From bd0a5b30f79c8608fb95663dda159844f444848d Mon Sep 17 00:00:00 2001 From: support Date: Mon, 21 Nov 2022 15:55:45 +0000 Subject: [PATCH] Built motion from commit 22695764.|2.6.22 --- 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/migrations/2.6.22.js | 7 ++++++- 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 +- 1204 files changed, 1209 insertions(+), 1204 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 691e9c0..6ef4e82 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-11-21T08:43:43.389Z", + "time": "2022-11-21T15:47:29.376Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9c29ac5..c2f3e7b 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-21T08:43:43.389Z", + "time": "2022-11-21T15:47:29.376Z", "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 ddbec26..dfc966c 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 _0x1eba=['TEXT','urlForward[body]','sequelize','VIRTUAL','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x381372,_0xf0a5a){var _0x4e959a=function(_0x25a897){while(--_0x25a897){_0x381372['push'](_0x381372['shift']());}};_0x4e959a(++_0xf0a5a);}(_0x1eba,0xda));var _0xa1eb=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x1eba[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1eb('0x1')],'get':function(_0x114b71){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xa1eb('0x3'),_0xa1eb('0x4'),_0xa1eb('0x5'),_0xa1eb('0x6'),_0xa1eb('0x7'),_0xa1eb('0x8'),_0xa1eb('0x9')]],'msg':_0xa1eb('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](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[_0xa1eb('0x2')](0x1000),'comment':_0xa1eb('0xb')},'data3':{'type':Sequelize[_0xa1eb('0x2')](0x1000),'comment':_0xa1eb('0xc')},'data4':{'type':Sequelize[_0xa1eb('0x2')](0x1000),'comments':_0xa1eb('0xd')},'data5':{'type':Sequelize[_0xa1eb('0x2')](0x1000),'comments':_0xa1eb('0xe')},'data6':{'type':Sequelize[_0xa1eb('0x2')],'comments':_0xa1eb('0xf')},'data7':{'type':Sequelize[_0xa1eb('0x10')],'comments':_0xa1eb('0x11')}}; \ No newline at end of file +var _0x4fef=['TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x2f70b6,_0x4b7db6){var _0x77a5b0=function(_0x3778e0){while(--_0x3778e0){_0x2f70b6['push'](_0x2f70b6['shift']());}};_0x77a5b0(++_0x4b7db6);}(_0x4fef,0x1dd));var _0xf4fe=function(_0x4bdc99,_0xa77058){_0x4bdc99=_0x4bdc99-0x0;var _0xc320f7=_0x4fef[_0x4bdc99];return _0xc320f7;};'use strict';var Sequelize=require(_0xf4fe('0x0'));module[_0xf4fe('0x1')]={'name':{'type':Sequelize[_0xf4fe('0x2')],'get':function(_0x3ce3eb){return this['getDataValue'](_0xf4fe('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf4fe('0x4'),_0xf4fe('0x5'),_0xf4fe('0x6'),_0xf4fe('0x7'),'urlForward',_0xf4fe('0x8'),'bot',_0xf4fe('0x9')]],'msg':_0xf4fe('0xa')}},'comment':_0xf4fe('0xa')},'data1':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comment':_0xf4fe('0xc')},'data2':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comment':_0xf4fe('0xd')},'data3':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comment':_0xf4fe('0xe')},'data4':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comments':_0xf4fe('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0xf4fe('0x10')},'data7':{'type':Sequelize[_0xf4fe('0x11')],'comments':_0xf4fe('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 2f99bb3..c56623b 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 _0xbd24=['send','body','Action','find','params','catch','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','destroy','then','stack','name'];(function(_0x14d97c,_0x4a7140){var _0x1e011f=function(_0x4ce24e){while(--_0x4ce24e){_0x14d97c['push'](_0x14d97c['shift']());}};_0x1e011f(++_0x4a7140);}(_0xbd24,0x1ce));var _0x4bd2=function(_0x4413cf,_0x3f70e8){_0x4413cf=_0x4413cf-0x0;var _0x9a1479=_0xbd24[_0x4413cf];return _0x9a1479;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4bd2('0x0'));var rp=require(_0x4bd2('0x1'));var moment=require(_0x4bd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4bd2('0x3'));var util=require(_0x4bd2('0x4'));var path=require(_0x4bd2('0x5'));var sox=require(_0x4bd2('0x6'));var csv=require(_0x4bd2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bd2('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4bd2('0x9'));var authService=require('../../components/auth/service');var qs=require(_0x4bd2('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4bd2('0xb'))(_0x4bd2('0xc'));var utils=require(_0x4bd2('0xd'));var config=require(_0x4bd2('0xe'));var licenseUtil=require(_0x4bd2('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x360c89,_0xa4ca4a){_0xa4ca4a=_0xa4ca4a||0xcc;return function(_0xaeab7a){if(_0xaeab7a){return _0x360c89['sendStatus'](_0xa4ca4a);}return _0x360c89['status'](_0xa4ca4a)[_0x4bd2('0x10')]();};}function respondWithResult(_0x1e1ef4,_0xcf2506){_0xcf2506=_0xcf2506||0xc8;return function(_0x598779){if(_0x598779){return _0x1e1ef4['status'](_0xcf2506)[_0x4bd2('0x11')](_0x598779);}};}function respondWithFilteredResult(_0x2b63be,_0x574309){return function(_0xef35f2){if(_0xef35f2){var _0x2dda66=typeof _0x574309['offset']===_0x4bd2('0x12')&&typeof _0x574309[_0x4bd2('0x13')]===_0x4bd2('0x12');var _0x13ad24=_0xef35f2[_0x4bd2('0x14')];var _0x30d408=_0x2dda66?0x0:_0x574309[_0x4bd2('0x15')];var _0x47ee32=_0x2dda66?_0xef35f2['count']:_0x574309[_0x4bd2('0x15')]+_0x574309[_0x4bd2('0x13')];var _0x4b58c5;if(_0x47ee32>=_0x13ad24){_0x47ee32=_0x13ad24;_0x4b58c5=0xc8;}else{_0x4b58c5=0xce;}_0x2b63be[_0x4bd2('0x16')](_0x4b58c5);return _0x2b63be[_0x4bd2('0x17')](_0x4bd2('0x18'),_0x30d408+'-'+_0x47ee32+'/'+_0x13ad24)[_0x4bd2('0x11')](_0xef35f2);}return null;};}function patchUpdates(_0x179213){return function(_0x74a4fb){try{jsonpatch['apply'](_0x74a4fb,_0x179213,!![]);}catch(_0x337d3c){return BPromise[_0x4bd2('0x19')](_0x337d3c);}return _0x74a4fb[_0x4bd2('0x1a')]();};}function saveUpdates(_0x49ff9e,_0x2f0b90){return function(_0x26c7d5){if(_0x26c7d5){return _0x26c7d5[_0x4bd2('0x1b')](_0x49ff9e)['then'](function(_0x4539cd){return _0x4539cd;});}return null;};}function removeEntity(_0x2468f1,_0x1d18a1){return function(_0x59b8c4){if(_0x59b8c4){return _0x59b8c4[_0x4bd2('0x1c')]()[_0x4bd2('0x1d')](function(){_0x2468f1[_0x4bd2('0x16')](0xcc)[_0x4bd2('0x10')]();});}};}function handleEntityNotFound(_0x1994ca,_0x47d5b0){return function(_0x1e6e82){if(!_0x1e6e82){_0x1994ca['sendStatus'](0x194);}return _0x1e6e82;};}function handleError(_0x1d513b,_0x2bc6c0){_0x2bc6c0=_0x2bc6c0||0x1f4;return function(_0x4d0bbb){logger['error'](_0x4d0bbb[_0x4bd2('0x1e')]);if(_0x4d0bbb[_0x4bd2('0x1f')]){delete _0x4d0bbb[_0x4bd2('0x1f')];}_0x1d513b[_0x4bd2('0x16')](_0x2bc6c0)[_0x4bd2('0x20')](_0x4d0bbb);};}exports['update']=function(_0x18e015,_0x53b134){if(_0x18e015[_0x4bd2('0x21')]['id']){delete _0x18e015[_0x4bd2('0x21')]['id'];}return db[_0x4bd2('0x22')][_0x4bd2('0x23')]({'where':{'id':_0x18e015[_0x4bd2('0x24')]['id']}})['then'](handleEntityNotFound(_0x53b134,null))[_0x4bd2('0x1d')](saveUpdates(_0x18e015[_0x4bd2('0x21')],null))[_0x4bd2('0x1d')](respondWithResult(_0x53b134,null))[_0x4bd2('0x25')](handleError(_0x53b134,null));};exports[_0x4bd2('0x1c')]=function(_0x58f4fb,_0x1c9ad8){return db[_0x4bd2('0x22')][_0x4bd2('0x23')]({'where':{'id':_0x58f4fb['params']['id']}})[_0x4bd2('0x1d')](handleEntityNotFound(_0x1c9ad8,null))[_0x4bd2('0x1d')](removeEntity(_0x1c9ad8,null))[_0x4bd2('0x25')](handleError(_0x1c9ad8,null));}; \ No newline at end of file +var _0x034f=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','body','Action'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x034f,0x179));var _0xf034=function(_0x45dd9b,_0x35fa24){_0x45dd9b=_0x45dd9b-0x0;var _0x410941=_0x034f[_0x45dd9b];return _0x410941;};'use strict';var emlformat=require(_0xf034('0x0'));var rimraf=require(_0xf034('0x1'));var zipdir=require(_0xf034('0x2'));var jsonpatch=require(_0xf034('0x3'));var rp=require(_0xf034('0x4'));var moment=require('moment');var BPromise=require(_0xf034('0x5'));var Mustache=require(_0xf034('0x6'));var util=require(_0xf034('0x7'));var path=require(_0xf034('0x8'));var sox=require(_0xf034('0x9'));var csv=require('to-csv');var ejs=require(_0xf034('0xa'));var fs=require('fs');var fs_extra=require(_0xf034('0xb'));var _=require(_0xf034('0xc'));var squel=require(_0xf034('0xd'));var crypto=require(_0xf034('0xe'));var jsforce=require(_0xf034('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf034('0x10'));var querystring=require(_0xf034('0x11'));var Papa=require(_0xf034('0x12'));var Redis=require(_0xf034('0x13'));var authService=require(_0xf034('0x14'));var qs=require(_0xf034('0x15'));var as=require(_0xf034('0x16'));var hardwareService=require(_0xf034('0x17'));var logger=require('../../config/logger')(_0xf034('0x18'));var utils=require(_0xf034('0x19'));var config=require(_0xf034('0x1a'));var licenseUtil=require(_0xf034('0x1b'));var db=require(_0xf034('0x1c'))['db'];function respondWithStatusCode(_0x4631c2,_0xd4f5d){_0xd4f5d=_0xd4f5d||0xcc;return function(_0x14c563){if(_0x14c563){return _0x4631c2[_0xf034('0x1d')](_0xd4f5d);}return _0x4631c2['status'](_0xd4f5d)[_0xf034('0x1e')]();};}function respondWithResult(_0x446aae,_0x1fc133){_0x1fc133=_0x1fc133||0xc8;return function(_0x40df00){if(_0x40df00){return _0x446aae[_0xf034('0x1f')](_0x1fc133)[_0xf034('0x20')](_0x40df00);}};}function respondWithFilteredResult(_0x5d20b8,_0x4e5044){return function(_0x113a32){if(_0x113a32){var _0x33cd3d=typeof _0x4e5044[_0xf034('0x21')]==='undefined'&&typeof _0x4e5044[_0xf034('0x22')]==='undefined';var _0x2b1f7e=_0x113a32[_0xf034('0x23')];var _0x194eb7=_0x33cd3d?0x0:_0x4e5044[_0xf034('0x21')];var _0x50e8e3=_0x33cd3d?_0x113a32[_0xf034('0x23')]:_0x4e5044['offset']+_0x4e5044['limit'];var _0x2bd3bc;if(_0x50e8e3>=_0x2b1f7e){_0x50e8e3=_0x2b1f7e;_0x2bd3bc=0xc8;}else{_0x2bd3bc=0xce;}_0x5d20b8[_0xf034('0x1f')](_0x2bd3bc);return _0x5d20b8[_0xf034('0x24')](_0xf034('0x25'),_0x194eb7+'-'+_0x50e8e3+'/'+_0x2b1f7e)[_0xf034('0x20')](_0x113a32);}return null;};}function patchUpdates(_0x1be8a9){return function(_0x38f93a){try{jsonpatch[_0xf034('0x26')](_0x38f93a,_0x1be8a9,!![]);}catch(_0x5126e0){return BPromise[_0xf034('0x27')](_0x5126e0);}return _0x38f93a[_0xf034('0x28')]();};}function saveUpdates(_0x111e32,_0x57fd78){return function(_0x21b8b1){if(_0x21b8b1){return _0x21b8b1[_0xf034('0x29')](_0x111e32)[_0xf034('0x2a')](function(_0x1ddccc){return _0x1ddccc;});}return null;};}function removeEntity(_0x2990da,_0x323349){return function(_0x296940){if(_0x296940){return _0x296940['destroy']()[_0xf034('0x2a')](function(){_0x2990da['status'](0xcc)[_0xf034('0x1e')]();});}};}function handleEntityNotFound(_0x3ccb9,_0xad0cbb){return function(_0x17ac34){if(!_0x17ac34){_0x3ccb9[_0xf034('0x1d')](0x194);}return _0x17ac34;};}function handleError(_0x443122,_0x378a2d){_0x378a2d=_0x378a2d||0x1f4;return function(_0x332f91){logger['error'](_0x332f91[_0xf034('0x2b')]);if(_0x332f91['name']){delete _0x332f91['name'];}_0x443122[_0xf034('0x1f')](_0x378a2d)['send'](_0x332f91);};}exports[_0xf034('0x29')]=function(_0x2764c6,_0x350b91){if(_0x2764c6[_0xf034('0x2c')]['id']){delete _0x2764c6[_0xf034('0x2c')]['id'];}return db[_0xf034('0x2d')][_0xf034('0x2e')]({'where':{'id':_0x2764c6['params']['id']}})['then'](handleEntityNotFound(_0x350b91,null))[_0xf034('0x2a')](saveUpdates(_0x2764c6[_0xf034('0x2c')],null))[_0xf034('0x2a')](respondWithResult(_0x350b91,null))['catch'](handleError(_0x350b91,null));};exports['destroy']=function(_0x7ddbe,_0x10b4d8){return db[_0xf034('0x2d')][_0xf034('0x2e')]({'where':{'id':_0x7ddbe['params']['id']}})['then'](handleEntityNotFound(_0x10b4d8,null))['then'](removeEntity(_0x10b4d8,null))['catch'](handleError(_0x10b4d8,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6916601..da0be4a 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 _0x5e03=['rimraf','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x4a8905,_0xb02e55){var _0x23d1f7=function(_0x525cf8){while(--_0x525cf8){_0x4a8905['push'](_0x4a8905['shift']());}};_0x23d1f7(++_0xb02e55);}(_0x5e03,0x192));var _0x35e0=function(_0x11b5b4,_0x26c396){_0x11b5b4=_0x11b5b4-0x0;var _0x4424e8=_0x5e03[_0x11b5b4];return _0x4424e8;};'use strict';var _=require('lodash');var util=require(_0x35e0('0x0'));var logger=require(_0x35e0('0x1'))(_0x35e0('0x2'));var moment=require(_0x35e0('0x3'));var BPromise=require(_0x35e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x35e0('0x6'));module[_0x35e0('0x7')]=function(_0x1a0687,_0x982db6){return _0x1a0687[_0x35e0('0x8')](_0x35e0('0x9'),attributes,{'tableName':_0x35e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaeff=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','../../config/logger','api','moment'];(function(_0x992a7a,_0x47c106){var _0x16b3bf=function(_0x1064d0){while(--_0x1064d0){_0x992a7a['push'](_0x992a7a['shift']());}};_0x16b3bf(++_0x47c106);}(_0xaeff,0x71));var _0xfaef=function(_0x44a56b,_0x40cab5){_0x44a56b=_0x44a56b-0x0;var _0x3eba36=_0xaeff[_0x44a56b];return _0x3eba36;};'use strict';var _=require(_0xfaef('0x0'));var util=require('util');var logger=require(_0xfaef('0x1'))(_0xfaef('0x2'));var moment=require(_0xfaef('0x3'));var BPromise=require(_0xfaef('0x4'));var rp=require(_0xfaef('0x5'));var fs=require('fs');var path=require(_0xfaef('0x6'));var rimraf=require(_0xfaef('0x7'));var config=require(_0xfaef('0x8'));var attributes=require('./action.attributes');module[_0xfaef('0x9')]=function(_0x13850f,_0x493beb){return _0x13850f[_0xfaef('0xa')](_0xfaef('0xb'),attributes,{'tableName':_0xfaef('0xc'),'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 af2a50c..941102e 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x5fab,0x177));var _0xb5fa=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x5fab[_0x2c5255];return _0x30d0ea;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x413e23,_0x4c8289){var _0x5cab0c=function(_0x97dc9c){while(--_0x97dc9c){_0x413e23['push'](_0x413e23['shift']());}};_0x5cab0c(++_0x4c8289);}(_0x326f,0xd1));var _0xf326=function(_0x5bcd71,_0x2c7c7f){_0x5bcd71=_0x5bcd71-0x0;var _0x60b542=_0x326f[_0x5bcd71];return _0x60b542;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 4e8f6cf..ce5dc5f 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 _0x5e38=['isAuthenticated','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id'];(function(_0x2d4ebd,_0x4d8b0d){var _0x399d0f=function(_0x588728){while(--_0x588728){_0x2d4ebd['push'](_0x2d4ebd['shift']());}};_0x399d0f(++_0x4d8b0d);}(_0x5e38,0x1b2));var _0x85e3=function(_0x443605,_0x17c563){_0x443605=_0x443605-0x0;var _0x252c9e=_0x5e38[_0x443605];return _0x252c9e;};'use strict';var multer=require('multer');var util=require(_0x85e3('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x85e3('0x1'));var router=express['Router']();var fs_extra=require(_0x85e3('0x2'));var auth=require(_0x85e3('0x3'));var interaction=require(_0x85e3('0x4'));var config=require(_0x85e3('0x5'));var controller=require(_0x85e3('0x6'));router['put'](_0x85e3('0x7'),auth[_0x85e3('0x8')](),controller[_0x85e3('0x9')]);router[_0x85e3('0xa')](_0x85e3('0x7'),auth[_0x85e3('0x8')](),controller[_0x85e3('0xb')]);module[_0x85e3('0xc')]=router; \ No newline at end of file +var _0x5ae4=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x5a37f2,_0x41611a){var _0x28ab89=function(_0x138f5c){while(--_0x138f5c){_0x5a37f2['push'](_0x5a37f2['shift']());}};_0x28ab89(++_0x41611a);}(_0x5ae4,0xb1));var _0x45ae=function(_0x362f26,_0x5ce460){_0x362f26=_0x362f26-0x0;var _0x324fb7=_0x5ae4[_0x362f26];return _0x324fb7;};'use strict';var multer=require('multer');var util=require(_0x45ae('0x0'));var path=require(_0x45ae('0x1'));var timeout=require(_0x45ae('0x2'));var express=require('express');var router=express[_0x45ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x45ae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x45ae('0x5'));var controller=require(_0x45ae('0x6'));router[_0x45ae('0x7')](_0x45ae('0x8'),auth[_0x45ae('0x9')](),controller['update']);router['delete'](_0x45ae('0x8'),auth[_0x45ae('0x9')](),controller['destroy']);module[_0x45ae('0xa')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index c18fc5d..0d57528 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x2ef644,_0x2ab0ff){var _0x11f00e=function(_0x32983a){while(--_0x32983a){_0x2ef644['push'](_0x2ef644['shift']());}};_0x11f00e(++_0x2ab0ff);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2eb2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x49887f,_0x5a025e){var _0x289ab8=function(_0xe6de34){while(--_0xe6de34){_0x49887f['push'](_0x49887f['shift']());}};_0x289ab8(++_0x5a025e);}(_0xeec6,0x1c2));var _0x6eec=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0xeec6[_0x39f097];return _0x544f6a;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 03a20a2..1b279da 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 _0xbcfc=['COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','operator','Please\x20insert\x20at\x20least\x20one\x20field','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','save','get','UserProfileResource','destroy','then','end','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','limit','order','where','filters','pick','filter','merge','options','include','findAll','catch','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join'];(function(_0x1e9b13,_0x78c34b){var _0x27254f=function(_0x3aa64d){while(--_0x3aa64d){_0x1e9b13['push'](_0x1e9b13['shift']());}};_0x27254f(++_0x78c34b);}(_0xbcfc,0x162));var _0xcbcf=function(_0x2ea71a,_0x4988d0){_0x2ea71a=_0x2ea71a-0x0;var _0xf4729a=_0xbcfc[_0x2ea71a];return _0xf4729a;};'use strict';var emlformat=require(_0xcbcf('0x0'));var rimraf=require(_0xcbcf('0x1'));var zipdir=require(_0xcbcf('0x2'));var jsonpatch=require(_0xcbcf('0x3'));var rp=require('request-promise');var moment=require(_0xcbcf('0x4'));var BPromise=require(_0xcbcf('0x5'));var Mustache=require(_0xcbcf('0x6'));var util=require(_0xcbcf('0x7'));var path=require(_0xcbcf('0x8'));var sox=require('sox');var csv=require(_0xcbcf('0x9'));var ejs=require(_0xcbcf('0xa'));var fs=require('fs');var fs_extra=require(_0xcbcf('0xb'));var _=require(_0xcbcf('0xc'));var squel=require('squel');var crypto=require(_0xcbcf('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbcf('0x9'));var querystring=require(_0xcbcf('0xe'));var Papa=require(_0xcbcf('0xf'));var Redis=require(_0xcbcf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcbcf('0x11'));var as=require(_0xcbcf('0x12'));var hardwareService=require(_0xcbcf('0x13'));var logger=require('../../config/logger')(_0xcbcf('0x14'));var utils=require(_0xcbcf('0x15'));var config=require(_0xcbcf('0x16'));var licenseUtil=require(_0xcbcf('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0xcbcf('0x18'))['dbH'];function respondWithStatusCode(_0x1988d4,_0x364e75){_0x364e75=_0x364e75||0xcc;return function(_0x360687){if(_0x360687){return _0x1988d4[_0xcbcf('0x19')](_0x364e75);}return _0x1988d4[_0xcbcf('0x1a')](_0x364e75)['end']();};}function respondWithResult(_0x5a1d44,_0xb2aaa5){_0xb2aaa5=_0xb2aaa5||0xc8;return function(_0x3a9bd3){if(_0x3a9bd3){return _0x5a1d44[_0xcbcf('0x1a')](_0xb2aaa5)['json'](_0x3a9bd3);}};}function respondWithFilteredResult(_0x2d7ca5,_0x9bef50){return function(_0xc2a7e9){if(_0xc2a7e9){var _0x4a6a15=typeof _0x9bef50[_0xcbcf('0x1b')]===_0xcbcf('0x1c')&&typeof _0x9bef50['limit']===_0xcbcf('0x1c');var _0x263d4f=_0xc2a7e9[_0xcbcf('0x1d')];var _0x487749=_0x4a6a15?0x0:_0x9bef50[_0xcbcf('0x1b')];var _0x283292=_0x4a6a15?_0xc2a7e9['count']:_0x9bef50[_0xcbcf('0x1b')]+_0x9bef50['limit'];var _0x536dbc;if(_0x283292>=_0x263d4f){_0x283292=_0x263d4f;_0x536dbc=0xc8;}else{_0x536dbc=0xce;}_0x2d7ca5['status'](_0x536dbc);return _0x2d7ca5['set'](_0xcbcf('0x1e'),_0x487749+'-'+_0x283292+'/'+_0x263d4f)[_0xcbcf('0x1f')](_0xc2a7e9);}return null;};}function patchUpdates(_0x37b661){return function(_0x1d0b96){try{jsonpatch[_0xcbcf('0x20')](_0x1d0b96,_0x37b661,!![]);}catch(_0xb8511e){return BPromise['reject'](_0xb8511e);}return _0x1d0b96[_0xcbcf('0x21')]();};}function saveUpdates(_0x49cf2f,_0x33f0b1){return function(_0x53843c){if(_0x53843c){return _0x53843c['update'](_0x49cf2f)['then'](function(_0x3c371f){return _0x3c371f;});}return null;};}function removeEntity(_0x14372b,_0x13c442){return function(_0x148eec){if(_0x148eec){return _0x148eec['destroy']()['then'](function(){var _0x1463d1=_0x148eec[_0xcbcf('0x22')]({'plain':!![]});var _0xb0fbc1='CustomReports';return db[_0xcbcf('0x23')][_0xcbcf('0x24')]({'where':{'type':_0xb0fbc1,'resourceId':_0x1463d1['id']}})[_0xcbcf('0x25')](function(){return _0x148eec;});})['then'](function(){_0x14372b['status'](0xcc)[_0xcbcf('0x26')]();});}};}function handleEntityNotFound(_0x1c251f,_0x171655){return function(_0x4818aa){if(!_0x4818aa){_0x1c251f[_0xcbcf('0x19')](0x194);}return _0x4818aa;};}function handleError(_0x2b7ee2,_0x29009c){_0x29009c=_0x29009c||0x1f4;return function(_0x92a7b4){logger[_0xcbcf('0x27')](_0x92a7b4[_0xcbcf('0x28')]);if(_0x92a7b4[_0xcbcf('0x29')]){delete _0x92a7b4[_0xcbcf('0x29')];}_0x2b7ee2[_0xcbcf('0x1a')](_0x29009c)[_0xcbcf('0x2a')](_0x92a7b4);};}exports['index']=function(_0x3dd650,_0x304227){var _0x2d5546={},_0xe6179e={},_0x333f2f={'count':0x0,'rows':[]};var _0x3de8b0=_['map'](db[_0xcbcf('0x2b')][_0xcbcf('0x2c')],function(_0x3304af){return{'name':_0x3304af[_0xcbcf('0x2d')],'type':_0x3304af[_0xcbcf('0x2e')][_0xcbcf('0x2f')]};});_0xe6179e['model']=_[_0xcbcf('0x30')](_0x3de8b0,_0xcbcf('0x29'));_0xe6179e['query']=_['keys'](_0x3dd650[_0xcbcf('0x31')]);_0xe6179e['filters']=_[_0xcbcf('0x32')](_0xe6179e[_0xcbcf('0x33')],_0xe6179e[_0xcbcf('0x31')]);_0x2d5546[_0xcbcf('0x34')]=_['intersection'](_0xe6179e[_0xcbcf('0x33')],qs['fields'](_0x3dd650[_0xcbcf('0x31')][_0xcbcf('0x35')]));_0x2d5546[_0xcbcf('0x34')]=_0x2d5546[_0xcbcf('0x34')][_0xcbcf('0x36')]?_0x2d5546[_0xcbcf('0x34')]:_0xe6179e[_0xcbcf('0x33')];if(!_0x3dd650[_0xcbcf('0x31')]['hasOwnProperty']('nolimit')){_0x2d5546['limit']=qs[_0xcbcf('0x37')](_0x3dd650['query'][_0xcbcf('0x37')]);_0x2d5546['offset']=qs[_0xcbcf('0x1b')](_0x3dd650[_0xcbcf('0x31')]['offset']);}_0x2d5546[_0xcbcf('0x38')]=qs['sort'](_0x3dd650[_0xcbcf('0x31')]['sort']);_0x2d5546[_0xcbcf('0x39')]=qs[_0xcbcf('0x3a')](_[_0xcbcf('0x3b')](_0x3dd650[_0xcbcf('0x31')],_0xe6179e[_0xcbcf('0x3a')]),_0x3de8b0);if(_0x3dd650[_0xcbcf('0x31')][_0xcbcf('0x3c')]){_0x2d5546[_0xcbcf('0x39')]=_[_0xcbcf('0x3d')](_0x2d5546['where'],{'$or':_[_0xcbcf('0x30')](_0x3de8b0,function(_0x37a51e){if(_0x37a51e['type']!=='VIRTUAL'){var _0x44c27f={};_0x44c27f[_0x37a51e[_0xcbcf('0x29')]]={'$like':'%'+_0x3dd650[_0xcbcf('0x31')][_0xcbcf('0x3c')]+'%'};return _0x44c27f;}})});}_0x2d5546=_[_0xcbcf('0x3d')]({},_0x2d5546,_0x3dd650[_0xcbcf('0x3e')]);var _0x4914e3={'where':_0x2d5546[_0xcbcf('0x39')]};return db['AnalyticCustomReport'][_0xcbcf('0x1d')](_0x4914e3)['then'](function(_0x3c6ba5){_0x333f2f[_0xcbcf('0x1d')]=_0x3c6ba5;if(_0x3dd650[_0xcbcf('0x31')]['includeAll']){_0x2d5546[_0xcbcf('0x3f')]=[{'all':!![]}];}return db[_0xcbcf('0x2b')][_0xcbcf('0x40')](_0x2d5546);})[_0xcbcf('0x25')](function(_0x24c5f2){_0x333f2f['rows']=_0x24c5f2;return _0x333f2f;})[_0xcbcf('0x25')](respondWithFilteredResult(_0x304227,_0x2d5546))[_0xcbcf('0x41')](handleError(_0x304227,null));};exports[_0xcbcf('0x42')]=function(_0xb5a613,_0x44e1d0){var _0x10bd81={'raw':![],'where':{'id':_0xb5a613[_0xcbcf('0x43')]['id']}},_0x331751={};_0x331751['model']=_[_0xcbcf('0x44')](db['AnalyticCustomReport'][_0xcbcf('0x2c')]);_0x331751[_0xcbcf('0x31')]=_[_0xcbcf('0x44')](_0xb5a613[_0xcbcf('0x31')]);_0x331751[_0xcbcf('0x3a')]=_[_0xcbcf('0x32')](_0x331751[_0xcbcf('0x33')],_0x331751['query']);_0x10bd81['attributes']=_[_0xcbcf('0x32')](_0x331751[_0xcbcf('0x33')],qs[_0xcbcf('0x35')](_0xb5a613[_0xcbcf('0x31')][_0xcbcf('0x35')]));_0x10bd81[_0xcbcf('0x34')]=_0x10bd81['attributes'][_0xcbcf('0x36')]?_0x10bd81[_0xcbcf('0x34')]:_0x331751[_0xcbcf('0x33')];if(_0xb5a613[_0xcbcf('0x31')][_0xcbcf('0x45')]){_0x10bd81[_0xcbcf('0x3f')]=[{'all':!![]}];}_0x10bd81=_['merge']({},_0x10bd81,_0xb5a613[_0xcbcf('0x3e')]);return db['AnalyticCustomReport']['find'](_0x10bd81)[_0xcbcf('0x25')](handleEntityNotFound(_0x44e1d0,null))[_0xcbcf('0x25')](respondWithResult(_0x44e1d0,null))[_0xcbcf('0x41')](handleError(_0x44e1d0,null));};exports[_0xcbcf('0x46')]=function(_0xf6902c,_0x2f663d){return db[_0xcbcf('0x2b')]['create'](_0xf6902c[_0xcbcf('0x47')],{})[_0xcbcf('0x25')](function(_0x1bc5ca){var _0x431d7a=_0xf6902c[_0xcbcf('0x48')][_0xcbcf('0x22')]({'plain':!![]});if(!_0x431d7a)throw new Error(_0xcbcf('0x49'));if(_0x431d7a[_0xcbcf('0x4a')]==='user'){var _0x1b7f97=_0x1bc5ca[_0xcbcf('0x22')]({'plain':!![]});var _0x3bce80=_0xcbcf('0x4b');return db[_0xcbcf('0x4c')][_0xcbcf('0x4d')]({'where':{'name':_0x3bce80,'userProfileId':_0x431d7a[_0xcbcf('0x4e')]},'raw':!![]})[_0xcbcf('0x25')](function(_0x3a4f01){if(_0x3a4f01&&_0x3a4f01[_0xcbcf('0x4f')]===0x0){return db[_0xcbcf('0x23')][_0xcbcf('0x46')]({'name':_0x1b7f97[_0xcbcf('0x29')],'resourceId':_0x1b7f97['id'],'type':_0xcbcf('0x50'),'sectionId':_0x3a4f01['id']},{})[_0xcbcf('0x25')](function(){return _0x1bc5ca;});}else{return _0x1bc5ca;}})[_0xcbcf('0x41')](function(_0x9d0027){logger['error'](_0xcbcf('0x51'),_0x9d0027);throw _0x9d0027;});}return _0x1bc5ca;})[_0xcbcf('0x25')](respondWithResult(_0x2f663d,0xc9))[_0xcbcf('0x41')](handleError(_0x2f663d,null));};exports[_0xcbcf('0x52')]=function(_0x359354,_0x381b91){if(_0x359354[_0xcbcf('0x47')]['id']){delete _0x359354[_0xcbcf('0x47')]['id'];}return db['AnalyticCustomReport'][_0xcbcf('0x4d')]({'where':{'id':_0x359354['params']['id']}})['then'](handleEntityNotFound(_0x381b91,null))[_0xcbcf('0x25')](saveUpdates(_0x359354[_0xcbcf('0x47')],null))[_0xcbcf('0x25')](respondWithResult(_0x381b91,null))[_0xcbcf('0x41')](handleError(_0x381b91,null));};exports['destroy']=function(_0x40cf6b,_0xe94123){return db[_0xcbcf('0x2b')][_0xcbcf('0x4d')]({'where':{'id':_0x40cf6b['params']['id']}})['then'](handleEntityNotFound(_0xe94123,null))[_0xcbcf('0x25')](removeEntity(_0xe94123,null))[_0xcbcf('0x41')](handleError(_0xe94123,null));};exports[_0xcbcf('0x53')]=function(_0xe8760e,_0x57fc84){var _0x4c0226=0xa;var _0x5d2558=[_0xcbcf('0x54'),_0xcbcf('0x55'),'right_join',_0xcbcf('0x56')];var _0xe58dd2={'SUM':_0xcbcf('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcbcf('0x58'),'MAX':'MAX(%s)','MIN':_0xcbcf('0x59'),'AVG':_0xcbcf('0x5a'),'GROUP_CONCAT':_0xcbcf('0x5b'),'GROUP_CONCAT ASC':_0xcbcf('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c446c={'SEC_TO_TIME':_0xcbcf('0x5d'),'DATE':_0xcbcf('0x5e'),'HOUR':_0xcbcf('0x5f'),'ROUND':_0xcbcf('0x60'),'UNIX_TIMESTAMP':_0xcbcf('0x61')};var _0x363cae=function(_0x532b1d){return!_[_0xcbcf('0x62')]([_0xcbcf('0x63'),_0xcbcf('0x64'),_0xcbcf('0x65'),_0xcbcf('0x66')],_0x532b1d);};var _0x5b8cec=function(_0x584eb9){if(!_0x584eb9||!_0x584eb9[_0xcbcf('0x67')][_0xcbcf('0x36')]){return'';}for(var _0x25f7da='(',_0x8370fb=0x0;_0x8370fb<_0x584eb9[_0xcbcf('0x67')][_0xcbcf('0x36')];_0x8370fb+=0x1){_0x8370fb>0x0&&(_0x25f7da+='\x20'+_0x584eb9['operator']+'\x20');_0x25f7da+=_0x584eb9[_0xcbcf('0x67')][_0x8370fb]['group']?_0x5b8cec(_0x584eb9[_0xcbcf('0x67')][_0x8370fb][_0xcbcf('0x68')]):_0x584eb9[_0xcbcf('0x67')][_0x8370fb][_0xcbcf('0x69')]+'\x20'+_0x584eb9[_0xcbcf('0x67')][_0x8370fb]['condition']+(_0x363cae(_0x584eb9[_0xcbcf('0x67')][_0x8370fb][_0xcbcf('0x6a')])?'\x20'+_0x584eb9['rules'][_0x8370fb][_0xcbcf('0x6b')]:'');}return _0x25f7da+')';};var _0x3b116e={'where':{'id':_0xe8760e[_0xcbcf('0x43')]['id']}},_0x5b90f5,_0xcaa541,_0x3dc1f2,_0x843c8c,_0x4f06ae;_0x3b116e=_['merge']({},_0x3b116e,_0xe8760e[_0xcbcf('0x3e')]);return db[_0xcbcf('0x2b')][_0xcbcf('0x4d')](_0x3b116e)[_0xcbcf('0x25')](function(_0x227087){if(_0x227087){_0x5b90f5=_0x227087;return _0x227087[_0xcbcf('0x6c')]();}return null;})[_0xcbcf('0x25')](function(_0xd25c66){if(_0xd25c66){if(!_0xd25c66[_0xcbcf('0x36')]){throw new db[(_0xcbcf('0x6d'))][(_0xcbcf('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xcaa541=_0xd25c66;return db[_0xcbcf('0x6f')][_0xcbcf('0x40')]({'raw':!![]});}return null;})[_0xcbcf('0x25')](function(_0x178045){if(_0x178045){_0x3dc1f2=_[_0xcbcf('0x70')](_0x178045,'id');var _0x458759;var _0x4a589a=squel[_0xcbcf('0x71')]();_0x4a589a[_0xcbcf('0x72')](_0x5b90f5[_0xcbcf('0x73')]);for(var _0x316052=0x0;_0x316052<_0xcaa541[_0xcbcf('0x36')];_0x316052+=0x1){_0x458759=_0xcaa541[_0x316052][_0xcbcf('0x74')]?_0x3dc1f2[_0xcaa541[_0x316052][_0xcbcf('0x74')]]['metric']:_0xcaa541[_0x316052][_0xcbcf('0x69')];_0x458759=_0xcaa541[_0x316052][_0xcbcf('0x75')]?_[_0xcbcf('0x76')](_0xe58dd2[_0xcaa541[_0x316052]['function']],'%s',_0x458759):_0x458759;_0x458759=_0xcaa541[_0x316052]['format']?_[_0xcbcf('0x76')](_0x3c446c[_0xcaa541[_0x316052][_0xcbcf('0x77')]],'%s',_0x458759):_0x458759;if(_0xcaa541[_0x316052][_0xcbcf('0x78')]){_0x4a589a[_0xcbcf('0x68')](_0x458759);}_0xcaa541[_0x316052]['orderBy']&&_0x4a589a['order'](_0x458759,_0xcaa541[_0x316052][_0xcbcf('0x79')]===_0xcbcf('0x7a')?![]:!![]);_0x4a589a['field'](_0x458759,_0xcaa541[_0x316052][_0xcbcf('0x7b')]||_0x458759);}if(_0x5b90f5[_0xcbcf('0x7c')]){_0x5b90f5[_0xcbcf('0x7c')]=JSON['parse'](_0x5b90f5['joins']);for(var _0x17edad=0x0;_0x17edad<_0x5b90f5[_0xcbcf('0x7c')]['length'];_0x17edad+=0x1){if(_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x2e')]&&_[_0xcbcf('0x62')](_0x5d2558,_0x5b90f5[_0xcbcf('0x7c')][_0x17edad]['type'])&&_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7d')]&&_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7e')]&&_0x5b90f5[_0xcbcf('0x7c')][_0x17edad]['foreignKey']){_0x4a589a[_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x2e')]](_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7e')],null,util[_0xcbcf('0x77')](_0xcbcf('0x7f'),_0x5b90f5[_0xcbcf('0x73')],_0x5b90f5['joins'][_0x17edad]['parentKey'],_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7e')],_0x5b90f5['joins'][_0x17edad][_0xcbcf('0x80')]));}}}if(_0x5b90f5[_0xcbcf('0x81')]){_0x5b90f5['conditions']=JSON[_0xcbcf('0x82')](_0x5b90f5[_0xcbcf('0x81')]);_0x4a589a[_0xcbcf('0x39')](_0x5b8cec(_0x5b90f5[_0xcbcf('0x81')][_0xcbcf('0x68')]));}_0x4f06ae=_0x4a589a[_0xcbcf('0x83')]();_0x4a589a['limit'](_0x4c0226);_0x4a589a[_0xcbcf('0x1b')](0x0);logger[_0xcbcf('0x84')]('Limited\x20Query:',_0x4a589a[_0xcbcf('0x85')]());return dbH['sequelize'][_0xcbcf('0x31')](_0x4a589a['toString'](),{'type':dbH[_0xcbcf('0x86')][_0xcbcf('0x87')][_0xcbcf('0x88')]});}})[_0xcbcf('0x25')](respondWithResult(_0x57fc84,null))[_0xcbcf('0x41')](handleError(_0x57fc84,null));};function runReport(_0xc67c30,_0x45e27c,_0x561b34){var _0x3e2dec=_0x45e27c[_0xcbcf('0x29')];var _0x2503b2=0xa;var _0x25d7e6=[_0xcbcf('0x54'),_0xcbcf('0x55'),_0xcbcf('0x89'),_0xcbcf('0x56')];var _0x4214a1={'SUM':_0xcbcf('0x57'),'COUNT':_0xcbcf('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcbcf('0x8b'),'MIN':_0xcbcf('0x59'),'AVG':_0xcbcf('0x5a'),'GROUP_CONCAT':_0xcbcf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcbcf('0x8c')};var _0x4b2712={'SEC_TO_TIME':_0xcbcf('0x5d'),'DATE':_0xcbcf('0x5e'),'HOUR':_0xcbcf('0x5f'),'ROUND':_0xcbcf('0x60'),'UNIX_TIMESTAMP':_0xcbcf('0x61')};var _0x13722e=function(_0x3cab3f){return!_[_0xcbcf('0x62')]([_0xcbcf('0x63'),_0xcbcf('0x64'),_0xcbcf('0x65'),_0xcbcf('0x66')],_0x3cab3f);};var _0xfb4d5b=function(_0x4d06c1){if(!_0x4d06c1||!_0x4d06c1[_0xcbcf('0x67')][_0xcbcf('0x36')]){return'';}for(var _0x1134a8='(',_0x509826=0x0;_0x509826<_0x4d06c1['rules'][_0xcbcf('0x36')];_0x509826+=0x1){_0x509826>0x0&&(_0x1134a8+='\x20'+_0x4d06c1[_0xcbcf('0x8d')]+'\x20');_0x1134a8+=_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x68')]?_0xfb4d5b(_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x68')]):_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x69')]+'\x20'+_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x6a')]+(_0x13722e(_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x6a')])?'\x20'+_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x6b')]:'');}return _0x1134a8+')';};var _0x1b9241={'where':{'id':_0xc67c30['id']}},_0x48779f,_0x49e878,_0x3c512c,_0x5b7502,_0x4ba1fa;_0x1b9241=_[_0xcbcf('0x3d')]({},_0x1b9241,_0x561b34);return db[_0xcbcf('0x2b')][_0xcbcf('0x4d')](_0x1b9241)['then'](function(_0xa822e9){if(_0xa822e9){_0x48779f=_0xa822e9;return _0xa822e9[_0xcbcf('0x6c')]();}return null;})[_0xcbcf('0x25')](function(_0x27e3c6){if(_0x27e3c6){if(!_0x27e3c6[_0xcbcf('0x36')]){throw new db[(_0xcbcf('0x6d'))][(_0xcbcf('0x6e'))](_0xcbcf('0x8e'),0x193);}_0x49e878=_0x27e3c6;return db[_0xcbcf('0x6f')][_0xcbcf('0x40')]({'raw':!![]});}return null;})[_0xcbcf('0x25')](function(_0x359c02){if(_0x359c02){_0x3c512c=_[_0xcbcf('0x70')](_0x359c02,'id');var _0x5696f0;var _0x44e4e0=squel['select']();_0x44e4e0['from'](_0x48779f[_0xcbcf('0x73')]);for(var _0x105106=0x0;_0x105106<_0x49e878[_0xcbcf('0x36')];_0x105106+=0x1){_0x5696f0=_0x49e878[_0x105106][_0xcbcf('0x74')]?_0x3c512c[_0x49e878[_0x105106][_0xcbcf('0x74')]]['metric']:_0x49e878[_0x105106][_0xcbcf('0x69')];_0x5696f0=_0x49e878[_0x105106][_0xcbcf('0x75')]?_[_0xcbcf('0x76')](_0x4214a1[_0x49e878[_0x105106]['function']],'%s',_0x5696f0):_0x5696f0;_0x5696f0=_0x49e878[_0x105106]['format']?_[_0xcbcf('0x76')](_0x4b2712[_0x49e878[_0x105106][_0xcbcf('0x77')]],'%s',_0x5696f0):_0x5696f0;if(_0x49e878[_0x105106][_0xcbcf('0x78')]){_0x44e4e0[_0xcbcf('0x68')](_0x5696f0);}_0x49e878[_0x105106][_0xcbcf('0x79')]&&_0x44e4e0['order'](_0x5696f0,_0x49e878[_0x105106]['orderBy']===_0xcbcf('0x7a')?![]:!![]);_0x44e4e0[_0xcbcf('0x69')](_0x5696f0,_0x49e878[_0x105106]['alias']||_0x5696f0);}if(_0x48779f[_0xcbcf('0x7c')]){_0x48779f['joins']=JSON[_0xcbcf('0x82')](_0x48779f[_0xcbcf('0x7c')]);for(var _0x1b41e4=0x0;_0x1b41e4<_0x48779f['joins'][_0xcbcf('0x36')];_0x1b41e4+=0x1){if(_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x2e')]&&_[_0xcbcf('0x62')](_0x25d7e6,_0x48779f['joins'][_0x1b41e4]['type'])&&_0x48779f['joins'][_0x1b41e4][_0xcbcf('0x7d')]&&_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x7e')]&&_0x48779f['joins'][_0x1b41e4]['foreignKey']){_0x44e4e0[_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x2e')]](_0x48779f['joins'][_0x1b41e4][_0xcbcf('0x7e')],null,util[_0xcbcf('0x77')](_0xcbcf('0x7f'),_0x48779f['table'],_0x48779f[_0xcbcf('0x7c')][_0x1b41e4]['parentKey'],_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x7e')],_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x80')]));}}}if(_0x48779f[_0xcbcf('0x81')]){_0x48779f[_0xcbcf('0x81')]=JSON[_0xcbcf('0x82')](_0x48779f[_0xcbcf('0x81')]);_0x44e4e0[_0xcbcf('0x39')](_0xfb4d5b(_0x48779f['conditions']['group']));}_0x4ba1fa=_0x44e4e0[_0xcbcf('0x83')]();_0x44e4e0[_0xcbcf('0x37')](_0x2503b2);_0x44e4e0[_0xcbcf('0x1b')](0x0);return;}})[_0xcbcf('0x25')](function(){if(_0x45e27c[_0xcbcf('0x8f')]===_0xcbcf('0x90')){return null;}var _0x150388=_[_0xcbcf('0x3d')](_0x45e27c,{'name':_0x45e27c['fullPath']||_0x45e27c[_0xcbcf('0x29')]||_0x48779f[_0xcbcf('0x29')],'basename':_0x3e2dec,'savename':util['format']('%s-%s.%s',_0x45e27c['name']||_0x48779f['name'],require(_0xcbcf('0x91'))[_0xcbcf('0x92')](0x4),_0x45e27c[_0xcbcf('0x8f')]||_0xcbcf('0x93')),'reportId':_0x48779f['id'],'reportType':_0xcbcf('0x94')});return db[_0xcbcf('0x95')][_0xcbcf('0x46')](_0x150388,{'raw':!![]});})[_0xcbcf('0x25')](function(_0x506510){if(_0x48779f['table']===_0xcbcf('0x96')){_0x4ba1fa['where'](_0x48779f['table']+_0xcbcf('0x97'),_0x45e27c[_0xcbcf('0x98')],_0x45e27c[_0xcbcf('0x99')]);}else{_0x4ba1fa[_0xcbcf('0x39')](_0x48779f[_0xcbcf('0x73')]+_0xcbcf('0x9a'),_0x45e27c[_0xcbcf('0x98')],_0x45e27c[_0xcbcf('0x99')]);}if(_0x506510){logger['info'](_0xcbcf('0x9b'),_0x4ba1fa[_0xcbcf('0x85')]());require(_0xcbcf('0x9c'))[_0xcbcf('0x9d')](path[_0xcbcf('0x54')](__dirname,_0xcbcf('0x9e'),_0x506510[_0xcbcf('0x8f')]),[_0x506510['id'],_0x4ba1fa[_0xcbcf('0x85')](),path['join'](__dirname,_0xcbcf('0x9f'),_0x506510['savename']),_0x3e2dec]);return _0x506510;}else{var _0x41de32=squel[_0xcbcf('0x71')]();_0x41de32[_0xcbcf('0x72')]('('+_0x4ba1fa[_0xcbcf('0x85')]()+')',_0xcbcf('0xa0'));_0x41de32[_0xcbcf('0x69')]('COUNT(*)','count');_0x4ba1fa[_0xcbcf('0x37')](_0x45e27c['limit']||_0x2503b2);_0x4ba1fa['offset'](_0x45e27c[_0xcbcf('0x1b')]||0x0);return dbH[_0xcbcf('0x86')]['query'](_0x41de32[_0xcbcf('0x85')](),{'type':dbH['sequelize'][_0xcbcf('0x87')]['SELECT']})['then'](function(_0x3cc2a7){if(!_0x3cc2a7['length']){_0x5b7502=0x0;}else{_0x5b7502=_0x3cc2a7[0x0][_0xcbcf('0x1d')]||0x0;}return dbH['sequelize'][_0xcbcf('0x31')](_0x4ba1fa['toString'](),{'type':dbH[_0xcbcf('0x86')]['QueryTypes'][_0xcbcf('0x88')]});})[_0xcbcf('0x25')](function(_0xf09f40){return{'rows':_0xf09f40||[],'count':_0x5b7502};});}});}exports[_0xcbcf('0xa1')]=function(_0x1c6127,_0x49e778){return runReport(_0x1c6127['params'],_0x1c6127[_0xcbcf('0x31')],_0x1c6127[_0xcbcf('0x3e')])[_0xcbcf('0x25')](respondWithResult(_0x49e778,null))['catch'](handleError(_0x49e778,null));};exports[_0xcbcf('0xa2')]=runReport;exports['query']=function(_0x5155bb,_0x1837d7){var _0x4117d6=0xa;var _0xe8c040=['join','left_join',_0xcbcf('0x89'),_0xcbcf('0x56')];var _0x25704e={'SUM':_0xcbcf('0x57'),'COUNT':_0xcbcf('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcbcf('0x8b'),'MIN':_0xcbcf('0x59'),'AVG':_0xcbcf('0x5a'),'GROUP_CONCAT':_0xcbcf('0x5b'),'GROUP_CONCAT ASC':_0xcbcf('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2fc2a9={'SEC_TO_TIME':_0xcbcf('0x5d'),'DATE':_0xcbcf('0x5e'),'HOUR':_0xcbcf('0x5f'),'ROUND':_0xcbcf('0x60'),'UNIX_TIMESTAMP':_0xcbcf('0x61')};var _0x33d2e7=function(_0x2bf2a3){return!_['includes']([_0xcbcf('0x63'),_0xcbcf('0x64'),_0xcbcf('0x65'),_0xcbcf('0x66')],_0x2bf2a3);};var _0x45da11=function(_0x51f4c1){if(!_0x51f4c1||!_0x51f4c1[_0xcbcf('0x67')][_0xcbcf('0x36')]){return'';}for(var _0x705612='(',_0x44402d=0x0;_0x44402d<_0x51f4c1[_0xcbcf('0x67')][_0xcbcf('0x36')];_0x44402d+=0x1){_0x44402d>0x0&&(_0x705612+='\x20'+_0x51f4c1[_0xcbcf('0x8d')]+'\x20');_0x705612+=_0x51f4c1[_0xcbcf('0x67')][_0x44402d][_0xcbcf('0x68')]?_0x45da11(_0x51f4c1[_0xcbcf('0x67')][_0x44402d]['group']):_0x51f4c1[_0xcbcf('0x67')][_0x44402d][_0xcbcf('0x69')]+'\x20'+_0x51f4c1[_0xcbcf('0x67')][_0x44402d][_0xcbcf('0x6a')]+(_0x33d2e7(_0x51f4c1[_0xcbcf('0x67')][_0x44402d]['condition'])?'\x20'+_0x51f4c1[_0xcbcf('0x67')][_0x44402d]['value']:'');}return _0x705612+')';};var _0x58590c={'where':{'id':_0x5155bb[_0xcbcf('0x43')]['id']}},_0x33b957,_0x5c20df,_0x217ff1,_0x2c4e10,_0x4a5ec8;_0x58590c=_[_0xcbcf('0x3d')]({},_0x58590c,_0x5155bb['options']);return db[_0xcbcf('0x2b')]['find'](_0x58590c)['then'](function(_0x2cf0f8){if(_0x2cf0f8){_0x33b957=_0x2cf0f8;return _0x2cf0f8[_0xcbcf('0x6c')]();}return null;})[_0xcbcf('0x25')](function(_0x195794){if(_0x195794){if(!_0x195794[_0xcbcf('0x36')]){throw new db[(_0xcbcf('0x6d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5c20df=_0x195794;return db[_0xcbcf('0x6f')][_0xcbcf('0x40')]({'raw':!![]});}return null;})[_0xcbcf('0x25')](function(_0x5354cd){if(_0x5354cd){_0x217ff1=_[_0xcbcf('0x70')](_0x5354cd,'id');var _0x43eea6;var _0x560414=squel[_0xcbcf('0x71')]();_0x560414[_0xcbcf('0x72')](_0x33b957['table']);for(var _0x2dcd80=0x0;_0x2dcd80<_0x5c20df['length'];_0x2dcd80+=0x1){_0x43eea6=_0x5c20df[_0x2dcd80][_0xcbcf('0x74')]?_0x217ff1[_0x5c20df[_0x2dcd80][_0xcbcf('0x74')]]['metric']:_0x5c20df[_0x2dcd80][_0xcbcf('0x69')];_0x43eea6=_0x5c20df[_0x2dcd80][_0xcbcf('0x75')]?_[_0xcbcf('0x76')](_0x25704e[_0x5c20df[_0x2dcd80]['function']],'%s',_0x43eea6):_0x43eea6;_0x43eea6=_0x5c20df[_0x2dcd80][_0xcbcf('0x77')]?_[_0xcbcf('0x76')](_0x2fc2a9[_0x5c20df[_0x2dcd80][_0xcbcf('0x77')]],'%s',_0x43eea6):_0x43eea6;if(_0x5c20df[_0x2dcd80][_0xcbcf('0x78')]){_0x560414[_0xcbcf('0x68')](_0x43eea6);}_0x5c20df[_0x2dcd80][_0xcbcf('0x79')]&&_0x560414['order'](_0x43eea6,_0x5c20df[_0x2dcd80][_0xcbcf('0x79')]===_0xcbcf('0x7a')?![]:!![]);_0x560414['field'](_0x43eea6,_0x5c20df[_0x2dcd80]['alias']||_0x43eea6);}if(_0x33b957[_0xcbcf('0x7c')]){_0x33b957[_0xcbcf('0x7c')]=JSON[_0xcbcf('0x82')](_0x33b957[_0xcbcf('0x7c')]);for(var _0x363542=0x0;_0x363542<_0x33b957[_0xcbcf('0x7c')]['length'];_0x363542+=0x1){if(_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x2e')]&&_[_0xcbcf('0x62')](_0xe8c040,_0x33b957['joins'][_0x363542][_0xcbcf('0x2e')])&&_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x7d')]&&_0x33b957['joins'][_0x363542][_0xcbcf('0x7e')]&&_0x33b957[_0xcbcf('0x7c')][_0x363542]['foreignKey']){_0x560414[_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x2e')]](_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x7e')],null,util[_0xcbcf('0x77')](_0xcbcf('0x7f'),_0x33b957[_0xcbcf('0x73')],_0x33b957['joins'][_0x363542][_0xcbcf('0x7d')],_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x7e')],_0x33b957['joins'][_0x363542][_0xcbcf('0x80')]));}}}if(_0x33b957[_0xcbcf('0x81')]){_0x33b957['conditions']=JSON['parse'](_0x33b957[_0xcbcf('0x81')]);_0x560414[_0xcbcf('0x39')](_0x45da11(_0x33b957[_0xcbcf('0x81')][_0xcbcf('0x68')]));}_0x4a5ec8=_0x560414['clone']();_0x560414[_0xcbcf('0x37')](_0x4117d6);_0x560414[_0xcbcf('0x1b')](0x0);logger['debug'](_0xcbcf('0xa3'),_0x560414[_0xcbcf('0x85')]());return dbH[_0xcbcf('0x86')]['query'](_0x560414[_0xcbcf('0x85')](),{'type':dbH[_0xcbcf('0x86')][_0xcbcf('0x87')][_0xcbcf('0x88')]});}})[_0xcbcf('0x25')](function(){return{'sql':_0x4a5ec8['toString']()};})[_0xcbcf('0x25')](respondWithResult(_0x1837d7,null))[_0xcbcf('0x41')](handleError(_0x1837d7,null));}; \ No newline at end of file +var _0xbd7b=['filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','intersection','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','AVG(%s)','DATE(%s)','IS\x20NOT\x20EMPTY','operator','value','getFields','metric','%s.%s\x20=\x20%s.%s','clone','output','fullPath','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','replace','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x918995,_0x26561a){var _0x49c093=function(_0x238807){while(--_0x238807){_0x918995['push'](_0x918995['shift']());}};_0x49c093(++_0x26561a);}(_0xbd7b,0x10c));var _0xbbd7=function(_0x1e8bea,_0x47bde9){_0x1e8bea=_0x1e8bea-0x0;var _0x29f756=_0xbd7b[_0x1e8bea];return _0x29f756;};'use strict';var emlformat=require(_0xbbd7('0x0'));var rimraf=require(_0xbbd7('0x1'));var zipdir=require(_0xbbd7('0x2'));var jsonpatch=require(_0xbbd7('0x3'));var rp=require(_0xbbd7('0x4'));var moment=require(_0xbbd7('0x5'));var BPromise=require(_0xbbd7('0x6'));var Mustache=require(_0xbbd7('0x7'));var util=require(_0xbbd7('0x8'));var path=require('path');var sox=require(_0xbbd7('0x9'));var csv=require(_0xbbd7('0xa'));var ejs=require(_0xbbd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbbd7('0xc'));var _=require(_0xbbd7('0xd'));var squel=require(_0xbbd7('0xe'));var crypto=require('crypto');var jsforce=require(_0xbbd7('0xf'));var deskjs=require(_0xbbd7('0x10'));var toCsv=require(_0xbbd7('0xa'));var querystring=require(_0xbbd7('0x11'));var Papa=require('papaparse');var Redis=require(_0xbbd7('0x12'));var authService=require(_0xbbd7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbbd7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbd7('0x15'))(_0xbbd7('0x16'));var utils=require(_0xbbd7('0x17'));var config=require(_0xbbd7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbbd7('0x19'))['db'];var dbH=require(_0xbbd7('0x19'))[_0xbbd7('0x1a')];function respondWithStatusCode(_0x22a0a9,_0x269617){_0x269617=_0x269617||0xcc;return function(_0x2f5045){if(_0x2f5045){return _0x22a0a9[_0xbbd7('0x1b')](_0x269617);}return _0x22a0a9[_0xbbd7('0x1c')](_0x269617)[_0xbbd7('0x1d')]();};}function respondWithResult(_0x242e47,_0x475acf){_0x475acf=_0x475acf||0xc8;return function(_0x32ad90){if(_0x32ad90){return _0x242e47[_0xbbd7('0x1c')](_0x475acf)['json'](_0x32ad90);}};}function respondWithFilteredResult(_0x36a1df,_0x3e2a90){return function(_0x2c2ff0){if(_0x2c2ff0){var _0x572217=typeof _0x3e2a90['offset']==='undefined'&&typeof _0x3e2a90['limit']===_0xbbd7('0x1e');var _0x2afbd4=_0x2c2ff0[_0xbbd7('0x1f')];var _0xf9634=_0x572217?0x0:_0x3e2a90[_0xbbd7('0x20')];var _0x45cdbb=_0x572217?_0x2c2ff0[_0xbbd7('0x1f')]:_0x3e2a90[_0xbbd7('0x20')]+_0x3e2a90[_0xbbd7('0x21')];var _0xa76ebe;if(_0x45cdbb>=_0x2afbd4){_0x45cdbb=_0x2afbd4;_0xa76ebe=0xc8;}else{_0xa76ebe=0xce;}_0x36a1df[_0xbbd7('0x1c')](_0xa76ebe);return _0x36a1df[_0xbbd7('0x22')](_0xbbd7('0x23'),_0xf9634+'-'+_0x45cdbb+'/'+_0x2afbd4)[_0xbbd7('0x24')](_0x2c2ff0);}return null;};}function patchUpdates(_0x5ac496){return function(_0x2ceaf3){try{jsonpatch[_0xbbd7('0x25')](_0x2ceaf3,_0x5ac496,!![]);}catch(_0x12621a){return BPromise[_0xbbd7('0x26')](_0x12621a);}return _0x2ceaf3[_0xbbd7('0x27')]();};}function saveUpdates(_0x2cb62a,_0x5ea98a){return function(_0x3ac08e){if(_0x3ac08e){return _0x3ac08e[_0xbbd7('0x28')](_0x2cb62a)[_0xbbd7('0x29')](function(_0x1842e5){return _0x1842e5;});}return null;};}function removeEntity(_0x49bf26,_0x5217a0){return function(_0x8e7e64){if(_0x8e7e64){return _0x8e7e64[_0xbbd7('0x2a')]()[_0xbbd7('0x29')](function(){var _0x4badff=_0x8e7e64['get']({'plain':!![]});var _0x30de='CustomReports';return db['UserProfileResource'][_0xbbd7('0x2a')]({'where':{'type':_0x30de,'resourceId':_0x4badff['id']}})[_0xbbd7('0x29')](function(){return _0x8e7e64;});})['then'](function(){_0x49bf26[_0xbbd7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e05e,_0x3e8e6a){return function(_0x1f1ac2){if(!_0x1f1ac2){_0x51e05e[_0xbbd7('0x1b')](0x194);}return _0x1f1ac2;};}function handleError(_0x2073de,_0x4e7dca){_0x4e7dca=_0x4e7dca||0x1f4;return function(_0x36cd6d){logger['error'](_0x36cd6d[_0xbbd7('0x2b')]);if(_0x36cd6d[_0xbbd7('0x2c')]){delete _0x36cd6d[_0xbbd7('0x2c')];}_0x2073de['status'](_0x4e7dca)['send'](_0x36cd6d);};}exports['index']=function(_0x27b6b2,_0x1d5ae9){var _0x5eeddb={},_0x1974fa={},_0xb1bb78={'count':0x0,'rows':[]};var _0xc3fbbe=_[_0xbbd7('0x2d')](db['AnalyticCustomReport'][_0xbbd7('0x2e')],function(_0x5414fe){return{'name':_0x5414fe[_0xbbd7('0x2f')],'type':_0x5414fe[_0xbbd7('0x30')][_0xbbd7('0x31')]};});_0x1974fa[_0xbbd7('0x32')]=_['map'](_0xc3fbbe,_0xbbd7('0x2c'));_0x1974fa[_0xbbd7('0x33')]=_[_0xbbd7('0x34')](_0x27b6b2[_0xbbd7('0x33')]);_0x1974fa[_0xbbd7('0x35')]=_['intersection'](_0x1974fa['model'],_0x1974fa['query']);_0x5eeddb[_0xbbd7('0x36')]=_['intersection'](_0x1974fa['model'],qs[_0xbbd7('0x37')](_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x37')]));_0x5eeddb[_0xbbd7('0x36')]=_0x5eeddb[_0xbbd7('0x36')][_0xbbd7('0x38')]?_0x5eeddb[_0xbbd7('0x36')]:_0x1974fa['model'];if(!_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x39')]('nolimit')){_0x5eeddb[_0xbbd7('0x21')]=qs['limit'](_0x27b6b2['query'][_0xbbd7('0x21')]);_0x5eeddb['offset']=qs[_0xbbd7('0x20')](_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x20')]);}_0x5eeddb[_0xbbd7('0x3a')]=qs[_0xbbd7('0x3b')](_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x3b')]);_0x5eeddb[_0xbbd7('0x3c')]=qs[_0xbbd7('0x35')](_[_0xbbd7('0x3d')](_0x27b6b2[_0xbbd7('0x33')],_0x1974fa[_0xbbd7('0x35')]),_0xc3fbbe);if(_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x3e')]){_0x5eeddb[_0xbbd7('0x3c')]=_[_0xbbd7('0x3f')](_0x5eeddb[_0xbbd7('0x3c')],{'$or':_[_0xbbd7('0x2d')](_0xc3fbbe,function(_0xa7ed39){if(_0xa7ed39[_0xbbd7('0x30')]!==_0xbbd7('0x40')){var _0x543eb7={};_0x543eb7[_0xa7ed39[_0xbbd7('0x2c')]]={'$like':'%'+_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x3e')]+'%'};return _0x543eb7;}})});}_0x5eeddb=_[_0xbbd7('0x3f')]({},_0x5eeddb,_0x27b6b2[_0xbbd7('0x41')]);var _0x59d02b={'where':_0x5eeddb[_0xbbd7('0x3c')]};return db[_0xbbd7('0x42')][_0xbbd7('0x1f')](_0x59d02b)[_0xbbd7('0x29')](function(_0x3b622b){_0xb1bb78[_0xbbd7('0x1f')]=_0x3b622b;if(_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x43')]){_0x5eeddb[_0xbbd7('0x44')]=[{'all':!![]}];}return db[_0xbbd7('0x42')][_0xbbd7('0x45')](_0x5eeddb);})['then'](function(_0x38dc1b){_0xb1bb78[_0xbbd7('0x46')]=_0x38dc1b;return _0xb1bb78;})[_0xbbd7('0x29')](respondWithFilteredResult(_0x1d5ae9,_0x5eeddb))['catch'](handleError(_0x1d5ae9,null));};exports['show']=function(_0x135e41,_0x2c01ad){var _0x3042d1={'raw':![],'where':{'id':_0x135e41['params']['id']}},_0x63bd9b={};_0x63bd9b[_0xbbd7('0x32')]=_[_0xbbd7('0x34')](db[_0xbbd7('0x42')][_0xbbd7('0x2e')]);_0x63bd9b[_0xbbd7('0x33')]=_[_0xbbd7('0x34')](_0x135e41[_0xbbd7('0x33')]);_0x63bd9b['filters']=_['intersection'](_0x63bd9b[_0xbbd7('0x32')],_0x63bd9b[_0xbbd7('0x33')]);_0x3042d1[_0xbbd7('0x36')]=_[_0xbbd7('0x47')](_0x63bd9b[_0xbbd7('0x32')],qs[_0xbbd7('0x37')](_0x135e41[_0xbbd7('0x33')][_0xbbd7('0x37')]));_0x3042d1[_0xbbd7('0x36')]=_0x3042d1[_0xbbd7('0x36')][_0xbbd7('0x38')]?_0x3042d1[_0xbbd7('0x36')]:_0x63bd9b[_0xbbd7('0x32')];if(_0x135e41[_0xbbd7('0x33')][_0xbbd7('0x43')]){_0x3042d1[_0xbbd7('0x44')]=[{'all':!![]}];}_0x3042d1=_[_0xbbd7('0x3f')]({},_0x3042d1,_0x135e41['options']);return db['AnalyticCustomReport'][_0xbbd7('0x48')](_0x3042d1)[_0xbbd7('0x29')](handleEntityNotFound(_0x2c01ad,null))[_0xbbd7('0x29')](respondWithResult(_0x2c01ad,null))[_0xbbd7('0x49')](handleError(_0x2c01ad,null));};exports[_0xbbd7('0x4a')]=function(_0x864056,_0x5c6f28){return db['AnalyticCustomReport'][_0xbbd7('0x4a')](_0x864056['body'],{})[_0xbbd7('0x29')](function(_0x87f316){var _0x4a04e1=_0x864056['user'][_0xbbd7('0x4b')]({'plain':!![]});if(!_0x4a04e1)throw new Error(_0xbbd7('0x4c'));if(_0x4a04e1[_0xbbd7('0x4d')]==='user'){var _0x2334ad=_0x87f316[_0xbbd7('0x4b')]({'plain':!![]});var _0x5cf40a=_0xbbd7('0x4e');return db['UserProfileSection'][_0xbbd7('0x48')]({'where':{'name':_0x5cf40a,'userProfileId':_0x4a04e1[_0xbbd7('0x4f')]},'raw':!![]})[_0xbbd7('0x29')](function(_0x30d05d){if(_0x30d05d&&_0x30d05d[_0xbbd7('0x50')]===0x0){return db[_0xbbd7('0x51')][_0xbbd7('0x4a')]({'name':_0x2334ad[_0xbbd7('0x2c')],'resourceId':_0x2334ad['id'],'type':_0xbbd7('0x52'),'sectionId':_0x30d05d['id']},{})[_0xbbd7('0x29')](function(){return _0x87f316;});}else{return _0x87f316;}})[_0xbbd7('0x49')](function(_0x597481){logger['error'](_0xbbd7('0x53'),_0x597481);throw _0x597481;});}return _0x87f316;})[_0xbbd7('0x29')](respondWithResult(_0x5c6f28,0xc9))[_0xbbd7('0x49')](handleError(_0x5c6f28,null));};exports[_0xbbd7('0x28')]=function(_0x412b08,_0x4f6c82){if(_0x412b08[_0xbbd7('0x54')]['id']){delete _0x412b08[_0xbbd7('0x54')]['id'];}return db['AnalyticCustomReport'][_0xbbd7('0x48')]({'where':{'id':_0x412b08['params']['id']}})[_0xbbd7('0x29')](handleEntityNotFound(_0x4f6c82,null))['then'](saveUpdates(_0x412b08[_0xbbd7('0x54')],null))[_0xbbd7('0x29')](respondWithResult(_0x4f6c82,null))[_0xbbd7('0x49')](handleError(_0x4f6c82,null));};exports[_0xbbd7('0x2a')]=function(_0x47eabd,_0xe8c16e){return db['AnalyticCustomReport']['find']({'where':{'id':_0x47eabd[_0xbbd7('0x55')]['id']}})[_0xbbd7('0x29')](handleEntityNotFound(_0xe8c16e,null))[_0xbbd7('0x29')](removeEntity(_0xe8c16e,null))[_0xbbd7('0x49')](handleError(_0xe8c16e,null));};exports[_0xbbd7('0x56')]=function(_0x4976c8,_0x3f8b60){var _0x33bd6f=0xa;var _0xb109bf=[_0xbbd7('0x57'),_0xbbd7('0x58'),'right_join','cross_join'];var _0x4c8ab4={'SUM':_0xbbd7('0x59'),'COUNT':_0xbbd7('0x5a'),'COUNT DISTINCT':_0xbbd7('0x5b'),'MAX':'MAX(%s)','MIN':_0xbbd7('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbbd7('0x5d'),'GROUP_CONCAT ASC':_0xbbd7('0x5e'),'GROUP_CONCAT DESC':_0xbbd7('0x5f')};var _0x177abb={'SEC_TO_TIME':_0xbbd7('0x60'),'DATE':'DATE(%s)','HOUR':_0xbbd7('0x61'),'ROUND':_0xbbd7('0x62'),'UNIX_TIMESTAMP':_0xbbd7('0x63')};var _0x4b9314=function(_0x3de454){return!_['includes']([_0xbbd7('0x64'),_0xbbd7('0x65'),_0xbbd7('0x66'),'IS\x20NOT\x20EMPTY'],_0x3de454);};var _0x4331ab=function(_0x20f41b){if(!_0x20f41b||!_0x20f41b[_0xbbd7('0x67')][_0xbbd7('0x38')]){return'';}for(var _0x19265f='(',_0x46edbb=0x0;_0x46edbb<_0x20f41b[_0xbbd7('0x67')][_0xbbd7('0x38')];_0x46edbb+=0x1){_0x46edbb>0x0&&(_0x19265f+='\x20'+_0x20f41b['operator']+'\x20');_0x19265f+=_0x20f41b[_0xbbd7('0x67')][_0x46edbb][_0xbbd7('0x68')]?_0x4331ab(_0x20f41b[_0xbbd7('0x67')][_0x46edbb]['group']):_0x20f41b['rules'][_0x46edbb]['field']+'\x20'+_0x20f41b[_0xbbd7('0x67')][_0x46edbb][_0xbbd7('0x69')]+(_0x4b9314(_0x20f41b[_0xbbd7('0x67')][_0x46edbb][_0xbbd7('0x69')])?'\x20'+_0x20f41b['rules'][_0x46edbb]['value']:'');}return _0x19265f+')';};var _0x1cf366={'where':{'id':_0x4976c8[_0xbbd7('0x55')]['id']}},_0x5e471c,_0x1e640b,_0x1d39e0,_0x4c5c05,_0x5de3b6;_0x1cf366=_[_0xbbd7('0x3f')]({},_0x1cf366,_0x4976c8[_0xbbd7('0x41')]);return db[_0xbbd7('0x42')][_0xbbd7('0x48')](_0x1cf366)[_0xbbd7('0x29')](function(_0x306444){if(_0x306444){_0x5e471c=_0x306444;return _0x306444['getFields']();}return null;})['then'](function(_0xb0e1a3){if(_0xb0e1a3){if(!_0xb0e1a3['length']){throw new db[(_0xbbd7('0x6a'))][(_0xbbd7('0x6b'))](_0xbbd7('0x6c'),0x193);}_0x1e640b=_0xb0e1a3;return db[_0xbbd7('0x6d')][_0xbbd7('0x45')]({'raw':!![]});}return null;})[_0xbbd7('0x29')](function(_0x41f6bd){if(_0x41f6bd){_0x1d39e0=_[_0xbbd7('0x6e')](_0x41f6bd,'id');var _0x3fca93;var _0x30c361=squel[_0xbbd7('0x6f')]();_0x30c361[_0xbbd7('0x70')](_0x5e471c[_0xbbd7('0x71')]);for(var _0x1954b5=0x0;_0x1954b5<_0x1e640b[_0xbbd7('0x38')];_0x1954b5+=0x1){_0x3fca93=_0x1e640b[_0x1954b5]['MetricId']?_0x1d39e0[_0x1e640b[_0x1954b5][_0xbbd7('0x72')]]['metric']:_0x1e640b[_0x1954b5][_0xbbd7('0x73')];_0x3fca93=_0x1e640b[_0x1954b5][_0xbbd7('0x74')]?_['replace'](_0x4c8ab4[_0x1e640b[_0x1954b5][_0xbbd7('0x74')]],'%s',_0x3fca93):_0x3fca93;_0x3fca93=_0x1e640b[_0x1954b5][_0xbbd7('0x75')]?_['replace'](_0x177abb[_0x1e640b[_0x1954b5][_0xbbd7('0x75')]],'%s',_0x3fca93):_0x3fca93;if(_0x1e640b[_0x1954b5][_0xbbd7('0x76')]){_0x30c361['group'](_0x3fca93);}_0x1e640b[_0x1954b5][_0xbbd7('0x77')]&&_0x30c361[_0xbbd7('0x3a')](_0x3fca93,_0x1e640b[_0x1954b5]['orderBy']===_0xbbd7('0x78')?![]:!![]);_0x30c361[_0xbbd7('0x73')](_0x3fca93,_0x1e640b[_0x1954b5][_0xbbd7('0x79')]||_0x3fca93);}if(_0x5e471c[_0xbbd7('0x7a')]){_0x5e471c[_0xbbd7('0x7a')]=JSON[_0xbbd7('0x7b')](_0x5e471c[_0xbbd7('0x7a')]);for(var _0x4496d4=0x0;_0x4496d4<_0x5e471c[_0xbbd7('0x7a')][_0xbbd7('0x38')];_0x4496d4+=0x1){if(_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x30')]&&_[_0xbbd7('0x7c')](_0xb109bf,_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x30')])&&_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7d')]&&_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7e')]&&_0x5e471c[_0xbbd7('0x7a')][_0x4496d4]['foreignKey']){_0x30c361[_0x5e471c['joins'][_0x4496d4][_0xbbd7('0x30')]](_0x5e471c['joins'][_0x4496d4][_0xbbd7('0x7e')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5e471c[_0xbbd7('0x71')],_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7d')],_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7e')],_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7f')]));}}}if(_0x5e471c[_0xbbd7('0x80')]){_0x5e471c[_0xbbd7('0x80')]=JSON[_0xbbd7('0x7b')](_0x5e471c[_0xbbd7('0x80')]);_0x30c361[_0xbbd7('0x3c')](_0x4331ab(_0x5e471c[_0xbbd7('0x80')][_0xbbd7('0x68')]));}_0x5de3b6=_0x30c361['clone']();_0x30c361[_0xbbd7('0x21')](_0x33bd6f);_0x30c361[_0xbbd7('0x20')](0x0);logger[_0xbbd7('0x81')]('Limited\x20Query:',_0x30c361[_0xbbd7('0x82')]());return dbH[_0xbbd7('0x83')]['query'](_0x30c361[_0xbbd7('0x82')](),{'type':dbH[_0xbbd7('0x83')][_0xbbd7('0x84')][_0xbbd7('0x85')]});}})[_0xbbd7('0x29')](respondWithResult(_0x3f8b60,null))[_0xbbd7('0x49')](handleError(_0x3f8b60,null));};function runReport(_0x37b528,_0x5f0206,_0x3b3f44){var _0x116a95=_0x5f0206[_0xbbd7('0x2c')];var _0x1333aa=0xa;var _0x52124b=[_0xbbd7('0x57'),_0xbbd7('0x58'),'right_join',_0xbbd7('0x86')];var _0xa387cf={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbbd7('0x5b'),'MAX':_0xbbd7('0x87'),'MIN':_0xbbd7('0x5c'),'AVG':_0xbbd7('0x88'),'GROUP_CONCAT':_0xbbd7('0x5d'),'GROUP_CONCAT ASC':_0xbbd7('0x5e'),'GROUP_CONCAT DESC':_0xbbd7('0x5f')};var _0x1ea571={'SEC_TO_TIME':_0xbbd7('0x60'),'DATE':_0xbbd7('0x89'),'HOUR':_0xbbd7('0x61'),'ROUND':_0xbbd7('0x62'),'UNIX_TIMESTAMP':_0xbbd7('0x63')};var _0x2b45ac=function(_0x139f99){return!_[_0xbbd7('0x7c')]([_0xbbd7('0x64'),_0xbbd7('0x65'),_0xbbd7('0x66'),_0xbbd7('0x8a')],_0x139f99);};var _0x48e49e=function(_0x1bde48){if(!_0x1bde48||!_0x1bde48[_0xbbd7('0x67')][_0xbbd7('0x38')]){return'';}for(var _0x2947c2='(',_0x5a217d=0x0;_0x5a217d<_0x1bde48[_0xbbd7('0x67')]['length'];_0x5a217d+=0x1){_0x5a217d>0x0&&(_0x2947c2+='\x20'+_0x1bde48[_0xbbd7('0x8b')]+'\x20');_0x2947c2+=_0x1bde48[_0xbbd7('0x67')][_0x5a217d]['group']?_0x48e49e(_0x1bde48['rules'][_0x5a217d]['group']):_0x1bde48[_0xbbd7('0x67')][_0x5a217d]['field']+'\x20'+_0x1bde48[_0xbbd7('0x67')][_0x5a217d][_0xbbd7('0x69')]+(_0x2b45ac(_0x1bde48[_0xbbd7('0x67')][_0x5a217d]['condition'])?'\x20'+_0x1bde48[_0xbbd7('0x67')][_0x5a217d][_0xbbd7('0x8c')]:'');}return _0x2947c2+')';};var _0x5d303d={'where':{'id':_0x37b528['id']}},_0x4de02d,_0x1869c2,_0x3ed0c8,_0xb47b5b,_0xdcef54;_0x5d303d=_['merge']({},_0x5d303d,_0x3b3f44);return db[_0xbbd7('0x42')][_0xbbd7('0x48')](_0x5d303d)[_0xbbd7('0x29')](function(_0x4d2a8f){if(_0x4d2a8f){_0x4de02d=_0x4d2a8f;return _0x4d2a8f[_0xbbd7('0x8d')]();}return null;})['then'](function(_0x44abc9){if(_0x44abc9){if(!_0x44abc9['length']){throw new db['Sequelize'][(_0xbbd7('0x6b'))](_0xbbd7('0x6c'),0x193);}_0x1869c2=_0x44abc9;return db[_0xbbd7('0x6d')][_0xbbd7('0x45')]({'raw':!![]});}return null;})[_0xbbd7('0x29')](function(_0x1ee357){if(_0x1ee357){_0x3ed0c8=_[_0xbbd7('0x6e')](_0x1ee357,'id');var _0x385665;var _0x225e60=squel['select']();_0x225e60['from'](_0x4de02d['table']);for(var _0x3725c5=0x0;_0x3725c5<_0x1869c2[_0xbbd7('0x38')];_0x3725c5+=0x1){_0x385665=_0x1869c2[_0x3725c5]['MetricId']?_0x3ed0c8[_0x1869c2[_0x3725c5][_0xbbd7('0x72')]][_0xbbd7('0x8e')]:_0x1869c2[_0x3725c5]['field'];_0x385665=_0x1869c2[_0x3725c5][_0xbbd7('0x74')]?_['replace'](_0xa387cf[_0x1869c2[_0x3725c5][_0xbbd7('0x74')]],'%s',_0x385665):_0x385665;_0x385665=_0x1869c2[_0x3725c5]['format']?_['replace'](_0x1ea571[_0x1869c2[_0x3725c5][_0xbbd7('0x75')]],'%s',_0x385665):_0x385665;if(_0x1869c2[_0x3725c5][_0xbbd7('0x76')]){_0x225e60[_0xbbd7('0x68')](_0x385665);}_0x1869c2[_0x3725c5]['orderBy']&&_0x225e60['order'](_0x385665,_0x1869c2[_0x3725c5][_0xbbd7('0x77')]===_0xbbd7('0x78')?![]:!![]);_0x225e60['field'](_0x385665,_0x1869c2[_0x3725c5][_0xbbd7('0x79')]||_0x385665);}if(_0x4de02d['joins']){_0x4de02d[_0xbbd7('0x7a')]=JSON[_0xbbd7('0x7b')](_0x4de02d[_0xbbd7('0x7a')]);for(var _0x32c132=0x0;_0x32c132<_0x4de02d['joins'][_0xbbd7('0x38')];_0x32c132+=0x1){if(_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x30')]&&_[_0xbbd7('0x7c')](_0x52124b,_0x4de02d['joins'][_0x32c132][_0xbbd7('0x30')])&&_0x4de02d['joins'][_0x32c132][_0xbbd7('0x7d')]&&_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x7e')]&&_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x7f')]){_0x225e60[_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x30')]](_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x7e')],null,util[_0xbbd7('0x75')](_0xbbd7('0x8f'),_0x4de02d[_0xbbd7('0x71')],_0x4de02d[_0xbbd7('0x7a')][_0x32c132]['parentKey'],_0x4de02d['joins'][_0x32c132][_0xbbd7('0x7e')],_0x4de02d['joins'][_0x32c132]['foreignKey']));}}}if(_0x4de02d[_0xbbd7('0x80')]){_0x4de02d[_0xbbd7('0x80')]=JSON[_0xbbd7('0x7b')](_0x4de02d['conditions']);_0x225e60[_0xbbd7('0x3c')](_0x48e49e(_0x4de02d['conditions'][_0xbbd7('0x68')]));}_0xdcef54=_0x225e60[_0xbbd7('0x90')]();_0x225e60[_0xbbd7('0x21')](_0x1333aa);_0x225e60[_0xbbd7('0x20')](0x0);return;}})[_0xbbd7('0x29')](function(){if(_0x5f0206[_0xbbd7('0x91')]==='web'){return null;}var _0x30a060=_[_0xbbd7('0x3f')](_0x5f0206,{'name':_0x5f0206[_0xbbd7('0x92')]||_0x5f0206[_0xbbd7('0x2c')]||_0x4de02d[_0xbbd7('0x2c')],'basename':_0x116a95,'savename':util[_0xbbd7('0x75')](_0xbbd7('0x93'),_0x5f0206[_0xbbd7('0x2c')]||_0x4de02d[_0xbbd7('0x2c')],require(_0xbbd7('0x94'))[_0xbbd7('0x95')](0x4),_0x5f0206[_0xbbd7('0x91')]||'csv'),'reportId':_0x4de02d['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xbbd7('0x4a')](_0x30a060,{'raw':!![]});})[_0xbbd7('0x29')](function(_0xc11665){if(_0x4de02d[_0xbbd7('0x71')]===_0xbbd7('0x96')){_0xdcef54[_0xbbd7('0x3c')](_0x4de02d['table']+_0xbbd7('0x97'),_0x5f0206[_0xbbd7('0x98')],_0x5f0206[_0xbbd7('0x99')]);}else{_0xdcef54[_0xbbd7('0x3c')](_0x4de02d[_0xbbd7('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f0206[_0xbbd7('0x98')],_0x5f0206[_0xbbd7('0x99')]);}if(_0xc11665){logger[_0xbbd7('0x9a')]('Run\x20Query:',_0xdcef54['toString']());require(_0xbbd7('0x9b'))[_0xbbd7('0x9c')](path[_0xbbd7('0x57')](__dirname,_0xbbd7('0x9d'),_0xc11665[_0xbbd7('0x91')]),[_0xc11665['id'],_0xdcef54['toString'](),path[_0xbbd7('0x57')](__dirname,_0xbbd7('0x9e'),_0xc11665['savename']),_0x116a95]);return _0xc11665;}else{var _0x256a5a=squel[_0xbbd7('0x6f')]();_0x256a5a[_0xbbd7('0x70')]('('+_0xdcef54[_0xbbd7('0x82')]()+')',_0xbbd7('0x9f'));_0x256a5a[_0xbbd7('0x73')](_0xbbd7('0xa0'),'count');_0xdcef54[_0xbbd7('0x21')](_0x5f0206[_0xbbd7('0x21')]||_0x1333aa);_0xdcef54[_0xbbd7('0x20')](_0x5f0206[_0xbbd7('0x20')]||0x0);return dbH[_0xbbd7('0x83')]['query'](_0x256a5a['toString'](),{'type':dbH[_0xbbd7('0x83')][_0xbbd7('0x84')]['SELECT']})['then'](function(_0x13a456){if(!_0x13a456['length']){_0xb47b5b=0x0;}else{_0xb47b5b=_0x13a456[0x0][_0xbbd7('0x1f')]||0x0;}return dbH[_0xbbd7('0x83')]['query'](_0xdcef54[_0xbbd7('0x82')](),{'type':dbH[_0xbbd7('0x83')][_0xbbd7('0x84')][_0xbbd7('0x85')]});})[_0xbbd7('0x29')](function(_0x6d6049){return{'rows':_0x6d6049||[],'count':_0xb47b5b};});}});}exports[_0xbbd7('0xa1')]=function(_0x479b55,_0x232db1){return runReport(_0x479b55[_0xbbd7('0x55')],_0x479b55[_0xbbd7('0x33')],_0x479b55[_0xbbd7('0x41')])[_0xbbd7('0x29')](respondWithResult(_0x232db1,null))[_0xbbd7('0x49')](handleError(_0x232db1,null));};exports[_0xbbd7('0xa2')]=runReport;exports[_0xbbd7('0x33')]=function(_0x41eef0,_0xbf2320){var _0x5daabd=0xa;var _0x231020=['join',_0xbbd7('0x58'),'right_join',_0xbbd7('0x86')];var _0x905401={'SUM':_0xbbd7('0x59'),'COUNT':_0xbbd7('0x5a'),'COUNT DISTINCT':_0xbbd7('0x5b'),'MAX':_0xbbd7('0x87'),'MIN':_0xbbd7('0x5c'),'AVG':_0xbbd7('0x88'),'GROUP_CONCAT':_0xbbd7('0x5d'),'GROUP_CONCAT ASC':_0xbbd7('0x5e'),'GROUP_CONCAT DESC':_0xbbd7('0x5f')};var _0xe7710d={'SEC_TO_TIME':_0xbbd7('0x60'),'DATE':'DATE(%s)','HOUR':_0xbbd7('0x61'),'ROUND':_0xbbd7('0x62'),'UNIX_TIMESTAMP':_0xbbd7('0x63')};var _0x59c0c0=function(_0x4b525f){return!_[_0xbbd7('0x7c')]([_0xbbd7('0x64'),_0xbbd7('0x65'),_0xbbd7('0x66'),'IS\x20NOT\x20EMPTY'],_0x4b525f);};var _0x572724=function(_0x24215b){if(!_0x24215b||!_0x24215b[_0xbbd7('0x67')][_0xbbd7('0x38')]){return'';}for(var _0x14cce9='(',_0x2d23d9=0x0;_0x2d23d9<_0x24215b['rules'][_0xbbd7('0x38')];_0x2d23d9+=0x1){_0x2d23d9>0x0&&(_0x14cce9+='\x20'+_0x24215b[_0xbbd7('0x8b')]+'\x20');_0x14cce9+=_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x68')]?_0x572724(_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x68')]):_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x73')]+'\x20'+_0x24215b['rules'][_0x2d23d9][_0xbbd7('0x69')]+(_0x59c0c0(_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x69')])?'\x20'+_0x24215b['rules'][_0x2d23d9][_0xbbd7('0x8c')]:'');}return _0x14cce9+')';};var _0x185b27={'where':{'id':_0x41eef0[_0xbbd7('0x55')]['id']}},_0x46a097,_0x42a282,_0x544701,_0x3f0252,_0x12335c;_0x185b27=_[_0xbbd7('0x3f')]({},_0x185b27,_0x41eef0[_0xbbd7('0x41')]);return db[_0xbbd7('0x42')][_0xbbd7('0x48')](_0x185b27)[_0xbbd7('0x29')](function(_0x308ede){if(_0x308ede){_0x46a097=_0x308ede;return _0x308ede[_0xbbd7('0x8d')]();}return null;})['then'](function(_0x4f470c){if(_0x4f470c){if(!_0x4f470c[_0xbbd7('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xbbd7('0x6c'),0x193);}_0x42a282=_0x4f470c;return db[_0xbbd7('0x6d')][_0xbbd7('0x45')]({'raw':!![]});}return null;})['then'](function(_0x522fdd){if(_0x522fdd){_0x544701=_[_0xbbd7('0x6e')](_0x522fdd,'id');var _0x42ff51;var _0x2c8dff=squel['select']();_0x2c8dff[_0xbbd7('0x70')](_0x46a097[_0xbbd7('0x71')]);for(var _0x44ea21=0x0;_0x44ea21<_0x42a282[_0xbbd7('0x38')];_0x44ea21+=0x1){_0x42ff51=_0x42a282[_0x44ea21]['MetricId']?_0x544701[_0x42a282[_0x44ea21]['MetricId']][_0xbbd7('0x8e')]:_0x42a282[_0x44ea21]['field'];_0x42ff51=_0x42a282[_0x44ea21][_0xbbd7('0x74')]?_[_0xbbd7('0xa3')](_0x905401[_0x42a282[_0x44ea21][_0xbbd7('0x74')]],'%s',_0x42ff51):_0x42ff51;_0x42ff51=_0x42a282[_0x44ea21][_0xbbd7('0x75')]?_[_0xbbd7('0xa3')](_0xe7710d[_0x42a282[_0x44ea21][_0xbbd7('0x75')]],'%s',_0x42ff51):_0x42ff51;if(_0x42a282[_0x44ea21]['groupBy']){_0x2c8dff[_0xbbd7('0x68')](_0x42ff51);}_0x42a282[_0x44ea21]['orderBy']&&_0x2c8dff['order'](_0x42ff51,_0x42a282[_0x44ea21][_0xbbd7('0x77')]===_0xbbd7('0x78')?![]:!![]);_0x2c8dff[_0xbbd7('0x73')](_0x42ff51,_0x42a282[_0x44ea21][_0xbbd7('0x79')]||_0x42ff51);}if(_0x46a097[_0xbbd7('0x7a')]){_0x46a097[_0xbbd7('0x7a')]=JSON[_0xbbd7('0x7b')](_0x46a097[_0xbbd7('0x7a')]);for(var _0x54082f=0x0;_0x54082f<_0x46a097[_0xbbd7('0x7a')]['length'];_0x54082f+=0x1){if(_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x30')]&&_[_0xbbd7('0x7c')](_0x231020,_0x46a097[_0xbbd7('0x7a')][_0x54082f]['type'])&&_0x46a097[_0xbbd7('0x7a')][_0x54082f]['parentKey']&&_0x46a097['joins'][_0x54082f][_0xbbd7('0x7e')]&&_0x46a097[_0xbbd7('0x7a')][_0x54082f]['foreignKey']){_0x2c8dff[_0x46a097['joins'][_0x54082f][_0xbbd7('0x30')]](_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7e')],null,util[_0xbbd7('0x75')]('%s.%s\x20=\x20%s.%s',_0x46a097[_0xbbd7('0x71')],_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7d')],_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7e')],_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7f')]));}}}if(_0x46a097[_0xbbd7('0x80')]){_0x46a097[_0xbbd7('0x80')]=JSON['parse'](_0x46a097[_0xbbd7('0x80')]);_0x2c8dff[_0xbbd7('0x3c')](_0x572724(_0x46a097[_0xbbd7('0x80')][_0xbbd7('0x68')]));}_0x12335c=_0x2c8dff[_0xbbd7('0x90')]();_0x2c8dff[_0xbbd7('0x21')](_0x5daabd);_0x2c8dff[_0xbbd7('0x20')](0x0);logger[_0xbbd7('0x81')](_0xbbd7('0xa4'),_0x2c8dff[_0xbbd7('0x82')]());return dbH[_0xbbd7('0x83')]['query'](_0x2c8dff[_0xbbd7('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0xbbd7('0x85')]});}})[_0xbbd7('0x29')](function(){return{'sql':_0x12335c['toString']()};})[_0xbbd7('0x29')](respondWithResult(_0xbf2320,null))[_0xbbd7('0x49')](handleError(_0xbf2320,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 6b414e9..47f1bf9 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 _0xd7a7=['analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport'];(function(_0x290789,_0x4a3d87){var _0x566fa4=function(_0x22e909){while(--_0x22e909){_0x290789['push'](_0x290789['shift']());}};_0x566fa4(++_0x4a3d87);}(_0xd7a7,0x199));var _0x7d7a=function(_0x557a54,_0x1e8558){_0x557a54=_0x557a54-0x0;var _0x111e38=_0xd7a7[_0x557a54];return _0x111e38;};'use strict';var _=require(_0x7d7a('0x0'));var util=require(_0x7d7a('0x1'));var logger=require(_0x7d7a('0x2'))('api');var moment=require(_0x7d7a('0x3'));var BPromise=require(_0x7d7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d7a('0x5'));var rimraf=require(_0x7d7a('0x6'));var config=require(_0x7d7a('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x7d7a('0x8')]=function(_0x218c54,_0x44b365){return _0x218c54[_0x7d7a('0x9')](_0x7d7a('0xa'),attributes,{'tableName':_0x7d7a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a1c=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6a1c,0xb0));var _0xc6a1=function(_0x50c7e1,_0x3e134a){_0x50c7e1=_0x50c7e1-0x0;var _0x48fbd6=_0x6a1c[_0x50c7e1];return _0x48fbd6;};'use strict';var _=require(_0xc6a1('0x0'));var util=require(_0xc6a1('0x1'));var logger=require('../../config/logger')(_0xc6a1('0x2'));var moment=require(_0xc6a1('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6a1('0x4'));var fs=require('fs');var path=require(_0xc6a1('0x5'));var rimraf=require(_0xc6a1('0x6'));var config=require(_0xc6a1('0x7'));var attributes=require(_0xc6a1('0x8'));module['exports']=function(_0x1d5114,_0x411f9b){return _0x1d5114[_0xc6a1('0x9')](_0xc6a1('0xa'),attributes,{'tableName':_0xc6a1('0xb'),'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 653825b..70d4c1f 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 _0xda49=['jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x57ba2d,_0x1dce7d){var _0x168847=function(_0x5b1c1a){while(--_0x5b1c1a){_0x57ba2d['push'](_0x57ba2d['shift']());}};_0x168847(++_0x1dce7d);}(_0xda49,0x1d7));var _0x9da4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xda49[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9da4('0x0'));var util=require(_0x9da4('0x1'));var moment=require(_0x9da4('0x2'));var BPromise=require('bluebird');var rs=require(_0x9da4('0x3'));var fs=require('fs');var Redis=require(_0x9da4('0x4'));var db=require(_0x9da4('0x5'))['db'];var utils=require(_0x9da4('0x6'));var logger=require('../../config/logger')(_0x9da4('0x7'));var config=require(_0x9da4('0x8'));var jayson=require(_0x9da4('0x9'));var client=jayson['client'][_0x9da4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x73751b,_0x4a9826,_0xe79e1b){return new BPromise(function(_0x119ad5,_0x39a422){return client['request'](_0x73751b,_0xe79e1b)[_0x9da4('0xb')](function(_0x36d9f6){logger['info'](_0x9da4('0xc'),_0x4a9826,_0x9da4('0xd'));logger['debug'](_0x9da4('0xe'),_0x4a9826,_0x9da4('0xd'),JSON[_0x9da4('0xf')](_0x36d9f6));if(_0x36d9f6[_0x9da4('0x10')]){if(_0x36d9f6[_0x9da4('0x10')]['code']===0x1f4){logger[_0x9da4('0x10')](_0x9da4('0xc'),_0x4a9826,_0x36d9f6[_0x9da4('0x10')][_0x9da4('0x11')]);return _0x39a422(_0x36d9f6[_0x9da4('0x10')][_0x9da4('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4a9826,_0x36d9f6[_0x9da4('0x10')]['message']);return _0x119ad5(_0x36d9f6[_0x9da4('0x10')][_0x9da4('0x11')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4a9826,'request\x20sent');_0x119ad5(_0x36d9f6[_0x9da4('0x12')][_0x9da4('0x11')]);}})[_0x9da4('0x13')](function(_0x24ec88){logger[_0x9da4('0x10')](_0x9da4('0xc'),_0x4a9826,_0x24ec88);_0x39a422(_0x24ec88);});});} \ No newline at end of file +var _0xafb6=['code','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c4b99,_0xe8bf48){var _0x171ccb=function(_0x88db28){while(--_0x88db28){_0x5c4b99['push'](_0x5c4b99['shift']());}};_0x171ccb(++_0xe8bf48);}(_0xafb6,0x156));var _0x6afb=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xafb6[_0x57975f];return _0x4793b8;};'use strict';var _=require(_0x6afb('0x0'));var util=require(_0x6afb('0x1'));var moment=require(_0x6afb('0x2'));var BPromise=require('bluebird');var rs=require(_0x6afb('0x3'));var fs=require('fs');var Redis=require(_0x6afb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6afb('0x5'));var logger=require(_0x6afb('0x6'))(_0x6afb('0x7'));var config=require(_0x6afb('0x8'));var jayson=require(_0x6afb('0x9'));var client=jayson['client'][_0x6afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ccaf3,_0x44730a,_0x5d7b4b){return new BPromise(function(_0x282aa2,_0x414340){return client[_0x6afb('0xb')](_0x5ccaf3,_0x5d7b4b)[_0x6afb('0xc')](function(_0x26aa52){logger['info'](_0x6afb('0xd'),_0x44730a,_0x6afb('0xe'));logger[_0x6afb('0xf')](_0x6afb('0x10'),_0x44730a,_0x6afb('0xe'),JSON[_0x6afb('0x11')](_0x26aa52));if(_0x26aa52['error']){if(_0x26aa52['error'][_0x6afb('0x12')]===0x1f4){logger[_0x6afb('0x13')](_0x6afb('0xd'),_0x44730a,_0x26aa52[_0x6afb('0x13')][_0x6afb('0x14')]);return _0x414340(_0x26aa52[_0x6afb('0x13')][_0x6afb('0x14')]);}logger[_0x6afb('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44730a,_0x26aa52[_0x6afb('0x13')]['message']);return _0x282aa2(_0x26aa52[_0x6afb('0x13')][_0x6afb('0x14')]);}else{logger[_0x6afb('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44730a,'request\x20sent');_0x282aa2(_0x26aa52[_0x6afb('0x16')][_0x6afb('0x14')]);}})[_0x6afb('0x17')](function(_0x4561d2){logger[_0x6afb('0x13')](_0x6afb('0xd'),_0x44730a,_0x4561d2);_0x414340(_0x4561d2);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 869bbe2..974c48f 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 _0x4c06=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete'];(function(_0x7ce68d,_0x17ece7){var _0x2dd767=function(_0x2a7418){while(--_0x2a7418){_0x7ce68d['push'](_0x7ce68d['shift']());}};_0x2dd767(++_0x17ece7);}(_0x4c06,0x89));var _0x64c0=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x4c06[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0x64c0('0x0'));var util=require(_0x64c0('0x1'));var path=require(_0x64c0('0x2'));var timeout=require(_0x64c0('0x3'));var express=require(_0x64c0('0x4'));var router=express[_0x64c0('0x5')]();var fs_extra=require(_0x64c0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x64c0('0x7'));var config=require(_0x64c0('0x8'));var controller=require(_0x64c0('0x9'));router[_0x64c0('0xa')]('/',auth[_0x64c0('0xb')](),controller[_0x64c0('0xc')]);router[_0x64c0('0xa')](_0x64c0('0xd'),auth[_0x64c0('0xb')](),controller[_0x64c0('0xe')]);router[_0x64c0('0xa')](_0x64c0('0xf'),auth[_0x64c0('0xb')](),controller[_0x64c0('0x10')]);router[_0x64c0('0xa')]('/:id/run',auth[_0x64c0('0xb')](),controller[_0x64c0('0x11')]);router[_0x64c0('0xa')](_0x64c0('0x12'),auth[_0x64c0('0xb')](),controller[_0x64c0('0x13')]);router[_0x64c0('0x14')]('/',auth['isAuthenticated'](),controller[_0x64c0('0x15')]);router[_0x64c0('0x16')](_0x64c0('0xd'),auth['isAuthenticated'](),controller[_0x64c0('0x17')]);router[_0x64c0('0x18')](_0x64c0('0xd'),auth[_0x64c0('0xb')](),controller[_0x64c0('0x19')]);module[_0x64c0('0x1a')]=router; \ No newline at end of file +var _0xea11=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','post','create','put','update','delete'];(function(_0x48c387,_0x55baa6){var _0x379f28=function(_0x2f7d79){while(--_0x2f7d79){_0x48c387['push'](_0x48c387['shift']());}};_0x379f28(++_0x55baa6);}(_0xea11,0x6f));var _0x1ea1=function(_0x30c66b,_0x3e10e9){_0x30c66b=_0x30c66b-0x0;var _0x54f719=_0xea11[_0x30c66b];return _0x54f719;};'use strict';var multer=require(_0x1ea1('0x0'));var util=require(_0x1ea1('0x1'));var path=require(_0x1ea1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ea1('0x3')]();var fs_extra=require(_0x1ea1('0x4'));var auth=require(_0x1ea1('0x5'));var interaction=require(_0x1ea1('0x6'));var config=require(_0x1ea1('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1ea1('0x8')]);router[_0x1ea1('0x9')](_0x1ea1('0xa'),auth[_0x1ea1('0xb')](),controller['show']);router[_0x1ea1('0x9')](_0x1ea1('0xc'),auth[_0x1ea1('0xb')](),controller[_0x1ea1('0xd')]);router[_0x1ea1('0x9')](_0x1ea1('0xe'),auth[_0x1ea1('0xb')](),controller['run']);router[_0x1ea1('0x9')](_0x1ea1('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x1ea1('0x10')]('/',auth['isAuthenticated'](),controller[_0x1ea1('0x11')]);router[_0x1ea1('0x12')](_0x1ea1('0xa'),auth[_0x1ea1('0xb')](),controller[_0x1ea1('0x13')]);router[_0x1ea1('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1ea1('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 44a7851..2a50101 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 _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x1ce393,_0x201902){var _0x4a1978=function(_0x2564e4){while(--_0x2564e4){_0x1ce393['push'](_0x1ce393['shift']());}};_0x4a1978(++_0x201902);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0x5fc3[_0x4914ad];return _0x3cd61f;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}}; \ No newline at end of file +var _0x2675=['sequelize','STRING','TEXT'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x2675,0x75));var _0x5267=function(_0x316fb3,_0x57ac35){_0x316fb3=_0x316fb3-0x0;var _0x24b833=_0x2675[_0x316fb3];return _0x24b833;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a4cd85a..a8bc421 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1dd78b,_0x213fd9){var _0x2d9bf6=function(_0x2c749a){while(--_0x2c749a){_0x1dd78b['push'](_0x1dd78b['shift']());}};_0x2d9bf6(++_0x213fd9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file +var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x5361dd,_0x56dfb2){var _0x4f4077=function(_0x15819f){while(--_0x15819f){_0x5361dd['push'](_0x5361dd['shift']());}};_0x4f4077(++_0x56dfb2);}(_0xba34,0x119));var _0x4ba3=function(_0x468502,_0x202602){_0x468502=_0x468502-0x0;var _0x39901c=_0xba34[_0x468502];return _0x39901c;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index baba481..fa35968 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 _0xa700=['exports','define','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa700,0x1ca));var _0x0a70=function(_0x4ce260,_0x2a5e2d){_0x4ce260=_0x4ce260-0x0;var _0x110812=_0xa700[_0x4ce260];return _0x110812;};'use strict';var _=require(_0x0a70('0x0'));var util=require(_0x0a70('0x1'));var logger=require('../../config/logger')(_0x0a70('0x2'));var moment=require(_0x0a70('0x3'));var BPromise=require(_0x0a70('0x4'));var rp=require(_0x0a70('0x5'));var fs=require('fs');var path=require(_0x0a70('0x6'));var rimraf=require(_0x0a70('0x7'));var config=require(_0x0a70('0x8'));var attributes=require(_0x0a70('0x9'));module[_0x0a70('0xa')]=function(_0x361898,_0x1135d3){return _0x361898[_0x0a70('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x0a70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb238=['bluebird','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment'];(function(_0x4b2ed7,_0x5b3100){var _0x55a953=function(_0x4b7abd){while(--_0x4b7abd){_0x4b2ed7['push'](_0x4b2ed7['shift']());}};_0x55a953(++_0x5b3100);}(_0xb238,0x17e));var _0x8b23=function(_0x591ec5,_0x2c94c5){_0x591ec5=_0x591ec5-0x0;var _0x56ed11=_0xb238[_0x591ec5];return _0x56ed11;};'use strict';var _=require(_0x8b23('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8b23('0x1'));var moment=require(_0x8b23('0x2'));var BPromise=require(_0x8b23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b23('0x4'));var rimraf=require(_0x8b23('0x5'));var config=require(_0x8b23('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x8b23('0x7')]=function(_0x20acf8,_0x539487){return _0x20acf8[_0x8b23('0x8')](_0x8b23('0x9'),attributes,{'tableName':_0x8b23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index c2d9899..ba0af79 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 _0x808c=['request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x12b838,_0x140461){var _0x4d0115=function(_0xf9839b){while(--_0xf9839b){_0x12b838['push'](_0x12b838['shift']());}};_0x4d0115(++_0x140461);}(_0x808c,0x13e));var _0xc808=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x808c[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xc808('0x0'));var util=require(_0xc808('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc808('0x2'));var fs=require('fs');var Redis=require(_0xc808('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc808('0x4'));var logger=require('../../config/logger')(_0xc808('0x5'));var config=require(_0xc808('0x6'));var jayson=require(_0xc808('0x7'));var client=jayson[_0xc808('0x8')][_0xc808('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e9d06,_0x511f63,_0x3e701b){return new BPromise(function(_0x46d357,_0xad0bd){return client[_0xc808('0xa')](_0x5e9d06,_0x3e701b)[_0xc808('0xb')](function(_0x4cdcf1){logger[_0xc808('0xc')](_0xc808('0xd'),_0x511f63,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x511f63,'request\x20sent',JSON[_0xc808('0xe')](_0x4cdcf1));if(_0x4cdcf1[_0xc808('0xf')]){if(_0x4cdcf1[_0xc808('0xf')][_0xc808('0x10')]===0x1f4){logger[_0xc808('0xf')](_0xc808('0xd'),_0x511f63,_0x4cdcf1[_0xc808('0xf')][_0xc808('0x11')]);return _0xad0bd(_0x4cdcf1['error'][_0xc808('0x11')]);}logger[_0xc808('0xf')](_0xc808('0xd'),_0x511f63,_0x4cdcf1[_0xc808('0xf')][_0xc808('0x11')]);return _0x46d357(_0x4cdcf1[_0xc808('0xf')]['message']);}else{logger[_0xc808('0xc')](_0xc808('0xd'),_0x511f63,_0xc808('0x12'));_0x46d357(_0x4cdcf1[_0xc808('0x13')][_0xc808('0x11')]);}})[_0xc808('0x14')](function(_0x3618dc){logger[_0xc808('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x511f63,_0x3618dc);_0xad0bd(_0x3618dc);});});} \ No newline at end of file +var _0xb2b5=['request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','client'];(function(_0x596e98,_0xc326c9){var _0x1c09ac=function(_0x3d839d){while(--_0x3d839d){_0x596e98['push'](_0x596e98['shift']());}};_0x1c09ac(++_0xc326c9);}(_0xb2b5,0xc0));var _0x5b2b=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xb2b5[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x5b2b('0x0'));var util=require(_0x5b2b('0x1'));var moment=require(_0x5b2b('0x2'));var BPromise=require(_0x5b2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5b2b('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4236bc,_0x30a670,_0x5d1f93){return new BPromise(function(_0x504f75,_0x1a5ea9){return client[_0x5b2b('0x6')](_0x4236bc,_0x5d1f93)[_0x5b2b('0x7')](function(_0x430c04){logger['info'](_0x5b2b('0x8'),_0x30a670,_0x5b2b('0x9'));logger['debug'](_0x5b2b('0xa'),_0x30a670,_0x5b2b('0x9'),JSON[_0x5b2b('0xb')](_0x430c04));if(_0x430c04[_0x5b2b('0xc')]){if(_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xd')]===0x1f4){logger[_0x5b2b('0xc')](_0x5b2b('0x8'),_0x30a670,_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);return _0x1a5ea9(_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);}logger[_0x5b2b('0xc')](_0x5b2b('0x8'),_0x30a670,_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);return _0x504f75(_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);}else{logger[_0x5b2b('0xf')](_0x5b2b('0x8'),_0x30a670,_0x5b2b('0x9'));_0x504f75(_0x430c04[_0x5b2b('0x10')][_0x5b2b('0xe')]);}})[_0x5b2b('0x11')](function(_0x57d35b){logger[_0x5b2b('0xc')](_0x5b2b('0x8'),_0x30a670,_0x57d35b);_0x1a5ea9(_0x57d35b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 91b858c..19daa54 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 _0xd662=['delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','run','/:id/query','query','post','put','update'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0xd662,0x85));var _0x2d66=function(_0x159638,_0x554a3a){_0x159638=_0x159638-0x0;var _0x2160f7=_0xd662[_0x159638];return _0x2160f7;};'use strict';var multer=require(_0x2d66('0x0'));var util=require(_0x2d66('0x1'));var path=require(_0x2d66('0x2'));var timeout=require(_0x2d66('0x3'));var express=require('express');var router=express[_0x2d66('0x4')]();var fs_extra=require(_0x2d66('0x5'));var auth=require(_0x2d66('0x6'));var interaction=require(_0x2d66('0x7'));var config=require(_0x2d66('0x8'));var controller=require(_0x2d66('0x9'));router[_0x2d66('0xa')]('/',auth[_0x2d66('0xb')](),controller[_0x2d66('0xc')]);router['get'](_0x2d66('0xd'),auth[_0x2d66('0xb')](),controller['show']);router[_0x2d66('0xa')](_0x2d66('0xe'),auth[_0x2d66('0xb')](),controller['preview']);router['get']('/:id/run',auth[_0x2d66('0xb')](),controller[_0x2d66('0xf')]);router[_0x2d66('0xa')](_0x2d66('0x10'),auth[_0x2d66('0xb')](),controller[_0x2d66('0x11')]);router[_0x2d66('0x12')]('/',auth[_0x2d66('0xb')](),controller['create']);router[_0x2d66('0x13')](_0x2d66('0xd'),auth[_0x2d66('0xb')](),controller[_0x2d66('0x14')]);router[_0x2d66('0x15')](_0x2d66('0xd'),auth[_0x2d66('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x37f8=['update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','create'];(function(_0x48adc5,_0x3f2723){var _0x1e532f=function(_0x360bd9){while(--_0x360bd9){_0x48adc5['push'](_0x48adc5['shift']());}};_0x1e532f(++_0x3f2723);}(_0x37f8,0xb3));var _0x837f=function(_0x2da707,_0x20ca44){_0x2da707=_0x2da707-0x0;var _0x211651=_0x37f8[_0x2da707];return _0x211651;};'use strict';var multer=require('multer');var util=require(_0x837f('0x0'));var path=require(_0x837f('0x1'));var timeout=require(_0x837f('0x2'));var express=require('express');var router=express[_0x837f('0x3')]();var fs_extra=require(_0x837f('0x4'));var auth=require(_0x837f('0x5'));var interaction=require(_0x837f('0x6'));var config=require(_0x837f('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x837f('0x8')]('/',auth[_0x837f('0x9')](),controller[_0x837f('0xa')]);router[_0x837f('0x8')](_0x837f('0xb'),auth['isAuthenticated'](),controller[_0x837f('0xc')]);router['get'](_0x837f('0xd'),auth[_0x837f('0x9')](),controller['preview']);router[_0x837f('0x8')](_0x837f('0xe'),auth['isAuthenticated'](),controller[_0x837f('0xf')]);router[_0x837f('0x8')](_0x837f('0x10'),auth[_0x837f('0x9')](),controller['query']);router[_0x837f('0x11')]('/',auth[_0x837f('0x9')](),controller[_0x837f('0x12')]);router['put']('/:id',auth[_0x837f('0x9')](),controller[_0x837f('0x13')]);router[_0x837f('0x14')](_0x837f('0xb'),auth[_0x837f('0x9')](),controller['destroy']);module[_0x837f('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 039ccd2..f00d0e6 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 _0xe1d8=['pdf','xlsx','csv','DATE','manual','scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1d8,0x168));var _0x8e1d=function(_0x242619,_0x44c6e2){_0x242619=_0x242619-0x0;var _0x577883=_0xe1d8[_0x242619];return _0x577883;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x8e1d('0x0')]={'name':{'type':Sequelize[_0x8e1d('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x8e1d('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x8e1d('0x2')]('csv',_0x8e1d('0x3'),_0x8e1d('0x4')),'allowNull':![],'defaultValue':_0x8e1d('0x5')},'savename':{'type':Sequelize[_0x8e1d('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8e1d('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8e1d('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x8e1d('0x7'),_0x8e1d('0x8')),'allowNull':![],'defaultValue':_0x8e1d('0x7')},'reportId':{'type':Sequelize[_0x8e1d('0x9')](0xb)[_0x8e1d('0xa')]},'reportType':{'type':Sequelize[_0x8e1d('0x1')]}}; \ No newline at end of file +var _0x4356=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','UNSIGNED','sequelize','moment'];(function(_0x5cfb92,_0x5797e6){var _0x1cd7c2=function(_0x1bb452){while(--_0x1bb452){_0x5cfb92['push'](_0x5cfb92['shift']());}};_0x1cd7c2(++_0x5797e6);}(_0x4356,0xe2));var _0x6435=function(_0x4bcc2a,_0x2528a7){_0x4bcc2a=_0x4bcc2a-0x0;var _0x20eaab=_0x4356[_0x4bcc2a];return _0x20eaab;};'use strict';var Sequelize=require(_0x6435('0x0'));var moment=require(_0x6435('0x1'));module[_0x6435('0x2')]={'name':{'type':Sequelize[_0x6435('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x6435('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x6435('0x4')](_0x6435('0x5'),_0x6435('0x6'),_0x6435('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x6435('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6435('0x8')]},'endDate':{'type':Sequelize[_0x6435('0x8')]},'status':{'type':Sequelize[_0x6435('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x6435('0x9'),_0x6435('0xa')),'allowNull':![],'defaultValue':_0x6435('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x6435('0xb')]},'reportType':{'type':Sequelize[_0x6435('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 6a2c61e..bc23e83 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 _0x2f91=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','limit','order','sort','where'];(function(_0xac5506,_0x7a1e38){var _0x180df6=function(_0x54eb82){while(--_0x54eb82){_0xac5506['push'](_0xac5506['shift']());}};_0x180df6(++_0x7a1e38);}(_0x2f91,0x134));var _0x12f9=function(_0x211fad,_0x19a959){_0x211fad=_0x211fad-0x0;var _0x1a6c85=_0x2f91[_0x211fad];return _0x1a6c85;};'use strict';var emlformat=require(_0x12f9('0x0'));var rimraf=require(_0x12f9('0x1'));var zipdir=require(_0x12f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12f9('0x3'));var moment=require(_0x12f9('0x4'));var BPromise=require(_0x12f9('0x5'));var Mustache=require(_0x12f9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x12f9('0x7'));var csv=require(_0x12f9('0x8'));var ejs=require(_0x12f9('0x9'));var fs=require('fs');var fs_extra=require(_0x12f9('0xa'));var _=require(_0x12f9('0xb'));var squel=require(_0x12f9('0xc'));var crypto=require(_0x12f9('0xd'));var jsforce=require(_0x12f9('0xe'));var deskjs=require(_0x12f9('0xf'));var toCsv=require(_0x12f9('0x8'));var querystring=require(_0x12f9('0x10'));var Papa=require(_0x12f9('0x11'));var Redis=require(_0x12f9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x12f9('0x13'));var as=require(_0x12f9('0x14'));var hardwareService=require(_0x12f9('0x15'));var logger=require('../../config/logger')(_0x12f9('0x16'));var utils=require(_0x12f9('0x17'));var config=require(_0x12f9('0x18'));var licenseUtil=require(_0x12f9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce2226,_0x489283){_0x489283=_0x489283||0xcc;return function(_0x20bfaa){if(_0x20bfaa){return _0xce2226['sendStatus'](_0x489283);}return _0xce2226[_0x12f9('0x1a')](_0x489283)['end']();};}function respondWithResult(_0x49f81f,_0x4f132c){_0x4f132c=_0x4f132c||0xc8;return function(_0x226ced){if(_0x226ced){return _0x49f81f[_0x12f9('0x1a')](_0x4f132c)['json'](_0x226ced);}};}function respondWithFilteredResult(_0x17123e,_0x288935){return function(_0x572052){if(_0x572052){var _0x2b56f1=typeof _0x288935[_0x12f9('0x1b')]===_0x12f9('0x1c')&&typeof _0x288935['limit']===_0x12f9('0x1c');var _0x45eb10=_0x572052[_0x12f9('0x1d')];var _0x21d5a9=_0x2b56f1?0x0:_0x288935[_0x12f9('0x1b')];var _0x662d96=_0x2b56f1?_0x572052[_0x12f9('0x1d')]:_0x288935[_0x12f9('0x1b')]+_0x288935['limit'];var _0x2cf215;if(_0x662d96>=_0x45eb10){_0x662d96=_0x45eb10;_0x2cf215=0xc8;}else{_0x2cf215=0xce;}_0x17123e[_0x12f9('0x1a')](_0x2cf215);return _0x17123e[_0x12f9('0x1e')](_0x12f9('0x1f'),_0x21d5a9+'-'+_0x662d96+'/'+_0x45eb10)['json'](_0x572052);}return null;};}function patchUpdates(_0x20b2c6){return function(_0x5d86a4){try{jsonpatch[_0x12f9('0x20')](_0x5d86a4,_0x20b2c6,!![]);}catch(_0x53c72a){return BPromise[_0x12f9('0x21')](_0x53c72a);}return _0x5d86a4[_0x12f9('0x22')]();};}function saveUpdates(_0x4aee03,_0x43cbea){return function(_0x2875e9){if(_0x2875e9){return _0x2875e9[_0x12f9('0x23')](_0x4aee03)[_0x12f9('0x24')](function(_0x15b0ca){return _0x15b0ca;});}return null;};}function removeEntity(_0x3e02ab,_0x3adecb){return function(_0xe567ad){if(_0xe567ad){return _0xe567ad[_0x12f9('0x25')]()[_0x12f9('0x24')](function(){var _0x5b49de=_0xe567ad[_0x12f9('0x26')]({'plain':!![]});var _0xea1edb=_0x12f9('0x27');return db[_0x12f9('0x28')][_0x12f9('0x25')]({'where':{'type':_0xea1edb,'resourceId':_0x5b49de['id']}})[_0x12f9('0x24')](function(){return _0xe567ad;});})['then'](function(){_0x3e02ab['status'](0xcc)[_0x12f9('0x29')]();});}};}function handleEntityNotFound(_0x3204ea,_0x1b1d22){return function(_0xbc0130){if(!_0xbc0130){_0x3204ea[_0x12f9('0x2a')](0x194);}return _0xbc0130;};}function handleError(_0x19d7ca,_0x2a844f){_0x2a844f=_0x2a844f||0x1f4;return function(_0x40489f){logger[_0x12f9('0x2b')](_0x40489f[_0x12f9('0x2c')]);if(_0x40489f['name']){delete _0x40489f[_0x12f9('0x2d')];}_0x19d7ca['status'](_0x2a844f)['send'](_0x40489f);};}exports['index']=function(_0x5b5a58,_0x1d9f2c){var _0x4b73cd={},_0x5632ea={},_0x36a54c={'count':0x0,'rows':[]};var _0x4d24cc=_[_0x12f9('0x2e')](db[_0x12f9('0x2f')][_0x12f9('0x30')],function(_0x5c311d){return{'name':_0x5c311d[_0x12f9('0x31')],'type':_0x5c311d[_0x12f9('0x32')][_0x12f9('0x33')]};});_0x5632ea[_0x12f9('0x34')]=_[_0x12f9('0x2e')](_0x4d24cc,'name');_0x5632ea['query']=_[_0x12f9('0x35')](_0x5b5a58['query']);_0x5632ea[_0x12f9('0x36')]=_[_0x12f9('0x37')](_0x5632ea['model'],_0x5632ea[_0x12f9('0x38')]);_0x4b73cd[_0x12f9('0x39')]=_['intersection'](_0x5632ea['model'],qs[_0x12f9('0x3a')](_0x5b5a58['query']['fields']));_0x4b73cd[_0x12f9('0x39')]=_0x4b73cd[_0x12f9('0x39')]['length']?_0x4b73cd[_0x12f9('0x39')]:_0x5632ea['model'];if(!_0x5b5a58['query'][_0x12f9('0x3b')]('nolimit')){_0x4b73cd[_0x12f9('0x3c')]=qs[_0x12f9('0x3c')](_0x5b5a58[_0x12f9('0x38')][_0x12f9('0x3c')]);_0x4b73cd['offset']=qs[_0x12f9('0x1b')](_0x5b5a58['query'][_0x12f9('0x1b')]);}_0x4b73cd[_0x12f9('0x3d')]=qs[_0x12f9('0x3e')](_0x5b5a58[_0x12f9('0x38')]['sort']);_0x4b73cd[_0x12f9('0x3f')]=qs[_0x12f9('0x36')](_[_0x12f9('0x40')](_0x5b5a58[_0x12f9('0x38')],_0x5632ea[_0x12f9('0x36')]),_0x4d24cc);if(_0x5b5a58[_0x12f9('0x38')][_0x12f9('0x41')]){_0x4b73cd[_0x12f9('0x3f')]=_[_0x12f9('0x42')](_0x4b73cd[_0x12f9('0x3f')],{'$or':_['map'](_0x4d24cc,function(_0x5420f7){if(_0x5420f7[_0x12f9('0x32')]!==_0x12f9('0x43')){var _0x4b6d7f={};_0x4b6d7f[_0x5420f7['name']]={'$like':'%'+_0x5b5a58[_0x12f9('0x38')]['filter']+'%'};return _0x4b6d7f;}})});}_0x4b73cd=_[_0x12f9('0x42')]({},_0x4b73cd,_0x5b5a58['options']);var _0xdd8ee9={'where':_0x4b73cd[_0x12f9('0x3f')]};return db['AnalyticExtractedReport']['count'](_0xdd8ee9)[_0x12f9('0x24')](function(_0x5e9235){_0x36a54c[_0x12f9('0x1d')]=_0x5e9235;if(_0x5b5a58[_0x12f9('0x38')][_0x12f9('0x44')]){_0x4b73cd[_0x12f9('0x45')]=[{'all':!![]}];}return db[_0x12f9('0x2f')][_0x12f9('0x46')](_0x4b73cd);})['then'](function(_0x11a8d7){_0x36a54c['rows']=_0x11a8d7;return _0x36a54c;})['then'](respondWithFilteredResult(_0x1d9f2c,_0x4b73cd))[_0x12f9('0x47')](handleError(_0x1d9f2c,null));};exports['show']=function(_0x19e36d,_0x29bc04){var _0x363c73={'raw':!![],'where':{'id':_0x19e36d['params']['id']}},_0x117d75={};_0x117d75[_0x12f9('0x34')]=_['keys'](db[_0x12f9('0x2f')][_0x12f9('0x30')]);_0x117d75[_0x12f9('0x38')]=_[_0x12f9('0x35')](_0x19e36d[_0x12f9('0x38')]);_0x117d75[_0x12f9('0x36')]=_[_0x12f9('0x37')](_0x117d75[_0x12f9('0x34')],_0x117d75[_0x12f9('0x38')]);_0x363c73[_0x12f9('0x39')]=_[_0x12f9('0x37')](_0x117d75[_0x12f9('0x34')],qs[_0x12f9('0x3a')](_0x19e36d[_0x12f9('0x38')][_0x12f9('0x3a')]));_0x363c73[_0x12f9('0x39')]=_0x363c73[_0x12f9('0x39')]['length']?_0x363c73[_0x12f9('0x39')]:_0x117d75[_0x12f9('0x34')];if(_0x19e36d[_0x12f9('0x38')][_0x12f9('0x44')]){_0x363c73[_0x12f9('0x45')]=[{'all':!![]}];}_0x363c73=_['merge']({},_0x363c73,_0x19e36d[_0x12f9('0x48')]);return db[_0x12f9('0x2f')]['find'](_0x363c73)[_0x12f9('0x24')](handleEntityNotFound(_0x29bc04,null))[_0x12f9('0x24')](respondWithResult(_0x29bc04,null))[_0x12f9('0x47')](handleError(_0x29bc04,null));};exports[_0x12f9('0x49')]=function(_0x2ba999,_0x2174e2){return db['AnalyticExtractedReport'][_0x12f9('0x49')](_0x2ba999[_0x12f9('0x4a')],{})[_0x12f9('0x24')](function(_0x4bd158){var _0x6074c8=_0x2ba999[_0x12f9('0x4b')][_0x12f9('0x26')]({'plain':!![]});if(!_0x6074c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6074c8[_0x12f9('0x4c')]===_0x12f9('0x4b')){var _0x590609=_0x4bd158[_0x12f9('0x26')]({'plain':!![]});var _0x58934d=_0x12f9('0x27');return db[_0x12f9('0x4d')][_0x12f9('0x4e')]({'where':{'name':_0x58934d,'userProfileId':_0x6074c8[_0x12f9('0x4f')]},'raw':!![]})[_0x12f9('0x24')](function(_0x486fea){if(_0x486fea&&_0x486fea[_0x12f9('0x50')]===0x0){return db[_0x12f9('0x28')][_0x12f9('0x49')]({'name':_0x590609[_0x12f9('0x2d')],'resourceId':_0x590609['id'],'type':_0x486fea[_0x12f9('0x2d')],'sectionId':_0x486fea['id']},{})[_0x12f9('0x24')](function(){return _0x4bd158;});}else{return _0x4bd158;}})[_0x12f9('0x47')](function(_0x49bf65){logger[_0x12f9('0x2b')](_0x12f9('0x51'),_0x49bf65);throw _0x49bf65;});}return _0x4bd158;})['then'](respondWithResult(_0x2174e2,0xc9))[_0x12f9('0x47')](handleError(_0x2174e2,null));};exports[_0x12f9('0x23')]=function(_0xfdff3f,_0x2b4502){if(_0xfdff3f[_0x12f9('0x4a')]['id']){delete _0xfdff3f[_0x12f9('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x12f9('0x4e')]({'where':{'id':_0xfdff3f[_0x12f9('0x52')]['id']}})[_0x12f9('0x24')](handleEntityNotFound(_0x2b4502,null))[_0x12f9('0x24')](saveUpdates(_0xfdff3f[_0x12f9('0x4a')],null))['then'](respondWithResult(_0x2b4502,null))[_0x12f9('0x47')](handleError(_0x2b4502,null));};exports['destroy']=function(_0x2c68dc,_0x28cf7a){return db[_0x12f9('0x2f')][_0x12f9('0x4e')]({'where':{'id':_0x2c68dc[_0x12f9('0x52')]['id']}})[_0x12f9('0x24')](handleEntityNotFound(_0x28cf7a,null))[_0x12f9('0x24')](removeEntity(_0x28cf7a,null))[_0x12f9('0x47')](handleError(_0x28cf7a,null));};exports[_0x12f9('0x53')]=function(_0x6f7532,_0x3e0b38,_0x4bc6e2){return db['AnalyticExtractedReport'][_0x12f9('0x4e')]({'where':{'id':_0x6f7532[_0x12f9('0x52')]['id']},'attributes':[_0x12f9('0x2d'),_0x12f9('0x54'),_0x12f9('0x55'),'output'],'raw':!![]})[_0x12f9('0x24')](handleEntityNotFound(_0x3e0b38,null))[_0x12f9('0x24')](function(_0x11e467){if(_0x11e467){if(!fs[_0x12f9('0x56')](path[_0x12f9('0x57')](config['root'],_0x12f9('0x58'),_0x11e467['savename']))){throw new db[(_0x12f9('0x59'))][(_0x12f9('0x5a'))](_0x12f9('0x5b'));}if(_0x6f7532[_0x12f9('0x38')]['exists']){return _0x3e0b38[_0x12f9('0x2a')](0xc8);}return _0x3e0b38['download'](path[_0x12f9('0x57')](config[_0x12f9('0x5c')],'server/files/reports',_0x11e467[_0x12f9('0x55')]),util['format']('%s.%s',_0x11e467['basename']||_0x11e467['name'],_0x11e467['output']['toLowerCase']()));}})['catch'](handleError(_0x3e0b38,null));}; \ No newline at end of file +var _0xb4e4=['model','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','rows','catch','params','length','includeAll','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','map','query','keys','filters'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0xb4e4,0x89));var _0x4b4e=function(_0x36afc3,_0x4956c9){_0x36afc3=_0x36afc3-0x0;var _0x405cb9=_0xb4e4[_0x36afc3];return _0x405cb9;};'use strict';var emlformat=require(_0x4b4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4b4e('0x1'));var rp=require(_0x4b4e('0x2'));var moment=require('moment');var BPromise=require(_0x4b4e('0x3'));var Mustache=require(_0x4b4e('0x4'));var util=require(_0x4b4e('0x5'));var path=require(_0x4b4e('0x6'));var sox=require('sox');var csv=require(_0x4b4e('0x7'));var ejs=require(_0x4b4e('0x8'));var fs=require('fs');var fs_extra=require(_0x4b4e('0x9'));var _=require(_0x4b4e('0xa'));var squel=require(_0x4b4e('0xb'));var crypto=require(_0x4b4e('0xc'));var jsforce=require(_0x4b4e('0xd'));var deskjs=require(_0x4b4e('0xe'));var toCsv=require(_0x4b4e('0x7'));var querystring=require(_0x4b4e('0xf'));var Papa=require(_0x4b4e('0x10'));var Redis=require('ioredis');var authService=require(_0x4b4e('0x11'));var qs=require(_0x4b4e('0x12'));var as=require(_0x4b4e('0x13'));var hardwareService=require(_0x4b4e('0x14'));var logger=require(_0x4b4e('0x15'))(_0x4b4e('0x16'));var utils=require(_0x4b4e('0x17'));var config=require(_0x4b4e('0x18'));var licenseUtil=require(_0x4b4e('0x19'));var db=require(_0x4b4e('0x1a'))['db'];function respondWithStatusCode(_0x26d8fa,_0x2c3dd6){_0x2c3dd6=_0x2c3dd6||0xcc;return function(_0x53c83d){if(_0x53c83d){return _0x26d8fa['sendStatus'](_0x2c3dd6);}return _0x26d8fa[_0x4b4e('0x1b')](_0x2c3dd6)[_0x4b4e('0x1c')]();};}function respondWithResult(_0x2ec170,_0x1ff8d8){_0x1ff8d8=_0x1ff8d8||0xc8;return function(_0x3bf9db){if(_0x3bf9db){return _0x2ec170['status'](_0x1ff8d8)[_0x4b4e('0x1d')](_0x3bf9db);}};}function respondWithFilteredResult(_0x186083,_0x5716ae){return function(_0x553845){if(_0x553845){var _0x13ddb3=typeof _0x5716ae[_0x4b4e('0x1e')]===_0x4b4e('0x1f')&&typeof _0x5716ae[_0x4b4e('0x20')]===_0x4b4e('0x1f');var _0x4b6c21=_0x553845[_0x4b4e('0x21')];var _0xe4f17a=_0x13ddb3?0x0:_0x5716ae[_0x4b4e('0x1e')];var _0x510d7a=_0x13ddb3?_0x553845[_0x4b4e('0x21')]:_0x5716ae[_0x4b4e('0x1e')]+_0x5716ae[_0x4b4e('0x20')];var _0x4bb061;if(_0x510d7a>=_0x4b6c21){_0x510d7a=_0x4b6c21;_0x4bb061=0xc8;}else{_0x4bb061=0xce;}_0x186083['status'](_0x4bb061);return _0x186083[_0x4b4e('0x22')](_0x4b4e('0x23'),_0xe4f17a+'-'+_0x510d7a+'/'+_0x4b6c21)[_0x4b4e('0x1d')](_0x553845);}return null;};}function patchUpdates(_0x236a09){return function(_0x329d4b){try{jsonpatch['apply'](_0x329d4b,_0x236a09,!![]);}catch(_0x8fea27){return BPromise[_0x4b4e('0x24')](_0x8fea27);}return _0x329d4b[_0x4b4e('0x25')]();};}function saveUpdates(_0x577870,_0x286fb0){return function(_0x5711b5){if(_0x5711b5){return _0x5711b5[_0x4b4e('0x26')](_0x577870)[_0x4b4e('0x27')](function(_0x3c4fff){return _0x3c4fff;});}return null;};}function removeEntity(_0x9d5fb2,_0x1a0ae3){return function(_0x4cd308){if(_0x4cd308){return _0x4cd308[_0x4b4e('0x28')]()[_0x4b4e('0x27')](function(){var _0xa4063b=_0x4cd308[_0x4b4e('0x29')]({'plain':!![]});var _0x12bf37='ExtractedReports';return db['UserProfileResource'][_0x4b4e('0x28')]({'where':{'type':_0x12bf37,'resourceId':_0xa4063b['id']}})[_0x4b4e('0x27')](function(){return _0x4cd308;});})['then'](function(){_0x9d5fb2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26acae,_0x2f0a93){return function(_0x25ecd1){if(!_0x25ecd1){_0x26acae[_0x4b4e('0x2a')](0x194);}return _0x25ecd1;};}function handleError(_0x3a3ecc,_0x47c22d){_0x47c22d=_0x47c22d||0x1f4;return function(_0x5846ba){logger[_0x4b4e('0x2b')](_0x5846ba[_0x4b4e('0x2c')]);if(_0x5846ba[_0x4b4e('0x2d')]){delete _0x5846ba['name'];}_0x3a3ecc[_0x4b4e('0x1b')](_0x47c22d)[_0x4b4e('0x2e')](_0x5846ba);};}exports[_0x4b4e('0x2f')]=function(_0x3fdc23,_0x36efef){var _0x1751bb={},_0x12ad6a={},_0xabeb5c={'count':0x0,'rows':[]};var _0x4d635b=_['map'](db[_0x4b4e('0x30')][_0x4b4e('0x31')],function(_0x2f6284){return{'name':_0x2f6284[_0x4b4e('0x32')],'type':_0x2f6284[_0x4b4e('0x33')][_0x4b4e('0x34')]};});_0x12ad6a['model']=_[_0x4b4e('0x35')](_0x4d635b,_0x4b4e('0x2d'));_0x12ad6a[_0x4b4e('0x36')]=_[_0x4b4e('0x37')](_0x3fdc23[_0x4b4e('0x36')]);_0x12ad6a[_0x4b4e('0x38')]=_['intersection'](_0x12ad6a['model'],_0x12ad6a[_0x4b4e('0x36')]);_0x1751bb['attributes']=_['intersection'](_0x12ad6a[_0x4b4e('0x39')],qs[_0x4b4e('0x3a')](_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x3a')]));_0x1751bb[_0x4b4e('0x3b')]=_0x1751bb[_0x4b4e('0x3b')]['length']?_0x1751bb['attributes']:_0x12ad6a['model'];if(!_0x3fdc23[_0x4b4e('0x36')]['hasOwnProperty'](_0x4b4e('0x3c'))){_0x1751bb['limit']=qs[_0x4b4e('0x20')](_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x20')]);_0x1751bb[_0x4b4e('0x1e')]=qs[_0x4b4e('0x1e')](_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x1e')]);}_0x1751bb[_0x4b4e('0x3d')]=qs[_0x4b4e('0x3e')](_0x3fdc23['query'][_0x4b4e('0x3e')]);_0x1751bb[_0x4b4e('0x3f')]=qs[_0x4b4e('0x38')](_[_0x4b4e('0x40')](_0x3fdc23[_0x4b4e('0x36')],_0x12ad6a[_0x4b4e('0x38')]),_0x4d635b);if(_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x41')]){_0x1751bb[_0x4b4e('0x3f')]=_['merge'](_0x1751bb[_0x4b4e('0x3f')],{'$or':_[_0x4b4e('0x35')](_0x4d635b,function(_0x14b06b){if(_0x14b06b['type']!==_0x4b4e('0x42')){var _0x2b12ff={};_0x2b12ff[_0x14b06b[_0x4b4e('0x2d')]]={'$like':'%'+_0x3fdc23[_0x4b4e('0x36')]['filter']+'%'};return _0x2b12ff;}})});}_0x1751bb=_[_0x4b4e('0x43')]({},_0x1751bb,_0x3fdc23['options']);var _0x5c82ef={'where':_0x1751bb[_0x4b4e('0x3f')]};return db['AnalyticExtractedReport'][_0x4b4e('0x21')](_0x5c82ef)[_0x4b4e('0x27')](function(_0x12fe18){_0xabeb5c['count']=_0x12fe18;if(_0x3fdc23[_0x4b4e('0x36')]['includeAll']){_0x1751bb['include']=[{'all':!![]}];}return db[_0x4b4e('0x30')]['findAll'](_0x1751bb);})['then'](function(_0x35a304){_0xabeb5c[_0x4b4e('0x44')]=_0x35a304;return _0xabeb5c;})[_0x4b4e('0x27')](respondWithFilteredResult(_0x36efef,_0x1751bb))[_0x4b4e('0x45')](handleError(_0x36efef,null));};exports['show']=function(_0x147c79,_0x89c59a){var _0x1c97d5={'raw':!![],'where':{'id':_0x147c79[_0x4b4e('0x46')]['id']}},_0x323798={};_0x323798['model']=_[_0x4b4e('0x37')](db[_0x4b4e('0x30')]['rawAttributes']);_0x323798[_0x4b4e('0x36')]=_['keys'](_0x147c79[_0x4b4e('0x36')]);_0x323798[_0x4b4e('0x38')]=_['intersection'](_0x323798[_0x4b4e('0x39')],_0x323798[_0x4b4e('0x36')]);_0x1c97d5[_0x4b4e('0x3b')]=_['intersection'](_0x323798[_0x4b4e('0x39')],qs[_0x4b4e('0x3a')](_0x147c79[_0x4b4e('0x36')][_0x4b4e('0x3a')]));_0x1c97d5[_0x4b4e('0x3b')]=_0x1c97d5[_0x4b4e('0x3b')][_0x4b4e('0x47')]?_0x1c97d5['attributes']:_0x323798[_0x4b4e('0x39')];if(_0x147c79[_0x4b4e('0x36')][_0x4b4e('0x48')]){_0x1c97d5[_0x4b4e('0x49')]=[{'all':!![]}];}_0x1c97d5=_['merge']({},_0x1c97d5,_0x147c79[_0x4b4e('0x4a')]);return db[_0x4b4e('0x30')]['find'](_0x1c97d5)['then'](handleEntityNotFound(_0x89c59a,null))[_0x4b4e('0x27')](respondWithResult(_0x89c59a,null))[_0x4b4e('0x45')](handleError(_0x89c59a,null));};exports[_0x4b4e('0x4b')]=function(_0x12338,_0x1bd553){return db[_0x4b4e('0x30')][_0x4b4e('0x4b')](_0x12338['body'],{})[_0x4b4e('0x27')](function(_0x5a7104){var _0x261e00=_0x12338[_0x4b4e('0x4c')]['get']({'plain':!![]});if(!_0x261e00)throw new Error(_0x4b4e('0x4d'));if(_0x261e00[_0x4b4e('0x4e')]===_0x4b4e('0x4c')){var _0x53e5ea=_0x5a7104[_0x4b4e('0x29')]({'plain':!![]});var _0xb48917='ExtractedReports';return db[_0x4b4e('0x4f')][_0x4b4e('0x50')]({'where':{'name':_0xb48917,'userProfileId':_0x261e00['userProfileId']},'raw':!![]})['then'](function(_0x352cb4){if(_0x352cb4&&_0x352cb4[_0x4b4e('0x51')]===0x0){return db[_0x4b4e('0x52')][_0x4b4e('0x4b')]({'name':_0x53e5ea['name'],'resourceId':_0x53e5ea['id'],'type':_0x352cb4[_0x4b4e('0x2d')],'sectionId':_0x352cb4['id']},{})['then'](function(){return _0x5a7104;});}else{return _0x5a7104;}})[_0x4b4e('0x45')](function(_0x52b178){logger[_0x4b4e('0x2b')](_0x4b4e('0x53'),_0x52b178);throw _0x52b178;});}return _0x5a7104;})['then'](respondWithResult(_0x1bd553,0xc9))['catch'](handleError(_0x1bd553,null));};exports[_0x4b4e('0x26')]=function(_0x6f45f7,_0x4dd592){if(_0x6f45f7['body']['id']){delete _0x6f45f7['body']['id'];}return db[_0x4b4e('0x30')][_0x4b4e('0x50')]({'where':{'id':_0x6f45f7[_0x4b4e('0x46')]['id']}})[_0x4b4e('0x27')](handleEntityNotFound(_0x4dd592,null))[_0x4b4e('0x27')](saveUpdates(_0x6f45f7[_0x4b4e('0x54')],null))['then'](respondWithResult(_0x4dd592,null))[_0x4b4e('0x45')](handleError(_0x4dd592,null));};exports[_0x4b4e('0x28')]=function(_0x483b29,_0x98eb3d){return db['AnalyticExtractedReport'][_0x4b4e('0x50')]({'where':{'id':_0x483b29['params']['id']}})[_0x4b4e('0x27')](handleEntityNotFound(_0x98eb3d,null))['then'](removeEntity(_0x98eb3d,null))[_0x4b4e('0x45')](handleError(_0x98eb3d,null));};exports[_0x4b4e('0x55')]=function(_0x457477,_0x20372e,_0x24536e){return db[_0x4b4e('0x30')][_0x4b4e('0x50')]({'where':{'id':_0x457477[_0x4b4e('0x46')]['id']},'attributes':['name',_0x4b4e('0x56'),_0x4b4e('0x57'),_0x4b4e('0x58')],'raw':!![]})[_0x4b4e('0x27')](handleEntityNotFound(_0x20372e,null))['then'](function(_0x4a5c2d){if(_0x4a5c2d){if(!fs['existsSync'](path[_0x4b4e('0x59')](config[_0x4b4e('0x5a')],_0x4b4e('0x5b'),_0x4a5c2d['savename']))){throw new db[(_0x4b4e('0x5c'))][(_0x4b4e('0x5d'))](_0x4b4e('0x5e'));}if(_0x457477[_0x4b4e('0x36')][_0x4b4e('0x5f')]){return _0x20372e[_0x4b4e('0x2a')](0xc8);}return _0x20372e['download'](path[_0x4b4e('0x59')](config[_0x4b4e('0x5a')],'server/files/reports',_0x4a5c2d['savename']),util['format']('%s.%s',_0x4a5c2d['basename']||_0x4a5c2d[_0x4b4e('0x2d')],_0x4a5c2d['output'][_0x4b4e('0x60')]()));}})[_0x4b4e('0x45')](handleError(_0x20372e,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 4965cac..d86257e 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 _0xd528=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x51d22e,_0x276640){var _0x275be3=function(_0x52d368){while(--_0x52d368){_0x51d22e['push'](_0x51d22e['shift']());}};_0x275be3(++_0x276640);}(_0xd528,0xc3));var _0x8d52=function(_0x380914,_0x5b90a1){_0x380914=_0x380914-0x0;var _0x23f34e=_0xd528[_0x380914];return _0x23f34e;};'use strict';var _=require(_0x8d52('0x0'));var util=require(_0x8d52('0x1'));var logger=require(_0x8d52('0x2'))(_0x8d52('0x3'));var moment=require(_0x8d52('0x4'));var BPromise=require(_0x8d52('0x5'));var rp=require(_0x8d52('0x6'));var fs=require('fs');var path=require(_0x8d52('0x7'));var rimraf=require(_0x8d52('0x8'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x8d52('0x9')]=function(_0x96cf3c,_0x19ff49){return _0x96cf3c[_0x8d52('0xa')](_0x8d52('0xb'),attributes,{'tableName':_0x8d52('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4702=['moment','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x2a1d58,_0x130e30){var _0x231fdf=function(_0x33b191){while(--_0x33b191){_0x2a1d58['push'](_0x2a1d58['shift']());}};_0x231fdf(++_0x130e30);}(_0x4702,0xd9));var _0x2470=function(_0x3b178d,_0x225115){_0x3b178d=_0x3b178d-0x0;var _0x1d4a81=_0x4702[_0x3b178d];return _0x1d4a81;};'use strict';var _=require(_0x2470('0x0'));var util=require(_0x2470('0x1'));var logger=require(_0x2470('0x2'))(_0x2470('0x3'));var moment=require(_0x2470('0x4'));var BPromise=require(_0x2470('0x5'));var rp=require(_0x2470('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2470('0x7'));var config=require('../../config/environment');var attributes=require(_0x2470('0x8'));module[_0x2470('0x9')]=function(_0x367651,_0x5c405f){return _0x367651[_0x2470('0xa')](_0x2470('0xb'),attributes,{'tableName':_0x2470('0xc'),'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 10e3460..11a8329 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 _0x4c58=['then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request'];(function(_0x3a39a5,_0x1e508c){var _0x5b035a=function(_0x187b81){while(--_0x187b81){_0x3a39a5['push'](_0x3a39a5['shift']());}};_0x5b035a(++_0x1e508c);}(_0x4c58,0x113));var _0x84c5=function(_0x25e70f,_0x845be6){_0x25e70f=_0x25e70f-0x0;var _0x1b262e=_0x4c58[_0x25e70f];return _0x1b262e;};'use strict';var _=require(_0x84c5('0x0'));var util=require(_0x84c5('0x1'));var moment=require(_0x84c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x84c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84c5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84c5('0x5'));var config=require('../../config/environment');var jayson=require(_0x84c5('0x6'));var client=jayson[_0x84c5('0x7')][_0x84c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x218a67,_0x495a9c,_0x5a5fa0){return new BPromise(function(_0x559f6e,_0x69ecb0){return client[_0x84c5('0x9')](_0x218a67,_0x5a5fa0)[_0x84c5('0xa')](function(_0x33dce4){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x495a9c,_0x84c5('0xb'));logger[_0x84c5('0xc')](_0x84c5('0xd'),_0x495a9c,'request\x20sent',JSON[_0x84c5('0xe')](_0x33dce4));if(_0x33dce4[_0x84c5('0xf')]){if(_0x33dce4[_0x84c5('0xf')][_0x84c5('0x10')]===0x1f4){logger[_0x84c5('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x495a9c,_0x33dce4[_0x84c5('0xf')][_0x84c5('0x11')]);return _0x69ecb0(_0x33dce4[_0x84c5('0xf')]['message']);}logger[_0x84c5('0xf')](_0x84c5('0x12'),_0x495a9c,_0x33dce4[_0x84c5('0xf')][_0x84c5('0x11')]);return _0x559f6e(_0x33dce4[_0x84c5('0xf')][_0x84c5('0x11')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x495a9c,_0x84c5('0xb'));_0x559f6e(_0x33dce4['result'][_0x84c5('0x11')]);}})['catch'](function(_0x120d05){logger[_0x84c5('0xf')](_0x84c5('0x12'),_0x495a9c,_0x120d05);_0x69ecb0(_0x120d05);});});} \ No newline at end of file +var _0xf729=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis'];(function(_0x47794f,_0x3a0baf){var _0x423604=function(_0x379cd6){while(--_0x379cd6){_0x47794f['push'](_0x47794f['shift']());}};_0x423604(++_0x3a0baf);}(_0xf729,0x1b4));var _0x9f72=function(_0x4765c6,_0x47036e){_0x4765c6=_0x4765c6-0x0;var _0x28f9bd=_0xf729[_0x4765c6];return _0x28f9bd;};'use strict';var _=require(_0x9f72('0x0'));var util=require(_0x9f72('0x1'));var moment=require(_0x9f72('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f72('0x4'));var logger=require(_0x9f72('0x5'))(_0x9f72('0x6'));var config=require(_0x9f72('0x7'));var jayson=require(_0x9f72('0x8'));var client=jayson[_0x9f72('0x9')][_0x9f72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x287d43,_0x4c545a,_0x4a8d2d){return new BPromise(function(_0x236c1c,_0x45453e){return client['request'](_0x287d43,_0x4a8d2d)[_0x9f72('0xb')](function(_0x9771c3){logger[_0x9f72('0xc')](_0x9f72('0xd'),_0x4c545a,_0x9f72('0xe'));logger[_0x9f72('0xf')](_0x9f72('0x10'),_0x4c545a,_0x9f72('0xe'),JSON[_0x9f72('0x11')](_0x9771c3));if(_0x9771c3[_0x9f72('0x12')]){if(_0x9771c3[_0x9f72('0x12')][_0x9f72('0x13')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c545a,_0x9771c3[_0x9f72('0x12')]['message']);return _0x45453e(_0x9771c3[_0x9f72('0x12')][_0x9f72('0x14')]);}logger[_0x9f72('0x12')](_0x9f72('0xd'),_0x4c545a,_0x9771c3[_0x9f72('0x12')][_0x9f72('0x14')]);return _0x236c1c(_0x9771c3[_0x9f72('0x12')][_0x9f72('0x14')]);}else{logger[_0x9f72('0xc')](_0x9f72('0xd'),_0x4c545a,_0x9f72('0xe'));_0x236c1c(_0x9771c3['result']['message']);}})[_0x9f72('0x15')](function(_0x5c73ed){logger[_0x9f72('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c545a,_0x5c73ed);_0x45453e(_0x5c73ed);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 9f5690e..60ea4b6 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 _0x8d05=['create','put','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','/:id/download','download'];(function(_0x364ed4,_0xea6d7a){var _0x4f43f7=function(_0xb2e113){while(--_0xb2e113){_0x364ed4['push'](_0x364ed4['shift']());}};_0x4f43f7(++_0xea6d7a);}(_0x8d05,0x125));var _0x58d0=function(_0x40b87,_0x209a34){_0x40b87=_0x40b87-0x0;var _0x5dfad8=_0x8d05[_0x40b87];return _0x5dfad8;};'use strict';var multer=require(_0x58d0('0x0'));var util=require('util');var path=require(_0x58d0('0x1'));var timeout=require(_0x58d0('0x2'));var express=require(_0x58d0('0x3'));var router=express[_0x58d0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58d0('0x5'));var config=require(_0x58d0('0x6'));var controller=require(_0x58d0('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x58d0('0x8')](_0x58d0('0x9'),auth[_0x58d0('0xa')](),controller['show']);router[_0x58d0('0x8')](_0x58d0('0xb'),auth['isAuthenticated'](),controller[_0x58d0('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x58d0('0xd')]);router[_0x58d0('0xe')](_0x58d0('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x58d0('0x9'),auth[_0x58d0('0xa')](),controller[_0x58d0('0xf')]);module[_0x58d0('0x10')]=router; \ No newline at end of file +var _0xd633=['./analyticExtractedReport.controller','get','isAuthenticated','index','download','create','/:id','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a8130,_0x2b7f50){var _0x55931f=function(_0x5340bb){while(--_0x5340bb){_0x5a8130['push'](_0x5a8130['shift']());}};_0x55931f(++_0x2b7f50);}(_0xd633,0x15b));var _0x3d63=function(_0x371b87,_0x177b5f){_0x371b87=_0x371b87-0x0;var _0x2aca85=_0xd633[_0x371b87];return _0x2aca85;};'use strict';var multer=require(_0x3d63('0x0'));var util=require(_0x3d63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3d63('0x2'));var auth=require(_0x3d63('0x3'));var interaction=require(_0x3d63('0x4'));var config=require('../../config/environment');var controller=require(_0x3d63('0x5'));router[_0x3d63('0x6')]('/',auth[_0x3d63('0x7')](),controller[_0x3d63('0x8')]);router['get']('/:id',auth[_0x3d63('0x7')](),controller['show']);router['get']('/:id/download',auth[_0x3d63('0x7')](),controller[_0x3d63('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3d63('0xa')]);router['put'](_0x3d63('0xb'),auth[_0x3d63('0x7')](),controller[_0x3d63('0xc')]);router[_0x3d63('0xd')]('/:id',auth[_0x3d63('0x7')](),controller[_0x3d63('0xe')]);module[_0x3d63('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 82d2532..f97dab5 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 _0x4604=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x137383,_0x46486f){var _0x5d7bfb=function(_0x27045f){while(--_0x27045f){_0x137383['push'](_0x137383['shift']());}};_0x5d7bfb(++_0x46486f);}(_0x4604,0xf8));var _0x4460=function(_0x592526,_0x46353d){_0x592526=_0x592526-0x0;var _0x4363f4=_0x4604[_0x592526];return _0x4363f4;};'use strict';var Sequelize=require(_0x4460('0x0'));module['exports']={'field':{'type':Sequelize[_0x4460('0x1')]},'alias':{'type':Sequelize[_0x4460('0x2')]},'function':{'type':Sequelize[_0x4460('0x2')]},'format':{'type':Sequelize[_0x4460('0x2')]},'groupBy':{'type':Sequelize[_0x4460('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4460('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc7e0=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x4d3a9b,_0x20b47d){var _0x1b5471=function(_0x51bf57){while(--_0x51bf57){_0x4d3a9b['push'](_0x4d3a9b['shift']());}};_0x1b5471(++_0x20b47d);}(_0xc7e0,0x1e3));var _0x0c7e=function(_0xfb8dec,_0x436634){_0xfb8dec=_0xfb8dec-0x0;var _0x3c4114=_0xc7e0[_0xfb8dec];return _0x3c4114;};'use strict';var Sequelize=require(_0x0c7e('0x0'));module[_0x0c7e('0x1')]={'field':{'type':Sequelize[_0x0c7e('0x2')]},'alias':{'type':Sequelize[_0x0c7e('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x0c7e('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0c7e('0x3')]},'custom':{'type':Sequelize[_0x0c7e('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index efc9d2e..81c7fcc 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 _0x1d32=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','create','catch','bulkCreate','body','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5a61be,_0x2b240a){var _0x52d35e=function(_0x3bc428){while(--_0x3bc428){_0x5a61be['push'](_0x5a61be['shift']());}};_0x52d35e(++_0x2b240a);}(_0x1d32,0x1e3));var _0x21d3=function(_0x383059,_0x11764a){_0x383059=_0x383059-0x0;var _0x18ffde=_0x1d32[_0x383059];return _0x18ffde;};'use strict';var emlformat=require(_0x21d3('0x0'));var rimraf=require(_0x21d3('0x1'));var zipdir=require(_0x21d3('0x2'));var jsonpatch=require(_0x21d3('0x3'));var rp=require(_0x21d3('0x4'));var moment=require(_0x21d3('0x5'));var BPromise=require(_0x21d3('0x6'));var Mustache=require(_0x21d3('0x7'));var util=require(_0x21d3('0x8'));var path=require(_0x21d3('0x9'));var sox=require(_0x21d3('0xa'));var csv=require(_0x21d3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21d3('0xc'));var _=require('lodash');var squel=require(_0x21d3('0xd'));var crypto=require(_0x21d3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x21d3('0xf'));var toCsv=require(_0x21d3('0xb'));var querystring=require(_0x21d3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x21d3('0x11'));var qs=require(_0x21d3('0x12'));var as=require(_0x21d3('0x13'));var hardwareService=require(_0x21d3('0x14'));var logger=require(_0x21d3('0x15'))(_0x21d3('0x16'));var utils=require(_0x21d3('0x17'));var config=require(_0x21d3('0x18'));var licenseUtil=require(_0x21d3('0x19'));var db=require(_0x21d3('0x1a'))['db'];function respondWithStatusCode(_0x55ce71,_0x5bfaec){_0x5bfaec=_0x5bfaec||0xcc;return function(_0x4bbc01){if(_0x4bbc01){return _0x55ce71['sendStatus'](_0x5bfaec);}return _0x55ce71[_0x21d3('0x1b')](_0x5bfaec)[_0x21d3('0x1c')]();};}function respondWithResult(_0x32e383,_0x2ea15a){_0x2ea15a=_0x2ea15a||0xc8;return function(_0x398db3){if(_0x398db3){return _0x32e383[_0x21d3('0x1b')](_0x2ea15a)[_0x21d3('0x1d')](_0x398db3);}};}function respondWithFilteredResult(_0xfc3a5d,_0x27c409){return function(_0x12b0c9){if(_0x12b0c9){var _0x5e0edd=typeof _0x27c409[_0x21d3('0x1e')]===_0x21d3('0x1f')&&typeof _0x27c409[_0x21d3('0x20')]==='undefined';var _0x50360d=_0x12b0c9[_0x21d3('0x21')];var _0x58d6d1=_0x5e0edd?0x0:_0x27c409['offset'];var _0x36f74f=_0x5e0edd?_0x12b0c9[_0x21d3('0x21')]:_0x27c409[_0x21d3('0x1e')]+_0x27c409[_0x21d3('0x20')];var _0x1d9517;if(_0x36f74f>=_0x50360d){_0x36f74f=_0x50360d;_0x1d9517=0xc8;}else{_0x1d9517=0xce;}_0xfc3a5d[_0x21d3('0x1b')](_0x1d9517);return _0xfc3a5d[_0x21d3('0x22')](_0x21d3('0x23'),_0x58d6d1+'-'+_0x36f74f+'/'+_0x50360d)[_0x21d3('0x1d')](_0x12b0c9);}return null;};}function patchUpdates(_0x464298){return function(_0x3ed10b){try{jsonpatch['apply'](_0x3ed10b,_0x464298,!![]);}catch(_0x15eacf){return BPromise[_0x21d3('0x24')](_0x15eacf);}return _0x3ed10b['save']();};}function saveUpdates(_0x5c8935,_0x19b697){return function(_0x1f406a){if(_0x1f406a){return _0x1f406a[_0x21d3('0x25')](_0x5c8935)[_0x21d3('0x26')](function(_0x348f24){return _0x348f24;});}return null;};}function removeEntity(_0x32466d,_0x59b128){return function(_0x57373c){if(_0x57373c){return _0x57373c[_0x21d3('0x27')]()['then'](function(){_0x32466d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35fec5,_0x173208){return function(_0x4a3b3e){if(!_0x4a3b3e){_0x35fec5['sendStatus'](0x194);}return _0x4a3b3e;};}function handleError(_0x1cbc07,_0x36a309){_0x36a309=_0x36a309||0x1f4;return function(_0x140f20){logger[_0x21d3('0x28')](_0x140f20[_0x21d3('0x29')]);if(_0x140f20[_0x21d3('0x2a')]){delete _0x140f20[_0x21d3('0x2a')];}_0x1cbc07[_0x21d3('0x1b')](_0x36a309)[_0x21d3('0x2b')](_0x140f20);};}exports[_0x21d3('0x2c')]=function(_0x388f2c,_0x2aca48){var _0x5406ca={},_0x2ef3a3={},_0x597e7b={'count':0x0,'rows':[]};var _0x49fe80=_[_0x21d3('0x2d')](db[_0x21d3('0x2e')][_0x21d3('0x2f')],function(_0x4459d2){return{'name':_0x4459d2['fieldName'],'type':_0x4459d2['type'][_0x21d3('0x30')]};});_0x2ef3a3[_0x21d3('0x31')]=_[_0x21d3('0x2d')](_0x49fe80,_0x21d3('0x2a'));_0x2ef3a3[_0x21d3('0x32')]=_[_0x21d3('0x33')](_0x388f2c['query']);_0x2ef3a3[_0x21d3('0x34')]=_[_0x21d3('0x35')](_0x2ef3a3[_0x21d3('0x31')],_0x2ef3a3[_0x21d3('0x32')]);_0x5406ca[_0x21d3('0x36')]=_[_0x21d3('0x35')](_0x2ef3a3[_0x21d3('0x31')],qs[_0x21d3('0x37')](_0x388f2c[_0x21d3('0x32')][_0x21d3('0x37')]));_0x5406ca['attributes']=_0x5406ca[_0x21d3('0x36')]['length']?_0x5406ca['attributes']:_0x2ef3a3[_0x21d3('0x31')];if(!_0x388f2c[_0x21d3('0x32')][_0x21d3('0x38')](_0x21d3('0x39'))){_0x5406ca['limit']=qs[_0x21d3('0x20')](_0x388f2c[_0x21d3('0x32')]['limit']);_0x5406ca[_0x21d3('0x1e')]=qs[_0x21d3('0x1e')](_0x388f2c[_0x21d3('0x32')][_0x21d3('0x1e')]);}_0x5406ca[_0x21d3('0x3a')]=qs[_0x21d3('0x3b')](_0x388f2c[_0x21d3('0x32')][_0x21d3('0x3b')]);_0x5406ca[_0x21d3('0x3c')]=qs[_0x21d3('0x34')](_[_0x21d3('0x3d')](_0x388f2c[_0x21d3('0x32')],_0x2ef3a3[_0x21d3('0x34')]),_0x49fe80);if(_0x388f2c[_0x21d3('0x32')]['filter']){_0x5406ca['where']=_[_0x21d3('0x3e')](_0x5406ca[_0x21d3('0x3c')],{'$or':_[_0x21d3('0x2d')](_0x49fe80,function(_0x40cc4c){if(_0x40cc4c[_0x21d3('0x3f')]!==_0x21d3('0x40')){var _0x46a698={};_0x46a698[_0x40cc4c['name']]={'$like':'%'+_0x388f2c[_0x21d3('0x32')]['filter']+'%'};return _0x46a698;}})});}_0x5406ca=_[_0x21d3('0x3e')]({},_0x5406ca,_0x388f2c[_0x21d3('0x41')]);var _0x6652f6={'where':_0x5406ca[_0x21d3('0x3c')]};return db[_0x21d3('0x2e')][_0x21d3('0x21')](_0x6652f6)[_0x21d3('0x26')](function(_0x45ccfe){_0x597e7b[_0x21d3('0x21')]=_0x45ccfe;if(_0x388f2c[_0x21d3('0x32')][_0x21d3('0x42')]){_0x5406ca[_0x21d3('0x43')]=[{'all':!![]}];}return db[_0x21d3('0x2e')][_0x21d3('0x44')](_0x5406ca);})[_0x21d3('0x26')](function(_0xf3aca1){_0x597e7b[_0x21d3('0x45')]=_0xf3aca1;return _0x597e7b;})[_0x21d3('0x26')](respondWithFilteredResult(_0x2aca48,_0x5406ca))['catch'](handleError(_0x2aca48,null));};exports[_0x21d3('0x46')]=function(_0x2d6965,_0x9c2dd7){var _0x358e03={'raw':![],'where':{'id':_0x2d6965['params']['id']}},_0x54571b={};_0x54571b['model']=_[_0x21d3('0x33')](db[_0x21d3('0x2e')][_0x21d3('0x2f')]);_0x54571b['query']=_['keys'](_0x2d6965['query']);_0x54571b['filters']=_[_0x21d3('0x35')](_0x54571b[_0x21d3('0x31')],_0x54571b[_0x21d3('0x32')]);_0x358e03[_0x21d3('0x36')]=_[_0x21d3('0x35')](_0x54571b[_0x21d3('0x31')],qs[_0x21d3('0x37')](_0x2d6965[_0x21d3('0x32')][_0x21d3('0x37')]));_0x358e03[_0x21d3('0x36')]=_0x358e03[_0x21d3('0x36')][_0x21d3('0x47')]?_0x358e03[_0x21d3('0x36')]:_0x54571b[_0x21d3('0x31')];if(_0x2d6965['query'][_0x21d3('0x42')]){_0x358e03[_0x21d3('0x43')]=[{'all':!![]}];}_0x358e03=_[_0x21d3('0x3e')]({},_0x358e03,_0x2d6965['options']);return db[_0x21d3('0x2e')]['find'](_0x358e03)[_0x21d3('0x26')](handleEntityNotFound(_0x9c2dd7,null))[_0x21d3('0x26')](respondWithResult(_0x9c2dd7,null))['catch'](handleError(_0x9c2dd7,null));};exports[_0x21d3('0x48')]=function(_0x298d40,_0x2f39af){return db['AnalyticFieldReport'][_0x21d3('0x48')](_0x298d40['body'],{})[_0x21d3('0x26')](respondWithResult(_0x2f39af,0xc9))[_0x21d3('0x49')](handleError(_0x2f39af,null));};exports[_0x21d3('0x4a')]=function(_0x5051b9,_0x12e561){return db[_0x21d3('0x2e')]['bulkCreate'](_0x5051b9[_0x21d3('0x4b')],{'raw':![],'individualHooks':!![]})[_0x21d3('0x26')](respondWithResult(_0x12e561,0xc9))[_0x21d3('0x49')](handleError(_0x12e561,null));};exports[_0x21d3('0x25')]=function(_0x1046a5,_0x5499ac){if(_0x1046a5[_0x21d3('0x4b')]['id']){delete _0x1046a5[_0x21d3('0x4b')]['id'];}return db[_0x21d3('0x2e')][_0x21d3('0x4c')]({'where':{'id':_0x1046a5[_0x21d3('0x4d')]['id']}})[_0x21d3('0x26')](handleEntityNotFound(_0x5499ac,null))[_0x21d3('0x26')](saveUpdates(_0x1046a5[_0x21d3('0x4b')],null))[_0x21d3('0x26')](respondWithResult(_0x5499ac,null))[_0x21d3('0x49')](handleError(_0x5499ac,null));};exports[_0x21d3('0x27')]=function(_0x1c719c,_0x35edb1){return db[_0x21d3('0x2e')]['find']({'where':{'id':_0x1c719c[_0x21d3('0x4d')]['id']}})[_0x21d3('0x26')](handleEntityNotFound(_0x35edb1,null))[_0x21d3('0x26')](removeEntity(_0x35edb1,null))['catch'](handleError(_0x35edb1,null));};exports[_0x21d3('0x4e')]=function(_0x3eb5e5,_0x3fca63){return db[_0x21d3('0x2e')][_0x21d3('0x27')]({'where':{'id':_0x3eb5e5[_0x21d3('0x32')][_0x21d3('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x21d3('0x26')](respondWithResult(_0x3fca63,0xcc))['catch'](handleError(_0x3fca63,null));};exports[_0x21d3('0x50')]=function(_0x8f77ce,_0x207cd1,_0x21d3a0){return db[_0x21d3('0x51')]['findOne']({'where':{'id':_0x8f77ce[_0x21d3('0x4d')]['id']}})[_0x21d3('0x26')](handleEntityNotFound(_0x207cd1,null))[_0x21d3('0x26')](function(_0x146767){if(_0x146767){return db[_0x21d3('0x52')][_0x21d3('0x53')](function(_0x42515c){return db['AnalyticFieldReport'][_0x21d3('0x27')]({'where':{'CustomReportId':_0x8f77ce[_0x21d3('0x4d')]['id']},'transaction':_0x42515c})[_0x21d3('0x26')](function(_0x431fc6){var _0x47ef8a=_[_0x21d3('0x2d')](_0x8f77ce[_0x21d3('0x4b')],function(_0x283293){delete _0x283293['id'];_0x283293[_0x21d3('0x54')]=_0x8f77ce[_0x21d3('0x4d')]['id'];return _0x283293;});return db[_0x21d3('0x2e')][_0x21d3('0x4a')](_0x47ef8a,{'transaction':_0x42515c});});})['then'](function(){return db[_0x21d3('0x2e')][_0x21d3('0x44')]({'where':{'CustomReportId':_0x8f77ce[_0x21d3('0x4d')]['id']}});});}})[_0x21d3('0x26')](respondWithResult(_0x207cd1,null))[_0x21d3('0x49')](handleError(_0x207cd1,null));}; \ No newline at end of file +var _0x43de=['name','send','map','AnalyticFieldReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','filter','includeAll','include','findAll','rows','params','rawAttributes','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','save','update','then','destroy','stack'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x43de,0x163));var _0xe43d=function(_0x53e8c1,_0x1a6586){_0x53e8c1=_0x53e8c1-0x0;var _0x416748=_0x43de[_0x53e8c1];return _0x416748;};'use strict';var emlformat=require(_0xe43d('0x0'));var rimraf=require(_0xe43d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe43d('0x2'));var rp=require('request-promise');var moment=require(_0xe43d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe43d('0x4'));var util=require(_0xe43d('0x5'));var path=require(_0xe43d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe43d('0x7'));var fs=require('fs');var fs_extra=require(_0xe43d('0x8'));var _=require(_0xe43d('0x9'));var squel=require(_0xe43d('0xa'));var crypto=require(_0xe43d('0xb'));var jsforce=require(_0xe43d('0xc'));var deskjs=require(_0xe43d('0xd'));var toCsv=require(_0xe43d('0xe'));var querystring=require(_0xe43d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe43d('0x10'));var qs=require(_0xe43d('0x11'));var as=require(_0xe43d('0x12'));var hardwareService=require(_0xe43d('0x13'));var logger=require(_0xe43d('0x14'))(_0xe43d('0x15'));var utils=require(_0xe43d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe43d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ec0b,_0x28ee70){_0x28ee70=_0x28ee70||0xcc;return function(_0x32c3b9){if(_0x32c3b9){return _0x49ec0b[_0xe43d('0x18')](_0x28ee70);}return _0x49ec0b['status'](_0x28ee70)[_0xe43d('0x19')]();};}function respondWithResult(_0x4e1af2,_0x2f3ccf){_0x2f3ccf=_0x2f3ccf||0xc8;return function(_0x55f9b5){if(_0x55f9b5){return _0x4e1af2['status'](_0x2f3ccf)['json'](_0x55f9b5);}};}function respondWithFilteredResult(_0x2ea3d8,_0x1d7b40){return function(_0x1491cd){if(_0x1491cd){var _0xc221d8=typeof _0x1d7b40[_0xe43d('0x1a')]===_0xe43d('0x1b')&&typeof _0x1d7b40['limit']===_0xe43d('0x1b');var _0x258752=_0x1491cd[_0xe43d('0x1c')];var _0x712a1c=_0xc221d8?0x0:_0x1d7b40[_0xe43d('0x1a')];var _0x3fe86a=_0xc221d8?_0x1491cd['count']:_0x1d7b40[_0xe43d('0x1a')]+_0x1d7b40[_0xe43d('0x1d')];var _0x2cb1c8;if(_0x3fe86a>=_0x258752){_0x3fe86a=_0x258752;_0x2cb1c8=0xc8;}else{_0x2cb1c8=0xce;}_0x2ea3d8[_0xe43d('0x1e')](_0x2cb1c8);return _0x2ea3d8[_0xe43d('0x1f')](_0xe43d('0x20'),_0x712a1c+'-'+_0x3fe86a+'/'+_0x258752)[_0xe43d('0x21')](_0x1491cd);}return null;};}function patchUpdates(_0x4d338a){return function(_0x1f9967){try{jsonpatch[_0xe43d('0x22')](_0x1f9967,_0x4d338a,!![]);}catch(_0x271ab9){return BPromise['reject'](_0x271ab9);}return _0x1f9967[_0xe43d('0x23')]();};}function saveUpdates(_0x2c33cd,_0x2e34f1){return function(_0x4fa4f1){if(_0x4fa4f1){return _0x4fa4f1[_0xe43d('0x24')](_0x2c33cd)[_0xe43d('0x25')](function(_0x866a14){return _0x866a14;});}return null;};}function removeEntity(_0x3af291,_0x2bf1fa){return function(_0x3f40b6){if(_0x3f40b6){return _0x3f40b6[_0xe43d('0x26')]()['then'](function(){_0x3af291[_0xe43d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453a8b,_0x243d83){return function(_0x37cac2){if(!_0x37cac2){_0x453a8b[_0xe43d('0x18')](0x194);}return _0x37cac2;};}function handleError(_0x4a173e,_0x27c765){_0x27c765=_0x27c765||0x1f4;return function(_0x228300){logger['error'](_0x228300[_0xe43d('0x27')]);if(_0x228300[_0xe43d('0x28')]){delete _0x228300['name'];}_0x4a173e[_0xe43d('0x1e')](_0x27c765)[_0xe43d('0x29')](_0x228300);};}exports['index']=function(_0x41ef33,_0x2053c3){var _0x3b8e38={},_0x16d999={},_0x407f03={'count':0x0,'rows':[]};var _0x441f34=_[_0xe43d('0x2a')](db[_0xe43d('0x2b')]['rawAttributes'],function(_0x3af35f){return{'name':_0x3af35f[_0xe43d('0x2c')],'type':_0x3af35f[_0xe43d('0x2d')]['key']};});_0x16d999[_0xe43d('0x2e')]=_[_0xe43d('0x2a')](_0x441f34,'name');_0x16d999[_0xe43d('0x2f')]=_[_0xe43d('0x30')](_0x41ef33[_0xe43d('0x2f')]);_0x16d999[_0xe43d('0x31')]=_[_0xe43d('0x32')](_0x16d999[_0xe43d('0x2e')],_0x16d999[_0xe43d('0x2f')]);_0x3b8e38['attributes']=_[_0xe43d('0x32')](_0x16d999[_0xe43d('0x2e')],qs['fields'](_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x33')]));_0x3b8e38[_0xe43d('0x34')]=_0x3b8e38[_0xe43d('0x34')][_0xe43d('0x35')]?_0x3b8e38[_0xe43d('0x34')]:_0x16d999[_0xe43d('0x2e')];if(!_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x36')]('nolimit')){_0x3b8e38[_0xe43d('0x1d')]=qs['limit'](_0x41ef33[_0xe43d('0x2f')]['limit']);_0x3b8e38[_0xe43d('0x1a')]=qs[_0xe43d('0x1a')](_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x1a')]);}_0x3b8e38[_0xe43d('0x37')]=qs['sort'](_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x38')]);_0x3b8e38['where']=qs['filters'](_[_0xe43d('0x39')](_0x41ef33['query'],_0x16d999[_0xe43d('0x31')]),_0x441f34);if(_0x41ef33[_0xe43d('0x2f')]['filter']){_0x3b8e38[_0xe43d('0x3a')]=_[_0xe43d('0x3b')](_0x3b8e38[_0xe43d('0x3a')],{'$or':_[_0xe43d('0x2a')](_0x441f34,function(_0x2bf985){if(_0x2bf985[_0xe43d('0x2d')]!=='VIRTUAL'){var _0x30b0b6={};_0x30b0b6[_0x2bf985[_0xe43d('0x28')]]={'$like':'%'+_0x41ef33['query'][_0xe43d('0x3c')]+'%'};return _0x30b0b6;}})});}_0x3b8e38=_[_0xe43d('0x3b')]({},_0x3b8e38,_0x41ef33['options']);var _0x205c28={'where':_0x3b8e38[_0xe43d('0x3a')]};return db[_0xe43d('0x2b')]['count'](_0x205c28)['then'](function(_0x4a3cd8){_0x407f03[_0xe43d('0x1c')]=_0x4a3cd8;if(_0x41ef33['query'][_0xe43d('0x3d')]){_0x3b8e38[_0xe43d('0x3e')]=[{'all':!![]}];}return db[_0xe43d('0x2b')][_0xe43d('0x3f')](_0x3b8e38);})['then'](function(_0x230257){_0x407f03[_0xe43d('0x40')]=_0x230257;return _0x407f03;})[_0xe43d('0x25')](respondWithFilteredResult(_0x2053c3,_0x3b8e38))['catch'](handleError(_0x2053c3,null));};exports['show']=function(_0x528bb2,_0x932821){var _0x3d2770={'raw':![],'where':{'id':_0x528bb2[_0xe43d('0x41')]['id']}},_0x414b56={};_0x414b56['model']=_[_0xe43d('0x30')](db[_0xe43d('0x2b')][_0xe43d('0x42')]);_0x414b56['query']=_[_0xe43d('0x30')](_0x528bb2[_0xe43d('0x2f')]);_0x414b56['filters']=_[_0xe43d('0x32')](_0x414b56[_0xe43d('0x2e')],_0x414b56[_0xe43d('0x2f')]);_0x3d2770['attributes']=_[_0xe43d('0x32')](_0x414b56['model'],qs[_0xe43d('0x33')](_0x528bb2[_0xe43d('0x2f')][_0xe43d('0x33')]));_0x3d2770[_0xe43d('0x34')]=_0x3d2770['attributes'][_0xe43d('0x35')]?_0x3d2770[_0xe43d('0x34')]:_0x414b56[_0xe43d('0x2e')];if(_0x528bb2[_0xe43d('0x2f')][_0xe43d('0x3d')]){_0x3d2770['include']=[{'all':!![]}];}_0x3d2770=_[_0xe43d('0x3b')]({},_0x3d2770,_0x528bb2[_0xe43d('0x43')]);return db[_0xe43d('0x2b')][_0xe43d('0x44')](_0x3d2770)[_0xe43d('0x25')](handleEntityNotFound(_0x932821,null))[_0xe43d('0x25')](respondWithResult(_0x932821,null))[_0xe43d('0x45')](handleError(_0x932821,null));};exports[_0xe43d('0x46')]=function(_0x5e6cd4,_0x3f805f){return db['AnalyticFieldReport'][_0xe43d('0x46')](_0x5e6cd4[_0xe43d('0x47')],{})[_0xe43d('0x25')](respondWithResult(_0x3f805f,0xc9))[_0xe43d('0x45')](handleError(_0x3f805f,null));};exports['bulkCreate']=function(_0xc1836,_0x181693){return db['AnalyticFieldReport'][_0xe43d('0x48')](_0xc1836['body'],{'raw':![],'individualHooks':!![]})[_0xe43d('0x25')](respondWithResult(_0x181693,0xc9))[_0xe43d('0x45')](handleError(_0x181693,null));};exports['update']=function(_0xfacc7,_0x2d4f0b){if(_0xfacc7['body']['id']){delete _0xfacc7[_0xe43d('0x47')]['id'];}return db[_0xe43d('0x2b')][_0xe43d('0x44')]({'where':{'id':_0xfacc7['params']['id']}})[_0xe43d('0x25')](handleEntityNotFound(_0x2d4f0b,null))[_0xe43d('0x25')](saveUpdates(_0xfacc7['body'],null))[_0xe43d('0x25')](respondWithResult(_0x2d4f0b,null))[_0xe43d('0x45')](handleError(_0x2d4f0b,null));};exports[_0xe43d('0x26')]=function(_0x282bc7,_0x3e174f){return db[_0xe43d('0x2b')][_0xe43d('0x44')]({'where':{'id':_0x282bc7[_0xe43d('0x41')]['id']}})[_0xe43d('0x25')](handleEntityNotFound(_0x3e174f,null))[_0xe43d('0x25')](removeEntity(_0x3e174f,null))[_0xe43d('0x45')](handleError(_0x3e174f,null));};exports[_0xe43d('0x49')]=function(_0x9c54a8,_0x1a62ac){return db[_0xe43d('0x2b')][_0xe43d('0x26')]({'where':{'id':_0x9c54a8[_0xe43d('0x2f')][_0xe43d('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1a62ac,0xcc))['catch'](handleError(_0x1a62ac,null));};exports[_0xe43d('0x4b')]=function(_0x1bb592,_0x6f22b7,_0x29b0cc){return db[_0xe43d('0x4c')][_0xe43d('0x4d')]({'where':{'id':_0x1bb592[_0xe43d('0x41')]['id']}})[_0xe43d('0x25')](handleEntityNotFound(_0x6f22b7,null))[_0xe43d('0x25')](function(_0x51193c){if(_0x51193c){return db[_0xe43d('0x4e')]['transaction'](function(_0x310bbe){return db[_0xe43d('0x2b')][_0xe43d('0x26')]({'where':{'CustomReportId':_0x1bb592['params']['id']},'transaction':_0x310bbe})['then'](function(_0x5e4a46){var _0x5b288c=_[_0xe43d('0x2a')](_0x1bb592['body'],function(_0x2af97a){delete _0x2af97a['id'];_0x2af97a['CustomReportId']=_0x1bb592['params']['id'];return _0x2af97a;});return db[_0xe43d('0x2b')][_0xe43d('0x48')](_0x5b288c,{'transaction':_0x310bbe});});})[_0xe43d('0x25')](function(){return db[_0xe43d('0x2b')][_0xe43d('0x3f')]({'where':{'CustomReportId':_0x1bb592[_0xe43d('0x41')]['id']}});});}})[_0xe43d('0x25')](respondWithResult(_0x6f22b7,null))[_0xe43d('0x45')](handleError(_0x6f22b7,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 2efae7c..ce7ae0a 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 _0xa6b9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x37d517,_0x30d866){var _0x1bce32=function(_0x455700){while(--_0x455700){_0x37d517['push'](_0x37d517['shift']());}};_0x1bce32(++_0x30d866);}(_0xa6b9,0x1a0));var _0x9a6b=function(_0xfe2d5b,_0x4f6148){_0xfe2d5b=_0xfe2d5b-0x0;var _0x2f2f6b=_0xa6b9[_0xfe2d5b];return _0x2f2f6b;};'use strict';var _=require(_0x9a6b('0x0'));var util=require(_0x9a6b('0x1'));var logger=require('../../config/logger')(_0x9a6b('0x2'));var moment=require(_0x9a6b('0x3'));var BPromise=require(_0x9a6b('0x4'));var rp=require(_0x9a6b('0x5'));var fs=require('fs');var path=require(_0x9a6b('0x6'));var rimraf=require(_0x9a6b('0x7'));var config=require(_0x9a6b('0x8'));var attributes=require(_0x9a6b('0x9'));module[_0x9a6b('0xa')]=function(_0xadacb3,_0xb91593){return _0xadacb3[_0x9a6b('0xb')](_0x9a6b('0xc'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d74=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api'];(function(_0x1bebb5,_0x550e89){var _0x22c83d=function(_0x1a9ed2){while(--_0x1a9ed2){_0x1bebb5['push'](_0x1bebb5['shift']());}};_0x22c83d(++_0x550e89);}(_0x6d74,0x182));var _0x46d7=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x6d74[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x46d7('0x0'));var util=require(_0x46d7('0x1'));var logger=require(_0x46d7('0x2'))(_0x46d7('0x3'));var moment=require(_0x46d7('0x4'));var BPromise=require(_0x46d7('0x5'));var rp=require(_0x46d7('0x6'));var fs=require('fs');var path=require(_0x46d7('0x7'));var rimraf=require(_0x46d7('0x8'));var config=require(_0x46d7('0x9'));var attributes=require(_0x46d7('0xa'));module[_0x46d7('0xb')]=function(_0x306f39,_0x3255a3){return _0x306f39[_0x46d7('0xc')](_0x46d7('0xd'),attributes,{'tableName':_0x46d7('0xe'),'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 ec45dc3..70280a0 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 _0x9618=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9618,0x1b9));var _0x8961=function(_0x4b4aa0,_0x353a65){_0x4b4aa0=_0x4b4aa0-0x0;var _0x331b16=_0x9618[_0x4b4aa0];return _0x331b16;};'use strict';var _=require(_0x8961('0x0'));var util=require(_0x8961('0x1'));var moment=require(_0x8961('0x2'));var BPromise=require(_0x8961('0x3'));var rs=require(_0x8961('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8961('0x5'))['db'];var utils=require(_0x8961('0x6'));var logger=require(_0x8961('0x7'))(_0x8961('0x8'));var config=require(_0x8961('0x9'));var jayson=require(_0x8961('0xa'));var client=jayson[_0x8961('0xb')][_0x8961('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b3ff8,_0x4cfbca,_0x3dd4b4){return new BPromise(function(_0xe1d457,_0x1270bb){return client[_0x8961('0xd')](_0x1b3ff8,_0x3dd4b4)['then'](function(_0x1a7705){logger[_0x8961('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4cfbca,'request\x20sent');logger[_0x8961('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4cfbca,_0x8961('0x10'),JSON[_0x8961('0x11')](_0x1a7705));if(_0x1a7705[_0x8961('0x12')]){if(_0x1a7705[_0x8961('0x12')]['code']===0x1f4){logger[_0x8961('0x12')](_0x8961('0x13'),_0x4cfbca,_0x1a7705[_0x8961('0x12')]['message']);return _0x1270bb(_0x1a7705[_0x8961('0x12')][_0x8961('0x14')]);}logger[_0x8961('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4cfbca,_0x1a7705[_0x8961('0x12')][_0x8961('0x14')]);return _0xe1d457(_0x1a7705['error'][_0x8961('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4cfbca,_0x8961('0x10'));_0xe1d457(_0x1a7705['result'][_0x8961('0x14')]);}})[_0x8961('0x15')](function(_0xd2cc68){logger[_0x8961('0x12')](_0x8961('0x13'),_0x4cfbca,_0xd2cc68);_0x1270bb(_0xd2cc68);});});} \ No newline at end of file +var _0x2196=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x300f86,_0x356a2f){var _0x1e9ac4=function(_0x549f9f){while(--_0x549f9f){_0x300f86['push'](_0x300f86['shift']());}};_0x1e9ac4(++_0x356a2f);}(_0x2196,0x197));var _0x6219=function(_0x3765ff,_0x16916e){_0x3765ff=_0x3765ff-0x0;var _0x333f28=_0x2196[_0x3765ff];return _0x333f28;};'use strict';var _=require(_0x6219('0x0'));var util=require(_0x6219('0x1'));var moment=require(_0x6219('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6219('0x3'));var db=require(_0x6219('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6219('0x5'))(_0x6219('0x6'));var config=require(_0x6219('0x7'));var jayson=require(_0x6219('0x8'));var client=jayson[_0x6219('0x9')][_0x6219('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3aeefb,_0x375f16,_0x324c64){return new BPromise(function(_0x53358e,_0x39b784){return client[_0x6219('0xb')](_0x3aeefb,_0x324c64)[_0x6219('0xc')](function(_0x1de215){logger[_0x6219('0xd')](_0x6219('0xe'),_0x375f16,'request\x20sent');logger['debug'](_0x6219('0xf'),_0x375f16,_0x6219('0x10'),JSON['stringify'](_0x1de215));if(_0x1de215['error']){if(_0x1de215[_0x6219('0x11')]['code']===0x1f4){logger[_0x6219('0x11')](_0x6219('0xe'),_0x375f16,_0x1de215[_0x6219('0x11')]['message']);return _0x39b784(_0x1de215[_0x6219('0x11')][_0x6219('0x12')]);}logger[_0x6219('0x11')](_0x6219('0xe'),_0x375f16,_0x1de215[_0x6219('0x11')][_0x6219('0x12')]);return _0x53358e(_0x1de215['error']['message']);}else{logger[_0x6219('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x375f16,_0x6219('0x10'));_0x53358e(_0x1de215['result'][_0x6219('0x12')]);}})['catch'](function(_0x5424ba){logger['error'](_0x6219('0xe'),_0x375f16,_0x5424ba);_0x39b784(_0x5424ba);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 333bdd5..55ec5e2 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(_0x3b4254,_0x3a6d5c){var _0x3a4dde=function(_0x17b618){while(--_0x17b618){_0x3b4254['push'](_0x3b4254['shift']());}};_0x3a4dde(++_0x3a6d5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x1f92c7,_0x351ccb){var _0x564e90=function(_0x5d6770){while(--_0x5d6770){_0x1f92c7['push'](_0x1f92c7['shift']());}};_0x564e90(++_0x351ccb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 e98b606..5a9774b 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 _0xaa88=['TEXT','sequelize','exports','STRING','name'];(function(_0x103448,_0x482583){var _0x267e4f=function(_0x57c5e9){while(--_0x57c5e9){_0x103448['push'](_0x103448['shift']());}};_0x267e4f(++_0x482583);}(_0xaa88,0x137));var _0x8aa8=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xaa88[_0x47a12a];return _0x30cd40;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![],'unique':_0x8aa8('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x8aa8('0x4')]},'description':{'type':Sequelize[_0x8aa8('0x2')]}}; \ No newline at end of file +var _0xffda=['sequelize','exports','STRING','name','TEXT'];(function(_0x31bb9e,_0x218f3f){var _0xa50bb8=function(_0x54e9c3){while(--_0x54e9c3){_0x31bb9e['push'](_0x31bb9e['shift']());}};_0xa50bb8(++_0x218f3f);}(_0xffda,0x73));var _0xaffd=function(_0x6ad3bf,_0x1418d7){_0x6ad3bf=_0x6ad3bf-0x0;var _0xe332e8=_0xffda[_0x6ad3bf];return _0xe332e8;};'use strict';var Sequelize=require(_0xaffd('0x0'));module[_0xaffd('0x1')]={'name':{'type':Sequelize[_0xaffd('0x2')],'allowNull':![],'unique':_0xaffd('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xaffd('0x4')]},'description':{'type':Sequelize[_0xaffd('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index f56ed56..7a42df5 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x547d1f,_0x1a3598){var _0x33149d=function(_0x47f77a){while(--_0x47f77a){_0x547d1f['push'](_0x547d1f['shift']());}};_0x33149d(++_0x1a3598);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0x24ca[_0x4f1da5];return _0xe972a8;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file +var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x205a6e,_0x571a14){var _0x43adb6=function(_0xb71d8b){while(--_0xb71d8b){_0x205a6e['push'](_0x205a6e['shift']());}};_0x43adb6(++_0x571a14);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3334cb,_0x38c266){_0x3334cb=_0x3334cb-0x0;var _0x60be26=_0x9c5a[_0x3334cb];return _0x60be26;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index ef389a1..5d45338 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 _0x972c=['api','bluebird','request-promise','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','../../config/logger'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x972c,0xf2));var _0xc972=function(_0xc7c23,_0x1901b8){_0xc7c23=_0xc7c23-0x0;var _0x3f8daa=_0x972c[_0xc7c23];return _0x3f8daa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc972('0x0'))(_0xc972('0x1'));var moment=require('moment');var BPromise=require(_0xc972('0x2'));var rp=require(_0xc972('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc972('0x4'));var attributes=require(_0xc972('0x5'));module[_0xc972('0x6')]=function(_0x5dd2c8,_0xd70261){return _0x5dd2c8['define'](_0xc972('0x7'),attributes,{'tableName':_0xc972('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed08=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1f8fee,_0x1a0bff){var _0x51643b=function(_0x414bd5){while(--_0x414bd5){_0x1f8fee['push'](_0x1f8fee['shift']());}};_0x51643b(++_0x1a0bff);}(_0xed08,0x67));var _0x8ed0=function(_0x85a9bf,_0x111dcd){_0x85a9bf=_0x85a9bf-0x0;var _0x6d94aa=_0xed08[_0x85a9bf];return _0x6d94aa;};'use strict';var _=require('lodash');var util=require(_0x8ed0('0x0'));var logger=require(_0x8ed0('0x1'))(_0x8ed0('0x2'));var moment=require(_0x8ed0('0x3'));var BPromise=require(_0x8ed0('0x4'));var rp=require(_0x8ed0('0x5'));var fs=require('fs');var path=require(_0x8ed0('0x6'));var rimraf=require(_0x8ed0('0x7'));var config=require(_0x8ed0('0x8'));var attributes=require(_0x8ed0('0x9'));module[_0x8ed0('0xa')]=function(_0x43ca60,_0x5c1343){return _0x43ca60[_0x8ed0('0xb')](_0x8ed0('0xc'),attributes,{'tableName':_0x8ed0('0xd'),'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 c307231..c2a79b5 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 _0xa235=['info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xa235,0x129));var _0x5a23=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xa235[_0x397cfb];return _0x15fed9;};'use strict';var _=require('lodash');var util=require(_0x5a23('0x0'));var moment=require(_0x5a23('0x1'));var BPromise=require(_0x5a23('0x2'));var rs=require(_0x5a23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a23('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a23('0x5'));var jayson=require(_0x5a23('0x6'));var client=jayson['client'][_0x5a23('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x99b608,_0x249270,_0x150547){return new BPromise(function(_0x3db6ef,_0x539af4){return client[_0x5a23('0x8')](_0x99b608,_0x150547)['then'](function(_0x4c77c8){logger[_0x5a23('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x249270,_0x5a23('0xa'));logger['debug'](_0x5a23('0xb'),_0x249270,_0x5a23('0xa'),JSON['stringify'](_0x4c77c8));if(_0x4c77c8[_0x5a23('0xc')]){if(_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xd')]===0x1f4){logger[_0x5a23('0xc')](_0x5a23('0xe'),_0x249270,_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);return _0x539af4(_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);}logger['error'](_0x5a23('0xe'),_0x249270,_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);return _0x3db6ef(_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);}else{logger['info'](_0x5a23('0xe'),_0x249270,_0x5a23('0xa'));_0x3db6ef(_0x4c77c8[_0x5a23('0x10')]['message']);}})[_0x5a23('0x11')](function(_0x32bd46){logger['error'](_0x5a23('0xe'),_0x249270,_0x32bd46);_0x539af4(_0x32bd46);});});} \ No newline at end of file +var _0xb9e3=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0xb9e3,0x150));var _0x3b9e=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xb9e3[_0x3712e2];return _0x1faff4;};'use strict';var _=require(_0x3b9e('0x0'));var util=require(_0x3b9e('0x1'));var moment=require(_0x3b9e('0x2'));var BPromise=require(_0x3b9e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b9e('0x5'));var logger=require(_0x3b9e('0x6'))(_0x3b9e('0x7'));var config=require(_0x3b9e('0x8'));var jayson=require(_0x3b9e('0x9'));var client=jayson[_0x3b9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3430cd,_0x3d828a,_0x20452d){return new BPromise(function(_0x413d31,_0x5d03b2){return client[_0x3b9e('0xb')](_0x3430cd,_0x20452d)[_0x3b9e('0xc')](function(_0x121d85){logger[_0x3b9e('0xd')](_0x3b9e('0xe'),_0x3d828a,'request\x20sent');logger[_0x3b9e('0xf')](_0x3b9e('0x10'),_0x3d828a,_0x3b9e('0x11'),JSON[_0x3b9e('0x12')](_0x121d85));if(_0x121d85[_0x3b9e('0x13')]){if(_0x121d85[_0x3b9e('0x13')][_0x3b9e('0x14')]===0x1f4){logger['error'](_0x3b9e('0xe'),_0x3d828a,_0x121d85[_0x3b9e('0x13')][_0x3b9e('0x15')]);return _0x5d03b2(_0x121d85['error'][_0x3b9e('0x15')]);}logger[_0x3b9e('0x13')](_0x3b9e('0xe'),_0x3d828a,_0x121d85['error']['message']);return _0x413d31(_0x121d85[_0x3b9e('0x13')]['message']);}else{logger['info'](_0x3b9e('0xe'),_0x3d828a,_0x3b9e('0x11'));_0x413d31(_0x121d85[_0x3b9e('0x16')]['message']);}})[_0x3b9e('0x17')](function(_0x4edbff){logger[_0x3b9e('0x13')](_0x3b9e('0xe'),_0x3d828a,_0x4edbff);_0x5d03b2(_0x4edbff);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index bdbfcb6..1de9ff0 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 _0xe0c3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x16de4c,_0x507b95){var _0x5f3b42=function(_0x1d4aa4){while(--_0x1d4aa4){_0x16de4c['push'](_0x16de4c['shift']());}};_0x5f3b42(++_0x507b95);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'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('0xf')]('/',auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller['update']);router['delete'](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);module[_0x3e0c('0x13')]=router; \ No newline at end of file +var _0xce1a=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','get','/:id','put','update','exports','multer','express','Router','fs-extra'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xce1a,0xbf));var _0xace1=function(_0x1be143,_0x2f58ed){_0x1be143=_0x1be143-0x0;var _0xaa3f65=_0xce1a[_0x1be143];return _0xaa3f65;};'use strict';var multer=require(_0xace1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xace1('0x1'));var router=express[_0xace1('0x2')]();var fs_extra=require(_0xace1('0x3'));var auth=require(_0xace1('0x4'));var interaction=require(_0xace1('0x5'));var config=require('../../config/environment');var controller=require(_0xace1('0x6'));router['get']('/',auth[_0xace1('0x7')](),controller['index']);router[_0xace1('0x8')](_0xace1('0x9'),auth[_0xace1('0x7')](),controller['show']);router['post']('/',auth[_0xace1('0x7')](),controller['create']);router[_0xace1('0xa')](_0xace1('0x9'),auth[_0xace1('0x7')](),controller[_0xace1('0xb')]);router['delete'](_0xace1('0x9'),auth[_0xace1('0x7')](),controller['destroy']);module[_0xace1('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e16d11a..341506e 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 _0xf7cb=['TEXT','exports'];(function(_0x167113,_0x2b659b){var _0x1cdd7c=function(_0x5419ec){while(--_0x5419ec){_0x167113['push'](_0x167113['shift']());}};_0x1cdd7c(++_0x2b659b);}(_0xf7cb,0x1a9));var _0xbf7c=function(_0x323e80,_0x283088){_0x323e80=_0x323e80-0x0;var _0x3c5a0d=_0xf7cb[_0x323e80];return _0x3c5a0d;};'use strict';var Sequelize=require('sequelize');module[_0xbf7c('0x0')]={'tree':{'type':Sequelize[_0xbf7c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa4ba=['TEXT','exports'];(function(_0x265793,_0x1184c5){var _0x1fbad1=function(_0x420cb8){while(--_0x420cb8){_0x265793['push'](_0x265793['shift']());}};_0x1fbad1(++_0x1184c5);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa4ba[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require('sequelize');module[_0xaa4b('0x0')]={'tree':{'type':Sequelize[_0xaa4b('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 124cf61..7fdd74d 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 _0xbd50=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','AnalyticTreeReport','includeAll','include','rows','show','params','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x5b78fe,_0x44542c){var _0x24ac3c=function(_0x552b51){while(--_0x552b51){_0x5b78fe['push'](_0x5b78fe['shift']());}};_0x24ac3c(++_0x44542c);}(_0xbd50,0x19a));var _0x0bd5=function(_0x570572,_0x1ec498){_0x570572=_0x570572-0x0;var _0x2584c9=_0xbd50[_0x570572];return _0x2584c9;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require(_0x0bd5('0x3'));var rp=require(_0x0bd5('0x4'));var moment=require(_0x0bd5('0x5'));var BPromise=require(_0x0bd5('0x6'));var Mustache=require(_0x0bd5('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0bd5('0x8'));var csv=require(_0x0bd5('0x9'));var ejs=require(_0x0bd5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bd5('0xb'));var squel=require(_0x0bd5('0xc'));var crypto=require(_0x0bd5('0xd'));var jsforce=require(_0x0bd5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0x9'));var querystring=require('querystring');var Papa=require(_0x0bd5('0xf'));var Redis=require(_0x0bd5('0x10'));var authService=require(_0x0bd5('0x11'));var qs=require(_0x0bd5('0x12'));var as=require(_0x0bd5('0x13'));var hardwareService=require(_0x0bd5('0x14'));var logger=require(_0x0bd5('0x15'))(_0x0bd5('0x16'));var utils=require(_0x0bd5('0x17'));var config=require(_0x0bd5('0x18'));var licenseUtil=require(_0x0bd5('0x19'));var db=require(_0x0bd5('0x1a'))['db'];function respondWithStatusCode(_0x25bc6c,_0x1dcc60){_0x1dcc60=_0x1dcc60||0xcc;return function(_0x12406d){if(_0x12406d){return _0x25bc6c[_0x0bd5('0x1b')](_0x1dcc60);}return _0x25bc6c[_0x0bd5('0x1c')](_0x1dcc60)[_0x0bd5('0x1d')]();};}function respondWithResult(_0x2f7308,_0x197212){_0x197212=_0x197212||0xc8;return function(_0x2d8150){if(_0x2d8150){return _0x2f7308[_0x0bd5('0x1c')](_0x197212)[_0x0bd5('0x1e')](_0x2d8150);}};}function respondWithFilteredResult(_0x3fb937,_0x4a5299){return function(_0x4cbcbd){if(_0x4cbcbd){var _0x49f770=typeof _0x4a5299[_0x0bd5('0x1f')]===_0x0bd5('0x20')&&typeof _0x4a5299[_0x0bd5('0x21')]===_0x0bd5('0x20');var _0x35cef5=_0x4cbcbd[_0x0bd5('0x22')];var _0x5bf789=_0x49f770?0x0:_0x4a5299[_0x0bd5('0x1f')];var _0x190cf4=_0x49f770?_0x4cbcbd['count']:_0x4a5299['offset']+_0x4a5299[_0x0bd5('0x21')];var _0x2be435;if(_0x190cf4>=_0x35cef5){_0x190cf4=_0x35cef5;_0x2be435=0xc8;}else{_0x2be435=0xce;}_0x3fb937[_0x0bd5('0x1c')](_0x2be435);return _0x3fb937['set'](_0x0bd5('0x23'),_0x5bf789+'-'+_0x190cf4+'/'+_0x35cef5)[_0x0bd5('0x1e')](_0x4cbcbd);}return null;};}function patchUpdates(_0x13483b){return function(_0x587566){try{jsonpatch['apply'](_0x587566,_0x13483b,!![]);}catch(_0x284fe2){return BPromise[_0x0bd5('0x24')](_0x284fe2);}return _0x587566[_0x0bd5('0x25')]();};}function saveUpdates(_0x12f688,_0x3cffc7){return function(_0x56c5d3){if(_0x56c5d3){return _0x56c5d3[_0x0bd5('0x26')](_0x12f688)[_0x0bd5('0x27')](function(_0x13c126){return _0x13c126;});}return null;};}function removeEntity(_0x51a3a0,_0x569ee3){return function(_0xdd9bc){if(_0xdd9bc){return _0xdd9bc[_0x0bd5('0x28')]()[_0x0bd5('0x27')](function(){_0x51a3a0[_0x0bd5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x78328d,_0x333fbe){return function(_0x42c78a){if(!_0x42c78a){_0x78328d[_0x0bd5('0x1b')](0x194);}return _0x42c78a;};}function handleError(_0x1dee6b,_0x265b25){_0x265b25=_0x265b25||0x1f4;return function(_0x5d09cc){logger[_0x0bd5('0x29')](_0x5d09cc[_0x0bd5('0x2a')]);if(_0x5d09cc[_0x0bd5('0x2b')]){delete _0x5d09cc['name'];}_0x1dee6b[_0x0bd5('0x1c')](_0x265b25)[_0x0bd5('0x2c')](_0x5d09cc);};}exports[_0x0bd5('0x2d')]=function(_0x3e19ae,_0x5ee9da){var _0x232d4d={},_0x542cbc={},_0x4d12c4={'count':0x0,'rows':[]};var _0x4d5b74=_[_0x0bd5('0x2e')](db['AnalyticTreeReport'][_0x0bd5('0x2f')],function(_0x392767){return{'name':_0x392767[_0x0bd5('0x30')],'type':_0x392767['type'][_0x0bd5('0x31')]};});_0x542cbc[_0x0bd5('0x32')]=_[_0x0bd5('0x2e')](_0x4d5b74,'name');_0x542cbc['query']=_[_0x0bd5('0x33')](_0x3e19ae[_0x0bd5('0x34')]);_0x542cbc[_0x0bd5('0x35')]=_[_0x0bd5('0x36')](_0x542cbc[_0x0bd5('0x32')],_0x542cbc[_0x0bd5('0x34')]);_0x232d4d[_0x0bd5('0x37')]=_[_0x0bd5('0x36')](_0x542cbc[_0x0bd5('0x32')],qs[_0x0bd5('0x38')](_0x3e19ae[_0x0bd5('0x34')]['fields']));_0x232d4d['attributes']=_0x232d4d[_0x0bd5('0x37')][_0x0bd5('0x39')]?_0x232d4d[_0x0bd5('0x37')]:_0x542cbc[_0x0bd5('0x32')];if(!_0x3e19ae['query'][_0x0bd5('0x3a')](_0x0bd5('0x3b'))){_0x232d4d[_0x0bd5('0x21')]=qs[_0x0bd5('0x21')](_0x3e19ae[_0x0bd5('0x34')]['limit']);_0x232d4d[_0x0bd5('0x1f')]=qs[_0x0bd5('0x1f')](_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x1f')]);}_0x232d4d[_0x0bd5('0x3c')]=qs[_0x0bd5('0x3d')](_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x3d')]);_0x232d4d[_0x0bd5('0x3e')]=qs['filters'](_[_0x0bd5('0x3f')](_0x3e19ae[_0x0bd5('0x34')],_0x542cbc['filters']),_0x4d5b74);if(_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x40')]){_0x232d4d['where']=_[_0x0bd5('0x41')](_0x232d4d[_0x0bd5('0x3e')],{'$or':_[_0x0bd5('0x2e')](_0x4d5b74,function(_0x55719c){if(_0x55719c['type']!==_0x0bd5('0x42')){var _0xa5ad8c={};_0xa5ad8c[_0x55719c['name']]={'$like':'%'+_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x40')]+'%'};return _0xa5ad8c;}})});}_0x232d4d=_['merge']({},_0x232d4d,_0x3e19ae['options']);var _0x6b319e={'where':_0x232d4d[_0x0bd5('0x3e')]};return db[_0x0bd5('0x43')][_0x0bd5('0x22')](_0x6b319e)[_0x0bd5('0x27')](function(_0x341512){_0x4d12c4['count']=_0x341512;if(_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x44')]){_0x232d4d[_0x0bd5('0x45')]=[{'all':!![]}];}return db[_0x0bd5('0x43')]['findAll'](_0x232d4d);})[_0x0bd5('0x27')](function(_0x2990d2){_0x4d12c4[_0x0bd5('0x46')]=_0x2990d2;return _0x4d12c4;})[_0x0bd5('0x27')](respondWithFilteredResult(_0x5ee9da,_0x232d4d))['catch'](handleError(_0x5ee9da,null));};exports[_0x0bd5('0x47')]=function(_0x3bc322,_0x2c2ad3){var _0x3f59bc={'raw':!![],'where':{'id':_0x3bc322[_0x0bd5('0x48')]['id']}},_0x2a2311={};_0x2a2311[_0x0bd5('0x32')]=_[_0x0bd5('0x33')](db[_0x0bd5('0x43')][_0x0bd5('0x2f')]);_0x2a2311[_0x0bd5('0x34')]=_[_0x0bd5('0x33')](_0x3bc322[_0x0bd5('0x34')]);_0x2a2311['filters']=_['intersection'](_0x2a2311[_0x0bd5('0x32')],_0x2a2311[_0x0bd5('0x34')]);_0x3f59bc['attributes']=_[_0x0bd5('0x36')](_0x2a2311[_0x0bd5('0x32')],qs['fields'](_0x3bc322[_0x0bd5('0x34')]['fields']));_0x3f59bc[_0x0bd5('0x37')]=_0x3f59bc[_0x0bd5('0x37')][_0x0bd5('0x39')]?_0x3f59bc['attributes']:_0x2a2311['model'];if(_0x3bc322['query'][_0x0bd5('0x44')]){_0x3f59bc[_0x0bd5('0x45')]=[{'all':!![]}];}_0x3f59bc=_[_0x0bd5('0x41')]({},_0x3f59bc,_0x3bc322[_0x0bd5('0x49')]);return db['AnalyticTreeReport'][_0x0bd5('0x4a')](_0x3f59bc)[_0x0bd5('0x27')](handleEntityNotFound(_0x2c2ad3,null))[_0x0bd5('0x27')](respondWithResult(_0x2c2ad3,null))['catch'](handleError(_0x2c2ad3,null));};exports[_0x0bd5('0x4b')]=function(_0x57942c,_0x311a16){return db[_0x0bd5('0x43')]['create'](_0x57942c[_0x0bd5('0x4c')],{})['then'](respondWithResult(_0x311a16,0xc9))[_0x0bd5('0x4d')](handleError(_0x311a16,null));};exports[_0x0bd5('0x26')]=function(_0x579383,_0x2de922){if(_0x579383[_0x0bd5('0x4c')]['id']){delete _0x579383['body']['id'];}return db['AnalyticTreeReport'][_0x0bd5('0x4a')]({'where':{'id':_0x579383['params']['id']}})[_0x0bd5('0x27')](handleEntityNotFound(_0x2de922,null))['then'](saveUpdates(_0x579383[_0x0bd5('0x4c')],null))[_0x0bd5('0x27')](respondWithResult(_0x2de922,null))[_0x0bd5('0x4d')](handleError(_0x2de922,null));};exports['destroy']=function(_0x26f9b0,_0x11fad4){return db[_0x0bd5('0x43')][_0x0bd5('0x4a')]({'where':{'id':_0x26f9b0['params']['id']}})[_0x0bd5('0x27')](handleEntityNotFound(_0x11fad4,null))[_0x0bd5('0x27')](removeEntity(_0x11fad4,null))[_0x0bd5('0x4d')](handleError(_0x11fad4,null));}; \ No newline at end of file +var _0x0e84=['offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','options','AnalyticTreeReport','includeAll','include','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x2dca3e,_0x4bf28c){var _0x3f1878=function(_0x798aab){while(--_0x798aab){_0x2dca3e['push'](_0x2dca3e['shift']());}};_0x3f1878(++_0x4bf28c);}(_0x0e84,0xb6));var _0x40e8=function(_0x1c7639,_0x2280c6){_0x1c7639=_0x1c7639-0x0;var _0x3229aa=_0x0e84[_0x1c7639];return _0x3229aa;};'use strict';var emlformat=require(_0x40e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40e8('0x1'));var jsonpatch=require(_0x40e8('0x2'));var rp=require(_0x40e8('0x3'));var moment=require(_0x40e8('0x4'));var BPromise=require(_0x40e8('0x5'));var Mustache=require('mustache');var util=require(_0x40e8('0x6'));var path=require(_0x40e8('0x7'));var sox=require(_0x40e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40e8('0x9'));var _=require(_0x40e8('0xa'));var squel=require(_0x40e8('0xb'));var crypto=require(_0x40e8('0xc'));var jsforce=require(_0x40e8('0xd'));var deskjs=require(_0x40e8('0xe'));var toCsv=require(_0x40e8('0xf'));var querystring=require(_0x40e8('0x10'));var Papa=require(_0x40e8('0x11'));var Redis=require(_0x40e8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x40e8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x40e8('0x14'))(_0x40e8('0x15'));var utils=require(_0x40e8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x40e8('0x17'))['db'];function respondWithStatusCode(_0x1bcf80,_0x1e9d20){_0x1e9d20=_0x1e9d20||0xcc;return function(_0x294737){if(_0x294737){return _0x1bcf80[_0x40e8('0x18')](_0x1e9d20);}return _0x1bcf80[_0x40e8('0x19')](_0x1e9d20)[_0x40e8('0x1a')]();};}function respondWithResult(_0x2a0cf5,_0x49d193){_0x49d193=_0x49d193||0xc8;return function(_0x48b53a){if(_0x48b53a){return _0x2a0cf5['status'](_0x49d193)[_0x40e8('0x1b')](_0x48b53a);}};}function respondWithFilteredResult(_0x543f8f,_0x1fae1d){return function(_0x55104d){if(_0x55104d){var _0x8af40b=typeof _0x1fae1d['offset']===_0x40e8('0x1c')&&typeof _0x1fae1d[_0x40e8('0x1d')]===_0x40e8('0x1c');var _0x25a3dc=_0x55104d[_0x40e8('0x1e')];var _0x5a04df=_0x8af40b?0x0:_0x1fae1d[_0x40e8('0x1f')];var _0x1c264c=_0x8af40b?_0x55104d['count']:_0x1fae1d[_0x40e8('0x1f')]+_0x1fae1d['limit'];var _0x1fbb10;if(_0x1c264c>=_0x25a3dc){_0x1c264c=_0x25a3dc;_0x1fbb10=0xc8;}else{_0x1fbb10=0xce;}_0x543f8f[_0x40e8('0x19')](_0x1fbb10);return _0x543f8f[_0x40e8('0x20')](_0x40e8('0x21'),_0x5a04df+'-'+_0x1c264c+'/'+_0x25a3dc)[_0x40e8('0x1b')](_0x55104d);}return null;};}function patchUpdates(_0x4ce9f7){return function(_0x404a2c){try{jsonpatch['apply'](_0x404a2c,_0x4ce9f7,!![]);}catch(_0x411e94){return BPromise['reject'](_0x411e94);}return _0x404a2c['save']();};}function saveUpdates(_0x524333,_0x14e91b){return function(_0x5532e9){if(_0x5532e9){return _0x5532e9[_0x40e8('0x22')](_0x524333)[_0x40e8('0x23')](function(_0x124845){return _0x124845;});}return null;};}function removeEntity(_0x10eabc,_0x526106){return function(_0x4bec02){if(_0x4bec02){return _0x4bec02[_0x40e8('0x24')]()[_0x40e8('0x23')](function(){_0x10eabc['status'](0xcc)[_0x40e8('0x1a')]();});}};}function handleEntityNotFound(_0x1f672d,_0xb4b807){return function(_0x13126e){if(!_0x13126e){_0x1f672d[_0x40e8('0x18')](0x194);}return _0x13126e;};}function handleError(_0x25c9dd,_0x10eda7){_0x10eda7=_0x10eda7||0x1f4;return function(_0x120958){logger[_0x40e8('0x25')](_0x120958[_0x40e8('0x26')]);if(_0x120958[_0x40e8('0x27')]){delete _0x120958[_0x40e8('0x27')];}_0x25c9dd[_0x40e8('0x19')](_0x10eda7)[_0x40e8('0x28')](_0x120958);};}exports[_0x40e8('0x29')]=function(_0x5d248d,_0x3cdb61){var _0x10bed3={},_0x27ad15={},_0x12f994={'count':0x0,'rows':[]};var _0x45d926=_[_0x40e8('0x2a')](db['AnalyticTreeReport'][_0x40e8('0x2b')],function(_0x34b22a){return{'name':_0x34b22a[_0x40e8('0x2c')],'type':_0x34b22a['type'][_0x40e8('0x2d')]};});_0x27ad15[_0x40e8('0x2e')]=_['map'](_0x45d926,_0x40e8('0x27'));_0x27ad15[_0x40e8('0x2f')]=_['keys'](_0x5d248d[_0x40e8('0x2f')]);_0x27ad15[_0x40e8('0x30')]=_[_0x40e8('0x31')](_0x27ad15[_0x40e8('0x2e')],_0x27ad15[_0x40e8('0x2f')]);_0x10bed3['attributes']=_['intersection'](_0x27ad15[_0x40e8('0x2e')],qs[_0x40e8('0x32')](_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x32')]));_0x10bed3[_0x40e8('0x33')]=_0x10bed3['attributes'][_0x40e8('0x34')]?_0x10bed3[_0x40e8('0x33')]:_0x27ad15[_0x40e8('0x2e')];if(!_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x35')](_0x40e8('0x36'))){_0x10bed3[_0x40e8('0x1d')]=qs[_0x40e8('0x1d')](_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x1d')]);_0x10bed3['offset']=qs[_0x40e8('0x1f')](_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x1f')]);}_0x10bed3[_0x40e8('0x37')]=qs['sort'](_0x5d248d['query']['sort']);_0x10bed3[_0x40e8('0x38')]=qs['filters'](_['pick'](_0x5d248d[_0x40e8('0x2f')],_0x27ad15[_0x40e8('0x30')]),_0x45d926);if(_0x5d248d['query'][_0x40e8('0x39')]){_0x10bed3[_0x40e8('0x38')]=_[_0x40e8('0x3a')](_0x10bed3['where'],{'$or':_[_0x40e8('0x2a')](_0x45d926,function(_0x43e2f9){if(_0x43e2f9[_0x40e8('0x3b')]!=='VIRTUAL'){var _0x15fea2={};_0x15fea2[_0x43e2f9[_0x40e8('0x27')]]={'$like':'%'+_0x5d248d['query'][_0x40e8('0x39')]+'%'};return _0x15fea2;}})});}_0x10bed3=_['merge']({},_0x10bed3,_0x5d248d[_0x40e8('0x3c')]);var _0x517a98={'where':_0x10bed3['where']};return db[_0x40e8('0x3d')]['count'](_0x517a98)[_0x40e8('0x23')](function(_0x2494bb){_0x12f994[_0x40e8('0x1e')]=_0x2494bb;if(_0x5d248d['query'][_0x40e8('0x3e')]){_0x10bed3[_0x40e8('0x3f')]=[{'all':!![]}];}return db[_0x40e8('0x3d')]['findAll'](_0x10bed3);})[_0x40e8('0x23')](function(_0x4a78e8){_0x12f994[_0x40e8('0x40')]=_0x4a78e8;return _0x12f994;})[_0x40e8('0x23')](respondWithFilteredResult(_0x3cdb61,_0x10bed3))[_0x40e8('0x41')](handleError(_0x3cdb61,null));};exports[_0x40e8('0x42')]=function(_0x144165,_0x2b0fb2){var _0x49abd4={'raw':!![],'where':{'id':_0x144165[_0x40e8('0x43')]['id']}},_0x67f8cc={};_0x67f8cc[_0x40e8('0x2e')]=_['keys'](db[_0x40e8('0x3d')]['rawAttributes']);_0x67f8cc[_0x40e8('0x2f')]=_['keys'](_0x144165[_0x40e8('0x2f')]);_0x67f8cc['filters']=_[_0x40e8('0x31')](_0x67f8cc[_0x40e8('0x2e')],_0x67f8cc[_0x40e8('0x2f')]);_0x49abd4['attributes']=_[_0x40e8('0x31')](_0x67f8cc[_0x40e8('0x2e')],qs[_0x40e8('0x32')](_0x144165['query']['fields']));_0x49abd4[_0x40e8('0x33')]=_0x49abd4[_0x40e8('0x33')]['length']?_0x49abd4['attributes']:_0x67f8cc[_0x40e8('0x2e')];if(_0x144165[_0x40e8('0x2f')][_0x40e8('0x3e')]){_0x49abd4[_0x40e8('0x3f')]=[{'all':!![]}];}_0x49abd4=_[_0x40e8('0x3a')]({},_0x49abd4,_0x144165[_0x40e8('0x3c')]);return db[_0x40e8('0x3d')]['find'](_0x49abd4)['then'](handleEntityNotFound(_0x2b0fb2,null))['then'](respondWithResult(_0x2b0fb2,null))[_0x40e8('0x41')](handleError(_0x2b0fb2,null));};exports[_0x40e8('0x44')]=function(_0x39dc3d,_0x1e95f5){return db[_0x40e8('0x3d')][_0x40e8('0x44')](_0x39dc3d[_0x40e8('0x45')],{})[_0x40e8('0x23')](respondWithResult(_0x1e95f5,0xc9))[_0x40e8('0x41')](handleError(_0x1e95f5,null));};exports['update']=function(_0x3a6bcb,_0x4f23b8){if(_0x3a6bcb[_0x40e8('0x45')]['id']){delete _0x3a6bcb[_0x40e8('0x45')]['id'];}return db[_0x40e8('0x3d')]['find']({'where':{'id':_0x3a6bcb['params']['id']}})[_0x40e8('0x23')](handleEntityNotFound(_0x4f23b8,null))[_0x40e8('0x23')](saveUpdates(_0x3a6bcb[_0x40e8('0x45')],null))[_0x40e8('0x23')](respondWithResult(_0x4f23b8,null))['catch'](handleError(_0x4f23b8,null));};exports[_0x40e8('0x24')]=function(_0x1c1faa,_0x53c800){return db['AnalyticTreeReport'][_0x40e8('0x46')]({'where':{'id':_0x1c1faa[_0x40e8('0x43')]['id']}})[_0x40e8('0x23')](handleEntityNotFound(_0x53c800,null))['then'](removeEntity(_0x53c800,null))[_0x40e8('0x41')](handleError(_0x53c800,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f2fde64..fe868af 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 _0x32bd=['../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x32bd,0x142));var _0xd32b=function(_0x46e793,_0x1dc52d){_0x46e793=_0x46e793-0x0;var _0x25cb99=_0x32bd[_0x46e793];return _0x25cb99;};'use strict';var _=require(_0xd32b('0x0'));var util=require('util');var logger=require(_0xd32b('0x1'))(_0xd32b('0x2'));var moment=require(_0xd32b('0x3'));var BPromise=require(_0xd32b('0x4'));var rp=require(_0xd32b('0x5'));var fs=require('fs');var path=require(_0xd32b('0x6'));var rimraf=require(_0xd32b('0x7'));var config=require(_0xd32b('0x8'));var attributes=require(_0xd32b('0x9'));module['exports']=function(_0x5b0184,_0x213413){return _0x5b0184['define'](_0xd32b('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8d8=['api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util'];(function(_0x2859bb,_0x3dd473){var _0x477110=function(_0xe4e169){while(--_0xe4e169){_0x2859bb['push'](_0x2859bb['shift']());}};_0x477110(++_0x3dd473);}(_0xd8d8,0xdb));var _0x8d8d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd8d8[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x8d8d('0x0'));var logger=require('../../config/logger')(_0x8d8d('0x1'));var moment=require('moment');var BPromise=require(_0x8d8d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d8d('0x3'));var rimraf=require(_0x8d8d('0x4'));var config=require(_0x8d8d('0x5'));var attributes=require(_0x8d8d('0x6'));module[_0x8d8d('0x7')]=function(_0x52c823,_0x23d8d4){return _0x52c823[_0x8d8d('0x8')](_0x8d8d('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 5a4efba..040b6ee 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x336f04,_0x270d81){var _0x5e6335=function(_0x49fc5d){while(--_0x49fc5d){_0x336f04['push'](_0x336f04['shift']());}};_0x5e6335(++_0x270d81);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _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(_0x4247e5,_0x30b7bb){var _0x5ee3d5=function(_0x5056cd){while(--_0x5056cd){_0x4247e5['push'](_0x4247e5['shift']());}};_0x5ee3d5(++_0x30b7bb);}(_0xadb5,0xad));var _0x5adb=function(_0x5e1029,_0xc7cc71){_0x5e1029=_0x5e1029-0x0;var _0xb06136=_0xadb5[_0x5e1029];return _0xb06136;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 64532ed..2ee1ada 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 _0x816f=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x816f,0x1e5));var _0xf816=function(_0x496b7a,_0x55d817){_0x496b7a=_0x496b7a-0x0;var _0x33e87a=_0x816f[_0x496b7a];return _0x33e87a;};'use strict';var multer=require(_0xf816('0x0'));var util=require(_0xf816('0x1'));var path=require(_0xf816('0x2'));var timeout=require(_0xf816('0x3'));var express=require('express');var router=express[_0xf816('0x4')]();var fs_extra=require(_0xf816('0x5'));var auth=require(_0xf816('0x6'));var interaction=require(_0xf816('0x7'));var config=require('../../config/environment');var controller=require(_0xf816('0x8'));router[_0xf816('0x9')]('/',auth[_0xf816('0xa')](),controller[_0xf816('0xb')]);router['get'](_0xf816('0xc'),auth[_0xf816('0xa')](),controller[_0xf816('0xd')]);router[_0xf816('0xe')]('/',auth['isAuthenticated'](),controller[_0xf816('0xf')]);router[_0xf816('0x10')](_0xf816('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf816('0x11')]('/:id',auth[_0xf816('0xa')](),controller[_0xf816('0x12')]);module[_0xf816('0x13')]=router; \ No newline at end of file +var _0xb64f=['isAuthenticated','index','show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3cfc96,_0x4a9b0b){var _0x3b5b7c=function(_0x54e966){while(--_0x54e966){_0x3cfc96['push'](_0x3cfc96['shift']());}};_0x3b5b7c(++_0x4a9b0b);}(_0xb64f,0x1a6));var _0xfb64=function(_0x2077be,_0x26136a){_0x2077be=_0x2077be-0x0;var _0x198bbf=_0xb64f[_0x2077be];return _0x198bbf;};'use strict';var multer=require('multer');var util=require(_0xfb64('0x0'));var path=require(_0xfb64('0x1'));var timeout=require(_0xfb64('0x2'));var express=require(_0xfb64('0x3'));var router=express[_0xfb64('0x4')]();var fs_extra=require(_0xfb64('0x5'));var auth=require(_0xfb64('0x6'));var interaction=require(_0xfb64('0x7'));var config=require(_0xfb64('0x8'));var controller=require('./analyticTreeReport.controller');router[_0xfb64('0x9')]('/',auth[_0xfb64('0xa')](),controller[_0xfb64('0xb')]);router[_0xfb64('0x9')]('/:id',auth[_0xfb64('0xa')](),controller[_0xfb64('0xc')]);router['post']('/',auth[_0xfb64('0xa')](),controller[_0xfb64('0xd')]);router[_0xfb64('0xe')](_0xfb64('0xf'),auth[_0xfb64('0xa')](),controller[_0xfb64('0x10')]);router[_0xfb64('0x11')](_0xfb64('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 6fddffe..84ba3e6 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 _0xf9bc=['exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x351274,_0xa3dc98){_0x351274=_0x351274-0x0;var _0x2c388a=_0xf9bc[_0x351274];return _0x2c388a;};'use strict';var Sequelize=require('sequelize');module[_0xcf9b('0x0')]={'name':{'type':Sequelize[_0xcf9b('0x1')]},'basename':{'type':Sequelize[_0xcf9b('0x1')]},'type':{'type':Sequelize[_0xcf9b('0x1')]}}; \ No newline at end of file +var _0xbed7=['STRING','sequelize','exports'];(function(_0x312cdb,_0x181ba2){var _0x2e1e2e=function(_0x1e8115){while(--_0x1e8115){_0x312cdb['push'](_0x312cdb['shift']());}};_0x2e1e2e(++_0x181ba2);}(_0xbed7,0x14b));var _0x7bed=function(_0x5e096c,_0x2ebcb9){_0x5e096c=_0x5e096c-0x0;var _0x78ab6c=_0xbed7[_0x5e096c];return _0x78ab6c;};'use strict';var Sequelize=require(_0x7bed('0x0'));module[_0x7bed('0x1')]={'name':{'type':Sequelize[_0x7bed('0x2')]},'basename':{'type':Sequelize[_0x7bed('0x2')]},'type':{'type':Sequelize[_0x7bed('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2ca96a9..1c1ec97 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 _0xd519=['create','download','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','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','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Attachment','rawAttributes','keys','clone','find','get','omit','createdAt','updatedAt','body','file','originalname','basename','filename','mimetype'];(function(_0x2430f7,_0x4842db){var _0x37dc5f=function(_0x55bf7c){while(--_0x55bf7c){_0x2430f7['push'](_0x2430f7['shift']());}};_0x37dc5f(++_0x4842db);}(_0xd519,0x1c7));var _0x9d51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd519[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9d51('0x0'));var rimraf=require(_0x9d51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d51('0x2'));var rp=require(_0x9d51('0x3'));var moment=require(_0x9d51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9d51('0x5'));var util=require(_0x9d51('0x6'));var path=require('path');var sox=require(_0x9d51('0x7'));var csv=require(_0x9d51('0x8'));var ejs=require(_0x9d51('0x9'));var fs=require('fs');var fs_extra=require(_0x9d51('0xa'));var _=require(_0x9d51('0xb'));var squel=require(_0x9d51('0xc'));var crypto=require(_0x9d51('0xd'));var jsforce=require(_0x9d51('0xe'));var deskjs=require(_0x9d51('0xf'));var toCsv=require(_0x9d51('0x8'));var querystring=require(_0x9d51('0x10'));var Papa=require(_0x9d51('0x11'));var Redis=require('ioredis');var authService=require(_0x9d51('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9d51('0x13'));var hardwareService=require(_0x9d51('0x14'));var logger=require('../../config/logger')(_0x9d51('0x15'));var utils=require(_0x9d51('0x16'));var config=require(_0x9d51('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d51('0x18'))['db'];function respondWithStatusCode(_0x456a18,_0x3fedef){_0x3fedef=_0x3fedef||0xcc;return function(_0x58b62b){if(_0x58b62b){return _0x456a18[_0x9d51('0x19')](_0x3fedef);}return _0x456a18['status'](_0x3fedef)['end']();};}function respondWithResult(_0x41ca02,_0x270cd2){_0x270cd2=_0x270cd2||0xc8;return function(_0x4d9a73){if(_0x4d9a73){return _0x41ca02[_0x9d51('0x1a')](_0x270cd2)[_0x9d51('0x1b')](_0x4d9a73);}};}function respondWithFilteredResult(_0xa39c6b,_0x488a2e){return function(_0x292677){if(_0x292677){var _0x224516=typeof _0x488a2e['offset']===_0x9d51('0x1c')&&typeof _0x488a2e[_0x9d51('0x1d')]==='undefined';var _0x33afa2=_0x292677[_0x9d51('0x1e')];var _0x24cc13=_0x224516?0x0:_0x488a2e[_0x9d51('0x1f')];var _0x5c1f79=_0x224516?_0x292677[_0x9d51('0x1e')]:_0x488a2e[_0x9d51('0x1f')]+_0x488a2e[_0x9d51('0x1d')];var _0x17e463;if(_0x5c1f79>=_0x33afa2){_0x5c1f79=_0x33afa2;_0x17e463=0xc8;}else{_0x17e463=0xce;}_0xa39c6b['status'](_0x17e463);return _0xa39c6b[_0x9d51('0x20')](_0x9d51('0x21'),_0x24cc13+'-'+_0x5c1f79+'/'+_0x33afa2)[_0x9d51('0x1b')](_0x292677);}return null;};}function patchUpdates(_0xcd2a12){return function(_0x5eb62b){try{jsonpatch[_0x9d51('0x22')](_0x5eb62b,_0xcd2a12,!![]);}catch(_0x177502){return BPromise['reject'](_0x177502);}return _0x5eb62b[_0x9d51('0x23')]();};}function saveUpdates(_0x334fc4,_0x1335e4){return function(_0x7ea2ae){if(_0x7ea2ae){return _0x7ea2ae[_0x9d51('0x24')](_0x334fc4)[_0x9d51('0x25')](function(_0x49891e){return _0x49891e;});}return null;};}function removeEntity(_0x2b09dd,_0x533448){return function(_0x527fd0){if(_0x527fd0){return _0x527fd0[_0x9d51('0x26')]()[_0x9d51('0x25')](function(){_0x2b09dd[_0x9d51('0x1a')](0xcc)[_0x9d51('0x27')]();});}};}function handleEntityNotFound(_0x9b2f26,_0x2869ce){return function(_0x365025){if(!_0x365025){_0x9b2f26['sendStatus'](0x194);}return _0x365025;};}function handleError(_0x5a273e,_0x7a8a06){_0x7a8a06=_0x7a8a06||0x1f4;return function(_0x1c275f){logger[_0x9d51('0x28')](_0x1c275f[_0x9d51('0x29')]);if(_0x1c275f[_0x9d51('0x2a')]){delete _0x1c275f[_0x9d51('0x2a')];}_0x5a273e[_0x9d51('0x1a')](_0x7a8a06)[_0x9d51('0x2b')](_0x1c275f);};}exports['index']=function(_0x1414b5,_0x5885f8){var _0x1b08c1={},_0x55c015={},_0x348a8f={'count':0x0,'rows':[]};var _0x5eb8ec=_[_0x9d51('0x2c')](db['Attachment']['rawAttributes'],function(_0x44d686){return{'name':_0x44d686[_0x9d51('0x2d')],'type':_0x44d686[_0x9d51('0x2e')]['key']};});_0x55c015[_0x9d51('0x2f')]=_[_0x9d51('0x2c')](_0x5eb8ec,'name');_0x55c015[_0x9d51('0x30')]=_['keys'](_0x1414b5[_0x9d51('0x30')]);_0x55c015['filters']=_[_0x9d51('0x31')](_0x55c015[_0x9d51('0x2f')],_0x55c015[_0x9d51('0x30')]);_0x1b08c1['attributes']=_[_0x9d51('0x31')](_0x55c015[_0x9d51('0x2f')],qs['fields'](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x32')]));_0x1b08c1[_0x9d51('0x33')]=_0x1b08c1['attributes']['length']?_0x1b08c1['attributes']:_0x55c015[_0x9d51('0x2f')];if(!_0x1414b5[_0x9d51('0x30')][_0x9d51('0x34')](_0x9d51('0x35'))){_0x1b08c1[_0x9d51('0x1d')]=qs['limit'](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x1d')]);_0x1b08c1[_0x9d51('0x1f')]=qs[_0x9d51('0x1f')](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x1f')]);}_0x1b08c1[_0x9d51('0x36')]=qs[_0x9d51('0x37')](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x37')]);_0x1b08c1[_0x9d51('0x38')]=qs[_0x9d51('0x39')](_[_0x9d51('0x3a')](_0x1414b5[_0x9d51('0x30')],_0x55c015[_0x9d51('0x39')]),_0x5eb8ec);if(_0x1414b5['query'][_0x9d51('0x3b')]){_0x1b08c1[_0x9d51('0x38')]=_[_0x9d51('0x3c')](_0x1b08c1[_0x9d51('0x38')],{'$or':_['map'](_0x5eb8ec,function(_0x19b53d){if(_0x19b53d[_0x9d51('0x2e')]!==_0x9d51('0x3d')){var _0x1bf853={};_0x1bf853[_0x19b53d[_0x9d51('0x2a')]]={'$like':'%'+_0x1414b5['query'][_0x9d51('0x3b')]+'%'};return _0x1bf853;}})});}_0x1b08c1=_[_0x9d51('0x3c')]({},_0x1b08c1,_0x1414b5[_0x9d51('0x3e')]);var _0x44aa24={'where':_0x1b08c1[_0x9d51('0x38')]};return db['Attachment'][_0x9d51('0x1e')](_0x44aa24)[_0x9d51('0x25')](function(_0x3c2104){_0x348a8f[_0x9d51('0x1e')]=_0x3c2104;if(_0x1414b5['query'][_0x9d51('0x3f')]){_0x1b08c1[_0x9d51('0x40')]=[{'all':!![]}];}return db['Attachment'][_0x9d51('0x41')](_0x1b08c1);})[_0x9d51('0x25')](function(_0x276daf){_0x348a8f[_0x9d51('0x42')]=_0x276daf;return _0x348a8f;})['then'](respondWithFilteredResult(_0x5885f8,_0x1b08c1))[_0x9d51('0x43')](handleError(_0x5885f8,null));};exports[_0x9d51('0x44')]=function(_0x171214,_0xe2204){var _0x1d6d6b={'raw':!![],'where':{'id':_0x171214[_0x9d51('0x45')]['id']}},_0x3225de={};_0x3225de[_0x9d51('0x2f')]=_['keys'](db[_0x9d51('0x46')][_0x9d51('0x47')]);_0x3225de['query']=_[_0x9d51('0x48')](_0x171214[_0x9d51('0x30')]);_0x3225de[_0x9d51('0x39')]=_[_0x9d51('0x31')](_0x3225de[_0x9d51('0x2f')],_0x3225de[_0x9d51('0x30')]);_0x1d6d6b[_0x9d51('0x33')]=_[_0x9d51('0x31')](_0x3225de['model'],qs[_0x9d51('0x32')](_0x171214[_0x9d51('0x30')][_0x9d51('0x32')]));_0x1d6d6b[_0x9d51('0x33')]=_0x1d6d6b[_0x9d51('0x33')]['length']?_0x1d6d6b['attributes']:_0x3225de[_0x9d51('0x2f')];if(_0x171214[_0x9d51('0x30')][_0x9d51('0x3f')]){_0x1d6d6b[_0x9d51('0x40')]=[{'all':!![]}];}_0x1d6d6b=_[_0x9d51('0x3c')]({},_0x1d6d6b,_0x171214['options']);return db[_0x9d51('0x46')]['find'](_0x1d6d6b)['then'](handleEntityNotFound(_0xe2204,null))[_0x9d51('0x25')](respondWithResult(_0xe2204,null))[_0x9d51('0x43')](handleError(_0xe2204,null));};exports[_0x9d51('0x49')]=function(_0x441e17,_0x21c811){var _0x19c5b2={'where':{'id':_0x441e17[_0x9d51('0x45')]['id']}},_0x55f9fe={};_0x55f9fe['model']=_['keys'](db['Attachment'][_0x9d51('0x47')]);_0x19c5b2[_0x9d51('0x33')]=_[_0x9d51('0x31')](_0x55f9fe[_0x9d51('0x2f')],qs[_0x9d51('0x32')](_0x441e17[_0x9d51('0x30')][_0x9d51('0x32')]));_0x19c5b2['attributes']=_0x19c5b2[_0x9d51('0x33')]['length']?_0x19c5b2[_0x9d51('0x33')]:_0x55f9fe[_0x9d51('0x2f')];if(_0x441e17[_0x9d51('0x30')][_0x9d51('0x3f')]){_0x19c5b2[_0x9d51('0x40')]=[{'all':!![]}];}_0x19c5b2=_[_0x9d51('0x3c')]({},_0x19c5b2,_0x441e17[_0x9d51('0x3e')]);return db[_0x9d51('0x46')][_0x9d51('0x4a')](_0x19c5b2)['then'](handleEntityNotFound(_0x21c811,null))['then'](function(_0x399854){if(_0x399854){var _0x1d709f=_0x399854[_0x9d51('0x4b')]({'plain':!![]});_0x1d709f=qs[_0x9d51('0x4c')](_0x1d709f,['id',_0x9d51('0x4d'),_0x9d51('0x4e')]);_0x441e17['body']=_['omit'](_0x441e17['body'],['id',_0x9d51('0x4d'),_0x9d51('0x4e')]);return db[_0x9d51('0x46')]['create'](_[_0x9d51('0x3c')](_0x1d709f,_0x441e17[_0x9d51('0x4f')]),{'include':_0x441e17[_0x9d51('0x30')][_0x9d51('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x21c811,0xc9))[_0x9d51('0x43')](handleError(_0x21c811,null));};exports[_0x9d51('0x24')]=function(_0x196370,_0x10218f){if(_0x196370[_0x9d51('0x4f')]['id']){delete _0x196370[_0x9d51('0x4f')]['id'];}return db[_0x9d51('0x46')][_0x9d51('0x4a')]({'where':{'id':_0x196370[_0x9d51('0x45')]['id']}})[_0x9d51('0x25')](handleEntityNotFound(_0x10218f,null))[_0x9d51('0x25')](saveUpdates(_0x196370[_0x9d51('0x4f')],null))[_0x9d51('0x25')](respondWithResult(_0x10218f,null))[_0x9d51('0x43')](handleError(_0x10218f,null));};exports['destroy']=function(_0xa4c749,_0x3f3621){return db[_0x9d51('0x46')][_0x9d51('0x4a')]({'where':{'id':_0xa4c749[_0x9d51('0x45')]['id']}})[_0x9d51('0x25')](handleEntityNotFound(_0x3f3621,null))[_0x9d51('0x25')](removeEntity(_0x3f3621,null))[_0x9d51('0x43')](handleError(_0x3f3621,null));};exports['create']=function(_0x48c30d,_0x364d46,_0x5b95eb){_0x48c30d[_0x9d51('0x4f')][_0x9d51('0x2a')]=_0x48c30d[_0x9d51('0x50')][_0x9d51('0x51')];_0x48c30d[_0x9d51('0x4f')][_0x9d51('0x52')]=_0x48c30d[_0x9d51('0x50')][_0x9d51('0x53')];_0x48c30d[_0x9d51('0x4f')]['type']=_0x48c30d[_0x9d51('0x50')][_0x9d51('0x54')];return db[_0x9d51('0x46')][_0x9d51('0x55')](_0x48c30d[_0x9d51('0x4f')])[_0x9d51('0x25')](respondWithResult(_0x364d46,0xc9))[_0x9d51('0x43')](handleError(_0x364d46,null));};exports[_0x9d51('0x56')]=function(_0x3ba379,_0x5615af,_0x53450a){return db[_0x9d51('0x46')]['findOne']({'where':{'id':_0x3ba379[_0x9d51('0x45')]['id']},'raw':!![]})[_0x9d51('0x25')](handleEntityNotFound(_0x5615af,null))[_0x9d51('0x25')](function(_0x3e2336){if(_0x3e2336){var _0x46d017=_0x3e2336['ChatOfflineMessageId']!==null;var _0x3cb073=path[_0x9d51('0x57')](config[_0x9d51('0x58')],'server/files/attachments/');if(_0x46d017){_0x3cb073=path[_0x9d51('0x57')](_0x3cb073,_0x9d51('0x59'));}var _0x513b86=path[_0x9d51('0x57')](_0x3cb073,_0x3e2336[_0x9d51('0x52')]);return _0x5615af[_0x9d51('0x56')](_0x513b86);}})['catch'](handleError(_0x5615af,null));}; \ No newline at end of file +var _0xdd36=['map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xdd36,0xe7));var _0x6dd3=function(_0x389b1a,_0x155431){_0x389b1a=_0x389b1a-0x0;var _0x1e035a=_0xdd36[_0x389b1a];return _0x1e035a;};'use strict';var emlformat=require(_0x6dd3('0x0'));var rimraf=require(_0x6dd3('0x1'));var zipdir=require(_0x6dd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dd3('0x3'));var moment=require(_0x6dd3('0x4'));var BPromise=require(_0x6dd3('0x5'));var Mustache=require(_0x6dd3('0x6'));var util=require(_0x6dd3('0x7'));var path=require(_0x6dd3('0x8'));var sox=require(_0x6dd3('0x9'));var csv=require(_0x6dd3('0xa'));var ejs=require(_0x6dd3('0xb'));var fs=require('fs');var fs_extra=require(_0x6dd3('0xc'));var _=require(_0x6dd3('0xd'));var squel=require(_0x6dd3('0xe'));var crypto=require('crypto');var jsforce=require(_0x6dd3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6dd3('0xa'));var querystring=require(_0x6dd3('0x10'));var Papa=require(_0x6dd3('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6dd3('0x12'));var as=require(_0x6dd3('0x13'));var hardwareService=require(_0x6dd3('0x14'));var logger=require(_0x6dd3('0x15'))(_0x6dd3('0x16'));var utils=require(_0x6dd3('0x17'));var config=require(_0x6dd3('0x18'));var licenseUtil=require(_0x6dd3('0x19'));var db=require(_0x6dd3('0x1a'))['db'];function respondWithStatusCode(_0x13ca0b,_0x54e006){_0x54e006=_0x54e006||0xcc;return function(_0x38bf61){if(_0x38bf61){return _0x13ca0b[_0x6dd3('0x1b')](_0x54e006);}return _0x13ca0b[_0x6dd3('0x1c')](_0x54e006)[_0x6dd3('0x1d')]();};}function respondWithResult(_0x5811d9,_0x59d946){_0x59d946=_0x59d946||0xc8;return function(_0x52d904){if(_0x52d904){return _0x5811d9[_0x6dd3('0x1c')](_0x59d946)[_0x6dd3('0x1e')](_0x52d904);}};}function respondWithFilteredResult(_0x1a187d,_0x42a91a){return function(_0x57a7b7){if(_0x57a7b7){var _0x2f0add=typeof _0x42a91a[_0x6dd3('0x1f')]==='undefined'&&typeof _0x42a91a[_0x6dd3('0x20')]===_0x6dd3('0x21');var _0x55be36=_0x57a7b7[_0x6dd3('0x22')];var _0x398450=_0x2f0add?0x0:_0x42a91a[_0x6dd3('0x1f')];var _0x2d1646=_0x2f0add?_0x57a7b7[_0x6dd3('0x22')]:_0x42a91a['offset']+_0x42a91a[_0x6dd3('0x20')];var _0x128fc5;if(_0x2d1646>=_0x55be36){_0x2d1646=_0x55be36;_0x128fc5=0xc8;}else{_0x128fc5=0xce;}_0x1a187d[_0x6dd3('0x1c')](_0x128fc5);return _0x1a187d[_0x6dd3('0x23')](_0x6dd3('0x24'),_0x398450+'-'+_0x2d1646+'/'+_0x55be36)[_0x6dd3('0x1e')](_0x57a7b7);}return null;};}function patchUpdates(_0x3b0772){return function(_0x9808a0){try{jsonpatch[_0x6dd3('0x25')](_0x9808a0,_0x3b0772,!![]);}catch(_0x184588){return BPromise[_0x6dd3('0x26')](_0x184588);}return _0x9808a0[_0x6dd3('0x27')]();};}function saveUpdates(_0x1962ee,_0x28d67d){return function(_0x54b21d){if(_0x54b21d){return _0x54b21d[_0x6dd3('0x28')](_0x1962ee)['then'](function(_0x1c6b96){return _0x1c6b96;});}return null;};}function removeEntity(_0x1d6282,_0x4fe6b3){return function(_0x5b54c6){if(_0x5b54c6){return _0x5b54c6[_0x6dd3('0x29')]()[_0x6dd3('0x2a')](function(){_0x1d6282[_0x6dd3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d2ed,_0x381066){return function(_0x35fd9b){if(!_0x35fd9b){_0x21d2ed[_0x6dd3('0x1b')](0x194);}return _0x35fd9b;};}function handleError(_0x2c2649,_0x3a0717){_0x3a0717=_0x3a0717||0x1f4;return function(_0x199b8a){logger[_0x6dd3('0x2b')](_0x199b8a[_0x6dd3('0x2c')]);if(_0x199b8a[_0x6dd3('0x2d')]){delete _0x199b8a['name'];}_0x2c2649[_0x6dd3('0x1c')](_0x3a0717)[_0x6dd3('0x2e')](_0x199b8a);};}exports[_0x6dd3('0x2f')]=function(_0x271418,_0x498510){var _0x11e703={},_0x1089f0={},_0xe25d87={'count':0x0,'rows':[]};var _0xedc8c4=_[_0x6dd3('0x30')](db[_0x6dd3('0x31')][_0x6dd3('0x32')],function(_0x55841d){return{'name':_0x55841d[_0x6dd3('0x33')],'type':_0x55841d[_0x6dd3('0x34')][_0x6dd3('0x35')]};});_0x1089f0[_0x6dd3('0x36')]=_[_0x6dd3('0x30')](_0xedc8c4,_0x6dd3('0x2d'));_0x1089f0[_0x6dd3('0x37')]=_[_0x6dd3('0x38')](_0x271418[_0x6dd3('0x37')]);_0x1089f0['filters']=_[_0x6dd3('0x39')](_0x1089f0[_0x6dd3('0x36')],_0x1089f0[_0x6dd3('0x37')]);_0x11e703[_0x6dd3('0x3a')]=_[_0x6dd3('0x39')](_0x1089f0['model'],qs[_0x6dd3('0x3b')](_0x271418['query'][_0x6dd3('0x3b')]));_0x11e703['attributes']=_0x11e703[_0x6dd3('0x3a')][_0x6dd3('0x3c')]?_0x11e703['attributes']:_0x1089f0[_0x6dd3('0x36')];if(!_0x271418[_0x6dd3('0x37')]['hasOwnProperty']('nolimit')){_0x11e703[_0x6dd3('0x20')]=qs[_0x6dd3('0x20')](_0x271418[_0x6dd3('0x37')][_0x6dd3('0x20')]);_0x11e703[_0x6dd3('0x1f')]=qs['offset'](_0x271418[_0x6dd3('0x37')][_0x6dd3('0x1f')]);}_0x11e703[_0x6dd3('0x3d')]=qs[_0x6dd3('0x3e')](_0x271418[_0x6dd3('0x37')][_0x6dd3('0x3e')]);_0x11e703[_0x6dd3('0x3f')]=qs[_0x6dd3('0x40')](_[_0x6dd3('0x41')](_0x271418[_0x6dd3('0x37')],_0x1089f0[_0x6dd3('0x40')]),_0xedc8c4);if(_0x271418[_0x6dd3('0x37')][_0x6dd3('0x42')]){_0x11e703[_0x6dd3('0x3f')]=_[_0x6dd3('0x43')](_0x11e703[_0x6dd3('0x3f')],{'$or':_[_0x6dd3('0x30')](_0xedc8c4,function(_0x305a8){if(_0x305a8[_0x6dd3('0x34')]!==_0x6dd3('0x44')){var _0x2d47ce={};_0x2d47ce[_0x305a8[_0x6dd3('0x2d')]]={'$like':'%'+_0x271418[_0x6dd3('0x37')]['filter']+'%'};return _0x2d47ce;}})});}_0x11e703=_[_0x6dd3('0x43')]({},_0x11e703,_0x271418[_0x6dd3('0x45')]);var _0x5381cd={'where':_0x11e703[_0x6dd3('0x3f')]};return db[_0x6dd3('0x31')][_0x6dd3('0x22')](_0x5381cd)[_0x6dd3('0x2a')](function(_0x4f0f0f){_0xe25d87[_0x6dd3('0x22')]=_0x4f0f0f;if(_0x271418[_0x6dd3('0x37')][_0x6dd3('0x46')]){_0x11e703[_0x6dd3('0x47')]=[{'all':!![]}];}return db[_0x6dd3('0x31')][_0x6dd3('0x48')](_0x11e703);})[_0x6dd3('0x2a')](function(_0x4e7e51){_0xe25d87['rows']=_0x4e7e51;return _0xe25d87;})[_0x6dd3('0x2a')](respondWithFilteredResult(_0x498510,_0x11e703))[_0x6dd3('0x49')](handleError(_0x498510,null));};exports[_0x6dd3('0x4a')]=function(_0x56c3c6,_0x51cdc6){var _0x5b706f={'raw':!![],'where':{'id':_0x56c3c6[_0x6dd3('0x4b')]['id']}},_0x5abc81={};_0x5abc81[_0x6dd3('0x36')]=_[_0x6dd3('0x38')](db[_0x6dd3('0x31')][_0x6dd3('0x32')]);_0x5abc81[_0x6dd3('0x37')]=_[_0x6dd3('0x38')](_0x56c3c6[_0x6dd3('0x37')]);_0x5abc81['filters']=_[_0x6dd3('0x39')](_0x5abc81[_0x6dd3('0x36')],_0x5abc81[_0x6dd3('0x37')]);_0x5b706f[_0x6dd3('0x3a')]=_[_0x6dd3('0x39')](_0x5abc81[_0x6dd3('0x36')],qs[_0x6dd3('0x3b')](_0x56c3c6[_0x6dd3('0x37')][_0x6dd3('0x3b')]));_0x5b706f[_0x6dd3('0x3a')]=_0x5b706f[_0x6dd3('0x3a')][_0x6dd3('0x3c')]?_0x5b706f['attributes']:_0x5abc81[_0x6dd3('0x36')];if(_0x56c3c6[_0x6dd3('0x37')][_0x6dd3('0x46')]){_0x5b706f['include']=[{'all':!![]}];}_0x5b706f=_[_0x6dd3('0x43')]({},_0x5b706f,_0x56c3c6[_0x6dd3('0x45')]);return db[_0x6dd3('0x31')][_0x6dd3('0x4c')](_0x5b706f)[_0x6dd3('0x2a')](handleEntityNotFound(_0x51cdc6,null))[_0x6dd3('0x2a')](respondWithResult(_0x51cdc6,null))[_0x6dd3('0x49')](handleError(_0x51cdc6,null));};exports['clone']=function(_0x1b3842,_0x16281d){var _0x81d607={'where':{'id':_0x1b3842[_0x6dd3('0x4b')]['id']}},_0x467c28={};_0x467c28['model']=_[_0x6dd3('0x38')](db['Attachment'][_0x6dd3('0x32')]);_0x81d607[_0x6dd3('0x3a')]=_['intersection'](_0x467c28[_0x6dd3('0x36')],qs['fields'](_0x1b3842[_0x6dd3('0x37')]['fields']));_0x81d607[_0x6dd3('0x3a')]=_0x81d607['attributes'][_0x6dd3('0x3c')]?_0x81d607[_0x6dd3('0x3a')]:_0x467c28[_0x6dd3('0x36')];if(_0x1b3842[_0x6dd3('0x37')][_0x6dd3('0x46')]){_0x81d607[_0x6dd3('0x47')]=[{'all':!![]}];}_0x81d607=_[_0x6dd3('0x43')]({},_0x81d607,_0x1b3842[_0x6dd3('0x45')]);return db[_0x6dd3('0x31')][_0x6dd3('0x4c')](_0x81d607)[_0x6dd3('0x2a')](handleEntityNotFound(_0x16281d,null))[_0x6dd3('0x2a')](function(_0x40889c){if(_0x40889c){var _0x310e98=_0x40889c[_0x6dd3('0x4d')]({'plain':!![]});_0x310e98=qs[_0x6dd3('0x4e')](_0x310e98,['id',_0x6dd3('0x4f'),_0x6dd3('0x50')]);_0x1b3842[_0x6dd3('0x51')]=_[_0x6dd3('0x4e')](_0x1b3842['body'],['id',_0x6dd3('0x4f'),'updatedAt']);return db[_0x6dd3('0x31')][_0x6dd3('0x52')](_[_0x6dd3('0x43')](_0x310e98,_0x1b3842[_0x6dd3('0x51')]),{'include':_0x1b3842[_0x6dd3('0x37')][_0x6dd3('0x46')]?[{'all':!![]}]:undefined});}})[_0x6dd3('0x2a')](respondWithResult(_0x16281d,0xc9))['catch'](handleError(_0x16281d,null));};exports[_0x6dd3('0x28')]=function(_0x596bb4,_0x30713c){if(_0x596bb4[_0x6dd3('0x51')]['id']){delete _0x596bb4[_0x6dd3('0x51')]['id'];}return db[_0x6dd3('0x31')]['find']({'where':{'id':_0x596bb4['params']['id']}})[_0x6dd3('0x2a')](handleEntityNotFound(_0x30713c,null))[_0x6dd3('0x2a')](saveUpdates(_0x596bb4[_0x6dd3('0x51')],null))[_0x6dd3('0x2a')](respondWithResult(_0x30713c,null))[_0x6dd3('0x49')](handleError(_0x30713c,null));};exports[_0x6dd3('0x29')]=function(_0x155074,_0x4396ea){return db[_0x6dd3('0x31')]['find']({'where':{'id':_0x155074[_0x6dd3('0x4b')]['id']}})[_0x6dd3('0x2a')](handleEntityNotFound(_0x4396ea,null))[_0x6dd3('0x2a')](removeEntity(_0x4396ea,null))[_0x6dd3('0x49')](handleError(_0x4396ea,null));};exports['create']=function(_0x4c6fac,_0x5b7337,_0x222753){_0x4c6fac['body'][_0x6dd3('0x2d')]=_0x4c6fac[_0x6dd3('0x53')][_0x6dd3('0x54')];_0x4c6fac[_0x6dd3('0x51')][_0x6dd3('0x55')]=_0x4c6fac[_0x6dd3('0x53')]['filename'];_0x4c6fac[_0x6dd3('0x51')][_0x6dd3('0x34')]=_0x4c6fac[_0x6dd3('0x53')][_0x6dd3('0x56')];return db[_0x6dd3('0x31')][_0x6dd3('0x52')](_0x4c6fac[_0x6dd3('0x51')])[_0x6dd3('0x2a')](respondWithResult(_0x5b7337,0xc9))[_0x6dd3('0x49')](handleError(_0x5b7337,null));};exports['download']=function(_0x5716fd,_0x495af7,_0x2b1109){return db['Attachment'][_0x6dd3('0x57')]({'where':{'id':_0x5716fd[_0x6dd3('0x4b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x495af7,null))[_0x6dd3('0x2a')](function(_0x38ded8){if(_0x38ded8){var _0x4f9ac1=_0x38ded8[_0x6dd3('0x58')]!==null;var _0x3e3653=path[_0x6dd3('0x59')](config[_0x6dd3('0x5a')],_0x6dd3('0x5b'));if(_0x4f9ac1){_0x3e3653=path[_0x6dd3('0x59')](_0x3e3653,'offline-chat/');}var _0x3e888b=path['join'](_0x3e3653,_0x38ded8[_0x6dd3('0x55')]);return _0x495af7[_0x6dd3('0x5c')](_0x3e888b);}})[_0x6dd3('0x49')](handleError(_0x495af7,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7c09f9b..e2fb6c3 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 _0x5251=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','lodash'];(function(_0xa338f6,_0x5a75d6){var _0x1fb469=function(_0x1ff512){while(--_0x1ff512){_0xa338f6['push'](_0xa338f6['shift']());}};_0x1fb469(++_0x5a75d6);}(_0x5251,0x167));var _0x1525=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5251[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1525('0x0'));var util=require(_0x1525('0x1'));var logger=require(_0x1525('0x2'))(_0x1525('0x3'));var moment=require(_0x1525('0x4'));var BPromise=require(_0x1525('0x5'));var rp=require(_0x1525('0x6'));var fs=require('fs');var path=require(_0x1525('0x7'));var rimraf=require('rimraf');var config=require(_0x1525('0x8'));var attributes=require(_0x1525('0x9'));module[_0x1525('0xa')]=function(_0x470262,_0x3bda57){return _0x470262[_0x1525('0xb')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdee1=['exports','define','attachments','util','../../config/logger','bluebird','request-promise','path','./attachment.attributes'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xdee1,0x9c));var _0x1dee=function(_0x35dc52,_0x5c666f){_0x35dc52=_0x35dc52-0x0;var _0x4134cd=_0xdee1[_0x35dc52];return _0x4134cd;};'use strict';var _=require('lodash');var util=require(_0x1dee('0x0'));var logger=require(_0x1dee('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1dee('0x2'));var rp=require(_0x1dee('0x3'));var fs=require('fs');var path=require(_0x1dee('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1dee('0x5'));module[_0x1dee('0x6')]=function(_0x17bcd5,_0x4444ff){return _0x17bcd5[_0x1dee('0x7')]('Attachment',attributes,{'tableName':_0x1dee('0x8'),'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 d5fb31b..6016ecd 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 _0xbb53=['http','then','info','request\x20sent','stringify','error','message','Attachment,\x20%s,\x20%s','result','CreateAttachment','body','options','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xbb53,0x121));var _0x3bb5=function(_0x17a88f,_0x2e6255){_0x17a88f=_0x17a88f-0x0;var _0x45e177=_0xbb53[_0x17a88f];return _0x45e177;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var moment=require(_0x3bb5('0x2'));var BPromise=require(_0x3bb5('0x3'));var rs=require(_0x3bb5('0x4'));var fs=require('fs');var Redis=require(_0x3bb5('0x5'));var db=require(_0x3bb5('0x6'))['db'];var utils=require(_0x3bb5('0x7'));var logger=require(_0x3bb5('0x8'))(_0x3bb5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bb5('0xa')][_0x3bb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aa7d,_0x157e04,_0x22f92f){return new BPromise(function(_0x480f9c,_0x5a4ae3){return client['request'](_0x28aa7d,_0x22f92f)[_0x3bb5('0xc')](function(_0x2e0cfa){logger[_0x3bb5('0xd')]('Attachment,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'),JSON[_0x3bb5('0xf')](_0x2e0cfa));if(_0x2e0cfa['error']){if(_0x2e0cfa[_0x3bb5('0x10')]['code']===0x1f4){logger[_0x3bb5('0x10')]('Attachment,\x20%s,\x20%s',_0x157e04,_0x2e0cfa['error'][_0x3bb5('0x11')]);return _0x5a4ae3(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}logger['error'](_0x3bb5('0x12'),_0x157e04,_0x2e0cfa[_0x3bb5('0x10')]['message']);return _0x480f9c(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x157e04,'request\x20sent');_0x480f9c(_0x2e0cfa[_0x3bb5('0x13')][_0x3bb5('0x11')]);}})['catch'](function(_0x25d774){logger[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x157e04,_0x25d774);_0x5a4ae3(_0x25d774);});});}exports[_0x3bb5('0x14')]=function(_0x48bc25){var _0x13cb3a=this;return new Promise(function(_0x1109d0,_0x289177){return db['Attachment']['create'](_0x48bc25[_0x3bb5('0x15')],{'raw':_0x48bc25[_0x3bb5('0x16')]?_0x48bc25[_0x3bb5('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x3bb5('0xc')](function(_0x2afe6e){logger[_0x3bb5('0xd')](_0x3bb5('0x14'),_0x48bc25);logger[_0x3bb5('0x17')](_0x3bb5('0x14'),_0x48bc25,JSON['stringify'](_0x2afe6e));_0x1109d0(_0x2afe6e);})[_0x3bb5('0x18')](function(_0x3eae85){logger[_0x3bb5('0x10')](_0x3bb5('0x14'),_0x3eae85[_0x3bb5('0x11')],_0x48bc25);_0x289177(_0x13cb3a[_0x3bb5('0x10')](0x1f4,_0x3eae85[_0x3bb5('0x11')]));});});}; \ No newline at end of file +var _0x74f0=['body','raw','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x74f0,0xf3));var _0x074f=function(_0x10e653,_0x59f1cc){_0x10e653=_0x10e653-0x0;var _0x328dfd=_0x74f0[_0x10e653];return _0x328dfd;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x074f('0x1'));var fs=require('fs');var Redis=require(_0x074f('0x2'));var db=require(_0x074f('0x3'))['db'];var utils=require(_0x074f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x074f('0x5'));var jayson=require(_0x074f('0x6'));var client=jayson[_0x074f('0x7')][_0x074f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10b244,_0x395b3c,_0x3dd440){return new BPromise(function(_0x547297,_0x7108e1){return client[_0x074f('0x9')](_0x10b244,_0x3dd440)['then'](function(_0x252a2e){logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));logger[_0x074f('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x395b3c,'request\x20sent',JSON[_0x074f('0xe')](_0x252a2e));if(_0x252a2e[_0x074f('0xf')]){if(_0x252a2e[_0x074f('0xf')][_0x074f('0x10')]===0x1f4){logger[_0x074f('0xf')](_0x074f('0xb'),_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x7108e1(_0x252a2e[_0x074f('0xf')]['message']);}logger[_0x074f('0xf')]('Attachment,\x20%s,\x20%s',_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x547297(_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);}else{logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));_0x547297(_0x252a2e[_0x074f('0x12')][_0x074f('0x11')]);}})[_0x074f('0x13')](function(_0x40fd10){logger['error'](_0x074f('0xb'),_0x395b3c,_0x40fd10);_0x7108e1(_0x40fd10);});});}exports[_0x074f('0x14')]=function(_0x200e43){var _0x3facd8=this;return new Promise(function(_0x315e7d,_0x1c5406){return db['Attachment']['create'](_0x200e43[_0x074f('0x15')],{'raw':_0x200e43['options']?_0x200e43['options'][_0x074f('0x16')]===undefined?!![]:![]:!![]})[_0x074f('0x17')](function(_0x1563f3){logger[_0x074f('0xa')](_0x074f('0x14'),_0x200e43);logger[_0x074f('0xd')](_0x074f('0x14'),_0x200e43,JSON[_0x074f('0xe')](_0x1563f3));_0x315e7d(_0x1563f3);})[_0x074f('0x13')](function(_0x2c3b23){logger[_0x074f('0xf')](_0x074f('0x14'),_0x2c3b23[_0x074f('0x11')],_0x200e43);_0x1c5406(_0x3facd8[_0x074f('0xf')](0x1f4,_0x2c3b23[_0x074f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index fe279a8..e35a87f 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(_0x5c1ca0,_0x410ca9){var _0x3a693c=function(_0x3cc4c2){while(--_0x3cc4c2){_0x5c1ca0['push'](_0x5c1ca0['shift']());}};_0x3a693c(++_0x410ca9);}(_0x2032,0xd9));var _0x2203=function(_0x23cc6a,_0x248f69){_0x23cc6a=_0x23cc6a-0x0;var _0x15a927=_0x2032[_0x23cc6a];return _0x15a927;};'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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5e0f94,_0x4a9ae7){var _0x55345a=function(_0x443222){while(--_0x443222){_0x5e0f94['push'](_0x5e0f94['shift']());}};_0x55345a(++_0x4a9ae7);}(_0xb10b,0x12a));var _0xbb10=function(_0x263714,_0x399b37){_0x263714=_0x263714-0x0;var _0x1cd43d=_0xb10b[_0x263714];return _0x1cd43d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index c7e60eb..3be65f2 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 _0x17c2=['activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','baseDN','domain','authenticate','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','name','password','salt','role','blocked','blockedAt','online','user','agent','add','blockDuration','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0x17c2,0x81));var _0x217c=function(_0x12321d,_0x1cf3bf){_0x12321d=_0x12321d-0x0;var _0x18fec7=_0x17c2[_0x12321d];return _0x18fec7;};'use strict';var passport=require(_0x217c('0x0'));var LocalStrategy=require(_0x217c('0x1'))[_0x217c('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x217c('0x3'));var BPromise=require(_0x217c('0x4'));var util=require(_0x217c('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x217c('0x6'));var utils=require(_0x217c('0x7'));var config=require('../../config/environment');var logger=require(_0x217c('0x8'))('api');function isActiveDirectoryConfigured(_0x249030){var _0x30923b=![];if(typeof _0x249030['activedirectory']!=='undefined'){_0x30923b=_0x249030[_0x217c('0x9')][_0x217c('0xa')]&&_0x249030[_0x217c('0x9')]['url']&&_0x249030[_0x217c('0x9')][_0x217c('0xb')];}return _0x30923b;}function adAuthenticate(_0x56298c,_0x119a5e,_0x1e845d){return new BPromise(function(_0x3bbe15,_0xb2f66b){try{var _0x3e61db=new ActiveDirectory(_0x56298c);_0x3e61db[_0x217c('0xc')](_0x119a5e,_0x1e845d,function(_0x22d490,_0xe35dce){if(_0x22d490){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x119a5e,util[_0x217c('0xd')](_0x22d490,{'showHidden':![],'depth':null}));_0xb2f66b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0xe35dce){logger[_0x217c('0xe')](_0x217c('0xf'),_0x119a5e);_0xb2f66b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3bbe15(_0xe35dce);}});}catch(_0x254d64){_0xb2f66b(_0x254d64);}});}function ActiveDirectoryAuthenticate(_0x4c2b28,_0x9a69d7,_0x17b547,_0x325510){var _0x33c46f,_0x256808;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x217c('0x10'),_0x9a69d7);return _0x325510(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x217c('0x11')][_0x217c('0x12')]({'where':{'id':0x1},'attributes':[_0x217c('0x13'),'blockDuration'],'raw':!![]})[_0x217c('0x14')](function(_0x453cb9){_0x33c46f=_0x453cb9;if(!_0x33c46f[_0x217c('0x13')]){logger[_0x217c('0xe')](_0x217c('0x15'),_0x9a69d7);throw new Error(_0x217c('0x16'));}return _0x4c2b28[_0x217c('0x12')]({'attributes':['id',_0x217c('0x17'),_0x217c('0x18'),_0x217c('0x19'),_0x217c('0x1a'),'disabled',_0x217c('0x1b'),_0x217c('0x1c'),_0x217c('0x1d')],'where':{'name':_0x9a69d7,'role':{'$or':['admin',_0x217c('0x1e'),_0x217c('0x1f')]},'adSsoEnabled':!![]}});})[_0x217c('0x14')](function(_0x2ba310){if(!_0x2ba310||_0x2ba310&&_0x2ba310['name']!==_0x9a69d7){throw new Error(_0x217c('0x16'));}_0x256808=_0x2ba310;var _0x2372e6=_0x256808[_0x217c('0x17')]+'@'+config['activedirectory'][_0x217c('0xb')];return adAuthenticate(config[_0x217c('0x9')],_0x2372e6,_0x17b547);})[_0x217c('0x14')](function(_0x5ccef5){if(_0x256808['disabled']){throw new Error(_0x217c('0x16'));}if(_0x33c46f['blockDuration']>0x0){if(_0x256808[_0x217c('0x1b')]){if(moment(_0x256808[_0x217c('0x1c')])[_0x217c('0x20')](_0x33c46f[_0x217c('0x21')],'minutes')>moment()){throw new Error(_0x217c('0x16'));}return utils[_0x217c('0x22')](_0x256808,0x0,![],null)[_0x217c('0x14')](function(){return utils[_0x217c('0x23')](_0x256808);})[_0x217c('0x14')](function(){return _0x325510(null,_0x256808);});}else{return utils['getLicense'](_0x256808)[_0x217c('0x14')](function(){return _0x325510(null,_0x256808);});}}else{return utils[_0x217c('0x23')](_0x256808)[_0x217c('0x14')](function(){return _0x325510(null,_0x256808);});}})['catch'](function(_0x3b38ce){return _0x325510(null,![],_0x3b38ce);});}function handleError(_0xf68ff,_0x56cf2c,_0x36fad1){return _0xf68ff[_0x217c('0x24')](_0x56cf2c||0x1f4)['send']({'message':_0x36fad1?_0x36fad1[_0x217c('0x25')]||_0x36fad1:''});}exports[_0x217c('0x26')]=function(_0x4ce46c,_0x15d2e7,_0x591d65){passport['authenticate'](_0x217c('0x27'),function(_0x78aa1c,_0x5a4efe,_0x272bd3){var _0xd3e0c3=_0x78aa1c||_0x272bd3;if(_0xd3e0c3){return handleError(_0x15d2e7,0x191,_0xd3e0c3);}if(!_0x5a4efe){return handleError(_0x15d2e7,0x194,{'message':_0x217c('0x28')});}else{var _0x19efe4={'payload':{'id':_0x5a4efe['id'],'role':_0x5a4efe[_0x217c('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x217c('0x29')](_0x19efe4)[_0x217c('0x14')](function(_0x4c0d82){_0x15d2e7[_0x217c('0x2a')]({'id':_0x5a4efe['id'],'token':_0x4c0d82,'statusCall':'','isAlreadyLogged':_0x5a4efe[_0x217c('0x1d')]});});}})(_0x4ce46c,_0x15d2e7,_0x591d65);};passport[_0x217c('0x2b')]('ad-login',new LocalStrategy({'usernameField':_0x217c('0x17'),'passwordField':_0x217c('0x18')},function(_0x5317ff,_0x45e145,_0x533fad){return ActiveDirectoryAuthenticate(db['User'],_0x5317ff,_0x45e145,_0x533fad);})); \ No newline at end of file +var _0xb644=['blockedAt','online','name','add','minutes','clearBlockUser','getLicense','catch','ad-login','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','password','salt','role','disabled','blocked'];(function(_0x219750,_0x4b83c1){var _0x4c90c1=function(_0x471d36){while(--_0x471d36){_0x219750['push'](_0x219750['shift']());}};_0x4c90c1(++_0x4b83c1);}(_0xb644,0x15c));var _0x4b64=function(_0x1ccd29,_0x3c456b){_0x1ccd29=_0x1ccd29-0x0;var _0x207fbb=_0xb644[_0x1ccd29];return _0x207fbb;};'use strict';var passport=require(_0x4b64('0x0'));var LocalStrategy=require(_0x4b64('0x1'))[_0x4b64('0x2')];var moment=require(_0x4b64('0x3'));var ActiveDirectory=require(_0x4b64('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x4b64('0x5'))['db'];var authService=require(_0x4b64('0x6'));var utils=require('../../config/utils');var config=require(_0x4b64('0x7'));var logger=require(_0x4b64('0x8'))(_0x4b64('0x9'));function isActiveDirectoryConfigured(_0x477da6){var _0x583e05=![];if(typeof _0x477da6[_0x4b64('0xa')]!==_0x4b64('0xb')){_0x583e05=_0x477da6[_0x4b64('0xa')][_0x4b64('0xc')]&&_0x477da6[_0x4b64('0xa')]['url']&&_0x477da6[_0x4b64('0xa')][_0x4b64('0xd')];}return _0x583e05;}function adAuthenticate(_0x2f5147,_0x4a43bc,_0x3731c2){return new BPromise(function(_0x21b76f,_0x42f461){try{var _0x4bebc7=new ActiveDirectory(_0x2f5147);_0x4bebc7[_0x4b64('0xe')](_0x4a43bc,_0x3731c2,function(_0x17b0e8,_0x282f9a){if(_0x17b0e8){logger[_0x4b64('0xf')](_0x4b64('0x10'),_0x4a43bc,util[_0x4b64('0x11')](_0x17b0e8,{'showHidden':![],'depth':null}));_0x42f461('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x282f9a){logger[_0x4b64('0xf')](_0x4b64('0x12'),_0x4a43bc);_0x42f461(_0x4b64('0x13'));}else{_0x21b76f(_0x282f9a);}});}catch(_0x5d507a){_0x42f461(_0x5d507a);}});}function ActiveDirectoryAuthenticate(_0x19a168,_0x364192,_0x8cd928,_0x1d95b8){var _0x3cf154,_0x2322a0;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4b64('0x14'),_0x364192);return _0x1d95b8(null,![],{'message':_0x4b64('0x13')});}return db['Setting'][_0x4b64('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x4b64('0x16')],'raw':!![]})[_0x4b64('0x17')](function(_0x2649bb){_0x3cf154=_0x2649bb;if(!_0x3cf154[_0x4b64('0x18')]){logger[_0x4b64('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x364192);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x19a168['findOne']({'attributes':['id','name',_0x4b64('0x19'),_0x4b64('0x1a'),_0x4b64('0x1b'),_0x4b64('0x1c'),_0x4b64('0x1d'),_0x4b64('0x1e'),_0x4b64('0x1f')],'where':{'name':_0x364192,'role':{'$or':['admin','user','agent']},'adSsoEnabled':!![]}});})[_0x4b64('0x17')](function(_0x5bae1b){if(!_0x5bae1b||_0x5bae1b&&_0x5bae1b[_0x4b64('0x20')]!==_0x364192){throw new Error(_0x4b64('0x13'));}_0x2322a0=_0x5bae1b;var _0x2406bb=_0x2322a0[_0x4b64('0x20')]+'@'+config[_0x4b64('0xa')][_0x4b64('0xd')];return adAuthenticate(config[_0x4b64('0xa')],_0x2406bb,_0x8cd928);})[_0x4b64('0x17')](function(_0x2cb563){if(_0x2322a0[_0x4b64('0x1c')]){throw new Error(_0x4b64('0x13'));}if(_0x3cf154[_0x4b64('0x16')]>0x0){if(_0x2322a0[_0x4b64('0x1d')]){if(moment(_0x2322a0[_0x4b64('0x1e')])[_0x4b64('0x21')](_0x3cf154[_0x4b64('0x16')],_0x4b64('0x22'))>moment()){throw new Error(_0x4b64('0x13'));}return utils[_0x4b64('0x23')](_0x2322a0,0x0,![],null)[_0x4b64('0x17')](function(){return utils['getLicense'](_0x2322a0);})['then'](function(){return _0x1d95b8(null,_0x2322a0);});}else{return utils[_0x4b64('0x24')](_0x2322a0)['then'](function(){return _0x1d95b8(null,_0x2322a0);});}}else{return utils[_0x4b64('0x24')](_0x2322a0)['then'](function(){return _0x1d95b8(null,_0x2322a0);});}})[_0x4b64('0x25')](function(_0x2a3374){return _0x1d95b8(null,![],_0x2a3374);});}function handleError(_0x57c235,_0x2ab215,_0x5c59e2){return _0x57c235['status'](_0x2ab215||0x1f4)['send']({'message':_0x5c59e2?_0x5c59e2['message']||_0x5c59e2:''});}exports['login']=function(_0x875216,_0x49db32,_0x1c63a0){passport[_0x4b64('0xe')](_0x4b64('0x26'),function(_0x2b7d22,_0x11de08,_0x13c9ee){var _0x39de48=_0x2b7d22||_0x13c9ee;if(_0x39de48){return handleError(_0x49db32,0x191,_0x39de48);}if(!_0x11de08){return handleError(_0x49db32,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xa5eb94={'payload':{'id':_0x11de08['id'],'role':_0x11de08['role']},'options':{'expiresIn':0x15180}};return authService[_0x4b64('0x27')](_0xa5eb94)['then'](function(_0x29172e){_0x49db32[_0x4b64('0x28')]({'id':_0x11de08['id'],'token':_0x29172e,'statusCall':'','isAlreadyLogged':_0x11de08[_0x4b64('0x1f')]});});}})(_0x875216,_0x49db32,_0x1c63a0);};passport['use'](_0x4b64('0x26'),new LocalStrategy({'usernameField':_0x4b64('0x20'),'passwordField':_0x4b64('0x19')},function(_0x7b48d6,_0x3b5899,_0x33931b){return ActiveDirectoryAuthenticate(db[_0x4b64('0x29')],_0x7b48d6,_0x3b5899,_0x33931b);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 04a5b85..d65eaef 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 _0x827d=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x55d800,_0x377aeb){var _0x512130=function(_0x53460f){while(--_0x53460f){_0x55d800['push'](_0x55d800['shift']());}};_0x512130(++_0x377aeb);}(_0x827d,0x150));var _0xd827=function(_0x34199f,_0x114d5a){_0x34199f=_0x34199f-0x0;var _0x4296ff=_0x827d[_0x34199f];return _0x4296ff;};'use strict';var express=require(_0xd827('0x0'));var router=express[_0xd827('0x1')]();var controller=require(_0xd827('0x2'));router[_0xd827('0x3')]('/',controller[_0xd827('0x4')]);module[_0xd827('0x5')]=router; \ No newline at end of file +var _0x97bf=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x278a74,_0x4ea713){var _0xc065b1=function(_0x4064b7){while(--_0x4064b7){_0x278a74['push'](_0x278a74['shift']());}};_0xc065b1(++_0x4ea713);}(_0x97bf,0x15b));var _0xf97b=function(_0x408380,_0x587b99){_0x408380=_0x408380-0x0;var _0x10e025=_0x97bf[_0x408380];return _0x10e025;};'use strict';var express=require(_0xf97b('0x0'));var router=express[_0xf97b('0x1')]();var controller=require(_0xf97b('0x2'));router['post']('/',controller[_0xf97b('0x3')]);module[_0xf97b('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 146de50..f94de0a 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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x7a54,0x106));var _0x47a5=function(_0x57429d,_0x493e61){_0x57429d=_0x57429d-0x0;var _0x4df528=_0x7a54[_0x57429d];return _0x4df528;};'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(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x13e6ff,_0x991288){_0x13e6ff=_0x13e6ff-0x0;var _0x4aee8b=_0x7a54[_0x13e6ff];return _0x4aee8b;};'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 ae501b4..47c6377 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 _0x142b=['isMiddleware','setTokenCookie','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x15736e,_0x112ce7){var _0x2c99fe=function(_0x53657c){while(--_0x53657c){_0x15736e['push'](_0x15736e['shift']());}};_0x2c99fe(++_0x112ce7);}(_0x142b,0x1bb));var _0xb142=function(_0x548f36,_0x20365f){_0x548f36=_0x548f36-0x0;var _0x4474d2=_0x142b[_0x548f36];return _0x4474d2;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xb142('0x0'));var authService=require(_0xb142('0x1'));router[_0xb142('0x2')]('/',controller[_0xb142('0x3')]);router[_0xb142('0x2')]('/callback',controller[_0xb142('0x4')],authService[_0xb142('0x5')],userController[_0xb142('0x3')],authService[_0xb142('0x6')]);module['exports']=router; \ No newline at end of file +var _0x1fc7=['../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller'];(function(_0x3ed1c1,_0x45fe0a){var _0x11797d=function(_0x26bad3){while(--_0x26bad3){_0x3ed1c1['push'](_0x3ed1c1['shift']());}};_0x11797d(++_0x45fe0a);}(_0x1fc7,0x1ca));var _0x71fc=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x1fc7[_0x1694f5];return _0x5b4321;};'use strict';var express=require(_0x71fc('0x0'));var passport=require(_0x71fc('0x1'));var router=express[_0x71fc('0x2')]();var controller=require(_0x71fc('0x3'));var userController=require(_0x71fc('0x4'));var authService=require(_0x71fc('0x5'));router[_0x71fc('0x6')]('/',controller[_0x71fc('0x7')]);router[_0x71fc('0x6')]('/callback',controller[_0x71fc('0x8')],authService[_0x71fc('0x9')],userController[_0x71fc('0x7')],authService['setTokenCookie']);module[_0x71fc('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index cbc02a2..6f6d91a 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 _0x9490=['util','passport-local','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','blocked','loginAttempts','admin','user','agent','then','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','clearBlockUser','minutes','getLicense','catch','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','message','stringify','error','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','toLowerCase','User','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','find','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','passwordHistoryLimit','use'];(function(_0x5cefc6,_0x25facc){var _0x36ab4d=function(_0x2c0426){while(--_0x2c0426){_0x5cefc6['push'](_0x5cefc6['shift']());}};_0x36ab4d(++_0x25facc);}(_0x9490,0x1b6));var _0x0949=function(_0x40e513,_0x4071ab){_0x40e513=_0x40e513-0x0;var _0x59068d=_0x9490[_0x40e513];return _0x59068d;};'use strict';var util=require(_0x0949('0x0'));var passport=require('passport');var LocalStrategy=require(_0x0949('0x1'))['Strategy'];var jayson=require(_0x0949('0x2'));var _=require(_0x0949('0x3'));var rs=require(_0x0949('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x0949('0x5'));var utils=require(_0x0949('0x6'));var client=jayson[_0x0949('0x7')][_0x0949('0x8')]({'port':0x232b});function localAuthenticate(_0x124b4b,_0x536c1f,_0x172b81,_0x2a16a3){var _0x3871b9,_0x23287b;return db[_0x0949('0x9')][_0x0949('0xa')]({'where':{'id':0x1},'attributes':[_0x0949('0xb'),_0x0949('0xc')],'raw':!![]})['then'](function(_0x342473){_0x3871b9=_0x342473;return _0x124b4b['findOne']({'attributes':['id','name',_0x0949('0xd'),'salt','role','disabled',_0x0949('0xe'),'blockedAt',_0x0949('0xf')],'where':{'name':_0x536c1f,'role':{'$or':[_0x0949('0x10'),_0x0949('0x11'),_0x0949('0x12')]}}});})['then'](function(_0x50eceb){if(!_0x50eceb||_0x50eceb&&_0x50eceb['name']!==_0x536c1f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x23287b=_0x50eceb;return _0x23287b;}})[_0x0949('0x13')](function(){_0x23287b[_0x0949('0x14')](_0x172b81,function(_0x8d253d,_0x13ed74){var _0x352056=_0x23287b[_0x0949('0xf')]+0x1;if(_0x8d253d){return _0x2a16a3(_0x8d253d);}else if(!_0x13ed74){if(_0x23287b[_0x0949('0x15')]){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}else if(_0x3871b9['allowedLoginAttempts']>0x0){if(_0x23287b[_0x0949('0xe')]){if(_0x3871b9[_0x0949('0xc')]>0x0){if(moment(_0x23287b[_0x0949('0x17')])[_0x0949('0x18')](_0x3871b9['blockDuration'],'minutes')>moment()){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}else{return utils[_0x0949('0x19')](_0x23287b,_0x352056,![],null)[_0x0949('0x13')](function(){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});});}}else{return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}}else{if(_0x352056>=_0x3871b9[_0x0949('0xb')]){return utils[_0x0949('0x19')](_0x23287b,0x0,!![],moment())['then'](function(){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});});}else{return utils[_0x0949('0x19')](_0x23287b,_0x352056,![],null)[_0x0949('0x13')](function(){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});});}}}else{return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}}else{if(_0x23287b[_0x0949('0x15')]){return _0x2a16a3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3871b9[_0x0949('0xb')]>0x0){if(_0x23287b[_0x0949('0xe')]){if(_0x3871b9[_0x0949('0xc')]>0x0){if(moment(_0x23287b[_0x0949('0x17')])[_0x0949('0x18')](_0x3871b9[_0x0949('0xc')],_0x0949('0x1a'))>moment()){return _0x2a16a3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0949('0x19')](_0x23287b,0x0,![],null)['then'](function(){return utils[_0x0949('0x1b')](_0x23287b);})[_0x0949('0x13')](function(){return _0x2a16a3(null,_0x23287b);});}}else{return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}}else{return utils['clearBlockUser'](_0x23287b,0x0,![],null)[_0x0949('0x13')](function(){return utils[_0x0949('0x1b')](_0x23287b);})[_0x0949('0x13')](function(){return _0x2a16a3(null,_0x23287b);})[_0x0949('0x1c')](function(_0x570391){return _0x2a16a3(null,![],_0x570391);});}}else{if(_0x23287b[_0x0949('0xe')]){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}else{return utils[_0x0949('0x1b')](_0x23287b)['then'](function(){return _0x2a16a3(null,_0x23287b);});}}}});})['catch'](function(_0xcfd295){return _0x2a16a3(null,![],_0xcfd295);});}function sendServiceMail(_0x4b2bf6){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x0949('0x1d'),_0x0949('0x1e')],'include':[{'model':db[_0x0949('0x1f')],'as':_0x0949('0x20'),'include':[{'model':db[_0x0949('0x21')],'as':'CloudProvider'}]}]})[_0x0949('0x13')](function(_0x55c0b1){if(!_0x55c0b1){throw new Error(_0x0949('0x22'));}var _0x573ae9=_0x55c0b1[_0x0949('0x23')]();var _0x2e82c0={'account':_0x573ae9,'message':_['merge']({'from':util[_0x0949('0x24')](_0x0949('0x25'),_0x55c0b1[_0x0949('0x1d')],_0x55c0b1[_0x0949('0x1e')]||_0x55c0b1['Smtp'][_0x0949('0x11')])},_0x4b2bf6)};return client['request']('SendMail',_0x2e82c0);})[_0x0949('0x13')](function(_0x33cd59){if(_0x33cd59['error']){throw new Error(util[_0x0949('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x33cd59['error'][_0x0949('0x26')]||JSON[_0x0949('0x27')](_0x33cd59[_0x0949('0x28')])));}return!![];});}function handleError(_0x5973b3,_0x460546,_0x5500c2){return _0x5973b3['status'](_0x460546||0x1f4)['send']({'message':_0x5500c2?_0x5500c2[_0x0949('0x26')]||_0x5500c2:''});}exports['login']=function(_0x1082ab,_0x503d4c,_0x3b72cf){passport[_0x0949('0x14')](_0x0949('0x29'),function(_0x555a64,_0x3c53cd,_0xbd3b6e){var _0x206666=_0x555a64||_0xbd3b6e;if(_0x206666){return handleError(_0x503d4c,0x191,_0x206666);}if(!_0x3c53cd){return handleError(_0x503d4c,0x194,{'message':_0x0949('0x2a')});}else{var _0x49783b={'payload':{'id':_0x3c53cd['id'],'role':_0x3c53cd['role']},'options':{'expiresIn':0x15180}};return authService[_0x0949('0x2b')](_0x49783b)['then'](function(_0x191be2){_0x503d4c[_0x0949('0x2c')]({'id':_0x3c53cd['id'],'token':_0x191be2,'statusCall':'','isAlreadyLogged':_0x3c53cd[_0x0949('0x2d')]});});}})(_0x1082ab,_0x503d4c,_0x3b72cf);};exports[_0x0949('0x2e')]=function(_0x4d2745,_0x2e8e6e){if(!_0x4d2745[_0x0949('0x2f')][_0x0949('0x1e')]){return handleError(_0x2e8e6e,0x1f4,{'message':_0x0949('0x30')});}var _0x21c22=rs['generate']();_0x4d2745[_0x0949('0x2f')][_0x0949('0x1e')]=_0x4d2745['body'][_0x0949('0x1e')]['trim']()[_0x0949('0x31')]();var _0x26457d;return db[_0x0949('0x9')][_0x0949('0xa')]({'where':{'id':0x1},'attributes':[_0x0949('0xb'),_0x0949('0xc')],'raw':!![]})[_0x0949('0x13')](function(_0x3c9731){_0x26457d=_0x3c9731;return db[_0x0949('0x32')]['find']({'where':{'email':_0x4d2745[_0x0949('0x2f')]['email']}});})['then'](function(_0x2f1c95){if(!_0x2f1c95){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2f1c95[_0x0949('0x15')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2f1c95[_0x0949('0xe')]){if(moment(_0x2f1c95[_0x0949('0x17')])['add'](_0x26457d[_0x0949('0xc')],_0x0949('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2f1c95['blocked']=![];_0x2f1c95[_0x0949('0x17')]=null;}}_0x2f1c95[_0x0949('0x33')]=_0x21c22;_0x2f1c95[_0x0949('0x34')]=Date['now']()+0x36ee80;return _0x2f1c95[_0x0949('0x35')]();})[_0x0949('0x13')](function(){return sendServiceMail({'to':_0x4d2745[_0x0949('0x2f')][_0x0949('0x1e')],'subject':_0x0949('0x36'),'text':_0x0949('0x37')+_0x0949('0x38')+_0x0949('0x39')+_0x4d2745['headers']['host']+_0x0949('0x3a')+_0x21c22+'\x0a\x0a'+_0x0949('0x3b')});})['then'](function(){_0x2e8e6e[_0x0949('0x3c')](0xc8)[_0x0949('0x3d')]({'message':_0x0949('0x3e')});})['catch'](function(_0x47f34b){return handleError(_0x2e8e6e,0x1f4,_0x47f34b);});};exports[_0x0949('0x3f')]=function(_0x5d8341,_0x9ae32b){return db['User'][_0x0949('0x40')]({'where':{'resetPasswordToken':_0x5d8341[_0x0949('0x41')]['token'],'resetPasswordExpires':{'$gt':Date[_0x0949('0x42')]()}}})['then'](function(_0x988f91){if(!_0x988f91){throw new Error(_0x0949('0x43'));}return db[_0x0949('0x9')][_0x0949('0xa')]({'attributes':['id','securePassword',_0x0949('0x44'),'passwordHistoryLimit']})[_0x0949('0x13')](function(_0x46dbc0){if(_0x46dbc0['securePassword'])authService[_0x0949('0x45')](_0x5d8341[_0x0949('0x2f')]['password']);if(!_0x46dbc0[_0x0949('0x44')]||!_0x988f91['previousPasswords'])return _0x988f91;authService[_0x0949('0x46')](_0x5d8341[_0x0949('0x2f')][_0x0949('0xd')],_0x988f91['previousPasswords'],_0x46dbc0[_0x0949('0x47')]);return _0x988f91;})[_0x0949('0x13')](function(){_0x988f91['password']=_0x5d8341[_0x0949('0x2f')]['password'];_0x988f91[_0x0949('0x33')]=null;_0x988f91[_0x0949('0x34')]=null;return _0x988f91[_0x0949('0x35')]();});})['then'](function(){_0x9ae32b['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0x0949('0x1c')](function(_0x492b66){return handleError(_0x9ae32b,0x1f4,_0x492b66);});};passport[_0x0949('0x48')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x0949('0xd')},function(_0x22c33f,_0x5ec3e9,_0x216931){return localAuthenticate(db['User'],_0x22c33f,_0x5ec3e9,_0x216931);})); \ No newline at end of file +var _0x44b0=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','merge','format','\x22%s\x22\x20<%s>','SendMail'];(function(_0xdb8e6c,_0x15df30){var _0x12c7e9=function(_0x2ae495){while(--_0x2ae495){_0xdb8e6c['push'](_0xdb8e6c['shift']());}};_0x12c7e9(++_0x15df30);}(_0x44b0,0x120));var _0x044b=function(_0x58403c,_0x45d162){_0x58403c=_0x58403c-0x0;var _0x117a7e=_0x44b0[_0x58403c];return _0x117a7e;};'use strict';var util=require(_0x044b('0x0'));var passport=require(_0x044b('0x1'));var LocalStrategy=require('passport-local')[_0x044b('0x2')];var jayson=require(_0x044b('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x044b('0x4'));var db=require(_0x044b('0x5'))['db'];var authService=require(_0x044b('0x6'));var utils=require(_0x044b('0x7'));var client=jayson[_0x044b('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x1242bb,_0x1ae22b,_0x1c960a,_0x7d0105){var _0x2ca4d3,_0x3f5c63;return db[_0x044b('0x9')][_0x044b('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x044b('0xb')],'raw':!![]})[_0x044b('0xc')](function(_0x9e2ddd){_0x2ca4d3=_0x9e2ddd;return _0x1242bb[_0x044b('0xa')]({'attributes':['id',_0x044b('0xd'),_0x044b('0xe'),_0x044b('0xf'),_0x044b('0x10'),_0x044b('0x11'),'blocked',_0x044b('0x12'),_0x044b('0x13')],'where':{'name':_0x1ae22b,'role':{'$or':[_0x044b('0x14'),_0x044b('0x15'),'agent']}}});})[_0x044b('0xc')](function(_0x4fbe79){if(!_0x4fbe79||_0x4fbe79&&_0x4fbe79[_0x044b('0xd')]!==_0x1ae22b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3f5c63=_0x4fbe79;return _0x3f5c63;}})[_0x044b('0xc')](function(){_0x3f5c63[_0x044b('0x16')](_0x1c960a,function(_0x17eea1,_0xc8c131){var _0x55e853=_0x3f5c63[_0x044b('0x13')]+0x1;if(_0x17eea1){return _0x7d0105(_0x17eea1);}else if(!_0xc8c131){if(_0x3f5c63['disabled']){return _0x7d0105(null,![],{'message':_0x044b('0x17')});}else if(_0x2ca4d3[_0x044b('0x18')]>0x0){if(_0x3f5c63['blocked']){if(_0x2ca4d3['blockDuration']>0x0){if(moment(_0x3f5c63[_0x044b('0x12')])[_0x044b('0x19')](_0x2ca4d3['blockDuration'],_0x044b('0x1a'))>moment()){return _0x7d0105(null,![],{'message':_0x044b('0x17')});}else{return utils['clearBlockUser'](_0x3f5c63,_0x55e853,![],null)[_0x044b('0xc')](function(){return _0x7d0105(null,![],{'message':_0x044b('0x17')});});}}else{return _0x7d0105(null,![],{'message':_0x044b('0x17')});}}else{if(_0x55e853>=_0x2ca4d3[_0x044b('0x18')]){return utils[_0x044b('0x1b')](_0x3f5c63,0x0,!![],moment())[_0x044b('0xc')](function(){return _0x7d0105(null,![],{'message':_0x044b('0x17')});});}else{return utils[_0x044b('0x1b')](_0x3f5c63,_0x55e853,![],null)[_0x044b('0xc')](function(){return _0x7d0105(null,![],{'message':_0x044b('0x17')});});}}}else{return _0x7d0105(null,![],{'message':_0x044b('0x17')});}}else{if(_0x3f5c63[_0x044b('0x11')]){return _0x7d0105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2ca4d3[_0x044b('0x18')]>0x0){if(_0x3f5c63[_0x044b('0x1c')]){if(_0x2ca4d3[_0x044b('0xb')]>0x0){if(moment(_0x3f5c63[_0x044b('0x12')])[_0x044b('0x19')](_0x2ca4d3['blockDuration'],_0x044b('0x1a'))>moment()){return _0x7d0105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3f5c63,0x0,![],null)[_0x044b('0xc')](function(){return utils['getLicense'](_0x3f5c63);})[_0x044b('0xc')](function(){return _0x7d0105(null,_0x3f5c63);});}}else{return _0x7d0105(null,![],{'message':_0x044b('0x17')});}}else{return utils[_0x044b('0x1b')](_0x3f5c63,0x0,![],null)['then'](function(){return utils[_0x044b('0x1d')](_0x3f5c63);})[_0x044b('0xc')](function(){return _0x7d0105(null,_0x3f5c63);})[_0x044b('0x1e')](function(_0xcc00ba){return _0x7d0105(null,![],_0xcc00ba);});}}else{if(_0x3f5c63[_0x044b('0x1c')]){return _0x7d0105(null,![],{'message':_0x044b('0x17')});}else{return utils[_0x044b('0x1d')](_0x3f5c63)[_0x044b('0xc')](function(){return _0x7d0105(null,_0x3f5c63);});}}}});})[_0x044b('0x1e')](function(_0x142b1b){return _0x7d0105(null,![],_0x142b1b);});}function sendServiceMail(_0x4b576f){return db[_0x044b('0x1f')][_0x044b('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x044b('0x21')],'include':[{'model':db[_0x044b('0x22')],'as':'Smtp','include':[{'model':db[_0x044b('0x23')],'as':'CloudProvider'}]}]})[_0x044b('0xc')](function(_0x33618d){if(!_0x33618d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3d7f6f=_0x33618d['getSmtpOptions']();var _0x24b358={'account':_0x3d7f6f,'message':_[_0x044b('0x24')]({'from':util[_0x044b('0x25')](_0x044b('0x26'),_0x33618d[_0x044b('0xd')],_0x33618d[_0x044b('0x21')]||_0x33618d['Smtp']['user'])},_0x4b576f)};return client['request'](_0x044b('0x27'),_0x24b358);})[_0x044b('0xc')](function(_0x5b2954){if(_0x5b2954[_0x044b('0x28')]){throw new Error(util[_0x044b('0x25')](_0x044b('0x29'),_0x5b2954[_0x044b('0x28')]['message']||JSON[_0x044b('0x2a')](_0x5b2954[_0x044b('0x28')])));}return!![];});}function handleError(_0x12bcc5,_0x17d17a,_0x5bb150){return _0x12bcc5[_0x044b('0x2b')](_0x17d17a||0x1f4)[_0x044b('0x2c')]({'message':_0x5bb150?_0x5bb150[_0x044b('0x2d')]||_0x5bb150:''});}exports[_0x044b('0x2e')]=function(_0x1e4bf6,_0x89bfb3,_0x9d5e5f){passport[_0x044b('0x16')](_0x044b('0x2f'),function(_0x5e9d53,_0x19e279,_0x333a2e){var _0x357501=_0x5e9d53||_0x333a2e;if(_0x357501){return handleError(_0x89bfb3,0x191,_0x357501);}if(!_0x19e279){return handleError(_0x89bfb3,0x194,{'message':_0x044b('0x30')});}else{var _0x1b7592={'payload':{'id':_0x19e279['id'],'role':_0x19e279[_0x044b('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x044b('0x31')](_0x1b7592)[_0x044b('0xc')](function(_0x30ca9e){_0x89bfb3[_0x044b('0x32')]({'id':_0x19e279['id'],'token':_0x30ca9e,'statusCall':'','isAlreadyLogged':_0x19e279[_0x044b('0x33')]});});}})(_0x1e4bf6,_0x89bfb3,_0x9d5e5f);};exports[_0x044b('0x34')]=function(_0x122cc7,_0x352ed9){if(!_0x122cc7[_0x044b('0x35')]['email']){return handleError(_0x352ed9,0x1f4,{'message':_0x044b('0x36')});}var _0x413c4a=rs['generate']();_0x122cc7['body'][_0x044b('0x21')]=_0x122cc7[_0x044b('0x35')]['email'][_0x044b('0x37')]()[_0x044b('0x38')]();var _0xd9522c;return db[_0x044b('0x9')][_0x044b('0xa')]({'where':{'id':0x1},'attributes':[_0x044b('0x18'),_0x044b('0xb')],'raw':!![]})[_0x044b('0xc')](function(_0x104cf0){_0xd9522c=_0x104cf0;return db[_0x044b('0x39')]['find']({'where':{'email':_0x122cc7['body'][_0x044b('0x21')]}});})['then'](function(_0x30a5a1){if(!_0x30a5a1){throw new Error(_0x044b('0x3a'));}if(_0x30a5a1[_0x044b('0x11')]){throw new Error(_0x044b('0x3b'));}if(_0x30a5a1[_0x044b('0x1c')]){if(moment(_0x30a5a1[_0x044b('0x12')])[_0x044b('0x19')](_0xd9522c[_0x044b('0xb')],_0x044b('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x30a5a1['blocked']=![];_0x30a5a1[_0x044b('0x12')]=null;}}_0x30a5a1[_0x044b('0x3c')]=_0x413c4a;_0x30a5a1[_0x044b('0x3d')]=Date[_0x044b('0x3e')]()+0x36ee80;return _0x30a5a1[_0x044b('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x122cc7[_0x044b('0x35')][_0x044b('0x21')],'subject':_0x044b('0x40'),'text':_0x044b('0x41')+_0x044b('0x42')+_0x044b('0x43')+_0x122cc7[_0x044b('0x44')][_0x044b('0x45')]+_0x044b('0x46')+_0x413c4a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x044b('0xc')](function(){_0x352ed9[_0x044b('0x2b')](0xc8)[_0x044b('0x2c')]({'message':_0x044b('0x47')});})[_0x044b('0x1e')](function(_0x53aa05){return handleError(_0x352ed9,0x1f4,_0x53aa05);});};exports['reset']=function(_0x564198,_0x35a52f){return db['User'][_0x044b('0x20')]({'where':{'resetPasswordToken':_0x564198['params'][_0x044b('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x044b('0xc')](function(_0x37a79b){if(!_0x37a79b){throw new Error(_0x044b('0x49'));}return db[_0x044b('0x9')][_0x044b('0xa')]({'attributes':['id','securePassword',_0x044b('0x4a'),_0x044b('0x4b')]})[_0x044b('0xc')](function(_0x354905){if(_0x354905[_0x044b('0x4c')])authService[_0x044b('0x4d')](_0x564198[_0x044b('0x35')][_0x044b('0xe')]);if(!_0x354905[_0x044b('0x4a')]||!_0x37a79b[_0x044b('0x4e')])return _0x37a79b;authService[_0x044b('0x4f')](_0x564198[_0x044b('0x35')]['password'],_0x37a79b[_0x044b('0x4e')],_0x354905[_0x044b('0x4b')]);return _0x37a79b;})[_0x044b('0xc')](function(){_0x37a79b[_0x044b('0xe')]=_0x564198[_0x044b('0x35')][_0x044b('0xe')];_0x37a79b[_0x044b('0x3c')]=null;_0x37a79b['resetPasswordExpires']=null;return _0x37a79b[_0x044b('0x3f')]();});})[_0x044b('0xc')](function(){_0x35a52f[_0x044b('0x2b')](0xc8)[_0x044b('0x2c')]({'message':_0x044b('0x50')});})[_0x044b('0x1e')](function(_0x49d8a4){return handleError(_0x35a52f,0x1f4,_0x49d8a4);});};passport[_0x044b('0x51')](_0x044b('0x2f'),new LocalStrategy({'usernameField':_0x044b('0xd'),'passwordField':_0x044b('0xe')},function(_0x509c7e,_0x48162f,_0x26a25b){return localAuthenticate(db[_0x044b('0x39')],_0x509c7e,_0x48162f,_0x26a25b);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 2642587..966c080 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 _0x2bd2=['post','login','forgot','reset','express','./authLocal.controller'];(function(_0x25dd41,_0xf30601){var _0x1e8624=function(_0x49f111){while(--_0x49f111){_0x25dd41['push'](_0x25dd41['shift']());}};_0x1e8624(++_0xf30601);}(_0x2bd2,0x19c));var _0x22bd=function(_0x37463a,_0x496ccb){_0x37463a=_0x37463a-0x0;var _0x356f55=_0x2bd2[_0x37463a];return _0x356f55;};'use strict';var express=require(_0x22bd('0x0'));var router=express['Router']();var controller=require(_0x22bd('0x1'));router[_0x22bd('0x2')]('/',controller[_0x22bd('0x3')]);router[_0x22bd('0x2')]('/forgot',controller[_0x22bd('0x4')]);router[_0x22bd('0x2')]('/reset/:token',controller[_0x22bd('0x5')]);module['exports']=router; \ No newline at end of file +var _0x38bc=['exports','express','Router','./authLocal.controller','login','post','/forgot','/reset/:token','reset'];(function(_0x3e41c0,_0x592a69){var _0x3e2903=function(_0xc2db0b){while(--_0xc2db0b){_0x3e41c0['push'](_0x3e41c0['shift']());}};_0x3e2903(++_0x592a69);}(_0x38bc,0x1c3));var _0xc38b=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x38bc[_0x4d613c];return _0x301fe3;};'use strict';var express=require(_0xc38b('0x0'));var router=express[_0xc38b('0x1')]();var controller=require(_0xc38b('0x2'));router['post']('/',controller[_0xc38b('0x3')]);router[_0xc38b('0x4')](_0xc38b('0x5'),controller['forgot']);router['post'](_0xc38b('0x6'),controller[_0xc38b('0x7')]);module[_0xc38b('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 04ef6c6..342d543 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 _0x79a5=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x2f48c8,_0x29cf4e){var _0x381dd0=function(_0xd0b14){while(--_0xd0b14){_0x2f48c8['push'](_0x2f48c8['shift']());}};_0x381dd0(++_0x29cf4e);}(_0x79a5,0x1d8));var _0x579a=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x79a5[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0x579a('0x0'));module[_0x579a('0x1')]={'name':{'type':Sequelize[_0x579a('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x579a('0x2')]},'status':{'type':Sequelize[_0x579a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x579a('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xedbd=['sequelize','STRING'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xedbd,0x162));var _0xdedb=function(_0x182812,_0x564202){_0x182812=_0x182812-0x0;var _0x182927=_0xedbd[_0x182812];return _0x182927;};'use strict';var Sequelize=require(_0xdedb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdedb('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xdedb('0x1')]},'description':{'type':Sequelize[_0xdedb('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 2a1ebfb..0b4e65e 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 _0x73b6=['body','find','catch','addConditions','ids','omit','getConditions','filter','addActions','Action','findOne','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','Automation','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','options','includeAll','include','findAll','rows','show','params','create'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x73b6,0xff));var _0x673b=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x73b6[_0x521929];return _0x632436;};'use strict';var emlformat=require(_0x673b('0x0'));var rimraf=require(_0x673b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x673b('0x2'));var rp=require(_0x673b('0x3'));var moment=require(_0x673b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x673b('0x5'));var util=require(_0x673b('0x6'));var path=require(_0x673b('0x7'));var sox=require('sox');var csv=require(_0x673b('0x8'));var ejs=require(_0x673b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x673b('0xa'));var jsforce=require(_0x673b('0xb'));var deskjs=require(_0x673b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x673b('0xd'));var Papa=require(_0x673b('0xe'));var Redis=require(_0x673b('0xf'));var authService=require(_0x673b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x673b('0x11'));var hardwareService=require(_0x673b('0x12'));var logger=require(_0x673b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x673b('0x14'));var licenseUtil=require(_0x673b('0x15'));var db=require(_0x673b('0x16'))['db'];function respondWithStatusCode(_0x45fa37,_0x725d10){_0x725d10=_0x725d10||0xcc;return function(_0x21598a){if(_0x21598a){return _0x45fa37[_0x673b('0x17')](_0x725d10);}return _0x45fa37[_0x673b('0x18')](_0x725d10)['end']();};}function respondWithResult(_0x12223c,_0x3cb10e){_0x3cb10e=_0x3cb10e||0xc8;return function(_0x4a6361){if(_0x4a6361){return _0x12223c[_0x673b('0x18')](_0x3cb10e)[_0x673b('0x19')](_0x4a6361);}};}function respondWithFilteredResult(_0x1af309,_0x40615a){return function(_0x141b7d){if(_0x141b7d){var _0x4e34ba=typeof _0x40615a[_0x673b('0x1a')]===_0x673b('0x1b')&&typeof _0x40615a[_0x673b('0x1c')]===_0x673b('0x1b');var _0x28b627=_0x141b7d[_0x673b('0x1d')];var _0x457c50=_0x4e34ba?0x0:_0x40615a[_0x673b('0x1a')];var _0x28ee67=_0x4e34ba?_0x141b7d['count']:_0x40615a[_0x673b('0x1a')]+_0x40615a[_0x673b('0x1c')];var _0x20c6a8;if(_0x28ee67>=_0x28b627){_0x28ee67=_0x28b627;_0x20c6a8=0xc8;}else{_0x20c6a8=0xce;}_0x1af309[_0x673b('0x18')](_0x20c6a8);return _0x1af309['set'](_0x673b('0x1e'),_0x457c50+'-'+_0x28ee67+'/'+_0x28b627)[_0x673b('0x19')](_0x141b7d);}return null;};}function patchUpdates(_0x2c5a35){return function(_0x487333){try{jsonpatch[_0x673b('0x1f')](_0x487333,_0x2c5a35,!![]);}catch(_0x2b5f71){return BPromise[_0x673b('0x20')](_0x2b5f71);}return _0x487333[_0x673b('0x21')]();};}function saveUpdates(_0x20a6a4,_0x1049fd){return function(_0x2870f2){if(_0x2870f2){return _0x2870f2[_0x673b('0x22')](_0x20a6a4)['then'](function(_0x388cd3){return _0x388cd3;});}return null;};}function removeEntity(_0x5f0e00,_0xf287c5){return function(_0xf06416){if(_0xf06416){return _0xf06416[_0x673b('0x23')]()[_0x673b('0x24')](function(){_0x5f0e00[_0x673b('0x18')](0xcc)[_0x673b('0x25')]();});}};}function handleEntityNotFound(_0x397dca,_0x266224){return function(_0x2e83c7){if(!_0x2e83c7){_0x397dca[_0x673b('0x17')](0x194);}return _0x2e83c7;};}function handleError(_0x49c35b,_0x47c033){_0x47c033=_0x47c033||0x1f4;return function(_0x32597b){logger[_0x673b('0x26')](_0x32597b[_0x673b('0x27')]);if(_0x32597b[_0x673b('0x28')]){delete _0x32597b['name'];}_0x49c35b['status'](_0x47c033)[_0x673b('0x29')](_0x32597b);};}exports['index']=function(_0x33cd7f,_0xb01dde){var _0x4b3f84={},_0x9149ea={},_0x250950={'count':0x0,'rows':[]};var _0x329bdc=_[_0x673b('0x2a')](db[_0x673b('0x2b')][_0x673b('0x2c')],function(_0x594fb3){return{'name':_0x594fb3['fieldName'],'type':_0x594fb3[_0x673b('0x2d')]['key']};});_0x9149ea[_0x673b('0x2e')]=_['map'](_0x329bdc,_0x673b('0x28'));_0x9149ea[_0x673b('0x2f')]=_[_0x673b('0x30')](_0x33cd7f[_0x673b('0x2f')]);_0x9149ea['filters']=_[_0x673b('0x31')](_0x9149ea[_0x673b('0x2e')],_0x9149ea['query']);_0x4b3f84[_0x673b('0x32')]=_['intersection'](_0x9149ea[_0x673b('0x2e')],qs[_0x673b('0x33')](_0x33cd7f[_0x673b('0x2f')][_0x673b('0x33')]));_0x4b3f84[_0x673b('0x32')]=_0x4b3f84['attributes'][_0x673b('0x34')]?_0x4b3f84[_0x673b('0x32')]:_0x9149ea[_0x673b('0x2e')];if(!_0x33cd7f[_0x673b('0x2f')][_0x673b('0x35')](_0x673b('0x36'))){_0x4b3f84[_0x673b('0x1c')]=qs[_0x673b('0x1c')](_0x33cd7f[_0x673b('0x2f')]['limit']);_0x4b3f84[_0x673b('0x1a')]=qs['offset'](_0x33cd7f[_0x673b('0x2f')][_0x673b('0x1a')]);}_0x4b3f84[_0x673b('0x37')]=qs['sort'](_0x33cd7f['query'][_0x673b('0x38')]);_0x4b3f84['where']=qs[_0x673b('0x39')](_[_0x673b('0x3a')](_0x33cd7f['query'],_0x9149ea[_0x673b('0x39')]),_0x329bdc);if(_0x33cd7f[_0x673b('0x2f')]['filter']){_0x4b3f84[_0x673b('0x3b')]=_[_0x673b('0x3c')](_0x4b3f84['where'],{'$or':_[_0x673b('0x2a')](_0x329bdc,function(_0x3c785c){if(_0x3c785c[_0x673b('0x2d')]!=='VIRTUAL'){var _0x392935={};_0x392935[_0x3c785c[_0x673b('0x28')]]={'$like':'%'+_0x33cd7f[_0x673b('0x2f')]['filter']+'%'};return _0x392935;}})});}_0x4b3f84=_[_0x673b('0x3c')]({},_0x4b3f84,_0x33cd7f[_0x673b('0x3d')]);var _0xd91ca5={'where':_0x4b3f84[_0x673b('0x3b')]};return db[_0x673b('0x2b')][_0x673b('0x1d')](_0xd91ca5)[_0x673b('0x24')](function(_0x59f1be){_0x250950[_0x673b('0x1d')]=_0x59f1be;if(_0x33cd7f[_0x673b('0x2f')][_0x673b('0x3e')]){_0x4b3f84[_0x673b('0x3f')]=[{'all':!![]}];}return db[_0x673b('0x2b')][_0x673b('0x40')](_0x4b3f84);})['then'](function(_0x3a0da3){_0x250950[_0x673b('0x41')]=_0x3a0da3;return _0x250950;})[_0x673b('0x24')](respondWithFilteredResult(_0xb01dde,_0x4b3f84))['catch'](handleError(_0xb01dde,null));};exports[_0x673b('0x42')]=function(_0x44acf2,_0x22b4ed){var _0xbaa317={'raw':![],'where':{'id':_0x44acf2[_0x673b('0x43')]['id']}},_0x5b173e={};_0x5b173e[_0x673b('0x2e')]=_[_0x673b('0x30')](db[_0x673b('0x2b')][_0x673b('0x2c')]);_0x5b173e['query']=_[_0x673b('0x30')](_0x44acf2[_0x673b('0x2f')]);_0x5b173e['filters']=_[_0x673b('0x31')](_0x5b173e[_0x673b('0x2e')],_0x5b173e['query']);_0xbaa317['attributes']=_[_0x673b('0x31')](_0x5b173e['model'],qs[_0x673b('0x33')](_0x44acf2[_0x673b('0x2f')][_0x673b('0x33')]));_0xbaa317[_0x673b('0x32')]=_0xbaa317[_0x673b('0x32')][_0x673b('0x34')]?_0xbaa317[_0x673b('0x32')]:_0x5b173e[_0x673b('0x2e')];if(_0x44acf2[_0x673b('0x2f')][_0x673b('0x3e')]){_0xbaa317[_0x673b('0x3f')]=[{'all':!![]}];}_0xbaa317=_[_0x673b('0x3c')]({},_0xbaa317,_0x44acf2[_0x673b('0x3d')]);return db['Automation']['find'](_0xbaa317)[_0x673b('0x24')](handleEntityNotFound(_0x22b4ed,null))['then'](respondWithResult(_0x22b4ed,null))['catch'](handleError(_0x22b4ed,null));};exports[_0x673b('0x44')]=function(_0x587da2,_0x2a66ae){return db[_0x673b('0x2b')]['create'](_0x587da2['body'],{})[_0x673b('0x24')](respondWithResult(_0x2a66ae,0xc9))['catch'](handleError(_0x2a66ae,null));};exports['update']=function(_0x2cdfb0,_0x53bd1c){if(_0x2cdfb0[_0x673b('0x45')]['id']){delete _0x2cdfb0[_0x673b('0x45')]['id'];}return db[_0x673b('0x2b')][_0x673b('0x46')]({'where':{'id':_0x2cdfb0['params']['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x53bd1c,null))[_0x673b('0x24')](saveUpdates(_0x2cdfb0[_0x673b('0x45')],null))[_0x673b('0x24')](respondWithResult(_0x53bd1c,null))[_0x673b('0x47')](handleError(_0x53bd1c,null));};exports['destroy']=function(_0x1dcfaf,_0x2e1afe){return db['Automation'][_0x673b('0x46')]({'where':{'id':_0x1dcfaf[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x2e1afe,null))[_0x673b('0x24')](removeEntity(_0x2e1afe,null))[_0x673b('0x47')](handleError(_0x2e1afe,null));};exports[_0x673b('0x48')]=function(_0xe384d8,_0x393eae,_0x3e7256){return db['Condition'][_0x673b('0x46')]({'where':{'id':_0xe384d8['params']['id']}})['then'](handleEntityNotFound(_0x393eae,null))[_0x673b('0x24')](function(_0x27d83d){if(_0x27d83d){return _0x27d83d[_0x673b('0x48')](_0xe384d8[_0x673b('0x45')][_0x673b('0x49')],_[_0x673b('0x4a')](_0xe384d8[_0x673b('0x45')],[_0x673b('0x49'),'id'])||{});}})[_0x673b('0x24')](respondWithResult(_0x393eae,null))['catch'](handleError(_0x393eae,null));};exports[_0x673b('0x4b')]=function(_0x3bdfb5,_0x45f6dc,_0x7b2214){var _0x21db97={};var _0x4f48ad={};var _0x2d6aab;var _0x1945c4;return db['Automation']['findOne']({'where':{'id':_0x3bdfb5[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x45f6dc,null))[_0x673b('0x24')](function(_0xa68100){if(_0xa68100){_0x2d6aab=_0xa68100;_0x4f48ad['model']=_[_0x673b('0x30')](db['Condition'][_0x673b('0x2c')]);_0x4f48ad[_0x673b('0x2f')]=_[_0x673b('0x30')](_0x3bdfb5['query']);_0x4f48ad[_0x673b('0x39')]=_[_0x673b('0x31')](_0x4f48ad[_0x673b('0x2e')],_0x4f48ad[_0x673b('0x2f')]);_0x21db97['attributes']=_[_0x673b('0x31')](_0x4f48ad[_0x673b('0x2e')],qs[_0x673b('0x33')](_0x3bdfb5['query'][_0x673b('0x33')]));_0x21db97[_0x673b('0x32')]=_0x21db97[_0x673b('0x32')][_0x673b('0x34')]?_0x21db97['attributes']:_0x4f48ad[_0x673b('0x2e')];_0x21db97['order']=qs[_0x673b('0x38')](_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x38')]);_0x21db97[_0x673b('0x3b')]=qs[_0x673b('0x39')](_[_0x673b('0x3a')](_0x3bdfb5[_0x673b('0x2f')],_0x4f48ad[_0x673b('0x39')]));if(_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x4c')]){_0x21db97['where']=_[_0x673b('0x3c')](_0x21db97[_0x673b('0x3b')],{'$or':_[_0x673b('0x2a')](_0x21db97[_0x673b('0x32')],function(_0x51f6a7){var _0x4ee45e={};_0x4ee45e[_0x51f6a7]={'$like':'%'+_0x3bdfb5[_0x673b('0x2f')]['filter']+'%'};return _0x4ee45e;})});}_0x21db97=_[_0x673b('0x3c')]({},_0x21db97,_0x3bdfb5[_0x673b('0x3d')]);return _0x2d6aab['getConditions'](_0x21db97);}})['then'](function(_0xb3812d){if(_0xb3812d){_0x1945c4=_0xb3812d[_0x673b('0x34')];if(!_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x35')](_0x673b('0x36'))){_0x21db97[_0x673b('0x1c')]=qs[_0x673b('0x1c')](_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x1c')]);_0x21db97['offset']=qs[_0x673b('0x1a')](_0x3bdfb5[_0x673b('0x2f')]['offset']);}return _0x2d6aab[_0x673b('0x4b')](_0x21db97);}})['then'](function(_0x248388){if(_0x248388){return _0x248388?{'count':_0x1945c4,'rows':_0x248388}:null;}})[_0x673b('0x24')](respondWithResult(_0x45f6dc,null))['catch'](handleError(_0x45f6dc,null));};exports[_0x673b('0x4d')]=function(_0x568ba7,_0x382770,_0x1e4889){return db[_0x673b('0x4e')][_0x673b('0x46')]({'where':{'id':_0x568ba7[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x382770,null))[_0x673b('0x24')](function(_0x1b396c){if(_0x1b396c){return _0x1b396c[_0x673b('0x4d')](_0x568ba7[_0x673b('0x45')][_0x673b('0x49')],_['omit'](_0x568ba7['body'],[_0x673b('0x49'),'id'])||{});}})[_0x673b('0x24')](respondWithResult(_0x382770,null))[_0x673b('0x47')](handleError(_0x382770,null));};exports['getActions']=function(_0x17ae97,_0xc42b37,_0xfb2b1a){var _0x16046e={};var _0x5161b3={};var _0x275b8c;var _0xf6b9;return db[_0x673b('0x2b')][_0x673b('0x4f')]({'where':{'id':_0x17ae97[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0xc42b37,null))['then'](function(_0x2060b6){if(_0x2060b6){_0x275b8c=_0x2060b6;_0x5161b3[_0x673b('0x2e')]=_[_0x673b('0x30')](db[_0x673b('0x4e')][_0x673b('0x2c')]);_0x5161b3[_0x673b('0x2f')]=_[_0x673b('0x30')](_0x17ae97['query']);_0x5161b3[_0x673b('0x39')]=_[_0x673b('0x31')](_0x5161b3[_0x673b('0x2e')],_0x5161b3[_0x673b('0x2f')]);_0x16046e[_0x673b('0x32')]=_['intersection'](_0x5161b3[_0x673b('0x2e')],qs[_0x673b('0x33')](_0x17ae97['query'][_0x673b('0x33')]));_0x16046e[_0x673b('0x32')]=_0x16046e[_0x673b('0x32')][_0x673b('0x34')]?_0x16046e[_0x673b('0x32')]:_0x5161b3['model'];_0x16046e[_0x673b('0x37')]=qs['sort'](_0x17ae97['query'][_0x673b('0x38')]);_0x16046e[_0x673b('0x3b')]=qs[_0x673b('0x39')](_[_0x673b('0x3a')](_0x17ae97[_0x673b('0x2f')],_0x5161b3[_0x673b('0x39')]));if(_0x17ae97[_0x673b('0x2f')]['filter']){_0x16046e[_0x673b('0x3b')]=_[_0x673b('0x3c')](_0x16046e['where'],{'$or':_[_0x673b('0x2a')](_0x16046e['attributes'],function(_0x1ac4b6){var _0x1a2950={};_0x1a2950[_0x1ac4b6]={'$like':'%'+_0x17ae97[_0x673b('0x2f')][_0x673b('0x4c')]+'%'};return _0x1a2950;})});}_0x16046e=_['merge']({},_0x16046e,_0x17ae97['options']);return _0x275b8c['getActions'](_0x16046e);}})[_0x673b('0x24')](function(_0xafc84b){if(_0xafc84b){_0xf6b9=_0xafc84b[_0x673b('0x34')];if(!_0x17ae97[_0x673b('0x2f')][_0x673b('0x35')](_0x673b('0x36'))){_0x16046e[_0x673b('0x1c')]=qs[_0x673b('0x1c')](_0x17ae97[_0x673b('0x2f')][_0x673b('0x1c')]);_0x16046e[_0x673b('0x1a')]=qs[_0x673b('0x1a')](_0x17ae97[_0x673b('0x2f')][_0x673b('0x1a')]);}return _0x275b8c[_0x673b('0x50')](_0x16046e);}})[_0x673b('0x24')](function(_0x152308){if(_0x152308){return _0x152308?{'count':_0xf6b9,'rows':_0x152308}:null;}})[_0x673b('0x24')](respondWithResult(_0xc42b37,null))['catch'](handleError(_0xc42b37,null));}; \ No newline at end of file +var _0x3f7b=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','addConditions','omit','ids','findOne','Condition','length','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x5773b4,_0x460374){var _0x5a8181=function(_0x2bd576){while(--_0x2bd576){_0x5773b4['push'](_0x5773b4['shift']());}};_0x5a8181(++_0x460374);}(_0x3f7b,0x117));var _0xb3f7=function(_0x2211d4,_0x592254){_0x2211d4=_0x2211d4-0x0;var _0x565b56=_0x3f7b[_0x2211d4];return _0x565b56;};'use strict';var emlformat=require(_0xb3f7('0x0'));var rimraf=require(_0xb3f7('0x1'));var zipdir=require(_0xb3f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb3f7('0x4'));var util=require(_0xb3f7('0x5'));var path=require('path');var sox=require(_0xb3f7('0x6'));var csv=require('to-csv');var ejs=require(_0xb3f7('0x7'));var fs=require('fs');var fs_extra=require(_0xb3f7('0x8'));var _=require(_0xb3f7('0x9'));var squel=require(_0xb3f7('0xa'));var crypto=require(_0xb3f7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb3f7('0xc'));var toCsv=require(_0xb3f7('0xd'));var querystring=require(_0xb3f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xb3f7('0xf'));var authService=require(_0xb3f7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb3f7('0x11'));var hardwareService=require(_0xb3f7('0x12'));var logger=require(_0xb3f7('0x13'))(_0xb3f7('0x14'));var utils=require('../../config/utils');var config=require(_0xb3f7('0x15'));var licenseUtil=require(_0xb3f7('0x16'));var db=require(_0xb3f7('0x17'))['db'];function respondWithStatusCode(_0x587205,_0x435b93){_0x435b93=_0x435b93||0xcc;return function(_0x3ee2b3){if(_0x3ee2b3){return _0x587205[_0xb3f7('0x18')](_0x435b93);}return _0x587205[_0xb3f7('0x19')](_0x435b93)[_0xb3f7('0x1a')]();};}function respondWithResult(_0x5a3a3f,_0x129749){_0x129749=_0x129749||0xc8;return function(_0xcf28c4){if(_0xcf28c4){return _0x5a3a3f['status'](_0x129749)[_0xb3f7('0x1b')](_0xcf28c4);}};}function respondWithFilteredResult(_0x543573,_0x317bdd){return function(_0x12e1d2){if(_0x12e1d2){var _0x19dadd=typeof _0x317bdd[_0xb3f7('0x1c')]===_0xb3f7('0x1d')&&typeof _0x317bdd[_0xb3f7('0x1e')]===_0xb3f7('0x1d');var _0xcf97f7=_0x12e1d2[_0xb3f7('0x1f')];var _0x3dfeb7=_0x19dadd?0x0:_0x317bdd[_0xb3f7('0x1c')];var _0x5ba469=_0x19dadd?_0x12e1d2[_0xb3f7('0x1f')]:_0x317bdd[_0xb3f7('0x1c')]+_0x317bdd[_0xb3f7('0x1e')];var _0x370ac2;if(_0x5ba469>=_0xcf97f7){_0x5ba469=_0xcf97f7;_0x370ac2=0xc8;}else{_0x370ac2=0xce;}_0x543573[_0xb3f7('0x19')](_0x370ac2);return _0x543573[_0xb3f7('0x20')]('Content-Range',_0x3dfeb7+'-'+_0x5ba469+'/'+_0xcf97f7)[_0xb3f7('0x1b')](_0x12e1d2);}return null;};}function patchUpdates(_0x1d44a2){return function(_0xc5f1f1){try{jsonpatch[_0xb3f7('0x21')](_0xc5f1f1,_0x1d44a2,!![]);}catch(_0x2699ca){return BPromise['reject'](_0x2699ca);}return _0xc5f1f1['save']();};}function saveUpdates(_0x2daf74,_0x1a270d){return function(_0x389329){if(_0x389329){return _0x389329[_0xb3f7('0x22')](_0x2daf74)[_0xb3f7('0x23')](function(_0x13549c){return _0x13549c;});}return null;};}function removeEntity(_0x4e8de9,_0x2b3d7a){return function(_0x49f3f0){if(_0x49f3f0){return _0x49f3f0[_0xb3f7('0x24')]()['then'](function(){_0x4e8de9['status'](0xcc)[_0xb3f7('0x1a')]();});}};}function handleEntityNotFound(_0x80b12b,_0x79a3b2){return function(_0x32e4d4){if(!_0x32e4d4){_0x80b12b[_0xb3f7('0x18')](0x194);}return _0x32e4d4;};}function handleError(_0x4adbfe,_0x3b9698){_0x3b9698=_0x3b9698||0x1f4;return function(_0x4f48bb){logger[_0xb3f7('0x25')](_0x4f48bb[_0xb3f7('0x26')]);if(_0x4f48bb[_0xb3f7('0x27')]){delete _0x4f48bb[_0xb3f7('0x27')];}_0x4adbfe['status'](_0x3b9698)[_0xb3f7('0x28')](_0x4f48bb);};}exports[_0xb3f7('0x29')]=function(_0x2a0d38,_0x17755d){var _0x3a6b68={},_0x5a2566={},_0x38d823={'count':0x0,'rows':[]};var _0x243a02=_[_0xb3f7('0x2a')](db[_0xb3f7('0x2b')][_0xb3f7('0x2c')],function(_0xe04496){return{'name':_0xe04496[_0xb3f7('0x2d')],'type':_0xe04496[_0xb3f7('0x2e')][_0xb3f7('0x2f')]};});_0x5a2566[_0xb3f7('0x30')]=_[_0xb3f7('0x2a')](_0x243a02,_0xb3f7('0x27'));_0x5a2566[_0xb3f7('0x31')]=_['keys'](_0x2a0d38[_0xb3f7('0x31')]);_0x5a2566[_0xb3f7('0x32')]=_[_0xb3f7('0x33')](_0x5a2566[_0xb3f7('0x30')],_0x5a2566[_0xb3f7('0x31')]);_0x3a6b68[_0xb3f7('0x34')]=_[_0xb3f7('0x33')](_0x5a2566[_0xb3f7('0x30')],qs['fields'](_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x35')]));_0x3a6b68[_0xb3f7('0x34')]=_0x3a6b68['attributes']['length']?_0x3a6b68[_0xb3f7('0x34')]:_0x5a2566[_0xb3f7('0x30')];if(!_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x36')](_0xb3f7('0x37'))){_0x3a6b68[_0xb3f7('0x1e')]=qs[_0xb3f7('0x1e')](_0x2a0d38['query'][_0xb3f7('0x1e')]);_0x3a6b68[_0xb3f7('0x1c')]=qs['offset'](_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x1c')]);}_0x3a6b68[_0xb3f7('0x38')]=qs[_0xb3f7('0x39')](_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x39')]);_0x3a6b68[_0xb3f7('0x3a')]=qs[_0xb3f7('0x32')](_[_0xb3f7('0x3b')](_0x2a0d38[_0xb3f7('0x31')],_0x5a2566['filters']),_0x243a02);if(_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x3c')]){_0x3a6b68[_0xb3f7('0x3a')]=_[_0xb3f7('0x3d')](_0x3a6b68[_0xb3f7('0x3a')],{'$or':_['map'](_0x243a02,function(_0x5b4cc2){if(_0x5b4cc2['type']!=='VIRTUAL'){var _0x3bf5bb={};_0x3bf5bb[_0x5b4cc2[_0xb3f7('0x27')]]={'$like':'%'+_0x2a0d38['query'][_0xb3f7('0x3c')]+'%'};return _0x3bf5bb;}})});}_0x3a6b68=_[_0xb3f7('0x3d')]({},_0x3a6b68,_0x2a0d38[_0xb3f7('0x3e')]);var _0x2fd149={'where':_0x3a6b68[_0xb3f7('0x3a')]};return db[_0xb3f7('0x2b')][_0xb3f7('0x1f')](_0x2fd149)[_0xb3f7('0x23')](function(_0x376af2){_0x38d823[_0xb3f7('0x1f')]=_0x376af2;if(_0x2a0d38['query'][_0xb3f7('0x3f')]){_0x3a6b68[_0xb3f7('0x40')]=[{'all':!![]}];}return db[_0xb3f7('0x2b')][_0xb3f7('0x41')](_0x3a6b68);})[_0xb3f7('0x23')](function(_0x97f317){_0x38d823['rows']=_0x97f317;return _0x38d823;})[_0xb3f7('0x23')](respondWithFilteredResult(_0x17755d,_0x3a6b68))['catch'](handleError(_0x17755d,null));};exports[_0xb3f7('0x42')]=function(_0x54887f,_0x1fa88c){var _0x150e39={'raw':![],'where':{'id':_0x54887f[_0xb3f7('0x43')]['id']}},_0x6cb41e={};_0x6cb41e[_0xb3f7('0x30')]=_[_0xb3f7('0x44')](db['Automation']['rawAttributes']);_0x6cb41e[_0xb3f7('0x31')]=_[_0xb3f7('0x44')](_0x54887f[_0xb3f7('0x31')]);_0x6cb41e[_0xb3f7('0x32')]=_['intersection'](_0x6cb41e[_0xb3f7('0x30')],_0x6cb41e['query']);_0x150e39[_0xb3f7('0x34')]=_[_0xb3f7('0x33')](_0x6cb41e['model'],qs[_0xb3f7('0x35')](_0x54887f[_0xb3f7('0x31')][_0xb3f7('0x35')]));_0x150e39['attributes']=_0x150e39[_0xb3f7('0x34')]['length']?_0x150e39[_0xb3f7('0x34')]:_0x6cb41e['model'];if(_0x54887f[_0xb3f7('0x31')]['includeAll']){_0x150e39[_0xb3f7('0x40')]=[{'all':!![]}];}_0x150e39=_[_0xb3f7('0x3d')]({},_0x150e39,_0x54887f['options']);return db[_0xb3f7('0x2b')][_0xb3f7('0x45')](_0x150e39)['then'](handleEntityNotFound(_0x1fa88c,null))[_0xb3f7('0x23')](respondWithResult(_0x1fa88c,null))[_0xb3f7('0x46')](handleError(_0x1fa88c,null));};exports[_0xb3f7('0x47')]=function(_0x472c2c,_0x55ed1d){return db[_0xb3f7('0x2b')][_0xb3f7('0x47')](_0x472c2c[_0xb3f7('0x48')],{})[_0xb3f7('0x23')](respondWithResult(_0x55ed1d,0xc9))[_0xb3f7('0x46')](handleError(_0x55ed1d,null));};exports['update']=function(_0x1f9adb,_0x50361f){if(_0x1f9adb[_0xb3f7('0x48')]['id']){delete _0x1f9adb[_0xb3f7('0x48')]['id'];}return db[_0xb3f7('0x2b')][_0xb3f7('0x45')]({'where':{'id':_0x1f9adb[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x50361f,null))[_0xb3f7('0x23')](saveUpdates(_0x1f9adb[_0xb3f7('0x48')],null))['then'](respondWithResult(_0x50361f,null))['catch'](handleError(_0x50361f,null));};exports[_0xb3f7('0x24')]=function(_0x43ddcc,_0x1f88f5){return db[_0xb3f7('0x2b')][_0xb3f7('0x45')]({'where':{'id':_0x43ddcc[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x1f88f5,null))[_0xb3f7('0x23')](removeEntity(_0x1f88f5,null))[_0xb3f7('0x46')](handleError(_0x1f88f5,null));};exports[_0xb3f7('0x49')]=function(_0x5128de,_0x2ac948,_0x5ba4e3){return db['Condition'][_0xb3f7('0x45')]({'where':{'id':_0x5128de[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x2ac948,null))[_0xb3f7('0x23')](function(_0x1dc1e5){if(_0x1dc1e5){return _0x1dc1e5[_0xb3f7('0x49')](_0x5128de[_0xb3f7('0x48')]['ids'],_[_0xb3f7('0x4a')](_0x5128de[_0xb3f7('0x48')],[_0xb3f7('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x2ac948,null))[_0xb3f7('0x46')](handleError(_0x2ac948,null));};exports['getConditions']=function(_0x10c917,_0x65c1d4,_0x1de412){var _0x33803e={};var _0x5d3573={};var _0x1f79b8;var _0x426ec7;return db[_0xb3f7('0x2b')][_0xb3f7('0x4c')]({'where':{'id':_0x10c917[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x65c1d4,null))[_0xb3f7('0x23')](function(_0xe631ea){if(_0xe631ea){_0x1f79b8=_0xe631ea;_0x5d3573['model']=_[_0xb3f7('0x44')](db[_0xb3f7('0x4d')][_0xb3f7('0x2c')]);_0x5d3573['query']=_[_0xb3f7('0x44')](_0x10c917[_0xb3f7('0x31')]);_0x5d3573[_0xb3f7('0x32')]=_[_0xb3f7('0x33')](_0x5d3573['model'],_0x5d3573[_0xb3f7('0x31')]);_0x33803e[_0xb3f7('0x34')]=_[_0xb3f7('0x33')](_0x5d3573[_0xb3f7('0x30')],qs['fields'](_0x10c917[_0xb3f7('0x31')]['fields']));_0x33803e['attributes']=_0x33803e[_0xb3f7('0x34')][_0xb3f7('0x4e')]?_0x33803e[_0xb3f7('0x34')]:_0x5d3573[_0xb3f7('0x30')];_0x33803e[_0xb3f7('0x38')]=qs['sort'](_0x10c917['query']['sort']);_0x33803e[_0xb3f7('0x3a')]=qs[_0xb3f7('0x32')](_['pick'](_0x10c917[_0xb3f7('0x31')],_0x5d3573[_0xb3f7('0x32')]));if(_0x10c917[_0xb3f7('0x31')]['filter']){_0x33803e[_0xb3f7('0x3a')]=_[_0xb3f7('0x3d')](_0x33803e[_0xb3f7('0x3a')],{'$or':_[_0xb3f7('0x2a')](_0x33803e[_0xb3f7('0x34')],function(_0x128617){var _0x5f84c4={};_0x5f84c4[_0x128617]={'$like':'%'+_0x10c917[_0xb3f7('0x31')][_0xb3f7('0x3c')]+'%'};return _0x5f84c4;})});}_0x33803e=_[_0xb3f7('0x3d')]({},_0x33803e,_0x10c917[_0xb3f7('0x3e')]);return _0x1f79b8[_0xb3f7('0x4f')](_0x33803e);}})['then'](function(_0x31cd87){if(_0x31cd87){_0x426ec7=_0x31cd87[_0xb3f7('0x4e')];if(!_0x10c917[_0xb3f7('0x31')]['hasOwnProperty'](_0xb3f7('0x37'))){_0x33803e['limit']=qs[_0xb3f7('0x1e')](_0x10c917[_0xb3f7('0x31')][_0xb3f7('0x1e')]);_0x33803e[_0xb3f7('0x1c')]=qs[_0xb3f7('0x1c')](_0x10c917[_0xb3f7('0x31')][_0xb3f7('0x1c')]);}return _0x1f79b8['getConditions'](_0x33803e);}})[_0xb3f7('0x23')](function(_0x257457){if(_0x257457){return _0x257457?{'count':_0x426ec7,'rows':_0x257457}:null;}})[_0xb3f7('0x23')](respondWithResult(_0x65c1d4,null))[_0xb3f7('0x46')](handleError(_0x65c1d4,null));};exports[_0xb3f7('0x50')]=function(_0x469861,_0x4463a9,_0xdb8e8f){return db[_0xb3f7('0x51')][_0xb3f7('0x45')]({'where':{'id':_0x469861['params']['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x4463a9,null))[_0xb3f7('0x23')](function(_0x26dbaf){if(_0x26dbaf){return _0x26dbaf[_0xb3f7('0x50')](_0x469861[_0xb3f7('0x48')]['ids'],_[_0xb3f7('0x4a')](_0x469861[_0xb3f7('0x48')],[_0xb3f7('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x4463a9,null))[_0xb3f7('0x46')](handleError(_0x4463a9,null));};exports[_0xb3f7('0x52')]=function(_0x24f1d4,_0x810f1c,_0x80288c){var _0x5e672e={};var _0x1826e2={};var _0xce6175;var _0x1d18f6;return db[_0xb3f7('0x2b')]['findOne']({'where':{'id':_0x24f1d4[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x810f1c,null))[_0xb3f7('0x23')](function(_0x705bb3){if(_0x705bb3){_0xce6175=_0x705bb3;_0x1826e2[_0xb3f7('0x30')]=_['keys'](db[_0xb3f7('0x51')][_0xb3f7('0x2c')]);_0x1826e2[_0xb3f7('0x31')]=_[_0xb3f7('0x44')](_0x24f1d4[_0xb3f7('0x31')]);_0x1826e2['filters']=_[_0xb3f7('0x33')](_0x1826e2[_0xb3f7('0x30')],_0x1826e2[_0xb3f7('0x31')]);_0x5e672e['attributes']=_[_0xb3f7('0x33')](_0x1826e2[_0xb3f7('0x30')],qs[_0xb3f7('0x35')](_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x35')]));_0x5e672e[_0xb3f7('0x34')]=_0x5e672e['attributes'][_0xb3f7('0x4e')]?_0x5e672e[_0xb3f7('0x34')]:_0x1826e2[_0xb3f7('0x30')];_0x5e672e['order']=qs[_0xb3f7('0x39')](_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x39')]);_0x5e672e['where']=qs['filters'](_[_0xb3f7('0x3b')](_0x24f1d4[_0xb3f7('0x31')],_0x1826e2[_0xb3f7('0x32')]));if(_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x3c')]){_0x5e672e[_0xb3f7('0x3a')]=_[_0xb3f7('0x3d')](_0x5e672e['where'],{'$or':_[_0xb3f7('0x2a')](_0x5e672e[_0xb3f7('0x34')],function(_0x536d77){var _0x2214fa={};_0x2214fa[_0x536d77]={'$like':'%'+_0x24f1d4['query']['filter']+'%'};return _0x2214fa;})});}_0x5e672e=_['merge']({},_0x5e672e,_0x24f1d4['options']);return _0xce6175[_0xb3f7('0x52')](_0x5e672e);}})[_0xb3f7('0x23')](function(_0x4ccf43){if(_0x4ccf43){_0x1d18f6=_0x4ccf43[_0xb3f7('0x4e')];if(!_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x36')](_0xb3f7('0x37'))){_0x5e672e[_0xb3f7('0x1e')]=qs['limit'](_0x24f1d4[_0xb3f7('0x31')]['limit']);_0x5e672e['offset']=qs['offset'](_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x1c')]);}return _0xce6175[_0xb3f7('0x52')](_0x5e672e);}})[_0xb3f7('0x23')](function(_0x1f8227){if(_0x1f8227){return _0x1f8227?{'count':_0x1d18f6,'rows':_0x1f8227}:null;}})[_0xb3f7('0x23')](respondWithResult(_0x810f1c,null))[_0xb3f7('0x46')](handleError(_0x810f1c,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 32b7a75..646ea64 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 _0xd080=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./automation.attributes','exports','define','tools_automations'];(function(_0x16446a,_0x5e9140){var _0x2c7051=function(_0x2e6a25){while(--_0x2e6a25){_0x16446a['push'](_0x16446a['shift']());}};_0x2c7051(++_0x5e9140);}(_0xd080,0x82));var _0x0d08=function(_0x1945b6,_0x1e9dba){_0x1945b6=_0x1945b6-0x0;var _0x2a16e6=_0xd080[_0x1945b6];return _0x2a16e6;};'use strict';var _=require(_0x0d08('0x0'));var util=require(_0x0d08('0x1'));var logger=require(_0x0d08('0x2'))('api');var moment=require(_0x0d08('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0d08('0x5'));var attributes=require(_0x0d08('0x6'));module[_0x0d08('0x7')]=function(_0xc0b17d,_0x4f5f7b){return _0xc0b17d[_0x0d08('0x8')]('Automation',attributes,{'tableName':_0x0d08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b65=['path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','api','moment','request-promise'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x2b65,0x131));var _0x52b6=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0x2b65[_0x5f584a];return _0x3788d9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x52b6('0x0'));var moment=require(_0x52b6('0x1'));var BPromise=require('bluebird');var rp=require(_0x52b6('0x2'));var fs=require('fs');var path=require(_0x52b6('0x3'));var rimraf=require(_0x52b6('0x4'));var config=require(_0x52b6('0x5'));var attributes=require(_0x52b6('0x6'));module[_0x52b6('0x7')]=function(_0x900710,_0x5779b0){return _0x900710[_0x52b6('0x8')](_0x52b6('0x9'),attributes,{'tableName':_0x52b6('0xa'),'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 c7c8367..c3667ab 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 _0xad07=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3a2cc8,_0x17defa){var _0x2db4e2=function(_0x1cbd2a){while(--_0x1cbd2a){_0x3a2cc8['push'](_0x3a2cc8['shift']());}};_0x2db4e2(++_0x17defa);}(_0xad07,0xe3));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ad0('0x0'));var util=require(_0x7ad0('0x1'));var moment=require('moment');var BPromise=require(_0x7ad0('0x2'));var rs=require(_0x7ad0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ad0('0x4'));var logger=require(_0x7ad0('0x5'))(_0x7ad0('0x6'));var config=require('../../config/environment');var jayson=require(_0x7ad0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d09f9,_0x458ffd,_0x533282){return new BPromise(function(_0x50b4e7,_0x8684e2){return client[_0x7ad0('0x8')](_0x2d09f9,_0x533282)['then'](function(_0x5afa7c){logger[_0x7ad0('0x9')](_0x7ad0('0xa'),_0x458ffd,_0x7ad0('0xb'));logger['debug'](_0x7ad0('0xc'),_0x458ffd,_0x7ad0('0xb'),JSON[_0x7ad0('0xd')](_0x5afa7c));if(_0x5afa7c[_0x7ad0('0xe')]){if(_0x5afa7c[_0x7ad0('0xe')][_0x7ad0('0xf')]===0x1f4){logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x458ffd,_0x5afa7c[_0x7ad0('0xe')]['message']);return _0x8684e2(_0x5afa7c[_0x7ad0('0xe')][_0x7ad0('0x10')]);}logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x458ffd,_0x5afa7c['error']['message']);return _0x50b4e7(_0x5afa7c[_0x7ad0('0xe')][_0x7ad0('0x10')]);}else{logger[_0x7ad0('0x9')](_0x7ad0('0xa'),_0x458ffd,_0x7ad0('0xb'));_0x50b4e7(_0x5afa7c[_0x7ad0('0x11')][_0x7ad0('0x10')]);}})[_0x7ad0('0x12')](function(_0x52c802){logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x458ffd,_0x52c802);_0x8684e2(_0x52c802);});});} \ No newline at end of file +var _0x225b=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x476036,_0x13c6a6){var _0x30b0ef=function(_0x35af25){while(--_0x35af25){_0x476036['push'](_0x476036['shift']());}};_0x30b0ef(++_0x13c6a6);}(_0x225b,0xb1));var _0xb225=function(_0x3e9d9f,_0x55766d){_0x3e9d9f=_0x3e9d9f-0x0;var _0xd04a20=_0x225b[_0x3e9d9f];return _0xd04a20;};'use strict';var _=require(_0xb225('0x0'));var util=require(_0xb225('0x1'));var moment=require('moment');var BPromise=require(_0xb225('0x2'));var rs=require(_0xb225('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb225('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb225('0x5'))('rpc');var config=require(_0xb225('0x6'));var jayson=require(_0xb225('0x7'));var client=jayson[_0xb225('0x8')][_0xb225('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37e0a1,_0x3f25e6,_0x31a718){return new BPromise(function(_0x4da794,_0x168aa8){return client[_0xb225('0xa')](_0x37e0a1,_0x31a718)[_0xb225('0xb')](function(_0xccc2e3){logger['info'](_0xb225('0xc'),_0x3f25e6,_0xb225('0xd'));logger[_0xb225('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x3f25e6,_0xb225('0xd'),JSON[_0xb225('0xf')](_0xccc2e3));if(_0xccc2e3[_0xb225('0x10')]){if(_0xccc2e3[_0xb225('0x10')][_0xb225('0x11')]===0x1f4){logger['error'](_0xb225('0xc'),_0x3f25e6,_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);return _0x168aa8(_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3f25e6,_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);return _0x4da794(_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);}else{logger[_0xb225('0x13')](_0xb225('0xc'),_0x3f25e6,_0xb225('0xd'));_0x4da794(_0xccc2e3[_0xb225('0x14')][_0xb225('0x12')]);}})[_0xb225('0x15')](function(_0x343ff8){logger[_0xb225('0x10')]('Automation,\x20%s,\x20%s',_0x3f25e6,_0x343ff8);_0x168aa8(_0x343ff8);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 252b1de..20e2ea4 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 _0xef35=['fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','/:id/actions','post','addConditions','addActions','put','update','delete','multer','path','connect-timeout','express','Router'];(function(_0xdb0d3,_0xa7146b){var _0x333824=function(_0x21d2a2){while(--_0x21d2a2){_0xdb0d3['push'](_0xdb0d3['shift']());}};_0x333824(++_0xa7146b);}(_0xef35,0x95));var _0x5ef3=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0xef35[_0x15bbf1];return _0x5c4b47;};'use strict';var multer=require(_0x5ef3('0x0'));var util=require('util');var path=require(_0x5ef3('0x1'));var timeout=require(_0x5ef3('0x2'));var express=require(_0x5ef3('0x3'));var router=express[_0x5ef3('0x4')]();var fs_extra=require(_0x5ef3('0x5'));var auth=require(_0x5ef3('0x6'));var interaction=require(_0x5ef3('0x7'));var config=require('../../config/environment');var controller=require(_0x5ef3('0x8'));router['get']('/',auth[_0x5ef3('0x9')](),controller['index']);router[_0x5ef3('0xa')](_0x5ef3('0xb'),auth[_0x5ef3('0x9')](),controller[_0x5ef3('0xc')]);router[_0x5ef3('0xa')](_0x5ef3('0xd'),auth['isAuthenticated'](),controller[_0x5ef3('0xe')]);router['get'](_0x5ef3('0xf'),auth[_0x5ef3('0x9')](),controller['getActions']);router[_0x5ef3('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5ef3('0xd'),auth[_0x5ef3('0x9')](),controller[_0x5ef3('0x11')]);router[_0x5ef3('0x10')](_0x5ef3('0xf'),auth['isAuthenticated'](),controller[_0x5ef3('0x12')]);router[_0x5ef3('0x13')](_0x5ef3('0xb'),auth[_0x5ef3('0x9')](),controller[_0x5ef3('0x14')]);router[_0x5ef3('0x15')](_0x5ef3('0xb'),auth[_0x5ef3('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9901=['create','addConditions','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x149b5f,_0x522e4a){var _0x1222fb=function(_0x3d420f){while(--_0x3d420f){_0x149b5f['push'](_0x149b5f['shift']());}};_0x1222fb(++_0x522e4a);}(_0x9901,0x15e));var _0x1990=function(_0x5b3946,_0x23053c){_0x5b3946=_0x5b3946-0x0;var _0x2bd577=_0x9901[_0x5b3946];return _0x2bd577;};'use strict';var multer=require('multer');var util=require(_0x1990('0x0'));var path=require('path');var timeout=require(_0x1990('0x1'));var express=require(_0x1990('0x2'));var router=express[_0x1990('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1990('0x4'));var interaction=require(_0x1990('0x5'));var config=require(_0x1990('0x6'));var controller=require(_0x1990('0x7'));router[_0x1990('0x8')]('/',auth[_0x1990('0x9')](),controller[_0x1990('0xa')]);router[_0x1990('0x8')](_0x1990('0xb'),auth[_0x1990('0x9')](),controller[_0x1990('0xc')]);router['get'](_0x1990('0xd'),auth[_0x1990('0x9')](),controller[_0x1990('0xe')]);router[_0x1990('0x8')](_0x1990('0xf'),auth[_0x1990('0x9')](),controller[_0x1990('0x10')]);router[_0x1990('0x11')]('/',auth[_0x1990('0x9')](),controller[_0x1990('0x12')]);router[_0x1990('0x11')](_0x1990('0xd'),auth['isAuthenticated'](),controller[_0x1990('0x13')]);router['post']('/:id/actions',auth[_0x1990('0x9')](),controller['addActions']);router[_0x1990('0x14')](_0x1990('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1990('0x15')](_0x1990('0xb'),auth[_0x1990('0x9')](),controller[_0x1990('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 69b3c63..aa24fe9 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 _0x57e9=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x57e9,0x150));var _0x957e=function(_0xb0394e,_0x5221ac){_0xb0394e=_0xb0394e-0x0;var _0x364703=_0x57e9[_0xb0394e];return _0x364703;};'use strict';var Sequelize=require('sequelize');module[_0x957e('0x0')]={'name':{'type':Sequelize[_0x957e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x957e('0x2')](_0x957e('0x3')),'allowNull':![],'defaultValue':_0x957e('0x3')},'description':{'type':Sequelize[_0x957e('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x957e('0x4')},'limitCalls':{'type':Sequelize[_0x957e('0x5')](0x4)[_0x957e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x957e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x957e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x957e('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x957e('0xe')},'dialTimezone':{'type':Sequelize[_0x957e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x957e('0x1')],'defaultValue':_0x957e('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x957e('0x2')](_0x957e('0x10'),_0x957e('0x11'),'onlyIfOpen'),'defaultValue':_0x957e('0x10')},'dialAMDActive':{'type':Sequelize[_0x957e('0x12')],'defaultValue':0x0,'comment':_0x957e('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x957e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x957e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x957e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x957e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x957e('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x957e('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x957e('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x957e('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x957e('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x957e('0x2')](_0x957e('0x1b'),_0x957e('0x1c')),'defaultValue':_0x957e('0x1b')},'dialPrefix':{'type':Sequelize[_0x957e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x957e('0x1d')},'dialCutDigit':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x957e('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x23')}}; \ No newline at end of file +var _0x0111=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence'];(function(_0x16a645,_0x4743bc){var _0x41dccb=function(_0xc681bf){while(--_0xc681bf){_0x16a645['push'](_0x16a645['shift']());}};_0x41dccb(++_0x4743bc);}(_0x0111,0x1cb));var _0x1011=function(_0xa0cc6f,_0x2cf629){_0xa0cc6f=_0xa0cc6f-0x0;var _0x2705b0=_0x0111[_0xa0cc6f];return _0x2705b0;};'use strict';var Sequelize=require(_0x1011('0x0'));module['exports']={'name':{'type':Sequelize[_0x1011('0x1')],'unique':_0x1011('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1011('0x3')](_0x1011('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1011('0x1')]},'active':{'type':Sequelize[_0x1011('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1011('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1011('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1011('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1011('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1011('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1011('0x1')],'defaultValue':_0x1011('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x1011('0x3')](_0x1011('0xf'),_0x1011('0x10'),'onlyIfOpen'),'defaultValue':_0x1011('0xf')},'dialAMDActive':{'type':Sequelize[_0x1011('0x5')],'defaultValue':0x0,'comment':_0x1011('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x1011('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1011('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1011('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1011('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1011('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1011('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1011('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1011('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1011('0x3')](_0x1011('0x18'),_0x1011('0x19')),'defaultValue':_0x1011('0x18')},'dialPrefix':{'type':Sequelize[_0x1011('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1011('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1011('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1011('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'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 9d373d5..3006d58 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 _0xd2a8=['CmHopper','hasOwnProperty','CampaignId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','path','to-csv','squel','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','undefined','limit','count','offset','apply','reject','save','update','then','destroy','IvrCampaigns','error','name','send','index','Campaign','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getHoppers','findOne'];(function(_0x43560b,_0x52a8ff){var _0x4687ee=function(_0x3d4a08){while(--_0x3d4a08){_0x43560b['push'](_0x43560b['shift']());}};_0x4687ee(++_0x52a8ff);}(_0xd2a8,0xc9));var _0x8d2a=function(_0x14dc3b,_0x497455){_0x14dc3b=_0x14dc3b-0x0;var _0x5848a7=_0xd2a8[_0x14dc3b];return _0x5848a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d2a('0x0'));var zipdir=require(_0x8d2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d2a('0x2'));var moment=require(_0x8d2a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8d2a('0x4'));var sox=require('sox');var csv=require(_0x8d2a('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d2a('0x6'));var crypto=require('crypto');var jsforce=require(_0x8d2a('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x8d2a('0x5'));var querystring=require('querystring');var Papa=require(_0x8d2a('0x8'));var Redis=require(_0x8d2a('0x9'));var authService=require('../../components/auth/service');var qs=require(_0x8d2a('0xa'));var as=require(_0x8d2a('0xb'));var hardwareService=require(_0x8d2a('0xc'));var logger=require(_0x8d2a('0xd'))(_0x8d2a('0xe'));var utils=require(_0x8d2a('0xf'));var config=require(_0x8d2a('0x10'));var licenseUtil=require(_0x8d2a('0x11'));var db=require(_0x8d2a('0x12'))['db'];function respondWithStatusCode(_0x1c4d91,_0x20c7bf){_0x20c7bf=_0x20c7bf||0xcc;return function(_0x36faf1){if(_0x36faf1){return _0x1c4d91[_0x8d2a('0x13')](_0x20c7bf);}return _0x1c4d91[_0x8d2a('0x14')](_0x20c7bf)[_0x8d2a('0x15')]();};}function respondWithResult(_0xac7097,_0x390844){_0x390844=_0x390844||0xc8;return function(_0x1ce423){if(_0x1ce423){return _0xac7097[_0x8d2a('0x14')](_0x390844)[_0x8d2a('0x16')](_0x1ce423);}};}function respondWithFilteredResult(_0x4dd8ec,_0x431ef1){return function(_0x356ece){if(_0x356ece){var _0x11dbd9=typeof _0x431ef1['offset']===_0x8d2a('0x17')&&typeof _0x431ef1[_0x8d2a('0x18')]===_0x8d2a('0x17');var _0x2ae5dd=_0x356ece[_0x8d2a('0x19')];var _0x48c0cc=_0x11dbd9?0x0:_0x431ef1[_0x8d2a('0x1a')];var _0x2ea79a=_0x11dbd9?_0x356ece[_0x8d2a('0x19')]:_0x431ef1[_0x8d2a('0x1a')]+_0x431ef1[_0x8d2a('0x18')];var _0x35639d;if(_0x2ea79a>=_0x2ae5dd){_0x2ea79a=_0x2ae5dd;_0x35639d=0xc8;}else{_0x35639d=0xce;}_0x4dd8ec[_0x8d2a('0x14')](_0x35639d);return _0x4dd8ec['set']('Content-Range',_0x48c0cc+'-'+_0x2ea79a+'/'+_0x2ae5dd)[_0x8d2a('0x16')](_0x356ece);}return null;};}function patchUpdates(_0x372f77){return function(_0x345a01){try{jsonpatch[_0x8d2a('0x1b')](_0x345a01,_0x372f77,!![]);}catch(_0x4e3010){return BPromise[_0x8d2a('0x1c')](_0x4e3010);}return _0x345a01[_0x8d2a('0x1d')]();};}function saveUpdates(_0x36ed11,_0x17e370){return function(_0x34983a){if(_0x34983a){return _0x34983a[_0x8d2a('0x1e')](_0x36ed11)[_0x8d2a('0x1f')](function(_0x59384e){return _0x59384e;});}return null;};}function removeEntity(_0x1c4bc9,_0x4cf2db){return function(_0x3ee19d){if(_0x3ee19d){return _0x3ee19d[_0x8d2a('0x20')]()[_0x8d2a('0x1f')](function(){var _0x3b5b9d=_0x3ee19d['get']({'plain':!![]});var _0x41172a=_0x8d2a('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x41172a,'resourceId':_0x3b5b9d['id']}})[_0x8d2a('0x1f')](function(){return _0x3ee19d;});})[_0x8d2a('0x1f')](function(){_0x1c4bc9[_0x8d2a('0x14')](0xcc)[_0x8d2a('0x15')]();});}};}function handleEntityNotFound(_0x2b1d7e,_0x53244b){return function(_0x515c1c){if(!_0x515c1c){_0x2b1d7e[_0x8d2a('0x13')](0x194);}return _0x515c1c;};}function handleError(_0x2249ab,_0x330e17){_0x330e17=_0x330e17||0x1f4;return function(_0x2422da){logger[_0x8d2a('0x22')](_0x2422da['stack']);if(_0x2422da[_0x8d2a('0x23')]){delete _0x2422da[_0x8d2a('0x23')];}_0x2249ab[_0x8d2a('0x14')](_0x330e17)[_0x8d2a('0x24')](_0x2422da);};}exports[_0x8d2a('0x25')]=function(_0x8caecc,_0xd470b3){var _0xb90057={},_0x55b8e8={},_0x769d35={'count':0x0,'rows':[]};var _0xa1b981=_['map'](db[_0x8d2a('0x26')][_0x8d2a('0x27')],function(_0x3b69ee){return{'name':_0x3b69ee[_0x8d2a('0x28')],'type':_0x3b69ee['type']['key']};});_0x55b8e8[_0x8d2a('0x29')]=_[_0x8d2a('0x2a')](_0xa1b981,_0x8d2a('0x23'));_0x55b8e8[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x8caecc[_0x8d2a('0x2b')]);_0x55b8e8[_0x8d2a('0x2d')]=_['intersection'](_0x55b8e8[_0x8d2a('0x29')],_0x55b8e8[_0x8d2a('0x2b')]);_0xb90057[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x55b8e8[_0x8d2a('0x29')],qs['fields'](_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0xb90057[_0x8d2a('0x2e')]=_0xb90057['attributes'][_0x8d2a('0x31')]?_0xb90057[_0x8d2a('0x2e')]:_0x55b8e8[_0x8d2a('0x29')];if(!_0x8caecc[_0x8d2a('0x2b')]['hasOwnProperty'](_0x8d2a('0x32'))){_0xb90057[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x8caecc['query'][_0x8d2a('0x18')]);_0xb90057['offset']=qs['offset'](_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x1a')]);}_0xb90057[_0x8d2a('0x33')]=qs[_0x8d2a('0x34')](_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x34')]);_0xb90057[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x8caecc[_0x8d2a('0x2b')],_0x55b8e8[_0x8d2a('0x2d')]),_0xa1b981);if(_0x8caecc[_0x8d2a('0x2b')]['filter']){_0xb90057[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0xb90057['where'],{'$or':_[_0x8d2a('0x2a')](_0xa1b981,function(_0x58cfba){if(_0x58cfba[_0x8d2a('0x38')]!=='VIRTUAL'){var _0x43e1a4={};_0x43e1a4[_0x58cfba[_0x8d2a('0x23')]]={'$like':'%'+_0x8caecc[_0x8d2a('0x2b')]['filter']+'%'};return _0x43e1a4;}})});}_0xb90057=_[_0x8d2a('0x37')]({},_0xb90057,_0x8caecc[_0x8d2a('0x39')]);var _0x1297bb={'where':_0xb90057[_0x8d2a('0x35')]};return db[_0x8d2a('0x26')][_0x8d2a('0x19')](_0x1297bb)[_0x8d2a('0x1f')](function(_0xdf9825){_0x769d35[_0x8d2a('0x19')]=_0xdf9825;if(_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x3a')]){_0xb90057[_0x8d2a('0x3b')]=[{'all':!![]}];}return db['Campaign'][_0x8d2a('0x3c')](_0xb90057);})['then'](function(_0x143cd2){_0x769d35[_0x8d2a('0x3d')]=_0x143cd2;return _0x769d35;})[_0x8d2a('0x1f')](respondWithFilteredResult(_0xd470b3,_0xb90057))[_0x8d2a('0x3e')](handleError(_0xd470b3,null));};exports[_0x8d2a('0x3f')]=function(_0x5f2a52,_0x51aea6){var _0x1793b0={'raw':![],'where':{'id':_0x5f2a52[_0x8d2a('0x40')]['id']}},_0x12b6c5={};_0x12b6c5[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db[_0x8d2a('0x26')][_0x8d2a('0x27')]);_0x12b6c5[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x5f2a52[_0x8d2a('0x2b')]);_0x12b6c5[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x12b6c5[_0x8d2a('0x29')],_0x12b6c5[_0x8d2a('0x2b')]);_0x1793b0[_0x8d2a('0x2e')]=_['intersection'](_0x12b6c5[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x5f2a52[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x1793b0[_0x8d2a('0x2e')]=_0x1793b0[_0x8d2a('0x2e')]['length']?_0x1793b0[_0x8d2a('0x2e')]:_0x12b6c5[_0x8d2a('0x29')];if(_0x5f2a52['query'][_0x8d2a('0x3a')]){_0x1793b0['include']=[{'all':!![]}];}_0x1793b0=_[_0x8d2a('0x37')]({},_0x1793b0,_0x5f2a52['options']);return db[_0x8d2a('0x26')][_0x8d2a('0x41')](_0x1793b0)[_0x8d2a('0x1f')](handleEntityNotFound(_0x51aea6,null))[_0x8d2a('0x1f')](respondWithResult(_0x51aea6,null))[_0x8d2a('0x3e')](handleError(_0x51aea6,null));};exports[_0x8d2a('0x42')]=function(_0x364777,_0x505a99){return db[_0x8d2a('0x26')][_0x8d2a('0x42')](_0x364777['body'],{})[_0x8d2a('0x1f')](function(_0x317313){var _0x3767a2=_0x364777[_0x8d2a('0x43')][_0x8d2a('0x44')]({'plain':!![]});if(!_0x3767a2)throw new Error(_0x8d2a('0x45'));if(_0x3767a2[_0x8d2a('0x46')]==='user'){var _0x4cd307=_0x317313[_0x8d2a('0x44')]({'plain':!![]});var _0x1a874c='IvrCampaigns';return db[_0x8d2a('0x47')][_0x8d2a('0x41')]({'where':{'name':_0x1a874c,'userProfileId':_0x3767a2[_0x8d2a('0x48')]},'raw':!![]})[_0x8d2a('0x1f')](function(_0xde4bb7){if(_0xde4bb7&&_0xde4bb7[_0x8d2a('0x49')]===0x0){return db[_0x8d2a('0x4a')][_0x8d2a('0x42')]({'name':_0x4cd307[_0x8d2a('0x23')],'resourceId':_0x4cd307['id'],'type':_0xde4bb7[_0x8d2a('0x23')],'sectionId':_0xde4bb7['id']},{})[_0x8d2a('0x1f')](function(){return _0x317313;});}else{return _0x317313;}})['catch'](function(_0x70a1c5){logger['error'](_0x8d2a('0x4b'),_0x70a1c5);throw _0x70a1c5;});}return _0x317313;})[_0x8d2a('0x1f')](respondWithResult(_0x505a99,0xc9))[_0x8d2a('0x3e')](handleError(_0x505a99,null));};exports[_0x8d2a('0x4c')]=function(_0x8c69cc,_0xc8c04b){var _0x80ba4={'where':{'id':_0x8c69cc[_0x8d2a('0x40')]['id']}},_0x3caf84={};_0x3caf84[_0x8d2a('0x29')]=_['keys'](db[_0x8d2a('0x26')][_0x8d2a('0x27')]);_0x80ba4[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x3caf84[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x8c69cc[_0x8d2a('0x2b')]['fields']));_0x80ba4['attributes']=_0x80ba4['attributes'][_0x8d2a('0x31')]?_0x80ba4['attributes']:_0x3caf84[_0x8d2a('0x29')];if(_0x8c69cc['query'][_0x8d2a('0x3a')]){_0x80ba4['include']=[{'all':!![]}];}_0x80ba4=_[_0x8d2a('0x37')]({},_0x80ba4,_0x8c69cc[_0x8d2a('0x39')]);return db[_0x8d2a('0x26')][_0x8d2a('0x41')](_0x80ba4)[_0x8d2a('0x1f')](handleEntityNotFound(_0xc8c04b,null))[_0x8d2a('0x1f')](function(_0x267e15){if(_0x267e15){var _0x29aa45=_0x267e15['get']({'plain':!![]});_0x29aa45=qs[_0x8d2a('0x4d')](_0x29aa45,['id',_0x8d2a('0x4e'),_0x8d2a('0x4f')]);_0x8c69cc[_0x8d2a('0x50')]=_[_0x8d2a('0x4d')](_0x8c69cc[_0x8d2a('0x50')],['id',_0x8d2a('0x4e'),'updatedAt']);return db['Campaign'][_0x8d2a('0x42')](_[_0x8d2a('0x37')](_0x29aa45,_0x8c69cc[_0x8d2a('0x50')]),{'include':_0x8c69cc['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x8da82e){var _0x486e2e=_0x8c69cc[_0x8d2a('0x43')][_0x8d2a('0x44')]({'plain':!![]});if(!_0x486e2e)throw new Error(_0x8d2a('0x45'));if(_0x486e2e['role']===_0x8d2a('0x43')){var _0x4ca908=_0x8da82e[_0x8d2a('0x44')]({'plain':!![]});var _0x19ad25=_0x8d2a('0x21');return db[_0x8d2a('0x47')][_0x8d2a('0x41')]({'where':{'name':_0x19ad25,'userProfileId':_0x486e2e[_0x8d2a('0x48')]},'raw':!![]})[_0x8d2a('0x1f')](function(_0x47bf9f){if(_0x47bf9f&&_0x47bf9f[_0x8d2a('0x49')]===0x0){return db[_0x8d2a('0x4a')][_0x8d2a('0x42')]({'name':_0x4ca908[_0x8d2a('0x23')],'resourceId':_0x4ca908['id'],'type':_0x47bf9f[_0x8d2a('0x23')],'sectionId':_0x47bf9f['id']},{})[_0x8d2a('0x1f')](function(){return _0x8da82e;});}else{return _0x8da82e;}})[_0x8d2a('0x3e')](function(_0xcb9352){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcb9352);throw _0xcb9352;});}return _0x8da82e;});}})[_0x8d2a('0x1f')](respondWithResult(_0xc8c04b,0xc9))[_0x8d2a('0x3e')](handleError(_0xc8c04b,null));};exports[_0x8d2a('0x1e')]=function(_0x12c1c,_0x3a2c96){if(_0x12c1c[_0x8d2a('0x50')]['id']){delete _0x12c1c['body']['id'];}return db[_0x8d2a('0x26')][_0x8d2a('0x41')]({'where':{'id':_0x12c1c[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x3a2c96,null))['then'](saveUpdates(_0x12c1c[_0x8d2a('0x50')],null))[_0x8d2a('0x1f')](respondWithResult(_0x3a2c96,null))['catch'](handleError(_0x3a2c96,null));};exports[_0x8d2a('0x20')]=function(_0x2d07a5,_0x4c2f3b){return db[_0x8d2a('0x26')]['find']({'where':{'id':_0x2d07a5[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x4c2f3b,null))[_0x8d2a('0x1f')](removeEntity(_0x4c2f3b,null))[_0x8d2a('0x3e')](handleError(_0x4c2f3b,null));};exports[_0x8d2a('0x51')]=function(_0x6dc9c9,_0x59a9b9,_0x1155a6){var _0x5f0ecc={'raw':!![],'where':{}};var _0x621f17={};var _0x50caf3={'count':0x0,'rows':[]};return db[_0x8d2a('0x26')][_0x8d2a('0x52')]({'where':{'id':_0x6dc9c9[_0x8d2a('0x40')]['id']}})['then'](handleEntityNotFound(_0x59a9b9,null))['then'](function(_0x1fd988){if(_0x1fd988){_0x621f17['model']=_[_0x8d2a('0x2c')](db[_0x8d2a('0x53')][_0x8d2a('0x27')]);_0x621f17[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x6dc9c9[_0x8d2a('0x2b')]);_0x621f17[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x621f17[_0x8d2a('0x29')],_0x621f17[_0x8d2a('0x2b')]);_0x5f0ecc[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x621f17[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x5f0ecc[_0x8d2a('0x2e')]=_0x5f0ecc[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x5f0ecc[_0x8d2a('0x2e')]:_0x621f17[_0x8d2a('0x29')];if(!_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x54')](_0x8d2a('0x32'))){_0x5f0ecc['limit']=qs[_0x8d2a('0x18')](_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x5f0ecc['offset']=qs[_0x8d2a('0x1a')](_0x6dc9c9['query']['offset']);}_0x5f0ecc[_0x8d2a('0x33')]=qs[_0x8d2a('0x34')](_0x6dc9c9['query'][_0x8d2a('0x34')]);_0x5f0ecc[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x6dc9c9[_0x8d2a('0x2b')],_0x621f17['filters']));_0x5f0ecc[_0x8d2a('0x35')][_0x8d2a('0x55')]=_0x1fd988['id'];if(_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x5f0ecc[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x5f0ecc['where'],{'$or':_['map'](_0x5f0ecc[_0x8d2a('0x2e')],function(_0x2ff32f){var _0x116909={};_0x116909[_0x2ff32f]={'$like':'%'+_0x6dc9c9[_0x8d2a('0x2b')]['filter']+'%'};return _0x116909;})});}_0x5f0ecc=_[_0x8d2a('0x37')]({},_0x5f0ecc,_0x6dc9c9[_0x8d2a('0x39')]);return db[_0x8d2a('0x53')][_0x8d2a('0x19')]({'where':_0x5f0ecc['where']})[_0x8d2a('0x1f')](function(_0x30aa34){_0x50caf3['count']=_0x30aa34;if(_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x3a')]){_0x5f0ecc[_0x8d2a('0x3b')]=[{'all':!![]}];}return db[_0x8d2a('0x53')]['findAll'](_0x5f0ecc);})[_0x8d2a('0x1f')](function(_0x53f022){_0x50caf3[_0x8d2a('0x3d')]=_0x53f022;return _0x50caf3;});}})[_0x8d2a('0x1f')](respondWithFilteredResult(_0x59a9b9,_0x5f0ecc))[_0x8d2a('0x3e')](handleError(_0x59a9b9,null));};exports[_0x8d2a('0x57')]=function(_0x468853,_0x134240,_0x210bc3){var _0x45feaf={'raw':!![],'where':{}};var _0x1f63c4={};var _0x429516={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x468853[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x134240,null))[_0x8d2a('0x1f')](function(_0x14b81c){if(_0x14b81c){_0x1f63c4['model']=_['keys'](db[_0x8d2a('0x58')][_0x8d2a('0x27')]);_0x1f63c4[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x468853[_0x8d2a('0x2b')]);_0x1f63c4[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x1f63c4[_0x8d2a('0x29')],_0x1f63c4['query']);_0x45feaf[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x1f63c4['model'],qs['fields'](_0x468853[_0x8d2a('0x2b')]['fields']));_0x45feaf[_0x8d2a('0x2e')]=_0x45feaf[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x45feaf[_0x8d2a('0x2e')]:_0x1f63c4[_0x8d2a('0x29')];if(!_0x468853[_0x8d2a('0x2b')][_0x8d2a('0x54')]('nolimit')){_0x45feaf[_0x8d2a('0x18')]=qs['limit'](_0x468853[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x45feaf['offset']=qs[_0x8d2a('0x1a')](_0x468853['query'][_0x8d2a('0x1a')]);}_0x45feaf[_0x8d2a('0x33')]=qs['sort'](_0x468853['query'][_0x8d2a('0x34')]);_0x45feaf[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_['pick'](_0x468853[_0x8d2a('0x2b')],_0x1f63c4[_0x8d2a('0x2d')]));_0x45feaf[_0x8d2a('0x35')]['CampaignId']=_0x14b81c['id'];if(_0x468853['query']['filter']){_0x45feaf[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x45feaf[_0x8d2a('0x35')],{'$or':_[_0x8d2a('0x2a')](_0x45feaf[_0x8d2a('0x2e')],function(_0x3e0b2b){var _0x31a42a={};_0x31a42a[_0x3e0b2b]={'$like':'%'+_0x468853[_0x8d2a('0x2b')]['filter']+'%'};return _0x31a42a;})});}_0x45feaf=_[_0x8d2a('0x37')]({},_0x45feaf,_0x468853['options']);return db[_0x8d2a('0x58')]['count']({'where':_0x45feaf[_0x8d2a('0x35')]})[_0x8d2a('0x1f')](function(_0x29e872){_0x429516['count']=_0x29e872;if(_0x468853['query'][_0x8d2a('0x3a')]){_0x45feaf[_0x8d2a('0x3b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8d2a('0x3c')](_0x45feaf);})[_0x8d2a('0x1f')](function(_0x5a7f46){_0x429516['rows']=_0x5a7f46;return _0x429516;});}})[_0x8d2a('0x1f')](respondWithFilteredResult(_0x134240,_0x45feaf))[_0x8d2a('0x3e')](handleError(_0x134240,null));};exports[_0x8d2a('0x59')]=function(_0x2176f4,_0x4b5bb7,_0x5646a7){var _0x53a4d0={'raw':!![],'where':{}};var _0x1e5804={};var _0x47d41a={'count':0x0,'rows':[]};return db[_0x8d2a('0x26')][_0x8d2a('0x52')]({'where':{'id':_0x2176f4[_0x8d2a('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b5bb7,null))[_0x8d2a('0x1f')](function(_0x339b3b){if(_0x339b3b){_0x1e5804[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db['CmHopperFinal'][_0x8d2a('0x27')]);_0x1e5804[_0x8d2a('0x2b')]=_['keys'](_0x2176f4[_0x8d2a('0x2b')]);_0x1e5804[_0x8d2a('0x2d')]=_['intersection'](_0x1e5804[_0x8d2a('0x29')],_0x1e5804['query']);_0x53a4d0[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x1e5804[_0x8d2a('0x29')],qs['fields'](_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x53a4d0[_0x8d2a('0x2e')]=_0x53a4d0[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x53a4d0[_0x8d2a('0x2e')]:_0x1e5804[_0x8d2a('0x29')];if(!_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x54')]('nolimit')){_0x53a4d0[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x53a4d0[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x1a')]);}_0x53a4d0[_0x8d2a('0x33')]=qs[_0x8d2a('0x34')](_0x2176f4[_0x8d2a('0x2b')]['sort']);_0x53a4d0[_0x8d2a('0x35')]=qs['filters'](_[_0x8d2a('0x36')](_0x2176f4['query'],_0x1e5804[_0x8d2a('0x2d')]));_0x53a4d0[_0x8d2a('0x35')][_0x8d2a('0x55')]=_0x339b3b['id'];if(_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x53a4d0['where']=_[_0x8d2a('0x37')](_0x53a4d0[_0x8d2a('0x35')],{'$or':_['map'](_0x53a4d0[_0x8d2a('0x2e')],function(_0x1c274c){var _0x15bb8e={};_0x15bb8e[_0x1c274c]={'$like':'%'+_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x56')]+'%'};return _0x15bb8e;})});}_0x53a4d0=_[_0x8d2a('0x37')]({},_0x53a4d0,_0x2176f4[_0x8d2a('0x39')]);return db['CmHopperFinal'][_0x8d2a('0x19')]({'where':_0x53a4d0[_0x8d2a('0x35')]})['then'](function(_0x392482){_0x47d41a[_0x8d2a('0x19')]=_0x392482;if(_0x2176f4[_0x8d2a('0x2b')]['includeAll']){_0x53a4d0[_0x8d2a('0x3b')]=[{'all':!![]}];}return db[_0x8d2a('0x5a')][_0x8d2a('0x3c')](_0x53a4d0);})[_0x8d2a('0x1f')](function(_0x1efa9e){_0x47d41a[_0x8d2a('0x3d')]=_0x1efa9e;return _0x47d41a;});}})['then'](respondWithFilteredResult(_0x4b5bb7,_0x53a4d0))[_0x8d2a('0x3e')](handleError(_0x4b5bb7,null));};exports[_0x8d2a('0x5b')]=function(_0x512bf8,_0x2593d7,_0x4e634c){var _0x2bf366={'raw':!![],'where':{}};var _0x17e63a={};var _0xb7c019={'count':0x0,'rows':[]};return db[_0x8d2a('0x26')]['findOne']({'where':{'id':_0x512bf8[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x2593d7,null))['then'](function(_0x45a902){if(_0x45a902){_0x17e63a[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db[_0x8d2a('0x5c')][_0x8d2a('0x27')]);_0x17e63a[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x512bf8[_0x8d2a('0x2b')]);_0x17e63a[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x17e63a[_0x8d2a('0x29')],_0x17e63a['query']);_0x2bf366[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x17e63a['model'],qs['fields'](_0x512bf8['query'][_0x8d2a('0x30')]));_0x2bf366['attributes']=_0x2bf366[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x2bf366['attributes']:_0x17e63a[_0x8d2a('0x29')];if(!_0x512bf8['query'][_0x8d2a('0x54')](_0x8d2a('0x32'))){_0x2bf366['limit']=qs[_0x8d2a('0x18')](_0x512bf8['query'][_0x8d2a('0x18')]);_0x2bf366[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x1a')]);}_0x2bf366['order']=qs[_0x8d2a('0x34')](_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x34')]);_0x2bf366[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_['pick'](_0x512bf8[_0x8d2a('0x2b')],_0x17e63a[_0x8d2a('0x2d')]));_0x2bf366[_0x8d2a('0x35')][_0x8d2a('0x55')]=_0x45a902['id'];if(_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x2bf366[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x2bf366[_0x8d2a('0x35')],{'$or':_[_0x8d2a('0x2a')](_0x2bf366['attributes'],function(_0x1e6c29){var _0x283b48={};_0x283b48[_0x1e6c29]={'$like':'%'+_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x56')]+'%'};return _0x283b48;})});}_0x2bf366=_[_0x8d2a('0x37')]({},_0x2bf366,_0x512bf8['options']);return db[_0x8d2a('0x5c')]['count']({'where':_0x2bf366[_0x8d2a('0x35')]})['then'](function(_0x113c95){_0xb7c019[_0x8d2a('0x19')]=_0x113c95;if(_0x512bf8['query'][_0x8d2a('0x3a')]){_0x2bf366['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x8d2a('0x3c')](_0x2bf366);})['then'](function(_0x4f0f0e){_0xb7c019[_0x8d2a('0x3d')]=_0x4f0f0e;return _0xb7c019;});}})[_0x8d2a('0x1f')](respondWithFilteredResult(_0x2593d7,_0x2bf366))['catch'](handleError(_0x2593d7,null));};exports[_0x8d2a('0x5d')]=function(_0x1a67e4,_0x5727d,_0x48fdf7){var _0x37e8ae={};var _0x773c7e={};var _0x3e7534;var _0x4c4f09;return db[_0x8d2a('0x26')][_0x8d2a('0x52')]({'where':{'id':_0x1a67e4[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x5727d,null))[_0x8d2a('0x1f')](function(_0x3a4247){if(_0x3a4247){_0x3e7534=_0x3a4247;_0x773c7e[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db[_0x8d2a('0x5e')]['rawAttributes']);_0x773c7e['query']=_[_0x8d2a('0x2c')](_0x1a67e4['query']);_0x773c7e['filters']=_[_0x8d2a('0x2f')](_0x773c7e['model'],_0x773c7e[_0x8d2a('0x2b')]);_0x37e8ae[_0x8d2a('0x2e')]=_['intersection'](_0x773c7e[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x1a67e4['query'][_0x8d2a('0x30')]));_0x37e8ae['attributes']=_0x37e8ae['attributes'][_0x8d2a('0x31')]?_0x37e8ae[_0x8d2a('0x2e')]:_0x773c7e[_0x8d2a('0x29')];_0x37e8ae['order']=qs[_0x8d2a('0x34')](_0x1a67e4['query'][_0x8d2a('0x34')]);_0x37e8ae[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x1a67e4['query'],_0x773c7e[_0x8d2a('0x2d')]));if(_0x1a67e4[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x37e8ae[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x37e8ae[_0x8d2a('0x35')],{'$or':_['map'](_0x37e8ae['attributes'],function(_0x7ac96b){var _0x13b54b={};_0x13b54b[_0x7ac96b]={'$like':'%'+_0x1a67e4[_0x8d2a('0x2b')]['filter']+'%'};return _0x13b54b;})});}_0x37e8ae=_['merge']({},_0x37e8ae,_0x1a67e4[_0x8d2a('0x39')]);return _0x3e7534[_0x8d2a('0x5d')](_0x37e8ae);}})['then'](function(_0x303de5){if(_0x303de5){_0x4c4f09=_0x303de5['length'];if(!_0x1a67e4[_0x8d2a('0x2b')][_0x8d2a('0x54')](_0x8d2a('0x32'))){_0x37e8ae[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x1a67e4[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x37e8ae[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x1a67e4[_0x8d2a('0x2b')]['offset']);}return _0x3e7534[_0x8d2a('0x5d')](_0x37e8ae);}})[_0x8d2a('0x1f')](function(_0x150be4){if(_0x150be4){return _0x150be4?{'count':_0x4c4f09,'rows':_0x150be4}:null;}})['then'](respondWithResult(_0x5727d,null))[_0x8d2a('0x3e')](handleError(_0x5727d,null));};exports[_0x8d2a('0x5f')]=function(_0x31ff46,_0x5aaa5e,_0x8cc053){var _0x402d58,_0xa9edf3;var _0x24e38d=[];var _0x4b9975=moment()[_0x8d2a('0x60')](_0x8d2a('0x61'));return db[_0x8d2a('0x26')][_0x8d2a('0x41')]({'where':{'id':_0x31ff46[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x5aaa5e,null))['then'](function(_0x5bff98){if(_0x5bff98){_0xa9edf3=_0x5bff98;return _0x5bff98[_0x8d2a('0x5f')](_0x31ff46[_0x8d2a('0x50')][_0x8d2a('0x62')],_[_0x8d2a('0x4d')](_0x31ff46[_0x8d2a('0x50')],['ids','id'])||{});}return null;})[_0x8d2a('0x63')](function(_0x2bc211){var _0x4d8e7d;var _0x513ff3;_0x402d58=_0x2bc211||[];var _0x7b9994=[];if(_0x2bc211){for(var _0x413022=0x0;_0x413022<_0x2bc211[_0x8d2a('0x31')];_0x413022+=0x1){var _0x469e44=_0x2bc211[_0x413022]['get']({'plain':!![]});_0xa9edf3[_0x8d2a('0x64')]=_0x31ff46[_0x8d2a('0x50')][_0x8d2a('0x64')]?_0x31ff46[_0x8d2a('0x50')][_0x8d2a('0x64')]:_0xa9edf3[_0x8d2a('0x64')];switch(_0xa9edf3[_0x8d2a('0x64')]){case _0x8d2a('0x65'):_0x4d8e7d=squel[_0x8d2a('0x66')]()[_0x8d2a('0x67')]('cm_hopper')[_0x8d2a('0x68')](['phone',_0x8d2a('0x69'),_0x8d2a('0x6a'),'ListId','CampaignId','createdAt',_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x6d'),_0x8d2a('0x6d'))[_0x8d2a('0x6c')](_0x8d2a('0x6e'),'scheduledAt')[_0x8d2a('0x6c')]('id','ContactId')[_0x8d2a('0x6c')](_0x469e44['CmListId'][_0x8d2a('0x6f')](),_0x8d2a('0x70'))[_0x8d2a('0x6c')](_0x31ff46[_0x8d2a('0x40')]['id'][_0x8d2a('0x6f')](),'CampaignId')['field']('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4f'))[_0x8d2a('0x71')](_0x8d2a('0x72'))['where'](_0x8d2a('0x73'))['where']('ListId\x20=\x20?',_0x469e44[_0x8d2a('0x74')]['toString']())[_0x8d2a('0x35')]('phone\x20IS\x20NOT\x20NULL')[_0x8d2a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x8d2a('0x71')]('cm_hopper_final')[_0x8d2a('0x35')](_0x8d2a('0x75'),_0x31ff46[_0x8d2a('0x40')]['id']['toString']()))[_0x8d2a('0x35')](_0x8d2a('0x76'),squel['select']()[_0x8d2a('0x6c')](_0x8d2a('0x77'))['from']('cm_hopper')[_0x8d2a('0x35')](_0x8d2a('0x75'),_0x31ff46[_0x8d2a('0x40')]['id'][_0x8d2a('0x6f')]())))[_0x8d2a('0x6f')]();break;case _0x8d2a('0x78'):_0x4d8e7d=squel['insert']()[_0x8d2a('0x67')](_0x8d2a('0x79'))[_0x8d2a('0x68')](['phone',_0x8d2a('0x69'),_0x8d2a('0x6a'),_0x8d2a('0x70'),_0x8d2a('0x55'),'createdAt',_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x6d'),_0x8d2a('0x6d'))[_0x8d2a('0x6c')]('NOW()',_0x8d2a('0x69'))[_0x8d2a('0x6c')]('id','ContactId')[_0x8d2a('0x6c')](_0x469e44[_0x8d2a('0x74')]['toString'](),_0x8d2a('0x70'))['field'](_0x31ff46['params']['id']['toString'](),'CampaignId')[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27','createdAt')['field']('\x27'+_0x4b9975+'\x27','updatedAt')['from'](_0x8d2a('0x72'))[_0x8d2a('0x35')]('deletedAt\x20IS\x20NULL')['where'](_0x8d2a('0x7a'),_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')]())[_0x8d2a('0x35')](_0x8d2a('0x7b'))[_0x8d2a('0x35')](_0x8d2a('0x76'),squel['select']()[_0x8d2a('0x6c')]('COALESCE(phone,\x27\x27)')[_0x8d2a('0x71')]('cm_hopper')[_0x8d2a('0x35')](_0x8d2a('0x75'),_0x31ff46[_0x8d2a('0x40')]['id'][_0x8d2a('0x6f')]())))[_0x8d2a('0x6f')]();break;default:_0x4d8e7d=squel[_0x8d2a('0x66')]()[_0x8d2a('0x67')]('cm_hopper')[_0x8d2a('0x68')](['phone',_0x8d2a('0x69'),_0x8d2a('0x6a'),_0x8d2a('0x70'),_0x8d2a('0x55'),_0x8d2a('0x4e'),_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')]('phone',_0x8d2a('0x6d'))[_0x8d2a('0x6c')](_0x8d2a('0x6e'),_0x8d2a('0x69'))[_0x8d2a('0x6c')]('id',_0x8d2a('0x6a'))['field'](_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')](),_0x8d2a('0x70'))[_0x8d2a('0x6c')](_0x31ff46['params']['id'][_0x8d2a('0x6f')](),'CampaignId')[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4f'))['from'](_0x8d2a('0x72'))[_0x8d2a('0x35')](_0x8d2a('0x73'))[_0x8d2a('0x35')](_0x8d2a('0x7a'),_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')]())[_0x8d2a('0x35')](_0x8d2a('0x7b')))[_0x8d2a('0x6f')]();}_0x513ff3=squel['insert']()[_0x8d2a('0x67')](_0x8d2a('0x7c'))[_0x8d2a('0x68')]([_0x8d2a('0x7d'),'scheduledAt','phone',_0x8d2a('0x7e'),'createdAt',_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x7f'),'id')['field'](_0x8d2a('0x6e'),_0x8d2a('0x69'))[_0x8d2a('0x6c')](_0x8d2a('0x80'),_0x8d2a('0x6d'))['field'](_0x8d2a('0x81'),_0x8d2a('0x7e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27','updatedAt')[_0x8d2a('0x71')](_0x8d2a('0x82'),'ci')[_0x8d2a('0x83')](_0x8d2a('0x79'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x8d2a('0x84'),_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')]())[_0x8d2a('0x35')]('h.CampaignId=?',_0x31ff46['params']['id'][_0x8d2a('0x6f')]())[_0x8d2a('0x35')](_0x8d2a('0x85'),_0x4b9975))['toString']();_0x7b9994[_0x8d2a('0x86')](db[_0x8d2a('0x87')][_0x8d2a('0x2b')](_0x4d8e7d));_0x24e38d['push'](db[_0x8d2a('0x87')]['query'](_0x513ff3));}return BPromise['all'](_0x7b9994);}})[_0x8d2a('0x1f')](function(){return BPromise[_0x8d2a('0x88')](_0x24e38d);})[_0x8d2a('0x1f')](function(){return _0x402d58;})['then'](respondWithResult(_0x5aaa5e,null))[_0x8d2a('0x3e')](handleError(_0x5aaa5e,null));};exports[_0x8d2a('0x89')]=function(_0x3e0ca4,_0xd4e83b,_0xbd5d22){return db[_0x8d2a('0x26')]['find']({'where':{'id':_0x3e0ca4[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0xd4e83b,null))[_0x8d2a('0x1f')](function(_0x189295){if(_0x189295){return _0x189295['removeLists'](_0x3e0ca4['query'][_0x8d2a('0x62')]);}})[_0x8d2a('0x1f')](function(_0x1c034d){if(_0x1c034d){return db['CmHopper'][_0x8d2a('0x20')]({'where':{'ListId':_0x3e0ca4[_0x8d2a('0x2b')][_0x8d2a('0x62')],'CampaignId':_0x3e0ca4[_0x8d2a('0x40')]['id']}})['then'](function(){return _0x1c034d;});}})[_0x8d2a('0x1f')](respondWithStatusCode(_0xd4e83b,null))[_0x8d2a('0x3e')](handleError(_0xd4e83b,null));};exports[_0x8d2a('0x8a')]=function(_0x2b3eb2,_0x36c4bb,_0x13f169){var _0x1d0c1e={};var _0x2a564a={};var _0xa006db;var _0x2c55e8;return db[_0x8d2a('0x26')]['findOne']({'where':{'id':_0x2b3eb2[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x36c4bb,null))[_0x8d2a('0x1f')](function(_0x1aeef6){if(_0x1aeef6){_0xa006db=_0x1aeef6;_0x2a564a['model']=_[_0x8d2a('0x2c')](db[_0x8d2a('0x5e')][_0x8d2a('0x27')]);_0x2a564a[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x2b3eb2[_0x8d2a('0x2b')]);_0x2a564a[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x2a564a[_0x8d2a('0x29')],_0x2a564a[_0x8d2a('0x2b')]);_0x1d0c1e[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x2a564a[_0x8d2a('0x29')],qs['fields'](_0x2b3eb2[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x1d0c1e[_0x8d2a('0x2e')]=_0x1d0c1e[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x1d0c1e[_0x8d2a('0x2e')]:_0x2a564a[_0x8d2a('0x29')];_0x1d0c1e[_0x8d2a('0x33')]=qs['sort'](_0x2b3eb2[_0x8d2a('0x2b')]['sort']);_0x1d0c1e[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x2b3eb2['query'],_0x2a564a[_0x8d2a('0x2d')]));if(_0x2b3eb2[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x1d0c1e[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x1d0c1e['where'],{'$or':_[_0x8d2a('0x2a')](_0x1d0c1e['attributes'],function(_0x285056){var _0x343858={};_0x343858[_0x285056]={'$like':'%'+_0x2b3eb2['query'][_0x8d2a('0x56')]+'%'};return _0x343858;})});}_0x1d0c1e=_['merge']({},_0x1d0c1e,_0x2b3eb2[_0x8d2a('0x39')]);return _0xa006db['getBlackLists'](_0x1d0c1e);}})[_0x8d2a('0x1f')](function(_0x1a400a){if(_0x1a400a){_0x2c55e8=_0x1a400a[_0x8d2a('0x31')];if(!_0x2b3eb2[_0x8d2a('0x2b')]['hasOwnProperty'](_0x8d2a('0x32'))){_0x1d0c1e[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x2b3eb2['query'][_0x8d2a('0x18')]);_0x1d0c1e[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x2b3eb2[_0x8d2a('0x2b')]['offset']);}return _0xa006db[_0x8d2a('0x8a')](_0x1d0c1e);}})[_0x8d2a('0x1f')](function(_0x51eaf1){if(_0x51eaf1){return _0x51eaf1?{'count':_0x2c55e8,'rows':_0x51eaf1}:null;}})['then'](respondWithResult(_0x36c4bb,null))[_0x8d2a('0x3e')](handleError(_0x36c4bb,null));};exports['addBlackLists']=function(_0x2622ae,_0x1f3ce7,_0x13d354){var _0x141c0e,_0x426ba3;var _0x4d558d=[];var _0x3487f2=moment()['format'](_0x8d2a('0x61'));return db['Campaign'][_0x8d2a('0x41')]({'where':{'id':_0x2622ae[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x1f3ce7,null))[_0x8d2a('0x1f')](function(_0x32213d){if(_0x32213d){_0x426ba3=_0x32213d;return _0x32213d[_0x8d2a('0x8b')](_0x2622ae['body'][_0x8d2a('0x62')],_[_0x8d2a('0x4d')](_0x2622ae[_0x8d2a('0x50')],['ids','id'])||{});}return null;})[_0x8d2a('0x63')](function(_0x2cc871){var _0x5c8bb2;var _0x75a0ac;_0x141c0e=_0x2cc871||[];var _0x4c0362=[];if(_0x2cc871){for(var _0x2db8d3=0x0;_0x2db8d3<_0x2cc871[_0x8d2a('0x31')];_0x2db8d3+=0x1){var _0xfb8025=_0x2cc871[_0x2db8d3][_0x8d2a('0x44')]({'plain':!![]});_0x5c8bb2=squel['insert']()[_0x8d2a('0x67')](_0x8d2a('0x8c'))[_0x8d2a('0x68')](['phone',_0x8d2a('0x6a'),_0x8d2a('0x70'),_0x8d2a('0x55'),_0x8d2a('0x4e'),_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x6d'),'phone')[_0x8d2a('0x6c')]('id','ContactId')[_0x8d2a('0x6c')](_0xfb8025[_0x8d2a('0x74')][_0x8d2a('0x6f')](),_0x8d2a('0x70'))[_0x8d2a('0x6c')](_0x2622ae['params']['id'][_0x8d2a('0x6f')](),'CampaignId')[_0x8d2a('0x6c')](_0x8d2a('0x6e'),_0x8d2a('0x4e'))['field'](_0x8d2a('0x6e'),_0x8d2a('0x4f'))[_0x8d2a('0x71')](_0x8d2a('0x72'))['where'](_0x8d2a('0x73'))['where']('ListId\x20=\x20?',_0xfb8025[_0x8d2a('0x74')][_0x8d2a('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x4c0362[_0x8d2a('0x86')](db[_0x8d2a('0x87')][_0x8d2a('0x2b')](_0x5c8bb2));}return BPromise[_0x8d2a('0x88')](_0x4c0362);}})['then'](function(){return _0x141c0e;})[_0x8d2a('0x1f')](respondWithResult(_0x1f3ce7,null))[_0x8d2a('0x3e')](handleError(_0x1f3ce7,null));};exports[_0x8d2a('0x8d')]=function(_0x30bc18,_0x18197b,_0x45302b){return db[_0x8d2a('0x26')][_0x8d2a('0x41')]({'where':{'id':_0x30bc18[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x18197b,null))['then'](function(_0x48a063){if(_0x48a063){return _0x48a063[_0x8d2a('0x8d')](_0x30bc18['query'][_0x8d2a('0x62')]);}})[_0x8d2a('0x1f')](function(_0x59427f){if(_0x59427f){return db[_0x8d2a('0x5c')][_0x8d2a('0x20')]({'where':{'ListId':_0x30bc18['query'][_0x8d2a('0x62')],'CampaignId':_0x30bc18['params']['id']}})[_0x8d2a('0x1f')](function(){return _0x59427f;});}})[_0x8d2a('0x1f')](respondWithStatusCode(_0x18197b,null))[_0x8d2a('0x3e')](handleError(_0x18197b,null));}; \ No newline at end of file +var _0xbe99=['Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','send','index','map','Campaign','rawAttributes','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','getHoppers','CmHopper','findAll','rows','findOne','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','scheduledAt','select','field','phone','NOW()','ContactId','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','insert','fromQuery','cmHopperId','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x19fc44,_0x4bca56){var _0x3414ec=function(_0x696b3d){while(--_0x696b3d){_0x19fc44['push'](_0x19fc44['shift']());}};_0x3414ec(++_0x4bca56);}(_0xbe99,0x196));var _0x9be9=function(_0x2b41e8,_0x86e285){_0x2b41e8=_0x2b41e8-0x0;var _0x396ab3=_0xbe99[_0x2b41e8];return _0x396ab3;};'use strict';var emlformat=require(_0x9be9('0x0'));var rimraf=require(_0x9be9('0x1'));var zipdir=require(_0x9be9('0x2'));var jsonpatch=require(_0x9be9('0x3'));var rp=require(_0x9be9('0x4'));var moment=require('moment');var BPromise=require(_0x9be9('0x5'));var Mustache=require('mustache');var util=require(_0x9be9('0x6'));var path=require(_0x9be9('0x7'));var sox=require(_0x9be9('0x8'));var csv=require(_0x9be9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9be9('0xa'));var _=require(_0x9be9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9be9('0xc'));var deskjs=require(_0x9be9('0xd'));var toCsv=require(_0x9be9('0x9'));var querystring=require(_0x9be9('0xe'));var Papa=require(_0x9be9('0xf'));var Redis=require(_0x9be9('0x10'));var authService=require(_0x9be9('0x11'));var qs=require(_0x9be9('0x12'));var as=require(_0x9be9('0x13'));var hardwareService=require(_0x9be9('0x14'));var logger=require(_0x9be9('0x15'))(_0x9be9('0x16'));var utils=require(_0x9be9('0x17'));var config=require(_0x9be9('0x18'));var licenseUtil=require(_0x9be9('0x19'));var db=require(_0x9be9('0x1a'))['db'];function respondWithStatusCode(_0x33c2cd,_0x4b6d99){_0x4b6d99=_0x4b6d99||0xcc;return function(_0x1251e4){if(_0x1251e4){return _0x33c2cd[_0x9be9('0x1b')](_0x4b6d99);}return _0x33c2cd[_0x9be9('0x1c')](_0x4b6d99)[_0x9be9('0x1d')]();};}function respondWithResult(_0x2cc374,_0x50a7fb){_0x50a7fb=_0x50a7fb||0xc8;return function(_0x2798bd){if(_0x2798bd){return _0x2cc374[_0x9be9('0x1c')](_0x50a7fb)[_0x9be9('0x1e')](_0x2798bd);}};}function respondWithFilteredResult(_0x5a8a3d,_0x2d3e45){return function(_0x418c1e){if(_0x418c1e){var _0x3c92cc=typeof _0x2d3e45[_0x9be9('0x1f')]===_0x9be9('0x20')&&typeof _0x2d3e45['limit']===_0x9be9('0x20');var _0x1cbff7=_0x418c1e[_0x9be9('0x21')];var _0x5f2612=_0x3c92cc?0x0:_0x2d3e45['offset'];var _0x9a37a0=_0x3c92cc?_0x418c1e[_0x9be9('0x21')]:_0x2d3e45[_0x9be9('0x1f')]+_0x2d3e45['limit'];var _0x5aeca2;if(_0x9a37a0>=_0x1cbff7){_0x9a37a0=_0x1cbff7;_0x5aeca2=0xc8;}else{_0x5aeca2=0xce;}_0x5a8a3d[_0x9be9('0x1c')](_0x5aeca2);return _0x5a8a3d[_0x9be9('0x22')](_0x9be9('0x23'),_0x5f2612+'-'+_0x9a37a0+'/'+_0x1cbff7)[_0x9be9('0x1e')](_0x418c1e);}return null;};}function patchUpdates(_0x1b041b){return function(_0x3761c7){try{jsonpatch[_0x9be9('0x24')](_0x3761c7,_0x1b041b,!![]);}catch(_0x2c1f2f){return BPromise[_0x9be9('0x25')](_0x2c1f2f);}return _0x3761c7[_0x9be9('0x26')]();};}function saveUpdates(_0xd700ff,_0x100637){return function(_0x599429){if(_0x599429){return _0x599429[_0x9be9('0x27')](_0xd700ff)['then'](function(_0x2d543d){return _0x2d543d;});}return null;};}function removeEntity(_0xf87e6d,_0x451e60){return function(_0x3fe959){if(_0x3fe959){return _0x3fe959['destroy']()[_0x9be9('0x28')](function(){var _0xfb4266=_0x3fe959[_0x9be9('0x29')]({'plain':!![]});var _0x42a486=_0x9be9('0x2a');return db[_0x9be9('0x2b')][_0x9be9('0x2c')]({'where':{'type':_0x42a486,'resourceId':_0xfb4266['id']}})[_0x9be9('0x28')](function(){return _0x3fe959;});})[_0x9be9('0x28')](function(){_0xf87e6d[_0x9be9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195330,_0x2f8466){return function(_0x26db60){if(!_0x26db60){_0x195330[_0x9be9('0x1b')](0x194);}return _0x26db60;};}function handleError(_0x10ac46,_0x54de1f){_0x54de1f=_0x54de1f||0x1f4;return function(_0x22c898){logger[_0x9be9('0x2d')](_0x22c898['stack']);if(_0x22c898[_0x9be9('0x2e')]){delete _0x22c898['name'];}_0x10ac46[_0x9be9('0x1c')](_0x54de1f)[_0x9be9('0x2f')](_0x22c898);};}exports[_0x9be9('0x30')]=function(_0x199cbd,_0x5a527a){var _0x133eca={},_0x3f6fff={},_0xb61721={'count':0x0,'rows':[]};var _0x35665c=_[_0x9be9('0x31')](db[_0x9be9('0x32')][_0x9be9('0x33')],function(_0x3dcb2a){return{'name':_0x3dcb2a['fieldName'],'type':_0x3dcb2a['type'][_0x9be9('0x34')]};});_0x3f6fff['model']=_[_0x9be9('0x31')](_0x35665c,_0x9be9('0x2e'));_0x3f6fff[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x199cbd['query']);_0x3f6fff[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x3f6fff[_0x9be9('0x39')],_0x3f6fff[_0x9be9('0x35')]);_0x133eca[_0x9be9('0x3a')]=_['intersection'](_0x3f6fff[_0x9be9('0x39')],qs['fields'](_0x199cbd['query']['fields']));_0x133eca['attributes']=_0x133eca[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x133eca['attributes']:_0x3f6fff[_0x9be9('0x39')];if(!_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x133eca[_0x9be9('0x3e')]=qs['limit'](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x133eca[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x133eca[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x40')]);_0x133eca[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x199cbd[_0x9be9('0x35')],_0x3f6fff[_0x9be9('0x37')]),_0x35665c);if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]){_0x133eca[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x133eca[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x35665c,function(_0x1c1d9a){if(_0x1c1d9a[_0x9be9('0x45')]!==_0x9be9('0x46')){var _0x56a49d={};_0x56a49d[_0x1c1d9a[_0x9be9('0x2e')]]={'$like':'%'+_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]+'%'};return _0x56a49d;}})});}_0x133eca=_[_0x9be9('0x44')]({},_0x133eca,_0x199cbd[_0x9be9('0x47')]);var _0x51e6fe={'where':_0x133eca[_0x9be9('0x41')]};return db[_0x9be9('0x32')][_0x9be9('0x21')](_0x51e6fe)[_0x9be9('0x28')](function(_0x1f7775){_0xb61721[_0x9be9('0x21')]=_0x1f7775;if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x48')]){_0x133eca[_0x9be9('0x49')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x133eca);})[_0x9be9('0x28')](function(_0x56bf39){_0xb61721['rows']=_0x56bf39;return _0xb61721;})[_0x9be9('0x28')](respondWithFilteredResult(_0x5a527a,_0x133eca))[_0x9be9('0x4a')](handleError(_0x5a527a,null));};exports[_0x9be9('0x4b')]=function(_0x59ed83,_0x5ab632){var _0x24c121={'raw':![],'where':{'id':_0x59ed83[_0x9be9('0x4c')]['id']}},_0x4f4168={};_0x4f4168[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x32')][_0x9be9('0x33')]);_0x4f4168[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x59ed83[_0x9be9('0x35')]);_0x4f4168['filters']=_[_0x9be9('0x38')](_0x4f4168[_0x9be9('0x39')],_0x4f4168[_0x9be9('0x35')]);_0x24c121['attributes']=_[_0x9be9('0x38')](_0x4f4168['model'],qs[_0x9be9('0x4d')](_0x59ed83[_0x9be9('0x35')][_0x9be9('0x4d')]));_0x24c121[_0x9be9('0x3a')]=_0x24c121['attributes']['length']?_0x24c121[_0x9be9('0x3a')]:_0x4f4168[_0x9be9('0x39')];if(_0x59ed83['query'][_0x9be9('0x48')]){_0x24c121[_0x9be9('0x49')]=[{'all':!![]}];}_0x24c121=_[_0x9be9('0x44')]({},_0x24c121,_0x59ed83[_0x9be9('0x47')]);return db[_0x9be9('0x32')][_0x9be9('0x4e')](_0x24c121)[_0x9be9('0x28')](handleEntityNotFound(_0x5ab632,null))[_0x9be9('0x28')](respondWithResult(_0x5ab632,null))[_0x9be9('0x4a')](handleError(_0x5ab632,null));};exports[_0x9be9('0x4f')]=function(_0x1385ac,_0x31faa8){return db['Campaign'][_0x9be9('0x4f')](_0x1385ac[_0x9be9('0x50')],{})[_0x9be9('0x28')](function(_0x31928f){var _0x47e6c8=_0x1385ac['user'][_0x9be9('0x29')]({'plain':!![]});if(!_0x47e6c8)throw new Error(_0x9be9('0x51'));if(_0x47e6c8[_0x9be9('0x52')]===_0x9be9('0x53')){var _0x18450a=_0x31928f['get']({'plain':!![]});var _0x240265=_0x9be9('0x2a');return db['UserProfileSection'][_0x9be9('0x4e')]({'where':{'name':_0x240265,'userProfileId':_0x47e6c8[_0x9be9('0x54')]},'raw':!![]})['then'](function(_0x5a4795){if(_0x5a4795&&_0x5a4795[_0x9be9('0x55')]===0x0){return db[_0x9be9('0x2b')][_0x9be9('0x4f')]({'name':_0x18450a['name'],'resourceId':_0x18450a['id'],'type':_0x5a4795[_0x9be9('0x2e')],'sectionId':_0x5a4795['id']},{})[_0x9be9('0x28')](function(){return _0x31928f;});}else{return _0x31928f;}})[_0x9be9('0x4a')](function(_0x46a7d2){logger[_0x9be9('0x2d')](_0x9be9('0x56'),_0x46a7d2);throw _0x46a7d2;});}return _0x31928f;})[_0x9be9('0x28')](respondWithResult(_0x31faa8,0xc9))[_0x9be9('0x4a')](handleError(_0x31faa8,null));};exports[_0x9be9('0x57')]=function(_0x156637,_0x4dd1d0){var _0x489f39={'where':{'id':_0x156637[_0x9be9('0x4c')]['id']}},_0x5862ef={};_0x5862ef[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x32')][_0x9be9('0x33')]);_0x489f39[_0x9be9('0x3a')]=_[_0x9be9('0x38')](_0x5862ef[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x156637[_0x9be9('0x35')]['fields']));_0x489f39[_0x9be9('0x3a')]=_0x489f39['attributes'][_0x9be9('0x3b')]?_0x489f39[_0x9be9('0x3a')]:_0x5862ef['model'];if(_0x156637[_0x9be9('0x35')][_0x9be9('0x48')]){_0x489f39[_0x9be9('0x49')]=[{'all':!![]}];}_0x489f39=_['merge']({},_0x489f39,_0x156637[_0x9be9('0x47')]);return db[_0x9be9('0x32')][_0x9be9('0x4e')](_0x489f39)[_0x9be9('0x28')](handleEntityNotFound(_0x4dd1d0,null))[_0x9be9('0x28')](function(_0x1b9d96){if(_0x1b9d96){var _0x2e025f=_0x1b9d96['get']({'plain':!![]});_0x2e025f=qs[_0x9be9('0x58')](_0x2e025f,['id',_0x9be9('0x59'),_0x9be9('0x5a')]);_0x156637[_0x9be9('0x50')]=_[_0x9be9('0x58')](_0x156637[_0x9be9('0x50')],['id',_0x9be9('0x59'),_0x9be9('0x5a')]);return db[_0x9be9('0x32')][_0x9be9('0x4f')](_[_0x9be9('0x44')](_0x2e025f,_0x156637['body']),{'include':_0x156637[_0x9be9('0x35')][_0x9be9('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x4bc3f0){var _0x2d0f36=_0x156637[_0x9be9('0x53')][_0x9be9('0x29')]({'plain':!![]});if(!_0x2d0f36)throw new Error(_0x9be9('0x51'));if(_0x2d0f36[_0x9be9('0x52')]==='user'){var _0x4dcf4d=_0x4bc3f0[_0x9be9('0x29')]({'plain':!![]});var _0x3bf990=_0x9be9('0x2a');return db[_0x9be9('0x5b')][_0x9be9('0x4e')]({'where':{'name':_0x3bf990,'userProfileId':_0x2d0f36[_0x9be9('0x54')]},'raw':!![]})[_0x9be9('0x28')](function(_0x11d7e9){if(_0x11d7e9&&_0x11d7e9['autoAssociation']===0x0){return db[_0x9be9('0x2b')][_0x9be9('0x4f')]({'name':_0x4dcf4d[_0x9be9('0x2e')],'resourceId':_0x4dcf4d['id'],'type':_0x11d7e9[_0x9be9('0x2e')],'sectionId':_0x11d7e9['id']},{})['then'](function(){return _0x4bc3f0;});}else{return _0x4bc3f0;}})[_0x9be9('0x4a')](function(_0x32d4ba){logger[_0x9be9('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32d4ba);throw _0x32d4ba;});}return _0x4bc3f0;});}})[_0x9be9('0x28')](respondWithResult(_0x4dd1d0,0xc9))[_0x9be9('0x4a')](handleError(_0x4dd1d0,null));};exports['update']=function(_0xcb0a1c,_0x5e961f){if(_0xcb0a1c['body']['id']){delete _0xcb0a1c[_0x9be9('0x50')]['id'];}return db['Campaign']['find']({'where':{'id':_0xcb0a1c[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x5e961f,null))[_0x9be9('0x28')](saveUpdates(_0xcb0a1c[_0x9be9('0x50')],null))[_0x9be9('0x28')](respondWithResult(_0x5e961f,null))[_0x9be9('0x4a')](handleError(_0x5e961f,null));};exports['destroy']=function(_0x37e5f9,_0xb101cc){return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x37e5f9[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb101cc,null))[_0x9be9('0x28')](removeEntity(_0xb101cc,null))[_0x9be9('0x4a')](handleError(_0xb101cc,null));};exports[_0x9be9('0x5c')]=function(_0x4dd055,_0x502d7b,_0x1f0623){var _0x179c64={'raw':!![],'where':{}};var _0x2425e0={};var _0x36a097={'count':0x0,'rows':[]};return db[_0x9be9('0x32')]['findOne']({'where':{'id':_0x4dd055[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x502d7b,null))[_0x9be9('0x28')](function(_0x133801){if(_0x133801){_0x2425e0['model']=_[_0x9be9('0x36')](db[_0x9be9('0x5d')][_0x9be9('0x33')]);_0x2425e0['query']=_[_0x9be9('0x36')](_0x4dd055[_0x9be9('0x35')]);_0x2425e0[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x2425e0[_0x9be9('0x39')],_0x2425e0[_0x9be9('0x35')]);_0x179c64['attributes']=_['intersection'](_0x2425e0[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x4dd055[_0x9be9('0x35')]['fields']));_0x179c64['attributes']=_0x179c64[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x179c64[_0x9be9('0x3a')]:_0x2425e0[_0x9be9('0x39')];if(!_0x4dd055[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x179c64[_0x9be9('0x3e')]=qs['limit'](_0x4dd055['query'][_0x9be9('0x3e')]);_0x179c64[_0x9be9('0x1f')]=qs['offset'](_0x4dd055[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x179c64[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x4dd055[_0x9be9('0x35')][_0x9be9('0x40')]);_0x179c64[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x4dd055['query'],_0x2425e0[_0x9be9('0x37')]));_0x179c64['where']['CampaignId']=_0x133801['id'];if(_0x4dd055[_0x9be9('0x35')]['filter']){_0x179c64['where']=_[_0x9be9('0x44')](_0x179c64['where'],{'$or':_[_0x9be9('0x31')](_0x179c64[_0x9be9('0x3a')],function(_0x230c0b){var _0x5a617a={};_0x5a617a[_0x230c0b]={'$like':'%'+_0x4dd055['query']['filter']+'%'};return _0x5a617a;})});}_0x179c64=_[_0x9be9('0x44')]({},_0x179c64,_0x4dd055[_0x9be9('0x47')]);return db[_0x9be9('0x5d')][_0x9be9('0x21')]({'where':_0x179c64[_0x9be9('0x41')]})['then'](function(_0x2f0478){_0x36a097[_0x9be9('0x21')]=_0x2f0478;if(_0x4dd055[_0x9be9('0x35')][_0x9be9('0x48')]){_0x179c64[_0x9be9('0x49')]=[{'all':!![]}];}return db[_0x9be9('0x5d')][_0x9be9('0x5e')](_0x179c64);})['then'](function(_0x3f3684){_0x36a097[_0x9be9('0x5f')]=_0x3f3684;return _0x36a097;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x502d7b,_0x179c64))[_0x9be9('0x4a')](handleError(_0x502d7b,null));};exports['getHopperHistories']=function(_0x385c5d,_0x314816,_0x4ce25a){var _0x3a21eb={'raw':!![],'where':{}};var _0x348ecc={};var _0x5b9c66={'count':0x0,'rows':[]};return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x385c5d['params']['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x314816,null))[_0x9be9('0x28')](function(_0x2e97c9){if(_0x2e97c9){_0x348ecc[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x61')][_0x9be9('0x33')]);_0x348ecc[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x385c5d[_0x9be9('0x35')]);_0x348ecc['filters']=_[_0x9be9('0x38')](_0x348ecc[_0x9be9('0x39')],_0x348ecc[_0x9be9('0x35')]);_0x3a21eb['attributes']=_[_0x9be9('0x38')](_0x348ecc[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x385c5d['query'][_0x9be9('0x4d')]));_0x3a21eb[_0x9be9('0x3a')]=_0x3a21eb[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x3a21eb[_0x9be9('0x3a')]:_0x348ecc['model'];if(!_0x385c5d['query']['hasOwnProperty'](_0x9be9('0x3d'))){_0x3a21eb['limit']=qs[_0x9be9('0x3e')](_0x385c5d['query'][_0x9be9('0x3e')]);_0x3a21eb['offset']=qs['offset'](_0x385c5d[_0x9be9('0x35')]['offset']);}_0x3a21eb[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x385c5d[_0x9be9('0x35')][_0x9be9('0x40')]);_0x3a21eb['where']=qs['filters'](_['pick'](_0x385c5d[_0x9be9('0x35')],_0x348ecc[_0x9be9('0x37')]));_0x3a21eb[_0x9be9('0x41')][_0x9be9('0x62')]=_0x2e97c9['id'];if(_0x385c5d[_0x9be9('0x35')][_0x9be9('0x43')]){_0x3a21eb[_0x9be9('0x41')]=_['merge'](_0x3a21eb[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x3a21eb[_0x9be9('0x3a')],function(_0x52e019){var _0xbb5e51={};_0xbb5e51[_0x52e019]={'$like':'%'+_0x385c5d['query']['filter']+'%'};return _0xbb5e51;})});}_0x3a21eb=_[_0x9be9('0x44')]({},_0x3a21eb,_0x385c5d[_0x9be9('0x47')]);return db[_0x9be9('0x61')][_0x9be9('0x21')]({'where':_0x3a21eb[_0x9be9('0x41')]})[_0x9be9('0x28')](function(_0x1d6019){_0x5b9c66[_0x9be9('0x21')]=_0x1d6019;if(_0x385c5d[_0x9be9('0x35')]['includeAll']){_0x3a21eb['include']=[{'all':!![]}];}return db[_0x9be9('0x61')][_0x9be9('0x5e')](_0x3a21eb);})[_0x9be9('0x28')](function(_0x5464df){_0x5b9c66['rows']=_0x5464df;return _0x5b9c66;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x314816,_0x3a21eb))[_0x9be9('0x4a')](handleError(_0x314816,null));};exports['getHopperFinals']=function(_0x2b6511,_0x11a231,_0x3e3352){var _0x44b2d5={'raw':!![],'where':{}};var _0x18c40b={};var _0x1054aa={'count':0x0,'rows':[]};return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x2b6511['params']['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x11a231,null))[_0x9be9('0x28')](function(_0x1722ff){if(_0x1722ff){_0x18c40b[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x63')][_0x9be9('0x33')]);_0x18c40b['query']=_[_0x9be9('0x36')](_0x2b6511[_0x9be9('0x35')]);_0x18c40b[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x18c40b[_0x9be9('0x39')],_0x18c40b[_0x9be9('0x35')]);_0x44b2d5[_0x9be9('0x3a')]=_[_0x9be9('0x38')](_0x18c40b['model'],qs[_0x9be9('0x4d')](_0x2b6511['query'][_0x9be9('0x4d')]));_0x44b2d5[_0x9be9('0x3a')]=_0x44b2d5[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x44b2d5[_0x9be9('0x3a')]:_0x18c40b[_0x9be9('0x39')];if(!_0x2b6511[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x44b2d5[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x2b6511[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x44b2d5[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x2b6511[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x44b2d5[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x2b6511['query']['sort']);_0x44b2d5[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x2b6511[_0x9be9('0x35')],_0x18c40b[_0x9be9('0x37')]));_0x44b2d5[_0x9be9('0x41')][_0x9be9('0x62')]=_0x1722ff['id'];if(_0x2b6511[_0x9be9('0x35')][_0x9be9('0x43')]){_0x44b2d5[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x44b2d5[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x44b2d5[_0x9be9('0x3a')],function(_0x5576f7){var _0x414357={};_0x414357[_0x5576f7]={'$like':'%'+_0x2b6511[_0x9be9('0x35')]['filter']+'%'};return _0x414357;})});}_0x44b2d5=_['merge']({},_0x44b2d5,_0x2b6511['options']);return db[_0x9be9('0x63')][_0x9be9('0x21')]({'where':_0x44b2d5[_0x9be9('0x41')]})[_0x9be9('0x28')](function(_0x46abb4){_0x1054aa[_0x9be9('0x21')]=_0x46abb4;if(_0x2b6511[_0x9be9('0x35')]['includeAll']){_0x44b2d5[_0x9be9('0x49')]=[{'all':!![]}];}return db[_0x9be9('0x63')][_0x9be9('0x5e')](_0x44b2d5);})[_0x9be9('0x28')](function(_0x56ea74){_0x1054aa[_0x9be9('0x5f')]=_0x56ea74;return _0x1054aa;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x11a231,_0x44b2d5))['catch'](handleError(_0x11a231,null));};exports[_0x9be9('0x64')]=function(_0x5be199,_0x3e6908,_0x172351){var _0x3e3fab={'raw':!![],'where':{}};var _0x536259={};var _0x2e24c7={'count':0x0,'rows':[]};return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x5be199[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x3e6908,null))[_0x9be9('0x28')](function(_0x55c9e9){if(_0x55c9e9){_0x536259[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x65')][_0x9be9('0x33')]);_0x536259[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x5be199[_0x9be9('0x35')]);_0x536259[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x536259[_0x9be9('0x39')],_0x536259[_0x9be9('0x35')]);_0x3e3fab[_0x9be9('0x3a')]=_[_0x9be9('0x38')](_0x536259[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x5be199['query'][_0x9be9('0x4d')]));_0x3e3fab[_0x9be9('0x3a')]=_0x3e3fab[_0x9be9('0x3a')]['length']?_0x3e3fab[_0x9be9('0x3a')]:_0x536259[_0x9be9('0x39')];if(!_0x5be199['query']['hasOwnProperty'](_0x9be9('0x3d'))){_0x3e3fab[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x5be199['query'][_0x9be9('0x3e')]);_0x3e3fab['offset']=qs[_0x9be9('0x1f')](_0x5be199[_0x9be9('0x35')]['offset']);}_0x3e3fab[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x5be199[_0x9be9('0x35')][_0x9be9('0x40')]);_0x3e3fab[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x5be199[_0x9be9('0x35')],_0x536259[_0x9be9('0x37')]));_0x3e3fab[_0x9be9('0x41')][_0x9be9('0x62')]=_0x55c9e9['id'];if(_0x5be199[_0x9be9('0x35')]['filter']){_0x3e3fab[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x3e3fab[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x3e3fab[_0x9be9('0x3a')],function(_0x366d2d){var _0x1a01dc={};_0x1a01dc[_0x366d2d]={'$like':'%'+_0x5be199[_0x9be9('0x35')]['filter']+'%'};return _0x1a01dc;})});}_0x3e3fab=_['merge']({},_0x3e3fab,_0x5be199[_0x9be9('0x47')]);return db[_0x9be9('0x65')][_0x9be9('0x21')]({'where':_0x3e3fab[_0x9be9('0x41')]})[_0x9be9('0x28')](function(_0x3c2dd6){_0x2e24c7[_0x9be9('0x21')]=_0x3c2dd6;if(_0x5be199[_0x9be9('0x35')]['includeAll']){_0x3e3fab['include']=[{'all':!![]}];}return db[_0x9be9('0x65')][_0x9be9('0x5e')](_0x3e3fab);})[_0x9be9('0x28')](function(_0x2300ed){_0x2e24c7[_0x9be9('0x5f')]=_0x2300ed;return _0x2e24c7;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x3e6908,_0x3e3fab))['catch'](handleError(_0x3e6908,null));};exports[_0x9be9('0x66')]=function(_0x244992,_0x4a4aa9,_0x24e468){var _0x1cbb84={};var _0xbdd102={};var _0x11f44d;var _0x5f5263;return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x244992[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a4aa9,null))[_0x9be9('0x28')](function(_0x538e7e){if(_0x538e7e){_0x11f44d=_0x538e7e;_0xbdd102[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x67')][_0x9be9('0x33')]);_0xbdd102[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x244992['query']);_0xbdd102[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0xbdd102[_0x9be9('0x39')],_0xbdd102[_0x9be9('0x35')]);_0x1cbb84[_0x9be9('0x3a')]=_['intersection'](_0xbdd102[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x244992[_0x9be9('0x35')][_0x9be9('0x4d')]));_0x1cbb84[_0x9be9('0x3a')]=_0x1cbb84[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x1cbb84[_0x9be9('0x3a')]:_0xbdd102[_0x9be9('0x39')];_0x1cbb84[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x244992[_0x9be9('0x35')][_0x9be9('0x40')]);_0x1cbb84[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x244992[_0x9be9('0x35')],_0xbdd102['filters']));if(_0x244992[_0x9be9('0x35')]['filter']){_0x1cbb84[_0x9be9('0x41')]=_['merge'](_0x1cbb84['where'],{'$or':_[_0x9be9('0x31')](_0x1cbb84['attributes'],function(_0x34a538){var _0x5023ff={};_0x5023ff[_0x34a538]={'$like':'%'+_0x244992[_0x9be9('0x35')]['filter']+'%'};return _0x5023ff;})});}_0x1cbb84=_[_0x9be9('0x44')]({},_0x1cbb84,_0x244992[_0x9be9('0x47')]);return _0x11f44d['getLists'](_0x1cbb84);}})[_0x9be9('0x28')](function(_0x5b06a2){if(_0x5b06a2){_0x5f5263=_0x5b06a2[_0x9be9('0x3b')];if(!_0x244992['query'][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x1cbb84[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x244992[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x1cbb84[_0x9be9('0x1f')]=qs['offset'](_0x244992['query'][_0x9be9('0x1f')]);}return _0x11f44d[_0x9be9('0x66')](_0x1cbb84);}})[_0x9be9('0x28')](function(_0x22cb72){if(_0x22cb72){return _0x22cb72?{'count':_0x5f5263,'rows':_0x22cb72}:null;}})['then'](respondWithResult(_0x4a4aa9,null))['catch'](handleError(_0x4a4aa9,null));};exports[_0x9be9('0x68')]=function(_0x38ffff,_0x19c4d0,_0x5cb511){var _0x146977,_0x42bd13;var _0x4a6162=[];var _0x485f2a=moment()[_0x9be9('0x69')](_0x9be9('0x6a'));return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x38ffff[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x19c4d0,null))[_0x9be9('0x28')](function(_0xa37285){if(_0xa37285){_0x42bd13=_0xa37285;return _0xa37285[_0x9be9('0x68')](_0x38ffff[_0x9be9('0x50')][_0x9be9('0x6b')],_[_0x9be9('0x58')](_0x38ffff[_0x9be9('0x50')],[_0x9be9('0x6b'),'id'])||{});}return null;})[_0x9be9('0x6c')](function(_0x4a1b0a){var _0x1189ad;var _0x421383;_0x146977=_0x4a1b0a||[];var _0x399015=[];if(_0x4a1b0a){for(var _0x184724=0x0;_0x184724<_0x4a1b0a[_0x9be9('0x3b')];_0x184724+=0x1){var _0x23f523=_0x4a1b0a[_0x184724][_0x9be9('0x29')]({'plain':!![]});_0x42bd13[_0x9be9('0x6d')]=_0x38ffff['body'][_0x9be9('0x6d')]?_0x38ffff[_0x9be9('0x50')][_0x9be9('0x6d')]:_0x42bd13['dialCheckDuplicateType'];switch(_0x42bd13[_0x9be9('0x6d')]){case'always':_0x1189ad=squel['insert']()[_0x9be9('0x6e')]('cm_hopper')['fromQuery'](['phone',_0x9be9('0x6f'),'ContactId','ListId','CampaignId',_0x9be9('0x59'),_0x9be9('0x5a')],squel[_0x9be9('0x70')]()[_0x9be9('0x71')](_0x9be9('0x72'),_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x73'),'scheduledAt')[_0x9be9('0x71')]('id',_0x9be9('0x74'))[_0x9be9('0x71')](_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')](),_0x9be9('0x77'))['field'](_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x5a'))[_0x9be9('0x78')]('cm_contacts')[_0x9be9('0x41')](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')]())[_0x9be9('0x41')](_0x9be9('0x7b'))['where'](_0x9be9('0x7c'),squel['select']()[_0x9be9('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x9be9('0x78')]('cm_hopper_final')[_0x9be9('0x41')]('CampaignId\x20=\x20?',_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')]()))[_0x9be9('0x41')](_0x9be9('0x7c'),squel['select']()[_0x9be9('0x71')](_0x9be9('0x7d'))['from'](_0x9be9('0x7e'))[_0x9be9('0x41')]('CampaignId\x20=\x20?',_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')]())))[_0x9be9('0x76')]();break;case _0x9be9('0x7f'):_0x1189ad=squel['insert']()[_0x9be9('0x6e')](_0x9be9('0x7e'))['fromQuery']([_0x9be9('0x72'),'scheduledAt','ContactId',_0x9be9('0x77'),_0x9be9('0x62'),_0x9be9('0x59'),_0x9be9('0x5a')],squel['select']()['field'](_0x9be9('0x72'),_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x73'),'scheduledAt')[_0x9be9('0x71')]('id','ContactId')[_0x9be9('0x71')](_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')](),_0x9be9('0x77'))[_0x9be9('0x71')](_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x5a'))[_0x9be9('0x78')](_0x9be9('0x80'))['where'](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')]())['where'](_0x9be9('0x7b'))[_0x9be9('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9be9('0x70')]()[_0x9be9('0x71')]('COALESCE(phone,\x27\x27)')['from'](_0x9be9('0x7e'))[_0x9be9('0x41')]('CampaignId\x20=\x20?',_0x38ffff[_0x9be9('0x4c')]['id']['toString']())))[_0x9be9('0x76')]();break;default:_0x1189ad=squel[_0x9be9('0x81')]()[_0x9be9('0x6e')]('cm_hopper')[_0x9be9('0x82')]([_0x9be9('0x72'),_0x9be9('0x6f'),_0x9be9('0x74'),_0x9be9('0x77'),_0x9be9('0x62'),_0x9be9('0x59'),_0x9be9('0x5a')],squel[_0x9be9('0x70')]()[_0x9be9('0x71')]('phone',_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x73'),_0x9be9('0x6f'))[_0x9be9('0x71')]('id',_0x9be9('0x74'))['field'](_0x23f523[_0x9be9('0x75')]['toString'](),'ListId')[_0x9be9('0x71')](_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))['field']('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27','updatedAt')[_0x9be9('0x78')]('cm_contacts')[_0x9be9('0x41')](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')]())[_0x9be9('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x9be9('0x76')]();}_0x421383=squel[_0x9be9('0x81')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x9be9('0x83'),_0x9be9('0x6f'),'phone',_0x9be9('0x84'),_0x9be9('0x59'),_0x9be9('0x5a')],squel['select']()[_0x9be9('0x71')](_0x9be9('0x85'),'id')['field']('NOW()',_0x9be9('0x6f'))['field']('ci.item',_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x86'),_0x9be9('0x84'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))['field']('\x27'+_0x485f2a+'\x27',_0x9be9('0x5a'))[_0x9be9('0x78')](_0x9be9('0x87'),'ci')[_0x9be9('0x88')](_0x9be9('0x7e'),'h',_0x9be9('0x89'))[_0x9be9('0x41')](_0x9be9('0x8a'),_0x23f523['CmListId'][_0x9be9('0x76')]())[_0x9be9('0x41')](_0x9be9('0x8b'),_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')]())[_0x9be9('0x41')]('h.createdAt\x20=\x20?',_0x485f2a))[_0x9be9('0x76')]();_0x399015['push'](db['sequelize'][_0x9be9('0x35')](_0x1189ad));_0x4a6162[_0x9be9('0x8c')](db[_0x9be9('0x8d')][_0x9be9('0x35')](_0x421383));}return BPromise[_0x9be9('0x8e')](_0x399015);}})[_0x9be9('0x28')](function(){return BPromise[_0x9be9('0x8e')](_0x4a6162);})[_0x9be9('0x28')](function(){return _0x146977;})[_0x9be9('0x28')](respondWithResult(_0x19c4d0,null))[_0x9be9('0x4a')](handleError(_0x19c4d0,null));};exports[_0x9be9('0x8f')]=function(_0x2e2cdf,_0x37b5fa,_0x233e0b){return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x2e2cdf[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37b5fa,null))[_0x9be9('0x28')](function(_0x4e624b){if(_0x4e624b){return _0x4e624b[_0x9be9('0x8f')](_0x2e2cdf['query'][_0x9be9('0x6b')]);}})[_0x9be9('0x28')](function(_0x34a5e2){if(_0x34a5e2){return db[_0x9be9('0x5d')]['destroy']({'where':{'ListId':_0x2e2cdf['query'][_0x9be9('0x6b')],'CampaignId':_0x2e2cdf[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](function(){return _0x34a5e2;});}})[_0x9be9('0x28')](respondWithStatusCode(_0x37b5fa,null))[_0x9be9('0x4a')](handleError(_0x37b5fa,null));};exports[_0x9be9('0x90')]=function(_0x945e1a,_0x25a5bc,_0x49d1ee){var _0x4c0d0e={};var _0x3e9851={};var _0x1b3bd4;var _0x3855a0;return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x945e1a[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25a5bc,null))[_0x9be9('0x28')](function(_0x15cf5e){if(_0x15cf5e){_0x1b3bd4=_0x15cf5e;_0x3e9851[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x67')]['rawAttributes']);_0x3e9851['query']=_[_0x9be9('0x36')](_0x945e1a[_0x9be9('0x35')]);_0x3e9851['filters']=_['intersection'](_0x3e9851[_0x9be9('0x39')],_0x3e9851['query']);_0x4c0d0e['attributes']=_[_0x9be9('0x38')](_0x3e9851[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x945e1a['query'][_0x9be9('0x4d')]));_0x4c0d0e['attributes']=_0x4c0d0e[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x4c0d0e['attributes']:_0x3e9851['model'];_0x4c0d0e[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x945e1a[_0x9be9('0x35')][_0x9be9('0x40')]);_0x4c0d0e[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_['pick'](_0x945e1a[_0x9be9('0x35')],_0x3e9851[_0x9be9('0x37')]));if(_0x945e1a[_0x9be9('0x35')][_0x9be9('0x43')]){_0x4c0d0e[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x4c0d0e[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x4c0d0e[_0x9be9('0x3a')],function(_0x2c54b2){var _0x580312={};_0x580312[_0x2c54b2]={'$like':'%'+_0x945e1a['query'][_0x9be9('0x43')]+'%'};return _0x580312;})});}_0x4c0d0e=_[_0x9be9('0x44')]({},_0x4c0d0e,_0x945e1a[_0x9be9('0x47')]);return _0x1b3bd4['getBlackLists'](_0x4c0d0e);}})['then'](function(_0x5b643b){if(_0x5b643b){_0x3855a0=_0x5b643b[_0x9be9('0x3b')];if(!_0x945e1a[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x4c0d0e[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x945e1a[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x4c0d0e[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x945e1a[_0x9be9('0x35')][_0x9be9('0x1f')]);}return _0x1b3bd4[_0x9be9('0x90')](_0x4c0d0e);}})[_0x9be9('0x28')](function(_0x412b53){if(_0x412b53){return _0x412b53?{'count':_0x3855a0,'rows':_0x412b53}:null;}})[_0x9be9('0x28')](respondWithResult(_0x25a5bc,null))[_0x9be9('0x4a')](handleError(_0x25a5bc,null));};exports[_0x9be9('0x91')]=function(_0x1d2e3e,_0x639d41,_0x299ffc){var _0x308eca,_0x4fe7e5;var _0x49be00=[];var _0x58fc7d=moment()['format'](_0x9be9('0x6a'));return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x1d2e3e[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x639d41,null))[_0x9be9('0x28')](function(_0x2db33b){if(_0x2db33b){_0x4fe7e5=_0x2db33b;return _0x2db33b['addBlackLists'](_0x1d2e3e[_0x9be9('0x50')][_0x9be9('0x6b')],_[_0x9be9('0x58')](_0x1d2e3e[_0x9be9('0x50')],['ids','id'])||{});}return null;})['spread'](function(_0x3c1cfa){var _0x81087f;var _0xb6b1f9;_0x308eca=_0x3c1cfa||[];var _0x3684fd=[];if(_0x3c1cfa){for(var _0x4a2f1e=0x0;_0x4a2f1e<_0x3c1cfa['length'];_0x4a2f1e+=0x1){var _0x756c25=_0x3c1cfa[_0x4a2f1e][_0x9be9('0x29')]({'plain':!![]});_0x81087f=squel[_0x9be9('0x81')]()[_0x9be9('0x6e')]('cm_hopper_black')['fromQuery']([_0x9be9('0x72'),'ContactId',_0x9be9('0x77'),'CampaignId','createdAt','updatedAt'],squel[_0x9be9('0x70')]()[_0x9be9('0x71')]('phone','phone')['field']('id',_0x9be9('0x74'))['field'](_0x756c25[_0x9be9('0x75')]['toString'](),_0x9be9('0x77'))[_0x9be9('0x71')](_0x1d2e3e[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))[_0x9be9('0x71')](_0x9be9('0x73'),_0x9be9('0x59'))[_0x9be9('0x71')](_0x9be9('0x73'),_0x9be9('0x5a'))[_0x9be9('0x78')]('cm_contacts')[_0x9be9('0x41')](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x756c25[_0x9be9('0x75')][_0x9be9('0x76')]())[_0x9be9('0x41')](_0x9be9('0x7b')))[_0x9be9('0x76')]();_0x3684fd[_0x9be9('0x8c')](db[_0x9be9('0x8d')][_0x9be9('0x35')](_0x81087f));}return BPromise[_0x9be9('0x8e')](_0x3684fd);}})[_0x9be9('0x28')](function(){return _0x308eca;})['then'](respondWithResult(_0x639d41,null))[_0x9be9('0x4a')](handleError(_0x639d41,null));};exports['removeBlackLists']=function(_0x3f32fd,_0x40ec04,_0x30965b){return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x3f32fd[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x40ec04,null))[_0x9be9('0x28')](function(_0x185b20){if(_0x185b20){return _0x185b20[_0x9be9('0x92')](_0x3f32fd[_0x9be9('0x35')][_0x9be9('0x6b')]);}})[_0x9be9('0x28')](function(_0x199e54){if(_0x199e54){return db[_0x9be9('0x65')]['destroy']({'where':{'ListId':_0x3f32fd['query'][_0x9be9('0x6b')],'CampaignId':_0x3f32fd[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](function(){return _0x199e54;});}})[_0x9be9('0x28')](respondWithStatusCode(_0x40ec04,null))['catch'](handleError(_0x40ec04,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index b2b80fd..47e5806 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x4f51cb,_0x3d7bd4){var _0x4b34b1=function(_0x1bab33){while(--_0x1bab33){_0x4f51cb['push'](_0x4f51cb['shift']());}};_0x4b34b1(++_0x3d7bd4);}(_0x7a54,0x106));var _0x47a5=function(_0x1b4a7b,_0x42cf67){_0x1b4a7b=_0x1b4a7b-0x0;var _0x4478aa=_0x7a54[_0x1b4a7b];return _0x4478aa;};'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 b67475e..b9b4f37 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 _0xdecb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','findAll','options','raw','where','include','map','attributes','model','stringify','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x530129,_0x5cf11f){var _0x408ac5=function(_0x27715e){while(--_0x27715e){_0x530129['push'](_0x530129['shift']());}};_0x408ac5(++_0x5cf11f);}(_0xdecb,0xe2));var _0xbdec=function(_0x5b78f4,_0x4a20e0){_0x5b78f4=_0x5b78f4-0x0;var _0x32bcab=_0xdecb[_0x5b78f4];return _0x32bcab;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var moment=require(_0xbdec('0x1'));var BPromise=require(_0xbdec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdec('0x4'));var logger=require(_0xbdec('0x5'))(_0xbdec('0x6'));var config=require(_0xbdec('0x7'));var jayson=require(_0xbdec('0x8'));var client=jayson[_0xbdec('0x9')][_0xbdec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x532f8e,_0x32d039,_0x22f7d4){return new BPromise(function(_0x2e8942,_0x298770){return client[_0xbdec('0xb')](_0x532f8e,_0x22f7d4)[_0xbdec('0xc')](function(_0x2333f6){logger[_0xbdec('0xd')]('Campaign,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));logger[_0xbdec('0xf')](_0xbdec('0x10'),_0x32d039,_0xbdec('0xe'),JSON['stringify'](_0x2333f6));if(_0x2333f6[_0xbdec('0x11')]){if(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x12')]===0x1f4){logger['error'](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x298770(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x2e8942(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}else{logger[_0xbdec('0xd')]('Campaign,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));_0x2e8942(_0x2333f6[_0xbdec('0x15')][_0xbdec('0x14')]);}})[_0xbdec('0x16')](function(_0x324378){logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x324378);_0x298770(_0x324378);});});}exports[_0xbdec('0x17')]=function(_0x2b9288){var _0x4f7879=this;return new Promise(function(_0x1206b8,_0x5da657){return db['Campaign'][_0xbdec('0x18')]({'raw':_0x2b9288[_0xbdec('0x19')]?_0x2b9288[_0xbdec('0x19')][_0xbdec('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b9288[_0xbdec('0x19')]?_0x2b9288['options'][_0xbdec('0x1b')]||null:null,'attributes':_0x2b9288['options']?_0x2b9288[_0xbdec('0x19')]['attributes']||null:null,'limit':_0x2b9288['options']?_0x2b9288[_0xbdec('0x19')]['limit']||null:null,'include':_0x2b9288[_0xbdec('0x19')]?_0x2b9288['options'][_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x2b9288[_0xbdec('0x19')][_0xbdec('0x1c')],function(_0x1a93e1){return{'model':db[_0x1a93e1['model']],'as':_0x1a93e1['as'],'attributes':_0x1a93e1[_0xbdec('0x1e')],'include':_0x1a93e1[_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x1a93e1[_0xbdec('0x1c')],function(_0x45eb56){return{'model':db[_0x45eb56[_0xbdec('0x1f')]],'as':_0x45eb56['as'],'attributes':_0x45eb56[_0xbdec('0x1e')],'include':_0x45eb56[_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x45eb56['include'],function(_0x5aae12){return{'model':db[_0x5aae12['model']],'as':_0x5aae12['as'],'attributes':_0x5aae12['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdec('0xc')](function(_0x3b67bc){logger[_0xbdec('0xd')](_0xbdec('0x17'),_0x2b9288);logger[_0xbdec('0xf')]('GetCampaign',_0x2b9288,JSON[_0xbdec('0x20')](_0x3b67bc));_0x1206b8(_0x3b67bc);})[_0xbdec('0x16')](function(_0x11c971){logger[_0xbdec('0x11')]('GetCampaign',_0x11c971[_0xbdec('0x14')],_0x2b9288);_0x5da657(_0x4f7879[_0xbdec('0x11')](0x1f4,_0x11c971[_0xbdec('0x14')]));});});}; \ No newline at end of file +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(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x14eba8,_0x1b1b10){_0x14eba8=_0x14eba8-0x0;var _0x4ca2c5=_0xb7fc[_0x14eba8];return _0x4ca2c5;};'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 diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d097fc1..74acadc 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 _0xe239=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','create','/:id/clone','post','addBlackLists','put','update','delete','destroy','removeBlackLists','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','/:id','isAuthenticated','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xe239,0x151));var _0x9e23=function(_0x4c0dd,_0x72eeba){_0x4c0dd=_0x4c0dd-0x0;var _0x1134a9=_0xe239[_0x4c0dd];return _0x1134a9;};'use strict';var multer=require(_0x9e23('0x0'));var util=require(_0x9e23('0x1'));var path=require('path');var timeout=require(_0x9e23('0x2'));var express=require(_0x9e23('0x3'));var router=express[_0x9e23('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e23('0x5'));var interaction=require(_0x9e23('0x6'));var config=require('../../config/environment');var controller=require(_0x9e23('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9e23('0x8'),auth[_0x9e23('0x9')](),controller['show']);router[_0x9e23('0xa')]('/:id/hoppers',auth[_0x9e23('0x9')](),controller[_0x9e23('0xb')]);router['get'](_0x9e23('0xc'),auth['isAuthenticated'](),controller[_0x9e23('0xd')]);router[_0x9e23('0xa')](_0x9e23('0xe'),auth['isAuthenticated'](),controller[_0x9e23('0xf')]);router['get'](_0x9e23('0x10'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x11')]);router['get'](_0x9e23('0x12'),auth[_0x9e23('0x9')](),controller['getLists']);router[_0x9e23('0xa')](_0x9e23('0x13'),auth[_0x9e23('0x9')](),controller['getBlackLists']);router['post']('/',auth[_0x9e23('0x9')](),controller[_0x9e23('0x14')]);router['post'](_0x9e23('0x15'),auth[_0x9e23('0x9')](),controller['clone']);router[_0x9e23('0x16')](_0x9e23('0x12'),auth[_0x9e23('0x9')](),controller['addLists']);router[_0x9e23('0x16')](_0x9e23('0x13'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x17')]);router[_0x9e23('0x18')](_0x9e23('0x8'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x19')]);router[_0x9e23('0x1a')](_0x9e23('0x8'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x1b')]);router[_0x9e23('0x1a')](_0x9e23('0x12'),auth[_0x9e23('0x9')](),controller['removeLists']);router[_0x9e23('0x1a')]('/:id/blacklists',auth[_0x9e23('0x9')](),controller[_0x9e23('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x1da7=['./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x429ce2,_0x387314){var _0x4045bc=function(_0x1b11a4){while(--_0x1b11a4){_0x429ce2['push'](_0x429ce2['shift']());}};_0x4045bc(++_0x387314);}(_0x1da7,0xee));var _0x71da=function(_0x166548,_0x12113b){_0x166548=_0x166548-0x0;var _0x5837ad=_0x1da7[_0x166548];return _0x5837ad;};'use strict';var multer=require('multer');var util=require(_0x71da('0x0'));var path=require('path');var timeout=require(_0x71da('0x1'));var express=require('express');var router=express[_0x71da('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x71da('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x71da('0x4'));var controller=require(_0x71da('0x5'));router[_0x71da('0x6')]('/',auth[_0x71da('0x7')](),controller['index']);router[_0x71da('0x6')](_0x71da('0x8'),auth['isAuthenticated'](),controller[_0x71da('0x9')]);router[_0x71da('0x6')](_0x71da('0xa'),auth[_0x71da('0x7')](),controller['getHoppers']);router['get'](_0x71da('0xb'),auth[_0x71da('0x7')](),controller['getHopperHistories']);router[_0x71da('0x6')]('/:id/hopper_finals',auth[_0x71da('0x7')](),controller['getHopperFinals']);router[_0x71da('0x6')](_0x71da('0xc'),auth['isAuthenticated'](),controller[_0x71da('0xd')]);router[_0x71da('0x6')](_0x71da('0xe'),auth[_0x71da('0x7')](),controller[_0x71da('0xf')]);router[_0x71da('0x6')](_0x71da('0x10'),auth['isAuthenticated'](),controller[_0x71da('0x11')]);router[_0x71da('0x12')]('/',auth[_0x71da('0x7')](),controller['create']);router[_0x71da('0x12')]('/:id/clone',auth[_0x71da('0x7')](),controller['clone']);router[_0x71da('0x12')]('/:id/lists',auth['isAuthenticated'](),controller[_0x71da('0x13')]);router[_0x71da('0x12')]('/:id/blacklists',auth[_0x71da('0x7')](),controller[_0x71da('0x14')]);router[_0x71da('0x15')](_0x71da('0x8'),auth[_0x71da('0x7')](),controller[_0x71da('0x16')]);router[_0x71da('0x17')](_0x71da('0x8'),auth[_0x71da('0x7')](),controller[_0x71da('0x18')]);router['delete'](_0x71da('0xe'),auth[_0x71da('0x7')](),controller[_0x71da('0x19')]);router[_0x71da('0x17')](_0x71da('0x10'),auth[_0x71da('0x7')](),controller[_0x71da('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 7eac27a..81185e5 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 _0x54aa=['TEXT','VIRTUAL','getDataValue','sequelize','exports','STRING'];(function(_0x49416f,_0x457ccd){var _0x57ee0d=function(_0x416dc0){while(--_0x416dc0){_0x49416f['push'](_0x49416f['shift']());}};_0x57ee0d(++_0x457ccd);}(_0x54aa,0x6f));var _0xa54a=function(_0x4b8c8c,_0x454428){_0x4b8c8c=_0x4b8c8c-0x0;var _0x2035bc=_0x54aa[_0x4b8c8c];return _0x2035bc;};'use strict';var Sequelize=require(_0xa54a('0x0'));module[_0xa54a('0x1')]={'key':{'type':Sequelize[_0xa54a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa54a('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0xa54a('0x2')]},'name':{'type':Sequelize[_0xa54a('0x4')],'get':function(){return this[_0xa54a('0x5')]('key');}}}; \ No newline at end of file +var _0x937a=['medium','VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0x5c8fa9,_0x26415f){var _0x35ae19=function(_0x42a1a6){while(--_0x42a1a6){_0x5c8fa9['push'](_0x5c8fa9['shift']());}};_0x35ae19(++_0x26415f);}(_0x937a,0x94));var _0xa937=function(_0x4d69a6,_0x44cbe8){_0x4d69a6=_0x4d69a6-0x0;var _0x56739a=_0x937a[_0x4d69a6];return _0x56739a;};'use strict';var Sequelize=require(_0xa937('0x0'));module['exports']={'key':{'type':Sequelize[_0xa937('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xa937('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa937('0x3')],'get':function(){return this[_0xa937('0x4')](_0xa937('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index a5befba..dda11b3 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 _0xaaea=['send','map','CannedAnswer','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','length','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','error','stack','name'];(function(_0x4d6de2,_0x200506){var _0x1c18a5=function(_0x5e9c01){while(--_0x5e9c01){_0x4d6de2['push'](_0x4d6de2['shift']());}};_0x1c18a5(++_0x200506);}(_0xaaea,0x191));var _0xaaae=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xaaea[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaae('0x0'));var zipdir=require(_0xaaae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaaae('0x2'));var moment=require(_0xaaae('0x3'));var BPromise=require(_0xaaae('0x4'));var Mustache=require(_0xaaae('0x5'));var util=require(_0xaaae('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xaaae('0x7'));var ejs=require(_0xaaae('0x8'));var fs=require('fs');var fs_extra=require(_0xaaae('0x9'));var _=require(_0xaaae('0xa'));var squel=require(_0xaaae('0xb'));var crypto=require(_0xaaae('0xc'));var jsforce=require(_0xaaae('0xd'));var deskjs=require(_0xaaae('0xe'));var toCsv=require(_0xaaae('0x7'));var querystring=require('querystring');var Papa=require(_0xaaae('0xf'));var Redis=require('ioredis');var authService=require(_0xaaae('0x10'));var qs=require(_0xaaae('0x11'));var as=require(_0xaaae('0x12'));var hardwareService=require(_0xaaae('0x13'));var logger=require(_0xaaae('0x14'))(_0xaaae('0x15'));var utils=require(_0xaaae('0x16'));var config=require(_0xaaae('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xaaae('0x18'))['db'];function respondWithStatusCode(_0x47bb24,_0x200d49){_0x200d49=_0x200d49||0xcc;return function(_0x41ff37){if(_0x41ff37){return _0x47bb24[_0xaaae('0x19')](_0x200d49);}return _0x47bb24[_0xaaae('0x1a')](_0x200d49)[_0xaaae('0x1b')]();};}function respondWithResult(_0x39c975,_0x7097b1){_0x7097b1=_0x7097b1||0xc8;return function(_0x53dba7){if(_0x53dba7){return _0x39c975[_0xaaae('0x1a')](_0x7097b1)[_0xaaae('0x1c')](_0x53dba7);}};}function respondWithFilteredResult(_0x330268,_0x413276){return function(_0x4610d6){if(_0x4610d6){var _0x55036c=typeof _0x413276['offset']===_0xaaae('0x1d')&&typeof _0x413276[_0xaaae('0x1e')]===_0xaaae('0x1d');var _0x355d0b=_0x4610d6[_0xaaae('0x1f')];var _0xf96a39=_0x55036c?0x0:_0x413276['offset'];var _0xfc89f=_0x55036c?_0x4610d6[_0xaaae('0x1f')]:_0x413276[_0xaaae('0x20')]+_0x413276['limit'];var _0x5922d1;if(_0xfc89f>=_0x355d0b){_0xfc89f=_0x355d0b;_0x5922d1=0xc8;}else{_0x5922d1=0xce;}_0x330268[_0xaaae('0x1a')](_0x5922d1);return _0x330268['set'](_0xaaae('0x21'),_0xf96a39+'-'+_0xfc89f+'/'+_0x355d0b)['json'](_0x4610d6);}return null;};}function patchUpdates(_0x1ca7bf){return function(_0x2d92b9){try{jsonpatch[_0xaaae('0x22')](_0x2d92b9,_0x1ca7bf,!![]);}catch(_0x3fb6b2){return BPromise[_0xaaae('0x23')](_0x3fb6b2);}return _0x2d92b9[_0xaaae('0x24')]();};}function saveUpdates(_0x500174,_0x14e78c){return function(_0x14d8e9){if(_0x14d8e9){return _0x14d8e9[_0xaaae('0x25')](_0x500174)[_0xaaae('0x26')](function(_0x1bce35){return _0x1bce35;});}return null;};}function removeEntity(_0x2117dd,_0x498d24){return function(_0x5bb9f2){if(_0x5bb9f2){return _0x5bb9f2[_0xaaae('0x27')]()[_0xaaae('0x26')](function(){var _0x2cb798=_0x5bb9f2['get']({'plain':!![]});var _0x458c59=_0xaaae('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x458c59,'resourceId':_0x2cb798['id']}})['then'](function(){return _0x5bb9f2;});})['then'](function(){_0x2117dd['status'](0xcc)[_0xaaae('0x1b')]();});}};}function handleEntityNotFound(_0x3aff5f,_0x4bd604){return function(_0x577539){if(!_0x577539){_0x3aff5f[_0xaaae('0x19')](0x194);}return _0x577539;};}function handleError(_0x687459,_0x5f4547){_0x5f4547=_0x5f4547||0x1f4;return function(_0x4c4bb0){logger[_0xaaae('0x29')](_0x4c4bb0[_0xaaae('0x2a')]);if(_0x4c4bb0[_0xaaae('0x2b')]){delete _0x4c4bb0['name'];}_0x687459[_0xaaae('0x1a')](_0x5f4547)[_0xaaae('0x2c')](_0x4c4bb0);};}exports['index']=function(_0x4e6f1a,_0x67ea2b){var _0x13b203={},_0xd7608c={},_0x47bc75={'count':0x0,'rows':[]};var _0x4bbd89=_[_0xaaae('0x2d')](db[_0xaaae('0x2e')][_0xaaae('0x2f')],function(_0x72a83f){return{'name':_0x72a83f['fieldName'],'type':_0x72a83f[_0xaaae('0x30')][_0xaaae('0x31')]};});_0xd7608c[_0xaaae('0x32')]=_[_0xaaae('0x2d')](_0x4bbd89,_0xaaae('0x2b'));_0xd7608c[_0xaaae('0x33')]=_[_0xaaae('0x34')](_0x4e6f1a[_0xaaae('0x33')]);_0xd7608c['filters']=_[_0xaaae('0x35')](_0xd7608c['model'],_0xd7608c[_0xaaae('0x33')]);_0x13b203['attributes']=_['intersection'](_0xd7608c[_0xaaae('0x32')],qs[_0xaaae('0x36')](_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x36')]));_0x13b203[_0xaaae('0x37')]=_0x13b203[_0xaaae('0x37')]['length']?_0x13b203[_0xaaae('0x37')]:_0xd7608c[_0xaaae('0x32')];if(!_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x38')](_0xaaae('0x39'))){_0x13b203['limit']=qs[_0xaaae('0x1e')](_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x1e')]);_0x13b203[_0xaaae('0x20')]=qs[_0xaaae('0x20')](_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x20')]);}_0x13b203['order']=qs[_0xaaae('0x3a')](_0x4e6f1a['query']['sort']);_0x13b203[_0xaaae('0x3b')]=qs[_0xaaae('0x3c')](_['pick'](_0x4e6f1a[_0xaaae('0x33')],_0xd7608c[_0xaaae('0x3c')]),_0x4bbd89);if(_0x4e6f1a['query'][_0xaaae('0x3d')]){_0x13b203[_0xaaae('0x3b')]=_[_0xaaae('0x3e')](_0x13b203[_0xaaae('0x3b')],{'$or':[{'key':{'$like':'%'+_0x4e6f1a['query'][_0xaaae('0x3d')]+'%'}},{'value':{'$like':'%'+_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x3d')]+'%'}}]});}_0x13b203=_[_0xaaae('0x3e')]({},_0x13b203,_0x4e6f1a[_0xaaae('0x3f')]);var _0x564108={'where':_0x13b203['where']};return db['CannedAnswer'][_0xaaae('0x1f')](_0x564108)[_0xaaae('0x26')](function(_0x27065c){_0x47bc75[_0xaaae('0x1f')]=_0x27065c;if(_0x4e6f1a['query'][_0xaaae('0x40')]){_0x13b203[_0xaaae('0x41')]=[{'all':!![]}];}return db[_0xaaae('0x2e')][_0xaaae('0x42')](_0x13b203);})[_0xaaae('0x26')](function(_0x42195e){_0x47bc75['rows']=_0x42195e;return _0x47bc75;})[_0xaaae('0x26')](respondWithFilteredResult(_0x67ea2b,_0x13b203))[_0xaaae('0x43')](handleError(_0x67ea2b,null));};exports[_0xaaae('0x44')]=function(_0x2d0c04,_0x3bc692){var _0x261fa6={'raw':!![],'where':{'id':_0x2d0c04[_0xaaae('0x45')]['id']}},_0x190d83={};_0x190d83[_0xaaae('0x32')]=_[_0xaaae('0x34')](db[_0xaaae('0x2e')][_0xaaae('0x2f')]);_0x190d83[_0xaaae('0x33')]=_[_0xaaae('0x34')](_0x2d0c04[_0xaaae('0x33')]);_0x190d83['filters']=_[_0xaaae('0x35')](_0x190d83[_0xaaae('0x32')],_0x190d83[_0xaaae('0x33')]);_0x261fa6[_0xaaae('0x37')]=_[_0xaaae('0x35')](_0x190d83['model'],qs['fields'](_0x2d0c04[_0xaaae('0x33')]['fields']));_0x261fa6[_0xaaae('0x37')]=_0x261fa6[_0xaaae('0x37')][_0xaaae('0x46')]?_0x261fa6['attributes']:_0x190d83['model'];if(_0x2d0c04[_0xaaae('0x33')][_0xaaae('0x40')]){_0x261fa6[_0xaaae('0x41')]=[{'all':!![]}];}_0x261fa6=_[_0xaaae('0x3e')]({},_0x261fa6,_0x2d0c04[_0xaaae('0x3f')]);return db[_0xaaae('0x2e')]['find'](_0x261fa6)[_0xaaae('0x26')](handleEntityNotFound(_0x3bc692,null))['then'](respondWithResult(_0x3bc692,null))['catch'](handleError(_0x3bc692,null));};exports[_0xaaae('0x25')]=function(_0x376507,_0x2bde69){if(_0x376507[_0xaaae('0x47')]['id']){delete _0x376507[_0xaaae('0x47')]['id'];}return db[_0xaaae('0x2e')][_0xaaae('0x48')]({'where':{'id':_0x376507[_0xaaae('0x45')]['id']}})['then'](handleEntityNotFound(_0x2bde69,null))[_0xaaae('0x26')](saveUpdates(_0x376507[_0xaaae('0x47')],null))[_0xaaae('0x26')](respondWithResult(_0x2bde69,null))[_0xaaae('0x43')](handleError(_0x2bde69,null));};exports[_0xaaae('0x27')]=function(_0x44bee4,_0x30da61){return db[_0xaaae('0x2e')][_0xaaae('0x48')]({'where':{'id':_0x44bee4[_0xaaae('0x45')]['id']}})['then'](handleEntityNotFound(_0x30da61,null))['then'](removeEntity(_0x30da61,null))[_0xaaae('0x43')](handleError(_0x30da61,null));};exports[_0xaaae('0x49')]=function(_0x3bba61,_0x1ba96b){var _0x330f9b={'key':_0x3bba61['body'][_0xaaae('0x31')]};if(_0x3bba61['body'][_0xaaae('0x4a')]){_0x330f9b[_0xaaae('0x4a')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4a')];}else if(_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4b')]){_0x330f9b[_0xaaae('0x4b')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4b')];}else if(_0x3bba61[_0xaaae('0x47')]['OpenchannelAccountId']){_0x330f9b[_0xaaae('0x4c')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4c')];}else if(_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4d')]){_0x330f9b[_0xaaae('0x4d')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4d')];}return db[_0xaaae('0x2e')][_0xaaae('0x48')]({'where':_0x330f9b})[_0xaaae('0x26')](function(_0x378a39){if(_0x378a39){throw new db[(_0xaaae('0x4e'))][(_0xaaae('0x4f'))](_0xaaae('0x50'));}return db[_0xaaae('0x2e')][_0xaaae('0x49')](_0x3bba61[_0xaaae('0x47')]);})[_0xaaae('0x26')](function(_0x32c614){var _0x2f9886=_0x3bba61[_0xaaae('0x51')][_0xaaae('0x52')]({'plain':!![]});if(!_0x2f9886)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f9886[_0xaaae('0x53')]===_0xaaae('0x51')){var _0x20b7a4=_0x32c614[_0xaaae('0x52')]({'plain':!![]});return db[_0xaaae('0x54')]['find']({'where':{'name':_0xaaae('0x28'),'userProfileId':_0x2f9886[_0xaaae('0x55')]},'raw':!![]})['then'](function(_0x2c10dc){if(_0x2c10dc&&_0x2c10dc[_0xaaae('0x56')]===0x0){return db[_0xaaae('0x57')][_0xaaae('0x49')]({'name':_0x20b7a4[_0xaaae('0x2b')],'resourceId':_0x20b7a4['id'],'type':_0x2c10dc[_0xaaae('0x2b')],'sectionId':_0x2c10dc['id']},{})['then'](function(){return _0x32c614;});}else{return _0x32c614;}})['catch'](function(_0x595cb1){logger[_0xaaae('0x29')](_0xaaae('0x58'),_0x595cb1);throw _0x595cb1;});}return _0x32c614;})[_0xaaae('0x26')](respondWithResult(_0x1ba96b,0xc9))[_0xaaae('0x43')](handleError(_0x1ba96b,null));}; \ No newline at end of file +var _0x2bfd=['fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x3b3092,_0x1eee2a){var _0x399002=function(_0x54b829){while(--_0x54b829){_0x3b3092['push'](_0x3b3092['shift']());}};_0x399002(++_0x1eee2a);}(_0x2bfd,0x77));var _0xd2bf=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x2bfd[_0x36f243];return _0x426436;};'use strict';var emlformat=require(_0xd2bf('0x0'));var rimraf=require(_0xd2bf('0x1'));var zipdir=require(_0xd2bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2bf('0x3'));var moment=require('moment');var BPromise=require(_0xd2bf('0x4'));var Mustache=require(_0xd2bf('0x5'));var util=require(_0xd2bf('0x6'));var path=require('path');var sox=require(_0xd2bf('0x7'));var csv=require(_0xd2bf('0x8'));var ejs=require(_0xd2bf('0x9'));var fs=require('fs');var fs_extra=require(_0xd2bf('0xa'));var _=require(_0xd2bf('0xb'));var squel=require(_0xd2bf('0xc'));var crypto=require(_0xd2bf('0xd'));var jsforce=require(_0xd2bf('0xe'));var deskjs=require(_0xd2bf('0xf'));var toCsv=require(_0xd2bf('0x8'));var querystring=require('querystring');var Papa=require(_0xd2bf('0x10'));var Redis=require(_0xd2bf('0x11'));var authService=require(_0xd2bf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd2bf('0x13'));var hardwareService=require(_0xd2bf('0x14'));var logger=require('../../config/logger')(_0xd2bf('0x15'));var utils=require(_0xd2bf('0x16'));var config=require(_0xd2bf('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30e636,_0x3099f8){_0x3099f8=_0x3099f8||0xcc;return function(_0x2fe218){if(_0x2fe218){return _0x30e636[_0xd2bf('0x18')](_0x3099f8);}return _0x30e636[_0xd2bf('0x19')](_0x3099f8)[_0xd2bf('0x1a')]();};}function respondWithResult(_0x71d706,_0x3d2af4){_0x3d2af4=_0x3d2af4||0xc8;return function(_0x3bf98e){if(_0x3bf98e){return _0x71d706[_0xd2bf('0x19')](_0x3d2af4)['json'](_0x3bf98e);}};}function respondWithFilteredResult(_0x497359,_0x50261f){return function(_0x1b76b1){if(_0x1b76b1){var _0x4283af=typeof _0x50261f['offset']==='undefined'&&typeof _0x50261f[_0xd2bf('0x1b')]===_0xd2bf('0x1c');var _0x1d2b4a=_0x1b76b1[_0xd2bf('0x1d')];var _0x5a702b=_0x4283af?0x0:_0x50261f['offset'];var _0x170fbb=_0x4283af?_0x1b76b1[_0xd2bf('0x1d')]:_0x50261f[_0xd2bf('0x1e')]+_0x50261f[_0xd2bf('0x1b')];var _0x589c18;if(_0x170fbb>=_0x1d2b4a){_0x170fbb=_0x1d2b4a;_0x589c18=0xc8;}else{_0x589c18=0xce;}_0x497359['status'](_0x589c18);return _0x497359[_0xd2bf('0x1f')](_0xd2bf('0x20'),_0x5a702b+'-'+_0x170fbb+'/'+_0x1d2b4a)[_0xd2bf('0x21')](_0x1b76b1);}return null;};}function patchUpdates(_0x1c6711){return function(_0x32f9c9){try{jsonpatch[_0xd2bf('0x22')](_0x32f9c9,_0x1c6711,!![]);}catch(_0x43fc35){return BPromise[_0xd2bf('0x23')](_0x43fc35);}return _0x32f9c9['save']();};}function saveUpdates(_0x47cd27,_0x26bd76){return function(_0x80d19d){if(_0x80d19d){return _0x80d19d[_0xd2bf('0x24')](_0x47cd27)[_0xd2bf('0x25')](function(_0x55b513){return _0x55b513;});}return null;};}function removeEntity(_0x39f9d6,_0x1edd13){return function(_0x34c7a7){if(_0x34c7a7){return _0x34c7a7[_0xd2bf('0x26')]()[_0xd2bf('0x25')](function(){var _0x57bde6=_0x34c7a7[_0xd2bf('0x27')]({'plain':!![]});var _0x37ffa9=_0xd2bf('0x28');return db['UserProfileResource'][_0xd2bf('0x26')]({'where':{'type':_0x37ffa9,'resourceId':_0x57bde6['id']}})[_0xd2bf('0x25')](function(){return _0x34c7a7;});})[_0xd2bf('0x25')](function(){_0x39f9d6['status'](0xcc)[_0xd2bf('0x1a')]();});}};}function handleEntityNotFound(_0x1ace01,_0x1d2441){return function(_0x491668){if(!_0x491668){_0x1ace01[_0xd2bf('0x18')](0x194);}return _0x491668;};}function handleError(_0x376c3b,_0x3dd61d){_0x3dd61d=_0x3dd61d||0x1f4;return function(_0x41b45f){logger[_0xd2bf('0x29')](_0x41b45f[_0xd2bf('0x2a')]);if(_0x41b45f[_0xd2bf('0x2b')]){delete _0x41b45f[_0xd2bf('0x2b')];}_0x376c3b[_0xd2bf('0x19')](_0x3dd61d)[_0xd2bf('0x2c')](_0x41b45f);};}exports['index']=function(_0x20da60,_0x414e13){var _0x487215={},_0x595ac0={},_0x2fdfee={'count':0x0,'rows':[]};var _0x338a40=_[_0xd2bf('0x2d')](db[_0xd2bf('0x2e')][_0xd2bf('0x2f')],function(_0x27f379){return{'name':_0x27f379[_0xd2bf('0x30')],'type':_0x27f379[_0xd2bf('0x31')][_0xd2bf('0x32')]};});_0x595ac0[_0xd2bf('0x33')]=_[_0xd2bf('0x2d')](_0x338a40,'name');_0x595ac0[_0xd2bf('0x34')]=_[_0xd2bf('0x35')](_0x20da60[_0xd2bf('0x34')]);_0x595ac0[_0xd2bf('0x36')]=_[_0xd2bf('0x37')](_0x595ac0[_0xd2bf('0x33')],_0x595ac0[_0xd2bf('0x34')]);_0x487215[_0xd2bf('0x38')]=_['intersection'](_0x595ac0[_0xd2bf('0x33')],qs[_0xd2bf('0x39')](_0x20da60['query'][_0xd2bf('0x39')]));_0x487215[_0xd2bf('0x38')]=_0x487215[_0xd2bf('0x38')][_0xd2bf('0x3a')]?_0x487215[_0xd2bf('0x38')]:_0x595ac0[_0xd2bf('0x33')];if(!_0x20da60['query']['hasOwnProperty'](_0xd2bf('0x3b'))){_0x487215[_0xd2bf('0x1b')]=qs[_0xd2bf('0x1b')](_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x1b')]);_0x487215[_0xd2bf('0x1e')]=qs[_0xd2bf('0x1e')](_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x1e')]);}_0x487215[_0xd2bf('0x3c')]=qs[_0xd2bf('0x3d')](_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x3d')]);_0x487215[_0xd2bf('0x3e')]=qs[_0xd2bf('0x36')](_[_0xd2bf('0x3f')](_0x20da60[_0xd2bf('0x34')],_0x595ac0[_0xd2bf('0x36')]),_0x338a40);if(_0x20da60[_0xd2bf('0x34')]['filter']){_0x487215[_0xd2bf('0x3e')]=_[_0xd2bf('0x40')](_0x487215[_0xd2bf('0x3e')],{'$or':[{'key':{'$like':'%'+_0x20da60[_0xd2bf('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x20da60['query'][_0xd2bf('0x41')]+'%'}}]});}_0x487215=_['merge']({},_0x487215,_0x20da60[_0xd2bf('0x42')]);var _0x5e8124={'where':_0x487215[_0xd2bf('0x3e')]};return db['CannedAnswer'][_0xd2bf('0x1d')](_0x5e8124)['then'](function(_0x22f92a){_0x2fdfee[_0xd2bf('0x1d')]=_0x22f92a;if(_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x43')]){_0x487215[_0xd2bf('0x44')]=[{'all':!![]}];}return db[_0xd2bf('0x2e')][_0xd2bf('0x45')](_0x487215);})[_0xd2bf('0x25')](function(_0x585d23){_0x2fdfee[_0xd2bf('0x46')]=_0x585d23;return _0x2fdfee;})['then'](respondWithFilteredResult(_0x414e13,_0x487215))[_0xd2bf('0x47')](handleError(_0x414e13,null));};exports['show']=function(_0xa0a4af,_0x337759){var _0x52e74c={'raw':!![],'where':{'id':_0xa0a4af['params']['id']}},_0x5c5da4={};_0x5c5da4['model']=_[_0xd2bf('0x35')](db[_0xd2bf('0x2e')][_0xd2bf('0x2f')]);_0x5c5da4[_0xd2bf('0x34')]=_[_0xd2bf('0x35')](_0xa0a4af[_0xd2bf('0x34')]);_0x5c5da4[_0xd2bf('0x36')]=_['intersection'](_0x5c5da4['model'],_0x5c5da4[_0xd2bf('0x34')]);_0x52e74c[_0xd2bf('0x38')]=_[_0xd2bf('0x37')](_0x5c5da4[_0xd2bf('0x33')],qs[_0xd2bf('0x39')](_0xa0a4af['query'][_0xd2bf('0x39')]));_0x52e74c['attributes']=_0x52e74c[_0xd2bf('0x38')][_0xd2bf('0x3a')]?_0x52e74c[_0xd2bf('0x38')]:_0x5c5da4['model'];if(_0xa0a4af['query'][_0xd2bf('0x43')]){_0x52e74c[_0xd2bf('0x44')]=[{'all':!![]}];}_0x52e74c=_['merge']({},_0x52e74c,_0xa0a4af[_0xd2bf('0x42')]);return db[_0xd2bf('0x2e')][_0xd2bf('0x48')](_0x52e74c)[_0xd2bf('0x25')](handleEntityNotFound(_0x337759,null))[_0xd2bf('0x25')](respondWithResult(_0x337759,null))[_0xd2bf('0x47')](handleError(_0x337759,null));};exports[_0xd2bf('0x24')]=function(_0x488508,_0x4f3c4b){if(_0x488508[_0xd2bf('0x49')]['id']){delete _0x488508[_0xd2bf('0x49')]['id'];}return db['CannedAnswer'][_0xd2bf('0x48')]({'where':{'id':_0x488508[_0xd2bf('0x4a')]['id']}})[_0xd2bf('0x25')](handleEntityNotFound(_0x4f3c4b,null))[_0xd2bf('0x25')](saveUpdates(_0x488508['body'],null))[_0xd2bf('0x25')](respondWithResult(_0x4f3c4b,null))['catch'](handleError(_0x4f3c4b,null));};exports['destroy']=function(_0x43e801,_0x5bce20){return db[_0xd2bf('0x2e')][_0xd2bf('0x48')]({'where':{'id':_0x43e801[_0xd2bf('0x4a')]['id']}})[_0xd2bf('0x25')](handleEntityNotFound(_0x5bce20,null))[_0xd2bf('0x25')](removeEntity(_0x5bce20,null))[_0xd2bf('0x47')](handleError(_0x5bce20,null));};exports[_0xd2bf('0x4b')]=function(_0xd23076,_0x1408a2){var _0x108b27={'key':_0xd23076['body'][_0xd2bf('0x32')]};if(_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4c')]){_0x108b27[_0xd2bf('0x4c')]=_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4c')];}else if(_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4d')]){_0x108b27['SmsAccountId']=_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4d')];}else if(_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4e')]){_0x108b27[_0xd2bf('0x4e')]=_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4e')];}else if(_0xd23076[_0xd2bf('0x49')]['ChatWebsiteId']){_0x108b27[_0xd2bf('0x4f')]=_0xd23076['body'][_0xd2bf('0x4f')];}return db['CannedAnswer']['find']({'where':_0x108b27})[_0xd2bf('0x25')](function(_0x198ce2){if(_0x198ce2){throw new db['Sequelize'][(_0xd2bf('0x50'))](_0xd2bf('0x51'));}return db[_0xd2bf('0x2e')][_0xd2bf('0x4b')](_0xd23076[_0xd2bf('0x49')]);})[_0xd2bf('0x25')](function(_0x30e6bd){var _0xd23240=_0xd23076['user'][_0xd2bf('0x27')]({'plain':!![]});if(!_0xd23240)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd23240['role']===_0xd2bf('0x52')){var _0x171d85=_0x30e6bd[_0xd2bf('0x27')]({'plain':!![]});return db[_0xd2bf('0x53')][_0xd2bf('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0xd23240[_0xd2bf('0x54')]},'raw':!![]})['then'](function(_0x6044dd){if(_0x6044dd&&_0x6044dd[_0xd2bf('0x55')]===0x0){return db[_0xd2bf('0x56')][_0xd2bf('0x4b')]({'name':_0x171d85[_0xd2bf('0x2b')],'resourceId':_0x171d85['id'],'type':_0x6044dd[_0xd2bf('0x2b')],'sectionId':_0x6044dd['id']},{})[_0xd2bf('0x25')](function(){return _0x30e6bd;});}else{return _0x30e6bd;}})[_0xd2bf('0x47')](function(_0x37cdfb){logger['error'](_0xd2bf('0x57'),_0x37cdfb);throw _0x37cdfb;});}return _0x30e6bd;})['then'](respondWithResult(_0x1408a2,0xc9))[_0xd2bf('0x47')](handleError(_0x1408a2,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 4319be2..6c9ab49 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 _0xe280=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe280,0x1b3));var _0x0e28=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xe280[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x0e28('0x0'));var util=require(_0x0e28('0x1'));var logger=require(_0x0e28('0x2'))('api');var moment=require(_0x0e28('0x3'));var BPromise=require(_0x0e28('0x4'));var rp=require(_0x0e28('0x5'));var fs=require('fs');var path=require(_0x0e28('0x6'));var rimraf=require(_0x0e28('0x7'));var config=require(_0x0e28('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x0e28('0x9')]=function(_0x3983d8,_0x23cd5c){return _0x3983d8[_0x0e28('0xa')](_0x0e28('0xb'),attributes,{'tableName':_0x0e28('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0e28('0xd'),'collate':_0x0e28('0xe')});}; \ No newline at end of file +var _0x0de3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4_unicode_ci','lodash','util'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x0de3,0x184));var _0x30de=function(_0x235b75,_0x322c34){_0x235b75=_0x235b75-0x0;var _0x38d797=_0x0de3[_0x235b75];return _0x38d797;};'use strict';var _=require(_0x30de('0x0'));var util=require(_0x30de('0x1'));var logger=require('../../config/logger')(_0x30de('0x2'));var moment=require(_0x30de('0x3'));var BPromise=require(_0x30de('0x4'));var rp=require(_0x30de('0x5'));var fs=require('fs');var path=require(_0x30de('0x6'));var rimraf=require(_0x30de('0x7'));var config=require(_0x30de('0x8'));var attributes=require(_0x30de('0x9'));module[_0x30de('0xa')]=function(_0x512874,_0x55e5e9){return _0x512874[_0x30de('0xb')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x30de('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index c38d4ca..93d5f8b 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(_0x4066ba,_0x5c032c){var _0x290596=function(_0x40aac7){while(--_0x40aac7){_0x4066ba['push'](_0x4066ba['shift']());}};_0x290596(++_0x5c032c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0xbfa2b4,_0x4e3706){var _0x34024e=function(_0x5825a3){while(--_0x5825a3){_0xbfa2b4['push'](_0xbfa2b4['shift']());}};_0x34024e(++_0x4e3706);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 9281317..45079ac 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 _0xd22c=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2fe7c7,_0x51a75d){var _0x39fac8=function(_0x4ed0db){while(--_0x4ed0db){_0x2fe7c7['push'](_0x2fe7c7['shift']());}};_0x39fac8(++_0x51a75d);}(_0xd22c,0x182));var _0xcd22=function(_0x5b05de,_0x441400){_0x5b05de=_0x5b05de-0x0;var _0x1dbd07=_0xd22c[_0x5b05de];return _0x1dbd07;};'use strict';var multer=require('multer');var util=require(_0xcd22('0x0'));var path=require(_0xcd22('0x1'));var timeout=require(_0xcd22('0x2'));var express=require(_0xcd22('0x3'));var router=express['Router']();var fs_extra=require(_0xcd22('0x4'));var auth=require(_0xcd22('0x5'));var interaction=require(_0xcd22('0x6'));var config=require('../../config/environment');var controller=require(_0xcd22('0x7'));router[_0xcd22('0x8')]('/',auth[_0xcd22('0x9')](),controller[_0xcd22('0xa')]);router[_0xcd22('0x8')](_0xcd22('0xb'),auth[_0xcd22('0x9')](),controller[_0xcd22('0xc')]);router[_0xcd22('0xd')]('/',auth['isAuthenticated'](),controller[_0xcd22('0xe')]);router[_0xcd22('0xf')]('/:id',auth[_0xcd22('0x9')](),controller[_0xcd22('0x10')]);router[_0xcd22('0x11')]('/:id',auth[_0xcd22('0x9')](),controller[_0xcd22('0x12')]);module[_0xcd22('0x13')]=router; \ No newline at end of file +var _0x0d7d=['isAuthenticated','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0d7d,0x1db));var _0xd0d7=function(_0x4851ff,_0x1c9a8d){_0x4851ff=_0x4851ff-0x0;var _0x26773b=_0x0d7d[_0x4851ff];return _0x26773b;};'use strict';var multer=require(_0xd0d7('0x0'));var util=require(_0xd0d7('0x1'));var path=require(_0xd0d7('0x2'));var timeout=require(_0xd0d7('0x3'));var express=require(_0xd0d7('0x4'));var router=express['Router']();var fs_extra=require(_0xd0d7('0x5'));var auth=require(_0xd0d7('0x6'));var interaction=require(_0xd0d7('0x7'));var config=require(_0xd0d7('0x8'));var controller=require(_0xd0d7('0x9'));router[_0xd0d7('0xa')]('/',auth[_0xd0d7('0xb')](),controller['index']);router['get'](_0xd0d7('0xc'),auth[_0xd0d7('0xb')](),controller['show']);router[_0xd0d7('0xd')]('/',auth[_0xd0d7('0xb')](),controller[_0xd0d7('0xe')]);router['put']('/:id',auth[_0xd0d7('0xb')](),controller[_0xd0d7('0xf')]);router[_0xd0d7('0x10')]('/:id',auth[_0xd0d7('0xb')](),controller[_0xd0d7('0x11')]);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 86a6279..b7563c5 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 _0x5c5a=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x1997c6,_0x1c364e){var _0x3afeed=function(_0x1756e6){while(--_0x1756e6){_0x1997c6['push'](_0x1997c6['shift']());}};_0x3afeed(++_0x1c364e);}(_0x5c5a,0x198));var _0xa5c5=function(_0x43bc3d,_0x22674f){_0x43bc3d=_0x43bc3d-0x0;var _0x3409a4=_0x5c5a[_0x43bc3d];return _0x3409a4;};'use strict';var Sequelize=require('sequelize');module[_0xa5c5('0x0')]={'calldate':{'type':Sequelize[_0xa5c5('0x1')],'allowNull':![],'defaultValue':_0xa5c5('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xa5c5('0x3')]},'dst':{'type':Sequelize[_0xa5c5('0x3')]},'dcontext':{'type':Sequelize[_0xa5c5('0x3')]},'channel':{'type':Sequelize[_0xa5c5('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xa5c5('0x3')]},'lastdata':{'type':Sequelize[_0xa5c5('0x3')]},'duration':{'type':Sequelize[_0xa5c5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa5c5('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa5c5('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa5c5('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa5c5('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa5c5('0x3')]},'tag':{'type':Sequelize[_0xa5c5('0x3')]}}; \ No newline at end of file +var _0xa508=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x553c61,_0x594716){var _0x20d786=function(_0x4f1c62){while(--_0x4f1c62){_0x553c61['push'](_0x553c61['shift']());}};_0x20d786(++_0x594716);}(_0xa508,0x187));var _0x8a50=function(_0x15a5b4,_0x90b469){_0x15a5b4=_0x15a5b4-0x0;var _0x26f037=_0xa508[_0x15a5b4];return _0x26f037;};'use strict';var Sequelize=require(_0x8a50('0x0'));module[_0x8a50('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x8a50('0x2')},'clid':{'type':Sequelize[_0x8a50('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x8a50('0x3')]},'channel':{'type':Sequelize[_0x8a50('0x3')]},'dstchannel':{'type':Sequelize[_0x8a50('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8a50('0x3')]},'duration':{'type':Sequelize[_0x8a50('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8a50('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8a50('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8a50('0x3')]},'userfield':{'type':Sequelize[_0x8a50('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x8a50('0x3')]},'sequence':{'type':Sequelize[_0x8a50('0x3')]},'peeraccount':{'type':Sequelize[_0x8a50('0x3')]},'type':{'type':Sequelize[_0x8a50('0x3')]},'tag':{'type':Sequelize[_0x8a50('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e4418f3..bbc659b 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 _0x23f4=['index','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','update','find','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','send'];(function(_0x2c769e,_0x1178f5){var _0x52acdd=function(_0x4b1a01){while(--_0x4b1a01){_0x2c769e['push'](_0x2c769e['shift']());}};_0x52acdd(++_0x1178f5);}(_0x23f4,0x1ee));var _0x423f=function(_0x1c890f,_0x47172a){_0x1c890f=_0x1c890f-0x0;var _0x5d1bfb=_0x23f4[_0x1c890f];return _0x5d1bfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];function respondWithStatusCode(_0x3d4027,_0x216360){_0x216360=_0x216360||0xcc;return function(_0x5275b0){if(_0x5275b0){return _0x3d4027[_0x423f('0x16')](_0x216360);}return _0x3d4027[_0x423f('0x17')](_0x216360)[_0x423f('0x18')]();};}function respondWithResult(_0x1c894f,_0x44e1d5){_0x44e1d5=_0x44e1d5||0xc8;return function(_0x3b531d){if(_0x3b531d){return _0x1c894f[_0x423f('0x17')](_0x44e1d5)[_0x423f('0x19')](_0x3b531d);}};}function respondWithFilteredResult(_0x252e6c,_0x235c86){return function(_0x3940ea){if(_0x3940ea){var _0x276be1=typeof _0x235c86[_0x423f('0x1a')]===_0x423f('0x1b')&&typeof _0x235c86[_0x423f('0x1c')]===_0x423f('0x1b');var _0x3fd56d=_0x3940ea[_0x423f('0x1d')];var _0x26b6d1=_0x276be1?0x0:_0x235c86['offset'];var _0x99435f=_0x276be1?_0x3940ea['count']:_0x235c86['offset']+_0x235c86[_0x423f('0x1c')];var _0x4956e0;if(_0x99435f>=_0x3fd56d){_0x99435f=_0x3fd56d;_0x4956e0=0xc8;}else{_0x4956e0=0xce;}_0x252e6c[_0x423f('0x17')](_0x4956e0);return _0x252e6c[_0x423f('0x1e')]('Content-Range',_0x26b6d1+'-'+_0x99435f+'/'+_0x3fd56d)[_0x423f('0x19')](_0x3940ea);}return null;};}function patchUpdates(_0x1fc317){return function(_0x56c21e){try{jsonpatch[_0x423f('0x1f')](_0x56c21e,_0x1fc317,!![]);}catch(_0x2ebe74){return BPromise['reject'](_0x2ebe74);}return _0x56c21e[_0x423f('0x20')]();};}function saveUpdates(_0x1b4ecc,_0x568dcd){return function(_0x54f47){if(_0x54f47){return _0x54f47['update'](_0x1b4ecc)[_0x423f('0x21')](function(_0x3c942e){return _0x3c942e;});}return null;};}function removeEntity(_0x4502ab,_0x3955a0){return function(_0xb82e8d){if(_0xb82e8d){return _0xb82e8d[_0x423f('0x22')]()[_0x423f('0x21')](function(){_0x4502ab[_0x423f('0x17')](0xcc)[_0x423f('0x18')]();});}};}function handleEntityNotFound(_0x36f57f,_0x45889f){return function(_0x199196){if(!_0x199196){_0x36f57f[_0x423f('0x16')](0x194);}return _0x199196;};}function handleError(_0x1f1747,_0x4a98f2){_0x4a98f2=_0x4a98f2||0x1f4;return function(_0x3308dd){logger[_0x423f('0x23')](_0x3308dd[_0x423f('0x24')]);if(_0x3308dd['name']){delete _0x3308dd['name'];}_0x1f1747[_0x423f('0x17')](_0x4a98f2)[_0x423f('0x25')](_0x3308dd);};}exports[_0x423f('0x26')]=function(_0x4c2f21,_0x5882ed){var _0x3ca28d={},_0xbb4bce={},_0x5a838e={'count':0x0,'rows':[]};var _0x3cf4aa=_[_0x423f('0x27')](db[_0x423f('0x28')][_0x423f('0x29')],function(_0x518c1e){return{'name':_0x518c1e[_0x423f('0x2a')],'type':_0x518c1e[_0x423f('0x2b')][_0x423f('0x2c')]};});_0xbb4bce[_0x423f('0x2d')]=_['map'](_0x3cf4aa,_0x423f('0x2e'));_0xbb4bce[_0x423f('0x2f')]=_[_0x423f('0x30')](_0x4c2f21[_0x423f('0x2f')]);_0xbb4bce[_0x423f('0x31')]=_[_0x423f('0x32')](_0xbb4bce[_0x423f('0x2d')],_0xbb4bce[_0x423f('0x2f')]);_0x3ca28d[_0x423f('0x33')]=_[_0x423f('0x32')](_0xbb4bce['model'],qs[_0x423f('0x34')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x34')]));_0x3ca28d['attributes']=_0x3ca28d[_0x423f('0x33')]['length']?_0x3ca28d[_0x423f('0x33')]:_0xbb4bce[_0x423f('0x2d')];if(!_0x4c2f21[_0x423f('0x2f')][_0x423f('0x35')](_0x423f('0x36'))){_0x3ca28d['limit']=qs['limit'](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1c')]);_0x3ca28d[_0x423f('0x1a')]=qs[_0x423f('0x1a')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1a')]);}_0x3ca28d[_0x423f('0x37')]=qs[_0x423f('0x38')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x38')]);_0x3ca28d[_0x423f('0x39')]=qs[_0x423f('0x31')](_[_0x423f('0x3a')](_0x4c2f21['query'],_0xbb4bce['filters']),_0x3cf4aa);if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]){_0x3ca28d[_0x423f('0x39')]=_[_0x423f('0x3c')](_0x3ca28d[_0x423f('0x39')],{'$or':_['map'](_0x3cf4aa,function(_0x38dcce){if(_0x38dcce[_0x423f('0x2b')]!==_0x423f('0x3d')){var _0x1d47d8={};_0x1d47d8[_0x38dcce[_0x423f('0x2e')]]={'$like':'%'+_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]+'%'};return _0x1d47d8;}})});}_0x3ca28d=_[_0x423f('0x3c')]({},_0x3ca28d,_0x4c2f21[_0x423f('0x3e')]);var _0x40571a={'where':_0x3ca28d['where']};return db['Cdr'][_0x423f('0x1d')](_0x40571a)[_0x423f('0x21')](function(_0x81bd62){_0x5a838e[_0x423f('0x1d')]=_0x81bd62;if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3ca28d['include']=[{'all':!![]}];}return db[_0x423f('0x28')][_0x423f('0x40')](_0x3ca28d);})[_0x423f('0x21')](function(_0x393618){_0x5a838e[_0x423f('0x41')]=_0x393618;return _0x5a838e;})[_0x423f('0x21')](respondWithFilteredResult(_0x5882ed,_0x3ca28d))[_0x423f('0x42')](handleError(_0x5882ed,null));};exports[_0x423f('0x43')]=function(_0x518443,_0x4165e0){var _0x3bc113={'raw':!![],'where':{'id':_0x518443[_0x423f('0x44')]['id']}},_0x192ae5={};_0x192ae5[_0x423f('0x2d')]=_[_0x423f('0x30')](db[_0x423f('0x28')][_0x423f('0x29')]);_0x192ae5[_0x423f('0x2f')]=_['keys'](_0x518443[_0x423f('0x2f')]);_0x192ae5['filters']=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],_0x192ae5[_0x423f('0x2f')]);_0x3bc113[_0x423f('0x33')]=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],qs[_0x423f('0x34')](_0x518443[_0x423f('0x2f')][_0x423f('0x34')]));_0x3bc113[_0x423f('0x33')]=_0x3bc113[_0x423f('0x33')][_0x423f('0x45')]?_0x3bc113[_0x423f('0x33')]:_0x192ae5[_0x423f('0x2d')];if(_0x518443[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3bc113[_0x423f('0x46')]=[{'all':!![]}];}_0x3bc113=_[_0x423f('0x3c')]({},_0x3bc113,_0x518443[_0x423f('0x3e')]);return db[_0x423f('0x28')]['find'](_0x3bc113)[_0x423f('0x21')](handleEntityNotFound(_0x4165e0,null))['then'](respondWithResult(_0x4165e0,null))[_0x423f('0x42')](handleError(_0x4165e0,null));};exports[_0x423f('0x47')]=function(_0x1cf881,_0x37035a){return db[_0x423f('0x28')][_0x423f('0x47')](_0x1cf881[_0x423f('0x48')],{})[_0x423f('0x21')](respondWithResult(_0x37035a,0xc9))[_0x423f('0x42')](handleError(_0x37035a,null));};exports[_0x423f('0x49')]=function(_0x31b88e,_0x2dcbec){if(_0x31b88e['body']['id']){delete _0x31b88e[_0x423f('0x48')]['id'];}return db[_0x423f('0x28')]['find']({'where':{'id':_0x31b88e[_0x423f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dcbec,null))[_0x423f('0x21')](saveUpdates(_0x31b88e['body'],null))['then'](respondWithResult(_0x2dcbec,null))[_0x423f('0x42')](handleError(_0x2dcbec,null));};exports[_0x423f('0x22')]=function(_0x1668d4,_0x4114e1){return db['Cdr'][_0x423f('0x4a')]({'where':{'id':_0x1668d4['params']['id']}})[_0x423f('0x21')](handleEntityNotFound(_0x4114e1,null))[_0x423f('0x21')](removeEntity(_0x4114e1,null))[_0x423f('0x42')](handleError(_0x4114e1,null));};exports[_0x423f('0x4b')]=function(_0x17c2b6,_0x961f0d){return db[_0x423f('0x28')][_0x423f('0x4b')]()[_0x423f('0x21')](respondWithResult(_0x961f0d,null))['catch'](handleError(_0x961f0d,null));}; \ No newline at end of file +var _0x032e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0xc48470,_0x2561ad){var _0x2152be=function(_0x2a0a34){while(--_0x2a0a34){_0xc48470['push'](_0xc48470['shift']());}};_0x2152be(++_0x2561ad);}(_0x032e,0x124));var _0xe032=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x032e[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['Cdr'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_0x4e8b72,_0xe032('0x29'));_0x469290[_0xe032('0x30')]=_[_0xe032('0x31')](_0x5573e4['query']);_0x469290[_0xe032('0x32')]=_[_0xe032('0x33')](_0x469290[_0xe032('0x2e')],_0x469290[_0xe032('0x30')]);_0x38e7ea['attributes']=_[_0xe032('0x33')](_0x469290['model'],qs[_0xe032('0x34')](_0x5573e4['query'][_0xe032('0x34')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x35')]['length']?_0x38e7ea[_0xe032('0x35')]:_0x469290[_0xe032('0x2e')];if(!_0x5573e4['query'][_0xe032('0x36')](_0xe032('0x37'))){_0x38e7ea[_0xe032('0x21')]=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea['offset']=qs[_0xe032('0x1f')](_0x5573e4[_0xe032('0x30')]['offset']);}_0x38e7ea[_0xe032('0x38')]=qs[_0xe032('0x39')](_0x5573e4['query'][_0xe032('0x39')]);_0x38e7ea[_0xe032('0x3a')]=qs[_0xe032('0x32')](_[_0xe032('0x3b')](_0x5573e4[_0xe032('0x30')],_0x469290[_0xe032('0x32')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x30')][_0xe032('0x3c')]){_0x38e7ea[_0xe032('0x3a')]=_[_0xe032('0x3d')](_0x38e7ea[_0xe032('0x3a')],{'$or':_[_0xe032('0x2f')](_0x4e8b72,function(_0x30571c){if(_0x30571c[_0xe032('0x2d')]!==_0xe032('0x3e')){var _0x14ea1a={};_0x14ea1a[_0x30571c[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3c')]+'%'};return _0x14ea1a;}})});}_0x38e7ea=_['merge']({},_0x38e7ea,_0x5573e4[_0xe032('0x3f')]);var _0x2bcfb4={'where':_0x38e7ea[_0xe032('0x3a')]};return db[_0xe032('0x40')][_0xe032('0x22')](_0x2bcfb4)['then'](function(_0x132d25){_0xae116e['count']=_0x132d25;if(_0x5573e4[_0xe032('0x30')]['includeAll']){_0x38e7ea[_0xe032('0x41')]=[{'all':!![]}];}return db[_0xe032('0x40')][_0xe032('0x42')](_0x38e7ea);})[_0xe032('0x27')](function(_0x4dc836){_0xae116e[_0xe032('0x43')]=_0x4dc836;return _0xae116e;})['then'](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x44')](handleError(_0x3e2575,null));};exports[_0xe032('0x45')]=function(_0x3c43f1,_0xe572b6){var _0x4b58eb={'raw':!![],'where':{'id':_0x3c43f1[_0xe032('0x46')]['id']}},_0x513b0c={};_0x513b0c[_0xe032('0x2e')]=_['keys'](db[_0xe032('0x40')][_0xe032('0x2b')]);_0x513b0c[_0xe032('0x30')]=_[_0xe032('0x31')](_0x3c43f1[_0xe032('0x30')]);_0x513b0c['filters']=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],_0x513b0c[_0xe032('0x30')]);_0x4b58eb[_0xe032('0x35')]=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],qs[_0xe032('0x34')](_0x3c43f1[_0xe032('0x30')]['fields']));_0x4b58eb['attributes']=_0x4b58eb[_0xe032('0x35')]['length']?_0x4b58eb[_0xe032('0x35')]:_0x513b0c[_0xe032('0x2e')];if(_0x3c43f1[_0xe032('0x30')][_0xe032('0x47')]){_0x4b58eb[_0xe032('0x41')]=[{'all':!![]}];}_0x4b58eb=_[_0xe032('0x3d')]({},_0x4b58eb,_0x3c43f1[_0xe032('0x3f')]);return db[_0xe032('0x40')][_0xe032('0x48')](_0x4b58eb)['then'](handleEntityNotFound(_0xe572b6,null))[_0xe032('0x27')](respondWithResult(_0xe572b6,null))['catch'](handleError(_0xe572b6,null));};exports['create']=function(_0x28f973,_0x2583e9){return db[_0xe032('0x40')][_0xe032('0x49')](_0x28f973['body'],{})[_0xe032('0x27')](respondWithResult(_0x2583e9,0xc9))[_0xe032('0x44')](handleError(_0x2583e9,null));};exports[_0xe032('0x26')]=function(_0x39ffb7,_0x1b3172){if(_0x39ffb7[_0xe032('0x4a')]['id']){delete _0x39ffb7[_0xe032('0x4a')]['id'];}return db['Cdr'][_0xe032('0x48')]({'where':{'id':_0x39ffb7[_0xe032('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b3172,null))[_0xe032('0x27')](saveUpdates(_0x39ffb7[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x1b3172,null))[_0xe032('0x44')](handleError(_0x1b3172,null));};exports[_0xe032('0x4b')]=function(_0x434f1a,_0x24b013){return db[_0xe032('0x40')][_0xe032('0x48')]({'where':{'id':_0x434f1a[_0xe032('0x46')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x24b013,null))[_0xe032('0x27')](removeEntity(_0x24b013,null))[_0xe032('0x44')](handleError(_0x24b013,null));};exports[_0xe032('0x4c')]=function(_0x4eabfc,_0x1c8b32){return db['Cdr'][_0xe032('0x4c')]()[_0xe032('0x27')](respondWithResult(_0x1c8b32,null))[_0xe032('0x44')](handleError(_0x1c8b32,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2bb0bd3..8000500 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(_0x3555c0,_0x1b32cd){var _0x9852f8=function(_0x387282){while(--_0x387282){_0x3555c0['push'](_0x3555c0['shift']());}};_0x9852f8(++_0x1b32cd);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3f62d8,_0x4ebd4a){var _0x4a649d=function(_0x2b69dc){while(--_0x2b69dc){_0x3f62d8['push'](_0x3f62d8['shift']());}};_0x4a649d(++_0x4ebd4a);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index eaa132c..6963d7c 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 _0x2cb5=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch'];(function(_0x493a89,_0x2f5fac){var _0x5be45c=function(_0x1147ed){while(--_0x1147ed){_0x493a89['push'](_0x493a89['shift']());}};_0x5be45c(++_0x2f5fac);}(_0x2cb5,0x176));var _0x52cb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2cb5[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x52cb('0x0'));var util=require(_0x52cb('0x1'));var moment=require(_0x52cb('0x2'));var BPromise=require(_0x52cb('0x3'));var rs=require(_0x52cb('0x4'));var fs=require('fs');var Redis=require(_0x52cb('0x5'));var db=require(_0x52cb('0x6'))['db'];var utils=require(_0x52cb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x52cb('0x8'));var jayson=require(_0x52cb('0x9'));var client=jayson[_0x52cb('0xa')][_0x52cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38e38e,_0x2a7bb9,_0x5e5844){return new BPromise(function(_0x367c8f,_0x4a5b98){return client['request'](_0x38e38e,_0x5e5844)[_0x52cb('0xc')](function(_0x2b185a){logger[_0x52cb('0xd')]('Cdr,\x20%s,\x20%s',_0x2a7bb9,'request\x20sent');logger['debug'](_0x52cb('0xe'),_0x2a7bb9,_0x52cb('0xf'),JSON[_0x52cb('0x10')](_0x2b185a));if(_0x2b185a[_0x52cb('0x11')]){if(_0x2b185a[_0x52cb('0x11')][_0x52cb('0x12')]===0x1f4){logger[_0x52cb('0x11')](_0x52cb('0x13'),_0x2a7bb9,_0x2b185a['error'][_0x52cb('0x14')]);return _0x4a5b98(_0x2b185a[_0x52cb('0x11')][_0x52cb('0x14')]);}logger['error'](_0x52cb('0x13'),_0x2a7bb9,_0x2b185a['error'][_0x52cb('0x14')]);return _0x367c8f(_0x2b185a[_0x52cb('0x11')][_0x52cb('0x14')]);}else{logger['info'](_0x52cb('0x13'),_0x2a7bb9,_0x52cb('0xf'));_0x367c8f(_0x2b185a['result'][_0x52cb('0x14')]);}})[_0x52cb('0x15')](function(_0x51f481){logger[_0x52cb('0x11')](_0x52cb('0x13'),_0x2a7bb9,_0x51f481);_0x4a5b98(_0x51f481);});});} \ No newline at end of file +var _0x1131=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e6e33,_0x507530){var _0x79305a=function(_0x12308b){while(--_0x12308b){_0x4e6e33['push'](_0x4e6e33['shift']());}};_0x79305a(++_0x507530);}(_0x1131,0x8b));var _0x1113=function(_0x229689,_0xa87582){_0x229689=_0x229689-0x0;var _0x3e7163=_0x1131[_0x229689];return _0x3e7163;};'use strict';var _=require('lodash');var util=require(_0x1113('0x0'));var moment=require(_0x1113('0x1'));var BPromise=require(_0x1113('0x2'));var rs=require(_0x1113('0x3'));var fs=require('fs');var Redis=require(_0x1113('0x4'));var db=require(_0x1113('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1113('0x6'))(_0x1113('0x7'));var config=require('../../config/environment');var jayson=require(_0x1113('0x8'));var client=jayson[_0x1113('0x9')][_0x1113('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c8ff1,_0x26bfeb,_0x523a29){return new BPromise(function(_0x268c69,_0x5cae96){return client[_0x1113('0xb')](_0x4c8ff1,_0x523a29)[_0x1113('0xc')](function(_0x2a662a){logger[_0x1113('0xd')](_0x1113('0xe'),_0x26bfeb,_0x1113('0xf'));logger[_0x1113('0x10')](_0x1113('0x11'),_0x26bfeb,_0x1113('0xf'),JSON[_0x1113('0x12')](_0x2a662a));if(_0x2a662a['error']){if(_0x2a662a['error'][_0x1113('0x13')]===0x1f4){logger[_0x1113('0x14')](_0x1113('0xe'),_0x26bfeb,_0x2a662a[_0x1113('0x14')][_0x1113('0x15')]);return _0x5cae96(_0x2a662a[_0x1113('0x14')][_0x1113('0x15')]);}logger['error'](_0x1113('0xe'),_0x26bfeb,_0x2a662a[_0x1113('0x14')][_0x1113('0x15')]);return _0x268c69(_0x2a662a[_0x1113('0x14')]['message']);}else{logger[_0x1113('0xd')](_0x1113('0xe'),_0x26bfeb,_0x1113('0xf'));_0x268c69(_0x2a662a[_0x1113('0x16')]['message']);}})[_0x1113('0x17')](function(_0x482070){logger[_0x1113('0x14')]('Cdr,\x20%s,\x20%s',_0x26bfeb,_0x482070);_0x5cae96(_0x482070);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 53fdead..749b741 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(_0x60a935,_0x4fae24){var _0x4e22a0=function(_0x395a0a){while(--_0x395a0a){_0x60a935['push'](_0x60a935['shift']());}};_0x4e22a0(++_0x4fae24);}(_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'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x45e647,_0x2c482c){var _0x2deace=function(_0x12e383){while(--_0x12e383){_0x45e647['push'](_0x45e647['shift']());}};_0x2deace(++_0x2c482c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 36064dc..ea1f84c 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 _0x4b72=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x6bbb11,_0x44e6b5){var _0x4c4dc3=function(_0x1307e8){while(--_0x1307e8){_0x6bbb11['push'](_0x6bbb11['shift']());}};_0x4c4dc3(++_0x44e6b5);}(_0x4b72,0x141));var _0x24b7=function(_0x1df6e8,_0x4589fe){_0x1df6e8=_0x1df6e8-0x0;var _0xf2f7b6=_0x4b72[_0x1df6e8];return _0xf2f7b6;};'use strict';var Sequelize=require(_0x24b7('0x0'));module[_0x24b7('0x1')]={'priority':{'type':Sequelize[_0x24b7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x24b7('0x3')},'appdata':{'type':Sequelize[_0x24b7('0x4')]()},'description':{'type':Sequelize[_0x24b7('0x5')]},'interval':{'type':Sequelize[_0x24b7('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xdf0e=['exports','STRING','TEXT','sequelize'];(function(_0x3aa341,_0xf2becc){var _0x4bd698=function(_0x5b7c81){while(--_0x5b7c81){_0x3aa341['push'](_0x3aa341['shift']());}};_0x4bd698(++_0xf2becc);}(_0xdf0e,0xa7));var _0xedf0=function(_0x5ea326,_0x3d52fa){_0x5ea326=_0x5ea326-0x0;var _0x48cf87=_0xdf0e[_0x5ea326];return _0x48cf87;};'use strict';var Sequelize=require(_0xedf0('0x0'));module[_0xedf0('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xedf0('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xedf0('0x3')]()},'description':{'type':Sequelize[_0xedf0('0x2')]},'interval':{'type':Sequelize[_0xedf0('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 925b24a..fb302fa 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 _0x76bc=['send','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','name'];(function(_0x450b15,_0x28ac6b){var _0x35ae8a=function(_0x560ae7){while(--_0x560ae7){_0x450b15['push'](_0x450b15['shift']());}};_0x35ae8a(++_0x28ac6b);}(_0x76bc,0x17f));var _0xc76b=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x76bc[_0xf9a6cf];return _0x59e2bc;};'use strict';var emlformat=require(_0xc76b('0x0'));var rimraf=require(_0xc76b('0x1'));var zipdir=require(_0xc76b('0x2'));var jsonpatch=require(_0xc76b('0x3'));var rp=require(_0xc76b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc76b('0x5'));var util=require(_0xc76b('0x6'));var path=require(_0xc76b('0x7'));var sox=require(_0xc76b('0x8'));var csv=require(_0xc76b('0x9'));var ejs=require(_0xc76b('0xa'));var fs=require('fs');var fs_extra=require(_0xc76b('0xb'));var _=require(_0xc76b('0xc'));var squel=require(_0xc76b('0xd'));var crypto=require(_0xc76b('0xe'));var jsforce=require(_0xc76b('0xf'));var deskjs=require(_0xc76b('0x10'));var toCsv=require(_0xc76b('0x9'));var querystring=require(_0xc76b('0x11'));var Papa=require(_0xc76b('0x12'));var Redis=require(_0xc76b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc76b('0x14'));var as=require(_0xc76b('0x15'));var hardwareService=require(_0xc76b('0x16'));var logger=require(_0xc76b('0x17'))(_0xc76b('0x18'));var utils=require(_0xc76b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc76b('0x1a'));var db=require(_0xc76b('0x1b'))['db'];function respondWithStatusCode(_0x30835f,_0xc84b2c){_0xc84b2c=_0xc84b2c||0xcc;return function(_0x4474cd){if(_0x4474cd){return _0x30835f[_0xc76b('0x1c')](_0xc84b2c);}return _0x30835f[_0xc76b('0x1d')](_0xc84b2c)['end']();};}function respondWithResult(_0x538ca8,_0x38a0f1){_0x38a0f1=_0x38a0f1||0xc8;return function(_0x25e4a1){if(_0x25e4a1){return _0x538ca8[_0xc76b('0x1d')](_0x38a0f1)[_0xc76b('0x1e')](_0x25e4a1);}};}function respondWithFilteredResult(_0x25752f,_0x5d1130){return function(_0x21d99a){if(_0x21d99a){var _0x2db167=typeof _0x5d1130[_0xc76b('0x1f')]==='undefined'&&typeof _0x5d1130['limit']===_0xc76b('0x20');var _0x2d3e9d=_0x21d99a[_0xc76b('0x21')];var _0x3e716e=_0x2db167?0x0:_0x5d1130[_0xc76b('0x1f')];var _0x55a61d=_0x2db167?_0x21d99a['count']:_0x5d1130['offset']+_0x5d1130[_0xc76b('0x22')];var _0x164d38;if(_0x55a61d>=_0x2d3e9d){_0x55a61d=_0x2d3e9d;_0x164d38=0xc8;}else{_0x164d38=0xce;}_0x25752f[_0xc76b('0x1d')](_0x164d38);return _0x25752f[_0xc76b('0x23')](_0xc76b('0x24'),_0x3e716e+'-'+_0x55a61d+'/'+_0x2d3e9d)[_0xc76b('0x1e')](_0x21d99a);}return null;};}function patchUpdates(_0x336be9){return function(_0x20aed4){try{jsonpatch[_0xc76b('0x25')](_0x20aed4,_0x336be9,!![]);}catch(_0x393b0b){return BPromise['reject'](_0x393b0b);}return _0x20aed4[_0xc76b('0x26')]();};}function saveUpdates(_0x4bf5a9,_0x51fafe){return function(_0x3bbede){if(_0x3bbede){return _0x3bbede[_0xc76b('0x27')](_0x4bf5a9)[_0xc76b('0x28')](function(_0xac9a7f){return _0xac9a7f;});}return null;};}function removeEntity(_0x18332d,_0xa6a862){return function(_0x24ee9a){if(_0x24ee9a){return _0x24ee9a[_0xc76b('0x29')]()['then'](function(){_0x18332d[_0xc76b('0x1d')](0xcc)[_0xc76b('0x2a')]();});}};}function handleEntityNotFound(_0x5f0a7b,_0xf43320){return function(_0x2ac9de){if(!_0x2ac9de){_0x5f0a7b[_0xc76b('0x1c')](0x194);}return _0x2ac9de;};}function handleError(_0x25ea69,_0x369fc1){_0x369fc1=_0x369fc1||0x1f4;return function(_0x451ee1){logger['error'](_0x451ee1['stack']);if(_0x451ee1[_0xc76b('0x2b')]){delete _0x451ee1[_0xc76b('0x2b')];}_0x25ea69[_0xc76b('0x1d')](_0x369fc1)[_0xc76b('0x2c')](_0x451ee1);};}exports['show']=function(_0xd92178,_0x26c19b){var _0x35d1bc={'raw':!![],'where':{'id':_0xd92178[_0xc76b('0x2d')]['id']}},_0x4a0918={};_0x4a0918[_0xc76b('0x2e')]=_[_0xc76b('0x2f')](db[_0xc76b('0x30')]['rawAttributes']);_0x4a0918[_0xc76b('0x31')]=_[_0xc76b('0x2f')](_0xd92178[_0xc76b('0x31')]);_0x4a0918[_0xc76b('0x32')]=_[_0xc76b('0x33')](_0x4a0918['model'],_0x4a0918[_0xc76b('0x31')]);_0x35d1bc['attributes']=_[_0xc76b('0x33')](_0x4a0918[_0xc76b('0x2e')],qs[_0xc76b('0x34')](_0xd92178[_0xc76b('0x31')][_0xc76b('0x34')]));_0x35d1bc[_0xc76b('0x35')]=_0x35d1bc['attributes']['length']?_0x35d1bc[_0xc76b('0x35')]:_0x4a0918[_0xc76b('0x2e')];if(_0xd92178[_0xc76b('0x31')][_0xc76b('0x36')]){_0x35d1bc[_0xc76b('0x37')]=[{'all':!![]}];}_0x35d1bc=_[_0xc76b('0x38')]({},_0x35d1bc,_0xd92178[_0xc76b('0x39')]);return db[_0xc76b('0x30')][_0xc76b('0x3a')](_0x35d1bc)[_0xc76b('0x28')](handleEntityNotFound(_0x26c19b,null))[_0xc76b('0x28')](respondWithResult(_0x26c19b,null))[_0xc76b('0x3b')](handleError(_0x26c19b,null));};exports[_0xc76b('0x27')]=function(_0x21bc23,_0xb3c2c6){if(_0x21bc23['body']['id']){delete _0x21bc23[_0xc76b('0x3c')]['id'];}return db[_0xc76b('0x30')][_0xc76b('0x3a')]({'where':{'id':_0x21bc23[_0xc76b('0x2d')]['id']}})[_0xc76b('0x28')](handleEntityNotFound(_0xb3c2c6,null))[_0xc76b('0x28')](saveUpdates(_0x21bc23[_0xc76b('0x3c')],null))[_0xc76b('0x28')](respondWithResult(_0xb3c2c6,null))[_0xc76b('0x3b')](handleError(_0xb3c2c6,null));};exports[_0xc76b('0x29')]=function(_0x41d26d,_0x3fc3d7){return db[_0xc76b('0x30')][_0xc76b('0x3a')]({'where':{'id':_0x41d26d['params']['id']}})[_0xc76b('0x28')](handleEntityNotFound(_0x3fc3d7,null))['then'](removeEntity(_0x3fc3d7,null))[_0xc76b('0x3b')](handleError(_0x3fc3d7,null));}; \ No newline at end of file +var _0x1ddc=['ejs','lodash','squel','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','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','options','find','update','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x2e7054,_0x3e955e){_0x2e7054=_0x2e7054-0x0;var _0x5b08a0=_0x1ddc[_0x2e7054];return _0x5b08a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1dd('0x0'));var zipdir=require(_0xc1dd('0x1'));var jsonpatch=require(_0xc1dd('0x2'));var rp=require('request-promise');var moment=require(_0xc1dd('0x3'));var BPromise=require(_0xc1dd('0x4'));var Mustache=require('mustache');var util=require(_0xc1dd('0x5'));var path=require(_0xc1dd('0x6'));var sox=require('sox');var csv=require(_0xc1dd('0x7'));var ejs=require(_0xc1dd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1dd('0x9'));var squel=require(_0xc1dd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc1dd('0xb'));var toCsv=require(_0xc1dd('0x7'));var querystring=require(_0xc1dd('0xc'));var Papa=require(_0xc1dd('0xd'));var Redis=require('ioredis');var authService=require(_0xc1dd('0xe'));var qs=require(_0xc1dd('0xf'));var as=require(_0xc1dd('0x10'));var hardwareService=require(_0xc1dd('0x11'));var logger=require('../../config/logger')(_0xc1dd('0x12'));var utils=require(_0xc1dd('0x13'));var config=require(_0xc1dd('0x14'));var licenseUtil=require(_0xc1dd('0x15'));var db=require(_0xc1dd('0x16'))['db'];function respondWithStatusCode(_0x2613c9,_0x1d9815){_0x1d9815=_0x1d9815||0xcc;return function(_0x83a291){if(_0x83a291){return _0x2613c9[_0xc1dd('0x17')](_0x1d9815);}return _0x2613c9[_0xc1dd('0x18')](_0x1d9815)[_0xc1dd('0x19')]();};}function respondWithResult(_0x576fc1,_0x3d4c7f){_0x3d4c7f=_0x3d4c7f||0xc8;return function(_0x30f49a){if(_0x30f49a){return _0x576fc1[_0xc1dd('0x18')](_0x3d4c7f)[_0xc1dd('0x1a')](_0x30f49a);}};}function respondWithFilteredResult(_0x104177,_0x52a9b8){return function(_0xe5a17a){if(_0xe5a17a){var _0x76994c=typeof _0x52a9b8[_0xc1dd('0x1b')]===_0xc1dd('0x1c')&&typeof _0x52a9b8['limit']==='undefined';var _0x3e7e6f=_0xe5a17a['count'];var _0x35139a=_0x76994c?0x0:_0x52a9b8['offset'];var _0x6198a7=_0x76994c?_0xe5a17a[_0xc1dd('0x1d')]:_0x52a9b8[_0xc1dd('0x1b')]+_0x52a9b8[_0xc1dd('0x1e')];var _0x312054;if(_0x6198a7>=_0x3e7e6f){_0x6198a7=_0x3e7e6f;_0x312054=0xc8;}else{_0x312054=0xce;}_0x104177[_0xc1dd('0x18')](_0x312054);return _0x104177['set'](_0xc1dd('0x1f'),_0x35139a+'-'+_0x6198a7+'/'+_0x3e7e6f)[_0xc1dd('0x1a')](_0xe5a17a);}return null;};}function patchUpdates(_0x5e99a6){return function(_0x3d22bb){try{jsonpatch[_0xc1dd('0x20')](_0x3d22bb,_0x5e99a6,!![]);}catch(_0x3650fd){return BPromise[_0xc1dd('0x21')](_0x3650fd);}return _0x3d22bb[_0xc1dd('0x22')]();};}function saveUpdates(_0x266147,_0x228626){return function(_0x60ef4a){if(_0x60ef4a){return _0x60ef4a['update'](_0x266147)[_0xc1dd('0x23')](function(_0x16a2b0){return _0x16a2b0;});}return null;};}function removeEntity(_0x22f9be,_0x3363ff){return function(_0x5f4c9e){if(_0x5f4c9e){return _0x5f4c9e[_0xc1dd('0x24')]()[_0xc1dd('0x23')](function(){_0x22f9be[_0xc1dd('0x18')](0xcc)[_0xc1dd('0x19')]();});}};}function handleEntityNotFound(_0x16fb8b,_0x1aea60){return function(_0x3c3a32){if(!_0x3c3a32){_0x16fb8b[_0xc1dd('0x17')](0x194);}return _0x3c3a32;};}function handleError(_0x29dc08,_0x41d319){_0x41d319=_0x41d319||0x1f4;return function(_0x1212c3){logger[_0xc1dd('0x25')](_0x1212c3[_0xc1dd('0x26')]);if(_0x1212c3[_0xc1dd('0x27')]){delete _0x1212c3['name'];}_0x29dc08['status'](_0x41d319)[_0xc1dd('0x28')](_0x1212c3);};}exports[_0xc1dd('0x29')]=function(_0x25a651,_0x1e112){var _0x2b5dbe={'raw':!![],'where':{'id':_0x25a651[_0xc1dd('0x2a')]['id']}},_0x39b8ac={};_0x39b8ac['model']=_[_0xc1dd('0x2b')](db[_0xc1dd('0x2c')][_0xc1dd('0x2d')]);_0x39b8ac[_0xc1dd('0x2e')]=_['keys'](_0x25a651[_0xc1dd('0x2e')]);_0x39b8ac[_0xc1dd('0x2f')]=_[_0xc1dd('0x30')](_0x39b8ac['model'],_0x39b8ac[_0xc1dd('0x2e')]);_0x2b5dbe['attributes']=_[_0xc1dd('0x30')](_0x39b8ac[_0xc1dd('0x31')],qs[_0xc1dd('0x32')](_0x25a651['query'][_0xc1dd('0x32')]));_0x2b5dbe[_0xc1dd('0x33')]=_0x2b5dbe[_0xc1dd('0x33')][_0xc1dd('0x34')]?_0x2b5dbe['attributes']:_0x39b8ac[_0xc1dd('0x31')];if(_0x25a651[_0xc1dd('0x2e')][_0xc1dd('0x35')]){_0x2b5dbe['include']=[{'all':!![]}];}_0x2b5dbe=_['merge']({},_0x2b5dbe,_0x25a651[_0xc1dd('0x36')]);return db[_0xc1dd('0x2c')][_0xc1dd('0x37')](_0x2b5dbe)[_0xc1dd('0x23')](handleEntityNotFound(_0x1e112,null))[_0xc1dd('0x23')](respondWithResult(_0x1e112,null))['catch'](handleError(_0x1e112,null));};exports[_0xc1dd('0x38')]=function(_0xe09168,_0x544b71){if(_0xe09168[_0xc1dd('0x39')]['id']){delete _0xe09168[_0xc1dd('0x39')]['id'];}return db[_0xc1dd('0x2c')]['find']({'where':{'id':_0xe09168[_0xc1dd('0x2a')]['id']}})['then'](handleEntityNotFound(_0x544b71,null))[_0xc1dd('0x23')](saveUpdates(_0xe09168[_0xc1dd('0x39')],null))['then'](respondWithResult(_0x544b71,null))[_0xc1dd('0x3a')](handleError(_0x544b71,null));};exports[_0xc1dd('0x24')]=function(_0x28723c,_0x299842){return db[_0xc1dd('0x2c')][_0xc1dd('0x37')]({'where':{'id':_0x28723c[_0xc1dd('0x2a')]['id']}})[_0xc1dd('0x23')](handleEntityNotFound(_0x299842,null))[_0xc1dd('0x23')](removeEntity(_0x299842,null))[_0xc1dd('0x3a')](handleError(_0x299842,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 56fb25f..6a625d6 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 _0xece1=['define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x140d18,_0x5bb6f7){var _0x2a4de4=function(_0xc08464){while(--_0xc08464){_0x140d18['push'](_0x140d18['shift']());}};_0x2a4de4(++_0x5bb6f7);}(_0xece1,0x8a));var _0x1ece=function(_0x29cd1e,_0x4e7512){_0x29cd1e=_0x29cd1e-0x0;var _0x47bb36=_0xece1[_0x29cd1e];return _0x47bb36;};'use strict';var _=require(_0x1ece('0x0'));var util=require(_0x1ece('0x1'));var logger=require(_0x1ece('0x2'))(_0x1ece('0x3'));var moment=require(_0x1ece('0x4'));var BPromise=require(_0x1ece('0x5'));var rp=require(_0x1ece('0x6'));var fs=require('fs');var path=require(_0x1ece('0x7'));var rimraf=require(_0x1ece('0x8'));var config=require(_0x1ece('0x9'));var attributes=require(_0x1ece('0xa'));module[_0x1ece('0xb')]=function(_0xfe0b6c,_0x5a65b6){return _0xfe0b6c[_0x1ece('0xc')](_0x1ece('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ece('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6953=['chat_applications','utf8mb4','lodash','util','bluebird','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x6953,0x91));var _0x3695=function(_0x1ba4c1,_0x3f409f){_0x1ba4c1=_0x1ba4c1-0x0;var _0x42304c=_0x6953[_0x1ba4c1];return _0x42304c;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3695('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3695('0x3'));var rimraf=require(_0x3695('0x4'));var config=require(_0x3695('0x5'));var attributes=require('./chatApplication.attributes');module[_0x3695('0x6')]=function(_0x558026,_0x2d7d98){return _0x558026[_0x3695('0x7')](_0x3695('0x8'),attributes,{'tableName':_0x3695('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3695('0xa'),'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 f144a4b..da1d9a9 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 _0xa58a=['../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x507f9e,_0x308d20){var _0x250f7e=function(_0x144202){while(--_0x144202){_0x507f9e['push'](_0x507f9e['shift']());}};_0x250f7e(++_0x308d20);}(_0xa58a,0x18a));var _0xaa58=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xa58a[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var util=require(_0xaa58('0x0'));var moment=require(_0xaa58('0x1'));var BPromise=require(_0xaa58('0x2'));var rs=require(_0xaa58('0x3'));var fs=require('fs');var Redis=require(_0xaa58('0x4'));var db=require(_0xaa58('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xaa58('0x6'));var jayson=require(_0xaa58('0x7'));var client=jayson['client'][_0xaa58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a26a9,_0x1802a0,_0x320f8c){return new BPromise(function(_0x9113d4,_0x33e24d){return client[_0xaa58('0x9')](_0x3a26a9,_0x320f8c)[_0xaa58('0xa')](function(_0x234ada){logger[_0xaa58('0xb')](_0xaa58('0xc'),_0x1802a0,'request\x20sent');logger[_0xaa58('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1802a0,_0xaa58('0xe'),JSON[_0xaa58('0xf')](_0x234ada));if(_0x234ada[_0xaa58('0x10')]){if(_0x234ada[_0xaa58('0x10')]['code']===0x1f4){logger['error'](_0xaa58('0xc'),_0x1802a0,_0x234ada[_0xaa58('0x10')]['message']);return _0x33e24d(_0x234ada['error']['message']);}logger[_0xaa58('0x10')](_0xaa58('0xc'),_0x1802a0,_0x234ada[_0xaa58('0x10')][_0xaa58('0x11')]);return _0x9113d4(_0x234ada['error'][_0xaa58('0x11')]);}else{logger[_0xaa58('0xb')](_0xaa58('0xc'),_0x1802a0,_0xaa58('0xe'));_0x9113d4(_0x234ada[_0xaa58('0x12')]['message']);}})[_0xaa58('0x13')](function(_0x167a2a){logger['error'](_0xaa58('0xc'),_0x1802a0,_0x167a2a);_0x33e24d(_0x167a2a);});});} \ No newline at end of file +var _0x1838=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash'];(function(_0x59347e,_0x5a45aa){var _0x56cadd=function(_0x34ae1b){while(--_0x34ae1b){_0x59347e['push'](_0x59347e['shift']());}};_0x56cadd(++_0x5a45aa);}(_0x1838,0x1a3));var _0x8183=function(_0x203374,_0x314eb7){_0x203374=_0x203374-0x0;var _0x469bf3=_0x1838[_0x203374];return _0x469bf3;};'use strict';var _=require(_0x8183('0x0'));var util=require('util');var moment=require(_0x8183('0x1'));var BPromise=require('bluebird');var rs=require(_0x8183('0x2'));var fs=require('fs');var Redis=require(_0x8183('0x3'));var db=require(_0x8183('0x4'))['db'];var utils=require(_0x8183('0x5'));var logger=require(_0x8183('0x6'))(_0x8183('0x7'));var config=require(_0x8183('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8183('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcd26c8,_0x394359,_0x362c94){return new BPromise(function(_0x15e265,_0x480f6b){return client[_0x8183('0xa')](_0xcd26c8,_0x362c94)['then'](function(_0x42fe35){logger[_0x8183('0xb')]('ChatApplication,\x20%s,\x20%s',_0x394359,_0x8183('0xc'));logger[_0x8183('0xd')](_0x8183('0xe'),_0x394359,_0x8183('0xc'),JSON[_0x8183('0xf')](_0x42fe35));if(_0x42fe35[_0x8183('0x10')]){if(_0x42fe35[_0x8183('0x10')][_0x8183('0x11')]===0x1f4){logger['error'](_0x8183('0x12'),_0x394359,_0x42fe35['error'][_0x8183('0x13')]);return _0x480f6b(_0x42fe35[_0x8183('0x10')][_0x8183('0x13')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x394359,_0x42fe35[_0x8183('0x10')][_0x8183('0x13')]);return _0x15e265(_0x42fe35['error'][_0x8183('0x13')]);}else{logger[_0x8183('0xb')]('ChatApplication,\x20%s,\x20%s',_0x394359,_0x8183('0xc'));_0x15e265(_0x42fe35['result'][_0x8183('0x13')]);}})[_0x8183('0x14')](function(_0x1f3722){logger[_0x8183('0x10')](_0x8183('0x12'),_0x394359,_0x1f3722);_0x480f6b(_0x1f3722);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index baa1e90..2756adc 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 _0xa209=['express','fs-extra','../../config/environment','./chatApplication.controller','get','put','/:id','delete','isAuthenticated','destroy','multer','util','connect-timeout'];(function(_0x388e6c,_0x2ca243){var _0x3dc6de=function(_0x1dfd84){while(--_0x1dfd84){_0x388e6c['push'](_0x388e6c['shift']());}};_0x3dc6de(++_0x2ca243);}(_0xa209,0x11b));var _0x9a20=function(_0x12a0c5,_0x46b206){_0x12a0c5=_0x12a0c5-0x0;var _0x14e148=_0xa209[_0x12a0c5];return _0x14e148;};'use strict';var multer=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var path=require('path');var timeout=require(_0x9a20('0x2'));var express=require(_0x9a20('0x3'));var router=express['Router']();var fs_extra=require(_0x9a20('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a20('0x5'));var controller=require(_0x9a20('0x6'));router[_0x9a20('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9a20('0x8')](_0x9a20('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x9a20('0xa')](_0x9a20('0x9'),auth[_0x9a20('0xb')](),controller[_0x9a20('0xc')]);module['exports']=router; \ No newline at end of file +var _0x17b7=['update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','isAuthenticated','show','put','/:id'];(function(_0x464582,_0x3cf4c6){var _0x1e161c=function(_0x236733){while(--_0x236733){_0x464582['push'](_0x464582['shift']());}};_0x1e161c(++_0x3cf4c6);}(_0x17b7,0xc3));var _0x717b=function(_0x1a19f2,_0x44c1eb){_0x1a19f2=_0x1a19f2-0x0;var _0xeb7e0=_0x17b7[_0x1a19f2];return _0xeb7e0;};'use strict';var multer=require(_0x717b('0x0'));var util=require(_0x717b('0x1'));var path=require(_0x717b('0x2'));var timeout=require(_0x717b('0x3'));var express=require(_0x717b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x717b('0x5'));var interaction=require(_0x717b('0x6'));var config=require('../../config/environment');var controller=require(_0x717b('0x7'));router[_0x717b('0x8')]('/:id',auth[_0x717b('0x9')](),controller[_0x717b('0xa')]);router[_0x717b('0xb')](_0x717b('0xc'),auth[_0x717b('0x9')](),controller[_0x717b('0xd')]);router[_0x717b('0xe')](_0x717b('0xc'),auth['isAuthenticated'](),controller[_0x717b('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 39f65c6..e5e86b8 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 _0x3f1b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x582171,_0x443d13){var _0x6e3900=function(_0x399c20){while(--_0x399c20){_0x582171['push'](_0x582171['shift']());}};_0x6e3900(++_0x443d13);}(_0x3f1b,0xcc));var _0xb3f1=function(_0x9b16c6,_0x24be9c){_0x9b16c6=_0x9b16c6-0x0;var _0x21bbd7=_0x3f1b[_0x9b16c6];return _0x21bbd7;};'use strict';var Sequelize=require(_0xb3f1('0x0'));module[_0xb3f1('0x1')]={'name':{'type':Sequelize[_0xb3f1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb3f1('0x2')]},'write':{'type':Sequelize[_0xb3f1('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x961e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1b40cf,_0x341a7a){var _0x16f16b=function(_0x12f14e){while(--_0x12f14e){_0x1b40cf['push'](_0x1b40cf['shift']());}};_0x16f16b(++_0x341a7a);}(_0x961e,0xd2));var _0xe961=function(_0x25ddeb,_0x167818){_0x25ddeb=_0x25ddeb-0x0;var _0x3d5ed5=_0x961e[_0x25ddeb];return _0x3d5ed5;};'use strict';var Sequelize=require(_0xe961('0x0'));module[_0xe961('0x1')]={'name':{'type':Sequelize[_0xe961('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe961('0x2')]},'write':{'type':Sequelize[_0xe961('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 7b30627..d9ff2c5 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 _0x33c9=['show','params','keys','intersection','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','nolimit','removeMembers','addMessage','pick','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','error','stack','name','send','ChatGroup','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','merge','options','includeAll','include','findAll','catch'];(function(_0x15dace,_0x69ab2b){var _0x3a1fa6=function(_0x626b09){while(--_0x626b09){_0x15dace['push'](_0x15dace['shift']());}};_0x3a1fa6(++_0x69ab2b);}(_0x33c9,0xdc));var _0x933c=function(_0x17c4b9,_0x2466fa){_0x17c4b9=_0x17c4b9-0x0;var _0x2c9261=_0x33c9[_0x17c4b9];return _0x2c9261;};'use strict';var emlformat=require(_0x933c('0x0'));var rimraf=require(_0x933c('0x1'));var zipdir=require(_0x933c('0x2'));var jsonpatch=require(_0x933c('0x3'));var rp=require('request-promise');var moment=require(_0x933c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x933c('0x5'));var util=require(_0x933c('0x6'));var path=require(_0x933c('0x7'));var sox=require(_0x933c('0x8'));var csv=require(_0x933c('0x9'));var ejs=require(_0x933c('0xa'));var fs=require('fs');var fs_extra=require(_0x933c('0xb'));var _=require(_0x933c('0xc'));var squel=require('squel');var crypto=require(_0x933c('0xd'));var jsforce=require(_0x933c('0xe'));var deskjs=require(_0x933c('0xf'));var toCsv=require(_0x933c('0x9'));var querystring=require(_0x933c('0x10'));var Papa=require(_0x933c('0x11'));var Redis=require(_0x933c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x933c('0x13'));var as=require(_0x933c('0x14'));var hardwareService=require(_0x933c('0x15'));var logger=require(_0x933c('0x16'))(_0x933c('0x17'));var utils=require(_0x933c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x933c('0x19'));var db=require(_0x933c('0x1a'))['db'];config[_0x933c('0x1b')]=_[_0x933c('0x1c')](config[_0x933c('0x1b')],{'host':_0x933c('0x1d'),'port':0x18eb});var socket=require(_0x933c('0x1e'))(new Redis(config[_0x933c('0x1b')]));require('./chatGroup.socket')[_0x933c('0x1f')](socket);function respondWithStatusCode(_0x17ec8f,_0x5d32a3){_0x5d32a3=_0x5d32a3||0xcc;return function(_0x2d365a){if(_0x2d365a){return _0x17ec8f[_0x933c('0x20')](_0x5d32a3);}return _0x17ec8f[_0x933c('0x21')](_0x5d32a3)[_0x933c('0x22')]();};}function respondWithResult(_0x1aba47,_0x870ec){_0x870ec=_0x870ec||0xc8;return function(_0x24db24){if(_0x24db24){return _0x1aba47[_0x933c('0x21')](_0x870ec)[_0x933c('0x23')](_0x24db24);}};}function respondWithFilteredResult(_0x5b45b2,_0x33a4d1){return function(_0x23f9c){if(_0x23f9c){var _0x27605e=typeof _0x33a4d1[_0x933c('0x24')]==='undefined'&&typeof _0x33a4d1[_0x933c('0x25')]===_0x933c('0x26');var _0x31add8=_0x23f9c[_0x933c('0x27')];var _0xe54ba3=_0x27605e?0x0:_0x33a4d1[_0x933c('0x24')];var _0x442409=_0x27605e?_0x23f9c[_0x933c('0x27')]:_0x33a4d1[_0x933c('0x24')]+_0x33a4d1['limit'];var _0x2875ed;if(_0x442409>=_0x31add8){_0x442409=_0x31add8;_0x2875ed=0xc8;}else{_0x2875ed=0xce;}_0x5b45b2['status'](_0x2875ed);return _0x5b45b2[_0x933c('0x28')](_0x933c('0x29'),_0xe54ba3+'-'+_0x442409+'/'+_0x31add8)[_0x933c('0x23')](_0x23f9c);}return null;};}function patchUpdates(_0x200057){return function(_0x4c4649){try{jsonpatch['apply'](_0x4c4649,_0x200057,!![]);}catch(_0x30b499){return BPromise[_0x933c('0x2a')](_0x30b499);}return _0x4c4649['save']();};}function saveUpdates(_0x58d5e0,_0x41f54e){return function(_0x30eefa){if(_0x30eefa){return _0x30eefa[_0x933c('0x2b')](_0x58d5e0)[_0x933c('0x2c')](function(_0x160164){return _0x160164;});}return null;};}function removeEntity(_0x27885d,_0xe279cd){return function(_0x5a5878){if(_0x5a5878){return _0x5a5878['destroy']()[_0x933c('0x2c')](function(){_0x27885d[_0x933c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fed5d,_0x4119d4){return function(_0x28959f){if(!_0x28959f){_0x4fed5d[_0x933c('0x20')](0x194);}return _0x28959f;};}function handleError(_0x2f73f5,_0x3fa99b){_0x3fa99b=_0x3fa99b||0x1f4;return function(_0x15f966){logger[_0x933c('0x2d')](_0x15f966[_0x933c('0x2e')]);if(_0x15f966[_0x933c('0x2f')]){delete _0x15f966[_0x933c('0x2f')];}_0x2f73f5['status'](_0x3fa99b)[_0x933c('0x30')](_0x15f966);};}exports['index']=function(_0x3d8c20,_0x126543){var _0xa371d7={},_0x3a5db4={},_0x4e6536={'count':0x0,'rows':[]};var _0x1d4163=_['map'](db[_0x933c('0x31')]['rawAttributes'],function(_0x14abef){return{'name':_0x14abef[_0x933c('0x32')],'type':_0x14abef[_0x933c('0x33')][_0x933c('0x34')]};});_0x3a5db4[_0x933c('0x35')]=_['map'](_0x1d4163,'name');_0x3a5db4[_0x933c('0x36')]=_['keys'](_0x3d8c20['query']);_0x3a5db4[_0x933c('0x37')]=_['intersection'](_0x3a5db4[_0x933c('0x35')],_0x3a5db4[_0x933c('0x36')]);_0xa371d7[_0x933c('0x38')]=_['intersection'](_0x3a5db4[_0x933c('0x35')],qs[_0x933c('0x39')](_0x3d8c20['query'][_0x933c('0x39')]));_0xa371d7[_0x933c('0x38')]=_0xa371d7[_0x933c('0x38')][_0x933c('0x3a')]?_0xa371d7[_0x933c('0x38')]:_0x3a5db4[_0x933c('0x35')];if(!_0x3d8c20[_0x933c('0x36')][_0x933c('0x3b')]('nolimit')){_0xa371d7[_0x933c('0x25')]=qs[_0x933c('0x25')](_0x3d8c20[_0x933c('0x36')][_0x933c('0x25')]);_0xa371d7[_0x933c('0x24')]=qs[_0x933c('0x24')](_0x3d8c20[_0x933c('0x36')][_0x933c('0x24')]);}_0xa371d7[_0x933c('0x3c')]=qs[_0x933c('0x3d')](_0x3d8c20[_0x933c('0x36')][_0x933c('0x3d')]);_0xa371d7[_0x933c('0x3e')]=qs[_0x933c('0x37')](_['pick'](_0x3d8c20[_0x933c('0x36')],_0x3a5db4[_0x933c('0x37')]),_0x1d4163);if(_0x3d8c20[_0x933c('0x36')][_0x933c('0x3f')]){_0xa371d7['where']=_['merge'](_0xa371d7['where'],{'$or':_[_0x933c('0x40')](_0x1d4163,function(_0xb2e538){if(_0xb2e538[_0x933c('0x33')]!=='VIRTUAL'){var _0x44ee01={};_0x44ee01[_0xb2e538[_0x933c('0x2f')]]={'$like':'%'+_0x3d8c20[_0x933c('0x36')][_0x933c('0x3f')]+'%'};return _0x44ee01;}})});}_0xa371d7=_[_0x933c('0x41')]({},_0xa371d7,_0x3d8c20[_0x933c('0x42')]);var _0x5d0354={'where':_0xa371d7['where']};return db[_0x933c('0x31')][_0x933c('0x27')](_0x5d0354)['then'](function(_0x320166){_0x4e6536[_0x933c('0x27')]=_0x320166;if(_0x3d8c20['query'][_0x933c('0x43')]){_0xa371d7[_0x933c('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x933c('0x45')](_0xa371d7);})[_0x933c('0x2c')](function(_0x4a744b){_0x4e6536['rows']=_0x4a744b;return _0x4e6536;})[_0x933c('0x2c')](respondWithFilteredResult(_0x126543,_0xa371d7))[_0x933c('0x46')](handleError(_0x126543,null));};exports[_0x933c('0x47')]=function(_0x4ce709,_0x2d8b4a){var _0x15fb4c={'raw':!![],'where':{'id':_0x4ce709[_0x933c('0x48')]['id']}},_0x3b1c30={};_0x3b1c30['model']=_[_0x933c('0x49')](db['ChatGroup']['rawAttributes']);_0x3b1c30[_0x933c('0x36')]=_['keys'](_0x4ce709[_0x933c('0x36')]);_0x3b1c30[_0x933c('0x37')]=_[_0x933c('0x4a')](_0x3b1c30[_0x933c('0x35')],_0x3b1c30[_0x933c('0x36')]);_0x15fb4c[_0x933c('0x38')]=_['intersection'](_0x3b1c30['model'],qs[_0x933c('0x39')](_0x4ce709[_0x933c('0x36')][_0x933c('0x39')]));_0x15fb4c['attributes']=_0x15fb4c[_0x933c('0x38')][_0x933c('0x3a')]?_0x15fb4c[_0x933c('0x38')]:_0x3b1c30[_0x933c('0x35')];if(_0x4ce709[_0x933c('0x36')][_0x933c('0x43')]){_0x15fb4c[_0x933c('0x44')]=[{'all':!![]}];}_0x15fb4c=_[_0x933c('0x41')]({},_0x15fb4c,_0x4ce709[_0x933c('0x42')]);return db[_0x933c('0x31')][_0x933c('0x4b')](_0x15fb4c)[_0x933c('0x2c')](handleEntityNotFound(_0x2d8b4a,null))['then'](respondWithResult(_0x2d8b4a,null))[_0x933c('0x46')](handleError(_0x2d8b4a,null));};exports[_0x933c('0x4c')]=function(_0x2ca4be,_0x1f28c6){return db[_0x933c('0x31')][_0x933c('0x4c')](_0x2ca4be['body'],{})[_0x933c('0x2c')](respondWithResult(_0x1f28c6,0xc9))[_0x933c('0x46')](handleError(_0x1f28c6,null));};exports[_0x933c('0x2b')]=function(_0x89e168,_0x116b15){if(_0x89e168[_0x933c('0x4d')]['id']){delete _0x89e168['body']['id'];}return db[_0x933c('0x31')][_0x933c('0x4b')]({'where':{'id':_0x89e168[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x116b15,null))[_0x933c('0x2c')](saveUpdates(_0x89e168['body'],null))['then'](respondWithResult(_0x116b15,null))[_0x933c('0x46')](handleError(_0x116b15,null));};exports['destroy']=function(_0xa37bbc,_0x599193){return db[_0x933c('0x31')][_0x933c('0x4b')]({'where':{'id':_0xa37bbc[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x599193,null))[_0x933c('0x2c')](removeEntity(_0x599193,null))[_0x933c('0x46')](handleError(_0x599193,null));};exports['describe']=function(_0x257827,_0x11118d){return db[_0x933c('0x31')][_0x933c('0x4e')]()['then'](respondWithResult(_0x11118d,null))[_0x933c('0x46')](handleError(_0x11118d,null));};exports['getUnread']=function(_0xa385da,_0x4e0e24,_0x15878c){return db[_0x933c('0x4f')][_0x933c('0x27')]({'where':{'ChatGroupId':_0xa385da['params']['id'],'ToId':_0xa385da[_0x933c('0x50')]['id'],'read':![]}})[_0x933c('0x2c')](function(_0x4cb64e){return{'id':_[_0x933c('0x51')](_0xa385da[_0x933c('0x48')]['id']),'count':_0x4cb64e};})['then'](respondWithResult(_0x4e0e24,null))[_0x933c('0x46')](handleError(_0x4e0e24,null));};exports['addMembers']=function(_0x4075d1,_0x2bd48f,_0x4b995c){return db['ChatGroup']['find']({'where':{'id':_0x4075d1[_0x933c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2bd48f,null))[_0x933c('0x2c')](function(_0x520ab7){if(_0x520ab7){return _0x520ab7[_0x933c('0x52')](_0x4075d1[_0x933c('0x4d')][_0x933c('0x53')],_[_0x933c('0x54')](_0x4075d1['body'],[_0x933c('0x53'),'id'])||{});}})[_0x933c('0x2c')](respondWithResult(_0x2bd48f,null))[_0x933c('0x46')](handleError(_0x2bd48f,null));};exports[_0x933c('0x55')]=function(_0x291935,_0x57aeb2,_0x2f8493){var _0x24b80c={};var _0x14cdfa={};var _0xb49de6;var _0x35e457;return db[_0x933c('0x31')][_0x933c('0x56')]({'where':{'id':_0x291935[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x57aeb2,null))[_0x933c('0x2c')](function(_0x38cafd){if(_0x38cafd){_0xb49de6=_0x38cafd;_0x14cdfa[_0x933c('0x35')]=_[_0x933c('0x49')](db[_0x933c('0x57')][_0x933c('0x58')]);_0x14cdfa['query']=_[_0x933c('0x49')](_0x291935[_0x933c('0x36')]);_0x14cdfa['filters']=_[_0x933c('0x4a')](_0x14cdfa[_0x933c('0x35')],_0x14cdfa['query']);_0x24b80c['attributes']=_[_0x933c('0x4a')](_0x14cdfa[_0x933c('0x35')],qs[_0x933c('0x39')](_0x291935[_0x933c('0x36')][_0x933c('0x39')]));_0x24b80c[_0x933c('0x38')]=_0x24b80c['attributes'][_0x933c('0x3a')]?_0x24b80c[_0x933c('0x38')]:_0x14cdfa['model'];_0x24b80c[_0x933c('0x3c')]=qs[_0x933c('0x3d')](_0x291935[_0x933c('0x36')][_0x933c('0x3d')]);_0x24b80c[_0x933c('0x3e')]=qs[_0x933c('0x37')](_['pick'](_0x291935[_0x933c('0x36')],_0x14cdfa[_0x933c('0x37')]));if(_0x291935['query']['filter']){_0x24b80c[_0x933c('0x3e')]=_[_0x933c('0x41')](_0x24b80c[_0x933c('0x3e')],{'$or':_[_0x933c('0x40')](_0x24b80c['attributes'],function(_0x86b9){var _0x22f97c={};_0x22f97c[_0x86b9]={'$like':'%'+_0x291935[_0x933c('0x36')][_0x933c('0x3f')]+'%'};return _0x22f97c;})});}_0x24b80c=_[_0x933c('0x41')]({},_0x24b80c,_0x291935['options']);return _0xb49de6[_0x933c('0x55')](_0x24b80c);}})[_0x933c('0x2c')](function(_0x35daf9){if(_0x35daf9){_0x35e457=_0x35daf9[_0x933c('0x3a')];if(!_0x291935['query'][_0x933c('0x3b')](_0x933c('0x59'))){_0x24b80c['limit']=qs['limit'](_0x291935[_0x933c('0x36')][_0x933c('0x25')]);_0x24b80c[_0x933c('0x24')]=qs['offset'](_0x291935[_0x933c('0x36')][_0x933c('0x24')]);}return _0xb49de6[_0x933c('0x55')](_0x24b80c);}})[_0x933c('0x2c')](function(_0x443f05){if(_0x443f05){return _0x443f05?{'count':_0x35e457,'rows':_0x443f05}:null;}})[_0x933c('0x2c')](respondWithResult(_0x57aeb2,null))[_0x933c('0x46')](handleError(_0x57aeb2,null));};exports[_0x933c('0x5a')]=function(_0x593b04,_0x899154,_0x103dd7){return db['ChatGroup'][_0x933c('0x4b')]({'where':{'id':_0x593b04['params']['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x899154,null))[_0x933c('0x2c')](function(_0x45c957){if(_0x45c957){return _0x45c957[_0x933c('0x5a')](_0x593b04[_0x933c('0x36')]['ids']);}})[_0x933c('0x2c')](respondWithStatusCode(_0x899154,null))['catch'](handleError(_0x899154,null));};exports[_0x933c('0x5b')]=function(_0x2f2c7b,_0x22d268,_0xd7f511){if(_0x2f2c7b[_0x933c('0x4d')]['id']){delete _0x2f2c7b[_0x933c('0x4d')]['id'];}return db[_0x933c('0x31')][_0x933c('0x4b')]({'where':{'id':_0x2f2c7b[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x22d268,null))['then'](function(_0x27cd75){if(_0x27cd75){_0x2f2c7b[_0x933c('0x4d')]['ChatGroupId']=_0x27cd75['id'];return db[_0x933c('0x4f')][_0x933c('0x4c')](_0x2f2c7b['body']);}})[_0x933c('0x2c')](respondWithResult(_0x22d268,null))[_0x933c('0x46')](handleError(_0x22d268,null));};exports['getMessages']=function(_0x1b66a3,_0x585595,_0x5d0686){var _0x12f3c0={};var _0x2d1445={};var _0x11a68e;var _0x12589e;return db[_0x933c('0x31')][_0x933c('0x56')]({'where':{'id':_0x1b66a3[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x585595,null))[_0x933c('0x2c')](function(_0x665735){if(_0x665735){_0x11a68e=_0x665735;_0x2d1445['model']=_[_0x933c('0x49')](db[_0x933c('0x4f')]['rawAttributes']);_0x2d1445[_0x933c('0x36')]=_[_0x933c('0x49')](_0x1b66a3[_0x933c('0x36')]);_0x2d1445[_0x933c('0x37')]=_['intersection'](_0x2d1445['model'],_0x2d1445[_0x933c('0x36')]);_0x12f3c0[_0x933c('0x38')]=_[_0x933c('0x4a')](_0x2d1445[_0x933c('0x35')],qs[_0x933c('0x39')](_0x1b66a3[_0x933c('0x36')][_0x933c('0x39')]));_0x12f3c0['attributes']=_0x12f3c0[_0x933c('0x38')][_0x933c('0x3a')]?_0x12f3c0[_0x933c('0x38')]:_0x2d1445['model'];_0x12f3c0[_0x933c('0x3c')]=qs[_0x933c('0x3d')](_0x1b66a3[_0x933c('0x36')][_0x933c('0x3d')]);_0x12f3c0[_0x933c('0x3e')]=qs[_0x933c('0x37')](_[_0x933c('0x5c')](_0x1b66a3[_0x933c('0x36')],_0x2d1445[_0x933c('0x37')]));if(_0x1b66a3[_0x933c('0x36')][_0x933c('0x3f')]){_0x12f3c0['where']=_[_0x933c('0x41')](_0x12f3c0[_0x933c('0x3e')],{'$or':_[_0x933c('0x40')](_0x12f3c0[_0x933c('0x38')],function(_0x36300f){var _0x10f966={};_0x10f966[_0x36300f]={'$like':'%'+_0x1b66a3[_0x933c('0x36')]['filter']+'%'};return _0x10f966;})});}if(_0x1b66a3['query'][_0x933c('0x5d')]){var _0x5a6835=_0x1b66a3[_0x933c('0x36')][_0x933c('0x5d')][_0x933c('0x5e')](',');var _0x33d1b0={};_0x33d1b0[_0x5a6835[0x0]]={'$gte':moment(_0x5a6835[0x1])['format'](_0x933c('0x5f'))};_0x12f3c0[_0x933c('0x3e')]=_[_0x933c('0x41')](_0x12f3c0['where'],_0x33d1b0);}_0x12f3c0=_[_0x933c('0x41')]({},_0x12f3c0,_0x1b66a3['options']);return _0x11a68e[_0x933c('0x60')](_0x12f3c0);}})[_0x933c('0x2c')](function(_0x10b495){if(_0x10b495){_0x12589e=_0x10b495['length'];if(!_0x1b66a3[_0x933c('0x36')][_0x933c('0x3b')](_0x933c('0x59'))){_0x12f3c0[_0x933c('0x25')]=qs['limit'](_0x1b66a3[_0x933c('0x36')][_0x933c('0x25')]);_0x12f3c0['offset']=qs[_0x933c('0x24')](_0x1b66a3[_0x933c('0x36')][_0x933c('0x24')]);}return _0x11a68e[_0x933c('0x60')](_0x12f3c0);}})[_0x933c('0x2c')](function(_0x5977bf){if(_0x5977bf){return _0x5977bf?{'count':_0x12589e,'rows':_0x5977bf}:null;}})[_0x933c('0x2c')](respondWithResult(_0x585595,null))[_0x933c('0x46')](handleError(_0x585595,null));}; \ No newline at end of file +var _0x14d4=['catch','create','body','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','send','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','includeAll','include','findAll','rows','show','params','rawAttributes'];(function(_0x21b916,_0x2f1c29){var _0x4df8bc=function(_0x33de8c){while(--_0x33de8c){_0x21b916['push'](_0x21b916['shift']());}};_0x4df8bc(++_0x2f1c29);}(_0x14d4,0x78));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x414d('0x0'));var rimraf=require(_0x414d('0x1'));var zipdir=require(_0x414d('0x2'));var jsonpatch=require(_0x414d('0x3'));var rp=require(_0x414d('0x4'));var moment=require(_0x414d('0x5'));var BPromise=require(_0x414d('0x6'));var Mustache=require(_0x414d('0x7'));var util=require(_0x414d('0x8'));var path=require(_0x414d('0x9'));var sox=require(_0x414d('0xa'));var csv=require(_0x414d('0xb'));var ejs=require(_0x414d('0xc'));var fs=require('fs');var fs_extra=require(_0x414d('0xd'));var _=require(_0x414d('0xe'));var squel=require(_0x414d('0xf'));var crypto=require('crypto');var jsforce=require(_0x414d('0x10'));var deskjs=require(_0x414d('0x11'));var toCsv=require(_0x414d('0xb'));var querystring=require('querystring');var Papa=require(_0x414d('0x12'));var Redis=require(_0x414d('0x13'));var authService=require(_0x414d('0x14'));var qs=require(_0x414d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x414d('0x16'))('api');var utils=require(_0x414d('0x17'));var config=require(_0x414d('0x18'));var licenseUtil=require(_0x414d('0x19'));var db=require('../../mysqldb')['db'];config[_0x414d('0x1a')]=_[_0x414d('0x1b')](config[_0x414d('0x1a')],{'host':_0x414d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x414d('0x1a')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0xf93be2,_0x565dcc){_0x565dcc=_0x565dcc||0xcc;return function(_0x2ba939){if(_0x2ba939){return _0xf93be2[_0x414d('0x1d')](_0x565dcc);}return _0xf93be2[_0x414d('0x1e')](_0x565dcc)['end']();};}function respondWithResult(_0x33f141,_0x576fe1){_0x576fe1=_0x576fe1||0xc8;return function(_0x520e05){if(_0x520e05){return _0x33f141[_0x414d('0x1e')](_0x576fe1)[_0x414d('0x1f')](_0x520e05);}};}function respondWithFilteredResult(_0x485858,_0x32b806){return function(_0x20e8de){if(_0x20e8de){var _0x44e5ef=typeof _0x32b806[_0x414d('0x20')]===_0x414d('0x21')&&typeof _0x32b806[_0x414d('0x22')]===_0x414d('0x21');var _0x3270a4=_0x20e8de[_0x414d('0x23')];var _0x5bc72b=_0x44e5ef?0x0:_0x32b806[_0x414d('0x20')];var _0x51bc87=_0x44e5ef?_0x20e8de['count']:_0x32b806[_0x414d('0x20')]+_0x32b806[_0x414d('0x22')];var _0x9a2c3b;if(_0x51bc87>=_0x3270a4){_0x51bc87=_0x3270a4;_0x9a2c3b=0xc8;}else{_0x9a2c3b=0xce;}_0x485858[_0x414d('0x1e')](_0x9a2c3b);return _0x485858[_0x414d('0x24')](_0x414d('0x25'),_0x5bc72b+'-'+_0x51bc87+'/'+_0x3270a4)[_0x414d('0x1f')](_0x20e8de);}return null;};}function patchUpdates(_0x170882){return function(_0x43da98){try{jsonpatch['apply'](_0x43da98,_0x170882,!![]);}catch(_0x494875){return BPromise[_0x414d('0x26')](_0x494875);}return _0x43da98[_0x414d('0x27')]();};}function saveUpdates(_0x26406a,_0x510d03){return function(_0x4a5481){if(_0x4a5481){return _0x4a5481[_0x414d('0x28')](_0x26406a)['then'](function(_0x516bbd){return _0x516bbd;});}return null;};}function removeEntity(_0x511018,_0x4ec885){return function(_0x5b554d){if(_0x5b554d){return _0x5b554d['destroy']()[_0x414d('0x29')](function(){_0x511018[_0x414d('0x1e')](0xcc)[_0x414d('0x2a')]();});}};}function handleEntityNotFound(_0x4200b7,_0x51205f){return function(_0x3f60e0){if(!_0x3f60e0){_0x4200b7[_0x414d('0x1d')](0x194);}return _0x3f60e0;};}function handleError(_0xad511f,_0x20d904){_0x20d904=_0x20d904||0x1f4;return function(_0x2912f1){logger['error'](_0x2912f1[_0x414d('0x2b')]);if(_0x2912f1[_0x414d('0x2c')]){delete _0x2912f1['name'];}_0xad511f[_0x414d('0x1e')](_0x20d904)[_0x414d('0x2d')](_0x2912f1);};}exports['index']=function(_0x4ed3fa,_0x3ae9a0){var _0xb245d5={},_0x49ce83={},_0x1d87ef={'count':0x0,'rows':[]};var _0x16149c=_['map'](db['ChatGroup']['rawAttributes'],function(_0x297354){return{'name':_0x297354[_0x414d('0x2e')],'type':_0x297354[_0x414d('0x2f')][_0x414d('0x30')]};});_0x49ce83['model']=_[_0x414d('0x31')](_0x16149c,_0x414d('0x2c'));_0x49ce83[_0x414d('0x32')]=_[_0x414d('0x33')](_0x4ed3fa[_0x414d('0x32')]);_0x49ce83[_0x414d('0x34')]=_[_0x414d('0x35')](_0x49ce83[_0x414d('0x36')],_0x49ce83[_0x414d('0x32')]);_0xb245d5[_0x414d('0x37')]=_[_0x414d('0x35')](_0x49ce83[_0x414d('0x36')],qs[_0x414d('0x38')](_0x4ed3fa['query'][_0x414d('0x38')]));_0xb245d5['attributes']=_0xb245d5['attributes'][_0x414d('0x39')]?_0xb245d5[_0x414d('0x37')]:_0x49ce83[_0x414d('0x36')];if(!_0x4ed3fa[_0x414d('0x32')][_0x414d('0x3a')]('nolimit')){_0xb245d5['limit']=qs[_0x414d('0x22')](_0x4ed3fa['query'][_0x414d('0x22')]);_0xb245d5[_0x414d('0x20')]=qs['offset'](_0x4ed3fa[_0x414d('0x32')][_0x414d('0x20')]);}_0xb245d5[_0x414d('0x3b')]=qs[_0x414d('0x3c')](_0x4ed3fa['query'][_0x414d('0x3c')]);_0xb245d5[_0x414d('0x3d')]=qs[_0x414d('0x34')](_[_0x414d('0x3e')](_0x4ed3fa[_0x414d('0x32')],_0x49ce83[_0x414d('0x34')]),_0x16149c);if(_0x4ed3fa[_0x414d('0x32')][_0x414d('0x3f')]){_0xb245d5[_0x414d('0x3d')]=_[_0x414d('0x40')](_0xb245d5[_0x414d('0x3d')],{'$or':_[_0x414d('0x31')](_0x16149c,function(_0x3d744c){if(_0x3d744c[_0x414d('0x2f')]!==_0x414d('0x41')){var _0x36fb91={};_0x36fb91[_0x3d744c[_0x414d('0x2c')]]={'$like':'%'+_0x4ed3fa[_0x414d('0x32')][_0x414d('0x3f')]+'%'};return _0x36fb91;}})});}_0xb245d5=_[_0x414d('0x40')]({},_0xb245d5,_0x4ed3fa['options']);var _0x5e1fa2={'where':_0xb245d5[_0x414d('0x3d')]};return db[_0x414d('0x42')][_0x414d('0x23')](_0x5e1fa2)['then'](function(_0x3b96a8){_0x1d87ef[_0x414d('0x23')]=_0x3b96a8;if(_0x4ed3fa[_0x414d('0x32')][_0x414d('0x43')]){_0xb245d5[_0x414d('0x44')]=[{'all':!![]}];}return db[_0x414d('0x42')][_0x414d('0x45')](_0xb245d5);})[_0x414d('0x29')](function(_0x2e5122){_0x1d87ef[_0x414d('0x46')]=_0x2e5122;return _0x1d87ef;})[_0x414d('0x29')](respondWithFilteredResult(_0x3ae9a0,_0xb245d5))['catch'](handleError(_0x3ae9a0,null));};exports[_0x414d('0x47')]=function(_0xb51350,_0x40a092){var _0x21cf34={'raw':!![],'where':{'id':_0xb51350[_0x414d('0x48')]['id']}},_0x2c2c8d={};_0x2c2c8d['model']=_[_0x414d('0x33')](db[_0x414d('0x42')][_0x414d('0x49')]);_0x2c2c8d[_0x414d('0x32')]=_['keys'](_0xb51350[_0x414d('0x32')]);_0x2c2c8d[_0x414d('0x34')]=_[_0x414d('0x35')](_0x2c2c8d[_0x414d('0x36')],_0x2c2c8d[_0x414d('0x32')]);_0x21cf34[_0x414d('0x37')]=_[_0x414d('0x35')](_0x2c2c8d['model'],qs[_0x414d('0x38')](_0xb51350[_0x414d('0x32')][_0x414d('0x38')]));_0x21cf34['attributes']=_0x21cf34[_0x414d('0x37')]['length']?_0x21cf34[_0x414d('0x37')]:_0x2c2c8d[_0x414d('0x36')];if(_0xb51350[_0x414d('0x32')][_0x414d('0x43')]){_0x21cf34[_0x414d('0x44')]=[{'all':!![]}];}_0x21cf34=_[_0x414d('0x40')]({},_0x21cf34,_0xb51350['options']);return db[_0x414d('0x42')]['find'](_0x21cf34)[_0x414d('0x29')](handleEntityNotFound(_0x40a092,null))[_0x414d('0x29')](respondWithResult(_0x40a092,null))[_0x414d('0x4a')](handleError(_0x40a092,null));};exports[_0x414d('0x4b')]=function(_0x72e8e9,_0x457767){return db[_0x414d('0x42')]['create'](_0x72e8e9[_0x414d('0x4c')],{})[_0x414d('0x29')](respondWithResult(_0x457767,0xc9))[_0x414d('0x4a')](handleError(_0x457767,null));};exports['update']=function(_0xc4d472,_0x3f4cf9){if(_0xc4d472[_0x414d('0x4c')]['id']){delete _0xc4d472[_0x414d('0x4c')]['id'];}return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0xc4d472[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x3f4cf9,null))[_0x414d('0x29')](saveUpdates(_0xc4d472[_0x414d('0x4c')],null))[_0x414d('0x29')](respondWithResult(_0x3f4cf9,null))[_0x414d('0x4a')](handleError(_0x3f4cf9,null));};exports[_0x414d('0x4e')]=function(_0x1c3090,_0x2005e0){return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0x1c3090[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x2005e0,null))[_0x414d('0x29')](removeEntity(_0x2005e0,null))[_0x414d('0x4a')](handleError(_0x2005e0,null));};exports[_0x414d('0x4f')]=function(_0x9d42c3,_0x427412){return db[_0x414d('0x42')]['describe']()[_0x414d('0x29')](respondWithResult(_0x427412,null))[_0x414d('0x4a')](handleError(_0x427412,null));};exports[_0x414d('0x50')]=function(_0x368cc0,_0x2a5e28,_0x55f829){return db[_0x414d('0x51')][_0x414d('0x23')]({'where':{'ChatGroupId':_0x368cc0[_0x414d('0x48')]['id'],'ToId':_0x368cc0[_0x414d('0x52')]['id'],'read':![]}})[_0x414d('0x29')](function(_0x3c7733){return{'id':_[_0x414d('0x53')](_0x368cc0[_0x414d('0x48')]['id']),'count':_0x3c7733};})[_0x414d('0x29')](respondWithResult(_0x2a5e28,null))[_0x414d('0x4a')](handleError(_0x2a5e28,null));};exports[_0x414d('0x54')]=function(_0x14ddb7,_0x260b52,_0x166deb){return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0x14ddb7[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x260b52,null))['then'](function(_0x421a2b){if(_0x421a2b){return _0x421a2b[_0x414d('0x54')](_0x14ddb7['body'][_0x414d('0x55')],_['omit'](_0x14ddb7[_0x414d('0x4c')],['ids','id'])||{});}})[_0x414d('0x29')](respondWithResult(_0x260b52,null))['catch'](handleError(_0x260b52,null));};exports['getMembers']=function(_0x52ef8a,_0x4a1b39,_0x5da766){var _0x389187={};var _0x1bc860={};var _0x2b529b;var _0x1f5f70;return db[_0x414d('0x42')]['findOne']({'where':{'id':_0x52ef8a[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x4a1b39,null))[_0x414d('0x29')](function(_0x142a4b){if(_0x142a4b){_0x2b529b=_0x142a4b;_0x1bc860[_0x414d('0x36')]=_['keys'](db['User'][_0x414d('0x49')]);_0x1bc860[_0x414d('0x32')]=_[_0x414d('0x33')](_0x52ef8a[_0x414d('0x32')]);_0x1bc860[_0x414d('0x34')]=_[_0x414d('0x35')](_0x1bc860['model'],_0x1bc860[_0x414d('0x32')]);_0x389187['attributes']=_[_0x414d('0x35')](_0x1bc860[_0x414d('0x36')],qs['fields'](_0x52ef8a['query'][_0x414d('0x38')]));_0x389187[_0x414d('0x37')]=_0x389187[_0x414d('0x37')][_0x414d('0x39')]?_0x389187[_0x414d('0x37')]:_0x1bc860[_0x414d('0x36')];_0x389187['order']=qs[_0x414d('0x3c')](_0x52ef8a[_0x414d('0x32')][_0x414d('0x3c')]);_0x389187[_0x414d('0x3d')]=qs[_0x414d('0x34')](_['pick'](_0x52ef8a['query'],_0x1bc860[_0x414d('0x34')]));if(_0x52ef8a[_0x414d('0x32')][_0x414d('0x3f')]){_0x389187[_0x414d('0x3d')]=_[_0x414d('0x40')](_0x389187[_0x414d('0x3d')],{'$or':_['map'](_0x389187[_0x414d('0x37')],function(_0x1fa70f){var _0x49b11e={};_0x49b11e[_0x1fa70f]={'$like':'%'+_0x52ef8a[_0x414d('0x32')][_0x414d('0x3f')]+'%'};return _0x49b11e;})});}_0x389187=_[_0x414d('0x40')]({},_0x389187,_0x52ef8a['options']);return _0x2b529b[_0x414d('0x56')](_0x389187);}})[_0x414d('0x29')](function(_0x2bff97){if(_0x2bff97){_0x1f5f70=_0x2bff97['length'];if(!_0x52ef8a[_0x414d('0x32')][_0x414d('0x3a')](_0x414d('0x57'))){_0x389187[_0x414d('0x22')]=qs['limit'](_0x52ef8a[_0x414d('0x32')]['limit']);_0x389187[_0x414d('0x20')]=qs[_0x414d('0x20')](_0x52ef8a['query']['offset']);}return _0x2b529b[_0x414d('0x56')](_0x389187);}})['then'](function(_0x2982e4){if(_0x2982e4){return _0x2982e4?{'count':_0x1f5f70,'rows':_0x2982e4}:null;}})[_0x414d('0x29')](respondWithResult(_0x4a1b39,null))['catch'](handleError(_0x4a1b39,null));};exports['removeMembers']=function(_0xfefb3e,_0x28198c,_0x13ad4b){return db['ChatGroup']['find']({'where':{'id':_0xfefb3e[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x28198c,null))[_0x414d('0x29')](function(_0x2b7f53){if(_0x2b7f53){return _0x2b7f53[_0x414d('0x58')](_0xfefb3e[_0x414d('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x28198c,null))[_0x414d('0x4a')](handleError(_0x28198c,null));};exports[_0x414d('0x59')]=function(_0x13951f,_0x3fe896,_0x1829be){if(_0x13951f['body']['id']){delete _0x13951f[_0x414d('0x4c')]['id'];}return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0x13951f[_0x414d('0x48')]['id']}})['then'](handleEntityNotFound(_0x3fe896,null))[_0x414d('0x29')](function(_0x1b399d){if(_0x1b399d){_0x13951f[_0x414d('0x4c')][_0x414d('0x5a')]=_0x1b399d['id'];return db['ChatInternalMessage'][_0x414d('0x4b')](_0x13951f[_0x414d('0x4c')]);}})['then'](respondWithResult(_0x3fe896,null))['catch'](handleError(_0x3fe896,null));};exports[_0x414d('0x5b')]=function(_0x96f052,_0x5af5fc,_0x47b508){var _0x30f1eb={};var _0x2e874c={};var _0x7a67b9;var _0x4aba48;return db['ChatGroup'][_0x414d('0x5c')]({'where':{'id':_0x96f052[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x5af5fc,null))[_0x414d('0x29')](function(_0x22f024){if(_0x22f024){_0x7a67b9=_0x22f024;_0x2e874c[_0x414d('0x36')]=_[_0x414d('0x33')](db[_0x414d('0x51')]['rawAttributes']);_0x2e874c['query']=_['keys'](_0x96f052[_0x414d('0x32')]);_0x2e874c[_0x414d('0x34')]=_[_0x414d('0x35')](_0x2e874c[_0x414d('0x36')],_0x2e874c[_0x414d('0x32')]);_0x30f1eb['attributes']=_[_0x414d('0x35')](_0x2e874c[_0x414d('0x36')],qs[_0x414d('0x38')](_0x96f052[_0x414d('0x32')][_0x414d('0x38')]));_0x30f1eb[_0x414d('0x37')]=_0x30f1eb[_0x414d('0x37')][_0x414d('0x39')]?_0x30f1eb[_0x414d('0x37')]:_0x2e874c[_0x414d('0x36')];_0x30f1eb['order']=qs[_0x414d('0x3c')](_0x96f052[_0x414d('0x32')][_0x414d('0x3c')]);_0x30f1eb[_0x414d('0x3d')]=qs[_0x414d('0x34')](_[_0x414d('0x3e')](_0x96f052[_0x414d('0x32')],_0x2e874c[_0x414d('0x34')]));if(_0x96f052[_0x414d('0x32')][_0x414d('0x3f')]){_0x30f1eb[_0x414d('0x3d')]=_['merge'](_0x30f1eb['where'],{'$or':_[_0x414d('0x31')](_0x30f1eb[_0x414d('0x37')],function(_0x387b2a){var _0x773189={};_0x773189[_0x387b2a]={'$like':'%'+_0x96f052[_0x414d('0x32')]['filter']+'%'};return _0x773189;})});}if(_0x96f052['query'][_0x414d('0x5d')]){var _0x5c826f=_0x96f052[_0x414d('0x32')][_0x414d('0x5d')][_0x414d('0x5e')](',');var _0x458e54={};_0x458e54[_0x5c826f[0x0]]={'$gte':moment(_0x5c826f[0x1])[_0x414d('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x30f1eb[_0x414d('0x3d')]=_['merge'](_0x30f1eb['where'],_0x458e54);}_0x30f1eb=_['merge']({},_0x30f1eb,_0x96f052[_0x414d('0x60')]);return _0x7a67b9[_0x414d('0x5b')](_0x30f1eb);}})[_0x414d('0x29')](function(_0x4c8604){if(_0x4c8604){_0x4aba48=_0x4c8604[_0x414d('0x39')];if(!_0x96f052[_0x414d('0x32')][_0x414d('0x3a')](_0x414d('0x57'))){_0x30f1eb[_0x414d('0x22')]=qs[_0x414d('0x22')](_0x96f052[_0x414d('0x32')][_0x414d('0x22')]);_0x30f1eb[_0x414d('0x20')]=qs[_0x414d('0x20')](_0x96f052[_0x414d('0x32')]['offset']);}return _0x7a67b9['getMessages'](_0x30f1eb);}})['then'](function(_0x1f759f){if(_0x1f759f){return _0x1f759f?{'count':_0x4aba48,'rows':_0x1f759f}:null;}})[_0x414d('0x29')](respondWithResult(_0x5af5fc,null))[_0x414d('0x4a')](handleError(_0x5af5fc,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 76faf72..bfb8034 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 _0x3fc6=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','ChatGroup'];(function(_0x308a3e,_0x81ce84){var _0x52a708=function(_0x5965f1){while(--_0x5965f1){_0x308a3e['push'](_0x308a3e['shift']());}};_0x52a708(++_0x81ce84);}(_0x3fc6,0x115));var _0x63fc=function(_0x1b46ed,_0x203e80){_0x1b46ed=_0x1b46ed-0x0;var _0x1a9c62=_0x3fc6[_0x1b46ed];return _0x1a9c62;};'use strict';var EventEmitter=require(_0x63fc('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x63fc('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x63fc('0x2')](0x0);var events={'afterCreate':_0x63fc('0x3'),'afterUpdate':_0x63fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ceadb){return function(_0x26d57e,_0x237af7,_0x5ce071){ChatGroupEvents[_0x63fc('0x5')](_0x3ceadb+':'+_0x26d57e['id'],_0x26d57e);ChatGroupEvents['emit'](_0x3ceadb,_0x26d57e);_0x5ce071(null);};}for(var e in events){if(events[_0x63fc('0x6')](e)){var event=events[e];ChatGroup[_0x63fc('0x7')](e,emitEvent(event));}}module[_0x63fc('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x74d3=['hook','events','../../mysqldb','ChatGroup','save','remove','emit','hasOwnProperty'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x74d3,0x159));var _0x374d=function(_0x305be7,_0x527c99){_0x305be7=_0x305be7-0x0;var _0x122e11=_0x74d3[_0x305be7];return _0x122e11;};'use strict';var EventEmitter=require(_0x374d('0x0'));var ChatGroup=require(_0x374d('0x1'))['db'][_0x374d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x374d('0x3'),'afterUpdate':'update','afterDestroy':_0x374d('0x4')};function emitEvent(_0x9f6268){return function(_0x1a79ae,_0x5e7908,_0x2ef1fc){ChatGroupEvents['emit'](_0x9f6268+':'+_0x1a79ae['id'],_0x1a79ae);ChatGroupEvents[_0x374d('0x5')](_0x9f6268,_0x1a79ae);_0x2ef1fc(null);};}for(var e in events){if(events[_0x374d('0x6')](e)){var event=events[e];ChatGroup[_0x374d('0x7')](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 403e236..ce13707 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 _0x7d40=['./chatGroup.attributes','exports','define','ChatGroup','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5387d9,_0x3e7c3e){var _0x2ea58b=function(_0x4d47ba){while(--_0x4d47ba){_0x5387d9['push'](_0x5387d9['shift']());}};_0x2ea58b(++_0x3e7c3e);}(_0x7d40,0x138));var _0x07d4=function(_0x27a45e,_0x556bb4){_0x27a45e=_0x27a45e-0x0;var _0x1fca64=_0x7d40[_0x27a45e];return _0x1fca64;};'use strict';var _=require('lodash');var util=require(_0x07d4('0x0'));var logger=require('../../config/logger')(_0x07d4('0x1'));var moment=require('moment');var BPromise=require(_0x07d4('0x2'));var rp=require(_0x07d4('0x3'));var fs=require('fs');var path=require(_0x07d4('0x4'));var rimraf=require(_0x07d4('0x5'));var config=require(_0x07d4('0x6'));var attributes=require(_0x07d4('0x7'));module[_0x07d4('0x8')]=function(_0x303b43,_0x4a83ef){return _0x303b43[_0x07d4('0x9')](_0x07d4('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cdd=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0x5a4d1f,_0x11e801){var _0x327268=function(_0x310d46){while(--_0x310d46){_0x5a4d1f['push'](_0x5a4d1f['shift']());}};_0x327268(++_0x11e801);}(_0x5cdd,0x6c));var _0xd5cd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5cdd[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd5cd('0x0'));var util=require(_0xd5cd('0x1'));var logger=require('../../config/logger')(_0xd5cd('0x2'));var moment=require(_0xd5cd('0x3'));var BPromise=require(_0xd5cd('0x4'));var rp=require(_0xd5cd('0x5'));var fs=require('fs');var path=require(_0xd5cd('0x6'));var rimraf=require(_0xd5cd('0x7'));var config=require(_0xd5cd('0x8'));var attributes=require(_0xd5cd('0x9'));module[_0xd5cd('0xa')]=function(_0x3e9305,_0x5adbe6){return _0x3e9305['define']('ChatGroup',attributes,{'tableName':_0xd5cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 0814ac8..e2aea39 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 _0xab5b=['debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x4817f9,_0x4070d1){var _0x2dcfa6=function(_0x408973){while(--_0x408973){_0x4817f9['push'](_0x4817f9['shift']());}};_0x2dcfa6(++_0x4070d1);}(_0xab5b,0x11a));var _0xbab5=function(_0x5641dd,_0x3560b5){_0x5641dd=_0x5641dd-0x0;var _0x5767ba=_0xab5b[_0x5641dd];return _0x5767ba;};'use strict';var _=require(_0xbab5('0x0'));var util=require(_0xbab5('0x1'));var moment=require('moment');var BPromise=require(_0xbab5('0x2'));var rs=require(_0xbab5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbab5('0x4'));var logger=require('../../config/logger')(_0xbab5('0x5'));var config=require(_0xbab5('0x6'));var jayson=require(_0xbab5('0x7'));var client=jayson[_0xbab5('0x8')][_0xbab5('0x9')]({'port':0x232a});config['redis']=_[_0xbab5('0xa')](config[_0xbab5('0xb')],{'host':_0xbab5('0xc'),'port':0x18eb});var socket=require(_0xbab5('0xd'))(new Redis(config[_0xbab5('0xb')]));require('./chatGroup.socket')[_0xbab5('0xe')](socket);function respondWithRpcPromise(_0x31f54b,_0x37ccba,_0x4c9350){return new BPromise(function(_0x226c55,_0xfbb62c){return client['request'](_0x31f54b,_0x4c9350)[_0xbab5('0xf')](function(_0x20b3fb){logger[_0xbab5('0x10')](_0xbab5('0x11'),_0x37ccba,'request\x20sent');logger[_0xbab5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x37ccba,_0xbab5('0x13'),JSON[_0xbab5('0x14')](_0x20b3fb));if(_0x20b3fb[_0xbab5('0x15')]){if(_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x16')]===0x1f4){logger['error'](_0xbab5('0x11'),_0x37ccba,_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);return _0xfbb62c(_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);}logger[_0xbab5('0x15')](_0xbab5('0x11'),_0x37ccba,_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);return _0x226c55(_0x20b3fb['error'][_0xbab5('0x17')]);}else{logger[_0xbab5('0x10')](_0xbab5('0x11'),_0x37ccba,'request\x20sent');_0x226c55(_0x20b3fb['result'][_0xbab5('0x17')]);}})[_0xbab5('0x18')](function(_0x25fbf1){logger[_0xbab5('0x15')](_0xbab5('0x11'),_0x37ccba,_0x25fbf1);_0xfbb62c(_0x25fbf1);});});} \ No newline at end of file +var _0x0fda=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x1d72ef,_0x251f64){_0x1d72ef=_0x1d72ef-0x0;var _0x35fc66=_0x0fda[_0x1d72ef];return _0x35fc66;};'use strict';var _=require(_0xa0fd('0x0'));var util=require('util');var moment=require(_0xa0fd('0x1'));var BPromise=require(_0xa0fd('0x2'));var rs=require(_0xa0fd('0x3'));var fs=require('fs');var Redis=require(_0xa0fd('0x4'));var db=require(_0xa0fd('0x5'))['db'];var utils=require(_0xa0fd('0x6'));var logger=require(_0xa0fd('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa0fd('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xa0fd('0x9')]=_[_0xa0fd('0xa')](config[_0xa0fd('0x9')],{'host':_0xa0fd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0fd('0x9')]));require(_0xa0fd('0xc'))[_0xa0fd('0xd')](socket);function respondWithRpcPromise(_0x322a1a,_0x4e1873,_0x31088d){return new BPromise(function(_0x423616,_0x36634c){return client['request'](_0x322a1a,_0x31088d)[_0xa0fd('0xe')](function(_0x332e66){logger[_0xa0fd('0xf')](_0xa0fd('0x10'),_0x4e1873,_0xa0fd('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4e1873,_0xa0fd('0x11'),JSON[_0xa0fd('0x12')](_0x332e66));if(_0x332e66['error']){if(_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x14')]===0x1f4){logger[_0xa0fd('0x13')](_0xa0fd('0x10'),_0x4e1873,_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x15')]);return _0x36634c(_0x332e66[_0xa0fd('0x13')]['message']);}logger[_0xa0fd('0x13')](_0xa0fd('0x10'),_0x4e1873,_0x332e66['error']['message']);return _0x423616(_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x15')]);}else{logger['info'](_0xa0fd('0x10'),_0x4e1873,_0xa0fd('0x11'));_0x423616(_0x332e66[_0xa0fd('0x16')]['message']);}})['catch'](function(_0x46e15a){logger['error'](_0xa0fd('0x10'),_0x4e1873,_0x46e15a);_0x36634c(_0x46e15a);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 602a979..2fec8d9 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 _0x5818=['remove','update','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x461b72,_0xb59085){var _0x4e1955=function(_0x45a50a){while(--_0x45a50a){_0x461b72['push'](_0x461b72['shift']());}};_0x4e1955(++_0xb59085);}(_0x5818,0x17e));var _0x8581=function(_0x32c8cb,_0x49c7d0){_0x32c8cb=_0x32c8cb-0x0;var _0x329a20=_0x5818[_0x32c8cb];return _0x329a20;};'use strict';var ChatGroupEvents=require(_0x8581('0x0'));var events=[_0x8581('0x1'),_0x8581('0x2'),_0x8581('0x3')];function createListener(_0x2dd013,_0x23df87){return function(_0x331626){_0x23df87['emit'](_0x2dd013,_0x331626);};}function removeListener(_0x55c237,_0x19476e){return function(){ChatGroupEvents[_0x8581('0x4')](_0x55c237,_0x19476e);};}exports[_0x8581('0x5')]=function(_0x226d63){for(var _0x399306=0x0,_0x481eca=events[_0x8581('0x6')];_0x399306<_0x481eca;_0x399306++){var _0x52cfa4=events[_0x399306];var _0x110761=createListener(_0x8581('0x7')+_0x52cfa4,_0x226d63);ChatGroupEvents['on'](_0x52cfa4,_0x110761);}}; \ No newline at end of file +var _0x3526=['save','remove','length','chatGroup:','./chatGroup.events'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x3526,0x1ad));var _0x6352=function(_0x4d2ea7,_0x2b2459){_0x4d2ea7=_0x4d2ea7-0x0;var _0x5875f6=_0x3526[_0x4d2ea7];return _0x5875f6;};'use strict';var ChatGroupEvents=require(_0x6352('0x0'));var events=[_0x6352('0x1'),_0x6352('0x2'),'update'];function createListener(_0x46d183,_0x5e2f1b){return function(_0x5a20f7){_0x5e2f1b['emit'](_0x46d183,_0x5a20f7);};}function removeListener(_0x3e9ea8,_0x3a7282){return function(){ChatGroupEvents['removeListener'](_0x3e9ea8,_0x3a7282);};}exports['register']=function(_0x1c34da){for(var _0x3f726d=0x0,_0x577b97=events[_0x6352('0x3')];_0x3f726d<_0x577b97;_0x3f726d++){var _0x2a1d45=events[_0x3f726d];var _0x1d138a=createListener(_0x6352('0x4')+_0x2a1d45,_0x1c34da);ChatGroupEvents['on'](_0x2a1d45,_0x1d138a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 1ffe0d1..e007245 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 _0x839c=['../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers','/:id/messages','addMessage','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x839c,0x64));var _0xc839=function(_0x1633a0,_0x3cdfc1){_0x1633a0=_0x1633a0-0x0;var _0x523846=_0x839c[_0x1633a0];return _0x523846;};'use strict';var multer=require(_0xc839('0x0'));var util=require(_0xc839('0x1'));var path=require('path');var timeout=require(_0xc839('0x2'));var express=require('express');var router=express[_0xc839('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc839('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc839('0x5'));var controller=require(_0xc839('0x6'));router[_0xc839('0x7')]('/',auth[_0xc839('0x8')](),controller[_0xc839('0x9')]);router['get']('/describe',auth[_0xc839('0x8')](),controller[_0xc839('0xa')]);router[_0xc839('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc839('0xb')]);router[_0xc839('0x7')](_0xc839('0xc'),auth[_0xc839('0x8')](),controller[_0xc839('0xd')]);router[_0xc839('0x7')](_0xc839('0xe'),auth['isAuthenticated'](),controller[_0xc839('0xf')]);router[_0xc839('0x7')]('/:id/messages',auth[_0xc839('0x8')](),controller[_0xc839('0x10')]);router[_0xc839('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc839('0x11')](_0xc839('0xe'),auth[_0xc839('0x8')](),controller[_0xc839('0x12')]);router[_0xc839('0x11')](_0xc839('0x13'),auth[_0xc839('0x8')](),controller[_0xc839('0x14')]);router[_0xc839('0x15')](_0xc839('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xc839('0x17')](_0xc839('0x16'),auth['isAuthenticated'](),controller[_0xc839('0x18')]);router[_0xc839('0x17')](_0xc839('0xe'),auth[_0xc839('0x8')](),controller['removeMembers']);module[_0xc839('0x19')]=router; \ No newline at end of file +var _0xcc2a=['show','/:id/unread','getUnread','getMembers','getMessages','post','/:id/members','addMembers','/:id/messages','update','delete','destroy','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id'];(function(_0xafdec6,_0x3d94df){var _0x372bdb=function(_0x5b3fd6){while(--_0x5b3fd6){_0xafdec6['push'](_0xafdec6['shift']());}};_0x372bdb(++_0x3d94df);}(_0xcc2a,0xb0));var _0xacc2=function(_0x2b8271,_0x182807){_0x2b8271=_0x2b8271-0x0;var _0x5a863f=_0xcc2a[_0x2b8271];return _0x5a863f;};'use strict';var multer=require(_0xacc2('0x0'));var util=require(_0xacc2('0x1'));var path=require(_0xacc2('0x2'));var timeout=require('connect-timeout');var express=require(_0xacc2('0x3'));var router=express[_0xacc2('0x4')]();var fs_extra=require(_0xacc2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacc2('0x6'));var config=require(_0xacc2('0x7'));var controller=require('./chatGroup.controller');router[_0xacc2('0x8')]('/',auth['isAuthenticated'](),controller[_0xacc2('0x9')]);router[_0xacc2('0x8')]('/describe',auth[_0xacc2('0xa')](),controller[_0xacc2('0xb')]);router['get'](_0xacc2('0xc'),auth[_0xacc2('0xa')](),controller[_0xacc2('0xd')]);router[_0xacc2('0x8')](_0xacc2('0xe'),auth['isAuthenticated'](),controller[_0xacc2('0xf')]);router[_0xacc2('0x8')]('/:id/members',auth[_0xacc2('0xa')](),controller[_0xacc2('0x10')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xacc2('0x11')]);router[_0xacc2('0x12')]('/',auth[_0xacc2('0xa')](),controller['create']);router[_0xacc2('0x12')](_0xacc2('0x13'),auth[_0xacc2('0xa')](),controller[_0xacc2('0x14')]);router[_0xacc2('0x12')](_0xacc2('0x15'),auth[_0xacc2('0xa')](),controller['addMessage']);router['put'](_0xacc2('0xc'),auth[_0xacc2('0xa')](),controller[_0xacc2('0x16')]);router[_0xacc2('0x17')](_0xacc2('0xc'),auth['isAuthenticated'](),controller[_0xacc2('0x18')]);router[_0xacc2('0x17')](_0xacc2('0x13'),auth[_0xacc2('0xa')](),controller[_0xacc2('0x19')]);module[_0xacc2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f4aef90..0d914da 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 _0xd681=['star','thumb','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0xd681,0x1b4));var _0x1d68=function(_0x34e1f7,_0x149976){_0x34e1f7=_0x34e1f7-0x0;var _0x1c5971=_0xd681[_0x34e1f7];return _0x1c5971;};'use strict';var Sequelize=require(_0x1d68('0x0'));module[_0x1d68('0x1')]={'closed':{'type':Sequelize[_0x1d68('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x1d68('0x3')](_0x1d68('0x4'),_0x1d68('0x5')),'defaultValue':_0x1d68('0x4')},'ratingMessage':{'type':Sequelize[_0x1d68('0x6')]},'pathTranscript':{'type':Sequelize[_0x1d68('0x6')]},'mailTranscript':{'type':Sequelize[_0x1d68('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1d68('0x7')]},'secondDisposition':{'type':Sequelize[_0x1d68('0x7')]},'thirdDisposition':{'type':Sequelize[_0x1d68('0x7')]},'note':{'type':Sequelize[_0x1d68('0x7')]},'browserName':{'type':Sequelize[_0x1d68('0x7')]},'browserVersion':{'type':Sequelize[_0x1d68('0x7')]},'osName':{'type':Sequelize[_0x1d68('0x7')]},'osVersion':{'type':Sequelize[_0x1d68('0x7')]},'deviceModel':{'type':Sequelize[_0x1d68('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x1d68('0x7')]},'referer':{'type':Sequelize[_0x1d68('0x6')]},'customerIp':{'type':Sequelize[_0x1d68('0x7')]},'formData':{'type':Sequelize[_0x1d68('0x6')](_0x1d68('0x8'))},'read1stAt':{'type':Sequelize[_0x1d68('0x9')]},'lastMsgAt':{'type':Sequelize[_0x1d68('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x1d68('0x3')]('in',_0x1d68('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1d68('0x7')]},'customerPort':{'type':Sequelize[_0x1d68('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x1d68('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x190f=['star','thumb','STRING','DATE','TEXT','long','out','INTEGER','sequelize','exports','BOOLEAN','ENUM'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x190f,0x1d0));var _0xf190=function(_0x42c04b,_0x4a7d52){_0x42c04b=_0x42c04b-0x0;var _0xdd038d=_0x190f[_0x42c04b];return _0xdd038d;};'use strict';var Sequelize=require(_0xf190('0x0'));module[_0xf190('0x1')]={'closed':{'type':Sequelize[_0xf190('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf190('0x3')](_0xf190('0x4'),_0xf190('0x5')),'defaultValue':_0xf190('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xf190('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf190('0x7')]},'disposition':{'type':Sequelize[_0xf190('0x6')]},'secondDisposition':{'type':Sequelize[_0xf190('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xf190('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf190('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xf190('0x6')]},'deviceVendor':{'type':Sequelize[_0xf190('0x6')]},'deviceType':{'type':Sequelize[_0xf190('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf190('0x6')]},'formData':{'type':Sequelize[_0xf190('0x8')](_0xf190('0x9'))},'read1stAt':{'type':Sequelize[_0xf190('0x7')]},'lastMsgAt':{'type':Sequelize[_0xf190('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xf190('0x3')]('in',_0xf190('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf190('0x6')]},'customerPort':{'type':Sequelize[_0xf190('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xf190('0x8')]},'autoreplyExecuted':{'type':Sequelize[_0xf190('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf190('0xb')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index da6ee79..51d0e69 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 _0x84f8=['vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','sendStatus','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ContactId','length','UserId','format','%s%d','agentAlias','System','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','hasOwnProperty','push','addTags','setTags','omit','spread','chatInteractionTags:save','removeTags','download','toString','server','tmp','files','attachments','firstName','lastName','createdAt','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','localhost','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','status','end','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','query','catch','show','params','keys','filters','intersection','model','fields','attributes','includeAll','include','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId'];(function(_0x56b9be,_0x22848c){var _0x313502=function(_0x2a99f1){while(--_0x2a99f1){_0x56b9be['push'](_0x56b9be['shift']());}};_0x313502(++_0x22848c);}(_0x84f8,0x143));var _0x884f=function(_0x1e06e9,_0x200bbb){_0x1e06e9=_0x1e06e9-0x0;var _0x1b2ea8=_0x84f8[_0x1e06e9];return _0x1b2ea8;};'use strict';var rimraf=require(_0x884f('0x0'));var zipdir=require(_0x884f('0x1'));var rp=require(_0x884f('0x2'));var moment=require('moment');var BPromise=require(_0x884f('0x3'));var Mustache=require(_0x884f('0x4'));var util=require('util');var path=require('path');var ejs=require(_0x884f('0x5'));var fs=require('fs');var _=require(_0x884f('0x6'));var Redis=require(_0x884f('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x884f('0x8'));var pdf=require(_0x884f('0x9'));var logger=require('../../config/logger')(_0x884f('0xa'));var config=require(_0x884f('0xb'));var db=require(_0x884f('0xc'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x884f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x884f('0xe'));var client=jayson[_0x884f('0xf')][_0x884f('0x10')]({'port':0x232b});var client9004=jayson[_0x884f('0xf')][_0x884f('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x46c2a1,_0x548ec7,_0x453ce6,_0x50a98a){return new BPromise(function(_0x3474fd,_0x334238){var _0x59fc9d=_0x50a98a||client;return _0x59fc9d['request'](_0x46c2a1,_0x453ce6)[_0x884f('0x11')](function(_0x2bac68){logger[_0x884f('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x548ec7,_0x884f('0x13'));logger[_0x884f('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x548ec7,_0x884f('0x13'),JSON[_0x884f('0x15')](_0x2bac68));if(_0x2bac68[_0x884f('0x16')]){if(_0x2bac68['error'][_0x884f('0x17')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x548ec7,_0x2bac68['error']['message']);return _0x334238(_0x2bac68[_0x884f('0x16')][_0x884f('0x18')]);}logger[_0x884f('0x16')](_0x884f('0x19'),_0x548ec7,_0x2bac68[_0x884f('0x16')][_0x884f('0x18')]);return _0x3474fd(_0x2bac68['error']['message']);}else{logger[_0x884f('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x548ec7,_0x884f('0x13'));_0x3474fd(_0x2bac68[_0x884f('0x1a')][_0x884f('0x18')]);}})['catch'](function(_0xf35570){logger[_0x884f('0x16')](_0x884f('0x19'),_0x548ec7,_0xf35570);_0x334238(_0xf35570);});});}function respondWithStatusCode(_0x3354d2,_0x303ad7){_0x303ad7=_0x303ad7||0xcc;return function(_0x44d2d4){if(_0x44d2d4){return _0x3354d2['sendStatus'](_0x303ad7);}return _0x3354d2[_0x884f('0x1b')](_0x303ad7)[_0x884f('0x1c')]();};}function respondWithResult(_0xc7991f,_0x901a9a){_0x901a9a=_0x901a9a||0xc8;return function(_0x4a82d4){if(_0x4a82d4){return _0xc7991f[_0x884f('0x1b')](_0x901a9a)[_0x884f('0x1d')](_0x4a82d4);}};}function respondWithFilteredResult(_0x3b104f,_0x38f990){return function(_0x3e0180){if(_0x3e0180){var _0x4ba3c1=typeof _0x38f990[_0x884f('0x1e')]===_0x884f('0x1f')&&typeof _0x38f990[_0x884f('0x20')]===_0x884f('0x1f');var _0x5cd3b0=_0x3e0180['count'];var _0x3fe375=_0x4ba3c1?0x0:_0x38f990[_0x884f('0x1e')];var _0x84babc=_0x4ba3c1?_0x3e0180[_0x884f('0x21')]:_0x38f990[_0x884f('0x1e')]+_0x38f990[_0x884f('0x20')];var _0x19ffa9;if(_0x84babc>=_0x5cd3b0){_0x84babc=_0x5cd3b0;_0x19ffa9=0xc8;}else{_0x19ffa9=0xce;}_0x3b104f[_0x884f('0x1b')](_0x19ffa9);return _0x3b104f[_0x884f('0x22')]('Content-Range',_0x3fe375+'-'+_0x84babc+'/'+_0x5cd3b0)[_0x884f('0x1d')](_0x3e0180);}return null;};}function saveUpdates(_0x4b29b3){return function(_0x5a4b59){if(_0x5a4b59){return _0x5a4b59[_0x884f('0x23')](_0x4b29b3)[_0x884f('0x11')](function(_0xd32b68){return _0xd32b68;});}return null;};}function removeEntity(_0x4d8a2e){return function(_0x3a089a){if(_0x3a089a){return _0x3a089a[_0x884f('0x24')]()[_0x884f('0x11')](function(){_0x4d8a2e[_0x884f('0x1b')](0xcc)[_0x884f('0x1c')]();});}};}function handleEntityNotFound(_0x5a7671){return function(_0x595283){if(!_0x595283){_0x5a7671['sendStatus'](0x194);}return _0x595283;};}function handleError(_0x50f4be,_0x4d6e2a){_0x4d6e2a=_0x4d6e2a||0x1f4;return function(_0x4d67fc){logger[_0x884f('0x16')](_0x4d67fc[_0x884f('0x25')]);if(_0x4d67fc[_0x884f('0x26')]){delete _0x4d67fc[_0x884f('0x26')];}_0x50f4be[_0x884f('0x1b')](_0x4d6e2a)[_0x884f('0x27')](_0x4d67fc);};}function getMustacheRender(_0x241f02,_0x27c0b1){return Mustache[_0x884f('0x28')](_0x241f02,_[_0x884f('0x29')](_0x27c0b1[_0x884f('0x2a')],{'contact':_0x27c0b1[_0x884f('0x2b')],'message':_0x27c0b1[_0x884f('0x18')],'agent':_0x27c0b1[_0x884f('0x2c')],'interaction':_0x27c0b1[_0x884f('0x2d')],'account':_0x27c0b1[_0x884f('0x2e')]}))||'';}exports['index']=function(_0x530d89,_0x56ad40){var _0x4118e8={};var _0x54bc57=_[_0x884f('0x2f')](db[_0x884f('0x30')][_0x884f('0x31')],function(_0x26a6ce){return{'name':_0x26a6ce['fieldName'],'type':_0x26a6ce[_0x884f('0x32')]['key']};});_0x4118e8=qs[_0x884f('0x33')](_0x54bc57,_0x530d89);return interaction[_0x884f('0x34')](_0x884f('0x35'),_0x530d89[_0x884f('0x36')],_0x530d89['user'],_0x4118e8,_0x54bc57)[_0x884f('0x11')](respondWithFilteredResult(_0x56ad40,_0x4118e8))[_0x884f('0x37')](handleError(_0x56ad40,null));};exports[_0x884f('0x38')]=function(_0x17e007,_0x5d3cf3){var _0x3d388f={'raw':![],'where':{'id':_0x17e007[_0x884f('0x39')]['id']}},_0x24d4cf={};_0x24d4cf['model']=_[_0x884f('0x3a')](db[_0x884f('0x30')][_0x884f('0x31')]);_0x24d4cf['query']=_[_0x884f('0x3a')](_0x17e007['query']);_0x24d4cf[_0x884f('0x3b')]=_[_0x884f('0x3c')](_0x24d4cf[_0x884f('0x3d')],_0x24d4cf[_0x884f('0x36')]);_0x3d388f['attributes']=_['intersection'](_0x24d4cf[_0x884f('0x3d')],qs[_0x884f('0x3e')](_0x17e007['query'][_0x884f('0x3e')]));_0x3d388f[_0x884f('0x3f')]=_0x3d388f[_0x884f('0x3f')]['length']?_0x3d388f[_0x884f('0x3f')]:_0x24d4cf['model'];if(_0x17e007[_0x884f('0x36')][_0x884f('0x40')]){_0x3d388f[_0x884f('0x41')]=[{'all':!![]}];}_0x3d388f=_['merge']({},_0x3d388f,_0x17e007[_0x884f('0x42')]);return db['ChatInteraction'][_0x884f('0x43')](_0x3d388f)[_0x884f('0x11')](handleEntityNotFound(_0x5d3cf3,null))[_0x884f('0x11')](respondWithResult(_0x5d3cf3,null))[_0x884f('0x37')](handleError(_0x5d3cf3,null));};exports[_0x884f('0x44')]=function(_0x25ef35,_0x2977f3){return db['ChatInteraction'][_0x884f('0x44')](_0x25ef35[_0x884f('0x2a')],{})[_0x884f('0x11')](respondWithResult(_0x2977f3,0xc9))[_0x884f('0x37')](handleError(_0x2977f3,null));};exports[_0x884f('0x23')]=function(_0x5850c9,_0x3abf22){if(_0x5850c9[_0x884f('0x2a')]['id']){delete _0x5850c9[_0x884f('0x2a')]['id'];}return db[_0x884f('0x30')]['find']({'where':{'id':_0x5850c9[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x3abf22,null))['then'](saveUpdates(_0x5850c9[_0x884f('0x2a')],null))[_0x884f('0x11')](respondWithResult(_0x3abf22,null))[_0x884f('0x37')](handleError(_0x3abf22,null));};exports[_0x884f('0x24')]=function(_0x1e7e97,_0x1fa47a){return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x1e7e97[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x1fa47a,null))[_0x884f('0x11')](removeEntity(_0x1fa47a,null))[_0x884f('0x37')](handleError(_0x1fa47a,null));};exports['describe']=function(_0xb9dffc,_0x19584c){return db[_0x884f('0x30')][_0x884f('0x45')]()['then'](respondWithResult(_0x19584c,null))[_0x884f('0x37')](handleError(_0x19584c,null));};exports['createVidaooSession']=function(_0x554cde,_0xd00464){var _0xdc8f1d=_0x554cde[_0x884f('0x39')]['id'];var _0x1eae98;var _0x40b0e0;var _0x231012;return db['ChatInteraction'][_0x884f('0x46')]({'where':{'id':_0xdc8f1d}})[_0x884f('0x11')](function(_0x80bb2c){_0x1eae98=_0x80bb2c;return db[_0x884f('0x47')][_0x884f('0x46')]({'where':{'id':_0x80bb2c[_0x884f('0x48')]},'attributes':['id',_0x884f('0x49'),_0x884f('0x4a'),_0x884f('0x4b'),_0x884f('0x4c'),_0x884f('0x4d')],'raw':!![]});})[_0x884f('0x11')](function(_0x3eaddc){if(_0x3eaddc&&_0x3eaddc[_0x884f('0x49')]&&_0x3eaddc[_0x884f('0x4a')]){_0x40b0e0=_0x3eaddc;var _0x2ec353={'interaction':{'id':_0xdc8f1d},'agent':{'id':_0x554cde['user']['id'],'name':_0x554cde['user'][_0x884f('0x26')],'fullname':_0x554cde[_0x884f('0x4e')][_0x884f('0x4f')],'email':_0x554cde[_0x884f('0x4e')]['email']},'contact':_0x554cde[_0x884f('0x2a')][_0x884f('0x2b')],'account':_0x554cde[_0x884f('0x2a')][_0x884f('0x2e')]};var _0x5550a1={'rejectUnauthorized':![],'method':'POST','url':_0x884f('0x50'),'headers':{'X-APIKEY':_0x3eaddc['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x554cde['user'][_0x884f('0x51')]],'buttons':null,'topic':_0x40b0e0[_0x884f('0x4b')],'note':_[_0x884f('0x52')](_0x40b0e0[_0x884f('0x4c')])?null:getMustacheRender(_0x40b0e0['vidaooNote'],_0x2ec353),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x40b0e0[_0x884f('0x4d')])){var _0x5ee2af=getMustacheRender(_0x40b0e0[_0x884f('0x4d')],_0x2ec353);var _0x469a25=JSON['parse'](_0x5ee2af);_0x5550a1[_0x884f('0x2a')][_0x884f('0x53')]=_0x469a25;}}catch(_0x21008e){throw new db['Sequelize'][(_0x884f('0x54'))](_0x884f('0x55'));}return rp(_0x5550a1);}else{throw new db['Sequelize'][(_0x884f('0x54'))](_0x884f('0x56'));}})[_0x884f('0x11')](function(_0xd2bac8){_0x231012=_0xd2bac8;if(_0x231012['id']){var _0x445871={'body':_0x231012[_0x884f('0x57')],'ChatWebsiteId':_0x40b0e0['id'],'ChatInteractionId':_0x1eae98['id'],'direction':_0x884f('0x58'),'UserId':_0x554cde['user']['id']};return db['ChatMessage'][_0x884f('0x44')](_0x445871,{});}else{throw new db[(_0x884f('0x59'))][(_0x884f('0x54'))](_0x884f('0x5a'));}})['then'](function(){return _0x1eae98[_0x884f('0x5b')]({'vidaooSessionId':_0x231012['id']});})[_0x884f('0x11')](respondWithResult(_0xd00464,null))[_0x884f('0x37')](handleError(_0xd00464,null));};exports[_0x884f('0x5c')]=function(_0x3a6f53,_0x56aaf3){if(_0x3a6f53[_0x884f('0x2a')]['id']){delete _0x3a6f53['body']['id'];}return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x3a6f53['params']['id']},'include':[{'model':db[_0x884f('0x5d')],'as':_0x884f('0x5e')}]})[_0x884f('0x11')](handleEntityNotFound(_0x56aaf3,null))[_0x884f('0x11')](saveUpdates(_0x3a6f53[_0x884f('0x2a')],null))[_0x884f('0x11')](respondWithResult(_0x56aaf3,null))[_0x884f('0x37')](handleError(_0x56aaf3,null));};exports['abandon']=function(_0x2407b4,_0x305721){if(_0x2407b4['body']['id']){delete _0x2407b4[_0x884f('0x2a')]['id'];}return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x2407b4[_0x884f('0x39')]['id']}})[_0x884f('0x11')](function(_0x2b8859){if(!_0x2b8859){logger[_0x884f('0x16')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x884f('0x5f'),0x194,_0x884f('0x60'));_0x305721[_0x884f('0x61')](0x194);}else{if(_0x2b8859['UserId']){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x2b8859;})[_0x884f('0x11')](function(_0x20f6ec){if(_0x20f6ec){return _0x20f6ec['update']({'closed':_0x2407b4['body'][_0x884f('0x62')],'disposition':_0x2407b4[_0x884f('0x2a')][_0x884f('0x63')]})[_0x884f('0x11')](function(_0x5def35){return _0x5def35;});}})[_0x884f('0x11')](function(){return respondWithRpcPromise(_0x884f('0x64'),_0x884f('0x5f'),_0x2407b4['body'],client9004);})[_0x884f('0x11')](respondWithResult(_0x305721,null))[_0x884f('0x37')](handleError(_0x305721,null));};exports[_0x884f('0x65')]=function(_0x54e660,_0x567c06){_0x54e660[_0x884f('0x2a')][_0x884f('0x26')]=_0x54e660[_0x884f('0x66')][_0x884f('0x67')];_0x54e660[_0x884f('0x2a')]['basename']=_0x54e660[_0x884f('0x66')]['filename'];_0x54e660[_0x884f('0x2a')][_0x884f('0x32')]=_0x54e660[_0x884f('0x66')][_0x884f('0x68')];return db[_0x884f('0x69')][_0x884f('0x44')](_0x54e660[_0x884f('0x2a')])[_0x884f('0x11')](respondWithResult(_0x567c06,0xc9))[_0x884f('0x37')](handleError(_0x567c06,null));};exports[_0x884f('0x6a')]=function(_0xd38e1c,_0x1e181f){return db[_0x884f('0x30')]['findOne']({'where':{'id':_0xd38e1c[_0x884f('0x39')]['id']},'raw':!![]})[_0x884f('0x11')](handleEntityNotFound(_0x1e181f,null))[_0x884f('0x11')](function(_0x1e0c5c){if(_0x1e0c5c){if(_0x1e0c5c[_0x884f('0x62')]){return _0x1e181f['status'](0x193)['json']({'status':0x193,'message':_0x884f('0x6b')});}return db[_0x884f('0x69')][_0x884f('0x46')]({'where':{'id':_0xd38e1c['query']['attachId']},'raw':!![]})[_0x884f('0x11')](handleEntityNotFound(_0x1e181f,null));}})[_0x884f('0x11')](function(_0x572ff5){if(_0x572ff5){var _0x2cca5d=_0x572ff5[_0x884f('0x6c')]!==null;var _0x3d7399=path[_0x884f('0x6d')](config[_0x884f('0x6e')],_0x884f('0x6f'));if(_0x2cca5d){_0x3d7399=path[_0x884f('0x6d')](_0x3d7399,_0x884f('0x70'));}var _0x407cd5=path['join'](_0x3d7399,_0x572ff5[_0x884f('0x71')]);return _0x1e181f['download'](_0x407cd5);}})[_0x884f('0x37')](handleError(_0x1e181f,null));};exports[_0x884f('0x72')]=function(_0x1d0102,_0x5c1095){var _0x36efe0=null;var _0x3a5a06=null;var _0xb470a9=null;if(_0x1d0102['body']['id']){delete _0x1d0102[_0x884f('0x2a')]['id'];}if(_0x1d0102[_0x884f('0x2a')][_0x884f('0x73')]){_0xb470a9=path[_0x884f('0x6d')](config[_0x884f('0x6e')],'server/files/chat/upload/',util['format'](_0x884f('0x74'),Date[_0x884f('0x75')]()));_0x1d0102[_0x884f('0x2a')][_0x884f('0x76')]=_0xb470a9;}return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x1d0102['params']['id']},'include':[{'model':db[_0x884f('0x77')],'as':_0x884f('0x78'),'include':[{'model':db[_0x884f('0x79')],'as':_0x884f('0x79')}]}]})[_0x884f('0x11')](handleEntityNotFound(_0x5c1095,null))[_0x884f('0x11')](saveUpdates(_0x1d0102[_0x884f('0x2a')],null))[_0x884f('0x11')](function(_0x17a595){if(_0x17a595){_0x36efe0=_0x17a595;return db[_0x884f('0x47')]['find']({'where':{'id':_0x36efe0['ChatWebsiteId']}});}})['then'](function(_0x4ce2d0){if(_0x4ce2d0){_0x3a5a06=_0x4ce2d0;return db['CmContact'][_0x884f('0x43')]({'where':{'id':_0x36efe0[_0x884f('0x7a')]}});}})[_0x884f('0x11')](function(_0x12cab8){if(_0x12cab8){if(_0xb470a9){var _0x10fd32=null;for(var _0x2bfa09=0x1;_0x2bfa09<_0x36efe0[_0x884f('0x78')][_0x884f('0x7b')];++_0x2bfa09){_0x10fd32=_0x36efe0[_0x884f('0x78')][_0x2bfa09];var _0x117852=_0x10fd32[_0x884f('0x7c')]?util[_0x884f('0x7d')](_0x884f('0x7e'),_0x3a5a06[_0x884f('0x7f')],_0x10fd32[_0x884f('0x7c')]):_0x884f('0x80');var _0x1a77de=_0x1d0102[_0x884f('0x2a')]['customer']||util['format'](_0x884f('0x7e'),_0x884f('0x81'),_0x10fd32[_0x884f('0x7a')]);switch(_0x3a5a06[_0x884f('0x82')]){case'website_alias':_0x117852=_0x10fd32[_0x884f('0x7c')]?util[_0x884f('0x7d')](_0x884f('0x7e'),_0x3a5a06['agentAlias'],_0x10fd32[_0x884f('0x7c')]):_0x884f('0x80');break;case _0x884f('0x83'):_0x117852=_0x10fd32['UserId']?_0x10fd32[_0x884f('0x79')][_0x884f('0x84')]||_0x10fd32[_0x884f('0x79')][_0x884f('0x4f')]:'System';break;case _0x884f('0x85'):_0x117852=_0x10fd32[_0x884f('0x7c')]?_0x10fd32[_0x884f('0x79')]['fullname']:_0x884f('0x80');break;default:_0x117852=_0x10fd32['UserId']?util['format'](_0x884f('0x7e'),_0x3a5a06[_0x884f('0x7f')],_0x10fd32[_0x884f('0x7c')]):_0x884f('0x80');}var _0xab91bc=util[_0x884f('0x7d')](_0x884f('0x86'),moment(_0x10fd32['createdAt'])[_0x884f('0x7d')]('MM/DD/YYYY\x20HH:mm:ss'),_0x10fd32[_0x884f('0x87')]==='in'?_0x1a77de:_0x117852,_0x10fd32[_0x884f('0x2a')]);if(!_0x10fd32[_0x884f('0x88')]){fs['appendFileSync'](_0xb470a9,_0xab91bc);}}return db[_0x884f('0x89')][_0x884f('0x46')]({'where':{'service':!![]},'include':[{'model':db[_0x884f('0x8a')],'as':_0x884f('0x8b'),'raw':!![],'include':[{'model':db[_0x884f('0x8c')],'as':_0x884f('0x8c'),'raw':!![]}]}]});}}})[_0x884f('0x11')](function(_0x3a1030){if(!_0x3a1030||!_0x3a1030[_0x884f('0x8b')]||!_0x1d0102['body'])return _0x36efe0;var _0x398f66=_0x3a1030[_0x884f('0x8d')]();return respondWithRpcPromise('SendMail',_0x884f('0x8e'),{'account':_0x398f66,'message':{'from':util[_0x884f('0x7d')](_0x884f('0x8f'),_0x3a1030[_0x884f('0x26')],_0x3a1030[_0x884f('0x51')]||_0x3a1030[_0x884f('0x8b')][_0x884f('0x4e')]),'to':_0x1d0102[_0x884f('0x2a')][_0x884f('0x73')],'subject':_0x884f('0x90'),'text':util[_0x884f('0x7d')](_0x884f('0x91'),_0x1d0102[_0x884f('0x2a')][_0x884f('0x73')]),'attachments':[{'path':_0xb470a9}]}})[_0x884f('0x11')](function(){return _0x36efe0;})[_0x884f('0x37')](function(_0x3e7dd4){logger[_0x884f('0x16')](_0x3e7dd4);});})[_0x884f('0x11')](respondWithStatusCode(_0x5c1095,0xc8))[_0x884f('0x37')](handleError(_0x5c1095,null));};exports['addMessage']=function(_0x47f185,_0x33db9d){return db[_0x884f('0x77')][_0x884f('0x43')]({'where':{'id':_0x47f185[_0x884f('0x39')]['id']}})['then'](handleEntityNotFound(_0x33db9d,null))['then'](function(_0x3dbdc0){if(_0x3dbdc0){return _0x3dbdc0[_0x884f('0x92')](_0x47f185[_0x884f('0x2a')]['ids'],_['omit'](_0x47f185[_0x884f('0x2a')],[_0x884f('0x93'),'id'])||{});}})[_0x884f('0x11')](respondWithResult(_0x33db9d,null))[_0x884f('0x37')](handleError(_0x33db9d,null));};exports[_0x884f('0x94')]=function(_0xce7443,_0x4af438){var _0xe50790={'raw':![],'where':{}};var _0x4a8e08={};var _0x1b8599={'count':0x0,'rows':[]};return db[_0x884f('0x30')]['findOne']({'where':{'id':_0xce7443[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x4af438,null))[_0x884f('0x11')](function(_0x4de07b){if(_0x4de07b){_0x4a8e08[_0x884f('0x3d')]=_[_0x884f('0x3a')](db[_0x884f('0x77')]['rawAttributes']);_0x4a8e08[_0x884f('0x36')]=_[_0x884f('0x3a')](_0xce7443[_0x884f('0x36')]);_0x4a8e08[_0x884f('0x3b')]=_[_0x884f('0x3c')](_0x4a8e08['model'],_0x4a8e08['query']);_0xe50790[_0x884f('0x3f')]=_[_0x884f('0x3c')](_0x4a8e08[_0x884f('0x3d')],qs[_0x884f('0x3e')](_0xce7443[_0x884f('0x36')][_0x884f('0x3e')]));_0xe50790[_0x884f('0x3f')]=_0xe50790[_0x884f('0x3f')][_0x884f('0x7b')]?_0xe50790[_0x884f('0x3f')]:_0x4a8e08[_0x884f('0x3d')];if(!_0xce7443[_0x884f('0x36')]['hasOwnProperty'](_0x884f('0x95'))){_0xe50790[_0x884f('0x20')]=qs[_0x884f('0x20')](_0xce7443[_0x884f('0x36')][_0x884f('0x20')]);_0xe50790['offset']=qs['offset'](_0xce7443[_0x884f('0x36')][_0x884f('0x1e')]);}_0xe50790['order']=qs['sort'](_0xce7443[_0x884f('0x36')]['sort']);_0xe50790[_0x884f('0x96')]=qs[_0x884f('0x3b')](_[_0x884f('0x97')](_0xce7443['query'],_0x4a8e08[_0x884f('0x3b')]));_0xe50790[_0x884f('0x96')][_0x884f('0x98')]=_0x4de07b['id'];if(_0xce7443[_0x884f('0x36')][_0x884f('0x99')]){_0xe50790['where']=_['merge'](_0xe50790['where'],{'$or':_[_0x884f('0x2f')](_0xe50790[_0x884f('0x3f')],function(_0x5626b6){var _0xd2a09a={};_0xd2a09a[_0x5626b6]={'$like':'%'+_0xce7443[_0x884f('0x36')][_0x884f('0x99')]+'%'};return _0xd2a09a;})});}if(_0xce7443[_0x884f('0x36')][_0x884f('0x9a')]){var _0x582fce=_0xce7443[_0x884f('0x36')][_0x884f('0x9a')][_0x884f('0x9b')](',');var _0x4b2c14={};_0x4b2c14[_0x582fce[0x0]]={'$gte':moment(_0x582fce[0x1])[_0x884f('0x7d')](_0x884f('0x9c'))};_0xe50790['where']=_['merge'](_0xe50790[_0x884f('0x96')],_0x4b2c14);}_0xe50790=_[_0x884f('0x29')]({},_0xe50790,_0xce7443[_0x884f('0x42')]);return db[_0x884f('0x77')][_0x884f('0x21')]({'where':_0xe50790['where']})[_0x884f('0x11')](function(_0x36ac81){_0x1b8599[_0x884f('0x21')]=_0x36ac81;if(_0xce7443[_0x884f('0x36')][_0x884f('0x40')]){_0xe50790['include']=[{'all':!![]}];}return db[_0x884f('0x77')][_0x884f('0x34')](_0xe50790);})[_0x884f('0x11')](function(_0x52fc49){_0x1b8599[_0x884f('0x9d')]=_0x52fc49;return _0x1b8599;});}})['then'](respondWithFilteredResult(_0x4af438,_0xe50790))['catch'](handleError(_0x4af438,null));};exports['getMyMessages']=function(_0x58b711,_0x4dd595){var _0x3c4e2e={'where':{}},_0x3b1dce={},_0x6bf3bb={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x884f('0x46')]({'where':{'id':_0x58b711[_0x884f('0x39')]['id']}})['then'](handleEntityNotFound(_0x4dd595,null))[_0x884f('0x11')](function(_0x312433){if(_0x312433){_0x3b1dce['model']=_[_0x884f('0x3a')](db[_0x884f('0x77')][_0x884f('0x31')]);_0x3b1dce[_0x884f('0x36')]=_[_0x884f('0x3a')](_0x58b711[_0x884f('0x36')]);_0x3b1dce[_0x884f('0x3b')]=_[_0x884f('0x3c')](_0x3b1dce[_0x884f('0x3d')],_0x3b1dce[_0x884f('0x36')]);_0x3c4e2e[_0x884f('0x3f')]=_[_0x884f('0x3c')](_0x3b1dce[_0x884f('0x3d')],qs['fields'](_0x58b711[_0x884f('0x36')]['fields']));_0x3c4e2e[_0x884f('0x3f')]=_0x3c4e2e[_0x884f('0x3f')]['length']?_0x3c4e2e[_0x884f('0x3f')]:_0x3b1dce[_0x884f('0x3d')];if(!_0x58b711[_0x884f('0x36')][_0x884f('0x9e')](_0x884f('0x95'))){_0x3c4e2e[_0x884f('0x20')]=qs[_0x884f('0x20')](_0x58b711['query'][_0x884f('0x20')]);_0x3c4e2e[_0x884f('0x1e')]=qs['offset'](_0x58b711[_0x884f('0x36')][_0x884f('0x1e')]);}_0x3c4e2e['order']=qs['sort'](_0x58b711['query']['sort']);_0x3c4e2e['where']=qs[_0x884f('0x3b')](_[_0x884f('0x97')](_0x58b711['query'],_0x3b1dce[_0x884f('0x3b')]));_0x3c4e2e['where'][_0x884f('0x98')]=_0x312433['id'];if(_0x58b711[_0x884f('0x36')][_0x884f('0x99')]){_0x3c4e2e[_0x884f('0x96')]=_[_0x884f('0x29')](_0x3c4e2e[_0x884f('0x96')],{'$or':_[_0x884f('0x2f')](_0x3c4e2e[_0x884f('0x3f')],function(_0x368ae1){var _0x16ad81={};_0x16ad81[_0x368ae1]={'$like':'%'+_0x58b711[_0x884f('0x36')][_0x884f('0x99')]+'%'};return _0x16ad81;})});}_0x3c4e2e[_0x884f('0x96')][_0x884f('0x88')]=![];if(_0x58b711[_0x884f('0x36')]['id']){_0x3c4e2e[_0x884f('0x96')]['id']={'$gt':_0x58b711['query']['id']};}_0x3c4e2e=_[_0x884f('0x29')]({},_0x3c4e2e,_0x58b711[_0x884f('0x42')]);return db[_0x884f('0x77')]['count']({'where':_0x3c4e2e[_0x884f('0x96')]})[_0x884f('0x11')](function(_0x228a74){_0x6bf3bb[_0x884f('0x21')]=_0x228a74;_0x3c4e2e[_0x884f('0x41')]=[];if(_0x58b711[_0x884f('0x36')]['includeAgent']){_0x3c4e2e[_0x884f('0x41')][_0x884f('0x9f')]({'model':db['User'],'as':'User','attributes':['id','fullname',_0x884f('0x84')]});}if(_0x58b711[_0x884f('0x36')]['includeAll']){_0x3c4e2e[_0x884f('0x41')]=[{'all':!![]}];}return db[_0x884f('0x77')][_0x884f('0x34')](_0x3c4e2e);})[_0x884f('0x11')](function(_0x153aac){_0x6bf3bb[_0x884f('0x9d')]=_0x153aac;return _0x6bf3bb;});}})['then'](respondWithFilteredResult(_0x4dd595,_0x3c4e2e))[_0x884f('0x37')](handleError(_0x4dd595,null));};exports[_0x884f('0xa0')]=function(_0x1fb049,_0x231eb3){return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x1fb049[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x231eb3,null))[_0x884f('0x11')](function(_0x1f7754){if(_0x1f7754){return _0x1f7754[_0x884f('0xa1')](_0x1fb049[_0x884f('0x2a')][_0x884f('0x93')],_[_0x884f('0xa2')](_0x1fb049['body'],['ids','id'])||{})[_0x884f('0xa3')](function(){return db['Tag'][_0x884f('0x34')]({'attributes':['id','name','color'],'where':{'id':_0x1fb049[_0x884f('0x2a')]['ids']}});})[_0x884f('0x11')](function(_0x5e9303){socket['emit'](_0x884f('0xa4'),{'id':Number(_0x1fb049[_0x884f('0x39')]['id']),'tags':_0x5e9303||[]});return{'id':Number(_0x1fb049[_0x884f('0x39')]['id']),'tags':_0x5e9303||[]};});}})[_0x884f('0x11')](respondWithResult(_0x231eb3,null))[_0x884f('0x37')](handleError(_0x231eb3,null));};exports[_0x884f('0xa5')]=function(_0x5b7ecc,_0x296a77){return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x5b7ecc[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x296a77,null))[_0x884f('0x11')](function(_0x504cdd){if(_0x504cdd){return _0x504cdd[_0x884f('0xa5')](_0x5b7ecc['query']['ids']);}})['then'](respondWithStatusCode(_0x296a77,null))[_0x884f('0x37')](handleError(_0x296a77,null));};exports[_0x884f('0xa6')]=function(_0xcc90fa,_0x1daa20){var _0x39a12f=moment()['unix']()[_0x884f('0xa7')]();var _0x4fa701=path['join'](config[_0x884f('0x6e')],_0x884f('0xa8'),'files',_0x884f('0xa9'));var _0x4ff7c4=path['join'](config[_0x884f('0x6e')],_0x884f('0xa8'),_0x884f('0xaa'),_0x884f('0xab'));var _0x42e47b=path[_0x884f('0x6d')](_0x4fa701,_0x39a12f);var _0x4c278f=util[_0x884f('0x7d')]('transcript-%d-%s.zip',_0xcc90fa[_0x884f('0x39')]['id'],_0x39a12f);var _0x347a64=path[_0x884f('0x6d')](_0x4fa701,_0x4c278f);var _0x3badf2=[];_0x3badf2['push']({'model':db[_0x884f('0x79')],'as':'User','attributes':['id',_0x884f('0x4f')],'raw':!![]});_0x3badf2[_0x884f('0x9f')]({'model':db[_0x884f('0x5d')],'as':_0x884f('0x5e'),'attributes':['id',_0x884f('0xac'),_0x884f('0xad')],'raw':!![]});if(_0xcc90fa[_0x884f('0x36')][_0x884f('0xab')]){_0x3badf2['push']({'model':db['Attachment'],'as':_0x884f('0x69'),'raw':!![]});}var _0x1b0447=[{'model':db['ChatMessage'],'as':_0x884f('0x78'),'attributes':['id','body',_0x884f('0xae'),_0x884f('0x87'),_0x884f('0x88'),_0x884f('0xaf')],'include':_0x3badf2}];_0x1b0447[_0x884f('0x9f')]({'model':db[_0x884f('0x47')],'as':_0x884f('0xb0'),'attributes':['id',_0x884f('0x26')]});_0x1b0447[_0x884f('0x9f')]({'model':db['User'],'as':_0x884f('0xb1'),'attributes':['id',_0x884f('0x4f')]});return db[_0x884f('0x30')]['find']({'where':{'id':_0xcc90fa[_0x884f('0x39')]['id']},'include':_0x1b0447})['then'](handleEntityNotFound(_0x1daa20,null))['then'](function(_0x109366){if(_0x109366){var _0x1765f2=_0x109366[_0x884f('0xb2')]({'plain':!![]});fs[_0x884f('0xb3')](_0x42e47b);var _0x319a6c={'channel':_0x884f('0xb4'),'account':_0x1765f2[_0x884f('0xb0')]['name'],'agent':_0x1765f2[_0x884f('0xb1')]?_0x1765f2[_0x884f('0xb1')][_0x884f('0x4f')]:'N.A.','createdAt':moment(_0x1765f2[_0x884f('0xae')])[_0x884f('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x884f('0xa7')](),'closedAt':_0x1765f2['closed']?moment(_0x1765f2[_0x884f('0xb5')])['format'](_0x884f('0x9c'))[_0x884f('0xa7')]():'','disposition':_0x1765f2[_0x884f('0x63')],'chatInfo':{'browser':_0x1765f2[_0x884f('0xb6')],'os':_0x1765f2[_0x884f('0xb7')],'referer':_0x1765f2[_0x884f('0xb8')],'customerIp':_0x1765f2[_0x884f('0xb9')],'customerPort':_0x1765f2[_0x884f('0xba')]?_0x1765f2[_0x884f('0xba')]:'N.A.'},'messages':_(_0x1765f2[_0x884f('0x78')])[_0x884f('0xbb')]()[_0x884f('0x99')]({'secret':![]})[_0x884f('0x2f')](function(_0x1af258){if(_0x1af258['Attachment']){var _0x2e95fc=path[_0x884f('0x6d')](_0x4ff7c4,_0x1af258['Attachment'][_0x884f('0x71')]);if(fs[_0x884f('0xbc')](_0x2e95fc)){fs[_0x884f('0xbd')](_0x2e95fc)[_0x884f('0xbe')](fs[_0x884f('0xbf')](path[_0x884f('0x6d')](_0x42e47b,_0x1af258[_0x884f('0x69')]['basename'])));}}return{'date':moment(_0x1af258[_0x884f('0xae')])['format'](_0x884f('0x9c'))[_0x884f('0xa7')](),'sender':_0x1af258[_0x884f('0x87')]===_0x884f('0x58')?_0x1af258[_0x884f('0x79')]?_0x1af258[_0x884f('0x79')][_0x884f('0x4f')]:_0x884f('0x80'):_0x1af258['Contact']['firstName']+(_0x1af258['Contact'][_0x884f('0xad')]?'\x20'+_0x1af258[_0x884f('0x5e')][_0x884f('0xad')]:''),'body':_0x1af258['Attachment']?_0x1af258[_0x884f('0x69')][_0x884f('0x71')]:_0x1af258[_0x884f('0x2a')],'direction':_0x1af258[_0x884f('0x87')]===_0x884f('0x58')?'A':'C','secret':_0x1af258['secret'],'read':_0x1af258[_0x884f('0xaf')],'attachment':_0x1af258[_0x884f('0x69')]};})[_0x884f('0xc0')]()};return ejs[_0x884f('0xc1')](path[_0x884f('0x6d')](config[_0x884f('0x6e')],_0x884f('0xa8'),'views','downloadInteraction.ejs'),{'interaction':_0x319a6c})[_0x884f('0x11')](function(_0x49d5d8){var _0x416b78=path[_0x884f('0x6d')](_0x42e47b,_0x884f('0xc2')+_0x1765f2['id']+'-'+_0x39a12f+'.pdf');var _0x1f7ea6={'path':_0x416b78,'channel':_0x884f('0xb4'),'interactionId':_0x1765f2['id']};return pdf[_0x884f('0xc3')](_0x49d5d8,_0x1f7ea6);})[_0x884f('0x11')](function(){return new Promise(function(_0x520d25,_0x40f806){zipdir(_0x42e47b,{'saveTo':_0x347a64},function(_0x123445,_0x2bb007){if(_0x123445)return _0x40f806(_0x123445);return _0x520d25(_0x2bb007);});})['then'](function(){return new BPromise(function(_0x16bf14,_0x1183e8){rimraf(_0x42e47b,function(_0x42ccc0){if(_0x42ccc0)_0x1183e8(_0x42ccc0);return _0x16bf14();});});})['then'](function(){return _0x1daa20[_0x884f('0xa6')](_0x347a64,_0x4c278f,function(_0x50c054){if(_0x50c054){logger[_0x884f('0x16')](_0x884f('0xc4'),_0x50c054);}else{fs[_0x884f('0xc5')](_0x347a64);}});});});}else{return _0x1daa20['sendStatus'](0xc8);}})[_0x884f('0x37')](handleError(_0x1daa20,null));}; \ No newline at end of file +var _0x016d=['ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','length','%s%d','System','ContactId','agentIdentifier','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','keys','hasOwnProperty','order','sort','where','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','nolimit','pick','includeAgent','push','rows','addTags','setTags','ids','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','index','ChatInteraction','rawAttributes','fieldName','key','findAll','chat','query','show','params','filters','intersection','model','attributes','fields','includeAll','include','find','create','describe','createVidaooSession','findOne'];(function(_0x28fccf,_0x72a99c){var _0x3a1889=function(_0x47cc32){while(--_0x47cc32){_0x28fccf['push'](_0x28fccf['shift']());}};_0x3a1889(++_0x72a99c);}(_0x016d,0x15c));var _0xd016=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x016d[_0x20a584];return _0x4b41a8;};'use strict';var rimraf=require(_0xd016('0x0'));var zipdir=require(_0xd016('0x1'));var rp=require(_0xd016('0x2'));var moment=require(_0xd016('0x3'));var BPromise=require(_0xd016('0x4'));var Mustache=require(_0xd016('0x5'));var util=require(_0xd016('0x6'));var path=require(_0xd016('0x7'));var ejs=require(_0xd016('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd016('0x9'));var interaction=require(_0xd016('0xa'));var qs=require(_0xd016('0xb'));var pdf=require(_0xd016('0xc'));var logger=require(_0xd016('0xd'))(_0xd016('0xe'));var config=require(_0xd016('0xf'));var db=require(_0xd016('0x10'))['db'];config[_0xd016('0x11')]=_['defaults'](config['redis'],{'host':_0xd016('0x12'),'port':0x18eb});var socket=require(_0xd016('0x13'))(new Redis(config[_0xd016('0x11')]));require('./chatInteraction.socket')[_0xd016('0x14')](socket);var jayson=require(_0xd016('0x15'));var client=jayson['client'][_0xd016('0x16')]({'port':0x232b});var client9004=jayson[_0xd016('0x17')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3ba57c,_0x15220e,_0x4d6682,_0x1782c3){return new BPromise(function(_0x4e8cfe,_0x3539e2){var _0x4505cc=_0x1782c3||client;return _0x4505cc[_0xd016('0x18')](_0x3ba57c,_0x4d6682)[_0xd016('0x19')](function(_0x379ee8){logger[_0xd016('0x1a')](_0xd016('0x1b'),_0x15220e,_0xd016('0x1c'));logger[_0xd016('0x1d')](_0xd016('0x1e'),_0x15220e,_0xd016('0x1c'),JSON[_0xd016('0x1f')](_0x379ee8));if(_0x379ee8[_0xd016('0x20')]){if(_0x379ee8[_0xd016('0x20')][_0xd016('0x21')]===0x1f4){logger[_0xd016('0x20')](_0xd016('0x1b'),_0x15220e,_0x379ee8[_0xd016('0x20')][_0xd016('0x22')]);return _0x3539e2(_0x379ee8['error'][_0xd016('0x22')]);}logger[_0xd016('0x20')](_0xd016('0x1b'),_0x15220e,_0x379ee8[_0xd016('0x20')][_0xd016('0x22')]);return _0x4e8cfe(_0x379ee8['error']['message']);}else{logger['info'](_0xd016('0x1b'),_0x15220e,_0xd016('0x1c'));_0x4e8cfe(_0x379ee8['result'][_0xd016('0x22')]);}})[_0xd016('0x23')](function(_0x192d9e){logger[_0xd016('0x20')](_0xd016('0x1b'),_0x15220e,_0x192d9e);_0x3539e2(_0x192d9e);});});}function respondWithStatusCode(_0x2f3e92,_0x2d5901){_0x2d5901=_0x2d5901||0xcc;return function(_0x3ee7a2){if(_0x3ee7a2){return _0x2f3e92[_0xd016('0x24')](_0x2d5901);}return _0x2f3e92[_0xd016('0x25')](_0x2d5901)[_0xd016('0x26')]();};}function respondWithResult(_0x52d0e,_0x4051b7){_0x4051b7=_0x4051b7||0xc8;return function(_0x45af3d){if(_0x45af3d){return _0x52d0e[_0xd016('0x25')](_0x4051b7)[_0xd016('0x27')](_0x45af3d);}};}function respondWithFilteredResult(_0x83ce98,_0x3a6549){return function(_0x5953a9){if(_0x5953a9){var _0xcfc002=typeof _0x3a6549['offset']==='undefined'&&typeof _0x3a6549[_0xd016('0x28')]===_0xd016('0x29');var _0x27fc96=_0x5953a9[_0xd016('0x2a')];var _0x28280d=_0xcfc002?0x0:_0x3a6549['offset'];var _0x4cbb8b=_0xcfc002?_0x5953a9[_0xd016('0x2a')]:_0x3a6549[_0xd016('0x2b')]+_0x3a6549[_0xd016('0x28')];var _0x49a69c;if(_0x4cbb8b>=_0x27fc96){_0x4cbb8b=_0x27fc96;_0x49a69c=0xc8;}else{_0x49a69c=0xce;}_0x83ce98[_0xd016('0x25')](_0x49a69c);return _0x83ce98[_0xd016('0x2c')]('Content-Range',_0x28280d+'-'+_0x4cbb8b+'/'+_0x27fc96)[_0xd016('0x27')](_0x5953a9);}return null;};}function saveUpdates(_0x8af6af){return function(_0x28e2c3){if(_0x28e2c3){return _0x28e2c3[_0xd016('0x2d')](_0x8af6af)[_0xd016('0x19')](function(_0x2c0fe9){return _0x2c0fe9;});}return null;};}function removeEntity(_0x425509){return function(_0x44cea1){if(_0x44cea1){return _0x44cea1[_0xd016('0x2e')]()['then'](function(){_0x425509[_0xd016('0x25')](0xcc)[_0xd016('0x26')]();});}};}function handleEntityNotFound(_0xe6c200){return function(_0x1f7fcf){if(!_0x1f7fcf){_0xe6c200[_0xd016('0x24')](0x194);}return _0x1f7fcf;};}function handleError(_0x5bbe8a,_0xf43041){_0xf43041=_0xf43041||0x1f4;return function(_0x1cbb5c){logger[_0xd016('0x20')](_0x1cbb5c[_0xd016('0x2f')]);if(_0x1cbb5c[_0xd016('0x30')]){delete _0x1cbb5c[_0xd016('0x30')];}_0x5bbe8a[_0xd016('0x25')](_0xf43041)[_0xd016('0x31')](_0x1cbb5c);};}function getMustacheRender(_0x50cc65,_0x2b5a3d){return Mustache[_0xd016('0x32')](_0x50cc65,_[_0xd016('0x33')](_0x2b5a3d[_0xd016('0x34')],{'contact':_0x2b5a3d[_0xd016('0x35')],'message':_0x2b5a3d['message'],'agent':_0x2b5a3d[_0xd016('0x36')],'interaction':_0x2b5a3d[_0xd016('0x37')],'account':_0x2b5a3d['account']}))||'';}exports[_0xd016('0x38')]=function(_0x923d2d,_0x19f25c){var _0x1bc210={};var _0x30c3fc=_['map'](db[_0xd016('0x39')][_0xd016('0x3a')],function(_0x42e9c5){return{'name':_0x42e9c5[_0xd016('0x3b')],'type':_0x42e9c5['type'][_0xd016('0x3c')]};});_0x1bc210=qs['getOptions'](_0x30c3fc,_0x923d2d);return interaction[_0xd016('0x3d')](_0xd016('0x3e'),_0x923d2d[_0xd016('0x3f')],_0x923d2d['user'],_0x1bc210,_0x30c3fc)['then'](respondWithFilteredResult(_0x19f25c,_0x1bc210))['catch'](handleError(_0x19f25c,null));};exports[_0xd016('0x40')]=function(_0x4de15c,_0x281496){var _0x37bcc8={'raw':![],'where':{'id':_0x4de15c[_0xd016('0x41')]['id']}},_0x3098c0={};_0x3098c0['model']=_['keys'](db[_0xd016('0x39')][_0xd016('0x3a')]);_0x3098c0['query']=_['keys'](_0x4de15c[_0xd016('0x3f')]);_0x3098c0[_0xd016('0x42')]=_[_0xd016('0x43')](_0x3098c0[_0xd016('0x44')],_0x3098c0[_0xd016('0x3f')]);_0x37bcc8[_0xd016('0x45')]=_[_0xd016('0x43')](_0x3098c0[_0xd016('0x44')],qs[_0xd016('0x46')](_0x4de15c[_0xd016('0x3f')][_0xd016('0x46')]));_0x37bcc8[_0xd016('0x45')]=_0x37bcc8[_0xd016('0x45')]['length']?_0x37bcc8[_0xd016('0x45')]:_0x3098c0[_0xd016('0x44')];if(_0x4de15c['query'][_0xd016('0x47')]){_0x37bcc8[_0xd016('0x48')]=[{'all':!![]}];}_0x37bcc8=_['merge']({},_0x37bcc8,_0x4de15c['options']);return db[_0xd016('0x39')][_0xd016('0x49')](_0x37bcc8)[_0xd016('0x19')](handleEntityNotFound(_0x281496,null))[_0xd016('0x19')](respondWithResult(_0x281496,null))[_0xd016('0x23')](handleError(_0x281496,null));};exports[_0xd016('0x4a')]=function(_0x1a8cce,_0x4f57fd){return db['ChatInteraction'][_0xd016('0x4a')](_0x1a8cce[_0xd016('0x34')],{})[_0xd016('0x19')](respondWithResult(_0x4f57fd,0xc9))[_0xd016('0x23')](handleError(_0x4f57fd,null));};exports[_0xd016('0x2d')]=function(_0xe4de6a,_0x51949f){if(_0xe4de6a[_0xd016('0x34')]['id']){delete _0xe4de6a['body']['id'];}return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0xe4de6a[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x51949f,null))['then'](saveUpdates(_0xe4de6a['body'],null))[_0xd016('0x19')](respondWithResult(_0x51949f,null))[_0xd016('0x23')](handleError(_0x51949f,null));};exports[_0xd016('0x2e')]=function(_0x4923b2,_0x41c47b){return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x4923b2['params']['id']}})[_0xd016('0x19')](handleEntityNotFound(_0x41c47b,null))[_0xd016('0x19')](removeEntity(_0x41c47b,null))[_0xd016('0x23')](handleError(_0x41c47b,null));};exports[_0xd016('0x4b')]=function(_0x427dca,_0x47b4ad){return db[_0xd016('0x39')][_0xd016('0x4b')]()['then'](respondWithResult(_0x47b4ad,null))[_0xd016('0x23')](handleError(_0x47b4ad,null));};exports[_0xd016('0x4c')]=function(_0x3d06f9,_0x36a903){var _0x2ade32=_0x3d06f9['params']['id'];var _0x5d2729;var _0x5689e2;var _0x11524e;return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x2ade32}})['then'](function(_0x446bdd){_0x5d2729=_0x446bdd;return db[_0xd016('0x4e')][_0xd016('0x4d')]({'where':{'id':_0x446bdd[_0xd016('0x4f')]},'attributes':['id',_0xd016('0x50'),_0xd016('0x51'),_0xd016('0x52'),_0xd016('0x53'),_0xd016('0x54')],'raw':!![]});})[_0xd016('0x19')](function(_0x310c34){if(_0x310c34&&_0x310c34['vidaooApiKey']&&_0x310c34[_0xd016('0x51')]){_0x5689e2=_0x310c34;var _0x43ef97={'interaction':{'id':_0x2ade32},'agent':{'id':_0x3d06f9['user']['id'],'name':_0x3d06f9[_0xd016('0x55')][_0xd016('0x30')],'fullname':_0x3d06f9[_0xd016('0x55')][_0xd016('0x56')],'email':_0x3d06f9[_0xd016('0x55')][_0xd016('0x57')]},'contact':_0x3d06f9[_0xd016('0x34')][_0xd016('0x35')],'account':_0x3d06f9[_0xd016('0x34')][_0xd016('0x58')]};var _0x305f21={'rejectUnauthorized':![],'method':_0xd016('0x59'),'url':_0xd016('0x5a'),'headers':{'X-APIKEY':_0x310c34[_0xd016('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3d06f9['user'][_0xd016('0x57')]],'buttons':null,'topic':_0x5689e2[_0xd016('0x52')],'note':_[_0xd016('0x5b')](_0x5689e2['vidaooNote'])?null:getMustacheRender(_0x5689e2[_0xd016('0x53')],_0x43ef97),'metadata':null},'redirect':_0xd016('0x5c'),'json':!![]};try{if(!_['isNull'](_0x5689e2['vidaooMetadata'])){var _0x293407=getMustacheRender(_0x5689e2['vidaooMetadata'],_0x43ef97);var _0x211d57=JSON[_0xd016('0x5d')](_0x293407);_0x305f21[_0xd016('0x34')][_0xd016('0x5e')]=_0x211d57;}}catch(_0x43944a){throw new db[(_0xd016('0x5f'))]['ValidationError'](_0xd016('0x60'));}return rp(_0x305f21);}else{throw new db[(_0xd016('0x5f'))][(_0xd016('0x61'))](_0xd016('0x62'));}})['then'](function(_0x7a24b6){_0x11524e=_0x7a24b6;if(_0x11524e['id']){var _0x383f19={'body':_0x11524e[_0xd016('0x63')],'ChatWebsiteId':_0x5689e2['id'],'ChatInteractionId':_0x5d2729['id'],'direction':_0xd016('0x64'),'UserId':_0x3d06f9['user']['id']};return db['ChatMessage'][_0xd016('0x4a')](_0x383f19,{});}else{throw new db['Sequelize'][(_0xd016('0x61'))](_0xd016('0x65'));}})['then'](function(){return _0x5d2729[_0xd016('0x66')]({'vidaooSessionId':_0x11524e['id']});})[_0xd016('0x19')](respondWithResult(_0x36a903,null))[_0xd016('0x23')](handleError(_0x36a903,null));};exports[_0xd016('0x67')]=function(_0x501916,_0x5a2499){if(_0x501916['body']['id']){delete _0x501916[_0xd016('0x34')]['id'];}return db['ChatInteraction'][_0xd016('0x49')]({'where':{'id':_0x501916['params']['id']},'include':[{'model':db['CmContact'],'as':_0xd016('0x68')}]})['then'](handleEntityNotFound(_0x5a2499,null))[_0xd016('0x19')](saveUpdates(_0x501916['body'],null))['then'](respondWithResult(_0x5a2499,null))[_0xd016('0x23')](handleError(_0x5a2499,null));};exports['abandon']=function(_0xe6affc,_0x3b9a5f){if(_0xe6affc[_0xd016('0x34')]['id']){delete _0xe6affc[_0xd016('0x34')]['id'];}return db[_0xd016('0x39')]['find']({'where':{'id':_0xe6affc['params']['id']}})[_0xd016('0x19')](function(_0xffe302){if(!_0xffe302){logger[_0xd016('0x20')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd016('0x69'),0x194,_0xd016('0x6a'));_0x3b9a5f[_0xd016('0x24')](0x194);}else{if(_0xffe302[_0xd016('0x6b')]){throw new db[(_0xd016('0x5f'))][(_0xd016('0x61'))](_0xd016('0x6c'));}}return _0xffe302;})[_0xd016('0x19')](function(_0x10a90a){if(_0x10a90a){return _0x10a90a[_0xd016('0x2d')]({'closed':_0xe6affc[_0xd016('0x34')][_0xd016('0x6d')],'disposition':_0xe6affc[_0xd016('0x34')][_0xd016('0x6e')]})[_0xd016('0x19')](function(_0x51f13a){return _0x51f13a;});}})[_0xd016('0x19')](function(){return respondWithRpcPromise(_0xd016('0x6f'),_0xd016('0x69'),_0xe6affc[_0xd016('0x34')],client9004);})['then'](respondWithResult(_0x3b9a5f,null))[_0xd016('0x23')](handleError(_0x3b9a5f,null));};exports[_0xd016('0x70')]=function(_0x1b194d,_0x40056b){_0x1b194d[_0xd016('0x34')]['name']=_0x1b194d['file'][_0xd016('0x71')];_0x1b194d['body'][_0xd016('0x72')]=_0x1b194d[_0xd016('0x73')][_0xd016('0x74')];_0x1b194d['body']['type']=_0x1b194d[_0xd016('0x73')][_0xd016('0x75')];return db[_0xd016('0x76')][_0xd016('0x4a')](_0x1b194d[_0xd016('0x34')])['then'](respondWithResult(_0x40056b,0xc9))[_0xd016('0x23')](handleError(_0x40056b,null));};exports['attachmentDownload']=function(_0x439949,_0x2538f3){return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x439949[_0xd016('0x41')]['id']},'raw':!![]})[_0xd016('0x19')](handleEntityNotFound(_0x2538f3,null))[_0xd016('0x19')](function(_0x302914){if(_0x302914){if(_0x302914[_0xd016('0x6d')]){return _0x2538f3[_0xd016('0x25')](0x193)[_0xd016('0x27')]({'status':0x193,'message':_0xd016('0x77')});}return db[_0xd016('0x76')][_0xd016('0x4d')]({'where':{'id':_0x439949['query'][_0xd016('0x78')]},'raw':!![]})[_0xd016('0x19')](handleEntityNotFound(_0x2538f3,null));}})[_0xd016('0x19')](function(_0x2edcfb){if(_0x2edcfb){var _0x48f3cf=_0x2edcfb[_0xd016('0x79')]!==null;var _0x2e0cc9=path[_0xd016('0x7a')](config[_0xd016('0x7b')],_0xd016('0x7c'));if(_0x48f3cf){_0x2e0cc9=path[_0xd016('0x7a')](_0x2e0cc9,_0xd016('0x7d'));}var _0x53a56f=path[_0xd016('0x7a')](_0x2e0cc9,_0x2edcfb[_0xd016('0x72')]);return _0x2538f3[_0xd016('0x7e')](_0x53a56f);}})[_0xd016('0x23')](handleError(_0x2538f3,null));};exports['close']=function(_0x5afb85,_0x3082e9){var _0x3f4131=null;var _0x543e75=null;var _0x4469d1=null;if(_0x5afb85[_0xd016('0x34')]['id']){delete _0x5afb85[_0xd016('0x34')]['id'];}if(_0x5afb85[_0xd016('0x34')][_0xd016('0x7f')]){_0x4469d1=path[_0xd016('0x7a')](config['root'],_0xd016('0x80'),util[_0xd016('0x81')]('transcript-%s.txt',Date[_0xd016('0x82')]()));_0x5afb85[_0xd016('0x34')][_0xd016('0x83')]=_0x4469d1;}return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x5afb85[_0xd016('0x41')]['id']},'include':[{'model':db[_0xd016('0x84')],'as':_0xd016('0x85'),'include':[{'model':db[_0xd016('0x86')],'as':'User'}]}]})[_0xd016('0x19')](handleEntityNotFound(_0x3082e9,null))[_0xd016('0x19')](saveUpdates(_0x5afb85[_0xd016('0x34')],null))[_0xd016('0x19')](function(_0x2e12fd){if(_0x2e12fd){_0x3f4131=_0x2e12fd;return db[_0xd016('0x4e')][_0xd016('0x49')]({'where':{'id':_0x3f4131[_0xd016('0x4f')]}});}})[_0xd016('0x19')](function(_0x3670a0){if(_0x3670a0){_0x543e75=_0x3670a0;return db['CmContact'][_0xd016('0x49')]({'where':{'id':_0x3f4131['ContactId']}});}})['then'](function(_0x40284c){if(_0x40284c){if(_0x4469d1){var _0x1cf0f7=null;for(var _0x1f6351=0x1;_0x1f6351<_0x3f4131[_0xd016('0x85')][_0xd016('0x87')];++_0x1f6351){_0x1cf0f7=_0x3f4131['Messages'][_0x1f6351];var _0x91f191=_0x1cf0f7[_0xd016('0x6b')]?util['format'](_0xd016('0x88'),_0x543e75['agentAlias'],_0x1cf0f7[_0xd016('0x6b')]):_0xd016('0x89');var _0x32269a=_0x5afb85['body']['customer']||util['format'](_0xd016('0x88'),'Visitor',_0x1cf0f7[_0xd016('0x8a')]);switch(_0x543e75[_0xd016('0x8b')]){case'website_alias':_0x91f191=_0x1cf0f7['UserId']?util[_0xd016('0x81')](_0xd016('0x88'),_0x543e75[_0xd016('0x8c')],_0x1cf0f7[_0xd016('0x6b')]):_0xd016('0x89');break;case'agent_alias':_0x91f191=_0x1cf0f7[_0xd016('0x6b')]?_0x1cf0f7[_0xd016('0x86')][_0xd016('0x8d')]||_0x1cf0f7[_0xd016('0x86')][_0xd016('0x56')]:'System';break;case _0xd016('0x8e'):_0x91f191=_0x1cf0f7[_0xd016('0x6b')]?_0x1cf0f7[_0xd016('0x86')][_0xd016('0x56')]:_0xd016('0x89');break;default:_0x91f191=_0x1cf0f7['UserId']?util[_0xd016('0x81')](_0xd016('0x88'),_0x543e75['agentAlias'],_0x1cf0f7[_0xd016('0x6b')]):_0xd016('0x89');}var _0x29d762=util[_0xd016('0x81')](_0xd016('0x8f'),moment(_0x1cf0f7[_0xd016('0x90')])['format'](_0xd016('0x91')),_0x1cf0f7[_0xd016('0x92')]==='in'?_0x32269a:_0x91f191,_0x1cf0f7[_0xd016('0x34')]);if(!_0x1cf0f7[_0xd016('0x93')]){fs['appendFileSync'](_0x4469d1,_0x29d762);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd016('0x94'),'raw':!![],'include':[{'model':db[_0xd016('0x95')],'as':_0xd016('0x95'),'raw':!![]}]}]});}}})[_0xd016('0x19')](function(_0x2aa679){if(!_0x2aa679||!_0x2aa679[_0xd016('0x94')]||!_0x5afb85[_0xd016('0x34')])return _0x3f4131;var _0x53fa9e=_0x2aa679[_0xd016('0x96')]();return respondWithRpcPromise(_0xd016('0x97'),_0xd016('0x98'),{'account':_0x53fa9e,'message':{'from':util[_0xd016('0x81')](_0xd016('0x99'),_0x2aa679[_0xd016('0x30')],_0x2aa679[_0xd016('0x57')]||_0x2aa679[_0xd016('0x94')][_0xd016('0x55')]),'to':_0x5afb85[_0xd016('0x34')][_0xd016('0x7f')],'subject':_0xd016('0x9a'),'text':util[_0xd016('0x81')](_0xd016('0x9b'),_0x5afb85['body']['mailTranscript']),'attachments':[{'path':_0x4469d1}]}})[_0xd016('0x19')](function(){return _0x3f4131;})['catch'](function(_0x2f2e02){logger[_0xd016('0x20')](_0x2f2e02);});})[_0xd016('0x19')](respondWithStatusCode(_0x3082e9,0xc8))[_0xd016('0x23')](handleError(_0x3082e9,null));};exports[_0xd016('0x9c')]=function(_0x31769c,_0x356a73){return db[_0xd016('0x84')][_0xd016('0x49')]({'where':{'id':_0x31769c[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x356a73,null))[_0xd016('0x19')](function(_0x4edf0e){if(_0x4edf0e){return _0x4edf0e[_0xd016('0x9c')](_0x31769c['body']['ids'],_[_0xd016('0x9d')](_0x31769c[_0xd016('0x34')],['ids','id'])||{});}})[_0xd016('0x19')](respondWithResult(_0x356a73,null))[_0xd016('0x23')](handleError(_0x356a73,null));};exports[_0xd016('0x9e')]=function(_0x2cc602,_0x42afed){var _0x219084={'raw':![],'where':{}};var _0x1529de={};var _0x3ccf84={'count':0x0,'rows':[]};return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x2cc602['params']['id']}})[_0xd016('0x19')](handleEntityNotFound(_0x42afed,null))[_0xd016('0x19')](function(_0x575f8e){if(_0x575f8e){_0x1529de['model']=_['keys'](db['ChatMessage'][_0xd016('0x3a')]);_0x1529de['query']=_[_0xd016('0x9f')](_0x2cc602['query']);_0x1529de[_0xd016('0x42')]=_[_0xd016('0x43')](_0x1529de[_0xd016('0x44')],_0x1529de['query']);_0x219084[_0xd016('0x45')]=_[_0xd016('0x43')](_0x1529de[_0xd016('0x44')],qs[_0xd016('0x46')](_0x2cc602[_0xd016('0x3f')][_0xd016('0x46')]));_0x219084['attributes']=_0x219084[_0xd016('0x45')]['length']?_0x219084[_0xd016('0x45')]:_0x1529de[_0xd016('0x44')];if(!_0x2cc602[_0xd016('0x3f')][_0xd016('0xa0')]('nolimit')){_0x219084['limit']=qs['limit'](_0x2cc602[_0xd016('0x3f')][_0xd016('0x28')]);_0x219084[_0xd016('0x2b')]=qs[_0xd016('0x2b')](_0x2cc602[_0xd016('0x3f')][_0xd016('0x2b')]);}_0x219084[_0xd016('0xa1')]=qs[_0xd016('0xa2')](_0x2cc602[_0xd016('0x3f')]['sort']);_0x219084[_0xd016('0xa3')]=qs['filters'](_['pick'](_0x2cc602[_0xd016('0x3f')],_0x1529de[_0xd016('0x42')]));_0x219084[_0xd016('0xa3')][_0xd016('0xa4')]=_0x575f8e['id'];if(_0x2cc602[_0xd016('0x3f')][_0xd016('0xa5')]){_0x219084[_0xd016('0xa3')]=_[_0xd016('0x33')](_0x219084[_0xd016('0xa3')],{'$or':_[_0xd016('0xa6')](_0x219084[_0xd016('0x45')],function(_0x34e4c9){var _0x2a8a4a={};_0x2a8a4a[_0x34e4c9]={'$like':'%'+_0x2cc602['query']['filter']+'%'};return _0x2a8a4a;})});}if(_0x2cc602[_0xd016('0x3f')][_0xd016('0xa7')]){var _0x3e1029=_0x2cc602['query'][_0xd016('0xa7')][_0xd016('0xa8')](',');var _0x370941={};_0x370941[_0x3e1029[0x0]]={'$gte':moment(_0x3e1029[0x1])['format'](_0xd016('0xa9'))};_0x219084[_0xd016('0xa3')]=_[_0xd016('0x33')](_0x219084['where'],_0x370941);}_0x219084=_['merge']({},_0x219084,_0x2cc602[_0xd016('0xaa')]);return db['ChatMessage'][_0xd016('0x2a')]({'where':_0x219084[_0xd016('0xa3')]})[_0xd016('0x19')](function(_0x3bbcbb){_0x3ccf84[_0xd016('0x2a')]=_0x3bbcbb;if(_0x2cc602['query'][_0xd016('0x47')]){_0x219084['include']=[{'all':!![]}];}return db[_0xd016('0x84')][_0xd016('0x3d')](_0x219084);})[_0xd016('0x19')](function(_0x158045){_0x3ccf84['rows']=_0x158045;return _0x3ccf84;});}})[_0xd016('0x19')](respondWithFilteredResult(_0x42afed,_0x219084))[_0xd016('0x23')](handleError(_0x42afed,null));};exports['getMyMessages']=function(_0x886201,_0x11e002){var _0x4a4966={'where':{}},_0x3c1353={},_0x19e32e={'count':0x0,'rows':[]};return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x886201[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x11e002,null))['then'](function(_0x5aab1f){if(_0x5aab1f){_0x3c1353['model']=_['keys'](db['ChatMessage'][_0xd016('0x3a')]);_0x3c1353[_0xd016('0x3f')]=_[_0xd016('0x9f')](_0x886201[_0xd016('0x3f')]);_0x3c1353[_0xd016('0x42')]=_[_0xd016('0x43')](_0x3c1353[_0xd016('0x44')],_0x3c1353[_0xd016('0x3f')]);_0x4a4966[_0xd016('0x45')]=_[_0xd016('0x43')](_0x3c1353[_0xd016('0x44')],qs['fields'](_0x886201[_0xd016('0x3f')][_0xd016('0x46')]));_0x4a4966[_0xd016('0x45')]=_0x4a4966[_0xd016('0x45')][_0xd016('0x87')]?_0x4a4966[_0xd016('0x45')]:_0x3c1353['model'];if(!_0x886201[_0xd016('0x3f')][_0xd016('0xa0')](_0xd016('0xab'))){_0x4a4966['limit']=qs[_0xd016('0x28')](_0x886201[_0xd016('0x3f')][_0xd016('0x28')]);_0x4a4966['offset']=qs['offset'](_0x886201[_0xd016('0x3f')][_0xd016('0x2b')]);}_0x4a4966[_0xd016('0xa1')]=qs[_0xd016('0xa2')](_0x886201[_0xd016('0x3f')][_0xd016('0xa2')]);_0x4a4966['where']=qs[_0xd016('0x42')](_[_0xd016('0xac')](_0x886201['query'],_0x3c1353[_0xd016('0x42')]));_0x4a4966['where']['ChatInteractionId']=_0x5aab1f['id'];if(_0x886201[_0xd016('0x3f')]['filter']){_0x4a4966[_0xd016('0xa3')]=_[_0xd016('0x33')](_0x4a4966[_0xd016('0xa3')],{'$or':_['map'](_0x4a4966['attributes'],function(_0x2426be){var _0x54fa77={};_0x54fa77[_0x2426be]={'$like':'%'+_0x886201[_0xd016('0x3f')]['filter']+'%'};return _0x54fa77;})});}_0x4a4966['where']['secret']=![];if(_0x886201[_0xd016('0x3f')]['id']){_0x4a4966[_0xd016('0xa3')]['id']={'$gt':_0x886201[_0xd016('0x3f')]['id']};}_0x4a4966=_[_0xd016('0x33')]({},_0x4a4966,_0x886201['options']);return db[_0xd016('0x84')][_0xd016('0x2a')]({'where':_0x4a4966[_0xd016('0xa3')]})['then'](function(_0x333eb6){_0x19e32e['count']=_0x333eb6;_0x4a4966['include']=[];if(_0x886201['query'][_0xd016('0xad')]){_0x4a4966['include'][_0xd016('0xae')]({'model':db[_0xd016('0x86')],'as':_0xd016('0x86'),'attributes':['id',_0xd016('0x56'),_0xd016('0x8d')]});}if(_0x886201[_0xd016('0x3f')][_0xd016('0x47')]){_0x4a4966[_0xd016('0x48')]=[{'all':!![]}];}return db[_0xd016('0x84')]['findAll'](_0x4a4966);})[_0xd016('0x19')](function(_0x2cc157){_0x19e32e[_0xd016('0xaf')]=_0x2cc157;return _0x19e32e;});}})[_0xd016('0x19')](respondWithFilteredResult(_0x11e002,_0x4a4966))[_0xd016('0x23')](handleError(_0x11e002,null));};exports[_0xd016('0xb0')]=function(_0x48035f,_0x43bb41){return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x48035f[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x43bb41,null))[_0xd016('0x19')](function(_0x210108){if(_0x210108){return _0x210108[_0xd016('0xb1')](_0x48035f[_0xd016('0x34')][_0xd016('0xb2')],_[_0xd016('0x9d')](_0x48035f[_0xd016('0x34')],[_0xd016('0xb2'),'id'])||{})['spread'](function(){return db['Tag'][_0xd016('0x3d')]({'attributes':['id','name','color'],'where':{'id':_0x48035f['body']['ids']}});})['then'](function(_0x277324){socket['emit'](_0xd016('0xb3'),{'id':Number(_0x48035f[_0xd016('0x41')]['id']),'tags':_0x277324||[]});return{'id':Number(_0x48035f[_0xd016('0x41')]['id']),'tags':_0x277324||[]};});}})['then'](respondWithResult(_0x43bb41,null))[_0xd016('0x23')](handleError(_0x43bb41,null));};exports[_0xd016('0xb4')]=function(_0x2f89d5,_0x268208){return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x2f89d5['params']['id']}})['then'](handleEntityNotFound(_0x268208,null))[_0xd016('0x19')](function(_0x3d98c4){if(_0x3d98c4){return _0x3d98c4[_0xd016('0xb4')](_0x2f89d5[_0xd016('0x3f')][_0xd016('0xb2')]);}})[_0xd016('0x19')](respondWithStatusCode(_0x268208,null))[_0xd016('0x23')](handleError(_0x268208,null));};exports['download']=function(_0x2b93a8,_0x51f259){var _0x23b17d=moment()[_0xd016('0xb5')]()[_0xd016('0xb6')]();var _0x4d9c15=path['join'](config['root'],_0xd016('0xb7'),_0xd016('0xb8'),_0xd016('0xb9'));var _0x552197=path[_0xd016('0x7a')](config[_0xd016('0x7b')],_0xd016('0xb7'),'files',_0xd016('0xba'));var _0x249b94=path[_0xd016('0x7a')](_0x4d9c15,_0x23b17d);var _0x4ce0a5=util[_0xd016('0x81')](_0xd016('0xbb'),_0x2b93a8[_0xd016('0x41')]['id'],_0x23b17d);var _0x103dc0=path['join'](_0x4d9c15,_0x4ce0a5);var _0x2653f9=[];_0x2653f9[_0xd016('0xae')]({'model':db[_0xd016('0x86')],'as':_0xd016('0x86'),'attributes':['id',_0xd016('0x56')],'raw':!![]});_0x2653f9[_0xd016('0xae')]({'model':db[_0xd016('0xbc')],'as':'Contact','attributes':['id',_0xd016('0xbd'),_0xd016('0xbe')],'raw':!![]});if(_0x2b93a8['query'][_0xd016('0xba')]){_0x2653f9[_0xd016('0xae')]({'model':db[_0xd016('0x76')],'as':_0xd016('0x76'),'raw':!![]});}var _0x453cb9=[{'model':db[_0xd016('0x84')],'as':_0xd016('0x85'),'attributes':['id',_0xd016('0x34'),_0xd016('0x90'),_0xd016('0x92'),'secret',_0xd016('0xbf')],'include':_0x2653f9}];_0x453cb9['push']({'model':db[_0xd016('0x4e')],'as':_0xd016('0xc0'),'attributes':['id','name']});_0x453cb9['push']({'model':db[_0xd016('0x86')],'as':_0xd016('0xc1'),'attributes':['id',_0xd016('0x56')]});return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x2b93a8[_0xd016('0x41')]['id']},'include':_0x453cb9})[_0xd016('0x19')](handleEntityNotFound(_0x51f259,null))[_0xd016('0x19')](function(_0x230231){if(_0x230231){var _0x486641=_0x230231[_0xd016('0xc2')]({'plain':!![]});fs[_0xd016('0xc3')](_0x249b94);var _0x450a37={'channel':_0xd016('0xc4'),'account':_0x486641[_0xd016('0xc0')]['name'],'agent':_0x486641['Owner']?_0x486641[_0xd016('0xc1')][_0xd016('0x56')]:'N.A.','createdAt':moment(_0x486641[_0xd016('0x90')])[_0xd016('0x81')](_0xd016('0xa9'))[_0xd016('0xb6')](),'closedAt':_0x486641[_0xd016('0x6d')]?moment(_0x486641[_0xd016('0xc5')])[_0xd016('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd016('0xb6')]():'','disposition':_0x486641[_0xd016('0x6e')],'chatInfo':{'browser':_0x486641['browserName'],'os':_0x486641[_0xd016('0xc6')],'referer':_0x486641[_0xd016('0xc7')],'customerIp':_0x486641[_0xd016('0xc8')],'customerPort':_0x486641['customerPort']?_0x486641[_0xd016('0xc9')]:_0xd016('0xca')},'messages':_(_0x486641['Messages'])[_0xd016('0xcb')]()[_0xd016('0xa5')]({'secret':![]})[_0xd016('0xa6')](function(_0x1c5af3){if(_0x1c5af3['Attachment']){var _0x34c8a8=path[_0xd016('0x7a')](_0x552197,_0x1c5af3[_0xd016('0x76')][_0xd016('0x72')]);if(fs[_0xd016('0xcc')](_0x34c8a8)){fs[_0xd016('0xcd')](_0x34c8a8)['pipe'](fs['createWriteStream'](path[_0xd016('0x7a')](_0x249b94,_0x1c5af3['Attachment'][_0xd016('0x72')])));}}return{'date':moment(_0x1c5af3[_0xd016('0x90')])[_0xd016('0x81')](_0xd016('0xa9'))[_0xd016('0xb6')](),'sender':_0x1c5af3[_0xd016('0x92')]===_0xd016('0x64')?_0x1c5af3[_0xd016('0x86')]?_0x1c5af3['User'][_0xd016('0x56')]:_0xd016('0x89'):_0x1c5af3[_0xd016('0x68')][_0xd016('0xbd')]+(_0x1c5af3[_0xd016('0x68')]['lastName']?'\x20'+_0x1c5af3[_0xd016('0x68')][_0xd016('0xbe')]:''),'body':_0x1c5af3['Attachment']?_0x1c5af3[_0xd016('0x76')][_0xd016('0x72')]:_0x1c5af3[_0xd016('0x34')],'direction':_0x1c5af3[_0xd016('0x92')]===_0xd016('0x64')?'A':'C','secret':_0x1c5af3[_0xd016('0x93')],'read':_0x1c5af3[_0xd016('0xbf')],'attachment':_0x1c5af3[_0xd016('0x76')]};})[_0xd016('0xce')]()};return ejs[_0xd016('0xcf')](path['join'](config[_0xd016('0x7b')],_0xd016('0xb7'),_0xd016('0xd0'),'downloadInteraction.ejs'),{'interaction':_0x450a37})[_0xd016('0x19')](function(_0x2ade34){var _0x187540=path[_0xd016('0x7a')](_0x249b94,_0xd016('0xd1')+_0x486641['id']+'-'+_0x23b17d+_0xd016('0xd2'));var _0x4f5366={'path':_0x187540,'channel':'Chat','interactionId':_0x486641['id']};return pdf[_0xd016('0xd3')](_0x2ade34,_0x4f5366);})[_0xd016('0x19')](function(){return new Promise(function(_0x305b77,_0x4a1809){zipdir(_0x249b94,{'saveTo':_0x103dc0},function(_0x6d77d2,_0x4726b8){if(_0x6d77d2)return _0x4a1809(_0x6d77d2);return _0x305b77(_0x4726b8);});})[_0xd016('0x19')](function(){return new BPromise(function(_0x1772f0,_0x588119){rimraf(_0x249b94,function(_0x504741){if(_0x504741)_0x588119(_0x504741);return _0x1772f0();});});})[_0xd016('0x19')](function(){return _0x51f259[_0xd016('0x7e')](_0x103dc0,_0x4ce0a5,function(_0x2c5b7c){if(_0x2c5b7c){logger['error'](_0xd016('0xd4'),_0x2c5b7c);}else{fs['unlinkSync'](_0x103dc0);}});});});}else{return _0x51f259[_0xd016('0x24')](0xc8);}})[_0xd016('0x23')](handleError(_0x51f259,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index dee2419..c848f4c 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 _0x4cbc=['unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map'];(function(_0x419ddc,_0x38acb3){var _0x1215e8=function(_0x17a495){while(--_0x17a495){_0x419ddc['push'](_0x419ddc['shift']());}};_0x1215e8(++_0x38acb3);}(_0x4cbc,0x155));var _0xc4cb=function(_0xdbb4c3,_0x244108){_0xdbb4c3=_0xdbb4c3-0x0;var _0x1b5f3f=_0x4cbc[_0xdbb4c3];return _0x1b5f3f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xc4cb('0x0'))['db'][_0xc4cb('0x1')];var ChatMessage=require(_0xc4cb('0x0'))['db'][_0xc4cb('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc4cb('0x3')](0x0);var events={'afterCreate':_0xc4cb('0x4'),'afterUpdate':_0xc4cb('0x5'),'afterDestroy':_0xc4cb('0x6')};function emitEvent(_0x1a7a28){return function(_0x27c884,_0x4bea35,_0x5dd9b3){_0x27c884[_0xc4cb('0x7')]({'attributes':['id'],'raw':!![]})[_0xc4cb('0x8')](function(_0x5b7486){_0x27c884[_0xc4cb('0x9')]('Users',_0x5b7486[_0xc4cb('0xa')](function(_0x5040ca){return{'id':_0x5040ca['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x27c884['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x51362c){_0x27c884['setDataValue'](_0xc4cb('0xb'),_0x51362c['length']);ChatInteractionEvents['emit'](_0x1a7a28+':'+_0x27c884['id'],_0x27c884);ChatInteractionEvents[_0xc4cb('0xc')](_0x1a7a28,_0x27c884);_0x5dd9b3(null);})[_0xc4cb('0xd')](_0x5dd9b3(null));};}for(var e in events){if(events[_0xc4cb('0xe')](e)){var event=events[e];ChatInteraction[_0xc4cb('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xbfc1=['../../mysqldb','ChatMessage','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hook','ChatInteraction'];(function(_0x1ddfe2,_0x41e6a4){var _0xa19e17=function(_0x585cb8){while(--_0x585cb8){_0x1ddfe2['push'](_0x1ddfe2['shift']());}};_0xa19e17(++_0x41e6a4);}(_0xbfc1,0x1df));var _0x1bfc=function(_0xa66bc1,_0x26010d){_0xa66bc1=_0xa66bc1-0x0;var _0x3783a8=_0xbfc1[_0xa66bc1];return _0x3783a8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x1bfc('0x0')];var ChatMessage=require(_0x1bfc('0x1'))['db'][_0x1bfc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1bfc('0x3'),'afterUpdate':_0x1bfc('0x4'),'afterDestroy':_0x1bfc('0x5')};function emitEvent(_0x324dd6){return function(_0x852547,_0x50d39f,_0x2aabb5){_0x852547[_0x1bfc('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5eda9c){_0x852547[_0x1bfc('0x7')](_0x1bfc('0x8'),_0x5eda9c[_0x1bfc('0x9')](function(_0x15321e){return{'id':_0x15321e['id']};}));return ChatMessage[_0x1bfc('0xa')]({'where':{'ChatInteractionId':_0x852547['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1bfc('0xb')](function(_0x1a9410){_0x852547[_0x1bfc('0x7')]('unreadMessages',_0x1a9410[_0x1bfc('0xc')]);ChatInteractionEvents[_0x1bfc('0xd')](_0x324dd6+':'+_0x852547['id'],_0x852547);ChatInteractionEvents[_0x1bfc('0xd')](_0x324dd6,_0x852547);_0x2aabb5(null);})[_0x1bfc('0xe')](_0x2aabb5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x1bfc('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 78610e8..cd88ac5 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 _0xca82=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x1f3f38,_0x284d6f){var _0xba052=function(_0x1a1bbb){while(--_0x1a1bbb){_0x1f3f38['push'](_0x1f3f38['shift']());}};_0xba052(++_0x284d6f);}(_0xca82,0x16c));var _0x2ca8=function(_0x330ff0,_0x146528){_0x330ff0=_0x330ff0-0x0;var _0x215472=_0xca82[_0x330ff0];return _0x215472;};'use strict';var _=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var logger=require(_0x2ca8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2ca8('0x3'));var rp=require(_0x2ca8('0x4'));var fs=require('fs');var path=require(_0x2ca8('0x5'));var rimraf=require('rimraf');var config=require(_0x2ca8('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x2ca8('0x7')]=function(_0x33a3e1,_0x824126){return _0x33a3e1[_0x2ca8('0x8')](_0x2ca8('0x9'),attributes,{'tableName':_0x2ca8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ec966,_0x24ecf6,_0x50455a){if(_0x1ec966[_0x2ca8('0xb')](_0x2ca8('0xc'))){_0x1ec966[_0x2ca8('0xd')]=moment()[_0x2ca8('0xe')](_0x2ca8('0xf'));}_0x50455a(null,_0x1ec966);}},'charset':_0x2ca8('0x10'),'collate':_0x2ca8('0x11')});}; \ No newline at end of file +var _0xebcc=['exports','define','ChatInteraction','changed','closedAt','format','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xebcc,0x107));var _0xcebc=function(_0x4b0388,_0x3749fb){_0x4b0388=_0x4b0388-0x0;var _0x5c3406=_0xebcc[_0x4b0388];return _0x5c3406;};'use strict';var _=require(_0xcebc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcebc('0x1'));var moment=require(_0xcebc('0x2'));var BPromise=require(_0xcebc('0x3'));var rp=require(_0xcebc('0x4'));var fs=require('fs');var path=require(_0xcebc('0x5'));var rimraf=require(_0xcebc('0x6'));var config=require(_0xcebc('0x7'));var attributes=require(_0xcebc('0x8'));module[_0xcebc('0x9')]=function(_0x1a10f3,_0x3e238b){return _0x1a10f3[_0xcebc('0xa')](_0xcebc('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x581360,_0x2dfe33,_0x3ea8ba){if(_0x581360[_0xcebc('0xc')]('closed')){_0x581360[_0xcebc('0xd')]=moment()[_0xcebc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3ea8ba(null,_0x581360);}},'charset':'utf8mb4','collate':_0xcebc('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 58b64f2..7bc119f 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 _0x7978=['ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','ChatInteraction','update','options','raw','where','attributes','limit','then','UpdateChatInteraction','stringify','find','addTags','body','ids','omit','lodash','util','bluebird','randomstring'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7978,0x1a9));var _0x8797=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x7978[_0x176329];return _0x31997c;};'use strict';var _=require(_0x8797('0x0'));var util=require(_0x8797('0x1'));var moment=require('moment');var BPromise=require(_0x8797('0x2'));var rs=require(_0x8797('0x3'));var fs=require('fs');var Redis=require(_0x8797('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8797('0x5'))(_0x8797('0x6'));var config=require('../../config/environment');var jayson=require(_0x8797('0x7'));var client=jayson[_0x8797('0x8')]['http']({'port':0x232a});config[_0x8797('0x9')]=_[_0x8797('0xa')](config[_0x8797('0x9')],{'host':_0x8797('0xb'),'port':0x18eb});var socket=require(_0x8797('0xc'))(new Redis(config['redis']));require(_0x8797('0xd'))[_0x8797('0xe')](socket);function respondWithRpcPromise(_0x4f73bb,_0x105f58,_0x17429d){return new BPromise(function(_0x42a68f,_0x399887){return client['request'](_0x4f73bb,_0x17429d)['then'](function(_0x3e662c){logger[_0x8797('0xf')](_0x8797('0x10'),_0x105f58,_0x8797('0x11'));logger[_0x8797('0x12')](_0x8797('0x13'),_0x105f58,'request\x20sent',JSON['stringify'](_0x3e662c));if(_0x3e662c[_0x8797('0x14')]){if(_0x3e662c[_0x8797('0x14')][_0x8797('0x15')]===0x1f4){logger[_0x8797('0x14')](_0x8797('0x10'),_0x105f58,_0x3e662c[_0x8797('0x14')]['message']);return _0x399887(_0x3e662c[_0x8797('0x14')][_0x8797('0x16')]);}logger[_0x8797('0x14')](_0x8797('0x10'),_0x105f58,_0x3e662c[_0x8797('0x14')][_0x8797('0x16')]);return _0x42a68f(_0x3e662c[_0x8797('0x14')][_0x8797('0x16')]);}else{logger[_0x8797('0xf')](_0x8797('0x10'),_0x105f58,_0x8797('0x11'));_0x42a68f(_0x3e662c['result'][_0x8797('0x16')]);}})[_0x8797('0x17')](function(_0x49b41b){logger['error'](_0x8797('0x10'),_0x105f58,_0x49b41b);_0x399887(_0x49b41b);});});}exports['UpdateChatInteraction']=function(_0x43fef7){var _0xa86c9e=this;return new Promise(function(_0x41bf25,_0x226846){return db[_0x8797('0x18')][_0x8797('0x19')](_0x43fef7['body'],{'raw':_0x43fef7[_0x8797('0x1a')]?_0x43fef7[_0x8797('0x1a')][_0x8797('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43fef7[_0x8797('0x1a')]?_0x43fef7[_0x8797('0x1a')][_0x8797('0x1c')]||null:null,'attributes':_0x43fef7[_0x8797('0x1a')]?_0x43fef7[_0x8797('0x1a')][_0x8797('0x1d')]||null:null,'limit':_0x43fef7[_0x8797('0x1a')]?_0x43fef7['options'][_0x8797('0x1e')]||null:null})[_0x8797('0x1f')](function(_0x3aa9de){logger[_0x8797('0xf')](_0x8797('0x20'),_0x43fef7);logger[_0x8797('0x12')](_0x8797('0x20'),_0x43fef7,JSON[_0x8797('0x21')](_0x3aa9de));_0x41bf25(_0x3aa9de);})[_0x8797('0x17')](function(_0x42bbe){logger[_0x8797('0x14')]('UpdateChatInteraction',_0x42bbe[_0x8797('0x16')],_0x43fef7);_0x226846(_0xa86c9e[_0x8797('0x14')](0x1f4,_0x42bbe[_0x8797('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x5aa023){return new Promise(function(_0x37f37f,_0x3cefea){return db[_0x8797('0x18')][_0x8797('0x22')]({'where':_0x5aa023['options']?_0x5aa023[_0x8797('0x1a')][_0x8797('0x1c')]||null:null})[_0x8797('0x1f')](function(_0x47e39a){if(_0x47e39a){return _0x47e39a[_0x8797('0x23')](_0x5aa023[_0x8797('0x24')][_0x8797('0x25')],_[_0x8797('0x26')](_0x5aa023['body'],['ids','id'])||{});}})['spread'](function(_0x24b122){logger['info']('AddTags',_0x5aa023);logger[_0x8797('0x12')]('AddTags',_0x5aa023,JSON[_0x8797('0x21')](_0x24b122));_0x37f37f(_0x24b122);})[_0x8797('0x17')](function(_0x520708){logger[_0x8797('0x14')]('AddTags',_0x520708[_0x8797('0x16')],_0x5aa023);_0x3cefea(_this['error'](0x1f4,_0x520708[_0x8797('0x16')]));});});}; \ No newline at end of file +var _0xaec7=['error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xaec7,0x1b9));var _0x7aec=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0xaec7[_0x20e7e3];return _0x14b9de;};'use strict';var _=require(_0x7aec('0x0'));var util=require(_0x7aec('0x1'));var moment=require(_0x7aec('0x2'));var BPromise=require('bluebird');var rs=require(_0x7aec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7aec('0x4'));var logger=require(_0x7aec('0x5'))(_0x7aec('0x6'));var config=require(_0x7aec('0x7'));var jayson=require(_0x7aec('0x8'));var client=jayson[_0x7aec('0x9')][_0x7aec('0xa')]({'port':0x232a});config[_0x7aec('0xb')]=_['defaults'](config['redis'],{'host':_0x7aec('0xc'),'port':0x18eb});var socket=require(_0x7aec('0xd'))(new Redis(config[_0x7aec('0xb')]));require(_0x7aec('0xe'))[_0x7aec('0xf')](socket);function respondWithRpcPromise(_0x112457,_0x4a7ca1,_0x2be259){return new BPromise(function(_0x3bec6a,_0x58e819){return client['request'](_0x112457,_0x2be259)[_0x7aec('0x10')](function(_0x43ce87){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4a7ca1,_0x7aec('0x11'));logger[_0x7aec('0x12')](_0x7aec('0x13'),_0x4a7ca1,_0x7aec('0x11'),JSON[_0x7aec('0x14')](_0x43ce87));if(_0x43ce87[_0x7aec('0x15')]){if(_0x43ce87['error'][_0x7aec('0x16')]===0x1f4){logger['error'](_0x7aec('0x17'),_0x4a7ca1,_0x43ce87['error'][_0x7aec('0x18')]);return _0x58e819(_0x43ce87[_0x7aec('0x15')][_0x7aec('0x18')]);}logger[_0x7aec('0x15')](_0x7aec('0x17'),_0x4a7ca1,_0x43ce87[_0x7aec('0x15')][_0x7aec('0x18')]);return _0x3bec6a(_0x43ce87[_0x7aec('0x15')][_0x7aec('0x18')]);}else{logger[_0x7aec('0x19')](_0x7aec('0x17'),_0x4a7ca1,_0x7aec('0x11'));_0x3bec6a(_0x43ce87['result']['message']);}})[_0x7aec('0x1a')](function(_0x2bf09f){logger[_0x7aec('0x15')](_0x7aec('0x17'),_0x4a7ca1,_0x2bf09f);_0x58e819(_0x2bf09f);});});}exports[_0x7aec('0x1b')]=function(_0x56573b){var _0x2323e7=this;return new Promise(function(_0x5d05d0,_0x56268d){return db[_0x7aec('0x1c')][_0x7aec('0x1d')](_0x56573b[_0x7aec('0x1e')],{'raw':_0x56573b[_0x7aec('0x1f')]?_0x56573b[_0x7aec('0x1f')][_0x7aec('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56573b['options']?_0x56573b['options'][_0x7aec('0x21')]||null:null,'attributes':_0x56573b[_0x7aec('0x1f')]?_0x56573b[_0x7aec('0x1f')]['attributes']||null:null,'limit':_0x56573b[_0x7aec('0x1f')]?_0x56573b[_0x7aec('0x1f')][_0x7aec('0x22')]||null:null})[_0x7aec('0x10')](function(_0x16772c){logger[_0x7aec('0x19')](_0x7aec('0x1b'),_0x56573b);logger['debug']('UpdateChatInteraction',_0x56573b,JSON[_0x7aec('0x14')](_0x16772c));_0x5d05d0(_0x16772c);})['catch'](function(_0x266453){logger[_0x7aec('0x15')](_0x7aec('0x1b'),_0x266453[_0x7aec('0x18')],_0x56573b);_0x56268d(_0x2323e7['error'](0x1f4,_0x266453[_0x7aec('0x18')]));});});};exports[_0x7aec('0x23')]=function(_0xa66034){return new Promise(function(_0x5e8dc1,_0x3de67a){return db['ChatInteraction'][_0x7aec('0x24')]({'where':_0xa66034['options']?_0xa66034[_0x7aec('0x1f')][_0x7aec('0x21')]||null:null})[_0x7aec('0x10')](function(_0xe87c37){if(_0xe87c37){return _0xe87c37[_0x7aec('0x25')](_0xa66034[_0x7aec('0x1e')]['ids'],_[_0x7aec('0x26')](_0xa66034[_0x7aec('0x1e')],[_0x7aec('0x27'),'id'])||{});}})[_0x7aec('0x28')](function(_0x23931c){logger[_0x7aec('0x19')]('AddTags',_0xa66034);logger[_0x7aec('0x12')](_0x7aec('0x29'),_0xa66034,JSON[_0x7aec('0x14')](_0x23931c));_0x5e8dc1(_0x23931c);})['catch'](function(_0xa9ead6){logger[_0x7aec('0x15')](_0x7aec('0x29'),_0xa9ead6[_0x7aec('0x18')],_0xa66034);_0x3de67a(_this['error'](0x1f4,_0xa9ead6[_0x7aec('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 017f268..207e507 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 _0x99fa=['removeListener','register','length','./chatInteraction.events','save','remove','update','emit'];(function(_0x36319d,_0x25df43){var _0x587d8d=function(_0xe528ab){while(--_0xe528ab){_0x36319d['push'](_0x36319d['shift']());}};_0x587d8d(++_0x25df43);}(_0x99fa,0x14b));var _0xa99f=function(_0x2d892a,_0x59e61a){_0x2d892a=_0x2d892a-0x0;var _0x367765=_0x99fa[_0x2d892a];return _0x367765;};'use strict';var ChatInteractionEvents=require(_0xa99f('0x0'));var events=[_0xa99f('0x1'),_0xa99f('0x2'),_0xa99f('0x3')];function createListener(_0x1063d5,_0x2b5be0){return function(_0x4c7b07){_0x2b5be0[_0xa99f('0x4')](_0x1063d5,_0x4c7b07);};}function removeListener(_0xe3164a,_0x2b6d57){return function(){ChatInteractionEvents[_0xa99f('0x5')](_0xe3164a,_0x2b6d57);};}exports[_0xa99f('0x6')]=function(_0x53cc48){for(var _0x533119=0x0,_0x385b19=events[_0xa99f('0x7')];_0x533119<_0x385b19;_0x533119++){var _0x104afe=events[_0x533119];var _0x2acde8=createListener('chatInteraction:'+_0x104afe,_0x53cc48);ChatInteractionEvents['on'](_0x104afe,_0x2acde8);}}; \ No newline at end of file +var _0x5d15=['save','remove','update','emit','register','length','./chatInteraction.events'];(function(_0x458f09,_0xf2ee90){var _0x1ca565=function(_0x8ec760){while(--_0x8ec760){_0x458f09['push'](_0x458f09['shift']());}};_0x1ca565(++_0xf2ee90);}(_0x5d15,0x76));var _0x55d1=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x5d15[_0x5550b3];return _0x4b8fc4;};'use strict';var ChatInteractionEvents=require(_0x55d1('0x0'));var events=[_0x55d1('0x1'),_0x55d1('0x2'),_0x55d1('0x3')];function createListener(_0x532365,_0x53d4b8){return function(_0x2f31be){_0x53d4b8[_0x55d1('0x4')](_0x532365,_0x2f31be);};}function removeListener(_0x11fb4b,_0x14f2cf){return function(){ChatInteractionEvents['removeListener'](_0x11fb4b,_0x14f2cf);};}exports[_0x55d1('0x5')]=function(_0x38136b){for(var _0x40e406=0x0,_0x3aba1a=events[_0x55d1('0x6')];_0x40e406<_0x3aba1a;_0x40e406++){var _0x3e9d0d=events[_0x40e406];var _0x2ee6c1=createListener('chatInteraction:'+_0x3e9d0d,_0x38136b);ChatInteractionEvents['on'](_0x3e9d0d,_0x2ee6c1);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 1725adf..2ca150c 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 _0x993b=['addTags','put','tracked','chat','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0x993b,0x1d5));var _0xb993=function(_0x2f05fd,_0x1185c6){_0x2f05fd=_0x2f05fd-0x0;var _0x5aa831=_0x993b[_0x2f05fd];return _0x5aa831;};'use strict';var multer=require(_0xb993('0x0'));var util=require(_0xb993('0x1'));var path=require(_0xb993('0x2'));var timeout=require(_0xb993('0x3'));var express=require(_0xb993('0x4'));var router=express[_0xb993('0x5')]();var fs_extra=require(_0xb993('0x6'));var auth=require(_0xb993('0x7'));var interaction=require(_0xb993('0x8'));var config=require(_0xb993('0x9'));var controller=require('./chatInteraction.controller');router[_0xb993('0xa')]('/',auth[_0xb993('0xb')](),controller[_0xb993('0xc')]);router[_0xb993('0xa')](_0xb993('0xd'),auth[_0xb993('0xb')](),controller[_0xb993('0xe')]);router[_0xb993('0xa')](_0xb993('0xf'),auth[_0xb993('0x10')](),controller[_0xb993('0x11')]);router[_0xb993('0xa')]('/:id/attachment_download',auth[_0xb993('0x10')](),controller[_0xb993('0x12')]);router[_0xb993('0xa')](_0xb993('0x13'),auth[_0xb993('0xb')](),controller[_0xb993('0x14')]);router[_0xb993('0xa')](_0xb993('0x15'),auth[_0xb993('0x10')](),controller[_0xb993('0x16')]);router[_0xb993('0xa')](_0xb993('0x17'),auth['isAuthenticated'](),controller[_0xb993('0x18')]);router[_0xb993('0x19')]('/',auth[_0xb993('0xb')](),controller[_0xb993('0x1a')]);router[_0xb993('0x19')](_0xb993('0x1b'),auth[_0xb993('0xb')](),controller[_0xb993('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d5f52,_0x817de3,_0x445e2c){_0x445e2c(null,path[_0xb993('0x1d')](config[_0xb993('0x1e')],_0xb993('0x1f')));},'filename':function(_0x3a6b0b,_0x761e90,_0x34e3b8){_0x34e3b8(null,util[_0xb993('0x20')](_0xb993('0x21'),Date[_0xb993('0x22')](),_0x761e90[_0xb993('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb993('0x19')]('/:id/attachment_upload',upload['single'](_0xb993('0x24')),controller[_0xb993('0x25')]);router[_0xb993('0x19')](_0xb993('0x13'),auth[_0xb993('0x10')](),controller[_0xb993('0x26')]);router[_0xb993('0x19')](_0xb993('0x27'),auth[_0xb993('0xb')](),interaction['tracked']('chat',_0xb993('0x28')),controller[_0xb993('0x29')]);router[_0xb993('0x2a')](_0xb993('0xf'),auth[_0xb993('0xb')](),interaction[_0xb993('0x2b')](_0xb993('0x2c'),'chatinteraction:update'),controller['update']);router[_0xb993('0x2a')](_0xb993('0x2d'),controller[_0xb993('0x2e')]);router[_0xb993('0x2a')](_0xb993('0x2f'),auth[_0xb993('0x10')](),controller[_0xb993('0x30')]);router[_0xb993('0x2a')]('/:id/close',controller['close']);router[_0xb993('0x31')](_0xb993('0xf'),auth['isAuthenticated'](),interaction[_0xb993('0x2b')]('chat',_0xb993('0x32')),controller['destroy']);router[_0xb993('0x31')](_0xb993('0x27'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x37e3=['put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x19ccd3,_0x3cb70c){var _0x134097=function(_0x32fdb6){while(--_0x32fdb6){_0x19ccd3['push'](_0x19ccd3['shift']());}};_0x134097(++_0x3cb70c);}(_0x37e3,0xbc));var _0x337e=function(_0x51a6ea,_0x4789e7){_0x51a6ea=_0x51a6ea-0x0;var _0x4c6e17=_0x37e3[_0x51a6ea];return _0x4c6e17;};'use strict';var multer=require(_0x337e('0x0'));var util=require(_0x337e('0x1'));var path=require(_0x337e('0x2'));var timeout=require(_0x337e('0x3'));var express=require(_0x337e('0x4'));var router=express[_0x337e('0x5')]();var fs_extra=require(_0x337e('0x6'));var auth=require(_0x337e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x337e('0x8'));var controller=require(_0x337e('0x9'));router[_0x337e('0xa')]('/',auth['isAuthenticated'](),controller[_0x337e('0xb')]);router[_0x337e('0xa')](_0x337e('0xc'),auth[_0x337e('0xd')](),controller[_0x337e('0xe')]);router['get']('/:id',auth[_0x337e('0xf')](),controller[_0x337e('0x10')]);router[_0x337e('0xa')]('/:id/attachment_download',auth[_0x337e('0xf')](),controller[_0x337e('0x11')]);router[_0x337e('0xa')](_0x337e('0x12'),auth[_0x337e('0xd')](),controller[_0x337e('0x13')]);router[_0x337e('0xa')](_0x337e('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x337e('0x15')]);router['get'](_0x337e('0x16'),auth[_0x337e('0xd')](),controller[_0x337e('0x17')]);router[_0x337e('0x18')]('/',auth[_0x337e('0xd')](),controller[_0x337e('0x19')]);router[_0x337e('0x18')](_0x337e('0x1a'),auth[_0x337e('0xd')](),controller[_0x337e('0x1b')]);var upload=multer({'storage':multer[_0x337e('0x1c')]({'destination':function(_0xfb5c13,_0x31649e,_0x5b9c9a){_0x5b9c9a(null,path['join'](config[_0x337e('0x1d')],_0x337e('0x1e')));},'filename':function(_0x31460b,_0x37bc46,_0x469719){_0x469719(null,util[_0x337e('0x1f')](_0x337e('0x20'),Date[_0x337e('0x21')](),_0x37bc46['originalname'][_0x337e('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x337e('0x18')](_0x337e('0x23'),upload[_0x337e('0x24')](_0x337e('0x25')),controller[_0x337e('0x26')]);router['post'](_0x337e('0x12'),auth[_0x337e('0xf')](),controller[_0x337e('0x27')]);router[_0x337e('0x18')]('/:id/tags',auth[_0x337e('0xd')](),interaction[_0x337e('0x28')](_0x337e('0x29'),_0x337e('0x2a')),controller[_0x337e('0x2b')]);router[_0x337e('0x2c')](_0x337e('0x2d'),auth['isAuthenticated'](),interaction[_0x337e('0x28')](_0x337e('0x29'),_0x337e('0x2e')),controller[_0x337e('0x2f')]);router[_0x337e('0x2c')](_0x337e('0x30'),controller[_0x337e('0x31')]);router[_0x337e('0x2c')](_0x337e('0x32'),auth[_0x337e('0xf')](),controller['abandon']);router[_0x337e('0x2c')](_0x337e('0x33'),controller[_0x337e('0x34')]);router[_0x337e('0x35')]('/:id',auth[_0x337e('0xd')](),interaction[_0x337e('0x28')](_0x337e('0x29'),_0x337e('0x36')),controller[_0x337e('0x37')]);router['delete']('/:id/tags',auth[_0x337e('0xd')](),controller[_0x337e('0x38')]);module[_0x337e('0x39')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 621955a..e882857 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 _0xcc78=['TEXT','medium','INTEGER','sequelize','exports'];(function(_0x1439fa,_0x208d7a){var _0x3a03ec=function(_0x5c9679){while(--_0x5c9679){_0x1439fa['push'](_0x1439fa['shift']());}};_0x3a03ec(++_0x208d7a);}(_0xcc78,0xfd));var _0x8cc7=function(_0x26d0b4,_0x3091c9){_0x26d0b4=_0x26d0b4-0x0;var _0x3ac956=_0xcc78[_0x26d0b4];return _0x3ac956;};'use strict';var Sequelize=require(_0x8cc7('0x0'));module[_0x8cc7('0x1')]={'body':{'type':Sequelize[_0x8cc7('0x2')](_0x8cc7('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8cc7('0x4')]}}; \ No newline at end of file +var _0xe426=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe426,0xac));var _0x6e42=function(_0x316b7b,_0x4f7b7b){_0x316b7b=_0x316b7b-0x0;var _0x2a7b74=_0xe426[_0x316b7b];return _0x2a7b74;};'use strict';var Sequelize=require(_0x6e42('0x0'));module[_0x6e42('0x1')]={'body':{'type':Sequelize[_0x6e42('0x2')](_0x6e42('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6e42('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6e42('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 49b4ee1..ca11b76 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 _0xb245=['VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xb245,0xf0));var _0x5b24=function(_0x308195,_0x1423f4){_0x308195=_0x308195-0x0;var _0x2c31f9=_0xb245[_0x308195];return _0x2c31f9;};'use strict';var emlformat=require(_0x5b24('0x0'));var rimraf=require(_0x5b24('0x1'));var zipdir=require(_0x5b24('0x2'));var jsonpatch=require(_0x5b24('0x3'));var rp=require(_0x5b24('0x4'));var moment=require(_0x5b24('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5b24('0x6'));var path=require(_0x5b24('0x7'));var sox=require('sox');var csv=require(_0x5b24('0x8'));var ejs=require(_0x5b24('0x9'));var fs=require('fs');var fs_extra=require(_0x5b24('0xa'));var _=require(_0x5b24('0xb'));var squel=require(_0x5b24('0xc'));var crypto=require(_0x5b24('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b24('0xe'));var toCsv=require(_0x5b24('0x8'));var querystring=require(_0x5b24('0xf'));var Papa=require(_0x5b24('0x10'));var Redis=require('ioredis');var authService=require(_0x5b24('0x11'));var qs=require(_0x5b24('0x12'));var as=require(_0x5b24('0x13'));var hardwareService=require(_0x5b24('0x14'));var logger=require(_0x5b24('0x15'))(_0x5b24('0x16'));var utils=require(_0x5b24('0x17'));var config=require(_0x5b24('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b24('0x19'))['db'];config[_0x5b24('0x1a')]=_[_0x5b24('0x1b')](config[_0x5b24('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b24('0x1c'))(new Redis(config[_0x5b24('0x1a')]));require('./chatInternalMessage.socket')[_0x5b24('0x1d')](socket);function respondWithStatusCode(_0x70b63b,_0x141cd3){_0x141cd3=_0x141cd3||0xcc;return function(_0x4139f6){if(_0x4139f6){return _0x70b63b[_0x5b24('0x1e')](_0x141cd3);}return _0x70b63b[_0x5b24('0x1f')](_0x141cd3)[_0x5b24('0x20')]();};}function respondWithResult(_0x52d383,_0x57a49b){_0x57a49b=_0x57a49b||0xc8;return function(_0x4de627){if(_0x4de627){return _0x52d383['status'](_0x57a49b)['json'](_0x4de627);}};}function respondWithFilteredResult(_0x3e1831,_0xbb305){return function(_0x4cd574){if(_0x4cd574){var _0xe0910c=typeof _0xbb305[_0x5b24('0x21')]==='undefined'&&typeof _0xbb305['limit']===_0x5b24('0x22');var _0x2ead72=_0x4cd574[_0x5b24('0x23')];var _0x4e1cc6=_0xe0910c?0x0:_0xbb305[_0x5b24('0x21')];var _0x593b81=_0xe0910c?_0x4cd574[_0x5b24('0x23')]:_0xbb305[_0x5b24('0x21')]+_0xbb305[_0x5b24('0x24')];var _0x313f77;if(_0x593b81>=_0x2ead72){_0x593b81=_0x2ead72;_0x313f77=0xc8;}else{_0x313f77=0xce;}_0x3e1831['status'](_0x313f77);return _0x3e1831[_0x5b24('0x25')](_0x5b24('0x26'),_0x4e1cc6+'-'+_0x593b81+'/'+_0x2ead72)[_0x5b24('0x27')](_0x4cd574);}return null;};}function patchUpdates(_0x41ae9f){return function(_0x4ab918){try{jsonpatch['apply'](_0x4ab918,_0x41ae9f,!![]);}catch(_0x48a4ae){return BPromise[_0x5b24('0x28')](_0x48a4ae);}return _0x4ab918[_0x5b24('0x29')]();};}function saveUpdates(_0x2a07ba,_0x3147fb){return function(_0x301fea){if(_0x301fea){return _0x301fea[_0x5b24('0x2a')](_0x2a07ba)[_0x5b24('0x2b')](function(_0x1ede38){return _0x1ede38;});}return null;};}function removeEntity(_0xf5f504,_0x23969d){return function(_0x38669c){if(_0x38669c){return _0x38669c[_0x5b24('0x2c')]()[_0x5b24('0x2b')](function(){_0xf5f504[_0x5b24('0x1f')](0xcc)[_0x5b24('0x20')]();});}};}function handleEntityNotFound(_0x3f50a6,_0x5ed603){return function(_0x468df7){if(!_0x468df7){_0x3f50a6[_0x5b24('0x1e')](0x194);}return _0x468df7;};}function handleError(_0x3bb438,_0x8de6c1){_0x8de6c1=_0x8de6c1||0x1f4;return function(_0x38c3b1){logger[_0x5b24('0x2d')](_0x38c3b1[_0x5b24('0x2e')]);if(_0x38c3b1[_0x5b24('0x2f')]){delete _0x38c3b1[_0x5b24('0x2f')];}_0x3bb438[_0x5b24('0x1f')](_0x8de6c1)[_0x5b24('0x30')](_0x38c3b1);};}exports[_0x5b24('0x31')]=function(_0x1069da,_0x5a007b){var _0x51bf3f={},_0x3193aa={},_0x51ebc9={'count':0x0,'rows':[]};var _0x2d0d16=_[_0x5b24('0x32')](db[_0x5b24('0x33')][_0x5b24('0x34')],function(_0xf859f1){return{'name':_0xf859f1['fieldName'],'type':_0xf859f1[_0x5b24('0x35')][_0x5b24('0x36')]};});_0x3193aa[_0x5b24('0x37')]=_['map'](_0x2d0d16,_0x5b24('0x2f'));_0x3193aa[_0x5b24('0x38')]=_[_0x5b24('0x39')](_0x1069da[_0x5b24('0x38')]);_0x3193aa['filters']=_[_0x5b24('0x3a')](_0x3193aa[_0x5b24('0x37')],_0x3193aa[_0x5b24('0x38')]);_0x51bf3f['attributes']=_['intersection'](_0x3193aa[_0x5b24('0x37')],qs['fields'](_0x1069da['query'][_0x5b24('0x3b')]));_0x51bf3f[_0x5b24('0x3c')]=_0x51bf3f[_0x5b24('0x3c')][_0x5b24('0x3d')]?_0x51bf3f[_0x5b24('0x3c')]:_0x3193aa[_0x5b24('0x37')];if(!_0x1069da[_0x5b24('0x38')][_0x5b24('0x3e')](_0x5b24('0x3f'))){_0x51bf3f[_0x5b24('0x24')]=qs[_0x5b24('0x24')](_0x1069da[_0x5b24('0x38')][_0x5b24('0x24')]);_0x51bf3f[_0x5b24('0x21')]=qs[_0x5b24('0x21')](_0x1069da['query']['offset']);}_0x51bf3f['order']=qs[_0x5b24('0x40')](_0x1069da['query']['sort']);_0x51bf3f[_0x5b24('0x41')]=qs[_0x5b24('0x42')](_[_0x5b24('0x43')](_0x1069da['query'],_0x3193aa['filters']),_0x2d0d16);if(_0x1069da[_0x5b24('0x38')][_0x5b24('0x44')]){_0x51bf3f[_0x5b24('0x41')]=_['merge'](_0x51bf3f[_0x5b24('0x41')],{'$or':_[_0x5b24('0x32')](_0x2d0d16,function(_0x2fa99f){if(_0x2fa99f[_0x5b24('0x35')]!==_0x5b24('0x45')){var _0x2be0ec={};_0x2be0ec[_0x2fa99f[_0x5b24('0x2f')]]={'$like':'%'+_0x1069da[_0x5b24('0x38')]['filter']+'%'};return _0x2be0ec;}})});}_0x51bf3f=_[_0x5b24('0x46')]({},_0x51bf3f,_0x1069da[_0x5b24('0x47')]);var _0x51801c={'where':_0x51bf3f[_0x5b24('0x41')]};return db[_0x5b24('0x33')][_0x5b24('0x23')](_0x51801c)[_0x5b24('0x2b')](function(_0x396f6d){_0x51ebc9[_0x5b24('0x23')]=_0x396f6d;if(_0x1069da['query'][_0x5b24('0x48')]){_0x51bf3f[_0x5b24('0x49')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5b24('0x4a')](_0x51bf3f);})['then'](function(_0x3b775e){_0x51ebc9['rows']=_0x3b775e;return _0x51ebc9;})[_0x5b24('0x2b')](respondWithFilteredResult(_0x5a007b,_0x51bf3f))[_0x5b24('0x4b')](handleError(_0x5a007b,null));};exports['show']=function(_0x4a3db3,_0x40cc4f){var _0x283066={'raw':!![],'where':{'id':_0x4a3db3[_0x5b24('0x4c')]['id']}},_0x4bfc04={};_0x4bfc04[_0x5b24('0x37')]=_[_0x5b24('0x39')](db[_0x5b24('0x33')][_0x5b24('0x34')]);_0x4bfc04['query']=_[_0x5b24('0x39')](_0x4a3db3[_0x5b24('0x38')]);_0x4bfc04[_0x5b24('0x42')]=_[_0x5b24('0x3a')](_0x4bfc04[_0x5b24('0x37')],_0x4bfc04[_0x5b24('0x38')]);_0x283066['attributes']=_[_0x5b24('0x3a')](_0x4bfc04[_0x5b24('0x37')],qs[_0x5b24('0x3b')](_0x4a3db3[_0x5b24('0x38')][_0x5b24('0x3b')]));_0x283066[_0x5b24('0x3c')]=_0x283066[_0x5b24('0x3c')]['length']?_0x283066['attributes']:_0x4bfc04[_0x5b24('0x37')];if(_0x4a3db3[_0x5b24('0x38')][_0x5b24('0x48')]){_0x283066[_0x5b24('0x49')]=[{'all':!![]}];}_0x283066=_['merge']({},_0x283066,_0x4a3db3[_0x5b24('0x47')]);return db[_0x5b24('0x33')][_0x5b24('0x4d')](_0x283066)[_0x5b24('0x2b')](handleEntityNotFound(_0x40cc4f,null))[_0x5b24('0x2b')](respondWithResult(_0x40cc4f,null))[_0x5b24('0x4b')](handleError(_0x40cc4f,null));};exports[_0x5b24('0x4e')]=function(_0x31c0a9,_0x4d3736){return db[_0x5b24('0x33')][_0x5b24('0x4e')](_0x31c0a9[_0x5b24('0x4f')],{})[_0x5b24('0x2b')](respondWithResult(_0x4d3736,0xc9))[_0x5b24('0x4b')](handleError(_0x4d3736,null));};exports[_0x5b24('0x2a')]=function(_0x2ad8aa,_0x2baf02){if(_0x2ad8aa[_0x5b24('0x4f')]['id']){delete _0x2ad8aa[_0x5b24('0x4f')]['id'];}return db[_0x5b24('0x33')][_0x5b24('0x4d')]({'where':{'id':_0x2ad8aa[_0x5b24('0x4c')]['id']}})[_0x5b24('0x2b')](handleEntityNotFound(_0x2baf02,null))[_0x5b24('0x2b')](saveUpdates(_0x2ad8aa[_0x5b24('0x4f')],null))[_0x5b24('0x2b')](respondWithResult(_0x2baf02,null))[_0x5b24('0x4b')](handleError(_0x2baf02,null));};exports['destroy']=function(_0x50a86c,_0x1a3a81){return db['ChatInternalMessage']['find']({'where':{'id':_0x50a86c[_0x5b24('0x4c')]['id']}})[_0x5b24('0x2b')](handleEntityNotFound(_0x1a3a81,null))[_0x5b24('0x2b')](removeEntity(_0x1a3a81,null))[_0x5b24('0x4b')](handleError(_0x1a3a81,null));};exports[_0x5b24('0x50')]=function(_0x2e1ca5,_0x1df010){return db[_0x5b24('0x33')][_0x5b24('0x50')]()[_0x5b24('0x2b')](respondWithResult(_0x1df010,null))[_0x5b24('0x4b')](handleError(_0x1df010,null));};function wrapUser(_0x46ceb9){return function(_0x3daae5){var _0x3b9125=_0x46ceb9[_0x5b24('0x51')]({'plain':!![]});_0x3b9125[_0x5b24('0x52')]=[];if(_0x3daae5){_0x3b9125['lastMessageAt']=_0x3daae5['createdAt'];_0x3b9125[_0x5b24('0x53')]=_0x3daae5;}else{_0x3b9125[_0x5b24('0x54')]=moment(0x0)[_0x5b24('0x55')](_0x5b24('0x56'));_0x3b9125[_0x5b24('0x53')]={};}return _0x3b9125;};}exports[_0x5b24('0x57')]=function(_0x5daa66,_0x13bae0,_0x485343){var _0x1f7cea=[];return db[_0x5b24('0x58')][_0x5b24('0x4a')]({'where':{'role':[_0x5b24('0x59'),_0x5b24('0x5a'),'user']},'attributes':['id','fullname',_0x5b24('0x2f'),_0x5b24('0x5b'),_0x5b24('0x5c'),_0x5b24('0x5d'),'online',_0x5b24('0x5e'),_0x5b24('0x5f'),_0x5b24('0x60')],'order':qs[_0x5b24('0x40')](_0x5b24('0x61')),'include':[{'model':db[_0x5b24('0x62')],'as':_0x5b24('0x63'),'attributes':['id',_0x5b24('0x2f'),'type'],'through':{'attributes':[]}}]})[_0x5b24('0x2b')](function(_0x49d9b6){if(_0x49d9b6){var _0x26c60f=_0x5daa66[_0x5b24('0x64')][_0x5b24('0x51')]({'plain':!![]});if(!_0x26c60f)throw new Error(_0x5b24('0x65'));if(_0x26c60f['role']===_0x5b24('0x64')){return db[_0x5b24('0x66')][_0x5b24('0x4d')]({'where':{'name':'Agents','userProfileId':_0x26c60f[_0x5b24('0x67')]},'raw':!![]})[_0x5b24('0x2b')](function(_0x510bef){if(_0x510bef){if(_0x510bef[_0x5b24('0x68')]===0x0){return db[_0x5b24('0x69')]['findAll']({'where':{'sectionId':_0x510bef['id']},'raw':!![]})[_0x5b24('0x2b')](function(_0x3f8eb8){var _0x5bddd8=[];if(_[_0x5b24('0x6a')](_0x3f8eb8)){_0x5bddd8=_['filter'](_0x49d9b6,function(_0x4f8ede){if(_0x4f8ede[_0x5b24('0x5b')]!==_0x5b24('0x59')){return _0x4f8ede;}});return _0x5bddd8;}else{for(var _0xb69848=0x0;_0xb69848<_0x49d9b6['length'];_0xb69848++){var _0x1653fb=_0x49d9b6[_0xb69848];if(_0x1653fb[_0x5b24('0x5b')]==='agent'){var _0x4fa87b=_[_0x5b24('0x4d')](_0x3f8eb8,function(_0x7ceb10){return _0x7ceb10[_0x5b24('0x6b')]===_0x1653fb['id'];});if(_0x4fa87b)_0x5bddd8[_0x5b24('0x6c')](_0x1653fb);}else{_0x5bddd8[_0x5b24('0x6c')](_0x1653fb);}}return _0x5bddd8;}});}else{return _0x49d9b6;}}else{var _0x45dfd7=_['filter'](_0x49d9b6,function(_0x53d971){if(_0x53d971['role']!==_0x5b24('0x59')){return _0x53d971;}});return _0x45dfd7;}});}else{return _0x49d9b6;}}})[_0x5b24('0x2b')](function(_0x3fed09){var _0x1d666f=[];if(_0x3fed09){_0x1f7cea=_0x3fed09;for(var _0x5c56c1=0x0;_0x5c56c1<_0x3fed09[_0x5b24('0x3d')];_0x5c56c1+=0x1){_0x1f7cea[_0x5c56c1][_0x5b24('0x52')]=[];_0x1d666f[_0x5b24('0x6c')](db[_0x5b24('0x33')][_0x5b24('0x4d')]({'where':{'FromId':[_0x5daa66['user']['id'],_0x3fed09[_0x5c56c1]['id']],'ToId':[_0x5daa66[_0x5b24('0x64')]['id'],_0x3fed09[_0x5c56c1]['id']],'ChatGroupId':null},'attributes':['id',_0x5b24('0x6d'),_0x5b24('0x6e'),_0x5b24('0x6f'),_0x5b24('0x70'),_0x5b24('0x4f')],'order':qs[_0x5b24('0x40')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5b24('0x2b')](wrapUser(_0x3fed09[_0x5c56c1])));}return BPromise['all'](_0x1d666f);}return[];})['then'](function(_0x26103c){return{'rows':_0x26103c,'count':_0x26103c['length']};})['then'](respondWithResult(_0x13bae0,null))[_0x5b24('0x4b')](handleError(_0x13bae0,null));}; \ No newline at end of file +var _0xae5f=['-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','keys','includeAll','options','create','body','find','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','read'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xae5f,0xdc));var _0xfae5=function(_0x55b6f2,_0x178fbf){_0x55b6f2=_0x55b6f2-0x0;var _0x1fc1ab=_0xae5f[_0x55b6f2];return _0x1fc1ab;};'use strict';var emlformat=require(_0xfae5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfae5('0x1'));var jsonpatch=require(_0xfae5('0x2'));var rp=require(_0xfae5('0x3'));var moment=require(_0xfae5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfae5('0x5'));var util=require(_0xfae5('0x6'));var path=require(_0xfae5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfae5('0x8'));var fs=require('fs');var fs_extra=require(_0xfae5('0x9'));var _=require(_0xfae5('0xa'));var squel=require(_0xfae5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfae5('0xc'));var toCsv=require(_0xfae5('0xd'));var querystring=require(_0xfae5('0xe'));var Papa=require(_0xfae5('0xf'));var Redis=require(_0xfae5('0x10'));var authService=require(_0xfae5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfae5('0x12'));var hardwareService=require(_0xfae5('0x13'));var logger=require('../../config/logger')(_0xfae5('0x14'));var utils=require('../../config/utils');var config=require(_0xfae5('0x15'));var licenseUtil=require(_0xfae5('0x16'));var db=require(_0xfae5('0x17'))['db'];config[_0xfae5('0x18')]=_[_0xfae5('0x19')](config['redis'],{'host':_0xfae5('0x1a'),'port':0x18eb});var socket=require(_0xfae5('0x1b'))(new Redis(config[_0xfae5('0x18')]));require(_0xfae5('0x1c'))[_0xfae5('0x1d')](socket);function respondWithStatusCode(_0x561cfe,_0x8c1f49){_0x8c1f49=_0x8c1f49||0xcc;return function(_0x1d3ba6){if(_0x1d3ba6){return _0x561cfe[_0xfae5('0x1e')](_0x8c1f49);}return _0x561cfe[_0xfae5('0x1f')](_0x8c1f49)[_0xfae5('0x20')]();};}function respondWithResult(_0x4d7573,_0x15565c){_0x15565c=_0x15565c||0xc8;return function(_0x26370b){if(_0x26370b){return _0x4d7573['status'](_0x15565c)[_0xfae5('0x21')](_0x26370b);}};}function respondWithFilteredResult(_0x323378,_0x1dbc2e){return function(_0x281e85){if(_0x281e85){var _0x4acc40=typeof _0x1dbc2e[_0xfae5('0x22')]===_0xfae5('0x23')&&typeof _0x1dbc2e[_0xfae5('0x24')]==='undefined';var _0x3493d9=_0x281e85['count'];var _0x16821a=_0x4acc40?0x0:_0x1dbc2e[_0xfae5('0x22')];var _0x1a1a32=_0x4acc40?_0x281e85[_0xfae5('0x25')]:_0x1dbc2e['offset']+_0x1dbc2e['limit'];var _0x5979b7;if(_0x1a1a32>=_0x3493d9){_0x1a1a32=_0x3493d9;_0x5979b7=0xc8;}else{_0x5979b7=0xce;}_0x323378[_0xfae5('0x1f')](_0x5979b7);return _0x323378[_0xfae5('0x26')](_0xfae5('0x27'),_0x16821a+'-'+_0x1a1a32+'/'+_0x3493d9)[_0xfae5('0x21')](_0x281e85);}return null;};}function patchUpdates(_0x2b3991){return function(_0x3a1933){try{jsonpatch[_0xfae5('0x28')](_0x3a1933,_0x2b3991,!![]);}catch(_0x3be144){return BPromise['reject'](_0x3be144);}return _0x3a1933[_0xfae5('0x29')]();};}function saveUpdates(_0x540eb3,_0x53ce28){return function(_0x2d8db2){if(_0x2d8db2){return _0x2d8db2[_0xfae5('0x2a')](_0x540eb3)[_0xfae5('0x2b')](function(_0x4e8f64){return _0x4e8f64;});}return null;};}function removeEntity(_0x6e2538,_0x4b7cb2){return function(_0x12d739){if(_0x12d739){return _0x12d739[_0xfae5('0x2c')]()['then'](function(){_0x6e2538[_0xfae5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fc92d,_0x14c14d){return function(_0x1e5984){if(!_0x1e5984){_0x8fc92d[_0xfae5('0x1e')](0x194);}return _0x1e5984;};}function handleError(_0x243d00,_0x9da725){_0x9da725=_0x9da725||0x1f4;return function(_0x3ae786){logger[_0xfae5('0x2d')](_0x3ae786[_0xfae5('0x2e')]);if(_0x3ae786[_0xfae5('0x2f')]){delete _0x3ae786[_0xfae5('0x2f')];}_0x243d00[_0xfae5('0x1f')](_0x9da725)['send'](_0x3ae786);};}exports[_0xfae5('0x30')]=function(_0x299133,_0x4d4518){var _0x266a4a={},_0x54c734={},_0x1648ab={'count':0x0,'rows':[]};var _0x3303d9=_[_0xfae5('0x31')](db[_0xfae5('0x32')][_0xfae5('0x33')],function(_0x15c492){return{'name':_0x15c492['fieldName'],'type':_0x15c492[_0xfae5('0x34')]['key']};});_0x54c734['model']=_[_0xfae5('0x31')](_0x3303d9,_0xfae5('0x2f'));_0x54c734[_0xfae5('0x35')]=_['keys'](_0x299133[_0xfae5('0x35')]);_0x54c734[_0xfae5('0x36')]=_[_0xfae5('0x37')](_0x54c734[_0xfae5('0x38')],_0x54c734[_0xfae5('0x35')]);_0x266a4a[_0xfae5('0x39')]=_[_0xfae5('0x37')](_0x54c734[_0xfae5('0x38')],qs['fields'](_0x299133['query'][_0xfae5('0x3a')]));_0x266a4a[_0xfae5('0x39')]=_0x266a4a['attributes'][_0xfae5('0x3b')]?_0x266a4a[_0xfae5('0x39')]:_0x54c734[_0xfae5('0x38')];if(!_0x299133[_0xfae5('0x35')][_0xfae5('0x3c')]('nolimit')){_0x266a4a[_0xfae5('0x24')]=qs[_0xfae5('0x24')](_0x299133['query'][_0xfae5('0x24')]);_0x266a4a[_0xfae5('0x22')]=qs[_0xfae5('0x22')](_0x299133[_0xfae5('0x35')]['offset']);}_0x266a4a[_0xfae5('0x3d')]=qs[_0xfae5('0x3e')](_0x299133[_0xfae5('0x35')][_0xfae5('0x3e')]);_0x266a4a[_0xfae5('0x3f')]=qs[_0xfae5('0x36')](_[_0xfae5('0x40')](_0x299133[_0xfae5('0x35')],_0x54c734[_0xfae5('0x36')]),_0x3303d9);if(_0x299133[_0xfae5('0x35')][_0xfae5('0x41')]){_0x266a4a[_0xfae5('0x3f')]=_[_0xfae5('0x42')](_0x266a4a['where'],{'$or':_[_0xfae5('0x31')](_0x3303d9,function(_0x498f1b){if(_0x498f1b['type']!=='VIRTUAL'){var _0x39c8af={};_0x39c8af[_0x498f1b[_0xfae5('0x2f')]]={'$like':'%'+_0x299133[_0xfae5('0x35')][_0xfae5('0x41')]+'%'};return _0x39c8af;}})});}_0x266a4a=_[_0xfae5('0x42')]({},_0x266a4a,_0x299133['options']);var _0x678fbf={'where':_0x266a4a[_0xfae5('0x3f')]};return db[_0xfae5('0x32')][_0xfae5('0x25')](_0x678fbf)[_0xfae5('0x2b')](function(_0x680ef4){_0x1648ab['count']=_0x680ef4;if(_0x299133[_0xfae5('0x35')]['includeAll']){_0x266a4a[_0xfae5('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xfae5('0x44')](_0x266a4a);})[_0xfae5('0x2b')](function(_0x1406ce){_0x1648ab[_0xfae5('0x45')]=_0x1406ce;return _0x1648ab;})['then'](respondWithFilteredResult(_0x4d4518,_0x266a4a))[_0xfae5('0x46')](handleError(_0x4d4518,null));};exports['show']=function(_0x23ef0d,_0x262b38){var _0x4fd014={'raw':!![],'where':{'id':_0x23ef0d['params']['id']}},_0x5ec947={};_0x5ec947['model']=_[_0xfae5('0x47')](db[_0xfae5('0x32')][_0xfae5('0x33')]);_0x5ec947[_0xfae5('0x35')]=_[_0xfae5('0x47')](_0x23ef0d[_0xfae5('0x35')]);_0x5ec947[_0xfae5('0x36')]=_['intersection'](_0x5ec947[_0xfae5('0x38')],_0x5ec947['query']);_0x4fd014[_0xfae5('0x39')]=_[_0xfae5('0x37')](_0x5ec947[_0xfae5('0x38')],qs['fields'](_0x23ef0d['query'][_0xfae5('0x3a')]));_0x4fd014[_0xfae5('0x39')]=_0x4fd014['attributes'][_0xfae5('0x3b')]?_0x4fd014[_0xfae5('0x39')]:_0x5ec947[_0xfae5('0x38')];if(_0x23ef0d['query'][_0xfae5('0x48')]){_0x4fd014['include']=[{'all':!![]}];}_0x4fd014=_['merge']({},_0x4fd014,_0x23ef0d[_0xfae5('0x49')]);return db['ChatInternalMessage']['find'](_0x4fd014)[_0xfae5('0x2b')](handleEntityNotFound(_0x262b38,null))[_0xfae5('0x2b')](respondWithResult(_0x262b38,null))[_0xfae5('0x46')](handleError(_0x262b38,null));};exports['create']=function(_0x1b6e83,_0xa6a595){return db[_0xfae5('0x32')][_0xfae5('0x4a')](_0x1b6e83['body'],{})[_0xfae5('0x2b')](respondWithResult(_0xa6a595,0xc9))['catch'](handleError(_0xa6a595,null));};exports[_0xfae5('0x2a')]=function(_0x36cbf3,_0x442f02){if(_0x36cbf3[_0xfae5('0x4b')]['id']){delete _0x36cbf3[_0xfae5('0x4b')]['id'];}return db[_0xfae5('0x32')][_0xfae5('0x4c')]({'where':{'id':_0x36cbf3[_0xfae5('0x4d')]['id']}})[_0xfae5('0x2b')](handleEntityNotFound(_0x442f02,null))[_0xfae5('0x2b')](saveUpdates(_0x36cbf3[_0xfae5('0x4b')],null))[_0xfae5('0x2b')](respondWithResult(_0x442f02,null))['catch'](handleError(_0x442f02,null));};exports[_0xfae5('0x2c')]=function(_0x12a5a3,_0x463143){return db[_0xfae5('0x32')][_0xfae5('0x4c')]({'where':{'id':_0x12a5a3[_0xfae5('0x4d')]['id']}})[_0xfae5('0x2b')](handleEntityNotFound(_0x463143,null))[_0xfae5('0x2b')](removeEntity(_0x463143,null))['catch'](handleError(_0x463143,null));};exports['describe']=function(_0x512369,_0x5d52f8){return db[_0xfae5('0x32')][_0xfae5('0x4e')]()[_0xfae5('0x2b')](respondWithResult(_0x5d52f8,null))[_0xfae5('0x46')](handleError(_0x5d52f8,null));};function wrapUser(_0xfd144a){return function(_0x1ad3be){var _0x3cbf52=_0xfd144a[_0xfae5('0x4f')]({'plain':!![]});_0x3cbf52[_0xfae5('0x50')]=[];if(_0x1ad3be){_0x3cbf52['lastMessageAt']=_0x1ad3be[_0xfae5('0x51')];_0x3cbf52[_0xfae5('0x52')]=_0x1ad3be;}else{_0x3cbf52[_0xfae5('0x53')]=moment(0x0)['format'](_0xfae5('0x54'));_0x3cbf52[_0xfae5('0x52')]={};}return _0x3cbf52;};}exports[_0xfae5('0x55')]=function(_0x7714bc,_0x31bdcf,_0x144c42){var _0x306a70=[];return db['User'][_0xfae5('0x44')]({'where':{'role':[_0xfae5('0x56'),_0xfae5('0x57'),_0xfae5('0x58')]},'attributes':['id',_0xfae5('0x59'),_0xfae5('0x2f'),_0xfae5('0x5a'),_0xfae5('0x5b'),_0xfae5('0x5c'),_0xfae5('0x5d'),_0xfae5('0x5e'),_0xfae5('0x5f'),'showWebBar'],'order':qs[_0xfae5('0x3e')]('-online'),'include':[{'model':db[_0xfae5('0x60')],'as':_0xfae5('0x61'),'attributes':['id',_0xfae5('0x2f'),_0xfae5('0x34')],'through':{'attributes':[]}}]})[_0xfae5('0x2b')](function(_0x413dce){if(_0x413dce){var _0x12a642=_0x7714bc[_0xfae5('0x58')]['get']({'plain':!![]});if(!_0x12a642)throw new Error(_0xfae5('0x62'));if(_0x12a642[_0xfae5('0x5a')]===_0xfae5('0x58')){return db[_0xfae5('0x63')]['find']({'where':{'name':_0xfae5('0x64'),'userProfileId':_0x12a642['userProfileId']},'raw':!![]})[_0xfae5('0x2b')](function(_0x1be189){if(_0x1be189){if(_0x1be189[_0xfae5('0x65')]===0x0){return db[_0xfae5('0x66')][_0xfae5('0x44')]({'where':{'sectionId':_0x1be189['id']},'raw':!![]})[_0xfae5('0x2b')](function(_0x1faf0b){var _0x52e39a=[];if(_[_0xfae5('0x67')](_0x1faf0b)){_0x52e39a=_[_0xfae5('0x41')](_0x413dce,function(_0x351132){if(_0x351132['role']!==_0xfae5('0x56')){return _0x351132;}});return _0x52e39a;}else{for(var _0x132ac2=0x0;_0x132ac2<_0x413dce[_0xfae5('0x3b')];_0x132ac2++){var _0x4556b9=_0x413dce[_0x132ac2];if(_0x4556b9['role']===_0xfae5('0x56')){var _0xd16d53=_['find'](_0x1faf0b,function(_0x4488a0){return _0x4488a0['resourceId']===_0x4556b9['id'];});if(_0xd16d53)_0x52e39a[_0xfae5('0x68')](_0x4556b9);}else{_0x52e39a['push'](_0x4556b9);}}return _0x52e39a;}});}else{return _0x413dce;}}else{var _0x5780b9=_['filter'](_0x413dce,function(_0x4a11fc){if(_0x4a11fc[_0xfae5('0x5a')]!=='agent'){return _0x4a11fc;}});return _0x5780b9;}});}else{return _0x413dce;}}})[_0xfae5('0x2b')](function(_0x40e063){var _0xebcdea=[];if(_0x40e063){_0x306a70=_0x40e063;for(var _0x3d2430=0x0;_0x3d2430<_0x40e063[_0xfae5('0x3b')];_0x3d2430+=0x1){_0x306a70[_0x3d2430]['messages']=[];_0xebcdea[_0xfae5('0x68')](db[_0xfae5('0x32')][_0xfae5('0x4c')]({'where':{'FromId':[_0x7714bc[_0xfae5('0x58')]['id'],_0x40e063[_0x3d2430]['id']],'ToId':[_0x7714bc[_0xfae5('0x58')]['id'],_0x40e063[_0x3d2430]['id']],'ChatGroupId':null},'attributes':['id',_0xfae5('0x51'),_0xfae5('0x69'),'ToId',_0xfae5('0x6a'),_0xfae5('0x4b')],'order':qs[_0xfae5('0x3e')](_0xfae5('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfae5('0x2b')](wrapUser(_0x40e063[_0x3d2430])));}return BPromise[_0xfae5('0x6c')](_0xebcdea);}return[];})[_0xfae5('0x2b')](function(_0x15afd3){return{'rows':_0x15afd3,'count':_0x15afd3[_0xfae5('0x3b')]};})[_0xfae5('0x2b')](respondWithResult(_0x31bdcf,null))[_0xfae5('0x46')](handleError(_0x31bdcf,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 280c4ed..424363a 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 _0x5d4e=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x5d4e,0x112));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe5d4('0x0'));var ChatInternalMessage=require(_0xe5d4('0x1'))['db'][_0xe5d4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5d4('0x3')](0x0);var events={'afterCreate':_0xe5d4('0x4'),'afterUpdate':_0xe5d4('0x5'),'afterDestroy':_0xe5d4('0x6')};function emitEvent(_0x59e9c3){return function(_0x346274,_0x5eb8fd,_0x566066){ChatInternalMessageEvents[_0xe5d4('0x7')](_0x59e9c3+':'+_0x346274['id'],_0x346274);ChatInternalMessageEvents[_0xe5d4('0x7')](_0x59e9c3,_0x346274);_0x566066(null);};}for(var e in events){if(events[_0xe5d4('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x943d=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x4a464e,_0x250abf){var _0x54d070=function(_0xf56d7){while(--_0xf56d7){_0x4a464e['push'](_0x4a464e['shift']());}};_0x54d070(++_0x250abf);}(_0x943d,0x155));var _0xd943=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0x943d[_0x305486];return _0xa04940;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd943('0x0'))['db'][_0xd943('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd943('0x2')](0x0);var events={'afterCreate':_0xd943('0x3'),'afterUpdate':_0xd943('0x4'),'afterDestroy':_0xd943('0x5')};function emitEvent(_0x21052e){return function(_0x3cbb0d,_0xf6c0e3,_0xd005c7){ChatInternalMessageEvents[_0xd943('0x6')](_0x21052e+':'+_0x3cbb0d['id'],_0x3cbb0d);ChatInternalMessageEvents[_0xd943('0x6')](_0x21052e,_0x3cbb0d);_0xd005c7(null);};}for(var e in events){if(events[_0xd943('0x7')](e)){var event=events[e];ChatInternalMessage[_0xd943('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 716a348..d1d928b 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 _0x4945=['api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x4945,0x15e));var _0x5494=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x4945[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require(_0x5494('0x0'));var logger=require('../../config/logger')(_0x5494('0x1'));var moment=require(_0x5494('0x2'));var BPromise=require(_0x5494('0x3'));var rp=require(_0x5494('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5494('0x5'));var config=require('../../config/environment');var attributes=require(_0x5494('0x6'));module[_0x5494('0x7')]=function(_0x5a141f,_0x40b495){return _0x5a141f[_0x5494('0x8')](_0x5494('0x9'),attributes,{'tableName':_0x5494('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5494('0xb'),'collate':_0x5494('0xc')});}; \ No newline at end of file +var _0x4d68=['api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x93b6aa,_0x19ca6e){var _0x580214=function(_0x55888b){while(--_0x55888b){_0x93b6aa['push'](_0x93b6aa['shift']());}};_0x580214(++_0x19ca6e);}(_0x4d68,0x19e));var _0x84d6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x4d68[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x84d6('0x0'));var util=require(_0x84d6('0x1'));var logger=require('../../config/logger')(_0x84d6('0x2'));var moment=require(_0x84d6('0x3'));var BPromise=require(_0x84d6('0x4'));var rp=require(_0x84d6('0x5'));var fs=require('fs');var path=require(_0x84d6('0x6'));var rimraf=require(_0x84d6('0x7'));var config=require('../../config/environment');var attributes=require(_0x84d6('0x8'));module['exports']=function(_0x49e5c6,_0x57be95){return _0x49e5c6[_0x84d6('0x9')](_0x84d6('0xa'),attributes,{'tableName':_0x84d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x84d6('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f6a28be..466c071 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 _0xeb0d=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInternalMessage.socket','register'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x5a4860,_0x22dc1d){_0x5a4860=_0x5a4860-0x0;var _0x6a4bf8=_0xeb0d[_0x5a4860];return _0x6a4bf8;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdeb0('0x1'));var fs=require('fs');var Redis=require(_0xdeb0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeb0('0x3'));var logger=require(_0xdeb0('0x4'))(_0xdeb0('0x5'));var config=require(_0xdeb0('0x6'));var jayson=require(_0xdeb0('0x7'));var client=jayson[_0xdeb0('0x8')][_0xdeb0('0x9')]({'port':0x232a});config[_0xdeb0('0xa')]=_['defaults'](config[_0xdeb0('0xa')],{'host':_0xdeb0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdeb0('0xa')]));require(_0xdeb0('0xc'))[_0xdeb0('0xd')](socket);function respondWithRpcPromise(_0x307271,_0x13e2c4,_0x43c43e){return new BPromise(function(_0x2eac19,_0x1ac0cf){return client['request'](_0x307271,_0x43c43e)['then'](function(_0x4169b0){logger['info'](_0xdeb0('0xe'),_0x13e2c4,_0xdeb0('0xf'));logger[_0xdeb0('0x10')](_0xdeb0('0x11'),_0x13e2c4,_0xdeb0('0xf'),JSON[_0xdeb0('0x12')](_0x4169b0));if(_0x4169b0[_0xdeb0('0x13')]){if(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x14')]===0x1f4){logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);return _0x1ac0cf(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0['error'][_0xdeb0('0x15')]);return _0x2eac19(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}else{logger['info'](_0xdeb0('0xe'),_0x13e2c4,'request\x20sent');_0x2eac19(_0x4169b0[_0xdeb0('0x16')][_0xdeb0('0x15')]);}})[_0xdeb0('0x17')](function(_0x52b34d){logger[_0xdeb0('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e2c4,_0x52b34d);_0x1ac0cf(_0x52b34d);});});} \ No newline at end of file +var _0xe1ce=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x46f736,_0x39930d){var _0x480865=function(_0x531f1e){while(--_0x531f1e){_0x46f736['push'](_0x46f736['shift']());}};_0x480865(++_0x39930d);}(_0xe1ce,0x15e));var _0xee1c=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xe1ce[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xee1c('0x0'));var util=require(_0xee1c('0x1'));var moment=require(_0xee1c('0x2'));var BPromise=require(_0xee1c('0x3'));var rs=require(_0xee1c('0x4'));var fs=require('fs');var Redis=require(_0xee1c('0x5'));var db=require(_0xee1c('0x6'))['db'];var utils=require(_0xee1c('0x7'));var logger=require(_0xee1c('0x8'))(_0xee1c('0x9'));var config=require('../../config/environment');var jayson=require(_0xee1c('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xee1c('0xb')]=_[_0xee1c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee1c('0xb')]));require(_0xee1c('0xd'))[_0xee1c('0xe')](socket);function respondWithRpcPromise(_0x1b1cca,_0x4e5fcd,_0x458b53){return new BPromise(function(_0x451be7,_0x56fe63){return client[_0xee1c('0xf')](_0x1b1cca,_0x458b53)[_0xee1c('0x10')](function(_0x562266){logger['info'](_0xee1c('0x11'),_0x4e5fcd,_0xee1c('0x12'));logger[_0xee1c('0x13')](_0xee1c('0x14'),_0x4e5fcd,_0xee1c('0x12'),JSON[_0xee1c('0x15')](_0x562266));if(_0x562266['error']){if(_0x562266[_0xee1c('0x16')][_0xee1c('0x17')]===0x1f4){logger['error'](_0xee1c('0x11'),_0x4e5fcd,_0x562266['error']['message']);return _0x56fe63(_0x562266[_0xee1c('0x16')]['message']);}logger[_0xee1c('0x16')](_0xee1c('0x11'),_0x4e5fcd,_0x562266['error'][_0xee1c('0x18')]);return _0x451be7(_0x562266[_0xee1c('0x16')][_0xee1c('0x18')]);}else{logger['info'](_0xee1c('0x11'),_0x4e5fcd,_0xee1c('0x12'));_0x451be7(_0x562266[_0xee1c('0x19')][_0xee1c('0x18')]);}})[_0xee1c('0x1a')](function(_0x3994b4){logger[_0xee1c('0x16')](_0xee1c('0x11'),_0x4e5fcd,_0x3994b4);_0x56fe63(_0x3994b4);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 481f605..57e1e7e 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 _0xad75=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x58fac9,_0x290a65){var _0x35da60=function(_0xff9be0){while(--_0xff9be0){_0x58fac9['push'](_0x58fac9['shift']());}};_0x35da60(++_0x290a65);}(_0xad75,0xca));var _0x5ad7=function(_0x13f411,_0x1402ee){_0x13f411=_0x13f411-0x0;var _0x523d52=_0xad75[_0x13f411];return _0x523d52;};'use strict';var ChatInternalMessageEvents=require(_0x5ad7('0x0'));var events=[_0x5ad7('0x1'),_0x5ad7('0x2'),_0x5ad7('0x3')];function createListener(_0x109af9,_0x316eee){return function(_0x3867fb){_0x316eee[_0x5ad7('0x4')](_0x109af9,_0x3867fb);};}function removeListener(_0x2331e0,_0x54bcc0){return function(){ChatInternalMessageEvents[_0x5ad7('0x5')](_0x2331e0,_0x54bcc0);};}exports[_0x5ad7('0x6')]=function(_0x480d79){for(var _0x17273b=0x0,_0x4694dd=events[_0x5ad7('0x7')];_0x17273b<_0x4694dd;_0x17273b++){var _0x25ec21=events[_0x17273b];var _0x29f7e2=createListener(_0x5ad7('0x8')+_0x25ec21,_0x480d79);ChatInternalMessageEvents['on'](_0x25ec21,_0x29f7e2);}}; \ No newline at end of file +var _0x3f67=['chatInternalMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x52015b,_0x14e87b){var _0x5f01be=function(_0x513d45){while(--_0x513d45){_0x52015b['push'](_0x52015b['shift']());}};_0x5f01be(++_0x14e87b);}(_0x3f67,0x89));var _0x73f6=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0x3f67[_0x5c6ceb];return _0x28821b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x73f6('0x0'),_0x73f6('0x1'),_0x73f6('0x2')];function createListener(_0x35be9f,_0x3e4dec){return function(_0x14c773){_0x3e4dec[_0x73f6('0x3')](_0x35be9f,_0x14c773);};}function removeListener(_0x2e0ad5,_0x3cd3c4){return function(){ChatInternalMessageEvents[_0x73f6('0x4')](_0x2e0ad5,_0x3cd3c4);};}exports[_0x73f6('0x5')]=function(_0x37679f){for(var _0x4b2323=0x0,_0x1a7d71=events[_0x73f6('0x6')];_0x4b2323<_0x1a7d71;_0x4b2323++){var _0x3fcce5=events[_0x4b2323];var _0x30b6f2=createListener(_0x73f6('0x7')+_0x3fcce5,_0x37679f);ChatInternalMessageEvents['on'](_0x3fcce5,_0x30b6f2);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f0cb642..37c0d4a 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 _0x461a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','create','put','delete','/:id','exports','util'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x461a,0x125));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa461('0x0'));var path=require(_0xa461('0x1'));var timeout=require(_0xa461('0x2'));var express=require(_0xa461('0x3'));var router=express[_0xa461('0x4')]();var fs_extra=require(_0xa461('0x5'));var auth=require(_0xa461('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa461('0x7'));router[_0xa461('0x8')]('/',auth[_0xa461('0x9')](),controller[_0xa461('0xa')]);router['get'](_0xa461('0xb'),auth['isAuthenticated'](),controller[_0xa461('0xc')]);router['get'](_0xa461('0xd'),auth[_0xa461('0x9')](),controller[_0xa461('0xe')]);router[_0xa461('0x8')]('/:id',auth[_0xa461('0x9')](),controller[_0xa461('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa461('0x10')]);router[_0xa461('0x11')]('/:id',controller['update']);router[_0xa461('0x12')](_0xa461('0x13'),auth[_0xa461('0x9')](),controller['destroy']);module[_0xa461('0x14')]=router; \ No newline at end of file +var _0x7eec=['get','isAuthenticated','index','/describe','describe','/users','getUsers','post','create','put','/:id','update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x202d12,_0x232a5e){var _0x100006=function(_0x43778f){while(--_0x43778f){_0x202d12['push'](_0x202d12['shift']());}};_0x100006(++_0x232a5e);}(_0x7eec,0x149));var _0xc7ee=function(_0x2ef2ae,_0x4a740a){_0x2ef2ae=_0x2ef2ae-0x0;var _0x276928=_0x7eec[_0x2ef2ae];return _0x276928;};'use strict';var multer=require(_0xc7ee('0x0'));var util=require(_0xc7ee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc7ee('0x2')]();var fs_extra=require(_0xc7ee('0x3'));var auth=require(_0xc7ee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc7ee('0x5'));var controller=require(_0xc7ee('0x6'));router[_0xc7ee('0x7')]('/',auth[_0xc7ee('0x8')](),controller[_0xc7ee('0x9')]);router[_0xc7ee('0x7')](_0xc7ee('0xa'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xb')]);router[_0xc7ee('0x7')](_0xc7ee('0xc'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xd')]);router[_0xc7ee('0x7')]('/:id',auth[_0xc7ee('0x8')](),controller['show']);router[_0xc7ee('0xe')]('/',auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xf')]);router[_0xc7ee('0x10')](_0xc7ee('0x11'),controller[_0xc7ee('0x12')]);router[_0xc7ee('0x13')](_0xc7ee('0x11'),auth['isAuthenticated'](),controller[_0xc7ee('0x14')]);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 eba4ac1..1ca478c 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 _0x7275=['out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0xf0928a,_0x30a122){var _0x1b49fc=function(_0x1686ce){while(--_0x1686ce){_0xf0928a['push'](_0xf0928a['shift']());}};_0x1b49fc(++_0x30a122);}(_0x7275,0x143));var _0x5727=function(_0x4ba9d7,_0x2ec6cc){_0x4ba9d7=_0x4ba9d7-0x0;var _0x45866e=_0x7275[_0x4ba9d7];return _0x45866e;};'use strict';var Sequelize=require(_0x5727('0x0'));module[_0x5727('0x1')]={'body':{'type':Sequelize[_0x5727('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5727('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5727('0x4')]('in',_0x5727('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x5727('0x6')]},'providerName':{'type':Sequelize[_0x5727('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4c71=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x51448c,_0x17e9dc){var _0x47e735=function(_0x187ff6){while(--_0x187ff6){_0x51448c['push'](_0x51448c['shift']());}};_0x47e735(++_0x17e9dc);}(_0x4c71,0x12b));var _0x14c7=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x4c71[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0x14c7('0x0'));module[_0x14c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x14c7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x14c7('0x4')]('in',_0x14c7('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x14c7('0x6')]},'providerName':{'type':Sequelize[_0x14c7('0x7')]},'providerResponse':{'type':Sequelize[_0x14c7('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 7f97b12..8c6d47d 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 _0xd6d0=['create','body','find','describe','../../config/logger','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','parse','chat','ChatInteraction','RejectMessage','rejectMessage','sequelize','fullname','rejectmessage','formData','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','status','undefined','limit','count','offset','json','reject','save','update','destroy','end','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','show','params'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0xd6d0,0xaf));var _0x0d6d=function(_0x2bd0ba,_0x2ca03b){_0x2bd0ba=_0x2bd0ba-0x0;var _0x10426b=_0xd6d0[_0x2bd0ba];return _0x10426b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0d6d('0x0'));var jsonpatch=require(_0x0d6d('0x1'));var rp=require(_0x0d6d('0x2'));var moment=require(_0x0d6d('0x3'));var BPromise=require(_0x0d6d('0x4'));var Mustache=require('mustache');var util=require(_0x0d6d('0x5'));var path=require(_0x0d6d('0x6'));var sox=require(_0x0d6d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d6d('0x8'));var squel=require(_0x0d6d('0x9'));var crypto=require('crypto');var jsforce=require(_0x0d6d('0xa'));var deskjs=require(_0x0d6d('0xb'));var toCsv=require(_0x0d6d('0xc'));var querystring=require('querystring');var Papa=require(_0x0d6d('0xd'));var Redis=require('ioredis');var authService=require(_0x0d6d('0xe'));var qs=require(_0x0d6d('0xf'));var as=require(_0x0d6d('0x10'));var hardwareService=require(_0x0d6d('0x11'));var logger=require('../../config/logger')(_0x0d6d('0x12'));var utils=require('../../config/utils');var config=require(_0x0d6d('0x13'));var licenseUtil=require(_0x0d6d('0x14'));var db=require(_0x0d6d('0x15'))['db'];config[_0x0d6d('0x16')]=_[_0x0d6d('0x17')](config['redis'],{'host':_0x0d6d('0x18'),'port':0x18eb});var socket=require(_0x0d6d('0x19'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x0d6d('0x1a')](socket);var jayson=require(_0x0d6d('0x1b'));var client=jayson[_0x0d6d('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x0d6d('0x1c')][_0x0d6d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x111d3b,_0x1141e8,_0x198ec6,_0x3a67b2){return new BPromise(function(_0x19ee0b,_0x4afb4d){var _0xe49f56=_0x3a67b2||client;return _0xe49f56[_0x0d6d('0x1e')](_0x111d3b,_0x198ec6)[_0x0d6d('0x1f')](function(_0x26c558){logger[_0x0d6d('0x20')](_0x0d6d('0x21'),_0x1141e8,_0x0d6d('0x22'));logger[_0x0d6d('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1141e8,_0x0d6d('0x22'),JSON[_0x0d6d('0x24')](_0x26c558));if(_0x26c558['error']){if(_0x26c558['error'][_0x0d6d('0x25')]===0x1f4){logger[_0x0d6d('0x26')](_0x0d6d('0x21'),_0x1141e8,_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);return _0x4afb4d(_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);}logger[_0x0d6d('0x26')](_0x0d6d('0x21'),_0x1141e8,_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);return _0x19ee0b(_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);}else{logger[_0x0d6d('0x20')](_0x0d6d('0x21'),_0x1141e8,'request\x20sent');_0x19ee0b(_0x26c558['result'][_0x0d6d('0x27')]);}})[_0x0d6d('0x28')](function(_0xe75004){logger[_0x0d6d('0x26')](_0x0d6d('0x21'),_0x1141e8,_0xe75004);_0x4afb4d(_0xe75004);});});}function respondWithStatusCode(_0x4c44f2,_0x59be3f){_0x59be3f=_0x59be3f||0xcc;return function(_0x38a5f8){if(_0x38a5f8){return _0x4c44f2['sendStatus'](_0x59be3f);}return _0x4c44f2['status'](_0x59be3f)['end']();};}function respondWithResult(_0x5be14e,_0x138625){_0x138625=_0x138625||0xc8;return function(_0x445a90){if(_0x445a90){return _0x5be14e[_0x0d6d('0x29')](_0x138625)['json'](_0x445a90);}};}function respondWithFilteredResult(_0x3ea76f,_0x5ac06e){return function(_0x43b399){if(_0x43b399){var _0x31dd85=typeof _0x5ac06e['offset']===_0x0d6d('0x2a')&&typeof _0x5ac06e[_0x0d6d('0x2b')]===_0x0d6d('0x2a');var _0x4eb094=_0x43b399[_0x0d6d('0x2c')];var _0x589cee=_0x31dd85?0x0:_0x5ac06e[_0x0d6d('0x2d')];var _0x59340f=_0x31dd85?_0x43b399[_0x0d6d('0x2c')]:_0x5ac06e[_0x0d6d('0x2d')]+_0x5ac06e[_0x0d6d('0x2b')];var _0x52539d;if(_0x59340f>=_0x4eb094){_0x59340f=_0x4eb094;_0x52539d=0xc8;}else{_0x52539d=0xce;}_0x3ea76f['status'](_0x52539d);return _0x3ea76f['set']('Content-Range',_0x589cee+'-'+_0x59340f+'/'+_0x4eb094)[_0x0d6d('0x2e')](_0x43b399);}return null;};}function patchUpdates(_0x3fd64b){return function(_0x13d631){try{jsonpatch['apply'](_0x13d631,_0x3fd64b,!![]);}catch(_0x265daa){return BPromise[_0x0d6d('0x2f')](_0x265daa);}return _0x13d631[_0x0d6d('0x30')]();};}function saveUpdates(_0x2fab4f,_0x21b254){return function(_0x48a932){if(_0x48a932){return _0x48a932[_0x0d6d('0x31')](_0x2fab4f)['then'](function(_0x4cf41f){return _0x4cf41f;});}return null;};}function removeEntity(_0x54dd4f,_0x5125d4){return function(_0xbdd569){if(_0xbdd569){return _0xbdd569[_0x0d6d('0x32')]()[_0x0d6d('0x1f')](function(){_0x54dd4f[_0x0d6d('0x29')](0xcc)[_0x0d6d('0x33')]();});}};}function handleEntityNotFound(_0x537751,_0x4c7192){return function(_0x315de1){if(!_0x315de1){_0x537751[_0x0d6d('0x34')](0x194);}return _0x315de1;};}function handleError(_0xd039ee,_0x5bb9ac){_0x5bb9ac=_0x5bb9ac||0x1f4;return function(_0x1a9b01){logger[_0x0d6d('0x26')](_0x1a9b01[_0x0d6d('0x35')]);if(_0x1a9b01[_0x0d6d('0x36')]){delete _0x1a9b01[_0x0d6d('0x36')];}_0xd039ee[_0x0d6d('0x29')](_0x5bb9ac)[_0x0d6d('0x37')](_0x1a9b01);};}exports['index']=function(_0x39ffae,_0x49d9b9){var _0x50e84a={},_0x41bc61={},_0x1dbea7={'count':0x0,'rows':[]};var _0x27b398=_[_0x0d6d('0x38')](db[_0x0d6d('0x39')][_0x0d6d('0x3a')],function(_0x12d289){return{'name':_0x12d289[_0x0d6d('0x3b')],'type':_0x12d289['type']['key']};});_0x41bc61[_0x0d6d('0x3c')]=_[_0x0d6d('0x38')](_0x27b398,_0x0d6d('0x36'));_0x41bc61['query']=_[_0x0d6d('0x3d')](_0x39ffae[_0x0d6d('0x3e')]);_0x41bc61[_0x0d6d('0x3f')]=_[_0x0d6d('0x40')](_0x41bc61[_0x0d6d('0x3c')],_0x41bc61[_0x0d6d('0x3e')]);_0x50e84a[_0x0d6d('0x41')]=_['intersection'](_0x41bc61[_0x0d6d('0x3c')],qs['fields'](_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x42')]));_0x50e84a[_0x0d6d('0x41')]=_0x50e84a[_0x0d6d('0x41')][_0x0d6d('0x43')]?_0x50e84a[_0x0d6d('0x41')]:_0x41bc61[_0x0d6d('0x3c')];if(!_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x44')](_0x0d6d('0x45'))){_0x50e84a[_0x0d6d('0x2b')]=qs[_0x0d6d('0x2b')](_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x2b')]);_0x50e84a[_0x0d6d('0x2d')]=qs[_0x0d6d('0x2d')](_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x2d')]);}_0x50e84a['order']=qs[_0x0d6d('0x46')](_0x39ffae[_0x0d6d('0x3e')]['sort']);_0x50e84a[_0x0d6d('0x47')]=qs[_0x0d6d('0x3f')](_[_0x0d6d('0x48')](_0x39ffae[_0x0d6d('0x3e')],_0x41bc61[_0x0d6d('0x3f')]),_0x27b398);if(_0x39ffae[_0x0d6d('0x3e')]['filter']){_0x50e84a['where']=_[_0x0d6d('0x49')](_0x50e84a[_0x0d6d('0x47')],{'$or':_[_0x0d6d('0x38')](_0x27b398,function(_0x5a028a){if(_0x5a028a['type']!==_0x0d6d('0x4a')){var _0x271cf0={};_0x271cf0[_0x5a028a[_0x0d6d('0x36')]]={'$like':'%'+_0x39ffae[_0x0d6d('0x3e')]['filter']+'%'};return _0x271cf0;}})});}_0x50e84a=_[_0x0d6d('0x49')]({},_0x50e84a,_0x39ffae[_0x0d6d('0x4b')]);var _0x921e82={'where':_0x50e84a[_0x0d6d('0x47')]};return db['ChatMessage'][_0x0d6d('0x2c')](_0x921e82)[_0x0d6d('0x1f')](function(_0x350a93){_0x1dbea7[_0x0d6d('0x2c')]=_0x350a93;if(_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x4c')]){_0x50e84a[_0x0d6d('0x4d')]=[{'all':!![]}];}return db[_0x0d6d('0x39')][_0x0d6d('0x4e')](_0x50e84a);})[_0x0d6d('0x1f')](function(_0x5dd50e){_0x1dbea7['rows']=_0x5dd50e;return _0x1dbea7;})['then'](respondWithFilteredResult(_0x49d9b9,_0x50e84a))['catch'](handleError(_0x49d9b9,null));};exports[_0x0d6d('0x4f')]=function(_0x1f996e,_0x11bb56){var _0x556f9b={'raw':!![],'where':{'id':_0x1f996e[_0x0d6d('0x50')]['id']}},_0x3f43a6={};_0x3f43a6[_0x0d6d('0x3c')]=_['keys'](db['ChatMessage'][_0x0d6d('0x3a')]);_0x3f43a6[_0x0d6d('0x3e')]=_['keys'](_0x1f996e[_0x0d6d('0x3e')]);_0x3f43a6[_0x0d6d('0x3f')]=_[_0x0d6d('0x40')](_0x3f43a6[_0x0d6d('0x3c')],_0x3f43a6[_0x0d6d('0x3e')]);_0x556f9b[_0x0d6d('0x41')]=_[_0x0d6d('0x40')](_0x3f43a6[_0x0d6d('0x3c')],qs[_0x0d6d('0x42')](_0x1f996e[_0x0d6d('0x3e')][_0x0d6d('0x42')]));_0x556f9b['attributes']=_0x556f9b[_0x0d6d('0x41')][_0x0d6d('0x43')]?_0x556f9b[_0x0d6d('0x41')]:_0x3f43a6[_0x0d6d('0x3c')];if(_0x1f996e['query'][_0x0d6d('0x4c')]){_0x556f9b[_0x0d6d('0x4d')]=[{'all':!![]}];}_0x556f9b=_[_0x0d6d('0x49')]({},_0x556f9b,_0x1f996e[_0x0d6d('0x4b')]);return db[_0x0d6d('0x39')]['find'](_0x556f9b)[_0x0d6d('0x1f')](handleEntityNotFound(_0x11bb56,null))['then'](respondWithResult(_0x11bb56,null))[_0x0d6d('0x28')](handleError(_0x11bb56,null));};exports['create']=function(_0xece2e0,_0x1b12a3){return db[_0x0d6d('0x39')][_0x0d6d('0x51')](_0xece2e0[_0x0d6d('0x52')],{})[_0x0d6d('0x1f')](respondWithResult(_0x1b12a3,0xc9))['catch'](handleError(_0x1b12a3,null));};exports['update']=function(_0x16eff5,_0x1233c0){if(_0x16eff5['body']['id']){delete _0x16eff5[_0x0d6d('0x52')]['id'];}return db[_0x0d6d('0x39')][_0x0d6d('0x53')]({'where':{'id':_0x16eff5[_0x0d6d('0x50')]['id']}})[_0x0d6d('0x1f')](handleEntityNotFound(_0x1233c0,null))[_0x0d6d('0x1f')](saveUpdates(_0x16eff5[_0x0d6d('0x52')],null))[_0x0d6d('0x1f')](respondWithResult(_0x1233c0,null))[_0x0d6d('0x28')](handleError(_0x1233c0,null));};exports[_0x0d6d('0x32')]=function(_0x4c3056,_0x1ffa29){return db['ChatMessage']['find']({'where':{'id':_0x4c3056[_0x0d6d('0x50')]['id']}})[_0x0d6d('0x1f')](handleEntityNotFound(_0x1ffa29,null))[_0x0d6d('0x1f')](removeEntity(_0x1ffa29,null))[_0x0d6d('0x28')](handleError(_0x1ffa29,null));};exports[_0x0d6d('0x54')]=function(_0x3232ba,_0xe4f49e){return db[_0x0d6d('0x39')]['describe']()[_0x0d6d('0x1f')](respondWithResult(_0xe4f49e,null))['catch'](handleError(_0xe4f49e,null));};var interaction_log=require(_0x0d6d('0x55'))(_0x0d6d('0x56'));exports[_0x0d6d('0x57')]=function(_0x2ef38e,_0x24f74f,_0x487dcc){var _0x66388b={'agent':{},'channel':'chat'};if(_0x2ef38e['body']['id']){delete _0x2ef38e[_0x0d6d('0x52')]['id'];}_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x58')]=!![];_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x59')]=moment()[_0x0d6d('0x5a')](_0x0d6d('0x5b'));_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')]=_0x2ef38e['body'][_0x0d6d('0x5c')]||_0x2ef38e[_0x0d6d('0x5d')]['id'];_0x66388b[_0x0d6d('0x5e')]['id']=_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')];return db[_0x0d6d('0x39')][_0x0d6d('0x53')]({'where':{'id':_0x2ef38e[_0x0d6d('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24f74f,null))[_0x0d6d('0x1f')](saveUpdates(_0x2ef38e[_0x0d6d('0x52')],null))[_0x0d6d('0x1f')](function(_0x1da300){if(_0x1da300){_0x66388b['message']=_0x1da300[_0x0d6d('0x5f')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x1da300[_0x0d6d('0x60')]}});}return null;})[_0x0d6d('0x1f')](handleEntityNotFound(_0x24f74f,null))[_0x0d6d('0x1f')](function(_0x3a2e22){if(_0x3a2e22){return _0x3a2e22[_0x0d6d('0x31')]({'UserId':_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')],'read1stAt':_[_0x0d6d('0x61')](_0x3a2e22['read1stAt'])?moment()['format'](_0x0d6d('0x5b')):undefined});}return null;})[_0x0d6d('0x1f')](function(_0x50ea93){if(_0x50ea93){_0x66388b[_0x0d6d('0x62')]=_0x50ea93['get']({'plain':!![]});interaction_log['info'](_0x0d6d('0x63'),_0x2ef38e[_0x0d6d('0x5d')]['id'],_0x2ef38e[_0x0d6d('0x5d')][_0x0d6d('0x36')],_0x2ef38e[_0x0d6d('0x5d')][_0x0d6d('0x64')],_0x66388b[_0x0d6d('0x62')]['id'],_0x2ef38e[_0x0d6d('0x52')]?JSON[_0x0d6d('0x24')](_0x2ef38e['body']):_0x0d6d('0x65'));return respondWithRpcPromise(_0x0d6d('0x66'),_0x0d6d('0x67'),_0x66388b);}return null;})['then'](function(_0x1bc2d7){var _0x27010c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1bc2d7[_0x0d6d('0x27')][_0x0d6d('0x68')];return db['sequelize']['query'](_0x27010c,{'type':db[_0x0d6d('0x69')][_0x0d6d('0x6a')][_0x0d6d('0x6b')],'raw':!![]})[_0x0d6d('0x1f')](function(_0x2f8e30){return _0x2f8e30;});})[_0x0d6d('0x1f')](function(_0x4ac516){if(_0x4ac516){_0x66388b['message'][_0x0d6d('0x6c')]=_0x4ac516[0x0];if(!_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')])return;return db[_0x0d6d('0x6d')][_0x0d6d('0x53')]({'where':{'id':_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')],'role':_0x0d6d('0x5e')},'attributes':['id',_0x0d6d('0x36'),'fullname',_0x0d6d('0x6e'),_0x0d6d('0x6f')],'raw':!![]});}return null;})[_0x0d6d('0x1f')](function(_0x1a082b){if(!_0x1a082b)return null;_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x5e')]=_0x1a082b;return _0x66388b;})[_0x0d6d('0x1f')](function(_0x449ecd){if(_0x449ecd){if(_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x70')]){_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x71')]=util[_0x0d6d('0x5a')](_0x0d6d('0x72'),_0x2ef38e[_0x0d6d('0x5d')]['name']);_0x66388b['message']['channel']=_0x66388b['channel'];_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x73')]=_0x66388b[_0x0d6d('0x74')];_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x75')]=_0x0d6d('0x57');return respondWithRpcPromise('EventManager',_0x0d6d('0x76'),{'event':'acceptmessage','message':_[_0x0d6d('0x49')](_0x66388b[_0x0d6d('0x27')],JSON[_0x0d6d('0x77')](_0x66388b[_0x0d6d('0x62')]['formData']))},client9002)[_0x0d6d('0x1f')](function(){return _0x66388b;});}return _0x66388b;}return null;})[_0x0d6d('0x1f')](respondWithResult(_0x24f74f,null))[_0x0d6d('0x28')](handleError(_0x24f74f,null));};var interaction_log=require('../../config/logger')(_0x0d6d('0x56'));exports['reject']=function(_0x44a26,_0x56660a,_0x6e52a){var _0x24ffad={'agent':{},'channel':_0x0d6d('0x78')};if(_0x44a26[_0x0d6d('0x52')]['id']){delete _0x44a26[_0x0d6d('0x52')]['id'];}_0x44a26[_0x0d6d('0x52')]['UserId']=_0x44a26[_0x0d6d('0x52')][_0x0d6d('0x5c')]||_0x44a26[_0x0d6d('0x5d')]['id'];_0x24ffad[_0x0d6d('0x5e')]['id']=_0x44a26[_0x0d6d('0x52')][_0x0d6d('0x5c')];return db['ChatMessage']['find']({'where':{'id':_0x44a26[_0x0d6d('0x50')]['id'],'UserId':null}})[_0x0d6d('0x1f')](handleEntityNotFound(_0x56660a,null))[_0x0d6d('0x1f')](function(_0x2c9653){if(_0x2c9653){_0x24ffad[_0x0d6d('0x27')]=_0x2c9653[_0x0d6d('0x5f')]({'plain':!![]});return db[_0x0d6d('0x79')][_0x0d6d('0x53')]({'where':{'id':_0x2c9653[_0x0d6d('0x60')]}});}return null;})[_0x0d6d('0x1f')](handleEntityNotFound(_0x56660a,null))[_0x0d6d('0x1f')](function(_0x1069b6){if(_0x1069b6){_0x24ffad[_0x0d6d('0x62')]=_0x1069b6[_0x0d6d('0x5f')]({'plain':!![]});interaction_log[_0x0d6d('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x44a26[_0x0d6d('0x5d')]['id'],_0x44a26[_0x0d6d('0x5d')]['name'],_0x44a26[_0x0d6d('0x5d')][_0x0d6d('0x64')],_0x24ffad[_0x0d6d('0x62')]['id'],_0x44a26[_0x0d6d('0x52')]?JSON[_0x0d6d('0x24')](_0x44a26[_0x0d6d('0x52')]):'null');return respondWithRpcPromise(_0x0d6d('0x7a'),_0x0d6d('0x7b'),_0x24ffad);}return null;})[_0x0d6d('0x1f')](function(_0x513b14){var _0x127676='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x513b14[_0x0d6d('0x27')][_0x0d6d('0x68')];return db[_0x0d6d('0x7c')][_0x0d6d('0x3e')](_0x127676,{'type':db[_0x0d6d('0x69')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x15f66f){return _0x15f66f;});})[_0x0d6d('0x1f')](function(_0x5c345f){if(_0x5c345f){_0x24ffad[_0x0d6d('0x27')][_0x0d6d('0x6c')]=_0x5c345f[0x0];if(!_0x44a26[_0x0d6d('0x52')]['UserId'])return;return db['User'][_0x0d6d('0x53')]({'where':{'id':_0x44a26[_0x0d6d('0x52')][_0x0d6d('0x5c')],'role':_0x0d6d('0x5e')},'attributes':['id',_0x0d6d('0x36'),_0x0d6d('0x7d'),_0x0d6d('0x6e'),_0x0d6d('0x6f')],'raw':!![]});}return null;})[_0x0d6d('0x1f')](function(_0x3df6b0){if(!_0x3df6b0)return null;_0x24ffad[_0x0d6d('0x27')][_0x0d6d('0x5e')]=_0x3df6b0;return _0x24ffad;})['then'](function(_0x491fe9){if(_0x491fe9){_0x491fe9['message'][_0x0d6d('0x71')]=util['format']('SIP/%s',_0x44a26[_0x0d6d('0x5d')][_0x0d6d('0x36')]);_0x491fe9[_0x0d6d('0x27')][_0x0d6d('0x74')]=_0x24ffad['channel'];_0x491fe9['message'][_0x0d6d('0x73')]=_0x24ffad[_0x0d6d('0x74')];_0x491fe9[_0x0d6d('0x27')][_0x0d6d('0x75')]='reject';respondWithRpcPromise(_0x0d6d('0x76'),_0x0d6d('0x76'),{'event':_0x0d6d('0x7e'),'message':_['merge'](_0x24ffad[_0x0d6d('0x27')],JSON[_0x0d6d('0x77')](_0x24ffad[_0x0d6d('0x62')][_0x0d6d('0x7f')]))},client9002);return _0x24ffad;}return null;})['then'](respondWithResult(_0x56660a,null))['catch'](handleError(_0x56660a,null));}; \ No newline at end of file +var _0x5579=['map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','chat-interactions','chat','RejectMessage','rejectMessage','User','fullname','event','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key'];(function(_0x4cd3f8,_0x534557){var _0x1660f8=function(_0x170ac1){while(--_0x170ac1){_0x4cd3f8['push'](_0x4cd3f8['shift']());}};_0x1660f8(++_0x534557);}(_0x5579,0x151));var _0x9557=function(_0xffd205,_0x392c2a){_0xffd205=_0xffd205-0x0;var _0x106a92=_0x5579[_0xffd205];return _0x106a92;};'use strict';var emlformat=require(_0x9557('0x0'));var rimraf=require(_0x9557('0x1'));var zipdir=require(_0x9557('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9557('0x3'));var moment=require(_0x9557('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9557('0x5'));var util=require(_0x9557('0x6'));var path=require(_0x9557('0x7'));var sox=require(_0x9557('0x8'));var csv=require(_0x9557('0x9'));var ejs=require(_0x9557('0xa'));var fs=require('fs');var fs_extra=require(_0x9557('0xb'));var _=require(_0x9557('0xc'));var squel=require(_0x9557('0xd'));var crypto=require('crypto');var jsforce=require(_0x9557('0xe'));var deskjs=require(_0x9557('0xf'));var toCsv=require(_0x9557('0x9'));var querystring=require(_0x9557('0x10'));var Papa=require(_0x9557('0x11'));var Redis=require(_0x9557('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9557('0x13'));var hardwareService=require(_0x9557('0x14'));var logger=require(_0x9557('0x15'))('api');var utils=require(_0x9557('0x16'));var config=require(_0x9557('0x17'));var licenseUtil=require(_0x9557('0x18'));var db=require(_0x9557('0x19'))['db'];config['redis']=_['defaults'](config[_0x9557('0x1a')],{'host':_0x9557('0x1b'),'port':0x18eb});var socket=require(_0x9557('0x1c'))(new Redis(config[_0x9557('0x1a')]));require('./chatMessage.socket')[_0x9557('0x1d')](socket);var jayson=require(_0x9557('0x1e'));var client=jayson['client'][_0x9557('0x1f')]({'port':0x232c});var client9002=jayson[_0x9557('0x20')][_0x9557('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3fa294,_0x879b9e,_0x4a6f66,_0x4f2c00){return new BPromise(function(_0x207be3,_0x59871b){var _0x4a509a=_0x4f2c00||client;return _0x4a509a['request'](_0x3fa294,_0x4a6f66)['then'](function(_0x7c83eb){logger['info'](_0x9557('0x21'),_0x879b9e,_0x9557('0x22'));logger[_0x9557('0x23')](_0x9557('0x24'),_0x879b9e,_0x9557('0x22'),JSON[_0x9557('0x25')](_0x7c83eb));if(_0x7c83eb[_0x9557('0x26')]){if(_0x7c83eb[_0x9557('0x26')][_0x9557('0x27')]===0x1f4){logger[_0x9557('0x26')]('ChatMessage,\x20%s,\x20%s',_0x879b9e,_0x7c83eb[_0x9557('0x26')]['message']);return _0x59871b(_0x7c83eb[_0x9557('0x26')][_0x9557('0x28')]);}logger[_0x9557('0x26')]('ChatMessage,\x20%s,\x20%s',_0x879b9e,_0x7c83eb[_0x9557('0x26')][_0x9557('0x28')]);return _0x207be3(_0x7c83eb['error'][_0x9557('0x28')]);}else{logger[_0x9557('0x29')]('ChatMessage,\x20%s,\x20%s',_0x879b9e,_0x9557('0x22'));_0x207be3(_0x7c83eb['result'][_0x9557('0x28')]);}})['catch'](function(_0x50fba2){logger[_0x9557('0x26')](_0x9557('0x21'),_0x879b9e,_0x50fba2);_0x59871b(_0x50fba2);});});}function respondWithStatusCode(_0x467081,_0x307b5c){_0x307b5c=_0x307b5c||0xcc;return function(_0x3e6917){if(_0x3e6917){return _0x467081[_0x9557('0x2a')](_0x307b5c);}return _0x467081[_0x9557('0x2b')](_0x307b5c)['end']();};}function respondWithResult(_0x4b5bc0,_0x5d8ecd){_0x5d8ecd=_0x5d8ecd||0xc8;return function(_0x5b5ab9){if(_0x5b5ab9){return _0x4b5bc0[_0x9557('0x2b')](_0x5d8ecd)[_0x9557('0x2c')](_0x5b5ab9);}};}function respondWithFilteredResult(_0x9416b5,_0x599c79){return function(_0x240c06){if(_0x240c06){var _0x474d61=typeof _0x599c79[_0x9557('0x2d')]===_0x9557('0x2e')&&typeof _0x599c79[_0x9557('0x2f')]===_0x9557('0x2e');var _0x4ca41b=_0x240c06[_0x9557('0x30')];var _0x42c433=_0x474d61?0x0:_0x599c79['offset'];var _0x591953=_0x474d61?_0x240c06[_0x9557('0x30')]:_0x599c79[_0x9557('0x2d')]+_0x599c79[_0x9557('0x2f')];var _0x25ac80;if(_0x591953>=_0x4ca41b){_0x591953=_0x4ca41b;_0x25ac80=0xc8;}else{_0x25ac80=0xce;}_0x9416b5['status'](_0x25ac80);return _0x9416b5['set'](_0x9557('0x31'),_0x42c433+'-'+_0x591953+'/'+_0x4ca41b)[_0x9557('0x2c')](_0x240c06);}return null;};}function patchUpdates(_0x314712){return function(_0x227085){try{jsonpatch[_0x9557('0x32')](_0x227085,_0x314712,!![]);}catch(_0x54c91d){return BPromise[_0x9557('0x33')](_0x54c91d);}return _0x227085[_0x9557('0x34')]();};}function saveUpdates(_0xdca481,_0x280390){return function(_0x234377){if(_0x234377){return _0x234377[_0x9557('0x35')](_0xdca481)[_0x9557('0x36')](function(_0x5e86b7){return _0x5e86b7;});}return null;};}function removeEntity(_0x29309c,_0x48136b){return function(_0x4f930a){if(_0x4f930a){return _0x4f930a[_0x9557('0x37')]()[_0x9557('0x36')](function(){_0x29309c[_0x9557('0x2b')](0xcc)[_0x9557('0x38')]();});}};}function handleEntityNotFound(_0x4d0a95,_0x45534a){return function(_0x5484b6){if(!_0x5484b6){_0x4d0a95[_0x9557('0x2a')](0x194);}return _0x5484b6;};}function handleError(_0x3e207b,_0x5ee5a1){_0x5ee5a1=_0x5ee5a1||0x1f4;return function(_0x4c254b){logger[_0x9557('0x26')](_0x4c254b[_0x9557('0x39')]);if(_0x4c254b[_0x9557('0x3a')]){delete _0x4c254b[_0x9557('0x3a')];}_0x3e207b[_0x9557('0x2b')](_0x5ee5a1)[_0x9557('0x3b')](_0x4c254b);};}exports['index']=function(_0x1bc276,_0xdb9c3c){var _0x2ecd8e={},_0x1e13a7={},_0x35802e={'count':0x0,'rows':[]};var _0xdba233=_['map'](db[_0x9557('0x3c')][_0x9557('0x3d')],function(_0x5af36c){return{'name':_0x5af36c[_0x9557('0x3e')],'type':_0x5af36c[_0x9557('0x3f')][_0x9557('0x40')]};});_0x1e13a7['model']=_[_0x9557('0x41')](_0xdba233,'name');_0x1e13a7[_0x9557('0x42')]=_[_0x9557('0x43')](_0x1bc276[_0x9557('0x42')]);_0x1e13a7[_0x9557('0x44')]=_['intersection'](_0x1e13a7['model'],_0x1e13a7[_0x9557('0x42')]);_0x2ecd8e['attributes']=_[_0x9557('0x45')](_0x1e13a7[_0x9557('0x46')],qs[_0x9557('0x47')](_0x1bc276[_0x9557('0x42')][_0x9557('0x47')]));_0x2ecd8e['attributes']=_0x2ecd8e[_0x9557('0x48')][_0x9557('0x49')]?_0x2ecd8e[_0x9557('0x48')]:_0x1e13a7[_0x9557('0x46')];if(!_0x1bc276[_0x9557('0x42')][_0x9557('0x4a')](_0x9557('0x4b'))){_0x2ecd8e[_0x9557('0x2f')]=qs[_0x9557('0x2f')](_0x1bc276[_0x9557('0x42')][_0x9557('0x2f')]);_0x2ecd8e[_0x9557('0x2d')]=qs[_0x9557('0x2d')](_0x1bc276[_0x9557('0x42')]['offset']);}_0x2ecd8e[_0x9557('0x4c')]=qs[_0x9557('0x4d')](_0x1bc276[_0x9557('0x42')]['sort']);_0x2ecd8e[_0x9557('0x4e')]=qs['filters'](_[_0x9557('0x4f')](_0x1bc276[_0x9557('0x42')],_0x1e13a7[_0x9557('0x44')]),_0xdba233);if(_0x1bc276[_0x9557('0x42')][_0x9557('0x50')]){_0x2ecd8e['where']=_[_0x9557('0x51')](_0x2ecd8e[_0x9557('0x4e')],{'$or':_[_0x9557('0x41')](_0xdba233,function(_0x3d0db3){if(_0x3d0db3[_0x9557('0x3f')]!==_0x9557('0x52')){var _0x24548a={};_0x24548a[_0x3d0db3[_0x9557('0x3a')]]={'$like':'%'+_0x1bc276[_0x9557('0x42')][_0x9557('0x50')]+'%'};return _0x24548a;}})});}_0x2ecd8e=_[_0x9557('0x51')]({},_0x2ecd8e,_0x1bc276[_0x9557('0x53')]);var _0x2ef387={'where':_0x2ecd8e[_0x9557('0x4e')]};return db[_0x9557('0x3c')][_0x9557('0x30')](_0x2ef387)[_0x9557('0x36')](function(_0x2f8ef5){_0x35802e['count']=_0x2f8ef5;if(_0x1bc276[_0x9557('0x42')][_0x9557('0x54')]){_0x2ecd8e[_0x9557('0x55')]=[{'all':!![]}];}return db[_0x9557('0x3c')]['findAll'](_0x2ecd8e);})[_0x9557('0x36')](function(_0x1e76ae){_0x35802e['rows']=_0x1e76ae;return _0x35802e;})[_0x9557('0x36')](respondWithFilteredResult(_0xdb9c3c,_0x2ecd8e))[_0x9557('0x56')](handleError(_0xdb9c3c,null));};exports['show']=function(_0x4110e9,_0x306530){var _0x189121={'raw':!![],'where':{'id':_0x4110e9[_0x9557('0x57')]['id']}},_0x1df139={};_0x1df139[_0x9557('0x46')]=_['keys'](db[_0x9557('0x3c')][_0x9557('0x3d')]);_0x1df139[_0x9557('0x42')]=_[_0x9557('0x43')](_0x4110e9[_0x9557('0x42')]);_0x1df139[_0x9557('0x44')]=_['intersection'](_0x1df139[_0x9557('0x46')],_0x1df139['query']);_0x189121['attributes']=_[_0x9557('0x45')](_0x1df139[_0x9557('0x46')],qs[_0x9557('0x47')](_0x4110e9['query'][_0x9557('0x47')]));_0x189121[_0x9557('0x48')]=_0x189121['attributes'][_0x9557('0x49')]?_0x189121[_0x9557('0x48')]:_0x1df139[_0x9557('0x46')];if(_0x4110e9[_0x9557('0x42')][_0x9557('0x54')]){_0x189121[_0x9557('0x55')]=[{'all':!![]}];}_0x189121=_[_0x9557('0x51')]({},_0x189121,_0x4110e9[_0x9557('0x53')]);return db['ChatMessage'][_0x9557('0x58')](_0x189121)[_0x9557('0x36')](handleEntityNotFound(_0x306530,null))[_0x9557('0x36')](respondWithResult(_0x306530,null))['catch'](handleError(_0x306530,null));};exports[_0x9557('0x59')]=function(_0x392712,_0x276b13){return db[_0x9557('0x3c')][_0x9557('0x59')](_0x392712['body'],{})['then'](respondWithResult(_0x276b13,0xc9))[_0x9557('0x56')](handleError(_0x276b13,null));};exports['update']=function(_0x44875a,_0x18aa64){if(_0x44875a[_0x9557('0x5a')]['id']){delete _0x44875a[_0x9557('0x5a')]['id'];}return db[_0x9557('0x3c')]['find']({'where':{'id':_0x44875a[_0x9557('0x57')]['id']}})[_0x9557('0x36')](handleEntityNotFound(_0x18aa64,null))[_0x9557('0x36')](saveUpdates(_0x44875a[_0x9557('0x5a')],null))[_0x9557('0x36')](respondWithResult(_0x18aa64,null))[_0x9557('0x56')](handleError(_0x18aa64,null));};exports[_0x9557('0x37')]=function(_0x5b986d,_0x4ff6c4){return db[_0x9557('0x3c')][_0x9557('0x58')]({'where':{'id':_0x5b986d[_0x9557('0x57')]['id']}})[_0x9557('0x36')](handleEntityNotFound(_0x4ff6c4,null))[_0x9557('0x36')](removeEntity(_0x4ff6c4,null))[_0x9557('0x56')](handleError(_0x4ff6c4,null));};exports['describe']=function(_0x2edf89,_0x3911e5){return db['ChatMessage'][_0x9557('0x5b')]()[_0x9557('0x36')](respondWithResult(_0x3911e5,null))[_0x9557('0x56')](handleError(_0x3911e5,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x9557('0x5c')]=function(_0x42bc90,_0x4697ef,_0x835396){var _0x2c15eb={'agent':{},'channel':'chat'};if(_0x42bc90['body']['id']){delete _0x42bc90['body']['id'];}_0x42bc90[_0x9557('0x5a')][_0x9557('0x5d')]=!![];_0x42bc90[_0x9557('0x5a')][_0x9557('0x5e')]=moment()[_0x9557('0x5f')](_0x9557('0x60'));_0x42bc90['body'][_0x9557('0x61')]=_0x42bc90[_0x9557('0x5a')][_0x9557('0x61')]||_0x42bc90[_0x9557('0x62')]['id'];_0x2c15eb[_0x9557('0x63')]['id']=_0x42bc90[_0x9557('0x5a')][_0x9557('0x61')];return db[_0x9557('0x3c')]['find']({'where':{'id':_0x42bc90[_0x9557('0x57')]['id'],'UserId':null}})[_0x9557('0x36')](handleEntityNotFound(_0x4697ef,null))[_0x9557('0x36')](saveUpdates(_0x42bc90[_0x9557('0x5a')],null))[_0x9557('0x36')](function(_0x5f165b){if(_0x5f165b){_0x2c15eb[_0x9557('0x28')]=_0x5f165b[_0x9557('0x64')]({'plain':!![]});return db[_0x9557('0x65')][_0x9557('0x58')]({'where':{'id':_0x5f165b[_0x9557('0x66')]}});}return null;})[_0x9557('0x36')](handleEntityNotFound(_0x4697ef,null))[_0x9557('0x36')](function(_0x5f2572){if(_0x5f2572){return _0x5f2572['update']({'UserId':_0x42bc90[_0x9557('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x5f2572['read1stAt'])?moment()['format'](_0x9557('0x60')):undefined});}return null;})[_0x9557('0x36')](function(_0x17314f){if(_0x17314f){_0x2c15eb[_0x9557('0x67')]=_0x17314f[_0x9557('0x64')]({'plain':!![]});interaction_log[_0x9557('0x29')](_0x9557('0x68'),_0x42bc90[_0x9557('0x62')]['id'],_0x42bc90['user']['name'],_0x42bc90[_0x9557('0x62')][_0x9557('0x69')],_0x2c15eb['interaction']['id'],_0x42bc90[_0x9557('0x5a')]?JSON[_0x9557('0x25')](_0x42bc90[_0x9557('0x5a')]):_0x9557('0x6a'));return respondWithRpcPromise(_0x9557('0x6b'),_0x9557('0x6c'),_0x2c15eb);}return null;})[_0x9557('0x36')](function(_0x5573be){var _0x38e20c=_0x9557('0x6d')+_0x5573be[_0x9557('0x28')][_0x9557('0x6e')];return db[_0x9557('0x6f')]['query'](_0x38e20c,{'type':db[_0x9557('0x70')][_0x9557('0x71')][_0x9557('0x72')],'raw':!![]})[_0x9557('0x36')](function(_0x381569){return _0x381569;});})[_0x9557('0x36')](function(_0x40a01f){if(_0x40a01f){_0x2c15eb['message'][_0x9557('0x73')]=_0x40a01f[0x0];if(!_0x42bc90[_0x9557('0x5a')][_0x9557('0x61')])return;return db['User'][_0x9557('0x58')]({'where':{'id':_0x42bc90['body'][_0x9557('0x61')],'role':_0x9557('0x63')},'attributes':['id',_0x9557('0x3a'),'fullname',_0x9557('0x74'),_0x9557('0x75')],'raw':!![]});}return null;})[_0x9557('0x36')](function(_0x1bea5e){if(!_0x1bea5e)return null;_0x2c15eb[_0x9557('0x28')]['agent']=_0x1bea5e;return _0x2c15eb;})[_0x9557('0x36')](function(_0x369bf1){if(_0x369bf1){if(_0x42bc90[_0x9557('0x5a')][_0x9557('0x76')]){_0x2c15eb[_0x9557('0x28')][_0x9557('0x77')]=util[_0x9557('0x5f')](_0x9557('0x78'),_0x42bc90[_0x9557('0x62')][_0x9557('0x3a')]);_0x2c15eb[_0x9557('0x28')][_0x9557('0x79')]=_0x2c15eb[_0x9557('0x79')];_0x2c15eb[_0x9557('0x28')]['motionChannel']=_0x2c15eb[_0x9557('0x79')];_0x2c15eb[_0x9557('0x28')]['event']='accept';return respondWithRpcPromise(_0x9557('0x7a'),_0x9557('0x7a'),{'event':_0x9557('0x7b'),'message':_[_0x9557('0x51')](_0x2c15eb['message'],JSON[_0x9557('0x7c')](_0x2c15eb['interaction']['formData']))},client9002)[_0x9557('0x36')](function(){return _0x2c15eb;});}return _0x2c15eb;}return null;})[_0x9557('0x36')](respondWithResult(_0x4697ef,null))[_0x9557('0x56')](handleError(_0x4697ef,null));};var interaction_log=require(_0x9557('0x15'))(_0x9557('0x7d'));exports[_0x9557('0x33')]=function(_0x59b3de,_0x49f028,_0x45f270){var _0x2db267={'agent':{},'channel':_0x9557('0x7e')};if(_0x59b3de['body']['id']){delete _0x59b3de[_0x9557('0x5a')]['id'];}_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')]=_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')]||_0x59b3de['user']['id'];_0x2db267[_0x9557('0x63')]['id']=_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x59b3de[_0x9557('0x57')]['id'],'UserId':null}})[_0x9557('0x36')](handleEntityNotFound(_0x49f028,null))[_0x9557('0x36')](function(_0x1699ee){if(_0x1699ee){_0x2db267[_0x9557('0x28')]=_0x1699ee['get']({'plain':!![]});return db[_0x9557('0x65')][_0x9557('0x58')]({'where':{'id':_0x1699ee[_0x9557('0x66')]}});}return null;})[_0x9557('0x36')](handleEntityNotFound(_0x49f028,null))[_0x9557('0x36')](function(_0xe25db6){if(_0xe25db6){_0x2db267['interaction']=_0xe25db6['get']({'plain':!![]});interaction_log[_0x9557('0x29')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59b3de['user']['id'],_0x59b3de[_0x9557('0x62')][_0x9557('0x3a')],_0x59b3de[_0x9557('0x62')][_0x9557('0x69')],_0x2db267['interaction']['id'],_0x59b3de['body']?JSON[_0x9557('0x25')](_0x59b3de[_0x9557('0x5a')]):_0x9557('0x6a'));return respondWithRpcPromise(_0x9557('0x7f'),_0x9557('0x80'),_0x2db267);}return null;})[_0x9557('0x36')](function(_0x5d6d8c){var _0x37a559='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d6d8c[_0x9557('0x28')][_0x9557('0x6e')];return db['sequelize'][_0x9557('0x42')](_0x37a559,{'type':db[_0x9557('0x70')][_0x9557('0x71')][_0x9557('0x72')],'raw':!![]})['then'](function(_0x2e7cb6){return _0x2e7cb6;});})['then'](function(_0x17bfa0){if(_0x17bfa0){_0x2db267[_0x9557('0x28')]['contact']=_0x17bfa0[0x0];if(!_0x59b3de[_0x9557('0x5a')]['UserId'])return;return db[_0x9557('0x81')][_0x9557('0x58')]({'where':{'id':_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')],'role':_0x9557('0x63')},'attributes':['id',_0x9557('0x3a'),_0x9557('0x82'),_0x9557('0x74'),_0x9557('0x75')],'raw':!![]});}return null;})['then'](function(_0x1f94e1){if(!_0x1f94e1)return null;_0x2db267['message'][_0x9557('0x63')]=_0x1f94e1;return _0x2db267;})[_0x9557('0x36')](function(_0x242a05){if(_0x242a05){_0x242a05['message'][_0x9557('0x77')]=util[_0x9557('0x5f')](_0x9557('0x78'),_0x59b3de[_0x9557('0x62')][_0x9557('0x3a')]);_0x242a05[_0x9557('0x28')][_0x9557('0x79')]=_0x2db267[_0x9557('0x79')];_0x242a05[_0x9557('0x28')]['motionChannel']=_0x2db267[_0x9557('0x79')];_0x242a05[_0x9557('0x28')][_0x9557('0x83')]='reject';respondWithRpcPromise('EventManager',_0x9557('0x7a'),{'event':_0x9557('0x84'),'message':_[_0x9557('0x51')](_0x2db267[_0x9557('0x28')],JSON[_0x9557('0x7c')](_0x2db267['interaction'][_0x9557('0x85')]))},client9002);return _0x2db267;}return null;})[_0x9557('0x36')](respondWithResult(_0x49f028,null))['catch'](handleError(_0x49f028,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 394781a..7d15879 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 _0x788d=['emit','events','setMaxListeners','save','remove'];(function(_0x2b3a2d,_0x1132de){var _0x4efb9f=function(_0x13df56){while(--_0x13df56){_0x2b3a2d['push'](_0x2b3a2d['shift']());}};_0x4efb9f(++_0x1132de);}(_0x788d,0x17d));var _0xd788=function(_0x348ab1,_0x58b7ee){_0x348ab1=_0x348ab1-0x0;var _0x15b1b7=_0x788d[_0x348ab1];return _0x15b1b7;};'use strict';var EventEmitter=require(_0xd788('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd788('0x1')](0x0);var events={'afterCreate':_0xd788('0x2'),'afterUpdate':'update','afterDestroy':_0xd788('0x3')};function emitEvent(_0x41f6d7){return function(_0x131a28,_0x2dce58,_0x336d8a){ChatMessageEvents['emit'](_0x41f6d7+':'+_0x131a28['id'],_0x131a28);ChatMessageEvents[_0xd788('0x4')](_0x41f6d7,_0x131a28);_0x336d8a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xaffe=['hasOwnProperty','hook','exports','events','ChatMessage','update','remove','emit'];(function(_0x2b2cc3,_0x5277d7){var _0x49d8a6=function(_0x1b604c){while(--_0x1b604c){_0x2b2cc3['push'](_0x2b2cc3['shift']());}};_0x49d8a6(++_0x5277d7);}(_0xaffe,0x17b));var _0xeaff=function(_0x165244,_0x26f339){_0x165244=_0x165244-0x0;var _0x1778bf=_0xaffe[_0x165244];return _0x1778bf;};'use strict';var EventEmitter=require(_0xeaff('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xeaff('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xeaff('0x2'),'afterDestroy':_0xeaff('0x3')};function emitEvent(_0x552990){return function(_0x1df606,_0x435fef,_0x23ced4){ChatMessageEvents[_0xeaff('0x4')](_0x552990+':'+_0x1df606['id'],_0x1df606);ChatMessageEvents[_0xeaff('0x4')](_0x552990,_0x1df606);_0x23ced4(null);};}for(var e in events){if(events[_0xeaff('0x5')](e)){var event=events[e];ChatMessage[_0xeaff('0x6')](e,emitEvent(event));}}module[_0xeaff('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 165f647..b59f743 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 _0x50a1=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x50a1,0xc4));var _0x150a=function(_0x3c841c,_0x3f26fb){_0x3c841c=_0x3c841c-0x0;var _0xd58efd=_0x50a1[_0x3c841c];return _0xd58efd;};'use strict';var _=require(_0x150a('0x0'));var util=require('util');var logger=require(_0x150a('0x1'))(_0x150a('0x2'));var moment=require(_0x150a('0x3'));var BPromise=require(_0x150a('0x4'));var rp=require(_0x150a('0x5'));var fs=require('fs');var path=require(_0x150a('0x6'));var rimraf=require(_0x150a('0x7'));var config=require('../../config/environment');var attributes=require(_0x150a('0x8'));module[_0x150a('0x9')]=function(_0x1fb98a,_0xf2c38d){return _0x1fb98a['define']('ChatMessage',attributes,{'tableName':_0x150a('0xa'),'paranoid':![],'indexes':[{'name':_0x150a('0xb'),'fields':[_0x150a('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58de26,_0x3e999c,_0x2b1eb8){var _0x391cda=_0x1fb98a[_0x150a('0xd')];var _0x1ebab6=_0x58de26[_0x150a('0xe')]({'plain':!![]});if(_0x1ebab6[_0x150a('0xf')][_0x150a('0x10')]()==='in'||_0x1ebab6['direction']['toLowerCase']()===_0x150a('0x11')&&!_0x1ebab6[_0x150a('0x12')]&&!_[_0x150a('0x13')](_0x1ebab6['UserId'])){_0x391cda[_0x150a('0x14')]['findOne']({'where':{'id':_0x1ebab6['ChatInteractionId']}})[_0x150a('0x15')](function(_0x254839){if(_0x254839){_0x254839[_0x150a('0x16')]({'lastMsgAt':_0x1ebab6[_0x150a('0x17')],'lastMsgDirection':_0x1ebab6[_0x150a('0xf')][_0x150a('0x10')]()});}})[_0x150a('0x18')](function(_0x4af914){console[_0x150a('0x19')](_0x4af914);});}_0x2b1eb8();}},'charset':_0x150a('0x1a'),'collate':_0x150a('0x1b')});}; \ No newline at end of file +var _0xf57b=['utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','update','createdAt','error','utf8mb4'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0xf57b,0x1c3));var _0xbf57=function(_0x1a9845,_0x5f1ca7){_0x1a9845=_0x1a9845-0x0;var _0x4f4490=_0xf57b[_0x1a9845];return _0x4f4490;};'use strict';var _=require(_0xbf57('0x0'));var util=require(_0xbf57('0x1'));var logger=require(_0xbf57('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf57('0x3'));var fs=require('fs');var path=require(_0xbf57('0x4'));var rimraf=require(_0xbf57('0x5'));var config=require(_0xbf57('0x6'));var attributes=require(_0xbf57('0x7'));module['exports']=function(_0x4140bf,_0x16c741){return _0x4140bf[_0xbf57('0x8')](_0xbf57('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xbf57('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x459ed6,_0x3be804,_0x128fa3){var _0x6e95cb=_0x4140bf[_0xbf57('0xb')];var _0x454b0b=_0x459ed6[_0xbf57('0xc')]({'plain':!![]});if(_0x454b0b['direction'][_0xbf57('0xd')]()==='in'||_0x454b0b[_0xbf57('0xe')][_0xbf57('0xd')]()===_0xbf57('0xf')&&!_0x454b0b[_0xbf57('0x10')]&&!_[_0xbf57('0x11')](_0x454b0b[_0xbf57('0x12')])){_0x6e95cb['ChatInteraction'][_0xbf57('0x13')]({'where':{'id':_0x454b0b['ChatInteractionId']}})['then'](function(_0x2dcef1){if(_0x2dcef1){_0x2dcef1[_0xbf57('0x14')]({'lastMsgAt':_0x454b0b[_0xbf57('0x15')],'lastMsgDirection':_0x454b0b[_0xbf57('0xe')][_0xbf57('0xd')]()});}})['catch'](function(_0x391e34){console[_0xbf57('0x16')](_0x391e34);});}_0x128fa3();}},'charset':_0xbf57('0x17'),'collate':_0xbf57('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 2ddea98..4fc8585 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 _0x7281=['options','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateChatMessage','create'];(function(_0x25e812,_0x1342a2){var _0x727c56=function(_0x243b79){while(--_0x243b79){_0x25e812['push'](_0x25e812['shift']());}};_0x727c56(++_0x1342a2);}(_0x7281,0x153));var _0x1728=function(_0x2438c1,_0x47d044){_0x2438c1=_0x2438c1-0x0;var _0x1cdf71=_0x7281[_0x2438c1];return _0x1cdf71;};'use strict';var _=require(_0x1728('0x0'));var util=require(_0x1728('0x1'));var moment=require(_0x1728('0x2'));var BPromise=require(_0x1728('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1728('0x4'));var db=require(_0x1728('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1728('0x6'));var config=require('../../config/environment');var jayson=require(_0x1728('0x7'));var client=jayson[_0x1728('0x8')]['http']({'port':0x232a});config[_0x1728('0x9')]=_[_0x1728('0xa')](config[_0x1728('0x9')],{'host':_0x1728('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1728('0x9')]));require('./chatMessage.socket')[_0x1728('0xc')](socket);function respondWithRpcPromise(_0x3730e4,_0x18912d,_0x2cca4e){return new BPromise(function(_0x14d2eb,_0x474c9a){return client['request'](_0x3730e4,_0x2cca4e)[_0x1728('0xd')](function(_0x527d7d){logger[_0x1728('0xe')](_0x1728('0xf'),_0x18912d,_0x1728('0x10'));logger[_0x1728('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x18912d,_0x1728('0x10'),JSON[_0x1728('0x12')](_0x527d7d));if(_0x527d7d[_0x1728('0x13')]){if(_0x527d7d[_0x1728('0x13')][_0x1728('0x14')]===0x1f4){logger[_0x1728('0x13')](_0x1728('0xf'),_0x18912d,_0x527d7d[_0x1728('0x13')][_0x1728('0x15')]);return _0x474c9a(_0x527d7d['error'][_0x1728('0x15')]);}logger[_0x1728('0x13')]('ChatMessage,\x20%s,\x20%s',_0x18912d,_0x527d7d['error'][_0x1728('0x15')]);return _0x14d2eb(_0x527d7d[_0x1728('0x13')][_0x1728('0x15')]);}else{logger['info'](_0x1728('0xf'),_0x18912d,'request\x20sent');_0x14d2eb(_0x527d7d['result']['message']);}})[_0x1728('0x16')](function(_0x4c88c6){logger['error'](_0x1728('0xf'),_0x18912d,_0x4c88c6);_0x474c9a(_0x4c88c6);});});}exports[_0x1728('0x17')]=function(_0x1c5caa){var _0x4cb6a5=this;return new Promise(function(_0x30d599,_0xb4380b){return db['ChatMessage'][_0x1728('0x18')](_0x1c5caa['body'],{'raw':_0x1c5caa[_0x1728('0x19')]?_0x1c5caa[_0x1728('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x1728('0xd')](function(_0x2670d0){logger[_0x1728('0xe')]('CreateChatMessage',_0x1c5caa);logger[_0x1728('0x11')](_0x1728('0x17'),_0x1c5caa,JSON[_0x1728('0x12')](_0x2670d0));_0x30d599(_0x2670d0);})[_0x1728('0x16')](function(_0x318506){logger[_0x1728('0x13')](_0x1728('0x17'),_0x318506[_0x1728('0x15')],_0x1c5caa);_0xb4380b(_0x4cb6a5['error'](0x1f4,_0x318506['message']));});});}; \ No newline at end of file +var _0xa981=['error','code','message','result','CreateChatMessage','ChatMessage','body','options','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0xa981,0xa9));var _0x1a98=function(_0x512e72,_0x49ffe1){_0x512e72=_0x512e72-0x0;var _0x143086=_0xa981[_0x512e72];return _0x143086;};'use strict';var _=require('lodash');var util=require(_0x1a98('0x0'));var moment=require('moment');var BPromise=require(_0x1a98('0x1'));var rs=require(_0x1a98('0x2'));var fs=require('fs');var Redis=require(_0x1a98('0x3'));var db=require(_0x1a98('0x4'))['db'];var utils=require(_0x1a98('0x5'));var logger=require('../../config/logger')(_0x1a98('0x6'));var config=require(_0x1a98('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1a98('0x8')][_0x1a98('0x9')]({'port':0x232a});config[_0x1a98('0xa')]=_[_0x1a98('0xb')](config[_0x1a98('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a98('0xc'))(new Redis(config[_0x1a98('0xa')]));require(_0x1a98('0xd'))[_0x1a98('0xe')](socket);function respondWithRpcPromise(_0x137a44,_0x45c260,_0x1d01c3){return new BPromise(function(_0x2b7877,_0x3ccd5b){return client[_0x1a98('0xf')](_0x137a44,_0x1d01c3)[_0x1a98('0x10')](function(_0x4647af){logger[_0x1a98('0x11')](_0x1a98('0x12'),_0x45c260,_0x1a98('0x13'));logger[_0x1a98('0x14')](_0x1a98('0x15'),_0x45c260,_0x1a98('0x13'),JSON[_0x1a98('0x16')](_0x4647af));if(_0x4647af[_0x1a98('0x17')]){if(_0x4647af[_0x1a98('0x17')][_0x1a98('0x18')]===0x1f4){logger['error'](_0x1a98('0x12'),_0x45c260,_0x4647af[_0x1a98('0x17')][_0x1a98('0x19')]);return _0x3ccd5b(_0x4647af[_0x1a98('0x17')][_0x1a98('0x19')]);}logger[_0x1a98('0x17')]('ChatMessage,\x20%s,\x20%s',_0x45c260,_0x4647af[_0x1a98('0x17')]['message']);return _0x2b7877(_0x4647af[_0x1a98('0x17')][_0x1a98('0x19')]);}else{logger[_0x1a98('0x11')](_0x1a98('0x12'),_0x45c260,_0x1a98('0x13'));_0x2b7877(_0x4647af[_0x1a98('0x1a')][_0x1a98('0x19')]);}})['catch'](function(_0x47a04b){logger['error'](_0x1a98('0x12'),_0x45c260,_0x47a04b);_0x3ccd5b(_0x47a04b);});});}exports[_0x1a98('0x1b')]=function(_0x2067e5){var _0x590c52=this;return new Promise(function(_0x5d426c,_0x25182e){return db[_0x1a98('0x1c')]['create'](_0x2067e5[_0x1a98('0x1d')],{'raw':_0x2067e5['options']?_0x2067e5[_0x1a98('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x1a98('0x10')](function(_0x17fd92){logger['info'](_0x1a98('0x1b'),_0x2067e5);logger[_0x1a98('0x14')](_0x1a98('0x1b'),_0x2067e5,JSON['stringify'](_0x17fd92));_0x5d426c(_0x17fd92);})[_0x1a98('0x1f')](function(_0x3b4bef){logger[_0x1a98('0x17')]('CreateChatMessage',_0x3b4bef[_0x1a98('0x19')],_0x2067e5);_0x25182e(_0x590c52[_0x1a98('0x17')](0x1f4,_0x3b4bef[_0x1a98('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f285e0b..1aadc51 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 _0x3595=['emit','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0xb90be8,_0x3014df){var _0x287c3f=function(_0x1016e9){while(--_0x1016e9){_0xb90be8['push'](_0xb90be8['shift']());}};_0x287c3f(++_0x3014df);}(_0x3595,0x147));var _0x5359=function(_0x384752,_0x3c4c5f){_0x384752=_0x384752-0x0;var _0x431eec=_0x3595[_0x384752];return _0x431eec;};'use strict';var ChatMessageEvents=require(_0x5359('0x0'));var events=[_0x5359('0x1'),_0x5359('0x2'),'update'];function createListener(_0x18677f,_0x398ac6){return function(_0xcb2beb){_0x398ac6[_0x5359('0x3')](_0x18677f,_0xcb2beb);};}function removeListener(_0x1fa814,_0x125c76){return function(){ChatMessageEvents['removeListener'](_0x1fa814,_0x125c76);};}exports['register']=function(_0x1cb891){for(var _0x24545a=0x0,_0x1b6f48=events[_0x5359('0x4')];_0x24545a<_0x1b6f48;_0x24545a++){var _0x39fcd8=events[_0x24545a];var _0x51b2fb=createListener(_0x5359('0x5')+_0x39fcd8,_0x1cb891);ChatMessageEvents['on'](_0x39fcd8,_0x51b2fb);}}; \ No newline at end of file +var _0x5162=['chatMessage:','./chatMessage.events','emit','removeListener','register','length'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0x5162,0x103));var _0x2516=function(_0x425af8,_0x366c35){_0x425af8=_0x425af8-0x0;var _0x5c2eb1=_0x5162[_0x425af8];return _0x5c2eb1;};'use strict';var ChatMessageEvents=require(_0x2516('0x0'));var events=['save','remove','update'];function createListener(_0x4db25c,_0x41fd28){return function(_0x2aaef5){_0x41fd28[_0x2516('0x1')](_0x4db25c,_0x2aaef5);};}function removeListener(_0x2d0b53,_0x2e48b6){return function(){ChatMessageEvents[_0x2516('0x2')](_0x2d0b53,_0x2e48b6);};}exports[_0x2516('0x3')]=function(_0x5b71b5){for(var _0x48f411=0x0,_0x5beeb3=events[_0x2516('0x4')];_0x48f411<_0x5beeb3;_0x48f411++){var _0xba4b36=events[_0x48f411];var _0xa1557=createListener(_0x2516('0x5')+_0xba4b36,_0x5b71b5);ChatMessageEvents['on'](_0xba4b36,_0xa1557);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 9947d72..328ce50 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 _0x1bc9=['tracked','chatmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x1bc9,0xad));var _0x91bc=function(_0x1ba3b7,_0x302135){_0x1ba3b7=_0x1ba3b7-0x0;var _0x42228e=_0x1bc9[_0x1ba3b7];return _0x42228e;};'use strict';var multer=require(_0x91bc('0x0'));var util=require('util');var path=require(_0x91bc('0x1'));var timeout=require(_0x91bc('0x2'));var express=require(_0x91bc('0x3'));var router=express[_0x91bc('0x4')]();var fs_extra=require(_0x91bc('0x5'));var auth=require(_0x91bc('0x6'));var interaction=require(_0x91bc('0x7'));var config=require(_0x91bc('0x8'));var controller=require(_0x91bc('0x9'));router[_0x91bc('0xa')]('/',auth[_0x91bc('0xb')](),controller[_0x91bc('0xc')]);router[_0x91bc('0xa')](_0x91bc('0xd'),auth[_0x91bc('0xb')](),controller[_0x91bc('0xe')]);router['get']('/:id',auth[_0x91bc('0xb')](),controller[_0x91bc('0xf')]);router['post']('/',auth[_0x91bc('0xb')](),interaction[_0x91bc('0x10')]('chat',_0x91bc('0x11')),controller[_0x91bc('0x12')]);router[_0x91bc('0x13')](_0x91bc('0x14'),controller[_0x91bc('0x15')]);router['put'](_0x91bc('0x16'),auth[_0x91bc('0xb')](),controller[_0x91bc('0x17')]);router['put'](_0x91bc('0x18'),auth['isAuthenticated'](),controller[_0x91bc('0x19')]);router['delete'](_0x91bc('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x91bc('0x1a')]=router; \ No newline at end of file +var _0x2248=['show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x57b5d0,_0xf302ef){var _0x7c212e=function(_0x3c6cef){while(--_0x3c6cef){_0x57b5d0['push'](_0x57b5d0['shift']());}};_0x7c212e(++_0xf302ef);}(_0x2248,0x93));var _0x8224=function(_0x5218db,_0x388fc7){_0x5218db=_0x5218db-0x0;var _0x157852=_0x2248[_0x5218db];return _0x157852;};'use strict';var multer=require(_0x8224('0x0'));var util=require(_0x8224('0x1'));var path=require(_0x8224('0x2'));var timeout=require('connect-timeout');var express=require(_0x8224('0x3'));var router=express[_0x8224('0x4')]();var fs_extra=require(_0x8224('0x5'));var auth=require(_0x8224('0x6'));var interaction=require(_0x8224('0x7'));var config=require('../../config/environment');var controller=require(_0x8224('0x8'));router[_0x8224('0x9')]('/',auth[_0x8224('0xa')](),controller[_0x8224('0xb')]);router[_0x8224('0x9')](_0x8224('0xc'),auth['isAuthenticated'](),controller[_0x8224('0xd')]);router[_0x8224('0x9')](_0x8224('0xe'),auth[_0x8224('0xa')](),controller[_0x8224('0xf')]);router[_0x8224('0x10')]('/',auth['isAuthenticated'](),interaction[_0x8224('0x11')](_0x8224('0x12'),_0x8224('0x13')),controller['create']);router[_0x8224('0x14')](_0x8224('0xe'),controller[_0x8224('0x15')]);router[_0x8224('0x14')](_0x8224('0x16'),auth[_0x8224('0xa')](),controller[_0x8224('0x17')]);router[_0x8224('0x14')](_0x8224('0x18'),auth[_0x8224('0xa')](),controller['reject']);router['delete'](_0x8224('0xe'),auth[_0x8224('0xa')](),controller[_0x8224('0x19')]);module[_0x8224('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 4fa6587..04e34bf 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0x0b0e[_0x4b7b9b];return _0x3be710;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x40c656,_0x27b0fa){var _0x553a28=function(_0x49ce84){while(--_0x49ce84){_0x40c656['push'](_0x40c656['shift']());}};_0x553a28(++_0x27b0fa);}(_0x2032,0xd9));var _0x2203=function(_0x3b1a3e,_0xfed716){_0x3b1a3e=_0x3b1a3e-0x0;var _0x343add=_0x2032[_0x3b1a3e];return _0x343add;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 529f758..938e9ee 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x10f4f3,_0x3320d3){_0x10f4f3=_0x10f4f3-0x0;var _0x3c4332=_0x7a54[_0x10f4f3];return _0x3c4332;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x22d268,_0x1347fc){var _0x30def5=function(_0xc83fc8){while(--_0xc83fc8){_0x22d268['push'](_0x22d268['shift']());}};_0x30def5(++_0x1347fc);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index eea6ba1..11f351b 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 _0xee65=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xee65,0x1bb));var _0x5ee6=function(_0x15caea,_0xd23bf){_0x15caea=_0x15caea-0x0;var _0x5713cf=_0xee65[_0x15caea];return _0x5713cf;};'use strict';var EventEmitter=require(_0x5ee6('0x0'));var ChatOfflineMessage=require(_0x5ee6('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5ee6('0x2')](0x0);var events={'afterCreate':_0x5ee6('0x3'),'afterUpdate':_0x5ee6('0x4'),'afterDestroy':_0x5ee6('0x5')};function emitEvent(_0x58d65c){return function(_0x5bcbaf,_0x8130d1,_0x46075c){ChatOfflineMessageEvents[_0x5ee6('0x6')](_0x58d65c+':'+_0x5bcbaf['id'],_0x5bcbaf);ChatOfflineMessageEvents[_0x5ee6('0x6')](_0x58d65c,_0x5bcbaf);_0x46075c(null);};}for(var e in events){if(events[_0x5ee6('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x5ee6('0x8')](e,emitEvent(event));}}module[_0x5ee6('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xe396=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xc8c149,_0x104184){var _0x261259=function(_0x314df3){while(--_0x314df3){_0xc8c149['push'](_0xc8c149['shift']());}};_0x261259(++_0x104184);}(_0xe396,0xa3));var _0x6e39=function(_0x6f7355,_0x3246eb){_0x6f7355=_0x6f7355-0x0;var _0xbd5cb5=_0xe396[_0x6f7355];return _0xbd5cb5;};'use strict';var EventEmitter=require(_0x6e39('0x0'));var ChatOfflineMessage=require(_0x6e39('0x1'))['db'][_0x6e39('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6e39('0x3')](0x0);var events={'afterCreate':_0x6e39('0x4'),'afterUpdate':_0x6e39('0x5'),'afterDestroy':_0x6e39('0x6')};function emitEvent(_0x2e51f0){return function(_0x34bb99,_0x59bce9,_0x3e8e20){ChatOfflineMessageEvents[_0x6e39('0x7')](_0x2e51f0+':'+_0x34bb99['id'],_0x34bb99);ChatOfflineMessageEvents[_0x6e39('0x7')](_0x2e51f0,_0x34bb99);_0x3e8e20(null);};}for(var e in events){if(events[_0x6e39('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x6e39('0x9')](e,emitEvent(event));}}module[_0x6e39('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 9ff6215..330ce09 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 _0x0605=['./chatOfflineMessage.attributes','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x471452,_0x157074){var _0x1220ac=function(_0x404d5c){while(--_0x404d5c){_0x471452['push'](_0x471452['shift']());}};_0x1220ac(++_0x157074);}(_0x0605,0x1e5));var _0x5060=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0605[_0x31e29a];return _0x32d892;};'use strict';var attributes=require(_0x5060('0x0'));module['exports']=function(_0x44ca89){return _0x44ca89[_0x5060('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x5060('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5060('0x3'),'collate':_0x5060('0x4')});}; \ No newline at end of file +var _0x823b=['exports','define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes'];(function(_0x4b5714,_0x4a8ff6){var _0x384f28=function(_0x1a97a5){while(--_0x1a97a5){_0x4b5714['push'](_0x4b5714['shift']());}};_0x384f28(++_0x4a8ff6);}(_0x823b,0xcc));var _0xb823=function(_0x52a9c3,_0x54a987){_0x52a9c3=_0x52a9c3-0x0;var _0x5b9422=_0x823b[_0x52a9c3];return _0x5b9422;};'use strict';var attributes=require(_0xb823('0x0'));module[_0xb823('0x1')]=function(_0x231efe){return _0x231efe[_0xb823('0x2')](_0xb823('0x3'),attributes,{'tableName':_0xb823('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 44fe1bd..6f980c4 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 _0x031f=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4bb730,_0x25cbee){var _0x4c0897=function(_0x1b13ef){while(--_0x1b13ef){_0x4bb730['push'](_0x4bb730['shift']());}};_0x4c0897(++_0x25cbee);}(_0x031f,0x1c2));var _0xf031=function(_0x3c7c41,_0x4c4375){_0x3c7c41=_0x3c7c41-0x0;var _0x27d147=_0x031f[_0x3c7c41];return _0x27d147;};'use strict';var _=require(_0xf031('0x0'));var util=require('util');var moment=require(_0xf031('0x1'));var BPromise=require('bluebird');var rs=require(_0xf031('0x2'));var fs=require('fs');var Redis=require(_0xf031('0x3'));var db=require(_0xf031('0x4'))['db'];var utils=require(_0xf031('0x5'));var logger=require('../../config/logger')(_0xf031('0x6'));var config=require(_0xf031('0x7'));var jayson=require(_0xf031('0x8'));var client=jayson[_0xf031('0x9')][_0xf031('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32aa5c,_0x3c598b,_0x506616){return new BPromise(function(_0x3f27ee,_0x49ac08){return client[_0xf031('0xb')](_0x32aa5c,_0x506616)[_0xf031('0xc')](function(_0x987107){logger[_0xf031('0xd')](_0xf031('0xe'),_0x3c598b,'request\x20sent');logger[_0xf031('0xf')](_0xf031('0x10'),_0x3c598b,'request\x20sent',JSON[_0xf031('0x11')](_0x987107));if(_0x987107[_0xf031('0x12')]){if(_0x987107[_0xf031('0x12')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3c598b,_0x987107[_0xf031('0x12')][_0xf031('0x13')]);return _0x49ac08(_0x987107['error'][_0xf031('0x13')]);}logger[_0xf031('0x12')](_0xf031('0xe'),_0x3c598b,_0x987107[_0xf031('0x12')]['message']);return _0x3f27ee(_0x987107['error']['message']);}else{logger[_0xf031('0xd')](_0xf031('0xe'),_0x3c598b,_0xf031('0x14'));_0x3f27ee(_0x987107[_0xf031('0x15')]['message']);}})[_0xf031('0x16')](function(_0x211c93){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3c598b,_0x211c93);_0x49ac08(_0x211c93);});});} \ No newline at end of file +var _0xe20a=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xe20a,0xf7));var _0xae20=function(_0x9f2ca5,_0x575ffd){_0x9f2ca5=_0x9f2ca5-0x0;var _0x3ff23e=_0xe20a[_0x9f2ca5];return _0x3ff23e;};'use strict';var _=require(_0xae20('0x0'));var util=require(_0xae20('0x1'));var moment=require(_0xae20('0x2'));var BPromise=require(_0xae20('0x3'));var rs=require(_0xae20('0x4'));var fs=require('fs');var Redis=require(_0xae20('0x5'));var db=require(_0xae20('0x6'))['db'];var utils=require(_0xae20('0x7'));var logger=require(_0xae20('0x8'))(_0xae20('0x9'));var config=require('../../config/environment');var jayson=require(_0xae20('0xa'));var client=jayson[_0xae20('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcb526d,_0x11bba1,_0x1159d7){return new BPromise(function(_0x407652,_0x47b731){return client['request'](_0xcb526d,_0x1159d7)[_0xae20('0xc')](function(_0x520a6a){logger[_0xae20('0xd')](_0xae20('0xe'),_0x11bba1,_0xae20('0xf'));logger[_0xae20('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x11bba1,_0xae20('0xf'),JSON[_0xae20('0x11')](_0x520a6a));if(_0x520a6a['error']){if(_0x520a6a[_0xae20('0x12')]['code']===0x1f4){logger['error'](_0xae20('0xe'),_0x11bba1,_0x520a6a[_0xae20('0x12')][_0xae20('0x13')]);return _0x47b731(_0x520a6a[_0xae20('0x12')][_0xae20('0x13')]);}logger[_0xae20('0x12')](_0xae20('0xe'),_0x11bba1,_0x520a6a[_0xae20('0x12')][_0xae20('0x13')]);return _0x407652(_0x520a6a['error'][_0xae20('0x13')]);}else{logger[_0xae20('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x11bba1,_0xae20('0xf'));_0x407652(_0x520a6a['result']['message']);}})['catch'](function(_0x27e6e7){logger[_0xae20('0x12')](_0xae20('0xe'),_0x11bba1,_0x27e6e7);_0x47b731(_0x27e6e7);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ffed146..e2ba43e 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 _0xada8=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','show','post','create','delete','/:id'];(function(_0xe98847,_0x197762){var _0x27f822=function(_0x2d26c6){while(--_0x2d26c6){_0xe98847['push'](_0xe98847['shift']());}};_0x27f822(++_0x197762);}(_0xada8,0x17c));var _0x8ada=function(_0x19c57f,_0x259afa){_0x19c57f=_0x19c57f-0x0;var _0x3696b8=_0xada8[_0x19c57f];return _0x3696b8;};'use strict';var multer=require(_0x8ada('0x0'));var util=require('util');var path=require(_0x8ada('0x1'));var timeout=require(_0x8ada('0x2'));var express=require('express');var router=express[_0x8ada('0x3')]();var fs_extra=require(_0x8ada('0x4'));var auth=require(_0x8ada('0x5'));var interaction=require(_0x8ada('0x6'));var config=require('../../config/environment');var controller=require(_0x8ada('0x7'));router['get']('/',auth[_0x8ada('0x8')](),controller[_0x8ada('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8ada('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8ada('0xb')]);router[_0x8ada('0xc')]('/',auth[_0x8ada('0x8')](),controller[_0x8ada('0xd')]);router['put']('/:id',auth[_0x8ada('0x8')](),controller['update']);router[_0x8ada('0xe')](_0x8ada('0xf'),auth[_0x8ada('0x8')](),controller[_0x8ada('0x10')]);module[_0x8ada('0x11')]=router; \ No newline at end of file +var _0xa738=['show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x2d8db5,_0x3c9c8d){var _0xdc5579=function(_0x36f14f){while(--_0x36f14f){_0x2d8db5['push'](_0x2d8db5['shift']());}};_0xdc5579(++_0x3c9c8d);}(_0xa738,0x86));var _0x8a73=function(_0x50804b,_0x34b219){_0x50804b=_0x50804b-0x0;var _0x1e3a47=_0xa738[_0x50804b];return _0x1e3a47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a73('0x0'));var timeout=require(_0x8a73('0x1'));var express=require(_0x8a73('0x2'));var router=express[_0x8a73('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8a73('0x4'));var interaction=require(_0x8a73('0x5'));var config=require(_0x8a73('0x6'));var controller=require(_0x8a73('0x7'));router[_0x8a73('0x8')]('/',auth[_0x8a73('0x9')](),controller['index']);router['get'](_0x8a73('0xa'),auth[_0x8a73('0x9')](),controller[_0x8a73('0xb')]);router[_0x8a73('0x8')](_0x8a73('0xc'),auth[_0x8a73('0x9')](),controller[_0x8a73('0xd')]);router[_0x8a73('0xe')]('/',auth[_0x8a73('0x9')](),controller[_0x8a73('0xf')]);router[_0x8a73('0x10')](_0x8a73('0xc'),auth[_0x8a73('0x9')](),controller[_0x8a73('0x11')]);router[_0x8a73('0x12')]('/:id',auth[_0x8a73('0x9')](),controller[_0x8a73('0x13')]);module[_0x8a73('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 3ccc332..6767485 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 _0xe2d4=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x1c07b0,_0x1876cc){var _0x3038ce=function(_0x376d13){while(--_0x376d13){_0x1c07b0['push'](_0x1c07b0['shift']());}};_0x3038ce(++_0x1876cc);}(_0xe2d4,0xa1));var _0x4e2d=function(_0x592d17,_0x57e2ed){_0x592d17=_0x592d17-0x0;var _0x44808f=_0xe2d4[_0x592d17];return _0x44808f;};'use strict';var Sequelize=require(_0x4e2d('0x0'));module[_0x4e2d('0x1')]={'name':{'type':Sequelize[_0x4e2d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4e2d('0x3')]('mouseOver','timeout'),'defaultValue':_0x4e2d('0x4')},'selector':{'type':Sequelize[_0x4e2d('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xae29=['STRING','mouseOver','INTEGER','sequelize','exports'];(function(_0x2c7b11,_0x19a38e){var _0x222b49=function(_0x57a52d){while(--_0x57a52d){_0x2c7b11['push'](_0x2c7b11['shift']());}};_0x222b49(++_0x19a38e);}(_0xae29,0xad));var _0x9ae2=function(_0x3f3f75,_0x5e215f){_0x3f3f75=_0x3f3f75-0x0;var _0x322635=_0xae29[_0x3f3f75];return _0x322635;};'use strict';var Sequelize=require(_0x9ae2('0x0'));module[_0x9ae2('0x1')]={'name':{'type':Sequelize[_0x9ae2('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x9ae2('0x3')},'selector':{'type':Sequelize[_0x9ae2('0x2')]},'timeout':{'type':Sequelize[_0x9ae2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 53e7a9e..04175db 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 _0xd13e=['fast-json-patch','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','name','show','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','length','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir'];(function(_0x3a2b60,_0x454e7c){var _0x3e73e6=function(_0x3d3f96){while(--_0x3d3f96){_0x3a2b60['push'](_0x3a2b60['shift']());}};_0x3e73e6(++_0x454e7c);}(_0xd13e,0x193));var _0xed13=function(_0xc35948,_0x11fa59){_0xc35948=_0xc35948-0x0;var _0x192662=_0xd13e[_0xc35948];return _0x192662;};'use strict';var emlformat=require(_0xed13('0x0'));var rimraf=require(_0xed13('0x1'));var zipdir=require(_0xed13('0x2'));var jsonpatch=require(_0xed13('0x3'));var rp=require('request-promise');var moment=require(_0xed13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed13('0x5'));var util=require('util');var path=require(_0xed13('0x6'));var sox=require(_0xed13('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed13('0x8'));var squel=require(_0xed13('0x9'));var crypto=require(_0xed13('0xa'));var jsforce=require(_0xed13('0xb'));var deskjs=require(_0xed13('0xc'));var toCsv=require(_0xed13('0xd'));var querystring=require(_0xed13('0xe'));var Papa=require(_0xed13('0xf'));var Redis=require(_0xed13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed13('0x11'));var as=require(_0xed13('0x12'));var hardwareService=require(_0xed13('0x13'));var logger=require(_0xed13('0x14'))(_0xed13('0x15'));var utils=require('../../config/utils');var config=require(_0xed13('0x16'));var licenseUtil=require(_0xed13('0x17'));var db=require(_0xed13('0x18'))['db'];function respondWithStatusCode(_0x3c0b22,_0x936103){_0x936103=_0x936103||0xcc;return function(_0x3295ba){if(_0x3295ba){return _0x3c0b22['sendStatus'](_0x936103);}return _0x3c0b22[_0xed13('0x19')](_0x936103)['end']();};}function respondWithResult(_0x257074,_0x56fdc6){_0x56fdc6=_0x56fdc6||0xc8;return function(_0x6e2978){if(_0x6e2978){return _0x257074['status'](_0x56fdc6)[_0xed13('0x1a')](_0x6e2978);}};}function respondWithFilteredResult(_0x4d5435,_0x38901a){return function(_0xf900d2){if(_0xf900d2){var _0x1d3d67=typeof _0x38901a[_0xed13('0x1b')]===_0xed13('0x1c')&&typeof _0x38901a[_0xed13('0x1d')]===_0xed13('0x1c');var _0x1148a3=_0xf900d2[_0xed13('0x1e')];var _0x1e161f=_0x1d3d67?0x0:_0x38901a[_0xed13('0x1b')];var _0x31de07=_0x1d3d67?_0xf900d2[_0xed13('0x1e')]:_0x38901a[_0xed13('0x1b')]+_0x38901a[_0xed13('0x1d')];var _0x2f38c9;if(_0x31de07>=_0x1148a3){_0x31de07=_0x1148a3;_0x2f38c9=0xc8;}else{_0x2f38c9=0xce;}_0x4d5435['status'](_0x2f38c9);return _0x4d5435['set'](_0xed13('0x1f'),_0x1e161f+'-'+_0x31de07+'/'+_0x1148a3)[_0xed13('0x1a')](_0xf900d2);}return null;};}function patchUpdates(_0x4f455b){return function(_0x40dd86){try{jsonpatch['apply'](_0x40dd86,_0x4f455b,!![]);}catch(_0x4e9e3b){return BPromise[_0xed13('0x20')](_0x4e9e3b);}return _0x40dd86[_0xed13('0x21')]();};}function saveUpdates(_0x2d62cd,_0x192d12){return function(_0x1d7621){if(_0x1d7621){return _0x1d7621[_0xed13('0x22')](_0x2d62cd)['then'](function(_0x5c0daf){return _0x5c0daf;});}return null;};}function removeEntity(_0x5d7ae1,_0x19d51b){return function(_0x3b1f23){if(_0x3b1f23){return _0x3b1f23[_0xed13('0x23')]()[_0xed13('0x24')](function(){_0x5d7ae1[_0xed13('0x19')](0xcc)[_0xed13('0x25')]();});}};}function handleEntityNotFound(_0x1f0405,_0x276c57){return function(_0x2410e2){if(!_0x2410e2){_0x1f0405[_0xed13('0x26')](0x194);}return _0x2410e2;};}function handleError(_0x1f064c,_0x3bc666){_0x3bc666=_0x3bc666||0x1f4;return function(_0x2c6c33){logger[_0xed13('0x27')](_0x2c6c33['stack']);if(_0x2c6c33['name']){delete _0x2c6c33[_0xed13('0x28')];}_0x1f064c[_0xed13('0x19')](_0x3bc666)['send'](_0x2c6c33);};}exports[_0xed13('0x29')]=function(_0x40444a,_0x4ed119){var _0x7ce996={'raw':!![],'where':{'id':_0x40444a[_0xed13('0x2a')]['id']}},_0x2066ca={};_0x2066ca['model']=_[_0xed13('0x2b')](db[_0xed13('0x2c')]['rawAttributes']);_0x2066ca[_0xed13('0x2d')]=_[_0xed13('0x2b')](_0x40444a['query']);_0x2066ca[_0xed13('0x2e')]=_[_0xed13('0x2f')](_0x2066ca[_0xed13('0x30')],_0x2066ca[_0xed13('0x2d')]);_0x7ce996[_0xed13('0x31')]=_[_0xed13('0x2f')](_0x2066ca[_0xed13('0x30')],qs['fields'](_0x40444a[_0xed13('0x2d')]['fields']));_0x7ce996['attributes']=_0x7ce996[_0xed13('0x31')][_0xed13('0x32')]?_0x7ce996[_0xed13('0x31')]:_0x2066ca['model'];if(_0x40444a[_0xed13('0x2d')][_0xed13('0x33')]){_0x7ce996[_0xed13('0x34')]=[{'all':!![]}];}_0x7ce996=_['merge']({},_0x7ce996,_0x40444a[_0xed13('0x35')]);return db[_0xed13('0x2c')][_0xed13('0x36')](_0x7ce996)[_0xed13('0x24')](handleEntityNotFound(_0x4ed119,null))['then'](respondWithResult(_0x4ed119,null))[_0xed13('0x37')](handleError(_0x4ed119,null));};exports[_0xed13('0x38')]=function(_0x2508b4,_0xed7343){return db[_0xed13('0x2c')][_0xed13('0x38')](_0x2508b4[_0xed13('0x39')],{})[_0xed13('0x24')](respondWithResult(_0xed7343,0xc9))[_0xed13('0x37')](handleError(_0xed7343,null));};exports[_0xed13('0x22')]=function(_0x5a09e4,_0x2342a5){if(_0x5a09e4[_0xed13('0x39')]['id']){delete _0x5a09e4['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x5a09e4[_0xed13('0x2a')]['id']}})[_0xed13('0x24')](handleEntityNotFound(_0x2342a5,null))['then'](saveUpdates(_0x5a09e4['body'],null))[_0xed13('0x24')](respondWithResult(_0x2342a5,null))[_0xed13('0x37')](handleError(_0x2342a5,null));};exports[_0xed13('0x23')]=function(_0x32ec49,_0x358098){return db['ChatProactiveAction']['find']({'where':{'id':_0x32ec49[_0xed13('0x2a')]['id']}})['then'](handleEntityNotFound(_0x358098,null))[_0xed13('0x24')](removeEntity(_0x358098,null))['catch'](handleError(_0x358098,null));}; \ No newline at end of file +var _0x9a19=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x18ca81,_0x5698ae){var _0x4c8c5c=function(_0x57477f){while(--_0x57477f){_0x18ca81['push'](_0x18ca81['shift']());}};_0x4c8c5c(++_0x5698ae);}(_0x9a19,0x114));var _0x99a1=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x9a19[_0x32b542];return _0x554d54;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['show']=function(_0xf41b0d,_0x499eef){var _0x255197={'raw':!![],'where':{'id':_0xf41b0d[_0x99a1('0x29')]['id']}},_0x1137f2={};_0x1137f2['model']=_[_0x99a1('0x2a')](db[_0x99a1('0x2b')]['rawAttributes']);_0x1137f2[_0x99a1('0x2c')]=_[_0x99a1('0x2a')](_0xf41b0d[_0x99a1('0x2c')]);_0x1137f2[_0x99a1('0x2d')]=_[_0x99a1('0x2e')](_0x1137f2[_0x99a1('0x2f')],_0x1137f2[_0x99a1('0x2c')]);_0x255197[_0x99a1('0x30')]=_['intersection'](_0x1137f2['model'],qs[_0x99a1('0x31')](_0xf41b0d['query'][_0x99a1('0x31')]));_0x255197[_0x99a1('0x30')]=_0x255197['attributes'][_0x99a1('0x32')]?_0x255197[_0x99a1('0x30')]:_0x1137f2[_0x99a1('0x2f')];if(_0xf41b0d[_0x99a1('0x2c')][_0x99a1('0x33')]){_0x255197[_0x99a1('0x34')]=[{'all':!![]}];}_0x255197=_[_0x99a1('0x35')]({},_0x255197,_0xf41b0d[_0x99a1('0x36')]);return db[_0x99a1('0x2b')][_0x99a1('0x37')](_0x255197)[_0x99a1('0x23')](handleEntityNotFound(_0x499eef,null))[_0x99a1('0x23')](respondWithResult(_0x499eef,null))[_0x99a1('0x38')](handleError(_0x499eef,null));};exports[_0x99a1('0x39')]=function(_0x55005e,_0x53fed5){return db[_0x99a1('0x2b')][_0x99a1('0x39')](_0x55005e[_0x99a1('0x3a')],{})[_0x99a1('0x23')](respondWithResult(_0x53fed5,0xc9))[_0x99a1('0x38')](handleError(_0x53fed5,null));};exports[_0x99a1('0x3b')]=function(_0x318dab,_0x54840d){if(_0x318dab[_0x99a1('0x3a')]['id']){delete _0x318dab[_0x99a1('0x3a')]['id'];}return db['ChatProactiveAction'][_0x99a1('0x37')]({'where':{'id':_0x318dab[_0x99a1('0x29')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x54840d,null))[_0x99a1('0x23')](saveUpdates(_0x318dab[_0x99a1('0x3a')],null))[_0x99a1('0x23')](respondWithResult(_0x54840d,null))[_0x99a1('0x38')](handleError(_0x54840d,null));};exports[_0x99a1('0x24')]=function(_0x1a44c6,_0x17bb50){return db[_0x99a1('0x2b')][_0x99a1('0x37')]({'where':{'id':_0x1a44c6[_0x99a1('0x29')]['id']}})['then'](handleEntityNotFound(_0x17bb50,null))['then'](removeEntity(_0x17bb50,null))['catch'](handleError(_0x17bb50,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index e522edd..e0a7170 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 _0xf344=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_proactive_actions'];(function(_0x1d6000,_0x3a3185){var _0x1db9ac=function(_0x22c3ba){while(--_0x22c3ba){_0x1d6000['push'](_0x1d6000['shift']());}};_0x1db9ac(++_0x3a3185);}(_0xf344,0xaa));var _0x4f34=function(_0x127483,_0x2bada2){_0x127483=_0x127483-0x0;var _0x16a73e=_0xf344[_0x127483];return _0x16a73e;};'use strict';var _=require('lodash');var util=require(_0x4f34('0x0'));var logger=require(_0x4f34('0x1'))(_0x4f34('0x2'));var moment=require('moment');var BPromise=require(_0x4f34('0x3'));var rp=require(_0x4f34('0x4'));var fs=require('fs');var path=require(_0x4f34('0x5'));var rimraf=require(_0x4f34('0x6'));var config=require(_0x4f34('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x4f34('0x8')]=function(_0x139eeb,_0x5d3955){return _0x139eeb['define']('ChatProactiveAction',attributes,{'tableName':_0x4f34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd28e=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','api','bluebird'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0xd28e,0x105));var _0xed28=function(_0x2d9c49,_0xc40595){_0x2d9c49=_0x2d9c49-0x0;var _0x4b86f3=_0xd28e[_0x2d9c49];return _0x4b86f3;};'use strict';var _=require('lodash');var util=require(_0xed28('0x0'));var logger=require('../../config/logger')(_0xed28('0x1'));var moment=require('moment');var BPromise=require(_0xed28('0x2'));var rp=require(_0xed28('0x3'));var fs=require('fs');var path=require(_0xed28('0x4'));var rimraf=require(_0xed28('0x5'));var config=require(_0xed28('0x6'));var attributes=require(_0xed28('0x7'));module[_0xed28('0x8')]=function(_0x594d16,_0x471f93){return _0x594d16[_0xed28('0x9')](_0xed28('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 93b6692..a03f93a 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 _0x614f=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message'];(function(_0xd8cfdb,_0x57ea8a){var _0x32b83d=function(_0x173629){while(--_0x173629){_0xd8cfdb['push'](_0xd8cfdb['shift']());}};_0x32b83d(++_0x57ea8a);}(_0x614f,0x1c5));var _0xf614=function(_0x37bc49,_0x48a894){_0x37bc49=_0x37bc49-0x0;var _0x49767a=_0x614f[_0x37bc49];return _0x49767a;};'use strict';var _=require(_0xf614('0x0'));var util=require(_0xf614('0x1'));var moment=require(_0xf614('0x2'));var BPromise=require(_0xf614('0x3'));var rs=require(_0xf614('0x4'));var fs=require('fs');var Redis=require(_0xf614('0x5'));var db=require(_0xf614('0x6'))['db'];var utils=require(_0xf614('0x7'));var logger=require(_0xf614('0x8'))(_0xf614('0x9'));var config=require(_0xf614('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf614('0xb')][_0xf614('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x127f7b,_0x550a9e,_0x557a64){return new BPromise(function(_0x19c677,_0x3d5333){return client['request'](_0x127f7b,_0x557a64)[_0xf614('0xd')](function(_0x36eb17){logger[_0xf614('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x550a9e,'request\x20sent');logger[_0xf614('0xf')](_0xf614('0x10'),_0x550a9e,'request\x20sent',JSON[_0xf614('0x11')](_0x36eb17));if(_0x36eb17[_0xf614('0x12')]){if(_0x36eb17[_0xf614('0x12')][_0xf614('0x13')]===0x1f4){logger[_0xf614('0x12')](_0xf614('0x14'),_0x550a9e,_0x36eb17[_0xf614('0x12')]['message']);return _0x3d5333(_0x36eb17[_0xf614('0x12')]['message']);}logger['error'](_0xf614('0x14'),_0x550a9e,_0x36eb17[_0xf614('0x12')][_0xf614('0x15')]);return _0x19c677(_0x36eb17[_0xf614('0x12')]['message']);}else{logger[_0xf614('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x550a9e,_0xf614('0x16'));_0x19c677(_0x36eb17[_0xf614('0x17')][_0xf614('0x15')]);}})[_0xf614('0x18')](function(_0x3f4ce1){logger['error'](_0xf614('0x14'),_0x550a9e,_0x3f4ce1);_0x3d5333(_0x3f4ce1);});});} \ No newline at end of file +var _0x6c32=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','error','code','message','result','catch','util','moment'];(function(_0x305a8a,_0x52b422){var _0x31e245=function(_0x4722c0){while(--_0x4722c0){_0x305a8a['push'](_0x305a8a['shift']());}};_0x31e245(++_0x52b422);}(_0x6c32,0xda));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x26c3('0x0'));var moment=require(_0x26c3('0x1'));var BPromise=require(_0x26c3('0x2'));var rs=require(_0x26c3('0x3'));var fs=require('fs');var Redis=require(_0x26c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x26c3('0x5'));var logger=require('../../config/logger')(_0x26c3('0x6'));var config=require(_0x26c3('0x7'));var jayson=require(_0x26c3('0x8'));var client=jayson[_0x26c3('0x9')][_0x26c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c3483,_0x1a3450,_0x42be62){return new BPromise(function(_0x452612,_0x4a8126){return client[_0x26c3('0xb')](_0x4c3483,_0x42be62)['then'](function(_0xb3294e){logger[_0x26c3('0xc')](_0x26c3('0xd'),_0x1a3450,'request\x20sent');logger[_0x26c3('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1a3450,'request\x20sent',JSON['stringify'](_0xb3294e));if(_0xb3294e['error']){if(_0xb3294e[_0x26c3('0xf')][_0x26c3('0x10')]===0x1f4){logger[_0x26c3('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x1a3450,_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);return _0x4a8126(_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);}logger[_0x26c3('0xf')](_0x26c3('0xd'),_0x1a3450,_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);return _0x452612(_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);}else{logger[_0x26c3('0xc')](_0x26c3('0xd'),_0x1a3450,'request\x20sent');_0x452612(_0xb3294e[_0x26c3('0x12')]['message']);}})[_0x26c3('0x13')](function(_0xb0af8){logger[_0x26c3('0xf')](_0x26c3('0xd'),_0x1a3450,_0xb0af8);_0x4a8126(_0xb0af8);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a78f0b9..06d6c50 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 _0x5d58=['/:id','isAuthenticated','show','create','update','delete','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x24c9b3,_0xcad610){var _0xc570f8=function(_0x530a3e){while(--_0x530a3e){_0x24c9b3['push'](_0x24c9b3['shift']());}};_0xc570f8(++_0xcad610);}(_0x5d58,0x187));var _0x85d5=function(_0x133117,_0xed49ea){_0x133117=_0x133117-0x0;var _0x566916=_0x5d58[_0x133117];return _0x566916;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./chatProactiveAction.controller');router[_0x85d5('0x4')](_0x85d5('0x5'),auth[_0x85d5('0x6')](),controller[_0x85d5('0x7')]);router['post']('/',auth[_0x85d5('0x6')](),controller[_0x85d5('0x8')]);router['put'](_0x85d5('0x5'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x5'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x4852bf,_0x56c4a0){var _0x205695=function(_0x307f9b){while(--_0x307f9b){_0x4852bf['push'](_0x4852bf['shift']());}};_0x205695(++_0x56c4a0);}(_0x032e,0x124));var _0xe032=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x032e[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 30bfc21..2134800 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 _0x694f=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x596b7c,_0x1d6e61){var _0x4816ac=function(_0x43a376){while(--_0x43a376){_0x596b7c['push'](_0x596b7c['shift']());}};_0x4816ac(++_0x1d6e61);}(_0x694f,0x1a1));var _0xf694=function(_0x5243db,_0x1cd37e){_0x5243db=_0x5243db-0x0;var _0x436ed9=_0x694f[_0x5243db];return _0x436ed9;};'use strict';var Sequelize=require(_0xf694('0x0'));module[_0xf694('0x1')]={'name':{'type':Sequelize[_0xf694('0x2')],'unique':_0xf694('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf694('0x2')]},'timeout':{'type':Sequelize[_0xf694('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf694('0x5')](_0xf694('0x6'),_0xf694('0x7'),_0xf694('0x8'))}}; \ No newline at end of file +var _0xf6b1=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x43ce33,_0x300b57){var _0x26f433=function(_0x2a473e){while(--_0x2a473e){_0x43ce33['push'](_0x43ce33['shift']());}};_0x26f433(++_0x300b57);}(_0xf6b1,0x1ae));var _0x1f6b=function(_0x24c803,_0xaf258c){_0x24c803=_0x24c803-0x0;var _0x59a954=_0xf6b1[_0x24c803];return _0x59a954;};'use strict';var Sequelize=require(_0x1f6b('0x0'));module[_0x1f6b('0x1')]={'name':{'type':Sequelize[_0x1f6b('0x2')],'unique':_0x1f6b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1f6b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1f6b('0x5')](_0x1f6b('0x6'),_0x1f6b('0x7'),_0x1f6b('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f2511ee..a407885 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 _0xc345=['forEach','userChatQueue:save','removeTeams','ids','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','all','union','value','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','destroy','then','UserProfileResource','name','send','map','ChatQueue','rawAttributes','type','getOptions','where','include','query','findAll','rows','catch','show','params','filters','intersection','attributes','model','fields','length','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','keys','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','addTeams','Team','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate'];(function(_0x41bdb7,_0x2d3c1c){var _0xa1e594=function(_0x4aa014){while(--_0x4aa014){_0x41bdb7['push'](_0x41bdb7['shift']());}};_0xa1e594(++_0x2d3c1c);}(_0xc345,0x190));var _0x5c34=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0xc345[_0xf97eb0];return _0xea70f4;};'use strict';var BPromise=require(_0x5c34('0x0'));var util=require(_0x5c34('0x1'));var _=require('lodash');var squel=require(_0x5c34('0x2'));var Redis=require('ioredis');var qs=require(_0x5c34('0x3'));var logger=require(_0x5c34('0x4'))(_0x5c34('0x5'));var config=require(_0x5c34('0x6'));var db=require(_0x5c34('0x7'))['db'];config['redis']=_[_0x5c34('0x8')](config[_0x5c34('0x9')],{'host':_0x5c34('0xa'),'port':0x18eb});var socket=require(_0x5c34('0xb'))(new Redis(config[_0x5c34('0x9')]));require('./chatQueue.socket')[_0x5c34('0xc')](socket);function respondWithStatusCode(_0x5554b0,_0xb48c06){_0xb48c06=_0xb48c06||0xcc;return function(_0x589320){if(_0x589320){return _0x5554b0[_0x5c34('0xd')](_0xb48c06);}return _0x5554b0['status'](_0xb48c06)[_0x5c34('0xe')]();};}function respondWithResult(_0x4a8fc8,_0x2c9721){_0x2c9721=_0x2c9721||0xc8;return function(_0x46054b){if(_0x46054b){return _0x4a8fc8[_0x5c34('0xf')](_0x2c9721)['json'](_0x46054b);}};}function respondWithFilteredResult(_0x5ee821,_0x57b1dd){return function(_0x25ae3f){if(_0x25ae3f){var _0x4c6be5=typeof _0x57b1dd[_0x5c34('0x10')]==='undefined'&&typeof _0x57b1dd[_0x5c34('0x11')]===_0x5c34('0x12');var _0x3bcb6a=_0x25ae3f[_0x5c34('0x13')];var _0x13ef6d=_0x4c6be5?0x0:_0x57b1dd[_0x5c34('0x10')];var _0x390558=_0x4c6be5?_0x25ae3f['count']:_0x57b1dd[_0x5c34('0x10')]+_0x57b1dd[_0x5c34('0x11')];var _0x57466c;if(_0x390558>=_0x3bcb6a){_0x390558=_0x3bcb6a;_0x57466c=0xc8;}else{_0x57466c=0xce;}_0x5ee821[_0x5c34('0xf')](_0x57466c);return _0x5ee821[_0x5c34('0x14')](_0x5c34('0x15'),_0x13ef6d+'-'+_0x390558+'/'+_0x3bcb6a)[_0x5c34('0x16')](_0x25ae3f);}return null;};}function saveUpdates(_0x1d0c8b){return function(_0x32b53c){if(_0x32b53c){return _0x32b53c['update'](_0x1d0c8b)['then'](function(_0x3a469a){return _0x3a469a;});}return null;};}function removeEntity(_0x395b8e){return function(_0x190cf3){if(_0x190cf3){return _0x190cf3[_0x5c34('0x17')]()[_0x5c34('0x18')](function(){var _0x5f9f8a=_0x190cf3['get']({'plain':!![]});var _0x3ab59d='ChatQueues';return db[_0x5c34('0x19')][_0x5c34('0x17')]({'where':{'type':_0x3ab59d,'resourceId':_0x5f9f8a['id']}})[_0x5c34('0x18')](function(){return _0x190cf3;});})['then'](function(){_0x395b8e[_0x5c34('0xf')](0xcc)[_0x5c34('0xe')]();});}};}function handleEntityNotFound(_0x2f92d6){return function(_0xea5423){if(!_0xea5423){_0x2f92d6[_0x5c34('0xd')](0x194);}return _0xea5423;};}function handleError(_0x7e1276,_0x52665a){_0x52665a=_0x52665a||0x1f4;return function(_0x337c20){logger['error'](_0x337c20['stack']);if(_0x337c20[_0x5c34('0x1a')]){delete _0x337c20[_0x5c34('0x1a')];}_0x7e1276[_0x5c34('0xf')](_0x52665a)[_0x5c34('0x1b')](_0x337c20);};}exports['index']=function(_0x428d63,_0x3801f1){var _0x3905c9={};var _0x3f7570={'count':0x0,'rows':[]};var _0x4a7b8c=_[_0x5c34('0x1c')](db[_0x5c34('0x1d')][_0x5c34('0x1e')],function(_0x12537b){return{'name':_0x12537b['fieldName'],'type':_0x12537b[_0x5c34('0x1f')]['key']};});_0x3905c9=qs[_0x5c34('0x20')](_0x4a7b8c,_0x428d63);var _0x1db41c={'where':_0x3905c9[_0x5c34('0x21')]};return db[_0x5c34('0x1d')]['count'](_0x1db41c)['then'](function(_0x53494c){_0x3f7570[_0x5c34('0x13')]=_0x53494c;_0x3905c9[_0x5c34('0x22')]=qs[_0x5c34('0x22')](_0x428d63[_0x5c34('0x23')]);return db['ChatQueue'][_0x5c34('0x24')](_0x3905c9);})['then'](function(_0x16704c){_0x3f7570[_0x5c34('0x25')]=_0x16704c;return _0x3f7570;})[_0x5c34('0x18')](respondWithFilteredResult(_0x3801f1,_0x3905c9))[_0x5c34('0x26')](handleError(_0x3801f1,null));};exports[_0x5c34('0x27')]=function(_0x122b63,_0x1865bd){var _0x5f3b28={'raw':!![],'where':{'id':_0x122b63[_0x5c34('0x28')]['id']}},_0x5a4721={};_0x5a4721['model']=_['keys'](db['ChatQueue']['rawAttributes']);_0x5a4721[_0x5c34('0x23')]=_['keys'](_0x122b63[_0x5c34('0x23')]);_0x5a4721[_0x5c34('0x29')]=_[_0x5c34('0x2a')](_0x5a4721['model'],_0x5a4721[_0x5c34('0x23')]);_0x5f3b28[_0x5c34('0x2b')]=_[_0x5c34('0x2a')](_0x5a4721[_0x5c34('0x2c')],qs['fields'](_0x122b63['query'][_0x5c34('0x2d')]));_0x5f3b28['attributes']=_0x5f3b28[_0x5c34('0x2b')][_0x5c34('0x2e')]?_0x5f3b28['attributes']:_0x5a4721[_0x5c34('0x2c')];if(_0x122b63[_0x5c34('0x23')][_0x5c34('0x2f')]){_0x5f3b28[_0x5c34('0x22')]=[{'all':!![]}];}_0x5f3b28=_[_0x5c34('0x30')]({},_0x5f3b28,_0x122b63[_0x5c34('0x31')]);return db[_0x5c34('0x1d')][_0x5c34('0x32')](_0x5f3b28)[_0x5c34('0x18')](handleEntityNotFound(_0x1865bd,null))[_0x5c34('0x18')](respondWithResult(_0x1865bd,null))[_0x5c34('0x26')](handleError(_0x1865bd,null));};exports[_0x5c34('0x33')]=function(_0x4efcd4,_0x4ce5b4){return db['ChatQueue'][_0x5c34('0x33')](_0x4efcd4[_0x5c34('0x34')],{})['then'](function(_0x483148){var _0x3a44ce=_0x4efcd4[_0x5c34('0x35')][_0x5c34('0x36')]({'plain':!![]});if(!_0x3a44ce)throw new Error(_0x5c34('0x37'));if(_0x3a44ce[_0x5c34('0x38')]===_0x5c34('0x35')){var _0x54cc0e=_0x483148[_0x5c34('0x36')]({'plain':!![]});var _0xd8ef6c=_0x5c34('0x39');return db[_0x5c34('0x3a')][_0x5c34('0x32')]({'where':{'name':_0xd8ef6c,'userProfileId':_0x3a44ce[_0x5c34('0x3b')]},'raw':!![]})[_0x5c34('0x18')](function(_0x4fa203){if(_0x4fa203&&_0x4fa203[_0x5c34('0x3c')]===0x0){return db[_0x5c34('0x19')][_0x5c34('0x33')]({'name':_0x54cc0e['name'],'resourceId':_0x54cc0e['id'],'type':_0x4fa203[_0x5c34('0x1a')],'sectionId':_0x4fa203['id']},{})[_0x5c34('0x18')](function(){return _0x483148;});}else{return _0x483148;}})['catch'](function(_0x505a62){logger[_0x5c34('0x3d')](_0x5c34('0x3e'),_0x505a62);throw _0x505a62;});}return _0x483148;})[_0x5c34('0x18')](respondWithResult(_0x4ce5b4,0xc9))['catch'](handleError(_0x4ce5b4,null));};exports[_0x5c34('0x3f')]=function(_0x423024,_0x334733){if(_0x423024[_0x5c34('0x34')]['id']){delete _0x423024[_0x5c34('0x34')]['id'];}return db[_0x5c34('0x1d')][_0x5c34('0x32')]({'where':{'id':_0x423024['params']['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x334733,null))[_0x5c34('0x18')](saveUpdates(_0x423024['body'],null))[_0x5c34('0x18')](respondWithResult(_0x334733,null))[_0x5c34('0x26')](handleError(_0x334733,null));};exports['destroy']=function(_0x1056b5,_0x138bd4){return db[_0x5c34('0x1d')]['find']({'where':{'id':_0x1056b5[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x138bd4,null))[_0x5c34('0x18')](removeEntity(_0x138bd4,null))['catch'](handleError(_0x138bd4,null));};exports[_0x5c34('0x40')]=function(_0x3a7eca,_0x471fa6){return db[_0x5c34('0x1d')][_0x5c34('0x40')]()[_0x5c34('0x18')](respondWithResult(_0x471fa6,null))[_0x5c34('0x26')](handleError(_0x471fa6,null));};exports[_0x5c34('0x41')]=function(_0x5e2e77,_0x5cebfc){var _0x4dd331={'raw':!![],'where':{}},_0xb3bd14={},_0x3106ef;return db[_0x5c34('0x1d')][_0x5c34('0x42')]({'where':{'id':_0x5e2e77['params']['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x5cebfc,null))[_0x5c34('0x18')](function(_0x20c547){if(_0x20c547){_0x3106ef=_0x20c547['get']({'plain':!![]});_0xb3bd14[_0x5c34('0x2c')]=_[_0x5c34('0x43')](db[_0x5c34('0x44')][_0x5c34('0x1e')]);_0xb3bd14[_0x5c34('0x23')]=_['keys'](_0x5e2e77[_0x5c34('0x23')]);_0xb3bd14[_0x5c34('0x29')]=_[_0x5c34('0x2a')](_0xb3bd14[_0x5c34('0x2c')],_0xb3bd14[_0x5c34('0x23')]);_0x4dd331['attributes']=_[_0x5c34('0x2a')](_0xb3bd14[_0x5c34('0x2c')],qs[_0x5c34('0x2d')](_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x2d')]));_0x4dd331['attributes']=_0x4dd331[_0x5c34('0x2b')][_0x5c34('0x2e')]?_0x4dd331[_0x5c34('0x2b')]:_0xb3bd14[_0x5c34('0x2c')];if(!_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x45')](_0x5c34('0x46'))){_0x4dd331['limit']=qs['limit'](_0x5e2e77[_0x5c34('0x23')]['limit']);_0x4dd331[_0x5c34('0x10')]=qs[_0x5c34('0x10')](_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x10')]);}_0x4dd331[_0x5c34('0x47')]=qs['sort'](_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x48')]);_0x4dd331[_0x5c34('0x21')]=qs[_0x5c34('0x29')](_[_0x5c34('0x49')](_0x5e2e77[_0x5c34('0x23')],_0xb3bd14[_0x5c34('0x29')]));_0x4dd331['where'][_0x5c34('0x4a')]=_0x20c547['id'];if(_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x4b')]){_0x4dd331[_0x5c34('0x21')]=_[_0x5c34('0x30')](_0x4dd331[_0x5c34('0x21')],{'$or':_['map'](_0x4dd331[_0x5c34('0x2b')],function(_0x205781){var _0xca7636={};_0xca7636[_0x205781]={'$like':'%'+_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x4b')]+'%'};return _0xca7636;})});}_0x4dd331=_[_0x5c34('0x30')]({},_0x4dd331,_0x5e2e77['options']);return db['UserChatQueue'][_0x5c34('0x24')](_0x4dd331);}})[_0x5c34('0x18')](function(_0x561586){if(_0x561586){return db[_0x5c34('0x4c')][_0x5c34('0x4d')]({'where':{'id':_[_0x5c34('0x1c')](_0x561586,_0x5c34('0x4e')),'role':_0x5c34('0x4f')},'attributes':['id',_0x5c34('0x1a'),_0x5c34('0x50'),_0x5c34('0x51'),'createdAt']});}})[_0x5c34('0x18')](function(_0x345933){if(_0x345933){return{'count':_0x345933[_0x5c34('0x13')],'rows':_[_0x5c34('0x1c')](_0x345933[_0x5c34('0x25')],function(_0x5c5c21){return{'membername':_0x5c5c21[_0x5c34('0x1a')],'UserId':_0x5c5c21['id'],'queue_name':_0x3106ef['name'],'ChatQueueId':_0x3106ef['id'],'interface':util[_0x5c34('0x52')]('%s/%s',_0x5c34('0x53'),_0x5c5c21[_0x5c34('0x1a')]),'penalty':0x0,'paused':_0x5c5c21[_0x5c34('0x50')],'createdAt':_0x5c5c21[_0x5c34('0x54')],'updatedAt':_0x5c5c21[_0x5c34('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c34('0x18')](respondWithFilteredResult(_0x5cebfc,_0x4dd331))[_0x5c34('0x26')](handleError(_0x5cebfc,null));};exports[_0x5c34('0x55')]=function(_0x5b32f4,_0x485000){var _0x55e065={};var _0x58b317={};var _0x5af40e;var _0x589128;return db[_0x5c34('0x1d')][_0x5c34('0x42')]({'where':{'id':_0x5b32f4[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x485000,null))['then'](function(_0x2a8d8f){if(_0x2a8d8f){_0x5af40e=_0x2a8d8f;_0x58b317[_0x5c34('0x2c')]=_[_0x5c34('0x43')](db['Team'][_0x5c34('0x1e')]);_0x58b317[_0x5c34('0x23')]=_[_0x5c34('0x43')](_0x5b32f4[_0x5c34('0x23')]);_0x58b317['filters']=_[_0x5c34('0x2a')](_0x58b317['model'],_0x58b317['query']);_0x55e065[_0x5c34('0x2b')]=_[_0x5c34('0x2a')](_0x58b317[_0x5c34('0x2c')],qs['fields'](_0x5b32f4['query'][_0x5c34('0x2d')]));_0x55e065['attributes']=_0x55e065[_0x5c34('0x2b')][_0x5c34('0x2e')]?_0x55e065[_0x5c34('0x2b')]:_0x58b317[_0x5c34('0x2c')];_0x55e065['order']=qs['sort'](_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x48')]);_0x55e065[_0x5c34('0x21')]=qs[_0x5c34('0x29')](_[_0x5c34('0x49')](_0x5b32f4[_0x5c34('0x23')],_0x58b317[_0x5c34('0x29')]));if(_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x4b')]){_0x55e065['where']=_[_0x5c34('0x30')](_0x55e065['where'],{'$or':_[_0x5c34('0x1c')](_0x55e065[_0x5c34('0x2b')],function(_0x19b048){var _0x25a0ae={};_0x25a0ae[_0x19b048]={'$like':'%'+_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x4b')]+'%'};return _0x25a0ae;})});}_0x55e065=_['merge']({},_0x55e065,_0x5b32f4[_0x5c34('0x31')]);return _0x5af40e['getTeams'](_0x55e065);}})[_0x5c34('0x18')](function(_0x14cf16){if(_0x14cf16){_0x589128=_0x14cf16[_0x5c34('0x2e')];if(!_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x45')]('nolimit')){_0x55e065[_0x5c34('0x11')]=qs[_0x5c34('0x11')](_0x5b32f4['query'][_0x5c34('0x11')]);_0x55e065[_0x5c34('0x10')]=qs[_0x5c34('0x10')](_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x10')]);}return _0x5af40e[_0x5c34('0x55')](_0x55e065);}})['then'](function(_0x55b410){if(_0x55b410){return _0x55b410?{'count':_0x589128,'rows':_0x55b410}:null;}})['then'](respondWithResult(_0x485000,null))[_0x5c34('0x26')](handleError(_0x485000,null));};exports[_0x5c34('0x56')]=function(_0x59166e,_0x457f90){var _0x20c16f=_0x59166e['body']['ids'];return db[_0x5c34('0x57')]['findAll']({'where':{'id':_0x20c16f},'attributes':['id'],'include':[{'model':db[_0x5c34('0x4c')],'as':'Agents','attributes':['id',_0x5c34('0x1a'),'online',_0x5c34('0x58'),_0x5c34('0x59')],'raw':!![]}]})[_0x5c34('0x18')](function(_0x529f8a){if(_0x529f8a){var _0x12fefd=_[_0x5c34('0x5a')](_0x529f8a,function(_0x40317d){var _0x489a85=_0x40317d[_0x5c34('0x36')]({'plain':!![]});return _0x489a85[_0x5c34('0x5b')];});return db['ChatQueue']['find']({'where':{'id':_0x59166e['params']['id']}})['then'](function(_0x54adbd){return db[_0x5c34('0x5c')][_0x5c34('0x5d')](function(_0x421921){return _0x54adbd[_0x5c34('0x56')](_0x20c16f,{'transaction':_0x421921})[_0x5c34('0x18')](function(){return BPromise[_0x5c34('0x5e')](_0x12fefd,function(_0x234944){return db[_0x5c34('0x44')][_0x5c34('0x5f')]({'where':{'UserId':_0x234944['id'],'ChatQueueId':_0x59166e[_0x5c34('0x28')]['id']},'transaction':_0x421921});});})[_0x5c34('0x18')](function(){_0x12fefd[_0x5c34('0x60')](function(_0x22d323){socket['emit'](_0x5c34('0x61'),{'UserId':_0x22d323['id'],'ChatQueueId':_0x54adbd['id']});});});});});}})[_0x5c34('0x18')](respondWithStatusCode(_0x457f90,null))[_0x5c34('0x26')](handleError(_0x457f90,null));};exports[_0x5c34('0x62')]=function(_0x50a783,_0x2fd187){return db[_0x5c34('0x57')][_0x5c34('0x24')]({'where':{'id':_0x50a783[_0x5c34('0x23')][_0x5c34('0x63')]},'attributes':['id'],'include':[{'model':db[_0x5c34('0x4c')],'as':_0x5c34('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x5c34('0x18')](handleEntityNotFound(_0x2fd187,null))[_0x5c34('0x18')](function(_0x59845d){var _0x35f14c=_[_0x5c34('0x1c')](_0x59845d,'id');var _0x5a079b=[];var _0x43ad93=[];var _0x109fb5=squel[_0x5c34('0x64')]();_0x109fb5[_0x5c34('0x65')]('tq.TeamId')[_0x5c34('0x66')](_0x5c34('0x67'),'tq')[_0x5c34('0x68')](_0x5c34('0x69'),'ut',_0x5c34('0x6a'))[_0x5c34('0x21')](_0x5c34('0x6b'),_0x50a783[_0x5c34('0x28')]['id']);for(var _0x3b6d2a=0x0;_0x3b6d2a<_0x59845d[_0x5c34('0x2e')];_0x3b6d2a+=0x1){let _0x3108f5=_0x59845d[_0x3b6d2a];for(var _0xce9f32=0x0;_0xce9f32<_0x3108f5[_0x5c34('0x5b')]['length'];_0xce9f32+=0x1){let _0x381439=_0x3108f5[_0x5c34('0x5b')][_0xce9f32];var _0x31f58b=_0x109fb5['clone']();_0x31f58b['where'](_0x5c34('0x6c'),_0x381439['id']);_0x43ad93[_0x5c34('0x6d')](db[_0x5c34('0x5c')][_0x5c34('0x23')](_0x31f58b[_0x5c34('0x6e')](),{'type':db['sequelize'][_0x5c34('0x6f')][_0x5c34('0x70')]})[_0x5c34('0x18')](function(_0x5dd622){if(_0x5dd622[_0x5c34('0x2e')]===0x1){return _0x381439['id'];}else{var _0x17ae92=_['every'](_[_0x5c34('0x1c')](_0x5dd622,'TeamId'),function(_0xa47491){return _['includes'](_0x35f14c,_0xa47491);});if(_0x17ae92){return _0x381439['id'];}}}));}}return BPromise[_0x5c34('0x71')](_0x43ad93)[_0x5c34('0x18')](function(_0x279a26){_0x5a079b=_(_0x5a079b)[_0x5c34('0x72')](_0x279a26)['compact']()[_0x5c34('0x73')]();return db[_0x5c34('0x1d')][_0x5c34('0x32')]({'where':{'id':_0x50a783['params']['id']}})[_0x5c34('0x18')](function(_0x584e0a){return db[_0x5c34('0x5c')][_0x5c34('0x5d')](function(_0x1ae9ea){return _0x584e0a[_0x5c34('0x62')](_0x50a783[_0x5c34('0x23')][_0x5c34('0x63')],{'transaction':_0x1ae9ea})['then'](function(){if(!_['isEmpty'](_0x5a079b)){return _0x584e0a[_0x5c34('0x74')](_0x5a079b,{'transaction':_0x1ae9ea});}})[_0x5c34('0x18')](function(){_0x5a079b['forEach'](function(_0x1d8872){socket[_0x5c34('0x75')](_0x5c34('0x76'),{'UserId':_0x1d8872,'ChatQueueId':_0x584e0a['id']});});});});});});})['then'](respondWithStatusCode(_0x2fd187,null))[_0x5c34('0x26')](handleError(_0x2fd187,null));};exports['addAgents']=function(_0x8f3380,_0x2fe01a){return db[_0x5c34('0x1d')][_0x5c34('0x32')]({'where':{'id':_0x8f3380[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x2fe01a,null))[_0x5c34('0x18')](function(_0x533eb5){if(_0x533eb5){return _0x533eb5[_0x5c34('0x77')](_0x8f3380[_0x5c34('0x34')][_0x5c34('0x63')],_[_0x5c34('0x78')](_0x8f3380[_0x5c34('0x34')],[_0x5c34('0x63'),'id'])||{})[_0x5c34('0x79')](function(_0x3f5953){for(var _0x3401ce=0x0;_0x3401ce<_0x8f3380[_0x5c34('0x34')][_0x5c34('0x63')][_0x5c34('0x2e')];_0x3401ce+=0x1){socket[_0x5c34('0x75')](_0x5c34('0x61'),{'UserId':Number(_0x8f3380[_0x5c34('0x34')]['ids'][_0x3401ce]),'ChatQueueId':Number(_0x8f3380[_0x5c34('0x28')]['id'])});}return _0x3f5953;});}})[_0x5c34('0x18')](respondWithResult(_0x2fe01a,null))[_0x5c34('0x26')](handleError(_0x2fe01a,null));};exports[_0x5c34('0x74')]=function(_0x9355dd,_0x5e563c){return db['ChatQueue'][_0x5c34('0x32')]({'where':{'id':_0x9355dd[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x5e563c,null))['then'](function(_0x5cd3a7){if(_0x5cd3a7){return _0x5cd3a7[_0x5c34('0x74')](_0x9355dd[_0x5c34('0x23')]['ids'])['then'](function(){if(_[_0x5c34('0x7a')](_0x9355dd[_0x5c34('0x23')]['ids'])){for(var _0x4da249=0x0;_0x4da249<_0x9355dd[_0x5c34('0x23')]['ids'][_0x5c34('0x2e')];_0x4da249+=0x1){socket[_0x5c34('0x75')](_0x5c34('0x76'),{'UserId':Number(_0x9355dd[_0x5c34('0x23')][_0x5c34('0x63')][_0x4da249]),'ChatQueueId':Number(_0x9355dd['params']['id'])});}}else{socket[_0x5c34('0x75')]('userChatQueue:remove',{'UserId':Number(_0x9355dd['query'][_0x5c34('0x63')]),'ChatQueueId':Number(_0x9355dd[_0x5c34('0x28')]['id'])});}});}})[_0x5c34('0x18')](respondWithStatusCode(_0x5e563c,null))[_0x5c34('0x26')](handleError(_0x5e563c,null));};exports[_0x5c34('0x7b')]=function(_0x4c7ec5,_0x144579){var _0x1c7125={};var _0x2a1454={};var _0x17ca7d;var _0xc6f01d;return db[_0x5c34('0x1d')][_0x5c34('0x42')]({'where':{'id':_0x4c7ec5[_0x5c34('0x28')]['id']}})['then'](handleEntityNotFound(_0x144579,null))[_0x5c34('0x18')](function(_0x453f05){if(_0x453f05){_0x17ca7d=_0x453f05;_0x2a1454[_0x5c34('0x2c')]=_[_0x5c34('0x43')](db[_0x5c34('0x4c')]['rawAttributes']);_0x2a1454[_0x5c34('0x23')]=_[_0x5c34('0x43')](_0x4c7ec5[_0x5c34('0x23')]);_0x2a1454[_0x5c34('0x29')]=_[_0x5c34('0x2a')](_0x2a1454['model'],_0x2a1454[_0x5c34('0x23')]);_0x1c7125[_0x5c34('0x2b')]=_[_0x5c34('0x2a')](_0x2a1454['model'],qs[_0x5c34('0x2d')](_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x2d')]));_0x1c7125[_0x5c34('0x2b')]=_0x1c7125['attributes'][_0x5c34('0x2e')]?_0x1c7125['attributes']:_0x2a1454[_0x5c34('0x2c')];_0x1c7125[_0x5c34('0x47')]=qs[_0x5c34('0x48')](_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x48')]);_0x1c7125['where']=qs['filters'](_[_0x5c34('0x49')](_0x4c7ec5[_0x5c34('0x23')],_0x2a1454[_0x5c34('0x29')]));if(_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x4b')]){_0x1c7125['where']=_[_0x5c34('0x30')](_0x1c7125['where'],{'$or':_['map'](_0x1c7125['attributes'],function(_0x4eb074){var _0x2713cd={};_0x2713cd[_0x4eb074]={'$like':'%'+_0x4c7ec5[_0x5c34('0x23')]['filter']+'%'};return _0x2713cd;})});}_0x1c7125=_['merge']({},_0x1c7125,_0x4c7ec5['options']);return _0x17ca7d[_0x5c34('0x7b')](_0x1c7125);}})[_0x5c34('0x18')](function(_0x47fa0e){if(_0x47fa0e){_0xc6f01d=_0x47fa0e[_0x5c34('0x2e')];if(!_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x45')](_0x5c34('0x46'))){_0x1c7125[_0x5c34('0x11')]=qs[_0x5c34('0x11')](_0x4c7ec5[_0x5c34('0x23')]['limit']);_0x1c7125[_0x5c34('0x10')]=qs[_0x5c34('0x10')](_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x10')]);}return _0x17ca7d[_0x5c34('0x7b')](_0x1c7125);}})[_0x5c34('0x18')](function(_0x581e82){if(_0x581e82){return _0x581e82?{'count':_0xc6f01d,'rows':_0x581e82}:null;}})['then'](respondWithResult(_0x144579,null))[_0x5c34('0x26')](handleError(_0x144579,null));}; \ No newline at end of file +var _0x115a=['spread','emit','userChatQueue:save','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','then','ChatQueues','UserProfileResource','end','error','name','send','ChatQueue','fieldName','type','key','getOptions','include','rows','catch','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','create','body','user','role','UserProfileSection','describe','findOne','get','UserChatQueue','hasOwnProperty','order','sort','where','ChatQueueId','filter','map','options','findAll','User','findAndCountAll','agent','updatedAt','format','%s/%s','chatPause','Team','pick','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','every','TeamId','includes','union','compact','value','find','isEmpty','removeAgents','userChatQueue:remove','addAgents'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0x115a,0x1d1));var _0xa115=function(_0x3a5e13,_0x3b89c6){_0x3a5e13=_0x3a5e13-0x0;var _0xe67c37=_0x115a[_0x3a5e13];return _0xe67c37;};'use strict';var BPromise=require(_0xa115('0x0'));var util=require(_0xa115('0x1'));var _=require(_0xa115('0x2'));var squel=require(_0xa115('0x3'));var Redis=require('ioredis');var qs=require(_0xa115('0x4'));var logger=require(_0xa115('0x5'))('api');var config=require('../../config/environment');var db=require(_0xa115('0x6'))['db'];config[_0xa115('0x7')]=_['defaults'](config['redis'],{'host':_0xa115('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa115('0x7')]));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x51440b,_0x24a5ba){_0x24a5ba=_0x24a5ba||0xcc;return function(_0x3fd2a2){if(_0x3fd2a2){return _0x51440b[_0xa115('0x9')](_0x24a5ba);}return _0x51440b[_0xa115('0xa')](_0x24a5ba)['end']();};}function respondWithResult(_0x225b46,_0x40e14d){_0x40e14d=_0x40e14d||0xc8;return function(_0x35b61c){if(_0x35b61c){return _0x225b46['status'](_0x40e14d)['json'](_0x35b61c);}};}function respondWithFilteredResult(_0x2b6441,_0x27864e){return function(_0x60f9b){if(_0x60f9b){var _0x4e0660=typeof _0x27864e[_0xa115('0xb')]==='undefined'&&typeof _0x27864e['limit']===_0xa115('0xc');var _0x4ffe54=_0x60f9b[_0xa115('0xd')];var _0x46e550=_0x4e0660?0x0:_0x27864e['offset'];var _0x2d1432=_0x4e0660?_0x60f9b[_0xa115('0xd')]:_0x27864e[_0xa115('0xb')]+_0x27864e[_0xa115('0xe')];var _0x41a46f;if(_0x2d1432>=_0x4ffe54){_0x2d1432=_0x4ffe54;_0x41a46f=0xc8;}else{_0x41a46f=0xce;}_0x2b6441[_0xa115('0xa')](_0x41a46f);return _0x2b6441[_0xa115('0xf')](_0xa115('0x10'),_0x46e550+'-'+_0x2d1432+'/'+_0x4ffe54)[_0xa115('0x11')](_0x60f9b);}return null;};}function saveUpdates(_0x2d07fd){return function(_0x3c58f1){if(_0x3c58f1){return _0x3c58f1[_0xa115('0x12')](_0x2d07fd)['then'](function(_0x26d328){return _0x26d328;});}return null;};}function removeEntity(_0x86fed3){return function(_0x183e6e){if(_0x183e6e){return _0x183e6e[_0xa115('0x13')]()[_0xa115('0x14')](function(){var _0x3514ac=_0x183e6e['get']({'plain':!![]});var _0x2d2bf5=_0xa115('0x15');return db[_0xa115('0x16')]['destroy']({'where':{'type':_0x2d2bf5,'resourceId':_0x3514ac['id']}})[_0xa115('0x14')](function(){return _0x183e6e;});})[_0xa115('0x14')](function(){_0x86fed3[_0xa115('0xa')](0xcc)[_0xa115('0x17')]();});}};}function handleEntityNotFound(_0x504d7c){return function(_0x3a620a){if(!_0x3a620a){_0x504d7c[_0xa115('0x9')](0x194);}return _0x3a620a;};}function handleError(_0x54a4ad,_0x28593d){_0x28593d=_0x28593d||0x1f4;return function(_0x3c679f){logger[_0xa115('0x18')](_0x3c679f['stack']);if(_0x3c679f[_0xa115('0x19')]){delete _0x3c679f[_0xa115('0x19')];}_0x54a4ad[_0xa115('0xa')](_0x28593d)[_0xa115('0x1a')](_0x3c679f);};}exports['index']=function(_0x12415e,_0x40f0cf){var _0x452cd3={};var _0x41eec1={'count':0x0,'rows':[]};var _0x51a666=_['map'](db[_0xa115('0x1b')]['rawAttributes'],function(_0x4c977b){return{'name':_0x4c977b[_0xa115('0x1c')],'type':_0x4c977b[_0xa115('0x1d')][_0xa115('0x1e')]};});_0x452cd3=qs[_0xa115('0x1f')](_0x51a666,_0x12415e);var _0x1b1eca={'where':_0x452cd3['where']};return db[_0xa115('0x1b')]['count'](_0x1b1eca)[_0xa115('0x14')](function(_0x1d2d73){_0x41eec1['count']=_0x1d2d73;_0x452cd3[_0xa115('0x20')]=qs['include'](_0x12415e['query']);return db[_0xa115('0x1b')]['findAll'](_0x452cd3);})[_0xa115('0x14')](function(_0xd95335){_0x41eec1[_0xa115('0x21')]=_0xd95335;return _0x41eec1;})[_0xa115('0x14')](respondWithFilteredResult(_0x40f0cf,_0x452cd3))[_0xa115('0x22')](handleError(_0x40f0cf,null));};exports[_0xa115('0x23')]=function(_0x52794a,_0x407bf3){var _0x62d4e4={'raw':!![],'where':{'id':_0x52794a[_0xa115('0x24')]['id']}},_0x3f45e6={};_0x3f45e6[_0xa115('0x25')]=_[_0xa115('0x26')](db[_0xa115('0x1b')][_0xa115('0x27')]);_0x3f45e6[_0xa115('0x28')]=_[_0xa115('0x26')](_0x52794a['query']);_0x3f45e6[_0xa115('0x29')]=_[_0xa115('0x2a')](_0x3f45e6[_0xa115('0x25')],_0x3f45e6[_0xa115('0x28')]);_0x62d4e4[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0x3f45e6[_0xa115('0x25')],qs[_0xa115('0x2c')](_0x52794a[_0xa115('0x28')][_0xa115('0x2c')]));_0x62d4e4[_0xa115('0x2b')]=_0x62d4e4[_0xa115('0x2b')][_0xa115('0x2d')]?_0x62d4e4[_0xa115('0x2b')]:_0x3f45e6[_0xa115('0x25')];if(_0x52794a[_0xa115('0x28')]['includeAll']){_0x62d4e4[_0xa115('0x20')]=[{'all':!![]}];}_0x62d4e4=_[_0xa115('0x2e')]({},_0x62d4e4,_0x52794a['options']);return db[_0xa115('0x1b')]['find'](_0x62d4e4)[_0xa115('0x14')](handleEntityNotFound(_0x407bf3,null))[_0xa115('0x14')](respondWithResult(_0x407bf3,null))[_0xa115('0x22')](handleError(_0x407bf3,null));};exports[_0xa115('0x2f')]=function(_0x14f525,_0x11153d){return db['ChatQueue']['create'](_0x14f525[_0xa115('0x30')],{})[_0xa115('0x14')](function(_0x385d7b){var _0x243426=_0x14f525[_0xa115('0x31')]['get']({'plain':!![]});if(!_0x243426)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x243426[_0xa115('0x32')]===_0xa115('0x31')){var _0x241c74=_0x385d7b['get']({'plain':!![]});var _0x259d71='ChatQueues';return db[_0xa115('0x33')]['find']({'where':{'name':_0x259d71,'userProfileId':_0x243426['userProfileId']},'raw':!![]})[_0xa115('0x14')](function(_0x19a16b){if(_0x19a16b&&_0x19a16b['autoAssociation']===0x0){return db['UserProfileResource'][_0xa115('0x2f')]({'name':_0x241c74[_0xa115('0x19')],'resourceId':_0x241c74['id'],'type':_0x19a16b[_0xa115('0x19')],'sectionId':_0x19a16b['id']},{})[_0xa115('0x14')](function(){return _0x385d7b;});}else{return _0x385d7b;}})[_0xa115('0x22')](function(_0x465b5d){logger[_0xa115('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x465b5d);throw _0x465b5d;});}return _0x385d7b;})[_0xa115('0x14')](respondWithResult(_0x11153d,0xc9))[_0xa115('0x22')](handleError(_0x11153d,null));};exports[_0xa115('0x12')]=function(_0x136dc4,_0xe430d6){if(_0x136dc4[_0xa115('0x30')]['id']){delete _0x136dc4['body']['id'];}return db[_0xa115('0x1b')]['find']({'where':{'id':_0x136dc4[_0xa115('0x24')]['id']}})[_0xa115('0x14')](handleEntityNotFound(_0xe430d6,null))[_0xa115('0x14')](saveUpdates(_0x136dc4[_0xa115('0x30')],null))[_0xa115('0x14')](respondWithResult(_0xe430d6,null))[_0xa115('0x22')](handleError(_0xe430d6,null));};exports[_0xa115('0x13')]=function(_0x3b65c8,_0x5aa5ef){return db[_0xa115('0x1b')]['find']({'where':{'id':_0x3b65c8[_0xa115('0x24')]['id']}})[_0xa115('0x14')](handleEntityNotFound(_0x5aa5ef,null))[_0xa115('0x14')](removeEntity(_0x5aa5ef,null))[_0xa115('0x22')](handleError(_0x5aa5ef,null));};exports[_0xa115('0x34')]=function(_0x427663,_0x5b74ce){return db[_0xa115('0x1b')][_0xa115('0x34')]()[_0xa115('0x14')](respondWithResult(_0x5b74ce,null))[_0xa115('0x22')](handleError(_0x5b74ce,null));};exports['getMembers']=function(_0x113bc9,_0xdc88f9){var _0x4cff11={'raw':!![],'where':{}},_0x425e94={},_0x1c4080;return db[_0xa115('0x1b')][_0xa115('0x35')]({'where':{'id':_0x113bc9[_0xa115('0x24')]['id']}})[_0xa115('0x14')](handleEntityNotFound(_0xdc88f9,null))[_0xa115('0x14')](function(_0x51940b){if(_0x51940b){_0x1c4080=_0x51940b[_0xa115('0x36')]({'plain':!![]});_0x425e94[_0xa115('0x25')]=_[_0xa115('0x26')](db[_0xa115('0x37')][_0xa115('0x27')]);_0x425e94['query']=_[_0xa115('0x26')](_0x113bc9['query']);_0x425e94[_0xa115('0x29')]=_['intersection'](_0x425e94[_0xa115('0x25')],_0x425e94[_0xa115('0x28')]);_0x4cff11[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0x425e94['model'],qs[_0xa115('0x2c')](_0x113bc9['query'][_0xa115('0x2c')]));_0x4cff11['attributes']=_0x4cff11[_0xa115('0x2b')][_0xa115('0x2d')]?_0x4cff11[_0xa115('0x2b')]:_0x425e94[_0xa115('0x25')];if(!_0x113bc9[_0xa115('0x28')][_0xa115('0x38')]('nolimit')){_0x4cff11[_0xa115('0xe')]=qs[_0xa115('0xe')](_0x113bc9[_0xa115('0x28')][_0xa115('0xe')]);_0x4cff11['offset']=qs[_0xa115('0xb')](_0x113bc9[_0xa115('0x28')]['offset']);}_0x4cff11[_0xa115('0x39')]=qs[_0xa115('0x3a')](_0x113bc9['query']['sort']);_0x4cff11['where']=qs['filters'](_['pick'](_0x113bc9[_0xa115('0x28')],_0x425e94[_0xa115('0x29')]));_0x4cff11[_0xa115('0x3b')][_0xa115('0x3c')]=_0x51940b['id'];if(_0x113bc9[_0xa115('0x28')][_0xa115('0x3d')]){_0x4cff11[_0xa115('0x3b')]=_[_0xa115('0x2e')](_0x4cff11[_0xa115('0x3b')],{'$or':_[_0xa115('0x3e')](_0x4cff11[_0xa115('0x2b')],function(_0x267e6b){var _0x3fd5c3={};_0x3fd5c3[_0x267e6b]={'$like':'%'+_0x113bc9[_0xa115('0x28')][_0xa115('0x3d')]+'%'};return _0x3fd5c3;})});}_0x4cff11=_[_0xa115('0x2e')]({},_0x4cff11,_0x113bc9[_0xa115('0x3f')]);return db[_0xa115('0x37')][_0xa115('0x40')](_0x4cff11);}})[_0xa115('0x14')](function(_0x28f64d){if(_0x28f64d){return db[_0xa115('0x41')][_0xa115('0x42')]({'where':{'id':_['map'](_0x28f64d,'UserId'),'role':_0xa115('0x43')},'attributes':['id',_0xa115('0x19'),'chatPause',_0xa115('0x44'),'createdAt']});}})[_0xa115('0x14')](function(_0x2ba5d5){if(_0x2ba5d5){return{'count':_0x2ba5d5[_0xa115('0xd')],'rows':_[_0xa115('0x3e')](_0x2ba5d5[_0xa115('0x21')],function(_0x1f58cf){return{'membername':_0x1f58cf[_0xa115('0x19')],'UserId':_0x1f58cf['id'],'queue_name':_0x1c4080['name'],'ChatQueueId':_0x1c4080['id'],'interface':util[_0xa115('0x45')](_0xa115('0x46'),'SIP',_0x1f58cf[_0xa115('0x19')]),'penalty':0x0,'paused':_0x1f58cf[_0xa115('0x47')],'createdAt':_0x1f58cf['createdAt'],'updatedAt':_0x1f58cf[_0xa115('0x44')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa115('0x14')](respondWithFilteredResult(_0xdc88f9,_0x4cff11))[_0xa115('0x22')](handleError(_0xdc88f9,null));};exports['getTeams']=function(_0x957ace,_0xe4961e){var _0x746d54={};var _0xed6839={};var _0x191ccc;var _0x585a7f;return db[_0xa115('0x1b')][_0xa115('0x35')]({'where':{'id':_0x957ace['params']['id']}})[_0xa115('0x14')](handleEntityNotFound(_0xe4961e,null))[_0xa115('0x14')](function(_0x385498){if(_0x385498){_0x191ccc=_0x385498;_0xed6839[_0xa115('0x25')]=_['keys'](db[_0xa115('0x48')][_0xa115('0x27')]);_0xed6839[_0xa115('0x28')]=_['keys'](_0x957ace[_0xa115('0x28')]);_0xed6839[_0xa115('0x29')]=_[_0xa115('0x2a')](_0xed6839['model'],_0xed6839[_0xa115('0x28')]);_0x746d54[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0xed6839[_0xa115('0x25')],qs[_0xa115('0x2c')](_0x957ace[_0xa115('0x28')]['fields']));_0x746d54[_0xa115('0x2b')]=_0x746d54['attributes'][_0xa115('0x2d')]?_0x746d54[_0xa115('0x2b')]:_0xed6839['model'];_0x746d54[_0xa115('0x39')]=qs[_0xa115('0x3a')](_0x957ace[_0xa115('0x28')][_0xa115('0x3a')]);_0x746d54['where']=qs[_0xa115('0x29')](_[_0xa115('0x49')](_0x957ace[_0xa115('0x28')],_0xed6839[_0xa115('0x29')]));if(_0x957ace[_0xa115('0x28')][_0xa115('0x3d')]){_0x746d54['where']=_[_0xa115('0x2e')](_0x746d54[_0xa115('0x3b')],{'$or':_[_0xa115('0x3e')](_0x746d54[_0xa115('0x2b')],function(_0x3d0c6b){var _0x55beb9={};_0x55beb9[_0x3d0c6b]={'$like':'%'+_0x957ace[_0xa115('0x28')][_0xa115('0x3d')]+'%'};return _0x55beb9;})});}_0x746d54=_[_0xa115('0x2e')]({},_0x746d54,_0x957ace[_0xa115('0x3f')]);return _0x191ccc[_0xa115('0x4a')](_0x746d54);}})[_0xa115('0x14')](function(_0x29ede4){if(_0x29ede4){_0x585a7f=_0x29ede4[_0xa115('0x2d')];if(!_0x957ace[_0xa115('0x28')][_0xa115('0x38')](_0xa115('0x4b'))){_0x746d54['limit']=qs[_0xa115('0xe')](_0x957ace[_0xa115('0x28')][_0xa115('0xe')]);_0x746d54[_0xa115('0xb')]=qs[_0xa115('0xb')](_0x957ace[_0xa115('0x28')][_0xa115('0xb')]);}return _0x191ccc[_0xa115('0x4a')](_0x746d54);}})[_0xa115('0x14')](function(_0xca918f){if(_0xca918f){return _0xca918f?{'count':_0x585a7f,'rows':_0xca918f}:null;}})['then'](respondWithResult(_0xe4961e,null))[_0xa115('0x22')](handleError(_0xe4961e,null));};exports[_0xa115('0x4c')]=function(_0x8845a0,_0x5e2b2f){var _0x1c9fcc=_0x8845a0[_0xa115('0x30')][_0xa115('0x4d')];return db[_0xa115('0x48')][_0xa115('0x40')]({'where':{'id':_0x1c9fcc},'attributes':['id'],'include':[{'model':db[_0xa115('0x41')],'as':_0xa115('0x4e'),'attributes':['id',_0xa115('0x19'),_0xa115('0x4f'),_0xa115('0x50'),_0xa115('0x51')],'raw':!![]}]})['then'](function(_0xa70db9){if(_0xa70db9){var _0x101f92=_[_0xa115('0x52')](_0xa70db9,function(_0x4dde33){var _0x34d3a7=_0x4dde33[_0xa115('0x36')]({'plain':!![]});return _0x34d3a7[_0xa115('0x4e')];});return db[_0xa115('0x1b')]['find']({'where':{'id':_0x8845a0[_0xa115('0x24')]['id']}})[_0xa115('0x14')](function(_0x59bf81){return db[_0xa115('0x53')][_0xa115('0x54')](function(_0x41b5e4){return _0x59bf81[_0xa115('0x4c')](_0x1c9fcc,{'transaction':_0x41b5e4})[_0xa115('0x14')](function(){return BPromise[_0xa115('0x55')](_0x101f92,function(_0x2a6274){return db['UserChatQueue'][_0xa115('0x56')]({'where':{'UserId':_0x2a6274['id'],'ChatQueueId':_0x8845a0[_0xa115('0x24')]['id']},'transaction':_0x41b5e4});});})['then'](function(){_0x101f92[_0xa115('0x57')](function(_0x29ddc9){socket['emit']('userChatQueue:save',{'UserId':_0x29ddc9['id'],'ChatQueueId':_0x59bf81['id']});});});});});}})['then'](respondWithStatusCode(_0x5e2b2f,null))['catch'](handleError(_0x5e2b2f,null));};exports[_0xa115('0x58')]=function(_0x22f7e0,_0x18b0c6){return db[_0xa115('0x48')]['findAll']({'where':{'id':_0x22f7e0[_0xa115('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa115('0x41')],'as':_0xa115('0x4e'),'attributes':['id'],'raw':!![]}]})[_0xa115('0x14')](handleEntityNotFound(_0x18b0c6,null))[_0xa115('0x14')](function(_0x46baae){var _0x1da862=_['map'](_0x46baae,'id');var _0x354c0e=[];var _0x5a45ab=[];var _0x40113c=squel[_0xa115('0x59')]();_0x40113c[_0xa115('0x5a')](_0xa115('0x5b'))[_0xa115('0x5c')](_0xa115('0x5d'),'tq')[_0xa115('0x5e')](_0xa115('0x5f'),'ut',_0xa115('0x60'))['where']('ChatQueueId\x20=\x20?',_0x22f7e0['params']['id']);for(var _0x573ea4=0x0;_0x573ea4<_0x46baae[_0xa115('0x2d')];_0x573ea4+=0x1){let _0x4645a7=_0x46baae[_0x573ea4];for(var _0xe96020=0x0;_0xe96020<_0x4645a7[_0xa115('0x4e')][_0xa115('0x2d')];_0xe96020+=0x1){let _0x4702c6=_0x4645a7['Agents'][_0xe96020];var _0x10a149=_0x40113c['clone']();_0x10a149[_0xa115('0x3b')](_0xa115('0x61'),_0x4702c6['id']);_0x5a45ab[_0xa115('0x62')](db[_0xa115('0x53')][_0xa115('0x28')](_0x10a149['toString'](),{'type':db[_0xa115('0x53')]['QueryTypes']['SELECT']})[_0xa115('0x14')](function(_0x14d7f4){if(_0x14d7f4[_0xa115('0x2d')]===0x1){return _0x4702c6['id'];}else{var _0x383c34=_[_0xa115('0x63')](_['map'](_0x14d7f4,_0xa115('0x64')),function(_0x8f2f29){return _[_0xa115('0x65')](_0x1da862,_0x8f2f29);});if(_0x383c34){return _0x4702c6['id'];}}}));}}return BPromise['all'](_0x5a45ab)[_0xa115('0x14')](function(_0x43dea5){_0x354c0e=_(_0x354c0e)[_0xa115('0x66')](_0x43dea5)[_0xa115('0x67')]()[_0xa115('0x68')]();return db[_0xa115('0x1b')][_0xa115('0x69')]({'where':{'id':_0x22f7e0[_0xa115('0x24')]['id']}})[_0xa115('0x14')](function(_0x2a3693){return db['sequelize'][_0xa115('0x54')](function(_0x2dfb31){return _0x2a3693[_0xa115('0x58')](_0x22f7e0[_0xa115('0x28')][_0xa115('0x4d')],{'transaction':_0x2dfb31})[_0xa115('0x14')](function(){if(!_[_0xa115('0x6a')](_0x354c0e)){return _0x2a3693[_0xa115('0x6b')](_0x354c0e,{'transaction':_0x2dfb31});}})[_0xa115('0x14')](function(){_0x354c0e[_0xa115('0x57')](function(_0x5ee327){socket['emit'](_0xa115('0x6c'),{'UserId':_0x5ee327,'ChatQueueId':_0x2a3693['id']});});});});});});})[_0xa115('0x14')](respondWithStatusCode(_0x18b0c6,null))['catch'](handleError(_0x18b0c6,null));};exports['addAgents']=function(_0x2adc87,_0x133f84){return db[_0xa115('0x1b')][_0xa115('0x69')]({'where':{'id':_0x2adc87[_0xa115('0x24')]['id']}})['then'](handleEntityNotFound(_0x133f84,null))[_0xa115('0x14')](function(_0x2d8635){if(_0x2d8635){return _0x2d8635[_0xa115('0x6d')](_0x2adc87[_0xa115('0x30')]['ids'],_['omit'](_0x2adc87[_0xa115('0x30')],['ids','id'])||{})[_0xa115('0x6e')](function(_0x3d2ee2){for(var _0x53bf58=0x0;_0x53bf58<_0x2adc87[_0xa115('0x30')][_0xa115('0x4d')][_0xa115('0x2d')];_0x53bf58+=0x1){socket[_0xa115('0x6f')](_0xa115('0x70'),{'UserId':Number(_0x2adc87['body'][_0xa115('0x4d')][_0x53bf58]),'ChatQueueId':Number(_0x2adc87['params']['id'])});}return _0x3d2ee2;});}})['then'](respondWithResult(_0x133f84,null))[_0xa115('0x22')](handleError(_0x133f84,null));};exports[_0xa115('0x6b')]=function(_0x301a7c,_0x2e274b){return db[_0xa115('0x1b')][_0xa115('0x69')]({'where':{'id':_0x301a7c['params']['id']}})[_0xa115('0x14')](handleEntityNotFound(_0x2e274b,null))['then'](function(_0x3e4618){if(_0x3e4618){return _0x3e4618[_0xa115('0x6b')](_0x301a7c['query'][_0xa115('0x4d')])['then'](function(){if(_[_0xa115('0x71')](_0x301a7c[_0xa115('0x28')][_0xa115('0x4d')])){for(var _0x14738b=0x0;_0x14738b<_0x301a7c[_0xa115('0x28')][_0xa115('0x4d')][_0xa115('0x2d')];_0x14738b+=0x1){socket['emit'](_0xa115('0x6c'),{'UserId':Number(_0x301a7c[_0xa115('0x28')]['ids'][_0x14738b]),'ChatQueueId':Number(_0x301a7c['params']['id'])});}}else{socket[_0xa115('0x6f')](_0xa115('0x6c'),{'UserId':Number(_0x301a7c[_0xa115('0x28')][_0xa115('0x4d')]),'ChatQueueId':Number(_0x301a7c[_0xa115('0x24')]['id'])});}});}})[_0xa115('0x14')](respondWithStatusCode(_0x2e274b,null))[_0xa115('0x22')](handleError(_0x2e274b,null));};exports[_0xa115('0x72')]=function(_0x1d004b,_0x241791){var _0x568615={};var _0x470925={};var _0x34417e;var _0x5a2832;return db[_0xa115('0x1b')][_0xa115('0x35')]({'where':{'id':_0x1d004b[_0xa115('0x24')]['id']}})['then'](handleEntityNotFound(_0x241791,null))['then'](function(_0x318a58){if(_0x318a58){_0x34417e=_0x318a58;_0x470925[_0xa115('0x25')]=_[_0xa115('0x26')](db[_0xa115('0x41')][_0xa115('0x27')]);_0x470925[_0xa115('0x28')]=_[_0xa115('0x26')](_0x1d004b['query']);_0x470925[_0xa115('0x29')]=_[_0xa115('0x2a')](_0x470925[_0xa115('0x25')],_0x470925[_0xa115('0x28')]);_0x568615[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0x470925[_0xa115('0x25')],qs[_0xa115('0x2c')](_0x1d004b[_0xa115('0x28')]['fields']));_0x568615['attributes']=_0x568615[_0xa115('0x2b')]['length']?_0x568615['attributes']:_0x470925[_0xa115('0x25')];_0x568615['order']=qs[_0xa115('0x3a')](_0x1d004b['query']['sort']);_0x568615[_0xa115('0x3b')]=qs['filters'](_[_0xa115('0x49')](_0x1d004b[_0xa115('0x28')],_0x470925[_0xa115('0x29')]));if(_0x1d004b[_0xa115('0x28')]['filter']){_0x568615['where']=_['merge'](_0x568615['where'],{'$or':_[_0xa115('0x3e')](_0x568615['attributes'],function(_0x5c622e){var _0x4e9575={};_0x4e9575[_0x5c622e]={'$like':'%'+_0x1d004b[_0xa115('0x28')][_0xa115('0x3d')]+'%'};return _0x4e9575;})});}_0x568615=_[_0xa115('0x2e')]({},_0x568615,_0x1d004b[_0xa115('0x3f')]);return _0x34417e[_0xa115('0x72')](_0x568615);}})['then'](function(_0x29ce60){if(_0x29ce60){_0x5a2832=_0x29ce60[_0xa115('0x2d')];if(!_0x1d004b['query'][_0xa115('0x38')]('nolimit')){_0x568615[_0xa115('0xe')]=qs['limit'](_0x1d004b['query'][_0xa115('0xe')]);_0x568615['offset']=qs[_0xa115('0xb')](_0x1d004b['query'][_0xa115('0xb')]);}return _0x34417e[_0xa115('0x72')](_0x568615);}})[_0xa115('0x14')](function(_0x797ca){if(_0x797ca){return _0x797ca?{'count':_0x5a2832,'rows':_0x797ca}:null;}})['then'](respondWithResult(_0x241791,null))[_0xa115('0x22')](handleError(_0x241791,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 1ac3a58..c093031 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 _0xda3d=['ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x423c82,_0x5293c6){var _0x25104c=function(_0x170f3e){while(--_0x170f3e){_0x423c82['push'](_0x423c82['shift']());}};_0x25104c(++_0x5293c6);}(_0xda3d,0x10f));var _0xdda3=function(_0x10e87a,_0x2739db){_0x10e87a=_0x10e87a-0x0;var _0x3008e7=_0xda3d[_0x10e87a];return _0x3008e7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xdda3('0x0'))['db'][_0xdda3('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdda3('0x2')](0x0);var events={'afterCreate':_0xdda3('0x3'),'afterUpdate':_0xdda3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x297c60){return function(_0x5af04e,_0x3f5a28,_0x10a555){ChatQueueEvents[_0xdda3('0x5')](_0x297c60+':'+_0x5af04e['id'],_0x5af04e);ChatQueueEvents['emit'](_0x297c60,_0x5af04e);_0x10a555(null);};}for(var e in events){if(events[_0xdda3('0x6')](e)){var event=events[e];ChatQueue[_0xdda3('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x0bca=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','update'];(function(_0x57bc96,_0x445aeb){var _0x56351f=function(_0x13515c){while(--_0x13515c){_0x57bc96['push'](_0x57bc96['shift']());}};_0x56351f(++_0x445aeb);}(_0x0bca,0xa7));var _0xa0bc=function(_0x207a0a,_0x10eceb){_0x207a0a=_0x207a0a-0x0;var _0x50445c=_0x0bca[_0x207a0a];return _0x50445c;};'use strict';var EventEmitter=require(_0xa0bc('0x0'));var ChatQueue=require(_0xa0bc('0x1'))['db'][_0xa0bc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0bc('0x3'),'afterDestroy':_0xa0bc('0x4')};function emitEvent(_0x529431){return function(_0x4c76a5,_0x549f88,_0xff60c0){ChatQueueEvents[_0xa0bc('0x5')](_0x529431+':'+_0x4c76a5['id'],_0x4c76a5);ChatQueueEvents[_0xa0bc('0x5')](_0x529431,_0x4c76a5);_0xff60c0(null);};}for(var e in events){if(events[_0xa0bc('0x6')](e)){var event=events[e];ChatQueue[_0xa0bc('0x7')](e,emitEvent(event));}}module[_0xa0bc('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index efcb9cc..6086cda 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 _0xa38c=['exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatQueue.attributes'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xa38c,0x117));var _0xca38=function(_0x4b08d3,_0x176175){_0x4b08d3=_0x4b08d3-0x0;var _0x11a556=_0xa38c[_0x4b08d3];return _0x11a556;};'use strict';var _=require(_0xca38('0x0'));var util=require(_0xca38('0x1'));var logger=require(_0xca38('0x2'))(_0xca38('0x3'));var moment=require(_0xca38('0x4'));var BPromise=require(_0xca38('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca38('0x6'));var rimraf=require('rimraf');var config=require(_0xca38('0x7'));var attributes=require(_0xca38('0x8'));module[_0xca38('0x9')]=function(_0xf36a14,_0x21245d){return _0xf36a14['define'](_0xca38('0xa'),attributes,{'tableName':_0xca38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x540d=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3c2004,_0x113d1c){var _0xe7b655=function(_0x476065){while(--_0x476065){_0x3c2004['push'](_0x3c2004['shift']());}};_0xe7b655(++_0x113d1c);}(_0x540d,0x19f));var _0xd540=function(_0x5e8bcc,_0x4bc996){_0x5e8bcc=_0x5e8bcc-0x0;var _0x2c23da=_0x540d[_0x5e8bcc];return _0x2c23da;};'use strict';var _=require(_0xd540('0x0'));var util=require('util');var logger=require(_0xd540('0x1'))(_0xd540('0x2'));var moment=require(_0xd540('0x3'));var BPromise=require(_0xd540('0x4'));var rp=require(_0xd540('0x5'));var fs=require('fs');var path=require(_0xd540('0x6'));var rimraf=require(_0xd540('0x7'));var config=require(_0xd540('0x8'));var attributes=require(_0xd540('0x9'));module[_0xd540('0xa')]=function(_0x33ac9b,_0x266354){return _0x33ac9b[_0xd540('0xb')](_0xd540('0xc'),attributes,{'tableName':_0xd540('0xd'),'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 b00e842..72d239b 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 _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','attributes','limit','include','model','map','debug','where','ShowChatQueue'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xef0f,0x168));var _0xfef0=function(_0x9b49da,_0x343d7a){_0x9b49da=_0x9b49da-0x0;var _0x2b171b=_0xef0f[_0x9b49da];return _0x2b171b;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config['redis'],{'host':_0xfef0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0xb')]));require(_0xfef0('0xe'))[_0xfef0('0xf')](socket);function respondWithRpcPromise(_0x2d42dc,_0x334e74,_0x402dff){return new BPromise(function(_0xc177db,_0x4bd6f2){return client[_0xfef0('0x10')](_0x2d42dc,_0x402dff)[_0xfef0('0x11')](function(_0x410234){logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,_0xfef0('0x14'));logger['debug'](_0xfef0('0x15'),_0x334e74,_0xfef0('0x14'),JSON[_0xfef0('0x16')](_0x410234));if(_0x410234[_0xfef0('0x17')]){if(_0x410234[_0xfef0('0x17')][_0xfef0('0x18')]===0x1f4){logger[_0xfef0('0x17')]('ChatQueue,\x20%s,\x20%s',_0x334e74,_0x410234[_0xfef0('0x17')]['message']);return _0x4bd6f2(_0x410234['error']['message']);}logger[_0xfef0('0x17')](_0xfef0('0x13'),_0x334e74,_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);return _0xc177db(_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);}else{logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,'request\x20sent');_0xc177db(_0x410234[_0xfef0('0x1a')][_0xfef0('0x19')]);}})[_0xfef0('0x1b')](function(_0x39f9d3){logger[_0xfef0('0x17')]('ChatQueue,\x20%s,\x20%s',_0x334e74,_0x39f9d3);_0x4bd6f2(_0x39f9d3);});});}exports[_0xfef0('0x1c')]=function(_0x4e24de){var _0x20826b=this;return new Promise(function(_0x1a0aa0,_0x28dee1){return db['ChatQueue'][_0xfef0('0x1d')]({'raw':_0x4e24de['options']?_0x4e24de[_0xfef0('0x1e')][_0xfef0('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e24de['options']?_0x4e24de['options']['where']||null:null,'attributes':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de['options'][_0xfef0('0x20')]||null:null,'limit':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')][_0xfef0('0x21')]||null:null,'include':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')]['include']?_['map'](_0x4e24de[_0xfef0('0x1e')][_0xfef0('0x22')],function(_0x924f6e){return{'model':db[_0x924f6e[_0xfef0('0x23')]],'as':_0x924f6e['as'],'attributes':_0x924f6e[_0xfef0('0x20')],'include':_0x924f6e[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x924f6e[_0xfef0('0x22')],function(_0x391279){return{'model':db[_0x391279['model']],'as':_0x391279['as'],'attributes':_0x391279[_0xfef0('0x20')],'include':_0x391279[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x391279[_0xfef0('0x22')],function(_0x37921f){return{'model':db[_0x37921f[_0xfef0('0x23')]],'as':_0x37921f['as'],'attributes':_0x37921f[_0xfef0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0x11')](function(_0x26cb9a){logger[_0xfef0('0x12')](_0xfef0('0x1c'),_0x4e24de);logger[_0xfef0('0x25')]('GetChatQueue',_0x4e24de,JSON[_0xfef0('0x16')](_0x26cb9a));_0x1a0aa0(_0x26cb9a);})['catch'](function(_0x4eaf74){logger[_0xfef0('0x17')](_0xfef0('0x1c'),_0x4eaf74['message'],_0x4e24de);_0x28dee1(_0x20826b['error'](0x1f4,_0x4eaf74['message']));});});};exports['ShowChatQueue']=function(_0x4cce8a){var _0x417535=this;return new Promise(function(_0x172d94,_0x2fffae){return db['ChatQueue']['find']({'raw':_0x4cce8a['options']?_0x4cce8a[_0xfef0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4cce8a[_0xfef0('0x1e')]?_0x4cce8a[_0xfef0('0x1e')][_0xfef0('0x26')]||null:null,'attributes':_0x4cce8a['options']?_0x4cce8a[_0xfef0('0x1e')]['attributes']||null:null,'include':_0x4cce8a[_0xfef0('0x1e')]?_0x4cce8a[_0xfef0('0x1e')][_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x4cce8a[_0xfef0('0x1e')][_0xfef0('0x22')],function(_0x92d420){return{'model':db[_0x92d420[_0xfef0('0x23')]],'as':_0x92d420['as'],'attributes':_0x92d420['attributes'],'include':_0x92d420[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x92d420[_0xfef0('0x22')],function(_0x36b2d1){return{'model':db[_0x36b2d1[_0xfef0('0x23')]],'as':_0x36b2d1['as'],'attributes':_0x36b2d1[_0xfef0('0x20')],'include':_0x36b2d1[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x36b2d1[_0xfef0('0x22')],function(_0x109d0f){return{'model':db[_0x109d0f[_0xfef0('0x23')]],'as':_0x109d0f['as'],'attributes':_0x109d0f[_0xfef0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0x11')](function(_0x4a8af4){logger[_0xfef0('0x12')]('ShowChatQueue',_0x4cce8a);logger[_0xfef0('0x25')](_0xfef0('0x27'),_0x4cce8a,JSON[_0xfef0('0x16')](_0x4a8af4));_0x172d94(_0x4a8af4);})['catch'](function(_0x3f1597){logger[_0xfef0('0x17')](_0xfef0('0x27'),_0x3f1597['message'],_0x4cce8a);_0x2fffae(_0x417535[_0xfef0('0x17')](0x1f4,_0x3f1597[_0xfef0('0x19')]));});});}; \ No newline at end of file +var _0xe99c=['ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','options','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x4162e6,_0x3f2dfd){var _0x50b0fc=function(_0x3d1ba0){while(--_0x3d1ba0){_0x4162e6['push'](_0x4162e6['shift']());}};_0x50b0fc(++_0x3f2dfd);}(_0xe99c,0x197));var _0xce99=function(_0x29b00a,_0x3a8303){_0x29b00a=_0x29b00a-0x0;var _0x1451c5=_0xe99c[_0x29b00a];return _0x1451c5;};'use strict';var _=require(_0xce99('0x0'));var util=require('util');var moment=require(_0xce99('0x1'));var BPromise=require(_0xce99('0x2'));var rs=require(_0xce99('0x3'));var fs=require('fs');var Redis=require(_0xce99('0x4'));var db=require(_0xce99('0x5'))['db'];var utils=require(_0xce99('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xce99('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce99('0x8')]['http']({'port':0x232a});config[_0xce99('0x9')]=_[_0xce99('0xa')](config[_0xce99('0x9')],{'host':_0xce99('0xb'),'port':0x18eb});var socket=require(_0xce99('0xc'))(new Redis(config[_0xce99('0x9')]));require(_0xce99('0xd'))[_0xce99('0xe')](socket);function respondWithRpcPromise(_0x5727f2,_0x3ceb6f,_0xed09d1){return new BPromise(function(_0x4c7423,_0x26ac93){return client[_0xce99('0xf')](_0x5727f2,_0xed09d1)[_0xce99('0x10')](function(_0x57a7f0){logger[_0xce99('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3ceb6f,_0xce99('0x12'));logger[_0xce99('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3ceb6f,'request\x20sent',JSON[_0xce99('0x14')](_0x57a7f0));if(_0x57a7f0[_0xce99('0x15')]){if(_0x57a7f0[_0xce99('0x15')]['code']===0x1f4){logger['error'](_0xce99('0x16'),_0x3ceb6f,_0x57a7f0['error'][_0xce99('0x17')]);return _0x26ac93(_0x57a7f0['error'][_0xce99('0x17')]);}logger[_0xce99('0x15')](_0xce99('0x16'),_0x3ceb6f,_0x57a7f0['error']['message']);return _0x4c7423(_0x57a7f0[_0xce99('0x15')][_0xce99('0x17')]);}else{logger[_0xce99('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3ceb6f,_0xce99('0x12'));_0x4c7423(_0x57a7f0[_0xce99('0x18')][_0xce99('0x17')]);}})[_0xce99('0x19')](function(_0x3f2427){logger[_0xce99('0x15')](_0xce99('0x16'),_0x3ceb6f,_0x3f2427);_0x26ac93(_0x3f2427);});});}exports['GetChatQueue']=function(_0x1de34e){var _0x5444b9=this;return new Promise(function(_0x1d55f0,_0x1c79a9){return db[_0xce99('0x1a')][_0xce99('0x1b')]({'raw':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')]['where']||null:null,'attributes':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')][_0xce99('0x1d')]||null:null,'limit':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')][_0xce99('0x1e')]||null:null,'include':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')][_0xce99('0x1f')]?_[_0xce99('0x20')](_0x1de34e[_0xce99('0x1c')][_0xce99('0x1f')],function(_0x223863){return{'model':db[_0x223863[_0xce99('0x21')]],'as':_0x223863['as'],'attributes':_0x223863[_0xce99('0x1d')],'include':_0x223863[_0xce99('0x1f')]?_[_0xce99('0x20')](_0x223863[_0xce99('0x1f')],function(_0x17a30f){return{'model':db[_0x17a30f[_0xce99('0x21')]],'as':_0x17a30f['as'],'attributes':_0x17a30f['attributes'],'include':_0x17a30f['include']?_[_0xce99('0x20')](_0x17a30f[_0xce99('0x1f')],function(_0x4139e4){return{'model':db[_0x4139e4['model']],'as':_0x4139e4['as'],'attributes':_0x4139e4[_0xce99('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xce99('0x10')](function(_0x1ce793){logger['info']('GetChatQueue',_0x1de34e);logger[_0xce99('0x13')]('GetChatQueue',_0x1de34e,JSON[_0xce99('0x14')](_0x1ce793));_0x1d55f0(_0x1ce793);})['catch'](function(_0x2e2d7b){logger[_0xce99('0x15')](_0xce99('0x22'),_0x2e2d7b['message'],_0x1de34e);_0x1c79a9(_0x5444b9[_0xce99('0x15')](0x1f4,_0x2e2d7b[_0xce99('0x17')]));});});};exports[_0xce99('0x23')]=function(_0x4ac587){var _0x521a82=this;return new Promise(function(_0x118070,_0x5203af){return db[_0xce99('0x1a')][_0xce99('0x24')]({'raw':_0x4ac587[_0xce99('0x1c')]?_0x4ac587[_0xce99('0x1c')][_0xce99('0x25')]===undefined?!![]:![]:!![],'where':_0x4ac587[_0xce99('0x1c')]?_0x4ac587[_0xce99('0x1c')][_0xce99('0x26')]||null:null,'attributes':_0x4ac587['options']?_0x4ac587[_0xce99('0x1c')][_0xce99('0x1d')]||null:null,'include':_0x4ac587[_0xce99('0x1c')]?_0x4ac587[_0xce99('0x1c')]['include']?_[_0xce99('0x20')](_0x4ac587['options'][_0xce99('0x1f')],function(_0x22e889){return{'model':db[_0x22e889[_0xce99('0x21')]],'as':_0x22e889['as'],'attributes':_0x22e889['attributes'],'include':_0x22e889[_0xce99('0x1f')]?_[_0xce99('0x20')](_0x22e889[_0xce99('0x1f')],function(_0x338250){return{'model':db[_0x338250[_0xce99('0x21')]],'as':_0x338250['as'],'attributes':_0x338250[_0xce99('0x1d')],'include':_0x338250[_0xce99('0x1f')]?_[_0xce99('0x20')](_0x338250['include'],function(_0x3fc690){return{'model':db[_0x3fc690[_0xce99('0x21')]],'as':_0x3fc690['as'],'attributes':_0x3fc690['attributes']};}):[]};}):[]};}):[]:[]})[_0xce99('0x10')](function(_0x3642c0){logger[_0xce99('0x11')]('ShowChatQueue',_0x4ac587);logger[_0xce99('0x13')]('ShowChatQueue',_0x4ac587,JSON[_0xce99('0x14')](_0x3642c0));_0x118070(_0x3642c0);})[_0xce99('0x19')](function(_0x4061ee){logger[_0xce99('0x15')](_0xce99('0x23'),_0x4061ee[_0xce99('0x17')],_0x4ac587);_0x5203af(_0x521a82['error'](0x1f4,_0x4061ee[_0xce99('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 5ac766f..981855c 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 _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x5e3c81,_0x252f3a){var _0x5dc1e3=function(_0x54f55a){while(--_0x54f55a){_0x5e3c81['push'](_0x5e3c81['shift']());}};_0x5dc1e3(++_0x252f3a);}(_0x22fb,0x192));var _0xb22f=function(_0xe70ed2,_0x2a2748){_0xe70ed2=_0xe70ed2-0x0;var _0xfd3c2e=_0x22fb[_0xe70ed2];return _0xfd3c2e;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file +var _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x56a761,_0x9fce38){var _0x248e40=function(_0x3d438d){while(--_0x3d438d){_0x56a761['push'](_0x56a761['shift']());}};_0x248e40(++_0x9fce38);}(_0x9b67,0xf6));var _0x79b6=function(_0x28d018,_0x5c5125){_0x28d018=_0x28d018-0x0;var _0x2626ba=_0x9b67[_0x28d018];return _0x2626ba;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 67d8c3a..45da786 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x462a81,_0x3ba80a){var _0x9dcafb=function(_0x596481){while(--_0x596481){_0x462a81['push'](_0x462a81['shift']());}};_0x9dcafb(++_0x3ba80a);}(_0x008c,0x188));var _0xc008=function(_0x5b1097,_0x3ed62f){_0x5b1097=_0x5b1097-0x0;var _0x57979c=_0x008c[_0x5b1097];return _0x57979c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x267ae4,_0x58c7cf){var _0x519990=function(_0x42b0f3){while(--_0x42b0f3){_0x267ae4['push'](_0x267ae4['shift']());}};_0x519990(++_0x58c7cf);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 83e4f3c..7b0555e 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 _0x6a0c=['DATE','moment','exports','STRING'];(function(_0x28cc1c,_0x820852){var _0xc1284c=function(_0x285e50){while(--_0x285e50){_0x28cc1c['push'](_0x28cc1c['shift']());}};_0xc1284c(++_0x820852);}(_0x6a0c,0xb5));var _0xc6a0=function(_0xa1c8d1,_0x41920c){_0xa1c8d1=_0xa1c8d1-0x0;var _0x2dbe18=_0x6a0c[_0xa1c8d1];return _0x2dbe18;};'use strict';var moment=require(_0xc6a0('0x0'));var Sequelize=require('sequelize');module[_0xc6a0('0x1')]={'uniqueid':{'type':Sequelize[_0xc6a0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc6a0('0x2')]},'joinAt':{'type':Sequelize[_0xc6a0('0x3')]},'leaveAt':{'type':Sequelize[_0xc6a0('0x3')]},'acceptAt':{'type':Sequelize[_0xc6a0('0x3')]},'exitAt':{'type':Sequelize[_0xc6a0('0x3')]},'reason':{'type':Sequelize[_0xc6a0('0x2')]}}; \ No newline at end of file +var _0xb501=['STRING','DATE','moment','exports'];(function(_0x7bb463,_0x1b100f){var _0xf95e1b=function(_0x26661f){while(--_0x26661f){_0x7bb463['push'](_0x7bb463['shift']());}};_0xf95e1b(++_0x1b100f);}(_0xb501,0x1ce));var _0x1b50=function(_0x3bab7f,_0x291900){_0x3bab7f=_0x3bab7f-0x0;var _0xc0648=_0xb501[_0x3bab7f];return _0xc0648;};'use strict';var moment=require(_0x1b50('0x0'));var Sequelize=require('sequelize');module[_0x1b50('0x1')]={'uniqueid':{'type':Sequelize[_0x1b50('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1b50('0x3')]},'leaveAt':{'type':Sequelize[_0x1b50('0x3')]},'acceptAt':{'type':Sequelize[_0x1b50('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 3f05065..3e6436f 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 _0xa6b0=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','index','map','ChatQueueReport','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5c6022,_0x2f4397){_0x5c6022=_0x5c6022-0x0;var _0x483c1d=_0xa6b0[_0x5c6022];return _0x483c1d;};'use strict';var emlformat=require(_0x0a6b('0x0'));var rimraf=require(_0x0a6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6b('0x2'));var moment=require(_0x0a6b('0x3'));var BPromise=require(_0x0a6b('0x4'));var Mustache=require('mustache');var util=require(_0x0a6b('0x5'));var path=require(_0x0a6b('0x6'));var sox=require(_0x0a6b('0x7'));var csv=require(_0x0a6b('0x8'));var ejs=require(_0x0a6b('0x9'));var fs=require('fs');var fs_extra=require(_0x0a6b('0xa'));var _=require(_0x0a6b('0xb'));var squel=require(_0x0a6b('0xc'));var crypto=require(_0x0a6b('0xd'));var jsforce=require(_0x0a6b('0xe'));var deskjs=require(_0x0a6b('0xf'));var toCsv=require(_0x0a6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a6b('0x10'));var authService=require(_0x0a6b('0x11'));var qs=require(_0x0a6b('0x12'));var as=require(_0x0a6b('0x13'));var hardwareService=require(_0x0a6b('0x14'));var logger=require(_0x0a6b('0x15'))(_0x0a6b('0x16'));var utils=require(_0x0a6b('0x17'));var config=require(_0x0a6b('0x18'));var licenseUtil=require(_0x0a6b('0x19'));var db=require(_0x0a6b('0x1a'))['db'];function respondWithStatusCode(_0x890493,_0x244a7d){_0x244a7d=_0x244a7d||0xcc;return function(_0x3cd9a4){if(_0x3cd9a4){return _0x890493['sendStatus'](_0x244a7d);}return _0x890493['status'](_0x244a7d)[_0x0a6b('0x1b')]();};}function respondWithResult(_0x2f27d6,_0x2abc4e){_0x2abc4e=_0x2abc4e||0xc8;return function(_0x177e87){if(_0x177e87){return _0x2f27d6[_0x0a6b('0x1c')](_0x2abc4e)[_0x0a6b('0x1d')](_0x177e87);}};}function respondWithFilteredResult(_0x9bb98e,_0x19e84c){return function(_0x1205a3){if(_0x1205a3){var _0x9d7aba=typeof _0x19e84c['offset']===_0x0a6b('0x1e')&&typeof _0x19e84c[_0x0a6b('0x1f')]==='undefined';var _0x290f7f=_0x1205a3['count'];var _0xcb412=_0x9d7aba?0x0:_0x19e84c[_0x0a6b('0x20')];var _0x2cb10b=_0x9d7aba?_0x1205a3[_0x0a6b('0x21')]:_0x19e84c['offset']+_0x19e84c[_0x0a6b('0x1f')];var _0x296162;if(_0x2cb10b>=_0x290f7f){_0x2cb10b=_0x290f7f;_0x296162=0xc8;}else{_0x296162=0xce;}_0x9bb98e['status'](_0x296162);return _0x9bb98e[_0x0a6b('0x22')](_0x0a6b('0x23'),_0xcb412+'-'+_0x2cb10b+'/'+_0x290f7f)[_0x0a6b('0x1d')](_0x1205a3);}return null;};}function patchUpdates(_0x491936){return function(_0x3ae3f4){try{jsonpatch[_0x0a6b('0x24')](_0x3ae3f4,_0x491936,!![]);}catch(_0x4077c6){return BPromise['reject'](_0x4077c6);}return _0x3ae3f4[_0x0a6b('0x25')]();};}function saveUpdates(_0x531e4c,_0xe4c2b9){return function(_0x5e8206){if(_0x5e8206){return _0x5e8206[_0x0a6b('0x26')](_0x531e4c)['then'](function(_0x1e5065){return _0x1e5065;});}return null;};}function removeEntity(_0xdda188,_0x3d153f){return function(_0x5c77fb){if(_0x5c77fb){return _0x5c77fb[_0x0a6b('0x27')]()[_0x0a6b('0x28')](function(){_0xdda188[_0x0a6b('0x1c')](0xcc)[_0x0a6b('0x1b')]();});}};}function handleEntityNotFound(_0x3b12a2,_0x5b2229){return function(_0x3e6a1d){if(!_0x3e6a1d){_0x3b12a2[_0x0a6b('0x29')](0x194);}return _0x3e6a1d;};}function handleError(_0x19a653,_0x4ce9d4){_0x4ce9d4=_0x4ce9d4||0x1f4;return function(_0x3a9092){logger['error'](_0x3a9092[_0x0a6b('0x2a')]);if(_0x3a9092[_0x0a6b('0x2b')]){delete _0x3a9092[_0x0a6b('0x2b')];}_0x19a653['status'](_0x4ce9d4)['send'](_0x3a9092);};}exports[_0x0a6b('0x2c')]=function(_0xe01bba,_0x1aecc7){var _0x3d649e={},_0x1935a3={},_0x2bbcb1={'count':0x0,'rows':[]};var _0x486f0d=_[_0x0a6b('0x2d')](db[_0x0a6b('0x2e')]['rawAttributes'],function(_0x4744d1){return{'name':_0x4744d1['fieldName'],'type':_0x4744d1['type'][_0x0a6b('0x2f')]};});_0x1935a3[_0x0a6b('0x30')]=_[_0x0a6b('0x2d')](_0x486f0d,_0x0a6b('0x2b'));_0x1935a3[_0x0a6b('0x31')]=_['keys'](_0xe01bba['query']);_0x1935a3[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],_0x1935a3[_0x0a6b('0x31')]);_0x3d649e['attributes']=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],qs['fields'](_0xe01bba['query'][_0x0a6b('0x34')]));_0x3d649e[_0x0a6b('0x35')]=_0x3d649e['attributes'][_0x0a6b('0x36')]?_0x3d649e[_0x0a6b('0x35')]:_0x1935a3[_0x0a6b('0x30')];if(!_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x37')](_0x0a6b('0x38'))){_0x3d649e[_0x0a6b('0x1f')]=qs[_0x0a6b('0x1f')](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x1f')]);_0x3d649e[_0x0a6b('0x20')]=qs[_0x0a6b('0x20')](_0xe01bba['query'][_0x0a6b('0x20')]);}_0x3d649e[_0x0a6b('0x39')]=qs['sort'](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3a')]);_0x3d649e[_0x0a6b('0x3b')]=qs[_0x0a6b('0x32')](_[_0x0a6b('0x3c')](_0xe01bba[_0x0a6b('0x31')],_0x1935a3[_0x0a6b('0x32')]),_0x486f0d);if(_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3d')]){_0x3d649e['where']=_[_0x0a6b('0x3e')](_0x3d649e[_0x0a6b('0x3b')],{'$or':_[_0x0a6b('0x2d')](_0x486f0d,function(_0x2f7e4b){if(_0x2f7e4b[_0x0a6b('0x3f')]!==_0x0a6b('0x40')){var _0x25254d={};_0x25254d[_0x2f7e4b[_0x0a6b('0x2b')]]={'$like':'%'+_0xe01bba[_0x0a6b('0x31')]['filter']+'%'};return _0x25254d;}})});}_0x3d649e=_[_0x0a6b('0x3e')]({},_0x3d649e,_0xe01bba[_0x0a6b('0x41')]);var _0x3aa7d5={'where':_0x3d649e[_0x0a6b('0x3b')]};return db[_0x0a6b('0x2e')][_0x0a6b('0x21')](_0x3aa7d5)[_0x0a6b('0x28')](function(_0x127e20){_0x2bbcb1[_0x0a6b('0x21')]=_0x127e20;if(_0xe01bba['query'][_0x0a6b('0x42')]){_0x3d649e['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x0a6b('0x43')](_0x3d649e);})['then'](function(_0x556a28){_0x2bbcb1[_0x0a6b('0x44')]=_0x556a28;return _0x2bbcb1;})[_0x0a6b('0x28')](respondWithFilteredResult(_0x1aecc7,_0x3d649e))[_0x0a6b('0x45')](handleError(_0x1aecc7,null));};exports['show']=function(_0x445a7b,_0x4d32bf){var _0x531f94={'raw':!![],'where':{'id':_0x445a7b['params']['id']}},_0x1114f1={};_0x1114f1[_0x0a6b('0x30')]=_['keys'](db[_0x0a6b('0x2e')]['rawAttributes']);_0x1114f1['query']=_[_0x0a6b('0x46')](_0x445a7b[_0x0a6b('0x31')]);_0x1114f1[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1114f1['model'],_0x1114f1[_0x0a6b('0x31')]);_0x531f94[_0x0a6b('0x35')]=_[_0x0a6b('0x33')](_0x1114f1[_0x0a6b('0x30')],qs[_0x0a6b('0x34')](_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x34')]));_0x531f94['attributes']=_0x531f94[_0x0a6b('0x35')][_0x0a6b('0x36')]?_0x531f94[_0x0a6b('0x35')]:_0x1114f1[_0x0a6b('0x30')];if(_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x42')]){_0x531f94[_0x0a6b('0x47')]=[{'all':!![]}];}_0x531f94=_[_0x0a6b('0x3e')]({},_0x531f94,_0x445a7b[_0x0a6b('0x41')]);return db['ChatQueueReport'][_0x0a6b('0x48')](_0x531f94)[_0x0a6b('0x28')](handleEntityNotFound(_0x4d32bf,null))[_0x0a6b('0x28')](respondWithResult(_0x4d32bf,null))[_0x0a6b('0x45')](handleError(_0x4d32bf,null));};exports[_0x0a6b('0x49')]=function(_0x638ba8,_0x8f1372){return db['ChatQueueReport']['create'](_0x638ba8[_0x0a6b('0x4a')],{})[_0x0a6b('0x28')](respondWithResult(_0x8f1372,0xc9))[_0x0a6b('0x45')](handleError(_0x8f1372,null));};exports[_0x0a6b('0x26')]=function(_0x2ca82a,_0x446187){if(_0x2ca82a[_0x0a6b('0x4a')]['id']){delete _0x2ca82a[_0x0a6b('0x4a')]['id'];}return db[_0x0a6b('0x2e')]['find']({'where':{'id':_0x2ca82a[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x446187,null))[_0x0a6b('0x28')](saveUpdates(_0x2ca82a[_0x0a6b('0x4a')],null))[_0x0a6b('0x28')](respondWithResult(_0x446187,null))['catch'](handleError(_0x446187,null));};exports[_0x0a6b('0x27')]=function(_0x3fd0df,_0x3aa85f){return db[_0x0a6b('0x2e')][_0x0a6b('0x48')]({'where':{'id':_0x3fd0df[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x3aa85f,null))[_0x0a6b('0x28')](removeEntity(_0x3aa85f,null))[_0x0a6b('0x45')](handleError(_0x3aa85f,null));};exports[_0x0a6b('0x4c')]=function(_0x5d8a4f,_0x4c81a7){return db[_0x0a6b('0x2e')]['describe']()[_0x0a6b('0x28')](respondWithResult(_0x4c81a7,null))['catch'](handleError(_0x4c81a7,null));}; \ No newline at end of file +var _0xc7a3=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x5a8ef6,_0x36dd17){var _0x39966e=function(_0x5f0a4a){while(--_0x5f0a4a){_0x5a8ef6['push'](_0x5a8ef6['shift']());}};_0x39966e(++_0x36dd17);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x2aa9c1,_0x3321e7){_0x2aa9c1=_0x2aa9c1-0x0;var _0x5d4f10=_0xc7a3[_0x2aa9c1];return _0x5d4f10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c7a('0x0'));var zipdir=require(_0x3c7a('0x1'));var jsonpatch=require(_0x3c7a('0x2'));var rp=require(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var Mustache=require('mustache');var util=require(_0x3c7a('0x6'));var path=require(_0x3c7a('0x7'));var sox=require('sox');var csv=require(_0x3c7a('0x8'));var ejs=require(_0x3c7a('0x9'));var fs=require('fs');var fs_extra=require(_0x3c7a('0xa'));var _=require('lodash');var squel=require(_0x3c7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c7a('0x8'));var querystring=require(_0x3c7a('0xd'));var Papa=require(_0x3c7a('0xe'));var Redis=require('ioredis');var authService=require(_0x3c7a('0xf'));var qs=require(_0x3c7a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7a('0x11'));var logger=require('../../config/logger')(_0x3c7a('0x12'));var utils=require('../../config/utils');var config=require(_0x3c7a('0x13'));var licenseUtil=require(_0x3c7a('0x14'));var db=require(_0x3c7a('0x15'))['db'];function respondWithStatusCode(_0x16ea63,_0x3d47c3){_0x3d47c3=_0x3d47c3||0xcc;return function(_0x53e5d7){if(_0x53e5d7){return _0x16ea63[_0x3c7a('0x16')](_0x3d47c3);}return _0x16ea63[_0x3c7a('0x17')](_0x3d47c3)[_0x3c7a('0x18')]();};}function respondWithResult(_0x36185c,_0x24d188){_0x24d188=_0x24d188||0xc8;return function(_0x4e6ca5){if(_0x4e6ca5){return _0x36185c[_0x3c7a('0x17')](_0x24d188)[_0x3c7a('0x19')](_0x4e6ca5);}};}function respondWithFilteredResult(_0x5af0a6,_0x539270){return function(_0x3044e6){if(_0x3044e6){var _0xb9201c=typeof _0x539270[_0x3c7a('0x1a')]==='undefined'&&typeof _0x539270[_0x3c7a('0x1b')]==='undefined';var _0x74fd1e=_0x3044e6[_0x3c7a('0x1c')];var _0x36e8c2=_0xb9201c?0x0:_0x539270[_0x3c7a('0x1a')];var _0x3cb5bf=_0xb9201c?_0x3044e6[_0x3c7a('0x1c')]:_0x539270['offset']+_0x539270[_0x3c7a('0x1b')];var _0x2db9df;if(_0x3cb5bf>=_0x74fd1e){_0x3cb5bf=_0x74fd1e;_0x2db9df=0xc8;}else{_0x2db9df=0xce;}_0x5af0a6[_0x3c7a('0x17')](_0x2db9df);return _0x5af0a6[_0x3c7a('0x1d')](_0x3c7a('0x1e'),_0x36e8c2+'-'+_0x3cb5bf+'/'+_0x74fd1e)[_0x3c7a('0x19')](_0x3044e6);}return null;};}function patchUpdates(_0x11a06b){return function(_0x34f4a6){try{jsonpatch[_0x3c7a('0x1f')](_0x34f4a6,_0x11a06b,!![]);}catch(_0x544742){return BPromise[_0x3c7a('0x20')](_0x544742);}return _0x34f4a6['save']();};}function saveUpdates(_0x3c75ff,_0x557518){return function(_0x40d24e){if(_0x40d24e){return _0x40d24e[_0x3c7a('0x21')](_0x3c75ff)[_0x3c7a('0x22')](function(_0x7dbe38){return _0x7dbe38;});}return null;};}function removeEntity(_0x283568,_0x245dde){return function(_0x8251d4){if(_0x8251d4){return _0x8251d4[_0x3c7a('0x23')]()[_0x3c7a('0x22')](function(){_0x283568[_0x3c7a('0x17')](0xcc)[_0x3c7a('0x18')]();});}};}function handleEntityNotFound(_0x317fbd,_0x56539f){return function(_0x3984a1){if(!_0x3984a1){_0x317fbd[_0x3c7a('0x16')](0x194);}return _0x3984a1;};}function handleError(_0x37cc40,_0x3829de){_0x3829de=_0x3829de||0x1f4;return function(_0x9b910c){logger[_0x3c7a('0x24')](_0x9b910c[_0x3c7a('0x25')]);if(_0x9b910c[_0x3c7a('0x26')]){delete _0x9b910c['name'];}_0x37cc40[_0x3c7a('0x17')](_0x3829de)[_0x3c7a('0x27')](_0x9b910c);};}exports[_0x3c7a('0x28')]=function(_0x197012,_0x33065b){var _0x1a96a0={},_0xccf304={},_0x1ff595={'count':0x0,'rows':[]};var _0x508d2e=_[_0x3c7a('0x29')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')],function(_0x18a346){return{'name':_0x18a346[_0x3c7a('0x2c')],'type':_0x18a346[_0x3c7a('0x2d')][_0x3c7a('0x2e')]};});_0xccf304[_0x3c7a('0x2f')]=_[_0x3c7a('0x29')](_0x508d2e,_0x3c7a('0x26'));_0xccf304[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x197012[_0x3c7a('0x30')]);_0xccf304['filters']=_['intersection'](_0xccf304['model'],_0xccf304['query']);_0x1a96a0[_0x3c7a('0x32')]=_[_0x3c7a('0x33')](_0xccf304[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x1a96a0[_0x3c7a('0x32')]=_0x1a96a0[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x1a96a0[_0x3c7a('0x32')]:_0xccf304[_0x3c7a('0x2f')];if(!_0x197012[_0x3c7a('0x30')][_0x3c7a('0x36')](_0x3c7a('0x37'))){_0x1a96a0['limit']=qs[_0x3c7a('0x1b')](_0x197012[_0x3c7a('0x30')]['limit']);_0x1a96a0[_0x3c7a('0x1a')]=qs['offset'](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x1a')]);}_0x1a96a0['order']=qs[_0x3c7a('0x38')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x38')]);_0x1a96a0[_0x3c7a('0x39')]=qs[_0x3c7a('0x3a')](_[_0x3c7a('0x3b')](_0x197012[_0x3c7a('0x30')],_0xccf304[_0x3c7a('0x3a')]),_0x508d2e);if(_0x197012[_0x3c7a('0x30')][_0x3c7a('0x3c')]){_0x1a96a0['where']=_[_0x3c7a('0x3d')](_0x1a96a0[_0x3c7a('0x39')],{'$or':_[_0x3c7a('0x29')](_0x508d2e,function(_0x43c236){if(_0x43c236[_0x3c7a('0x2d')]!==_0x3c7a('0x3e')){var _0x101e5d={};_0x101e5d[_0x43c236[_0x3c7a('0x26')]]={'$like':'%'+_0x197012['query'][_0x3c7a('0x3c')]+'%'};return _0x101e5d;}})});}_0x1a96a0=_[_0x3c7a('0x3d')]({},_0x1a96a0,_0x197012['options']);var _0x442087={'where':_0x1a96a0['where']};return db['ChatQueueReport']['count'](_0x442087)['then'](function(_0x44e935){_0x1ff595[_0x3c7a('0x1c')]=_0x44e935;if(_0x197012[_0x3c7a('0x30')]['includeAll']){_0x1a96a0[_0x3c7a('0x3f')]=[{'all':!![]}];}return db[_0x3c7a('0x2a')]['findAll'](_0x1a96a0);})['then'](function(_0x491335){_0x1ff595[_0x3c7a('0x40')]=_0x491335;return _0x1ff595;})[_0x3c7a('0x22')](respondWithFilteredResult(_0x33065b,_0x1a96a0))[_0x3c7a('0x41')](handleError(_0x33065b,null));};exports[_0x3c7a('0x42')]=function(_0x8d805a,_0x3e6a70){var _0x3f6060={'raw':!![],'where':{'id':_0x8d805a[_0x3c7a('0x43')]['id']}},_0x302556={};_0x302556[_0x3c7a('0x2f')]=_[_0x3c7a('0x31')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')]);_0x302556[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x8d805a['query']);_0x302556[_0x3c7a('0x3a')]=_[_0x3c7a('0x33')](_0x302556['model'],_0x302556['query']);_0x3f6060['attributes']=_[_0x3c7a('0x33')](_0x302556[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x8d805a[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x3f6060[_0x3c7a('0x32')]=_0x3f6060[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x3f6060[_0x3c7a('0x32')]:_0x302556[_0x3c7a('0x2f')];if(_0x8d805a[_0x3c7a('0x30')]['includeAll']){_0x3f6060['include']=[{'all':!![]}];}_0x3f6060=_['merge']({},_0x3f6060,_0x8d805a[_0x3c7a('0x44')]);return db[_0x3c7a('0x2a')][_0x3c7a('0x45')](_0x3f6060)[_0x3c7a('0x22')](handleEntityNotFound(_0x3e6a70,null))[_0x3c7a('0x22')](respondWithResult(_0x3e6a70,null))['catch'](handleError(_0x3e6a70,null));};exports[_0x3c7a('0x46')]=function(_0x12b69a,_0x2eb9e2){return db[_0x3c7a('0x2a')][_0x3c7a('0x46')](_0x12b69a[_0x3c7a('0x47')],{})[_0x3c7a('0x22')](respondWithResult(_0x2eb9e2,0xc9))['catch'](handleError(_0x2eb9e2,null));};exports['update']=function(_0x420fa7,_0x350ea7){if(_0x420fa7[_0x3c7a('0x47')]['id']){delete _0x420fa7[_0x3c7a('0x47')]['id'];}return db[_0x3c7a('0x2a')][_0x3c7a('0x45')]({'where':{'id':_0x420fa7['params']['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x350ea7,null))['then'](saveUpdates(_0x420fa7['body'],null))[_0x3c7a('0x22')](respondWithResult(_0x350ea7,null))[_0x3c7a('0x41')](handleError(_0x350ea7,null));};exports[_0x3c7a('0x23')]=function(_0x50b5e4,_0x5759a0){return db['ChatQueueReport']['find']({'where':{'id':_0x50b5e4[_0x3c7a('0x43')]['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x5759a0,null))[_0x3c7a('0x22')](removeEntity(_0x5759a0,null))[_0x3c7a('0x41')](handleError(_0x5759a0,null));};exports[_0x3c7a('0x48')]=function(_0x11f7ee,_0x124411){return db[_0x3c7a('0x2a')][_0x3c7a('0x48')]()[_0x3c7a('0x22')](respondWithResult(_0x124411,null))[_0x3c7a('0x41')](handleError(_0x124411,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index bcc6c52..875a5fe 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x2bb62e,_0x3d2f2f){var _0x3e85a2=function(_0x1b4fff){while(--_0x1b4fff){_0x2bb62e['push'](_0x2bb62e['shift']());}};_0x3e85a2(++_0x3d2f2f);}(_0x757a,0xde));var _0xa757=function(_0x1949e8,_0x379ae3){_0x1949e8=_0x1949e8-0x0;var _0xec336=_0x757a[_0x1949e8];return _0xec336;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x29aae6,_0x14c536){var _0x4be4e0=function(_0x16048e){while(--_0x16048e){_0x29aae6['push'](_0x29aae6['shift']());}};_0x4be4e0(++_0x14c536);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index cda32cb..d99713a 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 _0x12b3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','where','attributes','limit','lodash','util','bluebird'];(function(_0x3cf3ea,_0x39ea7e){var _0x4cd6c0=function(_0x4f1aeb){while(--_0x4f1aeb){_0x3cf3ea['push'](_0x3cf3ea['shift']());}};_0x4cd6c0(++_0x39ea7e);}(_0x12b3,0xcf));var _0x312b=function(_0x14bbe3,_0x3841d0){_0x14bbe3=_0x14bbe3-0x0;var _0x120e90=_0x12b3[_0x14bbe3];return _0x120e90;};'use strict';var _=require(_0x312b('0x0'));var util=require(_0x312b('0x1'));var moment=require('moment');var BPromise=require(_0x312b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x312b('0x3'))['db'];var utils=require(_0x312b('0x4'));var logger=require(_0x312b('0x5'))(_0x312b('0x6'));var config=require(_0x312b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x80db09,_0x3a753e,_0x343e1e){return new BPromise(function(_0x3873cb,_0x598b2e){return client['request'](_0x80db09,_0x343e1e)[_0x312b('0x8')](function(_0x35accd){logger['info'](_0x312b('0x9'),_0x3a753e,_0x312b('0xa'));logger[_0x312b('0xb')](_0x312b('0xc'),_0x3a753e,_0x312b('0xa'),JSON['stringify'](_0x35accd));if(_0x35accd[_0x312b('0xd')]){if(_0x35accd['error'][_0x312b('0xe')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3a753e,_0x35accd[_0x312b('0xd')]['message']);return _0x598b2e(_0x35accd['error']['message']);}logger[_0x312b('0xd')](_0x312b('0x9'),_0x3a753e,_0x35accd[_0x312b('0xd')][_0x312b('0xf')]);return _0x3873cb(_0x35accd[_0x312b('0xd')][_0x312b('0xf')]);}else{logger[_0x312b('0x10')](_0x312b('0x9'),_0x3a753e,_0x312b('0xa'));_0x3873cb(_0x35accd[_0x312b('0x11')][_0x312b('0xf')]);}})[_0x312b('0x12')](function(_0x102364){logger['error'](_0x312b('0x9'),_0x3a753e,_0x102364);_0x598b2e(_0x102364);});});}exports['CreateChatQueueReport']=function(_0xb84e3c){var _0x29a799=this;return new Promise(function(_0x454c3b,_0x3c7b21){return db[_0x312b('0x13')][_0x312b('0x14')](_0xb84e3c[_0x312b('0x15')],{'raw':_0xb84e3c[_0x312b('0x16')]?_0xb84e3c[_0x312b('0x16')][_0x312b('0x17')]===undefined?!![]:![]:!![]})[_0x312b('0x8')](function(_0x466c27){logger[_0x312b('0x10')](_0x312b('0x18'),_0xb84e3c);logger[_0x312b('0xb')](_0x312b('0x18'),_0xb84e3c,JSON[_0x312b('0x19')](_0x466c27));_0x454c3b(_0x466c27);})[_0x312b('0x12')](function(_0x1752b0){logger[_0x312b('0xd')]('CreateChatQueueReport',_0x1752b0['message'],_0xb84e3c);_0x3c7b21(_0x29a799[_0x312b('0xd')](0x1f4,_0x1752b0[_0x312b('0xf')]));});});};exports[_0x312b('0x1a')]=function(_0x36af19){var _0x4248e0=this;return new Promise(function(_0x34c37e,_0x1b753f){return db[_0x312b('0x13')]['update'](_0x36af19[_0x312b('0x15')],{'raw':_0x36af19[_0x312b('0x16')]?_0x36af19[_0x312b('0x16')][_0x312b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36af19[_0x312b('0x16')]?_0x36af19['options'][_0x312b('0x1b')]||null:null,'attributes':_0x36af19['options']?_0x36af19[_0x312b('0x16')][_0x312b('0x1c')]||null:null,'limit':_0x36af19[_0x312b('0x16')]?_0x36af19[_0x312b('0x16')][_0x312b('0x1d')]||null:null})[_0x312b('0x8')](function(_0x3983b3){logger[_0x312b('0x10')](_0x312b('0x1a'),_0x36af19);logger[_0x312b('0xb')](_0x312b('0x1a'),_0x36af19,JSON[_0x312b('0x19')](_0x3983b3));_0x34c37e(_0x3983b3);})['catch'](function(_0x4cd696){logger[_0x312b('0xd')](_0x312b('0x1a'),_0x4cd696['message'],_0x36af19);_0x1b753f(_0x4248e0[_0x312b('0xd')](0x1f4,_0x4cd696[_0x312b('0xf')]));});});}; \ No newline at end of file +var _0x663a=['result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','where','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','../../mysqldb','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x663a,0x119));var _0xa663=function(_0xe9b2c4,_0xac14d4){_0xe9b2c4=_0xe9b2c4-0x0;var _0x1fbda2=_0x663a[_0xe9b2c4];return _0x1fbda2;};'use strict';var _=require(_0xa663('0x0'));var util=require(_0xa663('0x1'));var moment=require(_0xa663('0x2'));var BPromise=require(_0xa663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa663('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa663('0x5'));var client=jayson['client'][_0xa663('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4c3abd,_0x583cbf,_0x11730c){return new BPromise(function(_0x527c06,_0xeb2d61){return client[_0xa663('0x7')](_0x4c3abd,_0x11730c)[_0xa663('0x8')](function(_0x4535ff){logger[_0xa663('0x9')](_0xa663('0xa'),_0x583cbf,'request\x20sent');logger[_0xa663('0xb')](_0xa663('0xc'),_0x583cbf,'request\x20sent',JSON[_0xa663('0xd')](_0x4535ff));if(_0x4535ff[_0xa663('0xe')]){if(_0x4535ff[_0xa663('0xe')]['code']===0x1f4){logger[_0xa663('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x583cbf,_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);return _0xeb2d61(_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);}logger[_0xa663('0xe')](_0xa663('0xa'),_0x583cbf,_0x4535ff['error'][_0xa663('0xf')]);return _0x527c06(_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);}else{logger[_0xa663('0x9')](_0xa663('0xa'),_0x583cbf,'request\x20sent');_0x527c06(_0x4535ff[_0xa663('0x10')][_0xa663('0xf')]);}})[_0xa663('0x11')](function(_0x25d390){logger['error'](_0xa663('0xa'),_0x583cbf,_0x25d390);_0xeb2d61(_0x25d390);});});}exports[_0xa663('0x12')]=function(_0x5abb3d){var _0x2efeb9=this;return new Promise(function(_0x30f00e,_0x1e967c){return db[_0xa663('0x13')][_0xa663('0x14')](_0x5abb3d[_0xa663('0x15')],{'raw':_0x5abb3d['options']?_0x5abb3d[_0xa663('0x16')][_0xa663('0x17')]===undefined?!![]:![]:!![]})[_0xa663('0x8')](function(_0x5e7116){logger[_0xa663('0x9')]('CreateChatQueueReport',_0x5abb3d);logger[_0xa663('0xb')](_0xa663('0x12'),_0x5abb3d,JSON[_0xa663('0xd')](_0x5e7116));_0x30f00e(_0x5e7116);})[_0xa663('0x11')](function(_0x1abd78){logger['error']('CreateChatQueueReport',_0x1abd78[_0xa663('0xf')],_0x5abb3d);_0x1e967c(_0x2efeb9['error'](0x1f4,_0x1abd78[_0xa663('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x3d080c){var _0x63a259=this;return new Promise(function(_0x5f016e,_0x1f467b){return db['ChatQueueReport']['update'](_0x3d080c[_0xa663('0x15')],{'raw':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')][_0xa663('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')][_0xa663('0x18')]||null:null,'attributes':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')]['attributes']||null:null,'limit':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')][_0xa663('0x19')]||null:null})[_0xa663('0x8')](function(_0x16fc80){logger['info']('UpdateChatQueueReport',_0x3d080c);logger[_0xa663('0xb')](_0xa663('0x1a'),_0x3d080c,JSON[_0xa663('0xd')](_0x16fc80));_0x5f016e(_0x16fc80);})[_0xa663('0x11')](function(_0x282556){logger[_0xa663('0xe')](_0xa663('0x1a'),_0x282556[_0xa663('0xf')],_0x3d080c);_0x1f467b(_0x63a259[_0xa663('0xe')](0x1f4,_0x282556['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 8c4c958..bf81ed8 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 _0x3aae=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x3aae,0x1bc));var _0xe3aa=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3aae[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xe3aa('0x0'));var util=require(_0xe3aa('0x1'));var path=require(_0xe3aa('0x2'));var timeout=require(_0xe3aa('0x3'));var express=require('express');var router=express[_0xe3aa('0x4')]();var fs_extra=require(_0xe3aa('0x5'));var auth=require(_0xe3aa('0x6'));var interaction=require(_0xe3aa('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xe3aa('0x8')]('/',auth[_0xe3aa('0x9')](),controller[_0xe3aa('0xa')]);router['get'](_0xe3aa('0xb'),auth['isAuthenticated'](),controller[_0xe3aa('0xc')]);router[_0xe3aa('0x8')](_0xe3aa('0xd'),auth[_0xe3aa('0x9')](),controller[_0xe3aa('0xe')]);router[_0xe3aa('0xf')]('/',auth[_0xe3aa('0x9')](),controller['create']);router[_0xe3aa('0x10')](_0xe3aa('0xd'),auth[_0xe3aa('0x9')](),controller[_0xe3aa('0x11')]);router['delete'](_0xe3aa('0xd'),auth[_0xe3aa('0x9')](),controller[_0xe3aa('0x12')]);module[_0xe3aa('0x13')]=router; \ No newline at end of file +var _0xc355=['get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x4afd7f,_0x124b6f){var _0x4d1b6c=function(_0xaae48d){while(--_0xaae48d){_0x4afd7f['push'](_0x4afd7f['shift']());}};_0x4d1b6c(++_0x124b6f);}(_0xc355,0x12a));var _0x5c35=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xc355[_0x49c68e];return _0x33032b;};'use strict';var multer=require('multer');var util=require(_0x5c35('0x0'));var path=require('path');var timeout=require(_0x5c35('0x1'));var express=require(_0x5c35('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5c35('0x3'));var config=require(_0x5c35('0x4'));var controller=require(_0x5c35('0x5'));router[_0x5c35('0x6')]('/',auth[_0x5c35('0x7')](),controller['index']);router[_0x5c35('0x6')](_0x5c35('0x8'),auth[_0x5c35('0x7')](),controller['describe']);router['get'](_0x5c35('0x9'),auth['isAuthenticated'](),controller[_0x5c35('0xa')]);router[_0x5c35('0xb')]('/',auth[_0x5c35('0x7')](),controller[_0x5c35('0xc')]);router[_0x5c35('0xd')](_0x5c35('0x9'),auth['isAuthenticated'](),controller[_0x5c35('0xe')]);router[_0x5c35('0xf')](_0x5c35('0x9'),auth['isAuthenticated'](),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 4039561..9ecc5fa 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3eaf93,_0x3361ad){var _0xea6aa1=function(_0x4c48f2){while(--_0x4c48f2){_0x3eaf93['push'](_0x3eaf93['shift']());}};_0xea6aa1(++_0x3361ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x269a42,_0x13c53c){var _0x1e76c1=function(_0x42c070){while(--_0x42c070){_0x269a42['push'](_0x269a42['shift']());}};_0x1e76c1(++_0x13c53c);}(_0x70e0,0x17b));var _0x070e=function(_0x340546,_0x4a08df){_0x340546=_0x340546-0x0;var _0x11ba79=_0x70e0[_0x340546];return _0x11ba79;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 290eb11..a8d9122 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 _0x4d3b=['../../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','send','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4d3b,0x16a));var _0xb4d3=function(_0x3c1655,_0x21e6a9){_0x3c1655=_0x3c1655-0x0;var _0x26578e=_0x4d3b[_0x3c1655];return _0x26578e;};'use strict';var emlformat=require(_0xb4d3('0x0'));var rimraf=require(_0xb4d3('0x1'));var zipdir=require(_0xb4d3('0x2'));var jsonpatch=require(_0xb4d3('0x3'));var rp=require('request-promise');var moment=require(_0xb4d3('0x4'));var BPromise=require(_0xb4d3('0x5'));var Mustache=require('mustache');var util=require(_0xb4d3('0x6'));var path=require('path');var sox=require(_0xb4d3('0x7'));var csv=require('to-csv');var ejs=require(_0xb4d3('0x8'));var fs=require('fs');var fs_extra=require(_0xb4d3('0x9'));var _=require(_0xb4d3('0xa'));var squel=require('squel');var crypto=require(_0xb4d3('0xb'));var jsforce=require(_0xb4d3('0xc'));var deskjs=require(_0xb4d3('0xd'));var toCsv=require(_0xb4d3('0xe'));var querystring=require(_0xb4d3('0xf'));var Papa=require('papaparse');var Redis=require(_0xb4d3('0x10'));var authService=require(_0xb4d3('0x11'));var qs=require(_0xb4d3('0x12'));var as=require(_0xb4d3('0x13'));var hardwareService=require(_0xb4d3('0x14'));var logger=require('../../config/logger')(_0xb4d3('0x15'));var utils=require(_0xb4d3('0x16'));var config=require(_0xb4d3('0x17'));var licenseUtil=require(_0xb4d3('0x18'));var db=require(_0xb4d3('0x19'))['db'];function respondWithStatusCode(_0x1296ed,_0x66098c){_0x66098c=_0x66098c||0xcc;return function(_0x2e59b0){if(_0x2e59b0){return _0x1296ed[_0xb4d3('0x1a')](_0x66098c);}return _0x1296ed[_0xb4d3('0x1b')](_0x66098c)[_0xb4d3('0x1c')]();};}function respondWithResult(_0x4255c4,_0x139c2c){_0x139c2c=_0x139c2c||0xc8;return function(_0x5a3a61){if(_0x5a3a61){return _0x4255c4[_0xb4d3('0x1b')](_0x139c2c)['json'](_0x5a3a61);}};}function respondWithFilteredResult(_0x386f7d,_0x9dc743){return function(_0x2d1e69){if(_0x2d1e69){var _0x22f95a=typeof _0x9dc743['offset']===_0xb4d3('0x1d')&&typeof _0x9dc743[_0xb4d3('0x1e')]===_0xb4d3('0x1d');var _0x353f2b=_0x2d1e69[_0xb4d3('0x1f')];var _0x2ac4e8=_0x22f95a?0x0:_0x9dc743[_0xb4d3('0x20')];var _0x2907fa=_0x22f95a?_0x2d1e69[_0xb4d3('0x1f')]:_0x9dc743[_0xb4d3('0x20')]+_0x9dc743[_0xb4d3('0x1e')];var _0x594b10;if(_0x2907fa>=_0x353f2b){_0x2907fa=_0x353f2b;_0x594b10=0xc8;}else{_0x594b10=0xce;}_0x386f7d[_0xb4d3('0x1b')](_0x594b10);return _0x386f7d[_0xb4d3('0x21')](_0xb4d3('0x22'),_0x2ac4e8+'-'+_0x2907fa+'/'+_0x353f2b)[_0xb4d3('0x23')](_0x2d1e69);}return null;};}function patchUpdates(_0x5ddbb5){return function(_0x4a8f21){try{jsonpatch[_0xb4d3('0x24')](_0x4a8f21,_0x5ddbb5,!![]);}catch(_0x45eb96){return BPromise[_0xb4d3('0x25')](_0x45eb96);}return _0x4a8f21['save']();};}function saveUpdates(_0x2cc625,_0x4ac9a8){return function(_0x5ecd23){if(_0x5ecd23){return _0x5ecd23[_0xb4d3('0x26')](_0x2cc625)[_0xb4d3('0x27')](function(_0xb025d8){return _0xb025d8;});}return null;};}function removeEntity(_0x333432,_0x5231ea){return function(_0x4eadfd){if(_0x4eadfd){return _0x4eadfd[_0xb4d3('0x28')]()[_0xb4d3('0x27')](function(){_0x333432[_0xb4d3('0x1b')](0xcc)[_0xb4d3('0x1c')]();});}};}function handleEntityNotFound(_0x3117f8,_0x169b6a){return function(_0x24ff1f){if(!_0x24ff1f){_0x3117f8[_0xb4d3('0x1a')](0x194);}return _0x24ff1f;};}function handleError(_0x3ceb5a,_0x2960ec){_0x2960ec=_0x2960ec||0x1f4;return function(_0x13896d){logger[_0xb4d3('0x29')](_0x13896d[_0xb4d3('0x2a')]);if(_0x13896d[_0xb4d3('0x2b')]){delete _0x13896d['name'];}_0x3ceb5a[_0xb4d3('0x1b')](_0x2960ec)[_0xb4d3('0x2c')](_0x13896d);};}exports['index']=function(_0x12c588,_0x30aeae){var _0x1bbf72={},_0xd6bac={},_0x18c86c={'count':0x0,'rows':[]};var _0x168191=_[_0xb4d3('0x2d')](db[_0xb4d3('0x2e')]['rawAttributes'],function(_0x54d043){return{'name':_0x54d043[_0xb4d3('0x2f')],'type':_0x54d043[_0xb4d3('0x30')][_0xb4d3('0x31')]};});_0xd6bac[_0xb4d3('0x32')]=_['map'](_0x168191,_0xb4d3('0x2b'));_0xd6bac[_0xb4d3('0x33')]=_[_0xb4d3('0x34')](_0x12c588[_0xb4d3('0x33')]);_0xd6bac[_0xb4d3('0x35')]=_[_0xb4d3('0x36')](_0xd6bac[_0xb4d3('0x32')],_0xd6bac[_0xb4d3('0x33')]);_0x1bbf72['attributes']=_[_0xb4d3('0x36')](_0xd6bac['model'],qs['fields'](_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x37')]));_0x1bbf72['attributes']=_0x1bbf72[_0xb4d3('0x38')][_0xb4d3('0x39')]?_0x1bbf72[_0xb4d3('0x38')]:_0xd6bac[_0xb4d3('0x32')];if(!_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x3a')]('nolimit')){_0x1bbf72[_0xb4d3('0x1e')]=qs[_0xb4d3('0x1e')](_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x1e')]);_0x1bbf72[_0xb4d3('0x20')]=qs['offset'](_0x12c588[_0xb4d3('0x33')]['offset']);}_0x1bbf72[_0xb4d3('0x3b')]=qs['sort'](_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x3c')]);_0x1bbf72[_0xb4d3('0x3d')]=qs[_0xb4d3('0x35')](_[_0xb4d3('0x3e')](_0x12c588[_0xb4d3('0x33')],_0xd6bac['filters']),_0x168191);if(_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x3f')]){_0x1bbf72[_0xb4d3('0x3d')]=_[_0xb4d3('0x40')](_0x1bbf72[_0xb4d3('0x3d')],{'$or':_[_0xb4d3('0x2d')](_0x168191,function(_0x52fd4e){if(_0x52fd4e['type']!==_0xb4d3('0x41')){var _0x11d36e={};_0x11d36e[_0x52fd4e[_0xb4d3('0x2b')]]={'$like':'%'+_0x12c588['query']['filter']+'%'};return _0x11d36e;}})});}_0x1bbf72=_['merge']({},_0x1bbf72,_0x12c588[_0xb4d3('0x42')]);var _0x4747f8={'where':_0x1bbf72[_0xb4d3('0x3d')]};return db[_0xb4d3('0x2e')][_0xb4d3('0x1f')](_0x4747f8)[_0xb4d3('0x27')](function(_0x245cca){_0x18c86c[_0xb4d3('0x1f')]=_0x245cca;if(_0x12c588[_0xb4d3('0x33')]['includeAll']){_0x1bbf72[_0xb4d3('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xb4d3('0x44')](_0x1bbf72);})[_0xb4d3('0x27')](function(_0x522404){_0x18c86c[_0xb4d3('0x45')]=_0x522404;return _0x18c86c;})[_0xb4d3('0x27')](respondWithFilteredResult(_0x30aeae,_0x1bbf72))['catch'](handleError(_0x30aeae,null));};exports['show']=function(_0x65851f,_0x240048){var _0xaaecc8={'raw':!![],'where':{'id':_0x65851f[_0xb4d3('0x46')]['id']}},_0x27d717={};_0x27d717[_0xb4d3('0x32')]=_[_0xb4d3('0x34')](db[_0xb4d3('0x2e')][_0xb4d3('0x47')]);_0x27d717[_0xb4d3('0x33')]=_['keys'](_0x65851f[_0xb4d3('0x33')]);_0x27d717[_0xb4d3('0x35')]=_['intersection'](_0x27d717['model'],_0x27d717[_0xb4d3('0x33')]);_0xaaecc8['attributes']=_[_0xb4d3('0x36')](_0x27d717[_0xb4d3('0x32')],qs[_0xb4d3('0x37')](_0x65851f['query'][_0xb4d3('0x37')]));_0xaaecc8[_0xb4d3('0x38')]=_0xaaecc8[_0xb4d3('0x38')]['length']?_0xaaecc8[_0xb4d3('0x38')]:_0x27d717[_0xb4d3('0x32')];if(_0x65851f['query']['includeAll']){_0xaaecc8['include']=[{'all':!![]}];}_0xaaecc8=_[_0xb4d3('0x40')]({},_0xaaecc8,_0x65851f['options']);return db['ChatTransferReport'][_0xb4d3('0x48')](_0xaaecc8)[_0xb4d3('0x27')](handleEntityNotFound(_0x240048,null))[_0xb4d3('0x27')](respondWithResult(_0x240048,null))[_0xb4d3('0x49')](handleError(_0x240048,null));};exports[_0xb4d3('0x4a')]=function(_0x3c93e2,_0x4502d7){return db[_0xb4d3('0x2e')]['create'](_0x3c93e2[_0xb4d3('0x4b')],{})[_0xb4d3('0x27')](respondWithResult(_0x4502d7,0xc9))['catch'](handleError(_0x4502d7,null));};exports['update']=function(_0x222c2d,_0x4d36d9){if(_0x222c2d[_0xb4d3('0x4b')]['id']){delete _0x222c2d[_0xb4d3('0x4b')]['id'];}return db['ChatTransferReport'][_0xb4d3('0x48')]({'where':{'id':_0x222c2d['params']['id']}})['then'](handleEntityNotFound(_0x4d36d9,null))[_0xb4d3('0x27')](saveUpdates(_0x222c2d[_0xb4d3('0x4b')],null))[_0xb4d3('0x27')](respondWithResult(_0x4d36d9,null))[_0xb4d3('0x49')](handleError(_0x4d36d9,null));};exports[_0xb4d3('0x28')]=function(_0x5e3007,_0x266b05){return db[_0xb4d3('0x2e')][_0xb4d3('0x48')]({'where':{'id':_0x5e3007[_0xb4d3('0x46')]['id']}})[_0xb4d3('0x27')](handleEntityNotFound(_0x266b05,null))['then'](removeEntity(_0x266b05,null))[_0xb4d3('0x49')](handleError(_0x266b05,null));};exports['describe']=function(_0x2cc8ca,_0x5b6801){return db['ChatTransferReport'][_0xb4d3('0x4c')]()[_0xb4d3('0x27')](respondWithResult(_0x5b6801,null))[_0xb4d3('0x49')](handleError(_0x5b6801,null));}; \ No newline at end of file +var _0x4688=['count','set','Content-Range','apply','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','update','describe','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined'];(function(_0x89933d,_0x4f62c7){var _0x1ff617=function(_0x593584){while(--_0x593584){_0x89933d['push'](_0x89933d['shift']());}};_0x1ff617(++_0x4f62c7);}(_0x4688,0xbb));var _0x8468=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0x4688[_0x16a223];return _0x5ded66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8468('0x0'));var zipdir=require(_0x8468('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8468('0x2'));var BPromise=require(_0x8468('0x3'));var Mustache=require(_0x8468('0x4'));var util=require(_0x8468('0x5'));var path=require('path');var sox=require(_0x8468('0x6'));var csv=require('to-csv');var ejs=require(_0x8468('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8468('0x8'));var squel=require(_0x8468('0x9'));var crypto=require(_0x8468('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8468('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8468('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8468('0xd'));var as=require(_0x8468('0xe'));var hardwareService=require(_0x8468('0xf'));var logger=require(_0x8468('0x10'))('api');var utils=require(_0x8468('0x11'));var config=require(_0x8468('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x390488,_0x339b2b){_0x339b2b=_0x339b2b||0xcc;return function(_0x4abf9e){if(_0x4abf9e){return _0x390488[_0x8468('0x13')](_0x339b2b);}return _0x390488['status'](_0x339b2b)[_0x8468('0x14')]();};}function respondWithResult(_0x3f8391,_0x4e6bc6){_0x4e6bc6=_0x4e6bc6||0xc8;return function(_0x41e388){if(_0x41e388){return _0x3f8391[_0x8468('0x15')](_0x4e6bc6)[_0x8468('0x16')](_0x41e388);}};}function respondWithFilteredResult(_0x30a6ce,_0x4852f8){return function(_0x2dfdb5){if(_0x2dfdb5){var _0x4df04c=typeof _0x4852f8[_0x8468('0x17')]==='undefined'&&typeof _0x4852f8[_0x8468('0x18')]===_0x8468('0x19');var _0x47a564=_0x2dfdb5[_0x8468('0x1a')];var _0x519da9=_0x4df04c?0x0:_0x4852f8[_0x8468('0x17')];var _0x4f1bdf=_0x4df04c?_0x2dfdb5[_0x8468('0x1a')]:_0x4852f8[_0x8468('0x17')]+_0x4852f8[_0x8468('0x18')];var _0x5adca2;if(_0x4f1bdf>=_0x47a564){_0x4f1bdf=_0x47a564;_0x5adca2=0xc8;}else{_0x5adca2=0xce;}_0x30a6ce[_0x8468('0x15')](_0x5adca2);return _0x30a6ce[_0x8468('0x1b')](_0x8468('0x1c'),_0x519da9+'-'+_0x4f1bdf+'/'+_0x47a564)[_0x8468('0x16')](_0x2dfdb5);}return null;};}function patchUpdates(_0x417ce6){return function(_0x47b3b4){try{jsonpatch[_0x8468('0x1d')](_0x47b3b4,_0x417ce6,!![]);}catch(_0x138b9d){return BPromise['reject'](_0x138b9d);}return _0x47b3b4['save']();};}function saveUpdates(_0x53e976,_0x5b4b67){return function(_0x5ba6d1){if(_0x5ba6d1){return _0x5ba6d1['update'](_0x53e976)[_0x8468('0x1e')](function(_0x3ee1f5){return _0x3ee1f5;});}return null;};}function removeEntity(_0x3640c5,_0x534cd4){return function(_0x691a7b){if(_0x691a7b){return _0x691a7b[_0x8468('0x1f')]()[_0x8468('0x1e')](function(){_0x3640c5[_0x8468('0x15')](0xcc)[_0x8468('0x14')]();});}};}function handleEntityNotFound(_0x246137,_0xb51f71){return function(_0x42e7a1){if(!_0x42e7a1){_0x246137[_0x8468('0x13')](0x194);}return _0x42e7a1;};}function handleError(_0x1e1058,_0x313431){_0x313431=_0x313431||0x1f4;return function(_0x5ecdad){logger[_0x8468('0x20')](_0x5ecdad[_0x8468('0x21')]);if(_0x5ecdad[_0x8468('0x22')]){delete _0x5ecdad[_0x8468('0x22')];}_0x1e1058[_0x8468('0x15')](_0x313431)[_0x8468('0x23')](_0x5ecdad);};}exports['index']=function(_0x4ff73b,_0x3602a8){var _0x54743c={},_0x4df0af={},_0x495571={'count':0x0,'rows':[]};var _0x2fe030=_[_0x8468('0x24')](db[_0x8468('0x25')][_0x8468('0x26')],function(_0xe2026e){return{'name':_0xe2026e[_0x8468('0x27')],'type':_0xe2026e['type'][_0x8468('0x28')]};});_0x4df0af[_0x8468('0x29')]=_[_0x8468('0x24')](_0x2fe030,_0x8468('0x22'));_0x4df0af['query']=_[_0x8468('0x2a')](_0x4ff73b[_0x8468('0x2b')]);_0x4df0af[_0x8468('0x2c')]=_[_0x8468('0x2d')](_0x4df0af[_0x8468('0x29')],_0x4df0af['query']);_0x54743c['attributes']=_[_0x8468('0x2d')](_0x4df0af[_0x8468('0x29')],qs['fields'](_0x4ff73b[_0x8468('0x2b')][_0x8468('0x2e')]));_0x54743c[_0x8468('0x2f')]=_0x54743c[_0x8468('0x2f')]['length']?_0x54743c[_0x8468('0x2f')]:_0x4df0af[_0x8468('0x29')];if(!_0x4ff73b[_0x8468('0x2b')][_0x8468('0x30')](_0x8468('0x31'))){_0x54743c[_0x8468('0x18')]=qs[_0x8468('0x18')](_0x4ff73b[_0x8468('0x2b')][_0x8468('0x18')]);_0x54743c['offset']=qs[_0x8468('0x17')](_0x4ff73b[_0x8468('0x2b')][_0x8468('0x17')]);}_0x54743c[_0x8468('0x32')]=qs[_0x8468('0x33')](_0x4ff73b['query'][_0x8468('0x33')]);_0x54743c[_0x8468('0x34')]=qs[_0x8468('0x2c')](_[_0x8468('0x35')](_0x4ff73b['query'],_0x4df0af['filters']),_0x2fe030);if(_0x4ff73b[_0x8468('0x2b')][_0x8468('0x36')]){_0x54743c[_0x8468('0x34')]=_[_0x8468('0x37')](_0x54743c[_0x8468('0x34')],{'$or':_[_0x8468('0x24')](_0x2fe030,function(_0xede5f6){if(_0xede5f6[_0x8468('0x38')]!=='VIRTUAL'){var _0x2a0528={};_0x2a0528[_0xede5f6[_0x8468('0x22')]]={'$like':'%'+_0x4ff73b[_0x8468('0x2b')][_0x8468('0x36')]+'%'};return _0x2a0528;}})});}_0x54743c=_['merge']({},_0x54743c,_0x4ff73b[_0x8468('0x39')]);var _0x522941={'where':_0x54743c[_0x8468('0x34')]};return db[_0x8468('0x25')][_0x8468('0x1a')](_0x522941)['then'](function(_0x4fd13f){_0x495571['count']=_0x4fd13f;if(_0x4ff73b[_0x8468('0x2b')]['includeAll']){_0x54743c[_0x8468('0x3a')]=[{'all':!![]}];}return db[_0x8468('0x25')][_0x8468('0x3b')](_0x54743c);})[_0x8468('0x1e')](function(_0x726f05){_0x495571[_0x8468('0x3c')]=_0x726f05;return _0x495571;})[_0x8468('0x1e')](respondWithFilteredResult(_0x3602a8,_0x54743c))[_0x8468('0x3d')](handleError(_0x3602a8,null));};exports[_0x8468('0x3e')]=function(_0x2e9c6e,_0x236bc9){var _0x44af13={'raw':!![],'where':{'id':_0x2e9c6e[_0x8468('0x3f')]['id']}},_0x5cea07={};_0x5cea07['model']=_[_0x8468('0x2a')](db['ChatTransferReport'][_0x8468('0x26')]);_0x5cea07['query']=_[_0x8468('0x2a')](_0x2e9c6e['query']);_0x5cea07[_0x8468('0x2c')]=_[_0x8468('0x2d')](_0x5cea07['model'],_0x5cea07[_0x8468('0x2b')]);_0x44af13[_0x8468('0x2f')]=_[_0x8468('0x2d')](_0x5cea07['model'],qs[_0x8468('0x2e')](_0x2e9c6e['query'][_0x8468('0x2e')]));_0x44af13[_0x8468('0x2f')]=_0x44af13[_0x8468('0x2f')][_0x8468('0x40')]?_0x44af13[_0x8468('0x2f')]:_0x5cea07['model'];if(_0x2e9c6e[_0x8468('0x2b')][_0x8468('0x41')]){_0x44af13[_0x8468('0x3a')]=[{'all':!![]}];}_0x44af13=_[_0x8468('0x37')]({},_0x44af13,_0x2e9c6e[_0x8468('0x39')]);return db[_0x8468('0x25')][_0x8468('0x42')](_0x44af13)[_0x8468('0x1e')](handleEntityNotFound(_0x236bc9,null))['then'](respondWithResult(_0x236bc9,null))['catch'](handleError(_0x236bc9,null));};exports[_0x8468('0x43')]=function(_0x5468e3,_0x5def89){return db[_0x8468('0x25')]['create'](_0x5468e3[_0x8468('0x44')],{})['then'](respondWithResult(_0x5def89,0xc9))[_0x8468('0x3d')](handleError(_0x5def89,null));};exports[_0x8468('0x45')]=function(_0x5e4bc8,_0x1e6105){if(_0x5e4bc8['body']['id']){delete _0x5e4bc8[_0x8468('0x44')]['id'];}return db[_0x8468('0x25')]['find']({'where':{'id':_0x5e4bc8[_0x8468('0x3f')]['id']}})[_0x8468('0x1e')](handleEntityNotFound(_0x1e6105,null))[_0x8468('0x1e')](saveUpdates(_0x5e4bc8['body'],null))[_0x8468('0x1e')](respondWithResult(_0x1e6105,null))[_0x8468('0x3d')](handleError(_0x1e6105,null));};exports[_0x8468('0x1f')]=function(_0x486552,_0x3d2a75){return db[_0x8468('0x25')][_0x8468('0x42')]({'where':{'id':_0x486552[_0x8468('0x3f')]['id']}})[_0x8468('0x1e')](handleEntityNotFound(_0x3d2a75,null))[_0x8468('0x1e')](removeEntity(_0x3d2a75,null))[_0x8468('0x3d')](handleError(_0x3d2a75,null));};exports[_0x8468('0x46')]=function(_0x4c1ef0,_0x2b1de8){return db[_0x8468('0x25')][_0x8468('0x46')]()['then'](respondWithResult(_0x2b1de8,null))[_0x8468('0x3d')](handleError(_0x2b1de8,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index c8e454d..c14098a 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 _0x3c39=['rimraf','./chatTransferReport.attributes','define','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0xddd7df,_0x46bd60){var _0x17bd36=function(_0x361412){while(--_0x361412){_0xddd7df['push'](_0xddd7df['shift']());}};_0x17bd36(++_0x46bd60);}(_0x3c39,0xac));var _0x93c3=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x3c39[_0x3a607e];return _0x37b106;};'use strict';var _=require(_0x93c3('0x0'));var util=require('util');var logger=require(_0x93c3('0x1'))('api');var moment=require(_0x93c3('0x2'));var BPromise=require(_0x93c3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x93c3('0x4'));var config=require('../../config/environment');var attributes=require(_0x93c3('0x5'));module['exports']=function(_0x323ef6,_0x216255){return _0x323ef6[_0x93c3('0x6')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x93c3('0x7'),'fields':[_0x93c3('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d15=['./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2d15,0xe9));var _0x52d1=function(_0xf0c3b7,_0x33e9ce){_0xf0c3b7=_0xf0c3b7-0x0;var _0x1ef874=_0x2d15[_0xf0c3b7];return _0x1ef874;};'use strict';var _=require(_0x52d1('0x0'));var util=require(_0x52d1('0x1'));var logger=require(_0x52d1('0x2'))('api');var moment=require(_0x52d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x52d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52d1('0x5'));var config=require(_0x52d1('0x6'));var attributes=require(_0x52d1('0x7'));module[_0x52d1('0x8')]=function(_0x2bc645,_0x144e81){return _0x2bc645[_0x52d1('0x9')](_0x52d1('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x52d1('0xb'),'fields':[_0x52d1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c430daa..85e2ba8 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 _0xc148=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5bce2c,_0x5f3d69){var _0x2970d4=function(_0x140593){while(--_0x140593){_0x5bce2c['push'](_0x5bce2c['shift']());}};_0x2970d4(++_0x5f3d69);}(_0xc148,0x6c));var _0x8c14=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc148[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x8c14('0x0'));var moment=require(_0x8c14('0x1'));var BPromise=require(_0x8c14('0x2'));var rs=require(_0x8c14('0x3'));var fs=require('fs');var Redis=require(_0x8c14('0x4'));var db=require(_0x8c14('0x5'))['db'];var utils=require(_0x8c14('0x6'));var logger=require(_0x8c14('0x7'))('rpc');var config=require(_0x8c14('0x8'));var jayson=require(_0x8c14('0x9'));var client=jayson[_0x8c14('0xa')][_0x8c14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5078dd,_0x5af169,_0x514432){return new BPromise(function(_0xa85894,_0x2d0064){return client[_0x8c14('0xc')](_0x5078dd,_0x514432)[_0x8c14('0xd')](function(_0x575f42){logger[_0x8c14('0xe')](_0x8c14('0xf'),_0x5af169,'request\x20sent');logger['debug'](_0x8c14('0x10'),_0x5af169,_0x8c14('0x11'),JSON[_0x8c14('0x12')](_0x575f42));if(_0x575f42[_0x8c14('0x13')]){if(_0x575f42[_0x8c14('0x13')]['code']===0x1f4){logger[_0x8c14('0x13')](_0x8c14('0xf'),_0x5af169,_0x575f42[_0x8c14('0x13')][_0x8c14('0x14')]);return _0x2d0064(_0x575f42[_0x8c14('0x13')][_0x8c14('0x14')]);}logger[_0x8c14('0x13')](_0x8c14('0xf'),_0x5af169,_0x575f42[_0x8c14('0x13')][_0x8c14('0x14')]);return _0xa85894(_0x575f42['error']['message']);}else{logger[_0x8c14('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x5af169,_0x8c14('0x11'));_0xa85894(_0x575f42[_0x8c14('0x15')][_0x8c14('0x14')]);}})[_0x8c14('0x16')](function(_0x1b7e2a){logger[_0x8c14('0x13')](_0x8c14('0xf'),_0x5af169,_0x1b7e2a);_0x2d0064(_0x1b7e2a);});});} \ No newline at end of file +var _0x10e0=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message'];(function(_0x29436c,_0x260a6a){var _0x3760a2=function(_0xc9ee2){while(--_0xc9ee2){_0x29436c['push'](_0x29436c['shift']());}};_0x3760a2(++_0x260a6a);}(_0x10e0,0x12e));var _0x010e=function(_0x16dfa1,_0x3f9429){_0x16dfa1=_0x16dfa1-0x0;var _0x5c9ad5=_0x10e0[_0x16dfa1];return _0x5c9ad5;};'use strict';var _=require(_0x010e('0x0'));var util=require(_0x010e('0x1'));var moment=require(_0x010e('0x2'));var BPromise=require(_0x010e('0x3'));var rs=require(_0x010e('0x4'));var fs=require('fs');var Redis=require(_0x010e('0x5'));var db=require(_0x010e('0x6'))['db'];var utils=require(_0x010e('0x7'));var logger=require(_0x010e('0x8'))('rpc');var config=require(_0x010e('0x9'));var jayson=require(_0x010e('0xa'));var client=jayson[_0x010e('0xb')][_0x010e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12b5f0,_0x776e9b,_0x5c7f5f){return new BPromise(function(_0x1d28a8,_0x285ab3){return client[_0x010e('0xd')](_0x12b5f0,_0x5c7f5f)['then'](function(_0x535558){logger[_0x010e('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x776e9b,_0x010e('0xf'));logger[_0x010e('0x10')](_0x010e('0x11'),_0x776e9b,'request\x20sent',JSON[_0x010e('0x12')](_0x535558));if(_0x535558['error']){if(_0x535558[_0x010e('0x13')][_0x010e('0x14')]===0x1f4){logger[_0x010e('0x13')](_0x010e('0x15'),_0x776e9b,_0x535558[_0x010e('0x13')]['message']);return _0x285ab3(_0x535558[_0x010e('0x13')][_0x010e('0x16')]);}logger[_0x010e('0x13')](_0x010e('0x15'),_0x776e9b,_0x535558[_0x010e('0x13')][_0x010e('0x16')]);return _0x1d28a8(_0x535558['error'][_0x010e('0x16')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x776e9b,_0x010e('0xf'));_0x1d28a8(_0x535558[_0x010e('0x17')][_0x010e('0x16')]);}})[_0x010e('0x18')](function(_0x42032){logger[_0x010e('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x776e9b,_0x42032);_0x285ab3(_0x42032);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 5902537..ff55af9 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 _0x646d=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x2d87a0,_0x4dc38a){var _0x2bfafc=function(_0x4588c3){while(--_0x4588c3){_0x2d87a0['push'](_0x2d87a0['shift']());}};_0x2bfafc(++_0x4dc38a);}(_0x646d,0xb5));var _0xd646=function(_0x2f22a0,_0x537d00){_0x2f22a0=_0x2f22a0-0x0;var _0x1b0084=_0x646d[_0x2f22a0];return _0x1b0084;};'use strict';var multer=require(_0xd646('0x0'));var util=require(_0xd646('0x1'));var path=require(_0xd646('0x2'));var timeout=require(_0xd646('0x3'));var express=require(_0xd646('0x4'));var router=express[_0xd646('0x5')]();var fs_extra=require(_0xd646('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd646('0x7'));var config=require(_0xd646('0x8'));var controller=require(_0xd646('0x9'));router[_0xd646('0xa')]('/',auth['isAuthenticated'](),controller[_0xd646('0xb')]);router[_0xd646('0xa')]('/describe',auth[_0xd646('0xc')](),controller[_0xd646('0xd')]);router[_0xd646('0xa')](_0xd646('0xe'),auth[_0xd646('0xc')](),controller[_0xd646('0xf')]);router[_0xd646('0x10')]('/',auth[_0xd646('0xc')](),controller[_0xd646('0x11')]);router[_0xd646('0x12')](_0xd646('0xe'),auth['isAuthenticated'](),controller[_0xd646('0x13')]);router['delete'](_0xd646('0xe'),auth['isAuthenticated'](),controller[_0xd646('0x14')]);module[_0xd646('0x15')]=router; \ No newline at end of file +var _0x3cd0=['fs-extra','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x1439e6,_0x2634b8){var _0x1101a9=function(_0x591d44){while(--_0x591d44){_0x1439e6['push'](_0x1439e6['shift']());}};_0x1101a9(++_0x2634b8);}(_0x3cd0,0xf8));var _0x03cd=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x3cd0[_0x79b649];return _0x1af9b1;};'use strict';var multer=require(_0x03cd('0x0'));var util=require(_0x03cd('0x1'));var path=require('path');var timeout=require(_0x03cd('0x2'));var express=require('express');var router=express[_0x03cd('0x3')]();var fs_extra=require(_0x03cd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x03cd('0x5'));var controller=require(_0x03cd('0x6'));router[_0x03cd('0x7')]('/',auth[_0x03cd('0x8')](),controller['index']);router['get'](_0x03cd('0x9'),auth[_0x03cd('0x8')](),controller[_0x03cd('0xa')]);router[_0x03cd('0x7')](_0x03cd('0xb'),auth[_0x03cd('0x8')](),controller[_0x03cd('0xc')]);router['post']('/',auth[_0x03cd('0x8')](),controller[_0x03cd('0xd')]);router[_0x03cd('0xe')]('/:id',auth[_0x03cd('0x8')](),controller['update']);router[_0x03cd('0xf')](_0x03cd('0xb'),auth[_0x03cd('0x8')](),controller[_0x03cd('0x10')]);module[_0x03cd('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 117ad67..051fa00 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 _0xe2df=['Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','thumb','star','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x646db,_0x125f4b){var _0x54979f=function(_0x42fa34){while(--_0x42fa34){_0x646db['push'](_0x646db['shift']());}};_0x54979f(++_0x125f4b);}(_0xe2df,0xef));var _0xfe2d=function(_0x571bf8,_0x4f2cef){_0x571bf8=_0x571bf8-0x0;var _0x4687cd=_0xe2df[_0x571bf8];return _0x4687cd;};'use strict';var Sequelize=require(_0xfe2d('0x0'));var rs=require(_0xfe2d('0x1'));module[_0xfe2d('0x2')]={'name':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'unique':_0xfe2d('0x4')},'description':{'type':Sequelize[_0xfe2d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x5')},'mapKeyOffline':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x5')},'key':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x6')},'customerAlias':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':_0xfe2d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfe2d('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfe2d('0x3')]},'animation':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfe2d('0xb')](_0xfe2d('0xc'),_0xfe2d('0xd')),'defaultValue':_0xfe2d('0xc')},'header_online':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0xe')},'start_chat_button':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x10')},'header_offline':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x11')},'download_transcript':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfe2d('0x12')]},'closingQuestion':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x13')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x16')},'closingMessage':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x17')},'closingMessageButton':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xfe2d('0xb')]('star',_0xfe2d('0x18')),'defaultValue':_0xfe2d('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfe2d('0x12')],'defaultValue':function(){return JSON[_0xfe2d('0x1a')]({'items':[{'type':_0xfe2d('0x1b'),'variable':null,'config':{'placeholder':_0xfe2d('0x1c'),'type':_0xfe2d('0x1d'),'required':!![]},'props':{'title':_0xfe2d('0x1c'),'helpText':''}},{'type':_0xfe2d('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xfe2d('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfe2d('0x1e')]('onlineForm')?JSON[_0xfe2d('0x1f')](this['getDataValue'](_0xfe2d('0x20'))):{};},'set':function(_0x552757){return this[_0xfe2d('0x21')](_0xfe2d('0x20'),JSON[_0xfe2d('0x1a')](_0x552757));}},'offlineForm':{'type':Sequelize[_0xfe2d('0x12')],'defaultValue':function(){return JSON[_0xfe2d('0x1a')]({'items':[{'type':'input','props':{'title':_0xfe2d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfe2d('0x5')},'variable':null},{'type':_0xfe2d('0x22'),'config':{'placeholder':_0xfe2d('0x23')},'props':{'title':_0xfe2d('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xfe2d('0x1e')](_0xfe2d('0x24'))?JSON['parse'](this['getDataValue'](_0xfe2d('0x24'))):{};},'set':function(_0x21bf77){return this[_0xfe2d('0x21')]('offlineForm',JSON[_0xfe2d('0x1a')](_0x21bf77));}},'token':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfe2d('0x3')]},'forwardOffline':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfe2d('0x3')]},'waitingTitle':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x26')},'offlineMessageBody':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x27')},'skipUnmanaged':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfe2d('0x12')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xfe2d('0x3')]},'notificationTemplate':{'type':Sequelize[_0xfe2d('0x12')],'defaultValue':function(){return _0xfe2d('0x28');}},'notificationSound':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x2a')},'verticalAlignment':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x2b')},'messagesAlignment':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xfe2d('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':_0xfe2d('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x2e')},'systemAvatar':{'type':Sequelize[_0xfe2d('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfe2d('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![],'comment':_0xfe2d('0x30'),'set':function(_0x1b21eb){if(!_0x1b21eb)this[_0xfe2d('0x21')]('mandatoryDispositionPauseId',null);this[_0xfe2d('0x21')](_0xfe2d('0x31'),_0x1b21eb);}},'vidaooEscalation':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xfe2d('0x3')]},'vidaooTopic':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':_0xfe2d('0x32')},'vidaooNote':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':function(){return _0xfe2d('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa934=['input','name','text','getDataValue','parse','onlineForm','setDataValue','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','stringify'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0xa934,0x83));var _0x4a93=function(_0x2e8986,_0x5e612c){_0x2e8986=_0x2e8986-0x0;var _0x30647f=_0xa934[_0x2e8986];return _0x30647f;};'use strict';var Sequelize=require(_0x4a93('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'unique':_0x4a93('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x4')},'customerAlias':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4a93('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4a93('0x1')]},'animation':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4a93('0x8')]('rounded',_0x4a93('0x9')),'defaultValue':_0x4a93('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xb')},'offline_chat_button':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xc')},'header_offline':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xd')},'download_transcript':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4a93('0xf')]},'closingQuestion':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x12')},'noteTitle':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x14')},'closingMessage':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x15')},'closingMessageButton':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x16')},'conditionAgreement':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x17')},'ratingType':{'type':Sequelize[_0x4a93('0x8')](_0x4a93('0x18'),_0x4a93('0x19')),'defaultValue':_0x4a93('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x4a93('0x1a')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4a93('0xf')],'defaultValue':function(){return JSON[_0x4a93('0x1b')]({'items':[{'type':_0x4a93('0x1c'),'variable':null,'config':{'placeholder':_0x4a93('0x1d'),'type':_0x4a93('0x1e'),'required':!![]},'props':{'title':_0x4a93('0x1d'),'helpText':''}},{'type':_0x4a93('0x1c'),'props':{'title':_0x4a93('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x4a93('0x3'),'type':_0x4a93('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4a93('0x1f')]('onlineForm')?JSON[_0x4a93('0x20')](this[_0x4a93('0x1f')](_0x4a93('0x21'))):{};},'set':function(_0x41784c){return this[_0x4a93('0x22')]('onlineForm',JSON[_0x4a93('0x1b')](_0x41784c));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x4a93('0x1b')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4a93('0x3'),'type':_0x4a93('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x4a93('0x23')},'props':{'title':_0x4a93('0x23'),'helpText':_0x4a93('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x4a93('0x1f')]('offlineForm')?JSON[_0x4a93('0x20')](this[_0x4a93('0x1f')](_0x4a93('0x25'))):{};},'set':function(_0x510e50){return this[_0x4a93('0x22')](_0x4a93('0x25'),JSON[_0x4a93('0x1b')](_0x510e50));}},'token':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':function(){return rs[_0x4a93('0x26')]();}},'autoclose':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4a93('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x27')},'waitingMessage':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4a93('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4a93('0x1')]},'notificationTemplate':{'type':Sequelize[_0x4a93('0xf')],'defaultValue':function(){return _0x4a93('0x2b');}},'notificationSound':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x2d')},'messagesAlignment':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x2e')},'defaultTitle':{'type':Sequelize[_0x4a93('0x1')]},'customerAvatar':{'type':Sequelize[_0x4a93('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x30')},'systemAvatar':{'type':Sequelize[_0x4a93('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4a93('0x1a')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4a93('0x31'),'set':function(_0xd3c023){if(!_0xd3c023)this[_0x4a93('0x22')]('mandatoryDispositionPauseId',null);this[_0x4a93('0x22')](_0x4a93('0x32'),_0xd3c023);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4a93('0x1')]},'vidaooTopic':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x33')},'vidaooNote':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':function(){return _0x4a93('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x4a93('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4a93('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 0bd09a1..7f1b55e 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 _0x451a=['setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','referer','browser','%s\x20%s','version','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','query','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','Pause','keys','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','filename','file','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','Interval','Intervals','spread','account','applications','priority','asc','Contacts','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','ChatMessage','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','unshift','Start','startRouting','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','ListId','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','CloudProvider','Smtp','forwardOffline','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','getProactiveActions','virtual','License','increment','address','origin','3.5.0','x-real-ip','connection','remoteAddress','replace','render','alignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','User','mustache','path','ejs','fs-extra','querystring','html-to-text','url','../../components/parsers/qs','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','getSnippet','timezone','iftime\x20%s,%s','format','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','all'];(function(_0x467ef6,_0x932cef){var _0x3e4aa2=function(_0xb56bb5){while(--_0xb56bb5){_0x467ef6['push'](_0x467ef6['shift']());}};_0x3e4aa2(++_0x932cef);}(_0x451a,0xe9));var _0xa451=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x451a[_0x411017];return _0x2adeea;};'use strict';var Mustache=require(_0xa451('0x0'));var util=require('util');var path=require(_0xa451('0x1'));var ejs=require(_0xa451('0x2'));var fs=require('fs');var fs_extra=require(_0xa451('0x3'));var _=require('lodash');var querystring=require(_0xa451('0x4'));var htmlToText=require(_0xa451('0x5'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0xa451('0x6'));var qs=require(_0xa451('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xa451('0x8'));var APIOutOfIntervalError=require(_0xa451('0x9'))[_0xa451('0xa')];var APINotFoundError=require(_0xa451('0x9'))['APINotFoundError'];var APIHandleError=require(_0xa451('0x9'))[_0xa451('0xb')];var db=require(_0xa451('0xc'))['db'];config[_0xa451('0xd')]=_[_0xa451('0xe')](config[_0xa451('0xd')],{'host':_0xa451('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa451('0xd')]));require(_0xa451('0x10'))[_0xa451('0x11')](socket);var client=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x232c});var client9002=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x232a});var client9003=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x232b});var client9001=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x2329});function respondWithRpcPromise(_0xb40255,_0x2e0bd5,_0x5c09e8,_0x391143){return new Promise(function(_0x33300a,_0x41e0e5){var _0x19cc10=_0x391143||client;return _0x19cc10[_0xa451('0x14')](_0xb40255,_0x5c09e8)[_0xa451('0x15')](function(_0x500a3b){logger['info'](_0xa451('0x16'),_0x2e0bd5,_0xa451('0x17'));logger[_0xa451('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2e0bd5,_0xa451('0x17'),JSON[_0xa451('0x19')](_0x500a3b));if(_0x500a3b[_0xa451('0x1a')]){if(_0x500a3b[_0xa451('0x1a')][_0xa451('0x1b')]===0x1f4){logger[_0xa451('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x2e0bd5,_0x500a3b['error']['message']);return _0x41e0e5(_0x500a3b[_0xa451('0x1a')]['message']);}logger['error'](_0xa451('0x16'),_0x2e0bd5,_0x500a3b[_0xa451('0x1a')]['message']);return _0x33300a(_0x500a3b[_0xa451('0x1a')][_0xa451('0x1c')]);}else{logger[_0xa451('0x1d')](_0xa451('0x16'),_0x2e0bd5,'request\x20sent');_0x33300a(_0x500a3b[_0xa451('0x1e')]['message']);}})[_0xa451('0x1f')](function(_0x1e956c){logger['error'](_0xa451('0x16'),_0x2e0bd5,_0x1e956c);_0x41e0e5(_0x1e956c);});});}function respondWithStatusCode(_0x310d0a,_0x20d378){_0x20d378=_0x20d378||0xcc;return function(_0x19675e){if(_0x19675e){return _0x310d0a[_0xa451('0x20')](_0x20d378);}return _0x310d0a[_0xa451('0x21')](_0x20d378)[_0xa451('0x22')]();};}function respondWithResult(_0x5c806d,_0x53f0d5){_0x53f0d5=_0x53f0d5||0xc8;return function(_0x4f67ea){if(_0x4f67ea){return _0x5c806d[_0xa451('0x21')](_0x53f0d5)[_0xa451('0x23')](_0x4f67ea);}};}function respondWithFilteredResult(_0x586799,_0x573f91){return function(_0x91b599){if(_0x91b599){var _0x3aaf66=typeof _0x573f91[_0xa451('0x24')]===_0xa451('0x25')&&typeof _0x573f91[_0xa451('0x26')]===_0xa451('0x25');var _0x12b5a2=_0x91b599['count'];var _0x450a84=_0x3aaf66?0x0:_0x573f91[_0xa451('0x24')];var _0x38c900=_0x3aaf66?_0x91b599[_0xa451('0x27')]:_0x573f91[_0xa451('0x24')]+_0x573f91[_0xa451('0x26')];var _0x296ada;if(_0x38c900>=_0x12b5a2){_0x38c900=_0x12b5a2;_0x296ada=0xc8;}else{_0x296ada=0xce;}_0x586799['status'](_0x296ada);return _0x586799[_0xa451('0x28')](_0xa451('0x29'),_0x450a84+'-'+_0x38c900+'/'+_0x12b5a2)['json'](_0x91b599);}return null;};}function saveUpdates(_0x1d911d){return function(_0x362aff){if(_0x362aff){return _0x362aff[_0xa451('0x2a')](_0x1d911d)[_0xa451('0x15')](function(_0x2f5bea){return _0x2f5bea;});}return null;};}function removeEntity(_0x163d8e){return function(_0x2d8e99){if(_0x2d8e99){return _0x2d8e99[_0xa451('0x2b')]()[_0xa451('0x15')](function(){var _0x4d3b72=_0x2d8e99[_0xa451('0x2c')]({'plain':!![]});var _0x18167c=_0xa451('0x2d');return db[_0xa451('0x2e')][_0xa451('0x2b')]({'where':{'type':_0x18167c,'resourceId':_0x4d3b72['id']}})['then'](function(){return _0x2d8e99;});})[_0xa451('0x15')](function(){_0x163d8e[_0xa451('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc936){return function(_0x4a70b7){if(!_0x4a70b7){_0x4fc936[_0xa451('0x20')](0x194);}return _0x4a70b7;};}function handleError(_0x17fe3e,_0x442a37){_0x442a37=_0x442a37||0x1f4;return function(_0x514a68){logger['error'](_0x514a68['stack']);if(_0x514a68[_0xa451('0x2f')]){delete _0x514a68[_0xa451('0x2f')];}_0x17fe3e[_0xa451('0x21')](_0x442a37)[_0xa451('0x30')](_0x514a68);};}function iftimePromise(_0x12d8a3,_0x1a366b){return respondWithRpcPromise('Command',_0xa451('0x31'),{'command':_0x1a366b[_0xa451('0x32')]?util['format'](_0xa451('0x33'),_0x12d8a3['interval'],_0x1a366b[_0xa451('0x32')]):util[_0xa451('0x34')](_0xa451('0x35'),_0x12d8a3[_0xa451('0x36')])},client9002)['then'](function(_0x129fbe){var _0x5da991=_0x129fbe&&_0x129fbe[_0xa451('0x37')]('true')>=0x0?!![]:![];logger[_0xa451('0x1d')](_0xa451('0x38'),_0x1a366b['id'],_0x12d8a3['id'],_0x12d8a3[_0xa451('0x36')],_0x5da991?_0xa451('0x39'):'OFFLINE',_0x1a366b['timezone']?_0x1a366b[_0xa451('0x32')]:_0xa451('0x3a'));return _0x5da991;})[_0xa451('0x1f')](function(_0x300ccd){logger[_0xa451('0x1a')](_0xa451('0x38'),_0x1a366b['id'],_0x12d8a3['id'],_0x12d8a3[_0xa451('0x36')],util['inspect'](_0x300ccd,{'showHidden':![],'depth':null}),_0x1a366b[_0xa451('0x32')]?_0x1a366b[_0xa451('0x32')]:_0xa451('0x3a'));return![];});}function checkWebsiteIntervals(_0x6027aa){var _0x265817=_['map'](_0x6027aa['Interval']['Intervals'],function(_0x36c35f){var _0x213a3b=_0x36c35f['get']({'plain':!![]});return iftimePromise(_0x213a3b,_0x6027aa);});return Promise[_0xa451('0x3b')](_0x265817)[_0xa451('0x15')](function(_0x78133d){return _['some'](_0x78133d);});}function createInteractionObject(_0xf5329d,_0x5aa608,_0x3d3a17,_0xa92118){var _0x115234=require('user-agent-parser');var _0x5a5a77=new _0x115234();var _0x51dc4e=_0x5a5a77[_0xa451('0x3c')](_0x3d3a17[_0xa451('0x3d')])[_0xa451('0x3e')]();var _0x355451=_0x5aa608[_0xa451('0x3f')];if(_0x3d3a17['cf-connecting-ip']){_0x355451=_0x3d3a17[_0xa451('0x40')];}else if(_0x3d3a17[_0xa451('0x41')]){_0x355451=_[_0xa451('0x42')](_0x3d3a17['x-forwarded-for']['split'](','));}return{'ContactId':_0xa92118['id'],'ChatWebsiteId':_0xf5329d,'from':(_0xa92118[_0xa451('0x43')]||'')+'\x20'+(_0xa92118[_0xa451('0x44')]||''),'customerIp':_0x355451,'customerPort':_0x3d3a17['x-real-port']?_0x3d3a17['x-real-port']:null,'referer':_0x5aa608[_0xa451('0x45')],'browserName':_0x51dc4e[_0xa451('0x46')][_0xa451('0x2f')]&&_0x51dc4e[_0xa451('0x46')]['version']?util['format'](_0xa451('0x47'),_0x51dc4e[_0xa451('0x46')]['name'],_0x51dc4e[_0xa451('0x46')][_0xa451('0x48')]):_0xa451('0x49'),'browserVersion':_0x51dc4e[_0xa451('0x46')]['version']||_0xa451('0x49'),'osName':util[_0xa451('0x34')](_0xa451('0x47'),_0x51dc4e['os'][_0xa451('0x2f')],_0x51dc4e['os']['version']),'osVersion':_0x51dc4e['os'][_0xa451('0x48')],'deviceModel':_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4b')]&&_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4c')]?util['format'](_0xa451('0x4d'),_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4b')],_0x51dc4e['device'][_0xa451('0x4c')],_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4e')]):null,'deviceVendor':_0x51dc4e['device'][_0xa451('0x4c')],'deviceType':_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4e')],'formData':JSON[_0xa451('0x19')](_0x5aa608)};}exports[_0xa451('0x4f')]=function(_0x32ac49,_0x4f66c3){var _0x16bf6a={'include':[{'model':db['Pause'],'as':_0xa451('0x50')}]},_0x449351={},_0x50df06={'count':0x0,'rows':[]};var _0xefed89=_[_0xa451('0x51')](db[_0xa451('0x52')][_0xa451('0x53')],function(_0x3abcb5){return{'name':_0x3abcb5[_0xa451('0x54')],'type':_0x3abcb5[_0xa451('0x4e')]['key']};});_0x449351['model']=_['map'](_0xefed89,_0xa451('0x2f'));_0x449351[_0xa451('0x55')]=_['keys'](_0x32ac49[_0xa451('0x55')]);_0x449351[_0xa451('0x56')]=_['intersection'](_0x449351[_0xa451('0x4b')],_0x449351[_0xa451('0x55')]);_0x16bf6a[_0xa451('0x57')]=_[_0xa451('0x58')](_0x449351[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x32ac49[_0xa451('0x55')][_0xa451('0x59')]));_0x16bf6a['attributes']=_0x16bf6a[_0xa451('0x57')][_0xa451('0x5a')]?_0x16bf6a[_0xa451('0x57')]:_0x449351[_0xa451('0x4b')];if(!_0x32ac49[_0xa451('0x55')]['hasOwnProperty'](_0xa451('0x5b'))){_0x16bf6a['limit']=qs['limit'](_0x32ac49[_0xa451('0x55')][_0xa451('0x26')]);_0x16bf6a[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x32ac49[_0xa451('0x55')][_0xa451('0x24')]);}_0x16bf6a['order']=qs[_0xa451('0x5c')](_0x32ac49[_0xa451('0x55')]['sort']);_0x16bf6a[_0xa451('0x5d')]=qs[_0xa451('0x56')](_['pick'](_0x32ac49[_0xa451('0x55')],_0x449351[_0xa451('0x56')]),_0xefed89);if(_0x32ac49[_0xa451('0x55')][_0xa451('0x5e')]){_0x16bf6a[_0xa451('0x5d')]=_[_0xa451('0x5f')](_0x16bf6a[_0xa451('0x5d')],{'$or':_['map'](_0xefed89,function(_0x4d48cf){if(_0x4d48cf[_0xa451('0x4e')]!==_0xa451('0x60')){var _0x27c465={};_0x27c465[_0x4d48cf['name']]={'$like':'%'+_0x32ac49[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x27c465;}})});}_0x16bf6a=_[_0xa451('0x5f')]({},_0x16bf6a,_0x32ac49['options']);var _0x22a4e1={'where':_0x16bf6a[_0xa451('0x5d')]};return db[_0xa451('0x52')]['count'](_0x22a4e1)[_0xa451('0x15')](function(_0xf2f16){_0x50df06['count']=_0xf2f16;if(_0x32ac49[_0xa451('0x55')][_0xa451('0x61')]){_0x16bf6a[_0xa451('0x62')]=[{'all':!![]}];}return db[_0xa451('0x52')][_0xa451('0x63')](_0x16bf6a);})[_0xa451('0x15')](function(_0x1c613f){_0x50df06[_0xa451('0x64')]=_0x1c613f;return _0x50df06;})[_0xa451('0x15')](respondWithFilteredResult(_0x4f66c3,_0x16bf6a))[_0xa451('0x1f')](handleError(_0x4f66c3,null));};exports[_0xa451('0x65')]=function(_0x203011,_0x4dabcb){var _0x5e4cca={'raw':![],'where':{'id':_0x203011['params']['id']},'include':[{'model':db[_0xa451('0x66')],'as':_0xa451('0x50')}]},_0x181ca0={};_0x181ca0[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0x52')]['rawAttributes']);_0x181ca0[_0xa451('0x55')]=_[_0xa451('0x67')](_0x203011['query']);_0x181ca0[_0xa451('0x56')]=_['intersection'](_0x181ca0[_0xa451('0x4b')],_0x181ca0['query']);_0x5e4cca[_0xa451('0x57')]=_[_0xa451('0x58')](_0x181ca0[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x203011[_0xa451('0x55')][_0xa451('0x59')]));_0x5e4cca[_0xa451('0x57')]=_0x5e4cca[_0xa451('0x57')][_0xa451('0x5a')]?_0x5e4cca[_0xa451('0x57')]:_0x181ca0[_0xa451('0x4b')];if(_0x203011[_0xa451('0x55')][_0xa451('0x61')]){_0x5e4cca[_0xa451('0x62')]=[{'all':!![]}];}_0x5e4cca=_[_0xa451('0x5f')]({},_0x5e4cca,_0x203011[_0xa451('0x68')]);return db[_0xa451('0x52')][_0xa451('0x69')](_0x5e4cca)['then'](handleEntityNotFound(_0x4dabcb,null))[_0xa451('0x15')](respondWithResult(_0x4dabcb,null))[_0xa451('0x1f')](handleError(_0x4dabcb,null));};exports[_0xa451('0x6a')]=function(_0x4ec36f,_0x790bda){return db[_0xa451('0x52')][_0xa451('0x6a')](_0x4ec36f[_0xa451('0x6b')],{})[_0xa451('0x15')](function(_0x4f8e59){var _0xcfdeef=_0x4ec36f['user'][_0xa451('0x2c')]({'plain':!![]});if(!_0xcfdeef)throw new Error(_0xa451('0x6c'));if(_0xcfdeef[_0xa451('0x6d')]===_0xa451('0x6e')){var _0x157649=_0x4f8e59['get']({'plain':!![]});var _0x22fc74='ChatWebsites';return db['UserProfileSection'][_0xa451('0x69')]({'where':{'name':_0x22fc74,'userProfileId':_0xcfdeef[_0xa451('0x6f')]},'raw':!![]})[_0xa451('0x15')](function(_0xe3b7dc){if(_0xe3b7dc&&_0xe3b7dc['autoAssociation']===0x0){return db[_0xa451('0x2e')][_0xa451('0x6a')]({'name':_0x157649['name'],'resourceId':_0x157649['id'],'type':_0xe3b7dc[_0xa451('0x2f')],'sectionId':_0xe3b7dc['id']},{})[_0xa451('0x15')](function(){return _0x4f8e59;});}else{return _0x4f8e59;}})[_0xa451('0x1f')](function(_0x2ec9cd){logger[_0xa451('0x1a')](_0xa451('0x70'),_0x2ec9cd);throw _0x2ec9cd;});}return _0x4f8e59;})['then'](respondWithResult(_0x790bda,0xc9))[_0xa451('0x1f')](handleError(_0x790bda,null));};exports[_0xa451('0x2a')]=function(_0x4f0110,_0x5d7a4b){if(_0x4f0110['body']['id']){delete _0x4f0110[_0xa451('0x6b')]['id'];}return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x4f0110['params']['id']},'include':[{'model':db['Pause'],'as':_0xa451('0x50')}]})['then'](handleEntityNotFound(_0x5d7a4b,null))['then'](saveUpdates(_0x4f0110[_0xa451('0x6b')],null))[_0xa451('0x15')](respondWithResult(_0x5d7a4b,null))[_0xa451('0x1f')](handleError(_0x5d7a4b,null));};exports[_0xa451('0x2b')]=function(_0x30c008,_0x3e5e15){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x30c008[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x3e5e15,null))[_0xa451('0x15')](removeEntity(_0x3e5e15,null))['catch'](handleError(_0x3e5e15,null));};exports[_0xa451('0x72')]=function(_0x364d76,_0x2cabfd){return db[_0xa451('0x52')][_0xa451('0x72')]()[_0xa451('0x15')](respondWithResult(_0x2cabfd,null))[_0xa451('0x1f')](handleError(_0x2cabfd,null));};exports[_0xa451('0x73')]=function(_0x12a2f4,_0x705a3){if(_0x12a2f4[_0xa451('0x6b')]['id']){delete _0x12a2f4['body']['id'];}return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x12a2f4[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x705a3,null))[_0xa451('0x15')](function(_0x1c83bd){if(_0x1c83bd){_0x12a2f4[_0xa451('0x6b')][_0xa451('0x74')]=_0x1c83bd['id'];return db[_0xa451('0x75')]['create'](_0x12a2f4['body']);}})[_0xa451('0x15')](respondWithResult(_0x705a3,null))[_0xa451('0x1f')](handleError(_0x705a3,null));};exports['getDispositions']=function(_0x5931cc,_0x513a33){var _0x5a77eb={'raw':![],'where':{}};var _0x2775ab={};var _0x5b0322={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5931cc[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x513a33,null))[_0xa451('0x15')](function(_0x1c75a6){if(_0x1c75a6){_0x2775ab['model']=_[_0xa451('0x67')](db[_0xa451('0x75')][_0xa451('0x53')]);_0x2775ab[_0xa451('0x55')]=_['keys'](_0x5931cc[_0xa451('0x55')]);_0x2775ab[_0xa451('0x56')]=_[_0xa451('0x58')](_0x2775ab[_0xa451('0x4b')],_0x2775ab[_0xa451('0x55')]);_0x5a77eb[_0xa451('0x57')]=_[_0xa451('0x58')](_0x2775ab[_0xa451('0x4b')],qs['fields'](_0x5931cc['query']['fields']));_0x5a77eb['attributes']=_0x5a77eb['attributes'][_0xa451('0x5a')]?_0x5a77eb[_0xa451('0x57')]:_0x2775ab[_0xa451('0x4b')];if(!_0x5931cc[_0xa451('0x55')][_0xa451('0x76')](_0xa451('0x5b'))){_0x5a77eb[_0xa451('0x26')]=qs[_0xa451('0x26')](_0x5931cc[_0xa451('0x55')][_0xa451('0x26')]);_0x5a77eb[_0xa451('0x24')]=qs['offset'](_0x5931cc[_0xa451('0x55')][_0xa451('0x24')]);}_0x5a77eb[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x5931cc[_0xa451('0x55')]['sort']);_0x5a77eb[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x5931cc['query'],_0x2775ab['filters']));_0x5a77eb['where']['ChatWebsiteId']=_0x1c75a6['id'];if(_0x5931cc[_0xa451('0x55')][_0xa451('0x5e')]){_0x5a77eb['where']=_['merge'](_0x5a77eb['where'],{'$or':_[_0xa451('0x51')](_0x5a77eb[_0xa451('0x57')],function(_0x3585a3){var _0x32cf0c={};_0x32cf0c[_0x3585a3]={'$like':'%'+_0x5931cc[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x32cf0c;})});}_0x5a77eb=_['merge']({},_0x5a77eb,_0x5931cc[_0xa451('0x68')]);return db[_0xa451('0x75')]['count']({'where':_0x5a77eb[_0xa451('0x5d')]})[_0xa451('0x15')](function(_0x2b5886){_0x5b0322[_0xa451('0x27')]=_0x2b5886;if(_0x5931cc[_0xa451('0x55')][_0xa451('0x61')]){_0x5a77eb['include']=[{'all':!![]}];}return db[_0xa451('0x75')]['findAll'](_0x5a77eb);})[_0xa451('0x15')](function(_0x190d57){_0x5b0322[_0xa451('0x64')]=_0x190d57;return _0x5b0322;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x513a33,_0x5a77eb))['catch'](handleError(_0x513a33,null));};exports['removeDispositions']=function(_0x3c00e5,_0x286d0d){return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x3c00e5[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x286d0d,null))['then'](function(_0x51d705){if(_0x51d705){return _0x51d705[_0xa451('0x79')](_0x3c00e5['query'][_0xa451('0x7a')]);}})[_0xa451('0x15')](respondWithStatusCode(_0x286d0d,null))[_0xa451('0x1f')](handleError(_0x286d0d,null));};exports[_0xa451('0x7b')]=function(_0x4de97a,_0x5df075){if(_0x4de97a['body']['id']){delete _0x4de97a[_0xa451('0x6b')]['id'];}return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x4de97a[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x5df075,null))[_0xa451('0x15')](function(_0xb7442e){if(_0xb7442e){_0x4de97a[_0xa451('0x6b')][_0xa451('0x74')]=_0xb7442e['id'];return db[_0xa451('0x7c')][_0xa451('0x6a')](_0x4de97a[_0xa451('0x6b')]);}})[_0xa451('0x15')](respondWithResult(_0x5df075,null))[_0xa451('0x1f')](handleError(_0x5df075,null));};exports['getAnswers']=function(_0x1fcfa4,_0x2c7a7d){var _0x5037f2={'raw':![],'where':{}};var _0x1ae5dd={};var _0x2bfb6d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1fcfa4[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x2c7a7d,null))[_0xa451('0x15')](function(_0x504198){if(_0x504198){_0x1ae5dd[_0xa451('0x4b')]=_[_0xa451('0x67')](db['CannedAnswer'][_0xa451('0x53')]);_0x1ae5dd[_0xa451('0x55')]=_[_0xa451('0x67')](_0x1fcfa4[_0xa451('0x55')]);_0x1ae5dd[_0xa451('0x56')]=_['intersection'](_0x1ae5dd['model'],_0x1ae5dd[_0xa451('0x55')]);_0x5037f2[_0xa451('0x57')]=_[_0xa451('0x58')](_0x1ae5dd[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x1fcfa4[_0xa451('0x55')]['fields']));_0x5037f2[_0xa451('0x57')]=_0x5037f2[_0xa451('0x57')][_0xa451('0x5a')]?_0x5037f2['attributes']:_0x1ae5dd[_0xa451('0x4b')];if(!_0x1fcfa4[_0xa451('0x55')]['hasOwnProperty'](_0xa451('0x5b'))){_0x5037f2[_0xa451('0x26')]=qs['limit'](_0x1fcfa4['query'][_0xa451('0x26')]);_0x5037f2[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x1fcfa4[_0xa451('0x55')]['offset']);}_0x5037f2[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x1fcfa4[_0xa451('0x55')][_0xa451('0x5c')]);_0x5037f2['where']=qs['filters'](_[_0xa451('0x78')](_0x1fcfa4['query'],_0x1ae5dd[_0xa451('0x56')]));_0x5037f2[_0xa451('0x5d')][_0xa451('0x74')]=_0x504198['id'];if(_0x1fcfa4[_0xa451('0x55')][_0xa451('0x5e')]){_0x5037f2[_0xa451('0x5d')]=_['merge'](_0x5037f2[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x5037f2[_0xa451('0x57')],function(_0x16d0cf){var _0x5c1519={};_0x5c1519[_0x16d0cf]={'$like':'%'+_0x1fcfa4[_0xa451('0x55')]['filter']+'%'};return _0x5c1519;})});}_0x5037f2=_[_0xa451('0x5f')]({},_0x5037f2,_0x1fcfa4[_0xa451('0x68')]);return db[_0xa451('0x7c')]['count']({'where':_0x5037f2[_0xa451('0x5d')]})[_0xa451('0x15')](function(_0x49b049){_0x2bfb6d[_0xa451('0x27')]=_0x49b049;if(_0x1fcfa4[_0xa451('0x55')][_0xa451('0x61')]){_0x5037f2[_0xa451('0x62')]=[{'all':!![]}];}return db[_0xa451('0x7c')][_0xa451('0x63')](_0x5037f2);})['then'](function(_0x4fb984){_0x2bfb6d[_0xa451('0x64')]=_0x4fb984;return _0x2bfb6d;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x2c7a7d,_0x5037f2))[_0xa451('0x1f')](handleError(_0x2c7a7d,null));};exports[_0xa451('0x7d')]=function(_0x470e48,_0x4fc65a){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x470e48[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x4fc65a,null))[_0xa451('0x15')](function(_0x38e310){if(_0x38e310){return _0x38e310[_0xa451('0x7d')](_0x470e48['query'][_0xa451('0x7a')]);}})['then'](respondWithStatusCode(_0x4fc65a,null))[_0xa451('0x1f')](handleError(_0x4fc65a,null));};exports[_0xa451('0x7e')]=function(_0x2fac29,_0x1aa76d){_0x2fac29[_0xa451('0x6b')][_0xa451('0x7f')]=_0x2fac29['file']['filename'];return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x2fac29[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x1aa76d,null))[_0xa451('0x15')](saveUpdates(_0x2fac29[_0xa451('0x6b')],null))['then'](respondWithResult(_0x1aa76d,null))['catch'](handleError(_0x1aa76d,null));};exports[_0xa451('0x80')]=function(_0x169000,_0x5d9781){_0x169000[_0xa451('0x6b')][_0xa451('0x81')]=_0x169000['file'][_0xa451('0x82')];return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x169000[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x5d9781,null))[_0xa451('0x15')](saveUpdates(_0x169000[_0xa451('0x6b')],null))['then'](respondWithResult(_0x5d9781,null))[_0xa451('0x1f')](handleError(_0x5d9781,null));};exports['addCustomerAvatar']=function(_0x32e14c,_0x58d058){_0x32e14c[_0xa451('0x6b')]['customerAvatar']=_0x32e14c[_0xa451('0x83')][_0xa451('0x82')];return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x32e14c['params']['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x58d058,null))[_0xa451('0x15')](saveUpdates(_0x32e14c[_0xa451('0x6b')],null))[_0xa451('0x15')](respondWithResult(_0x58d058,null))[_0xa451('0x1f')](handleError(_0x58d058,null));};exports['addSystemAvatar']=function(_0x5e0230,_0x440c70){_0x5e0230['body'][_0xa451('0x84')]=_0x5e0230['file']['filename'];return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x5e0230[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x440c70,null))[_0xa451('0x15')](saveUpdates(_0x5e0230[_0xa451('0x6b')],null))[_0xa451('0x15')](respondWithResult(_0x440c70,null))[_0xa451('0x1f')](handleError(_0x440c70,null));};exports['getLogo']=function(_0x514a72,_0x54ed53){var _0x220502=path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x87'));var _0x4f3a02={'where':{'id':_0x514a72[_0xa451('0x71')]['id']},'attributes':['id',_0xa451('0x7f')],'raw':!![]};var _0x1b28d2=![];return require(_0xa451('0x88'))[_0xa451('0x89')]()['then'](function(_0x3e1950){if(_0x3e1950){_0x1b28d2=_0x3e1950[_0xa451('0x8a')];}})[_0xa451('0x15')](function(){return db[_0xa451('0x52')][_0xa451('0x69')](_0x4f3a02);})['then'](handleEntityNotFound(_0x54ed53,null))['then'](function(_0x358067){if(_0x358067){if(!_[_0xa451('0x8b')](_0x358067[_0xa451('0x7f')])){if(fs[_0xa451('0x8c')](path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x8d'),_0x358067['sitepic']))&&_0x1b28d2){_0x220502=path['join'](config[_0xa451('0x86')],'server/files/images/logos/',_0x358067[_0xa451('0x7f')]);}}return _0x54ed53['download'](_0x220502);}})[_0xa451('0x1f')](handleError(_0x54ed53,null));};exports['getAvatar']=function(_0x1f38be,_0x45dc39){var _0x357347=path[_0xa451('0x85')](config['root'],_0xa451('0x8e'));var _0x236743={'where':{'id':_0x1f38be[_0xa451('0x71')]['id']},'attributes':['id',_0xa451('0x81')],'raw':!![]};return db[_0xa451('0x52')][_0xa451('0x69')](_0x236743)[_0xa451('0x15')](handleEntityNotFound(_0x45dc39,null))[_0xa451('0x15')](function(_0x4b1f46){if(_0x4b1f46){if(!_[_0xa451('0x8b')](_0x4b1f46[_0xa451('0x81')])){if(fs['existsSync'](path[_0xa451('0x85')](config[_0xa451('0x86')],'server/files/images/avatars/',_0x4b1f46[_0xa451('0x81')]))){_0x357347=path[_0xa451('0x85')](config['root'],_0xa451('0x8f'),_0x4b1f46['agentAvatar']);}}return _0x45dc39[_0xa451('0x90')](_0x357347);}})[_0xa451('0x1f')](handleError(_0x45dc39,null));};exports['getCustomerAvatar']=function(_0x526c7e,_0x47de25){var _0x4c118b=path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x91'));var _0xe1540b={'where':{'id':_0x526c7e[_0xa451('0x71')]['id']},'attributes':['id',_0xa451('0x92'),_0xa451('0x93')],'raw':!![]};return db['ChatWebsite']['find'](_0xe1540b)[_0xa451('0x15')](handleEntityNotFound(_0x47de25,null))[_0xa451('0x15')](function(_0x596c90){if(_0x596c90){if(!_['isNil'](_0x596c90[_0xa451('0x92')])){if(fs[_0xa451('0x8c')](path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x8f'),_0x596c90[_0xa451('0x92')]))&&_0x596c90[_0xa451('0x93')]){_0x4c118b=path[_0xa451('0x85')](config['root'],_0xa451('0x8f'),_0x596c90[_0xa451('0x92')]);}}return _0x47de25[_0xa451('0x90')](_0x4c118b);}})[_0xa451('0x1f')](handleError(_0x47de25,null));};exports[_0xa451('0x94')]=function(_0xa7b90,_0xfb2ad1){var _0x3b3cd7=path[_0xa451('0x85')](config['root'],_0xa451('0x95'));var _0x3c1eeb={'where':{'id':_0xa7b90['params']['id']},'attributes':['id',_0xa451('0x84')],'raw':!![]};return db[_0xa451('0x52')]['find'](_0x3c1eeb)[_0xa451('0x15')](handleEntityNotFound(_0xfb2ad1,null))[_0xa451('0x15')](function(_0x369f08){if(_0x369f08){if(!_[_0xa451('0x8b')](_0x369f08['systemAvatar'])){if(fs[_0xa451('0x8c')](path[_0xa451('0x85')](config[_0xa451('0x86')],'server/files/images/avatars/',_0x369f08['systemAvatar']))){_0x3b3cd7=path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x8f'),_0x369f08[_0xa451('0x84')]);}}return _0xfb2ad1['download'](_0x3b3cd7);}})[_0xa451('0x1f')](handleError(_0xfb2ad1,null));};exports[_0xa451('0x96')]=function(_0x2b4503,_0x3dab0e){var _0x794a4={'body':_0x2b4503[_0xa451('0x6b')],'channel':_0xa451('0x97')};var _0x308653=[];var _0x9697a8=[];var _0x4668ff={};var _0x51db81=![];return db[_0xa451('0x98')][_0xa451('0x72')]()['then'](function(_0x3bc965){if(!_0x3bc965){throw new db['Sequelize']['ValidationError'](_0xa451('0x99'));}_0x308653=_[_0xa451('0x9a')](_[_0xa451('0x67')](_0x3bc965),['createdAt',_0xa451('0x9b')]);_0x9697a8=_[_0xa451('0x9a')](_[_0xa451('0x67')](_0x3bc965),[_0xa451('0x9c'),'updatedAt','CompanyId','ListId']);if(_0x2b4503[_0xa451('0x6b')]['id']){delete _0x2b4503[_0xa451('0x6b')]['id'];}if(_[_0xa451('0x8b')](_0x2b4503['body'][_0xa451('0x9d')])){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xa0'));}if(_[_0xa451('0x8b')](_0x2b4503[_0xa451('0x6b')][_0xa451('0x6b')])||_0x2b4503[_0xa451('0x6b')][_0xa451('0x6b')]===''){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa451('0x8b')](_0x2b4503[_0xa451('0x6b')][_0xa451('0xa1')])){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xa2')+_0x9697a8);}if(!_[_0xa451('0xa3')](_0x9697a8,_0x2b4503[_0xa451('0x6b')][_0xa451('0xa1')])){throw new db[(_0xa451('0x9e'))]['ValidationError'](_0xa451('0xa4')+_0x9697a8);}_0x4668ff[_0x2b4503[_0xa451('0x6b')][_0xa451('0xa1')]]=_0x2b4503['body'][_0xa451('0x9d')];})[_0xa451('0x15')](function(){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x2b4503[_0xa451('0x71')]['id']},'include':[{'model':db['CmList'],'as':_0xa451('0xa5'),'include':[{'model':db[_0xa451('0x98')],'as':'Contacts','where':_0x4668ff,'limit':0x1,'order':[[_0xa451('0x9b'),_0xa451('0xa6')]]}]},{'model':db[_0xa451('0xa7')],'as':_0xa451('0xa8')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xa451('0xa9')],'as':_0xa451('0xaa'),'attributes':['id',_0xa451('0x36')],'raw':!![]}]}]});})[_0xa451('0x15')](function(_0x2f6934){if(!_0x2f6934)throw new APINotFoundError(util[_0xa451('0x34')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x2b4503['params']['id']));if(!_0x2f6934[_0xa451('0xa9')]||!_0x2f6934[_0xa451('0xa9')][_0xa451('0xaa')])return[_0x2f6934,!![]];return[_0x2f6934,checkWebsiteIntervals(_0x2f6934)];})[_0xa451('0xab')](function(_0x542fa8,_0x4517b9){if(!_0x4517b9)throw new APIOutOfIntervalError();if(!_0x542fa8['List'])return;_0x794a4[_0xa451('0xac')]=_0x542fa8;_0x794a4['list']=_0x542fa8[_0xa451('0xa5')];_0x794a4[_0xa451('0xad')]=_['orderBy'](_0x542fa8[_0xa451('0xa8')],[_0xa451('0xae')],[_0xa451('0xaf')]);if(_0x794a4[_0xa451('0xac')][_0xa451('0xa8')]){delete _0x794a4['account'][_0xa451('0xa8')];}if(_0x794a4['account'][_0xa451('0xa5')]&&_0x794a4[_0xa451('0xac')][_0xa451('0xa5')][_0xa451('0xb0')][_0xa451('0x5a')]){return _0x794a4[_0xa451('0xac')]['List'][_0xa451('0xb0')][0x0];}var _0x9cfca9=_[_0xa451('0xe')](_0x2b4503[_0xa451('0x6b')],{'firstName':_0x2b4503[_0xa451('0x6b')][_0xa451('0x9d')],'ListId':_0x542fa8['ListId']});_0x9cfca9[_0x2b4503['body'][_0xa451('0xa1')]]=_0x2b4503['body'][_0xa451('0x9d')];return db[_0xa451('0x98')]['create'](_0x9cfca9,{'fields':_0x308653,'raw':!![]});})[_0xa451('0x15')](function(_0x2a09ff){_0x794a4[_0xa451('0xb1')]=_0x2a09ff;var _0x59de77=createInteractionObject(_0x2b4503[_0xa451('0x71')]['id'],_0x2b4503[_0xa451('0x6b')],_0x2b4503[_0xa451('0xb2')],_0x2a09ff);var _0x22190={'ChatWebsiteId':_0x2b4503[_0xa451('0x71')]['id'],'closed':![]};if(_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')]){_0x22190[_0xa451('0xb3')]=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')];return db[_0xa451('0xb4')]['find']({'where':_0x22190})[_0xa451('0x15')](function(_0x1e23ef){if(_0x1e23ef){_0x51db81=!![];return _0x1e23ef;}_0x59de77['threadId']=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')];_0x59de77[_0xa451('0xb5')]=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb5')];return db[_0xa451('0xb4')][_0xa451('0x6a')](_0x59de77);});}_0x22190[_0xa451('0xb6')]=_0x2a09ff['id'];if(_0x2b4503[_0xa451('0x6b')][_0xa451('0xb7')]&&_0x2b4503[_0xa451('0x6b')][_0xa451('0xb7')]['id']){_0x22190['id']=_0x2b4503['body']['interaction']['id'];return db['ChatInteraction'][_0xa451('0x69')]({'where':_0x22190})[_0xa451('0x15')](function(_0x3593cd){if(_0x3593cd){_0x51db81=!![];return _0x3593cd;}return db['ChatInteraction']['create'](_0x59de77);});}return db['ChatInteraction'][_0xa451('0x6a')](_0x59de77);})[_0xa451('0x15')](function(_0x92b96d){if(!_0x51db81)return _0x92b96d;var _0xd99775={'from':(_0x794a4[_0xa451('0xb1')][_0xa451('0x43')]||'')+'\x20'+(_0x794a4[_0xa451('0xb1')][_0xa451('0x44')]||'')};if(_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')]&&_0x2b4503[_0xa451('0x6b')][_0xa451('0xb8')]&&_0x2b4503[_0xa451('0x6b')]['threadId']!=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb8')]){_0xd99775['threadId']=_0x2b4503['body']['messageId'];}return _0x92b96d[_0xa451('0x2a')](_0xd99775);})['then'](function(_0x51de02){_0x794a4[_0xa451('0xb7')]=_0x51de02[_0xa451('0x2c')]({'plain':!![]});_0x794a4[_0xa451('0xb7')][_0xa451('0xb9')]=!_0x51db81;if(_0x794a4[_0xa451('0xb7')][_0xa451('0xb9')]){if(_0x794a4[_0xa451('0xac')][_0xa451('0xba')]){_0x794a4[_0xa451('0xad')]['push']({'id':0x0,'priority':_0x794a4[_0xa451('0xad')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xa451('0xbb')][_0xa451('0x6a')]({'body':_0x2b4503[_0xa451('0x6b')]['body'],'ChatWebsiteId':_0x2b4503[_0xa451('0x71')]['id'],'ChatInteractionId':_0x51de02['id'],'direction':'in','ContactId':_0x794a4[_0xa451('0xb1')]['id'],'AttachmentId':_0x2b4503[_0xa451('0x6b')]['AttachmentId']});})[_0xa451('0x15')](function(_0x28a88c){_0x794a4[_0xa451('0x1c')]=_0x28a88c;if(!_0x794a4[_0xa451('0xb7')][_0xa451('0xbc')]){return;}return db['User'][_0xa451('0x69')]({'attributes':['id',_0xa451('0x2f')],'where':{'id':_0x794a4[_0xa451('0xb7')][_0xa451('0xbc')]}});})[_0xa451('0x15')](function(_0x4f1e37){if(_0x4f1e37){_0x794a4[_0xa451('0xad')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa451('0xbd'),'appdata':_0x4f1e37[_0xa451('0x2f')]+','+(_0x794a4[_0xa451('0xac')][_0xa451('0xbe')]||0xa),'interval':_0xa451('0xbf')});_0x794a4[_0xa451('0xc0')]=!![];}if(!_0x794a4[_0xa451('0xb7')][_0xa451('0xc1')]){return;}return db[_0xa451('0xc2')][_0xa451('0x69')]({'attributes':['id',_0xa451('0x2f')],'where':{'id':_0x794a4['interaction']['queueId']}});})['then'](function(_0x31d072){if(_0x31d072){_0x794a4[_0xa451('0xad')][_0xa451('0xc3')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x31d072[_0xa451('0x2f')]+','+(_0x794a4[_0xa451('0xac')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa451('0xc4'),_0xa451('0xc5'),_0x794a4);})[_0xa451('0x15')](function(_0x3cd67a){respondWithRpcPromise('EventManager','EventManager',{'event':_0xa451('0x96'),'message':_0x3cd67a},client9002);return _0x3cd67a;})[_0xa451('0x15')](respondWithResult(_0x3dab0e,null))['catch'](APIHandleError(_0x3dab0e));};exports[_0xa451('0xc6')]=function(_0x46047f,_0x5c5d46){var _0x4b4c07,_0x1ea90f,_0x591dcb;var _0x4d3580=[];var _0x54ba85={};var _0x41d329=_0x46047f[_0xa451('0xc7')]||[];var _0x2595e9=[];var _0x2e5718;return db['CmContact'][_0xa451('0x72')]()[_0xa451('0x15')](function(_0x2459ca){if(!_0x2459ca){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))]('no\x20available\x20attributes');}_0x4d3580=_['difference'](_[_0xa451('0x67')](_0x2459ca),[_0xa451('0x9c'),_0xa451('0x9b'),'CompanyId','ListId']);if(_0x46047f[_0xa451('0x6b')]['id']){delete _0x46047f[_0xa451('0x6b')]['id'];}if(_[_0xa451('0x8b')](_0x46047f['body'][_0xa451('0x9d')])){throw _0x5c5d46[_0xa451('0x21')](0x1f4)['send'](new db[(_0xa451('0x9e'))]['ValidationError'](_0xa451('0xa0')));}if(_[_0xa451('0x8b')](_0x46047f['body']['body'])||_0x46047f[_0xa451('0x6b')]['body']===''){throw _0x5c5d46[_0xa451('0x21')](0x1f4)[_0xa451('0x30')](new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xc8')));}if(_[_0xa451('0x8b')](_0x46047f[_0xa451('0x6b')]['mapKeyOffline'])){throw _0x5c5d46['status'](0x1f4)[_0xa451('0x30')](new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xc9')+_0x4d3580));}if(!_['includes'](_0x4d3580,_0x46047f[_0xa451('0x6b')][_0xa451('0xca')])){throw _0x5c5d46['status'](0x1f4)[_0xa451('0x30')](new db[(_0xa451('0x9e'))]['ValidationError'](_0xa451('0xcb')+_0x4d3580));}_0x54ba85[_0x46047f[_0xa451('0x6b')][_0xa451('0xca')]]=_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')];})[_0xa451('0x15')](function(){return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x46047f['params']['id']},'include':[{'model':db[_0xa451('0xcc')],'as':_0xa451('0xa5')},{'model':db[_0xa451('0xcd')],'as':_0xa451('0xcd')}]});})[_0xa451('0x15')](handleEntityNotFound(_0x5c5d46,null))[_0xa451('0x15')](function(_0x2f2009){if(_0x2f2009&&_0x2f2009['List']){_0x1ea90f=_0x2f2009;var _0x637458=_['defaults'](_0x46047f[_0xa451('0x6b')],{'firstName':_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')],'phone':_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')],'ListId':_0x2f2009[_0xa451('0xce')]});_0x637458[_0x46047f[_0xa451('0x6b')][_0xa451('0xca')]]=_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')];return db[_0xa451('0x98')]['findOrCreate']({'where':_0x54ba85,'defaults':_0x637458});}})[_0xa451('0xab')](function(_0x2c58b6){if(_0x2c58b6){_0x591dcb=_0x2c58b6;var _0x58b158=fs[_0xa451('0xcf')](path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0xd0')),_0xa451('0xd1'));var _0x1c1d95=ejs['render'](_0x58b158,{'body':_[_0xa451('0xd2')](_0x46047f[_0xa451('0x6b')]['body']),'bodyTitle':_0x1ea90f[_0xa451('0xd3')]});return db[_0xa451('0xd4')][_0xa451('0x6a')]({'body':_0x1c1d95,'plainBody':htmlToText[_0xa451('0xd5')](_0x1c1d95),'ContactId':_0x2c58b6['id'],'ChatWebsiteId':_0x1ea90f['id']});}})[_0xa451('0x15')](function(_0x46cacf){_0x2e5718=_0x46cacf;if(_0x41d329[_0xa451('0x5a')]){var _0x4981e3=_0x41d329[_0xa451('0x51')](function(_0x4989b9){return{'name':_0x4989b9[_0xa451('0xd6')],'basename':_0x4989b9[_0xa451('0x82')],'type':_0x4989b9[_0xa451('0xd7')],'ChatOfflineMessageId':_0x46cacf['id']};});_0x2595e9=_0x4981e3[_0xa451('0x51')](_0x1ec2e4=>{var _0x4bb01d={'filename':_0x1ec2e4[_0xa451('0x2f')],'path':path['join'](config[_0xa451('0x86')],_0xa451('0xd8'),_0xa451('0xc7'),_0xa451('0xd9'),_0xa451('0xda'),_0x1ec2e4[_0xa451('0xdb')])};return _0x4bb01d;});if(!_0x1ea90f[_0xa451('0xdc')]){return db[_0xa451('0xdd')][_0xa451('0xde')](function(_0x470530){return db[_0xa451('0xdf')][_0xa451('0xe0')](_0x4981e3,{'transaction':_0x470530});});}}})[_0xa451('0x15')](function(){if(_0x2e5718){_0x4b4c07=_0x2e5718;return db[_0xa451('0xcd')][_0xa451('0xe1')]({'where':{'service':!![]},'include':[{'model':db[_0xa451('0xe2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa451('0xe3')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xa451('0x15')](function(_0x46d3f6){if(_0x46d3f6&&_0x46d3f6[_0xa451('0xe4')]&&_0x1ea90f[_0xa451('0xe5')]&&_0x1ea90f['forwardOfflineAddress']){var _0x113abb=_0x46d3f6['getSmtpOptions']();return respondWithRpcPromise(_0xa451('0xe6'),_0xa451('0xe7'),{'account':_0x113abb,'message':{'from':util[_0xa451('0x34')](_0xa451('0xe8'),_0x46d3f6[_0xa451('0x2f')],_0x46d3f6[_0xa451('0xe9')]||_0x46d3f6['Smtp'][_0xa451('0x6e')]),'to':_0x1ea90f[_0xa451('0xea')],'subject':_0x1ea90f[_0xa451('0xeb')],'html':_0x4b4c07[_0xa451('0x6b')],'attachments':_0x2595e9}},client9003)['then'](function(){return _0x4b4c07;})['catch'](function(_0x32e268){logger[_0xa451('0x1a')](_0x32e268);});}})[_0xa451('0x15')](function(){if(_0x1ea90f&&_0x1ea90f[_0xa451('0xdc')]&&_0x1ea90f[_0xa451('0xec')]){var _0x425b03=[];if(_0x41d329[_0xa451('0x5a')]){_0x425b03=_0x41d329[_0xa451('0x51')](function(_0x3b4348){return{'name':_0x3b4348[_0xa451('0xd6')],'basename':_0x3b4348[_0xa451('0x82')],'type':_0x3b4348[_0xa451('0xd7')],'ChatOfflineMessageId':_0x2e5718['id']};});}var _0x51ab28;if(!_[_0xa451('0x8b')](_0x1ea90f[_0xa451('0xed')])){var _0x3bd9a7=_['map'](_0x46047f['body'],function(_0x2aa17c){return _0x2aa17c;});var _0x50989b=_[_0xa451('0xee')](_0x3bd9a7)[0x0];var _0x2af2a6=_['mapValues'](_0x50989b,function(_0x19d33f){return _0x19d33f;});_0x51ab28=_0x2af2a6[0x1][_0x1ea90f['subjectOffline']];}var _0x122422={'from':_0x591dcb[_0xa451('0xe9')],'firstName':_0x591dcb['firstName'],'lastName':_0x591dcb[_0xa451('0x44')],'mapKey':'email','message':{'from':_0x591dcb[_0xa451('0xe9')],'to':_0x1ea90f[_0xa451('0xcd')][_0xa451('0xe9')],'cc':'','subject':_[_0xa451('0x8b')](_0x51ab28)?_0x1ea90f['offlineMessageSubject']:_0x51ab28,'messageId':'','sentAt':new Date(),'attach':_0x425b03['length'],'attachments':_0x425b03,'originChannel':'Chat','ChatWebsiteId':_0x1ea90f['id'],'ChatOfflineMessageId':_0x4b4c07['id'],'originTo':_0x1ea90f[_0xa451('0xcd')]['email']},'body':_0x4b4c07[_0xa451('0x6b')]};var _0x4b50ed={'account':{'id':_0x1ea90f['MailAccountId']},'body':_0x122422,'log':_0xa451('0xef')};return respondWithRpcPromise(_0xa451('0xef'),_0xa451('0xf0'),_0x4b50ed,client9001)[_0xa451('0x15')](function(){return _0x4b4c07;})[_0xa451('0x1f')](function(_0x5c7102){logger[_0xa451('0x1a')](_0x5c7102);});}return;})[_0xa451('0x15')](function(){if(_0x4b4c07){return _0x4b4c07;}})[_0xa451('0x15')](respondWithResult(_0x5c5d46,null))[_0xa451('0x1f')](function(){for(var _0x8da88e of _0x41d329){var _0x3f6704=path['join'](config[_0xa451('0x86')],_0xa451('0xd8'),_0xa451('0xc7'),'attachments',_0xa451('0xda'),_0x8da88e[_0xa451('0x82')]);fs_extra[_0xa451('0xf1')](_0x3f6704)[_0xa451('0x1f')](function(_0x954420){logger[_0xa451('0x1a')](_0xa451('0xf2'),_0x3f6704,_0x954420);});}});};exports[_0xa451('0xf3')]=function(_0x2bbabe,_0x4c6a1f){return db[_0xa451('0xb4')][_0xa451('0x69')]({'where':{'id':_0x2bbabe[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x4c6a1f,null))[_0xa451('0x15')](function(_0x22094b){if(_0x22094b){return _0x22094b[_0xa451('0xf3')](_0x2bbabe['body']['ids'],_[_0xa451('0xf4')](_0x2bbabe[_0xa451('0x6b')],[_0xa451('0x7a'),'id'])||{});}})[_0xa451('0x15')](respondWithResult(_0x4c6a1f,null))[_0xa451('0x1f')](handleError(_0x4c6a1f,null));};exports[_0xa451('0xf5')]=function(_0x277624,_0x411c25){var _0x216e5c={'raw':![],'where':{}};var _0x32d330={};var _0x340046={'count':0x0,'rows':[]};return db[_0xa451('0x52')][_0xa451('0xe1')]({'where':{'id':_0x277624[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x411c25,null))[_0xa451('0x15')](function(_0x156a3e){if(_0x156a3e){_0x32d330[_0xa451('0x4b')]=_['keys'](db[_0xa451('0xb4')][_0xa451('0x53')]);_0x32d330[_0xa451('0x55')]=_['keys'](_0x277624['query']);_0x32d330[_0xa451('0x56')]=_[_0xa451('0x58')](_0x32d330[_0xa451('0x4b')],_0x32d330[_0xa451('0x55')]);_0x216e5c[_0xa451('0x57')]=_['intersection'](_0x32d330['model'],qs[_0xa451('0x59')](_0x277624['query']['fields']));_0x216e5c['attributes']=_0x216e5c['attributes'][_0xa451('0x5a')]?_0x216e5c[_0xa451('0x57')]:_0x32d330[_0xa451('0x4b')];if(!_0x277624['query'][_0xa451('0x76')]('nolimit')){_0x216e5c[_0xa451('0x26')]=qs['limit'](_0x277624['query'][_0xa451('0x26')]);_0x216e5c[_0xa451('0x24')]=qs['offset'](_0x277624[_0xa451('0x55')][_0xa451('0x24')]);}_0x216e5c[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x277624['query'][_0xa451('0x5c')]);_0x216e5c[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x277624['query'],_0x32d330[_0xa451('0x56')]));_0x216e5c[_0xa451('0x5d')][_0xa451('0x74')]=_0x156a3e['id'];if(_0x277624['query'][_0xa451('0x5e')]){_0x216e5c[_0xa451('0x5d')]=_['merge'](_0x216e5c['where'],{'$or':_[_0xa451('0x51')](_0x216e5c[_0xa451('0x57')],function(_0x2c92f8){var _0x50636b={};_0x50636b[_0x2c92f8]={'$like':'%'+_0x277624[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x50636b;})});}_0x216e5c=_[_0xa451('0x5f')]({},_0x216e5c,_0x277624['options']);return db[_0xa451('0xb4')]['count']({'where':_0x216e5c['where']})['then'](function(_0x119ebc){_0x340046[_0xa451('0x27')]=_0x119ebc;if(_0x277624[_0xa451('0x55')][_0xa451('0x61')]){_0x216e5c[_0xa451('0x62')]=[{'model':db[_0xa451('0x98')],'as':_0xa451('0xf6'),'required':![]},{'model':db['User'],'as':_0xa451('0xf7'),'attributes':[_0xa451('0x2f'),_0xa451('0xf8'),'internal'],'required':![]},{'model':db[_0xa451('0xf9')],'as':_0xa451('0xfa'),'attributes':['id',_0xa451('0x2f'),_0xa451('0xfb')],'where':_0x277624[_0xa451('0x55')][_0xa451('0xfc')]?{'id':_0x277624['query'][_0xa451('0xfc')]}:undefined,'required':_0x277624[_0xa451('0x55')][_0xa451('0xfc')]?!![]:![]}];}return db[_0xa451('0xb4')][_0xa451('0x63')](_0x216e5c);})[_0xa451('0x15')](function(_0x455542){_0x340046[_0xa451('0x64')]=_0x455542;return _0x340046;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x411c25,_0x216e5c))[_0xa451('0x1f')](handleError(_0x411c25,null));};exports[_0xa451('0x31')]=function(_0x58d166,_0x22b771){var _0x510d70=0x0;var _0xa02d97=0x0;var _0x545920=![];var _0x1b7fb0;var _0x11e5ae;return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x58d166[_0xa451('0x71')]['id']},'include':[{'model':db['Interval'],'as':_0xa451('0xa9'),'include':[{'model':db['Interval'],'as':_0xa451('0xaa'),'attributes':['id',_0xa451('0x36')]}]}]})[_0xa451('0x15')](handleEntityNotFound(_0x22b771,null))[_0xa451('0x15')](function(_0x2d104f){if(_0x2d104f){_0x1b7fb0=_0x2d104f;return _0x2d104f[_0xa451('0xfd')]({'raw':!![]});}})['then'](function(_0x46ca16){if(_0x1b7fb0){if(_0x46ca16){_0x11e5ae=_0x46ca16;}}return require(_0xa451('0x88'))[_0xa451('0x89')]();})[_0xa451('0x15')](function(_0x5cd83d){if(_0x5cd83d){_0xa02d97=_0x5cd83d[_0xa451('0xfe')];_0x545920=_0x5cd83d[_0xa451('0x8a')];}})[_0xa451('0x15')](function(){return db[_0xa451('0xb4')]['count']({'where':{'closed':![]}});})[_0xa451('0x15')](function(_0x115d5b){_0x510d70=_0x115d5b;if(_0xa02d97&&_0x115d5b>_0xa02d97){return db[_0xa451('0xff')][_0xa451('0xe1')]({'where':{'id':0x1}})[_0xa451('0x15')](function(_0x5e89bb){if(_0x5e89bb){_0x5e89bb[_0xa451('0x100')]('chatLicenseExceeded');}});}})[_0xa451('0x15')](function(){if(!_0x1b7fb0[_0xa451('0xa9')]||!_0x1b7fb0['Interval']['Intervals'])return!![];return checkWebsiteIntervals(_0x1b7fb0);})[_0xa451('0x15')](function(_0x4882ed){var _0x2c22c5=fs[_0xa451('0xcf')](path[_0xa451('0x85')](config['root'],'server/files/chat/iframe.ejs'),_0xa451('0xd1'));var _0x2f05a9=new url['URL'](_0x1b7fb0[_0xa451('0x101')])[_0xa451('0x102')];var _0xdaee2d=_0xa451('0x103');var _0x2d91e9=![];var _0x189c91={'chatVersion':_0xdaee2d,'chatWebsiteAddressOrigin':_0x2f05a9,'remote':_0x1b7fb0['remote'],'query':querystring['stringify'](_[_0xa451('0x5f')](_0x1b7fb0['get']({'plain':!![]}),{'customerIp':_0x58d166[_0xa451('0xb2')][_0xa451('0x41')]||_0x58d166[_0xa451('0xb2')][_0xa451('0x104')]||_0x58d166[_0xa451('0x105')][_0xa451('0x106')]||_0x58d166['ip'],'referer':_0x58d166[_0xa451('0xb2')][_0xa451('0x45')],'openedInteractions':_0x510d70,'maxInteractions':_0xa02d97,'virtual':_0x545920[_0xa451('0xfe')],'online':_0x4882ed,'custom':_0x545920}))[_0xa451('0x107')](/'/g,'\x5c\x27')};_0x22b771['send'](ejs[_0xa451('0x108')](Mustache[_0xa451('0x108')](_0x2c22c5,_0x189c91),{'proactiveActions':_0x11e5ae,'alignment':_0x1b7fb0[_0xa451('0x109')],'verticalAlignment':_0x1b7fb0['verticalAlignment'],'div_color':_0x1b7fb0[_0xa451('0xfb')],'labelText':_0x1b7fb0['labelText'],'text_color':_0x1b7fb0[_0xa451('0x10a')],'text_button_color':_0x1b7fb0[_0xa451('0x10b')],'button_color':_0x1b7fb0[_0xa451('0x10c')],'background_color':_0x1b7fb0[_0xa451('0x10d')],'hideWhenOffline':_0x1b7fb0[_0xa451('0x10e')],'intervalId':_0x1b7fb0[_0xa451('0x10f')],'isDevelopment':_0x2d91e9,'chatVersion':_0xdaee2d}));})[_0xa451('0x1f')](handleError(_0x22b771,null));};exports[_0xa451('0x110')]=function(_0x4b02a7,_0x1d06c8){var _0x5ced96=_0x4b02a7['params']['id'];var _0x5a11c2=_0x4b02a7['body'];var _0x4e79f2=0xc8;var _0x3c5158=null;return db[_0xa451('0xdd')][_0xa451('0xde')]({'isolationLevel':db[_0xa451('0xdd')][_0xa451('0x111')][_0xa451('0x112')][_0xa451('0x113')]},function(_0x167ae1){return db[_0xa451('0x52')]['findOne']({'where':{'id':_0x5ced96},'transaction':_0x167ae1})[_0xa451('0x15')](function(_0x4bd096){if(_0x4bd096){return db[_0xa451('0xa7')][_0xa451('0x2b')]({'where':{'ChatWebsiteId':_0x5ced96},'transaction':_0x167ae1})[_0xa451('0x15')](function(){var _0x26ce7e=_[_0xa451('0x51')](_0x5a11c2,function(_0x582998){_0x582998[_0xa451('0x74')]=_0x5ced96;return _0x582998;});return db[_0xa451('0xa7')][_0xa451('0xe0')](_0x26ce7e,{'transaction':_0x167ae1});});}else{_0x4e79f2=0x194;_0x3c5158=[];}});})[_0xa451('0x15')](function(){if(_0x4e79f2!==0x194){return db[_0xa451('0xa7')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5ced96},'order':_0xa451('0xae')})[_0xa451('0x15')](function(_0x14bf4d){_0x3c5158=_0x14bf4d;});}})[_0xa451('0x1f')](function(_0x5af255){_0x4e79f2=0x1f4;logger[_0xa451('0x1a')](_0x5af255[_0xa451('0x114')]);if(_0x5af255[_0xa451('0x2f')]){delete _0x5af255[_0xa451('0x2f')];}_0x3c5158=_0x5af255;})[_0xa451('0x115')](function(){if(_0x3c5158===null){_0x1d06c8[_0xa451('0x20')](_0x4e79f2);}else{if(_0x4e79f2===0x1f4){_0x1d06c8[_0xa451('0x21')](_0x4e79f2)[_0xa451('0x30')](_0x3c5158);}else{_0x1d06c8[_0xa451('0x21')](_0x4e79f2)[_0xa451('0x23')](_0x3c5158);}}});};exports[_0xa451('0x116')]=function(_0x40d4d3,_0x538511){var _0x115536={};var _0xfc1cb7={};var _0x54814f;var _0x50f675;return db['ChatWebsite']['findOne']({'where':{'id':_0x40d4d3[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x538511,null))['then'](function(_0x2d5d30){if(_0x2d5d30){_0x54814f=_0x2d5d30;_0xfc1cb7[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0xa7')][_0xa451('0x53')]);_0xfc1cb7[_0xa451('0x55')]=_[_0xa451('0x67')](_0x40d4d3['query']);_0xfc1cb7[_0xa451('0x56')]=_[_0xa451('0x58')](_0xfc1cb7[_0xa451('0x4b')],_0xfc1cb7['query']);_0x115536['attributes']=_[_0xa451('0x58')](_0xfc1cb7[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x40d4d3[_0xa451('0x55')][_0xa451('0x59')]));_0x115536[_0xa451('0x57')]=_0x115536[_0xa451('0x57')][_0xa451('0x5a')]?_0x115536['attributes']:_0xfc1cb7[_0xa451('0x4b')];_0x115536[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x40d4d3[_0xa451('0x55')]['sort']);_0x115536['where']=qs['filters'](_[_0xa451('0x78')](_0x40d4d3[_0xa451('0x55')],_0xfc1cb7[_0xa451('0x56')]));if(_0x40d4d3['query']['filter']){_0x115536['where']=_[_0xa451('0x5f')](_0x115536[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x115536[_0xa451('0x57')],function(_0x3b950d){var _0x16707c={};_0x16707c[_0x3b950d]={'$like':'%'+_0x40d4d3['query'][_0xa451('0x5e')]+'%'};return _0x16707c;})});}_0x115536=_['merge']({},_0x115536,_0x40d4d3[_0xa451('0x68')]);return _0x54814f[_0xa451('0x116')](_0x115536);}})[_0xa451('0x15')](function(_0x5e66ca){if(_0x5e66ca){_0x50f675=_0x5e66ca[_0xa451('0x5a')];if(!_0x40d4d3['query'][_0xa451('0x76')](_0xa451('0x5b'))){_0x115536['limit']=qs['limit'](_0x40d4d3[_0xa451('0x55')][_0xa451('0x26')]);_0x115536['offset']=qs[_0xa451('0x24')](_0x40d4d3['query'][_0xa451('0x24')]);}return _0x54814f['getApplications'](_0x115536);}})[_0xa451('0x15')](function(_0x347408){if(_0x347408){return _0x347408?{'count':_0x50f675,'rows':_0x347408}:null;}})[_0xa451('0x15')](respondWithResult(_0x538511,null))[_0xa451('0x1f')](handleError(_0x538511,null));};exports[_0xa451('0x117')]=function(_0x56d491,_0x54bcb0){return db[_0xa451('0x118')][_0xa451('0x69')]({'where':{'id':_0x56d491[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x54bcb0,null))[_0xa451('0x15')](function(_0x1a5ae2){if(_0x1a5ae2){return _0x1a5ae2[_0xa451('0x117')](_0x56d491[_0xa451('0x6b')][_0xa451('0x7a')],_[_0xa451('0xf4')](_0x56d491[_0xa451('0x6b')],[_0xa451('0x7a'),'id'])||{});}})[_0xa451('0x15')](respondWithResult(_0x54bcb0,null))[_0xa451('0x1f')](handleError(_0x54bcb0,null));};exports[_0xa451('0xfd')]=function(_0x142e3e,_0x3dc180){var _0x470c4e={};var _0x4f48ab={};var _0xe22270;var _0x34e459;return db[_0xa451('0x52')][_0xa451('0xe1')]({'where':{'id':_0x142e3e[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x3dc180,null))[_0xa451('0x15')](function(_0xc58a24){if(_0xc58a24){_0xe22270=_0xc58a24;_0x4f48ab[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0x119')][_0xa451('0x53')]);_0x4f48ab['query']=_[_0xa451('0x67')](_0x142e3e[_0xa451('0x55')]);_0x4f48ab[_0xa451('0x56')]=_[_0xa451('0x58')](_0x4f48ab[_0xa451('0x4b')],_0x4f48ab[_0xa451('0x55')]);_0x470c4e[_0xa451('0x57')]=_[_0xa451('0x58')](_0x4f48ab[_0xa451('0x4b')],qs['fields'](_0x142e3e['query'][_0xa451('0x59')]));_0x470c4e['attributes']=_0x470c4e['attributes']['length']?_0x470c4e[_0xa451('0x57')]:_0x4f48ab[_0xa451('0x4b')];_0x470c4e[_0xa451('0x77')]=qs['sort'](_0x142e3e[_0xa451('0x55')][_0xa451('0x5c')]);_0x470c4e['where']=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x142e3e['query'],_0x4f48ab[_0xa451('0x56')]));if(_0x142e3e[_0xa451('0x55')][_0xa451('0x5e')]){_0x470c4e[_0xa451('0x5d')]=_['merge'](_0x470c4e[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x470c4e[_0xa451('0x57')],function(_0x2d6e15){var _0x4ba9f7={};_0x4ba9f7[_0x2d6e15]={'$like':'%'+_0x142e3e['query'][_0xa451('0x5e')]+'%'};return _0x4ba9f7;})});}_0x470c4e=_[_0xa451('0x5f')]({},_0x470c4e,_0x142e3e[_0xa451('0x68')]);return _0xe22270[_0xa451('0xfd')](_0x470c4e);}})[_0xa451('0x15')](function(_0xd47bde){if(_0xd47bde){_0x34e459=_0xd47bde[_0xa451('0x5a')];if(!_0x142e3e[_0xa451('0x55')][_0xa451('0x76')]('nolimit')){_0x470c4e[_0xa451('0x26')]=qs[_0xa451('0x26')](_0x142e3e[_0xa451('0x55')][_0xa451('0x26')]);_0x470c4e[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x142e3e[_0xa451('0x55')]['offset']);}return _0xe22270[_0xa451('0xfd')](_0x470c4e);}})[_0xa451('0x15')](function(_0x203e5b){if(_0x203e5b){return _0x203e5b?{'count':_0x34e459,'rows':_0x203e5b}:null;}})[_0xa451('0x15')](respondWithResult(_0x3dc180,null))['catch'](handleError(_0x3dc180,null));};exports['getFields']=function(_0x5b90d3,_0x1850c6){var _0x31b1e2=_0x5b90d3[_0xa451('0x55')][_0xa451('0x11a')]==='false'?'offlineForm':'onlineForm';return db[_0xa451('0x52')]['find']({'attributes':['id',_0x31b1e2],'where':{'id':_0x5b90d3[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x1850c6,null))['then'](function(_0x28ac76){if(_0x28ac76){var _0x5b47e7=_0x28ac76[_0x31b1e2];var _0xc1f47d=_0x5b47e7&&_0x5b47e7[_0xa451('0x11b')]?_0x5b47e7[_0xa451('0x11b')]:[];_0x1850c6[_0xa451('0x30')]({'fromKey':_[_0xa451('0x8b')](_0x5b47e7[_0xa451('0x11c')])?undefined:_0x5b47e7['fromKey'],'count':_0xc1f47d['length'],'rows':_0xc1f47d});}})[_0xa451('0x1f')](handleError(_0x1850c6,null));};exports[_0xa451('0x11d')]=function(_0x2decbc,_0x12d6c8){var _0x5bdf4b={'raw':![],'where':{}};var _0x5b74f4={};var _0x15847d={'count':0x0,'rows':[]};return db[_0xa451('0x52')][_0xa451('0xe1')]({'where':{'id':_0x2decbc[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x12d6c8,null))[_0xa451('0x15')](function(_0xab5a50){if(_0xab5a50){_0x5b74f4[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0xd4')][_0xa451('0x53')]);_0x5b74f4[_0xa451('0x55')]=_[_0xa451('0x67')](_0x2decbc['query']);_0x5b74f4[_0xa451('0x56')]=_[_0xa451('0x58')](_0x5b74f4[_0xa451('0x4b')],_0x5b74f4['query']);_0x5bdf4b[_0xa451('0x57')]=_[_0xa451('0x58')](_0x5b74f4['model'],qs[_0xa451('0x59')](_0x2decbc['query']['fields']));_0x5bdf4b['attributes']=_0x5bdf4b[_0xa451('0x57')][_0xa451('0x5a')]?_0x5bdf4b[_0xa451('0x57')]:_0x5b74f4[_0xa451('0x4b')];if(!_0x2decbc[_0xa451('0x55')]['hasOwnProperty'](_0xa451('0x5b'))){_0x5bdf4b[_0xa451('0x26')]=qs['limit'](_0x2decbc[_0xa451('0x55')][_0xa451('0x26')]);_0x5bdf4b[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x2decbc['query']['offset']);}_0x5bdf4b[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x2decbc[_0xa451('0x55')][_0xa451('0x5c')]);_0x5bdf4b[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x2decbc[_0xa451('0x55')],_0x5b74f4['filters']));_0x5bdf4b[_0xa451('0x5d')]['ChatWebsiteId']=_0xab5a50['id'];if(_0x2decbc['query'][_0xa451('0x5e')]){_0x5bdf4b['where']=_['merge'](_0x5bdf4b[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x5bdf4b[_0xa451('0x57')],function(_0x2b63ec){var _0x53bd6d={};_0x53bd6d[_0x2b63ec]={'$like':'%'+_0x2decbc['query']['filter']+'%'};return _0x53bd6d;})});}_0x5bdf4b=_[_0xa451('0x5f')]({},_0x5bdf4b,_0x2decbc[_0xa451('0x68')]);return db[_0xa451('0xd4')]['count']({'where':_0x5bdf4b[_0xa451('0x5d')]})['then'](function(_0x32fe2c){_0x15847d[_0xa451('0x27')]=_0x32fe2c;if(_0x2decbc[_0xa451('0x55')]['includeAll']){_0x5bdf4b['include']=[{'all':!![]}];}else{_0x5bdf4b[_0xa451('0x62')]=[{'model':db[_0xa451('0x98')],'as':_0xa451('0xf6'),'required':![]},{'model':db[_0xa451('0xdf')],'as':'Attachments','required':![]}];}return db[_0xa451('0xd4')][_0xa451('0x63')](_0x5bdf4b);})[_0xa451('0x15')](function(_0x362ec){_0x15847d[_0xa451('0x64')]=_0x362ec;return _0x15847d;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x12d6c8,_0x5bdf4b))[_0xa451('0x1f')](handleError(_0x12d6c8,null));};exports[_0xa451('0x11e')]=function(_0x38a4e7,_0x435400){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x38a4e7['params']['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x435400,null))[_0xa451('0x15')](function(_0x2e5b7c){if(_0x2e5b7c){return _0x2e5b7c[_0xa451('0x11e')](_0x38a4e7[_0xa451('0x6b')][_0xa451('0x7a')],_[_0xa451('0xf4')](_0x38a4e7[_0xa451('0x6b')],['ids','id'])||{})['spread'](function(_0x271603){for(var _0x24a7bb=0x0;_0x24a7bb<_0x38a4e7[_0xa451('0x6b')]['ids']['length'];_0x24a7bb+=0x1){socket[_0xa451('0x11f')](_0xa451('0x120'),{'UserId':Number(_0x38a4e7[_0xa451('0x6b')]['ids'][_0x24a7bb]),'ChatWebsiteId':Number(_0x38a4e7['params']['id'])});}return _0x271603;});}})[_0xa451('0x15')](respondWithResult(_0x435400,null))[_0xa451('0x1f')](handleError(_0x435400,null));};exports[_0xa451('0x121')]=function(_0x3baa50,_0x47a054){return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x3baa50['params']['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x47a054,null))['then'](function(_0x4c31e0){if(_0x4c31e0){return _0x4c31e0['removeAgents'](_0x3baa50[_0xa451('0x55')][_0xa451('0x7a')])[_0xa451('0x15')](function(){if(_['isArray'](_0x3baa50[_0xa451('0x55')]['ids'])){for(var _0x2f7e4d=0x0;_0x2f7e4d<_0x3baa50[_0xa451('0x55')][_0xa451('0x7a')][_0xa451('0x5a')];_0x2f7e4d+=0x1){socket[_0xa451('0x11f')](_0xa451('0x122'),{'UserId':Number(_0x3baa50[_0xa451('0x55')]['ids'][_0x2f7e4d]),'ChatWebsiteId':Number(_0x3baa50[_0xa451('0x71')]['id'])});}}else{socket[_0xa451('0x11f')](_0xa451('0x122'),{'UserId':Number(_0x3baa50[_0xa451('0x55')]['ids']),'ChatWebsiteId':Number(_0x3baa50[_0xa451('0x71')]['id'])});}});}})[_0xa451('0x15')](respondWithStatusCode(_0x47a054,null))[_0xa451('0x1f')](handleError(_0x47a054,null));};exports[_0xa451('0x123')]=function(_0x57abf8,_0x56573e){var _0x2eda2c={};var _0x32229a={};var _0x25be2a;var _0x1208e5;return db[_0xa451('0x52')]['findOne']({'where':{'id':_0x57abf8[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x56573e,null))[_0xa451('0x15')](function(_0x58acb4){if(_0x58acb4){_0x25be2a=_0x58acb4;_0x32229a['model']=_['keys'](db[_0xa451('0x124')][_0xa451('0x53')]);_0x32229a[_0xa451('0x55')]=_[_0xa451('0x67')](_0x57abf8['query']);_0x32229a[_0xa451('0x56')]=_[_0xa451('0x58')](_0x32229a[_0xa451('0x4b')],_0x32229a[_0xa451('0x55')]);_0x2eda2c[_0xa451('0x57')]=_['intersection'](_0x32229a[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x57abf8[_0xa451('0x55')][_0xa451('0x59')]));_0x2eda2c[_0xa451('0x57')]=_0x2eda2c[_0xa451('0x57')]['length']?_0x2eda2c[_0xa451('0x57')]:_0x32229a[_0xa451('0x4b')];_0x2eda2c['order']=qs[_0xa451('0x5c')](_0x57abf8[_0xa451('0x55')]['sort']);_0x2eda2c[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x57abf8['query'],_0x32229a[_0xa451('0x56')]));if(_0x57abf8[_0xa451('0x55')]['filter']){_0x2eda2c[_0xa451('0x5d')]=_[_0xa451('0x5f')](_0x2eda2c[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x2eda2c[_0xa451('0x57')],function(_0x38d123){var _0x3f3c2b={};_0x3f3c2b[_0x38d123]={'$like':'%'+_0x57abf8[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x3f3c2b;})});}_0x2eda2c=_[_0xa451('0x5f')]({},_0x2eda2c,_0x57abf8['options']);return _0x25be2a[_0xa451('0x123')](_0x2eda2c);}})[_0xa451('0x15')](function(_0x91a95d){if(_0x91a95d){_0x1208e5=_0x91a95d[_0xa451('0x5a')];if(!_0x57abf8[_0xa451('0x55')][_0xa451('0x76')](_0xa451('0x5b'))){_0x2eda2c[_0xa451('0x26')]=qs[_0xa451('0x26')](_0x57abf8[_0xa451('0x55')]['limit']);_0x2eda2c[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x57abf8[_0xa451('0x55')][_0xa451('0x24')]);}return _0x25be2a[_0xa451('0x123')](_0x2eda2c);}})['then'](function(_0x21d789){if(_0x21d789){return _0x21d789?{'count':_0x1208e5,'rows':_0x21d789}:null;}})[_0xa451('0x15')](respondWithResult(_0x56573e,null))[_0xa451('0x1f')](handleError(_0x56573e,null));}; \ No newline at end of file +var _0x4a5a=['addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','handleError','redis','defaults','localhost','socket.io-emitter','client','http','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','map','Interval','all','user-agent-parser','setUA','user-agent','getResult','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','model','%s\x20%s\x20%s','vendor','type','stringify','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','describe','ChatWebsiteId','Disposition','getDispositions','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','systemAvatar','file','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','Intervals','spread','list','applications','orderBy','Applications','priority','asc','account','Contacts','contact','headers','threadId','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','openNewInteraction','transaction','Attachment','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','Tags','color','tag','getProactiveActions','virtual','License','URL','address','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','ChatApplication','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','online','false','items','fromKey','getOfflineMessages','Attachments'];(function(_0x24e18e,_0x52ce1b){var _0x35263a=function(_0x170d56){while(--_0x170d56){_0x24e18e['push'](_0x24e18e['shift']());}};_0x35263a(++_0x52ce1b);}(_0x4a5a,0x12f));var _0xa4a5=function(_0x1204dd,_0x30c6e0){_0x1204dd=_0x1204dd-0x0;var _0x482b6d=_0x4a5a[_0x1204dd];return _0x482b6d;};'use strict';var Mustache=require(_0xa4a5('0x0'));var util=require(_0xa4a5('0x1'));var path=require(_0xa4a5('0x2'));var ejs=require(_0xa4a5('0x3'));var fs=require('fs');var fs_extra=require(_0xa4a5('0x4'));var _=require(_0xa4a5('0x5'));var querystring=require('querystring');var htmlToText=require(_0xa4a5('0x6'));var Redis=require('ioredis');var jayson=require(_0xa4a5('0x7'));var url=require(_0xa4a5('0x8'));var qs=require(_0xa4a5('0x9'));var logger=require(_0xa4a5('0xa'))(_0xa4a5('0xb'));var config=require(_0xa4a5('0xc'));var APIOutOfIntervalError=require(_0xa4a5('0xd'))['APIOutOfIntervalError'];var APINotFoundError=require(_0xa4a5('0xd'))[_0xa4a5('0xe')];var APIHandleError=require('../../errors/api')[_0xa4a5('0xf')];var db=require('../../mysqldb')['db'];config[_0xa4a5('0x10')]=_[_0xa4a5('0x11')](config[_0xa4a5('0x10')],{'host':_0xa4a5('0x12'),'port':0x18eb});var socket=require(_0xa4a5('0x13'))(new Redis(config[_0xa4a5('0x10')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0xa4a5('0x14')][_0xa4a5('0x15')]({'port':0x232c});var client9002=jayson['client'][_0xa4a5('0x15')]({'port':0x232a});var client9003=jayson[_0xa4a5('0x14')][_0xa4a5('0x15')]({'port':0x232b});var client9001=jayson['client'][_0xa4a5('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x48944e,_0x4e679f,_0x188444,_0x490948){return new Promise(function(_0x5cd4bc,_0x1afc39){var _0x163907=_0x490948||client;return _0x163907['request'](_0x48944e,_0x188444)['then'](function(_0x32387e){logger['info'](_0xa4a5('0x16'),_0x4e679f,_0xa4a5('0x17'));logger[_0xa4a5('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4e679f,_0xa4a5('0x17'),JSON['stringify'](_0x32387e));if(_0x32387e[_0xa4a5('0x19')]){if(_0x32387e[_0xa4a5('0x19')]['code']===0x1f4){logger[_0xa4a5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e679f,_0x32387e[_0xa4a5('0x19')][_0xa4a5('0x1a')]);return _0x1afc39(_0x32387e[_0xa4a5('0x19')][_0xa4a5('0x1a')]);}logger[_0xa4a5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e679f,_0x32387e['error']['message']);return _0x5cd4bc(_0x32387e[_0xa4a5('0x19')]['message']);}else{logger['info'](_0xa4a5('0x16'),_0x4e679f,_0xa4a5('0x17'));_0x5cd4bc(_0x32387e[_0xa4a5('0x1b')]['message']);}})[_0xa4a5('0x1c')](function(_0x283428){logger[_0xa4a5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e679f,_0x283428);_0x1afc39(_0x283428);});});}function respondWithStatusCode(_0x42ecbe,_0x2e0301){_0x2e0301=_0x2e0301||0xcc;return function(_0x5e5009){if(_0x5e5009){return _0x42ecbe[_0xa4a5('0x1d')](_0x2e0301);}return _0x42ecbe[_0xa4a5('0x1e')](_0x2e0301)[_0xa4a5('0x1f')]();};}function respondWithResult(_0x538bac,_0x272e4e){_0x272e4e=_0x272e4e||0xc8;return function(_0x1e02c1){if(_0x1e02c1){return _0x538bac[_0xa4a5('0x1e')](_0x272e4e)['json'](_0x1e02c1);}};}function respondWithFilteredResult(_0x439243,_0x1d0d1d){return function(_0x5deb77){if(_0x5deb77){var _0x423189=typeof _0x1d0d1d[_0xa4a5('0x20')]===_0xa4a5('0x21')&&typeof _0x1d0d1d[_0xa4a5('0x22')]===_0xa4a5('0x21');var _0x1d7df8=_0x5deb77['count'];var _0x5c7357=_0x423189?0x0:_0x1d0d1d[_0xa4a5('0x20')];var _0x2c887f=_0x423189?_0x5deb77[_0xa4a5('0x23')]:_0x1d0d1d['offset']+_0x1d0d1d[_0xa4a5('0x22')];var _0x3aa9ed;if(_0x2c887f>=_0x1d7df8){_0x2c887f=_0x1d7df8;_0x3aa9ed=0xc8;}else{_0x3aa9ed=0xce;}_0x439243['status'](_0x3aa9ed);return _0x439243[_0xa4a5('0x24')]('Content-Range',_0x5c7357+'-'+_0x2c887f+'/'+_0x1d7df8)[_0xa4a5('0x25')](_0x5deb77);}return null;};}function saveUpdates(_0x475f8d){return function(_0x306b58){if(_0x306b58){return _0x306b58[_0xa4a5('0x26')](_0x475f8d)[_0xa4a5('0x27')](function(_0x68e4c3){return _0x68e4c3;});}return null;};}function removeEntity(_0x17448a){return function(_0x3bc3ad){if(_0x3bc3ad){return _0x3bc3ad[_0xa4a5('0x28')]()[_0xa4a5('0x27')](function(){var _0x5bda0a=_0x3bc3ad[_0xa4a5('0x29')]({'plain':!![]});var _0x20544d=_0xa4a5('0x2a');return db[_0xa4a5('0x2b')]['destroy']({'where':{'type':_0x20544d,'resourceId':_0x5bda0a['id']}})[_0xa4a5('0x27')](function(){return _0x3bc3ad;});})[_0xa4a5('0x27')](function(){_0x17448a[_0xa4a5('0x1e')](0xcc)[_0xa4a5('0x1f')]();});}};}function handleEntityNotFound(_0x41eaa2){return function(_0x305c73){if(!_0x305c73){_0x41eaa2[_0xa4a5('0x1d')](0x194);}return _0x305c73;};}function handleError(_0x4facda,_0x383396){_0x383396=_0x383396||0x1f4;return function(_0x45ec64){logger[_0xa4a5('0x19')](_0x45ec64[_0xa4a5('0x2c')]);if(_0x45ec64[_0xa4a5('0x2d')]){delete _0x45ec64[_0xa4a5('0x2d')];}_0x4facda[_0xa4a5('0x1e')](_0x383396)[_0xa4a5('0x2e')](_0x45ec64);};}function iftimePromise(_0x321ca6,_0x1677ac){return respondWithRpcPromise(_0xa4a5('0x2f'),_0xa4a5('0x30'),{'command':_0x1677ac[_0xa4a5('0x31')]?util['format'](_0xa4a5('0x32'),_0x321ca6[_0xa4a5('0x33')],_0x1677ac[_0xa4a5('0x31')]):util['format']('iftime\x20%s',_0x321ca6[_0xa4a5('0x33')])},client9002)[_0xa4a5('0x27')](function(_0x13f0e5){var _0x43b888=_0x13f0e5&&_0x13f0e5[_0xa4a5('0x34')](_0xa4a5('0x35'))>=0x0?!![]:![];logger[_0xa4a5('0x36')](_0xa4a5('0x37'),_0x1677ac['id'],_0x321ca6['id'],_0x321ca6[_0xa4a5('0x33')],_0x43b888?_0xa4a5('0x38'):_0xa4a5('0x39'),_0x1677ac[_0xa4a5('0x31')]?_0x1677ac['timezone']:'No\x20timezone');return _0x43b888;})['catch'](function(_0x4ff844){logger[_0xa4a5('0x19')](_0xa4a5('0x37'),_0x1677ac['id'],_0x321ca6['id'],_0x321ca6[_0xa4a5('0x33')],util[_0xa4a5('0x3a')](_0x4ff844,{'showHidden':![],'depth':null}),_0x1677ac[_0xa4a5('0x31')]?_0x1677ac[_0xa4a5('0x31')]:_0xa4a5('0x3b'));return![];});}function checkWebsiteIntervals(_0x1641e3){var _0x2a38fd=_[_0xa4a5('0x3c')](_0x1641e3[_0xa4a5('0x3d')]['Intervals'],function(_0xf6c31){var _0x14fcbb=_0xf6c31[_0xa4a5('0x29')]({'plain':!![]});return iftimePromise(_0x14fcbb,_0x1641e3);});return Promise[_0xa4a5('0x3e')](_0x2a38fd)[_0xa4a5('0x27')](function(_0x3a0dc7){return _['some'](_0x3a0dc7);});}function createInteractionObject(_0x41d178,_0x411c33,_0x43ba53,_0x3aecfa){var _0x15fc03=require(_0xa4a5('0x3f'));var _0x17a86d=new _0x15fc03();var _0x10ac15=_0x17a86d[_0xa4a5('0x40')](_0x43ba53[_0xa4a5('0x41')])[_0xa4a5('0x42')]();var _0x18ea4b=_0x411c33['customerIp'];if(_0x43ba53['cf-connecting-ip']){_0x18ea4b=_0x43ba53['cf-connecting-ip'];}else if(_0x43ba53[_0xa4a5('0x43')]){_0x18ea4b=_['first'](_0x43ba53['x-forwarded-for'][_0xa4a5('0x44')](','));}return{'ContactId':_0x3aecfa['id'],'ChatWebsiteId':_0x41d178,'from':(_0x3aecfa[_0xa4a5('0x45')]||'')+'\x20'+(_0x3aecfa[_0xa4a5('0x46')]||''),'customerIp':_0x18ea4b,'customerPort':_0x43ba53['x-real-port']?_0x43ba53[_0xa4a5('0x47')]:null,'referer':_0x411c33[_0xa4a5('0x48')],'browserName':_0x10ac15['browser'][_0xa4a5('0x2d')]&&_0x10ac15[_0xa4a5('0x49')]['version']?util[_0xa4a5('0x4a')](_0xa4a5('0x4b'),_0x10ac15['browser'][_0xa4a5('0x2d')],_0x10ac15[_0xa4a5('0x49')][_0xa4a5('0x4c')]):_0xa4a5('0x4d'),'browserVersion':_0x10ac15[_0xa4a5('0x49')][_0xa4a5('0x4c')]||_0xa4a5('0x4d'),'osName':util[_0xa4a5('0x4a')](_0xa4a5('0x4b'),_0x10ac15['os']['name'],_0x10ac15['os']['version']),'osVersion':_0x10ac15['os']['version'],'deviceModel':_0x10ac15[_0xa4a5('0x4e')][_0xa4a5('0x4f')]&&_0x10ac15['device']['vendor']?util[_0xa4a5('0x4a')](_0xa4a5('0x50'),_0x10ac15[_0xa4a5('0x4e')]['model'],_0x10ac15[_0xa4a5('0x4e')][_0xa4a5('0x51')],_0x10ac15['device'][_0xa4a5('0x52')]):null,'deviceVendor':_0x10ac15[_0xa4a5('0x4e')]['vendor'],'deviceType':_0x10ac15[_0xa4a5('0x4e')][_0xa4a5('0x52')],'formData':JSON[_0xa4a5('0x53')](_0x411c33)};}exports[_0xa4a5('0x54')]=function(_0x2460f3,_0x4613b4){var _0xb381ff={'include':[{'model':db[_0xa4a5('0x55')],'as':_0xa4a5('0x56')}]},_0x48aa89={},_0x6f47c9={'count':0x0,'rows':[]};var _0x8e41be=_['map'](db[_0xa4a5('0x57')][_0xa4a5('0x58')],function(_0x56fb51){return{'name':_0x56fb51[_0xa4a5('0x59')],'type':_0x56fb51[_0xa4a5('0x52')][_0xa4a5('0x5a')]};});_0x48aa89[_0xa4a5('0x4f')]=_[_0xa4a5('0x3c')](_0x8e41be,'name');_0x48aa89['query']=_[_0xa4a5('0x5b')](_0x2460f3['query']);_0x48aa89[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x48aa89[_0xa4a5('0x4f')],_0x48aa89['query']);_0xb381ff[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x48aa89[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x2460f3[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0xb381ff[_0xa4a5('0x5e')]=_0xb381ff[_0xa4a5('0x5e')][_0xa4a5('0x61')]?_0xb381ff[_0xa4a5('0x5e')]:_0x48aa89[_0xa4a5('0x4f')];if(!_0x2460f3['query'][_0xa4a5('0x62')]('nolimit')){_0xb381ff['limit']=qs['limit'](_0x2460f3[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0xb381ff[_0xa4a5('0x20')]=qs['offset'](_0x2460f3['query']['offset']);}_0xb381ff[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x2460f3[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0xb381ff[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x2460f3['query'],_0x48aa89[_0xa4a5('0x5c')]),_0x8e41be);if(_0x2460f3['query'][_0xa4a5('0x67')]){_0xb381ff[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0xb381ff['where'],{'$or':_[_0xa4a5('0x3c')](_0x8e41be,function(_0x2696a3){if(_0x2696a3['type']!==_0xa4a5('0x69')){var _0x3accce={};_0x3accce[_0x2696a3['name']]={'$like':'%'+_0x2460f3['query'][_0xa4a5('0x67')]+'%'};return _0x3accce;}})});}_0xb381ff=_[_0xa4a5('0x68')]({},_0xb381ff,_0x2460f3[_0xa4a5('0x6a')]);var _0x326388={'where':_0xb381ff[_0xa4a5('0x65')]};return db[_0xa4a5('0x57')][_0xa4a5('0x23')](_0x326388)[_0xa4a5('0x27')](function(_0x5e0006){_0x6f47c9[_0xa4a5('0x23')]=_0x5e0006;if(_0x2460f3[_0xa4a5('0x60')]['includeAll']){_0xb381ff['include']=[{'all':!![]}];}return db[_0xa4a5('0x57')][_0xa4a5('0x6b')](_0xb381ff);})[_0xa4a5('0x27')](function(_0x178b68){_0x6f47c9[_0xa4a5('0x6c')]=_0x178b68;return _0x6f47c9;})[_0xa4a5('0x27')](respondWithFilteredResult(_0x4613b4,_0xb381ff))[_0xa4a5('0x1c')](handleError(_0x4613b4,null));};exports['show']=function(_0x176397,_0x112fea){var _0x5539d4={'raw':![],'where':{'id':_0x176397[_0xa4a5('0x6d')]['id']},'include':[{'model':db[_0xa4a5('0x55')],'as':_0xa4a5('0x56')}]},_0x31eb7b={};_0x31eb7b[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['ChatWebsite'][_0xa4a5('0x58')]);_0x31eb7b[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x176397[_0xa4a5('0x60')]);_0x31eb7b['filters']=_[_0xa4a5('0x5d')](_0x31eb7b['model'],_0x31eb7b[_0xa4a5('0x60')]);_0x5539d4['attributes']=_['intersection'](_0x31eb7b[_0xa4a5('0x4f')],qs['fields'](_0x176397['query'][_0xa4a5('0x5f')]));_0x5539d4[_0xa4a5('0x5e')]=_0x5539d4['attributes']['length']?_0x5539d4[_0xa4a5('0x5e')]:_0x31eb7b[_0xa4a5('0x4f')];if(_0x176397['query'][_0xa4a5('0x6e')]){_0x5539d4[_0xa4a5('0x6f')]=[{'all':!![]}];}_0x5539d4=_[_0xa4a5('0x68')]({},_0x5539d4,_0x176397[_0xa4a5('0x6a')]);return db[_0xa4a5('0x57')][_0xa4a5('0x70')](_0x5539d4)[_0xa4a5('0x27')](handleEntityNotFound(_0x112fea,null))[_0xa4a5('0x27')](respondWithResult(_0x112fea,null))[_0xa4a5('0x1c')](handleError(_0x112fea,null));};exports[_0xa4a5('0x71')]=function(_0xd9687d,_0x18b396){return db['ChatWebsite'][_0xa4a5('0x71')](_0xd9687d[_0xa4a5('0x72')],{})[_0xa4a5('0x27')](function(_0x2996db){var _0x5bfba6=_0xd9687d[_0xa4a5('0x73')][_0xa4a5('0x29')]({'plain':!![]});if(!_0x5bfba6)throw new Error(_0xa4a5('0x74'));if(_0x5bfba6[_0xa4a5('0x75')]===_0xa4a5('0x73')){var _0x3e78bb=_0x2996db[_0xa4a5('0x29')]({'plain':!![]});var _0x188343='ChatWebsites';return db['UserProfileSection'][_0xa4a5('0x70')]({'where':{'name':_0x188343,'userProfileId':_0x5bfba6[_0xa4a5('0x76')]},'raw':!![]})[_0xa4a5('0x27')](function(_0xb3b114){if(_0xb3b114&&_0xb3b114['autoAssociation']===0x0){return db['UserProfileResource'][_0xa4a5('0x71')]({'name':_0x3e78bb[_0xa4a5('0x2d')],'resourceId':_0x3e78bb['id'],'type':_0xb3b114['name'],'sectionId':_0xb3b114['id']},{})['then'](function(){return _0x2996db;});}else{return _0x2996db;}})[_0xa4a5('0x1c')](function(_0x164257){logger[_0xa4a5('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x164257);throw _0x164257;});}return _0x2996db;})['then'](respondWithResult(_0x18b396,0xc9))[_0xa4a5('0x1c')](handleError(_0x18b396,null));};exports[_0xa4a5('0x26')]=function(_0x8016f7,_0x43c8c7){if(_0x8016f7[_0xa4a5('0x72')]['id']){delete _0x8016f7[_0xa4a5('0x72')]['id'];}return db['ChatWebsite'][_0xa4a5('0x70')]({'where':{'id':_0x8016f7['params']['id']},'include':[{'model':db[_0xa4a5('0x55')],'as':_0xa4a5('0x56')}]})[_0xa4a5('0x27')](handleEntityNotFound(_0x43c8c7,null))[_0xa4a5('0x27')](saveUpdates(_0x8016f7[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x43c8c7,null))['catch'](handleError(_0x43c8c7,null));};exports[_0xa4a5('0x28')]=function(_0x2ff662,_0x5aee3a){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x2ff662['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x5aee3a,null))[_0xa4a5('0x27')](removeEntity(_0x5aee3a,null))[_0xa4a5('0x1c')](handleError(_0x5aee3a,null));};exports['describe']=function(_0x44631a,_0xe52a94){return db['ChatWebsite'][_0xa4a5('0x77')]()[_0xa4a5('0x27')](respondWithResult(_0xe52a94,null))[_0xa4a5('0x1c')](handleError(_0xe52a94,null));};exports['addDisposition']=function(_0x2d98fd,_0x17eb88){if(_0x2d98fd['body']['id']){delete _0x2d98fd[_0xa4a5('0x72')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2d98fd[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x17eb88,null))[_0xa4a5('0x27')](function(_0x3727f8){if(_0x3727f8){_0x2d98fd[_0xa4a5('0x72')][_0xa4a5('0x78')]=_0x3727f8['id'];return db[_0xa4a5('0x79')][_0xa4a5('0x71')](_0x2d98fd[_0xa4a5('0x72')]);}})[_0xa4a5('0x27')](respondWithResult(_0x17eb88,null))[_0xa4a5('0x1c')](handleError(_0x17eb88,null));};exports[_0xa4a5('0x7a')]=function(_0x902ae,_0x557484){var _0x27a34a={'raw':![],'where':{}};var _0x52e0b1={};var _0x15fcd4={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')]['findOne']({'where':{'id':_0x902ae[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x557484,null))['then'](function(_0x4ef480){if(_0x4ef480){_0x52e0b1[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db[_0xa4a5('0x79')][_0xa4a5('0x58')]);_0x52e0b1['query']=_['keys'](_0x902ae['query']);_0x52e0b1[_0xa4a5('0x5c')]=_['intersection'](_0x52e0b1[_0xa4a5('0x4f')],_0x52e0b1[_0xa4a5('0x60')]);_0x27a34a[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x52e0b1[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x902ae['query'][_0xa4a5('0x5f')]));_0x27a34a[_0xa4a5('0x5e')]=_0x27a34a[_0xa4a5('0x5e')]['length']?_0x27a34a[_0xa4a5('0x5e')]:_0x52e0b1[_0xa4a5('0x4f')];if(!_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x27a34a[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x27a34a['offset']=qs[_0xa4a5('0x20')](_0x902ae['query'][_0xa4a5('0x20')]);}_0x27a34a['order']=qs[_0xa4a5('0x64')](_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x27a34a[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x902ae[_0xa4a5('0x60')],_0x52e0b1[_0xa4a5('0x5c')]));_0x27a34a[_0xa4a5('0x65')][_0xa4a5('0x78')]=_0x4ef480['id'];if(_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x27a34a[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x27a34a[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x27a34a[_0xa4a5('0x5e')],function(_0x4f50eb){var _0x1d0e64={};_0x1d0e64[_0x4f50eb]={'$like':'%'+_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x1d0e64;})});}_0x27a34a=_[_0xa4a5('0x68')]({},_0x27a34a,_0x902ae[_0xa4a5('0x6a')]);return db['Disposition'][_0xa4a5('0x23')]({'where':_0x27a34a[_0xa4a5('0x65')]})[_0xa4a5('0x27')](function(_0x48aaaf){_0x15fcd4[_0xa4a5('0x23')]=_0x48aaaf;if(_0x902ae[_0xa4a5('0x60')]['includeAll']){_0x27a34a['include']=[{'all':!![]}];}return db[_0xa4a5('0x79')][_0xa4a5('0x6b')](_0x27a34a);})['then'](function(_0xac1aa3){_0x15fcd4[_0xa4a5('0x6c')]=_0xac1aa3;return _0x15fcd4;});}})[_0xa4a5('0x27')](respondWithFilteredResult(_0x557484,_0x27a34a))[_0xa4a5('0x1c')](handleError(_0x557484,null));};exports['removeDispositions']=function(_0xd91077,_0x4ffe55){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0xd91077[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4ffe55,null))[_0xa4a5('0x27')](function(_0x35e77e){if(_0x35e77e){return _0x35e77e[_0xa4a5('0x7c')](_0xd91077[_0xa4a5('0x60')][_0xa4a5('0x7d')]);}})[_0xa4a5('0x27')](respondWithStatusCode(_0x4ffe55,null))['catch'](handleError(_0x4ffe55,null));};exports['addAnswer']=function(_0x4cfc5a,_0x468f70){if(_0x4cfc5a[_0xa4a5('0x72')]['id']){delete _0x4cfc5a[_0xa4a5('0x72')]['id'];}return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x4cfc5a[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x468f70,null))['then'](function(_0xd4cad1){if(_0xd4cad1){_0x4cfc5a[_0xa4a5('0x72')][_0xa4a5('0x78')]=_0xd4cad1['id'];return db[_0xa4a5('0x7e')][_0xa4a5('0x71')](_0x4cfc5a[_0xa4a5('0x72')]);}})['then'](respondWithResult(_0x468f70,null))['catch'](handleError(_0x468f70,null));};exports[_0xa4a5('0x7f')]=function(_0x563947,_0x2d8f0c){var _0x153385={'raw':![],'where':{}};var _0x532332={};var _0x1ae6d8={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')]['findOne']({'where':{'id':_0x563947[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x2d8f0c,null))[_0xa4a5('0x27')](function(_0x9a3be){if(_0x9a3be){_0x532332[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['CannedAnswer'][_0xa4a5('0x58')]);_0x532332['query']=_[_0xa4a5('0x5b')](_0x563947['query']);_0x532332['filters']=_[_0xa4a5('0x5d')](_0x532332[_0xa4a5('0x4f')],_0x532332['query']);_0x153385[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x532332[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x563947['query'][_0xa4a5('0x5f')]));_0x153385[_0xa4a5('0x5e')]=_0x153385[_0xa4a5('0x5e')]['length']?_0x153385[_0xa4a5('0x5e')]:_0x532332[_0xa4a5('0x4f')];if(!_0x563947[_0xa4a5('0x60')]['hasOwnProperty'](_0xa4a5('0x7b'))){_0x153385[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x563947['query'][_0xa4a5('0x22')]);_0x153385[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0x563947[_0xa4a5('0x60')][_0xa4a5('0x20')]);}_0x153385[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x563947[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x153385[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x563947['query'],_0x532332[_0xa4a5('0x5c')]));_0x153385[_0xa4a5('0x65')][_0xa4a5('0x78')]=_0x9a3be['id'];if(_0x563947[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x153385[_0xa4a5('0x65')]=_['merge'](_0x153385[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x153385[_0xa4a5('0x5e')],function(_0x3a273e){var _0x526624={};_0x526624[_0x3a273e]={'$like':'%'+_0x563947[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x526624;})});}_0x153385=_['merge']({},_0x153385,_0x563947['options']);return db[_0xa4a5('0x7e')][_0xa4a5('0x23')]({'where':_0x153385[_0xa4a5('0x65')]})[_0xa4a5('0x27')](function(_0x52f0c1){_0x1ae6d8[_0xa4a5('0x23')]=_0x52f0c1;if(_0x563947[_0xa4a5('0x60')]['includeAll']){_0x153385[_0xa4a5('0x6f')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa4a5('0x6b')](_0x153385);})[_0xa4a5('0x27')](function(_0x31b915){_0x1ae6d8['rows']=_0x31b915;return _0x1ae6d8;});}})['then'](respondWithFilteredResult(_0x2d8f0c,_0x153385))['catch'](handleError(_0x2d8f0c,null));};exports[_0xa4a5('0x80')]=function(_0x35aa50,_0x4ff4bd){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x35aa50[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x4ff4bd,null))[_0xa4a5('0x27')](function(_0x55b408){if(_0x55b408){return _0x55b408[_0xa4a5('0x80')](_0x35aa50[_0xa4a5('0x60')]['ids']);}})[_0xa4a5('0x27')](respondWithStatusCode(_0x4ff4bd,null))[_0xa4a5('0x1c')](handleError(_0x4ff4bd,null));};exports['addLogo']=function(_0x37203a,_0x5803cc){_0x37203a[_0xa4a5('0x72')][_0xa4a5('0x81')]=_0x37203a['file'][_0xa4a5('0x82')];return db[_0xa4a5('0x57')]['find']({'where':{'id':_0x37203a[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x5803cc,null))[_0xa4a5('0x27')](saveUpdates(_0x37203a[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x5803cc,null))['catch'](handleError(_0x5803cc,null));};exports[_0xa4a5('0x83')]=function(_0x33ba91,_0x14022c){_0x33ba91['body'][_0xa4a5('0x84')]=_0x33ba91['file']['filename'];return db['ChatWebsite'][_0xa4a5('0x70')]({'where':{'id':_0x33ba91['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x14022c,null))[_0xa4a5('0x27')](saveUpdates(_0x33ba91[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x14022c,null))[_0xa4a5('0x1c')](handleError(_0x14022c,null));};exports[_0xa4a5('0x85')]=function(_0x1360c6,_0x6c00cc){_0x1360c6[_0xa4a5('0x72')]['customerAvatar']=_0x1360c6['file'][_0xa4a5('0x82')];return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x1360c6['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x6c00cc,null))[_0xa4a5('0x27')](saveUpdates(_0x1360c6[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x6c00cc,null))[_0xa4a5('0x1c')](handleError(_0x6c00cc,null));};exports['addSystemAvatar']=function(_0x1d774f,_0xd02afc){_0x1d774f[_0xa4a5('0x72')][_0xa4a5('0x86')]=_0x1d774f[_0xa4a5('0x87')][_0xa4a5('0x82')];return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x1d774f['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0xd02afc,null))[_0xa4a5('0x27')](saveUpdates(_0x1d774f[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0xd02afc,null))[_0xa4a5('0x1c')](handleError(_0xd02afc,null));};exports['getLogo']=function(_0x39c9b1,_0x291608){var _0xe2e176=path[_0xa4a5('0x88')](config['root'],_0xa4a5('0x89'));var _0x155408={'where':{'id':_0x39c9b1[_0xa4a5('0x6d')]['id']},'attributes':['id',_0xa4a5('0x81')],'raw':!![]};var _0x3b7c85=![];return require(_0xa4a5('0x8a'))[_0xa4a5('0x8b')]()[_0xa4a5('0x27')](function(_0x3fca8b){if(_0x3fca8b){_0x3b7c85=_0x3fca8b[_0xa4a5('0x8c')];}})['then'](function(){return db[_0xa4a5('0x57')][_0xa4a5('0x70')](_0x155408);})['then'](handleEntityNotFound(_0x291608,null))[_0xa4a5('0x27')](function(_0x98b92b){if(_0x98b92b){if(!_['isNil'](_0x98b92b['sitepic'])){if(fs[_0xa4a5('0x8d')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],'server/files/images/logos/',_0x98b92b['sitepic']))&&_0x3b7c85){_0xe2e176=path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x8f'),_0x98b92b[_0xa4a5('0x81')]);}}return _0x291608['download'](_0xe2e176);}})[_0xa4a5('0x1c')](handleError(_0x291608,null));};exports[_0xa4a5('0x90')]=function(_0x160975,_0x278dd8){var _0x3bd042=path['join'](config[_0xa4a5('0x8e')],_0xa4a5('0x91'));var _0x26b2f6={'where':{'id':_0x160975['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xa4a5('0x57')][_0xa4a5('0x70')](_0x26b2f6)[_0xa4a5('0x27')](handleEntityNotFound(_0x278dd8,null))[_0xa4a5('0x27')](function(_0x35c09f){if(_0x35c09f){if(!_[_0xa4a5('0x92')](_0x35c09f[_0xa4a5('0x84')])){if(fs[_0xa4a5('0x8d')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x93'),_0x35c09f[_0xa4a5('0x84')]))){_0x3bd042=path['join'](config['root'],'server/files/images/avatars/',_0x35c09f[_0xa4a5('0x84')]);}}return _0x278dd8[_0xa4a5('0x94')](_0x3bd042);}})['catch'](handleError(_0x278dd8,null));};exports[_0xa4a5('0x95')]=function(_0xade522,_0x2c07a7){var _0x12080c=path['join'](config['root'],_0xa4a5('0x96'));var _0x2f9d68={'where':{'id':_0xade522['params']['id']},'attributes':['id',_0xa4a5('0x97'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xa4a5('0x70')](_0x2f9d68)[_0xa4a5('0x27')](handleEntityNotFound(_0x2c07a7,null))[_0xa4a5('0x27')](function(_0xa2ba5){if(_0xa2ba5){if(!_[_0xa4a5('0x92')](_0xa2ba5[_0xa4a5('0x97')])){if(fs['existsSync'](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x93'),_0xa2ba5[_0xa4a5('0x97')]))&&_0xa2ba5['showCustomerAvatar']){_0x12080c=path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],'server/files/images/avatars/',_0xa2ba5[_0xa4a5('0x97')]);}}return _0x2c07a7[_0xa4a5('0x94')](_0x12080c);}})[_0xa4a5('0x1c')](handleError(_0x2c07a7,null));};exports[_0xa4a5('0x98')]=function(_0x415331,_0x10a2fd){var _0x512272=path[_0xa4a5('0x88')](config['root'],_0xa4a5('0x99'));var _0xbe88d3={'where':{'id':_0x415331[_0xa4a5('0x6d')]['id']},'attributes':['id',_0xa4a5('0x86')],'raw':!![]};return db['ChatWebsite']['find'](_0xbe88d3)['then'](handleEntityNotFound(_0x10a2fd,null))[_0xa4a5('0x27')](function(_0x301217){if(_0x301217){if(!_[_0xa4a5('0x92')](_0x301217[_0xa4a5('0x86')])){if(fs[_0xa4a5('0x8d')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],'server/files/images/avatars/',_0x301217[_0xa4a5('0x86')]))){_0x512272=path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x93'),_0x301217[_0xa4a5('0x86')]);}}return _0x10a2fd['download'](_0x512272);}})['catch'](handleError(_0x10a2fd,null));};exports[_0xa4a5('0x9a')]=function(_0x5375e9,_0xec46fb){var _0x234cbe={'body':_0x5375e9['body'],'channel':_0xa4a5('0x9b')};var _0x3cc69b=[];var _0x3454a3=[];var _0x29de26={};var _0x32719f=![];return db[_0xa4a5('0x9c')][_0xa4a5('0x77')]()['then'](function(_0x2b4c32){if(!_0x2b4c32){throw new db['Sequelize'][(_0xa4a5('0x9d'))](_0xa4a5('0x9e'));}_0x3cc69b=_[_0xa4a5('0x9f')](_[_0xa4a5('0x5b')](_0x2b4c32),['createdAt',_0xa4a5('0xa0')]);_0x3454a3=_[_0xa4a5('0x9f')](_['keys'](_0x2b4c32),[_0xa4a5('0xa1'),'updatedAt',_0xa4a5('0xa2'),_0xa4a5('0xa3')]);if(_0x5375e9[_0xa4a5('0x72')]['id']){delete _0x5375e9[_0xa4a5('0x72')]['id'];}if(_[_0xa4a5('0x92')](_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xa4')])){throw new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0x72')])||_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0x72')]===''){throw new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xa6'));}if(_['isNil'](_0x5375e9['body']['mapKey'])){throw new db['Sequelize'][(_0xa4a5('0x9d'))](_0xa4a5('0xa7')+_0x3454a3);}if(!_[_0xa4a5('0xa8')](_0x3454a3,_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xa9')])){throw new db['Sequelize']['ValidationError'](_0xa4a5('0xaa')+_0x3454a3);}_0x29de26[_0x5375e9['body'][_0xa4a5('0xa9')]]=_0x5375e9[_0xa4a5('0x72')]['from'];})['then'](function(){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x5375e9[_0xa4a5('0x6d')]['id']},'include':[{'model':db['CmList'],'as':_0xa4a5('0xab'),'include':[{'model':db[_0xa4a5('0x9c')],'as':'Contacts','where':_0x29de26,'limit':0x1,'order':[['updatedAt',_0xa4a5('0xac')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0x3d'),'include':[{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0xad'),'attributes':['id',_0xa4a5('0x33')],'raw':!![]}]}]});})[_0xa4a5('0x27')](function(_0x40b617){if(!_0x40b617)throw new APINotFoundError(util[_0xa4a5('0x4a')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x5375e9['params']['id']));if(!_0x40b617[_0xa4a5('0x3d')]||!_0x40b617[_0xa4a5('0x3d')]['Intervals'])return[_0x40b617,!![]];return[_0x40b617,checkWebsiteIntervals(_0x40b617)];})[_0xa4a5('0xae')](function(_0x5148c7,_0xd42e9a){if(!_0xd42e9a)throw new APIOutOfIntervalError();if(!_0x5148c7[_0xa4a5('0xab')])return;_0x234cbe['account']=_0x5148c7;_0x234cbe[_0xa4a5('0xaf')]=_0x5148c7[_0xa4a5('0xab')];_0x234cbe[_0xa4a5('0xb0')]=_[_0xa4a5('0xb1')](_0x5148c7[_0xa4a5('0xb2')],[_0xa4a5('0xb3')],[_0xa4a5('0xb4')]);if(_0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xb2')]){delete _0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xb2')];}if(_0x234cbe['account'][_0xa4a5('0xab')]&&_0x234cbe[_0xa4a5('0xb5')]['List'][_0xa4a5('0xb6')][_0xa4a5('0x61')]){return _0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xab')][_0xa4a5('0xb6')][0x0];}var _0x57122c=_[_0xa4a5('0x11')](_0x5375e9[_0xa4a5('0x72')],{'firstName':_0x5375e9[_0xa4a5('0x72')]['from'],'ListId':_0x5148c7[_0xa4a5('0xa3')]});_0x57122c[_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xa9')]]=_0x5375e9[_0xa4a5('0x72')]['from'];return db[_0xa4a5('0x9c')][_0xa4a5('0x71')](_0x57122c,{'fields':_0x3cc69b,'raw':!![]});})[_0xa4a5('0x27')](function(_0x3b93a0){_0x234cbe[_0xa4a5('0xb7')]=_0x3b93a0;var _0x331722=createInteractionObject(_0x5375e9[_0xa4a5('0x6d')]['id'],_0x5375e9[_0xa4a5('0x72')],_0x5375e9[_0xa4a5('0xb8')],_0x3b93a0);var _0x16e72d={'ChatWebsiteId':_0x5375e9[_0xa4a5('0x6d')]['id'],'closed':![]};if(_0x5375e9[_0xa4a5('0x72')]['threadId']){_0x16e72d[_0xa4a5('0xb9')]=_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xb9')];return db['ChatInteraction'][_0xa4a5('0x70')]({'where':_0x16e72d})[_0xa4a5('0x27')](function(_0x5065b7){if(_0x5065b7){_0x32719f=!![];return _0x5065b7;}_0x331722[_0xa4a5('0xb9')]=_0x5375e9[_0xa4a5('0x72')]['threadId'];_0x331722['externalUrl']=_0x5375e9[_0xa4a5('0x72')]['externalUrl'];return db[_0xa4a5('0xba')][_0xa4a5('0x71')](_0x331722);});}_0x16e72d[_0xa4a5('0xbb')]=_0x3b93a0['id'];if(_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbc')]&&_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbc')]['id']){_0x16e72d['id']=_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbc')]['id'];return db['ChatInteraction'][_0xa4a5('0x70')]({'where':_0x16e72d})[_0xa4a5('0x27')](function(_0x336530){if(_0x336530){_0x32719f=!![];return _0x336530;}return db[_0xa4a5('0xba')][_0xa4a5('0x71')](_0x331722);});}return db[_0xa4a5('0xba')][_0xa4a5('0x71')](_0x331722);})[_0xa4a5('0x27')](function(_0x1d2da0){if(!_0x32719f)return _0x1d2da0;var _0x4de047={'from':(_0x234cbe[_0xa4a5('0xb7')][_0xa4a5('0x45')]||'')+'\x20'+(_0x234cbe[_0xa4a5('0xb7')][_0xa4a5('0x46')]||'')};if(_0x5375e9[_0xa4a5('0x72')]['threadId']&&_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbd')]&&_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xb9')]!=_0x5375e9[_0xa4a5('0x72')]['messageId']){_0x4de047[_0xa4a5('0xb9')]=_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbd')];}return _0x1d2da0['update'](_0x4de047);})[_0xa4a5('0x27')](function(_0x1e3de2){_0x234cbe[_0xa4a5('0xbc')]=_0x1e3de2[_0xa4a5('0x29')]({'plain':!![]});_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xbe')]=!_0x32719f;if(_0x234cbe['interaction'][_0xa4a5('0xbe')]){if(_0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xbf')]){_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0xc0')]({'id':0x0,'priority':_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0x61')]+0x1,'app':_0xa4a5('0xc1'),'appdata':_0xa4a5('0xc2'),'interval':_0xa4a5('0xc3')});}}return db[_0xa4a5('0xc4')][_0xa4a5('0x71')]({'body':_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0x72')],'ChatWebsiteId':_0x5375e9[_0xa4a5('0x6d')]['id'],'ChatInteractionId':_0x1e3de2['id'],'direction':'in','ContactId':_0x234cbe[_0xa4a5('0xb7')]['id'],'AttachmentId':_0x5375e9['body']['AttachmentId']});})[_0xa4a5('0x27')](function(_0xcc5246){_0x234cbe[_0xa4a5('0x1a')]=_0xcc5246;if(!_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xc5')]){return;}return db[_0xa4a5('0xc6')][_0xa4a5('0x70')]({'attributes':['id',_0xa4a5('0x2d')],'where':{'id':_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xc5')]}});})[_0xa4a5('0x27')](function(_0x1636bf){if(_0x1636bf){_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1636bf['name']+','+(_0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xc8')]||0xa),'interval':_0xa4a5('0xc3')});_0x234cbe[_0xa4a5('0xc9')]=!![];}if(!_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xca')]){return;}return db[_0xa4a5('0xcb')]['find']({'attributes':['id',_0xa4a5('0x2d')],'where':{'id':_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xca')]}});})[_0xa4a5('0x27')](function(_0xdd7647){if(_0xdd7647){_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0xc7')]({'id':0x0,'priority':0x1,'app':_0xa4a5('0xcc'),'appdata':_0xdd7647[_0xa4a5('0x2d')]+','+(_0x234cbe['account'][_0xa4a5('0xcd')]||0x12c),'interval':_0xa4a5('0xc3')});}return respondWithRpcPromise(_0xa4a5('0xce'),'startRouting',_0x234cbe);})[_0xa4a5('0x27')](function(_0x2a4d31){respondWithRpcPromise(_0xa4a5('0xcf'),_0xa4a5('0xcf'),{'event':'notify','message':_0x2a4d31},client9002);return _0x2a4d31;})[_0xa4a5('0x27')](respondWithResult(_0xec46fb,null))['catch'](APIHandleError(_0xec46fb));};exports['offline']=function(_0x2f5f16,_0x44450c){var _0x1c6969,_0x527b8d,_0x180ff4;var _0x1e0b61=[];var _0x38ab89={};var _0x290370=_0x2f5f16[_0xa4a5('0xd0')]||[];var _0x55551b=[];var _0xb32507;return db[_0xa4a5('0x9c')]['describe']()[_0xa4a5('0x27')](function(_0x682607){if(!_0x682607){throw new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))]('no\x20available\x20attributes');}_0x1e0b61=_[_0xa4a5('0x9f')](_[_0xa4a5('0x5b')](_0x682607),[_0xa4a5('0xa1'),'updatedAt',_0xa4a5('0xa2'),_0xa4a5('0xa3')]);if(_0x2f5f16[_0xa4a5('0x72')]['id']){delete _0x2f5f16['body']['id'];}if(_[_0xa4a5('0x92')](_0x2f5f16[_0xa4a5('0x72')]['from'])){throw _0x44450c[_0xa4a5('0x1e')](0x1f4)['send'](new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xd1')));}if(_[_0xa4a5('0x92')](_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0x72')])||_0x2f5f16['body'][_0xa4a5('0x72')]===''){throw _0x44450c['status'](0x1f4)[_0xa4a5('0x2e')](new db[(_0xa4a5('0xa5'))]['ValidationError'](_0xa4a5('0xa6')));}if(_[_0xa4a5('0x92')](_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')])){throw _0x44450c[_0xa4a5('0x1e')](0x1f4)[_0xa4a5('0x2e')](new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xd3')+_0x1e0b61));}if(!_[_0xa4a5('0xa8')](_0x1e0b61,_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')])){throw _0x44450c['status'](0x1f4)[_0xa4a5('0x2e')](new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xd4')+_0x1e0b61));}_0x38ab89[_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')]]=_0x2f5f16[_0xa4a5('0x72')]['from'];})[_0xa4a5('0x27')](function(){return db[_0xa4a5('0x57')]['find']({'where':{'id':_0x2f5f16['params']['id']},'include':[{'model':db[_0xa4a5('0xd5')],'as':'List'},{'model':db[_0xa4a5('0xd6')],'as':_0xa4a5('0xd6')}]});})[_0xa4a5('0x27')](handleEntityNotFound(_0x44450c,null))['then'](function(_0x6cc227){if(_0x6cc227&&_0x6cc227[_0xa4a5('0xab')]){_0x527b8d=_0x6cc227;var _0x1894b1=_['defaults'](_0x2f5f16[_0xa4a5('0x72')],{'firstName':_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xa4')],'phone':_0x2f5f16['body'][_0xa4a5('0xa4')],'ListId':_0x6cc227[_0xa4a5('0xa3')]});_0x1894b1[_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')]]=_0x2f5f16['body']['from'];return db[_0xa4a5('0x9c')][_0xa4a5('0xd7')]({'where':_0x38ab89,'defaults':_0x1894b1});}})['spread'](function(_0x5ba75b){if(_0x5ba75b){_0x180ff4=_0x5ba75b;var _0x150fb0=fs[_0xa4a5('0xd8')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0xd9')),_0xa4a5('0xda'));var _0x1fcc8b=ejs[_0xa4a5('0xdb')](_0x150fb0,{'body':_[_0xa4a5('0xdc')](_0x2f5f16['body']['body']),'bodyTitle':_0x527b8d['offlineMessageBody']});return db[_0xa4a5('0xdd')]['create']({'body':_0x1fcc8b,'plainBody':htmlToText[_0xa4a5('0xde')](_0x1fcc8b),'ContactId':_0x5ba75b['id'],'ChatWebsiteId':_0x527b8d['id']});}})[_0xa4a5('0x27')](function(_0x484f61){_0xb32507=_0x484f61;if(_0x290370[_0xa4a5('0x61')]){var _0x16c485=_0x290370[_0xa4a5('0x3c')](function(_0x448182){return{'name':_0x448182[_0xa4a5('0xdf')],'basename':_0x448182[_0xa4a5('0x82')],'type':_0x448182[_0xa4a5('0xe0')],'ChatOfflineMessageId':_0x484f61['id']};});_0x55551b=_0x16c485['map'](_0x4581c0=>{var _0x5e550a={'filename':_0x4581c0[_0xa4a5('0x2d')],'path':path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0xe1'),_0xa4a5('0xd0'),_0xa4a5('0xe2'),'offline-chat',_0x4581c0['basename'])};return _0x5e550a;});if(!_0x527b8d[_0xa4a5('0xe3')]){return db['sequelize'][_0xa4a5('0xe4')](function(_0x142cfd){return db[_0xa4a5('0xe5')]['bulkCreate'](_0x16c485,{'transaction':_0x142cfd});});}}})['then'](function(){if(_0xb32507){_0x1c6969=_0xb32507;return db[_0xa4a5('0xd6')][_0xa4a5('0xe6')]({'where':{'service':!![]},'include':[{'model':db[_0xa4a5('0xe7')],'as':_0xa4a5('0xe8'),'raw':!![],'include':[{'model':db[_0xa4a5('0xe9')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xa4a5('0x27')](function(_0x1c67d8){if(_0x1c67d8&&_0x1c67d8[_0xa4a5('0xe8')]&&_0x527b8d[_0xa4a5('0xea')]&&_0x527b8d[_0xa4a5('0xeb')]){var _0x3bc88e=_0x1c67d8[_0xa4a5('0xec')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3bc88e,'message':{'from':util[_0xa4a5('0x4a')]('\x22%s\x22\x20<%s>',_0x1c67d8[_0xa4a5('0x2d')],_0x1c67d8[_0xa4a5('0xed')]||_0x1c67d8[_0xa4a5('0xe8')][_0xa4a5('0x73')]),'to':_0x527b8d[_0xa4a5('0xeb')],'subject':_0x527b8d[_0xa4a5('0xee')],'html':_0x1c6969['body'],'attachments':_0x55551b}},client9003)[_0xa4a5('0x27')](function(){return _0x1c6969;})[_0xa4a5('0x1c')](function(_0x56d0bd){logger[_0xa4a5('0x19')](_0x56d0bd);});}})[_0xa4a5('0x27')](function(){if(_0x527b8d&&_0x527b8d[_0xa4a5('0xe3')]&&_0x527b8d[_0xa4a5('0xef')]){var _0x2858c8=[];if(_0x290370['length']){_0x2858c8=_0x290370['map'](function(_0x4b06fc){return{'name':_0x4b06fc[_0xa4a5('0xdf')],'basename':_0x4b06fc[_0xa4a5('0x82')],'type':_0x4b06fc[_0xa4a5('0xe0')],'ChatOfflineMessageId':_0xb32507['id']};});}var _0x121e25;if(!_[_0xa4a5('0x92')](_0x527b8d[_0xa4a5('0xf0')])){var _0x53de59=_[_0xa4a5('0x3c')](_0x2f5f16[_0xa4a5('0x72')],function(_0x455aec){return _0x455aec;});var _0xbfc3e3=_[_0xa4a5('0xf1')](_0x53de59)[0x0];var _0x57361d=_[_0xa4a5('0xf2')](_0xbfc3e3,function(_0x50331e){return _0x50331e;});_0x121e25=_0x57361d[0x1][_0x527b8d[_0xa4a5('0xf0')]];}var _0x25d2ed={'from':_0x180ff4[_0xa4a5('0xed')],'firstName':_0x180ff4[_0xa4a5('0x45')],'lastName':_0x180ff4[_0xa4a5('0x46')],'mapKey':_0xa4a5('0xed'),'message':{'from':_0x180ff4[_0xa4a5('0xed')],'to':_0x527b8d[_0xa4a5('0xd6')]['email'],'cc':'','subject':_[_0xa4a5('0x92')](_0x121e25)?_0x527b8d[_0xa4a5('0xee')]:_0x121e25,'messageId':'','sentAt':new Date(),'attach':_0x2858c8[_0xa4a5('0x61')],'attachments':_0x2858c8,'originChannel':_0xa4a5('0xf3'),'ChatWebsiteId':_0x527b8d['id'],'ChatOfflineMessageId':_0x1c6969['id'],'originTo':_0x527b8d[_0xa4a5('0xd6')][_0xa4a5('0xed')]},'body':_0x1c6969[_0xa4a5('0x72')]};var _0x3225a6={'account':{'id':_0x527b8d[_0xa4a5('0xef')]},'body':_0x25d2ed,'log':_0xa4a5('0xf4')};return respondWithRpcPromise(_0xa4a5('0xf4'),_0xa4a5('0xf5'),_0x3225a6,client9001)[_0xa4a5('0x27')](function(){return _0x1c6969;})[_0xa4a5('0x1c')](function(_0x29740c){logger[_0xa4a5('0x19')](_0x29740c);});}return;})['then'](function(){if(_0x1c6969){return _0x1c6969;}})['then'](respondWithResult(_0x44450c,null))[_0xa4a5('0x1c')](function(){for(var _0xbee19e of _0x290370){var _0x1be088=path['join'](config[_0xa4a5('0x8e')],_0xa4a5('0xe1'),_0xa4a5('0xd0'),'attachments',_0xa4a5('0xf6'),_0xbee19e[_0xa4a5('0x82')]);fs_extra[_0xa4a5('0xf7')](_0x1be088)[_0xa4a5('0x1c')](function(_0x215afc){logger[_0xa4a5('0x19')](_0xa4a5('0xf8'),_0x1be088,_0x215afc);});}});};exports[_0xa4a5('0xf9')]=function(_0x502541,_0x4d4c37){return db[_0xa4a5('0xba')][_0xa4a5('0x70')]({'where':{'id':_0x502541[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x4d4c37,null))[_0xa4a5('0x27')](function(_0x3996c4){if(_0x3996c4){return _0x3996c4[_0xa4a5('0xf9')](_0x502541[_0xa4a5('0x72')][_0xa4a5('0x7d')],_[_0xa4a5('0xfa')](_0x502541[_0xa4a5('0x72')],[_0xa4a5('0x7d'),'id'])||{});}})[_0xa4a5('0x27')](respondWithResult(_0x4d4c37,null))[_0xa4a5('0x1c')](handleError(_0x4d4c37,null));};exports[_0xa4a5('0xfb')]=function(_0x17ed3e,_0x6cbe37){var _0x4e2098={'raw':![],'where':{}};var _0x4bd425={};var _0x1da67b={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x17ed3e[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x6cbe37,null))[_0xa4a5('0x27')](function(_0x4aa109){if(_0x4aa109){_0x4bd425[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db[_0xa4a5('0xba')][_0xa4a5('0x58')]);_0x4bd425[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x17ed3e['query']);_0x4bd425[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x4bd425[_0xa4a5('0x4f')],_0x4bd425['query']);_0x4e2098[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x4bd425[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x4e2098[_0xa4a5('0x5e')]=_0x4e2098['attributes'][_0xa4a5('0x61')]?_0x4e2098['attributes']:_0x4bd425['model'];if(!_0x17ed3e['query'][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x4e2098[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x4e2098[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x20')]);}_0x4e2098[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x17ed3e[_0xa4a5('0x60')]['sort']);_0x4e2098[_0xa4a5('0x65')]=qs[_0xa4a5('0x5c')](_['pick'](_0x17ed3e[_0xa4a5('0x60')],_0x4bd425[_0xa4a5('0x5c')]));_0x4e2098[_0xa4a5('0x65')][_0xa4a5('0x78')]=_0x4aa109['id'];if(_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x4e2098[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x4e2098[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x4e2098['attributes'],function(_0x1d01be){var _0x59178f={};_0x59178f[_0x1d01be]={'$like':'%'+_0x17ed3e['query']['filter']+'%'};return _0x59178f;})});}_0x4e2098=_[_0xa4a5('0x68')]({},_0x4e2098,_0x17ed3e[_0xa4a5('0x6a')]);return db[_0xa4a5('0xba')][_0xa4a5('0x23')]({'where':_0x4e2098[_0xa4a5('0x65')]})[_0xa4a5('0x27')](function(_0x1ecc43){_0x1da67b[_0xa4a5('0x23')]=_0x1ecc43;if(_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x6e')]){_0x4e2098['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa4a5('0xc6')],'as':_0xa4a5('0xfc'),'attributes':[_0xa4a5('0x2d'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xa4a5('0xfd'),'attributes':['id',_0xa4a5('0x2d'),_0xa4a5('0xfe')],'where':_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0xff')]?{'id':_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0xff')]}:undefined,'required':_0x17ed3e[_0xa4a5('0x60')]['tag']?!![]:![]}];}return db[_0xa4a5('0xba')]['findAll'](_0x4e2098);})[_0xa4a5('0x27')](function(_0x1cb9eb){_0x1da67b[_0xa4a5('0x6c')]=_0x1cb9eb;return _0x1da67b;});}})[_0xa4a5('0x27')](respondWithFilteredResult(_0x6cbe37,_0x4e2098))[_0xa4a5('0x1c')](handleError(_0x6cbe37,null));};exports[_0xa4a5('0x30')]=function(_0xa97daf,_0x4f9ccc){var _0x23393a=0x0;var _0x1755a5=0x0;var _0x58cd81=![];var _0x49226b;var _0x2691c6;return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0xa97daf[_0xa4a5('0x6d')]['id']},'include':[{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0x3d'),'include':[{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0xad'),'attributes':['id',_0xa4a5('0x33')]}]}]})[_0xa4a5('0x27')](handleEntityNotFound(_0x4f9ccc,null))[_0xa4a5('0x27')](function(_0x49e451){if(_0x49e451){_0x49226b=_0x49e451;return _0x49e451[_0xa4a5('0x100')]({'raw':!![]});}})[_0xa4a5('0x27')](function(_0x822841){if(_0x49226b){if(_0x822841){_0x2691c6=_0x822841;}}return require('../../config/license/util')[_0xa4a5('0x8b')]();})['then'](function(_0x50d3f3){if(_0x50d3f3){_0x1755a5=_0x50d3f3[_0xa4a5('0x101')];_0x58cd81=_0x50d3f3[_0xa4a5('0x8c')];}})[_0xa4a5('0x27')](function(){return db['ChatInteraction'][_0xa4a5('0x23')]({'where':{'closed':![]}});})[_0xa4a5('0x27')](function(_0x582071){_0x23393a=_0x582071;if(_0x1755a5&&_0x582071>_0x1755a5){return db[_0xa4a5('0x102')]['findOne']({'where':{'id':0x1}})[_0xa4a5('0x27')](function(_0x1cc639){if(_0x1cc639){_0x1cc639['increment']('chatLicenseExceeded');}});}})[_0xa4a5('0x27')](function(){if(!_0x49226b['Interval']||!_0x49226b[_0xa4a5('0x3d')][_0xa4a5('0xad')])return!![];return checkWebsiteIntervals(_0x49226b);})['then'](function(_0x185f9a){var _0x3e2f94=fs['readFileSync'](path[_0xa4a5('0x88')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0xe8e81e=new url[(_0xa4a5('0x103'))](_0x49226b[_0xa4a5('0x104')])[_0xa4a5('0x105')];var _0x5e191a=_0xa4a5('0x106');var _0x202cf7=![];var _0x13bd94={'chatVersion':_0x5e191a,'chatWebsiteAddressOrigin':_0xe8e81e,'remote':_0x49226b[_0xa4a5('0x107')],'query':querystring['stringify'](_[_0xa4a5('0x68')](_0x49226b[_0xa4a5('0x29')]({'plain':!![]}),{'customerIp':_0xa97daf[_0xa4a5('0xb8')][_0xa4a5('0x43')]||_0xa97daf[_0xa4a5('0xb8')][_0xa4a5('0x108')]||_0xa97daf[_0xa4a5('0x109')][_0xa4a5('0x10a')]||_0xa97daf['ip'],'referer':_0xa97daf[_0xa4a5('0xb8')][_0xa4a5('0x48')],'openedInteractions':_0x23393a,'maxInteractions':_0x1755a5,'virtual':_0x58cd81[_0xa4a5('0x101')],'online':_0x185f9a,'custom':_0x58cd81}))[_0xa4a5('0x10b')](/'/g,'\x5c\x27')};_0x4f9ccc[_0xa4a5('0x2e')](ejs[_0xa4a5('0xdb')](Mustache[_0xa4a5('0xdb')](_0x3e2f94,_0x13bd94),{'proactiveActions':_0x2691c6,'alignment':_0x49226b['alignment'],'verticalAlignment':_0x49226b['verticalAlignment'],'div_color':_0x49226b[_0xa4a5('0xfe')],'labelText':_0x49226b[_0xa4a5('0x10c')],'text_color':_0x49226b[_0xa4a5('0x10d')],'text_button_color':_0x49226b[_0xa4a5('0x10e')],'button_color':_0x49226b[_0xa4a5('0x10f')],'background_color':_0x49226b[_0xa4a5('0x110')],'hideWhenOffline':_0x49226b[_0xa4a5('0x111')],'intervalId':_0x49226b[_0xa4a5('0x112')],'isDevelopment':_0x202cf7,'chatVersion':_0x5e191a}));})[_0xa4a5('0x1c')](handleError(_0x4f9ccc,null));};exports[_0xa4a5('0x113')]=function(_0x12e97e,_0xe1ded6){var _0x16c733=_0x12e97e[_0xa4a5('0x6d')]['id'];var _0x2e379d=_0x12e97e[_0xa4a5('0x72')];var _0x2777a3=0xc8;var _0x5a2c6e=null;return db[_0xa4a5('0x114')][_0xa4a5('0xe4')]({'isolationLevel':db['sequelize'][_0xa4a5('0x115')][_0xa4a5('0x116')]['READ_COMMITTED']},function(_0xf25743){return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x16c733},'transaction':_0xf25743})[_0xa4a5('0x27')](function(_0xfcfbb7){if(_0xfcfbb7){return db[_0xa4a5('0x117')][_0xa4a5('0x28')]({'where':{'ChatWebsiteId':_0x16c733},'transaction':_0xf25743})[_0xa4a5('0x27')](function(){var _0x2fc572=_[_0xa4a5('0x3c')](_0x2e379d,function(_0x3c8297){_0x3c8297[_0xa4a5('0x78')]=_0x16c733;return _0x3c8297;});return db[_0xa4a5('0x117')][_0xa4a5('0x118')](_0x2fc572,{'transaction':_0xf25743});});}else{_0x2777a3=0x194;_0x5a2c6e=[];}});})['then'](function(){if(_0x2777a3!==0x194){return db[_0xa4a5('0x117')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x16c733},'order':_0xa4a5('0xb3')})[_0xa4a5('0x27')](function(_0x525a30){_0x5a2c6e=_0x525a30;});}})[_0xa4a5('0x1c')](function(_0x3d7782){_0x2777a3=0x1f4;logger[_0xa4a5('0x19')](_0x3d7782[_0xa4a5('0x2c')]);if(_0x3d7782[_0xa4a5('0x2d')]){delete _0x3d7782[_0xa4a5('0x2d')];}_0x5a2c6e=_0x3d7782;})[_0xa4a5('0x119')](function(){if(_0x5a2c6e===null){_0xe1ded6[_0xa4a5('0x1d')](_0x2777a3);}else{if(_0x2777a3===0x1f4){_0xe1ded6[_0xa4a5('0x1e')](_0x2777a3)[_0xa4a5('0x2e')](_0x5a2c6e);}else{_0xe1ded6['status'](_0x2777a3)[_0xa4a5('0x25')](_0x5a2c6e);}}});};exports['getApplications']=function(_0x474f34,_0x19c315){var _0x5c8508={};var _0x4c71f4={};var _0x1dbb32;var _0x3568b8;return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x474f34[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x19c315,null))['then'](function(_0x29b71d){if(_0x29b71d){_0x1dbb32=_0x29b71d;_0x4c71f4[_0xa4a5('0x4f')]=_['keys'](db[_0xa4a5('0x117')][_0xa4a5('0x58')]);_0x4c71f4[_0xa4a5('0x60')]=_['keys'](_0x474f34[_0xa4a5('0x60')]);_0x4c71f4[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x4c71f4[_0xa4a5('0x4f')],_0x4c71f4[_0xa4a5('0x60')]);_0x5c8508[_0xa4a5('0x5e')]=_['intersection'](_0x4c71f4['model'],qs[_0xa4a5('0x5f')](_0x474f34[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x5c8508[_0xa4a5('0x5e')]=_0x5c8508[_0xa4a5('0x5e')][_0xa4a5('0x61')]?_0x5c8508[_0xa4a5('0x5e')]:_0x4c71f4['model'];_0x5c8508[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x474f34[_0xa4a5('0x60')]['sort']);_0x5c8508[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x474f34[_0xa4a5('0x60')],_0x4c71f4[_0xa4a5('0x5c')]));if(_0x474f34['query'][_0xa4a5('0x67')]){_0x5c8508[_0xa4a5('0x65')]=_['merge'](_0x5c8508[_0xa4a5('0x65')],{'$or':_['map'](_0x5c8508['attributes'],function(_0xb44f0a){var _0x4fbeb2={};_0x4fbeb2[_0xb44f0a]={'$like':'%'+_0x474f34['query'][_0xa4a5('0x67')]+'%'};return _0x4fbeb2;})});}_0x5c8508=_[_0xa4a5('0x68')]({},_0x5c8508,_0x474f34[_0xa4a5('0x6a')]);return _0x1dbb32[_0xa4a5('0x11a')](_0x5c8508);}})[_0xa4a5('0x27')](function(_0x1e558f){if(_0x1e558f){_0x3568b8=_0x1e558f['length'];if(!_0x474f34[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x5c8508[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x474f34[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x5c8508[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0x474f34[_0xa4a5('0x60')]['offset']);}return _0x1dbb32['getApplications'](_0x5c8508);}})[_0xa4a5('0x27')](function(_0x21905e){if(_0x21905e){return _0x21905e?{'count':_0x3568b8,'rows':_0x21905e}:null;}})['then'](respondWithResult(_0x19c315,null))[_0xa4a5('0x1c')](handleError(_0x19c315,null));};exports[_0xa4a5('0x11b')]=function(_0x35f250,_0x3e9f5a){return db[_0xa4a5('0x11c')][_0xa4a5('0x70')]({'where':{'id':_0x35f250[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3e9f5a,null))[_0xa4a5('0x27')](function(_0x130480){if(_0x130480){return _0x130480[_0xa4a5('0x11b')](_0x35f250[_0xa4a5('0x72')][_0xa4a5('0x7d')],_[_0xa4a5('0xfa')](_0x35f250['body'],[_0xa4a5('0x7d'),'id'])||{});}})['then'](respondWithResult(_0x3e9f5a,null))[_0xa4a5('0x1c')](handleError(_0x3e9f5a,null));};exports[_0xa4a5('0x100')]=function(_0xd77566,_0x3afac4){var _0x5eaa2b={};var _0x29a039={};var _0x321ade;var _0x119e28;return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0xd77566[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3afac4,null))[_0xa4a5('0x27')](function(_0xd76c83){if(_0xd76c83){_0x321ade=_0xd76c83;_0x29a039['model']=_[_0xa4a5('0x5b')](db['ChatProactiveAction']['rawAttributes']);_0x29a039[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0xd77566[_0xa4a5('0x60')]);_0x29a039[_0xa4a5('0x5c')]=_['intersection'](_0x29a039[_0xa4a5('0x4f')],_0x29a039['query']);_0x5eaa2b[_0xa4a5('0x5e')]=_['intersection'](_0x29a039[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x5eaa2b[_0xa4a5('0x5e')]=_0x5eaa2b[_0xa4a5('0x5e')][_0xa4a5('0x61')]?_0x5eaa2b['attributes']:_0x29a039[_0xa4a5('0x4f')];_0x5eaa2b[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x5eaa2b[_0xa4a5('0x65')]=qs['filters'](_['pick'](_0xd77566['query'],_0x29a039[_0xa4a5('0x5c')]));if(_0xd77566['query'][_0xa4a5('0x67')]){_0x5eaa2b[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x5eaa2b[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x5eaa2b[_0xa4a5('0x5e')],function(_0x1ac9d5){var _0x3e80f8={};_0x3e80f8[_0x1ac9d5]={'$like':'%'+_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x3e80f8;})});}_0x5eaa2b=_[_0xa4a5('0x68')]({},_0x5eaa2b,_0xd77566[_0xa4a5('0x6a')]);return _0x321ade['getProactiveActions'](_0x5eaa2b);}})[_0xa4a5('0x27')](function(_0x480cd4){if(_0x480cd4){_0x119e28=_0x480cd4[_0xa4a5('0x61')];if(!_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x5eaa2b['limit']=qs[_0xa4a5('0x22')](_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x5eaa2b[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0xd77566['query'][_0xa4a5('0x20')]);}return _0x321ade[_0xa4a5('0x100')](_0x5eaa2b);}})['then'](function(_0x2db12a){if(_0x2db12a){return _0x2db12a?{'count':_0x119e28,'rows':_0x2db12a}:null;}})[_0xa4a5('0x27')](respondWithResult(_0x3afac4,null))[_0xa4a5('0x1c')](handleError(_0x3afac4,null));};exports['getFields']=function(_0x3340b7,_0x4e041c){var _0x3d7d51=_0x3340b7[_0xa4a5('0x60')][_0xa4a5('0x11d')]===_0xa4a5('0x11e')?'offlineForm':'onlineForm';return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'attributes':['id',_0x3d7d51],'where':{'id':_0x3340b7[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x4e041c,null))[_0xa4a5('0x27')](function(_0x21608d){if(_0x21608d){var _0x228236=_0x21608d[_0x3d7d51];var _0x15229b=_0x228236&&_0x228236[_0xa4a5('0x11f')]?_0x228236[_0xa4a5('0x11f')]:[];_0x4e041c[_0xa4a5('0x2e')]({'fromKey':_[_0xa4a5('0x92')](_0x228236[_0xa4a5('0x120')])?undefined:_0x228236[_0xa4a5('0x120')],'count':_0x15229b[_0xa4a5('0x61')],'rows':_0x15229b});}})[_0xa4a5('0x1c')](handleError(_0x4e041c,null));};exports[_0xa4a5('0x121')]=function(_0x18e10f,_0xdf727d){var _0x477724={'raw':![],'where':{}};var _0x2f557f={};var _0x589a76={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x18e10f[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0xdf727d,null))['then'](function(_0x1ce8d1){if(_0x1ce8d1){_0x2f557f[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['ChatOfflineMessage'][_0xa4a5('0x58')]);_0x2f557f[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x18e10f[_0xa4a5('0x60')]);_0x2f557f['filters']=_['intersection'](_0x2f557f[_0xa4a5('0x4f')],_0x2f557f[_0xa4a5('0x60')]);_0x477724['attributes']=_[_0xa4a5('0x5d')](_0x2f557f[_0xa4a5('0x4f')],qs['fields'](_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x477724['attributes']=_0x477724['attributes'][_0xa4a5('0x61')]?_0x477724[_0xa4a5('0x5e')]:_0x2f557f[_0xa4a5('0x4f')];if(!_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x477724[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x18e10f[_0xa4a5('0x60')]['limit']);_0x477724[_0xa4a5('0x20')]=qs['offset'](_0x18e10f[_0xa4a5('0x60')]['offset']);}_0x477724[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x477724[_0xa4a5('0x65')]=qs[_0xa4a5('0x5c')](_['pick'](_0x18e10f[_0xa4a5('0x60')],_0x2f557f[_0xa4a5('0x5c')]));_0x477724['where'][_0xa4a5('0x78')]=_0x1ce8d1['id'];if(_0x18e10f[_0xa4a5('0x60')]['filter']){_0x477724[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x477724[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x477724['attributes'],function(_0x509bad){var _0x144a58={};_0x144a58[_0x509bad]={'$like':'%'+_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x144a58;})});}_0x477724=_[_0xa4a5('0x68')]({},_0x477724,_0x18e10f[_0xa4a5('0x6a')]);return db[_0xa4a5('0xdd')][_0xa4a5('0x23')]({'where':_0x477724[_0xa4a5('0x65')]})['then'](function(_0x2fe416){_0x589a76[_0xa4a5('0x23')]=_0x2fe416;if(_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x6e')]){_0x477724[_0xa4a5('0x6f')]=[{'all':!![]}];}else{_0x477724[_0xa4a5('0x6f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa4a5('0xe5')],'as':_0xa4a5('0x122'),'required':![]}];}return db[_0xa4a5('0xdd')][_0xa4a5('0x6b')](_0x477724);})[_0xa4a5('0x27')](function(_0x3eaa09){_0x589a76[_0xa4a5('0x6c')]=_0x3eaa09;return _0x589a76;});}})[_0xa4a5('0x27')](respondWithFilteredResult(_0xdf727d,_0x477724))[_0xa4a5('0x1c')](handleError(_0xdf727d,null));};exports[_0xa4a5('0x123')]=function(_0x476d53,_0x30e324){return db[_0xa4a5('0x57')]['find']({'where':{'id':_0x476d53['params']['id']}})['then'](handleEntityNotFound(_0x30e324,null))[_0xa4a5('0x27')](function(_0x4ddb3c){if(_0x4ddb3c){return _0x4ddb3c[_0xa4a5('0x123')](_0x476d53[_0xa4a5('0x72')][_0xa4a5('0x7d')],_[_0xa4a5('0xfa')](_0x476d53['body'],[_0xa4a5('0x7d'),'id'])||{})[_0xa4a5('0xae')](function(_0x14614a){for(var _0x492b7a=0x0;_0x492b7a<_0x476d53['body'][_0xa4a5('0x7d')][_0xa4a5('0x61')];_0x492b7a+=0x1){socket[_0xa4a5('0x124')]('userChatWebsite:save',{'UserId':Number(_0x476d53['body'][_0xa4a5('0x7d')][_0x492b7a]),'ChatWebsiteId':Number(_0x476d53[_0xa4a5('0x6d')]['id'])});}return _0x14614a;});}})['then'](respondWithResult(_0x30e324,null))[_0xa4a5('0x1c')](handleError(_0x30e324,null));};exports[_0xa4a5('0x125')]=function(_0x1a9003,_0x40ab83){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x1a9003[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x40ab83,null))[_0xa4a5('0x27')](function(_0x42c5d0){if(_0x42c5d0){return _0x42c5d0[_0xa4a5('0x125')](_0x1a9003[_0xa4a5('0x60')][_0xa4a5('0x7d')])[_0xa4a5('0x27')](function(){if(_[_0xa4a5('0x126')](_0x1a9003[_0xa4a5('0x60')][_0xa4a5('0x7d')])){for(var _0x3838ed=0x0;_0x3838ed<_0x1a9003[_0xa4a5('0x60')][_0xa4a5('0x7d')][_0xa4a5('0x61')];_0x3838ed+=0x1){socket[_0xa4a5('0x124')](_0xa4a5('0x127'),{'UserId':Number(_0x1a9003['query'][_0xa4a5('0x7d')][_0x3838ed]),'ChatWebsiteId':Number(_0x1a9003[_0xa4a5('0x6d')]['id'])});}}else{socket[_0xa4a5('0x124')](_0xa4a5('0x127'),{'UserId':Number(_0x1a9003[_0xa4a5('0x60')]['ids']),'ChatWebsiteId':Number(_0x1a9003['params']['id'])});}});}})[_0xa4a5('0x27')](respondWithStatusCode(_0x40ab83,null))['catch'](handleError(_0x40ab83,null));};exports[_0xa4a5('0x128')]=function(_0x5ef8f9,_0x4a81ca){var _0x190208={};var _0x354782={};var _0x1a4d98;var _0x511794;return db['ChatWebsite'][_0xa4a5('0xe6')]({'where':{'id':_0x5ef8f9[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4a81ca,null))[_0xa4a5('0x27')](function(_0x20da55){if(_0x20da55){_0x1a4d98=_0x20da55;_0x354782[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['User'][_0xa4a5('0x58')]);_0x354782[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x5ef8f9['query']);_0x354782[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x354782['model'],_0x354782[_0xa4a5('0x60')]);_0x190208['attributes']=_[_0xa4a5('0x5d')](_0x354782[_0xa4a5('0x4f')],qs['fields'](_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x190208[_0xa4a5('0x5e')]=_0x190208[_0xa4a5('0x5e')]['length']?_0x190208['attributes']:_0x354782[_0xa4a5('0x4f')];_0x190208[_0xa4a5('0x63')]=qs['sort'](_0x5ef8f9[_0xa4a5('0x60')]['sort']);_0x190208['where']=qs['filters'](_[_0xa4a5('0x66')](_0x5ef8f9[_0xa4a5('0x60')],_0x354782[_0xa4a5('0x5c')]));if(_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x190208[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x190208[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x190208[_0xa4a5('0x5e')],function(_0x12ef64){var _0x306ed4={};_0x306ed4[_0x12ef64]={'$like':'%'+_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x306ed4;})});}_0x190208=_[_0xa4a5('0x68')]({},_0x190208,_0x5ef8f9[_0xa4a5('0x6a')]);return _0x1a4d98[_0xa4a5('0x128')](_0x190208);}})[_0xa4a5('0x27')](function(_0xcc9d){if(_0xcc9d){_0x511794=_0xcc9d[_0xa4a5('0x61')];if(!_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x190208[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x190208[_0xa4a5('0x20')]=qs['offset'](_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x20')]);}return _0x1a4d98[_0xa4a5('0x128')](_0x190208);}})['then'](function(_0x35ab93){if(_0x35ab93){return _0x35ab93?{'count':_0x511794,'rows':_0x35ab93}:null;}})[_0xa4a5('0x27')](respondWithResult(_0x4a81ca,null))['catch'](handleError(_0x4a81ca,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 040ca68..e59ad5d 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 _0xfaec=['remove','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite'];(function(_0x3a5ac9,_0xd6b08b){var _0x428e4a=function(_0x5f172d){while(--_0x5f172d){_0x3a5ac9['push'](_0x3a5ac9['shift']());}};_0x428e4a(++_0xd6b08b);}(_0xfaec,0x12f));var _0xcfae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfaec[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xcfae('0x0'));var ChatWebsite=require(_0xcfae('0x1'))['db'][_0xcfae('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcfae('0x3')};function emitEvent(_0x2c5d89){return function(_0xa45aee,_0x3035db,_0x23ea5e){ChatWebsiteEvents['emit'](_0x2c5d89+':'+_0xa45aee['id'],_0xa45aee);ChatWebsiteEvents['emit'](_0x2c5d89,_0xa45aee);_0x23ea5e(null);};}for(var e in events){if(events[_0xcfae('0x4')](e)){var event=events[e];ChatWebsite[_0xcfae('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x2d17=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x2d17,0x17e));var _0x72d1=function(_0x45b43b,_0x1037a9){_0x45b43b=_0x45b43b-0x0;var _0x41f6c7=_0x2d17[_0x45b43b];return _0x41f6c7;};'use strict';var EventEmitter=require(_0x72d1('0x0'));var ChatWebsite=require(_0x72d1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x72d1('0x2')](0x0);var events={'afterCreate':_0x72d1('0x3'),'afterUpdate':'update','afterDestroy':_0x72d1('0x4')};function emitEvent(_0x38fec7){return function(_0x55b722,_0x1dd6d8,_0x4dfee1){ChatWebsiteEvents[_0x72d1('0x5')](_0x38fec7+':'+_0x55b722['id'],_0x55b722);ChatWebsiteEvents['emit'](_0x38fec7,_0x55b722);_0x4dfee1(null);};}for(var e in events){if(events[_0x72d1('0x6')](e)){var event=events[e];ChatWebsite[_0x72d1('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index d7a1f02..9f63dc5 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 _0x8e45=['exports','define','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8e45,0x12f));var _0x58e4=function(_0x437257,_0x4b33b9){_0x437257=_0x437257-0x0;var _0x378721=_0x8e45[_0x437257];return _0x378721;};'use strict';var _=require(_0x58e4('0x0'));var util=require(_0x58e4('0x1'));var logger=require(_0x58e4('0x2'))(_0x58e4('0x3'));var moment=require('moment');var BPromise=require(_0x58e4('0x4'));var rp=require(_0x58e4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58e4('0x6'));var config=require(_0x58e4('0x7'));var attributes=require(_0x58e4('0x8'));module[_0x58e4('0x9')]=function(_0x3638d0,_0x56c7dc){return _0x3638d0[_0x58e4('0xa')]('ChatWebsite',attributes,{'tableName':_0x58e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe80e=['moment','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe80e,0x12a));var _0xee80=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xe80e[_0x236d24];return _0x1574cf;};'use strict';var _=require('lodash');var util=require(_0xee80('0x0'));var logger=require('../../config/logger')(_0xee80('0x1'));var moment=require(_0xee80('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee80('0x3'));var rimraf=require(_0xee80('0x4'));var config=require(_0xee80('0x5'));var attributes=require(_0xee80('0x6'));module[_0xee80('0x7')]=function(_0x10e12a,_0x36c211){return _0x10e12a[_0xee80('0x8')]('ChatWebsite',attributes,{'tableName':_0xee80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 9d16503..db028f9 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 _0xb79e=['code','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb79e,0x17e));var _0xeb79=function(_0x8533ec,_0x5f2114){_0x8533ec=_0x8533ec-0x0;var _0x4e123a=_0xb79e[_0x8533ec];return _0x4e123a;};'use strict';var _=require('lodash');var util=require(_0xeb79('0x0'));var moment=require(_0xeb79('0x1'));var BPromise=require(_0xeb79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb79('0x3'));var db=require(_0xeb79('0x4'))['db'];var utils=require(_0xeb79('0x5'));var logger=require(_0xeb79('0x6'))(_0xeb79('0x7'));var config=require(_0xeb79('0x8'));var jayson=require(_0xeb79('0x9'));var client=jayson[_0xeb79('0xa')][_0xeb79('0xb')]({'port':0x232a});config['redis']=_[_0xeb79('0xc')](config[_0xeb79('0xd')],{'host':_0xeb79('0xe'),'port':0x18eb});var socket=require(_0xeb79('0xf'))(new Redis(config[_0xeb79('0xd')]));require(_0xeb79('0x10'))[_0xeb79('0x11')](socket);function respondWithRpcPromise(_0x217b64,_0x36fe0f,_0x2e0706){return new BPromise(function(_0x39f153,_0x2f8f89){return client['request'](_0x217b64,_0x2e0706)[_0xeb79('0x12')](function(_0x2ac5dc){logger['info'](_0xeb79('0x13'),_0x36fe0f,_0xeb79('0x14'));logger[_0xeb79('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x36fe0f,_0xeb79('0x14'),JSON['stringify'](_0x2ac5dc));if(_0x2ac5dc[_0xeb79('0x16')]){if(_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x17')]===0x1f4){logger['error'](_0xeb79('0x13'),_0x36fe0f,_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);return _0x2f8f89(_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);}logger[_0xeb79('0x16')](_0xeb79('0x13'),_0x36fe0f,_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);return _0x39f153(_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);}else{logger[_0xeb79('0x19')](_0xeb79('0x13'),_0x36fe0f,_0xeb79('0x14'));_0x39f153(_0x2ac5dc['result'][_0xeb79('0x18')]);}})[_0xeb79('0x1a')](function(_0x39c447){logger[_0xeb79('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x36fe0f,_0x39c447);_0x2f8f89(_0x39c447);});});} \ No newline at end of file +var _0x0246=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/environment','client','redis','defaults','localhost','./chatWebsite.socket','then'];(function(_0x240c03,_0x132524){var _0x455f30=function(_0x4912f4){while(--_0x4912f4){_0x240c03['push'](_0x240c03['shift']());}};_0x455f30(++_0x132524);}(_0x0246,0xa9));var _0x6024=function(_0x2229d4,_0x366868){_0x2229d4=_0x2229d4-0x0;var _0x5ae869=_0x0246[_0x2229d4];return _0x5ae869;};'use strict';var _=require('lodash');var util=require(_0x6024('0x0'));var moment=require('moment');var BPromise=require(_0x6024('0x1'));var rs=require(_0x6024('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6024('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6024('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x6024('0x5')]['http']({'port':0x232a});config[_0x6024('0x6')]=_[_0x6024('0x7')](config['redis'],{'host':_0x6024('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6024('0x6')]));require(_0x6024('0x9'))['register'](socket);function respondWithRpcPromise(_0x4ed962,_0x5823bf,_0x397dbf){return new BPromise(function(_0x21278a,_0x288965){return client['request'](_0x4ed962,_0x397dbf)[_0x6024('0xa')](function(_0x4c1e33){logger[_0x6024('0xb')](_0x6024('0xc'),_0x5823bf,_0x6024('0xd'));logger['debug'](_0x6024('0xe'),_0x5823bf,_0x6024('0xd'),JSON[_0x6024('0xf')](_0x4c1e33));if(_0x4c1e33['error']){if(_0x4c1e33['error']['code']===0x1f4){logger[_0x6024('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5823bf,_0x4c1e33[_0x6024('0x10')][_0x6024('0x11')]);return _0x288965(_0x4c1e33['error'][_0x6024('0x11')]);}logger[_0x6024('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5823bf,_0x4c1e33[_0x6024('0x10')][_0x6024('0x11')]);return _0x21278a(_0x4c1e33[_0x6024('0x10')][_0x6024('0x11')]);}else{logger['info'](_0x6024('0xc'),_0x5823bf,'request\x20sent');_0x21278a(_0x4c1e33[_0x6024('0x12')][_0x6024('0x11')]);}})[_0x6024('0x13')](function(_0x169f9e){logger['error'](_0x6024('0xc'),_0x5823bf,_0x169f9e);_0x288965(_0x169f9e);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8155194..268cb3e 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 _0xc883=['length','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0xc883,0x122));var _0x3c88=function(_0x35fd98,_0x11e58b){_0x35fd98=_0x35fd98-0x0;var _0x139fe8=_0xc883[_0x35fd98];return _0x139fe8;};'use strict';var ChatWebsiteEvents=require(_0x3c88('0x0'));var events=[_0x3c88('0x1'),'remove',_0x3c88('0x2')];function createListener(_0x44d44a,_0x5f4aef){return function(_0x498e26){_0x5f4aef[_0x3c88('0x3')](_0x44d44a,_0x498e26);};}function removeListener(_0x5547e1,_0x8e0934){return function(){ChatWebsiteEvents['removeListener'](_0x5547e1,_0x8e0934);};}exports['register']=function(_0x412275){for(var _0x50ff89=0x0,_0x49fe5b=events[_0x3c88('0x4')];_0x50ff89<_0x49fe5b;_0x50ff89++){var _0x111c93=events[_0x50ff89];var _0x510691=createListener(_0x3c88('0x5')+_0x111c93,_0x412275);ChatWebsiteEvents['on'](_0x111c93,_0x510691);}}; \ No newline at end of file +var _0x26ba=['update','removeListener','./chatWebsite.events','save','remove'];(function(_0x512132,_0x360c5c){var _0x2a6fab=function(_0x542bac){while(--_0x542bac){_0x512132['push'](_0x512132['shift']());}};_0x2a6fab(++_0x360c5c);}(_0x26ba,0x1ba));var _0xa26b=function(_0x54af0d,_0x3e5db0){_0x54af0d=_0x54af0d-0x0;var _0x57b08d=_0x26ba[_0x54af0d];return _0x57b08d;};'use strict';var ChatWebsiteEvents=require(_0xa26b('0x0'));var events=[_0xa26b('0x1'),_0xa26b('0x2'),_0xa26b('0x3')];function createListener(_0x14674a,_0x4abec5){return function(_0x700185){_0x4abec5['emit'](_0x14674a,_0x700185);};}function removeListener(_0x426635,_0x51c119){return function(){ChatWebsiteEvents[_0xa26b('0x4')](_0x426635,_0x51c119);};}exports['register']=function(_0x104f55){for(var _0x5a099d=0x0,_0x5a08b8=events['length'];_0x5a099d<_0x5a08b8;_0x5a099d++){var _0x16b406=events[_0x5a099d];var _0x39cafb=createListener('chatWebsite:'+_0x16b406,_0x104f55);ChatWebsiteEvents['on'](_0x16b406,_0x39cafb);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 9130f5c..8c7165f 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 _0x0ff2=['getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','addDisposition','post','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','addAvatar','single','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','describe','get','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar'];(function(_0xb2423a,_0x71b6a3){var _0x3b88ba=function(_0x1cc533){while(--_0x1cc533){_0xb2423a['push'](_0xb2423a['shift']());}};_0x3b88ba(++_0x71b6a3);}(_0x0ff2,0xc9));var _0x20ff=function(_0x46d39b,_0x57b6dd){_0x46d39b=_0x46d39b-0x0;var _0x342d09=_0x0ff2[_0x46d39b];return _0x342d09;};'use strict';var multer=require('multer');var util=require(_0x20ff('0x0'));var path=require(_0x20ff('0x1'));var timeout=require(_0x20ff('0x2'));var express=require('express');var router=express[_0x20ff('0x3')]();var fs_extra=require(_0x20ff('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x20ff('0x5'));var config=require(_0x20ff('0x6'));var controller=require(_0x20ff('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x20ff('0x8')]);router['get'](_0x20ff('0x9'),auth['isAuthenticated'](),controller[_0x20ff('0xa')]);router[_0x20ff('0xb')](_0x20ff('0xc'),auth[_0x20ff('0xd')](),controller['show']);router[_0x20ff('0xb')](_0x20ff('0xe'),auth[_0x20ff('0xd')](),controller[_0x20ff('0xf')]);router[_0x20ff('0xb')](_0x20ff('0x10'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x11')]);router['get']('/:id/logo',controller[_0x20ff('0x12')]);router[_0x20ff('0xb')](_0x20ff('0x13'),controller[_0x20ff('0x14')]);router[_0x20ff('0xb')](_0x20ff('0x15'),controller[_0x20ff('0x16')]);router[_0x20ff('0xb')](_0x20ff('0x17'),controller[_0x20ff('0x18')]);router[_0x20ff('0xb')](_0x20ff('0x19'),auth[_0x20ff('0xd')](),controller['getInteractions']);router[_0x20ff('0xb')](_0x20ff('0x1a'),controller[_0x20ff('0x1b')]);router[_0x20ff('0xb')](_0x20ff('0x1c'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x1d')]);router[_0x20ff('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x20ff('0x1e')]);router[_0x20ff('0xb')](_0x20ff('0x1f'),controller[_0x20ff('0x20')]);router['get'](_0x20ff('0x21'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x22')]);router[_0x20ff('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0x20ff('0x23')]);router['post']('/',auth['isAuthenticated'](),controller[_0x20ff('0x24')]);router['post']('/:id/dispositions',auth[_0x20ff('0xd')](),controller[_0x20ff('0x25')]);router[_0x20ff('0x26')](_0x20ff('0x10'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x4c05e4,_0x4aec6e,_0x350042){_0x350042(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],_0x20ff('0x2a')));},'filename':function(_0x3db28b,_0x123560,_0x22e397){_0x22e397(null,util[_0x20ff('0x2b')](_0x20ff('0x2c'),Date[_0x20ff('0x2d')](),_0x123560[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')]('/:id/logo',upload['single'](_0x20ff('0x2f')),controller[_0x20ff('0x30')]);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x2d7865,_0x514a53,_0x297b3e){_0x297b3e(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],_0x20ff('0x31')));},'filename':function(_0x306c25,_0x4958b7,_0x35aa2c){_0x35aa2c(null,util[_0x20ff('0x2b')](_0x20ff('0x2c'),Date[_0x20ff('0x2d')](),_0x4958b7[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')](_0x20ff('0x13'),upload['single'](_0x20ff('0x2f')),controller[_0x20ff('0x32')]);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x122417,_0x3ae439,_0x396094){_0x396094(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],'server/files/images/avatars/'));},'filename':function(_0x11b5c4,_0x47cdf3,_0x1c92cf){_0x1c92cf(null,util[_0x20ff('0x2b')]('%s-%s',Date[_0x20ff('0x2d')](),_0x47cdf3[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')](_0x20ff('0x15'),upload[_0x20ff('0x33')](_0x20ff('0x2f')),controller[_0x20ff('0x34')]);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x1ab4b5,_0xeaeced,_0x5bb27b){_0x5bb27b(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],'server/files/images/avatars/'));},'filename':function(_0x4e6449,_0x75e292,_0x194d16){_0x194d16(null,util[_0x20ff('0x2b')](_0x20ff('0x2c'),Date[_0x20ff('0x2d')](),_0x75e292[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')](_0x20ff('0x17'),upload[_0x20ff('0x33')](_0x20ff('0x2f')),controller[_0x20ff('0x35')]);router[_0x20ff('0x26')]('/:id/notify',controller[_0x20ff('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x38fdbd,_0x4fc388,_0x56df99){const _0x1925ad=path[_0x20ff('0x28')](config[_0x20ff('0x29')],_0x20ff('0x37'),_0x20ff('0x38'),'offline-chat');fs_extra[_0x20ff('0x39')](_0x1925ad,function(){_0x56df99(null,_0x1925ad);});},'filename':function(_0x527a22,_0xeb29a7,_0x3ac585){const _0x3a876e=_0xeb29a7[_0x20ff('0x2e')][_0x20ff('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x32315c=path[_0x20ff('0x3b')](_0x3a876e);const _0x299577=Date[_0x20ff('0x2d')]()+'-'+_0x3a876e[_0x20ff('0x3a')](_0x32315c,'')+_0x32315c;_0x3ac585(null,_0x299577);}})});router[_0x20ff('0x26')](_0x20ff('0x3c'),offlineUploadMulter[_0x20ff('0x3d')](),controller[_0x20ff('0x3e')]);router['post'](_0x20ff('0x19'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x3f')]);router['post'](_0x20ff('0x1c'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x40')]);router['post']('/:id/proactive_actions',auth[_0x20ff('0xd')](),controller[_0x20ff('0x41')]);router[_0x20ff('0x26')](_0x20ff('0x42'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x43')]);router[_0x20ff('0x44')](_0x20ff('0xc'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x45')]);router[_0x20ff('0x46')](_0x20ff('0xc'),auth[_0x20ff('0xd')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x20ff('0xd')](),controller[_0x20ff('0x47')]);router[_0x20ff('0x46')](_0x20ff('0x10'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x48')]);router['delete']('/:id/users',auth[_0x20ff('0xd')](),controller[_0x20ff('0x49')]);module[_0x20ff('0x4a')]=router; \ No newline at end of file +var _0xc3a3=['addApplications','addProactiveActions','addAgents','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','show','/:id/canned_answers','isAuthenticated','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction'];(function(_0x12f56b,_0x534bf4){var _0x10e4e4=function(_0x49b772){while(--_0x49b772){_0x12f56b['push'](_0x12f56b['shift']());}};_0x10e4e4(++_0x534bf4);}(_0xc3a3,0x9a));var _0x3c3a=function(_0x4004e1,_0x4a241d){_0x4004e1=_0x4004e1-0x0;var _0x360efb=_0xc3a3[_0x4004e1];return _0x360efb;};'use strict';var multer=require(_0x3c3a('0x0'));var util=require(_0x3c3a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3c3a('0x2'));var router=express[_0x3c3a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3c3a('0x4'));var interaction=require(_0x3c3a('0x5'));var config=require(_0x3c3a('0x6'));var controller=require(_0x3c3a('0x7'));router[_0x3c3a('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0x9')]);router[_0x3c3a('0x8')](_0x3c3a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3c3a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3c3a('0xb')]);router[_0x3c3a('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x3c3a('0xc'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0xe')]);router['get'](_0x3c3a('0xf'),controller[_0x3c3a('0x10')]);router[_0x3c3a('0x8')](_0x3c3a('0x11'),controller[_0x3c3a('0x12')]);router[_0x3c3a('0x8')](_0x3c3a('0x13'),controller[_0x3c3a('0x14')]);router[_0x3c3a('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x3c3a('0x8')](_0x3c3a('0x15'),auth['isAuthenticated'](),controller[_0x3c3a('0x16')]);router['get'](_0x3c3a('0x17'),controller[_0x3c3a('0x18')]);router[_0x3c3a('0x8')](_0x3c3a('0x19'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x1a')]);router[_0x3c3a('0x8')](_0x3c3a('0x1b'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x1c')]);router[_0x3c3a('0x8')]('/:id/fields',controller['getFields']);router[_0x3c3a('0x8')](_0x3c3a('0x1d'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x1e')]);router[_0x3c3a('0x8')](_0x3c3a('0x1f'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x20')]);router[_0x3c3a('0x21')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0x22')]);router['post'](_0x3c3a('0x23'),auth['isAuthenticated'](),controller[_0x3c3a('0x24')]);router['post'](_0x3c3a('0xc'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x25')]);var upload=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x2ebb12,_0x10a9eb,_0x5750f8){_0x5750f8(null,path['join'](config[_0x3c3a('0x27')],_0x3c3a('0x28')));},'filename':function(_0x46d87f,_0x2f1b22,_0x5292cf){_0x5292cf(null,util[_0x3c3a('0x29')](_0x3c3a('0x2a'),Date[_0x3c3a('0x2b')](),_0x2f1b22[_0x3c3a('0x2c')]));}})});router[_0x3c3a('0x21')]('/:id/logo',upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller[_0x3c3a('0x2f')]);var upload=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x537d7a,_0x43afb0,_0x582966){_0x582966(null,path[_0x3c3a('0x30')](config[_0x3c3a('0x27')],_0x3c3a('0x31')));},'filename':function(_0x51c602,_0x5d4f47,_0x57ff31){_0x57ff31(null,util['format']('%s-%s',Date[_0x3c3a('0x2b')](),_0x5d4f47[_0x3c3a('0x2c')]));}})});router[_0x3c3a('0x21')](_0x3c3a('0x11'),upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller[_0x3c3a('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52a8f3,_0x3e8557,_0x129442){_0x129442(null,path[_0x3c3a('0x30')](config[_0x3c3a('0x27')],_0x3c3a('0x31')));},'filename':function(_0x139264,_0x3859f2,_0x12cde3){_0x12cde3(null,util['format']('%s-%s',Date[_0x3c3a('0x2b')](),_0x3859f2[_0x3c3a('0x2c')]));}})});router['post'](_0x3c3a('0x13'),upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller[_0x3c3a('0x33')]);var upload=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x144788,_0x91486b,_0x884e6d){_0x884e6d(null,path['join'](config[_0x3c3a('0x27')],_0x3c3a('0x31')));},'filename':function(_0x25fa49,_0x1e5d74,_0x272693){_0x272693(null,util[_0x3c3a('0x29')](_0x3c3a('0x2a'),Date[_0x3c3a('0x2b')](),_0x1e5d74[_0x3c3a('0x2c')]));}})});router['post']('/:id/system_avatar',upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller['addSystemAvatar']);router[_0x3c3a('0x21')](_0x3c3a('0x34'),controller[_0x3c3a('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x24009d,_0x48bef8,_0x29f3e2){const _0x4dc6c0=path[_0x3c3a('0x30')](config[_0x3c3a('0x27')],_0x3c3a('0x36'),'attachments',_0x3c3a('0x37'));fs_extra[_0x3c3a('0x38')](_0x4dc6c0,function(){_0x29f3e2(null,_0x4dc6c0);});},'filename':function(_0x29f1ba,_0x458dfb,_0x30251e){const _0x1c5494=_0x458dfb['originalname'][_0x3c3a('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x42ebd7=path['extname'](_0x1c5494);const _0x1802b5=Date['now']()+'-'+_0x1c5494[_0x3c3a('0x39')](_0x42ebd7,'')+_0x42ebd7;_0x30251e(null,_0x1802b5);}})});router[_0x3c3a('0x21')](_0x3c3a('0x3a'),offlineUploadMulter[_0x3c3a('0x3b')](),controller[_0x3c3a('0x3c')]);router['post'](_0x3c3a('0x15'),auth['isAuthenticated'](),controller[_0x3c3a('0x3d')]);router['post'](_0x3c3a('0x19'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x3e')]);router[_0x3c3a('0x21')](_0x3c3a('0x1b'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x3f')]);router[_0x3c3a('0x21')](_0x3c3a('0x1f'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x40')]);router['put'](_0x3c3a('0x41'),auth[_0x3c3a('0xd')](),controller['update']);router[_0x3c3a('0x42')](_0x3c3a('0x41'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x43')]);router[_0x3c3a('0x42')](_0x3c3a('0x23'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x44')]);router[_0x3c3a('0x42')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3c3a('0x45')]);router['delete'](_0x3c3a('0x1f'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x46')]);module[_0x3c3a('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index df39792..5e03972 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 _0xc52a=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production','app'];(function(_0xee4cde,_0xec9c59){var _0x4fd9f0=function(_0x24a6ff){while(--_0x24a6ff){_0xee4cde['push'](_0xee4cde['shift']());}};_0x4fd9f0(++_0xec9c59);}(_0xc52a,0x181));var _0xac52=function(_0x44a573,_0x1e6efc){_0x44a573=_0x44a573-0x0;var _0x4babc6=_0xc52a[_0x44a573];return _0x4babc6;};var beaverLogger=require(_0xac52('0x0'));var express=require('express');var auth=require(_0xac52('0x1'));var config=require(_0xac52('0x2'));var router=express[_0xac52('0x3')]();var isProduction=config[_0xac52('0x4')]===_0xac52('0x5')||![];function clientSideLogs(_0x502d75,_0x3c42ad,_0x29f9e1){var _0x3328da=_0x502d75[_0xac52('0x6')][_0xac52('0x7')](_0xac52('0x8'));if(!_0x3328da){throw new Error(_0xac52('0x9'));}return beaverLogger[_0xac52('0xa')]({'uri':_0xac52('0xb'),'logger':_0x3328da,'enableCors':!isProduction})(_0x502d75,_0x3c42ad,_0x29f9e1);}router['use'](auth[_0xac52('0xc')](),clientSideLogs);module[_0xac52('0xd')]=router; \ No newline at end of file +var _0x1942=['beaver-logger/server','express','../config/environment','Router','env','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports'];(function(_0x8774d0,_0x5989f9){var _0x27ebed=function(_0x296fc7){while(--_0x296fc7){_0x8774d0['push'](_0x8774d0['shift']());}};_0x27ebed(++_0x5989f9);}(_0x1942,0x179));var _0x2194=function(_0x271d63,_0x40ca6f){_0x271d63=_0x271d63-0x0;var _0x16d485=_0x1942[_0x271d63];return _0x16d485;};var beaverLogger=require(_0x2194('0x0'));var express=require(_0x2194('0x1'));var auth=require('../components/auth/service');var config=require(_0x2194('0x2'));var router=express[_0x2194('0x3')]();var isProduction=config[_0x2194('0x4')]==='production'||![];function clientSideLogs(_0x459464,_0x526c81,_0x5571b9){var _0x390bd7=_0x459464[_0x2194('0x5')]['get'](_0x2194('0x6'));if(!_0x390bd7){throw new Error(_0x2194('0x7'));}return beaverLogger[_0x2194('0x8')]({'uri':_0x2194('0x9'),'logger':_0x390bd7,'enableCors':!isProduction})(_0x459464,_0x526c81,_0x5571b9);}router[_0x2194('0xa')](auth[_0x2194('0xb')](),clientSideLogs);module[_0x2194('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 07fd55c..fa89edb 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 _0x10ad=['AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM'];(function(_0xecc8f4,_0x350061){var _0x1cc0bc=function(_0x57f0f0){while(--_0x57f0f0){_0xecc8f4['push'](_0xecc8f4['shift']());}};_0x1cc0bc(++_0x350061);}(_0x10ad,0x19d));var _0xd10a=function(_0x2fe439,_0x5bf629){_0x2fe439=_0x2fe439-0x0;var _0x1db61a=_0x10ad[_0x2fe439];return _0x1db61a;};'use strict';var Sequelize=require('sequelize');module[_0xd10a('0x0')]={'name':{'type':Sequelize[_0xd10a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd10a('0x2')](_0xd10a('0x3'),_0xd10a('0x4'),_0xd10a('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd10a('0x6'),_0xd10a('0x7'))},'data1':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0x8')},'data2':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0x9')},'data3':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0xa')},'data4':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0xb')},'data5':{'type':Sequelize[_0xd10a('0xc')],'comment':_0xd10a('0xd')},'data6':{'type':Sequelize[_0xd10a('0xc')],'comment':_0xd10a('0xe')},'data7':{'type':Sequelize[_0xd10a('0xc')],'comment':_0xd10a('0xf')}}; \ No newline at end of file +var _0x759d=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token'];(function(_0x2d2ff4,_0x1f59bc){var _0x18513a=function(_0x19d6e6){while(--_0x19d6e6){_0x2d2ff4['push'](_0x2d2ff4['shift']());}};_0x18513a(++_0x1f59bc);}(_0x759d,0x161));var _0xd759=function(_0x2bc84e,_0x1fcf67){_0x2bc84e=_0x2bc84e-0x0;var _0x4ad0b9=_0x759d[_0x2bc84e];return _0x4ad0b9;};'use strict';var Sequelize=require(_0xd759('0x0'));module[_0xd759('0x1')]={'name':{'type':Sequelize[_0xd759('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd759('0x3')](_0xd759('0x4'),'Google',_0xd759('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd759('0x3')](_0xd759('0x6'),_0xd759('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0xd759('0x8')},'data2':{'type':Sequelize[_0xd759('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xd759('0x2')],'comment':_0xd759('0x9')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0xd759('0xa')},'data6':{'type':Sequelize[_0xd759('0xb')],'comment':_0xd759('0xc')},'data7':{'type':Sequelize[_0xd759('0xb')],'comment':_0xd759('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 8fa4088..6706975 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 _0x81ec=['json','offset','undefined','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','MicrosoftAzure','decryptString','data3','show','params','find','catch','create','Name\x20parameter\x20not\x20specified','body','service','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','status','end'];(function(_0xfbfe1a,_0x3e9459){var _0xba1312=function(_0x4f2a2f){while(--_0x4f2a2f){_0xfbfe1a['push'](_0xfbfe1a['shift']());}};_0xba1312(++_0x3e9459);}(_0x81ec,0x170));var _0xc81e=function(_0x4073b6,_0x3bdde9){_0x4073b6=_0x4073b6-0x0;var _0x464a51=_0x81ec[_0x4073b6];return _0x464a51;};'use strict';var _=require('lodash');var Redis=require(_0xc81e('0x0'));var qs=require(_0xc81e('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0xc81e('0x2'));var logger=require(_0xc81e('0x3'))(_0xc81e('0x4'));var db=require(_0xc81e('0x5'))['db'];var oauth=require(_0xc81e('0x6'));config[_0xc81e('0x7')]=_['defaults'](config[_0xc81e('0x7')],{'host':_0xc81e('0x8'),'port':0x18eb});var socket=require(_0xc81e('0x9'))(new Redis(config[_0xc81e('0x7')]));var redis=new Redis(config[_0xc81e('0x7')]);function respondWithStatusCode(_0xa20fbe,_0x57d124){_0x57d124=_0x57d124||0xcc;return function(_0x28989c){if(_0x28989c){return _0xa20fbe['sendStatus'](_0x57d124);}return _0xa20fbe[_0xc81e('0xa')](_0x57d124)[_0xc81e('0xb')]();};}function respondWithResult(_0x5ab8c8,_0x4916bc){_0x4916bc=_0x4916bc||0xc8;return function(_0x1c1098){if(_0x1c1098){return _0x5ab8c8['status'](_0x4916bc)[_0xc81e('0xc')](_0x1c1098);}};}function respondWithFilteredResult(_0xfcecf0,_0xa40378){return function(_0x84f562){if(_0x84f562){var _0x439f68=typeof _0xa40378[_0xc81e('0xd')]===_0xc81e('0xe')&&typeof _0xa40378['limit']===_0xc81e('0xe');var _0x4625b9=_0x84f562['count'];var _0x5d26f2=_0x439f68?0x0:_0xa40378[_0xc81e('0xd')];var _0x4d5477=_0x439f68?_0x84f562[_0xc81e('0xf')]:_0xa40378['offset']+_0xa40378['limit'];var _0x3837ce;if(_0x4d5477>=_0x4625b9){_0x4d5477=_0x4625b9;_0x3837ce=0xc8;}else{_0x3837ce=0xce;}_0xfcecf0[_0xc81e('0xa')](_0x3837ce);return _0xfcecf0[_0xc81e('0x10')](_0xc81e('0x11'),_0x5d26f2+'-'+_0x4d5477+'/'+_0x4625b9)['json'](_0x84f562);}return null;};}function saveUpdates(_0x1c19d6){return function(_0x2ca32a){if(_0x2ca32a){return _0x2ca32a[_0xc81e('0x12')](_0x1c19d6)[_0xc81e('0x13')](function(_0x5e1385){return _0x5e1385;});}return null;};}function removeEntity(_0xb29b47){return function(_0x5e33f7){if(_0x5e33f7){return _0x5e33f7[_0xc81e('0x14')]()[_0xc81e('0x13')](function(){_0xb29b47[_0xc81e('0xa')](0xcc)[_0xc81e('0xb')]();});}};}function handleEntityNotFound(_0x14522f){return function(_0x3b919e){if(!_0x3b919e){_0x14522f[_0xc81e('0x15')](0x194);}return _0x3b919e;};}function handleError(_0x4a4be0,_0x4cd469){_0x4cd469=_0x4cd469||0x1f4;return function(_0x2109f2){logger[_0xc81e('0x16')](_0x2109f2[_0xc81e('0x17')]);if(_0x2109f2[_0xc81e('0x18')]){delete _0x2109f2[_0xc81e('0x18')];}_0x4a4be0[_0xc81e('0xa')](_0x4cd469)[_0xc81e('0x19')](_0x2109f2);};}function maskClientSecret(_0x158987){return _[_0xc81e('0x1a')](_0x158987[_0xc81e('0x1b')](0x0,0x3),0x14,'*');}exports[_0xc81e('0x1c')]=function(_0x16e67a,_0x3d1608){var _0x5307fd={},_0xfefc02={},_0x6eb361={'count':0x0,'rows':[]};var _0x234517=_[_0xc81e('0x1d')](db[_0xc81e('0x1e')][_0xc81e('0x1f')],function(_0x27a7e2){return{'name':_0x27a7e2['fieldName'],'type':_0x27a7e2[_0xc81e('0x20')][_0xc81e('0x21')]};});_0xfefc02[_0xc81e('0x22')]=_['map'](_0x234517,'name');_0xfefc02[_0xc81e('0x23')]=_[_0xc81e('0x24')](_0x16e67a[_0xc81e('0x23')]);_0xfefc02[_0xc81e('0x25')]=_[_0xc81e('0x26')](_0xfefc02[_0xc81e('0x22')],_0xfefc02[_0xc81e('0x23')]);_0x5307fd[_0xc81e('0x27')]=_['intersection'](_0xfefc02['model'],qs[_0xc81e('0x28')](_0x16e67a[_0xc81e('0x23')]['fields']));_0x5307fd['attributes']=_0x5307fd[_0xc81e('0x27')][_0xc81e('0x29')]?_0x5307fd[_0xc81e('0x27')]:_0xfefc02['model'];if(!_0x16e67a[_0xc81e('0x23')][_0xc81e('0x2a')]('nolimit')){_0x5307fd['limit']=qs[_0xc81e('0x2b')](_0x16e67a[_0xc81e('0x23')][_0xc81e('0x2b')]);_0x5307fd[_0xc81e('0xd')]=qs[_0xc81e('0xd')](_0x16e67a[_0xc81e('0x23')][_0xc81e('0xd')]);}_0x5307fd[_0xc81e('0x2c')]=qs[_0xc81e('0x2d')](_0x16e67a[_0xc81e('0x23')]['sort']);_0x5307fd[_0xc81e('0x2e')]=qs[_0xc81e('0x25')](_[_0xc81e('0x2f')](_0x16e67a[_0xc81e('0x23')],_0xfefc02[_0xc81e('0x25')]),_0x234517);if(_0x16e67a[_0xc81e('0x23')][_0xc81e('0x30')]){_0x5307fd[_0xc81e('0x2e')]=_[_0xc81e('0x31')](_0x5307fd[_0xc81e('0x2e')],{'$or':_[_0xc81e('0x1d')](_0x234517,function(_0x2eda2f){if(_0x2eda2f['type']!=='VIRTUAL'){var _0x183f58={};_0x183f58[_0x2eda2f[_0xc81e('0x18')]]={'$like':'%'+_0x16e67a[_0xc81e('0x23')][_0xc81e('0x30')]+'%'};return _0x183f58;}})});}_0x5307fd=_[_0xc81e('0x31')]({},_0x5307fd,_0x16e67a[_0xc81e('0x32')]);var _0x46f4d1={'where':_0x5307fd[_0xc81e('0x2e')]};return db[_0xc81e('0x1e')][_0xc81e('0xf')](_0x46f4d1)[_0xc81e('0x13')](function(_0x591a96){_0x6eb361[_0xc81e('0xf')]=_0x591a96;if(_0x16e67a['query'][_0xc81e('0x33')]){_0x5307fd[_0xc81e('0x34')]=[{'all':!![]}];}return db['CloudProvider'][_0xc81e('0x35')](_0x5307fd);})['then'](function(_0x5441e9){_0x6eb361['rows']=_['map'](_0x5441e9,function(_0x21a91f){if(_0x21a91f['service']===_0xc81e('0x36')){var _0x30024c=encryptor[_0xc81e('0x37')](_0x21a91f[_0xc81e('0x38')]);_0x21a91f['data3']=maskClientSecret(_0x30024c);}return _0x21a91f;});return _0x6eb361;})[_0xc81e('0x13')](respondWithFilteredResult(_0x3d1608,_0x5307fd))['catch'](handleError(_0x3d1608,null));};exports[_0xc81e('0x39')]=function(_0xfd2524,_0x3572ee){var _0x30d251={'raw':!![],'where':{'id':_0xfd2524[_0xc81e('0x3a')]['id']}},_0x494fbe={};_0x494fbe[_0xc81e('0x22')]=_[_0xc81e('0x24')](db['CloudProvider'][_0xc81e('0x1f')]);_0x494fbe[_0xc81e('0x23')]=_[_0xc81e('0x24')](_0xfd2524[_0xc81e('0x23')]);_0x494fbe[_0xc81e('0x25')]=_[_0xc81e('0x26')](_0x494fbe[_0xc81e('0x22')],_0x494fbe['query']);_0x30d251['attributes']=_[_0xc81e('0x26')](_0x494fbe[_0xc81e('0x22')],qs[_0xc81e('0x28')](_0xfd2524[_0xc81e('0x23')][_0xc81e('0x28')]));_0x30d251[_0xc81e('0x27')]=_0x30d251['attributes']['length']?_0x30d251[_0xc81e('0x27')]:_0x494fbe[_0xc81e('0x22')];if(_0xfd2524['query'][_0xc81e('0x33')]){_0x30d251[_0xc81e('0x34')]=[{'all':!![]}];}_0x30d251=_[_0xc81e('0x31')]({},_0x30d251,_0xfd2524[_0xc81e('0x32')]);return db[_0xc81e('0x1e')][_0xc81e('0x3b')](_0x30d251)[_0xc81e('0x13')](handleEntityNotFound(_0x3572ee,null))[_0xc81e('0x13')](function(_0x53adff){if(_0x53adff['service']===_0xc81e('0x36')){var _0x4b9c4a=encryptor[_0xc81e('0x37')](_0x53adff['data3']);_0x53adff['data3']=maskClientSecret(_0x4b9c4a);}return _0x53adff;})['then'](respondWithResult(_0x3572ee,null))[_0xc81e('0x3c')](handleError(_0x3572ee,null));};exports[_0xc81e('0x3d')]=function(_0x5837b0,_0x20f7a9){if(!_0x5837b0['body'][_0xc81e('0x18')])throw new Error(_0xc81e('0x3e'));if(!_0x5837b0[_0xc81e('0x3f')][_0xc81e('0x40')])throw new Error(_0xc81e('0x41'));var _0x20001f=db['CloudProvider'][_0xc81e('0x1f')]['service'][_0xc81e('0x42')];if(!_0x20001f[_0xc81e('0x43')](_0x5837b0[_0xc81e('0x3f')]['service']))throw new Error(_0xc81e('0x44')+_0x20001f['join'](',\x20'));if(_0x5837b0[_0xc81e('0x3f')][_0xc81e('0x40')]===_0xc81e('0x36')&&_0x5837b0['body']['data3']){_0x5837b0['body'][_0xc81e('0x38')]=encryptor[_0xc81e('0x45')](_0x5837b0[_0xc81e('0x3f')][_0xc81e('0x38')]);}return db['CloudProvider'][_0xc81e('0x3d')](_0x5837b0[_0xc81e('0x3f')],{})[_0xc81e('0x13')](respondWithResult(_0x20f7a9,0xc9))[_0xc81e('0x3c')](handleError(_0x20f7a9,null));};exports[_0xc81e('0x12')]=function(_0x59a93f,_0x339be2){if(_0x59a93f[_0xc81e('0x3f')]['id']){delete _0x59a93f[_0xc81e('0x3f')]['id'];}return db[_0xc81e('0x1e')]['find']({'where':{'id':_0x59a93f[_0xc81e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x339be2,null))[_0xc81e('0x13')](function(_0x595c61){if(_0x595c61['service']==='MicrosoftAzure'&&_0x59a93f[_0xc81e('0x3f')][_0xc81e('0x38')]){_0x59a93f[_0xc81e('0x3f')][_0xc81e('0x38')]=encryptor[_0xc81e('0x45')](_0x59a93f['body'][_0xc81e('0x38')]);}return _0x595c61;})[_0xc81e('0x13')](saveUpdates(_0x59a93f[_0xc81e('0x3f')],null))['then'](respondWithResult(_0x339be2,null))[_0xc81e('0x3c')](handleError(_0x339be2,null));};exports[_0xc81e('0x14')]=function(_0xe36f5f,_0x42af3b){return db['CloudProvider'][_0xc81e('0x3b')]({'where':{'id':_0xe36f5f[_0xc81e('0x3a')]['id']}})[_0xc81e('0x13')](handleEntityNotFound(_0x42af3b,null))[_0xc81e('0x13')](removeEntity(_0x42af3b,null))[_0xc81e('0x3c')](handleError(_0x42af3b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x27756a,_0x2aa5c1){return db[_0xc81e('0x1e')]['findOne']({'where':{'id':_0x27756a[_0xc81e('0x3a')]['id']},'raw':!![]})['then'](function(_0x17df22){if(!_0x17df22)return _0x2aa5c1[_0xc81e('0x15')](0x194);return{'url':oauth[_0xc81e('0x46')](_0x17df22,_0x27756a[_0xc81e('0x47')]['id'])};})[_0xc81e('0x13')](respondWithResult(_0x2aa5c1,null))[_0xc81e('0x3c')](handleError(_0x2aa5c1,null));};exports[_0xc81e('0x48')]=function(_0x502250,_0x42a5f1){var _0xa1ce6f=_0x502250[_0xc81e('0x3f')];var _0x1cb249;var _0x4250cd;if(_0xa1ce6f[_0xc81e('0x16')])throw _0xa1ce6f;redis[_0xc81e('0x49')](_0xa1ce6f[_0xc81e('0x4a')])['then'](function(_0x551965){if(!_0x551965)throw new Error(_0xc81e('0x4b'));_0x1cb249=JSON[_0xc81e('0x4c')](_0x551965);var _0x5736ac=Buffer['from'](_0xa1ce6f[_0xc81e('0x4a')],_0xc81e('0x4d'))[_0xc81e('0x4e')]('ascii');_0x4250cd=JSON[_0xc81e('0x4c')](_0x5736ac);if(!oauth[_0xc81e('0x4f')](_0xa1ce6f[_0xc81e('0x50')],_0x1cb249[_0xc81e('0x51')]))throw new Error(_0xc81e('0x52'));redis[_0xc81e('0x53')](_0xa1ce6f[_0xc81e('0x4a')]);return oauth[_0xc81e('0x54')](_0xa1ce6f[_0xc81e('0x55')],_0x1cb249);})[_0xc81e('0x13')](function(_0x4c672e){_0x1cb249[_0xc81e('0x56')]=_0x4c672e[_0xc81e('0x57')];_0x1cb249[_0xc81e('0x58')]=_0x4c672e['refresh_token'];return db[_0xc81e('0x1e')][_0xc81e('0x12')]({'data5':_0x1cb249[_0xc81e('0x56')],'data6':_0x1cb249[_0xc81e('0x58')]},{'where':{'id':_0x1cb249['id']}});})[_0xc81e('0x13')](function(){oauth['startRefreshInterval'](_0x1cb249);socket[_0xc81e('0x59')](_0xc81e('0x5a'),{'id':_0x4250cd['id']});return;})[_0xc81e('0x13')](respondWithStatusCode(_0x42a5f1,null))['catch'](function(_0xe85cc5){if(_0x4250cd){socket[_0xc81e('0x59')](_0xc81e('0x5b'),{'id':_0x4250cd['id']});}if(!_0x1cb249){logger[_0xc81e('0x16')](_0xc81e('0x5c'),_0xe85cc5);return _0x42a5f1[_0xc81e('0xa')](0x1f4)[_0xc81e('0x19')](_0xe85cc5[_0xc81e('0x5d')]);}logger[_0xc81e('0x16')](_0xc81e('0x5e'),_0x1cb249['id'],JSON['stringify'](_0xe85cc5));});}; \ No newline at end of file +var _0xaa80=['update','then','destroy','end','sendStatus','error','name','send','padEnd','map','CloudProvider','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','rawAttributes','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','status','offset','undefined','limit','count','set','json'];(function(_0x49a94c,_0xd3fe12){var _0x1e57e9=function(_0x3f4585){while(--_0x3f4585){_0x49a94c['push'](_0x49a94c['shift']());}};_0x1e57e9(++_0xd3fe12);}(_0xaa80,0x1d0));var _0x0aa8=function(_0x54f03d,_0x5a6ce8){_0x54f03d=_0x54f03d-0x0;var _0x568f29=_0xaa80[_0x54f03d];return _0x568f29;};'use strict';var _=require('lodash');var Redis=require(_0x0aa8('0x0'));var qs=require(_0x0aa8('0x1'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x0aa8('0x2'))(_0x0aa8('0x3'));var db=require(_0x0aa8('0x4'))['db'];var oauth=require(_0x0aa8('0x5'));config[_0x0aa8('0x6')]=_[_0x0aa8('0x7')](config[_0x0aa8('0x6')],{'host':_0x0aa8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0aa8('0x6')]));var redis=new Redis(config[_0x0aa8('0x6')]);function respondWithStatusCode(_0x285923,_0x1c8df9){_0x1c8df9=_0x1c8df9||0xcc;return function(_0x3954b6){if(_0x3954b6){return _0x285923['sendStatus'](_0x1c8df9);}return _0x285923['status'](_0x1c8df9)['end']();};}function respondWithResult(_0x17abf7,_0x4a8d03){_0x4a8d03=_0x4a8d03||0xc8;return function(_0x218e64){if(_0x218e64){return _0x17abf7[_0x0aa8('0x9')](_0x4a8d03)['json'](_0x218e64);}};}function respondWithFilteredResult(_0x3cba6b,_0x250fd7){return function(_0x1cdaa6){if(_0x1cdaa6){var _0x1bac96=typeof _0x250fd7[_0x0aa8('0xa')]===_0x0aa8('0xb')&&typeof _0x250fd7[_0x0aa8('0xc')]===_0x0aa8('0xb');var _0x2dd6fc=_0x1cdaa6[_0x0aa8('0xd')];var _0x37a56d=_0x1bac96?0x0:_0x250fd7[_0x0aa8('0xa')];var _0x3603a6=_0x1bac96?_0x1cdaa6['count']:_0x250fd7[_0x0aa8('0xa')]+_0x250fd7[_0x0aa8('0xc')];var _0x485f87;if(_0x3603a6>=_0x2dd6fc){_0x3603a6=_0x2dd6fc;_0x485f87=0xc8;}else{_0x485f87=0xce;}_0x3cba6b[_0x0aa8('0x9')](_0x485f87);return _0x3cba6b[_0x0aa8('0xe')]('Content-Range',_0x37a56d+'-'+_0x3603a6+'/'+_0x2dd6fc)[_0x0aa8('0xf')](_0x1cdaa6);}return null;};}function saveUpdates(_0x2a0773){return function(_0x33c3d9){if(_0x33c3d9){return _0x33c3d9[_0x0aa8('0x10')](_0x2a0773)[_0x0aa8('0x11')](function(_0x29b053){return _0x29b053;});}return null;};}function removeEntity(_0x11d8e6){return function(_0x14cff9){if(_0x14cff9){return _0x14cff9[_0x0aa8('0x12')]()['then'](function(){_0x11d8e6['status'](0xcc)[_0x0aa8('0x13')]();});}};}function handleEntityNotFound(_0x17fa59){return function(_0x515abc){if(!_0x515abc){_0x17fa59[_0x0aa8('0x14')](0x194);}return _0x515abc;};}function handleError(_0x2b8bb2,_0x1dca15){_0x1dca15=_0x1dca15||0x1f4;return function(_0x5169d3){logger[_0x0aa8('0x15')](_0x5169d3['stack']);if(_0x5169d3[_0x0aa8('0x16')]){delete _0x5169d3['name'];}_0x2b8bb2[_0x0aa8('0x9')](_0x1dca15)[_0x0aa8('0x17')](_0x5169d3);};}function maskClientSecret(_0x3c84c7){return _[_0x0aa8('0x18')](_0x3c84c7['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x57c36a,_0x5b4685){var _0x109d72={},_0x134c2e={},_0x5d0262={'count':0x0,'rows':[]};var _0x1ef9c9=_[_0x0aa8('0x19')](db[_0x0aa8('0x1a')]['rawAttributes'],function(_0x8dc5e4){return{'name':_0x8dc5e4[_0x0aa8('0x1b')],'type':_0x8dc5e4[_0x0aa8('0x1c')][_0x0aa8('0x1d')]};});_0x134c2e[_0x0aa8('0x1e')]=_[_0x0aa8('0x19')](_0x1ef9c9,'name');_0x134c2e[_0x0aa8('0x1f')]=_[_0x0aa8('0x20')](_0x57c36a[_0x0aa8('0x1f')]);_0x134c2e['filters']=_[_0x0aa8('0x21')](_0x134c2e[_0x0aa8('0x1e')],_0x134c2e[_0x0aa8('0x1f')]);_0x109d72['attributes']=_[_0x0aa8('0x21')](_0x134c2e[_0x0aa8('0x1e')],qs[_0x0aa8('0x22')](_0x57c36a['query'][_0x0aa8('0x22')]));_0x109d72[_0x0aa8('0x23')]=_0x109d72['attributes'][_0x0aa8('0x24')]?_0x109d72[_0x0aa8('0x23')]:_0x134c2e[_0x0aa8('0x1e')];if(!_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x25')](_0x0aa8('0x26'))){_0x109d72[_0x0aa8('0xc')]=qs[_0x0aa8('0xc')](_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0xc')]);_0x109d72[_0x0aa8('0xa')]=qs['offset'](_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0xa')]);}_0x109d72['order']=qs[_0x0aa8('0x27')](_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x27')]);_0x109d72[_0x0aa8('0x28')]=qs[_0x0aa8('0x29')](_[_0x0aa8('0x2a')](_0x57c36a[_0x0aa8('0x1f')],_0x134c2e[_0x0aa8('0x29')]),_0x1ef9c9);if(_0x57c36a['query'][_0x0aa8('0x2b')]){_0x109d72[_0x0aa8('0x28')]=_[_0x0aa8('0x2c')](_0x109d72['where'],{'$or':_[_0x0aa8('0x19')](_0x1ef9c9,function(_0x2af270){if(_0x2af270['type']!=='VIRTUAL'){var _0x123ecf={};_0x123ecf[_0x2af270[_0x0aa8('0x16')]]={'$like':'%'+_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x2b')]+'%'};return _0x123ecf;}})});}_0x109d72=_[_0x0aa8('0x2c')]({},_0x109d72,_0x57c36a[_0x0aa8('0x2d')]);var _0x48eaf2={'where':_0x109d72[_0x0aa8('0x28')]};return db[_0x0aa8('0x1a')][_0x0aa8('0xd')](_0x48eaf2)['then'](function(_0x10b5de){_0x5d0262[_0x0aa8('0xd')]=_0x10b5de;if(_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x2e')]){_0x109d72[_0x0aa8('0x2f')]=[{'all':!![]}];}return db[_0x0aa8('0x1a')][_0x0aa8('0x30')](_0x109d72);})[_0x0aa8('0x11')](function(_0x417051){_0x5d0262[_0x0aa8('0x31')]=_[_0x0aa8('0x19')](_0x417051,function(_0x1684cb){if(_0x1684cb[_0x0aa8('0x32')]==='MicrosoftAzure'){var _0x1db669=encryptor[_0x0aa8('0x33')](_0x1684cb['data3']);_0x1684cb[_0x0aa8('0x34')]=maskClientSecret(_0x1db669);}return _0x1684cb;});return _0x5d0262;})[_0x0aa8('0x11')](respondWithFilteredResult(_0x5b4685,_0x109d72))[_0x0aa8('0x35')](handleError(_0x5b4685,null));};exports[_0x0aa8('0x36')]=function(_0x57f299,_0x208026){var _0x19b46e={'raw':!![],'where':{'id':_0x57f299['params']['id']}},_0x53ec36={};_0x53ec36[_0x0aa8('0x1e')]=_[_0x0aa8('0x20')](db['CloudProvider'][_0x0aa8('0x37')]);_0x53ec36['query']=_[_0x0aa8('0x20')](_0x57f299[_0x0aa8('0x1f')]);_0x53ec36[_0x0aa8('0x29')]=_[_0x0aa8('0x21')](_0x53ec36['model'],_0x53ec36[_0x0aa8('0x1f')]);_0x19b46e[_0x0aa8('0x23')]=_[_0x0aa8('0x21')](_0x53ec36[_0x0aa8('0x1e')],qs[_0x0aa8('0x22')](_0x57f299[_0x0aa8('0x1f')]['fields']));_0x19b46e[_0x0aa8('0x23')]=_0x19b46e['attributes'][_0x0aa8('0x24')]?_0x19b46e[_0x0aa8('0x23')]:_0x53ec36[_0x0aa8('0x1e')];if(_0x57f299[_0x0aa8('0x1f')]['includeAll']){_0x19b46e['include']=[{'all':!![]}];}_0x19b46e=_[_0x0aa8('0x2c')]({},_0x19b46e,_0x57f299[_0x0aa8('0x2d')]);return db[_0x0aa8('0x1a')][_0x0aa8('0x38')](_0x19b46e)[_0x0aa8('0x11')](handleEntityNotFound(_0x208026,null))[_0x0aa8('0x11')](function(_0x1d32ad){if(_0x1d32ad[_0x0aa8('0x32')]===_0x0aa8('0x39')){var _0x3b8e60=encryptor['decryptString'](_0x1d32ad['data3']);_0x1d32ad['data3']=maskClientSecret(_0x3b8e60);}return _0x1d32ad;})[_0x0aa8('0x11')](respondWithResult(_0x208026,null))[_0x0aa8('0x35')](handleError(_0x208026,null));};exports[_0x0aa8('0x3a')]=function(_0x475c2a,_0x54661a){if(!_0x475c2a[_0x0aa8('0x3b')]['name'])throw new Error(_0x0aa8('0x3c'));if(!_0x475c2a[_0x0aa8('0x3b')]['service'])throw new Error(_0x0aa8('0x3d'));var _0x238bb1=db[_0x0aa8('0x1a')]['rawAttributes']['service'][_0x0aa8('0x3e')];if(!_0x238bb1[_0x0aa8('0x3f')](_0x475c2a[_0x0aa8('0x3b')][_0x0aa8('0x32')]))throw new Error(_0x0aa8('0x40')+_0x238bb1[_0x0aa8('0x41')](',\x20'));if(_0x475c2a[_0x0aa8('0x3b')][_0x0aa8('0x32')]===_0x0aa8('0x39')&&_0x475c2a[_0x0aa8('0x3b')][_0x0aa8('0x34')]){_0x475c2a['body'][_0x0aa8('0x34')]=encryptor[_0x0aa8('0x42')](_0x475c2a['body'][_0x0aa8('0x34')]);}return db['CloudProvider'][_0x0aa8('0x3a')](_0x475c2a[_0x0aa8('0x3b')],{})[_0x0aa8('0x11')](respondWithResult(_0x54661a,0xc9))[_0x0aa8('0x35')](handleError(_0x54661a,null));};exports[_0x0aa8('0x10')]=function(_0x4efb32,_0x30165a){if(_0x4efb32['body']['id']){delete _0x4efb32[_0x0aa8('0x3b')]['id'];}return db[_0x0aa8('0x1a')]['find']({'where':{'id':_0x4efb32[_0x0aa8('0x43')]['id']}})[_0x0aa8('0x11')](handleEntityNotFound(_0x30165a,null))[_0x0aa8('0x11')](function(_0x116ecb){if(_0x116ecb['service']===_0x0aa8('0x39')&&_0x4efb32['body'][_0x0aa8('0x34')]){_0x4efb32[_0x0aa8('0x3b')][_0x0aa8('0x34')]=encryptor[_0x0aa8('0x42')](_0x4efb32['body'][_0x0aa8('0x34')]);}return _0x116ecb;})[_0x0aa8('0x11')](saveUpdates(_0x4efb32['body'],null))[_0x0aa8('0x11')](respondWithResult(_0x30165a,null))[_0x0aa8('0x35')](handleError(_0x30165a,null));};exports[_0x0aa8('0x12')]=function(_0x5724b1,_0x53dda7){return db['CloudProvider']['find']({'where':{'id':_0x5724b1[_0x0aa8('0x43')]['id']}})['then'](handleEntityNotFound(_0x53dda7,null))[_0x0aa8('0x11')](removeEntity(_0x53dda7,null))[_0x0aa8('0x35')](handleError(_0x53dda7,null));};exports[_0x0aa8('0x44')]=function(_0x20d6c8,_0x4c38ee){return db['CloudProvider'][_0x0aa8('0x45')]({'where':{'id':_0x20d6c8[_0x0aa8('0x43')]['id']},'raw':!![]})[_0x0aa8('0x11')](function(_0x15e861){if(!_0x15e861)return _0x4c38ee[_0x0aa8('0x14')](0x194);return{'url':oauth[_0x0aa8('0x46')](_0x15e861,_0x20d6c8[_0x0aa8('0x47')]['id'])};})[_0x0aa8('0x11')](respondWithResult(_0x4c38ee,null))[_0x0aa8('0x35')](handleError(_0x4c38ee,null));};exports[_0x0aa8('0x48')]=function(_0x562609,_0x3fd1d3){var _0x53048c=_0x562609[_0x0aa8('0x3b')];var _0x415602;var _0x272a34;if(_0x53048c['error'])throw _0x53048c;redis['get'](_0x53048c[_0x0aa8('0x49')])[_0x0aa8('0x11')](function(_0x39a3f0){if(!_0x39a3f0)throw new Error(_0x0aa8('0x4a'));_0x415602=JSON['parse'](_0x39a3f0);var _0x270680=Buffer[_0x0aa8('0x4b')](_0x53048c[_0x0aa8('0x49')],_0x0aa8('0x4c'))[_0x0aa8('0x4d')](_0x0aa8('0x4e'));_0x272a34=JSON['parse'](_0x270680);if(!oauth[_0x0aa8('0x4f')](_0x53048c['id_token'],_0x415602[_0x0aa8('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x0aa8('0x51')](_0x53048c[_0x0aa8('0x49')]);return oauth[_0x0aa8('0x52')](_0x53048c[_0x0aa8('0x53')],_0x415602);})['then'](function(_0x3ca306){_0x415602[_0x0aa8('0x54')]=_0x3ca306[_0x0aa8('0x55')];_0x415602[_0x0aa8('0x56')]=_0x3ca306[_0x0aa8('0x57')];return db['CloudProvider']['update']({'data5':_0x415602['data5'],'data6':_0x415602[_0x0aa8('0x56')]},{'where':{'id':_0x415602['id']}});})[_0x0aa8('0x11')](function(){oauth[_0x0aa8('0x58')](_0x415602);socket[_0x0aa8('0x59')](_0x0aa8('0x5a'),{'id':_0x272a34['id']});return;})[_0x0aa8('0x11')](respondWithStatusCode(_0x3fd1d3,null))[_0x0aa8('0x35')](function(_0x352466){if(_0x272a34){socket[_0x0aa8('0x59')](_0x0aa8('0x5b'),{'id':_0x272a34['id']});}if(!_0x415602){logger[_0x0aa8('0x15')](_0x0aa8('0x5c'),_0x352466);return _0x3fd1d3[_0x0aa8('0x9')](0x1f4)['send'](_0x352466[_0x0aa8('0x5d')]);}logger[_0x0aa8('0x15')](_0x0aa8('0x5e'),_0x415602['id'],JSON[_0x0aa8('0x5f')](_0x352466));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f4b9443..7402aa0 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 _0x4baf=['define','CloudProvider','cloud_providers','lodash','api','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4baf,0x1d9));var _0xf4ba=function(_0x69a354,_0x2e75a0){_0x69a354=_0x69a354-0x0;var _0x18c30a=_0x4baf[_0x69a354];return _0x18c30a;};'use strict';var _=require(_0xf4ba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf4ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ba('0x2'));var rimraf=require(_0xf4ba('0x3'));var config=require(_0xf4ba('0x4'));var attributes=require(_0xf4ba('0x5'));module[_0xf4ba('0x6')]=function(_0x544595,_0x45a2f9){return _0x544595[_0xf4ba('0x7')](_0xf4ba('0x8'),attributes,{'tableName':_0xf4ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39c0=['cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider'];(function(_0x3b80c0,_0x48642f){var _0x5e497a=function(_0x5ca4eb){while(--_0x5ca4eb){_0x3b80c0['push'](_0x3b80c0['shift']());}};_0x5e497a(++_0x48642f);}(_0x39c0,0x10b));var _0x039c=function(_0x3d3b5d,_0x2deb32){_0x3d3b5d=_0x3d3b5d-0x0;var _0x147b76=_0x39c0[_0x3d3b5d];return _0x147b76;};'use strict';var _=require(_0x039c('0x0'));var util=require(_0x039c('0x1'));var logger=require(_0x039c('0x2'))(_0x039c('0x3'));var moment=require(_0x039c('0x4'));var BPromise=require(_0x039c('0x5'));var rp=require(_0x039c('0x6'));var fs=require('fs');var path=require(_0x039c('0x7'));var rimraf=require(_0x039c('0x8'));var config=require(_0x039c('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x039c('0xa')]=function(_0x37182d,_0x25c52d){return _0x37182d[_0x039c('0xb')](_0x039c('0xc'),attributes,{'tableName':_0x039c('0xd'),'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 bce74e3..53e9356 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 _0xf719=['code','id_token','toString','randomBytes','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','stringify','decode','payload','iss','issuer','audience','isAfter','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','POST','access_token','update','data5','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','all','inspect','error','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf719,0x11c));var _0x9f71=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xf719[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x9f71('0x0'));var crypto=require(_0x9f71('0x1'));var jwt=require(_0x9f71('0x2'));var moment=require(_0x9f71('0x3'));var Redis=require(_0x9f71('0x4'));var rp=require(_0x9f71('0x5'));var util=require(_0x9f71('0x6'));var encryptor=require(_0x9f71('0x7'));var config=require('../../config/environment');var logger=require(_0x9f71('0x8'))(_0x9f71('0x9'));var schedule=require(_0x9f71('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9f71('0xb')](config[_0x9f71('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x9f71('0xc')]);var MICROSOFT_AUTH_URL=_0x9f71('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9f71('0xe'),_0x9f71('0xf'),_0x9f71('0x10'),_0x9f71('0x11'),_0x9f71('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x9f71('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x9f71('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x12c7ae){var _0x57858e=_[_0x9f71('0x15')](AZURE_AUTH_SCOPES[_0x12c7ae['type']]);if(_0x12c7ae[_0x9f71('0x16')]===_0x9f71('0x17'))_0x57858e[_0x9f71('0x18')](_0x12c7ae[_0x9f71('0x19')]+_0x9f71('0x1a'));return _0x57858e[_0x9f71('0x1b')]('\x20');}function getAccessTokenScope(_0x40f634){if(_0x40f634['type']===_0x9f71('0x1c'))return _0x9f71('0x11');if(_0x40f634[_0x9f71('0x16')]==='Dynamics365')return _0x40f634[_0x9f71('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x35c71a,_0x4f20e1){var _0x5c1dfb=MICROSOFT_AUTH_URL[_0x9f71('0x1d')](_0x9f71('0x1e'),_0x35c71a[_0x9f71('0x1f')]);var _0x46fe40=[_0x9f71('0x20'),_0x9f71('0x21')];var _0xcec2dd=Buffer['from'](JSON['stringify']({'id':_0x4f20e1}))[_0x9f71('0x22')]('base64');var _0x27bb1a=crypto[_0x9f71('0x23')](0x10)[_0x9f71('0x22')]('hex');var _0x37f8da=getAuthorizationScopes(_0x35c71a);var _0x49ea59=[{'key':'client_id','value':_0x35c71a[_0x9f71('0x24')]},{'key':_0x9f71('0x25'),'value':encodeURIComponent(_0x46fe40['join']('\x20'))},{'key':_0x9f71('0x26'),'value':_0x35c71a[_0x9f71('0x27')]},{'key':_0x9f71('0x28'),'value':_0x9f71('0x29')},{'key':'scope','value':encodeURIComponent(_0x37f8da)},{'key':_0x9f71('0x2a'),'value':_0xcec2dd},{'key':_0x9f71('0x2b'),'value':_0x27bb1a},{'key':_0x9f71('0x2c'),'value':_0x9f71('0x2d')}];var _0x3a8b0=_0x5c1dfb+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x49ea59,function(_0x27927c){return _0x27927c[_0x9f71('0x2e')]+'='+_0x27927c[_0x9f71('0x2f')];})[_0x9f71('0x1b')]('&');_0x35c71a[_0x9f71('0x30')]={'issuer':_0x5c1dfb[_0x9f71('0x1d')](_0x9f71('0x31'),''),'audience':_0x35c71a[_0x9f71('0x24')],'state':_0xcec2dd,'nonce':_0x27bb1a};redis[_0x9f71('0x32')](_0xcec2dd,JSON[_0x9f71('0x33')](_0x35c71a));return _0x3a8b0;}function isValidIdToken(_0xaba088,_0x3a7d57){try{var _0x37091f=jwt[_0x9f71('0x34')](_0xaba088,{'complete':!![]});var _0xc68ec8=_0x37091f[_0x9f71('0x35')];if(_0xc68ec8[_0x9f71('0x36')]!==_0x3a7d57[_0x9f71('0x37')])return![];if(_0xc68ec8['aud']!==_0x3a7d57[_0x9f71('0x38')])return![];if(_0xc68ec8[_0x9f71('0x2b')]!==_0x3a7d57[_0x9f71('0x2b')])return![];if(moment()[_0x9f71('0x39')](moment['unix'](_0xc68ec8['exp'])))return![];return!![];}catch(_0x48bcbd){throw _0x48bcbd;}}function refreshOauth2MicrosoftAccessToken(_0x11491c){return Promise[_0x9f71('0x3a')]()[_0x9f71('0x3b')](function(){if(_0x11491c[_0x9f71('0x3c')])return _0x11491c;return db[_0x9f71('0x3d')][_0x9f71('0x3e')]({'where':{'id':_0x11491c['id']},'raw':!![]});})['then'](function(_0x474bcf){var _0x1c2764={'grant_type':_0x9f71('0x3f'),'refresh_token':_0x474bcf[_0x9f71('0x40')],'scope':getAccessTokenScope(_0x474bcf),'redirect_uri':_0x474bcf[_0x9f71('0x27')],'client_id':_0x474bcf[_0x9f71('0x24')],'client_secret':encryptor['decryptString'](_0x474bcf['data3'])};var _0xad25f9={'method':_0x9f71('0x41'),'uri':MICROSOFT_AUTH_URL['replace'](_0x9f71('0x1e'),_0x474bcf['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1c2764,'json':!![]};return rp(_0xad25f9);})['then'](function(_0x48d9d1){_0x11491c['data5']=_0x48d9d1[_0x9f71('0x42')];_0x11491c[_0x9f71('0x40')]=_0x48d9d1[_0x9f71('0x3f')];return db[_0x9f71('0x3d')][_0x9f71('0x43')]({'data5':_0x11491c[_0x9f71('0x44')],'data6':_0x11491c[_0x9f71('0x40')]},{'where':{'id':_0x11491c['id']}});})[_0x9f71('0x3b')](function(){return _0x11491c;})[_0x9f71('0x45')](function(_0x4e7b02){logger['error'](_0x9f71('0x46'),_0x11491c['id'],_0x4e7b02);});}function getOauth2MicrosoftAccessToken(_0x531e20,_0x368016){var _0x261b02={'grant_type':_0x9f71('0x47'),'code':_0x531e20,'scope':getAccessTokenScope(_0x368016),'redirect_uri':_0x368016['data4'],'client_id':_0x368016[_0x9f71('0x24')],'client_secret':encryptor[_0x9f71('0x48')](_0x368016[_0x9f71('0x3c')])};var _0x4d347c={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x9f71('0x1e'),_0x368016['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x261b02,'json':!![]};return rp(_0x4d347c);}function startRefreshInterval(_0x4f3467){var _0x4dc3f4=schedule[_0x9f71('0x49')];if(_0x4dc3f4[_0x4f3467['id']])clearInterval(_0x4dc3f4[_0x4f3467['id']]);_0x4dc3f4[_0x4f3467['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9f71('0x4a')](this,{'id':_0x4f3467['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9f71('0x49')]=_0x4dc3f4;}function startAllRefreshIntervals(){return db[_0x9f71('0x3d')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9f71('0x3b')](function(_0x22dac2){var _0x5bae28=_0x22dac2[_0x9f71('0x15')](function(_0x3676ee){return refreshOauth2MicrosoftAccessToken(_0x3676ee)[_0x9f71('0x3b')](function(_0x543cbd){startRefreshInterval(_0x543cbd);});});return Promise[_0x9f71('0x4b')](_0x5bae28);})[_0x9f71('0x45')](function(_0x4c01fe){var _0x43fae2=_0x4c01fe?util[_0x9f71('0x4c')](_0x4c01fe,{'showHidden':![],'depth':null}):'';logger[_0x9f71('0x4d')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x43fae2);});}module[_0x9f71('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1dcc=['code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','join','data4','form_post','state','login','key','value','set','decode','issuer','aud','audience','nonce','isAfter','exp','resolve','then','data3','findOne','refresh_token','decryptString','POST','data2','data5','access_token','data6','CloudProvider','update','catch','error','authorization_code','intervals','bind','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','/.default','Outlook365','Dynamics365','replace','{TENANT_ID}'];(function(_0x1c3c09,_0x5ed170){var _0x28a78e=function(_0x43d486){while(--_0x43d486){_0x1c3c09['push'](_0x1c3c09['shift']());}};_0x28a78e(++_0x5ed170);}(_0x1dcc,0x79));var _0xc1dc=function(_0x5c0251,_0xc32d67){_0x5c0251=_0x5c0251-0x0;var _0x3fe699=_0x1dcc[_0x5c0251];return _0x3fe699;};'use strict';var _=require(_0xc1dc('0x0'));var crypto=require('crypto');var jwt=require(_0xc1dc('0x1'));var moment=require(_0xc1dc('0x2'));var Redis=require('ioredis');var rp=require(_0xc1dc('0x3'));var util=require(_0xc1dc('0x4'));var encryptor=require(_0xc1dc('0x5'));var config=require(_0xc1dc('0x6'));var logger=require('../../config/logger')(_0xc1dc('0x7'));var schedule=require(_0xc1dc('0x8'));var db=require('../../mysqldb')['db'];config[_0xc1dc('0x9')]=_[_0xc1dc('0xa')](config[_0xc1dc('0x9')],{'host':_0xc1dc('0xb'),'port':0x18eb});var redis=new Redis(config[_0xc1dc('0x9')]);var MICROSOFT_AUTH_URL=_0xc1dc('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xc1dc('0xd'),'profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xc1dc('0xe'),_0xc1dc('0xf')],'Dynamics365':[_0xc1dc('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xc1dc('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0xc1dc('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d503e){var _0x44a348=_[_0xc1dc('0x12')](AZURE_AUTH_SCOPES[_0x2d503e['type']]);if(_0x2d503e[_0xc1dc('0x13')]==='Dynamics365')_0x44a348[_0xc1dc('0x14')](_0x2d503e[_0xc1dc('0x15')]+_0xc1dc('0x16'));return _0x44a348['join']('\x20');}function getAccessTokenScope(_0x572cdb){if(_0x572cdb[_0xc1dc('0x13')]===_0xc1dc('0x17'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x572cdb[_0xc1dc('0x13')]===_0xc1dc('0x18'))return _0x572cdb[_0xc1dc('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x489ed2,_0x1750a5){var _0x40bf64=MICROSOFT_AUTH_URL[_0xc1dc('0x19')](_0xc1dc('0x1a'),_0x489ed2['data2']);var _0x424c3f=[_0xc1dc('0x1b'),_0xc1dc('0x1c')];var _0x41f31c=Buffer[_0xc1dc('0x1d')](JSON[_0xc1dc('0x1e')]({'id':_0x1750a5}))['toString'](_0xc1dc('0x1f'));var _0x2803a8=crypto[_0xc1dc('0x20')](0x10)[_0xc1dc('0x21')](_0xc1dc('0x22'));var _0x22a689=getAuthorizationScopes(_0x489ed2);var _0x1949a5=[{'key':_0xc1dc('0x23'),'value':_0x489ed2[_0xc1dc('0x24')]},{'key':_0xc1dc('0x25'),'value':encodeURIComponent(_0x424c3f[_0xc1dc('0x26')]('\x20'))},{'key':'redirect_uri','value':_0x489ed2[_0xc1dc('0x27')]},{'key':'response_mode','value':_0xc1dc('0x28')},{'key':'scope','value':encodeURIComponent(_0x22a689)},{'key':_0xc1dc('0x29'),'value':_0x41f31c},{'key':'nonce','value':_0x2803a8},{'key':'prompt','value':_0xc1dc('0x2a')}];var _0x3a3479=_0x40bf64+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1949a5,function(_0x1f6d64){return _0x1f6d64[_0xc1dc('0x2b')]+'='+_0x1f6d64[_0xc1dc('0x2c')];})[_0xc1dc('0x26')]('&');_0x489ed2['oauth2Claims']={'issuer':_0x40bf64['replace']('oauth2/',''),'audience':_0x489ed2[_0xc1dc('0x24')],'state':_0x41f31c,'nonce':_0x2803a8};redis[_0xc1dc('0x2d')](_0x41f31c,JSON[_0xc1dc('0x1e')](_0x489ed2));return _0x3a3479;}function isValidIdToken(_0x3aa0b2,_0x49a9a9){try{var _0x1b8993=jwt[_0xc1dc('0x2e')](_0x3aa0b2,{'complete':!![]});var _0x59bc61=_0x1b8993['payload'];if(_0x59bc61['iss']!==_0x49a9a9[_0xc1dc('0x2f')])return![];if(_0x59bc61[_0xc1dc('0x30')]!==_0x49a9a9[_0xc1dc('0x31')])return![];if(_0x59bc61['nonce']!==_0x49a9a9[_0xc1dc('0x32')])return![];if(moment()[_0xc1dc('0x33')](moment['unix'](_0x59bc61[_0xc1dc('0x34')])))return![];return!![];}catch(_0x1d12ac){throw _0x1d12ac;}}function refreshOauth2MicrosoftAccessToken(_0x43a699){return Promise[_0xc1dc('0x35')]()[_0xc1dc('0x36')](function(){if(_0x43a699[_0xc1dc('0x37')])return _0x43a699;return db['CloudProvider'][_0xc1dc('0x38')]({'where':{'id':_0x43a699['id']},'raw':!![]});})[_0xc1dc('0x36')](function(_0x5cff2f){var _0x3f0c78={'grant_type':_0xc1dc('0x39'),'refresh_token':_0x5cff2f['data6'],'scope':getAccessTokenScope(_0x5cff2f),'redirect_uri':_0x5cff2f[_0xc1dc('0x27')],'client_id':_0x5cff2f[_0xc1dc('0x24')],'client_secret':encryptor[_0xc1dc('0x3a')](_0x5cff2f[_0xc1dc('0x37')])};var _0x3e8cd3={'method':_0xc1dc('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xc1dc('0x19')](_0xc1dc('0x1a'),_0x5cff2f[_0xc1dc('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f0c78,'json':!![]};return rp(_0x3e8cd3);})[_0xc1dc('0x36')](function(_0x2810dc){_0x43a699[_0xc1dc('0x3d')]=_0x2810dc[_0xc1dc('0x3e')];_0x43a699[_0xc1dc('0x3f')]=_0x2810dc[_0xc1dc('0x39')];return db[_0xc1dc('0x40')][_0xc1dc('0x41')]({'data5':_0x43a699[_0xc1dc('0x3d')],'data6':_0x43a699[_0xc1dc('0x3f')]},{'where':{'id':_0x43a699['id']}});})['then'](function(){return _0x43a699;})[_0xc1dc('0x42')](function(_0x1a03b1){logger[_0xc1dc('0x43')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x43a699['id'],_0x1a03b1);});}function getOauth2MicrosoftAccessToken(_0x5d0ae4,_0x4e1387){var _0x302826={'grant_type':_0xc1dc('0x44'),'code':_0x5d0ae4,'scope':getAccessTokenScope(_0x4e1387),'redirect_uri':_0x4e1387[_0xc1dc('0x27')],'client_id':_0x4e1387[_0xc1dc('0x24')],'client_secret':encryptor['decryptString'](_0x4e1387[_0xc1dc('0x37')])};var _0x2c6dcf={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xc1dc('0x19')]('{TENANT_ID}',_0x4e1387['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x302826,'json':!![]};return rp(_0x2c6dcf);}function startRefreshInterval(_0x24d756){var _0x723f3e=schedule[_0xc1dc('0x45')];if(_0x723f3e[_0x24d756['id']])clearInterval(_0x723f3e[_0x24d756['id']]);_0x723f3e[_0x24d756['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc1dc('0x46')](this,{'id':_0x24d756['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc1dc('0x45')]=_0x723f3e;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xc1dc('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc1dc('0x36')](function(_0x27a87b){var _0x573c74=_0x27a87b[_0xc1dc('0x12')](function(_0x4d0340){return refreshOauth2MicrosoftAccessToken(_0x4d0340)['then'](function(_0x36d173){startRefreshInterval(_0x36d173);});});return Promise['all'](_0x573c74);})[_0xc1dc('0x42')](function(_0x9f7ed8){var _0x391a05=_0x9f7ed8?util[_0xc1dc('0x48')](_0x9f7ed8,{'showHidden':![],'depth':null}):'';logger['error'](_0xc1dc('0x49'),_0x391a05);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 4eea749..caa51bd 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 _0x471a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x471a,0x18d));var _0xa471=function(_0xa31086,_0xdc718a){_0xa31086=_0xa31086-0x0;var _0x732df0=_0x471a[_0xa31086];return _0x732df0;};'use strict';var _=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var moment=require(_0xa471('0x2'));var BPromise=require('bluebird');var rs=require(_0xa471('0x3'));var fs=require('fs');var Redis=require(_0xa471('0x4'));var db=require(_0xa471('0x5'))['db'];var utils=require(_0xa471('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa471('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5eb32c,_0x310613,_0x233b28){return new BPromise(function(_0x25f238,_0x50c1c4){return client[_0xa471('0x8')](_0x5eb32c,_0x233b28)['then'](function(_0x5b0a2b){logger[_0xa471('0x9')](_0xa471('0xa'),_0x310613,_0xa471('0xb'));logger[_0xa471('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x310613,_0xa471('0xb'),JSON[_0xa471('0xd')](_0x5b0a2b));if(_0x5b0a2b[_0xa471('0xe')]){if(_0x5b0a2b[_0xa471('0xe')][_0xa471('0xf')]===0x1f4){logger[_0xa471('0xe')]('CloudProvider,\x20%s,\x20%s',_0x310613,_0x5b0a2b[_0xa471('0xe')]['message']);return _0x50c1c4(_0x5b0a2b[_0xa471('0xe')]['message']);}logger[_0xa471('0xe')](_0xa471('0xa'),_0x310613,_0x5b0a2b[_0xa471('0xe')][_0xa471('0x10')]);return _0x25f238(_0x5b0a2b[_0xa471('0xe')][_0xa471('0x10')]);}else{logger['info'](_0xa471('0xa'),_0x310613,_0xa471('0xb'));_0x25f238(_0x5b0a2b[_0xa471('0x11')][_0xa471('0x10')]);}})[_0xa471('0x12')](function(_0x5730c3){logger[_0xa471('0xe')](_0xa471('0xa'),_0x310613,_0x5730c3);_0x50c1c4(_0x5730c3);});});} \ No newline at end of file +var _0x36fe=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then'];(function(_0x381080,_0x2ed325){var _0x529ae7=function(_0x3e8197){while(--_0x3e8197){_0x381080['push'](_0x381080['shift']());}};_0x529ae7(++_0x2ed325);}(_0x36fe,0x127));var _0xe36f=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x36fe[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var moment=require(_0xe36f('0x2'));var BPromise=require(_0xe36f('0x3'));var rs=require(_0xe36f('0x4'));var fs=require('fs');var Redis=require(_0xe36f('0x5'));var db=require(_0xe36f('0x6'))['db'];var utils=require(_0xe36f('0x7'));var logger=require(_0xe36f('0x8'))(_0xe36f('0x9'));var config=require(_0xe36f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x349c9e,_0xdae131,_0x5a0d3c){return new BPromise(function(_0x1ecd6b,_0x21f2a5){return client['request'](_0x349c9e,_0x5a0d3c)[_0xe36f('0xc')](function(_0x386c00){logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,_0xe36f('0xf'));logger['debug'](_0xe36f('0x10'),_0xdae131,'request\x20sent',JSON[_0xe36f('0x11')](_0x386c00));if(_0x386c00[_0xe36f('0x12')]){if(_0x386c00[_0xe36f('0x12')]['code']===0x1f4){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x386c00['error'][_0xe36f('0x13')]);return _0x21f2a5(_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);}logger[_0xe36f('0x12')]('CloudProvider,\x20%s,\x20%s',_0xdae131,_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);return _0x1ecd6b(_0x386c00[_0xe36f('0x12')]['message']);}else{logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,'request\x20sent');_0x1ecd6b(_0x386c00[_0xe36f('0x14')][_0xe36f('0x13')]);}})[_0xe36f('0x15')](function(_0x3f8f9f){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x3f8f9f);_0x21f2a5(_0x3f8f9f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 46a2920..a408557 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x1261,0x144));var _0x1126=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x1261[_0x51674a];return _0x13fca6;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x5f2f,0x73));var _0xf5f2=function(_0x23e1f6,_0x3b658f){_0x23e1f6=_0x23e1f6-0x0;var _0x33de91=_0x5f2f[_0x23e1f6];return _0x33de91;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index f124ff1..98c1175 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 _0xce1b=['STRING','sequelize','exports'];(function(_0x507056,_0xe16b72){var _0x4eaecc=function(_0x440b91){while(--_0x440b91){_0x507056['push'](_0x507056['shift']());}};_0x4eaecc(++_0xe16b72);}(_0xce1b,0x151));var _0xbce1=function(_0x2402d5,_0x37a7d5){_0x2402d5=_0x2402d5-0x0;var _0x103053=_0xce1b[_0x2402d5];return _0x103053;};'use strict';var Sequelize=require(_0xbce1('0x0'));module[_0xbce1('0x1')]={'name':{'type':Sequelize[_0xbce1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbce1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xbce1('0x2')]},'fax':{'type':Sequelize[_0xbce1('0x2')]},'type':{'type':Sequelize[_0xbce1('0x2')]},'street':{'type':Sequelize[_0xbce1('0x2')]},'postalCode':{'type':Sequelize[_0xbce1('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbce1('0x2')]},'email':{'type':Sequelize[_0xbce1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbce1('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xbce1('0x2')]},'sCountry':{'type':Sequelize[_0xbce1('0x2')]},'description':{'type':Sequelize[_0xbce1('0x2')]}}; \ No newline at end of file +var _0x0d1a=['sequelize','exports','STRING'];(function(_0x1562a3,_0x2c6cad){var _0x58476f=function(_0x225512){while(--_0x225512){_0x1562a3['push'](_0x1562a3['shift']());}};_0x58476f(++_0x2c6cad);}(_0x0d1a,0x1e6));var _0xa0d1=function(_0x933730,_0x197943){_0x933730=_0x933730-0x0;var _0x5543e1=_0x0d1a[_0x933730];return _0x5543e1;};'use strict';var Sequelize=require(_0xa0d1('0x0'));module[_0xa0d1('0x1')]={'name':{'type':Sequelize[_0xa0d1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa0d1('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xa0d1('0x2')]},'phone':{'type':Sequelize[_0xa0d1('0x2')]},'fax':{'type':Sequelize[_0xa0d1('0x2')]},'type':{'type':Sequelize[_0xa0d1('0x2')]},'street':{'type':Sequelize[_0xa0d1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa0d1('0x2')]},'country':{'type':Sequelize[_0xa0d1('0x2')]},'email':{'type':Sequelize[_0xa0d1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa0d1('0x2')]},'sStreet':{'type':Sequelize[_0xa0d1('0x2')]},'sPostalCode':{'type':Sequelize[_0xa0d1('0x2')]},'sCity':{'type':Sequelize[_0xa0d1('0x2')]},'sCountry':{'type':Sequelize[_0xa0d1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index b9a3817..11e9b9a 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 _0x5257=['fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','map','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','CmContact','pick','getContacts','eml-format','zip-dir'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5257,0x1ac));var _0x7525=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x5257[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0x7525('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7525('0x1'));var jsonpatch=require(_0x7525('0x2'));var rp=require('request-promise');var moment=require(_0x7525('0x3'));var BPromise=require(_0x7525('0x4'));var Mustache=require(_0x7525('0x5'));var util=require(_0x7525('0x6'));var path=require('path');var sox=require(_0x7525('0x7'));var csv=require(_0x7525('0x8'));var ejs=require(_0x7525('0x9'));var fs=require('fs');var fs_extra=require(_0x7525('0xa'));var _=require(_0x7525('0xb'));var squel=require(_0x7525('0xc'));var crypto=require(_0x7525('0xd'));var jsforce=require(_0x7525('0xe'));var deskjs=require(_0x7525('0xf'));var toCsv=require(_0x7525('0x8'));var querystring=require('querystring');var Papa=require(_0x7525('0x10'));var Redis=require(_0x7525('0x11'));var authService=require(_0x7525('0x12'));var qs=require(_0x7525('0x13'));var as=require(_0x7525('0x14'));var hardwareService=require(_0x7525('0x15'));var logger=require(_0x7525('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7525('0x17'));var licenseUtil=require(_0x7525('0x18'));var db=require(_0x7525('0x19'))['db'];function respondWithStatusCode(_0x257def,_0x389011){_0x389011=_0x389011||0xcc;return function(_0x2adbe5){if(_0x2adbe5){return _0x257def['sendStatus'](_0x389011);}return _0x257def[_0x7525('0x1a')](_0x389011)[_0x7525('0x1b')]();};}function respondWithResult(_0x20f54d,_0x3bbf28){_0x3bbf28=_0x3bbf28||0xc8;return function(_0x129cc5){if(_0x129cc5){return _0x20f54d[_0x7525('0x1a')](_0x3bbf28)[_0x7525('0x1c')](_0x129cc5);}};}function respondWithFilteredResult(_0x19a26b,_0x373f1d){return function(_0x5686d9){if(_0x5686d9){var _0x5036a5=typeof _0x373f1d['offset']===_0x7525('0x1d')&&typeof _0x373f1d[_0x7525('0x1e')]===_0x7525('0x1d');var _0x3cf76a=_0x5686d9[_0x7525('0x1f')];var _0x2881c1=_0x5036a5?0x0:_0x373f1d[_0x7525('0x20')];var _0x325298=_0x5036a5?_0x5686d9[_0x7525('0x1f')]:_0x373f1d[_0x7525('0x20')]+_0x373f1d[_0x7525('0x1e')];var _0xe43945;if(_0x325298>=_0x3cf76a){_0x325298=_0x3cf76a;_0xe43945=0xc8;}else{_0xe43945=0xce;}_0x19a26b[_0x7525('0x1a')](_0xe43945);return _0x19a26b['set'](_0x7525('0x21'),_0x2881c1+'-'+_0x325298+'/'+_0x3cf76a)[_0x7525('0x1c')](_0x5686d9);}return null;};}function patchUpdates(_0x2074da){return function(_0x198b72){try{jsonpatch[_0x7525('0x22')](_0x198b72,_0x2074da,!![]);}catch(_0x366512){return BPromise['reject'](_0x366512);}return _0x198b72[_0x7525('0x23')]();};}function saveUpdates(_0x4ee82a,_0x370f17){return function(_0x88ad8f){if(_0x88ad8f){return _0x88ad8f[_0x7525('0x24')](_0x4ee82a)[_0x7525('0x25')](function(_0x2077db){return _0x2077db;});}return null;};}function removeEntity(_0x53ceba,_0x62ce76){return function(_0x55fced){if(_0x55fced){return _0x55fced[_0x7525('0x26')]()['then'](function(){var _0x376a21=_0x55fced[_0x7525('0x27')]({'plain':!![]});var _0x2be39c=_0x7525('0x28');return db['UserProfileResource'][_0x7525('0x26')]({'where':{'type':_0x2be39c,'resourceId':_0x376a21['id']}})[_0x7525('0x25')](function(){return _0x55fced;});})['then'](function(){_0x53ceba[_0x7525('0x1a')](0xcc)[_0x7525('0x1b')]();});}};}function handleEntityNotFound(_0x107e68,_0x4abb8b){return function(_0x49abf1){if(!_0x49abf1){_0x107e68[_0x7525('0x29')](0x194);}return _0x49abf1;};}function handleError(_0x5cc8b4,_0x1e16c3){_0x1e16c3=_0x1e16c3||0x1f4;return function(_0x127474){logger[_0x7525('0x2a')](_0x127474[_0x7525('0x2b')]);if(_0x127474['name']){delete _0x127474[_0x7525('0x2c')];}_0x5cc8b4[_0x7525('0x1a')](_0x1e16c3)[_0x7525('0x2d')](_0x127474);};}exports[_0x7525('0x2e')]=function(_0x3888f3,_0x3b1698){var _0x1fec70={},_0x3f5068={},_0x225f44={'count':0x0,'rows':[]};return db[_0x7525('0x2f')][_0x7525('0x30')]()[_0x7525('0x25')](function(_0x315c73){_0x3f5068['model']=_[_0x7525('0x31')](_0x315c73);_0x3f5068[_0x7525('0x32')]=_[_0x7525('0x31')](_0x3888f3['query']);_0x3f5068['filters']=_['intersection'](_0x3f5068[_0x7525('0x33')],_0x3f5068['query']);_0x1fec70[_0x7525('0x34')]=_[_0x7525('0x35')](_0x3f5068[_0x7525('0x33')],qs[_0x7525('0x36')](_0x3888f3[_0x7525('0x32')][_0x7525('0x36')]));_0x1fec70[_0x7525('0x34')]=_0x1fec70[_0x7525('0x34')][_0x7525('0x37')]?_0x1fec70[_0x7525('0x34')]:_0x3f5068[_0x7525('0x33')];if(!_0x3888f3['query'][_0x7525('0x38')](_0x7525('0x39'))){_0x1fec70['limit']=qs[_0x7525('0x1e')](_0x3888f3[_0x7525('0x32')][_0x7525('0x1e')]);_0x1fec70[_0x7525('0x20')]=qs['offset'](_0x3888f3[_0x7525('0x32')]['offset']);}_0x1fec70['order']=qs['sort'](_0x3888f3['query'][_0x7525('0x3a')]);_0x1fec70[_0x7525('0x3b')]=qs['filters'](_['pick'](_0x3888f3[_0x7525('0x32')],_0x3f5068[_0x7525('0x3c')]),_0x315c73);if(_0x3888f3[_0x7525('0x32')]['filter']){_0x1fec70[_0x7525('0x3b')]=_[_0x7525('0x3d')](_0x1fec70[_0x7525('0x3b')],{'$or':_[_0x7525('0x3e')](_0x1fec70[_0x7525('0x34')],function(_0x36674b){var _0x301114={};_0x301114[_0x36674b]={'$like':'%'+_0x3888f3[_0x7525('0x32')][_0x7525('0x3f')]+'%'};return _0x301114;})});}_0x1fec70=_[_0x7525('0x3d')]({},_0x1fec70,_0x3888f3[_0x7525('0x40')]);var _0x47e3ba={'where':_0x1fec70[_0x7525('0x3b')]};return db['CmCompany'][_0x7525('0x1f')](_0x47e3ba)[_0x7525('0x25')](function(_0x387382){_0x225f44[_0x7525('0x1f')]=_0x387382;if(_0x3888f3['query'][_0x7525('0x41')]){_0x1fec70[_0x7525('0x42')]=[{'all':!![]}];}return db[_0x7525('0x2f')][_0x7525('0x43')](_0x1fec70);})['then'](function(_0xbe8e7a){_0x225f44[_0x7525('0x44')]=_0xbe8e7a;return _0x225f44;})['then'](respondWithFilteredResult(_0x3b1698,_0x1fec70))[_0x7525('0x45')](handleError(_0x3b1698,null));})['catch'](handleError(_0x3b1698,null));};exports['show']=function(_0x1d97c9,_0x1ad51a){var _0x4b61b7={'raw':![],'where':{'id':_0x1d97c9[_0x7525('0x46')]['id']}},_0x485644={};_0x485644[_0x7525('0x33')]=_[_0x7525('0x31')](db['CmCompany'][_0x7525('0x47')]);_0x485644['query']=_[_0x7525('0x31')](_0x1d97c9[_0x7525('0x32')]);_0x485644[_0x7525('0x3c')]=_[_0x7525('0x35')](_0x485644['model'],_0x485644[_0x7525('0x32')]);_0x4b61b7[_0x7525('0x34')]=_[_0x7525('0x35')](_0x485644['model'],qs['fields'](_0x1d97c9['query']['fields']));_0x4b61b7['attributes']=_0x4b61b7[_0x7525('0x34')][_0x7525('0x37')]?_0x4b61b7[_0x7525('0x34')]:_0x485644['model'];if(_0x1d97c9['query'][_0x7525('0x41')]){_0x4b61b7[_0x7525('0x42')]=[{'all':!![]}];}_0x4b61b7=_[_0x7525('0x3d')]({},_0x4b61b7,_0x1d97c9[_0x7525('0x40')]);return db[_0x7525('0x2f')][_0x7525('0x48')](_0x4b61b7)[_0x7525('0x25')](handleEntityNotFound(_0x1ad51a,null))[_0x7525('0x25')](respondWithResult(_0x1ad51a,null))[_0x7525('0x45')](handleError(_0x1ad51a,null));};exports['create']=function(_0x910a50,_0x5231dd){return db[_0x7525('0x2f')][_0x7525('0x49')](_0x910a50[_0x7525('0x4a')],{})[_0x7525('0x25')](function(_0x173593){var _0x1bad46=_0x910a50[_0x7525('0x4b')][_0x7525('0x27')]({'plain':!![]});if(!_0x1bad46)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bad46[_0x7525('0x4c')]==='user'){var _0x44ad6e=_0x173593[_0x7525('0x27')]({'plain':!![]});var _0x2c1729=_0x7525('0x28');return db['UserProfileSection'][_0x7525('0x48')]({'where':{'name':_0x2c1729,'userProfileId':_0x1bad46['userProfileId']},'raw':!![]})['then'](function(_0x3bfe06){if(_0x3bfe06&&_0x3bfe06[_0x7525('0x4d')]===0x0){return db[_0x7525('0x4e')][_0x7525('0x49')]({'name':_0x44ad6e['name'],'resourceId':_0x44ad6e['id'],'type':_0x3bfe06[_0x7525('0x2c')],'sectionId':_0x3bfe06['id']},{})[_0x7525('0x25')](function(){return _0x173593;});}else{return _0x173593;}})[_0x7525('0x45')](function(_0x290511){logger[_0x7525('0x2a')](_0x7525('0x4f'),_0x290511);throw _0x290511;});}return _0x173593;})['then'](respondWithResult(_0x5231dd,0xc9))[_0x7525('0x45')](handleError(_0x5231dd,null));};exports[_0x7525('0x24')]=function(_0x434c62,_0x485717){if(_0x434c62[_0x7525('0x4a')]['id']){delete _0x434c62[_0x7525('0x4a')]['id'];}return db[_0x7525('0x2f')][_0x7525('0x48')]({'where':{'id':_0x434c62[_0x7525('0x46')]['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x485717,null))['then'](saveUpdates(_0x434c62[_0x7525('0x4a')],null))[_0x7525('0x25')](respondWithResult(_0x485717,null))[_0x7525('0x45')](handleError(_0x485717,null));};exports[_0x7525('0x26')]=function(_0x55c825,_0x3fd650){return db[_0x7525('0x2f')]['find']({'where':{'id':_0x55c825['params']['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x3fd650,null))[_0x7525('0x25')](removeEntity(_0x3fd650,null))[_0x7525('0x45')](handleError(_0x3fd650,null));};exports[_0x7525('0x30')]=function(_0x4d147a,_0x17870f){return db[_0x7525('0x2f')][_0x7525('0x30')]()[_0x7525('0x25')](respondWithResult(_0x17870f,null))['catch'](handleError(_0x17870f,null));};exports['addContacts']=function(_0x1b489c,_0x19de97,_0x3f1480){return db['CmContact']['find']({'where':{'id':_0x1b489c[_0x7525('0x46')]['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x19de97,null))[_0x7525('0x25')](function(_0x6bc388){if(_0x6bc388){return _0x6bc388[_0x7525('0x50')](_0x1b489c[_0x7525('0x4a')][_0x7525('0x51')],_[_0x7525('0x52')](_0x1b489c[_0x7525('0x4a')],[_0x7525('0x51'),'id'])||{});}})[_0x7525('0x25')](respondWithResult(_0x19de97,null))[_0x7525('0x45')](handleError(_0x19de97,null));};exports['getContacts']=function(_0x246fce,_0x415ac9,_0x35ac31){var _0x36ed3a={};var _0x35ef41={};var _0x547dc0;var _0x13430a;return db[_0x7525('0x2f')]['findOne']({'where':{'id':_0x246fce[_0x7525('0x46')]['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x415ac9,null))[_0x7525('0x25')](function(_0x587e2e){if(_0x587e2e){_0x547dc0=_0x587e2e;_0x35ef41[_0x7525('0x33')]=_['keys'](db[_0x7525('0x53')][_0x7525('0x47')]);_0x35ef41[_0x7525('0x32')]=_[_0x7525('0x31')](_0x246fce[_0x7525('0x32')]);_0x35ef41[_0x7525('0x3c')]=_[_0x7525('0x35')](_0x35ef41[_0x7525('0x33')],_0x35ef41[_0x7525('0x32')]);_0x36ed3a[_0x7525('0x34')]=_[_0x7525('0x35')](_0x35ef41[_0x7525('0x33')],qs[_0x7525('0x36')](_0x246fce[_0x7525('0x32')]['fields']));_0x36ed3a[_0x7525('0x34')]=_0x36ed3a[_0x7525('0x34')]['length']?_0x36ed3a['attributes']:_0x35ef41[_0x7525('0x33')];_0x36ed3a['order']=qs[_0x7525('0x3a')](_0x246fce['query'][_0x7525('0x3a')]);_0x36ed3a[_0x7525('0x3b')]=qs['filters'](_[_0x7525('0x54')](_0x246fce[_0x7525('0x32')],_0x35ef41[_0x7525('0x3c')]));if(_0x246fce['query']['filter']){_0x36ed3a[_0x7525('0x3b')]=_[_0x7525('0x3d')](_0x36ed3a['where'],{'$or':_[_0x7525('0x3e')](_0x36ed3a[_0x7525('0x34')],function(_0x127431){var _0x2072cf={};_0x2072cf[_0x127431]={'$like':'%'+_0x246fce[_0x7525('0x32')][_0x7525('0x3f')]+'%'};return _0x2072cf;})});}_0x36ed3a=_[_0x7525('0x3d')]({},_0x36ed3a,_0x246fce[_0x7525('0x40')]);return _0x547dc0[_0x7525('0x55')](_0x36ed3a);}})[_0x7525('0x25')](function(_0x28dc1a){if(_0x28dc1a){_0x13430a=_0x28dc1a[_0x7525('0x37')];if(!_0x246fce['query'][_0x7525('0x38')](_0x7525('0x39'))){_0x36ed3a[_0x7525('0x1e')]=qs[_0x7525('0x1e')](_0x246fce['query']['limit']);_0x36ed3a[_0x7525('0x20')]=qs[_0x7525('0x20')](_0x246fce[_0x7525('0x32')][_0x7525('0x20')]);}return _0x547dc0['getContacts'](_0x36ed3a);}})[_0x7525('0x25')](function(_0x15aab8){if(_0x15aab8){return _0x15aab8?{'count':_0x13430a,'rows':_0x15aab8}:null;}})[_0x7525('0x25')](respondWithResult(_0x415ac9,null))[_0x7525('0x45')](handleError(_0x415ac9,null));}; \ No newline at end of file +var _0xe06e=['sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','CmContact','omit','ids','getContacts','findOne','map','nolimit','rimraf','request-promise','bluebird','mustache','util','path'];(function(_0x2e6859,_0xc33939){var _0x6077ab=function(_0x3d63ec){while(--_0x3d63ec){_0x2e6859['push'](_0x2e6859['shift']());}};_0x6077ab(++_0xc33939);}(_0xe06e,0x98));var _0xee06=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0xe06e[_0x5bf2b3];return _0x5e8a9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee06('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xee06('0x1'));var moment=require('moment');var BPromise=require(_0xee06('0x2'));var Mustache=require(_0xee06('0x3'));var util=require(_0xee06('0x4'));var path=require(_0xee06('0x5'));var sox=require(_0xee06('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee06('0x7'));var squel=require(_0xee06('0x8'));var crypto=require('crypto');var jsforce=require(_0xee06('0x9'));var deskjs=require(_0xee06('0xa'));var toCsv=require('to-csv');var querystring=require(_0xee06('0xb'));var Papa=require(_0xee06('0xc'));var Redis=require(_0xee06('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xee06('0xe'));var as=require(_0xee06('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee06('0x10'))('api');var utils=require(_0xee06('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xee06('0x12'));var db=require(_0xee06('0x13'))['db'];function respondWithStatusCode(_0x4b27c4,_0x1281ee){_0x1281ee=_0x1281ee||0xcc;return function(_0x2cb778){if(_0x2cb778){return _0x4b27c4[_0xee06('0x14')](_0x1281ee);}return _0x4b27c4['status'](_0x1281ee)[_0xee06('0x15')]();};}function respondWithResult(_0x5c24df,_0x390694){_0x390694=_0x390694||0xc8;return function(_0x1aa41e){if(_0x1aa41e){return _0x5c24df[_0xee06('0x16')](_0x390694)['json'](_0x1aa41e);}};}function respondWithFilteredResult(_0x1d91de,_0xb86363){return function(_0x1fae04){if(_0x1fae04){var _0x3a42bf=typeof _0xb86363['offset']==='undefined'&&typeof _0xb86363[_0xee06('0x17')]==='undefined';var _0x36b559=_0x1fae04[_0xee06('0x18')];var _0x4c6f9c=_0x3a42bf?0x0:_0xb86363[_0xee06('0x19')];var _0x545d9f=_0x3a42bf?_0x1fae04[_0xee06('0x18')]:_0xb86363['offset']+_0xb86363[_0xee06('0x17')];var _0x3665bc;if(_0x545d9f>=_0x36b559){_0x545d9f=_0x36b559;_0x3665bc=0xc8;}else{_0x3665bc=0xce;}_0x1d91de[_0xee06('0x16')](_0x3665bc);return _0x1d91de['set'](_0xee06('0x1a'),_0x4c6f9c+'-'+_0x545d9f+'/'+_0x36b559)[_0xee06('0x1b')](_0x1fae04);}return null;};}function patchUpdates(_0x54f6bc){return function(_0x329d21){try{jsonpatch[_0xee06('0x1c')](_0x329d21,_0x54f6bc,!![]);}catch(_0x3a7851){return BPromise['reject'](_0x3a7851);}return _0x329d21[_0xee06('0x1d')]();};}function saveUpdates(_0x48bb57,_0x1023b6){return function(_0x57cb8e){if(_0x57cb8e){return _0x57cb8e[_0xee06('0x1e')](_0x48bb57)[_0xee06('0x1f')](function(_0x106500){return _0x106500;});}return null;};}function removeEntity(_0x16f3b4,_0x34e9a9){return function(_0x489e31){if(_0x489e31){return _0x489e31[_0xee06('0x20')]()['then'](function(){var _0x3ae4b2=_0x489e31[_0xee06('0x21')]({'plain':!![]});var _0x395338=_0xee06('0x22');return db[_0xee06('0x23')][_0xee06('0x20')]({'where':{'type':_0x395338,'resourceId':_0x3ae4b2['id']}})['then'](function(){return _0x489e31;});})['then'](function(){_0x16f3b4[_0xee06('0x16')](0xcc)[_0xee06('0x15')]();});}};}function handleEntityNotFound(_0x2369ef,_0x5c897b){return function(_0x16f506){if(!_0x16f506){_0x2369ef[_0xee06('0x14')](0x194);}return _0x16f506;};}function handleError(_0x2232ff,_0x5c29c5){_0x5c29c5=_0x5c29c5||0x1f4;return function(_0x23e1fb){logger[_0xee06('0x24')](_0x23e1fb[_0xee06('0x25')]);if(_0x23e1fb[_0xee06('0x26')]){delete _0x23e1fb[_0xee06('0x26')];}_0x2232ff[_0xee06('0x16')](_0x5c29c5)[_0xee06('0x27')](_0x23e1fb);};}exports['index']=function(_0x1cf26c,_0x436596){var _0x320e29={},_0x3fa44b={},_0x1e5382={'count':0x0,'rows':[]};return db[_0xee06('0x28')][_0xee06('0x29')]()[_0xee06('0x1f')](function(_0x12b866){_0x3fa44b[_0xee06('0x2a')]=_[_0xee06('0x2b')](_0x12b866);_0x3fa44b[_0xee06('0x2c')]=_[_0xee06('0x2b')](_0x1cf26c[_0xee06('0x2c')]);_0x3fa44b[_0xee06('0x2d')]=_['intersection'](_0x3fa44b[_0xee06('0x2a')],_0x3fa44b['query']);_0x320e29[_0xee06('0x2e')]=_[_0xee06('0x2f')](_0x3fa44b[_0xee06('0x2a')],qs[_0xee06('0x30')](_0x1cf26c['query'][_0xee06('0x30')]));_0x320e29[_0xee06('0x2e')]=_0x320e29[_0xee06('0x2e')]['length']?_0x320e29[_0xee06('0x2e')]:_0x3fa44b['model'];if(!_0x1cf26c[_0xee06('0x2c')][_0xee06('0x31')]('nolimit')){_0x320e29[_0xee06('0x17')]=qs[_0xee06('0x17')](_0x1cf26c[_0xee06('0x2c')][_0xee06('0x17')]);_0x320e29[_0xee06('0x19')]=qs[_0xee06('0x19')](_0x1cf26c[_0xee06('0x2c')][_0xee06('0x19')]);}_0x320e29[_0xee06('0x32')]=qs[_0xee06('0x33')](_0x1cf26c[_0xee06('0x2c')]['sort']);_0x320e29[_0xee06('0x34')]=qs[_0xee06('0x2d')](_[_0xee06('0x35')](_0x1cf26c['query'],_0x3fa44b[_0xee06('0x2d')]),_0x12b866);if(_0x1cf26c['query'][_0xee06('0x36')]){_0x320e29['where']=_[_0xee06('0x37')](_0x320e29['where'],{'$or':_['map'](_0x320e29[_0xee06('0x2e')],function(_0x8e8a0b){var _0xcd3e0f={};_0xcd3e0f[_0x8e8a0b]={'$like':'%'+_0x1cf26c[_0xee06('0x2c')][_0xee06('0x36')]+'%'};return _0xcd3e0f;})});}_0x320e29=_[_0xee06('0x37')]({},_0x320e29,_0x1cf26c[_0xee06('0x38')]);var _0x383ce2={'where':_0x320e29[_0xee06('0x34')]};return db[_0xee06('0x28')]['count'](_0x383ce2)['then'](function(_0x4635a9){_0x1e5382['count']=_0x4635a9;if(_0x1cf26c[_0xee06('0x2c')][_0xee06('0x39')]){_0x320e29[_0xee06('0x3a')]=[{'all':!![]}];}return db[_0xee06('0x28')]['findAll'](_0x320e29);})['then'](function(_0x5badcf){_0x1e5382['rows']=_0x5badcf;return _0x1e5382;})[_0xee06('0x1f')](respondWithFilteredResult(_0x436596,_0x320e29))[_0xee06('0x3b')](handleError(_0x436596,null));})[_0xee06('0x3b')](handleError(_0x436596,null));};exports[_0xee06('0x3c')]=function(_0xba88d7,_0x32c6f7){var _0x33a6c3={'raw':![],'where':{'id':_0xba88d7[_0xee06('0x3d')]['id']}},_0x4af1df={};_0x4af1df['model']=_['keys'](db[_0xee06('0x28')][_0xee06('0x3e')]);_0x4af1df[_0xee06('0x2c')]=_[_0xee06('0x2b')](_0xba88d7[_0xee06('0x2c')]);_0x4af1df[_0xee06('0x2d')]=_[_0xee06('0x2f')](_0x4af1df[_0xee06('0x2a')],_0x4af1df[_0xee06('0x2c')]);_0x33a6c3[_0xee06('0x2e')]=_[_0xee06('0x2f')](_0x4af1df[_0xee06('0x2a')],qs['fields'](_0xba88d7[_0xee06('0x2c')][_0xee06('0x30')]));_0x33a6c3[_0xee06('0x2e')]=_0x33a6c3[_0xee06('0x2e')][_0xee06('0x3f')]?_0x33a6c3[_0xee06('0x2e')]:_0x4af1df['model'];if(_0xba88d7['query'][_0xee06('0x39')]){_0x33a6c3[_0xee06('0x3a')]=[{'all':!![]}];}_0x33a6c3=_['merge']({},_0x33a6c3,_0xba88d7[_0xee06('0x38')]);return db[_0xee06('0x28')][_0xee06('0x40')](_0x33a6c3)[_0xee06('0x1f')](handleEntityNotFound(_0x32c6f7,null))['then'](respondWithResult(_0x32c6f7,null))['catch'](handleError(_0x32c6f7,null));};exports[_0xee06('0x41')]=function(_0x4626ac,_0x3055b6){return db[_0xee06('0x28')][_0xee06('0x41')](_0x4626ac[_0xee06('0x42')],{})[_0xee06('0x1f')](function(_0x1d0f82){var _0x3524ee=_0x4626ac[_0xee06('0x43')][_0xee06('0x21')]({'plain':!![]});if(!_0x3524ee)throw new Error(_0xee06('0x44'));if(_0x3524ee['role']===_0xee06('0x43')){var _0x59844c=_0x1d0f82['get']({'plain':!![]});var _0xdfdc94='Companies';return db[_0xee06('0x45')][_0xee06('0x40')]({'where':{'name':_0xdfdc94,'userProfileId':_0x3524ee[_0xee06('0x46')]},'raw':!![]})[_0xee06('0x1f')](function(_0x2ce0ea){if(_0x2ce0ea&&_0x2ce0ea[_0xee06('0x47')]===0x0){return db[_0xee06('0x23')][_0xee06('0x41')]({'name':_0x59844c['name'],'resourceId':_0x59844c['id'],'type':_0x2ce0ea[_0xee06('0x26')],'sectionId':_0x2ce0ea['id']},{})[_0xee06('0x1f')](function(){return _0x1d0f82;});}else{return _0x1d0f82;}})[_0xee06('0x3b')](function(_0x4bd131){logger[_0xee06('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bd131);throw _0x4bd131;});}return _0x1d0f82;})[_0xee06('0x1f')](respondWithResult(_0x3055b6,0xc9))[_0xee06('0x3b')](handleError(_0x3055b6,null));};exports[_0xee06('0x1e')]=function(_0x1bd580,_0x455a2f){if(_0x1bd580[_0xee06('0x42')]['id']){delete _0x1bd580[_0xee06('0x42')]['id'];}return db[_0xee06('0x28')][_0xee06('0x40')]({'where':{'id':_0x1bd580['params']['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x455a2f,null))[_0xee06('0x1f')](saveUpdates(_0x1bd580[_0xee06('0x42')],null))[_0xee06('0x1f')](respondWithResult(_0x455a2f,null))[_0xee06('0x3b')](handleError(_0x455a2f,null));};exports[_0xee06('0x20')]=function(_0xa569b3,_0x31fc5d){return db['CmCompany'][_0xee06('0x40')]({'where':{'id':_0xa569b3['params']['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x31fc5d,null))[_0xee06('0x1f')](removeEntity(_0x31fc5d,null))[_0xee06('0x3b')](handleError(_0x31fc5d,null));};exports[_0xee06('0x29')]=function(_0x5bfae6,_0x59d310){return db[_0xee06('0x28')][_0xee06('0x29')]()[_0xee06('0x1f')](respondWithResult(_0x59d310,null))['catch'](handleError(_0x59d310,null));};exports['addContacts']=function(_0x356dd2,_0x138564,_0x11b4f9){return db[_0xee06('0x48')]['find']({'where':{'id':_0x356dd2[_0xee06('0x3d')]['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x138564,null))[_0xee06('0x1f')](function(_0x5c6b05){if(_0x5c6b05){return _0x5c6b05['addContacts'](_0x356dd2[_0xee06('0x42')]['ids'],_[_0xee06('0x49')](_0x356dd2[_0xee06('0x42')],[_0xee06('0x4a'),'id'])||{});}})[_0xee06('0x1f')](respondWithResult(_0x138564,null))[_0xee06('0x3b')](handleError(_0x138564,null));};exports[_0xee06('0x4b')]=function(_0x5a8c45,_0x3d9b8b,_0xdd9dbc){var _0x578405={};var _0x570d1b={};var _0x98a245;var _0x4d37af;return db[_0xee06('0x28')][_0xee06('0x4c')]({'where':{'id':_0x5a8c45[_0xee06('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3d9b8b,null))[_0xee06('0x1f')](function(_0x42608d){if(_0x42608d){_0x98a245=_0x42608d;_0x570d1b[_0xee06('0x2a')]=_[_0xee06('0x2b')](db[_0xee06('0x48')][_0xee06('0x3e')]);_0x570d1b['query']=_[_0xee06('0x2b')](_0x5a8c45['query']);_0x570d1b[_0xee06('0x2d')]=_[_0xee06('0x2f')](_0x570d1b[_0xee06('0x2a')],_0x570d1b[_0xee06('0x2c')]);_0x578405[_0xee06('0x2e')]=_[_0xee06('0x2f')](_0x570d1b[_0xee06('0x2a')],qs[_0xee06('0x30')](_0x5a8c45[_0xee06('0x2c')][_0xee06('0x30')]));_0x578405[_0xee06('0x2e')]=_0x578405[_0xee06('0x2e')][_0xee06('0x3f')]?_0x578405['attributes']:_0x570d1b[_0xee06('0x2a')];_0x578405['order']=qs[_0xee06('0x33')](_0x5a8c45[_0xee06('0x2c')]['sort']);_0x578405[_0xee06('0x34')]=qs['filters'](_[_0xee06('0x35')](_0x5a8c45[_0xee06('0x2c')],_0x570d1b['filters']));if(_0x5a8c45[_0xee06('0x2c')][_0xee06('0x36')]){_0x578405[_0xee06('0x34')]=_[_0xee06('0x37')](_0x578405[_0xee06('0x34')],{'$or':_[_0xee06('0x4d')](_0x578405[_0xee06('0x2e')],function(_0x373b03){var _0x452049={};_0x452049[_0x373b03]={'$like':'%'+_0x5a8c45[_0xee06('0x2c')][_0xee06('0x36')]+'%'};return _0x452049;})});}_0x578405=_[_0xee06('0x37')]({},_0x578405,_0x5a8c45[_0xee06('0x38')]);return _0x98a245[_0xee06('0x4b')](_0x578405);}})['then'](function(_0x179622){if(_0x179622){_0x4d37af=_0x179622[_0xee06('0x3f')];if(!_0x5a8c45['query'][_0xee06('0x31')](_0xee06('0x4e'))){_0x578405[_0xee06('0x17')]=qs[_0xee06('0x17')](_0x5a8c45[_0xee06('0x2c')][_0xee06('0x17')]);_0x578405[_0xee06('0x19')]=qs['offset'](_0x5a8c45['query'][_0xee06('0x19')]);}return _0x98a245[_0xee06('0x4b')](_0x578405);}})[_0xee06('0x1f')](function(_0x422798){if(_0x422798){return _0x422798?{'count':_0x4d37af,'rows':_0x422798}:null;}})[_0xee06('0x1f')](respondWithResult(_0x3d9b8b,null))['catch'](handleError(_0x3d9b8b,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3fe282a..7103984 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 _0xa2a2=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','util','../../config/logger','moment'];(function(_0x3833c4,_0x24e37a){var _0x4d7c15=function(_0x54676c){while(--_0x54676c){_0x3833c4['push'](_0x3833c4['shift']());}};_0x4d7c15(++_0x24e37a);}(_0xa2a2,0x1dd));var _0x2a2a=function(_0x4a8cf1,_0x9e18ac){_0x4a8cf1=_0x4a8cf1-0x0;var _0x214bb2=_0xa2a2[_0x4a8cf1];return _0x214bb2;};'use strict';var _=require('lodash');var util=require(_0x2a2a('0x0'));var logger=require(_0x2a2a('0x1'))('api');var moment=require(_0x2a2a('0x2'));var BPromise=require(_0x2a2a('0x3'));var rp=require(_0x2a2a('0x4'));var fs=require('fs');var path=require(_0x2a2a('0x5'));var rimraf=require(_0x2a2a('0x6'));var config=require(_0x2a2a('0x7'));var attributes=require(_0x2a2a('0x8'));module['exports']=function(_0x5bac23,_0x11ee4a){return _0x5bac23[_0x2a2a('0x9')](_0x2a2a('0xa'),attributes,{'tableName':_0x2a2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc327=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x260468,_0x27498d){var _0x1f8c7f=function(_0x5ad4dd){while(--_0x5ad4dd){_0x260468['push'](_0x260468['shift']());}};_0x1f8c7f(++_0x27498d);}(_0xc327,0x1ac));var _0x7c32=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xc327[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x7c32('0x0'));var util=require(_0x7c32('0x1'));var logger=require(_0x7c32('0x2'))(_0x7c32('0x3'));var moment=require(_0x7c32('0x4'));var BPromise=require(_0x7c32('0x5'));var rp=require(_0x7c32('0x6'));var fs=require('fs');var path=require(_0x7c32('0x7'));var rimraf=require(_0x7c32('0x8'));var config=require(_0x7c32('0x9'));var attributes=require(_0x7c32('0xa'));module[_0x7c32('0xb')]=function(_0x1090c5,_0x118706){return _0x1090c5[_0x7c32('0xc')](_0x7c32('0xd'),attributes,{'tableName':'cm_companies','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 72978a1..01222e4 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 _0xae6a=['error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xae6a,0xeb));var _0xaae6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xae6a[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xaae6('0x0'));var util=require(_0xaae6('0x1'));var moment=require('moment');var BPromise=require(_0xaae6('0x2'));var rs=require(_0xaae6('0x3'));var fs=require('fs');var Redis=require(_0xaae6('0x4'));var db=require(_0xaae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaae6('0x6'))(_0xaae6('0x7'));var config=require('../../config/environment');var jayson=require(_0xaae6('0x8'));var client=jayson[_0xaae6('0x9')][_0xaae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0dc0,_0x4753b9,_0x4f91a1){return new BPromise(function(_0xdd6ded,_0x19807c){return client[_0xaae6('0xb')](_0x2e0dc0,_0x4f91a1)[_0xaae6('0xc')](function(_0x2049da){logger['info'](_0xaae6('0xd'),_0x4753b9,_0xaae6('0xe'));logger[_0xaae6('0xf')](_0xaae6('0x10'),_0x4753b9,_0xaae6('0xe'),JSON[_0xaae6('0x11')](_0x2049da));if(_0x2049da[_0xaae6('0x12')]){if(_0x2049da[_0xaae6('0x12')][_0xaae6('0x13')]===0x1f4){logger['error'](_0xaae6('0xd'),_0x4753b9,_0x2049da['error'][_0xaae6('0x14')]);return _0x19807c(_0x2049da[_0xaae6('0x12')]['message']);}logger[_0xaae6('0x12')](_0xaae6('0xd'),_0x4753b9,_0x2049da['error']['message']);return _0xdd6ded(_0x2049da[_0xaae6('0x12')][_0xaae6('0x14')]);}else{logger[_0xaae6('0x15')](_0xaae6('0xd'),_0x4753b9,_0xaae6('0xe'));_0xdd6ded(_0x2049da[_0xaae6('0x16')]['message']);}})['catch'](function(_0x21dacb){logger[_0xaae6('0x12')](_0xaae6('0xd'),_0x4753b9,_0x21dacb);_0x19807c(_0x21dacb);});});} \ No newline at end of file +var _0xd248=['../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x20ea5b,_0x663129){var _0x45c501=function(_0x10743d){while(--_0x10743d){_0x20ea5b['push'](_0x20ea5b['shift']());}};_0x45c501(++_0x663129);}(_0xd248,0xe9));var _0x8d24=function(_0x5627a2,_0x43c8ce){_0x5627a2=_0x5627a2-0x0;var _0x3f8e87=_0xd248[_0x5627a2];return _0x3f8e87;};'use strict';var _=require(_0x8d24('0x0'));var util=require(_0x8d24('0x1'));var moment=require(_0x8d24('0x2'));var BPromise=require(_0x8d24('0x3'));var rs=require(_0x8d24('0x4'));var fs=require('fs');var Redis=require(_0x8d24('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d24('0x6'));var logger=require(_0x8d24('0x7'))(_0x8d24('0x8'));var config=require(_0x8d24('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d24('0xa')][_0x8d24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f480d,_0xac1fa6,_0x15e272){return new BPromise(function(_0xbc5696,_0x3cea27){return client[_0x8d24('0xc')](_0x4f480d,_0x15e272)[_0x8d24('0xd')](function(_0x40eeb0){logger['info'](_0x8d24('0xe'),_0xac1fa6,_0x8d24('0xf'));logger[_0x8d24('0x10')](_0x8d24('0x11'),_0xac1fa6,_0x8d24('0xf'),JSON['stringify'](_0x40eeb0));if(_0x40eeb0[_0x8d24('0x12')]){if(_0x40eeb0[_0x8d24('0x12')][_0x8d24('0x13')]===0x1f4){logger[_0x8d24('0x12')](_0x8d24('0xe'),_0xac1fa6,_0x40eeb0[_0x8d24('0x12')][_0x8d24('0x14')]);return _0x3cea27(_0x40eeb0[_0x8d24('0x12')][_0x8d24('0x14')]);}logger['error'](_0x8d24('0xe'),_0xac1fa6,_0x40eeb0['error'][_0x8d24('0x14')]);return _0xbc5696(_0x40eeb0['error'][_0x8d24('0x14')]);}else{logger['info'](_0x8d24('0xe'),_0xac1fa6,_0x8d24('0xf'));_0xbc5696(_0x40eeb0['result']['message']);}})[_0x8d24('0x15')](function(_0x1b5d3d){logger['error'](_0x8d24('0xe'),_0xac1fa6,_0x1b5d3d);_0x3cea27(_0x1b5d3d);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index de67736..9e3ff0c 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 _0x7363=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/contacts','getContacts','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4a5946,_0x262f3a){var _0x3b7562=function(_0x1054e9){while(--_0x1054e9){_0x4a5946['push'](_0x4a5946['shift']());}};_0x3b7562(++_0x262f3a);}(_0x7363,0x1c8));var _0x3736=function(_0x37cb44,_0x117aa5){_0x37cb44=_0x37cb44-0x0;var _0x5c16e6=_0x7363[_0x37cb44];return _0x5c16e6;};'use strict';var multer=require(_0x3736('0x0'));var util=require(_0x3736('0x1'));var path=require(_0x3736('0x2'));var timeout=require(_0x3736('0x3'));var express=require(_0x3736('0x4'));var router=express['Router']();var fs_extra=require(_0x3736('0x5'));var auth=require(_0x3736('0x6'));var interaction=require(_0x3736('0x7'));var config=require(_0x3736('0x8'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x3736('0x9')](),controller['index']);router[_0x3736('0xa')]('/describe',auth[_0x3736('0x9')](),controller['describe']);router['get'](_0x3736('0xb'),auth[_0x3736('0x9')](),controller[_0x3736('0xc')]);router[_0x3736('0xa')](_0x3736('0xd'),auth[_0x3736('0x9')](),controller[_0x3736('0xe')]);router[_0x3736('0xf')]('/',auth[_0x3736('0x9')](),controller[_0x3736('0x10')]);router[_0x3736('0xf')](_0x3736('0xd'),auth[_0x3736('0x9')](),controller['addContacts']);router[_0x3736('0x11')]('/:id',auth[_0x3736('0x9')](),controller[_0x3736('0x12')]);router[_0x3736('0x13')](_0x3736('0xb'),auth[_0x3736('0x9')](),controller[_0x3736('0x14')]);module['exports']=router; \ No newline at end of file +var _0x82f7=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','delete','destroy'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x82f7,0x8b));var _0x782f=function(_0xe2f1bc,_0x4eb312){_0xe2f1bc=_0xe2f1bc-0x0;var _0x8cf39d=_0x82f7[_0xe2f1bc];return _0x8cf39d;};'use strict';var multer=require(_0x782f('0x0'));var util=require(_0x782f('0x1'));var path=require(_0x782f('0x2'));var timeout=require(_0x782f('0x3'));var express=require(_0x782f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x782f('0x5'));var interaction=require(_0x782f('0x6'));var config=require(_0x782f('0x7'));var controller=require(_0x782f('0x8'));router[_0x782f('0x9')]('/',auth['isAuthenticated'](),controller[_0x782f('0xa')]);router['get']('/describe',auth[_0x782f('0xb')](),controller[_0x782f('0xc')]);router['get'](_0x782f('0xd'),auth[_0x782f('0xb')](),controller[_0x782f('0xe')]);router['get'](_0x782f('0xf'),auth['isAuthenticated'](),controller[_0x782f('0x10')]);router[_0x782f('0x11')]('/',auth[_0x782f('0xb')](),controller['create']);router[_0x782f('0x11')](_0x782f('0xf'),auth['isAuthenticated'](),controller[_0x782f('0x12')]);router[_0x782f('0x13')](_0x782f('0xd'),auth[_0x782f('0xb')](),controller['update']);router[_0x782f('0x14')](_0x782f('0xd'),auth[_0x782f('0xb')](),controller[_0x782f('0x15')]);module[_0x782f('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 657dfa7..b012755 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 _0x9bc5=['STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x89ed41,_0xdae94b){var _0x159a10=function(_0x563697){while(--_0x563697){_0x89ed41['push'](_0x89ed41['shift']());}};_0x159a10(++_0xdae94b);}(_0x9bc5,0x1c2));var _0x59bc=function(_0x18ba79,_0x4c55ec){_0x18ba79=_0x18ba79-0x0;var _0xb208d2=_0x9bc5[_0x18ba79];return _0xb208d2;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x59bc('0x0')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x59bc('0x0')]},'description':{'type':Sequelize[_0x59bc('0x1')]},'phone':{'type':Sequelize[_0x59bc('0x0')]},'mobile':{'type':Sequelize[_0x59bc('0x0')]},'fax':{'type':Sequelize[_0x59bc('0x0')]},'email':{'type':Sequelize[_0x59bc('0x0')]},'url':{'type':Sequelize[_0x59bc('0x0')]},'facebook':{'type':Sequelize[_0x59bc('0x0')]},'fb_data':{'type':Sequelize[_0x59bc('0x0')]},'twitter':{'type':Sequelize[_0x59bc('0x0')]},'skype':{'type':Sequelize[_0x59bc('0x0')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x59bc('0x0')]},'line':{'type':Sequelize[_0x59bc('0x0')]},'wechat':{'type':Sequelize[_0x59bc('0x0')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x59bc('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x59bc('0x0')]},'priority':{'type':Sequelize[_0x59bc('0x2')](0x2)[_0x59bc('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x59bc('0x4')]},'dialTimezone':{'type':Sequelize[_0x59bc('0x0')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0291=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x3134c9,_0x5670c8){var _0x19b94a=function(_0x2c68de){while(--_0x2c68de){_0x3134c9['push'](_0x3134c9['shift']());}};_0x19b94a(++_0x5670c8);}(_0x0291,0xad));var _0x1029=function(_0x3bc179,_0x392c5b){_0x3bc179=_0x3bc179-0x0;var _0x25dfb4=_0x0291[_0x3bc179];return _0x25dfb4;};'use strict';var _=require(_0x1029('0x0'));var Sequelize=require(_0x1029('0x1'));module[_0x1029('0x2')]={'firstName':{'type':Sequelize[_0x1029('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1029('0x3')]},'street':{'type':Sequelize[_0x1029('0x3')]},'postalCode':{'type':Sequelize[_0x1029('0x3')]},'city':{'type':Sequelize[_0x1029('0x3')]},'country':{'type':Sequelize[_0x1029('0x3')]},'dateOfBirth':{'type':Sequelize[_0x1029('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1029('0x3')]},'mobile':{'type':Sequelize[_0x1029('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1029('0x3')]},'url':{'type':Sequelize[_0x1029('0x3')]},'facebook':{'type':Sequelize[_0x1029('0x3')]},'fb_data':{'type':Sequelize[_0x1029('0x3')]},'twitter':{'type':Sequelize[_0x1029('0x3')]},'skype':{'type':Sequelize[_0x1029('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1029('0x3')]},'line':{'type':Sequelize[_0x1029('0x3')]},'wechat':{'type':Sequelize[_0x1029('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1029('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x1029('0x3')]},'priority':{'type':Sequelize[_0x1029('0x4')](0x2)[_0x1029('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1029('0x6')],'defaultValue':Sequelize[_0x1029('0x7')]},'dialTimezone':{'type':Sequelize[_0x1029('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7b34145..fe2b568 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 _0x0b7c=['values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','update','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','tag','Phones','ItemType','sequelize','literal','$and','omit','map','cf_%d','find','pickBy','format','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','model','Tag','rawAttributes','filters','intersection','attributes','order','sort','pick','filter','options','hasOwnProperty','nolimit','setTags','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','bulkCreate','rescheduleAdditionalPhones','hopperId','getHoppers','fields','ContactId','includeAll','include','getHopperHistories','rows','getHopperFinals','getJscriptySessions','JscriptySessionReport','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','import','binding','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','User','agent','No\x20phone\x20column\x20specified','child_process','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','DESC','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','fullname','Tags','color','customerPort','osName','ratingMessage','ratingType','ratingValue','subject','substatus','externalUrl','threadId','Interaction','findAndCountAll','Owner','flatten','reverse','slice','moment','bluebird','path','lodash','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','destroy','then','error','stack','name','send','describe','getOptions','findAll','query','user','catch','CmContact','params','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','alias','custom','type'];(function(_0x33d365,_0xb09985){var _0x587f65=function(_0x1c49f1){while(--_0x1c49f1){_0x33d365['push'](_0x33d365['shift']());}};_0x587f65(++_0xb09985);}(_0x0b7c,0xd3));var _0xc0b7=function(_0x1081a3,_0x2ac784){_0x1081a3=_0x1081a3-0x0;var _0x5696a2=_0x0b7c[_0x1081a3];return _0x5696a2;};'use strict';var moment=require(_0xc0b7('0x0'));var BPromise=require(_0xc0b7('0x1'));var util=require('util');var path=require(_0xc0b7('0x2'));var fs=require('fs');var _=require(_0xc0b7('0x3'));var squel=require('squel');var Papa=require(_0xc0b7('0x4'));var Redis=require('ioredis');var contacts=require(_0xc0b7('0x5'));var qs=require(_0xc0b7('0x6'));var logger=require(_0xc0b7('0x7'))(_0xc0b7('0x8'));var config=require(_0xc0b7('0x9'));var shared=require(_0xc0b7('0xa'));var db=require('../../mysqldb')['db'];config[_0xc0b7('0xb')]=_[_0xc0b7('0xc')](config[_0xc0b7('0xb')],{'host':_0xc0b7('0xd'),'port':0x18eb});var socket=require(_0xc0b7('0xe'))(new Redis(config[_0xc0b7('0xb')]));require(_0xc0b7('0xf'))[_0xc0b7('0x10')](socket);function respondWithResult(_0x5f3d3b,_0x55d42f){_0x55d42f=_0x55d42f||0xc8;return function(_0x4fc92e){if(_0x4fc92e){return _0x5f3d3b[_0xc0b7('0x11')](_0x55d42f)[_0xc0b7('0x12')](_0x4fc92e);}};}function respondWithFilteredResult(_0x5bfcf8,_0x578853){return function(_0x12ffc3){if(_0x12ffc3){var _0x3ceb61=typeof _0x578853['offset']==='undefined'&&typeof _0x578853[_0xc0b7('0x13')]===_0xc0b7('0x14');var _0x5c8aac=_0x12ffc3[_0xc0b7('0x15')];var _0x387db8=_0x3ceb61?0x0:_0x578853[_0xc0b7('0x16')];var _0x5e53c8=_0x3ceb61?_0x12ffc3[_0xc0b7('0x15')]:_0x578853[_0xc0b7('0x16')]+_0x578853[_0xc0b7('0x13')];var _0x46f1d5;if(_0x5e53c8>=_0x5c8aac){_0x5e53c8=_0x5c8aac;_0x46f1d5=0xc8;}else{_0x46f1d5=0xce;}_0x5bfcf8[_0xc0b7('0x11')](_0x46f1d5);return _0x5bfcf8[_0xc0b7('0x17')](_0xc0b7('0x18'),_0x387db8+'-'+_0x5e53c8+'/'+_0x5c8aac)['json'](_0x12ffc3);}return null;};}function saveUpdates(_0x15e765){return function(_0x2dc40e){if(_0x2dc40e){return _0x2dc40e['update'](_0x15e765)['then'](function(_0x558b0d){return _0x558b0d;});}return null;};}function removeEntity(_0x45b60d){return function(_0x1578ce){if(_0x1578ce){return _0x1578ce[_0xc0b7('0x19')]()[_0xc0b7('0x1a')](function(){_0x45b60d[_0xc0b7('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b048a){return function(_0x141dec){if(!_0x141dec){_0x1b048a['sendStatus'](0x194);}return _0x141dec;};}function handleError(_0x19579c,_0x17c9fc){_0x17c9fc=_0x17c9fc||0x1f4;return function(_0x568fc6){logger[_0xc0b7('0x1b')](_0x568fc6[_0xc0b7('0x1c')]);if(_0x568fc6[_0xc0b7('0x1d')]){delete _0x568fc6['name'];}_0x19579c[_0xc0b7('0x11')](_0x17c9fc)[_0xc0b7('0x1e')](_0x568fc6);};}exports['index']=function(_0x19df0d,_0x3e70e3){var _0x4ca581={};return contacts[_0xc0b7('0x1f')]()[_0xc0b7('0x1a')](function(_0x3731dc){_0x4ca581=qs[_0xc0b7('0x20')](_0x3731dc,_0x19df0d);return contacts[_0xc0b7('0x21')](_0x19df0d[_0xc0b7('0x22')],_0x19df0d[_0xc0b7('0x23')],_0x4ca581,_0x3731dc);})[_0xc0b7('0x1a')](respondWithFilteredResult(_0x3e70e3,_0x4ca581))[_0xc0b7('0x24')](handleError(_0x3e70e3,null));};exports[_0xc0b7('0x19')]=function(_0x48ac3b,_0x1379d7){return db[_0xc0b7('0x25')]['find']({'where':{'id':_0x48ac3b[_0xc0b7('0x26')]['id']}})[_0xc0b7('0x1a')](handleEntityNotFound(_0x1379d7,null))[_0xc0b7('0x1a')](removeEntity(_0x1379d7,null))[_0xc0b7('0x24')](handleError(_0x1379d7,null));};exports[_0xc0b7('0x1f')]=function(_0x23ec59,_0x215325){return db['CmContact'][_0xc0b7('0x1f')]()[_0xc0b7('0x1a')](function(_0xda1c00){delete _0xda1c00['tags'];for(var _0x4abf78=0x0;_0x4abf780x0){return new Promise(function(_0x550aa0){var _0x2953a3=[];for(var _0x589cba=0x0;_0x589cba<_0x2ffca7[_0xc0b7('0x2d')];_0x589cba++){_0x2953a3[_0xc0b7('0x5d')](insertAdditionalPhones(_0x2ffca7[_0x589cba][_0xc0b7('0x61')],_0x2ffca7[_0x589cba][_0xc0b7('0x58')]));}Promise[_0xc0b7('0x62')](_0x2953a3)[_0xc0b7('0x1a')](function(){_0x550aa0(0x1);});})[_0xc0b7('0x1a')](function(){return{'success':_0x294537,'failure':_0xc16c8c,'duplicates':_0x2e58f5};});}else{return{'success':_0x294537,'failure':_0xc16c8c,'duplicates':_0x2e58f5};}}})['then'](respondWithResult(_0x4f5403,0xc9))[_0xc0b7('0x24')](handleError(_0x4f5403,null));};exports['show']=function(_0x343813,_0x5ea681){var _0xa34563;return db[_0xc0b7('0x25')][_0xc0b7('0x1f')]()[_0xc0b7('0x1a')](function(_0x222342){return db[_0xc0b7('0x25')]['find']({'where':{'id':_0x343813[_0xc0b7('0x26')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0xc0b7('0x1d'),'color'],'required':_0x343813[_0xc0b7('0x22')][_0xc0b7('0x63')]?!![]:![]},{'model':db[_0xc0b7('0x4b')],'as':_0xc0b7('0x64'),'where':{'CmContactId':_0x343813[_0xc0b7('0x26')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xc0b7('0x65')}]}],'order':[db[_0xc0b7('0x66')][_0xc0b7('0x67')]('Phones.OrderBy')],'attributes':_[_0xc0b7('0x27')](_0x222342)});})[_0xc0b7('0x1a')](function(_0x1440ab){if(!_['isNil'](_0x1440ab)){_0xa34563=_0x1440ab[_0xc0b7('0x36')]({'plain':!![]});var _0x534d0e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1440ab&&_0x1440ab[_0xc0b7('0x5e')]){if(_0x1440ab[_0xc0b7('0x5e')]){_0x534d0e[_0xc0b7('0x5b')][_0xc0b7('0x68')][_0xc0b7('0x5d')]({'ListId':{'$ne':_0x1440ab[_0xc0b7('0x5e')]}});}}return db[_0xc0b7('0x2c')][_0xc0b7('0x21')](_0x534d0e);}})[_0xc0b7('0x1a')](function(_0x4abd6a){if(!_[_0xc0b7('0x55')](_0x4abd6a)){return _[_0xc0b7('0x69')](_0xa34563,_[_0xc0b7('0x6a')](_0x4abd6a,function(_0x47f907){return util['format'](_0xc0b7('0x6b'),_0x47f907['id']);}));}})['then'](handleEntityNotFound(_0x5ea681,null))[_0xc0b7('0x1a')](respondWithResult(_0x5ea681,null))[_0xc0b7('0x24')](handleError(_0x5ea681,null));};exports['update']=function(_0x353e69,_0x4267f1){var _0x5bc4aa;if(_0x353e69[_0xc0b7('0x35')]['id']){delete _0x353e69[_0xc0b7('0x35')]['id'];}if(!_[_0xc0b7('0x55')](_0x353e69[_0xc0b7('0x35')][_0xc0b7('0x54')])){var _0x1e170a=_0x353e69[_0xc0b7('0x35')]['dialTimezone'];if(!_[_0xc0b7('0x55')](shared[_0xc0b7('0x56')][_0x1e170a]))_0x353e69['body'][_0xc0b7('0x57')]=shared[_0xc0b7('0x56')][_0x1e170a]['utcOffset'];}return db[_0xc0b7('0x25')][_0xc0b7('0x6c')]({'where':{'id':_0x353e69[_0xc0b7('0x26')]['id']}})[_0xc0b7('0x1a')](handleEntityNotFound(_0x4267f1,null))[_0xc0b7('0x1a')](saveUpdates(_0x353e69[_0xc0b7('0x35')],null))[_0xc0b7('0x1a')](function(_0x1241a4){_0x5bc4aa=_0x1241a4;var _0x2150c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1241a4&&_0x1241a4[_0xc0b7('0x5e')]){if(_0x1241a4[_0xc0b7('0x5e')]){_0x2150c7['where']['$and'][_0xc0b7('0x5d')]({'ListId':{'$ne':_0x1241a4[_0xc0b7('0x5e')]}});}}return db[_0xc0b7('0x2c')][_0xc0b7('0x21')](_0x2150c7);})[_0xc0b7('0x1a')](function(_0x3d7ee6){if(_0x3d7ee6){return _['omit'](_[_0xc0b7('0x6d')](_0x353e69[_0xc0b7('0x35')],function(_0x47ada8,_0x5d3302){return _['startsWith'](_0x5d3302,_0xc0b7('0x29'));}),_[_0xc0b7('0x6a')](_0x3d7ee6,function(_0x411749){return util[_0xc0b7('0x6e')]('cf_%d',_0x411749['id']);}));}})['then'](function(_0x594064){if(_0x594064&&!_[_0xc0b7('0x6f')](_0x594064)){var _0x28ad09=squel[_0xc0b7('0x45')]()[_0xc0b7('0x70')](_0xc0b7('0x71'))[_0xc0b7('0x72')](_0x594064)['where'](_0xc0b7('0x73'),_0x353e69[_0xc0b7('0x26')]['id'])[_0xc0b7('0x74')]();return db['sequelize']['query'](_0x28ad09['text'],{'replacements':_0x28ad09[_0xc0b7('0x31')]});}})[_0xc0b7('0x1a')](function(){if(_0x353e69[_0xc0b7('0x35')]['phone']&&_0x5bc4aa){return db[_0xc0b7('0x3e')][_0xc0b7('0x45')]({'phone':_0x353e69['body'][_0xc0b7('0x75')],'OrderBy':0x0},{'where':{'ContactId':_0x5bc4aa['id']}});}})['then'](function(){return _0x5bc4aa;})['then'](respondWithResult(_0x4267f1,null))[_0xc0b7('0x24')](handleError(_0x4267f1,null));};exports[_0xc0b7('0x76')]=function(_0x38ad6d,_0x1c38ff){var _0x3441bd={};var _0x292bec={};var _0x3d484a;var _0xfa85e;return db['CmContact'][_0xc0b7('0x77')]({'where':{'id':_0x38ad6d['params']['id']}})['then'](handleEntityNotFound(_0x1c38ff,null))[_0xc0b7('0x1a')](function(_0x1781cc){if(_0x1781cc){_0x3d484a=_0x1781cc;_0x292bec[_0xc0b7('0x78')]=_[_0xc0b7('0x27')](db[_0xc0b7('0x79')][_0xc0b7('0x7a')]);_0x292bec[_0xc0b7('0x22')]=_['keys'](_0x38ad6d['query']);_0x292bec[_0xc0b7('0x7b')]=_[_0xc0b7('0x7c')](_0x292bec['model'],_0x292bec[_0xc0b7('0x22')]);_0x3441bd[_0xc0b7('0x7d')]=_[_0xc0b7('0x7c')](_0x292bec[_0xc0b7('0x78')],qs['fields'](_0x38ad6d[_0xc0b7('0x22')]['fields']));_0x3441bd['attributes']=_0x3441bd['attributes']['length']?_0x3441bd[_0xc0b7('0x7d')]:_0x292bec[_0xc0b7('0x78')];_0x3441bd[_0xc0b7('0x7e')]=qs[_0xc0b7('0x7f')](_0x38ad6d[_0xc0b7('0x22')]['sort']);_0x3441bd[_0xc0b7('0x5b')]=qs['filters'](_[_0xc0b7('0x80')](_0x38ad6d[_0xc0b7('0x22')],_0x292bec[_0xc0b7('0x7b')]));if(_0x38ad6d[_0xc0b7('0x22')][_0xc0b7('0x81')]){_0x3441bd[_0xc0b7('0x5b')]=_[_0xc0b7('0x34')](_0x3441bd[_0xc0b7('0x5b')],{'$or':_[_0xc0b7('0x6a')](_0x3441bd['attributes'],function(_0xe1be27){var _0x51b0b3={};_0x51b0b3[_0xe1be27]={'$like':'%'+_0x38ad6d[_0xc0b7('0x22')][_0xc0b7('0x81')]+'%'};return _0x51b0b3;})});}_0x3441bd=_[_0xc0b7('0x34')]({},_0x3441bd,_0x38ad6d[_0xc0b7('0x82')]);return _0x3d484a[_0xc0b7('0x76')](_0x3441bd);}})[_0xc0b7('0x1a')](function(_0x34c8c8){if(_0x34c8c8){_0xfa85e=_0x34c8c8[_0xc0b7('0x2d')];if(!_0x38ad6d['query'][_0xc0b7('0x83')](_0xc0b7('0x84'))){_0x3441bd['limit']=qs[_0xc0b7('0x13')](_0x38ad6d['query']['limit']);_0x3441bd[_0xc0b7('0x16')]=qs[_0xc0b7('0x16')](_0x38ad6d[_0xc0b7('0x22')]['offset']);}return _0x3d484a['getTags'](_0x3441bd);}})[_0xc0b7('0x1a')](function(_0x5dfe8f){if(_0x5dfe8f){return _0x5dfe8f?{'count':_0xfa85e,'rows':_0x5dfe8f}:null;}})[_0xc0b7('0x1a')](respondWithResult(_0x1c38ff,null))['catch'](handleError(_0x1c38ff,null));};exports[_0xc0b7('0x85')]=function(_0x265e88,_0x4f0f9b){if(_0x265e88[_0xc0b7('0x35')]['id']){delete _0x265e88['body']['id'];}return db['CmContact'][_0xc0b7('0x77')]({'where':{'id':_0x265e88[_0xc0b7('0x26')]['id']}})[_0xc0b7('0x1a')](handleEntityNotFound(_0x4f0f9b,null))[_0xc0b7('0x1a')](function(_0x53ad6b){if(_0x53ad6b){return _0x53ad6b['setTags'](_0x265e88['body']['ids']||[]);}return null;})[_0xc0b7('0x1a')](respondWithResult(_0x4f0f9b,null))[_0xc0b7('0x24')](handleError(_0x4f0f9b,null));};exports[_0xc0b7('0x86')]=function(_0x3e87b0,_0x475d95){var _0x102d04=[];_0x102d04[_0xc0b7('0x5d')](addAdditionalPhones(_0x3e87b0['body']));Promise[_0xc0b7('0x62')](_0x102d04)[_0xc0b7('0x1a')](function(){_0x102d04=[];_0x102d04[_0xc0b7('0x5d')](deleteCmHopperPhones(_0x3e87b0['body']['id']));_0x102d04[_0xc0b7('0x5d')](addCmHopperPhones(_0x3e87b0['body']['id']));Promise[_0xc0b7('0x62')](_0x102d04)[_0xc0b7('0x1a')](function(){return[0x1];})[_0xc0b7('0x1a')](respondWithResult(_0x475d95,null));});};function addAdditionalPhones(_0x1cf0a4){var _0xb0b861;return new Promise(function(_0x366529){return db[_0xc0b7('0x4b')][_0xc0b7('0x19')]({'where':{'CmContactId':_0x1cf0a4['id']}})[_0xc0b7('0x1a')](function(){db[_0xc0b7('0x87')][_0xc0b7('0x21')]({'raw':!![],'attributes':['id',_0xc0b7('0x88')]})[_0xc0b7('0x1a')](function(_0x3515be){var _0x480843=[];for(var _0x566c4a=0x0;_0x566c4a<_0x1cf0a4[_0xc0b7('0x89')][_0xc0b7('0x2d')];_0x566c4a++){var _0x3ebe8a=_0x1cf0a4[_0xc0b7('0x8a')]?_[_0xc0b7('0x55')](_0x1cf0a4[_0xc0b7('0x8a')][_0x566c4a])?'':_0x1cf0a4[_0xc0b7('0x8a')][_0x566c4a]:_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a][_0xc0b7('0x8b')]?_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a][_0xc0b7('0x8b')]:'';var _0x311d0e=_[_0xc0b7('0x55')](_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a][_0xc0b7('0x8c')])?'':_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a][_0xc0b7('0x8c')];var _0x132b23=_0x3ebe8a+':'+_0x1cf0a4['items'][_0x566c4a][_0xc0b7('0x75')]+'§'+_0x311d0e;if(_[_0xc0b7('0x55')](_0xb0b861))_0xb0b861=_0x132b23;else _0xb0b861+=';'+_0x132b23;var _0xf4bf51=null;var _0x3276cd=null;if(_0x1cf0a4['item_types']){if(!_[_0xc0b7('0x55')](_0x1cf0a4[_0xc0b7('0x8a')][_0x566c4a])){_0x3276cd=_['find'](_0x3515be,function(_0x5e58a4){return _0x5e58a4['id']===_0x1cf0a4['item_types'][_0x566c4a];});if(!_[_0xc0b7('0x55')](_0x3276cd)){_0xf4bf51=_0x3276cd['OrderBy'];}}}else{if(!_[_0xc0b7('0x55')](_0x1cf0a4['items'][_0x566c4a])){_0x3276cd=_[_0xc0b7('0x6c')](_0x3515be,function(_0x327cd0){return _0x327cd0['id']===_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a]['ItemTypeId'];});if(!_[_0xc0b7('0x55')](_0x3276cd)){_0xf4bf51=_0x566c4a;}}}if(_[_0xc0b7('0x55')](_0xf4bf51)){_0xf4bf51=0x64;}_0x480843[_0xc0b7('0x5d')](addAdditionalPhone(_0x1cf0a4['id'],_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a][_0xc0b7('0x75')],_0x1cf0a4[_0xc0b7('0x8a')]?_[_0xc0b7('0x55')](_0x1cf0a4[_0xc0b7('0x8a')][_0x566c4a])?null:_0x1cf0a4['item_types'][_0x566c4a]:_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a][_0xc0b7('0x8b')]?_0x1cf0a4[_0xc0b7('0x89')][_0x566c4a][_0xc0b7('0x8b')]:null,_0xf4bf51,_0x311d0e));}Promise[_0xc0b7('0x62')](_0x480843)[_0xc0b7('0x1a')](function(){db[_0xc0b7('0x25')][_0xc0b7('0x45')]({'AdditionalPhones':_0xb0b861},{'where':{'id':_0x1cf0a4['id']}})[_0xc0b7('0x1a')](function(){_0x366529(0x1);});});});});});}function addAdditionalPhone(_0x1f292d,_0x137361,_0x4f8d86,_0x4bb57d,_0x10fddd){return db[_0xc0b7('0x4b')]['find']({'where':{'CmContactId':_0x1f292d,'item':_0x137361}})[_0xc0b7('0x1a')](function(_0x5b72ac){if(_0x5b72ac)logger['info'](_0xc0b7('0x8d'),_0x5b72ac);else{db['CmContactHasItem'][_0xc0b7('0x42')]({'CmContactId':_0x1f292d,'item':_0x137361,'ItemTypeId':_0x4f8d86,'OrderBy':_0x4bb57d,'ItemClass':_0xc0b7('0x8e'),'description':_0x10fddd});}});}function deleteCmHopperPhones(_0x5304b2){return new Promise(function(_0x140541){return db['CmHopper'][_0xc0b7('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5304b2}})[_0xc0b7('0x1a')](function(_0x25c10b){db[_0xc0b7('0x8f')][_0xc0b7('0x19')]({'where':{'CmHopperId':{'$in':_[_0xc0b7('0x6a')](_0x25c10b,'id')}}});})['then'](function(){_0x140541(0x1);});});}function addCmHopperPhones(_0x251829){return new Promise(function(_0x5421fc){return db['CmHopper'][_0xc0b7('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x251829}})['then'](function(_0x5d2acc){var _0x39dd59=[];_[_0xc0b7('0x6a')](_0x5d2acc,function(_0x5a6e47){_0x39dd59[_0xc0b7('0x5d')](createCmHopperPhone(_0x251829,_0x5a6e47['id']));});Promise[_0xc0b7('0x62')](_0x39dd59)[_0xc0b7('0x1a')](function(){_0x5421fc(0x1);});});});}function createCmHopperPhone(_0x22bf52,_0x5dab3a){return new Promise(function(_0x3fb7a7){db[_0xc0b7('0x4b')]['findAll']({'raw':!![],'attributes':[_0xc0b7('0x90'),_0xc0b7('0x88')],'where':{'CmContactId':_0x22bf52,'ItemClass':_0xc0b7('0x8e')},'include':[{'model':db[_0xc0b7('0x87')],'attributes':['OrderBy'],'as':'ItemType'}],'order':[_0xc0b7('0x88'),db[_0xc0b7('0x66')]['literal'](_0xc0b7('0x91'))]})[_0xc0b7('0x1a')](function(_0x11a8e6){var _0x203dcd=0x1;var _0x42cc6d=_[_0xc0b7('0x6a')](_0x11a8e6,function(_0x529b95){_0x529b95[_0xc0b7('0x92')]=_0x5dab3a;_0x529b95[_0xc0b7('0x75')]=_0x529b95[_0xc0b7('0x90')];_0x529b95[_0xc0b7('0x88')]=_0x203dcd;delete _0x529b95['ItemType.OrderBy'];_0x203dcd=_0x203dcd+0x1;return _0x529b95;});return db[_0xc0b7('0x8f')]['bulkCreate'](_0x42cc6d,{});})[_0xc0b7('0x1a')](function(){_0x3fb7a7(0x1);});});}function insertAdditionalPhones(_0x1409c9,_0x3d921a){return new Promise(function(_0x56452d){var _0x237331=[];for(var _0x281fa5=0x0;_0x281fa5<_0x3d921a[_0xc0b7('0x2d')];_0x281fa5++){var _0x5afa9c=_0x3d921a[_0x281fa5];_0x237331[_0xc0b7('0x5d')](parseContactItemType(_0x5afa9c));}Promise['all'](_0x237331)[_0xc0b7('0x1a')](function(){var _0x594bc7={'id':_0x1409c9['id'],'items':_0x3d921a};return addAdditionalPhones(_0x594bc7)['then'](function(){return addCmHopperPhones(_0x1409c9['id']);});})[_0xc0b7('0x1a')](function(){_0x56452d(_0x1409c9);});});}function parseContactItemType(_0x3c61ea){return new Promise(function(_0x3b99b5){if(_0x3c61ea[_0xc0b7('0x83')](_0xc0b7('0x8b'))){_0x3b99b5(_0x3c61ea);}else{return db[_0xc0b7('0x87')]['find']({'where':{'name':_0x3c61ea[_0xc0b7('0x65')]}})[_0xc0b7('0x1a')](function(_0x4284b6){if(_['isNil'](_0x4284b6))_0x3c61ea['ItemTypeId']=null;else _0x3c61ea['ItemTypeId']=_0x4284b6['id'];_0x3b99b5(_0x3c61ea);});}});}exports[_0xc0b7('0x93')]=function(_0x3207c8,_0x2f4965){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x3207c8['params']['id'],'ItemClass':_0xc0b7('0x8e')},'include':[{'model':db[_0xc0b7('0x87')],'as':_0xc0b7('0x65')}],'order':[[_0xc0b7('0x88')],[db['sequelize']['literal'](_0xc0b7('0x91'))]]})[_0xc0b7('0x1a')](function(_0x7eda11){return _0x7eda11;})['then'](respondWithResult(_0x2f4965,null))[_0xc0b7('0x24')](handleError(_0x2f4965,null));};exports[_0xc0b7('0x94')]=function(_0x5a34de,_0x1fd5d1){return db[_0xc0b7('0x4b')][_0xc0b7('0x21')]({'raw':!![],'where':{'CmContactId':_0x5a34de[_0xc0b7('0x35')][_0xc0b7('0x95')]}})['then'](function(_0x1658e4){var _0x45a0d0=_[_0xc0b7('0x6a')](_0x1658e4,function(_0xb52b23){_0xb52b23[_0xc0b7('0x96')]=_0x5a34de[_0xc0b7('0x35')][_0xc0b7('0x97')];return _0xb52b23;});return db[_0xc0b7('0x4b')][_0xc0b7('0x98')](_0x45a0d0,{});})[_0xc0b7('0x1a')](function(){return addCmHopperPhones(_0x5a34de[_0xc0b7('0x35')][_0xc0b7('0x97')]);})[_0xc0b7('0x1a')](function(){return['ok'];})['then'](respondWithResult(_0x1fd5d1,null))[_0xc0b7('0x24')](handleError(_0x1fd5d1,null));};exports[_0xc0b7('0x99')]=function(_0x4e834e,_0x10d35b){var _0xf5d0cc=[];_0xf5d0cc['push'](createCmHopperPhone(_0x4e834e[_0xc0b7('0x35')]['id'],_0x4e834e[_0xc0b7('0x35')][_0xc0b7('0x9a')]));Promise[_0xc0b7('0x62')](_0xf5d0cc)[_0xc0b7('0x1a')](function(){return[0x1];})[_0xc0b7('0x1a')](respondWithResult(_0x10d35b,null));};exports[_0xc0b7('0x9b')]=function(_0x1572f4,_0x1ed339){var _0x479819={'raw':![],'where':{}};var _0x170f08={};var _0x3275b3={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x1572f4[_0xc0b7('0x26')]['id']}})['then'](handleEntityNotFound(_0x1ed339,null))[_0xc0b7('0x1a')](function(_0x4c082d){if(_0x4c082d){_0x170f08[_0xc0b7('0x78')]=_['keys'](db['CmHopper'][_0xc0b7('0x7a')]);_0x170f08[_0xc0b7('0x22')]=_[_0xc0b7('0x27')](_0x1572f4[_0xc0b7('0x22')]);_0x170f08[_0xc0b7('0x7b')]=_[_0xc0b7('0x7c')](_0x170f08[_0xc0b7('0x78')],_0x170f08[_0xc0b7('0x22')]);_0x479819[_0xc0b7('0x7d')]=_['intersection'](_0x170f08[_0xc0b7('0x78')],qs[_0xc0b7('0x9c')](_0x1572f4[_0xc0b7('0x22')][_0xc0b7('0x9c')]));_0x479819['attributes']=_0x479819[_0xc0b7('0x7d')][_0xc0b7('0x2d')]?_0x479819['attributes']:_0x170f08[_0xc0b7('0x78')];if(!_0x1572f4['query']['hasOwnProperty'](_0xc0b7('0x84'))){_0x479819['limit']=qs[_0xc0b7('0x13')](_0x1572f4[_0xc0b7('0x22')][_0xc0b7('0x13')]);_0x479819[_0xc0b7('0x16')]=qs[_0xc0b7('0x16')](_0x1572f4[_0xc0b7('0x22')][_0xc0b7('0x16')]);}_0x479819['order']=qs[_0xc0b7('0x7f')](_0x1572f4[_0xc0b7('0x22')]['sort']);_0x479819[_0xc0b7('0x5b')]=qs[_0xc0b7('0x7b')](_[_0xc0b7('0x80')](_0x1572f4['query'],_0x170f08[_0xc0b7('0x7b')]));_0x479819[_0xc0b7('0x5b')][_0xc0b7('0x9d')]=_0x4c082d['id'];if(_0x1572f4['query'][_0xc0b7('0x81')]){_0x479819[_0xc0b7('0x5b')]=_['merge'](_0x479819[_0xc0b7('0x5b')],{'$or':_['map'](_0x479819[_0xc0b7('0x7d')],function(_0x1612b1){var _0x476e49={};_0x476e49[_0x1612b1]={'$like':'%'+_0x1572f4[_0xc0b7('0x22')][_0xc0b7('0x81')]+'%'};return _0x476e49;})});}_0x479819=_[_0xc0b7('0x34')]({},_0x479819,_0x1572f4[_0xc0b7('0x82')]);return db[_0xc0b7('0x3e')][_0xc0b7('0x15')]({'where':_0x479819['where']})[_0xc0b7('0x1a')](function(_0xb6c3f9){_0x3275b3[_0xc0b7('0x15')]=_0xb6c3f9;if(_0x1572f4[_0xc0b7('0x22')][_0xc0b7('0x9e')]){_0x479819[_0xc0b7('0x9f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x479819);})[_0xc0b7('0x1a')](function(_0x5e84f7){_0x3275b3['rows']=_0x5e84f7;return _0x3275b3;});}})[_0xc0b7('0x1a')](respondWithFilteredResult(_0x1ed339,_0x479819))[_0xc0b7('0x24')](handleError(_0x1ed339,null));};exports[_0xc0b7('0xa0')]=function(_0x11f906,_0x4e484a){var _0x5abb7d={'raw':!![],'where':{}};var _0x3cefd2={};var _0x4a32e4={'count':0x0,'rows':[]};return db[_0xc0b7('0x25')][_0xc0b7('0x77')]({'where':{'id':_0x11f906['params']['id']}})['then'](handleEntityNotFound(_0x4e484a,null))['then'](function(_0x12e12d){if(_0x12e12d){_0x3cefd2['model']=_[_0xc0b7('0x27')](db['CmHopperHistory'][_0xc0b7('0x7a')]);_0x3cefd2[_0xc0b7('0x22')]=_[_0xc0b7('0x27')](_0x11f906[_0xc0b7('0x22')]);_0x3cefd2[_0xc0b7('0x7b')]=_[_0xc0b7('0x7c')](_0x3cefd2[_0xc0b7('0x78')],_0x3cefd2[_0xc0b7('0x22')]);_0x5abb7d[_0xc0b7('0x7d')]=_[_0xc0b7('0x7c')](_0x3cefd2[_0xc0b7('0x78')],qs['fields'](_0x11f906['query'][_0xc0b7('0x9c')]));_0x5abb7d['attributes']=_0x5abb7d['attributes']['length']?_0x5abb7d[_0xc0b7('0x7d')]:_0x3cefd2[_0xc0b7('0x78')];if(!_0x11f906[_0xc0b7('0x22')]['hasOwnProperty']('nolimit')){_0x5abb7d[_0xc0b7('0x13')]=qs[_0xc0b7('0x13')](_0x11f906['query'][_0xc0b7('0x13')]);_0x5abb7d[_0xc0b7('0x16')]=qs[_0xc0b7('0x16')](_0x11f906[_0xc0b7('0x22')]['offset']);}_0x5abb7d[_0xc0b7('0x7e')]=qs[_0xc0b7('0x7f')](_0x11f906[_0xc0b7('0x22')][_0xc0b7('0x7f')]);_0x5abb7d[_0xc0b7('0x5b')]=qs['filters'](_[_0xc0b7('0x80')](_0x11f906[_0xc0b7('0x22')],_0x3cefd2[_0xc0b7('0x7b')]));_0x5abb7d[_0xc0b7('0x5b')][_0xc0b7('0x9d')]=_0x12e12d['id'];if(_0x11f906['query'][_0xc0b7('0x81')]){_0x5abb7d[_0xc0b7('0x5b')]=_['merge'](_0x5abb7d[_0xc0b7('0x5b')],{'$or':_[_0xc0b7('0x6a')](_0x5abb7d['attributes'],function(_0x836272){var _0x191909={};_0x191909[_0x836272]={'$like':'%'+_0x11f906[_0xc0b7('0x22')][_0xc0b7('0x81')]+'%'};return _0x191909;})});}_0x5abb7d=_[_0xc0b7('0x34')]({},_0x5abb7d,_0x11f906[_0xc0b7('0x82')]);return db['CmHopperHistory'][_0xc0b7('0x15')]({'where':_0x5abb7d[_0xc0b7('0x5b')]})['then'](function(_0x7e3a9d){_0x4a32e4['count']=_0x7e3a9d;if(_0x11f906[_0xc0b7('0x22')][_0xc0b7('0x9e')]){_0x5abb7d[_0xc0b7('0x9f')]=[{'all':!![]}];}return db[_0xc0b7('0x4d')][_0xc0b7('0x21')](_0x5abb7d);})[_0xc0b7('0x1a')](function(_0x26e4f1){_0x4a32e4[_0xc0b7('0xa1')]=_0x26e4f1;return _0x4a32e4;});}})[_0xc0b7('0x1a')](respondWithFilteredResult(_0x4e484a,_0x5abb7d))[_0xc0b7('0x24')](handleError(_0x4e484a,null));};exports[_0xc0b7('0xa2')]=function(_0x419026,_0x20da29){var _0x5cce2b={'raw':!![],'where':{}};var _0x19c31f={};var _0x1e5151={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x419026['params']['id']}})[_0xc0b7('0x1a')](handleEntityNotFound(_0x20da29,null))['then'](function(_0x343b7b){if(_0x343b7b){_0x19c31f[_0xc0b7('0x78')]=_[_0xc0b7('0x27')](db['CmHopperFinal'][_0xc0b7('0x7a')]);_0x19c31f['query']=_['keys'](_0x419026[_0xc0b7('0x22')]);_0x19c31f[_0xc0b7('0x7b')]=_[_0xc0b7('0x7c')](_0x19c31f['model'],_0x19c31f[_0xc0b7('0x22')]);_0x5cce2b['attributes']=_[_0xc0b7('0x7c')](_0x19c31f[_0xc0b7('0x78')],qs[_0xc0b7('0x9c')](_0x419026[_0xc0b7('0x22')]['fields']));_0x5cce2b[_0xc0b7('0x7d')]=_0x5cce2b[_0xc0b7('0x7d')][_0xc0b7('0x2d')]?_0x5cce2b[_0xc0b7('0x7d')]:_0x19c31f[_0xc0b7('0x78')];if(!_0x419026['query'][_0xc0b7('0x83')](_0xc0b7('0x84'))){_0x5cce2b[_0xc0b7('0x13')]=qs['limit'](_0x419026[_0xc0b7('0x22')][_0xc0b7('0x13')]);_0x5cce2b[_0xc0b7('0x16')]=qs['offset'](_0x419026[_0xc0b7('0x22')][_0xc0b7('0x16')]);}_0x5cce2b[_0xc0b7('0x7e')]=qs[_0xc0b7('0x7f')](_0x419026[_0xc0b7('0x22')][_0xc0b7('0x7f')]);_0x5cce2b[_0xc0b7('0x5b')]=qs[_0xc0b7('0x7b')](_[_0xc0b7('0x80')](_0x419026[_0xc0b7('0x22')],_0x19c31f[_0xc0b7('0x7b')]));_0x5cce2b[_0xc0b7('0x5b')][_0xc0b7('0x9d')]=_0x343b7b['id'];if(_0x419026[_0xc0b7('0x22')][_0xc0b7('0x81')]){_0x5cce2b['where']=_[_0xc0b7('0x34')](_0x5cce2b[_0xc0b7('0x5b')],{'$or':_[_0xc0b7('0x6a')](_0x5cce2b[_0xc0b7('0x7d')],function(_0xb0a413){var _0x4de56f={};_0x4de56f[_0xb0a413]={'$like':'%'+_0x419026[_0xc0b7('0x22')][_0xc0b7('0x81')]+'%'};return _0x4de56f;})});}_0x5cce2b=_[_0xc0b7('0x34')]({},_0x5cce2b,_0x419026[_0xc0b7('0x82')]);return db[_0xc0b7('0x4c')][_0xc0b7('0x15')]({'where':_0x5cce2b[_0xc0b7('0x5b')]})[_0xc0b7('0x1a')](function(_0x45bc1f){_0x1e5151[_0xc0b7('0x15')]=_0x45bc1f;if(_0x419026[_0xc0b7('0x22')][_0xc0b7('0x9e')]){_0x5cce2b[_0xc0b7('0x9f')]=[{'all':!![]}];}return db[_0xc0b7('0x4c')][_0xc0b7('0x21')](_0x5cce2b);})[_0xc0b7('0x1a')](function(_0x431664){_0x1e5151[_0xc0b7('0xa1')]=_0x431664;return _0x1e5151;});}})['then'](respondWithFilteredResult(_0x20da29,_0x5cce2b))[_0xc0b7('0x24')](handleError(_0x20da29,null));};exports[_0xc0b7('0xa3')]=function(_0x5be573,_0x5024e1){var _0x529982={'raw':!![],'where':{}};var _0x12ade6={};var _0x47eb6d={'count':0x0,'rows':[]};return db[_0xc0b7('0x25')][_0xc0b7('0x77')]({'where':{'id':_0x5be573[_0xc0b7('0x26')]['id']}})['then'](handleEntityNotFound(_0x5024e1,null))['then'](function(_0x51466b){if(_0x51466b){_0x12ade6[_0xc0b7('0x78')]=_[_0xc0b7('0x27')](db[_0xc0b7('0xa4')][_0xc0b7('0x7a')]);_0x12ade6[_0xc0b7('0x22')]=_['keys'](_0x5be573[_0xc0b7('0x22')]);_0x12ade6[_0xc0b7('0x7b')]=_[_0xc0b7('0x7c')](_0x12ade6[_0xc0b7('0x78')],_0x12ade6['query']);_0x529982[_0xc0b7('0x7d')]=_['intersection'](_0x12ade6[_0xc0b7('0x78')],qs[_0xc0b7('0x9c')](_0x5be573['query']['fields']));_0x529982[_0xc0b7('0x7d')]=_0x529982[_0xc0b7('0x7d')]['length']?_0x529982[_0xc0b7('0x7d')]:_0x12ade6['model'];if(!_0x5be573['query']['hasOwnProperty'](_0xc0b7('0x84'))){_0x529982[_0xc0b7('0x13')]=qs[_0xc0b7('0x13')](_0x5be573[_0xc0b7('0x22')][_0xc0b7('0x13')]);_0x529982['offset']=qs[_0xc0b7('0x16')](_0x5be573[_0xc0b7('0x22')]['offset']);}_0x529982[_0xc0b7('0x7e')]=qs['sort'](_0x5be573[_0xc0b7('0x22')][_0xc0b7('0x7f')]);_0x529982[_0xc0b7('0x5b')]=qs[_0xc0b7('0x7b')](_[_0xc0b7('0x80')](_0x5be573[_0xc0b7('0x22')],_0x12ade6[_0xc0b7('0x7b')]));_0x529982['where']['ContactId']=_0x51466b['id'];if(_0x5be573[_0xc0b7('0x22')][_0xc0b7('0x81')]){_0x529982[_0xc0b7('0x5b')]=_['merge'](_0x529982['where'],{'$or':_[_0xc0b7('0x6a')](_0x529982[_0xc0b7('0x7d')],function(_0x46b7de){var _0x5b9d50={};_0x5b9d50[_0x46b7de]={'$like':'%'+_0x5be573[_0xc0b7('0x22')][_0xc0b7('0x81')]+'%'};return _0x5b9d50;})});}_0x529982=_[_0xc0b7('0x34')]({},_0x529982,_0x5be573[_0xc0b7('0x82')]);return db[_0xc0b7('0xa4')]['count']({'where':_0x529982[_0xc0b7('0x5b')]})['then'](function(_0x6e359a){_0x47eb6d[_0xc0b7('0x15')]=_0x6e359a;if(_0x5be573['query'][_0xc0b7('0x9e')]){_0x529982['include']=[{'all':!![]}];}return db[_0xc0b7('0xa4')][_0xc0b7('0x21')](_0x529982);})[_0xc0b7('0x1a')](function(_0x4d396c){_0x47eb6d[_0xc0b7('0xa1')]=_0x4d396c;return _0x47eb6d;});}})[_0xc0b7('0x1a')](respondWithFilteredResult(_0x5024e1,_0x529982))[_0xc0b7('0x24')](handleError(_0x5024e1,null));};exports['uploadCsv']=function(_0xeaf0a3,_0x4a11e9){try{if(!_0xeaf0a3[_0xc0b7('0x35')]['ListId']){throw new Error(_0xc0b7('0xa5'));}if(!_0xeaf0a3[_0xc0b7('0x35')][_0xc0b7('0xa6')]){throw new Error(_0xc0b7('0xa7'));}if(!_0xeaf0a3[_0xc0b7('0x35')]['binding_values']){throw new Error(_0xc0b7('0xa8'));}if(!_0xeaf0a3[_0xc0b7('0x35')]['socket_timestamp']){throw new Error(_0xc0b7('0xa9'));}var _0x447dfe=_0xeaf0a3[_0xc0b7('0x35')][_0xc0b7('0xa6')][_0xc0b7('0xaa')](',');var _0x252b22=_0xeaf0a3[_0xc0b7('0x35')][_0xc0b7('0xab')][_0xc0b7('0xaa')](',');if(!_0x447dfe[_0xc0b7('0x2d')]||!_0x252b22['length']||_0x447dfe[_0xc0b7('0x2d')]!==_0x252b22[_0xc0b7('0x2d')]){throw new Error(_0xc0b7('0xac'));}_0xeaf0a3[_0xc0b7('0x35')][_0xc0b7('0x9c')]=_['zipObject'](_0x447dfe,_0x252b22);if(!_0xeaf0a3['body'][_0xc0b7('0x9c')][_0xc0b7('0x75')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0xeaf0a3[_0xc0b7('0x35')]['fields'][_0xc0b7('0xad')]){throw new Error(_0xc0b7('0xae'));}var _0x4bb876=path[_0xc0b7('0x3a')](config[_0xc0b7('0xaf')],_0xc0b7('0xb0'),_0xeaf0a3[_0xc0b7('0xb1')]['filename']);fs[_0xc0b7('0xb2')](_0x4bb876,parseInt(_0xc0b7('0xb3'),0x8));var _0x2bca9e=require('child_process')[_0xc0b7('0xb4')](path['join'](__dirname,_0xc0b7('0xb5')),[_0x4bb876,_0xeaf0a3[_0xc0b7('0x35')][_0xc0b7('0xa6')],_0xeaf0a3[_0xc0b7('0x35')][_0xc0b7('0xab')],_0xeaf0a3[_0xc0b7('0x35')]['ListId'],_0xeaf0a3[_0xc0b7('0x35')][_0xc0b7('0xb6')],_0xeaf0a3[_0xc0b7('0x35')]['duplicates'],_0xeaf0a3[_0xc0b7('0x35')]['socket_timestamp']]);return _0x4a11e9[_0xc0b7('0x11')](0xc8)[_0xc0b7('0x12')]({'message':_0xc0b7('0xb7'),'pid':_0x2bca9e[_0xc0b7('0xb8')]});}catch(_0x2cce65){return _0x4a11e9[_0xc0b7('0x11')](0x1f4)[_0xc0b7('0x1e')](_0x2cce65);}};exports['upload']=function(_0x84cfe7,_0x1a3236){var _0x495cc1=fs[_0xc0b7('0xb9')](_0x84cfe7[_0xc0b7('0xb1')][_0xc0b7('0x2')]);Papa[_0xc0b7('0xba')](_0x495cc1,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3d195b){return _0x1a3236[_0xc0b7('0x11')](0xc8)['json']({'file':_0x84cfe7[_0xc0b7('0xb1')],'fields':_0x3d195b[_0xc0b7('0xbb')][_0xc0b7('0x9c')]});}});};exports[_0xc0b7('0xbc')]=function(_0x20f4b3,_0x32c7c2){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xc0b7('0x1a')](function(_0x2de73d){var _0x56f4bb=![];if(!_0x20f4b3['body'][_0xc0b7('0x5e')]){throw new Error(_0xc0b7('0xa5'));}if(!_0x20f4b3[_0xc0b7('0x35')][_0xc0b7('0xbd')][_0xc0b7('0x75')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x20f4b3[_0xc0b7('0x35')][_0xc0b7('0xbd')][_0xc0b7('0xad')]){throw new Error(_0xc0b7('0xae'));}if(!_0x20f4b3[_0xc0b7('0x35')][_0xc0b7('0xbe')]){throw new Error(_0xc0b7('0xa9'));}var _0x395924=require('child_process')['fork'](path[_0xc0b7('0x3a')](__dirname,_0xc0b7('0xbf')),[_0x20f4b3[_0xc0b7('0x26')]['id'],JSON[_0xc0b7('0xc0')](_0x20f4b3[_0xc0b7('0x35')]),JSON[_0xc0b7('0xc0')](_0x2de73d)]);_0x395924['on'](_0xc0b7('0xc1'),function(){_0x56f4bb=!![];return _0x32c7c2[_0xc0b7('0x11')](0xc8)[_0xc0b7('0x12')]({'message':_0xc0b7('0xc2'),'pid':_0x395924[_0xc0b7('0xb8')]});});_0x395924['on']('exit',function(_0x4c8c2e){if(_0x4c8c2e&&!_0x56f4bb){return _0x32c7c2[_0xc0b7('0x11')](0x1f4)[_0xc0b7('0x12')]({'message':_0xc0b7('0xc3'),'pid':_0x395924[_0xc0b7('0xb8')]});}});})[_0xc0b7('0x24')](handleError(_0x32c7c2,null));};exports['importUpdates']=function(_0x354d9e,_0x3a9a2c){return db[_0xc0b7('0xc4')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xc0b7('0xc5')}})[_0xc0b7('0x1a')](function(_0x42f7b2){var _0x437f4a=![];if(!_0x354d9e[_0xc0b7('0x35')][_0xc0b7('0x5e')]){throw new Error('No\x20ListId\x20specified');}if(!_0x354d9e[_0xc0b7('0x35')]['binding'][_0xc0b7('0x75')]){throw new Error(_0xc0b7('0xc6'));}if(!_0x354d9e[_0xc0b7('0x35')][_0xc0b7('0xbd')][_0xc0b7('0xad')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x354d9e[_0xc0b7('0x35')][_0xc0b7('0xbe')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1011b4=require(_0xc0b7('0xc7'))[_0xc0b7('0xb4')](path[_0xc0b7('0x3a')](__dirname,_0xc0b7('0xc8')),[_0x354d9e[_0xc0b7('0x26')]['id'],JSON[_0xc0b7('0xc0')](_0x354d9e[_0xc0b7('0x35')]),JSON['stringify'](_0x42f7b2)]);_0x1011b4['on'](_0xc0b7('0xc1'),function(){_0x437f4a=!![];return _0x3a9a2c[_0xc0b7('0x11')](0xc8)[_0xc0b7('0x12')]({'message':_0xc0b7('0xc2'),'pid':_0x1011b4[_0xc0b7('0xb8')]});});_0x1011b4['on'](_0xc0b7('0xc9'),function(_0x53af66){if(_0x53af66&&!_0x437f4a){return _0x3a9a2c[_0xc0b7('0x11')](0x1f4)[_0xc0b7('0x12')]({'message':_0xc0b7('0xc3'),'pid':_0x1011b4['pid']});}});})[_0xc0b7('0x24')](handleError(_0x3a9a2c,null));};exports[_0xc0b7('0xca')]=function(_0x14df2f,_0x35e1fb){var _0xed84e=[_0xc0b7('0xcb'),_0xc0b7('0xcc'),_0xc0b7('0xcd'),_0xc0b7('0xce'),_0xc0b7('0xcf'),_0xc0b7('0xd0'),_0xc0b7('0xd1')];var _0x54677c={'offset':0x0,'order':qs[_0xc0b7('0x7f')](_0xc0b7('0xd2'))},_0x1de06b={'count':0x0,'rows':[]};Promise[_0xc0b7('0xd3')]()[_0xc0b7('0x1a')](function(){if(_0x14df2f['query'][_0xc0b7('0xd4')]){if(!_[_0xc0b7('0xd5')](_0xed84e,_0x14df2f[_0xc0b7('0x22')]['channel']['toLowerCase']())){throw new Error(_0xc0b7('0xd6'));}_0xed84e=[_0x14df2f[_0xc0b7('0x22')][_0xc0b7('0xd4')][_0xc0b7('0xd7')]()];}if(_0x14df2f[_0xc0b7('0x22')][_0xc0b7('0xd8')]){try{var _0xdc92d0=JSON[_0xc0b7('0xba')](_0x14df2f['query']['range']);if(!moment(_0xdc92d0['from'])[_0xc0b7('0xd9')]()){throw new Error(_0xc0b7('0xda'));}if(!moment(_0xdc92d0['to'])[_0xc0b7('0xd9')]()){throw new Error(_0xc0b7('0xdb'));}}catch(_0x54b230){throw new Error(_0xc0b7('0xdc'));}}if(!_0x14df2f[_0xc0b7('0x22')][_0xc0b7('0x83')](_0xc0b7('0x84'))){_0x54677c[_0xc0b7('0x13')]=qs[_0xc0b7('0x13')](_0x14df2f[_0xc0b7('0x22')][_0xc0b7('0x13')]||0xa);_0x54677c[_0xc0b7('0x16')]=qs[_0xc0b7('0x16')](_0x14df2f['query']['offset']);}var _0x484746=_0xed84e['map'](function(_0x17fe9c){if(_0x17fe9c===_0xc0b7('0xd1')){var _0x4595e2={'attributes':['id',_0xc0b7('0xdd'),_0xc0b7('0x30'),_0xc0b7('0xde'),_0xc0b7('0xdf'),_0xc0b7('0xe0'),_0xc0b7('0xe1'),_0xc0b7('0xe2'),'duration',_0xc0b7('0xe3'),_0xc0b7('0xe4'),_0xc0b7('0xe5'),_0xc0b7('0xe6'),_0xc0b7('0xe7'),'UserId'],'where':{'ContactId':_0x14df2f[_0xc0b7('0x26')]['id']},'include':[{'model':db[_0xc0b7('0xc4')],'as':'User','attributes':['id','name','fullname',_0xc0b7('0x2e')]}],'order':[[_0xc0b7('0xe4'),_0xc0b7('0xe8')]]};if(_0x14df2f[_0xc0b7('0x22')][_0xc0b7('0xd8')]){_0x4595e2[_0xc0b7('0x5b')][_0xc0b7('0xe4')]={'$gte':_0xdc92d0[_0xc0b7('0x3d')],'$lte':_0xdc92d0['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x4595e2)[_0xc0b7('0x1a')](function(_0x1940f7){_0x1de06b[_0xc0b7('0x15')]+=_0x1940f7[_0xc0b7('0x15')];return _['map'](_0x1940f7['rows'],function(_0x4358d8){var _0x4487f8=_0x4358d8[_0xc0b7('0x36')]({'plain':!![]});_0x4487f8[_0xc0b7('0xd4')]=_0x17fe9c;if(_0x4487f8[_0xc0b7('0xc4')]){_0x4487f8['User']={'id':_0x4487f8[_0xc0b7('0xc4')]['id'],'name':_0x4487f8[_0xc0b7('0xc4')][_0xc0b7('0x1d')],'fullname':_0x4487f8['User']['fullname'],'alias':_0x4487f8[_0xc0b7('0xc4')][_0xc0b7('0x2e')]};}return _0x4487f8;});});}else{var _0x121d70=_[_0xc0b7('0xe9')](_0x17fe9c)+(_0x17fe9c===_0xc0b7('0xcc')?_0xc0b7('0xea'):_0xc0b7('0xeb'));var _0x5e6cc5={'attributes':['id','closed',_0xc0b7('0xec'),_0xc0b7('0xe4'),_0xc0b7('0xe3'),_0xc0b7('0xed'),_0xc0b7('0xee'),_0xc0b7('0xef'),_0xc0b7('0xf0'),_0x121d70+'Id'],'where':{'ContactId':_0x14df2f[_0xc0b7('0x26')]['id']},'include':[{'model':db[_0x121d70],'as':_0xc0b7('0xeb'),'attributes':['id',_0xc0b7('0x1d'),_0xc0b7('0xf1')]},{'model':db['User'],'as':'Owner','attributes':['id',_0xc0b7('0x1d'),_0xc0b7('0xf2')]},{'model':db[_0xc0b7('0x79')],'as':_0xc0b7('0xf3'),'attributes':['id',_0xc0b7('0x1d'),_0xc0b7('0xf4')],'through':{'attributes':[]}}],'order':[['createdAt',_0xc0b7('0xe8')]]};if(_0x14df2f[_0xc0b7('0x22')][_0xc0b7('0xd8')]){_0x5e6cc5['where'][_0xc0b7('0xe4')]={'$gte':_0xdc92d0[_0xc0b7('0x3d')],'$lte':_0xdc92d0['to']};}switch(_0x17fe9c){case _0xc0b7('0xcc'):_0x5e6cc5[_0xc0b7('0x7d')]['push']('browserName','customerIp',_0xc0b7('0xf5'),'deviceModel',_0xc0b7('0xf6'),_0xc0b7('0xf7'),_0xc0b7('0xf8'),_0xc0b7('0xf9'),'referer');break;case _0xc0b7('0xcb'):_0x5e6cc5[_0xc0b7('0x7d')][_0xc0b7('0x5d')](_0xc0b7('0xfa'),_0xc0b7('0xfb'));break;case _0xc0b7('0xce'):_0x5e6cc5[_0xc0b7('0x7d')][_0xc0b7('0x5d')](_0xc0b7('0xfc'),_0xc0b7('0xfd'));break;}return db[_[_0xc0b7('0xe9')](_0x17fe9c)+_0xc0b7('0xfe')][_0xc0b7('0xff')](_0x5e6cc5)[_0xc0b7('0x1a')](function(_0x5e9091){_0x1de06b[_0xc0b7('0x15')]+=_0x5e9091[_0xc0b7('0x15')];return _[_0xc0b7('0x6a')](_0x5e9091[_0xc0b7('0xa1')],function(_0xab37f4){var _0x461137=_0xab37f4[_0xc0b7('0x36')]({'plain':!![]});_0x461137['channel']=_0x17fe9c;if(_0x461137[_0xc0b7('0x100')]){_0x461137[_0xc0b7('0x100')]={'id':_0x461137[_0xc0b7('0x100')]['id'],'name':_0x461137['Owner'][_0xc0b7('0x1d')],'fullname':_0x461137['Owner'][_0xc0b7('0xf2')]};}return _0x461137;});});}});return Promise[_0xc0b7('0x62')](_0x484746);})[_0xc0b7('0x1a')](function(_0x1d8274){return _(_0x1d8274)[_0xc0b7('0x101')]()['sortBy'](_0xc0b7('0xe4'))[_0xc0b7('0x102')]()['value']();})[_0xc0b7('0x1a')](function(_0x5875f1){_0x1de06b[_0xc0b7('0xa1')]=_0x54677c[_0xc0b7('0x13')]?_0x5875f1[_0xc0b7('0x103')](_0x54677c[_0xc0b7('0x16')],_0x54677c[_0xc0b7('0x16')]+_0x54677c['limit']):_0x5875f1;return _0x1de06b;})[_0xc0b7('0x1a')](respondWithFilteredResult(_0x35e1fb,_0x54677c))[_0xc0b7('0x24')](handleError(_0x35e1fb,null));}; \ No newline at end of file +var _0x6140=['duplicates','where','ListId','spread','push','all','show','Tag','Tags','tag','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','cf_%d','pickBy','map','format','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','filters','intersection','model','attributes','fields','order','sort','pick','filter','options','hasOwnProperty','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','item','PHONE','`ItemType`.OrderBy','CmHopperId','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','include','rows','getHopperHistories','getHopperFinals','ContactId','includeAll','uploadCsv','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!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','meta','import','User','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','getJourney','mail','sms','fax','whatsapp','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userThirdDisposition','UserId','fullname','VoiceCallReport','findAndCountAll','alias','startCase','Website','Account','closed','closedAt','secondDisposition','thirdDisposition','key','Owner','color','DESC','chat','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','flatten','sortBy','reverse','value','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','register','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','findAll','query','user','catch','CmContact','find','params','describe','tags','keys','length','startsWith','analytics','CmCustomField','cf_','columnName','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','merge','body','from','get','mergeWith','isArray','join','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6140,0x1a4));var _0x0614=function(_0x483f56,_0x4b6339){_0x483f56=_0x483f56-0x0;var _0x31a5b8=_0x6140[_0x483f56];return _0x31a5b8;};'use strict';var moment=require(_0x0614('0x0'));var BPromise=require(_0x0614('0x1'));var util=require(_0x0614('0x2'));var path=require(_0x0614('0x3'));var fs=require('fs');var _=require(_0x0614('0x4'));var squel=require(_0x0614('0x5'));var Papa=require(_0x0614('0x6'));var Redis=require(_0x0614('0x7'));var contacts=require(_0x0614('0x8'));var qs=require(_0x0614('0x9'));var logger=require(_0x0614('0xa'))(_0x0614('0xb'));var config=require(_0x0614('0xc'));var shared=require(_0x0614('0xd'));var db=require(_0x0614('0xe'))['db'];config[_0x0614('0xf')]=_['defaults'](config[_0x0614('0xf')],{'host':_0x0614('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0614('0xf')]));require('./cmContact.socket')[_0x0614('0x11')](socket);function respondWithResult(_0x4b7049,_0x4c63ed){_0x4c63ed=_0x4c63ed||0xc8;return function(_0x13774c){if(_0x13774c){return _0x4b7049[_0x0614('0x12')](_0x4c63ed)['json'](_0x13774c);}};}function respondWithFilteredResult(_0x21d8b2,_0x27487a){return function(_0x4e8f3d){if(_0x4e8f3d){var _0x514254=typeof _0x27487a[_0x0614('0x13')]===_0x0614('0x14')&&typeof _0x27487a[_0x0614('0x15')]===_0x0614('0x14');var _0x37d91e=_0x4e8f3d['count'];var _0x577ca9=_0x514254?0x0:_0x27487a[_0x0614('0x13')];var _0x458dd1=_0x514254?_0x4e8f3d[_0x0614('0x16')]:_0x27487a[_0x0614('0x13')]+_0x27487a['limit'];var _0x589353;if(_0x458dd1>=_0x37d91e){_0x458dd1=_0x37d91e;_0x589353=0xc8;}else{_0x589353=0xce;}_0x21d8b2[_0x0614('0x12')](_0x589353);return _0x21d8b2[_0x0614('0x17')](_0x0614('0x18'),_0x577ca9+'-'+_0x458dd1+'/'+_0x37d91e)[_0x0614('0x19')](_0x4e8f3d);}return null;};}function saveUpdates(_0x5ad72b){return function(_0x59cee0){if(_0x59cee0){return _0x59cee0[_0x0614('0x1a')](_0x5ad72b)[_0x0614('0x1b')](function(_0x48e280){return _0x48e280;});}return null;};}function removeEntity(_0xd4909d){return function(_0x863f3){if(_0x863f3){return _0x863f3[_0x0614('0x1c')]()['then'](function(){_0xd4909d[_0x0614('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35c012){return function(_0x267308){if(!_0x267308){_0x35c012[_0x0614('0x1d')](0x194);}return _0x267308;};}function handleError(_0x531850,_0x30612d){_0x30612d=_0x30612d||0x1f4;return function(_0xb41c67){logger[_0x0614('0x1e')](_0xb41c67[_0x0614('0x1f')]);if(_0xb41c67[_0x0614('0x20')]){delete _0xb41c67['name'];}_0x531850[_0x0614('0x12')](_0x30612d)['send'](_0xb41c67);};}exports['index']=function(_0x523102,_0x5eab5a){var _0xd13516={};return contacts['describe']()[_0x0614('0x1b')](function(_0x71a516){_0xd13516=qs['getOptions'](_0x71a516,_0x523102);return contacts[_0x0614('0x21')](_0x523102[_0x0614('0x22')],_0x523102[_0x0614('0x23')],_0xd13516,_0x71a516);})[_0x0614('0x1b')](respondWithFilteredResult(_0x5eab5a,_0xd13516))[_0x0614('0x24')](handleError(_0x5eab5a,null));};exports['destroy']=function(_0x13bddd,_0xc5356c){return db[_0x0614('0x25')][_0x0614('0x26')]({'where':{'id':_0x13bddd[_0x0614('0x27')]['id']}})[_0x0614('0x1b')](handleEntityNotFound(_0xc5356c,null))[_0x0614('0x1b')](removeEntity(_0xc5356c,null))[_0x0614('0x24')](handleError(_0xc5356c,null));};exports[_0x0614('0x28')]=function(_0x3e6931,_0x1f100e){return db[_0x0614('0x25')][_0x0614('0x28')]()['then'](function(_0x55a2e7){delete _0x55a2e7[_0x0614('0x29')];for(var _0x4fc6d4=0x0;_0x4fc6d40x0){return new Promise(function(_0x383b24){var _0x1b93c0=[];for(var _0x1ef310=0x0;_0x1ef310<_0x540d44[_0x0614('0x2b')];_0x1ef310++){_0x1b93c0[_0x0614('0x60')](insertAdditionalPhones(_0x540d44[_0x1ef310]['contact'],_0x540d44[_0x1ef310]['additionalPhones']));}Promise[_0x0614('0x61')](_0x1b93c0)['then'](function(){_0x383b24(0x1);});})['then'](function(){return{'success':_0x24e9a2,'failure':_0xcf3b05,'duplicates':_0x339dbf};});}else{return{'success':_0x24e9a2,'failure':_0xcf3b05,'duplicates':_0x339dbf};}}})[_0x0614('0x1b')](respondWithResult(_0x142066,0xc9))[_0x0614('0x24')](handleError(_0x142066,null));};exports[_0x0614('0x62')]=function(_0xbfd6e5,_0x2d7e52){var _0x4fdae0;return db[_0x0614('0x25')][_0x0614('0x28')]()[_0x0614('0x1b')](function(_0x4e52f5){return db[_0x0614('0x25')]['find']({'where':{'id':_0xbfd6e5[_0x0614('0x27')]['id']},'include':[{'model':db[_0x0614('0x63')],'as':_0x0614('0x64'),'attributes':['id',_0x0614('0x20'),'color'],'required':_0xbfd6e5[_0x0614('0x22')][_0x0614('0x65')]?!![]:![]},{'model':db[_0x0614('0x66')],'as':_0x0614('0x67'),'where':{'CmContactId':_0xbfd6e5['params']['id']},'required':![],'include':[{'model':db[_0x0614('0x68')],'as':_0x0614('0x69')}]}],'order':[db[_0x0614('0x6a')][_0x0614('0x6b')](_0x0614('0x6c'))],'attributes':_[_0x0614('0x2a')](_0x4e52f5)});})['then'](function(_0x4d7ad0){if(!_['isNil'](_0x4d7ad0)){_0x4fdae0=_0x4d7ad0[_0x0614('0x39')]({'plain':!![]});var _0x5c1a75={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4d7ad0&&_0x4d7ad0[_0x0614('0x5e')]){if(_0x4d7ad0[_0x0614('0x5e')]){_0x5c1a75[_0x0614('0x5d')][_0x0614('0x6d')][_0x0614('0x60')]({'ListId':{'$ne':_0x4d7ad0[_0x0614('0x5e')]}});}}return db[_0x0614('0x2e')]['findAll'](_0x5c1a75);}})[_0x0614('0x1b')](function(_0x33e912){if(!_[_0x0614('0x56')](_0x33e912)){return _[_0x0614('0x6e')](_0x4fdae0,_['map'](_0x33e912,function(_0x438f9b){return util['format'](_0x0614('0x6f'),_0x438f9b['id']);}));}})[_0x0614('0x1b')](handleEntityNotFound(_0x2d7e52,null))['then'](respondWithResult(_0x2d7e52,null))[_0x0614('0x24')](handleError(_0x2d7e52,null));};exports['update']=function(_0x16e176,_0x2f7d21){var _0x1b4d9c;if(_0x16e176[_0x0614('0x37')]['id']){delete _0x16e176['body']['id'];}if(!_[_0x0614('0x56')](_0x16e176[_0x0614('0x37')][_0x0614('0x55')])){var _0x388d32=_0x16e176['body'][_0x0614('0x55')];if(!_[_0x0614('0x56')](shared[_0x0614('0x57')][_0x388d32]))_0x16e176['body'][_0x0614('0x58')]=shared[_0x0614('0x57')][_0x388d32][_0x0614('0x58')];}return db[_0x0614('0x25')]['find']({'where':{'id':_0x16e176['params']['id']}})[_0x0614('0x1b')](handleEntityNotFound(_0x2f7d21,null))['then'](saveUpdates(_0x16e176[_0x0614('0x37')],null))[_0x0614('0x1b')](function(_0xb9603c){_0x1b4d9c=_0xb9603c;var _0x2c00ff={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xb9603c&&_0xb9603c[_0x0614('0x5e')]){if(_0xb9603c['ListId']){_0x2c00ff['where'][_0x0614('0x6d')][_0x0614('0x60')]({'ListId':{'$ne':_0xb9603c['ListId']}});}}return db[_0x0614('0x2e')][_0x0614('0x21')](_0x2c00ff);})['then'](function(_0x2c7b53){if(_0x2c7b53){return _[_0x0614('0x6e')](_[_0x0614('0x70')](_0x16e176[_0x0614('0x37')],function(_0x34990d,_0x4da1f8){return _['startsWith'](_0x4da1f8,_0x0614('0x2f'));}),_[_0x0614('0x71')](_0x2c7b53,function(_0x5b0d71){return util[_0x0614('0x72')](_0x0614('0x6f'),_0x5b0d71['id']);}));}})[_0x0614('0x1b')](function(_0x1c6e7b){if(_0x1c6e7b&&!_['isEmpty'](_0x1c6e7b)){var _0x48a1a0=squel['update']()[_0x0614('0x73')](_0x0614('0x74'))[_0x0614('0x75')](_0x1c6e7b)[_0x0614('0x5d')](_0x0614('0x76'),_0x16e176[_0x0614('0x27')]['id'])[_0x0614('0x77')]();return db[_0x0614('0x6a')]['query'](_0x48a1a0['text'],{'replacements':_0x48a1a0[_0x0614('0x33')]});}})[_0x0614('0x1b')](function(){if(_0x16e176[_0x0614('0x37')]['phone']&&_0x1b4d9c){return db[_0x0614('0x3d')][_0x0614('0x1a')]({'phone':_0x16e176[_0x0614('0x37')][_0x0614('0x78')],'OrderBy':0x0},{'where':{'ContactId':_0x1b4d9c['id']}});}})[_0x0614('0x1b')](function(){return _0x1b4d9c;})[_0x0614('0x1b')](respondWithResult(_0x2f7d21,null))[_0x0614('0x24')](handleError(_0x2f7d21,null));};exports['getTags']=function(_0x2417db,_0x172146){var _0x329746={};var _0x376160={};var _0x18ffba;var _0x3c40f6;return db[_0x0614('0x25')][_0x0614('0x79')]({'where':{'id':_0x2417db['params']['id']}})[_0x0614('0x1b')](handleEntityNotFound(_0x172146,null))[_0x0614('0x1b')](function(_0x1e1c55){if(_0x1e1c55){_0x18ffba=_0x1e1c55;_0x376160['model']=_[_0x0614('0x2a')](db['Tag'][_0x0614('0x7a')]);_0x376160[_0x0614('0x22')]=_[_0x0614('0x2a')](_0x2417db[_0x0614('0x22')]);_0x376160[_0x0614('0x7b')]=_[_0x0614('0x7c')](_0x376160[_0x0614('0x7d')],_0x376160[_0x0614('0x22')]);_0x329746[_0x0614('0x7e')]=_[_0x0614('0x7c')](_0x376160[_0x0614('0x7d')],qs[_0x0614('0x7f')](_0x2417db['query']['fields']));_0x329746[_0x0614('0x7e')]=_0x329746[_0x0614('0x7e')][_0x0614('0x2b')]?_0x329746[_0x0614('0x7e')]:_0x376160[_0x0614('0x7d')];_0x329746[_0x0614('0x80')]=qs[_0x0614('0x81')](_0x2417db[_0x0614('0x22')][_0x0614('0x81')]);_0x329746[_0x0614('0x5d')]=qs[_0x0614('0x7b')](_[_0x0614('0x82')](_0x2417db[_0x0614('0x22')],_0x376160['filters']));if(_0x2417db[_0x0614('0x22')][_0x0614('0x83')]){_0x329746[_0x0614('0x5d')]=_['merge'](_0x329746[_0x0614('0x5d')],{'$or':_[_0x0614('0x71')](_0x329746['attributes'],function(_0x329846){var _0x4da55c={};_0x4da55c[_0x329846]={'$like':'%'+_0x2417db[_0x0614('0x22')][_0x0614('0x83')]+'%'};return _0x4da55c;})});}_0x329746=_['merge']({},_0x329746,_0x2417db[_0x0614('0x84')]);return _0x18ffba['getTags'](_0x329746);}})[_0x0614('0x1b')](function(_0x38f9ab){if(_0x38f9ab){_0x3c40f6=_0x38f9ab[_0x0614('0x2b')];if(!_0x2417db[_0x0614('0x22')][_0x0614('0x85')]('nolimit')){_0x329746[_0x0614('0x15')]=qs[_0x0614('0x15')](_0x2417db['query'][_0x0614('0x15')]);_0x329746[_0x0614('0x13')]=qs[_0x0614('0x13')](_0x2417db[_0x0614('0x22')][_0x0614('0x13')]);}return _0x18ffba['getTags'](_0x329746);}})['then'](function(_0x560fb2){if(_0x560fb2){return _0x560fb2?{'count':_0x3c40f6,'rows':_0x560fb2}:null;}})[_0x0614('0x1b')](respondWithResult(_0x172146,null))['catch'](handleError(_0x172146,null));};exports[_0x0614('0x86')]=function(_0x3572c6,_0x268093){if(_0x3572c6['body']['id']){delete _0x3572c6['body']['id'];}return db[_0x0614('0x25')]['findOne']({'where':{'id':_0x3572c6[_0x0614('0x27')]['id']}})[_0x0614('0x1b')](handleEntityNotFound(_0x268093,null))[_0x0614('0x1b')](function(_0x4c1a95){if(_0x4c1a95){return _0x4c1a95[_0x0614('0x86')](_0x3572c6[_0x0614('0x37')][_0x0614('0x87')]||[]);}return null;})['then'](respondWithResult(_0x268093,null))[_0x0614('0x24')](handleError(_0x268093,null));};exports['setAdditionalPhones']=function(_0x267cbb,_0x391243){var _0x479a14=[];_0x479a14[_0x0614('0x60')](addAdditionalPhones(_0x267cbb[_0x0614('0x37')]));Promise[_0x0614('0x61')](_0x479a14)[_0x0614('0x1b')](function(){_0x479a14=[];_0x479a14[_0x0614('0x60')](deleteCmHopperPhones(_0x267cbb[_0x0614('0x37')]['id']));_0x479a14[_0x0614('0x60')](addCmHopperPhones(_0x267cbb['body']['id']));Promise[_0x0614('0x61')](_0x479a14)[_0x0614('0x1b')](function(){return[0x1];})[_0x0614('0x1b')](respondWithResult(_0x391243,null));});};function addAdditionalPhones(_0x10bf46){var _0x22e6e0;return new Promise(function(_0x2d18b2){return db[_0x0614('0x66')][_0x0614('0x1c')]({'where':{'CmContactId':_0x10bf46['id']}})[_0x0614('0x1b')](function(){db[_0x0614('0x68')][_0x0614('0x21')]({'raw':!![],'attributes':['id',_0x0614('0x88')]})[_0x0614('0x1b')](function(_0x3bcd04){var _0x40a9ff=[];for(var _0x5df1a9=0x0;_0x5df1a9<_0x10bf46[_0x0614('0x89')][_0x0614('0x2b')];_0x5df1a9++){var _0x1fdd83=_0x10bf46[_0x0614('0x8a')]?_['isNil'](_0x10bf46[_0x0614('0x8a')][_0x5df1a9])?'':_0x10bf46[_0x0614('0x8a')][_0x5df1a9]:_0x10bf46[_0x0614('0x89')][_0x5df1a9][_0x0614('0x8b')]?_0x10bf46[_0x0614('0x89')][_0x5df1a9][_0x0614('0x8b')]:'';var _0x49e2cf=_['isNil'](_0x10bf46['items'][_0x5df1a9][_0x0614('0x8c')])?'':_0x10bf46[_0x0614('0x89')][_0x5df1a9]['description'];var _0x1b91e4=_0x1fdd83+':'+_0x10bf46[_0x0614('0x89')][_0x5df1a9][_0x0614('0x78')]+'§'+_0x49e2cf;if(_['isNil'](_0x22e6e0))_0x22e6e0=_0x1b91e4;else _0x22e6e0+=';'+_0x1b91e4;var _0x27a36b=null;var _0x3ac239=null;if(_0x10bf46[_0x0614('0x8a')]){if(!_[_0x0614('0x56')](_0x10bf46[_0x0614('0x8a')][_0x5df1a9])){_0x3ac239=_[_0x0614('0x26')](_0x3bcd04,function(_0x4981c2){return _0x4981c2['id']===_0x10bf46['item_types'][_0x5df1a9];});if(!_[_0x0614('0x56')](_0x3ac239)){_0x27a36b=_0x3ac239['OrderBy'];}}}else{if(!_[_0x0614('0x56')](_0x10bf46['items'][_0x5df1a9])){_0x3ac239=_[_0x0614('0x26')](_0x3bcd04,function(_0x4b60da){return _0x4b60da['id']===_0x10bf46[_0x0614('0x89')][_0x5df1a9]['ItemTypeId'];});if(!_[_0x0614('0x56')](_0x3ac239)){_0x27a36b=_0x5df1a9;}}}if(_['isNil'](_0x27a36b)){_0x27a36b=0x64;}_0x40a9ff['push'](addAdditionalPhone(_0x10bf46['id'],_0x10bf46[_0x0614('0x89')][_0x5df1a9]['phone'],_0x10bf46[_0x0614('0x8a')]?_[_0x0614('0x56')](_0x10bf46[_0x0614('0x8a')][_0x5df1a9])?null:_0x10bf46['item_types'][_0x5df1a9]:_0x10bf46[_0x0614('0x89')][_0x5df1a9]['ItemTypeId']?_0x10bf46[_0x0614('0x89')][_0x5df1a9][_0x0614('0x8b')]:null,_0x27a36b,_0x49e2cf));}Promise[_0x0614('0x61')](_0x40a9ff)[_0x0614('0x1b')](function(){db[_0x0614('0x25')][_0x0614('0x1a')]({'AdditionalPhones':_0x22e6e0},{'where':{'id':_0x10bf46['id']}})['then'](function(){_0x2d18b2(0x1);});});});});});}function addAdditionalPhone(_0x41b22a,_0x38db4a,_0x57b87b,_0x424306,_0x49b202){return db[_0x0614('0x66')]['find']({'where':{'CmContactId':_0x41b22a,'item':_0x38db4a}})[_0x0614('0x1b')](function(_0x1bcee2){if(_0x1bcee2)logger[_0x0614('0x34')](_0x0614('0x8d'),_0x1bcee2);else{db['CmContactHasItem'][_0x0614('0x40')]({'CmContactId':_0x41b22a,'item':_0x38db4a,'ItemTypeId':_0x57b87b,'OrderBy':_0x424306,'ItemClass':'PHONE','description':_0x49b202});}});}function deleteCmHopperPhones(_0x2f6a5d){return new Promise(function(_0x3c78c0){return db['CmHopper'][_0x0614('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2f6a5d}})[_0x0614('0x1b')](function(_0x16c2d3){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_[_0x0614('0x71')](_0x16c2d3,'id')}}});})[_0x0614('0x1b')](function(){_0x3c78c0(0x1);});});}function addCmHopperPhones(_0x5803b9){return new Promise(function(_0x11ba4c){return db[_0x0614('0x3d')][_0x0614('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5803b9}})[_0x0614('0x1b')](function(_0x9202ff){var _0x28622f=[];_[_0x0614('0x71')](_0x9202ff,function(_0x5a0867){_0x28622f[_0x0614('0x60')](createCmHopperPhone(_0x5803b9,_0x5a0867['id']));});Promise[_0x0614('0x61')](_0x28622f)[_0x0614('0x1b')](function(){_0x11ba4c(0x1);});});});}function createCmHopperPhone(_0x57a30c,_0x2693f8){return new Promise(function(_0x4a9a4f){db[_0x0614('0x66')][_0x0614('0x21')]({'raw':!![],'attributes':[_0x0614('0x8e'),'OrderBy'],'where':{'CmContactId':_0x57a30c,'ItemClass':_0x0614('0x8f')},'include':[{'model':db['ContactItemType'],'attributes':[_0x0614('0x88')],'as':'ItemType'}],'order':[_0x0614('0x88'),db[_0x0614('0x6a')]['literal'](_0x0614('0x90'))]})[_0x0614('0x1b')](function(_0x2110c9){var _0x2e111a=0x1;var _0x213481=_[_0x0614('0x71')](_0x2110c9,function(_0x3319e6){_0x3319e6[_0x0614('0x91')]=_0x2693f8;_0x3319e6[_0x0614('0x78')]=_0x3319e6['item'];_0x3319e6[_0x0614('0x88')]=_0x2e111a;delete _0x3319e6['ItemType.OrderBy'];_0x2e111a=_0x2e111a+0x1;return _0x3319e6;});return db[_0x0614('0x92')][_0x0614('0x5a')](_0x213481,{});})['then'](function(){_0x4a9a4f(0x1);});});}function insertAdditionalPhones(_0x534d27,_0xe2435c){return new Promise(function(_0x596076){var _0x2845d8=[];for(var _0x407634=0x0;_0x407634<_0xe2435c[_0x0614('0x2b')];_0x407634++){var _0x48537c=_0xe2435c[_0x407634];_0x2845d8[_0x0614('0x60')](parseContactItemType(_0x48537c));}Promise['all'](_0x2845d8)[_0x0614('0x1b')](function(){var _0x42cba7={'id':_0x534d27['id'],'items':_0xe2435c};return addAdditionalPhones(_0x42cba7)[_0x0614('0x1b')](function(){return addCmHopperPhones(_0x534d27['id']);});})[_0x0614('0x1b')](function(){_0x596076(_0x534d27);});});}function parseContactItemType(_0x3a3d91){return new Promise(function(_0x1ff941){if(_0x3a3d91['hasOwnProperty']('ItemTypeId')){_0x1ff941(_0x3a3d91);}else{return db['ContactItemType']['find']({'where':{'name':_0x3a3d91[_0x0614('0x69')]}})[_0x0614('0x1b')](function(_0x170c0b){if(_[_0x0614('0x56')](_0x170c0b))_0x3a3d91[_0x0614('0x8b')]=null;else _0x3a3d91[_0x0614('0x8b')]=_0x170c0b['id'];_0x1ff941(_0x3a3d91);});}});}exports[_0x0614('0x93')]=function(_0x198feb,_0x22b290){return db[_0x0614('0x66')][_0x0614('0x21')]({'raw':!![],'where':{'CmContactId':_0x198feb[_0x0614('0x27')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x0614('0x68')],'as':_0x0614('0x69')}],'order':[[_0x0614('0x88')],[db[_0x0614('0x6a')][_0x0614('0x6b')]('`ItemType`.OrderBy')]]})[_0x0614('0x1b')](function(_0x5936cc){return _0x5936cc;})['then'](respondWithResult(_0x22b290,null))['catch'](handleError(_0x22b290,null));};exports[_0x0614('0x94')]=function(_0x15ee8a,_0x467d89){return db['CmContactHasItem'][_0x0614('0x21')]({'raw':!![],'where':{'CmContactId':_0x15ee8a[_0x0614('0x37')][_0x0614('0x95')]}})[_0x0614('0x1b')](function(_0x41c139){var _0x168b6d=_[_0x0614('0x71')](_0x41c139,function(_0x5ce71c){_0x5ce71c[_0x0614('0x96')]=_0x15ee8a[_0x0614('0x37')][_0x0614('0x97')];return _0x5ce71c;});return db[_0x0614('0x66')][_0x0614('0x5a')](_0x168b6d,{});})[_0x0614('0x1b')](function(){return addCmHopperPhones(_0x15ee8a[_0x0614('0x37')]['toContactId']);})[_0x0614('0x1b')](function(){return['ok'];})[_0x0614('0x1b')](respondWithResult(_0x467d89,null))[_0x0614('0x24')](handleError(_0x467d89,null));};exports[_0x0614('0x98')]=function(_0x117e31,_0x4960f9){var _0x484952=[];_0x484952['push'](createCmHopperPhone(_0x117e31[_0x0614('0x37')]['id'],_0x117e31[_0x0614('0x37')][_0x0614('0x99')]));Promise[_0x0614('0x61')](_0x484952)[_0x0614('0x1b')](function(){return[0x1];})[_0x0614('0x1b')](respondWithResult(_0x4960f9,null));};exports[_0x0614('0x9a')]=function(_0x548f85,_0xa221d9){var _0x2daf01={'raw':![],'where':{}};var _0x366e4c={};var _0x3f952d={'count':0x0,'rows':[]};return db[_0x0614('0x25')]['findOne']({'where':{'id':_0x548f85[_0x0614('0x27')]['id']}})[_0x0614('0x1b')](handleEntityNotFound(_0xa221d9,null))[_0x0614('0x1b')](function(_0x23a019){if(_0x23a019){_0x366e4c[_0x0614('0x7d')]=_['keys'](db['CmHopper'][_0x0614('0x7a')]);_0x366e4c['query']=_[_0x0614('0x2a')](_0x548f85[_0x0614('0x22')]);_0x366e4c['filters']=_[_0x0614('0x7c')](_0x366e4c[_0x0614('0x7d')],_0x366e4c['query']);_0x2daf01['attributes']=_[_0x0614('0x7c')](_0x366e4c[_0x0614('0x7d')],qs[_0x0614('0x7f')](_0x548f85['query'][_0x0614('0x7f')]));_0x2daf01[_0x0614('0x7e')]=_0x2daf01[_0x0614('0x7e')][_0x0614('0x2b')]?_0x2daf01['attributes']:_0x366e4c[_0x0614('0x7d')];if(!_0x548f85[_0x0614('0x22')][_0x0614('0x85')](_0x0614('0x9b'))){_0x2daf01[_0x0614('0x15')]=qs[_0x0614('0x15')](_0x548f85[_0x0614('0x22')][_0x0614('0x15')]);_0x2daf01['offset']=qs[_0x0614('0x13')](_0x548f85[_0x0614('0x22')][_0x0614('0x13')]);}_0x2daf01[_0x0614('0x80')]=qs['sort'](_0x548f85['query'][_0x0614('0x81')]);_0x2daf01[_0x0614('0x5d')]=qs[_0x0614('0x7b')](_['pick'](_0x548f85['query'],_0x366e4c[_0x0614('0x7b')]));_0x2daf01[_0x0614('0x5d')]['ContactId']=_0x23a019['id'];if(_0x548f85[_0x0614('0x22')][_0x0614('0x83')]){_0x2daf01[_0x0614('0x5d')]=_[_0x0614('0x36')](_0x2daf01[_0x0614('0x5d')],{'$or':_[_0x0614('0x71')](_0x2daf01[_0x0614('0x7e')],function(_0x1b88ba){var _0x273e99={};_0x273e99[_0x1b88ba]={'$like':'%'+_0x548f85[_0x0614('0x22')][_0x0614('0x83')]+'%'};return _0x273e99;})});}_0x2daf01=_[_0x0614('0x36')]({},_0x2daf01,_0x548f85['options']);return db['CmHopper']['count']({'where':_0x2daf01[_0x0614('0x5d')]})[_0x0614('0x1b')](function(_0x547f6e){_0x3f952d['count']=_0x547f6e;if(_0x548f85[_0x0614('0x22')]['includeAll']){_0x2daf01[_0x0614('0x9c')]=[{'all':!![]}];}return db[_0x0614('0x3d')]['findAll'](_0x2daf01);})[_0x0614('0x1b')](function(_0x4a9582){_0x3f952d[_0x0614('0x9d')]=_0x4a9582;return _0x3f952d;});}})[_0x0614('0x1b')](respondWithFilteredResult(_0xa221d9,_0x2daf01))[_0x0614('0x24')](handleError(_0xa221d9,null));};exports[_0x0614('0x9e')]=function(_0x21cd66,_0x13db9c){var _0x795e02={'raw':!![],'where':{}};var _0x36ea1c={};var _0x173c35={'count':0x0,'rows':[]};return db[_0x0614('0x25')][_0x0614('0x79')]({'where':{'id':_0x21cd66[_0x0614('0x27')]['id']}})[_0x0614('0x1b')](handleEntityNotFound(_0x13db9c,null))['then'](function(_0x3ee915){if(_0x3ee915){_0x36ea1c[_0x0614('0x7d')]=_[_0x0614('0x2a')](db['CmHopperHistory']['rawAttributes']);_0x36ea1c['query']=_[_0x0614('0x2a')](_0x21cd66['query']);_0x36ea1c['filters']=_[_0x0614('0x7c')](_0x36ea1c[_0x0614('0x7d')],_0x36ea1c[_0x0614('0x22')]);_0x795e02['attributes']=_[_0x0614('0x7c')](_0x36ea1c[_0x0614('0x7d')],qs[_0x0614('0x7f')](_0x21cd66[_0x0614('0x22')]['fields']));_0x795e02[_0x0614('0x7e')]=_0x795e02['attributes'][_0x0614('0x2b')]?_0x795e02[_0x0614('0x7e')]:_0x36ea1c[_0x0614('0x7d')];if(!_0x21cd66['query'][_0x0614('0x85')]('nolimit')){_0x795e02[_0x0614('0x15')]=qs[_0x0614('0x15')](_0x21cd66[_0x0614('0x22')][_0x0614('0x15')]);_0x795e02[_0x0614('0x13')]=qs[_0x0614('0x13')](_0x21cd66[_0x0614('0x22')]['offset']);}_0x795e02[_0x0614('0x80')]=qs[_0x0614('0x81')](_0x21cd66[_0x0614('0x22')][_0x0614('0x81')]);_0x795e02[_0x0614('0x5d')]=qs['filters'](_[_0x0614('0x82')](_0x21cd66['query'],_0x36ea1c[_0x0614('0x7b')]));_0x795e02[_0x0614('0x5d')]['ContactId']=_0x3ee915['id'];if(_0x21cd66[_0x0614('0x22')]['filter']){_0x795e02[_0x0614('0x5d')]=_[_0x0614('0x36')](_0x795e02[_0x0614('0x5d')],{'$or':_[_0x0614('0x71')](_0x795e02[_0x0614('0x7e')],function(_0x42375f){var _0x194865={};_0x194865[_0x42375f]={'$like':'%'+_0x21cd66[_0x0614('0x22')][_0x0614('0x83')]+'%'};return _0x194865;})});}_0x795e02=_[_0x0614('0x36')]({},_0x795e02,_0x21cd66[_0x0614('0x84')]);return db[_0x0614('0x4c')][_0x0614('0x16')]({'where':_0x795e02[_0x0614('0x5d')]})['then'](function(_0x346153){_0x173c35[_0x0614('0x16')]=_0x346153;if(_0x21cd66[_0x0614('0x22')]['includeAll']){_0x795e02['include']=[{'all':!![]}];}return db[_0x0614('0x4c')][_0x0614('0x21')](_0x795e02);})['then'](function(_0x1d7169){_0x173c35[_0x0614('0x9d')]=_0x1d7169;return _0x173c35;});}})[_0x0614('0x1b')](respondWithFilteredResult(_0x13db9c,_0x795e02))[_0x0614('0x24')](handleError(_0x13db9c,null));};exports[_0x0614('0x9f')]=function(_0x5bc345,_0x26db2b){var _0x5726cd={'raw':!![],'where':{}};var _0x2978c0={};var _0x52ca35={'count':0x0,'rows':[]};return db[_0x0614('0x25')][_0x0614('0x79')]({'where':{'id':_0x5bc345[_0x0614('0x27')]['id']}})[_0x0614('0x1b')](handleEntityNotFound(_0x26db2b,null))[_0x0614('0x1b')](function(_0x4d0490){if(_0x4d0490){_0x2978c0[_0x0614('0x7d')]=_[_0x0614('0x2a')](db[_0x0614('0x4b')][_0x0614('0x7a')]);_0x2978c0['query']=_[_0x0614('0x2a')](_0x5bc345[_0x0614('0x22')]);_0x2978c0['filters']=_[_0x0614('0x7c')](_0x2978c0[_0x0614('0x7d')],_0x2978c0[_0x0614('0x22')]);_0x5726cd[_0x0614('0x7e')]=_['intersection'](_0x2978c0['model'],qs[_0x0614('0x7f')](_0x5bc345['query'][_0x0614('0x7f')]));_0x5726cd[_0x0614('0x7e')]=_0x5726cd[_0x0614('0x7e')]['length']?_0x5726cd[_0x0614('0x7e')]:_0x2978c0[_0x0614('0x7d')];if(!_0x5bc345[_0x0614('0x22')]['hasOwnProperty'](_0x0614('0x9b'))){_0x5726cd[_0x0614('0x15')]=qs[_0x0614('0x15')](_0x5bc345[_0x0614('0x22')]['limit']);_0x5726cd[_0x0614('0x13')]=qs[_0x0614('0x13')](_0x5bc345[_0x0614('0x22')][_0x0614('0x13')]);}_0x5726cd['order']=qs[_0x0614('0x81')](_0x5bc345['query'][_0x0614('0x81')]);_0x5726cd[_0x0614('0x5d')]=qs[_0x0614('0x7b')](_[_0x0614('0x82')](_0x5bc345[_0x0614('0x22')],_0x2978c0[_0x0614('0x7b')]));_0x5726cd[_0x0614('0x5d')][_0x0614('0xa0')]=_0x4d0490['id'];if(_0x5bc345[_0x0614('0x22')][_0x0614('0x83')]){_0x5726cd['where']=_[_0x0614('0x36')](_0x5726cd['where'],{'$or':_[_0x0614('0x71')](_0x5726cd[_0x0614('0x7e')],function(_0x5417c3){var _0x3faa70={};_0x3faa70[_0x5417c3]={'$like':'%'+_0x5bc345['query'][_0x0614('0x83')]+'%'};return _0x3faa70;})});}_0x5726cd=_[_0x0614('0x36')]({},_0x5726cd,_0x5bc345[_0x0614('0x84')]);return db[_0x0614('0x4b')][_0x0614('0x16')]({'where':_0x5726cd[_0x0614('0x5d')]})[_0x0614('0x1b')](function(_0x14f0b9){_0x52ca35[_0x0614('0x16')]=_0x14f0b9;if(_0x5bc345[_0x0614('0x22')][_0x0614('0xa1')]){_0x5726cd[_0x0614('0x9c')]=[{'all':!![]}];}return db[_0x0614('0x4b')]['findAll'](_0x5726cd);})[_0x0614('0x1b')](function(_0x59c94d){_0x52ca35[_0x0614('0x9d')]=_0x59c94d;return _0x52ca35;});}})['then'](respondWithFilteredResult(_0x26db2b,_0x5726cd))[_0x0614('0x24')](handleError(_0x26db2b,null));};exports['getJscriptySessions']=function(_0xc27155,_0x363787){var _0x210177={'raw':!![],'where':{}};var _0x1cc200={};var _0x14f4b2={'count':0x0,'rows':[]};return db['CmContact'][_0x0614('0x79')]({'where':{'id':_0xc27155['params']['id']}})['then'](handleEntityNotFound(_0x363787,null))[_0x0614('0x1b')](function(_0x434354){if(_0x434354){_0x1cc200['model']=_[_0x0614('0x2a')](db['JscriptySessionReport'][_0x0614('0x7a')]);_0x1cc200[_0x0614('0x22')]=_['keys'](_0xc27155[_0x0614('0x22')]);_0x1cc200[_0x0614('0x7b')]=_[_0x0614('0x7c')](_0x1cc200['model'],_0x1cc200[_0x0614('0x22')]);_0x210177[_0x0614('0x7e')]=_[_0x0614('0x7c')](_0x1cc200[_0x0614('0x7d')],qs[_0x0614('0x7f')](_0xc27155['query']['fields']));_0x210177[_0x0614('0x7e')]=_0x210177['attributes'][_0x0614('0x2b')]?_0x210177['attributes']:_0x1cc200[_0x0614('0x7d')];if(!_0xc27155[_0x0614('0x22')][_0x0614('0x85')](_0x0614('0x9b'))){_0x210177[_0x0614('0x15')]=qs[_0x0614('0x15')](_0xc27155['query'][_0x0614('0x15')]);_0x210177[_0x0614('0x13')]=qs[_0x0614('0x13')](_0xc27155[_0x0614('0x22')][_0x0614('0x13')]);}_0x210177[_0x0614('0x80')]=qs['sort'](_0xc27155[_0x0614('0x22')][_0x0614('0x81')]);_0x210177[_0x0614('0x5d')]=qs[_0x0614('0x7b')](_[_0x0614('0x82')](_0xc27155[_0x0614('0x22')],_0x1cc200[_0x0614('0x7b')]));_0x210177[_0x0614('0x5d')][_0x0614('0xa0')]=_0x434354['id'];if(_0xc27155[_0x0614('0x22')]['filter']){_0x210177[_0x0614('0x5d')]=_['merge'](_0x210177[_0x0614('0x5d')],{'$or':_[_0x0614('0x71')](_0x210177[_0x0614('0x7e')],function(_0x238271){var _0x3169f1={};_0x3169f1[_0x238271]={'$like':'%'+_0xc27155[_0x0614('0x22')][_0x0614('0x83')]+'%'};return _0x3169f1;})});}_0x210177=_[_0x0614('0x36')]({},_0x210177,_0xc27155[_0x0614('0x84')]);return db[_0x0614('0x51')][_0x0614('0x16')]({'where':_0x210177['where']})['then'](function(_0x3ebecb){_0x14f4b2[_0x0614('0x16')]=_0x3ebecb;if(_0xc27155[_0x0614('0x22')][_0x0614('0xa1')]){_0x210177[_0x0614('0x9c')]=[{'all':!![]}];}return db[_0x0614('0x51')][_0x0614('0x21')](_0x210177);})[_0x0614('0x1b')](function(_0x3efad6){_0x14f4b2[_0x0614('0x9d')]=_0x3efad6;return _0x14f4b2;});}})[_0x0614('0x1b')](respondWithFilteredResult(_0x363787,_0x210177))[_0x0614('0x24')](handleError(_0x363787,null));};exports[_0x0614('0xa2')]=function(_0x4f592d,_0x50fbed){try{if(!_0x4f592d[_0x0614('0x37')][_0x0614('0x5e')]){throw new Error(_0x0614('0xa3'));}if(!_0x4f592d[_0x0614('0x37')][_0x0614('0xa4')]){throw new Error(_0x0614('0xa5'));}if(!_0x4f592d[_0x0614('0x37')][_0x0614('0xa6')]){throw new Error(_0x0614('0xa7'));}if(!_0x4f592d['body'][_0x0614('0xa8')]){throw new Error(_0x0614('0xa9'));}var _0x2fe012=_0x4f592d['body'][_0x0614('0xa4')][_0x0614('0xaa')](',');var _0x32974f=_0x4f592d['body'][_0x0614('0xa6')][_0x0614('0xaa')](',');if(!_0x2fe012[_0x0614('0x2b')]||!_0x32974f['length']||_0x2fe012[_0x0614('0x2b')]!==_0x32974f[_0x0614('0x2b')]){throw new Error(_0x0614('0xab'));}_0x4f592d[_0x0614('0x37')][_0x0614('0x7f')]=_['zipObject'](_0x2fe012,_0x32974f);if(!_0x4f592d[_0x0614('0x37')][_0x0614('0x7f')][_0x0614('0x78')]){throw new Error(_0x0614('0xac'));}if(!_0x4f592d[_0x0614('0x37')][_0x0614('0x7f')][_0x0614('0xad')]){throw new Error(_0x0614('0xae'));}var _0x3812d8=path[_0x0614('0x3c')](config[_0x0614('0xaf')],'server/files/tmp',_0x4f592d[_0x0614('0xb0')][_0x0614('0xb1')]);fs[_0x0614('0xb2')](_0x3812d8,parseInt(_0x0614('0xb3'),0x8));var _0x4b8e9f=require(_0x0614('0xb4'))[_0x0614('0xb5')](path['join'](__dirname,_0x0614('0xb6')),[_0x3812d8,_0x4f592d[_0x0614('0x37')]['binding_keys'],_0x4f592d['body'][_0x0614('0xa6')],_0x4f592d['body'][_0x0614('0x5e')],_0x4f592d['body'][_0x0614('0xb7')],_0x4f592d[_0x0614('0x37')][_0x0614('0x5c')],_0x4f592d['body'][_0x0614('0xa8')]]);return _0x50fbed[_0x0614('0x12')](0xc8)[_0x0614('0x19')]({'message':'File\x20uploaded\x20correctly!','pid':_0x4b8e9f[_0x0614('0xb8')]});}catch(_0x430c53){return _0x50fbed['status'](0x1f4)['send'](_0x430c53);}};exports[_0x0614('0xb9')]=function(_0x219a07,_0x504a52){var _0x5d0b44=fs[_0x0614('0xba')](_0x219a07['file'][_0x0614('0x3')]);Papa[_0x0614('0xbb')](_0x5d0b44,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2e0cf4){return _0x504a52[_0x0614('0x12')](0xc8)[_0x0614('0x19')]({'file':_0x219a07['file'],'fields':_0x2e0cf4[_0x0614('0xbc')][_0x0614('0x7f')]});}});};exports[_0x0614('0xbd')]=function(_0x3c7c49,_0x2a53cb){return db[_0x0614('0xbe')][_0x0614('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0614('0xbf')}})[_0x0614('0x1b')](function(_0x57ad5b){var _0x3a122c=![];if(!_0x3c7c49['body']['ListId']){throw new Error(_0x0614('0xa3'));}if(!_0x3c7c49[_0x0614('0x37')][_0x0614('0xc0')]['phone']){throw new Error(_0x0614('0xac'));}if(!_0x3c7c49['body']['binding'][_0x0614('0xad')]){throw new Error(_0x0614('0xae'));}if(!_0x3c7c49[_0x0614('0x37')][_0x0614('0xa8')]){throw new Error(_0x0614('0xa9'));}var _0x17c075=require(_0x0614('0xb4'))[_0x0614('0xb5')](path['join'](__dirname,'../../components/import/cm/csv2'),[_0x3c7c49['params']['id'],JSON[_0x0614('0xc1')](_0x3c7c49[_0x0614('0x37')]),JSON[_0x0614('0xc1')](_0x57ad5b)]);_0x17c075['on'](_0x0614('0xc2'),function(){_0x3a122c=!![];return _0x2a53cb[_0x0614('0x12')](0xc8)[_0x0614('0x19')]({'message':_0x0614('0xc3'),'pid':_0x17c075[_0x0614('0xb8')]});});_0x17c075['on'](_0x0614('0xc4'),function(_0x10e2e7){if(_0x10e2e7&&!_0x3a122c){return _0x2a53cb[_0x0614('0x12')](0x1f4)[_0x0614('0x19')]({'message':_0x0614('0xc5'),'pid':_0x17c075[_0x0614('0xb8')]});}});})[_0x0614('0x24')](handleError(_0x2a53cb,null));};exports[_0x0614('0xc6')]=function(_0x53ea21,_0x46c3f6){return db['User'][_0x0614('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0614('0xbf')}})[_0x0614('0x1b')](function(_0x2eb688){var _0xb9165c=![];if(!_0x53ea21[_0x0614('0x37')][_0x0614('0x5e')]){throw new Error('No\x20ListId\x20specified');}if(!_0x53ea21[_0x0614('0x37')]['binding'][_0x0614('0x78')]){throw new Error(_0x0614('0xac'));}if(!_0x53ea21[_0x0614('0x37')]['binding']['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x53ea21['body'][_0x0614('0xa8')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x99913d=require(_0x0614('0xb4'))[_0x0614('0xb5')](path['join'](__dirname,'../../components/import/cm/csvUpdates'),[_0x53ea21[_0x0614('0x27')]['id'],JSON[_0x0614('0xc1')](_0x53ea21[_0x0614('0x37')]),JSON['stringify'](_0x2eb688)]);_0x99913d['on'](_0x0614('0xc2'),function(){_0xb9165c=!![];return _0x46c3f6[_0x0614('0x12')](0xc8)[_0x0614('0x19')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x99913d['pid']});});_0x99913d['on'](_0x0614('0xc4'),function(_0x162130){if(_0x162130&&!_0xb9165c){return _0x46c3f6['status'](0x1f4)[_0x0614('0x19')]({'message':'error\x20child\x20process','pid':_0x99913d['pid']});}});})[_0x0614('0x24')](handleError(_0x46c3f6,null));};exports[_0x0614('0xc7')]=function(_0x2757f0,_0x2889c1){var _0x483e61=[_0x0614('0xc8'),'chat',_0x0614('0xc9'),'openchannel',_0x0614('0xca'),_0x0614('0xcb'),'voice'];var _0x33ff48={'offset':0x0,'order':qs[_0x0614('0x81')](_0x0614('0xcc'))},_0x4afa27={'count':0x0,'rows':[]};Promise[_0x0614('0xcd')]()['then'](function(){if(_0x2757f0['query'][_0x0614('0xce')]){if(!_[_0x0614('0xcf')](_0x483e61,_0x2757f0[_0x0614('0x22')][_0x0614('0xce')][_0x0614('0xd0')]())){throw new Error(_0x0614('0xd1'));}_0x483e61=[_0x2757f0[_0x0614('0x22')]['channel'][_0x0614('0xd0')]()];}if(_0x2757f0['query'][_0x0614('0xd2')]){try{var _0x5b6877=JSON['parse'](_0x2757f0['query'][_0x0614('0xd2')]);if(!moment(_0x5b6877[_0x0614('0x38')])[_0x0614('0xd3')]()){throw new Error(_0x0614('0xd4'));}if(!moment(_0x5b6877['to'])[_0x0614('0xd3')]()){throw new Error(_0x0614('0xd5'));}}catch(_0x27dcc5){throw new Error(_0x0614('0xd6'));}}if(!_0x2757f0[_0x0614('0x22')][_0x0614('0x85')]('nolimit')){_0x33ff48[_0x0614('0x15')]=qs[_0x0614('0x15')](_0x2757f0['query'][_0x0614('0x15')]||0xa);_0x33ff48['offset']=qs['offset'](_0x2757f0[_0x0614('0x22')][_0x0614('0x13')]);}var _0x225798=_0x483e61['map'](function(_0xedb624){if(_0xedb624===_0x0614('0xd7')){var _0xd23422={'attributes':['id',_0x0614('0xd8'),_0x0614('0x32'),_0x0614('0xd9'),_0x0614('0xda'),'callerid',_0x0614('0xdb'),_0x0614('0xdc'),_0x0614('0xdd'),_0x0614('0xde'),_0x0614('0xdf'),'userDisposition','userSecondDisposition',_0x0614('0xe0'),_0x0614('0xe1')],'where':{'ContactId':_0x2757f0[_0x0614('0x27')]['id']},'include':[{'model':db[_0x0614('0xbe')],'as':_0x0614('0xbe'),'attributes':['id',_0x0614('0x20'),_0x0614('0xe2'),'alias']}],'order':[[_0x0614('0xdf'),'DESC']]};if(_0x2757f0[_0x0614('0x22')][_0x0614('0xd2')]){_0xd23422[_0x0614('0x5d')][_0x0614('0xdf')]={'$gte':_0x5b6877[_0x0614('0x38')],'$lte':_0x5b6877['to']};}return db[_0x0614('0xe3')][_0x0614('0xe4')](_0xd23422)[_0x0614('0x1b')](function(_0x190d82){_0x4afa27[_0x0614('0x16')]+=_0x190d82[_0x0614('0x16')];return _[_0x0614('0x71')](_0x190d82[_0x0614('0x9d')],function(_0x16a3b2){var _0x474e5a=_0x16a3b2[_0x0614('0x39')]({'plain':!![]});_0x474e5a[_0x0614('0xce')]=_0xedb624;if(_0x474e5a[_0x0614('0xbe')]){_0x474e5a['User']={'id':_0x474e5a['User']['id'],'name':_0x474e5a[_0x0614('0xbe')][_0x0614('0x20')],'fullname':_0x474e5a['User'][_0x0614('0xe2')],'alias':_0x474e5a['User'][_0x0614('0xe5')]};}return _0x474e5a;});});}else{var _0x2da453=_[_0x0614('0xe6')](_0xedb624)+(_0xedb624==='chat'?_0x0614('0xe7'):_0x0614('0xe8'));var _0x277ca6={'attributes':['id',_0x0614('0xe9'),_0x0614('0xea'),_0x0614('0xdf'),_0x0614('0xde'),'disposition',_0x0614('0xeb'),_0x0614('0xec'),'UserId',_0x2da453+'Id'],'where':{'ContactId':_0x2757f0[_0x0614('0x27')]['id']},'include':[{'model':db[_0x2da453],'as':_0x0614('0xe8'),'attributes':['id','name',_0x0614('0xed')]},{'model':db['User'],'as':_0x0614('0xee'),'attributes':['id',_0x0614('0x20'),_0x0614('0xe2')]},{'model':db[_0x0614('0x63')],'as':'Tags','attributes':['id',_0x0614('0x20'),_0x0614('0xef')],'through':{'attributes':[]}}],'order':[['createdAt',_0x0614('0xf0')]]};if(_0x2757f0[_0x0614('0x22')]['range']){_0x277ca6[_0x0614('0x5d')][_0x0614('0xdf')]={'$gte':_0x5b6877[_0x0614('0x38')],'$lte':_0x5b6877['to']};}switch(_0xedb624){case _0x0614('0xf1'):_0x277ca6[_0x0614('0x7e')]['push']('browserName','customerIp','customerPort',_0x0614('0xf2'),_0x0614('0xf3'),_0x0614('0xf4'),'ratingType',_0x0614('0xf5'),_0x0614('0xf6'));break;case'mail':_0x277ca6['attributes'][_0x0614('0x60')](_0x0614('0xf7'),_0x0614('0xf8'));break;case _0x0614('0xf9'):_0x277ca6[_0x0614('0x7e')]['push'](_0x0614('0xfa'),_0x0614('0xfb'));break;}return db[_[_0x0614('0xe6')](_0xedb624)+'Interaction'][_0x0614('0xe4')](_0x277ca6)[_0x0614('0x1b')](function(_0x4a640c){_0x4afa27[_0x0614('0x16')]+=_0x4a640c[_0x0614('0x16')];return _[_0x0614('0x71')](_0x4a640c[_0x0614('0x9d')],function(_0x403652){var _0x30e85b=_0x403652[_0x0614('0x39')]({'plain':!![]});_0x30e85b[_0x0614('0xce')]=_0xedb624;if(_0x30e85b[_0x0614('0xee')]){_0x30e85b[_0x0614('0xee')]={'id':_0x30e85b['Owner']['id'],'name':_0x30e85b['Owner'][_0x0614('0x20')],'fullname':_0x30e85b[_0x0614('0xee')][_0x0614('0xe2')]};}return _0x30e85b;});});}});return Promise[_0x0614('0x61')](_0x225798);})[_0x0614('0x1b')](function(_0x48316c){return _(_0x48316c)[_0x0614('0xfc')]()[_0x0614('0xfd')]('createdAt')[_0x0614('0xfe')]()[_0x0614('0xff')]();})['then'](function(_0x506618){_0x4afa27[_0x0614('0x9d')]=_0x33ff48[_0x0614('0x15')]?_0x506618['slice'](_0x33ff48[_0x0614('0x13')],_0x33ff48[_0x0614('0x13')]+_0x33ff48[_0x0614('0x15')]):_0x506618;return _0x4afa27;})[_0x0614('0x1b')](respondWithFilteredResult(_0x2889c1,_0x33ff48))['catch'](handleError(_0x2889c1,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index a0f08bd..a9cbcb8 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 _0xf818=['emit','hasOwnProperty','hook','events','../../mysqldb','CmContact','setMaxListeners','save','update','remove'];(function(_0x5811d8,_0x5b7b56){var _0x321b47=function(_0x303969){while(--_0x303969){_0x5811d8['push'](_0x5811d8['shift']());}};_0x321b47(++_0x5b7b56);}(_0xf818,0x161));var _0x8f81=function(_0x1fdef5,_0x455a09){_0x1fdef5=_0x1fdef5-0x0;var _0x91a49a=_0xf818[_0x1fdef5];return _0x91a49a;};'use strict';var EventEmitter=require(_0x8f81('0x0'));var CmContact=require(_0x8f81('0x1'))['db'][_0x8f81('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8f81('0x3')](0x0);var events={'afterCreate':_0x8f81('0x4'),'afterUpdate':_0x8f81('0x5'),'afterDestroy':_0x8f81('0x6')};function emitEvent(_0x33ccef){return function(_0x5cc7ce,_0x4f2d67,_0x84eff3){CmContactEvents[_0x8f81('0x7')](_0x33ccef+':'+_0x5cc7ce['id'],_0x5cc7ce);CmContactEvents[_0x8f81('0x7')](_0x33ccef,_0x5cc7ce);_0x84eff3(null);};}for(var e in events){if(events[_0x8f81('0x8')](e)){var event=events[e];CmContact[_0x8f81('0x9')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x5070=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x29c42c,_0x12a918){var _0x5ea3db=function(_0x45424e){while(--_0x45424e){_0x29c42c['push'](_0x29c42c['shift']());}};_0x5ea3db(++_0x12a918);}(_0x5070,0xb0));var _0x0507=function(_0x3905ed,_0x5350e3){_0x3905ed=_0x3905ed-0x0;var _0x33e9ea=_0x5070[_0x3905ed];return _0x33e9ea;};'use strict';var EventEmitter=require(_0x0507('0x0'));var CmContact=require(_0x0507('0x1'))['db'][_0x0507('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0507('0x3')](0x0);var events={'afterCreate':_0x0507('0x4'),'afterUpdate':_0x0507('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b4a21){return function(_0x34422a,_0xa9ab66,_0x44f8d5){CmContactEvents['emit'](_0x5b4a21+':'+_0x34422a['id'],_0x34422a);CmContactEvents[_0x0507('0x6')](_0x5b4a21,_0x34422a);_0x44f8d5(null);};}for(var e in events){if(events[_0x0507('0x7')](e)){var event=events[e];CmContact[_0x0507('0x8')](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 65d37e3..cb1978a 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 _0x4a68=['create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','afterCreate','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','outbound','Lists','length','get','dialCheckDuplicateType','onlyIfOpen','CmList','BlackLists','CmHopperBlack','error','message','always','cmContact,\x20%s,\x20%s','List\x20not\x20found','models','destroy','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','then','isNil','timezones','utcOffset','minutes','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4a68,0x1d4));var _0x84a6=function(_0x56d444,_0x2ee7c8){_0x56d444=_0x56d444-0x0;var _0x4cbca1=_0x4a68[_0x56d444];return _0x4cbca1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x84a6('0x0'))(_0x84a6('0x1'));var moment=require(_0x84a6('0x2'));var BPromise=require(_0x84a6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84a6('0x4'));var rimraf=require('rimraf');var config=require(_0x84a6('0x5'));var shared=require('../../config/environment/shared');var attributes=require(_0x84a6('0x6'));module[_0x84a6('0x7')]=function(_0x4466cb,_0x33ddcc){return _0x4466cb[_0x84a6('0x8')](_0x84a6('0x9'),attributes,{'tableName':_0x84a6('0xa'),'paranoid':!![],'indexes':[{'name':_0x84a6('0xb'),'fields':[_0x84a6('0xb')]},{'name':_0x84a6('0xc'),'fields':['firstName',_0x84a6('0xd'),_0x84a6('0xb'),_0x84a6('0xe'),_0x84a6('0xf'),_0x84a6('0x10')],'type':_0x84a6('0x11')}],'timestamps':!![],'charset':_0x84a6('0x12'),'collate':_0x84a6('0x13'),'hooks':{'afterCreate':function(_0x326a51,_0x2b34ed,_0x534d1b){var _0x4b74c5=_0x4466cb['models'];var _0x223234=_0x326a51['get']({'plain':!![]});function _0x3e2b45(){return function(_0x4363de){logger['error']('cmContact','afterCreate',util[_0x84a6('0x14')](_0x4363de,{'showHidden':![],'depth':null}));};}function _0x582db7(_0x13fab2,_0x56149e){var _0x109a92=_0x56149e[_0x84a6('0x15')]?_0x56149e[_0x84a6('0x15')]:moment()[_0x84a6('0x16')](_0x84a6('0x17'));return new BPromise(function(_0xc08e37,_0x5c8273){if(_['isNil'](_0x56149e[_0x84a6('0x18')])){_0xc08e37({'ret':_0x109a92});}else{_0x4b74c5[_0x84a6('0x19')]['findOne']({'where':{'id':_0x13fab2['id']}})[_0x84a6('0x1a')](function(_0x403a53){if(!_[_0x84a6('0x1b')](_0x403a53)){var _0x48e4f8=_0x403a53['dialTimezone'];if(!_[_0x84a6('0x1b')](_0x48e4f8)){var _0x442886=shared[_0x84a6('0x1c')];var _0xc7fa66=_0x442886[_0x48e4f8];var _0x1d7df1=_0x442886[_0x56149e[_0x84a6('0x18')]];if(!_['isNil'](_0xc7fa66)&&!_[_0x84a6('0x1b')](_0x1d7df1)){var _0x295242=_0xc7fa66[_0x84a6('0x1d')]-_0x1d7df1[_0x84a6('0x1d')];_0x109a92=_0x56149e[_0x84a6('0x15')]?_0x56149e[_0x84a6('0x15')]:moment();var _0x1499b0=moment(_0x109a92)['add'](_0x295242,_0x84a6('0x1e'));_0xc08e37({'ret':_0x1499b0[_0x84a6('0x16')](_0x84a6('0x17'))});}else _0xc08e37({'ret':_0x109a92});}else _0xc08e37({'ret':_0x109a92});}else{_0xc08e37({'ret':_0x109a92});}});}});return 0xa;}var _0xcfae24=function(_0x34d8b5){return new BPromise(function(_0x1da138,_0x2d5b17){_0x582db7(_0x34d8b5,_0x223234)[_0x84a6('0x1a')](function(_0xc2508c){_0x223234[_0x84a6('0x15')]=_0xc2508c[_0x84a6('0x1f')];_0x4b74c5['CmHopper'][_0x84a6('0x20')]({'where':{'phone':_0x223234['phone'],'VoiceQueueId':_0x34d8b5['id']}})[_0x84a6('0x1a')](function(_0x45d9a7){if(!_[_0x84a6('0x1b')](_0x45d9a7)){throw new Error(_0x84a6('0x21')+_0x223234['phone']+_0x84a6('0x22')+_0x34d8b5['id']);}return _0x4b74c5[_0x84a6('0x23')][_0x84a6('0x24')]({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'priority':_0x223234[_0x84a6('0x26')]?_0x223234[_0x84a6('0x26')]:0x2,'scheduledat':_0x223234[_0x84a6('0x15')]?_0x223234[_0x84a6('0x15')]:moment()['format'](_0x84a6('0x17')),'callback':_0x223234[_0x84a6('0x27')]?!![]:![],'callbackuniqueid':_0x223234['callbackUniqueid']?_0x223234[_0x84a6('0x27')]:undefined,'callbackat':_0x223234[_0x84a6('0x27')]?moment()['format'](_0x84a6('0x17')):undefined,'VoiceQueueId':_0x34d8b5['id']});})[_0x84a6('0x28')](function(_0x9f2abd){_0x2d5b17(_0x9f2abd);});});});};var _0x2adff1=function(_0x25f9cd){return new BPromise(function(_0x698233,_0x31b7d4){_0x582db7(_0x25f9cd,_0x223234)[_0x84a6('0x1a')](function(_0x75e481){_0x223234[_0x84a6('0x15')]=_0x75e481[_0x84a6('0x1f')];_0x4b74c5[_0x84a6('0x23')][_0x84a6('0x20')]({'where':{'phone':_0x223234[_0x84a6('0xb')],'VoiceQueueId':_0x25f9cd['id']}})[_0x84a6('0x1a')](function(_0x1d3c7c){if(!_[_0x84a6('0x1b')](_0x1d3c7c)){throw new Error(_0x84a6('0x21')+_0x223234['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x25f9cd['id']);}return _0x4b74c5[_0x84a6('0x29')]['findOne']({'where':{'calleridnum':_0x223234[_0x84a6('0xb')],'VoiceQueueId':_0x25f9cd['id']}});})[_0x84a6('0x1a')](function(_0x117d96){if(!_['isNil'](_0x117d96)){throw new Error(_0x84a6('0x2a')+_0x223234['phone']+_0x84a6('0x2b')+_0x25f9cd['id']);}return _0x4b74c5[_0x84a6('0x23')][_0x84a6('0x24')]({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'priority':_0x223234['priority']?_0x223234[_0x84a6('0x26')]:0x2,'scheduledat':_0x223234[_0x84a6('0x15')]?_0x223234[_0x84a6('0x15')]:moment()[_0x84a6('0x16')](_0x84a6('0x17')),'callback':_0x223234[_0x84a6('0x27')]?!![]:![],'callbackuniqueid':_0x223234[_0x84a6('0x27')]?_0x223234['callbackUniqueid']:undefined,'callbackat':_0x223234[_0x84a6('0x27')]?moment()[_0x84a6('0x16')](_0x84a6('0x17')):undefined,'VoiceQueueId':_0x25f9cd['id']});})['catch'](function(_0x16ab6d){_0x31b7d4(_0x16ab6d);});});});};function _0x48dea7(){return function(_0x413387){logger['error'](_0x84a6('0x2c'),_0x84a6('0x2d'),util[_0x84a6('0x14')](_0x413387,{'showHidden':![],'depth':null}));};}function _0x4984b1(_0x11fe25,_0x34e84c){var _0x3f26a8=_0x34e84c[_0x84a6('0x15')]?_0x34e84c[_0x84a6('0x15')]:moment()[_0x84a6('0x16')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x47501c,_0x25f0f2){if(_[_0x84a6('0x1b')](_0x34e84c[_0x84a6('0x18')])){_0x47501c({'ret':_0x3f26a8});}else{_0x4b74c5[_0x84a6('0x2e')][_0x84a6('0x20')]({'where':{'id':_0x11fe25['id']}})[_0x84a6('0x1a')](function(_0x483f3a){if(!_['isNil'](_0x483f3a)){var _0x488852=_0x483f3a[_0x84a6('0x18')];if(!_[_0x84a6('0x1b')](_0x488852)){var _0x387d78=shared[_0x84a6('0x1c')];var _0x31a70c=_0x387d78[_0x488852];var _0x36b385=_0x387d78[_0x34e84c[_0x84a6('0x18')]];if(!_[_0x84a6('0x1b')](_0x31a70c)&&!_['isNil'](_0x36b385)){var _0x4feccb=_0x31a70c['utcOffset']-_0x36b385[_0x84a6('0x1d')];_0x3f26a8=_0x34e84c[_0x84a6('0x15')]?_0x34e84c[_0x84a6('0x15')]:moment();var _0xfafc6f=moment(_0x3f26a8)['add'](_0x4feccb,_0x84a6('0x1e'));_0x47501c({'ret':_0xfafc6f['format'](_0x84a6('0x17'))});}else _0x47501c({'ret':_0x3f26a8});}else _0x47501c({'ret':_0x3f26a8});}else{_0x47501c({'ret':_0x3f26a8});}});}});return 0xa;}var _0x143db6=function(_0x21a410){return new BPromise(function(_0x3b8f86,_0x24e8b2){_0x4984b1(_0x21a410,_0x223234)[_0x84a6('0x1a')](function(_0x553166){_0x223234[_0x84a6('0x15')]=_0x553166[_0x84a6('0x1f')];_0x4b74c5[_0x84a6('0x23')]['findOne']({'where':{'phone':_0x223234[_0x84a6('0xb')],'CampaignId':_0x21a410['id']}})[_0x84a6('0x1a')](function(_0x39c853){if(!_[_0x84a6('0x1b')](_0x39c853)){throw new Error('cmContact,\x20afterCreate\x20'+_0x223234[_0x84a6('0xb')]+_0x84a6('0x2f')+_0x21a410['id']);}return _0x4b74c5[_0x84a6('0x23')][_0x84a6('0x24')]({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'priority':_0x223234[_0x84a6('0x26')]?_0x223234[_0x84a6('0x26')]:0x2,'scheduledat':_0x223234[_0x84a6('0x15')]?_0x223234[_0x84a6('0x15')]:moment()[_0x84a6('0x16')](_0x84a6('0x17')),'callback':_0x223234[_0x84a6('0x27')]?!![]:![],'callbackuniqueid':_0x223234[_0x84a6('0x27')]?_0x223234[_0x84a6('0x27')]:undefined,'callbackat':_0x223234[_0x84a6('0x27')]?moment()[_0x84a6('0x16')](_0x84a6('0x17')):undefined,'CampaignId':_0x21a410['id']});})[_0x84a6('0x28')](function(_0x5172a1){_0x24e8b2(_0x5172a1);});});});};var _0x531034=function(_0x5ba7b0){return new BPromise(function(_0x56a592,_0x7961a6){_0x4984b1(_0x5ba7b0,_0x223234)[_0x84a6('0x1a')](function(_0x22f231){_0x223234[_0x84a6('0x15')]=_0x22f231[_0x84a6('0x1f')];_0x4b74c5['CmHopper'][_0x84a6('0x20')]({'where':{'phone':_0x223234[_0x84a6('0xb')],'CampaignId':_0x5ba7b0['id']}})[_0x84a6('0x1a')](function(_0x5054d5){if(!_[_0x84a6('0x1b')](_0x5054d5)){throw new Error(_0x84a6('0x21')+_0x223234[_0x84a6('0xb')]+_0x84a6('0x30')+_0x5ba7b0['id']);}return _0x4b74c5[_0x84a6('0x29')]['findOne']({'where':{'calleridnum':_0x223234[_0x84a6('0xb')],'CampaignId':_0x5ba7b0['id']}});})[_0x84a6('0x1a')](function(_0xb511c7){if(!_[_0x84a6('0x1b')](_0xb511c7)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x223234['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x5ba7b0['id']);}return _0x4b74c5[_0x84a6('0x23')]['create']({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'priority':_0x223234[_0x84a6('0x26')]?_0x223234[_0x84a6('0x26')]:0x2,'scheduledat':_0x223234[_0x84a6('0x15')]?_0x223234[_0x84a6('0x15')]:moment()[_0x84a6('0x16')](_0x84a6('0x17')),'callback':_0x223234['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x223234[_0x84a6('0x27')]?_0x223234[_0x84a6('0x27')]:undefined,'callbackat':_0x223234['callbackUniqueid']?moment()['format'](_0x84a6('0x17')):undefined,'CampaignId':_0x5ba7b0['id']});})[_0x84a6('0x28')](function(_0x1e8ceb){_0x7961a6(_0x1e8ceb);});});});};if(_0x223234[_0x84a6('0x25')]){_0x4b74c5[_0x84a6('0x19')][_0x84a6('0x31')]({'where':{'type':_0x84a6('0x32')},'attributes':['id','dialCheckDuplicateType',_0x84a6('0x18')],'include':[{'model':_0x4b74c5['CmList'],'as':_0x84a6('0x33'),'where':{'id':_0x223234[_0x84a6('0x25')]}}]})[_0x84a6('0x1a')](function(_0x547ba8){if(_0x547ba8){var _0x570e7c=[];for(var _0x47e2ba=0x0,_0x6cab1e;_0x47e2ba<_0x547ba8[_0x84a6('0x34')];_0x47e2ba+=0x1){_0x6cab1e=_0x547ba8[_0x47e2ba][_0x84a6('0x35')]({'plain':!![]});switch(_0x6cab1e[_0x84a6('0x36')]){case'always':_0x2adff1(_0x6cab1e)[_0x84a6('0x28')](_0x3e2b45());break;case _0x84a6('0x37'):_0xcfae24(_0x6cab1e)[_0x84a6('0x28')](_0x3e2b45());break;default:_0x4984b1(_0x6cab1e,_0x223234)[_0x84a6('0x1a')](function(_0x1cf464){_0x223234['scheduledat']=_0x1cf464['ret'];_0x4b74c5[_0x84a6('0x23')][_0x84a6('0x24')]({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'scheduledat':_0x223234[_0x84a6('0x15')]?_0x223234[_0x84a6('0x15')]:moment()[_0x84a6('0x16')](_0x84a6('0x17')),'priority':_0x223234[_0x84a6('0x26')]?_0x223234[_0x84a6('0x26')]:0x2,'callback':_0x223234[_0x84a6('0x27')]?!![]:![],'callbackuniqueid':_0x223234[_0x84a6('0x27')]?_0x223234[_0x84a6('0x27')]:undefined,'callbackat':_0x223234['callbackUniqueid']?moment()[_0x84a6('0x16')](_0x84a6('0x17')):undefined,'VoiceQueueId':_0x6cab1e['id']})[_0x84a6('0x28')](_0x3e2b45());});}}}})[_0x84a6('0x1a')](function(){return _0x4b74c5[_0x84a6('0x19')]['findAll']({'where':{'type':_0x84a6('0x32')},'attributes':['id'],'include':[{'model':_0x4b74c5[_0x84a6('0x38')],'as':_0x84a6('0x39'),'where':{'id':_0x223234[_0x84a6('0x25')]}}]})[_0x84a6('0x1a')](function(_0x275666){if(_0x275666){var _0x70dd10=[];for(var _0x330d20=0x0,_0x1e1893;_0x330d20<_0x275666[_0x84a6('0x34')];_0x330d20+=0x1){_0x1e1893=_0x275666[_0x330d20]['get']({'plain':!![]});_0x4b74c5[_0x84a6('0x3a')][_0x84a6('0x24')]({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'VoiceQueueId':_0x1e1893['id']})[_0x84a6('0x28')](function(_0x963c41){logger[_0x84a6('0x3b')]('cmContact,\x20%s,\x20%s',_0x84a6('0x2d'),_0x963c41[_0x84a6('0x3c')]);});}}});})[_0x84a6('0x1a')](function(){return _0x4b74c5[_0x84a6('0x2e')]['findAll']({'attributes':['id',_0x84a6('0x36'),_0x84a6('0x18')],'include':[{'model':_0x4b74c5['CmList'],'as':'Lists','where':{'id':_0x223234[_0x84a6('0x25')]}}]})[_0x84a6('0x1a')](function(_0x159104){if(_0x159104){var _0xfdf8eb=[];for(var _0x5551da=0x0,_0x5b60e6;_0x5551da<_0x159104[_0x84a6('0x34')];_0x5551da+=0x1){_0x5b60e6=_0x159104[_0x5551da][_0x84a6('0x35')]({'plain':!![]});switch(_0x5b60e6['dialCheckDuplicateType']){case _0x84a6('0x3d'):_0x531034(_0x5b60e6)[_0x84a6('0x28')](_0x48dea7());break;case _0x84a6('0x37'):_0x143db6(_0x5b60e6)['catch'](_0x48dea7());break;default:_0x4b74c5[_0x84a6('0x23')]['create']({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'scheduledat':_0x223234[_0x84a6('0x15')]?_0x223234['scheduledat']:moment()[_0x84a6('0x16')](_0x84a6('0x17')),'priority':_0x223234['priority']?_0x223234[_0x84a6('0x26')]:0x2,'callback':_0x223234[_0x84a6('0x27')]?!![]:![],'callbackuniqueid':_0x223234[_0x84a6('0x27')]?_0x223234[_0x84a6('0x27')]:undefined,'callbackat':_0x223234['callbackUniqueid']?moment()['format'](_0x84a6('0x17')):undefined,'CampaignId':_0x5b60e6['id']})['catch'](_0x48dea7());}}}});})[_0x84a6('0x1a')](function(){return _0x4b74c5[_0x84a6('0x2e')]['findAll']({'attributes':['id'],'include':[{'model':_0x4b74c5['CmList'],'as':_0x84a6('0x39'),'where':{'id':_0x223234['ListId']}}]})[_0x84a6('0x1a')](function(_0x5d1844){if(_0x5d1844){var _0x870013=[];for(var _0x5a8f90=0x0,_0x5920e6;_0x5a8f90<_0x5d1844[_0x84a6('0x34')];_0x5a8f90+=0x1){_0x5920e6=_0x5d1844[_0x5a8f90][_0x84a6('0x35')]({'plain':!![]});_0x4b74c5[_0x84a6('0x3a')][_0x84a6('0x24')]({'phone':_0x223234[_0x84a6('0xb')],'ContactId':_0x223234['id'],'ListId':_0x223234[_0x84a6('0x25')],'CampaignId':_0x5920e6['id']})[_0x84a6('0x28')](function(_0x338072){logger[_0x84a6('0x3b')](_0x84a6('0x3e'),_0x84a6('0x2d'),_0x338072[_0x84a6('0x3c')]);});}}});})[_0x84a6('0x1a')](function(){_0x534d1b();})[_0x84a6('0x28')](function(_0x53d6f7){logger['error']('cmContact,\x20%s,\x20%s',_0x84a6('0x2d'),_0x53d6f7['message']);_0x534d1b(_0x53d6f7);});}else{_0x534d1b(new Error(_0x84a6('0x3f')));}},'afterDestroy':function(_0x16b6ae,_0x57d3fc,_0x529887){var _0x4a744f=_0x4466cb[_0x84a6('0x40')];var _0x5ac408=_0x16b6ae['get']({'plain':!![]});return _0x4a744f[_0x84a6('0x23')][_0x84a6('0x31')]({'raw':!![],'where':{'ListId':_0x5ac408['ListId'],'ContactId':_0x5ac408['id']}})[_0x84a6('0x1a')](function(_0x506105){if(!_['isEmpty'](_0x506105)){var _0x166294=[];for(var _0x1db8ef=0x0;_0x1db8ef<_0x506105[_0x84a6('0x34')];_0x1db8ef+=0x1){var _0x10223e=_0x4a744f[_0x84a6('0x23')][_0x84a6('0x41')]({'where':{'ListId':_0x506105[_0x1db8ef]['ListId'],'ContactId':_0x506105[_0x1db8ef]['ContactId'],'VoiceQueueId':_0x506105[_0x1db8ef][_0x84a6('0x42')],'CampaignId':_0x506105[_0x1db8ef][_0x84a6('0x43')]}});_0x166294['push'](_0x10223e);}return BPromise[_0x84a6('0x44')](_0x166294);}})['then'](function(_0x56577f){logger[_0x84a6('0x45')](_0x84a6('0x46'),util[_0x84a6('0x14')](_0x56577f,{'showHidden':![],'depth':null}));_0x529887();})[_0x84a6('0x28')](function(_0x2aa066){logger['error'](_0x84a6('0x47'),util[_0x84a6('0x14')](_0x2aa066,{'showHidden':![],'depth':null}));_0x529887(_0x2aa066);});}}});}; \ No newline at end of file +var _0x4db2=['create','error','cmContact','afterCreate','Campaign','timezones','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','get','always','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','CmHopperBlack','message','ContactId','VoiceQueueId','CampaignId','all','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','phone','fti_cm_contacts','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','ListId','priority','callbackUniqueid','CmHopperFinal'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4db2,0xab));var _0x24db=function(_0x1058ed,_0x109d8d){_0x1058ed=_0x1058ed-0x0;var _0x4e4661=_0x4db2[_0x1058ed];return _0x4e4661;};'use strict';var _=require(_0x24db('0x0'));var util=require(_0x24db('0x1'));var logger=require(_0x24db('0x2'))(_0x24db('0x3'));var moment=require(_0x24db('0x4'));var BPromise=require(_0x24db('0x5'));var rp=require(_0x24db('0x6'));var fs=require('fs');var path=require(_0x24db('0x7'));var rimraf=require(_0x24db('0x8'));var config=require(_0x24db('0x9'));var shared=require(_0x24db('0xa'));var attributes=require(_0x24db('0xb'));module['exports']=function(_0x238749,_0x3b5d78){return _0x238749[_0x24db('0xc')]('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x24db('0xd'),'fields':[_0x24db('0xd')]},{'name':_0x24db('0xe'),'fields':[_0x24db('0xf'),'lastName',_0x24db('0xd'),_0x24db('0x10'),_0x24db('0x11'),_0x24db('0x12')],'type':_0x24db('0x13')}],'timestamps':!![],'charset':_0x24db('0x14'),'collate':_0x24db('0x15'),'hooks':{'afterCreate':function(_0x201e0e,_0xfd1a13,_0x13a633){var _0x39802f=_0x238749[_0x24db('0x16')];var _0x1d13a6=_0x201e0e['get']({'plain':!![]});function _0x4b0689(){return function(_0x3bb167){logger['error']('cmContact','afterCreate',util[_0x24db('0x17')](_0x3bb167,{'showHidden':![],'depth':null}));};}function _0x4f8d6c(_0x2e8501,_0xb66f29){var _0x2cbb5d=_0xb66f29[_0x24db('0x18')]?_0xb66f29[_0x24db('0x18')]:moment()[_0x24db('0x19')](_0x24db('0x1a'));return new BPromise(function(_0x46a514,_0x42244d){if(_[_0x24db('0x1b')](_0xb66f29[_0x24db('0x1c')])){_0x46a514({'ret':_0x2cbb5d});}else{_0x39802f[_0x24db('0x1d')][_0x24db('0x1e')]({'where':{'id':_0x2e8501['id']}})[_0x24db('0x1f')](function(_0xb9758e){if(!_[_0x24db('0x1b')](_0xb9758e)){var _0x103596=_0xb9758e[_0x24db('0x1c')];if(!_[_0x24db('0x1b')](_0x103596)){var _0x2408f8=shared['timezones'];var _0x481ccb=_0x2408f8[_0x103596];var _0x579533=_0x2408f8[_0xb66f29[_0x24db('0x1c')]];if(!_[_0x24db('0x1b')](_0x481ccb)&&!_['isNil'](_0x579533)){var _0x212712=_0x481ccb['utcOffset']-_0x579533[_0x24db('0x20')];_0x2cbb5d=_0xb66f29[_0x24db('0x18')]?_0xb66f29[_0x24db('0x18')]:moment();var _0x33f908=moment(_0x2cbb5d)['add'](_0x212712,_0x24db('0x21'));_0x46a514({'ret':_0x33f908[_0x24db('0x19')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x46a514({'ret':_0x2cbb5d});}else _0x46a514({'ret':_0x2cbb5d});}else{_0x46a514({'ret':_0x2cbb5d});}});}});return 0xa;}var _0x495905=function(_0x444fd3){return new BPromise(function(_0x4cd074,_0x3d31a8){_0x4f8d6c(_0x444fd3,_0x1d13a6)[_0x24db('0x1f')](function(_0x21daf8){_0x1d13a6['scheduledat']=_0x21daf8[_0x24db('0x22')];_0x39802f['CmHopper']['findOne']({'where':{'phone':_0x1d13a6[_0x24db('0xd')],'VoiceQueueId':_0x444fd3['id']}})[_0x24db('0x1f')](function(_0x298200){if(!_['isNil'](_0x298200)){throw new Error(_0x24db('0x23')+_0x1d13a6[_0x24db('0xd')]+_0x24db('0x24')+_0x444fd3['id']);}return _0x39802f[_0x24db('0x25')]['create']({'phone':_0x1d13a6['phone'],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'priority':_0x1d13a6[_0x24db('0x27')]?_0x1d13a6[_0x24db('0x27')]:0x2,'scheduledat':_0x1d13a6['scheduledat']?_0x1d13a6['scheduledat']:moment()['format'](_0x24db('0x1a')),'callback':_0x1d13a6[_0x24db('0x28')]?!![]:![],'callbackuniqueid':_0x1d13a6['callbackUniqueid']?_0x1d13a6[_0x24db('0x28')]:undefined,'callbackat':_0x1d13a6[_0x24db('0x28')]?moment()[_0x24db('0x19')](_0x24db('0x1a')):undefined,'VoiceQueueId':_0x444fd3['id']});})['catch'](function(_0x4dd720){_0x3d31a8(_0x4dd720);});});});};var _0x347a6a=function(_0x37a1c2){return new BPromise(function(_0x42958e,_0x55eafa){_0x4f8d6c(_0x37a1c2,_0x1d13a6)[_0x24db('0x1f')](function(_0x456070){_0x1d13a6[_0x24db('0x18')]=_0x456070['ret'];_0x39802f[_0x24db('0x25')][_0x24db('0x1e')]({'where':{'phone':_0x1d13a6[_0x24db('0xd')],'VoiceQueueId':_0x37a1c2['id']}})['then'](function(_0x5f582f){if(!_[_0x24db('0x1b')](_0x5f582f)){throw new Error(_0x24db('0x23')+_0x1d13a6[_0x24db('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x37a1c2['id']);}return _0x39802f[_0x24db('0x29')]['findOne']({'where':{'calleridnum':_0x1d13a6['phone'],'VoiceQueueId':_0x37a1c2['id']}});})[_0x24db('0x1f')](function(_0x2300ae){if(!_['isNil'](_0x2300ae)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1d13a6[_0x24db('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x37a1c2['id']);}return _0x39802f['CmHopper'][_0x24db('0x2a')]({'phone':_0x1d13a6[_0x24db('0xd')],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'priority':_0x1d13a6[_0x24db('0x27')]?_0x1d13a6[_0x24db('0x27')]:0x2,'scheduledat':_0x1d13a6['scheduledat']?_0x1d13a6['scheduledat']:moment()[_0x24db('0x19')](_0x24db('0x1a')),'callback':_0x1d13a6[_0x24db('0x28')]?!![]:![],'callbackuniqueid':_0x1d13a6['callbackUniqueid']?_0x1d13a6[_0x24db('0x28')]:undefined,'callbackat':_0x1d13a6[_0x24db('0x28')]?moment()['format'](_0x24db('0x1a')):undefined,'VoiceQueueId':_0x37a1c2['id']});})['catch'](function(_0x1406f4){_0x55eafa(_0x1406f4);});});});};function _0x42fb17(){return function(_0xa20e2e){logger[_0x24db('0x2b')](_0x24db('0x2c'),_0x24db('0x2d'),util[_0x24db('0x17')](_0xa20e2e,{'showHidden':![],'depth':null}));};}function _0xb17830(_0x32dca4,_0x58ab12){var _0x2990df=_0x58ab12[_0x24db('0x18')]?_0x58ab12[_0x24db('0x18')]:moment()[_0x24db('0x19')](_0x24db('0x1a'));return new BPromise(function(_0x2c50d1,_0x7a19e6){if(_[_0x24db('0x1b')](_0x58ab12[_0x24db('0x1c')])){_0x2c50d1({'ret':_0x2990df});}else{_0x39802f[_0x24db('0x2e')][_0x24db('0x1e')]({'where':{'id':_0x32dca4['id']}})[_0x24db('0x1f')](function(_0x3ead7e){if(!_[_0x24db('0x1b')](_0x3ead7e)){var _0x680faa=_0x3ead7e[_0x24db('0x1c')];if(!_[_0x24db('0x1b')](_0x680faa)){var _0x4b5368=shared[_0x24db('0x2f')];var _0x4c3898=_0x4b5368[_0x680faa];var _0x4b5b8d=_0x4b5368[_0x58ab12['dialTimezone']];if(!_[_0x24db('0x1b')](_0x4c3898)&&!_[_0x24db('0x1b')](_0x4b5b8d)){var _0x2df751=_0x4c3898[_0x24db('0x20')]-_0x4b5b8d[_0x24db('0x20')];_0x2990df=_0x58ab12['scheduledat']?_0x58ab12['scheduledat']:moment();var _0x44a21f=moment(_0x2990df)[_0x24db('0x30')](_0x2df751,_0x24db('0x21'));_0x2c50d1({'ret':_0x44a21f[_0x24db('0x19')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2c50d1({'ret':_0x2990df});}else _0x2c50d1({'ret':_0x2990df});}else{_0x2c50d1({'ret':_0x2990df});}});}});return 0xa;}var _0x1fcaf8=function(_0x758e36){return new BPromise(function(_0x3432c5,_0x41968a){_0xb17830(_0x758e36,_0x1d13a6)[_0x24db('0x1f')](function(_0x5a950d){_0x1d13a6[_0x24db('0x18')]=_0x5a950d[_0x24db('0x22')];_0x39802f[_0x24db('0x25')][_0x24db('0x1e')]({'where':{'phone':_0x1d13a6[_0x24db('0xd')],'CampaignId':_0x758e36['id']}})['then'](function(_0x164697){if(!_['isNil'](_0x164697)){throw new Error(_0x24db('0x23')+_0x1d13a6['phone']+_0x24db('0x31')+_0x758e36['id']);}return _0x39802f[_0x24db('0x25')][_0x24db('0x2a')]({'phone':_0x1d13a6[_0x24db('0xd')],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'priority':_0x1d13a6[_0x24db('0x27')]?_0x1d13a6[_0x24db('0x27')]:0x2,'scheduledat':_0x1d13a6[_0x24db('0x18')]?_0x1d13a6['scheduledat']:moment()[_0x24db('0x19')](_0x24db('0x1a')),'callback':_0x1d13a6[_0x24db('0x28')]?!![]:![],'callbackuniqueid':_0x1d13a6[_0x24db('0x28')]?_0x1d13a6[_0x24db('0x28')]:undefined,'callbackat':_0x1d13a6[_0x24db('0x28')]?moment()['format'](_0x24db('0x1a')):undefined,'CampaignId':_0x758e36['id']});})[_0x24db('0x32')](function(_0x1f4d99){_0x41968a(_0x1f4d99);});});});};var _0x3d86fc=function(_0x4a021f){return new BPromise(function(_0x5290ed,_0x27fec2){_0xb17830(_0x4a021f,_0x1d13a6)[_0x24db('0x1f')](function(_0x54e568){_0x1d13a6['scheduledat']=_0x54e568[_0x24db('0x22')];_0x39802f[_0x24db('0x25')]['findOne']({'where':{'phone':_0x1d13a6[_0x24db('0xd')],'CampaignId':_0x4a021f['id']}})[_0x24db('0x1f')](function(_0x1cabc2){if(!_[_0x24db('0x1b')](_0x1cabc2)){throw new Error(_0x24db('0x23')+_0x1d13a6['phone']+_0x24db('0x33')+_0x4a021f['id']);}return _0x39802f[_0x24db('0x29')][_0x24db('0x1e')]({'where':{'calleridnum':_0x1d13a6[_0x24db('0xd')],'CampaignId':_0x4a021f['id']}});})['then'](function(_0x853381){if(!_['isNil'](_0x853381)){throw new Error(_0x24db('0x34')+_0x1d13a6['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x4a021f['id']);}return _0x39802f[_0x24db('0x25')][_0x24db('0x2a')]({'phone':_0x1d13a6['phone'],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'priority':_0x1d13a6['priority']?_0x1d13a6[_0x24db('0x27')]:0x2,'scheduledat':_0x1d13a6[_0x24db('0x18')]?_0x1d13a6[_0x24db('0x18')]:moment()[_0x24db('0x19')](_0x24db('0x1a')),'callback':_0x1d13a6[_0x24db('0x28')]?!![]:![],'callbackuniqueid':_0x1d13a6[_0x24db('0x28')]?_0x1d13a6['callbackUniqueid']:undefined,'callbackat':_0x1d13a6[_0x24db('0x28')]?moment()[_0x24db('0x19')](_0x24db('0x1a')):undefined,'CampaignId':_0x4a021f['id']});})[_0x24db('0x32')](function(_0x388e48){_0x27fec2(_0x388e48);});});});};if(_0x1d13a6[_0x24db('0x26')]){_0x39802f[_0x24db('0x1d')][_0x24db('0x35')]({'where':{'type':_0x24db('0x36')},'attributes':['id',_0x24db('0x37'),'dialTimezone'],'include':[{'model':_0x39802f[_0x24db('0x38')],'as':_0x24db('0x39'),'where':{'id':_0x1d13a6['ListId']}}]})[_0x24db('0x1f')](function(_0x32d67d){if(_0x32d67d){var _0x27f9f0=[];for(var _0x335e98=0x0,_0x1de13e;_0x335e98<_0x32d67d[_0x24db('0x3a')];_0x335e98+=0x1){_0x1de13e=_0x32d67d[_0x335e98][_0x24db('0x3b')]({'plain':!![]});switch(_0x1de13e[_0x24db('0x37')]){case _0x24db('0x3c'):_0x347a6a(_0x1de13e)[_0x24db('0x32')](_0x4b0689());break;case _0x24db('0x3d'):_0x495905(_0x1de13e)[_0x24db('0x32')](_0x4b0689());break;default:_0xb17830(_0x1de13e,_0x1d13a6)[_0x24db('0x1f')](function(_0x56548b){_0x1d13a6[_0x24db('0x18')]=_0x56548b[_0x24db('0x22')];_0x39802f[_0x24db('0x25')][_0x24db('0x2a')]({'phone':_0x1d13a6[_0x24db('0xd')],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'scheduledat':_0x1d13a6[_0x24db('0x18')]?_0x1d13a6[_0x24db('0x18')]:moment()[_0x24db('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1d13a6[_0x24db('0x27')]?_0x1d13a6['priority']:0x2,'callback':_0x1d13a6[_0x24db('0x28')]?!![]:![],'callbackuniqueid':_0x1d13a6[_0x24db('0x28')]?_0x1d13a6[_0x24db('0x28')]:undefined,'callbackat':_0x1d13a6[_0x24db('0x28')]?moment()[_0x24db('0x19')](_0x24db('0x1a')):undefined,'VoiceQueueId':_0x1de13e['id']})['catch'](_0x4b0689());});}}}})[_0x24db('0x1f')](function(){return _0x39802f[_0x24db('0x1d')][_0x24db('0x35')]({'where':{'type':_0x24db('0x36')},'attributes':['id'],'include':[{'model':_0x39802f[_0x24db('0x38')],'as':_0x24db('0x3e'),'where':{'id':_0x1d13a6[_0x24db('0x26')]}}]})[_0x24db('0x1f')](function(_0x3bc653){if(_0x3bc653){var _0x107d0b=[];for(var _0x36d846=0x0,_0x125534;_0x36d846<_0x3bc653[_0x24db('0x3a')];_0x36d846+=0x1){_0x125534=_0x3bc653[_0x36d846][_0x24db('0x3b')]({'plain':!![]});_0x39802f['CmHopperBlack']['create']({'phone':_0x1d13a6[_0x24db('0xd')],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'VoiceQueueId':_0x125534['id']})[_0x24db('0x32')](function(_0xa742fa){logger[_0x24db('0x2b')](_0x24db('0x3f'),_0x24db('0x2d'),_0xa742fa['message']);});}}});})[_0x24db('0x1f')](function(){return _0x39802f['Campaign'][_0x24db('0x35')]({'attributes':['id',_0x24db('0x37'),_0x24db('0x1c')],'include':[{'model':_0x39802f[_0x24db('0x38')],'as':_0x24db('0x39'),'where':{'id':_0x1d13a6[_0x24db('0x26')]}}]})[_0x24db('0x1f')](function(_0x13d7bb){if(_0x13d7bb){var _0x42aa60=[];for(var _0x10782a=0x0,_0x35522c;_0x10782a<_0x13d7bb['length'];_0x10782a+=0x1){_0x35522c=_0x13d7bb[_0x10782a][_0x24db('0x3b')]({'plain':!![]});switch(_0x35522c['dialCheckDuplicateType']){case _0x24db('0x3c'):_0x3d86fc(_0x35522c)[_0x24db('0x32')](_0x42fb17());break;case _0x24db('0x3d'):_0x1fcaf8(_0x35522c)['catch'](_0x42fb17());break;default:_0x39802f[_0x24db('0x25')][_0x24db('0x2a')]({'phone':_0x1d13a6['phone'],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'scheduledat':_0x1d13a6['scheduledat']?_0x1d13a6[_0x24db('0x18')]:moment()[_0x24db('0x19')](_0x24db('0x1a')),'priority':_0x1d13a6[_0x24db('0x27')]?_0x1d13a6[_0x24db('0x27')]:0x2,'callback':_0x1d13a6[_0x24db('0x28')]?!![]:![],'callbackuniqueid':_0x1d13a6['callbackUniqueid']?_0x1d13a6[_0x24db('0x28')]:undefined,'callbackat':_0x1d13a6[_0x24db('0x28')]?moment()['format'](_0x24db('0x1a')):undefined,'CampaignId':_0x35522c['id']})[_0x24db('0x32')](_0x42fb17());}}}});})[_0x24db('0x1f')](function(){return _0x39802f[_0x24db('0x2e')][_0x24db('0x35')]({'attributes':['id'],'include':[{'model':_0x39802f[_0x24db('0x38')],'as':'BlackLists','where':{'id':_0x1d13a6['ListId']}}]})['then'](function(_0xf8cfd0){if(_0xf8cfd0){var _0xc56260=[];for(var _0x2bba65=0x0,_0x3865a5;_0x2bba65<_0xf8cfd0[_0x24db('0x3a')];_0x2bba65+=0x1){_0x3865a5=_0xf8cfd0[_0x2bba65][_0x24db('0x3b')]({'plain':!![]});_0x39802f[_0x24db('0x40')][_0x24db('0x2a')]({'phone':_0x1d13a6[_0x24db('0xd')],'ContactId':_0x1d13a6['id'],'ListId':_0x1d13a6[_0x24db('0x26')],'CampaignId':_0x3865a5['id']})[_0x24db('0x32')](function(_0x3bfb9f){logger['error'](_0x24db('0x3f'),'afterCreate',_0x3bfb9f[_0x24db('0x41')]);});}}});})['then'](function(){_0x13a633();})[_0x24db('0x32')](function(_0x2c89c0){logger[_0x24db('0x2b')]('cmContact,\x20%s,\x20%s',_0x24db('0x2d'),_0x2c89c0[_0x24db('0x41')]);_0x13a633(_0x2c89c0);});}else{_0x13a633(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x3ab194,_0x5f41d1,_0x3cdbfd){var _0x8206e5=_0x238749[_0x24db('0x16')];var _0x38be73=_0x3ab194[_0x24db('0x3b')]({'plain':!![]});return _0x8206e5[_0x24db('0x25')][_0x24db('0x35')]({'raw':!![],'where':{'ListId':_0x38be73[_0x24db('0x26')],'ContactId':_0x38be73['id']}})[_0x24db('0x1f')](function(_0x838835){if(!_['isEmpty'](_0x838835)){var _0x22ddcf=[];for(var _0x4f2c11=0x0;_0x4f2c11<_0x838835['length'];_0x4f2c11+=0x1){var _0x541c92=_0x8206e5[_0x24db('0x25')]['destroy']({'where':{'ListId':_0x838835[_0x4f2c11][_0x24db('0x26')],'ContactId':_0x838835[_0x4f2c11][_0x24db('0x42')],'VoiceQueueId':_0x838835[_0x4f2c11][_0x24db('0x43')],'CampaignId':_0x838835[_0x4f2c11][_0x24db('0x44')]}});_0x22ddcf['push'](_0x541c92);}return BPromise[_0x24db('0x45')](_0x22ddcf);}})['then'](function(_0xc6d2aa){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0x24db('0x17')](_0xc6d2aa,{'showHidden':![],'depth':null}));_0x3cdbfd();})[_0x24db('0x32')](function(_0xd73099){logger['error'](_0x24db('0x46'),util[_0x24db('0x17')](_0xd73099,{'showHidden':![],'depth':null}));_0x3cdbfd(_0xd73099);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 0516adc..9c7bbdd 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(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x1b3080,_0x3f308e){var _0x438c4a=function(_0x2b42d8){while(--_0x2b42d8){_0x1b3080['push'](_0x1b3080['shift']());}};_0x438c4a(++_0x3f308e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 8ac2447..aaa9295 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 _0xd3b4=['PHONE','sequelize','STRING','INTEGER'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x49d2fe,_0x4bb617){_0x49d2fe=_0x49d2fe-0x0;var _0x12d469=_0xd3b4[_0x49d2fe];return _0x12d469;};'use strict';var Sequelize=require(_0x4d3b('0x0'));module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x4d3b('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x4d3b('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x4d3b('0x1')],'defaultValue':_0x4d3b('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x4d3b('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0x1542=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1542,0x116));var _0x2154=function(_0x495af5,_0x4da751){_0x495af5=_0x495af5-0x0;var _0x27fc50=_0x1542[_0x495af5];return _0x27fc50;};'use strict';var Sequelize=require(_0x2154('0x0'));module[_0x2154('0x1')]={'CmContactId':{'type':Sequelize[_0x2154('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x2154('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x2154('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x2154('0x4')},'OrderBy':{'type':Sequelize[_0x2154('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x2154('0x3')],'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 d0aa187..8b9dd47 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 _0xe80f=['api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','get','CmContactHasItems','UserProfileResource','end','sendStatus','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','catch','params','find','create','body','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe80f,0x176));var _0xfe80=function(_0x8bab5e,_0x39815a){_0x8bab5e=_0x8bab5e-0x0;var _0x1a45d8=_0xe80f[_0x8bab5e];return _0x1a45d8;};'use strict';var emlformat=require(_0xfe80('0x0'));var rimraf=require(_0xfe80('0x1'));var zipdir=require(_0xfe80('0x2'));var jsonpatch=require(_0xfe80('0x3'));var rp=require(_0xfe80('0x4'));var moment=require(_0xfe80('0x5'));var BPromise=require(_0xfe80('0x6'));var Mustache=require(_0xfe80('0x7'));var util=require(_0xfe80('0x8'));var path=require(_0xfe80('0x9'));var sox=require(_0xfe80('0xa'));var csv=require(_0xfe80('0xb'));var ejs=require(_0xfe80('0xc'));var fs=require('fs');var fs_extra=require(_0xfe80('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfe80('0xe'));var jsforce=require(_0xfe80('0xf'));var deskjs=require(_0xfe80('0x10'));var toCsv=require(_0xfe80('0xb'));var querystring=require(_0xfe80('0x11'));var Papa=require('papaparse');var Redis=require(_0xfe80('0x12'));var authService=require(_0xfe80('0x13'));var qs=require(_0xfe80('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfe80('0x15'));var utils=require(_0xfe80('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfe80('0x17'));var db=require(_0xfe80('0x18'))['db'];function respondWithStatusCode(_0x59fdde,_0x46ac8b){_0x46ac8b=_0x46ac8b||0xcc;return function(_0x33090d){if(_0x33090d){return _0x59fdde['sendStatus'](_0x46ac8b);}return _0x59fdde[_0xfe80('0x19')](_0x46ac8b)['end']();};}function respondWithResult(_0x678d22,_0x10540a){_0x10540a=_0x10540a||0xc8;return function(_0x53d57f){if(_0x53d57f){return _0x678d22[_0xfe80('0x19')](_0x10540a)[_0xfe80('0x1a')](_0x53d57f);}};}function respondWithFilteredResult(_0x1346fd,_0x38c82c){return function(_0x448f3a){if(_0x448f3a){var _0x3ba51b=typeof _0x38c82c[_0xfe80('0x1b')]==='undefined'&&typeof _0x38c82c[_0xfe80('0x1c')]===_0xfe80('0x1d');var _0x56cd2c=_0x448f3a[_0xfe80('0x1e')];var _0x1a350a=_0x3ba51b?0x0:_0x38c82c['offset'];var _0x4b4adf=_0x3ba51b?_0x448f3a[_0xfe80('0x1e')]:_0x38c82c[_0xfe80('0x1b')]+_0x38c82c[_0xfe80('0x1c')];var _0x361952;if(_0x4b4adf>=_0x56cd2c){_0x4b4adf=_0x56cd2c;_0x361952=0xc8;}else{_0x361952=0xce;}_0x1346fd[_0xfe80('0x19')](_0x361952);return _0x1346fd['set'](_0xfe80('0x1f'),_0x1a350a+'-'+_0x4b4adf+'/'+_0x56cd2c)['json'](_0x448f3a);}return null;};}function patchUpdates(_0x350db5){return function(_0x1ccc41){try{jsonpatch['apply'](_0x1ccc41,_0x350db5,!![]);}catch(_0x3f8367){return BPromise[_0xfe80('0x20')](_0x3f8367);}return _0x1ccc41[_0xfe80('0x21')]();};}function saveUpdates(_0x5a4f97,_0x186ef4){return function(_0x599410){if(_0x599410){return _0x599410['update'](_0x5a4f97)[_0xfe80('0x22')](function(_0x90c87a){return _0x90c87a;});}return null;};}function removeEntity(_0x1abad7,_0x2a8522){return function(_0x5c0403){if(_0x5c0403){return _0x5c0403[_0xfe80('0x23')]()['then'](function(){var _0x14801f=_0x5c0403[_0xfe80('0x24')]({'plain':!![]});var _0x16bce5=_0xfe80('0x25');return db[_0xfe80('0x26')][_0xfe80('0x23')]({'where':{'type':_0x16bce5,'resourceId':_0x14801f['id']}})[_0xfe80('0x22')](function(){return _0x5c0403;});})[_0xfe80('0x22')](function(){_0x1abad7['status'](0xcc)[_0xfe80('0x27')]();});}};}function handleEntityNotFound(_0x2585dd,_0x247bf0){return function(_0x255eed){if(!_0x255eed){_0x2585dd[_0xfe80('0x28')](0x194);}return _0x255eed;};}function handleError(_0x3499a7,_0x3bd84e){_0x3bd84e=_0x3bd84e||0x1f4;return function(_0x20155e){logger[_0xfe80('0x29')](_0x20155e['stack']);if(_0x20155e[_0xfe80('0x2a')]){delete _0x20155e[_0xfe80('0x2a')];}_0x3499a7[_0xfe80('0x19')](_0x3bd84e)[_0xfe80('0x2b')](_0x20155e);};}exports[_0xfe80('0x2c')]=function(_0xd861d5,_0x423fbc){var _0xffc392={},_0x559f9a={},_0x2ab3fa={'count':0x0,'rows':[]};var _0x66eddf=_[_0xfe80('0x2d')](db[_0xfe80('0x2e')][_0xfe80('0x2f')],function(_0x3918f7){return{'name':_0x3918f7[_0xfe80('0x30')],'type':_0x3918f7['type']['key']};});_0x559f9a[_0xfe80('0x31')]=_['map'](_0x66eddf,_0xfe80('0x2a'));_0x559f9a['query']=_[_0xfe80('0x32')](_0xd861d5[_0xfe80('0x33')]);_0x559f9a['filters']=_['intersection'](_0x559f9a['model'],_0x559f9a[_0xfe80('0x33')]);_0xffc392[_0xfe80('0x34')]=_[_0xfe80('0x35')](_0x559f9a[_0xfe80('0x31')],qs[_0xfe80('0x36')](_0xd861d5[_0xfe80('0x33')][_0xfe80('0x36')]));_0xffc392[_0xfe80('0x34')]=_0xffc392[_0xfe80('0x34')][_0xfe80('0x37')]?_0xffc392[_0xfe80('0x34')]:_0x559f9a[_0xfe80('0x31')];if(!_0xd861d5[_0xfe80('0x33')][_0xfe80('0x38')](_0xfe80('0x39'))){_0xffc392[_0xfe80('0x1c')]=qs[_0xfe80('0x1c')](_0xd861d5['query']['limit']);_0xffc392['offset']=qs['offset'](_0xd861d5[_0xfe80('0x33')]['offset']);}_0xffc392[_0xfe80('0x3a')]=qs[_0xfe80('0x3b')](_0xd861d5[_0xfe80('0x33')][_0xfe80('0x3b')]);_0xffc392[_0xfe80('0x3c')]=qs[_0xfe80('0x3d')](_[_0xfe80('0x3e')](_0xd861d5[_0xfe80('0x33')],_0x559f9a[_0xfe80('0x3d')]),_0x66eddf);if(_0xd861d5[_0xfe80('0x33')][_0xfe80('0x3f')]){_0xffc392[_0xfe80('0x3c')]=_[_0xfe80('0x40')](_0xffc392['where'],{'$or':_[_0xfe80('0x2d')](_0x66eddf,function(_0x127c61){if(_0x127c61[_0xfe80('0x41')]!=='VIRTUAL'){var _0x5bb1a6={};_0x5bb1a6[_0x127c61[_0xfe80('0x2a')]]={'$like':'%'+_0xd861d5[_0xfe80('0x33')][_0xfe80('0x3f')]+'%'};return _0x5bb1a6;}})});}_0xffc392=_['merge']({},_0xffc392,_0xd861d5[_0xfe80('0x42')]);var _0x2ab284={'where':_0xffc392[_0xfe80('0x3c')]};return db[_0xfe80('0x2e')]['count'](_0x2ab284)[_0xfe80('0x22')](function(_0x2e8575){_0x2ab3fa[_0xfe80('0x1e')]=_0x2e8575;if(_0xd861d5[_0xfe80('0x33')][_0xfe80('0x43')]){_0xffc392[_0xfe80('0x44')]=[{'all':!![]}];}return db[_0xfe80('0x2e')][_0xfe80('0x45')](_0xffc392);})['then'](function(_0x45e571){_0x2ab3fa['rows']=_0x45e571;return _0x2ab3fa;})['then'](respondWithFilteredResult(_0x423fbc,_0xffc392))[_0xfe80('0x46')](handleError(_0x423fbc,null));};exports['show']=function(_0x2ac5e5,_0x40199d){var _0x540153={'raw':!![],'where':{'id':_0x2ac5e5[_0xfe80('0x47')]['id']}},_0x46ed3a={};_0x46ed3a[_0xfe80('0x31')]=_[_0xfe80('0x32')](db[_0xfe80('0x2e')][_0xfe80('0x2f')]);_0x46ed3a[_0xfe80('0x33')]=_[_0xfe80('0x32')](_0x2ac5e5[_0xfe80('0x33')]);_0x46ed3a[_0xfe80('0x3d')]=_[_0xfe80('0x35')](_0x46ed3a['model'],_0x46ed3a[_0xfe80('0x33')]);_0x540153[_0xfe80('0x34')]=_['intersection'](_0x46ed3a[_0xfe80('0x31')],qs['fields'](_0x2ac5e5[_0xfe80('0x33')][_0xfe80('0x36')]));_0x540153[_0xfe80('0x34')]=_0x540153[_0xfe80('0x34')][_0xfe80('0x37')]?_0x540153['attributes']:_0x46ed3a[_0xfe80('0x31')];if(_0x2ac5e5[_0xfe80('0x33')][_0xfe80('0x43')]){_0x540153['include']=[{'all':!![]}];}_0x540153=_[_0xfe80('0x40')]({},_0x540153,_0x2ac5e5['options']);return db[_0xfe80('0x2e')][_0xfe80('0x48')](_0x540153)['then'](handleEntityNotFound(_0x40199d,null))[_0xfe80('0x22')](respondWithResult(_0x40199d,null))['catch'](handleError(_0x40199d,null));};exports[_0xfe80('0x49')]=function(_0x5ca399,_0x4dd6a7){return db[_0xfe80('0x2e')][_0xfe80('0x49')](_0x5ca399[_0xfe80('0x4a')],{})['then'](function(_0x72cea3){var _0x306709=_0x5ca399['user'][_0xfe80('0x24')]({'plain':!![]});if(!_0x306709)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x306709[_0xfe80('0x4b')]==='user'){var _0x2020cd=_0x72cea3['get']({'plain':!![]});var _0x4af230=_0xfe80('0x25');return db[_0xfe80('0x4c')][_0xfe80('0x48')]({'where':{'name':_0x4af230,'userProfileId':_0x306709['userProfileId']},'raw':!![]})['then'](function(_0x5cc75){if(_0x5cc75&&_0x5cc75[_0xfe80('0x4d')]===0x0){return db[_0xfe80('0x26')]['create']({'name':_0x2020cd[_0xfe80('0x2a')],'resourceId':_0x2020cd['id'],'type':_0x5cc75[_0xfe80('0x2a')],'sectionId':_0x5cc75['id']},{})[_0xfe80('0x22')](function(){return _0x72cea3;});}else{return _0x72cea3;}})[_0xfe80('0x46')](function(_0x458f02){logger[_0xfe80('0x29')](_0xfe80('0x4e'),_0x458f02);throw _0x458f02;});}return _0x72cea3;})[_0xfe80('0x22')](respondWithResult(_0x4dd6a7,0xc9))[_0xfe80('0x46')](handleError(_0x4dd6a7,null));};exports['update']=function(_0x2c3354,_0x3a52bc){if(_0x2c3354[_0xfe80('0x4a')]['id']){delete _0x2c3354['body']['id'];}return db[_0xfe80('0x2e')][_0xfe80('0x48')]({'where':{'id':_0x2c3354[_0xfe80('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a52bc,null))[_0xfe80('0x22')](saveUpdates(_0x2c3354['body'],null))[_0xfe80('0x22')](respondWithResult(_0x3a52bc,null))[_0xfe80('0x46')](handleError(_0x3a52bc,null));};exports['destroy']=function(_0x31f140,_0x53bb8f){return db[_0xfe80('0x2e')][_0xfe80('0x48')]({'where':{'id':_0x31f140[_0xfe80('0x47')]['id']}})[_0xfe80('0x22')](handleEntityNotFound(_0x53bb8f,null))[_0xfe80('0x22')](removeEntity(_0x53bb8f,null))[_0xfe80('0x46')](handleError(_0x53bb8f,null));}; \ No newline at end of file +var _0xd2d4=['findAll','rows','show','params','merge','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','stack','name','send','index','map','CmContactHasItem','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','include'];(function(_0x93be8e,_0x3fbb4c){var _0x5b9f49=function(_0x32cf9f){while(--_0x32cf9f){_0x93be8e['push'](_0x93be8e['shift']());}};_0x5b9f49(++_0x3fbb4c);}(_0xd2d4,0xb9));var _0x4d2d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd2d4[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4d2d('0x0'));var rimraf=require(_0x4d2d('0x1'));var zipdir=require(_0x4d2d('0x2'));var jsonpatch=require(_0x4d2d('0x3'));var rp=require(_0x4d2d('0x4'));var moment=require('moment');var BPromise=require(_0x4d2d('0x5'));var Mustache=require(_0x4d2d('0x6'));var util=require(_0x4d2d('0x7'));var path=require('path');var sox=require(_0x4d2d('0x8'));var csv=require(_0x4d2d('0x9'));var ejs=require(_0x4d2d('0xa'));var fs=require('fs');var fs_extra=require(_0x4d2d('0xb'));var _=require(_0x4d2d('0xc'));var squel=require('squel');var crypto=require(_0x4d2d('0xd'));var jsforce=require(_0x4d2d('0xe'));var deskjs=require(_0x4d2d('0xf'));var toCsv=require(_0x4d2d('0x9'));var querystring=require('querystring');var Papa=require(_0x4d2d('0x10'));var Redis=require(_0x4d2d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4d2d('0x12'));var as=require(_0x4d2d('0x13'));var hardwareService=require(_0x4d2d('0x14'));var logger=require(_0x4d2d('0x15'))(_0x4d2d('0x16'));var utils=require(_0x4d2d('0x17'));var config=require(_0x4d2d('0x18'));var licenseUtil=require(_0x4d2d('0x19'));var db=require(_0x4d2d('0x1a'))['db'];function respondWithStatusCode(_0x557cd4,_0x55215b){_0x55215b=_0x55215b||0xcc;return function(_0x3ee9f1){if(_0x3ee9f1){return _0x557cd4[_0x4d2d('0x1b')](_0x55215b);}return _0x557cd4[_0x4d2d('0x1c')](_0x55215b)[_0x4d2d('0x1d')]();};}function respondWithResult(_0x3879b6,_0x223ad4){_0x223ad4=_0x223ad4||0xc8;return function(_0x348d78){if(_0x348d78){return _0x3879b6[_0x4d2d('0x1c')](_0x223ad4)[_0x4d2d('0x1e')](_0x348d78);}};}function respondWithFilteredResult(_0x2c8c76,_0x20518e){return function(_0x4c34ff){if(_0x4c34ff){var _0x49e0b8=typeof _0x20518e[_0x4d2d('0x1f')]===_0x4d2d('0x20')&&typeof _0x20518e[_0x4d2d('0x21')]===_0x4d2d('0x20');var _0x22a363=_0x4c34ff['count'];var _0x24f39f=_0x49e0b8?0x0:_0x20518e[_0x4d2d('0x1f')];var _0x4143c9=_0x49e0b8?_0x4c34ff[_0x4d2d('0x22')]:_0x20518e['offset']+_0x20518e['limit'];var _0x1eb6b1;if(_0x4143c9>=_0x22a363){_0x4143c9=_0x22a363;_0x1eb6b1=0xc8;}else{_0x1eb6b1=0xce;}_0x2c8c76[_0x4d2d('0x1c')](_0x1eb6b1);return _0x2c8c76['set'](_0x4d2d('0x23'),_0x24f39f+'-'+_0x4143c9+'/'+_0x22a363)['json'](_0x4c34ff);}return null;};}function patchUpdates(_0x5ad0a6){return function(_0x153ea0){try{jsonpatch[_0x4d2d('0x24')](_0x153ea0,_0x5ad0a6,!![]);}catch(_0x11130a){return BPromise['reject'](_0x11130a);}return _0x153ea0[_0x4d2d('0x25')]();};}function saveUpdates(_0x1ae2e5,_0x21fe32){return function(_0x46bbfb){if(_0x46bbfb){return _0x46bbfb[_0x4d2d('0x26')](_0x1ae2e5)[_0x4d2d('0x27')](function(_0x3ccd65){return _0x3ccd65;});}return null;};}function removeEntity(_0x2fae8a,_0x1e3b43){return function(_0x570b4d){if(_0x570b4d){return _0x570b4d[_0x4d2d('0x28')]()[_0x4d2d('0x27')](function(){var _0x556b4a=_0x570b4d[_0x4d2d('0x29')]({'plain':!![]});var _0x54ebb6=_0x4d2d('0x2a');return db[_0x4d2d('0x2b')]['destroy']({'where':{'type':_0x54ebb6,'resourceId':_0x556b4a['id']}})['then'](function(){return _0x570b4d;});})[_0x4d2d('0x27')](function(){_0x2fae8a['status'](0xcc)[_0x4d2d('0x1d')]();});}};}function handleEntityNotFound(_0x15d784,_0x5917b6){return function(_0x506903){if(!_0x506903){_0x15d784[_0x4d2d('0x1b')](0x194);}return _0x506903;};}function handleError(_0x6db0f0,_0x59fcea){_0x59fcea=_0x59fcea||0x1f4;return function(_0x433674){logger['error'](_0x433674[_0x4d2d('0x2c')]);if(_0x433674[_0x4d2d('0x2d')]){delete _0x433674['name'];}_0x6db0f0[_0x4d2d('0x1c')](_0x59fcea)[_0x4d2d('0x2e')](_0x433674);};}exports[_0x4d2d('0x2f')]=function(_0x5f1e02,_0x9e06ab){var _0x124fe9={},_0x279dfc={},_0x239f74={'count':0x0,'rows':[]};var _0x5b443e=_[_0x4d2d('0x30')](db[_0x4d2d('0x31')]['rawAttributes'],function(_0x2d81c7){return{'name':_0x2d81c7[_0x4d2d('0x32')],'type':_0x2d81c7[_0x4d2d('0x33')]['key']};});_0x279dfc['model']=_[_0x4d2d('0x30')](_0x5b443e,_0x4d2d('0x2d'));_0x279dfc[_0x4d2d('0x34')]=_[_0x4d2d('0x35')](_0x5f1e02[_0x4d2d('0x34')]);_0x279dfc[_0x4d2d('0x36')]=_[_0x4d2d('0x37')](_0x279dfc[_0x4d2d('0x38')],_0x279dfc[_0x4d2d('0x34')]);_0x124fe9[_0x4d2d('0x39')]=_[_0x4d2d('0x37')](_0x279dfc[_0x4d2d('0x38')],qs['fields'](_0x5f1e02['query'][_0x4d2d('0x3a')]));_0x124fe9[_0x4d2d('0x39')]=_0x124fe9[_0x4d2d('0x39')][_0x4d2d('0x3b')]?_0x124fe9[_0x4d2d('0x39')]:_0x279dfc['model'];if(!_0x5f1e02[_0x4d2d('0x34')][_0x4d2d('0x3c')](_0x4d2d('0x3d'))){_0x124fe9[_0x4d2d('0x21')]=qs['limit'](_0x5f1e02[_0x4d2d('0x34')][_0x4d2d('0x21')]);_0x124fe9[_0x4d2d('0x1f')]=qs[_0x4d2d('0x1f')](_0x5f1e02[_0x4d2d('0x34')]['offset']);}_0x124fe9[_0x4d2d('0x3e')]=qs[_0x4d2d('0x3f')](_0x5f1e02[_0x4d2d('0x34')]['sort']);_0x124fe9['where']=qs[_0x4d2d('0x36')](_[_0x4d2d('0x40')](_0x5f1e02[_0x4d2d('0x34')],_0x279dfc['filters']),_0x5b443e);if(_0x5f1e02[_0x4d2d('0x34')][_0x4d2d('0x41')]){_0x124fe9[_0x4d2d('0x42')]=_['merge'](_0x124fe9[_0x4d2d('0x42')],{'$or':_['map'](_0x5b443e,function(_0x5e8b8b){if(_0x5e8b8b['type']!==_0x4d2d('0x43')){var _0x2136b2={};_0x2136b2[_0x5e8b8b[_0x4d2d('0x2d')]]={'$like':'%'+_0x5f1e02['query'][_0x4d2d('0x41')]+'%'};return _0x2136b2;}})});}_0x124fe9=_['merge']({},_0x124fe9,_0x5f1e02['options']);var _0x1069ba={'where':_0x124fe9[_0x4d2d('0x42')]};return db[_0x4d2d('0x31')][_0x4d2d('0x22')](_0x1069ba)[_0x4d2d('0x27')](function(_0x1672a8){_0x239f74[_0x4d2d('0x22')]=_0x1672a8;if(_0x5f1e02['query'][_0x4d2d('0x44')]){_0x124fe9[_0x4d2d('0x45')]=[{'all':!![]}];}return db[_0x4d2d('0x31')][_0x4d2d('0x46')](_0x124fe9);})[_0x4d2d('0x27')](function(_0x80939b){_0x239f74[_0x4d2d('0x47')]=_0x80939b;return _0x239f74;})[_0x4d2d('0x27')](respondWithFilteredResult(_0x9e06ab,_0x124fe9))['catch'](handleError(_0x9e06ab,null));};exports[_0x4d2d('0x48')]=function(_0x501a31,_0x6b86f){var _0x1f8c01={'raw':!![],'where':{'id':_0x501a31[_0x4d2d('0x49')]['id']}},_0x28169b={};_0x28169b[_0x4d2d('0x38')]=_['keys'](db[_0x4d2d('0x31')]['rawAttributes']);_0x28169b[_0x4d2d('0x34')]=_['keys'](_0x501a31[_0x4d2d('0x34')]);_0x28169b[_0x4d2d('0x36')]=_['intersection'](_0x28169b[_0x4d2d('0x38')],_0x28169b[_0x4d2d('0x34')]);_0x1f8c01[_0x4d2d('0x39')]=_[_0x4d2d('0x37')](_0x28169b[_0x4d2d('0x38')],qs['fields'](_0x501a31[_0x4d2d('0x34')]['fields']));_0x1f8c01['attributes']=_0x1f8c01[_0x4d2d('0x39')][_0x4d2d('0x3b')]?_0x1f8c01[_0x4d2d('0x39')]:_0x28169b[_0x4d2d('0x38')];if(_0x501a31[_0x4d2d('0x34')]['includeAll']){_0x1f8c01[_0x4d2d('0x45')]=[{'all':!![]}];}_0x1f8c01=_[_0x4d2d('0x4a')]({},_0x1f8c01,_0x501a31[_0x4d2d('0x4b')]);return db[_0x4d2d('0x31')][_0x4d2d('0x4c')](_0x1f8c01)[_0x4d2d('0x27')](handleEntityNotFound(_0x6b86f,null))[_0x4d2d('0x27')](respondWithResult(_0x6b86f,null))[_0x4d2d('0x4d')](handleError(_0x6b86f,null));};exports[_0x4d2d('0x4e')]=function(_0x191a1d,_0x5976b9){return db[_0x4d2d('0x31')]['create'](_0x191a1d[_0x4d2d('0x4f')],{})[_0x4d2d('0x27')](function(_0x2f5f12){var _0x11677e=_0x191a1d[_0x4d2d('0x50')][_0x4d2d('0x29')]({'plain':!![]});if(!_0x11677e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11677e[_0x4d2d('0x51')]===_0x4d2d('0x50')){var _0x388392=_0x2f5f12[_0x4d2d('0x29')]({'plain':!![]});var _0x5e505e=_0x4d2d('0x2a');return db[_0x4d2d('0x52')][_0x4d2d('0x4c')]({'where':{'name':_0x5e505e,'userProfileId':_0x11677e[_0x4d2d('0x53')]},'raw':!![]})[_0x4d2d('0x27')](function(_0x5a6b7e){if(_0x5a6b7e&&_0x5a6b7e[_0x4d2d('0x54')]===0x0){return db[_0x4d2d('0x2b')][_0x4d2d('0x4e')]({'name':_0x388392['name'],'resourceId':_0x388392['id'],'type':_0x5a6b7e['name'],'sectionId':_0x5a6b7e['id']},{})[_0x4d2d('0x27')](function(){return _0x2f5f12;});}else{return _0x2f5f12;}})['catch'](function(_0x371d38){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x371d38);throw _0x371d38;});}return _0x2f5f12;})[_0x4d2d('0x27')](respondWithResult(_0x5976b9,0xc9))[_0x4d2d('0x4d')](handleError(_0x5976b9,null));};exports['update']=function(_0x1cadfd,_0x75d707){if(_0x1cadfd[_0x4d2d('0x4f')]['id']){delete _0x1cadfd[_0x4d2d('0x4f')]['id'];}return db[_0x4d2d('0x31')][_0x4d2d('0x4c')]({'where':{'id':_0x1cadfd[_0x4d2d('0x49')]['id']}})[_0x4d2d('0x27')](handleEntityNotFound(_0x75d707,null))[_0x4d2d('0x27')](saveUpdates(_0x1cadfd['body'],null))[_0x4d2d('0x27')](respondWithResult(_0x75d707,null))[_0x4d2d('0x4d')](handleError(_0x75d707,null));};exports[_0x4d2d('0x28')]=function(_0x27a2aa,_0x9a083c){return db[_0x4d2d('0x31')][_0x4d2d('0x4c')]({'where':{'id':_0x27a2aa['params']['id']}})[_0x4d2d('0x27')](handleEntityNotFound(_0x9a083c,null))[_0x4d2d('0x27')](removeEntity(_0x9a083c,null))['catch'](handleError(_0x9a083c,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 851c517..facdfdf 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 _0xefb8=['request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','../../config/logger','api','moment','bluebird'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0xefb8,0xcd));var _0x8efb=function(_0x24ab19,_0x1f1275){_0x24ab19=_0x24ab19-0x0;var _0x58e24c=_0xefb8[_0x24ab19];return _0x58e24c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8efb('0x0'))(_0x8efb('0x1'));var moment=require(_0x8efb('0x2'));var BPromise=require(_0x8efb('0x3'));var rp=require(_0x8efb('0x4'));var fs=require('fs');var path=require(_0x8efb('0x5'));var rimraf=require(_0x8efb('0x6'));var config=require(_0x8efb('0x7'));var attributes=require(_0x8efb('0x8'));module[_0x8efb('0x9')]=function(_0x100f24,_0x502742){return _0x100f24[_0x8efb('0xa')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92ee=['path','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','moment','request-promise'];(function(_0x46ce98,_0x52d764){var _0x172f46=function(_0x10ccee){while(--_0x10ccee){_0x46ce98['push'](_0x46ce98['shift']());}};_0x172f46(++_0x52d764);}(_0x92ee,0xc2));var _0xe92e=function(_0x5c10d3,_0x3a3b3a){_0x5c10d3=_0x5c10d3-0x0;var _0x2cbab4=_0x92ee[_0x5c10d3];return _0x2cbab4;};'use strict';var _=require(_0xe92e('0x0'));var util=require(_0xe92e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe92e('0x2'));var BPromise=require('bluebird');var rp=require(_0xe92e('0x3'));var fs=require('fs');var path=require(_0xe92e('0x4'));var rimraf=require('rimraf');var config=require(_0xe92e('0x5'));var attributes=require(_0xe92e('0x6'));module[_0xe92e('0x7')]=function(_0x87889a,_0x1ed1d3){return _0x87889a[_0xe92e('0x8')](_0xe92e('0x9'),attributes,{'tableName':_0xe92e('0xa'),'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 e5516e8..19d85a5 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 _0x907e=['ioredis','../../config/utils','rpc','http','request','then','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xac47b3,_0x1ff94e){var _0x33f1dc=function(_0x2fd3ae){while(--_0x2fd3ae){_0xac47b3['push'](_0xac47b3['shift']());}};_0x33f1dc(++_0x1ff94e);}(_0x907e,0x1db));var _0xe907=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x907e[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0xe907('0x0'));var util=require(_0xe907('0x1'));var moment=require(_0xe907('0x2'));var BPromise=require(_0xe907('0x3'));var rs=require(_0xe907('0x4'));var fs=require('fs');var Redis=require(_0xe907('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe907('0x6'));var logger=require('../../config/logger')(_0xe907('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe907('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4834e9,_0x21ba2d,_0x360030){return new BPromise(function(_0x1202f0,_0x1692d7){return client[_0xe907('0x9')](_0x4834e9,_0x360030)[_0xe907('0xa')](function(_0xba8993){logger['info'](_0xe907('0xb'),_0x21ba2d,'request\x20sent');logger[_0xe907('0xc')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x21ba2d,_0xe907('0xd'),JSON[_0xe907('0xe')](_0xba8993));if(_0xba8993[_0xe907('0xf')]){if(_0xba8993['error']['code']===0x1f4){logger[_0xe907('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x21ba2d,_0xba8993['error'][_0xe907('0x10')]);return _0x1692d7(_0xba8993[_0xe907('0xf')]['message']);}logger[_0xe907('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x21ba2d,_0xba8993[_0xe907('0xf')][_0xe907('0x10')]);return _0x1202f0(_0xba8993[_0xe907('0xf')][_0xe907('0x10')]);}else{logger[_0xe907('0x11')](_0xe907('0xb'),_0x21ba2d,_0xe907('0xd'));_0x1202f0(_0xba8993[_0xe907('0x12')][_0xe907('0x10')]);}})[_0xe907('0x13')](function(_0x438dcb){logger[_0xe907('0xf')](_0xe907('0xb'),_0x21ba2d,_0x438dcb);_0x1692d7(_0x438dcb);});});} \ No newline at end of file +var _0x8d37=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x5c0c37,_0x3d39fc){var _0x4c2a6b=function(_0x377379){while(--_0x377379){_0x5c0c37['push'](_0x5c0c37['shift']());}};_0x4c2a6b(++_0x3d39fc);}(_0x8d37,0x16e));var _0x78d3=function(_0x2a5fc9,_0x3ba271){_0x2a5fc9=_0x2a5fc9-0x0;var _0x138443=_0x8d37[_0x2a5fc9];return _0x138443;};'use strict';var _=require(_0x78d3('0x0'));var util=require('util');var moment=require(_0x78d3('0x1'));var BPromise=require(_0x78d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78d3('0x3'));var db=require(_0x78d3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x78d3('0x5'))(_0x78d3('0x6'));var config=require(_0x78d3('0x7'));var jayson=require(_0x78d3('0x8'));var client=jayson['client'][_0x78d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b6b47,_0x5ad2e7,_0x4b478f){return new BPromise(function(_0x56eb4b,_0x6ff853){return client[_0x78d3('0xa')](_0x5b6b47,_0x4b478f)[_0x78d3('0xb')](function(_0x320afb){logger[_0x78d3('0xc')](_0x78d3('0xd'),_0x5ad2e7,_0x78d3('0xe'));logger[_0x78d3('0xf')](_0x78d3('0x10'),_0x5ad2e7,_0x78d3('0xe'),JSON[_0x78d3('0x11')](_0x320afb));if(_0x320afb[_0x78d3('0x12')]){if(_0x320afb['error'][_0x78d3('0x13')]===0x1f4){logger[_0x78d3('0x12')](_0x78d3('0xd'),_0x5ad2e7,_0x320afb[_0x78d3('0x12')]['message']);return _0x6ff853(_0x320afb['error']['message']);}logger[_0x78d3('0x12')](_0x78d3('0xd'),_0x5ad2e7,_0x320afb['error'][_0x78d3('0x14')]);return _0x56eb4b(_0x320afb[_0x78d3('0x12')][_0x78d3('0x14')]);}else{logger[_0x78d3('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x5ad2e7,_0x78d3('0xe'));_0x56eb4b(_0x320afb[_0x78d3('0x15')][_0x78d3('0x14')]);}})[_0x78d3('0x16')](function(_0x5af658){logger['error'](_0x78d3('0xd'),_0x5ad2e7,_0x5af658);_0x6ff853(_0x5af658);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 4d561f6..25f8cce 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 _0xefa1=['connect-timeout','express','Router','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xefa1,0xce));var _0x1efa=function(_0x284def,_0x5ad119){_0x284def=_0x284def-0x0;var _0x33c276=_0xefa1[_0x284def];return _0x33c276;};'use strict';var multer=require(_0x1efa('0x0'));var util=require(_0x1efa('0x1'));var path=require(_0x1efa('0x2'));var timeout=require(_0x1efa('0x3'));var express=require(_0x1efa('0x4'));var router=express[_0x1efa('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1efa('0x6'));var controller=require(_0x1efa('0x7'));router['get']('/',auth[_0x1efa('0x8')](),controller[_0x1efa('0x9')]);router['get'](_0x1efa('0xa'),auth[_0x1efa('0x8')](),controller[_0x1efa('0xb')]);router[_0x1efa('0xc')]('/',auth['isAuthenticated'](),controller[_0x1efa('0xd')]);router[_0x1efa('0xe')](_0x1efa('0xa'),auth[_0x1efa('0x8')](),controller[_0x1efa('0xf')]);router[_0x1efa('0x10')](_0x1efa('0xa'),auth[_0x1efa('0x8')](),controller[_0x1efa('0x11')]);module[_0x1efa('0x12')]=router; \ No newline at end of file +var _0xceee=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','get','show','post','create','put','/:id'];(function(_0x14da60,_0x5e6ae0){var _0x55dd8c=function(_0x5ac403){while(--_0x5ac403){_0x14da60['push'](_0x14da60['shift']());}};_0x55dd8c(++_0x5e6ae0);}(_0xceee,0xff));var _0xecee=function(_0xd711ab,_0x1a363e){_0xd711ab=_0xd711ab-0x0;var _0x4d05fb=_0xceee[_0xd711ab];return _0x4d05fb;};'use strict';var multer=require(_0xecee('0x0'));var util=require(_0xecee('0x1'));var path=require(_0xecee('0x2'));var timeout=require(_0xecee('0x3'));var express=require('express');var router=express[_0xecee('0x4')]();var fs_extra=require(_0xecee('0x5'));var auth=require(_0xecee('0x6'));var interaction=require(_0xecee('0x7'));var config=require(_0xecee('0x8'));var controller=require(_0xecee('0x9'));router['get']('/',auth[_0xecee('0xa')](),controller[_0xecee('0xb')]);router[_0xecee('0xc')]('/:id',auth[_0xecee('0xa')](),controller[_0xecee('0xd')]);router[_0xecee('0xe')]('/',auth[_0xecee('0xa')](),controller[_0xecee('0xf')]);router[_0xecee('0x10')](_0xecee('0x11'),auth[_0xecee('0xa')](),controller[_0xecee('0x12')]);router['delete'](_0xecee('0x11'),auth[_0xecee('0xa')](),controller[_0xecee('0x13')]);module[_0xecee('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 1ce5d09..c3e2b90 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 _0x51a2=['BOOLEAN','ENUM','sequelize','exports','VIRTUAL','STRING','setDataValue','getDataValue','TEXT','long','type','select','parse','values','isArray','stringify'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x51a2,0x132));var _0x251a=function(_0x52ed69,_0x459639){_0x52ed69=_0x52ed69-0x0;var _0x1cac9f=_0x51a2[_0x52ed69];return _0x1cac9f;};'use strict';var Sequelize=require(_0x251a('0x0'));var _=require('lodash');module[_0x251a('0x1')]={'name':{'type':Sequelize[_0x251a('0x2')],'get':function(_0x5df60a){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x251a('0x3')],'allowNull':![],'set':function(_0x4c0c30){this[_0x251a('0x4')]('alias',_0x4c0c30?_0x4c0c30:this[_0x251a('0x5')]('name'));}},'type':{'type':Sequelize[_0x251a('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x251a('0x6')](_0x251a('0x7')),'get':function(){if(this[_0x251a('0x5')](_0x251a('0x8'))===_0x251a('0x9')){return JSON[_0x251a('0xa')](this[_0x251a('0x5')](_0x251a('0xb')));}else{return this[_0x251a('0x5')](_0x251a('0xb'));}},'set':function(_0x153b57){if(Array[_0x251a('0xc')](_0x153b57)){this[_0x251a('0x4')]('values',JSON[_0x251a('0xd')](_0x153b57));}else{this['setDataValue'](_0x251a('0xb'),_0x153b57);}}},'required':{'type':Sequelize[_0x251a('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x251a('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x251a('0xf')]('voice')}}; \ No newline at end of file +var _0xa9b6=['select','parse','values','setDataValue','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','type'];(function(_0x33ccb6,_0x1ab105){var _0x478b54=function(_0x38708e){while(--_0x38708e){_0x33ccb6['push'](_0x33ccb6['shift']());}};_0x478b54(++_0x1ab105);}(_0xa9b6,0x1ba));var _0x6a9b=function(_0x281d51,_0xb81751){_0x281d51=_0x281d51-0x0;var _0x333b25=_0xa9b6[_0x281d51];return _0x333b25;};'use strict';var Sequelize=require(_0x6a9b('0x0'));var _=require(_0x6a9b('0x1'));module[_0x6a9b('0x2')]={'name':{'type':Sequelize[_0x6a9b('0x3')],'get':function(_0x452554){return this[_0x6a9b('0x4')](_0x6a9b('0x5'));}},'alias':{'type':Sequelize[_0x6a9b('0x6')],'allowNull':![],'set':function(_0x505f84){this['setDataValue'](_0x6a9b('0x5'),_0x505f84?_0x505f84:this[_0x6a9b('0x4')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0x6a9b('0x7'))===_0x6a9b('0x8')){return JSON[_0x6a9b('0x9')](this[_0x6a9b('0x4')](_0x6a9b('0xa')));}else{return this[_0x6a9b('0x4')](_0x6a9b('0xa'));}},'set':function(_0x7d4e28){if(Array['isArray'](_0x7d4e28)){this[_0x6a9b('0xb')](_0x6a9b('0xa'),JSON[_0x6a9b('0xc')](_0x7d4e28));}else{this['setDataValue'](_0x6a9b('0xa'),_0x7d4e28);}}},'required':{'type':Sequelize[_0x6a9b('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6a9b('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6a9b('0xe')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 90315d8..4faf10d 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 _0x01e2=['then','destroy','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','catch','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update'];(function(_0x4828b1,_0x5c8cf3){var _0x1fec1b=function(_0x3f2e5a){while(--_0x3f2e5a){_0x4828b1['push'](_0x4828b1['shift']());}};_0x1fec1b(++_0x5c8cf3);}(_0x01e2,0x92));var _0x201e=function(_0x5dea68,_0x1808ff){_0x5dea68=_0x5dea68-0x0;var _0x1b7406=_0x01e2[_0x5dea68];return _0x1b7406;};'use strict';var emlformat=require(_0x201e('0x0'));var rimraf=require(_0x201e('0x1'));var zipdir=require(_0x201e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x201e('0x3'));var moment=require(_0x201e('0x4'));var BPromise=require(_0x201e('0x5'));var Mustache=require(_0x201e('0x6'));var util=require(_0x201e('0x7'));var path=require(_0x201e('0x8'));var sox=require(_0x201e('0x9'));var csv=require('to-csv');var ejs=require(_0x201e('0xa'));var fs=require('fs');var fs_extra=require(_0x201e('0xb'));var _=require(_0x201e('0xc'));var squel=require(_0x201e('0xd'));var crypto=require('crypto');var jsforce=require(_0x201e('0xe'));var deskjs=require(_0x201e('0xf'));var toCsv=require(_0x201e('0x10'));var querystring=require(_0x201e('0x11'));var Papa=require(_0x201e('0x12'));var Redis=require(_0x201e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x201e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x201e('0x15'));var logger=require(_0x201e('0x16'))(_0x201e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x201e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ff331,_0x3c605f){_0x3c605f=_0x3c605f||0xcc;return function(_0x351f29){if(_0x351f29){return _0x1ff331[_0x201e('0x19')](_0x3c605f);}return _0x1ff331[_0x201e('0x1a')](_0x3c605f)[_0x201e('0x1b')]();};}function respondWithResult(_0x119fb7,_0x4ce39e){_0x4ce39e=_0x4ce39e||0xc8;return function(_0x1a68a9){if(_0x1a68a9){return _0x119fb7[_0x201e('0x1a')](_0x4ce39e)[_0x201e('0x1c')](_0x1a68a9);}};}function respondWithFilteredResult(_0x562dec,_0x1495e6){return function(_0x229e6e){if(_0x229e6e){var _0x5ead3f=typeof _0x1495e6[_0x201e('0x1d')]==='undefined'&&typeof _0x1495e6['limit']===_0x201e('0x1e');var _0x2fe515=_0x229e6e[_0x201e('0x1f')];var _0x382eb5=_0x5ead3f?0x0:_0x1495e6['offset'];var _0x138665=_0x5ead3f?_0x229e6e[_0x201e('0x1f')]:_0x1495e6[_0x201e('0x1d')]+_0x1495e6[_0x201e('0x20')];var _0x4e47a5;if(_0x138665>=_0x2fe515){_0x138665=_0x2fe515;_0x4e47a5=0xc8;}else{_0x4e47a5=0xce;}_0x562dec['status'](_0x4e47a5);return _0x562dec['set'](_0x201e('0x21'),_0x382eb5+'-'+_0x138665+'/'+_0x2fe515)['json'](_0x229e6e);}return null;};}function patchUpdates(_0x224916){return function(_0x5b734c){try{jsonpatch[_0x201e('0x22')](_0x5b734c,_0x224916,!![]);}catch(_0x5ae427){return BPromise[_0x201e('0x23')](_0x5ae427);}return _0x5b734c[_0x201e('0x24')]();};}function saveUpdates(_0x23f9d0,_0x23f5e3){return function(_0x12443c){if(_0x12443c){return _0x12443c[_0x201e('0x25')](_0x23f9d0)[_0x201e('0x26')](function(_0x43f18b){return _0x43f18b;});}return null;};}function removeEntity(_0x4a7cfc,_0x389480){return function(_0x265cd0){if(_0x265cd0){return _0x265cd0[_0x201e('0x27')]()['then'](function(){_0x4a7cfc[_0x201e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331c7d,_0x53b643){return function(_0x5a74fe){if(!_0x5a74fe){_0x331c7d['sendStatus'](0x194);}return _0x5a74fe;};}function handleError(_0x8f4cae,_0x5a2d11){_0x5a2d11=_0x5a2d11||0x1f4;return function(_0xcef53e){logger[_0x201e('0x28')](_0xcef53e[_0x201e('0x29')]);if(_0xcef53e[_0x201e('0x2a')]){delete _0xcef53e[_0x201e('0x2a')];}_0x8f4cae[_0x201e('0x1a')](_0x5a2d11)[_0x201e('0x2b')](_0xcef53e);};}exports[_0x201e('0x2c')]=function(_0x914484,_0x105ff6){var _0x163a4f={},_0x361330={},_0x596185={'count':0x0,'rows':[]};var _0x3e63e3=_['map'](db[_0x201e('0x2d')][_0x201e('0x2e')],function(_0xa46db5){return{'name':_0xa46db5[_0x201e('0x2f')],'type':_0xa46db5[_0x201e('0x30')][_0x201e('0x31')]};});_0x361330[_0x201e('0x32')]=_[_0x201e('0x33')](_[_0x201e('0x34')](_0x3e63e3,'name'),[_0x201e('0x2a')]);_0x361330[_0x201e('0x35')]=_[_0x201e('0x36')](_0x914484[_0x201e('0x35')]);_0x361330[_0x201e('0x37')]=_['intersection'](_0x361330['model'],_0x361330[_0x201e('0x35')]);_0x163a4f['attributes']=_[_0x201e('0x38')](_0x361330['model'],qs[_0x201e('0x39')](_0x914484[_0x201e('0x35')][_0x201e('0x39')]));_0x163a4f[_0x201e('0x3a')]=_0x163a4f[_0x201e('0x3a')][_0x201e('0x3b')]?_0x163a4f[_0x201e('0x3a')]:_0x361330[_0x201e('0x32')];if(!_0x914484['query'][_0x201e('0x3c')]('nolimit')){_0x163a4f[_0x201e('0x20')]=qs[_0x201e('0x20')](_0x914484[_0x201e('0x35')]['limit']);_0x163a4f[_0x201e('0x1d')]=qs[_0x201e('0x1d')](_0x914484['query'][_0x201e('0x1d')]);}_0x163a4f[_0x201e('0x3d')]=qs[_0x201e('0x3e')](_0x914484[_0x201e('0x35')][_0x201e('0x3e')]);_0x163a4f['where']=qs[_0x201e('0x37')](_['pick'](_0x914484[_0x201e('0x35')],_0x361330['filters']),_0x3e63e3);if(_0x914484[_0x201e('0x35')][_0x201e('0x3f')]){_0x163a4f[_0x201e('0x40')]=_[_0x201e('0x41')](_0x163a4f['where'],{'$or':_['map'](_0x3e63e3,function(_0x123477){if(_0x123477['type']!==_0x201e('0x42')){var _0x4e10a4={};_0x4e10a4[_0x123477[_0x201e('0x2a')]]={'$like':'%'+_0x914484[_0x201e('0x35')][_0x201e('0x3f')]+'%'};return _0x4e10a4;}})});}_0x163a4f=_[_0x201e('0x41')]({},_0x163a4f,_0x914484[_0x201e('0x43')]);var _0x3b2972={'where':_0x163a4f[_0x201e('0x40')]};return db[_0x201e('0x2d')][_0x201e('0x1f')](_0x3b2972)['then'](function(_0x134219){_0x596185[_0x201e('0x1f')]=_0x134219;if(_0x914484['query'][_0x201e('0x44')]){_0x163a4f[_0x201e('0x45')]=[{'all':!![]}];}return db[_0x201e('0x2d')][_0x201e('0x46')](_0x163a4f);})['then'](function(_0x1d1ed9){_0x596185[_0x201e('0x47')]=_0x1d1ed9;return _0x596185;})[_0x201e('0x26')](respondWithFilteredResult(_0x105ff6,_0x163a4f))['catch'](handleError(_0x105ff6,null));};exports[_0x201e('0x48')]=function(_0x2ab4e9,_0x4135d0){var _0x5e198e={'raw':!![],'where':{'id':_0x2ab4e9[_0x201e('0x49')]['id']}},_0x60ae88={};_0x60ae88[_0x201e('0x32')]=_['keys'](db['CmCustomField'][_0x201e('0x2e')]);_0x60ae88[_0x201e('0x35')]=_[_0x201e('0x36')](_0x2ab4e9[_0x201e('0x35')]);_0x60ae88['filters']=_['intersection'](_0x60ae88['model'],_0x60ae88['query']);_0x5e198e[_0x201e('0x3a')]=_[_0x201e('0x38')](_0x60ae88['model'],qs[_0x201e('0x39')](_0x2ab4e9[_0x201e('0x35')][_0x201e('0x39')]));_0x5e198e[_0x201e('0x3a')]=_0x5e198e[_0x201e('0x3a')][_0x201e('0x3b')]?_0x5e198e[_0x201e('0x3a')]:_0x60ae88[_0x201e('0x32')];if(_0x2ab4e9[_0x201e('0x35')]['includeAll']){_0x5e198e['include']=[{'all':!![]}];}_0x5e198e=_['merge']({},_0x5e198e,_0x2ab4e9[_0x201e('0x43')]);return db[_0x201e('0x2d')][_0x201e('0x4a')](_0x5e198e)[_0x201e('0x26')](handleEntityNotFound(_0x4135d0,null))['then'](respondWithResult(_0x4135d0,null))['catch'](handleError(_0x4135d0,null));};exports[_0x201e('0x25')]=function(_0x21c9ab,_0x5bf622){if(_0x21c9ab[_0x201e('0x4b')]['id']){delete _0x21c9ab[_0x201e('0x4b')]['id'];}return db['CmCustomField'][_0x201e('0x4a')]({'where':{'id':_0x21c9ab[_0x201e('0x49')]['id']}})[_0x201e('0x26')](handleEntityNotFound(_0x5bf622,null))[_0x201e('0x26')](saveUpdates(_0x21c9ab[_0x201e('0x4b')],null))[_0x201e('0x26')](respondWithResult(_0x5bf622,null))[_0x201e('0x4c')](handleError(_0x5bf622,null));};exports[_0x201e('0x27')]=function(_0x54d9a0,_0x1258f4){return db['CmCustomField']['find']({'where':{'id':_0x54d9a0[_0x201e('0x49')]['id']}})[_0x201e('0x26')](handleEntityNotFound(_0x1258f4,null))['then'](removeEntity(_0x1258f4,null))['catch'](handleError(_0x1258f4,null));};exports[_0x201e('0x4d')]=function(_0x2ceab1,_0x4ae97d){var _0x5365da;return db['sequelize'][_0x201e('0x4e')](function(_0x57ab40){return db[_0x201e('0x2d')]['create'](_0x2ceab1['body'],{'transaction':_0x57ab40})[_0x201e('0x26')](function(_0x518f6a){_0x5365da=_0x518f6a;var _0x17efcb={'type':db[_0x201e('0x4f')][_0x201e('0x50')],'transaction':_0x57ab40};switch(_0x2ceab1[_0x201e('0x4b')][_0x201e('0x30')]){case _0x201e('0x51'):_0x17efcb[_0x201e('0x30')]=db[_0x201e('0x4f')][_0x201e('0x50')];break;case _0x201e('0x52'):_0x17efcb[_0x201e('0x30')]=db['Sequelize'][_0x201e('0x53')];break;case _0x201e('0x54'):_0x17efcb[_0x201e('0x30')]=db[_0x201e('0x4f')][_0x201e('0x55')];_0x17efcb['defaultValue']=![];break;default:}return db[_0x201e('0x56')][_0x201e('0x57')][_0x201e('0x58')](_0x201e('0x59'),util[_0x201e('0x5a')](_0x201e('0x5b'),_0x5365da['id']),_0x17efcb);})[_0x201e('0x26')](function(){return _0x5365da;});})[_0x201e('0x26')](respondWithResult(_0x4ae97d,0xc9))[_0x201e('0x4c')](handleError(_0x4ae97d,null));}; \ No newline at end of file +var _0x1b1f=['update','body','create','Sequelize','TEXT','switch','BOOLEAN','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmCustomField','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x5a9feb,_0x5b9fcf){var _0xcf1834=function(_0x120fb2){while(--_0x120fb2){_0x5a9feb['push'](_0x5a9feb['shift']());}};_0xcf1834(++_0x5b9fcf);}(_0x1b1f,0x1b4));var _0xf1b1=function(_0x42b456,_0x6d573){_0x42b456=_0x42b456-0x0;var _0x2126d7=_0x1b1f[_0x42b456];return _0x2126d7;};'use strict';var emlformat=require(_0xf1b1('0x0'));var rimraf=require(_0xf1b1('0x1'));var zipdir=require(_0xf1b1('0x2'));var jsonpatch=require(_0xf1b1('0x3'));var rp=require(_0xf1b1('0x4'));var moment=require(_0xf1b1('0x5'));var BPromise=require(_0xf1b1('0x6'));var Mustache=require(_0xf1b1('0x7'));var util=require(_0xf1b1('0x8'));var path=require('path');var sox=require(_0xf1b1('0x9'));var csv=require(_0xf1b1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1b1('0xb'));var _=require('lodash');var squel=require(_0xf1b1('0xc'));var crypto=require(_0xf1b1('0xd'));var jsforce=require(_0xf1b1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf1b1('0xa'));var querystring=require('querystring');var Papa=require(_0xf1b1('0xf'));var Redis=require('ioredis');var authService=require(_0xf1b1('0x10'));var qs=require(_0xf1b1('0x11'));var as=require(_0xf1b1('0x12'));var hardwareService=require(_0xf1b1('0x13'));var logger=require('../../config/logger')(_0xf1b1('0x14'));var utils=require(_0xf1b1('0x15'));var config=require(_0xf1b1('0x16'));var licenseUtil=require(_0xf1b1('0x17'));var db=require(_0xf1b1('0x18'))['db'];function respondWithStatusCode(_0x1291f2,_0x25a912){_0x25a912=_0x25a912||0xcc;return function(_0x445d6b){if(_0x445d6b){return _0x1291f2[_0xf1b1('0x19')](_0x25a912);}return _0x1291f2[_0xf1b1('0x1a')](_0x25a912)[_0xf1b1('0x1b')]();};}function respondWithResult(_0x22c5eb,_0x4ca47b){_0x4ca47b=_0x4ca47b||0xc8;return function(_0x14694d){if(_0x14694d){return _0x22c5eb['status'](_0x4ca47b)[_0xf1b1('0x1c')](_0x14694d);}};}function respondWithFilteredResult(_0x4d20d5,_0x41fe5f){return function(_0x3003e6){if(_0x3003e6){var _0x1a5e82=typeof _0x41fe5f['offset']===_0xf1b1('0x1d')&&typeof _0x41fe5f[_0xf1b1('0x1e')]===_0xf1b1('0x1d');var _0x1ba43e=_0x3003e6[_0xf1b1('0x1f')];var _0xd16d6f=_0x1a5e82?0x0:_0x41fe5f['offset'];var _0x253fcf=_0x1a5e82?_0x3003e6['count']:_0x41fe5f[_0xf1b1('0x20')]+_0x41fe5f['limit'];var _0x3482ad;if(_0x253fcf>=_0x1ba43e){_0x253fcf=_0x1ba43e;_0x3482ad=0xc8;}else{_0x3482ad=0xce;}_0x4d20d5[_0xf1b1('0x1a')](_0x3482ad);return _0x4d20d5[_0xf1b1('0x21')](_0xf1b1('0x22'),_0xd16d6f+'-'+_0x253fcf+'/'+_0x1ba43e)[_0xf1b1('0x1c')](_0x3003e6);}return null;};}function patchUpdates(_0x512906){return function(_0xd681d7){try{jsonpatch[_0xf1b1('0x23')](_0xd681d7,_0x512906,!![]);}catch(_0x3afc2c){return BPromise[_0xf1b1('0x24')](_0x3afc2c);}return _0xd681d7[_0xf1b1('0x25')]();};}function saveUpdates(_0x304d6b,_0x3bcf77){return function(_0x5b382a){if(_0x5b382a){return _0x5b382a['update'](_0x304d6b)[_0xf1b1('0x26')](function(_0x1e5e13){return _0x1e5e13;});}return null;};}function removeEntity(_0x15f6c0,_0x12fae0){return function(_0x39cb0d){if(_0x39cb0d){return _0x39cb0d[_0xf1b1('0x27')]()[_0xf1b1('0x26')](function(){_0x15f6c0[_0xf1b1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5b93,_0x1bf35c){return function(_0x500911){if(!_0x500911){_0x1c5b93[_0xf1b1('0x19')](0x194);}return _0x500911;};}function handleError(_0x3176ab,_0x463662){_0x463662=_0x463662||0x1f4;return function(_0x473dd8){logger[_0xf1b1('0x28')](_0x473dd8[_0xf1b1('0x29')]);if(_0x473dd8[_0xf1b1('0x2a')]){delete _0x473dd8[_0xf1b1('0x2a')];}_0x3176ab[_0xf1b1('0x1a')](_0x463662)['send'](_0x473dd8);};}exports['index']=function(_0x49baa0,_0x577a3e){var _0x9d5723={},_0x1b0a54={},_0x24ffad={'count':0x0,'rows':[]};var _0x1e2d66=_[_0xf1b1('0x2b')](db['CmCustomField'][_0xf1b1('0x2c')],function(_0xeee193){return{'name':_0xeee193[_0xf1b1('0x2d')],'type':_0xeee193[_0xf1b1('0x2e')][_0xf1b1('0x2f')]};});_0x1b0a54[_0xf1b1('0x30')]=_['differenceBy'](_['map'](_0x1e2d66,_0xf1b1('0x2a')),['name']);_0x1b0a54[_0xf1b1('0x31')]=_[_0xf1b1('0x32')](_0x49baa0['query']);_0x1b0a54[_0xf1b1('0x33')]=_[_0xf1b1('0x34')](_0x1b0a54[_0xf1b1('0x30')],_0x1b0a54[_0xf1b1('0x31')]);_0x9d5723[_0xf1b1('0x35')]=_[_0xf1b1('0x34')](_0x1b0a54['model'],qs[_0xf1b1('0x36')](_0x49baa0[_0xf1b1('0x31')][_0xf1b1('0x36')]));_0x9d5723[_0xf1b1('0x35')]=_0x9d5723[_0xf1b1('0x35')][_0xf1b1('0x37')]?_0x9d5723[_0xf1b1('0x35')]:_0x1b0a54[_0xf1b1('0x30')];if(!_0x49baa0[_0xf1b1('0x31')][_0xf1b1('0x38')](_0xf1b1('0x39'))){_0x9d5723[_0xf1b1('0x1e')]=qs[_0xf1b1('0x1e')](_0x49baa0[_0xf1b1('0x31')][_0xf1b1('0x1e')]);_0x9d5723[_0xf1b1('0x20')]=qs[_0xf1b1('0x20')](_0x49baa0[_0xf1b1('0x31')][_0xf1b1('0x20')]);}_0x9d5723[_0xf1b1('0x3a')]=qs[_0xf1b1('0x3b')](_0x49baa0[_0xf1b1('0x31')]['sort']);_0x9d5723[_0xf1b1('0x3c')]=qs['filters'](_[_0xf1b1('0x3d')](_0x49baa0[_0xf1b1('0x31')],_0x1b0a54[_0xf1b1('0x33')]),_0x1e2d66);if(_0x49baa0['query'][_0xf1b1('0x3e')]){_0x9d5723['where']=_[_0xf1b1('0x3f')](_0x9d5723[_0xf1b1('0x3c')],{'$or':_[_0xf1b1('0x2b')](_0x1e2d66,function(_0x138e10){if(_0x138e10[_0xf1b1('0x2e')]!=='VIRTUAL'){var _0x32282e={};_0x32282e[_0x138e10[_0xf1b1('0x2a')]]={'$like':'%'+_0x49baa0['query']['filter']+'%'};return _0x32282e;}})});}_0x9d5723=_['merge']({},_0x9d5723,_0x49baa0[_0xf1b1('0x40')]);var _0x59e8bc={'where':_0x9d5723[_0xf1b1('0x3c')]};return db[_0xf1b1('0x41')][_0xf1b1('0x1f')](_0x59e8bc)[_0xf1b1('0x26')](function(_0x2efa7d){_0x24ffad['count']=_0x2efa7d;if(_0x49baa0[_0xf1b1('0x31')][_0xf1b1('0x42')]){_0x9d5723[_0xf1b1('0x43')]=[{'all':!![]}];}return db[_0xf1b1('0x41')][_0xf1b1('0x44')](_0x9d5723);})['then'](function(_0x33e7a9){_0x24ffad[_0xf1b1('0x45')]=_0x33e7a9;return _0x24ffad;})[_0xf1b1('0x26')](respondWithFilteredResult(_0x577a3e,_0x9d5723))[_0xf1b1('0x46')](handleError(_0x577a3e,null));};exports[_0xf1b1('0x47')]=function(_0x5add3f,_0x4335e2){var _0x3c94a3={'raw':!![],'where':{'id':_0x5add3f[_0xf1b1('0x48')]['id']}},_0x36e7a8={};_0x36e7a8[_0xf1b1('0x30')]=_['keys'](db[_0xf1b1('0x41')]['rawAttributes']);_0x36e7a8[_0xf1b1('0x31')]=_[_0xf1b1('0x32')](_0x5add3f[_0xf1b1('0x31')]);_0x36e7a8[_0xf1b1('0x33')]=_[_0xf1b1('0x34')](_0x36e7a8[_0xf1b1('0x30')],_0x36e7a8['query']);_0x3c94a3[_0xf1b1('0x35')]=_['intersection'](_0x36e7a8['model'],qs[_0xf1b1('0x36')](_0x5add3f['query'][_0xf1b1('0x36')]));_0x3c94a3['attributes']=_0x3c94a3[_0xf1b1('0x35')][_0xf1b1('0x37')]?_0x3c94a3[_0xf1b1('0x35')]:_0x36e7a8['model'];if(_0x5add3f[_0xf1b1('0x31')][_0xf1b1('0x42')]){_0x3c94a3[_0xf1b1('0x43')]=[{'all':!![]}];}_0x3c94a3=_['merge']({},_0x3c94a3,_0x5add3f[_0xf1b1('0x40')]);return db[_0xf1b1('0x41')][_0xf1b1('0x49')](_0x3c94a3)[_0xf1b1('0x26')](handleEntityNotFound(_0x4335e2,null))[_0xf1b1('0x26')](respondWithResult(_0x4335e2,null))[_0xf1b1('0x46')](handleError(_0x4335e2,null));};exports[_0xf1b1('0x4a')]=function(_0x51930f,_0x34ae5e){if(_0x51930f[_0xf1b1('0x4b')]['id']){delete _0x51930f[_0xf1b1('0x4b')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x51930f[_0xf1b1('0x48')]['id']}})[_0xf1b1('0x26')](handleEntityNotFound(_0x34ae5e,null))[_0xf1b1('0x26')](saveUpdates(_0x51930f[_0xf1b1('0x4b')],null))[_0xf1b1('0x26')](respondWithResult(_0x34ae5e,null))[_0xf1b1('0x46')](handleError(_0x34ae5e,null));};exports[_0xf1b1('0x27')]=function(_0x5340b0,_0x1d4a8a){return db[_0xf1b1('0x41')][_0xf1b1('0x49')]({'where':{'id':_0x5340b0[_0xf1b1('0x48')]['id']}})[_0xf1b1('0x26')](handleEntityNotFound(_0x1d4a8a,null))[_0xf1b1('0x26')](removeEntity(_0x1d4a8a,null))[_0xf1b1('0x46')](handleError(_0x1d4a8a,null));};exports[_0xf1b1('0x4c')]=function(_0x222f4c,_0x132336){var _0x1e896a;return db['sequelize']['transaction'](function(_0x40a8e0){return db['CmCustomField'][_0xf1b1('0x4c')](_0x222f4c['body'],{'transaction':_0x40a8e0})[_0xf1b1('0x26')](function(_0x25ade0){_0x1e896a=_0x25ade0;var _0x46567b={'type':db[_0xf1b1('0x4d')][_0xf1b1('0x4e')],'transaction':_0x40a8e0};switch(_0x222f4c[_0xf1b1('0x4b')][_0xf1b1('0x2e')]){case'text':_0x46567b[_0xf1b1('0x2e')]=db[_0xf1b1('0x4d')][_0xf1b1('0x4e')];break;case'number':_0x46567b[_0xf1b1('0x2e')]=db['Sequelize']['INTEGER'];break;case _0xf1b1('0x4f'):_0x46567b[_0xf1b1('0x2e')]=db[_0xf1b1('0x4d')][_0xf1b1('0x50')];_0x46567b['defaultValue']=![];break;default:}return db['sequelize'][_0xf1b1('0x51')]['addColumn'](_0xf1b1('0x52'),util[_0xf1b1('0x53')](_0xf1b1('0x54'),_0x1e896a['id']),_0x46567b);})['then'](function(){return _0x1e896a;});})['then'](respondWithResult(_0x132336,0xc9))[_0xf1b1('0x46')](handleError(_0x132336,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e24889f..873436f 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 _0x7b20=['moment','bluebird','request-promise','../../config/environment','cm_custom_fields','lodash','util','api'];(function(_0x47a802,_0x424bf1){var _0xb3badc=function(_0x5f44d3){while(--_0x5f44d3){_0x47a802['push'](_0x47a802['shift']());}};_0xb3badc(++_0x424bf1);}(_0x7b20,0xc5));var _0x07b2=function(_0x528038,_0x17a593){_0x528038=_0x528038-0x0;var _0x6b6999=_0x7b20[_0x528038];return _0x6b6999;};'use strict';var _=require(_0x07b2('0x0'));var util=require(_0x07b2('0x1'));var logger=require('../../config/logger')(_0x07b2('0x2'));var moment=require(_0x07b2('0x3'));var BPromise=require(_0x07b2('0x4'));var rp=require(_0x07b2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x07b2('0x6'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x5a5b24,_0xbde574){return _0x5a5b24['define']('CmCustomField',attributes,{'tableName':_0x07b2('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f3=['../../config/environment','./cmCustomField.attributes','exports','cm_custom_fields','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x49ad02,_0x1367dc){var _0x34506f=function(_0x3a3bd6){while(--_0x3a3bd6){_0x49ad02['push'](_0x49ad02['shift']());}};_0x34506f(++_0x1367dc);}(_0x54f3,0x164));var _0x354f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x54f3[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x354f('0x0'));var util=require(_0x354f('0x1'));var logger=require(_0x354f('0x2'))(_0x354f('0x3'));var moment=require(_0x354f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x354f('0x5'));var rimraf=require(_0x354f('0x6'));var config=require(_0x354f('0x7'));var attributes=require(_0x354f('0x8'));module[_0x354f('0x9')]=function(_0x496dba,_0x46d8aa){return _0x496dba['define']('CmCustomField',attributes,{'tableName':_0x354f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 62c7a62..cadce6a 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 _0x5809=['../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5809,0x6a));var _0x9580=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5809[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9580('0x0'));var util=require(_0x9580('0x1'));var moment=require(_0x9580('0x2'));var BPromise=require(_0x9580('0x3'));var rs=require(_0x9580('0x4'));var fs=require('fs');var Redis=require(_0x9580('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9580('0x6'));var logger=require(_0x9580('0x7'))(_0x9580('0x8'));var config=require(_0x9580('0x9'));var jayson=require(_0x9580('0xa'));var client=jayson[_0x9580('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa1cb,_0x2e085c,_0x2c36ee){return new BPromise(function(_0x47b1ea,_0x371de6){return client[_0x9580('0xc')](_0x3aa1cb,_0x2c36ee)[_0x9580('0xd')](function(_0x5262db){logger[_0x9580('0xe')](_0x9580('0xf'),_0x2e085c,_0x9580('0x10'));logger['debug'](_0x9580('0x11'),_0x2e085c,'request\x20sent',JSON[_0x9580('0x12')](_0x5262db));if(_0x5262db[_0x9580('0x13')]){if(_0x5262db[_0x9580('0x13')][_0x9580('0x14')]===0x1f4){logger[_0x9580('0x13')](_0x9580('0xf'),_0x2e085c,_0x5262db['error'][_0x9580('0x15')]);return _0x371de6(_0x5262db[_0x9580('0x13')][_0x9580('0x15')]);}logger['error'](_0x9580('0xf'),_0x2e085c,_0x5262db['error'][_0x9580('0x15')]);return _0x47b1ea(_0x5262db[_0x9580('0x13')][_0x9580('0x15')]);}else{logger['info'](_0x9580('0xf'),_0x2e085c,'request\x20sent');_0x47b1ea(_0x5262db[_0x9580('0x16')][_0x9580('0x15')]);}})['catch'](function(_0x2e9a4b){logger[_0x9580('0x13')](_0x9580('0xf'),_0x2e085c,_0x2e9a4b);_0x371de6(_0x2e9a4b);});});} \ No newline at end of file +var _0x0a93=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x37ac95,_0x2d39e4){var _0x4001f6=function(_0x226667){while(--_0x226667){_0x37ac95['push'](_0x37ac95['shift']());}};_0x4001f6(++_0x2d39e4);}(_0x0a93,0x6a));var _0x30a9=function(_0x398730,_0x57099b){_0x398730=_0x398730-0x0;var _0x3b0d30=_0x0a93[_0x398730];return _0x3b0d30;};'use strict';var _=require(_0x30a9('0x0'));var util=require(_0x30a9('0x1'));var moment=require(_0x30a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x30a9('0x3'));var fs=require('fs');var Redis=require(_0x30a9('0x4'));var db=require(_0x30a9('0x5'))['db'];var utils=require(_0x30a9('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x30a9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c46fb,_0x5ae289,_0x5ed9b4){return new BPromise(function(_0x312a90,_0x3a3f7e){return client[_0x30a9('0x8')](_0x1c46fb,_0x5ed9b4)['then'](function(_0x146fae){logger[_0x30a9('0x9')](_0x30a9('0xa'),_0x5ae289,_0x30a9('0xb'));logger[_0x30a9('0xc')](_0x30a9('0xd'),_0x5ae289,_0x30a9('0xb'),JSON[_0x30a9('0xe')](_0x146fae));if(_0x146fae[_0x30a9('0xf')]){if(_0x146fae['error'][_0x30a9('0x10')]===0x1f4){logger[_0x30a9('0xf')](_0x30a9('0xa'),_0x5ae289,_0x146fae[_0x30a9('0xf')]['message']);return _0x3a3f7e(_0x146fae[_0x30a9('0xf')]['message']);}logger[_0x30a9('0xf')](_0x30a9('0xa'),_0x5ae289,_0x146fae['error']['message']);return _0x312a90(_0x146fae[_0x30a9('0xf')][_0x30a9('0x11')]);}else{logger['info'](_0x30a9('0xa'),_0x5ae289,_0x30a9('0xb'));_0x312a90(_0x146fae[_0x30a9('0x12')][_0x30a9('0x11')]);}})[_0x30a9('0x13')](function(_0x1e7927){logger['error'](_0x30a9('0xa'),_0x5ae289,_0x1e7927);_0x3a3f7e(_0x1e7927);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 90ca4f5..94bfa37 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 _0x3bf5=['connect-timeout','express','fs-extra','../../config/environment','./cmCustomField.controller','get','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util'];(function(_0x12b90b,_0x5a6932){var _0x306926=function(_0x54d594){while(--_0x54d594){_0x12b90b['push'](_0x12b90b['shift']());}};_0x306926(++_0x5a6932);}(_0x3bf5,0x17e));var _0x53bf=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x3bf5[_0x43a37c];return _0x5d1d40;};'use strict';var multer=require(_0x53bf('0x0'));var util=require(_0x53bf('0x1'));var path=require('path');var timeout=require(_0x53bf('0x2'));var express=require(_0x53bf('0x3'));var router=express['Router']();var fs_extra=require(_0x53bf('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x53bf('0x5'));var controller=require(_0x53bf('0x6'));router[_0x53bf('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x53bf('0x7')](_0x53bf('0x8'),auth[_0x53bf('0x9')](),controller[_0x53bf('0xa')]);router['post']('/',auth[_0x53bf('0x9')](),controller[_0x53bf('0xb')]);router[_0x53bf('0xc')]('/:id',auth[_0x53bf('0x9')](),controller[_0x53bf('0xd')]);router['delete'](_0x53bf('0x8'),auth[_0x53bf('0x9')](),controller[_0x53bf('0xe')]);module[_0x53bf('0xf')]=router; \ No newline at end of file +var _0x56a4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5d7b48,_0x1c8eaa){var _0x31bd82=function(_0x3632d5){while(--_0x3632d5){_0x5d7b48['push'](_0x5d7b48['shift']());}};_0x31bd82(++_0x1c8eaa);}(_0x56a4,0x11b));var _0x456a=function(_0x5c7055,_0x550d42){_0x5c7055=_0x5c7055-0x0;var _0x20d196=_0x56a4[_0x5c7055];return _0x20d196;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/:id',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0xc')]('/',auth['isAuthenticated'](),controller[_0x456a('0xd')]);router['put'](_0x456a('0xe'),auth[_0x456a('0xa')](),controller[_0x456a('0xf')]);router[_0x456a('0x10')](_0x456a('0xe'),auth[_0x456a('0xa')](),controller[_0x456a('0x11')]);module[_0x456a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 9f922ee..312aaa4 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 _0x8d0c=['sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','contactListQueue','moment'];(function(_0xde344d,_0x3867c6){var _0x66a9ef=function(_0x11fb93){while(--_0x11fb93){_0xde344d['push'](_0xde344d['shift']());}};_0x66a9ef(++_0x3867c6);}(_0x8d0c,0x153));var _0xc8d0=function(_0x357ad5,_0x2f8479){_0x357ad5=_0x357ad5-0x0;var _0x4325ff=_0x8d0c[_0x357ad5];return _0x4325ff;};'use strict';var moment=require(_0xc8d0('0x0'));var Sequelize=require(_0xc8d0('0x1'));module[_0xc8d0('0x2')]={'phone':{'type':Sequelize[_0xc8d0('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xc8d0('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc8d0('0x5')](_0xc8d0('0x6'))},'countbusyretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc8d0('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc8d0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc8d0('0x8')]},'priority':{'type':Sequelize[_0xc8d0('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc8d0('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc8d0('0x7')],'unique':_0xc8d0('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc8d0('0x9')},'UserId':{'type':Sequelize[_0xc8d0('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xc8d0('0x7')],'unique':_0xc8d0('0x9')},'CampaignId':{'type':Sequelize[_0xc8d0('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc8d0('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xc8d0('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc8d0('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xc8d0('0x8')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xaa38=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','STRING'];(function(_0x5cda92,_0x53897d){var _0x395468=function(_0x2d0133){while(--_0x2d0133){_0x5cda92['push'](_0x5cda92['shift']());}};_0x395468(++_0x53897d);}(_0xaa38,0x156));var _0x8aa3=function(_0x1c0285,_0x1dc1ce){_0x1c0285=_0x1c0285-0x0;var _0x395e76=_0xaa38[_0x1c0285];return _0x395e76;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x8aa3('0x0')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8aa3('0x1')],'defaultValue':moment()['format'](_0x8aa3('0x2'))},'countbusyretry':{'type':Sequelize[_0x8aa3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8aa3('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8aa3('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8aa3('0x1')]},'priority':{'type':Sequelize[_0x8aa3('0x3')](0x2)[_0x8aa3('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8aa3('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8aa3('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8aa3('0x3')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x8aa3('0x3')]},'VoiceQueueId':{'type':Sequelize[_0x8aa3('0x3')],'unique':_0x8aa3('0x6')},'CampaignId':{'type':Sequelize[_0x8aa3('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8aa3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8aa3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8aa3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x8aa3('0x3')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8aa3('0x0')]},'recallmeNotifiedDate':{'type':Sequelize[_0x8aa3('0x1')],'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 85cae6b..e055f4d 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 _0xdc97=['campaigntype','queue','ivr','ContactId','firstName','lastName','calleridname','isNil','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','value','direction','prev','hopperIds','ASC','scheduledAt','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','getPreviewRecall','findOne','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','moment','lodash','../../components/parsers/qs','api','../../mysqldb','status','json','undefined','limit','count','offset','then','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','concat','$and','$gt','$gte','$lt','$not','$between','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','update','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone'];(function(_0x294293,_0x1cf1fd){var _0x49bef8=function(_0x358551){while(--_0x358551){_0x294293['push'](_0x294293['shift']());}};_0x49bef8(++_0x1cf1fd);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1eefc1,_0x5087f0){_0x1eefc1=_0x1eefc1-0x0;var _0x175561=_0xdc97[_0x1eefc1];return _0x175561;};'use strict';var moment=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var qs=require(_0x7dc9('0x2'));var logger=require('../../config/logger')(_0x7dc9('0x3'));var shared=require('../../config/environment');var db=require(_0x7dc9('0x4'))['db'];function respondWithResult(_0x2b86da,_0x478a95){_0x478a95=_0x478a95||0xc8;return function(_0x2a77c1){if(_0x2a77c1){return _0x2b86da[_0x7dc9('0x5')](_0x478a95)[_0x7dc9('0x6')](_0x2a77c1);}};}function respondWithFilteredResult(_0x3ba3ca,_0x589f02){return function(_0x2636ef){if(_0x2636ef){var _0x4f91c7=typeof _0x589f02['offset']===_0x7dc9('0x7')&&typeof _0x589f02[_0x7dc9('0x8')]===_0x7dc9('0x7');var _0x42ec7c=_0x2636ef[_0x7dc9('0x9')];var _0x5ca05b=_0x4f91c7?0x0:_0x589f02[_0x7dc9('0xa')];var _0x44fe24=_0x4f91c7?_0x2636ef[_0x7dc9('0x9')]:_0x589f02[_0x7dc9('0xa')]+_0x589f02[_0x7dc9('0x8')];var _0x3c2af5;if(_0x44fe24>=_0x42ec7c){_0x44fe24=_0x42ec7c;_0x3c2af5=0xc8;}else{_0x3c2af5=0xce;}_0x3ba3ca[_0x7dc9('0x5')](_0x3c2af5);return _0x3ba3ca['set']('Content-Range',_0x5ca05b+'-'+_0x44fe24+'/'+_0x42ec7c)['json'](_0x2636ef);}return null;};}function saveUpdates(_0x599ef1,_0x94c75a){return function(_0x14e5db){if(_0x14e5db){return _0x14e5db['update'](_0x599ef1)[_0x7dc9('0xb')](function(_0x2f3acd){return _0x2f3acd;});}return null;};}function handleEntityNotFound(_0xaadf2,_0xf37bc7){return function(_0x31d43d){if(!_0x31d43d){_0xaadf2[_0x7dc9('0xc')](0x194);}return _0x31d43d;};}function handleError(_0x524d09,_0x3a54f2){_0x3a54f2=_0x3a54f2||0x1f4;return function(_0x278191){logger[_0x7dc9('0xd')](_0x278191[_0x7dc9('0xe')]);if(_0x278191[_0x7dc9('0xf')]){delete _0x278191[_0x7dc9('0xf')];}_0x524d09[_0x7dc9('0x5')](_0x3a54f2)[_0x7dc9('0x10')](_0x278191);};}exports[_0x7dc9('0x11')]=function(_0x5a6e04,_0x22577e){var _0x4afb47={},_0x1f5906={},_0x1cc237={'count':0x0,'rows':[]};var _0x5d61d7=_[_0x7dc9('0x12')](db[_0x7dc9('0x13')][_0x7dc9('0x14')],function(_0x4b2703){return{'name':_0x4b2703[_0x7dc9('0x15')],'type':_0x4b2703[_0x7dc9('0x16')][_0x7dc9('0x17')]};});_0x1f5906[_0x7dc9('0x18')]=_[_0x7dc9('0x12')](_0x5d61d7,_0x7dc9('0xf'));_0x1f5906['query']=_['keys'](_0x5a6e04[_0x7dc9('0x19')]);_0x1f5906[_0x7dc9('0x1a')]=_['intersection'](_0x1f5906[_0x7dc9('0x18')],_0x1f5906[_0x7dc9('0x19')]);_0x1f5906['filters']=_[_0x7dc9('0x1b')](_0x1f5906[_0x7dc9('0x1a')],[_0x7dc9('0x1c'),'$or',_0x7dc9('0x1d'),_0x7dc9('0x1e'),_0x7dc9('0x1f'),'$lte','$ne','$eq',_0x7dc9('0x20'),_0x7dc9('0x21'),'$notBetween','$in',_0x7dc9('0x22'),'$like',_0x7dc9('0x23'),_0x7dc9('0x24'),_0x7dc9('0x25'),_0x7dc9('0x26'),_0x7dc9('0x27'),_0x7dc9('0x28'),_0x7dc9('0x29'),_0x7dc9('0x2a')]);_0x4afb47[_0x7dc9('0x2b')]=_[_0x7dc9('0x2c')](_0x1f5906[_0x7dc9('0x18')],qs[_0x7dc9('0x2d')](_0x5a6e04['query']['fields']));_0x4afb47['attributes']=_0x4afb47['attributes']['length']?_0x4afb47['attributes']:_0x1f5906['model'];if(!_0x5a6e04['query'][_0x7dc9('0x2e')](_0x7dc9('0x2f'))){_0x4afb47[_0x7dc9('0x8')]=qs[_0x7dc9('0x8')](_0x5a6e04[_0x7dc9('0x19')][_0x7dc9('0x8')]);_0x4afb47['offset']=qs['offset'](_0x5a6e04['query'][_0x7dc9('0xa')]);}_0x4afb47['order']=qs[_0x7dc9('0x30')](_0x5a6e04[_0x7dc9('0x19')][_0x7dc9('0x30')]);_0x4afb47[_0x7dc9('0x31')]=qs[_0x7dc9('0x1a')](_[_0x7dc9('0x32')](_0x5a6e04[_0x7dc9('0x19')],_0x1f5906[_0x7dc9('0x1a')]),_0x5d61d7);if(_0x5a6e04['query'][_0x7dc9('0x33')]){_0x4afb47['where']=_[_0x7dc9('0x34')](_0x4afb47[_0x7dc9('0x31')],{'$or':_[_0x7dc9('0x12')](_0x5d61d7,function(_0x1c3b5f){if(_0x1c3b5f['type']!==_0x7dc9('0x35')){var _0x47fb58={};_0x47fb58[_0x1c3b5f[_0x7dc9('0xf')]]={'$like':'%'+_0x5a6e04['query']['filter']+'%'};return _0x47fb58;}})});}_0x4afb47=_[_0x7dc9('0x34')]({},_0x4afb47,_0x5a6e04[_0x7dc9('0x36')]);var _0x21e036={'where':_0x4afb47[_0x7dc9('0x31')]};return db['CmHopper'][_0x7dc9('0x9')](_0x21e036)[_0x7dc9('0xb')](function(_0x138f33){_0x1cc237[_0x7dc9('0x9')]=_0x138f33;if(_0x5a6e04[_0x7dc9('0x19')][_0x7dc9('0x37')]){_0x4afb47[_0x7dc9('0x38')]=[{'all':!![]}];}return db[_0x7dc9('0x13')][_0x7dc9('0x39')](_0x4afb47);})[_0x7dc9('0xb')](function(_0x452aed){_0x1cc237[_0x7dc9('0x3a')]=_0x452aed;return _0x1cc237;})['then'](respondWithFilteredResult(_0x22577e,_0x4afb47))[_0x7dc9('0x3b')](handleError(_0x22577e,null));};exports[_0x7dc9('0x3c')]=function(_0x466b02,_0xfd2612){var _0x4bcdce={'raw':!![],'where':{'id':_0x466b02[_0x7dc9('0x3d')]['id']}},_0x3492e6={};_0x3492e6[_0x7dc9('0x18')]=_[_0x7dc9('0x3e')](db[_0x7dc9('0x13')][_0x7dc9('0x14')]);_0x3492e6['query']=_['keys'](_0x466b02[_0x7dc9('0x19')]);_0x3492e6[_0x7dc9('0x1a')]=_['intersection'](_0x3492e6[_0x7dc9('0x18')],_0x3492e6['query']);_0x4bcdce[_0x7dc9('0x2b')]=_[_0x7dc9('0x2c')](_0x3492e6[_0x7dc9('0x18')],qs['fields'](_0x466b02[_0x7dc9('0x19')][_0x7dc9('0x2d')]));_0x4bcdce[_0x7dc9('0x2b')]=_0x4bcdce[_0x7dc9('0x2b')][_0x7dc9('0x3f')]?_0x4bcdce[_0x7dc9('0x2b')]:_0x3492e6[_0x7dc9('0x18')];if(_0x466b02['query'][_0x7dc9('0x37')]){_0x4bcdce['include']=[{'all':!![]}];}_0x4bcdce=_['merge']({},_0x4bcdce,_0x466b02[_0x7dc9('0x36')]);return db[_0x7dc9('0x13')][_0x7dc9('0x40')](_0x4bcdce)[_0x7dc9('0xb')](handleEntityNotFound(_0xfd2612,null))[_0x7dc9('0xb')](respondWithResult(_0xfd2612,null))[_0x7dc9('0x3b')](handleError(_0xfd2612,null));};exports[_0x7dc9('0x41')]=function(_0x765fee,_0x3b130f){return db['CmHopper'][_0x7dc9('0x41')](_0x765fee[_0x7dc9('0x42')],{})[_0x7dc9('0xb')](respondWithResult(_0x3b130f,0xc9))[_0x7dc9('0x3b')](handleError(_0x3b130f,null));};exports[_0x7dc9('0x43')]=function(_0x19957f,_0x575393){if(_0x19957f[_0x7dc9('0x42')]['id']){delete _0x19957f[_0x7dc9('0x42')]['id'];}return db['CmHopper'][_0x7dc9('0x40')]({'where':{'id':_0x19957f[_0x7dc9('0x3d')]['id']}})[_0x7dc9('0xb')](handleEntityNotFound(_0x575393,null))['then'](saveUpdates(_0x19957f[_0x7dc9('0x42')],null))['then'](respondWithResult(_0x575393,null))['catch'](handleError(_0x575393,null));};exports[_0x7dc9('0x44')]=function(_0x30a315,_0x36d591){return db['CmHopper']['describe']()[_0x7dc9('0xb')](respondWithResult(_0x36d591,null))['catch'](handleError(_0x36d591,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){var _0x24ccce;var _0x1d6c0a=_0x4ab558[_0x7dc9('0x3d')]['id'];return db[_0x7dc9('0x13')][_0x7dc9('0x40')]({'where':{'id':_0x4ab558[_0x7dc9('0x3d')]['id']}})[_0x7dc9('0xb')](handleEntityNotFound(_0x5e2d59,null))[_0x7dc9('0xb')](function(_0x44883f){if(_0x44883f){return _0x44883f[_0x7dc9('0x45')]()[_0x7dc9('0xb')](function(_0x13580b){return _0x13580b;});}})[_0x7dc9('0xb')](function(_0x59be9b){_0x24ccce=_0x59be9b;if(_0x59be9b){if(_0x59be9b[_0x7dc9('0x46')]||_0x59be9b['CampaignId']){return db[_0x59be9b['VoiceQueueId']?_0x7dc9('0x47'):_0x7dc9('0x48')][_0x7dc9('0x40')]({'where':{'id':_0x59be9b[_0x7dc9('0x46')]?_0x59be9b[_0x7dc9('0x46')]:_0x59be9b['CampaignId']},'attributes':['id',_0x7dc9('0xf')],'raw':!![]});}}})[_0x7dc9('0xb')](function(_0x34f7b1){var _0x4a9b75={};if(_0x34f7b1){_[_0x7dc9('0x34')](_0x4a9b75,_[_0x7dc9('0x49')](_0x24ccce[_0x7dc9('0x4a')],[_0x7dc9('0x4b'),_0x7dc9('0x4c'),'id']));_0x4a9b75[_0x7dc9('0x4d')]=0x15;_0x4a9b75['statedesc']=_0x7dc9('0x4e');_0x4a9b75[_0x7dc9('0x4f')]=_0x34f7b1[_0x7dc9('0xf')];_0x4a9b75[_0x7dc9('0x50')]=_0x4ab558[_0x7dc9('0x51')][_0x7dc9('0xf')];_0x4a9b75[_0x7dc9('0x52')]=_0x4ab558[_0x7dc9('0x51')]['id'];_0x4a9b75[_0x7dc9('0x4e')]=!![];_0x4a9b75[_0x7dc9('0x53')]=moment()[_0x7dc9('0x54')](_0x7dc9('0x55'));_0x4a9b75['calleridnum']=_0x24ccce[_0x7dc9('0x56')];_0x4a9b75[_0x7dc9('0x57')]=_0x24ccce[_0x7dc9('0x46')]?_0x7dc9('0x58'):_0x7dc9('0x59');return db['CmContact'][_0x7dc9('0x40')]({'where':{'id':_0x4a9b75[_0x7dc9('0x5a')]},'attributes':[_0x7dc9('0x5b'),_0x7dc9('0x5c')]})[_0x7dc9('0xb')](function(_0x2f01a0){if(!_['isNil'](_0x5e2d59)&&!_['isNil'](_0x2f01a0['firstName'])){_0x4a9b75[_0x7dc9('0x5d')]=_0x2f01a0[_0x7dc9('0x5b')];if(!_[_0x7dc9('0x5e')](_0x2f01a0[_0x7dc9('0x5c')])){_0x4a9b75['calleridname']+='\x20'+_0x2f01a0['lastName'];}}})[_0x7dc9('0x5f')](function(){return db[_0x7dc9('0x60')][_0x7dc9('0x41')](_0x4a9b75);});}})[_0x7dc9('0xb')](function(_0x2caf7f){return db[_0x7dc9('0x61')][_0x7dc9('0x45')]({'where':{'CmHopperId':_0x1d6c0a}});})['then'](function(){return _0x5e2d59[_0x7dc9('0x5')](0xcc)[_0x7dc9('0x62')]();})[_0x7dc9('0x3b')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x63')]=function(_0x4683b3,_0x4bbf8b){var _0x175858=[];return db[_0x7dc9('0x64')][_0x7dc9('0x44')]()[_0x7dc9('0xb')](function(_0x2454d7){_0x175858=_[_0x7dc9('0x3e')](_0x2454d7);return _0x4683b3[_0x7dc9('0x51')][_0x7dc9('0x65')]({'where':{'type':_0x7dc9('0x66'),'dialActive':!![],'dialMethod':_0x7dc9('0x67')},'attributes':['id',_0x7dc9('0x68'),_0x7dc9('0x69')],'raw':!![]});})[_0x7dc9('0xb')](function(_0x5eee27){if(_0x5eee27&&_0x5eee27[_0x7dc9('0x3f')]){return db['sequelize'][_0x7dc9('0x6a')](function(_0x15cf19){var _0x48ea37={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7dc9('0x54')](_0x7dc9('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x5eee27,'id')},'$or':[{'UserId':null},{'UserId':_0x4683b3[_0x7dc9('0x51')]['id']}]};var _0x34cca4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5eee27)[_0x7dc9('0x33')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x7dc9('0x6b')]()},'$or':[{'UserId':null},{'UserId':_0x4683b3[_0x7dc9('0x51')]['id']}]};var _0x4ed60e={'$or':[_0x48ea37,_0x34cca4]};var _0x3aba59=[];if(_0x4683b3[_0x7dc9('0x42')][_0x7dc9('0x6c')]&&_0x4683b3[_0x7dc9('0x42')][_0x7dc9('0x6c')]===_0x7dc9('0x6d')){if(!_['isEmpty'](_0x4683b3[_0x7dc9('0x42')][_0x7dc9('0x6e')])){_0x4ed60e['id']={'$in':_0x4683b3[_0x7dc9('0x42')]['hopperIds']};}_0x3aba59=[['priority',_0x7dc9('0x6f')],[_0x7dc9('0x70'),_0x5eee27[0x0][_0x7dc9('0x68')]===_0x7dc9('0x6f')?'DESC':'ASC'],db[_0x7dc9('0x71')][_0x7dc9('0x72')](_0x7dc9('0x73')),['id',_0x7dc9('0x74')]];}else{if(!_['isEmpty'](_0x4683b3[_0x7dc9('0x42')][_0x7dc9('0x6e')])){_0x4ed60e['id']={'$notIn':_0x4683b3[_0x7dc9('0x42')][_0x7dc9('0x6e')]};}_0x3aba59=[[_0x7dc9('0x75'),_0x7dc9('0x74')],[_0x7dc9('0x70'),_0x5eee27[0x0]['dialOrderByScheduledAt']],db[_0x7dc9('0x71')][_0x7dc9('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x7dc9('0x13')]['findOne']({'attributes':['id',_0x7dc9('0x76'),_0x7dc9('0x56'),_0x7dc9('0x77')],'where':_0x4ed60e,'order':_0x3aba59,'transaction':_0x15cf19,'lock':_0x15cf19[_0x7dc9('0x78')][_0x7dc9('0x79')],'include':[{'model':db[_0x7dc9('0x64')],'as':_0x7dc9('0x7a'),'attributes':_0x175858,'include':[{'model':db[_0x7dc9('0x7b')],'as':_0x7dc9('0x7c'),'attributes':['id',_0x7dc9('0xf')]}]},{'model':db['CmList'],'as':_0x7dc9('0x7d'),'attributes':['id',_0x7dc9('0xf')]},{'model':db[_0x7dc9('0x47')],'as':'Queue','attributes':['id',_0x7dc9('0xf'),'dialActive']}]})['then'](function(_0x4202ce){if(_0x4202ce){return _0x4202ce[_0x7dc9('0x43')]({'UserId':_0x4683b3['user']['id']},{'transaction':_0x15cf19});}});});}})[_0x7dc9('0xb')](handleEntityNotFound(_0x4bbf8b,null))['then'](respondWithResult(_0x4bbf8b,null))['catch'](handleError(_0x4bbf8b,null));};exports[_0x7dc9('0x7e')]=function(_0x26c033,_0x3b096d,_0xb8be9){var _0x56f757=[];var _0xf9a553=_0x26c033[_0x7dc9('0x3d')]['id'];var _0x222370=_0x26c033[_0x7dc9('0x51')]['id'];return db[_0x7dc9('0x64')][_0x7dc9('0x44')]()[_0x7dc9('0xb')](function(_0x93b4a9){_0x56f757=_['keys'](_0x93b4a9);return db['sequelize'][_0x7dc9('0x6a')](function(_0x4cfaba){const _0x9a83b1={'id':_0xf9a553};return db[_0x7dc9('0x13')][_0x7dc9('0x7f')]({'attributes':['id',_0x7dc9('0x76'),'recallme'],'where':_0x9a83b1,'transaction':_0x4cfaba,'lock':_0x4cfaba[_0x7dc9('0x78')][_0x7dc9('0x79')],'include':[{'model':db['CmContact'],'as':_0x7dc9('0x7a'),'attributes':_0x56f757,'include':[{'model':db[_0x7dc9('0x7b')],'as':_0x7dc9('0x7c'),'attributes':['id',_0x7dc9('0xf')]}]},{'model':db['CmList'],'as':_0x7dc9('0x7d'),'attributes':['id',_0x7dc9('0xf')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x7dc9('0xf'),_0x7dc9('0x80')]}]})['then'](function(_0x114078){if(_0x114078){return _0x114078['update']({'UserId':_0x222370},{'transaction':_0x4cfaba});}});});})[_0x7dc9('0xb')](handleEntityNotFound(_0x3b096d,null))[_0x7dc9('0xb')](respondWithResult(_0x3b096d,null))[_0x7dc9('0x3b')](handleError(_0x3b096d,null));};exports['getOpenContacts']=function(_0x33d68c,_0x3c7daf){return _0x33d68c[_0x7dc9('0x51')]['getVoiceQueues']({'where':{'type':_0x7dc9('0x66'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0xa899){if(_0xa899&&_0xa899[_0x7dc9('0x3f')]){return db[_0x7dc9('0x13')][_0x7dc9('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7dc9('0x54')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x7dc9('0x12')](_0xa899,'id')},'$or':[{'UserId':null},{'UserId':_0x33d68c[_0x7dc9('0x51')]['id']}]}});}return 0x0;})[_0x7dc9('0xb')](function(_0x2dc92e){if(!_[_0x7dc9('0x5e')](_0x2dc92e)&&_['isNumber'](_0x2dc92e)){return _0x3c7daf[_0x7dc9('0x5')](0xc8)[_0x7dc9('0x6')]({'contacts':_0x2dc92e});}else{logger[_0x7dc9('0xd')](_0x7dc9('0x81'),'getOpenContacts',0x194,_0x7dc9('0x82'));_0x3c7daf['sendStatus'](0x194);}})['catch'](handleError(_0x3c7daf,null));};exports[_0x7dc9('0x83')]=function(_0x583834,_0x21da79){var _0x476a24=shared[_0x7dc9('0x84')];var _0xcf3a6f=[];_[_0x7dc9('0x12')](_0x476a24,function(_0xc716c3){_0xcf3a6f['push']({'id':_0xc716c3[_0x7dc9('0xf')],'name':_0xc716c3[_0x7dc9('0xf')],'utcOffset':_0xc716c3[_0x7dc9('0x85')]});});return _0x21da79[_0x7dc9('0x5')](0xc8)[_0x7dc9('0x6')]({'tz':_0xcf3a6f});};exports['getTimezone']=function(_0x18ee88,_0x562b7f){var _0x3c5941=shared[_0x7dc9('0x84')];var _0x1c070a={};if(!_['isNil'](_0x3c5941[_0x18ee88[_0x7dc9('0x42')]['id']]))_0x1c070a=_0x3c5941[_0x18ee88[_0x7dc9('0x42')]['id']];return _0x562b7f['status'](0xc8)[_0x7dc9('0x6')](_0x1c070a);}; \ No newline at end of file +var _0x3baf=['then','sendStatus','stack','name','send','index','CmHopper','rawAttributes','type','key','model','map','query','keys','filters','concat','$gt','$gte','$lte','$ne','$between','$notBetween','$notIn','$like','$notLike','$notILike','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','create','body','find','describe','destroy','params','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getVoiceQueues','transaction','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','recallme','UPDATE','getOpenContacts','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','limit','count','offset','set','Content-Range','update'];(function(_0x5ebe85,_0x1cd906){var _0x4ff5de=function(_0x7d9593){while(--_0x7d9593){_0x5ebe85['push'](_0x5ebe85['shift']());}};_0x4ff5de(++_0x1cd906);}(_0x3baf,0xf7));var _0xf3ba=function(_0x37ef38,_0x2cfe4e){_0x37ef38=_0x37ef38-0x0;var _0x499daa=_0x3baf[_0x37ef38];return _0x499daa;};'use strict';var moment=require(_0xf3ba('0x0'));var _=require(_0xf3ba('0x1'));var qs=require(_0xf3ba('0x2'));var logger=require(_0xf3ba('0x3'))(_0xf3ba('0x4'));var shared=require(_0xf3ba('0x5'));var db=require(_0xf3ba('0x6'))['db'];function respondWithResult(_0x306bdd,_0x3e6058){_0x3e6058=_0x3e6058||0xc8;return function(_0x1ae6e6){if(_0x1ae6e6){return _0x306bdd[_0xf3ba('0x7')](_0x3e6058)[_0xf3ba('0x8')](_0x1ae6e6);}};}function respondWithFilteredResult(_0x475268,_0x2e6df2){return function(_0x1284b7){if(_0x1284b7){var _0x4de144=typeof _0x2e6df2['offset']==='undefined'&&typeof _0x2e6df2[_0xf3ba('0x9')]==='undefined';var _0x346f5b=_0x1284b7[_0xf3ba('0xa')];var _0x3ae5fb=_0x4de144?0x0:_0x2e6df2[_0xf3ba('0xb')];var _0x3a5714=_0x4de144?_0x1284b7[_0xf3ba('0xa')]:_0x2e6df2[_0xf3ba('0xb')]+_0x2e6df2[_0xf3ba('0x9')];var _0x32ecd1;if(_0x3a5714>=_0x346f5b){_0x3a5714=_0x346f5b;_0x32ecd1=0xc8;}else{_0x32ecd1=0xce;}_0x475268[_0xf3ba('0x7')](_0x32ecd1);return _0x475268[_0xf3ba('0xc')](_0xf3ba('0xd'),_0x3ae5fb+'-'+_0x3a5714+'/'+_0x346f5b)[_0xf3ba('0x8')](_0x1284b7);}return null;};}function saveUpdates(_0x85939e,_0x26cefe){return function(_0x17673a){if(_0x17673a){return _0x17673a[_0xf3ba('0xe')](_0x85939e)[_0xf3ba('0xf')](function(_0x505b8d){return _0x505b8d;});}return null;};}function handleEntityNotFound(_0x327675,_0x56816b){return function(_0x815037){if(!_0x815037){_0x327675[_0xf3ba('0x10')](0x194);}return _0x815037;};}function handleError(_0x4717be,_0x1e2969){_0x1e2969=_0x1e2969||0x1f4;return function(_0x235c8a){logger['error'](_0x235c8a[_0xf3ba('0x11')]);if(_0x235c8a[_0xf3ba('0x12')]){delete _0x235c8a[_0xf3ba('0x12')];}_0x4717be['status'](_0x1e2969)[_0xf3ba('0x13')](_0x235c8a);};}exports[_0xf3ba('0x14')]=function(_0x430d64,_0x44de40){var _0x4d3c0a={},_0x1e18ed={},_0x3b0d9e={'count':0x0,'rows':[]};var _0x4e601c=_['map'](db[_0xf3ba('0x15')][_0xf3ba('0x16')],function(_0x854fc4){return{'name':_0x854fc4['fieldName'],'type':_0x854fc4[_0xf3ba('0x17')][_0xf3ba('0x18')]};});_0x1e18ed[_0xf3ba('0x19')]=_[_0xf3ba('0x1a')](_0x4e601c,_0xf3ba('0x12'));_0x1e18ed[_0xf3ba('0x1b')]=_[_0xf3ba('0x1c')](_0x430d64['query']);_0x1e18ed['filters']=_['intersection'](_0x1e18ed[_0xf3ba('0x19')],_0x1e18ed[_0xf3ba('0x1b')]);_0x1e18ed[_0xf3ba('0x1d')]=_[_0xf3ba('0x1e')](_0x1e18ed[_0xf3ba('0x1d')],['$and','$or',_0xf3ba('0x1f'),_0xf3ba('0x20'),'$lt',_0xf3ba('0x21'),_0xf3ba('0x22'),'$eq','$not',_0xf3ba('0x23'),_0xf3ba('0x24'),'$in',_0xf3ba('0x25'),_0xf3ba('0x26'),_0xf3ba('0x27'),'$iLike',_0xf3ba('0x28'),'$like','$overlap',_0xf3ba('0x29'),_0xf3ba('0x2a'),'$any']);_0x4d3c0a[_0xf3ba('0x2b')]=_[_0xf3ba('0x2c')](_0x1e18ed['model'],qs['fields'](_0x430d64['query'][_0xf3ba('0x2d')]));_0x4d3c0a[_0xf3ba('0x2b')]=_0x4d3c0a['attributes'][_0xf3ba('0x2e')]?_0x4d3c0a['attributes']:_0x1e18ed['model'];if(!_0x430d64[_0xf3ba('0x1b')][_0xf3ba('0x2f')](_0xf3ba('0x30'))){_0x4d3c0a[_0xf3ba('0x9')]=qs[_0xf3ba('0x9')](_0x430d64[_0xf3ba('0x1b')]['limit']);_0x4d3c0a[_0xf3ba('0xb')]=qs['offset'](_0x430d64[_0xf3ba('0x1b')][_0xf3ba('0xb')]);}_0x4d3c0a['order']=qs[_0xf3ba('0x31')](_0x430d64[_0xf3ba('0x1b')][_0xf3ba('0x31')]);_0x4d3c0a[_0xf3ba('0x32')]=qs['filters'](_[_0xf3ba('0x33')](_0x430d64['query'],_0x1e18ed['filters']),_0x4e601c);if(_0x430d64['query'][_0xf3ba('0x34')]){_0x4d3c0a[_0xf3ba('0x32')]=_[_0xf3ba('0x35')](_0x4d3c0a[_0xf3ba('0x32')],{'$or':_[_0xf3ba('0x1a')](_0x4e601c,function(_0x55b29b){if(_0x55b29b[_0xf3ba('0x17')]!=='VIRTUAL'){var _0x3a927e={};_0x3a927e[_0x55b29b['name']]={'$like':'%'+_0x430d64[_0xf3ba('0x1b')][_0xf3ba('0x34')]+'%'};return _0x3a927e;}})});}_0x4d3c0a=_[_0xf3ba('0x35')]({},_0x4d3c0a,_0x430d64[_0xf3ba('0x36')]);var _0x55d9be={'where':_0x4d3c0a[_0xf3ba('0x32')]};return db[_0xf3ba('0x15')]['count'](_0x55d9be)[_0xf3ba('0xf')](function(_0x2405e5){_0x3b0d9e[_0xf3ba('0xa')]=_0x2405e5;if(_0x430d64[_0xf3ba('0x1b')][_0xf3ba('0x37')]){_0x4d3c0a[_0xf3ba('0x38')]=[{'all':!![]}];}return db[_0xf3ba('0x15')]['findAll'](_0x4d3c0a);})[_0xf3ba('0xf')](function(_0x527092){_0x3b0d9e[_0xf3ba('0x39')]=_0x527092;return _0x3b0d9e;})['then'](respondWithFilteredResult(_0x44de40,_0x4d3c0a))[_0xf3ba('0x3a')](handleError(_0x44de40,null));};exports[_0xf3ba('0x3b')]=function(_0x1251b1,_0x39bbea){var _0x2cbfca={'raw':!![],'where':{'id':_0x1251b1['params']['id']}},_0x5f3dcc={};_0x5f3dcc[_0xf3ba('0x19')]=_[_0xf3ba('0x1c')](db[_0xf3ba('0x15')][_0xf3ba('0x16')]);_0x5f3dcc[_0xf3ba('0x1b')]=_[_0xf3ba('0x1c')](_0x1251b1['query']);_0x5f3dcc[_0xf3ba('0x1d')]=_['intersection'](_0x5f3dcc[_0xf3ba('0x19')],_0x5f3dcc[_0xf3ba('0x1b')]);_0x2cbfca[_0xf3ba('0x2b')]=_[_0xf3ba('0x2c')](_0x5f3dcc[_0xf3ba('0x19')],qs[_0xf3ba('0x2d')](_0x1251b1[_0xf3ba('0x1b')][_0xf3ba('0x2d')]));_0x2cbfca['attributes']=_0x2cbfca[_0xf3ba('0x2b')][_0xf3ba('0x2e')]?_0x2cbfca[_0xf3ba('0x2b')]:_0x5f3dcc[_0xf3ba('0x19')];if(_0x1251b1[_0xf3ba('0x1b')][_0xf3ba('0x37')]){_0x2cbfca[_0xf3ba('0x38')]=[{'all':!![]}];}_0x2cbfca=_['merge']({},_0x2cbfca,_0x1251b1[_0xf3ba('0x36')]);return db[_0xf3ba('0x15')]['find'](_0x2cbfca)[_0xf3ba('0xf')](handleEntityNotFound(_0x39bbea,null))[_0xf3ba('0xf')](respondWithResult(_0x39bbea,null))[_0xf3ba('0x3a')](handleError(_0x39bbea,null));};exports[_0xf3ba('0x3c')]=function(_0x3c454e,_0x6a0ca0){return db[_0xf3ba('0x15')][_0xf3ba('0x3c')](_0x3c454e[_0xf3ba('0x3d')],{})[_0xf3ba('0xf')](respondWithResult(_0x6a0ca0,0xc9))[_0xf3ba('0x3a')](handleError(_0x6a0ca0,null));};exports[_0xf3ba('0xe')]=function(_0x40c152,_0x422655){if(_0x40c152[_0xf3ba('0x3d')]['id']){delete _0x40c152[_0xf3ba('0x3d')]['id'];}return db[_0xf3ba('0x15')][_0xf3ba('0x3e')]({'where':{'id':_0x40c152['params']['id']}})[_0xf3ba('0xf')](handleEntityNotFound(_0x422655,null))[_0xf3ba('0xf')](saveUpdates(_0x40c152['body'],null))[_0xf3ba('0xf')](respondWithResult(_0x422655,null))[_0xf3ba('0x3a')](handleError(_0x422655,null));};exports[_0xf3ba('0x3f')]=function(_0x36f476,_0x52ef61){return db['CmHopper'][_0xf3ba('0x3f')]()[_0xf3ba('0xf')](respondWithResult(_0x52ef61,null))[_0xf3ba('0x3a')](handleError(_0x52ef61,null));};exports[_0xf3ba('0x40')]=function(_0x502483,_0x2d3a0d){var _0xdc71c8;var _0x221050=_0x502483['params']['id'];return db[_0xf3ba('0x15')][_0xf3ba('0x3e')]({'where':{'id':_0x502483[_0xf3ba('0x41')]['id']}})[_0xf3ba('0xf')](handleEntityNotFound(_0x2d3a0d,null))[_0xf3ba('0xf')](function(_0xaaf8b){if(_0xaaf8b){return _0xaaf8b[_0xf3ba('0x40')]()[_0xf3ba('0xf')](function(_0x4620c0){return _0x4620c0;});}})[_0xf3ba('0xf')](function(_0x534426){_0xdc71c8=_0x534426;if(_0x534426){if(_0x534426[_0xf3ba('0x42')]||_0x534426[_0xf3ba('0x43')]){return db[_0x534426[_0xf3ba('0x42')]?_0xf3ba('0x44'):'Campaign'][_0xf3ba('0x3e')]({'where':{'id':_0x534426['VoiceQueueId']?_0x534426['VoiceQueueId']:_0x534426[_0xf3ba('0x43')]},'attributes':['id',_0xf3ba('0x12')],'raw':!![]});}}})[_0xf3ba('0xf')](function(_0x1fc9e6){var _0x410cf6={};if(_0x1fc9e6){_[_0xf3ba('0x35')](_0x410cf6,_[_0xf3ba('0x45')](_0xdc71c8[_0xf3ba('0x46')],['createdAt',_0xf3ba('0x47'),'id']));_0x410cf6[_0xf3ba('0x48')]=0x15;_0x410cf6[_0xf3ba('0x49')]=_0xf3ba('0x4a');_0x410cf6['campaign']=_0x1fc9e6['name'];_0x410cf6[_0xf3ba('0x4b')]=_0x502483[_0xf3ba('0x4c')][_0xf3ba('0x12')];_0x410cf6[_0xf3ba('0x4d')]=_0x502483[_0xf3ba('0x4c')]['id'];_0x410cf6['deleted']=!![];_0x410cf6[_0xf3ba('0x4e')]=moment()['format'](_0xf3ba('0x4f'));_0x410cf6['calleridnum']=_0xdc71c8[_0xf3ba('0x50')];_0x410cf6['campaigntype']=_0xdc71c8[_0xf3ba('0x42')]?_0xf3ba('0x51'):_0xf3ba('0x52');return db[_0xf3ba('0x53')][_0xf3ba('0x3e')]({'where':{'id':_0x410cf6['ContactId']},'attributes':[_0xf3ba('0x54'),_0xf3ba('0x55')]})[_0xf3ba('0xf')](function(_0x494f83){if(!_[_0xf3ba('0x56')](_0x2d3a0d)&&!_['isNil'](_0x494f83[_0xf3ba('0x54')])){_0x410cf6[_0xf3ba('0x57')]=_0x494f83[_0xf3ba('0x54')];if(!_[_0xf3ba('0x56')](_0x494f83[_0xf3ba('0x55')])){_0x410cf6[_0xf3ba('0x57')]+='\x20'+_0x494f83[_0xf3ba('0x55')];}}})[_0xf3ba('0x58')](function(){return db[_0xf3ba('0x59')][_0xf3ba('0x3c')](_0x410cf6);});}})[_0xf3ba('0xf')](function(_0x4f731d){return db[_0xf3ba('0x5a')]['destroy']({'where':{'CmHopperId':_0x221050}});})[_0xf3ba('0xf')](function(){return _0x2d3a0d[_0xf3ba('0x7')](0xcc)[_0xf3ba('0x5b')]();})[_0xf3ba('0x3a')](handleError(_0x2d3a0d,null));};exports['getPreview']=function(_0x26fd3e,_0x307a22){var _0x437458=[];return db[_0xf3ba('0x53')][_0xf3ba('0x3f')]()[_0xf3ba('0xf')](function(_0x3cd4fc){_0x437458=_[_0xf3ba('0x1c')](_0x3cd4fc);return _0x26fd3e[_0xf3ba('0x4c')][_0xf3ba('0x5c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0xf3ba('0xf')](function(_0x172eb7){if(_0x172eb7&&_0x172eb7[_0xf3ba('0x2e')]){return db['sequelize'][_0xf3ba('0x5d')](function(_0x5797a5){var _0x102adb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf3ba('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x172eb7,'id')},'$or':[{'UserId':null},{'UserId':_0x26fd3e[_0xf3ba('0x4c')]['id']}]};var _0x522e55={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x172eb7)[_0xf3ba('0x34')](['dialPreviewAutoRecallMe',0x0])[_0xf3ba('0x1a')]('id')[_0xf3ba('0x5f')]()},'$or':[{'UserId':null},{'UserId':_0x26fd3e[_0xf3ba('0x4c')]['id']}]};var _0x44b33f={'$or':[_0x102adb,_0x522e55]};var _0x540228=[];if(_0x26fd3e[_0xf3ba('0x3d')]['direction']&&_0x26fd3e['body'][_0xf3ba('0x60')]===_0xf3ba('0x61')){if(!_[_0xf3ba('0x62')](_0x26fd3e[_0xf3ba('0x3d')][_0xf3ba('0x63')])){_0x44b33f['id']={'$in':_0x26fd3e[_0xf3ba('0x3d')]['hopperIds']};}_0x540228=[[_0xf3ba('0x64'),_0xf3ba('0x65')],[_0xf3ba('0x66'),_0x172eb7[0x0]['dialOrderByScheduledAt']===_0xf3ba('0x65')?_0xf3ba('0x67'):_0xf3ba('0x65')],db[_0xf3ba('0x68')]['literal'](_0xf3ba('0x69')),['id',_0xf3ba('0x67')]];}else{if(!_[_0xf3ba('0x62')](_0x26fd3e[_0xf3ba('0x3d')][_0xf3ba('0x63')])){_0x44b33f['id']={'$notIn':_0x26fd3e['body'][_0xf3ba('0x63')]};}_0x540228=[[_0xf3ba('0x64'),_0xf3ba('0x67')],[_0xf3ba('0x66'),_0x172eb7[0x0][_0xf3ba('0x6a')]],db[_0xf3ba('0x68')][_0xf3ba('0x6b')](_0xf3ba('0x6c')),['id',_0xf3ba('0x65')]];}return db[_0xf3ba('0x15')][_0xf3ba('0x6d')]({'attributes':['id',_0xf3ba('0x6e'),_0xf3ba('0x50'),'recallme'],'where':_0x44b33f,'order':_0x540228,'transaction':_0x5797a5,'lock':_0x5797a5[_0xf3ba('0x6f')]['UPDATE'],'include':[{'model':db[_0xf3ba('0x53')],'as':_0xf3ba('0x70'),'attributes':_0x437458,'include':[{'model':db[_0xf3ba('0x71')],'as':_0xf3ba('0x72'),'attributes':['id',_0xf3ba('0x12')]}]},{'model':db[_0xf3ba('0x73')],'as':_0xf3ba('0x74'),'attributes':['id',_0xf3ba('0x12')]},{'model':db['VoiceQueue'],'as':_0xf3ba('0x75'),'attributes':['id',_0xf3ba('0x12'),_0xf3ba('0x76')]}]})['then'](function(_0x3e1c39){if(_0x3e1c39){return _0x3e1c39[_0xf3ba('0xe')]({'UserId':_0x26fd3e[_0xf3ba('0x4c')]['id']},{'transaction':_0x5797a5});}});});}})[_0xf3ba('0xf')](handleEntityNotFound(_0x307a22,null))[_0xf3ba('0xf')](respondWithResult(_0x307a22,null))[_0xf3ba('0x3a')](handleError(_0x307a22,null));};exports[_0xf3ba('0x77')]=function(_0x3b1d98,_0x3d966b,_0x4b4267){var _0x588ef2=[];var _0x1060e4=_0x3b1d98[_0xf3ba('0x41')]['id'];var _0x4ce3fc=_0x3b1d98[_0xf3ba('0x4c')]['id'];return db['CmContact'][_0xf3ba('0x3f')]()['then'](function(_0x409f1f){_0x588ef2=_[_0xf3ba('0x1c')](_0x409f1f);return db['sequelize'][_0xf3ba('0x5d')](function(_0x57e5a6){const _0x1105d2={'id':_0x1060e4};return db[_0xf3ba('0x15')][_0xf3ba('0x6d')]({'attributes':['id',_0xf3ba('0x6e'),_0xf3ba('0x78')],'where':_0x1105d2,'transaction':_0x57e5a6,'lock':_0x57e5a6[_0xf3ba('0x6f')][_0xf3ba('0x79')],'include':[{'model':db[_0xf3ba('0x53')],'as':_0xf3ba('0x70'),'attributes':_0x588ef2,'include':[{'model':db['CmCompany'],'as':_0xf3ba('0x72'),'attributes':['id',_0xf3ba('0x12')]}]},{'model':db[_0xf3ba('0x73')],'as':_0xf3ba('0x74'),'attributes':['id',_0xf3ba('0x12')]},{'model':db[_0xf3ba('0x44')],'as':'Queue','attributes':['id',_0xf3ba('0x12'),_0xf3ba('0x76')]}]})[_0xf3ba('0xf')](function(_0x521341){if(_0x521341){return _0x521341[_0xf3ba('0xe')]({'UserId':_0x4ce3fc},{'transaction':_0x57e5a6});}});});})[_0xf3ba('0xf')](handleEntityNotFound(_0x3d966b,null))[_0xf3ba('0xf')](respondWithResult(_0x3d966b,null))[_0xf3ba('0x3a')](handleError(_0x3d966b,null));};exports[_0xf3ba('0x7a')]=function(_0x388170,_0x5b3aef){return _0x388170[_0xf3ba('0x4c')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xf3ba('0x7b')},'attributes':['id'],'raw':!![]})[_0xf3ba('0xf')](function(_0x5c488f){if(_0x5c488f&&_0x5c488f['length']){return db[_0xf3ba('0x15')][_0xf3ba('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf3ba('0x5e')](_0xf3ba('0x4f'))},'VoiceQueueId':{'$in':_[_0xf3ba('0x1a')](_0x5c488f,'id')},'$or':[{'UserId':null},{'UserId':_0x388170[_0xf3ba('0x4c')]['id']}]}});}return 0x0;})[_0xf3ba('0xf')](function(_0x5e78c2){if(!_[_0xf3ba('0x56')](_0x5e78c2)&&_[_0xf3ba('0x7c')](_0x5e78c2)){return _0x5b3aef['status'](0xc8)[_0xf3ba('0x8')]({'contacts':_0x5e78c2});}else{logger[_0xf3ba('0x7d')](_0xf3ba('0x7e'),_0xf3ba('0x7a'),0x194,_0xf3ba('0x7f'));_0x5b3aef[_0xf3ba('0x10')](0x194);}})[_0xf3ba('0x3a')](handleError(_0x5b3aef,null));};exports[_0xf3ba('0x80')]=function(_0x499ac3,_0x504e6a){var _0x5626a1=shared[_0xf3ba('0x81')];var _0x299fab=[];_['map'](_0x5626a1,function(_0x591fb1){_0x299fab['push']({'id':_0x591fb1[_0xf3ba('0x12')],'name':_0x591fb1[_0xf3ba('0x12')],'utcOffset':_0x591fb1['utcOffset']});});return _0x504e6a[_0xf3ba('0x7')](0xc8)[_0xf3ba('0x8')]({'tz':_0x299fab});};exports[_0xf3ba('0x82')]=function(_0x3de094,_0x41eb6b){var _0x2cd284=shared[_0xf3ba('0x81')];var _0x3bc463={};if(!_[_0xf3ba('0x56')](_0x2cd284[_0x3de094['body']['id']]))_0x3bc463=_0x2cd284[_0x3de094[_0xf3ba('0x3d')]['id']];return _0x41eb6b[_0xf3ba('0x7')](0xc8)[_0xf3ba('0x8')](_0x3bc463);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 3c029f9..f12709e 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 _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x1e1b18,_0x5d471b){var _0x3da8f2=function(_0x51fe71){while(--_0x51fe71){_0x1e1b18['push'](_0x1e1b18['shift']());}};_0x3da8f2(++_0x5d471b);}(_0x2a07,0x74));var _0x72a0=function(_0x15c530,_0x489b22){_0x15c530=_0x15c530-0x0;var _0x3bd24f=_0x2a07[_0x15c530];return _0x3bd24f;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['priority','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xba34,0x119));var _0x4ba3=function(_0x4c59bb,_0x1f71b9){_0x4c59bb=_0x4c59bb-0x0;var _0x593907=_0xba34[_0x4c59bb];return _0x593907;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('CmHopper',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]},{'name':_0x4ba3('0xc'),'fields':[_0x4ba3('0xc')]},{'name':_0x4ba3('0xd'),'fields':[_0x4ba3('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 5da7163..f1b3db6 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 _0x66d4=['UserId','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','UPDATE','all','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','voicePause','CmList','List','NOW()','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','stringify','error','message','ShowCmHopper','find','info','catch','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','LOCK','Contact','keys','User','Agent','name','length'];(function(_0x579c47,_0x1fff47){var _0x1109e6=function(_0x1344a1){while(--_0x1344a1){_0x579c47['push'](_0x579c47['shift']());}};_0x1109e6(++_0x1fff47);}(_0x66d4,0x174));var _0x466d=function(_0x3b2be5,_0x9c01ae){_0x3b2be5=_0x3b2be5-0x0;var _0x14cd8=_0x66d4[_0x3b2be5];return _0x14cd8;};'use strict';var _=require(_0x466d('0x0'));var util=require(_0x466d('0x1'));var moment=require(_0x466d('0x2'));var BPromise=require(_0x466d('0x3'));var db=require(_0x466d('0x4'))['db'];var logger=require(_0x466d('0x5'))(_0x466d('0x6'));exports[_0x466d('0x7')]=function(_0x185a27){var _0x2b18b1=this;return new Promise(function(_0x3bfcde,_0x202212){return db[_0x466d('0x8')][_0x466d('0x9')]({'raw':_0x185a27[_0x466d('0xa')]?_0x185a27[_0x466d('0xa')][_0x466d('0xb')]===undefined?!![]:![]:!![],'where':_0x185a27[_0x466d('0xa')]?_0x185a27[_0x466d('0xa')][_0x466d('0xc')]||null:null,'attributes':_0x185a27[_0x466d('0xa')]?_0x185a27[_0x466d('0xa')][_0x466d('0xd')]||null:null,'limit':_0x185a27[_0x466d('0xa')]?_0x185a27[_0x466d('0xa')][_0x466d('0xe')]||null:null,'include':_0x185a27[_0x466d('0xa')]?_0x185a27[_0x466d('0xa')]['include']?_[_0x466d('0xf')](_0x185a27[_0x466d('0xa')]['include'],function(_0x422f76){return{'model':db[_0x422f76['model']],'as':_0x422f76['as'],'attributes':_0x422f76[_0x466d('0xd')],'include':_0x422f76[_0x466d('0x10')]?_[_0x466d('0xf')](_0x422f76['include'],function(_0x4127e8){return{'model':db[_0x4127e8[_0x466d('0x11')]],'as':_0x4127e8['as'],'attributes':_0x4127e8['attributes'],'include':_0x4127e8[_0x466d('0x10')]?_[_0x466d('0xf')](_0x4127e8[_0x466d('0x10')],function(_0x45ebbc){return{'model':db[_0x45ebbc[_0x466d('0x11')]],'as':_0x45ebbc['as'],'attributes':_0x45ebbc[_0x466d('0xd')]};}):[]};}):[]};}):[]:[]})[_0x466d('0x12')](function(_0x533f4d){logger['info'](_0x466d('0x7'),_0x185a27);logger[_0x466d('0x13')](_0x466d('0x7'),_0x185a27,JSON[_0x466d('0x14')](_0x533f4d));_0x3bfcde(_0x533f4d);})['catch'](function(_0x404a9b){logger[_0x466d('0x15')](_0x466d('0x7'),_0x404a9b['message'],_0x185a27);_0x202212(_0x2b18b1[_0x466d('0x15')](0x1f4,_0x404a9b[_0x466d('0x16')]));});});};exports[_0x466d('0x17')]=function(_0xd154bd){var _0x2a5956=this;return new Promise(function(_0x1eccfe,_0x85d997){return db['CmHopper'][_0x466d('0x18')]({'raw':_0xd154bd['options']?_0xd154bd[_0x466d('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0xd154bd[_0x466d('0xa')]?_0xd154bd[_0x466d('0xa')]['where']||null:null,'attributes':_0xd154bd[_0x466d('0xa')]?_0xd154bd[_0x466d('0xa')][_0x466d('0xd')]||null:null,'include':_0xd154bd[_0x466d('0xa')]?_0xd154bd[_0x466d('0xa')]['include']?_[_0x466d('0xf')](_0xd154bd[_0x466d('0xa')][_0x466d('0x10')],function(_0x46e20b){return{'model':db[_0x46e20b[_0x466d('0x11')]],'as':_0x46e20b['as'],'attributes':_0x46e20b['attributes'],'include':_0x46e20b[_0x466d('0x10')]?_['map'](_0x46e20b['include'],function(_0x2aa2dc){return{'model':db[_0x2aa2dc[_0x466d('0x11')]],'as':_0x2aa2dc['as'],'attributes':_0x2aa2dc[_0x466d('0xd')],'include':_0x2aa2dc['include']?_[_0x466d('0xf')](_0x2aa2dc[_0x466d('0x10')],function(_0x2db3dd){return{'model':db[_0x2db3dd[_0x466d('0x11')]],'as':_0x2db3dd['as'],'attributes':_0x2db3dd[_0x466d('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54fed9){logger[_0x466d('0x19')](_0x466d('0x17'),_0xd154bd);logger[_0x466d('0x13')](_0x466d('0x17'),_0xd154bd,JSON[_0x466d('0x14')](_0x54fed9));_0x1eccfe(_0x54fed9);})[_0x466d('0x1a')](function(_0x49ec8b){logger['error'](_0x466d('0x17'),_0x49ec8b[_0x466d('0x16')],_0xd154bd);_0x85d997(_0x2a5956[_0x466d('0x15')](0x1f4,_0x49ec8b['message']));});});};exports[_0x466d('0x1b')]=function(_0x36bcdf){var _0x3d8f84=this;return new Promise(function(_0x3b328c,_0x1beed5){return db[_0x466d('0x8')][_0x466d('0x1c')](_0x36bcdf[_0x466d('0x1d')],{'raw':_0x36bcdf[_0x466d('0xa')]?_0x36bcdf['options'][_0x466d('0xb')]===undefined?!![]:![]:!![]})['then'](function(_0x56041f){logger['info'](_0x466d('0x1b'),_0x36bcdf);logger[_0x466d('0x13')](_0x466d('0x1b'),_0x36bcdf,JSON[_0x466d('0x14')](_0x56041f));_0x3b328c(_0x56041f);})[_0x466d('0x1a')](function(_0x1c574a){logger[_0x466d('0x15')]('CreateCmHopper',_0x1c574a['message'],_0x36bcdf);_0x1beed5(_0x3d8f84[_0x466d('0x15')](0x1f4,_0x1c574a[_0x466d('0x16')]));});});};exports[_0x466d('0x1e')]=function(_0x34e060){var _0x354fbc=this;return new Promise(function(_0x5106b8,_0x60e247){return db[_0x466d('0x8')][_0x466d('0x1f')](_0x34e060[_0x466d('0x1d')],{'raw':_0x34e060[_0x466d('0xa')]?_0x34e060[_0x466d('0xa')][_0x466d('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34e060[_0x466d('0xa')]?_0x34e060[_0x466d('0xa')][_0x466d('0xc')]||null:null,'attributes':_0x34e060[_0x466d('0xa')]?_0x34e060[_0x466d('0xa')][_0x466d('0xd')]||null:null,'limit':_0x34e060[_0x466d('0xa')]?_0x34e060[_0x466d('0xa')][_0x466d('0xe')]||null:null})[_0x466d('0x12')](function(_0x59bb83){logger[_0x466d('0x19')](_0x466d('0x1e'),_0x34e060);logger[_0x466d('0x19')](_0x466d('0x20'),JSON[_0x466d('0x14')](_0x34e060[_0x466d('0xa')][_0x466d('0xc')]),_0x34e060['body'][_0x466d('0x21')]);logger[_0x466d('0x13')]('UpdateCmHopper',_0x34e060,JSON[_0x466d('0x14')](_0x59bb83));_0x5106b8(_0x59bb83);})[_0x466d('0x1a')](function(_0x59b5dc){logger['error'](_0x466d('0x1e'),_0x59b5dc[_0x466d('0x16')],_0x34e060);_0x60e247(_0x354fbc[_0x466d('0x15')](0x1f4,_0x59b5dc[_0x466d('0x16')]));});});};exports[_0x466d('0x22')]=function(_0xc8b055){var _0x574000=this;return new Promise(function(_0x3490dd,_0x55868f){return db[_0x466d('0x8')][_0x466d('0x23')]({'where':_0xc8b055['options']?_0xc8b055[_0x466d('0xa')]['where']||null:null})[_0x466d('0x12')](function(_0x11ce5c){logger[_0x466d('0x19')](_0x466d('0x22'),_0xc8b055);logger[_0x466d('0x13')](_0x466d('0x22'),_0xc8b055,JSON[_0x466d('0x14')](_0x11ce5c));_0x3490dd(_0x11ce5c);})[_0x466d('0x1a')](function(_0x479144){logger['error'](_0x466d('0x22'),_0x479144[_0x466d('0x16')],_0xc8b055);_0x55868f(_0x574000['error'](0x1f4,_0x479144[_0x466d('0x16')]));});});};exports[_0x466d('0x24')]=function(_0x21971f){var _0x1f72be=this;return new Promise(function(_0x2eab49,_0x38db20){return db[_0x466d('0x25')][_0x466d('0x26')]()['then'](function(_0x528368){return db['sequelize'][_0x466d('0x27')](function(_0x2b70c2){return db[_0x466d('0x8')][_0x466d('0x9')]({'where':_0x21971f[_0x466d('0xa')]?_0x21971f[_0x466d('0xa')][_0x466d('0xc')]||null:null,'attributes':_0x21971f['options']?_0x21971f[_0x466d('0xa')][_0x466d('0xd')]||null:null,'limit':_0x21971f['options']?_0x21971f[_0x466d('0xa')][_0x466d('0xe')]||null:null,'order':_0x21971f[_0x466d('0xa')]?_0x21971f[_0x466d('0xa')][_0x466d('0x28')]||null:null,'transaction':_0x2b70c2,'lock':_0x2b70c2[_0x466d('0x29')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x466d('0x2a'),'attributes':_[_0x466d('0x2b')](_0x528368)},{'model':db[_0x466d('0x2c')],'as':_0x466d('0x2d'),'attributes':['id',_0x466d('0x2e'),'voicePause']}]})[_0x466d('0x12')](function(_0x3d811f){var _0x43fb3e=[];var _0x23b9f8=[];for(var _0x39aca6=0x0;_0x39aca6<_0x3d811f[_0x466d('0x2f')];_0x39aca6+=0x1){var _0x548694=_0x3d811f[_0x39aca6][_0x466d('0x30')];if(_0x548694===null){_0x43fb3e[_0x466d('0x31')](_0x3d811f[_0x39aca6][_0x466d('0x1f')](_0x21971f[_0x466d('0x1d')],{'transaction':_0x2b70c2}));}else if(!_0x23b9f8[_0x466d('0x32')](_0x548694)){_0x23b9f8[_0x466d('0x31')](_0x548694);_0x43fb3e[_0x466d('0x31')](_0x3d811f[_0x39aca6][_0x466d('0x1f')](_0x21971f[_0x466d('0x1d')],{'transaction':_0x2b70c2}));}}return BPromise['all'](_0x43fb3e);});})[_0x466d('0x12')](function(_0x14f2ca){logger[_0x466d('0x19')](_0x466d('0x24'),_0x21971f);if(_0x14f2ca[_0x466d('0x2f')]>0x0){logger['info'](_0x466d('0x33'),_0x14f2ca[0x0][_0x466d('0x34')]['id'],_0x14f2ca[0x0]['dataValues'][_0x466d('0x35')],_0x14f2ca[0x0]['dataValues'][_0x466d('0x21')]);}logger[_0x466d('0x13')](_0x466d('0x24'),_0x21971f,JSON[_0x466d('0x14')](_0x14f2ca));_0x2eab49(_0x14f2ca);})[_0x466d('0x1a')](function(_0x4c8b51){logger[_0x466d('0x15')](_0x466d('0x24'),_0x4c8b51[_0x466d('0x16')],_0x21971f);_0x38db20(_0x1f72be[_0x466d('0x15')](0x1f4,_0x4c8b51[_0x466d('0x16')]));});});});};exports[_0x466d('0x36')]=function(_0x16bc01){var _0x118cd0=this;return new Promise(function(_0x48f3f5,_0x48c7ea){return db[_0x466d('0x37')]['transaction'](function(_0x53a47e){return db[_0x466d('0x38')][_0x466d('0x1c')](_0x16bc01[_0x466d('0x1d')],{'raw':_0x16bc01['options']?_0x16bc01[_0x466d('0xa')]['raw']===undefined?!![]:![]:!![],'transaction':_0x53a47e})['then'](function(){logger[_0x466d('0x19')](_0x466d('0x39'),JSON['stringify'](_0x16bc01['options'][_0x466d('0xc')]),_0x16bc01[_0x466d('0xa')]['where'][_0x466d('0x21')]);return db[_0x466d('0x8')][_0x466d('0x23')]({'where':_0x16bc01['options']?_0x16bc01[_0x466d('0xa')][_0x466d('0xc')]||null:null,'transaction':_0x53a47e});});})[_0x466d('0x12')](function(_0x3fa04d){logger['info'](_0x466d('0x36'),_0x16bc01);logger[_0x466d('0x13')](_0x466d('0x36'),_0x16bc01,JSON[_0x466d('0x14')](_0x3fa04d));_0x48f3f5(_0x3fa04d);})[_0x466d('0x1a')](function(_0xb5c779){logger['error'](_0x466d('0x36'),_0xb5c779['message'],_0x16bc01);_0x48c7ea(_0x118cd0[_0x466d('0x15')](0x1f4,_0xb5c779[_0x466d('0x16')]));});});};exports[_0x466d('0x3a')]=function(_0xebe0a1){var _0x3906a4=this;return new Promise(function(_0x29f54d,_0x30ddef){return db[_0x466d('0x8')][_0x466d('0x9')]({'raw':_0xebe0a1[_0x466d('0xa')]?_0xebe0a1[_0x466d('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0xebe0a1[_0x466d('0xa')]?_0xebe0a1[_0x466d('0xa')][_0x466d('0xc')]||null:null,'attributes':[[db[_0x466d('0x37')]['fn'](_0x466d('0x3b'),db[_0x466d('0x37')]['fn']('IF',db[_0x466d('0x37')]['literal'](_0x466d('0x3c')+util['format'](_0x466d('0x3d'),moment()[_0x466d('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x466d('0x3f')))),_0x466d('0x40')]]})[_0x466d('0x12')](function(_0x3cb2ef){logger['info'](_0x466d('0x3a'),_0xebe0a1);logger[_0x466d('0x13')](_0x466d('0x3a'),_0xebe0a1,JSON[_0x466d('0x14')](_0x3cb2ef));_0x29f54d(_0x3cb2ef);})['catch'](function(_0x3c537a){logger['error'](_0x466d('0x3a'),_0x3c537a[_0x466d('0x16')],_0xebe0a1);_0x30ddef(_0x3906a4[_0x466d('0x15')](0x1f4,_0x3c537a['message']));});});};exports['GetContactRecallMe']=function(_0x7d7afc){var _0x4ce924=this;return new Promise(function(_0x1cbff7,_0x19848c){return db[_0x466d('0x25')][_0x466d('0x26')]()[_0x466d('0x12')](function(){return db[_0x466d('0x37')]['transaction'](function(_0x308a84){return db[_0x466d('0x8')][_0x466d('0x9')]({'where':_0x7d7afc['options']?_0x7d7afc[_0x466d('0xa')][_0x466d('0xc')]||null:null,'attributes':_0x7d7afc[_0x466d('0xa')]?_0x7d7afc[_0x466d('0xa')][_0x466d('0xd')]||null:null,'limit':0x1,'order':_0x7d7afc['options']?_0x7d7afc[_0x466d('0xa')][_0x466d('0x28')]||null:null,'group':db[_0x466d('0x8')]['UserId'],'transaction':_0x308a84,'lock':_0x308a84[_0x466d('0x29')][_0x466d('0x41')],'include':_0x7d7afc[_0x466d('0xa')]?_0x7d7afc[_0x466d('0xa')]['include']?_[_0x466d('0xf')](_0x7d7afc[_0x466d('0xa')][_0x466d('0x10')],function(_0x20dabb){return{'model':db[_0x20dabb[_0x466d('0x11')]],'as':_0x20dabb['as'],'attributes':_0x20dabb['attributes'],'include':_0x20dabb[_0x466d('0x10')]?_[_0x466d('0xf')](_0x20dabb[_0x466d('0x10')],function(_0x2b0c10){return{'model':db[_0x2b0c10[_0x466d('0x11')]],'as':_0x2b0c10['as'],'attributes':_0x2b0c10['attributes'],'include':_0x2b0c10[_0x466d('0x10')]?_[_0x466d('0xf')](_0x2b0c10[_0x466d('0x10')],function(_0x2bd609){return{'model':db[_0x2bd609[_0x466d('0x11')]],'as':_0x2bd609['as'],'attributes':_0x2bd609['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2440b5){var _0x1d08aa=[];for(var _0x540f7d=0x0;_0x540f7d<_0x2440b5[_0x466d('0x2f')];_0x540f7d+=0x1){_0x1d08aa[_0x466d('0x31')](_0x2440b5[_0x540f7d][_0x466d('0x1f')](_0x7d7afc['body'],{'transaction':_0x308a84}));}return BPromise[_0x466d('0x42')](_0x1d08aa);});})[_0x466d('0x12')](function(_0x3ba35a){logger[_0x466d('0x19')]('GetContactRecallMe',_0x7d7afc);logger[_0x466d('0x13')](_0x466d('0x43'),_0x7d7afc,JSON['stringify'](_0x3ba35a));_0x1cbff7(_0x3ba35a);})['catch'](function(_0x136b28){logger['error'](_0x466d('0x43'),_0x136b28[_0x466d('0x16')],_0x7d7afc);_0x19848c(_0x4ce924[_0x466d('0x15')](0x1f4,_0x136b28['message']));});});});};exports[_0x466d('0x44')]=function(_0x219450){var _0x4900dd=this;return new Promise(function(_0x19ae6f,_0x3a1fb6){db[_0x466d('0x25')][_0x466d('0x26')]()[_0x466d('0x12')](function(_0x3f8874){return db[_0x466d('0x8')][_0x466d('0x9')]({'raw':_0x219450[_0x466d('0xa')]?_0x219450['options']['raw']===undefined?!![]:![]:!![],'where':_0x219450['options']?_0x219450['options'][_0x466d('0xc')]||null:null,'attributes':_0x219450[_0x466d('0xa')]?_0x219450[_0x466d('0xa')][_0x466d('0xd')]||null:null,'limit':_0x219450[_0x466d('0xa')]?_0x219450[_0x466d('0xa')][_0x466d('0xe')]||null:null,'include':_0x219450[_0x466d('0xa')]?_0x219450[_0x466d('0xa')][_0x466d('0x10')]?_[_0x466d('0xf')](_0x219450[_0x466d('0xa')][_0x466d('0x10')],function(_0x5d378c){return{'model':db[_0x5d378c[_0x466d('0x11')]],'as':_0x5d378c['as'],'attributes':_0x5d378c['as']===_0x466d('0x2a')?_[_0x466d('0x2b')](_0x3f8874):_0x5d378c['attributes'],'include':_0x5d378c[_0x466d('0x10')]?_[_0x466d('0xf')](_0x5d378c[_0x466d('0x10')],function(_0xdb4109){return{'model':db[_0xdb4109[_0x466d('0x11')]],'as':_0xdb4109['as'],'attributes':_0xdb4109[_0x466d('0xd')],'include':_0xdb4109[_0x466d('0x10')]?_['map'](_0xdb4109['include'],function(_0x314f75){return{'model':db[_0x314f75['model']],'as':_0x314f75['as'],'attributes':_0x314f75[_0x466d('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48f03c){logger[_0x466d('0x19')](_0x466d('0x7'),_0x219450);logger[_0x466d('0x13')](_0x466d('0x7'),_0x219450,JSON[_0x466d('0x14')](_0x48f03c));_0x19ae6f(_0x48f03c);})[_0x466d('0x1a')](function(_0x48ee23){logger[_0x466d('0x15')](_0x466d('0x7'),_0x48ee23['message'],_0x219450);_0x3a1fb6(_0x4900dd[_0x466d('0x15')](0x1f4,_0x48ee23['message']));});});});};exports[_0x466d('0x45')]=function(_0x22df9a){var _0x2771d3=this;return new Promise(function(_0x3e8c83,_0x2b0f1b){return db[_0x466d('0x25')][_0x466d('0x46')]({'raw':!![],'where':{'phone':_0x22df9a['options'][_0x466d('0xc')]['phone']},'attributes':['id',_0x466d('0x47')],'order':[['id',_0x466d('0x48')]]})[_0x466d('0x12')](function(_0x105428){logger[_0x466d('0x19')]('getContactByPhone',_0x22df9a);logger[_0x466d('0x13')](_0x466d('0x49'),_0x22df9a,JSON[_0x466d('0x14')](_0x105428));_0x3e8c83(_0x105428);})['catch'](function(_0x256da3){logger[_0x466d('0x15')](_0x466d('0x49'),_0x256da3[_0x466d('0x16')],_0x22df9a);_0x2b0f1b(_0x2771d3['error'](0x1f4,_0x256da3['message']));});});};exports['ResetActiveCalls']=function(_0x47227f){var _0x28374d=this;return new Promise(function(_0x59a345,_0x9005f8){return db[_0x466d('0x37')]['transaction'](function(_0xa7cca0){var _0x2798ec=_0x47227f[_0x466d('0xa')]&&_0x47227f[_0x466d('0xa')][_0x466d('0xc')]?_0x47227f[_0x466d('0xa')][_0x466d('0xc')]:{};return db[_0x466d('0x8')][_0x466d('0x1f')](_0x47227f[_0x466d('0x1d')],{'where':_0x2798ec,'transaction':_0xa7cca0})[_0x466d('0x12')](function(_0x42e325){logger[_0x466d('0x19')](_0x466d('0x4a'),_0x47227f);logger[_0x466d('0x13')](_0x466d('0x4a'),_0x47227f,JSON[_0x466d('0x14')](_0x42e325));_0x59a345(_0x42e325);})[_0x466d('0x1a')](function(_0x48e49b){logger[_0x466d('0x15')]('ResetActiveCalls',_0x48e49b['message'],_0x47227f);_0x9005f8(_0x28374d[_0x466d('0x15')](0x1f4,_0x48e49b[_0x466d('0x16')]));});});});};exports[_0x466d('0x4b')]=function(_0x3e7f1d){var _0x5212a3=this;var _0x4a9094=_0x3e7f1d[_0x466d('0x1d')]['where'][_0x466d('0x4c')];var _0x48dd61=_0x3e7f1d[_0x466d('0x1d')]['where'][_0x466d('0x4d')];var _0x106eb9=_0x3e7f1d[_0x466d('0x1d')][_0x466d('0xc')]['availableAgentsIds'];return new Promise(function(_0x23dc8e,_0xfdfb40){return db[_0x466d('0x8')][_0x466d('0x9')]({'where':{'voiceQueueId':{'$in':_0x4a9094},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x466d('0x37')]['literal'](_0x466d('0x4e')+_0x48dd61+_0x466d('0x4f')),'$gt':db['sequelize']['literal']('NOW()')}},'UserId':{'$in':_0x106eb9}},'include':[{'model':db[_0x466d('0x25')],'as':'Contact'},{'model':db[_0x466d('0x2c')],'as':'Agent','attributes':['id','name',_0x466d('0x50')]},{'model':db[_0x466d('0x51')],'as':_0x466d('0x52')}]})['then'](function(_0x9bec92){if(_0x9bec92['length']>0x0){return db[_0x466d('0x37')][_0x466d('0x27')](function(_0x5f2fa9){return db[_0x466d('0x8')]['update']({'recallmeNotifiedDate':db[_0x466d('0x37')]['literal'](_0x466d('0x53'))},{'where':{'id':{'$in':_['map'](_0x9bec92,'id')}},'transaction':_0x5f2fa9})[_0x466d('0x12')](function(){_0x23dc8e(_0x9bec92);})[_0x466d('0x1a')](function(_0x510b0d){logger[_0x466d('0x15')]('CmHopperHandlePreviewRecallNotifications',_0x510b0d[_0x466d('0x16')],_0x3e7f1d);_0xfdfb40(_0x5212a3[_0x466d('0x15')](0x1f4,_0x510b0d[_0x466d('0x16')]));});})['catch'](function(_0x1bd7c2){logger[_0x466d('0x15')](_0x466d('0x4b'),_0x1bd7c2['message'],_0x3e7f1d);_0xfdfb40(_0x5212a3[_0x466d('0x15')](0x1f4,_0x1bd7c2['message']));});}else{_0x23dc8e(_0x9bec92);}});});}; \ No newline at end of file +var _0xd41a=['CountReScheduled','COUNT','literal','\x22%s\x22','format','\x20,\x201,\x20null','order','GetContactRecallMe','keys','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','NOW()','lodash','util','bluebird','../../config/logger','rpc','CmHopper','findAll','options','raw','where','attributes','include','model','map','then','info','GetCmHopper','debug','stringify','error','message','ShowCmHopper','CreateCmHopper','catch','UpdateCmHopper','limit','body','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','LOCK','UPDATE','Contact','User','Agent','name','voicePause','UserId','push','update','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]'];(function(_0x196776,_0x698086){var _0x232e39=function(_0xb3215c){while(--_0xb3215c){_0x196776['push'](_0x196776['shift']());}};_0x232e39(++_0x698086);}(_0xd41a,0x18e));var _0xad41=function(_0x3ddd29,_0x26f096){_0x3ddd29=_0x3ddd29-0x0;var _0x34cb20=_0xd41a[_0x3ddd29];return _0x34cb20;};'use strict';var _=require(_0xad41('0x0'));var util=require(_0xad41('0x1'));var moment=require('moment');var BPromise=require(_0xad41('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xad41('0x3'))(_0xad41('0x4'));exports['GetCmHopper']=function(_0x21d980){var _0x15eb91=this;return new Promise(function(_0x2876f7,_0x17d490){return db[_0xad41('0x5')][_0xad41('0x6')]({'raw':_0x21d980[_0xad41('0x7')]?_0x21d980[_0xad41('0x7')][_0xad41('0x8')]===undefined?!![]:![]:!![],'where':_0x21d980['options']?_0x21d980[_0xad41('0x7')][_0xad41('0x9')]||null:null,'attributes':_0x21d980['options']?_0x21d980[_0xad41('0x7')][_0xad41('0xa')]||null:null,'limit':_0x21d980[_0xad41('0x7')]?_0x21d980['options']['limit']||null:null,'include':_0x21d980[_0xad41('0x7')]?_0x21d980['options'][_0xad41('0xb')]?_['map'](_0x21d980['options'][_0xad41('0xb')],function(_0x52c701){return{'model':db[_0x52c701[_0xad41('0xc')]],'as':_0x52c701['as'],'attributes':_0x52c701[_0xad41('0xa')],'include':_0x52c701['include']?_[_0xad41('0xd')](_0x52c701[_0xad41('0xb')],function(_0x32c401){return{'model':db[_0x32c401[_0xad41('0xc')]],'as':_0x32c401['as'],'attributes':_0x32c401[_0xad41('0xa')],'include':_0x32c401[_0xad41('0xb')]?_[_0xad41('0xd')](_0x32c401['include'],function(_0x58c6fe){return{'model':db[_0x58c6fe[_0xad41('0xc')]],'as':_0x58c6fe['as'],'attributes':_0x58c6fe[_0xad41('0xa')]};}):[]};}):[]};}):[]:[]})[_0xad41('0xe')](function(_0x284101){logger[_0xad41('0xf')](_0xad41('0x10'),_0x21d980);logger[_0xad41('0x11')](_0xad41('0x10'),_0x21d980,JSON[_0xad41('0x12')](_0x284101));_0x2876f7(_0x284101);})['catch'](function(_0x30407c){logger[_0xad41('0x13')](_0xad41('0x10'),_0x30407c['message'],_0x21d980);_0x17d490(_0x15eb91[_0xad41('0x13')](0x1f4,_0x30407c[_0xad41('0x14')]));});});};exports[_0xad41('0x15')]=function(_0x4f5052){var _0x2354c2=this;return new Promise(function(_0x56e750,_0x49a22c){return db[_0xad41('0x5')]['find']({'raw':_0x4f5052[_0xad41('0x7')]?_0x4f5052[_0xad41('0x7')][_0xad41('0x8')]===undefined?!![]:![]:!![],'where':_0x4f5052[_0xad41('0x7')]?_0x4f5052[_0xad41('0x7')]['where']||null:null,'attributes':_0x4f5052[_0xad41('0x7')]?_0x4f5052[_0xad41('0x7')]['attributes']||null:null,'include':_0x4f5052[_0xad41('0x7')]?_0x4f5052['options'][_0xad41('0xb')]?_['map'](_0x4f5052[_0xad41('0x7')]['include'],function(_0x5f00ee){return{'model':db[_0x5f00ee[_0xad41('0xc')]],'as':_0x5f00ee['as'],'attributes':_0x5f00ee[_0xad41('0xa')],'include':_0x5f00ee['include']?_[_0xad41('0xd')](_0x5f00ee[_0xad41('0xb')],function(_0xba94ab){return{'model':db[_0xba94ab['model']],'as':_0xba94ab['as'],'attributes':_0xba94ab[_0xad41('0xa')],'include':_0xba94ab[_0xad41('0xb')]?_[_0xad41('0xd')](_0xba94ab['include'],function(_0x4ac070){return{'model':db[_0x4ac070['model']],'as':_0x4ac070['as'],'attributes':_0x4ac070['attributes']};}):[]};}):[]};}):[]:[]})[_0xad41('0xe')](function(_0x4785b3){logger['info'](_0xad41('0x15'),_0x4f5052);logger['debug'](_0xad41('0x15'),_0x4f5052,JSON['stringify'](_0x4785b3));_0x56e750(_0x4785b3);})['catch'](function(_0x3191f2){logger[_0xad41('0x13')](_0xad41('0x15'),_0x3191f2['message'],_0x4f5052);_0x49a22c(_0x2354c2[_0xad41('0x13')](0x1f4,_0x3191f2[_0xad41('0x14')]));});});};exports[_0xad41('0x16')]=function(_0x218910){var _0x25e7a8=this;return new Promise(function(_0x2ba97a,_0x3e32ce){return db[_0xad41('0x5')]['create'](_0x218910['body'],{'raw':_0x218910[_0xad41('0x7')]?_0x218910[_0xad41('0x7')]['raw']===undefined?!![]:![]:!![]})[_0xad41('0xe')](function(_0x11c478){logger[_0xad41('0xf')](_0xad41('0x16'),_0x218910);logger[_0xad41('0x11')](_0xad41('0x16'),_0x218910,JSON[_0xad41('0x12')](_0x11c478));_0x2ba97a(_0x11c478);})[_0xad41('0x17')](function(_0x281519){logger[_0xad41('0x13')](_0xad41('0x16'),_0x281519['message'],_0x218910);_0x3e32ce(_0x25e7a8[_0xad41('0x13')](0x1f4,_0x281519[_0xad41('0x14')]));});});};exports[_0xad41('0x18')]=function(_0x48f6f9){var _0xcf0fff=this;return new Promise(function(_0x23f382,_0x4e28a0){return db[_0xad41('0x5')]['update'](_0x48f6f9['body'],{'raw':_0x48f6f9[_0xad41('0x7')]?_0x48f6f9[_0xad41('0x7')][_0xad41('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48f6f9[_0xad41('0x7')]?_0x48f6f9['options'][_0xad41('0x9')]||null:null,'attributes':_0x48f6f9[_0xad41('0x7')]?_0x48f6f9[_0xad41('0x7')]['attributes']||null:null,'limit':_0x48f6f9[_0xad41('0x7')]?_0x48f6f9['options'][_0xad41('0x19')]||null:null})[_0xad41('0xe')](function(_0xb6808){logger['info'](_0xad41('0x18'),_0x48f6f9);logger[_0xad41('0xf')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xad41('0x12')](_0x48f6f9[_0xad41('0x7')][_0xad41('0x9')]),_0x48f6f9[_0xad41('0x1a')][_0xad41('0x1b')]);logger[_0xad41('0x11')](_0xad41('0x18'),_0x48f6f9,JSON[_0xad41('0x12')](_0xb6808));_0x23f382(_0xb6808);})[_0xad41('0x17')](function(_0x5455f2){logger[_0xad41('0x13')](_0xad41('0x18'),_0x5455f2[_0xad41('0x14')],_0x48f6f9);_0x4e28a0(_0xcf0fff['error'](0x1f4,_0x5455f2[_0xad41('0x14')]));});});};exports[_0xad41('0x1c')]=function(_0x4df6e0){var _0x55543c=this;return new Promise(function(_0xa9dfb9,_0xb76c6c){return db[_0xad41('0x5')][_0xad41('0x1d')]({'where':_0x4df6e0[_0xad41('0x7')]?_0x4df6e0[_0xad41('0x7')][_0xad41('0x9')]||null:null})['then'](function(_0x38f5ec){logger[_0xad41('0xf')](_0xad41('0x1c'),_0x4df6e0);logger[_0xad41('0x11')](_0xad41('0x1c'),_0x4df6e0,JSON['stringify'](_0x38f5ec));_0xa9dfb9(_0x38f5ec);})[_0xad41('0x17')](function(_0x3ae65a){logger['error'](_0xad41('0x1c'),_0x3ae65a[_0xad41('0x14')],_0x4df6e0);_0xb76c6c(_0x55543c[_0xad41('0x13')](0x1f4,_0x3ae65a[_0xad41('0x14')]));});});};exports[_0xad41('0x1e')]=function(_0x235a73){var _0x2bb3b8=this;return new Promise(function(_0x2c5522,_0x1d33bf){return db[_0xad41('0x1f')][_0xad41('0x20')]()['then'](function(_0x246366){return db['sequelize'][_0xad41('0x21')](function(_0x2e5758){return db[_0xad41('0x5')][_0xad41('0x6')]({'where':_0x235a73[_0xad41('0x7')]?_0x235a73[_0xad41('0x7')][_0xad41('0x9')]||null:null,'attributes':_0x235a73[_0xad41('0x7')]?_0x235a73[_0xad41('0x7')][_0xad41('0xa')]||null:null,'limit':_0x235a73[_0xad41('0x7')]?_0x235a73['options'][_0xad41('0x19')]||null:null,'order':_0x235a73[_0xad41('0x7')]?_0x235a73[_0xad41('0x7')]['order']||null:null,'transaction':_0x2e5758,'lock':_0x2e5758[_0xad41('0x22')][_0xad41('0x23')],'include':[{'model':db[_0xad41('0x1f')],'as':_0xad41('0x24'),'attributes':_['keys'](_0x246366)},{'model':db[_0xad41('0x25')],'as':_0xad41('0x26'),'attributes':['id',_0xad41('0x27'),_0xad41('0x28')]}]})[_0xad41('0xe')](function(_0x530b71){var _0x2e112a=[];var _0xa95044=[];for(var _0x1078bc=0x0;_0x1078bc<_0x530b71['length'];_0x1078bc+=0x1){var _0x37ba46=_0x530b71[_0x1078bc][_0xad41('0x29')];if(_0x37ba46===null){_0x2e112a[_0xad41('0x2a')](_0x530b71[_0x1078bc][_0xad41('0x2b')](_0x235a73[_0xad41('0x1a')],{'transaction':_0x2e5758}));}else if(!_0xa95044['includes'](_0x37ba46)){_0xa95044[_0xad41('0x2a')](_0x37ba46);_0x2e112a[_0xad41('0x2a')](_0x530b71[_0x1078bc][_0xad41('0x2b')](_0x235a73[_0xad41('0x1a')],{'transaction':_0x2e5758}));}}return BPromise['all'](_0x2e112a);});})[_0xad41('0xe')](function(_0x30eecd){logger[_0xad41('0xf')]('GetContactDialer',_0x235a73);if(_0x30eecd[_0xad41('0x2c')]>0x0){logger[_0xad41('0xf')](_0xad41('0x2d'),_0x30eecd[0x0][_0xad41('0x2e')]['id'],_0x30eecd[0x0][_0xad41('0x2e')][_0xad41('0x2f')],_0x30eecd[0x0][_0xad41('0x2e')][_0xad41('0x1b')]);}logger[_0xad41('0x11')](_0xad41('0x1e'),_0x235a73,JSON[_0xad41('0x12')](_0x30eecd));_0x2c5522(_0x30eecd);})[_0xad41('0x17')](function(_0x2039d4){logger['error'](_0xad41('0x1e'),_0x2039d4[_0xad41('0x14')],_0x235a73);_0x1d33bf(_0x2bb3b8[_0xad41('0x13')](0x1f4,_0x2039d4[_0xad41('0x14')]));});});});};exports[_0xad41('0x30')]=function(_0x5f2644){var _0x2000c1=this;return new Promise(function(_0x2f36f2,_0x325008){return db[_0xad41('0x31')][_0xad41('0x21')](function(_0x42b4ae){return db[_0xad41('0x32')]['create'](_0x5f2644['body'],{'raw':_0x5f2644[_0xad41('0x7')]?_0x5f2644['options'][_0xad41('0x8')]===undefined?!![]:![]:!![],'transaction':_0x42b4ae})[_0xad41('0xe')](function(){logger[_0xad41('0xf')](_0xad41('0x33'),JSON['stringify'](_0x5f2644[_0xad41('0x7')][_0xad41('0x9')]),_0x5f2644[_0xad41('0x7')][_0xad41('0x9')][_0xad41('0x1b')]);return db[_0xad41('0x5')][_0xad41('0x1d')]({'where':_0x5f2644[_0xad41('0x7')]?_0x5f2644[_0xad41('0x7')][_0xad41('0x9')]||null:null,'transaction':_0x42b4ae});});})[_0xad41('0xe')](function(_0x11765e){logger[_0xad41('0xf')](_0xad41('0x30'),_0x5f2644);logger[_0xad41('0x11')](_0xad41('0x30'),_0x5f2644,JSON[_0xad41('0x12')](_0x11765e));_0x2f36f2(_0x11765e);})[_0xad41('0x17')](function(_0x20c30d){logger[_0xad41('0x13')](_0xad41('0x30'),_0x20c30d[_0xad41('0x14')],_0x5f2644);_0x325008(_0x2000c1[_0xad41('0x13')](0x1f4,_0x20c30d['message']));});});};exports[_0xad41('0x34')]=function(_0x5d3ea3){var _0x565ce4=this;return new Promise(function(_0x177471,_0x36e2e3){return db[_0xad41('0x5')][_0xad41('0x6')]({'raw':_0x5d3ea3[_0xad41('0x7')]?_0x5d3ea3[_0xad41('0x7')][_0xad41('0x8')]===undefined?!![]:![]:!![],'where':_0x5d3ea3[_0xad41('0x7')]?_0x5d3ea3['options'][_0xad41('0x9')]||null:null,'attributes':[[db[_0xad41('0x31')]['fn'](_0xad41('0x35'),db[_0xad41('0x31')]['fn']('IF',db[_0xad41('0x31')][_0xad41('0x36')]('`scheduledat`\x20>=\x20'+util['format'](_0xad41('0x37'),moment()[_0xad41('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xad41('0x39')))),'contactsRescheduled']]})[_0xad41('0xe')](function(_0x12281a){logger['info'](_0xad41('0x34'),_0x5d3ea3);logger['debug'](_0xad41('0x34'),_0x5d3ea3,JSON[_0xad41('0x12')](_0x12281a));_0x177471(_0x12281a);})[_0xad41('0x17')](function(_0x30d0d2){logger[_0xad41('0x13')](_0xad41('0x34'),_0x30d0d2[_0xad41('0x14')],_0x5d3ea3);_0x36e2e3(_0x565ce4[_0xad41('0x13')](0x1f4,_0x30d0d2[_0xad41('0x14')]));});});};exports['GetContactRecallMe']=function(_0x4647d7){var _0x31aa14=this;return new Promise(function(_0x4da79e,_0x26da70){return db['CmContact'][_0xad41('0x20')]()[_0xad41('0xe')](function(){return db['sequelize'][_0xad41('0x21')](function(_0x4b44cb){return db[_0xad41('0x5')][_0xad41('0x6')]({'where':_0x4647d7[_0xad41('0x7')]?_0x4647d7[_0xad41('0x7')]['where']||null:null,'attributes':_0x4647d7[_0xad41('0x7')]?_0x4647d7[_0xad41('0x7')][_0xad41('0xa')]||null:null,'limit':0x1,'order':_0x4647d7[_0xad41('0x7')]?_0x4647d7[_0xad41('0x7')][_0xad41('0x3a')]||null:null,'group':db['CmHopper'][_0xad41('0x29')],'transaction':_0x4b44cb,'lock':_0x4b44cb['LOCK'][_0xad41('0x23')],'include':_0x4647d7['options']?_0x4647d7['options']['include']?_[_0xad41('0xd')](_0x4647d7['options'][_0xad41('0xb')],function(_0x5bae59){return{'model':db[_0x5bae59['model']],'as':_0x5bae59['as'],'attributes':_0x5bae59[_0xad41('0xa')],'include':_0x5bae59[_0xad41('0xb')]?_[_0xad41('0xd')](_0x5bae59[_0xad41('0xb')],function(_0x30fc81){return{'model':db[_0x30fc81[_0xad41('0xc')]],'as':_0x30fc81['as'],'attributes':_0x30fc81[_0xad41('0xa')],'include':_0x30fc81[_0xad41('0xb')]?_[_0xad41('0xd')](_0x30fc81['include'],function(_0x12d15b){return{'model':db[_0x12d15b[_0xad41('0xc')]],'as':_0x12d15b['as'],'attributes':_0x12d15b[_0xad41('0xa')]};}):[]};}):[]};}):[]:[]})[_0xad41('0xe')](function(_0x35a08e){var _0x5e2fc5=[];for(var _0xfd9393=0x0;_0xfd9393<_0x35a08e['length'];_0xfd9393+=0x1){_0x5e2fc5[_0xad41('0x2a')](_0x35a08e[_0xfd9393][_0xad41('0x2b')](_0x4647d7[_0xad41('0x1a')],{'transaction':_0x4b44cb}));}return BPromise['all'](_0x5e2fc5);});})['then'](function(_0x21a669){logger[_0xad41('0xf')](_0xad41('0x3b'),_0x4647d7);logger[_0xad41('0x11')]('GetContactRecallMe',_0x4647d7,JSON['stringify'](_0x21a669));_0x4da79e(_0x21a669);})[_0xad41('0x17')](function(_0x5e1e71){logger[_0xad41('0x13')]('GetContactRecallMe',_0x5e1e71[_0xad41('0x14')],_0x4647d7);_0x26da70(_0x31aa14[_0xad41('0x13')](0x1f4,_0x5e1e71[_0xad41('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x5049ff){var _0x482862=this;return new Promise(function(_0x7d85e,_0x8d3667){db['CmContact'][_0xad41('0x20')]()[_0xad41('0xe')](function(_0x1b78b1){return db[_0xad41('0x5')][_0xad41('0x6')]({'raw':_0x5049ff[_0xad41('0x7')]?_0x5049ff[_0xad41('0x7')][_0xad41('0x8')]===undefined?!![]:![]:!![],'where':_0x5049ff[_0xad41('0x7')]?_0x5049ff[_0xad41('0x7')][_0xad41('0x9')]||null:null,'attributes':_0x5049ff[_0xad41('0x7')]?_0x5049ff[_0xad41('0x7')][_0xad41('0xa')]||null:null,'limit':_0x5049ff['options']?_0x5049ff[_0xad41('0x7')]['limit']||null:null,'include':_0x5049ff[_0xad41('0x7')]?_0x5049ff[_0xad41('0x7')][_0xad41('0xb')]?_['map'](_0x5049ff[_0xad41('0x7')][_0xad41('0xb')],function(_0xe21b00){return{'model':db[_0xe21b00[_0xad41('0xc')]],'as':_0xe21b00['as'],'attributes':_0xe21b00['as']===_0xad41('0x24')?_[_0xad41('0x3c')](_0x1b78b1):_0xe21b00[_0xad41('0xa')],'include':_0xe21b00['include']?_[_0xad41('0xd')](_0xe21b00[_0xad41('0xb')],function(_0x23f5dd){return{'model':db[_0x23f5dd['model']],'as':_0x23f5dd['as'],'attributes':_0x23f5dd[_0xad41('0xa')],'include':_0x23f5dd[_0xad41('0xb')]?_[_0xad41('0xd')](_0x23f5dd['include'],function(_0x1cf1b1){return{'model':db[_0x1cf1b1[_0xad41('0xc')]],'as':_0x1cf1b1['as'],'attributes':_0x1cf1b1[_0xad41('0xa')]};}):[]};}):[]};}):[]:[]})[_0xad41('0xe')](function(_0x288edc){logger['info'](_0xad41('0x10'),_0x5049ff);logger['debug'](_0xad41('0x10'),_0x5049ff,JSON['stringify'](_0x288edc));_0x7d85e(_0x288edc);})[_0xad41('0x17')](function(_0x20c468){logger[_0xad41('0x13')]('GetCmHopper',_0x20c468[_0xad41('0x14')],_0x5049ff);_0x8d3667(_0x482862[_0xad41('0x13')](0x1f4,_0x20c468[_0xad41('0x14')]));});});});};exports['GetContactByPhone']=function(_0x35db36){var _0x535c01=this;return new Promise(function(_0x2c3b46,_0xcc1983){return db[_0xad41('0x1f')][_0xad41('0x3d')]({'raw':!![],'where':{'phone':_0x35db36[_0xad41('0x7')][_0xad41('0x9')][_0xad41('0x3e')]},'attributes':['id',_0xad41('0x3f')],'order':[['id','DESC']]})['then'](function(_0x186823){logger[_0xad41('0xf')](_0xad41('0x40'),_0x35db36);logger[_0xad41('0x11')]('getContactByPhone',_0x35db36,JSON['stringify'](_0x186823));_0x2c3b46(_0x186823);})[_0xad41('0x17')](function(_0x1fa992){logger['error'](_0xad41('0x40'),_0x1fa992[_0xad41('0x14')],_0x35db36);_0xcc1983(_0x535c01['error'](0x1f4,_0x1fa992[_0xad41('0x14')]));});});};exports['ResetActiveCalls']=function(_0x18a90b){var _0x49ce36=this;return new Promise(function(_0x5850aa,_0x2547bb){return db[_0xad41('0x31')][_0xad41('0x21')](function(_0x3a0ed2){var _0x158ecd=_0x18a90b[_0xad41('0x7')]&&_0x18a90b[_0xad41('0x7')][_0xad41('0x9')]?_0x18a90b[_0xad41('0x7')]['where']:{};return db[_0xad41('0x5')][_0xad41('0x2b')](_0x18a90b[_0xad41('0x1a')],{'where':_0x158ecd,'transaction':_0x3a0ed2})[_0xad41('0xe')](function(_0x11944f){logger['info'](_0xad41('0x41'),_0x18a90b);logger[_0xad41('0x11')](_0xad41('0x41'),_0x18a90b,JSON[_0xad41('0x12')](_0x11944f));_0x5850aa(_0x11944f);})[_0xad41('0x17')](function(_0x970885){logger['error'](_0xad41('0x41'),_0x970885[_0xad41('0x14')],_0x18a90b);_0x2547bb(_0x49ce36[_0xad41('0x13')](0x1f4,_0x970885[_0xad41('0x14')]));});});});};exports[_0xad41('0x42')]=function(_0x385683){var _0x42b36f=this;var _0x334383=_0x385683[_0xad41('0x1a')][_0xad41('0x9')][_0xad41('0x43')];var _0x4796c0=_0x385683[_0xad41('0x1a')][_0xad41('0x9')][_0xad41('0x44')];var _0x172902=_0x385683[_0xad41('0x1a')][_0xad41('0x9')][_0xad41('0x45')];return new Promise(function(_0x4a616d,_0x335aa3){return db['CmHopper'][_0xad41('0x6')]({'where':{'voiceQueueId':{'$in':_0x334383},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xad41('0x31')][_0xad41('0x36')](_0xad41('0x46')+_0x4796c0+_0xad41('0x47')),'$gt':db[_0xad41('0x31')][_0xad41('0x36')]('NOW()')}},'UserId':{'$in':_0x172902}},'include':[{'model':db[_0xad41('0x1f')],'as':_0xad41('0x24')},{'model':db[_0xad41('0x25')],'as':_0xad41('0x26'),'attributes':['id','name','voicePause']},{'model':db[_0xad41('0x48')],'as':_0xad41('0x49')}]})[_0xad41('0xe')](function(_0x2457ca){if(_0x2457ca[_0xad41('0x2c')]>0x0){return db[_0xad41('0x31')][_0xad41('0x21')](function(_0x114729){return db[_0xad41('0x5')]['update']({'recallmeNotifiedDate':db[_0xad41('0x31')][_0xad41('0x36')](_0xad41('0x4a'))},{'where':{'id':{'$in':_[_0xad41('0xd')](_0x2457ca,'id')}},'transaction':_0x114729})[_0xad41('0xe')](function(){_0x4a616d(_0x2457ca);})[_0xad41('0x17')](function(_0x4cd7cf){logger[_0xad41('0x13')](_0xad41('0x42'),_0x4cd7cf['message'],_0x385683);_0x335aa3(_0x42b36f[_0xad41('0x13')](0x1f4,_0x4cd7cf[_0xad41('0x14')]));});})['catch'](function(_0x55f77b){logger[_0xad41('0x13')](_0xad41('0x42'),_0x55f77b[_0xad41('0x14')],_0x385683);_0x335aa3(_0x42b36f[_0xad41('0x13')](0x1f4,_0x55f77b[_0xad41('0x14')]));});}else{_0x4a616d(_0x2457ca);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8b36b9b..1e94778 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 _0x4160=['/:id','show','/:id/previewrecall','post','/preview','getPreview','/timezone','getTimezone','put','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','getTimezones'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x4160,0x198));var _0x0416=function(_0x192ac5,_0xfc09dc){_0x192ac5=_0x192ac5-0x0;var _0x394713=_0x4160[_0x192ac5];return _0x394713;};'use strict';var express=require(_0x0416('0x0'));var router=express[_0x0416('0x1')]();var auth=require(_0x0416('0x2'));var controller=require(_0x0416('0x3'));router[_0x0416('0x4')]('/',auth[_0x0416('0x5')](),controller[_0x0416('0x6')]);router[_0x0416('0x4')](_0x0416('0x7'),auth[_0x0416('0x5')](),controller[_0x0416('0x8')]);router[_0x0416('0x4')]('/opencontacts',auth[_0x0416('0x5')](),controller['getOpenContacts']);router[_0x0416('0x4')]('/timezones',auth[_0x0416('0x5')](),controller[_0x0416('0x9')]);router[_0x0416('0x4')](_0x0416('0xa'),auth['isAuthenticated'](),controller[_0x0416('0xb')]);router[_0x0416('0x4')](_0x0416('0xc'),auth[_0x0416('0x5')](),controller['getPreviewRecall']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0416('0xd')](_0x0416('0xe'),auth[_0x0416('0x5')](),controller[_0x0416('0xf')]);router['post'](_0x0416('0x10'),auth[_0x0416('0x5')](),controller[_0x0416('0x11')]);router[_0x0416('0x12')](_0x0416('0xa'),auth[_0x0416('0x5')](),controller['update']);router[_0x0416('0x13')](_0x0416('0xa'),auth[_0x0416('0x5')](),controller[_0x0416('0x14')]);module[_0x0416('0x15')]=router; \ No newline at end of file +var _0x4485=['/timezone','getTimezone','update','delete','exports','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','post','/preview','getPreview'];(function(_0x288766,_0x3247a5){var _0x327187=function(_0x38501b){while(--_0x38501b){_0x288766['push'](_0x288766['shift']());}};_0x327187(++_0x3247a5);}(_0x4485,0xe1));var _0x5448=function(_0x2724e5,_0x229d74){_0x2724e5=_0x2724e5-0x0;var _0x4b6621=_0x4485[_0x2724e5];return _0x4b6621;};'use strict';var express=require('express');var router=express[_0x5448('0x0')]();var auth=require(_0x5448('0x1'));var controller=require(_0x5448('0x2'));router[_0x5448('0x3')]('/',auth[_0x5448('0x4')](),controller['index']);router['get'](_0x5448('0x5'),auth['isAuthenticated'](),controller[_0x5448('0x6')]);router[_0x5448('0x3')]('/opencontacts',auth[_0x5448('0x4')](),controller[_0x5448('0x7')]);router[_0x5448('0x3')](_0x5448('0x8'),auth[_0x5448('0x4')](),controller[_0x5448('0x9')]);router['get'](_0x5448('0xa'),auth[_0x5448('0x4')](),controller['show']);router[_0x5448('0x3')](_0x5448('0xb'),auth[_0x5448('0x4')](),controller['getPreviewRecall']);router[_0x5448('0xc')]('/',auth[_0x5448('0x4')](),controller['create']);router[_0x5448('0xc')](_0x5448('0xd'),auth[_0x5448('0x4')](),controller[_0x5448('0xe')]);router[_0x5448('0xc')](_0x5448('0xf'),auth[_0x5448('0x4')](),controller[_0x5448('0x10')]);router['put'](_0x5448('0xa'),auth[_0x5448('0x4')](),controller[_0x5448('0x11')]);router[_0x5448('0x12')](_0x5448('0xa'),auth[_0x5448('0x4')](),controller['destroy']);module[_0x5448('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 49dd83e..ac06005 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 _0x206b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','STRING'];(function(_0x545312,_0x563053){var _0x52bc56=function(_0x14a75d){while(--_0x14a75d){_0x545312['push'](_0x545312['shift']());}};_0x52bc56(++_0x563053);}(_0x206b,0xff));var _0xb206=function(_0x12b830,_0xd66540){_0x12b830=_0x12b830-0x0;var _0x261dc4=_0x206b[_0x12b830];return _0x261dc4;};'use strict';var moment=require(_0xb206('0x0'));var Sequelize=require(_0xb206('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xb206('0x2')]},'phone':{'type':Sequelize[_0xb206('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xb206('0x4')],'defaultValue':moment()[_0xb206('0x5')](_0xb206('0x6'))},'countbusyretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb206('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcfa6=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','moment','sequelize','exports','STRING','DATE','format'];(function(_0x1825d1,_0x37c89c){var _0xefb147=function(_0x17b65b){while(--_0x17b65b){_0x1825d1['push'](_0x1825d1['shift']());}};_0xefb147(++_0x37c89c);}(_0xcfa6,0x19a));var _0x6cfa=function(_0x5e374a,_0x525a8c){_0x5e374a=_0x5e374a-0x0;var _0x4460db=_0xcfa6[_0x5e374a];return _0x4460db;};'use strict';var moment=require(_0x6cfa('0x0'));var Sequelize=require(_0x6cfa('0x1'));module[_0x6cfa('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x6cfa('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6cfa('0x4')],'defaultValue':moment()[_0x6cfa('0x5')](_0x6cfa('0x6'))},'countbusyretry':{'type':Sequelize[_0x6cfa('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6cfa('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6cfa('0x7')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6cfa('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6cfa('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6cfa('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6cfa('0x7')],'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 a2d9589..3946eb5 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 _0x023b=['map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','create','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','end','error','stack','name','send','index','CmHopperAdditionalPhone','type','key','model'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x023b,0x1cb));var _0xb023=function(_0x4983ef,_0x270429){_0x4983ef=_0x4983ef-0x0;var _0x1b05ba=_0x023b[_0x4983ef];return _0x1b05ba;};'use strict';var emlformat=require(_0xb023('0x0'));var rimraf=require(_0xb023('0x1'));var zipdir=require(_0xb023('0x2'));var jsonpatch=require(_0xb023('0x3'));var rp=require(_0xb023('0x4'));var moment=require(_0xb023('0x5'));var BPromise=require(_0xb023('0x6'));var Mustache=require(_0xb023('0x7'));var util=require(_0xb023('0x8'));var path=require(_0xb023('0x9'));var sox=require(_0xb023('0xa'));var csv=require(_0xb023('0xb'));var ejs=require(_0xb023('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb023('0xd'));var crypto=require(_0xb023('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb023('0xf'));var toCsv=require(_0xb023('0xb'));var querystring=require(_0xb023('0x10'));var Papa=require(_0xb023('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb023('0x12'));var as=require(_0xb023('0x13'));var hardwareService=require(_0xb023('0x14'));var logger=require(_0xb023('0x15'))(_0xb023('0x16'));var utils=require(_0xb023('0x17'));var config=require(_0xb023('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ab100,_0x448245){_0x448245=_0x448245||0xcc;return function(_0x199f08){if(_0x199f08){return _0x2ab100[_0xb023('0x19')](_0x448245);}return _0x2ab100[_0xb023('0x1a')](_0x448245)['end']();};}function respondWithResult(_0x5da9d2,_0x1ae735){_0x1ae735=_0x1ae735||0xc8;return function(_0x117e86){if(_0x117e86){return _0x5da9d2[_0xb023('0x1a')](_0x1ae735)[_0xb023('0x1b')](_0x117e86);}};}function respondWithFilteredResult(_0x479a74,_0x24401f){return function(_0x41e006){if(_0x41e006){var _0x213999=typeof _0x24401f['offset']===_0xb023('0x1c')&&typeof _0x24401f[_0xb023('0x1d')]===_0xb023('0x1c');var _0x43a5ac=_0x41e006['count'];var _0x171e11=_0x213999?0x0:_0x24401f[_0xb023('0x1e')];var _0x10ac59=_0x213999?_0x41e006['count']:_0x24401f[_0xb023('0x1e')]+_0x24401f[_0xb023('0x1d')];var _0x398d62;if(_0x10ac59>=_0x43a5ac){_0x10ac59=_0x43a5ac;_0x398d62=0xc8;}else{_0x398d62=0xce;}_0x479a74['status'](_0x398d62);return _0x479a74[_0xb023('0x1f')](_0xb023('0x20'),_0x171e11+'-'+_0x10ac59+'/'+_0x43a5ac)[_0xb023('0x1b')](_0x41e006);}return null;};}function patchUpdates(_0x2863e4){return function(_0x7f173e){try{jsonpatch[_0xb023('0x21')](_0x7f173e,_0x2863e4,!![]);}catch(_0x150d27){return BPromise['reject'](_0x150d27);}return _0x7f173e[_0xb023('0x22')]();};}function saveUpdates(_0x2f77ab,_0x432e5b){return function(_0x59674f){if(_0x59674f){return _0x59674f[_0xb023('0x23')](_0x2f77ab)[_0xb023('0x24')](function(_0x316736){return _0x316736;});}return null;};}function removeEntity(_0x2c7c9a,_0x4667a9){return function(_0x8ef8b5){if(_0x8ef8b5){return _0x8ef8b5[_0xb023('0x25')]()[_0xb023('0x24')](function(){var _0x5f0973=_0x8ef8b5[_0xb023('0x26')]({'plain':!![]});var _0xc7257d=_0xb023('0x27');return db[_0xb023('0x28')]['destroy']({'where':{'type':_0xc7257d,'resourceId':_0x5f0973['id']}})[_0xb023('0x24')](function(){return _0x8ef8b5;});})[_0xb023('0x24')](function(){_0x2c7c9a[_0xb023('0x1a')](0xcc)[_0xb023('0x29')]();});}};}function handleEntityNotFound(_0x75ce01,_0x5af716){return function(_0x3ab237){if(!_0x3ab237){_0x75ce01['sendStatus'](0x194);}return _0x3ab237;};}function handleError(_0x35c463,_0x33a11a){_0x33a11a=_0x33a11a||0x1f4;return function(_0x46348f){logger[_0xb023('0x2a')](_0x46348f[_0xb023('0x2b')]);if(_0x46348f[_0xb023('0x2c')]){delete _0x46348f['name'];}_0x35c463[_0xb023('0x1a')](_0x33a11a)[_0xb023('0x2d')](_0x46348f);};}exports[_0xb023('0x2e')]=function(_0x4c975c,_0x12822d){var _0x538dd2={},_0x53d5e6={},_0x4c8009={'count':0x0,'rows':[]};var _0x2ac2a5=_['map'](db[_0xb023('0x2f')]['rawAttributes'],function(_0x21b073){return{'name':_0x21b073['fieldName'],'type':_0x21b073[_0xb023('0x30')][_0xb023('0x31')]};});_0x53d5e6[_0xb023('0x32')]=_[_0xb023('0x33')](_0x2ac2a5,'name');_0x53d5e6[_0xb023('0x34')]=_['keys'](_0x4c975c['query']);_0x53d5e6[_0xb023('0x35')]=_[_0xb023('0x36')](_0x53d5e6['model'],_0x53d5e6[_0xb023('0x34')]);_0x538dd2[_0xb023('0x37')]=_['intersection'](_0x53d5e6[_0xb023('0x32')],qs[_0xb023('0x38')](_0x4c975c[_0xb023('0x34')][_0xb023('0x38')]));_0x538dd2['attributes']=_0x538dd2[_0xb023('0x37')][_0xb023('0x39')]?_0x538dd2['attributes']:_0x53d5e6[_0xb023('0x32')];if(!_0x4c975c[_0xb023('0x34')][_0xb023('0x3a')]('nolimit')){_0x538dd2['limit']=qs[_0xb023('0x1d')](_0x4c975c['query']['limit']);_0x538dd2['offset']=qs[_0xb023('0x1e')](_0x4c975c[_0xb023('0x34')][_0xb023('0x1e')]);}_0x538dd2[_0xb023('0x3b')]=qs['sort'](_0x4c975c['query'][_0xb023('0x3c')]);_0x538dd2[_0xb023('0x3d')]=qs['filters'](_[_0xb023('0x3e')](_0x4c975c[_0xb023('0x34')],_0x53d5e6['filters']),_0x2ac2a5);if(_0x4c975c[_0xb023('0x34')][_0xb023('0x3f')]){_0x538dd2[_0xb023('0x3d')]=_['merge'](_0x538dd2[_0xb023('0x3d')],{'$or':_[_0xb023('0x33')](_0x2ac2a5,function(_0x3a8851){if(_0x3a8851[_0xb023('0x30')]!==_0xb023('0x40')){var _0x57de90={};_0x57de90[_0x3a8851[_0xb023('0x2c')]]={'$like':'%'+_0x4c975c[_0xb023('0x34')][_0xb023('0x3f')]+'%'};return _0x57de90;}})});}_0x538dd2=_['merge']({},_0x538dd2,_0x4c975c['options']);var _0x498fa4={'where':_0x538dd2['where']};return db['CmHopperAdditionalPhone'][_0xb023('0x41')](_0x498fa4)[_0xb023('0x24')](function(_0x420f8e){_0x4c8009['count']=_0x420f8e;if(_0x4c975c[_0xb023('0x34')][_0xb023('0x42')]){_0x538dd2[_0xb023('0x43')]=[{'all':!![]}];}return db[_0xb023('0x2f')][_0xb023('0x44')](_0x538dd2);})[_0xb023('0x24')](function(_0x19a0ed){_0x4c8009[_0xb023('0x45')]=_0x19a0ed;return _0x4c8009;})['then'](respondWithFilteredResult(_0x12822d,_0x538dd2))[_0xb023('0x46')](handleError(_0x12822d,null));};exports[_0xb023('0x47')]=function(_0x5d78b9,_0x1bace6){var _0x35ec39={'raw':!![],'where':{'id':_0x5d78b9[_0xb023('0x48')]['id']}},_0x227612={};_0x227612[_0xb023('0x32')]=_[_0xb023('0x49')](db[_0xb023('0x2f')]['rawAttributes']);_0x227612['query']=_[_0xb023('0x49')](_0x5d78b9['query']);_0x227612[_0xb023('0x35')]=_[_0xb023('0x36')](_0x227612[_0xb023('0x32')],_0x227612[_0xb023('0x34')]);_0x35ec39[_0xb023('0x37')]=_[_0xb023('0x36')](_0x227612[_0xb023('0x32')],qs[_0xb023('0x38')](_0x5d78b9[_0xb023('0x34')][_0xb023('0x38')]));_0x35ec39[_0xb023('0x37')]=_0x35ec39['attributes']['length']?_0x35ec39[_0xb023('0x37')]:_0x227612[_0xb023('0x32')];if(_0x5d78b9[_0xb023('0x34')][_0xb023('0x42')]){_0x35ec39[_0xb023('0x43')]=[{'all':!![]}];}_0x35ec39=_[_0xb023('0x4a')]({},_0x35ec39,_0x5d78b9[_0xb023('0x4b')]);return db[_0xb023('0x2f')]['find'](_0x35ec39)[_0xb023('0x24')](handleEntityNotFound(_0x1bace6,null))[_0xb023('0x24')](respondWithResult(_0x1bace6,null))[_0xb023('0x46')](handleError(_0x1bace6,null));};exports[_0xb023('0x4c')]=function(_0x41efcc,_0x490a8a){return db[_0xb023('0x2f')][_0xb023('0x4c')](_0x41efcc['body'],{})[_0xb023('0x24')](function(_0x15a0a0){var _0x5c6f74=_0x41efcc['user'][_0xb023('0x26')]({'plain':!![]});if(!_0x5c6f74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c6f74[_0xb023('0x4d')]===_0xb023('0x4e')){var _0x11395c=_0x15a0a0[_0xb023('0x26')]({'plain':!![]});var _0x3ec728=_0xb023('0x27');return db[_0xb023('0x4f')][_0xb023('0x50')]({'where':{'name':_0x3ec728,'userProfileId':_0x5c6f74[_0xb023('0x51')]},'raw':!![]})[_0xb023('0x24')](function(_0x523423){if(_0x523423&&_0x523423[_0xb023('0x52')]===0x0){return db[_0xb023('0x28')][_0xb023('0x4c')]({'name':_0x11395c[_0xb023('0x2c')],'resourceId':_0x11395c['id'],'type':_0x523423[_0xb023('0x2c')],'sectionId':_0x523423['id']},{})[_0xb023('0x24')](function(){return _0x15a0a0;});}else{return _0x15a0a0;}})[_0xb023('0x46')](function(_0x3db83e){logger[_0xb023('0x2a')](_0xb023('0x53'),_0x3db83e);throw _0x3db83e;});}return _0x15a0a0;})[_0xb023('0x24')](respondWithResult(_0x490a8a,0xc9))['catch'](handleError(_0x490a8a,null));};exports['update']=function(_0x1f5fa6,_0x416d1d){if(_0x1f5fa6[_0xb023('0x54')]['id']){delete _0x1f5fa6[_0xb023('0x54')]['id'];}return db['CmHopperAdditionalPhone'][_0xb023('0x50')]({'where':{'id':_0x1f5fa6[_0xb023('0x48')]['id']}})[_0xb023('0x24')](handleEntityNotFound(_0x416d1d,null))[_0xb023('0x24')](saveUpdates(_0x1f5fa6['body'],null))[_0xb023('0x24')](respondWithResult(_0x416d1d,null))[_0xb023('0x46')](handleError(_0x416d1d,null));};exports['destroy']=function(_0x53b0e5,_0x7ea27e){return db[_0xb023('0x2f')][_0xb023('0x50')]({'where':{'id':_0x53b0e5[_0xb023('0x48')]['id']}})['then'](handleEntityNotFound(_0x7ea27e,null))[_0xb023('0x24')](removeEntity(_0x7ea27e,null))[_0xb023('0x46')](handleError(_0x7ea27e,null));}; \ No newline at end of file +var _0x81f1=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','CmHopperAdditionalPhones','UserProfileResource','sendStatus','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x81f1,0x14f));var _0x181f=function(_0x2a6558,_0x86acaa){_0x2a6558=_0x2a6558-0x0;var _0x257640=_0x81f1[_0x2a6558];return _0x257640;};'use strict';var emlformat=require(_0x181f('0x0'));var rimraf=require(_0x181f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x181f('0x2'));var rp=require(_0x181f('0x3'));var moment=require('moment');var BPromise=require(_0x181f('0x4'));var Mustache=require('mustache');var util=require(_0x181f('0x5'));var path=require(_0x181f('0x6'));var sox=require(_0x181f('0x7'));var csv=require(_0x181f('0x8'));var ejs=require(_0x181f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x181f('0xa'));var squel=require(_0x181f('0xb'));var crypto=require(_0x181f('0xc'));var jsforce=require(_0x181f('0xd'));var deskjs=require(_0x181f('0xe'));var toCsv=require(_0x181f('0x8'));var querystring=require(_0x181f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x181f('0x10'));var as=require(_0x181f('0x11'));var hardwareService=require(_0x181f('0x12'));var logger=require(_0x181f('0x13'))(_0x181f('0x14'));var utils=require(_0x181f('0x15'));var config=require(_0x181f('0x16'));var licenseUtil=require(_0x181f('0x17'));var db=require(_0x181f('0x18'))['db'];function respondWithStatusCode(_0x46e428,_0x4010c1){_0x4010c1=_0x4010c1||0xcc;return function(_0x196fac){if(_0x196fac){return _0x46e428['sendStatus'](_0x4010c1);}return _0x46e428[_0x181f('0x19')](_0x4010c1)[_0x181f('0x1a')]();};}function respondWithResult(_0x2f2731,_0x56953e){_0x56953e=_0x56953e||0xc8;return function(_0x59a232){if(_0x59a232){return _0x2f2731[_0x181f('0x19')](_0x56953e)[_0x181f('0x1b')](_0x59a232);}};}function respondWithFilteredResult(_0x3888ab,_0x599783){return function(_0x3208c7){if(_0x3208c7){var _0x47646e=typeof _0x599783[_0x181f('0x1c')]===_0x181f('0x1d')&&typeof _0x599783[_0x181f('0x1e')]===_0x181f('0x1d');var _0x5e6631=_0x3208c7[_0x181f('0x1f')];var _0x310fdb=_0x47646e?0x0:_0x599783['offset'];var _0x48bffa=_0x47646e?_0x3208c7[_0x181f('0x1f')]:_0x599783['offset']+_0x599783[_0x181f('0x1e')];var _0x872f2;if(_0x48bffa>=_0x5e6631){_0x48bffa=_0x5e6631;_0x872f2=0xc8;}else{_0x872f2=0xce;}_0x3888ab['status'](_0x872f2);return _0x3888ab[_0x181f('0x20')](_0x181f('0x21'),_0x310fdb+'-'+_0x48bffa+'/'+_0x5e6631)[_0x181f('0x1b')](_0x3208c7);}return null;};}function patchUpdates(_0x5a8cfd){return function(_0x3cea0a){try{jsonpatch[_0x181f('0x22')](_0x3cea0a,_0x5a8cfd,!![]);}catch(_0x53c310){return BPromise[_0x181f('0x23')](_0x53c310);}return _0x3cea0a[_0x181f('0x24')]();};}function saveUpdates(_0x3ea165,_0x536b51){return function(_0x5c999a){if(_0x5c999a){return _0x5c999a['update'](_0x3ea165)[_0x181f('0x25')](function(_0x21382a){return _0x21382a;});}return null;};}function removeEntity(_0x50e9bb,_0x26de9e){return function(_0x3e6a3a){if(_0x3e6a3a){return _0x3e6a3a[_0x181f('0x26')]()[_0x181f('0x25')](function(){var _0x119cfc=_0x3e6a3a['get']({'plain':!![]});var _0x1aa916=_0x181f('0x27');return db[_0x181f('0x28')][_0x181f('0x26')]({'where':{'type':_0x1aa916,'resourceId':_0x119cfc['id']}})['then'](function(){return _0x3e6a3a;});})['then'](function(){_0x50e9bb[_0x181f('0x19')](0xcc)[_0x181f('0x1a')]();});}};}function handleEntityNotFound(_0x5c2d4b,_0x3549de){return function(_0x1aa003){if(!_0x1aa003){_0x5c2d4b[_0x181f('0x29')](0x194);}return _0x1aa003;};}function handleError(_0x374f5c,_0x57cbe0){_0x57cbe0=_0x57cbe0||0x1f4;return function(_0x5aedf7){logger['error'](_0x5aedf7[_0x181f('0x2a')]);if(_0x5aedf7['name']){delete _0x5aedf7[_0x181f('0x2b')];}_0x374f5c[_0x181f('0x19')](_0x57cbe0)[_0x181f('0x2c')](_0x5aedf7);};}exports[_0x181f('0x2d')]=function(_0x1e75d7,_0x164d1c){var _0x3b6233={},_0x2d854b={},_0x170259={'count':0x0,'rows':[]};var _0x1f46ab=_[_0x181f('0x2e')](db[_0x181f('0x2f')][_0x181f('0x30')],function(_0x4d9196){return{'name':_0x4d9196['fieldName'],'type':_0x4d9196[_0x181f('0x31')][_0x181f('0x32')]};});_0x2d854b['model']=_[_0x181f('0x2e')](_0x1f46ab,_0x181f('0x2b'));_0x2d854b[_0x181f('0x33')]=_[_0x181f('0x34')](_0x1e75d7['query']);_0x2d854b[_0x181f('0x35')]=_[_0x181f('0x36')](_0x2d854b[_0x181f('0x37')],_0x2d854b[_0x181f('0x33')]);_0x3b6233[_0x181f('0x38')]=_['intersection'](_0x2d854b['model'],qs[_0x181f('0x39')](_0x1e75d7['query'][_0x181f('0x39')]));_0x3b6233['attributes']=_0x3b6233[_0x181f('0x38')][_0x181f('0x3a')]?_0x3b6233[_0x181f('0x38')]:_0x2d854b[_0x181f('0x37')];if(!_0x1e75d7[_0x181f('0x33')]['hasOwnProperty'](_0x181f('0x3b'))){_0x3b6233['limit']=qs['limit'](_0x1e75d7[_0x181f('0x33')][_0x181f('0x1e')]);_0x3b6233[_0x181f('0x1c')]=qs['offset'](_0x1e75d7[_0x181f('0x33')][_0x181f('0x1c')]);}_0x3b6233[_0x181f('0x3c')]=qs[_0x181f('0x3d')](_0x1e75d7[_0x181f('0x33')]['sort']);_0x3b6233[_0x181f('0x3e')]=qs[_0x181f('0x35')](_[_0x181f('0x3f')](_0x1e75d7[_0x181f('0x33')],_0x2d854b[_0x181f('0x35')]),_0x1f46ab);if(_0x1e75d7['query'][_0x181f('0x40')]){_0x3b6233[_0x181f('0x3e')]=_[_0x181f('0x41')](_0x3b6233[_0x181f('0x3e')],{'$or':_[_0x181f('0x2e')](_0x1f46ab,function(_0xd0384b){if(_0xd0384b[_0x181f('0x31')]!=='VIRTUAL'){var _0xc4e94e={};_0xc4e94e[_0xd0384b[_0x181f('0x2b')]]={'$like':'%'+_0x1e75d7[_0x181f('0x33')][_0x181f('0x40')]+'%'};return _0xc4e94e;}})});}_0x3b6233=_['merge']({},_0x3b6233,_0x1e75d7[_0x181f('0x42')]);var _0x4fdbcf={'where':_0x3b6233[_0x181f('0x3e')]};return db[_0x181f('0x2f')][_0x181f('0x1f')](_0x4fdbcf)['then'](function(_0x1824c5){_0x170259['count']=_0x1824c5;if(_0x1e75d7[_0x181f('0x33')][_0x181f('0x43')]){_0x3b6233['include']=[{'all':!![]}];}return db[_0x181f('0x2f')][_0x181f('0x44')](_0x3b6233);})[_0x181f('0x25')](function(_0x384132){_0x170259[_0x181f('0x45')]=_0x384132;return _0x170259;})[_0x181f('0x25')](respondWithFilteredResult(_0x164d1c,_0x3b6233))[_0x181f('0x46')](handleError(_0x164d1c,null));};exports['show']=function(_0x6371c,_0x56ab94){var _0x3acd3b={'raw':!![],'where':{'id':_0x6371c[_0x181f('0x47')]['id']}},_0x4b837e={};_0x4b837e['model']=_[_0x181f('0x34')](db['CmHopperAdditionalPhone'][_0x181f('0x30')]);_0x4b837e[_0x181f('0x33')]=_['keys'](_0x6371c[_0x181f('0x33')]);_0x4b837e[_0x181f('0x35')]=_[_0x181f('0x36')](_0x4b837e[_0x181f('0x37')],_0x4b837e[_0x181f('0x33')]);_0x3acd3b['attributes']=_[_0x181f('0x36')](_0x4b837e['model'],qs[_0x181f('0x39')](_0x6371c[_0x181f('0x33')][_0x181f('0x39')]));_0x3acd3b['attributes']=_0x3acd3b[_0x181f('0x38')]['length']?_0x3acd3b[_0x181f('0x38')]:_0x4b837e['model'];if(_0x6371c[_0x181f('0x33')][_0x181f('0x43')]){_0x3acd3b[_0x181f('0x48')]=[{'all':!![]}];}_0x3acd3b=_[_0x181f('0x41')]({},_0x3acd3b,_0x6371c[_0x181f('0x42')]);return db[_0x181f('0x2f')][_0x181f('0x49')](_0x3acd3b)['then'](handleEntityNotFound(_0x56ab94,null))[_0x181f('0x25')](respondWithResult(_0x56ab94,null))['catch'](handleError(_0x56ab94,null));};exports[_0x181f('0x4a')]=function(_0xfa1fd,_0x40a92a){return db[_0x181f('0x2f')][_0x181f('0x4a')](_0xfa1fd['body'],{})['then'](function(_0x468a65){var _0x1985f7=_0xfa1fd[_0x181f('0x4b')][_0x181f('0x4c')]({'plain':!![]});if(!_0x1985f7)throw new Error(_0x181f('0x4d'));if(_0x1985f7[_0x181f('0x4e')]===_0x181f('0x4b')){var _0x2f847a=_0x468a65[_0x181f('0x4c')]({'plain':!![]});var _0x544832=_0x181f('0x27');return db[_0x181f('0x4f')]['find']({'where':{'name':_0x544832,'userProfileId':_0x1985f7[_0x181f('0x50')]},'raw':!![]})[_0x181f('0x25')](function(_0x3c7371){if(_0x3c7371&&_0x3c7371[_0x181f('0x51')]===0x0){return db[_0x181f('0x28')][_0x181f('0x4a')]({'name':_0x2f847a[_0x181f('0x2b')],'resourceId':_0x2f847a['id'],'type':_0x3c7371[_0x181f('0x2b')],'sectionId':_0x3c7371['id']},{})[_0x181f('0x25')](function(){return _0x468a65;});}else{return _0x468a65;}})[_0x181f('0x46')](function(_0x259fdf){logger[_0x181f('0x52')](_0x181f('0x53'),_0x259fdf);throw _0x259fdf;});}return _0x468a65;})[_0x181f('0x25')](respondWithResult(_0x40a92a,0xc9))['catch'](handleError(_0x40a92a,null));};exports[_0x181f('0x54')]=function(_0x595bf6,_0xd2bd5e){if(_0x595bf6[_0x181f('0x55')]['id']){delete _0x595bf6[_0x181f('0x55')]['id'];}return db[_0x181f('0x2f')][_0x181f('0x49')]({'where':{'id':_0x595bf6[_0x181f('0x47')]['id']}})[_0x181f('0x25')](handleEntityNotFound(_0xd2bd5e,null))[_0x181f('0x25')](saveUpdates(_0x595bf6[_0x181f('0x55')],null))['then'](respondWithResult(_0xd2bd5e,null))['catch'](handleError(_0xd2bd5e,null));};exports[_0x181f('0x26')]=function(_0x322262,_0x4ed174){return db[_0x181f('0x2f')]['find']({'where':{'id':_0x322262[_0x181f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ed174,null))[_0x181f('0x25')](removeEntity(_0x4ed174,null))[_0x181f('0x46')](handleError(_0x4ed174,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 78d1372..f52f484 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 _0x2533=['bluebird','request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','util','../../config/logger','api','moment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x2533,0xf2));var _0x3253=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x2533[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0x3253('0x0'));var util=require(_0x3253('0x1'));var logger=require(_0x3253('0x2'))(_0x3253('0x3'));var moment=require(_0x3253('0x4'));var BPromise=require(_0x3253('0x5'));var rp=require(_0x3253('0x6'));var fs=require('fs');var path=require(_0x3253('0x7'));var rimraf=require('rimraf');var config=require(_0x3253('0x8'));var attributes=require(_0x3253('0x9'));module[_0x3253('0xa')]=function(_0x31c5d6,_0x1cdae3){return _0x31c5d6[_0x3253('0xb')](_0x3253('0xc'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ee0=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x4e89e8,_0x50afec){var _0x10dee4=function(_0x3fb670){while(--_0x3fb670){_0x4e89e8['push'](_0x4e89e8['shift']());}};_0x10dee4(++_0x50afec);}(_0x3ee0,0x12b));var _0x03ee=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3ee0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x03ee('0x0'));var util=require(_0x03ee('0x1'));var logger=require(_0x03ee('0x2'))(_0x03ee('0x3'));var moment=require('moment');var BPromise=require(_0x03ee('0x4'));var rp=require(_0x03ee('0x5'));var fs=require('fs');var path=require(_0x03ee('0x6'));var rimraf=require('rimraf');var config=require(_0x03ee('0x7'));var attributes=require(_0x03ee('0x8'));module[_0x03ee('0x9')]=function(_0x247897,_0x11881f){return _0x247897[_0x03ee('0xa')](_0x03ee('0xb'),attributes,{'tableName':_0x03ee('0xc'),'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 0225b5c..32e35fc 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 _0x8319=['createdAt','updatedAt','sequelize','transaction','update','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countnoanswerretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','SwapAdditionalPhones','ContactId','CmHopperAdditionalPhone','waitTime','duration','isNil','scheduledat','minutes','add','phone'];(function(_0x1c9e79,_0x43edcc){var _0x2ec82a=function(_0x413a77){while(--_0x413a77){_0x1c9e79['push'](_0x1c9e79['shift']());}};_0x2ec82a(++_0x43edcc);}(_0x8319,0x77));var _0x9831=function(_0xeeb3ba,_0x18463f){_0xeeb3ba=_0xeeb3ba-0x0;var _0x181a47=_0x8319[_0xeeb3ba];return _0x181a47;};'use strict';var _=require('lodash');var util=require(_0x9831('0x0'));var moment=require(_0x9831('0x1'));var BPromise=require(_0x9831('0x2'));var rs=require(_0x9831('0x3'));var fs=require('fs');var Redis=require(_0x9831('0x4'));var db=require(_0x9831('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9831('0x6'))('rpc');var config=require(_0x9831('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9831('0x8')][_0x9831('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed4a1,_0xff0524,_0x40ce13){return new BPromise(function(_0x2d5c88,_0x2c35a9){return client['request'](_0x1ed4a1,_0x40ce13)[_0x9831('0xa')](function(_0x2cb5a0){logger['info'](_0x9831('0xb'),_0xff0524,_0x9831('0xc'));logger[_0x9831('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0xff0524,'request\x20sent',JSON[_0x9831('0xe')](_0x2cb5a0));if(_0x2cb5a0[_0x9831('0xf')]){if(_0x2cb5a0[_0x9831('0xf')][_0x9831('0x10')]===0x1f4){logger[_0x9831('0xf')](_0x9831('0xb'),_0xff0524,_0x2cb5a0[_0x9831('0xf')][_0x9831('0x11')]);return _0x2c35a9(_0x2cb5a0[_0x9831('0xf')][_0x9831('0x11')]);}logger[_0x9831('0xf')](_0x9831('0xb'),_0xff0524,_0x2cb5a0[_0x9831('0xf')][_0x9831('0x11')]);return _0x2d5c88(_0x2cb5a0[_0x9831('0xf')][_0x9831('0x11')]);}else{logger[_0x9831('0x12')](_0x9831('0xb'),_0xff0524,_0x9831('0xc'));_0x2d5c88(_0x2cb5a0['result'][_0x9831('0x11')]);}})[_0x9831('0x13')](function(_0x4c30bf){logger[_0x9831('0xf')](_0x9831('0xb'),_0xff0524,_0x4c30bf);_0x2c35a9(_0x4c30bf);});});}exports[_0x9831('0x14')]=function(_0x1a25ee){var _0x52802a=this;return new Promise(function(_0x9c221,_0x40013f){return db[_0x9831('0x15')][_0x9831('0x16')]({'raw':!![],'where':{'ContactId':_0x1a25ee[_0x9831('0x17')]['ContactId'],'ListId':_0x1a25ee[_0x9831('0x17')][_0x9831('0x18')],'VoiceQueueId':_0x1a25ee[_0x9831('0x17')][_0x9831('0x19')]===undefined?null:_0x1a25ee[_0x9831('0x17')][_0x9831('0x19')],'CampaignId':_0x1a25ee[_0x9831('0x17')][_0x9831('0x1a')]===undefined?null:_0x1a25ee[_0x9831('0x17')][_0x9831('0x1a')]}})['then'](function(_0x52a1de){if(_0x52a1de!=null){return db['CmHopperAdditionalPhone'][_0x9831('0x16')]({'raw':!![],'where':{'CmHopperId':_0x52a1de['id'],'OrderBy':{'$gt':_0x52a1de[_0x9831('0x1b')]}},'order':[[_0x9831('0x1b'),_0x9831('0x1c')]]})[_0x9831('0xa')](function(_0x127f4b){var _0x287827=0x0;if(_0x127f4b){if(_0x127f4b['countbusyretry']+_0x127f4b['countcongestionretry']+_0x127f4b[_0x9831('0x1d')]+_0x127f4b['countnosuchnumberretry']+_0x127f4b[_0x9831('0x1e')]+_0x127f4b['countabandonedretry']+_0x127f4b[_0x9831('0x1f')]+_0x127f4b['countagentrejectretry']<_0x1a25ee[_0x9831('0x20')][_0x9831('0x21')])_0x287827=0x1;_0x9c221({'additional':_0x287827});}else{return db['CmHopperAdditionalPhone'][_0x9831('0x16')]({'raw':!![],'where':{'CmHopperId':_0x52a1de['id']},'order':[[_0x9831('0x1b'),_0x9831('0x1c')]]})[_0x9831('0xa')](function(_0x516c85){var _0x4fef9f=0x0;if(_0x516c85){if(_0x516c85[_0x9831('0x22')]+_0x516c85[_0x9831('0x23')]+_0x516c85['countnoanswerretry']+_0x516c85[_0x9831('0x24')]+_0x516c85[_0x9831('0x1e')]+_0x516c85[_0x9831('0x25')]+_0x516c85[_0x9831('0x1f')]+_0x516c85[_0x9831('0x26')]<_0x1a25ee[_0x9831('0x20')][_0x9831('0x21')])_0x4fef9f=0x1;_0x9c221({'additional':_0x4fef9f});}else{_0x9c221({'additional':0x0});}})[_0x9831('0x13')](function(_0x4964a9){logger['error'](_0x9831('0x14'),_0x4964a9[_0x9831('0x11')]);_0x40013f(_0x52802a[_0x9831('0xf')](0x1f4,_0x4964a9['message']));});}})[_0x9831('0x13')](function(_0x1bcaf9){logger[_0x9831('0xf')](_0x9831('0x14'),_0x1bcaf9[_0x9831('0x11')]);_0x40013f(_0x52802a[_0x9831('0xf')](0x1f4,_0x1bcaf9['message']));});}else _0x9c221({'additional':0x0});});});};exports[_0x9831('0x27')]=function(_0x433c14){var _0x55261f=this;return new Promise(function(_0x10408f,_0x4eb3e3){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x433c14[_0x9831('0x17')][_0x9831('0x28')],'ListId':_0x433c14['body'][_0x9831('0x18')],'VoiceQueueId':_0x433c14[_0x9831('0x17')][_0x9831('0x19')]===undefined?null:_0x433c14[_0x9831('0x17')]['VoiceQueueId'],'CampaignId':_0x433c14[_0x9831('0x17')][_0x9831('0x1a')]===undefined?null:_0x433c14[_0x9831('0x17')][_0x9831('0x1a')]}})[_0x9831('0xa')](function(_0x554e28){if(_0x554e28!=null){return db[_0x9831('0x29')][_0x9831('0x16')]({'raw':!![],'where':{'CmHopperId':_0x554e28['id'],'OrderBy':{'$gte':_0x554e28['OrderBy']}},'order':[[_0x9831('0x1b'),_0x9831('0x1c')]]})[_0x9831('0xa')](function(_0x4d8fef){if(_0x4d8fef)return activateAdditionalPhone(_0x554e28,_0x433c14[_0x9831('0x17')],_0x4d8fef,_0x433c14['duration'],_0x433c14[_0x9831('0x2a')])[_0x9831('0xa')](function(_0x52c34e){_0x10408f(_0x52c34e);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x554e28['id']},'order':[['OrderBy',_0x9831('0x1c')]]})[_0x9831('0xa')](function(_0x194053){if(_0x194053)return activateAdditionalPhone(_0x554e28,_0x433c14['body'],_0x194053,_0x433c14[_0x9831('0x2b')],_0x433c14[_0x9831('0x2a')])[_0x9831('0xa')](function(_0x48dd3f){_0x10408f(_0x48dd3f);});else{_0x10408f({'id':_0x554e28['id'],'phone':''});}})['catch'](function(_0x21a10e){logger[_0x9831('0xf')]('VerifyAdditionalPhones',_0x21a10e[_0x9831('0x11')]);_0x4eb3e3(_0x55261f[_0x9831('0xf')](0x1f4,_0x21a10e['message']));});}})['catch'](function(_0x1c8548){logger[_0x9831('0xf')](_0x9831('0x14'),_0x1c8548[_0x9831('0x11')]);_0x4eb3e3(_0x55261f[_0x9831('0xf')](0x1f4,_0x1c8548['message']));});}else _0x10408f(0x1);});});};function activateAdditionalPhone(_0x307a33,_0x550046,_0x1c18cf,_0x561402,_0x10eef6){return new Promise(function(_0x2da03d,_0xd3405b){var _0x3fce21;if(_[_0x9831('0x2c')](_0x1c18cf[_0x9831('0x2d')])){_0x1c18cf[_0x9831('0x2d')]=moment();}if(moment()>moment(_0x1c18cf['scheduledat'])){_0x3fce21=moment()['add'](_0x10eef6||0x3,_0x9831('0x2e'));}else{if(_0x1c18cf[_0x9831('0x1b')]==0x0){_0x3fce21=moment(_0x1c18cf['scheduledat']);}else{_0x3fce21=moment()[_0x9831('0x2f')](_0x10eef6||0x3,_0x9831('0x2e'));}}if(_[_0x9831('0x2c')](_0x3fce21)){_0x3fce21=moment()[_0x9831('0x2f')](_0x10eef6||0x3,'minutes');}var _0x3c370c={'phone':_0x307a33[_0x9831('0x30')],'active':0x0,'OrderBy':_[_0x9831('0x2c')](_0x307a33[_0x9831('0x1b')])?0x0:_0x307a33['OrderBy'],'scheduledat':moment()['add'](_0x561402||0x1,_0x9831('0x2e')),'countbusyretry':_0x550046[_0x9831('0x22')],'countcongestionretry':_0x550046[_0x9831('0x23')],'countnoanswerretry':_0x550046[_0x9831('0x1d')],'countnosuchnumberretry':_0x550046[_0x9831('0x24')],'countdropretry':_0x550046[_0x9831('0x1e')],'countabandonedretry':_0x550046['countabandonedretry'],'countmachineretry':_0x550046[_0x9831('0x1f')],'countagentrejectretry':_0x550046[_0x9831('0x26')],'createdAt':_0x550046[_0x9831('0x31')],'updatedAt':_0x550046[_0x9831('0x32')]};var _0x1cd5ce={'CmHopperId':_0x307a33['id'],'phone':_0x1c18cf['phone'],'active':0x0,'OrderBy':_['isNil'](_0x1c18cf['OrderBy'])?0x0:_0x1c18cf[_0x9831('0x1b')],'scheduledat':_0x3fce21,'countbusyretry':_0x1c18cf[_0x9831('0x22')],'countcongestionretry':_0x1c18cf['countcongestionretry'],'countnoanswerretry':_0x1c18cf[_0x9831('0x1d')],'countnosuchnumberretry':_0x1c18cf[_0x9831('0x24')],'countdropretry':_0x1c18cf['countdropretry'],'countabandonedretry':_0x1c18cf[_0x9831('0x25')],'countmachineretry':_0x1c18cf[_0x9831('0x1f')],'countagentrejectretry':_0x1c18cf[_0x9831('0x26')],'createdAt':_0x1c18cf[_0x9831('0x31')],'updatedAt':_0x1c18cf['updatedAt']};return db[_0x9831('0x33')][_0x9831('0x34')](function(_0x2d3c79){return db['CmHopperAdditionalPhone'][_0x9831('0x35')](_0x3c370c,{'where':{'id':_0x1c18cf['id']}},{'transaction':_0x2d3c79})['then'](function(){return db[_0x9831('0x15')][_0x9831('0x35')](_0x1cd5ce,{'where':{'id':_0x307a33['id']}},{'transaction':_0x2d3c79});});})['then'](function(_0x550204){_0x2da03d({'id':_0x307a33['id'],'phone':_0x1c18cf[_0x9831('0x30')]});})[_0x9831('0x13')](function(_0x1f3af2){logger[_0x9831('0xf')]('activateAdditionalPhone',_0x1f3af2['message']);_0xd3405b({'error':_0x1f3af2['message']});});});}exports[_0x9831('0x36')]=function(_0x1705fd){var _0x2deead=this;return new Promise(function(_0x2c3373,_0x46b6f0){return db[_0x9831('0x15')][_0x9831('0x35')](_0x1705fd[_0x9831('0x17')][_0x9831('0x37')],{'where':{'id':_0x1705fd[_0x9831('0x17')]['id']}})['then'](function(_0xa053fa){_0x2c3373(_0xa053fa);})['catch'](function(_0x19a7ee){logger[_0x9831('0xf')](_0x9831('0x36'),_0x19a7ee[_0x9831('0x11')]);_0x46b6f0(_0x2deead[_0x9831('0xf')](0x1f4,_0x19a7ee['message']));});});}; \ No newline at end of file +var _0xae64=['field','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','entity','dialGlobalMaxRetry','OrderBy','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','catch','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','sequelize','update','IncrementPreviewCounters'];(function(_0x4bb055,_0x48257a){var _0x2ab87e=function(_0x4afb40){while(--_0x4afb40){_0x4bb055['push'](_0x4bb055['shift']());}};_0x2ab87e(++_0x48257a);}(_0xae64,0x190));var _0x4ae6=function(_0xf1aa01,_0x477960){_0xf1aa01=_0xf1aa01-0x0;var _0x2e8946=_0xae64[_0xf1aa01];return _0x2e8946;};'use strict';var _=require(_0x4ae6('0x0'));var util=require('util');var moment=require(_0x4ae6('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ae6('0x2'));var fs=require('fs');var Redis=require(_0x4ae6('0x3'));var db=require(_0x4ae6('0x4'))['db'];var utils=require(_0x4ae6('0x5'));var logger=require(_0x4ae6('0x6'))(_0x4ae6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4ae6('0x8')][_0x4ae6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a179b,_0x4f3764,_0x528552){return new BPromise(function(_0x203170,_0x542990){return client[_0x4ae6('0xa')](_0x4a179b,_0x528552)[_0x4ae6('0xb')](function(_0x19f9fb){logger[_0x4ae6('0xc')](_0x4ae6('0xd'),_0x4f3764,_0x4ae6('0xe'));logger[_0x4ae6('0xf')](_0x4ae6('0x10'),_0x4f3764,'request\x20sent',JSON['stringify'](_0x19f9fb));if(_0x19f9fb[_0x4ae6('0x11')]){if(_0x19f9fb[_0x4ae6('0x11')][_0x4ae6('0x12')]===0x1f4){logger[_0x4ae6('0x11')](_0x4ae6('0xd'),_0x4f3764,_0x19f9fb[_0x4ae6('0x11')][_0x4ae6('0x13')]);return _0x542990(_0x19f9fb[_0x4ae6('0x11')][_0x4ae6('0x13')]);}logger['error'](_0x4ae6('0xd'),_0x4f3764,_0x19f9fb['error']['message']);return _0x203170(_0x19f9fb['error'][_0x4ae6('0x13')]);}else{logger[_0x4ae6('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4f3764,_0x4ae6('0xe'));_0x203170(_0x19f9fb[_0x4ae6('0x14')][_0x4ae6('0x13')]);}})['catch'](function(_0x5445fa){logger[_0x4ae6('0x11')](_0x4ae6('0xd'),_0x4f3764,_0x5445fa);_0x542990(_0x5445fa);});});}exports[_0x4ae6('0x15')]=function(_0xb096fe){var _0x4d4dad=this;return new Promise(function(_0x550f6b,_0x26a0a3){return db[_0x4ae6('0x16')][_0x4ae6('0x17')]({'raw':!![],'where':{'ContactId':_0xb096fe[_0x4ae6('0x18')][_0x4ae6('0x19')],'ListId':_0xb096fe['body'][_0x4ae6('0x1a')],'VoiceQueueId':_0xb096fe[_0x4ae6('0x18')][_0x4ae6('0x1b')]===undefined?null:_0xb096fe[_0x4ae6('0x18')][_0x4ae6('0x1b')],'CampaignId':_0xb096fe['body'][_0x4ae6('0x1c')]===undefined?null:_0xb096fe[_0x4ae6('0x18')][_0x4ae6('0x1c')]}})['then'](function(_0x5f4003){if(_0x5f4003!=null){return db[_0x4ae6('0x1d')][_0x4ae6('0x17')]({'raw':!![],'where':{'CmHopperId':_0x5f4003['id'],'OrderBy':{'$gt':_0x5f4003['OrderBy']}},'order':[['OrderBy',_0x4ae6('0x1e')]]})[_0x4ae6('0xb')](function(_0x4fe158){var _0x181da0=0x0;if(_0x4fe158){if(_0x4fe158['countbusyretry']+_0x4fe158[_0x4ae6('0x1f')]+_0x4fe158[_0x4ae6('0x20')]+_0x4fe158[_0x4ae6('0x21')]+_0x4fe158['countdropretry']+_0x4fe158[_0x4ae6('0x22')]+_0x4fe158['countmachineretry']+_0x4fe158['countagentrejectretry']<_0xb096fe[_0x4ae6('0x23')][_0x4ae6('0x24')])_0x181da0=0x1;_0x550f6b({'additional':_0x181da0});}else{return db[_0x4ae6('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5f4003['id']},'order':[[_0x4ae6('0x25'),_0x4ae6('0x1e')]]})[_0x4ae6('0xb')](function(_0x3e1af4){var _0x5e92ac=0x0;if(_0x3e1af4){if(_0x3e1af4[_0x4ae6('0x26')]+_0x3e1af4[_0x4ae6('0x1f')]+_0x3e1af4[_0x4ae6('0x20')]+_0x3e1af4[_0x4ae6('0x21')]+_0x3e1af4[_0x4ae6('0x27')]+_0x3e1af4[_0x4ae6('0x22')]+_0x3e1af4[_0x4ae6('0x28')]+_0x3e1af4[_0x4ae6('0x29')]<_0xb096fe[_0x4ae6('0x23')][_0x4ae6('0x24')])_0x5e92ac=0x1;_0x550f6b({'additional':_0x5e92ac});}else{_0x550f6b({'additional':0x0});}})[_0x4ae6('0x2a')](function(_0x19e460){logger['error']('VerifyAdditionalPhones',_0x19e460[_0x4ae6('0x13')]);_0x26a0a3(_0x4d4dad['error'](0x1f4,_0x19e460['message']));});}})[_0x4ae6('0x2a')](function(_0x4d791f){logger[_0x4ae6('0x11')](_0x4ae6('0x15'),_0x4d791f[_0x4ae6('0x13')]);_0x26a0a3(_0x4d4dad[_0x4ae6('0x11')](0x1f4,_0x4d791f['message']));});}else _0x550f6b({'additional':0x0});});});};exports[_0x4ae6('0x2b')]=function(_0x10430b){var _0xb69a8c=this;return new Promise(function(_0x137d3d,_0x1cc7b2){return db['CmHopper'][_0x4ae6('0x17')]({'raw':!![],'where':{'ContactId':_0x10430b['body'][_0x4ae6('0x19')],'ListId':_0x10430b[_0x4ae6('0x18')][_0x4ae6('0x1a')],'VoiceQueueId':_0x10430b[_0x4ae6('0x18')][_0x4ae6('0x1b')]===undefined?null:_0x10430b[_0x4ae6('0x18')][_0x4ae6('0x1b')],'CampaignId':_0x10430b[_0x4ae6('0x18')]['CampaignId']===undefined?null:_0x10430b[_0x4ae6('0x18')][_0x4ae6('0x1c')]}})[_0x4ae6('0xb')](function(_0x3fd908){if(_0x3fd908!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x3fd908['id'],'OrderBy':{'$gte':_0x3fd908['OrderBy']}},'order':[[_0x4ae6('0x25'),_0x4ae6('0x1e')]]})[_0x4ae6('0xb')](function(_0x323ca4){if(_0x323ca4)return activateAdditionalPhone(_0x3fd908,_0x10430b['body'],_0x323ca4,_0x10430b[_0x4ae6('0x2c')],_0x10430b[_0x4ae6('0x2d')])['then'](function(_0xe43e37){_0x137d3d(_0xe43e37);});else{return db[_0x4ae6('0x1d')][_0x4ae6('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3fd908['id']},'order':[[_0x4ae6('0x25'),_0x4ae6('0x1e')]]})[_0x4ae6('0xb')](function(_0x2b3aee){if(_0x2b3aee)return activateAdditionalPhone(_0x3fd908,_0x10430b[_0x4ae6('0x18')],_0x2b3aee,_0x10430b[_0x4ae6('0x2c')],_0x10430b[_0x4ae6('0x2d')])[_0x4ae6('0xb')](function(_0xf921f4){_0x137d3d(_0xf921f4);});else{_0x137d3d({'id':_0x3fd908['id'],'phone':''});}})['catch'](function(_0x2e1110){logger[_0x4ae6('0x11')]('VerifyAdditionalPhones',_0x2e1110[_0x4ae6('0x13')]);_0x1cc7b2(_0xb69a8c[_0x4ae6('0x11')](0x1f4,_0x2e1110[_0x4ae6('0x13')]));});}})[_0x4ae6('0x2a')](function(_0x2306d9){logger['error'](_0x4ae6('0x15'),_0x2306d9[_0x4ae6('0x13')]);_0x1cc7b2(_0xb69a8c[_0x4ae6('0x11')](0x1f4,_0x2306d9[_0x4ae6('0x13')]));});}else _0x137d3d(0x1);});});};function activateAdditionalPhone(_0x3cdab4,_0x560402,_0x4a79e2,_0x19acb0,_0x3d70aa){return new Promise(function(_0x43b1a5,_0x5d4afe){var _0x556330;if(_[_0x4ae6('0x2e')](_0x4a79e2[_0x4ae6('0x2f')])){_0x4a79e2[_0x4ae6('0x2f')]=moment();}if(moment()>moment(_0x4a79e2['scheduledat'])){_0x556330=moment()[_0x4ae6('0x30')](_0x3d70aa||0x3,_0x4ae6('0x31'));}else{if(_0x4a79e2['OrderBy']==0x0){_0x556330=moment(_0x4a79e2[_0x4ae6('0x2f')]);}else{_0x556330=moment()[_0x4ae6('0x30')](_0x3d70aa||0x3,'minutes');}}if(_[_0x4ae6('0x2e')](_0x556330)){_0x556330=moment()[_0x4ae6('0x30')](_0x3d70aa||0x3,'minutes');}var _0x435cc1={'phone':_0x3cdab4['phone'],'active':0x0,'OrderBy':_[_0x4ae6('0x2e')](_0x3cdab4['OrderBy'])?0x0:_0x3cdab4[_0x4ae6('0x25')],'scheduledat':moment()[_0x4ae6('0x30')](_0x19acb0||0x1,_0x4ae6('0x31')),'countbusyretry':_0x560402[_0x4ae6('0x26')],'countcongestionretry':_0x560402[_0x4ae6('0x1f')],'countnoanswerretry':_0x560402[_0x4ae6('0x20')],'countnosuchnumberretry':_0x560402['countnosuchnumberretry'],'countdropretry':_0x560402[_0x4ae6('0x27')],'countabandonedretry':_0x560402['countabandonedretry'],'countmachineretry':_0x560402['countmachineretry'],'countagentrejectretry':_0x560402[_0x4ae6('0x29')],'createdAt':_0x560402[_0x4ae6('0x32')],'updatedAt':_0x560402[_0x4ae6('0x33')]};var _0x595d6b={'CmHopperId':_0x3cdab4['id'],'phone':_0x4a79e2[_0x4ae6('0x34')],'active':0x0,'OrderBy':_[_0x4ae6('0x2e')](_0x4a79e2['OrderBy'])?0x0:_0x4a79e2[_0x4ae6('0x25')],'scheduledat':_0x556330,'countbusyretry':_0x4a79e2[_0x4ae6('0x26')],'countcongestionretry':_0x4a79e2[_0x4ae6('0x1f')],'countnoanswerretry':_0x4a79e2[_0x4ae6('0x20')],'countnosuchnumberretry':_0x4a79e2[_0x4ae6('0x21')],'countdropretry':_0x4a79e2[_0x4ae6('0x27')],'countabandonedretry':_0x4a79e2['countabandonedretry'],'countmachineretry':_0x4a79e2['countmachineretry'],'countagentrejectretry':_0x4a79e2[_0x4ae6('0x29')],'createdAt':_0x4a79e2[_0x4ae6('0x32')],'updatedAt':_0x4a79e2[_0x4ae6('0x33')]};return db[_0x4ae6('0x35')]['transaction'](function(_0xa25ed){return db[_0x4ae6('0x1d')][_0x4ae6('0x36')](_0x435cc1,{'where':{'id':_0x4a79e2['id']}},{'transaction':_0xa25ed})[_0x4ae6('0xb')](function(){return db[_0x4ae6('0x16')][_0x4ae6('0x36')](_0x595d6b,{'where':{'id':_0x3cdab4['id']}},{'transaction':_0xa25ed});});})['then'](function(_0xe6fc6d){_0x43b1a5({'id':_0x3cdab4['id'],'phone':_0x4a79e2[_0x4ae6('0x34')]});})[_0x4ae6('0x2a')](function(_0x3c9401){logger[_0x4ae6('0x11')]('activateAdditionalPhone',_0x3c9401[_0x4ae6('0x13')]);_0x5d4afe({'error':_0x3c9401[_0x4ae6('0x13')]});});});}exports[_0x4ae6('0x37')]=function(_0x59ecd8){var _0x597dd5=this;return new Promise(function(_0x4bf3dd,_0x144b0b){return db[_0x4ae6('0x16')]['update'](_0x59ecd8[_0x4ae6('0x18')][_0x4ae6('0x38')],{'where':{'id':_0x59ecd8[_0x4ae6('0x18')]['id']}})['then'](function(_0x1f4974){_0x4bf3dd(_0x1f4974);})[_0x4ae6('0x2a')](function(_0x5d3d79){logger[_0x4ae6('0x11')](_0x4ae6('0x37'),_0x5d3d79[_0x4ae6('0x13')]);_0x144b0b(_0x597dd5[_0x4ae6('0x11')](0x1f4,_0x5d3d79[_0x4ae6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 729dfd9..3ed274a 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 _0x6417=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','util'];(function(_0x183696,_0x24cab7){var _0x443073=function(_0x30bd26){while(--_0x30bd26){_0x183696['push'](_0x183696['shift']());}};_0x443073(++_0x24cab7);}(_0x6417,0x8f));var _0x7641=function(_0x4c975c,_0x3f71b6){_0x4c975c=_0x4c975c-0x0;var _0xf90e1f=_0x6417[_0x4c975c];return _0xf90e1f;};'use strict';var multer=require('multer');var util=require(_0x7641('0x0'));var path=require(_0x7641('0x1'));var timeout=require(_0x7641('0x2'));var express=require(_0x7641('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7641('0x4'));var interaction=require(_0x7641('0x5'));var config=require(_0x7641('0x6'));var controller=require(_0x7641('0x7'));router[_0x7641('0x8')]('/',auth[_0x7641('0x9')](),controller[_0x7641('0xa')]);router[_0x7641('0x8')](_0x7641('0xb'),auth[_0x7641('0x9')](),controller[_0x7641('0xc')]);router[_0x7641('0xd')]('/',auth['isAuthenticated'](),controller[_0x7641('0xe')]);router[_0x7641('0xf')](_0x7641('0xb'),auth[_0x7641('0x9')](),controller['update']);router[_0x7641('0x10')](_0x7641('0xb'),auth[_0x7641('0x9')](),controller['destroy']);module[_0x7641('0x11')]=router; \ No newline at end of file +var _0xc06e=['/:id','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0xdf7d3b,_0x474cea){var _0x675076=function(_0x605a85){while(--_0x605a85){_0xdf7d3b['push'](_0xdf7d3b['shift']());}};_0x675076(++_0x474cea);}(_0xc06e,0xd5));var _0xec06=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xc06e[_0x3b3210];return _0x5b5484;};'use strict';var multer=require(_0xec06('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec06('0x1'));var express=require(_0xec06('0x2'));var router=express[_0xec06('0x3')]();var fs_extra=require(_0xec06('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xec06('0x5'));var config=require(_0xec06('0x6'));var controller=require(_0xec06('0x7'));router[_0xec06('0x8')]('/',auth[_0xec06('0x9')](),controller[_0xec06('0xa')]);router['get']('/:id',auth[_0xec06('0x9')](),controller[_0xec06('0xb')]);router[_0xec06('0xc')]('/',auth['isAuthenticated'](),controller[_0xec06('0xd')]);router[_0xec06('0xe')](_0xec06('0xf'),auth[_0xec06('0x9')](),controller[_0xec06('0x10')]);router[_0xec06('0x11')](_0xec06('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xec06('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index d76f7cf..4549971 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 _0x78d3=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x578a71,_0x3d4b58){var _0x4a7ba4=function(_0x2ba440){while(--_0x2ba440){_0x578a71['push'](_0x578a71['shift']());}};_0x4a7ba4(++_0x3d4b58);}(_0x78d3,0x73));var _0x378d=function(_0x540cdd,_0x23d0c0){_0x540cdd=_0x540cdd-0x0;var _0x7ebe30=_0x78d3[_0x540cdd];return _0x7ebe30;};'use strict';var moment=require(_0x378d('0x0'));var Sequelize=require(_0x378d('0x1'));module[_0x378d('0x2')]={'phone':{'type':Sequelize[_0x378d('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x378d('0x4')],'unique':_0x378d('0x5')},'ListId':{'type':Sequelize[_0x378d('0x4')],'unique':_0x378d('0x5')},'VoiceQueueId':{'type':Sequelize[_0x378d('0x4')],'unique':_0x378d('0x5')}}; \ No newline at end of file +var _0x10dc=['STRING','contactListQueue','INTEGER','moment','sequelize'];(function(_0x1c712a,_0x41a447){var _0x39a74a=function(_0x2e9aaa){while(--_0x2e9aaa){_0x1c712a['push'](_0x1c712a['shift']());}};_0x39a74a(++_0x41a447);}(_0x10dc,0x107));var _0xc10d=function(_0x3e19fb,_0x3258e2){_0x3e19fb=_0x3e19fb-0x0;var _0x5b19bd=_0x10dc[_0x3e19fb];return _0x5b19bd;};'use strict';var moment=require(_0xc10d('0x0'));var Sequelize=require(_0xc10d('0x1'));module['exports']={'phone':{'type':Sequelize[_0xc10d('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc10d('0x3')},'ListId':{'type':Sequelize[_0xc10d('0x4')],'unique':_0xc10d('0x3')},'VoiceQueueId':{'type':Sequelize[_0xc10d('0x4')],'unique':_0xc10d('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 44e48e5..b237ce7 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 _0x031d=['offset','set','Content-Range','save','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','update','body','destroy','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','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x594f20,_0x19efe4){var _0x54f0bd=function(_0x15f6c2){while(--_0x15f6c2){_0x594f20['push'](_0x594f20['shift']());}};_0x54f0bd(++_0x19efe4);}(_0x031d,0x1b7));var _0xd031=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x031d[_0x4914e2];return _0x2dcd07;};'use strict';var emlformat=require(_0xd031('0x0'));var rimraf=require(_0xd031('0x1'));var zipdir=require(_0xd031('0x2'));var jsonpatch=require(_0xd031('0x3'));var rp=require(_0xd031('0x4'));var moment=require(_0xd031('0x5'));var BPromise=require(_0xd031('0x6'));var Mustache=require(_0xd031('0x7'));var util=require(_0xd031('0x8'));var path=require(_0xd031('0x9'));var sox=require(_0xd031('0xa'));var csv=require(_0xd031('0xb'));var ejs=require(_0xd031('0xc'));var fs=require('fs');var fs_extra=require(_0xd031('0xd'));var _=require(_0xd031('0xe'));var squel=require(_0xd031('0xf'));var crypto=require(_0xd031('0x10'));var jsforce=require(_0xd031('0x11'));var deskjs=require(_0xd031('0x12'));var toCsv=require(_0xd031('0xb'));var querystring=require(_0xd031('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd031('0x14'));var qs=require(_0xd031('0x15'));var as=require(_0xd031('0x16'));var hardwareService=require(_0xd031('0x17'));var logger=require(_0xd031('0x18'))(_0xd031('0x19'));var utils=require('../../config/utils');var config=require(_0xd031('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd031('0x1b'))['db'];function respondWithStatusCode(_0x5a775e,_0x28d256){_0x28d256=_0x28d256||0xcc;return function(_0x2df62f){if(_0x2df62f){return _0x5a775e[_0xd031('0x1c')](_0x28d256);}return _0x5a775e[_0xd031('0x1d')](_0x28d256)[_0xd031('0x1e')]();};}function respondWithResult(_0xe8d6a4,_0x32e4ec){_0x32e4ec=_0x32e4ec||0xc8;return function(_0x1d52a0){if(_0x1d52a0){return _0xe8d6a4[_0xd031('0x1d')](_0x32e4ec)[_0xd031('0x1f')](_0x1d52a0);}};}function respondWithFilteredResult(_0x4f4cc0,_0x16d2fe){return function(_0x1e748b){if(_0x1e748b){var _0x5a1e04=typeof _0x16d2fe['offset']===_0xd031('0x20')&&typeof _0x16d2fe[_0xd031('0x21')]===_0xd031('0x20');var _0xa34be8=_0x1e748b[_0xd031('0x22')];var _0x2b5f1d=_0x5a1e04?0x0:_0x16d2fe[_0xd031('0x23')];var _0x131fd6=_0x5a1e04?_0x1e748b[_0xd031('0x22')]:_0x16d2fe[_0xd031('0x23')]+_0x16d2fe[_0xd031('0x21')];var _0x1f9697;if(_0x131fd6>=_0xa34be8){_0x131fd6=_0xa34be8;_0x1f9697=0xc8;}else{_0x1f9697=0xce;}_0x4f4cc0[_0xd031('0x1d')](_0x1f9697);return _0x4f4cc0[_0xd031('0x24')](_0xd031('0x25'),_0x2b5f1d+'-'+_0x131fd6+'/'+_0xa34be8)[_0xd031('0x1f')](_0x1e748b);}return null;};}function patchUpdates(_0x375ac8){return function(_0x8fe3fd){try{jsonpatch['apply'](_0x8fe3fd,_0x375ac8,!![]);}catch(_0x2e38ef){return BPromise['reject'](_0x2e38ef);}return _0x8fe3fd[_0xd031('0x26')]();};}function saveUpdates(_0x1e8e30,_0x2aa05d){return function(_0x19d9a4){if(_0x19d9a4){return _0x19d9a4['update'](_0x1e8e30)[_0xd031('0x27')](function(_0x502bf8){return _0x502bf8;});}return null;};}function removeEntity(_0xee7940,_0x52fc5f){return function(_0x13bb21){if(_0x13bb21){return _0x13bb21['destroy']()[_0xd031('0x27')](function(){_0xee7940[_0xd031('0x1d')](0xcc)[_0xd031('0x1e')]();});}};}function handleEntityNotFound(_0x539c84,_0x191785){return function(_0x4cb64a){if(!_0x4cb64a){_0x539c84['sendStatus'](0x194);}return _0x4cb64a;};}function handleError(_0x2f3fe1,_0x11a72e){_0x11a72e=_0x11a72e||0x1f4;return function(_0x4be610){logger[_0xd031('0x28')](_0x4be610[_0xd031('0x29')]);if(_0x4be610['name']){delete _0x4be610[_0xd031('0x2a')];}_0x2f3fe1[_0xd031('0x1d')](_0x11a72e)[_0xd031('0x2b')](_0x4be610);};}exports[_0xd031('0x2c')]=function(_0x385211,_0x2e4ef8){var _0x5e41b8={},_0x326745={},_0x53e4a7={'count':0x0,'rows':[]};var _0x54d608=_[_0xd031('0x2d')](db[_0xd031('0x2e')][_0xd031('0x2f')],function(_0x43aacf){return{'name':_0x43aacf[_0xd031('0x30')],'type':_0x43aacf[_0xd031('0x31')][_0xd031('0x32')]};});_0x326745['model']=_[_0xd031('0x2d')](_0x54d608,_0xd031('0x2a'));_0x326745[_0xd031('0x33')]=_[_0xd031('0x34')](_0x385211[_0xd031('0x33')]);_0x326745['filters']=_[_0xd031('0x35')](_0x326745['model'],_0x326745[_0xd031('0x33')]);_0x5e41b8[_0xd031('0x36')]=_[_0xd031('0x35')](_0x326745[_0xd031('0x37')],qs[_0xd031('0x38')](_0x385211[_0xd031('0x33')][_0xd031('0x38')]));_0x5e41b8[_0xd031('0x36')]=_0x5e41b8[_0xd031('0x36')][_0xd031('0x39')]?_0x5e41b8[_0xd031('0x36')]:_0x326745[_0xd031('0x37')];if(!_0x385211[_0xd031('0x33')][_0xd031('0x3a')]('nolimit')){_0x5e41b8[_0xd031('0x21')]=qs[_0xd031('0x21')](_0x385211[_0xd031('0x33')]['limit']);_0x5e41b8['offset']=qs[_0xd031('0x23')](_0x385211[_0xd031('0x33')][_0xd031('0x23')]);}_0x5e41b8[_0xd031('0x3b')]=qs[_0xd031('0x3c')](_0x385211[_0xd031('0x33')][_0xd031('0x3c')]);_0x5e41b8['where']=qs[_0xd031('0x3d')](_[_0xd031('0x3e')](_0x385211[_0xd031('0x33')],_0x326745['filters']),_0x54d608);if(_0x385211[_0xd031('0x33')]['filter']){_0x5e41b8[_0xd031('0x3f')]=_[_0xd031('0x40')](_0x5e41b8['where'],{'$or':_['map'](_0x54d608,function(_0x3f2dcb){if(_0x3f2dcb['type']!==_0xd031('0x41')){var _0x2f6878={};_0x2f6878[_0x3f2dcb[_0xd031('0x2a')]]={'$like':'%'+_0x385211[_0xd031('0x33')][_0xd031('0x42')]+'%'};return _0x2f6878;}})});}_0x5e41b8=_[_0xd031('0x40')]({},_0x5e41b8,_0x385211['options']);var _0x4763c4={'where':_0x5e41b8[_0xd031('0x3f')]};return db['CmHopperBlack'][_0xd031('0x22')](_0x4763c4)[_0xd031('0x27')](function(_0x336fac){_0x53e4a7[_0xd031('0x22')]=_0x336fac;if(_0x385211['query'][_0xd031('0x43')]){_0x5e41b8[_0xd031('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd031('0x45')](_0x5e41b8);})[_0xd031('0x27')](function(_0x408c72){_0x53e4a7['rows']=_0x408c72;return _0x53e4a7;})[_0xd031('0x27')](respondWithFilteredResult(_0x2e4ef8,_0x5e41b8))[_0xd031('0x46')](handleError(_0x2e4ef8,null));};exports[_0xd031('0x47')]=function(_0x1ca8d5,_0x2b1655){var _0x2e9046={'raw':!![],'where':{'id':_0x1ca8d5[_0xd031('0x48')]['id']}},_0x196f5a={};_0x196f5a[_0xd031('0x37')]=_['keys'](db[_0xd031('0x2e')]['rawAttributes']);_0x196f5a['query']=_[_0xd031('0x34')](_0x1ca8d5['query']);_0x196f5a[_0xd031('0x3d')]=_[_0xd031('0x35')](_0x196f5a[_0xd031('0x37')],_0x196f5a['query']);_0x2e9046[_0xd031('0x36')]=_[_0xd031('0x35')](_0x196f5a[_0xd031('0x37')],qs['fields'](_0x1ca8d5['query']['fields']));_0x2e9046[_0xd031('0x36')]=_0x2e9046[_0xd031('0x36')][_0xd031('0x39')]?_0x2e9046[_0xd031('0x36')]:_0x196f5a[_0xd031('0x37')];if(_0x1ca8d5[_0xd031('0x33')][_0xd031('0x43')]){_0x2e9046[_0xd031('0x44')]=[{'all':!![]}];}_0x2e9046=_[_0xd031('0x40')]({},_0x2e9046,_0x1ca8d5[_0xd031('0x49')]);return db[_0xd031('0x2e')][_0xd031('0x4a')](_0x2e9046)['then'](handleEntityNotFound(_0x2b1655,null))[_0xd031('0x27')](respondWithResult(_0x2b1655,null))['catch'](handleError(_0x2b1655,null));};exports[_0xd031('0x4b')]=function(_0x17765f,_0x17ba84){if(_0x17765f[_0xd031('0x4c')]['id']){delete _0x17765f[_0xd031('0x4c')]['id'];}return db[_0xd031('0x2e')][_0xd031('0x4a')]({'where':{'id':_0x17765f[_0xd031('0x48')]['id']}})[_0xd031('0x27')](handleEntityNotFound(_0x17ba84,null))[_0xd031('0x27')](saveUpdates(_0x17765f[_0xd031('0x4c')],null))[_0xd031('0x27')](respondWithResult(_0x17ba84,null))[_0xd031('0x46')](handleError(_0x17ba84,null));};exports[_0xd031('0x4d')]=function(_0x25cbd2,_0x5a5fd5){return db[_0xd031('0x2e')]['find']({'where':{'id':_0x25cbd2['params']['id']}})[_0xd031('0x27')](handleEntityNotFound(_0x5a5fd5,null))[_0xd031('0x27')](removeEntity(_0x5a5fd5,null))[_0xd031('0x46')](handleError(_0x5a5fd5,null));};exports[_0xd031('0x4e')]=function(_0x541aa1,_0x41a026){return db[_0xd031('0x2e')][_0xd031('0x4e')]()[_0xd031('0x27')](respondWithResult(_0x41a026,null))[_0xd031('0x46')](handleError(_0x41a026,null));}; \ No newline at end of file +var _0x7cce=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','key','model','query','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','find','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring'];(function(_0x212a42,_0x344899){var _0x1c06d0=function(_0x56a5bd){while(--_0x56a5bd){_0x212a42['push'](_0x212a42['shift']());}};_0x1c06d0(++_0x344899);}(_0x7cce,0x143));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe7cc('0x0'));var rimraf=require(_0xe7cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7cc('0x2'));var rp=require('request-promise');var moment=require(_0xe7cc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe7cc('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe7cc('0x5'));var csv=require(_0xe7cc('0x6'));var ejs=require(_0xe7cc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe7cc('0x8'));var jsforce=require(_0xe7cc('0x9'));var deskjs=require(_0xe7cc('0xa'));var toCsv=require(_0xe7cc('0x6'));var querystring=require(_0xe7cc('0xb'));var Papa=require(_0xe7cc('0xc'));var Redis=require('ioredis');var authService=require(_0xe7cc('0xd'));var qs=require(_0xe7cc('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7cc('0xf'))(_0xe7cc('0x10'));var utils=require(_0xe7cc('0x11'));var config=require(_0xe7cc('0x12'));var licenseUtil=require(_0xe7cc('0x13'));var db=require(_0xe7cc('0x14'))['db'];function respondWithStatusCode(_0x5eabdb,_0x42be0e){_0x42be0e=_0x42be0e||0xcc;return function(_0x465553){if(_0x465553){return _0x5eabdb[_0xe7cc('0x15')](_0x42be0e);}return _0x5eabdb['status'](_0x42be0e)[_0xe7cc('0x16')]();};}function respondWithResult(_0x3df276,_0x300536){_0x300536=_0x300536||0xc8;return function(_0x1e52f7){if(_0x1e52f7){return _0x3df276[_0xe7cc('0x17')](_0x300536)[_0xe7cc('0x18')](_0x1e52f7);}};}function respondWithFilteredResult(_0x4b7676,_0x2f7aec){return function(_0x4853ed){if(_0x4853ed){var _0x7d135c=typeof _0x2f7aec[_0xe7cc('0x19')]===_0xe7cc('0x1a')&&typeof _0x2f7aec[_0xe7cc('0x1b')]===_0xe7cc('0x1a');var _0x169587=_0x4853ed[_0xe7cc('0x1c')];var _0x5e9307=_0x7d135c?0x0:_0x2f7aec[_0xe7cc('0x19')];var _0x1a67e2=_0x7d135c?_0x4853ed[_0xe7cc('0x1c')]:_0x2f7aec[_0xe7cc('0x19')]+_0x2f7aec[_0xe7cc('0x1b')];var _0xfcd6ab;if(_0x1a67e2>=_0x169587){_0x1a67e2=_0x169587;_0xfcd6ab=0xc8;}else{_0xfcd6ab=0xce;}_0x4b7676[_0xe7cc('0x17')](_0xfcd6ab);return _0x4b7676['set']('Content-Range',_0x5e9307+'-'+_0x1a67e2+'/'+_0x169587)[_0xe7cc('0x18')](_0x4853ed);}return null;};}function patchUpdates(_0x1449d6){return function(_0x37b4bc){try{jsonpatch['apply'](_0x37b4bc,_0x1449d6,!![]);}catch(_0x348c1b){return BPromise[_0xe7cc('0x1d')](_0x348c1b);}return _0x37b4bc['save']();};}function saveUpdates(_0xac2eca,_0x42a079){return function(_0x83edd5){if(_0x83edd5){return _0x83edd5[_0xe7cc('0x1e')](_0xac2eca)[_0xe7cc('0x1f')](function(_0x13f1d2){return _0x13f1d2;});}return null;};}function removeEntity(_0x23805b,_0x263aac){return function(_0x519772){if(_0x519772){return _0x519772[_0xe7cc('0x20')]()[_0xe7cc('0x1f')](function(){_0x23805b[_0xe7cc('0x17')](0xcc)[_0xe7cc('0x16')]();});}};}function handleEntityNotFound(_0x53a875,_0x13018b){return function(_0x591b8a){if(!_0x591b8a){_0x53a875[_0xe7cc('0x15')](0x194);}return _0x591b8a;};}function handleError(_0x1d780b,_0x5a0ef0){_0x5a0ef0=_0x5a0ef0||0x1f4;return function(_0x1e855d){logger[_0xe7cc('0x21')](_0x1e855d[_0xe7cc('0x22')]);if(_0x1e855d[_0xe7cc('0x23')]){delete _0x1e855d[_0xe7cc('0x23')];}_0x1d780b[_0xe7cc('0x17')](_0x5a0ef0)[_0xe7cc('0x24')](_0x1e855d);};}exports[_0xe7cc('0x25')]=function(_0x3566ce,_0x3ab18b){var _0x175845={},_0x11206b={},_0x579813={'count':0x0,'rows':[]};var _0x2db99b=_[_0xe7cc('0x26')](db[_0xe7cc('0x27')][_0xe7cc('0x28')],function(_0x335861){return{'name':_0x335861['fieldName'],'type':_0x335861['type'][_0xe7cc('0x29')]};});_0x11206b[_0xe7cc('0x2a')]=_[_0xe7cc('0x26')](_0x2db99b,_0xe7cc('0x23'));_0x11206b[_0xe7cc('0x2b')]=_['keys'](_0x3566ce[_0xe7cc('0x2b')]);_0x11206b['filters']=_[_0xe7cc('0x2c')](_0x11206b[_0xe7cc('0x2a')],_0x11206b['query']);_0x175845[_0xe7cc('0x2d')]=_[_0xe7cc('0x2c')](_0x11206b['model'],qs[_0xe7cc('0x2e')](_0x3566ce[_0xe7cc('0x2b')]['fields']));_0x175845[_0xe7cc('0x2d')]=_0x175845[_0xe7cc('0x2d')][_0xe7cc('0x2f')]?_0x175845['attributes']:_0x11206b['model'];if(!_0x3566ce[_0xe7cc('0x2b')]['hasOwnProperty']('nolimit')){_0x175845[_0xe7cc('0x1b')]=qs['limit'](_0x3566ce[_0xe7cc('0x2b')][_0xe7cc('0x1b')]);_0x175845[_0xe7cc('0x19')]=qs[_0xe7cc('0x19')](_0x3566ce[_0xe7cc('0x2b')][_0xe7cc('0x19')]);}_0x175845['order']=qs[_0xe7cc('0x30')](_0x3566ce[_0xe7cc('0x2b')]['sort']);_0x175845[_0xe7cc('0x31')]=qs[_0xe7cc('0x32')](_[_0xe7cc('0x33')](_0x3566ce[_0xe7cc('0x2b')],_0x11206b['filters']),_0x2db99b);if(_0x3566ce[_0xe7cc('0x2b')][_0xe7cc('0x34')]){_0x175845['where']=_[_0xe7cc('0x35')](_0x175845['where'],{'$or':_[_0xe7cc('0x26')](_0x2db99b,function(_0x1ebaa2){if(_0x1ebaa2[_0xe7cc('0x36')]!==_0xe7cc('0x37')){var _0xa4452a={};_0xa4452a[_0x1ebaa2[_0xe7cc('0x23')]]={'$like':'%'+_0x3566ce['query']['filter']+'%'};return _0xa4452a;}})});}_0x175845=_[_0xe7cc('0x35')]({},_0x175845,_0x3566ce[_0xe7cc('0x38')]);var _0x13ab3f={'where':_0x175845[_0xe7cc('0x31')]};return db[_0xe7cc('0x27')][_0xe7cc('0x1c')](_0x13ab3f)[_0xe7cc('0x1f')](function(_0x13b681){_0x579813[_0xe7cc('0x1c')]=_0x13b681;if(_0x3566ce[_0xe7cc('0x2b')][_0xe7cc('0x39')]){_0x175845['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xe7cc('0x3a')](_0x175845);})[_0xe7cc('0x1f')](function(_0x181bc4){_0x579813[_0xe7cc('0x3b')]=_0x181bc4;return _0x579813;})[_0xe7cc('0x1f')](respondWithFilteredResult(_0x3ab18b,_0x175845))[_0xe7cc('0x3c')](handleError(_0x3ab18b,null));};exports['show']=function(_0x3ff6d1,_0x1d0761){var _0x512cfb={'raw':!![],'where':{'id':_0x3ff6d1[_0xe7cc('0x3d')]['id']}},_0x6766e6={};_0x6766e6['model']=_[_0xe7cc('0x3e')](db[_0xe7cc('0x27')][_0xe7cc('0x28')]);_0x6766e6[_0xe7cc('0x2b')]=_[_0xe7cc('0x3e')](_0x3ff6d1[_0xe7cc('0x2b')]);_0x6766e6['filters']=_[_0xe7cc('0x2c')](_0x6766e6[_0xe7cc('0x2a')],_0x6766e6[_0xe7cc('0x2b')]);_0x512cfb[_0xe7cc('0x2d')]=_[_0xe7cc('0x2c')](_0x6766e6[_0xe7cc('0x2a')],qs[_0xe7cc('0x2e')](_0x3ff6d1[_0xe7cc('0x2b')][_0xe7cc('0x2e')]));_0x512cfb[_0xe7cc('0x2d')]=_0x512cfb[_0xe7cc('0x2d')][_0xe7cc('0x2f')]?_0x512cfb['attributes']:_0x6766e6[_0xe7cc('0x2a')];if(_0x3ff6d1['query'][_0xe7cc('0x39')]){_0x512cfb[_0xe7cc('0x3f')]=[{'all':!![]}];}_0x512cfb=_[_0xe7cc('0x35')]({},_0x512cfb,_0x3ff6d1[_0xe7cc('0x38')]);return db['CmHopperBlack'][_0xe7cc('0x40')](_0x512cfb)[_0xe7cc('0x1f')](handleEntityNotFound(_0x1d0761,null))[_0xe7cc('0x1f')](respondWithResult(_0x1d0761,null))['catch'](handleError(_0x1d0761,null));};exports[_0xe7cc('0x1e')]=function(_0x23ad66,_0x20c795){if(_0x23ad66[_0xe7cc('0x41')]['id']){delete _0x23ad66[_0xe7cc('0x41')]['id'];}return db[_0xe7cc('0x27')]['find']({'where':{'id':_0x23ad66[_0xe7cc('0x3d')]['id']}})[_0xe7cc('0x1f')](handleEntityNotFound(_0x20c795,null))[_0xe7cc('0x1f')](saveUpdates(_0x23ad66[_0xe7cc('0x41')],null))[_0xe7cc('0x1f')](respondWithResult(_0x20c795,null))['catch'](handleError(_0x20c795,null));};exports[_0xe7cc('0x20')]=function(_0x4a35cf,_0x456799){return db[_0xe7cc('0x27')][_0xe7cc('0x40')]({'where':{'id':_0x4a35cf['params']['id']}})['then'](handleEntityNotFound(_0x456799,null))['then'](removeEntity(_0x456799,null))[_0xe7cc('0x3c')](handleError(_0x456799,null));};exports[_0xe7cc('0x42')]=function(_0x9a344,_0x407883){return db[_0xe7cc('0x27')]['describe']()[_0xe7cc('0x1f')](respondWithResult(_0x407883,null))[_0xe7cc('0x3c')](handleError(_0x407883,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 26ea6cc..8a1e54f 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 _0xc6b9=['rimraf','./cmHopperBlack.attributes','exports','define','cm_hopper_black','util','../../config/logger','bluebird','path'];(function(_0xbc22ee,_0x56f8fc){var _0x3f8fbb=function(_0x421aff){while(--_0x421aff){_0xbc22ee['push'](_0xbc22ee['shift']());}};_0x3f8fbb(++_0x56f8fc);}(_0xc6b9,0x191));var _0x9c6b=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xc6b9[_0x382a62];return _0x490a25;};'use strict';var _=require('lodash');var util=require(_0x9c6b('0x0'));var logger=require(_0x9c6b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9c6b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c6b('0x3'));var rimraf=require(_0x9c6b('0x4'));var config=require('../../config/environment');var attributes=require(_0x9c6b('0x5'));module[_0x9c6b('0x6')]=function(_0x192f63,_0x3796c1){return _0x192f63[_0x9c6b('0x7')]('CmHopperBlack',attributes,{'tableName':_0x9c6b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4996=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0x4996,0x95));var _0x6499=function(_0x2ed6ae,_0x4f257d){_0x2ed6ae=_0x2ed6ae-0x0;var _0x2461a0=_0x4996[_0x2ed6ae];return _0x2461a0;};'use strict';var _=require(_0x6499('0x0'));var util=require(_0x6499('0x1'));var logger=require(_0x6499('0x2'))(_0x6499('0x3'));var moment=require(_0x6499('0x4'));var BPromise=require('bluebird');var rp=require(_0x6499('0x5'));var fs=require('fs');var path=require(_0x6499('0x6'));var rimraf=require(_0x6499('0x7'));var config=require(_0x6499('0x8'));var attributes=require(_0x6499('0x9'));module[_0x6499('0xa')]=function(_0x15242a,_0xfc23f8){return _0x15242a['define'](_0x6499('0xb'),attributes,{'tableName':_0x6499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 01bf036..0309c0e 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 _0x9c01=['catch','GetCmHopperBlack','CmHopperBlack','options','raw','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result'];(function(_0x153a4d,_0x2b1c7b){var _0x5979e5=function(_0x4de9c1){while(--_0x4de9c1){_0x153a4d['push'](_0x153a4d['shift']());}};_0x5979e5(++_0x2b1c7b);}(_0x9c01,0x138));var _0x19c0=function(_0xb2bd84,_0x331891){_0xb2bd84=_0xb2bd84-0x0;var _0x25157a=_0x9c01[_0xb2bd84];return _0x25157a;};'use strict';var _=require(_0x19c0('0x0'));var util=require(_0x19c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x19c0('0x2'));var fs=require('fs');var Redis=require(_0x19c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x19c0('0x4'));var logger=require(_0x19c0('0x5'))(_0x19c0('0x6'));var config=require('../../config/environment');var jayson=require(_0x19c0('0x7'));var client=jayson[_0x19c0('0x8')][_0x19c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41c93e,_0x58007e,_0x5a0246){return new BPromise(function(_0x31e567,_0x52a272){return client[_0x19c0('0xa')](_0x41c93e,_0x5a0246)[_0x19c0('0xb')](function(_0x409b93){logger[_0x19c0('0xc')](_0x19c0('0xd'),_0x58007e,'request\x20sent');logger[_0x19c0('0xe')](_0x19c0('0xf'),_0x58007e,'request\x20sent',JSON['stringify'](_0x409b93));if(_0x409b93[_0x19c0('0x10')]){if(_0x409b93['error'][_0x19c0('0x11')]===0x1f4){logger[_0x19c0('0x10')](_0x19c0('0xd'),_0x58007e,_0x409b93[_0x19c0('0x10')][_0x19c0('0x12')]);return _0x52a272(_0x409b93[_0x19c0('0x10')][_0x19c0('0x12')]);}logger['error'](_0x19c0('0xd'),_0x58007e,_0x409b93[_0x19c0('0x10')][_0x19c0('0x12')]);return _0x31e567(_0x409b93['error'][_0x19c0('0x12')]);}else{logger[_0x19c0('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x58007e,_0x19c0('0x13'));_0x31e567(_0x409b93[_0x19c0('0x14')][_0x19c0('0x12')]);}})[_0x19c0('0x15')](function(_0x3fc0d5){logger[_0x19c0('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x58007e,_0x3fc0d5);_0x52a272(_0x3fc0d5);});});}exports[_0x19c0('0x16')]=function(_0x3fabd2){var _0x58916d=this;return new Promise(function(_0x48b041,_0x2bc8f8){return db[_0x19c0('0x17')]['findAll']({'raw':_0x3fabd2[_0x19c0('0x18')]?_0x3fabd2[_0x19c0('0x18')][_0x19c0('0x19')]===undefined?!![]:![]:!![],'where':_0x3fabd2[_0x19c0('0x18')]?_0x3fabd2[_0x19c0('0x18')]['where']||null:null,'attributes':_0x3fabd2[_0x19c0('0x18')]?_0x3fabd2[_0x19c0('0x18')][_0x19c0('0x1a')]||null:null,'limit':_0x3fabd2[_0x19c0('0x18')]?_0x3fabd2['options'][_0x19c0('0x1b')]||null:null,'include':_0x3fabd2['options']?_0x3fabd2[_0x19c0('0x18')][_0x19c0('0x1c')]?_[_0x19c0('0x1d')](_0x3fabd2[_0x19c0('0x18')][_0x19c0('0x1c')],function(_0x1e066f){return{'model':db[_0x1e066f[_0x19c0('0x1e')]],'as':_0x1e066f['as'],'attributes':_0x1e066f['attributes'],'include':_0x1e066f[_0x19c0('0x1c')]?_[_0x19c0('0x1d')](_0x1e066f[_0x19c0('0x1c')],function(_0x50a9dd){return{'model':db[_0x50a9dd['model']],'as':_0x50a9dd['as'],'attributes':_0x50a9dd['attributes'],'include':_0x50a9dd[_0x19c0('0x1c')]?_[_0x19c0('0x1d')](_0x50a9dd[_0x19c0('0x1c')],function(_0x34f72d){return{'model':db[_0x34f72d[_0x19c0('0x1e')]],'as':_0x34f72d['as'],'attributes':_0x34f72d[_0x19c0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x19c0('0xb')](function(_0x63c411){logger[_0x19c0('0xc')](_0x19c0('0x16'),_0x3fabd2);logger['debug'](_0x19c0('0x16'),_0x3fabd2,JSON[_0x19c0('0x1f')](_0x63c411));_0x48b041(_0x63c411);})[_0x19c0('0x15')](function(_0x3d2efe){logger[_0x19c0('0x10')](_0x19c0('0x16'),_0x3d2efe[_0x19c0('0x12')],_0x3fabd2);_0x2bc8f8(_0x58916d[_0x19c0('0x10')](0x1f4,_0x3d2efe[_0x19c0('0x12')]));});});};exports[_0x19c0('0x20')]=function(_0x29f5e6){var _0x59ed77=this;return new Promise(function(_0x5e624,_0x506bc6){return db[_0x19c0('0x17')][_0x19c0('0x21')](_0x29f5e6[_0x19c0('0x22')],{'raw':_0x29f5e6[_0x19c0('0x18')]?_0x29f5e6[_0x19c0('0x18')][_0x19c0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29f5e6[_0x19c0('0x18')]?_0x29f5e6[_0x19c0('0x18')]['where']||null:null,'attributes':_0x29f5e6[_0x19c0('0x18')]?_0x29f5e6[_0x19c0('0x18')][_0x19c0('0x1a')]||null:null,'limit':_0x29f5e6[_0x19c0('0x18')]?_0x29f5e6[_0x19c0('0x18')][_0x19c0('0x1b')]||null:null})[_0x19c0('0xb')](function(_0x2c469a){logger[_0x19c0('0xc')]('UpdateCmHopperBlack',_0x29f5e6);logger[_0x19c0('0xe')](_0x19c0('0x20'),_0x29f5e6,JSON['stringify'](_0x2c469a));_0x5e624(_0x2c469a);})[_0x19c0('0x15')](function(_0x5a79ff){logger[_0x19c0('0x10')](_0x19c0('0x20'),_0x5a79ff[_0x19c0('0x12')],_0x29f5e6);_0x506bc6(_0x59ed77[_0x19c0('0x10')](0x1f4,_0x5a79ff[_0x19c0('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x5280a8){var _0x4aa4c4=this;return new Promise(function(_0x1e1c47,_0x167378){return db[_0x19c0('0x17')]['destroy']({'where':_0x5280a8['options']?_0x5280a8[_0x19c0('0x18')][_0x19c0('0x23')]||null:null})[_0x19c0('0xb')](function(_0x3df0af){logger['info'](_0x19c0('0x24'),_0x5280a8);logger[_0x19c0('0xe')](_0x19c0('0x24'),_0x5280a8,JSON['stringify'](_0x3df0af));_0x1e1c47(_0x3df0af);})[_0x19c0('0x15')](function(_0x2a5db1){logger['error'](_0x19c0('0x24'),_0x2a5db1[_0x19c0('0x12')],_0x5280a8);_0x167378(_0x4aa4c4[_0x19c0('0x10')](0x1f4,_0x2a5db1[_0x19c0('0x12')]));});});}; \ No newline at end of file +var _0x6f88=['error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','map','include','model','attributes','then','debug','stringify','update','body','limit','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent'];(function(_0x410058,_0xca4c1e){var _0xf52fe4=function(_0x48879d){while(--_0x48879d){_0x410058['push'](_0x410058['shift']());}};_0xf52fe4(++_0xca4c1e);}(_0x6f88,0x1c5));var _0x86f8=function(_0x486be1,_0x3fdf5e){_0x486be1=_0x486be1-0x0;var _0x586fa1=_0x6f88[_0x486be1];return _0x586fa1;};'use strict';var _=require(_0x86f8('0x0'));var util=require(_0x86f8('0x1'));var moment=require(_0x86f8('0x2'));var BPromise=require(_0x86f8('0x3'));var rs=require(_0x86f8('0x4'));var fs=require('fs');var Redis=require(_0x86f8('0x5'));var db=require(_0x86f8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x86f8('0x7'))(_0x86f8('0x8'));var config=require(_0x86f8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x86f8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa9e72b,_0x63e2b6,_0xbc2805){return new BPromise(function(_0x504c87,_0x9787fb){return client[_0x86f8('0xb')](_0xa9e72b,_0xbc2805)['then'](function(_0x18bc13){logger[_0x86f8('0xc')](_0x86f8('0xd'),_0x63e2b6,_0x86f8('0xe'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x63e2b6,_0x86f8('0xe'),JSON['stringify'](_0x18bc13));if(_0x18bc13[_0x86f8('0xf')]){if(_0x18bc13[_0x86f8('0xf')][_0x86f8('0x10')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x63e2b6,_0x18bc13[_0x86f8('0xf')][_0x86f8('0x11')]);return _0x9787fb(_0x18bc13[_0x86f8('0xf')][_0x86f8('0x11')]);}logger[_0x86f8('0xf')](_0x86f8('0xd'),_0x63e2b6,_0x18bc13[_0x86f8('0xf')]['message']);return _0x504c87(_0x18bc13[_0x86f8('0xf')][_0x86f8('0x11')]);}else{logger[_0x86f8('0xc')](_0x86f8('0xd'),_0x63e2b6,'request\x20sent');_0x504c87(_0x18bc13['result'][_0x86f8('0x11')]);}})[_0x86f8('0x12')](function(_0x1ca4f4){logger[_0x86f8('0xf')](_0x86f8('0xd'),_0x63e2b6,_0x1ca4f4);_0x9787fb(_0x1ca4f4);});});}exports[_0x86f8('0x13')]=function(_0x3ce14d){var _0x303f9c=this;return new Promise(function(_0x1801c1,_0xad84cc){return db[_0x86f8('0x14')]['findAll']({'raw':_0x3ce14d[_0x86f8('0x15')]?_0x3ce14d[_0x86f8('0x15')][_0x86f8('0x16')]===undefined?!![]:![]:!![],'where':_0x3ce14d[_0x86f8('0x15')]?_0x3ce14d[_0x86f8('0x15')][_0x86f8('0x17')]||null:null,'attributes':_0x3ce14d[_0x86f8('0x15')]?_0x3ce14d['options']['attributes']||null:null,'limit':_0x3ce14d['options']?_0x3ce14d['options']['limit']||null:null,'include':_0x3ce14d[_0x86f8('0x15')]?_0x3ce14d['options']['include']?_[_0x86f8('0x18')](_0x3ce14d[_0x86f8('0x15')][_0x86f8('0x19')],function(_0x95a94d){return{'model':db[_0x95a94d[_0x86f8('0x1a')]],'as':_0x95a94d['as'],'attributes':_0x95a94d['attributes'],'include':_0x95a94d[_0x86f8('0x19')]?_['map'](_0x95a94d[_0x86f8('0x19')],function(_0x102089){return{'model':db[_0x102089[_0x86f8('0x1a')]],'as':_0x102089['as'],'attributes':_0x102089[_0x86f8('0x1b')],'include':_0x102089[_0x86f8('0x19')]?_[_0x86f8('0x18')](_0x102089['include'],function(_0x3566e3){return{'model':db[_0x3566e3[_0x86f8('0x1a')]],'as':_0x3566e3['as'],'attributes':_0x3566e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x86f8('0x1c')](function(_0x13d637){logger['info'](_0x86f8('0x13'),_0x3ce14d);logger[_0x86f8('0x1d')](_0x86f8('0x13'),_0x3ce14d,JSON[_0x86f8('0x1e')](_0x13d637));_0x1801c1(_0x13d637);})[_0x86f8('0x12')](function(_0x5e3af9){logger[_0x86f8('0xf')](_0x86f8('0x13'),_0x5e3af9['message'],_0x3ce14d);_0xad84cc(_0x303f9c[_0x86f8('0xf')](0x1f4,_0x5e3af9[_0x86f8('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x45e003){var _0x3b9a3d=this;return new Promise(function(_0x50a223,_0x3a601b){return db[_0x86f8('0x14')][_0x86f8('0x1f')](_0x45e003[_0x86f8('0x20')],{'raw':_0x45e003['options']?_0x45e003['options'][_0x86f8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45e003[_0x86f8('0x15')]?_0x45e003[_0x86f8('0x15')]['where']||null:null,'attributes':_0x45e003[_0x86f8('0x15')]?_0x45e003[_0x86f8('0x15')][_0x86f8('0x1b')]||null:null,'limit':_0x45e003[_0x86f8('0x15')]?_0x45e003[_0x86f8('0x15')][_0x86f8('0x21')]||null:null})[_0x86f8('0x1c')](function(_0x2def2d){logger[_0x86f8('0xc')]('UpdateCmHopperBlack',_0x45e003);logger['debug']('UpdateCmHopperBlack',_0x45e003,JSON[_0x86f8('0x1e')](_0x2def2d));_0x50a223(_0x2def2d);})[_0x86f8('0x12')](function(_0x1c5183){logger[_0x86f8('0xf')]('UpdateCmHopperBlack',_0x1c5183[_0x86f8('0x11')],_0x45e003);_0x3a601b(_0x3b9a3d[_0x86f8('0xf')](0x1f4,_0x1c5183[_0x86f8('0x11')]));});});};exports['DestroyCmHopperBlack']=function(_0x283808){var _0x407c3d=this;return new Promise(function(_0x46d423,_0x529017){return db[_0x86f8('0x14')][_0x86f8('0x22')]({'where':_0x283808[_0x86f8('0x15')]?_0x283808['options'][_0x86f8('0x17')]||null:null})[_0x86f8('0x1c')](function(_0x5061fe){logger[_0x86f8('0xc')]('DestroyCmHopperBlack',_0x283808);logger['debug'](_0x86f8('0x23'),_0x283808,JSON[_0x86f8('0x1e')](_0x5061fe));_0x46d423(_0x5061fe);})[_0x86f8('0x12')](function(_0x248dda){logger[_0x86f8('0xf')]('DestroyCmHopperBlack',_0x248dda[_0x86f8('0x11')],_0x283808);_0x529017(_0x407c3d[_0x86f8('0xf')](0x1f4,_0x248dda['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 183bc14..001ef6b 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 _0xb145=['update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x316ddd,_0x296f7e){var _0x176e00=function(_0xd5fb45){while(--_0xd5fb45){_0x316ddd['push'](_0x316ddd['shift']());}};_0x176e00(++_0x296f7e);}(_0xb145,0xa3));var _0x5b14=function(_0x647993,_0x2158b8){_0x647993=_0x647993-0x0;var _0x522a1c=_0xb145[_0x647993];return _0x522a1c;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xe'),auth[_0x5b14('0xa')](),controller['destroy']);module[_0x5b14('0x13')]=router; \ No newline at end of file +var _0x5d17=['index','/describe','isAuthenticated','describe','/:id','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x813d0a,_0x4fd3d7){var _0x241352=function(_0x3ca375){while(--_0x3ca375){_0x813d0a['push'](_0x813d0a['shift']());}};_0x241352(++_0x4fd3d7);}(_0x5d17,0x114));var _0x75d1=function(_0x177cc9,_0x3f6fdd){_0x177cc9=_0x177cc9-0x0;var _0x2fe577=_0x5d17[_0x177cc9];return _0x2fe577;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x75d1('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0xf')]);router[_0x75d1('0x10')]('/:id',auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);module[_0x75d1('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 34db938..97fe84f 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 _0x0b2b=['INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','seconds','BOOLEAN','sequelize','exports'];(function(_0x1e53ca,_0x2692ed){var _0x55e658=function(_0x2194c5){while(--_0x2194c5){_0x1e53ca['push'](_0x1e53ca['shift']());}};_0x55e658(++_0x2692ed);}(_0x0b2b,0x17f));var _0xb0b2=function(_0x3cd44a,_0x1df82a){_0x3cd44a=_0x3cd44a-0x0;var _0x5682bb=_0x0b2b[_0x3cd44a];return _0x5682bb;};'use strict';var Sequelize=require(_0xb0b2('0x0'));var moment=require('moment');module[_0xb0b2('0x1')]={'state':{'type':Sequelize[_0xb0b2('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb0b2('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb0b2('0x4')]},'answertime':{'type':Sequelize[_0xb0b2('0x4')]},'droptime':{'type':Sequelize[_0xb0b2('0x4')]},'endtime':{'type':Sequelize[_0xb0b2('0x4')]},'ringtime':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb0b2('0x3')]},'membername':{'type':Sequelize[_0xb0b2('0x3')]},'reason':{'type':Sequelize[_0xb0b2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb0b2('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xb0b2('0x4')],'set':function(_0x3bbbc9){var _0x435367=this[_0xb0b2('0x5')](_0xb0b2('0x6'));if(_0x435367&&_0x3bbbc9){this['setDataValue'](_0xb0b2('0x7'),moment(_0x3bbbc9)[_0xb0b2('0x8')](moment(_0x435367),_0xb0b2('0x9')));}}},'amd':{'type':Sequelize[_0xb0b2('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb0b2('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb0b2('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb0b2('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb0b2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb0b2('0x4')]},'deleted':{'type':Sequelize[_0xb0b2('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb0b2('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb0b2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3031=['DATE','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0x3d07f2,_0x19854d){var _0x26052a=function(_0x213834){while(--_0x213834){_0x3d07f2['push'](_0x3d07f2['shift']());}};_0x26052a(++_0x19854d);}(_0x3031,0xaf));var _0x1303=function(_0x433c46,_0x488941){_0x433c46=_0x433c46-0x0;var _0x5276a4=_0x3031[_0x433c46];return _0x5276a4;};'use strict';var Sequelize=require(_0x1303('0x0'));var moment=require(_0x1303('0x1'));module[_0x1303('0x2')]={'state':{'type':Sequelize[_0x1303('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x1303('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1303('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x1303('0x4')]},'originatecalleridname':{'type':Sequelize[_0x1303('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1303('0x4')]},'starttime':{'type':Sequelize[_0x1303('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x1303('0x5')]},'endtime':{'type':Sequelize[_0x1303('0x5')]},'ringtime':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x1303('0x4')]},'campaigntype':{'type':Sequelize[_0x1303('0x4')]},'membername':{'type':Sequelize[_0x1303('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x1303('0x4')]},'secondDisposition':{'type':Sequelize[_0x1303('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1303('0x4')]},'dispositionat':{'type':Sequelize[_0x1303('0x5')],'set':function(_0x4ba695){var _0x1d860e=this[_0x1303('0x6')](_0x1303('0x7'));if(_0x1d860e&&_0x4ba695){this[_0x1303('0x8')]('followuptime',moment(_0x4ba695)[_0x1303('0x9')](moment(_0x1d860e),_0x1303('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1303('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1303('0x5')]},'callback':{'type':Sequelize[_0x1303('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1303('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1303('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1303('0x5')]},'recallme':{'type':Sequelize[_0x1303('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1303('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1303('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index aa6042e..cb4a5b3 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 _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x90b1,0x1bb));var _0x190b=function(_0x1389e3,_0x2ed4bd){_0x1389e3=_0x1389e3-0x0;var _0x3f6873=_0x90b1[_0x1389e3];return _0x3f6873;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));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(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));}; \ No newline at end of file +var _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 273a14f..e2baec5 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 _0xa102=['define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x453db0,_0x5cdc9b){var _0x382549=function(_0x2e3b69){while(--_0x2e3b69){_0x453db0['push'](_0x453db0['shift']());}};_0x382549(++_0x5cdc9b);}(_0xa102,0x82));var _0x2a10=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xa102[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x2a10('0x0'));var util=require(_0x2a10('0x1'));var logger=require(_0x2a10('0x2'))(_0x2a10('0x3'));var moment=require('moment');var BPromise=require(_0x2a10('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a10('0x5'));var rimraf=require(_0x2a10('0x6'));var config=require(_0x2a10('0x7'));var attributes=require(_0x2a10('0x8'));module[_0x2a10('0x9')]=function(_0x248f5a,_0x279ce4){return _0x248f5a[_0x2a10('0xa')]('CmHopperFinal',attributes,{'tableName':_0x2a10('0xb'),'paranoid':![],'indexes':[{'name':_0x2a10('0xc'),'fields':['calleridnum']},{'name':_0x2a10('0xd'),'fields':[_0x2a10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3fd=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x20c71c,_0x46b89f){var _0x2e8d49=function(_0x4d0742){while(--_0x4d0742){_0x20c71c['push'](_0x20c71c['shift']());}};_0x2e8d49(++_0x46b89f);}(_0xf3fd,0x176));var _0xdf3f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf3fd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xdf3f('0x0'));var util=require('util');var logger=require(_0xdf3f('0x1'))(_0xdf3f('0x2'));var moment=require(_0xdf3f('0x3'));var BPromise=require(_0xdf3f('0x4'));var rp=require(_0xdf3f('0x5'));var fs=require('fs');var path=require(_0xdf3f('0x6'));var rimraf=require(_0xdf3f('0x7'));var config=require(_0xdf3f('0x8'));var attributes=require(_0xdf3f('0x9'));module[_0xdf3f('0xa')]=function(_0x829570,_0x45644b){return _0x829570[_0xdf3f('0xb')](_0xdf3f('0xc'),attributes,{'tableName':_0xdf3f('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xdf3f('0xe')]},{'name':'uniqueid','fields':[_0xdf3f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 043ba11..4348318 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(_0x2bb57e,_0x51dbf5){var _0x223699=function(_0x5f7d1d){while(--_0x5f7d1d){_0x2bb57e['push'](_0x2bb57e['shift']());}};_0x223699(++_0x51dbf5);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xb10b[_0x5cb1af];return _0x8d7940;};'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(_0x319689,_0x2d1c26){var _0x5347cc=function(_0x56a18c){while(--_0x56a18c){_0x319689['push'](_0x319689['shift']());}};_0x5347cc(++_0x2d1c26);}(_0xb10b,0x12a));var _0xbb10=function(_0x18175b,_0x4d7376){_0x18175b=_0x18175b-0x0;var _0x210d45=_0xb10b[_0x18175b];return _0x210d45;};'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 d155a14..5b0a5fc 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 _0xb01c=['put','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x4f97fc,_0x4e524e){var _0x3e6250=function(_0x32dde8){while(--_0x32dde8){_0x4f97fc['push'](_0x4f97fc['shift']());}};_0x3e6250(++_0x4e524e);}(_0xb01c,0xbe));var _0xcb01=function(_0x7d6197,_0x271388){_0x7d6197=_0x7d6197-0x0;var _0x1563b5=_0xb01c[_0x7d6197];return _0x1563b5;};'use strict';var multer=require(_0xcb01('0x0'));var util=require('util');var path=require(_0xcb01('0x1'));var timeout=require(_0xcb01('0x2'));var express=require(_0xcb01('0x3'));var router=express[_0xcb01('0x4')]();var fs_extra=require(_0xcb01('0x5'));var auth=require(_0xcb01('0x6'));var interaction=require(_0xcb01('0x7'));var config=require('../../config/environment');var controller=require(_0xcb01('0x8'));router[_0xcb01('0x9')]('/',auth[_0xcb01('0xa')](),controller[_0xcb01('0xb')]);router[_0xcb01('0x9')](_0xcb01('0xc'),auth[_0xcb01('0xa')](),controller['describe']);router[_0xcb01('0x9')](_0xcb01('0xd'),auth[_0xcb01('0xa')](),controller[_0xcb01('0xe')]);router['get'](_0xcb01('0xf'),auth[_0xcb01('0xa')](),controller[_0xcb01('0x10')]);router['get'](_0xcb01('0x11'),auth[_0xcb01('0xa')](),controller[_0xcb01('0x12')]);router[_0xcb01('0x13')](_0xcb01('0x14'),auth['isAuthenticated'](),controller[_0xcb01('0x15')]);router[_0xcb01('0x13')](_0xcb01('0x16'),auth[_0xcb01('0xa')](),controller[_0xcb01('0x17')]);router[_0xcb01('0x13')](_0xcb01('0x18'),auth[_0xcb01('0xa')](),controller[_0xcb01('0x19')]);router[_0xcb01('0x1a')](_0xcb01('0xd'),auth[_0xcb01('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xa868=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','post','put','update','exports','multer','util'];(function(_0x450409,_0x75a308){var _0x479b90=function(_0x257d1f){while(--_0x257d1f){_0x450409['push'](_0x450409['shift']());}};_0x479b90(++_0x75a308);}(_0xa868,0x1b8));var _0x8a86=function(_0x70f515,_0x31a8a9){_0x70f515=_0x70f515-0x0;var _0x412225=_0xa868[_0x70f515];return _0x412225;};'use strict';var multer=require(_0x8a86('0x0'));var util=require(_0x8a86('0x1'));var path=require(_0x8a86('0x2'));var timeout=require(_0x8a86('0x3'));var express=require(_0x8a86('0x4'));var router=express[_0x8a86('0x5')]();var fs_extra=require(_0x8a86('0x6'));var auth=require(_0x8a86('0x7'));var interaction=require(_0x8a86('0x8'));var config=require(_0x8a86('0x9'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x8a86('0xa')](),controller[_0x8a86('0xb')]);router[_0x8a86('0xc')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8a86('0xc')](_0x8a86('0xd'),auth['isAuthenticated'](),controller[_0x8a86('0xe')]);router['get'](_0x8a86('0xf'),auth[_0x8a86('0xa')](),controller[_0x8a86('0x10')]);router[_0x8a86('0xc')](_0x8a86('0x11'),auth[_0x8a86('0xa')](),controller[_0x8a86('0x12')]);router['post'](_0x8a86('0x13'),auth[_0x8a86('0xa')](),controller[_0x8a86('0x14')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0x8a86('0xa')](),controller[_0x8a86('0x15')]);router[_0x8a86('0x16')]('/checkContactHopper',auth[_0x8a86('0xa')](),controller['checkContactHopper']);router[_0x8a86('0x17')](_0x8a86('0xd'),auth['isAuthenticated'](),controller[_0x8a86('0x18')]);module[_0x8a86('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 28a8dd3..12047ef 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 _0x6069=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x15ab29,_0x3cdaa8){var _0x3fe3b2=function(_0x2237bf){while(--_0x2237bf){_0x15ab29['push'](_0x15ab29['shift']());}};_0x3fe3b2(++_0x3cdaa8);}(_0x6069,0x1c1));var _0x9606=function(_0x3d68b3,_0x483c01){_0x3d68b3=_0x3d68b3-0x0;var _0x1ff4d1=_0x6069[_0x3d68b3];return _0x1ff4d1;};'use strict';var Sequelize=require(_0x9606('0x0'));module[_0x9606('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9606('0x2')]},'scheduledat':{'type':Sequelize[_0x9606('0x3')]},'countbusyretry':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9606('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9606('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9606('0x2')]},'calleridnum':{'type':Sequelize[_0x9606('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x9606('0x3')]},'answertime':{'type':Sequelize[_0x9606('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9606('0x2')]},'campaign':{'type':Sequelize[_0x9606('0x2')]},'campaigntype':{'type':Sequelize[_0x9606('0x2')]},'membername':{'type':Sequelize[_0x9606('0x2')]},'reason':{'type':Sequelize[_0x9606('0x2')]},'amd':{'type':Sequelize[_0x9606('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9606('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9606('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x9606('0x3')]},'edited':{'type':Sequelize[_0x9606('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9606('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x99bb=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x576509,_0x44816b){var _0x5ebac1=function(_0x1d8158){while(--_0x1d8158){_0x576509['push'](_0x576509['shift']());}};_0x5ebac1(++_0x44816b);}(_0x99bb,0x11a));var _0xb99b=function(_0x17df77,_0x200e0b){_0x17df77=_0x17df77-0x0;var _0x35c153=_0x99bb[_0x17df77];return _0x35c153;};'use strict';var Sequelize=require(_0xb99b('0x0'));module[_0xb99b('0x1')]={'state':{'type':Sequelize[_0xb99b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb99b('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb99b('0x3')]},'originatecalleridname':{'type':Sequelize[_0xb99b('0x3')]},'calleridnum':{'type':Sequelize[_0xb99b('0x3')]},'calleridname':{'type':Sequelize[_0xb99b('0x3')]},'starttime':{'type':Sequelize[_0xb99b('0x4')]},'responsetime':{'type':Sequelize[_0xb99b('0x4')]},'answertime':{'type':Sequelize[_0xb99b('0x4')]},'droptime':{'type':Sequelize[_0xb99b('0x4')]},'endtime':{'type':Sequelize[_0xb99b('0x4')]},'ringtime':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb99b('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb99b('0x3')]},'membername':{'type':Sequelize[_0xb99b('0x3')]},'reason':{'type':Sequelize[_0xb99b('0x3')]},'amd':{'type':Sequelize[_0xb99b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb99b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xb99b('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb99b('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb99b('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xb99b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb99b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index e85d872..26b9368 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 _0x21fc=['VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','describe','uniqueid','find','eml-format','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge'];(function(_0x2251cf,_0x40e7c3){var _0x434dcb=function(_0xaf445a){while(--_0xaf445a){_0x2251cf['push'](_0x2251cf['shift']());}};_0x434dcb(++_0x40e7c3);}(_0x21fc,0x180));var _0xc21f=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x21fc[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0xc21f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc21f('0x1'));var rp=require(_0xc21f('0x2'));var moment=require(_0xc21f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc21f('0x4'));var path=require('path');var sox=require(_0xc21f('0x5'));var csv=require(_0xc21f('0x6'));var ejs=require(_0xc21f('0x7'));var fs=require('fs');var fs_extra=require(_0xc21f('0x8'));var _=require(_0xc21f('0x9'));var squel=require(_0xc21f('0xa'));var crypto=require(_0xc21f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc21f('0xc'));var toCsv=require(_0xc21f('0x6'));var querystring=require('querystring');var Papa=require(_0xc21f('0xd'));var Redis=require(_0xc21f('0xe'));var authService=require(_0xc21f('0xf'));var qs=require(_0xc21f('0x10'));var as=require(_0xc21f('0x11'));var hardwareService=require(_0xc21f('0x12'));var logger=require(_0xc21f('0x13'))(_0xc21f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc21f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11d68d,_0x3d8c3e){_0x3d8c3e=_0x3d8c3e||0xcc;return function(_0x44a15e){if(_0x44a15e){return _0x11d68d[_0xc21f('0x16')](_0x3d8c3e);}return _0x11d68d[_0xc21f('0x17')](_0x3d8c3e)['end']();};}function respondWithResult(_0x20f65f,_0x3f694e){_0x3f694e=_0x3f694e||0xc8;return function(_0x50902e){if(_0x50902e){return _0x20f65f['status'](_0x3f694e)[_0xc21f('0x18')](_0x50902e);}};}function respondWithFilteredResult(_0x46eec6,_0x421008){return function(_0x4125f2){if(_0x4125f2){var _0x5fca50=typeof _0x421008[_0xc21f('0x19')]===_0xc21f('0x1a')&&typeof _0x421008['limit']===_0xc21f('0x1a');var _0x4dedde=_0x4125f2[_0xc21f('0x1b')];var _0x45b149=_0x5fca50?0x0:_0x421008[_0xc21f('0x19')];var _0xe7183a=_0x5fca50?_0x4125f2[_0xc21f('0x1b')]:_0x421008[_0xc21f('0x19')]+_0x421008[_0xc21f('0x1c')];var _0x3e8998;if(_0xe7183a>=_0x4dedde){_0xe7183a=_0x4dedde;_0x3e8998=0xc8;}else{_0x3e8998=0xce;}_0x46eec6[_0xc21f('0x17')](_0x3e8998);return _0x46eec6[_0xc21f('0x1d')](_0xc21f('0x1e'),_0x45b149+'-'+_0xe7183a+'/'+_0x4dedde)['json'](_0x4125f2);}return null;};}function patchUpdates(_0x7ea217){return function(_0x395aa4){try{jsonpatch[_0xc21f('0x1f')](_0x395aa4,_0x7ea217,!![]);}catch(_0x35f9b2){return BPromise[_0xc21f('0x20')](_0x35f9b2);}return _0x395aa4['save']();};}function saveUpdates(_0x561064,_0x6df657){return function(_0x19c9c7){if(_0x19c9c7){return _0x19c9c7['update'](_0x561064)['then'](function(_0xc727bb){return _0xc727bb;});}return null;};}function removeEntity(_0x502c83,_0x450f17){return function(_0x349298){if(_0x349298){return _0x349298[_0xc21f('0x21')]()[_0xc21f('0x22')](function(){_0x502c83[_0xc21f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b3344,_0xd8abd0){return function(_0x30d004){if(!_0x30d004){_0x5b3344[_0xc21f('0x16')](0x194);}return _0x30d004;};}function handleError(_0xf04c6c,_0x3fdcf1){_0x3fdcf1=_0x3fdcf1||0x1f4;return function(_0x4382cc){logger[_0xc21f('0x23')](_0x4382cc[_0xc21f('0x24')]);if(_0x4382cc[_0xc21f('0x25')]){delete _0x4382cc['name'];}_0xf04c6c['status'](_0x3fdcf1)[_0xc21f('0x26')](_0x4382cc);};}exports[_0xc21f('0x27')]=function(_0x184bc3,_0x288cc9){var _0x121bf8={},_0x54376a={},_0x42d5e6={'count':0x0,'rows':[]};var _0x74d42c=_[_0xc21f('0x28')](db[_0xc21f('0x29')][_0xc21f('0x2a')],function(_0xe79c1a){return{'name':_0xe79c1a['fieldName'],'type':_0xe79c1a[_0xc21f('0x2b')][_0xc21f('0x2c')]};});_0x54376a[_0xc21f('0x2d')]=_['map'](_0x74d42c,'name');_0x54376a[_0xc21f('0x2e')]=_[_0xc21f('0x2f')](_0x184bc3[_0xc21f('0x2e')]);_0x54376a[_0xc21f('0x30')]=_[_0xc21f('0x31')](_0x54376a[_0xc21f('0x2d')],_0x54376a['query']);_0x121bf8['attributes']=_[_0xc21f('0x31')](_0x54376a[_0xc21f('0x2d')],qs[_0xc21f('0x32')](_0x184bc3[_0xc21f('0x2e')]['fields']));_0x121bf8[_0xc21f('0x33')]=_0x121bf8[_0xc21f('0x33')][_0xc21f('0x34')]?_0x121bf8[_0xc21f('0x33')]:_0x54376a['model'];if(!_0x184bc3['query']['hasOwnProperty'](_0xc21f('0x35'))){_0x121bf8[_0xc21f('0x1c')]=qs['limit'](_0x184bc3[_0xc21f('0x2e')]['limit']);_0x121bf8[_0xc21f('0x19')]=qs[_0xc21f('0x19')](_0x184bc3['query'][_0xc21f('0x19')]);}_0x121bf8[_0xc21f('0x36')]=qs['sort'](_0x184bc3['query'][_0xc21f('0x37')]);_0x121bf8['where']=qs['filters'](_[_0xc21f('0x38')](_0x184bc3[_0xc21f('0x2e')],_0x54376a[_0xc21f('0x30')]),_0x74d42c);if(_0x184bc3[_0xc21f('0x2e')][_0xc21f('0x39')]){_0x121bf8[_0xc21f('0x3a')]=_[_0xc21f('0x3b')](_0x121bf8[_0xc21f('0x3a')],{'$or':_['map'](_0x74d42c,function(_0x26fc8f){if(_0x26fc8f[_0xc21f('0x2b')]!==_0xc21f('0x3c')){var _0xbb318={};_0xbb318[_0x26fc8f[_0xc21f('0x25')]]={'$like':'%'+_0x184bc3[_0xc21f('0x2e')][_0xc21f('0x39')]+'%'};return _0xbb318;}})});}_0x121bf8=_[_0xc21f('0x3b')]({},_0x121bf8,_0x184bc3['options']);var _0x4cd96e={'where':_0x121bf8[_0xc21f('0x3a')]};return db[_0xc21f('0x29')][_0xc21f('0x1b')](_0x4cd96e)[_0xc21f('0x22')](function(_0x6e39e9){_0x42d5e6[_0xc21f('0x1b')]=_0x6e39e9;if(_0x184bc3[_0xc21f('0x2e')][_0xc21f('0x3d')]){_0x121bf8[_0xc21f('0x3e')]=[{'all':!![]}];}return db[_0xc21f('0x29')][_0xc21f('0x3f')](_0x121bf8);})['then'](function(_0x2ed063){_0x42d5e6[_0xc21f('0x40')]=_0x2ed063;return _0x42d5e6;})[_0xc21f('0x22')](respondWithFilteredResult(_0x288cc9,_0x121bf8))[_0xc21f('0x41')](handleError(_0x288cc9,null));};exports[_0xc21f('0x42')]=function(_0xffd6cb,_0x5c9c4f){var _0x93ae33={'raw':!![],'where':{'id':_0xffd6cb[_0xc21f('0x43')]['id']}},_0x30496d={};_0x30496d[_0xc21f('0x2d')]=_[_0xc21f('0x2f')](db[_0xc21f('0x29')][_0xc21f('0x2a')]);_0x30496d[_0xc21f('0x2e')]=_[_0xc21f('0x2f')](_0xffd6cb[_0xc21f('0x2e')]);_0x30496d[_0xc21f('0x30')]=_[_0xc21f('0x31')](_0x30496d[_0xc21f('0x2d')],_0x30496d['query']);_0x93ae33[_0xc21f('0x33')]=_[_0xc21f('0x31')](_0x30496d['model'],qs[_0xc21f('0x32')](_0xffd6cb[_0xc21f('0x2e')][_0xc21f('0x32')]));_0x93ae33[_0xc21f('0x33')]=_0x93ae33[_0xc21f('0x33')][_0xc21f('0x34')]?_0x93ae33[_0xc21f('0x33')]:_0x30496d[_0xc21f('0x2d')];if(_0xffd6cb[_0xc21f('0x2e')]['includeAll']){_0x93ae33[_0xc21f('0x3e')]=[{'all':!![]}];}_0x93ae33=_[_0xc21f('0x3b')]({},_0x93ae33,_0xffd6cb[_0xc21f('0x44')]);return db[_0xc21f('0x29')]['find'](_0x93ae33)[_0xc21f('0x22')](handleEntityNotFound(_0x5c9c4f,null))[_0xc21f('0x22')](respondWithResult(_0x5c9c4f,null))[_0xc21f('0x41')](handleError(_0x5c9c4f,null));};exports[_0xc21f('0x45')]=function(_0x1076f6,_0x4d1440){return db[_0xc21f('0x29')][_0xc21f('0x45')](_0x1076f6[_0xc21f('0x46')],{})[_0xc21f('0x22')](respondWithResult(_0x4d1440,0xc9))[_0xc21f('0x41')](handleError(_0x4d1440,null));};exports[_0xc21f('0x47')]=function(_0x172f81,_0x562c42){return db['CmHopperHistory'][_0xc21f('0x47')]()[_0xc21f('0x22')](respondWithResult(_0x562c42,null))['catch'](handleError(_0x562c42,null));};exports['update']=function(_0x362a1a,_0x32ea1a){if(_0x362a1a['body'][_0xc21f('0x48')]){delete _0x362a1a[_0xc21f('0x46')][_0xc21f('0x48')];}return db[_0xc21f('0x29')][_0xc21f('0x49')]({'where':{'uniqueid':_0x362a1a['params']['id']}})[_0xc21f('0x22')](handleEntityNotFound(_0x32ea1a,null))[_0xc21f('0x22')](saveUpdates(_0x362a1a[_0xc21f('0x46')],null))[_0xc21f('0x22')](respondWithResult(_0x32ea1a,null))[_0xc21f('0x41')](handleError(_0x32ea1a,null));}; \ No newline at end of file +var _0x1bd2=['status','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','index','map','CmHopperHistory','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1bd2,0x1e7));var _0x21bd=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x1bd2[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0x21bd('0x0'));var rimraf=require(_0x21bd('0x1'));var zipdir=require(_0x21bd('0x2'));var jsonpatch=require(_0x21bd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21bd('0x4'));var Mustache=require(_0x21bd('0x5'));var util=require(_0x21bd('0x6'));var path=require(_0x21bd('0x7'));var sox=require(_0x21bd('0x8'));var csv=require(_0x21bd('0x9'));var ejs=require(_0x21bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21bd('0xb'));var squel=require('squel');var crypto=require(_0x21bd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x21bd('0xd'));var Redis=require(_0x21bd('0xe'));var authService=require(_0x21bd('0xf'));var qs=require(_0x21bd('0x10'));var as=require(_0x21bd('0x11'));var hardwareService=require(_0x21bd('0x12'));var logger=require(_0x21bd('0x13'))('api');var utils=require(_0x21bd('0x14'));var config=require(_0x21bd('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x309b28,_0x2fed07){_0x2fed07=_0x2fed07||0xcc;return function(_0x4b9ef4){if(_0x4b9ef4){return _0x309b28[_0x21bd('0x16')](_0x2fed07);}return _0x309b28['status'](_0x2fed07)[_0x21bd('0x17')]();};}function respondWithResult(_0x8ff227,_0x81150b){_0x81150b=_0x81150b||0xc8;return function(_0x3bd227){if(_0x3bd227){return _0x8ff227[_0x21bd('0x18')](_0x81150b)['json'](_0x3bd227);}};}function respondWithFilteredResult(_0x23f472,_0x3971c6){return function(_0x36a9ee){if(_0x36a9ee){var _0xf9c847=typeof _0x3971c6[_0x21bd('0x19')]==='undefined'&&typeof _0x3971c6[_0x21bd('0x1a')]===_0x21bd('0x1b');var _0x1ef727=_0x36a9ee['count'];var _0x537a4f=_0xf9c847?0x0:_0x3971c6[_0x21bd('0x19')];var _0x516d03=_0xf9c847?_0x36a9ee[_0x21bd('0x1c')]:_0x3971c6[_0x21bd('0x19')]+_0x3971c6['limit'];var _0x26a042;if(_0x516d03>=_0x1ef727){_0x516d03=_0x1ef727;_0x26a042=0xc8;}else{_0x26a042=0xce;}_0x23f472[_0x21bd('0x18')](_0x26a042);return _0x23f472[_0x21bd('0x1d')](_0x21bd('0x1e'),_0x537a4f+'-'+_0x516d03+'/'+_0x1ef727)[_0x21bd('0x1f')](_0x36a9ee);}return null;};}function patchUpdates(_0x20ee62){return function(_0x456caa){try{jsonpatch['apply'](_0x456caa,_0x20ee62,!![]);}catch(_0x4a488b){return BPromise[_0x21bd('0x20')](_0x4a488b);}return _0x456caa['save']();};}function saveUpdates(_0x11c772,_0x5a9b24){return function(_0x32a9f9){if(_0x32a9f9){return _0x32a9f9[_0x21bd('0x21')](_0x11c772)[_0x21bd('0x22')](function(_0x236390){return _0x236390;});}return null;};}function removeEntity(_0x29133d,_0x1e54dd){return function(_0x505877){if(_0x505877){return _0x505877[_0x21bd('0x23')]()[_0x21bd('0x22')](function(){_0x29133d[_0x21bd('0x18')](0xcc)[_0x21bd('0x17')]();});}};}function handleEntityNotFound(_0x35378d,_0x4cbabf){return function(_0x324821){if(!_0x324821){_0x35378d[_0x21bd('0x16')](0x194);}return _0x324821;};}function handleError(_0x105afd,_0x130e3e){_0x130e3e=_0x130e3e||0x1f4;return function(_0x6e8768){logger[_0x21bd('0x24')](_0x6e8768[_0x21bd('0x25')]);if(_0x6e8768[_0x21bd('0x26')]){delete _0x6e8768[_0x21bd('0x26')];}_0x105afd[_0x21bd('0x18')](_0x130e3e)['send'](_0x6e8768);};}exports[_0x21bd('0x27')]=function(_0x58e601,_0x521262){var _0x26314b={},_0x13a151={},_0x471869={'count':0x0,'rows':[]};var _0x1d7206=_[_0x21bd('0x28')](db[_0x21bd('0x29')][_0x21bd('0x2a')],function(_0x5c818c){return{'name':_0x5c818c['fieldName'],'type':_0x5c818c[_0x21bd('0x2b')]['key']};});_0x13a151[_0x21bd('0x2c')]=_[_0x21bd('0x28')](_0x1d7206,_0x21bd('0x26'));_0x13a151[_0x21bd('0x2d')]=_[_0x21bd('0x2e')](_0x58e601['query']);_0x13a151[_0x21bd('0x2f')]=_[_0x21bd('0x30')](_0x13a151[_0x21bd('0x2c')],_0x13a151['query']);_0x26314b['attributes']=_[_0x21bd('0x30')](_0x13a151[_0x21bd('0x2c')],qs['fields'](_0x58e601[_0x21bd('0x2d')][_0x21bd('0x31')]));_0x26314b[_0x21bd('0x32')]=_0x26314b[_0x21bd('0x32')][_0x21bd('0x33')]?_0x26314b['attributes']:_0x13a151[_0x21bd('0x2c')];if(!_0x58e601[_0x21bd('0x2d')][_0x21bd('0x34')]('nolimit')){_0x26314b[_0x21bd('0x1a')]=qs[_0x21bd('0x1a')](_0x58e601[_0x21bd('0x2d')]['limit']);_0x26314b[_0x21bd('0x19')]=qs[_0x21bd('0x19')](_0x58e601['query'][_0x21bd('0x19')]);}_0x26314b[_0x21bd('0x35')]=qs[_0x21bd('0x36')](_0x58e601['query'][_0x21bd('0x36')]);_0x26314b[_0x21bd('0x37')]=qs['filters'](_[_0x21bd('0x38')](_0x58e601[_0x21bd('0x2d')],_0x13a151[_0x21bd('0x2f')]),_0x1d7206);if(_0x58e601[_0x21bd('0x2d')][_0x21bd('0x39')]){_0x26314b[_0x21bd('0x37')]=_[_0x21bd('0x3a')](_0x26314b[_0x21bd('0x37')],{'$or':_['map'](_0x1d7206,function(_0x230f4a){if(_0x230f4a['type']!==_0x21bd('0x3b')){var _0x520286={};_0x520286[_0x230f4a[_0x21bd('0x26')]]={'$like':'%'+_0x58e601['query']['filter']+'%'};return _0x520286;}})});}_0x26314b=_[_0x21bd('0x3a')]({},_0x26314b,_0x58e601[_0x21bd('0x3c')]);var _0xab9e4c={'where':_0x26314b[_0x21bd('0x37')]};return db[_0x21bd('0x29')][_0x21bd('0x1c')](_0xab9e4c)[_0x21bd('0x22')](function(_0x3c5d9c){_0x471869['count']=_0x3c5d9c;if(_0x58e601[_0x21bd('0x2d')][_0x21bd('0x3d')]){_0x26314b['include']=[{'all':!![]}];}return db[_0x21bd('0x29')][_0x21bd('0x3e')](_0x26314b);})['then'](function(_0x5a90dc){_0x471869[_0x21bd('0x3f')]=_0x5a90dc;return _0x471869;})[_0x21bd('0x22')](respondWithFilteredResult(_0x521262,_0x26314b))['catch'](handleError(_0x521262,null));};exports[_0x21bd('0x40')]=function(_0x5a9baf,_0x147a5f){var _0x5d3e89={'raw':!![],'where':{'id':_0x5a9baf[_0x21bd('0x41')]['id']}},_0x505825={};_0x505825[_0x21bd('0x2c')]=_[_0x21bd('0x2e')](db['CmHopperHistory']['rawAttributes']);_0x505825[_0x21bd('0x2d')]=_['keys'](_0x5a9baf[_0x21bd('0x2d')]);_0x505825['filters']=_[_0x21bd('0x30')](_0x505825[_0x21bd('0x2c')],_0x505825['query']);_0x5d3e89[_0x21bd('0x32')]=_[_0x21bd('0x30')](_0x505825[_0x21bd('0x2c')],qs[_0x21bd('0x31')](_0x5a9baf[_0x21bd('0x2d')][_0x21bd('0x31')]));_0x5d3e89[_0x21bd('0x32')]=_0x5d3e89['attributes'][_0x21bd('0x33')]?_0x5d3e89['attributes']:_0x505825[_0x21bd('0x2c')];if(_0x5a9baf[_0x21bd('0x2d')][_0x21bd('0x3d')]){_0x5d3e89[_0x21bd('0x42')]=[{'all':!![]}];}_0x5d3e89=_[_0x21bd('0x3a')]({},_0x5d3e89,_0x5a9baf[_0x21bd('0x3c')]);return db['CmHopperHistory'][_0x21bd('0x43')](_0x5d3e89)[_0x21bd('0x22')](handleEntityNotFound(_0x147a5f,null))[_0x21bd('0x22')](respondWithResult(_0x147a5f,null))[_0x21bd('0x44')](handleError(_0x147a5f,null));};exports[_0x21bd('0x45')]=function(_0x1c5758,_0x5ac6c6){return db[_0x21bd('0x29')][_0x21bd('0x45')](_0x1c5758[_0x21bd('0x46')],{})[_0x21bd('0x22')](respondWithResult(_0x5ac6c6,0xc9))[_0x21bd('0x44')](handleError(_0x5ac6c6,null));};exports[_0x21bd('0x47')]=function(_0x3b5caf,_0x7a4fec){return db[_0x21bd('0x29')][_0x21bd('0x47')]()[_0x21bd('0x22')](respondWithResult(_0x7a4fec,null))[_0x21bd('0x44')](handleError(_0x7a4fec,null));};exports[_0x21bd('0x21')]=function(_0xec82d7,_0x2cbd66){if(_0xec82d7[_0x21bd('0x46')][_0x21bd('0x48')]){delete _0xec82d7[_0x21bd('0x46')][_0x21bd('0x48')];}return db['CmHopperHistory'][_0x21bd('0x43')]({'where':{'uniqueid':_0xec82d7[_0x21bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x2cbd66,null))[_0x21bd('0x22')](saveUpdates(_0xec82d7[_0x21bd('0x46')],null))[_0x21bd('0x22')](respondWithResult(_0x2cbd66,null))[_0x21bd('0x44')](handleError(_0x2cbd66,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 40032cd..4b283e3 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 _0x186d=['CmHopperHistory','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define'];(function(_0x239bb5,_0x144952){var _0x15e817=function(_0x3beea9){while(--_0x3beea9){_0x239bb5['push'](_0x239bb5['shift']());}};_0x15e817(++_0x144952);}(_0x186d,0x1ca));var _0xd186=function(_0x40a740,_0x5e1944){_0x40a740=_0x40a740-0x0;var _0x2b5bbb=_0x186d[_0x40a740];return _0x2b5bbb;};'use strict';var _=require('lodash');var util=require(_0xd186('0x0'));var logger=require(_0xd186('0x1'))(_0xd186('0x2'));var moment=require(_0xd186('0x3'));var BPromise=require(_0xd186('0x4'));var rp=require(_0xd186('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd186('0x6'));var config=require(_0xd186('0x7'));var attributes=require(_0xd186('0x8'));module['exports']=function(_0x5312dd,_0x410c23){return _0x5312dd[_0xd186('0x9')](_0xd186('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xd186('0xb'),'fields':[_0xd186('0xb')]},{'name':_0xd186('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1ca=['lodash','util','bluebird','request-promise','path','../../config/environment','define','cm_hopper_history','endtime','uniqueid'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd1ca,0x140));var _0xad1c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd1ca[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xad1c('0x2'));var rp=require(_0xad1c('0x3'));var fs=require('fs');var path=require(_0xad1c('0x4'));var rimraf=require('rimraf');var config=require(_0xad1c('0x5'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0xd08c6,_0x44ae9c){return _0xd08c6[_0xad1c('0x6')]('CmHopperHistory',attributes,{'tableName':_0xad1c('0x7'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xad1c('0x8')]},{'name':_0xad1c('0x9'),'fields':[_0xad1c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index e6142d5..3aac683 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 _0x06a0=['predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','create','body','raw','AvgHandleTime','CmHopperHistory','findAll','options','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout'];(function(_0x4672b7,_0x2a6cb5){var _0x2ae8df=function(_0xbb7aaa){while(--_0xbb7aaa){_0x4672b7['push'](_0x4672b7['shift']());}};_0x2ae8df(++_0x2a6cb5);}(_0x06a0,0x1e1));var _0x006a=function(_0x5440d3,_0x68412d){_0x5440d3=_0x5440d3-0x0;var _0x49b20a=_0x06a0[_0x5440d3];return _0x49b20a;};'use strict';var _=require(_0x006a('0x0'));var util=require('util');var moment=require(_0x006a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x006a('0x2'));var db=require(_0x006a('0x3'))['db'];var utils=require(_0x006a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x006a('0x5'));var jayson=require(_0x006a('0x6'));var client=jayson[_0x006a('0x7')][_0x006a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x345c22,_0xb532f9,_0x4b1151){return new BPromise(function(_0x5f1077,_0xba9c3b){return client[_0x006a('0x9')](_0x345c22,_0x4b1151)[_0x006a('0xa')](function(_0x11f165){logger[_0x006a('0xb')](_0x006a('0xc'),_0xb532f9,_0x006a('0xd'));logger[_0x006a('0xe')](_0x006a('0xf'),_0xb532f9,_0x006a('0xd'),JSON[_0x006a('0x10')](_0x11f165));if(_0x11f165[_0x006a('0x11')]){if(_0x11f165[_0x006a('0x11')][_0x006a('0x12')]===0x1f4){logger[_0x006a('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0xb532f9,_0x11f165['error'][_0x006a('0x13')]);return _0xba9c3b(_0x11f165[_0x006a('0x11')][_0x006a('0x13')]);}logger[_0x006a('0x11')](_0x006a('0xc'),_0xb532f9,_0x11f165[_0x006a('0x11')][_0x006a('0x13')]);return _0x5f1077(_0x11f165['error']['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0xb532f9,_0x006a('0xd'));_0x5f1077(_0x11f165[_0x006a('0x14')][_0x006a('0x13')]);}})[_0x006a('0x15')](function(_0x18be31){logger['error'](_0x006a('0xc'),_0xb532f9,_0x18be31);_0xba9c3b(_0x18be31);});});}exports[_0x006a('0x16')]=function(_0x39d602){var _0x20a3d9=this;return new Promise(function(_0xc0baaa,_0x1001c2){return db['CmHopperHistory'][_0x006a('0x17')](_0x39d602[_0x006a('0x18')],{'raw':_0x39d602['options']?_0x39d602['options'][_0x006a('0x19')]===undefined?!![]:![]:!![]})[_0x006a('0xa')](function(_0x3294eb){logger['info'](_0x006a('0x16'),_0x39d602);logger[_0x006a('0xe')](_0x006a('0x16'),_0x39d602,JSON[_0x006a('0x10')](_0x3294eb));_0xc0baaa(_0x3294eb);})[_0x006a('0x15')](function(_0x1ad18d){logger[_0x006a('0x11')](_0x006a('0x16'),_0x1ad18d[_0x006a('0x13')],_0x39d602);_0x1001c2(_0x20a3d9[_0x006a('0x11')](0x1f4,_0x1ad18d[_0x006a('0x13')]));});});};exports[_0x006a('0x1a')]=function(_0x101fbd){var _0x262327=this;return new Promise(function(_0x591c41,_0x3306c3){return db[_0x006a('0x1b')][_0x006a('0x1c')]({'raw':_0x101fbd[_0x006a('0x1d')]?_0x101fbd[_0x006a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x101fbd[_0x006a('0x1d')]?_0x101fbd[_0x006a('0x1d')][_0x006a('0x1e')]||null:null,'attributes':[[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')][_0x006a('0x21')]('id')),_0x006a('0x22')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')](_0x006a('0x24')))),_0x006a('0x25')],[db['sequelize']['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),_0x006a('0x26')],[db[_0x006a('0x1f')]['fn']('COUNT',db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),_0x006a('0x27')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x28'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')](_0x006a('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0x006a('0x1f')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')](_0x006a('0x2a')))),_0x006a('0x2b')]]})[_0x006a('0xa')](function(_0x6e1cb3){logger[_0x006a('0xb')]('AvgHandleTime',_0x101fbd);logger['debug']('AvgHandleTime',_0x101fbd,JSON[_0x006a('0x10')](_0x6e1cb3));_0x591c41(_0x6e1cb3);})[_0x006a('0x15')](function(_0x417210){logger[_0x006a('0x11')](_0x006a('0x1a'),_0x417210['message'],_0x101fbd);_0x3306c3(_0x262327[_0x006a('0x11')](0x1f4,_0x417210['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4b3512){var _0x2e7d6b=this;return new Promise(function(_0x176a1c,_0x3955c8){return db['CmHopperHistory'][_0x006a('0x1c')]({'raw':_0x4b3512[_0x006a('0x1d')]?_0x4b3512[_0x006a('0x1d')][_0x006a('0x19')]===undefined?!![]:![]:!![],'where':_0x4b3512[_0x006a('0x1d')]?_0x4b3512[_0x006a('0x1d')]['where']||null:null,'attributes':[[_0x006a('0x2c'),_0x006a('0x2d')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0x006a('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x006a('0x1f')]['fn']('IF',db['sequelize'][_0x006a('0x23')](_0x006a('0x2f')))),_0x006a('0x30')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')](_0x006a('0x24')))),_0x006a('0x31')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')]['literal'](_0x006a('0x32')))),_0x006a('0x33')],[db[_0x006a('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db['sequelize'][_0x006a('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x006a('0x34')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db['sequelize'][_0x006a('0x23')](_0x006a('0x35')))),_0x006a('0x36')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')]('`state`\x20=\x2013,\x201,\x20null'))),_0x006a('0x37')],[db[_0x006a('0x1f')]['fn']('COUNT',db[_0x006a('0x1f')]['fn']('IF',db['sequelize'][_0x006a('0x23')]('`state`\x20=\x2014,\x201,\x20null'))),_0x006a('0x38')],[db[_0x006a('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')](_0x006a('0x39')))),_0x006a('0x3a')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')][_0x006a('0x23')](_0x006a('0x3b')))),_0x006a('0x3c')],[db['sequelize']['fn']('COUNT',db[_0x006a('0x1f')]['fn']('IF',db[_0x006a('0x1f')]['literal'](_0x006a('0x3d')))),_0x006a('0x3a')],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db['sequelize']['fn']('IF',db[_0x006a('0x1f')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x006a('0x2c')]})[_0x006a('0xa')](function(_0x4741aa){logger[_0x006a('0xb')](_0x006a('0x3e'),_0x4b3512);logger[_0x006a('0xe')](_0x006a('0x3e'),_0x4b3512,JSON[_0x006a('0x10')](_0x4741aa));_0x176a1c(_0x4741aa);})[_0x006a('0x15')](function(_0x16835e){logger[_0x006a('0x11')]('GetVoiceQueueHopperHistory',_0x16835e[_0x006a('0x13')],_0x4b3512);_0x3955c8(_0x2e7d6b[_0x006a('0x11')](0x1f4,_0x16835e[_0x006a('0x13')]));});});};exports[_0x006a('0x3f')]=function(_0x4fe2dc){var _0x5a7d8d=this;return new Promise(function(_0x5d3d92,_0x59247b){return db['CmHopperHistory'][_0x006a('0x1c')]({'raw':_0x4fe2dc[_0x006a('0x1d')]?_0x4fe2dc[_0x006a('0x1d')][_0x006a('0x19')]===undefined?!![]:![]:!![],'where':_0x4fe2dc[_0x006a('0x1d')]?_0x4fe2dc[_0x006a('0x1d')]['where']||null:null,'attributes':[[_0x006a('0x2c'),_0x006a('0x2d')],[db['sequelize']['fn'](_0x006a('0x20'),db['sequelize'][_0x006a('0x21')]('id')),'ivrTotalCallsDays'],[db[_0x006a('0x1f')]['fn'](_0x006a('0x20'),db['sequelize']['fn']('IF',db[_0x006a('0x1f')]['literal'](_0x006a('0x24')))),_0x006a('0x40')]],'group':[_0x006a('0x2c')]})[_0x006a('0xa')](function(_0xbf38e){logger[_0x006a('0xb')](_0x006a('0x3f'),_0x4fe2dc);logger[_0x006a('0xe')](_0x006a('0x3f'),_0x4fe2dc,JSON[_0x006a('0x10')](_0xbf38e));_0x5d3d92(_0xbf38e);})[_0x006a('0x15')](function(_0x1be691){logger[_0x006a('0x11')]('GetCampaignHopperHistory',_0x1be691[_0x006a('0x13')],_0x4fe2dc);_0x59247b(_0x5a7d8d[_0x006a('0x11')](0x1f4,_0x1be691[_0x006a('0x13')]));});});}; \ No newline at end of file +var _0xd61e=['outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateCmHopperHistory','create','body','options','raw','debug','AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null'];(function(_0x45f6e0,_0x3e4779){var _0x5909db=function(_0x982766){while(--_0x982766){_0x45f6e0['push'](_0x45f6e0['shift']());}};_0x5909db(++_0x3e4779);}(_0xd61e,0x13d));var _0xed61=function(_0x5f5de0,_0x153131){_0x5f5de0=_0x5f5de0-0x0;var _0x220f90=_0xd61e[_0x5f5de0];return _0x220f90;};'use strict';var _=require(_0xed61('0x0'));var util=require(_0xed61('0x1'));var moment=require(_0xed61('0x2'));var BPromise=require(_0xed61('0x3'));var rs=require(_0xed61('0x4'));var fs=require('fs');var Redis=require(_0xed61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xed61('0x6'));var logger=require(_0xed61('0x7'))(_0xed61('0x8'));var config=require(_0xed61('0x9'));var jayson=require(_0xed61('0xa'));var client=jayson[_0xed61('0xb')][_0xed61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b7469,_0x5e6173,_0x59ef0e){return new BPromise(function(_0x5cbbd7,_0x4a2d4c){return client[_0xed61('0xd')](_0x5b7469,_0x59ef0e)[_0xed61('0xe')](function(_0x2964de){logger[_0xed61('0xf')](_0xed61('0x10'),_0x5e6173,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5e6173,_0xed61('0x11'),JSON[_0xed61('0x12')](_0x2964de));if(_0x2964de['error']){if(_0x2964de['error']['code']===0x1f4){logger['error'](_0xed61('0x10'),_0x5e6173,_0x2964de[_0xed61('0x13')][_0xed61('0x14')]);return _0x4a2d4c(_0x2964de[_0xed61('0x13')]['message']);}logger[_0xed61('0x13')](_0xed61('0x10'),_0x5e6173,_0x2964de[_0xed61('0x13')]['message']);return _0x5cbbd7(_0x2964de[_0xed61('0x13')][_0xed61('0x14')]);}else{logger[_0xed61('0xf')](_0xed61('0x10'),_0x5e6173,'request\x20sent');_0x5cbbd7(_0x2964de[_0xed61('0x15')][_0xed61('0x14')]);}})[_0xed61('0x16')](function(_0x6d05cd){logger['error'](_0xed61('0x10'),_0x5e6173,_0x6d05cd);_0x4a2d4c(_0x6d05cd);});});}exports[_0xed61('0x17')]=function(_0x4bd841){var _0x31b034=this;return new Promise(function(_0x11a277,_0x9d980e){return db['CmHopperHistory'][_0xed61('0x18')](_0x4bd841[_0xed61('0x19')],{'raw':_0x4bd841[_0xed61('0x1a')]?_0x4bd841['options'][_0xed61('0x1b')]===undefined?!![]:![]:!![]})[_0xed61('0xe')](function(_0xce408c){logger['info'](_0xed61('0x17'),_0x4bd841);logger[_0xed61('0x1c')]('CreateCmHopperHistory',_0x4bd841,JSON[_0xed61('0x12')](_0xce408c));_0x11a277(_0xce408c);})[_0xed61('0x16')](function(_0x864dfa){logger['error']('CreateCmHopperHistory',_0x864dfa[_0xed61('0x14')],_0x4bd841);_0x9d980e(_0x31b034['error'](0x1f4,_0x864dfa[_0xed61('0x14')]));});});};exports[_0xed61('0x1d')]=function(_0x2722d0){var _0x39a8ff=this;return new Promise(function(_0x40ea88,_0x5a71f0){return db['CmHopperHistory']['findAll']({'raw':_0x2722d0['options']?_0x2722d0['options'][_0xed61('0x1b')]===undefined?!![]:![]:!![],'where':_0x2722d0['options']?_0x2722d0[_0xed61('0x1a')][_0xed61('0x1e')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xed61('0x1f')][_0xed61('0x20')]('id')),_0xed61('0x21')],[db['sequelize']['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')]['literal'](_0xed61('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db['sequelize'][_0xed61('0x24')](_0xed61('0x25')))),_0xed61('0x26')],[db[_0xed61('0x1f')]['fn']('COUNT',db[_0xed61('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xed61('0x27')))),_0xed61('0x28')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x29'),db['sequelize']['fn']('IF',db['sequelize'][_0xed61('0x24')](_0xed61('0x2a')))),_0xed61('0x2b')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x29'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xed61('0x2c')]]})['then'](function(_0x251829){logger['info']('AvgHandleTime',_0x2722d0);logger['debug']('AvgHandleTime',_0x2722d0,JSON['stringify'](_0x251829));_0x40ea88(_0x251829);})[_0xed61('0x16')](function(_0x8470f8){logger[_0xed61('0x13')](_0xed61('0x1d'),_0x8470f8[_0xed61('0x14')],_0x2722d0);_0x5a71f0(_0x39a8ff[_0xed61('0x13')](0x1f4,_0x8470f8[_0xed61('0x14')]));});});};exports[_0xed61('0x2d')]=function(_0x5b1e4e){var _0x5d9cb3=this;return new Promise(function(_0x4b7688,_0x16391d){return db[_0xed61('0x2e')][_0xed61('0x2f')]({'raw':_0x5b1e4e['options']?_0x5b1e4e[_0xed61('0x1a')][_0xed61('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b1e4e['options']?_0x5b1e4e[_0xed61('0x1a')][_0xed61('0x1e')]||null:null,'attributes':[[_0xed61('0x30'),_0xed61('0x31')],[db['sequelize']['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x32')))),_0xed61('0x33')],[db[_0xed61('0x1f')]['fn']('COUNT',db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x34')))),_0xed61('0x35')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x23')))),_0xed61('0x36')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0xed61('0x24')](_0xed61('0x37')))),'outboundBusyCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x38')))),_0xed61('0x39')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db['sequelize']['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x3a')))),'outboundDropCallsDayTimeout'],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')]['literal'](_0xed61('0x3b')))),_0xed61('0x3c')],[db[_0xed61('0x1f')]['fn']('COUNT',db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')]['literal'](_0xed61('0x3d')))),_0xed61('0x3e')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x3f')))),_0xed61('0x40')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x41')))),_0xed61('0x42')],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x43')))),_0xed61('0x44')],[db['sequelize']['fn']('COUNT',db[_0xed61('0x1f')]['fn']('IF',db[_0xed61('0x1f')][_0xed61('0x24')](_0xed61('0x45')))),'outboundRejectCallsDay'],[db[_0xed61('0x1f')]['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xed61('0x46')]],'group':[_0xed61('0x30')]})[_0xed61('0xe')](function(_0x1d3b9d){logger[_0xed61('0xf')](_0xed61('0x2d'),_0x5b1e4e);logger[_0xed61('0x1c')](_0xed61('0x2d'),_0x5b1e4e,JSON['stringify'](_0x1d3b9d));_0x4b7688(_0x1d3b9d);})[_0xed61('0x16')](function(_0x258a40){logger['error'](_0xed61('0x2d'),_0x258a40[_0xed61('0x14')],_0x5b1e4e);_0x16391d(_0x5d9cb3[_0xed61('0x13')](0x1f4,_0x258a40['message']));});});};exports[_0xed61('0x47')]=function(_0x5768d6){var _0xb93db9=this;return new Promise(function(_0x2c16a9,_0x361fd8){return db[_0xed61('0x2e')][_0xed61('0x2f')]({'raw':_0x5768d6[_0xed61('0x1a')]?_0x5768d6[_0xed61('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5768d6[_0xed61('0x1a')]?_0x5768d6[_0xed61('0x1a')][_0xed61('0x1e')]||null:null,'attributes':[[_0xed61('0x30'),_0xed61('0x31')],[db[_0xed61('0x1f')]['fn']('COUNT',db[_0xed61('0x1f')]['col']('id')),_0xed61('0x48')],[db['sequelize']['fn'](_0xed61('0x22'),db[_0xed61('0x1f')]['fn']('IF',db['sequelize'][_0xed61('0x24')](_0xed61('0x23')))),_0xed61('0x49')]],'group':[_0xed61('0x30')]})[_0xed61('0xe')](function(_0x546be2){logger[_0xed61('0xf')](_0xed61('0x47'),_0x5768d6);logger[_0xed61('0x1c')](_0xed61('0x47'),_0x5768d6,JSON[_0xed61('0x12')](_0x546be2));_0x2c16a9(_0x546be2);})[_0xed61('0x16')](function(_0x3ea371){logger['error']('GetCampaignHopperHistory',_0x3ea371[_0xed61('0x14')],_0x5768d6);_0x361fd8(_0xb93db9[_0xed61('0x13')](0x1f4,_0x3ea371[_0xed61('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 05e9d95..4f8a79e 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 _0xbe90=['express','Router','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/:id','show','post','put','update','multer','util','path','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbe90,0x74));var _0x0be9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe90[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0be9('0x0'));var util=require(_0x0be9('0x1'));var path=require(_0x0be9('0x2'));var timeout=require(_0x0be9('0x3'));var express=require(_0x0be9('0x4'));var router=express[_0x0be9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0be9('0x6'));var controller=require(_0x0be9('0x7'));router[_0x0be9('0x8')]('/',auth[_0x0be9('0x9')](),controller['index']);router['get']('/describe',auth[_0x0be9('0x9')](),controller['describe']);router[_0x0be9('0x8')](_0x0be9('0xa'),auth[_0x0be9('0x9')](),controller[_0x0be9('0xb')]);router[_0x0be9('0xc')]('/',auth[_0x0be9('0x9')](),controller['create']);router[_0x0be9('0xd')](_0x0be9('0xa'),auth['isAuthenticated'](),controller[_0x0be9('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3e54=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/:id','show','post','update','exports','multer'];(function(_0x3e6127,_0x37dc77){var _0x3db180=function(_0xcb7811){while(--_0xcb7811){_0x3e6127['push'](_0x3e6127['shift']());}};_0x3db180(++_0x37dc77);}(_0x3e54,0x8f));var _0x43e5=function(_0x4a66bb,_0x3c3a9e){_0x4a66bb=_0x4a66bb-0x0;var _0x2572f6=_0x3e54[_0x4a66bb];return _0x2572f6;};'use strict';var multer=require(_0x43e5('0x0'));var util=require(_0x43e5('0x1'));var path=require(_0x43e5('0x2'));var timeout=require(_0x43e5('0x3'));var express=require('express');var router=express[_0x43e5('0x4')]();var fs_extra=require(_0x43e5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x43e5('0x6'));var config=require(_0x43e5('0x7'));var controller=require(_0x43e5('0x8'));router[_0x43e5('0x9')]('/',auth[_0x43e5('0xa')](),controller['index']);router[_0x43e5('0x9')]('/describe',auth[_0x43e5('0xa')](),controller['describe']);router[_0x43e5('0x9')](_0x43e5('0xb'),auth['isAuthenticated'](),controller[_0x43e5('0xc')]);router[_0x43e5('0xd')]('/',auth[_0x43e5('0xa')](),controller['create']);router['put'](_0x43e5('0xb'),auth[_0x43e5('0xa')](),controller[_0x43e5('0xe')]);module[_0x43e5('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 8c12501..746a6a0 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 _0x9b67=['STRING','name','sequelize','exports'];(function(_0x141338,_0x4a8156){var _0x3688d7=function(_0x59a3c7){while(--_0x59a3c7){_0x141338['push'](_0x141338['shift']());}};_0x3688d7(++_0x4a8156);}(_0x9b67,0xf6));var _0x79b6=function(_0x58ac68,_0x13c2bb){_0x58ac68=_0x58ac68-0x0;var _0x175232=_0x9b67[_0x58ac68];return _0x175232;};'use strict';var Sequelize=require(_0x79b6('0x0'));module[_0x79b6('0x1')]={'name':{'type':Sequelize[_0x79b6('0x2')],'unique':_0x79b6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x79b6('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb43b=['STRING','name','sequelize'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0xb43b,0xbf));var _0xbb43=function(_0x40805e,_0x2d8a5a){_0x40805e=_0x40805e-0x0;var _0x2c3eca=_0xb43b[_0x40805e];return _0x2c3eca;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb43('0x1')],'unique':_0xbb43('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbb43('0x1')]},'dialPrefix':{'type':Sequelize[_0xbb43('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index e1b069e..32b0796 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 _0xf7ac=['CmList','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','user','role','Lists','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','findOne','Disposition','length','ListId','findAll','removeDispositions','addContacts','CmContact','isArray','tags','join','push','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','raw','ContactItemType','select','from','cm_contacts','distinct','field','c.cf_','customField_','alias','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','description_additionalPhone_','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','type','text','TEXT','number','switch','defaultValue','cf_%s','getCustomFields','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','User','getAgents','info','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map'];(function(_0x5603d4,_0x225c88){var _0x2ac7cd=function(_0x1ae5ff){while(--_0x1ae5ff){_0x5603d4['push'](_0x5603d4['shift']());}};_0x2ac7cd(++_0x225c88);}(_0xf7ac,0x1a8));var _0xcf7a=function(_0x414968,_0x1fb53c){_0x414968=_0x414968-0x0;var _0x3ad0a9=_0xf7ac[_0x414968];return _0x3ad0a9;};'use strict';var emlformat=require(_0xcf7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf7a('0x1'));var jsonpatch=require(_0xcf7a('0x2'));var rp=require(_0xcf7a('0x3'));var moment=require(_0xcf7a('0x4'));var BPromise=require(_0xcf7a('0x5'));var Mustache=require(_0xcf7a('0x6'));var util=require('util');var path=require(_0xcf7a('0x7'));var sox=require(_0xcf7a('0x8'));var csv=require(_0xcf7a('0x9'));var ejs=require(_0xcf7a('0xa'));var fs=require('fs');var fs_extra=require(_0xcf7a('0xb'));var _=require(_0xcf7a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcf7a('0xd'));var toCsv=require(_0xcf7a('0x9'));var querystring=require(_0xcf7a('0xe'));var Papa=require(_0xcf7a('0xf'));var Redis=require(_0xcf7a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcf7a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf7a('0x12'))(_0xcf7a('0x13'));var utils=require(_0xcf7a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcf7a('0x15'));var db=require(_0xcf7a('0x16'))['db'];var csv_results;config[_0xcf7a('0x17')]=_[_0xcf7a('0x18')](config[_0xcf7a('0x17')],{'host':_0xcf7a('0x19'),'port':0x18eb});var socket=require(_0xcf7a('0x1a'))(new Redis(config[_0xcf7a('0x17')]));require('./cmList.socket')[_0xcf7a('0x1b')](socket);function respondWithStatusCode(_0x3d11cd,_0x3e85f0){_0x3e85f0=_0x3e85f0||0xcc;return function(_0x2c3075){if(_0x2c3075){return _0x3d11cd[_0xcf7a('0x1c')](_0x3e85f0);}return _0x3d11cd[_0xcf7a('0x1d')](_0x3e85f0)[_0xcf7a('0x1e')]();};}function respondWithResult(_0x29ee37,_0xd95acd){_0xd95acd=_0xd95acd||0xc8;return function(_0x9425a4){if(_0x9425a4){return _0x29ee37['status'](_0xd95acd)['json'](_0x9425a4);}};}function respondWithFilteredResult(_0x514e71,_0x50f9e7){return function(_0x45023d){if(_0x45023d){var _0x1f5949=typeof _0x50f9e7[_0xcf7a('0x1f')]===_0xcf7a('0x20')&&typeof _0x50f9e7[_0xcf7a('0x21')]===_0xcf7a('0x20');var _0x20a3bb=_0x45023d['count'];var _0x12d870=_0x1f5949?0x0:_0x50f9e7[_0xcf7a('0x1f')];var _0x4efd5f=_0x1f5949?_0x45023d[_0xcf7a('0x22')]:_0x50f9e7[_0xcf7a('0x1f')]+_0x50f9e7[_0xcf7a('0x21')];var _0x510175;if(_0x4efd5f>=_0x20a3bb){_0x4efd5f=_0x20a3bb;_0x510175=0xc8;}else{_0x510175=0xce;}_0x514e71[_0xcf7a('0x1d')](_0x510175);return _0x514e71[_0xcf7a('0x23')]('Content-Range',_0x12d870+'-'+_0x4efd5f+'/'+_0x20a3bb)[_0xcf7a('0x24')](_0x45023d);}return null;};}function patchUpdates(_0x4d6a03){return function(_0x42ab85){try{jsonpatch[_0xcf7a('0x25')](_0x42ab85,_0x4d6a03,!![]);}catch(_0x58e76c){return BPromise[_0xcf7a('0x26')](_0x58e76c);}return _0x42ab85[_0xcf7a('0x27')]();};}function saveUpdates(_0xce1d2a,_0x160444){return function(_0x307ee1){if(_0x307ee1){return _0x307ee1[_0xcf7a('0x28')](_0xce1d2a)[_0xcf7a('0x29')](function(_0x5835d4){return _0x5835d4;});}return null;};}function removeEntity(_0x4efbec,_0x182899){return function(_0x5e4639){if(_0x5e4639){return _0x5e4639[_0xcf7a('0x2a')]()[_0xcf7a('0x29')](function(){var _0x62dcbc=_0x5e4639[_0xcf7a('0x2b')]({'plain':!![]});var _0x4376ca='Lists';return db[_0xcf7a('0x2c')][_0xcf7a('0x2a')]({'where':{'type':_0x4376ca,'resourceId':_0x62dcbc['id']}})[_0xcf7a('0x29')](function(){return _0x5e4639;});})[_0xcf7a('0x29')](function(){_0x4efbec[_0xcf7a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x102ea6,_0x438072){return function(_0xda46be){if(!_0xda46be){_0x102ea6[_0xcf7a('0x1c')](0x194);}return _0xda46be;};}function handleError(_0x2cd221,_0x362ec9){_0x362ec9=_0x362ec9||0x1f4;return function(_0x4e355b){logger[_0xcf7a('0x2d')](_0x4e355b[_0xcf7a('0x2e')]);if(_0x4e355b[_0xcf7a('0x2f')]){delete _0x4e355b[_0xcf7a('0x2f')];}_0x2cd221[_0xcf7a('0x1d')](_0x362ec9)['send'](_0x4e355b);};}exports[_0xcf7a('0x30')]=function(_0x20a719,_0x75c4d8){var _0x56f1a0={},_0x4648fa={},_0x79d062={'count':0x0,'rows':[]};var _0x58dacf=_[_0xcf7a('0x31')](db[_0xcf7a('0x32')][_0xcf7a('0x33')],function(_0x555645){return{'name':_0x555645[_0xcf7a('0x34')],'type':_0x555645['type']['key']};});_0x4648fa[_0xcf7a('0x35')]=_[_0xcf7a('0x31')](_0x58dacf,_0xcf7a('0x2f'));_0x4648fa[_0xcf7a('0x36')]=_[_0xcf7a('0x37')](_0x20a719['query']);_0x4648fa[_0xcf7a('0x38')]=_[_0xcf7a('0x39')](_0x4648fa[_0xcf7a('0x35')],_0x4648fa[_0xcf7a('0x36')]);_0x56f1a0[_0xcf7a('0x3a')]=_[_0xcf7a('0x39')](_0x4648fa['model'],qs[_0xcf7a('0x3b')](_0x20a719[_0xcf7a('0x36')]['fields']));_0x56f1a0['attributes']=_0x56f1a0[_0xcf7a('0x3a')]['length']?_0x56f1a0[_0xcf7a('0x3a')]:_0x4648fa[_0xcf7a('0x35')];if(!_0x20a719[_0xcf7a('0x36')][_0xcf7a('0x3c')](_0xcf7a('0x3d'))){_0x56f1a0['limit']=qs[_0xcf7a('0x21')](_0x20a719['query'][_0xcf7a('0x21')]);_0x56f1a0[_0xcf7a('0x1f')]=qs[_0xcf7a('0x1f')](_0x20a719['query'][_0xcf7a('0x1f')]);}_0x56f1a0[_0xcf7a('0x3e')]=qs[_0xcf7a('0x3f')](_0x20a719[_0xcf7a('0x36')][_0xcf7a('0x3f')]);_0x56f1a0[_0xcf7a('0x40')]=qs[_0xcf7a('0x38')](_[_0xcf7a('0x41')](_0x20a719['query'],_0x4648fa[_0xcf7a('0x38')]),_0x58dacf);if(_0x20a719[_0xcf7a('0x36')][_0xcf7a('0x42')]){_0x56f1a0[_0xcf7a('0x40')]=_[_0xcf7a('0x43')](_0x56f1a0[_0xcf7a('0x40')],{'$or':_[_0xcf7a('0x31')](_0x58dacf,function(_0x4d2f60){if(_0x4d2f60['type']!==_0xcf7a('0x44')){var _0x2c4b91={};_0x2c4b91[_0x4d2f60['name']]={'$like':'%'+_0x20a719['query']['filter']+'%'};return _0x2c4b91;}})});}_0x56f1a0=_[_0xcf7a('0x43')]({},_0x56f1a0,_0x20a719[_0xcf7a('0x45')]);var _0x6d7405={'where':_0x56f1a0[_0xcf7a('0x40')]};return db['CmList'][_0xcf7a('0x22')](_0x6d7405)[_0xcf7a('0x29')](function(_0x353a42){_0x79d062['count']=_0x353a42;if(_0x20a719[_0xcf7a('0x36')][_0xcf7a('0x46')]){_0x56f1a0[_0xcf7a('0x47')]=[{'all':!![]}];}return db[_0xcf7a('0x32')]['findAll'](_0x56f1a0);})[_0xcf7a('0x29')](function(_0x161120){_0x79d062[_0xcf7a('0x48')]=_0x161120;return _0x79d062;})[_0xcf7a('0x29')](respondWithFilteredResult(_0x75c4d8,_0x56f1a0))[_0xcf7a('0x49')](handleError(_0x75c4d8,null));};exports[_0xcf7a('0x4a')]=function(_0x17c2cd,_0x4c97e5){var _0x201a26={'raw':![],'where':{'id':_0x17c2cd[_0xcf7a('0x4b')]['id']}},_0xb29f97={};_0xb29f97['model']=_[_0xcf7a('0x37')](db[_0xcf7a('0x32')]['rawAttributes']);_0xb29f97[_0xcf7a('0x36')]=_['keys'](_0x17c2cd[_0xcf7a('0x36')]);_0xb29f97[_0xcf7a('0x38')]=_[_0xcf7a('0x39')](_0xb29f97[_0xcf7a('0x35')],_0xb29f97[_0xcf7a('0x36')]);_0x201a26[_0xcf7a('0x3a')]=_[_0xcf7a('0x39')](_0xb29f97[_0xcf7a('0x35')],qs['fields'](_0x17c2cd['query'][_0xcf7a('0x3b')]));_0x201a26[_0xcf7a('0x3a')]=_0x201a26['attributes']['length']?_0x201a26[_0xcf7a('0x3a')]:_0xb29f97[_0xcf7a('0x35')];if(_0x17c2cd[_0xcf7a('0x36')][_0xcf7a('0x46')]){_0x201a26[_0xcf7a('0x47')]=[{'all':!![]}];}_0x201a26=_[_0xcf7a('0x43')]({},_0x201a26,_0x17c2cd[_0xcf7a('0x45')]);return db[_0xcf7a('0x32')][_0xcf7a('0x4c')](_0x201a26)[_0xcf7a('0x29')](handleEntityNotFound(_0x4c97e5,null))[_0xcf7a('0x29')](respondWithResult(_0x4c97e5,null))[_0xcf7a('0x49')](handleError(_0x4c97e5,null));};exports[_0xcf7a('0x4d')]=function(_0x531912,_0x163155){return db['CmList'][_0xcf7a('0x4d')](_0x531912['body'],{})[_0xcf7a('0x29')](function(_0x474861){var _0x130c38=_0x531912[_0xcf7a('0x4e')]['get']({'plain':!![]});if(!_0x130c38)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x130c38[_0xcf7a('0x4f')]===_0xcf7a('0x4e')){var _0x1b48b2=_0x474861['get']({'plain':!![]});var _0x555a09=_0xcf7a('0x50');return db[_0xcf7a('0x51')][_0xcf7a('0x4c')]({'where':{'name':_0x555a09,'userProfileId':_0x130c38['userProfileId']},'raw':!![]})[_0xcf7a('0x29')](function(_0x4dcba7){if(_0x4dcba7&&_0x4dcba7[_0xcf7a('0x52')]===0x0){return db[_0xcf7a('0x2c')][_0xcf7a('0x4d')]({'name':_0x1b48b2[_0xcf7a('0x2f')],'resourceId':_0x1b48b2['id'],'type':_0x4dcba7['name'],'sectionId':_0x4dcba7['id']},{})['then'](function(){return _0x474861;});}else{return _0x474861;}})[_0xcf7a('0x49')](function(_0x10a8ee){logger['error'](_0xcf7a('0x53'),_0x10a8ee);throw _0x10a8ee;});}return _0x474861;})[_0xcf7a('0x29')](respondWithResult(_0x163155,0xc9))[_0xcf7a('0x49')](handleError(_0x163155,null));};exports['update']=function(_0x569560,_0xc7d42d){if(_0x569560[_0xcf7a('0x54')]['id']){delete _0x569560[_0xcf7a('0x54')]['id'];}return db[_0xcf7a('0x32')][_0xcf7a('0x4c')]({'where':{'id':_0x569560[_0xcf7a('0x4b')]['id']}})[_0xcf7a('0x29')](handleEntityNotFound(_0xc7d42d,null))['then'](saveUpdates(_0x569560[_0xcf7a('0x54')],null))[_0xcf7a('0x29')](respondWithResult(_0xc7d42d,null))[_0xcf7a('0x49')](handleError(_0xc7d42d,null));};exports['destroy']=function(_0x244802,_0x14995f){return db['CmList'][_0xcf7a('0x4c')]({'where':{'id':_0x244802[_0xcf7a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x14995f,null))[_0xcf7a('0x29')](removeEntity(_0x14995f,null))[_0xcf7a('0x49')](handleError(_0x14995f,null));};exports[_0xcf7a('0x55')]=function(_0xbb7519,_0x3bba51){return db[_0xcf7a('0x32')][_0xcf7a('0x55')]()[_0xcf7a('0x29')](respondWithResult(_0x3bba51,null))[_0xcf7a('0x49')](handleError(_0x3bba51,null));};exports[_0xcf7a('0x56')]=function(_0x363ae8,_0x12c1d6,_0x26aa38){if(_0x363ae8[_0xcf7a('0x54')]['id']){delete _0x363ae8[_0xcf7a('0x54')]['id'];}return db[_0xcf7a('0x32')]['find']({'where':{'id':_0x363ae8['params']['id']}})[_0xcf7a('0x29')](handleEntityNotFound(_0x12c1d6,null))['then'](function(_0x456824){if(_0x456824){_0x363ae8[_0xcf7a('0x54')]['ListId']=_0x456824['id'];return db['Disposition'][_0xcf7a('0x4d')](_0x363ae8[_0xcf7a('0x54')]);}})[_0xcf7a('0x29')](respondWithResult(_0x12c1d6,null))['catch'](handleError(_0x12c1d6,null));};exports['getDispositions']=function(_0x5191fa,_0x419468,_0x2f99fc){var _0x53ad37={'raw':![],'where':{}};var _0x3ab93a={};var _0x5add07={'count':0x0,'rows':[]};return db[_0xcf7a('0x32')][_0xcf7a('0x57')]({'where':{'id':_0x5191fa[_0xcf7a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x419468,null))[_0xcf7a('0x29')](function(_0x232ec6){if(_0x232ec6){_0x3ab93a['model']=_[_0xcf7a('0x37')](db[_0xcf7a('0x58')][_0xcf7a('0x33')]);_0x3ab93a['query']=_[_0xcf7a('0x37')](_0x5191fa[_0xcf7a('0x36')]);_0x3ab93a[_0xcf7a('0x38')]=_[_0xcf7a('0x39')](_0x3ab93a[_0xcf7a('0x35')],_0x3ab93a[_0xcf7a('0x36')]);_0x53ad37[_0xcf7a('0x3a')]=_[_0xcf7a('0x39')](_0x3ab93a[_0xcf7a('0x35')],qs[_0xcf7a('0x3b')](_0x5191fa[_0xcf7a('0x36')][_0xcf7a('0x3b')]));_0x53ad37['attributes']=_0x53ad37[_0xcf7a('0x3a')][_0xcf7a('0x59')]?_0x53ad37['attributes']:_0x3ab93a[_0xcf7a('0x35')];if(!_0x5191fa[_0xcf7a('0x36')][_0xcf7a('0x3c')](_0xcf7a('0x3d'))){_0x53ad37[_0xcf7a('0x21')]=qs[_0xcf7a('0x21')](_0x5191fa['query'][_0xcf7a('0x21')]);_0x53ad37[_0xcf7a('0x1f')]=qs[_0xcf7a('0x1f')](_0x5191fa[_0xcf7a('0x36')][_0xcf7a('0x1f')]);}_0x53ad37[_0xcf7a('0x3e')]=qs['sort'](_0x5191fa[_0xcf7a('0x36')][_0xcf7a('0x3f')]);_0x53ad37[_0xcf7a('0x40')]=qs[_0xcf7a('0x38')](_[_0xcf7a('0x41')](_0x5191fa[_0xcf7a('0x36')],_0x3ab93a['filters']));_0x53ad37[_0xcf7a('0x40')][_0xcf7a('0x5a')]=_0x232ec6['id'];if(_0x5191fa['query'][_0xcf7a('0x42')]){_0x53ad37[_0xcf7a('0x40')]=_[_0xcf7a('0x43')](_0x53ad37[_0xcf7a('0x40')],{'$or':_[_0xcf7a('0x31')](_0x53ad37['attributes'],function(_0x2deb10){var _0x2c94cb={};_0x2c94cb[_0x2deb10]={'$like':'%'+_0x5191fa[_0xcf7a('0x36')][_0xcf7a('0x42')]+'%'};return _0x2c94cb;})});}_0x53ad37=_['merge']({},_0x53ad37,_0x5191fa[_0xcf7a('0x45')]);return db['Disposition']['count']({'where':_0x53ad37['where']})[_0xcf7a('0x29')](function(_0x2f21c1){_0x5add07[_0xcf7a('0x22')]=_0x2f21c1;if(_0x5191fa[_0xcf7a('0x36')][_0xcf7a('0x46')]){_0x53ad37[_0xcf7a('0x47')]=[{'all':!![]}];}return db[_0xcf7a('0x58')][_0xcf7a('0x5b')](_0x53ad37);})['then'](function(_0x174f43){_0x5add07[_0xcf7a('0x48')]=_0x174f43;return _0x5add07;});}})[_0xcf7a('0x29')](respondWithFilteredResult(_0x419468,_0x53ad37))[_0xcf7a('0x49')](handleError(_0x419468,null));};exports[_0xcf7a('0x5c')]=function(_0x21c840,_0x23c028,_0xc8664c){return db[_0xcf7a('0x32')]['find']({'where':{'id':_0x21c840[_0xcf7a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x23c028,null))[_0xcf7a('0x29')](function(_0x2b5cdb){if(_0x2b5cdb){return _0x2b5cdb[_0xcf7a('0x5c')](_0x21c840[_0xcf7a('0x36')]['ids']);}})[_0xcf7a('0x29')](respondWithStatusCode(_0x23c028,null))['catch'](handleError(_0x23c028,null));};exports[_0xcf7a('0x5d')]=function(_0x5f432a,_0x634e67,_0x5f301e){return db[_0xcf7a('0x32')][_0xcf7a('0x4c')]({'where':{'id':_0x5f432a[_0xcf7a('0x4b')]['id']}})[_0xcf7a('0x29')](handleEntityNotFound(_0x634e67,null))[_0xcf7a('0x29')](function(_0x4b7664){if(_0x4b7664){var _0x56a8c5=[];var _0x25eae1={'success':[],'errors':[]};return db[_0xcf7a('0x5e')][_0xcf7a('0x55')]()['then'](function(_0xdb1d9b){if(_0x5f432a['body']['tags']&&_[_0xcf7a('0x5f')](_0x5f432a[_0xcf7a('0x54')]['tags'])){if(_0x5f432a['body']['tags'][_0xcf7a('0x59')]){_0x5f432a[_0xcf7a('0x54')][_0xcf7a('0x60')]=_0x5f432a[_0xcf7a('0x54')]['tags'][_0xcf7a('0x61')](';')+';';}else{_0x5f432a[_0xcf7a('0x54')]['tags']=null;}}else{_0x5f432a[_0xcf7a('0x54')][_0xcf7a('0x60')]=null;}if(_0x5f432a[_0xcf7a('0x54')]&&_[_0xcf7a('0x5f')](_0x5f432a[_0xcf7a('0x54')])){for(var _0x2e1c97=0x0;_0x2e1c97<_0x5f432a[_0xcf7a('0x54')][_0xcf7a('0x59')];_0x2e1c97+=0x1){_0x5f432a[_0xcf7a('0x54')][_0x2e1c97][_0xcf7a('0x5a')]=_0x5f432a[_0xcf7a('0x4b')]['id'];_0x56a8c5[_0xcf7a('0x62')](_0x5f432a[_0xcf7a('0x54')][_0x2e1c97]);}return BPromise['each'](_0x56a8c5,function(_0x35f015){return db[_0xcf7a('0x5e')][_0xcf7a('0x4d')](_[_0xcf7a('0x63')](_0x35f015,[_0xcf7a('0x64'),'id'])||{},{'fields':_[_0xcf7a('0x37')](_0xdb1d9b),'raw':!![]})[_0xcf7a('0x29')](function(_0x2d0195){_0x25eae1[_0xcf7a('0x65')][_0xcf7a('0x62')](_0x2d0195[_0xcf7a('0x66')]);})[_0xcf7a('0x49')](function(_0x8eff50){_0x25eae1[_0xcf7a('0x67')][_0xcf7a('0x62')]({'data':_0x35f015,'error':_0x8eff50[_0xcf7a('0x68')]});});})[_0xcf7a('0x29')](function(_0x2f8c71){return _0x25eae1;})[_0xcf7a('0x49')](function(_0x224f0a){return _0x224f0a;});}else{_0x634e67['status'](0x190)[_0xcf7a('0x24')]({'message':_0xcf7a('0x69')});}});}})[_0xcf7a('0x29')](respondWithResult(_0x634e67,null))['catch'](handleError(_0x634e67,null));};exports[_0xcf7a('0x6a')]=function(_0x44701b,_0x5dce33,_0x398de2){var _0x18547a;return db[_0xcf7a('0x32')][_0xcf7a('0x4c')]({'where':{'id':_0x44701b[_0xcf7a('0x4b')]['id']},'include':[{'model':db[_0xcf7a('0x6b')],'as':'CustomFields'}]})[_0xcf7a('0x29')](handleEntityNotFound(_0x5dce33,null))[_0xcf7a('0x29')](function(_0x523840){if(_0x523840){_0x18547a=_0x523840;return db[_0xcf7a('0x5e')]['rawAttributes'];}})['then'](function(_0x39d27f){if(_0x39d27f){var _0x4e9709={};var _0x5ae480={};_0x5ae480[_0xcf7a('0x35')]=_[_0xcf7a('0x6c')](_[_0xcf7a('0x37')](_0x39d27f),_['map'](_0x18547a[_0xcf7a('0x6d')],function(_0x43eb97){return util[_0xcf7a('0x6e')]('cf_%d',_0x43eb97['id']);}));_0x5ae480[_0xcf7a('0x36')]=_['keys'](_0x44701b[_0xcf7a('0x36')]);_0x5ae480[_0xcf7a('0x38')]=_['intersection'](_0x5ae480[_0xcf7a('0x35')],_0x5ae480[_0xcf7a('0x36')]);_0x4e9709[_0xcf7a('0x3a')]=_[_0xcf7a('0x39')](_0x5ae480['model'],qs['fields'](_0x44701b[_0xcf7a('0x36')][_0xcf7a('0x3b')]));_0x4e9709['attributes']=_0x4e9709[_0xcf7a('0x3a')][_0xcf7a('0x59')]?_0x4e9709[_0xcf7a('0x3a')]:_0x5ae480['model'];if(!_0x44701b[_0xcf7a('0x36')]['hasOwnProperty'](_0xcf7a('0x3d'))){_0x4e9709[_0xcf7a('0x21')]=qs[_0xcf7a('0x21')](_0x44701b['query']['limit']);_0x4e9709[_0xcf7a('0x1f')]=qs[_0xcf7a('0x1f')](_0x44701b['query']['offset']);}_0x4e9709[_0xcf7a('0x3e')]=qs[_0xcf7a('0x3f')](_0x44701b['query']['sort']);_0x4e9709[_0xcf7a('0x40')]=qs[_0xcf7a('0x38')](_[_0xcf7a('0x41')](_0x44701b['query'],_0x5ae480[_0xcf7a('0x38')]));_0x4e9709[_0xcf7a('0x6f')]=!![];if(_0x44701b['query'][_0xcf7a('0x42')]){_0x4e9709[_0xcf7a('0x40')]=_[_0xcf7a('0x43')](_0x4e9709['where'],{'$or':_[_0xcf7a('0x31')](_0x4e9709[_0xcf7a('0x3a')],function(_0x442fc3){var _0x24a0de={};_0x24a0de[_0x442fc3]={'$like':'%'+_0x44701b[_0xcf7a('0x36')][_0xcf7a('0x42')]+'%'};return _0x24a0de;})});}_0x4e9709=_['merge']({},_0x4e9709,_0x44701b[_0xcf7a('0x45')]);return _0x18547a[_0xcf7a('0x6a')](_0x4e9709);}})[_0xcf7a('0x29')](respondWithResult(_0x5dce33,null))[_0xcf7a('0x49')](handleError(_0x5dce33,null));};exports['getContactsCsv']=function(_0x45ba0f,_0x210880,_0x4b03f6){var _0x28644d;var _0xa2556a;var _0x3c2304;var _0x424b6d=_0x45ba0f['params']['id'];csv_results=[];return db[_0xcf7a('0x70')][_0xcf7a('0x5b')]({'attributes':['id',_0xcf7a('0x2f')],'raw':!![],'order':['OrderBy']})['then'](function(_0x31695b){_0x28644d=_0x31695b;var _0x1a4d4a=_['keys'](db[_0xcf7a('0x5e')][_0xcf7a('0x33')]);return db[_0xcf7a('0x6b')][_0xcf7a('0x5b')]({'raw':!![],'attributes':['id','alias']})[_0xcf7a('0x29')](function(_0x269b4d){_0xa2556a=_0x269b4d;var _0x510c9d=squel[_0xcf7a('0x71')]()[_0xcf7a('0x3b')](_0x1a4d4a)[_0xcf7a('0x72')](_0xcf7a('0x73'),'c')[_0xcf7a('0x40')]('c.ListId\x20=\x20?',_0x424b6d)[_0xcf7a('0x40')]('c.deletedAt\x20is\x20null')[_0xcf7a('0x74')]();for(var _0x33f3de=0x0;_0x33f3de<_0xa2556a['length'];_0x33f3de++){_0x510c9d[_0xcf7a('0x75')](_0xcf7a('0x76')+_0xa2556a[_0x33f3de]['id'],_0xcf7a('0x77')+_0xa2556a[_0x33f3de][_0xcf7a('0x78')]);}for(var _0x33f3de=0x0;_0x33f3de<_0x28644d['length'];_0x33f3de++){_0x510c9d[_0xcf7a('0x75')](squel[_0xcf7a('0x71')]()[_0xcf7a('0x75')](_0xcf7a('0x79'))[_0xcf7a('0x72')](_0xcf7a('0x7a'))[_0xcf7a('0x40')](_0xcf7a('0x7b'),_0x28644d[_0x33f3de]['id'])[_0xcf7a('0x40')](_0xcf7a('0x7c')),'additionalPhone_'+_0x28644d[_0x33f3de]['name']);_0x510c9d[_0xcf7a('0x75')](squel['select']()['field'](_0xcf7a('0x7d'))[_0xcf7a('0x72')](_0xcf7a('0x7a'))[_0xcf7a('0x40')](_0xcf7a('0x7b'),_0x28644d[_0x33f3de]['id'])[_0xcf7a('0x40')](_0xcf7a('0x7c')),_0xcf7a('0x7e')+_0x28644d[_0x33f3de][_0xcf7a('0x2f')]);}var _0x430093=[];_0x430093[_0xcf7a('0x62')](_0x510c9d['toString']());BPromise['each'](_0x430093,handleQuery)['then'](function(_0x1dbea6){handleQuery(_0x510c9d['toString']());var _0x45bf3a=csv_results[0x0];if(!_[_0xcf7a('0x7f')](_0x45bf3a)){var _0x29012a=toCsv(_0x45bf3a);var _0x5de20e=Date['now']();fs[_0xcf7a('0x80')](util['format'](_0xcf7a('0x81'),_0x424b6d,_0x5de20e),_0x29012a);_0x210880[_0xcf7a('0x82')](_0xcf7a('0x83'),_0xcf7a('0x84')+util[_0xcf7a('0x6e')](_0xcf7a('0x85'),_0x424b6d,_0x5de20e));_0x210880[_0xcf7a('0x82')](_0xcf7a('0x86'),_0xcf7a('0x87'));return _0x210880[_0xcf7a('0x88')](util[_0xcf7a('0x6e')](_0xcf7a('0x81'),_0x424b6d,_0x5de20e));}else{return _0x210880[_0xcf7a('0x1c')](0xcc);}});});});};exports[_0xcf7a('0x89')]=function(_0x4d5660,_0x337c4e,_0x194a12){var _0x220a69;delete _0x4d5660[_0xcf7a('0x54')]['id'];return db['CmList']['findOne']({'where':{'id':_0x4d5660['params']['id']}})[_0xcf7a('0x29')](handleEntityNotFound(_0x337c4e,null))[_0xcf7a('0x29')](function(_0x71efcf){if(_0x71efcf){return db[_0xcf7a('0x8a')]['transaction'](function(_0x44b8ea){return db['CmCustomField'][_0xcf7a('0x4d')](_0x4d5660[_0xcf7a('0x54')],{'transaction':_0x44b8ea})[_0xcf7a('0x29')](function(_0x3bbc1a){_0x220a69=_0x3bbc1a;return _0x71efcf[_0xcf7a('0x8b')](_0x3bbc1a,{'transaction':_0x44b8ea});})['then'](function(){var _0x953afe={'type':db[_0xcf7a('0x8c')]['TEXT'],'transaction':_0x44b8ea};switch(_0x4d5660[_0xcf7a('0x54')][_0xcf7a('0x8d')]){case _0xcf7a('0x8e'):_0x953afe[_0xcf7a('0x8d')]=db['Sequelize'][_0xcf7a('0x8f')];break;case _0xcf7a('0x90'):_0x953afe[_0xcf7a('0x8d')]=db[_0xcf7a('0x8c')]['INTEGER'];break;case _0xcf7a('0x91'):_0x953afe[_0xcf7a('0x8d')]=db[_0xcf7a('0x8c')]['BOOLEAN'];_0x953afe[_0xcf7a('0x92')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0xcf7a('0x73'),util[_0xcf7a('0x6e')](_0xcf7a('0x93'),_0x220a69['id']),_0x953afe);})[_0xcf7a('0x29')](function(){return _0x220a69;});});}})[_0xcf7a('0x29')](respondWithResult(_0x337c4e,null))[_0xcf7a('0x49')](handleError(_0x337c4e,null));};exports[_0xcf7a('0x94')]=function(_0x4dfcaf,_0x337645,_0x317a41){var _0x20d493={};var _0x5852db={};var _0x35e551;var _0x1fe9cc;return db[_0xcf7a('0x32')][_0xcf7a('0x57')]({'where':{'id':_0x4dfcaf[_0xcf7a('0x4b')]['id']}})[_0xcf7a('0x29')](handleEntityNotFound(_0x337645,null))[_0xcf7a('0x29')](function(_0x49228c){if(_0x49228c){_0x35e551=_0x49228c;_0x5852db[_0xcf7a('0x35')]=_['keys'](db[_0xcf7a('0x6b')][_0xcf7a('0x33')]);_0x5852db['query']=_[_0xcf7a('0x37')](_0x4dfcaf[_0xcf7a('0x36')]);_0x5852db['filters']=_[_0xcf7a('0x39')](_0x5852db[_0xcf7a('0x35')],_0x5852db[_0xcf7a('0x36')]);_0x20d493[_0xcf7a('0x3a')]=_[_0xcf7a('0x39')](_0x5852db[_0xcf7a('0x35')],qs['fields'](_0x4dfcaf[_0xcf7a('0x36')][_0xcf7a('0x3b')]));_0x20d493['attributes']=_0x20d493['attributes'][_0xcf7a('0x59')]?_0x20d493[_0xcf7a('0x3a')]:_0x5852db[_0xcf7a('0x35')];_0x20d493['order']=qs[_0xcf7a('0x3f')](_0x4dfcaf[_0xcf7a('0x36')][_0xcf7a('0x3f')]);_0x20d493[_0xcf7a('0x40')]=qs[_0xcf7a('0x38')](_[_0xcf7a('0x41')](_0x4dfcaf[_0xcf7a('0x36')],_0x5852db[_0xcf7a('0x38')]));_0x20d493[_0xcf7a('0x40')]=_[_0xcf7a('0x43')](_0x20d493['where'],{'$or':[{'ListId':_0x49228c['id']},{'ListId':null}]});if(_0x4dfcaf[_0xcf7a('0x36')][_0xcf7a('0x42')]){_0x20d493[_0xcf7a('0x40')]=_[_0xcf7a('0x43')](_0x20d493['where'],{'$or':_[_0xcf7a('0x31')](_0x20d493[_0xcf7a('0x3a')],function(_0x2f3d8d){var _0x5c40a4={};_0x5c40a4[_0x2f3d8d]={'$like':'%'+_0x4dfcaf['query'][_0xcf7a('0x42')]+'%'};return _0x5c40a4;})});}_0x20d493=_[_0xcf7a('0x43')]({},_0x20d493,_0x4dfcaf[_0xcf7a('0x45')]);return db[_0xcf7a('0x6b')]['findAndCountAll'](_0x20d493);}})[_0xcf7a('0x29')](respondWithResult(_0x337645,null))['catch'](handleError(_0x337645,null));};exports[_0xcf7a('0x95')]=function(_0x30953a,_0x1887a1){return db[_0xcf7a('0x6b')]['findAndCountAll']({'where':{'ListId':null}})[_0xcf7a('0x29')](handleEntityNotFound(_0x1887a1,null))[_0xcf7a('0x29')](function(_0x55a09a){return _0x55a09a;})[_0xcf7a('0x29')](respondWithResult(_0x1887a1,null))[_0xcf7a('0x49')](handleError(_0x1887a1,null));};exports[_0xcf7a('0x96')]=function(_0x2498d5,_0x4c40a6,_0x4ecfe2){return db[_0xcf7a('0x32')][_0xcf7a('0x4c')]({'where':{'id':_0x2498d5[_0xcf7a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c40a6,null))[_0xcf7a('0x29')](function(_0x454c4b){if(_0x454c4b){return _0x454c4b[_0xcf7a('0x96')](_0x2498d5['body'][_0xcf7a('0x64')],_[_0xcf7a('0x63')](_0x2498d5[_0xcf7a('0x54')],[_0xcf7a('0x64'),'id'])||{})[_0xcf7a('0x97')](function(_0x101507){for(var _0x565bfd=0x0;_0x565bfd<_0x2498d5['body'][_0xcf7a('0x64')][_0xcf7a('0x59')];_0x565bfd+=0x1){socket[_0xcf7a('0x98')]('userCmList:save',{'UserId':Number(_0x2498d5[_0xcf7a('0x54')][_0xcf7a('0x64')][_0x565bfd]),'CmListId':Number(_0x2498d5[_0xcf7a('0x4b')]['id'])});}return _0x101507;});}})['then'](respondWithResult(_0x4c40a6,null))['catch'](handleError(_0x4c40a6,null));};exports[_0xcf7a('0x99')]=function(_0x262ff1,_0x1b0102,_0x2aedcb){return db[_0xcf7a('0x32')][_0xcf7a('0x4c')]({'where':{'id':_0x262ff1[_0xcf7a('0x4b')]['id']}})[_0xcf7a('0x29')](handleEntityNotFound(_0x1b0102,null))[_0xcf7a('0x29')](function(_0x2691d5){if(_0x2691d5){return _0x2691d5[_0xcf7a('0x99')](_0x262ff1['query'][_0xcf7a('0x64')])['then'](function(){if(_['isArray'](_0x262ff1[_0xcf7a('0x36')]['ids'])){for(var _0xf4bde9=0x0;_0xf4bde9<_0x262ff1['query'][_0xcf7a('0x64')]['length'];_0xf4bde9+=0x1){socket[_0xcf7a('0x98')](_0xcf7a('0x9a'),{'UserId':Number(_0x262ff1[_0xcf7a('0x36')][_0xcf7a('0x64')][_0xf4bde9]),'CmListId':Number(_0x262ff1[_0xcf7a('0x4b')]['id'])});}}else{socket[_0xcf7a('0x98')]('userCmList:remove',{'UserId':Number(_0x262ff1[_0xcf7a('0x36')][_0xcf7a('0x64')]),'CmListId':Number(_0x262ff1[_0xcf7a('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b0102,null))[_0xcf7a('0x49')](handleError(_0x1b0102,null));};exports['getAgents']=function(_0x464e61,_0x4d854e,_0x19378a){var _0x19f2a1={};var _0x131043={};var _0x1d37fa;var _0x50f6da;return db['CmList'][_0xcf7a('0x57')]({'where':{'id':_0x464e61[_0xcf7a('0x4b')]['id']}})[_0xcf7a('0x29')](handleEntityNotFound(_0x4d854e,null))[_0xcf7a('0x29')](function(_0x57e9de){if(_0x57e9de){_0x1d37fa=_0x57e9de;_0x131043[_0xcf7a('0x35')]=_[_0xcf7a('0x37')](db[_0xcf7a('0x9b')][_0xcf7a('0x33')]);_0x131043['query']=_[_0xcf7a('0x37')](_0x464e61[_0xcf7a('0x36')]);_0x131043[_0xcf7a('0x38')]=_['intersection'](_0x131043['model'],_0x131043[_0xcf7a('0x36')]);_0x19f2a1[_0xcf7a('0x3a')]=_[_0xcf7a('0x39')](_0x131043[_0xcf7a('0x35')],qs[_0xcf7a('0x3b')](_0x464e61[_0xcf7a('0x36')][_0xcf7a('0x3b')]));_0x19f2a1[_0xcf7a('0x3a')]=_0x19f2a1[_0xcf7a('0x3a')][_0xcf7a('0x59')]?_0x19f2a1[_0xcf7a('0x3a')]:_0x131043[_0xcf7a('0x35')];_0x19f2a1[_0xcf7a('0x3e')]=qs[_0xcf7a('0x3f')](_0x464e61['query']['sort']);_0x19f2a1[_0xcf7a('0x40')]=qs['filters'](_[_0xcf7a('0x41')](_0x464e61['query'],_0x131043[_0xcf7a('0x38')]));if(_0x464e61[_0xcf7a('0x36')]['filter']){_0x19f2a1[_0xcf7a('0x40')]=_[_0xcf7a('0x43')](_0x19f2a1[_0xcf7a('0x40')],{'$or':_['map'](_0x19f2a1[_0xcf7a('0x3a')],function(_0x218a15){var _0xcc0dad={};_0xcc0dad[_0x218a15]={'$like':'%'+_0x464e61[_0xcf7a('0x36')][_0xcf7a('0x42')]+'%'};return _0xcc0dad;})});}_0x19f2a1=_['merge']({},_0x19f2a1,_0x464e61['options']);return _0x1d37fa[_0xcf7a('0x9c')](_0x19f2a1);}})[_0xcf7a('0x29')](function(_0x421f73){if(_0x421f73){_0x50f6da=_0x421f73[_0xcf7a('0x59')];if(!_0x464e61[_0xcf7a('0x36')][_0xcf7a('0x3c')](_0xcf7a('0x3d'))){_0x19f2a1['limit']=qs[_0xcf7a('0x21')](_0x464e61[_0xcf7a('0x36')][_0xcf7a('0x21')]);_0x19f2a1['offset']=qs[_0xcf7a('0x1f')](_0x464e61[_0xcf7a('0x36')][_0xcf7a('0x1f')]);}return _0x1d37fa[_0xcf7a('0x9c')](_0x19f2a1);}})['then'](function(_0x4be134){if(_0x4be134){return _0x4be134?{'count':_0x50f6da,'rows':_0x4be134}:null;}})[_0xcf7a('0x29')](respondWithResult(_0x4d854e,null))['catch'](handleError(_0x4d854e,null));};function handleQuery(_0x16c8eb){logger[_0xcf7a('0x9d')](_0x16c8eb);return db['sequelize'][_0xcf7a('0x36')](_0x16c8eb)[_0xcf7a('0x97')](function(_0x3b3a80){csv_results[_0xcf7a('0x62')](_0x3b3a80);})[_0xcf7a('0x49')](function(_0x53a20a){logger[_0xcf7a('0x2d')](_0x53a20a['message']);});} \ No newline at end of file +var _0xa8c0=['info','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','json','undefined','offset','count','status','set','Content-Range','apply','save','then','destroy','get','Lists','end','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','update','params','describe','ListId','Disposition','getDispositions','findOne','order','filter','removeDispositions','ids','addContacts','CmContact','tags','push','each','omit','success','dataValues','message','Malformed\x20request\x20syntax','CmCustomField','concat','format','cf_%d','raw','getContacts','getContactsCsv','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','getAgents'];(function(_0xc2488,_0x5c5c57){var _0x419250=function(_0x4bf55e){while(--_0x4bf55e){_0xc2488['push'](_0xc2488['shift']());}};_0x419250(++_0x5c5c57);}(_0xa8c0,0x149));var _0x0a8c=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0xa8c0[_0x1a4a06];return _0x49ec08;};'use strict';var emlformat=require(_0x0a8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a8c('0x1'));var jsonpatch=require(_0x0a8c('0x2'));var rp=require(_0x0a8c('0x3'));var moment=require('moment');var BPromise=require(_0x0a8c('0x4'));var Mustache=require(_0x0a8c('0x5'));var util=require('util');var path=require(_0x0a8c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a8c('0x7'));var _=require(_0x0a8c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a8c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0a8c('0xa'));var querystring=require(_0x0a8c('0xb'));var Papa=require(_0x0a8c('0xc'));var Redis=require(_0x0a8c('0xd'));var authService=require(_0x0a8c('0xe'));var qs=require(_0x0a8c('0xf'));var as=require(_0x0a8c('0x10'));var hardwareService=require(_0x0a8c('0x11'));var logger=require(_0x0a8c('0x12'))(_0x0a8c('0x13'));var utils=require('../../config/utils');var config=require(_0x0a8c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a8c('0x15'))['db'];var csv_results;config[_0x0a8c('0x16')]=_[_0x0a8c('0x17')](config['redis'],{'host':_0x0a8c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a8c('0x16')]));require(_0x0a8c('0x19'))[_0x0a8c('0x1a')](socket);function respondWithStatusCode(_0x16b920,_0x2025f){_0x2025f=_0x2025f||0xcc;return function(_0x4eb47f){if(_0x4eb47f){return _0x16b920[_0x0a8c('0x1b')](_0x2025f);}return _0x16b920['status'](_0x2025f)['end']();};}function respondWithResult(_0x2016b1,_0x4aa1bb){_0x4aa1bb=_0x4aa1bb||0xc8;return function(_0x4d2f7e){if(_0x4d2f7e){return _0x2016b1['status'](_0x4aa1bb)[_0x0a8c('0x1c')](_0x4d2f7e);}};}function respondWithFilteredResult(_0x23faf4,_0x3f912a){return function(_0x227ada){if(_0x227ada){var _0x359e13=typeof _0x3f912a['offset']===_0x0a8c('0x1d')&&typeof _0x3f912a['limit']===_0x0a8c('0x1d');var _0x463df0=_0x227ada['count'];var _0x2965be=_0x359e13?0x0:_0x3f912a[_0x0a8c('0x1e')];var _0x2c55c2=_0x359e13?_0x227ada[_0x0a8c('0x1f')]:_0x3f912a[_0x0a8c('0x1e')]+_0x3f912a['limit'];var _0x35914b;if(_0x2c55c2>=_0x463df0){_0x2c55c2=_0x463df0;_0x35914b=0xc8;}else{_0x35914b=0xce;}_0x23faf4[_0x0a8c('0x20')](_0x35914b);return _0x23faf4[_0x0a8c('0x21')](_0x0a8c('0x22'),_0x2965be+'-'+_0x2c55c2+'/'+_0x463df0)[_0x0a8c('0x1c')](_0x227ada);}return null;};}function patchUpdates(_0x42c41d){return function(_0x3f5b44){try{jsonpatch[_0x0a8c('0x23')](_0x3f5b44,_0x42c41d,!![]);}catch(_0x47270f){return BPromise['reject'](_0x47270f);}return _0x3f5b44[_0x0a8c('0x24')]();};}function saveUpdates(_0x2ec7fd,_0x7edcc7){return function(_0x39d1df){if(_0x39d1df){return _0x39d1df['update'](_0x2ec7fd)[_0x0a8c('0x25')](function(_0x38a6c9){return _0x38a6c9;});}return null;};}function removeEntity(_0x49e34d,_0x4e91d2){return function(_0x411d6d){if(_0x411d6d){return _0x411d6d[_0x0a8c('0x26')]()['then'](function(){var _0x4e2db4=_0x411d6d[_0x0a8c('0x27')]({'plain':!![]});var _0x54b5f8=_0x0a8c('0x28');return db['UserProfileResource'][_0x0a8c('0x26')]({'where':{'type':_0x54b5f8,'resourceId':_0x4e2db4['id']}})['then'](function(){return _0x411d6d;});})[_0x0a8c('0x25')](function(){_0x49e34d[_0x0a8c('0x20')](0xcc)[_0x0a8c('0x29')]();});}};}function handleEntityNotFound(_0xf35e83,_0x3e9693){return function(_0x1b5c1a){if(!_0x1b5c1a){_0xf35e83[_0x0a8c('0x1b')](0x194);}return _0x1b5c1a;};}function handleError(_0x1997b2,_0x12fd0f){_0x12fd0f=_0x12fd0f||0x1f4;return function(_0x5bae13){logger['error'](_0x5bae13['stack']);if(_0x5bae13[_0x0a8c('0x2a')]){delete _0x5bae13[_0x0a8c('0x2a')];}_0x1997b2[_0x0a8c('0x20')](_0x12fd0f)[_0x0a8c('0x2b')](_0x5bae13);};}exports[_0x0a8c('0x2c')]=function(_0x426c74,_0x38cdda){var _0x40de1c={},_0xf05822={},_0x4548e8={'count':0x0,'rows':[]};var _0x54846f=_[_0x0a8c('0x2d')](db[_0x0a8c('0x2e')][_0x0a8c('0x2f')],function(_0x122d33){return{'name':_0x122d33[_0x0a8c('0x30')],'type':_0x122d33[_0x0a8c('0x31')][_0x0a8c('0x32')]};});_0xf05822['model']=_[_0x0a8c('0x2d')](_0x54846f,'name');_0xf05822[_0x0a8c('0x33')]=_[_0x0a8c('0x34')](_0x426c74[_0x0a8c('0x33')]);_0xf05822['filters']=_[_0x0a8c('0x35')](_0xf05822[_0x0a8c('0x36')],_0xf05822[_0x0a8c('0x33')]);_0x40de1c[_0x0a8c('0x37')]=_[_0x0a8c('0x35')](_0xf05822[_0x0a8c('0x36')],qs[_0x0a8c('0x38')](_0x426c74[_0x0a8c('0x33')][_0x0a8c('0x38')]));_0x40de1c[_0x0a8c('0x37')]=_0x40de1c[_0x0a8c('0x37')]['length']?_0x40de1c['attributes']:_0xf05822[_0x0a8c('0x36')];if(!_0x426c74[_0x0a8c('0x33')][_0x0a8c('0x39')](_0x0a8c('0x3a'))){_0x40de1c[_0x0a8c('0x3b')]=qs[_0x0a8c('0x3b')](_0x426c74['query'][_0x0a8c('0x3b')]);_0x40de1c[_0x0a8c('0x1e')]=qs[_0x0a8c('0x1e')](_0x426c74[_0x0a8c('0x33')][_0x0a8c('0x1e')]);}_0x40de1c['order']=qs['sort'](_0x426c74['query'][_0x0a8c('0x3c')]);_0x40de1c['where']=qs[_0x0a8c('0x3d')](_[_0x0a8c('0x3e')](_0x426c74[_0x0a8c('0x33')],_0xf05822[_0x0a8c('0x3d')]),_0x54846f);if(_0x426c74['query']['filter']){_0x40de1c[_0x0a8c('0x3f')]=_[_0x0a8c('0x40')](_0x40de1c['where'],{'$or':_[_0x0a8c('0x2d')](_0x54846f,function(_0x275d58){if(_0x275d58[_0x0a8c('0x31')]!==_0x0a8c('0x41')){var _0xe3f0bc={};_0xe3f0bc[_0x275d58[_0x0a8c('0x2a')]]={'$like':'%'+_0x426c74['query']['filter']+'%'};return _0xe3f0bc;}})});}_0x40de1c=_['merge']({},_0x40de1c,_0x426c74[_0x0a8c('0x42')]);var _0x237f30={'where':_0x40de1c[_0x0a8c('0x3f')]};return db[_0x0a8c('0x2e')][_0x0a8c('0x1f')](_0x237f30)[_0x0a8c('0x25')](function(_0x4e92dc){_0x4548e8['count']=_0x4e92dc;if(_0x426c74[_0x0a8c('0x33')][_0x0a8c('0x43')]){_0x40de1c['include']=[{'all':!![]}];}return db['CmList'][_0x0a8c('0x44')](_0x40de1c);})['then'](function(_0x1df6c9){_0x4548e8[_0x0a8c('0x45')]=_0x1df6c9;return _0x4548e8;})[_0x0a8c('0x25')](respondWithFilteredResult(_0x38cdda,_0x40de1c))[_0x0a8c('0x46')](handleError(_0x38cdda,null));};exports[_0x0a8c('0x47')]=function(_0x2f400b,_0x552dad){var _0xa57270={'raw':![],'where':{'id':_0x2f400b['params']['id']}},_0x3f7055={};_0x3f7055['model']=_[_0x0a8c('0x34')](db[_0x0a8c('0x2e')][_0x0a8c('0x2f')]);_0x3f7055[_0x0a8c('0x33')]=_[_0x0a8c('0x34')](_0x2f400b['query']);_0x3f7055['filters']=_[_0x0a8c('0x35')](_0x3f7055[_0x0a8c('0x36')],_0x3f7055['query']);_0xa57270[_0x0a8c('0x37')]=_[_0x0a8c('0x35')](_0x3f7055['model'],qs['fields'](_0x2f400b['query'][_0x0a8c('0x38')]));_0xa57270[_0x0a8c('0x37')]=_0xa57270[_0x0a8c('0x37')][_0x0a8c('0x48')]?_0xa57270[_0x0a8c('0x37')]:_0x3f7055[_0x0a8c('0x36')];if(_0x2f400b[_0x0a8c('0x33')][_0x0a8c('0x43')]){_0xa57270[_0x0a8c('0x49')]=[{'all':!![]}];}_0xa57270=_[_0x0a8c('0x40')]({},_0xa57270,_0x2f400b['options']);return db['CmList'][_0x0a8c('0x4a')](_0xa57270)[_0x0a8c('0x25')](handleEntityNotFound(_0x552dad,null))[_0x0a8c('0x25')](respondWithResult(_0x552dad,null))[_0x0a8c('0x46')](handleError(_0x552dad,null));};exports[_0x0a8c('0x4b')]=function(_0x482285,_0x5cdb37){return db[_0x0a8c('0x2e')][_0x0a8c('0x4b')](_0x482285[_0x0a8c('0x4c')],{})['then'](function(_0x1af319){var _0x2b8922=_0x482285[_0x0a8c('0x4d')][_0x0a8c('0x27')]({'plain':!![]});if(!_0x2b8922)throw new Error(_0x0a8c('0x4e'));if(_0x2b8922['role']===_0x0a8c('0x4d')){var _0x145d57=_0x1af319['get']({'plain':!![]});var _0x40a8d1='Lists';return db[_0x0a8c('0x4f')][_0x0a8c('0x4a')]({'where':{'name':_0x40a8d1,'userProfileId':_0x2b8922[_0x0a8c('0x50')]},'raw':!![]})[_0x0a8c('0x25')](function(_0x25125c){if(_0x25125c&&_0x25125c[_0x0a8c('0x51')]===0x0){return db[_0x0a8c('0x52')][_0x0a8c('0x4b')]({'name':_0x145d57[_0x0a8c('0x2a')],'resourceId':_0x145d57['id'],'type':_0x25125c[_0x0a8c('0x2a')],'sectionId':_0x25125c['id']},{})['then'](function(){return _0x1af319;});}else{return _0x1af319;}})['catch'](function(_0x279802){logger[_0x0a8c('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x279802);throw _0x279802;});}return _0x1af319;})['then'](respondWithResult(_0x5cdb37,0xc9))[_0x0a8c('0x46')](handleError(_0x5cdb37,null));};exports[_0x0a8c('0x54')]=function(_0x51d7c2,_0x37820c){if(_0x51d7c2[_0x0a8c('0x4c')]['id']){delete _0x51d7c2[_0x0a8c('0x4c')]['id'];}return db[_0x0a8c('0x2e')]['find']({'where':{'id':_0x51d7c2[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x37820c,null))[_0x0a8c('0x25')](saveUpdates(_0x51d7c2[_0x0a8c('0x4c')],null))[_0x0a8c('0x25')](respondWithResult(_0x37820c,null))[_0x0a8c('0x46')](handleError(_0x37820c,null));};exports[_0x0a8c('0x26')]=function(_0x15c6be,_0x5946f7){return db[_0x0a8c('0x2e')][_0x0a8c('0x4a')]({'where':{'id':_0x15c6be[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x5946f7,null))['then'](removeEntity(_0x5946f7,null))[_0x0a8c('0x46')](handleError(_0x5946f7,null));};exports[_0x0a8c('0x56')]=function(_0x2c96da,_0x3d0eac){return db[_0x0a8c('0x2e')][_0x0a8c('0x56')]()[_0x0a8c('0x25')](respondWithResult(_0x3d0eac,null))[_0x0a8c('0x46')](handleError(_0x3d0eac,null));};exports['addDisposition']=function(_0x160dac,_0x4511bb,_0x6d723e){if(_0x160dac[_0x0a8c('0x4c')]['id']){delete _0x160dac[_0x0a8c('0x4c')]['id'];}return db[_0x0a8c('0x2e')]['find']({'where':{'id':_0x160dac[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x4511bb,null))[_0x0a8c('0x25')](function(_0x19bff3){if(_0x19bff3){_0x160dac[_0x0a8c('0x4c')][_0x0a8c('0x57')]=_0x19bff3['id'];return db[_0x0a8c('0x58')]['create'](_0x160dac[_0x0a8c('0x4c')]);}})[_0x0a8c('0x25')](respondWithResult(_0x4511bb,null))[_0x0a8c('0x46')](handleError(_0x4511bb,null));};exports[_0x0a8c('0x59')]=function(_0x9362bd,_0x455898,_0x17b737){var _0x5bff92={'raw':![],'where':{}};var _0x4139c7={};var _0x41ceef={'count':0x0,'rows':[]};return db[_0x0a8c('0x2e')][_0x0a8c('0x5a')]({'where':{'id':_0x9362bd[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x455898,null))[_0x0a8c('0x25')](function(_0x4e4332){if(_0x4e4332){_0x4139c7[_0x0a8c('0x36')]=_['keys'](db['Disposition'][_0x0a8c('0x2f')]);_0x4139c7['query']=_[_0x0a8c('0x34')](_0x9362bd['query']);_0x4139c7[_0x0a8c('0x3d')]=_['intersection'](_0x4139c7[_0x0a8c('0x36')],_0x4139c7['query']);_0x5bff92['attributes']=_[_0x0a8c('0x35')](_0x4139c7['model'],qs[_0x0a8c('0x38')](_0x9362bd['query']['fields']));_0x5bff92['attributes']=_0x5bff92[_0x0a8c('0x37')][_0x0a8c('0x48')]?_0x5bff92[_0x0a8c('0x37')]:_0x4139c7[_0x0a8c('0x36')];if(!_0x9362bd[_0x0a8c('0x33')]['hasOwnProperty'](_0x0a8c('0x3a'))){_0x5bff92[_0x0a8c('0x3b')]=qs['limit'](_0x9362bd[_0x0a8c('0x33')][_0x0a8c('0x3b')]);_0x5bff92['offset']=qs[_0x0a8c('0x1e')](_0x9362bd['query']['offset']);}_0x5bff92[_0x0a8c('0x5b')]=qs[_0x0a8c('0x3c')](_0x9362bd[_0x0a8c('0x33')][_0x0a8c('0x3c')]);_0x5bff92[_0x0a8c('0x3f')]=qs[_0x0a8c('0x3d')](_['pick'](_0x9362bd[_0x0a8c('0x33')],_0x4139c7[_0x0a8c('0x3d')]));_0x5bff92[_0x0a8c('0x3f')][_0x0a8c('0x57')]=_0x4e4332['id'];if(_0x9362bd['query']['filter']){_0x5bff92[_0x0a8c('0x3f')]=_[_0x0a8c('0x40')](_0x5bff92[_0x0a8c('0x3f')],{'$or':_[_0x0a8c('0x2d')](_0x5bff92['attributes'],function(_0x9e0f0b){var _0x249af8={};_0x249af8[_0x9e0f0b]={'$like':'%'+_0x9362bd[_0x0a8c('0x33')][_0x0a8c('0x5c')]+'%'};return _0x249af8;})});}_0x5bff92=_[_0x0a8c('0x40')]({},_0x5bff92,_0x9362bd[_0x0a8c('0x42')]);return db[_0x0a8c('0x58')][_0x0a8c('0x1f')]({'where':_0x5bff92['where']})['then'](function(_0x2c9aae){_0x41ceef['count']=_0x2c9aae;if(_0x9362bd[_0x0a8c('0x33')][_0x0a8c('0x43')]){_0x5bff92[_0x0a8c('0x49')]=[{'all':!![]}];}return db[_0x0a8c('0x58')][_0x0a8c('0x44')](_0x5bff92);})[_0x0a8c('0x25')](function(_0x4c1d5f){_0x41ceef['rows']=_0x4c1d5f;return _0x41ceef;});}})['then'](respondWithFilteredResult(_0x455898,_0x5bff92))[_0x0a8c('0x46')](handleError(_0x455898,null));};exports[_0x0a8c('0x5d')]=function(_0x573b6a,_0x1b7e77,_0x3eaa3d){return db[_0x0a8c('0x2e')]['find']({'where':{'id':_0x573b6a[_0x0a8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x1b7e77,null))[_0x0a8c('0x25')](function(_0x34128e){if(_0x34128e){return _0x34128e['removeDispositions'](_0x573b6a['query'][_0x0a8c('0x5e')]);}})[_0x0a8c('0x25')](respondWithStatusCode(_0x1b7e77,null))[_0x0a8c('0x46')](handleError(_0x1b7e77,null));};exports[_0x0a8c('0x5f')]=function(_0x3b8a87,_0x460008,_0x286d40){return db[_0x0a8c('0x2e')][_0x0a8c('0x4a')]({'where':{'id':_0x3b8a87[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x460008,null))[_0x0a8c('0x25')](function(_0x1d5c8b){if(_0x1d5c8b){var _0x8fefbc=[];var _0x5219f1={'success':[],'errors':[]};return db[_0x0a8c('0x60')][_0x0a8c('0x56')]()['then'](function(_0x3c3c6d){if(_0x3b8a87[_0x0a8c('0x4c')][_0x0a8c('0x61')]&&_['isArray'](_0x3b8a87[_0x0a8c('0x4c')]['tags'])){if(_0x3b8a87[_0x0a8c('0x4c')][_0x0a8c('0x61')][_0x0a8c('0x48')]){_0x3b8a87[_0x0a8c('0x4c')][_0x0a8c('0x61')]=_0x3b8a87[_0x0a8c('0x4c')][_0x0a8c('0x61')]['join'](';')+';';}else{_0x3b8a87[_0x0a8c('0x4c')]['tags']=null;}}else{_0x3b8a87[_0x0a8c('0x4c')][_0x0a8c('0x61')]=null;}if(_0x3b8a87[_0x0a8c('0x4c')]&&_['isArray'](_0x3b8a87['body'])){for(var _0x57a96a=0x0;_0x57a96a<_0x3b8a87[_0x0a8c('0x4c')][_0x0a8c('0x48')];_0x57a96a+=0x1){_0x3b8a87['body'][_0x57a96a][_0x0a8c('0x57')]=_0x3b8a87[_0x0a8c('0x55')]['id'];_0x8fefbc[_0x0a8c('0x62')](_0x3b8a87[_0x0a8c('0x4c')][_0x57a96a]);}return BPromise[_0x0a8c('0x63')](_0x8fefbc,function(_0x4de2df){return db[_0x0a8c('0x60')][_0x0a8c('0x4b')](_[_0x0a8c('0x64')](_0x4de2df,[_0x0a8c('0x5e'),'id'])||{},{'fields':_[_0x0a8c('0x34')](_0x3c3c6d),'raw':!![]})['then'](function(_0x1218cc){_0x5219f1[_0x0a8c('0x65')][_0x0a8c('0x62')](_0x1218cc[_0x0a8c('0x66')]);})[_0x0a8c('0x46')](function(_0x3da9bd){_0x5219f1['errors'][_0x0a8c('0x62')]({'data':_0x4de2df,'error':_0x3da9bd[_0x0a8c('0x67')]});});})['then'](function(_0x25dc21){return _0x5219f1;})['catch'](function(_0x4bfbf5){return _0x4bfbf5;});}else{_0x460008[_0x0a8c('0x20')](0x190)[_0x0a8c('0x1c')]({'message':_0x0a8c('0x68')});}});}})[_0x0a8c('0x25')](respondWithResult(_0x460008,null))['catch'](handleError(_0x460008,null));};exports['getContacts']=function(_0x44f92c,_0x4a3113,_0x3574fb){var _0x470c0a;return db['CmList'][_0x0a8c('0x4a')]({'where':{'id':_0x44f92c[_0x0a8c('0x55')]['id']},'include':[{'model':db[_0x0a8c('0x69')],'as':'CustomFields'}]})[_0x0a8c('0x25')](handleEntityNotFound(_0x4a3113,null))[_0x0a8c('0x25')](function(_0x211099){if(_0x211099){_0x470c0a=_0x211099;return db['CmContact'][_0x0a8c('0x2f')];}})['then'](function(_0xe9a2fc){if(_0xe9a2fc){var _0x1efc9f={};var _0x53ec3f={};_0x53ec3f[_0x0a8c('0x36')]=_[_0x0a8c('0x6a')](_[_0x0a8c('0x34')](_0xe9a2fc),_[_0x0a8c('0x2d')](_0x470c0a['CustomFields'],function(_0x307775){return util[_0x0a8c('0x6b')](_0x0a8c('0x6c'),_0x307775['id']);}));_0x53ec3f['query']=_['keys'](_0x44f92c['query']);_0x53ec3f['filters']=_[_0x0a8c('0x35')](_0x53ec3f[_0x0a8c('0x36')],_0x53ec3f[_0x0a8c('0x33')]);_0x1efc9f['attributes']=_[_0x0a8c('0x35')](_0x53ec3f[_0x0a8c('0x36')],qs[_0x0a8c('0x38')](_0x44f92c[_0x0a8c('0x33')][_0x0a8c('0x38')]));_0x1efc9f[_0x0a8c('0x37')]=_0x1efc9f[_0x0a8c('0x37')]['length']?_0x1efc9f[_0x0a8c('0x37')]:_0x53ec3f['model'];if(!_0x44f92c['query']['hasOwnProperty'](_0x0a8c('0x3a'))){_0x1efc9f['limit']=qs['limit'](_0x44f92c[_0x0a8c('0x33')]['limit']);_0x1efc9f[_0x0a8c('0x1e')]=qs[_0x0a8c('0x1e')](_0x44f92c['query']['offset']);}_0x1efc9f[_0x0a8c('0x5b')]=qs[_0x0a8c('0x3c')](_0x44f92c[_0x0a8c('0x33')][_0x0a8c('0x3c')]);_0x1efc9f['where']=qs[_0x0a8c('0x3d')](_['pick'](_0x44f92c[_0x0a8c('0x33')],_0x53ec3f['filters']));_0x1efc9f[_0x0a8c('0x6d')]=!![];if(_0x44f92c[_0x0a8c('0x33')][_0x0a8c('0x5c')]){_0x1efc9f[_0x0a8c('0x3f')]=_[_0x0a8c('0x40')](_0x1efc9f[_0x0a8c('0x3f')],{'$or':_['map'](_0x1efc9f[_0x0a8c('0x37')],function(_0x239523){var _0x1838a3={};_0x1838a3[_0x239523]={'$like':'%'+_0x44f92c['query'][_0x0a8c('0x5c')]+'%'};return _0x1838a3;})});}_0x1efc9f=_[_0x0a8c('0x40')]({},_0x1efc9f,_0x44f92c['options']);return _0x470c0a[_0x0a8c('0x6e')](_0x1efc9f);}})[_0x0a8c('0x25')](respondWithResult(_0x4a3113,null))['catch'](handleError(_0x4a3113,null));};exports[_0x0a8c('0x6f')]=function(_0x4e080b,_0x22e651,_0x40f478){var _0x7cefb7;var _0x3c14e7;var _0x185186;var _0x59d3f3=_0x4e080b[_0x0a8c('0x55')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0x0a8c('0x2a')],'raw':!![],'order':[_0x0a8c('0x70')]})[_0x0a8c('0x25')](function(_0x99bfec){_0x7cefb7=_0x99bfec;var _0x103f30=_[_0x0a8c('0x34')](db[_0x0a8c('0x60')][_0x0a8c('0x2f')]);return db['CmCustomField'][_0x0a8c('0x44')]({'raw':!![],'attributes':['id',_0x0a8c('0x71')]})[_0x0a8c('0x25')](function(_0x30e831){_0x3c14e7=_0x30e831;var _0x4e1f5d=squel[_0x0a8c('0x72')]()['fields'](_0x103f30)[_0x0a8c('0x73')](_0x0a8c('0x74'),'c')['where'](_0x0a8c('0x75'),_0x59d3f3)['where'](_0x0a8c('0x76'))[_0x0a8c('0x77')]();for(var _0x84d813=0x0;_0x84d813<_0x3c14e7[_0x0a8c('0x48')];_0x84d813++){_0x4e1f5d[_0x0a8c('0x78')](_0x0a8c('0x79')+_0x3c14e7[_0x84d813]['id'],'customField_'+_0x3c14e7[_0x84d813][_0x0a8c('0x71')]);}for(var _0x84d813=0x0;_0x84d813<_0x7cefb7[_0x0a8c('0x48')];_0x84d813++){_0x4e1f5d[_0x0a8c('0x78')](squel[_0x0a8c('0x72')]()[_0x0a8c('0x78')](_0x0a8c('0x7a'))[_0x0a8c('0x73')](_0x0a8c('0x7b'))['where'](_0x0a8c('0x7c'),_0x7cefb7[_0x84d813]['id'])[_0x0a8c('0x3f')](_0x0a8c('0x7d')),_0x0a8c('0x7e')+_0x7cefb7[_0x84d813]['name']);_0x4e1f5d[_0x0a8c('0x78')](squel[_0x0a8c('0x72')]()['field'](_0x0a8c('0x7f'))[_0x0a8c('0x73')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x7cefb7[_0x84d813]['id'])[_0x0a8c('0x3f')](_0x0a8c('0x7d')),'description_additionalPhone_'+_0x7cefb7[_0x84d813][_0x0a8c('0x2a')]);}var _0xf816df=[];_0xf816df[_0x0a8c('0x62')](_0x4e1f5d[_0x0a8c('0x80')]());BPromise[_0x0a8c('0x63')](_0xf816df,handleQuery)[_0x0a8c('0x25')](function(_0x3ed040){handleQuery(_0x4e1f5d[_0x0a8c('0x80')]());var _0x46ee4b=csv_results[0x0];if(!_[_0x0a8c('0x81')](_0x46ee4b)){var _0x4dac06=toCsv(_0x46ee4b);var _0x3e458e=Date[_0x0a8c('0x82')]();fs[_0x0a8c('0x83')](util['format'](_0x0a8c('0x84'),_0x59d3f3,_0x3e458e),_0x4dac06);_0x22e651['setHeader'](_0x0a8c('0x85'),_0x0a8c('0x86')+util['format'](_0x0a8c('0x87'),_0x59d3f3,_0x3e458e));_0x22e651[_0x0a8c('0x88')](_0x0a8c('0x89'),_0x0a8c('0x8a'));return _0x22e651['download'](util[_0x0a8c('0x6b')]('/tmp/list_%d_%s.csv',_0x59d3f3,_0x3e458e));}else{return _0x22e651[_0x0a8c('0x1b')](0xcc);}});});});};exports[_0x0a8c('0x8b')]=function(_0x1bfa7a,_0x1b5827,_0x101565){var _0x541b15;delete _0x1bfa7a[_0x0a8c('0x4c')]['id'];return db[_0x0a8c('0x2e')]['findOne']({'where':{'id':_0x1bfa7a[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x1b5827,null))[_0x0a8c('0x25')](function(_0x58a859){if(_0x58a859){return db[_0x0a8c('0x8c')][_0x0a8c('0x8d')](function(_0x4b7560){return db[_0x0a8c('0x69')]['create'](_0x1bfa7a['body'],{'transaction':_0x4b7560})[_0x0a8c('0x25')](function(_0x592c1e){_0x541b15=_0x592c1e;return _0x58a859[_0x0a8c('0x8e')](_0x592c1e,{'transaction':_0x4b7560});})['then'](function(){var _0x153817={'type':db[_0x0a8c('0x8f')][_0x0a8c('0x90')],'transaction':_0x4b7560};switch(_0x1bfa7a[_0x0a8c('0x4c')][_0x0a8c('0x31')]){case'text':_0x153817['type']=db[_0x0a8c('0x8f')]['TEXT'];break;case _0x0a8c('0x91'):_0x153817[_0x0a8c('0x31')]=db[_0x0a8c('0x8f')][_0x0a8c('0x92')];break;case _0x0a8c('0x93'):_0x153817[_0x0a8c('0x31')]=db[_0x0a8c('0x8f')][_0x0a8c('0x94')];_0x153817[_0x0a8c('0x95')]=![];break;default:}return db['sequelize'][_0x0a8c('0x96')]['addColumn'](_0x0a8c('0x74'),util[_0x0a8c('0x6b')](_0x0a8c('0x97'),_0x541b15['id']),_0x153817);})[_0x0a8c('0x25')](function(){return _0x541b15;});});}})[_0x0a8c('0x25')](respondWithResult(_0x1b5827,null))[_0x0a8c('0x46')](handleError(_0x1b5827,null));};exports[_0x0a8c('0x98')]=function(_0x4d3bb6,_0x363688,_0x29eddc){var _0x51ab34={};var _0x36dda7={};var _0x1d4e00;var _0x1c3d2d;return db['CmList'][_0x0a8c('0x5a')]({'where':{'id':_0x4d3bb6[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x363688,null))[_0x0a8c('0x25')](function(_0x187d7e){if(_0x187d7e){_0x1d4e00=_0x187d7e;_0x36dda7[_0x0a8c('0x36')]=_[_0x0a8c('0x34')](db[_0x0a8c('0x69')][_0x0a8c('0x2f')]);_0x36dda7['query']=_[_0x0a8c('0x34')](_0x4d3bb6[_0x0a8c('0x33')]);_0x36dda7[_0x0a8c('0x3d')]=_[_0x0a8c('0x35')](_0x36dda7[_0x0a8c('0x36')],_0x36dda7[_0x0a8c('0x33')]);_0x51ab34[_0x0a8c('0x37')]=_['intersection'](_0x36dda7['model'],qs['fields'](_0x4d3bb6[_0x0a8c('0x33')][_0x0a8c('0x38')]));_0x51ab34[_0x0a8c('0x37')]=_0x51ab34[_0x0a8c('0x37')]['length']?_0x51ab34[_0x0a8c('0x37')]:_0x36dda7[_0x0a8c('0x36')];_0x51ab34[_0x0a8c('0x5b')]=qs['sort'](_0x4d3bb6[_0x0a8c('0x33')]['sort']);_0x51ab34['where']=qs[_0x0a8c('0x3d')](_[_0x0a8c('0x3e')](_0x4d3bb6[_0x0a8c('0x33')],_0x36dda7[_0x0a8c('0x3d')]));_0x51ab34[_0x0a8c('0x3f')]=_[_0x0a8c('0x40')](_0x51ab34['where'],{'$or':[{'ListId':_0x187d7e['id']},{'ListId':null}]});if(_0x4d3bb6[_0x0a8c('0x33')][_0x0a8c('0x5c')]){_0x51ab34[_0x0a8c('0x3f')]=_[_0x0a8c('0x40')](_0x51ab34[_0x0a8c('0x3f')],{'$or':_[_0x0a8c('0x2d')](_0x51ab34[_0x0a8c('0x37')],function(_0xa7f2ad){var _0x5f2b41={};_0x5f2b41[_0xa7f2ad]={'$like':'%'+_0x4d3bb6['query']['filter']+'%'};return _0x5f2b41;})});}_0x51ab34=_[_0x0a8c('0x40')]({},_0x51ab34,_0x4d3bb6[_0x0a8c('0x42')]);return db[_0x0a8c('0x69')][_0x0a8c('0x99')](_0x51ab34);}})[_0x0a8c('0x25')](respondWithResult(_0x363688,null))['catch'](handleError(_0x363688,null));};exports[_0x0a8c('0x9a')]=function(_0x1d7e5e,_0x637036){return db[_0x0a8c('0x69')]['findAndCountAll']({'where':{'ListId':null}})[_0x0a8c('0x25')](handleEntityNotFound(_0x637036,null))[_0x0a8c('0x25')](function(_0x363cb5){return _0x363cb5;})[_0x0a8c('0x25')](respondWithResult(_0x637036,null))[_0x0a8c('0x46')](handleError(_0x637036,null));};exports[_0x0a8c('0x9b')]=function(_0x547d55,_0x357259,_0x237121){return db[_0x0a8c('0x2e')]['find']({'where':{'id':_0x547d55[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x357259,null))[_0x0a8c('0x25')](function(_0x138c51){if(_0x138c51){return _0x138c51[_0x0a8c('0x9b')](_0x547d55[_0x0a8c('0x4c')][_0x0a8c('0x5e')],_[_0x0a8c('0x64')](_0x547d55[_0x0a8c('0x4c')],['ids','id'])||{})[_0x0a8c('0x9c')](function(_0x5335f8){for(var _0x401387=0x0;_0x401387<_0x547d55[_0x0a8c('0x4c')][_0x0a8c('0x5e')][_0x0a8c('0x48')];_0x401387+=0x1){socket[_0x0a8c('0x9d')](_0x0a8c('0x9e'),{'UserId':Number(_0x547d55[_0x0a8c('0x4c')][_0x0a8c('0x5e')][_0x401387]),'CmListId':Number(_0x547d55['params']['id'])});}return _0x5335f8;});}})[_0x0a8c('0x25')](respondWithResult(_0x357259,null))[_0x0a8c('0x46')](handleError(_0x357259,null));};exports[_0x0a8c('0x9f')]=function(_0x5764b0,_0x2fff35,_0x52f16f){return db['CmList'][_0x0a8c('0x4a')]({'where':{'id':_0x5764b0[_0x0a8c('0x55')]['id']}})[_0x0a8c('0x25')](handleEntityNotFound(_0x2fff35,null))['then'](function(_0x3eeb59){if(_0x3eeb59){return _0x3eeb59[_0x0a8c('0x9f')](_0x5764b0[_0x0a8c('0x33')][_0x0a8c('0x5e')])[_0x0a8c('0x25')](function(){if(_[_0x0a8c('0xa0')](_0x5764b0['query'][_0x0a8c('0x5e')])){for(var _0x5a077b=0x0;_0x5a077b<_0x5764b0[_0x0a8c('0x33')][_0x0a8c('0x5e')]['length'];_0x5a077b+=0x1){socket[_0x0a8c('0x9d')](_0x0a8c('0xa1'),{'UserId':Number(_0x5764b0[_0x0a8c('0x33')][_0x0a8c('0x5e')][_0x5a077b]),'CmListId':Number(_0x5764b0[_0x0a8c('0x55')]['id'])});}}else{socket[_0x0a8c('0x9d')](_0x0a8c('0xa1'),{'UserId':Number(_0x5764b0[_0x0a8c('0x33')][_0x0a8c('0x5e')]),'CmListId':Number(_0x5764b0[_0x0a8c('0x55')]['id'])});}});}})[_0x0a8c('0x25')](respondWithStatusCode(_0x2fff35,null))[_0x0a8c('0x46')](handleError(_0x2fff35,null));};exports[_0x0a8c('0xa2')]=function(_0x32f704,_0x2fa317,_0xb63708){var _0x28e791={};var _0x190140={};var _0x108d3c;var _0x39faf4;return db['CmList'][_0x0a8c('0x5a')]({'where':{'id':_0x32f704[_0x0a8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x2fa317,null))['then'](function(_0x223dba){if(_0x223dba){_0x108d3c=_0x223dba;_0x190140[_0x0a8c('0x36')]=_[_0x0a8c('0x34')](db['User'][_0x0a8c('0x2f')]);_0x190140[_0x0a8c('0x33')]=_[_0x0a8c('0x34')](_0x32f704[_0x0a8c('0x33')]);_0x190140['filters']=_['intersection'](_0x190140[_0x0a8c('0x36')],_0x190140['query']);_0x28e791[_0x0a8c('0x37')]=_[_0x0a8c('0x35')](_0x190140[_0x0a8c('0x36')],qs[_0x0a8c('0x38')](_0x32f704['query'][_0x0a8c('0x38')]));_0x28e791[_0x0a8c('0x37')]=_0x28e791[_0x0a8c('0x37')][_0x0a8c('0x48')]?_0x28e791[_0x0a8c('0x37')]:_0x190140[_0x0a8c('0x36')];_0x28e791[_0x0a8c('0x5b')]=qs['sort'](_0x32f704['query'][_0x0a8c('0x3c')]);_0x28e791[_0x0a8c('0x3f')]=qs['filters'](_[_0x0a8c('0x3e')](_0x32f704['query'],_0x190140[_0x0a8c('0x3d')]));if(_0x32f704[_0x0a8c('0x33')][_0x0a8c('0x5c')]){_0x28e791[_0x0a8c('0x3f')]=_[_0x0a8c('0x40')](_0x28e791[_0x0a8c('0x3f')],{'$or':_['map'](_0x28e791[_0x0a8c('0x37')],function(_0x4565cd){var _0x41f519={};_0x41f519[_0x4565cd]={'$like':'%'+_0x32f704[_0x0a8c('0x33')][_0x0a8c('0x5c')]+'%'};return _0x41f519;})});}_0x28e791=_[_0x0a8c('0x40')]({},_0x28e791,_0x32f704[_0x0a8c('0x42')]);return _0x108d3c[_0x0a8c('0xa2')](_0x28e791);}})['then'](function(_0x295c35){if(_0x295c35){_0x39faf4=_0x295c35['length'];if(!_0x32f704[_0x0a8c('0x33')][_0x0a8c('0x39')](_0x0a8c('0x3a'))){_0x28e791[_0x0a8c('0x3b')]=qs[_0x0a8c('0x3b')](_0x32f704['query'][_0x0a8c('0x3b')]);_0x28e791[_0x0a8c('0x1e')]=qs[_0x0a8c('0x1e')](_0x32f704[_0x0a8c('0x33')][_0x0a8c('0x1e')]);}return _0x108d3c[_0x0a8c('0xa2')](_0x28e791);}})['then'](function(_0x48739e){if(_0x48739e){return _0x48739e?{'count':_0x39faf4,'rows':_0x48739e}:null;}})[_0x0a8c('0x25')](respondWithResult(_0x2fa317,null))[_0x0a8c('0x46')](handleError(_0x2fa317,null));};function handleQuery(_0x36050d){logger[_0x0a8c('0xa3')](_0x36050d);return db[_0x0a8c('0x8c')][_0x0a8c('0x33')](_0x36050d)[_0x0a8c('0x9c')](function(_0x57c543){csv_results['push'](_0x57c543);})['catch'](function(_0xd1b505){logger[_0x0a8c('0x53')](_0xd1b505[_0x0a8c('0x67')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 2da20bb..1327393 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2bcd1f,_0x4f1972){var _0x2381ca=function(_0x51f935){while(--_0x51f935){_0x2bcd1f['push'](_0x2bcd1f['shift']());}};_0x2381ca(++_0x4f1972);}(_0x5fc3,0xa8));var _0x35fc=function(_0x44474f,_0x431580){_0x44474f=_0x44474f-0x0;var _0x427d97=_0x5fc3[_0x44474f];return _0x427d97;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x4a5635,_0x443b90){var _0x18d602=function(_0x1ddd38){while(--_0x1ddd38){_0x4a5635['push'](_0x4a5635['shift']());}};_0x18d602(++_0x443b90);}(_0x814b,0x1a2));var _0xb814=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x814b[_0x3718b7];return _0xf8c91e;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 733fa8b..99d388f 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 _0x668b=['cm_lists','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cmList.attributes','define','CmList'];(function(_0x22fc1d,_0x5b8ee1){var _0x29e032=function(_0x69e18a){while(--_0x69e18a){_0x22fc1d['push'](_0x22fc1d['shift']());}};_0x29e032(++_0x5b8ee1);}(_0x668b,0x140));var _0xb668=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x668b[_0x54bac5];return _0xc15971;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91a7=['bluebird','path','./cmList.attributes','exports','CmList','cm_lists','util','../../config/logger','api'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0x91a7,0xe7));var _0x791a=function(_0x17f986,_0x18e5e7){_0x17f986=_0x17f986-0x0;var _0x155893=_0x91a7[_0x17f986];return _0x155893;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x791a('0x5'));module[_0x791a('0x6')]=function(_0x49a9b7,_0x361f53){return _0x49a9b7['define'](_0x791a('0x7'),attributes,{'tableName':_0x791a('0x8'),'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 a80dfae..6f38a00 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 _0x8d32=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s'];(function(_0x310a1b,_0x4c9129){var _0xdea206=function(_0x1f1e8d){while(--_0x1f1e8d){_0x310a1b['push'](_0x310a1b['shift']());}};_0xdea206(++_0x4c9129);}(_0x8d32,0x139));var _0x28d3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8d32[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x28d3('0x0'));var util=require(_0x28d3('0x1'));var moment=require(_0x28d3('0x2'));var BPromise=require(_0x28d3('0x3'));var rs=require(_0x28d3('0x4'));var fs=require('fs');var Redis=require(_0x28d3('0x5'));var db=require(_0x28d3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x28d3('0x7'))('rpc');var config=require(_0x28d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x28d3('0x9')][_0x28d3('0xa')]({'port':0x232a});config[_0x28d3('0xb')]=_[_0x28d3('0xc')](config[_0x28d3('0xb')],{'host':_0x28d3('0xd'),'port':0x18eb});var socket=require(_0x28d3('0xe'))(new Redis(config['redis']));require(_0x28d3('0xf'))[_0x28d3('0x10')](socket);function respondWithRpcPromise(_0x4b61ff,_0x1e0a90,_0x3db192){return new BPromise(function(_0x5aae79,_0x183ec9){return client['request'](_0x4b61ff,_0x3db192)['then'](function(_0x377295){logger[_0x28d3('0x11')]('CmList,\x20%s,\x20%s',_0x1e0a90,_0x28d3('0x12'));logger['debug'](_0x28d3('0x13'),_0x1e0a90,'request\x20sent',JSON[_0x28d3('0x14')](_0x377295));if(_0x377295['error']){if(_0x377295[_0x28d3('0x15')][_0x28d3('0x16')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x1e0a90,_0x377295[_0x28d3('0x15')][_0x28d3('0x17')]);return _0x183ec9(_0x377295[_0x28d3('0x15')]['message']);}logger[_0x28d3('0x15')](_0x28d3('0x18'),_0x1e0a90,_0x377295[_0x28d3('0x15')][_0x28d3('0x17')]);return _0x5aae79(_0x377295[_0x28d3('0x15')][_0x28d3('0x17')]);}else{logger[_0x28d3('0x11')]('CmList,\x20%s,\x20%s',_0x1e0a90,_0x28d3('0x12'));_0x5aae79(_0x377295[_0x28d3('0x19')][_0x28d3('0x17')]);}})['catch'](function(_0x5ef8ce){logger[_0x28d3('0x15')](_0x28d3('0x18'),_0x1e0a90,_0x5ef8ce);_0x183ec9(_0x5ef8ce);});});} \ No newline at end of file +var _0x0dc3=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','CmList,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xaf7943,_0x173e73){var _0x288e7b=function(_0x5609b0){while(--_0x5609b0){_0xaf7943['push'](_0xaf7943['shift']());}};_0x288e7b(++_0x173e73);}(_0x0dc3,0x1d8));var _0x30dc=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x0dc3[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x30dc('0x0'));var util=require(_0x30dc('0x1'));var moment=require('moment');var BPromise=require(_0x30dc('0x2'));var rs=require(_0x30dc('0x3'));var fs=require('fs');var Redis=require(_0x30dc('0x4'));var db=require(_0x30dc('0x5'))['db'];var utils=require(_0x30dc('0x6'));var logger=require(_0x30dc('0x7'))('rpc');var config=require(_0x30dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x30dc('0x9')][_0x30dc('0xa')]({'port':0x232a});config[_0x30dc('0xb')]=_[_0x30dc('0xc')](config['redis'],{'host':_0x30dc('0xd'),'port':0x18eb});var socket=require(_0x30dc('0xe'))(new Redis(config[_0x30dc('0xb')]));require('./cmList.socket')[_0x30dc('0xf')](socket);function respondWithRpcPromise(_0x241881,_0x1f405b,_0x3f08f7){return new BPromise(function(_0x576ca0,_0x23e412){return client[_0x30dc('0x10')](_0x241881,_0x3f08f7)[_0x30dc('0x11')](function(_0x398376){logger['info']('CmList,\x20%s,\x20%s',_0x1f405b,'request\x20sent');logger['debug'](_0x30dc('0x12'),_0x1f405b,_0x30dc('0x13'),JSON['stringify'](_0x398376));if(_0x398376[_0x30dc('0x14')]){if(_0x398376[_0x30dc('0x14')]['code']===0x1f4){logger[_0x30dc('0x14')](_0x30dc('0x15'),_0x1f405b,_0x398376[_0x30dc('0x14')][_0x30dc('0x16')]);return _0x23e412(_0x398376[_0x30dc('0x14')][_0x30dc('0x16')]);}logger[_0x30dc('0x14')](_0x30dc('0x15'),_0x1f405b,_0x398376[_0x30dc('0x14')][_0x30dc('0x16')]);return _0x576ca0(_0x398376[_0x30dc('0x14')][_0x30dc('0x16')]);}else{logger[_0x30dc('0x17')](_0x30dc('0x15'),_0x1f405b,_0x30dc('0x13'));_0x576ca0(_0x398376['result'][_0x30dc('0x16')]);}})['catch'](function(_0x29b5e8){logger[_0x30dc('0x14')](_0x30dc('0x15'),_0x1f405b,_0x29b5e8);_0x23e412(_0x29b5e8);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 82a73a8..52f4385 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 _0x3939=['remove','update','emit','removeListener','register','length','cmList:','./cmList.events','save'];(function(_0x41ac1e,_0x166c22){var _0x4c179f=function(_0x209adf){while(--_0x209adf){_0x41ac1e['push'](_0x41ac1e['shift']());}};_0x4c179f(++_0x166c22);}(_0x3939,0xe8));var _0x9393=function(_0x5303d6,_0x24cfce){_0x5303d6=_0x5303d6-0x0;var _0x29f561=_0x3939[_0x5303d6];return _0x29f561;};'use strict';var CmListEvents=require(_0x9393('0x0'));var events=[_0x9393('0x1'),_0x9393('0x2'),_0x9393('0x3')];function createListener(_0x1ceca6,_0x5e4dbf){return function(_0x4688e6){_0x5e4dbf[_0x9393('0x4')](_0x1ceca6,_0x4688e6);};}function removeListener(_0x52f655,_0x34049a){return function(){CmListEvents[_0x9393('0x5')](_0x52f655,_0x34049a);};}exports[_0x9393('0x6')]=function(_0x2fee37){for(var _0x276bb5=0x0,_0x5ed1e=events[_0x9393('0x7')];_0x276bb5<_0x5ed1e;_0x276bb5++){var _0x59453b=events[_0x276bb5];var _0x360b84=createListener(_0x9393('0x8')+_0x59453b,_0x2fee37);CmListEvents['on'](_0x59453b,_0x360b84);}}; \ No newline at end of file +var _0x119c=['./cmList.events','update','emit','removeListener'];(function(_0x44ccbe,_0x3a88e7){var _0x328d99=function(_0x12ddb2){while(--_0x12ddb2){_0x44ccbe['push'](_0x44ccbe['shift']());}};_0x328d99(++_0x3a88e7);}(_0x119c,0xa0));var _0xc119=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0x119c[_0xb5fc3e];return _0x2efc3c;};'use strict';var CmListEvents=require(_0xc119('0x0'));var events=['save','remove',_0xc119('0x1')];function createListener(_0xf428b4,_0x2cf552){return function(_0xde2e15){_0x2cf552[_0xc119('0x2')](_0xf428b4,_0xde2e15);};}function removeListener(_0x588a5d,_0x1a2818){return function(){CmListEvents[_0xc119('0x3')](_0x588a5d,_0x1a2818);};}exports['register']=function(_0x2df4e5){for(var _0x2d2572=0x0,_0x2f8c50=events['length'];_0x2d2572<_0x2f8c50;_0x2d2572++){var _0x5e1685=events[_0x2d2572];var _0x44c03d=createListener('cmList:'+_0x5e1685,_0x2df4e5);CmListEvents['on'](_0x5e1685,_0x44c03d);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0395512..e0a0ba1 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 _0x7b79=['../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','create','post','/:id/dispositions','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','express','Router','fs-extra'];(function(_0x1c6e67,_0x3761f2){var _0x11541a=function(_0x34732f){while(--_0x34732f){_0x1c6e67['push'](_0x1c6e67['shift']());}};_0x11541a(++_0x3761f2);}(_0x7b79,0x1b6));var _0x97b7=function(_0x57bf95,_0x131d28){_0x57bf95=_0x57bf95-0x0;var _0x4580a2=_0x7b79[_0x57bf95];return _0x4580a2;};'use strict';var multer=require(_0x97b7('0x0'));var util=require(_0x97b7('0x1'));var path=require(_0x97b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x97b7('0x3'));var router=express[_0x97b7('0x4')]();var fs_extra=require(_0x97b7('0x5'));var auth=require(_0x97b7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x97b7('0x7'));var controller=require(_0x97b7('0x8'));router[_0x97b7('0x9')]('/',auth[_0x97b7('0xa')](),controller[_0x97b7('0xb')]);router[_0x97b7('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x97b7('0xc'),auth[_0x97b7('0xa')](),controller[_0x97b7('0xd')]);router[_0x97b7('0x9')](_0x97b7('0xe'),auth['isAuthenticated'](),controller[_0x97b7('0xf')]);router[_0x97b7('0x9')]('/:id/dispositions',auth[_0x97b7('0xa')](),controller[_0x97b7('0x10')]);router['get'](_0x97b7('0x11'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x12')]);router['get'](_0x97b7('0x13'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x14')]);router[_0x97b7('0x9')](_0x97b7('0x15'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x16')]);router[_0x97b7('0x9')]('/:id/users',auth[_0x97b7('0xa')](),controller[_0x97b7('0x17')]);router['post']('/',auth[_0x97b7('0xa')](),controller[_0x97b7('0x18')]);router[_0x97b7('0x19')](_0x97b7('0x1a'),auth[_0x97b7('0xa')](),controller['addDisposition']);router[_0x97b7('0x19')](_0x97b7('0x11'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x1b')]);router[_0x97b7('0x19')]('/:id/fields',auth['isAuthenticated'](),controller[_0x97b7('0x1c')]);router[_0x97b7('0x19')](_0x97b7('0x1d'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x1e')]);router[_0x97b7('0x1f')](_0x97b7('0xe'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x20')]);router[_0x97b7('0x21')](_0x97b7('0xe'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x22')]);router[_0x97b7('0x21')](_0x97b7('0x1a'),auth[_0x97b7('0xa')](),controller[_0x97b7('0x23')]);router[_0x97b7('0x21')](_0x97b7('0x1d'),auth['isAuthenticated'](),controller[_0x97b7('0x24')]);module['exports']=router; \ No newline at end of file +var _0x1ee4=['index','isAuthenticated','describe','/global_fields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getAgents','post','create','addDisposition','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get'];(function(_0xef3ae2,_0x4c63b8){var _0x1cc22b=function(_0x4de2da){while(--_0x4de2da){_0xef3ae2['push'](_0xef3ae2['shift']());}};_0x1cc22b(++_0x4c63b8);}(_0x1ee4,0xbe));var _0x41ee=function(_0x4497a8,_0x5de053){_0x4497a8=_0x4497a8-0x0;var _0x5e6d7b=_0x1ee4[_0x4497a8];return _0x5e6d7b;};'use strict';var multer=require(_0x41ee('0x0'));var util=require(_0x41ee('0x1'));var path=require(_0x41ee('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x41ee('0x3'));var auth=require(_0x41ee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x41ee('0x5'));var controller=require(_0x41ee('0x6'));router[_0x41ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x41ee('0x8')]);router[_0x41ee('0x7')]('/describe',auth[_0x41ee('0x9')](),controller[_0x41ee('0xa')]);router[_0x41ee('0x7')](_0x41ee('0xb'),auth[_0x41ee('0x9')](),controller['getGlobalCustomFields']);router['get'](_0x41ee('0xc'),auth[_0x41ee('0x9')](),controller[_0x41ee('0xd')]);router[_0x41ee('0x7')](_0x41ee('0xe'),auth[_0x41ee('0x9')](),controller[_0x41ee('0xf')]);router[_0x41ee('0x7')](_0x41ee('0x10'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x11')]);router['get'](_0x41ee('0x12'),auth[_0x41ee('0x9')](),controller['getContactsCsv']);router[_0x41ee('0x7')](_0x41ee('0x13'),auth[_0x41ee('0x9')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x41ee('0x9')](),controller[_0x41ee('0x14')]);router[_0x41ee('0x15')]('/',auth[_0x41ee('0x9')](),controller[_0x41ee('0x16')]);router[_0x41ee('0x15')](_0x41ee('0xe'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x17')]);router[_0x41ee('0x15')](_0x41ee('0x10'),auth[_0x41ee('0x9')](),controller['addContacts']);router[_0x41ee('0x15')](_0x41ee('0x13'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x18')]);router[_0x41ee('0x15')](_0x41ee('0x19'),auth['isAuthenticated'](),controller[_0x41ee('0x1a')]);router[_0x41ee('0x1b')]('/:id',auth[_0x41ee('0x9')](),controller[_0x41ee('0x1c')]);router[_0x41ee('0x1d')](_0x41ee('0xc'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x1e')]);router[_0x41ee('0x1d')](_0x41ee('0xe'),auth['isAuthenticated'](),controller[_0x41ee('0x1f')]);router[_0x41ee('0x1d')](_0x41ee('0x19'),auth[_0x41ee('0x9')](),controller['removeAgents']);module[_0x41ee('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d9d7daa..017a998 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 _0xcebe=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x500439,_0x24b02e){var _0x476501=function(_0x1b92ca){while(--_0x1b92ca){_0x500439['push'](_0x500439['shift']());}};_0x476501(++_0x24b02e);}(_0xcebe,0x1e8));var _0xeceb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xcebe[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xeceb('0x0'));module[_0xeceb('0x1')]={'name':{'type':Sequelize[_0xeceb('0x2')],'get':function(_0x408e49){return this['getDataValue'](_0xeceb('0x3'));}},'field':{'type':Sequelize[_0xeceb('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xeceb('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xebb1=['VIRTUAL','getDataValue','STRING','exports'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0xebb1,0x113));var _0x1ebb=function(_0x201039,_0x22ea8f){_0x201039=_0x201039-0x0;var _0x5b424a=_0xebb1[_0x201039];return _0x5b424a;};'use strict';var Sequelize=require('sequelize');module[_0x1ebb('0x0')]={'name':{'type':Sequelize[_0x1ebb('0x1')],'get':function(_0x2342bd){return this[_0x1ebb('0x2')]('field');}},'field':{'type':Sequelize[_0x1ebb('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x1ebb('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 058aa4e..5c4a96d 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(_0x2bc856,_0x1beada){var _0x16ac21=function(_0x4aade1){while(--_0x4aade1){_0x2bc856['push'](_0x2bc856['shift']());}};_0x16ac21(++_0x1beada);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 _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(_0x3e92cf,_0x49d58e){var _0x35f5d3=function(_0x13a83d){while(--_0x13a83d){_0x3e92cf['push'](_0x3e92cf['shift']());}};_0x35f5d3(++_0x49d58e);}(_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){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 72b5eae..32fc450 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 _0x9ba6=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','../../config/logger','api','moment'];(function(_0x10c01c,_0x5bc461){var _0x4549db=function(_0x5a7489){while(--_0x5a7489){_0x10c01c['push'](_0x10c01c['shift']());}};_0x4549db(++_0x5bc461);}(_0x9ba6,0x7f));var _0x69ba=function(_0x22a1e1,_0x2c4afc){_0x22a1e1=_0x22a1e1-0x0;var _0x58b2a0=_0x9ba6[_0x22a1e1];return _0x58b2a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x69ba('0x0'))(_0x69ba('0x1'));var moment=require(_0x69ba('0x2'));var BPromise=require(_0x69ba('0x3'));var rp=require(_0x69ba('0x4'));var fs=require('fs');var path=require(_0x69ba('0x5'));var rimraf=require(_0x69ba('0x6'));var config=require(_0x69ba('0x7'));var attributes=require(_0x69ba('0x8'));module[_0x69ba('0x9')]=function(_0x46e066,_0x42e374){return _0x46e066[_0x69ba('0xa')](_0x69ba('0xb'),attributes,{'tableName':_0x69ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5afd=['../../config/environment','./condition.attributes','exports','define','tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x5afd,0x155));var _0xd5af=function(_0x29271a,_0x232277){_0x29271a=_0x29271a-0x0;var _0x10dc39=_0x5afd[_0x29271a];return _0x10dc39;};'use strict';var _=require('lodash');var util=require(_0xd5af('0x0'));var logger=require(_0xd5af('0x1'))(_0xd5af('0x2'));var moment=require(_0xd5af('0x3'));var BPromise=require(_0xd5af('0x4'));var rp=require(_0xd5af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5af('0x6'));var config=require(_0xd5af('0x7'));var attributes=require(_0xd5af('0x8'));module[_0xd5af('0x9')]=function(_0x3acc74,_0x5735a3){return _0x3acc74[_0xd5af('0xa')]('Condition',attributes,{'tableName':_0xd5af('0xb'),'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 395a9a5..3b81ef9 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 _0x3a5c=['info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','client','request','then'];(function(_0x32da04,_0x255b7b){var _0x468bac=function(_0x4e2e53){while(--_0x4e2e53){_0x32da04['push'](_0x32da04['shift']());}};_0x468bac(++_0x255b7b);}(_0x3a5c,0xe1));var _0xc3a5=function(_0x1071f7,_0x26e062){_0x1071f7=_0x1071f7-0x0;var _0x25bcdc=_0x3a5c[_0x1071f7];return _0x25bcdc;};'use strict';var _=require(_0xc3a5('0x0'));var util=require('util');var moment=require(_0xc3a5('0x1'));var BPromise=require(_0xc3a5('0x2'));var rs=require(_0xc3a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc3a5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc3a5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8a53,_0x24dbf1,_0x212e83){return new BPromise(function(_0x18ad88,_0x3b0b86){return client[_0xc3a5('0x7')](_0x5d8a53,_0x212e83)[_0xc3a5('0x8')](function(_0x26f196){logger[_0xc3a5('0x9')](_0xc3a5('0xa'),_0x24dbf1,_0xc3a5('0xb'));logger[_0xc3a5('0xc')](_0xc3a5('0xd'),_0x24dbf1,_0xc3a5('0xb'),JSON[_0xc3a5('0xe')](_0x26f196));if(_0x26f196[_0xc3a5('0xf')]){if(_0x26f196['error']['code']===0x1f4){logger['error'](_0xc3a5('0xa'),_0x24dbf1,_0x26f196['error'][_0xc3a5('0x10')]);return _0x3b0b86(_0x26f196[_0xc3a5('0xf')]['message']);}logger[_0xc3a5('0xf')](_0xc3a5('0xa'),_0x24dbf1,_0x26f196['error']['message']);return _0x18ad88(_0x26f196[_0xc3a5('0xf')]['message']);}else{logger[_0xc3a5('0x9')](_0xc3a5('0xa'),_0x24dbf1,'request\x20sent');_0x18ad88(_0x26f196[_0xc3a5('0x11')][_0xc3a5('0x10')]);}})['catch'](function(_0x419f25){logger[_0xc3a5('0xf')](_0xc3a5('0xa'),_0x24dbf1,_0x419f25);_0x3b0b86(_0x419f25);});});} \ No newline at end of file +var _0x12ba=['randomstring','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','Condition,\x20%s,\x20%s','message','result','util','moment','bluebird'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x12ba,0xbb));var _0xa12b=function(_0x4298af,_0x4bdefd){_0x4298af=_0x4298af-0x0;var _0x54589e=_0x12ba[_0x4298af];return _0x54589e;};'use strict';var _=require('lodash');var util=require(_0xa12b('0x0'));var moment=require(_0xa12b('0x1'));var BPromise=require(_0xa12b('0x2'));var rs=require(_0xa12b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa12b('0x4'))(_0xa12b('0x5'));var config=require(_0xa12b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa12b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d9f71,_0x3b28af,_0x403d52){return new BPromise(function(_0x17fab4,_0x43485a){return client[_0xa12b('0x8')](_0x5d9f71,_0x403d52)[_0xa12b('0x9')](function(_0x1c9a69){logger[_0xa12b('0xa')]('Condition,\x20%s,\x20%s',_0x3b28af,_0xa12b('0xb'));logger[_0xa12b('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x3b28af,_0xa12b('0xb'),JSON[_0xa12b('0xd')](_0x1c9a69));if(_0x1c9a69['error']){if(_0x1c9a69[_0xa12b('0xe')][_0xa12b('0xf')]===0x1f4){logger[_0xa12b('0xe')](_0xa12b('0x10'),_0x3b28af,_0x1c9a69[_0xa12b('0xe')]['message']);return _0x43485a(_0x1c9a69['error'][_0xa12b('0x11')]);}logger[_0xa12b('0xe')](_0xa12b('0x10'),_0x3b28af,_0x1c9a69[_0xa12b('0xe')][_0xa12b('0x11')]);return _0x17fab4(_0x1c9a69[_0xa12b('0xe')][_0xa12b('0x11')]);}else{logger[_0xa12b('0xa')](_0xa12b('0x10'),_0x3b28af,_0xa12b('0xb'));_0x17fab4(_0x1c9a69[_0xa12b('0x12')][_0xa12b('0x11')]);}})['catch'](function(_0x95b99){logger[_0xa12b('0xe')](_0xa12b('0x10'),_0x3b28af,_0x95b99);_0x43485a(_0x95b99);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 82c0bf8..9c5d737 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 _0xd0ce=['../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x568fe7,_0x446b23){var _0x259825=function(_0x16e139){while(--_0x16e139){_0x568fe7['push'](_0x568fe7['shift']());}};_0x259825(++_0x446b23);}(_0xd0ce,0x105));var _0xed0c=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0xd0ce[_0x5aa373];return _0x590e8e;};'use strict';var multer=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var path=require(_0xed0c('0x2'));var timeout=require(_0xed0c('0x3'));var express=require(_0xed0c('0x4'));var router=express[_0xed0c('0x5')]();var fs_extra=require(_0xed0c('0x6'));var auth=require(_0xed0c('0x7'));var interaction=require(_0xed0c('0x8'));var config=require(_0xed0c('0x9'));var controller=require(_0xed0c('0xa'));router[_0xed0c('0xb')]('/:id',auth[_0xed0c('0xc')](),controller[_0xed0c('0xd')]);router[_0xed0c('0xe')](_0xed0c('0xf'),auth[_0xed0c('0xc')](),controller[_0xed0c('0x10')]);module[_0xed0c('0x11')]=router; \ No newline at end of file +var _0x2e33=['delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x2e33,0x1d2));var _0x32e3=function(_0x51da2d,_0xb74ab6){_0x51da2d=_0x51da2d-0x0;var _0x5e6668=_0x2e33[_0x51da2d];return _0x5e6668;};'use strict';var multer=require(_0x32e3('0x0'));var util=require(_0x32e3('0x1'));var path=require('path');var timeout=require(_0x32e3('0x2'));var express=require(_0x32e3('0x3'));var router=express['Router']();var fs_extra=require(_0x32e3('0x4'));var auth=require(_0x32e3('0x5'));var interaction=require(_0x32e3('0x6'));var config=require('../../config/environment');var controller=require(_0x32e3('0x7'));router[_0x32e3('0x8')](_0x32e3('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x32e3('0xa')]('/:id',auth[_0x32e3('0xb')](),controller[_0x32e3('0xc')]);module[_0x32e3('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 89df3f2..88621ca 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 _0x30d1=['STRING','name','sequelize'];(function(_0x1e32d9,_0x11e286){var _0x563f76=function(_0x349122){while(--_0x349122){_0x1e32d9['push'](_0x1e32d9['shift']());}};_0x563f76(++_0x11e286);}(_0x30d1,0x164));var _0x130d=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x30d1[_0xd7b0a4];return _0x184e9e;};'use strict';var Sequelize=require(_0x130d('0x0'));module['exports']={'name':{'type':Sequelize[_0x130d('0x1')],'allowNull':![],'unique':_0x130d('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x130d('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x9c8a=['STRING','sequelize','exports'];(function(_0x3e5237,_0x3845d8){var _0x252880=function(_0x580d15){while(--_0x580d15){_0x3e5237['push'](_0x3e5237['shift']());}};_0x252880(++_0x3845d8);}(_0x9c8a,0x103));var _0xa9c8=function(_0x34db7a,_0x56e382){_0x34db7a=_0x34db7a-0x0;var _0x47905e=_0x9c8a[_0x34db7a];return _0x47905e;};'use strict';var Sequelize=require(_0xa9c8('0x0'));module[_0xa9c8('0x1')]={'name':{'type':Sequelize[_0xa9c8('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xa9c8('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 632cbdf..0ef6660 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 _0x5b12=['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','get','ContactItemTypes','UserProfileResource','then','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','type','map','query','keys','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','intersection','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x5c41d5,_0xa8e8c3){var _0x2c4858=function(_0x2b08e6){while(--_0x2b08e6){_0x5c41d5['push'](_0x5c41d5['shift']());}};_0x2c4858(++_0xa8e8c3);}(_0x5b12,0xa3));var _0x25b1=function(_0x445fe0,_0x3a5dd9){_0x445fe0=_0x445fe0-0x0;var _0x1b422c=_0x5b12[_0x445fe0];return _0x1b422c;};'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(){var _0x3fa043=_0x246acd[_0x25b1('0x24')]({'plain':!![]});var _0xd22469=_0x25b1('0x25');return db[_0x25b1('0x26')][_0x25b1('0x23')]({'where':{'type':_0xd22469,'resourceId':_0x3fa043['id']}})['then'](function(){return _0x246acd;});})[_0x25b1('0x27')](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0x5bc8fc,_0x20a218){return function(_0x9e175f){if(!_0x9e175f){_0x5bc8fc[_0x25b1('0x19')](0x194);}return _0x9e175f;};}function handleError(_0x584357,_0x33baed){_0x33baed=_0x33baed||0x1f4;return function(_0x54ce2d){logger[_0x25b1('0x28')](_0x54ce2d[_0x25b1('0x29')]);if(_0x54ce2d[_0x25b1('0x2a')]){delete _0x54ce2d[_0x25b1('0x2a')];}_0x584357[_0x25b1('0x1a')](_0x33baed)[_0x25b1('0x2b')](_0x54ce2d);};}exports[_0x25b1('0x2c')]=function(_0x4cd825,_0x30d455){var _0xca56f0={},_0x925e99={},_0x26f323={'count':0x0,'rows':[]};var _0x274205=_['map'](db[_0x25b1('0x2d')][_0x25b1('0x2e')],function(_0x42441d){return{'name':_0x42441d[_0x25b1('0x2f')],'type':_0x42441d[_0x25b1('0x30')]['key']};});_0x925e99['model']=_[_0x25b1('0x31')](_0x274205,'name');_0x925e99[_0x25b1('0x32')]=_[_0x25b1('0x33')](_0x4cd825[_0x25b1('0x32')]);_0x925e99['filters']=_['intersection'](_0x925e99[_0x25b1('0x34')],_0x925e99[_0x25b1('0x32')]);_0xca56f0[_0x25b1('0x35')]=_['intersection'](_0x925e99[_0x25b1('0x34')],qs[_0x25b1('0x36')](_0x4cd825[_0x25b1('0x32')][_0x25b1('0x36')]));_0xca56f0['attributes']=_0xca56f0[_0x25b1('0x35')][_0x25b1('0x37')]?_0xca56f0[_0x25b1('0x35')]:_0x925e99['model'];if(!_0x4cd825['query'][_0x25b1('0x38')]('nolimit')){_0xca56f0[_0x25b1('0x39')]=qs[_0x25b1('0x39')](_0x4cd825[_0x25b1('0x32')][_0x25b1('0x39')]);_0xca56f0[_0x25b1('0x1e')]=qs[_0x25b1('0x1e')](_0x4cd825[_0x25b1('0x32')][_0x25b1('0x1e')]);}_0xca56f0[_0x25b1('0x3a')]=qs[_0x25b1('0x3b')](_0x4cd825[_0x25b1('0x32')][_0x25b1('0x3b')]);_0xca56f0[_0x25b1('0x3c')]=qs[_0x25b1('0x3d')](_[_0x25b1('0x3e')](_0x4cd825['query'],_0x925e99[_0x25b1('0x3d')]),_0x274205);if(_0x4cd825[_0x25b1('0x32')]['filter']){_0xca56f0[_0x25b1('0x3c')]=_[_0x25b1('0x3f')](_0xca56f0[_0x25b1('0x3c')],{'$or':_[_0x25b1('0x31')](_0x274205,function(_0xb82930){if(_0xb82930['type']!==_0x25b1('0x40')){var _0x5c729d={};_0x5c729d[_0xb82930[_0x25b1('0x2a')]]={'$like':'%'+_0x4cd825['query'][_0x25b1('0x41')]+'%'};return _0x5c729d;}})});}_0xca56f0=_[_0x25b1('0x3f')]({},_0xca56f0,_0x4cd825[_0x25b1('0x42')]);var _0x454eac={'where':_0xca56f0[_0x25b1('0x3c')]};return db[_0x25b1('0x2d')][_0x25b1('0x1d')](_0x454eac)[_0x25b1('0x27')](function(_0x3f9754){_0x26f323['count']=_0x3f9754;if(_0x4cd825[_0x25b1('0x32')]['includeAll']){_0xca56f0[_0x25b1('0x43')]=[{'all':!![]}];}return db[_0x25b1('0x2d')]['findAll'](_0xca56f0);})[_0x25b1('0x27')](function(_0x39b4c7){_0x26f323[_0x25b1('0x44')]=_0x39b4c7;return _0x26f323;})[_0x25b1('0x27')](respondWithFilteredResult(_0x30d455,_0xca56f0))[_0x25b1('0x45')](handleError(_0x30d455,null));};exports[_0x25b1('0x46')]=function(_0x122ce4,_0x30ee65){var _0x33e39c={'raw':!![],'where':{'id':_0x122ce4[_0x25b1('0x47')]['id']}},_0x453352={};_0x453352[_0x25b1('0x34')]=_[_0x25b1('0x33')](db[_0x25b1('0x2d')][_0x25b1('0x2e')]);_0x453352[_0x25b1('0x32')]=_[_0x25b1('0x33')](_0x122ce4[_0x25b1('0x32')]);_0x453352['filters']=_['intersection'](_0x453352['model'],_0x453352[_0x25b1('0x32')]);_0x33e39c['attributes']=_[_0x25b1('0x48')](_0x453352['model'],qs[_0x25b1('0x36')](_0x122ce4[_0x25b1('0x32')][_0x25b1('0x36')]));_0x33e39c[_0x25b1('0x35')]=_0x33e39c[_0x25b1('0x35')][_0x25b1('0x37')]?_0x33e39c['attributes']:_0x453352[_0x25b1('0x34')];if(_0x122ce4[_0x25b1('0x32')][_0x25b1('0x49')]){_0x33e39c[_0x25b1('0x43')]=[{'all':!![]}];}_0x33e39c=_['merge']({},_0x33e39c,_0x122ce4[_0x25b1('0x42')]);return db[_0x25b1('0x2d')][_0x25b1('0x4a')](_0x33e39c)['then'](handleEntityNotFound(_0x30ee65,null))[_0x25b1('0x27')](respondWithResult(_0x30ee65,null))['catch'](handleError(_0x30ee65,null));};exports[_0x25b1('0x4b')]=function(_0x4b6181,_0x543f9b){return db[_0x25b1('0x2d')][_0x25b1('0x4b')](_0x4b6181[_0x25b1('0x4c')],{})[_0x25b1('0x27')](function(_0x5de62e){var _0x2b38ca=_0x4b6181['user'][_0x25b1('0x24')]({'plain':!![]});if(!_0x2b38ca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b38ca[_0x25b1('0x4d')]===_0x25b1('0x4e')){var _0x1fcc79=_0x5de62e['get']({'plain':!![]});var _0x1f3b01=_0x25b1('0x25');return db[_0x25b1('0x4f')][_0x25b1('0x4a')]({'where':{'name':_0x1f3b01,'userProfileId':_0x2b38ca[_0x25b1('0x50')]},'raw':!![]})[_0x25b1('0x27')](function(_0x59859e){if(_0x59859e&&_0x59859e[_0x25b1('0x51')]===0x0){return db[_0x25b1('0x26')][_0x25b1('0x4b')]({'name':_0x1fcc79[_0x25b1('0x2a')],'resourceId':_0x1fcc79['id'],'type':_0x59859e[_0x25b1('0x2a')],'sectionId':_0x59859e['id']},{})[_0x25b1('0x27')](function(){return _0x5de62e;});}else{return _0x5de62e;}})[_0x25b1('0x45')](function(_0x40d574){logger[_0x25b1('0x28')](_0x25b1('0x52'),_0x40d574);throw _0x40d574;});}return _0x5de62e;})[_0x25b1('0x27')](respondWithResult(_0x543f9b,0xc9))[_0x25b1('0x45')](handleError(_0x543f9b,null));};exports[_0x25b1('0x22')]=function(_0x2f17b2,_0x3191d7){if(_0x2f17b2[_0x25b1('0x4c')]['id']){delete _0x2f17b2[_0x25b1('0x4c')]['id'];}return db[_0x25b1('0x2d')]['find']({'where':{'id':_0x2f17b2[_0x25b1('0x47')]['id']}})[_0x25b1('0x27')](handleEntityNotFound(_0x3191d7,null))[_0x25b1('0x27')](saveUpdates(_0x2f17b2[_0x25b1('0x4c')],null))[_0x25b1('0x27')](respondWithResult(_0x3191d7,null))[_0x25b1('0x45')](handleError(_0x3191d7,null));};exports['destroy']=function(_0x105587,_0x3af93d){return db[_0x25b1('0x2d')]['find']({'where':{'id':_0x105587[_0x25b1('0x47')]['id']}})['then'](handleEntityNotFound(_0x3af93d,null))['then'](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x105587[_0x25b1('0x47')]['id']}}))['then'](removeEntity(_0x3af93d,null))[_0x25b1('0x45')](handleError(_0x3af93d,null));}; \ No newline at end of file +var _0xfb11=['show','keys','rawAttributes','includeAll','include','find','body','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','ContactItemType','findAll','rows','catch'];(function(_0x3c60cf,_0x3103d0){var _0xfb2d7=function(_0xa63de){while(--_0xa63de){_0x3c60cf['push'](_0x3c60cf['shift']());}};_0xfb2d7(++_0x3103d0);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xfb11[_0x1e7b16];return _0x37fadc;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];function respondWithStatusCode(_0x10bcac,_0x333229){_0x333229=_0x333229||0xcc;return function(_0x14f290){if(_0x14f290){return _0x10bcac['sendStatus'](_0x333229);}return _0x10bcac[_0x1fb1('0x18')](_0x333229)[_0x1fb1('0x19')]();};}function respondWithResult(_0x2c5be1,_0x44f24c){_0x44f24c=_0x44f24c||0xc8;return function(_0xd83038){if(_0xd83038){return _0x2c5be1[_0x1fb1('0x18')](_0x44f24c)[_0x1fb1('0x1a')](_0xd83038);}};}function respondWithFilteredResult(_0x316fe5,_0x358b58){return function(_0x4cbe42){if(_0x4cbe42){var _0x5c8d23=typeof _0x358b58[_0x1fb1('0x1b')]===_0x1fb1('0x1c')&&typeof _0x358b58[_0x1fb1('0x1d')]==='undefined';var _0x161ca3=_0x4cbe42[_0x1fb1('0x1e')];var _0x24d4df=_0x5c8d23?0x0:_0x358b58[_0x1fb1('0x1b')];var _0x33c6b6=_0x5c8d23?_0x4cbe42[_0x1fb1('0x1e')]:_0x358b58[_0x1fb1('0x1b')]+_0x358b58[_0x1fb1('0x1d')];var _0x4041ea;if(_0x33c6b6>=_0x161ca3){_0x33c6b6=_0x161ca3;_0x4041ea=0xc8;}else{_0x4041ea=0xce;}_0x316fe5['status'](_0x4041ea);return _0x316fe5[_0x1fb1('0x1f')]('Content-Range',_0x24d4df+'-'+_0x33c6b6+'/'+_0x161ca3)['json'](_0x4cbe42);}return null;};}function patchUpdates(_0xdf9c1b){return function(_0x313d9a){try{jsonpatch[_0x1fb1('0x20')](_0x313d9a,_0xdf9c1b,!![]);}catch(_0x54ad97){return BPromise[_0x1fb1('0x21')](_0x54ad97);}return _0x313d9a['save']();};}function saveUpdates(_0x5c76f5,_0x532c63){return function(_0x31178c){if(_0x31178c){return _0x31178c[_0x1fb1('0x22')](_0x5c76f5)[_0x1fb1('0x23')](function(_0x10924f){return _0x10924f;});}return null;};}function removeEntity(_0x303a06,_0x53b8af){return function(_0x4272c7){if(_0x4272c7){return _0x4272c7[_0x1fb1('0x24')]()[_0x1fb1('0x23')](function(){var _0x5fc9e6=_0x4272c7[_0x1fb1('0x25')]({'plain':!![]});var _0x1353a4=_0x1fb1('0x26');return db[_0x1fb1('0x27')]['destroy']({'where':{'type':_0x1353a4,'resourceId':_0x5fc9e6['id']}})[_0x1fb1('0x23')](function(){return _0x4272c7;});})[_0x1fb1('0x23')](function(){_0x303a06[_0x1fb1('0x18')](0xcc)[_0x1fb1('0x19')]();});}};}function handleEntityNotFound(_0x1898e7,_0x29e1bd){return function(_0x1a74c4){if(!_0x1a74c4){_0x1898e7[_0x1fb1('0x28')](0x194);}return _0x1a74c4;};}function handleError(_0xa7bba,_0x33a3b7){_0x33a3b7=_0x33a3b7||0x1f4;return function(_0x5e99e7){logger[_0x1fb1('0x29')](_0x5e99e7[_0x1fb1('0x2a')]);if(_0x5e99e7[_0x1fb1('0x2b')]){delete _0x5e99e7[_0x1fb1('0x2b')];}_0xa7bba['status'](_0x33a3b7)[_0x1fb1('0x2c')](_0x5e99e7);};}exports[_0x1fb1('0x2d')]=function(_0x90d8ef,_0x1b71cb){var _0x5402e9={},_0x245f84={},_0x30c8eb={'count':0x0,'rows':[]};var _0x5d45a5=_[_0x1fb1('0x2e')](db['ContactItemType']['rawAttributes'],function(_0x354e92){return{'name':_0x354e92[_0x1fb1('0x2f')],'type':_0x354e92['type'][_0x1fb1('0x30')]};});_0x245f84[_0x1fb1('0x31')]=_[_0x1fb1('0x2e')](_0x5d45a5,_0x1fb1('0x2b'));_0x245f84[_0x1fb1('0x32')]=_['keys'](_0x90d8ef[_0x1fb1('0x32')]);_0x245f84[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],_0x245f84[_0x1fb1('0x32')]);_0x5402e9[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x90d8ef['query'][_0x1fb1('0x36')]));_0x5402e9['attributes']=_0x5402e9[_0x1fb1('0x35')]['length']?_0x5402e9[_0x1fb1('0x35')]:_0x245f84['model'];if(!_0x90d8ef['query'][_0x1fb1('0x37')](_0x1fb1('0x38'))){_0x5402e9[_0x1fb1('0x1d')]=qs[_0x1fb1('0x1d')](_0x90d8ef['query'][_0x1fb1('0x1d')]);_0x5402e9[_0x1fb1('0x1b')]=qs[_0x1fb1('0x1b')](_0x90d8ef['query'][_0x1fb1('0x1b')]);}_0x5402e9[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3a')]);_0x5402e9[_0x1fb1('0x3b')]=qs[_0x1fb1('0x33')](_['pick'](_0x90d8ef[_0x1fb1('0x32')],_0x245f84[_0x1fb1('0x33')]),_0x5d45a5);if(_0x90d8ef['query'][_0x1fb1('0x3c')]){_0x5402e9['where']=_[_0x1fb1('0x3d')](_0x5402e9[_0x1fb1('0x3b')],{'$or':_[_0x1fb1('0x2e')](_0x5d45a5,function(_0x439eec){if(_0x439eec[_0x1fb1('0x3e')]!==_0x1fb1('0x3f')){var _0x927301={};_0x927301[_0x439eec[_0x1fb1('0x2b')]]={'$like':'%'+_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3c')]+'%'};return _0x927301;}})});}_0x5402e9=_[_0x1fb1('0x3d')]({},_0x5402e9,_0x90d8ef[_0x1fb1('0x40')]);var _0xafc9a7={'where':_0x5402e9[_0x1fb1('0x3b')]};return db[_0x1fb1('0x41')]['count'](_0xafc9a7)[_0x1fb1('0x23')](function(_0xca1fd3){_0x30c8eb[_0x1fb1('0x1e')]=_0xca1fd3;if(_0x90d8ef[_0x1fb1('0x32')]['includeAll']){_0x5402e9['include']=[{'all':!![]}];}return db[_0x1fb1('0x41')][_0x1fb1('0x42')](_0x5402e9);})[_0x1fb1('0x23')](function(_0x3edc8a){_0x30c8eb[_0x1fb1('0x43')]=_0x3edc8a;return _0x30c8eb;})[_0x1fb1('0x23')](respondWithFilteredResult(_0x1b71cb,_0x5402e9))[_0x1fb1('0x44')](handleError(_0x1b71cb,null));};exports[_0x1fb1('0x45')]=function(_0x14aa27,_0x320bda){var _0x4a943c={'raw':!![],'where':{'id':_0x14aa27['params']['id']}},_0x44ccbe={};_0x44ccbe['model']=_[_0x1fb1('0x46')](db[_0x1fb1('0x41')][_0x1fb1('0x47')]);_0x44ccbe[_0x1fb1('0x32')]=_['keys'](_0x14aa27['query']);_0x44ccbe[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],_0x44ccbe[_0x1fb1('0x32')]);_0x4a943c[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x14aa27[_0x1fb1('0x32')]['fields']));_0x4a943c['attributes']=_0x4a943c[_0x1fb1('0x35')]['length']?_0x4a943c[_0x1fb1('0x35')]:_0x44ccbe[_0x1fb1('0x31')];if(_0x14aa27[_0x1fb1('0x32')][_0x1fb1('0x48')]){_0x4a943c[_0x1fb1('0x49')]=[{'all':!![]}];}_0x4a943c=_[_0x1fb1('0x3d')]({},_0x4a943c,_0x14aa27['options']);return db[_0x1fb1('0x41')][_0x1fb1('0x4a')](_0x4a943c)[_0x1fb1('0x23')](handleEntityNotFound(_0x320bda,null))['then'](respondWithResult(_0x320bda,null))[_0x1fb1('0x44')](handleError(_0x320bda,null));};exports['create']=function(_0x6e105b,_0xba4fa7){return db[_0x1fb1('0x41')]['create'](_0x6e105b[_0x1fb1('0x4b')],{})[_0x1fb1('0x23')](function(_0x52271f){var _0xe492ab=_0x6e105b[_0x1fb1('0x4c')][_0x1fb1('0x25')]({'plain':!![]});if(!_0xe492ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe492ab['role']==='user'){var _0x31a85a=_0x52271f[_0x1fb1('0x25')]({'plain':!![]});var _0x1e2754=_0x1fb1('0x26');return db[_0x1fb1('0x4d')][_0x1fb1('0x4a')]({'where':{'name':_0x1e2754,'userProfileId':_0xe492ab['userProfileId']},'raw':!![]})['then'](function(_0x267c36){if(_0x267c36&&_0x267c36[_0x1fb1('0x4e')]===0x0){return db[_0x1fb1('0x27')][_0x1fb1('0x4f')]({'name':_0x31a85a['name'],'resourceId':_0x31a85a['id'],'type':_0x267c36['name'],'sectionId':_0x267c36['id']},{})[_0x1fb1('0x23')](function(){return _0x52271f;});}else{return _0x52271f;}})['catch'](function(_0x41fefb){logger['error'](_0x1fb1('0x50'),_0x41fefb);throw _0x41fefb;});}return _0x52271f;})['then'](respondWithResult(_0xba4fa7,0xc9))[_0x1fb1('0x44')](handleError(_0xba4fa7,null));};exports[_0x1fb1('0x22')]=function(_0x1475ee,_0xca9395){if(_0x1475ee[_0x1fb1('0x4b')]['id']){delete _0x1475ee['body']['id'];}return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x1475ee[_0x1fb1('0x51')]['id']}})['then'](handleEntityNotFound(_0xca9395,null))['then'](saveUpdates(_0x1475ee[_0x1fb1('0x4b')],null))[_0x1fb1('0x23')](respondWithResult(_0xca9395,null))[_0x1fb1('0x44')](handleError(_0xca9395,null));};exports[_0x1fb1('0x24')]=function(_0x439670,_0xc9e8d4){return db['ContactItemType'][_0x1fb1('0x4a')]({'where':{'id':_0x439670[_0x1fb1('0x51')]['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0xc9e8d4,null))[_0x1fb1('0x23')](db[_0x1fb1('0x52')][_0x1fb1('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x439670[_0x1fb1('0x51')]['id']}}))['then'](removeEntity(_0xc9e8d4,null))[_0x1fb1('0x44')](handleError(_0xc9e8d4,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index c9ca934..d587c88 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 _0x8c1a=['bluebird','request-promise','path','./contactItemType.attributes','ContactItemType','tools_contact_item_types','lodash','api','moment'];(function(_0x561f85,_0x535b06){var _0x58ab8c=function(_0x513f9d){while(--_0x513f9d){_0x561f85['push'](_0x561f85['shift']());}};_0x58ab8c(++_0x535b06);}(_0x8c1a,0x1ad));var _0xa8c1=function(_0x554db0,_0x4eda6b){_0x554db0=_0x554db0-0x0;var _0x2ac209=_0x8c1a[_0x554db0];return _0x2ac209;};'use strict';var _=require(_0xa8c1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8c1('0x1'));var moment=require(_0xa8c1('0x2'));var BPromise=require(_0xa8c1('0x3'));var rp=require(_0xa8c1('0x4'));var fs=require('fs');var path=require(_0xa8c1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8c1('0x6'));module['exports']=function(_0x396c2e,_0x3d8943){return _0x396c2e['define'](_0xa8c1('0x7'),attributes,{'tableName':_0xa8c1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe924=['api','moment','bluebird','path','rimraf','./contactItemType.attributes','exports','define','lodash','../../config/logger'];(function(_0x51d98c,_0x591b77){var _0x52a73e=function(_0x2329d9){while(--_0x2329d9){_0x51d98c['push'](_0x51d98c['shift']());}};_0x52a73e(++_0x591b77);}(_0xe924,0x1de));var _0x4e92=function(_0x28b34a,_0x3d5f72){_0x28b34a=_0x28b34a-0x0;var _0x596278=_0xe924[_0x28b34a];return _0x596278;};'use strict';var _=require(_0x4e92('0x0'));var util=require('util');var logger=require(_0x4e92('0x1'))(_0x4e92('0x2'));var moment=require(_0x4e92('0x3'));var BPromise=require(_0x4e92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e92('0x5'));var rimraf=require(_0x4e92('0x6'));var config=require('../../config/environment');var attributes=require(_0x4e92('0x7'));module[_0x4e92('0x8')]=function(_0x32829e,_0x517e6c){return _0x32829e[_0x4e92('0x9')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','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 00a505d..b315059 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 _0x9bf4=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x4b1341,_0x3a4635){var _0x2c2040=function(_0x3ce8ad){while(--_0x3ce8ad){_0x4b1341['push'](_0x4b1341['shift']());}};_0x2c2040(++_0x3a4635);}(_0x9bf4,0xd7));var _0x49bf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9bf4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x49bf('0x0'));var util=require(_0x49bf('0x1'));var moment=require(_0x49bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x49bf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49bf('0x4'))['db'];var utils=require(_0x49bf('0x5'));var logger=require(_0x49bf('0x6'))(_0x49bf('0x7'));var config=require(_0x49bf('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x49bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e1a61,_0xf0ae02,_0x140f37){return new BPromise(function(_0x4588a8,_0xc5ba83){return client[_0x49bf('0xa')](_0x4e1a61,_0x140f37)['then'](function(_0x5db58c){logger[_0x49bf('0xb')](_0x49bf('0xc'),_0xf0ae02,'request\x20sent');logger[_0x49bf('0xd')](_0x49bf('0xe'),_0xf0ae02,'request\x20sent',JSON[_0x49bf('0xf')](_0x5db58c));if(_0x5db58c[_0x49bf('0x10')]){if(_0x5db58c[_0x49bf('0x10')][_0x49bf('0x11')]===0x1f4){logger['error'](_0x49bf('0xc'),_0xf0ae02,_0x5db58c[_0x49bf('0x10')][_0x49bf('0x12')]);return _0xc5ba83(_0x5db58c[_0x49bf('0x10')][_0x49bf('0x12')]);}logger[_0x49bf('0x10')](_0x49bf('0xc'),_0xf0ae02,_0x5db58c['error'][_0x49bf('0x12')]);return _0x4588a8(_0x5db58c[_0x49bf('0x10')][_0x49bf('0x12')]);}else{logger[_0x49bf('0xb')](_0x49bf('0xc'),_0xf0ae02,_0x49bf('0x13'));_0x4588a8(_0x5db58c[_0x49bf('0x14')]['message']);}})[_0x49bf('0x15')](function(_0x3ff8b7){logger['error'](_0x49bf('0xc'),_0xf0ae02,_0x3ff8b7);_0xc5ba83(_0x3ff8b7);});});} \ No newline at end of file +var _0x8547=['jayson/promise','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x374954,_0x18dc36){var _0x42073e=function(_0x1cb45f){while(--_0x1cb45f){_0x374954['push'](_0x374954['shift']());}};_0x42073e(++_0x18dc36);}(_0x8547,0x1ae));var _0x7854=function(_0x31ad4b,_0x86e879){_0x31ad4b=_0x31ad4b-0x0;var _0x4ebb69=_0x8547[_0x31ad4b];return _0x4ebb69;};'use strict';var _=require(_0x7854('0x0'));var util=require(_0x7854('0x1'));var moment=require(_0x7854('0x2'));var BPromise=require(_0x7854('0x3'));var rs=require(_0x7854('0x4'));var fs=require('fs');var Redis=require(_0x7854('0x5'));var db=require(_0x7854('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7854('0x7'))(_0x7854('0x8'));var config=require(_0x7854('0x9'));var jayson=require(_0x7854('0xa'));var client=jayson['client'][_0x7854('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe88928,_0x1e678c,_0xde5ac){return new BPromise(function(_0x19eea5,_0x342e3b){return client[_0x7854('0xc')](_0xe88928,_0xde5ac)[_0x7854('0xd')](function(_0x26a561){logger['info'](_0x7854('0xe'),_0x1e678c,_0x7854('0xf'));logger[_0x7854('0x10')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x1e678c,_0x7854('0xf'),JSON[_0x7854('0x11')](_0x26a561));if(_0x26a561[_0x7854('0x12')]){if(_0x26a561['error']['code']===0x1f4){logger[_0x7854('0x12')](_0x7854('0xe'),_0x1e678c,_0x26a561['error'][_0x7854('0x13')]);return _0x342e3b(_0x26a561[_0x7854('0x12')][_0x7854('0x13')]);}logger[_0x7854('0x12')](_0x7854('0xe'),_0x1e678c,_0x26a561[_0x7854('0x12')][_0x7854('0x13')]);return _0x19eea5(_0x26a561[_0x7854('0x12')][_0x7854('0x13')]);}else{logger['info'](_0x7854('0xe'),_0x1e678c,_0x7854('0xf'));_0x19eea5(_0x26a561[_0x7854('0x14')][_0x7854('0x13')]);}})[_0x7854('0x15')](function(_0x1b57f0){logger[_0x7854('0x12')]('ContactItemType,\x20%s,\x20%s',_0x1e678c,_0x1b57f0);_0x342e3b(_0x1b57f0);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 6442de7..0632ef9 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 _0xd617=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x2a7771,_0x240907){var _0x1bf80c=function(_0x1ca863){while(--_0x1ca863){_0x2a7771['push'](_0x2a7771['shift']());}};_0x1bf80c(++_0x240907);}(_0xd617,0x1e1));var _0x7d61=function(_0xa95a5e,_0x322e23){_0xa95a5e=_0xa95a5e-0x0;var _0x9eee13=_0xd617[_0xa95a5e];return _0x9eee13;};'use strict';var multer=require(_0x7d61('0x0'));var util=require('util');var path=require(_0x7d61('0x1'));var timeout=require(_0x7d61('0x2'));var express=require('express');var router=express[_0x7d61('0x3')]();var fs_extra=require(_0x7d61('0x4'));var auth=require(_0x7d61('0x5'));var interaction=require(_0x7d61('0x6'));var config=require(_0x7d61('0x7'));var controller=require(_0x7d61('0x8'));router[_0x7d61('0x9')]('/',auth[_0x7d61('0xa')](),controller[_0x7d61('0xb')]);router[_0x7d61('0x9')](_0x7d61('0xc'),auth[_0x7d61('0xa')](),controller['show']);router[_0x7d61('0xd')]('/',auth['isAuthenticated'](),controller[_0x7d61('0xe')]);router[_0x7d61('0xf')]('/:id',auth[_0x7d61('0xa')](),controller[_0x7d61('0x10')]);router[_0x7d61('0x11')](_0x7d61('0xc'),auth[_0x7d61('0xa')](),controller[_0x7d61('0x12')]);module[_0x7d61('0x13')]=router; \ No newline at end of file +var _0x26ae=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4520cf,_0x55a167){var _0x470206=function(_0x3de8a5){while(--_0x3de8a5){_0x4520cf['push'](_0x4520cf['shift']());}};_0x470206(++_0x55a167);}(_0x26ae,0x122));var _0xe26a=function(_0x729896,_0x101131){_0x729896=_0x729896-0x0;var _0x36c6aa=_0x26ae[_0x729896];return _0x36c6aa;};'use strict';var multer=require(_0xe26a('0x0'));var util=require(_0xe26a('0x1'));var path=require(_0xe26a('0x2'));var timeout=require(_0xe26a('0x3'));var express=require('express');var router=express[_0xe26a('0x4')]();var fs_extra=require(_0xe26a('0x5'));var auth=require(_0xe26a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe26a('0x7'));router[_0xe26a('0x8')]('/',auth[_0xe26a('0x9')](),controller[_0xe26a('0xa')]);router[_0xe26a('0x8')](_0xe26a('0xb'),auth['isAuthenticated'](),controller[_0xe26a('0xc')]);router[_0xe26a('0xd')]('/',auth[_0xe26a('0x9')](),controller[_0xe26a('0xe')]);router['put'](_0xe26a('0xb'),auth[_0xe26a('0x9')](),controller[_0xe26a('0xf')]);router[_0xe26a('0x10')](_0xe26a('0xb'),auth['isAuthenticated'](),controller[_0xe26a('0x11')]);module[_0xe26a('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 10322f7..2560dc6 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb7e7[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index fcf69a3..087e2da 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 _0xc17b=['attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','CustomDashboards','sendStatus','error','stack','name','send','Dashboard','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','include','omit','createdAt','updatedAt','role','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xc17b,0x9b));var _0xbc17=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc17b[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xbc17('0x0'));var rimraf=require(_0xbc17('0x1'));var zipdir=require(_0xbc17('0x2'));var jsonpatch=require(_0xbc17('0x3'));var rp=require(_0xbc17('0x4'));var moment=require('moment');var BPromise=require(_0xbc17('0x5'));var Mustache=require(_0xbc17('0x6'));var util=require(_0xbc17('0x7'));var path=require(_0xbc17('0x8'));var sox=require('sox');var csv=require(_0xbc17('0x9'));var ejs=require(_0xbc17('0xa'));var fs=require('fs');var fs_extra=require(_0xbc17('0xb'));var _=require(_0xbc17('0xc'));var squel=require(_0xbc17('0xd'));var crypto=require(_0xbc17('0xe'));var jsforce=require(_0xbc17('0xf'));var deskjs=require(_0xbc17('0x10'));var toCsv=require(_0xbc17('0x9'));var querystring=require(_0xbc17('0x11'));var Papa=require(_0xbc17('0x12'));var Redis=require(_0xbc17('0x13'));var authService=require(_0xbc17('0x14'));var qs=require(_0xbc17('0x15'));var as=require(_0xbc17('0x16'));var hardwareService=require(_0xbc17('0x17'));var logger=require(_0xbc17('0x18'))(_0xbc17('0x19'));var utils=require(_0xbc17('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xbc17('0x1b'));var db=require(_0xbc17('0x1c'))['db'];config[_0xbc17('0x1d')]=_[_0xbc17('0x1e')](config[_0xbc17('0x1d')],{'host':_0xbc17('0x1f'),'port':0x18eb});var socket=require(_0xbc17('0x20'))(new Redis(config[_0xbc17('0x1d')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x6a0442,_0x2b72){_0x2b72=_0x2b72||0xcc;return function(_0x5835e0){if(_0x5835e0){return _0x6a0442['sendStatus'](_0x2b72);}return _0x6a0442[_0xbc17('0x21')](_0x2b72)[_0xbc17('0x22')]();};}function respondWithResult(_0x469c14,_0x1a33b8){_0x1a33b8=_0x1a33b8||0xc8;return function(_0x4b9f6f){if(_0x4b9f6f){return _0x469c14[_0xbc17('0x21')](_0x1a33b8)[_0xbc17('0x23')](_0x4b9f6f);}};}function respondWithFilteredResult(_0x171ef2,_0x4d97da){return function(_0xcfd983){if(_0xcfd983){var _0x15bdbf=typeof _0x4d97da[_0xbc17('0x24')]===_0xbc17('0x25')&&typeof _0x4d97da[_0xbc17('0x26')]===_0xbc17('0x25');var _0x2835b1=_0xcfd983[_0xbc17('0x27')];var _0x92e30a=_0x15bdbf?0x0:_0x4d97da[_0xbc17('0x24')];var _0x112e4e=_0x15bdbf?_0xcfd983[_0xbc17('0x27')]:_0x4d97da['offset']+_0x4d97da[_0xbc17('0x26')];var _0x3b8a7c;if(_0x112e4e>=_0x2835b1){_0x112e4e=_0x2835b1;_0x3b8a7c=0xc8;}else{_0x3b8a7c=0xce;}_0x171ef2[_0xbc17('0x21')](_0x3b8a7c);return _0x171ef2['set']('Content-Range',_0x92e30a+'-'+_0x112e4e+'/'+_0x2835b1)[_0xbc17('0x23')](_0xcfd983);}return null;};}function patchUpdates(_0x35f456){return function(_0x53b0f8){try{jsonpatch[_0xbc17('0x28')](_0x53b0f8,_0x35f456,!![]);}catch(_0x2a4679){return BPromise[_0xbc17('0x29')](_0x2a4679);}return _0x53b0f8[_0xbc17('0x2a')]();};}function saveUpdates(_0x26ca1a,_0x311e20){return function(_0x426720){if(_0x426720){return _0x426720[_0xbc17('0x2b')](_0x26ca1a)[_0xbc17('0x2c')](function(_0x4172b5){return _0x4172b5;});}return null;};}function removeEntity(_0x3992ce,_0x4aa30a){return function(_0x261a7d){if(_0x261a7d){return _0x261a7d[_0xbc17('0x2d')]()[_0xbc17('0x2c')](function(){var _0x3ccc34=_0x261a7d[_0xbc17('0x2e')]({'plain':!![]});var _0x33c84b=_0xbc17('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x33c84b,'resourceId':_0x3ccc34['id']}})[_0xbc17('0x2c')](function(){return _0x261a7d;});})[_0xbc17('0x2c')](function(){_0x3992ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1206bd,_0x3e8ddd){return function(_0x53850d){if(!_0x53850d){_0x1206bd[_0xbc17('0x30')](0x194);}return _0x53850d;};}function handleError(_0x99d1b9,_0x506c9d){_0x506c9d=_0x506c9d||0x1f4;return function(_0x3cb525){logger[_0xbc17('0x31')](_0x3cb525[_0xbc17('0x32')]);if(_0x3cb525['name']){delete _0x3cb525[_0xbc17('0x33')];}_0x99d1b9['status'](_0x506c9d)[_0xbc17('0x34')](_0x3cb525);};}exports['index']=function(_0x24e4b5,_0x4724a2){var _0x4aa014={},_0x58b064={},_0x626f0={'count':0x0,'rows':[]};var _0x4bbcad=_['map'](db[_0xbc17('0x35')][_0xbc17('0x36')],function(_0x45d1f2){return{'name':_0x45d1f2[_0xbc17('0x37')],'type':_0x45d1f2['type'][_0xbc17('0x38')]};});_0x58b064['model']=_[_0xbc17('0x39')](_0x4bbcad,_0xbc17('0x33'));_0x58b064[_0xbc17('0x3a')]=_[_0xbc17('0x3b')](_0x24e4b5[_0xbc17('0x3a')]);_0x58b064[_0xbc17('0x3c')]=_[_0xbc17('0x3d')](_0x58b064[_0xbc17('0x3e')],_0x58b064['query']);_0x4aa014[_0xbc17('0x3f')]=_[_0xbc17('0x3d')](_0x58b064['model'],qs[_0xbc17('0x40')](_0x24e4b5[_0xbc17('0x3a')][_0xbc17('0x40')]));_0x4aa014[_0xbc17('0x3f')]=_0x4aa014[_0xbc17('0x3f')]['length']?_0x4aa014[_0xbc17('0x3f')]:_0x58b064[_0xbc17('0x3e')];if(!_0x24e4b5[_0xbc17('0x3a')][_0xbc17('0x41')](_0xbc17('0x42'))){_0x4aa014[_0xbc17('0x26')]=qs[_0xbc17('0x26')](_0x24e4b5[_0xbc17('0x3a')][_0xbc17('0x26')]);_0x4aa014[_0xbc17('0x24')]=qs[_0xbc17('0x24')](_0x24e4b5[_0xbc17('0x3a')]['offset']);}_0x4aa014[_0xbc17('0x43')]=qs[_0xbc17('0x44')](_0x24e4b5[_0xbc17('0x3a')]['sort']);_0x4aa014['where']=qs[_0xbc17('0x3c')](_[_0xbc17('0x45')](_0x24e4b5[_0xbc17('0x3a')],_0x58b064[_0xbc17('0x3c')]),_0x4bbcad);if(_0x24e4b5['query'][_0xbc17('0x46')]){_0x4aa014[_0xbc17('0x47')]=_[_0xbc17('0x48')](_0x4aa014[_0xbc17('0x47')],{'$or':_['map'](_0x4bbcad,function(_0x463d87){if(_0x463d87['type']!==_0xbc17('0x49')){var _0x26a468={};_0x26a468[_0x463d87[_0xbc17('0x33')]]={'$like':'%'+_0x24e4b5['query'][_0xbc17('0x46')]+'%'};return _0x26a468;}})});}_0x4aa014=_['merge']({},_0x4aa014,_0x24e4b5['options']);var _0xd39e26={'where':_0x4aa014['where']};return db[_0xbc17('0x35')]['count'](_0xd39e26)[_0xbc17('0x2c')](function(_0x2ccdd6){_0x626f0[_0xbc17('0x27')]=_0x2ccdd6;if(_0x24e4b5[_0xbc17('0x3a')][_0xbc17('0x4a')]){_0x4aa014['include']=[{'all':!![]}];}return db[_0xbc17('0x35')][_0xbc17('0x4b')](_0x4aa014);})[_0xbc17('0x2c')](function(_0x5204c3){_0x626f0[_0xbc17('0x4c')]=_0x5204c3;return _0x626f0;})[_0xbc17('0x2c')](respondWithFilteredResult(_0x4724a2,_0x4aa014))[_0xbc17('0x4d')](handleError(_0x4724a2,null));};exports[_0xbc17('0x4e')]=function(_0x427965,_0x11864e){var _0x64dd79={'raw':![],'where':{'id':_0x427965[_0xbc17('0x4f')]['id']}},_0x521501={};_0x521501[_0xbc17('0x3e')]=_[_0xbc17('0x3b')](db[_0xbc17('0x35')][_0xbc17('0x36')]);_0x521501[_0xbc17('0x3a')]=_[_0xbc17('0x3b')](_0x427965[_0xbc17('0x3a')]);_0x521501[_0xbc17('0x3c')]=_[_0xbc17('0x3d')](_0x521501[_0xbc17('0x3e')],_0x521501[_0xbc17('0x3a')]);_0x64dd79['attributes']=_[_0xbc17('0x3d')](_0x521501[_0xbc17('0x3e')],qs[_0xbc17('0x40')](_0x427965['query'][_0xbc17('0x40')]));_0x64dd79[_0xbc17('0x3f')]=_0x64dd79[_0xbc17('0x3f')][_0xbc17('0x50')]?_0x64dd79['attributes']:_0x521501['model'];if(_0x427965[_0xbc17('0x3a')][_0xbc17('0x4a')]){_0x64dd79['include']=[{'all':!![]}];}_0x64dd79=_[_0xbc17('0x48')]({},_0x64dd79,_0x427965[_0xbc17('0x51')]);return db[_0xbc17('0x35')][_0xbc17('0x52')](_0x64dd79)[_0xbc17('0x2c')](handleEntityNotFound(_0x11864e,null))['then'](respondWithResult(_0x11864e,null))[_0xbc17('0x4d')](handleError(_0x11864e,null));};exports['create']=function(_0x49ddfc,_0x23683a){return db['Dashboard'][_0xbc17('0x53')](_0x49ddfc[_0xbc17('0x54')],{})['then'](function(_0x158cf5){var _0x25ebad=_0x49ddfc[_0xbc17('0x55')][_0xbc17('0x2e')]({'plain':!![]});if(!_0x25ebad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ebad['role']===_0xbc17('0x55')){var _0x50c4d7=_0x158cf5[_0xbc17('0x2e')]({'plain':!![]});var _0x33b6a5=_0xbc17('0x2f');return db[_0xbc17('0x56')][_0xbc17('0x52')]({'where':{'name':_0x33b6a5,'userProfileId':_0x25ebad[_0xbc17('0x57')]},'raw':!![]})[_0xbc17('0x2c')](function(_0x25bc7e){if(_0x25bc7e&&_0x25bc7e[_0xbc17('0x58')]===0x0){return db[_0xbc17('0x59')][_0xbc17('0x53')]({'name':_0x50c4d7[_0xbc17('0x33')],'resourceId':_0x50c4d7['id'],'type':_0x25bc7e['name'],'sectionId':_0x25bc7e['id']},{})[_0xbc17('0x2c')](function(){return _0x158cf5;});}else{return _0x158cf5;}})['catch'](function(_0x2e5b68){logger[_0xbc17('0x31')](_0xbc17('0x5a'),_0x2e5b68);throw _0x2e5b68;});}return _0x158cf5;})['then'](respondWithResult(_0x23683a,0xc9))[_0xbc17('0x4d')](handleError(_0x23683a,null));};exports['clone']=function(_0x14312f,_0x8b1613){var _0x2dca88={'where':{'id':_0x14312f[_0xbc17('0x4f')]['id']}},_0xa216fd={};_0xa216fd[_0xbc17('0x3e')]=_[_0xbc17('0x3b')](db[_0xbc17('0x35')][_0xbc17('0x36')]);_0x2dca88[_0xbc17('0x3f')]=_['intersection'](_0xa216fd[_0xbc17('0x3e')],qs['fields'](_0x14312f[_0xbc17('0x3a')]['fields']));_0x2dca88[_0xbc17('0x3f')]=_0x2dca88[_0xbc17('0x3f')]['length']?_0x2dca88['attributes']:_0xa216fd[_0xbc17('0x3e')];if(_0x14312f[_0xbc17('0x3a')][_0xbc17('0x4a')]){_0x2dca88[_0xbc17('0x5b')]=[{'all':!![]}];}_0x2dca88=_[_0xbc17('0x48')]({},_0x2dca88,_0x14312f[_0xbc17('0x51')]);return db['Dashboard'][_0xbc17('0x52')](_0x2dca88)[_0xbc17('0x2c')](handleEntityNotFound(_0x8b1613,null))[_0xbc17('0x2c')](function(_0x68c383){if(_0x68c383){var _0x36c710=_0x68c383[_0xbc17('0x2e')]({'plain':!![]});_0x36c710=qs[_0xbc17('0x5c')](_0x36c710,['id',_0xbc17('0x5d'),_0xbc17('0x5e')]);_0x14312f[_0xbc17('0x54')]=_[_0xbc17('0x5c')](_0x14312f[_0xbc17('0x54')],['id',_0xbc17('0x5d'),_0xbc17('0x5e')]);return db[_0xbc17('0x35')][_0xbc17('0x53')](_[_0xbc17('0x48')](_0x36c710,_0x14312f[_0xbc17('0x54')]),{'include':_0x14312f[_0xbc17('0x3a')][_0xbc17('0x4a')]?[{'all':!![]}]:undefined})[_0xbc17('0x2c')](function(_0x20f0c3){var _0x558137=_0x14312f[_0xbc17('0x55')][_0xbc17('0x2e')]({'plain':!![]});if(!_0x558137)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x558137[_0xbc17('0x5f')]===_0xbc17('0x55')){var _0x25db9e=_0x20f0c3[_0xbc17('0x2e')]({'plain':!![]});var _0x334390=_0xbc17('0x2f');return db['UserProfileSection'][_0xbc17('0x52')]({'where':{'name':_0x334390,'userProfileId':_0x558137[_0xbc17('0x57')]},'raw':!![]})[_0xbc17('0x2c')](function(_0x57a7c4){if(_0x57a7c4&&_0x57a7c4[_0xbc17('0x58')]===0x0){return db[_0xbc17('0x59')][_0xbc17('0x53')]({'name':_0x25db9e[_0xbc17('0x33')],'resourceId':_0x25db9e['id'],'type':_0x57a7c4['name'],'sectionId':_0x57a7c4['id']},{})['then'](function(){return _0x20f0c3;});}else{return _0x20f0c3;}})[_0xbc17('0x4d')](function(_0x20f040){logger[_0xbc17('0x31')](_0xbc17('0x5a'),_0x20f040);throw _0x20f040;});}return _0x20f0c3;});}})['then'](respondWithResult(_0x8b1613,0xc9))[_0xbc17('0x4d')](handleError(_0x8b1613,null));};exports[_0xbc17('0x2b')]=function(_0xac61e3,_0x162f49){if(_0xac61e3[_0xbc17('0x54')]['id']){delete _0xac61e3[_0xbc17('0x54')]['id'];}return db['Dashboard']['find']({'where':{'id':_0xac61e3[_0xbc17('0x4f')]['id']}})[_0xbc17('0x2c')](handleEntityNotFound(_0x162f49,null))[_0xbc17('0x2c')](saveUpdates(_0xac61e3[_0xbc17('0x54')],null))[_0xbc17('0x2c')](respondWithResult(_0x162f49,null))[_0xbc17('0x4d')](handleError(_0x162f49,null));};exports[_0xbc17('0x2d')]=function(_0x4e1b0b,_0x298461){return db[_0xbc17('0x35')][_0xbc17('0x52')]({'where':{'id':_0x4e1b0b[_0xbc17('0x4f')]['id']}})[_0xbc17('0x2c')](handleEntityNotFound(_0x298461,null))[_0xbc17('0x2c')](removeEntity(_0x298461,null))['catch'](handleError(_0x298461,null));};function widgetAttributes(_0x129636){try{switch(_0x129636[_0xbc17('0x60')]){case'iframe':return[{'name':_0xbc17('0x61'),'value':_0x129636[_0xbc17('0x61')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x0]?_0x129636['attrs'][0x0][_0xbc17('0x63')]:undefined)||_0xbc17('0x64')}];case _0xbc17('0x65'):return[{'name':_0xbc17('0x66'),'value':_0x129636[_0xbc17('0x66')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x0]?_0x129636[_0xbc17('0x62')][0x0][_0xbc17('0x63')]:undefined)||''}];case _0xbc17('0x67'):return[{'name':_0xbc17('0x68'),'value':_0x129636[_0xbc17('0x68')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x0]?_0x129636[_0xbc17('0x62')][0x0]['value']:undefined)||_0xbc17('0x69')},{'name':_0xbc17('0x6a'),'value':_0x129636[_0xbc17('0x6a')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x1]?_0x129636[_0xbc17('0x62')][0x1]['value']:undefined)||_0xbc17('0x6b')},{'name':_0xbc17('0x6c'),'value':_0x129636[_0xbc17('0x6c')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x2]?_0x129636['attrs'][0x2][_0xbc17('0x63')]:undefined)||0xc}];case _0xbc17('0x6d'):return[{'name':_0xbc17('0x6e'),'value':_0x129636[_0xbc17('0x6e')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x0]?_0x129636['attrs'][0x0][_0xbc17('0x63')]:undefined)||_0xbc17('0x6f')},{'name':_0xbc17('0x70'),'value':_0x129636[_0xbc17('0x70')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x1]?_0x129636[_0xbc17('0x62')][0x1]['value']:undefined)||[]},{'name':_0xbc17('0x6c'),'value':_0x129636['attrFontSize']||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0x2]?_0x129636[_0xbc17('0x62')][0x2][_0xbc17('0x63')]:undefined)||0x14},{'name':_0xbc17('0x71'),'value':_0x129636['attrChannel']||(_0x129636['attrs']&&_0x129636['attrs'][0x3]?_0x129636[_0xbc17('0x62')][0x3][_0xbc17('0x63')]:undefined)||_0xbc17('0x72')},{'name':'attrEmailAccounts','value':_0x129636[_0xbc17('0x73')]||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0x4]?_0x129636['attrs'][0x4][_0xbc17('0x63')]:undefined)||''},{'name':_0xbc17('0x74'),'value':_0x129636['attrFaxAccounts']||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x5]?_0x129636[_0xbc17('0x62')][0x5]['value']:undefined)||''},{'name':_0xbc17('0x75'),'value':_0x129636[_0xbc17('0x75')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x6]?_0x129636[_0xbc17('0x62')][0x6]['value']:undefined)||''},{'name':_0xbc17('0x76'),'value':_0x129636['attrOpenchannelAccounts']||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x7]?_0x129636[_0xbc17('0x62')][0x7][_0xbc17('0x63')]:undefined)||''},{'name':_0xbc17('0x77'),'value':_0x129636[_0xbc17('0x77')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x8]?_0x129636[_0xbc17('0x62')][0x8][_0xbc17('0x63')]:undefined)||''},{'name':_0xbc17('0x78'),'value':_0x129636['attrChatWebsites']||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x9]?_0x129636[_0xbc17('0x62')][0x9][_0xbc17('0x63')]:undefined)||''}];case'multibar-chart':case _0xbc17('0x79'):return[{'name':_0xbc17('0x7a'),'value':_0x129636[_0xbc17('0x7a')]||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0x0]?_0x129636[_0xbc17('0x62')][0x0]['value']:undefined)||'total'},{'name':_0xbc17('0x7b'),'value':_0x129636[_0xbc17('0x7b')]||(_0x129636['attrs']&&_0x129636[_0xbc17('0x62')][0x1]?_0x129636['attrs'][0x1][_0xbc17('0x63')]:undefined)||null},{'name':_0xbc17('0x7c'),'value':_0x129636[_0xbc17('0x7c')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x2]?_0x129636[_0xbc17('0x62')][0x2][_0xbc17('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x129636[_0xbc17('0x70')]||(_0x129636['attrs']&&_0x129636[_0xbc17('0x62')][0x3]?_0x129636[_0xbc17('0x62')][0x3]['value']:undefined)||[]},{'name':_0xbc17('0x71'),'value':_0x129636['attrChannel']||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x4]?_0x129636[_0xbc17('0x62')][0x4][_0xbc17('0x63')]:undefined)||_0xbc17('0x72')},{'name':_0xbc17('0x73'),'value':_0x129636['attrEmailAccounts']||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0x5]?_0x129636[_0xbc17('0x62')][0x5][_0xbc17('0x63')]:undefined)||''},{'name':_0xbc17('0x74'),'value':_0x129636[_0xbc17('0x74')]||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0x6]?_0x129636[_0xbc17('0x62')][0x6]['value']:undefined)||''},{'name':_0xbc17('0x75'),'value':_0x129636['attrSmsAccounts']||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x7]?_0x129636[_0xbc17('0x62')][0x7]['value']:undefined)||''},{'name':_0xbc17('0x76'),'value':_0x129636[_0xbc17('0x76')]||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0x8]?_0x129636[_0xbc17('0x62')][0x8][_0xbc17('0x63')]:undefined)||''},{'name':_0xbc17('0x77'),'value':_0x129636[_0xbc17('0x77')]||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0x9]?_0x129636[_0xbc17('0x62')][0x9][_0xbc17('0x63')]:undefined)||''},{'name':_0xbc17('0x78'),'value':_0x129636['attrChatWebsites']||(_0x129636[_0xbc17('0x62')]&&_0x129636['attrs'][0xa]?_0x129636['attrs'][0xa][_0xbc17('0x63')]:undefined)||''}];case _0xbc17('0x7d'):return[{'name':_0xbc17('0x7e'),'type':_0x129636[_0xbc17('0x7f')]||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x0]?_0x129636[_0xbc17('0x62')][0x0][_0xbc17('0x60')]:undefined)||null,'value':_0x129636[_0xbc17('0x7e')]||(_0x129636['attrs']&&_0x129636[_0xbc17('0x62')][0x0]?_0x129636['attrs'][0x0][_0xbc17('0x63')]:undefined)||null},{'name':_0xbc17('0x80'),'value':_0x129636['attrRefresh']||(_0x129636[_0xbc17('0x62')]&&_0x129636[_0xbc17('0x62')][0x1]?_0x129636[_0xbc17('0x62')][0x1][_0xbc17('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x3532c6){logger[_0xbc17('0x31')](_0xbc17('0x81'),JSON[_0xbc17('0x82')](_0x3532c6));return[];}}exports['addItem']=function(_0xb179bc,_0x476ca6,_0x490a7f){if(_0xb179bc[_0xbc17('0x54')]['id']){delete _0xb179bc[_0xbc17('0x54')]['id'];}return db[_0xbc17('0x35')]['find']({'where':{'id':_0xb179bc[_0xbc17('0x4f')]['id']}})['then'](handleEntityNotFound(_0x476ca6,null))[_0xbc17('0x2c')](function(_0x290d3a){if(_0x290d3a){_0xb179bc[_0xbc17('0x54')][_0xbc17('0x83')]=_0x290d3a['id'];_0xb179bc[_0xbc17('0x54')][_0xbc17('0x62')]=widgetAttributes(_0xb179bc['body']);return db['DashboardItem'][_0xbc17('0x53')](_0xb179bc['body']);}})[_0xbc17('0x2c')](respondWithResult(_0x476ca6,null))['catch'](handleError(_0x476ca6,null));};exports[_0xbc17('0x84')]=function(_0x3c616b,_0x21f867,_0x8cea2b){var _0x2caff2={};var _0x554a67={};var _0xe780e0;var _0x8c63e9;return db['Dashboard'][_0xbc17('0x85')]({'where':{'id':_0x3c616b[_0xbc17('0x4f')]['id']}})[_0xbc17('0x2c')](handleEntityNotFound(_0x21f867,null))[_0xbc17('0x2c')](function(_0x14cf0a){if(_0x14cf0a){_0xe780e0=_0x14cf0a;_0x554a67[_0xbc17('0x3e')]=_[_0xbc17('0x3b')](db['DashboardItem']['rawAttributes']);_0x554a67[_0xbc17('0x3a')]=_[_0xbc17('0x3b')](_0x3c616b[_0xbc17('0x3a')]);_0x554a67[_0xbc17('0x3c')]=_[_0xbc17('0x3d')](_0x554a67['model'],_0x554a67[_0xbc17('0x3a')]);_0x2caff2['attributes']=_[_0xbc17('0x3d')](_0x554a67[_0xbc17('0x3e')],qs[_0xbc17('0x40')](_0x3c616b['query']['fields']));_0x2caff2[_0xbc17('0x3f')]=_0x2caff2['attributes'][_0xbc17('0x50')]?_0x2caff2[_0xbc17('0x3f')]:_0x554a67[_0xbc17('0x3e')];_0x2caff2[_0xbc17('0x43')]=qs[_0xbc17('0x44')](_0x3c616b[_0xbc17('0x3a')][_0xbc17('0x44')]);_0x2caff2[_0xbc17('0x47')]=qs[_0xbc17('0x3c')](_['pick'](_0x3c616b['query'],_0x554a67['filters']));if(_0x3c616b[_0xbc17('0x3a')][_0xbc17('0x46')]){_0x2caff2['where']=_['merge'](_0x2caff2[_0xbc17('0x47')],{'$or':_[_0xbc17('0x39')](_0x2caff2[_0xbc17('0x3f')],function(_0x210a8d){var _0x377231={};_0x377231[_0x210a8d]={'$like':'%'+_0x3c616b[_0xbc17('0x3a')]['filter']+'%'};return _0x377231;})});}_0x2caff2=_[_0xbc17('0x48')]({},_0x2caff2,_0x3c616b[_0xbc17('0x51')]);return _0xe780e0[_0xbc17('0x84')](_0x2caff2);}})[_0xbc17('0x2c')](function(_0x196dc6){if(_0x196dc6){_0x8c63e9=_0x196dc6[_0xbc17('0x50')];if(!_0x3c616b['query'][_0xbc17('0x41')](_0xbc17('0x42'))){_0x2caff2[_0xbc17('0x26')]=qs[_0xbc17('0x26')](_0x3c616b[_0xbc17('0x3a')][_0xbc17('0x26')]);_0x2caff2[_0xbc17('0x24')]=qs['offset'](_0x3c616b[_0xbc17('0x3a')]['offset']);}return _0xe780e0[_0xbc17('0x84')](_0x2caff2);}})[_0xbc17('0x2c')](function(_0x5e4669){if(_0x5e4669){return _0x5e4669?{'count':_0x8c63e9,'rows':_0x5e4669}:null;}})['then'](respondWithResult(_0x21f867,null))[_0xbc17('0x4d')](handleError(_0x21f867,null));}; \ No newline at end of file +var _0x0285=['attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','socket.io-emitter','register','sendStatus','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','then','get','CustomDashboards','status','end','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','merge','filter','options','includeAll','findAll','catch','show','params','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','clone','include','omit','createdAt','updatedAt','update','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x0285,0x17d));var _0x5028=function(_0xfcb0f1,_0x3f2d57){_0xfcb0f1=_0xfcb0f1-0x0;var _0x4ed14e=_0x0285[_0xfcb0f1];return _0x4ed14e;};'use strict';var emlformat=require(_0x5028('0x0'));var rimraf=require(_0x5028('0x1'));var zipdir=require(_0x5028('0x2'));var jsonpatch=require(_0x5028('0x3'));var rp=require(_0x5028('0x4'));var moment=require(_0x5028('0x5'));var BPromise=require(_0x5028('0x6'));var Mustache=require(_0x5028('0x7'));var util=require(_0x5028('0x8'));var path=require(_0x5028('0x9'));var sox=require('sox');var csv=require(_0x5028('0xa'));var ejs=require(_0x5028('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5028('0xc'));var squel=require('squel');var crypto=require(_0x5028('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5028('0xa'));var querystring=require(_0x5028('0xe'));var Papa=require(_0x5028('0xf'));var Redis=require(_0x5028('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5028('0x11'));var as=require(_0x5028('0x12'));var hardwareService=require(_0x5028('0x13'));var logger=require(_0x5028('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5028('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5028('0x16')](config[_0x5028('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5028('0x18'))(new Redis(config[_0x5028('0x17')]));require('./dashboard.socket')[_0x5028('0x19')](socket);function respondWithStatusCode(_0x42367c,_0x5efcd3){_0x5efcd3=_0x5efcd3||0xcc;return function(_0x5ca05d){if(_0x5ca05d){return _0x42367c[_0x5028('0x1a')](_0x5efcd3);}return _0x42367c['status'](_0x5efcd3)['end']();};}function respondWithResult(_0x506fd4,_0x18aec4){_0x18aec4=_0x18aec4||0xc8;return function(_0x2653fe){if(_0x2653fe){return _0x506fd4['status'](_0x18aec4)[_0x5028('0x1b')](_0x2653fe);}};}function respondWithFilteredResult(_0x2f73e3,_0x3e1d50){return function(_0x3524de){if(_0x3524de){var _0x11edb6=typeof _0x3e1d50[_0x5028('0x1c')]==='undefined'&&typeof _0x3e1d50[_0x5028('0x1d')]===_0x5028('0x1e');var _0x322842=_0x3524de[_0x5028('0x1f')];var _0x5199b1=_0x11edb6?0x0:_0x3e1d50[_0x5028('0x1c')];var _0x36b504=_0x11edb6?_0x3524de['count']:_0x3e1d50[_0x5028('0x1c')]+_0x3e1d50[_0x5028('0x1d')];var _0x26060d;if(_0x36b504>=_0x322842){_0x36b504=_0x322842;_0x26060d=0xc8;}else{_0x26060d=0xce;}_0x2f73e3['status'](_0x26060d);return _0x2f73e3['set'](_0x5028('0x20'),_0x5199b1+'-'+_0x36b504+'/'+_0x322842)[_0x5028('0x1b')](_0x3524de);}return null;};}function patchUpdates(_0x287543){return function(_0x1bf925){try{jsonpatch[_0x5028('0x21')](_0x1bf925,_0x287543,!![]);}catch(_0x2336ad){return BPromise[_0x5028('0x22')](_0x2336ad);}return _0x1bf925[_0x5028('0x23')]();};}function saveUpdates(_0x135b80,_0x4250e7){return function(_0x173d67){if(_0x173d67){return _0x173d67['update'](_0x135b80)['then'](function(_0x4cef5b){return _0x4cef5b;});}return null;};}function removeEntity(_0x1e33e4,_0x5d4bb7){return function(_0x526326){if(_0x526326){return _0x526326[_0x5028('0x24')]()[_0x5028('0x25')](function(){var _0x4a0326=_0x526326[_0x5028('0x26')]({'plain':!![]});var _0x31cadc=_0x5028('0x27');return db['UserProfileResource'][_0x5028('0x24')]({'where':{'type':_0x31cadc,'resourceId':_0x4a0326['id']}})[_0x5028('0x25')](function(){return _0x526326;});})['then'](function(){_0x1e33e4[_0x5028('0x28')](0xcc)[_0x5028('0x29')]();});}};}function handleEntityNotFound(_0x3eee52,_0x3b3a88){return function(_0x3ddae4){if(!_0x3ddae4){_0x3eee52[_0x5028('0x1a')](0x194);}return _0x3ddae4;};}function handleError(_0xf60305,_0x2e5955){_0x2e5955=_0x2e5955||0x1f4;return function(_0xfb3311){logger[_0x5028('0x2a')](_0xfb3311[_0x5028('0x2b')]);if(_0xfb3311[_0x5028('0x2c')]){delete _0xfb3311['name'];}_0xf60305[_0x5028('0x28')](_0x2e5955)['send'](_0xfb3311);};}exports[_0x5028('0x2d')]=function(_0x42cd51,_0x395ffe){var _0x17bef6={},_0x52449e={},_0x12cb0c={'count':0x0,'rows':[]};var _0x2ac7cc=_[_0x5028('0x2e')](db[_0x5028('0x2f')][_0x5028('0x30')],function(_0x426942){return{'name':_0x426942[_0x5028('0x31')],'type':_0x426942[_0x5028('0x32')][_0x5028('0x33')]};});_0x52449e[_0x5028('0x34')]=_[_0x5028('0x2e')](_0x2ac7cc,'name');_0x52449e[_0x5028('0x35')]=_[_0x5028('0x36')](_0x42cd51[_0x5028('0x35')]);_0x52449e['filters']=_[_0x5028('0x37')](_0x52449e[_0x5028('0x34')],_0x52449e[_0x5028('0x35')]);_0x17bef6[_0x5028('0x38')]=_[_0x5028('0x37')](_0x52449e['model'],qs[_0x5028('0x39')](_0x42cd51[_0x5028('0x35')][_0x5028('0x39')]));_0x17bef6[_0x5028('0x38')]=_0x17bef6[_0x5028('0x38')][_0x5028('0x3a')]?_0x17bef6[_0x5028('0x38')]:_0x52449e[_0x5028('0x34')];if(!_0x42cd51['query']['hasOwnProperty'](_0x5028('0x3b'))){_0x17bef6[_0x5028('0x1d')]=qs['limit'](_0x42cd51[_0x5028('0x35')][_0x5028('0x1d')]);_0x17bef6['offset']=qs['offset'](_0x42cd51[_0x5028('0x35')]['offset']);}_0x17bef6['order']=qs[_0x5028('0x3c')](_0x42cd51['query']['sort']);_0x17bef6[_0x5028('0x3d')]=qs['filters'](_[_0x5028('0x3e')](_0x42cd51['query'],_0x52449e[_0x5028('0x3f')]),_0x2ac7cc);if(_0x42cd51['query']['filter']){_0x17bef6[_0x5028('0x3d')]=_[_0x5028('0x40')](_0x17bef6['where'],{'$or':_['map'](_0x2ac7cc,function(_0x498054){if(_0x498054[_0x5028('0x32')]!=='VIRTUAL'){var _0xcde52f={};_0xcde52f[_0x498054[_0x5028('0x2c')]]={'$like':'%'+_0x42cd51['query'][_0x5028('0x41')]+'%'};return _0xcde52f;}})});}_0x17bef6=_[_0x5028('0x40')]({},_0x17bef6,_0x42cd51[_0x5028('0x42')]);var _0x5b8623={'where':_0x17bef6[_0x5028('0x3d')]};return db['Dashboard'][_0x5028('0x1f')](_0x5b8623)['then'](function(_0x1df06d){_0x12cb0c[_0x5028('0x1f')]=_0x1df06d;if(_0x42cd51[_0x5028('0x35')][_0x5028('0x43')]){_0x17bef6['include']=[{'all':!![]}];}return db[_0x5028('0x2f')][_0x5028('0x44')](_0x17bef6);})[_0x5028('0x25')](function(_0x241462){_0x12cb0c['rows']=_0x241462;return _0x12cb0c;})[_0x5028('0x25')](respondWithFilteredResult(_0x395ffe,_0x17bef6))[_0x5028('0x45')](handleError(_0x395ffe,null));};exports[_0x5028('0x46')]=function(_0x342caf,_0x2deff5){var _0x43b978={'raw':![],'where':{'id':_0x342caf[_0x5028('0x47')]['id']}},_0x522cde={};_0x522cde['model']=_[_0x5028('0x36')](db[_0x5028('0x2f')][_0x5028('0x30')]);_0x522cde[_0x5028('0x35')]=_['keys'](_0x342caf['query']);_0x522cde['filters']=_['intersection'](_0x522cde[_0x5028('0x34')],_0x522cde['query']);_0x43b978[_0x5028('0x38')]=_[_0x5028('0x37')](_0x522cde[_0x5028('0x34')],qs[_0x5028('0x39')](_0x342caf[_0x5028('0x35')][_0x5028('0x39')]));_0x43b978[_0x5028('0x38')]=_0x43b978['attributes'][_0x5028('0x3a')]?_0x43b978['attributes']:_0x522cde[_0x5028('0x34')];if(_0x342caf[_0x5028('0x35')][_0x5028('0x43')]){_0x43b978['include']=[{'all':!![]}];}_0x43b978=_[_0x5028('0x40')]({},_0x43b978,_0x342caf[_0x5028('0x42')]);return db[_0x5028('0x2f')][_0x5028('0x48')](_0x43b978)[_0x5028('0x25')](handleEntityNotFound(_0x2deff5,null))['then'](respondWithResult(_0x2deff5,null))[_0x5028('0x45')](handleError(_0x2deff5,null));};exports[_0x5028('0x49')]=function(_0x4a9bc1,_0x5906c6){return db['Dashboard']['create'](_0x4a9bc1[_0x5028('0x4a')],{})[_0x5028('0x25')](function(_0x3f8c43){var _0x1a53b5=_0x4a9bc1[_0x5028('0x4b')]['get']({'plain':!![]});if(!_0x1a53b5)throw new Error(_0x5028('0x4c'));if(_0x1a53b5[_0x5028('0x4d')]===_0x5028('0x4b')){var _0x4ab730=_0x3f8c43[_0x5028('0x26')]({'plain':!![]});var _0x361b79=_0x5028('0x27');return db[_0x5028('0x4e')][_0x5028('0x48')]({'where':{'name':_0x361b79,'userProfileId':_0x1a53b5[_0x5028('0x4f')]},'raw':!![]})[_0x5028('0x25')](function(_0x550933){if(_0x550933&&_0x550933[_0x5028('0x50')]===0x0){return db[_0x5028('0x51')][_0x5028('0x49')]({'name':_0x4ab730[_0x5028('0x2c')],'resourceId':_0x4ab730['id'],'type':_0x550933[_0x5028('0x2c')],'sectionId':_0x550933['id']},{})['then'](function(){return _0x3f8c43;});}else{return _0x3f8c43;}})[_0x5028('0x45')](function(_0x25c113){logger['error'](_0x5028('0x52'),_0x25c113);throw _0x25c113;});}return _0x3f8c43;})[_0x5028('0x25')](respondWithResult(_0x5906c6,0xc9))[_0x5028('0x45')](handleError(_0x5906c6,null));};exports[_0x5028('0x53')]=function(_0x4d0633,_0x307edc){var _0x526a2a={'where':{'id':_0x4d0633[_0x5028('0x47')]['id']}},_0x472f78={};_0x472f78[_0x5028('0x34')]=_[_0x5028('0x36')](db[_0x5028('0x2f')][_0x5028('0x30')]);_0x526a2a['attributes']=_[_0x5028('0x37')](_0x472f78['model'],qs[_0x5028('0x39')](_0x4d0633['query'][_0x5028('0x39')]));_0x526a2a['attributes']=_0x526a2a[_0x5028('0x38')]['length']?_0x526a2a['attributes']:_0x472f78[_0x5028('0x34')];if(_0x4d0633[_0x5028('0x35')][_0x5028('0x43')]){_0x526a2a[_0x5028('0x54')]=[{'all':!![]}];}_0x526a2a=_['merge']({},_0x526a2a,_0x4d0633[_0x5028('0x42')]);return db[_0x5028('0x2f')][_0x5028('0x48')](_0x526a2a)[_0x5028('0x25')](handleEntityNotFound(_0x307edc,null))[_0x5028('0x25')](function(_0x11ae56){if(_0x11ae56){var _0x277e3a=_0x11ae56[_0x5028('0x26')]({'plain':!![]});_0x277e3a=qs[_0x5028('0x55')](_0x277e3a,['id',_0x5028('0x56'),_0x5028('0x57')]);_0x4d0633[_0x5028('0x4a')]=_[_0x5028('0x55')](_0x4d0633[_0x5028('0x4a')],['id',_0x5028('0x56'),_0x5028('0x57')]);return db[_0x5028('0x2f')][_0x5028('0x49')](_[_0x5028('0x40')](_0x277e3a,_0x4d0633[_0x5028('0x4a')]),{'include':_0x4d0633[_0x5028('0x35')][_0x5028('0x43')]?[{'all':!![]}]:undefined})[_0x5028('0x25')](function(_0x4bd09e){var _0x19f101=_0x4d0633[_0x5028('0x4b')][_0x5028('0x26')]({'plain':!![]});if(!_0x19f101)throw new Error(_0x5028('0x4c'));if(_0x19f101[_0x5028('0x4d')]===_0x5028('0x4b')){var _0x839826=_0x4bd09e[_0x5028('0x26')]({'plain':!![]});var _0x438743=_0x5028('0x27');return db[_0x5028('0x4e')][_0x5028('0x48')]({'where':{'name':_0x438743,'userProfileId':_0x19f101['userProfileId']},'raw':!![]})[_0x5028('0x25')](function(_0xcbf5a8){if(_0xcbf5a8&&_0xcbf5a8[_0x5028('0x50')]===0x0){return db[_0x5028('0x51')][_0x5028('0x49')]({'name':_0x839826[_0x5028('0x2c')],'resourceId':_0x839826['id'],'type':_0xcbf5a8[_0x5028('0x2c')],'sectionId':_0xcbf5a8['id']},{})['then'](function(){return _0x4bd09e;});}else{return _0x4bd09e;}})[_0x5028('0x45')](function(_0x4bb454){logger[_0x5028('0x2a')](_0x5028('0x52'),_0x4bb454);throw _0x4bb454;});}return _0x4bd09e;});}})['then'](respondWithResult(_0x307edc,0xc9))[_0x5028('0x45')](handleError(_0x307edc,null));};exports[_0x5028('0x58')]=function(_0x323e0e,_0x2dc8ae){if(_0x323e0e['body']['id']){delete _0x323e0e[_0x5028('0x4a')]['id'];}return db[_0x5028('0x2f')][_0x5028('0x48')]({'where':{'id':_0x323e0e[_0x5028('0x47')]['id']}})['then'](handleEntityNotFound(_0x2dc8ae,null))[_0x5028('0x25')](saveUpdates(_0x323e0e[_0x5028('0x4a')],null))[_0x5028('0x25')](respondWithResult(_0x2dc8ae,null))[_0x5028('0x45')](handleError(_0x2dc8ae,null));};exports[_0x5028('0x24')]=function(_0x233622,_0x56afb2){return db[_0x5028('0x2f')][_0x5028('0x48')]({'where':{'id':_0x233622['params']['id']}})[_0x5028('0x25')](handleEntityNotFound(_0x56afb2,null))['then'](removeEntity(_0x56afb2,null))['catch'](handleError(_0x56afb2,null));};function widgetAttributes(_0x3a9d12){try{switch(_0x3a9d12['type']){case'iframe':return[{'name':'attrUrl','value':_0x3a9d12[_0x5028('0x59')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x0]?_0x3a9d12[_0x5028('0x5a')][0x0]['value']:undefined)||_0x5028('0x5b')}];case'custom':return[{'name':_0x5028('0x5c'),'value':_0x3a9d12[_0x5028('0x5c')]||(_0x3a9d12['attrs']&&_0x3a9d12['attrs'][0x0]?_0x3a9d12[_0x5028('0x5a')][0x0][_0x5028('0x5d')]:undefined)||''}];case _0x5028('0x5e'):return[{'name':_0x5028('0x5f'),'value':_0x3a9d12[_0x5028('0x5f')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x0]?_0x3a9d12[_0x5028('0x5a')][0x0][_0x5028('0x5d')]:undefined)||_0x5028('0x60')},{'name':'attrTimezone','value':_0x3a9d12[_0x5028('0x61')]||(_0x3a9d12['attrs']&&_0x3a9d12[_0x5028('0x5a')][0x1]?_0x3a9d12[_0x5028('0x5a')][0x1]['value']:undefined)||_0x5028('0x62')},{'name':_0x5028('0x63'),'value':_0x3a9d12[_0x5028('0x63')]||(_0x3a9d12['attrs']&&_0x3a9d12['attrs'][0x2]?_0x3a9d12[_0x5028('0x5a')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x5028('0x64'),'value':_0x3a9d12['attrMetric']||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x0]?_0x3a9d12[_0x5028('0x5a')][0x0][_0x5028('0x5d')]:undefined)||_0x5028('0x65')},{'name':_0x5028('0x66'),'value':_0x3a9d12[_0x5028('0x66')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x1]?_0x3a9d12[_0x5028('0x5a')][0x1][_0x5028('0x5d')]:undefined)||[]},{'name':_0x5028('0x63'),'value':_0x3a9d12[_0x5028('0x63')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x2]?_0x3a9d12[_0x5028('0x5a')][0x2][_0x5028('0x5d')]:undefined)||0x14},{'name':_0x5028('0x67'),'value':_0x3a9d12[_0x5028('0x67')]||(_0x3a9d12['attrs']&&_0x3a9d12[_0x5028('0x5a')][0x3]?_0x3a9d12[_0x5028('0x5a')][0x3][_0x5028('0x5d')]:undefined)||_0x5028('0x68')},{'name':_0x5028('0x69'),'value':_0x3a9d12[_0x5028('0x69')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x4]?_0x3a9d12[_0x5028('0x5a')][0x4][_0x5028('0x5d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3a9d12[_0x5028('0x6a')]||(_0x3a9d12['attrs']&&_0x3a9d12[_0x5028('0x5a')][0x5]?_0x3a9d12[_0x5028('0x5a')][0x5][_0x5028('0x5d')]:undefined)||''},{'name':_0x5028('0x6b'),'value':_0x3a9d12[_0x5028('0x6b')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x6]?_0x3a9d12[_0x5028('0x5a')][0x6][_0x5028('0x5d')]:undefined)||''},{'name':_0x5028('0x6c'),'value':_0x3a9d12[_0x5028('0x6c')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x7]?_0x3a9d12[_0x5028('0x5a')][0x7][_0x5028('0x5d')]:undefined)||''},{'name':_0x5028('0x6d'),'value':_0x3a9d12[_0x5028('0x6d')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x8]?_0x3a9d12['attrs'][0x8][_0x5028('0x5d')]:undefined)||''},{'name':_0x5028('0x6e'),'value':_0x3a9d12[_0x5028('0x6e')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x9]?_0x3a9d12['attrs'][0x9][_0x5028('0x5d')]:undefined)||''}];case _0x5028('0x6f'):case'pie-chart':return[{'name':_0x5028('0x70'),'value':_0x3a9d12['attrSerie1']||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x0]?_0x3a9d12[_0x5028('0x5a')][0x0][_0x5028('0x5d')]:undefined)||_0x5028('0x65')},{'name':_0x5028('0x71'),'value':_0x3a9d12[_0x5028('0x71')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x1]?_0x3a9d12[_0x5028('0x5a')][0x1][_0x5028('0x5d')]:undefined)||null},{'name':_0x5028('0x72'),'value':_0x3a9d12[_0x5028('0x72')]||(_0x3a9d12['attrs']&&_0x3a9d12[_0x5028('0x5a')][0x2]?_0x3a9d12[_0x5028('0x5a')][0x2][_0x5028('0x5d')]:undefined)||null},{'name':_0x5028('0x66'),'value':_0x3a9d12['attrVoiceQueues']||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x3]?_0x3a9d12[_0x5028('0x5a')][0x3][_0x5028('0x5d')]:undefined)||[]},{'name':_0x5028('0x67'),'value':_0x3a9d12[_0x5028('0x67')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x4]?_0x3a9d12[_0x5028('0x5a')][0x4][_0x5028('0x5d')]:undefined)||_0x5028('0x68')},{'name':_0x5028('0x69'),'value':_0x3a9d12[_0x5028('0x69')]||(_0x3a9d12['attrs']&&_0x3a9d12[_0x5028('0x5a')][0x5]?_0x3a9d12[_0x5028('0x5a')][0x5][_0x5028('0x5d')]:undefined)||''},{'name':_0x5028('0x6a'),'value':_0x3a9d12['attrFaxAccounts']||(_0x3a9d12['attrs']&&_0x3a9d12['attrs'][0x6]?_0x3a9d12['attrs'][0x6][_0x5028('0x5d')]:undefined)||''},{'name':_0x5028('0x6b'),'value':_0x3a9d12[_0x5028('0x6b')]||(_0x3a9d12['attrs']&&_0x3a9d12['attrs'][0x7]?_0x3a9d12[_0x5028('0x5a')][0x7][_0x5028('0x5d')]:undefined)||''},{'name':_0x5028('0x6c'),'value':_0x3a9d12[_0x5028('0x6c')]||(_0x3a9d12['attrs']&&_0x3a9d12[_0x5028('0x5a')][0x8]?_0x3a9d12[_0x5028('0x5a')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3a9d12[_0x5028('0x6d')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x9]?_0x3a9d12[_0x5028('0x5a')][0x9]['value']:undefined)||''},{'name':_0x5028('0x6e'),'value':_0x3a9d12[_0x5028('0x6e')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0xa]?_0x3a9d12['attrs'][0xa][_0x5028('0x5d')]:undefined)||''}];case'web-report':return[{'name':_0x5028('0x73'),'type':_0x3a9d12[_0x5028('0x74')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x0]?_0x3a9d12[_0x5028('0x5a')][0x0]['type']:undefined)||null,'value':_0x3a9d12[_0x5028('0x73')]||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12['attrs'][0x0]?_0x3a9d12[_0x5028('0x5a')][0x0][_0x5028('0x5d')]:undefined)||null},{'name':_0x5028('0x75'),'value':_0x3a9d12['attrRefresh']||(_0x3a9d12[_0x5028('0x5a')]&&_0x3a9d12[_0x5028('0x5a')][0x1]?_0x3a9d12[_0x5028('0x5a')][0x1][_0x5028('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x1726d8){logger[_0x5028('0x2a')](_0x5028('0x76'),JSON[_0x5028('0x77')](_0x1726d8));return[];}}exports['addItem']=function(_0x2e0655,_0x9caaa,_0x449a00){if(_0x2e0655['body']['id']){delete _0x2e0655[_0x5028('0x4a')]['id'];}return db['Dashboard'][_0x5028('0x48')]({'where':{'id':_0x2e0655['params']['id']}})[_0x5028('0x25')](handleEntityNotFound(_0x9caaa,null))[_0x5028('0x25')](function(_0xa4d41e){if(_0xa4d41e){_0x2e0655['body'][_0x5028('0x78')]=_0xa4d41e['id'];_0x2e0655[_0x5028('0x4a')][_0x5028('0x5a')]=widgetAttributes(_0x2e0655[_0x5028('0x4a')]);return db[_0x5028('0x79')][_0x5028('0x49')](_0x2e0655[_0x5028('0x4a')]);}})[_0x5028('0x25')](respondWithResult(_0x9caaa,null))[_0x5028('0x45')](handleError(_0x9caaa,null));};exports['getItems']=function(_0x3df2a9,_0x5f4946,_0x3bc53e){var _0x414dea={};var _0x546e54={};var _0x53e6b9;var _0x16be8d;return db[_0x5028('0x2f')][_0x5028('0x7a')]({'where':{'id':_0x3df2a9[_0x5028('0x47')]['id']}})[_0x5028('0x25')](handleEntityNotFound(_0x5f4946,null))[_0x5028('0x25')](function(_0x8acae6){if(_0x8acae6){_0x53e6b9=_0x8acae6;_0x546e54[_0x5028('0x34')]=_[_0x5028('0x36')](db['DashboardItem']['rawAttributes']);_0x546e54['query']=_['keys'](_0x3df2a9['query']);_0x546e54['filters']=_['intersection'](_0x546e54[_0x5028('0x34')],_0x546e54['query']);_0x414dea['attributes']=_['intersection'](_0x546e54[_0x5028('0x34')],qs[_0x5028('0x39')](_0x3df2a9['query']['fields']));_0x414dea[_0x5028('0x38')]=_0x414dea['attributes'][_0x5028('0x3a')]?_0x414dea['attributes']:_0x546e54[_0x5028('0x34')];_0x414dea['order']=qs[_0x5028('0x3c')](_0x3df2a9[_0x5028('0x35')]['sort']);_0x414dea[_0x5028('0x3d')]=qs['filters'](_[_0x5028('0x3e')](_0x3df2a9[_0x5028('0x35')],_0x546e54[_0x5028('0x3f')]));if(_0x3df2a9['query']['filter']){_0x414dea[_0x5028('0x3d')]=_[_0x5028('0x40')](_0x414dea[_0x5028('0x3d')],{'$or':_['map'](_0x414dea[_0x5028('0x38')],function(_0x4b8b27){var _0x4a2d9d={};_0x4a2d9d[_0x4b8b27]={'$like':'%'+_0x3df2a9[_0x5028('0x35')][_0x5028('0x41')]+'%'};return _0x4a2d9d;})});}_0x414dea=_[_0x5028('0x40')]({},_0x414dea,_0x3df2a9[_0x5028('0x42')]);return _0x53e6b9[_0x5028('0x7b')](_0x414dea);}})['then'](function(_0x135eac){if(_0x135eac){_0x16be8d=_0x135eac[_0x5028('0x3a')];if(!_0x3df2a9[_0x5028('0x35')]['hasOwnProperty'](_0x5028('0x3b'))){_0x414dea[_0x5028('0x1d')]=qs[_0x5028('0x1d')](_0x3df2a9[_0x5028('0x35')][_0x5028('0x1d')]);_0x414dea[_0x5028('0x1c')]=qs[_0x5028('0x1c')](_0x3df2a9[_0x5028('0x35')]['offset']);}return _0x53e6b9['getItems'](_0x414dea);}})['then'](function(_0x133267){if(_0x133267){return _0x133267?{'count':_0x16be8d,'rows':_0x133267}:null;}})[_0x5028('0x25')](respondWithResult(_0x5f4946,null))[_0x5028('0x45')](handleError(_0x5f4946,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index def15aa..a526f22 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 _0xa12e=['emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard','save','update','remove'];(function(_0x3e7d17,_0x114f51){var _0x44e349=function(_0x4762ed){while(--_0x4762ed){_0x3e7d17['push'](_0x3e7d17['shift']());}};_0x44e349(++_0x114f51);}(_0xa12e,0x6f));var _0xea12=function(_0x3e08f3,_0x35bf04){_0x3e08f3=_0x3e08f3-0x0;var _0x4cdb44=_0xa12e[_0x3e08f3];return _0x4cdb44;};'use strict';var EventEmitter=require(_0xea12('0x0'));var Dashboard=require(_0xea12('0x1'))['db'][_0xea12('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea12('0x3'),'afterUpdate':_0xea12('0x4'),'afterDestroy':_0xea12('0x5')};function emitEvent(_0x2926c1){return function(_0x9c3055,_0x216e3f,_0x48b37a){DashboardEvents[_0xea12('0x6')](_0x2926c1+':'+_0x9c3055['id'],_0x9c3055);DashboardEvents[_0xea12('0x6')](_0x2926c1,_0x9c3055);_0x48b37a(null);};}for(var e in events){if(events[_0xea12('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xea12('0x8')]=DashboardEvents; \ No newline at end of file +var _0xe774=['emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','save','update','remove'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0xe774,0x135));var _0x4e77=function(_0x29c209,_0x38118b){_0x29c209=_0x29c209-0x0;var _0x1d5ba1=_0xe774[_0x29c209];return _0x1d5ba1;};'use strict';var EventEmitter=require(_0x4e77('0x0'));var Dashboard=require(_0x4e77('0x1'))['db'][_0x4e77('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4e77('0x3'),'afterUpdate':_0x4e77('0x4'),'afterDestroy':_0x4e77('0x5')};function emitEvent(_0x1e054d){return function(_0x1b8ffc,_0x436828,_0xcfe81e){DashboardEvents['emit'](_0x1e054d+':'+_0x1b8ffc['id'],_0x1b8ffc);DashboardEvents[_0x4e77('0x6')](_0x1e054d,_0x1b8ffc);_0xcfe81e(null);};}for(var e in events){if(events[_0x4e77('0x7')](e)){var event=events[e];Dashboard[_0x4e77('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index d8e21e4..cf8fde8 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 _0xd6e2=['dashboards','lodash','api','moment','bluebird','request-promise','path','./dashboard.attributes','exports','define'];(function(_0x5b7193,_0x304c69){var _0x4016af=function(_0x2e5b00){while(--_0x2e5b00){_0x5b7193['push'](_0x5b7193['shift']());}};_0x4016af(++_0x304c69);}(_0xd6e2,0x169));var _0x2d6e=function(_0x3a7ced,_0xccb91){_0x3a7ced=_0x3a7ced-0x0;var _0x8cb6d=_0xd6e2[_0x3a7ced];return _0x8cb6d;};'use strict';var _=require(_0x2d6e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d6e('0x1'));var moment=require(_0x2d6e('0x2'));var BPromise=require(_0x2d6e('0x3'));var rp=require(_0x2d6e('0x4'));var fs=require('fs');var path=require(_0x2d6e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2d6e('0x6'));module[_0x2d6e('0x7')]=function(_0x4f0eb7,_0x4176c4){return _0x4f0eb7[_0x2d6e('0x8')]('Dashboard',attributes,{'tableName':_0x2d6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d62=['rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3476bb,_0xcddcee){var _0x6cdc68=function(_0x1a8b08){while(--_0x1a8b08){_0x3476bb['push'](_0x3476bb['shift']());}};_0x6cdc68(++_0xcddcee);}(_0x9d62,0xaf));var _0x29d6=function(_0x1291bd,_0x29bc1f){_0x1291bd=_0x1291bd-0x0;var _0x33eb14=_0x9d62[_0x1291bd];return _0x33eb14;};'use strict';var _=require(_0x29d6('0x0'));var util=require(_0x29d6('0x1'));var logger=require(_0x29d6('0x2'))(_0x29d6('0x3'));var moment=require(_0x29d6('0x4'));var BPromise=require('bluebird');var rp=require(_0x29d6('0x5'));var fs=require('fs');var path=require(_0x29d6('0x6'));var rimraf=require(_0x29d6('0x7'));var config=require(_0x29d6('0x8'));var attributes=require(_0x29d6('0x9'));module['exports']=function(_0x2962a9,_0x468e41){return _0x2962a9[_0x29d6('0xa')](_0x29d6('0xb'),attributes,{'tableName':_0x29d6('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 f51a7a6..6e38123 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 _0x5f77=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','register','request','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x543314,_0x5c9fa8){var _0xa9f0ca=function(_0x7a9072){while(--_0x7a9072){_0x543314['push'](_0x543314['shift']());}};_0xa9f0ca(++_0x5c9fa8);}(_0x5f77,0x122));var _0x75f7=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x5f77[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x75f7('0x0'));var util=require(_0x75f7('0x1'));var moment=require(_0x75f7('0x2'));var BPromise=require(_0x75f7('0x3'));var rs=require(_0x75f7('0x4'));var fs=require('fs');var Redis=require(_0x75f7('0x5'));var db=require(_0x75f7('0x6'))['db'];var utils=require(_0x75f7('0x7'));var logger=require(_0x75f7('0x8'))(_0x75f7('0x9'));var config=require(_0x75f7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x75f7('0xb')][_0x75f7('0xc')]({'port':0x232a});config[_0x75f7('0xd')]=_[_0x75f7('0xe')](config[_0x75f7('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75f7('0xd')]));require('./dashboard.socket')[_0x75f7('0xf')](socket);function respondWithRpcPromise(_0x288baf,_0x3e6832,_0x54f285){return new BPromise(function(_0xa87470,_0x27c122){return client[_0x75f7('0x10')](_0x288baf,_0x54f285)['then'](function(_0x2bf371){logger[_0x75f7('0x11')]('Dashboard,\x20%s,\x20%s',_0x3e6832,_0x75f7('0x12'));logger[_0x75f7('0x13')](_0x75f7('0x14'),_0x3e6832,_0x75f7('0x12'),JSON['stringify'](_0x2bf371));if(_0x2bf371[_0x75f7('0x15')]){if(_0x2bf371[_0x75f7('0x15')][_0x75f7('0x16')]===0x1f4){logger[_0x75f7('0x15')](_0x75f7('0x17'),_0x3e6832,_0x2bf371[_0x75f7('0x15')][_0x75f7('0x18')]);return _0x27c122(_0x2bf371[_0x75f7('0x15')]['message']);}logger[_0x75f7('0x15')](_0x75f7('0x17'),_0x3e6832,_0x2bf371[_0x75f7('0x15')]['message']);return _0xa87470(_0x2bf371[_0x75f7('0x15')][_0x75f7('0x18')]);}else{logger[_0x75f7('0x11')](_0x75f7('0x17'),_0x3e6832,_0x75f7('0x12'));_0xa87470(_0x2bf371[_0x75f7('0x19')][_0x75f7('0x18')]);}})[_0x75f7('0x1a')](function(_0x25bac9){logger[_0x75f7('0x15')](_0x75f7('0x17'),_0x3e6832,_0x25bac9);_0x27c122(_0x25bac9);});});} \ No newline at end of file +var _0xad36=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad36,0x11c));var _0x6ad3=function(_0x35c9ae,_0x263c3e){_0x35c9ae=_0x35c9ae-0x0;var _0x408df2=_0xad36[_0x35c9ae];return _0x408df2;};'use strict';var _=require('lodash');var util=require(_0x6ad3('0x0'));var moment=require(_0x6ad3('0x1'));var BPromise=require(_0x6ad3('0x2'));var rs=require(_0x6ad3('0x3'));var fs=require('fs');var Redis=require(_0x6ad3('0x4'));var db=require(_0x6ad3('0x5'))['db'];var utils=require(_0x6ad3('0x6'));var logger=require(_0x6ad3('0x7'))(_0x6ad3('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ad3('0x9'));var client=jayson[_0x6ad3('0xa')][_0x6ad3('0xb')]({'port':0x232a});config[_0x6ad3('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ad3('0xc')]));require(_0x6ad3('0xd'))[_0x6ad3('0xe')](socket);function respondWithRpcPromise(_0x1de02d,_0x236745,_0xb64f36){return new BPromise(function(_0x22dbd1,_0x293c9d){return client[_0x6ad3('0xf')](_0x1de02d,_0xb64f36)['then'](function(_0x6bb2f5){logger[_0x6ad3('0x10')](_0x6ad3('0x11'),_0x236745,_0x6ad3('0x12'));logger[_0x6ad3('0x13')](_0x6ad3('0x14'),_0x236745,_0x6ad3('0x12'),JSON[_0x6ad3('0x15')](_0x6bb2f5));if(_0x6bb2f5['error']){if(_0x6bb2f5[_0x6ad3('0x16')]['code']===0x1f4){logger[_0x6ad3('0x16')](_0x6ad3('0x11'),_0x236745,_0x6bb2f5[_0x6ad3('0x16')][_0x6ad3('0x17')]);return _0x293c9d(_0x6bb2f5[_0x6ad3('0x16')]['message']);}logger[_0x6ad3('0x16')](_0x6ad3('0x11'),_0x236745,_0x6bb2f5[_0x6ad3('0x16')]['message']);return _0x22dbd1(_0x6bb2f5['error']['message']);}else{logger['info'](_0x6ad3('0x11'),_0x236745,'request\x20sent');_0x22dbd1(_0x6bb2f5[_0x6ad3('0x18')]['message']);}})[_0x6ad3('0x19')](function(_0x1d688f){logger[_0x6ad3('0x16')](_0x6ad3('0x11'),_0x236745,_0x1d688f);_0x293c9d(_0x1d688f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 09431d9..1919259 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 _0x00ee=['dashboard:','./dashboard.events','save','remove','update','emit','register'];(function(_0x35bcec,_0x1389e9){var _0x375ed4=function(_0x28d0a8){while(--_0x28d0a8){_0x35bcec['push'](_0x35bcec['shift']());}};_0x375ed4(++_0x1389e9);}(_0x00ee,0xd3));var _0xe00e=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0x00ee[_0x3b3a82];return _0x267063;};'use strict';var DashboardEvents=require(_0xe00e('0x0'));var events=[_0xe00e('0x1'),_0xe00e('0x2'),_0xe00e('0x3')];function createListener(_0x3b144b,_0x52bba1){return function(_0x3b1ca3){_0x52bba1[_0xe00e('0x4')](_0x3b144b,_0x3b1ca3);};}function removeListener(_0x4b77d8,_0x4d7069){return function(){DashboardEvents['removeListener'](_0x4b77d8,_0x4d7069);};}exports[_0xe00e('0x5')]=function(_0x260653){for(var _0x29f2af=0x0,_0xdefc19=events['length'];_0x29f2af<_0xdefc19;_0x29f2af++){var _0x26a2c=events[_0x29f2af];var _0x1942e2=createListener(_0xe00e('0x6')+_0x26a2c,_0x260653);DashboardEvents['on'](_0x26a2c,_0x1942e2);}}; \ No newline at end of file +var _0xd730=['./dashboard.events','remove','update','register','dashboard:'];(function(_0x51a952,_0x10d16f){var _0x261f9a=function(_0x18659d){while(--_0x18659d){_0x51a952['push'](_0x51a952['shift']());}};_0x261f9a(++_0x10d16f);}(_0xd730,0x1bd));var _0x0d73=function(_0x9f8acb,_0x52bb25){_0x9f8acb=_0x9f8acb-0x0;var _0x373110=_0xd730[_0x9f8acb];return _0x373110;};'use strict';var DashboardEvents=require(_0x0d73('0x0'));var events=['save',_0x0d73('0x1'),_0x0d73('0x2')];function createListener(_0x2bf33f,_0x163cf8){return function(_0x53f646){_0x163cf8['emit'](_0x2bf33f,_0x53f646);};}function removeListener(_0x1f0a93,_0x43689f){return function(){DashboardEvents['removeListener'](_0x1f0a93,_0x43689f);};}exports[_0x0d73('0x3')]=function(_0x1975f2){for(var _0x25d87b=0x0,_0x531ffe=events['length'];_0x25d87b<_0x531ffe;_0x25d87b++){var _0x1112b2=events[_0x25d87b];var _0x289fed=createListener(_0x0d73('0x4')+_0x1112b2,_0x1975f2);DashboardEvents['on'](_0x1112b2,_0x289fed);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index fbf7f70..5b913e2 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 _0x4ed9=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','getItems','create','post','clone','addItem','update'];(function(_0x2a9c08,_0x48d8a4){var _0x17ec20=function(_0x2f5a97){while(--_0x2f5a97){_0x2a9c08['push'](_0x2a9c08['shift']());}};_0x17ec20(++_0x48d8a4);}(_0x4ed9,0xe8));var _0x94ed=function(_0xdee667,_0x96f7cb){_0xdee667=_0xdee667-0x0;var _0x4d205c=_0x4ed9[_0xdee667];return _0x4d205c;};'use strict';var multer=require(_0x94ed('0x0'));var util=require('util');var path=require(_0x94ed('0x1'));var timeout=require(_0x94ed('0x2'));var express=require(_0x94ed('0x3'));var router=express[_0x94ed('0x4')]();var fs_extra=require(_0x94ed('0x5'));var auth=require(_0x94ed('0x6'));var interaction=require(_0x94ed('0x7'));var config=require(_0x94ed('0x8'));var controller=require(_0x94ed('0x9'));router[_0x94ed('0xa')]('/',auth[_0x94ed('0xb')](),controller['index']);router[_0x94ed('0xa')](_0x94ed('0xc'),auth[_0x94ed('0xb')](),controller[_0x94ed('0xd')]);router['get'](_0x94ed('0xe'),auth['isAuthenticated'](),controller[_0x94ed('0xf')]);router['post']('/',auth[_0x94ed('0xb')](),controller[_0x94ed('0x10')]);router[_0x94ed('0x11')]('/:id/clone',auth[_0x94ed('0xb')](),controller[_0x94ed('0x12')]);router[_0x94ed('0x11')](_0x94ed('0xe'),auth[_0x94ed('0xb')](),controller[_0x94ed('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x94ed('0x14')]);router[_0x94ed('0x15')](_0x94ed('0xc'),auth[_0x94ed('0xb')](),controller[_0x94ed('0x16')]);module['exports']=router; \ No newline at end of file +var _0xb25f=['isAuthenticated','index','/:id','show','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get'];(function(_0x56a57a,_0x4d34e5){var _0x341a5c=function(_0x14327a){while(--_0x14327a){_0x56a57a['push'](_0x56a57a['shift']());}};_0x341a5c(++_0x4d34e5);}(_0xb25f,0x117));var _0xfb25=function(_0x243713,_0x498eba){_0x243713=_0x243713-0x0;var _0x5adf3e=_0xb25f[_0x243713];return _0x5adf3e;};'use strict';var multer=require(_0xfb25('0x0'));var util=require('util');var path=require(_0xfb25('0x1'));var timeout=require('connect-timeout');var express=require(_0xfb25('0x2'));var router=express[_0xfb25('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfb25('0x4'));var interaction=require(_0xfb25('0x5'));var config=require(_0xfb25('0x6'));var controller=require(_0xfb25('0x7'));router[_0xfb25('0x8')]('/',auth[_0xfb25('0x9')](),controller[_0xfb25('0xa')]);router[_0xfb25('0x8')](_0xfb25('0xb'),auth['isAuthenticated'](),controller[_0xfb25('0xc')]);router['get']('/:id/items',auth[_0xfb25('0x9')](),controller[_0xfb25('0xd')]);router[_0xfb25('0xe')]('/',auth[_0xfb25('0x9')](),controller[_0xfb25('0xf')]);router[_0xfb25('0xe')](_0xfb25('0x10'),auth[_0xfb25('0x9')](),controller[_0xfb25('0x11')]);router[_0xfb25('0xe')]('/:id/items',auth[_0xfb25('0x9')](),controller[_0xfb25('0x12')]);router[_0xfb25('0x13')](_0xfb25('0xb'),auth[_0xfb25('0x9')](),controller[_0xfb25('0x14')]);router[_0xfb25('0x15')]('/:id',auth[_0xfb25('0x9')](),controller[_0xfb25('0x16')]);module[_0xfb25('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index c4a29ca..fd44882 100644 --- a/server/api/dashboardItem/dashboardItem.attributes.js +++ b/server/api/dashboardItem/dashboardItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8fb=['exports','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','STRING','sequelize','squel','lodash'];(function(_0x351ce5,_0x150077){var _0x260035=function(_0x2eb431){while(--_0x2eb431){_0x351ce5['push'](_0x351ce5['shift']());}};_0x260035(++_0x150077);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5cf9b4,_0x5d48bf){_0x5cf9b4=_0x5cf9b4-0x0;var _0x18e00f=_0xd8fb[_0x5cf9b4];return _0x18e00f;};'use strict';var Sequelize=require(_0xbd8f('0x0'));var squel=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));module[_0xbd8f('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xbd8f('0x4')),'get':function(){try{return JSON[_0xbd8f('0x5')](this['getDataValue'](_0xbd8f('0x6')));}catch(_0x2343bf){return[];}},'set':function(_0x5543b2){try{this[_0xbd8f('0x7')]('attrs',JSON[_0xbd8f('0x8')](_0x5543b2));}catch(_0x578499){this[_0xbd8f('0x7')](_0xbd8f('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xbd8f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xbd8f('0x9')]},'col':{'type':Sequelize[_0xbd8f('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbd8f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xbd8f('0xb')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xbd8f('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xb4c7=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x540f2a,_0x496b69){_0x540f2a=_0x540f2a-0x0;var _0x3d9c44=_0xb4c7[_0x540f2a];return _0x3d9c44;};'use strict';var Sequelize=require(_0x7b4c('0x0'));var squel=require(_0x7b4c('0x1'));var _=require(_0x7b4c('0x2'));module[_0x7b4c('0x3')]={'title':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7b4c('0x5')](_0x7b4c('0x6')),'get':function(){try{return JSON[_0x7b4c('0x7')](this[_0x7b4c('0x8')](_0x7b4c('0x9')));}catch(_0x5adec9){return[];}},'set':function(_0x1b0f57){try{this[_0x7b4c('0xa')](_0x7b4c('0x9'),JSON['stringify'](_0x1b0f57));}catch(_0x2d7b7e){this[_0x7b4c('0xa')]('attrs',JSON[_0x7b4c('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x7b4c('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7b4c('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7b4c('0xc')]},'col':{'type':Sequelize[_0x7b4c('0xc')]},'background':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![],'defaultValue':_0x7b4c('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![],'defaultValue':_0x7b4c('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7b4c('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 5445c9b..7d73a44 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 _0x2ef3=['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','redis','localhost','./dashboardItem.socket','sendStatus','status','undefined','limit','count','offset','set','json','reject','save','update','destroy','then','end','error','name','send','params','model','keys','rawAttributes','query','intersection','attributes','length','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body'];(function(_0x46f964,_0x225c78){var _0x104cfe=function(_0x3f291c){while(--_0x3f291c){_0x46f964['push'](_0x46f964['shift']());}};_0x104cfe(++_0x225c78);}(_0x2ef3,0xba));var _0x32ef=function(_0x75c55b,_0x97be77){_0x75c55b=_0x75c55b-0x0;var _0x32c651=_0x2ef3[_0x75c55b];return _0x32c651;};'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'];config[_0x32ef('0x18')]=_['defaults'](config[_0x32ef('0x18')],{'host':_0x32ef('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x32ef('0x1a'))['register'](socket);function respondWithStatusCode(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xcc;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x1b')](_0x40a6e6);}return _0x326fce['status'](_0x40a6e6)['end']();};}function respondWithResult(_0x531e30,_0x13db1a){_0x13db1a=_0x13db1a||0xc8;return function(_0x3950e6){if(_0x3950e6){return _0x531e30[_0x32ef('0x1c')](_0x13db1a)['json'](_0x3950e6);}};}function respondWithFilteredResult(_0x5d559b,_0x1eb468){return function(_0x1a9476){if(_0x1a9476){var _0x286bfb=typeof _0x1eb468['offset']===_0x32ef('0x1d')&&typeof _0x1eb468[_0x32ef('0x1e')]==='undefined';var _0x304505=_0x1a9476[_0x32ef('0x1f')];var _0x26aff3=_0x286bfb?0x0:_0x1eb468[_0x32ef('0x20')];var _0x445cda=_0x286bfb?_0x1a9476[_0x32ef('0x1f')]:_0x1eb468['offset']+_0x1eb468[_0x32ef('0x1e')];var _0x5cc3ef;if(_0x445cda>=_0x304505){_0x445cda=_0x304505;_0x5cc3ef=0xc8;}else{_0x5cc3ef=0xce;}_0x5d559b[_0x32ef('0x1c')](_0x5cc3ef);return _0x5d559b[_0x32ef('0x21')]('Content-Range',_0x26aff3+'-'+_0x445cda+'/'+_0x304505)[_0x32ef('0x22')](_0x1a9476);}return null;};}function patchUpdates(_0x97780){return function(_0x5e8898){try{jsonpatch['apply'](_0x5e8898,_0x97780,!![]);}catch(_0x57f5e5){return BPromise[_0x32ef('0x23')](_0x57f5e5);}return _0x5e8898[_0x32ef('0x24')]();};}function saveUpdates(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x25')](_0x225feb)['then'](function(_0x51a412){return _0x51a412;});}return null;};}function removeEntity(_0x278495,_0x14d4b3){return function(_0x371540){if(_0x371540){return _0x371540[_0x32ef('0x26')]()[_0x32ef('0x27')](function(){_0x278495[_0x32ef('0x1c')](0xcc)[_0x32ef('0x28')]();});}};}function handleEntityNotFound(_0x38aed5,_0x338f19){return function(_0x2f52d7){if(!_0x2f52d7){_0x38aed5[_0x32ef('0x1b')](0x194);}return _0x2f52d7;};}function handleError(_0xba4b3f,_0x5a88a5){_0x5a88a5=_0x5a88a5||0x1f4;return function(_0xd65fde){logger[_0x32ef('0x29')](_0xd65fde['stack']);if(_0xd65fde[_0x32ef('0x2a')]){delete _0xd65fde[_0x32ef('0x2a')];}_0xba4b3f[_0x32ef('0x1c')](_0x5a88a5)[_0x32ef('0x2b')](_0xd65fde);};}exports['show']=function(_0x10e38c,_0x22bf86){var _0x31dbc3={'raw':![],'where':{'id':_0x10e38c[_0x32ef('0x2c')]['id']}},_0x2ac686={};_0x2ac686[_0x32ef('0x2d')]=_[_0x32ef('0x2e')](db['DashboardItem'][_0x32ef('0x2f')]);_0x2ac686['query']=_[_0x32ef('0x2e')](_0x10e38c[_0x32ef('0x30')]);_0x2ac686['filters']=_[_0x32ef('0x31')](_0x2ac686[_0x32ef('0x2d')],_0x2ac686[_0x32ef('0x30')]);_0x31dbc3[_0x32ef('0x32')]=_[_0x32ef('0x31')](_0x2ac686['model'],qs['fields'](_0x10e38c[_0x32ef('0x30')]['fields']));_0x31dbc3[_0x32ef('0x32')]=_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x33')]?_0x31dbc3[_0x32ef('0x32')]:_0x2ac686[_0x32ef('0x2d')];if(_0x10e38c[_0x32ef('0x30')]['includeAll']){_0x31dbc3['include']=[{'all':!![]}];}_0x31dbc3=_['merge']({},_0x31dbc3,_0x10e38c[_0x32ef('0x34')]);return db[_0x32ef('0x35')][_0x32ef('0x36')](_0x31dbc3)['then'](handleEntityNotFound(_0x22bf86,null))['then'](respondWithResult(_0x22bf86,null))[_0x32ef('0x37')](handleError(_0x22bf86,null));};exports[_0x32ef('0x26')]=function(_0x410334,_0x480348){return db['DashboardItem'][_0x32ef('0x36')]({'where':{'id':_0x410334[_0x32ef('0x2c')]['id']}})[_0x32ef('0x27')](handleEntityNotFound(_0x480348,null))[_0x32ef('0x27')](removeEntity(_0x480348,null))[_0x32ef('0x37')](handleError(_0x480348,null));};function widgetAttributes(_0x211c79){try{switch(_0x211c79[_0x32ef('0x38')]){case _0x32ef('0x39'):return[{'name':_0x32ef('0x3a'),'value':_0x211c79['attrUrl']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0]['value']:undefined)||_0x32ef('0x3c')}];case _0x32ef('0x3d'):return[{'name':_0x32ef('0x3e'),'value':_0x211c79[_0x32ef('0x3e')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||''}];case _0x32ef('0x40'):return[{'name':_0x32ef('0x41'),'value':_0x211c79[_0x32ef('0x41')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||_0x32ef('0x42')},{'name':_0x32ef('0x43'),'value':_0x211c79[_0x32ef('0x43')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79['attrs'][0x1]['value']:undefined)||_0x32ef('0x44')},{'name':_0x32ef('0x45'),'value':_0x211c79[_0x32ef('0x45')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x2]?_0x211c79[_0x32ef('0x3b')][0x2][_0x32ef('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0x32ef('0x46'),'value':_0x211c79['attrMetric']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||_0x32ef('0x47')},{'name':_0x32ef('0x48'),'value':_0x211c79[_0x32ef('0x48')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79[_0x32ef('0x3b')][0x1]['value']:undefined)||[]},{'name':_0x32ef('0x45'),'value':_0x211c79['attrFontSize']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x2]?_0x211c79[_0x32ef('0x3b')][0x2]['value']:undefined)||0x14},{'name':_0x32ef('0x49'),'value':_0x211c79[_0x32ef('0x49')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x3]?_0x211c79[_0x32ef('0x3b')][0x3][_0x32ef('0x3f')]:undefined)||_0x32ef('0x4a')},{'name':'attrEmailAccounts','value':_0x211c79['attrEmailAccounts']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x4]?_0x211c79[_0x32ef('0x3b')][0x4][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4b'),'value':_0x211c79[_0x32ef('0x4b')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x5]?_0x211c79[_0x32ef('0x3b')][0x5][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4c'),'value':_0x211c79[_0x32ef('0x4c')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x6]?_0x211c79[_0x32ef('0x3b')][0x6][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4d'),'value':_0x211c79[_0x32ef('0x4d')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x7]?_0x211c79[_0x32ef('0x3b')][0x7][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4e'),'value':_0x211c79[_0x32ef('0x4e')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x8]?_0x211c79[_0x32ef('0x3b')][0x8][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4f'),'value':_0x211c79[_0x32ef('0x4f')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x9]?_0x211c79['attrs'][0x9]['value']:undefined)||''}];case _0x32ef('0x50'):case _0x32ef('0x51'):return[{'name':_0x32ef('0x52'),'value':_0x211c79[_0x32ef('0x52')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x3f')]:undefined)||_0x32ef('0x47')},{'name':_0x32ef('0x53'),'value':_0x211c79[_0x32ef('0x53')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79[_0x32ef('0x3b')][0x1][_0x32ef('0x3f')]:undefined)||null},{'name':_0x32ef('0x54'),'value':_0x211c79[_0x32ef('0x54')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x2]?_0x211c79[_0x32ef('0x3b')][0x2][_0x32ef('0x3f')]:undefined)||null},{'name':_0x32ef('0x48'),'value':_0x211c79['attrVoiceQueues']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x3]?_0x211c79[_0x32ef('0x3b')][0x3][_0x32ef('0x3f')]:undefined)||[]},{'name':'attrChannel','value':_0x211c79[_0x32ef('0x49')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x4]?_0x211c79[_0x32ef('0x3b')][0x4][_0x32ef('0x3f')]:undefined)||_0x32ef('0x4a')},{'name':_0x32ef('0x55'),'value':_0x211c79[_0x32ef('0x55')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x5]?_0x211c79['attrs'][0x5][_0x32ef('0x3f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x211c79['attrFaxAccounts']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x6]?_0x211c79[_0x32ef('0x3b')][0x6][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4c'),'value':_0x211c79[_0x32ef('0x4c')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x7]?_0x211c79[_0x32ef('0x3b')][0x7][_0x32ef('0x3f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x211c79['attrOpenchannelAccounts']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x8]?_0x211c79['attrs'][0x8][_0x32ef('0x3f')]:undefined)||''},{'name':_0x32ef('0x4e'),'value':_0x211c79[_0x32ef('0x4e')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x9]?_0x211c79[_0x32ef('0x3b')][0x9][_0x32ef('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x211c79['attrChatWebsites']||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0xa]?_0x211c79[_0x32ef('0x3b')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x32ef('0x56'),'type':_0x211c79[_0x32ef('0x57')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79['attrs'][0x0]?_0x211c79[_0x32ef('0x3b')][0x0][_0x32ef('0x38')]:undefined)||null,'value':_0x211c79[_0x32ef('0x56')]||(_0x211c79['attrs']&&_0x211c79[_0x32ef('0x3b')][0x0]?_0x211c79[_0x32ef('0x3b')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x211c79[_0x32ef('0x58')]||(_0x211c79[_0x32ef('0x3b')]&&_0x211c79[_0x32ef('0x3b')][0x1]?_0x211c79[_0x32ef('0x3b')][0x1][_0x32ef('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x40700e){logger['error'](_0x32ef('0x59'),JSON[_0x32ef('0x5a')](_0x40700e));return[];}}exports[_0x32ef('0x5b')]=function(_0x36ed97,_0x21e930){if(_0x36ed97[_0x32ef('0x5c')]){_0x36ed97[_0x32ef('0x5c')][_0x32ef('0x3b')]=widgetAttributes(_0x36ed97[_0x32ef('0x5c')]);}return db['DashboardItem'][_0x32ef('0x5b')](_0x36ed97[_0x32ef('0x5c')],{})[_0x32ef('0x27')](respondWithResult(_0x21e930,0xc9))[_0x32ef('0x37')](handleError(_0x21e930,null));};exports[_0x32ef('0x25')]=function(_0x5ad75c,_0x47c0ed){if(_0x5ad75c[_0x32ef('0x5c')]['id']){delete _0x5ad75c[_0x32ef('0x5c')]['id'];}_0x5ad75c[_0x32ef('0x5c')][_0x32ef('0x3b')]=widgetAttributes(_0x5ad75c[_0x32ef('0x5c')]);return db['DashboardItem'][_0x32ef('0x36')]({'where':{'id':_0x5ad75c['params']['id']}})[_0x32ef('0x27')](handleEntityNotFound(_0x47c0ed,null))[_0x32ef('0x27')](saveUpdates(_0x5ad75c['body'],null))['then'](respondWithResult(_0x47c0ed,null))[_0x32ef('0x37')](handleError(_0x47c0ed,null));}; \ No newline at end of file +var _0x363e=['offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','length','merge','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status'];(function(_0x487600,_0x593697){var _0x1ecfc4=function(_0x4f72eb){while(--_0x4f72eb){_0x487600['push'](_0x487600['shift']());}};_0x1ecfc4(++_0x593697);}(_0x363e,0x179));var _0xe363=function(_0x107240,_0x328580){_0x107240=_0x107240-0x0;var _0x3965d5=_0x363e[_0x107240];return _0x3965d5;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe363('0x1b')](config[_0xe363('0x1c')],{'host':_0xe363('0x1d'),'port':0x18eb});var socket=require(_0xe363('0x1e'))(new Redis(config[_0xe363('0x1c')]));require('./dashboardItem.socket')[_0xe363('0x1f')](socket);function respondWithStatusCode(_0x22b227,_0x4a3258){_0x4a3258=_0x4a3258||0xcc;return function(_0xdfce32){if(_0xdfce32){return _0x22b227[_0xe363('0x20')](_0x4a3258);}return _0x22b227['status'](_0x4a3258)[_0xe363('0x21')]();};}function respondWithResult(_0x73ef9a,_0x51e1a8){_0x51e1a8=_0x51e1a8||0xc8;return function(_0xd9d1b1){if(_0xd9d1b1){return _0x73ef9a[_0xe363('0x22')](_0x51e1a8)['json'](_0xd9d1b1);}};}function respondWithFilteredResult(_0xecbe2c,_0x17606f){return function(_0x2f2c20){if(_0x2f2c20){var _0x4dcba0=typeof _0x17606f[_0xe363('0x23')]===_0xe363('0x24')&&typeof _0x17606f['limit']===_0xe363('0x24');var _0x110e59=_0x2f2c20[_0xe363('0x25')];var _0x7d407d=_0x4dcba0?0x0:_0x17606f[_0xe363('0x23')];var _0x3f2c97=_0x4dcba0?_0x2f2c20['count']:_0x17606f[_0xe363('0x23')]+_0x17606f[_0xe363('0x26')];var _0x14ff95;if(_0x3f2c97>=_0x110e59){_0x3f2c97=_0x110e59;_0x14ff95=0xc8;}else{_0x14ff95=0xce;}_0xecbe2c[_0xe363('0x22')](_0x14ff95);return _0xecbe2c[_0xe363('0x27')](_0xe363('0x28'),_0x7d407d+'-'+_0x3f2c97+'/'+_0x110e59)[_0xe363('0x29')](_0x2f2c20);}return null;};}function patchUpdates(_0xaff56f){return function(_0x41d04b){try{jsonpatch[_0xe363('0x2a')](_0x41d04b,_0xaff56f,!![]);}catch(_0x1de673){return BPromise[_0xe363('0x2b')](_0x1de673);}return _0x41d04b[_0xe363('0x2c')]();};}function saveUpdates(_0x388223,_0x1ffed7){return function(_0x3f5dc2){if(_0x3f5dc2){return _0x3f5dc2[_0xe363('0x2d')](_0x388223)[_0xe363('0x2e')](function(_0x19c7b4){return _0x19c7b4;});}return null;};}function removeEntity(_0x3e24ad,_0x312d75){return function(_0x1e7eb7){if(_0x1e7eb7){return _0x1e7eb7['destroy']()[_0xe363('0x2e')](function(){_0x3e24ad[_0xe363('0x22')](0xcc)[_0xe363('0x21')]();});}};}function handleEntityNotFound(_0x276b93,_0x335c60){return function(_0x52cafe){if(!_0x52cafe){_0x276b93[_0xe363('0x20')](0x194);}return _0x52cafe;};}function handleError(_0x291841,_0x4dc950){_0x4dc950=_0x4dc950||0x1f4;return function(_0x3cc130){logger['error'](_0x3cc130[_0xe363('0x2f')]);if(_0x3cc130[_0xe363('0x30')]){delete _0x3cc130['name'];}_0x291841[_0xe363('0x22')](_0x4dc950)[_0xe363('0x31')](_0x3cc130);};}exports[_0xe363('0x32')]=function(_0x54c76c,_0x40671e){var _0x32c9ab={'raw':![],'where':{'id':_0x54c76c[_0xe363('0x33')]['id']}},_0x102030={};_0x102030['model']=_[_0xe363('0x34')](db[_0xe363('0x35')][_0xe363('0x36')]);_0x102030[_0xe363('0x37')]=_[_0xe363('0x34')](_0x54c76c[_0xe363('0x37')]);_0x102030[_0xe363('0x38')]=_[_0xe363('0x39')](_0x102030[_0xe363('0x3a')],_0x102030[_0xe363('0x37')]);_0x32c9ab['attributes']=_['intersection'](_0x102030[_0xe363('0x3a')],qs[_0xe363('0x3b')](_0x54c76c['query'][_0xe363('0x3b')]));_0x32c9ab[_0xe363('0x3c')]=_0x32c9ab['attributes'][_0xe363('0x3d')]?_0x32c9ab[_0xe363('0x3c')]:_0x102030[_0xe363('0x3a')];if(_0x54c76c[_0xe363('0x37')]['includeAll']){_0x32c9ab['include']=[{'all':!![]}];}_0x32c9ab=_[_0xe363('0x3e')]({},_0x32c9ab,_0x54c76c['options']);return db['DashboardItem'][_0xe363('0x3f')](_0x32c9ab)[_0xe363('0x2e')](handleEntityNotFound(_0x40671e,null))[_0xe363('0x2e')](respondWithResult(_0x40671e,null))[_0xe363('0x40')](handleError(_0x40671e,null));};exports[_0xe363('0x41')]=function(_0x1ad258,_0x249aa3){return db[_0xe363('0x35')][_0xe363('0x3f')]({'where':{'id':_0x1ad258[_0xe363('0x33')]['id']}})[_0xe363('0x2e')](handleEntityNotFound(_0x249aa3,null))[_0xe363('0x2e')](removeEntity(_0x249aa3,null))['catch'](handleError(_0x249aa3,null));};function widgetAttributes(_0x574af3){try{switch(_0x574af3[_0xe363('0x42')]){case _0xe363('0x43'):return[{'name':_0xe363('0x44'),'value':_0x574af3['attrUrl']||(_0x574af3['attrs']&&_0x574af3[_0xe363('0x45')][0x0]?_0x574af3[_0xe363('0x45')][0x0][_0xe363('0x46')]:undefined)||_0xe363('0x47')}];case'custom':return[{'name':_0xe363('0x48'),'value':_0x574af3['attrPath']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x0]?_0x574af3[_0xe363('0x45')][0x0][_0xe363('0x46')]:undefined)||''}];case _0xe363('0x49'):return[{'name':_0xe363('0x4a'),'value':_0x574af3[_0xe363('0x4a')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x0]?_0x574af3['attrs'][0x0]['value']:undefined)||_0xe363('0x4b')},{'name':_0xe363('0x4c'),'value':_0x574af3[_0xe363('0x4c')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x1]?_0x574af3[_0xe363('0x45')][0x1][_0xe363('0x46')]:undefined)||_0xe363('0x4d')},{'name':_0xe363('0x4e'),'value':_0x574af3['attrFontSize']||(_0x574af3[_0xe363('0x45')]&&_0x574af3['attrs'][0x2]?_0x574af3[_0xe363('0x45')][0x2]['value']:undefined)||0xc}];case _0xe363('0x4f'):return[{'name':_0xe363('0x50'),'value':_0x574af3['attrMetric']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x0]?_0x574af3[_0xe363('0x45')][0x0][_0xe363('0x46')]:undefined)||_0xe363('0x51')},{'name':_0xe363('0x52'),'value':_0x574af3['attrVoiceQueues']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x1]?_0x574af3[_0xe363('0x45')][0x1][_0xe363('0x46')]:undefined)||[]},{'name':_0xe363('0x4e'),'value':_0x574af3['attrFontSize']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x2]?_0x574af3[_0xe363('0x45')][0x2][_0xe363('0x46')]:undefined)||0x14},{'name':_0xe363('0x53'),'value':_0x574af3[_0xe363('0x53')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3['attrs'][0x3]?_0x574af3['attrs'][0x3][_0xe363('0x46')]:undefined)||_0xe363('0x54')},{'name':_0xe363('0x55'),'value':_0x574af3['attrEmailAccounts']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x4]?_0x574af3['attrs'][0x4]['value']:undefined)||''},{'name':_0xe363('0x56'),'value':_0x574af3[_0xe363('0x56')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x5]?_0x574af3['attrs'][0x5][_0xe363('0x46')]:undefined)||''},{'name':_0xe363('0x57'),'value':_0x574af3['attrSmsAccounts']||(_0x574af3['attrs']&&_0x574af3[_0xe363('0x45')][0x6]?_0x574af3[_0xe363('0x45')][0x6]['value']:undefined)||''},{'name':_0xe363('0x58'),'value':_0x574af3['attrOpenchannelAccounts']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x7]?_0x574af3['attrs'][0x7][_0xe363('0x46')]:undefined)||''},{'name':_0xe363('0x59'),'value':_0x574af3['attrWhatsappAccounts']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x8]?_0x574af3['attrs'][0x8][_0xe363('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0x574af3[_0xe363('0x5a')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x9]?_0x574af3[_0xe363('0x45')][0x9]['value']:undefined)||''}];case _0xe363('0x5b'):case _0xe363('0x5c'):return[{'name':_0xe363('0x5d'),'value':_0x574af3['attrSerie1']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x0]?_0x574af3[_0xe363('0x45')][0x0]['value']:undefined)||_0xe363('0x51')},{'name':_0xe363('0x5e'),'value':_0x574af3['attrSerie2']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x1]?_0x574af3[_0xe363('0x45')][0x1][_0xe363('0x46')]:undefined)||null},{'name':_0xe363('0x5f'),'value':_0x574af3[_0xe363('0x5f')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x2]?_0x574af3[_0xe363('0x45')][0x2][_0xe363('0x46')]:undefined)||null},{'name':_0xe363('0x52'),'value':_0x574af3[_0xe363('0x52')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3['attrs'][0x3]?_0x574af3['attrs'][0x3][_0xe363('0x46')]:undefined)||[]},{'name':_0xe363('0x53'),'value':_0x574af3[_0xe363('0x53')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x4]?_0x574af3[_0xe363('0x45')][0x4][_0xe363('0x46')]:undefined)||_0xe363('0x54')},{'name':_0xe363('0x55'),'value':_0x574af3[_0xe363('0x55')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x5]?_0x574af3[_0xe363('0x45')][0x5]['value']:undefined)||''},{'name':_0xe363('0x56'),'value':_0x574af3[_0xe363('0x56')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3['attrs'][0x6]?_0x574af3[_0xe363('0x45')][0x6][_0xe363('0x46')]:undefined)||''},{'name':_0xe363('0x57'),'value':_0x574af3[_0xe363('0x57')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3['attrs'][0x7]?_0x574af3['attrs'][0x7][_0xe363('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x574af3[_0xe363('0x58')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x8]?_0x574af3[_0xe363('0x45')][0x8][_0xe363('0x46')]:undefined)||''},{'name':_0xe363('0x59'),'value':_0x574af3[_0xe363('0x59')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x9]?_0x574af3[_0xe363('0x45')][0x9][_0xe363('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0x574af3[_0xe363('0x5a')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0xa]?_0x574af3['attrs'][0xa][_0xe363('0x46')]:undefined)||''}];case _0xe363('0x60'):return[{'name':_0xe363('0x61'),'type':_0x574af3[_0xe363('0x62')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x0]?_0x574af3[_0xe363('0x45')][0x0][_0xe363('0x42')]:undefined)||null,'value':_0x574af3[_0xe363('0x61')]||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x0]?_0x574af3['attrs'][0x0]['value']:undefined)||null},{'name':_0xe363('0x63'),'value':_0x574af3['attrRefresh']||(_0x574af3[_0xe363('0x45')]&&_0x574af3[_0xe363('0x45')][0x1]?_0x574af3[_0xe363('0x45')][0x1][_0xe363('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x5d312a){logger['error']('widgetAttributes:\x20%s',JSON[_0xe363('0x64')](_0x5d312a));return[];}}exports[_0xe363('0x65')]=function(_0x2008f7,_0x123106){if(_0x2008f7['body']){_0x2008f7['body'][_0xe363('0x45')]=widgetAttributes(_0x2008f7['body']);}return db[_0xe363('0x35')][_0xe363('0x65')](_0x2008f7[_0xe363('0x66')],{})[_0xe363('0x2e')](respondWithResult(_0x123106,0xc9))[_0xe363('0x40')](handleError(_0x123106,null));};exports[_0xe363('0x2d')]=function(_0x3bdf90,_0x79d40b){if(_0x3bdf90['body']['id']){delete _0x3bdf90[_0xe363('0x66')]['id'];}_0x3bdf90[_0xe363('0x66')]['attrs']=widgetAttributes(_0x3bdf90[_0xe363('0x66')]);return db['DashboardItem']['find']({'where':{'id':_0x3bdf90[_0xe363('0x33')]['id']}})['then'](handleEntityNotFound(_0x79d40b,null))[_0xe363('0x2e')](saveUpdates(_0x3bdf90[_0xe363('0x66')],null))['then'](respondWithResult(_0x79d40b,null))[_0xe363('0x40')](handleError(_0x79d40b,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a7ef80b..a9ef57c 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 _0xd472=['exports','events','../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x557495,_0x5655db){var _0x22ff4d=function(_0x39f45c){while(--_0x39f45c){_0x557495['push'](_0x557495['shift']());}};_0x22ff4d(++_0x5655db);}(_0xd472,0x1eb));var _0x2d47=function(_0xf739cf,_0x4981f1){_0xf739cf=_0xf739cf-0x0;var _0x13c1c7=_0xd472[_0xf739cf];return _0x13c1c7;};'use strict';var EventEmitter=require(_0x2d47('0x0'));var DashboardItem=require(_0x2d47('0x1'))['db'][_0x2d47('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d47('0x3'),'afterUpdate':_0x2d47('0x4'),'afterDestroy':_0x2d47('0x5')};function emitEvent(_0x306653){return function(_0xdc4c59,_0xd50ba1,_0x52c371){DashboardItemEvents['emit'](_0x306653+':'+_0xdc4c59['id'],_0xdc4c59);DashboardItemEvents[_0x2d47('0x6')](_0x306653,_0xdc4c59);_0x52c371(null);};}for(var e in events){if(events[_0x2d47('0x7')](e)){var event=events[e];DashboardItem[_0x2d47('0x8')](e,emitEvent(event));}}module[_0x2d47('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x070f=['DashboardItem','save','update','remove','emit','exports','events'];(function(_0x2b3a98,_0x3796c6){var _0xdf53c0=function(_0x2aac80){while(--_0x2aac80){_0x2b3a98['push'](_0x2b3a98['shift']());}};_0xdf53c0(++_0x3796c6);}(_0x070f,0x13a));var _0xf070=function(_0x237206,_0xc21d91){_0x237206=_0x237206-0x0;var _0x209f1a=_0x070f[_0x237206];return _0x209f1a;};'use strict';var EventEmitter=require(_0xf070('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xf070('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf070('0x2'),'afterUpdate':_0xf070('0x3'),'afterDestroy':_0xf070('0x4')};function emitEvent(_0x100840){return function(_0x2f656e,_0x124467,_0x585478){DashboardItemEvents[_0xf070('0x5')](_0x100840+':'+_0x2f656e['id'],_0x2f656e);DashboardItemEvents['emit'](_0x100840,_0x2f656e);_0x585478(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xf070('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 2bdda36..cbe909a 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 _0xf9bb=['./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x3b69e7,_0x5f1f51){var _0x2f921a=function(_0xea18ae){while(--_0xea18ae){_0x3b69e7['push'](_0x3b69e7['shift']());}};_0x2f921a(++_0x5f1f51);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x275f08,_0x44cddf){_0x275f08=_0x275f08-0x0;var _0x275290=_0xf9bb[_0x275f08];return _0x275290;};'use strict';var _=require(_0xbf9b('0x0'));var util=require(_0xbf9b('0x1'));var logger=require(_0xbf9b('0x2'))('api');var moment=require(_0xbf9b('0x3'));var BPromise=require(_0xbf9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf9b('0x5'));var config=require(_0xbf9b('0x6'));var attributes=require(_0xbf9b('0x7'));module[_0xbf9b('0x8')]=function(_0x46d1f,_0x7fa5a){return _0x46d1f['define']('DashboardItem',attributes,{'tableName':_0xbf9b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe608=['dashboard_items','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','DashboardItem'];(function(_0xf8053,_0x4b5401){var _0x2fe82f=function(_0x3fb111){while(--_0x3fb111){_0xf8053['push'](_0xf8053['shift']());}};_0x2fe82f(++_0x4b5401);}(_0xe608,0xb5));var _0x8e60=function(_0x50856f,_0x262f2c){_0x50856f=_0x50856f-0x0;var _0x505ca2=_0xe608[_0x50856f];return _0x505ca2;};'use strict';var _=require(_0x8e60('0x0'));var util=require('util');var logger=require(_0x8e60('0x1'))(_0x8e60('0x2'));var moment=require(_0x8e60('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e60('0x4'));var fs=require('fs');var path=require(_0x8e60('0x5'));var rimraf=require(_0x8e60('0x6'));var config=require(_0x8e60('0x7'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x55b99d,_0x2f027d){return _0x55b99d['define'](_0x8e60('0x8'),attributes,{'tableName':_0x8e60('0x9'),'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 fba5673..0a6affe 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 _0x7c65=['socket.io-emitter','register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost'];(function(_0x2f852d,_0x2ff90d){var _0xc540f9=function(_0x11cadf){while(--_0x11cadf){_0x2f852d['push'](_0x2f852d['shift']());}};_0xc540f9(++_0x2ff90d);}(_0x7c65,0xc5));var _0x57c6=function(_0x51896b,_0x3577ff){_0x51896b=_0x51896b-0x0;var _0x15d9ed=_0x7c65[_0x51896b];return _0x15d9ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x57c6('0x0'));var fs=require('fs');var Redis=require(_0x57c6('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x57c6('0x2'));var logger=require(_0x57c6('0x3'))(_0x57c6('0x4'));var config=require('../../config/environment');var jayson=require(_0x57c6('0x5'));var client=jayson[_0x57c6('0x6')]['http']({'port':0x232a});config[_0x57c6('0x7')]=_[_0x57c6('0x8')](config['redis'],{'host':_0x57c6('0x9'),'port':0x18eb});var socket=require(_0x57c6('0xa'))(new Redis(config[_0x57c6('0x7')]));require('./dashboardItem.socket')[_0x57c6('0xb')](socket);function respondWithRpcPromise(_0x82feec,_0x33165a,_0x270c41){return new BPromise(function(_0x3c9717,_0x25af4b){return client[_0x57c6('0xc')](_0x82feec,_0x270c41)['then'](function(_0x519211){logger['info'](_0x57c6('0xd'),_0x33165a,_0x57c6('0xe'));logger[_0x57c6('0xf')](_0x57c6('0x10'),_0x33165a,'request\x20sent',JSON[_0x57c6('0x11')](_0x519211));if(_0x519211['error']){if(_0x519211[_0x57c6('0x12')]['code']===0x1f4){logger[_0x57c6('0x12')](_0x57c6('0xd'),_0x33165a,_0x519211[_0x57c6('0x12')]['message']);return _0x25af4b(_0x519211[_0x57c6('0x12')][_0x57c6('0x13')]);}logger[_0x57c6('0x12')](_0x57c6('0xd'),_0x33165a,_0x519211[_0x57c6('0x12')][_0x57c6('0x13')]);return _0x3c9717(_0x519211[_0x57c6('0x12')][_0x57c6('0x13')]);}else{logger[_0x57c6('0x14')](_0x57c6('0xd'),_0x33165a,_0x57c6('0xe'));_0x3c9717(_0x519211[_0x57c6('0x15')][_0x57c6('0x13')]);}})[_0x57c6('0x16')](function(_0x499c1e){logger[_0x57c6('0x12')](_0x57c6('0xd'),_0x33165a,_0x499c1e);_0x25af4b(_0x499c1e);});});} \ No newline at end of file +var _0x4f3d=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','./dashboardItem.socket','register','request','then','info'];(function(_0x58e2a5,_0x4e822c){var _0x440ba0=function(_0x375d68){while(--_0x375d68){_0x58e2a5['push'](_0x58e2a5['shift']());}};_0x440ba0(++_0x4e822c);}(_0x4f3d,0x1ca));var _0xd4f3=function(_0xbf1924,_0x506493){_0xbf1924=_0xbf1924-0x0;var _0x325b96=_0x4f3d[_0xbf1924];return _0x325b96;};'use strict';var _=require(_0xd4f3('0x0'));var util=require(_0xd4f3('0x1'));var moment=require(_0xd4f3('0x2'));var BPromise=require(_0xd4f3('0x3'));var rs=require(_0xd4f3('0x4'));var fs=require('fs');var Redis=require(_0xd4f3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4f3('0x6'));var logger=require(_0xd4f3('0x7'))(_0xd4f3('0x8'));var config=require(_0xd4f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd4f3('0xa')]['http']({'port':0x232a});config[_0xd4f3('0xb')]=_['defaults'](config[_0xd4f3('0xb')],{'host':_0xd4f3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd4f3('0xd'))[_0xd4f3('0xe')](socket);function respondWithRpcPromise(_0xfa8537,_0x38d5e4,_0x5c895b){return new BPromise(function(_0x4e4c9d,_0x49e83e){return client[_0xd4f3('0xf')](_0xfa8537,_0x5c895b)[_0xd4f3('0x10')](function(_0x3168a3){logger[_0xd4f3('0x11')](_0xd4f3('0x12'),_0x38d5e4,_0xd4f3('0x13'));logger[_0xd4f3('0x14')](_0xd4f3('0x15'),_0x38d5e4,_0xd4f3('0x13'),JSON[_0xd4f3('0x16')](_0x3168a3));if(_0x3168a3[_0xd4f3('0x17')]){if(_0x3168a3[_0xd4f3('0x17')][_0xd4f3('0x18')]===0x1f4){logger[_0xd4f3('0x17')](_0xd4f3('0x12'),_0x38d5e4,_0x3168a3[_0xd4f3('0x17')][_0xd4f3('0x19')]);return _0x49e83e(_0x3168a3[_0xd4f3('0x17')][_0xd4f3('0x19')]);}logger[_0xd4f3('0x17')]('DashboardItem,\x20%s,\x20%s',_0x38d5e4,_0x3168a3[_0xd4f3('0x17')][_0xd4f3('0x19')]);return _0x4e4c9d(_0x3168a3[_0xd4f3('0x17')][_0xd4f3('0x19')]);}else{logger['info'](_0xd4f3('0x12'),_0x38d5e4,'request\x20sent');_0x4e4c9d(_0x3168a3[_0xd4f3('0x1a')][_0xd4f3('0x19')]);}})[_0xd4f3('0x1b')](function(_0x34f6d9){logger[_0xd4f3('0x17')](_0xd4f3('0x12'),_0x38d5e4,_0x34f6d9);_0x49e83e(_0x34f6d9);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index bd63ae2..ae8e5e0 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 _0x9048=['update','removeListener','register','length','./dashboardItem.events','remove'];(function(_0x1d704c,_0x43bcfe){var _0x5d972d=function(_0x18f19f){while(--_0x18f19f){_0x1d704c['push'](_0x1d704c['shift']());}};_0x5d972d(++_0x43bcfe);}(_0x9048,0x7c));var _0x8904=function(_0x1b23db,_0x1ef695){_0x1b23db=_0x1b23db-0x0;var _0x20a179=_0x9048[_0x1b23db];return _0x20a179;};'use strict';var DashboardItemEvents=require(_0x8904('0x0'));var events=['save',_0x8904('0x1'),_0x8904('0x2')];function createListener(_0x1ecf96,_0x4390b7){return function(_0x525ab8){_0x4390b7['emit'](_0x1ecf96,_0x525ab8);};}function removeListener(_0x3f984d,_0xeb9356){return function(){DashboardItemEvents[_0x8904('0x3')](_0x3f984d,_0xeb9356);};}exports[_0x8904('0x4')]=function(_0x43bd21){for(var _0x34acb0=0x0,_0xec66a0=events[_0x8904('0x5')];_0x34acb0<_0xec66a0;_0x34acb0++){var _0x3e4a49=events[_0x34acb0];var _0x50586a=createListener('dashboardItem:'+_0x3e4a49,_0x43bd21);DashboardItemEvents['on'](_0x3e4a49,_0x50586a);}}; \ No newline at end of file +var _0x76b0=['save','remove','update','emit','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x200f72,_0x44be0e){var _0x58f4fd=function(_0xeef45f){while(--_0xeef45f){_0x200f72['push'](_0x200f72['shift']());}};_0x58f4fd(++_0x44be0e);}(_0x76b0,0x117));var _0x076b=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x76b0[_0xaa1b3e];return _0x454d7d;};'use strict';var DashboardItemEvents=require(_0x076b('0x0'));var events=[_0x076b('0x1'),_0x076b('0x2'),_0x076b('0x3')];function createListener(_0x2caa22,_0x30c5c7){return function(_0x1afe53){_0x30c5c7[_0x076b('0x4')](_0x2caa22,_0x1afe53);};}function removeListener(_0x5c16da,_0x2ef43e){return function(){DashboardItemEvents['removeListener'](_0x5c16da,_0x2ef43e);};}exports[_0x076b('0x5')]=function(_0x2869fb){for(var _0x53d544=0x0,_0x2b0acc=events[_0x076b('0x6')];_0x53d544<_0x2b0acc;_0x53d544++){var _0x3f7f1e=events[_0x53d544];var _0x1d0dbb=createListener(_0x076b('0x7')+_0x3f7f1e,_0x2869fb);DashboardItemEvents['on'](_0x3f7f1e,_0x1d0dbb);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 4d004e2..c7309e5 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 _0x65a6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','put','update','delete','multer','express'];(function(_0x5dc5e2,_0x273cca){var _0x53af42=function(_0x2019d8){while(--_0x2019d8){_0x5dc5e2['push'](_0x5dc5e2['shift']());}};_0x53af42(++_0x273cca);}(_0x65a6,0x1ec));var _0x665a=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x65a6[_0x541ea6];return _0x3c3e84;};'use strict';var multer=require(_0x665a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x665a('0x1'));var router=express['Router']();var fs_extra=require(_0x665a('0x2'));var auth=require(_0x665a('0x3'));var interaction=require(_0x665a('0x4'));var config=require(_0x665a('0x5'));var controller=require('./dashboardItem.controller');router[_0x665a('0x6')](_0x665a('0x7'),auth['isAuthenticated'](),controller[_0x665a('0x8')]);router['post']('/',auth[_0x665a('0x9')](),controller['create']);router[_0x665a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x665a('0xb')]);router[_0x665a('0xc')](_0x665a('0x7'),auth[_0x665a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7a15=['./dashboardItem.controller','get','/:id','isAuthenticated','post','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f95f2,_0x307ecc){var _0x5a2a66=function(_0x17c4f7){while(--_0x17c4f7){_0x3f95f2['push'](_0x3f95f2['shift']());}};_0x5a2a66(++_0x307ecc);}(_0x7a15,0x149));var _0x57a1=function(_0x3d8152,_0x9d30dd){_0x3d8152=_0x3d8152-0x0;var _0x2c37e6=_0x7a15[_0x3d8152];return _0x2c37e6;};'use strict';var multer=require('multer');var util=require(_0x57a1('0x0'));var path=require(_0x57a1('0x1'));var timeout=require(_0x57a1('0x2'));var express=require(_0x57a1('0x3'));var router=express['Router']();var fs_extra=require(_0x57a1('0x4'));var auth=require(_0x57a1('0x5'));var interaction=require(_0x57a1('0x6'));var config=require('../../config/environment');var controller=require(_0x57a1('0x7'));router[_0x57a1('0x8')](_0x57a1('0x9'),auth[_0x57a1('0xa')](),controller['show']);router[_0x57a1('0xb')]('/',auth[_0x57a1('0xa')](),controller['create']);router['put']('/:id',auth[_0x57a1('0xa')](),controller[_0x57a1('0xc')]);router[_0x57a1('0xd')](_0x57a1('0x9'),auth['isAuthenticated'](),controller[_0x57a1('0xe')]);module[_0x57a1('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index cf1a5b6..5ff2aa2 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 _0x31b8=['STRING','exports','first'];(function(_0x101cd1,_0x9e28ef){var _0x2e50b0=function(_0x5988d2){while(--_0x5988d2){_0x101cd1['push'](_0x101cd1['shift']());}};_0x2e50b0(++_0x9e28ef);}(_0x31b8,0x94));var _0x831b=function(_0x357109,_0x501f56){_0x357109=_0x357109-0x0;var _0x2b157a=_0x31b8[_0x357109];return _0x2b157a;};'use strict';var Sequelize=require('sequelize');module[_0x831b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x831b('0x1'),'second','third'),'allowNull':![],'defaultValue':_0x831b('0x1')},'description':{'type':Sequelize[_0x831b('0x2')]}}; \ No newline at end of file +var _0xac5a=['second','third','exports','STRING','first'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xac5a,0x8e));var _0xaac5=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xac5a[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require('sequelize');module[_0xaac5('0x0')]={'name':{'type':Sequelize[_0xaac5('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xaac5('0x2'),_0xaac5('0x3'),_0xaac5('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xaac5('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 0a6e480..ec4ac6f 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 _0x53ab=['destroy','then','get','Dispositions','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x1242e3,_0x50732a){var _0x120a09=function(_0x1b2a80){while(--_0x1b2a80){_0x1242e3['push'](_0x1242e3['shift']());}};_0x120a09(++_0x50732a);}(_0x53ab,0x130));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb53a('0x0'));var rimraf=require(_0xb53a('0x1'));var zipdir=require(_0xb53a('0x2'));var jsonpatch=require(_0xb53a('0x3'));var rp=require(_0xb53a('0x4'));var moment=require(_0xb53a('0x5'));var BPromise=require(_0xb53a('0x6'));var Mustache=require(_0xb53a('0x7'));var util=require(_0xb53a('0x8'));var path=require(_0xb53a('0x9'));var sox=require('sox');var csv=require(_0xb53a('0xa'));var ejs=require(_0xb53a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb53a('0xc'));var squel=require(_0xb53a('0xd'));var crypto=require('crypto');var jsforce=require(_0xb53a('0xe'));var deskjs=require(_0xb53a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb53a('0x10'));var Papa=require(_0xb53a('0x11'));var Redis=require(_0xb53a('0x12'));var authService=require(_0xb53a('0x13'));var qs=require(_0xb53a('0x14'));var as=require(_0xb53a('0x15'));var hardwareService=require(_0xb53a('0x16'));var logger=require(_0xb53a('0x17'))(_0xb53a('0x18'));var utils=require('../../config/utils');var config=require(_0xb53a('0x19'));var licenseUtil=require(_0xb53a('0x1a'));var db=require(_0xb53a('0x1b'))['db'];function respondWithStatusCode(_0x38d6e5,_0x7f10a2){_0x7f10a2=_0x7f10a2||0xcc;return function(_0x53bf98){if(_0x53bf98){return _0x38d6e5[_0xb53a('0x1c')](_0x7f10a2);}return _0x38d6e5['status'](_0x7f10a2)['end']();};}function respondWithResult(_0x5a7657,_0x4c339f){_0x4c339f=_0x4c339f||0xc8;return function(_0x37cb1e){if(_0x37cb1e){return _0x5a7657[_0xb53a('0x1d')](_0x4c339f)[_0xb53a('0x1e')](_0x37cb1e);}};}function respondWithFilteredResult(_0x5d2978,_0x10c0c8){return function(_0x18b982){if(_0x18b982){var _0x11a337=typeof _0x10c0c8['offset']===_0xb53a('0x1f')&&typeof _0x10c0c8['limit']===_0xb53a('0x1f');var _0x473376=_0x18b982[_0xb53a('0x20')];var _0x4b94f5=_0x11a337?0x0:_0x10c0c8[_0xb53a('0x21')];var _0x5c2856=_0x11a337?_0x18b982[_0xb53a('0x20')]:_0x10c0c8[_0xb53a('0x21')]+_0x10c0c8[_0xb53a('0x22')];var _0x334113;if(_0x5c2856>=_0x473376){_0x5c2856=_0x473376;_0x334113=0xc8;}else{_0x334113=0xce;}_0x5d2978[_0xb53a('0x1d')](_0x334113);return _0x5d2978['set'](_0xb53a('0x23'),_0x4b94f5+'-'+_0x5c2856+'/'+_0x473376)['json'](_0x18b982);}return null;};}function patchUpdates(_0x324501){return function(_0x899b2d){try{jsonpatch[_0xb53a('0x24')](_0x899b2d,_0x324501,!![]);}catch(_0x4d4388){return BPromise[_0xb53a('0x25')](_0x4d4388);}return _0x899b2d[_0xb53a('0x26')]();};}function saveUpdates(_0x505f04,_0x135a3b){return function(_0x5c9067){if(_0x5c9067){return _0x5c9067[_0xb53a('0x27')](_0x505f04)['then'](function(_0x46d5cf){return _0x46d5cf;});}return null;};}function removeEntity(_0x39ad0e,_0x44a97c){return function(_0x1f8992){if(_0x1f8992){return _0x1f8992[_0xb53a('0x28')]()[_0xb53a('0x29')](function(){var _0x35a43f=_0x1f8992[_0xb53a('0x2a')]({'plain':!![]});var _0x50439a=_0xb53a('0x2b');return db[_0xb53a('0x2c')][_0xb53a('0x28')]({'where':{'type':_0x50439a,'resourceId':_0x35a43f['id']}})[_0xb53a('0x29')](function(){return _0x1f8992;});})[_0xb53a('0x29')](function(){_0x39ad0e['status'](0xcc)[_0xb53a('0x2d')]();});}};}function handleEntityNotFound(_0x6177f1,_0x315309){return function(_0x4b2fbe){if(!_0x4b2fbe){_0x6177f1['sendStatus'](0x194);}return _0x4b2fbe;};}function handleError(_0x473039,_0x5b6fa1){_0x5b6fa1=_0x5b6fa1||0x1f4;return function(_0x182317){logger[_0xb53a('0x2e')](_0x182317[_0xb53a('0x2f')]);if(_0x182317['name']){delete _0x182317[_0xb53a('0x30')];}_0x473039[_0xb53a('0x1d')](_0x5b6fa1)[_0xb53a('0x31')](_0x182317);};}exports[_0xb53a('0x32')]=function(_0xba38be,_0x7184b9){var _0x3e5532={},_0x2d3932={},_0x4c86bd={'count':0x0,'rows':[]};var _0x3f5130=_[_0xb53a('0x33')](db[_0xb53a('0x34')][_0xb53a('0x35')],function(_0x4e7b34){return{'name':_0x4e7b34[_0xb53a('0x36')],'type':_0x4e7b34['type']['key']};});_0x2d3932[_0xb53a('0x37')]=_[_0xb53a('0x33')](_0x3f5130,_0xb53a('0x30'));_0x2d3932[_0xb53a('0x38')]=_[_0xb53a('0x39')](_0xba38be[_0xb53a('0x38')]);_0x2d3932[_0xb53a('0x3a')]=_[_0xb53a('0x3b')](_0x2d3932[_0xb53a('0x37')],_0x2d3932[_0xb53a('0x38')]);_0x3e5532['attributes']=_['intersection'](_0x2d3932[_0xb53a('0x37')],qs[_0xb53a('0x3c')](_0xba38be[_0xb53a('0x38')][_0xb53a('0x3c')]));_0x3e5532[_0xb53a('0x3d')]=_0x3e5532[_0xb53a('0x3d')][_0xb53a('0x3e')]?_0x3e5532[_0xb53a('0x3d')]:_0x2d3932['model'];if(!_0xba38be[_0xb53a('0x38')][_0xb53a('0x3f')](_0xb53a('0x40'))){_0x3e5532[_0xb53a('0x22')]=qs['limit'](_0xba38be['query'][_0xb53a('0x22')]);_0x3e5532[_0xb53a('0x21')]=qs[_0xb53a('0x21')](_0xba38be[_0xb53a('0x38')][_0xb53a('0x21')]);}_0x3e5532['order']=qs[_0xb53a('0x41')](_0xba38be['query'][_0xb53a('0x41')]);_0x3e5532[_0xb53a('0x42')]=qs[_0xb53a('0x3a')](_[_0xb53a('0x43')](_0xba38be[_0xb53a('0x38')],_0x2d3932['filters']),_0x3f5130);if(_0xba38be['query'][_0xb53a('0x44')]){_0x3e5532[_0xb53a('0x42')]=_[_0xb53a('0x45')](_0x3e5532[_0xb53a('0x42')],{'$or':_['map'](_0x3f5130,function(_0xf9598e){if(_0xf9598e['type']!==_0xb53a('0x46')){var _0x4ce9bf={};_0x4ce9bf[_0xf9598e[_0xb53a('0x30')]]={'$like':'%'+_0xba38be[_0xb53a('0x38')][_0xb53a('0x44')]+'%'};return _0x4ce9bf;}})});}_0x3e5532=_[_0xb53a('0x45')]({},_0x3e5532,_0xba38be[_0xb53a('0x47')]);var _0x2e1da8={'where':_0x3e5532[_0xb53a('0x42')]};return db[_0xb53a('0x34')][_0xb53a('0x20')](_0x2e1da8)['then'](function(_0x3f2e85){_0x4c86bd[_0xb53a('0x20')]=_0x3f2e85;if(_0xba38be[_0xb53a('0x38')][_0xb53a('0x48')]){_0x3e5532[_0xb53a('0x49')]=[{'all':!![]}];}return db[_0xb53a('0x34')][_0xb53a('0x4a')](_0x3e5532);})[_0xb53a('0x29')](function(_0x23e56b){_0x4c86bd['rows']=_0x23e56b;return _0x4c86bd;})[_0xb53a('0x29')](respondWithFilteredResult(_0x7184b9,_0x3e5532))[_0xb53a('0x4b')](handleError(_0x7184b9,null));};exports[_0xb53a('0x4c')]=function(_0x174eee,_0x2fc925){var _0x1bd2c2={'raw':!![],'where':{'id':_0x174eee[_0xb53a('0x4d')]['id']}},_0xa1eea5={};_0xa1eea5[_0xb53a('0x37')]=_[_0xb53a('0x39')](db[_0xb53a('0x34')][_0xb53a('0x35')]);_0xa1eea5[_0xb53a('0x38')]=_[_0xb53a('0x39')](_0x174eee[_0xb53a('0x38')]);_0xa1eea5[_0xb53a('0x3a')]=_[_0xb53a('0x3b')](_0xa1eea5['model'],_0xa1eea5['query']);_0x1bd2c2[_0xb53a('0x3d')]=_['intersection'](_0xa1eea5[_0xb53a('0x37')],qs[_0xb53a('0x3c')](_0x174eee[_0xb53a('0x38')][_0xb53a('0x3c')]));_0x1bd2c2[_0xb53a('0x3d')]=_0x1bd2c2[_0xb53a('0x3d')][_0xb53a('0x3e')]?_0x1bd2c2['attributes']:_0xa1eea5[_0xb53a('0x37')];if(_0x174eee['query']['includeAll']){_0x1bd2c2['include']=[{'all':!![]}];}_0x1bd2c2=_[_0xb53a('0x45')]({},_0x1bd2c2,_0x174eee['options']);return db[_0xb53a('0x34')][_0xb53a('0x4e')](_0x1bd2c2)[_0xb53a('0x29')](handleEntityNotFound(_0x2fc925,null))[_0xb53a('0x29')](respondWithResult(_0x2fc925,null))[_0xb53a('0x4b')](handleError(_0x2fc925,null));};exports[_0xb53a('0x4f')]=function(_0x33da3a,_0x2f8169){return db[_0xb53a('0x34')][_0xb53a('0x4f')](_0x33da3a[_0xb53a('0x50')],{})[_0xb53a('0x29')](function(_0x1b6229){var _0x373761=_0x33da3a[_0xb53a('0x51')]['get']({'plain':!![]});if(!_0x373761)throw new Error(_0xb53a('0x52'));if(_0x373761[_0xb53a('0x53')]==='user'){var _0x395fed=_0x1b6229['get']({'plain':!![]});var _0x53993a=_0xb53a('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x53993a,'userProfileId':_0x373761['userProfileId']},'raw':!![]})['then'](function(_0x165d52){if(_0x165d52&&_0x165d52[_0xb53a('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x395fed[_0xb53a('0x30')],'resourceId':_0x395fed['id'],'type':_0x165d52[_0xb53a('0x30')],'sectionId':_0x165d52['id']},{})[_0xb53a('0x29')](function(){return _0x1b6229;});}else{return _0x1b6229;}})[_0xb53a('0x4b')](function(_0x5d517e){logger['error'](_0xb53a('0x55'),_0x5d517e);throw _0x5d517e;});}return _0x1b6229;})[_0xb53a('0x29')](respondWithResult(_0x2f8169,0xc9))[_0xb53a('0x4b')](handleError(_0x2f8169,null));};exports[_0xb53a('0x27')]=function(_0x33c95a,_0x532b0a){if(_0x33c95a[_0xb53a('0x50')]['id']){delete _0x33c95a[_0xb53a('0x50')]['id'];}return db[_0xb53a('0x34')]['find']({'where':{'id':_0x33c95a[_0xb53a('0x4d')]['id']}})[_0xb53a('0x29')](handleEntityNotFound(_0x532b0a,null))['then'](saveUpdates(_0x33c95a[_0xb53a('0x50')],null))[_0xb53a('0x29')](respondWithResult(_0x532b0a,null))[_0xb53a('0x4b')](handleError(_0x532b0a,null));};exports['destroy']=function(_0x3ff648,_0x538f21){return db[_0xb53a('0x34')][_0xb53a('0x4e')]({'where':{'id':_0x3ff648[_0xb53a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x538f21,null))[_0xb53a('0x29')](removeEntity(_0x538f21,null))[_0xb53a('0x4b')](handleError(_0x538f21,null));}; \ No newline at end of file +var _0x8375=['status','json','offset','count','set','Content-Range','apply','reject','update','then','get','Dispositions','UserProfileResource','destroy','end','error','stack','name','send','index','Disposition','rawAttributes','type','key','model','map','query','filters','attributes','fields','length','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','intersection','options','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x12df2d,_0x164072){var _0x575ec5=function(_0x45b093){while(--_0x45b093){_0x12df2d['push'](_0x12df2d['shift']());}};_0x575ec5(++_0x164072);}(_0x8375,0x132));var _0x5837=function(_0x257723,_0x1c80d0){_0x257723=_0x257723-0x0;var _0x24282d=_0x8375[_0x257723];return _0x24282d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5837('0x0'));var zipdir=require(_0x5837('0x1'));var jsonpatch=require(_0x5837('0x2'));var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require('mustache');var util=require(_0x5837('0x6'));var path=require(_0x5837('0x7'));var sox=require('sox');var csv=require(_0x5837('0x8'));var ejs=require(_0x5837('0x9'));var fs=require('fs');var fs_extra=require(_0x5837('0xa'));var _=require(_0x5837('0xb'));var squel=require('squel');var crypto=require(_0x5837('0xc'));var jsforce=require(_0x5837('0xd'));var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x8'));var querystring=require(_0x5837('0xf'));var Papa=require(_0x5837('0x10'));var Redis=require(_0x5837('0x11'));var authService=require(_0x5837('0x12'));var qs=require(_0x5837('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5837('0x14'));var logger=require(_0x5837('0x15'))('api');var utils=require(_0x5837('0x16'));var config=require(_0x5837('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x5abd5e,_0x2b0b43){_0x2b0b43=_0x2b0b43||0xcc;return function(_0x3ad5b3){if(_0x3ad5b3){return _0x5abd5e[_0x5837('0x19')](_0x2b0b43);}return _0x5abd5e[_0x5837('0x1a')](_0x2b0b43)['end']();};}function respondWithResult(_0x2b82a9,_0x103b9c){_0x103b9c=_0x103b9c||0xc8;return function(_0x2bc6f6){if(_0x2bc6f6){return _0x2b82a9['status'](_0x103b9c)[_0x5837('0x1b')](_0x2bc6f6);}};}function respondWithFilteredResult(_0x11f16c,_0x2f8af0){return function(_0x23c3af){if(_0x23c3af){var _0x304fe7=typeof _0x2f8af0[_0x5837('0x1c')]==='undefined'&&typeof _0x2f8af0['limit']==='undefined';var _0x37824b=_0x23c3af[_0x5837('0x1d')];var _0x1a5725=_0x304fe7?0x0:_0x2f8af0[_0x5837('0x1c')];var _0x128b4a=_0x304fe7?_0x23c3af[_0x5837('0x1d')]:_0x2f8af0[_0x5837('0x1c')]+_0x2f8af0['limit'];var _0x3c5ec9;if(_0x128b4a>=_0x37824b){_0x128b4a=_0x37824b;_0x3c5ec9=0xc8;}else{_0x3c5ec9=0xce;}_0x11f16c[_0x5837('0x1a')](_0x3c5ec9);return _0x11f16c[_0x5837('0x1e')](_0x5837('0x1f'),_0x1a5725+'-'+_0x128b4a+'/'+_0x37824b)[_0x5837('0x1b')](_0x23c3af);}return null;};}function patchUpdates(_0x50c42c){return function(_0x4bd76c){try{jsonpatch[_0x5837('0x20')](_0x4bd76c,_0x50c42c,!![]);}catch(_0x21c0bf){return BPromise[_0x5837('0x21')](_0x21c0bf);}return _0x4bd76c['save']();};}function saveUpdates(_0x31010b,_0x46786c){return function(_0x4b59b1){if(_0x4b59b1){return _0x4b59b1[_0x5837('0x22')](_0x31010b)[_0x5837('0x23')](function(_0x5e9c2e){return _0x5e9c2e;});}return null;};}function removeEntity(_0x332a90,_0x2709cf){return function(_0x1366c1){if(_0x1366c1){return _0x1366c1['destroy']()[_0x5837('0x23')](function(){var _0x4c431c=_0x1366c1[_0x5837('0x24')]({'plain':!![]});var _0x8e5a48=_0x5837('0x25');return db[_0x5837('0x26')][_0x5837('0x27')]({'where':{'type':_0x8e5a48,'resourceId':_0x4c431c['id']}})[_0x5837('0x23')](function(){return _0x1366c1;});})[_0x5837('0x23')](function(){_0x332a90[_0x5837('0x1a')](0xcc)[_0x5837('0x28')]();});}};}function handleEntityNotFound(_0x192883,_0x24b941){return function(_0x27848d){if(!_0x27848d){_0x192883[_0x5837('0x19')](0x194);}return _0x27848d;};}function handleError(_0x3a6cc8,_0x271e23){_0x271e23=_0x271e23||0x1f4;return function(_0x5c17dd){logger[_0x5837('0x29')](_0x5c17dd[_0x5837('0x2a')]);if(_0x5c17dd[_0x5837('0x2b')]){delete _0x5c17dd[_0x5837('0x2b')];}_0x3a6cc8[_0x5837('0x1a')](_0x271e23)[_0x5837('0x2c')](_0x5c17dd);};}exports[_0x5837('0x2d')]=function(_0x4e3259,_0x89e7e5){var _0x290e14={},_0x3a3a34={},_0x285186={'count':0x0,'rows':[]};var _0x55b71b=_['map'](db[_0x5837('0x2e')][_0x5837('0x2f')],function(_0x12cdcd){return{'name':_0x12cdcd['fieldName'],'type':_0x12cdcd[_0x5837('0x30')][_0x5837('0x31')]};});_0x3a3a34[_0x5837('0x32')]=_[_0x5837('0x33')](_0x55b71b,_0x5837('0x2b'));_0x3a3a34[_0x5837('0x34')]=_['keys'](_0x4e3259[_0x5837('0x34')]);_0x3a3a34[_0x5837('0x35')]=_['intersection'](_0x3a3a34[_0x5837('0x32')],_0x3a3a34[_0x5837('0x34')]);_0x290e14[_0x5837('0x36')]=_['intersection'](_0x3a3a34['model'],qs['fields'](_0x4e3259['query'][_0x5837('0x37')]));_0x290e14['attributes']=_0x290e14['attributes'][_0x5837('0x38')]?_0x290e14[_0x5837('0x36')]:_0x3a3a34['model'];if(!_0x4e3259[_0x5837('0x34')]['hasOwnProperty'](_0x5837('0x39'))){_0x290e14[_0x5837('0x3a')]=qs['limit'](_0x4e3259[_0x5837('0x34')][_0x5837('0x3a')]);_0x290e14['offset']=qs[_0x5837('0x1c')](_0x4e3259['query'][_0x5837('0x1c')]);}_0x290e14['order']=qs['sort'](_0x4e3259[_0x5837('0x34')][_0x5837('0x3b')]);_0x290e14[_0x5837('0x3c')]=qs[_0x5837('0x35')](_[_0x5837('0x3d')](_0x4e3259['query'],_0x3a3a34[_0x5837('0x35')]),_0x55b71b);if(_0x4e3259['query']['filter']){_0x290e14[_0x5837('0x3c')]=_[_0x5837('0x3e')](_0x290e14['where'],{'$or':_[_0x5837('0x33')](_0x55b71b,function(_0x3c27e8){if(_0x3c27e8[_0x5837('0x30')]!==_0x5837('0x3f')){var _0x1fefdb={};_0x1fefdb[_0x3c27e8[_0x5837('0x2b')]]={'$like':'%'+_0x4e3259[_0x5837('0x34')][_0x5837('0x40')]+'%'};return _0x1fefdb;}})});}_0x290e14=_[_0x5837('0x3e')]({},_0x290e14,_0x4e3259['options']);var _0xa8e83b={'where':_0x290e14['where']};return db['Disposition'][_0x5837('0x1d')](_0xa8e83b)[_0x5837('0x23')](function(_0x5e6916){_0x285186[_0x5837('0x1d')]=_0x5e6916;if(_0x4e3259[_0x5837('0x34')][_0x5837('0x41')]){_0x290e14[_0x5837('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x5837('0x43')](_0x290e14);})[_0x5837('0x23')](function(_0x84eff){_0x285186[_0x5837('0x44')]=_0x84eff;return _0x285186;})[_0x5837('0x23')](respondWithFilteredResult(_0x89e7e5,_0x290e14))['catch'](handleError(_0x89e7e5,null));};exports[_0x5837('0x45')]=function(_0x45513d,_0x3075da){var _0x50866e={'raw':!![],'where':{'id':_0x45513d[_0x5837('0x46')]['id']}},_0x45e6b8={};_0x45e6b8[_0x5837('0x32')]=_[_0x5837('0x47')](db[_0x5837('0x2e')][_0x5837('0x2f')]);_0x45e6b8[_0x5837('0x34')]=_[_0x5837('0x47')](_0x45513d[_0x5837('0x34')]);_0x45e6b8[_0x5837('0x35')]=_[_0x5837('0x48')](_0x45e6b8['model'],_0x45e6b8[_0x5837('0x34')]);_0x50866e[_0x5837('0x36')]=_['intersection'](_0x45e6b8['model'],qs[_0x5837('0x37')](_0x45513d['query'][_0x5837('0x37')]));_0x50866e[_0x5837('0x36')]=_0x50866e[_0x5837('0x36')][_0x5837('0x38')]?_0x50866e['attributes']:_0x45e6b8[_0x5837('0x32')];if(_0x45513d[_0x5837('0x34')][_0x5837('0x41')]){_0x50866e[_0x5837('0x42')]=[{'all':!![]}];}_0x50866e=_[_0x5837('0x3e')]({},_0x50866e,_0x45513d[_0x5837('0x49')]);return db[_0x5837('0x2e')][_0x5837('0x4a')](_0x50866e)[_0x5837('0x23')](handleEntityNotFound(_0x3075da,null))['then'](respondWithResult(_0x3075da,null))[_0x5837('0x4b')](handleError(_0x3075da,null));};exports[_0x5837('0x4c')]=function(_0xd49ba7,_0x16f12f){return db[_0x5837('0x2e')][_0x5837('0x4c')](_0xd49ba7['body'],{})[_0x5837('0x23')](function(_0x3d88df){var _0x3f5db9=_0xd49ba7[_0x5837('0x4d')][_0x5837('0x24')]({'plain':!![]});if(!_0x3f5db9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f5db9[_0x5837('0x4e')]==='user'){var _0x105315=_0x3d88df[_0x5837('0x24')]({'plain':!![]});var _0x42d0e2='Dispositions';return db[_0x5837('0x4f')][_0x5837('0x4a')]({'where':{'name':_0x42d0e2,'userProfileId':_0x3f5db9[_0x5837('0x50')]},'raw':!![]})[_0x5837('0x23')](function(_0xd28f94){if(_0xd28f94&&_0xd28f94[_0x5837('0x51')]===0x0){return db[_0x5837('0x26')][_0x5837('0x4c')]({'name':_0x105315[_0x5837('0x2b')],'resourceId':_0x105315['id'],'type':_0xd28f94['name'],'sectionId':_0xd28f94['id']},{})['then'](function(){return _0x3d88df;});}else{return _0x3d88df;}})[_0x5837('0x4b')](function(_0x219f2d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x219f2d);throw _0x219f2d;});}return _0x3d88df;})[_0x5837('0x23')](respondWithResult(_0x16f12f,0xc9))[_0x5837('0x4b')](handleError(_0x16f12f,null));};exports[_0x5837('0x22')]=function(_0x1e68b7,_0xda7373){if(_0x1e68b7['body']['id']){delete _0x1e68b7[_0x5837('0x52')]['id'];}return db[_0x5837('0x2e')][_0x5837('0x4a')]({'where':{'id':_0x1e68b7['params']['id']}})['then'](handleEntityNotFound(_0xda7373,null))[_0x5837('0x23')](saveUpdates(_0x1e68b7[_0x5837('0x52')],null))[_0x5837('0x23')](respondWithResult(_0xda7373,null))[_0x5837('0x4b')](handleError(_0xda7373,null));};exports['destroy']=function(_0x1ad14c,_0x4a66c4){return db['Disposition'][_0x5837('0x4a')]({'where':{'id':_0x1ad14c[_0x5837('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a66c4,null))[_0x5837('0x23')](removeEntity(_0x4a66c4,null))[_0x5837('0x4b')](handleError(_0x4a66c4,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index adbc80c..f92fe93 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 _0xae86=['bluebird','request-promise','path','rimraf','exports','define','Disposition','tools_dispositions','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','moment'];(function(_0x5d4701,_0x50bfcf){var _0x85d4ca=function(_0x30cdcc){while(--_0x30cdcc){_0x5d4701['push'](_0x5d4701['shift']());}};_0x85d4ca(++_0x50bfcf);}(_0xae86,0x1a1));var _0x6ae8=function(_0xc6489d,_0x27d8d6){_0xc6489d=_0xc6489d-0x0;var _0x53618d=_0xae86[_0xc6489d];return _0x53618d;};'use strict';var _=require(_0x6ae8('0x0'));var util=require('util');var logger=require(_0x6ae8('0x1'))('api');var moment=require(_0x6ae8('0x2'));var BPromise=require(_0x6ae8('0x3'));var rp=require(_0x6ae8('0x4'));var fs=require('fs');var path=require(_0x6ae8('0x5'));var rimraf=require(_0x6ae8('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x6ae8('0x7')]=function(_0xecfd5c,_0x2074d7){return _0xecfd5c[_0x6ae8('0x8')](_0x6ae8('0x9'),attributes,{'tableName':_0x6ae8('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x6ae8('0xb'),_0x6ae8('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x6ae8('0xb'),_0x6ae8('0xd')]},{'unique':!![],'name':_0x6ae8('0xe'),'fields':[_0x6ae8('0xb'),_0x6ae8('0xf')]},{'unique':!![],'name':_0x6ae8('0x10'),'fields':[_0x6ae8('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x6ae8('0x11'),'fields':[_0x6ae8('0xb'),_0x6ae8('0x12')]},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0x6ae8('0x13'),'fields':[_0x6ae8('0xb'),_0x6ae8('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2db4=['name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId'];(function(_0x483afa,_0x3b127d){var _0x35a382=function(_0x319975){while(--_0x319975){_0x483afa['push'](_0x483afa['shift']());}};_0x35a382(++_0x3b127d);}(_0x2db4,0xbd));var _0x42db=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2db4[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x42db('0x0'));var util=require(_0x42db('0x1'));var logger=require('../../config/logger')(_0x42db('0x2'));var moment=require(_0x42db('0x3'));var BPromise=require(_0x42db('0x4'));var rp=require(_0x42db('0x5'));var fs=require('fs');var path=require(_0x42db('0x6'));var rimraf=require(_0x42db('0x7'));var config=require(_0x42db('0x8'));var attributes=require(_0x42db('0x9'));module[_0x42db('0xa')]=function(_0x161adf,_0x5ded6a){return _0x161adf[_0x42db('0xb')](_0x42db('0xc'),attributes,{'tableName':_0x42db('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x42db('0xe'),'fields':[_0x42db('0xf'),_0x42db('0x10')]},{'unique':!![],'name':_0x42db('0x11'),'fields':[_0x42db('0xf'),_0x42db('0x12')]},{'unique':!![],'name':_0x42db('0x13'),'fields':['name',_0x42db('0x14')]},{'unique':!![],'name':_0x42db('0x15'),'fields':[_0x42db('0xf'),_0x42db('0x16')]},{'unique':!![],'name':_0x42db('0x17'),'fields':[_0x42db('0xf'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':['name',_0x42db('0x18')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x42db('0x19')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index e0e94d3..22c84fb 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(_0x2638da,_0xec9438){var _0xaacdae=function(_0x381fb0){while(--_0x381fb0){_0x2638da['push'](_0x2638da['shift']());}};_0xaacdae(++_0xec9438);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x28e829,_0x23fbf8){var _0xae03ec=function(_0x22cd6f){while(--_0x22cd6f){_0x28e829['push'](_0x28e829['shift']());}};_0xae03ec(++_0x23fbf8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 a694777..f93ea38 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 _0xfad0=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x17156d,_0x3cd0d8){var _0x13c60d=function(_0x11647c){while(--_0x11647c){_0x17156d['push'](_0x17156d['shift']());}};_0x13c60d(++_0x3cd0d8);}(_0xfad0,0x12a));var _0x0fad=function(_0x322104,_0x4122e1){_0x322104=_0x322104-0x0;var _0x14fbaa=_0xfad0[_0x322104];return _0x14fbaa;};'use strict';var multer=require(_0x0fad('0x0'));var util=require(_0x0fad('0x1'));var path=require(_0x0fad('0x2'));var timeout=require(_0x0fad('0x3'));var express=require('express');var router=express[_0x0fad('0x4')]();var fs_extra=require(_0x0fad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fad('0x6'));var config=require(_0x0fad('0x7'));var controller=require('./disposition.controller');router['get']('/',auth[_0x0fad('0x8')](),controller[_0x0fad('0x9')]);router[_0x0fad('0xa')](_0x0fad('0xb'),auth[_0x0fad('0x8')](),controller[_0x0fad('0xc')]);router[_0x0fad('0xd')]('/',auth[_0x0fad('0x8')](),controller[_0x0fad('0xe')]);router[_0x0fad('0xf')](_0x0fad('0xb'),auth[_0x0fad('0x8')](),controller[_0x0fad('0x10')]);router['delete'](_0x0fad('0xb'),auth[_0x0fad('0x8')](),controller[_0x0fad('0x11')]);module[_0x0fad('0x12')]=router; \ No newline at end of file +var _0x4b97=['update','delete','destroy','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','index','show','post','isAuthenticated','create','put','/:id'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4b97,0x6f));var _0x74b9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4b97[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x74b9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x74b9('0x1'));var router=express['Router']();var fs_extra=require(_0x74b9('0x2'));var auth=require(_0x74b9('0x3'));var interaction=require(_0x74b9('0x4'));var config=require(_0x74b9('0x5'));var controller=require(_0x74b9('0x6'));router[_0x74b9('0x7')]('/',auth['isAuthenticated'](),controller[_0x74b9('0x8')]);router[_0x74b9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x74b9('0x9')]);router[_0x74b9('0xa')]('/',auth[_0x74b9('0xb')](),controller[_0x74b9('0xc')]);router[_0x74b9('0xd')](_0x74b9('0xe'),auth[_0x74b9('0xb')](),controller[_0x74b9('0xf')]);router[_0x74b9('0x10')]('/:id',auth[_0x74b9('0xb')](),controller[_0x74b9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a0a66d3..389a1e5 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 _0x5fab=['12000','14400','4800','v17,v27,v29','INTEGER','IAX','DADHI','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','9600'];(function(_0x274057,_0x8e11c8){var _0x29fc37=function(_0x4b633c){while(--_0x4b633c){_0x274057['push'](_0x274057['shift']());}};_0x29fc37(++_0x8e11c8);}(_0x5fab,0x177));var _0xb5fa=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x5fab[_0x419550];return _0x55f9ef;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb5fa('0x2')]},'ecm':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x4'),'no'),'defaultValue':_0xb5fa('0x4')},'headerinfo':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0x5')},'localstationid':{'type':Sequelize[_0xb5fa('0x2')],'unique':_0xb5fa('0x6')},'minrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),'4800','7200',_0xb5fa('0x8'),_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),_0xb5fa('0xb'),'7200','9600',_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':_0xb5fa('0xa')},'modem':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0xc')},'gateway':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb5fa('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb5fa('0x3')]('SIP',_0xb5fa('0xe'),_0xb5fa('0xf'),'KHOMP'),'defaultValue':_0xb5fa('0x10')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb5fa('0x11')],'defaultValue':function(){return _0xb5fa('0x12');}},'notificationSound':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5fa('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb5fa('0x14'),'set':function(_0x1f7f05){if(!_0x1f7f05)this[_0xb5fa('0x15')](_0xb5fa('0x16'),null);this[_0xb5fa('0x15')](_0xb5fa('0x17'),_0x1f7f05);}}}; \ No newline at end of file +var _0x938d=['7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x314eea,_0x88e82c){var _0x4e0fc7=function(_0x2976b5){while(--_0x2976b5){_0x314eea['push'](_0x314eea['shift']());}};_0x4e0fc7(++_0x88e82c);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd938('0x0'));module[_0xd938('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd938('0x2')]},'ecm':{'type':Sequelize[_0xd938('0x3')](_0xd938('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xd938('0x5')},'localstationid':{'type':Sequelize[_0xd938('0x2')],'unique':_0xd938('0x6')},'minrate':{'type':Sequelize['ENUM'](_0xd938('0x7'),_0xd938('0x8'),_0xd938('0x9'),_0xd938('0xa'),_0xd938('0xb'),_0xd938('0xc')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xd938('0x3')](_0xd938('0x7'),_0xd938('0x8'),_0xd938('0x9'),_0xd938('0xa'),_0xd938('0xb'),'14400'),'defaultValue':_0xd938('0xc')},'modem':{'type':Sequelize[_0xd938('0x2')],'defaultValue':_0xd938('0xd')},'gateway':{'type':Sequelize[_0xd938('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd938('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd938('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd938('0x3')](_0xd938('0xf'),_0xd938('0x10'),_0xd938('0x11'),_0xd938('0x12')),'defaultValue':_0xd938('0xf')},'key':{'type':Sequelize[_0xd938('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd938('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd938('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd938('0xe')],'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[_0xd938('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd938('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd938('0x14'),'set':function(_0x1e3c7f){if(!_0x1e3c7f)this[_0xd938('0x15')]('mandatoryDispositionPauseId',null);this[_0xd938('0x15')](_0xd938('0x16'),_0x1e3c7f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 10b271d..8903bf7 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 _0xa513=['DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','limit','count','offset','apply','reject','save','update','get','FaxAccounts','destroy','sendStatus','name','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','findAll','rows','ids','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','CmContact','User','fullname','internal','Tag','Tags','tag','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','send','json','getApplications','context','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','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','sequelize','VoiceExtension','key','createdAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','updatedAt'];(function(_0x48c346,_0x24ab43){var _0x5a194a=function(_0x3a8111){while(--_0x3a8111){_0x48c346['push'](_0x48c346['shift']());}};_0x5a194a(++_0x24ab43);}(_0xa513,0x191));var _0x3a51=function(_0x51bc87,_0x3460a0){_0x51bc87=_0x51bc87-0x0;var _0x526fa9=_0xa513[_0x51bc87];return _0x526fa9;};'use strict';var emlformat=require(_0x3a51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a51('0x1'));var jsonpatch=require(_0x3a51('0x2'));var rp=require('request-promise');var moment=require(_0x3a51('0x3'));var BPromise=require(_0x3a51('0x4'));var Mustache=require(_0x3a51('0x5'));var util=require('util');var path=require(_0x3a51('0x6'));var sox=require(_0x3a51('0x7'));var csv=require(_0x3a51('0x8'));var ejs=require(_0x3a51('0x9'));var fs=require('fs');var fs_extra=require(_0x3a51('0xa'));var _=require('lodash');var squel=require(_0x3a51('0xb'));var crypto=require('crypto');var jsforce=require(_0x3a51('0xc'));var deskjs=require(_0x3a51('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3a51('0xe'));var Redis=require(_0x3a51('0xf'));var authService=require(_0x3a51('0x10'));var qs=require(_0x3a51('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a51('0x12'));var logger=require(_0x3a51('0x13'))(_0x3a51('0x14'));var utils=require(_0x3a51('0x15'));var config=require(_0x3a51('0x16'));var licenseUtil=require(_0x3a51('0x17'));var db=require('../../mysqldb')['db'];config[_0x3a51('0x18')]=_[_0x3a51('0x19')](config[_0x3a51('0x18')],{'host':_0x3a51('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a51('0x18')]));require(_0x3a51('0x1b'))[_0x3a51('0x1c')](socket);var jayson=require(_0x3a51('0x1d'));var client=jayson[_0x3a51('0x1e')][_0x3a51('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x3a51('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1ceb5c,_0x7ff990,_0x58d1bb,_0x20e87e){return new BPromise(function(_0x30e3ac,_0x8fb9d4){var _0x162b52=_0x20e87e||client;return _0x162b52[_0x3a51('0x20')](_0x1ceb5c,_0x58d1bb)[_0x3a51('0x21')](function(_0x35f3e5){logger[_0x3a51('0x22')](_0x3a51('0x23'),_0x7ff990,_0x3a51('0x24'));logger['debug'](_0x3a51('0x25'),_0x7ff990,_0x3a51('0x24'),JSON['stringify'](_0x35f3e5));if(_0x35f3e5['error']){if(_0x35f3e5[_0x3a51('0x26')][_0x3a51('0x27')]===0x1f4){logger['error'](_0x3a51('0x23'),_0x7ff990,_0x35f3e5[_0x3a51('0x26')][_0x3a51('0x28')]);return _0x8fb9d4(_0x35f3e5[_0x3a51('0x26')][_0x3a51('0x28')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x7ff990,_0x35f3e5[_0x3a51('0x26')][_0x3a51('0x28')]);return _0x30e3ac(_0x35f3e5[_0x3a51('0x26')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x7ff990,_0x3a51('0x24'));_0x30e3ac(_0x35f3e5[_0x3a51('0x29')]['message']);}})[_0x3a51('0x2a')](function(_0x359eb5){logger[_0x3a51('0x26')](_0x3a51('0x23'),_0x7ff990,_0x359eb5);_0x8fb9d4(_0x359eb5);});});}function respondWithStatusCode(_0xa6661c,_0x1f0368){_0x1f0368=_0x1f0368||0xcc;return function(_0xdd2a12){if(_0xdd2a12){return _0xa6661c['sendStatus'](_0x1f0368);}return _0xa6661c[_0x3a51('0x2b')](_0x1f0368)[_0x3a51('0x2c')]();};}function respondWithResult(_0x25e9b1,_0x51b5d8){_0x51b5d8=_0x51b5d8||0xc8;return function(_0x2d5256){if(_0x2d5256){return _0x25e9b1[_0x3a51('0x2b')](_0x51b5d8)['json'](_0x2d5256);}};}function respondWithFilteredResult(_0x1b21f2,_0x2f4dc7){return function(_0x4187e4){if(_0x4187e4){var _0x4a7f6e=typeof _0x2f4dc7['offset']==='undefined'&&typeof _0x2f4dc7[_0x3a51('0x2d')]==='undefined';var _0x1568cb=_0x4187e4[_0x3a51('0x2e')];var _0x50e6f1=_0x4a7f6e?0x0:_0x2f4dc7[_0x3a51('0x2f')];var _0x32483a=_0x4a7f6e?_0x4187e4[_0x3a51('0x2e')]:_0x2f4dc7[_0x3a51('0x2f')]+_0x2f4dc7['limit'];var _0x680b72;if(_0x32483a>=_0x1568cb){_0x32483a=_0x1568cb;_0x680b72=0xc8;}else{_0x680b72=0xce;}_0x1b21f2[_0x3a51('0x2b')](_0x680b72);return _0x1b21f2['set']('Content-Range',_0x50e6f1+'-'+_0x32483a+'/'+_0x1568cb)['json'](_0x4187e4);}return null;};}function patchUpdates(_0x4bcf12){return function(_0x4e17a4){try{jsonpatch[_0x3a51('0x30')](_0x4e17a4,_0x4bcf12,!![]);}catch(_0x4e5c12){return BPromise[_0x3a51('0x31')](_0x4e5c12);}return _0x4e17a4[_0x3a51('0x32')]();};}function saveUpdates(_0x5c6f60,_0x12399c){return function(_0x1630a0){if(_0x1630a0){return _0x1630a0[_0x3a51('0x33')](_0x5c6f60)[_0x3a51('0x21')](function(_0x1f78d6){return _0x1f78d6;});}return null;};}function removeEntity(_0x2bfdf6,_0x18e028){return function(_0x31965b){if(_0x31965b){return _0x31965b['destroy']()[_0x3a51('0x21')](function(){var _0x3d9c58=_0x31965b[_0x3a51('0x34')]({'plain':!![]});var _0x504805=_0x3a51('0x35');return db['UserProfileResource'][_0x3a51('0x36')]({'where':{'type':_0x504805,'resourceId':_0x3d9c58['id']}})[_0x3a51('0x21')](function(){return _0x31965b;});})[_0x3a51('0x21')](function(){_0x2bfdf6[_0x3a51('0x2b')](0xcc)[_0x3a51('0x2c')]();});}};}function handleEntityNotFound(_0x15e323,_0x402771){return function(_0x38eaab){if(!_0x38eaab){_0x15e323[_0x3a51('0x37')](0x194);}return _0x38eaab;};}function handleError(_0x5cd46f,_0xf0227e){_0xf0227e=_0xf0227e||0x1f4;return function(_0x56f9d1){logger['error'](_0x56f9d1['stack']);if(_0x56f9d1[_0x3a51('0x38')]){delete _0x56f9d1[_0x3a51('0x38')];}_0x5cd46f[_0x3a51('0x2b')](_0xf0227e)['send'](_0x56f9d1);};}exports['index']=function(_0x366fa8,_0xd3ebb6){var _0x2f0776={'include':[{'model':db[_0x3a51('0x39')],'as':_0x3a51('0x3a')}]},_0x299398={},_0x44fc32={'count':0x0,'rows':[]};var _0x543a6f=_[_0x3a51('0x3b')](db[_0x3a51('0x3c')][_0x3a51('0x3d')],function(_0x571ab6){return{'name':_0x571ab6[_0x3a51('0x3e')],'type':_0x571ab6['type']['key']};});_0x299398[_0x3a51('0x3f')]=_['map'](_0x543a6f,_0x3a51('0x38'));_0x299398[_0x3a51('0x40')]=_[_0x3a51('0x41')](_0x366fa8[_0x3a51('0x40')]);_0x299398[_0x3a51('0x42')]=_[_0x3a51('0x43')](_0x299398[_0x3a51('0x3f')],_0x299398['query']);_0x2f0776[_0x3a51('0x44')]=_[_0x3a51('0x43')](_0x299398['model'],qs['fields'](_0x366fa8[_0x3a51('0x40')][_0x3a51('0x45')]));_0x2f0776[_0x3a51('0x44')]=_0x2f0776[_0x3a51('0x44')]['length']?_0x2f0776[_0x3a51('0x44')]:_0x299398[_0x3a51('0x3f')];if(!_0x366fa8[_0x3a51('0x40')]['hasOwnProperty'](_0x3a51('0x46'))){_0x2f0776[_0x3a51('0x2d')]=qs['limit'](_0x366fa8['query'][_0x3a51('0x2d')]);_0x2f0776[_0x3a51('0x2f')]=qs[_0x3a51('0x2f')](_0x366fa8['query'][_0x3a51('0x2f')]);}_0x2f0776[_0x3a51('0x47')]=qs['sort'](_0x366fa8[_0x3a51('0x40')][_0x3a51('0x48')]);_0x2f0776['where']=qs[_0x3a51('0x42')](_[_0x3a51('0x49')](_0x366fa8[_0x3a51('0x40')],_0x299398[_0x3a51('0x42')]),_0x543a6f);if(_0x366fa8['query'][_0x3a51('0x4a')]){_0x2f0776[_0x3a51('0x4b')]=_[_0x3a51('0x4c')](_0x2f0776['where'],{'$or':_[_0x3a51('0x3b')](_0x543a6f,function(_0x5eb723){if(_0x5eb723[_0x3a51('0x4d')]!=='VIRTUAL'){var _0x501292={};_0x501292[_0x5eb723[_0x3a51('0x38')]]={'$like':'%'+_0x366fa8[_0x3a51('0x40')][_0x3a51('0x4a')]+'%'};return _0x501292;}})});}_0x2f0776=_['merge']({},_0x2f0776,_0x366fa8[_0x3a51('0x4e')]);var _0x29f918={'where':_0x2f0776[_0x3a51('0x4b')]};return db[_0x3a51('0x3c')][_0x3a51('0x2e')](_0x29f918)['then'](function(_0x5aa1c4){_0x44fc32[_0x3a51('0x2e')]=_0x5aa1c4;if(_0x366fa8['query'][_0x3a51('0x4f')]){_0x2f0776[_0x3a51('0x50')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x2f0776);})[_0x3a51('0x21')](function(_0x32ed9e){_0x44fc32['rows']=_0x32ed9e;return _0x44fc32;})['then'](respondWithFilteredResult(_0xd3ebb6,_0x2f0776))['catch'](handleError(_0xd3ebb6,null));};exports[_0x3a51('0x51')]=function(_0x34abea,_0xa7ae6b){var _0x4e87ac={'raw':![],'where':{'id':_0x34abea[_0x3a51('0x52')]['id']},'include':[{'model':db[_0x3a51('0x39')],'as':_0x3a51('0x3a')}]},_0x512789={};_0x512789[_0x3a51('0x3f')]=_[_0x3a51('0x41')](db[_0x3a51('0x3c')][_0x3a51('0x3d')]);_0x512789[_0x3a51('0x40')]=_['keys'](_0x34abea[_0x3a51('0x40')]);_0x512789[_0x3a51('0x42')]=_[_0x3a51('0x43')](_0x512789['model'],_0x512789[_0x3a51('0x40')]);_0x4e87ac[_0x3a51('0x44')]=_[_0x3a51('0x43')](_0x512789[_0x3a51('0x3f')],qs[_0x3a51('0x45')](_0x34abea['query']['fields']));_0x4e87ac[_0x3a51('0x44')]=_0x4e87ac[_0x3a51('0x44')][_0x3a51('0x53')]?_0x4e87ac[_0x3a51('0x44')]:_0x512789[_0x3a51('0x3f')];if(_0x34abea['query'][_0x3a51('0x4f')]){_0x4e87ac[_0x3a51('0x50')]=[{'all':!![]}];}_0x4e87ac=_[_0x3a51('0x4c')]({},_0x4e87ac,_0x34abea[_0x3a51('0x4e')]);return db[_0x3a51('0x3c')][_0x3a51('0x54')](_0x4e87ac)[_0x3a51('0x21')](handleEntityNotFound(_0xa7ae6b,null))[_0x3a51('0x21')](respondWithResult(_0xa7ae6b,null))[_0x3a51('0x2a')](handleError(_0xa7ae6b,null));};exports[_0x3a51('0x55')]=function(_0x11e1c0,_0x494322){return db['FaxAccount']['create'](_0x11e1c0['body'],{})['then'](function(_0x2020b7){var _0x1fd218=_0x11e1c0[_0x3a51('0x56')][_0x3a51('0x34')]({'plain':!![]});if(!_0x1fd218)throw new Error(_0x3a51('0x57'));if(_0x1fd218['role']===_0x3a51('0x56')){var _0x172dea=_0x2020b7['get']({'plain':!![]});var _0x8dea6f=_0x3a51('0x35');return db[_0x3a51('0x58')]['find']({'where':{'name':_0x8dea6f,'userProfileId':_0x1fd218['userProfileId']},'raw':!![]})[_0x3a51('0x21')](function(_0x1fbc08){if(_0x1fbc08&&_0x1fbc08[_0x3a51('0x59')]===0x0){return db['UserProfileResource'][_0x3a51('0x55')]({'name':_0x172dea['name'],'resourceId':_0x172dea['id'],'type':_0x1fbc08['name'],'sectionId':_0x1fbc08['id']},{})[_0x3a51('0x21')](function(){return _0x2020b7;});}else{return _0x2020b7;}})['catch'](function(_0x195ae4){logger['error'](_0x3a51('0x5a'),_0x195ae4);throw _0x195ae4;});}return _0x2020b7;})[_0x3a51('0x21')](respondWithResult(_0x494322,0xc9))[_0x3a51('0x2a')](handleError(_0x494322,null));};exports[_0x3a51('0x33')]=function(_0x4c898f,_0x47406d){if(_0x4c898f[_0x3a51('0x5b')]['id']){delete _0x4c898f[_0x3a51('0x5b')]['id'];}return db[_0x3a51('0x3c')]['find']({'where':{'id':_0x4c898f['params']['id']},'include':[{'model':db[_0x3a51('0x39')],'as':_0x3a51('0x3a')}]})[_0x3a51('0x21')](handleEntityNotFound(_0x47406d,null))[_0x3a51('0x21')](saveUpdates(_0x4c898f[_0x3a51('0x5b')],null))[_0x3a51('0x21')](respondWithResult(_0x47406d,null))[_0x3a51('0x2a')](handleError(_0x47406d,null));};exports[_0x3a51('0x36')]=function(_0x51d1e1,_0x425943){return db[_0x3a51('0x3c')][_0x3a51('0x54')]({'where':{'id':_0x51d1e1[_0x3a51('0x52')]['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x425943,null))[_0x3a51('0x21')](removeEntity(_0x425943,null))['catch'](handleError(_0x425943,null));};exports['describe']=function(_0x484512,_0x3f53b7){return db['FaxAccount'][_0x3a51('0x5c')]()[_0x3a51('0x21')](respondWithResult(_0x3f53b7,null))['catch'](handleError(_0x3f53b7,null));};exports[_0x3a51('0x5d')]=function(_0x95c19f,_0x488bcc,_0x5ec28f){if(_0x95c19f['body']['id']){delete _0x95c19f[_0x3a51('0x5b')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x95c19f[_0x3a51('0x52')]['id']}})['then'](handleEntityNotFound(_0x488bcc,null))['then'](function(_0x28e8c7){if(_0x28e8c7){_0x95c19f['body'][_0x3a51('0x5e')]=_0x28e8c7['id'];return db[_0x3a51('0x5f')][_0x3a51('0x55')](_0x95c19f[_0x3a51('0x5b')]);}})[_0x3a51('0x21')](respondWithResult(_0x488bcc,null))[_0x3a51('0x2a')](handleError(_0x488bcc,null));};exports[_0x3a51('0x60')]=function(_0x233da5,_0x52a8a0,_0x29f7f6){var _0x1201ef={'raw':![],'where':{}};var _0x971c42={};var _0x54b451={'count':0x0,'rows':[]};return db[_0x3a51('0x3c')][_0x3a51('0x61')]({'where':{'id':_0x233da5[_0x3a51('0x52')]['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x52a8a0,null))[_0x3a51('0x21')](function(_0x4eabca){if(_0x4eabca){_0x971c42['model']=_['keys'](db[_0x3a51('0x5f')]['rawAttributes']);_0x971c42[_0x3a51('0x40')]=_[_0x3a51('0x41')](_0x233da5[_0x3a51('0x40')]);_0x971c42['filters']=_[_0x3a51('0x43')](_0x971c42['model'],_0x971c42['query']);_0x1201ef[_0x3a51('0x44')]=_['intersection'](_0x971c42['model'],qs[_0x3a51('0x45')](_0x233da5['query'][_0x3a51('0x45')]));_0x1201ef['attributes']=_0x1201ef['attributes'][_0x3a51('0x53')]?_0x1201ef['attributes']:_0x971c42['model'];if(!_0x233da5[_0x3a51('0x40')][_0x3a51('0x62')](_0x3a51('0x46'))){_0x1201ef['limit']=qs['limit'](_0x233da5[_0x3a51('0x40')][_0x3a51('0x2d')]);_0x1201ef[_0x3a51('0x2f')]=qs[_0x3a51('0x2f')](_0x233da5[_0x3a51('0x40')][_0x3a51('0x2f')]);}_0x1201ef[_0x3a51('0x47')]=qs[_0x3a51('0x48')](_0x233da5[_0x3a51('0x40')][_0x3a51('0x48')]);_0x1201ef[_0x3a51('0x4b')]=qs[_0x3a51('0x42')](_['pick'](_0x233da5[_0x3a51('0x40')],_0x971c42[_0x3a51('0x42')]));_0x1201ef[_0x3a51('0x4b')][_0x3a51('0x5e')]=_0x4eabca['id'];if(_0x233da5[_0x3a51('0x40')][_0x3a51('0x4a')]){_0x1201ef[_0x3a51('0x4b')]=_[_0x3a51('0x4c')](_0x1201ef[_0x3a51('0x4b')],{'$or':_[_0x3a51('0x3b')](_0x1201ef[_0x3a51('0x44')],function(_0x24f6f4){var _0x2aaadc={};_0x2aaadc[_0x24f6f4]={'$like':'%'+_0x233da5['query'][_0x3a51('0x4a')]+'%'};return _0x2aaadc;})});}_0x1201ef=_[_0x3a51('0x4c')]({},_0x1201ef,_0x233da5[_0x3a51('0x4e')]);return db[_0x3a51('0x5f')][_0x3a51('0x2e')]({'where':_0x1201ef[_0x3a51('0x4b')]})[_0x3a51('0x21')](function(_0x300cda){_0x54b451[_0x3a51('0x2e')]=_0x300cda;if(_0x233da5[_0x3a51('0x40')][_0x3a51('0x4f')]){_0x1201ef[_0x3a51('0x50')]=[{'all':!![]}];}return db[_0x3a51('0x5f')][_0x3a51('0x63')](_0x1201ef);})[_0x3a51('0x21')](function(_0x6bd534){_0x54b451[_0x3a51('0x64')]=_0x6bd534;return _0x54b451;});}})['then'](respondWithFilteredResult(_0x52a8a0,_0x1201ef))[_0x3a51('0x2a')](handleError(_0x52a8a0,null));};exports['removeDispositions']=function(_0xc8ebfe,_0x23e938,_0x462e63){return db['FaxAccount'][_0x3a51('0x54')]({'where':{'id':_0xc8ebfe[_0x3a51('0x52')]['id']}})['then'](handleEntityNotFound(_0x23e938,null))['then'](function(_0x575314){if(_0x575314){return _0x575314['removeDispositions'](_0xc8ebfe[_0x3a51('0x40')][_0x3a51('0x65')]);}})['then'](respondWithStatusCode(_0x23e938,null))[_0x3a51('0x2a')](handleError(_0x23e938,null));};exports['addAnswer']=function(_0x415b2a,_0x2c44b8,_0x557f16){if(_0x415b2a[_0x3a51('0x5b')]['id']){delete _0x415b2a[_0x3a51('0x5b')]['id'];}return db[_0x3a51('0x3c')]['find']({'where':{'id':_0x415b2a[_0x3a51('0x52')]['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x2c44b8,null))[_0x3a51('0x21')](function(_0x152523){if(_0x152523){_0x415b2a['body']['FaxAccountId']=_0x152523['id'];return db[_0x3a51('0x66')][_0x3a51('0x55')](_0x415b2a['body']);}})[_0x3a51('0x21')](respondWithResult(_0x2c44b8,null))[_0x3a51('0x2a')](handleError(_0x2c44b8,null));};exports[_0x3a51('0x67')]=function(_0x5d56a9,_0xbb5b11,_0x2be514){var _0x27c276={'raw':![],'where':{}};var _0x1e4f23={};var _0x26e80a={'count':0x0,'rows':[]};return db[_0x3a51('0x3c')][_0x3a51('0x61')]({'where':{'id':_0x5d56a9[_0x3a51('0x52')]['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0xbb5b11,null))['then'](function(_0x297cbe){if(_0x297cbe){_0x1e4f23[_0x3a51('0x3f')]=_[_0x3a51('0x41')](db[_0x3a51('0x66')][_0x3a51('0x3d')]);_0x1e4f23[_0x3a51('0x40')]=_[_0x3a51('0x41')](_0x5d56a9['query']);_0x1e4f23[_0x3a51('0x42')]=_[_0x3a51('0x43')](_0x1e4f23['model'],_0x1e4f23[_0x3a51('0x40')]);_0x27c276[_0x3a51('0x44')]=_[_0x3a51('0x43')](_0x1e4f23[_0x3a51('0x3f')],qs[_0x3a51('0x45')](_0x5d56a9[_0x3a51('0x40')]['fields']));_0x27c276[_0x3a51('0x44')]=_0x27c276[_0x3a51('0x44')][_0x3a51('0x53')]?_0x27c276[_0x3a51('0x44')]:_0x1e4f23[_0x3a51('0x3f')];if(!_0x5d56a9[_0x3a51('0x40')][_0x3a51('0x62')]('nolimit')){_0x27c276[_0x3a51('0x2d')]=qs[_0x3a51('0x2d')](_0x5d56a9[_0x3a51('0x40')][_0x3a51('0x2d')]);_0x27c276['offset']=qs[_0x3a51('0x2f')](_0x5d56a9[_0x3a51('0x40')][_0x3a51('0x2f')]);}_0x27c276[_0x3a51('0x47')]=qs[_0x3a51('0x48')](_0x5d56a9[_0x3a51('0x40')][_0x3a51('0x48')]);_0x27c276['where']=qs[_0x3a51('0x42')](_[_0x3a51('0x49')](_0x5d56a9[_0x3a51('0x40')],_0x1e4f23['filters']));_0x27c276['where'][_0x3a51('0x5e')]=_0x297cbe['id'];if(_0x5d56a9[_0x3a51('0x40')][_0x3a51('0x4a')]){_0x27c276[_0x3a51('0x4b')]=_[_0x3a51('0x4c')](_0x27c276[_0x3a51('0x4b')],{'$or':_[_0x3a51('0x3b')](_0x27c276[_0x3a51('0x44')],function(_0x56ab76){var _0x3d5168={};_0x3d5168[_0x56ab76]={'$like':'%'+_0x5d56a9[_0x3a51('0x40')][_0x3a51('0x4a')]+'%'};return _0x3d5168;})});}_0x27c276=_[_0x3a51('0x4c')]({},_0x27c276,_0x5d56a9['options']);return db['CannedAnswer'][_0x3a51('0x2e')]({'where':_0x27c276[_0x3a51('0x4b')]})['then'](function(_0x1e95e1){_0x26e80a['count']=_0x1e95e1;if(_0x5d56a9[_0x3a51('0x40')][_0x3a51('0x4f')]){_0x27c276[_0x3a51('0x50')]=[{'all':!![]}];}return db[_0x3a51('0x66')][_0x3a51('0x63')](_0x27c276);})[_0x3a51('0x21')](function(_0xed0a3f){_0x26e80a['rows']=_0xed0a3f;return _0x26e80a;});}})[_0x3a51('0x21')](respondWithFilteredResult(_0xbb5b11,_0x27c276))[_0x3a51('0x2a')](handleError(_0xbb5b11,null));};exports[_0x3a51('0x68')]=function(_0x4c7a16,_0x2b652f,_0x448fae){return db[_0x3a51('0x3c')][_0x3a51('0x54')]({'where':{'id':_0x4c7a16['params']['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x2b652f,null))['then'](function(_0x39ec41){if(_0x39ec41){return _0x39ec41[_0x3a51('0x68')](_0x4c7a16[_0x3a51('0x40')][_0x3a51('0x65')]);}})[_0x3a51('0x21')](respondWithStatusCode(_0x2b652f,null))['catch'](handleError(_0x2b652f,null));};exports['addInteraction']=function(_0x484c23,_0x589376,_0x21a00a){return db[_0x3a51('0x69')][_0x3a51('0x54')]({'where':{'id':_0x484c23[_0x3a51('0x52')]['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x589376,null))[_0x3a51('0x21')](function(_0x1508a0){if(_0x1508a0){return _0x1508a0['addInteraction'](_0x484c23[_0x3a51('0x5b')][_0x3a51('0x65')],_[_0x3a51('0x6a')](_0x484c23['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x589376,null))['catch'](handleError(_0x589376,null));};exports['getInteractions']=function(_0xf6d6e0,_0x291c9a,_0x3b21dd){var _0x2bea8a={'raw':![],'where':{}};var _0x51a4cf={};var _0x59ebd4={'count':0x0,'rows':[]};return db[_0x3a51('0x3c')][_0x3a51('0x61')]({'where':{'id':_0xf6d6e0['params']['id']}})['then'](handleEntityNotFound(_0x291c9a,null))['then'](function(_0x33373c){if(_0x33373c){_0x51a4cf[_0x3a51('0x3f')]=_['keys'](db[_0x3a51('0x69')][_0x3a51('0x3d')]);_0x51a4cf[_0x3a51('0x40')]=_[_0x3a51('0x41')](_0xf6d6e0['query']);_0x51a4cf['filters']=_['intersection'](_0x51a4cf['model'],_0x51a4cf[_0x3a51('0x40')]);_0x2bea8a[_0x3a51('0x44')]=_[_0x3a51('0x43')](_0x51a4cf[_0x3a51('0x3f')],qs[_0x3a51('0x45')](_0xf6d6e0[_0x3a51('0x40')]['fields']));_0x2bea8a[_0x3a51('0x44')]=_0x2bea8a['attributes'][_0x3a51('0x53')]?_0x2bea8a[_0x3a51('0x44')]:_0x51a4cf[_0x3a51('0x3f')];if(!_0xf6d6e0[_0x3a51('0x40')][_0x3a51('0x62')](_0x3a51('0x46'))){_0x2bea8a[_0x3a51('0x2d')]=qs[_0x3a51('0x2d')](_0xf6d6e0['query'][_0x3a51('0x2d')]);_0x2bea8a[_0x3a51('0x2f')]=qs['offset'](_0xf6d6e0[_0x3a51('0x40')][_0x3a51('0x2f')]);}_0x2bea8a[_0x3a51('0x47')]=qs[_0x3a51('0x48')](_0xf6d6e0[_0x3a51('0x40')][_0x3a51('0x48')]);_0x2bea8a[_0x3a51('0x4b')]=qs[_0x3a51('0x42')](_['pick'](_0xf6d6e0[_0x3a51('0x40')],_0x51a4cf[_0x3a51('0x42')]));_0x2bea8a['where']['FaxAccountId']=_0x33373c['id'];if(_0xf6d6e0[_0x3a51('0x40')]['filter']){_0x2bea8a['where']=_['merge'](_0x2bea8a[_0x3a51('0x4b')],{'$or':_[_0x3a51('0x3b')](_0x2bea8a[_0x3a51('0x44')],function(_0x383a98){var _0x41ee90={};_0x41ee90[_0x383a98]={'$like':'%'+_0xf6d6e0[_0x3a51('0x40')][_0x3a51('0x4a')]+'%'};return _0x41ee90;})});}_0x2bea8a=_[_0x3a51('0x4c')]({},_0x2bea8a,_0xf6d6e0[_0x3a51('0x4e')]);return db[_0x3a51('0x69')][_0x3a51('0x2e')]({'where':_0x2bea8a[_0x3a51('0x4b')]})[_0x3a51('0x21')](function(_0x2e7327){_0x59ebd4[_0x3a51('0x2e')]=_0x2e7327;if(_0xf6d6e0[_0x3a51('0x40')]['includeAll']){_0x2bea8a[_0x3a51('0x50')]=[{'model':db[_0x3a51('0x6b')],'as':'Contact','required':![]},{'model':db[_0x3a51('0x6c')],'as':'Owner','attributes':[_0x3a51('0x38'),_0x3a51('0x6d'),_0x3a51('0x6e')],'required':![]},{'model':db[_0x3a51('0x6f')],'as':_0x3a51('0x70'),'attributes':['id',_0x3a51('0x38'),'color'],'where':_0xf6d6e0[_0x3a51('0x40')]['tag']?{'id':_0xf6d6e0[_0x3a51('0x40')][_0x3a51('0x71')]}:undefined,'required':_0xf6d6e0['query'][_0x3a51('0x71')]?!![]:![]}];}return db[_0x3a51('0x69')][_0x3a51('0x63')](_0x2bea8a);})['then'](function(_0x40cd8a){_0x59ebd4[_0x3a51('0x64')]=_0x40cd8a;return _0x59ebd4;});}})[_0x3a51('0x21')](respondWithFilteredResult(_0x291c9a,_0x2bea8a))[_0x3a51('0x2a')](handleError(_0x291c9a,null));};exports['addApplications']=function(_0xd4ea86,_0x551596){var _0x4dc5fa=_0xd4ea86[_0x3a51('0x52')]['id'];var _0x2d7f12=_0xd4ea86[_0x3a51('0x5b')];var _0x48fee5=0xc8;var _0xa51e5=null;return db['sequelize'][_0x3a51('0x72')]({'isolationLevel':db['sequelize'][_0x3a51('0x73')][_0x3a51('0x74')][_0x3a51('0x75')]},function(_0x1f3ba3){return db[_0x3a51('0x3c')][_0x3a51('0x61')]({'where':{'id':_0x4dc5fa},'transaction':_0x1f3ba3})[_0x3a51('0x21')](function(_0x180571){if(_0x180571){return db['FaxApplication'][_0x3a51('0x36')]({'where':{'FaxAccountId':_0x4dc5fa},'transaction':_0x1f3ba3})['then'](function(){var _0x2c9f2b=_[_0x3a51('0x3b')](_0x2d7f12,function(_0x1d6b5c){_0x1d6b5c[_0x3a51('0x5e')]=_0x4dc5fa;return _0x1d6b5c;});return db[_0x3a51('0x76')][_0x3a51('0x77')](_0x2c9f2b,{'transaction':_0x1f3ba3});});}else{_0x48fee5=0x194;_0xa51e5=[];}});})['then'](function(){if(_0x48fee5!==0x194){return db[_0x3a51('0x76')][_0x3a51('0x78')]({'where':{'FaxAccountId':_0x4dc5fa},'order':_0x3a51('0x79')})[_0x3a51('0x21')](function(_0x55f622){_0xa51e5=_0x55f622;});}})[_0x3a51('0x2a')](function(_0x5b48e2){_0x48fee5=0x1f4;logger[_0x3a51('0x26')](_0x5b48e2[_0x3a51('0x7a')]);if(_0x5b48e2[_0x3a51('0x38')]){delete _0x5b48e2[_0x3a51('0x38')];}_0xa51e5=_0x5b48e2;})[_0x3a51('0x7b')](function(){if(_0xa51e5===null){_0x551596[_0x3a51('0x37')](_0x48fee5);}else{if(_0x48fee5===0x1f4){_0x551596['status'](_0x48fee5)[_0x3a51('0x7c')](_0xa51e5);}else{_0x551596[_0x3a51('0x2b')](_0x48fee5)[_0x3a51('0x7d')](_0xa51e5);}}});};exports[_0x3a51('0x7e')]=function(_0x4ead15,_0x131951,_0x18f713){var _0xe6915b={};var _0x5a5069={};var _0xca9bc2;var _0x46c870;return db[_0x3a51('0x3c')]['findOne']({'where':{'id':_0x4ead15[_0x3a51('0x52')]['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x131951,null))[_0x3a51('0x21')](function(_0x4da6a7){if(_0x4da6a7){_0xca9bc2=_0x4da6a7;_0x5a5069[_0x3a51('0x3f')]=_[_0x3a51('0x41')](db[_0x3a51('0x76')][_0x3a51('0x3d')]);_0x5a5069[_0x3a51('0x40')]=_[_0x3a51('0x41')](_0x4ead15[_0x3a51('0x40')]);_0x5a5069[_0x3a51('0x42')]=_[_0x3a51('0x43')](_0x5a5069[_0x3a51('0x3f')],_0x5a5069['query']);_0xe6915b['attributes']=_[_0x3a51('0x43')](_0x5a5069[_0x3a51('0x3f')],qs[_0x3a51('0x45')](_0x4ead15[_0x3a51('0x40')][_0x3a51('0x45')]));_0xe6915b[_0x3a51('0x44')]=_0xe6915b['attributes'][_0x3a51('0x53')]?_0xe6915b['attributes']:_0x5a5069[_0x3a51('0x3f')];_0xe6915b[_0x3a51('0x47')]=qs['sort'](_0x4ead15[_0x3a51('0x40')][_0x3a51('0x48')]);_0xe6915b['where']=qs['filters'](_[_0x3a51('0x49')](_0x4ead15['query'],_0x5a5069['filters']));if(_0x4ead15[_0x3a51('0x40')]['filter']){_0xe6915b[_0x3a51('0x4b')]=_[_0x3a51('0x4c')](_0xe6915b[_0x3a51('0x4b')],{'$or':_[_0x3a51('0x3b')](_0xe6915b[_0x3a51('0x44')],function(_0x3146e1){var _0x51e2b5={};_0x51e2b5[_0x3146e1]={'$like':'%'+_0x4ead15[_0x3a51('0x40')]['filter']+'%'};return _0x51e2b5;})});}_0xe6915b=_[_0x3a51('0x4c')]({},_0xe6915b,_0x4ead15[_0x3a51('0x4e')]);return _0xca9bc2['getApplications'](_0xe6915b);}})[_0x3a51('0x21')](function(_0x1f9334){if(_0x1f9334){_0x46c870=_0x1f9334[_0x3a51('0x53')];if(!_0x4ead15[_0x3a51('0x40')][_0x3a51('0x62')](_0x3a51('0x46'))){_0xe6915b[_0x3a51('0x2d')]=qs['limit'](_0x4ead15[_0x3a51('0x40')][_0x3a51('0x2d')]);_0xe6915b['offset']=qs['offset'](_0x4ead15[_0x3a51('0x40')]['offset']);}return _0xca9bc2['getApplications'](_0xe6915b);}})[_0x3a51('0x21')](function(_0x247f48){if(_0x247f48){return _0x247f48?{'count':_0x46c870,'rows':_0x247f48}:null;}})['then'](respondWithResult(_0x131951,null))[_0x3a51('0x2a')](handleError(_0x131951,null));};function Extension(_0x275e61,_0x184a02,_0x49644e,_0x41022a){this[_0x3a51('0x7f')]='from-voip-provider';this['exten']=_0x275e61[_0x3a51('0x80')];this['app']=_0x41022a;this[_0x3a51('0x4d')]=_0x3a51('0x81');this[_0x3a51('0x82')]=_0x3a51('0x83');this[_0x3a51('0x5e')]=_0x275e61['id'];this['priority']=_0x184a02;this[_0x3a51('0x84')]=_0x49644e;}function createExtensionsReciveFax(_0x3c3717){var _0x14580c=0x1;var _0x56b8a5=[];_0x56b8a5[_0x3a51('0x85')](new Extension(_0x3c3717,_0x14580c,'',_0x3a51('0x86')));_0x14580c+=0x1;_0x56b8a5['push'](new Extension(_0x3c3717,_0x14580c,'CDR(type)=inbound-fax',_0x3a51('0x87')));_0x14580c+=0x1;for(var _0x38e81b in _0x3c3717){if(_0x3c3717[_0x3a51('0x62')](_0x38e81b)&&(_0x38e81b==='ecm'||_0x38e81b==='localstationid'||_0x38e81b===_0x3a51('0x88')||_0x38e81b===_0x3a51('0x89')||_0x38e81b===_0x3a51('0x8a')||_0x38e81b===_0x3a51('0x8b')||_0x38e81b===_0x3a51('0x8c')||_0x38e81b===_0x3a51('0x8d')||_0x38e81b===_0x3a51('0x8e'))){_0x56b8a5[_0x3a51('0x85')](new Extension(_0x3c3717,_0x14580c,'FAXOPT('+_0x38e81b+')='+_0x3c3717[_0x38e81b],'Set'));_0x14580c+=0x1;}}_0x56b8a5[_0x3a51('0x85')](new Extension(_0x3c3717,_0x14580c,'6',_0x3a51('0x8f')));_0x14580c+=0x1;_0x56b8a5[_0x3a51('0x85')](new Extension(_0x3c3717,_0x14580c,_0x3a51('0x90'),_0x3a51('0x91')));_0x14580c=0x0;return _0x56b8a5;}exports['addAccountApplications']=function(_0x5f1482,_0x576a9e,_0x342f78){var _0x4674cd;return db[_0x3a51('0x92')][_0x3a51('0x72')](function(_0x138f08){return db[_0x3a51('0x3c')][_0x3a51('0x55')](_0x5f1482['body'],{'transaction':_0x138f08})['then'](function(_0x5955d8){_0x4674cd=_0x5955d8[_0x3a51('0x34')]({'plain':!![]});return db[_0x3a51('0x93')][_0x3a51('0x77')](createExtensionsReciveFax(_0x4674cd),{'transaction':_0x138f08});});})[_0x3a51('0x21')](function(){return _0x4674cd;})[_0x3a51('0x21')](respondWithResult(_0x576a9e,null))['catch'](handleError(_0x576a9e,null));};exports['updateAccountApplications']=function(_0x50e282,_0x2ada53,_0x15a89f){var _0x4c213c;return db[_0x3a51('0x92')][_0x3a51('0x72')](function(_0x15cbeb){return db[_0x3a51('0x3c')][_0x3a51('0x33')](_0x50e282['body'],{'where':{'id':_0x50e282[_0x3a51('0x5b')]['id']},'transaction':_0x15cbeb})[_0x3a51('0x21')](function(_0x1632cf){return db[_0x3a51('0x93')][_0x3a51('0x36')]({'where':{'FaxAccountId':_0x50e282[_0x3a51('0x5b')]['id']},'transaction':_0x15cbeb})[_0x3a51('0x21')](function(_0x5f396b){return db[_0x3a51('0x93')][_0x3a51('0x77')](createExtensionsReciveFax(_[_0x3a51('0x6a')](_0x50e282[_0x3a51('0x5b')],['tech',_0x3a51('0x94'),_0x3a51('0x95'),'updatedAt',_0x3a51('0x96'),_0x3a51('0x97')])),{'transaction':_0x15cbeb});});});})[_0x3a51('0x21')](function(){return db[_0x3a51('0x3c')][_0x3a51('0x98')](_0x50e282['body']['id']);})['then'](respondWithResult(_0x2ada53,null))[_0x3a51('0x2a')](handleError(_0x2ada53,null));};exports['getMessages']=function(_0x79be06,_0x125b78,_0x4af3b0){var _0x42c6e5={'raw':!![],'where':{}};var _0x2c738b={};var _0x2adcd0={'count':0x0,'rows':[]};return db[_0x3a51('0x3c')]['findOne']({'where':{'id':_0x79be06['params']['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x125b78,null))[_0x3a51('0x21')](function(_0x8e5bad){if(_0x8e5bad){_0x2c738b[_0x3a51('0x3f')]=_[_0x3a51('0x41')](db[_0x3a51('0x99')][_0x3a51('0x3d')]);_0x2c738b[_0x3a51('0x40')]=_[_0x3a51('0x41')](_0x79be06['query']);_0x2c738b['filters']=_['intersection'](_0x2c738b[_0x3a51('0x3f')],_0x2c738b[_0x3a51('0x40')]);_0x42c6e5[_0x3a51('0x44')]=_[_0x3a51('0x43')](_0x2c738b[_0x3a51('0x3f')],qs[_0x3a51('0x45')](_0x79be06[_0x3a51('0x40')]['fields']));_0x42c6e5[_0x3a51('0x44')]=_0x42c6e5[_0x3a51('0x44')][_0x3a51('0x53')]?_0x42c6e5['attributes']:_0x2c738b['model'];if(!_0x79be06[_0x3a51('0x40')][_0x3a51('0x62')](_0x3a51('0x46'))){_0x42c6e5[_0x3a51('0x2d')]=qs['limit'](_0x79be06[_0x3a51('0x40')][_0x3a51('0x2d')]);_0x42c6e5[_0x3a51('0x2f')]=qs[_0x3a51('0x2f')](_0x79be06[_0x3a51('0x40')][_0x3a51('0x2f')]);}_0x42c6e5[_0x3a51('0x47')]=qs[_0x3a51('0x48')](_0x79be06['query'][_0x3a51('0x48')]);_0x42c6e5[_0x3a51('0x4b')]=qs[_0x3a51('0x42')](_[_0x3a51('0x49')](_0x79be06['query'],_0x2c738b[_0x3a51('0x42')]));_0x42c6e5[_0x3a51('0x4b')][_0x3a51('0x5e')]=_0x8e5bad['id'];if(_0x79be06[_0x3a51('0x40')][_0x3a51('0x4a')]){_0x42c6e5[_0x3a51('0x4b')]=_[_0x3a51('0x4c')](_0x42c6e5[_0x3a51('0x4b')],{'$or':_[_0x3a51('0x3b')](_0x42c6e5['attributes'],function(_0x3fc65e){var _0x3b616d={};_0x3b616d[_0x3fc65e]={'$like':'%'+_0x79be06['query']['filter']+'%'};return _0x3b616d;})});}if(_0x79be06[_0x3a51('0x40')][_0x3a51('0x9a')]){var _0x22872d=_0x79be06['query']['$gte'][_0x3a51('0x9b')](',');var _0xc2ba8b={};_0xc2ba8b[_0x22872d[0x0]]={'$gte':moment(_0x22872d[0x1])[_0x3a51('0x9c')](_0x3a51('0x9d'))};_0x42c6e5[_0x3a51('0x4b')]=_[_0x3a51('0x4c')](_0x42c6e5[_0x3a51('0x4b')],_0xc2ba8b);}_0x42c6e5=_[_0x3a51('0x4c')]({},_0x42c6e5,_0x79be06[_0x3a51('0x4e')]);return db[_0x3a51('0x99')]['count']({'where':_0x42c6e5[_0x3a51('0x4b')]})[_0x3a51('0x21')](function(_0x41146d){_0x2adcd0['count']=_0x41146d;if(_0x79be06[_0x3a51('0x40')][_0x3a51('0x4f')]){_0x42c6e5[_0x3a51('0x50')]=[{'all':!![]}];}return db[_0x3a51('0x99')][_0x3a51('0x63')](_0x42c6e5);})[_0x3a51('0x21')](function(_0x2c0713){_0x2adcd0['rows']=_0x2c0713;return _0x2adcd0;});}})[_0x3a51('0x21')](respondWithFilteredResult(_0x125b78,_0x42c6e5))['catch'](handleError(_0x125b78,null));};exports[_0x3a51('0x7c')]=function(_0x1ff8b2,_0x6f1223,_0x446731){var _0x57f8e6,_0x212e38={},_0x58009d;if(_0x1ff8b2[_0x3a51('0x5b')]['to']){_0x58009d=_0x1ff8b2['body']['to'][0x0];}return db[_0x3a51('0x3c')][_0x3a51('0x54')]({'where':{'id':_0x1ff8b2['params']['id']},'include':[{'model':db['CmList'],'as':_0x3a51('0x9e'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x58009d},'limit':0x1,'order':[[_0x3a51('0x9f'),_0x3a51('0xa0')]]}]}]})[_0x3a51('0x21')](handleEntityNotFound(_0x6f1223,null))[_0x3a51('0x21')](function(_0x3d6e5f){_0x57f8e6=_0x3d6e5f;if(_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')]&&_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][_0x3a51('0x53')]){for(var _0x3fdff9=0x0;_0x3fdff9<_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][_0x3a51('0x53')];_0x3fdff9+=0x1){_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][_0x3fdff9]={'filename':_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][_0x3fdff9][_0x3a51('0x38')],'id':_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][_0x3fdff9]['id'],'path':path[_0x3a51('0xa2')](config['root'],_0x3a51('0xa3'),_0x1ff8b2['body'][_0x3a51('0xa1')][_0x3fdff9]['basename'])};}}return respondWithRpcPromise(_0x3a51('0xa4'),_0x3a51('0xa4'),{'FaxAccountId':_[_0x3a51('0xa5')](_0x1ff8b2[_0x3a51('0x52')]['id'])?undefined:_0x1ff8b2[_0x3a51('0x52')]['id'],'path':_['isNil'](_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][0x0]['path'])?undefined:_0x1ff8b2[_0x3a51('0x5b')]['attachments'][0x0][_0x3a51('0x6')],'fax':_[_0x3a51('0xa5')](_0x1ff8b2[_0x3a51('0x5b')]['to'][0x0])?undefined:_0x1ff8b2[_0x3a51('0x5b')]['to'][0x0]},client9002);})[_0x3a51('0x21')](function(){if(_0x57f8e6){if(_[_0x3a51('0xa5')](_0x1ff8b2['body'][_0x3a51('0xa6')])){_0x1ff8b2['body']['from']=util['format'](_0x3a51('0xa7'),_0x57f8e6[_0x3a51('0x38')],_0x57f8e6[_0x3a51('0xa8')]);}if(_0x57f8e6[_0x3a51('0x9e')]){if(_0x57f8e6[_0x3a51('0x9e')][_0x3a51('0xa9')][_0x3a51('0x53')]){return _0x57f8e6[_0x3a51('0x9e')][_0x3a51('0xa9')][0x0];}else{return db['CmContact'][_0x3a51('0x55')](_[_0x3a51('0x19')](_0x1ff8b2[_0x3a51('0x5b')],{'firstName':_0x1ff8b2[_0x3a51('0x5b')]['to'][0x0],'phone':_0x1ff8b2[_0x3a51('0x5b')]['to'][0x0],'fax':_0x1ff8b2[_0x3a51('0x5b')]['to'][0x0],'ListId':_0x57f8e6[_0x3a51('0x97')]}));}}else{throw new Error(_0x3a51('0xaa'));}}else{throw new Error(_0x3a51('0xab'));}})[_0x3a51('0x21')](function(_0x40c9e2){if(_0x40c9e2){return db[_0x3a51('0x69')][_0x3a51('0x54')]({'where':{'ContactId':_0x40c9e2['id'],'closed':![],'FaxAccountId':_0x57f8e6['id']}})['then'](function(_0x196c1f){if(_0x196c1f){return[_0x196c1f,![]];}return db[_0x3a51('0x69')]['create']({'UserId':_0x1ff8b2[_0x3a51('0x56')]['id'],'ContactId':_0x40c9e2['id'],'FaxAccountId':_0x57f8e6['id'],'fax':_0x1ff8b2[_0x3a51('0x5b')]['to'][0x0],'firstMsgDirection':_0x3a51('0xac'),'Messages':[_[_0x3a51('0x4c')](_0x1ff8b2['body'],{'read':![],'body':_0x1ff8b2['body']['attachments'][0x0][_0x3a51('0xad')],'FaxAccountId':_0x57f8e6['id'],'UserId':_0x1ff8b2[_0x3a51('0x56')]['id'],'ContactId':_0x40c9e2['id'],'AttachmentId':_0x1ff8b2['body'][_0x3a51('0xa1')][0x0]['id']})]},{'include':[{'model':db[_0x3a51('0x99')],'as':_0x3a51('0xae')}]})[_0x3a51('0x21')](function(_0x466ad1){return[_0x466ad1,!![]];});});}else{throw new Error(_0x3a51('0xaf'));}})['spread'](function(_0x2e6712,_0x139fec){if(_0x139fec){return _0x2e6712;}return db[_0x3a51('0x99')][_0x3a51('0x55')]({'direction':_0x3a51('0xac'),'read':![],'body':_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][0x0]['filename'],'FaxAccountId':_0x57f8e6['id'],'FaxInteractionId':_0x2e6712['id'],'UserId':_0x1ff8b2[_0x3a51('0x56')]['id'],'ContactId':_0x2e6712[_0x3a51('0xb0')],'AttachmentId':_0x1ff8b2[_0x3a51('0x5b')]['attachments'][0x0]['id']})[_0x3a51('0x21')](function(_0xe84609){_0x2e6712['dataValues'][_0x3a51('0xae')]=[];_0x2e6712[_0x3a51('0xb1')][_0x3a51('0xae')][_0x3a51('0x85')](_0xe84609[_0x3a51('0xb1')]);return _0x2e6712;});})['then'](function(_0x3eb358){respondWithRpcPromise(_0x3a51('0xb2'),_0x3a51('0xb2'),{'FaxAccountId':_['isNil'](_0x1ff8b2[_0x3a51('0x52')]['id'])?undefined:_0x1ff8b2[_0x3a51('0x52')]['id'],'path':_[_0x3a51('0xa5')](_0x1ff8b2['body'][_0x3a51('0xa1')][0x0][_0x3a51('0x6')])?undefined:_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][0x0][_0x3a51('0x6')],'fax':_[_0x3a51('0xa5')](_0x1ff8b2['body']['to'][0x0])?undefined:_0x1ff8b2[_0x3a51('0x5b')]['to'][0x0],'AttachmentId':_0x1ff8b2[_0x3a51('0x5b')][_0x3a51('0xa1')][0x0]['id']},client9002)[_0x3a51('0x21')](function(_0xf986af){logger[_0x3a51('0x22')](_0x3a51('0xb3'),_0xf986af);})[_0x3a51('0x2a')](function(_0x47b667){logger[_0x3a51('0x22')](_0x3a51('0xb3'),_0x47b667);});return _0x3eb358;})[_0x3a51('0x21')](respondWithResult(_0x6f1223,null))[_0x3a51('0x2a')](handleError(_0x6f1223,null));};exports[_0x3a51('0xb4')]=function(_0x338413,_0x45688f,_0x41337d){return db['FaxAccount']['find']({'where':{'id':_0x338413[_0x3a51('0x52')]['id']}})['then'](handleEntityNotFound(_0x45688f,null))['then'](function(_0x260caa){if(_0x260caa){return _0x260caa[_0x3a51('0xb4')](_0x338413[_0x3a51('0x5b')]['ids'],_[_0x3a51('0x6a')](_0x338413[_0x3a51('0x5b')],[_0x3a51('0x65'),'id'])||{})[_0x3a51('0xb5')](function(_0x496813){for(var _0x11ec60=0x0;_0x11ec60<_0x338413[_0x3a51('0x5b')]['ids'][_0x3a51('0x53')];_0x11ec60+=0x1){socket[_0x3a51('0xb6')]('userFaxAccount:save',{'UserId':Number(_0x338413[_0x3a51('0x5b')][_0x3a51('0x65')][_0x11ec60]),'FaxAccountId':Number(_0x338413[_0x3a51('0x52')]['id'])});}return _0x496813;});}})[_0x3a51('0x21')](respondWithResult(_0x45688f,null))[_0x3a51('0x2a')](handleError(_0x45688f,null));};exports[_0x3a51('0xb7')]=function(_0x2688e3,_0x5dc217,_0x53eb8e){return db[_0x3a51('0x3c')][_0x3a51('0x54')]({'where':{'id':_0x2688e3[_0x3a51('0x52')]['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x5dc217,null))['then'](function(_0x555087){if(_0x555087){return _0x555087[_0x3a51('0xb7')](_0x2688e3['query'][_0x3a51('0x65')])[_0x3a51('0x21')](function(){if(_[_0x3a51('0xb8')](_0x2688e3['query'][_0x3a51('0x65')])){for(var _0x32384a=0x0;_0x32384a<_0x2688e3['query'][_0x3a51('0x65')][_0x3a51('0x53')];_0x32384a+=0x1){socket[_0x3a51('0xb6')](_0x3a51('0xb9'),{'UserId':Number(_0x2688e3[_0x3a51('0x40')][_0x3a51('0x65')][_0x32384a]),'FaxAccountId':Number(_0x2688e3[_0x3a51('0x52')]['id'])});}}else{socket['emit'](_0x3a51('0xb9'),{'UserId':Number(_0x2688e3[_0x3a51('0x40')]['ids']),'FaxAccountId':Number(_0x2688e3['params']['id'])});}});}})[_0x3a51('0x21')](respondWithStatusCode(_0x5dc217,null))[_0x3a51('0x2a')](handleError(_0x5dc217,null));};exports[_0x3a51('0xba')]=function(_0x128adc,_0x6ba828,_0x198285){var _0x3be964={};var _0x976d6b={};var _0x28bf92;var _0x2c55e1;return db[_0x3a51('0x3c')][_0x3a51('0x61')]({'where':{'id':_0x128adc['params']['id']}})[_0x3a51('0x21')](handleEntityNotFound(_0x6ba828,null))[_0x3a51('0x21')](function(_0x23058d){if(_0x23058d){_0x28bf92=_0x23058d;_0x976d6b[_0x3a51('0x3f')]=_[_0x3a51('0x41')](db[_0x3a51('0x6c')][_0x3a51('0x3d')]);_0x976d6b[_0x3a51('0x40')]=_['keys'](_0x128adc['query']);_0x976d6b[_0x3a51('0x42')]=_[_0x3a51('0x43')](_0x976d6b[_0x3a51('0x3f')],_0x976d6b['query']);_0x3be964['attributes']=_[_0x3a51('0x43')](_0x976d6b[_0x3a51('0x3f')],qs['fields'](_0x128adc[_0x3a51('0x40')][_0x3a51('0x45')]));_0x3be964[_0x3a51('0x44')]=_0x3be964[_0x3a51('0x44')][_0x3a51('0x53')]?_0x3be964[_0x3a51('0x44')]:_0x976d6b[_0x3a51('0x3f')];_0x3be964[_0x3a51('0x47')]=qs[_0x3a51('0x48')](_0x128adc[_0x3a51('0x40')][_0x3a51('0x48')]);_0x3be964[_0x3a51('0x4b')]=qs[_0x3a51('0x42')](_[_0x3a51('0x49')](_0x128adc[_0x3a51('0x40')],_0x976d6b[_0x3a51('0x42')]));if(_0x128adc[_0x3a51('0x40')]['filter']){_0x3be964['where']=_[_0x3a51('0x4c')](_0x3be964[_0x3a51('0x4b')],{'$or':_[_0x3a51('0x3b')](_0x3be964[_0x3a51('0x44')],function(_0xe792ab){var _0x54ccc2={};_0x54ccc2[_0xe792ab]={'$like':'%'+_0x128adc[_0x3a51('0x40')][_0x3a51('0x4a')]+'%'};return _0x54ccc2;})});}_0x3be964=_[_0x3a51('0x4c')]({},_0x3be964,_0x128adc['options']);return _0x28bf92['getAgents'](_0x3be964);}})[_0x3a51('0x21')](function(_0x129ca9){if(_0x129ca9){_0x2c55e1=_0x129ca9['length'];if(!_0x128adc[_0x3a51('0x40')][_0x3a51('0x62')](_0x3a51('0x46'))){_0x3be964['limit']=qs[_0x3a51('0x2d')](_0x128adc[_0x3a51('0x40')]['limit']);_0x3be964[_0x3a51('0x2f')]=qs[_0x3a51('0x2f')](_0x128adc[_0x3a51('0x40')][_0x3a51('0x2f')]);}return _0x28bf92['getAgents'](_0x3be964);}})['then'](function(_0x5b5521){if(_0x5b5521){return _0x5b5521?{'count':_0x2c55e1,'rows':_0x5b5521}:null;}})[_0x3a51('0x21')](respondWithResult(_0x6ba828,null))[_0x3a51('0x2a')](handleError(_0x6ba828,null));}; \ No newline at end of file +var _0xf202=['localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','FaxAccounts','end','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','localstationid','app','system','appdata','push','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','minrate','modem','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','removeAgents','isArray','emit','userFaxAccount:remove','User','rimraf','fast-json-patch','moment','bluebird','mustache','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/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf202,0x174));var _0x2f20=function(_0x52e6bd,_0x1f42d9){_0x52e6bd=_0x52e6bd-0x0;var _0x1d0e6c=_0xf202[_0x52e6bd];return _0x1d0e6c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f20('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f20('0x1'));var rp=require('request-promise');var moment=require(_0x2f20('0x2'));var BPromise=require(_0x2f20('0x3'));var Mustache=require(_0x2f20('0x4'));var util=require(_0x2f20('0x5'));var path=require(_0x2f20('0x6'));var sox=require(_0x2f20('0x7'));var csv=require(_0x2f20('0x8'));var ejs=require(_0x2f20('0x9'));var fs=require('fs');var fs_extra=require(_0x2f20('0xa'));var _=require('lodash');var squel=require(_0x2f20('0xb'));var crypto=require(_0x2f20('0xc'));var jsforce=require(_0x2f20('0xd'));var deskjs=require(_0x2f20('0xe'));var toCsv=require(_0x2f20('0x8'));var querystring=require(_0x2f20('0xf'));var Papa=require('papaparse');var Redis=require(_0x2f20('0x10'));var authService=require(_0x2f20('0x11'));var qs=require(_0x2f20('0x12'));var as=require(_0x2f20('0x13'));var hardwareService=require(_0x2f20('0x14'));var logger=require(_0x2f20('0x15'))('api');var utils=require(_0x2f20('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2f20('0x17'));var db=require('../../mysqldb')['db'];config[_0x2f20('0x18')]=_[_0x2f20('0x19')](config['redis'],{'host':_0x2f20('0x1a'),'port':0x18eb});var socket=require(_0x2f20('0x1b'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x2f20('0x1c')](socket);var jayson=require(_0x2f20('0x1d'));var client=jayson[_0x2f20('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x2f20('0x1e')][_0x2f20('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4fefcb,_0x2b26ec,_0x3aeabf,_0x2ce802){return new BPromise(function(_0x34b68c,_0x54ab2b){var _0x36cd70=_0x2ce802||client;return _0x36cd70[_0x2f20('0x20')](_0x4fefcb,_0x3aeabf)[_0x2f20('0x21')](function(_0x57e549){logger[_0x2f20('0x22')](_0x2f20('0x23'),_0x2b26ec,_0x2f20('0x24'));logger[_0x2f20('0x25')](_0x2f20('0x26'),_0x2b26ec,_0x2f20('0x24'),JSON[_0x2f20('0x27')](_0x57e549));if(_0x57e549[_0x2f20('0x28')]){if(_0x57e549[_0x2f20('0x28')][_0x2f20('0x29')]===0x1f4){logger[_0x2f20('0x28')]('FaxAccount,\x20%s,\x20%s',_0x2b26ec,_0x57e549[_0x2f20('0x28')][_0x2f20('0x2a')]);return _0x54ab2b(_0x57e549[_0x2f20('0x28')]['message']);}logger['error'](_0x2f20('0x23'),_0x2b26ec,_0x57e549['error'][_0x2f20('0x2a')]);return _0x34b68c(_0x57e549[_0x2f20('0x28')][_0x2f20('0x2a')]);}else{logger['info'](_0x2f20('0x23'),_0x2b26ec,_0x2f20('0x24'));_0x34b68c(_0x57e549[_0x2f20('0x2b')][_0x2f20('0x2a')]);}})['catch'](function(_0x2c75b8){logger[_0x2f20('0x28')](_0x2f20('0x23'),_0x2b26ec,_0x2c75b8);_0x54ab2b(_0x2c75b8);});});}function respondWithStatusCode(_0x452bb5,_0x2388b0){_0x2388b0=_0x2388b0||0xcc;return function(_0x58e180){if(_0x58e180){return _0x452bb5[_0x2f20('0x2c')](_0x2388b0);}return _0x452bb5[_0x2f20('0x2d')](_0x2388b0)['end']();};}function respondWithResult(_0x1f78e3,_0x41c3a5){_0x41c3a5=_0x41c3a5||0xc8;return function(_0x35a3ca){if(_0x35a3ca){return _0x1f78e3[_0x2f20('0x2d')](_0x41c3a5)[_0x2f20('0x2e')](_0x35a3ca);}};}function respondWithFilteredResult(_0x36b3d5,_0x38b7e8){return function(_0x213210){if(_0x213210){var _0x47b410=typeof _0x38b7e8[_0x2f20('0x2f')]===_0x2f20('0x30')&&typeof _0x38b7e8[_0x2f20('0x31')]===_0x2f20('0x30');var _0x58e2a8=_0x213210[_0x2f20('0x32')];var _0x46b000=_0x47b410?0x0:_0x38b7e8[_0x2f20('0x2f')];var _0x490924=_0x47b410?_0x213210[_0x2f20('0x32')]:_0x38b7e8[_0x2f20('0x2f')]+_0x38b7e8['limit'];var _0x51108a;if(_0x490924>=_0x58e2a8){_0x490924=_0x58e2a8;_0x51108a=0xc8;}else{_0x51108a=0xce;}_0x36b3d5[_0x2f20('0x2d')](_0x51108a);return _0x36b3d5[_0x2f20('0x33')](_0x2f20('0x34'),_0x46b000+'-'+_0x490924+'/'+_0x58e2a8)[_0x2f20('0x2e')](_0x213210);}return null;};}function patchUpdates(_0x4a3467){return function(_0x1393ee){try{jsonpatch['apply'](_0x1393ee,_0x4a3467,!![]);}catch(_0x8fc251){return BPromise[_0x2f20('0x35')](_0x8fc251);}return _0x1393ee[_0x2f20('0x36')]();};}function saveUpdates(_0x28e4ca,_0x29fc69){return function(_0x5ba73e){if(_0x5ba73e){return _0x5ba73e[_0x2f20('0x37')](_0x28e4ca)['then'](function(_0x4c24cd){return _0x4c24cd;});}return null;};}function removeEntity(_0x297c29,_0x359be5){return function(_0x3a1449){if(_0x3a1449){return _0x3a1449[_0x2f20('0x38')]()[_0x2f20('0x21')](function(){var _0x1e8474=_0x3a1449[_0x2f20('0x39')]({'plain':!![]});var _0x18a9cd=_0x2f20('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x18a9cd,'resourceId':_0x1e8474['id']}})[_0x2f20('0x21')](function(){return _0x3a1449;});})[_0x2f20('0x21')](function(){_0x297c29['status'](0xcc)[_0x2f20('0x3b')]();});}};}function handleEntityNotFound(_0x994f4b,_0x1bb242){return function(_0x44670c){if(!_0x44670c){_0x994f4b[_0x2f20('0x2c')](0x194);}return _0x44670c;};}function handleError(_0x25abcd,_0x23e9be){_0x23e9be=_0x23e9be||0x1f4;return function(_0x55bf4f){logger['error'](_0x55bf4f[_0x2f20('0x3c')]);if(_0x55bf4f['name']){delete _0x55bf4f[_0x2f20('0x3d')];}_0x25abcd['status'](_0x23e9be)['send'](_0x55bf4f);};}exports[_0x2f20('0x3e')]=function(_0x14943c,_0x1d877b){var _0x218da1={'include':[{'model':db[_0x2f20('0x3f')],'as':_0x2f20('0x40')}]},_0x51d9d0={},_0x3ddfee={'count':0x0,'rows':[]};var _0x577203=_[_0x2f20('0x41')](db[_0x2f20('0x42')][_0x2f20('0x43')],function(_0x9af997){return{'name':_0x9af997[_0x2f20('0x44')],'type':_0x9af997['type'][_0x2f20('0x45')]};});_0x51d9d0['model']=_[_0x2f20('0x41')](_0x577203,_0x2f20('0x3d'));_0x51d9d0['query']=_[_0x2f20('0x46')](_0x14943c['query']);_0x51d9d0[_0x2f20('0x47')]=_[_0x2f20('0x48')](_0x51d9d0[_0x2f20('0x49')],_0x51d9d0['query']);_0x218da1[_0x2f20('0x4a')]=_[_0x2f20('0x48')](_0x51d9d0[_0x2f20('0x49')],qs[_0x2f20('0x4b')](_0x14943c[_0x2f20('0x4c')][_0x2f20('0x4b')]));_0x218da1[_0x2f20('0x4a')]=_0x218da1[_0x2f20('0x4a')][_0x2f20('0x4d')]?_0x218da1[_0x2f20('0x4a')]:_0x51d9d0[_0x2f20('0x49')];if(!_0x14943c[_0x2f20('0x4c')][_0x2f20('0x4e')](_0x2f20('0x4f'))){_0x218da1['limit']=qs['limit'](_0x14943c[_0x2f20('0x4c')][_0x2f20('0x31')]);_0x218da1[_0x2f20('0x2f')]=qs[_0x2f20('0x2f')](_0x14943c['query'][_0x2f20('0x2f')]);}_0x218da1[_0x2f20('0x50')]=qs[_0x2f20('0x51')](_0x14943c[_0x2f20('0x4c')][_0x2f20('0x51')]);_0x218da1[_0x2f20('0x52')]=qs[_0x2f20('0x47')](_[_0x2f20('0x53')](_0x14943c[_0x2f20('0x4c')],_0x51d9d0[_0x2f20('0x47')]),_0x577203);if(_0x14943c[_0x2f20('0x4c')][_0x2f20('0x54')]){_0x218da1[_0x2f20('0x52')]=_[_0x2f20('0x55')](_0x218da1['where'],{'$or':_[_0x2f20('0x41')](_0x577203,function(_0x15d80d){if(_0x15d80d[_0x2f20('0x56')]!=='VIRTUAL'){var _0x146ef5={};_0x146ef5[_0x15d80d[_0x2f20('0x3d')]]={'$like':'%'+_0x14943c[_0x2f20('0x4c')][_0x2f20('0x54')]+'%'};return _0x146ef5;}})});}_0x218da1=_['merge']({},_0x218da1,_0x14943c['options']);var _0x766ca={'where':_0x218da1['where']};return db['FaxAccount'][_0x2f20('0x32')](_0x766ca)[_0x2f20('0x21')](function(_0x586e74){_0x3ddfee[_0x2f20('0x32')]=_0x586e74;if(_0x14943c[_0x2f20('0x4c')]['includeAll']){_0x218da1[_0x2f20('0x57')]=[{'all':!![]}];}return db[_0x2f20('0x42')][_0x2f20('0x58')](_0x218da1);})[_0x2f20('0x21')](function(_0x412126){_0x3ddfee[_0x2f20('0x59')]=_0x412126;return _0x3ddfee;})['then'](respondWithFilteredResult(_0x1d877b,_0x218da1))[_0x2f20('0x5a')](handleError(_0x1d877b,null));};exports[_0x2f20('0x5b')]=function(_0x10f578,_0x434953){var _0x16e61f={'raw':![],'where':{'id':_0x10f578[_0x2f20('0x5c')]['id']},'include':[{'model':db[_0x2f20('0x3f')],'as':_0x2f20('0x40')}]},_0x21e25d={};_0x21e25d[_0x2f20('0x49')]=_['keys'](db[_0x2f20('0x42')][_0x2f20('0x43')]);_0x21e25d[_0x2f20('0x4c')]=_[_0x2f20('0x46')](_0x10f578[_0x2f20('0x4c')]);_0x21e25d['filters']=_['intersection'](_0x21e25d[_0x2f20('0x49')],_0x21e25d[_0x2f20('0x4c')]);_0x16e61f[_0x2f20('0x4a')]=_[_0x2f20('0x48')](_0x21e25d[_0x2f20('0x49')],qs[_0x2f20('0x4b')](_0x10f578[_0x2f20('0x4c')][_0x2f20('0x4b')]));_0x16e61f[_0x2f20('0x4a')]=_0x16e61f[_0x2f20('0x4a')]['length']?_0x16e61f[_0x2f20('0x4a')]:_0x21e25d[_0x2f20('0x49')];if(_0x10f578[_0x2f20('0x4c')][_0x2f20('0x5d')]){_0x16e61f['include']=[{'all':!![]}];}_0x16e61f=_[_0x2f20('0x55')]({},_0x16e61f,_0x10f578[_0x2f20('0x5e')]);return db[_0x2f20('0x42')][_0x2f20('0x5f')](_0x16e61f)['then'](handleEntityNotFound(_0x434953,null))[_0x2f20('0x21')](respondWithResult(_0x434953,null))[_0x2f20('0x5a')](handleError(_0x434953,null));};exports['create']=function(_0x180893,_0x3a1c28){return db[_0x2f20('0x42')][_0x2f20('0x60')](_0x180893[_0x2f20('0x61')],{})[_0x2f20('0x21')](function(_0x3cc22b){var _0x464153=_0x180893[_0x2f20('0x62')]['get']({'plain':!![]});if(!_0x464153)throw new Error(_0x2f20('0x63'));if(_0x464153['role']===_0x2f20('0x62')){var _0x137863=_0x3cc22b[_0x2f20('0x39')]({'plain':!![]});var _0x464b45=_0x2f20('0x3a');return db['UserProfileSection'][_0x2f20('0x5f')]({'where':{'name':_0x464b45,'userProfileId':_0x464153[_0x2f20('0x64')]},'raw':!![]})[_0x2f20('0x21')](function(_0x474dbb){if(_0x474dbb&&_0x474dbb[_0x2f20('0x65')]===0x0){return db[_0x2f20('0x66')][_0x2f20('0x60')]({'name':_0x137863[_0x2f20('0x3d')],'resourceId':_0x137863['id'],'type':_0x474dbb['name'],'sectionId':_0x474dbb['id']},{})[_0x2f20('0x21')](function(){return _0x3cc22b;});}else{return _0x3cc22b;}})[_0x2f20('0x5a')](function(_0x4e8876){logger[_0x2f20('0x28')](_0x2f20('0x67'),_0x4e8876);throw _0x4e8876;});}return _0x3cc22b;})[_0x2f20('0x21')](respondWithResult(_0x3a1c28,0xc9))[_0x2f20('0x5a')](handleError(_0x3a1c28,null));};exports[_0x2f20('0x37')]=function(_0xd8a420,_0x3a5bf1){if(_0xd8a420[_0x2f20('0x61')]['id']){delete _0xd8a420[_0x2f20('0x61')]['id'];}return db['FaxAccount'][_0x2f20('0x5f')]({'where':{'id':_0xd8a420[_0x2f20('0x5c')]['id']},'include':[{'model':db[_0x2f20('0x3f')],'as':_0x2f20('0x40')}]})[_0x2f20('0x21')](handleEntityNotFound(_0x3a5bf1,null))[_0x2f20('0x21')](saveUpdates(_0xd8a420[_0x2f20('0x61')],null))[_0x2f20('0x21')](respondWithResult(_0x3a5bf1,null))[_0x2f20('0x5a')](handleError(_0x3a5bf1,null));};exports[_0x2f20('0x38')]=function(_0x29f256,_0x464fb5){return db[_0x2f20('0x42')]['find']({'where':{'id':_0x29f256[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x464fb5,null))[_0x2f20('0x21')](removeEntity(_0x464fb5,null))['catch'](handleError(_0x464fb5,null));};exports[_0x2f20('0x68')]=function(_0x3be826,_0x3db3f7){return db['FaxAccount'][_0x2f20('0x68')]()[_0x2f20('0x21')](respondWithResult(_0x3db3f7,null))[_0x2f20('0x5a')](handleError(_0x3db3f7,null));};exports[_0x2f20('0x69')]=function(_0x211c63,_0xdc6a1a,_0x54fa99){if(_0x211c63[_0x2f20('0x61')]['id']){delete _0x211c63['body']['id'];}return db[_0x2f20('0x42')][_0x2f20('0x5f')]({'where':{'id':_0x211c63['params']['id']}})['then'](handleEntityNotFound(_0xdc6a1a,null))[_0x2f20('0x21')](function(_0x32172b){if(_0x32172b){_0x211c63['body'][_0x2f20('0x6a')]=_0x32172b['id'];return db[_0x2f20('0x6b')]['create'](_0x211c63[_0x2f20('0x61')]);}})[_0x2f20('0x21')](respondWithResult(_0xdc6a1a,null))[_0x2f20('0x5a')](handleError(_0xdc6a1a,null));};exports[_0x2f20('0x6c')]=function(_0x26a115,_0x313ade,_0x33b16d){var _0x1e5f8={'raw':![],'where':{}};var _0x3a61c0={};var _0x49d29a={'count':0x0,'rows':[]};return db[_0x2f20('0x42')][_0x2f20('0x6d')]({'where':{'id':_0x26a115[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x313ade,null))[_0x2f20('0x21')](function(_0x350e5c){if(_0x350e5c){_0x3a61c0[_0x2f20('0x49')]=_[_0x2f20('0x46')](db[_0x2f20('0x6b')]['rawAttributes']);_0x3a61c0['query']=_[_0x2f20('0x46')](_0x26a115['query']);_0x3a61c0[_0x2f20('0x47')]=_[_0x2f20('0x48')](_0x3a61c0[_0x2f20('0x49')],_0x3a61c0[_0x2f20('0x4c')]);_0x1e5f8[_0x2f20('0x4a')]=_[_0x2f20('0x48')](_0x3a61c0[_0x2f20('0x49')],qs['fields'](_0x26a115[_0x2f20('0x4c')][_0x2f20('0x4b')]));_0x1e5f8['attributes']=_0x1e5f8[_0x2f20('0x4a')][_0x2f20('0x4d')]?_0x1e5f8['attributes']:_0x3a61c0[_0x2f20('0x49')];if(!_0x26a115[_0x2f20('0x4c')][_0x2f20('0x4e')](_0x2f20('0x4f'))){_0x1e5f8['limit']=qs[_0x2f20('0x31')](_0x26a115['query'][_0x2f20('0x31')]);_0x1e5f8['offset']=qs[_0x2f20('0x2f')](_0x26a115[_0x2f20('0x4c')]['offset']);}_0x1e5f8[_0x2f20('0x50')]=qs['sort'](_0x26a115[_0x2f20('0x4c')][_0x2f20('0x51')]);_0x1e5f8[_0x2f20('0x52')]=qs[_0x2f20('0x47')](_['pick'](_0x26a115['query'],_0x3a61c0[_0x2f20('0x47')]));_0x1e5f8[_0x2f20('0x52')]['FaxAccountId']=_0x350e5c['id'];if(_0x26a115['query'][_0x2f20('0x54')]){_0x1e5f8['where']=_[_0x2f20('0x55')](_0x1e5f8[_0x2f20('0x52')],{'$or':_[_0x2f20('0x41')](_0x1e5f8[_0x2f20('0x4a')],function(_0x3b1054){var _0x1dfd57={};_0x1dfd57[_0x3b1054]={'$like':'%'+_0x26a115[_0x2f20('0x4c')][_0x2f20('0x54')]+'%'};return _0x1dfd57;})});}_0x1e5f8=_[_0x2f20('0x55')]({},_0x1e5f8,_0x26a115[_0x2f20('0x5e')]);return db['Disposition']['count']({'where':_0x1e5f8[_0x2f20('0x52')]})[_0x2f20('0x21')](function(_0x52b05e){_0x49d29a[_0x2f20('0x32')]=_0x52b05e;if(_0x26a115[_0x2f20('0x4c')][_0x2f20('0x5d')]){_0x1e5f8['include']=[{'all':!![]}];}return db[_0x2f20('0x6b')][_0x2f20('0x58')](_0x1e5f8);})[_0x2f20('0x21')](function(_0x13a583){_0x49d29a['rows']=_0x13a583;return _0x49d29a;});}})[_0x2f20('0x21')](respondWithFilteredResult(_0x313ade,_0x1e5f8))[_0x2f20('0x5a')](handleError(_0x313ade,null));};exports[_0x2f20('0x6e')]=function(_0x4a337a,_0x4c10bb,_0x54a33c){return db[_0x2f20('0x42')][_0x2f20('0x5f')]({'where':{'id':_0x4a337a[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x4c10bb,null))[_0x2f20('0x21')](function(_0x5f1cb8){if(_0x5f1cb8){return _0x5f1cb8[_0x2f20('0x6e')](_0x4a337a[_0x2f20('0x4c')][_0x2f20('0x6f')]);}})[_0x2f20('0x21')](respondWithStatusCode(_0x4c10bb,null))['catch'](handleError(_0x4c10bb,null));};exports[_0x2f20('0x70')]=function(_0x80203a,_0x290d91,_0xeca8dc){if(_0x80203a[_0x2f20('0x61')]['id']){delete _0x80203a[_0x2f20('0x61')]['id'];}return db[_0x2f20('0x42')][_0x2f20('0x5f')]({'where':{'id':_0x80203a[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x290d91,null))[_0x2f20('0x21')](function(_0x49a924){if(_0x49a924){_0x80203a['body'][_0x2f20('0x6a')]=_0x49a924['id'];return db[_0x2f20('0x71')][_0x2f20('0x60')](_0x80203a[_0x2f20('0x61')]);}})[_0x2f20('0x21')](respondWithResult(_0x290d91,null))['catch'](handleError(_0x290d91,null));};exports[_0x2f20('0x72')]=function(_0x335414,_0x5311ae,_0x3db022){var _0x49fee1={'raw':![],'where':{}};var _0xe1789f={};var _0x13a2e9={'count':0x0,'rows':[]};return db[_0x2f20('0x42')][_0x2f20('0x6d')]({'where':{'id':_0x335414[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x5311ae,null))[_0x2f20('0x21')](function(_0x11efce){if(_0x11efce){_0xe1789f[_0x2f20('0x49')]=_['keys'](db[_0x2f20('0x71')][_0x2f20('0x43')]);_0xe1789f['query']=_[_0x2f20('0x46')](_0x335414['query']);_0xe1789f[_0x2f20('0x47')]=_[_0x2f20('0x48')](_0xe1789f['model'],_0xe1789f[_0x2f20('0x4c')]);_0x49fee1[_0x2f20('0x4a')]=_[_0x2f20('0x48')](_0xe1789f[_0x2f20('0x49')],qs['fields'](_0x335414['query'][_0x2f20('0x4b')]));_0x49fee1[_0x2f20('0x4a')]=_0x49fee1[_0x2f20('0x4a')][_0x2f20('0x4d')]?_0x49fee1['attributes']:_0xe1789f[_0x2f20('0x49')];if(!_0x335414[_0x2f20('0x4c')][_0x2f20('0x4e')](_0x2f20('0x4f'))){_0x49fee1[_0x2f20('0x31')]=qs[_0x2f20('0x31')](_0x335414[_0x2f20('0x4c')][_0x2f20('0x31')]);_0x49fee1[_0x2f20('0x2f')]=qs[_0x2f20('0x2f')](_0x335414[_0x2f20('0x4c')][_0x2f20('0x2f')]);}_0x49fee1[_0x2f20('0x50')]=qs[_0x2f20('0x51')](_0x335414['query'][_0x2f20('0x51')]);_0x49fee1[_0x2f20('0x52')]=qs[_0x2f20('0x47')](_[_0x2f20('0x53')](_0x335414['query'],_0xe1789f['filters']));_0x49fee1[_0x2f20('0x52')][_0x2f20('0x6a')]=_0x11efce['id'];if(_0x335414[_0x2f20('0x4c')][_0x2f20('0x54')]){_0x49fee1[_0x2f20('0x52')]=_[_0x2f20('0x55')](_0x49fee1['where'],{'$or':_[_0x2f20('0x41')](_0x49fee1[_0x2f20('0x4a')],function(_0x2994a6){var _0x33c451={};_0x33c451[_0x2994a6]={'$like':'%'+_0x335414['query'][_0x2f20('0x54')]+'%'};return _0x33c451;})});}_0x49fee1=_[_0x2f20('0x55')]({},_0x49fee1,_0x335414[_0x2f20('0x5e')]);return db[_0x2f20('0x71')][_0x2f20('0x32')]({'where':_0x49fee1[_0x2f20('0x52')]})['then'](function(_0x3216cc){_0x13a2e9[_0x2f20('0x32')]=_0x3216cc;if(_0x335414[_0x2f20('0x4c')][_0x2f20('0x5d')]){_0x49fee1[_0x2f20('0x57')]=[{'all':!![]}];}return db[_0x2f20('0x71')][_0x2f20('0x58')](_0x49fee1);})[_0x2f20('0x21')](function(_0x26b60f){_0x13a2e9[_0x2f20('0x59')]=_0x26b60f;return _0x13a2e9;});}})[_0x2f20('0x21')](respondWithFilteredResult(_0x5311ae,_0x49fee1))[_0x2f20('0x5a')](handleError(_0x5311ae,null));};exports['removeAnswers']=function(_0x5561fb,_0x2d1f45,_0x10c31d){return db[_0x2f20('0x42')]['find']({'where':{'id':_0x5561fb[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x2d1f45,null))[_0x2f20('0x21')](function(_0x4dd045){if(_0x4dd045){return _0x4dd045[_0x2f20('0x73')](_0x5561fb[_0x2f20('0x4c')]['ids']);}})[_0x2f20('0x21')](respondWithStatusCode(_0x2d1f45,null))[_0x2f20('0x5a')](handleError(_0x2d1f45,null));};exports[_0x2f20('0x74')]=function(_0x183053,_0x39dbb2,_0x14e0ec){return db[_0x2f20('0x75')][_0x2f20('0x5f')]({'where':{'id':_0x183053[_0x2f20('0x5c')]['id']}})['then'](handleEntityNotFound(_0x39dbb2,null))['then'](function(_0x43c4bb){if(_0x43c4bb){return _0x43c4bb[_0x2f20('0x74')](_0x183053[_0x2f20('0x61')][_0x2f20('0x6f')],_[_0x2f20('0x76')](_0x183053[_0x2f20('0x61')],[_0x2f20('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x39dbb2,null))[_0x2f20('0x5a')](handleError(_0x39dbb2,null));};exports['getInteractions']=function(_0x5b2514,_0xe55ed4,_0x46273c){var _0x56f60a={'raw':![],'where':{}};var _0x25a1f7={};var _0x44ed4a={'count':0x0,'rows':[]};return db[_0x2f20('0x42')]['findOne']({'where':{'id':_0x5b2514[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0xe55ed4,null))[_0x2f20('0x21')](function(_0x17a296){if(_0x17a296){_0x25a1f7[_0x2f20('0x49')]=_[_0x2f20('0x46')](db[_0x2f20('0x75')][_0x2f20('0x43')]);_0x25a1f7['query']=_[_0x2f20('0x46')](_0x5b2514['query']);_0x25a1f7[_0x2f20('0x47')]=_['intersection'](_0x25a1f7['model'],_0x25a1f7['query']);_0x56f60a['attributes']=_[_0x2f20('0x48')](_0x25a1f7[_0x2f20('0x49')],qs['fields'](_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x4b')]));_0x56f60a[_0x2f20('0x4a')]=_0x56f60a[_0x2f20('0x4a')][_0x2f20('0x4d')]?_0x56f60a['attributes']:_0x25a1f7[_0x2f20('0x49')];if(!_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x4e')](_0x2f20('0x4f'))){_0x56f60a[_0x2f20('0x31')]=qs[_0x2f20('0x31')](_0x5b2514['query'][_0x2f20('0x31')]);_0x56f60a[_0x2f20('0x2f')]=qs['offset'](_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x2f')]);}_0x56f60a[_0x2f20('0x50')]=qs[_0x2f20('0x51')](_0x5b2514['query'][_0x2f20('0x51')]);_0x56f60a[_0x2f20('0x52')]=qs[_0x2f20('0x47')](_[_0x2f20('0x53')](_0x5b2514[_0x2f20('0x4c')],_0x25a1f7[_0x2f20('0x47')]));_0x56f60a[_0x2f20('0x52')]['FaxAccountId']=_0x17a296['id'];if(_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x54')]){_0x56f60a['where']=_['merge'](_0x56f60a['where'],{'$or':_[_0x2f20('0x41')](_0x56f60a[_0x2f20('0x4a')],function(_0x8e9724){var _0x1db7bb={};_0x1db7bb[_0x8e9724]={'$like':'%'+_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x54')]+'%'};return _0x1db7bb;})});}_0x56f60a=_[_0x2f20('0x55')]({},_0x56f60a,_0x5b2514['options']);return db[_0x2f20('0x75')][_0x2f20('0x32')]({'where':_0x56f60a[_0x2f20('0x52')]})['then'](function(_0x6798a9){_0x44ed4a[_0x2f20('0x32')]=_0x6798a9;if(_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x5d')]){_0x56f60a[_0x2f20('0x57')]=[{'model':db[_0x2f20('0x77')],'as':_0x2f20('0x78'),'required':![]},{'model':db['User'],'as':_0x2f20('0x79'),'attributes':[_0x2f20('0x3d'),_0x2f20('0x7a'),'internal'],'required':![]},{'model':db[_0x2f20('0x7b')],'as':_0x2f20('0x7c'),'attributes':['id',_0x2f20('0x3d'),_0x2f20('0x7d')],'where':_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x7e')]?{'id':_0x5b2514['query'][_0x2f20('0x7e')]}:undefined,'required':_0x5b2514[_0x2f20('0x4c')][_0x2f20('0x7e')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x56f60a);})[_0x2f20('0x21')](function(_0x3ad80d){_0x44ed4a[_0x2f20('0x59')]=_0x3ad80d;return _0x44ed4a;});}})[_0x2f20('0x21')](respondWithFilteredResult(_0xe55ed4,_0x56f60a))[_0x2f20('0x5a')](handleError(_0xe55ed4,null));};exports[_0x2f20('0x7f')]=function(_0x18c195,_0x2e0d15){var _0x292211=_0x18c195[_0x2f20('0x5c')]['id'];var _0x54d5b0=_0x18c195[_0x2f20('0x61')];var _0x159409=0xc8;var _0x1acb7d=null;return db[_0x2f20('0x80')][_0x2f20('0x81')]({'isolationLevel':db[_0x2f20('0x80')][_0x2f20('0x82')][_0x2f20('0x83')][_0x2f20('0x84')]},function(_0x37fe5d){return db['FaxAccount'][_0x2f20('0x6d')]({'where':{'id':_0x292211},'transaction':_0x37fe5d})['then'](function(_0x355e69){if(_0x355e69){return db[_0x2f20('0x85')][_0x2f20('0x38')]({'where':{'FaxAccountId':_0x292211},'transaction':_0x37fe5d})[_0x2f20('0x21')](function(){var _0x4294e8=_[_0x2f20('0x41')](_0x54d5b0,function(_0xb9a4b1){_0xb9a4b1[_0x2f20('0x6a')]=_0x292211;return _0xb9a4b1;});return db[_0x2f20('0x85')][_0x2f20('0x86')](_0x4294e8,{'transaction':_0x37fe5d});});}else{_0x159409=0x194;_0x1acb7d=[];}});})[_0x2f20('0x21')](function(){if(_0x159409!==0x194){return db['FaxApplication'][_0x2f20('0x87')]({'where':{'FaxAccountId':_0x292211},'order':_0x2f20('0x88')})['then'](function(_0x198270){_0x1acb7d=_0x198270;});}})[_0x2f20('0x5a')](function(_0x45ef10){_0x159409=0x1f4;logger[_0x2f20('0x28')](_0x45ef10[_0x2f20('0x3c')]);if(_0x45ef10[_0x2f20('0x3d')]){delete _0x45ef10[_0x2f20('0x3d')];}_0x1acb7d=_0x45ef10;})[_0x2f20('0x89')](function(){if(_0x1acb7d===null){_0x2e0d15['sendStatus'](_0x159409);}else{if(_0x159409===0x1f4){_0x2e0d15[_0x2f20('0x2d')](_0x159409)[_0x2f20('0x8a')](_0x1acb7d);}else{_0x2e0d15[_0x2f20('0x2d')](_0x159409)[_0x2f20('0x2e')](_0x1acb7d);}}});};exports[_0x2f20('0x8b')]=function(_0x59d9eb,_0x407251,_0x19f11c){var _0x3c03e7={};var _0xb874da={};var _0x35a182;var _0x46ecb4;return db[_0x2f20('0x42')][_0x2f20('0x6d')]({'where':{'id':_0x59d9eb[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x407251,null))[_0x2f20('0x21')](function(_0x5c62e1){if(_0x5c62e1){_0x35a182=_0x5c62e1;_0xb874da[_0x2f20('0x49')]=_[_0x2f20('0x46')](db['FaxApplication'][_0x2f20('0x43')]);_0xb874da[_0x2f20('0x4c')]=_[_0x2f20('0x46')](_0x59d9eb['query']);_0xb874da['filters']=_[_0x2f20('0x48')](_0xb874da['model'],_0xb874da['query']);_0x3c03e7[_0x2f20('0x4a')]=_[_0x2f20('0x48')](_0xb874da[_0x2f20('0x49')],qs[_0x2f20('0x4b')](_0x59d9eb[_0x2f20('0x4c')][_0x2f20('0x4b')]));_0x3c03e7['attributes']=_0x3c03e7[_0x2f20('0x4a')][_0x2f20('0x4d')]?_0x3c03e7[_0x2f20('0x4a')]:_0xb874da[_0x2f20('0x49')];_0x3c03e7['order']=qs['sort'](_0x59d9eb['query'][_0x2f20('0x51')]);_0x3c03e7[_0x2f20('0x52')]=qs[_0x2f20('0x47')](_[_0x2f20('0x53')](_0x59d9eb['query'],_0xb874da[_0x2f20('0x47')]));if(_0x59d9eb[_0x2f20('0x4c')][_0x2f20('0x54')]){_0x3c03e7[_0x2f20('0x52')]=_[_0x2f20('0x55')](_0x3c03e7[_0x2f20('0x52')],{'$or':_[_0x2f20('0x41')](_0x3c03e7[_0x2f20('0x4a')],function(_0x9679a6){var _0x1a240c={};_0x1a240c[_0x9679a6]={'$like':'%'+_0x59d9eb[_0x2f20('0x4c')][_0x2f20('0x54')]+'%'};return _0x1a240c;})});}_0x3c03e7=_['merge']({},_0x3c03e7,_0x59d9eb['options']);return _0x35a182[_0x2f20('0x8b')](_0x3c03e7);}})[_0x2f20('0x21')](function(_0x36927c){if(_0x36927c){_0x46ecb4=_0x36927c[_0x2f20('0x4d')];if(!_0x59d9eb[_0x2f20('0x4c')]['hasOwnProperty'](_0x2f20('0x4f'))){_0x3c03e7[_0x2f20('0x31')]=qs[_0x2f20('0x31')](_0x59d9eb[_0x2f20('0x4c')][_0x2f20('0x31')]);_0x3c03e7[_0x2f20('0x2f')]=qs['offset'](_0x59d9eb[_0x2f20('0x4c')][_0x2f20('0x2f')]);}return _0x35a182['getApplications'](_0x3c03e7);}})['then'](function(_0x435a08){if(_0x435a08){return _0x435a08?{'count':_0x46ecb4,'rows':_0x435a08}:null;}})[_0x2f20('0x21')](respondWithResult(_0x407251,null))[_0x2f20('0x5a')](handleError(_0x407251,null));};function Extension(_0x449faa,_0x50b2f0,_0x3df303,_0x3f82ae){this[_0x2f20('0x8c')]=_0x2f20('0x8d');this['exten']=_0x449faa[_0x2f20('0x8e')];this[_0x2f20('0x8f')]=_0x3f82ae;this[_0x2f20('0x56')]=_0x2f20('0x90');this['description']='Fax\x20Extension';this[_0x2f20('0x6a')]=_0x449faa['id'];this['priority']=_0x50b2f0;this[_0x2f20('0x91')]=_0x3df303;}function createExtensionsReciveFax(_0x2660f0){var _0x3f7b41=0x1;var _0x4ce26d=[];_0x4ce26d[_0x2f20('0x92')](new Extension(_0x2660f0,_0x3f7b41,'','Answer'));_0x3f7b41+=0x1;_0x4ce26d[_0x2f20('0x92')](new Extension(_0x2660f0,_0x3f7b41,_0x2f20('0x93'),'Set'));_0x3f7b41+=0x1;for(var _0x52ce30 in _0x2660f0){if(_0x2660f0['hasOwnProperty'](_0x52ce30)&&(_0x52ce30===_0x2f20('0x94')||_0x52ce30===_0x2f20('0x8e')||_0x52ce30==='gateway'||_0x52ce30===_0x2f20('0x95')||_0x52ce30===_0x2f20('0x96')||_0x52ce30==='maxrate'||_0x52ce30===_0x2f20('0x97')||_0x52ce30===_0x2f20('0x98')||_0x52ce30==='t38timeout')){_0x4ce26d[_0x2f20('0x92')](new Extension(_0x2660f0,_0x3f7b41,_0x2f20('0x99')+_0x52ce30+')='+_0x2660f0[_0x52ce30],_0x2f20('0x9a')));_0x3f7b41+=0x1;}}_0x4ce26d[_0x2f20('0x92')](new Extension(_0x2660f0,_0x3f7b41,'6',_0x2f20('0x9b')));_0x3f7b41+=0x1;_0x4ce26d[_0x2f20('0x92')](new Extension(_0x2660f0,_0x3f7b41,_0x2f20('0x9c'),_0x2f20('0x9d')));_0x3f7b41=0x0;return _0x4ce26d;}exports[_0x2f20('0x9e')]=function(_0x3ae6ef,_0x585716,_0x3dcd1b){var _0x1380ce;return db['sequelize'][_0x2f20('0x81')](function(_0x79fa56){return db[_0x2f20('0x42')][_0x2f20('0x60')](_0x3ae6ef[_0x2f20('0x61')],{'transaction':_0x79fa56})[_0x2f20('0x21')](function(_0x24ab16){_0x1380ce=_0x24ab16[_0x2f20('0x39')]({'plain':!![]});return db['VoiceExtension'][_0x2f20('0x86')](createExtensionsReciveFax(_0x1380ce),{'transaction':_0x79fa56});});})[_0x2f20('0x21')](function(){return _0x1380ce;})[_0x2f20('0x21')](respondWithResult(_0x585716,null))[_0x2f20('0x5a')](handleError(_0x585716,null));};exports[_0x2f20('0x9f')]=function(_0x1532a6,_0x4382fe,_0x5b9bb4){var _0x46916c;return db[_0x2f20('0x80')][_0x2f20('0x81')](function(_0x3fc12e){return db[_0x2f20('0x42')][_0x2f20('0x37')](_0x1532a6[_0x2f20('0x61')],{'where':{'id':_0x1532a6[_0x2f20('0x61')]['id']},'transaction':_0x3fc12e})[_0x2f20('0x21')](function(_0x1b9a62){return db[_0x2f20('0xa0')][_0x2f20('0x38')]({'where':{'FaxAccountId':_0x1532a6[_0x2f20('0x61')]['id']},'transaction':_0x3fc12e})[_0x2f20('0x21')](function(_0x4dd464){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x2f20('0x76')](_0x1532a6[_0x2f20('0x61')],[_0x2f20('0xa1'),_0x2f20('0x45'),'createdAt',_0x2f20('0xa2'),_0x2f20('0xa3'),_0x2f20('0xa4')])),{'transaction':_0x3fc12e});});});})[_0x2f20('0x21')](function(){return db[_0x2f20('0x42')][_0x2f20('0xa5')](_0x1532a6[_0x2f20('0x61')]['id']);})['then'](respondWithResult(_0x4382fe,null))['catch'](handleError(_0x4382fe,null));};exports['getMessages']=function(_0x31960f,_0x43bd20,_0x21da0b){var _0x2ad086={'raw':!![],'where':{}};var _0x23b49e={};var _0x7e5355={'count':0x0,'rows':[]};return db[_0x2f20('0x42')][_0x2f20('0x6d')]({'where':{'id':_0x31960f[_0x2f20('0x5c')]['id']}})['then'](handleEntityNotFound(_0x43bd20,null))[_0x2f20('0x21')](function(_0x2cbbf4){if(_0x2cbbf4){_0x23b49e['model']=_[_0x2f20('0x46')](db[_0x2f20('0xa6')][_0x2f20('0x43')]);_0x23b49e[_0x2f20('0x4c')]=_[_0x2f20('0x46')](_0x31960f['query']);_0x23b49e[_0x2f20('0x47')]=_[_0x2f20('0x48')](_0x23b49e[_0x2f20('0x49')],_0x23b49e['query']);_0x2ad086[_0x2f20('0x4a')]=_[_0x2f20('0x48')](_0x23b49e[_0x2f20('0x49')],qs[_0x2f20('0x4b')](_0x31960f[_0x2f20('0x4c')][_0x2f20('0x4b')]));_0x2ad086[_0x2f20('0x4a')]=_0x2ad086[_0x2f20('0x4a')][_0x2f20('0x4d')]?_0x2ad086[_0x2f20('0x4a')]:_0x23b49e[_0x2f20('0x49')];if(!_0x31960f[_0x2f20('0x4c')][_0x2f20('0x4e')](_0x2f20('0x4f'))){_0x2ad086['limit']=qs[_0x2f20('0x31')](_0x31960f[_0x2f20('0x4c')]['limit']);_0x2ad086[_0x2f20('0x2f')]=qs[_0x2f20('0x2f')](_0x31960f[_0x2f20('0x4c')][_0x2f20('0x2f')]);}_0x2ad086[_0x2f20('0x50')]=qs[_0x2f20('0x51')](_0x31960f[_0x2f20('0x4c')][_0x2f20('0x51')]);_0x2ad086[_0x2f20('0x52')]=qs[_0x2f20('0x47')](_[_0x2f20('0x53')](_0x31960f['query'],_0x23b49e[_0x2f20('0x47')]));_0x2ad086[_0x2f20('0x52')]['FaxAccountId']=_0x2cbbf4['id'];if(_0x31960f[_0x2f20('0x4c')][_0x2f20('0x54')]){_0x2ad086['where']=_[_0x2f20('0x55')](_0x2ad086[_0x2f20('0x52')],{'$or':_['map'](_0x2ad086[_0x2f20('0x4a')],function(_0x5a5a4a){var _0x2b3c89={};_0x2b3c89[_0x5a5a4a]={'$like':'%'+_0x31960f[_0x2f20('0x4c')][_0x2f20('0x54')]+'%'};return _0x2b3c89;})});}if(_0x31960f[_0x2f20('0x4c')][_0x2f20('0xa7')]){var _0x48aeef=_0x31960f['query'][_0x2f20('0xa7')][_0x2f20('0xa8')](',');var _0x378ed9={};_0x378ed9[_0x48aeef[0x0]]={'$gte':moment(_0x48aeef[0x1])[_0x2f20('0xa9')](_0x2f20('0xaa'))};_0x2ad086[_0x2f20('0x52')]=_['merge'](_0x2ad086[_0x2f20('0x52')],_0x378ed9);}_0x2ad086=_[_0x2f20('0x55')]({},_0x2ad086,_0x31960f['options']);return db[_0x2f20('0xa6')][_0x2f20('0x32')]({'where':_0x2ad086[_0x2f20('0x52')]})[_0x2f20('0x21')](function(_0x8965cf){_0x7e5355['count']=_0x8965cf;if(_0x31960f[_0x2f20('0x4c')]['includeAll']){_0x2ad086[_0x2f20('0x57')]=[{'all':!![]}];}return db[_0x2f20('0xa6')][_0x2f20('0x58')](_0x2ad086);})[_0x2f20('0x21')](function(_0x534c6f){_0x7e5355[_0x2f20('0x59')]=_0x534c6f;return _0x7e5355;});}})[_0x2f20('0x21')](respondWithFilteredResult(_0x43bd20,_0x2ad086))[_0x2f20('0x5a')](handleError(_0x43bd20,null));};exports[_0x2f20('0x8a')]=function(_0x4ebdfe,_0x180edb,_0xba4fed){var _0x5693e7,_0x569687={},_0x990e6f;if(_0x4ebdfe[_0x2f20('0x61')]['to']){_0x990e6f=_0x4ebdfe[_0x2f20('0x61')]['to'][0x0];}return db[_0x2f20('0x42')][_0x2f20('0x5f')]({'where':{'id':_0x4ebdfe['params']['id']},'include':[{'model':db[_0x2f20('0xab')],'as':'List','include':[{'model':db['CmContact'],'as':_0x2f20('0xac'),'where':{'fax':_0x990e6f},'limit':0x1,'order':[[_0x2f20('0xa2'),_0x2f20('0xad')]]}]}]})[_0x2f20('0x21')](handleEntityNotFound(_0x180edb,null))['then'](function(_0x77b769){_0x5693e7=_0x77b769;if(_0x4ebdfe[_0x2f20('0x61')]['attachments']&&_0x4ebdfe['body'][_0x2f20('0xae')]['length']){for(var _0x278a0c=0x0;_0x278a0c<_0x4ebdfe[_0x2f20('0x61')]['attachments'][_0x2f20('0x4d')];_0x278a0c+=0x1){_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][_0x278a0c]={'filename':_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][_0x278a0c][_0x2f20('0x3d')],'id':_0x4ebdfe['body'][_0x2f20('0xae')][_0x278a0c]['id'],'path':path[_0x2f20('0xaf')](config[_0x2f20('0xb0')],_0x2f20('0xb1'),_0x4ebdfe[_0x2f20('0x61')]['attachments'][_0x278a0c][_0x2f20('0xb2')])};}}return respondWithRpcPromise(_0x2f20('0xb3'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x4ebdfe[_0x2f20('0x5c')]['id'])?undefined:_0x4ebdfe[_0x2f20('0x5c')]['id'],'path':_[_0x2f20('0xb4')](_0x4ebdfe['body'][_0x2f20('0xae')][0x0][_0x2f20('0x6')])?undefined:_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][0x0][_0x2f20('0x6')],'fax':_[_0x2f20('0xb4')](_0x4ebdfe['body']['to'][0x0])?undefined:_0x4ebdfe[_0x2f20('0x61')]['to'][0x0]},client9002);})[_0x2f20('0x21')](function(){if(_0x5693e7){if(_['isNil'](_0x4ebdfe['body'][_0x2f20('0xb5')])){_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xb5')]=util[_0x2f20('0xa9')]('\x22%s\x22\x20<%s>',_0x5693e7[_0x2f20('0x3d')],_0x5693e7[_0x2f20('0xb6')]);}if(_0x5693e7[_0x2f20('0xb7')]){if(_0x5693e7[_0x2f20('0xb7')][_0x2f20('0xac')]['length']){return _0x5693e7[_0x2f20('0xb7')][_0x2f20('0xac')][0x0];}else{return db[_0x2f20('0x77')][_0x2f20('0x60')](_['defaults'](_0x4ebdfe[_0x2f20('0x61')],{'firstName':_0x4ebdfe[_0x2f20('0x61')]['to'][0x0],'phone':_0x4ebdfe[_0x2f20('0x61')]['to'][0x0],'fax':_0x4ebdfe[_0x2f20('0x61')]['to'][0x0],'ListId':_0x5693e7['ListId']}));}}else{throw new Error(_0x2f20('0xb8'));}}else{throw new Error(_0x2f20('0xb9'));}})[_0x2f20('0x21')](function(_0x297869){if(_0x297869){return db[_0x2f20('0x75')][_0x2f20('0x5f')]({'where':{'ContactId':_0x297869['id'],'closed':![],'FaxAccountId':_0x5693e7['id']}})[_0x2f20('0x21')](function(_0x54f4b3){if(_0x54f4b3){return[_0x54f4b3,![]];}return db[_0x2f20('0x75')]['create']({'UserId':_0x4ebdfe[_0x2f20('0x62')]['id'],'ContactId':_0x297869['id'],'FaxAccountId':_0x5693e7['id'],'fax':_0x4ebdfe[_0x2f20('0x61')]['to'][0x0],'firstMsgDirection':_0x2f20('0xba'),'Messages':[_[_0x2f20('0x55')](_0x4ebdfe[_0x2f20('0x61')],{'read':![],'body':_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][0x0][_0x2f20('0xbb')],'FaxAccountId':_0x5693e7['id'],'UserId':_0x4ebdfe['user']['id'],'ContactId':_0x297869['id'],'AttachmentId':_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][0x0]['id']})]},{'include':[{'model':db[_0x2f20('0xa6')],'as':'Messages'}]})[_0x2f20('0x21')](function(_0x1bb7c4){return[_0x1bb7c4,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5e5b31,_0x1a8f0a){if(_0x1a8f0a){return _0x5e5b31;}return db[_0x2f20('0xa6')][_0x2f20('0x60')]({'direction':'out','read':![],'body':_0x4ebdfe[_0x2f20('0x61')]['attachments'][0x0][_0x2f20('0xbb')],'FaxAccountId':_0x5693e7['id'],'FaxInteractionId':_0x5e5b31['id'],'UserId':_0x4ebdfe['user']['id'],'ContactId':_0x5e5b31[_0x2f20('0xbc')],'AttachmentId':_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][0x0]['id']})[_0x2f20('0x21')](function(_0x4f21a5){_0x5e5b31[_0x2f20('0xbd')]['Messages']=[];_0x5e5b31[_0x2f20('0xbd')]['Messages'][_0x2f20('0x92')](_0x4f21a5['dataValues']);return _0x5e5b31;});})['then'](function(_0x1d1ec1){respondWithRpcPromise(_0x2f20('0xbe'),'SendFax',{'FaxAccountId':_['isNil'](_0x4ebdfe[_0x2f20('0x5c')]['id'])?undefined:_0x4ebdfe['params']['id'],'path':_[_0x2f20('0xb4')](_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][0x0][_0x2f20('0x6')])?undefined:_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][0x0]['path'],'fax':_['isNil'](_0x4ebdfe[_0x2f20('0x61')]['to'][0x0])?undefined:_0x4ebdfe[_0x2f20('0x61')]['to'][0x0],'AttachmentId':_0x4ebdfe[_0x2f20('0x61')][_0x2f20('0xae')][0x0]['id']},client9002)[_0x2f20('0x21')](function(_0x225b5e){logger[_0x2f20('0x22')](_0x2f20('0xbf'),_0x225b5e);})['catch'](function(_0x3ee73d){logger['info'](_0x2f20('0xbf'),_0x3ee73d);});return _0x1d1ec1;})[_0x2f20('0x21')](respondWithResult(_0x180edb,null))[_0x2f20('0x5a')](handleError(_0x180edb,null));};exports[_0x2f20('0xc0')]=function(_0x2d40f8,_0x1966a7,_0x5d3b70){return db['FaxAccount'][_0x2f20('0x5f')]({'where':{'id':_0x2d40f8[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x1966a7,null))[_0x2f20('0x21')](function(_0x2c9b82){if(_0x2c9b82){return _0x2c9b82[_0x2f20('0xc0')](_0x2d40f8['body']['ids'],_[_0x2f20('0x76')](_0x2d40f8[_0x2f20('0x61')],['ids','id'])||{})[_0x2f20('0xc1')](function(_0x1ec6e8){for(var _0x3a426a=0x0;_0x3a426a<_0x2d40f8[_0x2f20('0x61')][_0x2f20('0x6f')][_0x2f20('0x4d')];_0x3a426a+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x2d40f8[_0x2f20('0x61')][_0x2f20('0x6f')][_0x3a426a]),'FaxAccountId':Number(_0x2d40f8[_0x2f20('0x5c')]['id'])});}return _0x1ec6e8;});}})['then'](respondWithResult(_0x1966a7,null))[_0x2f20('0x5a')](handleError(_0x1966a7,null));};exports[_0x2f20('0xc2')]=function(_0x124c7a,_0x42d678,_0x45e82e){return db[_0x2f20('0x42')][_0x2f20('0x5f')]({'where':{'id':_0x124c7a[_0x2f20('0x5c')]['id']}})[_0x2f20('0x21')](handleEntityNotFound(_0x42d678,null))[_0x2f20('0x21')](function(_0x10c954){if(_0x10c954){return _0x10c954[_0x2f20('0xc2')](_0x124c7a['query']['ids'])[_0x2f20('0x21')](function(){if(_[_0x2f20('0xc3')](_0x124c7a[_0x2f20('0x4c')][_0x2f20('0x6f')])){for(var _0x56b59f=0x0;_0x56b59f<_0x124c7a[_0x2f20('0x4c')][_0x2f20('0x6f')][_0x2f20('0x4d')];_0x56b59f+=0x1){socket[_0x2f20('0xc4')](_0x2f20('0xc5'),{'UserId':Number(_0x124c7a[_0x2f20('0x4c')][_0x2f20('0x6f')][_0x56b59f]),'FaxAccountId':Number(_0x124c7a[_0x2f20('0x5c')]['id'])});}}else{socket['emit'](_0x2f20('0xc5'),{'UserId':Number(_0x124c7a[_0x2f20('0x4c')][_0x2f20('0x6f')]),'FaxAccountId':Number(_0x124c7a['params']['id'])});}});}})[_0x2f20('0x21')](respondWithStatusCode(_0x42d678,null))[_0x2f20('0x5a')](handleError(_0x42d678,null));};exports['getAgents']=function(_0x9b43f6,_0x16c7ab,_0x2f827f){var _0x518c0d={};var _0x28f2b8={};var _0x138b7a;var _0x10b13a;return db[_0x2f20('0x42')][_0x2f20('0x6d')]({'where':{'id':_0x9b43f6[_0x2f20('0x5c')]['id']}})['then'](handleEntityNotFound(_0x16c7ab,null))[_0x2f20('0x21')](function(_0x5b3d8c){if(_0x5b3d8c){_0x138b7a=_0x5b3d8c;_0x28f2b8['model']=_['keys'](db[_0x2f20('0xc6')][_0x2f20('0x43')]);_0x28f2b8[_0x2f20('0x4c')]=_[_0x2f20('0x46')](_0x9b43f6[_0x2f20('0x4c')]);_0x28f2b8[_0x2f20('0x47')]=_['intersection'](_0x28f2b8[_0x2f20('0x49')],_0x28f2b8[_0x2f20('0x4c')]);_0x518c0d[_0x2f20('0x4a')]=_[_0x2f20('0x48')](_0x28f2b8[_0x2f20('0x49')],qs[_0x2f20('0x4b')](_0x9b43f6[_0x2f20('0x4c')][_0x2f20('0x4b')]));_0x518c0d[_0x2f20('0x4a')]=_0x518c0d['attributes'][_0x2f20('0x4d')]?_0x518c0d['attributes']:_0x28f2b8[_0x2f20('0x49')];_0x518c0d[_0x2f20('0x50')]=qs['sort'](_0x9b43f6['query'][_0x2f20('0x51')]);_0x518c0d['where']=qs['filters'](_['pick'](_0x9b43f6[_0x2f20('0x4c')],_0x28f2b8[_0x2f20('0x47')]));if(_0x9b43f6['query'][_0x2f20('0x54')]){_0x518c0d['where']=_[_0x2f20('0x55')](_0x518c0d[_0x2f20('0x52')],{'$or':_[_0x2f20('0x41')](_0x518c0d['attributes'],function(_0x2dcee2){var _0x25d9d8={};_0x25d9d8[_0x2dcee2]={'$like':'%'+_0x9b43f6[_0x2f20('0x4c')][_0x2f20('0x54')]+'%'};return _0x25d9d8;})});}_0x518c0d=_[_0x2f20('0x55')]({},_0x518c0d,_0x9b43f6['options']);return _0x138b7a['getAgents'](_0x518c0d);}})[_0x2f20('0x21')](function(_0x302f53){if(_0x302f53){_0x10b13a=_0x302f53['length'];if(!_0x9b43f6[_0x2f20('0x4c')]['hasOwnProperty'](_0x2f20('0x4f'))){_0x518c0d[_0x2f20('0x31')]=qs[_0x2f20('0x31')](_0x9b43f6[_0x2f20('0x4c')][_0x2f20('0x31')]);_0x518c0d['offset']=qs[_0x2f20('0x2f')](_0x9b43f6[_0x2f20('0x4c')][_0x2f20('0x2f')]);}return _0x138b7a['getAgents'](_0x518c0d);}})['then'](function(_0x4cfc7e){if(_0x4cfc7e){return _0x4cfc7e?{'count':_0x10b13a,'rows':_0x4cfc7e}:null;}})[_0x2f20('0x21')](respondWithResult(_0x16c7ab,null))[_0x2f20('0x5a')](handleError(_0x16c7ab,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 91c7f3d..ff50188 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 _0xbb8b=['update','remove','emit','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x1f2f7c,_0x26190c){var _0x4aa2db=function(_0x18c40c){while(--_0x18c40c){_0x1f2f7c['push'](_0x1f2f7c['shift']());}};_0x4aa2db(++_0x26190c);}(_0xbb8b,0x101));var _0xbbb8=function(_0x253274,_0x2025b0){_0x253274=_0x253274-0x0;var _0x5cb5d9=_0xbb8b[_0x253274];return _0x5cb5d9;};'use strict';var EventEmitter=require(_0xbbb8('0x0'));var FaxAccount=require(_0xbbb8('0x1'))['db'][_0xbbb8('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbbb8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbbb8('0x4'),'afterDestroy':_0xbbb8('0x5')};function emitEvent(_0x2813df){return function(_0x1921e0,_0x376fcb,_0x526a38){FaxAccountEvents[_0xbbb8('0x6')](_0x2813df+':'+_0x1921e0['id'],_0x1921e0);FaxAccountEvents[_0xbbb8('0x6')](_0x2813df,_0x1921e0);_0x526a38(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xbbb8('0x7')](e,emitEvent(event));}}module[_0xbbb8('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xf234=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x4bc820,_0x291096){var _0x336570=function(_0x48ae22){while(--_0x48ae22){_0x4bc820['push'](_0x4bc820['shift']());}};_0x336570(++_0x291096);}(_0xf234,0xeb));var _0x4f23=function(_0x282796,_0x217005){_0x282796=_0x282796-0x0;var _0x1a755f=_0xf234[_0x282796];return _0x1a755f;};'use strict';var EventEmitter=require(_0x4f23('0x0'));var FaxAccount=require(_0x4f23('0x1'))['db'][_0x4f23('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4f23('0x3')](0x0);var events={'afterCreate':_0x4f23('0x4'),'afterUpdate':_0x4f23('0x5'),'afterDestroy':_0x4f23('0x6')};function emitEvent(_0x15de96){return function(_0x4867e2,_0x396788,_0x171524){FaxAccountEvents[_0x4f23('0x7')](_0x15de96+':'+_0x4867e2['id'],_0x4867e2);FaxAccountEvents[_0x4f23('0x7')](_0x15de96,_0x4867e2);_0x171524(null);};}for(var e in events){if(events[_0x4f23('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x4f23('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 507d51c..53f3faa 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 _0xadc3=['rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0xadc3,0x132));var _0x3adc=function(_0x3612e1,_0x36da66){_0x3612e1=_0x3612e1-0x0;var _0x5a3177=_0xadc3[_0x3612e1];return _0x5a3177;};'use strict';var _=require(_0x3adc('0x0'));var util=require(_0x3adc('0x1'));var logger=require('../../config/logger')(_0x3adc('0x2'));var moment=require(_0x3adc('0x3'));var BPromise=require(_0x3adc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3adc('0x5'));var rimraf=require(_0x3adc('0x6'));var config=require(_0x3adc('0x7'));var attributes=require('./faxAccount.attributes');module[_0x3adc('0x8')]=function(_0x11bded,_0x285da7){return _0x11bded[_0x3adc('0x9')](_0x3adc('0xa'),attributes,{'tableName':_0x3adc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b4b=['FaxAccount','fax_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x6b9f13,_0x243e7d){var _0x2e6e15=function(_0x44eb61){while(--_0x44eb61){_0x6b9f13['push'](_0x6b9f13['shift']());}};_0x2e6e15(++_0x243e7d);}(_0x6b4b,0x1d6));var _0xb6b4=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x6b4b[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xb6b4('0x0'));var util=require(_0xb6b4('0x1'));var logger=require(_0xb6b4('0x2'))(_0xb6b4('0x3'));var moment=require('moment');var BPromise=require(_0xb6b4('0x4'));var rp=require(_0xb6b4('0x5'));var fs=require('fs');var path=require(_0xb6b4('0x6'));var rimraf=require(_0xb6b4('0x7'));var config=require(_0xb6b4('0x8'));var attributes=require('./faxAccount.attributes');module[_0xb6b4('0x9')]=function(_0x52d158,_0x408d26){return _0x52d158['define'](_0xb6b4('0xa'),attributes,{'tableName':_0xb6b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 9166db2..995a768 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 _0xe48b=['ListId','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','create','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queue','waitForTheAssignedQueue','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','redis','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetFaxAccount','options','limit','map','include','model','attributes','NotifyFaxAccount','fax','CmContact','describe','difference','keys','updatedAt','CompanyId','body','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','orderBy','priority','asc','Contacts','length','defaults'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0xe48b,0x70));var _0xbe48=function(_0x382985,_0x2bc70f){_0x382985=_0x382985-0x0;var _0x268ef8=_0xe48b[_0x382985];return _0x268ef8;};'use strict';var _=require(_0xbe48('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbe48('0x1'));var rs=require(_0xbe48('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe48('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe48('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbe48('0x5')][_0xbe48('0x6')]({'port':0x232c});config[_0xbe48('0x7')]=_['defaults'](config[_0xbe48('0x7')],{'host':_0xbe48('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe48('0x7')]));require('./faxAccount.socket')[_0xbe48('0x9')](socket);function respondWithRpcPromise(_0x73cbeb,_0x5c2ba5,_0x1819d7){return new BPromise(function(_0x1631de,_0x486ac2){return client[_0xbe48('0xa')](_0x73cbeb,_0x1819d7)[_0xbe48('0xb')](function(_0x16e512){logger[_0xbe48('0xc')](_0xbe48('0xd'),_0x5c2ba5,_0xbe48('0xe'));logger[_0xbe48('0xf')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5c2ba5,'request\x20sent',JSON[_0xbe48('0x10')](_0x16e512));if(_0x16e512['error']){if(_0x16e512[_0xbe48('0x11')]['code']===0x1f4){logger[_0xbe48('0x11')]('FaxAccount,\x20%s,\x20%s',_0x5c2ba5,_0x16e512[_0xbe48('0x11')][_0xbe48('0x12')]);return _0x486ac2(_0x16e512[_0xbe48('0x11')][_0xbe48('0x12')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x5c2ba5,_0x16e512[_0xbe48('0x11')][_0xbe48('0x12')]);return _0x1631de(_0x16e512[_0xbe48('0x11')][_0xbe48('0x12')]);}else{logger[_0xbe48('0xc')](_0xbe48('0xd'),_0x5c2ba5,_0xbe48('0xe'));_0x1631de(_0x16e512[_0xbe48('0x13')]['message']);}})[_0xbe48('0x14')](function(_0x285915){logger[_0xbe48('0x11')](_0xbe48('0xd'),_0x5c2ba5,_0x285915);_0x486ac2(_0x285915);});});}exports[_0xbe48('0x15')]=function(_0x592482){var _0x2ea0be=this;return new Promise(function(_0x5c7ae4,_0x1a37e5){return db['FaxAccount']['findAll']({'raw':_0x592482[_0xbe48('0x16')]?_0x592482[_0xbe48('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x592482['options']?_0x592482[_0xbe48('0x16')]['where']||null:null,'attributes':_0x592482[_0xbe48('0x16')]?_0x592482[_0xbe48('0x16')]['attributes']||null:null,'limit':_0x592482[_0xbe48('0x16')]?_0x592482[_0xbe48('0x16')][_0xbe48('0x17')]||null:null,'include':_0x592482[_0xbe48('0x16')]?_0x592482[_0xbe48('0x16')]['include']?_[_0xbe48('0x18')](_0x592482[_0xbe48('0x16')][_0xbe48('0x19')],function(_0x532034){return{'model':db[_0x532034[_0xbe48('0x1a')]],'as':_0x532034['as'],'attributes':_0x532034['attributes'],'include':_0x532034['include']?_[_0xbe48('0x18')](_0x532034[_0xbe48('0x19')],function(_0x56f1c4){return{'model':db[_0x56f1c4[_0xbe48('0x1a')]],'as':_0x56f1c4['as'],'attributes':_0x56f1c4[_0xbe48('0x1b')],'include':_0x56f1c4[_0xbe48('0x19')]?_[_0xbe48('0x18')](_0x56f1c4['include'],function(_0x21c933){return{'model':db[_0x21c933[_0xbe48('0x1a')]],'as':_0x21c933['as'],'attributes':_0x21c933['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe48('0xb')](function(_0x588b0c){logger[_0xbe48('0xc')](_0xbe48('0x15'),_0x592482);logger[_0xbe48('0xf')](_0xbe48('0x15'),_0x592482,JSON[_0xbe48('0x10')](_0x588b0c));_0x5c7ae4(_0x588b0c);})[_0xbe48('0x14')](function(_0x3df99e){logger['error'](_0xbe48('0x15'),_0x3df99e['message'],_0x592482);_0x1a37e5(_0x2ea0be['error'](0x1f4,_0x3df99e[_0xbe48('0x12')]));});});};exports[_0xbe48('0x1c')]=function(_0x1c3d53,_0x515289,_0x488894){var _0x135cf8=this;return new Promise(function(_0x2c4457,_0x520135){var _0x481123={'body':_0x1c3d53['body'],'channel':_0xbe48('0x1d')};var _0x56aa91=[];var _0x19cfde=[];var _0x36ffce={};return db[_0xbe48('0x1e')][_0xbe48('0x1f')]()['then'](function(_0x589113){if(!_0x589113){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x56aa91=_[_0xbe48('0x20')](_[_0xbe48('0x21')](_0x589113),['createdAt',_0xbe48('0x22')]);_0x19cfde=_[_0xbe48('0x20')](_[_0xbe48('0x21')](_0x589113),['createdAt',_0xbe48('0x22'),_0xbe48('0x23'),'ListId']);if(_0x1c3d53[_0xbe48('0x24')]['id']){delete _0x1c3d53[_0xbe48('0x24')]['id'];}if(_[_0xbe48('0x25')](_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x26')])){throw new db[(_0xbe48('0x27'))][(_0xbe48('0x28'))](_0xbe48('0x29'));}if(_[_0xbe48('0x25')](_0x1c3d53['body'][_0xbe48('0x24')])||_0x1c3d53['body'][_0xbe48('0x24')]===''){throw new db[(_0xbe48('0x27'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x2a')])){throw new db[(_0xbe48('0x27'))][(_0xbe48('0x28'))](_0xbe48('0x2b')+_0x19cfde);}if(!_[_0xbe48('0x2c')](_0x19cfde,_0x1c3d53['body']['mapKey'])){throw new db['Sequelize'][(_0xbe48('0x28'))](_0xbe48('0x2d')+_0x19cfde);}_0x36ffce[_0x1c3d53[_0xbe48('0x24')]['mapKey']]=_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x26')];})['then'](function(){return db[_0xbe48('0x2e')][_0xbe48('0x2f')]({'where':{'id':_0x1c3d53[_0xbe48('0x30')]['id']},'include':[{'model':db[_0xbe48('0x31')],'as':_0xbe48('0x32'),'include':[{'model':db[_0xbe48('0x1e')],'as':'Contacts','where':_0x36ffce,'limit':0x1,'order':[[_0xbe48('0x22'),_0xbe48('0x33')]]}]},{'model':db[_0xbe48('0x34')],'as':_0xbe48('0x35')}]});})[_0xbe48('0xb')](function(_0x4e6b8f){if(_0x4e6b8f&&_0x4e6b8f['List']){var _0x42f592=_0x4e6b8f[_0xbe48('0x36')]({'plain':!![]});_0x481123[_0xbe48('0x30')]=_0x42f592;_0x481123[_0xbe48('0x37')]=_0x42f592[_0xbe48('0x35')];_0x481123['list']=_0x42f592[_0xbe48('0x32')];_0x481123[_0xbe48('0x37')]=_[_0xbe48('0x38')](_0x481123[_0xbe48('0x37')],[_0xbe48('0x39')],[_0xbe48('0x3a')]);if(_0x481123[_0xbe48('0x30')][_0xbe48('0x35')]){delete _0x481123['account'][_0xbe48('0x35')];}if(_0x481123[_0xbe48('0x30')][_0xbe48('0x32')]&&_0x481123['account'][_0xbe48('0x32')][_0xbe48('0x3b')][_0xbe48('0x3c')]){return _0x481123[_0xbe48('0x30')][_0xbe48('0x32')][_0xbe48('0x3b')][0x0];}var _0x397110=_[_0xbe48('0x3d')](_0x1c3d53[_0xbe48('0x24')],{'firstName':_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x26')],'ListId':_0x42f592[_0xbe48('0x3e')]});_0x397110[_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x2a')]]=_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x26')];return db[_0xbe48('0x1e')]['create'](_0x397110,{'fields':_0x56aa91,'raw':!![]});}})['then'](function(_0x1b2e8b){_0x481123[_0xbe48('0x3f')]=_0x1b2e8b;if(_0x1b2e8b){var _0x2bd6dd={'ContactId':_0x1b2e8b['id'],'FaxAccountId':_0x1c3d53[_0xbe48('0x30')]['id'],'fax':_0x1b2e8b['fax']};return db[_0xbe48('0x40')][_0xbe48('0x2f')]({'where':{'ContactId':_0x1b2e8b['id'],'closed':![],'FaxAccountId':_0x1c3d53[_0xbe48('0x30')]['id']}})[_0xbe48('0xb')](function(_0x284ecc){if(_0x284ecc){return[_0x284ecc,![]];}return db[_0xbe48('0x40')]['create'](_0x2bd6dd)[_0xbe48('0xb')](function(_0x16d5eb){return[_0x16d5eb,!![]];});});}else{throw new Error(_0xbe48('0x41'));}})[_0xbe48('0x42')](function(_0xc91a49,_0x4b20d3){var _0x17dd1c=_0xc91a49['get']({'plain':!![]});if(_0x4b20d3){if(_0x481123[_0xbe48('0x30')][_0xbe48('0x43')]){_0x481123['applications'][_0xbe48('0x44')]({'id':0x0,'priority':_0x481123[_0xbe48('0x37')]['length']+0x1,'app':_0xbe48('0x45'),'appdata':_0xbe48('0x46'),'interval':_0xbe48('0x47')});}_0x17dd1c[_0xbe48('0x48')]=!![];}else{_0x17dd1c[_0xbe48('0x48')]=![];}_0x481123['interaction']=_0x17dd1c;return db['FaxMessage'][_0xbe48('0x49')]({'body':_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x24')],'FaxAccountId':_0x1c3d53['account']['id'],'FaxInteractionId':_0xc91a49['id'],'direction':'in','ContactId':_0xc91a49[_0xbe48('0x4a')],'AttachmentId':_0x1c3d53[_0xbe48('0x24')][_0xbe48('0x4b')]});})[_0xbe48('0xb')](function(_0x15e9f6){_0x481123[_0xbe48('0x12')]=_0x15e9f6;if(!_0x481123[_0xbe48('0x4c')][_0xbe48('0x4d')])return;return db[_0xbe48('0x4e')]['find']({'attributes':['id',_0xbe48('0x4f')],'where':{'id':_0x481123[_0xbe48('0x4c')][_0xbe48('0x4d')]}});})[_0xbe48('0xb')](function(_0x5832d4){if(_0x5832d4){_0x481123[_0xbe48('0x37')][_0xbe48('0x50')]({'id':0x0,'priority':0x0,'app':_0xbe48('0x51'),'appdata':_0x5832d4[_0xbe48('0x4f')]+','+(_0x481123['account'][_0xbe48('0x52')]||0xa),'interval':'*,*,*,*'});}if(!_0x481123[_0xbe48('0x4c')]['queueId'])return;return db['FaxQueue'][_0xbe48('0x2f')]({'attributes':['id',_0xbe48('0x4f')],'where':{'id':_0x481123[_0xbe48('0x4c')]['queueId']}});})[_0xbe48('0xb')](function(_0x3c92b7){if(_0x3c92b7){_0x481123[_0xbe48('0x37')][_0xbe48('0x50')]({'id':0x0,'priority':0x1,'app':_0xbe48('0x53'),'appdata':_0x3c92b7[_0xbe48('0x4f')]+','+(_0x481123[_0xbe48('0x30')][_0xbe48('0x54')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbe48('0x55'),_0xbe48('0x56'),_0x481123);})[_0xbe48('0xb')](function(_0x4b8448){_0x2c4457(_0x4b8448);})['catch'](function(_0xd4d654){_0x520135(_0x135cf8['error'](0x1f4,_0xd4d654['message']));});});}; \ No newline at end of file +var _0x9c9c=['queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','DESC','FaxApplication','Applications','get','list','applications','orderBy','asc','Contacts','length','defaults','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','User','interaction','UserId','unshift','name','waitForTheAssignedAgent','FaxQueue','queueId'];(function(_0x234ef1,_0x235c1d){var _0x324237=function(_0x502497){while(--_0x502497){_0x234ef1['push'](_0x234ef1['shift']());}};_0x324237(++_0x235c1d);}(_0x9c9c,0xc8));var _0xc9c9=function(_0x146beb,_0x57b1f4){_0x146beb=_0x146beb-0x0;var _0x404c81=_0x9c9c[_0x146beb];return _0x404c81;};'use strict';var _=require(_0xc9c9('0x0'));var util=require(_0xc9c9('0x1'));var moment=require(_0xc9c9('0x2'));var BPromise=require(_0xc9c9('0x3'));var rs=require(_0xc9c9('0x4'));var fs=require('fs');var Redis=require(_0xc9c9('0x5'));var db=require(_0xc9c9('0x6'))['db'];var utils=require(_0xc9c9('0x7'));var logger=require(_0xc9c9('0x8'))('rpc');var config=require(_0xc9c9('0x9'));var jayson=require(_0xc9c9('0xa'));var client=jayson[_0xc9c9('0xb')][_0xc9c9('0xc')]({'port':0x232c});config[_0xc9c9('0xd')]=_['defaults'](config[_0xc9c9('0xd')],{'host':_0xc9c9('0xe'),'port':0x18eb});var socket=require(_0xc9c9('0xf'))(new Redis(config[_0xc9c9('0xd')]));require(_0xc9c9('0x10'))[_0xc9c9('0x11')](socket);function respondWithRpcPromise(_0x3f26a6,_0x39ef4d,_0x8aafe5){return new BPromise(function(_0x160c2d,_0x2f693c){return client[_0xc9c9('0x12')](_0x3f26a6,_0x8aafe5)['then'](function(_0x5953dc){logger[_0xc9c9('0x13')](_0xc9c9('0x14'),_0x39ef4d,_0xc9c9('0x15'));logger[_0xc9c9('0x16')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x39ef4d,'request\x20sent',JSON['stringify'](_0x5953dc));if(_0x5953dc[_0xc9c9('0x17')]){if(_0x5953dc[_0xc9c9('0x17')][_0xc9c9('0x18')]===0x1f4){logger[_0xc9c9('0x17')](_0xc9c9('0x14'),_0x39ef4d,_0x5953dc[_0xc9c9('0x17')][_0xc9c9('0x19')]);return _0x2f693c(_0x5953dc['error'][_0xc9c9('0x19')]);}logger[_0xc9c9('0x17')](_0xc9c9('0x14'),_0x39ef4d,_0x5953dc[_0xc9c9('0x17')][_0xc9c9('0x19')]);return _0x160c2d(_0x5953dc['error'][_0xc9c9('0x19')]);}else{logger[_0xc9c9('0x13')](_0xc9c9('0x14'),_0x39ef4d,_0xc9c9('0x15'));_0x160c2d(_0x5953dc[_0xc9c9('0x1a')][_0xc9c9('0x19')]);}})[_0xc9c9('0x1b')](function(_0x54325e){logger[_0xc9c9('0x17')](_0xc9c9('0x14'),_0x39ef4d,_0x54325e);_0x2f693c(_0x54325e);});});}exports[_0xc9c9('0x1c')]=function(_0x1d9fa2){var _0x5811ec=this;return new Promise(function(_0x208b86,_0x177dbf){return db[_0xc9c9('0x1d')][_0xc9c9('0x1e')]({'raw':_0x1d9fa2[_0xc9c9('0x1f')]?_0x1d9fa2[_0xc9c9('0x1f')][_0xc9c9('0x20')]===undefined?!![]:![]:!![],'where':_0x1d9fa2['options']?_0x1d9fa2[_0xc9c9('0x1f')][_0xc9c9('0x21')]||null:null,'attributes':_0x1d9fa2[_0xc9c9('0x1f')]?_0x1d9fa2[_0xc9c9('0x1f')][_0xc9c9('0x22')]||null:null,'limit':_0x1d9fa2['options']?_0x1d9fa2[_0xc9c9('0x1f')][_0xc9c9('0x23')]||null:null,'include':_0x1d9fa2[_0xc9c9('0x1f')]?_0x1d9fa2[_0xc9c9('0x1f')][_0xc9c9('0x24')]?_[_0xc9c9('0x25')](_0x1d9fa2[_0xc9c9('0x1f')][_0xc9c9('0x24')],function(_0x4761d5){return{'model':db[_0x4761d5['model']],'as':_0x4761d5['as'],'attributes':_0x4761d5[_0xc9c9('0x22')],'include':_0x4761d5[_0xc9c9('0x24')]?_['map'](_0x4761d5[_0xc9c9('0x24')],function(_0x36b9a2){return{'model':db[_0x36b9a2['model']],'as':_0x36b9a2['as'],'attributes':_0x36b9a2[_0xc9c9('0x22')],'include':_0x36b9a2[_0xc9c9('0x24')]?_[_0xc9c9('0x25')](_0x36b9a2['include'],function(_0xefcff){return{'model':db[_0xefcff[_0xc9c9('0x26')]],'as':_0xefcff['as'],'attributes':_0xefcff['attributes']};}):[]};}):[]};}):[]:[]})[_0xc9c9('0x27')](function(_0x2fbd3d){logger[_0xc9c9('0x13')]('GetFaxAccount',_0x1d9fa2);logger[_0xc9c9('0x16')]('GetFaxAccount',_0x1d9fa2,JSON['stringify'](_0x2fbd3d));_0x208b86(_0x2fbd3d);})[_0xc9c9('0x1b')](function(_0x5ba85a){logger[_0xc9c9('0x17')](_0xc9c9('0x1c'),_0x5ba85a[_0xc9c9('0x19')],_0x1d9fa2);_0x177dbf(_0x5811ec[_0xc9c9('0x17')](0x1f4,_0x5ba85a[_0xc9c9('0x19')]));});});};exports[_0xc9c9('0x28')]=function(_0x4a2195,_0x4801ec,_0x320027){var _0x183b96=this;return new Promise(function(_0x282080,_0x2e3a54){var _0x119c75={'body':_0x4a2195['body'],'channel':_0xc9c9('0x29')};var _0x336e6b=[];var _0x4d395e=[];var _0x30dbc8={};return db[_0xc9c9('0x2a')][_0xc9c9('0x2b')]()[_0xc9c9('0x27')](function(_0x34f5ae){if(!_0x34f5ae){throw new db[(_0xc9c9('0x2c'))][(_0xc9c9('0x2d'))](_0xc9c9('0x2e'));}_0x336e6b=_[_0xc9c9('0x2f')](_[_0xc9c9('0x30')](_0x34f5ae),[_0xc9c9('0x31'),_0xc9c9('0x32')]);_0x4d395e=_[_0xc9c9('0x2f')](_[_0xc9c9('0x30')](_0x34f5ae),[_0xc9c9('0x31'),'updatedAt',_0xc9c9('0x33'),_0xc9c9('0x34')]);if(_0x4a2195[_0xc9c9('0x35')]['id']){delete _0x4a2195[_0xc9c9('0x35')]['id'];}if(_[_0xc9c9('0x36')](_0x4a2195[_0xc9c9('0x35')][_0xc9c9('0x37')])){throw new db['Sequelize'][(_0xc9c9('0x2d'))](_0xc9c9('0x38'));}if(_[_0xc9c9('0x36')](_0x4a2195[_0xc9c9('0x35')][_0xc9c9('0x35')])||_0x4a2195['body'][_0xc9c9('0x35')]===''){throw new db['Sequelize'][(_0xc9c9('0x2d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4a2195[_0xc9c9('0x35')][_0xc9c9('0x39')])){throw new db[(_0xc9c9('0x2c'))]['ValidationError'](_0xc9c9('0x3a')+_0x4d395e);}if(!_['includes'](_0x4d395e,_0x4a2195['body'][_0xc9c9('0x39')])){throw new db[(_0xc9c9('0x2c'))][(_0xc9c9('0x2d'))](_0xc9c9('0x3b')+_0x4d395e);}_0x30dbc8[_0x4a2195[_0xc9c9('0x35')][_0xc9c9('0x39')]]=_0x4a2195[_0xc9c9('0x35')]['from'];})[_0xc9c9('0x27')](function(){return db['FaxAccount'][_0xc9c9('0x3c')]({'where':{'id':_0x4a2195[_0xc9c9('0x3d')]['id']},'include':[{'model':db['CmList'],'as':_0xc9c9('0x3e'),'include':[{'model':db[_0xc9c9('0x2a')],'as':'Contacts','where':_0x30dbc8,'limit':0x1,'order':[[_0xc9c9('0x32'),_0xc9c9('0x3f')]]}]},{'model':db[_0xc9c9('0x40')],'as':_0xc9c9('0x41')}]});})[_0xc9c9('0x27')](function(_0x3404d7){if(_0x3404d7&&_0x3404d7[_0xc9c9('0x3e')]){var _0x3e00fd=_0x3404d7[_0xc9c9('0x42')]({'plain':!![]});_0x119c75['account']=_0x3e00fd;_0x119c75['applications']=_0x3e00fd[_0xc9c9('0x41')];_0x119c75[_0xc9c9('0x43')]=_0x3e00fd[_0xc9c9('0x3e')];_0x119c75[_0xc9c9('0x44')]=_[_0xc9c9('0x45')](_0x119c75[_0xc9c9('0x44')],['priority'],[_0xc9c9('0x46')]);if(_0x119c75[_0xc9c9('0x3d')]['Applications']){delete _0x119c75[_0xc9c9('0x3d')][_0xc9c9('0x41')];}if(_0x119c75['account']['List']&&_0x119c75[_0xc9c9('0x3d')]['List'][_0xc9c9('0x47')][_0xc9c9('0x48')]){return _0x119c75[_0xc9c9('0x3d')][_0xc9c9('0x3e')][_0xc9c9('0x47')][0x0];}var _0x1ddc8f=_[_0xc9c9('0x49')](_0x4a2195[_0xc9c9('0x35')],{'firstName':_0x4a2195['body'][_0xc9c9('0x37')],'ListId':_0x3e00fd[_0xc9c9('0x34')]});_0x1ddc8f[_0x4a2195[_0xc9c9('0x35')]['mapKey']]=_0x4a2195['body'][_0xc9c9('0x37')];return db[_0xc9c9('0x2a')][_0xc9c9('0x4a')](_0x1ddc8f,{'fields':_0x336e6b,'raw':!![]});}})['then'](function(_0x90fdf8){_0x119c75['contact']=_0x90fdf8;if(_0x90fdf8){var _0x26aaff={'ContactId':_0x90fdf8['id'],'FaxAccountId':_0x4a2195[_0xc9c9('0x3d')]['id'],'fax':_0x90fdf8['fax']};return db[_0xc9c9('0x4b')][_0xc9c9('0x3c')]({'where':{'ContactId':_0x90fdf8['id'],'closed':![],'FaxAccountId':_0x4a2195[_0xc9c9('0x3d')]['id']}})['then'](function(_0x55c1c6){if(_0x55c1c6){return[_0x55c1c6,![]];}return db[_0xc9c9('0x4b')]['create'](_0x26aaff)[_0xc9c9('0x27')](function(_0x36421c){return[_0x36421c,!![]];});});}else{throw new Error(_0xc9c9('0x4c'));}})[_0xc9c9('0x4d')](function(_0x23a742,_0x3544fc){var _0x2219c1=_0x23a742[_0xc9c9('0x42')]({'plain':!![]});if(_0x3544fc){if(_0x119c75[_0xc9c9('0x3d')][_0xc9c9('0x4e')]){_0x119c75['applications'][_0xc9c9('0x4f')]({'id':0x0,'priority':_0x119c75[_0xc9c9('0x44')][_0xc9c9('0x48')]+0x1,'app':_0xc9c9('0x50'),'appdata':'unmanaged','interval':_0xc9c9('0x51')});}_0x2219c1[_0xc9c9('0x52')]=!![];}else{_0x2219c1[_0xc9c9('0x52')]=![];}_0x119c75['interaction']=_0x2219c1;return db[_0xc9c9('0x53')][_0xc9c9('0x4a')]({'body':_0x4a2195['body'][_0xc9c9('0x35')],'FaxAccountId':_0x4a2195[_0xc9c9('0x3d')]['id'],'FaxInteractionId':_0x23a742['id'],'direction':'in','ContactId':_0x23a742[_0xc9c9('0x54')],'AttachmentId':_0x4a2195[_0xc9c9('0x35')][_0xc9c9('0x55')]});})['then'](function(_0x25a635){_0x119c75['message']=_0x25a635;if(!_0x119c75['interaction']['UserId'])return;return db[_0xc9c9('0x56')][_0xc9c9('0x3c')]({'attributes':['id','name'],'where':{'id':_0x119c75[_0xc9c9('0x57')][_0xc9c9('0x58')]}});})['then'](function(_0xb99c95){if(_0xb99c95){_0x119c75['applications'][_0xc9c9('0x59')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xb99c95[_0xc9c9('0x5a')]+','+(_0x119c75[_0xc9c9('0x3d')][_0xc9c9('0x5b')]||0xa),'interval':_0xc9c9('0x51')});}if(!_0x119c75[_0xc9c9('0x57')]['queueId'])return;return db[_0xc9c9('0x5c')][_0xc9c9('0x3c')]({'attributes':['id','name'],'where':{'id':_0x119c75[_0xc9c9('0x57')][_0xc9c9('0x5d')]}});})[_0xc9c9('0x27')](function(_0x3311e5){if(_0x3311e5){_0x119c75['applications'][_0xc9c9('0x59')]({'id':0x0,'priority':0x1,'app':_0xc9c9('0x5e'),'appdata':_0x3311e5[_0xc9c9('0x5a')]+','+(_0x119c75[_0xc9c9('0x3d')][_0xc9c9('0x5f')]||0x12c),'interval':_0xc9c9('0x51')});}return respondWithRpcPromise(_0xc9c9('0x60'),_0xc9c9('0x61'),_0x119c75);})[_0xc9c9('0x27')](function(_0x1d1fd6){_0x282080(_0x1d1fd6);})[_0xc9c9('0x1b')](function(_0x2d1b2f){_0x2e3a54(_0x183b96[_0xc9c9('0x17')](0x1f4,_0x2d1b2f[_0xc9c9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 7e78702..7b668ef 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 _0xa92c=['length','save','update','removeListener','register'];(function(_0x58ec2e,_0x3200fa){var _0x514625=function(_0x1ea7da){while(--_0x1ea7da){_0x58ec2e['push'](_0x58ec2e['shift']());}};_0x514625(++_0x3200fa);}(_0xa92c,0xb0));var _0xca92=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xa92c[_0x1e4360];return _0x31e6b4;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xca92('0x0'),'remove',_0xca92('0x1')];function createListener(_0x5e57f3,_0x4e613d){return function(_0x20a97){_0x4e613d['emit'](_0x5e57f3,_0x20a97);};}function removeListener(_0x45fec5,_0x5a4d37){return function(){FaxAccountEvents[_0xca92('0x2')](_0x45fec5,_0x5a4d37);};}exports[_0xca92('0x3')]=function(_0x37b73b){for(var _0x11943b=0x0,_0x40bbce=events[_0xca92('0x4')];_0x11943b<_0x40bbce;_0x11943b++){var _0x701dcc=events[_0x11943b];var _0x24f084=createListener('faxAccount:'+_0x701dcc,_0x37b73b);FaxAccountEvents['on'](_0x701dcc,_0x24f084);}}; \ No newline at end of file +var _0x87cf=['length','faxAccount:','./faxAccount.events','save','emit','register'];(function(_0x2e0e5a,_0x1f4eef){var _0x1240ab=function(_0x41e90d){while(--_0x41e90d){_0x2e0e5a['push'](_0x2e0e5a['shift']());}};_0x1240ab(++_0x1f4eef);}(_0x87cf,0xe0));var _0xf87c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x87cf[_0x321bb2];return _0x9c12ed;};'use strict';var FaxAccountEvents=require(_0xf87c('0x0'));var events=[_0xf87c('0x1'),'remove','update'];function createListener(_0x36c0bd,_0x5b3816){return function(_0x5da032){_0x5b3816[_0xf87c('0x2')](_0x36c0bd,_0x5da032);};}function removeListener(_0x56c865,_0x26d300){return function(){FaxAccountEvents['removeListener'](_0x56c865,_0x26d300);};}exports[_0xf87c('0x3')]=function(_0x44e141){for(var _0x10d352=0x0,_0x12173b=events[_0xf87c('0x4')];_0x10d352<_0x12173b;_0x10d352++){var _0x5bb2cf=events[_0x10d352];var _0xd2420c=createListener(_0xf87c('0x5')+_0x5bb2cf,_0x44e141);FaxAccountEvents['on'](_0x5bb2cf,_0xd2420c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 52e0882..b0ab0b0 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 _0xf34a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','getAgents','create','post','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','/:id/users','removeAgents'];(function(_0x36dc96,_0x56e00c){var _0x45761f=function(_0x4138eb){while(--_0x4138eb){_0x36dc96['push'](_0x36dc96['shift']());}};_0x45761f(++_0x56e00c);}(_0xf34a,0x115));var _0xaf34=function(_0x219ef9,_0x1f46e6){_0x219ef9=_0x219ef9-0x0;var _0x1603a1=_0xf34a[_0x219ef9];return _0x1603a1;};'use strict';var multer=require(_0xaf34('0x0'));var util=require(_0xaf34('0x1'));var path=require(_0xaf34('0x2'));var timeout=require(_0xaf34('0x3'));var express=require(_0xaf34('0x4'));var router=express[_0xaf34('0x5')]();var fs_extra=require(_0xaf34('0x6'));var auth=require(_0xaf34('0x7'));var interaction=require(_0xaf34('0x8'));var config=require(_0xaf34('0x9'));var controller=require(_0xaf34('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaf34('0xb')](_0xaf34('0xc'),auth[_0xaf34('0xd')](),controller[_0xaf34('0xe')]);router[_0xaf34('0xb')](_0xaf34('0xf'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x10')]);router[_0xaf34('0xb')](_0xaf34('0x11'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x12')]);router['get'](_0xaf34('0x13'),auth['isAuthenticated'](),controller[_0xaf34('0x14')]);router[_0xaf34('0xb')](_0xaf34('0x15'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x16')]);router[_0xaf34('0xb')](_0xaf34('0x17'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x18')]);router[_0xaf34('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xaf34('0x19')]);router[_0xaf34('0xb')]('/:id/users',auth[_0xaf34('0xd')](),controller[_0xaf34('0x1a')]);router['post']('/',auth[_0xaf34('0xd')](),controller[_0xaf34('0x1b')]);router[_0xaf34('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xaf34('0x1c')]('/:id/canned_answers',auth[_0xaf34('0xd')](),controller[_0xaf34('0x1d')]);router[_0xaf34('0x1c')](_0xaf34('0x15'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x1e')]);router['post'](_0xaf34('0x17'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x1f')]);router[_0xaf34('0x1c')](_0xaf34('0x20'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x21')]);router['post'](_0xaf34('0x22'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x23')]);router['post'](_0xaf34('0x24'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x25')]);router[_0xaf34('0x1c')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xaf34('0x26')](_0xaf34('0xf'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x27')]);router[_0xaf34('0x28')](_0xaf34('0xf'),auth[_0xaf34('0xd')](),controller['destroy']);router[_0xaf34('0x28')](_0xaf34('0x11'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x29')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xaf34('0x2a')]);router[_0xaf34('0x28')](_0xaf34('0x2b'),auth[_0xaf34('0xd')](),controller[_0xaf34('0x2c')]);module[_0xaf34('0x2d')]=router; \ No newline at end of file +var _0xf031=['getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/applications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions'];(function(_0x2192ae,_0x197b1e){var _0x5d8404=function(_0x11e731){while(--_0x11e731){_0x2192ae['push'](_0x2192ae['shift']());}};_0x5d8404(++_0x197b1e);}(_0xf031,0x149));var _0x1f03=function(_0x49f638,_0x1ac3f5){_0x49f638=_0x49f638-0x0;var _0x3c5be4=_0xf031[_0x49f638];return _0x3c5be4;};'use strict';var multer=require(_0x1f03('0x0'));var util=require('util');var path=require(_0x1f03('0x1'));var timeout=require(_0x1f03('0x2'));var express=require('express');var router=express[_0x1f03('0x3')]();var fs_extra=require(_0x1f03('0x4'));var auth=require(_0x1f03('0x5'));var interaction=require(_0x1f03('0x6'));var config=require(_0x1f03('0x7'));var controller=require(_0x1f03('0x8'));router[_0x1f03('0x9')]('/',auth[_0x1f03('0xa')](),controller[_0x1f03('0xb')]);router[_0x1f03('0x9')](_0x1f03('0xc'),auth[_0x1f03('0xa')](),controller[_0x1f03('0xd')]);router[_0x1f03('0x9')]('/:id',auth[_0x1f03('0xa')](),controller['show']);router[_0x1f03('0x9')](_0x1f03('0xe'),auth['isAuthenticated'](),controller[_0x1f03('0xf')]);router[_0x1f03('0x9')](_0x1f03('0x10'),auth['isAuthenticated'](),controller[_0x1f03('0x11')]);router[_0x1f03('0x9')](_0x1f03('0x12'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x13')]);router[_0x1f03('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x1f03('0x9')](_0x1f03('0x14'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x15')]);router['get'](_0x1f03('0x16'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x17')]);router[_0x1f03('0x18')]('/',auth[_0x1f03('0xa')](),controller[_0x1f03('0x19')]);router[_0x1f03('0x18')](_0x1f03('0xe'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x1a')]);router[_0x1f03('0x18')](_0x1f03('0x10'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x1b')]);router[_0x1f03('0x18')](_0x1f03('0x12'),auth[_0x1f03('0xa')](),controller['addInteraction']);router[_0x1f03('0x18')](_0x1f03('0x1c'),auth[_0x1f03('0xa')](),controller['addApplications']);router['post'](_0x1f03('0x1d'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x1e')]);router[_0x1f03('0x18')](_0x1f03('0x1f'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x20')]);router[_0x1f03('0x18')]('/:id/send',auth[_0x1f03('0xa')](),controller[_0x1f03('0x21')]);router[_0x1f03('0x18')](_0x1f03('0x16'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x22')]);router[_0x1f03('0x23')]('/:id',auth[_0x1f03('0xa')](),controller['update']);router[_0x1f03('0x24')](_0x1f03('0x25'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x26')]);router[_0x1f03('0x24')](_0x1f03('0xe'),auth[_0x1f03('0xa')](),controller[_0x1f03('0x27')]);router[_0x1f03('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1f03('0x28')]);router[_0x1f03('0x24')]('/:id/users',auth[_0x1f03('0xa')](),controller[_0x1f03('0x29')]);module[_0x1f03('0x2a')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 466a564..52dbe63 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 _0x677d=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x677d,0x9f));var _0xd677=function(_0x559434,_0x2f9870){_0x559434=_0x559434-0x0;var _0x252834=_0x677d[_0x559434];return _0x252834;};'use strict';var Sequelize=require('sequelize');module[_0xd677('0x0')]={'priority':{'type':Sequelize[_0xd677('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd677('0x2')],'allowNull':![],'defaultValue':_0xd677('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd677('0x2')]},'interval':{'type':Sequelize[_0xd677('0x2')],'defaultValue':_0xd677('0x4')}}; \ No newline at end of file +var _0x1f64=['TEXT','sequelize','exports','STRING'];(function(_0x2d6397,_0x288cf1){var _0x8bfcbc=function(_0x29c420){while(--_0x29c420){_0x2d6397['push'](_0x2d6397['shift']());}};_0x8bfcbc(++_0x288cf1);}(_0x1f64,0xfd));var _0x41f6=function(_0x5ce402,_0x5c811b){_0x5ce402=_0x5ce402-0x0;var _0x5d5ad3=_0x1f64[_0x5ce402];return _0x5d5ad3;};'use strict';var Sequelize=require(_0x41f6('0x0'));module[_0x41f6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x41f6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x41f6('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x41f6('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index be4ddf5..3197f8e 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 _0x6045=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','name','send','index','map','FaxApplication','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','findAll','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x22017f,_0x1ca805){var _0x33d98e=function(_0x24df44){while(--_0x24df44){_0x22017f['push'](_0x22017f['shift']());}};_0x33d98e(++_0x1ca805);}(_0x6045,0x87));var _0x5604=function(_0x5b5e1f,_0x3d3d4e){_0x5b5e1f=_0x5b5e1f-0x0;var _0x32cc72=_0x6045[_0x5b5e1f];return _0x32cc72;};'use strict';var emlformat=require(_0x5604('0x0'));var rimraf=require(_0x5604('0x1'));var zipdir=require(_0x5604('0x2'));var jsonpatch=require(_0x5604('0x3'));var rp=require(_0x5604('0x4'));var moment=require(_0x5604('0x5'));var BPromise=require(_0x5604('0x6'));var Mustache=require('mustache');var util=require(_0x5604('0x7'));var path=require(_0x5604('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5604('0x9'));var fs=require('fs');var fs_extra=require(_0x5604('0xa'));var _=require(_0x5604('0xb'));var squel=require(_0x5604('0xc'));var crypto=require(_0x5604('0xd'));var jsforce=require(_0x5604('0xe'));var deskjs=require(_0x5604('0xf'));var toCsv=require(_0x5604('0x10'));var querystring=require(_0x5604('0x11'));var Papa=require(_0x5604('0x12'));var Redis=require('ioredis');var authService=require(_0x5604('0x13'));var qs=require(_0x5604('0x14'));var as=require(_0x5604('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5604('0x16'))('api');var utils=require(_0x5604('0x17'));var config=require(_0x5604('0x18'));var licenseUtil=require(_0x5604('0x19'));var db=require(_0x5604('0x1a'))['db'];function respondWithStatusCode(_0xf5a4e3,_0x586972){_0x586972=_0x586972||0xcc;return function(_0x277015){if(_0x277015){return _0xf5a4e3[_0x5604('0x1b')](_0x586972);}return _0xf5a4e3['status'](_0x586972)['end']();};}function respondWithResult(_0x575d15,_0x4ee391){_0x4ee391=_0x4ee391||0xc8;return function(_0x3ec33b){if(_0x3ec33b){return _0x575d15[_0x5604('0x1c')](_0x4ee391)[_0x5604('0x1d')](_0x3ec33b);}};}function respondWithFilteredResult(_0x14e0a7,_0x4deaa2){return function(_0x222488){if(_0x222488){var _0x30b424=typeof _0x4deaa2[_0x5604('0x1e')]===_0x5604('0x1f')&&typeof _0x4deaa2[_0x5604('0x20')]===_0x5604('0x1f');var _0x43c72d=_0x222488[_0x5604('0x21')];var _0x41a0f0=_0x30b424?0x0:_0x4deaa2[_0x5604('0x1e')];var _0x5ef451=_0x30b424?_0x222488[_0x5604('0x21')]:_0x4deaa2['offset']+_0x4deaa2[_0x5604('0x20')];var _0x22e04a;if(_0x5ef451>=_0x43c72d){_0x5ef451=_0x43c72d;_0x22e04a=0xc8;}else{_0x22e04a=0xce;}_0x14e0a7['status'](_0x22e04a);return _0x14e0a7[_0x5604('0x22')]('Content-Range',_0x41a0f0+'-'+_0x5ef451+'/'+_0x43c72d)['json'](_0x222488);}return null;};}function patchUpdates(_0x12ac8d){return function(_0x4388ff){try{jsonpatch[_0x5604('0x23')](_0x4388ff,_0x12ac8d,!![]);}catch(_0x119392){return BPromise[_0x5604('0x24')](_0x119392);}return _0x4388ff[_0x5604('0x25')]();};}function saveUpdates(_0x23801c,_0x1c0afc){return function(_0x3aa099){if(_0x3aa099){return _0x3aa099[_0x5604('0x26')](_0x23801c)[_0x5604('0x27')](function(_0x38a717){return _0x38a717;});}return null;};}function removeEntity(_0xabcad7,_0x3fa7bf){return function(_0x45b63b){if(_0x45b63b){return _0x45b63b['destroy']()['then'](function(){_0xabcad7['status'](0xcc)[_0x5604('0x28')]();});}};}function handleEntityNotFound(_0x34dc3f,_0x20a7ab){return function(_0x390dab){if(!_0x390dab){_0x34dc3f[_0x5604('0x1b')](0x194);}return _0x390dab;};}function handleError(_0x34ac50,_0x10d733){_0x10d733=_0x10d733||0x1f4;return function(_0x1f27bd){logger[_0x5604('0x29')](_0x1f27bd['stack']);if(_0x1f27bd['name']){delete _0x1f27bd[_0x5604('0x2a')];}_0x34ac50['status'](_0x10d733)[_0x5604('0x2b')](_0x1f27bd);};}exports[_0x5604('0x2c')]=function(_0x405016,_0x137ef0){var _0x116a12={},_0xf318b9={},_0x54b3b2={'count':0x0,'rows':[]};var _0x42901b=_[_0x5604('0x2d')](db[_0x5604('0x2e')][_0x5604('0x2f')],function(_0x47f91e){return{'name':_0x47f91e['fieldName'],'type':_0x47f91e[_0x5604('0x30')][_0x5604('0x31')]};});_0xf318b9[_0x5604('0x32')]=_[_0x5604('0x2d')](_0x42901b,_0x5604('0x2a'));_0xf318b9[_0x5604('0x33')]=_[_0x5604('0x34')](_0x405016[_0x5604('0x33')]);_0xf318b9['filters']=_[_0x5604('0x35')](_0xf318b9[_0x5604('0x32')],_0xf318b9['query']);_0x116a12[_0x5604('0x36')]=_['intersection'](_0xf318b9['model'],qs[_0x5604('0x37')](_0x405016[_0x5604('0x33')][_0x5604('0x37')]));_0x116a12[_0x5604('0x36')]=_0x116a12[_0x5604('0x36')][_0x5604('0x38')]?_0x116a12[_0x5604('0x36')]:_0xf318b9[_0x5604('0x32')];if(!_0x405016[_0x5604('0x33')][_0x5604('0x39')]('nolimit')){_0x116a12[_0x5604('0x20')]=qs[_0x5604('0x20')](_0x405016[_0x5604('0x33')][_0x5604('0x20')]);_0x116a12[_0x5604('0x1e')]=qs[_0x5604('0x1e')](_0x405016['query'][_0x5604('0x1e')]);}_0x116a12[_0x5604('0x3a')]=qs[_0x5604('0x3b')](_0x405016[_0x5604('0x33')][_0x5604('0x3b')]);_0x116a12[_0x5604('0x3c')]=qs['filters'](_[_0x5604('0x3d')](_0x405016[_0x5604('0x33')],_0xf318b9[_0x5604('0x3e')]),_0x42901b);if(_0x405016[_0x5604('0x33')][_0x5604('0x3f')]){_0x116a12['where']=_['merge'](_0x116a12[_0x5604('0x3c')],{'$or':_['map'](_0x42901b,function(_0x1941f9){if(_0x1941f9[_0x5604('0x30')]!==_0x5604('0x40')){var _0x984bef={};_0x984bef[_0x1941f9[_0x5604('0x2a')]]={'$like':'%'+_0x405016[_0x5604('0x33')][_0x5604('0x3f')]+'%'};return _0x984bef;}})});}_0x116a12=_[_0x5604('0x41')]({},_0x116a12,_0x405016[_0x5604('0x42')]);var _0x29034c={'where':_0x116a12['where']};return db[_0x5604('0x2e')][_0x5604('0x21')](_0x29034c)['then'](function(_0x2cb9da){_0x54b3b2[_0x5604('0x21')]=_0x2cb9da;if(_0x405016[_0x5604('0x33')]['includeAll']){_0x116a12['include']=[{'all':!![]}];}return db[_0x5604('0x2e')][_0x5604('0x43')](_0x116a12);})[_0x5604('0x27')](function(_0x552517){_0x54b3b2['rows']=_0x552517;return _0x54b3b2;})[_0x5604('0x27')](respondWithFilteredResult(_0x137ef0,_0x116a12))[_0x5604('0x44')](handleError(_0x137ef0,null));};exports[_0x5604('0x45')]=function(_0x1282f2,_0x1e92f3){var _0x582512={'raw':!![],'where':{'id':_0x1282f2[_0x5604('0x46')]['id']}},_0xc854ea={};_0xc854ea[_0x5604('0x32')]=_[_0x5604('0x34')](db[_0x5604('0x2e')]['rawAttributes']);_0xc854ea['query']=_['keys'](_0x1282f2[_0x5604('0x33')]);_0xc854ea[_0x5604('0x3e')]=_[_0x5604('0x35')](_0xc854ea[_0x5604('0x32')],_0xc854ea[_0x5604('0x33')]);_0x582512['attributes']=_[_0x5604('0x35')](_0xc854ea[_0x5604('0x32')],qs[_0x5604('0x37')](_0x1282f2['query'][_0x5604('0x37')]));_0x582512[_0x5604('0x36')]=_0x582512[_0x5604('0x36')][_0x5604('0x38')]?_0x582512[_0x5604('0x36')]:_0xc854ea[_0x5604('0x32')];if(_0x1282f2[_0x5604('0x33')]['includeAll']){_0x582512[_0x5604('0x47')]=[{'all':!![]}];}_0x582512=_['merge']({},_0x582512,_0x1282f2[_0x5604('0x42')]);return db[_0x5604('0x2e')][_0x5604('0x48')](_0x582512)[_0x5604('0x27')](handleEntityNotFound(_0x1e92f3,null))[_0x5604('0x27')](respondWithResult(_0x1e92f3,null))['catch'](handleError(_0x1e92f3,null));};exports[_0x5604('0x49')]=function(_0x384ad7,_0x5c5757){return db['FaxApplication'][_0x5604('0x49')](_0x384ad7[_0x5604('0x4a')],{})[_0x5604('0x27')](respondWithResult(_0x5c5757,0xc9))[_0x5604('0x44')](handleError(_0x5c5757,null));};exports['update']=function(_0x5e7572,_0x4cc9f4){if(_0x5e7572[_0x5604('0x4a')]['id']){delete _0x5e7572[_0x5604('0x4a')]['id'];}return db[_0x5604('0x2e')][_0x5604('0x48')]({'where':{'id':_0x5e7572[_0x5604('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cc9f4,null))[_0x5604('0x27')](saveUpdates(_0x5e7572[_0x5604('0x4a')],null))[_0x5604('0x27')](respondWithResult(_0x4cc9f4,null))[_0x5604('0x44')](handleError(_0x4cc9f4,null));};exports[_0x5604('0x4b')]=function(_0x39cdf1,_0xbab60d){return db[_0x5604('0x2e')][_0x5604('0x48')]({'where':{'id':_0x39cdf1['params']['id']}})[_0x5604('0x27')](handleEntityNotFound(_0xbab60d,null))[_0x5604('0x27')](removeEntity(_0xbab60d,null))['catch'](handleError(_0xbab60d,null));}; \ No newline at end of file +var _0xad0e=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','merge','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x346115,_0x275219){var _0xa18bb6=function(_0xfc8fee){while(--_0xfc8fee){_0x346115['push'](_0x346115['shift']());}};_0xa18bb6(++_0x275219);}(_0xad0e,0x186));var _0xead0=function(_0xaa2d05,_0x3d9b62){_0xaa2d05=_0xaa2d05-0x0;var _0x10753c=_0xad0e[_0xaa2d05];return _0x10753c;};'use strict';var emlformat=require(_0xead0('0x0'));var rimraf=require(_0xead0('0x1'));var zipdir=require(_0xead0('0x2'));var jsonpatch=require(_0xead0('0x3'));var rp=require(_0xead0('0x4'));var moment=require(_0xead0('0x5'));var BPromise=require(_0xead0('0x6'));var Mustache=require('mustache');var util=require(_0xead0('0x7'));var path=require(_0xead0('0x8'));var sox=require(_0xead0('0x9'));var csv=require(_0xead0('0xa'));var ejs=require(_0xead0('0xb'));var fs=require('fs');var fs_extra=require(_0xead0('0xc'));var _=require(_0xead0('0xd'));var squel=require(_0xead0('0xe'));var crypto=require(_0xead0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xead0('0x10'));var toCsv=require(_0xead0('0xa'));var querystring=require(_0xead0('0x11'));var Papa=require(_0xead0('0x12'));var Redis=require(_0xead0('0x13'));var authService=require(_0xead0('0x14'));var qs=require(_0xead0('0x15'));var as=require(_0xead0('0x16'));var hardwareService=require(_0xead0('0x17'));var logger=require('../../config/logger')(_0xead0('0x18'));var utils=require('../../config/utils');var config=require(_0xead0('0x19'));var licenseUtil=require(_0xead0('0x1a'));var db=require(_0xead0('0x1b'))['db'];function respondWithStatusCode(_0x2148af,_0x2e5887){_0x2e5887=_0x2e5887||0xcc;return function(_0xff7b95){if(_0xff7b95){return _0x2148af[_0xead0('0x1c')](_0x2e5887);}return _0x2148af[_0xead0('0x1d')](_0x2e5887)['end']();};}function respondWithResult(_0x3b2cd0,_0x35b458){_0x35b458=_0x35b458||0xc8;return function(_0x5c38d2){if(_0x5c38d2){return _0x3b2cd0[_0xead0('0x1d')](_0x35b458)[_0xead0('0x1e')](_0x5c38d2);}};}function respondWithFilteredResult(_0x2bf842,_0xf909f9){return function(_0xaaf2c8){if(_0xaaf2c8){var _0x4057d0=typeof _0xf909f9['offset']===_0xead0('0x1f')&&typeof _0xf909f9[_0xead0('0x20')]===_0xead0('0x1f');var _0x6b3645=_0xaaf2c8[_0xead0('0x21')];var _0x45bd0f=_0x4057d0?0x0:_0xf909f9[_0xead0('0x22')];var _0x261441=_0x4057d0?_0xaaf2c8['count']:_0xf909f9[_0xead0('0x22')]+_0xf909f9[_0xead0('0x20')];var _0x327d96;if(_0x261441>=_0x6b3645){_0x261441=_0x6b3645;_0x327d96=0xc8;}else{_0x327d96=0xce;}_0x2bf842[_0xead0('0x1d')](_0x327d96);return _0x2bf842[_0xead0('0x23')](_0xead0('0x24'),_0x45bd0f+'-'+_0x261441+'/'+_0x6b3645)[_0xead0('0x1e')](_0xaaf2c8);}return null;};}function patchUpdates(_0x5e0028){return function(_0x383a00){try{jsonpatch[_0xead0('0x25')](_0x383a00,_0x5e0028,!![]);}catch(_0x235bdd){return BPromise[_0xead0('0x26')](_0x235bdd);}return _0x383a00[_0xead0('0x27')]();};}function saveUpdates(_0x484793,_0x97956a){return function(_0xbf9c00){if(_0xbf9c00){return _0xbf9c00['update'](_0x484793)[_0xead0('0x28')](function(_0x5bbbfc){return _0x5bbbfc;});}return null;};}function removeEntity(_0x1e4997,_0x125757){return function(_0x170aa4){if(_0x170aa4){return _0x170aa4[_0xead0('0x29')]()[_0xead0('0x28')](function(){_0x1e4997['status'](0xcc)[_0xead0('0x2a')]();});}};}function handleEntityNotFound(_0x46ef4d,_0x25e9c1){return function(_0x3ec67a){if(!_0x3ec67a){_0x46ef4d[_0xead0('0x1c')](0x194);}return _0x3ec67a;};}function handleError(_0x3b7c30,_0x5ee2ef){_0x5ee2ef=_0x5ee2ef||0x1f4;return function(_0x49ef09){logger[_0xead0('0x2b')](_0x49ef09[_0xead0('0x2c')]);if(_0x49ef09['name']){delete _0x49ef09[_0xead0('0x2d')];}_0x3b7c30[_0xead0('0x1d')](_0x5ee2ef)[_0xead0('0x2e')](_0x49ef09);};}exports[_0xead0('0x2f')]=function(_0x527c3f,_0x9cb1b9){var _0x411e0={},_0x4c7432={},_0x9a1d55={'count':0x0,'rows':[]};var _0x2e1753=_[_0xead0('0x30')](db[_0xead0('0x31')][_0xead0('0x32')],function(_0x35d6bf){return{'name':_0x35d6bf[_0xead0('0x33')],'type':_0x35d6bf[_0xead0('0x34')][_0xead0('0x35')]};});_0x4c7432['model']=_['map'](_0x2e1753,_0xead0('0x2d'));_0x4c7432['query']=_[_0xead0('0x36')](_0x527c3f[_0xead0('0x37')]);_0x4c7432[_0xead0('0x38')]=_[_0xead0('0x39')](_0x4c7432['model'],_0x4c7432[_0xead0('0x37')]);_0x411e0['attributes']=_[_0xead0('0x39')](_0x4c7432[_0xead0('0x3a')],qs[_0xead0('0x3b')](_0x527c3f['query'][_0xead0('0x3b')]));_0x411e0[_0xead0('0x3c')]=_0x411e0[_0xead0('0x3c')][_0xead0('0x3d')]?_0x411e0[_0xead0('0x3c')]:_0x4c7432['model'];if(!_0x527c3f[_0xead0('0x37')]['hasOwnProperty'](_0xead0('0x3e'))){_0x411e0[_0xead0('0x20')]=qs[_0xead0('0x20')](_0x527c3f['query'][_0xead0('0x20')]);_0x411e0['offset']=qs['offset'](_0x527c3f[_0xead0('0x37')]['offset']);}_0x411e0[_0xead0('0x3f')]=qs[_0xead0('0x40')](_0x527c3f[_0xead0('0x37')][_0xead0('0x40')]);_0x411e0[_0xead0('0x41')]=qs[_0xead0('0x38')](_[_0xead0('0x42')](_0x527c3f[_0xead0('0x37')],_0x4c7432['filters']),_0x2e1753);if(_0x527c3f['query'][_0xead0('0x43')]){_0x411e0[_0xead0('0x41')]=_['merge'](_0x411e0[_0xead0('0x41')],{'$or':_[_0xead0('0x30')](_0x2e1753,function(_0x370efd){if(_0x370efd[_0xead0('0x34')]!==_0xead0('0x44')){var _0x58dca5={};_0x58dca5[_0x370efd[_0xead0('0x2d')]]={'$like':'%'+_0x527c3f[_0xead0('0x37')]['filter']+'%'};return _0x58dca5;}})});}_0x411e0=_['merge']({},_0x411e0,_0x527c3f[_0xead0('0x45')]);var _0x6ad827={'where':_0x411e0['where']};return db[_0xead0('0x31')][_0xead0('0x21')](_0x6ad827)[_0xead0('0x28')](function(_0x3c89a3){_0x9a1d55[_0xead0('0x21')]=_0x3c89a3;if(_0x527c3f['query'][_0xead0('0x46')]){_0x411e0[_0xead0('0x47')]=[{'all':!![]}];}return db[_0xead0('0x31')][_0xead0('0x48')](_0x411e0);})[_0xead0('0x28')](function(_0x295be2){_0x9a1d55[_0xead0('0x49')]=_0x295be2;return _0x9a1d55;})[_0xead0('0x28')](respondWithFilteredResult(_0x9cb1b9,_0x411e0))[_0xead0('0x4a')](handleError(_0x9cb1b9,null));};exports['show']=function(_0x4c9d27,_0x5a1398){var _0x25f4cb={'raw':!![],'where':{'id':_0x4c9d27[_0xead0('0x4b')]['id']}},_0x4ce50b={};_0x4ce50b[_0xead0('0x3a')]=_[_0xead0('0x36')](db[_0xead0('0x31')]['rawAttributes']);_0x4ce50b['query']=_[_0xead0('0x36')](_0x4c9d27[_0xead0('0x37')]);_0x4ce50b[_0xead0('0x38')]=_[_0xead0('0x39')](_0x4ce50b[_0xead0('0x3a')],_0x4ce50b['query']);_0x25f4cb[_0xead0('0x3c')]=_[_0xead0('0x39')](_0x4ce50b['model'],qs[_0xead0('0x3b')](_0x4c9d27[_0xead0('0x37')][_0xead0('0x3b')]));_0x25f4cb['attributes']=_0x25f4cb[_0xead0('0x3c')]['length']?_0x25f4cb[_0xead0('0x3c')]:_0x4ce50b['model'];if(_0x4c9d27[_0xead0('0x37')][_0xead0('0x46')]){_0x25f4cb[_0xead0('0x47')]=[{'all':!![]}];}_0x25f4cb=_[_0xead0('0x4c')]({},_0x25f4cb,_0x4c9d27['options']);return db[_0xead0('0x31')][_0xead0('0x4d')](_0x25f4cb)['then'](handleEntityNotFound(_0x5a1398,null))[_0xead0('0x28')](respondWithResult(_0x5a1398,null))[_0xead0('0x4a')](handleError(_0x5a1398,null));};exports[_0xead0('0x4e')]=function(_0x16f201,_0x32b634){return db[_0xead0('0x31')]['create'](_0x16f201['body'],{})['then'](respondWithResult(_0x32b634,0xc9))[_0xead0('0x4a')](handleError(_0x32b634,null));};exports[_0xead0('0x4f')]=function(_0x10c833,_0x3731cb){if(_0x10c833[_0xead0('0x50')]['id']){delete _0x10c833[_0xead0('0x50')]['id'];}return db[_0xead0('0x31')]['find']({'where':{'id':_0x10c833[_0xead0('0x4b')]['id']}})[_0xead0('0x28')](handleEntityNotFound(_0x3731cb,null))['then'](saveUpdates(_0x10c833[_0xead0('0x50')],null))[_0xead0('0x28')](respondWithResult(_0x3731cb,null))[_0xead0('0x4a')](handleError(_0x3731cb,null));};exports[_0xead0('0x29')]=function(_0x121449,_0x430fa7){return db[_0xead0('0x31')]['find']({'where':{'id':_0x121449[_0xead0('0x4b')]['id']}})[_0xead0('0x28')](handleEntityNotFound(_0x430fa7,null))[_0xead0('0x28')](removeEntity(_0x430fa7,null))[_0xead0('0x4a')](handleError(_0x430fa7,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6d35efb..f52f64e 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 _0xd083=['api','path','rimraf','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x39e0c5,_0x16ddc6){var _0x9a6ade=function(_0x1c1ccf){while(--_0x1c1ccf){_0x39e0c5['push'](_0x39e0c5['shift']());}};_0x9a6ade(++_0x16ddc6);}(_0xd083,0xca));var _0x3d08=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xd083[_0x148c09];return _0x18e613;};'use strict';var _=require('lodash');var util=require(_0x3d08('0x0'));var logger=require(_0x3d08('0x1'))(_0x3d08('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d08('0x3'));var rimraf=require(_0x3d08('0x4'));var config=require('../../config/environment');var attributes=require(_0x3d08('0x5'));module[_0x3d08('0x6')]=function(_0xb73b19,_0x424c8c){return _0xb73b19[_0x3d08('0x7')](_0x3d08('0x8'),attributes,{'tableName':_0x3d08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d08('0xa'),'collate':_0x3d08('0xb')});}; \ No newline at end of file +var _0x2903=['path','rimraf','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x2903,0x157));var _0x3290=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2903[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3290('0x0'));var util=require(_0x3290('0x1'));var logger=require('../../config/logger')(_0x3290('0x2'));var moment=require('moment');var BPromise=require(_0x3290('0x3'));var rp=require(_0x3290('0x4'));var fs=require('fs');var path=require(_0x3290('0x5'));var rimraf=require(_0x3290('0x6'));var config=require('../../config/environment');var attributes=require(_0x3290('0x7'));module[_0x3290('0x8')]=function(_0x419f63,_0x185351){return _0x419f63[_0x3290('0x9')]('FaxApplication',attributes,{'tableName':_0x3290('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3290('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 99032b6..22b9d54 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 _0x0738=['info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xb6f84b,_0x55caf0){var _0x22e141=function(_0x4004a5){while(--_0x4004a5){_0xb6f84b['push'](_0xb6f84b['shift']());}};_0x22e141(++_0x55caf0);}(_0x0738,0x6e));var _0x8073=function(_0x528bb5,_0x119c5b){_0x528bb5=_0x528bb5-0x0;var _0x58e8ca=_0x0738[_0x528bb5];return _0x58e8ca;};'use strict';var _=require(_0x8073('0x0'));var util=require('util');var moment=require(_0x8073('0x1'));var BPromise=require(_0x8073('0x2'));var rs=require(_0x8073('0x3'));var fs=require('fs');var Redis=require(_0x8073('0x4'));var db=require(_0x8073('0x5'))['db'];var utils=require(_0x8073('0x6'));var logger=require(_0x8073('0x7'))(_0x8073('0x8'));var config=require(_0x8073('0x9'));var jayson=require(_0x8073('0xa'));var client=jayson[_0x8073('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aad61,_0x16ff8b,_0x2899ce){return new BPromise(function(_0x310f3a,_0x3f7807){return client[_0x8073('0xc')](_0x1aad61,_0x2899ce)[_0x8073('0xd')](function(_0x57b564){logger[_0x8073('0xe')]('FaxApplication,\x20%s,\x20%s',_0x16ff8b,'request\x20sent');logger[_0x8073('0xf')](_0x8073('0x10'),_0x16ff8b,_0x8073('0x11'),JSON[_0x8073('0x12')](_0x57b564));if(_0x57b564['error']){if(_0x57b564[_0x8073('0x13')][_0x8073('0x14')]===0x1f4){logger['error'](_0x8073('0x15'),_0x16ff8b,_0x57b564['error'][_0x8073('0x16')]);return _0x3f7807(_0x57b564[_0x8073('0x13')][_0x8073('0x16')]);}logger[_0x8073('0x13')]('FaxApplication,\x20%s,\x20%s',_0x16ff8b,_0x57b564[_0x8073('0x13')][_0x8073('0x16')]);return _0x310f3a(_0x57b564[_0x8073('0x13')][_0x8073('0x16')]);}else{logger[_0x8073('0xe')](_0x8073('0x15'),_0x16ff8b,_0x8073('0x11'));_0x310f3a(_0x57b564['result'][_0x8073('0x16')]);}})['catch'](function(_0xe9c222){logger[_0x8073('0x13')](_0x8073('0x15'),_0x16ff8b,_0xe9c222);_0x3f7807(_0xe9c222);});});}exports[_0x8073('0x17')]=function(_0x24cc34){var _0x2bd877=this;return new Promise(function(_0xb20a36,_0x8b8f1a){return db[_0x8073('0x18')][_0x8073('0x19')](_0x24cc34['body'],{'raw':_0x24cc34['options']?_0x24cc34[_0x8073('0x1a')][_0x8073('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24cc34['options']?_0x24cc34[_0x8073('0x1a')][_0x8073('0x1c')]||null:null,'attributes':_0x24cc34[_0x8073('0x1a')]?_0x24cc34[_0x8073('0x1a')][_0x8073('0x1d')]||null:null,'limit':_0x24cc34[_0x8073('0x1a')]?_0x24cc34[_0x8073('0x1a')]['limit']||null:null})[_0x8073('0xd')](function(_0x5b82c4){logger[_0x8073('0xe')](_0x8073('0x17'),_0x24cc34);logger[_0x8073('0xf')](_0x8073('0x17'),_0x24cc34,JSON[_0x8073('0x12')](_0x5b82c4));_0xb20a36(_0x5b82c4);})[_0x8073('0x1e')](function(_0x18633f){logger['error'](_0x8073('0x17'),_0x18633f[_0x8073('0x16')],_0x24cc34);_0x8b8f1a(_0x2bd877[_0x8073('0x13')](0x1f4,_0x18633f[_0x8073('0x16')]));});});}; \ No newline at end of file +var _0x9e47=['FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','stringify','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x463532,_0x36f05d){var _0x3dae78=function(_0x47579a){while(--_0x47579a){_0x463532['push'](_0x463532['shift']());}};_0x3dae78(++_0x36f05d);}(_0x9e47,0xe4));var _0x79e4=function(_0x4d9596,_0x3e347b){_0x4d9596=_0x4d9596-0x0;var _0x58dd56=_0x9e47[_0x4d9596];return _0x58dd56;};'use strict';var _=require(_0x79e4('0x0'));var util=require('util');var moment=require(_0x79e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x79e4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79e4('0x3'))['db'];var utils=require(_0x79e4('0x4'));var logger=require(_0x79e4('0x5'))(_0x79e4('0x6'));var config=require(_0x79e4('0x7'));var jayson=require(_0x79e4('0x8'));var client=jayson[_0x79e4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x150b3f,_0x34b8b9,_0x17851e){return new BPromise(function(_0x2298d5,_0x3eacdb){return client[_0x79e4('0xa')](_0x150b3f,_0x17851e)[_0x79e4('0xb')](function(_0x24e5eb){logger['info'](_0x79e4('0xc'),_0x34b8b9,_0x79e4('0xd'));logger[_0x79e4('0xe')](_0x79e4('0xf'),_0x34b8b9,_0x79e4('0xd'),JSON['stringify'](_0x24e5eb));if(_0x24e5eb['error']){if(_0x24e5eb[_0x79e4('0x10')]['code']===0x1f4){logger['error'](_0x79e4('0xc'),_0x34b8b9,_0x24e5eb[_0x79e4('0x10')][_0x79e4('0x11')]);return _0x3eacdb(_0x24e5eb['error']['message']);}logger['error'](_0x79e4('0xc'),_0x34b8b9,_0x24e5eb['error'][_0x79e4('0x11')]);return _0x2298d5(_0x24e5eb[_0x79e4('0x10')][_0x79e4('0x11')]);}else{logger[_0x79e4('0x12')](_0x79e4('0xc'),_0x34b8b9,_0x79e4('0xd'));_0x2298d5(_0x24e5eb[_0x79e4('0x13')][_0x79e4('0x11')]);}})[_0x79e4('0x14')](function(_0x251937){logger[_0x79e4('0x10')](_0x79e4('0xc'),_0x34b8b9,_0x251937);_0x3eacdb(_0x251937);});});}exports[_0x79e4('0x15')]=function(_0x5554b6){var _0x262b50=this;return new Promise(function(_0x3b074d,_0x2d782b){return db[_0x79e4('0x16')][_0x79e4('0x17')](_0x5554b6[_0x79e4('0x18')],{'raw':_0x5554b6[_0x79e4('0x19')]?_0x5554b6[_0x79e4('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5554b6[_0x79e4('0x19')]?_0x5554b6['options'][_0x79e4('0x1a')]||null:null,'attributes':_0x5554b6[_0x79e4('0x19')]?_0x5554b6[_0x79e4('0x19')][_0x79e4('0x1b')]||null:null,'limit':_0x5554b6[_0x79e4('0x19')]?_0x5554b6[_0x79e4('0x19')][_0x79e4('0x1c')]||null:null})[_0x79e4('0xb')](function(_0x5486a9){logger['info'](_0x79e4('0x15'),_0x5554b6);logger['debug'](_0x79e4('0x15'),_0x5554b6,JSON[_0x79e4('0x1d')](_0x5486a9));_0x3b074d(_0x5486a9);})[_0x79e4('0x14')](function(_0x3c0361){logger[_0x79e4('0x10')]('UpdateFaxApplication',_0x3c0361['message'],_0x5554b6);_0x2d782b(_0x262b50['error'](0x1f4,_0x3c0361[_0x79e4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 1131984..4b92803 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 _0x8603=['../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3452eb,_0x44035e){var _0x4244fd=function(_0x48564b){while(--_0x48564b){_0x3452eb['push'](_0x3452eb['shift']());}};_0x4244fd(++_0x44035e);}(_0x8603,0x190));var _0x3860=function(_0x2a04,_0x434f07){_0x2a04=_0x2a04-0x0;var _0x2c7007=_0x8603[_0x2a04];return _0x2c7007;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0xb10b=['./faxApplication.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f583d,_0x4168a6){var _0x312c0e=function(_0x2f7690){while(--_0x2f7690){_0x4f583d['push'](_0x4f583d['shift']());}};_0x312c0e(++_0x4168a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x25bb4c,_0x1a0b53){_0x25bb4c=_0x25bb4c-0x0;var _0x4c78b2=_0xb10b[_0x25bb4c];return _0x4c78b2;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c8a9ae3..7979932 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 _0xc6ac=['ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x14ee1a,_0x273aca){var _0x3d3c61=function(_0xfaa03c){while(--_0xfaa03c){_0x14ee1a['push'](_0x14ee1a['shift']());}};_0x3d3c61(++_0x273aca);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xb0016a,_0x42ff4a){_0xb0016a=_0xb0016a-0x0;var _0x517da6=_0xc6ac[_0xb0016a];return _0x517da6;};'use strict';var Sequelize=require(_0xcc6a('0x0'));module[_0xcc6a('0x1')]={'closed':{'type':Sequelize[_0xcc6a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc6a('0x3')]},'disposition':{'type':Sequelize[_0xcc6a('0x4')]},'secondDisposition':{'type':Sequelize[_0xcc6a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcc6a('0x4')]},'note':{'type':Sequelize[_0xcc6a('0x4')]},'read1stAt':{'type':Sequelize[_0xcc6a('0x3')]},'fax':{'type':Sequelize[_0xcc6a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xcc6a('0x5')]('in',_0xcc6a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc6a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcc6a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xcc6a('0x7')]}}; \ No newline at end of file +var _0x1399=['sequelize','exports','DATE','STRING','ENUM','out','INTEGER'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x1399,0x16c));var _0x9139=function(_0xc5d3c8,_0x43352b){_0xc5d3c8=_0xc5d3c8-0x0;var _0x3537e4=_0x1399[_0xc5d3c8];return _0x3537e4;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9139('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9139('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9139('0x3')]},'note':{'type':Sequelize[_0x9139('0x3')]},'read1stAt':{'type':Sequelize[_0x9139('0x2')]},'fax':{'type':Sequelize[_0x9139('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9139('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9139('0x4')]('in',_0x9139('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x9139('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 6b0f50c..93011c0 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 _0x1259=['get','mkdirSync','Attachment','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','log','err','unlinkSync','rimraf','moment','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','type','getOptions','findAll','fax','query','user','show','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','catch','FaxMessage','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','spread','color','emit','removeTags','download','toString','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','Messages'];(function(_0x3068db,_0x39c5de){var _0xca3dbb=function(_0x2add66){while(--_0x2add66){_0x3068db['push'](_0x3068db['shift']());}};_0xca3dbb(++_0x39c5de);}(_0x1259,0xd6));var _0x9125=function(_0x5a123f,_0x14cb93){_0x5a123f=_0x5a123f-0x0;var _0x40f3e8=_0x1259[_0x5a123f];return _0x40f3e8;};'use strict';var rimraf=require(_0x9125('0x0'));var zipdir=require('zip-dir');var moment=require(_0x9125('0x1'));var BPromise=require('bluebird');var util=require(_0x9125('0x2'));var path=require(_0x9125('0x3'));var fs=require('fs');var _=require(_0x9125('0x4'));var Redis=require(_0x9125('0x5'));var interaction=require(_0x9125('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x9125('0x7'))(_0x9125('0x8'));var config=require(_0x9125('0x9'));var db=require('../../mysqldb')['db'];config[_0x9125('0xa')]=_['defaults'](config[_0x9125('0xa')],{'host':_0x9125('0xb'),'port':0x18eb});var socket=require(_0x9125('0xc'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x9125('0xd')](socket);function respondWithStatusCode(_0xd41d41,_0x381024){_0x381024=_0x381024||0xcc;return function(_0x4d0ef8){if(_0x4d0ef8){return _0xd41d41[_0x9125('0xe')](_0x381024);}return _0xd41d41[_0x9125('0xf')](_0x381024)[_0x9125('0x10')]();};}function respondWithResult(_0x19c726,_0x32f246){_0x32f246=_0x32f246||0xc8;return function(_0x43ca11){if(_0x43ca11){return _0x19c726[_0x9125('0xf')](_0x32f246)[_0x9125('0x11')](_0x43ca11);}};}function respondWithFilteredResult(_0x1d0601,_0x2bf2aa){return function(_0x4e4867){if(_0x4e4867){var _0xfb2676=typeof _0x2bf2aa[_0x9125('0x12')]==='undefined'&&typeof _0x2bf2aa['limit']===_0x9125('0x13');var _0x59a58f=_0x4e4867['count'];var _0x394b23=_0xfb2676?0x0:_0x2bf2aa[_0x9125('0x12')];var _0x20e6e6=_0xfb2676?_0x4e4867[_0x9125('0x14')]:_0x2bf2aa['offset']+_0x2bf2aa[_0x9125('0x15')];var _0x1b189c;if(_0x20e6e6>=_0x59a58f){_0x20e6e6=_0x59a58f;_0x1b189c=0xc8;}else{_0x1b189c=0xce;}_0x1d0601[_0x9125('0xf')](_0x1b189c);return _0x1d0601[_0x9125('0x16')](_0x9125('0x17'),_0x394b23+'-'+_0x20e6e6+'/'+_0x59a58f)[_0x9125('0x11')](_0x4e4867);}return null;};}function saveUpdates(_0x181a79){return function(_0x18eede){if(_0x18eede){return _0x18eede[_0x9125('0x18')](_0x181a79)['then'](function(_0x273308){return _0x273308;});}return null;};}function removeEntity(_0x445ab3){return function(_0x3aa0d3){if(_0x3aa0d3){return _0x3aa0d3[_0x9125('0x19')]()[_0x9125('0x1a')](function(){_0x445ab3[_0x9125('0xf')](0xcc)[_0x9125('0x10')]();});}};}function handleEntityNotFound(_0xa045ec){return function(_0x321318){if(!_0x321318){_0xa045ec[_0x9125('0xe')](0x194);}return _0x321318;};}function handleError(_0x3cd58e,_0x1a6cf7){_0x1a6cf7=_0x1a6cf7||0x1f4;return function(_0x2088e3){logger[_0x9125('0x1b')](_0x2088e3[_0x9125('0x1c')]);if(_0x2088e3['name']){delete _0x2088e3[_0x9125('0x1d')];}_0x3cd58e[_0x9125('0xf')](_0x1a6cf7)[_0x9125('0x1e')](_0x2088e3);};}exports[_0x9125('0x1f')]=function(_0x3c4c24,_0x1c3382){var _0x1c24fa={};var _0x5bc970=_[_0x9125('0x20')](db[_0x9125('0x21')][_0x9125('0x22')],function(_0x3dbcc0){return{'name':_0x3dbcc0['fieldName'],'type':_0x3dbcc0[_0x9125('0x23')]['key']};});_0x1c24fa=qs[_0x9125('0x24')](_0x5bc970,_0x3c4c24);return interaction[_0x9125('0x25')](_0x9125('0x26'),_0x3c4c24[_0x9125('0x27')],_0x3c4c24[_0x9125('0x28')],_0x1c24fa,_0x5bc970)['then'](respondWithFilteredResult(_0x1c3382,_0x1c24fa))['catch'](handleError(_0x1c3382,null));};exports[_0x9125('0x29')]=function(_0x3e8c3c,_0x49d3e7){var _0x35b513={'raw':![],'where':{'id':_0x3e8c3c['params']['id']}},_0x30502e={};_0x30502e['model']=_[_0x9125('0x2a')](db[_0x9125('0x21')]['rawAttributes']);_0x30502e[_0x9125('0x27')]=_[_0x9125('0x2a')](_0x3e8c3c[_0x9125('0x27')]);_0x30502e[_0x9125('0x2b')]=_[_0x9125('0x2c')](_0x30502e[_0x9125('0x2d')],_0x30502e[_0x9125('0x27')]);_0x35b513[_0x9125('0x2e')]=_[_0x9125('0x2c')](_0x30502e[_0x9125('0x2d')],qs[_0x9125('0x2f')](_0x3e8c3c[_0x9125('0x27')][_0x9125('0x2f')]));_0x35b513['attributes']=_0x35b513['attributes'][_0x9125('0x30')]?_0x35b513[_0x9125('0x2e')]:_0x30502e[_0x9125('0x2d')];if(_0x3e8c3c[_0x9125('0x27')][_0x9125('0x31')]){_0x35b513[_0x9125('0x32')]=[{'all':!![]}];}_0x35b513=_[_0x9125('0x33')]({},_0x35b513,_0x3e8c3c[_0x9125('0x34')]);return db[_0x9125('0x21')][_0x9125('0x35')](_0x35b513)['then'](handleEntityNotFound(_0x49d3e7,null))[_0x9125('0x1a')](respondWithResult(_0x49d3e7,null))['catch'](handleError(_0x49d3e7,null));};exports['create']=function(_0x3c0368,_0x39cfb4){return db[_0x9125('0x21')][_0x9125('0x36')](_0x3c0368['body'],{})['then'](respondWithResult(_0x39cfb4,0xc9))['catch'](handleError(_0x39cfb4,null));};exports[_0x9125('0x18')]=function(_0x14212b,_0x4f80cf){if(_0x14212b['body']['id']){delete _0x14212b[_0x9125('0x37')]['id'];}return db[_0x9125('0x21')][_0x9125('0x35')]({'where':{'id':_0x14212b[_0x9125('0x38')]['id']}})[_0x9125('0x1a')](handleEntityNotFound(_0x4f80cf,null))['then'](saveUpdates(_0x14212b['body'],null))['then'](respondWithResult(_0x4f80cf,null))['catch'](handleError(_0x4f80cf,null));};exports[_0x9125('0x19')]=function(_0x3dafe5,_0x3e42f1){return db[_0x9125('0x21')][_0x9125('0x35')]({'where':{'id':_0x3dafe5['params']['id']}})['then'](handleEntityNotFound(_0x3e42f1,null))[_0x9125('0x1a')](removeEntity(_0x3e42f1,null))['catch'](handleError(_0x3e42f1,null));};exports[_0x9125('0x39')]=function(_0x59e7aa,_0x29129f){return db['FaxInteraction'][_0x9125('0x39')]()[_0x9125('0x1a')](respondWithResult(_0x29129f,null))[_0x9125('0x3a')](handleError(_0x29129f,null));};exports['addMessage']=function(_0x73dcf1,_0x39f316){return db[_0x9125('0x3b')][_0x9125('0x35')]({'where':{'id':_0x73dcf1[_0x9125('0x38')]['id']}})[_0x9125('0x1a')](handleEntityNotFound(_0x39f316,null))[_0x9125('0x1a')](function(_0x566eda){if(_0x566eda){return _0x566eda[_0x9125('0x3c')](_0x73dcf1[_0x9125('0x37')][_0x9125('0x3d')],_[_0x9125('0x3e')](_0x73dcf1[_0x9125('0x37')],[_0x9125('0x3d'),'id'])||{});}})[_0x9125('0x1a')](respondWithResult(_0x39f316,null))[_0x9125('0x3a')](handleError(_0x39f316,null));};exports[_0x9125('0x3f')]=function(_0x30c41d,_0x308788){var _0x24ccfd={'raw':![],'where':{}};var _0x4f6625={};var _0x486437={'count':0x0,'rows':[]};return db[_0x9125('0x21')]['findOne']({'where':{'id':_0x30c41d[_0x9125('0x38')]['id']}})[_0x9125('0x1a')](handleEntityNotFound(_0x308788,null))[_0x9125('0x1a')](function(_0x3b42d5){if(_0x3b42d5){_0x4f6625[_0x9125('0x2d')]=_[_0x9125('0x2a')](db[_0x9125('0x3b')][_0x9125('0x22')]);_0x4f6625[_0x9125('0x27')]=_[_0x9125('0x2a')](_0x30c41d[_0x9125('0x27')]);_0x4f6625[_0x9125('0x2b')]=_[_0x9125('0x2c')](_0x4f6625[_0x9125('0x2d')],_0x4f6625[_0x9125('0x27')]);_0x24ccfd['attributes']=_[_0x9125('0x2c')](_0x4f6625[_0x9125('0x2d')],qs['fields'](_0x30c41d[_0x9125('0x27')][_0x9125('0x2f')]));_0x24ccfd[_0x9125('0x2e')]=_0x24ccfd['attributes'][_0x9125('0x30')]?_0x24ccfd['attributes']:_0x4f6625[_0x9125('0x2d')];if(!_0x30c41d[_0x9125('0x27')][_0x9125('0x40')](_0x9125('0x41'))){_0x24ccfd[_0x9125('0x15')]=qs[_0x9125('0x15')](_0x30c41d[_0x9125('0x27')][_0x9125('0x15')]);_0x24ccfd[_0x9125('0x12')]=qs[_0x9125('0x12')](_0x30c41d[_0x9125('0x27')]['offset']);}_0x24ccfd[_0x9125('0x42')]=qs['sort'](_0x30c41d[_0x9125('0x27')][_0x9125('0x43')]);_0x24ccfd[_0x9125('0x44')]=qs[_0x9125('0x2b')](_['pick'](_0x30c41d[_0x9125('0x27')],_0x4f6625[_0x9125('0x2b')]));_0x24ccfd[_0x9125('0x44')][_0x9125('0x45')]=_0x3b42d5['id'];if(_0x30c41d[_0x9125('0x27')][_0x9125('0x46')]){_0x24ccfd[_0x9125('0x44')]=_[_0x9125('0x33')](_0x24ccfd[_0x9125('0x44')],{'$or':_[_0x9125('0x20')](_0x24ccfd['attributes'],function(_0x441986){var _0x5cf6b8={};_0x5cf6b8[_0x441986]={'$like':'%'+_0x30c41d[_0x9125('0x27')][_0x9125('0x46')]+'%'};return _0x5cf6b8;})});}if(_0x30c41d[_0x9125('0x27')][_0x9125('0x47')]){var _0x37d33a=_0x30c41d[_0x9125('0x27')]['$gte'][_0x9125('0x48')](',');var _0x332110={};_0x332110[_0x37d33a[0x0]]={'$gte':moment(_0x37d33a[0x1])[_0x9125('0x49')](_0x9125('0x4a'))};_0x24ccfd[_0x9125('0x44')]=_[_0x9125('0x33')](_0x24ccfd[_0x9125('0x44')],_0x332110);}_0x24ccfd=_[_0x9125('0x33')]({},_0x24ccfd,_0x30c41d['options']);return db['FaxMessage']['count']({'where':_0x24ccfd['where']})['then'](function(_0x367f54){_0x486437[_0x9125('0x14')]=_0x367f54;if(_0x30c41d[_0x9125('0x27')][_0x9125('0x31')]){_0x24ccfd[_0x9125('0x32')]=[{'all':!![]}];}return db[_0x9125('0x3b')][_0x9125('0x25')](_0x24ccfd);})[_0x9125('0x1a')](function(_0x304f59){_0x486437['rows']=_0x304f59;return _0x486437;});}})[_0x9125('0x1a')](respondWithFilteredResult(_0x308788,_0x24ccfd))[_0x9125('0x3a')](handleError(_0x308788,null));};exports['addTags']=function(_0x374ffc,_0x37c97d){return db[_0x9125('0x21')][_0x9125('0x35')]({'where':{'id':_0x374ffc[_0x9125('0x38')]['id']}})[_0x9125('0x1a')](handleEntityNotFound(_0x37c97d,null))[_0x9125('0x1a')](function(_0x42c13c){if(_0x42c13c){return _0x42c13c['setTags'](_0x374ffc['body'][_0x9125('0x3d')],_['omit'](_0x374ffc[_0x9125('0x37')],[_0x9125('0x3d'),'id'])||{})[_0x9125('0x4b')](function(){return db['Tag'][_0x9125('0x25')]({'attributes':['id',_0x9125('0x1d'),_0x9125('0x4c')],'where':{'id':_0x374ffc[_0x9125('0x37')][_0x9125('0x3d')]}});})[_0x9125('0x1a')](function(_0x2b2e90){socket[_0x9125('0x4d')]('faxInteractionTags:save',{'id':Number(_0x374ffc['params']['id']),'tags':_0x2b2e90||[]});return{'id':Number(_0x374ffc[_0x9125('0x38')]['id']),'tags':_0x2b2e90||[]};});}})[_0x9125('0x1a')](respondWithResult(_0x37c97d,null))[_0x9125('0x3a')](handleError(_0x37c97d,null));};exports[_0x9125('0x4e')]=function(_0x2ecf0b,_0x395abb){return db[_0x9125('0x21')][_0x9125('0x35')]({'where':{'id':_0x2ecf0b['params']['id']}})[_0x9125('0x1a')](handleEntityNotFound(_0x395abb,null))[_0x9125('0x1a')](function(_0x2671e3){if(_0x2671e3){return _0x2671e3[_0x9125('0x4e')](_0x2ecf0b[_0x9125('0x27')][_0x9125('0x3d')]);}})[_0x9125('0x1a')](respondWithStatusCode(_0x395abb,null))[_0x9125('0x3a')](handleError(_0x395abb,null));};exports[_0x9125('0x4f')]=function(_0x543fbd,_0x178d47){var _0x2dcf91=moment()['unix']()[_0x9125('0x50')]();var _0x228384=path['join'](config[_0x9125('0x51')],_0x9125('0x52'),_0x9125('0x53'),_0x9125('0x54'));var _0x3bd81e=path['join'](config[_0x9125('0x51')],_0x9125('0x52'),'files',_0x9125('0x55'));var _0x36dfa4=path[_0x9125('0x56')](_0x228384,_0x2dcf91);var _0x400380=util[_0x9125('0x49')](_0x9125('0x57'),_0x543fbd[_0x9125('0x38')]['id'],_0x2dcf91);var _0x4fc397=path[_0x9125('0x56')](_0x228384,_0x400380);var _0x10d0a0=[];_0x10d0a0['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x3ec2af=[{'model':db[_0x9125('0x3b')],'as':_0x9125('0x58'),'attributes':['id',_0x9125('0x37'),'createdAt'],'include':_0x10d0a0}];return db[_0x9125('0x21')][_0x9125('0x35')]({'where':{'id':_0x543fbd['params']['id']},'include':_0x3ec2af})[_0x9125('0x1a')](handleEntityNotFound(_0x178d47,null))['then'](function(_0x5f599b){if(_0x5f599b&&_0x5f599b[_0x9125('0x58')]){var _0x30a32a=_0x5f599b[_0x9125('0x59')]({'plain':!![]});fs[_0x9125('0x5a')](_0x36dfa4);for(var _0x341089=0x0;_0x341089<_0x30a32a[_0x9125('0x58')][_0x9125('0x30')];_0x341089++){var _0x88ac19=_0x30a32a[_0x9125('0x58')][_0x341089][_0x9125('0x5b')];if(_0x88ac19){var _0x156dd0=path[_0x9125('0x56')](_0x3bd81e,_0x88ac19['basename']);if(fs[_0x9125('0x5c')](_0x156dd0)){fs[_0x9125('0x5d')](_0x156dd0)[_0x9125('0x5e')](fs[_0x9125('0x5f')](path[_0x9125('0x56')](_0x36dfa4,_0x88ac19[_0x9125('0x60')])));}}}return BPromise[_0x9125('0x61')]()[_0x9125('0x1a')](function(){return new BPromise(function(_0x3a3b73,_0x3367ef){zipdir(_0x36dfa4,{'saveTo':_0x4fc397},function(_0x8c502b,_0x2fe78b){if(_0x8c502b)return _0x3367ef(_0x8c502b);return _0x3a3b73(_0x2fe78b);});})[_0x9125('0x1a')](function(){return new BPromise(function(_0x5ed77f,_0x14050b){rimraf(_0x36dfa4,function(_0x376b2c){if(_0x376b2c)_0x14050b(_0x376b2c);return _0x5ed77f();});});})['then'](function(){return _0x178d47[_0x9125('0x4f')](_0x4fc397,_0x400380,function(_0x27fecc){if(_0x27fecc){console[_0x9125('0x62')](_0x9125('0x63'),_0x27fecc);}else{fs[_0x9125('0x64')](_0x4fc397);}});});});}else{return _0x178d47[_0x9125('0xe')](0xc8);}})[_0x9125('0x3a')](handleError(_0x178d47,null));}; \ No newline at end of file +var _0xf4f1=['find','create','body','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','filters','nolimit','sort','pick','where','FaxInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','color','faxInteractionTags:save','removeTags','download','toString','join','server','files','tmp','root','transcript-%d-%s.zip','Attachment','createdAt','Messages','get','mkdirSync','basename','createReadStream','createWriteStream','resolve','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','findAll','user','catch','model','keys','FaxInteraction','query','intersection','fields','attributes','length','includeAll','include','options'];(function(_0x1390ff,_0x29b25a){var _0x4ea773=function(_0xf7a9e3){while(--_0xf7a9e3){_0x1390ff['push'](_0x1390ff['shift']());}};_0x4ea773(++_0x29b25a);}(_0xf4f1,0x15b));var _0x1f4f=function(_0x573e27,_0x5478fd){_0x573e27=_0x573e27-0x0;var _0x46c3a7=_0xf4f1[_0x573e27];return _0x46c3a7;};'use strict';var rimraf=require(_0x1f4f('0x0'));var zipdir=require(_0x1f4f('0x1'));var moment=require('moment');var BPromise=require(_0x1f4f('0x2'));var util=require(_0x1f4f('0x3'));var path=require(_0x1f4f('0x4'));var fs=require('fs');var _=require(_0x1f4f('0x5'));var Redis=require(_0x1f4f('0x6'));var interaction=require(_0x1f4f('0x7'));var qs=require(_0x1f4f('0x8'));var logger=require(_0x1f4f('0x9'))(_0x1f4f('0xa'));var config=require(_0x1f4f('0xb'));var db=require(_0x1f4f('0xc'))['db'];config[_0x1f4f('0xd')]=_[_0x1f4f('0xe')](config[_0x1f4f('0xd')],{'host':_0x1f4f('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1f4f('0x10'))[_0x1f4f('0x11')](socket);function respondWithStatusCode(_0x1643ed,_0x484206){_0x484206=_0x484206||0xcc;return function(_0x4f4b55){if(_0x4f4b55){return _0x1643ed[_0x1f4f('0x12')](_0x484206);}return _0x1643ed[_0x1f4f('0x13')](_0x484206)[_0x1f4f('0x14')]();};}function respondWithResult(_0xd86f7b,_0x42fd73){_0x42fd73=_0x42fd73||0xc8;return function(_0x11f2be){if(_0x11f2be){return _0xd86f7b[_0x1f4f('0x13')](_0x42fd73)[_0x1f4f('0x15')](_0x11f2be);}};}function respondWithFilteredResult(_0xa10dca,_0x10a84a){return function(_0x3d4823){if(_0x3d4823){var _0x4daeae=typeof _0x10a84a[_0x1f4f('0x16')]===_0x1f4f('0x17')&&typeof _0x10a84a['limit']==='undefined';var _0x2dc0a6=_0x3d4823[_0x1f4f('0x18')];var _0x1ca2ea=_0x4daeae?0x0:_0x10a84a[_0x1f4f('0x16')];var _0x241c0b=_0x4daeae?_0x3d4823[_0x1f4f('0x18')]:_0x10a84a[_0x1f4f('0x16')]+_0x10a84a[_0x1f4f('0x19')];var _0x3c7c62;if(_0x241c0b>=_0x2dc0a6){_0x241c0b=_0x2dc0a6;_0x3c7c62=0xc8;}else{_0x3c7c62=0xce;}_0xa10dca[_0x1f4f('0x13')](_0x3c7c62);return _0xa10dca[_0x1f4f('0x1a')]('Content-Range',_0x1ca2ea+'-'+_0x241c0b+'/'+_0x2dc0a6)[_0x1f4f('0x15')](_0x3d4823);}return null;};}function saveUpdates(_0x48edb5){return function(_0x27c8cf){if(_0x27c8cf){return _0x27c8cf[_0x1f4f('0x1b')](_0x48edb5)[_0x1f4f('0x1c')](function(_0xd478c8){return _0xd478c8;});}return null;};}function removeEntity(_0x35d52a){return function(_0x4aa23f){if(_0x4aa23f){return _0x4aa23f[_0x1f4f('0x1d')]()[_0x1f4f('0x1c')](function(){_0x35d52a[_0x1f4f('0x13')](0xcc)[_0x1f4f('0x14')]();});}};}function handleEntityNotFound(_0x19e905){return function(_0x594429){if(!_0x594429){_0x19e905[_0x1f4f('0x12')](0x194);}return _0x594429;};}function handleError(_0x37729,_0xa92f37){_0xa92f37=_0xa92f37||0x1f4;return function(_0x19c101){logger[_0x1f4f('0x1e')](_0x19c101[_0x1f4f('0x1f')]);if(_0x19c101[_0x1f4f('0x20')]){delete _0x19c101[_0x1f4f('0x20')];}_0x37729['status'](_0xa92f37)[_0x1f4f('0x21')](_0x19c101);};}exports['index']=function(_0x296df7,_0x904d2){var _0x59ffde={};var _0x2c301a=_[_0x1f4f('0x22')](db['FaxInteraction'][_0x1f4f('0x23')],function(_0x1038bb){return{'name':_0x1038bb[_0x1f4f('0x24')],'type':_0x1038bb[_0x1f4f('0x25')][_0x1f4f('0x26')]};});_0x59ffde=qs['getOptions'](_0x2c301a,_0x296df7);return interaction[_0x1f4f('0x27')]('fax',_0x296df7['query'],_0x296df7[_0x1f4f('0x28')],_0x59ffde,_0x2c301a)['then'](respondWithFilteredResult(_0x904d2,_0x59ffde))[_0x1f4f('0x29')](handleError(_0x904d2,null));};exports['show']=function(_0x2c4d73,_0x506ea6){var _0x134fb3={'raw':![],'where':{'id':_0x2c4d73['params']['id']}},_0x3e1bba={};_0x3e1bba[_0x1f4f('0x2a')]=_[_0x1f4f('0x2b')](db[_0x1f4f('0x2c')][_0x1f4f('0x23')]);_0x3e1bba[_0x1f4f('0x2d')]=_[_0x1f4f('0x2b')](_0x2c4d73[_0x1f4f('0x2d')]);_0x3e1bba['filters']=_[_0x1f4f('0x2e')](_0x3e1bba[_0x1f4f('0x2a')],_0x3e1bba['query']);_0x134fb3['attributes']=_['intersection'](_0x3e1bba['model'],qs[_0x1f4f('0x2f')](_0x2c4d73['query'][_0x1f4f('0x2f')]));_0x134fb3[_0x1f4f('0x30')]=_0x134fb3['attributes'][_0x1f4f('0x31')]?_0x134fb3['attributes']:_0x3e1bba['model'];if(_0x2c4d73[_0x1f4f('0x2d')][_0x1f4f('0x32')]){_0x134fb3[_0x1f4f('0x33')]=[{'all':!![]}];}_0x134fb3=_['merge']({},_0x134fb3,_0x2c4d73[_0x1f4f('0x34')]);return db[_0x1f4f('0x2c')][_0x1f4f('0x35')](_0x134fb3)[_0x1f4f('0x1c')](handleEntityNotFound(_0x506ea6,null))['then'](respondWithResult(_0x506ea6,null))['catch'](handleError(_0x506ea6,null));};exports['create']=function(_0x41b869,_0x1af9ad){return db[_0x1f4f('0x2c')][_0x1f4f('0x36')](_0x41b869[_0x1f4f('0x37')],{})[_0x1f4f('0x1c')](respondWithResult(_0x1af9ad,0xc9))[_0x1f4f('0x29')](handleError(_0x1af9ad,null));};exports['update']=function(_0x538748,_0x20e5c0){if(_0x538748[_0x1f4f('0x37')]['id']){delete _0x538748[_0x1f4f('0x37')]['id'];}return db['FaxInteraction'][_0x1f4f('0x35')]({'where':{'id':_0x538748[_0x1f4f('0x38')]['id']}})[_0x1f4f('0x1c')](handleEntityNotFound(_0x20e5c0,null))[_0x1f4f('0x1c')](saveUpdates(_0x538748['body'],null))['then'](respondWithResult(_0x20e5c0,null))[_0x1f4f('0x29')](handleError(_0x20e5c0,null));};exports[_0x1f4f('0x1d')]=function(_0x1f5600,_0x225e98){return db[_0x1f4f('0x2c')][_0x1f4f('0x35')]({'where':{'id':_0x1f5600['params']['id']}})[_0x1f4f('0x1c')](handleEntityNotFound(_0x225e98,null))['then'](removeEntity(_0x225e98,null))[_0x1f4f('0x29')](handleError(_0x225e98,null));};exports[_0x1f4f('0x39')]=function(_0x4d3cc5,_0x1f6ec5){return db[_0x1f4f('0x2c')][_0x1f4f('0x39')]()[_0x1f4f('0x1c')](respondWithResult(_0x1f6ec5,null))['catch'](handleError(_0x1f6ec5,null));};exports[_0x1f4f('0x3a')]=function(_0xee5e3f,_0x3bccb6){return db[_0x1f4f('0x3b')][_0x1f4f('0x35')]({'where':{'id':_0xee5e3f[_0x1f4f('0x38')]['id']}})[_0x1f4f('0x1c')](handleEntityNotFound(_0x3bccb6,null))[_0x1f4f('0x1c')](function(_0x28a80f){if(_0x28a80f){return _0x28a80f[_0x1f4f('0x3a')](_0xee5e3f[_0x1f4f('0x37')]['ids'],_['omit'](_0xee5e3f[_0x1f4f('0x37')],[_0x1f4f('0x3c'),'id'])||{});}})[_0x1f4f('0x1c')](respondWithResult(_0x3bccb6,null))[_0x1f4f('0x29')](handleError(_0x3bccb6,null));};exports[_0x1f4f('0x3d')]=function(_0x5ebcff,_0x31ed97){var _0x46694d={'raw':![],'where':{}};var _0x183f84={};var _0x43d8f9={'count':0x0,'rows':[]};return db[_0x1f4f('0x2c')][_0x1f4f('0x3e')]({'where':{'id':_0x5ebcff[_0x1f4f('0x38')]['id']}})['then'](handleEntityNotFound(_0x31ed97,null))[_0x1f4f('0x1c')](function(_0x1af883){if(_0x1af883){_0x183f84[_0x1f4f('0x2a')]=_[_0x1f4f('0x2b')](db[_0x1f4f('0x3b')][_0x1f4f('0x23')]);_0x183f84[_0x1f4f('0x2d')]=_[_0x1f4f('0x2b')](_0x5ebcff['query']);_0x183f84[_0x1f4f('0x3f')]=_[_0x1f4f('0x2e')](_0x183f84['model'],_0x183f84[_0x1f4f('0x2d')]);_0x46694d[_0x1f4f('0x30')]=_['intersection'](_0x183f84[_0x1f4f('0x2a')],qs['fields'](_0x5ebcff['query'][_0x1f4f('0x2f')]));_0x46694d[_0x1f4f('0x30')]=_0x46694d['attributes']['length']?_0x46694d[_0x1f4f('0x30')]:_0x183f84[_0x1f4f('0x2a')];if(!_0x5ebcff[_0x1f4f('0x2d')]['hasOwnProperty'](_0x1f4f('0x40'))){_0x46694d[_0x1f4f('0x19')]=qs['limit'](_0x5ebcff['query']['limit']);_0x46694d['offset']=qs[_0x1f4f('0x16')](_0x5ebcff[_0x1f4f('0x2d')][_0x1f4f('0x16')]);}_0x46694d['order']=qs[_0x1f4f('0x41')](_0x5ebcff[_0x1f4f('0x2d')][_0x1f4f('0x41')]);_0x46694d['where']=qs[_0x1f4f('0x3f')](_[_0x1f4f('0x42')](_0x5ebcff[_0x1f4f('0x2d')],_0x183f84[_0x1f4f('0x3f')]));_0x46694d[_0x1f4f('0x43')][_0x1f4f('0x44')]=_0x1af883['id'];if(_0x5ebcff[_0x1f4f('0x2d')][_0x1f4f('0x45')]){_0x46694d['where']=_[_0x1f4f('0x46')](_0x46694d['where'],{'$or':_[_0x1f4f('0x22')](_0x46694d['attributes'],function(_0x3cdc1f){var _0x26405e={};_0x26405e[_0x3cdc1f]={'$like':'%'+_0x5ebcff[_0x1f4f('0x2d')][_0x1f4f('0x45')]+'%'};return _0x26405e;})});}if(_0x5ebcff[_0x1f4f('0x2d')][_0x1f4f('0x47')]){var _0x5370e9=_0x5ebcff[_0x1f4f('0x2d')][_0x1f4f('0x47')][_0x1f4f('0x48')](',');var _0x3aa0ab={};_0x3aa0ab[_0x5370e9[0x0]]={'$gte':moment(_0x5370e9[0x1])[_0x1f4f('0x49')](_0x1f4f('0x4a'))};_0x46694d[_0x1f4f('0x43')]=_['merge'](_0x46694d['where'],_0x3aa0ab);}_0x46694d=_[_0x1f4f('0x46')]({},_0x46694d,_0x5ebcff[_0x1f4f('0x34')]);return db[_0x1f4f('0x3b')][_0x1f4f('0x18')]({'where':_0x46694d[_0x1f4f('0x43')]})[_0x1f4f('0x1c')](function(_0x359c18){_0x43d8f9[_0x1f4f('0x18')]=_0x359c18;if(_0x5ebcff['query'][_0x1f4f('0x32')]){_0x46694d[_0x1f4f('0x33')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x46694d);})[_0x1f4f('0x1c')](function(_0x188405){_0x43d8f9[_0x1f4f('0x4b')]=_0x188405;return _0x43d8f9;});}})[_0x1f4f('0x1c')](respondWithFilteredResult(_0x31ed97,_0x46694d))[_0x1f4f('0x29')](handleError(_0x31ed97,null));};exports[_0x1f4f('0x4c')]=function(_0x181dc8,_0x269913){return db[_0x1f4f('0x2c')]['find']({'where':{'id':_0x181dc8[_0x1f4f('0x38')]['id']}})['then'](handleEntityNotFound(_0x269913,null))[_0x1f4f('0x1c')](function(_0x6d4cf5){if(_0x6d4cf5){return _0x6d4cf5['setTags'](_0x181dc8['body'][_0x1f4f('0x3c')],_['omit'](_0x181dc8[_0x1f4f('0x37')],['ids','id'])||{})[_0x1f4f('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id',_0x1f4f('0x20'),_0x1f4f('0x4e')],'where':{'id':_0x181dc8[_0x1f4f('0x37')][_0x1f4f('0x3c')]}});})['then'](function(_0x52f5e2){socket['emit'](_0x1f4f('0x4f'),{'id':Number(_0x181dc8['params']['id']),'tags':_0x52f5e2||[]});return{'id':Number(_0x181dc8[_0x1f4f('0x38')]['id']),'tags':_0x52f5e2||[]};});}})['then'](respondWithResult(_0x269913,null))[_0x1f4f('0x29')](handleError(_0x269913,null));};exports[_0x1f4f('0x50')]=function(_0x56875d,_0x2f047a){return db[_0x1f4f('0x2c')][_0x1f4f('0x35')]({'where':{'id':_0x56875d[_0x1f4f('0x38')]['id']}})[_0x1f4f('0x1c')](handleEntityNotFound(_0x2f047a,null))['then'](function(_0x5812ba){if(_0x5812ba){return _0x5812ba[_0x1f4f('0x50')](_0x56875d['query'][_0x1f4f('0x3c')]);}})[_0x1f4f('0x1c')](respondWithStatusCode(_0x2f047a,null))[_0x1f4f('0x29')](handleError(_0x2f047a,null));};exports[_0x1f4f('0x51')]=function(_0x367dec,_0x49a9d0){var _0x112604=moment()['unix']()[_0x1f4f('0x52')]();var _0x5101a9=path[_0x1f4f('0x53')](config['root'],_0x1f4f('0x54'),_0x1f4f('0x55'),_0x1f4f('0x56'));var _0x15c208=path['join'](config[_0x1f4f('0x57')],_0x1f4f('0x54'),_0x1f4f('0x55'),'attachments');var _0x1c8d52=path['join'](_0x5101a9,_0x112604);var _0x502745=util[_0x1f4f('0x49')](_0x1f4f('0x58'),_0x367dec[_0x1f4f('0x38')]['id'],_0x112604);var _0x508c05=path[_0x1f4f('0x53')](_0x5101a9,_0x502745);var _0x116b13=[];_0x116b13['push']({'model':db[_0x1f4f('0x59')],'as':_0x1f4f('0x59'),'raw':!![]});var _0xd007d7=[{'model':db[_0x1f4f('0x3b')],'as':'Messages','attributes':['id',_0x1f4f('0x37'),_0x1f4f('0x5a')],'include':_0x116b13}];return db[_0x1f4f('0x2c')][_0x1f4f('0x35')]({'where':{'id':_0x367dec[_0x1f4f('0x38')]['id']},'include':_0xd007d7})[_0x1f4f('0x1c')](handleEntityNotFound(_0x49a9d0,null))['then'](function(_0xb1c62e){if(_0xb1c62e&&_0xb1c62e[_0x1f4f('0x5b')]){var _0x237a2b=_0xb1c62e[_0x1f4f('0x5c')]({'plain':!![]});fs[_0x1f4f('0x5d')](_0x1c8d52);for(var _0x5d41ec=0x0;_0x5d41ec<_0x237a2b[_0x1f4f('0x5b')][_0x1f4f('0x31')];_0x5d41ec++){var _0x367631=_0x237a2b[_0x1f4f('0x5b')][_0x5d41ec][_0x1f4f('0x59')];if(_0x367631){var _0x194cb1=path[_0x1f4f('0x53')](_0x15c208,_0x367631[_0x1f4f('0x5e')]);if(fs['existsSync'](_0x194cb1)){fs[_0x1f4f('0x5f')](_0x194cb1)['pipe'](fs[_0x1f4f('0x60')](path[_0x1f4f('0x53')](_0x1c8d52,_0x367631[_0x1f4f('0x5e')])));}}}return BPromise[_0x1f4f('0x61')]()[_0x1f4f('0x1c')](function(){return new BPromise(function(_0x43f005,_0x4df3a9){zipdir(_0x1c8d52,{'saveTo':_0x508c05},function(_0x59bfec,_0x366bf7){if(_0x59bfec)return _0x4df3a9(_0x59bfec);return _0x43f005(_0x366bf7);});})[_0x1f4f('0x1c')](function(){return new BPromise(function(_0x5b3b80,_0x47e0c7){rimraf(_0x1c8d52,function(_0xefdc4f){if(_0xefdc4f)_0x47e0c7(_0xefdc4f);return _0x5b3b80();});});})[_0x1f4f('0x1c')](function(){return _0x49a9d0[_0x1f4f('0x51')](_0x508c05,_0x502745,function(_0x4ca291){if(_0x4ca291){console['log'](_0x1f4f('0x62'),_0x4ca291);}else{fs[_0x1f4f('0x63')](_0x508c05);}});});});}else{return _0x49a9d0['sendStatus'](0xc8);}})[_0x1f4f('0x29')](handleError(_0x49a9d0,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b0c9be2..7c2e890 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 _0xd063=['update','then','Users','map','findAll','setDataValue','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xd063,0x1aa));var _0x3d06=function(_0x3e3c1d,_0x31f577){_0x3e3c1d=_0x3e3c1d-0x0;var _0x8b1dcb=_0xd063[_0x3e3c1d];return _0x8b1dcb;};'use strict';var EventEmitter=require(_0x3d06('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x3d06('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3d06('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d06('0x3'),'afterDestroy':'remove'};function emitEvent(_0x19a961){return function(_0x30dfbb,_0x22be74,_0x440ec6){_0x30dfbb['getUsers']({'attributes':['id'],'raw':!![]})[_0x3d06('0x4')](function(_0x41fe44){_0x30dfbb['setDataValue'](_0x3d06('0x5'),_0x41fe44[_0x3d06('0x6')](function(_0x270d18){return{'id':_0x270d18['id']};}));return FaxMessage[_0x3d06('0x7')]({'where':{'FaxInteractionId':_0x30dfbb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d06('0x4')](function(_0xc44062){_0x30dfbb[_0x3d06('0x8')]('unreadMessages',_0xc44062['length']);FaxInteractionEvents['emit'](_0x19a961+':'+_0x30dfbb['id'],_0x30dfbb);FaxInteractionEvents[_0x3d06('0x9')](_0x19a961,_0x30dfbb);_0x440ec6(null);})['catch'](_0x440ec6(null));};}for(var e in events){if(events[_0x3d06('0xa')](e)){var event=events[e];FaxInteraction[_0x3d06('0xb')](e,emitEvent(event));}}module[_0x3d06('0xc')]=FaxInteractionEvents; \ No newline at end of file +var _0xd389=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','setDataValue','Users'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xd389,0x107));var _0x9d38=function(_0x5aa640,_0x8b110e){_0x5aa640=_0x5aa640-0x0;var _0x11aebf=_0xd389[_0x5aa640];return _0x11aebf;};'use strict';var EventEmitter=require(_0x9d38('0x0'));var FaxInteraction=require(_0x9d38('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x9d38('0x1'))['db'][_0x9d38('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9d38('0x3')](0x0);var events={'afterCreate':_0x9d38('0x4'),'afterUpdate':_0x9d38('0x5'),'afterDestroy':_0x9d38('0x6')};function emitEvent(_0x10e5fc){return function(_0x33cc51,_0x6c881c,_0x1346c0){_0x33cc51['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x133063){_0x33cc51[_0x9d38('0x7')](_0x9d38('0x8'),_0x133063[_0x9d38('0x9')](function(_0x5598b8){return{'id':_0x5598b8['id']};}));return FaxMessage[_0x9d38('0xa')]({'where':{'FaxInteractionId':_0x33cc51['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xf6b152){_0x33cc51[_0x9d38('0x7')](_0x9d38('0xb'),_0xf6b152[_0x9d38('0xc')]);FaxInteractionEvents[_0x9d38('0xd')](_0x10e5fc+':'+_0x33cc51['id'],_0x33cc51);FaxInteractionEvents[_0x9d38('0xd')](_0x10e5fc,_0x33cc51);_0x1346c0(null);})[_0x9d38('0xe')](_0x1346c0(null));};}for(var e in events){if(events[_0x9d38('0xf')](e)){var event=events[e];FaxInteraction[_0x9d38('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index df4ef50..c90f46d 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 _0x7dc5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x2d9142,_0x179010){var _0x4156d1=function(_0x3f30c8){while(--_0x3f30c8){_0x2d9142['push'](_0x2d9142['shift']());}};_0x4156d1(++_0x179010);}(_0x7dc5,0x11c));var _0x57dc=function(_0x161ab6,_0x51ee5c){_0x161ab6=_0x161ab6-0x0;var _0x437d12=_0x7dc5[_0x161ab6];return _0x437d12;};'use strict';var _=require(_0x57dc('0x0'));var util=require(_0x57dc('0x1'));var logger=require(_0x57dc('0x2'))(_0x57dc('0x3'));var moment=require(_0x57dc('0x4'));var BPromise=require(_0x57dc('0x5'));var rp=require(_0x57dc('0x6'));var fs=require('fs');var path=require(_0x57dc('0x7'));var rimraf=require(_0x57dc('0x8'));var config=require(_0x57dc('0x9'));var attributes=require(_0x57dc('0xa'));module[_0x57dc('0xb')]=function(_0x19cdd1,_0x30ea16){return _0x19cdd1[_0x57dc('0xc')](_0x57dc('0xd'),attributes,{'tableName':_0x57dc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x721490,_0x2d3391,_0xd8fce3){if(_0x721490['changed'](_0x57dc('0xf'))){_0x721490[_0x57dc('0x10')]=moment()['format'](_0x57dc('0x11'));}_0xd8fce3(null,_0x721490);}}});}; \ No newline at end of file +var _0x2d18=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','changed'];(function(_0x262a6c,_0x24ed2d){var _0x4ce86a=function(_0x352258){while(--_0x352258){_0x262a6c['push'](_0x262a6c['shift']());}};_0x4ce86a(++_0x24ed2d);}(_0x2d18,0xd5));var _0x82d1=function(_0x2aa092,_0x321421){_0x2aa092=_0x2aa092-0x0;var _0x20dc3a=_0x2d18[_0x2aa092];return _0x20dc3a;};'use strict';var _=require(_0x82d1('0x0'));var util=require(_0x82d1('0x1'));var logger=require(_0x82d1('0x2'))(_0x82d1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82d1('0x4'));var fs=require('fs');var path=require(_0x82d1('0x5'));var rimraf=require(_0x82d1('0x6'));var config=require(_0x82d1('0x7'));var attributes=require(_0x82d1('0x8'));module[_0x82d1('0x9')]=function(_0x32b9c8,_0x3e36a0){return _0x32b9c8[_0x82d1('0xa')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d5eca,_0x8fb9b2,_0x2e5191){if(_0x2d5eca[_0x82d1('0xb')](_0x82d1('0xc'))){_0x2d5eca['closedAt']=moment()[_0x82d1('0xd')](_0x82d1('0xe'));}_0x2e5191(null,_0x2d5eca);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index fad6b87..3724081 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 _0x600c=['http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','then','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x49b8a3,_0x42d37d){var _0x4236c8=function(_0x53e51a){while(--_0x53e51a){_0x49b8a3['push'](_0x49b8a3['shift']());}};_0x4236c8(++_0x42d37d);}(_0x600c,0x179));var _0xc600=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x600c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc600('0x0'));var util=require(_0xc600('0x1'));var moment=require('moment');var BPromise=require(_0xc600('0x2'));var rs=require(_0xc600('0x3'));var fs=require('fs');var Redis=require(_0xc600('0x4'));var db=require(_0xc600('0x5'))['db'];var utils=require(_0xc600('0x6'));var logger=require(_0xc600('0x7'))(_0xc600('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc600('0x9')][_0xc600('0xa')]({'port':0x232a});config[_0xc600('0xb')]=_[_0xc600('0xc')](config[_0xc600('0xb')],{'host':_0xc600('0xd'),'port':0x18eb});var socket=require(_0xc600('0xe'))(new Redis(config[_0xc600('0xb')]));require(_0xc600('0xf'))[_0xc600('0x10')](socket);function respondWithRpcPromise(_0x149df0,_0x7f5886,_0x178a17){return new BPromise(function(_0x2a2756,_0xc00564){return client['request'](_0x149df0,_0x178a17)['then'](function(_0x56f994){logger[_0xc600('0x11')](_0xc600('0x12'),_0x7f5886,_0xc600('0x13'));logger[_0xc600('0x14')](_0xc600('0x15'),_0x7f5886,'request\x20sent',JSON[_0xc600('0x16')](_0x56f994));if(_0x56f994[_0xc600('0x17')]){if(_0x56f994[_0xc600('0x17')][_0xc600('0x18')]===0x1f4){logger[_0xc600('0x17')](_0xc600('0x12'),_0x7f5886,_0x56f994[_0xc600('0x17')]['message']);return _0xc00564(_0x56f994[_0xc600('0x17')]['message']);}logger['error'](_0xc600('0x12'),_0x7f5886,_0x56f994['error']['message']);return _0x2a2756(_0x56f994['error'][_0xc600('0x19')]);}else{logger['info'](_0xc600('0x12'),_0x7f5886,_0xc600('0x13'));_0x2a2756(_0x56f994[_0xc600('0x1a')][_0xc600('0x19')]);}})[_0xc600('0x1b')](function(_0x116592){logger[_0xc600('0x17')](_0xc600('0x12'),_0x7f5886,_0x116592);_0xc00564(_0x116592);});});}exports[_0xc600('0x1c')]=function(_0x92d3f){var _0x569563=this;return new Promise(function(_0x1cb990,_0x4662c2){return db[_0xc600('0x1d')][_0xc600('0x1e')](_0x92d3f[_0xc600('0x1f')],{'raw':_0x92d3f['options']?_0x92d3f[_0xc600('0x20')][_0xc600('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92d3f[_0xc600('0x20')]?_0x92d3f[_0xc600('0x20')][_0xc600('0x22')]||null:null,'attributes':_0x92d3f[_0xc600('0x20')]?_0x92d3f['options'][_0xc600('0x23')]||null:null,'limit':_0x92d3f['options']?_0x92d3f[_0xc600('0x20')]['limit']||null:null})[_0xc600('0x24')](function(_0x50760a){logger[_0xc600('0x11')](_0xc600('0x1c'),_0x92d3f);logger[_0xc600('0x14')](_0xc600('0x1c'),_0x92d3f,JSON[_0xc600('0x16')](_0x50760a));_0x1cb990(_0x50760a);})[_0xc600('0x1b')](function(_0x24ab31){logger[_0xc600('0x17')](_0xc600('0x1c'),_0x24ab31['message'],_0x92d3f);_0x4662c2(_0x569563[_0xc600('0x17')](0x1f4,_0x24ab31[_0xc600('0x19')]));});});};exports[_0xc600('0x25')]=function(_0x57532c){return new Promise(function(_0x2bc9ce,_0x54628f){return db[_0xc600('0x1d')][_0xc600('0x26')]({'where':_0x57532c[_0xc600('0x20')]?_0x57532c[_0xc600('0x20')][_0xc600('0x22')]||null:null})['then'](function(_0x7eb7fe){if(_0x7eb7fe){return _0x7eb7fe[_0xc600('0x27')](_0x57532c['body'][_0xc600('0x28')],_[_0xc600('0x29')](_0x57532c[_0xc600('0x1f')],[_0xc600('0x28'),'id'])||{});}})['spread'](function(_0x2eceb4){logger[_0xc600('0x11')](_0xc600('0x2a'),_0x57532c);logger[_0xc600('0x14')](_0xc600('0x2a'),_0x57532c,JSON[_0xc600('0x16')](_0x2eceb4));_0x2bc9ce(_0x2eceb4);})[_0xc600('0x1b')](function(_0x431e31){logger[_0xc600('0x17')](_0xc600('0x2a'),_0x431e31[_0xc600('0x19')],_0x57532c);_0x54628f(_this['error'](0x1f4,_0x431e31[_0xc600('0x19')]));});});}; \ No newline at end of file +var _0x2f1d=['addTags','ids','omit','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./faxInteraction.socket','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','FaxInteraction,\x20%s,\x20%s','message','result','catch','FaxInteraction','update','body','options','raw','where','attributes','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find'];(function(_0x1413c7,_0x338846){var _0x855596=function(_0x58a15a){while(--_0x58a15a){_0x1413c7['push'](_0x1413c7['shift']());}};_0x855596(++_0x338846);}(_0x2f1d,0x7c));var _0xd2f1=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x2f1d[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xd2f1('0x0'));var util=require(_0xd2f1('0x1'));var moment=require(_0xd2f1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2f1('0x3'));var db=require(_0xd2f1('0x4'))['db'];var utils=require(_0xd2f1('0x5'));var logger=require('../../config/logger')(_0xd2f1('0x6'));var config=require(_0xd2f1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd2f1('0x8')][_0xd2f1('0x9')]({'port':0x232a});config[_0xd2f1('0xa')]=_[_0xd2f1('0xb')](config[_0xd2f1('0xa')],{'host':_0xd2f1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd2f1('0xa')]));require(_0xd2f1('0xd'))['register'](socket);function respondWithRpcPromise(_0x135b57,_0x5ddbfc,_0x580645){return new BPromise(function(_0x9be4e8,_0x511d27){return client[_0xd2f1('0xe')](_0x135b57,_0x580645)[_0xd2f1('0xf')](function(_0x1784f1){logger[_0xd2f1('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x5ddbfc,_0xd2f1('0x11'));logger[_0xd2f1('0x12')](_0xd2f1('0x13'),_0x5ddbfc,'request\x20sent',JSON['stringify'](_0x1784f1));if(_0x1784f1['error']){if(_0x1784f1['error']['code']===0x1f4){logger[_0xd2f1('0x14')](_0xd2f1('0x15'),_0x5ddbfc,_0x1784f1[_0xd2f1('0x14')][_0xd2f1('0x16')]);return _0x511d27(_0x1784f1[_0xd2f1('0x14')]['message']);}logger[_0xd2f1('0x14')](_0xd2f1('0x15'),_0x5ddbfc,_0x1784f1[_0xd2f1('0x14')][_0xd2f1('0x16')]);return _0x9be4e8(_0x1784f1[_0xd2f1('0x14')][_0xd2f1('0x16')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x5ddbfc,_0xd2f1('0x11'));_0x9be4e8(_0x1784f1[_0xd2f1('0x17')][_0xd2f1('0x16')]);}})[_0xd2f1('0x18')](function(_0x20c429){logger[_0xd2f1('0x14')](_0xd2f1('0x15'),_0x5ddbfc,_0x20c429);_0x511d27(_0x20c429);});});}exports['UpdateFaxInteraction']=function(_0xb27996){var _0x5c0c91=this;return new Promise(function(_0x48b55b,_0x9855d2){return db[_0xd2f1('0x19')][_0xd2f1('0x1a')](_0xb27996[_0xd2f1('0x1b')],{'raw':_0xb27996[_0xd2f1('0x1c')]?_0xb27996[_0xd2f1('0x1c')][_0xd2f1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb27996[_0xd2f1('0x1c')]?_0xb27996['options'][_0xd2f1('0x1e')]||null:null,'attributes':_0xb27996[_0xd2f1('0x1c')]?_0xb27996[_0xd2f1('0x1c')][_0xd2f1('0x1f')]||null:null,'limit':_0xb27996['options']?_0xb27996[_0xd2f1('0x1c')]['limit']||null:null})[_0xd2f1('0xf')](function(_0x4bc882){logger[_0xd2f1('0x10')](_0xd2f1('0x20'),_0xb27996);logger['debug'](_0xd2f1('0x20'),_0xb27996,JSON[_0xd2f1('0x21')](_0x4bc882));_0x48b55b(_0x4bc882);})[_0xd2f1('0x18')](function(_0x3fbca0){logger['error'](_0xd2f1('0x20'),_0x3fbca0[_0xd2f1('0x16')],_0xb27996);_0x9855d2(_0x5c0c91[_0xd2f1('0x14')](0x1f4,_0x3fbca0[_0xd2f1('0x16')]));});});};exports[_0xd2f1('0x22')]=function(_0x236fda){return new Promise(function(_0x2bc444,_0x1c2df0){return db[_0xd2f1('0x19')][_0xd2f1('0x23')]({'where':_0x236fda['options']?_0x236fda[_0xd2f1('0x1c')][_0xd2f1('0x1e')]||null:null})[_0xd2f1('0xf')](function(_0x1aef48){if(_0x1aef48){return _0x1aef48[_0xd2f1('0x24')](_0x236fda[_0xd2f1('0x1b')][_0xd2f1('0x25')],_[_0xd2f1('0x26')](_0x236fda[_0xd2f1('0x1b')],[_0xd2f1('0x25'),'id'])||{});}})['spread'](function(_0x112565){logger[_0xd2f1('0x10')]('AddTags',_0x236fda);logger[_0xd2f1('0x12')](_0xd2f1('0x27'),_0x236fda,JSON[_0xd2f1('0x21')](_0x112565));_0x2bc444(_0x112565);})['catch'](function(_0x36add9){logger[_0xd2f1('0x14')](_0xd2f1('0x27'),_0x36add9[_0xd2f1('0x16')],_0x236fda);_0x1c2df0(_this[_0xd2f1('0x14')](0x1f4,_0x36add9[_0xd2f1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index b1ccf0d..0df9a71 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 _0x0ab1=['faxInteraction:','./faxInteraction.events','save','update','removeListener','register','length'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x0ab1,0x1d6));var _0x10ab=function(_0xa76009,_0x27d604){_0xa76009=_0xa76009-0x0;var _0x39226a=_0x0ab1[_0xa76009];return _0x39226a;};'use strict';var FaxInteractionEvents=require(_0x10ab('0x0'));var events=[_0x10ab('0x1'),'remove',_0x10ab('0x2')];function createListener(_0x39bf1c,_0x512c3a){return function(_0x2ff6bd){_0x512c3a['emit'](_0x39bf1c,_0x2ff6bd);};}function removeListener(_0x54f263,_0x44308b){return function(){FaxInteractionEvents[_0x10ab('0x3')](_0x54f263,_0x44308b);};}exports[_0x10ab('0x4')]=function(_0x54ada6){for(var _0x78f4c2=0x0,_0x242553=events[_0x10ab('0x5')];_0x78f4c2<_0x242553;_0x78f4c2++){var _0x9b900f=events[_0x78f4c2];var _0x1506db=createListener(_0x10ab('0x6')+_0x9b900f,_0x54ada6);FaxInteractionEvents['on'](_0x9b900f,_0x1506db);}}; \ No newline at end of file +var _0xaf64=['./faxInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x27a3ac,_0xe952af){var _0x4a3f37=function(_0x382dc6){while(--_0x382dc6){_0x27a3ac['push'](_0x27a3ac['shift']());}};_0x4a3f37(++_0xe952af);}(_0xaf64,0x168));var _0x4af6=function(_0x51b80a,_0x355fe3){_0x51b80a=_0x51b80a-0x0;var _0x22fdf0=_0xaf64[_0x51b80a];return _0x22fdf0;};'use strict';var FaxInteractionEvents=require(_0x4af6('0x0'));var events=[_0x4af6('0x1'),_0x4af6('0x2'),_0x4af6('0x3')];function createListener(_0x434c89,_0x26807a){return function(_0x36fb9f){_0x26807a[_0x4af6('0x4')](_0x434c89,_0x36fb9f);};}function removeListener(_0x56a535,_0x36a2bf){return function(){FaxInteractionEvents[_0x4af6('0x5')](_0x56a535,_0x36a2bf);};}exports[_0x4af6('0x6')]=function(_0xfea959){for(var _0xce517c=0x0,_0x39b89e=events[_0x4af6('0x7')];_0xce517c<_0x39b89e;_0xce517c++){var _0x5663d0=events[_0xce517c];var _0xcbefb0=createListener('faxInteraction:'+_0x5663d0,_0xfea959);FaxInteractionEvents['on'](_0x5663d0,_0xcbefb0);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 019472e..e95c0a6 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 _0x00b3=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','addTags','put','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','connect-timeout','express','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00b3,0x97));var _0x300b=function(_0x233451,_0x4644bd){_0x233451=_0x233451-0x0;var _0x27f651=_0x00b3[_0x233451];return _0x27f651;};'use strict';var multer=require(_0x300b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x300b('0x1'));var express=require(_0x300b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x300b('0x3'));var interaction=require(_0x300b('0x4'));var config=require(_0x300b('0x5'));var controller=require('./faxInteraction.controller');router[_0x300b('0x6')]('/',auth[_0x300b('0x7')](),controller[_0x300b('0x8')]);router[_0x300b('0x6')](_0x300b('0x9'),auth[_0x300b('0x7')](),controller[_0x300b('0xa')]);router[_0x300b('0x6')](_0x300b('0xb'),auth[_0x300b('0x7')](),controller[_0x300b('0xc')]);router[_0x300b('0x6')](_0x300b('0xd'),auth['isAuthenticated'](),controller[_0x300b('0xe')]);router[_0x300b('0x6')](_0x300b('0xf'),auth['isAuthenticated'](),controller[_0x300b('0x10')]);router[_0x300b('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x300b('0x11')]('/:id/messages',auth[_0x300b('0x7')](),controller[_0x300b('0x12')]);router[_0x300b('0x11')](_0x300b('0x13'),auth[_0x300b('0x7')](),interaction[_0x300b('0x14')]('fax','faxinteraction:addtags'),controller[_0x300b('0x15')]);router[_0x300b('0x16')](_0x300b('0xb'),auth[_0x300b('0x7')](),interaction[_0x300b('0x14')](_0x300b('0x17'),_0x300b('0x18')),controller[_0x300b('0x19')]);router['delete'](_0x300b('0xb'),auth[_0x300b('0x7')](),interaction['tracked'](_0x300b('0x17'),_0x300b('0x1a')),controller[_0x300b('0x1b')]);router[_0x300b('0x1c')]('/:id/tags',auth[_0x300b('0x7')](),controller[_0x300b('0x1d')]);module[_0x300b('0x1e')]=router; \ No newline at end of file +var _0xd9ee=['faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','../../config/environment','./faxInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','faxinteraction:addtags','addTags','put','tracked','fax','faxinteraction:update','update'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xd9ee,0x1d3));var _0xed9e=function(_0x4d813b,_0x22dea3){_0x4d813b=_0x4d813b-0x0;var _0x4f6204=_0xd9ee[_0x4d813b];return _0x4f6204;};'use strict';var multer=require(_0xed9e('0x0'));var util=require(_0xed9e('0x1'));var path=require('path');var timeout=require(_0xed9e('0x2'));var express=require(_0xed9e('0x3'));var router=express[_0xed9e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xed9e('0x5'));var controller=require(_0xed9e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xed9e('0x7')]);router[_0xed9e('0x8')](_0xed9e('0x9'),auth[_0xed9e('0xa')](),controller[_0xed9e('0xb')]);router[_0xed9e('0x8')](_0xed9e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xed9e('0x8')](_0xed9e('0xd'),auth[_0xed9e('0xa')](),controller[_0xed9e('0xe')]);router[_0xed9e('0x8')](_0xed9e('0xf'),auth[_0xed9e('0xa')](),controller[_0xed9e('0x10')]);router[_0xed9e('0x11')]('/',auth[_0xed9e('0xa')](),controller[_0xed9e('0x12')]);router[_0xed9e('0x11')]('/:id/messages',auth[_0xed9e('0xa')](),controller[_0xed9e('0x13')]);router[_0xed9e('0x11')](_0xed9e('0x14'),auth[_0xed9e('0xa')](),interaction['tracked']('fax',_0xed9e('0x15')),controller[_0xed9e('0x16')]);router[_0xed9e('0x17')](_0xed9e('0xc'),auth[_0xed9e('0xa')](),interaction[_0xed9e('0x18')](_0xed9e('0x19'),_0xed9e('0x1a')),controller[_0xed9e('0x1b')]);router['delete'](_0xed9e('0xc'),auth[_0xed9e('0xa')](),interaction[_0xed9e('0x18')](_0xed9e('0x19'),_0xed9e('0x1c')),controller[_0xed9e('0x1d')]);router[_0xed9e('0x1e')](_0xed9e('0x14'),auth[_0xed9e('0xa')](),controller[_0xed9e('0x1f')]);module[_0xed9e('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 63885cb..f004a30 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 _0xf120=['TEXT','medium','ENUM','out','DATE','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf120,0x179));var _0x0f12=function(_0x15a2ce,_0x383ed9){_0x15a2ce=_0x15a2ce-0x0;var _0x56eda5=_0xf120[_0x15a2ce];return _0x56eda5;};'use strict';var Sequelize=require('sequelize');module[_0x0f12('0x0')]={'body':{'type':Sequelize[_0x0f12('0x1')](_0x0f12('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0f12('0x3')]('in',_0x0f12('0x4')),'defaultValue':_0x0f12('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x0f12('0x5')]}}; \ No newline at end of file +var _0xc112=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x5e0bfe,_0x971889){var _0x369dde=function(_0x5d4b7c){while(--_0x5d4b7c){_0x5e0bfe['push'](_0x5e0bfe['shift']());}};_0x369dde(++_0x971889);}(_0xc112,0xec));var _0x2c11=function(_0x2190f1,_0x39e05f){_0x2190f1=_0x2190f1-0x0;var _0x57b400=_0xc112[_0x2190f1];return _0x57b400;};'use strict';var Sequelize=require(_0x2c11('0x0'));module[_0x2c11('0x1')]={'body':{'type':Sequelize[_0x2c11('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2c11('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c11('0x4')]('in',_0x2c11('0x5')),'defaultValue':_0x2c11('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x2c11('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2c11('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index ce9aaef..3eff246 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 _0x0615=['options','include','findAll','rows','show','params','includeAll','find','body','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','motionChannel','reject','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','Content-Range','update','destroy','end','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x3f5471,_0x561c86){var _0x192729=function(_0x1f3326){while(--_0x1f3326){_0x3f5471['push'](_0x3f5471['shift']());}};_0x192729(++_0x561c86);}(_0x0615,0xd7));var _0x5061=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0615[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x5061('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5061('0x1'));var rp=require(_0x5061('0x2'));var moment=require(_0x5061('0x3'));var BPromise=require(_0x5061('0x4'));var Mustache=require(_0x5061('0x5'));var util=require(_0x5061('0x6'));var path=require(_0x5061('0x7'));var sox=require(_0x5061('0x8'));var csv=require(_0x5061('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5061('0xa'));var _=require(_0x5061('0xb'));var squel=require(_0x5061('0xc'));var crypto=require(_0x5061('0xd'));var jsforce=require(_0x5061('0xe'));var deskjs=require(_0x5061('0xf'));var toCsv=require(_0x5061('0x9'));var querystring=require(_0x5061('0x10'));var Papa=require('papaparse');var Redis=require(_0x5061('0x11'));var authService=require(_0x5061('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5061('0x14'))(_0x5061('0x15'));var utils=require('../../config/utils');var config=require(_0x5061('0x16'));var licenseUtil=require(_0x5061('0x17'));var db=require('../../mysqldb')['db'];config[_0x5061('0x18')]=_[_0x5061('0x19')](config[_0x5061('0x18')],{'host':_0x5061('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5061('0x18')]));require(_0x5061('0x1b'))[_0x5061('0x1c')](socket);var jayson=require(_0x5061('0x1d'));var client=jayson[_0x5061('0x1e')][_0x5061('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24ec8c,_0x229f0c,_0x3eb607,_0xe86cf8){return new BPromise(function(_0x1cf27a,_0x303c0e){var _0x34f1ca=_0xe86cf8||client;return _0x34f1ca[_0x5061('0x20')](_0x24ec8c,_0x3eb607)[_0x5061('0x21')](function(_0x26908f){logger[_0x5061('0x22')](_0x5061('0x23'),_0x229f0c,'request\x20sent');logger[_0x5061('0x24')](_0x5061('0x25'),_0x229f0c,_0x5061('0x26'),JSON[_0x5061('0x27')](_0x26908f));if(_0x26908f[_0x5061('0x28')]){if(_0x26908f[_0x5061('0x28')][_0x5061('0x29')]===0x1f4){logger['error'](_0x5061('0x23'),_0x229f0c,_0x26908f[_0x5061('0x28')][_0x5061('0x2a')]);return _0x303c0e(_0x26908f[_0x5061('0x28')][_0x5061('0x2a')]);}logger[_0x5061('0x28')](_0x5061('0x23'),_0x229f0c,_0x26908f[_0x5061('0x28')][_0x5061('0x2a')]);return _0x1cf27a(_0x26908f['error'][_0x5061('0x2a')]);}else{logger[_0x5061('0x22')](_0x5061('0x23'),_0x229f0c,'request\x20sent');_0x1cf27a(_0x26908f[_0x5061('0x2b')]['message']);}})[_0x5061('0x2c')](function(_0x1d24c1){logger['error'](_0x5061('0x23'),_0x229f0c,_0x1d24c1);_0x303c0e(_0x1d24c1);});});}function respondWithStatusCode(_0x3e829a,_0x27ee56){_0x27ee56=_0x27ee56||0xcc;return function(_0x4bbf84){if(_0x4bbf84){return _0x3e829a['sendStatus'](_0x27ee56);}return _0x3e829a[_0x5061('0x2d')](_0x27ee56)['end']();};}function respondWithResult(_0x5ece99,_0x52f727){_0x52f727=_0x52f727||0xc8;return function(_0x343440){if(_0x343440){return _0x5ece99[_0x5061('0x2d')](_0x52f727)[_0x5061('0x2e')](_0x343440);}};}function respondWithFilteredResult(_0x13dc6e,_0x35fe92){return function(_0x234716){if(_0x234716){var _0x473c7f=typeof _0x35fe92['offset']===_0x5061('0x2f')&&typeof _0x35fe92[_0x5061('0x30')]===_0x5061('0x2f');var _0x350501=_0x234716[_0x5061('0x31')];var _0x4b3f40=_0x473c7f?0x0:_0x35fe92[_0x5061('0x32')];var _0x2f2011=_0x473c7f?_0x234716[_0x5061('0x31')]:_0x35fe92[_0x5061('0x32')]+_0x35fe92[_0x5061('0x30')];var _0x199cb0;if(_0x2f2011>=_0x350501){_0x2f2011=_0x350501;_0x199cb0=0xc8;}else{_0x199cb0=0xce;}_0x13dc6e['status'](_0x199cb0);return _0x13dc6e['set'](_0x5061('0x33'),_0x4b3f40+'-'+_0x2f2011+'/'+_0x350501)[_0x5061('0x2e')](_0x234716);}return null;};}function patchUpdates(_0xd03faa){return function(_0x22428e){try{jsonpatch['apply'](_0x22428e,_0xd03faa,!![]);}catch(_0x1d9004){return BPromise['reject'](_0x1d9004);}return _0x22428e['save']();};}function saveUpdates(_0x20d8d3,_0x5c0afe){return function(_0x4fad1d){if(_0x4fad1d){return _0x4fad1d[_0x5061('0x34')](_0x20d8d3)[_0x5061('0x21')](function(_0x2659b1){return _0x2659b1;});}return null;};}function removeEntity(_0x2229ee,_0x12d8fd){return function(_0x2a3a86){if(_0x2a3a86){return _0x2a3a86[_0x5061('0x35')]()[_0x5061('0x21')](function(){_0x2229ee[_0x5061('0x2d')](0xcc)[_0x5061('0x36')]();});}};}function handleEntityNotFound(_0x43a84e,_0x282281){return function(_0x56e74b){if(!_0x56e74b){_0x43a84e['sendStatus'](0x194);}return _0x56e74b;};}function handleError(_0x24232f,_0x31b49c){_0x31b49c=_0x31b49c||0x1f4;return function(_0x10a262){logger[_0x5061('0x28')](_0x10a262[_0x5061('0x37')]);if(_0x10a262[_0x5061('0x38')]){delete _0x10a262['name'];}_0x24232f[_0x5061('0x2d')](_0x31b49c)['send'](_0x10a262);};}exports[_0x5061('0x39')]=function(_0x27b74f,_0x10766e){var _0x28a210={},_0x125383={},_0x4dc99d={'count':0x0,'rows':[]};var _0x4c7f4f=_[_0x5061('0x3a')](db[_0x5061('0x3b')][_0x5061('0x3c')],function(_0x1fa3f9){return{'name':_0x1fa3f9[_0x5061('0x3d')],'type':_0x1fa3f9[_0x5061('0x3e')]['key']};});_0x125383[_0x5061('0x3f')]=_[_0x5061('0x3a')](_0x4c7f4f,_0x5061('0x38'));_0x125383[_0x5061('0x40')]=_[_0x5061('0x41')](_0x27b74f[_0x5061('0x40')]);_0x125383[_0x5061('0x42')]=_[_0x5061('0x43')](_0x125383['model'],_0x125383[_0x5061('0x40')]);_0x28a210[_0x5061('0x44')]=_[_0x5061('0x43')](_0x125383[_0x5061('0x3f')],qs[_0x5061('0x45')](_0x27b74f[_0x5061('0x40')][_0x5061('0x45')]));_0x28a210[_0x5061('0x44')]=_0x28a210[_0x5061('0x44')][_0x5061('0x46')]?_0x28a210[_0x5061('0x44')]:_0x125383[_0x5061('0x3f')];if(!_0x27b74f['query']['hasOwnProperty'](_0x5061('0x47'))){_0x28a210[_0x5061('0x30')]=qs[_0x5061('0x30')](_0x27b74f['query'][_0x5061('0x30')]);_0x28a210[_0x5061('0x32')]=qs[_0x5061('0x32')](_0x27b74f[_0x5061('0x40')]['offset']);}_0x28a210[_0x5061('0x48')]=qs['sort'](_0x27b74f['query'][_0x5061('0x49')]);_0x28a210['where']=qs['filters'](_[_0x5061('0x4a')](_0x27b74f[_0x5061('0x40')],_0x125383[_0x5061('0x42')]),_0x4c7f4f);if(_0x27b74f[_0x5061('0x40')][_0x5061('0x4b')]){_0x28a210[_0x5061('0x4c')]=_[_0x5061('0x4d')](_0x28a210[_0x5061('0x4c')],{'$or':_[_0x5061('0x3a')](_0x4c7f4f,function(_0x4585d2){if(_0x4585d2[_0x5061('0x3e')]!==_0x5061('0x4e')){var _0x22a9c9={};_0x22a9c9[_0x4585d2[_0x5061('0x38')]]={'$like':'%'+_0x27b74f[_0x5061('0x40')][_0x5061('0x4b')]+'%'};return _0x22a9c9;}})});}_0x28a210=_[_0x5061('0x4d')]({},_0x28a210,_0x27b74f[_0x5061('0x4f')]);var _0x3674e2={'where':_0x28a210[_0x5061('0x4c')]};return db['FaxMessage']['count'](_0x3674e2)[_0x5061('0x21')](function(_0x34a7e7){_0x4dc99d[_0x5061('0x31')]=_0x34a7e7;if(_0x27b74f[_0x5061('0x40')]['includeAll']){_0x28a210[_0x5061('0x50')]=[{'all':!![]}];}return db[_0x5061('0x3b')][_0x5061('0x51')](_0x28a210);})[_0x5061('0x21')](function(_0x9c459f){_0x4dc99d[_0x5061('0x52')]=_0x9c459f;return _0x4dc99d;})[_0x5061('0x21')](respondWithFilteredResult(_0x10766e,_0x28a210))['catch'](handleError(_0x10766e,null));};exports[_0x5061('0x53')]=function(_0x1fd7da,_0x4c17e6){var _0x456d8d={'raw':!![],'where':{'id':_0x1fd7da[_0x5061('0x54')]['id']}},_0x778916={};_0x778916[_0x5061('0x3f')]=_[_0x5061('0x41')](db['FaxMessage']['rawAttributes']);_0x778916[_0x5061('0x40')]=_['keys'](_0x1fd7da[_0x5061('0x40')]);_0x778916[_0x5061('0x42')]=_[_0x5061('0x43')](_0x778916[_0x5061('0x3f')],_0x778916['query']);_0x456d8d['attributes']=_[_0x5061('0x43')](_0x778916[_0x5061('0x3f')],qs[_0x5061('0x45')](_0x1fd7da[_0x5061('0x40')][_0x5061('0x45')]));_0x456d8d[_0x5061('0x44')]=_0x456d8d[_0x5061('0x44')][_0x5061('0x46')]?_0x456d8d[_0x5061('0x44')]:_0x778916['model'];if(_0x1fd7da['query'][_0x5061('0x55')]){_0x456d8d[_0x5061('0x50')]=[{'all':!![]}];}_0x456d8d=_[_0x5061('0x4d')]({},_0x456d8d,_0x1fd7da['options']);return db[_0x5061('0x3b')][_0x5061('0x56')](_0x456d8d)['then'](handleEntityNotFound(_0x4c17e6,null))[_0x5061('0x21')](respondWithResult(_0x4c17e6,null))['catch'](handleError(_0x4c17e6,null));};exports[_0x5061('0x34')]=function(_0x1910b7,_0x5ea63e){if(_0x1910b7[_0x5061('0x57')]['id']){delete _0x1910b7[_0x5061('0x57')]['id'];}return db[_0x5061('0x3b')][_0x5061('0x56')]({'where':{'id':_0x1910b7[_0x5061('0x54')]['id']}})['then'](handleEntityNotFound(_0x5ea63e,null))[_0x5061('0x21')](saveUpdates(_0x1910b7['body'],null))[_0x5061('0x21')](respondWithResult(_0x5ea63e,null))[_0x5061('0x2c')](handleError(_0x5ea63e,null));};exports['destroy']=function(_0x581450,_0x1f901d){return db[_0x5061('0x3b')][_0x5061('0x56')]({'where':{'id':_0x581450['params']['id']}})[_0x5061('0x21')](handleEntityNotFound(_0x1f901d,null))[_0x5061('0x21')](removeEntity(_0x1f901d,null))[_0x5061('0x2c')](handleError(_0x1f901d,null));};exports['describe']=function(_0x225e3b,_0x1138eb){return db[_0x5061('0x3b')][_0x5061('0x58')]()['then'](respondWithResult(_0x1138eb,null))[_0x5061('0x2c')](handleError(_0x1138eb,null));};var interaction_log=require(_0x5061('0x14'))('fax-interactions');exports['accept']=function(_0x1bef77,_0x358c7f,_0x12cce8){var _0x1c942b={'agent':{},'channel':_0x5061('0x59')};if(_0x1bef77[_0x5061('0x57')]['id']){delete _0x1bef77[_0x5061('0x57')]['id'];}_0x1bef77[_0x5061('0x57')][_0x5061('0x5a')]=!![];_0x1bef77[_0x5061('0x57')][_0x5061('0x5b')]=moment()[_0x5061('0x5c')](_0x5061('0x5d'));_0x1bef77['body'][_0x5061('0x5e')]=_0x1bef77[_0x5061('0x57')][_0x5061('0x5e')]||_0x1bef77[_0x5061('0x5f')]['id'];_0x1c942b[_0x5061('0x60')]['id']=_0x1bef77[_0x5061('0x57')][_0x5061('0x5e')];return db[_0x5061('0x3b')]['find']({'where':{'id':_0x1bef77[_0x5061('0x54')]['id'],'UserId':null}})[_0x5061('0x21')](handleEntityNotFound(_0x358c7f,null))[_0x5061('0x21')](saveUpdates(_0x1bef77[_0x5061('0x57')],null))[_0x5061('0x21')](function(_0xeaaed2){if(_0xeaaed2){_0x1c942b[_0x5061('0x2a')]=_0xeaaed2['get']({'plain':!![]});return db[_0x5061('0x61')][_0x5061('0x56')]({'where':{'id':_0xeaaed2[_0x5061('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x358c7f,null))[_0x5061('0x21')](function(_0x4186ba){if(_0x4186ba){return _0x4186ba[_0x5061('0x34')]({'UserId':_0x1bef77[_0x5061('0x57')][_0x5061('0x5e')],'read1stAt':_[_0x5061('0x63')](_0x4186ba[_0x5061('0x64')])?moment()['format'](_0x5061('0x5d')):undefined});}return null;})[_0x5061('0x21')](function(_0x1c6958){if(_0x1c6958){_0x1c942b[_0x5061('0x65')]=_0x1c6958[_0x5061('0x66')]({'plain':!![]});interaction_log[_0x5061('0x22')](_0x5061('0x67'),_0x1bef77[_0x5061('0x5f')]['id'],_0x1bef77['user'][_0x5061('0x38')],_0x1bef77[_0x5061('0x5f')]['role'],_0x1c942b[_0x5061('0x65')]['id'],_0x1bef77[_0x5061('0x57')]?JSON[_0x5061('0x27')](_0x1bef77[_0x5061('0x57')]):_0x5061('0x68'));return respondWithRpcPromise(_0x5061('0x69'),_0x5061('0x6a'),_0x1c942b);}return null;})[_0x5061('0x21')](function(_0xe22bde){var _0x46af1a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe22bde['message'][_0x5061('0x6b')];return db[_0x5061('0x6c')][_0x5061('0x40')](_0x46af1a,{'type':db[_0x5061('0x6d')]['QueryTypes'][_0x5061('0x6e')],'raw':!![]})[_0x5061('0x21')](function(_0x27470c){return _0x27470c;});})[_0x5061('0x21')](function(_0x5656b2){if(_0x5656b2){_0x1c942b[_0x5061('0x2a')][_0x5061('0x6f')]=_0x5656b2[0x0];if(!_0x1bef77[_0x5061('0x57')][_0x5061('0x5e')])return;return db[_0x5061('0x70')][_0x5061('0x56')]({'where':{'id':_0x1bef77[_0x5061('0x57')][_0x5061('0x5e')],'role':_0x5061('0x60')},'attributes':['id',_0x5061('0x38'),_0x5061('0x71'),'email',_0x5061('0x72')],'raw':!![]});}return null;})[_0x5061('0x21')](function(_0x3c4a24){if(!_0x3c4a24)return null;_0x1c942b[_0x5061('0x2a')][_0x5061('0x60')]=_0x3c4a24;return _0x1c942b;})[_0x5061('0x21')](function(_0x5c15dc){if(_0x5c15dc){if(_0x1bef77[_0x5061('0x57')][_0x5061('0x73')]){_0x1c942b['message'][_0x5061('0x74')]=util[_0x5061('0x5c')](_0x5061('0x75'),_0x1bef77[_0x5061('0x5f')][_0x5061('0x38')]);_0x1c942b[_0x5061('0x2a')]['channel']=_0x1c942b[_0x5061('0x76')];_0x1c942b[_0x5061('0x2a')]['motionChannel']=_0x1c942b[_0x5061('0x76')];_0x1c942b[_0x5061('0x2a')][_0x5061('0x77')]=_0x5061('0x78');return respondWithRpcPromise(_0x5061('0x79'),_0x5061('0x79'),{'event':_0x5061('0x7a'),'message':_0x1c942b[_0x5061('0x2a')]},client9002)['then'](function(){return _0x1c942b;});}return _0x1c942b;}return null;})[_0x5061('0x21')](respondWithResult(_0x358c7f,null))['catch'](handleError(_0x358c7f,null));};var interaction_log=require(_0x5061('0x14'))(_0x5061('0x7b'));exports['reject']=function(_0x4d8274,_0x49b616,_0x4f7fe3){var _0x55325f={'agent':{},'channel':'fax'};if(_0x4d8274[_0x5061('0x57')]['id']){delete _0x4d8274[_0x5061('0x57')]['id'];}_0x4d8274[_0x5061('0x57')][_0x5061('0x5e')]=_0x4d8274['body'][_0x5061('0x5e')]||_0x4d8274[_0x5061('0x5f')]['id'];_0x55325f[_0x5061('0x60')]['id']=_0x4d8274[_0x5061('0x57')][_0x5061('0x5e')];return db['FaxMessage']['find']({'where':{'id':_0x4d8274[_0x5061('0x54')]['id'],'UserId':null}})[_0x5061('0x21')](handleEntityNotFound(_0x49b616,null))[_0x5061('0x21')](function(_0x4845b4){if(_0x4845b4){_0x55325f['message']=_0x4845b4[_0x5061('0x66')]({'plain':!![]});return db[_0x5061('0x61')][_0x5061('0x56')]({'where':{'id':_0x4845b4[_0x5061('0x62')]}});}return null;})[_0x5061('0x21')](handleEntityNotFound(_0x49b616,null))[_0x5061('0x21')](function(_0x3a9c62){if(_0x3a9c62){_0x55325f[_0x5061('0x65')]=_0x3a9c62['get']({'plain':!![]});interaction_log['info'](_0x5061('0x7c'),_0x4d8274[_0x5061('0x5f')]['id'],_0x4d8274['user']['name'],_0x4d8274[_0x5061('0x5f')][_0x5061('0x7d')],_0x55325f[_0x5061('0x65')]['id'],_0x4d8274[_0x5061('0x57')]?JSON['stringify'](_0x4d8274[_0x5061('0x57')]):_0x5061('0x68'));return respondWithRpcPromise(_0x5061('0x7e'),'rejectMessage',_0x55325f);}return null;})[_0x5061('0x21')](function(_0x3dbd97){var _0x61ede6=_0x5061('0x7f')+_0x3dbd97[_0x5061('0x2a')]['ContactId'];return db['sequelize'][_0x5061('0x40')](_0x61ede6,{'type':db[_0x5061('0x6d')][_0x5061('0x80')][_0x5061('0x6e')],'raw':!![]})[_0x5061('0x21')](function(_0x3d89c5){return _0x3d89c5;});})[_0x5061('0x21')](function(_0x13eb60){if(_0x13eb60){_0x55325f[_0x5061('0x2a')][_0x5061('0x6f')]=_0x13eb60[0x0];if(!_0x4d8274[_0x5061('0x57')][_0x5061('0x5e')])return;return db['User'][_0x5061('0x56')]({'where':{'id':_0x4d8274[_0x5061('0x57')]['UserId'],'role':_0x5061('0x60')},'attributes':['id',_0x5061('0x38'),_0x5061('0x71'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x123eea){if(!_0x123eea)return null;_0x55325f[_0x5061('0x2a')][_0x5061('0x60')]=_0x123eea;return _0x55325f;})[_0x5061('0x21')](function(_0x3032cb){if(_0x3032cb){_0x3032cb['message']['interface']=util['format'](_0x5061('0x75'),_0x4d8274[_0x5061('0x5f')][_0x5061('0x38')]);_0x3032cb['message'][_0x5061('0x76')]=_0x55325f[_0x5061('0x76')];_0x3032cb[_0x5061('0x2a')][_0x5061('0x81')]=_0x55325f[_0x5061('0x76')];_0x3032cb[_0x5061('0x2a')][_0x5061('0x77')]=_0x5061('0x82');respondWithRpcPromise(_0x5061('0x79'),'EventManager',{'event':_0x5061('0x83'),'message':_0x3032cb['message']},client9002);return _0x55325f;}return null;})[_0x5061('0x21')](respondWithResult(_0x49b616,null))[_0x5061('0x2c')](handleError(_0x49b616,null));};exports[_0x5061('0x84')]=function(_0x2e9546,_0x5b7483){var _0x23429b;return db[_0x5061('0x3b')][_0x5061('0x84')](_0x2e9546[_0x5061('0x57')],{})[_0x5061('0x21')](function(_0x51784a){_0x23429b=_0x51784a;return db[_0x5061('0x85')][_0x5061('0x86')]({'where':{'id':_0x23429b[_0x5061('0x6b')]}});})['then'](function(_0x826545){if(_[_0x5061('0x63')](_0x826545)){return;}else{_0x23429b[_0x5061('0x59')]=_0x826545[_0x5061('0x59')];return db[_0x5061('0x87')]['findOne']({'where':{'id':_0x23429b[_0x5061('0x88')]}});}})['then'](function(_0xd7158f){return respondWithRpcPromise(_0x5061('0x89'),_0x5061('0x89'),{'FaxAccountId':_[_0x5061('0x63')](_0x2e9546[_0x5061('0x57')])?undefined:_0x2e9546[_0x5061('0x57')][_0x5061('0x8a')],'path':_['isNil'](_0xd7158f)?undefined:util[_0x5061('0x5c')](_0x5061('0x8b'),_0xd7158f[_0x5061('0x8c')]),'fax':_[_0x5061('0x63')](_0x23429b[_0x5061('0x59')])?undefined:_0x23429b[_0x5061('0x59')],'AttachmentId':_0x23429b[_0x5061('0x88')]},client9002);})[_0x5061('0x21')](respondWithResult(_0x5b7483,0xc9))[_0x5061('0x2c')](handleError(_0x5b7483,null));};exports[_0x5061('0x8d')]=function(_0x2d7990,_0x3d97b5){var _0x2f39a8=path[_0x5061('0x8e')](config[_0x5061('0x8f')],_0x5061('0x90'),_0x5061('0x91'),_0x5061('0x92'));return db[_0x5061('0x3b')][_0x5061('0x56')]({'where':{'id':_0x2d7990[_0x5061('0x54')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x3d97b5,null))[_0x5061('0x21')](function(_0x2f77f6){if(_0x2f77f6){return _0x3d97b5['download'](path[_0x5061('0x8e')](_0x2f39a8,_0x2f77f6['Attachment'][_0x5061('0x8c')]));}})[_0x5061('0x2c')](handleError(_0x3d97b5,null));}; \ No newline at end of file +var _0x1a8f=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','stack','send','index','map','FaxMessage','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','describe','../../config/logger','fax-interactions','accept','fax','readAt','UserId','user','agent','FaxInteraction','FaxInteractionId','read1stAt','format','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','channel','motionChannel','event','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','SIP/%s','create','findOne','Attachment','AttachmentId','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','redis','defaults','localhost','register','http','request','then','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus'];(function(_0xdc72ae,_0x84935d){var _0x512b60=function(_0x133f34){while(--_0x133f34){_0xdc72ae['push'](_0xdc72ae['shift']());}};_0x512b60(++_0x84935d);}(_0x1a8f,0xf1));var _0xf1a8=function(_0x2f5dad,_0x4313ad){_0x2f5dad=_0x2f5dad-0x0;var _0x38e02d=_0x1a8f[_0x2f5dad];return _0x38e02d;};'use strict';var emlformat=require(_0xf1a8('0x0'));var rimraf=require(_0xf1a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf1a8('0x2'));var moment=require('moment');var BPromise=require(_0xf1a8('0x3'));var Mustache=require(_0xf1a8('0x4'));var util=require('util');var path=require(_0xf1a8('0x5'));var sox=require('sox');var csv=require(_0xf1a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1a8('0x7'));var _=require(_0xf1a8('0x8'));var squel=require(_0xf1a8('0x9'));var crypto=require(_0xf1a8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf1a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf1a8('0xc'));var Papa=require('papaparse');var Redis=require(_0xf1a8('0xd'));var authService=require(_0xf1a8('0xe'));var qs=require(_0xf1a8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1a8('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf1a8('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf1a8('0x12')]=_[_0xf1a8('0x13')](config[_0xf1a8('0x12')],{'host':_0xf1a8('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0xf1a8('0x15')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf1a8('0x16')]({'port':0x232c});var client9002=jayson['client'][_0xf1a8('0x16')]({'port':0x232a});function respondWithRpcPromise(_0xf32d1,_0x3c79d2,_0xe9f5e1,_0x12bf9b){return new BPromise(function(_0x5e1d43,_0x11c9b5){var _0x4ffd84=_0x12bf9b||client;return _0x4ffd84[_0xf1a8('0x17')](_0xf32d1,_0xe9f5e1)[_0xf1a8('0x18')](function(_0xa2afc6){logger['info'](_0xf1a8('0x19'),_0x3c79d2,'request\x20sent');logger['debug'](_0xf1a8('0x1a'),_0x3c79d2,_0xf1a8('0x1b'),JSON['stringify'](_0xa2afc6));if(_0xa2afc6[_0xf1a8('0x1c')]){if(_0xa2afc6[_0xf1a8('0x1c')][_0xf1a8('0x1d')]===0x1f4){logger[_0xf1a8('0x1c')](_0xf1a8('0x19'),_0x3c79d2,_0xa2afc6[_0xf1a8('0x1c')][_0xf1a8('0x1e')]);return _0x11c9b5(_0xa2afc6['error']['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x3c79d2,_0xa2afc6[_0xf1a8('0x1c')][_0xf1a8('0x1e')]);return _0x5e1d43(_0xa2afc6[_0xf1a8('0x1c')][_0xf1a8('0x1e')]);}else{logger[_0xf1a8('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x3c79d2,_0xf1a8('0x1b'));_0x5e1d43(_0xa2afc6[_0xf1a8('0x20')][_0xf1a8('0x1e')]);}})[_0xf1a8('0x21')](function(_0x28e544){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3c79d2,_0x28e544);_0x11c9b5(_0x28e544);});});}function respondWithStatusCode(_0x5e934b,_0x5e3853){_0x5e3853=_0x5e3853||0xcc;return function(_0x1c5368){if(_0x1c5368){return _0x5e934b[_0xf1a8('0x22')](_0x5e3853);}return _0x5e934b[_0xf1a8('0x23')](_0x5e3853)['end']();};}function respondWithResult(_0x2e2aee,_0x159fcf){_0x159fcf=_0x159fcf||0xc8;return function(_0x2f676c){if(_0x2f676c){return _0x2e2aee['status'](_0x159fcf)[_0xf1a8('0x24')](_0x2f676c);}};}function respondWithFilteredResult(_0x81604f,_0x269a18){return function(_0x27b257){if(_0x27b257){var _0x4b3918=typeof _0x269a18[_0xf1a8('0x25')]===_0xf1a8('0x26')&&typeof _0x269a18[_0xf1a8('0x27')]===_0xf1a8('0x26');var _0x36fc97=_0x27b257['count'];var _0x31676c=_0x4b3918?0x0:_0x269a18[_0xf1a8('0x25')];var _0x33a47b=_0x4b3918?_0x27b257[_0xf1a8('0x28')]:_0x269a18['offset']+_0x269a18[_0xf1a8('0x27')];var _0x31c75f;if(_0x33a47b>=_0x36fc97){_0x33a47b=_0x36fc97;_0x31c75f=0xc8;}else{_0x31c75f=0xce;}_0x81604f[_0xf1a8('0x23')](_0x31c75f);return _0x81604f[_0xf1a8('0x29')](_0xf1a8('0x2a'),_0x31676c+'-'+_0x33a47b+'/'+_0x36fc97)[_0xf1a8('0x24')](_0x27b257);}return null;};}function patchUpdates(_0x82b10b){return function(_0x1e5b11){try{jsonpatch[_0xf1a8('0x2b')](_0x1e5b11,_0x82b10b,!![]);}catch(_0x17e756){return BPromise[_0xf1a8('0x2c')](_0x17e756);}return _0x1e5b11['save']();};}function saveUpdates(_0x1e06aa,_0x2c9788){return function(_0x4a350c){if(_0x4a350c){return _0x4a350c[_0xf1a8('0x2d')](_0x1e06aa)[_0xf1a8('0x18')](function(_0x508cbb){return _0x508cbb;});}return null;};}function removeEntity(_0x484549,_0x101ffa){return function(_0x118bda){if(_0x118bda){return _0x118bda[_0xf1a8('0x2e')]()[_0xf1a8('0x18')](function(){_0x484549[_0xf1a8('0x23')](0xcc)[_0xf1a8('0x2f')]();});}};}function handleEntityNotFound(_0x4c1069,_0x2e3bd9){return function(_0x212745){if(!_0x212745){_0x4c1069[_0xf1a8('0x22')](0x194);}return _0x212745;};}function handleError(_0x12e635,_0x1bfc56){_0x1bfc56=_0x1bfc56||0x1f4;return function(_0x13c10a){logger[_0xf1a8('0x1c')](_0x13c10a[_0xf1a8('0x30')]);if(_0x13c10a['name']){delete _0x13c10a['name'];}_0x12e635[_0xf1a8('0x23')](_0x1bfc56)[_0xf1a8('0x31')](_0x13c10a);};}exports[_0xf1a8('0x32')]=function(_0x2f843e,_0x57ac20){var _0x221d68={},_0x544f16={},_0x5c1342={'count':0x0,'rows':[]};var _0x231bb9=_[_0xf1a8('0x33')](db[_0xf1a8('0x34')]['rawAttributes'],function(_0x4a9324){return{'name':_0x4a9324[_0xf1a8('0x35')],'type':_0x4a9324[_0xf1a8('0x36')]['key']};});_0x544f16[_0xf1a8('0x37')]=_[_0xf1a8('0x33')](_0x231bb9,_0xf1a8('0x38'));_0x544f16[_0xf1a8('0x39')]=_[_0xf1a8('0x3a')](_0x2f843e[_0xf1a8('0x39')]);_0x544f16[_0xf1a8('0x3b')]=_[_0xf1a8('0x3c')](_0x544f16[_0xf1a8('0x37')],_0x544f16[_0xf1a8('0x39')]);_0x221d68[_0xf1a8('0x3d')]=_[_0xf1a8('0x3c')](_0x544f16[_0xf1a8('0x37')],qs[_0xf1a8('0x3e')](_0x2f843e[_0xf1a8('0x39')]['fields']));_0x221d68[_0xf1a8('0x3d')]=_0x221d68['attributes'][_0xf1a8('0x3f')]?_0x221d68['attributes']:_0x544f16[_0xf1a8('0x37')];if(!_0x2f843e[_0xf1a8('0x39')][_0xf1a8('0x40')](_0xf1a8('0x41'))){_0x221d68[_0xf1a8('0x27')]=qs[_0xf1a8('0x27')](_0x2f843e[_0xf1a8('0x39')][_0xf1a8('0x27')]);_0x221d68[_0xf1a8('0x25')]=qs[_0xf1a8('0x25')](_0x2f843e[_0xf1a8('0x39')]['offset']);}_0x221d68[_0xf1a8('0x42')]=qs[_0xf1a8('0x43')](_0x2f843e[_0xf1a8('0x39')]['sort']);_0x221d68[_0xf1a8('0x44')]=qs['filters'](_['pick'](_0x2f843e[_0xf1a8('0x39')],_0x544f16[_0xf1a8('0x3b')]),_0x231bb9);if(_0x2f843e['query'][_0xf1a8('0x45')]){_0x221d68[_0xf1a8('0x44')]=_[_0xf1a8('0x46')](_0x221d68[_0xf1a8('0x44')],{'$or':_[_0xf1a8('0x33')](_0x231bb9,function(_0x3d3078){if(_0x3d3078[_0xf1a8('0x36')]!==_0xf1a8('0x47')){var _0x12cd93={};_0x12cd93[_0x3d3078[_0xf1a8('0x38')]]={'$like':'%'+_0x2f843e[_0xf1a8('0x39')][_0xf1a8('0x45')]+'%'};return _0x12cd93;}})});}_0x221d68=_[_0xf1a8('0x46')]({},_0x221d68,_0x2f843e[_0xf1a8('0x48')]);var _0x2e5547={'where':_0x221d68[_0xf1a8('0x44')]};return db[_0xf1a8('0x34')][_0xf1a8('0x28')](_0x2e5547)[_0xf1a8('0x18')](function(_0x27cc32){_0x5c1342[_0xf1a8('0x28')]=_0x27cc32;if(_0x2f843e['query'][_0xf1a8('0x49')]){_0x221d68[_0xf1a8('0x4a')]=[{'all':!![]}];}return db[_0xf1a8('0x34')][_0xf1a8('0x4b')](_0x221d68);})[_0xf1a8('0x18')](function(_0x18dc7c){_0x5c1342[_0xf1a8('0x4c')]=_0x18dc7c;return _0x5c1342;})[_0xf1a8('0x18')](respondWithFilteredResult(_0x57ac20,_0x221d68))[_0xf1a8('0x21')](handleError(_0x57ac20,null));};exports[_0xf1a8('0x4d')]=function(_0x26d4f6,_0x3c736b){var _0x2b0461={'raw':!![],'where':{'id':_0x26d4f6[_0xf1a8('0x4e')]['id']}},_0x403003={};_0x403003[_0xf1a8('0x37')]=_[_0xf1a8('0x3a')](db[_0xf1a8('0x34')][_0xf1a8('0x4f')]);_0x403003['query']=_[_0xf1a8('0x3a')](_0x26d4f6[_0xf1a8('0x39')]);_0x403003[_0xf1a8('0x3b')]=_[_0xf1a8('0x3c')](_0x403003[_0xf1a8('0x37')],_0x403003['query']);_0x2b0461[_0xf1a8('0x3d')]=_[_0xf1a8('0x3c')](_0x403003[_0xf1a8('0x37')],qs[_0xf1a8('0x3e')](_0x26d4f6[_0xf1a8('0x39')][_0xf1a8('0x3e')]));_0x2b0461[_0xf1a8('0x3d')]=_0x2b0461['attributes'][_0xf1a8('0x3f')]?_0x2b0461[_0xf1a8('0x3d')]:_0x403003['model'];if(_0x26d4f6[_0xf1a8('0x39')]['includeAll']){_0x2b0461['include']=[{'all':!![]}];}_0x2b0461=_[_0xf1a8('0x46')]({},_0x2b0461,_0x26d4f6['options']);return db[_0xf1a8('0x34')][_0xf1a8('0x50')](_0x2b0461)['then'](handleEntityNotFound(_0x3c736b,null))[_0xf1a8('0x18')](respondWithResult(_0x3c736b,null))[_0xf1a8('0x21')](handleError(_0x3c736b,null));};exports['update']=function(_0x417bed,_0x5d4806){if(_0x417bed[_0xf1a8('0x51')]['id']){delete _0x417bed[_0xf1a8('0x51')]['id'];}return db[_0xf1a8('0x34')][_0xf1a8('0x50')]({'where':{'id':_0x417bed[_0xf1a8('0x4e')]['id']}})[_0xf1a8('0x18')](handleEntityNotFound(_0x5d4806,null))[_0xf1a8('0x18')](saveUpdates(_0x417bed[_0xf1a8('0x51')],null))[_0xf1a8('0x18')](respondWithResult(_0x5d4806,null))[_0xf1a8('0x21')](handleError(_0x5d4806,null));};exports['destroy']=function(_0x171dd3,_0x24b4c5){return db[_0xf1a8('0x34')][_0xf1a8('0x50')]({'where':{'id':_0x171dd3[_0xf1a8('0x4e')]['id']}})[_0xf1a8('0x18')](handleEntityNotFound(_0x24b4c5,null))[_0xf1a8('0x18')](removeEntity(_0x24b4c5,null))[_0xf1a8('0x21')](handleError(_0x24b4c5,null));};exports[_0xf1a8('0x52')]=function(_0x310ff2,_0xb07d15){return db[_0xf1a8('0x34')][_0xf1a8('0x52')]()[_0xf1a8('0x18')](respondWithResult(_0xb07d15,null))['catch'](handleError(_0xb07d15,null));};var interaction_log=require(_0xf1a8('0x53'))(_0xf1a8('0x54'));exports[_0xf1a8('0x55')]=function(_0x37e134,_0x1bba5e,_0x427430){var _0x5a564d={'agent':{},'channel':_0xf1a8('0x56')};if(_0x37e134[_0xf1a8('0x51')]['id']){delete _0x37e134[_0xf1a8('0x51')]['id'];}_0x37e134['body']['read']=!![];_0x37e134[_0xf1a8('0x51')][_0xf1a8('0x57')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37e134['body'][_0xf1a8('0x58')]=_0x37e134[_0xf1a8('0x51')][_0xf1a8('0x58')]||_0x37e134[_0xf1a8('0x59')]['id'];_0x5a564d[_0xf1a8('0x5a')]['id']=_0x37e134[_0xf1a8('0x51')]['UserId'];return db[_0xf1a8('0x34')][_0xf1a8('0x50')]({'where':{'id':_0x37e134[_0xf1a8('0x4e')]['id'],'UserId':null}})[_0xf1a8('0x18')](handleEntityNotFound(_0x1bba5e,null))['then'](saveUpdates(_0x37e134[_0xf1a8('0x51')],null))[_0xf1a8('0x18')](function(_0x29da3e){if(_0x29da3e){_0x5a564d[_0xf1a8('0x1e')]=_0x29da3e['get']({'plain':!![]});return db[_0xf1a8('0x5b')]['find']({'where':{'id':_0x29da3e[_0xf1a8('0x5c')]}});}return null;})[_0xf1a8('0x18')](handleEntityNotFound(_0x1bba5e,null))[_0xf1a8('0x18')](function(_0x35f7bb){if(_0x35f7bb){return _0x35f7bb[_0xf1a8('0x2d')]({'UserId':_0x37e134[_0xf1a8('0x51')][_0xf1a8('0x58')],'read1stAt':_['isNil'](_0x35f7bb[_0xf1a8('0x5d')])?moment()[_0xf1a8('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf1a8('0x18')](function(_0x52dba8){if(_0x52dba8){_0x5a564d[_0xf1a8('0x5f')]=_0x52dba8[_0xf1a8('0x60')]({'plain':!![]});interaction_log[_0xf1a8('0x1f')](_0xf1a8('0x61'),_0x37e134[_0xf1a8('0x59')]['id'],_0x37e134[_0xf1a8('0x59')]['name'],_0x37e134[_0xf1a8('0x59')][_0xf1a8('0x62')],_0x5a564d[_0xf1a8('0x5f')]['id'],_0x37e134[_0xf1a8('0x51')]?JSON[_0xf1a8('0x63')](_0x37e134[_0xf1a8('0x51')]):_0xf1a8('0x64'));return respondWithRpcPromise(_0xf1a8('0x65'),_0xf1a8('0x66'),_0x5a564d);}return null;})['then'](function(_0xd9c16d){var _0x59daed=_0xf1a8('0x67')+_0xd9c16d[_0xf1a8('0x1e')][_0xf1a8('0x68')];return db[_0xf1a8('0x69')][_0xf1a8('0x39')](_0x59daed,{'type':db[_0xf1a8('0x6a')][_0xf1a8('0x6b')][_0xf1a8('0x6c')],'raw':!![]})[_0xf1a8('0x18')](function(_0x590355){return _0x590355;});})[_0xf1a8('0x18')](function(_0x13fe4c){if(_0x13fe4c){_0x5a564d[_0xf1a8('0x1e')][_0xf1a8('0x6d')]=_0x13fe4c[0x0];if(!_0x37e134['body'][_0xf1a8('0x58')])return;return db['User'][_0xf1a8('0x50')]({'where':{'id':_0x37e134['body'][_0xf1a8('0x58')],'role':_0xf1a8('0x5a')},'attributes':['id',_0xf1a8('0x38'),_0xf1a8('0x6e'),'email',_0xf1a8('0x6f')],'raw':!![]});}return null;})[_0xf1a8('0x18')](function(_0x22d78b){if(!_0x22d78b)return null;_0x5a564d[_0xf1a8('0x1e')][_0xf1a8('0x5a')]=_0x22d78b;return _0x5a564d;})[_0xf1a8('0x18')](function(_0x45da3c){if(_0x45da3c){if(_0x37e134[_0xf1a8('0x51')][_0xf1a8('0x70')]){_0x5a564d['message'][_0xf1a8('0x71')]=util[_0xf1a8('0x5e')]('SIP/%s',_0x37e134[_0xf1a8('0x59')][_0xf1a8('0x38')]);_0x5a564d[_0xf1a8('0x1e')][_0xf1a8('0x72')]=_0x5a564d['channel'];_0x5a564d['message'][_0xf1a8('0x73')]=_0x5a564d['channel'];_0x5a564d[_0xf1a8('0x1e')][_0xf1a8('0x74')]=_0xf1a8('0x55');return respondWithRpcPromise(_0xf1a8('0x75'),_0xf1a8('0x75'),{'event':'acceptmessage','message':_0x5a564d[_0xf1a8('0x1e')]},client9002)[_0xf1a8('0x18')](function(){return _0x5a564d;});}return _0x5a564d;}return null;})[_0xf1a8('0x18')](respondWithResult(_0x1bba5e,null))[_0xf1a8('0x21')](handleError(_0x1bba5e,null));};var interaction_log=require('../../config/logger')(_0xf1a8('0x54'));exports[_0xf1a8('0x2c')]=function(_0x5616d4,_0x4a369a,_0x508980){var _0x19f6f4={'agent':{},'channel':_0xf1a8('0x56')};if(_0x5616d4[_0xf1a8('0x51')]['id']){delete _0x5616d4['body']['id'];}_0x5616d4[_0xf1a8('0x51')][_0xf1a8('0x58')]=_0x5616d4[_0xf1a8('0x51')]['UserId']||_0x5616d4[_0xf1a8('0x59')]['id'];_0x19f6f4['agent']['id']=_0x5616d4['body'][_0xf1a8('0x58')];return db['FaxMessage']['find']({'where':{'id':_0x5616d4['params']['id'],'UserId':null}})[_0xf1a8('0x18')](handleEntityNotFound(_0x4a369a,null))[_0xf1a8('0x18')](function(_0x4289f3){if(_0x4289f3){_0x19f6f4[_0xf1a8('0x1e')]=_0x4289f3[_0xf1a8('0x60')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4289f3['FaxInteractionId']}});}return null;})[_0xf1a8('0x18')](handleEntityNotFound(_0x4a369a,null))[_0xf1a8('0x18')](function(_0x390fe0){if(_0x390fe0){_0x19f6f4[_0xf1a8('0x5f')]=_0x390fe0[_0xf1a8('0x60')]({'plain':!![]});interaction_log[_0xf1a8('0x1f')](_0xf1a8('0x76'),_0x5616d4[_0xf1a8('0x59')]['id'],_0x5616d4[_0xf1a8('0x59')][_0xf1a8('0x38')],_0x5616d4['user']['role'],_0x19f6f4[_0xf1a8('0x5f')]['id'],_0x5616d4[_0xf1a8('0x51')]?JSON[_0xf1a8('0x63')](_0x5616d4[_0xf1a8('0x51')]):'null');return respondWithRpcPromise(_0xf1a8('0x77'),_0xf1a8('0x78'),_0x19f6f4);}return null;})[_0xf1a8('0x18')](function(_0x5a544f){var _0x223fd0=_0xf1a8('0x67')+_0x5a544f[_0xf1a8('0x1e')][_0xf1a8('0x68')];return db[_0xf1a8('0x69')][_0xf1a8('0x39')](_0x223fd0,{'type':db[_0xf1a8('0x6a')][_0xf1a8('0x6b')]['SELECT'],'raw':!![]})[_0xf1a8('0x18')](function(_0xaf4bf1){return _0xaf4bf1;});})[_0xf1a8('0x18')](function(_0x1c6d45){if(_0x1c6d45){_0x19f6f4[_0xf1a8('0x1e')][_0xf1a8('0x6d')]=_0x1c6d45[0x0];if(!_0x5616d4['body'][_0xf1a8('0x58')])return;return db[_0xf1a8('0x79')][_0xf1a8('0x50')]({'where':{'id':_0x5616d4['body'][_0xf1a8('0x58')],'role':'agent'},'attributes':['id',_0xf1a8('0x38'),_0xf1a8('0x6e'),'email',_0xf1a8('0x6f')],'raw':!![]});}return null;})['then'](function(_0x589170){if(!_0x589170)return null;_0x19f6f4['message'][_0xf1a8('0x5a')]=_0x589170;return _0x19f6f4;})[_0xf1a8('0x18')](function(_0x13d2f2){if(_0x13d2f2){_0x13d2f2[_0xf1a8('0x1e')][_0xf1a8('0x71')]=util[_0xf1a8('0x5e')](_0xf1a8('0x7a'),_0x5616d4[_0xf1a8('0x59')][_0xf1a8('0x38')]);_0x13d2f2['message'][_0xf1a8('0x72')]=_0x19f6f4[_0xf1a8('0x72')];_0x13d2f2[_0xf1a8('0x1e')]['motionChannel']=_0x19f6f4['channel'];_0x13d2f2[_0xf1a8('0x1e')][_0xf1a8('0x74')]=_0xf1a8('0x2c');respondWithRpcPromise(_0xf1a8('0x75'),_0xf1a8('0x75'),{'event':'rejectmessage','message':_0x13d2f2['message']},client9002);return _0x19f6f4;}return null;})[_0xf1a8('0x18')](respondWithResult(_0x4a369a,null))[_0xf1a8('0x21')](handleError(_0x4a369a,null));};exports[_0xf1a8('0x7b')]=function(_0x2ed13a,_0x5d13d5){var _0x111330;return db[_0xf1a8('0x34')][_0xf1a8('0x7b')](_0x2ed13a[_0xf1a8('0x51')],{})[_0xf1a8('0x18')](function(_0x1511fb){_0x111330=_0x1511fb;return db['CmContact'][_0xf1a8('0x7c')]({'where':{'id':_0x111330[_0xf1a8('0x68')]}});})[_0xf1a8('0x18')](function(_0x168cc5){if(_['isNil'](_0x168cc5)){return;}else{_0x111330['fax']=_0x168cc5[_0xf1a8('0x56')];return db[_0xf1a8('0x7d')]['findOne']({'where':{'id':_0x111330[_0xf1a8('0x7e')]}});}})[_0xf1a8('0x18')](function(_0x21eba6){return respondWithRpcPromise(_0xf1a8('0x7f'),'SendFax',{'FaxAccountId':_[_0xf1a8('0x80')](_0x2ed13a[_0xf1a8('0x51')])?undefined:_0x2ed13a[_0xf1a8('0x51')][_0xf1a8('0x81')],'path':_['isNil'](_0x21eba6)?undefined:util[_0xf1a8('0x5e')](_0xf1a8('0x82'),_0x21eba6['basename']),'fax':_[_0xf1a8('0x80')](_0x111330[_0xf1a8('0x56')])?undefined:_0x111330[_0xf1a8('0x56')],'AttachmentId':_0x111330[_0xf1a8('0x7e')]},client9002);})[_0xf1a8('0x18')](respondWithResult(_0x5d13d5,0xc9))[_0xf1a8('0x21')](handleError(_0x5d13d5,null));};exports[_0xf1a8('0x83')]=function(_0x51a90c,_0x9f8c20){var _0x5c1746=path[_0xf1a8('0x84')](config[_0xf1a8('0x85')],_0xf1a8('0x86'),_0xf1a8('0x87'),_0xf1a8('0x88'));return db['FaxMessage'][_0xf1a8('0x50')]({'where':{'id':_0x51a90c['params']['id']},'include':[{'model':db['Attachment'],'as':_0xf1a8('0x7d')}]})['then'](handleEntityNotFound(_0x9f8c20,null))[_0xf1a8('0x18')](function(_0x4ab526){if(_0x4ab526){return _0x9f8c20[_0xf1a8('0x83')](path['join'](_0x5c1746,_0x4ab526['Attachment'][_0xf1a8('0x89')]));}})[_0xf1a8('0x21')](handleError(_0x9f8c20,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 3bb4f56..4272727 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 _0xad40=['events','../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad40,0xfa));var _0x0ad4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xad40[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0x0ad4('0x0'));var FaxMessage=require(_0x0ad4('0x1'))['db'][_0x0ad4('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0ad4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ad4('0x4'),'afterDestroy':_0x0ad4('0x5')};function emitEvent(_0x2d5a56){return function(_0x3f47b3,_0x85c3b9,_0x34f7cb){FaxMessageEvents[_0x0ad4('0x6')](_0x2d5a56+':'+_0x3f47b3['id'],_0x3f47b3);FaxMessageEvents['emit'](_0x2d5a56,_0x3f47b3);_0x34f7cb(null);};}for(var e in events){if(events[_0x0ad4('0x7')](e)){var event=events[e];FaxMessage[_0x0ad4('0x8')](e,emitEvent(event));}}module[_0x0ad4('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x5d58=['hook','update','remove','emit','hasOwnProperty'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5d58,0x187));var _0x85d5=function(_0x20c123,_0x40594a){_0x20c123=_0x20c123-0x0;var _0x5b8709=_0x5d58[_0x20c123];return _0x5b8709;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85d5('0x0'),'afterDestroy':_0x85d5('0x1')};function emitEvent(_0x53ca58){return function(_0x1469fc,_0x30bfe8,_0x54207b){FaxMessageEvents[_0x85d5('0x2')](_0x53ca58+':'+_0x1469fc['id'],_0x1469fc);FaxMessageEvents[_0x85d5('0x2')](_0x53ca58,_0x1469fc);_0x54207b(null);};}for(var e in events){if(events[_0x85d5('0x3')](e)){var event=events[e];FaxMessage[_0x85d5('0x4')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e55f1c9..76e57fd 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 _0x3111=['catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt'];(function(_0x4662c7,_0xad7ea1){var _0x1e1d78=function(_0x5c48d4){while(--_0x5c48d4){_0x4662c7['push'](_0x4662c7['shift']());}};_0x1e1d78(++_0xad7ea1);}(_0x3111,0x146));var _0x1311=function(_0x317a83,_0x5b473d){_0x317a83=_0x317a83-0x0;var _0x4a90c2=_0x3111[_0x317a83];return _0x4a90c2;};'use strict';var _=require(_0x1311('0x0'));var util=require(_0x1311('0x1'));var logger=require('../../config/logger')(_0x1311('0x2'));var moment=require(_0x1311('0x3'));var BPromise=require(_0x1311('0x4'));var rp=require(_0x1311('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1311('0x6'));module[_0x1311('0x7')]=function(_0x35d6cd,_0x53848a){return _0x35d6cd[_0x1311('0x8')](_0x1311('0x9'),attributes,{'tableName':_0x1311('0xa'),'paranoid':![],'indexes':[{'name':_0x1311('0xb'),'fields':[_0x1311('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1313fc,_0x1b7b72,_0x5b94b8){var _0x18b0a9=_0x35d6cd[_0x1311('0xd')];var _0x1f4667=_0x1313fc[_0x1311('0xe')]({'plain':!![]});if(_0x1f4667[_0x1311('0xf')][_0x1311('0x10')]()==='in'||_0x1f4667[_0x1311('0xf')][_0x1311('0x10')]()==='out'&&!_0x1f4667[_0x1311('0x11')]&&!_[_0x1311('0x12')](_0x1f4667[_0x1311('0x13')])){_0x18b0a9[_0x1311('0x14')][_0x1311('0x15')]({'where':{'id':_0x1f4667[_0x1311('0x16')]}})[_0x1311('0x17')](function(_0x15521c){if(_0x15521c){_0x15521c['update']({'lastMsgAt':_0x1f4667[_0x1311('0x18')],'lastMsgDirection':_0x1f4667[_0x1311('0xf')][_0x1311('0x10')]()});}})[_0x1311('0x19')](function(_0x20a525){console['error'](_0x20a525);});}_0x5b94b8();}},'charset':'utf8mb4','collate':_0x1311('0x1a')});}; \ No newline at end of file +var _0xd36a=['path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x417f52,_0x41ec6b){var _0x2e84e8=function(_0x37f0ac){while(--_0x37f0ac){_0x417f52['push'](_0x417f52['shift']());}};_0x2e84e8(++_0x41ec6b);}(_0xd36a,0xf1));var _0xad36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd36a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xad36('0x0'));var util=require(_0xad36('0x1'));var logger=require(_0xad36('0x2'))(_0xad36('0x3'));var moment=require(_0xad36('0x4'));var BPromise=require(_0xad36('0x5'));var rp=require(_0xad36('0x6'));var fs=require('fs');var path=require(_0xad36('0x7'));var rimraf=require(_0xad36('0x8'));var config=require(_0xad36('0x9'));var attributes=require(_0xad36('0xa'));module['exports']=function(_0x149398,_0x510874){return _0x149398[_0xad36('0xb')](_0xad36('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xad36('0xd'),'fields':[_0xad36('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x504e94,_0x2aa76f,_0x3f7bae){var _0x391399=_0x149398[_0xad36('0xf')];var _0x167302=_0x504e94[_0xad36('0x10')]({'plain':!![]});if(_0x167302[_0xad36('0x11')]['toLowerCase']()==='in'||_0x167302[_0xad36('0x11')][_0xad36('0x12')]()==='out'&&!_0x167302[_0xad36('0x13')]&&!_[_0xad36('0x14')](_0x167302[_0xad36('0x15')])){_0x391399[_0xad36('0x16')][_0xad36('0x17')]({'where':{'id':_0x167302[_0xad36('0x18')]}})[_0xad36('0x19')](function(_0x3ef2c4){if(_0x3ef2c4){_0x3ef2c4[_0xad36('0x1a')]({'lastMsgAt':_0x167302[_0xad36('0x1b')],'lastMsgDirection':_0x167302[_0xad36('0x11')]['toLowerCase']()});}})['catch'](function(_0xd8f5be){console[_0xad36('0x1c')](_0xd8f5be);});}_0x3f7bae();}},'charset':_0xad36('0x1d'),'collate':_0xad36('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 98547eb..c466061 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 _0x4b84=['CreateFaxMessage','FaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','attributes','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','debug','error','message','FaxMessage,\x20%s,\x20%s','result'];(function(_0x382a05,_0x344b9c){var _0xf1407=function(_0x5792ae){while(--_0x5792ae){_0x382a05['push'](_0x382a05['shift']());}};_0xf1407(++_0x344b9c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x4b84[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});config['redis']=_[_0x44b8('0x7')](config['redis'],{'host':_0x44b8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x44b8('0x9'))[_0x44b8('0xa')](socket);function respondWithRpcPromise(_0x30ebc3,_0x48a371,_0xc650ec){return new BPromise(function(_0x2cc74b,_0x4315f6){return client[_0x44b8('0xb')](_0x30ebc3,_0xc650ec)[_0x44b8('0xc')](function(_0x37e471){logger[_0x44b8('0xd')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'));logger[_0x44b8('0xf')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'),JSON['stringify'](_0x37e471));if(_0x37e471[_0x44b8('0x10')]){if(_0x37e471[_0x44b8('0x10')]['code']===0x1f4){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error'][_0x44b8('0x11')]);return _0x4315f6(_0x37e471[_0x44b8('0x10')][_0x44b8('0x11')]);}logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error']['message']);return _0x2cc74b(_0x37e471[_0x44b8('0x10')]['message']);}else{logger[_0x44b8('0xd')](_0x44b8('0x12'),_0x48a371,'request\x20sent');_0x2cc74b(_0x37e471[_0x44b8('0x13')][_0x44b8('0x11')]);}})['catch'](function(_0x89bc30){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x89bc30);_0x4315f6(_0x89bc30);});});}exports[_0x44b8('0x14')]=function(_0x8b4301){var _0xebfe79=this;return new Promise(function(_0x235bdc,_0x102ef9){return db[_0x44b8('0x15')][_0x44b8('0x16')](_0x8b4301[_0x44b8('0x17')],{'raw':_0x8b4301[_0x44b8('0x18')]?_0x8b4301[_0x44b8('0x18')][_0x44b8('0x19')]===undefined?!![]:![]:!![]})[_0x44b8('0xc')](function(_0x48327e){logger[_0x44b8('0xd')](_0x44b8('0x14'),_0x8b4301);logger[_0x44b8('0xf')](_0x44b8('0x14'),_0x8b4301,JSON[_0x44b8('0x1a')](_0x48327e));_0x235bdc(_0x48327e);})['catch'](function(_0x402497){logger['error'](_0x44b8('0x14'),_0x402497[_0x44b8('0x11')],_0x8b4301);_0x102ef9(_0xebfe79[_0x44b8('0x10')](0x1f4,_0x402497[_0x44b8('0x11')]));});});};exports[_0x44b8('0x1b')]=function(_0x59acbc){var _0x474f01=this;return new Promise(function(_0x502acf,_0x41d673){return db[_0x44b8('0x15')]['update'](_0x59acbc[_0x44b8('0x17')],{'raw':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['where']||null:null,'attributes':_0x59acbc[_0x44b8('0x18')]?_0x59acbc['options'][_0x44b8('0x1c')]||null:null,'limit':_0x59acbc['options']?_0x59acbc['options']['limit']||null:null})[_0x44b8('0xc')](function(_0x29b18d){logger[_0x44b8('0xd')](_0x44b8('0x1b'),_0x59acbc);logger[_0x44b8('0xf')](_0x44b8('0x1b'),_0x59acbc,JSON[_0x44b8('0x1a')](_0x29b18d));_0x502acf(_0x29b18d);})[_0x44b8('0x1d')](function(_0xd1d320){logger[_0x44b8('0x10')](_0x44b8('0x1b'),_0xd1d320[_0x44b8('0x11')],_0x59acbc);_0x41d673(_0x474f01[_0x44b8('0x10')](0x1f4,_0xd1d320['message']));});});}; \ No newline at end of file +var _0xa41a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','info','debug','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','body','options','raw','then','FaxMessage','update','where','attributes','UpdateFaxMessage','lodash','util','bluebird','randomstring'];(function(_0x1bdb67,_0x4b8014){var _0x1a6781=function(_0x5b3ec6){while(--_0x5b3ec6){_0x1bdb67['push'](_0x1bdb67['shift']());}};_0x1a6781(++_0x4b8014);}(_0xa41a,0x6b));var _0xaa41=function(_0x250780,_0x4994e6){_0x250780=_0x250780-0x0;var _0x11f214=_0xa41a[_0x250780];return _0x11f214;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaa41('0xc')],{'host':_0xaa41('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xc')]));require(_0xaa41('0xe'))[_0xaa41('0xf')](socket);function respondWithRpcPromise(_0x1cc344,_0x4263d6,_0x38d930){return new BPromise(function(_0x806f08,_0x423a19){return client[_0xaa41('0x10')](_0x1cc344,_0x38d930)['then'](function(_0x1d3aac){logger[_0xaa41('0x11')]('FaxMessage,\x20%s,\x20%s',_0x4263d6,'request\x20sent');logger[_0xaa41('0x12')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4263d6,_0xaa41('0x13'),JSON[_0xaa41('0x14')](_0x1d3aac));if(_0x1d3aac[_0xaa41('0x15')]){if(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x16')]===0x1f4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);return _0x423a19(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}logger[_0xaa41('0x15')](_0xaa41('0x17'),_0x4263d6,_0x1d3aac['error'][_0xaa41('0x18')]);return _0x806f08(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}else{logger[_0xaa41('0x11')](_0xaa41('0x17'),_0x4263d6,_0xaa41('0x13'));_0x806f08(_0x1d3aac[_0xaa41('0x19')][_0xaa41('0x18')]);}})[_0xaa41('0x1a')](function(_0x4fe1a4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x4fe1a4);_0x423a19(_0x4fe1a4);});});}exports[_0xaa41('0x1b')]=function(_0x35c753){var _0x54c488=this;return new Promise(function(_0x2bf794,_0x1f692b){return db['FaxMessage']['create'](_0x35c753[_0xaa41('0x1c')],{'raw':_0x35c753['options']?_0x35c753[_0xaa41('0x1d')][_0xaa41('0x1e')]===undefined?!![]:![]:!![]})[_0xaa41('0x1f')](function(_0x1f27f3){logger[_0xaa41('0x11')]('CreateFaxMessage',_0x35c753);logger[_0xaa41('0x12')](_0xaa41('0x1b'),_0x35c753,JSON[_0xaa41('0x14')](_0x1f27f3));_0x2bf794(_0x1f27f3);})[_0xaa41('0x1a')](function(_0x274630){logger[_0xaa41('0x15')]('CreateFaxMessage',_0x274630['message'],_0x35c753);_0x1f692b(_0x54c488[_0xaa41('0x15')](0x1f4,_0x274630['message']));});});};exports['UpdateFaxMessage']=function(_0x12e362){var _0x59707f=this;return new Promise(function(_0x536bed,_0x2d0ac0){return db[_0xaa41('0x20')][_0xaa41('0x21')](_0x12e362[_0xaa41('0x1c')],{'raw':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x22')]||null:null,'attributes':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x23')]||null:null,'limit':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['limit']||null:null})[_0xaa41('0x1f')](function(_0x48b48b){logger['info'](_0xaa41('0x24'),_0x12e362);logger[_0xaa41('0x12')]('UpdateFaxMessage',_0x12e362,JSON[_0xaa41('0x14')](_0x48b48b));_0x536bed(_0x48b48b);})[_0xaa41('0x1a')](function(_0x4e3b44){logger['error']('UpdateFaxMessage',_0x4e3b44[_0xaa41('0x18')],_0x12e362);_0x2d0ac0(_0x59707f[_0xaa41('0x15')](0x1f4,_0x4e3b44[_0xaa41('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 1930c82..6aac2a9 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 _0x59c3=['update','removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x59c3,0xc5));var _0x359c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x59c3[_0x5b561d];return _0x431060;};'use strict';var FaxMessageEvents=require(_0x359c('0x0'));var events=[_0x359c('0x1'),_0x359c('0x2'),_0x359c('0x3')];function createListener(_0x1aeec1,_0x101237){return function(_0x33a68c){_0x101237['emit'](_0x1aeec1,_0x33a68c);};}function removeListener(_0x4bbcad,_0x129ab0){return function(){FaxMessageEvents[_0x359c('0x4')](_0x4bbcad,_0x129ab0);};}exports[_0x359c('0x5')]=function(_0x2ed2fe){for(var _0x43c38b=0x0,_0x549890=events[_0x359c('0x6')];_0x43c38b<_0x549890;_0x43c38b++){var _0x4cb267=events[_0x43c38b];var _0x3eaf38=createListener(_0x359c('0x7')+_0x4cb267,_0x2ed2fe);FaxMessageEvents['on'](_0x4cb267,_0x3eaf38);}}; \ No newline at end of file +var _0xc750=['remove','removeListener','faxMessage:','./faxMessage.events','save'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0xc750,0x18e));var _0x0c75=function(_0x50e55c,_0x1ca488){_0x50e55c=_0x50e55c-0x0;var _0x39c88d=_0xc750[_0x50e55c];return _0x39c88d;};'use strict';var FaxMessageEvents=require(_0x0c75('0x0'));var events=[_0x0c75('0x1'),_0x0c75('0x2'),'update'];function createListener(_0x5213d4,_0x32ed98){return function(_0x28131a){_0x32ed98['emit'](_0x5213d4,_0x28131a);};}function removeListener(_0x676f3b,_0x18f162){return function(){FaxMessageEvents[_0x0c75('0x3')](_0x676f3b,_0x18f162);};}exports['register']=function(_0xac314a){for(var _0x5099a8=0x0,_0xe484d7=events['length'];_0x5099a8<_0xe484d7;_0x5099a8++){var _0x152f3a=events[_0x5099a8];var _0x4c8329=createListener(_0x0c75('0x4')+_0x152f3a,_0xac314a);FaxMessageEvents['on'](_0x152f3a,_0x4c8329);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 32f3cf2..eb1ef67 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 _0x5ec6=['express','fs-extra','../../components/interaction/service','./faxMessage.controller','isAuthenticated','index','/describe','get','/:id','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path'];(function(_0x2d45d2,_0x37c56f){var _0x5e6c2a=function(_0x11686d){while(--_0x11686d){_0x2d45d2['push'](_0x2d45d2['shift']());}};_0x5e6c2a(++_0x37c56f);}(_0x5ec6,0x7f));var _0x65ec=function(_0x613b2b,_0x20e844){_0x613b2b=_0x613b2b-0x0;var _0x175eed=_0x5ec6[_0x613b2b];return _0x175eed;};'use strict';var multer=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var path=require(_0x65ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x65ec('0x3'));var router=express['Router']();var fs_extra=require(_0x65ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65ec('0x5'));var config=require('../../config/environment');var controller=require(_0x65ec('0x6'));router['get']('/',auth[_0x65ec('0x7')](),controller[_0x65ec('0x8')]);router['get'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller['describe']);router[_0x65ec('0xa')](_0x65ec('0xb'),auth[_0x65ec('0x7')](),controller['show']);router['get'](_0x65ec('0xc'),auth['isAuthenticated'](),controller[_0x65ec('0xd')]);router[_0x65ec('0xe')]('/',auth['isAuthenticated'](),interaction[_0x65ec('0xf')](_0x65ec('0x10'),'faxmessage:create'),controller[_0x65ec('0x11')]);router[_0x65ec('0x12')]('/:id',auth[_0x65ec('0x7')](),controller[_0x65ec('0x13')]);router[_0x65ec('0x12')](_0x65ec('0x14'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x15')]);router[_0x65ec('0x12')](_0x65ec('0x16'),auth['isAuthenticated'](),controller[_0x65ec('0x17')]);router[_0x65ec('0x18')](_0x65ec('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x65ec('0x19')]=router; \ No newline at end of file +var _0xd404=['/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe'];(function(_0xa8f9a3,_0x33e8e9){var _0x30b6d5=function(_0xca2b7d){while(--_0xca2b7d){_0xa8f9a3['push'](_0xa8f9a3['shift']());}};_0x30b6d5(++_0x33e8e9);}(_0xd404,0x15b));var _0x4d40=function(_0x41b6a7,_0x3feba8){_0x41b6a7=_0x41b6a7-0x0;var _0x5a8061=_0xd404[_0x41b6a7];return _0x5a8061;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/describe',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['get'](_0x4d40('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4d40('0x9')](_0x4d40('0xe'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')]('/',auth[_0x4d40('0xa')](),interaction[_0x4d40('0x11')](_0x4d40('0x12'),_0x4d40('0x13')),controller[_0x4d40('0x14')]);router[_0x4d40('0x15')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x16')]);router['put'](_0x4d40('0x17'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x18')]);router[_0x4d40('0x15')](_0x4d40('0x19'),auth['isAuthenticated'](),controller[_0x4d40('0x1a')]);router[_0x4d40('0x1b')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x1c')]);module[_0x4d40('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 5877cee..1b679fb 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 _0xbaef=['STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbaef,0xae));var _0xfbae=function(_0x31d454,_0x40ec23){_0x31d454=_0x31d454-0x0;var _0x116b9c=_0xbaef[_0x31d454];return _0x116b9c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfbae('0x0')],'unique':_0xfbae('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfbae('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfbae('0x3'),_0xfbae('0x4'),_0xfbae('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3ecc=['beepall','roundrobin','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ecc,0x12f));var _0xc3ec=function(_0x3e2a9a,_0x2053d6){_0x3e2a9a=_0x3e2a9a-0x0;var _0x16c7ae=_0x3ecc[_0x3e2a9a];return _0x16c7ae;};'use strict';var Sequelize=require('sequelize');module[_0xc3ec('0x0')]={'name':{'type':Sequelize[_0xc3ec('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc3ec('0x1')]},'timeout':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc3ec('0x3')](_0xc3ec('0x4'),_0xc3ec('0x5'),_0xc3ec('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc3ec('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 0bbd9b9..aaeb11a 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 _0xffd6=['interface','flatMap','sequelize','transaction','addTeams','each','emit','userFaxQueue:save','ids','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','pick','getAgents','hasOwnProperty','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','update','then','get','FaxQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','key','getOptions','count','include','query','FaxQueue','findAll','rows','catch','show','keys','filters','intersection','model','attributes','fields','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','destroy','params','describe','getMembers','findOne','UserFaxQueue','nolimit','order','sort','where','FaxQueueId','filter','User','findAndCountAll','agent','faxPause','createdAt','%s/%s','SIP','getTeams','length','Team','Agents','online'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0xffd6,0x97));var _0x6ffd=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xffd6[_0x5f0501];return _0x3c2c45;};'use strict';var BPromise=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var _=require(_0x6ffd('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x6ffd('0x3'));var logger=require(_0x6ffd('0x4'))(_0x6ffd('0x5'));var config=require('../../config/environment');var db=require(_0x6ffd('0x6'))['db'];config[_0x6ffd('0x7')]=_[_0x6ffd('0x8')](config[_0x6ffd('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ffd('0x9'))(new Redis(config[_0x6ffd('0x7')]));require(_0x6ffd('0xa'))[_0x6ffd('0xb')](socket);function respondWithStatusCode(_0x1d8b50,_0x4a9f85){_0x4a9f85=_0x4a9f85||0xcc;return function(_0x455dda){if(_0x455dda){return _0x1d8b50[_0x6ffd('0xc')](_0x4a9f85);}return _0x1d8b50['status'](_0x4a9f85)[_0x6ffd('0xd')]();};}function respondWithResult(_0x38fc68,_0x23f7f2){_0x23f7f2=_0x23f7f2||0xc8;return function(_0x3dda1e){if(_0x3dda1e){return _0x38fc68[_0x6ffd('0xe')](_0x23f7f2)[_0x6ffd('0xf')](_0x3dda1e);}};}function respondWithFilteredResult(_0x836501,_0x5892e1){return function(_0x242078){if(_0x242078){var _0x46936d=typeof _0x5892e1['offset']===_0x6ffd('0x10')&&typeof _0x5892e1[_0x6ffd('0x11')]===_0x6ffd('0x10');var _0x1a00d9=_0x242078['count'];var _0x259235=_0x46936d?0x0:_0x5892e1['offset'];var _0x468ecc=_0x46936d?_0x242078['count']:_0x5892e1[_0x6ffd('0x12')]+_0x5892e1[_0x6ffd('0x11')];var _0x45db49;if(_0x468ecc>=_0x1a00d9){_0x468ecc=_0x1a00d9;_0x45db49=0xc8;}else{_0x45db49=0xce;}_0x836501['status'](_0x45db49);return _0x836501[_0x6ffd('0x13')](_0x6ffd('0x14'),_0x259235+'-'+_0x468ecc+'/'+_0x1a00d9)[_0x6ffd('0xf')](_0x242078);}return null;};}function saveUpdates(_0x3394b2){return function(_0x29293a){if(_0x29293a){return _0x29293a[_0x6ffd('0x15')](_0x3394b2)[_0x6ffd('0x16')](function(_0x889a4b){return _0x889a4b;});}return null;};}function removeEntity(_0x545576){return function(_0x11a609){if(_0x11a609){return _0x11a609['destroy']()['then'](function(){var _0x2f5ec4=_0x11a609[_0x6ffd('0x17')]({'plain':!![]});var _0x50aaa2=_0x6ffd('0x18');return db[_0x6ffd('0x19')]['destroy']({'where':{'type':_0x50aaa2,'resourceId':_0x2f5ec4['id']}})['then'](function(){return _0x11a609;});})[_0x6ffd('0x16')](function(){_0x545576[_0x6ffd('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e1afd){return function(_0x39f25c){if(!_0x39f25c){_0x2e1afd[_0x6ffd('0xc')](0x194);}return _0x39f25c;};}function handleError(_0x53128a,_0x3ba429){_0x3ba429=_0x3ba429||0x1f4;return function(_0x2efeb5){logger['error'](_0x2efeb5[_0x6ffd('0x1a')]);if(_0x2efeb5[_0x6ffd('0x1b')]){delete _0x2efeb5['name'];}_0x53128a[_0x6ffd('0xe')](_0x3ba429)[_0x6ffd('0x1c')](_0x2efeb5);};}exports[_0x6ffd('0x1d')]=function(_0x5d353a,_0x46631e){var _0x3e5726={};var _0x46b03f={'count':0x0,'rows':[]};var _0x4ae7ac=_[_0x6ffd('0x1e')](db['FaxQueue'][_0x6ffd('0x1f')],function(_0x43269c){return{'name':_0x43269c['fieldName'],'type':_0x43269c['type'][_0x6ffd('0x20')]};});_0x3e5726=qs[_0x6ffd('0x21')](_0x4ae7ac,_0x5d353a);var _0x1934d4={'where':_0x3e5726['where']};return db['FaxQueue'][_0x6ffd('0x22')](_0x1934d4)['then'](function(_0x470021){_0x46b03f[_0x6ffd('0x22')]=_0x470021;_0x3e5726['include']=qs[_0x6ffd('0x23')](_0x5d353a[_0x6ffd('0x24')]);return db[_0x6ffd('0x25')][_0x6ffd('0x26')](_0x3e5726);})[_0x6ffd('0x16')](function(_0x31c609){_0x46b03f[_0x6ffd('0x27')]=_0x31c609;return _0x46b03f;})[_0x6ffd('0x16')](respondWithFilteredResult(_0x46631e,_0x3e5726))[_0x6ffd('0x28')](handleError(_0x46631e,null));};exports[_0x6ffd('0x29')]=function(_0x295a37,_0x352656){var _0x2b9873={'raw':!![],'where':{'id':_0x295a37['params']['id']}},_0x480dfd={};_0x480dfd['model']=_[_0x6ffd('0x2a')](db[_0x6ffd('0x25')][_0x6ffd('0x1f')]);_0x480dfd[_0x6ffd('0x24')]=_[_0x6ffd('0x2a')](_0x295a37[_0x6ffd('0x24')]);_0x480dfd[_0x6ffd('0x2b')]=_[_0x6ffd('0x2c')](_0x480dfd[_0x6ffd('0x2d')],_0x480dfd[_0x6ffd('0x24')]);_0x2b9873[_0x6ffd('0x2e')]=_[_0x6ffd('0x2c')](_0x480dfd[_0x6ffd('0x2d')],qs['fields'](_0x295a37[_0x6ffd('0x24')][_0x6ffd('0x2f')]));_0x2b9873[_0x6ffd('0x2e')]=_0x2b9873[_0x6ffd('0x2e')]['length']?_0x2b9873[_0x6ffd('0x2e')]:_0x480dfd['model'];if(_0x295a37['query'][_0x6ffd('0x30')]){_0x2b9873[_0x6ffd('0x23')]=[{'all':!![]}];}_0x2b9873=_[_0x6ffd('0x31')]({},_0x2b9873,_0x295a37[_0x6ffd('0x32')]);return db['FaxQueue'][_0x6ffd('0x33')](_0x2b9873)['then'](handleEntityNotFound(_0x352656,null))[_0x6ffd('0x16')](respondWithResult(_0x352656,null))[_0x6ffd('0x28')](handleError(_0x352656,null));};exports[_0x6ffd('0x34')]=function(_0x399984,_0x23fae4){return db['FaxQueue']['create'](_0x399984[_0x6ffd('0x35')],{})['then'](function(_0x2a7278){var _0x98bf46=_0x399984[_0x6ffd('0x36')][_0x6ffd('0x17')]({'plain':!![]});if(!_0x98bf46)throw new Error(_0x6ffd('0x37'));if(_0x98bf46[_0x6ffd('0x38')]==='user'){var _0x32d62b=_0x2a7278[_0x6ffd('0x17')]({'plain':!![]});var _0x173e2a=_0x6ffd('0x18');return db['UserProfileSection'][_0x6ffd('0x33')]({'where':{'name':_0x173e2a,'userProfileId':_0x98bf46['userProfileId']},'raw':!![]})[_0x6ffd('0x16')](function(_0x13b409){if(_0x13b409&&_0x13b409[_0x6ffd('0x39')]===0x0){return db['UserProfileResource'][_0x6ffd('0x34')]({'name':_0x32d62b[_0x6ffd('0x1b')],'resourceId':_0x32d62b['id'],'type':_0x13b409[_0x6ffd('0x1b')],'sectionId':_0x13b409['id']},{})[_0x6ffd('0x16')](function(){return _0x2a7278;});}else{return _0x2a7278;}})[_0x6ffd('0x28')](function(_0x2894f5){logger[_0x6ffd('0x3a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2894f5);throw _0x2894f5;});}return _0x2a7278;})['then'](respondWithResult(_0x23fae4,0xc9))['catch'](handleError(_0x23fae4,null));};exports[_0x6ffd('0x15')]=function(_0x162259,_0x51ae8d){if(_0x162259[_0x6ffd('0x35')]['id']){delete _0x162259[_0x6ffd('0x35')]['id'];}return db[_0x6ffd('0x25')][_0x6ffd('0x33')]({'where':{'id':_0x162259['params']['id']}})[_0x6ffd('0x16')](handleEntityNotFound(_0x51ae8d,null))[_0x6ffd('0x16')](saveUpdates(_0x162259[_0x6ffd('0x35')],null))[_0x6ffd('0x16')](respondWithResult(_0x51ae8d,null))[_0x6ffd('0x28')](handleError(_0x51ae8d,null));};exports[_0x6ffd('0x3b')]=function(_0x2759cc,_0x24d1fb){return db[_0x6ffd('0x25')][_0x6ffd('0x33')]({'where':{'id':_0x2759cc[_0x6ffd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x24d1fb,null))['then'](removeEntity(_0x24d1fb,null))['catch'](handleError(_0x24d1fb,null));};exports[_0x6ffd('0x3d')]=function(_0x36cdf4,_0x5dc5d2){return db[_0x6ffd('0x25')][_0x6ffd('0x3d')]()[_0x6ffd('0x16')](respondWithResult(_0x5dc5d2,null))[_0x6ffd('0x28')](handleError(_0x5dc5d2,null));};exports[_0x6ffd('0x3e')]=function(_0x57e547,_0x376864){var _0x28e9a1={'raw':!![],'where':{}},_0x45f4aa={},_0x495a8d;return db[_0x6ffd('0x25')][_0x6ffd('0x3f')]({'where':{'id':_0x57e547[_0x6ffd('0x3c')]['id']}})[_0x6ffd('0x16')](handleEntityNotFound(_0x376864,null))[_0x6ffd('0x16')](function(_0x19bc25){if(_0x19bc25){_0x495a8d=_0x19bc25['get']({'plain':!![]});_0x45f4aa[_0x6ffd('0x2d')]=_[_0x6ffd('0x2a')](db[_0x6ffd('0x40')][_0x6ffd('0x1f')]);_0x45f4aa[_0x6ffd('0x24')]=_[_0x6ffd('0x2a')](_0x57e547[_0x6ffd('0x24')]);_0x45f4aa['filters']=_[_0x6ffd('0x2c')](_0x45f4aa[_0x6ffd('0x2d')],_0x45f4aa['query']);_0x28e9a1['attributes']=_['intersection'](_0x45f4aa[_0x6ffd('0x2d')],qs['fields'](_0x57e547[_0x6ffd('0x24')][_0x6ffd('0x2f')]));_0x28e9a1[_0x6ffd('0x2e')]=_0x28e9a1[_0x6ffd('0x2e')]['length']?_0x28e9a1[_0x6ffd('0x2e')]:_0x45f4aa[_0x6ffd('0x2d')];if(!_0x57e547[_0x6ffd('0x24')]['hasOwnProperty'](_0x6ffd('0x41'))){_0x28e9a1[_0x6ffd('0x11')]=qs['limit'](_0x57e547['query'][_0x6ffd('0x11')]);_0x28e9a1[_0x6ffd('0x12')]=qs[_0x6ffd('0x12')](_0x57e547[_0x6ffd('0x24')][_0x6ffd('0x12')]);}_0x28e9a1[_0x6ffd('0x42')]=qs[_0x6ffd('0x43')](_0x57e547['query'][_0x6ffd('0x43')]);_0x28e9a1[_0x6ffd('0x44')]=qs[_0x6ffd('0x2b')](_['pick'](_0x57e547['query'],_0x45f4aa[_0x6ffd('0x2b')]));_0x28e9a1[_0x6ffd('0x44')][_0x6ffd('0x45')]=_0x19bc25['id'];if(_0x57e547[_0x6ffd('0x24')]['filter']){_0x28e9a1[_0x6ffd('0x44')]=_[_0x6ffd('0x31')](_0x28e9a1[_0x6ffd('0x44')],{'$or':_[_0x6ffd('0x1e')](_0x28e9a1[_0x6ffd('0x2e')],function(_0x2a12f8){var _0x4ca29b={};_0x4ca29b[_0x2a12f8]={'$like':'%'+_0x57e547[_0x6ffd('0x24')][_0x6ffd('0x46')]+'%'};return _0x4ca29b;})});}_0x28e9a1=_[_0x6ffd('0x31')]({},_0x28e9a1,_0x57e547[_0x6ffd('0x32')]);return db[_0x6ffd('0x40')]['findAll'](_0x28e9a1);}})[_0x6ffd('0x16')](function(_0x3fea35){if(_0x3fea35){return db[_0x6ffd('0x47')][_0x6ffd('0x48')]({'where':{'id':_[_0x6ffd('0x1e')](_0x3fea35,'UserId'),'role':_0x6ffd('0x49')},'attributes':['id',_0x6ffd('0x1b'),_0x6ffd('0x4a'),'updatedAt',_0x6ffd('0x4b')]});}})[_0x6ffd('0x16')](function(_0x5284d5){if(_0x5284d5){return{'count':_0x5284d5[_0x6ffd('0x22')],'rows':_['map'](_0x5284d5[_0x6ffd('0x27')],function(_0x4352ea){return{'membername':_0x4352ea['name'],'UserId':_0x4352ea['id'],'queue_name':_0x495a8d[_0x6ffd('0x1b')],'FaxQueueId':_0x495a8d['id'],'interface':util['format'](_0x6ffd('0x4c'),_0x6ffd('0x4d'),_0x4352ea[_0x6ffd('0x1b')]),'penalty':0x0,'paused':_0x4352ea[_0x6ffd('0x4a')],'createdAt':_0x4352ea[_0x6ffd('0x4b')],'updatedAt':_0x4352ea['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ffd('0x16')](respondWithFilteredResult(_0x376864,_0x28e9a1))[_0x6ffd('0x28')](handleError(_0x376864,null));};exports[_0x6ffd('0x4e')]=function(_0x34d94f,_0x4b34cf){var _0x38a627={};var _0x183ac7={};var _0x46f9bc;var _0x4e1198;return db[_0x6ffd('0x25')]['findOne']({'where':{'id':_0x34d94f[_0x6ffd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4b34cf,null))[_0x6ffd('0x16')](function(_0x18ffe9){if(_0x18ffe9){_0x46f9bc=_0x18ffe9;_0x183ac7[_0x6ffd('0x2d')]=_[_0x6ffd('0x2a')](db['Team'][_0x6ffd('0x1f')]);_0x183ac7[_0x6ffd('0x24')]=_[_0x6ffd('0x2a')](_0x34d94f[_0x6ffd('0x24')]);_0x183ac7[_0x6ffd('0x2b')]=_[_0x6ffd('0x2c')](_0x183ac7[_0x6ffd('0x2d')],_0x183ac7[_0x6ffd('0x24')]);_0x38a627[_0x6ffd('0x2e')]=_[_0x6ffd('0x2c')](_0x183ac7[_0x6ffd('0x2d')],qs[_0x6ffd('0x2f')](_0x34d94f[_0x6ffd('0x24')][_0x6ffd('0x2f')]));_0x38a627[_0x6ffd('0x2e')]=_0x38a627[_0x6ffd('0x2e')][_0x6ffd('0x4f')]?_0x38a627[_0x6ffd('0x2e')]:_0x183ac7[_0x6ffd('0x2d')];_0x38a627[_0x6ffd('0x42')]=qs[_0x6ffd('0x43')](_0x34d94f[_0x6ffd('0x24')][_0x6ffd('0x43')]);_0x38a627[_0x6ffd('0x44')]=qs[_0x6ffd('0x2b')](_['pick'](_0x34d94f[_0x6ffd('0x24')],_0x183ac7['filters']));if(_0x34d94f[_0x6ffd('0x24')][_0x6ffd('0x46')]){_0x38a627[_0x6ffd('0x44')]=_[_0x6ffd('0x31')](_0x38a627[_0x6ffd('0x44')],{'$or':_[_0x6ffd('0x1e')](_0x38a627[_0x6ffd('0x2e')],function(_0x5badb2){var _0x2022ed={};_0x2022ed[_0x5badb2]={'$like':'%'+_0x34d94f[_0x6ffd('0x24')][_0x6ffd('0x46')]+'%'};return _0x2022ed;})});}_0x38a627=_[_0x6ffd('0x31')]({},_0x38a627,_0x34d94f[_0x6ffd('0x32')]);return _0x46f9bc[_0x6ffd('0x4e')](_0x38a627);}})[_0x6ffd('0x16')](function(_0x43b6b1){if(_0x43b6b1){_0x4e1198=_0x43b6b1[_0x6ffd('0x4f')];if(!_0x34d94f[_0x6ffd('0x24')]['hasOwnProperty'](_0x6ffd('0x41'))){_0x38a627[_0x6ffd('0x11')]=qs[_0x6ffd('0x11')](_0x34d94f[_0x6ffd('0x24')][_0x6ffd('0x11')]);_0x38a627[_0x6ffd('0x12')]=qs['offset'](_0x34d94f['query'][_0x6ffd('0x12')]);}return _0x46f9bc[_0x6ffd('0x4e')](_0x38a627);}})['then'](function(_0x444470){if(_0x444470){return _0x444470?{'count':_0x4e1198,'rows':_0x444470}:null;}})['then'](respondWithResult(_0x4b34cf,null))[_0x6ffd('0x28')](handleError(_0x4b34cf,null));};exports['addTeams']=function(_0x272e61,_0x41b939){var _0x4b50ac=_0x272e61[_0x6ffd('0x35')]['ids'];return db[_0x6ffd('0x50')][_0x6ffd('0x26')]({'where':{'id':_0x4b50ac},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6ffd('0x51'),'attributes':['id',_0x6ffd('0x1b'),_0x6ffd('0x52'),'voicePause',_0x6ffd('0x53')],'raw':!![]}]})[_0x6ffd('0x16')](function(_0x251fc4){if(_0x251fc4){var _0x418b48=_[_0x6ffd('0x54')](_0x251fc4,function(_0x14bd26){var _0x7d4b5e=_0x14bd26[_0x6ffd('0x17')]({'plain':!![]});return _0x7d4b5e['Agents'];});return db[_0x6ffd('0x25')][_0x6ffd('0x33')]({'where':{'id':_0x272e61['params']['id']}})['then'](function(_0x4eaa9f){return db[_0x6ffd('0x55')][_0x6ffd('0x56')](function(_0x2d13c2){return _0x4eaa9f[_0x6ffd('0x57')](_0x4b50ac,{'transaction':_0x2d13c2})[_0x6ffd('0x16')](function(){return BPromise[_0x6ffd('0x58')](_0x418b48,function(_0x3fbc2b){return db[_0x6ffd('0x40')]['findOrCreate']({'where':{'UserId':_0x3fbc2b['id'],'FaxQueueId':_0x272e61[_0x6ffd('0x3c')]['id']},'transaction':_0x2d13c2});});})[_0x6ffd('0x16')](function(){_0x418b48['forEach'](function(_0x134dc3){socket[_0x6ffd('0x59')](_0x6ffd('0x5a'),{'UserId':_0x134dc3['id'],'FaxQueueId':_0x4eaa9f['id']});});});});});}})[_0x6ffd('0x16')](respondWithStatusCode(_0x41b939,null))['catch'](handleError(_0x41b939,null));};exports['removeTeams']=function(_0x3084f9,_0x53cece){return db['Team'][_0x6ffd('0x26')]({'where':{'id':_0x3084f9[_0x6ffd('0x24')][_0x6ffd('0x5b')]},'attributes':['id'],'include':[{'model':db[_0x6ffd('0x47')],'as':_0x6ffd('0x51'),'attributes':['id'],'raw':!![]}]})[_0x6ffd('0x16')](handleEntityNotFound(_0x53cece,null))[_0x6ffd('0x16')](function(_0xe63fdc){var _0x10b35e=_[_0x6ffd('0x1e')](_0xe63fdc,'id');var _0x175c7e=[];var _0x298891=[];var _0x48db89=squel['select']();_0x48db89[_0x6ffd('0x5c')](_0x6ffd('0x5d'))[_0x6ffd('0x5e')](_0x6ffd('0x5f'),'tq')[_0x6ffd('0x60')]('user_has_teams','ut',_0x6ffd('0x61'))[_0x6ffd('0x44')](_0x6ffd('0x62'),_0x3084f9[_0x6ffd('0x3c')]['id']);for(var _0x58e1e4=0x0;_0x58e1e4<_0xe63fdc[_0x6ffd('0x4f')];_0x58e1e4+=0x1){let _0x1f2869=_0xe63fdc[_0x58e1e4];for(var _0x5a45c2=0x0;_0x5a45c2<_0x1f2869[_0x6ffd('0x51')][_0x6ffd('0x4f')];_0x5a45c2+=0x1){let _0x205396=_0x1f2869[_0x6ffd('0x51')][_0x5a45c2];var _0x113af0=_0x48db89[_0x6ffd('0x63')]();_0x113af0['where'](_0x6ffd('0x64'),_0x205396['id']);_0x298891['push'](db['sequelize'][_0x6ffd('0x24')](_0x113af0[_0x6ffd('0x65')](),{'type':db['sequelize'][_0x6ffd('0x66')][_0x6ffd('0x67')]})[_0x6ffd('0x16')](function(_0xb30598){if(_0xb30598[_0x6ffd('0x4f')]===0x1){return _0x205396['id'];}else{var _0x39e2fc=_[_0x6ffd('0x68')](_[_0x6ffd('0x1e')](_0xb30598,_0x6ffd('0x69')),function(_0x1fa2d6){return _[_0x6ffd('0x6a')](_0x10b35e,_0x1fa2d6);});if(_0x39e2fc){return _0x205396['id'];}}}));}}return BPromise['all'](_0x298891)[_0x6ffd('0x16')](function(_0x153f2d){_0x175c7e=_(_0x175c7e)['union'](_0x153f2d)[_0x6ffd('0x6b')]()[_0x6ffd('0x6c')]();return db[_0x6ffd('0x25')][_0x6ffd('0x33')]({'where':{'id':_0x3084f9['params']['id']}})[_0x6ffd('0x16')](function(_0x1edbf8){return db['sequelize'][_0x6ffd('0x56')](function(_0x2adc61){return _0x1edbf8['removeTeams'](_0x3084f9['query'][_0x6ffd('0x5b')],{'transaction':_0x2adc61})[_0x6ffd('0x16')](function(){if(!_['isEmpty'](_0x175c7e)){return _0x1edbf8[_0x6ffd('0x6d')](_0x175c7e,{'transaction':_0x2adc61});}})['then'](function(){_0x175c7e['forEach'](function(_0x1ab496){socket[_0x6ffd('0x59')]('userFaxQueue:remove',{'UserId':_0x1ab496,'FaxQueueId':_0x1edbf8['id']});});});});});});})['then'](respondWithStatusCode(_0x53cece,null))['catch'](handleError(_0x53cece,null));};exports[_0x6ffd('0x6e')]=function(_0x256aa2,_0x1f856f){return db['FaxQueue'][_0x6ffd('0x33')]({'where':{'id':_0x256aa2[_0x6ffd('0x3c')]['id']}})[_0x6ffd('0x16')](handleEntityNotFound(_0x1f856f,null))[_0x6ffd('0x16')](function(_0x3d5e90){if(_0x3d5e90){return _0x3d5e90['addAgents'](_0x256aa2[_0x6ffd('0x35')][_0x6ffd('0x5b')],_['omit'](_0x256aa2['body'],[_0x6ffd('0x5b'),'id'])||{})[_0x6ffd('0x6f')](function(_0x19915c){for(var _0x558b5a=0x0;_0x558b5a<_0x256aa2['body'][_0x6ffd('0x5b')][_0x6ffd('0x4f')];_0x558b5a+=0x1){socket['emit'](_0x6ffd('0x5a'),{'UserId':Number(_0x256aa2[_0x6ffd('0x35')][_0x6ffd('0x5b')][_0x558b5a]),'FaxQueueId':Number(_0x256aa2['params']['id'])});}return _0x19915c;});}})[_0x6ffd('0x16')](respondWithResult(_0x1f856f,null))[_0x6ffd('0x28')](handleError(_0x1f856f,null));};exports[_0x6ffd('0x6d')]=function(_0x23a188,_0x2a854b){return db[_0x6ffd('0x25')][_0x6ffd('0x33')]({'where':{'id':_0x23a188['params']['id']}})[_0x6ffd('0x16')](handleEntityNotFound(_0x2a854b,null))[_0x6ffd('0x16')](function(_0x43b2ae){if(_0x43b2ae){return _0x43b2ae['removeAgents'](_0x23a188[_0x6ffd('0x24')]['ids'])[_0x6ffd('0x16')](function(){if(_[_0x6ffd('0x70')](_0x23a188[_0x6ffd('0x24')][_0x6ffd('0x5b')])){for(var _0x395401=0x0;_0x395401<_0x23a188[_0x6ffd('0x24')]['ids'][_0x6ffd('0x4f')];_0x395401+=0x1){socket[_0x6ffd('0x59')](_0x6ffd('0x71'),{'UserId':Number(_0x23a188[_0x6ffd('0x24')][_0x6ffd('0x5b')][_0x395401]),'FaxQueueId':Number(_0x23a188[_0x6ffd('0x3c')]['id'])});}}else{socket['emit'](_0x6ffd('0x71'),{'UserId':Number(_0x23a188[_0x6ffd('0x24')][_0x6ffd('0x5b')]),'FaxQueueId':Number(_0x23a188[_0x6ffd('0x3c')]['id'])});}});}})[_0x6ffd('0x16')](respondWithStatusCode(_0x2a854b,null))[_0x6ffd('0x28')](handleError(_0x2a854b,null));};exports['getAgents']=function(_0x4c065a,_0x263ee1){var _0x2f447f={};var _0x4ace14={};var _0xc88cb2;var _0x55a00d;return db[_0x6ffd('0x25')]['findOne']({'where':{'id':_0x4c065a[_0x6ffd('0x3c')]['id']}})[_0x6ffd('0x16')](handleEntityNotFound(_0x263ee1,null))['then'](function(_0x2a0e56){if(_0x2a0e56){_0xc88cb2=_0x2a0e56;_0x4ace14[_0x6ffd('0x2d')]=_['keys'](db['User'][_0x6ffd('0x1f')]);_0x4ace14['query']=_[_0x6ffd('0x2a')](_0x4c065a['query']);_0x4ace14['filters']=_[_0x6ffd('0x2c')](_0x4ace14['model'],_0x4ace14[_0x6ffd('0x24')]);_0x2f447f[_0x6ffd('0x2e')]=_[_0x6ffd('0x2c')](_0x4ace14[_0x6ffd('0x2d')],qs[_0x6ffd('0x2f')](_0x4c065a[_0x6ffd('0x24')][_0x6ffd('0x2f')]));_0x2f447f[_0x6ffd('0x2e')]=_0x2f447f[_0x6ffd('0x2e')]['length']?_0x2f447f[_0x6ffd('0x2e')]:_0x4ace14[_0x6ffd('0x2d')];_0x2f447f[_0x6ffd('0x42')]=qs[_0x6ffd('0x43')](_0x4c065a['query']['sort']);_0x2f447f[_0x6ffd('0x44')]=qs[_0x6ffd('0x2b')](_[_0x6ffd('0x72')](_0x4c065a['query'],_0x4ace14['filters']));if(_0x4c065a[_0x6ffd('0x24')][_0x6ffd('0x46')]){_0x2f447f[_0x6ffd('0x44')]=_[_0x6ffd('0x31')](_0x2f447f[_0x6ffd('0x44')],{'$or':_[_0x6ffd('0x1e')](_0x2f447f[_0x6ffd('0x2e')],function(_0x3c0377){var _0x6e5421={};_0x6e5421[_0x3c0377]={'$like':'%'+_0x4c065a[_0x6ffd('0x24')][_0x6ffd('0x46')]+'%'};return _0x6e5421;})});}_0x2f447f=_[_0x6ffd('0x31')]({},_0x2f447f,_0x4c065a[_0x6ffd('0x32')]);return _0xc88cb2[_0x6ffd('0x73')](_0x2f447f);}})['then'](function(_0x4ac278){if(_0x4ac278){_0x55a00d=_0x4ac278[_0x6ffd('0x4f')];if(!_0x4c065a[_0x6ffd('0x24')][_0x6ffd('0x74')](_0x6ffd('0x41'))){_0x2f447f[_0x6ffd('0x11')]=qs[_0x6ffd('0x11')](_0x4c065a['query'][_0x6ffd('0x11')]);_0x2f447f[_0x6ffd('0x12')]=qs[_0x6ffd('0x12')](_0x4c065a[_0x6ffd('0x24')][_0x6ffd('0x12')]);}return _0xc88cb2['getAgents'](_0x2f447f);}})[_0x6ffd('0x16')](function(_0x4414bc){if(_0x4414bc){return _0x4414bc?{'count':_0x55a00d,'rows':_0x4414bc}:null;}})['then'](respondWithResult(_0x263ee1,null))['catch'](handleError(_0x263ee1,null));}; \ No newline at end of file +var _0xda19=['name','send','index','map','rawAttributes','key','getOptions','where','include','query','findAll','rows','catch','show','params','FaxQueue','keys','intersection','model','attributes','includeAll','merge','options','create','body','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','filters','fields','length','offset','order','sort','FaxQueueId','filter','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','SIP','getTeams','pick','nolimit','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','util','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack'];(function(_0x554af0,_0x3769a1){var _0x34d939=function(_0x69694f){while(--_0x69694f){_0x554af0['push'](_0x554af0['shift']());}};_0x34d939(++_0x3769a1);}(_0xda19,0xd5));var _0x9da1=function(_0x507436,_0x445faa){_0x507436=_0x507436-0x0;var _0x43b784=_0xda19[_0x507436];return _0x43b784;};'use strict';var BPromise=require('bluebird');var util=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));var squel=require('squel');var Redis=require(_0x9da1('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x9da1('0x3'))('api');var config=require(_0x9da1('0x4'));var db=require(_0x9da1('0x5'))['db'];config[_0x9da1('0x6')]=_[_0x9da1('0x7')](config[_0x9da1('0x6')],{'host':_0x9da1('0x8'),'port':0x18eb});var socket=require(_0x9da1('0x9'))(new Redis(config[_0x9da1('0x6')]));require(_0x9da1('0xa'))[_0x9da1('0xb')](socket);function respondWithStatusCode(_0x47df89,_0x55f66b){_0x55f66b=_0x55f66b||0xcc;return function(_0x4cb9f7){if(_0x4cb9f7){return _0x47df89[_0x9da1('0xc')](_0x55f66b);}return _0x47df89['status'](_0x55f66b)[_0x9da1('0xd')]();};}function respondWithResult(_0x1cca84,_0x3ba3d3){_0x3ba3d3=_0x3ba3d3||0xc8;return function(_0x1ab988){if(_0x1ab988){return _0x1cca84[_0x9da1('0xe')](_0x3ba3d3)[_0x9da1('0xf')](_0x1ab988);}};}function respondWithFilteredResult(_0x9fd032,_0x5807ec){return function(_0x51bc88){if(_0x51bc88){var _0x3114f7=typeof _0x5807ec['offset']===_0x9da1('0x10')&&typeof _0x5807ec[_0x9da1('0x11')]===_0x9da1('0x10');var _0x1ffa2a=_0x51bc88['count'];var _0x2837e3=_0x3114f7?0x0:_0x5807ec['offset'];var _0x4d17e1=_0x3114f7?_0x51bc88[_0x9da1('0x12')]:_0x5807ec['offset']+_0x5807ec[_0x9da1('0x11')];var _0x43c093;if(_0x4d17e1>=_0x1ffa2a){_0x4d17e1=_0x1ffa2a;_0x43c093=0xc8;}else{_0x43c093=0xce;}_0x9fd032[_0x9da1('0xe')](_0x43c093);return _0x9fd032[_0x9da1('0x13')](_0x9da1('0x14'),_0x2837e3+'-'+_0x4d17e1+'/'+_0x1ffa2a)['json'](_0x51bc88);}return null;};}function saveUpdates(_0x16f75a){return function(_0x116a76){if(_0x116a76){return _0x116a76[_0x9da1('0x15')](_0x16f75a)[_0x9da1('0x16')](function(_0xfb278d){return _0xfb278d;});}return null;};}function removeEntity(_0x42a9c7){return function(_0x497676){if(_0x497676){return _0x497676['destroy']()[_0x9da1('0x16')](function(){var _0x8da712=_0x497676[_0x9da1('0x17')]({'plain':!![]});var _0x41e555=_0x9da1('0x18');return db[_0x9da1('0x19')][_0x9da1('0x1a')]({'where':{'type':_0x41e555,'resourceId':_0x8da712['id']}})['then'](function(){return _0x497676;});})[_0x9da1('0x16')](function(){_0x42a9c7[_0x9da1('0xe')](0xcc)[_0x9da1('0xd')]();});}};}function handleEntityNotFound(_0xacba30){return function(_0x1fc065){if(!_0x1fc065){_0xacba30['sendStatus'](0x194);}return _0x1fc065;};}function handleError(_0x5454d3,_0x14793b){_0x14793b=_0x14793b||0x1f4;return function(_0x3e6f85){logger[_0x9da1('0x1b')](_0x3e6f85[_0x9da1('0x1c')]);if(_0x3e6f85[_0x9da1('0x1d')]){delete _0x3e6f85[_0x9da1('0x1d')];}_0x5454d3['status'](_0x14793b)[_0x9da1('0x1e')](_0x3e6f85);};}exports[_0x9da1('0x1f')]=function(_0x4fd25a,_0x45fcce){var _0x3f5680={};var _0x534210={'count':0x0,'rows':[]};var _0x2fd49c=_[_0x9da1('0x20')](db['FaxQueue'][_0x9da1('0x21')],function(_0x1d6af5){return{'name':_0x1d6af5['fieldName'],'type':_0x1d6af5['type'][_0x9da1('0x22')]};});_0x3f5680=qs[_0x9da1('0x23')](_0x2fd49c,_0x4fd25a);var _0x5eca5b={'where':_0x3f5680[_0x9da1('0x24')]};return db['FaxQueue']['count'](_0x5eca5b)['then'](function(_0x31b826){_0x534210[_0x9da1('0x12')]=_0x31b826;_0x3f5680[_0x9da1('0x25')]=qs[_0x9da1('0x25')](_0x4fd25a[_0x9da1('0x26')]);return db['FaxQueue'][_0x9da1('0x27')](_0x3f5680);})['then'](function(_0x1feae0){_0x534210[_0x9da1('0x28')]=_0x1feae0;return _0x534210;})['then'](respondWithFilteredResult(_0x45fcce,_0x3f5680))[_0x9da1('0x29')](handleError(_0x45fcce,null));};exports[_0x9da1('0x2a')]=function(_0x4f318b,_0x1a0771){var _0x3fe97a={'raw':!![],'where':{'id':_0x4f318b[_0x9da1('0x2b')]['id']}},_0x1802e0={};_0x1802e0['model']=_['keys'](db[_0x9da1('0x2c')][_0x9da1('0x21')]);_0x1802e0[_0x9da1('0x26')]=_[_0x9da1('0x2d')](_0x4f318b[_0x9da1('0x26')]);_0x1802e0['filters']=_[_0x9da1('0x2e')](_0x1802e0[_0x9da1('0x2f')],_0x1802e0[_0x9da1('0x26')]);_0x3fe97a[_0x9da1('0x30')]=_[_0x9da1('0x2e')](_0x1802e0[_0x9da1('0x2f')],qs['fields'](_0x4f318b[_0x9da1('0x26')]['fields']));_0x3fe97a['attributes']=_0x3fe97a[_0x9da1('0x30')]['length']?_0x3fe97a[_0x9da1('0x30')]:_0x1802e0[_0x9da1('0x2f')];if(_0x4f318b[_0x9da1('0x26')][_0x9da1('0x31')]){_0x3fe97a[_0x9da1('0x25')]=[{'all':!![]}];}_0x3fe97a=_[_0x9da1('0x32')]({},_0x3fe97a,_0x4f318b[_0x9da1('0x33')]);return db[_0x9da1('0x2c')]['find'](_0x3fe97a)[_0x9da1('0x16')](handleEntityNotFound(_0x1a0771,null))['then'](respondWithResult(_0x1a0771,null))[_0x9da1('0x29')](handleError(_0x1a0771,null));};exports['create']=function(_0x5eaa7e,_0x1ce0f8){return db['FaxQueue'][_0x9da1('0x34')](_0x5eaa7e[_0x9da1('0x35')],{})['then'](function(_0x38242c){var _0x1b750f=_0x5eaa7e[_0x9da1('0x36')][_0x9da1('0x17')]({'plain':!![]});if(!_0x1b750f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b750f[_0x9da1('0x37')]==='user'){var _0x2bb9e4=_0x38242c['get']({'plain':!![]});var _0x26e8d3=_0x9da1('0x18');return db['UserProfileSection'][_0x9da1('0x38')]({'where':{'name':_0x26e8d3,'userProfileId':_0x1b750f[_0x9da1('0x39')]},'raw':!![]})[_0x9da1('0x16')](function(_0x4e9af3){if(_0x4e9af3&&_0x4e9af3['autoAssociation']===0x0){return db['UserProfileResource'][_0x9da1('0x34')]({'name':_0x2bb9e4['name'],'resourceId':_0x2bb9e4['id'],'type':_0x4e9af3[_0x9da1('0x1d')],'sectionId':_0x4e9af3['id']},{})[_0x9da1('0x16')](function(){return _0x38242c;});}else{return _0x38242c;}})[_0x9da1('0x29')](function(_0x43c064){logger['error'](_0x9da1('0x3a'),_0x43c064);throw _0x43c064;});}return _0x38242c;})[_0x9da1('0x16')](respondWithResult(_0x1ce0f8,0xc9))[_0x9da1('0x29')](handleError(_0x1ce0f8,null));};exports[_0x9da1('0x15')]=function(_0x28fc88,_0x26c225){if(_0x28fc88[_0x9da1('0x35')]['id']){delete _0x28fc88['body']['id'];}return db[_0x9da1('0x2c')]['find']({'where':{'id':_0x28fc88[_0x9da1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x26c225,null))[_0x9da1('0x16')](saveUpdates(_0x28fc88[_0x9da1('0x35')],null))['then'](respondWithResult(_0x26c225,null))[_0x9da1('0x29')](handleError(_0x26c225,null));};exports[_0x9da1('0x1a')]=function(_0x4ea83c,_0x1a193b){return db['FaxQueue'][_0x9da1('0x38')]({'where':{'id':_0x4ea83c[_0x9da1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1a193b,null))['then'](removeEntity(_0x1a193b,null))[_0x9da1('0x29')](handleError(_0x1a193b,null));};exports[_0x9da1('0x3b')]=function(_0x15bb24,_0x40f514){return db[_0x9da1('0x2c')][_0x9da1('0x3b')]()[_0x9da1('0x16')](respondWithResult(_0x40f514,null))[_0x9da1('0x29')](handleError(_0x40f514,null));};exports['getMembers']=function(_0xd7fb0a,_0x23b445){var _0x1eebc5={'raw':!![],'where':{}},_0x5cf7ef={},_0xd5b3da;return db[_0x9da1('0x2c')][_0x9da1('0x3c')]({'where':{'id':_0xd7fb0a['params']['id']}})[_0x9da1('0x16')](handleEntityNotFound(_0x23b445,null))[_0x9da1('0x16')](function(_0x28b1b0){if(_0x28b1b0){_0xd5b3da=_0x28b1b0['get']({'plain':!![]});_0x5cf7ef[_0x9da1('0x2f')]=_['keys'](db['UserFaxQueue'][_0x9da1('0x21')]);_0x5cf7ef[_0x9da1('0x26')]=_['keys'](_0xd7fb0a[_0x9da1('0x26')]);_0x5cf7ef[_0x9da1('0x3d')]=_['intersection'](_0x5cf7ef[_0x9da1('0x2f')],_0x5cf7ef[_0x9da1('0x26')]);_0x1eebc5[_0x9da1('0x30')]=_[_0x9da1('0x2e')](_0x5cf7ef[_0x9da1('0x2f')],qs[_0x9da1('0x3e')](_0xd7fb0a[_0x9da1('0x26')][_0x9da1('0x3e')]));_0x1eebc5[_0x9da1('0x30')]=_0x1eebc5['attributes'][_0x9da1('0x3f')]?_0x1eebc5[_0x9da1('0x30')]:_0x5cf7ef[_0x9da1('0x2f')];if(!_0xd7fb0a[_0x9da1('0x26')]['hasOwnProperty']('nolimit')){_0x1eebc5[_0x9da1('0x11')]=qs[_0x9da1('0x11')](_0xd7fb0a[_0x9da1('0x26')][_0x9da1('0x11')]);_0x1eebc5[_0x9da1('0x40')]=qs[_0x9da1('0x40')](_0xd7fb0a[_0x9da1('0x26')][_0x9da1('0x40')]);}_0x1eebc5[_0x9da1('0x41')]=qs[_0x9da1('0x42')](_0xd7fb0a[_0x9da1('0x26')][_0x9da1('0x42')]);_0x1eebc5[_0x9da1('0x24')]=qs[_0x9da1('0x3d')](_['pick'](_0xd7fb0a[_0x9da1('0x26')],_0x5cf7ef[_0x9da1('0x3d')]));_0x1eebc5['where'][_0x9da1('0x43')]=_0x28b1b0['id'];if(_0xd7fb0a['query'][_0x9da1('0x44')]){_0x1eebc5['where']=_[_0x9da1('0x32')](_0x1eebc5[_0x9da1('0x24')],{'$or':_[_0x9da1('0x20')](_0x1eebc5[_0x9da1('0x30')],function(_0x32d131){var _0x2cb7a4={};_0x2cb7a4[_0x32d131]={'$like':'%'+_0xd7fb0a[_0x9da1('0x26')][_0x9da1('0x44')]+'%'};return _0x2cb7a4;})});}_0x1eebc5=_[_0x9da1('0x32')]({},_0x1eebc5,_0xd7fb0a[_0x9da1('0x33')]);return db['UserFaxQueue'][_0x9da1('0x27')](_0x1eebc5);}})[_0x9da1('0x16')](function(_0x2e5aae){if(_0x2e5aae){return db[_0x9da1('0x45')][_0x9da1('0x46')]({'where':{'id':_[_0x9da1('0x20')](_0x2e5aae,_0x9da1('0x47')),'role':_0x9da1('0x48')},'attributes':['id',_0x9da1('0x1d'),_0x9da1('0x49'),'updatedAt',_0x9da1('0x4a')]});}})[_0x9da1('0x16')](function(_0x5bda2a){if(_0x5bda2a){return{'count':_0x5bda2a[_0x9da1('0x12')],'rows':_[_0x9da1('0x20')](_0x5bda2a[_0x9da1('0x28')],function(_0x1bd260){return{'membername':_0x1bd260[_0x9da1('0x1d')],'UserId':_0x1bd260['id'],'queue_name':_0xd5b3da[_0x9da1('0x1d')],'FaxQueueId':_0xd5b3da['id'],'interface':util[_0x9da1('0x4b')]('%s/%s',_0x9da1('0x4c'),_0x1bd260[_0x9da1('0x1d')]),'penalty':0x0,'paused':_0x1bd260[_0x9da1('0x49')],'createdAt':_0x1bd260[_0x9da1('0x4a')],'updatedAt':_0x1bd260['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9da1('0x16')](respondWithFilteredResult(_0x23b445,_0x1eebc5))['catch'](handleError(_0x23b445,null));};exports[_0x9da1('0x4d')]=function(_0x10ebc9,_0x15bb3a){var _0x432c8b={};var _0x464c41={};var _0x4445e2;var _0x5e262c;return db['FaxQueue'][_0x9da1('0x3c')]({'where':{'id':_0x10ebc9['params']['id']}})['then'](handleEntityNotFound(_0x15bb3a,null))['then'](function(_0x6f86c3){if(_0x6f86c3){_0x4445e2=_0x6f86c3;_0x464c41['model']=_[_0x9da1('0x2d')](db['Team'][_0x9da1('0x21')]);_0x464c41[_0x9da1('0x26')]=_['keys'](_0x10ebc9[_0x9da1('0x26')]);_0x464c41[_0x9da1('0x3d')]=_['intersection'](_0x464c41[_0x9da1('0x2f')],_0x464c41[_0x9da1('0x26')]);_0x432c8b['attributes']=_['intersection'](_0x464c41[_0x9da1('0x2f')],qs[_0x9da1('0x3e')](_0x10ebc9[_0x9da1('0x26')][_0x9da1('0x3e')]));_0x432c8b[_0x9da1('0x30')]=_0x432c8b[_0x9da1('0x30')]['length']?_0x432c8b[_0x9da1('0x30')]:_0x464c41['model'];_0x432c8b['order']=qs[_0x9da1('0x42')](_0x10ebc9[_0x9da1('0x26')][_0x9da1('0x42')]);_0x432c8b[_0x9da1('0x24')]=qs[_0x9da1('0x3d')](_[_0x9da1('0x4e')](_0x10ebc9[_0x9da1('0x26')],_0x464c41[_0x9da1('0x3d')]));if(_0x10ebc9[_0x9da1('0x26')]['filter']){_0x432c8b[_0x9da1('0x24')]=_[_0x9da1('0x32')](_0x432c8b[_0x9da1('0x24')],{'$or':_[_0x9da1('0x20')](_0x432c8b[_0x9da1('0x30')],function(_0x491fcb){var _0x1a934c={};_0x1a934c[_0x491fcb]={'$like':'%'+_0x10ebc9[_0x9da1('0x26')][_0x9da1('0x44')]+'%'};return _0x1a934c;})});}_0x432c8b=_[_0x9da1('0x32')]({},_0x432c8b,_0x10ebc9[_0x9da1('0x33')]);return _0x4445e2[_0x9da1('0x4d')](_0x432c8b);}})['then'](function(_0x197e1d){if(_0x197e1d){_0x5e262c=_0x197e1d['length'];if(!_0x10ebc9[_0x9da1('0x26')]['hasOwnProperty'](_0x9da1('0x4f'))){_0x432c8b[_0x9da1('0x11')]=qs[_0x9da1('0x11')](_0x10ebc9[_0x9da1('0x26')]['limit']);_0x432c8b['offset']=qs['offset'](_0x10ebc9[_0x9da1('0x26')][_0x9da1('0x40')]);}return _0x4445e2[_0x9da1('0x4d')](_0x432c8b);}})[_0x9da1('0x16')](function(_0x4aa5f3){if(_0x4aa5f3){return _0x4aa5f3?{'count':_0x5e262c,'rows':_0x4aa5f3}:null;}})['then'](respondWithResult(_0x15bb3a,null))[_0x9da1('0x29')](handleError(_0x15bb3a,null));};exports[_0x9da1('0x50')]=function(_0x3ed43e,_0x5d0e05){var _0x5b3114=_0x3ed43e[_0x9da1('0x35')][_0x9da1('0x51')];return db[_0x9da1('0x52')]['findAll']({'where':{'id':_0x5b3114},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9da1('0x53'),'attributes':['id',_0x9da1('0x1d'),_0x9da1('0x54'),_0x9da1('0x55'),_0x9da1('0x56')],'raw':!![]}]})['then'](function(_0x3dcb6b){if(_0x3dcb6b){var _0x1ea46a=_[_0x9da1('0x57')](_0x3dcb6b,function(_0x1f0369){var _0x4def4c=_0x1f0369[_0x9da1('0x17')]({'plain':!![]});return _0x4def4c[_0x9da1('0x53')];});return db[_0x9da1('0x2c')]['find']({'where':{'id':_0x3ed43e[_0x9da1('0x2b')]['id']}})[_0x9da1('0x16')](function(_0x17f032){return db['sequelize'][_0x9da1('0x58')](function(_0x1eb493){return _0x17f032['addTeams'](_0x5b3114,{'transaction':_0x1eb493})[_0x9da1('0x16')](function(){return BPromise['each'](_0x1ea46a,function(_0x247710){return db['UserFaxQueue'][_0x9da1('0x59')]({'where':{'UserId':_0x247710['id'],'FaxQueueId':_0x3ed43e[_0x9da1('0x2b')]['id']},'transaction':_0x1eb493});});})[_0x9da1('0x16')](function(){_0x1ea46a[_0x9da1('0x5a')](function(_0x3baa47){socket[_0x9da1('0x5b')](_0x9da1('0x5c'),{'UserId':_0x3baa47['id'],'FaxQueueId':_0x17f032['id']});});});});});}})[_0x9da1('0x16')](respondWithStatusCode(_0x5d0e05,null))[_0x9da1('0x29')](handleError(_0x5d0e05,null));};exports[_0x9da1('0x5d')]=function(_0x323cae,_0x2bd73d){return db[_0x9da1('0x52')]['findAll']({'where':{'id':_0x323cae[_0x9da1('0x26')][_0x9da1('0x51')]},'attributes':['id'],'include':[{'model':db[_0x9da1('0x45')],'as':_0x9da1('0x53'),'attributes':['id'],'raw':!![]}]})[_0x9da1('0x16')](handleEntityNotFound(_0x2bd73d,null))['then'](function(_0x1ca102){var _0x2eb5e6=_['map'](_0x1ca102,'id');var _0x4a4cda=[];var _0x84f8d8=[];var _0x2d0e01=squel[_0x9da1('0x5e')]();_0x2d0e01[_0x9da1('0x5f')](_0x9da1('0x60'))[_0x9da1('0x61')](_0x9da1('0x62'),'tq')[_0x9da1('0x63')](_0x9da1('0x64'),'ut',_0x9da1('0x65'))[_0x9da1('0x24')](_0x9da1('0x66'),_0x323cae[_0x9da1('0x2b')]['id']);for(var _0x49a95c=0x0;_0x49a95c<_0x1ca102[_0x9da1('0x3f')];_0x49a95c+=0x1){let _0x3a0a84=_0x1ca102[_0x49a95c];for(var _0x3f9782=0x0;_0x3f9782<_0x3a0a84[_0x9da1('0x53')][_0x9da1('0x3f')];_0x3f9782+=0x1){let _0x5e6b67=_0x3a0a84[_0x9da1('0x53')][_0x3f9782];var _0x354c5a=_0x2d0e01['clone']();_0x354c5a[_0x9da1('0x24')]('ut.UserId\x20=\x20?',_0x5e6b67['id']);_0x84f8d8[_0x9da1('0x67')](db['sequelize'][_0x9da1('0x26')](_0x354c5a[_0x9da1('0x68')](),{'type':db[_0x9da1('0x69')][_0x9da1('0x6a')][_0x9da1('0x6b')]})[_0x9da1('0x16')](function(_0x1f785c){if(_0x1f785c[_0x9da1('0x3f')]===0x1){return _0x5e6b67['id'];}else{var _0x118e26=_[_0x9da1('0x6c')](_[_0x9da1('0x20')](_0x1f785c,_0x9da1('0x6d')),function(_0x5d329c){return _[_0x9da1('0x6e')](_0x2eb5e6,_0x5d329c);});if(_0x118e26){return _0x5e6b67['id'];}}}));}}return BPromise[_0x9da1('0x6f')](_0x84f8d8)[_0x9da1('0x16')](function(_0x4015b9){_0x4a4cda=_(_0x4a4cda)[_0x9da1('0x70')](_0x4015b9)[_0x9da1('0x71')]()['value']();return db['FaxQueue'][_0x9da1('0x38')]({'where':{'id':_0x323cae[_0x9da1('0x2b')]['id']}})[_0x9da1('0x16')](function(_0x4cd85f){return db[_0x9da1('0x69')][_0x9da1('0x58')](function(_0x175b4b){return _0x4cd85f[_0x9da1('0x5d')](_0x323cae[_0x9da1('0x26')][_0x9da1('0x51')],{'transaction':_0x175b4b})[_0x9da1('0x16')](function(){if(!_['isEmpty'](_0x4a4cda)){return _0x4cd85f[_0x9da1('0x72')](_0x4a4cda,{'transaction':_0x175b4b});}})[_0x9da1('0x16')](function(){_0x4a4cda['forEach'](function(_0x56af13){socket[_0x9da1('0x5b')]('userFaxQueue:remove',{'UserId':_0x56af13,'FaxQueueId':_0x4cd85f['id']});});});});});});})['then'](respondWithStatusCode(_0x2bd73d,null))[_0x9da1('0x29')](handleError(_0x2bd73d,null));};exports[_0x9da1('0x73')]=function(_0x3f9010,_0x18ae08){return db[_0x9da1('0x2c')][_0x9da1('0x38')]({'where':{'id':_0x3f9010[_0x9da1('0x2b')]['id']}})[_0x9da1('0x16')](handleEntityNotFound(_0x18ae08,null))['then'](function(_0x5569d5){if(_0x5569d5){return _0x5569d5[_0x9da1('0x73')](_0x3f9010[_0x9da1('0x35')][_0x9da1('0x51')],_[_0x9da1('0x74')](_0x3f9010[_0x9da1('0x35')],[_0x9da1('0x51'),'id'])||{})[_0x9da1('0x75')](function(_0x440e2a){for(var _0x4c9aa5=0x0;_0x4c9aa5<_0x3f9010[_0x9da1('0x35')]['ids'][_0x9da1('0x3f')];_0x4c9aa5+=0x1){socket[_0x9da1('0x5b')](_0x9da1('0x5c'),{'UserId':Number(_0x3f9010[_0x9da1('0x35')][_0x9da1('0x51')][_0x4c9aa5]),'FaxQueueId':Number(_0x3f9010[_0x9da1('0x2b')]['id'])});}return _0x440e2a;});}})[_0x9da1('0x16')](respondWithResult(_0x18ae08,null))['catch'](handleError(_0x18ae08,null));};exports[_0x9da1('0x72')]=function(_0x532686,_0x174d15){return db[_0x9da1('0x2c')][_0x9da1('0x38')]({'where':{'id':_0x532686[_0x9da1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x174d15,null))[_0x9da1('0x16')](function(_0x1f93bf){if(_0x1f93bf){return _0x1f93bf[_0x9da1('0x72')](_0x532686[_0x9da1('0x26')][_0x9da1('0x51')])[_0x9da1('0x16')](function(){if(_[_0x9da1('0x76')](_0x532686[_0x9da1('0x26')][_0x9da1('0x51')])){for(var _0x1faea5=0x0;_0x1faea5<_0x532686[_0x9da1('0x26')][_0x9da1('0x51')][_0x9da1('0x3f')];_0x1faea5+=0x1){socket[_0x9da1('0x5b')]('userFaxQueue:remove',{'UserId':Number(_0x532686[_0x9da1('0x26')]['ids'][_0x1faea5]),'FaxQueueId':Number(_0x532686[_0x9da1('0x2b')]['id'])});}}else{socket['emit'](_0x9da1('0x77'),{'UserId':Number(_0x532686[_0x9da1('0x26')][_0x9da1('0x51')]),'FaxQueueId':Number(_0x532686[_0x9da1('0x2b')]['id'])});}});}})[_0x9da1('0x16')](respondWithStatusCode(_0x174d15,null))[_0x9da1('0x29')](handleError(_0x174d15,null));};exports[_0x9da1('0x78')]=function(_0x25afb2,_0x5e71f5){var _0xe8b0a5={};var _0x1d4552={};var _0x4fe1ff;var _0x329d99;return db[_0x9da1('0x2c')][_0x9da1('0x3c')]({'where':{'id':_0x25afb2['params']['id']}})['then'](handleEntityNotFound(_0x5e71f5,null))['then'](function(_0x1d0ca8){if(_0x1d0ca8){_0x4fe1ff=_0x1d0ca8;_0x1d4552[_0x9da1('0x2f')]=_[_0x9da1('0x2d')](db['User']['rawAttributes']);_0x1d4552[_0x9da1('0x26')]=_[_0x9da1('0x2d')](_0x25afb2['query']);_0x1d4552[_0x9da1('0x3d')]=_['intersection'](_0x1d4552['model'],_0x1d4552['query']);_0xe8b0a5[_0x9da1('0x30')]=_[_0x9da1('0x2e')](_0x1d4552[_0x9da1('0x2f')],qs[_0x9da1('0x3e')](_0x25afb2[_0x9da1('0x26')][_0x9da1('0x3e')]));_0xe8b0a5[_0x9da1('0x30')]=_0xe8b0a5[_0x9da1('0x30')][_0x9da1('0x3f')]?_0xe8b0a5[_0x9da1('0x30')]:_0x1d4552[_0x9da1('0x2f')];_0xe8b0a5['order']=qs['sort'](_0x25afb2['query'][_0x9da1('0x42')]);_0xe8b0a5[_0x9da1('0x24')]=qs['filters'](_[_0x9da1('0x4e')](_0x25afb2[_0x9da1('0x26')],_0x1d4552[_0x9da1('0x3d')]));if(_0x25afb2[_0x9da1('0x26')][_0x9da1('0x44')]){_0xe8b0a5[_0x9da1('0x24')]=_[_0x9da1('0x32')](_0xe8b0a5[_0x9da1('0x24')],{'$or':_['map'](_0xe8b0a5[_0x9da1('0x30')],function(_0x25fd3d){var _0x1eda44={};_0x1eda44[_0x25fd3d]={'$like':'%'+_0x25afb2[_0x9da1('0x26')][_0x9da1('0x44')]+'%'};return _0x1eda44;})});}_0xe8b0a5=_['merge']({},_0xe8b0a5,_0x25afb2[_0x9da1('0x33')]);return _0x4fe1ff['getAgents'](_0xe8b0a5);}})[_0x9da1('0x16')](function(_0x3516dc){if(_0x3516dc){_0x329d99=_0x3516dc[_0x9da1('0x3f')];if(!_0x25afb2['query']['hasOwnProperty'](_0x9da1('0x4f'))){_0xe8b0a5[_0x9da1('0x11')]=qs[_0x9da1('0x11')](_0x25afb2['query'][_0x9da1('0x11')]);_0xe8b0a5[_0x9da1('0x40')]=qs['offset'](_0x25afb2[_0x9da1('0x26')][_0x9da1('0x40')]);}return _0x4fe1ff['getAgents'](_0xe8b0a5);}})['then'](function(_0x489b3f){if(_0x489b3f){return _0x489b3f?{'count':_0x329d99,'rows':_0x489b3f}:null;}})[_0x9da1('0x16')](respondWithResult(_0x5e71f5,null))['catch'](handleError(_0x5e71f5,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 0088c53..52c2e8a 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 _0x93bc=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x26a3fa,_0x1d9102){var _0x1fe7e2=function(_0x50689b){while(--_0x50689b){_0x26a3fa['push'](_0x26a3fa['shift']());}};_0x1fe7e2(++_0x1d9102);}(_0x93bc,0x132));var _0xc93b=function(_0x5c7cd6,_0xa77e75){_0x5c7cd6=_0x5c7cd6-0x0;var _0x5820da=_0x93bc[_0x5c7cd6];return _0x5820da;};'use strict';var EventEmitter=require(_0xc93b('0x0'));var FaxQueue=require(_0xc93b('0x1'))['db'][_0xc93b('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc93b('0x3')](0x0);var events={'afterCreate':_0xc93b('0x4'),'afterUpdate':_0xc93b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c57bf){return function(_0x4d6e8c,_0x6d1218,_0x2b07fc){FaxQueueEvents[_0xc93b('0x6')](_0x4c57bf+':'+_0x4d6e8c['id'],_0x4d6e8c);FaxQueueEvents[_0xc93b('0x6')](_0x4c57bf,_0x4d6e8c);_0x2b07fc(null);};}for(var e in events){if(events[_0xc93b('0x7')](e)){var event=events[e];FaxQueue[_0xc93b('0x8')](e,emitEvent(event));}}module[_0xc93b('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x26f9=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x39a04c,_0x2b4002){var _0x580cb0=function(_0x138902){while(--_0x138902){_0x39a04c['push'](_0x39a04c['shift']());}};_0x580cb0(++_0x2b4002);}(_0x26f9,0x169));var _0x926f=function(_0x2212d3,_0x324f32){_0x2212d3=_0x2212d3-0x0;var _0x51c05d=_0x26f9[_0x2212d3];return _0x51c05d;};'use strict';var EventEmitter=require(_0x926f('0x0'));var FaxQueue=require(_0x926f('0x1'))['db'][_0x926f('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x926f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x926f('0x4'),'afterDestroy':_0x926f('0x5')};function emitEvent(_0x39b052){return function(_0x236e8d,_0x5502c6,_0x409981){FaxQueueEvents[_0x926f('0x6')](_0x39b052+':'+_0x236e8d['id'],_0x236e8d);FaxQueueEvents[_0x926f('0x6')](_0x39b052,_0x236e8d);_0x409981(null);};}for(var e in events){if(events[_0x926f('0x7')](e)){var event=events[e];FaxQueue[_0x926f('0x8')](e,emitEvent(event));}}module[_0x926f('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index d78698e..8ba5b7b 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 _0x6f85=['FaxQueue','lodash','util','../../config/logger','api','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x1dcb61,_0x533143){var _0x275729=function(_0x1987eb){while(--_0x1987eb){_0x1dcb61['push'](_0x1dcb61['shift']());}};_0x275729(++_0x533143);}(_0x6f85,0xd9));var _0x56f8=function(_0x899a7b,_0x47f3fe){_0x899a7b=_0x899a7b-0x0;var _0x501574=_0x6f85[_0x899a7b];return _0x501574;};'use strict';var _=require(_0x56f8('0x0'));var util=require(_0x56f8('0x1'));var logger=require(_0x56f8('0x2'))(_0x56f8('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('rimraf');var config=require(_0x56f8('0x4'));var attributes=require(_0x56f8('0x5'));module[_0x56f8('0x6')]=function(_0x1d9ffb,_0x568be2){return _0x1d9ffb[_0x56f8('0x7')](_0x56f8('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x529f=['define','FaxQueue','fax_queues','lodash','util','moment','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x500d68,_0x332f52){var _0x54a496=function(_0x354f7a){while(--_0x354f7a){_0x500d68['push'](_0x500d68['shift']());}};_0x54a496(++_0x332f52);}(_0x529f,0xc9));var _0xf529=function(_0x5b44e5,_0x5e894f){_0x5b44e5=_0x5b44e5-0x0;var _0x233f61=_0x529f[_0x5b44e5];return _0x233f61;};'use strict';var _=require(_0xf529('0x0'));var util=require(_0xf529('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf529('0x2'));var BPromise=require('bluebird');var rp=require(_0xf529('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf529('0x4'));var config=require(_0xf529('0x5'));var attributes=require(_0xf529('0x6'));module[_0xf529('0x7')]=function(_0x41a415,_0x3e1f9a){return _0x41a415[_0xf529('0x8')](_0xf529('0x9'),attributes,{'tableName':_0xf529('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index d1c8e57..69608b3 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 _0x2a0a=['http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','model','attributes','map','then','ShowFaxQueue','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47b9d3,_0x18f3a1){var _0xfa7c91=function(_0x51e0d2){while(--_0x51e0d2){_0x47b9d3['push'](_0x47b9d3['shift']());}};_0xfa7c91(++_0x18f3a1);}(_0x2a0a,0x16d));var _0xa2a0=function(_0x4eb98c,_0x5efbad){_0x4eb98c=_0x4eb98c-0x0;var _0x3a5d99=_0x2a0a[_0x4eb98c];return _0x3a5d99;};'use strict';var _=require(_0xa2a0('0x0'));var util=require(_0xa2a0('0x1'));var moment=require(_0xa2a0('0x2'));var BPromise=require(_0xa2a0('0x3'));var rs=require(_0xa2a0('0x4'));var fs=require('fs');var Redis=require(_0xa2a0('0x5'));var db=require(_0xa2a0('0x6'))['db'];var utils=require(_0xa2a0('0x7'));var logger=require(_0xa2a0('0x8'))(_0xa2a0('0x9'));var config=require(_0xa2a0('0xa'));var jayson=require(_0xa2a0('0xb'));var client=jayson[_0xa2a0('0xc')][_0xa2a0('0xd')]({'port':0x232a});config[_0xa2a0('0xe')]=_[_0xa2a0('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa2a0('0x10'))(new Redis(config[_0xa2a0('0xe')]));require(_0xa2a0('0x11'))[_0xa2a0('0x12')](socket);function respondWithRpcPromise(_0x10cfa9,_0x5775e0,_0xfbe365){return new BPromise(function(_0x4f9592,_0x116804){return client['request'](_0x10cfa9,_0xfbe365)['then'](function(_0x2a503e){logger[_0xa2a0('0x13')]('FaxQueue,\x20%s,\x20%s',_0x5775e0,_0xa2a0('0x14'));logger['debug'](_0xa2a0('0x15'),_0x5775e0,'request\x20sent',JSON[_0xa2a0('0x16')](_0x2a503e));if(_0x2a503e[_0xa2a0('0x17')]){if(_0x2a503e['error']['code']===0x1f4){logger[_0xa2a0('0x17')](_0xa2a0('0x18'),_0x5775e0,_0x2a503e['error'][_0xa2a0('0x19')]);return _0x116804(_0x2a503e[_0xa2a0('0x17')][_0xa2a0('0x19')]);}logger[_0xa2a0('0x17')](_0xa2a0('0x18'),_0x5775e0,_0x2a503e[_0xa2a0('0x17')][_0xa2a0('0x19')]);return _0x4f9592(_0x2a503e['error']['message']);}else{logger[_0xa2a0('0x13')](_0xa2a0('0x18'),_0x5775e0,_0xa2a0('0x14'));_0x4f9592(_0x2a503e[_0xa2a0('0x1a')][_0xa2a0('0x19')]);}})[_0xa2a0('0x1b')](function(_0x143e91){logger[_0xa2a0('0x17')](_0xa2a0('0x18'),_0x5775e0,_0x143e91);_0x116804(_0x143e91);});});}exports[_0xa2a0('0x1c')]=function(_0x55ec4f){var _0x592622=this;return new Promise(function(_0x23bafb,_0x405b57){return db[_0xa2a0('0x1d')][_0xa2a0('0x1e')]({'raw':_0x55ec4f['options']?_0x55ec4f[_0xa2a0('0x1f')][_0xa2a0('0x20')]===undefined?!![]:![]:!![],'where':_0x55ec4f[_0xa2a0('0x1f')]?_0x55ec4f['options'][_0xa2a0('0x21')]||null:null,'attributes':_0x55ec4f[_0xa2a0('0x1f')]?_0x55ec4f[_0xa2a0('0x1f')]['attributes']||null:null,'limit':_0x55ec4f[_0xa2a0('0x1f')]?_0x55ec4f[_0xa2a0('0x1f')][_0xa2a0('0x22')]||null:null,'include':_0x55ec4f['options']?_0x55ec4f['options'][_0xa2a0('0x23')]?_['map'](_0x55ec4f[_0xa2a0('0x1f')][_0xa2a0('0x23')],function(_0x59f982){return{'model':db[_0x59f982[_0xa2a0('0x24')]],'as':_0x59f982['as'],'attributes':_0x59f982[_0xa2a0('0x25')],'include':_0x59f982['include']?_[_0xa2a0('0x26')](_0x59f982[_0xa2a0('0x23')],function(_0x5332b5){return{'model':db[_0x5332b5[_0xa2a0('0x24')]],'as':_0x5332b5['as'],'attributes':_0x5332b5[_0xa2a0('0x25')],'include':_0x5332b5[_0xa2a0('0x23')]?_['map'](_0x5332b5[_0xa2a0('0x23')],function(_0x1e6dcf){return{'model':db[_0x1e6dcf[_0xa2a0('0x24')]],'as':_0x1e6dcf['as'],'attributes':_0x1e6dcf[_0xa2a0('0x25')]};}):[]};}):[]};}):[]:[]})[_0xa2a0('0x27')](function(_0x160373){logger[_0xa2a0('0x13')]('GetFaxQueue',_0x55ec4f);logger['debug']('GetFaxQueue',_0x55ec4f,JSON[_0xa2a0('0x16')](_0x160373));_0x23bafb(_0x160373);})['catch'](function(_0xcf8586){logger[_0xa2a0('0x17')](_0xa2a0('0x1c'),_0xcf8586['message'],_0x55ec4f);_0x405b57(_0x592622[_0xa2a0('0x17')](0x1f4,_0xcf8586[_0xa2a0('0x19')]));});});};exports[_0xa2a0('0x28')]=function(_0x3bcf2b){var _0x2766c7=this;return new Promise(function(_0x4909d2,_0x3353fe){return db[_0xa2a0('0x1d')]['find']({'raw':_0x3bcf2b[_0xa2a0('0x1f')]?_0x3bcf2b[_0xa2a0('0x1f')][_0xa2a0('0x20')]===undefined?!![]:![]:!![],'where':_0x3bcf2b['options']?_0x3bcf2b[_0xa2a0('0x1f')]['where']||null:null,'attributes':_0x3bcf2b[_0xa2a0('0x1f')]?_0x3bcf2b[_0xa2a0('0x1f')][_0xa2a0('0x25')]||null:null,'include':_0x3bcf2b[_0xa2a0('0x1f')]?_0x3bcf2b[_0xa2a0('0x1f')][_0xa2a0('0x23')]?_['map'](_0x3bcf2b[_0xa2a0('0x1f')][_0xa2a0('0x23')],function(_0x593b4b){return{'model':db[_0x593b4b['model']],'as':_0x593b4b['as'],'attributes':_0x593b4b['attributes'],'include':_0x593b4b['include']?_['map'](_0x593b4b[_0xa2a0('0x23')],function(_0x2f3514){return{'model':db[_0x2f3514[_0xa2a0('0x24')]],'as':_0x2f3514['as'],'attributes':_0x2f3514[_0xa2a0('0x25')],'include':_0x2f3514[_0xa2a0('0x23')]?_[_0xa2a0('0x26')](_0x2f3514['include'],function(_0x4f2317){return{'model':db[_0x4f2317[_0xa2a0('0x24')]],'as':_0x4f2317['as'],'attributes':_0x4f2317[_0xa2a0('0x25')]};}):[]};}):[]};}):[]:[]})[_0xa2a0('0x27')](function(_0xd0ba09){logger[_0xa2a0('0x13')](_0xa2a0('0x28'),_0x3bcf2b);logger[_0xa2a0('0x29')](_0xa2a0('0x28'),_0x3bcf2b,JSON[_0xa2a0('0x16')](_0xd0ba09));_0x4909d2(_0xd0ba09);})[_0xa2a0('0x1b')](function(_0xff87d8){logger[_0xa2a0('0x17')]('ShowFaxQueue',_0xff87d8[_0xa2a0('0x19')],_0x3bcf2b);_0x3353fe(_0x2766c7['error'](0x1f4,_0xff87d8[_0xa2a0('0x19')]));});});}; \ No newline at end of file +var _0xa505=['catch','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa505,0x1d7));var _0x5a50=function(_0x12f166,_0x941053){_0x12f166=_0x12f166-0x0;var _0x5e197e=_0xa505[_0x12f166];return _0x5e197e;};'use strict';var _=require(_0x5a50('0x0'));var util=require(_0x5a50('0x1'));var moment=require(_0x5a50('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a50('0x3'));var fs=require('fs');var Redis=require(_0x5a50('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a50('0x5'));var logger=require(_0x5a50('0x6'))('rpc');var config=require(_0x5a50('0x7'));var jayson=require(_0x5a50('0x8'));var client=jayson[_0x5a50('0x9')]['http']({'port':0x232a});config[_0x5a50('0xa')]=_['defaults'](config['redis'],{'host':_0x5a50('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a50('0xa')]));require(_0x5a50('0xc'))[_0x5a50('0xd')](socket);function respondWithRpcPromise(_0x27894c,_0x4b0131,_0x52f88b){return new BPromise(function(_0x82571,_0x4db96b){return client[_0x5a50('0xe')](_0x27894c,_0x52f88b)[_0x5a50('0xf')](function(_0x31ac04){logger[_0x5a50('0x10')](_0x5a50('0x11'),_0x4b0131,'request\x20sent');logger[_0x5a50('0x12')](_0x5a50('0x13'),_0x4b0131,'request\x20sent',JSON[_0x5a50('0x14')](_0x31ac04));if(_0x31ac04[_0x5a50('0x15')]){if(_0x31ac04[_0x5a50('0x15')][_0x5a50('0x16')]===0x1f4){logger[_0x5a50('0x15')]('FaxQueue,\x20%s,\x20%s',_0x4b0131,_0x31ac04[_0x5a50('0x15')][_0x5a50('0x17')]);return _0x4db96b(_0x31ac04[_0x5a50('0x15')][_0x5a50('0x17')]);}logger[_0x5a50('0x15')]('FaxQueue,\x20%s,\x20%s',_0x4b0131,_0x31ac04[_0x5a50('0x15')][_0x5a50('0x17')]);return _0x82571(_0x31ac04[_0x5a50('0x15')][_0x5a50('0x17')]);}else{logger[_0x5a50('0x10')](_0x5a50('0x11'),_0x4b0131,_0x5a50('0x18'));_0x82571(_0x31ac04[_0x5a50('0x19')][_0x5a50('0x17')]);}})['catch'](function(_0x4f13cc){logger[_0x5a50('0x15')](_0x5a50('0x11'),_0x4b0131,_0x4f13cc);_0x4db96b(_0x4f13cc);});});}exports[_0x5a50('0x1a')]=function(_0x289035){var _0x2efb40=this;return new Promise(function(_0x1b1785,_0x14dbf5){return db[_0x5a50('0x1b')][_0x5a50('0x1c')]({'raw':_0x289035[_0x5a50('0x1d')]?_0x289035[_0x5a50('0x1d')][_0x5a50('0x1e')]===undefined?!![]:![]:!![],'where':_0x289035[_0x5a50('0x1d')]?_0x289035['options'][_0x5a50('0x1f')]||null:null,'attributes':_0x289035[_0x5a50('0x1d')]?_0x289035[_0x5a50('0x1d')][_0x5a50('0x20')]||null:null,'limit':_0x289035['options']?_0x289035[_0x5a50('0x1d')]['limit']||null:null,'include':_0x289035['options']?_0x289035['options'][_0x5a50('0x21')]?_[_0x5a50('0x22')](_0x289035[_0x5a50('0x1d')][_0x5a50('0x21')],function(_0x3f688b){return{'model':db[_0x3f688b['model']],'as':_0x3f688b['as'],'attributes':_0x3f688b['attributes'],'include':_0x3f688b['include']?_[_0x5a50('0x22')](_0x3f688b[_0x5a50('0x21')],function(_0x258f0e){return{'model':db[_0x258f0e[_0x5a50('0x23')]],'as':_0x258f0e['as'],'attributes':_0x258f0e['attributes'],'include':_0x258f0e[_0x5a50('0x21')]?_[_0x5a50('0x22')](_0x258f0e[_0x5a50('0x21')],function(_0x25fc29){return{'model':db[_0x25fc29[_0x5a50('0x23')]],'as':_0x25fc29['as'],'attributes':_0x25fc29[_0x5a50('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xef67ea){logger[_0x5a50('0x10')](_0x5a50('0x1a'),_0x289035);logger['debug'](_0x5a50('0x1a'),_0x289035,JSON[_0x5a50('0x14')](_0xef67ea));_0x1b1785(_0xef67ea);})[_0x5a50('0x24')](function(_0x1f3b5c){logger[_0x5a50('0x15')](_0x5a50('0x1a'),_0x1f3b5c[_0x5a50('0x17')],_0x289035);_0x14dbf5(_0x2efb40[_0x5a50('0x15')](0x1f4,_0x1f3b5c[_0x5a50('0x17')]));});});};exports[_0x5a50('0x25')]=function(_0x3d7e40){var _0x59bcf9=this;return new Promise(function(_0x51cb69,_0x537c9b){return db['FaxQueue'][_0x5a50('0x26')]({'raw':_0x3d7e40[_0x5a50('0x1d')]?_0x3d7e40[_0x5a50('0x1d')][_0x5a50('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d7e40['options']?_0x3d7e40[_0x5a50('0x1d')]['where']||null:null,'attributes':_0x3d7e40['options']?_0x3d7e40[_0x5a50('0x1d')]['attributes']||null:null,'include':_0x3d7e40[_0x5a50('0x1d')]?_0x3d7e40[_0x5a50('0x1d')][_0x5a50('0x21')]?_[_0x5a50('0x22')](_0x3d7e40['options'][_0x5a50('0x21')],function(_0x3e06c1){return{'model':db[_0x3e06c1[_0x5a50('0x23')]],'as':_0x3e06c1['as'],'attributes':_0x3e06c1['attributes'],'include':_0x3e06c1[_0x5a50('0x21')]?_[_0x5a50('0x22')](_0x3e06c1[_0x5a50('0x21')],function(_0x51cc3b){return{'model':db[_0x51cc3b['model']],'as':_0x51cc3b['as'],'attributes':_0x51cc3b[_0x5a50('0x20')],'include':_0x51cc3b[_0x5a50('0x21')]?_['map'](_0x51cc3b['include'],function(_0x2efdb9){return{'model':db[_0x2efdb9[_0x5a50('0x23')]],'as':_0x2efdb9['as'],'attributes':_0x2efdb9[_0x5a50('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5a50('0xf')](function(_0x1c9a3e){logger[_0x5a50('0x10')](_0x5a50('0x25'),_0x3d7e40);logger[_0x5a50('0x12')](_0x5a50('0x25'),_0x3d7e40,JSON[_0x5a50('0x14')](_0x1c9a3e));_0x51cb69(_0x1c9a3e);})['catch'](function(_0x1c6487){logger[_0x5a50('0x15')](_0x5a50('0x25'),_0x1c6487['message'],_0x3d7e40);_0x537c9b(_0x59bcf9[_0x5a50('0x15')](0x1f4,_0x1c6487[_0x5a50('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 3495aed..2a53b7a 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 _0xf6da=['save','remove','update','emit','register','length','faxQueue:','./faxQueue.events'];(function(_0x1f55f3,_0xdca5fd){var _0x5e106e=function(_0x557012){while(--_0x557012){_0x1f55f3['push'](_0x1f55f3['shift']());}};_0x5e106e(++_0xdca5fd);}(_0xf6da,0x19f));var _0xaf6d=function(_0x829c85,_0x5898c4){_0x829c85=_0x829c85-0x0;var _0x7d594c=_0xf6da[_0x829c85];return _0x7d594c;};'use strict';var FaxQueueEvents=require(_0xaf6d('0x0'));var events=[_0xaf6d('0x1'),_0xaf6d('0x2'),_0xaf6d('0x3')];function createListener(_0x3e65ba,_0x44277b){return function(_0x16417f){_0x44277b[_0xaf6d('0x4')](_0x3e65ba,_0x16417f);};}function removeListener(_0x28fd8d,_0x3a04e2){return function(){FaxQueueEvents['removeListener'](_0x28fd8d,_0x3a04e2);};}exports[_0xaf6d('0x5')]=function(_0x2c1c8f){for(var _0x189864=0x0,_0x281a74=events[_0xaf6d('0x6')];_0x189864<_0x281a74;_0x189864++){var _0x10d207=events[_0x189864];var _0x19311=createListener(_0xaf6d('0x7')+_0x10d207,_0x2c1c8f);FaxQueueEvents['on'](_0x10d207,_0x19311);}}; \ No newline at end of file +var _0x8ce1=['./faxQueue.events','save','remove','update','emit','removeListener','register','length','faxQueue:'];(function(_0x5850b5,_0x4f5185){var _0x4101a4=function(_0x17b705){while(--_0x17b705){_0x5850b5['push'](_0x5850b5['shift']());}};_0x4101a4(++_0x4f5185);}(_0x8ce1,0x183));var _0x18ce=function(_0x5d07aa,_0x61055f){_0x5d07aa=_0x5d07aa-0x0;var _0x16b665=_0x8ce1[_0x5d07aa];return _0x16b665;};'use strict';var FaxQueueEvents=require(_0x18ce('0x0'));var events=[_0x18ce('0x1'),_0x18ce('0x2'),_0x18ce('0x3')];function createListener(_0x202f93,_0x22b196){return function(_0x211dc4){_0x22b196[_0x18ce('0x4')](_0x202f93,_0x211dc4);};}function removeListener(_0x1d842c,_0x15f55e){return function(){FaxQueueEvents[_0x18ce('0x5')](_0x1d842c,_0x15f55e);};}exports[_0x18ce('0x6')]=function(_0x13ff9d){for(var _0x36f8db=0x0,_0x682d4b=events[_0x18ce('0x7')];_0x36f8db<_0x682d4b;_0x36f8db++){var _0x4ebf82=events[_0x36f8db];var _0x1a60c5=createListener(_0x18ce('0x8')+_0x4ebf82,_0x13ff9d);FaxQueueEvents['on'](_0x4ebf82,_0x1a60c5);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index ecb7527..1157b20 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 _0x7046=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','/:id','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x5791d1,_0x3948fe){var _0x4a9a5d=function(_0x500c9f){while(--_0x500c9f){_0x5791d1['push'](_0x5791d1['shift']());}};_0x4a9a5d(++_0x3948fe);}(_0x7046,0x144));var _0x6704=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7046[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0x9')](_0x6704('0xe'),auth[_0x6704('0xa')](),controller[_0x6704('0xf')]);router[_0x6704('0x9')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller['getTeams']);router[_0x6704('0x9')](_0x6704('0x11'),auth['isAuthenticated'](),controller[_0x6704('0x12')]);router[_0x6704('0x13')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0x14')]);router[_0x6704('0x13')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller[_0x6704('0x15')]);router[_0x6704('0x13')]('/:id/users',auth[_0x6704('0xa')](),controller[_0x6704('0x16')]);router[_0x6704('0x17')]('/:id',auth[_0x6704('0xa')](),controller[_0x6704('0x18')]);router[_0x6704('0x19')](_0x6704('0x1a'),auth[_0x6704('0xa')](),controller['destroy']);router[_0x6704('0x19')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller[_0x6704('0x1b')]);router[_0x6704('0x19')]('/:id/users',auth[_0x6704('0xa')](),controller[_0x6704('0x1c')]);module[_0x6704('0x1d')]=router; \ No newline at end of file +var _0x7b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.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','exports','multer','util','path','connect-timeout'];(function(_0x470e67,_0x4a596d){var _0x28bbde=function(_0x1bbf56){while(--_0x1bbf56){_0x470e67['push'](_0x470e67['shift']());}};_0x28bbde(++_0x4a596d);}(_0x7b84,0x17c));var _0x47b8=function(_0x14d7bf,_0x1d9917){_0x14d7bf=_0x14d7bf-0x0;var _0x1d0b69=_0x7b84[_0x14d7bf];return _0x1d0b69;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0xa')](_0x47b8('0x11'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0xa')](_0x47b8('0x13'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0xa')](_0x47b8('0x15'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);router[_0x47b8('0x17')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x18')]);router[_0x47b8('0x17')](_0x47b8('0x13'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x19')]);router[_0x47b8('0x17')]('/:id/users',auth[_0x47b8('0xb')](),controller[_0x47b8('0x1a')]);router[_0x47b8('0x1b')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x1c')]);router[_0x47b8('0x1d')]('/:id',auth[_0x47b8('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0x47b8('0xb')](),controller[_0x47b8('0x1e')]);router[_0x47b8('0x1d')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x47b8('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d1ae307..fa47d66 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 _0xf3ac=['DATE','STRING'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xf3ac,0x79));var _0xcf3a=function(_0x9b4c91,_0x19d4c4){_0x9b4c91=_0x9b4c91-0x0;var _0x4ff3ce=_0xf3ac[_0x9b4c91];return _0x4ff3ce;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcf3a('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xcf3a('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcf3a('0x1')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c7b=['exports','STRING','DATE','moment','sequelize'];(function(_0x412262,_0xc8a3cc){var _0x4d522b=function(_0x3cc4b2){while(--_0x3cc4b2){_0x412262['push'](_0x412262['shift']());}};_0x4d522b(++_0xc8a3cc);}(_0x1c7b,0x1d4));var _0xb1c7=function(_0x4863a2,_0x189822){_0x4863a2=_0x4863a2-0x0;var _0x185578=_0x1c7b[_0x4863a2];return _0x185578;};'use strict';var moment=require(_0xb1c7('0x0'));var Sequelize=require(_0xb1c7('0x1'));module[_0xb1c7('0x2')]={'uniqueid':{'type':Sequelize[_0xb1c7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb1c7('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb1c7('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb1c7('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 52db878..2fb5dad 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 _0xb11e=['ejs','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','count','then','destroy','sendStatus','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0x2aed3,_0x5f9c05){var _0x160e00=function(_0x552b3a){while(--_0x552b3a){_0x2aed3['push'](_0x2aed3['shift']());}};_0x160e00(++_0x5f9c05);}(_0xb11e,0x7d));var _0xeb11=function(_0x19ebc7,_0x2cd981){_0x19ebc7=_0x19ebc7-0x0;var _0x51f7ea=_0xb11e[_0x19ebc7];return _0x51f7ea;};'use strict';var emlformat=require(_0xeb11('0x0'));var rimraf=require(_0xeb11('0x1'));var zipdir=require(_0xeb11('0x2'));var jsonpatch=require(_0xeb11('0x3'));var rp=require(_0xeb11('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb11('0x5'));var util=require(_0xeb11('0x6'));var path=require(_0xeb11('0x7'));var sox=require(_0xeb11('0x8'));var csv=require('to-csv');var ejs=require(_0xeb11('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb11('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb11('0xb'));var toCsv=require(_0xeb11('0xc'));var querystring=require(_0xeb11('0xd'));var Papa=require('papaparse');var Redis=require(_0xeb11('0xe'));var authService=require(_0xeb11('0xf'));var qs=require(_0xeb11('0x10'));var as=require(_0xeb11('0x11'));var hardwareService=require(_0xeb11('0x12'));var logger=require(_0xeb11('0x13'))(_0xeb11('0x14'));var utils=require(_0xeb11('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeb11('0x16'));var db=require(_0xeb11('0x17'))['db'];function respondWithStatusCode(_0x15b1e4,_0x517962){_0x517962=_0x517962||0xcc;return function(_0x44b192){if(_0x44b192){return _0x15b1e4['sendStatus'](_0x517962);}return _0x15b1e4[_0xeb11('0x18')](_0x517962)['end']();};}function respondWithResult(_0x5d183d,_0x146cfa){_0x146cfa=_0x146cfa||0xc8;return function(_0x2e0d2c){if(_0x2e0d2c){return _0x5d183d[_0xeb11('0x18')](_0x146cfa)[_0xeb11('0x19')](_0x2e0d2c);}};}function respondWithFilteredResult(_0x4c6a67,_0x58d276){return function(_0x200730){if(_0x200730){var _0xd1a9bf=typeof _0x58d276[_0xeb11('0x1a')]==='undefined'&&typeof _0x58d276[_0xeb11('0x1b')]==='undefined';var _0x33a996=_0x200730[_0xeb11('0x1c')];var _0x139ff8=_0xd1a9bf?0x0:_0x58d276['offset'];var _0xf36770=_0xd1a9bf?_0x200730[_0xeb11('0x1c')]:_0x58d276['offset']+_0x58d276['limit'];var _0x1906db;if(_0xf36770>=_0x33a996){_0xf36770=_0x33a996;_0x1906db=0xc8;}else{_0x1906db=0xce;}_0x4c6a67[_0xeb11('0x18')](_0x1906db);return _0x4c6a67['set']('Content-Range',_0x139ff8+'-'+_0xf36770+'/'+_0x33a996)[_0xeb11('0x19')](_0x200730);}return null;};}function patchUpdates(_0xf057c){return function(_0x4dfe03){try{jsonpatch['apply'](_0x4dfe03,_0xf057c,!![]);}catch(_0x17af28){return BPromise['reject'](_0x17af28);}return _0x4dfe03['save']();};}function saveUpdates(_0x5779df,_0xeeb427){return function(_0x1caf4f){if(_0x1caf4f){return _0x1caf4f['update'](_0x5779df)[_0xeb11('0x1d')](function(_0x40a4cb){return _0x40a4cb;});}return null;};}function removeEntity(_0x53e48d,_0x1c526d){return function(_0x3b2e1a){if(_0x3b2e1a){return _0x3b2e1a[_0xeb11('0x1e')]()['then'](function(){_0x53e48d[_0xeb11('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b97b5,_0x8af064){return function(_0x2a4fc6){if(!_0x2a4fc6){_0x5b97b5[_0xeb11('0x1f')](0x194);}return _0x2a4fc6;};}function handleError(_0x59e3fb,_0x4d8cf8){_0x4d8cf8=_0x4d8cf8||0x1f4;return function(_0xca08dd){logger['error'](_0xca08dd[_0xeb11('0x20')]);if(_0xca08dd[_0xeb11('0x21')]){delete _0xca08dd[_0xeb11('0x21')];}_0x59e3fb[_0xeb11('0x18')](_0x4d8cf8)[_0xeb11('0x22')](_0xca08dd);};}exports['index']=function(_0x1d9bf7,_0x387fb7){var _0x4ee70a={},_0x104561={},_0x4bb5b8={'count':0x0,'rows':[]};var _0xa18410=_[_0xeb11('0x23')](db[_0xeb11('0x24')][_0xeb11('0x25')],function(_0x22e3d2){return{'name':_0x22e3d2[_0xeb11('0x26')],'type':_0x22e3d2[_0xeb11('0x27')][_0xeb11('0x28')]};});_0x104561[_0xeb11('0x29')]=_['map'](_0xa18410,_0xeb11('0x21'));_0x104561['query']=_[_0xeb11('0x2a')](_0x1d9bf7[_0xeb11('0x2b')]);_0x104561[_0xeb11('0x2c')]=_['intersection'](_0x104561['model'],_0x104561[_0xeb11('0x2b')]);_0x4ee70a[_0xeb11('0x2d')]=_[_0xeb11('0x2e')](_0x104561[_0xeb11('0x29')],qs['fields'](_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x2f')]));_0x4ee70a[_0xeb11('0x2d')]=_0x4ee70a['attributes'][_0xeb11('0x30')]?_0x4ee70a['attributes']:_0x104561[_0xeb11('0x29')];if(!_0x1d9bf7['query'][_0xeb11('0x31')](_0xeb11('0x32'))){_0x4ee70a[_0xeb11('0x1b')]=qs[_0xeb11('0x1b')](_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x1b')]);_0x4ee70a[_0xeb11('0x1a')]=qs['offset'](_0x1d9bf7[_0xeb11('0x2b')]['offset']);}_0x4ee70a[_0xeb11('0x33')]=qs['sort'](_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x34')]);_0x4ee70a[_0xeb11('0x35')]=qs[_0xeb11('0x2c')](_['pick'](_0x1d9bf7[_0xeb11('0x2b')],_0x104561[_0xeb11('0x2c')]),_0xa18410);if(_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x36')]){_0x4ee70a[_0xeb11('0x35')]=_[_0xeb11('0x37')](_0x4ee70a[_0xeb11('0x35')],{'$or':_[_0xeb11('0x23')](_0xa18410,function(_0x436aff){if(_0x436aff[_0xeb11('0x27')]!==_0xeb11('0x38')){var _0x25bc1a={};_0x25bc1a[_0x436aff[_0xeb11('0x21')]]={'$like':'%'+_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x36')]+'%'};return _0x25bc1a;}})});}_0x4ee70a=_['merge']({},_0x4ee70a,_0x1d9bf7[_0xeb11('0x39')]);var _0x480bb9={'where':_0x4ee70a[_0xeb11('0x35')]};return db[_0xeb11('0x24')]['count'](_0x480bb9)['then'](function(_0x210dcc){_0x4bb5b8[_0xeb11('0x1c')]=_0x210dcc;if(_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x3a')]){_0x4ee70a['include']=[{'all':!![]}];}return db[_0xeb11('0x24')][_0xeb11('0x3b')](_0x4ee70a);})[_0xeb11('0x1d')](function(_0xffa000){_0x4bb5b8['rows']=_0xffa000;return _0x4bb5b8;})['then'](respondWithFilteredResult(_0x387fb7,_0x4ee70a))[_0xeb11('0x3c')](handleError(_0x387fb7,null));};exports['show']=function(_0x7b589,_0xa750bf){var _0xfb67ee={'raw':!![],'where':{'id':_0x7b589[_0xeb11('0x3d')]['id']}},_0xdf32e7={};_0xdf32e7[_0xeb11('0x29')]=_['keys'](db['FaxQueueReport'][_0xeb11('0x25')]);_0xdf32e7[_0xeb11('0x2b')]=_[_0xeb11('0x2a')](_0x7b589['query']);_0xdf32e7[_0xeb11('0x2c')]=_[_0xeb11('0x2e')](_0xdf32e7[_0xeb11('0x29')],_0xdf32e7[_0xeb11('0x2b')]);_0xfb67ee[_0xeb11('0x2d')]=_['intersection'](_0xdf32e7['model'],qs[_0xeb11('0x2f')](_0x7b589['query'][_0xeb11('0x2f')]));_0xfb67ee[_0xeb11('0x2d')]=_0xfb67ee[_0xeb11('0x2d')][_0xeb11('0x30')]?_0xfb67ee[_0xeb11('0x2d')]:_0xdf32e7[_0xeb11('0x29')];if(_0x7b589['query'][_0xeb11('0x3a')]){_0xfb67ee[_0xeb11('0x3e')]=[{'all':!![]}];}_0xfb67ee=_[_0xeb11('0x37')]({},_0xfb67ee,_0x7b589[_0xeb11('0x39')]);return db[_0xeb11('0x24')]['find'](_0xfb67ee)[_0xeb11('0x1d')](handleEntityNotFound(_0xa750bf,null))[_0xeb11('0x1d')](respondWithResult(_0xa750bf,null))['catch'](handleError(_0xa750bf,null));};exports[_0xeb11('0x3f')]=function(_0x28d67a,_0x65e0ac){return db[_0xeb11('0x24')][_0xeb11('0x3f')](_0x28d67a['body'],{})['then'](respondWithResult(_0x65e0ac,0xc9))[_0xeb11('0x3c')](handleError(_0x65e0ac,null));};exports['update']=function(_0x355251,_0x2307ff){if(_0x355251[_0xeb11('0x40')]['id']){delete _0x355251[_0xeb11('0x40')]['id'];}return db['FaxQueueReport'][_0xeb11('0x41')]({'where':{'id':_0x355251[_0xeb11('0x3d')]['id']}})[_0xeb11('0x1d')](handleEntityNotFound(_0x2307ff,null))[_0xeb11('0x1d')](saveUpdates(_0x355251[_0xeb11('0x40')],null))['then'](respondWithResult(_0x2307ff,null))['catch'](handleError(_0x2307ff,null));};exports['destroy']=function(_0x315f87,_0x371513){return db['FaxQueueReport']['find']({'where':{'id':_0x315f87[_0xeb11('0x3d')]['id']}})['then'](handleEntityNotFound(_0x371513,null))[_0xeb11('0x1d')](removeEntity(_0x371513,null))[_0xeb11('0x3c')](handleError(_0x371513,null));};exports[_0xeb11('0x42')]=function(_0x3e2134,_0x24ecdc){return db[_0xeb11('0x24')][_0xeb11('0x42')]()[_0xeb11('0x1d')](respondWithResult(_0x24ecdc,null))[_0xeb11('0x3c')](handleError(_0x24ecdc,null));}; \ No newline at end of file +var _0xab26=['request-promise','moment','util','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/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','FaxQueueReport','rows','show','params','include','options','find','create','catch','body','destroy','describe','eml-format','rimraf','zip-dir'];(function(_0x12f401,_0x4afcc2){var _0x274dd0=function(_0x320699){while(--_0x320699){_0x12f401['push'](_0x12f401['shift']());}};_0x274dd0(++_0x4afcc2);}(_0xab26,0xd2));var _0x6ab2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xab26[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x6ab2('0x0'));var rimraf=require(_0x6ab2('0x1'));var zipdir=require(_0x6ab2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ab2('0x3'));var moment=require(_0x6ab2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ab2('0x5'));var path=require('path');var sox=require(_0x6ab2('0x6'));var csv=require(_0x6ab2('0x7'));var ejs=require(_0x6ab2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ab2('0x9'));var squel=require(_0x6ab2('0xa'));var crypto=require('crypto');var jsforce=require(_0x6ab2('0xb'));var deskjs=require(_0x6ab2('0xc'));var toCsv=require(_0x6ab2('0x7'));var querystring=require(_0x6ab2('0xd'));var Papa=require(_0x6ab2('0xe'));var Redis=require(_0x6ab2('0xf'));var authService=require(_0x6ab2('0x10'));var qs=require(_0x6ab2('0x11'));var as=require(_0x6ab2('0x12'));var hardwareService=require(_0x6ab2('0x13'));var logger=require(_0x6ab2('0x14'))('api');var utils=require(_0x6ab2('0x15'));var config=require(_0x6ab2('0x16'));var licenseUtil=require(_0x6ab2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b6f7c,_0x10c3b1){_0x10c3b1=_0x10c3b1||0xcc;return function(_0x2bb464){if(_0x2bb464){return _0x5b6f7c[_0x6ab2('0x18')](_0x10c3b1);}return _0x5b6f7c[_0x6ab2('0x19')](_0x10c3b1)[_0x6ab2('0x1a')]();};}function respondWithResult(_0x432df4,_0x9f3aea){_0x9f3aea=_0x9f3aea||0xc8;return function(_0x13d31d){if(_0x13d31d){return _0x432df4['status'](_0x9f3aea)[_0x6ab2('0x1b')](_0x13d31d);}};}function respondWithFilteredResult(_0x55d6f4,_0x1bc335){return function(_0x429aba){if(_0x429aba){var _0x5ced24=typeof _0x1bc335['offset']==='undefined'&&typeof _0x1bc335[_0x6ab2('0x1c')]===_0x6ab2('0x1d');var _0x20f437=_0x429aba[_0x6ab2('0x1e')];var _0x272bd0=_0x5ced24?0x0:_0x1bc335[_0x6ab2('0x1f')];var _0x508376=_0x5ced24?_0x429aba[_0x6ab2('0x1e')]:_0x1bc335[_0x6ab2('0x1f')]+_0x1bc335['limit'];var _0x17f6e0;if(_0x508376>=_0x20f437){_0x508376=_0x20f437;_0x17f6e0=0xc8;}else{_0x17f6e0=0xce;}_0x55d6f4['status'](_0x17f6e0);return _0x55d6f4['set'](_0x6ab2('0x20'),_0x272bd0+'-'+_0x508376+'/'+_0x20f437)[_0x6ab2('0x1b')](_0x429aba);}return null;};}function patchUpdates(_0x2ca855){return function(_0x1851bf){try{jsonpatch[_0x6ab2('0x21')](_0x1851bf,_0x2ca855,!![]);}catch(_0x4a2584){return BPromise[_0x6ab2('0x22')](_0x4a2584);}return _0x1851bf[_0x6ab2('0x23')]();};}function saveUpdates(_0x3b7a1a,_0x3fad2b){return function(_0x25fa3f){if(_0x25fa3f){return _0x25fa3f[_0x6ab2('0x24')](_0x3b7a1a)[_0x6ab2('0x25')](function(_0x2b87a0){return _0x2b87a0;});}return null;};}function removeEntity(_0x2784f8,_0x1caf3d){return function(_0x4fd76d){if(_0x4fd76d){return _0x4fd76d['destroy']()['then'](function(){_0x2784f8[_0x6ab2('0x19')](0xcc)[_0x6ab2('0x1a')]();});}};}function handleEntityNotFound(_0x273aee,_0x4cb5e1){return function(_0x4620f2){if(!_0x4620f2){_0x273aee[_0x6ab2('0x18')](0x194);}return _0x4620f2;};}function handleError(_0x24ece3,_0x17d62d){_0x17d62d=_0x17d62d||0x1f4;return function(_0x573516){logger['error'](_0x573516['stack']);if(_0x573516[_0x6ab2('0x26')]){delete _0x573516['name'];}_0x24ece3['status'](_0x17d62d)[_0x6ab2('0x27')](_0x573516);};}exports[_0x6ab2('0x28')]=function(_0x161165,_0x3bfb16){var _0x22bbb8={},_0x890013={},_0x307beb={'count':0x0,'rows':[]};var _0x3d3fe7=_[_0x6ab2('0x29')](db['FaxQueueReport'][_0x6ab2('0x2a')],function(_0xd9c398){return{'name':_0xd9c398['fieldName'],'type':_0xd9c398[_0x6ab2('0x2b')]['key']};});_0x890013[_0x6ab2('0x2c')]=_[_0x6ab2('0x29')](_0x3d3fe7,_0x6ab2('0x26'));_0x890013[_0x6ab2('0x2d')]=_[_0x6ab2('0x2e')](_0x161165[_0x6ab2('0x2d')]);_0x890013['filters']=_[_0x6ab2('0x2f')](_0x890013[_0x6ab2('0x2c')],_0x890013[_0x6ab2('0x2d')]);_0x22bbb8[_0x6ab2('0x30')]=_[_0x6ab2('0x2f')](_0x890013[_0x6ab2('0x2c')],qs[_0x6ab2('0x31')](_0x161165['query'][_0x6ab2('0x31')]));_0x22bbb8[_0x6ab2('0x30')]=_0x22bbb8['attributes']['length']?_0x22bbb8[_0x6ab2('0x30')]:_0x890013[_0x6ab2('0x2c')];if(!_0x161165[_0x6ab2('0x2d')][_0x6ab2('0x32')](_0x6ab2('0x33'))){_0x22bbb8[_0x6ab2('0x1c')]=qs[_0x6ab2('0x1c')](_0x161165[_0x6ab2('0x2d')]['limit']);_0x22bbb8['offset']=qs[_0x6ab2('0x1f')](_0x161165[_0x6ab2('0x2d')][_0x6ab2('0x1f')]);}_0x22bbb8[_0x6ab2('0x34')]=qs[_0x6ab2('0x35')](_0x161165['query'][_0x6ab2('0x35')]);_0x22bbb8[_0x6ab2('0x36')]=qs[_0x6ab2('0x37')](_['pick'](_0x161165[_0x6ab2('0x2d')],_0x890013[_0x6ab2('0x37')]),_0x3d3fe7);if(_0x161165['query'][_0x6ab2('0x38')]){_0x22bbb8[_0x6ab2('0x36')]=_[_0x6ab2('0x39')](_0x22bbb8[_0x6ab2('0x36')],{'$or':_[_0x6ab2('0x29')](_0x3d3fe7,function(_0xb5afbf){if(_0xb5afbf[_0x6ab2('0x2b')]!=='VIRTUAL'){var _0xdcec9={};_0xdcec9[_0xb5afbf['name']]={'$like':'%'+_0x161165[_0x6ab2('0x2d')][_0x6ab2('0x38')]+'%'};return _0xdcec9;}})});}_0x22bbb8=_[_0x6ab2('0x39')]({},_0x22bbb8,_0x161165['options']);var _0x5630e6={'where':_0x22bbb8[_0x6ab2('0x36')]};return db['FaxQueueReport']['count'](_0x5630e6)[_0x6ab2('0x25')](function(_0xdb02a7){_0x307beb[_0x6ab2('0x1e')]=_0xdb02a7;if(_0x161165[_0x6ab2('0x2d')][_0x6ab2('0x3a')]){_0x22bbb8['include']=[{'all':!![]}];}return db[_0x6ab2('0x3b')]['findAll'](_0x22bbb8);})[_0x6ab2('0x25')](function(_0x1a3b61){_0x307beb[_0x6ab2('0x3c')]=_0x1a3b61;return _0x307beb;})[_0x6ab2('0x25')](respondWithFilteredResult(_0x3bfb16,_0x22bbb8))['catch'](handleError(_0x3bfb16,null));};exports[_0x6ab2('0x3d')]=function(_0x251f3b,_0x39392e){var _0x1cb791={'raw':!![],'where':{'id':_0x251f3b[_0x6ab2('0x3e')]['id']}},_0x12d4b6={};_0x12d4b6[_0x6ab2('0x2c')]=_[_0x6ab2('0x2e')](db[_0x6ab2('0x3b')][_0x6ab2('0x2a')]);_0x12d4b6[_0x6ab2('0x2d')]=_[_0x6ab2('0x2e')](_0x251f3b['query']);_0x12d4b6[_0x6ab2('0x37')]=_[_0x6ab2('0x2f')](_0x12d4b6[_0x6ab2('0x2c')],_0x12d4b6[_0x6ab2('0x2d')]);_0x1cb791[_0x6ab2('0x30')]=_[_0x6ab2('0x2f')](_0x12d4b6['model'],qs[_0x6ab2('0x31')](_0x251f3b[_0x6ab2('0x2d')][_0x6ab2('0x31')]));_0x1cb791[_0x6ab2('0x30')]=_0x1cb791['attributes']['length']?_0x1cb791[_0x6ab2('0x30')]:_0x12d4b6[_0x6ab2('0x2c')];if(_0x251f3b[_0x6ab2('0x2d')][_0x6ab2('0x3a')]){_0x1cb791[_0x6ab2('0x3f')]=[{'all':!![]}];}_0x1cb791=_['merge']({},_0x1cb791,_0x251f3b[_0x6ab2('0x40')]);return db[_0x6ab2('0x3b')][_0x6ab2('0x41')](_0x1cb791)[_0x6ab2('0x25')](handleEntityNotFound(_0x39392e,null))['then'](respondWithResult(_0x39392e,null))['catch'](handleError(_0x39392e,null));};exports[_0x6ab2('0x42')]=function(_0x2deb87,_0x56d800){return db[_0x6ab2('0x3b')]['create'](_0x2deb87['body'],{})['then'](respondWithResult(_0x56d800,0xc9))[_0x6ab2('0x43')](handleError(_0x56d800,null));};exports[_0x6ab2('0x24')]=function(_0x4fffb4,_0x186746){if(_0x4fffb4['body']['id']){delete _0x4fffb4[_0x6ab2('0x44')]['id'];}return db[_0x6ab2('0x3b')][_0x6ab2('0x41')]({'where':{'id':_0x4fffb4[_0x6ab2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x186746,null))[_0x6ab2('0x25')](saveUpdates(_0x4fffb4[_0x6ab2('0x44')],null))[_0x6ab2('0x25')](respondWithResult(_0x186746,null))[_0x6ab2('0x43')](handleError(_0x186746,null));};exports[_0x6ab2('0x45')]=function(_0x301270,_0x27d960){return db['FaxQueueReport'][_0x6ab2('0x41')]({'where':{'id':_0x301270[_0x6ab2('0x3e')]['id']}})[_0x6ab2('0x25')](handleEntityNotFound(_0x27d960,null))[_0x6ab2('0x25')](removeEntity(_0x27d960,null))[_0x6ab2('0x43')](handleError(_0x27d960,null));};exports[_0x6ab2('0x46')]=function(_0x4f2a4e,_0x1db491){return db['FaxQueueReport'][_0x6ab2('0x46')]()[_0x6ab2('0x25')](respondWithResult(_0x1db491,null))[_0x6ab2('0x43')](handleError(_0x1db491,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 653226b..c3a7155 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x407538,_0x3867c3){var _0x106535=function(_0x529bd0){while(--_0x529bd0){_0x407538['push'](_0x407538['shift']());}};_0x106535(++_0x3867c3);}(_0x5fab,0x177));var _0xb5fa=function(_0x2f0366,_0x10885f){_0x2f0366=_0x2f0366-0x0;var _0x5e1c27=_0x5fab[_0x2f0366];return _0x5e1c27;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4464a2,_0x4a557f){var _0x26b25c=function(_0x4695ec){while(--_0x4695ec){_0x4464a2['push'](_0x4464a2['shift']());}};_0x26b25c(++_0x4a557f);}(_0x53ec,0x192));var _0xc53e=function(_0x1bd247,_0x14f195){_0x1bd247=_0x1bd247-0x0;var _0x54d8d5=_0x53ec[_0x1bd247];return _0x54d8d5;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index e271d03..1e30411 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 _0xe0d3=['stringify','UpdateFaxQueueReport','update','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0xe0d3,0xc7));var _0x3e0d=function(_0x33e4ef,_0x50aa2c){_0x33e4ef=_0x33e4ef-0x0;var _0x3513ad=_0xe0d3[_0x33e4ef];return _0x3513ad;};'use strict';var _=require(_0x3e0d('0x0'));var util=require('util');var moment=require(_0x3e0d('0x1'));var BPromise=require(_0x3e0d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e0d('0x3'));var db=require(_0x3e0d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e0d('0x5'))('rpc');var config=require(_0x3e0d('0x6'));var jayson=require(_0x3e0d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19c946,_0x2d49e4,_0x15675a){return new BPromise(function(_0x4934ab,_0x1e7a08){return client[_0x3e0d('0x8')](_0x19c946,_0x15675a)[_0x3e0d('0x9')](function(_0x1a8b3c){logger[_0x3e0d('0xa')](_0x3e0d('0xb'),_0x2d49e4,_0x3e0d('0xc'));logger[_0x3e0d('0xd')](_0x3e0d('0xe'),_0x2d49e4,_0x3e0d('0xc'),JSON['stringify'](_0x1a8b3c));if(_0x1a8b3c[_0x3e0d('0xf')]){if(_0x1a8b3c[_0x3e0d('0xf')]['code']===0x1f4){logger[_0x3e0d('0xf')](_0x3e0d('0xb'),_0x2d49e4,_0x1a8b3c[_0x3e0d('0xf')]['message']);return _0x1e7a08(_0x1a8b3c[_0x3e0d('0xf')]['message']);}logger[_0x3e0d('0xf')](_0x3e0d('0xb'),_0x2d49e4,_0x1a8b3c[_0x3e0d('0xf')][_0x3e0d('0x10')]);return _0x4934ab(_0x1a8b3c['error']['message']);}else{logger[_0x3e0d('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x2d49e4,_0x3e0d('0xc'));_0x4934ab(_0x1a8b3c[_0x3e0d('0x11')]['message']);}})[_0x3e0d('0x12')](function(_0x3981f3){logger['error'](_0x3e0d('0xb'),_0x2d49e4,_0x3981f3);_0x1e7a08(_0x3981f3);});});}exports[_0x3e0d('0x13')]=function(_0x530fcb){var _0x1db8b7=this;return new Promise(function(_0x23f61c,_0x2ef902){return db[_0x3e0d('0x14')][_0x3e0d('0x15')](_0x530fcb[_0x3e0d('0x16')],{'raw':_0x530fcb[_0x3e0d('0x17')]?_0x530fcb['options'][_0x3e0d('0x18')]===undefined?!![]:![]:!![]})[_0x3e0d('0x9')](function(_0x4a3b02){logger[_0x3e0d('0xa')]('CreateFaxQueueReport',_0x530fcb);logger['debug'](_0x3e0d('0x13'),_0x530fcb,JSON[_0x3e0d('0x19')](_0x4a3b02));_0x23f61c(_0x4a3b02);})[_0x3e0d('0x12')](function(_0x484b39){logger[_0x3e0d('0xf')](_0x3e0d('0x13'),_0x484b39[_0x3e0d('0x10')],_0x530fcb);_0x2ef902(_0x1db8b7['error'](0x1f4,_0x484b39['message']));});});};exports[_0x3e0d('0x1a')]=function(_0xa193cb){var _0x5bf83a=this;return new Promise(function(_0x3819dc,_0x1c6099){return db[_0x3e0d('0x14')][_0x3e0d('0x1b')](_0xa193cb[_0x3e0d('0x16')],{'raw':_0xa193cb[_0x3e0d('0x17')]?_0xa193cb[_0x3e0d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa193cb[_0x3e0d('0x17')]?_0xa193cb[_0x3e0d('0x17')]['where']||null:null,'attributes':_0xa193cb[_0x3e0d('0x17')]?_0xa193cb[_0x3e0d('0x17')]['attributes']||null:null,'limit':_0xa193cb['options']?_0xa193cb[_0x3e0d('0x17')]['limit']||null:null})[_0x3e0d('0x9')](function(_0xfcecde){logger[_0x3e0d('0xa')](_0x3e0d('0x1a'),_0xa193cb);logger[_0x3e0d('0xd')](_0x3e0d('0x1a'),_0xa193cb,JSON[_0x3e0d('0x19')](_0xfcecde));_0x3819dc(_0xfcecde);})[_0x3e0d('0x12')](function(_0x427e81){logger[_0x3e0d('0xf')](_0x3e0d('0x1a'),_0x427e81['message'],_0xa193cb);_0x1c6099(_0x5bf83a[_0x3e0d('0xf')](0x1f4,_0x427e81[_0x3e0d('0x10')]));});});}; \ No newline at end of file +var _0x04f6=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','FaxQueueReport','body','options','raw','CreateFaxQueueReport','where','attributes','UpdateFaxQueueReport','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x04f6,0x132));var _0x604f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x04f6[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x604f('0x0'));var moment=require('moment');var BPromise=require(_0x604f('0x1'));var rs=require(_0x604f('0x2'));var fs=require('fs');var Redis=require(_0x604f('0x3'));var db=require(_0x604f('0x4'))['db'];var utils=require(_0x604f('0x5'));var logger=require(_0x604f('0x6'))(_0x604f('0x7'));var config=require(_0x604f('0x8'));var jayson=require(_0x604f('0x9'));var client=jayson[_0x604f('0xa')][_0x604f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f0cac,_0x5ea161,_0x4dc720){return new BPromise(function(_0x39004d,_0x394277){return client[_0x604f('0xc')](_0x5f0cac,_0x4dc720)[_0x604f('0xd')](function(_0x16f062){logger['info'](_0x604f('0xe'),_0x5ea161,_0x604f('0xf'));logger[_0x604f('0x10')](_0x604f('0x11'),_0x5ea161,_0x604f('0xf'),JSON[_0x604f('0x12')](_0x16f062));if(_0x16f062[_0x604f('0x13')]){if(_0x16f062[_0x604f('0x13')][_0x604f('0x14')]===0x1f4){logger[_0x604f('0x13')](_0x604f('0xe'),_0x5ea161,_0x16f062[_0x604f('0x13')]['message']);return _0x394277(_0x16f062[_0x604f('0x13')][_0x604f('0x15')]);}logger['error'](_0x604f('0xe'),_0x5ea161,_0x16f062[_0x604f('0x13')][_0x604f('0x15')]);return _0x39004d(_0x16f062[_0x604f('0x13')]['message']);}else{logger[_0x604f('0x16')](_0x604f('0xe'),_0x5ea161,_0x604f('0xf'));_0x39004d(_0x16f062['result']['message']);}})['catch'](function(_0x3df84b){logger[_0x604f('0x13')](_0x604f('0xe'),_0x5ea161,_0x3df84b);_0x394277(_0x3df84b);});});}exports['CreateFaxQueueReport']=function(_0x5142d3){var _0x2299bf=this;return new Promise(function(_0x5a462a,_0x353727){return db[_0x604f('0x17')]['create'](_0x5142d3[_0x604f('0x18')],{'raw':_0x5142d3[_0x604f('0x19')]?_0x5142d3[_0x604f('0x19')][_0x604f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x21f91a){logger[_0x604f('0x16')]('CreateFaxQueueReport',_0x5142d3);logger[_0x604f('0x10')](_0x604f('0x1b'),_0x5142d3,JSON[_0x604f('0x12')](_0x21f91a));_0x5a462a(_0x21f91a);})['catch'](function(_0x43ed9e){logger[_0x604f('0x13')]('CreateFaxQueueReport',_0x43ed9e['message'],_0x5142d3);_0x353727(_0x2299bf[_0x604f('0x13')](0x1f4,_0x43ed9e[_0x604f('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x156026){var _0x3f9083=this;return new Promise(function(_0x228f09,_0x40671b){return db[_0x604f('0x17')]['update'](_0x156026['body'],{'raw':_0x156026[_0x604f('0x19')]?_0x156026[_0x604f('0x19')][_0x604f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x156026[_0x604f('0x19')]?_0x156026[_0x604f('0x19')][_0x604f('0x1c')]||null:null,'attributes':_0x156026[_0x604f('0x19')]?_0x156026[_0x604f('0x19')][_0x604f('0x1d')]||null:null,'limit':_0x156026['options']?_0x156026[_0x604f('0x19')]['limit']||null:null})[_0x604f('0xd')](function(_0x5604f1){logger[_0x604f('0x16')](_0x604f('0x1e'),_0x156026);logger[_0x604f('0x10')](_0x604f('0x1e'),_0x156026,JSON[_0x604f('0x12')](_0x5604f1));_0x228f09(_0x5604f1);})[_0x604f('0x1f')](function(_0x4cb297){logger[_0x604f('0x13')](_0x604f('0x1e'),_0x4cb297['message'],_0x156026);_0x40671b(_0x3f9083[_0x604f('0x13')](0x1f4,_0x4cb297[_0x604f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b221c20..bc33eeb 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 _0x822a=['exports','multer','util','path','connect-timeout','express','fs-extra','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','create','put','update','delete','destroy'];(function(_0x4a98bc,_0x487cbc){var _0x255669=function(_0x466202){while(--_0x466202){_0x4a98bc['push'](_0x4a98bc['shift']());}};_0x255669(++_0x487cbc);}(_0x822a,0x1b1));var _0xa822=function(_0x4bab92,_0x497266){_0x4bab92=_0x4bab92-0x0;var _0x5ebe8b=_0x822a[_0x4bab92];return _0x5ebe8b;};'use strict';var multer=require(_0xa822('0x0'));var util=require(_0xa822('0x1'));var path=require(_0xa822('0x2'));var timeout=require(_0xa822('0x3'));var express=require(_0xa822('0x4'));var router=express['Router']();var fs_extra=require(_0xa822('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa822('0x6'));router[_0xa822('0x7')]('/',auth[_0xa822('0x8')](),controller[_0xa822('0x9')]);router[_0xa822('0x7')](_0xa822('0xa'),auth[_0xa822('0x8')](),controller['describe']);router[_0xa822('0x7')](_0xa822('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa822('0x8')](),controller[_0xa822('0xc')]);router[_0xa822('0xd')]('/:id',auth[_0xa822('0x8')](),controller[_0xa822('0xe')]);router[_0xa822('0xf')](_0xa822('0xb'),auth[_0xa822('0x8')](),controller[_0xa822('0x10')]);module[_0xa822('0x11')]=router; \ No newline at end of file +var _0xad5f=['isAuthenticated','index','/describe','describe','/:id','post','create','put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad5f,0xbe));var _0xfad5=function(_0x2cd8a4,_0x51fb40){_0x2cd8a4=_0x2cd8a4-0x0;var _0x375630=_0xad5f[_0x2cd8a4];return _0x375630;};'use strict';var multer=require('multer');var util=require(_0xfad5('0x0'));var path=require(_0xfad5('0x1'));var timeout=require(_0xfad5('0x2'));var express=require(_0xfad5('0x3'));var router=express['Router']();var fs_extra=require(_0xfad5('0x4'));var auth=require(_0xfad5('0x5'));var interaction=require(_0xfad5('0x6'));var config=require(_0xfad5('0x7'));var controller=require(_0xfad5('0x8'));router[_0xfad5('0x9')]('/',auth[_0xfad5('0xa')](),controller[_0xfad5('0xb')]);router[_0xfad5('0x9')](_0xfad5('0xc'),auth[_0xfad5('0xa')](),controller[_0xfad5('0xd')]);router[_0xfad5('0x9')](_0xfad5('0xe'),auth[_0xfad5('0xa')](),controller['show']);router[_0xfad5('0xf')]('/',auth[_0xfad5('0xa')](),controller[_0xfad5('0x10')]);router[_0xfad5('0x11')](_0xfad5('0xe'),auth[_0xfad5('0xa')](),controller['update']);router['delete'](_0xfad5('0xe'),auth[_0xfad5('0xa')](),controller[_0xfad5('0x12')]);module[_0xfad5('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index fbc6d18..8dbc199 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x588a6,_0x2bfc30){var _0x5c4f2e=function(_0x1564ab){while(--_0x1564ab){_0x588a6['push'](_0x588a6['shift']());}};_0x5c4f2e(++_0x2bfc30);}(_0x00bb,0x1d8));var _0xb00b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x00bb[_0x24237f];return _0x48298e;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xbb5c90,_0x44bbf7){var _0x1947c6=function(_0x5bdcce){while(--_0x5bdcce){_0xbb5c90['push'](_0xbb5c90['shift']());}};_0x1947c6(++_0x44bbf7);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f4561,_0x4611b9){_0x3f4561=_0x3f4561-0x0;var _0x3b6300=_0xedd9[_0x3f4561];return _0x3b6300;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 219acad..96e0c2f 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 _0x3c0b=['then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','FaxTransferReport','include','findAll','rows','catch','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update'];(function(_0x35c26b,_0x13ca4e){var _0x4a9290=function(_0x50aa5f){while(--_0x50aa5f){_0x35c26b['push'](_0x35c26b['shift']());}};_0x4a9290(++_0x13ca4e);}(_0x3c0b,0x1e6));var _0xb3c0=function(_0x27cb33,_0x14157e){_0x27cb33=_0x27cb33-0x0;var _0x5b459a=_0x3c0b[_0x27cb33];return _0x5b459a;};'use strict';var emlformat=require(_0xb3c0('0x0'));var rimraf=require(_0xb3c0('0x1'));var zipdir=require(_0xb3c0('0x2'));var jsonpatch=require(_0xb3c0('0x3'));var rp=require(_0xb3c0('0x4'));var moment=require(_0xb3c0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb3c0('0x6'));var util=require('util');var path=require(_0xb3c0('0x7'));var sox=require('sox');var csv=require(_0xb3c0('0x8'));var ejs=require(_0xb3c0('0x9'));var fs=require('fs');var fs_extra=require(_0xb3c0('0xa'));var _=require(_0xb3c0('0xb'));var squel=require(_0xb3c0('0xc'));var crypto=require(_0xb3c0('0xd'));var jsforce=require(_0xb3c0('0xe'));var deskjs=require(_0xb3c0('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb3c0('0x10'));var Redis=require(_0xb3c0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb3c0('0x12'));var as=require(_0xb3c0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3c0('0x14'))(_0xb3c0('0x15'));var utils=require(_0xb3c0('0x16'));var config=require(_0xb3c0('0x17'));var licenseUtil=require(_0xb3c0('0x18'));var db=require(_0xb3c0('0x19'))['db'];function respondWithStatusCode(_0x5076a6,_0x7f970e){_0x7f970e=_0x7f970e||0xcc;return function(_0x190369){if(_0x190369){return _0x5076a6['sendStatus'](_0x7f970e);}return _0x5076a6['status'](_0x7f970e)[_0xb3c0('0x1a')]();};}function respondWithResult(_0x2885,_0x856e6c){_0x856e6c=_0x856e6c||0xc8;return function(_0x2ae2cf){if(_0x2ae2cf){return _0x2885[_0xb3c0('0x1b')](_0x856e6c)[_0xb3c0('0x1c')](_0x2ae2cf);}};}function respondWithFilteredResult(_0x19d1c1,_0x561f37){return function(_0x54db41){if(_0x54db41){var _0x4c8452=typeof _0x561f37[_0xb3c0('0x1d')]==='undefined'&&typeof _0x561f37[_0xb3c0('0x1e')]===_0xb3c0('0x1f');var _0x1c3bbd=_0x54db41['count'];var _0x35cd5c=_0x4c8452?0x0:_0x561f37[_0xb3c0('0x1d')];var _0x5e66d4=_0x4c8452?_0x54db41[_0xb3c0('0x20')]:_0x561f37[_0xb3c0('0x1d')]+_0x561f37[_0xb3c0('0x1e')];var _0x1a76a9;if(_0x5e66d4>=_0x1c3bbd){_0x5e66d4=_0x1c3bbd;_0x1a76a9=0xc8;}else{_0x1a76a9=0xce;}_0x19d1c1[_0xb3c0('0x1b')](_0x1a76a9);return _0x19d1c1[_0xb3c0('0x21')](_0xb3c0('0x22'),_0x35cd5c+'-'+_0x5e66d4+'/'+_0x1c3bbd)[_0xb3c0('0x1c')](_0x54db41);}return null;};}function patchUpdates(_0x340c3){return function(_0x48d7b0){try{jsonpatch[_0xb3c0('0x23')](_0x48d7b0,_0x340c3,!![]);}catch(_0x615c88){return BPromise[_0xb3c0('0x24')](_0x615c88);}return _0x48d7b0[_0xb3c0('0x25')]();};}function saveUpdates(_0x400b87,_0x263703){return function(_0x2b86ca){if(_0x2b86ca){return _0x2b86ca[_0xb3c0('0x26')](_0x400b87)[_0xb3c0('0x27')](function(_0x5cf15f){return _0x5cf15f;});}return null;};}function removeEntity(_0x4754eb,_0x49ee5c){return function(_0x5b4a74){if(_0x5b4a74){return _0x5b4a74[_0xb3c0('0x28')]()['then'](function(){_0x4754eb[_0xb3c0('0x1b')](0xcc)[_0xb3c0('0x1a')]();});}};}function handleEntityNotFound(_0x5c3e0b,_0x3280ee){return function(_0x3e46c1){if(!_0x3e46c1){_0x5c3e0b[_0xb3c0('0x29')](0x194);}return _0x3e46c1;};}function handleError(_0x118d4b,_0xf557ad){_0xf557ad=_0xf557ad||0x1f4;return function(_0x7e2e4d){logger[_0xb3c0('0x2a')](_0x7e2e4d[_0xb3c0('0x2b')]);if(_0x7e2e4d['name']){delete _0x7e2e4d[_0xb3c0('0x2c')];}_0x118d4b[_0xb3c0('0x1b')](_0xf557ad)[_0xb3c0('0x2d')](_0x7e2e4d);};}exports['index']=function(_0x28144f,_0x558128){var _0x108d4e={},_0x45ae1b={},_0x5d74db={'count':0x0,'rows':[]};var _0x3f5cbd=_[_0xb3c0('0x2e')](db['FaxTransferReport'][_0xb3c0('0x2f')],function(_0x54f733){return{'name':_0x54f733['fieldName'],'type':_0x54f733[_0xb3c0('0x30')][_0xb3c0('0x31')]};});_0x45ae1b[_0xb3c0('0x32')]=_[_0xb3c0('0x2e')](_0x3f5cbd,_0xb3c0('0x2c'));_0x45ae1b['query']=_[_0xb3c0('0x33')](_0x28144f[_0xb3c0('0x34')]);_0x45ae1b[_0xb3c0('0x35')]=_[_0xb3c0('0x36')](_0x45ae1b[_0xb3c0('0x32')],_0x45ae1b[_0xb3c0('0x34')]);_0x108d4e[_0xb3c0('0x37')]=_[_0xb3c0('0x36')](_0x45ae1b[_0xb3c0('0x32')],qs[_0xb3c0('0x38')](_0x28144f[_0xb3c0('0x34')][_0xb3c0('0x38')]));_0x108d4e['attributes']=_0x108d4e[_0xb3c0('0x37')]['length']?_0x108d4e[_0xb3c0('0x37')]:_0x45ae1b[_0xb3c0('0x32')];if(!_0x28144f['query'][_0xb3c0('0x39')](_0xb3c0('0x3a'))){_0x108d4e['limit']=qs[_0xb3c0('0x1e')](_0x28144f['query'][_0xb3c0('0x1e')]);_0x108d4e[_0xb3c0('0x1d')]=qs[_0xb3c0('0x1d')](_0x28144f[_0xb3c0('0x34')][_0xb3c0('0x1d')]);}_0x108d4e[_0xb3c0('0x3b')]=qs[_0xb3c0('0x3c')](_0x28144f['query'][_0xb3c0('0x3c')]);_0x108d4e['where']=qs['filters'](_['pick'](_0x28144f[_0xb3c0('0x34')],_0x45ae1b['filters']),_0x3f5cbd);if(_0x28144f[_0xb3c0('0x34')][_0xb3c0('0x3d')]){_0x108d4e[_0xb3c0('0x3e')]=_[_0xb3c0('0x3f')](_0x108d4e[_0xb3c0('0x3e')],{'$or':_[_0xb3c0('0x2e')](_0x3f5cbd,function(_0x176434){if(_0x176434[_0xb3c0('0x30')]!==_0xb3c0('0x40')){var _0x4d10c1={};_0x4d10c1[_0x176434[_0xb3c0('0x2c')]]={'$like':'%'+_0x28144f['query'][_0xb3c0('0x3d')]+'%'};return _0x4d10c1;}})});}_0x108d4e=_[_0xb3c0('0x3f')]({},_0x108d4e,_0x28144f['options']);var _0x151c78={'where':_0x108d4e[_0xb3c0('0x3e')]};return db[_0xb3c0('0x41')][_0xb3c0('0x20')](_0x151c78)[_0xb3c0('0x27')](function(_0x4904d6){_0x5d74db['count']=_0x4904d6;if(_0x28144f[_0xb3c0('0x34')]['includeAll']){_0x108d4e[_0xb3c0('0x42')]=[{'all':!![]}];}return db[_0xb3c0('0x41')][_0xb3c0('0x43')](_0x108d4e);})['then'](function(_0x5a7319){_0x5d74db[_0xb3c0('0x44')]=_0x5a7319;return _0x5d74db;})['then'](respondWithFilteredResult(_0x558128,_0x108d4e))[_0xb3c0('0x45')](handleError(_0x558128,null));};exports['show']=function(_0x3b3ade,_0x26a5aa){var _0x5b3f52={'raw':!![],'where':{'id':_0x3b3ade[_0xb3c0('0x46')]['id']}},_0x402b06={};_0x402b06[_0xb3c0('0x32')]=_[_0xb3c0('0x33')](db[_0xb3c0('0x41')][_0xb3c0('0x2f')]);_0x402b06[_0xb3c0('0x34')]=_[_0xb3c0('0x33')](_0x3b3ade[_0xb3c0('0x34')]);_0x402b06[_0xb3c0('0x35')]=_[_0xb3c0('0x36')](_0x402b06[_0xb3c0('0x32')],_0x402b06['query']);_0x5b3f52[_0xb3c0('0x37')]=_[_0xb3c0('0x36')](_0x402b06[_0xb3c0('0x32')],qs[_0xb3c0('0x38')](_0x3b3ade[_0xb3c0('0x34')][_0xb3c0('0x38')]));_0x5b3f52[_0xb3c0('0x37')]=_0x5b3f52[_0xb3c0('0x37')]['length']?_0x5b3f52[_0xb3c0('0x37')]:_0x402b06[_0xb3c0('0x32')];if(_0x3b3ade[_0xb3c0('0x34')][_0xb3c0('0x47')]){_0x5b3f52[_0xb3c0('0x42')]=[{'all':!![]}];}_0x5b3f52=_[_0xb3c0('0x3f')]({},_0x5b3f52,_0x3b3ade['options']);return db['FaxTransferReport'][_0xb3c0('0x48')](_0x5b3f52)['then'](handleEntityNotFound(_0x26a5aa,null))['then'](respondWithResult(_0x26a5aa,null))[_0xb3c0('0x45')](handleError(_0x26a5aa,null));};exports['create']=function(_0x50b81e,_0x124e90){return db[_0xb3c0('0x41')]['create'](_0x50b81e[_0xb3c0('0x49')],{})[_0xb3c0('0x27')](respondWithResult(_0x124e90,0xc9))[_0xb3c0('0x45')](handleError(_0x124e90,null));};exports[_0xb3c0('0x26')]=function(_0x57255a,_0x819ef5){if(_0x57255a[_0xb3c0('0x49')]['id']){delete _0x57255a['body']['id'];}return db['FaxTransferReport'][_0xb3c0('0x48')]({'where':{'id':_0x57255a[_0xb3c0('0x46')]['id']}})[_0xb3c0('0x27')](handleEntityNotFound(_0x819ef5,null))['then'](saveUpdates(_0x57255a['body'],null))[_0xb3c0('0x27')](respondWithResult(_0x819ef5,null))[_0xb3c0('0x45')](handleError(_0x819ef5,null));};exports[_0xb3c0('0x28')]=function(_0x5b5610,_0xc708ea){return db[_0xb3c0('0x41')][_0xb3c0('0x48')]({'where':{'id':_0x5b5610[_0xb3c0('0x46')]['id']}})['then'](handleEntityNotFound(_0xc708ea,null))[_0xb3c0('0x27')](removeEntity(_0xc708ea,null))[_0xb3c0('0x45')](handleError(_0xc708ea,null));};exports['describe']=function(_0x3ef124,_0x294004){return db['FaxTransferReport'][_0xb3c0('0x4a')]()[_0xb3c0('0x27')](respondWithResult(_0x294004,null))[_0xb3c0('0x45')](handleError(_0x294004,null));}; \ No newline at end of file +var _0xe847=['Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','model','query','keys','intersection','fields','length','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','includeAll','rows','catch','show','params','attributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x2f0e81,_0x5c62b7){var _0x20d42a=function(_0x3fc1c8){while(--_0x3fc1c8){_0x2f0e81['push'](_0x2f0e81['shift']());}};_0x20d42a(++_0x5c62b7);}(_0xe847,0x1b0));var _0x7e84=function(_0x5e17c9,_0x527a71){_0x5e17c9=_0x5e17c9-0x0;var _0x1aa0d9=_0xe847[_0x5e17c9];return _0x1aa0d9;};'use strict';var emlformat=require(_0x7e84('0x0'));var rimraf=require(_0x7e84('0x1'));var zipdir=require(_0x7e84('0x2'));var jsonpatch=require(_0x7e84('0x3'));var rp=require(_0x7e84('0x4'));var moment=require(_0x7e84('0x5'));var BPromise=require(_0x7e84('0x6'));var Mustache=require(_0x7e84('0x7'));var util=require(_0x7e84('0x8'));var path=require(_0x7e84('0x9'));var sox=require(_0x7e84('0xa'));var csv=require(_0x7e84('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e84('0xc'));var _=require(_0x7e84('0xd'));var squel=require(_0x7e84('0xe'));var crypto=require(_0x7e84('0xf'));var jsforce=require(_0x7e84('0x10'));var deskjs=require(_0x7e84('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7e84('0x12'));var Papa=require(_0x7e84('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e84('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e84('0x15'))(_0x7e84('0x16'));var utils=require(_0x7e84('0x17'));var config=require(_0x7e84('0x18'));var licenseUtil=require(_0x7e84('0x19'));var db=require(_0x7e84('0x1a'))['db'];function respondWithStatusCode(_0x4dc4de,_0x1424ba){_0x1424ba=_0x1424ba||0xcc;return function(_0x2fb533){if(_0x2fb533){return _0x4dc4de[_0x7e84('0x1b')](_0x1424ba);}return _0x4dc4de[_0x7e84('0x1c')](_0x1424ba)[_0x7e84('0x1d')]();};}function respondWithResult(_0x5b726d,_0x3c144e){_0x3c144e=_0x3c144e||0xc8;return function(_0x231584){if(_0x231584){return _0x5b726d[_0x7e84('0x1c')](_0x3c144e)[_0x7e84('0x1e')](_0x231584);}};}function respondWithFilteredResult(_0x3b5ef9,_0x7a1d70){return function(_0x24bd9d){if(_0x24bd9d){var _0x3838c1=typeof _0x7a1d70[_0x7e84('0x1f')]===_0x7e84('0x20')&&typeof _0x7a1d70[_0x7e84('0x21')]==='undefined';var _0x41788e=_0x24bd9d[_0x7e84('0x22')];var _0x1e0cae=_0x3838c1?0x0:_0x7a1d70[_0x7e84('0x1f')];var _0x1ca530=_0x3838c1?_0x24bd9d[_0x7e84('0x22')]:_0x7a1d70[_0x7e84('0x1f')]+_0x7a1d70[_0x7e84('0x21')];var _0xfcca95;if(_0x1ca530>=_0x41788e){_0x1ca530=_0x41788e;_0xfcca95=0xc8;}else{_0xfcca95=0xce;}_0x3b5ef9[_0x7e84('0x1c')](_0xfcca95);return _0x3b5ef9[_0x7e84('0x23')](_0x7e84('0x24'),_0x1e0cae+'-'+_0x1ca530+'/'+_0x41788e)['json'](_0x24bd9d);}return null;};}function patchUpdates(_0x239036){return function(_0x69eee9){try{jsonpatch['apply'](_0x69eee9,_0x239036,!![]);}catch(_0x2546c2){return BPromise[_0x7e84('0x25')](_0x2546c2);}return _0x69eee9[_0x7e84('0x26')]();};}function saveUpdates(_0x5e79cc,_0x3d235a){return function(_0x55a2aa){if(_0x55a2aa){return _0x55a2aa[_0x7e84('0x27')](_0x5e79cc)[_0x7e84('0x28')](function(_0x1fc76a){return _0x1fc76a;});}return null;};}function removeEntity(_0x5c7da0,_0x39f19a){return function(_0x5a557a){if(_0x5a557a){return _0x5a557a[_0x7e84('0x29')]()[_0x7e84('0x28')](function(){_0x5c7da0['status'](0xcc)[_0x7e84('0x1d')]();});}};}function handleEntityNotFound(_0x193bf5,_0x3c3d51){return function(_0x47ca1a){if(!_0x47ca1a){_0x193bf5[_0x7e84('0x1b')](0x194);}return _0x47ca1a;};}function handleError(_0x51a7f6,_0x164de1){_0x164de1=_0x164de1||0x1f4;return function(_0x31a069){logger[_0x7e84('0x2a')](_0x31a069[_0x7e84('0x2b')]);if(_0x31a069[_0x7e84('0x2c')]){delete _0x31a069[_0x7e84('0x2c')];}_0x51a7f6[_0x7e84('0x1c')](_0x164de1)[_0x7e84('0x2d')](_0x31a069);};}exports[_0x7e84('0x2e')]=function(_0x4ac88f,_0x1b7908){var _0x5a5ee6={},_0xa5214a={},_0x19d492={'count':0x0,'rows':[]};var _0x1421b4=_[_0x7e84('0x2f')](db[_0x7e84('0x30')][_0x7e84('0x31')],function(_0x521b84){return{'name':_0x521b84[_0x7e84('0x32')],'type':_0x521b84['type']['key']};});_0xa5214a[_0x7e84('0x33')]=_[_0x7e84('0x2f')](_0x1421b4,'name');_0xa5214a[_0x7e84('0x34')]=_[_0x7e84('0x35')](_0x4ac88f[_0x7e84('0x34')]);_0xa5214a['filters']=_['intersection'](_0xa5214a[_0x7e84('0x33')],_0xa5214a['query']);_0x5a5ee6['attributes']=_[_0x7e84('0x36')](_0xa5214a[_0x7e84('0x33')],qs[_0x7e84('0x37')](_0x4ac88f[_0x7e84('0x34')][_0x7e84('0x37')]));_0x5a5ee6['attributes']=_0x5a5ee6['attributes'][_0x7e84('0x38')]?_0x5a5ee6['attributes']:_0xa5214a['model'];if(!_0x4ac88f[_0x7e84('0x34')]['hasOwnProperty'](_0x7e84('0x39'))){_0x5a5ee6[_0x7e84('0x21')]=qs[_0x7e84('0x21')](_0x4ac88f[_0x7e84('0x34')][_0x7e84('0x21')]);_0x5a5ee6['offset']=qs[_0x7e84('0x1f')](_0x4ac88f['query'][_0x7e84('0x1f')]);}_0x5a5ee6[_0x7e84('0x3a')]=qs['sort'](_0x4ac88f[_0x7e84('0x34')][_0x7e84('0x3b')]);_0x5a5ee6[_0x7e84('0x3c')]=qs[_0x7e84('0x3d')](_[_0x7e84('0x3e')](_0x4ac88f[_0x7e84('0x34')],_0xa5214a['filters']),_0x1421b4);if(_0x4ac88f[_0x7e84('0x34')]['filter']){_0x5a5ee6[_0x7e84('0x3c')]=_['merge'](_0x5a5ee6[_0x7e84('0x3c')],{'$or':_[_0x7e84('0x2f')](_0x1421b4,function(_0x79a61a){if(_0x79a61a[_0x7e84('0x3f')]!==_0x7e84('0x40')){var _0x854350={};_0x854350[_0x79a61a[_0x7e84('0x2c')]]={'$like':'%'+_0x4ac88f[_0x7e84('0x34')][_0x7e84('0x41')]+'%'};return _0x854350;}})});}_0x5a5ee6=_[_0x7e84('0x42')]({},_0x5a5ee6,_0x4ac88f['options']);var _0x37aa27={'where':_0x5a5ee6[_0x7e84('0x3c')]};return db[_0x7e84('0x30')][_0x7e84('0x22')](_0x37aa27)[_0x7e84('0x28')](function(_0x4fcf1a){_0x19d492['count']=_0x4fcf1a;if(_0x4ac88f[_0x7e84('0x34')][_0x7e84('0x43')]){_0x5a5ee6['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x5a5ee6);})[_0x7e84('0x28')](function(_0x53f8c7){_0x19d492[_0x7e84('0x44')]=_0x53f8c7;return _0x19d492;})[_0x7e84('0x28')](respondWithFilteredResult(_0x1b7908,_0x5a5ee6))[_0x7e84('0x45')](handleError(_0x1b7908,null));};exports[_0x7e84('0x46')]=function(_0x57e96f,_0x1c8097){var _0x5b0587={'raw':!![],'where':{'id':_0x57e96f[_0x7e84('0x47')]['id']}},_0x5c3c3c={};_0x5c3c3c[_0x7e84('0x33')]=_[_0x7e84('0x35')](db['FaxTransferReport'][_0x7e84('0x31')]);_0x5c3c3c[_0x7e84('0x34')]=_['keys'](_0x57e96f[_0x7e84('0x34')]);_0x5c3c3c['filters']=_['intersection'](_0x5c3c3c[_0x7e84('0x33')],_0x5c3c3c[_0x7e84('0x34')]);_0x5b0587[_0x7e84('0x48')]=_[_0x7e84('0x36')](_0x5c3c3c[_0x7e84('0x33')],qs[_0x7e84('0x37')](_0x57e96f['query'][_0x7e84('0x37')]));_0x5b0587[_0x7e84('0x48')]=_0x5b0587[_0x7e84('0x48')][_0x7e84('0x38')]?_0x5b0587['attributes']:_0x5c3c3c['model'];if(_0x57e96f[_0x7e84('0x34')][_0x7e84('0x43')]){_0x5b0587['include']=[{'all':!![]}];}_0x5b0587=_[_0x7e84('0x42')]({},_0x5b0587,_0x57e96f[_0x7e84('0x49')]);return db[_0x7e84('0x30')][_0x7e84('0x4a')](_0x5b0587)['then'](handleEntityNotFound(_0x1c8097,null))[_0x7e84('0x28')](respondWithResult(_0x1c8097,null))['catch'](handleError(_0x1c8097,null));};exports[_0x7e84('0x4b')]=function(_0xb1d3e4,_0x2f2d10){return db[_0x7e84('0x30')][_0x7e84('0x4b')](_0xb1d3e4['body'],{})[_0x7e84('0x28')](respondWithResult(_0x2f2d10,0xc9))['catch'](handleError(_0x2f2d10,null));};exports[_0x7e84('0x27')]=function(_0x1e747c,_0x438b27){if(_0x1e747c[_0x7e84('0x4c')]['id']){delete _0x1e747c['body']['id'];}return db[_0x7e84('0x30')][_0x7e84('0x4a')]({'where':{'id':_0x1e747c[_0x7e84('0x47')]['id']}})['then'](handleEntityNotFound(_0x438b27,null))[_0x7e84('0x28')](saveUpdates(_0x1e747c['body'],null))[_0x7e84('0x28')](respondWithResult(_0x438b27,null))[_0x7e84('0x45')](handleError(_0x438b27,null));};exports[_0x7e84('0x29')]=function(_0x59bf86,_0x52f806){return db['FaxTransferReport'][_0x7e84('0x4a')]({'where':{'id':_0x59bf86[_0x7e84('0x47')]['id']}})[_0x7e84('0x28')](handleEntityNotFound(_0x52f806,null))[_0x7e84('0x28')](removeEntity(_0x52f806,null))['catch'](handleError(_0x52f806,null));};exports[_0x7e84('0x4d')]=function(_0x55702a,_0x25ee44){return db['FaxTransferReport']['describe']()['then'](respondWithResult(_0x25ee44,null))[_0x7e84('0x45')](handleError(_0x25ee44,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 58770ff..1685750 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 _0x8f37=['request-promise','rimraf','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','util','moment','bluebird'];(function(_0x115175,_0x262286){var _0x532de1=function(_0x24f1fe){while(--_0x24f1fe){_0x115175['push'](_0x115175['shift']());}};_0x532de1(++_0x262286);}(_0x8f37,0x100));var _0x78f3=function(_0x212981,_0x617863){_0x212981=_0x212981-0x0;var _0x175797=_0x8f37[_0x212981];return _0x175797;};'use strict';var _=require(_0x78f3('0x0'));var util=require(_0x78f3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x78f3('0x2'));var BPromise=require(_0x78f3('0x3'));var rp=require(_0x78f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x78f3('0x6'));module['exports']=function(_0x2ff2d5,_0x9807a5){return _0x2ff2d5[_0x78f3('0x7')]('FaxTransferReport',attributes,{'tableName':_0x78f3('0x8'),'paranoid':![],'indexes':[{'name':_0x78f3('0x9'),'fields':[_0x78f3('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b22=['./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','lodash','api','moment','request-promise','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b22,0x67));var _0x27b2=function(_0x130209,_0x2cc129){_0x130209=_0x130209-0x0;var _0x155fb7=_0x7b22[_0x130209];return _0x155fb7;};'use strict';var _=require(_0x27b2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x27b2('0x1'));var moment=require(_0x27b2('0x2'));var BPromise=require('bluebird');var rp=require(_0x27b2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x27b2('0x4'));var attributes=require(_0x27b2('0x5'));module['exports']=function(_0x14e786,_0x1db1bf){return _0x14e786[_0x27b2('0x6')](_0x27b2('0x7'),attributes,{'tableName':_0x27b2('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 03ff0c7..dd031bc 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 _0xd8cc=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','code','error','FaxTransferReport,\x20%s,\x20%s','message','result','catch','util'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0xd8cc,0x1f3));var _0xcd8c=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0xd8cc[_0x1d2bbb];return _0x38082b;};'use strict';var _=require('lodash');var util=require(_0xcd8c('0x0'));var moment=require('moment');var BPromise=require(_0xcd8c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd8c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd8c('0x3'));var logger=require('../../config/logger')(_0xcd8c('0x4'));var config=require(_0xcd8c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcd8c('0x6')][_0xcd8c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e6df5,_0x3081f9,_0x25faa8){return new BPromise(function(_0xbdf67d,_0x7f0445){return client[_0xcd8c('0x8')](_0x4e6df5,_0x25faa8)[_0xcd8c('0x9')](function(_0x362a9e){logger[_0xcd8c('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x3081f9,'request\x20sent');logger[_0xcd8c('0xb')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x3081f9,_0xcd8c('0xc'),JSON[_0xcd8c('0xd')](_0x362a9e));if(_0x362a9e['error']){if(_0x362a9e['error'][_0xcd8c('0xe')]===0x1f4){logger[_0xcd8c('0xf')](_0xcd8c('0x10'),_0x3081f9,_0x362a9e[_0xcd8c('0xf')][_0xcd8c('0x11')]);return _0x7f0445(_0x362a9e[_0xcd8c('0xf')]['message']);}logger['error'](_0xcd8c('0x10'),_0x3081f9,_0x362a9e['error']['message']);return _0xbdf67d(_0x362a9e[_0xcd8c('0xf')][_0xcd8c('0x11')]);}else{logger[_0xcd8c('0xa')](_0xcd8c('0x10'),_0x3081f9,'request\x20sent');_0xbdf67d(_0x362a9e[_0xcd8c('0x12')]['message']);}})[_0xcd8c('0x13')](function(_0x46725a){logger[_0xcd8c('0xf')](_0xcd8c('0x10'),_0x3081f9,_0x46725a);_0x7f0445(_0x46725a);});});} \ No newline at end of file +var _0x89ae=['code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x55ccb7,_0x2f7889){var _0x19e52f=function(_0x3c0893){while(--_0x3c0893){_0x55ccb7['push'](_0x55ccb7['shift']());}};_0x19e52f(++_0x2f7889);}(_0x89ae,0xbd));var _0xe89a=function(_0x2f2377,_0x11cc21){_0x2f2377=_0x2f2377-0x0;var _0x441e6b=_0x89ae[_0x2f2377];return _0x441e6b;};'use strict';var _=require(_0xe89a('0x0'));var util=require('util');var moment=require(_0xe89a('0x1'));var BPromise=require(_0xe89a('0x2'));var rs=require(_0xe89a('0x3'));var fs=require('fs');var Redis=require(_0xe89a('0x4'));var db=require(_0xe89a('0x5'))['db'];var utils=require(_0xe89a('0x6'));var logger=require(_0xe89a('0x7'))(_0xe89a('0x8'));var config=require('../../config/environment');var jayson=require(_0xe89a('0x9'));var client=jayson[_0xe89a('0xa')][_0xe89a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435235,_0x51d05d,_0x1940a6){return new BPromise(function(_0xa2bcc0,_0x560d3b){return client[_0xe89a('0xc')](_0x435235,_0x1940a6)['then'](function(_0x270981){logger['info'](_0xe89a('0xd'),_0x51d05d,'request\x20sent');logger[_0xe89a('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x51d05d,_0xe89a('0xf'),JSON[_0xe89a('0x10')](_0x270981));if(_0x270981['error']){if(_0x270981[_0xe89a('0x11')][_0xe89a('0x12')]===0x1f4){logger[_0xe89a('0x11')](_0xe89a('0xd'),_0x51d05d,_0x270981[_0xe89a('0x11')][_0xe89a('0x13')]);return _0x560d3b(_0x270981['error']['message']);}logger[_0xe89a('0x11')](_0xe89a('0xd'),_0x51d05d,_0x270981[_0xe89a('0x11')]['message']);return _0xa2bcc0(_0x270981[_0xe89a('0x11')][_0xe89a('0x13')]);}else{logger[_0xe89a('0x14')](_0xe89a('0xd'),_0x51d05d,_0xe89a('0xf'));_0xa2bcc0(_0x270981[_0xe89a('0x15')]['message']);}})[_0xe89a('0x16')](function(_0x1e4a4c){logger[_0xe89a('0x11')](_0xe89a('0xd'),_0x51d05d,_0x1e4a4c);_0x560d3b(_0x1e4a4c);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index bc8f010..7e279e7 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 _0xbea2=['post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe'];(function(_0x8d534d,_0x2a7443){var _0x159841=function(_0x1a404f){while(--_0x1a404f){_0x8d534d['push'](_0x8d534d['shift']());}};_0x159841(++_0x2a7443);}(_0xbea2,0x15c));var _0x2bea=function(_0x4b930a,_0x15f8fd){_0x4b930a=_0x4b930a-0x0;var _0x4b1a54=_0xbea2[_0x4b930a];return _0x4b1a54;};'use strict';var multer=require(_0x2bea('0x0'));var util=require(_0x2bea('0x1'));var path=require(_0x2bea('0x2'));var timeout=require(_0x2bea('0x3'));var express=require('express');var router=express[_0x2bea('0x4')]();var fs_extra=require(_0x2bea('0x5'));var auth=require(_0x2bea('0x6'));var interaction=require(_0x2bea('0x7'));var config=require(_0x2bea('0x8'));var controller=require('./faxTransferReport.controller');router[_0x2bea('0x9')]('/',auth[_0x2bea('0xa')](),controller['index']);router['get']('/describe',auth[_0x2bea('0xa')](),controller[_0x2bea('0xb')]);router['get']('/:id',auth[_0x2bea('0xa')](),controller['show']);router[_0x2bea('0xc')]('/',auth['isAuthenticated'](),controller[_0x2bea('0xd')]);router['put'](_0x2bea('0xe'),auth['isAuthenticated'](),controller[_0x2bea('0xf')]);router['delete'](_0x2bea('0xe'),auth[_0x2bea('0xa')](),controller[_0x2bea('0x10')]);module[_0x2bea('0x11')]=router; \ No newline at end of file +var _0xb39b=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0xb39b,0x1d4));var _0xbb39=function(_0x1a4c27,_0x16e7b1){_0x1a4c27=_0x1a4c27-0x0;var _0x529bbd=_0xb39b[_0x1a4c27];return _0x529bbd;};'use strict';var multer=require(_0xbb39('0x0'));var util=require(_0xbb39('0x1'));var path=require(_0xbb39('0x2'));var timeout=require(_0xbb39('0x3'));var express=require(_0xbb39('0x4'));var router=express['Router']();var fs_extra=require(_0xbb39('0x5'));var auth=require(_0xbb39('0x6'));var interaction=require(_0xbb39('0x7'));var config=require(_0xbb39('0x8'));var controller=require(_0xbb39('0x9'));router[_0xbb39('0xa')]('/',auth['isAuthenticated'](),controller[_0xbb39('0xb')]);router[_0xbb39('0xa')](_0xbb39('0xc'),auth[_0xbb39('0xd')](),controller[_0xbb39('0xe')]);router[_0xbb39('0xa')](_0xbb39('0xf'),auth[_0xbb39('0xd')](),controller[_0xbb39('0x10')]);router[_0xbb39('0x11')]('/',auth[_0xbb39('0xd')](),controller[_0xbb39('0x12')]);router[_0xbb39('0x13')](_0xbb39('0xf'),auth[_0xbb39('0xd')](),controller['update']);router[_0xbb39('0x14')](_0xbb39('0xf'),auth[_0xbb39('0xd')](),controller[_0xbb39('0x15')]);module[_0xbb39('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 106734c..21c92a7 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 _0x014b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','create','post','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x51b1d9,_0x18c04a){var _0xf1bc97=function(_0x418929){while(--_0x418929){_0x51b1d9['push'](_0x51b1d9['shift']());}};_0xf1bc97(++_0x18c04a);}(_0x014b,0x11b));var _0xb014=function(_0x3eb4bb,_0x1b1c6d){_0x3eb4bb=_0x3eb4bb-0x0;var _0xa9427d=_0x014b[_0x3eb4bb];return _0xa9427d;};'use strict';var multer=require(_0xb014('0x0'));var util=require(_0xb014('0x1'));var path=require('path');var timeout=require(_0xb014('0x2'));var express=require('express');var router=express[_0xb014('0x3')]();var fs_extra=require(_0xb014('0x4'));var auth=require(_0xb014('0x5'));var interaction=require(_0xb014('0x6'));var config=require(_0xb014('0x7'));var controller=require(_0xb014('0x8'));router['get']('/',auth[_0xb014('0x9')](),controller[_0xb014('0xa')]);router[_0xb014('0xb')]('/:id',auth[_0xb014('0x9')](),controller[_0xb014('0xc')]);router[_0xb014('0xb')](_0xb014('0xd'),auth[_0xb014('0x9')](),controller[_0xb014('0xe')]);router['get'](_0xb014('0xf'),auth[_0xb014('0x9')](),controller['getFields']);router['post']('/',auth[_0xb014('0x9')](),controller[_0xb014('0x10')]);router[_0xb014('0x11')](_0xb014('0xd'),auth[_0xb014('0x9')](),controller['addConfiguration']);router[_0xb014('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb014('0x13')]);router[_0xb014('0x14')](_0xb014('0x15'),auth[_0xb014('0x9')](),controller[_0xb014('0x16')]);module[_0xb014('0x17')]=router; \ No newline at end of file +var _0xba38=['post','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x28aef4,_0x5e4e2e){var _0x1f0ec7=function(_0x295673){while(--_0x295673){_0x28aef4['push'](_0x28aef4['shift']());}};_0x1f0ec7(++_0x5e4e2e);}(_0xba38,0x119));var _0x8ba3=function(_0x412358,_0x1e3ebd){_0x412358=_0x412358-0x0;var _0xe7daaf=_0xba38[_0x412358];return _0xe7daaf;};'use strict';var multer=require(_0x8ba3('0x0'));var util=require(_0x8ba3('0x1'));var path=require(_0x8ba3('0x2'));var timeout=require(_0x8ba3('0x3'));var express=require(_0x8ba3('0x4'));var router=express[_0x8ba3('0x5')]();var fs_extra=require(_0x8ba3('0x6'));var auth=require(_0x8ba3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ba3('0x8'));var controller=require('./intDeskAccount.controller');router[_0x8ba3('0x9')]('/',auth[_0x8ba3('0xa')](),controller[_0x8ba3('0xb')]);router['get'](_0x8ba3('0xc'),auth[_0x8ba3('0xa')](),controller[_0x8ba3('0xd')]);router[_0x8ba3('0x9')](_0x8ba3('0xe'),auth['isAuthenticated'](),controller[_0x8ba3('0xf')]);router[_0x8ba3('0x9')](_0x8ba3('0x10'),auth[_0x8ba3('0xa')](),controller[_0x8ba3('0x11')]);router[_0x8ba3('0x12')]('/',auth[_0x8ba3('0xa')](),controller['create']);router[_0x8ba3('0x12')](_0x8ba3('0xe'),auth[_0x8ba3('0xa')](),controller[_0x8ba3('0x13')]);router['put'](_0x8ba3('0xc'),auth[_0x8ba3('0xa')](),controller[_0x8ba3('0x14')]);router[_0x8ba3('0x15')](_0x8ba3('0xc'),auth[_0x8ba3('0xa')](),controller[_0x8ba3('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e5c3686..25843cb 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 _0x9562=['ENUM','basic','integrationTab','newTab','sequelize','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9562,0x18a));var _0x2956=function(_0x423a98,_0x16020f){_0x423a98=_0x423a98-0x0;var _0x1350c0=_0x9562[_0x423a98];return _0x1350c0;};'use strict';var Sequelize=require(_0x2956('0x0'));module['exports']={'name':{'type':Sequelize[_0x2956('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2956('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x2956('0x2')]('basic'),'defaultValue':_0x2956('0x3')},'password':{'type':Sequelize[_0x2956('0x1')]},'consumerKey':{'type':Sequelize[_0x2956('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2956('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2956('0x2')](_0x2956('0x4'),_0x2956('0x5')),'defaultValue':_0x2956('0x4')}}; \ No newline at end of file +var _0x552a=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x5da337,_0x3a55fb){var _0x3dd702=function(_0x1ab70f){while(--_0x1ab70f){_0x5da337['push'](_0x5da337['shift']());}};_0x3dd702(++_0x3a55fb);}(_0x552a,0x9e));var _0xa552=function(_0x55a619,_0x5916d0){_0x55a619=_0x55a619-0x0;var _0x3365c6=_0x552a[_0x55a619];return _0x3365c6;};'use strict';var Sequelize=require(_0xa552('0x0'));module[_0xa552('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa552('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa552('0x2')]},'authType':{'type':Sequelize[_0xa552('0x3')](_0xa552('0x4')),'defaultValue':_0xa552('0x4')},'password':{'type':Sequelize[_0xa552('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa552('0x2')]},'tokenSecret':{'type':Sequelize[_0xa552('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa552('0x5'),_0xa552('0x6')),'defaultValue':_0xa552('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 67ae599..8850587 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 _0x7b31=['merge','include','findAll','rows','catch','params','options','find','create','body','getConfigurations','findOne','DeskConfiguration','order','pick','nolimit','addConfiguration','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','authType','password','token','tokenSecret','remoteUri','slice','substring','GET','format','application/json','headers','Authorization','Basic\x20%s','username','toString','base64','concat','_embedded','entries','label','test','statusCode','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','VIRTUAL','filter'];(function(_0x18b7ea,_0xe7ae52){var _0x10b3dc=function(_0x3e0344){while(--_0x3e0344){_0x18b7ea['push'](_0x18b7ea['shift']());}};_0x10b3dc(++_0xe7ae52);}(_0x7b31,0x1f0));var _0x17b3=function(_0x13980c,_0x5ea740){_0x13980c=_0x13980c-0x0;var _0x20a110=_0x7b31[_0x13980c];return _0x20a110;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x17b3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x17b3('0x1'));var moment=require(_0x17b3('0x2'));var BPromise=require(_0x17b3('0x3'));var Mustache=require(_0x17b3('0x4'));var util=require('util');var path=require(_0x17b3('0x5'));var sox=require(_0x17b3('0x6'));var csv=require(_0x17b3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x17b3('0x8'));var _=require(_0x17b3('0x9'));var squel=require(_0x17b3('0xa'));var crypto=require('crypto');var jsforce=require(_0x17b3('0xb'));var deskjs=require(_0x17b3('0xc'));var toCsv=require(_0x17b3('0x7'));var querystring=require(_0x17b3('0xd'));var Papa=require(_0x17b3('0xe'));var Redis=require(_0x17b3('0xf'));var authService=require(_0x17b3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x17b3('0x11'));var hardwareService=require(_0x17b3('0x12'));var logger=require(_0x17b3('0x13'))(_0x17b3('0x14'));var utils=require('../../config/utils');var config=require(_0x17b3('0x15'));var licenseUtil=require(_0x17b3('0x16'));var db=require(_0x17b3('0x17'))['db'];var integrations=require(_0x17b3('0x18'));function respondWithStatusCode(_0x52b787,_0x2f08b0){_0x2f08b0=_0x2f08b0||0xcc;return function(_0xb45506){if(_0xb45506){return _0x52b787['sendStatus'](_0x2f08b0);}return _0x52b787[_0x17b3('0x19')](_0x2f08b0)[_0x17b3('0x1a')]();};}function respondWithResult(_0x343ce0,_0x236e04){_0x236e04=_0x236e04||0xc8;return function(_0x2a5044){if(_0x2a5044){return _0x343ce0[_0x17b3('0x19')](_0x236e04)[_0x17b3('0x1b')](_0x2a5044);}};}function respondWithFilteredResult(_0x4f9827,_0x2add14){return function(_0x401cdc){if(_0x401cdc){var _0x1f0ffa=typeof _0x2add14[_0x17b3('0x1c')]==='undefined'&&typeof _0x2add14['limit']===_0x17b3('0x1d');var _0x125995=_0x401cdc[_0x17b3('0x1e')];var _0x43018=_0x1f0ffa?0x0:_0x2add14[_0x17b3('0x1c')];var _0x304506=_0x1f0ffa?_0x401cdc[_0x17b3('0x1e')]:_0x2add14[_0x17b3('0x1c')]+_0x2add14[_0x17b3('0x1f')];var _0x1fb81c;if(_0x304506>=_0x125995){_0x304506=_0x125995;_0x1fb81c=0xc8;}else{_0x1fb81c=0xce;}_0x4f9827[_0x17b3('0x19')](_0x1fb81c);return _0x4f9827['set'](_0x17b3('0x20'),_0x43018+'-'+_0x304506+'/'+_0x125995)[_0x17b3('0x1b')](_0x401cdc);}return null;};}function patchUpdates(_0x54dcc6){return function(_0x3087ad){try{jsonpatch[_0x17b3('0x21')](_0x3087ad,_0x54dcc6,!![]);}catch(_0x7f3721){return BPromise[_0x17b3('0x22')](_0x7f3721);}return _0x3087ad[_0x17b3('0x23')]();};}function saveUpdates(_0x37c31c,_0x476a95){return function(_0x25a12b){if(_0x25a12b){return _0x25a12b[_0x17b3('0x24')](_0x37c31c)[_0x17b3('0x25')](function(_0xce03e4){return _0xce03e4;});}return null;};}function removeEntity(_0x575bc5,_0x1d987b){return function(_0x5143b5){if(_0x5143b5){return _0x5143b5[_0x17b3('0x26')]()[_0x17b3('0x25')](function(){_0x575bc5[_0x17b3('0x19')](0xcc)[_0x17b3('0x1a')]();});}};}function handleEntityNotFound(_0xd88e76,_0x18a279){return function(_0x257493){if(!_0x257493){_0xd88e76[_0x17b3('0x27')](0x194);}return _0x257493;};}function handleError(_0x9cefb2,_0x54d6c7){_0x54d6c7=_0x54d6c7||0x1f4;return function(_0x2d9eb6){logger[_0x17b3('0x28')](_0x2d9eb6[_0x17b3('0x29')]);if(_0x2d9eb6['name']){delete _0x2d9eb6[_0x17b3('0x2a')];}_0x9cefb2[_0x17b3('0x19')](_0x54d6c7)[_0x17b3('0x2b')](_0x2d9eb6);};}exports[_0x17b3('0x2c')]=function(_0x2afae6,_0x15be93){var _0x143aeb={},_0x3df574={},_0x581ed7={'count':0x0,'rows':[]};var _0x11d5a7=_[_0x17b3('0x2d')](db[_0x17b3('0x2e')][_0x17b3('0x2f')],function(_0x35a5d1){return{'name':_0x35a5d1[_0x17b3('0x30')],'type':_0x35a5d1[_0x17b3('0x31')][_0x17b3('0x32')]};});_0x3df574[_0x17b3('0x33')]=_[_0x17b3('0x2d')](_0x11d5a7,'name');_0x3df574['query']=_[_0x17b3('0x34')](_0x2afae6['query']);_0x3df574[_0x17b3('0x35')]=_['intersection'](_0x3df574[_0x17b3('0x33')],_0x3df574[_0x17b3('0x36')]);_0x143aeb[_0x17b3('0x37')]=_[_0x17b3('0x38')](_0x3df574[_0x17b3('0x33')],qs[_0x17b3('0x39')](_0x2afae6[_0x17b3('0x36')][_0x17b3('0x39')]));_0x143aeb[_0x17b3('0x37')]=_0x143aeb[_0x17b3('0x37')][_0x17b3('0x3a')]?_0x143aeb[_0x17b3('0x37')]:_0x3df574[_0x17b3('0x33')];if(!_0x2afae6[_0x17b3('0x36')][_0x17b3('0x3b')]('nolimit')){_0x143aeb[_0x17b3('0x1f')]=qs['limit'](_0x2afae6[_0x17b3('0x36')]['limit']);_0x143aeb[_0x17b3('0x1c')]=qs[_0x17b3('0x1c')](_0x2afae6['query'][_0x17b3('0x1c')]);}_0x143aeb['order']=qs[_0x17b3('0x3c')](_0x2afae6[_0x17b3('0x36')]['sort']);_0x143aeb[_0x17b3('0x3d')]=qs[_0x17b3('0x35')](_['pick'](_0x2afae6[_0x17b3('0x36')],_0x3df574[_0x17b3('0x35')]),_0x11d5a7);if(_0x2afae6[_0x17b3('0x36')]['filter']){_0x143aeb[_0x17b3('0x3d')]=_['merge'](_0x143aeb['where'],{'$or':_['map'](_0x11d5a7,function(_0x52c37d){if(_0x52c37d[_0x17b3('0x31')]!==_0x17b3('0x3e')){var _0xc143fe={};_0xc143fe[_0x52c37d[_0x17b3('0x2a')]]={'$like':'%'+_0x2afae6['query'][_0x17b3('0x3f')]+'%'};return _0xc143fe;}})});}_0x143aeb=_[_0x17b3('0x40')]({},_0x143aeb,_0x2afae6['options']);var _0x4e83ad={'where':_0x143aeb[_0x17b3('0x3d')]};return db[_0x17b3('0x2e')][_0x17b3('0x1e')](_0x4e83ad)[_0x17b3('0x25')](function(_0xcbc0bc){_0x581ed7['count']=_0xcbc0bc;if(_0x2afae6[_0x17b3('0x36')]['includeAll']){_0x143aeb[_0x17b3('0x41')]=[{'all':!![]}];}return db['DeskAccount'][_0x17b3('0x42')](_0x143aeb);})[_0x17b3('0x25')](function(_0x2bf749){_0x581ed7[_0x17b3('0x43')]=_0x2bf749;return _0x581ed7;})[_0x17b3('0x25')](respondWithFilteredResult(_0x15be93,_0x143aeb))[_0x17b3('0x44')](handleError(_0x15be93,null));};exports['show']=function(_0x4748a9,_0x1d3ed2){var _0x105b64={'raw':![],'where':{'id':_0x4748a9[_0x17b3('0x45')]['id']}},_0x57abad={};_0x57abad[_0x17b3('0x33')]=_['keys'](db[_0x17b3('0x2e')]['rawAttributes']);_0x57abad[_0x17b3('0x36')]=_[_0x17b3('0x34')](_0x4748a9[_0x17b3('0x36')]);_0x57abad['filters']=_[_0x17b3('0x38')](_0x57abad[_0x17b3('0x33')],_0x57abad['query']);_0x105b64[_0x17b3('0x37')]=_[_0x17b3('0x38')](_0x57abad[_0x17b3('0x33')],qs[_0x17b3('0x39')](_0x4748a9['query'][_0x17b3('0x39')]));_0x105b64[_0x17b3('0x37')]=_0x105b64[_0x17b3('0x37')][_0x17b3('0x3a')]?_0x105b64[_0x17b3('0x37')]:_0x57abad[_0x17b3('0x33')];if(_0x4748a9[_0x17b3('0x36')]['includeAll']){_0x105b64[_0x17b3('0x41')]=[{'all':!![]}];}_0x105b64=_['merge']({},_0x105b64,_0x4748a9[_0x17b3('0x46')]);return db[_0x17b3('0x2e')][_0x17b3('0x47')](_0x105b64)[_0x17b3('0x25')](handleEntityNotFound(_0x1d3ed2,null))[_0x17b3('0x25')](respondWithResult(_0x1d3ed2,null))[_0x17b3('0x44')](handleError(_0x1d3ed2,null));};exports[_0x17b3('0x48')]=function(_0x515863,_0x59150d){return db[_0x17b3('0x2e')][_0x17b3('0x48')](_0x515863['body'],{})[_0x17b3('0x25')](respondWithResult(_0x59150d,0xc9))['catch'](handleError(_0x59150d,null));};exports['update']=function(_0x36c9a7,_0x437ac1){if(_0x36c9a7['body']['id']){delete _0x36c9a7[_0x17b3('0x49')]['id'];}return db[_0x17b3('0x2e')][_0x17b3('0x47')]({'where':{'id':_0x36c9a7['params']['id']}})[_0x17b3('0x25')](handleEntityNotFound(_0x437ac1,null))[_0x17b3('0x25')](saveUpdates(_0x36c9a7[_0x17b3('0x49')],null))[_0x17b3('0x25')](respondWithResult(_0x437ac1,null))[_0x17b3('0x44')](handleError(_0x437ac1,null));};exports[_0x17b3('0x26')]=function(_0x19b8b9,_0x19ab96){return db[_0x17b3('0x2e')][_0x17b3('0x47')]({'where':{'id':_0x19b8b9[_0x17b3('0x45')]['id']}})[_0x17b3('0x25')](handleEntityNotFound(_0x19ab96,null))[_0x17b3('0x25')](removeEntity(_0x19ab96,null))[_0x17b3('0x44')](handleError(_0x19ab96,null));};exports[_0x17b3('0x4a')]=function(_0x16d5b4,_0x6a5f8a,_0x3aa674){var _0x41d6ce={};var _0x51bf49={};var _0x4e582d;var _0xfc25b3;return db['DeskAccount'][_0x17b3('0x4b')]({'where':{'id':_0x16d5b4['params']['id']}})['then'](handleEntityNotFound(_0x6a5f8a,null))[_0x17b3('0x25')](function(_0x53d4eb){if(_0x53d4eb){_0x4e582d=_0x53d4eb;_0x51bf49[_0x17b3('0x33')]=_[_0x17b3('0x34')](db[_0x17b3('0x4c')][_0x17b3('0x2f')]);_0x51bf49[_0x17b3('0x36')]=_[_0x17b3('0x34')](_0x16d5b4[_0x17b3('0x36')]);_0x51bf49[_0x17b3('0x35')]=_[_0x17b3('0x38')](_0x51bf49[_0x17b3('0x33')],_0x51bf49['query']);_0x41d6ce[_0x17b3('0x37')]=_[_0x17b3('0x38')](_0x51bf49[_0x17b3('0x33')],qs[_0x17b3('0x39')](_0x16d5b4[_0x17b3('0x36')]['fields']));_0x41d6ce['attributes']=_0x41d6ce[_0x17b3('0x37')][_0x17b3('0x3a')]?_0x41d6ce[_0x17b3('0x37')]:_0x51bf49[_0x17b3('0x33')];_0x41d6ce[_0x17b3('0x4d')]=qs[_0x17b3('0x3c')](_0x16d5b4[_0x17b3('0x36')]['sort']);_0x41d6ce['where']=qs['filters'](_[_0x17b3('0x4e')](_0x16d5b4[_0x17b3('0x36')],_0x51bf49[_0x17b3('0x35')]));if(_0x16d5b4[_0x17b3('0x36')][_0x17b3('0x3f')]){_0x41d6ce['where']=_[_0x17b3('0x40')](_0x41d6ce[_0x17b3('0x3d')],{'$or':_['map'](_0x41d6ce[_0x17b3('0x37')],function(_0x4d02ff){var _0x221c15={};_0x221c15[_0x4d02ff]={'$like':'%'+_0x16d5b4[_0x17b3('0x36')]['filter']+'%'};return _0x221c15;})});}_0x41d6ce=_['merge']({},_0x41d6ce,_0x16d5b4[_0x17b3('0x46')]);return _0x4e582d[_0x17b3('0x4a')](_0x41d6ce);}})[_0x17b3('0x25')](function(_0x27af4f){if(_0x27af4f){_0xfc25b3=_0x27af4f[_0x17b3('0x3a')];if(!_0x16d5b4['query']['hasOwnProperty'](_0x17b3('0x4f'))){_0x41d6ce[_0x17b3('0x1f')]=qs[_0x17b3('0x1f')](_0x16d5b4[_0x17b3('0x36')][_0x17b3('0x1f')]);_0x41d6ce[_0x17b3('0x1c')]=qs[_0x17b3('0x1c')](_0x16d5b4[_0x17b3('0x36')]['offset']);}return _0x4e582d[_0x17b3('0x4a')](_0x41d6ce);}})[_0x17b3('0x25')](function(_0x552dd2){if(_0x552dd2){return _0x552dd2?{'count':_0xfc25b3,'rows':_0x552dd2}:null;}})[_0x17b3('0x25')](respondWithResult(_0x6a5f8a,null))[_0x17b3('0x44')](handleError(_0x6a5f8a,null));};exports[_0x17b3('0x50')]=function(_0x55b5e6,_0x48974f,_0x4b9aa7){if(_0x55b5e6[_0x17b3('0x49')]['id']){delete _0x55b5e6[_0x17b3('0x49')]['id'];}return db[_0x17b3('0x2e')][_0x17b3('0x4b')]({'where':{'id':_0x55b5e6['params']['id']}})['then'](handleEntityNotFound(_0x48974f,null))[_0x17b3('0x25')](function(_0x47c195){if(_0x47c195){_0x55b5e6[_0x17b3('0x49')][_0x17b3('0x51')]=_0x47c195['id'];_0x55b5e6[_0x17b3('0x49')]['Subjects']=integrations['getSubjects'](_0x55b5e6[_0x17b3('0x49')][_0x17b3('0x52')],_0x55b5e6[_0x17b3('0x49')]['type']);_0x55b5e6[_0x17b3('0x49')][_0x17b3('0x53')]=integrations[_0x17b3('0x54')](_0x55b5e6[_0x17b3('0x49')][_0x17b3('0x52')],_0x55b5e6[_0x17b3('0x49')][_0x17b3('0x31')]);return db[_0x17b3('0x4c')][_0x17b3('0x48')](_0x55b5e6[_0x17b3('0x49')],{'include':[{'model':db[_0x17b3('0x55')],'as':_0x17b3('0x56')},{'model':db[_0x17b3('0x55')],'as':'Descriptions'}]});}return null;})[_0x17b3('0x25')](respondWithResult(_0x48974f,null))[_0x17b3('0x44')](handleError(_0x48974f,null));};exports[_0x17b3('0x57')]=function(_0x2507a2,_0x79b3b8,_0x4ff6e1){var _0x3ebb50=[{'name':_0x17b3('0x58'),'label':_0x17b3('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1c7cc9='';return db[_0x17b3('0x2e')][_0x17b3('0x4b')]({'where':{'id':_0x2507a2[_0x17b3('0x45')]['id']},'attributes':['id','remoteUri',_0x17b3('0x59'),'username',_0x17b3('0x5a'),'consumerKey','consumerSecret',_0x17b3('0x5b'),_0x17b3('0x5c')]})[_0x17b3('0x25')](handleEntityNotFound(_0x79b3b8,null))['then'](function(_0x215883){if(_0x215883){_0x1c7cc9=_0x215883[_0x17b3('0x5d')];var _0x4f247b=_0x1c7cc9[_0x17b3('0x5e')](-0x1);if(_0x4f247b==='/'){_0x1c7cc9=_0x1c7cc9[_0x17b3('0x5f')](0x0,_0x1c7cc9['lastIndexOf'](_0x4f247b));}var _0x2e731b={'method':_0x17b3('0x60'),'uri':util[_0x17b3('0x61')]('%s/custom_fields',_0x1c7cc9),'headers':{'Content-Type':'application/json','Accept':_0x17b3('0x62')},'json':!![]};if(_0x215883[_0x17b3('0x59')]==='basic'){_0x2e731b[_0x17b3('0x63')][_0x17b3('0x64')]=util[_0x17b3('0x61')](_0x17b3('0x65'),new Buffer(util['format']('%s:%s',_0x215883[_0x17b3('0x66')],_0x215883[_0x17b3('0x5a')]))[_0x17b3('0x67')](_0x17b3('0x68')));}return rp(_0x2e731b)['then'](function(_0x2526b6){return _0x3ebb50[_0x17b3('0x69')](_['map'](_0x2526b6[_0x17b3('0x6a')][_0x17b3('0x6b')],function(_0x20c32d){return{'id':_0x20c32d[_0x17b3('0x2a')],'name':_0x20c32d[_0x17b3('0x2a')],'type':_0x20c32d[_0x17b3('0x31')],'active':_0x20c32d['active'],'label':_0x20c32d[_0x17b3('0x6c')],'custom':!![]};}));});}})[_0x17b3('0x25')](function(_0x347f87){return{'count':_0x347f87['length'],'rows':_0x347f87};})[_0x17b3('0x25')](respondWithResult(_0x79b3b8,null))['catch'](function(_0x30aef7){var _0x3d8603=_0x2507a2[_0x17b3('0x36')][_0x17b3('0x6d')]?0x1f4:_0x30aef7[_0x17b3('0x6e')]||0x1f4;logger[_0x17b3('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x17b3('0x57'),_0x3d8603,JSON['stringify'](_0x30aef7));delete _0x30aef7[_0x17b3('0x2a')];if(_0x3d8603===0x191){_0x3d8603=0x190;}_0x79b3b8[_0x17b3('0x19')](_0x3d8603)[_0x17b3('0x2b')](_0x2507a2[_0x17b3('0x36')]['test']?{'message':_0x17b3('0x6f'),'statusCode':_0x30aef7[_0x17b3('0x6e')]}:_0x30aef7);});}; \ No newline at end of file +var _0x56be=['body','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','channel','Subjects','priority','remoteUri','consumerKey','token','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','end','error','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x56be,0x161));var _0xe56b=function(_0x4b9c67,_0x634eb2){_0x4b9c67=_0x4b9c67-0x0;var _0x555e63=_0x56be[_0x4b9c67];return _0x555e63;};'use strict';var emlformat=require(_0xe56b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe56b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe56b('0x2'));var moment=require(_0xe56b('0x3'));var BPromise=require(_0xe56b('0x4'));var Mustache=require(_0xe56b('0x5'));var util=require(_0xe56b('0x6'));var path=require(_0xe56b('0x7'));var sox=require('sox');var csv=require(_0xe56b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe56b('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe56b('0xa'));var toCsv=require(_0xe56b('0x8'));var querystring=require(_0xe56b('0xb'));var Papa=require(_0xe56b('0xc'));var Redis=require(_0xe56b('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe56b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe56b('0xf'))(_0xe56b('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe56b('0x11'));var db=require(_0xe56b('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x16e06b,_0x2cda96){_0x2cda96=_0x2cda96||0xcc;return function(_0x5a202c){if(_0x5a202c){return _0x16e06b[_0xe56b('0x13')](_0x2cda96);}return _0x16e06b[_0xe56b('0x14')](_0x2cda96)['end']();};}function respondWithResult(_0x459a1d,_0x25032e){_0x25032e=_0x25032e||0xc8;return function(_0x19ef73){if(_0x19ef73){return _0x459a1d['status'](_0x25032e)['json'](_0x19ef73);}};}function respondWithFilteredResult(_0x3557cd,_0x387062){return function(_0x3a74d5){if(_0x3a74d5){var _0x3ea9fc=typeof _0x387062[_0xe56b('0x15')]===_0xe56b('0x16')&&typeof _0x387062[_0xe56b('0x17')]===_0xe56b('0x16');var _0x173bbd=_0x3a74d5[_0xe56b('0x18')];var _0x347114=_0x3ea9fc?0x0:_0x387062[_0xe56b('0x15')];var _0x30a133=_0x3ea9fc?_0x3a74d5['count']:_0x387062[_0xe56b('0x15')]+_0x387062['limit'];var _0xdf617c;if(_0x30a133>=_0x173bbd){_0x30a133=_0x173bbd;_0xdf617c=0xc8;}else{_0xdf617c=0xce;}_0x3557cd[_0xe56b('0x14')](_0xdf617c);return _0x3557cd['set'](_0xe56b('0x19'),_0x347114+'-'+_0x30a133+'/'+_0x173bbd)['json'](_0x3a74d5);}return null;};}function patchUpdates(_0x5da77c){return function(_0x5afe54){try{jsonpatch[_0xe56b('0x1a')](_0x5afe54,_0x5da77c,!![]);}catch(_0x364f1e){return BPromise[_0xe56b('0x1b')](_0x364f1e);}return _0x5afe54[_0xe56b('0x1c')]();};}function saveUpdates(_0x1d48e6,_0x3c251b){return function(_0xa16c93){if(_0xa16c93){return _0xa16c93[_0xe56b('0x1d')](_0x1d48e6)['then'](function(_0x153da7){return _0x153da7;});}return null;};}function removeEntity(_0xe732ee,_0x3b2120){return function(_0x476a0f){if(_0x476a0f){return _0x476a0f['destroy']()['then'](function(){_0xe732ee[_0xe56b('0x14')](0xcc)[_0xe56b('0x1e')]();});}};}function handleEntityNotFound(_0x3c0739,_0x2719d6){return function(_0x5df09b){if(!_0x5df09b){_0x3c0739[_0xe56b('0x13')](0x194);}return _0x5df09b;};}function handleError(_0x4514ee,_0x55d73c){_0x55d73c=_0x55d73c||0x1f4;return function(_0x1c317a){logger[_0xe56b('0x1f')](_0x1c317a['stack']);if(_0x1c317a[_0xe56b('0x20')]){delete _0x1c317a['name'];}_0x4514ee[_0xe56b('0x14')](_0x55d73c)['send'](_0x1c317a);};}exports[_0xe56b('0x21')]=function(_0x208a25,_0x40cc0f){var _0x21304a={},_0x251efe={},_0xdc60d4={'count':0x0,'rows':[]};var _0x125959=_[_0xe56b('0x22')](db[_0xe56b('0x23')][_0xe56b('0x24')],function(_0x4e7e41){return{'name':_0x4e7e41[_0xe56b('0x25')],'type':_0x4e7e41[_0xe56b('0x26')][_0xe56b('0x27')]};});_0x251efe['model']=_[_0xe56b('0x22')](_0x125959,_0xe56b('0x20'));_0x251efe[_0xe56b('0x28')]=_[_0xe56b('0x29')](_0x208a25['query']);_0x251efe[_0xe56b('0x2a')]=_[_0xe56b('0x2b')](_0x251efe[_0xe56b('0x2c')],_0x251efe[_0xe56b('0x28')]);_0x21304a[_0xe56b('0x2d')]=_['intersection'](_0x251efe[_0xe56b('0x2c')],qs[_0xe56b('0x2e')](_0x208a25[_0xe56b('0x28')]['fields']));_0x21304a[_0xe56b('0x2d')]=_0x21304a[_0xe56b('0x2d')][_0xe56b('0x2f')]?_0x21304a[_0xe56b('0x2d')]:_0x251efe[_0xe56b('0x2c')];if(!_0x208a25['query'][_0xe56b('0x30')](_0xe56b('0x31'))){_0x21304a['limit']=qs[_0xe56b('0x17')](_0x208a25[_0xe56b('0x28')][_0xe56b('0x17')]);_0x21304a[_0xe56b('0x15')]=qs['offset'](_0x208a25['query'][_0xe56b('0x15')]);}_0x21304a[_0xe56b('0x32')]=qs['sort'](_0x208a25[_0xe56b('0x28')][_0xe56b('0x33')]);_0x21304a['where']=qs['filters'](_['pick'](_0x208a25[_0xe56b('0x28')],_0x251efe[_0xe56b('0x2a')]),_0x125959);if(_0x208a25[_0xe56b('0x28')][_0xe56b('0x34')]){_0x21304a['where']=_['merge'](_0x21304a[_0xe56b('0x35')],{'$or':_[_0xe56b('0x22')](_0x125959,function(_0x9c0729){if(_0x9c0729[_0xe56b('0x26')]!==_0xe56b('0x36')){var _0x38f856={};_0x38f856[_0x9c0729[_0xe56b('0x20')]]={'$like':'%'+_0x208a25[_0xe56b('0x28')]['filter']+'%'};return _0x38f856;}})});}_0x21304a=_[_0xe56b('0x37')]({},_0x21304a,_0x208a25[_0xe56b('0x38')]);var _0x3ac80a={'where':_0x21304a['where']};return db[_0xe56b('0x23')][_0xe56b('0x18')](_0x3ac80a)[_0xe56b('0x39')](function(_0x1d7f20){_0xdc60d4[_0xe56b('0x18')]=_0x1d7f20;if(_0x208a25[_0xe56b('0x28')][_0xe56b('0x3a')]){_0x21304a[_0xe56b('0x3b')]=[{'all':!![]}];}return db[_0xe56b('0x23')][_0xe56b('0x3c')](_0x21304a);})[_0xe56b('0x39')](function(_0x8eedd5){_0xdc60d4[_0xe56b('0x3d')]=_0x8eedd5;return _0xdc60d4;})[_0xe56b('0x39')](respondWithFilteredResult(_0x40cc0f,_0x21304a))[_0xe56b('0x3e')](handleError(_0x40cc0f,null));};exports[_0xe56b('0x3f')]=function(_0x5b800d,_0x2588bc){var _0x1ac6b1={'raw':![],'where':{'id':_0x5b800d[_0xe56b('0x40')]['id']}},_0x2bccce={};_0x2bccce['model']=_[_0xe56b('0x29')](db['DeskAccount'][_0xe56b('0x24')]);_0x2bccce[_0xe56b('0x28')]=_[_0xe56b('0x29')](_0x5b800d[_0xe56b('0x28')]);_0x2bccce[_0xe56b('0x2a')]=_[_0xe56b('0x2b')](_0x2bccce['model'],_0x2bccce[_0xe56b('0x28')]);_0x1ac6b1[_0xe56b('0x2d')]=_['intersection'](_0x2bccce[_0xe56b('0x2c')],qs[_0xe56b('0x2e')](_0x5b800d[_0xe56b('0x28')][_0xe56b('0x2e')]));_0x1ac6b1[_0xe56b('0x2d')]=_0x1ac6b1[_0xe56b('0x2d')][_0xe56b('0x2f')]?_0x1ac6b1[_0xe56b('0x2d')]:_0x2bccce[_0xe56b('0x2c')];if(_0x5b800d[_0xe56b('0x28')]['includeAll']){_0x1ac6b1['include']=[{'all':!![]}];}_0x1ac6b1=_[_0xe56b('0x37')]({},_0x1ac6b1,_0x5b800d[_0xe56b('0x38')]);return db[_0xe56b('0x23')][_0xe56b('0x41')](_0x1ac6b1)['then'](handleEntityNotFound(_0x2588bc,null))[_0xe56b('0x39')](respondWithResult(_0x2588bc,null))[_0xe56b('0x3e')](handleError(_0x2588bc,null));};exports[_0xe56b('0x42')]=function(_0x849b0c,_0x33f04f){return db[_0xe56b('0x23')][_0xe56b('0x42')](_0x849b0c[_0xe56b('0x43')],{})['then'](respondWithResult(_0x33f04f,0xc9))['catch'](handleError(_0x33f04f,null));};exports[_0xe56b('0x1d')]=function(_0x83b4f,_0x2d84ef){if(_0x83b4f[_0xe56b('0x43')]['id']){delete _0x83b4f[_0xe56b('0x43')]['id'];}return db['DeskAccount'][_0xe56b('0x41')]({'where':{'id':_0x83b4f[_0xe56b('0x40')]['id']}})[_0xe56b('0x39')](handleEntityNotFound(_0x2d84ef,null))[_0xe56b('0x39')](saveUpdates(_0x83b4f[_0xe56b('0x43')],null))['then'](respondWithResult(_0x2d84ef,null))[_0xe56b('0x3e')](handleError(_0x2d84ef,null));};exports[_0xe56b('0x44')]=function(_0x283c0f,_0x26694a){return db[_0xe56b('0x23')][_0xe56b('0x41')]({'where':{'id':_0x283c0f['params']['id']}})[_0xe56b('0x39')](handleEntityNotFound(_0x26694a,null))[_0xe56b('0x39')](removeEntity(_0x26694a,null))[_0xe56b('0x3e')](handleError(_0x26694a,null));};exports[_0xe56b('0x45')]=function(_0x4e4599,_0x5bf555,_0x2f322b){var _0xe47d78={};var _0x3bbd75={};var _0x55c918;var _0x239003;return db[_0xe56b('0x23')][_0xe56b('0x46')]({'where':{'id':_0x4e4599[_0xe56b('0x40')]['id']}})['then'](handleEntityNotFound(_0x5bf555,null))[_0xe56b('0x39')](function(_0x27f7b1){if(_0x27f7b1){_0x55c918=_0x27f7b1;_0x3bbd75[_0xe56b('0x2c')]=_['keys'](db[_0xe56b('0x47')][_0xe56b('0x24')]);_0x3bbd75[_0xe56b('0x28')]=_['keys'](_0x4e4599['query']);_0x3bbd75[_0xe56b('0x2a')]=_[_0xe56b('0x2b')](_0x3bbd75[_0xe56b('0x2c')],_0x3bbd75[_0xe56b('0x28')]);_0xe47d78[_0xe56b('0x2d')]=_[_0xe56b('0x2b')](_0x3bbd75[_0xe56b('0x2c')],qs[_0xe56b('0x2e')](_0x4e4599[_0xe56b('0x28')][_0xe56b('0x2e')]));_0xe47d78[_0xe56b('0x2d')]=_0xe47d78['attributes'][_0xe56b('0x2f')]?_0xe47d78['attributes']:_0x3bbd75['model'];_0xe47d78[_0xe56b('0x32')]=qs[_0xe56b('0x33')](_0x4e4599[_0xe56b('0x28')]['sort']);_0xe47d78[_0xe56b('0x35')]=qs[_0xe56b('0x2a')](_['pick'](_0x4e4599['query'],_0x3bbd75[_0xe56b('0x2a')]));if(_0x4e4599[_0xe56b('0x28')][_0xe56b('0x34')]){_0xe47d78[_0xe56b('0x35')]=_[_0xe56b('0x37')](_0xe47d78[_0xe56b('0x35')],{'$or':_['map'](_0xe47d78[_0xe56b('0x2d')],function(_0x5d69d9){var _0x10257f={};_0x10257f[_0x5d69d9]={'$like':'%'+_0x4e4599[_0xe56b('0x28')][_0xe56b('0x34')]+'%'};return _0x10257f;})});}_0xe47d78=_[_0xe56b('0x37')]({},_0xe47d78,_0x4e4599[_0xe56b('0x38')]);return _0x55c918['getConfigurations'](_0xe47d78);}})[_0xe56b('0x39')](function(_0x14dc48){if(_0x14dc48){_0x239003=_0x14dc48[_0xe56b('0x2f')];if(!_0x4e4599[_0xe56b('0x28')]['hasOwnProperty'](_0xe56b('0x31'))){_0xe47d78[_0xe56b('0x17')]=qs[_0xe56b('0x17')](_0x4e4599[_0xe56b('0x28')][_0xe56b('0x17')]);_0xe47d78['offset']=qs[_0xe56b('0x15')](_0x4e4599[_0xe56b('0x28')][_0xe56b('0x15')]);}return _0x55c918[_0xe56b('0x45')](_0xe47d78);}})[_0xe56b('0x39')](function(_0x32b053){if(_0x32b053){return _0x32b053?{'count':_0x239003,'rows':_0x32b053}:null;}})[_0xe56b('0x39')](respondWithResult(_0x5bf555,null))['catch'](handleError(_0x5bf555,null));};exports[_0xe56b('0x48')]=function(_0x7d6074,_0x413e7a,_0xc60836){if(_0x7d6074[_0xe56b('0x43')]['id']){delete _0x7d6074['body']['id'];}return db[_0xe56b('0x23')][_0xe56b('0x46')]({'where':{'id':_0x7d6074['params']['id']}})[_0xe56b('0x39')](handleEntityNotFound(_0x413e7a,null))[_0xe56b('0x39')](function(_0x10e8ab){if(_0x10e8ab){_0x7d6074[_0xe56b('0x43')][_0xe56b('0x49')]=_0x10e8ab['id'];_0x7d6074['body']['Subjects']=integrations[_0xe56b('0x4a')](_0x7d6074['body']['channel'],_0x7d6074[_0xe56b('0x43')][_0xe56b('0x26')]);_0x7d6074[_0xe56b('0x43')][_0xe56b('0x4b')]=integrations['getDescriptions'](_0x7d6074[_0xe56b('0x43')][_0xe56b('0x4c')],_0x7d6074[_0xe56b('0x43')][_0xe56b('0x26')]);return db[_0xe56b('0x47')][_0xe56b('0x42')](_0x7d6074[_0xe56b('0x43')],{'include':[{'model':db['DeskField'],'as':_0xe56b('0x4d')},{'model':db['DeskField'],'as':_0xe56b('0x4b')}]});}return null;})[_0xe56b('0x39')](respondWithResult(_0x413e7a,null))['catch'](handleError(_0x413e7a,null));};exports['getFields']=function(_0x5be097,_0x26b3f2,_0x12aa8a){var _0xd823a5=[{'name':_0xe56b('0x4e'),'label':_0xe56b('0x4e'),'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 _0x3915ee='';return db[_0xe56b('0x23')][_0xe56b('0x46')]({'where':{'id':_0x5be097[_0xe56b('0x40')]['id']},'attributes':['id',_0xe56b('0x4f'),'authType','username','password',_0xe56b('0x50'),'consumerSecret',_0xe56b('0x51'),'tokenSecret']})['then'](handleEntityNotFound(_0x26b3f2,null))[_0xe56b('0x39')](function(_0x76757f){if(_0x76757f){_0x3915ee=_0x76757f['remoteUri'];var _0x52dabe=_0x3915ee['slice'](-0x1);if(_0x52dabe==='/'){_0x3915ee=_0x3915ee[_0xe56b('0x52')](0x0,_0x3915ee[_0xe56b('0x53')](_0x52dabe));}var _0x525434={'method':'GET','uri':util[_0xe56b('0x54')](_0xe56b('0x55'),_0x3915ee),'headers':{'Content-Type':_0xe56b('0x56'),'Accept':_0xe56b('0x56')},'json':!![]};if(_0x76757f[_0xe56b('0x57')]===_0xe56b('0x58')){_0x525434['headers'][_0xe56b('0x59')]=util[_0xe56b('0x54')](_0xe56b('0x5a'),new Buffer(util[_0xe56b('0x54')](_0xe56b('0x5b'),_0x76757f['username'],_0x76757f['password']))[_0xe56b('0x5c')](_0xe56b('0x5d')));}return rp(_0x525434)['then'](function(_0x1a7a78){return _0xd823a5[_0xe56b('0x5e')](_[_0xe56b('0x22')](_0x1a7a78[_0xe56b('0x5f')][_0xe56b('0x60')],function(_0x4edbbd){return{'id':_0x4edbbd[_0xe56b('0x20')],'name':_0x4edbbd[_0xe56b('0x20')],'type':_0x4edbbd[_0xe56b('0x26')],'active':_0x4edbbd[_0xe56b('0x61')],'label':_0x4edbbd[_0xe56b('0x62')],'custom':!![]};}));});}})[_0xe56b('0x39')](function(_0x31b2c0){return{'count':_0x31b2c0[_0xe56b('0x2f')],'rows':_0x31b2c0};})[_0xe56b('0x39')](respondWithResult(_0x26b3f2,null))[_0xe56b('0x3e')](function(_0x4aed3f){var _0x52370d=_0x5be097[_0xe56b('0x28')][_0xe56b('0x63')]?0x1f4:_0x4aed3f[_0xe56b('0x64')]||0x1f4;logger[_0xe56b('0x1f')](_0xe56b('0x65'),_0xe56b('0x66'),_0x52370d,JSON[_0xe56b('0x67')](_0x4aed3f));delete _0x4aed3f[_0xe56b('0x20')];if(_0x52370d===0x191){_0x52370d=0x190;}_0x26b3f2[_0xe56b('0x14')](_0x52370d)['send'](_0x5be097[_0xe56b('0x28')][_0xe56b('0x63')]?{'message':_0xe56b('0x68'),'statusCode':_0x4aed3f['statusCode']}:_0x4aed3f);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 8292697..883b8d3 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 _0x3e02=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','api','bluebird','request-promise','path'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x3e02,0x1e5));var _0x23e0=function(_0x549a09,_0x2fe584){_0x549a09=_0x549a09-0x0;var _0x3ef978=_0x3e02[_0x549a09];return _0x3ef978;};'use strict';var _=require(_0x23e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x23e0('0x1'));var moment=require('moment');var BPromise=require(_0x23e0('0x2'));var rp=require(_0x23e0('0x3'));var fs=require('fs');var path=require(_0x23e0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23e0('0x5'));var integrations=require(_0x23e0('0x6'));module[_0x23e0('0x7')]=function(_0x5ead83,_0x200890){return _0x5ead83['define'](_0x23e0('0x8'),attributes,{'tableName':_0x23e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d23=['exports','define','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x0d23,0xe7));var _0x30d2=function(_0x2f1ee9,_0x395737){_0x2f1ee9=_0x2f1ee9-0x0;var _0x3582f3=_0x0d23[_0x2f1ee9];return _0x3582f3;};'use strict';var _=require('lodash');var util=require(_0x30d2('0x0'));var logger=require(_0x30d2('0x1'))(_0x30d2('0x2'));var moment=require(_0x30d2('0x3'));var BPromise=require(_0x30d2('0x4'));var rp=require(_0x30d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30d2('0x6'));var config=require(_0x30d2('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x30d2('0x8'));module[_0x30d2('0x9')]=function(_0x5c1777,_0x51e0a9){return _0x5c1777[_0x30d2('0xa')]('DeskAccount',attributes,{'tableName':_0x30d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index a3ebd4e..55c3a9e 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 _0x6d37=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetDeskAccount','options','raw','where','attributes','limit','include','map','model','then','debug','catch','ShowDeskAccount','DeskAccount','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0x6d37,0xe2));var _0x76d3=function(_0xa73c4d,_0x44d280){_0xa73c4d=_0xa73c4d-0x0;var _0x1ebb03=_0x6d37[_0xa73c4d];return _0x1ebb03;};'use strict';var _=require(_0x76d3('0x0'));var util=require(_0x76d3('0x1'));var moment=require('moment');var BPromise=require(_0x76d3('0x2'));var rs=require(_0x76d3('0x3'));var fs=require('fs');var Redis=require(_0x76d3('0x4'));var db=require(_0x76d3('0x5'))['db'];var utils=require(_0x76d3('0x6'));var logger=require('../../config/logger')(_0x76d3('0x7'));var config=require('../../config/environment');var jayson=require(_0x76d3('0x8'));var client=jayson[_0x76d3('0x9')][_0x76d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b115d,_0x3dfbe9,_0x38dedd){return new BPromise(function(_0x351c6e,_0x4d0223){return client['request'](_0x9b115d,_0x38dedd)['then'](function(_0x5b6f29){logger[_0x76d3('0xb')](_0x76d3('0xc'),_0x3dfbe9,_0x76d3('0xd'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3dfbe9,_0x76d3('0xd'),JSON[_0x76d3('0xe')](_0x5b6f29));if(_0x5b6f29[_0x76d3('0xf')]){if(_0x5b6f29[_0x76d3('0xf')]['code']===0x1f4){logger[_0x76d3('0xf')](_0x76d3('0xc'),_0x3dfbe9,_0x5b6f29[_0x76d3('0xf')][_0x76d3('0x10')]);return _0x4d0223(_0x5b6f29[_0x76d3('0xf')][_0x76d3('0x10')]);}logger['error'](_0x76d3('0xc'),_0x3dfbe9,_0x5b6f29['error'][_0x76d3('0x10')]);return _0x351c6e(_0x5b6f29[_0x76d3('0xf')][_0x76d3('0x10')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x3dfbe9,_0x76d3('0xd'));_0x351c6e(_0x5b6f29[_0x76d3('0x11')]['message']);}})['catch'](function(_0x2352f9){logger[_0x76d3('0xf')](_0x76d3('0xc'),_0x3dfbe9,_0x2352f9);_0x4d0223(_0x2352f9);});});}exports[_0x76d3('0x12')]=function(_0xa2ab97){var _0x125905=this;return new Promise(function(_0x406e31,_0x242583){return db['DeskAccount']['findAll']({'raw':_0xa2ab97['options']?_0xa2ab97[_0x76d3('0x13')][_0x76d3('0x14')]===undefined?!![]:![]:!![],'where':_0xa2ab97[_0x76d3('0x13')]?_0xa2ab97[_0x76d3('0x13')][_0x76d3('0x15')]||null:null,'attributes':_0xa2ab97[_0x76d3('0x13')]?_0xa2ab97[_0x76d3('0x13')][_0x76d3('0x16')]||null:null,'limit':_0xa2ab97[_0x76d3('0x13')]?_0xa2ab97[_0x76d3('0x13')][_0x76d3('0x17')]||null:null,'include':_0xa2ab97[_0x76d3('0x13')]?_0xa2ab97[_0x76d3('0x13')][_0x76d3('0x18')]?_[_0x76d3('0x19')](_0xa2ab97[_0x76d3('0x13')][_0x76d3('0x18')],function(_0x5f4230){return{'model':db[_0x5f4230[_0x76d3('0x1a')]],'as':_0x5f4230['as'],'attributes':_0x5f4230[_0x76d3('0x16')],'include':_0x5f4230[_0x76d3('0x18')]?_[_0x76d3('0x19')](_0x5f4230['include'],function(_0x60fb7f){return{'model':db[_0x60fb7f[_0x76d3('0x1a')]],'as':_0x60fb7f['as'],'attributes':_0x60fb7f[_0x76d3('0x16')],'include':_0x60fb7f['include']?_[_0x76d3('0x19')](_0x60fb7f[_0x76d3('0x18')],function(_0x15a1ef){return{'model':db[_0x15a1ef[_0x76d3('0x1a')]],'as':_0x15a1ef['as'],'attributes':_0x15a1ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x76d3('0x1b')](function(_0x25752c){logger[_0x76d3('0xb')]('GetDeskAccount',_0xa2ab97);logger[_0x76d3('0x1c')](_0x76d3('0x12'),_0xa2ab97,JSON['stringify'](_0x25752c));_0x406e31(_0x25752c);})[_0x76d3('0x1d')](function(_0x4b1a53){logger[_0x76d3('0xf')](_0x76d3('0x12'),_0x4b1a53['message'],_0xa2ab97);_0x242583(_0x125905[_0x76d3('0xf')](0x1f4,_0x4b1a53[_0x76d3('0x10')]));});});};exports[_0x76d3('0x1e')]=function(_0x34a2e7){var _0x3e9a0d=this;return new Promise(function(_0x1b0083,_0x2bac27){return db[_0x76d3('0x1f')][_0x76d3('0x20')]({'raw':_0x34a2e7['options']?_0x34a2e7['options'][_0x76d3('0x14')]===undefined?!![]:![]:!![],'where':_0x34a2e7[_0x76d3('0x13')]?_0x34a2e7[_0x76d3('0x13')][_0x76d3('0x15')]||null:null,'attributes':_0x34a2e7[_0x76d3('0x13')]?_0x34a2e7['options'][_0x76d3('0x16')]||null:null,'include':_0x34a2e7['options']?_0x34a2e7[_0x76d3('0x13')][_0x76d3('0x18')]?_['map'](_0x34a2e7[_0x76d3('0x13')][_0x76d3('0x18')],function(_0x37975e){return{'model':db[_0x37975e['model']],'as':_0x37975e['as'],'attributes':_0x37975e['attributes'],'include':_0x37975e[_0x76d3('0x18')]?_['map'](_0x37975e[_0x76d3('0x18')],function(_0xf161a0){return{'model':db[_0xf161a0[_0x76d3('0x1a')]],'as':_0xf161a0['as'],'attributes':_0xf161a0['attributes'],'include':_0xf161a0[_0x76d3('0x18')]?_[_0x76d3('0x19')](_0xf161a0[_0x76d3('0x18')],function(_0x2c329e){return{'model':db[_0x2c329e[_0x76d3('0x1a')]],'as':_0x2c329e['as'],'attributes':_0x2c329e[_0x76d3('0x16')]};}):[]};}):[]};}):[]:[]})[_0x76d3('0x1b')](function(_0x52a0d4){logger['info'](_0x76d3('0x1e'),_0x34a2e7);logger[_0x76d3('0x1c')](_0x76d3('0x1e'),_0x34a2e7,JSON[_0x76d3('0xe')](_0x52a0d4));_0x1b0083(_0x52a0d4);})[_0x76d3('0x1d')](function(_0x2e6564){logger[_0x76d3('0xf')](_0x76d3('0x1e'),_0x2e6564[_0x76d3('0x10')],_0x34a2e7);_0x2bac27(_0x3e9a0d[_0x76d3('0xf')](0x1f4,_0x2e6564[_0x76d3('0x10')]));});});}; \ No newline at end of file +var _0xe18d=['DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','debug','ShowDeskAccount','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe18d,0x188));var _0xde18=function(_0x2309a8,_0x3ac2a8){_0x2309a8=_0x2309a8-0x0;var _0x2b1442=_0xe18d[_0x2309a8];return _0x2b1442;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xde18('0x0'));var BPromise=require(_0xde18('0x1'));var rs=require(_0xde18('0x2'));var fs=require('fs');var Redis=require(_0xde18('0x3'));var db=require(_0xde18('0x4'))['db'];var utils=require(_0xde18('0x5'));var logger=require(_0xde18('0x6'))('rpc');var config=require(_0xde18('0x7'));var jayson=require(_0xde18('0x8'));var client=jayson[_0xde18('0x9')][_0xde18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d528a,_0x10d33a,_0x4f41d0){return new BPromise(function(_0x2adacd,_0x167a2d){return client[_0xde18('0xb')](_0x1d528a,_0x4f41d0)[_0xde18('0xc')](function(_0x3fe550){logger[_0xde18('0xd')]('DeskAccount,\x20%s,\x20%s',_0x10d33a,_0xde18('0xe'));logger['debug'](_0xde18('0xf'),_0x10d33a,_0xde18('0xe'),JSON[_0xde18('0x10')](_0x3fe550));if(_0x3fe550[_0xde18('0x11')]){if(_0x3fe550[_0xde18('0x11')][_0xde18('0x12')]===0x1f4){logger[_0xde18('0x11')](_0xde18('0x13'),_0x10d33a,_0x3fe550[_0xde18('0x11')][_0xde18('0x14')]);return _0x167a2d(_0x3fe550[_0xde18('0x11')][_0xde18('0x14')]);}logger[_0xde18('0x11')](_0xde18('0x13'),_0x10d33a,_0x3fe550['error'][_0xde18('0x14')]);return _0x2adacd(_0x3fe550[_0xde18('0x11')][_0xde18('0x14')]);}else{logger[_0xde18('0xd')]('DeskAccount,\x20%s,\x20%s',_0x10d33a,'request\x20sent');_0x2adacd(_0x3fe550[_0xde18('0x15')]['message']);}})[_0xde18('0x16')](function(_0x7324cd){logger[_0xde18('0x11')](_0xde18('0x13'),_0x10d33a,_0x7324cd);_0x167a2d(_0x7324cd);});});}exports[_0xde18('0x17')]=function(_0x323043){var _0x2c0915=this;return new Promise(function(_0x1fb2ac,_0x2ef717){return db[_0xde18('0x18')][_0xde18('0x19')]({'raw':_0x323043['options']?_0x323043[_0xde18('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x323043[_0xde18('0x1a')]?_0x323043[_0xde18('0x1a')][_0xde18('0x1b')]||null:null,'attributes':_0x323043['options']?_0x323043[_0xde18('0x1a')][_0xde18('0x1c')]||null:null,'limit':_0x323043[_0xde18('0x1a')]?_0x323043[_0xde18('0x1a')][_0xde18('0x1d')]||null:null,'include':_0x323043[_0xde18('0x1a')]?_0x323043[_0xde18('0x1a')][_0xde18('0x1e')]?_[_0xde18('0x1f')](_0x323043[_0xde18('0x1a')]['include'],function(_0x7043e9){return{'model':db[_0x7043e9[_0xde18('0x20')]],'as':_0x7043e9['as'],'attributes':_0x7043e9['attributes'],'include':_0x7043e9['include']?_[_0xde18('0x1f')](_0x7043e9[_0xde18('0x1e')],function(_0x5cc336){return{'model':db[_0x5cc336[_0xde18('0x20')]],'as':_0x5cc336['as'],'attributes':_0x5cc336['attributes'],'include':_0x5cc336[_0xde18('0x1e')]?_['map'](_0x5cc336[_0xde18('0x1e')],function(_0x2b7693){return{'model':db[_0x2b7693['model']],'as':_0x2b7693['as'],'attributes':_0x2b7693[_0xde18('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fd72b){logger[_0xde18('0xd')](_0xde18('0x17'),_0x323043);logger[_0xde18('0x21')](_0xde18('0x17'),_0x323043,JSON['stringify'](_0x2fd72b));_0x1fb2ac(_0x2fd72b);})[_0xde18('0x16')](function(_0x3b71d1){logger[_0xde18('0x11')]('GetDeskAccount',_0x3b71d1['message'],_0x323043);_0x2ef717(_0x2c0915[_0xde18('0x11')](0x1f4,_0x3b71d1[_0xde18('0x14')]));});});};exports[_0xde18('0x22')]=function(_0x4a1811){var _0x3677f0=this;return new Promise(function(_0x2c9a31,_0x16b28a){return db[_0xde18('0x18')][_0xde18('0x23')]({'raw':_0x4a1811[_0xde18('0x1a')]?_0x4a1811['options'][_0xde18('0x24')]===undefined?!![]:![]:!![],'where':_0x4a1811[_0xde18('0x1a')]?_0x4a1811['options'][_0xde18('0x1b')]||null:null,'attributes':_0x4a1811[_0xde18('0x1a')]?_0x4a1811[_0xde18('0x1a')][_0xde18('0x1c')]||null:null,'include':_0x4a1811[_0xde18('0x1a')]?_0x4a1811[_0xde18('0x1a')][_0xde18('0x1e')]?_[_0xde18('0x1f')](_0x4a1811[_0xde18('0x1a')][_0xde18('0x1e')],function(_0x47a6de){return{'model':db[_0x47a6de[_0xde18('0x20')]],'as':_0x47a6de['as'],'attributes':_0x47a6de[_0xde18('0x1c')],'include':_0x47a6de['include']?_[_0xde18('0x1f')](_0x47a6de[_0xde18('0x1e')],function(_0xe35781){return{'model':db[_0xe35781['model']],'as':_0xe35781['as'],'attributes':_0xe35781['attributes'],'include':_0xe35781[_0xde18('0x1e')]?_['map'](_0xe35781[_0xde18('0x1e')],function(_0x384569){return{'model':db[_0x384569[_0xde18('0x20')]],'as':_0x384569['as'],'attributes':_0x384569[_0xde18('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xde18('0xc')](function(_0x553862){logger[_0xde18('0xd')]('ShowDeskAccount',_0x4a1811);logger[_0xde18('0x21')]('ShowDeskAccount',_0x4a1811,JSON['stringify'](_0x553862));_0x2c9a31(_0x553862);})['catch'](function(_0x296cc0){logger['error'](_0xde18('0x22'),_0x296cc0['message'],_0x4a1811);_0x16b28a(_0x3677f0[_0xde18('0x11')](0x1f4,_0x296cc0[_0xde18('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index cef4d81..f80ef22 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x301f39,_0x192d7b){var _0xd2a00c=function(_0x504f99){while(--_0x504f99){_0x301f39['push'](_0x301f39['shift']());}};_0xd2a00c(++_0x192d7b);}(_0x3e74,0x175));var _0x43e7=function(_0x55e383,_0x42e89b){_0x55e383=_0x55e383-0x0;var _0x1d12f2=_0x3e74[_0x55e383];return _0x1d12f2;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x187b70,_0x53c101){var _0x58dc49=function(_0xc0a8de){while(--_0xc0a8de){_0x187b70['push'](_0x187b70['shift']());}};_0x58dc49(++_0x53c101);}(_0x34e8,0x12c));var _0x834e=function(_0x57f3e1,_0xbb7ead){_0x57f3e1=_0x57f3e1-0x0;var _0x4363aa=_0x34e8[_0x57f3e1];return _0x4363aa;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 53c8a4a..3191930 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 _0x5b7a=['STRING','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5b7a,0xcf));var _0xa5b7=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x5b7a[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require('sequelize');module[_0xa5b7('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa5b7('0x1')]}}; \ No newline at end of file +var _0x449f=['STRING','sequelize','exports'];(function(_0x300301,_0x11d528){var _0x41589f=function(_0x134877){while(--_0x134877){_0x300301['push'](_0x300301['shift']());}};_0x41589f(++_0x11d528);}(_0x449f,0x1a8));var _0xf449=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x449f[_0x5c3ae9];return _0x3f5950;};'use strict';var Sequelize=require(_0xf449('0x0'));module[_0xf449('0x1')]={'name':{'type':Sequelize[_0xf449('0x2')]},'description':{'type':Sequelize[_0xf449('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 58ed832..55a4112 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 _0x39c0=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','create','body','update','find','getFields','DeskField','sort','pick','nolimit','findOne','getSubjects','getDescriptions','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','sendStatus','error','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','key'];(function(_0x510931,_0x2d1390){var _0x173fc2=function(_0x572f62){while(--_0x572f62){_0x510931['push'](_0x510931['shift']());}};_0x173fc2(++_0x2d1390);}(_0x39c0,0xce));var _0x039c=function(_0x4f9108,_0x3119f4){_0x4f9108=_0x4f9108-0x0;var _0x2398a5=_0x39c0[_0x4f9108];return _0x2398a5;};'use strict';var emlformat=require(_0x039c('0x0'));var rimraf=require(_0x039c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x039c('0x2'));var rp=require(_0x039c('0x3'));var moment=require('moment');var BPromise=require(_0x039c('0x4'));var Mustache=require(_0x039c('0x5'));var util=require(_0x039c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x039c('0x7'));var ejs=require(_0x039c('0x8'));var fs=require('fs');var fs_extra=require(_0x039c('0x9'));var _=require(_0x039c('0xa'));var squel=require(_0x039c('0xb'));var crypto=require(_0x039c('0xc'));var jsforce=require(_0x039c('0xd'));var deskjs=require(_0x039c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x039c('0xf'));var Papa=require(_0x039c('0x10'));var Redis=require(_0x039c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x039c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x039c('0x13'));var logger=require(_0x039c('0x14'))('api');var utils=require(_0x039c('0x15'));var config=require(_0x039c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x039c('0x17'))['db'];function respondWithStatusCode(_0x4293cc,_0x2dc839){_0x2dc839=_0x2dc839||0xcc;return function(_0x5c7ab9){if(_0x5c7ab9){return _0x4293cc['sendStatus'](_0x2dc839);}return _0x4293cc[_0x039c('0x18')](_0x2dc839)[_0x039c('0x19')]();};}function respondWithResult(_0x205680,_0x590882){_0x590882=_0x590882||0xc8;return function(_0x3e664c){if(_0x3e664c){return _0x205680[_0x039c('0x18')](_0x590882)['json'](_0x3e664c);}};}function respondWithFilteredResult(_0x539cb2,_0x4a3079){return function(_0x32ba3c){if(_0x32ba3c){var _0x30d551=typeof _0x4a3079[_0x039c('0x1a')]===_0x039c('0x1b')&&typeof _0x4a3079[_0x039c('0x1c')]==='undefined';var _0x5beeae=_0x32ba3c[_0x039c('0x1d')];var _0xae6814=_0x30d551?0x0:_0x4a3079[_0x039c('0x1a')];var _0x4e811a=_0x30d551?_0x32ba3c[_0x039c('0x1d')]:_0x4a3079[_0x039c('0x1a')]+_0x4a3079['limit'];var _0x54ffca;if(_0x4e811a>=_0x5beeae){_0x4e811a=_0x5beeae;_0x54ffca=0xc8;}else{_0x54ffca=0xce;}_0x539cb2[_0x039c('0x18')](_0x54ffca);return _0x539cb2['set'](_0x039c('0x1e'),_0xae6814+'-'+_0x4e811a+'/'+_0x5beeae)[_0x039c('0x1f')](_0x32ba3c);}return null;};}function patchUpdates(_0xc893c0){return function(_0x4f270c){try{jsonpatch[_0x039c('0x20')](_0x4f270c,_0xc893c0,!![]);}catch(_0x1288c5){return BPromise['reject'](_0x1288c5);}return _0x4f270c[_0x039c('0x21')]();};}function saveUpdates(_0x48d7f1,_0x45f5d7){return function(_0x4f4e68){if(_0x4f4e68){return _0x4f4e68['update'](_0x48d7f1)[_0x039c('0x22')](function(_0x4a143){return _0x4a143;});}return null;};}function removeEntity(_0x125e7f,_0x3f8fbc){return function(_0x50ce24){if(_0x50ce24){return _0x50ce24[_0x039c('0x23')]()[_0x039c('0x22')](function(){_0x125e7f['status'](0xcc)[_0x039c('0x19')]();});}};}function handleEntityNotFound(_0x5069ea,_0x3fffe7){return function(_0x549544){if(!_0x549544){_0x5069ea[_0x039c('0x24')](0x194);}return _0x549544;};}function handleError(_0x28db56,_0x5995e1){_0x5995e1=_0x5995e1||0x1f4;return function(_0x2b10d0){logger[_0x039c('0x25')](_0x2b10d0['stack']);if(_0x2b10d0[_0x039c('0x26')]){delete _0x2b10d0[_0x039c('0x26')];}_0x28db56[_0x039c('0x18')](_0x5995e1)[_0x039c('0x27')](_0x2b10d0);};}exports[_0x039c('0x28')]=function(_0x1c5d21,_0x53265b){var _0x13ec12={},_0x1f12f9={},_0x3f04a4={'count':0x0,'rows':[]};var _0x4c03d6=_[_0x039c('0x29')](db[_0x039c('0x2a')][_0x039c('0x2b')],function(_0x3ce920){return{'name':_0x3ce920[_0x039c('0x2c')],'type':_0x3ce920['type'][_0x039c('0x2d')]};});_0x1f12f9[_0x039c('0x2e')]=_['map'](_0x4c03d6,_0x039c('0x26'));_0x1f12f9[_0x039c('0x2f')]=_['keys'](_0x1c5d21['query']);_0x1f12f9[_0x039c('0x30')]=_[_0x039c('0x31')](_0x1f12f9[_0x039c('0x2e')],_0x1f12f9[_0x039c('0x2f')]);_0x13ec12[_0x039c('0x32')]=_['intersection'](_0x1f12f9[_0x039c('0x2e')],qs[_0x039c('0x33')](_0x1c5d21[_0x039c('0x2f')]['fields']));_0x13ec12[_0x039c('0x32')]=_0x13ec12['attributes'][_0x039c('0x34')]?_0x13ec12[_0x039c('0x32')]:_0x1f12f9[_0x039c('0x2e')];if(!_0x1c5d21[_0x039c('0x2f')][_0x039c('0x35')]('nolimit')){_0x13ec12['limit']=qs[_0x039c('0x1c')](_0x1c5d21[_0x039c('0x2f')][_0x039c('0x1c')]);_0x13ec12[_0x039c('0x1a')]=qs['offset'](_0x1c5d21['query'][_0x039c('0x1a')]);}_0x13ec12[_0x039c('0x36')]=qs['sort'](_0x1c5d21[_0x039c('0x2f')]['sort']);_0x13ec12['where']=qs[_0x039c('0x30')](_['pick'](_0x1c5d21[_0x039c('0x2f')],_0x1f12f9[_0x039c('0x30')]),_0x4c03d6);if(_0x1c5d21[_0x039c('0x2f')]['filter']){_0x13ec12[_0x039c('0x37')]=_['merge'](_0x13ec12[_0x039c('0x37')],{'$or':_[_0x039c('0x29')](_0x4c03d6,function(_0x40b556){if(_0x40b556[_0x039c('0x38')]!==_0x039c('0x39')){var _0x299338={};_0x299338[_0x40b556[_0x039c('0x26')]]={'$like':'%'+_0x1c5d21['query'][_0x039c('0x3a')]+'%'};return _0x299338;}})});}_0x13ec12=_['merge']({},_0x13ec12,_0x1c5d21[_0x039c('0x3b')]);var _0x4f40e1={'where':_0x13ec12[_0x039c('0x37')]};return db[_0x039c('0x2a')][_0x039c('0x1d')](_0x4f40e1)['then'](function(_0x434735){_0x3f04a4['count']=_0x434735;if(_0x1c5d21['query'][_0x039c('0x3c')]){_0x13ec12[_0x039c('0x3d')]=[{'all':!![]}];}return db[_0x039c('0x2a')][_0x039c('0x3e')](_0x13ec12);})[_0x039c('0x22')](function(_0x30f7f2){_0x3f04a4[_0x039c('0x3f')]=_0x30f7f2;return _0x3f04a4;})[_0x039c('0x22')](respondWithFilteredResult(_0x53265b,_0x13ec12))[_0x039c('0x40')](handleError(_0x53265b,null));};exports[_0x039c('0x41')]=function(_0x583988,_0x238e2f){var _0x1b83d2={'raw':![],'where':{'id':_0x583988[_0x039c('0x42')]['id']}},_0x9474aa={};_0x9474aa[_0x039c('0x2e')]=_['keys'](db[_0x039c('0x2a')][_0x039c('0x2b')]);_0x9474aa[_0x039c('0x2f')]=_[_0x039c('0x43')](_0x583988[_0x039c('0x2f')]);_0x9474aa[_0x039c('0x30')]=_[_0x039c('0x31')](_0x9474aa[_0x039c('0x2e')],_0x9474aa[_0x039c('0x2f')]);_0x1b83d2[_0x039c('0x32')]=_[_0x039c('0x31')](_0x9474aa[_0x039c('0x2e')],qs[_0x039c('0x33')](_0x583988['query'][_0x039c('0x33')]));_0x1b83d2[_0x039c('0x32')]=_0x1b83d2[_0x039c('0x32')][_0x039c('0x34')]?_0x1b83d2[_0x039c('0x32')]:_0x9474aa['model'];if(_0x583988[_0x039c('0x2f')][_0x039c('0x3c')]){_0x1b83d2['include']=[{'all':!![]}];}_0x1b83d2=_[_0x039c('0x44')]({},_0x1b83d2,_0x583988[_0x039c('0x3b')]);return db[_0x039c('0x2a')]['find'](_0x1b83d2)[_0x039c('0x22')](handleEntityNotFound(_0x238e2f,null))[_0x039c('0x22')](respondWithResult(_0x238e2f,null))[_0x039c('0x40')](handleError(_0x238e2f,null));};exports[_0x039c('0x45')]=function(_0x1b5b2d,_0x420f37){return db[_0x039c('0x2a')][_0x039c('0x45')](_0x1b5b2d[_0x039c('0x46')],{})['then'](respondWithResult(_0x420f37,0xc9))['catch'](handleError(_0x420f37,null));};exports[_0x039c('0x47')]=function(_0x5062a2,_0x1bf4db){if(_0x5062a2['body']['id']){delete _0x5062a2['body']['id'];}return db[_0x039c('0x2a')][_0x039c('0x48')]({'where':{'id':_0x5062a2[_0x039c('0x42')]['id']}})[_0x039c('0x22')](handleEntityNotFound(_0x1bf4db,null))['then'](saveUpdates(_0x5062a2[_0x039c('0x46')],null))[_0x039c('0x22')](respondWithResult(_0x1bf4db,null))[_0x039c('0x40')](handleError(_0x1bf4db,null));};exports[_0x039c('0x23')]=function(_0xffa7bb,_0x3d552b){return db[_0x039c('0x2a')][_0x039c('0x48')]({'where':{'id':_0xffa7bb[_0x039c('0x42')]['id']}})[_0x039c('0x22')](handleEntityNotFound(_0x3d552b,null))[_0x039c('0x22')](removeEntity(_0x3d552b,null))['catch'](handleError(_0x3d552b,null));};exports[_0x039c('0x49')]=function(_0x969a31,_0x39639f,_0x1dca22){var _0x5ede93={};var _0x5e3c30={};var _0x3b78ae;var _0x4bcaca;return db['DeskConfiguration']['findOne']({'where':{'id':_0x969a31[_0x039c('0x42')]['id']}})[_0x039c('0x22')](handleEntityNotFound(_0x39639f,null))[_0x039c('0x22')](function(_0x177850){if(_0x177850){_0x3b78ae=_0x177850;_0x5e3c30[_0x039c('0x2e')]=_[_0x039c('0x43')](db[_0x039c('0x4a')]['rawAttributes']);_0x5e3c30[_0x039c('0x2f')]=_[_0x039c('0x43')](_0x969a31[_0x039c('0x2f')]);_0x5e3c30[_0x039c('0x30')]=_[_0x039c('0x31')](_0x5e3c30[_0x039c('0x2e')],_0x5e3c30[_0x039c('0x2f')]);_0x5ede93['attributes']=_[_0x039c('0x31')](_0x5e3c30[_0x039c('0x2e')],qs[_0x039c('0x33')](_0x969a31['query']['fields']));_0x5ede93[_0x039c('0x32')]=_0x5ede93[_0x039c('0x32')][_0x039c('0x34')]?_0x5ede93[_0x039c('0x32')]:_0x5e3c30[_0x039c('0x2e')];_0x5ede93['order']=qs[_0x039c('0x4b')](_0x969a31[_0x039c('0x2f')][_0x039c('0x4b')]);_0x5ede93[_0x039c('0x37')]=qs['filters'](_[_0x039c('0x4c')](_0x969a31['query'],_0x5e3c30[_0x039c('0x30')]));if(_0x969a31['query']['filter']){_0x5ede93[_0x039c('0x37')]=_['merge'](_0x5ede93['where'],{'$or':_[_0x039c('0x29')](_0x5ede93[_0x039c('0x32')],function(_0x4724d4){var _0xcb91c3={};_0xcb91c3[_0x4724d4]={'$like':'%'+_0x969a31['query'][_0x039c('0x3a')]+'%'};return _0xcb91c3;})});}_0x5ede93=_['merge']({},_0x5ede93,_0x969a31[_0x039c('0x3b')]);return _0x3b78ae[_0x039c('0x49')](_0x5ede93);}})['then'](function(_0x94e95e){if(_0x94e95e){_0x4bcaca=_0x94e95e[_0x039c('0x34')];if(!_0x969a31[_0x039c('0x2f')][_0x039c('0x35')](_0x039c('0x4d'))){_0x5ede93['limit']=qs[_0x039c('0x1c')](_0x969a31[_0x039c('0x2f')]['limit']);_0x5ede93[_0x039c('0x1a')]=qs['offset'](_0x969a31[_0x039c('0x2f')][_0x039c('0x1a')]);}return _0x3b78ae[_0x039c('0x49')](_0x5ede93);}})[_0x039c('0x22')](function(_0x36149f){if(_0x36149f){return _0x36149f?{'count':_0x4bcaca,'rows':_0x36149f}:null;}})[_0x039c('0x22')](respondWithResult(_0x39639f,null))[_0x039c('0x40')](handleError(_0x39639f,null));};exports['getSubjects']=function(_0x1389f8,_0x30fba8,_0xb00c54){var _0x41431c={};var _0x109d0a={};var _0x343ea8;var _0x1059ce;return db['DeskConfiguration'][_0x039c('0x4e')]({'where':{'id':_0x1389f8[_0x039c('0x42')]['id']}})[_0x039c('0x22')](handleEntityNotFound(_0x30fba8,null))[_0x039c('0x22')](function(_0x4f3b54){if(_0x4f3b54){_0x343ea8=_0x4f3b54;_0x109d0a[_0x039c('0x2e')]=_[_0x039c('0x43')](db[_0x039c('0x4a')][_0x039c('0x2b')]);_0x109d0a[_0x039c('0x2f')]=_['keys'](_0x1389f8['query']);_0x109d0a[_0x039c('0x30')]=_['intersection'](_0x109d0a['model'],_0x109d0a[_0x039c('0x2f')]);_0x41431c[_0x039c('0x32')]=_['intersection'](_0x109d0a[_0x039c('0x2e')],qs[_0x039c('0x33')](_0x1389f8[_0x039c('0x2f')][_0x039c('0x33')]));_0x41431c[_0x039c('0x32')]=_0x41431c[_0x039c('0x32')]['length']?_0x41431c[_0x039c('0x32')]:_0x109d0a[_0x039c('0x2e')];_0x41431c['order']=qs[_0x039c('0x4b')](_0x1389f8['query']['sort']);_0x41431c[_0x039c('0x37')]=qs['filters'](_[_0x039c('0x4c')](_0x1389f8[_0x039c('0x2f')],_0x109d0a['filters']));if(_0x1389f8[_0x039c('0x2f')][_0x039c('0x3a')]){_0x41431c[_0x039c('0x37')]=_[_0x039c('0x44')](_0x41431c[_0x039c('0x37')],{'$or':_[_0x039c('0x29')](_0x41431c[_0x039c('0x32')],function(_0x42b34c){var _0x2a3b7c={};_0x2a3b7c[_0x42b34c]={'$like':'%'+_0x1389f8[_0x039c('0x2f')][_0x039c('0x3a')]+'%'};return _0x2a3b7c;})});}_0x41431c=_['merge']({},_0x41431c,_0x1389f8['options']);return _0x343ea8[_0x039c('0x4f')](_0x41431c);}})[_0x039c('0x22')](function(_0x4e2a12){if(_0x4e2a12){_0x1059ce=_0x4e2a12['length'];if(!_0x1389f8[_0x039c('0x2f')]['hasOwnProperty'](_0x039c('0x4d'))){_0x41431c[_0x039c('0x1c')]=qs['limit'](_0x1389f8['query'][_0x039c('0x1c')]);_0x41431c[_0x039c('0x1a')]=qs['offset'](_0x1389f8['query'][_0x039c('0x1a')]);}return _0x343ea8[_0x039c('0x4f')](_0x41431c);}})[_0x039c('0x22')](function(_0x428899){if(_0x428899){return _0x428899?{'count':_0x1059ce,'rows':_0x428899}:null;}})[_0x039c('0x22')](respondWithResult(_0x30fba8,null))['catch'](handleError(_0x30fba8,null));};exports[_0x039c('0x50')]=function(_0xff1c86,_0x5c552d,_0x3755bc){var _0x3f4dd7={};var _0x4e7dda={};var _0x137bd2;var _0x419a32;return db['DeskConfiguration']['findOne']({'where':{'id':_0xff1c86[_0x039c('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c552d,null))[_0x039c('0x22')](function(_0x46b15b){if(_0x46b15b){_0x137bd2=_0x46b15b;_0x4e7dda[_0x039c('0x2e')]=_[_0x039c('0x43')](db[_0x039c('0x4a')][_0x039c('0x2b')]);_0x4e7dda[_0x039c('0x2f')]=_[_0x039c('0x43')](_0xff1c86[_0x039c('0x2f')]);_0x4e7dda[_0x039c('0x30')]=_[_0x039c('0x31')](_0x4e7dda[_0x039c('0x2e')],_0x4e7dda[_0x039c('0x2f')]);_0x3f4dd7[_0x039c('0x32')]=_[_0x039c('0x31')](_0x4e7dda[_0x039c('0x2e')],qs['fields'](_0xff1c86['query'][_0x039c('0x33')]));_0x3f4dd7[_0x039c('0x32')]=_0x3f4dd7[_0x039c('0x32')][_0x039c('0x34')]?_0x3f4dd7[_0x039c('0x32')]:_0x4e7dda['model'];_0x3f4dd7['order']=qs[_0x039c('0x4b')](_0xff1c86['query'][_0x039c('0x4b')]);_0x3f4dd7['where']=qs['filters'](_[_0x039c('0x4c')](_0xff1c86['query'],_0x4e7dda[_0x039c('0x30')]));if(_0xff1c86[_0x039c('0x2f')][_0x039c('0x3a')]){_0x3f4dd7[_0x039c('0x37')]=_[_0x039c('0x44')](_0x3f4dd7[_0x039c('0x37')],{'$or':_[_0x039c('0x29')](_0x3f4dd7[_0x039c('0x32')],function(_0x3f9bda){var _0x43abb3={};_0x43abb3[_0x3f9bda]={'$like':'%'+_0xff1c86[_0x039c('0x2f')][_0x039c('0x3a')]+'%'};return _0x43abb3;})});}_0x3f4dd7=_['merge']({},_0x3f4dd7,_0xff1c86[_0x039c('0x3b')]);return _0x137bd2[_0x039c('0x50')](_0x3f4dd7);}})[_0x039c('0x22')](function(_0x3de041){if(_0x3de041){_0x419a32=_0x3de041[_0x039c('0x34')];if(!_0xff1c86[_0x039c('0x2f')][_0x039c('0x35')](_0x039c('0x4d'))){_0x3f4dd7[_0x039c('0x1c')]=qs[_0x039c('0x1c')](_0xff1c86['query'][_0x039c('0x1c')]);_0x3f4dd7[_0x039c('0x1a')]=qs['offset'](_0xff1c86[_0x039c('0x2f')][_0x039c('0x1a')]);}return _0x137bd2[_0x039c('0x50')](_0x3f4dd7);}})[_0x039c('0x22')](function(_0x55726a){if(_0x55726a){return _0x55726a?{'count':_0x419a32,'rows':_0x55726a}:null;}})[_0x039c('0x22')](respondWithResult(_0x5c552d,null))[_0x039c('0x40')](handleError(_0x5c552d,null));};exports['getTags']=function(_0x41d982,_0x3ec03a,_0x41338f){var _0x143042={};var _0x38c4a9={};var _0x3b3d58;var _0x479c96;return db['DeskConfiguration'][_0x039c('0x4e')]({'where':{'id':_0x41d982[_0x039c('0x42')]['id']}})[_0x039c('0x22')](handleEntityNotFound(_0x3ec03a,null))[_0x039c('0x22')](function(_0xa90be7){if(_0xa90be7){_0x3b3d58=_0xa90be7;_0x38c4a9[_0x039c('0x2e')]=_[_0x039c('0x43')](db[_0x039c('0x51')][_0x039c('0x2b')]);_0x38c4a9[_0x039c('0x2f')]=_[_0x039c('0x43')](_0x41d982[_0x039c('0x2f')]);_0x38c4a9[_0x039c('0x30')]=_[_0x039c('0x31')](_0x38c4a9[_0x039c('0x2e')],_0x38c4a9[_0x039c('0x2f')]);_0x143042['attributes']=_[_0x039c('0x31')](_0x38c4a9['model'],qs[_0x039c('0x33')](_0x41d982[_0x039c('0x2f')][_0x039c('0x33')]));_0x143042[_0x039c('0x32')]=_0x143042[_0x039c('0x32')]['length']?_0x143042[_0x039c('0x32')]:_0x38c4a9[_0x039c('0x2e')];_0x143042['order']=qs[_0x039c('0x4b')](_0x41d982[_0x039c('0x2f')][_0x039c('0x4b')]);_0x143042['where']=qs[_0x039c('0x30')](_['pick'](_0x41d982[_0x039c('0x2f')],_0x38c4a9[_0x039c('0x30')]));if(_0x41d982[_0x039c('0x2f')][_0x039c('0x3a')]){_0x143042[_0x039c('0x37')]=_[_0x039c('0x44')](_0x143042[_0x039c('0x37')],{'$or':_[_0x039c('0x29')](_0x143042[_0x039c('0x32')],function(_0x4ff3f2){var _0x23c894={};_0x23c894[_0x4ff3f2]={'$like':'%'+_0x41d982[_0x039c('0x2f')][_0x039c('0x3a')]+'%'};return _0x23c894;})});}_0x143042=_['merge']({},_0x143042,_0x41d982[_0x039c('0x3b')]);return _0x3b3d58['getTags'](_0x143042);}})['then'](function(_0x58f3b4){if(_0x58f3b4){_0x479c96=_0x58f3b4[_0x039c('0x34')];if(!_0x41d982[_0x039c('0x2f')][_0x039c('0x35')]('nolimit')){_0x143042[_0x039c('0x1c')]=qs[_0x039c('0x1c')](_0x41d982[_0x039c('0x2f')][_0x039c('0x1c')]);_0x143042[_0x039c('0x1a')]=qs[_0x039c('0x1a')](_0x41d982[_0x039c('0x2f')][_0x039c('0x1a')]);}return _0x3b3d58['getTags'](_0x143042);}})[_0x039c('0x22')](function(_0x382710){if(_0x382710){return _0x382710?{'count':_0x479c96,'rows':_0x382710}:null;}})['then'](respondWithResult(_0x3ec03a,null))[_0x039c('0x40')](handleError(_0x3ec03a,null));};exports[_0x039c('0x52')]=function(_0x3f4711,_0x206a06,_0x5e6bc1){if(_0x3f4711['body']['id']){delete _0x3f4711[_0x039c('0x46')]['id'];}return db[_0x039c('0x2a')][_0x039c('0x4e')]({'where':{'id':_0x3f4711['params']['id']}})[_0x039c('0x22')](handleEntityNotFound(_0x206a06,null))[_0x039c('0x22')](function(_0x1dc34e){if(_0x1dc34e){return _0x1dc34e[_0x039c('0x52')](_0x3f4711[_0x039c('0x46')][_0x039c('0x53')]||[]);}return null;})[_0x039c('0x22')](respondWithResult(_0x206a06,null))[_0x039c('0x40')](handleError(_0x206a06,null));}; \ No newline at end of file +var _0x1104=['DeskField','order','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','reject','save','update','then','end','error','stack','name','send','index','DeskConfiguration','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','body','getFields','getSubjects','findOne'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1104,0x197));var _0x4110=function(_0x3047a,_0x39e58e){_0x3047a=_0x3047a-0x0;var _0x258f9b=_0x1104[_0x3047a];return _0x258f9b;};'use strict';var emlformat=require(_0x4110('0x0'));var rimraf=require(_0x4110('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4110('0x2'));var rp=require('request-promise');var moment=require(_0x4110('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4110('0x4'));var util=require('util');var path=require(_0x4110('0x5'));var sox=require(_0x4110('0x6'));var csv=require('to-csv');var ejs=require(_0x4110('0x7'));var fs=require('fs');var fs_extra=require(_0x4110('0x8'));var _=require(_0x4110('0x9'));var squel=require(_0x4110('0xa'));var crypto=require('crypto');var jsforce=require(_0x4110('0xb'));var deskjs=require(_0x4110('0xc'));var toCsv=require(_0x4110('0xd'));var querystring=require(_0x4110('0xe'));var Papa=require(_0x4110('0xf'));var Redis=require(_0x4110('0x10'));var authService=require(_0x4110('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4110('0x12'));var logger=require(_0x4110('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4110('0x14'));var licenseUtil=require(_0x4110('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x194794,_0x5285f){_0x5285f=_0x5285f||0xcc;return function(_0x1e7555){if(_0x1e7555){return _0x194794[_0x4110('0x16')](_0x5285f);}return _0x194794[_0x4110('0x17')](_0x5285f)['end']();};}function respondWithResult(_0x44721c,_0x12e859){_0x12e859=_0x12e859||0xc8;return function(_0x35a2cd){if(_0x35a2cd){return _0x44721c[_0x4110('0x17')](_0x12e859)[_0x4110('0x18')](_0x35a2cd);}};}function respondWithFilteredResult(_0x27f307,_0x4c1477){return function(_0x3a78fe){if(_0x3a78fe){var _0x113ebe=typeof _0x4c1477['offset']===_0x4110('0x19')&&typeof _0x4c1477[_0x4110('0x1a')]===_0x4110('0x19');var _0x5c8fc9=_0x3a78fe[_0x4110('0x1b')];var _0xb105fc=_0x113ebe?0x0:_0x4c1477[_0x4110('0x1c')];var _0x5dde3c=_0x113ebe?_0x3a78fe['count']:_0x4c1477[_0x4110('0x1c')]+_0x4c1477[_0x4110('0x1a')];var _0x52c9c0;if(_0x5dde3c>=_0x5c8fc9){_0x5dde3c=_0x5c8fc9;_0x52c9c0=0xc8;}else{_0x52c9c0=0xce;}_0x27f307[_0x4110('0x17')](_0x52c9c0);return _0x27f307[_0x4110('0x1d')]('Content-Range',_0xb105fc+'-'+_0x5dde3c+'/'+_0x5c8fc9)['json'](_0x3a78fe);}return null;};}function patchUpdates(_0x4ec862){return function(_0x53c076){try{jsonpatch['apply'](_0x53c076,_0x4ec862,!![]);}catch(_0x319902){return BPromise[_0x4110('0x1e')](_0x319902);}return _0x53c076[_0x4110('0x1f')]();};}function saveUpdates(_0x536f02,_0x103613){return function(_0x1c5a55){if(_0x1c5a55){return _0x1c5a55[_0x4110('0x20')](_0x536f02)[_0x4110('0x21')](function(_0x1076a5){return _0x1076a5;});}return null;};}function removeEntity(_0xfc16dc,_0x5ddd0e){return function(_0x1684cb){if(_0x1684cb){return _0x1684cb['destroy']()[_0x4110('0x21')](function(){_0xfc16dc[_0x4110('0x17')](0xcc)[_0x4110('0x22')]();});}};}function handleEntityNotFound(_0x55f965,_0x4b6573){return function(_0x25ea41){if(!_0x25ea41){_0x55f965[_0x4110('0x16')](0x194);}return _0x25ea41;};}function handleError(_0x2eaccf,_0x3ca254){_0x3ca254=_0x3ca254||0x1f4;return function(_0x5c593e){logger[_0x4110('0x23')](_0x5c593e[_0x4110('0x24')]);if(_0x5c593e['name']){delete _0x5c593e[_0x4110('0x25')];}_0x2eaccf['status'](_0x3ca254)[_0x4110('0x26')](_0x5c593e);};}exports[_0x4110('0x27')]=function(_0x354237,_0x263698){var _0x2566bf={},_0x48ca3a={},_0xbbcf42={'count':0x0,'rows':[]};var _0x32273f=_['map'](db[_0x4110('0x28')]['rawAttributes'],function(_0x286249){return{'name':_0x286249['fieldName'],'type':_0x286249[_0x4110('0x29')][_0x4110('0x2a')]};});_0x48ca3a[_0x4110('0x2b')]=_[_0x4110('0x2c')](_0x32273f,_0x4110('0x25'));_0x48ca3a[_0x4110('0x2d')]=_['keys'](_0x354237[_0x4110('0x2d')]);_0x48ca3a[_0x4110('0x2e')]=_[_0x4110('0x2f')](_0x48ca3a['model'],_0x48ca3a[_0x4110('0x2d')]);_0x2566bf[_0x4110('0x30')]=_['intersection'](_0x48ca3a[_0x4110('0x2b')],qs['fields'](_0x354237['query'][_0x4110('0x31')]));_0x2566bf[_0x4110('0x30')]=_0x2566bf[_0x4110('0x30')][_0x4110('0x32')]?_0x2566bf[_0x4110('0x30')]:_0x48ca3a['model'];if(!_0x354237[_0x4110('0x2d')][_0x4110('0x33')](_0x4110('0x34'))){_0x2566bf['limit']=qs['limit'](_0x354237[_0x4110('0x2d')]['limit']);_0x2566bf['offset']=qs[_0x4110('0x1c')](_0x354237[_0x4110('0x2d')][_0x4110('0x1c')]);}_0x2566bf['order']=qs[_0x4110('0x35')](_0x354237[_0x4110('0x2d')][_0x4110('0x35')]);_0x2566bf[_0x4110('0x36')]=qs[_0x4110('0x2e')](_[_0x4110('0x37')](_0x354237[_0x4110('0x2d')],_0x48ca3a['filters']),_0x32273f);if(_0x354237[_0x4110('0x2d')][_0x4110('0x38')]){_0x2566bf['where']=_[_0x4110('0x39')](_0x2566bf[_0x4110('0x36')],{'$or':_[_0x4110('0x2c')](_0x32273f,function(_0x5b0123){if(_0x5b0123[_0x4110('0x29')]!=='VIRTUAL'){var _0xc844c7={};_0xc844c7[_0x5b0123[_0x4110('0x25')]]={'$like':'%'+_0x354237['query'][_0x4110('0x38')]+'%'};return _0xc844c7;}})});}_0x2566bf=_[_0x4110('0x39')]({},_0x2566bf,_0x354237[_0x4110('0x3a')]);var _0x1e765c={'where':_0x2566bf['where']};return db[_0x4110('0x28')][_0x4110('0x1b')](_0x1e765c)[_0x4110('0x21')](function(_0x230fc5){_0xbbcf42[_0x4110('0x1b')]=_0x230fc5;if(_0x354237[_0x4110('0x2d')][_0x4110('0x3b')]){_0x2566bf[_0x4110('0x3c')]=[{'all':!![]}];}return db[_0x4110('0x28')]['findAll'](_0x2566bf);})[_0x4110('0x21')](function(_0x319ef9){_0xbbcf42[_0x4110('0x3d')]=_0x319ef9;return _0xbbcf42;})[_0x4110('0x21')](respondWithFilteredResult(_0x263698,_0x2566bf))[_0x4110('0x3e')](handleError(_0x263698,null));};exports[_0x4110('0x3f')]=function(_0x9e76c1,_0x9c75ff){var _0x45b0cc={'raw':![],'where':{'id':_0x9e76c1[_0x4110('0x40')]['id']}},_0x543e45={};_0x543e45[_0x4110('0x2b')]=_['keys'](db[_0x4110('0x28')][_0x4110('0x41')]);_0x543e45[_0x4110('0x2d')]=_[_0x4110('0x42')](_0x9e76c1[_0x4110('0x2d')]);_0x543e45[_0x4110('0x2e')]=_[_0x4110('0x2f')](_0x543e45[_0x4110('0x2b')],_0x543e45['query']);_0x45b0cc[_0x4110('0x30')]=_[_0x4110('0x2f')](_0x543e45[_0x4110('0x2b')],qs[_0x4110('0x31')](_0x9e76c1[_0x4110('0x2d')]['fields']));_0x45b0cc[_0x4110('0x30')]=_0x45b0cc[_0x4110('0x30')][_0x4110('0x32')]?_0x45b0cc[_0x4110('0x30')]:_0x543e45[_0x4110('0x2b')];if(_0x9e76c1['query'][_0x4110('0x3b')]){_0x45b0cc[_0x4110('0x3c')]=[{'all':!![]}];}_0x45b0cc=_[_0x4110('0x39')]({},_0x45b0cc,_0x9e76c1[_0x4110('0x3a')]);return db[_0x4110('0x28')][_0x4110('0x43')](_0x45b0cc)[_0x4110('0x21')](handleEntityNotFound(_0x9c75ff,null))[_0x4110('0x21')](respondWithResult(_0x9c75ff,null))['catch'](handleError(_0x9c75ff,null));};exports[_0x4110('0x44')]=function(_0x3bf673,_0x44b0dd){return db[_0x4110('0x28')]['create'](_0x3bf673[_0x4110('0x45')],{})[_0x4110('0x21')](respondWithResult(_0x44b0dd,0xc9))[_0x4110('0x3e')](handleError(_0x44b0dd,null));};exports['update']=function(_0x4873e6,_0x8dc31){if(_0x4873e6[_0x4110('0x45')]['id']){delete _0x4873e6[_0x4110('0x45')]['id'];}return db[_0x4110('0x28')][_0x4110('0x43')]({'where':{'id':_0x4873e6[_0x4110('0x40')]['id']}})['then'](handleEntityNotFound(_0x8dc31,null))[_0x4110('0x21')](saveUpdates(_0x4873e6[_0x4110('0x45')],null))[_0x4110('0x21')](respondWithResult(_0x8dc31,null))[_0x4110('0x3e')](handleError(_0x8dc31,null));};exports['destroy']=function(_0x33d5d3,_0x50ca1d){return db[_0x4110('0x28')][_0x4110('0x43')]({'where':{'id':_0x33d5d3[_0x4110('0x40')]['id']}})[_0x4110('0x21')](handleEntityNotFound(_0x50ca1d,null))[_0x4110('0x21')](removeEntity(_0x50ca1d,null))[_0x4110('0x3e')](handleError(_0x50ca1d,null));};exports['getFields']=function(_0x466689,_0x1e0471,_0x384bce){var _0x3ed04c={};var _0x213e62={};var _0x42143c;var _0x6770bf;return db['DeskConfiguration']['findOne']({'where':{'id':_0x466689[_0x4110('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e0471,null))[_0x4110('0x21')](function(_0x3eca01){if(_0x3eca01){_0x42143c=_0x3eca01;_0x213e62[_0x4110('0x2b')]=_[_0x4110('0x42')](db['DeskField'][_0x4110('0x41')]);_0x213e62[_0x4110('0x2d')]=_[_0x4110('0x42')](_0x466689[_0x4110('0x2d')]);_0x213e62[_0x4110('0x2e')]=_[_0x4110('0x2f')](_0x213e62[_0x4110('0x2b')],_0x213e62[_0x4110('0x2d')]);_0x3ed04c[_0x4110('0x30')]=_[_0x4110('0x2f')](_0x213e62[_0x4110('0x2b')],qs[_0x4110('0x31')](_0x466689[_0x4110('0x2d')][_0x4110('0x31')]));_0x3ed04c[_0x4110('0x30')]=_0x3ed04c[_0x4110('0x30')][_0x4110('0x32')]?_0x3ed04c[_0x4110('0x30')]:_0x213e62['model'];_0x3ed04c['order']=qs['sort'](_0x466689['query'][_0x4110('0x35')]);_0x3ed04c[_0x4110('0x36')]=qs['filters'](_[_0x4110('0x37')](_0x466689[_0x4110('0x2d')],_0x213e62[_0x4110('0x2e')]));if(_0x466689[_0x4110('0x2d')]['filter']){_0x3ed04c[_0x4110('0x36')]=_[_0x4110('0x39')](_0x3ed04c[_0x4110('0x36')],{'$or':_[_0x4110('0x2c')](_0x3ed04c[_0x4110('0x30')],function(_0x2e9253){var _0x271f4a={};_0x271f4a[_0x2e9253]={'$like':'%'+_0x466689[_0x4110('0x2d')][_0x4110('0x38')]+'%'};return _0x271f4a;})});}_0x3ed04c=_[_0x4110('0x39')]({},_0x3ed04c,_0x466689[_0x4110('0x3a')]);return _0x42143c[_0x4110('0x46')](_0x3ed04c);}})[_0x4110('0x21')](function(_0x59a275){if(_0x59a275){_0x6770bf=_0x59a275[_0x4110('0x32')];if(!_0x466689[_0x4110('0x2d')]['hasOwnProperty'](_0x4110('0x34'))){_0x3ed04c['limit']=qs[_0x4110('0x1a')](_0x466689[_0x4110('0x2d')][_0x4110('0x1a')]);_0x3ed04c[_0x4110('0x1c')]=qs[_0x4110('0x1c')](_0x466689[_0x4110('0x2d')]['offset']);}return _0x42143c[_0x4110('0x46')](_0x3ed04c);}})[_0x4110('0x21')](function(_0x3656cf){if(_0x3656cf){return _0x3656cf?{'count':_0x6770bf,'rows':_0x3656cf}:null;}})[_0x4110('0x21')](respondWithResult(_0x1e0471,null))[_0x4110('0x3e')](handleError(_0x1e0471,null));};exports[_0x4110('0x47')]=function(_0x3cb7ec,_0x435c06,_0xe0dc84){var _0x77b9ef={};var _0x22fa4c={};var _0x5ecb84;var _0x169929;return db['DeskConfiguration'][_0x4110('0x48')]({'where':{'id':_0x3cb7ec[_0x4110('0x40')]['id']}})[_0x4110('0x21')](handleEntityNotFound(_0x435c06,null))[_0x4110('0x21')](function(_0x546720){if(_0x546720){_0x5ecb84=_0x546720;_0x22fa4c[_0x4110('0x2b')]=_[_0x4110('0x42')](db[_0x4110('0x49')][_0x4110('0x41')]);_0x22fa4c[_0x4110('0x2d')]=_['keys'](_0x3cb7ec[_0x4110('0x2d')]);_0x22fa4c[_0x4110('0x2e')]=_['intersection'](_0x22fa4c[_0x4110('0x2b')],_0x22fa4c[_0x4110('0x2d')]);_0x77b9ef[_0x4110('0x30')]=_[_0x4110('0x2f')](_0x22fa4c[_0x4110('0x2b')],qs[_0x4110('0x31')](_0x3cb7ec[_0x4110('0x2d')][_0x4110('0x31')]));_0x77b9ef[_0x4110('0x30')]=_0x77b9ef[_0x4110('0x30')]['length']?_0x77b9ef[_0x4110('0x30')]:_0x22fa4c['model'];_0x77b9ef[_0x4110('0x4a')]=qs['sort'](_0x3cb7ec[_0x4110('0x2d')][_0x4110('0x35')]);_0x77b9ef['where']=qs['filters'](_[_0x4110('0x37')](_0x3cb7ec['query'],_0x22fa4c['filters']));if(_0x3cb7ec['query']['filter']){_0x77b9ef[_0x4110('0x36')]=_[_0x4110('0x39')](_0x77b9ef[_0x4110('0x36')],{'$or':_['map'](_0x77b9ef[_0x4110('0x30')],function(_0x593e84){var _0x4d4d4d={};_0x4d4d4d[_0x593e84]={'$like':'%'+_0x3cb7ec[_0x4110('0x2d')][_0x4110('0x38')]+'%'};return _0x4d4d4d;})});}_0x77b9ef=_[_0x4110('0x39')]({},_0x77b9ef,_0x3cb7ec[_0x4110('0x3a')]);return _0x5ecb84[_0x4110('0x47')](_0x77b9ef);}})[_0x4110('0x21')](function(_0x1ade2c){if(_0x1ade2c){_0x169929=_0x1ade2c[_0x4110('0x32')];if(!_0x3cb7ec[_0x4110('0x2d')][_0x4110('0x33')](_0x4110('0x34'))){_0x77b9ef[_0x4110('0x1a')]=qs[_0x4110('0x1a')](_0x3cb7ec['query'][_0x4110('0x1a')]);_0x77b9ef[_0x4110('0x1c')]=qs['offset'](_0x3cb7ec['query'][_0x4110('0x1c')]);}return _0x5ecb84[_0x4110('0x47')](_0x77b9ef);}})['then'](function(_0x14625a){if(_0x14625a){return _0x14625a?{'count':_0x169929,'rows':_0x14625a}:null;}})['then'](respondWithResult(_0x435c06,null))['catch'](handleError(_0x435c06,null));};exports[_0x4110('0x4b')]=function(_0x1f7518,_0x83b474,_0x58d432){var _0x247ae5={};var _0x23f1f7={};var _0x4400bc;var _0x59fc9e;return db[_0x4110('0x28')][_0x4110('0x48')]({'where':{'id':_0x1f7518[_0x4110('0x40')]['id']}})[_0x4110('0x21')](handleEntityNotFound(_0x83b474,null))['then'](function(_0x28e190){if(_0x28e190){_0x4400bc=_0x28e190;_0x23f1f7[_0x4110('0x2b')]=_[_0x4110('0x42')](db[_0x4110('0x49')][_0x4110('0x41')]);_0x23f1f7['query']=_['keys'](_0x1f7518[_0x4110('0x2d')]);_0x23f1f7['filters']=_[_0x4110('0x2f')](_0x23f1f7['model'],_0x23f1f7[_0x4110('0x2d')]);_0x247ae5['attributes']=_[_0x4110('0x2f')](_0x23f1f7['model'],qs[_0x4110('0x31')](_0x1f7518[_0x4110('0x2d')][_0x4110('0x31')]));_0x247ae5['attributes']=_0x247ae5[_0x4110('0x30')]['length']?_0x247ae5['attributes']:_0x23f1f7[_0x4110('0x2b')];_0x247ae5[_0x4110('0x4a')]=qs['sort'](_0x1f7518[_0x4110('0x2d')]['sort']);_0x247ae5[_0x4110('0x36')]=qs[_0x4110('0x2e')](_[_0x4110('0x37')](_0x1f7518[_0x4110('0x2d')],_0x23f1f7[_0x4110('0x2e')]));if(_0x1f7518[_0x4110('0x2d')]['filter']){_0x247ae5[_0x4110('0x36')]=_[_0x4110('0x39')](_0x247ae5['where'],{'$or':_[_0x4110('0x2c')](_0x247ae5['attributes'],function(_0x424aca){var _0x331df1={};_0x331df1[_0x424aca]={'$like':'%'+_0x1f7518[_0x4110('0x2d')][_0x4110('0x38')]+'%'};return _0x331df1;})});}_0x247ae5=_[_0x4110('0x39')]({},_0x247ae5,_0x1f7518[_0x4110('0x3a')]);return _0x4400bc[_0x4110('0x4b')](_0x247ae5);}})['then'](function(_0x46a939){if(_0x46a939){_0x59fc9e=_0x46a939[_0x4110('0x32')];if(!_0x1f7518[_0x4110('0x2d')]['hasOwnProperty'](_0x4110('0x34'))){_0x247ae5[_0x4110('0x1a')]=qs[_0x4110('0x1a')](_0x1f7518['query'][_0x4110('0x1a')]);_0x247ae5[_0x4110('0x1c')]=qs[_0x4110('0x1c')](_0x1f7518[_0x4110('0x2d')]['offset']);}return _0x4400bc[_0x4110('0x4b')](_0x247ae5);}})[_0x4110('0x21')](function(_0x270db2){if(_0x270db2){return _0x270db2?{'count':_0x59fc9e,'rows':_0x270db2}:null;}})[_0x4110('0x21')](respondWithResult(_0x83b474,null))['catch'](handleError(_0x83b474,null));};exports[_0x4110('0x4c')]=function(_0x2fd412,_0x5589a5,_0x17234c){var _0x43be27={};var _0x221bf5={};var _0x3f84ac;var _0x4e9595;return db[_0x4110('0x28')]['findOne']({'where':{'id':_0x2fd412[_0x4110('0x40')]['id']}})['then'](handleEntityNotFound(_0x5589a5,null))[_0x4110('0x21')](function(_0x3c8085){if(_0x3c8085){_0x3f84ac=_0x3c8085;_0x221bf5[_0x4110('0x2b')]=_['keys'](db[_0x4110('0x4d')]['rawAttributes']);_0x221bf5[_0x4110('0x2d')]=_['keys'](_0x2fd412['query']);_0x221bf5[_0x4110('0x2e')]=_[_0x4110('0x2f')](_0x221bf5[_0x4110('0x2b')],_0x221bf5[_0x4110('0x2d')]);_0x43be27['attributes']=_[_0x4110('0x2f')](_0x221bf5['model'],qs[_0x4110('0x31')](_0x2fd412['query'][_0x4110('0x31')]));_0x43be27[_0x4110('0x30')]=_0x43be27[_0x4110('0x30')][_0x4110('0x32')]?_0x43be27[_0x4110('0x30')]:_0x221bf5[_0x4110('0x2b')];_0x43be27[_0x4110('0x4a')]=qs[_0x4110('0x35')](_0x2fd412['query'][_0x4110('0x35')]);_0x43be27['where']=qs[_0x4110('0x2e')](_[_0x4110('0x37')](_0x2fd412['query'],_0x221bf5[_0x4110('0x2e')]));if(_0x2fd412['query']['filter']){_0x43be27[_0x4110('0x36')]=_[_0x4110('0x39')](_0x43be27[_0x4110('0x36')],{'$or':_[_0x4110('0x2c')](_0x43be27['attributes'],function(_0x3cb5c0){var _0x4da820={};_0x4da820[_0x3cb5c0]={'$like':'%'+_0x2fd412['query']['filter']+'%'};return _0x4da820;})});}_0x43be27=_[_0x4110('0x39')]({},_0x43be27,_0x2fd412[_0x4110('0x3a')]);return _0x3f84ac['getTags'](_0x43be27);}})[_0x4110('0x21')](function(_0x1f3059){if(_0x1f3059){_0x4e9595=_0x1f3059[_0x4110('0x32')];if(!_0x2fd412['query']['hasOwnProperty'](_0x4110('0x34'))){_0x43be27[_0x4110('0x1a')]=qs['limit'](_0x2fd412[_0x4110('0x2d')][_0x4110('0x1a')]);_0x43be27[_0x4110('0x1c')]=qs[_0x4110('0x1c')](_0x2fd412[_0x4110('0x2d')][_0x4110('0x1c')]);}return _0x3f84ac[_0x4110('0x4c')](_0x43be27);}})[_0x4110('0x21')](function(_0x538147){if(_0x538147){return _0x538147?{'count':_0x4e9595,'rows':_0x538147}:null;}})[_0x4110('0x21')](respondWithResult(_0x5589a5,null))[_0x4110('0x3e')](handleError(_0x5589a5,null));};exports[_0x4110('0x4e')]=function(_0x25578f,_0x1548b1,_0x2ea3f9){if(_0x25578f[_0x4110('0x45')]['id']){delete _0x25578f[_0x4110('0x45')]['id'];}return db[_0x4110('0x28')][_0x4110('0x48')]({'where':{'id':_0x25578f[_0x4110('0x40')]['id']}})[_0x4110('0x21')](handleEntityNotFound(_0x1548b1,null))[_0x4110('0x21')](function(_0x234d5b){if(_0x234d5b){return _0x234d5b[_0x4110('0x4e')](_0x25578f[_0x4110('0x45')][_0x4110('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x1548b1,null))['catch'](handleError(_0x1548b1,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 54d0fc5..bd576a2 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 _0x1987=['request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x1c3514,_0x3907f7){var _0x30ca68=function(_0x301376){while(--_0x301376){_0x1c3514['push'](_0x1c3514['shift']());}};_0x30ca68(++_0x3907f7);}(_0x1987,0x140));var _0x7198=function(_0x12c63c,_0x34e7da){_0x12c63c=_0x12c63c-0x0;var _0x59b23e=_0x1987[_0x12c63c];return _0x59b23e;};'use strict';var _=require('lodash');var util=require(_0x7198('0x0'));var logger=require(_0x7198('0x1'))(_0x7198('0x2'));var moment=require(_0x7198('0x3'));var BPromise=require(_0x7198('0x4'));var rp=require(_0x7198('0x5'));var fs=require('fs');var path=require(_0x7198('0x6'));var rimraf=require(_0x7198('0x7'));var config=require('../../config/environment');var attributes=require(_0x7198('0x8'));module[_0x7198('0x9')]=function(_0x5bca2c,_0xa726c9){return _0x5bca2c[_0x7198('0xa')](_0x7198('0xb'),attributes,{'tableName':_0x7198('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8383=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b26a9,_0x31e5e0){var _0x4942b8=function(_0x44471f){while(--_0x44471f){_0x2b26a9['push'](_0x2b26a9['shift']());}};_0x4942b8(++_0x31e5e0);}(_0x8383,0x1a9));var _0x3838=function(_0x487861,_0x358f2f){_0x487861=_0x487861-0x0;var _0x56b689=_0x8383[_0x487861];return _0x56b689;};'use strict';var _=require(_0x3838('0x0'));var util=require(_0x3838('0x1'));var logger=require(_0x3838('0x2'))(_0x3838('0x3'));var moment=require(_0x3838('0x4'));var BPromise=require(_0x3838('0x5'));var rp=require(_0x3838('0x6'));var fs=require('fs');var path=require(_0x3838('0x7'));var rimraf=require(_0x3838('0x8'));var config=require(_0x3838('0x9'));var attributes=require(_0x3838('0xa'));module[_0x3838('0xb')]=function(_0x577488,_0x4091b4){return _0x577488[_0x3838('0xc')](_0x3838('0xd'),attributes,{'tableName':_0x3838('0xe'),'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 dbd24cd..868fbfa 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 _0xa962=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','message','DeskConfiguration,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x501803,_0x3d90a7){var _0x9ea16f=function(_0x2eb1b1){while(--_0x2eb1b1){_0x501803['push'](_0x501803['shift']());}};_0x9ea16f(++_0x3d90a7);}(_0xa962,0xea));var _0x2a96=function(_0x3f0b15,_0xb88473){_0x3f0b15=_0x3f0b15-0x0;var _0x38f95f=_0xa962[_0x3f0b15];return _0x38f95f;};'use strict';var _=require(_0x2a96('0x0'));var util=require(_0x2a96('0x1'));var moment=require('moment');var BPromise=require(_0x2a96('0x2'));var rs=require(_0x2a96('0x3'));var fs=require('fs');var Redis=require(_0x2a96('0x4'));var db=require(_0x2a96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a96('0x6'))(_0x2a96('0x7'));var config=require(_0x2a96('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2a96('0x9')][_0x2a96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dcf0c,_0x60e02,_0x2d3300){return new BPromise(function(_0x5499d6,_0x438363){return client[_0x2a96('0xb')](_0x2dcf0c,_0x2d3300)[_0x2a96('0xc')](function(_0x4d8e6a){logger[_0x2a96('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x60e02,_0x2a96('0xe'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x60e02,_0x2a96('0xe'),JSON[_0x2a96('0xf')](_0x4d8e6a));if(_0x4d8e6a['error']){if(_0x4d8e6a[_0x2a96('0x10')]['code']===0x1f4){logger[_0x2a96('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x60e02,_0x4d8e6a[_0x2a96('0x10')][_0x2a96('0x11')]);return _0x438363(_0x4d8e6a[_0x2a96('0x10')]['message']);}logger['error'](_0x2a96('0x12'),_0x60e02,_0x4d8e6a['error'][_0x2a96('0x11')]);return _0x5499d6(_0x4d8e6a[_0x2a96('0x10')]['message']);}else{logger['info'](_0x2a96('0x12'),_0x60e02,'request\x20sent');_0x5499d6(_0x4d8e6a[_0x2a96('0x13')][_0x2a96('0x11')]);}})['catch'](function(_0x3238ad){logger[_0x2a96('0x10')](_0x2a96('0x12'),_0x60e02,_0x3238ad);_0x438363(_0x3238ad);});});} \ No newline at end of file +var _0xa63a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3e2ffd,_0x46cada){var _0xeee2bd=function(_0x94000e){while(--_0x94000e){_0x3e2ffd['push'](_0x3e2ffd['shift']());}};_0xeee2bd(++_0x46cada);}(_0xa63a,0x154));var _0xaa63=function(_0x5c1b05,_0x213768){_0x5c1b05=_0x5c1b05-0x0;var _0x1a65e7=_0xa63a[_0x5c1b05];return _0x1a65e7;};'use strict';var _=require('lodash');var util=require(_0xaa63('0x0'));var moment=require(_0xaa63('0x1'));var BPromise=require(_0xaa63('0x2'));var rs=require(_0xaa63('0x3'));var fs=require('fs');var Redis=require(_0xaa63('0x4'));var db=require(_0xaa63('0x5'))['db'];var utils=require(_0xaa63('0x6'));var logger=require(_0xaa63('0x7'))(_0xaa63('0x8'));var config=require(_0xaa63('0x9'));var jayson=require(_0xaa63('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee756,_0x43e4e3,_0x53e524){return new BPromise(function(_0x42f55d,_0x37abe2){return client['request'](_0x5ee756,_0x53e524)[_0xaa63('0xb')](function(_0x146c00){logger[_0xaa63('0xc')](_0xaa63('0xd'),_0x43e4e3,_0xaa63('0xe'));logger[_0xaa63('0xf')](_0xaa63('0x10'),_0x43e4e3,'request\x20sent',JSON[_0xaa63('0x11')](_0x146c00));if(_0x146c00[_0xaa63('0x12')]){if(_0x146c00[_0xaa63('0x12')][_0xaa63('0x13')]===0x1f4){logger[_0xaa63('0x12')](_0xaa63('0xd'),_0x43e4e3,_0x146c00['error']['message']);return _0x37abe2(_0x146c00['error']['message']);}logger[_0xaa63('0x12')](_0xaa63('0xd'),_0x43e4e3,_0x146c00[_0xaa63('0x12')][_0xaa63('0x14')]);return _0x42f55d(_0x146c00[_0xaa63('0x12')][_0xaa63('0x14')]);}else{logger[_0xaa63('0xc')](_0xaa63('0xd'),_0x43e4e3,'request\x20sent');_0x42f55d(_0x146c00[_0xaa63('0x15')][_0xaa63('0x14')]);}})[_0xaa63('0x16')](function(_0x285a23){logger[_0xaa63('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x43e4e3,_0x285a23);_0x37abe2(_0x285a23);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index fb41298..0df2e5c 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 _0x1bf9=['../../components/interaction/service','./intDeskField.controller','get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x1bf9,0x188));var _0x91bf=function(_0x3f1927,_0x5c28eb){_0x3f1927=_0x3f1927-0x0;var _0x2aac51=_0x1bf9[_0x3f1927];return _0x2aac51;};'use strict';var multer=require(_0x91bf('0x0'));var util=require('util');var path=require(_0x91bf('0x1'));var timeout=require(_0x91bf('0x2'));var express=require(_0x91bf('0x3'));var router=express[_0x91bf('0x4')]();var fs_extra=require(_0x91bf('0x5'));var auth=require(_0x91bf('0x6'));var interaction=require(_0x91bf('0x7'));var config=require('../../config/environment');var controller=require(_0x91bf('0x8'));router[_0x91bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x91bf('0xa')]);router[_0x91bf('0x9')](_0x91bf('0xb'),auth[_0x91bf('0xc')](),controller[_0x91bf('0xd')]);router['post']('/',auth[_0x91bf('0xc')](),controller[_0x91bf('0xe')]);router['put'](_0x91bf('0xb'),auth['isAuthenticated'](),controller[_0x91bf('0xf')]);router[_0x91bf('0x10')](_0x91bf('0xb'),auth[_0x91bf('0xc')](),controller[_0x91bf('0x11')]);module[_0x91bf('0x12')]=router; \ No newline at end of file +var _0x0e4a=['multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0e4a,0xd8));var _0xa0e4=function(_0x41cb1c,_0x189664){_0x41cb1c=_0x41cb1c-0x0;var _0x150510=_0x0e4a[_0x41cb1c];return _0x150510;};'use strict';var multer=require(_0xa0e4('0x0'));var util=require(_0xa0e4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa0e4('0x2')]();var fs_extra=require(_0xa0e4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa0e4('0x4'));var config=require(_0xa0e4('0x5'));var controller=require(_0xa0e4('0x6'));router[_0xa0e4('0x7')]('/',auth[_0xa0e4('0x8')](),controller[_0xa0e4('0x9')]);router['get']('/:id',auth[_0xa0e4('0x8')](),controller[_0xa0e4('0xa')]);router[_0xa0e4('0xb')]('/',auth[_0xa0e4('0x8')](),controller['create']);router[_0xa0e4('0xc')](_0xa0e4('0xd'),auth[_0xa0e4('0x8')](),controller[_0xa0e4('0xe')]);router[_0xa0e4('0xf')](_0xa0e4('0xd'),auth[_0xa0e4('0x8')](),controller[_0xa0e4('0x10')]);module[_0xa0e4('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 245dd77..6d0e264 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 _0x0de2=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x2e95b1,_0x54e623){var _0x3a84de=function(_0x5b1104){while(--_0x5b1104){_0x2e95b1['push'](_0x2e95b1['shift']());}};_0x3a84de(++_0x54e623);}(_0x0de2,0x108));var _0x20de=function(_0x36f257,_0x47793b){_0x36f257=_0x36f257-0x0;var _0x381cc6=_0x0de2[_0x36f257];return _0x381cc6;};'use strict';var Sequelize=require(_0x20de('0x0'));module['exports']={'type':{'type':Sequelize[_0x20de('0x1')](_0x20de('0x2'),_0x20de('0x3'),_0x20de('0x4'),_0x20de('0x5'),_0x20de('0x6')),'defaultValue':_0x20de('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x20de('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x20de('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x20de('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x20de('0x7')]}}; \ No newline at end of file +var _0x2481=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x3c37b2,_0x223707){var _0x372e4b=function(_0x3a4067){while(--_0x3a4067){_0x3c37b2['push'](_0x3c37b2['shift']());}};_0x372e4b(++_0x223707);}(_0x2481,0x186));var _0x1248=function(_0x1b1642,_0x3600f2){_0x1b1642=_0x1b1642-0x0;var _0xa5aea3=_0x2481[_0x1b1642];return _0xa5aea3;};'use strict';var Sequelize=require(_0x1248('0x0'));module['exports']={'type':{'type':Sequelize[_0x1248('0x1')](_0x1248('0x2'),_0x1248('0x3'),_0x1248('0x4'),'keyValue',_0x1248('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1248('0x6')]},'key':{'type':Sequelize[_0x1248('0x6')]},'keyType':{'type':Sequelize[_0x1248('0x1')]('string','variable',_0x1248('0x4'))},'keyContent':{'type':Sequelize[_0x1248('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1248('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1248('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index d36ef65..b61baf6 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 _0x96aa=['filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','then','destroy','stack','name','send','map','DeskField','fieldName','type','key','model','query'];(function(_0x23ee21,_0x1bd012){var _0x892676=function(_0x48b1e){while(--_0x48b1e){_0x23ee21['push'](_0x23ee21['shift']());}};_0x892676(++_0x1bd012);}(_0x96aa,0x67));var _0xa96a=function(_0x4af449,_0x58bbca){_0x4af449=_0x4af449-0x0;var _0x286691=_0x96aa[_0x4af449];return _0x286691;};'use strict';var emlformat=require(_0xa96a('0x0'));var rimraf=require(_0xa96a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa96a('0x2'));var rp=require(_0xa96a('0x3'));var moment=require(_0xa96a('0x4'));var BPromise=require(_0xa96a('0x5'));var Mustache=require(_0xa96a('0x6'));var util=require('util');var path=require(_0xa96a('0x7'));var sox=require(_0xa96a('0x8'));var csv=require('to-csv');var ejs=require(_0xa96a('0x9'));var fs=require('fs');var fs_extra=require(_0xa96a('0xa'));var _=require(_0xa96a('0xb'));var squel=require(_0xa96a('0xc'));var crypto=require(_0xa96a('0xd'));var jsforce=require(_0xa96a('0xe'));var deskjs=require(_0xa96a('0xf'));var toCsv=require(_0xa96a('0x10'));var querystring=require(_0xa96a('0x11'));var Papa=require(_0xa96a('0x12'));var Redis=require(_0xa96a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa96a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa96a('0x15'));var logger=require(_0xa96a('0x16'))('api');var utils=require(_0xa96a('0x17'));var config=require(_0xa96a('0x18'));var licenseUtil=require(_0xa96a('0x19'));var db=require(_0xa96a('0x1a'))['db'];function respondWithStatusCode(_0x26267e,_0x3f0f9e){_0x3f0f9e=_0x3f0f9e||0xcc;return function(_0x225192){if(_0x225192){return _0x26267e[_0xa96a('0x1b')](_0x3f0f9e);}return _0x26267e[_0xa96a('0x1c')](_0x3f0f9e)[_0xa96a('0x1d')]();};}function respondWithResult(_0x431927,_0x3983ba){_0x3983ba=_0x3983ba||0xc8;return function(_0x4dc5a8){if(_0x4dc5a8){return _0x431927['status'](_0x3983ba)[_0xa96a('0x1e')](_0x4dc5a8);}};}function respondWithFilteredResult(_0x4f44b0,_0x14927b){return function(_0x5cd3f7){if(_0x5cd3f7){var _0x170e3d=typeof _0x14927b[_0xa96a('0x1f')]===_0xa96a('0x20')&&typeof _0x14927b[_0xa96a('0x21')]===_0xa96a('0x20');var _0x16257d=_0x5cd3f7['count'];var _0x8d32c0=_0x170e3d?0x0:_0x14927b[_0xa96a('0x1f')];var _0x48ca06=_0x170e3d?_0x5cd3f7[_0xa96a('0x22')]:_0x14927b[_0xa96a('0x1f')]+_0x14927b[_0xa96a('0x21')];var _0x2e8c75;if(_0x48ca06>=_0x16257d){_0x48ca06=_0x16257d;_0x2e8c75=0xc8;}else{_0x2e8c75=0xce;}_0x4f44b0[_0xa96a('0x1c')](_0x2e8c75);return _0x4f44b0[_0xa96a('0x23')](_0xa96a('0x24'),_0x8d32c0+'-'+_0x48ca06+'/'+_0x16257d)[_0xa96a('0x1e')](_0x5cd3f7);}return null;};}function patchUpdates(_0x3f41ad){return function(_0x5ee7ba){try{jsonpatch[_0xa96a('0x25')](_0x5ee7ba,_0x3f41ad,!![]);}catch(_0x5b7cbc){return BPromise[_0xa96a('0x26')](_0x5b7cbc);}return _0x5ee7ba['save']();};}function saveUpdates(_0x1572bd,_0x96a6b2){return function(_0x484ee7){if(_0x484ee7){return _0x484ee7['update'](_0x1572bd)[_0xa96a('0x27')](function(_0x33feeb){return _0x33feeb;});}return null;};}function removeEntity(_0x2c5db0,_0x2f2173){return function(_0x3eca00){if(_0x3eca00){return _0x3eca00[_0xa96a('0x28')]()['then'](function(){_0x2c5db0['status'](0xcc)[_0xa96a('0x1d')]();});}};}function handleEntityNotFound(_0x5916af,_0x36f3ae){return function(_0x44c4ee){if(!_0x44c4ee){_0x5916af[_0xa96a('0x1b')](0x194);}return _0x44c4ee;};}function handleError(_0x573ea7,_0x171450){_0x171450=_0x171450||0x1f4;return function(_0x485fb1){logger['error'](_0x485fb1[_0xa96a('0x29')]);if(_0x485fb1['name']){delete _0x485fb1[_0xa96a('0x2a')];}_0x573ea7[_0xa96a('0x1c')](_0x171450)[_0xa96a('0x2b')](_0x485fb1);};}exports['index']=function(_0x1bb965,_0x5256cb){var _0x55b8be={},_0x14c246={},_0x5576b9={'count':0x0,'rows':[]};var _0x585af1=_[_0xa96a('0x2c')](db[_0xa96a('0x2d')]['rawAttributes'],function(_0x34ef72){return{'name':_0x34ef72[_0xa96a('0x2e')],'type':_0x34ef72[_0xa96a('0x2f')][_0xa96a('0x30')]};});_0x14c246[_0xa96a('0x31')]=_['map'](_0x585af1,_0xa96a('0x2a'));_0x14c246[_0xa96a('0x32')]=_['keys'](_0x1bb965[_0xa96a('0x32')]);_0x14c246[_0xa96a('0x33')]=_[_0xa96a('0x34')](_0x14c246[_0xa96a('0x31')],_0x14c246[_0xa96a('0x32')]);_0x55b8be[_0xa96a('0x35')]=_[_0xa96a('0x34')](_0x14c246['model'],qs[_0xa96a('0x36')](_0x1bb965[_0xa96a('0x32')][_0xa96a('0x36')]));_0x55b8be[_0xa96a('0x35')]=_0x55b8be[_0xa96a('0x35')][_0xa96a('0x37')]?_0x55b8be['attributes']:_0x14c246['model'];if(!_0x1bb965['query']['hasOwnProperty'](_0xa96a('0x38'))){_0x55b8be[_0xa96a('0x21')]=qs[_0xa96a('0x21')](_0x1bb965[_0xa96a('0x32')][_0xa96a('0x21')]);_0x55b8be[_0xa96a('0x1f')]=qs[_0xa96a('0x1f')](_0x1bb965[_0xa96a('0x32')][_0xa96a('0x1f')]);}_0x55b8be[_0xa96a('0x39')]=qs[_0xa96a('0x3a')](_0x1bb965[_0xa96a('0x32')]['sort']);_0x55b8be['where']=qs[_0xa96a('0x33')](_[_0xa96a('0x3b')](_0x1bb965['query'],_0x14c246[_0xa96a('0x33')]),_0x585af1);if(_0x1bb965['query']['filter']){_0x55b8be[_0xa96a('0x3c')]=_[_0xa96a('0x3d')](_0x55b8be[_0xa96a('0x3c')],{'$or':_[_0xa96a('0x2c')](_0x585af1,function(_0x169acd){if(_0x169acd[_0xa96a('0x2f')]!==_0xa96a('0x3e')){var _0xbb2011={};_0xbb2011[_0x169acd[_0xa96a('0x2a')]]={'$like':'%'+_0x1bb965['query'][_0xa96a('0x3f')]+'%'};return _0xbb2011;}})});}_0x55b8be=_[_0xa96a('0x3d')]({},_0x55b8be,_0x1bb965[_0xa96a('0x40')]);var _0x5e4bf6={'where':_0x55b8be['where']};return db['DeskField']['count'](_0x5e4bf6)[_0xa96a('0x27')](function(_0x2ee9d3){_0x5576b9['count']=_0x2ee9d3;if(_0x1bb965[_0xa96a('0x32')][_0xa96a('0x41')]){_0x55b8be[_0xa96a('0x42')]=[{'all':!![]}];}return db[_0xa96a('0x2d')][_0xa96a('0x43')](_0x55b8be);})[_0xa96a('0x27')](function(_0x4b66f5){_0x5576b9['rows']=_0x4b66f5;return _0x5576b9;})['then'](respondWithFilteredResult(_0x5256cb,_0x55b8be))[_0xa96a('0x44')](handleError(_0x5256cb,null));};exports[_0xa96a('0x45')]=function(_0x231ff2,_0x48cc46){var _0x101191={'raw':!![],'where':{'id':_0x231ff2[_0xa96a('0x46')]['id']}},_0x2edf92={};_0x2edf92['model']=_[_0xa96a('0x47')](db[_0xa96a('0x2d')][_0xa96a('0x48')]);_0x2edf92[_0xa96a('0x32')]=_[_0xa96a('0x47')](_0x231ff2[_0xa96a('0x32')]);_0x2edf92[_0xa96a('0x33')]=_['intersection'](_0x2edf92[_0xa96a('0x31')],_0x2edf92[_0xa96a('0x32')]);_0x101191['attributes']=_['intersection'](_0x2edf92[_0xa96a('0x31')],qs[_0xa96a('0x36')](_0x231ff2['query']['fields']));_0x101191[_0xa96a('0x35')]=_0x101191[_0xa96a('0x35')][_0xa96a('0x37')]?_0x101191[_0xa96a('0x35')]:_0x2edf92[_0xa96a('0x31')];if(_0x231ff2['query'][_0xa96a('0x41')]){_0x101191[_0xa96a('0x42')]=[{'all':!![]}];}_0x101191=_[_0xa96a('0x3d')]({},_0x101191,_0x231ff2['options']);return db['DeskField'][_0xa96a('0x49')](_0x101191)[_0xa96a('0x27')](handleEntityNotFound(_0x48cc46,null))[_0xa96a('0x27')](respondWithResult(_0x48cc46,null))['catch'](handleError(_0x48cc46,null));};exports['create']=function(_0x1eea0f,_0x2bd9e2){return db[_0xa96a('0x2d')][_0xa96a('0x4a')](_0x1eea0f[_0xa96a('0x4b')],{})[_0xa96a('0x27')](respondWithResult(_0x2bd9e2,0xc9))[_0xa96a('0x44')](handleError(_0x2bd9e2,null));};exports[_0xa96a('0x4c')]=function(_0x193042,_0x2afe5b){if(_0x193042[_0xa96a('0x4b')]['id']){delete _0x193042[_0xa96a('0x4b')]['id'];}return db[_0xa96a('0x2d')][_0xa96a('0x49')]({'where':{'id':_0x193042[_0xa96a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2afe5b,null))[_0xa96a('0x27')](saveUpdates(_0x193042['body'],null))['then'](respondWithResult(_0x2afe5b,null))[_0xa96a('0x44')](handleError(_0x2afe5b,null));};exports['destroy']=function(_0x4608fa,_0x195188){return db[_0xa96a('0x2d')][_0xa96a('0x49')]({'where':{'id':_0x4608fa[_0xa96a('0x46')]['id']}})[_0xa96a('0x27')](handleEntityNotFound(_0x195188,null))[_0xa96a('0x27')](removeEntity(_0x195188,null))[_0xa96a('0x44')](handleError(_0x195188,null));}; \ No newline at end of file +var _0x8289=['show','params','keys','merge','find','catch','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','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','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll'];(function(_0x214691,_0x4d221b){var _0x16feb0=function(_0x43dbb2){while(--_0x43dbb2){_0x214691['push'](_0x214691['shift']());}};_0x16feb0(++_0x4d221b);}(_0x8289,0xf8));var _0x9828=function(_0x20ed15,_0x5cbc68){_0x20ed15=_0x20ed15-0x0;var _0x5dc256=_0x8289[_0x20ed15];return _0x5dc256;};'use strict';var emlformat=require(_0x9828('0x0'));var rimraf=require(_0x9828('0x1'));var zipdir=require(_0x9828('0x2'));var jsonpatch=require(_0x9828('0x3'));var rp=require(_0x9828('0x4'));var moment=require(_0x9828('0x5'));var BPromise=require(_0x9828('0x6'));var Mustache=require(_0x9828('0x7'));var util=require('util');var path=require(_0x9828('0x8'));var sox=require(_0x9828('0x9'));var csv=require(_0x9828('0xa'));var ejs=require(_0x9828('0xb'));var fs=require('fs');var fs_extra=require(_0x9828('0xc'));var _=require(_0x9828('0xd'));var squel=require(_0x9828('0xe'));var crypto=require(_0x9828('0xf'));var jsforce=require(_0x9828('0x10'));var deskjs=require(_0x9828('0x11'));var toCsv=require(_0x9828('0xa'));var querystring=require(_0x9828('0x12'));var Papa=require(_0x9828('0x13'));var Redis=require(_0x9828('0x14'));var authService=require(_0x9828('0x15'));var qs=require(_0x9828('0x16'));var as=require(_0x9828('0x17'));var hardwareService=require(_0x9828('0x18'));var logger=require(_0x9828('0x19'))('api');var utils=require(_0x9828('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x9828('0x1b'));var db=require(_0x9828('0x1c'))['db'];function respondWithStatusCode(_0x41320f,_0x3af102){_0x3af102=_0x3af102||0xcc;return function(_0x3186ee){if(_0x3186ee){return _0x41320f[_0x9828('0x1d')](_0x3af102);}return _0x41320f[_0x9828('0x1e')](_0x3af102)[_0x9828('0x1f')]();};}function respondWithResult(_0x30e8ee,_0x4132c4){_0x4132c4=_0x4132c4||0xc8;return function(_0x155343){if(_0x155343){return _0x30e8ee[_0x9828('0x1e')](_0x4132c4)[_0x9828('0x20')](_0x155343);}};}function respondWithFilteredResult(_0x43ff2b,_0x563eb1){return function(_0x44bea2){if(_0x44bea2){var _0x29ae36=typeof _0x563eb1[_0x9828('0x21')]===_0x9828('0x22')&&typeof _0x563eb1[_0x9828('0x23')]===_0x9828('0x22');var _0x1d14c8=_0x44bea2['count'];var _0x2fb19e=_0x29ae36?0x0:_0x563eb1['offset'];var _0x259f35=_0x29ae36?_0x44bea2[_0x9828('0x24')]:_0x563eb1[_0x9828('0x21')]+_0x563eb1[_0x9828('0x23')];var _0x3cc718;if(_0x259f35>=_0x1d14c8){_0x259f35=_0x1d14c8;_0x3cc718=0xc8;}else{_0x3cc718=0xce;}_0x43ff2b['status'](_0x3cc718);return _0x43ff2b[_0x9828('0x25')](_0x9828('0x26'),_0x2fb19e+'-'+_0x259f35+'/'+_0x1d14c8)['json'](_0x44bea2);}return null;};}function patchUpdates(_0x2eee4d){return function(_0x10bc8c){try{jsonpatch['apply'](_0x10bc8c,_0x2eee4d,!![]);}catch(_0x1e3caa){return BPromise[_0x9828('0x27')](_0x1e3caa);}return _0x10bc8c[_0x9828('0x28')]();};}function saveUpdates(_0x4836f6,_0x2e6c60){return function(_0x534b5e){if(_0x534b5e){return _0x534b5e[_0x9828('0x29')](_0x4836f6)[_0x9828('0x2a')](function(_0x344a1d){return _0x344a1d;});}return null;};}function removeEntity(_0x4b7484,_0x56c7a7){return function(_0x296037){if(_0x296037){return _0x296037[_0x9828('0x2b')]()[_0x9828('0x2a')](function(){_0x4b7484[_0x9828('0x1e')](0xcc)[_0x9828('0x1f')]();});}};}function handleEntityNotFound(_0x57b06a,_0x9466b0){return function(_0x3cb295){if(!_0x3cb295){_0x57b06a[_0x9828('0x1d')](0x194);}return _0x3cb295;};}function handleError(_0x58a08d,_0x4b9207){_0x4b9207=_0x4b9207||0x1f4;return function(_0x12744c){logger[_0x9828('0x2c')](_0x12744c[_0x9828('0x2d')]);if(_0x12744c[_0x9828('0x2e')]){delete _0x12744c[_0x9828('0x2e')];}_0x58a08d['status'](_0x4b9207)['send'](_0x12744c);};}exports[_0x9828('0x2f')]=function(_0x3f2f2a,_0x137338){var _0x93648={},_0x58acf2={},_0x5ef7a7={'count':0x0,'rows':[]};var _0x451983=_[_0x9828('0x30')](db[_0x9828('0x31')][_0x9828('0x32')],function(_0x37c81d){return{'name':_0x37c81d[_0x9828('0x33')],'type':_0x37c81d[_0x9828('0x34')][_0x9828('0x35')]};});_0x58acf2[_0x9828('0x36')]=_[_0x9828('0x30')](_0x451983,_0x9828('0x2e'));_0x58acf2[_0x9828('0x37')]=_['keys'](_0x3f2f2a[_0x9828('0x37')]);_0x58acf2[_0x9828('0x38')]=_['intersection'](_0x58acf2[_0x9828('0x36')],_0x58acf2[_0x9828('0x37')]);_0x93648[_0x9828('0x39')]=_[_0x9828('0x3a')](_0x58acf2[_0x9828('0x36')],qs[_0x9828('0x3b')](_0x3f2f2a[_0x9828('0x37')]['fields']));_0x93648['attributes']=_0x93648[_0x9828('0x39')][_0x9828('0x3c')]?_0x93648['attributes']:_0x58acf2['model'];if(!_0x3f2f2a['query'][_0x9828('0x3d')](_0x9828('0x3e'))){_0x93648['limit']=qs[_0x9828('0x23')](_0x3f2f2a[_0x9828('0x37')][_0x9828('0x23')]);_0x93648[_0x9828('0x21')]=qs[_0x9828('0x21')](_0x3f2f2a[_0x9828('0x37')][_0x9828('0x21')]);}_0x93648[_0x9828('0x3f')]=qs[_0x9828('0x40')](_0x3f2f2a[_0x9828('0x37')][_0x9828('0x40')]);_0x93648[_0x9828('0x41')]=qs['filters'](_['pick'](_0x3f2f2a[_0x9828('0x37')],_0x58acf2[_0x9828('0x38')]),_0x451983);if(_0x3f2f2a[_0x9828('0x37')][_0x9828('0x42')]){_0x93648[_0x9828('0x41')]=_['merge'](_0x93648['where'],{'$or':_['map'](_0x451983,function(_0x995ed9){if(_0x995ed9[_0x9828('0x34')]!==_0x9828('0x43')){var _0x2377aa={};_0x2377aa[_0x995ed9['name']]={'$like':'%'+_0x3f2f2a[_0x9828('0x37')][_0x9828('0x42')]+'%'};return _0x2377aa;}})});}_0x93648=_['merge']({},_0x93648,_0x3f2f2a[_0x9828('0x44')]);var _0x5962af={'where':_0x93648['where']};return db[_0x9828('0x31')][_0x9828('0x24')](_0x5962af)['then'](function(_0x25170b){_0x5ef7a7['count']=_0x25170b;if(_0x3f2f2a['query'][_0x9828('0x45')]){_0x93648[_0x9828('0x46')]=[{'all':!![]}];}return db['DeskField'][_0x9828('0x47')](_0x93648);})['then'](function(_0x29fb58){_0x5ef7a7['rows']=_0x29fb58;return _0x5ef7a7;})[_0x9828('0x2a')](respondWithFilteredResult(_0x137338,_0x93648))['catch'](handleError(_0x137338,null));};exports[_0x9828('0x48')]=function(_0x4f32fe,_0x2cdc7b){var _0x20162a={'raw':!![],'where':{'id':_0x4f32fe[_0x9828('0x49')]['id']}},_0x33889c={};_0x33889c[_0x9828('0x36')]=_[_0x9828('0x4a')](db[_0x9828('0x31')][_0x9828('0x32')]);_0x33889c[_0x9828('0x37')]=_[_0x9828('0x4a')](_0x4f32fe['query']);_0x33889c['filters']=_[_0x9828('0x3a')](_0x33889c[_0x9828('0x36')],_0x33889c[_0x9828('0x37')]);_0x20162a[_0x9828('0x39')]=_[_0x9828('0x3a')](_0x33889c[_0x9828('0x36')],qs[_0x9828('0x3b')](_0x4f32fe[_0x9828('0x37')]['fields']));_0x20162a[_0x9828('0x39')]=_0x20162a[_0x9828('0x39')]['length']?_0x20162a[_0x9828('0x39')]:_0x33889c[_0x9828('0x36')];if(_0x4f32fe[_0x9828('0x37')][_0x9828('0x45')]){_0x20162a[_0x9828('0x46')]=[{'all':!![]}];}_0x20162a=_[_0x9828('0x4b')]({},_0x20162a,_0x4f32fe[_0x9828('0x44')]);return db[_0x9828('0x31')][_0x9828('0x4c')](_0x20162a)[_0x9828('0x2a')](handleEntityNotFound(_0x2cdc7b,null))[_0x9828('0x2a')](respondWithResult(_0x2cdc7b,null))[_0x9828('0x4d')](handleError(_0x2cdc7b,null));};exports[_0x9828('0x4e')]=function(_0x5d147a,_0x1cb779){return db[_0x9828('0x31')][_0x9828('0x4e')](_0x5d147a[_0x9828('0x4f')],{})[_0x9828('0x2a')](respondWithResult(_0x1cb779,0xc9))[_0x9828('0x4d')](handleError(_0x1cb779,null));};exports['update']=function(_0x4ca19c,_0x1d3abd){if(_0x4ca19c[_0x9828('0x4f')]['id']){delete _0x4ca19c['body']['id'];}return db[_0x9828('0x31')][_0x9828('0x4c')]({'where':{'id':_0x4ca19c[_0x9828('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d3abd,null))[_0x9828('0x2a')](saveUpdates(_0x4ca19c[_0x9828('0x4f')],null))[_0x9828('0x2a')](respondWithResult(_0x1d3abd,null))[_0x9828('0x4d')](handleError(_0x1d3abd,null));};exports[_0x9828('0x2b')]=function(_0x304ed6,_0x98abbb){return db[_0x9828('0x31')][_0x9828('0x4c')]({'where':{'id':_0x304ed6['params']['id']}})['then'](handleEntityNotFound(_0x98abbb,null))['then'](removeEntity(_0x98abbb,null))[_0x9828('0x4d')](handleError(_0x98abbb,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 5f95834..dfab665 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 _0xf820=['int_desk_fields','desk_unique_index','FieldId','lodash','util','moment','rimraf','../../config/environment','exports'];(function(_0x570c8d,_0x430700){var _0x56d3f7=function(_0x2f0c40){while(--_0x2f0c40){_0x570c8d['push'](_0x570c8d['shift']());}};_0x56d3f7(++_0x430700);}(_0xf820,0x18f));var _0x0f82=function(_0x215be1,_0x2168c5){_0x215be1=_0x215be1-0x0;var _0x329b82=_0xf820[_0x215be1];return _0x329b82;};'use strict';var _=require(_0x0f82('0x0'));var util=require(_0x0f82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0f82('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f82('0x3'));var config=require(_0x0f82('0x4'));var attributes=require('./intDeskField.attributes');module[_0x0f82('0x5')]=function(_0x1a87f1,_0x3ccf41){return _0x1a87f1['define']('DeskField',attributes,{'tableName':_0x0f82('0x6'),'paranoid':![],'indexes':[{'name':_0x0f82('0x7'),'fields':['idField',_0x0f82('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf75=['util','../../config/logger','bluebird','request-promise','path','rimraf','./intDeskField.attributes','DeskField','int_desk_fields','FieldId','lodash'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xcf75,0x112));var _0x5cf7=function(_0x234214,_0xb4a789){_0x234214=_0x234214-0x0;var _0x231f3e=_0xcf75[_0x234214];return _0x231f3e;};'use strict';var _=require(_0x5cf7('0x0'));var util=require(_0x5cf7('0x1'));var logger=require(_0x5cf7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5cf7('0x3'));var rp=require(_0x5cf7('0x4'));var fs=require('fs');var path=require(_0x5cf7('0x5'));var rimraf=require(_0x5cf7('0x6'));var config=require('../../config/environment');var attributes=require(_0x5cf7('0x7'));module['exports']=function(_0x106b6c,_0xc302e6){return _0x106b6c['define'](_0x5cf7('0x8'),attributes,{'tableName':_0x5cf7('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x5cf7('0xa')],'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 34d6a44..f077610 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 _0x7c8d=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7c8d,0x156));var _0xd7c8=function(_0x1f6df2,_0x22a926){_0x1f6df2=_0x1f6df2-0x0;var _0x3ad5cc=_0x7c8d[_0x1f6df2];return _0x3ad5cc;};'use strict';var _=require('lodash');var util=require(_0xd7c8('0x0'));var moment=require(_0xd7c8('0x1'));var BPromise=require(_0xd7c8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7c8('0x3'));var db=require(_0xd7c8('0x4'))['db'];var utils=require(_0xd7c8('0x5'));var logger=require('../../config/logger')(_0xd7c8('0x6'));var config=require(_0xd7c8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd7c8('0x8')][_0xd7c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20dfcd,_0x2e1c23,_0x493522){return new BPromise(function(_0x463ffd,_0xb6b7bb){return client[_0xd7c8('0xa')](_0x20dfcd,_0x493522)[_0xd7c8('0xb')](function(_0x219d4d){logger[_0xd7c8('0xc')](_0xd7c8('0xd'),_0x2e1c23,'request\x20sent');logger[_0xd7c8('0xe')](_0xd7c8('0xf'),_0x2e1c23,_0xd7c8('0x10'),JSON[_0xd7c8('0x11')](_0x219d4d));if(_0x219d4d[_0xd7c8('0x12')]){if(_0x219d4d[_0xd7c8('0x12')][_0xd7c8('0x13')]===0x1f4){logger[_0xd7c8('0x12')](_0xd7c8('0xd'),_0x2e1c23,_0x219d4d['error'][_0xd7c8('0x14')]);return _0xb6b7bb(_0x219d4d[_0xd7c8('0x12')]['message']);}logger[_0xd7c8('0x12')](_0xd7c8('0xd'),_0x2e1c23,_0x219d4d[_0xd7c8('0x12')][_0xd7c8('0x14')]);return _0x463ffd(_0x219d4d['error'][_0xd7c8('0x14')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x2e1c23,_0xd7c8('0x10'));_0x463ffd(_0x219d4d[_0xd7c8('0x15')][_0xd7c8('0x14')]);}})[_0xd7c8('0x16')](function(_0x29b4e0){logger['error']('DeskField,\x20%s,\x20%s',_0x2e1c23,_0x29b4e0);_0xb6b7bb(_0x29b4e0);});});} \ No newline at end of file +var _0x430a=['rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x40af9a,_0x42fc9c){var _0x283f30=function(_0x492413){while(--_0x492413){_0x40af9a['push'](_0x40af9a['shift']());}};_0x283f30(++_0x42fc9c);}(_0x430a,0x1f3));var _0xa430=function(_0x1daa97,_0xbaa3fc){_0x1daa97=_0x1daa97-0x0;var _0x551a31=_0x430a[_0x1daa97];return _0x551a31;};'use strict';var _=require('lodash');var util=require(_0xa430('0x0'));var moment=require(_0xa430('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa430('0x2'));var db=require(_0xa430('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa430('0x4'))(_0xa430('0x5'));var config=require(_0xa430('0x6'));var jayson=require(_0xa430('0x7'));var client=jayson['client'][_0xa430('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1fa106,_0x5cde98,_0x1e7cde){return new BPromise(function(_0x484359,_0xf87939){return client[_0xa430('0x9')](_0x1fa106,_0x1e7cde)[_0xa430('0xa')](function(_0x4ccdf8){logger[_0xa430('0xb')](_0xa430('0xc'),_0x5cde98,_0xa430('0xd'));logger[_0xa430('0xe')](_0xa430('0xf'),_0x5cde98,_0xa430('0xd'),JSON[_0xa430('0x10')](_0x4ccdf8));if(_0x4ccdf8[_0xa430('0x11')]){if(_0x4ccdf8[_0xa430('0x11')][_0xa430('0x12')]===0x1f4){logger[_0xa430('0x11')](_0xa430('0xc'),_0x5cde98,_0x4ccdf8['error'][_0xa430('0x13')]);return _0xf87939(_0x4ccdf8['error']['message']);}logger[_0xa430('0x11')](_0xa430('0xc'),_0x5cde98,_0x4ccdf8[_0xa430('0x11')][_0xa430('0x13')]);return _0x484359(_0x4ccdf8['error'][_0xa430('0x13')]);}else{logger[_0xa430('0xb')](_0xa430('0xc'),_0x5cde98,_0xa430('0xd'));_0x484359(_0x4ccdf8[_0xa430('0x14')]['message']);}})['catch'](function(_0x51b2fc){logger[_0xa430('0x11')](_0xa430('0xc'),_0x5cde98,_0x51b2fc);_0xf87939(_0x51b2fc);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index c8830aa..1b0eca7 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 _0x8bd6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bd6,0x163));var _0x68bd=function(_0x303afb,_0x2501be){_0x303afb=_0x303afb-0x0;var _0x2eb76a=_0x8bd6[_0x303afb];return _0x2eb76a;};'use strict';var multer=require(_0x68bd('0x0'));var util=require(_0x68bd('0x1'));var path=require(_0x68bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x68bd('0x3'));var router=express[_0x68bd('0x4')]();var fs_extra=require(_0x68bd('0x5'));var auth=require(_0x68bd('0x6'));var interaction=require(_0x68bd('0x7'));var config=require(_0x68bd('0x8'));var controller=require(_0x68bd('0x9'));router[_0x68bd('0xa')]('/',auth[_0x68bd('0xb')](),controller[_0x68bd('0xc')]);router[_0x68bd('0xa')](_0x68bd('0xd'),auth['isAuthenticated'](),controller[_0x68bd('0xe')]);router[_0x68bd('0xa')]('/:id/configurations',auth[_0x68bd('0xb')](),controller['getConfigurations']);router['get'](_0x68bd('0xf'),auth['isAuthenticated'](),controller[_0x68bd('0x10')]);router[_0x68bd('0x11')]('/',auth['isAuthenticated'](),controller[_0x68bd('0x12')]);router['post'](_0x68bd('0x13'),auth[_0x68bd('0xb')](),controller[_0x68bd('0x14')]);router['put'](_0x68bd('0xd'),auth[_0x68bd('0xb')](),controller[_0x68bd('0x15')]);router[_0x68bd('0x16')](_0x68bd('0xd'),auth[_0x68bd('0xb')](),controller['destroy']);module[_0x68bd('0x17')]=router; \ No newline at end of file +var _0x02d1=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x2e3f7e,_0x519233){var _0x15834b=function(_0x116989){while(--_0x116989){_0x2e3f7e['push'](_0x2e3f7e['shift']());}};_0x15834b(++_0x519233);}(_0x02d1,0x94));var _0x102d=function(_0x37bf49,_0x45555c){_0x37bf49=_0x37bf49-0x0;var _0x323eee=_0x02d1[_0x37bf49];return _0x323eee;};'use strict';var multer=require('multer');var util=require(_0x102d('0x0'));var path=require(_0x102d('0x1'));var timeout=require('connect-timeout');var express=require(_0x102d('0x2'));var router=express[_0x102d('0x3')]();var fs_extra=require(_0x102d('0x4'));var auth=require(_0x102d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x102d('0x6'));router[_0x102d('0x7')]('/',auth[_0x102d('0x8')](),controller[_0x102d('0x9')]);router[_0x102d('0x7')](_0x102d('0xa'),auth[_0x102d('0x8')](),controller[_0x102d('0xb')]);router[_0x102d('0x7')](_0x102d('0xc'),auth['isAuthenticated'](),controller[_0x102d('0xd')]);router[_0x102d('0x7')](_0x102d('0xe'),auth[_0x102d('0x8')](),controller[_0x102d('0xf')]);router[_0x102d('0x10')]('/',auth[_0x102d('0x8')](),controller[_0x102d('0x11')]);router[_0x102d('0x10')](_0x102d('0xc'),auth[_0x102d('0x8')](),controller[_0x102d('0x12')]);router[_0x102d('0x13')](_0x102d('0xa'),auth[_0x102d('0x8')](),controller[_0x102d('0x14')]);router[_0x102d('0x15')](_0x102d('0xa'),auth['isAuthenticated'](),controller[_0x102d('0x16')]);module[_0x102d('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 f168d27..0530699 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 _0x86b8=['STRING','sequelize','exports'];(function(_0x16a0d9,_0x22a723){var _0x59df04=function(_0x430b01){while(--_0x430b01){_0x16a0d9['push'](_0x16a0d9['shift']());}};_0x59df04(++_0x22a723);}(_0x86b8,0x15d));var _0x886b=function(_0x1a5529,_0x232747){_0x1a5529=_0x1a5529-0x0;var _0x30ec1a=_0x86b8[_0x1a5529];return _0x30ec1a;};'use strict';var Sequelize=require(_0x886b('0x0'));module[_0x886b('0x1')]={'name':{'type':Sequelize[_0x886b('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x886b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x886b('0x2')]},'clientId':{'type':Sequelize[_0x886b('0x2')]},'clientSecret':{'type':Sequelize[_0x886b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x886b('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xbeea=['sequelize','STRING','BOOLEAN'];(function(_0x4824d4,_0x1bfad0){var _0x59026b=function(_0x46ee5d){while(--_0x46ee5d){_0x4824d4['push'](_0x4824d4['shift']());}};_0x59026b(++_0x1bfad0);}(_0xbeea,0xb1));var _0xabee=function(_0x69c9a6,_0x59bf4d){_0x69c9a6=_0x69c9a6-0x0;var _0x3fb1a2=_0xbeea[_0x69c9a6];return _0x3fb1a2;};'use strict';var Sequelize=require(_0xabee('0x0'));module['exports']={'name':{'type':Sequelize[_0xabee('0x1')]},'username':{'type':Sequelize[_0xabee('0x1')]},'password':{'type':Sequelize[_0xabee('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xabee('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xabee('0x1')]},'serverUrl':{'type':Sequelize[_0xabee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xabee('0x1')]},'modernAuthentication':{'type':Sequelize[_0xabee('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 985839d..7b440a1 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 _0xa7a4=['versionnumber','password','remoteUri','clientSecret','modernAuthentication','CloudProvider','access_token','data5','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','GET','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','@odata.type','PicklistAttributeMetadata','forEach','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','error','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','LogicalName','DisplayName','EntityDefinitions(','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','then','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','query','model','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','keys','length','find','create','update','body','params','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xa7a4,0xf6));var _0x4a7a=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0xa7a4[_0x5e8eae];return _0xdd09cd;};'use strict';var rp=require(_0x4a7a('0x0'));var util=require(_0x4a7a('0x1'));var _=require(_0x4a7a('0x2'));var qs=require(_0x4a7a('0x3'));var logger=require(_0x4a7a('0x4'))(_0x4a7a('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4a7a('0x6'));function respondWithResult(_0x1286e8,_0x4f058d){_0x4f058d=_0x4f058d||0xc8;return function(_0x4aad79){if(_0x4aad79){return _0x1286e8[_0x4a7a('0x7')](_0x4f058d)[_0x4a7a('0x8')](_0x4aad79);}};}function respondWithFilteredResult(_0x3ba889,_0x3ee10b){return function(_0x1339f5){if(_0x1339f5){var _0x539bc8=typeof _0x3ee10b[_0x4a7a('0x9')]===_0x4a7a('0xa')&&typeof _0x3ee10b[_0x4a7a('0xb')]===_0x4a7a('0xa');var _0x1cbffb=_0x1339f5[_0x4a7a('0xc')];var _0x5c0045=_0x539bc8?0x0:_0x3ee10b['offset'];var _0x2d8397=_0x539bc8?_0x1339f5[_0x4a7a('0xc')]:_0x3ee10b[_0x4a7a('0x9')]+_0x3ee10b[_0x4a7a('0xb')];var _0x26f9aa;if(_0x2d8397>=_0x1cbffb){_0x2d8397=_0x1cbffb;_0x26f9aa=0xc8;}else{_0x26f9aa=0xce;}_0x3ba889[_0x4a7a('0x7')](_0x26f9aa);return _0x3ba889[_0x4a7a('0xd')](_0x4a7a('0xe'),_0x5c0045+'-'+_0x2d8397+'/'+_0x1cbffb)[_0x4a7a('0x8')](_0x1339f5);}return null;};}function saveUpdates(_0x2a88bb){return function(_0x11cc3f){if(_0x11cc3f){return _0x11cc3f['update'](_0x2a88bb)[_0x4a7a('0xf')](function(_0x63f4d7){return _0x63f4d7;});}return null;};}function removeEntity(_0x4ce375){return function(_0x5c7d4a){if(_0x5c7d4a){return _0x5c7d4a['destroy']()[_0x4a7a('0xf')](function(){_0x4ce375[_0x4a7a('0x7')](0xcc)[_0x4a7a('0x10')]();});}};}function handleEntityNotFound(_0x5d42e9){return function(_0xae416f){if(!_0xae416f){_0x5d42e9[_0x4a7a('0x11')](0x194);}return _0xae416f;};}function handleError(_0x7befc4,_0x1aec42){_0x1aec42=_0x1aec42||0x1f4;return function(_0x55a267){logger['error'](_0x55a267[_0x4a7a('0x12')]);if(_0x55a267[_0x4a7a('0x13')]){delete _0x55a267[_0x4a7a('0x13')];}_0x7befc4['status'](_0x1aec42)[_0x4a7a('0x14')](_0x55a267);};}exports[_0x4a7a('0x15')]=function(_0x27a7bd,_0x4c9c12){var _0x57d630={},_0xce4e71={},_0x32a7a3={'count':0x0,'rows':[]};var _0x58b16c=_[_0x4a7a('0x16')](db['Dynamics365Account'][_0x4a7a('0x17')],function(_0x3a12ff){return{'name':_0x3a12ff[_0x4a7a('0x18')],'type':_0x3a12ff['type']['key']};});_0xce4e71['model']=_[_0x4a7a('0x16')](_0x58b16c,'name');_0xce4e71[_0x4a7a('0x19')]=_['keys'](_0x27a7bd[_0x4a7a('0x19')]);_0xce4e71['filters']=_['intersection'](_0xce4e71[_0x4a7a('0x1a')],_0xce4e71['query']);_0x57d630[_0x4a7a('0x1b')]=_[_0x4a7a('0x1c')](_0xce4e71[_0x4a7a('0x1a')],qs[_0x4a7a('0x1d')](_0x27a7bd[_0x4a7a('0x19')][_0x4a7a('0x1d')]));_0x57d630[_0x4a7a('0x1b')]=_0x57d630[_0x4a7a('0x1b')]['length']?_0x57d630['attributes']:_0xce4e71[_0x4a7a('0x1a')];if(!_0x27a7bd[_0x4a7a('0x19')]['hasOwnProperty'](_0x4a7a('0x1e'))){_0x57d630[_0x4a7a('0xb')]=qs[_0x4a7a('0xb')](_0x27a7bd[_0x4a7a('0x19')][_0x4a7a('0xb')]);_0x57d630[_0x4a7a('0x9')]=qs[_0x4a7a('0x9')](_0x27a7bd[_0x4a7a('0x19')][_0x4a7a('0x9')]);}_0x57d630[_0x4a7a('0x1f')]=qs[_0x4a7a('0x20')](_0x27a7bd[_0x4a7a('0x19')]['sort']);_0x57d630[_0x4a7a('0x21')]=qs[_0x4a7a('0x22')](_[_0x4a7a('0x23')](_0x27a7bd[_0x4a7a('0x19')],_0xce4e71['filters']),_0x58b16c);if(_0x27a7bd[_0x4a7a('0x19')][_0x4a7a('0x24')]){_0x57d630[_0x4a7a('0x21')]=_[_0x4a7a('0x25')](_0x57d630[_0x4a7a('0x21')],{'$or':_[_0x4a7a('0x16')](_0x58b16c,function(_0x2efcd5){if(_0x2efcd5['type']!==_0x4a7a('0x26')){var _0x13f4c3={};_0x13f4c3[_0x2efcd5[_0x4a7a('0x13')]]={'$like':'%'+_0x27a7bd[_0x4a7a('0x19')][_0x4a7a('0x24')]+'%'};return _0x13f4c3;}})});}_0x57d630=_[_0x4a7a('0x25')]({},_0x57d630,_0x27a7bd[_0x4a7a('0x27')]);var _0x26581b={'where':_0x57d630['where']};return db[_0x4a7a('0x28')][_0x4a7a('0xc')](_0x26581b)[_0x4a7a('0xf')](function(_0x1648c7){_0x32a7a3[_0x4a7a('0xc')]=_0x1648c7;if(_0x27a7bd[_0x4a7a('0x19')][_0x4a7a('0x29')]){_0x57d630[_0x4a7a('0x2a')]=[{'all':!![]}];}return db[_0x4a7a('0x28')][_0x4a7a('0x2b')](_0x57d630);})['then'](function(_0x22758b){_0x32a7a3[_0x4a7a('0x2c')]=_0x22758b;return _0x32a7a3;})[_0x4a7a('0xf')](respondWithFilteredResult(_0x4c9c12,_0x57d630))[_0x4a7a('0x2d')](handleError(_0x4c9c12,null));};exports[_0x4a7a('0x2e')]=function(_0x4b4583,_0x2dd5bc){var _0x41fd14={'raw':![],'where':{'id':_0x4b4583['params']['id']}},_0x34e3f9={};_0x34e3f9['model']=_[_0x4a7a('0x2f')](db[_0x4a7a('0x28')][_0x4a7a('0x17')]);_0x34e3f9[_0x4a7a('0x19')]=_[_0x4a7a('0x2f')](_0x4b4583[_0x4a7a('0x19')]);_0x34e3f9[_0x4a7a('0x22')]=_[_0x4a7a('0x1c')](_0x34e3f9[_0x4a7a('0x1a')],_0x34e3f9[_0x4a7a('0x19')]);_0x41fd14[_0x4a7a('0x1b')]=_['intersection'](_0x34e3f9[_0x4a7a('0x1a')],qs['fields'](_0x4b4583[_0x4a7a('0x19')][_0x4a7a('0x1d')]));_0x41fd14['attributes']=_0x41fd14[_0x4a7a('0x1b')][_0x4a7a('0x30')]?_0x41fd14['attributes']:_0x34e3f9[_0x4a7a('0x1a')];if(_0x4b4583['query'][_0x4a7a('0x29')]){_0x41fd14[_0x4a7a('0x2a')]=[{'all':!![]}];}_0x41fd14=_[_0x4a7a('0x25')]({},_0x41fd14,_0x4b4583[_0x4a7a('0x27')]);return db['Dynamics365Account'][_0x4a7a('0x31')](_0x41fd14)[_0x4a7a('0xf')](handleEntityNotFound(_0x2dd5bc,null))[_0x4a7a('0xf')](respondWithResult(_0x2dd5bc,null))['catch'](handleError(_0x2dd5bc,null));};exports[_0x4a7a('0x32')]=function(_0x4b05b7,_0x471350){return db[_0x4a7a('0x28')]['create'](_0x4b05b7['body'],{})[_0x4a7a('0xf')](respondWithResult(_0x471350,0xc9))[_0x4a7a('0x2d')](handleError(_0x471350,null));};exports[_0x4a7a('0x33')]=function(_0x36cbbd,_0x47cc52){if(_0x36cbbd[_0x4a7a('0x34')]['id']){delete _0x36cbbd[_0x4a7a('0x34')]['id'];}return db[_0x4a7a('0x28')][_0x4a7a('0x31')]({'where':{'id':_0x36cbbd[_0x4a7a('0x35')]['id']}})['then'](handleEntityNotFound(_0x47cc52,null))['then'](saveUpdates(_0x36cbbd['body'],null))[_0x4a7a('0xf')](respondWithResult(_0x47cc52,null))[_0x4a7a('0x2d')](handleError(_0x47cc52,null));};exports[_0x4a7a('0x36')]=function(_0x45cb97,_0x3fb0ff){return db['Dynamics365Account'][_0x4a7a('0x31')]({'where':{'id':_0x45cb97[_0x4a7a('0x35')]['id']}})['then'](handleEntityNotFound(_0x3fb0ff,null))['then'](removeEntity(_0x3fb0ff,null))[_0x4a7a('0x2d')](handleError(_0x3fb0ff,null));};exports[_0x4a7a('0x37')]=function(_0x54e01a,_0x299021){var _0x2b15da={};var _0x259cf7={};var _0x2f2721;var _0x4a94b9;return db[_0x4a7a('0x28')][_0x4a7a('0x38')]({'where':{'id':_0x54e01a['params']['id']}})['then'](handleEntityNotFound(_0x299021,null))['then'](function(_0x3b0f9f){if(_0x3b0f9f){_0x2f2721=_0x3b0f9f;_0x259cf7[_0x4a7a('0x1a')]=_[_0x4a7a('0x2f')](db['Dynamics365Configuration'][_0x4a7a('0x17')]);_0x259cf7['query']=_[_0x4a7a('0x2f')](_0x54e01a[_0x4a7a('0x19')]);_0x259cf7[_0x4a7a('0x22')]=_['intersection'](_0x259cf7[_0x4a7a('0x1a')],_0x259cf7[_0x4a7a('0x19')]);_0x2b15da['attributes']=_[_0x4a7a('0x1c')](_0x259cf7[_0x4a7a('0x1a')],qs[_0x4a7a('0x1d')](_0x54e01a['query'][_0x4a7a('0x1d')]));_0x2b15da[_0x4a7a('0x1b')]=_0x2b15da['attributes'][_0x4a7a('0x30')]?_0x2b15da[_0x4a7a('0x1b')]:_0x259cf7[_0x4a7a('0x1a')];_0x2b15da[_0x4a7a('0x1f')]=qs['sort'](_0x54e01a['query']['sort']);_0x2b15da[_0x4a7a('0x21')]=qs['filters'](_['pick'](_0x54e01a[_0x4a7a('0x19')],_0x259cf7['filters']));if(_0x54e01a[_0x4a7a('0x19')][_0x4a7a('0x24')]){_0x2b15da['where']=_[_0x4a7a('0x25')](_0x2b15da[_0x4a7a('0x21')],{'$or':_[_0x4a7a('0x16')](_0x2b15da['attributes'],function(_0x20a750){var _0x2604fd={};_0x2604fd[_0x20a750]={'$like':'%'+_0x54e01a[_0x4a7a('0x19')][_0x4a7a('0x24')]+'%'};return _0x2604fd;})});}_0x2b15da=_['merge']({},_0x2b15da,_0x54e01a[_0x4a7a('0x27')]);return _0x2f2721[_0x4a7a('0x37')](_0x2b15da);}})[_0x4a7a('0xf')](function(_0x2ab237){if(_0x2ab237){_0x4a94b9=_0x2ab237['length'];if(!_0x54e01a[_0x4a7a('0x19')][_0x4a7a('0x39')](_0x4a7a('0x1e'))){_0x2b15da['limit']=qs['limit'](_0x54e01a[_0x4a7a('0x19')][_0x4a7a('0xb')]);_0x2b15da[_0x4a7a('0x9')]=qs[_0x4a7a('0x9')](_0x54e01a['query'][_0x4a7a('0x9')]);}return _0x2f2721[_0x4a7a('0x37')](_0x2b15da);}})[_0x4a7a('0xf')](function(_0x5ab774){if(_0x5ab774){return _0x5ab774?{'count':_0x4a94b9,'rows':_0x5ab774}:null;}})['then'](respondWithResult(_0x299021,null))[_0x4a7a('0x2d')](handleError(_0x299021,null));};exports[_0x4a7a('0x3a')]=function(_0x46e433,_0x4bd72b){if(_0x46e433[_0x4a7a('0x34')]['id']){delete _0x46e433[_0x4a7a('0x34')]['id'];}return db[_0x4a7a('0x28')][_0x4a7a('0x38')]({'where':{'id':_0x46e433[_0x4a7a('0x35')]['id']}})[_0x4a7a('0xf')](handleEntityNotFound(_0x4bd72b,null))[_0x4a7a('0xf')](function(_0x42930c){if(_0x42930c){_0x46e433[_0x4a7a('0x34')][_0x4a7a('0x3b')]=_0x42930c['id'];_0x46e433[_0x4a7a('0x34')][_0x4a7a('0x3c')]=integrations['getSubjects'](_0x46e433[_0x4a7a('0x34')][_0x4a7a('0x3d')],_0x46e433[_0x4a7a('0x34')][_0x4a7a('0x3e')]);_0x46e433[_0x4a7a('0x34')][_0x4a7a('0x3f')]=integrations[_0x4a7a('0x40')](_0x46e433[_0x4a7a('0x34')][_0x4a7a('0x3d')],_0x46e433[_0x4a7a('0x34')][_0x4a7a('0x3e')]);return db['Dynamics365Configuration'][_0x4a7a('0x32')](_0x46e433['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x4a7a('0x3c')},{'model':db[_0x4a7a('0x41')],'as':_0x4a7a('0x3f')}]});}return null;})[_0x4a7a('0xf')](respondWithResult(_0x4bd72b,null))['catch'](handleError(_0x4bd72b,null));};function sanitizeRemoteUri(_0x263495){var _0xd819fe=_0x263495['slice'](-0x1);if(_0xd819fe==='/')return _0x263495[_0x4a7a('0x42')](0x0,_0x263495[_0x4a7a('0x43')](_0xd819fe));return _0x263495;}function getWebApiUrl(_0x20ebec){return util[_0x4a7a('0x44')]('%s/api/data/v9.0/',_0x20ebec);}exports[_0x4a7a('0x45')]=function(_0x4fbb95,_0x17cea5){var _0x44f4ee=_0x4fbb95[_0x4a7a('0x19')][_0x4a7a('0x46')];var _0x5bf1e4=_0x44f4ee===_0x4a7a('0x47')?_0x4a7a('0x48'):'PhoneCall';var _0xe4d61d='';var _0x4bea78='';var _0x3399da='';var _0x3d5679='';var _0x2e9750='';var _0x38d517='';var _0x35f4af='';var _0x44e10f='';var _0x1f2343=[_0x4a7a('0x49'),_0x4a7a('0x4a'),_0x4a7a('0x4b'),_0x4a7a('0x4c'),_0x4a7a('0x4d'),_0x4a7a('0x4e'),_0x4a7a('0x4f'),'regardingobjectid','directioncode',_0x4a7a('0x50')];var _0x1cc359=['accountidname',_0x4a7a('0x51'),_0x4a7a('0x52'),_0x4a7a('0x53'),'contactidname',_0x4a7a('0x54'),_0x4a7a('0x55'),_0x4a7a('0x56'),_0x4a7a('0x57'),_0x4a7a('0x58'),_0x4a7a('0x59'),'createdbyyominame',_0x4a7a('0x5a'),_0x4a7a('0x5b'),_0x4a7a('0x5c'),'customeridname',_0x4a7a('0x5d'),_0x4a7a('0x5e'),_0x4a7a('0x5f'),_0x4a7a('0x60'),_0x4a7a('0x61'),_0x4a7a('0x62'),_0x4a7a('0x63'),'exchangerate',_0x4a7a('0x64'),_0x4a7a('0x65'),_0x4a7a('0x66'),_0x4a7a('0x67'),_0x4a7a('0x68'),'lastonholdtime','masteridname',_0x4a7a('0x69'),'modifiedbyexternalpartyyominame',_0x4a7a('0x6a'),_0x4a7a('0x6b'),_0x4a7a('0x6c'),'modifiedonbehalfbyname',_0x4a7a('0x6d'),_0x4a7a('0x6e'),_0x4a7a('0x6f'),_0x4a7a('0x70'),'onholdtime',_0x4a7a('0x71'),_0x4a7a('0x72'),_0x4a7a('0x73'),_0x4a7a('0x74'),_0x4a7a('0x75'),_0x4a7a('0x76'),_0x4a7a('0x77'),_0x4a7a('0x78'),_0x4a7a('0x79'),_0x4a7a('0x7a'),'resolveby',_0x4a7a('0x7b'),_0x4a7a('0x7c'),_0x4a7a('0x7d'),_0x4a7a('0x7e'),'sentimentvalue',_0x4a7a('0x7f'),'slaname',_0x4a7a('0x80'),_0x4a7a('0x81'),_0x4a7a('0x82'),_0x4a7a('0x83'),_0x4a7a('0x84'),'timezoneruleversionnumber',_0x4a7a('0x85'),_0x4a7a('0x86'),_0x4a7a('0x87'),_0x4a7a('0x88')];var _0x38cda5=_0x1f2343['concat'](_0x1cc359);return db['Dynamics365Account'][_0x4a7a('0x38')]({'where':{'id':_0x4fbb95[_0x4a7a('0x35')]['id']},'attributes':['id','username',_0x4a7a('0x89'),_0x4a7a('0x8a'),'tenantId','clientId',_0x4a7a('0x8b'),_0x4a7a('0x8c')],'include':[{'model':db[_0x4a7a('0x8d')],'as':_0x4a7a('0x8d'),'attributes':['id','data5','data7']}]})[_0x4a7a('0xf')](handleEntityNotFound(_0x17cea5,null))[_0x4a7a('0xf')](function(_0x2768af){if(_0x2768af){if(_0x2768af[_0x4a7a('0x8c')]){_0x2768af[_0x4a7a('0x8e')]=_0x2768af[_0x4a7a('0x8d')][_0x4a7a('0x8f')];_0x44e10f=sanitizeRemoteUri(_0x2768af[_0x4a7a('0x8d')]['data7']);_0x35f4af=getWebApiUrl(_0x44e10f);return _0x2768af;}_0x44e10f=sanitizeRemoteUri(_0x2768af['remoteUri']);_0x35f4af=getWebApiUrl(_0x44e10f);var _0x26c523={'method':_0x4a7a('0x90'),'uri':_0x4a7a('0x91')+_0x2768af[_0x4a7a('0x92')]+_0x4a7a('0x93'),'form':{'client_id':_0x2768af[_0x4a7a('0x94')],'resource':_0x44e10f,'username':_0x2768af['username'],'password':_0x2768af[_0x4a7a('0x89')],'grant_type':'password','client_secret':_0x2768af[_0x4a7a('0x8b')]},'json':!![]};return rp(_0x26c523);}})[_0x4a7a('0xf')](function(_0x574b08){_0x38d517=_0x574b08[_0x4a7a('0x8e')];var _0x42f4d6={'method':_0x4a7a('0x95'),'uri':encodeURI(_0x35f4af+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5bf1e4+'\x27'),'headers':{'Authorization':_0x4a7a('0x96')+_0x38d517,'If-None-Match':null,'OData-Version':_0x4a7a('0x97')},'json':!![]};return rp(_0x42f4d6);})[_0x4a7a('0xf')](function(_0x4ba636){var _0x9a2a10=_0x4ba636[_0x4a7a('0x98')][0x0];var _0xd6d421=_0x9a2a10[_0x4a7a('0x99')];var _0x55a34f={'method':_0x4a7a('0x95'),'uri':_0x35f4af+'EntityDefinitions('+_0xd6d421+_0x4a7a('0x9a'),'headers':{'Authorization':'Bearer\x20'+_0x38d517,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x55a34f);})['then'](function(_0x5bb54e){_0xe4d61d=_0x5bb54e;_0x4bea78=_0xe4d61d[_0x4a7a('0x9b')];_0x4bea78=_['remove'](_0x4bea78,function(_0x5cffd4){return!_0x38cda5[_0x4a7a('0x9c')](_0x5cffd4['LogicalName']);});var _0x25c62f=[];var _0x475548=[];_0x4bea78['forEach'](function(_0x5008f9){if(_0x5008f9[_0x4a7a('0x9d')]){var _0x33a0fe=_0x5008f9[_0x4a7a('0x9d')][_0x4a7a('0x42')](_0x5008f9[_0x4a7a('0x9d')]['lastIndexOf']('.')+0x1);if(_0x33a0fe===_0x4a7a('0x9e')){_0x25c62f['push'](getSelectList(_0x35f4af,_0x44f4ee,_0x475548,_0xe4d61d['MetadataId'],_0x5008f9[_0x4a7a('0x99')],_0x38d517));}}});return Promise['all'](_0x25c62f);})[_0x4a7a('0xf')](function(_0x3def96){_0x3399da=_0x3def96[0x0];var _0x460614=[];var _0x30a1ba=[];_0x4bea78[_0x4a7a('0x9f')](function(_0x58ce22){if(!_[_0x4a7a('0xa0')](_0x58ce22[_0x4a7a('0x9d')])){var _0x8eb14a=_0x58ce22['@odata.type'][_0x4a7a('0x42')](_0x58ce22['@odata.type'][_0x4a7a('0x43')]('.')+0x1);if(_0x8eb14a===_0x4a7a('0xa1')){_0x460614[_0x4a7a('0xa2')](getBooleanList(_0x35f4af,_0x44f4ee,_0x30a1ba,_0xe4d61d[_0x4a7a('0x99')],_0x58ce22[_0x4a7a('0x99')],_0x38d517));}}});return Promise[_0x4a7a('0xa3')](_0x460614);})[_0x4a7a('0xf')](function(_0x28dfe0){_0x3d5679=_0x28dfe0[0x0];var _0x449db6=[];var _0x375874=[];_0x4bea78[_0x4a7a('0x9f')](function(_0x3615a){if(_0x3615a[_0x4a7a('0x9d')]){var _0x22968c=_0x3615a[_0x4a7a('0x9d')][_0x4a7a('0x42')](_0x3615a[_0x4a7a('0x9d')][_0x4a7a('0x43')]('.')+0x1);if(_0x22968c===_0x4a7a('0xa4')||_0x22968c==='DoubleAttributeMetadata'||_0x22968c===_0x4a7a('0xa5')||_0x22968c===_0x4a7a('0xa6')||_0x22968c===_0x4a7a('0xa7')||_0x22968c===_0x4a7a('0xa8')||_0x22968c==='StatusAttributeMetadata'||_0x22968c===_0x4a7a('0xa9')||_0x22968c===_0x4a7a('0xaa')||_0x22968c===_0x4a7a('0xab')){_0x449db6[_0x4a7a('0xa2')](getInputList(_0x35f4af,_0x44f4ee,_0x22968c,_0x375874,_0xe4d61d[_0x4a7a('0x99')],_0x3615a['MetadataId'],_0x38d517));}}});return Promise[_0x4a7a('0xa3')](_0x449db6);})[_0x4a7a('0xf')](function(_0x3b1726){_0x2e9750=_0x3b1726[0x0];var _0x4a2022=_0x3399da[_0x4a7a('0xac')](_0x3d5679)[_0x4a7a('0xac')](_0x2e9750);var _0x21dba5={'count':_0x4a2022[_0x4a7a('0x30')],'rows':_0x4a2022};return _0x21dba5;})['then'](respondWithResult(_0x17cea5,null))['catch'](function(_0x34b3a6){var _0x4557ae=_0x4fbb95[_0x4a7a('0x19')][_0x4a7a('0xad')]?0x1f4:_0x34b3a6['statusCode']||0x1f4;logger[_0x4a7a('0xae')](_0x34b3a6[_0x4a7a('0x12')]);delete _0x34b3a6[_0x4a7a('0x13')];if(_0x4557ae===0x191){_0x4557ae=0x190;}_0x17cea5['status'](_0x4557ae)['send'](_0x4fbb95[_0x4a7a('0x19')][_0x4a7a('0xad')]?{'message':_0x4a7a('0xaf'),'statusCode':_0x34b3a6[_0x4a7a('0xb0')]}:_0x34b3a6);});};function getSelectList(_0x5b0684,_0x1467a4,_0x6a8e0c,_0x35f9d7,_0x5c6f72,_0x47e73d){var _0x48f0e9={'method':_0x4a7a('0x95'),'uri':_0x5b0684+'EntityDefinitions('+_0x35f9d7+_0x4a7a('0xb1')+_0x5c6f72+_0x4a7a('0xb2')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x47e73d,'If-None-Match':null,'OData-Version':_0x4a7a('0x97')},'json':!![]};return rp(_0x48f0e9)[_0x4a7a('0xf')](function(_0x5fd5a4){var _0x50c6a9=[];var _0x5b1eaa=_0x5fd5a4[_0x4a7a('0xb3')][_0x4a7a('0xb4')];_0x5b1eaa['forEach'](function(_0x39ed05){_0x50c6a9[_0x4a7a('0xa2')]({'name':_0x39ed05[_0x4a7a('0xb5')][_0x4a7a('0xb6')][_0x4a7a('0xb5')],'value':String(_0x39ed05['Value'])});});var _0x194978={'id':_0x1467a4+'_'+_0x5fd5a4[_0x4a7a('0xb7')],'name':_0x5fd5a4[_0x4a7a('0xb8')][_0x4a7a('0xb6')][_0x4a7a('0xb5')],'custom':![],'options':_0x50c6a9};_0x6a8e0c['push'](_0x194978);return _0x6a8e0c;});}function getBooleanList(_0x14245d,_0x30ded3,_0x2e57a8,_0x5f1c71,_0x12bd74,_0x553ef7){var _0x219f32={'method':_0x4a7a('0x95'),'uri':_0x14245d+_0x4a7a('0xb9')+_0x5f1c71+')/Attributes('+_0x12bd74+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x4a7a('0x96')+_0x553ef7,'If-None-Match':null,'OData-Version':_0x4a7a('0x97')},'json':!![]};return rp(_0x219f32)[_0x4a7a('0xf')](function(_0x5dd4ad){var _0x16cbd7=[];_0x16cbd7[_0x4a7a('0xa2')]({'name':_0x5dd4ad[_0x4a7a('0xb3')]['TrueOption'][_0x4a7a('0xb5')][_0x4a7a('0xb6')][_0x4a7a('0xb5')],'value':_0x4a7a('0xba')},{'name':_0x5dd4ad[_0x4a7a('0xb3')][_0x4a7a('0xbb')][_0x4a7a('0xb5')][_0x4a7a('0xb6')]['Label'],'value':_0x4a7a('0xbc')});var _0x5b76a7={'id':_0x30ded3+'_'+_0x5dd4ad['LogicalName'],'name':_0x5dd4ad[_0x4a7a('0xb8')]['UserLocalizedLabel'][_0x4a7a('0xb5')],'custom':![],'options':_0x16cbd7};_0x2e57a8[_0x4a7a('0xa2')](_0x5b76a7);return _0x2e57a8;});}function getInputList(_0x49b7df,_0x3b9bc9,_0x5cc854,_0x2daa4d,_0x4fcf8f,_0x5c2d86,_0x1e7b1e){var _0x2a2f3a={'method':_0x4a7a('0x95'),'uri':_0x49b7df+_0x4a7a('0xb9')+_0x4fcf8f+_0x4a7a('0xb1')+_0x5c2d86+_0x4a7a('0xbd')+_0x5cc854+_0x4a7a('0xbe'),'headers':{'Authorization':_0x4a7a('0x96')+_0x1e7b1e,'If-None-Match':null,'OData-Version':_0x4a7a('0x97')},'json':!![]};return rp(_0x2a2f3a)[_0x4a7a('0xf')](function(_0x4a855d){var _0x172976={'id':_0x3b9bc9+'_'+_0x4a855d['LogicalName'],'name':_0x4a855d['DisplayName']['UserLocalizedLabel']?_0x4a855d[_0x4a7a('0xb8')]['UserLocalizedLabel'][_0x4a7a('0xb5')]:_0x4a855d['LogicalName'],'custom':![],'options':[]};_0x2daa4d[_0x4a7a('0xa2')](_0x172976);return _0x2daa4d;});} \ No newline at end of file +var _0x792f=['exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','responseby','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','CloudProvider','data7','modernAuthentication','access_token','data5','POST','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','GET','EntityDefinitions(','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','push','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','LogicalName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','options','Dynamics365Account','includeAll','include','findAll','keys','rawAttributes','find','catch','create','body','params','findOne','sort','pick','getConfigurations','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','title','description','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_timestamp','escalatedon'];(function(_0x3dd89c,_0x67999e){var _0x174796=function(_0x3b6b1e){while(--_0x3b6b1e){_0x3dd89c['push'](_0x3dd89c['shift']());}};_0x174796(++_0x67999e);}(_0x792f,0x10e));var _0xf792=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x792f[_0x4b174a];return _0x3cd7bf;};'use strict';var rp=require('request-promise');var util=require(_0xf792('0x0'));var _=require(_0xf792('0x1'));var qs=require(_0xf792('0x2'));var logger=require(_0xf792('0x3'))(_0xf792('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf792('0x5'));function respondWithResult(_0x3a1312,_0x94202a){_0x94202a=_0x94202a||0xc8;return function(_0x531214){if(_0x531214){return _0x3a1312[_0xf792('0x6')](_0x94202a)[_0xf792('0x7')](_0x531214);}};}function respondWithFilteredResult(_0x357d6e,_0x3f7cdc){return function(_0x35634c){if(_0x35634c){var _0x48f50a=typeof _0x3f7cdc[_0xf792('0x8')]===_0xf792('0x9')&&typeof _0x3f7cdc[_0xf792('0xa')]===_0xf792('0x9');var _0x47603e=_0x35634c[_0xf792('0xb')];var _0x3feefa=_0x48f50a?0x0:_0x3f7cdc[_0xf792('0x8')];var _0x213aac=_0x48f50a?_0x35634c[_0xf792('0xb')]:_0x3f7cdc[_0xf792('0x8')]+_0x3f7cdc['limit'];var _0x47ff16;if(_0x213aac>=_0x47603e){_0x213aac=_0x47603e;_0x47ff16=0xc8;}else{_0x47ff16=0xce;}_0x357d6e[_0xf792('0x6')](_0x47ff16);return _0x357d6e[_0xf792('0xc')](_0xf792('0xd'),_0x3feefa+'-'+_0x213aac+'/'+_0x47603e)['json'](_0x35634c);}return null;};}function saveUpdates(_0x2482e2){return function(_0xe7439c){if(_0xe7439c){return _0xe7439c[_0xf792('0xe')](_0x2482e2)[_0xf792('0xf')](function(_0x5bf1e9){return _0x5bf1e9;});}return null;};}function removeEntity(_0x5bfde8){return function(_0x53a1a0){if(_0x53a1a0){return _0x53a1a0['destroy']()[_0xf792('0xf')](function(){_0x5bfde8[_0xf792('0x6')](0xcc)[_0xf792('0x10')]();});}};}function handleEntityNotFound(_0x5d7498){return function(_0x3c79f9){if(!_0x3c79f9){_0x5d7498[_0xf792('0x11')](0x194);}return _0x3c79f9;};}function handleError(_0x1e01c3,_0x45a663){_0x45a663=_0x45a663||0x1f4;return function(_0x2e8811){logger[_0xf792('0x12')](_0x2e8811[_0xf792('0x13')]);if(_0x2e8811[_0xf792('0x14')]){delete _0x2e8811[_0xf792('0x14')];}_0x1e01c3[_0xf792('0x6')](_0x45a663)['send'](_0x2e8811);};}exports[_0xf792('0x15')]=function(_0x29289c,_0x4c03cb){var _0x52907f={},_0x3acb87={},_0x53e52e={'count':0x0,'rows':[]};var _0x2710fc=_[_0xf792('0x16')](db['Dynamics365Account']['rawAttributes'],function(_0x2145db){return{'name':_0x2145db[_0xf792('0x17')],'type':_0x2145db[_0xf792('0x18')][_0xf792('0x19')]};});_0x3acb87[_0xf792('0x1a')]=_[_0xf792('0x16')](_0x2710fc,_0xf792('0x14'));_0x3acb87[_0xf792('0x1b')]=_['keys'](_0x29289c[_0xf792('0x1b')]);_0x3acb87[_0xf792('0x1c')]=_[_0xf792('0x1d')](_0x3acb87['model'],_0x3acb87[_0xf792('0x1b')]);_0x52907f[_0xf792('0x1e')]=_['intersection'](_0x3acb87[_0xf792('0x1a')],qs[_0xf792('0x1f')](_0x29289c[_0xf792('0x1b')][_0xf792('0x1f')]));_0x52907f['attributes']=_0x52907f[_0xf792('0x1e')][_0xf792('0x20')]?_0x52907f[_0xf792('0x1e')]:_0x3acb87[_0xf792('0x1a')];if(!_0x29289c[_0xf792('0x1b')][_0xf792('0x21')](_0xf792('0x22'))){_0x52907f[_0xf792('0xa')]=qs['limit'](_0x29289c[_0xf792('0x1b')]['limit']);_0x52907f['offset']=qs[_0xf792('0x8')](_0x29289c['query'][_0xf792('0x8')]);}_0x52907f[_0xf792('0x23')]=qs['sort'](_0x29289c[_0xf792('0x1b')]['sort']);_0x52907f[_0xf792('0x24')]=qs[_0xf792('0x1c')](_['pick'](_0x29289c[_0xf792('0x1b')],_0x3acb87['filters']),_0x2710fc);if(_0x29289c[_0xf792('0x1b')][_0xf792('0x25')]){_0x52907f[_0xf792('0x24')]=_['merge'](_0x52907f[_0xf792('0x24')],{'$or':_[_0xf792('0x16')](_0x2710fc,function(_0x5ba34b){if(_0x5ba34b[_0xf792('0x18')]!==_0xf792('0x26')){var _0x9e72c6={};_0x9e72c6[_0x5ba34b[_0xf792('0x14')]]={'$like':'%'+_0x29289c[_0xf792('0x1b')][_0xf792('0x25')]+'%'};return _0x9e72c6;}})});}_0x52907f=_[_0xf792('0x27')]({},_0x52907f,_0x29289c[_0xf792('0x28')]);var _0x244622={'where':_0x52907f['where']};return db[_0xf792('0x29')][_0xf792('0xb')](_0x244622)['then'](function(_0x23706b){_0x53e52e[_0xf792('0xb')]=_0x23706b;if(_0x29289c[_0xf792('0x1b')][_0xf792('0x2a')]){_0x52907f[_0xf792('0x2b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xf792('0x2c')](_0x52907f);})[_0xf792('0xf')](function(_0x31f899){_0x53e52e['rows']=_0x31f899;return _0x53e52e;})[_0xf792('0xf')](respondWithFilteredResult(_0x4c03cb,_0x52907f))['catch'](handleError(_0x4c03cb,null));};exports['show']=function(_0x11b1f3,_0x32840f){var _0x532ad2={'raw':![],'where':{'id':_0x11b1f3['params']['id']}},_0x16af97={};_0x16af97[_0xf792('0x1a')]=_[_0xf792('0x2d')](db[_0xf792('0x29')][_0xf792('0x2e')]);_0x16af97[_0xf792('0x1b')]=_[_0xf792('0x2d')](_0x11b1f3['query']);_0x16af97[_0xf792('0x1c')]=_[_0xf792('0x1d')](_0x16af97['model'],_0x16af97[_0xf792('0x1b')]);_0x532ad2[_0xf792('0x1e')]=_[_0xf792('0x1d')](_0x16af97[_0xf792('0x1a')],qs[_0xf792('0x1f')](_0x11b1f3[_0xf792('0x1b')][_0xf792('0x1f')]));_0x532ad2[_0xf792('0x1e')]=_0x532ad2[_0xf792('0x1e')][_0xf792('0x20')]?_0x532ad2[_0xf792('0x1e')]:_0x16af97[_0xf792('0x1a')];if(_0x11b1f3[_0xf792('0x1b')]['includeAll']){_0x532ad2[_0xf792('0x2b')]=[{'all':!![]}];}_0x532ad2=_['merge']({},_0x532ad2,_0x11b1f3['options']);return db['Dynamics365Account'][_0xf792('0x2f')](_0x532ad2)['then'](handleEntityNotFound(_0x32840f,null))[_0xf792('0xf')](respondWithResult(_0x32840f,null))[_0xf792('0x30')](handleError(_0x32840f,null));};exports[_0xf792('0x31')]=function(_0x533528,_0x13ccda){return db[_0xf792('0x29')]['create'](_0x533528[_0xf792('0x32')],{})[_0xf792('0xf')](respondWithResult(_0x13ccda,0xc9))[_0xf792('0x30')](handleError(_0x13ccda,null));};exports[_0xf792('0xe')]=function(_0x5c54db,_0x17ed3a){if(_0x5c54db[_0xf792('0x32')]['id']){delete _0x5c54db[_0xf792('0x32')]['id'];}return db[_0xf792('0x29')][_0xf792('0x2f')]({'where':{'id':_0x5c54db[_0xf792('0x33')]['id']}})[_0xf792('0xf')](handleEntityNotFound(_0x17ed3a,null))[_0xf792('0xf')](saveUpdates(_0x5c54db['body'],null))[_0xf792('0xf')](respondWithResult(_0x17ed3a,null))[_0xf792('0x30')](handleError(_0x17ed3a,null));};exports['destroy']=function(_0x34256c,_0x23bff2){return db[_0xf792('0x29')]['find']({'where':{'id':_0x34256c[_0xf792('0x33')]['id']}})[_0xf792('0xf')](handleEntityNotFound(_0x23bff2,null))[_0xf792('0xf')](removeEntity(_0x23bff2,null))['catch'](handleError(_0x23bff2,null));};exports['getConfigurations']=function(_0x398872,_0x59b683){var _0x7b58e={};var _0x461349={};var _0x23a8dc;var _0x5b645b;return db['Dynamics365Account'][_0xf792('0x34')]({'where':{'id':_0x398872[_0xf792('0x33')]['id']}})[_0xf792('0xf')](handleEntityNotFound(_0x59b683,null))[_0xf792('0xf')](function(_0x5831b3){if(_0x5831b3){_0x23a8dc=_0x5831b3;_0x461349[_0xf792('0x1a')]=_[_0xf792('0x2d')](db['Dynamics365Configuration'][_0xf792('0x2e')]);_0x461349['query']=_['keys'](_0x398872[_0xf792('0x1b')]);_0x461349['filters']=_['intersection'](_0x461349[_0xf792('0x1a')],_0x461349[_0xf792('0x1b')]);_0x7b58e[_0xf792('0x1e')]=_['intersection'](_0x461349['model'],qs['fields'](_0x398872[_0xf792('0x1b')][_0xf792('0x1f')]));_0x7b58e[_0xf792('0x1e')]=_0x7b58e[_0xf792('0x1e')][_0xf792('0x20')]?_0x7b58e[_0xf792('0x1e')]:_0x461349[_0xf792('0x1a')];_0x7b58e[_0xf792('0x23')]=qs[_0xf792('0x35')](_0x398872[_0xf792('0x1b')][_0xf792('0x35')]);_0x7b58e[_0xf792('0x24')]=qs[_0xf792('0x1c')](_[_0xf792('0x36')](_0x398872['query'],_0x461349['filters']));if(_0x398872[_0xf792('0x1b')][_0xf792('0x25')]){_0x7b58e[_0xf792('0x24')]=_['merge'](_0x7b58e[_0xf792('0x24')],{'$or':_[_0xf792('0x16')](_0x7b58e['attributes'],function(_0x27d119){var _0x170b2b={};_0x170b2b[_0x27d119]={'$like':'%'+_0x398872[_0xf792('0x1b')][_0xf792('0x25')]+'%'};return _0x170b2b;})});}_0x7b58e=_[_0xf792('0x27')]({},_0x7b58e,_0x398872['options']);return _0x23a8dc['getConfigurations'](_0x7b58e);}})[_0xf792('0xf')](function(_0x559329){if(_0x559329){_0x5b645b=_0x559329[_0xf792('0x20')];if(!_0x398872[_0xf792('0x1b')][_0xf792('0x21')](_0xf792('0x22'))){_0x7b58e[_0xf792('0xa')]=qs[_0xf792('0xa')](_0x398872[_0xf792('0x1b')][_0xf792('0xa')]);_0x7b58e['offset']=qs[_0xf792('0x8')](_0x398872[_0xf792('0x1b')]['offset']);}return _0x23a8dc[_0xf792('0x37')](_0x7b58e);}})[_0xf792('0xf')](function(_0x9dcbfe){if(_0x9dcbfe){return _0x9dcbfe?{'count':_0x5b645b,'rows':_0x9dcbfe}:null;}})[_0xf792('0xf')](respondWithResult(_0x59b683,null))[_0xf792('0x30')](handleError(_0x59b683,null));};exports['addConfiguration']=function(_0x526212,_0x17d7f0){if(_0x526212[_0xf792('0x32')]['id']){delete _0x526212[_0xf792('0x32')]['id'];}return db['Dynamics365Account'][_0xf792('0x34')]({'where':{'id':_0x526212[_0xf792('0x33')]['id']}})[_0xf792('0xf')](handleEntityNotFound(_0x17d7f0,null))[_0xf792('0xf')](function(_0x3f25cd){if(_0x3f25cd){_0x526212[_0xf792('0x32')][_0xf792('0x38')]=_0x3f25cd['id'];_0x526212['body'][_0xf792('0x39')]=integrations[_0xf792('0x3a')](_0x526212[_0xf792('0x32')][_0xf792('0x3b')],_0x526212['body'][_0xf792('0x18')]);_0x526212[_0xf792('0x32')]['Descriptions']=integrations[_0xf792('0x3c')](_0x526212[_0xf792('0x32')][_0xf792('0x3b')],_0x526212[_0xf792('0x32')][_0xf792('0x18')]);return db[_0xf792('0x3d')][_0xf792('0x31')](_0x526212[_0xf792('0x32')],{'include':[{'model':db[_0xf792('0x3e')],'as':_0xf792('0x39')},{'model':db[_0xf792('0x3e')],'as':_0xf792('0x3f')}]});}return null;})[_0xf792('0xf')](respondWithResult(_0x17d7f0,null))[_0xf792('0x30')](handleError(_0x17d7f0,null));};function sanitizeRemoteUri(_0x3eb4d3){var _0x470207=_0x3eb4d3[_0xf792('0x40')](-0x1);if(_0x470207==='/')return _0x3eb4d3[_0xf792('0x41')](0x0,_0x3eb4d3[_0xf792('0x42')](_0x470207));return _0x3eb4d3;}function getWebApiUrl(_0x25f10b){return util[_0xf792('0x43')](_0xf792('0x44'),_0x25f10b);}exports[_0xf792('0x45')]=function(_0x487d65,_0x8931fb){var _0x4e07e1=_0x487d65[_0xf792('0x1b')][_0xf792('0x46')];var _0x2d80d9=_0x4e07e1==='incident'?_0xf792('0x47'):_0xf792('0x48');var _0x364768='';var _0x595a2a='';var _0x6954c8='';var _0x3b19f1='';var _0x5324e6='';var _0x23f9df='';var _0x4b8b8e='';var _0x1b8c71='';var _0x43bfe3=[_0xf792('0x49'),_0xf792('0x4a'),'customerid','ownerid','caseorigincode',_0xf792('0x4b'),_0xf792('0x4c'),'regardingobjectid',_0xf792('0x4d'),_0xf792('0x4e')];var _0x962c44=[_0xf792('0x4f'),_0xf792('0x50'),'actualserviceunits',_0xf792('0x51'),_0xf792('0x52'),'contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname',_0xf792('0x53'),_0xf792('0x54'),_0xf792('0x55'),_0xf792('0x56'),_0xf792('0x57'),_0xf792('0x58'),_0xf792('0x59'),_0xf792('0x5a'),'customeridyominame',_0xf792('0x5b'),'entitlementidname',_0xf792('0x5c'),'entityimage_url',_0xf792('0x5d'),_0xf792('0x5e'),_0xf792('0x5f'),'followupby',_0xf792('0x60'),_0xf792('0x61'),_0xf792('0x62'),_0xf792('0x63'),'masteridname',_0xf792('0x64'),_0xf792('0x65'),'modifiedbyname',_0xf792('0x66'),_0xf792('0x67'),_0xf792('0x68'),_0xf792('0x69'),'msdyn_incidenttypename','msdyn_iotalertname',_0xf792('0x6a'),_0xf792('0x6b'),_0xf792('0x6c'),'owneridname','owneridtype','owneridyominame',_0xf792('0x6d'),_0xf792('0x6e'),'primarycontactidyominame',_0xf792('0x6f'),_0xf792('0x70'),_0xf792('0x71'),_0xf792('0x72'),'resolvebykpiidname',_0xf792('0x73'),'responsiblecontactidname','responsiblecontactidyominame',_0xf792('0x74'),'slainvokedidname',_0xf792('0x75'),_0xf792('0x76'),_0xf792('0x77'),_0xf792('0x78'),_0xf792('0x79'),_0xf792('0x7a'),_0xf792('0x7b'),_0xf792('0x7c'),_0xf792('0x7d'),_0xf792('0x7e'),_0xf792('0x7f')];var _0x5f5412=_0x43bfe3[_0xf792('0x80')](_0x962c44);return db['Dynamics365Account']['findOne']({'where':{'id':_0x487d65[_0xf792('0x33')]['id']},'attributes':['id',_0xf792('0x81'),_0xf792('0x82'),_0xf792('0x83'),'tenantId',_0xf792('0x84'),_0xf792('0x85'),'modernAuthentication'],'include':[{'model':db[_0xf792('0x86')],'as':'CloudProvider','attributes':['id','data5',_0xf792('0x87')]}]})[_0xf792('0xf')](handleEntityNotFound(_0x8931fb,null))[_0xf792('0xf')](function(_0x41eb42){if(_0x41eb42){if(_0x41eb42[_0xf792('0x88')]){_0x41eb42[_0xf792('0x89')]=_0x41eb42[_0xf792('0x86')][_0xf792('0x8a')];_0x1b8c71=sanitizeRemoteUri(_0x41eb42[_0xf792('0x86')][_0xf792('0x87')]);_0x4b8b8e=getWebApiUrl(_0x1b8c71);return _0x41eb42;}_0x1b8c71=sanitizeRemoteUri(_0x41eb42[_0xf792('0x83')]);_0x4b8b8e=getWebApiUrl(_0x1b8c71);var _0x13fe18={'method':_0xf792('0x8b'),'uri':'https://login.microsoftonline.com/'+_0x41eb42['tenantId']+_0xf792('0x8c'),'form':{'client_id':_0x41eb42[_0xf792('0x84')],'resource':_0x1b8c71,'username':_0x41eb42[_0xf792('0x81')],'password':_0x41eb42[_0xf792('0x82')],'grant_type':_0xf792('0x82'),'client_secret':_0x41eb42[_0xf792('0x85')]},'json':!![]};return rp(_0x13fe18);}})['then'](function(_0x54d5fc){_0x23f9df=_0x54d5fc[_0xf792('0x89')];var _0x162db5={'method':'GET','uri':encodeURI(_0x4b8b8e+_0xf792('0x8d')+_0x2d80d9+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x23f9df,'If-None-Match':null,'OData-Version':_0xf792('0x8e')},'json':!![]};return rp(_0x162db5);})[_0xf792('0xf')](function(_0x40ace2){var _0x3deb98=_0x40ace2[_0xf792('0x8f')][0x0];var _0x2c4011=_0x3deb98[_0xf792('0x90')];var _0x429f7d={'method':_0xf792('0x91'),'uri':_0x4b8b8e+_0xf792('0x92')+_0x2c4011+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xf792('0x93')+_0x23f9df,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x429f7d);})[_0xf792('0xf')](function(_0x13af8c){_0x364768=_0x13af8c;_0x595a2a=_0x364768[_0xf792('0x94')];_0x595a2a=_[_0xf792('0x95')](_0x595a2a,function(_0x3be662){return!_0x5f5412[_0xf792('0x96')](_0x3be662['LogicalName']);});var _0x1caaea=[];var _0x47e117=[];_0x595a2a[_0xf792('0x97')](function(_0x29fc57){if(_0x29fc57['@odata.type']){var _0x4f30d9=_0x29fc57[_0xf792('0x98')][_0xf792('0x41')](_0x29fc57['@odata.type'][_0xf792('0x42')]('.')+0x1);if(_0x4f30d9==='PicklistAttributeMetadata'){_0x1caaea['push'](getSelectList(_0x4b8b8e,_0x4e07e1,_0x47e117,_0x364768['MetadataId'],_0x29fc57[_0xf792('0x90')],_0x23f9df));}}});return Promise[_0xf792('0x99')](_0x1caaea);})[_0xf792('0xf')](function(_0x452add){_0x6954c8=_0x452add[0x0];var _0x1857a5=[];var _0x1bcfdb=[];_0x595a2a[_0xf792('0x97')](function(_0x4ff6cd){if(!_[_0xf792('0x9a')](_0x4ff6cd[_0xf792('0x98')])){var _0xceb003=_0x4ff6cd[_0xf792('0x98')][_0xf792('0x41')](_0x4ff6cd[_0xf792('0x98')][_0xf792('0x42')]('.')+0x1);if(_0xceb003==='BooleanAttributeMetadata'){_0x1857a5['push'](getBooleanList(_0x4b8b8e,_0x4e07e1,_0x1bcfdb,_0x364768[_0xf792('0x90')],_0x4ff6cd['MetadataId'],_0x23f9df));}}});return Promise[_0xf792('0x99')](_0x1857a5);})[_0xf792('0xf')](function(_0x167960){_0x3b19f1=_0x167960[0x0];var _0x3abecd=[];var _0x2d103a=[];_0x595a2a['forEach'](function(_0x3eb4ed){if(_0x3eb4ed['@odata.type']){var _0x58dcee=_0x3eb4ed['@odata.type'][_0xf792('0x41')](_0x3eb4ed[_0xf792('0x98')][_0xf792('0x42')]('.')+0x1);if(_0x58dcee===_0xf792('0x9b')||_0x58dcee===_0xf792('0x9c')||_0x58dcee===_0xf792('0x9d')||_0x58dcee==='IntegerAttributeMetadata'||_0x58dcee===_0xf792('0x9e')||_0x58dcee===_0xf792('0x9f')||_0x58dcee===_0xf792('0xa0')||_0x58dcee==='EntityNameAttributeMetadata'||_0x58dcee===_0xf792('0xa1')||_0x58dcee==='DecimalAttributeMetadata'){_0x3abecd[_0xf792('0xa2')](getInputList(_0x4b8b8e,_0x4e07e1,_0x58dcee,_0x2d103a,_0x364768['MetadataId'],_0x3eb4ed[_0xf792('0x90')],_0x23f9df));}}});return Promise[_0xf792('0x99')](_0x3abecd);})[_0xf792('0xf')](function(_0x4b6930){_0x5324e6=_0x4b6930[0x0];var _0x5c9609=_0x6954c8[_0xf792('0x80')](_0x3b19f1)[_0xf792('0x80')](_0x5324e6);var _0xc345a6={'count':_0x5c9609['length'],'rows':_0x5c9609};return _0xc345a6;})[_0xf792('0xf')](respondWithResult(_0x8931fb,null))[_0xf792('0x30')](function(_0x184743){var _0x2ef881=_0x487d65[_0xf792('0x1b')][_0xf792('0xa3')]?0x1f4:_0x184743[_0xf792('0xa4')]||0x1f4;logger[_0xf792('0x12')](_0x184743[_0xf792('0x13')]);delete _0x184743[_0xf792('0x14')];if(_0x2ef881===0x191){_0x2ef881=0x190;}_0x8931fb['status'](_0x2ef881)['send'](_0x487d65[_0xf792('0x1b')][_0xf792('0xa3')]?{'message':_0xf792('0xa5'),'statusCode':_0x184743[_0xf792('0xa4')]}:_0x184743);});};function getSelectList(_0x17a384,_0x461206,_0x4dbf6c,_0xee0eec,_0x56d546,_0x154402){var _0x219e63={'method':_0xf792('0x91'),'uri':_0x17a384+'EntityDefinitions('+_0xee0eec+_0xf792('0xa6')+_0x56d546+_0xf792('0xa7')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x154402,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x219e63)[_0xf792('0xf')](function(_0x232712){var _0x8d5028=[];var _0x2bfc10=_0x232712[_0xf792('0xa8')][_0xf792('0xa9')];_0x2bfc10[_0xf792('0x97')](function(_0xb69a6f){_0x8d5028[_0xf792('0xa2')]({'name':_0xb69a6f[_0xf792('0xaa')][_0xf792('0xab')][_0xf792('0xaa')],'value':String(_0xb69a6f[_0xf792('0xac')])});});var _0x3025d1={'id':_0x461206+'_'+_0x232712['LogicalName'],'name':_0x232712[_0xf792('0xad')][_0xf792('0xab')]['Label'],'custom':![],'options':_0x8d5028};_0x4dbf6c['push'](_0x3025d1);return _0x4dbf6c;});}function getBooleanList(_0x2638e9,_0x3babd8,_0x2e36a2,_0x368c01,_0xe6fd50,_0x10d4e6){var _0x33db31={'method':_0xf792('0x91'),'uri':_0x2638e9+_0xf792('0x92')+_0x368c01+_0xf792('0xa6')+_0xe6fd50+_0xf792('0xae'),'headers':{'Authorization':_0xf792('0x93')+_0x10d4e6,'If-None-Match':null,'OData-Version':_0xf792('0x8e')},'json':!![]};return rp(_0x33db31)[_0xf792('0xf')](function(_0x42896c){var _0x35a76c=[];_0x35a76c[_0xf792('0xa2')]({'name':_0x42896c['OptionSet'][_0xf792('0xaf')][_0xf792('0xaa')][_0xf792('0xab')][_0xf792('0xaa')],'value':_0xf792('0xb0')},{'name':_0x42896c[_0xf792('0xa8')][_0xf792('0xb1')][_0xf792('0xaa')][_0xf792('0xab')][_0xf792('0xaa')],'value':_0xf792('0xb2')});var _0x5c8e9e={'id':_0x3babd8+'_'+_0x42896c[_0xf792('0xb3')],'name':_0x42896c[_0xf792('0xad')]['UserLocalizedLabel'][_0xf792('0xaa')],'custom':![],'options':_0x35a76c};_0x2e36a2[_0xf792('0xa2')](_0x5c8e9e);return _0x2e36a2;});}function getInputList(_0x300fd9,_0x57e7fe,_0x5c2740,_0x26b964,_0x51cda6,_0x21530e,_0x51145a){var _0x23e3b0={'method':_0xf792('0x91'),'uri':_0x300fd9+_0xf792('0x92')+_0x51cda6+')/Attributes('+_0x21530e+_0xf792('0xb4')+_0x5c2740+_0xf792('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x51145a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x23e3b0)['then'](function(_0x2960a5){var _0xa33c59={'id':_0x57e7fe+'_'+_0x2960a5[_0xf792('0xb3')],'name':_0x2960a5[_0xf792('0xad')][_0xf792('0xab')]?_0x2960a5[_0xf792('0xad')][_0xf792('0xab')]['Label']:_0x2960a5[_0xf792('0xb3')],'custom':![],'options':[]};_0x26b964[_0xf792('0xa2')](_0xa33c59);return _0x26b964;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b6927f9..f112b6f 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(_0x2c5d39,_0x2c2c91){var _0x9abbac=function(_0x1a5a97){while(--_0x1a5a97){_0x2c5d39['push'](_0x2c5d39['shift']());}};_0x9abbac(++_0x2c2c91);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x13203d,_0x433dff){var _0x3bfc43=function(_0x4b6018){while(--_0x4b6018){_0x13203d['push'](_0x13203d['shift']());}};_0x3bfc43(++_0x433dff);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xcb91[_0x872b02];return _0x1a6b24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index b1fb4a7..f214b3d 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 _0x2b99=['message','result','catch','GetDynamics365Account','options','raw','where','limit','map','include','attributes','model','ShowDynamics365Account','Dynamics365Account','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s'];(function(_0x1a04ad,_0x390617){var _0x102712=function(_0x27dab7){while(--_0x27dab7){_0x1a04ad['push'](_0x1a04ad['shift']());}};_0x102712(++_0x390617);}(_0x2b99,0x1b3));var _0x92b9=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x2b99[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x92b9('0x0'));var util=require(_0x92b9('0x1'));var moment=require(_0x92b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x92b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b9('0x4'))['db'];var utils=require(_0x92b9('0x5'));var logger=require('../../config/logger')(_0x92b9('0x6'));var config=require(_0x92b9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x92b9('0x8')][_0x92b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x61f37e,_0x1b1000,_0x4267b2){return new BPromise(function(_0x927fc0,_0x53e1a5){return client[_0x92b9('0xa')](_0x61f37e,_0x4267b2)[_0x92b9('0xb')](function(_0x31f8bb){logger[_0x92b9('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x1b1000,_0x92b9('0xd'));logger[_0x92b9('0xe')](_0x92b9('0xf'),_0x1b1000,_0x92b9('0xd'),JSON[_0x92b9('0x10')](_0x31f8bb));if(_0x31f8bb[_0x92b9('0x11')]){if(_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x12')]===0x1f4){logger[_0x92b9('0x11')](_0x92b9('0x13'),_0x1b1000,_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x14')]);return _0x53e1a5(_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x14')]);}logger[_0x92b9('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x1b1000,_0x31f8bb[_0x92b9('0x11')][_0x92b9('0x14')]);return _0x927fc0(_0x31f8bb['error']['message']);}else{logger[_0x92b9('0xc')](_0x92b9('0x13'),_0x1b1000,_0x92b9('0xd'));_0x927fc0(_0x31f8bb[_0x92b9('0x15')][_0x92b9('0x14')]);}})[_0x92b9('0x16')](function(_0x491168){logger['error'](_0x92b9('0x13'),_0x1b1000,_0x491168);_0x53e1a5(_0x491168);});});}exports[_0x92b9('0x17')]=function(_0x36da34){var _0x419fc7=this;return new Promise(function(_0x10cedd,_0x3471cb){return db['Dynamics365Account']['findAll']({'raw':_0x36da34[_0x92b9('0x18')]?_0x36da34['options'][_0x92b9('0x19')]===undefined?!![]:![]:!![],'where':_0x36da34['options']?_0x36da34['options'][_0x92b9('0x1a')]||null:null,'attributes':_0x36da34[_0x92b9('0x18')]?_0x36da34[_0x92b9('0x18')]['attributes']||null:null,'limit':_0x36da34[_0x92b9('0x18')]?_0x36da34[_0x92b9('0x18')][_0x92b9('0x1b')]||null:null,'include':_0x36da34[_0x92b9('0x18')]?_0x36da34[_0x92b9('0x18')]['include']?_[_0x92b9('0x1c')](_0x36da34['options'][_0x92b9('0x1d')],function(_0x57c037){return{'model':db[_0x57c037['model']],'as':_0x57c037['as'],'attributes':_0x57c037[_0x92b9('0x1e')],'include':_0x57c037[_0x92b9('0x1d')]?_[_0x92b9('0x1c')](_0x57c037['include'],function(_0x754d07){return{'model':db[_0x754d07['model']],'as':_0x754d07['as'],'attributes':_0x754d07[_0x92b9('0x1e')],'include':_0x754d07[_0x92b9('0x1d')]?_[_0x92b9('0x1c')](_0x754d07[_0x92b9('0x1d')],function(_0x14241b){return{'model':db[_0x14241b[_0x92b9('0x1f')]],'as':_0x14241b['as'],'attributes':_0x14241b['attributes']};}):[]};}):[]};}):[]:[]})[_0x92b9('0xb')](function(_0x3c1ae4){logger[_0x92b9('0xc')](_0x92b9('0x17'),_0x36da34);logger['debug'](_0x92b9('0x17'),_0x36da34,JSON[_0x92b9('0x10')](_0x3c1ae4));_0x10cedd(_0x3c1ae4);})['catch'](function(_0x20771b){logger[_0x92b9('0x11')](_0x92b9('0x17'),_0x20771b[_0x92b9('0x14')],_0x36da34);_0x3471cb(_0x419fc7['error'](0x1f4,_0x20771b[_0x92b9('0x14')]));});});};exports[_0x92b9('0x20')]=function(_0x4f9d27){var _0x3548d8=this;return new Promise(function(_0xfa1217,_0x45ca02){return db[_0x92b9('0x21')][_0x92b9('0x22')]({'raw':_0x4f9d27[_0x92b9('0x18')]?_0x4f9d27[_0x92b9('0x18')][_0x92b9('0x19')]===undefined?!![]:![]:!![],'where':_0x4f9d27['options']?_0x4f9d27[_0x92b9('0x18')][_0x92b9('0x1a')]||null:null,'attributes':_0x4f9d27[_0x92b9('0x18')]?_0x4f9d27[_0x92b9('0x18')][_0x92b9('0x1e')]||null:null,'include':_0x4f9d27[_0x92b9('0x18')]?_0x4f9d27[_0x92b9('0x18')][_0x92b9('0x1d')]?_[_0x92b9('0x1c')](_0x4f9d27[_0x92b9('0x18')][_0x92b9('0x1d')],function(_0x132138){return{'model':db[_0x132138[_0x92b9('0x1f')]],'as':_0x132138['as'],'attributes':_0x132138['attributes'],'include':_0x132138[_0x92b9('0x1d')]?_[_0x92b9('0x1c')](_0x132138[_0x92b9('0x1d')],function(_0x54d05c){return{'model':db[_0x54d05c['model']],'as':_0x54d05c['as'],'attributes':_0x54d05c[_0x92b9('0x1e')],'include':_0x54d05c[_0x92b9('0x1d')]?_[_0x92b9('0x1c')](_0x54d05c[_0x92b9('0x1d')],function(_0x393ca6){return{'model':db[_0x393ca6[_0x92b9('0x1f')]],'as':_0x393ca6['as'],'attributes':_0x393ca6['attributes']};}):[]};}):[]};}):[]:[]})[_0x92b9('0xb')](function(_0x2affaa){logger[_0x92b9('0xc')](_0x92b9('0x20'),_0x4f9d27);logger[_0x92b9('0xe')]('ShowDynamics365Account',_0x4f9d27,JSON[_0x92b9('0x10')](_0x2affaa));_0xfa1217(_0x2affaa);})[_0x92b9('0x16')](function(_0x26961b){logger[_0x92b9('0x11')]('ShowDynamics365Account',_0x26961b[_0x92b9('0x14')],_0x4f9d27);_0x45ca02(_0x3548d8[_0x92b9('0x11')](0x1f4,_0x26961b['message']));});});}; \ No newline at end of file +var _0x951c=['options','raw','where','attributes','limit','include','model','map','GetDynamics365Account','Dynamics365Account','find','then','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x951c,0x13d));var _0xc951=function(_0x3cea81,_0x230abc){_0x3cea81=_0x3cea81-0x0;var _0x3b1c95=_0x951c[_0x3cea81];return _0x3b1c95;};'use strict';var _=require('lodash');var util=require(_0xc951('0x0'));var moment=require(_0xc951('0x1'));var BPromise=require(_0xc951('0x2'));var rs=require(_0xc951('0x3'));var fs=require('fs');var Redis=require(_0xc951('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc951('0x5'));var logger=require(_0xc951('0x6'))(_0xc951('0x7'));var config=require(_0xc951('0x8'));var jayson=require(_0xc951('0x9'));var client=jayson[_0xc951('0xa')][_0xc951('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f1f06,_0x3687d8,_0x5d2b9c){return new BPromise(function(_0x249e9a,_0x457b2e){return client[_0xc951('0xc')](_0x5f1f06,_0x5d2b9c)['then'](function(_0x212917){logger['info'](_0xc951('0xd'),_0x3687d8,_0xc951('0xe'));logger[_0xc951('0xf')](_0xc951('0x10'),_0x3687d8,_0xc951('0xe'),JSON[_0xc951('0x11')](_0x212917));if(_0x212917[_0xc951('0x12')]){if(_0x212917[_0xc951('0x12')][_0xc951('0x13')]===0x1f4){logger[_0xc951('0x12')](_0xc951('0xd'),_0x3687d8,_0x212917[_0xc951('0x12')][_0xc951('0x14')]);return _0x457b2e(_0x212917[_0xc951('0x12')][_0xc951('0x14')]);}logger[_0xc951('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x3687d8,_0x212917[_0xc951('0x12')][_0xc951('0x14')]);return _0x249e9a(_0x212917[_0xc951('0x12')][_0xc951('0x14')]);}else{logger[_0xc951('0x15')](_0xc951('0xd'),_0x3687d8,'request\x20sent');_0x249e9a(_0x212917[_0xc951('0x16')][_0xc951('0x14')]);}})[_0xc951('0x17')](function(_0x1853b3){logger[_0xc951('0x12')](_0xc951('0xd'),_0x3687d8,_0x1853b3);_0x457b2e(_0x1853b3);});});}exports['GetDynamics365Account']=function(_0x517523){var _0x458772=this;return new Promise(function(_0x443121,_0x33be99){return db['Dynamics365Account'][_0xc951('0x18')]({'raw':_0x517523[_0xc951('0x19')]?_0x517523[_0xc951('0x19')][_0xc951('0x1a')]===undefined?!![]:![]:!![],'where':_0x517523[_0xc951('0x19')]?_0x517523[_0xc951('0x19')][_0xc951('0x1b')]||null:null,'attributes':_0x517523[_0xc951('0x19')]?_0x517523[_0xc951('0x19')][_0xc951('0x1c')]||null:null,'limit':_0x517523[_0xc951('0x19')]?_0x517523[_0xc951('0x19')][_0xc951('0x1d')]||null:null,'include':_0x517523[_0xc951('0x19')]?_0x517523['options'][_0xc951('0x1e')]?_['map'](_0x517523[_0xc951('0x19')][_0xc951('0x1e')],function(_0x488eb5){return{'model':db[_0x488eb5[_0xc951('0x1f')]],'as':_0x488eb5['as'],'attributes':_0x488eb5[_0xc951('0x1c')],'include':_0x488eb5[_0xc951('0x1e')]?_[_0xc951('0x20')](_0x488eb5[_0xc951('0x1e')],function(_0x1bee32){return{'model':db[_0x1bee32[_0xc951('0x1f')]],'as':_0x1bee32['as'],'attributes':_0x1bee32[_0xc951('0x1c')],'include':_0x1bee32['include']?_[_0xc951('0x20')](_0x1bee32[_0xc951('0x1e')],function(_0x35c4a7){return{'model':db[_0x35c4a7['model']],'as':_0x35c4a7['as'],'attributes':_0x35c4a7[_0xc951('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13fc64){logger['info'](_0xc951('0x21'),_0x517523);logger[_0xc951('0xf')]('GetDynamics365Account',_0x517523,JSON[_0xc951('0x11')](_0x13fc64));_0x443121(_0x13fc64);})['catch'](function(_0xc7350b){logger[_0xc951('0x12')](_0xc951('0x21'),_0xc7350b['message'],_0x517523);_0x33be99(_0x458772[_0xc951('0x12')](0x1f4,_0xc7350b[_0xc951('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x9352a4){var _0x8d13b2=this;return new Promise(function(_0x396665,_0x23f9e8){return db[_0xc951('0x22')][_0xc951('0x23')]({'raw':_0x9352a4[_0xc951('0x19')]?_0x9352a4[_0xc951('0x19')][_0xc951('0x1a')]===undefined?!![]:![]:!![],'where':_0x9352a4[_0xc951('0x19')]?_0x9352a4[_0xc951('0x19')]['where']||null:null,'attributes':_0x9352a4[_0xc951('0x19')]?_0x9352a4[_0xc951('0x19')]['attributes']||null:null,'include':_0x9352a4[_0xc951('0x19')]?_0x9352a4[_0xc951('0x19')][_0xc951('0x1e')]?_['map'](_0x9352a4[_0xc951('0x19')][_0xc951('0x1e')],function(_0x1b7d99){return{'model':db[_0x1b7d99[_0xc951('0x1f')]],'as':_0x1b7d99['as'],'attributes':_0x1b7d99[_0xc951('0x1c')],'include':_0x1b7d99['include']?_['map'](_0x1b7d99[_0xc951('0x1e')],function(_0xfaa7a4){return{'model':db[_0xfaa7a4[_0xc951('0x1f')]],'as':_0xfaa7a4['as'],'attributes':_0xfaa7a4[_0xc951('0x1c')],'include':_0xfaa7a4[_0xc951('0x1e')]?_[_0xc951('0x20')](_0xfaa7a4[_0xc951('0x1e')],function(_0x123006){return{'model':db[_0x123006[_0xc951('0x1f')]],'as':_0x123006['as'],'attributes':_0x123006[_0xc951('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc951('0x24')](function(_0x787553){logger[_0xc951('0x15')]('ShowDynamics365Account',_0x9352a4);logger[_0xc951('0xf')](_0xc951('0x25'),_0x9352a4,JSON[_0xc951('0x11')](_0x787553));_0x396665(_0x787553);})['catch'](function(_0x4bcce7){logger[_0xc951('0x12')]('ShowDynamics365Account',_0x4bcce7[_0xc951('0x14')],_0x9352a4);_0x23f9e8(_0x8d13b2[_0xc951('0x12')](0x1f4,_0x4bcce7[_0xc951('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 799ec24..f17df70 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 _0xea21=['connect-timeout','express','Router','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getFields','/:id/descriptions','getDescriptions','post','/:id','update','delete','multer','util','path'];(function(_0x188598,_0x339503){var _0x4924fd=function(_0x3800b7){while(--_0x3800b7){_0x188598['push'](_0x188598['shift']());}};_0x4924fd(++_0x339503);}(_0xea21,0xf4));var _0x1ea2=function(_0x4874ff,_0xcb7373){_0x4874ff=_0x4874ff-0x0;var _0x15ea9c=_0xea21[_0x4874ff];return _0x15ea9c;};'use strict';var multer=require(_0x1ea2('0x0'));var util=require(_0x1ea2('0x1'));var path=require(_0x1ea2('0x2'));var timeout=require(_0x1ea2('0x3'));var express=require(_0x1ea2('0x4'));var router=express[_0x1ea2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1ea2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1ea2('0x7'));router[_0x1ea2('0x8')]('/',auth[_0x1ea2('0x9')](),controller[_0x1ea2('0xa')]);router[_0x1ea2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1ea2('0xb')]);router[_0x1ea2('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1ea2('0xc')]);router[_0x1ea2('0x8')]('/:id/subjects',auth[_0x1ea2('0x9')](),controller['getSubjects']);router[_0x1ea2('0x8')](_0x1ea2('0xd'),auth['isAuthenticated'](),controller[_0x1ea2('0xe')]);router[_0x1ea2('0xf')]('/',auth[_0x1ea2('0x9')](),controller['create']);router['put'](_0x1ea2('0x10'),auth[_0x1ea2('0x9')](),controller[_0x1ea2('0x11')]);router[_0x1ea2('0x12')](_0x1ea2('0x10'),auth[_0x1ea2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6208=['get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index'];(function(_0x4f319b,_0x249687){var _0x2aa953=function(_0x380243){while(--_0x380243){_0x4f319b['push'](_0x4f319b['shift']());}};_0x2aa953(++_0x249687);}(_0x6208,0x192));var _0x8620=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0x6208[_0x5b5eb4];return _0x42af53;};'use strict';var multer=require('multer');var util=require(_0x8620('0x0'));var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require(_0x8620('0x3'));var router=express[_0x8620('0x4')]();var fs_extra=require(_0x8620('0x5'));var auth=require(_0x8620('0x6'));var interaction=require(_0x8620('0x7'));var config=require(_0x8620('0x8'));var controller=require(_0x8620('0x9'));router['get']('/',auth[_0x8620('0xa')](),controller[_0x8620('0xb')]);router[_0x8620('0xc')](_0x8620('0xd'),auth[_0x8620('0xa')](),controller['show']);router[_0x8620('0xc')](_0x8620('0xe'),auth['isAuthenticated'](),controller[_0x8620('0xf')]);router[_0x8620('0xc')]('/:id/subjects',auth[_0x8620('0xa')](),controller[_0x8620('0x10')]);router['get'](_0x8620('0x11'),auth[_0x8620('0xa')](),controller[_0x8620('0x12')]);router['post']('/',auth[_0x8620('0xa')](),controller[_0x8620('0x13')]);router[_0x8620('0x14')](_0x8620('0xd'),auth[_0x8620('0xa')](),controller['update']);router['delete']('/:id',auth[_0x8620('0xa')](),controller[_0x8620('0x15')]);module[_0x8620('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 7f08798..a2989e3 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 _0x089b=['ENUM','incident','contact','sequelize','exports','STRING'];(function(_0x542c6b,_0xe97c2a){var _0x1c00b1=function(_0x3c6a72){while(--_0x3c6a72){_0x542c6b['push'](_0x542c6b['shift']());}};_0x1c00b1(++_0xe97c2a);}(_0x089b,0x10b));var _0xb089=function(_0x490075,_0x26250d){_0x490075=_0x490075-0x0;var _0x3f70a7=_0x089b[_0x490075];return _0x3f70a7;};'use strict';var Sequelize=require(_0xb089('0x0'));module[_0xb089('0x1')]={'name':{'type':Sequelize[_0xb089('0x2')]},'description':{'type':Sequelize[_0xb089('0x2')]},'ticketType':{'type':Sequelize[_0xb089('0x3')]('incident','phonecall'),'defaultValue':_0xb089('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb089('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9989=['contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident','phonecall','nothing'];(function(_0x59f5cd,_0x5658d4){var _0x292606=function(_0x552490){while(--_0x552490){_0x59f5cd['push'](_0x59f5cd['shift']());}};_0x292606(++_0x5658d4);}(_0x9989,0xda));var _0x9998=function(_0x3ac218,_0x4e1862){_0x3ac218=_0x3ac218-0x0;var _0x24810e=_0x9989[_0x3ac218];return _0x24810e;};'use strict';var Sequelize=require(_0x9998('0x0'));module[_0x9998('0x1')]={'name':{'type':Sequelize[_0x9998('0x2')]},'description':{'type':Sequelize[_0x9998('0x2')]},'ticketType':{'type':Sequelize[_0x9998('0x3')](_0x9998('0x4'),_0x9998('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x9998('0x3')]('contact',_0x9998('0x6')),'defaultValue':_0x9998('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9998('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x9998('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index f448490..05e7163 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 _0x79cf=['nolimit','order','sort','pick','filter','merge','where','VIRTUAL','Dynamics365Configuration','includeAll','include','rows','params','keys','rawAttributes','intersection','options','find','catch','create','update','body','getFields','findOne','Dynamics365Field','length','hasOwnProperty','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','json','apply','save','then','destroy','status','error','stack','name','index','map','type','model','query','filters','fields','attributes'];(function(_0x5dbdb8,_0x185a64){var _0x57db24=function(_0x241c77){while(--_0x241c77){_0x5dbdb8['push'](_0x5dbdb8['shift']());}};_0x57db24(++_0x185a64);}(_0x79cf,0x199));var _0xf79c=function(_0x40b89a,_0x559596){_0x40b89a=_0x40b89a-0x0;var _0x747a91=_0x79cf[_0x40b89a];return _0x747a91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf79c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf79c('0x1'));var rp=require(_0xf79c('0x2'));var moment=require(_0xf79c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf79c('0x4'));var util=require(_0xf79c('0x5'));var path=require(_0xf79c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf79c('0x7'));var fs=require('fs');var fs_extra=require(_0xf79c('0x8'));var _=require('lodash');var squel=require(_0xf79c('0x9'));var crypto=require(_0xf79c('0xa'));var jsforce=require(_0xf79c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf79c('0xc'));var querystring=require(_0xf79c('0xd'));var Papa=require(_0xf79c('0xe'));var Redis=require('ioredis');var authService=require(_0xf79c('0xf'));var qs=require(_0xf79c('0x10'));var as=require(_0xf79c('0x11'));var hardwareService=require(_0xf79c('0x12'));var logger=require(_0xf79c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf79c('0x14'));var licenseUtil=require(_0xf79c('0x15'));var db=require(_0xf79c('0x16'))['db'];function respondWithStatusCode(_0x54cfca,_0x4b4f87){_0x4b4f87=_0x4b4f87||0xcc;return function(_0x442212){if(_0x442212){return _0x54cfca[_0xf79c('0x17')](_0x4b4f87);}return _0x54cfca['status'](_0x4b4f87)[_0xf79c('0x18')]();};}function respondWithResult(_0x2db656,_0x25eed){_0x25eed=_0x25eed||0xc8;return function(_0x540df2){if(_0x540df2){return _0x2db656['status'](_0x25eed)['json'](_0x540df2);}};}function respondWithFilteredResult(_0x3b234c,_0x42ba8c){return function(_0x82e240){if(_0x82e240){var _0x1db0c5=typeof _0x42ba8c[_0xf79c('0x19')]===_0xf79c('0x1a')&&typeof _0x42ba8c[_0xf79c('0x1b')]===_0xf79c('0x1a');var _0x43bb74=_0x82e240['count'];var _0x111e45=_0x1db0c5?0x0:_0x42ba8c[_0xf79c('0x19')];var _0x3ff1e6=_0x1db0c5?_0x82e240[_0xf79c('0x1c')]:_0x42ba8c[_0xf79c('0x19')]+_0x42ba8c['limit'];var _0x90ec92;if(_0x3ff1e6>=_0x43bb74){_0x3ff1e6=_0x43bb74;_0x90ec92=0xc8;}else{_0x90ec92=0xce;}_0x3b234c['status'](_0x90ec92);return _0x3b234c[_0xf79c('0x1d')]('Content-Range',_0x111e45+'-'+_0x3ff1e6+'/'+_0x43bb74)[_0xf79c('0x1e')](_0x82e240);}return null;};}function patchUpdates(_0x186bd3){return function(_0x3aa03a){try{jsonpatch[_0xf79c('0x1f')](_0x3aa03a,_0x186bd3,!![]);}catch(_0xce552a){return BPromise['reject'](_0xce552a);}return _0x3aa03a[_0xf79c('0x20')]();};}function saveUpdates(_0x4c5612,_0x458088){return function(_0x259238){if(_0x259238){return _0x259238['update'](_0x4c5612)[_0xf79c('0x21')](function(_0x249625){return _0x249625;});}return null;};}function removeEntity(_0x295814,_0x54f085){return function(_0x5ab76f){if(_0x5ab76f){return _0x5ab76f[_0xf79c('0x22')]()[_0xf79c('0x21')](function(){_0x295814[_0xf79c('0x23')](0xcc)[_0xf79c('0x18')]();});}};}function handleEntityNotFound(_0x4a3cd2,_0x421e31){return function(_0x4b8811){if(!_0x4b8811){_0x4a3cd2[_0xf79c('0x17')](0x194);}return _0x4b8811;};}function handleError(_0x521aaa,_0x357ed7){_0x357ed7=_0x357ed7||0x1f4;return function(_0x149814){logger[_0xf79c('0x24')](_0x149814[_0xf79c('0x25')]);if(_0x149814[_0xf79c('0x26')]){delete _0x149814[_0xf79c('0x26')];}_0x521aaa[_0xf79c('0x23')](_0x357ed7)['send'](_0x149814);};}exports[_0xf79c('0x27')]=function(_0x5751e2,_0x44db61){var _0x21ad52={},_0x188691={},_0x2e321d={'count':0x0,'rows':[]};var _0xd844a8=_[_0xf79c('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0x14c479){return{'name':_0x14c479['fieldName'],'type':_0x14c479[_0xf79c('0x29')]['key']};});_0x188691[_0xf79c('0x2a')]=_[_0xf79c('0x28')](_0xd844a8,_0xf79c('0x26'));_0x188691[_0xf79c('0x2b')]=_['keys'](_0x5751e2[_0xf79c('0x2b')]);_0x188691[_0xf79c('0x2c')]=_['intersection'](_0x188691[_0xf79c('0x2a')],_0x188691[_0xf79c('0x2b')]);_0x21ad52['attributes']=_['intersection'](_0x188691['model'],qs[_0xf79c('0x2d')](_0x5751e2[_0xf79c('0x2b')][_0xf79c('0x2d')]));_0x21ad52[_0xf79c('0x2e')]=_0x21ad52[_0xf79c('0x2e')]['length']?_0x21ad52[_0xf79c('0x2e')]:_0x188691[_0xf79c('0x2a')];if(!_0x5751e2[_0xf79c('0x2b')]['hasOwnProperty'](_0xf79c('0x2f'))){_0x21ad52['limit']=qs[_0xf79c('0x1b')](_0x5751e2[_0xf79c('0x2b')][_0xf79c('0x1b')]);_0x21ad52[_0xf79c('0x19')]=qs[_0xf79c('0x19')](_0x5751e2[_0xf79c('0x2b')][_0xf79c('0x19')]);}_0x21ad52[_0xf79c('0x30')]=qs[_0xf79c('0x31')](_0x5751e2[_0xf79c('0x2b')]['sort']);_0x21ad52['where']=qs['filters'](_[_0xf79c('0x32')](_0x5751e2[_0xf79c('0x2b')],_0x188691[_0xf79c('0x2c')]),_0xd844a8);if(_0x5751e2[_0xf79c('0x2b')][_0xf79c('0x33')]){_0x21ad52['where']=_[_0xf79c('0x34')](_0x21ad52[_0xf79c('0x35')],{'$or':_[_0xf79c('0x28')](_0xd844a8,function(_0xeda414){if(_0xeda414[_0xf79c('0x29')]!==_0xf79c('0x36')){var _0x57075c={};_0x57075c[_0xeda414[_0xf79c('0x26')]]={'$like':'%'+_0x5751e2[_0xf79c('0x2b')]['filter']+'%'};return _0x57075c;}})});}_0x21ad52=_[_0xf79c('0x34')]({},_0x21ad52,_0x5751e2['options']);var _0x3e3c09={'where':_0x21ad52[_0xf79c('0x35')]};return db[_0xf79c('0x37')][_0xf79c('0x1c')](_0x3e3c09)[_0xf79c('0x21')](function(_0x256734){_0x2e321d[_0xf79c('0x1c')]=_0x256734;if(_0x5751e2['query'][_0xf79c('0x38')]){_0x21ad52[_0xf79c('0x39')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x21ad52);})['then'](function(_0x325156){_0x2e321d[_0xf79c('0x3a')]=_0x325156;return _0x2e321d;})[_0xf79c('0x21')](respondWithFilteredResult(_0x44db61,_0x21ad52))['catch'](handleError(_0x44db61,null));};exports['show']=function(_0x241c67,_0x2ddcaa){var _0x5c4a80={'raw':![],'where':{'id':_0x241c67[_0xf79c('0x3b')]['id']}},_0x2626b4={};_0x2626b4[_0xf79c('0x2a')]=_[_0xf79c('0x3c')](db[_0xf79c('0x37')][_0xf79c('0x3d')]);_0x2626b4[_0xf79c('0x2b')]=_[_0xf79c('0x3c')](_0x241c67['query']);_0x2626b4[_0xf79c('0x2c')]=_[_0xf79c('0x3e')](_0x2626b4[_0xf79c('0x2a')],_0x2626b4[_0xf79c('0x2b')]);_0x5c4a80[_0xf79c('0x2e')]=_['intersection'](_0x2626b4[_0xf79c('0x2a')],qs['fields'](_0x241c67[_0xf79c('0x2b')][_0xf79c('0x2d')]));_0x5c4a80[_0xf79c('0x2e')]=_0x5c4a80[_0xf79c('0x2e')]['length']?_0x5c4a80[_0xf79c('0x2e')]:_0x2626b4[_0xf79c('0x2a')];if(_0x241c67['query'][_0xf79c('0x38')]){_0x5c4a80['include']=[{'all':!![]}];}_0x5c4a80=_[_0xf79c('0x34')]({},_0x5c4a80,_0x241c67[_0xf79c('0x3f')]);return db[_0xf79c('0x37')][_0xf79c('0x40')](_0x5c4a80)['then'](handleEntityNotFound(_0x2ddcaa,null))[_0xf79c('0x21')](respondWithResult(_0x2ddcaa,null))[_0xf79c('0x41')](handleError(_0x2ddcaa,null));};exports[_0xf79c('0x42')]=function(_0xc8d493,_0x513d10){return db[_0xf79c('0x37')][_0xf79c('0x42')](_0xc8d493['body'],{})[_0xf79c('0x21')](respondWithResult(_0x513d10,0xc9))['catch'](handleError(_0x513d10,null));};exports[_0xf79c('0x43')]=function(_0x1354e0,_0x3ba4f2){if(_0x1354e0['body']['id']){delete _0x1354e0['body']['id'];}return db[_0xf79c('0x37')][_0xf79c('0x40')]({'where':{'id':_0x1354e0[_0xf79c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3ba4f2,null))['then'](saveUpdates(_0x1354e0[_0xf79c('0x44')],null))['then'](respondWithResult(_0x3ba4f2,null))['catch'](handleError(_0x3ba4f2,null));};exports[_0xf79c('0x22')]=function(_0xb46310,_0x3366d7){return db[_0xf79c('0x37')][_0xf79c('0x40')]({'where':{'id':_0xb46310[_0xf79c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3366d7,null))[_0xf79c('0x21')](removeEntity(_0x3366d7,null))[_0xf79c('0x41')](handleError(_0x3366d7,null));};exports[_0xf79c('0x45')]=function(_0x139fdc,_0x467e60,_0x2be5e7){var _0xc84658={};var _0x15c8bc={};var _0x3023c7;var _0x57484d;return db[_0xf79c('0x37')][_0xf79c('0x46')]({'where':{'id':_0x139fdc['params']['id']}})[_0xf79c('0x21')](handleEntityNotFound(_0x467e60,null))['then'](function(_0x2e7209){if(_0x2e7209){_0x3023c7=_0x2e7209;_0x15c8bc[_0xf79c('0x2a')]=_['keys'](db[_0xf79c('0x47')][_0xf79c('0x3d')]);_0x15c8bc[_0xf79c('0x2b')]=_['keys'](_0x139fdc[_0xf79c('0x2b')]);_0x15c8bc[_0xf79c('0x2c')]=_[_0xf79c('0x3e')](_0x15c8bc[_0xf79c('0x2a')],_0x15c8bc['query']);_0xc84658['attributes']=_[_0xf79c('0x3e')](_0x15c8bc[_0xf79c('0x2a')],qs[_0xf79c('0x2d')](_0x139fdc['query'][_0xf79c('0x2d')]));_0xc84658[_0xf79c('0x2e')]=_0xc84658[_0xf79c('0x2e')][_0xf79c('0x48')]?_0xc84658['attributes']:_0x15c8bc['model'];_0xc84658['order']=qs[_0xf79c('0x31')](_0x139fdc[_0xf79c('0x2b')][_0xf79c('0x31')]);_0xc84658[_0xf79c('0x35')]=qs['filters'](_[_0xf79c('0x32')](_0x139fdc[_0xf79c('0x2b')],_0x15c8bc['filters']));if(_0x139fdc['query'][_0xf79c('0x33')]){_0xc84658['where']=_[_0xf79c('0x34')](_0xc84658[_0xf79c('0x35')],{'$or':_['map'](_0xc84658[_0xf79c('0x2e')],function(_0x58913a){var _0x200987={};_0x200987[_0x58913a]={'$like':'%'+_0x139fdc[_0xf79c('0x2b')]['filter']+'%'};return _0x200987;})});}_0xc84658=_[_0xf79c('0x34')]({},_0xc84658,_0x139fdc[_0xf79c('0x3f')]);return _0x3023c7[_0xf79c('0x45')](_0xc84658);}})['then'](function(_0x4c7e5d){if(_0x4c7e5d){_0x57484d=_0x4c7e5d[_0xf79c('0x48')];if(!_0x139fdc[_0xf79c('0x2b')][_0xf79c('0x49')](_0xf79c('0x2f'))){_0xc84658[_0xf79c('0x1b')]=qs[_0xf79c('0x1b')](_0x139fdc['query'][_0xf79c('0x1b')]);_0xc84658[_0xf79c('0x19')]=qs['offset'](_0x139fdc[_0xf79c('0x2b')][_0xf79c('0x19')]);}return _0x3023c7[_0xf79c('0x45')](_0xc84658);}})[_0xf79c('0x21')](function(_0x4aeb83){if(_0x4aeb83){return _0x4aeb83?{'count':_0x57484d,'rows':_0x4aeb83}:null;}})[_0xf79c('0x21')](respondWithResult(_0x467e60,null))[_0xf79c('0x41')](handleError(_0x467e60,null));};exports[_0xf79c('0x4a')]=function(_0x2a27f6,_0x32814c,_0x4dc2d4){var _0x4eea0d={};var _0x3187ab={};var _0x227ccb;var _0x201ca9;return db['Dynamics365Configuration'][_0xf79c('0x46')]({'where':{'id':_0x2a27f6[_0xf79c('0x3b')]['id']}})[_0xf79c('0x21')](handleEntityNotFound(_0x32814c,null))[_0xf79c('0x21')](function(_0x12babe){if(_0x12babe){_0x227ccb=_0x12babe;_0x3187ab['model']=_['keys'](db['Dynamics365Field'][_0xf79c('0x3d')]);_0x3187ab[_0xf79c('0x2b')]=_[_0xf79c('0x3c')](_0x2a27f6[_0xf79c('0x2b')]);_0x3187ab['filters']=_['intersection'](_0x3187ab[_0xf79c('0x2a')],_0x3187ab[_0xf79c('0x2b')]);_0x4eea0d[_0xf79c('0x2e')]=_[_0xf79c('0x3e')](_0x3187ab[_0xf79c('0x2a')],qs[_0xf79c('0x2d')](_0x2a27f6['query'][_0xf79c('0x2d')]));_0x4eea0d[_0xf79c('0x2e')]=_0x4eea0d[_0xf79c('0x2e')]['length']?_0x4eea0d[_0xf79c('0x2e')]:_0x3187ab[_0xf79c('0x2a')];_0x4eea0d[_0xf79c('0x30')]=qs[_0xf79c('0x31')](_0x2a27f6[_0xf79c('0x2b')]['sort']);_0x4eea0d[_0xf79c('0x35')]=qs[_0xf79c('0x2c')](_[_0xf79c('0x32')](_0x2a27f6[_0xf79c('0x2b')],_0x3187ab[_0xf79c('0x2c')]));if(_0x2a27f6[_0xf79c('0x2b')]['filter']){_0x4eea0d[_0xf79c('0x35')]=_['merge'](_0x4eea0d[_0xf79c('0x35')],{'$or':_[_0xf79c('0x28')](_0x4eea0d[_0xf79c('0x2e')],function(_0x209010){var _0x5ee535={};_0x5ee535[_0x209010]={'$like':'%'+_0x2a27f6[_0xf79c('0x2b')][_0xf79c('0x33')]+'%'};return _0x5ee535;})});}_0x4eea0d=_[_0xf79c('0x34')]({},_0x4eea0d,_0x2a27f6[_0xf79c('0x3f')]);return _0x227ccb[_0xf79c('0x4a')](_0x4eea0d);}})[_0xf79c('0x21')](function(_0x51b286){if(_0x51b286){_0x201ca9=_0x51b286[_0xf79c('0x48')];if(!_0x2a27f6[_0xf79c('0x2b')][_0xf79c('0x49')](_0xf79c('0x2f'))){_0x4eea0d['limit']=qs[_0xf79c('0x1b')](_0x2a27f6[_0xf79c('0x2b')][_0xf79c('0x1b')]);_0x4eea0d[_0xf79c('0x19')]=qs[_0xf79c('0x19')](_0x2a27f6[_0xf79c('0x2b')][_0xf79c('0x19')]);}return _0x227ccb[_0xf79c('0x4a')](_0x4eea0d);}})['then'](function(_0xe03b5e){if(_0xe03b5e){return _0xe03b5e?{'count':_0x201ca9,'rows':_0xe03b5e}:null;}})['then'](respondWithResult(_0x32814c,null))['catch'](handleError(_0x32814c,null));};exports['getDescriptions']=function(_0x12fd7e,_0x23fadd,_0x4fedcc){var _0xf8d377={};var _0x44ab57={};var _0x1fee19;var _0x33c5c7;return db[_0xf79c('0x37')][_0xf79c('0x46')]({'where':{'id':_0x12fd7e[_0xf79c('0x3b')]['id']}})[_0xf79c('0x21')](handleEntityNotFound(_0x23fadd,null))[_0xf79c('0x21')](function(_0x445e46){if(_0x445e46){_0x1fee19=_0x445e46;_0x44ab57[_0xf79c('0x2a')]=_[_0xf79c('0x3c')](db['Dynamics365Field'][_0xf79c('0x3d')]);_0x44ab57[_0xf79c('0x2b')]=_[_0xf79c('0x3c')](_0x12fd7e[_0xf79c('0x2b')]);_0x44ab57[_0xf79c('0x2c')]=_['intersection'](_0x44ab57[_0xf79c('0x2a')],_0x44ab57[_0xf79c('0x2b')]);_0xf8d377[_0xf79c('0x2e')]=_['intersection'](_0x44ab57[_0xf79c('0x2a')],qs['fields'](_0x12fd7e['query']['fields']));_0xf8d377['attributes']=_0xf8d377[_0xf79c('0x2e')][_0xf79c('0x48')]?_0xf8d377[_0xf79c('0x2e')]:_0x44ab57[_0xf79c('0x2a')];_0xf8d377[_0xf79c('0x30')]=qs[_0xf79c('0x31')](_0x12fd7e[_0xf79c('0x2b')][_0xf79c('0x31')]);_0xf8d377['where']=qs['filters'](_['pick'](_0x12fd7e[_0xf79c('0x2b')],_0x44ab57[_0xf79c('0x2c')]));if(_0x12fd7e[_0xf79c('0x2b')][_0xf79c('0x33')]){_0xf8d377['where']=_[_0xf79c('0x34')](_0xf8d377[_0xf79c('0x35')],{'$or':_['map'](_0xf8d377[_0xf79c('0x2e')],function(_0x5f2d2e){var _0x45a0ca={};_0x45a0ca[_0x5f2d2e]={'$like':'%'+_0x12fd7e[_0xf79c('0x2b')][_0xf79c('0x33')]+'%'};return _0x45a0ca;})});}_0xf8d377=_[_0xf79c('0x34')]({},_0xf8d377,_0x12fd7e[_0xf79c('0x3f')]);return _0x1fee19[_0xf79c('0x4b')](_0xf8d377);}})[_0xf79c('0x21')](function(_0x207042){if(_0x207042){_0x33c5c7=_0x207042['length'];if(!_0x12fd7e[_0xf79c('0x2b')][_0xf79c('0x49')](_0xf79c('0x2f'))){_0xf8d377[_0xf79c('0x1b')]=qs[_0xf79c('0x1b')](_0x12fd7e[_0xf79c('0x2b')]['limit']);_0xf8d377[_0xf79c('0x19')]=qs[_0xf79c('0x19')](_0x12fd7e[_0xf79c('0x2b')][_0xf79c('0x19')]);}return _0x1fee19['getDescriptions'](_0xf8d377);}})[_0xf79c('0x21')](function(_0x554d64){if(_0x554d64){return _0x554d64?{'count':_0x33c5c7,'rows':_0x554d64}:null;}})[_0xf79c('0x21')](respondWithResult(_0x23fadd,null))['catch'](handleError(_0x23fadd,null));}; \ No newline at end of file +var _0x1eb1=['moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','find','getFields','findOne','Dynamics365Field','order','pick','merge','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x34dd48,_0x1d0620){var _0x486efd=function(_0xaa1812){while(--_0xaa1812){_0x34dd48['push'](_0x34dd48['shift']());}};_0x486efd(++_0x1d0620);}(_0x1eb1,0x14b));var _0x11eb=function(_0x2673c8,_0x2a8a28){_0x2673c8=_0x2673c8-0x0;var _0x3a7346=_0x1eb1[_0x2673c8];return _0x3a7346;};'use strict';var emlformat=require(_0x11eb('0x0'));var rimraf=require(_0x11eb('0x1'));var zipdir=require(_0x11eb('0x2'));var jsonpatch=require(_0x11eb('0x3'));var rp=require(_0x11eb('0x4'));var moment=require(_0x11eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x11eb('0x6'));var util=require(_0x11eb('0x7'));var path=require('path');var sox=require(_0x11eb('0x8'));var csv=require(_0x11eb('0x9'));var ejs=require(_0x11eb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11eb('0xb'));var squel=require(_0x11eb('0xc'));var crypto=require(_0x11eb('0xd'));var jsforce=require(_0x11eb('0xe'));var deskjs=require(_0x11eb('0xf'));var toCsv=require(_0x11eb('0x9'));var querystring=require(_0x11eb('0x10'));var Papa=require(_0x11eb('0x11'));var Redis=require(_0x11eb('0x12'));var authService=require(_0x11eb('0x13'));var qs=require(_0x11eb('0x14'));var as=require(_0x11eb('0x15'));var hardwareService=require(_0x11eb('0x16'));var logger=require(_0x11eb('0x17'))(_0x11eb('0x18'));var utils=require(_0x11eb('0x19'));var config=require(_0x11eb('0x1a'));var licenseUtil=require(_0x11eb('0x1b'));var db=require(_0x11eb('0x1c'))['db'];function respondWithStatusCode(_0x4b5006,_0x304f13){_0x304f13=_0x304f13||0xcc;return function(_0x104e4f){if(_0x104e4f){return _0x4b5006[_0x11eb('0x1d')](_0x304f13);}return _0x4b5006[_0x11eb('0x1e')](_0x304f13)[_0x11eb('0x1f')]();};}function respondWithResult(_0x5f1491,_0x7144db){_0x7144db=_0x7144db||0xc8;return function(_0x9be5a0){if(_0x9be5a0){return _0x5f1491['status'](_0x7144db)['json'](_0x9be5a0);}};}function respondWithFilteredResult(_0x42b2e6,_0x1380c9){return function(_0x1cea00){if(_0x1cea00){var _0x511af7=typeof _0x1380c9[_0x11eb('0x20')]===_0x11eb('0x21')&&typeof _0x1380c9['limit']===_0x11eb('0x21');var _0x477a1d=_0x1cea00[_0x11eb('0x22')];var _0x1218c4=_0x511af7?0x0:_0x1380c9[_0x11eb('0x20')];var _0x1c4db9=_0x511af7?_0x1cea00[_0x11eb('0x22')]:_0x1380c9[_0x11eb('0x20')]+_0x1380c9[_0x11eb('0x23')];var _0x57f93b;if(_0x1c4db9>=_0x477a1d){_0x1c4db9=_0x477a1d;_0x57f93b=0xc8;}else{_0x57f93b=0xce;}_0x42b2e6[_0x11eb('0x1e')](_0x57f93b);return _0x42b2e6[_0x11eb('0x24')]('Content-Range',_0x1218c4+'-'+_0x1c4db9+'/'+_0x477a1d)['json'](_0x1cea00);}return null;};}function patchUpdates(_0x26feef){return function(_0x4850af){try{jsonpatch[_0x11eb('0x25')](_0x4850af,_0x26feef,!![]);}catch(_0x38696d){return BPromise[_0x11eb('0x26')](_0x38696d);}return _0x4850af[_0x11eb('0x27')]();};}function saveUpdates(_0x504982,_0x5cf6a6){return function(_0x4e158c){if(_0x4e158c){return _0x4e158c[_0x11eb('0x28')](_0x504982)[_0x11eb('0x29')](function(_0xef0b65){return _0xef0b65;});}return null;};}function removeEntity(_0x48c41b,_0x3710f5){return function(_0x15443e){if(_0x15443e){return _0x15443e[_0x11eb('0x2a')]()[_0x11eb('0x29')](function(){_0x48c41b[_0x11eb('0x1e')](0xcc)[_0x11eb('0x1f')]();});}};}function handleEntityNotFound(_0x483d22,_0x2f6acc){return function(_0x4dd185){if(!_0x4dd185){_0x483d22[_0x11eb('0x1d')](0x194);}return _0x4dd185;};}function handleError(_0x2baa0e,_0x10a2ec){_0x10a2ec=_0x10a2ec||0x1f4;return function(_0x4388e1){logger[_0x11eb('0x2b')](_0x4388e1[_0x11eb('0x2c')]);if(_0x4388e1[_0x11eb('0x2d')]){delete _0x4388e1[_0x11eb('0x2d')];}_0x2baa0e['status'](_0x10a2ec)[_0x11eb('0x2e')](_0x4388e1);};}exports['index']=function(_0x1ad7d2,_0x2e2b56){var _0x2189e0={},_0x3af8f9={},_0x11a851={'count':0x0,'rows':[]};var _0x3e2c25=_['map'](db[_0x11eb('0x2f')][_0x11eb('0x30')],function(_0x365654){return{'name':_0x365654[_0x11eb('0x31')],'type':_0x365654[_0x11eb('0x32')][_0x11eb('0x33')]};});_0x3af8f9[_0x11eb('0x34')]=_[_0x11eb('0x35')](_0x3e2c25,'name');_0x3af8f9[_0x11eb('0x36')]=_[_0x11eb('0x37')](_0x1ad7d2[_0x11eb('0x36')]);_0x3af8f9[_0x11eb('0x38')]=_[_0x11eb('0x39')](_0x3af8f9[_0x11eb('0x34')],_0x3af8f9[_0x11eb('0x36')]);_0x2189e0[_0x11eb('0x3a')]=_[_0x11eb('0x39')](_0x3af8f9[_0x11eb('0x34')],qs[_0x11eb('0x3b')](_0x1ad7d2[_0x11eb('0x36')]['fields']));_0x2189e0[_0x11eb('0x3a')]=_0x2189e0['attributes'][_0x11eb('0x3c')]?_0x2189e0['attributes']:_0x3af8f9[_0x11eb('0x34')];if(!_0x1ad7d2[_0x11eb('0x36')]['hasOwnProperty']('nolimit')){_0x2189e0[_0x11eb('0x23')]=qs[_0x11eb('0x23')](_0x1ad7d2[_0x11eb('0x36')][_0x11eb('0x23')]);_0x2189e0[_0x11eb('0x20')]=qs[_0x11eb('0x20')](_0x1ad7d2[_0x11eb('0x36')][_0x11eb('0x20')]);}_0x2189e0['order']=qs[_0x11eb('0x3d')](_0x1ad7d2[_0x11eb('0x36')][_0x11eb('0x3d')]);_0x2189e0[_0x11eb('0x3e')]=qs['filters'](_['pick'](_0x1ad7d2[_0x11eb('0x36')],_0x3af8f9['filters']),_0x3e2c25);if(_0x1ad7d2[_0x11eb('0x36')][_0x11eb('0x3f')]){_0x2189e0[_0x11eb('0x3e')]=_['merge'](_0x2189e0[_0x11eb('0x3e')],{'$or':_[_0x11eb('0x35')](_0x3e2c25,function(_0x5084f5){if(_0x5084f5['type']!==_0x11eb('0x40')){var _0x13a67c={};_0x13a67c[_0x5084f5[_0x11eb('0x2d')]]={'$like':'%'+_0x1ad7d2[_0x11eb('0x36')][_0x11eb('0x3f')]+'%'};return _0x13a67c;}})});}_0x2189e0=_['merge']({},_0x2189e0,_0x1ad7d2[_0x11eb('0x41')]);var _0x284c3e={'where':_0x2189e0[_0x11eb('0x3e')]};return db[_0x11eb('0x2f')][_0x11eb('0x22')](_0x284c3e)['then'](function(_0x2532a7){_0x11a851['count']=_0x2532a7;if(_0x1ad7d2[_0x11eb('0x36')][_0x11eb('0x42')]){_0x2189e0[_0x11eb('0x43')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x11eb('0x44')](_0x2189e0);})[_0x11eb('0x29')](function(_0x17270e){_0x11a851[_0x11eb('0x45')]=_0x17270e;return _0x11a851;})[_0x11eb('0x29')](respondWithFilteredResult(_0x2e2b56,_0x2189e0))[_0x11eb('0x46')](handleError(_0x2e2b56,null));};exports['show']=function(_0x5afcd8,_0x175040){var _0x1f938c={'raw':![],'where':{'id':_0x5afcd8[_0x11eb('0x47')]['id']}},_0x2c14f9={};_0x2c14f9['model']=_[_0x11eb('0x37')](db[_0x11eb('0x2f')][_0x11eb('0x30')]);_0x2c14f9['query']=_['keys'](_0x5afcd8[_0x11eb('0x36')]);_0x2c14f9[_0x11eb('0x38')]=_[_0x11eb('0x39')](_0x2c14f9['model'],_0x2c14f9['query']);_0x1f938c[_0x11eb('0x3a')]=_[_0x11eb('0x39')](_0x2c14f9[_0x11eb('0x34')],qs[_0x11eb('0x3b')](_0x5afcd8[_0x11eb('0x36')][_0x11eb('0x3b')]));_0x1f938c[_0x11eb('0x3a')]=_0x1f938c[_0x11eb('0x3a')][_0x11eb('0x3c')]?_0x1f938c[_0x11eb('0x3a')]:_0x2c14f9[_0x11eb('0x34')];if(_0x5afcd8[_0x11eb('0x36')][_0x11eb('0x42')]){_0x1f938c[_0x11eb('0x43')]=[{'all':!![]}];}_0x1f938c=_['merge']({},_0x1f938c,_0x5afcd8[_0x11eb('0x41')]);return db['Dynamics365Configuration']['find'](_0x1f938c)['then'](handleEntityNotFound(_0x175040,null))[_0x11eb('0x29')](respondWithResult(_0x175040,null))['catch'](handleError(_0x175040,null));};exports[_0x11eb('0x48')]=function(_0xe1005c,_0x58c7d1){return db[_0x11eb('0x2f')][_0x11eb('0x48')](_0xe1005c['body'],{})[_0x11eb('0x29')](respondWithResult(_0x58c7d1,0xc9))[_0x11eb('0x46')](handleError(_0x58c7d1,null));};exports[_0x11eb('0x28')]=function(_0x2069f6,_0x15c022){if(_0x2069f6['body']['id']){delete _0x2069f6['body']['id'];}return db[_0x11eb('0x2f')]['find']({'where':{'id':_0x2069f6[_0x11eb('0x47')]['id']}})[_0x11eb('0x29')](handleEntityNotFound(_0x15c022,null))['then'](saveUpdates(_0x2069f6['body'],null))[_0x11eb('0x29')](respondWithResult(_0x15c022,null))[_0x11eb('0x46')](handleError(_0x15c022,null));};exports[_0x11eb('0x2a')]=function(_0x4dc74d,_0x8d8b24){return db[_0x11eb('0x2f')][_0x11eb('0x49')]({'where':{'id':_0x4dc74d['params']['id']}})['then'](handleEntityNotFound(_0x8d8b24,null))[_0x11eb('0x29')](removeEntity(_0x8d8b24,null))['catch'](handleError(_0x8d8b24,null));};exports[_0x11eb('0x4a')]=function(_0xa38f9a,_0x1bf8f7,_0x102d10){var _0x3d916d={};var _0x4390c3={};var _0x2c4dfc;var _0x4c8239;return db[_0x11eb('0x2f')][_0x11eb('0x4b')]({'where':{'id':_0xa38f9a[_0x11eb('0x47')]['id']}})[_0x11eb('0x29')](handleEntityNotFound(_0x1bf8f7,null))[_0x11eb('0x29')](function(_0x4ee5c1){if(_0x4ee5c1){_0x2c4dfc=_0x4ee5c1;_0x4390c3[_0x11eb('0x34')]=_[_0x11eb('0x37')](db[_0x11eb('0x4c')][_0x11eb('0x30')]);_0x4390c3[_0x11eb('0x36')]=_[_0x11eb('0x37')](_0xa38f9a[_0x11eb('0x36')]);_0x4390c3[_0x11eb('0x38')]=_[_0x11eb('0x39')](_0x4390c3['model'],_0x4390c3[_0x11eb('0x36')]);_0x3d916d[_0x11eb('0x3a')]=_[_0x11eb('0x39')](_0x4390c3[_0x11eb('0x34')],qs[_0x11eb('0x3b')](_0xa38f9a[_0x11eb('0x36')][_0x11eb('0x3b')]));_0x3d916d[_0x11eb('0x3a')]=_0x3d916d[_0x11eb('0x3a')][_0x11eb('0x3c')]?_0x3d916d['attributes']:_0x4390c3[_0x11eb('0x34')];_0x3d916d[_0x11eb('0x4d')]=qs[_0x11eb('0x3d')](_0xa38f9a['query'][_0x11eb('0x3d')]);_0x3d916d[_0x11eb('0x3e')]=qs[_0x11eb('0x38')](_[_0x11eb('0x4e')](_0xa38f9a[_0x11eb('0x36')],_0x4390c3[_0x11eb('0x38')]));if(_0xa38f9a[_0x11eb('0x36')][_0x11eb('0x3f')]){_0x3d916d[_0x11eb('0x3e')]=_[_0x11eb('0x4f')](_0x3d916d[_0x11eb('0x3e')],{'$or':_['map'](_0x3d916d[_0x11eb('0x3a')],function(_0x148b2f){var _0x128f9e={};_0x128f9e[_0x148b2f]={'$like':'%'+_0xa38f9a[_0x11eb('0x36')][_0x11eb('0x3f')]+'%'};return _0x128f9e;})});}_0x3d916d=_[_0x11eb('0x4f')]({},_0x3d916d,_0xa38f9a['options']);return _0x2c4dfc[_0x11eb('0x4a')](_0x3d916d);}})[_0x11eb('0x29')](function(_0xae029e){if(_0xae029e){_0x4c8239=_0xae029e[_0x11eb('0x3c')];if(!_0xa38f9a['query'][_0x11eb('0x50')](_0x11eb('0x51'))){_0x3d916d[_0x11eb('0x23')]=qs[_0x11eb('0x23')](_0xa38f9a[_0x11eb('0x36')]['limit']);_0x3d916d[_0x11eb('0x20')]=qs['offset'](_0xa38f9a[_0x11eb('0x36')][_0x11eb('0x20')]);}return _0x2c4dfc[_0x11eb('0x4a')](_0x3d916d);}})[_0x11eb('0x29')](function(_0x5f58c2){if(_0x5f58c2){return _0x5f58c2?{'count':_0x4c8239,'rows':_0x5f58c2}:null;}})[_0x11eb('0x29')](respondWithResult(_0x1bf8f7,null))['catch'](handleError(_0x1bf8f7,null));};exports['getSubjects']=function(_0x16063c,_0x9548a9,_0x12e8be){var _0x481e0c={};var _0x4e4382={};var _0xe2b30d;var _0x16634d;return db[_0x11eb('0x2f')]['findOne']({'where':{'id':_0x16063c[_0x11eb('0x47')]['id']}})[_0x11eb('0x29')](handleEntityNotFound(_0x9548a9,null))[_0x11eb('0x29')](function(_0x100e31){if(_0x100e31){_0xe2b30d=_0x100e31;_0x4e4382[_0x11eb('0x34')]=_[_0x11eb('0x37')](db[_0x11eb('0x4c')]['rawAttributes']);_0x4e4382[_0x11eb('0x36')]=_[_0x11eb('0x37')](_0x16063c[_0x11eb('0x36')]);_0x4e4382['filters']=_[_0x11eb('0x39')](_0x4e4382[_0x11eb('0x34')],_0x4e4382[_0x11eb('0x36')]);_0x481e0c[_0x11eb('0x3a')]=_[_0x11eb('0x39')](_0x4e4382[_0x11eb('0x34')],qs[_0x11eb('0x3b')](_0x16063c[_0x11eb('0x36')]['fields']));_0x481e0c[_0x11eb('0x3a')]=_0x481e0c[_0x11eb('0x3a')][_0x11eb('0x3c')]?_0x481e0c[_0x11eb('0x3a')]:_0x4e4382[_0x11eb('0x34')];_0x481e0c[_0x11eb('0x4d')]=qs[_0x11eb('0x3d')](_0x16063c[_0x11eb('0x36')][_0x11eb('0x3d')]);_0x481e0c[_0x11eb('0x3e')]=qs[_0x11eb('0x38')](_[_0x11eb('0x4e')](_0x16063c[_0x11eb('0x36')],_0x4e4382[_0x11eb('0x38')]));if(_0x16063c[_0x11eb('0x36')]['filter']){_0x481e0c['where']=_[_0x11eb('0x4f')](_0x481e0c[_0x11eb('0x3e')],{'$or':_[_0x11eb('0x35')](_0x481e0c[_0x11eb('0x3a')],function(_0x1a8dea){var _0x20bba2={};_0x20bba2[_0x1a8dea]={'$like':'%'+_0x16063c['query'][_0x11eb('0x3f')]+'%'};return _0x20bba2;})});}_0x481e0c=_[_0x11eb('0x4f')]({},_0x481e0c,_0x16063c['options']);return _0xe2b30d[_0x11eb('0x52')](_0x481e0c);}})[_0x11eb('0x29')](function(_0x40edf9){if(_0x40edf9){_0x16634d=_0x40edf9[_0x11eb('0x3c')];if(!_0x16063c['query'][_0x11eb('0x50')](_0x11eb('0x51'))){_0x481e0c[_0x11eb('0x23')]=qs['limit'](_0x16063c[_0x11eb('0x36')][_0x11eb('0x23')]);_0x481e0c[_0x11eb('0x20')]=qs[_0x11eb('0x20')](_0x16063c[_0x11eb('0x36')][_0x11eb('0x20')]);}return _0xe2b30d[_0x11eb('0x52')](_0x481e0c);}})['then'](function(_0x1c12a1){if(_0x1c12a1){return _0x1c12a1?{'count':_0x16634d,'rows':_0x1c12a1}:null;}})[_0x11eb('0x29')](respondWithResult(_0x9548a9,null))[_0x11eb('0x46')](handleError(_0x9548a9,null));};exports[_0x11eb('0x53')]=function(_0x212d66,_0x51c258,_0x4dde5b){var _0x39f322={};var _0x2b62da={};var _0x2e177b;var _0x1c5a34;return db[_0x11eb('0x2f')][_0x11eb('0x4b')]({'where':{'id':_0x212d66[_0x11eb('0x47')]['id']}})['then'](handleEntityNotFound(_0x51c258,null))[_0x11eb('0x29')](function(_0x21731e){if(_0x21731e){_0x2e177b=_0x21731e;_0x2b62da['model']=_['keys'](db[_0x11eb('0x4c')][_0x11eb('0x30')]);_0x2b62da['query']=_[_0x11eb('0x37')](_0x212d66['query']);_0x2b62da[_0x11eb('0x38')]=_['intersection'](_0x2b62da[_0x11eb('0x34')],_0x2b62da[_0x11eb('0x36')]);_0x39f322[_0x11eb('0x3a')]=_[_0x11eb('0x39')](_0x2b62da[_0x11eb('0x34')],qs[_0x11eb('0x3b')](_0x212d66[_0x11eb('0x36')][_0x11eb('0x3b')]));_0x39f322['attributes']=_0x39f322[_0x11eb('0x3a')][_0x11eb('0x3c')]?_0x39f322[_0x11eb('0x3a')]:_0x2b62da[_0x11eb('0x34')];_0x39f322['order']=qs['sort'](_0x212d66[_0x11eb('0x36')][_0x11eb('0x3d')]);_0x39f322[_0x11eb('0x3e')]=qs['filters'](_[_0x11eb('0x4e')](_0x212d66[_0x11eb('0x36')],_0x2b62da[_0x11eb('0x38')]));if(_0x212d66['query'][_0x11eb('0x3f')]){_0x39f322[_0x11eb('0x3e')]=_[_0x11eb('0x4f')](_0x39f322[_0x11eb('0x3e')],{'$or':_[_0x11eb('0x35')](_0x39f322[_0x11eb('0x3a')],function(_0x191510){var _0xdffc87={};_0xdffc87[_0x191510]={'$like':'%'+_0x212d66['query']['filter']+'%'};return _0xdffc87;})});}_0x39f322=_['merge']({},_0x39f322,_0x212d66['options']);return _0x2e177b[_0x11eb('0x53')](_0x39f322);}})['then'](function(_0x13d025){if(_0x13d025){_0x1c5a34=_0x13d025[_0x11eb('0x3c')];if(!_0x212d66[_0x11eb('0x36')][_0x11eb('0x50')](_0x11eb('0x51'))){_0x39f322[_0x11eb('0x23')]=qs['limit'](_0x212d66['query'][_0x11eb('0x23')]);_0x39f322[_0x11eb('0x20')]=qs[_0x11eb('0x20')](_0x212d66[_0x11eb('0x36')][_0x11eb('0x20')]);}return _0x2e177b[_0x11eb('0x53')](_0x39f322);}})[_0x11eb('0x29')](function(_0x8a5d9e){if(_0x8a5d9e){return _0x8a5d9e?{'count':_0x1c5a34,'rows':_0x8a5d9e}:null;}})[_0x11eb('0x29')](respondWithResult(_0x51c258,null))[_0x11eb('0x46')](handleError(_0x51c258,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 3090997..db5d254 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 _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x3cafb8,_0x32860e){var _0x4b7f85=function(_0x31b11d){while(--_0x31b11d){_0x3cafb8['push'](_0x3cafb8['shift']());}};_0x4b7f85(++_0x32860e);}(_0x008c,0x188));var _0xc008=function(_0x4142b1,_0x1119af){_0x4142b1=_0x4142b1-0x0;var _0x346210=_0x008c[_0x4142b1];return _0x346210;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x5023fd,_0x290c3f){var _0x9c249f=function(_0x263250){while(--_0x263250){_0x5023fd['push'](_0x5023fd['shift']());}};_0x9c249f(++_0x290c3f);}(_0xdace,0xc5));var _0xedac=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xdace[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('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 5f25d85..2b33789 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 _0x7d64=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4df8a1,_0x55c600){var _0x10e5c9=function(_0x12f3cf){while(--_0x12f3cf){_0x4df8a1['push'](_0x4df8a1['shift']());}};_0x10e5c9(++_0x55c600);}(_0x7d64,0x1e5));var _0x47d6=function(_0xe16c75,_0x7c260b){_0xe16c75=_0xe16c75-0x0;var _0x585e8a=_0x7d64[_0xe16c75];return _0x585e8a;};'use strict';var _=require(_0x47d6('0x0'));var util=require('util');var moment=require(_0x47d6('0x1'));var BPromise=require(_0x47d6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47d6('0x3'));var db=require(_0x47d6('0x4'))['db'];var utils=require(_0x47d6('0x5'));var logger=require(_0x47d6('0x6'))(_0x47d6('0x7'));var config=require('../../config/environment');var jayson=require(_0x47d6('0x8'));var client=jayson[_0x47d6('0x9')][_0x47d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xedc142,_0x37027a,_0x290421){return new BPromise(function(_0x3a65ef,_0x5b9ea5){return client['request'](_0xedc142,_0x290421)[_0x47d6('0xb')](function(_0x576cb4){logger[_0x47d6('0xc')](_0x47d6('0xd'),_0x37027a,'request\x20sent');logger[_0x47d6('0xe')](_0x47d6('0xf'),_0x37027a,_0x47d6('0x10'),JSON[_0x47d6('0x11')](_0x576cb4));if(_0x576cb4[_0x47d6('0x12')]){if(_0x576cb4[_0x47d6('0x12')][_0x47d6('0x13')]===0x1f4){logger[_0x47d6('0x12')](_0x47d6('0xd'),_0x37027a,_0x576cb4[_0x47d6('0x12')]['message']);return _0x5b9ea5(_0x576cb4[_0x47d6('0x12')][_0x47d6('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x37027a,_0x576cb4[_0x47d6('0x12')]['message']);return _0x3a65ef(_0x576cb4[_0x47d6('0x12')][_0x47d6('0x14')]);}else{logger[_0x47d6('0xc')](_0x47d6('0xd'),_0x37027a,'request\x20sent');_0x3a65ef(_0x576cb4[_0x47d6('0x15')][_0x47d6('0x14')]);}})[_0x47d6('0x16')](function(_0xa54a50){logger['error'](_0x47d6('0xd'),_0x37027a,_0xa54a50);_0x5b9ea5(_0xa54a50);});});} \ No newline at end of file +var _0x0c60=['../../config/environment','client','http','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2f9a03,_0x3b929b){var _0x56825b=function(_0x498cd9){while(--_0x498cd9){_0x2f9a03['push'](_0x2f9a03['shift']());}};_0x56825b(++_0x3b929b);}(_0x0c60,0x171));var _0x00c6=function(_0x3a4ef3,_0x1cc618){_0x3a4ef3=_0x3a4ef3-0x0;var _0x512679=_0x0c60[_0x3a4ef3];return _0x512679;};'use strict';var _=require(_0x00c6('0x0'));var util=require(_0x00c6('0x1'));var moment=require(_0x00c6('0x2'));var BPromise=require('bluebird');var rs=require(_0x00c6('0x3'));var fs=require('fs');var Redis=require(_0x00c6('0x4'));var db=require(_0x00c6('0x5'))['db'];var utils=require(_0x00c6('0x6'));var logger=require(_0x00c6('0x7'))(_0x00c6('0x8'));var config=require(_0x00c6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x00c6('0xa')][_0x00c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x205eee,_0x578fb7,_0x3de760){return new BPromise(function(_0x2aa841,_0x295b18){return client[_0x00c6('0xc')](_0x205eee,_0x3de760)['then'](function(_0x10b48c){logger['info'](_0x00c6('0xd'),_0x578fb7,_0x00c6('0xe'));logger[_0x00c6('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x578fb7,'request\x20sent',JSON[_0x00c6('0x10')](_0x10b48c));if(_0x10b48c[_0x00c6('0x11')]){if(_0x10b48c[_0x00c6('0x11')][_0x00c6('0x12')]===0x1f4){logger['error'](_0x00c6('0xd'),_0x578fb7,_0x10b48c[_0x00c6('0x11')][_0x00c6('0x13')]);return _0x295b18(_0x10b48c[_0x00c6('0x11')][_0x00c6('0x13')]);}logger[_0x00c6('0x11')](_0x00c6('0xd'),_0x578fb7,_0x10b48c[_0x00c6('0x11')]['message']);return _0x2aa841(_0x10b48c[_0x00c6('0x11')][_0x00c6('0x13')]);}else{logger['info'](_0x00c6('0xd'),_0x578fb7,_0x00c6('0xe'));_0x2aa841(_0x10b48c[_0x00c6('0x14')][_0x00c6('0x13')]);}})['catch'](function(_0x75afd9){logger[_0x00c6('0x11')](_0x00c6('0xd'),_0x578fb7,_0x75afd9);_0x295b18(_0x75afd9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index a239392..ad3e8e4 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 _0x11c7=['./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x289a5d,_0xb28a33){var _0x243792=function(_0x321b9d){while(--_0x321b9d){_0x289a5d['push'](_0x289a5d['shift']());}};_0x243792(++_0xb28a33);}(_0x11c7,0x128));var _0x711c=function(_0x3672a8,_0xe618ea){_0x3672a8=_0x3672a8-0x0;var _0x34b16d=_0x11c7[_0x3672a8];return _0x34b16d;};'use strict';var multer=require(_0x711c('0x0'));var util=require(_0x711c('0x1'));var path=require(_0x711c('0x2'));var timeout=require('connect-timeout');var express=require(_0x711c('0x3'));var router=express[_0x711c('0x4')]();var fs_extra=require(_0x711c('0x5'));var auth=require(_0x711c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x711c('0x7'));var controller=require(_0x711c('0x8'));router[_0x711c('0x9')]('/',auth[_0x711c('0xa')](),controller['index']);router['get'](_0x711c('0xb'),auth[_0x711c('0xa')](),controller[_0x711c('0xc')]);router[_0x711c('0xd')]('/',auth[_0x711c('0xa')](),controller[_0x711c('0xe')]);router[_0x711c('0xf')](_0x711c('0xb'),auth[_0x711c('0xa')](),controller['update']);router[_0x711c('0x10')]('/:id',auth[_0x711c('0xa')](),controller[_0x711c('0x11')]);module[_0x711c('0x12')]=router; \ No newline at end of file +var _0x00f8=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index','get','show'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x00f8,0x183));var _0x800f=function(_0x5c049a,_0x2c1263){_0x5c049a=_0x5c049a-0x0;var _0x168e70=_0x00f8[_0x5c049a];return _0x168e70;};'use strict';var multer=require(_0x800f('0x0'));var util=require(_0x800f('0x1'));var path=require(_0x800f('0x2'));var timeout=require(_0x800f('0x3'));var express=require(_0x800f('0x4'));var router=express['Router']();var fs_extra=require(_0x800f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x800f('0x6'));var config=require('../../config/environment');var controller=require(_0x800f('0x7'));router['get']('/',auth[_0x800f('0x8')](),controller[_0x800f('0x9')]);router[_0x800f('0xa')]('/:id',auth[_0x800f('0x8')](),controller[_0x800f('0xb')]);router[_0x800f('0xc')]('/',auth[_0x800f('0x8')](),controller[_0x800f('0xd')]);router[_0x800f('0xe')]('/:id',auth[_0x800f('0x8')](),controller[_0x800f('0xf')]);router[_0x800f('0x10')]('/:id',auth[_0x800f('0x8')](),controller[_0x800f('0x11')]);module[_0x800f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index caf1c24..72c4fc9 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 _0xe429=['ENUM','string','variable','customVariable','STRING','sequelize'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0xe429,0x101));var _0x9e42=function(_0xc35685,_0x2150f3){_0xc35685=_0xc35685-0x0;var _0x38c170=_0xe429[_0xc35685];return _0x38c170;};'use strict';var Sequelize=require(_0x9e42('0x0'));module['exports']={'type':{'type':Sequelize[_0x9e42('0x1')](_0x9e42('0x2'),_0x9e42('0x3'),_0x9e42('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x9e42('0x5')]},'key':{'type':Sequelize[_0x9e42('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9e42('0x2'),_0x9e42('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9e42('0x5')]},'nameField':{'type':Sequelize[_0x9e42('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcc85=['exports','ENUM','variable','keyValue','string','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x347f41,_0x2cbc52){var _0x2637c2=function(_0x27f641){while(--_0x27f641){_0x347f41['push'](_0x347f41['shift']());}};_0x2637c2(++_0x2cbc52);}(_0xcc85,0x179));var _0x5cc8=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xcc85[_0x486f4a];return _0x135d99;};'use strict';var Sequelize=require(_0x5cc8('0x0'));module[_0x5cc8('0x1')]={'type':{'type':Sequelize[_0x5cc8('0x2')]('string',_0x5cc8('0x3'),'customVariable',_0x5cc8('0x4'),'picklist'),'defaultValue':_0x5cc8('0x5')},'content':{'type':Sequelize[_0x5cc8('0x6')]},'key':{'type':Sequelize[_0x5cc8('0x6')]},'keyType':{'type':Sequelize[_0x5cc8('0x2')](_0x5cc8('0x5'),_0x5cc8('0x3'),_0x5cc8('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5cc8('0x6')]},'nameField':{'type':Sequelize[_0x5cc8('0x6')]},'customField':{'type':Sequelize[_0x5cc8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 12d66fd..2b248e9 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 _0x6bc8=['api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','find','create','body','params','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x36caec,_0x4d432e){var _0x235762=function(_0x4754a6){while(--_0x4754a6){_0x36caec['push'](_0x36caec['shift']());}};_0x235762(++_0x4d432e);}(_0x6bc8,0x83));var _0x86bc=function(_0x23c1fb,_0x678968){_0x23c1fb=_0x23c1fb-0x0;var _0x5256e0=_0x6bc8[_0x23c1fb];return _0x5256e0;};'use strict';var emlformat=require(_0x86bc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x86bc('0x1'));var moment=require(_0x86bc('0x2'));var BPromise=require(_0x86bc('0x3'));var Mustache=require(_0x86bc('0x4'));var util=require(_0x86bc('0x5'));var path=require(_0x86bc('0x6'));var sox=require(_0x86bc('0x7'));var csv=require(_0x86bc('0x8'));var ejs=require(_0x86bc('0x9'));var fs=require('fs');var fs_extra=require(_0x86bc('0xa'));var _=require(_0x86bc('0xb'));var squel=require(_0x86bc('0xc'));var crypto=require(_0x86bc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x86bc('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86bc('0xf'));var as=require(_0x86bc('0x10'));var hardwareService=require(_0x86bc('0x11'));var logger=require(_0x86bc('0x12'))(_0x86bc('0x13'));var utils=require(_0x86bc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x86bc('0x15'))['db'];function respondWithStatusCode(_0x144f9b,_0x181faa){_0x181faa=_0x181faa||0xcc;return function(_0x581f45){if(_0x581f45){return _0x144f9b['sendStatus'](_0x181faa);}return _0x144f9b[_0x86bc('0x16')](_0x181faa)[_0x86bc('0x17')]();};}function respondWithResult(_0x56e9ac,_0xb8a3d7){_0xb8a3d7=_0xb8a3d7||0xc8;return function(_0xbfe973){if(_0xbfe973){return _0x56e9ac[_0x86bc('0x16')](_0xb8a3d7)['json'](_0xbfe973);}};}function respondWithFilteredResult(_0x35713d,_0xe0b4b3){return function(_0x447b27){if(_0x447b27){var _0x34ca14=typeof _0xe0b4b3[_0x86bc('0x18')]===_0x86bc('0x19')&&typeof _0xe0b4b3[_0x86bc('0x1a')]===_0x86bc('0x19');var _0x5f3ac7=_0x447b27[_0x86bc('0x1b')];var _0xee86ff=_0x34ca14?0x0:_0xe0b4b3['offset'];var _0x22f4ab=_0x34ca14?_0x447b27[_0x86bc('0x1b')]:_0xe0b4b3[_0x86bc('0x18')]+_0xe0b4b3[_0x86bc('0x1a')];var _0x1f23d5;if(_0x22f4ab>=_0x5f3ac7){_0x22f4ab=_0x5f3ac7;_0x1f23d5=0xc8;}else{_0x1f23d5=0xce;}_0x35713d['status'](_0x1f23d5);return _0x35713d[_0x86bc('0x1c')](_0x86bc('0x1d'),_0xee86ff+'-'+_0x22f4ab+'/'+_0x5f3ac7)['json'](_0x447b27);}return null;};}function patchUpdates(_0x33cf1d){return function(_0x4d380e){try{jsonpatch['apply'](_0x4d380e,_0x33cf1d,!![]);}catch(_0x2d51ce){return BPromise[_0x86bc('0x1e')](_0x2d51ce);}return _0x4d380e[_0x86bc('0x1f')]();};}function saveUpdates(_0x3750fd,_0x2dd6f2){return function(_0x556408){if(_0x556408){return _0x556408[_0x86bc('0x20')](_0x3750fd)[_0x86bc('0x21')](function(_0x163787){return _0x163787;});}return null;};}function removeEntity(_0x537f37,_0xfa433f){return function(_0x78020a){if(_0x78020a){return _0x78020a[_0x86bc('0x22')]()[_0x86bc('0x21')](function(){_0x537f37[_0x86bc('0x16')](0xcc)[_0x86bc('0x17')]();});}};}function handleEntityNotFound(_0x4915d7,_0x27fb72){return function(_0x17bcd5){if(!_0x17bcd5){_0x4915d7[_0x86bc('0x23')](0x194);}return _0x17bcd5;};}function handleError(_0x3fb5ca,_0x310a21){_0x310a21=_0x310a21||0x1f4;return function(_0x68bea6){logger[_0x86bc('0x24')](_0x68bea6[_0x86bc('0x25')]);if(_0x68bea6['name']){delete _0x68bea6[_0x86bc('0x26')];}_0x3fb5ca[_0x86bc('0x16')](_0x310a21)[_0x86bc('0x27')](_0x68bea6);};}exports[_0x86bc('0x28')]=function(_0x58db33,_0x183c75){var _0xabe6f1={},_0x568e31={},_0x1a56fa={'count':0x0,'rows':[]};var _0x1b4d17=_[_0x86bc('0x29')](db['Dynamics365Field']['rawAttributes'],function(_0x2985f0){return{'name':_0x2985f0[_0x86bc('0x2a')],'type':_0x2985f0[_0x86bc('0x2b')][_0x86bc('0x2c')]};});_0x568e31[_0x86bc('0x2d')]=_['map'](_0x1b4d17,_0x86bc('0x26'));_0x568e31[_0x86bc('0x2e')]=_[_0x86bc('0x2f')](_0x58db33[_0x86bc('0x2e')]);_0x568e31[_0x86bc('0x30')]=_['intersection'](_0x568e31[_0x86bc('0x2d')],_0x568e31[_0x86bc('0x2e')]);_0xabe6f1[_0x86bc('0x31')]=_[_0x86bc('0x32')](_0x568e31[_0x86bc('0x2d')],qs['fields'](_0x58db33[_0x86bc('0x2e')]['fields']));_0xabe6f1[_0x86bc('0x31')]=_0xabe6f1['attributes'][_0x86bc('0x33')]?_0xabe6f1[_0x86bc('0x31')]:_0x568e31[_0x86bc('0x2d')];if(!_0x58db33[_0x86bc('0x2e')][_0x86bc('0x34')](_0x86bc('0x35'))){_0xabe6f1[_0x86bc('0x1a')]=qs[_0x86bc('0x1a')](_0x58db33[_0x86bc('0x2e')][_0x86bc('0x1a')]);_0xabe6f1[_0x86bc('0x18')]=qs['offset'](_0x58db33[_0x86bc('0x2e')][_0x86bc('0x18')]);}_0xabe6f1[_0x86bc('0x36')]=qs[_0x86bc('0x37')](_0x58db33[_0x86bc('0x2e')][_0x86bc('0x37')]);_0xabe6f1['where']=qs['filters'](_[_0x86bc('0x38')](_0x58db33['query'],_0x568e31[_0x86bc('0x30')]),_0x1b4d17);if(_0x58db33[_0x86bc('0x2e')][_0x86bc('0x39')]){_0xabe6f1[_0x86bc('0x3a')]=_[_0x86bc('0x3b')](_0xabe6f1[_0x86bc('0x3a')],{'$or':_['map'](_0x1b4d17,function(_0x194274){if(_0x194274['type']!==_0x86bc('0x3c')){var _0x27b749={};_0x27b749[_0x194274[_0x86bc('0x26')]]={'$like':'%'+_0x58db33[_0x86bc('0x2e')][_0x86bc('0x39')]+'%'};return _0x27b749;}})});}_0xabe6f1=_[_0x86bc('0x3b')]({},_0xabe6f1,_0x58db33[_0x86bc('0x3d')]);var _0x3f831a={'where':_0xabe6f1[_0x86bc('0x3a')]};return db[_0x86bc('0x3e')][_0x86bc('0x1b')](_0x3f831a)['then'](function(_0x6eaec9){_0x1a56fa[_0x86bc('0x1b')]=_0x6eaec9;if(_0x58db33[_0x86bc('0x2e')][_0x86bc('0x3f')]){_0xabe6f1[_0x86bc('0x40')]=[{'all':!![]}];}return db[_0x86bc('0x3e')][_0x86bc('0x41')](_0xabe6f1);})[_0x86bc('0x21')](function(_0x44ba7d){_0x1a56fa[_0x86bc('0x42')]=_0x44ba7d;return _0x1a56fa;})[_0x86bc('0x21')](respondWithFilteredResult(_0x183c75,_0xabe6f1))[_0x86bc('0x43')](handleError(_0x183c75,null));};exports[_0x86bc('0x44')]=function(_0x23abba,_0x6e9683){var _0x29ab82={'raw':!![],'where':{'id':_0x23abba['params']['id']}},_0x4a9df0={};_0x4a9df0[_0x86bc('0x2d')]=_[_0x86bc('0x2f')](db['Dynamics365Field'][_0x86bc('0x45')]);_0x4a9df0[_0x86bc('0x2e')]=_[_0x86bc('0x2f')](_0x23abba[_0x86bc('0x2e')]);_0x4a9df0[_0x86bc('0x30')]=_[_0x86bc('0x32')](_0x4a9df0[_0x86bc('0x2d')],_0x4a9df0[_0x86bc('0x2e')]);_0x29ab82[_0x86bc('0x31')]=_[_0x86bc('0x32')](_0x4a9df0[_0x86bc('0x2d')],qs['fields'](_0x23abba[_0x86bc('0x2e')][_0x86bc('0x46')]));_0x29ab82[_0x86bc('0x31')]=_0x29ab82['attributes'][_0x86bc('0x33')]?_0x29ab82[_0x86bc('0x31')]:_0x4a9df0[_0x86bc('0x2d')];if(_0x23abba[_0x86bc('0x2e')][_0x86bc('0x3f')]){_0x29ab82[_0x86bc('0x40')]=[{'all':!![]}];}_0x29ab82=_[_0x86bc('0x3b')]({},_0x29ab82,_0x23abba[_0x86bc('0x3d')]);return db[_0x86bc('0x3e')][_0x86bc('0x47')](_0x29ab82)['then'](handleEntityNotFound(_0x6e9683,null))['then'](respondWithResult(_0x6e9683,null))[_0x86bc('0x43')](handleError(_0x6e9683,null));};exports[_0x86bc('0x48')]=function(_0x47af78,_0xd12915){return db['Dynamics365Field'][_0x86bc('0x48')](_0x47af78[_0x86bc('0x49')],{})[_0x86bc('0x21')](respondWithResult(_0xd12915,0xc9))[_0x86bc('0x43')](handleError(_0xd12915,null));};exports['update']=function(_0x13c23c,_0x1a29e9){if(_0x13c23c[_0x86bc('0x49')]['id']){delete _0x13c23c[_0x86bc('0x49')]['id'];}return db[_0x86bc('0x3e')][_0x86bc('0x47')]({'where':{'id':_0x13c23c[_0x86bc('0x4a')]['id']}})[_0x86bc('0x21')](handleEntityNotFound(_0x1a29e9,null))['then'](saveUpdates(_0x13c23c[_0x86bc('0x49')],null))['then'](respondWithResult(_0x1a29e9,null))[_0x86bc('0x43')](handleError(_0x1a29e9,null));};exports[_0x86bc('0x22')]=function(_0x544dbd,_0xec14b7){return db[_0x86bc('0x3e')][_0x86bc('0x47')]({'where':{'id':_0x544dbd[_0x86bc('0x4a')]['id']}})[_0x86bc('0x21')](handleEntityNotFound(_0xec14b7,null))['then'](removeEntity(_0xec14b7,null))[_0x86bc('0x43')](handleError(_0xec14b7,null));}; \ No newline at end of file +var _0xbabf=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','map','fieldName','type','model','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','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(_0x4c4a8b,_0x402020){var _0x20fa14=function(_0xbe8c84){while(--_0xbe8c84){_0x4c4a8b['push'](_0x4c4a8b['shift']());}};_0x20fa14(++_0x402020);}(_0xbabf,0x170));var _0xfbab=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xbabf[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0xfbab('0x0'));var rimraf=require(_0xfbab('0x1'));var zipdir=require(_0xfbab('0x2'));var jsonpatch=require(_0xfbab('0x3'));var rp=require(_0xfbab('0x4'));var moment=require(_0xfbab('0x5'));var BPromise=require(_0xfbab('0x6'));var Mustache=require(_0xfbab('0x7'));var util=require('util');var path=require(_0xfbab('0x8'));var sox=require(_0xfbab('0x9'));var csv=require(_0xfbab('0xa'));var ejs=require(_0xfbab('0xb'));var fs=require('fs');var fs_extra=require(_0xfbab('0xc'));var _=require(_0xfbab('0xd'));var squel=require(_0xfbab('0xe'));var crypto=require(_0xfbab('0xf'));var jsforce=require(_0xfbab('0x10'));var deskjs=require(_0xfbab('0x11'));var toCsv=require(_0xfbab('0xa'));var querystring=require('querystring');var Papa=require(_0xfbab('0x12'));var Redis=require(_0xfbab('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbab('0x14'));var hardwareService=require(_0xfbab('0x15'));var logger=require(_0xfbab('0x16'))(_0xfbab('0x17'));var utils=require(_0xfbab('0x18'));var config=require(_0xfbab('0x19'));var licenseUtil=require(_0xfbab('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42beb4,_0x59ba55){_0x59ba55=_0x59ba55||0xcc;return function(_0x309326){if(_0x309326){return _0x42beb4[_0xfbab('0x1b')](_0x59ba55);}return _0x42beb4['status'](_0x59ba55)[_0xfbab('0x1c')]();};}function respondWithResult(_0x59cbd2,_0x5f38e8){_0x5f38e8=_0x5f38e8||0xc8;return function(_0x4e09a4){if(_0x4e09a4){return _0x59cbd2[_0xfbab('0x1d')](_0x5f38e8)['json'](_0x4e09a4);}};}function respondWithFilteredResult(_0x36af27,_0x5d61b4){return function(_0x2c255a){if(_0x2c255a){var _0x254d06=typeof _0x5d61b4[_0xfbab('0x1e')]===_0xfbab('0x1f')&&typeof _0x5d61b4['limit']==='undefined';var _0x3ae129=_0x2c255a['count'];var _0xb137ff=_0x254d06?0x0:_0x5d61b4[_0xfbab('0x1e')];var _0x56d0ab=_0x254d06?_0x2c255a[_0xfbab('0x20')]:_0x5d61b4[_0xfbab('0x1e')]+_0x5d61b4[_0xfbab('0x21')];var _0xb31221;if(_0x56d0ab>=_0x3ae129){_0x56d0ab=_0x3ae129;_0xb31221=0xc8;}else{_0xb31221=0xce;}_0x36af27[_0xfbab('0x1d')](_0xb31221);return _0x36af27[_0xfbab('0x22')](_0xfbab('0x23'),_0xb137ff+'-'+_0x56d0ab+'/'+_0x3ae129)[_0xfbab('0x24')](_0x2c255a);}return null;};}function patchUpdates(_0x26b81f){return function(_0x31e8d7){try{jsonpatch[_0xfbab('0x25')](_0x31e8d7,_0x26b81f,!![]);}catch(_0x15c740){return BPromise[_0xfbab('0x26')](_0x15c740);}return _0x31e8d7[_0xfbab('0x27')]();};}function saveUpdates(_0x17fe94,_0x1d314c){return function(_0x46da60){if(_0x46da60){return _0x46da60[_0xfbab('0x28')](_0x17fe94)[_0xfbab('0x29')](function(_0x4fd052){return _0x4fd052;});}return null;};}function removeEntity(_0x2ff5a3,_0x3754ea){return function(_0xf011b8){if(_0xf011b8){return _0xf011b8[_0xfbab('0x2a')]()[_0xfbab('0x29')](function(){_0x2ff5a3[_0xfbab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37034a,_0x1abdda){return function(_0x29c3ae){if(!_0x29c3ae){_0x37034a[_0xfbab('0x1b')](0x194);}return _0x29c3ae;};}function handleError(_0x2384c5,_0x38d357){_0x38d357=_0x38d357||0x1f4;return function(_0x20e712){logger['error'](_0x20e712[_0xfbab('0x2b')]);if(_0x20e712[_0xfbab('0x2c')]){delete _0x20e712['name'];}_0x2384c5[_0xfbab('0x1d')](_0x38d357)['send'](_0x20e712);};}exports[_0xfbab('0x2d')]=function(_0x3ac6fa,_0x254dc7){var _0x133d78={},_0x1a619c={},_0x1a87ee={'count':0x0,'rows':[]};var _0x1f7b91=_[_0xfbab('0x2e')](db['Dynamics365Field']['rawAttributes'],function(_0x459fad){return{'name':_0x459fad[_0xfbab('0x2f')],'type':_0x459fad[_0xfbab('0x30')]['key']};});_0x1a619c[_0xfbab('0x31')]=_[_0xfbab('0x2e')](_0x1f7b91,_0xfbab('0x2c'));_0x1a619c['query']=_['keys'](_0x3ac6fa['query']);_0x1a619c[_0xfbab('0x32')]=_[_0xfbab('0x33')](_0x1a619c['model'],_0x1a619c[_0xfbab('0x34')]);_0x133d78['attributes']=_[_0xfbab('0x33')](_0x1a619c['model'],qs['fields'](_0x3ac6fa[_0xfbab('0x34')][_0xfbab('0x35')]));_0x133d78[_0xfbab('0x36')]=_0x133d78[_0xfbab('0x36')][_0xfbab('0x37')]?_0x133d78[_0xfbab('0x36')]:_0x1a619c[_0xfbab('0x31')];if(!_0x3ac6fa[_0xfbab('0x34')]['hasOwnProperty'](_0xfbab('0x38'))){_0x133d78[_0xfbab('0x21')]=qs[_0xfbab('0x21')](_0x3ac6fa[_0xfbab('0x34')]['limit']);_0x133d78[_0xfbab('0x1e')]=qs['offset'](_0x3ac6fa[_0xfbab('0x34')]['offset']);}_0x133d78[_0xfbab('0x39')]=qs['sort'](_0x3ac6fa[_0xfbab('0x34')][_0xfbab('0x3a')]);_0x133d78[_0xfbab('0x3b')]=qs['filters'](_[_0xfbab('0x3c')](_0x3ac6fa[_0xfbab('0x34')],_0x1a619c['filters']),_0x1f7b91);if(_0x3ac6fa[_0xfbab('0x34')][_0xfbab('0x3d')]){_0x133d78[_0xfbab('0x3b')]=_['merge'](_0x133d78['where'],{'$or':_[_0xfbab('0x2e')](_0x1f7b91,function(_0x3de7f3){if(_0x3de7f3[_0xfbab('0x30')]!==_0xfbab('0x3e')){var _0x2ed4c8={};_0x2ed4c8[_0x3de7f3[_0xfbab('0x2c')]]={'$like':'%'+_0x3ac6fa[_0xfbab('0x34')]['filter']+'%'};return _0x2ed4c8;}})});}_0x133d78=_[_0xfbab('0x3f')]({},_0x133d78,_0x3ac6fa['options']);var _0x568e62={'where':_0x133d78['where']};return db[_0xfbab('0x40')]['count'](_0x568e62)[_0xfbab('0x29')](function(_0x1ffd41){_0x1a87ee[_0xfbab('0x20')]=_0x1ffd41;if(_0x3ac6fa['query'][_0xfbab('0x41')]){_0x133d78[_0xfbab('0x42')]=[{'all':!![]}];}return db[_0xfbab('0x40')][_0xfbab('0x43')](_0x133d78);})[_0xfbab('0x29')](function(_0x142446){_0x1a87ee[_0xfbab('0x44')]=_0x142446;return _0x1a87ee;})['then'](respondWithFilteredResult(_0x254dc7,_0x133d78))[_0xfbab('0x45')](handleError(_0x254dc7,null));};exports[_0xfbab('0x46')]=function(_0x2a8e61,_0x667278){var _0x30ae6a={'raw':!![],'where':{'id':_0x2a8e61[_0xfbab('0x47')]['id']}},_0x1a208a={};_0x1a208a['model']=_[_0xfbab('0x48')](db['Dynamics365Field'][_0xfbab('0x49')]);_0x1a208a[_0xfbab('0x34')]=_[_0xfbab('0x48')](_0x2a8e61[_0xfbab('0x34')]);_0x1a208a[_0xfbab('0x32')]=_[_0xfbab('0x33')](_0x1a208a[_0xfbab('0x31')],_0x1a208a[_0xfbab('0x34')]);_0x30ae6a[_0xfbab('0x36')]=_[_0xfbab('0x33')](_0x1a208a['model'],qs[_0xfbab('0x35')](_0x2a8e61[_0xfbab('0x34')][_0xfbab('0x35')]));_0x30ae6a[_0xfbab('0x36')]=_0x30ae6a[_0xfbab('0x36')]['length']?_0x30ae6a[_0xfbab('0x36')]:_0x1a208a[_0xfbab('0x31')];if(_0x2a8e61[_0xfbab('0x34')][_0xfbab('0x41')]){_0x30ae6a['include']=[{'all':!![]}];}_0x30ae6a=_[_0xfbab('0x3f')]({},_0x30ae6a,_0x2a8e61['options']);return db[_0xfbab('0x40')][_0xfbab('0x4a')](_0x30ae6a)[_0xfbab('0x29')](handleEntityNotFound(_0x667278,null))[_0xfbab('0x29')](respondWithResult(_0x667278,null))[_0xfbab('0x45')](handleError(_0x667278,null));};exports['create']=function(_0x5b78fb,_0x3a1b9a){return db[_0xfbab('0x40')][_0xfbab('0x4b')](_0x5b78fb[_0xfbab('0x4c')],{})[_0xfbab('0x29')](respondWithResult(_0x3a1b9a,0xc9))[_0xfbab('0x45')](handleError(_0x3a1b9a,null));};exports[_0xfbab('0x28')]=function(_0x119a48,_0x4fd647){if(_0x119a48[_0xfbab('0x4c')]['id']){delete _0x119a48['body']['id'];}return db[_0xfbab('0x40')][_0xfbab('0x4a')]({'where':{'id':_0x119a48['params']['id']}})[_0xfbab('0x29')](handleEntityNotFound(_0x4fd647,null))[_0xfbab('0x29')](saveUpdates(_0x119a48[_0xfbab('0x4c')],null))[_0xfbab('0x29')](respondWithResult(_0x4fd647,null))[_0xfbab('0x45')](handleError(_0x4fd647,null));};exports[_0xfbab('0x2a')]=function(_0x55508e,_0x3f2fd5){return db[_0xfbab('0x40')][_0xfbab('0x4a')]({'where':{'id':_0x55508e[_0xfbab('0x47')]['id']}})[_0xfbab('0x29')](handleEntityNotFound(_0x3f2fd5,null))[_0xfbab('0x29')](removeEntity(_0x3f2fd5,null))[_0xfbab('0x45')](handleError(_0x3f2fd5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index e7193e0..c43ed51 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 _0xba8b=['dynamics365_unique_index','idField','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xba8b,0xaa));var _0xbba8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xba8b[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xbba8('0x0'));var logger=require(_0xbba8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbba8('0x2'));var rp=require(_0xbba8('0x3'));var fs=require('fs');var path=require(_0xbba8('0x4'));var rimraf=require('rimraf');var config=require(_0xbba8('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0xbba8('0x6')]=function(_0x5bdfd9,_0x3ffa53){return _0x5bdfd9[_0xbba8('0x7')](_0xbba8('0x8'),attributes,{'tableName':_0xbba8('0x9'),'paranoid':![],'indexes':[{'name':_0xbba8('0xa'),'fields':[_0xbba8('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x760b=['define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x270120,_0x1c8bcb){var _0xcf7744=function(_0x4c26c8){while(--_0x4c26c8){_0x270120['push'](_0x270120['shift']());}};_0xcf7744(++_0x1c8bcb);}(_0x760b,0x17c));var _0xb760=function(_0xff3c91,_0x512eac){_0xff3c91=_0xff3c91-0x0;var _0x1b9e5e=_0x760b[_0xff3c91];return _0x1b9e5e;};'use strict';var _=require('lodash');var util=require(_0xb760('0x0'));var logger=require(_0xb760('0x1'))(_0xb760('0x2'));var moment=require(_0xb760('0x3'));var BPromise=require('bluebird');var rp=require(_0xb760('0x4'));var fs=require('fs');var path=require(_0xb760('0x5'));var rimraf=require(_0xb760('0x6'));var config=require(_0xb760('0x7'));var attributes=require(_0xb760('0x8'));module[_0xb760('0x9')]=function(_0x4ac2e8,_0x50c532){return _0x4ac2e8[_0xb760('0xa')]('Dynamics365Field',attributes,{'tableName':_0xb760('0xb'),'paranoid':![],'indexes':[{'name':_0xb760('0xc'),'fields':[_0xb760('0xd'),_0xb760('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index d6f606a..5f2354e 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 _0xd821=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x58516d,_0x227aef){var _0x2c4b29=function(_0x3647dd){while(--_0x3647dd){_0x58516d['push'](_0x58516d['shift']());}};_0x2c4b29(++_0x227aef);}(_0xd821,0x10d));var _0x1d82=function(_0x1eb602,_0x9ad735){_0x1eb602=_0x1eb602-0x0;var _0x222311=_0xd821[_0x1eb602];return _0x222311;};'use strict';var _=require(_0x1d82('0x0'));var util=require(_0x1d82('0x1'));var moment=require(_0x1d82('0x2'));var BPromise=require(_0x1d82('0x3'));var rs=require(_0x1d82('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d82('0x6'))(_0x1d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x396590,_0x4a40f6,_0xf1993){return new BPromise(function(_0x547980,_0x3eb971){return client[_0x1d82('0x9')](_0x396590,_0xf1993)[_0x1d82('0xa')](function(_0x90ff6c){logger[_0x1d82('0xb')](_0x1d82('0xc'),_0x4a40f6,'request\x20sent');logger[_0x1d82('0xd')](_0x1d82('0xe'),_0x4a40f6,_0x1d82('0xf'),JSON[_0x1d82('0x10')](_0x90ff6c));if(_0x90ff6c[_0x1d82('0x11')]){if(_0x90ff6c[_0x1d82('0x11')][_0x1d82('0x12')]===0x1f4){logger[_0x1d82('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x4a40f6,_0x90ff6c[_0x1d82('0x11')][_0x1d82('0x13')]);return _0x3eb971(_0x90ff6c[_0x1d82('0x11')][_0x1d82('0x13')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x4a40f6,_0x90ff6c[_0x1d82('0x11')][_0x1d82('0x13')]);return _0x547980(_0x90ff6c[_0x1d82('0x11')][_0x1d82('0x13')]);}else{logger[_0x1d82('0xb')](_0x1d82('0xc'),_0x4a40f6,_0x1d82('0xf'));_0x547980(_0x90ff6c[_0x1d82('0x14')][_0x1d82('0x13')]);}})[_0x1d82('0x15')](function(_0x741fa6){logger[_0x1d82('0x11')](_0x1d82('0xc'),_0x4a40f6,_0x741fa6);_0x3eb971(_0x741fa6);});});} \ No newline at end of file +var _0xb82a=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x38f015,_0x227f7d){var _0x2889fa=function(_0x3e5fe2){while(--_0x3e5fe2){_0x38f015['push'](_0x38f015['shift']());}};_0x2889fa(++_0x227f7d);}(_0xb82a,0xe1));var _0xab82=function(_0x2d5a53,_0x52e809){_0x2d5a53=_0x2d5a53-0x0;var _0x1b5d56=_0xb82a[_0x2d5a53];return _0x1b5d56;};'use strict';var _=require(_0xab82('0x0'));var util=require(_0xab82('0x1'));var moment=require(_0xab82('0x2'));var BPromise=require('bluebird');var rs=require(_0xab82('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab82('0x4'));var logger=require(_0xab82('0x5'))(_0xab82('0x6'));var config=require('../../config/environment');var jayson=require(_0xab82('0x7'));var client=jayson[_0xab82('0x8')][_0xab82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4babfb,_0x140e85,_0x5b6eb7){return new BPromise(function(_0x241870,_0x39e7c7){return client['request'](_0x4babfb,_0x5b6eb7)['then'](function(_0x5bb30e){logger[_0xab82('0xa')](_0xab82('0xb'),_0x140e85,_0xab82('0xc'));logger['debug'](_0xab82('0xd'),_0x140e85,_0xab82('0xc'),JSON[_0xab82('0xe')](_0x5bb30e));if(_0x5bb30e[_0xab82('0xf')]){if(_0x5bb30e[_0xab82('0xf')]['code']===0x1f4){logger[_0xab82('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x140e85,_0x5bb30e[_0xab82('0xf')][_0xab82('0x10')]);return _0x39e7c7(_0x5bb30e[_0xab82('0xf')][_0xab82('0x10')]);}logger[_0xab82('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x140e85,_0x5bb30e[_0xab82('0xf')][_0xab82('0x10')]);return _0x241870(_0x5bb30e[_0xab82('0xf')][_0xab82('0x10')]);}else{logger[_0xab82('0xa')](_0xab82('0xb'),_0x140e85,_0xab82('0xc'));_0x241870(_0x5bb30e[_0xab82('0x11')][_0xab82('0x10')]);}})[_0xab82('0x12')](function(_0x31377a){logger['error'](_0xab82('0xb'),_0x140e85,_0x31377a);_0x39e7c7(_0x31377a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8cf0793..e1c8a88 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 _0xec1a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','exports','util','path'];(function(_0x41d09f,_0x46fd23){var _0x50a8e0=function(_0x5dfe10){while(--_0x5dfe10){_0x41d09f['push'](_0x41d09f['shift']());}};_0x50a8e0(++_0x46fd23);}(_0xec1a,0xa9));var _0xaec1=function(_0x1f0611,_0x8ef37a){_0x1f0611=_0x1f0611-0x0;var _0x4a42bc=_0xec1a[_0x1f0611];return _0x4a42bc;};'use strict';var multer=require('multer');var util=require(_0xaec1('0x0'));var path=require(_0xaec1('0x1'));var timeout=require('connect-timeout');var express=require(_0xaec1('0x2'));var router=express['Router']();var fs_extra=require(_0xaec1('0x3'));var auth=require(_0xaec1('0x4'));var interaction=require(_0xaec1('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0xaec1('0x6')](),controller[_0xaec1('0x7')]);router[_0xaec1('0x8')](_0xaec1('0x9'),auth['isAuthenticated'](),controller[_0xaec1('0xa')]);router[_0xaec1('0x8')](_0xaec1('0xb'),auth[_0xaec1('0x6')](),controller[_0xaec1('0xc')]);router['get'](_0xaec1('0xd'),auth[_0xaec1('0x6')](),controller['getFields']);router[_0xaec1('0xe')]('/',auth[_0xaec1('0x6')](),controller['create']);router['post'](_0xaec1('0xb'),auth[_0xaec1('0x6')](),controller[_0xaec1('0xf')]);router[_0xaec1('0x10')]('/:id',auth[_0xaec1('0x6')](),controller[_0xaec1('0x11')]);router['delete'](_0xaec1('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xaec1('0x12')]=router; \ No newline at end of file +var _0xa0d3=['get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0xd4fef9,_0xd847a9){var _0x5314c4=function(_0x2d5155){while(--_0x2d5155){_0xd4fef9['push'](_0xd4fef9['shift']());}};_0x5314c4(++_0xd847a9);}(_0xa0d3,0x16e));var _0x3a0d=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xa0d3[_0x55d8c5];return _0x225ae5;};'use strict';var multer=require(_0x3a0d('0x0'));var util=require(_0x3a0d('0x1'));var path=require(_0x3a0d('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a0d('0x3'));var router=express['Router']();var fs_extra=require(_0x3a0d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3a0d('0x5'));var config=require(_0x3a0d('0x6'));var controller=require(_0x3a0d('0x7'));router[_0x3a0d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3a0d('0x8')]('/:id',auth[_0x3a0d('0x9')](),controller[_0x3a0d('0xa')]);router[_0x3a0d('0x8')](_0x3a0d('0xb'),auth[_0x3a0d('0x9')](),controller[_0x3a0d('0xc')]);router[_0x3a0d('0x8')]('/:id/fields',auth[_0x3a0d('0x9')](),controller[_0x3a0d('0xd')]);router[_0x3a0d('0xe')]('/',auth['isAuthenticated'](),controller[_0x3a0d('0xf')]);router[_0x3a0d('0xe')](_0x3a0d('0xb'),auth[_0x3a0d('0x9')](),controller['addConfiguration']);router[_0x3a0d('0x10')](_0x3a0d('0x11'),auth['isAuthenticated'](),controller[_0x3a0d('0x12')]);router[_0x3a0d('0x13')](_0x3a0d('0x11'),auth[_0x3a0d('0x9')](),controller[_0x3a0d('0x14')]);module[_0x3a0d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index dd0e06a..3f62d87 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 _0xda2d=['exports','STRING','username'];(function(_0x5b90d1,_0x2a9706){var _0x273f02=function(_0x86d2ed){while(--_0x86d2ed){_0x5b90d1['push'](_0x5b90d1['shift']());}};_0x273f02(++_0x2a9706);}(_0xda2d,0x102));var _0xdda2=function(_0x856c6e,_0x35d850){_0x856c6e=_0x856c6e-0x0;var _0x41086b=_0xda2d[_0x856c6e];return _0x41086b;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4888=['exports','STRING','username'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4888,0x198));var _0x8488=function(_0x557f77,_0x2ff13f){_0x557f77=_0x557f77-0x0;var _0x166ce5=_0x4888[_0x557f77];return _0x166ce5;};'use strict';var Sequelize=require('sequelize');module[_0x8488('0x0')]={'name':{'type':Sequelize[_0x8488('0x1')]},'description':{'type':Sequelize[_0x8488('0x1')]},'username':{'type':Sequelize[_0x8488('0x1')],'unique':_0x8488('0x2')},'apiKey':{'type':Sequelize[_0x8488('0x1')]},'remoteUri':{'type':Sequelize[_0x8488('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x8488('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 7a83116..f5a2f6b 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 _0x1707=['priority','group','source','ticket_type','company','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','FreshdeskAccount','rawAttributes','fieldName','key','map','keys','query','filters','model','fields','attributes','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','intersection','length','find','create','body','catch','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','toString','base64','requester','subject','description'];(function(_0x19b4f9,_0x31beba){var _0x1d830a=function(_0x30c2a1){while(--_0x30c2a1){_0x19b4f9['push'](_0x19b4f9['shift']());}};_0x1d830a(++_0x31beba);}(_0x1707,0x1df));var _0x7170=function(_0x11a835,_0x2ea08e){_0x11a835=_0x11a835-0x0;var _0x44b14f=_0x1707[_0x11a835];return _0x44b14f;};'use strict';var emlformat=require(_0x7170('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7170('0x1'));var moment=require(_0x7170('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7170('0x3'));var util=require(_0x7170('0x4'));var path=require(_0x7170('0x5'));var sox=require(_0x7170('0x6'));var csv=require(_0x7170('0x7'));var ejs=require(_0x7170('0x8'));var fs=require('fs');var fs_extra=require(_0x7170('0x9'));var _=require(_0x7170('0xa'));var squel=require(_0x7170('0xb'));var crypto=require(_0x7170('0xc'));var jsforce=require(_0x7170('0xd'));var deskjs=require(_0x7170('0xe'));var toCsv=require(_0x7170('0x7'));var querystring=require(_0x7170('0xf'));var Papa=require(_0x7170('0x10'));var Redis=require(_0x7170('0x11'));var authService=require(_0x7170('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7170('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7170('0x14'))(_0x7170('0x15'));var utils=require(_0x7170('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7170('0x17'));function respondWithStatusCode(_0x3193c7,_0x58c1ec){_0x58c1ec=_0x58c1ec||0xcc;return function(_0x42911e){if(_0x42911e){return _0x3193c7[_0x7170('0x18')](_0x58c1ec);}return _0x3193c7[_0x7170('0x19')](_0x58c1ec)[_0x7170('0x1a')]();};}function respondWithResult(_0x369b9e,_0x418282){_0x418282=_0x418282||0xc8;return function(_0x4f3b70){if(_0x4f3b70){return _0x369b9e['status'](_0x418282)[_0x7170('0x1b')](_0x4f3b70);}};}function respondWithFilteredResult(_0x599aa8,_0x31ffb6){return function(_0xabf79a){if(_0xabf79a){var _0x578f10=typeof _0x31ffb6[_0x7170('0x1c')]==='undefined'&&typeof _0x31ffb6[_0x7170('0x1d')]===_0x7170('0x1e');var _0x4f6ab5=_0xabf79a[_0x7170('0x1f')];var _0x58f2dc=_0x578f10?0x0:_0x31ffb6[_0x7170('0x1c')];var _0x2cf7da=_0x578f10?_0xabf79a['count']:_0x31ffb6[_0x7170('0x1c')]+_0x31ffb6['limit'];var _0x58e2ef;if(_0x2cf7da>=_0x4f6ab5){_0x2cf7da=_0x4f6ab5;_0x58e2ef=0xc8;}else{_0x58e2ef=0xce;}_0x599aa8[_0x7170('0x19')](_0x58e2ef);return _0x599aa8[_0x7170('0x20')](_0x7170('0x21'),_0x58f2dc+'-'+_0x2cf7da+'/'+_0x4f6ab5)[_0x7170('0x1b')](_0xabf79a);}return null;};}function patchUpdates(_0x126d87){return function(_0x32b51a){try{jsonpatch[_0x7170('0x22')](_0x32b51a,_0x126d87,!![]);}catch(_0x57b3ae){return BPromise[_0x7170('0x23')](_0x57b3ae);}return _0x32b51a[_0x7170('0x24')]();};}function saveUpdates(_0x25e86e,_0x1fa020){return function(_0x25b033){if(_0x25b033){return _0x25b033[_0x7170('0x25')](_0x25e86e)[_0x7170('0x26')](function(_0x474d30){return _0x474d30;});}return null;};}function removeEntity(_0x598fe3,_0x1539b4){return function(_0xfa8e3){if(_0xfa8e3){return _0xfa8e3[_0x7170('0x27')]()[_0x7170('0x26')](function(){_0x598fe3[_0x7170('0x19')](0xcc)[_0x7170('0x1a')]();});}};}function handleEntityNotFound(_0x1af07f,_0x31c3cb){return function(_0x256991){if(!_0x256991){_0x1af07f['sendStatus'](0x194);}return _0x256991;};}function handleError(_0x38aadf,_0x57977b){_0x57977b=_0x57977b||0x1f4;return function(_0x2f6c1c){logger[_0x7170('0x28')](_0x2f6c1c['stack']);if(_0x2f6c1c['name']){delete _0x2f6c1c[_0x7170('0x29')];}_0x38aadf[_0x7170('0x19')](_0x57977b)[_0x7170('0x2a')](_0x2f6c1c);};}exports['index']=function(_0x382c9f,_0x2a5c45){var _0x126985={},_0x533f40={},_0xb0d003={'count':0x0,'rows':[]};var _0x515b12=_['map'](db[_0x7170('0x2b')][_0x7170('0x2c')],function(_0x39861a){return{'name':_0x39861a[_0x7170('0x2d')],'type':_0x39861a['type'][_0x7170('0x2e')]};});_0x533f40['model']=_[_0x7170('0x2f')](_0x515b12,_0x7170('0x29'));_0x533f40['query']=_[_0x7170('0x30')](_0x382c9f[_0x7170('0x31')]);_0x533f40[_0x7170('0x32')]=_['intersection'](_0x533f40['model'],_0x533f40[_0x7170('0x31')]);_0x126985['attributes']=_['intersection'](_0x533f40[_0x7170('0x33')],qs[_0x7170('0x34')](_0x382c9f['query'][_0x7170('0x34')]));_0x126985['attributes']=_0x126985[_0x7170('0x35')]['length']?_0x126985[_0x7170('0x35')]:_0x533f40['model'];if(!_0x382c9f[_0x7170('0x31')]['hasOwnProperty'](_0x7170('0x36'))){_0x126985[_0x7170('0x1d')]=qs[_0x7170('0x1d')](_0x382c9f[_0x7170('0x31')][_0x7170('0x1d')]);_0x126985[_0x7170('0x1c')]=qs[_0x7170('0x1c')](_0x382c9f['query'][_0x7170('0x1c')]);}_0x126985[_0x7170('0x37')]=qs['sort'](_0x382c9f[_0x7170('0x31')][_0x7170('0x38')]);_0x126985['where']=qs[_0x7170('0x32')](_[_0x7170('0x39')](_0x382c9f[_0x7170('0x31')],_0x533f40[_0x7170('0x32')]),_0x515b12);if(_0x382c9f[_0x7170('0x31')][_0x7170('0x3a')]){_0x126985[_0x7170('0x3b')]=_['merge'](_0x126985[_0x7170('0x3b')],{'$or':_[_0x7170('0x2f')](_0x515b12,function(_0x4b8a26){if(_0x4b8a26[_0x7170('0x3c')]!==_0x7170('0x3d')){var _0x35ae24={};_0x35ae24[_0x4b8a26[_0x7170('0x29')]]={'$like':'%'+_0x382c9f[_0x7170('0x31')][_0x7170('0x3a')]+'%'};return _0x35ae24;}})});}_0x126985=_[_0x7170('0x3e')]({},_0x126985,_0x382c9f[_0x7170('0x3f')]);var _0x385e2e={'where':_0x126985[_0x7170('0x3b')]};return db[_0x7170('0x2b')][_0x7170('0x1f')](_0x385e2e)[_0x7170('0x26')](function(_0x48c7f3){_0xb0d003[_0x7170('0x1f')]=_0x48c7f3;if(_0x382c9f['query'][_0x7170('0x40')]){_0x126985['include']=[{'all':!![]}];}return db[_0x7170('0x2b')][_0x7170('0x41')](_0x126985);})[_0x7170('0x26')](function(_0x293ba5){_0xb0d003[_0x7170('0x42')]=_0x293ba5;return _0xb0d003;})[_0x7170('0x26')](respondWithFilteredResult(_0x2a5c45,_0x126985))['catch'](handleError(_0x2a5c45,null));};exports[_0x7170('0x43')]=function(_0x2086b1,_0xcaa498){var _0x404bdd={'raw':![],'where':{'id':_0x2086b1[_0x7170('0x44')]['id']}},_0xc16b7={};_0xc16b7['model']=_[_0x7170('0x30')](db[_0x7170('0x2b')][_0x7170('0x2c')]);_0xc16b7[_0x7170('0x31')]=_['keys'](_0x2086b1[_0x7170('0x31')]);_0xc16b7[_0x7170('0x32')]=_[_0x7170('0x45')](_0xc16b7['model'],_0xc16b7[_0x7170('0x31')]);_0x404bdd[_0x7170('0x35')]=_[_0x7170('0x45')](_0xc16b7[_0x7170('0x33')],qs['fields'](_0x2086b1[_0x7170('0x31')]['fields']));_0x404bdd['attributes']=_0x404bdd['attributes'][_0x7170('0x46')]?_0x404bdd['attributes']:_0xc16b7[_0x7170('0x33')];if(_0x2086b1[_0x7170('0x31')][_0x7170('0x40')]){_0x404bdd['include']=[{'all':!![]}];}_0x404bdd=_[_0x7170('0x3e')]({},_0x404bdd,_0x2086b1['options']);return db[_0x7170('0x2b')][_0x7170('0x47')](_0x404bdd)[_0x7170('0x26')](handleEntityNotFound(_0xcaa498,null))[_0x7170('0x26')](respondWithResult(_0xcaa498,null))['catch'](handleError(_0xcaa498,null));};exports[_0x7170('0x48')]=function(_0x27d103,_0x495105){return db[_0x7170('0x2b')][_0x7170('0x48')](_0x27d103[_0x7170('0x49')],{})[_0x7170('0x26')](respondWithResult(_0x495105,0xc9))[_0x7170('0x4a')](handleError(_0x495105,null));};exports[_0x7170('0x25')]=function(_0x33b41f,_0x56674b){if(_0x33b41f[_0x7170('0x49')]['id']){delete _0x33b41f[_0x7170('0x49')]['id'];}return db[_0x7170('0x2b')][_0x7170('0x47')]({'where':{'id':_0x33b41f[_0x7170('0x44')]['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x56674b,null))[_0x7170('0x26')](saveUpdates(_0x33b41f['body'],null))[_0x7170('0x26')](respondWithResult(_0x56674b,null))[_0x7170('0x4a')](handleError(_0x56674b,null));};exports[_0x7170('0x27')]=function(_0x4e84ed,_0x1be3b1){return db[_0x7170('0x2b')][_0x7170('0x47')]({'where':{'id':_0x4e84ed[_0x7170('0x44')]['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x1be3b1,null))[_0x7170('0x26')](removeEntity(_0x1be3b1,null))[_0x7170('0x4a')](handleError(_0x1be3b1,null));};exports[_0x7170('0x4b')]=function(_0x125083,_0x595890,_0x4dec37){var _0x3f5f3b={};var _0x2b5b8b={};var _0x9b4c2;var _0x20acb8;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x125083[_0x7170('0x44')]['id']}})['then'](handleEntityNotFound(_0x595890,null))[_0x7170('0x26')](function(_0x1964d8){if(_0x1964d8){_0x9b4c2=_0x1964d8;_0x2b5b8b['model']=_[_0x7170('0x30')](db[_0x7170('0x4c')][_0x7170('0x2c')]);_0x2b5b8b[_0x7170('0x31')]=_[_0x7170('0x30')](_0x125083[_0x7170('0x31')]);_0x2b5b8b[_0x7170('0x32')]=_[_0x7170('0x45')](_0x2b5b8b[_0x7170('0x33')],_0x2b5b8b[_0x7170('0x31')]);_0x3f5f3b['attributes']=_[_0x7170('0x45')](_0x2b5b8b[_0x7170('0x33')],qs[_0x7170('0x34')](_0x125083[_0x7170('0x31')][_0x7170('0x34')]));_0x3f5f3b[_0x7170('0x35')]=_0x3f5f3b['attributes'][_0x7170('0x46')]?_0x3f5f3b[_0x7170('0x35')]:_0x2b5b8b[_0x7170('0x33')];_0x3f5f3b['order']=qs[_0x7170('0x38')](_0x125083['query']['sort']);_0x3f5f3b[_0x7170('0x3b')]=qs[_0x7170('0x32')](_[_0x7170('0x39')](_0x125083[_0x7170('0x31')],_0x2b5b8b[_0x7170('0x32')]));if(_0x125083[_0x7170('0x31')][_0x7170('0x3a')]){_0x3f5f3b[_0x7170('0x3b')]=_['merge'](_0x3f5f3b[_0x7170('0x3b')],{'$or':_[_0x7170('0x2f')](_0x3f5f3b['attributes'],function(_0x520981){var _0x4f389b={};_0x4f389b[_0x520981]={'$like':'%'+_0x125083[_0x7170('0x31')][_0x7170('0x3a')]+'%'};return _0x4f389b;})});}_0x3f5f3b=_[_0x7170('0x3e')]({},_0x3f5f3b,_0x125083[_0x7170('0x3f')]);return _0x9b4c2[_0x7170('0x4b')](_0x3f5f3b);}})[_0x7170('0x26')](function(_0x12855b){if(_0x12855b){_0x20acb8=_0x12855b['length'];if(!_0x125083[_0x7170('0x31')][_0x7170('0x4d')](_0x7170('0x36'))){_0x3f5f3b[_0x7170('0x1d')]=qs['limit'](_0x125083[_0x7170('0x31')][_0x7170('0x1d')]);_0x3f5f3b['offset']=qs[_0x7170('0x1c')](_0x125083[_0x7170('0x31')][_0x7170('0x1c')]);}return _0x9b4c2[_0x7170('0x4b')](_0x3f5f3b);}})['then'](function(_0x11de38){if(_0x11de38){return _0x11de38?{'count':_0x20acb8,'rows':_0x11de38}:null;}})[_0x7170('0x26')](respondWithResult(_0x595890,null))['catch'](handleError(_0x595890,null));};exports[_0x7170('0x4e')]=function(_0x2162d3,_0x397250,_0x55f5f2){if(_0x2162d3[_0x7170('0x49')]['id']){delete _0x2162d3[_0x7170('0x49')]['id'];}return db[_0x7170('0x2b')][_0x7170('0x4f')]({'where':{'id':_0x2162d3['params']['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x397250,null))[_0x7170('0x26')](function(_0x14a6f0){if(_0x14a6f0){_0x2162d3[_0x7170('0x49')][_0x7170('0x50')]=_0x14a6f0['id'];_0x2162d3[_0x7170('0x49')][_0x7170('0x51')]=integrations[_0x7170('0x52')](_0x2162d3[_0x7170('0x49')][_0x7170('0x53')],_0x2162d3[_0x7170('0x49')][_0x7170('0x3c')]);_0x2162d3[_0x7170('0x49')]['Descriptions']=integrations[_0x7170('0x54')](_0x2162d3[_0x7170('0x49')][_0x7170('0x53')],_0x2162d3[_0x7170('0x49')][_0x7170('0x3c')]);return db[_0x7170('0x4c')]['create'](_0x2162d3[_0x7170('0x49')],{'include':[{'model':db[_0x7170('0x55')],'as':_0x7170('0x51')},{'model':db[_0x7170('0x55')],'as':_0x7170('0x56')}]});}return null;})['then'](respondWithResult(_0x397250,null))[_0x7170('0x4a')](handleError(_0x397250,null));};exports[_0x7170('0x57')]=function(_0xa36419,_0x3f1318,_0x25a7e0){var _0x4aab89='';return db[_0x7170('0x2b')]['findOne']({'where':{'id':_0xa36419['params']['id']},'attributes':['id',_0x7170('0x58'),_0x7170('0x59')]})['then'](handleEntityNotFound(_0x3f1318,null))[_0x7170('0x26')](function(_0x241f8){if(_0x241f8){_0x4aab89=_0x241f8[_0x7170('0x58')];var _0x30413d=_0x4aab89[_0x7170('0x5a')](-0x1);if(_0x30413d==='/'){_0x4aab89=_0x4aab89['substring'](0x0,_0x4aab89[_0x7170('0x5b')](_0x30413d));}return rp({'method':_0x7170('0x5c'),'uri':util[_0x7170('0x5d')](_0x7170('0x5e'),_0x4aab89,_0x7170('0x5f')),'headers':{'Authorization':util[_0x7170('0x5d')]('Basic\x20%s',new Buffer(util[_0x7170('0x5d')]('%s:X',_0x241f8[_0x7170('0x59')]))[_0x7170('0x60')](_0x7170('0x61')))},'json':!![]});}})[_0x7170('0x26')](function(_0x4fd91a){if(_0x4fd91a){var _0x36de8e=[_0x7170('0x62'),_0x7170('0x63'),'agent',_0x7170('0x64'),_0x7170('0x19'),_0x7170('0x65'),_0x7170('0x66'),_0x7170('0x67'),_0x7170('0x68'),'group',_0x7170('0x69')];_['remove'](_0x4fd91a,function(_0x59292c){return _0x36de8e['includes'](_0x59292c[_0x7170('0x29')])||!_0x59292c[_0x7170('0x6a')]&&_0x59292c[_0x7170('0x3c')]!==_0x7170('0x6b')&&_0x59292c['type']!=='custom_dropdown';});return{'count':_0x4fd91a[_0x7170('0x46')],'rows':_[_0x7170('0x2f')](_0x4fd91a,function(_0x1ee17e){return{'id':_0x1ee17e['name'],'name':_0x1ee17e[_0x7170('0x6c')],'custom':!_0x1ee17e[_0x7170('0x6a')],'options':_0x1ee17e['choices']?_['map'](_0x1ee17e[_0x7170('0x6d')],function(_0x2818c2){return{'name':_[_0x7170('0x6e')](_0x2818c2),'value':_0x2818c2};}):[]};})};}})['then'](respondWithResult(_0x3f1318,null))[_0x7170('0x4a')](function(_0x39fd2d){var _0x3660a7=_0xa36419['query']['test']?0x1f4:_0x39fd2d[_0x7170('0x6f')]||0x1f4;logger['error'](_0x7170('0x70'),'getFields',_0x3660a7,JSON[_0x7170('0x71')](_0x39fd2d));delete _0x39fd2d[_0x7170('0x29')];if(_0x3660a7===0x191){_0x3660a7=0x190;}_0x3f1318['status'](_0x3660a7)[_0x7170('0x2a')](_0xa36419[_0x7170('0x31')][_0x7170('0x72')]?{'message':_0x7170('0x73'),'statusCode':_0x39fd2d[_0x7170('0x6f')]}:_0x39fd2d);});}; \ No newline at end of file +var _0x2964=['AccountId','channel','Descriptions','getDescriptions','FreshdeskField','findOne','apiKey','substring','format','%s/%s','Basic\x20%s','%s:X','base64','requester','subject','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','FreshdeskAccount','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','FreshdeskConfiguration','order','getConfigurations','hasOwnProperty','nolimit'];(function(_0x135c1b,_0x15f991){var _0x38c5b7=function(_0x26a6d8){while(--_0x26a6d8){_0x135c1b['push'](_0x135c1b['shift']());}};_0x38c5b7(++_0x15f991);}(_0x2964,0x108));var _0x4296=function(_0x591baf,_0x5a9682){_0x591baf=_0x591baf-0x0;var _0xf80633=_0x2964[_0x591baf];return _0xf80633;};'use strict';var emlformat=require(_0x4296('0x0'));var rimraf=require(_0x4296('0x1'));var zipdir=require(_0x4296('0x2'));var jsonpatch=require(_0x4296('0x3'));var rp=require(_0x4296('0x4'));var moment=require(_0x4296('0x5'));var BPromise=require(_0x4296('0x6'));var Mustache=require(_0x4296('0x7'));var util=require(_0x4296('0x8'));var path=require('path');var sox=require(_0x4296('0x9'));var csv=require(_0x4296('0xa'));var ejs=require(_0x4296('0xb'));var fs=require('fs');var fs_extra=require(_0x4296('0xc'));var _=require(_0x4296('0xd'));var squel=require(_0x4296('0xe'));var crypto=require('crypto');var jsforce=require(_0x4296('0xf'));var deskjs=require(_0x4296('0x10'));var toCsv=require(_0x4296('0xa'));var querystring=require(_0x4296('0x11'));var Papa=require(_0x4296('0x12'));var Redis=require(_0x4296('0x13'));var authService=require(_0x4296('0x14'));var qs=require(_0x4296('0x15'));var as=require(_0x4296('0x16'));var hardwareService=require(_0x4296('0x17'));var logger=require(_0x4296('0x18'))(_0x4296('0x19'));var utils=require('../../config/utils');var config=require(_0x4296('0x1a'));var licenseUtil=require(_0x4296('0x1b'));var db=require(_0x4296('0x1c'))['db'];var integrations=require(_0x4296('0x1d'));function respondWithStatusCode(_0x23ba5a,_0x676674){_0x676674=_0x676674||0xcc;return function(_0x3789a2){if(_0x3789a2){return _0x23ba5a['sendStatus'](_0x676674);}return _0x23ba5a[_0x4296('0x1e')](_0x676674)[_0x4296('0x1f')]();};}function respondWithResult(_0x3574da,_0x56b6d7){_0x56b6d7=_0x56b6d7||0xc8;return function(_0x1c192c){if(_0x1c192c){return _0x3574da[_0x4296('0x1e')](_0x56b6d7)[_0x4296('0x20')](_0x1c192c);}};}function respondWithFilteredResult(_0x53af4b,_0x182910){return function(_0x2e63c4){if(_0x2e63c4){var _0x1e7af8=typeof _0x182910['offset']===_0x4296('0x21')&&typeof _0x182910[_0x4296('0x22')]===_0x4296('0x21');var _0x1dcb36=_0x2e63c4[_0x4296('0x23')];var _0x540b0d=_0x1e7af8?0x0:_0x182910[_0x4296('0x24')];var _0x4ac668=_0x1e7af8?_0x2e63c4[_0x4296('0x23')]:_0x182910['offset']+_0x182910[_0x4296('0x22')];var _0x6c50b7;if(_0x4ac668>=_0x1dcb36){_0x4ac668=_0x1dcb36;_0x6c50b7=0xc8;}else{_0x6c50b7=0xce;}_0x53af4b[_0x4296('0x1e')](_0x6c50b7);return _0x53af4b[_0x4296('0x25')](_0x4296('0x26'),_0x540b0d+'-'+_0x4ac668+'/'+_0x1dcb36)[_0x4296('0x20')](_0x2e63c4);}return null;};}function patchUpdates(_0x4ca11f){return function(_0x33839e){try{jsonpatch[_0x4296('0x27')](_0x33839e,_0x4ca11f,!![]);}catch(_0x5456ca){return BPromise[_0x4296('0x28')](_0x5456ca);}return _0x33839e[_0x4296('0x29')]();};}function saveUpdates(_0x257f51,_0x3c899f){return function(_0x5d285d){if(_0x5d285d){return _0x5d285d['update'](_0x257f51)[_0x4296('0x2a')](function(_0x3902b5){return _0x3902b5;});}return null;};}function removeEntity(_0x4ce761,_0x179e5d){return function(_0x4c5aca){if(_0x4c5aca){return _0x4c5aca[_0x4296('0x2b')]()[_0x4296('0x2a')](function(){_0x4ce761[_0x4296('0x1e')](0xcc)[_0x4296('0x1f')]();});}};}function handleEntityNotFound(_0x5098c1,_0x3b8b48){return function(_0x4c56e5){if(!_0x4c56e5){_0x5098c1[_0x4296('0x2c')](0x194);}return _0x4c56e5;};}function handleError(_0x516365,_0x4f2d8e){_0x4f2d8e=_0x4f2d8e||0x1f4;return function(_0x853bf5){logger[_0x4296('0x2d')](_0x853bf5[_0x4296('0x2e')]);if(_0x853bf5['name']){delete _0x853bf5[_0x4296('0x2f')];}_0x516365[_0x4296('0x1e')](_0x4f2d8e)['send'](_0x853bf5);};}exports[_0x4296('0x30')]=function(_0x5cb6b7,_0x4f9a1a){var _0x14c84f={},_0x2f5a2e={},_0x37f4e5={'count':0x0,'rows':[]};var _0x1bf57b=_[_0x4296('0x31')](db[_0x4296('0x32')][_0x4296('0x33')],function(_0x9ac120){return{'name':_0x9ac120['fieldName'],'type':_0x9ac120[_0x4296('0x34')]['key']};});_0x2f5a2e[_0x4296('0x35')]=_['map'](_0x1bf57b,'name');_0x2f5a2e[_0x4296('0x36')]=_['keys'](_0x5cb6b7[_0x4296('0x36')]);_0x2f5a2e[_0x4296('0x37')]=_[_0x4296('0x38')](_0x2f5a2e[_0x4296('0x35')],_0x2f5a2e[_0x4296('0x36')]);_0x14c84f[_0x4296('0x39')]=_[_0x4296('0x38')](_0x2f5a2e[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3a')]));_0x14c84f['attributes']=_0x14c84f['attributes'][_0x4296('0x3b')]?_0x14c84f[_0x4296('0x39')]:_0x2f5a2e[_0x4296('0x35')];if(!_0x5cb6b7[_0x4296('0x36')]['hasOwnProperty']('nolimit')){_0x14c84f[_0x4296('0x22')]=qs[_0x4296('0x22')](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x22')]);_0x14c84f['offset']=qs[_0x4296('0x24')](_0x5cb6b7[_0x4296('0x36')]['offset']);}_0x14c84f['order']=qs['sort'](_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3c')]);_0x14c84f['where']=qs[_0x4296('0x37')](_[_0x4296('0x3d')](_0x5cb6b7[_0x4296('0x36')],_0x2f5a2e[_0x4296('0x37')]),_0x1bf57b);if(_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3e')]){_0x14c84f[_0x4296('0x3f')]=_[_0x4296('0x40')](_0x14c84f[_0x4296('0x3f')],{'$or':_[_0x4296('0x31')](_0x1bf57b,function(_0x1e96ed){if(_0x1e96ed[_0x4296('0x34')]!==_0x4296('0x41')){var _0x542ef9={};_0x542ef9[_0x1e96ed[_0x4296('0x2f')]]={'$like':'%'+_0x5cb6b7[_0x4296('0x36')][_0x4296('0x3e')]+'%'};return _0x542ef9;}})});}_0x14c84f=_[_0x4296('0x40')]({},_0x14c84f,_0x5cb6b7[_0x4296('0x42')]);var _0x2fa9c0={'where':_0x14c84f['where']};return db[_0x4296('0x32')][_0x4296('0x23')](_0x2fa9c0)[_0x4296('0x2a')](function(_0x536531){_0x37f4e5[_0x4296('0x23')]=_0x536531;if(_0x5cb6b7['query'][_0x4296('0x43')]){_0x14c84f[_0x4296('0x44')]=[{'all':!![]}];}return db[_0x4296('0x32')][_0x4296('0x45')](_0x14c84f);})[_0x4296('0x2a')](function(_0x43e3b2){_0x37f4e5['rows']=_0x43e3b2;return _0x37f4e5;})[_0x4296('0x2a')](respondWithFilteredResult(_0x4f9a1a,_0x14c84f))[_0x4296('0x46')](handleError(_0x4f9a1a,null));};exports['show']=function(_0x47bd76,_0xa64359){var _0x3fffd3={'raw':![],'where':{'id':_0x47bd76[_0x4296('0x47')]['id']}},_0x2da579={};_0x2da579[_0x4296('0x35')]=_['keys'](db['FreshdeskAccount'][_0x4296('0x33')]);_0x2da579[_0x4296('0x36')]=_[_0x4296('0x48')](_0x47bd76[_0x4296('0x36')]);_0x2da579[_0x4296('0x37')]=_[_0x4296('0x38')](_0x2da579[_0x4296('0x35')],_0x2da579[_0x4296('0x36')]);_0x3fffd3[_0x4296('0x39')]=_['intersection'](_0x2da579[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x47bd76[_0x4296('0x36')]['fields']));_0x3fffd3[_0x4296('0x39')]=_0x3fffd3[_0x4296('0x39')]['length']?_0x3fffd3['attributes']:_0x2da579[_0x4296('0x35')];if(_0x47bd76[_0x4296('0x36')][_0x4296('0x43')]){_0x3fffd3['include']=[{'all':!![]}];}_0x3fffd3=_['merge']({},_0x3fffd3,_0x47bd76['options']);return db[_0x4296('0x32')][_0x4296('0x49')](_0x3fffd3)[_0x4296('0x2a')](handleEntityNotFound(_0xa64359,null))['then'](respondWithResult(_0xa64359,null))['catch'](handleError(_0xa64359,null));};exports[_0x4296('0x4a')]=function(_0x1ddb06,_0x403e7d){return db[_0x4296('0x32')][_0x4296('0x4a')](_0x1ddb06[_0x4296('0x4b')],{})[_0x4296('0x2a')](respondWithResult(_0x403e7d,0xc9))[_0x4296('0x46')](handleError(_0x403e7d,null));};exports['update']=function(_0x419cab,_0x1f050b){if(_0x419cab[_0x4296('0x4b')]['id']){delete _0x419cab[_0x4296('0x4b')]['id'];}return db[_0x4296('0x32')][_0x4296('0x49')]({'where':{'id':_0x419cab['params']['id']}})['then'](handleEntityNotFound(_0x1f050b,null))['then'](saveUpdates(_0x419cab[_0x4296('0x4b')],null))[_0x4296('0x2a')](respondWithResult(_0x1f050b,null))[_0x4296('0x46')](handleError(_0x1f050b,null));};exports[_0x4296('0x2b')]=function(_0x4baee7,_0x2ac96d){return db[_0x4296('0x32')][_0x4296('0x49')]({'where':{'id':_0x4baee7[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x2ac96d,null))[_0x4296('0x2a')](removeEntity(_0x2ac96d,null))[_0x4296('0x46')](handleError(_0x2ac96d,null));};exports['getConfigurations']=function(_0x468453,_0x47f668,_0x52c28a){var _0x6379ec={};var _0x18080a={};var _0x4f306a;var _0x17e212;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x468453[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x47f668,null))['then'](function(_0x4faac4){if(_0x4faac4){_0x4f306a=_0x4faac4;_0x18080a[_0x4296('0x35')]=_[_0x4296('0x48')](db[_0x4296('0x4c')][_0x4296('0x33')]);_0x18080a[_0x4296('0x36')]=_['keys'](_0x468453[_0x4296('0x36')]);_0x18080a[_0x4296('0x37')]=_['intersection'](_0x18080a[_0x4296('0x35')],_0x18080a[_0x4296('0x36')]);_0x6379ec[_0x4296('0x39')]=_[_0x4296('0x38')](_0x18080a[_0x4296('0x35')],qs[_0x4296('0x3a')](_0x468453['query'][_0x4296('0x3a')]));_0x6379ec[_0x4296('0x39')]=_0x6379ec[_0x4296('0x39')][_0x4296('0x3b')]?_0x6379ec['attributes']:_0x18080a['model'];_0x6379ec[_0x4296('0x4d')]=qs[_0x4296('0x3c')](_0x468453['query'][_0x4296('0x3c')]);_0x6379ec[_0x4296('0x3f')]=qs[_0x4296('0x37')](_[_0x4296('0x3d')](_0x468453[_0x4296('0x36')],_0x18080a['filters']));if(_0x468453[_0x4296('0x36')]['filter']){_0x6379ec[_0x4296('0x3f')]=_['merge'](_0x6379ec[_0x4296('0x3f')],{'$or':_[_0x4296('0x31')](_0x6379ec[_0x4296('0x39')],function(_0x26a400){var _0x2e8b42={};_0x2e8b42[_0x26a400]={'$like':'%'+_0x468453[_0x4296('0x36')][_0x4296('0x3e')]+'%'};return _0x2e8b42;})});}_0x6379ec=_[_0x4296('0x40')]({},_0x6379ec,_0x468453['options']);return _0x4f306a[_0x4296('0x4e')](_0x6379ec);}})[_0x4296('0x2a')](function(_0x128f96){if(_0x128f96){_0x17e212=_0x128f96[_0x4296('0x3b')];if(!_0x468453['query'][_0x4296('0x4f')](_0x4296('0x50'))){_0x6379ec[_0x4296('0x22')]=qs[_0x4296('0x22')](_0x468453[_0x4296('0x36')][_0x4296('0x22')]);_0x6379ec[_0x4296('0x24')]=qs[_0x4296('0x24')](_0x468453[_0x4296('0x36')][_0x4296('0x24')]);}return _0x4f306a[_0x4296('0x4e')](_0x6379ec);}})[_0x4296('0x2a')](function(_0x3841c1){if(_0x3841c1){return _0x3841c1?{'count':_0x17e212,'rows':_0x3841c1}:null;}})[_0x4296('0x2a')](respondWithResult(_0x47f668,null))[_0x4296('0x46')](handleError(_0x47f668,null));};exports['addConfiguration']=function(_0x2c2823,_0x6360e7,_0xe4cf57){if(_0x2c2823[_0x4296('0x4b')]['id']){delete _0x2c2823[_0x4296('0x4b')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2c2823[_0x4296('0x47')]['id']}})[_0x4296('0x2a')](handleEntityNotFound(_0x6360e7,null))[_0x4296('0x2a')](function(_0x24054b){if(_0x24054b){_0x2c2823[_0x4296('0x4b')][_0x4296('0x51')]=_0x24054b['id'];_0x2c2823[_0x4296('0x4b')]['Subjects']=integrations['getSubjects'](_0x2c2823['body'][_0x4296('0x52')],_0x2c2823[_0x4296('0x4b')][_0x4296('0x34')]);_0x2c2823['body'][_0x4296('0x53')]=integrations[_0x4296('0x54')](_0x2c2823[_0x4296('0x4b')][_0x4296('0x52')],_0x2c2823['body'][_0x4296('0x34')]);return db[_0x4296('0x4c')][_0x4296('0x4a')](_0x2c2823['body'],{'include':[{'model':db[_0x4296('0x55')],'as':'Subjects'},{'model':db[_0x4296('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x6360e7,null))[_0x4296('0x46')](handleError(_0x6360e7,null));};exports['getFields']=function(_0x171ffb,_0x22ab58,_0x309225){var _0x45c839='';return db[_0x4296('0x32')][_0x4296('0x56')]({'where':{'id':_0x171ffb[_0x4296('0x47')]['id']},'attributes':['id','remoteUri',_0x4296('0x57')]})['then'](handleEntityNotFound(_0x22ab58,null))[_0x4296('0x2a')](function(_0x5aa04d){if(_0x5aa04d){_0x45c839=_0x5aa04d['remoteUri'];var _0xea86ed=_0x45c839['slice'](-0x1);if(_0xea86ed==='/'){_0x45c839=_0x45c839[_0x4296('0x58')](0x0,_0x45c839['lastIndexOf'](_0xea86ed));}return rp({'method':'GET','uri':util[_0x4296('0x59')](_0x4296('0x5a'),_0x45c839,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x4296('0x59')](_0x4296('0x5b'),new Buffer(util['format'](_0x4296('0x5c'),_0x5aa04d[_0x4296('0x57')]))['toString'](_0x4296('0x5d')))},'json':!![]});}})[_0x4296('0x2a')](function(_0x54a6c){if(_0x54a6c){var _0x1ea1de=[_0x4296('0x5e'),_0x4296('0x5f'),'agent',_0x4296('0x60'),_0x4296('0x1e'),_0x4296('0x61'),_0x4296('0x62'),_0x4296('0x63'),_0x4296('0x64'),_0x4296('0x62'),'company'];_[_0x4296('0x65')](_0x54a6c,function(_0x12efc5){return _0x1ea1de[_0x4296('0x66')](_0x12efc5[_0x4296('0x2f')])||!_0x12efc5[_0x4296('0x67')]&&_0x12efc5[_0x4296('0x34')]!==_0x4296('0x68')&&_0x12efc5[_0x4296('0x34')]!==_0x4296('0x69');});return{'count':_0x54a6c[_0x4296('0x3b')],'rows':_[_0x4296('0x31')](_0x54a6c,function(_0x5599b8){return{'id':_0x5599b8[_0x4296('0x2f')],'name':_0x5599b8[_0x4296('0x6a')],'custom':!_0x5599b8[_0x4296('0x67')],'options':_0x5599b8[_0x4296('0x6b')]?_['map'](_0x5599b8[_0x4296('0x6b')],function(_0x5b3dce){return{'name':_[_0x4296('0x6c')](_0x5b3dce),'value':_0x5b3dce};}):[]};})};}})[_0x4296('0x2a')](respondWithResult(_0x22ab58,null))[_0x4296('0x46')](function(_0x57319b){var _0x4eeaa8=_0x171ffb[_0x4296('0x36')]['test']?0x1f4:_0x57319b['statusCode']||0x1f4;logger[_0x4296('0x2d')](_0x4296('0x6d'),_0x4296('0x6e'),_0x4eeaa8,JSON[_0x4296('0x6f')](_0x57319b));delete _0x57319b[_0x4296('0x2f')];if(_0x4eeaa8===0x191){_0x4eeaa8=0x190;}_0x22ab58[_0x4296('0x1e')](_0x4eeaa8)[_0x4296('0x70')](_0x171ffb['query']['test']?{'message':_0x4296('0x71'),'statusCode':_0x57319b[_0x4296('0x72')]}:_0x57319b);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 489196d..79056a9 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 _0xcaa6=['FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4d5336,_0x3aa1a9){var _0x1447c3=function(_0x71e11c){while(--_0x71e11c){_0x4d5336['push'](_0x4d5336['shift']());}};_0x1447c3(++_0x3aa1a9);}(_0xcaa6,0x195));var _0x6caa=function(_0x3cb971,_0x345857){_0x3cb971=_0x3cb971-0x0;var _0x2f8e2f=_0xcaa6[_0x3cb971];return _0x2f8e2f;};'use strict';var _=require(_0x6caa('0x0'));var util=require('util');var logger=require(_0x6caa('0x1'))('api');var moment=require(_0x6caa('0x2'));var BPromise=require(_0x6caa('0x3'));var rp=require(_0x6caa('0x4'));var fs=require('fs');var path=require(_0x6caa('0x5'));var rimraf=require('rimraf');var config=require(_0x6caa('0x6'));var attributes=require(_0x6caa('0x7'));var integrations=require(_0x6caa('0x8'));module[_0x6caa('0x9')]=function(_0x1902de,_0x59c10f){return _0x1902de[_0x6caa('0xa')](_0x6caa('0xb'),attributes,{'tableName':_0x6caa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f9b=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','lodash','util','api','bluebird','request-promise'];(function(_0x414543,_0x300927){var _0x2eecb6=function(_0x13eb3d){while(--_0x13eb3d){_0x414543['push'](_0x414543['shift']());}};_0x2eecb6(++_0x300927);}(_0x6f9b,0xdf));var _0xb6f9=function(_0x3ef13b,_0x2f1002){_0x3ef13b=_0x3ef13b-0x0;var _0x51a8db=_0x6f9b[_0x3ef13b];return _0x51a8db;};'use strict';var _=require(_0xb6f9('0x0'));var util=require(_0xb6f9('0x1'));var logger=require('../../config/logger')(_0xb6f9('0x2'));var moment=require('moment');var BPromise=require(_0xb6f9('0x3'));var rp=require(_0xb6f9('0x4'));var fs=require('fs');var path=require(_0xb6f9('0x5'));var rimraf=require(_0xb6f9('0x6'));var config=require(_0xb6f9('0x7'));var attributes=require(_0xb6f9('0x8'));var integrations=require(_0xb6f9('0x9'));module['exports']=function(_0x23976b,_0x3a842b){return _0x23976b[_0xb6f9('0xa')](_0xb6f9('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 8aea6a6..8f4dbc3 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 _0x5e4a=['stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1f146c,_0xfb86d6){var _0x2354fb=function(_0x2078d0){while(--_0x2078d0){_0x1f146c['push'](_0x1f146c['shift']());}};_0x2354fb(++_0xfb86d6);}(_0x5e4a,0x1b5));var _0xa5e4=function(_0x2acc2f,_0x5f1e62){_0x2acc2f=_0x2acc2f-0x0;var _0x110451=_0x5e4a[_0x2acc2f];return _0x110451;};'use strict';var _=require(_0xa5e4('0x0'));var util=require(_0xa5e4('0x1'));var moment=require(_0xa5e4('0x2'));var BPromise=require(_0xa5e4('0x3'));var rs=require(_0xa5e4('0x4'));var fs=require('fs');var Redis=require(_0xa5e4('0x5'));var db=require(_0xa5e4('0x6'))['db'];var utils=require(_0xa5e4('0x7'));var logger=require(_0xa5e4('0x8'))(_0xa5e4('0x9'));var config=require(_0xa5e4('0xa'));var jayson=require(_0xa5e4('0xb'));var client=jayson[_0xa5e4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x392e00,_0x4cf7f0,_0x2a570e){return new BPromise(function(_0x723f27,_0x5d72f9){return client['request'](_0x392e00,_0x2a570e)[_0xa5e4('0xd')](function(_0x5db71b){logger[_0xa5e4('0xe')](_0xa5e4('0xf'),_0x4cf7f0,_0xa5e4('0x10'));logger[_0xa5e4('0x11')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x4cf7f0,'request\x20sent',JSON[_0xa5e4('0x12')](_0x5db71b));if(_0x5db71b[_0xa5e4('0x13')]){if(_0x5db71b['error']['code']===0x1f4){logger[_0xa5e4('0x13')](_0xa5e4('0xf'),_0x4cf7f0,_0x5db71b[_0xa5e4('0x13')]['message']);return _0x5d72f9(_0x5db71b[_0xa5e4('0x13')][_0xa5e4('0x14')]);}logger[_0xa5e4('0x13')](_0xa5e4('0xf'),_0x4cf7f0,_0x5db71b[_0xa5e4('0x13')][_0xa5e4('0x14')]);return _0x723f27(_0x5db71b[_0xa5e4('0x13')][_0xa5e4('0x14')]);}else{logger[_0xa5e4('0xe')](_0xa5e4('0xf'),_0x4cf7f0,'request\x20sent');_0x723f27(_0x5db71b[_0xa5e4('0x15')][_0xa5e4('0x14')]);}})[_0xa5e4('0x16')](function(_0x47ae01){logger[_0xa5e4('0x13')](_0xa5e4('0xf'),_0x4cf7f0,_0x47ae01);_0x5d72f9(_0x47ae01);});});}exports[_0xa5e4('0x17')]=function(_0x53dfc5){var _0x2bf4c0=this;return new Promise(function(_0x599400,_0x5bffff){return db[_0xa5e4('0x18')][_0xa5e4('0x19')]({'raw':_0x53dfc5[_0xa5e4('0x1a')]?_0x53dfc5['options'][_0xa5e4('0x1b')]===undefined?!![]:![]:!![],'where':_0x53dfc5[_0xa5e4('0x1a')]?_0x53dfc5['options'][_0xa5e4('0x1c')]||null:null,'attributes':_0x53dfc5[_0xa5e4('0x1a')]?_0x53dfc5[_0xa5e4('0x1a')][_0xa5e4('0x1d')]||null:null,'limit':_0x53dfc5[_0xa5e4('0x1a')]?_0x53dfc5['options']['limit']||null:null,'include':_0x53dfc5['options']?_0x53dfc5[_0xa5e4('0x1a')][_0xa5e4('0x1e')]?_[_0xa5e4('0x1f')](_0x53dfc5[_0xa5e4('0x1a')][_0xa5e4('0x1e')],function(_0x33a19b){return{'model':db[_0x33a19b[_0xa5e4('0x20')]],'as':_0x33a19b['as'],'attributes':_0x33a19b[_0xa5e4('0x1d')],'include':_0x33a19b[_0xa5e4('0x1e')]?_[_0xa5e4('0x1f')](_0x33a19b[_0xa5e4('0x1e')],function(_0x1fdadb){return{'model':db[_0x1fdadb[_0xa5e4('0x20')]],'as':_0x1fdadb['as'],'attributes':_0x1fdadb[_0xa5e4('0x1d')],'include':_0x1fdadb[_0xa5e4('0x1e')]?_[_0xa5e4('0x1f')](_0x1fdadb[_0xa5e4('0x1e')],function(_0x11ec96){return{'model':db[_0x11ec96[_0xa5e4('0x20')]],'as':_0x11ec96['as'],'attributes':_0x11ec96[_0xa5e4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe71de1){logger['info'](_0xa5e4('0x17'),_0x53dfc5);logger[_0xa5e4('0x11')]('GetFreshdeskAccount',_0x53dfc5,JSON[_0xa5e4('0x12')](_0xe71de1));_0x599400(_0xe71de1);})[_0xa5e4('0x16')](function(_0x4a633b){logger['error'](_0xa5e4('0x17'),_0x4a633b[_0xa5e4('0x14')],_0x53dfc5);_0x5bffff(_0x2bf4c0[_0xa5e4('0x13')](0x1f4,_0x4a633b[_0xa5e4('0x14')]));});});};exports[_0xa5e4('0x21')]=function(_0x4b0c97){var _0x202804=this;return new Promise(function(_0x481541,_0x281068){return db[_0xa5e4('0x18')][_0xa5e4('0x22')]({'raw':_0x4b0c97[_0xa5e4('0x1a')]?_0x4b0c97[_0xa5e4('0x1a')][_0xa5e4('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b0c97[_0xa5e4('0x1a')]?_0x4b0c97[_0xa5e4('0x1a')][_0xa5e4('0x1c')]||null:null,'attributes':_0x4b0c97[_0xa5e4('0x1a')]?_0x4b0c97[_0xa5e4('0x1a')][_0xa5e4('0x1d')]||null:null,'include':_0x4b0c97[_0xa5e4('0x1a')]?_0x4b0c97[_0xa5e4('0x1a')][_0xa5e4('0x1e')]?_[_0xa5e4('0x1f')](_0x4b0c97['options'][_0xa5e4('0x1e')],function(_0x1cc3fa){return{'model':db[_0x1cc3fa[_0xa5e4('0x20')]],'as':_0x1cc3fa['as'],'attributes':_0x1cc3fa[_0xa5e4('0x1d')],'include':_0x1cc3fa[_0xa5e4('0x1e')]?_[_0xa5e4('0x1f')](_0x1cc3fa['include'],function(_0x3091fd){return{'model':db[_0x3091fd['model']],'as':_0x3091fd['as'],'attributes':_0x3091fd[_0xa5e4('0x1d')],'include':_0x3091fd[_0xa5e4('0x1e')]?_[_0xa5e4('0x1f')](_0x3091fd[_0xa5e4('0x1e')],function(_0x15e7c0){return{'model':db[_0x15e7c0[_0xa5e4('0x20')]],'as':_0x15e7c0['as'],'attributes':_0x15e7c0[_0xa5e4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa5e4('0xd')](function(_0x1c1881){logger[_0xa5e4('0xe')](_0xa5e4('0x21'),_0x4b0c97);logger[_0xa5e4('0x11')]('ShowFreshdeskAccount',_0x4b0c97,JSON[_0xa5e4('0x12')](_0x1c1881));_0x481541(_0x1c1881);})[_0xa5e4('0x16')](function(_0x2f3b8a){logger[_0xa5e4('0x13')](_0xa5e4('0x21'),_0x2f3b8a[_0xa5e4('0x14')],_0x4b0c97);_0x281068(_0x202804[_0xa5e4('0x13')](0x1f4,_0x2f3b8a[_0xa5e4('0x14')]));});});}; \ No newline at end of file +var _0x6904=['http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','FreshdeskAccount','findAll','raw','options','where','limit','map','include','model','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x570df7,_0x169e53){var _0x6bc984=function(_0x5481d2){while(--_0x5481d2){_0x570df7['push'](_0x570df7['shift']());}};_0x6bc984(++_0x169e53);}(_0x6904,0xd9));var _0x4690=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x6904[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x4690('0x0'));var util=require('util');var moment=require(_0x4690('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4690('0x2'))['db'];var utils=require(_0x4690('0x3'));var logger=require(_0x4690('0x4'))('rpc');var config=require(_0x4690('0x5'));var jayson=require(_0x4690('0x6'));var client=jayson['client'][_0x4690('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4071dd,_0x5b4a0d,_0x8980b9){return new BPromise(function(_0x369476,_0x28de59){return client[_0x4690('0x8')](_0x4071dd,_0x8980b9)[_0x4690('0x9')](function(_0x3a6233){logger['info'](_0x4690('0xa'),_0x5b4a0d,_0x4690('0xb'));logger[_0x4690('0xc')](_0x4690('0xd'),_0x5b4a0d,'request\x20sent',JSON[_0x4690('0xe')](_0x3a6233));if(_0x3a6233[_0x4690('0xf')]){if(_0x3a6233[_0x4690('0xf')]['code']===0x1f4){logger[_0x4690('0xf')](_0x4690('0xa'),_0x5b4a0d,_0x3a6233[_0x4690('0xf')][_0x4690('0x10')]);return _0x28de59(_0x3a6233[_0x4690('0xf')][_0x4690('0x10')]);}logger[_0x4690('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x5b4a0d,_0x3a6233[_0x4690('0xf')][_0x4690('0x10')]);return _0x369476(_0x3a6233[_0x4690('0xf')]['message']);}else{logger[_0x4690('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x5b4a0d,'request\x20sent');_0x369476(_0x3a6233['result'][_0x4690('0x10')]);}})[_0x4690('0x12')](function(_0x318626){logger[_0x4690('0xf')](_0x4690('0xa'),_0x5b4a0d,_0x318626);_0x28de59(_0x318626);});});}exports['GetFreshdeskAccount']=function(_0x11f24e){var _0x840e29=this;return new Promise(function(_0x2bcf25,_0x44f09a){return db[_0x4690('0x13')][_0x4690('0x14')]({'raw':_0x11f24e['options']?_0x11f24e['options'][_0x4690('0x15')]===undefined?!![]:![]:!![],'where':_0x11f24e['options']?_0x11f24e[_0x4690('0x16')][_0x4690('0x17')]||null:null,'attributes':_0x11f24e[_0x4690('0x16')]?_0x11f24e[_0x4690('0x16')]['attributes']||null:null,'limit':_0x11f24e[_0x4690('0x16')]?_0x11f24e[_0x4690('0x16')][_0x4690('0x18')]||null:null,'include':_0x11f24e['options']?_0x11f24e[_0x4690('0x16')]['include']?_[_0x4690('0x19')](_0x11f24e[_0x4690('0x16')][_0x4690('0x1a')],function(_0x58bc4d){return{'model':db[_0x58bc4d['model']],'as':_0x58bc4d['as'],'attributes':_0x58bc4d['attributes'],'include':_0x58bc4d['include']?_[_0x4690('0x19')](_0x58bc4d[_0x4690('0x1a')],function(_0x4f4fa0){return{'model':db[_0x4f4fa0[_0x4690('0x1b')]],'as':_0x4f4fa0['as'],'attributes':_0x4f4fa0['attributes'],'include':_0x4f4fa0[_0x4690('0x1a')]?_[_0x4690('0x19')](_0x4f4fa0[_0x4690('0x1a')],function(_0x2d7ea4){return{'model':db[_0x2d7ea4[_0x4690('0x1b')]],'as':_0x2d7ea4['as'],'attributes':_0x2d7ea4[_0x4690('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4690('0x9')](function(_0x3b050a){logger[_0x4690('0x11')](_0x4690('0x1d'),_0x11f24e);logger['debug'](_0x4690('0x1d'),_0x11f24e,JSON[_0x4690('0xe')](_0x3b050a));_0x2bcf25(_0x3b050a);})['catch'](function(_0x353c99){logger['error'](_0x4690('0x1d'),_0x353c99['message'],_0x11f24e);_0x44f09a(_0x840e29['error'](0x1f4,_0x353c99[_0x4690('0x10')]));});});};exports[_0x4690('0x1e')]=function(_0x475bf7){var _0x4db451=this;return new Promise(function(_0x574581,_0x114695){return db[_0x4690('0x13')][_0x4690('0x1f')]({'raw':_0x475bf7[_0x4690('0x16')]?_0x475bf7[_0x4690('0x16')][_0x4690('0x15')]===undefined?!![]:![]:!![],'where':_0x475bf7['options']?_0x475bf7[_0x4690('0x16')]['where']||null:null,'attributes':_0x475bf7[_0x4690('0x16')]?_0x475bf7[_0x4690('0x16')]['attributes']||null:null,'include':_0x475bf7[_0x4690('0x16')]?_0x475bf7[_0x4690('0x16')][_0x4690('0x1a')]?_[_0x4690('0x19')](_0x475bf7[_0x4690('0x16')][_0x4690('0x1a')],function(_0x30fcf7){return{'model':db[_0x30fcf7[_0x4690('0x1b')]],'as':_0x30fcf7['as'],'attributes':_0x30fcf7[_0x4690('0x1c')],'include':_0x30fcf7['include']?_[_0x4690('0x19')](_0x30fcf7['include'],function(_0x20f114){return{'model':db[_0x20f114['model']],'as':_0x20f114['as'],'attributes':_0x20f114[_0x4690('0x1c')],'include':_0x20f114[_0x4690('0x1a')]?_[_0x4690('0x19')](_0x20f114[_0x4690('0x1a')],function(_0x908854){return{'model':db[_0x908854[_0x4690('0x1b')]],'as':_0x908854['as'],'attributes':_0x908854[_0x4690('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40fe8d){logger[_0x4690('0x11')](_0x4690('0x1e'),_0x475bf7);logger[_0x4690('0xc')](_0x4690('0x1e'),_0x475bf7,JSON[_0x4690('0xe')](_0x40fe8d));_0x574581(_0x40fe8d);})['catch'](function(_0x168f1d){logger['error'](_0x4690('0x1e'),_0x168f1d[_0x4690('0x10')],_0x475bf7);_0x114695(_0x4db451[_0x4690('0xf')](0x1f4,_0x168f1d['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 8bcb580..bad68d8 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 _0x63af=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','/:id','update','destroy','exports','multer','util'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x63af,0xce));var _0xf63a=function(_0x383552,_0x5db2de){_0x383552=_0x383552-0x0;var _0x338ff7=_0x63af[_0x383552];return _0x338ff7;};'use strict';var multer=require(_0xf63a('0x0'));var util=require(_0xf63a('0x1'));var path=require('path');var timeout=require(_0xf63a('0x2'));var express=require(_0xf63a('0x3'));var router=express[_0xf63a('0x4')]();var fs_extra=require(_0xf63a('0x5'));var auth=require(_0xf63a('0x6'));var interaction=require(_0xf63a('0x7'));var config=require(_0xf63a('0x8'));var controller=require(_0xf63a('0x9'));router[_0xf63a('0xa')]('/',auth[_0xf63a('0xb')](),controller[_0xf63a('0xc')]);router['get']('/:id',auth[_0xf63a('0xb')](),controller[_0xf63a('0xd')]);router[_0xf63a('0xa')]('/:id/fields',auth[_0xf63a('0xb')](),controller[_0xf63a('0xe')]);router['get'](_0xf63a('0xf'),auth[_0xf63a('0xb')](),controller['getSubjects']);router[_0xf63a('0xa')](_0xf63a('0x10'),auth[_0xf63a('0xb')](),controller[_0xf63a('0x11')]);router[_0xf63a('0xa')]('/:id/tags',auth[_0xf63a('0xb')](),controller[_0xf63a('0x12')]);router[_0xf63a('0x13')]('/',auth[_0xf63a('0xb')](),controller[_0xf63a('0x14')]);router[_0xf63a('0x13')](_0xf63a('0x15'),auth[_0xf63a('0xb')](),controller['setTags']);router['put'](_0xf63a('0x16'),auth[_0xf63a('0xb')](),controller[_0xf63a('0x17')]);router['delete'](_0xf63a('0x16'),auth[_0xf63a('0xb')](),controller[_0xf63a('0x18')]);module[_0xf63a('0x19')]=router; \ No newline at end of file +var _0x682d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getTags','create','post','/:id/tags','setTags','update','delete','exports','util','path','connect-timeout'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0x682d,0x177));var _0xd682=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x682d[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xd682('0x0'));var path=require(_0xd682('0x1'));var timeout=require(_0xd682('0x2'));var express=require(_0xd682('0x3'));var router=express[_0xd682('0x4')]();var fs_extra=require(_0xd682('0x5'));var auth=require(_0xd682('0x6'));var interaction=require(_0xd682('0x7'));var config=require(_0xd682('0x8'));var controller=require(_0xd682('0x9'));router[_0xd682('0xa')]('/',auth[_0xd682('0xb')](),controller[_0xd682('0xc')]);router['get'](_0xd682('0xd'),auth[_0xd682('0xb')](),controller[_0xd682('0xe')]);router[_0xd682('0xa')](_0xd682('0xf'),auth[_0xd682('0xb')](),controller['getFields']);router['get'](_0xd682('0x10'),auth[_0xd682('0xb')](),controller[_0xd682('0x11')]);router['get'](_0xd682('0x12'),auth[_0xd682('0xb')](),controller['getDescriptions']);router[_0xd682('0xa')]('/:id/tags',auth[_0xd682('0xb')](),controller[_0xd682('0x13')]);router['post']('/',auth[_0xd682('0xb')](),controller[_0xd682('0x14')]);router[_0xd682('0x15')](_0xd682('0x16'),auth[_0xd682('0xb')](),controller[_0xd682('0x17')]);router['put'](_0xd682('0xd'),auth[_0xd682('0xb')](),controller[_0xd682('0x18')]);router[_0xd682('0x19')](_0xd682('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd682('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 52cbf2f..d0f389e 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 _0xc0e0=['STRING','sequelize'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0xc0e0,0x18b));var _0x0c0e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc0e0[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x0c0e('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c0e('0x1')]},'description':{'type':Sequelize[_0x0c0e('0x1')]}}; \ No newline at end of file +var _0x096b=['STRING','sequelize'];(function(_0x2f3fa1,_0x1a7215){var _0x4265e0=function(_0x4c6701){while(--_0x4c6701){_0x2f3fa1['push'](_0x2f3fa1['shift']());}};_0x4265e0(++_0x1a7215);}(_0x096b,0x109));var _0xb096=function(_0xb5e21e,_0x2cbc71){_0xb5e21e=_0xb5e21e-0x0;var _0x49ffb2=_0x096b[_0xb5e21e];return _0x49ffb2;};'use strict';var Sequelize=require(_0xb096('0x0'));module['exports']={'name':{'type':Sequelize[_0xb096('0x1')]},'description':{'type':Sequelize[_0xb096('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index bd85523..2eb41dc 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 _0xdcaf=['to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','name','index','map','FreshdeskConfiguration','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','destroy','findOne','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xdcaf,0x9e));var _0xfdca=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcaf[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xfdca('0x0'));var rimraf=require(_0xfdca('0x1'));var zipdir=require(_0xfdca('0x2'));var jsonpatch=require(_0xfdca('0x3'));var rp=require(_0xfdca('0x4'));var moment=require('moment');var BPromise=require(_0xfdca('0x5'));var Mustache=require('mustache');var util=require(_0xfdca('0x6'));var path=require(_0xfdca('0x7'));var sox=require('sox');var csv=require(_0xfdca('0x8'));var ejs=require(_0xfdca('0x9'));var fs=require('fs');var fs_extra=require(_0xfdca('0xa'));var _=require(_0xfdca('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdca('0xc'));var deskjs=require(_0xfdca('0xd'));var toCsv=require(_0xfdca('0x8'));var querystring=require(_0xfdca('0xe'));var Papa=require(_0xfdca('0xf'));var Redis=require(_0xfdca('0x10'));var authService=require(_0xfdca('0x11'));var qs=require(_0xfdca('0x12'));var as=require(_0xfdca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xfdca('0x14'));var config=require(_0xfdca('0x15'));var licenseUtil=require(_0xfdca('0x16'));var db=require(_0xfdca('0x17'))['db'];function respondWithStatusCode(_0x5b012e,_0x810f57){_0x810f57=_0x810f57||0xcc;return function(_0x4c5562){if(_0x4c5562){return _0x5b012e[_0xfdca('0x18')](_0x810f57);}return _0x5b012e[_0xfdca('0x19')](_0x810f57)[_0xfdca('0x1a')]();};}function respondWithResult(_0x520b4c,_0x2a25ee){_0x2a25ee=_0x2a25ee||0xc8;return function(_0x3297b1){if(_0x3297b1){return _0x520b4c['status'](_0x2a25ee)['json'](_0x3297b1);}};}function respondWithFilteredResult(_0xc3a983,_0x938538){return function(_0x1649a9){if(_0x1649a9){var _0x51cbe6=typeof _0x938538['offset']===_0xfdca('0x1b')&&typeof _0x938538[_0xfdca('0x1c')]==='undefined';var _0x499d3f=_0x1649a9[_0xfdca('0x1d')];var _0xcf4f03=_0x51cbe6?0x0:_0x938538[_0xfdca('0x1e')];var _0xac2673=_0x51cbe6?_0x1649a9[_0xfdca('0x1d')]:_0x938538[_0xfdca('0x1e')]+_0x938538[_0xfdca('0x1c')];var _0x59c39a;if(_0xac2673>=_0x499d3f){_0xac2673=_0x499d3f;_0x59c39a=0xc8;}else{_0x59c39a=0xce;}_0xc3a983[_0xfdca('0x19')](_0x59c39a);return _0xc3a983[_0xfdca('0x1f')](_0xfdca('0x20'),_0xcf4f03+'-'+_0xac2673+'/'+_0x499d3f)[_0xfdca('0x21')](_0x1649a9);}return null;};}function patchUpdates(_0x145bf9){return function(_0x58624e){try{jsonpatch[_0xfdca('0x22')](_0x58624e,_0x145bf9,!![]);}catch(_0x530ef2){return BPromise[_0xfdca('0x23')](_0x530ef2);}return _0x58624e[_0xfdca('0x24')]();};}function saveUpdates(_0x510045,_0x11f452){return function(_0x5509f8){if(_0x5509f8){return _0x5509f8[_0xfdca('0x25')](_0x510045)[_0xfdca('0x26')](function(_0x4bc7e8){return _0x4bc7e8;});}return null;};}function removeEntity(_0x29e83d,_0x4d3a3d){return function(_0x2af524){if(_0x2af524){return _0x2af524['destroy']()[_0xfdca('0x26')](function(){_0x29e83d[_0xfdca('0x19')](0xcc)[_0xfdca('0x1a')]();});}};}function handleEntityNotFound(_0x275721,_0x5e90a3){return function(_0x5b7019){if(!_0x5b7019){_0x275721[_0xfdca('0x18')](0x194);}return _0x5b7019;};}function handleError(_0x5baf64,_0x1fa84f){_0x1fa84f=_0x1fa84f||0x1f4;return function(_0x247226){logger['error'](_0x247226[_0xfdca('0x27')]);if(_0x247226[_0xfdca('0x28')]){delete _0x247226[_0xfdca('0x28')];}_0x5baf64[_0xfdca('0x19')](_0x1fa84f)['send'](_0x247226);};}exports[_0xfdca('0x29')]=function(_0x574cce,_0x49d1ac){var _0x1dedcc={},_0x3f985c={},_0x3c9de8={'count':0x0,'rows':[]};var _0x20f8c0=_[_0xfdca('0x2a')](db[_0xfdca('0x2b')]['rawAttributes'],function(_0x357d2b){return{'name':_0x357d2b['fieldName'],'type':_0x357d2b[_0xfdca('0x2c')][_0xfdca('0x2d')]};});_0x3f985c[_0xfdca('0x2e')]=_[_0xfdca('0x2a')](_0x20f8c0,_0xfdca('0x28'));_0x3f985c[_0xfdca('0x2f')]=_[_0xfdca('0x30')](_0x574cce[_0xfdca('0x2f')]);_0x3f985c['filters']=_['intersection'](_0x3f985c[_0xfdca('0x2e')],_0x3f985c[_0xfdca('0x2f')]);_0x1dedcc[_0xfdca('0x31')]=_[_0xfdca('0x32')](_0x3f985c['model'],qs['fields'](_0x574cce[_0xfdca('0x2f')][_0xfdca('0x33')]));_0x1dedcc['attributes']=_0x1dedcc[_0xfdca('0x31')][_0xfdca('0x34')]?_0x1dedcc[_0xfdca('0x31')]:_0x3f985c['model'];if(!_0x574cce[_0xfdca('0x2f')][_0xfdca('0x35')](_0xfdca('0x36'))){_0x1dedcc[_0xfdca('0x1c')]=qs[_0xfdca('0x1c')](_0x574cce[_0xfdca('0x2f')][_0xfdca('0x1c')]);_0x1dedcc[_0xfdca('0x1e')]=qs[_0xfdca('0x1e')](_0x574cce['query'][_0xfdca('0x1e')]);}_0x1dedcc[_0xfdca('0x37')]=qs[_0xfdca('0x38')](_0x574cce[_0xfdca('0x2f')][_0xfdca('0x38')]);_0x1dedcc[_0xfdca('0x39')]=qs[_0xfdca('0x3a')](_[_0xfdca('0x3b')](_0x574cce[_0xfdca('0x2f')],_0x3f985c[_0xfdca('0x3a')]),_0x20f8c0);if(_0x574cce['query'][_0xfdca('0x3c')]){_0x1dedcc[_0xfdca('0x39')]=_[_0xfdca('0x3d')](_0x1dedcc[_0xfdca('0x39')],{'$or':_[_0xfdca('0x2a')](_0x20f8c0,function(_0x333667){if(_0x333667[_0xfdca('0x2c')]!==_0xfdca('0x3e')){var _0x4117b8={};_0x4117b8[_0x333667[_0xfdca('0x28')]]={'$like':'%'+_0x574cce[_0xfdca('0x2f')]['filter']+'%'};return _0x4117b8;}})});}_0x1dedcc=_[_0xfdca('0x3d')]({},_0x1dedcc,_0x574cce[_0xfdca('0x3f')]);var _0x5f2bb6={'where':_0x1dedcc['where']};return db['FreshdeskConfiguration'][_0xfdca('0x1d')](_0x5f2bb6)[_0xfdca('0x26')](function(_0x13a40c){_0x3c9de8[_0xfdca('0x1d')]=_0x13a40c;if(_0x574cce[_0xfdca('0x2f')][_0xfdca('0x40')]){_0x1dedcc[_0xfdca('0x41')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xfdca('0x42')](_0x1dedcc);})[_0xfdca('0x26')](function(_0x26e522){_0x3c9de8[_0xfdca('0x43')]=_0x26e522;return _0x3c9de8;})['then'](respondWithFilteredResult(_0x49d1ac,_0x1dedcc))[_0xfdca('0x44')](handleError(_0x49d1ac,null));};exports[_0xfdca('0x45')]=function(_0x1e10d4,_0xa7ee19){var _0x79a9b5={'raw':![],'where':{'id':_0x1e10d4['params']['id']}},_0xbbd229={};_0xbbd229[_0xfdca('0x2e')]=_[_0xfdca('0x30')](db[_0xfdca('0x2b')][_0xfdca('0x46')]);_0xbbd229['query']=_[_0xfdca('0x30')](_0x1e10d4[_0xfdca('0x2f')]);_0xbbd229[_0xfdca('0x3a')]=_[_0xfdca('0x32')](_0xbbd229[_0xfdca('0x2e')],_0xbbd229['query']);_0x79a9b5[_0xfdca('0x31')]=_[_0xfdca('0x32')](_0xbbd229[_0xfdca('0x2e')],qs[_0xfdca('0x33')](_0x1e10d4[_0xfdca('0x2f')][_0xfdca('0x33')]));_0x79a9b5[_0xfdca('0x31')]=_0x79a9b5[_0xfdca('0x31')][_0xfdca('0x34')]?_0x79a9b5['attributes']:_0xbbd229[_0xfdca('0x2e')];if(_0x1e10d4[_0xfdca('0x2f')][_0xfdca('0x40')]){_0x79a9b5['include']=[{'all':!![]}];}_0x79a9b5=_[_0xfdca('0x3d')]({},_0x79a9b5,_0x1e10d4['options']);return db[_0xfdca('0x2b')]['find'](_0x79a9b5)[_0xfdca('0x26')](handleEntityNotFound(_0xa7ee19,null))[_0xfdca('0x26')](respondWithResult(_0xa7ee19,null))[_0xfdca('0x44')](handleError(_0xa7ee19,null));};exports[_0xfdca('0x47')]=function(_0xad3800,_0x2349a4){return db['FreshdeskConfiguration'][_0xfdca('0x47')](_0xad3800['body'],{})[_0xfdca('0x26')](respondWithResult(_0x2349a4,0xc9))[_0xfdca('0x44')](handleError(_0x2349a4,null));};exports['update']=function(_0x5684ba,_0x575dc6){if(_0x5684ba[_0xfdca('0x48')]['id']){delete _0x5684ba[_0xfdca('0x48')]['id'];}return db['FreshdeskConfiguration'][_0xfdca('0x49')]({'where':{'id':_0x5684ba[_0xfdca('0x4a')]['id']}})[_0xfdca('0x26')](handleEntityNotFound(_0x575dc6,null))[_0xfdca('0x26')](saveUpdates(_0x5684ba[_0xfdca('0x48')],null))[_0xfdca('0x26')](respondWithResult(_0x575dc6,null))['catch'](handleError(_0x575dc6,null));};exports[_0xfdca('0x4b')]=function(_0x1884d6,_0x1541d6){return db[_0xfdca('0x2b')][_0xfdca('0x49')]({'where':{'id':_0x1884d6['params']['id']}})[_0xfdca('0x26')](handleEntityNotFound(_0x1541d6,null))[_0xfdca('0x26')](removeEntity(_0x1541d6,null))[_0xfdca('0x44')](handleError(_0x1541d6,null));};exports['getFields']=function(_0x151e7b,_0x32a64c,_0x314ad1){var _0x2507cf={};var _0x2b2257={};var _0x29c1f7;var _0x3fd1bc;return db[_0xfdca('0x2b')][_0xfdca('0x4c')]({'where':{'id':_0x151e7b['params']['id']}})[_0xfdca('0x26')](handleEntityNotFound(_0x32a64c,null))[_0xfdca('0x26')](function(_0x97f9c3){if(_0x97f9c3){_0x29c1f7=_0x97f9c3;_0x2b2257[_0xfdca('0x2e')]=_[_0xfdca('0x30')](db['FreshdeskField'][_0xfdca('0x46')]);_0x2b2257[_0xfdca('0x2f')]=_[_0xfdca('0x30')](_0x151e7b['query']);_0x2b2257['filters']=_['intersection'](_0x2b2257[_0xfdca('0x2e')],_0x2b2257[_0xfdca('0x2f')]);_0x2507cf['attributes']=_[_0xfdca('0x32')](_0x2b2257[_0xfdca('0x2e')],qs[_0xfdca('0x33')](_0x151e7b['query'][_0xfdca('0x33')]));_0x2507cf[_0xfdca('0x31')]=_0x2507cf[_0xfdca('0x31')]['length']?_0x2507cf[_0xfdca('0x31')]:_0x2b2257[_0xfdca('0x2e')];_0x2507cf[_0xfdca('0x37')]=qs[_0xfdca('0x38')](_0x151e7b[_0xfdca('0x2f')]['sort']);_0x2507cf['where']=qs[_0xfdca('0x3a')](_[_0xfdca('0x3b')](_0x151e7b[_0xfdca('0x2f')],_0x2b2257[_0xfdca('0x3a')]));if(_0x151e7b[_0xfdca('0x2f')][_0xfdca('0x3c')]){_0x2507cf['where']=_[_0xfdca('0x3d')](_0x2507cf[_0xfdca('0x39')],{'$or':_[_0xfdca('0x2a')](_0x2507cf[_0xfdca('0x31')],function(_0xca18f7){var _0x9a44ab={};_0x9a44ab[_0xca18f7]={'$like':'%'+_0x151e7b[_0xfdca('0x2f')][_0xfdca('0x3c')]+'%'};return _0x9a44ab;})});}_0x2507cf=_[_0xfdca('0x3d')]({},_0x2507cf,_0x151e7b[_0xfdca('0x3f')]);return _0x29c1f7['getFields'](_0x2507cf);}})[_0xfdca('0x26')](function(_0x112c24){if(_0x112c24){_0x3fd1bc=_0x112c24[_0xfdca('0x34')];if(!_0x151e7b['query']['hasOwnProperty'](_0xfdca('0x36'))){_0x2507cf[_0xfdca('0x1c')]=qs[_0xfdca('0x1c')](_0x151e7b[_0xfdca('0x2f')]['limit']);_0x2507cf['offset']=qs[_0xfdca('0x1e')](_0x151e7b['query'][_0xfdca('0x1e')]);}return _0x29c1f7['getFields'](_0x2507cf);}})[_0xfdca('0x26')](function(_0x3f00f3){if(_0x3f00f3){return _0x3f00f3?{'count':_0x3fd1bc,'rows':_0x3f00f3}:null;}})[_0xfdca('0x26')](respondWithResult(_0x32a64c,null))[_0xfdca('0x44')](handleError(_0x32a64c,null));};exports[_0xfdca('0x4d')]=function(_0x22c244,_0x30cf4b,_0x4f1b8c){var _0x51ec26={};var _0x260b07={};var _0x1e3bc8;var _0x1bcec2;return db[_0xfdca('0x2b')][_0xfdca('0x4c')]({'where':{'id':_0x22c244[_0xfdca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x30cf4b,null))[_0xfdca('0x26')](function(_0x200d7e){if(_0x200d7e){_0x1e3bc8=_0x200d7e;_0x260b07['model']=_[_0xfdca('0x30')](db[_0xfdca('0x4e')][_0xfdca('0x46')]);_0x260b07[_0xfdca('0x2f')]=_[_0xfdca('0x30')](_0x22c244[_0xfdca('0x2f')]);_0x260b07[_0xfdca('0x3a')]=_['intersection'](_0x260b07[_0xfdca('0x2e')],_0x260b07[_0xfdca('0x2f')]);_0x51ec26['attributes']=_['intersection'](_0x260b07[_0xfdca('0x2e')],qs[_0xfdca('0x33')](_0x22c244['query'][_0xfdca('0x33')]));_0x51ec26[_0xfdca('0x31')]=_0x51ec26[_0xfdca('0x31')][_0xfdca('0x34')]?_0x51ec26[_0xfdca('0x31')]:_0x260b07['model'];_0x51ec26[_0xfdca('0x37')]=qs['sort'](_0x22c244[_0xfdca('0x2f')][_0xfdca('0x38')]);_0x51ec26[_0xfdca('0x39')]=qs['filters'](_[_0xfdca('0x3b')](_0x22c244[_0xfdca('0x2f')],_0x260b07[_0xfdca('0x3a')]));if(_0x22c244['query'][_0xfdca('0x3c')]){_0x51ec26[_0xfdca('0x39')]=_[_0xfdca('0x3d')](_0x51ec26['where'],{'$or':_['map'](_0x51ec26['attributes'],function(_0x30e677){var _0x3ee0d5={};_0x3ee0d5[_0x30e677]={'$like':'%'+_0x22c244[_0xfdca('0x2f')][_0xfdca('0x3c')]+'%'};return _0x3ee0d5;})});}_0x51ec26=_[_0xfdca('0x3d')]({},_0x51ec26,_0x22c244[_0xfdca('0x3f')]);return _0x1e3bc8[_0xfdca('0x4d')](_0x51ec26);}})[_0xfdca('0x26')](function(_0x3b9caa){if(_0x3b9caa){_0x1bcec2=_0x3b9caa['length'];if(!_0x22c244[_0xfdca('0x2f')][_0xfdca('0x35')](_0xfdca('0x36'))){_0x51ec26['limit']=qs['limit'](_0x22c244[_0xfdca('0x2f')][_0xfdca('0x1c')]);_0x51ec26['offset']=qs[_0xfdca('0x1e')](_0x22c244[_0xfdca('0x2f')][_0xfdca('0x1e')]);}return _0x1e3bc8[_0xfdca('0x4d')](_0x51ec26);}})['then'](function(_0x582b92){if(_0x582b92){return _0x582b92?{'count':_0x1bcec2,'rows':_0x582b92}:null;}})[_0xfdca('0x26')](respondWithResult(_0x30cf4b,null))['catch'](handleError(_0x30cf4b,null));};exports[_0xfdca('0x4f')]=function(_0x49fab4,_0x13e44d,_0x22df77){var _0x447002={};var _0x51611a={};var _0x1afac0;var _0x36844d;return db[_0xfdca('0x2b')][_0xfdca('0x4c')]({'where':{'id':_0x49fab4[_0xfdca('0x4a')]['id']}})[_0xfdca('0x26')](handleEntityNotFound(_0x13e44d,null))['then'](function(_0x30f1c5){if(_0x30f1c5){_0x1afac0=_0x30f1c5;_0x51611a[_0xfdca('0x2e')]=_['keys'](db[_0xfdca('0x4e')][_0xfdca('0x46')]);_0x51611a[_0xfdca('0x2f')]=_[_0xfdca('0x30')](_0x49fab4[_0xfdca('0x2f')]);_0x51611a[_0xfdca('0x3a')]=_['intersection'](_0x51611a[_0xfdca('0x2e')],_0x51611a[_0xfdca('0x2f')]);_0x447002[_0xfdca('0x31')]=_[_0xfdca('0x32')](_0x51611a['model'],qs[_0xfdca('0x33')](_0x49fab4[_0xfdca('0x2f')][_0xfdca('0x33')]));_0x447002['attributes']=_0x447002[_0xfdca('0x31')][_0xfdca('0x34')]?_0x447002[_0xfdca('0x31')]:_0x51611a[_0xfdca('0x2e')];_0x447002[_0xfdca('0x37')]=qs[_0xfdca('0x38')](_0x49fab4[_0xfdca('0x2f')][_0xfdca('0x38')]);_0x447002[_0xfdca('0x39')]=qs[_0xfdca('0x3a')](_[_0xfdca('0x3b')](_0x49fab4['query'],_0x51611a['filters']));if(_0x49fab4['query']['filter']){_0x447002[_0xfdca('0x39')]=_[_0xfdca('0x3d')](_0x447002['where'],{'$or':_['map'](_0x447002[_0xfdca('0x31')],function(_0x2b1510){var _0x5f36c6={};_0x5f36c6[_0x2b1510]={'$like':'%'+_0x49fab4[_0xfdca('0x2f')][_0xfdca('0x3c')]+'%'};return _0x5f36c6;})});}_0x447002=_[_0xfdca('0x3d')]({},_0x447002,_0x49fab4[_0xfdca('0x3f')]);return _0x1afac0[_0xfdca('0x4f')](_0x447002);}})['then'](function(_0x1edd91){if(_0x1edd91){_0x36844d=_0x1edd91[_0xfdca('0x34')];if(!_0x49fab4['query']['hasOwnProperty'](_0xfdca('0x36'))){_0x447002['limit']=qs[_0xfdca('0x1c')](_0x49fab4[_0xfdca('0x2f')][_0xfdca('0x1c')]);_0x447002[_0xfdca('0x1e')]=qs[_0xfdca('0x1e')](_0x49fab4[_0xfdca('0x2f')][_0xfdca('0x1e')]);}return _0x1afac0[_0xfdca('0x4f')](_0x447002);}})['then'](function(_0x4e64a6){if(_0x4e64a6){return _0x4e64a6?{'count':_0x36844d,'rows':_0x4e64a6}:null;}})[_0xfdca('0x26')](respondWithResult(_0x13e44d,null))[_0xfdca('0x44')](handleError(_0x13e44d,null));};exports[_0xfdca('0x50')]=function(_0x54f96d,_0x4dab11,_0x7b9f56){var _0x180eb8={};var _0x4b24f2={};var _0x1853b3;var _0x53c056;return db[_0xfdca('0x2b')][_0xfdca('0x4c')]({'where':{'id':_0x54f96d[_0xfdca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4dab11,null))['then'](function(_0x4a3bdc){if(_0x4a3bdc){_0x1853b3=_0x4a3bdc;_0x4b24f2[_0xfdca('0x2e')]=_[_0xfdca('0x30')](db[_0xfdca('0x51')]['rawAttributes']);_0x4b24f2[_0xfdca('0x2f')]=_[_0xfdca('0x30')](_0x54f96d[_0xfdca('0x2f')]);_0x4b24f2[_0xfdca('0x3a')]=_[_0xfdca('0x32')](_0x4b24f2[_0xfdca('0x2e')],_0x4b24f2['query']);_0x180eb8[_0xfdca('0x31')]=_[_0xfdca('0x32')](_0x4b24f2['model'],qs[_0xfdca('0x33')](_0x54f96d[_0xfdca('0x2f')]['fields']));_0x180eb8['attributes']=_0x180eb8['attributes'][_0xfdca('0x34')]?_0x180eb8[_0xfdca('0x31')]:_0x4b24f2[_0xfdca('0x2e')];_0x180eb8[_0xfdca('0x37')]=qs[_0xfdca('0x38')](_0x54f96d[_0xfdca('0x2f')][_0xfdca('0x38')]);_0x180eb8[_0xfdca('0x39')]=qs[_0xfdca('0x3a')](_[_0xfdca('0x3b')](_0x54f96d[_0xfdca('0x2f')],_0x4b24f2[_0xfdca('0x3a')]));if(_0x54f96d[_0xfdca('0x2f')][_0xfdca('0x3c')]){_0x180eb8[_0xfdca('0x39')]=_[_0xfdca('0x3d')](_0x180eb8[_0xfdca('0x39')],{'$or':_[_0xfdca('0x2a')](_0x180eb8[_0xfdca('0x31')],function(_0x1e6e4f){var _0x2f91e2={};_0x2f91e2[_0x1e6e4f]={'$like':'%'+_0x54f96d[_0xfdca('0x2f')][_0xfdca('0x3c')]+'%'};return _0x2f91e2;})});}_0x180eb8=_[_0xfdca('0x3d')]({},_0x180eb8,_0x54f96d[_0xfdca('0x3f')]);return _0x1853b3[_0xfdca('0x50')](_0x180eb8);}})['then'](function(_0xb51c4e){if(_0xb51c4e){_0x53c056=_0xb51c4e[_0xfdca('0x34')];if(!_0x54f96d['query'][_0xfdca('0x35')](_0xfdca('0x36'))){_0x180eb8[_0xfdca('0x1c')]=qs[_0xfdca('0x1c')](_0x54f96d[_0xfdca('0x2f')][_0xfdca('0x1c')]);_0x180eb8['offset']=qs[_0xfdca('0x1e')](_0x54f96d[_0xfdca('0x2f')][_0xfdca('0x1e')]);}return _0x1853b3['getTags'](_0x180eb8);}})[_0xfdca('0x26')](function(_0x5d31e1){if(_0x5d31e1){return _0x5d31e1?{'count':_0x53c056,'rows':_0x5d31e1}:null;}})[_0xfdca('0x26')](respondWithResult(_0x4dab11,null))[_0xfdca('0x44')](handleError(_0x4dab11,null));};exports[_0xfdca('0x52')]=function(_0x15b45f,_0x365b85,_0x18b411){if(_0x15b45f['body']['id']){delete _0x15b45f['body']['id'];}return db[_0xfdca('0x2b')][_0xfdca('0x4c')]({'where':{'id':_0x15b45f['params']['id']}})[_0xfdca('0x26')](handleEntityNotFound(_0x365b85,null))[_0xfdca('0x26')](function(_0x40d272){if(_0x40d272){return _0x40d272[_0xfdca('0x52')](_0x15b45f[_0xfdca('0x48')]['ids']||[]);}return null;})[_0xfdca('0x26')](respondWithResult(_0x365b85,null))['catch'](handleError(_0x365b85,null));}; \ No newline at end of file +var _0x93e0=['merge','options','include','rows','catch','show','keys','includeAll','create','update','body','find','params','destroy','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL'];(function(_0x51b7f7,_0x2b20f0){var _0x332742=function(_0x7fc190){while(--_0x7fc190){_0x51b7f7['push'](_0x51b7f7['shift']());}};_0x332742(++_0x2b20f0);}(_0x93e0,0xbc));var _0x093e=function(_0x37e8ba,_0x2134ea){_0x37e8ba=_0x37e8ba-0x0;var _0xf3f1ea=_0x93e0[_0x37e8ba];return _0xf3f1ea;};'use strict';var emlformat=require(_0x093e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x093e('0x1'));var rp=require(_0x093e('0x2'));var moment=require('moment');var BPromise=require(_0x093e('0x3'));var Mustache=require(_0x093e('0x4'));var util=require(_0x093e('0x5'));var path=require(_0x093e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x093e('0x7'));var fs=require('fs');var fs_extra=require(_0x093e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x093e('0x9'));var deskjs=require(_0x093e('0xa'));var toCsv=require(_0x093e('0xb'));var querystring=require(_0x093e('0xc'));var Papa=require(_0x093e('0xd'));var Redis=require(_0x093e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x093e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x093e('0x10'))(_0x093e('0x11'));var utils=require(_0x093e('0x12'));var config=require(_0x093e('0x13'));var licenseUtil=require(_0x093e('0x14'));var db=require(_0x093e('0x15'))['db'];function respondWithStatusCode(_0xeee2e8,_0x29d7f1){_0x29d7f1=_0x29d7f1||0xcc;return function(_0x1c92c9){if(_0x1c92c9){return _0xeee2e8[_0x093e('0x16')](_0x29d7f1);}return _0xeee2e8['status'](_0x29d7f1)[_0x093e('0x17')]();};}function respondWithResult(_0x2d6624,_0x4ba7da){_0x4ba7da=_0x4ba7da||0xc8;return function(_0x5c150b){if(_0x5c150b){return _0x2d6624[_0x093e('0x18')](_0x4ba7da)[_0x093e('0x19')](_0x5c150b);}};}function respondWithFilteredResult(_0x50c314,_0x9f7b09){return function(_0x3941be){if(_0x3941be){var _0x3d8f31=typeof _0x9f7b09[_0x093e('0x1a')]===_0x093e('0x1b')&&typeof _0x9f7b09[_0x093e('0x1c')]===_0x093e('0x1b');var _0x1675d8=_0x3941be['count'];var _0x103e38=_0x3d8f31?0x0:_0x9f7b09[_0x093e('0x1a')];var _0x586219=_0x3d8f31?_0x3941be[_0x093e('0x1d')]:_0x9f7b09['offset']+_0x9f7b09[_0x093e('0x1c')];var _0x543c65;if(_0x586219>=_0x1675d8){_0x586219=_0x1675d8;_0x543c65=0xc8;}else{_0x543c65=0xce;}_0x50c314[_0x093e('0x18')](_0x543c65);return _0x50c314[_0x093e('0x1e')](_0x093e('0x1f'),_0x103e38+'-'+_0x586219+'/'+_0x1675d8)['json'](_0x3941be);}return null;};}function patchUpdates(_0x501140){return function(_0x1e4445){try{jsonpatch[_0x093e('0x20')](_0x1e4445,_0x501140,!![]);}catch(_0x73bbba){return BPromise[_0x093e('0x21')](_0x73bbba);}return _0x1e4445['save']();};}function saveUpdates(_0x2648f8,_0x4d85ec){return function(_0x29ff10){if(_0x29ff10){return _0x29ff10['update'](_0x2648f8)[_0x093e('0x22')](function(_0x1261ac){return _0x1261ac;});}return null;};}function removeEntity(_0x2f7972,_0x2e75f9){return function(_0x4e8741){if(_0x4e8741){return _0x4e8741['destroy']()[_0x093e('0x22')](function(){_0x2f7972[_0x093e('0x18')](0xcc)[_0x093e('0x17')]();});}};}function handleEntityNotFound(_0x2c75db,_0x3c4c4c){return function(_0x22882a){if(!_0x22882a){_0x2c75db[_0x093e('0x16')](0x194);}return _0x22882a;};}function handleError(_0x21ac5a,_0x496418){_0x496418=_0x496418||0x1f4;return function(_0x3994b3){logger[_0x093e('0x23')](_0x3994b3[_0x093e('0x24')]);if(_0x3994b3['name']){delete _0x3994b3['name'];}_0x21ac5a[_0x093e('0x18')](_0x496418)['send'](_0x3994b3);};}exports[_0x093e('0x25')]=function(_0x6c4603,_0x3d8262){var _0x2ea632={},_0x47ee6a={},_0x23fe20={'count':0x0,'rows':[]};var _0x2c2272=_[_0x093e('0x26')](db[_0x093e('0x27')][_0x093e('0x28')],function(_0x3b0534){return{'name':_0x3b0534['fieldName'],'type':_0x3b0534[_0x093e('0x29')][_0x093e('0x2a')]};});_0x47ee6a[_0x093e('0x2b')]=_[_0x093e('0x26')](_0x2c2272,_0x093e('0x2c'));_0x47ee6a[_0x093e('0x2d')]=_['keys'](_0x6c4603[_0x093e('0x2d')]);_0x47ee6a[_0x093e('0x2e')]=_[_0x093e('0x2f')](_0x47ee6a['model'],_0x47ee6a[_0x093e('0x2d')]);_0x2ea632[_0x093e('0x30')]=_['intersection'](_0x47ee6a[_0x093e('0x2b')],qs[_0x093e('0x31')](_0x6c4603[_0x093e('0x2d')]['fields']));_0x2ea632[_0x093e('0x30')]=_0x2ea632[_0x093e('0x30')][_0x093e('0x32')]?_0x2ea632[_0x093e('0x30')]:_0x47ee6a[_0x093e('0x2b')];if(!_0x6c4603[_0x093e('0x2d')][_0x093e('0x33')](_0x093e('0x34'))){_0x2ea632[_0x093e('0x1c')]=qs[_0x093e('0x1c')](_0x6c4603['query'][_0x093e('0x1c')]);_0x2ea632[_0x093e('0x1a')]=qs['offset'](_0x6c4603[_0x093e('0x2d')][_0x093e('0x1a')]);}_0x2ea632['order']=qs['sort'](_0x6c4603[_0x093e('0x2d')][_0x093e('0x35')]);_0x2ea632[_0x093e('0x36')]=qs[_0x093e('0x2e')](_[_0x093e('0x37')](_0x6c4603[_0x093e('0x2d')],_0x47ee6a[_0x093e('0x2e')]),_0x2c2272);if(_0x6c4603[_0x093e('0x2d')][_0x093e('0x38')]){_0x2ea632[_0x093e('0x36')]=_['merge'](_0x2ea632['where'],{'$or':_['map'](_0x2c2272,function(_0x17c06e){if(_0x17c06e[_0x093e('0x29')]!==_0x093e('0x39')){var _0x874735={};_0x874735[_0x17c06e[_0x093e('0x2c')]]={'$like':'%'+_0x6c4603[_0x093e('0x2d')][_0x093e('0x38')]+'%'};return _0x874735;}})});}_0x2ea632=_[_0x093e('0x3a')]({},_0x2ea632,_0x6c4603[_0x093e('0x3b')]);var _0x59c59d={'where':_0x2ea632[_0x093e('0x36')]};return db[_0x093e('0x27')][_0x093e('0x1d')](_0x59c59d)[_0x093e('0x22')](function(_0x5e17b5){_0x23fe20[_0x093e('0x1d')]=_0x5e17b5;if(_0x6c4603[_0x093e('0x2d')]['includeAll']){_0x2ea632[_0x093e('0x3c')]=[{'all':!![]}];}return db[_0x093e('0x27')]['findAll'](_0x2ea632);})[_0x093e('0x22')](function(_0x2207ff){_0x23fe20[_0x093e('0x3d')]=_0x2207ff;return _0x23fe20;})[_0x093e('0x22')](respondWithFilteredResult(_0x3d8262,_0x2ea632))[_0x093e('0x3e')](handleError(_0x3d8262,null));};exports[_0x093e('0x3f')]=function(_0x2a0d27,_0x41bf4e){var _0x32b7ef={'raw':![],'where':{'id':_0x2a0d27['params']['id']}},_0x25ab54={};_0x25ab54[_0x093e('0x2b')]=_[_0x093e('0x40')](db[_0x093e('0x27')][_0x093e('0x28')]);_0x25ab54[_0x093e('0x2d')]=_['keys'](_0x2a0d27[_0x093e('0x2d')]);_0x25ab54[_0x093e('0x2e')]=_[_0x093e('0x2f')](_0x25ab54['model'],_0x25ab54[_0x093e('0x2d')]);_0x32b7ef[_0x093e('0x30')]=_['intersection'](_0x25ab54['model'],qs[_0x093e('0x31')](_0x2a0d27[_0x093e('0x2d')][_0x093e('0x31')]));_0x32b7ef[_0x093e('0x30')]=_0x32b7ef[_0x093e('0x30')]['length']?_0x32b7ef[_0x093e('0x30')]:_0x25ab54[_0x093e('0x2b')];if(_0x2a0d27['query'][_0x093e('0x41')]){_0x32b7ef['include']=[{'all':!![]}];}_0x32b7ef=_[_0x093e('0x3a')]({},_0x32b7ef,_0x2a0d27[_0x093e('0x3b')]);return db[_0x093e('0x27')]['find'](_0x32b7ef)[_0x093e('0x22')](handleEntityNotFound(_0x41bf4e,null))[_0x093e('0x22')](respondWithResult(_0x41bf4e,null))[_0x093e('0x3e')](handleError(_0x41bf4e,null));};exports[_0x093e('0x42')]=function(_0x2b8354,_0x3342c0){return db['FreshdeskConfiguration']['create'](_0x2b8354['body'],{})[_0x093e('0x22')](respondWithResult(_0x3342c0,0xc9))[_0x093e('0x3e')](handleError(_0x3342c0,null));};exports[_0x093e('0x43')]=function(_0x118f8e,_0x5b615f){if(_0x118f8e[_0x093e('0x44')]['id']){delete _0x118f8e[_0x093e('0x44')]['id'];}return db[_0x093e('0x27')][_0x093e('0x45')]({'where':{'id':_0x118f8e[_0x093e('0x46')]['id']}})[_0x093e('0x22')](handleEntityNotFound(_0x5b615f,null))[_0x093e('0x22')](saveUpdates(_0x118f8e[_0x093e('0x44')],null))[_0x093e('0x22')](respondWithResult(_0x5b615f,null))[_0x093e('0x3e')](handleError(_0x5b615f,null));};exports[_0x093e('0x47')]=function(_0x25c971,_0x49365a){return db[_0x093e('0x27')][_0x093e('0x45')]({'where':{'id':_0x25c971[_0x093e('0x46')]['id']}})[_0x093e('0x22')](handleEntityNotFound(_0x49365a,null))[_0x093e('0x22')](removeEntity(_0x49365a,null))[_0x093e('0x3e')](handleError(_0x49365a,null));};exports['getFields']=function(_0x56606e,_0xde1420,_0x50ef72){var _0x26000f={};var _0x5bdf44={};var _0x40f7cc;var _0x49dbdf;return db[_0x093e('0x27')][_0x093e('0x48')]({'where':{'id':_0x56606e[_0x093e('0x46')]['id']}})['then'](handleEntityNotFound(_0xde1420,null))['then'](function(_0x341503){if(_0x341503){_0x40f7cc=_0x341503;_0x5bdf44[_0x093e('0x2b')]=_[_0x093e('0x40')](db[_0x093e('0x49')]['rawAttributes']);_0x5bdf44['query']=_[_0x093e('0x40')](_0x56606e[_0x093e('0x2d')]);_0x5bdf44[_0x093e('0x2e')]=_[_0x093e('0x2f')](_0x5bdf44[_0x093e('0x2b')],_0x5bdf44[_0x093e('0x2d')]);_0x26000f[_0x093e('0x30')]=_[_0x093e('0x2f')](_0x5bdf44['model'],qs[_0x093e('0x31')](_0x56606e[_0x093e('0x2d')][_0x093e('0x31')]));_0x26000f[_0x093e('0x30')]=_0x26000f[_0x093e('0x30')]['length']?_0x26000f[_0x093e('0x30')]:_0x5bdf44[_0x093e('0x2b')];_0x26000f[_0x093e('0x4a')]=qs[_0x093e('0x35')](_0x56606e[_0x093e('0x2d')][_0x093e('0x35')]);_0x26000f[_0x093e('0x36')]=qs[_0x093e('0x2e')](_['pick'](_0x56606e[_0x093e('0x2d')],_0x5bdf44[_0x093e('0x2e')]));if(_0x56606e[_0x093e('0x2d')][_0x093e('0x38')]){_0x26000f[_0x093e('0x36')]=_['merge'](_0x26000f[_0x093e('0x36')],{'$or':_[_0x093e('0x26')](_0x26000f['attributes'],function(_0x59ef4e){var _0x25405c={};_0x25405c[_0x59ef4e]={'$like':'%'+_0x56606e[_0x093e('0x2d')][_0x093e('0x38')]+'%'};return _0x25405c;})});}_0x26000f=_['merge']({},_0x26000f,_0x56606e['options']);return _0x40f7cc[_0x093e('0x4b')](_0x26000f);}})[_0x093e('0x22')](function(_0x1fe2ef){if(_0x1fe2ef){_0x49dbdf=_0x1fe2ef[_0x093e('0x32')];if(!_0x56606e[_0x093e('0x2d')][_0x093e('0x33')](_0x093e('0x34'))){_0x26000f[_0x093e('0x1c')]=qs['limit'](_0x56606e[_0x093e('0x2d')][_0x093e('0x1c')]);_0x26000f[_0x093e('0x1a')]=qs[_0x093e('0x1a')](_0x56606e[_0x093e('0x2d')][_0x093e('0x1a')]);}return _0x40f7cc[_0x093e('0x4b')](_0x26000f);}})['then'](function(_0x3e63fb){if(_0x3e63fb){return _0x3e63fb?{'count':_0x49dbdf,'rows':_0x3e63fb}:null;}})[_0x093e('0x22')](respondWithResult(_0xde1420,null))[_0x093e('0x3e')](handleError(_0xde1420,null));};exports[_0x093e('0x4c')]=function(_0x4019b2,_0x34b141,_0x251ebd){var _0x49264e={};var _0x2a84e4={};var _0x12e28b;var _0x23dfd6;return db[_0x093e('0x27')]['findOne']({'where':{'id':_0x4019b2[_0x093e('0x46')]['id']}})[_0x093e('0x22')](handleEntityNotFound(_0x34b141,null))[_0x093e('0x22')](function(_0x74561d){if(_0x74561d){_0x12e28b=_0x74561d;_0x2a84e4[_0x093e('0x2b')]=_[_0x093e('0x40')](db[_0x093e('0x49')][_0x093e('0x28')]);_0x2a84e4['query']=_[_0x093e('0x40')](_0x4019b2['query']);_0x2a84e4[_0x093e('0x2e')]=_[_0x093e('0x2f')](_0x2a84e4['model'],_0x2a84e4[_0x093e('0x2d')]);_0x49264e[_0x093e('0x30')]=_[_0x093e('0x2f')](_0x2a84e4[_0x093e('0x2b')],qs[_0x093e('0x31')](_0x4019b2[_0x093e('0x2d')][_0x093e('0x31')]));_0x49264e[_0x093e('0x30')]=_0x49264e[_0x093e('0x30')][_0x093e('0x32')]?_0x49264e[_0x093e('0x30')]:_0x2a84e4[_0x093e('0x2b')];_0x49264e[_0x093e('0x4a')]=qs[_0x093e('0x35')](_0x4019b2[_0x093e('0x2d')]['sort']);_0x49264e['where']=qs['filters'](_[_0x093e('0x37')](_0x4019b2[_0x093e('0x2d')],_0x2a84e4['filters']));if(_0x4019b2['query'][_0x093e('0x38')]){_0x49264e['where']=_['merge'](_0x49264e['where'],{'$or':_['map'](_0x49264e[_0x093e('0x30')],function(_0x29b4b0){var _0x557367={};_0x557367[_0x29b4b0]={'$like':'%'+_0x4019b2[_0x093e('0x2d')][_0x093e('0x38')]+'%'};return _0x557367;})});}_0x49264e=_[_0x093e('0x3a')]({},_0x49264e,_0x4019b2[_0x093e('0x3b')]);return _0x12e28b[_0x093e('0x4c')](_0x49264e);}})[_0x093e('0x22')](function(_0x1823ca){if(_0x1823ca){_0x23dfd6=_0x1823ca[_0x093e('0x32')];if(!_0x4019b2[_0x093e('0x2d')][_0x093e('0x33')](_0x093e('0x34'))){_0x49264e[_0x093e('0x1c')]=qs[_0x093e('0x1c')](_0x4019b2[_0x093e('0x2d')][_0x093e('0x1c')]);_0x49264e['offset']=qs[_0x093e('0x1a')](_0x4019b2[_0x093e('0x2d')][_0x093e('0x1a')]);}return _0x12e28b[_0x093e('0x4c')](_0x49264e);}})['then'](function(_0x13c12a){if(_0x13c12a){return _0x13c12a?{'count':_0x23dfd6,'rows':_0x13c12a}:null;}})[_0x093e('0x22')](respondWithResult(_0x34b141,null))['catch'](handleError(_0x34b141,null));};exports[_0x093e('0x4d')]=function(_0x2fb90c,_0x1bf2a4,_0x38f01f){var _0x4e1361={};var _0x5a4fc6={};var _0x425774;var _0x7d964e;return db[_0x093e('0x27')][_0x093e('0x48')]({'where':{'id':_0x2fb90c[_0x093e('0x46')]['id']}})[_0x093e('0x22')](handleEntityNotFound(_0x1bf2a4,null))[_0x093e('0x22')](function(_0x1cd701){if(_0x1cd701){_0x425774=_0x1cd701;_0x5a4fc6[_0x093e('0x2b')]=_[_0x093e('0x40')](db['FreshdeskField']['rawAttributes']);_0x5a4fc6[_0x093e('0x2d')]=_[_0x093e('0x40')](_0x2fb90c[_0x093e('0x2d')]);_0x5a4fc6[_0x093e('0x2e')]=_[_0x093e('0x2f')](_0x5a4fc6['model'],_0x5a4fc6[_0x093e('0x2d')]);_0x4e1361['attributes']=_[_0x093e('0x2f')](_0x5a4fc6[_0x093e('0x2b')],qs[_0x093e('0x31')](_0x2fb90c[_0x093e('0x2d')][_0x093e('0x31')]));_0x4e1361['attributes']=_0x4e1361[_0x093e('0x30')][_0x093e('0x32')]?_0x4e1361['attributes']:_0x5a4fc6[_0x093e('0x2b')];_0x4e1361['order']=qs[_0x093e('0x35')](_0x2fb90c[_0x093e('0x2d')][_0x093e('0x35')]);_0x4e1361[_0x093e('0x36')]=qs[_0x093e('0x2e')](_[_0x093e('0x37')](_0x2fb90c[_0x093e('0x2d')],_0x5a4fc6['filters']));if(_0x2fb90c[_0x093e('0x2d')]['filter']){_0x4e1361[_0x093e('0x36')]=_[_0x093e('0x3a')](_0x4e1361[_0x093e('0x36')],{'$or':_[_0x093e('0x26')](_0x4e1361[_0x093e('0x30')],function(_0x4175e1){var _0x516072={};_0x516072[_0x4175e1]={'$like':'%'+_0x2fb90c[_0x093e('0x2d')][_0x093e('0x38')]+'%'};return _0x516072;})});}_0x4e1361=_[_0x093e('0x3a')]({},_0x4e1361,_0x2fb90c[_0x093e('0x3b')]);return _0x425774['getDescriptions'](_0x4e1361);}})[_0x093e('0x22')](function(_0x1ee274){if(_0x1ee274){_0x7d964e=_0x1ee274[_0x093e('0x32')];if(!_0x2fb90c[_0x093e('0x2d')][_0x093e('0x33')](_0x093e('0x34'))){_0x4e1361[_0x093e('0x1c')]=qs['limit'](_0x2fb90c[_0x093e('0x2d')][_0x093e('0x1c')]);_0x4e1361[_0x093e('0x1a')]=qs['offset'](_0x2fb90c[_0x093e('0x2d')][_0x093e('0x1a')]);}return _0x425774[_0x093e('0x4d')](_0x4e1361);}})['then'](function(_0x342629){if(_0x342629){return _0x342629?{'count':_0x7d964e,'rows':_0x342629}:null;}})[_0x093e('0x22')](respondWithResult(_0x1bf2a4,null))[_0x093e('0x3e')](handleError(_0x1bf2a4,null));};exports[_0x093e('0x4e')]=function(_0x1922b2,_0xc6f582,_0x343cad){var _0x83f803={};var _0x24ffdb={};var _0x2414b6;var _0x36d19b;return db['FreshdeskConfiguration'][_0x093e('0x48')]({'where':{'id':_0x1922b2[_0x093e('0x46')]['id']}})[_0x093e('0x22')](handleEntityNotFound(_0xc6f582,null))[_0x093e('0x22')](function(_0x57c039){if(_0x57c039){_0x2414b6=_0x57c039;_0x24ffdb[_0x093e('0x2b')]=_[_0x093e('0x40')](db[_0x093e('0x4f')][_0x093e('0x28')]);_0x24ffdb[_0x093e('0x2d')]=_['keys'](_0x1922b2[_0x093e('0x2d')]);_0x24ffdb[_0x093e('0x2e')]=_[_0x093e('0x2f')](_0x24ffdb[_0x093e('0x2b')],_0x24ffdb[_0x093e('0x2d')]);_0x83f803['attributes']=_[_0x093e('0x2f')](_0x24ffdb[_0x093e('0x2b')],qs[_0x093e('0x31')](_0x1922b2[_0x093e('0x2d')][_0x093e('0x31')]));_0x83f803[_0x093e('0x30')]=_0x83f803[_0x093e('0x30')][_0x093e('0x32')]?_0x83f803['attributes']:_0x24ffdb[_0x093e('0x2b')];_0x83f803[_0x093e('0x4a')]=qs[_0x093e('0x35')](_0x1922b2[_0x093e('0x2d')][_0x093e('0x35')]);_0x83f803[_0x093e('0x36')]=qs[_0x093e('0x2e')](_[_0x093e('0x37')](_0x1922b2[_0x093e('0x2d')],_0x24ffdb[_0x093e('0x2e')]));if(_0x1922b2[_0x093e('0x2d')]['filter']){_0x83f803['where']=_['merge'](_0x83f803[_0x093e('0x36')],{'$or':_[_0x093e('0x26')](_0x83f803['attributes'],function(_0x2ed0f9){var _0x4d4697={};_0x4d4697[_0x2ed0f9]={'$like':'%'+_0x1922b2['query'][_0x093e('0x38')]+'%'};return _0x4d4697;})});}_0x83f803=_[_0x093e('0x3a')]({},_0x83f803,_0x1922b2[_0x093e('0x3b')]);return _0x2414b6[_0x093e('0x4e')](_0x83f803);}})['then'](function(_0x23ea4c){if(_0x23ea4c){_0x36d19b=_0x23ea4c['length'];if(!_0x1922b2['query'][_0x093e('0x33')](_0x093e('0x34'))){_0x83f803[_0x093e('0x1c')]=qs[_0x093e('0x1c')](_0x1922b2[_0x093e('0x2d')]['limit']);_0x83f803[_0x093e('0x1a')]=qs[_0x093e('0x1a')](_0x1922b2[_0x093e('0x2d')][_0x093e('0x1a')]);}return _0x2414b6['getTags'](_0x83f803);}})[_0x093e('0x22')](function(_0x19f9c9){if(_0x19f9c9){return _0x19f9c9?{'count':_0x36d19b,'rows':_0x19f9c9}:null;}})[_0x093e('0x22')](respondWithResult(_0xc6f582,null))[_0x093e('0x3e')](handleError(_0xc6f582,null));};exports[_0x093e('0x50')]=function(_0xcc3895,_0x4c8c4a,_0x4a3cd1){if(_0xcc3895[_0x093e('0x44')]['id']){delete _0xcc3895['body']['id'];}return db[_0x093e('0x27')][_0x093e('0x48')]({'where':{'id':_0xcc3895['params']['id']}})[_0x093e('0x22')](handleEntityNotFound(_0x4c8c4a,null))[_0x093e('0x22')](function(_0x1a21a7){if(_0x1a21a7){return _0x1a21a7[_0x093e('0x50')](_0xcc3895[_0x093e('0x44')][_0x093e('0x51')]||[]);}return null;})[_0x093e('0x22')](respondWithResult(_0x4c8c4a,null))[_0x093e('0x3e')](handleError(_0x4c8c4a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 826e9fb..a27ed47 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 _0x8ede=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x43ca33,_0x4cc0e5){var _0x35b879=function(_0x56c0be){while(--_0x56c0be){_0x43ca33['push'](_0x43ca33['shift']());}};_0x35b879(++_0x4cc0e5);}(_0x8ede,0x1c8));var _0xe8ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ede[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8ed('0x0'));var util=require(_0xe8ed('0x1'));var logger=require(_0xe8ed('0x2'))(_0xe8ed('0x3'));var moment=require(_0xe8ed('0x4'));var BPromise=require(_0xe8ed('0x5'));var rp=require(_0xe8ed('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8ed('0x7'));var config=require('../../config/environment');var attributes=require(_0xe8ed('0x8'));module['exports']=function(_0x3276c8,_0x235cf2){return _0x3276c8[_0xe8ed('0x9')](_0xe8ed('0xa'),attributes,{'tableName':_0xe8ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc06e=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x53797c,_0x4538b3){var _0x12c092=function(_0x3bf18b){while(--_0x3bf18b){_0x53797c['push'](_0x53797c['shift']());}};_0x12c092(++_0x4538b3);}(_0xc06e,0xa4));var _0xec06=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0xc06e[_0x4191af];return _0x27bebf;};'use strict';var _=require('lodash');var util=require(_0xec06('0x0'));var logger=require(_0xec06('0x1'))(_0xec06('0x2'));var moment=require(_0xec06('0x3'));var BPromise=require('bluebird');var rp=require(_0xec06('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec06('0x5'));var config=require(_0xec06('0x6'));var attributes=require(_0xec06('0x7'));module['exports']=function(_0x135a42,_0x32e421){return _0x135a42[_0xec06('0x8')](_0xec06('0x9'),attributes,{'tableName':_0xec06('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 464725e..9d75ca7 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 _0x1098=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1098,0xef));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8109('0x0'));var util=require(_0x8109('0x1'));var moment=require(_0x8109('0x2'));var BPromise=require(_0x8109('0x3'));var rs=require(_0x8109('0x4'));var fs=require('fs');var Redis=require(_0x8109('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8109('0x6'))(_0x8109('0x7'));var config=require(_0x8109('0x8'));var jayson=require(_0x8109('0x9'));var client=jayson[_0x8109('0xa')][_0x8109('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b3297,_0x552927,_0x4a1464){return new BPromise(function(_0x34ad85,_0x15aa1c){return client[_0x8109('0xc')](_0x3b3297,_0x4a1464)[_0x8109('0xd')](function(_0x322551){logger[_0x8109('0xe')](_0x8109('0xf'),_0x552927,_0x8109('0x10'));logger[_0x8109('0x11')](_0x8109('0x12'),_0x552927,_0x8109('0x10'),JSON['stringify'](_0x322551));if(_0x322551['error']){if(_0x322551[_0x8109('0x13')]['code']===0x1f4){logger[_0x8109('0x13')](_0x8109('0xf'),_0x552927,_0x322551[_0x8109('0x13')][_0x8109('0x14')]);return _0x15aa1c(_0x322551[_0x8109('0x13')][_0x8109('0x14')]);}logger[_0x8109('0x13')](_0x8109('0xf'),_0x552927,_0x322551[_0x8109('0x13')][_0x8109('0x14')]);return _0x34ad85(_0x322551[_0x8109('0x13')][_0x8109('0x14')]);}else{logger[_0x8109('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x552927,'request\x20sent');_0x34ad85(_0x322551['result']['message']);}})['catch'](function(_0x2e80c2){logger[_0x8109('0x13')](_0x8109('0xf'),_0x552927,_0x2e80c2);_0x15aa1c(_0x2e80c2);});});} \ No newline at end of file +var _0xa20d=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x5beac1,_0x25522c){var _0x712848=function(_0x572825){while(--_0x572825){_0x5beac1['push'](_0x5beac1['shift']());}};_0x712848(++_0x25522c);}(_0xa20d,0x69));var _0xda20=function(_0x571848,_0x46d718){_0x571848=_0x571848-0x0;var _0x2ecd36=_0xa20d[_0x571848];return _0x2ecd36;};'use strict';var _=require(_0xda20('0x0'));var util=require(_0xda20('0x1'));var moment=require(_0xda20('0x2'));var BPromise=require('bluebird');var rs=require(_0xda20('0x3'));var fs=require('fs');var Redis=require(_0xda20('0x4'));var db=require(_0xda20('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda20('0x6'));var config=require(_0xda20('0x7'));var jayson=require(_0xda20('0x8'));var client=jayson[_0xda20('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4966f5,_0x48da14,_0x1fd38e){return new BPromise(function(_0x5d09c2,_0x297842){return client[_0xda20('0xa')](_0x4966f5,_0x1fd38e)[_0xda20('0xb')](function(_0x1f2743){logger[_0xda20('0xc')](_0xda20('0xd'),_0x48da14,_0xda20('0xe'));logger[_0xda20('0xf')](_0xda20('0x10'),_0x48da14,'request\x20sent',JSON[_0xda20('0x11')](_0x1f2743));if(_0x1f2743[_0xda20('0x12')]){if(_0x1f2743['error'][_0xda20('0x13')]===0x1f4){logger[_0xda20('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x48da14,_0x1f2743['error']['message']);return _0x297842(_0x1f2743[_0xda20('0x12')]['message']);}logger[_0xda20('0x12')](_0xda20('0xd'),_0x48da14,_0x1f2743[_0xda20('0x12')][_0xda20('0x14')]);return _0x5d09c2(_0x1f2743[_0xda20('0x12')]['message']);}else{logger[_0xda20('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x48da14,_0xda20('0xe'));_0x5d09c2(_0x1f2743['result'][_0xda20('0x14')]);}})[_0xda20('0x15')](function(_0x5c1c56){logger[_0xda20('0x12')](_0xda20('0xd'),_0x48da14,_0x5c1c56);_0x297842(_0x5c1c56);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index eee67d4..f94bb7c 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 _0x9729=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','util'];(function(_0x18fd9e,_0x5b7677){var _0x383dc0=function(_0x1065b2){while(--_0x1065b2){_0x18fd9e['push'](_0x18fd9e['shift']());}};_0x383dc0(++_0x5b7677);}(_0x9729,0x1c1));var _0x9972=function(_0x15a6c0,_0x40e575){_0x15a6c0=_0x15a6c0-0x0;var _0x3b6647=_0x9729[_0x15a6c0];return _0x3b6647;};'use strict';var multer=require('multer');var util=require(_0x9972('0x0'));var path=require('path');var timeout=require(_0x9972('0x1'));var express=require('express');var router=express[_0x9972('0x2')]();var fs_extra=require(_0x9972('0x3'));var auth=require(_0x9972('0x4'));var interaction=require(_0x9972('0x5'));var config=require(_0x9972('0x6'));var controller=require(_0x9972('0x7'));router[_0x9972('0x8')]('/',auth[_0x9972('0x9')](),controller[_0x9972('0xa')]);router[_0x9972('0x8')](_0x9972('0xb'),auth[_0x9972('0x9')](),controller[_0x9972('0xc')]);router[_0x9972('0xd')]('/',auth[_0x9972('0x9')](),controller['create']);router[_0x9972('0xe')](_0x9972('0xb'),auth[_0x9972('0x9')](),controller[_0x9972('0xf')]);router['delete']('/:id',auth[_0x9972('0x9')](),controller[_0x9972('0x10')]);module[_0x9972('0x11')]=router; \ No newline at end of file +var _0xcfa1=['put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','index','/:id','isAuthenticated','show','create'];(function(_0x5aa1e2,_0x2b5adb){var _0x399098=function(_0xb129fb){while(--_0xb129fb){_0x5aa1e2['push'](_0x5aa1e2['shift']());}};_0x399098(++_0x2b5adb);}(_0xcfa1,0x19b));var _0x1cfa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcfa1[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1cfa('0x0'));var util=require(_0x1cfa('0x1'));var path=require(_0x1cfa('0x2'));var timeout=require(_0x1cfa('0x3'));var express=require(_0x1cfa('0x4'));var router=express['Router']();var fs_extra=require(_0x1cfa('0x5'));var auth=require(_0x1cfa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1cfa('0x7'));var controller=require(_0x1cfa('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1cfa('0x9')]);router['get'](_0x1cfa('0xa'),auth[_0x1cfa('0xb')](),controller[_0x1cfa('0xc')]);router['post']('/',auth[_0x1cfa('0xb')](),controller[_0x1cfa('0xd')]);router[_0x1cfa('0xe')](_0x1cfa('0xa'),auth[_0x1cfa('0xb')](),controller['update']);router[_0x1cfa('0xf')](_0x1cfa('0xa'),auth[_0x1cfa('0xb')](),controller['destroy']);module[_0x1cfa('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 2eb4f1a..96a88e7 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 _0x5f9d=['ENUM','string','variable','keyValue','STRING','sequelize','exports'];(function(_0x340cc6,_0x116869){var _0x54f3d9=function(_0x1fa0b8){while(--_0x1fa0b8){_0x340cc6['push'](_0x340cc6['shift']());}};_0x54f3d9(++_0x116869);}(_0x5f9d,0x19b));var _0xd5f9=function(_0x387927,_0x112e47){_0x387927=_0x387927-0x0;var _0x53cc6c=_0x5f9d[_0x387927];return _0x53cc6c;};'use strict';var Sequelize=require(_0xd5f9('0x0'));module[_0xd5f9('0x1')]={'type':{'type':Sequelize[_0xd5f9('0x2')](_0xd5f9('0x3'),_0xd5f9('0x4'),'customVariable',_0xd5f9('0x5'),'picklist'),'defaultValue':_0xd5f9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd5f9('0x6')]},'keyType':{'type':Sequelize[_0xd5f9('0x2')](_0xd5f9('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd5f9('0x6')]},'idField':{'type':Sequelize[_0xd5f9('0x6')]},'nameField':{'type':Sequelize[_0xd5f9('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2624=['keyValue','STRING','ENUM','sequelize','exports','string','variable'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2624,0x153));var _0x4262=function(_0xdfc924,_0x423b92){_0xdfc924=_0xdfc924-0x0;var _0x25ed89=_0x2624[_0xdfc924];return _0x25ed89;};'use strict';var Sequelize=require(_0x4262('0x0'));module[_0x4262('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4262('0x2'),_0x4262('0x3'),'customVariable',_0x4262('0x4'),'picklist'),'defaultValue':_0x4262('0x2')},'content':{'type':Sequelize[_0x4262('0x5')]},'key':{'type':Sequelize[_0x4262('0x5')]},'keyType':{'type':Sequelize[_0x4262('0x6')](_0x4262('0x2'),_0x4262('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4262('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'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 52a41a2..c51f7f3 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 _0x6f7a=['path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','sendStatus','error','name','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x21e16f,_0x500b34){var _0x2b9c84=function(_0x263d27){while(--_0x263d27){_0x21e16f['push'](_0x21e16f['shift']());}};_0x2b9c84(++_0x500b34);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x62967,_0x469a03){_0x62967=_0x62967-0x0;var _0x481f38=_0x6f7a[_0x62967];return _0x481f38;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ef97,_0x402d25){return function(_0x5efdce){if(!_0x5efdce){_0x47ef97[_0xa6f7('0x23')](0x194);}return _0x5efdce;};}function handleError(_0x126d24,_0x3c79ea){_0x3c79ea=_0x3c79ea||0x1f4;return function(_0x2b4c6c){logger[_0xa6f7('0x24')](_0x2b4c6c['stack']);if(_0x2b4c6c['name']){delete _0x2b4c6c[_0xa6f7('0x25')];}_0x126d24[_0xa6f7('0x19')](_0x3c79ea)['send'](_0x2b4c6c);};}exports[_0xa6f7('0x26')]=function(_0x27babb,_0x87bccc){var _0x3a7ff9={},_0x224f5a={},_0x10bf77={'count':0x0,'rows':[]};var _0x353de8=_[_0xa6f7('0x27')](db[_0xa6f7('0x28')][_0xa6f7('0x29')],function(_0x40b0f8){return{'name':_0x40b0f8[_0xa6f7('0x2a')],'type':_0x40b0f8['type'][_0xa6f7('0x2b')]};});_0x224f5a[_0xa6f7('0x2c')]=_['map'](_0x353de8,_0xa6f7('0x25'));_0x224f5a[_0xa6f7('0x2d')]=_['keys'](_0x27babb['query']);_0x224f5a[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x224f5a[_0xa6f7('0x2c')],_0x224f5a[_0xa6f7('0x2d')]);_0x3a7ff9[_0xa6f7('0x30')]=_['intersection'](_0x224f5a['model'],qs[_0xa6f7('0x31')](_0x27babb['query'][_0xa6f7('0x31')]));_0x3a7ff9[_0xa6f7('0x30')]=_0x3a7ff9[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x3a7ff9[_0xa6f7('0x30')]:_0x224f5a[_0xa6f7('0x2c')];if(!_0x27babb['query'][_0xa6f7('0x33')](_0xa6f7('0x34'))){_0x3a7ff9[_0xa6f7('0x1d')]=qs['limit'](_0x27babb[_0xa6f7('0x2d')]['limit']);_0x3a7ff9[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x27babb[_0xa6f7('0x2d')]['offset']);}_0x3a7ff9[_0xa6f7('0x35')]=qs[_0xa6f7('0x36')](_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x36')]);_0x3a7ff9[_0xa6f7('0x37')]=qs[_0xa6f7('0x2e')](_['pick'](_0x27babb[_0xa6f7('0x2d')],_0x224f5a[_0xa6f7('0x2e')]),_0x353de8);if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]){_0x3a7ff9[_0xa6f7('0x37')]=_[_0xa6f7('0x39')](_0x3a7ff9[_0xa6f7('0x37')],{'$or':_[_0xa6f7('0x27')](_0x353de8,function(_0x4c2d2e){if(_0x4c2d2e[_0xa6f7('0x3a')]!==_0xa6f7('0x3b')){var _0x353e54={};_0x353e54[_0x4c2d2e['name']]={'$like':'%'+_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]+'%'};return _0x353e54;}})});}_0x3a7ff9=_['merge']({},_0x3a7ff9,_0x27babb[_0xa6f7('0x3c')]);var _0x13c7c4={'where':_0x3a7ff9[_0xa6f7('0x37')]};return db[_0xa6f7('0x28')][_0xa6f7('0x1f')](_0x13c7c4)['then'](function(_0x2e3eb2){_0x10bf77[_0xa6f7('0x1f')]=_0x2e3eb2;if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x3a7ff9[_0xa6f7('0x3e')]=[{'all':!![]}];}return db[_0xa6f7('0x28')][_0xa6f7('0x3f')](_0x3a7ff9);})[_0xa6f7('0x40')](function(_0x5646b9){_0x10bf77['rows']=_0x5646b9;return _0x10bf77;})[_0xa6f7('0x40')](respondWithFilteredResult(_0x87bccc,_0x3a7ff9))[_0xa6f7('0x41')](handleError(_0x87bccc,null));};exports[_0xa6f7('0x42')]=function(_0x2546a3,_0x2ac07f){var _0x387714={'raw':!![],'where':{'id':_0x2546a3[_0xa6f7('0x43')]['id']}},_0x21fdd7={};_0x21fdd7[_0xa6f7('0x2c')]=_[_0xa6f7('0x44')](db['FreshdeskField'][_0xa6f7('0x29')]);_0x21fdd7[_0xa6f7('0x2d')]=_['keys'](_0x2546a3[_0xa6f7('0x2d')]);_0x21fdd7[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x21fdd7[_0xa6f7('0x2c')],_0x21fdd7['query']);_0x387714[_0xa6f7('0x30')]=_['intersection'](_0x21fdd7['model'],qs[_0xa6f7('0x31')](_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x31')]));_0x387714[_0xa6f7('0x30')]=_0x387714[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x387714[_0xa6f7('0x30')]:_0x21fdd7['model'];if(_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x387714['include']=[{'all':!![]}];}_0x387714=_[_0xa6f7('0x39')]({},_0x387714,_0x2546a3[_0xa6f7('0x3c')]);return db[_0xa6f7('0x28')]['find'](_0x387714)[_0xa6f7('0x40')](handleEntityNotFound(_0x2ac07f,null))['then'](respondWithResult(_0x2ac07f,null))[_0xa6f7('0x41')](handleError(_0x2ac07f,null));};exports[_0xa6f7('0x45')]=function(_0x260e77,_0x5f3c84){return db['FreshdeskField'][_0xa6f7('0x45')](_0x260e77['body'],{})[_0xa6f7('0x40')](respondWithResult(_0x5f3c84,0xc9))['catch'](handleError(_0x5f3c84,null));};exports['update']=function(_0x1e7089,_0x2e3a04){if(_0x1e7089[_0xa6f7('0x46')]['id']){delete _0x1e7089[_0xa6f7('0x46')]['id'];}return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x1e7089['params']['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x2e3a04,null))[_0xa6f7('0x40')](saveUpdates(_0x1e7089['body'],null))[_0xa6f7('0x40')](respondWithResult(_0x2e3a04,null))['catch'](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x48')]=function(_0x59091a,_0x488efc){return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x59091a[_0xa6f7('0x43')]['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x488efc,null))[_0xa6f7('0x40')](removeEntity(_0x488efc,null))['catch'](handleError(_0x488efc,null));}; \ No newline at end of file +var _0x80df=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','FreshdeskField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','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'];(function(_0x57915d,_0x396b08){var _0x38b1eb=function(_0x3c8261){while(--_0x3c8261){_0x57915d['push'](_0x57915d['shift']());}};_0x38b1eb(++_0x396b08);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf80d('0x0'));var rimraf=require(_0xf80d('0x1'));var zipdir=require(_0xf80d('0x2'));var jsonpatch=require(_0xf80d('0x3'));var rp=require('request-promise');var moment=require(_0xf80d('0x4'));var BPromise=require(_0xf80d('0x5'));var Mustache=require(_0xf80d('0x6'));var util=require(_0xf80d('0x7'));var path=require(_0xf80d('0x8'));var sox=require(_0xf80d('0x9'));var csv=require(_0xf80d('0xa'));var ejs=require(_0xf80d('0xb'));var fs=require('fs');var fs_extra=require(_0xf80d('0xc'));var _=require(_0xf80d('0xd'));var squel=require('squel');var crypto=require(_0xf80d('0xe'));var jsforce=require(_0xf80d('0xf'));var deskjs=require(_0xf80d('0x10'));var toCsv=require(_0xf80d('0xa'));var querystring=require(_0xf80d('0x11'));var Papa=require(_0xf80d('0x12'));var Redis=require(_0xf80d('0x13'));var authService=require(_0xf80d('0x14'));var qs=require(_0xf80d('0x15'));var as=require(_0xf80d('0x16'));var hardwareService=require(_0xf80d('0x17'));var logger=require(_0xf80d('0x18'))(_0xf80d('0x19'));var utils=require(_0xf80d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf80d('0x1b'))['db'];function respondWithStatusCode(_0x74ce36,_0x489bdf){_0x489bdf=_0x489bdf||0xcc;return function(_0x34e130){if(_0x34e130){return _0x74ce36['sendStatus'](_0x489bdf);}return _0x74ce36[_0xf80d('0x1c')](_0x489bdf)['end']();};}function respondWithResult(_0x4285de,_0x50c968){_0x50c968=_0x50c968||0xc8;return function(_0x3be9a9){if(_0x3be9a9){return _0x4285de[_0xf80d('0x1c')](_0x50c968)[_0xf80d('0x1d')](_0x3be9a9);}};}function respondWithFilteredResult(_0x1e1b08,_0x2098d6){return function(_0x45751c){if(_0x45751c){var _0x482043=typeof _0x2098d6[_0xf80d('0x1e')]===_0xf80d('0x1f')&&typeof _0x2098d6[_0xf80d('0x20')]===_0xf80d('0x1f');var _0x27b2ea=_0x45751c[_0xf80d('0x21')];var _0x1d104a=_0x482043?0x0:_0x2098d6[_0xf80d('0x1e')];var _0x2ea2c1=_0x482043?_0x45751c[_0xf80d('0x21')]:_0x2098d6[_0xf80d('0x1e')]+_0x2098d6[_0xf80d('0x20')];var _0x5392c5;if(_0x2ea2c1>=_0x27b2ea){_0x2ea2c1=_0x27b2ea;_0x5392c5=0xc8;}else{_0x5392c5=0xce;}_0x1e1b08[_0xf80d('0x1c')](_0x5392c5);return _0x1e1b08[_0xf80d('0x22')]('Content-Range',_0x1d104a+'-'+_0x2ea2c1+'/'+_0x27b2ea)[_0xf80d('0x1d')](_0x45751c);}return null;};}function patchUpdates(_0x539c80){return function(_0x3f3a2a){try{jsonpatch[_0xf80d('0x23')](_0x3f3a2a,_0x539c80,!![]);}catch(_0x2d5e46){return BPromise[_0xf80d('0x24')](_0x2d5e46);}return _0x3f3a2a[_0xf80d('0x25')]();};}function saveUpdates(_0x25d031,_0x446153){return function(_0x269859){if(_0x269859){return _0x269859[_0xf80d('0x26')](_0x25d031)[_0xf80d('0x27')](function(_0x33d58c){return _0x33d58c;});}return null;};}function removeEntity(_0x739968,_0x570c99){return function(_0x32ad42){if(_0x32ad42){return _0x32ad42[_0xf80d('0x28')]()['then'](function(){_0x739968[_0xf80d('0x1c')](0xcc)[_0xf80d('0x29')]();});}};}function handleEntityNotFound(_0x323540,_0x947bb){return function(_0x4986ad){if(!_0x4986ad){_0x323540[_0xf80d('0x2a')](0x194);}return _0x4986ad;};}function handleError(_0x14399e,_0xf4c3af){_0xf4c3af=_0xf4c3af||0x1f4;return function(_0x2a4597){logger[_0xf80d('0x2b')](_0x2a4597[_0xf80d('0x2c')]);if(_0x2a4597[_0xf80d('0x2d')]){delete _0x2a4597[_0xf80d('0x2d')];}_0x14399e[_0xf80d('0x1c')](_0xf4c3af)['send'](_0x2a4597);};}exports[_0xf80d('0x2e')]=function(_0x1603a4,_0x3e2c8c){var _0x368865={},_0x3ce924={},_0x5eab42={'count':0x0,'rows':[]};var _0x401cfb=_['map'](db[_0xf80d('0x2f')][_0xf80d('0x30')],function(_0x214bff){return{'name':_0x214bff[_0xf80d('0x31')],'type':_0x214bff['type']['key']};});_0x3ce924[_0xf80d('0x32')]=_['map'](_0x401cfb,_0xf80d('0x2d'));_0x3ce924[_0xf80d('0x33')]=_[_0xf80d('0x34')](_0x1603a4['query']);_0x3ce924[_0xf80d('0x35')]=_[_0xf80d('0x36')](_0x3ce924['model'],_0x3ce924[_0xf80d('0x33')]);_0x368865[_0xf80d('0x37')]=_[_0xf80d('0x36')](_0x3ce924['model'],qs[_0xf80d('0x38')](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x38')]));_0x368865[_0xf80d('0x37')]=_0x368865[_0xf80d('0x37')]['length']?_0x368865[_0xf80d('0x37')]:_0x3ce924['model'];if(!_0x1603a4[_0xf80d('0x33')][_0xf80d('0x39')](_0xf80d('0x3a'))){_0x368865[_0xf80d('0x20')]=qs['limit'](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x20')]);_0x368865[_0xf80d('0x1e')]=qs[_0xf80d('0x1e')](_0x1603a4['query'][_0xf80d('0x1e')]);}_0x368865[_0xf80d('0x3b')]=qs[_0xf80d('0x3c')](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x3c')]);_0x368865[_0xf80d('0x3d')]=qs[_0xf80d('0x35')](_[_0xf80d('0x3e')](_0x1603a4['query'],_0x3ce924[_0xf80d('0x35')]),_0x401cfb);if(_0x1603a4[_0xf80d('0x33')][_0xf80d('0x3f')]){_0x368865['where']=_[_0xf80d('0x40')](_0x368865['where'],{'$or':_[_0xf80d('0x41')](_0x401cfb,function(_0x1a4ab7){if(_0x1a4ab7[_0xf80d('0x42')]!==_0xf80d('0x43')){var _0x4a3c5e={};_0x4a3c5e[_0x1a4ab7['name']]={'$like':'%'+_0x1603a4['query'][_0xf80d('0x3f')]+'%'};return _0x4a3c5e;}})});}_0x368865=_[_0xf80d('0x40')]({},_0x368865,_0x1603a4[_0xf80d('0x44')]);var _0x4b9f1d={'where':_0x368865[_0xf80d('0x3d')]};return db[_0xf80d('0x2f')]['count'](_0x4b9f1d)[_0xf80d('0x27')](function(_0x511310){_0x5eab42[_0xf80d('0x21')]=_0x511310;if(_0x1603a4['query'][_0xf80d('0x45')]){_0x368865['include']=[{'all':!![]}];}return db[_0xf80d('0x2f')][_0xf80d('0x46')](_0x368865);})[_0xf80d('0x27')](function(_0x2cd371){_0x5eab42[_0xf80d('0x47')]=_0x2cd371;return _0x5eab42;})[_0xf80d('0x27')](respondWithFilteredResult(_0x3e2c8c,_0x368865))[_0xf80d('0x48')](handleError(_0x3e2c8c,null));};exports[_0xf80d('0x49')]=function(_0x99e531,_0x80f24a){var _0x1fcbad={'raw':!![],'where':{'id':_0x99e531[_0xf80d('0x4a')]['id']}},_0x437e44={};_0x437e44[_0xf80d('0x32')]=_[_0xf80d('0x34')](db[_0xf80d('0x2f')][_0xf80d('0x30')]);_0x437e44[_0xf80d('0x33')]=_[_0xf80d('0x34')](_0x99e531[_0xf80d('0x33')]);_0x437e44[_0xf80d('0x35')]=_[_0xf80d('0x36')](_0x437e44[_0xf80d('0x32')],_0x437e44[_0xf80d('0x33')]);_0x1fcbad[_0xf80d('0x37')]=_['intersection'](_0x437e44[_0xf80d('0x32')],qs[_0xf80d('0x38')](_0x99e531[_0xf80d('0x33')][_0xf80d('0x38')]));_0x1fcbad[_0xf80d('0x37')]=_0x1fcbad['attributes'][_0xf80d('0x4b')]?_0x1fcbad[_0xf80d('0x37')]:_0x437e44[_0xf80d('0x32')];if(_0x99e531[_0xf80d('0x33')][_0xf80d('0x45')]){_0x1fcbad[_0xf80d('0x4c')]=[{'all':!![]}];}_0x1fcbad=_[_0xf80d('0x40')]({},_0x1fcbad,_0x99e531[_0xf80d('0x44')]);return db[_0xf80d('0x2f')][_0xf80d('0x4d')](_0x1fcbad)[_0xf80d('0x27')](handleEntityNotFound(_0x80f24a,null))[_0xf80d('0x27')](respondWithResult(_0x80f24a,null))[_0xf80d('0x48')](handleError(_0x80f24a,null));};exports[_0xf80d('0x4e')]=function(_0x3a420d,_0x10d5b5){return db[_0xf80d('0x2f')]['create'](_0x3a420d[_0xf80d('0x4f')],{})[_0xf80d('0x27')](respondWithResult(_0x10d5b5,0xc9))[_0xf80d('0x48')](handleError(_0x10d5b5,null));};exports['update']=function(_0x3e5cf6,_0x1088ca){if(_0x3e5cf6['body']['id']){delete _0x3e5cf6['body']['id'];}return db[_0xf80d('0x2f')]['find']({'where':{'id':_0x3e5cf6[_0xf80d('0x4a')]['id']}})[_0xf80d('0x27')](handleEntityNotFound(_0x1088ca,null))[_0xf80d('0x27')](saveUpdates(_0x3e5cf6[_0xf80d('0x4f')],null))[_0xf80d('0x27')](respondWithResult(_0x1088ca,null))[_0xf80d('0x48')](handleError(_0x1088ca,null));};exports[_0xf80d('0x28')]=function(_0x114132,_0x115d1f){return db[_0xf80d('0x2f')][_0xf80d('0x4d')]({'where':{'id':_0x114132[_0xf80d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x115d1f,null))[_0xf80d('0x27')](removeEntity(_0x115d1f,null))[_0xf80d('0x48')](handleError(_0x115d1f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 9a0b6f6..2410c26 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 _0x355e=['util','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash'];(function(_0x30a152,_0x313c9f){var _0x29ed7a=function(_0x2cab83){while(--_0x2cab83){_0x30a152['push'](_0x30a152['shift']());}};_0x29ed7a(++_0x313c9f);}(_0x355e,0xa7));var _0xe355=function(_0x4ffeff,_0x48eb45){_0x4ffeff=_0x4ffeff-0x0;var _0x11f30f=_0x355e[_0x4ffeff];return _0x11f30f;};'use strict';var _=require(_0xe355('0x0'));var util=require(_0xe355('0x1'));var logger=require('../../config/logger')(_0xe355('0x2'));var moment=require(_0xe355('0x3'));var BPromise=require(_0xe355('0x4'));var rp=require(_0xe355('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe355('0x6'));var attributes=require(_0xe355('0x7'));module[_0xe355('0x8')]=function(_0xc41274,_0x2b600f){return _0xc41274[_0xe355('0x9')](_0xe355('0xa'),attributes,{'tableName':_0xe355('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xe355('0xc'),_0xe355('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9b4=['idField','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','freshdesk_unique_index'];(function(_0x1f47b2,_0x32ea9c){var _0xf37729=function(_0x15ed33){while(--_0x15ed33){_0x1f47b2['push'](_0x1f47b2['shift']());}};_0xf37729(++_0x32ea9c);}(_0xd9b4,0x1f0));var _0x4d9b=function(_0x3d03ba,_0x40eab9){_0x3d03ba=_0x3d03ba-0x0;var _0x26f8f0=_0xd9b4[_0x3d03ba];return _0x26f8f0;};'use strict';var _=require(_0x4d9b('0x0'));var util=require(_0x4d9b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4d9b('0x2'));var rp=require(_0x4d9b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d9b('0x4'));var config=require(_0x4d9b('0x5'));var attributes=require(_0x4d9b('0x6'));module['exports']=function(_0x595284,_0x14f7e0){return _0x595284[_0x4d9b('0x7')](_0x4d9b('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x4d9b('0x9'),'fields':[_0x4d9b('0xa'),'FieldId'],'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 ee76791..e8db55b 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 _0x8338=['catch','moment','../../config/utils','../../config/logger','rpc','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x5445e9,_0x488171){var _0x1224e5=function(_0x2dfd7e){while(--_0x2dfd7e){_0x5445e9['push'](_0x5445e9['shift']());}};_0x1224e5(++_0x488171);}(_0x8338,0x78));var _0x8833=function(_0xa18f31,_0x19afe8){_0xa18f31=_0xa18f31-0x0;var _0x4aeada=_0x8338[_0xa18f31];return _0x4aeada;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8833('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8833('0x1'));var logger=require(_0x8833('0x2'))(_0x8833('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8833('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x5e16ec,_0xfa88d8,_0x1bb3f7){return new BPromise(function(_0x3f9782,_0x2f1f29){return client[_0x8833('0x5')](_0x5e16ec,_0x1bb3f7)[_0x8833('0x6')](function(_0x2a5d78){logger[_0x8833('0x7')](_0x8833('0x8'),_0xfa88d8,'request\x20sent');logger[_0x8833('0x9')](_0x8833('0xa'),_0xfa88d8,_0x8833('0xb'),JSON['stringify'](_0x2a5d78));if(_0x2a5d78[_0x8833('0xc')]){if(_0x2a5d78[_0x8833('0xc')][_0x8833('0xd')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0xfa88d8,_0x2a5d78['error'][_0x8833('0xe')]);return _0x2f1f29(_0x2a5d78[_0x8833('0xc')][_0x8833('0xe')]);}logger['error'](_0x8833('0x8'),_0xfa88d8,_0x2a5d78['error'][_0x8833('0xe')]);return _0x3f9782(_0x2a5d78['error'][_0x8833('0xe')]);}else{logger[_0x8833('0x7')]('FreshdeskField,\x20%s,\x20%s',_0xfa88d8,_0x8833('0xb'));_0x3f9782(_0x2a5d78[_0x8833('0xf')][_0x8833('0xe')]);}})[_0x8833('0x10')](function(_0x1f0421){logger[_0x8833('0xc')](_0x8833('0x8'),_0xfa88d8,_0x1f0421);_0x2f1f29(_0x1f0421);});});} \ No newline at end of file +var _0x4872=['error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2799d3,_0x1d0f54){var _0x5c5701=function(_0x373ac2){while(--_0x373ac2){_0x2799d3['push'](_0x2799d3['shift']());}};_0x5c5701(++_0x1d0f54);}(_0x4872,0x70));var _0x2487=function(_0x50c1b3,_0x3ed97f){_0x50c1b3=_0x50c1b3-0x0;var _0x1f5160=_0x4872[_0x50c1b3];return _0x1f5160;};'use strict';var _=require(_0x2487('0x0'));var util=require(_0x2487('0x1'));var moment=require(_0x2487('0x2'));var BPromise=require(_0x2487('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2487('0x4'));var db=require(_0x2487('0x5'))['db'];var utils=require(_0x2487('0x6'));var logger=require(_0x2487('0x7'))(_0x2487('0x8'));var config=require(_0x2487('0x9'));var jayson=require(_0x2487('0xa'));var client=jayson[_0x2487('0xb')][_0x2487('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10cb62,_0x564156,_0xea7523){return new BPromise(function(_0x134fa5,_0x154443){return client[_0x2487('0xd')](_0x10cb62,_0xea7523)[_0x2487('0xe')](function(_0x5bdb44){logger['info'](_0x2487('0xf'),_0x564156,_0x2487('0x10'));logger[_0x2487('0x11')](_0x2487('0x12'),_0x564156,_0x2487('0x10'),JSON[_0x2487('0x13')](_0x5bdb44));if(_0x5bdb44['error']){if(_0x5bdb44[_0x2487('0x14')]['code']===0x1f4){logger[_0x2487('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x564156,_0x5bdb44[_0x2487('0x14')]['message']);return _0x154443(_0x5bdb44[_0x2487('0x14')]['message']);}logger['error'](_0x2487('0xf'),_0x564156,_0x5bdb44[_0x2487('0x14')][_0x2487('0x15')]);return _0x134fa5(_0x5bdb44[_0x2487('0x14')][_0x2487('0x15')]);}else{logger['info'](_0x2487('0xf'),_0x564156,'request\x20sent');_0x134fa5(_0x5bdb44['result'][_0x2487('0x15')]);}})['catch'](function(_0x5a3c86){logger[_0x2487('0x14')](_0x2487('0xf'),_0x564156,_0x5a3c86);_0x154443(_0x5a3c86);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index b3f470c..25d8cca 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 _0x16d2=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x16d2,0x123));var _0x216d=function(_0x5b2c50,_0x4db66b){_0x5b2c50=_0x5b2c50-0x0;var _0x47f2f9=_0x16d2[_0x5b2c50];return _0x47f2f9;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['getFields']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),controller[_0x216d('0x13')]);router[_0x216d('0x12')](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x14')]);router[_0x216d('0x15')]('/:id',auth[_0x216d('0xb')](),controller['update']);router[_0x216d('0x16')](_0x216d('0xd'),auth['isAuthenticated'](),controller[_0x216d('0x17')]);module[_0x216d('0x18')]=router; \ No newline at end of file +var _0x0abf=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete'];(function(_0x167f10,_0x20209b){var _0x2ef2f9=function(_0x5532a3){while(--_0x5532a3){_0x167f10['push'](_0x167f10['shift']());}};_0x2ef2f9(++_0x20209b);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xf0ab('0xe')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0xf')]);router[_0xf0ab('0xe')](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')](_0xf0ab('0x12'),auth['isAuthenticated'](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x15')]);module[_0xf0ab('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 4a83a2a..b59d6d6 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 _0x28f2=['exports','STRING','remoteUri','sequelize'];(function(_0x22358c,_0x454fdd){var _0x254350=function(_0x297aa7){while(--_0x297aa7){_0x22358c['push'](_0x22358c['shift']());}};_0x254350(++_0x454fdd);}(_0x28f2,0x193));var _0x228f=function(_0x4c5c7f,_0x5bf0aa){_0x4c5c7f=_0x4c5c7f-0x0;var _0x333631=_0x28f2[_0x4c5c7f];return _0x333631;};'use strict';var Sequelize=require(_0x228f('0x0'));module[_0x228f('0x1')]={'name':{'type':Sequelize[_0x228f('0x2')]},'description':{'type':Sequelize[_0x228f('0x2')]},'username':{'type':Sequelize[_0x228f('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x228f('0x2')]},'remoteUri':{'type':Sequelize[_0x228f('0x2')],'unique':_0x228f('0x3')},'serverUrl':{'type':Sequelize[_0x228f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x32f4=['sequelize','exports','STRING','username','remoteUri'];(function(_0x44e50a,_0x1cc4a2){var _0x1b5994=function(_0x29a487){while(--_0x29a487){_0x44e50a['push'](_0x44e50a['shift']());}};_0x1b5994(++_0x1cc4a2);}(_0x32f4,0x154));var _0x432f=function(_0x5e19b5,_0x1df79e){_0x5e19b5=_0x5e19b5-0x0;var _0xd7b959=_0x32f4[_0x5e19b5];return _0xd7b959;};'use strict';var Sequelize=require(_0x432f('0x0'));module[_0x432f('0x1')]={'name':{'type':Sequelize[_0x432f('0x2')]},'description':{'type':Sequelize[_0x432f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x432f('0x3')},'apiKey':{'type':Sequelize[_0x432f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x432f('0x4')},'serverUrl':{'type':Sequelize[_0x432f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index e5f6d86..db85b0c 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 _0x7df7=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','create','body','find','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','users','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','model','query','keys'];(function(_0x4ef12e,_0x5515ee){var _0x21a8e0=function(_0xa5946f){while(--_0xa5946f){_0x4ef12e['push'](_0x4ef12e['shift']());}};_0x21a8e0(++_0x5515ee);}(_0x7df7,0x1c7));var _0x77df=function(_0x336e50,_0x33c298){_0x336e50=_0x336e50-0x0;var _0x374a0d=_0x7df7[_0x336e50];return _0x374a0d;};'use strict';var emlformat=require(_0x77df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x77df('0x1'));var jsonpatch=require(_0x77df('0x2'));var rp=require('request-promise');var moment=require(_0x77df('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x77df('0x4'));var path=require(_0x77df('0x5'));var sox=require(_0x77df('0x6'));var csv=require('to-csv');var ejs=require(_0x77df('0x7'));var fs=require('fs');var fs_extra=require(_0x77df('0x8'));var _=require(_0x77df('0x9'));var squel=require(_0x77df('0xa'));var crypto=require(_0x77df('0xb'));var jsforce=require(_0x77df('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x77df('0xd'));var Papa=require(_0x77df('0xe'));var Redis=require(_0x77df('0xf'));var authService=require(_0x77df('0x10'));var qs=require(_0x77df('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x77df('0x12'))(_0x77df('0x13'));var utils=require('../../config/utils');var config=require(_0x77df('0x14'));var licenseUtil=require(_0x77df('0x15'));var db=require(_0x77df('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c1ab4,_0x4113a5){_0x4113a5=_0x4113a5||0xcc;return function(_0x1ac4a8){if(_0x1ac4a8){return _0x4c1ab4['sendStatus'](_0x4113a5);}return _0x4c1ab4[_0x77df('0x17')](_0x4113a5)[_0x77df('0x18')]();};}function respondWithResult(_0x3267fd,_0xa22b4b){_0xa22b4b=_0xa22b4b||0xc8;return function(_0x38654c){if(_0x38654c){return _0x3267fd[_0x77df('0x17')](_0xa22b4b)[_0x77df('0x19')](_0x38654c);}};}function respondWithFilteredResult(_0x103e31,_0x5759b6){return function(_0x3e12ef){if(_0x3e12ef){var _0x45d8c6=typeof _0x5759b6[_0x77df('0x1a')]===_0x77df('0x1b')&&typeof _0x5759b6['limit']===_0x77df('0x1b');var _0x16d095=_0x3e12ef[_0x77df('0x1c')];var _0x4da9d8=_0x45d8c6?0x0:_0x5759b6[_0x77df('0x1a')];var _0x10d55e=_0x45d8c6?_0x3e12ef[_0x77df('0x1c')]:_0x5759b6[_0x77df('0x1a')]+_0x5759b6['limit'];var _0x30d624;if(_0x10d55e>=_0x16d095){_0x10d55e=_0x16d095;_0x30d624=0xc8;}else{_0x30d624=0xce;}_0x103e31[_0x77df('0x17')](_0x30d624);return _0x103e31[_0x77df('0x1d')](_0x77df('0x1e'),_0x4da9d8+'-'+_0x10d55e+'/'+_0x16d095)[_0x77df('0x19')](_0x3e12ef);}return null;};}function patchUpdates(_0x3266ee){return function(_0x5dbda6){try{jsonpatch[_0x77df('0x1f')](_0x5dbda6,_0x3266ee,!![]);}catch(_0xa4feb4){return BPromise[_0x77df('0x20')](_0xa4feb4);}return _0x5dbda6[_0x77df('0x21')]();};}function saveUpdates(_0x3c5692,_0xb85759){return function(_0x3e2779){if(_0x3e2779){return _0x3e2779[_0x77df('0x22')](_0x3c5692)[_0x77df('0x23')](function(_0x418044){return _0x418044;});}return null;};}function removeEntity(_0x345115,_0x133560){return function(_0x1304b3){if(_0x1304b3){return _0x1304b3[_0x77df('0x24')]()[_0x77df('0x23')](function(){_0x345115[_0x77df('0x17')](0xcc)[_0x77df('0x18')]();});}};}function handleEntityNotFound(_0x2b64b1,_0x4e5abf){return function(_0x435da3){if(!_0x435da3){_0x2b64b1[_0x77df('0x25')](0x194);}return _0x435da3;};}function handleError(_0x961e83,_0x15e3f3){_0x15e3f3=_0x15e3f3||0x1f4;return function(_0x2c90e3){logger['error'](_0x2c90e3[_0x77df('0x26')]);if(_0x2c90e3[_0x77df('0x27')]){delete _0x2c90e3[_0x77df('0x27')];}_0x961e83[_0x77df('0x17')](_0x15e3f3)[_0x77df('0x28')](_0x2c90e3);};}exports[_0x77df('0x29')]=function(_0x4d17f6,_0x223fc0){var _0xb6b159={},_0x224fd1={},_0x554624={'count':0x0,'rows':[]};var _0xb426eb=_[_0x77df('0x2a')](db[_0x77df('0x2b')]['rawAttributes'],function(_0x48e9e2){return{'name':_0x48e9e2[_0x77df('0x2c')],'type':_0x48e9e2[_0x77df('0x2d')][_0x77df('0x2e')]};});_0x224fd1[_0x77df('0x2f')]=_[_0x77df('0x2a')](_0xb426eb,'name');_0x224fd1[_0x77df('0x30')]=_[_0x77df('0x31')](_0x4d17f6[_0x77df('0x30')]);_0x224fd1[_0x77df('0x32')]=_['intersection'](_0x224fd1['model'],_0x224fd1['query']);_0xb6b159[_0x77df('0x33')]=_[_0x77df('0x34')](_0x224fd1[_0x77df('0x2f')],qs[_0x77df('0x35')](_0x4d17f6[_0x77df('0x30')]['fields']));_0xb6b159[_0x77df('0x33')]=_0xb6b159[_0x77df('0x33')][_0x77df('0x36')]?_0xb6b159['attributes']:_0x224fd1['model'];if(!_0x4d17f6[_0x77df('0x30')][_0x77df('0x37')](_0x77df('0x38'))){_0xb6b159[_0x77df('0x39')]=qs['limit'](_0x4d17f6[_0x77df('0x30')][_0x77df('0x39')]);_0xb6b159[_0x77df('0x1a')]=qs[_0x77df('0x1a')](_0x4d17f6['query'][_0x77df('0x1a')]);}_0xb6b159[_0x77df('0x3a')]=qs['sort'](_0x4d17f6[_0x77df('0x30')][_0x77df('0x3b')]);_0xb6b159[_0x77df('0x3c')]=qs[_0x77df('0x32')](_['pick'](_0x4d17f6[_0x77df('0x30')],_0x224fd1[_0x77df('0x32')]),_0xb426eb);if(_0x4d17f6[_0x77df('0x30')]['filter']){_0xb6b159['where']=_[_0x77df('0x3d')](_0xb6b159[_0x77df('0x3c')],{'$or':_[_0x77df('0x2a')](_0xb426eb,function(_0xda2f58){if(_0xda2f58[_0x77df('0x2d')]!==_0x77df('0x3e')){var _0x12a8ec={};_0x12a8ec[_0xda2f58[_0x77df('0x27')]]={'$like':'%'+_0x4d17f6[_0x77df('0x30')][_0x77df('0x3f')]+'%'};return _0x12a8ec;}})});}_0xb6b159=_[_0x77df('0x3d')]({},_0xb6b159,_0x4d17f6['options']);var _0x188c65={'where':_0xb6b159[_0x77df('0x3c')]};return db[_0x77df('0x2b')]['count'](_0x188c65)[_0x77df('0x23')](function(_0x2bd4cb){_0x554624[_0x77df('0x1c')]=_0x2bd4cb;if(_0x4d17f6['query'][_0x77df('0x40')]){_0xb6b159[_0x77df('0x41')]=[{'all':!![]}];}return db[_0x77df('0x2b')][_0x77df('0x42')](_0xb6b159);})['then'](function(_0x5d9b88){_0x554624[_0x77df('0x43')]=_0x5d9b88;return _0x554624;})[_0x77df('0x23')](respondWithFilteredResult(_0x223fc0,_0xb6b159))[_0x77df('0x44')](handleError(_0x223fc0,null));};exports['show']=function(_0x17347d,_0x52df44){var _0x4e209c={'raw':![],'where':{'id':_0x17347d[_0x77df('0x45')]['id']}},_0xe7d741={};_0xe7d741['model']=_[_0x77df('0x31')](db[_0x77df('0x2b')]['rawAttributes']);_0xe7d741[_0x77df('0x30')]=_[_0x77df('0x31')](_0x17347d[_0x77df('0x30')]);_0xe7d741['filters']=_['intersection'](_0xe7d741[_0x77df('0x2f')],_0xe7d741[_0x77df('0x30')]);_0x4e209c[_0x77df('0x33')]=_[_0x77df('0x34')](_0xe7d741['model'],qs[_0x77df('0x35')](_0x17347d['query'][_0x77df('0x35')]));_0x4e209c[_0x77df('0x33')]=_0x4e209c[_0x77df('0x33')][_0x77df('0x36')]?_0x4e209c[_0x77df('0x33')]:_0xe7d741['model'];if(_0x17347d['query'][_0x77df('0x40')]){_0x4e209c[_0x77df('0x41')]=[{'all':!![]}];}_0x4e209c=_[_0x77df('0x3d')]({},_0x4e209c,_0x17347d[_0x77df('0x46')]);return db[_0x77df('0x2b')]['find'](_0x4e209c)[_0x77df('0x23')](handleEntityNotFound(_0x52df44,null))[_0x77df('0x23')](respondWithResult(_0x52df44,null))[_0x77df('0x44')](handleError(_0x52df44,null));};exports[_0x77df('0x47')]=function(_0x2e82c4,_0xeee6fe){return db[_0x77df('0x2b')][_0x77df('0x47')](_0x2e82c4['body'],{})[_0x77df('0x23')](respondWithResult(_0xeee6fe,0xc9))[_0x77df('0x44')](handleError(_0xeee6fe,null));};exports[_0x77df('0x22')]=function(_0x13aef2,_0x3400a5){if(_0x13aef2[_0x77df('0x48')]['id']){delete _0x13aef2['body']['id'];}return db[_0x77df('0x2b')][_0x77df('0x49')]({'where':{'id':_0x13aef2[_0x77df('0x45')]['id']}})['then'](handleEntityNotFound(_0x3400a5,null))['then'](saveUpdates(_0x13aef2[_0x77df('0x48')],null))[_0x77df('0x23')](respondWithResult(_0x3400a5,null))[_0x77df('0x44')](handleError(_0x3400a5,null));};exports[_0x77df('0x24')]=function(_0x23dff7,_0x54da6b){return db['FreshsalesAccount'][_0x77df('0x49')]({'where':{'id':_0x23dff7[_0x77df('0x45')]['id']}})['then'](handleEntityNotFound(_0x54da6b,null))['then'](removeEntity(_0x54da6b,null))[_0x77df('0x44')](handleError(_0x54da6b,null));};exports[_0x77df('0x4a')]=function(_0x5ab1dc,_0x45d5ab,_0x41f5b0){var _0x533b8a={};var _0x4e975c={};var _0x2428fc;var _0x418a59;return db[_0x77df('0x2b')][_0x77df('0x4b')]({'where':{'id':_0x5ab1dc[_0x77df('0x45')]['id']}})[_0x77df('0x23')](handleEntityNotFound(_0x45d5ab,null))['then'](function(_0x259250){if(_0x259250){_0x2428fc=_0x259250;_0x4e975c['model']=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x4e975c[_0x77df('0x30')]=_[_0x77df('0x31')](_0x5ab1dc['query']);_0x4e975c[_0x77df('0x32')]=_[_0x77df('0x34')](_0x4e975c['model'],_0x4e975c['query']);_0x533b8a[_0x77df('0x33')]=_[_0x77df('0x34')](_0x4e975c[_0x77df('0x2f')],qs[_0x77df('0x35')](_0x5ab1dc['query'][_0x77df('0x35')]));_0x533b8a['attributes']=_0x533b8a[_0x77df('0x33')]['length']?_0x533b8a['attributes']:_0x4e975c[_0x77df('0x2f')];_0x533b8a[_0x77df('0x3a')]=qs['sort'](_0x5ab1dc[_0x77df('0x30')][_0x77df('0x3b')]);_0x533b8a[_0x77df('0x3c')]=qs[_0x77df('0x32')](_[_0x77df('0x4c')](_0x5ab1dc['query'],_0x4e975c[_0x77df('0x32')]));if(_0x5ab1dc['query'][_0x77df('0x3f')]){_0x533b8a[_0x77df('0x3c')]=_[_0x77df('0x3d')](_0x533b8a[_0x77df('0x3c')],{'$or':_['map'](_0x533b8a[_0x77df('0x33')],function(_0xcd815e){var _0x2efde6={};_0x2efde6[_0xcd815e]={'$like':'%'+_0x5ab1dc[_0x77df('0x30')][_0x77df('0x3f')]+'%'};return _0x2efde6;})});}_0x533b8a=_[_0x77df('0x3d')]({},_0x533b8a,_0x5ab1dc[_0x77df('0x46')]);return _0x2428fc[_0x77df('0x4a')](_0x533b8a);}})['then'](function(_0x521e6d){if(_0x521e6d){_0x418a59=_0x521e6d['length'];if(!_0x5ab1dc[_0x77df('0x30')][_0x77df('0x37')](_0x77df('0x38'))){_0x533b8a['limit']=qs['limit'](_0x5ab1dc[_0x77df('0x30')]['limit']);_0x533b8a['offset']=qs['offset'](_0x5ab1dc['query'][_0x77df('0x1a')]);}return _0x2428fc[_0x77df('0x4a')](_0x533b8a);}})[_0x77df('0x23')](function(_0x4ee9a3){if(_0x4ee9a3){return _0x4ee9a3?{'count':_0x418a59,'rows':_0x4ee9a3}:null;}})[_0x77df('0x23')](respondWithResult(_0x45d5ab,null))['catch'](handleError(_0x45d5ab,null));};exports[_0x77df('0x4d')]=function(_0x2b7f7f,_0x44ac90,_0x14ed3c){if(_0x2b7f7f[_0x77df('0x48')]['id']){delete _0x2b7f7f['body']['id'];}return db[_0x77df('0x2b')][_0x77df('0x4b')]({'where':{'id':_0x2b7f7f['params']['id']}})[_0x77df('0x23')](handleEntityNotFound(_0x44ac90,null))[_0x77df('0x23')](function(_0x2b5acd){if(_0x2b5acd){_0x2b7f7f[_0x77df('0x48')][_0x77df('0x4e')]=_0x2b5acd['id'];_0x2b7f7f[_0x77df('0x48')][_0x77df('0x4f')]=integrations['getSubjects'](_0x2b7f7f[_0x77df('0x48')]['channel'],_0x2b7f7f[_0x77df('0x48')][_0x77df('0x2d')]);_0x2b7f7f[_0x77df('0x48')]['Descriptions']=integrations[_0x77df('0x50')](_0x2b7f7f[_0x77df('0x48')][_0x77df('0x51')],_0x2b7f7f[_0x77df('0x48')][_0x77df('0x2d')]);return db[_0x77df('0x52')][_0x77df('0x47')](_0x2b7f7f['body'],{'include':[{'model':db[_0x77df('0x53')],'as':_0x77df('0x4f')},{'model':db[_0x77df('0x53')],'as':_0x77df('0x54')}]});}return null;})[_0x77df('0x23')](respondWithResult(_0x44ac90,null))['catch'](handleError(_0x44ac90,null));};exports[_0x77df('0x55')]=function(_0x18253a,_0x414e42,_0x33cd7c){var _0x858056='';var _0xc10253='';return db['FreshsalesAccount'][_0x77df('0x4b')]({'where':{'id':_0x18253a[_0x77df('0x45')]['id']},'attributes':['id',_0x77df('0x56'),_0x77df('0x57'),_0x77df('0x58')]})[_0x77df('0x23')](handleEntityNotFound(_0x414e42,null))['then'](function(_0x1f9421){if(_0x1f9421){_0xc10253=_0x1f9421[_0x77df('0x56')];_0x858056=_0x1f9421[_0x77df('0x57')];var _0x2a64b6=_0x1f9421[_0x77df('0x57')][_0x77df('0x59')](-0x1);if(_0x2a64b6==='/'){_0x858056=_0x858056[_0x77df('0x5a')](0x0,_0x858056[_0x77df('0x5b')](_0x2a64b6));}return rp({'method':'GET','uri':util['format'](_0x77df('0x5c'),_0x858056,_0x77df('0x5d')),'headers':{'Authorization':_0x77df('0x5e')+_0x1f9421['apiKey']},'json':!![]});}})[_0x77df('0x23')](function(_0x50386c){if(_0x50386c){var _0x3535cf=_0x50386c[_0x77df('0x5f')];var _0x3b2ad9=![];var _0x204bc4=null;for(_0x204bc4=0x0;_0x204bc4<_0x3535cf[_0x77df('0x36')];_0x204bc4++){if(_0x3535cf[_0x204bc4]['email']===_0xc10253){_0x3b2ad9=!![];}}if(_0x3b2ad9){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x77df('0x23')](respondWithResult(_0x414e42,null))[_0x77df('0x44')](function(_0x35b248){var _0xb15b86=_0x18253a['query'][_0x77df('0x60')]?0x1f4:_0x35b248[_0x77df('0x61')]||0x1f4;logger['error'](_0x77df('0x62'),_0x77df('0x55'),_0xb15b86,JSON[_0x77df('0x63')](_0x35b248));delete _0x35b248[_0x77df('0x27')];if(_0xb15b86===0x191){_0xb15b86=0x190;}_0x414e42[_0x77df('0x17')](_0xb15b86)[_0x77df('0x28')](_0x18253a['query']['test']?{'message':_0x77df('0x64'),'statusCode':_0x35b248[_0x77df('0x61')]}:_0x35b248);});}; \ No newline at end of file +var _0xb836=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','name','send','index','FreshsalesAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash'];(function(_0x3ff5e5,_0x9380c3){var _0xf8437a=function(_0x34b66a){while(--_0x34b66a){_0x3ff5e5['push'](_0x3ff5e5['shift']());}};_0xf8437a(++_0x9380c3);}(_0xb836,0x175));var _0x6b83=function(_0x3985a0,_0x1b0657){_0x3985a0=_0x3985a0-0x0;var _0x49f7a5=_0xb836[_0x3985a0];return _0x49f7a5;};'use strict';var emlformat=require(_0x6b83('0x0'));var rimraf=require(_0x6b83('0x1'));var zipdir=require(_0x6b83('0x2'));var jsonpatch=require(_0x6b83('0x3'));var rp=require(_0x6b83('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6b83('0x5'));var util=require(_0x6b83('0x6'));var path=require('path');var sox=require(_0x6b83('0x7'));var csv=require(_0x6b83('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b83('0x9'));var _=require(_0x6b83('0xa'));var squel=require('squel');var crypto=require(_0x6b83('0xb'));var jsforce=require(_0x6b83('0xc'));var deskjs=require(_0x6b83('0xd'));var toCsv=require(_0x6b83('0x8'));var querystring=require('querystring');var Papa=require(_0x6b83('0xe'));var Redis=require('ioredis');var authService=require(_0x6b83('0xf'));var qs=require(_0x6b83('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b83('0x11'));var logger=require(_0x6b83('0x12'))('api');var utils=require(_0x6b83('0x13'));var config=require(_0x6b83('0x14'));var licenseUtil=require(_0x6b83('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6b83('0x16'));function respondWithStatusCode(_0x37f4e4,_0xc40b19){_0xc40b19=_0xc40b19||0xcc;return function(_0x489f07){if(_0x489f07){return _0x37f4e4[_0x6b83('0x17')](_0xc40b19);}return _0x37f4e4[_0x6b83('0x18')](_0xc40b19)[_0x6b83('0x19')]();};}function respondWithResult(_0x11890a,_0x39973f){_0x39973f=_0x39973f||0xc8;return function(_0x299cfd){if(_0x299cfd){return _0x11890a[_0x6b83('0x18')](_0x39973f)[_0x6b83('0x1a')](_0x299cfd);}};}function respondWithFilteredResult(_0x38dfe2,_0x28f579){return function(_0x4ca1b9){if(_0x4ca1b9){var _0x40fa3a=typeof _0x28f579['offset']==='undefined'&&typeof _0x28f579[_0x6b83('0x1b')]===_0x6b83('0x1c');var _0x129764=_0x4ca1b9[_0x6b83('0x1d')];var _0xd969e=_0x40fa3a?0x0:_0x28f579[_0x6b83('0x1e')];var _0x4be614=_0x40fa3a?_0x4ca1b9['count']:_0x28f579['offset']+_0x28f579[_0x6b83('0x1b')];var _0x426c21;if(_0x4be614>=_0x129764){_0x4be614=_0x129764;_0x426c21=0xc8;}else{_0x426c21=0xce;}_0x38dfe2[_0x6b83('0x18')](_0x426c21);return _0x38dfe2[_0x6b83('0x1f')](_0x6b83('0x20'),_0xd969e+'-'+_0x4be614+'/'+_0x129764)[_0x6b83('0x1a')](_0x4ca1b9);}return null;};}function patchUpdates(_0xb4585d){return function(_0x2fb2fa){try{jsonpatch['apply'](_0x2fb2fa,_0xb4585d,!![]);}catch(_0x32cce2){return BPromise['reject'](_0x32cce2);}return _0x2fb2fa[_0x6b83('0x21')]();};}function saveUpdates(_0x5aa20b,_0x46aeb6){return function(_0x2b68cf){if(_0x2b68cf){return _0x2b68cf[_0x6b83('0x22')](_0x5aa20b)[_0x6b83('0x23')](function(_0x3ac214){return _0x3ac214;});}return null;};}function removeEntity(_0x2a687e,_0x5d0172){return function(_0xf34333){if(_0xf34333){return _0xf34333['destroy']()['then'](function(){_0x2a687e[_0x6b83('0x18')](0xcc)[_0x6b83('0x19')]();});}};}function handleEntityNotFound(_0x5b821c,_0x7117eb){return function(_0x2861c1){if(!_0x2861c1){_0x5b821c['sendStatus'](0x194);}return _0x2861c1;};}function handleError(_0x39aef0,_0x4357c1){_0x4357c1=_0x4357c1||0x1f4;return function(_0x44dd26){logger['error'](_0x44dd26['stack']);if(_0x44dd26['name']){delete _0x44dd26[_0x6b83('0x24')];}_0x39aef0[_0x6b83('0x18')](_0x4357c1)[_0x6b83('0x25')](_0x44dd26);};}exports[_0x6b83('0x26')]=function(_0x3857f0,_0x43a6c2){var _0x57ea47={},_0x5b5007={},_0x451a5a={'count':0x0,'rows':[]};var _0x39dbcc=_['map'](db[_0x6b83('0x27')]['rawAttributes'],function(_0x150916){return{'name':_0x150916['fieldName'],'type':_0x150916[_0x6b83('0x28')][_0x6b83('0x29')]};});_0x5b5007[_0x6b83('0x2a')]=_['map'](_0x39dbcc,_0x6b83('0x24'));_0x5b5007[_0x6b83('0x2b')]=_[_0x6b83('0x2c')](_0x3857f0[_0x6b83('0x2b')]);_0x5b5007[_0x6b83('0x2d')]=_[_0x6b83('0x2e')](_0x5b5007[_0x6b83('0x2a')],_0x5b5007[_0x6b83('0x2b')]);_0x57ea47[_0x6b83('0x2f')]=_[_0x6b83('0x2e')](_0x5b5007[_0x6b83('0x2a')],qs[_0x6b83('0x30')](_0x3857f0[_0x6b83('0x2b')][_0x6b83('0x30')]));_0x57ea47[_0x6b83('0x2f')]=_0x57ea47['attributes'][_0x6b83('0x31')]?_0x57ea47[_0x6b83('0x2f')]:_0x5b5007[_0x6b83('0x2a')];if(!_0x3857f0[_0x6b83('0x2b')][_0x6b83('0x32')]('nolimit')){_0x57ea47[_0x6b83('0x1b')]=qs[_0x6b83('0x1b')](_0x3857f0[_0x6b83('0x2b')][_0x6b83('0x1b')]);_0x57ea47[_0x6b83('0x1e')]=qs[_0x6b83('0x1e')](_0x3857f0[_0x6b83('0x2b')][_0x6b83('0x1e')]);}_0x57ea47[_0x6b83('0x33')]=qs[_0x6b83('0x34')](_0x3857f0[_0x6b83('0x2b')]['sort']);_0x57ea47[_0x6b83('0x35')]=qs[_0x6b83('0x2d')](_[_0x6b83('0x36')](_0x3857f0[_0x6b83('0x2b')],_0x5b5007[_0x6b83('0x2d')]),_0x39dbcc);if(_0x3857f0[_0x6b83('0x2b')][_0x6b83('0x37')]){_0x57ea47[_0x6b83('0x35')]=_[_0x6b83('0x38')](_0x57ea47[_0x6b83('0x35')],{'$or':_[_0x6b83('0x39')](_0x39dbcc,function(_0x354f6f){if(_0x354f6f[_0x6b83('0x28')]!=='VIRTUAL'){var _0xebe188={};_0xebe188[_0x354f6f['name']]={'$like':'%'+_0x3857f0[_0x6b83('0x2b')][_0x6b83('0x37')]+'%'};return _0xebe188;}})});}_0x57ea47=_[_0x6b83('0x38')]({},_0x57ea47,_0x3857f0[_0x6b83('0x3a')]);var _0x313114={'where':_0x57ea47[_0x6b83('0x35')]};return db['FreshsalesAccount'][_0x6b83('0x1d')](_0x313114)[_0x6b83('0x23')](function(_0x4661f9){_0x451a5a[_0x6b83('0x1d')]=_0x4661f9;if(_0x3857f0['query'][_0x6b83('0x3b')]){_0x57ea47[_0x6b83('0x3c')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x57ea47);})[_0x6b83('0x23')](function(_0x347b3a){_0x451a5a['rows']=_0x347b3a;return _0x451a5a;})[_0x6b83('0x23')](respondWithFilteredResult(_0x43a6c2,_0x57ea47))[_0x6b83('0x3d')](handleError(_0x43a6c2,null));};exports[_0x6b83('0x3e')]=function(_0x7749f4,_0x387fdd){var _0x591d02={'raw':![],'where':{'id':_0x7749f4[_0x6b83('0x3f')]['id']}},_0x53d479={};_0x53d479['model']=_['keys'](db['FreshsalesAccount'][_0x6b83('0x40')]);_0x53d479['query']=_[_0x6b83('0x2c')](_0x7749f4['query']);_0x53d479[_0x6b83('0x2d')]=_[_0x6b83('0x2e')](_0x53d479['model'],_0x53d479[_0x6b83('0x2b')]);_0x591d02[_0x6b83('0x2f')]=_[_0x6b83('0x2e')](_0x53d479[_0x6b83('0x2a')],qs[_0x6b83('0x30')](_0x7749f4[_0x6b83('0x2b')]['fields']));_0x591d02[_0x6b83('0x2f')]=_0x591d02[_0x6b83('0x2f')][_0x6b83('0x31')]?_0x591d02[_0x6b83('0x2f')]:_0x53d479['model'];if(_0x7749f4[_0x6b83('0x2b')]['includeAll']){_0x591d02['include']=[{'all':!![]}];}_0x591d02=_['merge']({},_0x591d02,_0x7749f4[_0x6b83('0x3a')]);return db[_0x6b83('0x27')][_0x6b83('0x41')](_0x591d02)[_0x6b83('0x23')](handleEntityNotFound(_0x387fdd,null))[_0x6b83('0x23')](respondWithResult(_0x387fdd,null))[_0x6b83('0x3d')](handleError(_0x387fdd,null));};exports['create']=function(_0x3a1f68,_0xe42d7d){return db[_0x6b83('0x27')][_0x6b83('0x42')](_0x3a1f68['body'],{})[_0x6b83('0x23')](respondWithResult(_0xe42d7d,0xc9))[_0x6b83('0x3d')](handleError(_0xe42d7d,null));};exports[_0x6b83('0x22')]=function(_0x162d68,_0x48105f){if(_0x162d68[_0x6b83('0x43')]['id']){delete _0x162d68[_0x6b83('0x43')]['id'];}return db[_0x6b83('0x27')][_0x6b83('0x41')]({'where':{'id':_0x162d68[_0x6b83('0x3f')]['id']}})[_0x6b83('0x23')](handleEntityNotFound(_0x48105f,null))[_0x6b83('0x23')](saveUpdates(_0x162d68[_0x6b83('0x43')],null))[_0x6b83('0x23')](respondWithResult(_0x48105f,null))[_0x6b83('0x3d')](handleError(_0x48105f,null));};exports[_0x6b83('0x44')]=function(_0x18fd44,_0x26cea3){return db['FreshsalesAccount'][_0x6b83('0x41')]({'where':{'id':_0x18fd44[_0x6b83('0x3f')]['id']}})['then'](handleEntityNotFound(_0x26cea3,null))[_0x6b83('0x23')](removeEntity(_0x26cea3,null))[_0x6b83('0x3d')](handleError(_0x26cea3,null));};exports[_0x6b83('0x45')]=function(_0x2ed6fd,_0x1a7c10,_0x4438a7){var _0x13802c={};var _0x5cde88={};var _0x1c1e8c;var _0x16114a;return db[_0x6b83('0x27')][_0x6b83('0x46')]({'where':{'id':_0x2ed6fd[_0x6b83('0x3f')]['id']}})[_0x6b83('0x23')](handleEntityNotFound(_0x1a7c10,null))['then'](function(_0x5cb53d){if(_0x5cb53d){_0x1c1e8c=_0x5cb53d;_0x5cde88[_0x6b83('0x2a')]=_[_0x6b83('0x2c')](db['FreshsalesConfiguration'][_0x6b83('0x40')]);_0x5cde88[_0x6b83('0x2b')]=_[_0x6b83('0x2c')](_0x2ed6fd['query']);_0x5cde88[_0x6b83('0x2d')]=_[_0x6b83('0x2e')](_0x5cde88[_0x6b83('0x2a')],_0x5cde88['query']);_0x13802c[_0x6b83('0x2f')]=_[_0x6b83('0x2e')](_0x5cde88['model'],qs[_0x6b83('0x30')](_0x2ed6fd['query'][_0x6b83('0x30')]));_0x13802c[_0x6b83('0x2f')]=_0x13802c[_0x6b83('0x2f')][_0x6b83('0x31')]?_0x13802c[_0x6b83('0x2f')]:_0x5cde88['model'];_0x13802c[_0x6b83('0x33')]=qs[_0x6b83('0x34')](_0x2ed6fd[_0x6b83('0x2b')][_0x6b83('0x34')]);_0x13802c['where']=qs[_0x6b83('0x2d')](_[_0x6b83('0x36')](_0x2ed6fd[_0x6b83('0x2b')],_0x5cde88[_0x6b83('0x2d')]));if(_0x2ed6fd[_0x6b83('0x2b')]['filter']){_0x13802c[_0x6b83('0x35')]=_[_0x6b83('0x38')](_0x13802c[_0x6b83('0x35')],{'$or':_[_0x6b83('0x39')](_0x13802c[_0x6b83('0x2f')],function(_0xc71f83){var _0x3434ef={};_0x3434ef[_0xc71f83]={'$like':'%'+_0x2ed6fd['query'][_0x6b83('0x37')]+'%'};return _0x3434ef;})});}_0x13802c=_[_0x6b83('0x38')]({},_0x13802c,_0x2ed6fd['options']);return _0x1c1e8c[_0x6b83('0x45')](_0x13802c);}})[_0x6b83('0x23')](function(_0x1ac356){if(_0x1ac356){_0x16114a=_0x1ac356[_0x6b83('0x31')];if(!_0x2ed6fd[_0x6b83('0x2b')][_0x6b83('0x32')](_0x6b83('0x47'))){_0x13802c[_0x6b83('0x1b')]=qs[_0x6b83('0x1b')](_0x2ed6fd[_0x6b83('0x2b')]['limit']);_0x13802c[_0x6b83('0x1e')]=qs['offset'](_0x2ed6fd[_0x6b83('0x2b')]['offset']);}return _0x1c1e8c['getConfigurations'](_0x13802c);}})[_0x6b83('0x23')](function(_0x41622d){if(_0x41622d){return _0x41622d?{'count':_0x16114a,'rows':_0x41622d}:null;}})[_0x6b83('0x23')](respondWithResult(_0x1a7c10,null))[_0x6b83('0x3d')](handleError(_0x1a7c10,null));};exports[_0x6b83('0x48')]=function(_0x34c380,_0x24a813,_0x2405de){if(_0x34c380['body']['id']){delete _0x34c380[_0x6b83('0x43')]['id'];}return db[_0x6b83('0x27')][_0x6b83('0x46')]({'where':{'id':_0x34c380[_0x6b83('0x3f')]['id']}})[_0x6b83('0x23')](handleEntityNotFound(_0x24a813,null))[_0x6b83('0x23')](function(_0x5ef238){if(_0x5ef238){_0x34c380[_0x6b83('0x43')][_0x6b83('0x49')]=_0x5ef238['id'];_0x34c380['body'][_0x6b83('0x4a')]=integrations[_0x6b83('0x4b')](_0x34c380[_0x6b83('0x43')][_0x6b83('0x4c')],_0x34c380[_0x6b83('0x43')][_0x6b83('0x28')]);_0x34c380[_0x6b83('0x43')][_0x6b83('0x4d')]=integrations[_0x6b83('0x4e')](_0x34c380[_0x6b83('0x43')][_0x6b83('0x4c')],_0x34c380['body'][_0x6b83('0x28')]);return db[_0x6b83('0x4f')][_0x6b83('0x42')](_0x34c380[_0x6b83('0x43')],{'include':[{'model':db['FreshsalesField'],'as':_0x6b83('0x4a')},{'model':db['FreshsalesField'],'as':_0x6b83('0x4d')}]});}return null;})[_0x6b83('0x23')](respondWithResult(_0x24a813,null))[_0x6b83('0x3d')](handleError(_0x24a813,null));};exports[_0x6b83('0x50')]=function(_0x4b514c,_0x24aa05,_0x17b919){var _0x219279='';var _0x36baf6='';return db[_0x6b83('0x27')][_0x6b83('0x46')]({'where':{'id':_0x4b514c[_0x6b83('0x3f')]['id']},'attributes':['id',_0x6b83('0x51'),_0x6b83('0x52'),_0x6b83('0x53')]})['then'](handleEntityNotFound(_0x24aa05,null))['then'](function(_0x5d45a9){if(_0x5d45a9){_0x36baf6=_0x5d45a9[_0x6b83('0x51')];_0x219279=_0x5d45a9[_0x6b83('0x52')];var _0x57f15d=_0x5d45a9[_0x6b83('0x52')][_0x6b83('0x54')](-0x1);if(_0x57f15d==='/'){_0x219279=_0x219279[_0x6b83('0x55')](0x0,_0x219279[_0x6b83('0x56')](_0x57f15d));}return rp({'method':'GET','uri':util[_0x6b83('0x57')]('%s%s',_0x219279,'/api/selector/owners'),'headers':{'Authorization':_0x6b83('0x58')+_0x5d45a9[_0x6b83('0x53')]},'json':!![]});}})['then'](function(_0x200d85){if(_0x200d85){var _0x438888=_0x200d85[_0x6b83('0x59')];var _0x3ad3e1=![];var _0x7c5edc=null;for(_0x7c5edc=0x0;_0x7c5edc<_0x438888[_0x6b83('0x31')];_0x7c5edc++){if(_0x438888[_0x7c5edc][_0x6b83('0x5a')]===_0x36baf6){_0x3ad3e1=!![];}}if(_0x3ad3e1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6b83('0x5b')});}}})[_0x6b83('0x23')](respondWithResult(_0x24aa05,null))[_0x6b83('0x3d')](function(_0x318c6b){var _0x2a3572=_0x4b514c[_0x6b83('0x2b')]['test']?0x1f4:_0x318c6b['statusCode']||0x1f4;logger['error'](_0x6b83('0x5c'),'getFields',_0x2a3572,JSON[_0x6b83('0x5d')](_0x318c6b));delete _0x318c6b[_0x6b83('0x24')];if(_0x2a3572===0x191){_0x2a3572=0x190;}_0x24aa05[_0x6b83('0x18')](_0x2a3572)['send'](_0x4b514c[_0x6b83('0x2b')]['test']?{'message':_0x6b83('0x5e'),'statusCode':_0x318c6b[_0x6b83('0x5f')]}:_0x318c6b);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 1af4010..0ca6dbb 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 _0x5464=['int_freshsales_accounts','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount'];(function(_0x53f62b,_0x1af4c9){var _0x11d123=function(_0x6c4e59){while(--_0x6c4e59){_0x53f62b['push'](_0x53f62b['shift']());}};_0x11d123(++_0x1af4c9);}(_0x5464,0x15d));var _0x4546=function(_0x5f0fea,_0x8d79e7){_0x5f0fea=_0x5f0fea-0x0;var _0x1c7950=_0x5464[_0x5f0fea];return _0x1c7950;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));var integrations=require(_0x4546('0x8'));module['exports']=function(_0x57391f,_0x5c5e09){return _0x57391f[_0x4546('0x9')](_0x4546('0xa'),attributes,{'tableName':_0x4546('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x323f=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x48f4ef,_0x5a9a21){var _0x6f762f=function(_0x2341b9){while(--_0x2341b9){_0x48f4ef['push'](_0x48f4ef['shift']());}};_0x6f762f(++_0x5a9a21);}(_0x323f,0x1ee));var _0xf323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x323f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));var integrations=require(_0xf323('0x9'));module[_0xf323('0xa')]=function(_0x5d7d60,_0xb9a667){return _0x5d7d60[_0xf323('0xb')](_0xf323('0xc'),attributes,{'tableName':_0xf323('0xd'),'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 c2e0b85..c0a9658 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 _0xadb5=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','findAll','raw','options','where','attributes','limit','include','map','model','debug','ShowFreshsalesAccount','FreshsalesAccount','find','util','bluebird'];(function(_0x588593,_0x39d091){var _0x370bbf=function(_0x423762){while(--_0x423762){_0x588593['push'](_0x588593['shift']());}};_0x370bbf(++_0x39d091);}(_0xadb5,0xad));var _0x5adb=function(_0x557b22,_0x2ecfb5){_0x557b22=_0x557b22-0x0;var _0x6f5a07=_0xadb5[_0x557b22];return _0x6f5a07;};'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']('FreshsalesAccount,\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['FreshsalesAccount'][_0x5adb('0x16')]({'raw':_0x529b65['options']?_0x529b65['options'][_0x5adb('0x17')]===undefined?!![]:![]:!![],'where':_0x529b65[_0x5adb('0x18')]?_0x529b65[_0x5adb('0x18')][_0x5adb('0x19')]||null:null,'attributes':_0x529b65[_0x5adb('0x18')]?_0x529b65['options'][_0x5adb('0x1a')]||null:null,'limit':_0x529b65['options']?_0x529b65['options'][_0x5adb('0x1b')]||null:null,'include':_0x529b65[_0x5adb('0x18')]?_0x529b65[_0x5adb('0x18')][_0x5adb('0x1c')]?_[_0x5adb('0x1d')](_0x529b65[_0x5adb('0x18')][_0x5adb('0x1c')],function(_0x4ca150){return{'model':db[_0x4ca150[_0x5adb('0x1e')]],'as':_0x4ca150['as'],'attributes':_0x4ca150[_0x5adb('0x1a')],'include':_0x4ca150[_0x5adb('0x1c')]?_[_0x5adb('0x1d')](_0x4ca150[_0x5adb('0x1c')],function(_0x49f203){return{'model':db[_0x49f203[_0x5adb('0x1e')]],'as':_0x49f203['as'],'attributes':_0x49f203[_0x5adb('0x1a')],'include':_0x49f203['include']?_[_0x5adb('0x1d')](_0x49f203[_0x5adb('0x1c')],function(_0x1a0acd){return{'model':db[_0x1a0acd['model']],'as':_0x1a0acd['as'],'attributes':_0x1a0acd[_0x5adb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5adb('0xb')](function(_0x3a4fca){logger[_0x5adb('0xc')](_0x5adb('0x15'),_0x529b65);logger[_0x5adb('0x1f')]('GetFreshsalesAccount',_0x529b65,JSON['stringify'](_0x3a4fca));_0x5de028(_0x3a4fca);})['catch'](function(_0x39bddd){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x39bddd[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x39bddd['message']));});});};exports[_0x5adb('0x20')]=function(_0x34b793){var _0x372da1=this;return new Promise(function(_0x3b1fed,_0x450169){return db[_0x5adb('0x21')][_0x5adb('0x22')]({'raw':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')][_0x5adb('0x17')]===undefined?!![]:![]:!![],'where':_0x34b793['options']?_0x34b793[_0x5adb('0x18')]['where']||null:null,'attributes':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')]['attributes']||null:null,'include':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')][_0x5adb('0x1c')]?_['map'](_0x34b793[_0x5adb('0x18')][_0x5adb('0x1c')],function(_0x4b5887){return{'model':db[_0x4b5887['model']],'as':_0x4b5887['as'],'attributes':_0x4b5887[_0x5adb('0x1a')],'include':_0x4b5887['include']?_[_0x5adb('0x1d')](_0x4b5887[_0x5adb('0x1c')],function(_0x3c2b07){return{'model':db[_0x3c2b07[_0x5adb('0x1e')]],'as':_0x3c2b07['as'],'attributes':_0x3c2b07[_0x5adb('0x1a')],'include':_0x3c2b07['include']?_[_0x5adb('0x1d')](_0x3c2b07[_0x5adb('0x1c')],function(_0x1c3a5c){return{'model':db[_0x1c3a5c['model']],'as':_0x1c3a5c['as'],'attributes':_0x1c3a5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5adb('0xb')](function(_0x5d1baa){logger['info'](_0x5adb('0x20'),_0x34b793);logger['debug'](_0x5adb('0x20'),_0x34b793,JSON['stringify'](_0x5d1baa));_0x3b1fed(_0x5d1baa);})[_0x5adb('0x14')](function(_0x4d052f){logger[_0x5adb('0x10')](_0x5adb('0x20'),_0x4d052f['message'],_0x34b793);_0x450169(_0x372da1[_0x5adb('0x10')](0x1f4,_0x4d052f['message']));});});}; \ No newline at end of file +var _0x4888=['FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshsalesAccount'];(function(_0x4720b6,_0x13c3bd){var _0x235734=function(_0x493745){while(--_0x493745){_0x4720b6['push'](_0x4720b6['shift']());}};_0x235734(++_0x13c3bd);}(_0x4888,0x198));var _0x8488=function(_0x3f7855,_0x535342){_0x3f7855=_0x3f7855-0x0;var _0x301fb7=_0x4888[_0x3f7855];return _0x301fb7;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});}exports[_0x8488('0x17')]=function(_0x60ae2f){var _0x39775f=this;return new Promise(function(_0x1aedb1,_0x27c62a){return db[_0x8488('0x18')][_0x8488('0x19')]({'raw':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x60ae2f['options']?_0x60ae2f['options'][_0x8488('0x1c')]||null:null,'attributes':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1d')]||null:null,'limit':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1e')]||null:null,'include':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')]['include']?_[_0x8488('0x1f')](_0x60ae2f[_0x8488('0x1a')][_0x8488('0x20')],function(_0x1361a6){return{'model':db[_0x1361a6[_0x8488('0x21')]],'as':_0x1361a6['as'],'attributes':_0x1361a6['attributes'],'include':_0x1361a6['include']?_['map'](_0x1361a6['include'],function(_0x472624){return{'model':db[_0x472624['model']],'as':_0x472624['as'],'attributes':_0x472624['attributes'],'include':_0x472624[_0x8488('0x20')]?_[_0x8488('0x1f')](_0x472624[_0x8488('0x20')],function(_0x6ebee0){return{'model':db[_0x6ebee0[_0x8488('0x21')]],'as':_0x6ebee0['as'],'attributes':_0x6ebee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x38c137){logger[_0x8488('0xe')](_0x8488('0x17'),_0x60ae2f);logger[_0x8488('0x11')](_0x8488('0x17'),_0x60ae2f,JSON[_0x8488('0x12')](_0x38c137));_0x1aedb1(_0x38c137);})[_0x8488('0x22')](function(_0x368f9c){logger[_0x8488('0x13')](_0x8488('0x17'),_0x368f9c['message'],_0x60ae2f);_0x27c62a(_0x39775f['error'](0x1f4,_0x368f9c['message']));});});};exports[_0x8488('0x23')]=function(_0x408c36){var _0x19cf42=this;return new Promise(function(_0x121dcc,_0x117321){return db[_0x8488('0x18')]['find']({'raw':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['where']||null:null,'attributes':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['attributes']||null:null,'include':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x20')]?_[_0x8488('0x1f')](_0x408c36[_0x8488('0x1a')]['include'],function(_0x44c8f3){return{'model':db[_0x44c8f3[_0x8488('0x21')]],'as':_0x44c8f3['as'],'attributes':_0x44c8f3[_0x8488('0x1d')],'include':_0x44c8f3['include']?_[_0x8488('0x1f')](_0x44c8f3['include'],function(_0x205ccc){return{'model':db[_0x205ccc[_0x8488('0x21')]],'as':_0x205ccc['as'],'attributes':_0x205ccc[_0x8488('0x1d')],'include':_0x205ccc[_0x8488('0x20')]?_['map'](_0x205ccc[_0x8488('0x20')],function(_0xe71bd9){return{'model':db[_0xe71bd9[_0x8488('0x21')]],'as':_0xe71bd9['as'],'attributes':_0xe71bd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x17bfea){logger[_0x8488('0xe')](_0x8488('0x23'),_0x408c36);logger[_0x8488('0x11')](_0x8488('0x23'),_0x408c36,JSON[_0x8488('0x12')](_0x17bfea));_0x121dcc(_0x17bfea);})[_0x8488('0x22')](function(_0x1a8235){logger[_0x8488('0x13')](_0x8488('0x23'),_0x1a8235['message'],_0x408c36);_0x117321(_0x19cf42['error'](0x1f4,_0x1a8235[_0x8488('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 9325da5..e8587f5 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 _0x167f=['getFields','create','put','update','delete','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x18de95,_0x256f9a){var _0x2d87cd=function(_0x397fe9){while(--_0x397fe9){_0x18de95['push'](_0x18de95['shift']());}};_0x2d87cd(++_0x256f9a);}(_0x167f,0x10b));var _0xf167=function(_0xd31621,_0x17b567){_0xd31621=_0xd31621-0x0;var _0x2e7ac0=_0x167f[_0xd31621];return _0x2e7ac0;};'use strict';var multer=require('multer');var util=require(_0xf167('0x0'));var path=require(_0xf167('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf167('0x2'));var interaction=require(_0xf167('0x3'));var config=require('../../config/environment');var controller=require(_0xf167('0x4'));router[_0xf167('0x5')]('/',auth[_0xf167('0x6')](),controller[_0xf167('0x7')]);router['get'](_0xf167('0x8'),auth[_0xf167('0x6')](),controller[_0xf167('0x9')]);router[_0xf167('0x5')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xf167('0xa')]);router['get'](_0xf167('0xb'),auth[_0xf167('0x6')](),controller[_0xf167('0xc')]);router[_0xf167('0x5')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf167('0xd')]);router['post']('/',auth[_0xf167('0x6')](),controller[_0xf167('0xe')]);router[_0xf167('0xf')](_0xf167('0x8'),auth[_0xf167('0x6')](),controller[_0xf167('0x10')]);router[_0xf167('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf167('0x12')]);module[_0xf167('0x13')]=router; \ No newline at end of file +var _0x46ac=['show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x101cf5,_0x4bc4ab){var _0xa8d8ec=function(_0x3fb9bc){while(--_0x3fb9bc){_0x101cf5['push'](_0x101cf5['shift']());}};_0xa8d8ec(++_0x4bc4ab);}(_0x46ac,0xd3));var _0xc46a=function(_0x492c40,_0x4d16aa){_0x492c40=_0x492c40-0x0;var _0x373710=_0x46ac[_0x492c40];return _0x373710;};'use strict';var multer=require(_0xc46a('0x0'));var util=require(_0xc46a('0x1'));var path=require(_0xc46a('0x2'));var timeout=require(_0xc46a('0x3'));var express=require(_0xc46a('0x4'));var router=express[_0xc46a('0x5')]();var fs_extra=require(_0xc46a('0x6'));var auth=require(_0xc46a('0x7'));var interaction=require(_0xc46a('0x8'));var config=require(_0xc46a('0x9'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xc46a('0xa')](),controller[_0xc46a('0xb')]);router[_0xc46a('0xc')](_0xc46a('0xd'),auth[_0xc46a('0xa')](),controller[_0xc46a('0xe')]);router[_0xc46a('0xc')](_0xc46a('0xf'),auth[_0xc46a('0xa')](),controller[_0xc46a('0x10')]);router['get'](_0xc46a('0x11'),auth[_0xc46a('0xa')](),controller[_0xc46a('0x12')]);router[_0xc46a('0xc')]('/:id/fields',auth[_0xc46a('0xa')](),controller['getFields']);router[_0xc46a('0x13')]('/',auth[_0xc46a('0xa')](),controller[_0xc46a('0x14')]);router[_0xc46a('0x15')](_0xc46a('0xd'),auth['isAuthenticated'](),controller[_0xc46a('0x16')]);router['delete'](_0xc46a('0xd'),auth['isAuthenticated'](),controller[_0xc46a('0x17')]);module[_0xc46a('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 16583dd..1b23b4c 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 _0xca25=['STRING','sequelize','exports'];(function(_0x29cf58,_0x2d34c9){var _0x2f82e5=function(_0x2111b8){while(--_0x2111b8){_0x29cf58['push'](_0x29cf58['shift']());}};_0x2f82e5(++_0x2d34c9);}(_0xca25,0x1ae));var _0x5ca2=function(_0x599318,_0x319486){_0x599318=_0x599318-0x0;var _0x7b06fa=_0xca25[_0x599318];return _0x7b06fa;};'use strict';var Sequelize=require(_0x5ca2('0x0'));module[_0x5ca2('0x1')]={'name':{'type':Sequelize[_0x5ca2('0x2')]},'description':{'type':Sequelize[_0x5ca2('0x2')]}}; \ No newline at end of file +var _0xf055=['STRING','sequelize'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xf055,0x1b7));var _0x5f05=function(_0x2e6c75,_0x1bdbb7){_0x2e6c75=_0x2e6c75-0x0;var _0x13a9ea=_0xf055[_0x2e6c75];return _0x13a9ea;};'use strict';var Sequelize=require(_0x5f05('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5f05('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index e22cedf..12d94c0 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 _0xaa37=['include','options','find','create','body','params','findOne','getSubjects','getDescriptions','getFields','FreshsalesField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','sendStatus','status','offset','undefined','count','limit','json','reject','save','update','destroy','then','end','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show'];(function(_0xc6879,_0x84a966){var _0x54f7a4=function(_0x4e63eb){while(--_0x4e63eb){_0xc6879['push'](_0xc6879['shift']());}};_0x54f7a4(++_0x84a966);}(_0xaa37,0x13b));var _0x7aa3=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xaa37[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x7aa3('0x0'));var rimraf=require(_0x7aa3('0x1'));var zipdir=require(_0x7aa3('0x2'));var jsonpatch=require(_0x7aa3('0x3'));var rp=require(_0x7aa3('0x4'));var moment=require('moment');var BPromise=require(_0x7aa3('0x5'));var Mustache=require(_0x7aa3('0x6'));var util=require(_0x7aa3('0x7'));var path=require('path');var sox=require(_0x7aa3('0x8'));var csv=require('to-csv');var ejs=require(_0x7aa3('0x9'));var fs=require('fs');var fs_extra=require(_0x7aa3('0xa'));var _=require(_0x7aa3('0xb'));var squel=require(_0x7aa3('0xc'));var crypto=require(_0x7aa3('0xd'));var jsforce=require(_0x7aa3('0xe'));var deskjs=require(_0x7aa3('0xf'));var toCsv=require(_0x7aa3('0x10'));var querystring=require('querystring');var Papa=require(_0x7aa3('0x11'));var Redis=require('ioredis');var authService=require(_0x7aa3('0x12'));var qs=require(_0x7aa3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7aa3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7aa3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d5db5,_0x594456){_0x594456=_0x594456||0xcc;return function(_0x2e682a){if(_0x2e682a){return _0x5d5db5[_0x7aa3('0x16')](_0x594456);}return _0x5d5db5[_0x7aa3('0x17')](_0x594456)['end']();};}function respondWithResult(_0x2eadba,_0x4db889){_0x4db889=_0x4db889||0xc8;return function(_0xc6623b){if(_0xc6623b){return _0x2eadba[_0x7aa3('0x17')](_0x4db889)['json'](_0xc6623b);}};}function respondWithFilteredResult(_0x57487d,_0x20373b){return function(_0x5dce9e){if(_0x5dce9e){var _0x236625=typeof _0x20373b[_0x7aa3('0x18')]===_0x7aa3('0x19')&&typeof _0x20373b['limit']===_0x7aa3('0x19');var _0x2c2e82=_0x5dce9e['count'];var _0x4d9666=_0x236625?0x0:_0x20373b['offset'];var _0x8d3d6=_0x236625?_0x5dce9e[_0x7aa3('0x1a')]:_0x20373b[_0x7aa3('0x18')]+_0x20373b[_0x7aa3('0x1b')];var _0xef6ec9;if(_0x8d3d6>=_0x2c2e82){_0x8d3d6=_0x2c2e82;_0xef6ec9=0xc8;}else{_0xef6ec9=0xce;}_0x57487d[_0x7aa3('0x17')](_0xef6ec9);return _0x57487d['set']('Content-Range',_0x4d9666+'-'+_0x8d3d6+'/'+_0x2c2e82)[_0x7aa3('0x1c')](_0x5dce9e);}return null;};}function patchUpdates(_0x4ed778){return function(_0x4ec971){try{jsonpatch['apply'](_0x4ec971,_0x4ed778,!![]);}catch(_0x417de4){return BPromise[_0x7aa3('0x1d')](_0x417de4);}return _0x4ec971[_0x7aa3('0x1e')]();};}function saveUpdates(_0x657bb2,_0x25c405){return function(_0x1f2aa8){if(_0x1f2aa8){return _0x1f2aa8[_0x7aa3('0x1f')](_0x657bb2)['then'](function(_0x3b97b7){return _0x3b97b7;});}return null;};}function removeEntity(_0x2797ca,_0x36b15d){return function(_0x38034e){if(_0x38034e){return _0x38034e[_0x7aa3('0x20')]()[_0x7aa3('0x21')](function(){_0x2797ca['status'](0xcc)[_0x7aa3('0x22')]();});}};}function handleEntityNotFound(_0xd4fd8c,_0x1fded3){return function(_0x4c0aac){if(!_0x4c0aac){_0xd4fd8c[_0x7aa3('0x16')](0x194);}return _0x4c0aac;};}function handleError(_0x31f2b8,_0x163bc7){_0x163bc7=_0x163bc7||0x1f4;return function(_0xa3eea8){logger['error'](_0xa3eea8[_0x7aa3('0x23')]);if(_0xa3eea8[_0x7aa3('0x24')]){delete _0xa3eea8['name'];}_0x31f2b8[_0x7aa3('0x17')](_0x163bc7)[_0x7aa3('0x25')](_0xa3eea8);};}exports[_0x7aa3('0x26')]=function(_0x96176c,_0x39ff6e){var _0x1442e0={},_0x39a032={},_0x3f9053={'count':0x0,'rows':[]};var _0x16743e=_[_0x7aa3('0x27')](db[_0x7aa3('0x28')][_0x7aa3('0x29')],function(_0x12dcd8){return{'name':_0x12dcd8[_0x7aa3('0x2a')],'type':_0x12dcd8[_0x7aa3('0x2b')]['key']};});_0x39a032[_0x7aa3('0x2c')]=_['map'](_0x16743e,_0x7aa3('0x24'));_0x39a032[_0x7aa3('0x2d')]=_[_0x7aa3('0x2e')](_0x96176c[_0x7aa3('0x2d')]);_0x39a032['filters']=_[_0x7aa3('0x2f')](_0x39a032[_0x7aa3('0x2c')],_0x39a032[_0x7aa3('0x2d')]);_0x1442e0[_0x7aa3('0x30')]=_[_0x7aa3('0x2f')](_0x39a032['model'],qs[_0x7aa3('0x31')](_0x96176c[_0x7aa3('0x2d')]['fields']));_0x1442e0[_0x7aa3('0x30')]=_0x1442e0['attributes'][_0x7aa3('0x32')]?_0x1442e0[_0x7aa3('0x30')]:_0x39a032['model'];if(!_0x96176c[_0x7aa3('0x2d')][_0x7aa3('0x33')](_0x7aa3('0x34'))){_0x1442e0[_0x7aa3('0x1b')]=qs['limit'](_0x96176c[_0x7aa3('0x2d')]['limit']);_0x1442e0[_0x7aa3('0x18')]=qs[_0x7aa3('0x18')](_0x96176c[_0x7aa3('0x2d')][_0x7aa3('0x18')]);}_0x1442e0[_0x7aa3('0x35')]=qs[_0x7aa3('0x36')](_0x96176c[_0x7aa3('0x2d')][_0x7aa3('0x36')]);_0x1442e0[_0x7aa3('0x37')]=qs[_0x7aa3('0x38')](_[_0x7aa3('0x39')](_0x96176c[_0x7aa3('0x2d')],_0x39a032[_0x7aa3('0x38')]),_0x16743e);if(_0x96176c[_0x7aa3('0x2d')][_0x7aa3('0x3a')]){_0x1442e0[_0x7aa3('0x37')]=_[_0x7aa3('0x3b')](_0x1442e0['where'],{'$or':_[_0x7aa3('0x27')](_0x16743e,function(_0x5ec42b){if(_0x5ec42b['type']!=='VIRTUAL'){var _0x466fb4={};_0x466fb4[_0x5ec42b[_0x7aa3('0x24')]]={'$like':'%'+_0x96176c['query']['filter']+'%'};return _0x466fb4;}})});}_0x1442e0=_[_0x7aa3('0x3b')]({},_0x1442e0,_0x96176c['options']);var _0x52c950={'where':_0x1442e0['where']};return db[_0x7aa3('0x28')][_0x7aa3('0x1a')](_0x52c950)[_0x7aa3('0x21')](function(_0x1d789a){_0x3f9053['count']=_0x1d789a;if(_0x96176c[_0x7aa3('0x2d')][_0x7aa3('0x3c')]){_0x1442e0['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x7aa3('0x3d')](_0x1442e0);})[_0x7aa3('0x21')](function(_0x5c50f7){_0x3f9053[_0x7aa3('0x3e')]=_0x5c50f7;return _0x3f9053;})[_0x7aa3('0x21')](respondWithFilteredResult(_0x39ff6e,_0x1442e0))[_0x7aa3('0x3f')](handleError(_0x39ff6e,null));};exports[_0x7aa3('0x40')]=function(_0x520a7a,_0x1439b8){var _0x3e282a={'raw':![],'where':{'id':_0x520a7a['params']['id']}},_0x18ec80={};_0x18ec80[_0x7aa3('0x2c')]=_['keys'](db[_0x7aa3('0x28')][_0x7aa3('0x29')]);_0x18ec80[_0x7aa3('0x2d')]=_[_0x7aa3('0x2e')](_0x520a7a[_0x7aa3('0x2d')]);_0x18ec80[_0x7aa3('0x38')]=_['intersection'](_0x18ec80[_0x7aa3('0x2c')],_0x18ec80[_0x7aa3('0x2d')]);_0x3e282a[_0x7aa3('0x30')]=_[_0x7aa3('0x2f')](_0x18ec80[_0x7aa3('0x2c')],qs[_0x7aa3('0x31')](_0x520a7a[_0x7aa3('0x2d')][_0x7aa3('0x31')]));_0x3e282a[_0x7aa3('0x30')]=_0x3e282a[_0x7aa3('0x30')]['length']?_0x3e282a[_0x7aa3('0x30')]:_0x18ec80['model'];if(_0x520a7a[_0x7aa3('0x2d')]['includeAll']){_0x3e282a[_0x7aa3('0x41')]=[{'all':!![]}];}_0x3e282a=_[_0x7aa3('0x3b')]({},_0x3e282a,_0x520a7a[_0x7aa3('0x42')]);return db[_0x7aa3('0x28')][_0x7aa3('0x43')](_0x3e282a)['then'](handleEntityNotFound(_0x1439b8,null))[_0x7aa3('0x21')](respondWithResult(_0x1439b8,null))[_0x7aa3('0x3f')](handleError(_0x1439b8,null));};exports[_0x7aa3('0x44')]=function(_0xb02cce,_0x3474b7){return db['FreshsalesConfiguration'][_0x7aa3('0x44')](_0xb02cce[_0x7aa3('0x45')],{})[_0x7aa3('0x21')](respondWithResult(_0x3474b7,0xc9))[_0x7aa3('0x3f')](handleError(_0x3474b7,null));};exports[_0x7aa3('0x1f')]=function(_0x2a1d14,_0x1922f2){if(_0x2a1d14[_0x7aa3('0x45')]['id']){delete _0x2a1d14[_0x7aa3('0x45')]['id'];}return db['FreshsalesConfiguration'][_0x7aa3('0x43')]({'where':{'id':_0x2a1d14[_0x7aa3('0x46')]['id']}})[_0x7aa3('0x21')](handleEntityNotFound(_0x1922f2,null))[_0x7aa3('0x21')](saveUpdates(_0x2a1d14[_0x7aa3('0x45')],null))[_0x7aa3('0x21')](respondWithResult(_0x1922f2,null))[_0x7aa3('0x3f')](handleError(_0x1922f2,null));};exports[_0x7aa3('0x20')]=function(_0x18c0cb,_0x14101a){return db[_0x7aa3('0x28')]['find']({'where':{'id':_0x18c0cb[_0x7aa3('0x46')]['id']}})['then'](handleEntityNotFound(_0x14101a,null))[_0x7aa3('0x21')](removeEntity(_0x14101a,null))[_0x7aa3('0x3f')](handleError(_0x14101a,null));};exports['getSubjects']=function(_0x32b6c1,_0x3561b8,_0x495858){var _0x5f5670={};var _0x4b8ced={};var _0x1f18e6;var _0x4ac0af;return db[_0x7aa3('0x28')][_0x7aa3('0x47')]({'where':{'id':_0x32b6c1[_0x7aa3('0x46')]['id']}})[_0x7aa3('0x21')](handleEntityNotFound(_0x3561b8,null))[_0x7aa3('0x21')](function(_0x1fdf7a){if(_0x1fdf7a){_0x1f18e6=_0x1fdf7a;_0x4b8ced['model']=_[_0x7aa3('0x2e')](db['FreshsalesField'][_0x7aa3('0x29')]);_0x4b8ced[_0x7aa3('0x2d')]=_[_0x7aa3('0x2e')](_0x32b6c1[_0x7aa3('0x2d')]);_0x4b8ced['filters']=_[_0x7aa3('0x2f')](_0x4b8ced[_0x7aa3('0x2c')],_0x4b8ced['query']);_0x5f5670[_0x7aa3('0x30')]=_[_0x7aa3('0x2f')](_0x4b8ced[_0x7aa3('0x2c')],qs[_0x7aa3('0x31')](_0x32b6c1[_0x7aa3('0x2d')][_0x7aa3('0x31')]));_0x5f5670[_0x7aa3('0x30')]=_0x5f5670[_0x7aa3('0x30')][_0x7aa3('0x32')]?_0x5f5670['attributes']:_0x4b8ced[_0x7aa3('0x2c')];_0x5f5670['order']=qs[_0x7aa3('0x36')](_0x32b6c1[_0x7aa3('0x2d')]['sort']);_0x5f5670[_0x7aa3('0x37')]=qs[_0x7aa3('0x38')](_['pick'](_0x32b6c1[_0x7aa3('0x2d')],_0x4b8ced[_0x7aa3('0x38')]));if(_0x32b6c1['query'][_0x7aa3('0x3a')]){_0x5f5670[_0x7aa3('0x37')]=_[_0x7aa3('0x3b')](_0x5f5670[_0x7aa3('0x37')],{'$or':_[_0x7aa3('0x27')](_0x5f5670[_0x7aa3('0x30')],function(_0xcc6a4e){var _0x5cde75={};_0x5cde75[_0xcc6a4e]={'$like':'%'+_0x32b6c1[_0x7aa3('0x2d')]['filter']+'%'};return _0x5cde75;})});}_0x5f5670=_['merge']({},_0x5f5670,_0x32b6c1['options']);return _0x1f18e6[_0x7aa3('0x48')](_0x5f5670);}})[_0x7aa3('0x21')](function(_0x47c696){if(_0x47c696){_0x4ac0af=_0x47c696['length'];if(!_0x32b6c1['query'][_0x7aa3('0x33')](_0x7aa3('0x34'))){_0x5f5670[_0x7aa3('0x1b')]=qs['limit'](_0x32b6c1[_0x7aa3('0x2d')][_0x7aa3('0x1b')]);_0x5f5670[_0x7aa3('0x18')]=qs[_0x7aa3('0x18')](_0x32b6c1[_0x7aa3('0x2d')][_0x7aa3('0x18')]);}return _0x1f18e6[_0x7aa3('0x48')](_0x5f5670);}})[_0x7aa3('0x21')](function(_0x100796){if(_0x100796){return _0x100796?{'count':_0x4ac0af,'rows':_0x100796}:null;}})['then'](respondWithResult(_0x3561b8,null))[_0x7aa3('0x3f')](handleError(_0x3561b8,null));};exports[_0x7aa3('0x49')]=function(_0x15df12,_0x15735c,_0x9798f0){var _0x1f945c={};var _0x5c6361={};var _0x573d38;var _0x574a54;return db[_0x7aa3('0x28')][_0x7aa3('0x47')]({'where':{'id':_0x15df12[_0x7aa3('0x46')]['id']}})[_0x7aa3('0x21')](handleEntityNotFound(_0x15735c,null))[_0x7aa3('0x21')](function(_0x4ee5dc){if(_0x4ee5dc){_0x573d38=_0x4ee5dc;_0x5c6361[_0x7aa3('0x2c')]=_['keys'](db['FreshsalesField'][_0x7aa3('0x29')]);_0x5c6361[_0x7aa3('0x2d')]=_[_0x7aa3('0x2e')](_0x15df12[_0x7aa3('0x2d')]);_0x5c6361[_0x7aa3('0x38')]=_[_0x7aa3('0x2f')](_0x5c6361[_0x7aa3('0x2c')],_0x5c6361[_0x7aa3('0x2d')]);_0x1f945c['attributes']=_['intersection'](_0x5c6361['model'],qs['fields'](_0x15df12[_0x7aa3('0x2d')][_0x7aa3('0x31')]));_0x1f945c[_0x7aa3('0x30')]=_0x1f945c[_0x7aa3('0x30')][_0x7aa3('0x32')]?_0x1f945c[_0x7aa3('0x30')]:_0x5c6361[_0x7aa3('0x2c')];_0x1f945c[_0x7aa3('0x35')]=qs[_0x7aa3('0x36')](_0x15df12[_0x7aa3('0x2d')][_0x7aa3('0x36')]);_0x1f945c[_0x7aa3('0x37')]=qs[_0x7aa3('0x38')](_['pick'](_0x15df12[_0x7aa3('0x2d')],_0x5c6361[_0x7aa3('0x38')]));if(_0x15df12[_0x7aa3('0x2d')]['filter']){_0x1f945c[_0x7aa3('0x37')]=_['merge'](_0x1f945c[_0x7aa3('0x37')],{'$or':_[_0x7aa3('0x27')](_0x1f945c['attributes'],function(_0xed455a){var _0x4e5f3b={};_0x4e5f3b[_0xed455a]={'$like':'%'+_0x15df12['query'][_0x7aa3('0x3a')]+'%'};return _0x4e5f3b;})});}_0x1f945c=_['merge']({},_0x1f945c,_0x15df12[_0x7aa3('0x42')]);return _0x573d38[_0x7aa3('0x49')](_0x1f945c);}})[_0x7aa3('0x21')](function(_0x354e77){if(_0x354e77){_0x574a54=_0x354e77[_0x7aa3('0x32')];if(!_0x15df12['query'][_0x7aa3('0x33')]('nolimit')){_0x1f945c['limit']=qs['limit'](_0x15df12[_0x7aa3('0x2d')][_0x7aa3('0x1b')]);_0x1f945c[_0x7aa3('0x18')]=qs['offset'](_0x15df12[_0x7aa3('0x2d')][_0x7aa3('0x18')]);}return _0x573d38['getDescriptions'](_0x1f945c);}})[_0x7aa3('0x21')](function(_0x5a216f){if(_0x5a216f){return _0x5a216f?{'count':_0x574a54,'rows':_0x5a216f}:null;}})[_0x7aa3('0x21')](respondWithResult(_0x15735c,null))['catch'](handleError(_0x15735c,null));};exports[_0x7aa3('0x4a')]=function(_0x494db6,_0x4fcf36,_0x5c19a8){var _0x1aa14f={};var _0x387cb9={};var _0x1d33b0;var _0x5751ce;return db[_0x7aa3('0x28')]['findOne']({'where':{'id':_0x494db6['params']['id']}})['then'](handleEntityNotFound(_0x4fcf36,null))[_0x7aa3('0x21')](function(_0x51035c){if(_0x51035c){_0x1d33b0=_0x51035c;_0x387cb9[_0x7aa3('0x2c')]=_[_0x7aa3('0x2e')](db[_0x7aa3('0x4b')]['rawAttributes']);_0x387cb9[_0x7aa3('0x2d')]=_[_0x7aa3('0x2e')](_0x494db6[_0x7aa3('0x2d')]);_0x387cb9[_0x7aa3('0x38')]=_[_0x7aa3('0x2f')](_0x387cb9[_0x7aa3('0x2c')],_0x387cb9['query']);_0x1aa14f[_0x7aa3('0x30')]=_[_0x7aa3('0x2f')](_0x387cb9['model'],qs['fields'](_0x494db6[_0x7aa3('0x2d')]['fields']));_0x1aa14f['attributes']=_0x1aa14f[_0x7aa3('0x30')][_0x7aa3('0x32')]?_0x1aa14f[_0x7aa3('0x30')]:_0x387cb9[_0x7aa3('0x2c')];_0x1aa14f['order']=qs[_0x7aa3('0x36')](_0x494db6[_0x7aa3('0x2d')][_0x7aa3('0x36')]);_0x1aa14f['where']=qs[_0x7aa3('0x38')](_[_0x7aa3('0x39')](_0x494db6[_0x7aa3('0x2d')],_0x387cb9[_0x7aa3('0x38')]));if(_0x494db6[_0x7aa3('0x2d')][_0x7aa3('0x3a')]){_0x1aa14f[_0x7aa3('0x37')]=_[_0x7aa3('0x3b')](_0x1aa14f[_0x7aa3('0x37')],{'$or':_[_0x7aa3('0x27')](_0x1aa14f[_0x7aa3('0x30')],function(_0x4a5919){var _0x45cee0={};_0x45cee0[_0x4a5919]={'$like':'%'+_0x494db6[_0x7aa3('0x2d')][_0x7aa3('0x3a')]+'%'};return _0x45cee0;})});}_0x1aa14f=_[_0x7aa3('0x3b')]({},_0x1aa14f,_0x494db6[_0x7aa3('0x42')]);return _0x1d33b0['getFields'](_0x1aa14f);}})[_0x7aa3('0x21')](function(_0x1e2e9c){if(_0x1e2e9c){_0x5751ce=_0x1e2e9c['length'];if(!_0x494db6[_0x7aa3('0x2d')][_0x7aa3('0x33')]('nolimit')){_0x1aa14f[_0x7aa3('0x1b')]=qs[_0x7aa3('0x1b')](_0x494db6[_0x7aa3('0x2d')][_0x7aa3('0x1b')]);_0x1aa14f[_0x7aa3('0x18')]=qs[_0x7aa3('0x18')](_0x494db6['query']['offset']);}return _0x1d33b0['getFields'](_0x1aa14f);}})[_0x7aa3('0x21')](function(_0x29ba9d){if(_0x29ba9d){return _0x29ba9d?{'count':_0x5751ce,'rows':_0x29ba9d}:null;}})[_0x7aa3('0x21')](respondWithResult(_0x4fcf36,null))[_0x7aa3('0x3f')](handleError(_0x4fcf36,null));}; \ No newline at end of file +var _0x1801=['lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','send','index','map','rawAttributes','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','offset','order','sort','where','filter','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','getSubjects','findOne','FreshsalesField','getDescriptions','pick','getFields','nolimit','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x1801,0x18c));var _0x1180=function(_0x5af4ff,_0x36409d){_0x5af4ff=_0x5af4ff-0x0;var _0x1554f5=_0x1801[_0x5af4ff];return _0x1554f5;};'use strict';var emlformat=require(_0x1180('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1180('0x1'));var rp=require(_0x1180('0x2'));var moment=require('moment');var BPromise=require(_0x1180('0x3'));var Mustache=require(_0x1180('0x4'));var util=require(_0x1180('0x5'));var path=require(_0x1180('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1180('0x7'));var fs=require('fs');var fs_extra=require(_0x1180('0x8'));var _=require(_0x1180('0x9'));var squel=require(_0x1180('0xa'));var crypto=require(_0x1180('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1180('0xc'));var toCsv=require(_0x1180('0xd'));var querystring=require(_0x1180('0xe'));var Papa=require(_0x1180('0xf'));var Redis=require(_0x1180('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1180('0x11'));var as=require(_0x1180('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1180('0x13'))('api');var utils=require(_0x1180('0x14'));var config=require(_0x1180('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1180('0x16'))['db'];function respondWithStatusCode(_0x43d347,_0x1e90d6){_0x1e90d6=_0x1e90d6||0xcc;return function(_0x28e8a0){if(_0x28e8a0){return _0x43d347['sendStatus'](_0x1e90d6);}return _0x43d347[_0x1180('0x17')](_0x1e90d6)[_0x1180('0x18')]();};}function respondWithResult(_0x1aaa6a,_0x2b8cd4){_0x2b8cd4=_0x2b8cd4||0xc8;return function(_0x1a6dde){if(_0x1a6dde){return _0x1aaa6a['status'](_0x2b8cd4)[_0x1180('0x19')](_0x1a6dde);}};}function respondWithFilteredResult(_0x2e3c78,_0x4f76d4){return function(_0x1eff18){if(_0x1eff18){var _0x23b7a5=typeof _0x4f76d4['offset']===_0x1180('0x1a')&&typeof _0x4f76d4[_0x1180('0x1b')]===_0x1180('0x1a');var _0x182139=_0x1eff18[_0x1180('0x1c')];var _0x216892=_0x23b7a5?0x0:_0x4f76d4['offset'];var _0xf02c40=_0x23b7a5?_0x1eff18['count']:_0x4f76d4['offset']+_0x4f76d4[_0x1180('0x1b')];var _0x5509d0;if(_0xf02c40>=_0x182139){_0xf02c40=_0x182139;_0x5509d0=0xc8;}else{_0x5509d0=0xce;}_0x2e3c78[_0x1180('0x17')](_0x5509d0);return _0x2e3c78[_0x1180('0x1d')](_0x1180('0x1e'),_0x216892+'-'+_0xf02c40+'/'+_0x182139)[_0x1180('0x19')](_0x1eff18);}return null;};}function patchUpdates(_0x196b2c){return function(_0x294502){try{jsonpatch[_0x1180('0x1f')](_0x294502,_0x196b2c,!![]);}catch(_0x2ba164){return BPromise[_0x1180('0x20')](_0x2ba164);}return _0x294502[_0x1180('0x21')]();};}function saveUpdates(_0x27fe93,_0x531c75){return function(_0x105ab0){if(_0x105ab0){return _0x105ab0[_0x1180('0x22')](_0x27fe93)[_0x1180('0x23')](function(_0x4eda5e){return _0x4eda5e;});}return null;};}function removeEntity(_0x3cc827,_0x1a5e9b){return function(_0x1259ff){if(_0x1259ff){return _0x1259ff['destroy']()[_0x1180('0x23')](function(){_0x3cc827[_0x1180('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aed2f,_0x58a7dd){return function(_0x1d250c){if(!_0x1d250c){_0x4aed2f['sendStatus'](0x194);}return _0x1d250c;};}function handleError(_0x3b524f,_0x420e33){_0x420e33=_0x420e33||0x1f4;return function(_0x1adc65){logger[_0x1180('0x24')](_0x1adc65['stack']);if(_0x1adc65['name']){delete _0x1adc65['name'];}_0x3b524f[_0x1180('0x17')](_0x420e33)[_0x1180('0x25')](_0x1adc65);};}exports[_0x1180('0x26')]=function(_0x32c396,_0x46ed57){var _0x1f69c8={},_0x17239e={},_0x4fa1c1={'count':0x0,'rows':[]};var _0x311cce=_[_0x1180('0x27')](db['FreshsalesConfiguration'][_0x1180('0x28')],function(_0x30f760){return{'name':_0x30f760[_0x1180('0x29')],'type':_0x30f760[_0x1180('0x2a')][_0x1180('0x2b')]};});_0x17239e['model']=_[_0x1180('0x27')](_0x311cce,_0x1180('0x2c'));_0x17239e['query']=_['keys'](_0x32c396[_0x1180('0x2d')]);_0x17239e[_0x1180('0x2e')]=_[_0x1180('0x2f')](_0x17239e['model'],_0x17239e[_0x1180('0x2d')]);_0x1f69c8[_0x1180('0x30')]=_[_0x1180('0x2f')](_0x17239e[_0x1180('0x31')],qs[_0x1180('0x32')](_0x32c396[_0x1180('0x2d')][_0x1180('0x32')]));_0x1f69c8[_0x1180('0x30')]=_0x1f69c8[_0x1180('0x30')][_0x1180('0x33')]?_0x1f69c8[_0x1180('0x30')]:_0x17239e[_0x1180('0x31')];if(!_0x32c396[_0x1180('0x2d')][_0x1180('0x34')]('nolimit')){_0x1f69c8[_0x1180('0x1b')]=qs[_0x1180('0x1b')](_0x32c396['query'][_0x1180('0x1b')]);_0x1f69c8[_0x1180('0x35')]=qs[_0x1180('0x35')](_0x32c396[_0x1180('0x2d')][_0x1180('0x35')]);}_0x1f69c8[_0x1180('0x36')]=qs['sort'](_0x32c396[_0x1180('0x2d')][_0x1180('0x37')]);_0x1f69c8[_0x1180('0x38')]=qs['filters'](_['pick'](_0x32c396['query'],_0x17239e['filters']),_0x311cce);if(_0x32c396[_0x1180('0x2d')][_0x1180('0x39')]){_0x1f69c8[_0x1180('0x38')]=_['merge'](_0x1f69c8[_0x1180('0x38')],{'$or':_[_0x1180('0x27')](_0x311cce,function(_0x39eb75){if(_0x39eb75['type']!==_0x1180('0x3a')){var _0xe2059={};_0xe2059[_0x39eb75[_0x1180('0x2c')]]={'$like':'%'+_0x32c396[_0x1180('0x2d')][_0x1180('0x39')]+'%'};return _0xe2059;}})});}_0x1f69c8=_[_0x1180('0x3b')]({},_0x1f69c8,_0x32c396[_0x1180('0x3c')]);var _0x3d5395={'where':_0x1f69c8[_0x1180('0x38')]};return db[_0x1180('0x3d')][_0x1180('0x1c')](_0x3d5395)[_0x1180('0x23')](function(_0x48c7b4){_0x4fa1c1[_0x1180('0x1c')]=_0x48c7b4;if(_0x32c396['query'][_0x1180('0x3e')]){_0x1f69c8[_0x1180('0x3f')]=[{'all':!![]}];}return db[_0x1180('0x3d')][_0x1180('0x40')](_0x1f69c8);})[_0x1180('0x23')](function(_0x5af069){_0x4fa1c1[_0x1180('0x41')]=_0x5af069;return _0x4fa1c1;})[_0x1180('0x23')](respondWithFilteredResult(_0x46ed57,_0x1f69c8))[_0x1180('0x42')](handleError(_0x46ed57,null));};exports[_0x1180('0x43')]=function(_0x2b8f67,_0x22bad2){var _0x530cab={'raw':![],'where':{'id':_0x2b8f67[_0x1180('0x44')]['id']}},_0x5009fd={};_0x5009fd['model']=_[_0x1180('0x45')](db['FreshsalesConfiguration'][_0x1180('0x28')]);_0x5009fd[_0x1180('0x2d')]=_[_0x1180('0x45')](_0x2b8f67['query']);_0x5009fd[_0x1180('0x2e')]=_['intersection'](_0x5009fd[_0x1180('0x31')],_0x5009fd['query']);_0x530cab[_0x1180('0x30')]=_['intersection'](_0x5009fd['model'],qs[_0x1180('0x32')](_0x2b8f67[_0x1180('0x2d')][_0x1180('0x32')]));_0x530cab[_0x1180('0x30')]=_0x530cab[_0x1180('0x30')][_0x1180('0x33')]?_0x530cab[_0x1180('0x30')]:_0x5009fd[_0x1180('0x31')];if(_0x2b8f67[_0x1180('0x2d')][_0x1180('0x3e')]){_0x530cab['include']=[{'all':!![]}];}_0x530cab=_[_0x1180('0x3b')]({},_0x530cab,_0x2b8f67[_0x1180('0x3c')]);return db[_0x1180('0x3d')][_0x1180('0x46')](_0x530cab)[_0x1180('0x23')](handleEntityNotFound(_0x22bad2,null))['then'](respondWithResult(_0x22bad2,null))[_0x1180('0x42')](handleError(_0x22bad2,null));};exports[_0x1180('0x47')]=function(_0x277be6,_0x32a667){return db[_0x1180('0x3d')][_0x1180('0x47')](_0x277be6[_0x1180('0x48')],{})[_0x1180('0x23')](respondWithResult(_0x32a667,0xc9))[_0x1180('0x42')](handleError(_0x32a667,null));};exports['update']=function(_0x3b1ec1,_0x412a2d){if(_0x3b1ec1[_0x1180('0x48')]['id']){delete _0x3b1ec1[_0x1180('0x48')]['id'];}return db[_0x1180('0x3d')]['find']({'where':{'id':_0x3b1ec1[_0x1180('0x44')]['id']}})[_0x1180('0x23')](handleEntityNotFound(_0x412a2d,null))[_0x1180('0x23')](saveUpdates(_0x3b1ec1[_0x1180('0x48')],null))[_0x1180('0x23')](respondWithResult(_0x412a2d,null))[_0x1180('0x42')](handleError(_0x412a2d,null));};exports[_0x1180('0x49')]=function(_0x495699,_0x3eb913){return db[_0x1180('0x3d')][_0x1180('0x46')]({'where':{'id':_0x495699[_0x1180('0x44')]['id']}})['then'](handleEntityNotFound(_0x3eb913,null))['then'](removeEntity(_0x3eb913,null))[_0x1180('0x42')](handleError(_0x3eb913,null));};exports[_0x1180('0x4a')]=function(_0x2f1e4c,_0x33110d,_0x22be5f){var _0x50ce05={};var _0x52f9d3={};var _0x214476;var _0x1d9bd4;return db[_0x1180('0x3d')][_0x1180('0x4b')]({'where':{'id':_0x2f1e4c[_0x1180('0x44')]['id']}})[_0x1180('0x23')](handleEntityNotFound(_0x33110d,null))[_0x1180('0x23')](function(_0x299a02){if(_0x299a02){_0x214476=_0x299a02;_0x52f9d3['model']=_[_0x1180('0x45')](db[_0x1180('0x4c')][_0x1180('0x28')]);_0x52f9d3[_0x1180('0x2d')]=_[_0x1180('0x45')](_0x2f1e4c['query']);_0x52f9d3[_0x1180('0x2e')]=_[_0x1180('0x2f')](_0x52f9d3[_0x1180('0x31')],_0x52f9d3[_0x1180('0x2d')]);_0x50ce05['attributes']=_[_0x1180('0x2f')](_0x52f9d3[_0x1180('0x31')],qs[_0x1180('0x32')](_0x2f1e4c['query'][_0x1180('0x32')]));_0x50ce05[_0x1180('0x30')]=_0x50ce05['attributes'][_0x1180('0x33')]?_0x50ce05[_0x1180('0x30')]:_0x52f9d3['model'];_0x50ce05['order']=qs[_0x1180('0x37')](_0x2f1e4c[_0x1180('0x2d')]['sort']);_0x50ce05[_0x1180('0x38')]=qs[_0x1180('0x2e')](_['pick'](_0x2f1e4c[_0x1180('0x2d')],_0x52f9d3[_0x1180('0x2e')]));if(_0x2f1e4c['query'][_0x1180('0x39')]){_0x50ce05[_0x1180('0x38')]=_[_0x1180('0x3b')](_0x50ce05[_0x1180('0x38')],{'$or':_[_0x1180('0x27')](_0x50ce05[_0x1180('0x30')],function(_0x5396cc){var _0x547dcf={};_0x547dcf[_0x5396cc]={'$like':'%'+_0x2f1e4c[_0x1180('0x2d')]['filter']+'%'};return _0x547dcf;})});}_0x50ce05=_['merge']({},_0x50ce05,_0x2f1e4c[_0x1180('0x3c')]);return _0x214476[_0x1180('0x4a')](_0x50ce05);}})[_0x1180('0x23')](function(_0x2b55bf){if(_0x2b55bf){_0x1d9bd4=_0x2b55bf[_0x1180('0x33')];if(!_0x2f1e4c[_0x1180('0x2d')]['hasOwnProperty']('nolimit')){_0x50ce05[_0x1180('0x1b')]=qs[_0x1180('0x1b')](_0x2f1e4c[_0x1180('0x2d')][_0x1180('0x1b')]);_0x50ce05[_0x1180('0x35')]=qs[_0x1180('0x35')](_0x2f1e4c[_0x1180('0x2d')][_0x1180('0x35')]);}return _0x214476[_0x1180('0x4a')](_0x50ce05);}})['then'](function(_0x4324b6){if(_0x4324b6){return _0x4324b6?{'count':_0x1d9bd4,'rows':_0x4324b6}:null;}})[_0x1180('0x23')](respondWithResult(_0x33110d,null))[_0x1180('0x42')](handleError(_0x33110d,null));};exports[_0x1180('0x4d')]=function(_0x480d48,_0x55478a,_0x18b158){var _0x29d3ec={};var _0xad3475={};var _0x7c1043;var _0x53787a;return db[_0x1180('0x3d')][_0x1180('0x4b')]({'where':{'id':_0x480d48[_0x1180('0x44')]['id']}})[_0x1180('0x23')](handleEntityNotFound(_0x55478a,null))['then'](function(_0x137138){if(_0x137138){_0x7c1043=_0x137138;_0xad3475[_0x1180('0x31')]=_[_0x1180('0x45')](db[_0x1180('0x4c')][_0x1180('0x28')]);_0xad3475[_0x1180('0x2d')]=_[_0x1180('0x45')](_0x480d48[_0x1180('0x2d')]);_0xad3475[_0x1180('0x2e')]=_['intersection'](_0xad3475[_0x1180('0x31')],_0xad3475[_0x1180('0x2d')]);_0x29d3ec[_0x1180('0x30')]=_[_0x1180('0x2f')](_0xad3475[_0x1180('0x31')],qs[_0x1180('0x32')](_0x480d48[_0x1180('0x2d')]['fields']));_0x29d3ec[_0x1180('0x30')]=_0x29d3ec[_0x1180('0x30')][_0x1180('0x33')]?_0x29d3ec[_0x1180('0x30')]:_0xad3475[_0x1180('0x31')];_0x29d3ec[_0x1180('0x36')]=qs[_0x1180('0x37')](_0x480d48[_0x1180('0x2d')][_0x1180('0x37')]);_0x29d3ec[_0x1180('0x38')]=qs['filters'](_[_0x1180('0x4e')](_0x480d48[_0x1180('0x2d')],_0xad3475[_0x1180('0x2e')]));if(_0x480d48['query'][_0x1180('0x39')]){_0x29d3ec[_0x1180('0x38')]=_[_0x1180('0x3b')](_0x29d3ec[_0x1180('0x38')],{'$or':_[_0x1180('0x27')](_0x29d3ec[_0x1180('0x30')],function(_0x15a8b7){var _0x28a512={};_0x28a512[_0x15a8b7]={'$like':'%'+_0x480d48[_0x1180('0x2d')][_0x1180('0x39')]+'%'};return _0x28a512;})});}_0x29d3ec=_['merge']({},_0x29d3ec,_0x480d48[_0x1180('0x3c')]);return _0x7c1043[_0x1180('0x4d')](_0x29d3ec);}})[_0x1180('0x23')](function(_0x1f5015){if(_0x1f5015){_0x53787a=_0x1f5015[_0x1180('0x33')];if(!_0x480d48['query'][_0x1180('0x34')]('nolimit')){_0x29d3ec[_0x1180('0x1b')]=qs[_0x1180('0x1b')](_0x480d48[_0x1180('0x2d')][_0x1180('0x1b')]);_0x29d3ec[_0x1180('0x35')]=qs['offset'](_0x480d48[_0x1180('0x2d')][_0x1180('0x35')]);}return _0x7c1043[_0x1180('0x4d')](_0x29d3ec);}})[_0x1180('0x23')](function(_0x1e588d){if(_0x1e588d){return _0x1e588d?{'count':_0x53787a,'rows':_0x1e588d}:null;}})[_0x1180('0x23')](respondWithResult(_0x55478a,null))[_0x1180('0x42')](handleError(_0x55478a,null));};exports[_0x1180('0x4f')]=function(_0x308d5a,_0x2a02c9,_0x43ba98){var _0x58bed7={};var _0x28047a={};var _0x1802eb;var _0x271fa0;return db[_0x1180('0x3d')][_0x1180('0x4b')]({'where':{'id':_0x308d5a['params']['id']}})['then'](handleEntityNotFound(_0x2a02c9,null))['then'](function(_0xdc3672){if(_0xdc3672){_0x1802eb=_0xdc3672;_0x28047a[_0x1180('0x31')]=_[_0x1180('0x45')](db[_0x1180('0x4c')][_0x1180('0x28')]);_0x28047a[_0x1180('0x2d')]=_[_0x1180('0x45')](_0x308d5a[_0x1180('0x2d')]);_0x28047a[_0x1180('0x2e')]=_[_0x1180('0x2f')](_0x28047a['model'],_0x28047a[_0x1180('0x2d')]);_0x58bed7[_0x1180('0x30')]=_[_0x1180('0x2f')](_0x28047a[_0x1180('0x31')],qs[_0x1180('0x32')](_0x308d5a[_0x1180('0x2d')]['fields']));_0x58bed7['attributes']=_0x58bed7[_0x1180('0x30')][_0x1180('0x33')]?_0x58bed7[_0x1180('0x30')]:_0x28047a['model'];_0x58bed7[_0x1180('0x36')]=qs[_0x1180('0x37')](_0x308d5a['query'][_0x1180('0x37')]);_0x58bed7[_0x1180('0x38')]=qs[_0x1180('0x2e')](_[_0x1180('0x4e')](_0x308d5a[_0x1180('0x2d')],_0x28047a[_0x1180('0x2e')]));if(_0x308d5a[_0x1180('0x2d')][_0x1180('0x39')]){_0x58bed7[_0x1180('0x38')]=_[_0x1180('0x3b')](_0x58bed7['where'],{'$or':_['map'](_0x58bed7[_0x1180('0x30')],function(_0x36b681){var _0x2da10e={};_0x2da10e[_0x36b681]={'$like':'%'+_0x308d5a[_0x1180('0x2d')]['filter']+'%'};return _0x2da10e;})});}_0x58bed7=_['merge']({},_0x58bed7,_0x308d5a[_0x1180('0x3c')]);return _0x1802eb[_0x1180('0x4f')](_0x58bed7);}})['then'](function(_0x85db63){if(_0x85db63){_0x271fa0=_0x85db63['length'];if(!_0x308d5a['query'][_0x1180('0x34')](_0x1180('0x50'))){_0x58bed7['limit']=qs[_0x1180('0x1b')](_0x308d5a[_0x1180('0x2d')][_0x1180('0x1b')]);_0x58bed7[_0x1180('0x35')]=qs[_0x1180('0x35')](_0x308d5a['query'][_0x1180('0x35')]);}return _0x1802eb[_0x1180('0x4f')](_0x58bed7);}})[_0x1180('0x23')](function(_0x32a17d){if(_0x32a17d){return _0x32a17d?{'count':_0x271fa0,'rows':_0x32a17d}:null;}})[_0x1180('0x23')](respondWithResult(_0x2a02c9,null))['catch'](handleError(_0x2a02c9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index c57d259..140bb83 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 _0xf17b=['path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x260f2a,_0x15504c){var _0x50f8c2=function(_0x2afdba){while(--_0x2afdba){_0x260f2a['push'](_0x260f2a['shift']());}};_0x50f8c2(++_0x15504c);}(_0xf17b,0x7b));var _0xbf17=function(_0x4e9d7f,_0x383253){_0x4e9d7f=_0x4e9d7f-0x0;var _0x51f0bc=_0xf17b[_0x4e9d7f];return _0x51f0bc;};'use strict';var _=require(_0xbf17('0x0'));var util=require(_0xbf17('0x1'));var logger=require(_0xbf17('0x2'))(_0xbf17('0x3'));var moment=require(_0xbf17('0x4'));var BPromise=require(_0xbf17('0x5'));var rp=require(_0xbf17('0x6'));var fs=require('fs');var path=require(_0xbf17('0x7'));var rimraf=require(_0xbf17('0x8'));var config=require('../../config/environment');var attributes=require(_0xbf17('0x9'));module[_0xbf17('0xa')]=function(_0x4dd93e,_0x5988da){return _0x4dd93e[_0xbf17('0xb')](_0xbf17('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbef3=['rimraf','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','util','../../config/logger','request-promise','path'];(function(_0xc76ffd,_0xd30e6){var _0x443aac=function(_0x7921b6){while(--_0x7921b6){_0xc76ffd['push'](_0xc76ffd['shift']());}};_0x443aac(++_0xd30e6);}(_0xbef3,0x127));var _0x3bef=function(_0x27dc21,_0x52a6f4){_0x27dc21=_0x27dc21-0x0;var _0x146a14=_0xbef3[_0x27dc21];return _0x146a14;};'use strict';var _=require(_0x3bef('0x0'));var util=require(_0x3bef('0x1'));var logger=require(_0x3bef('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3bef('0x3'));var fs=require('fs');var path=require(_0x3bef('0x4'));var rimraf=require(_0x3bef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3bef('0x6'));module[_0x3bef('0x7')]=function(_0xf5d5ff,_0x41ea6d){return _0xf5d5ff[_0x3bef('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x3bef('0x9'),'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 f87ba18..fe522f1 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 _0xf055=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','randomstring'];(function(_0x429ba6,_0x43dc83){var _0x37fc6f=function(_0x28e7bf){while(--_0x28e7bf){_0x429ba6['push'](_0x429ba6['shift']());}};_0x37fc6f(++_0x43dc83);}(_0xf055,0x1dd));var _0x5f05=function(_0x5970b9,_0x8715e9){_0x5970b9=_0x5970b9-0x0;var _0x102199=_0xf055[_0x5970b9];return _0x102199;};'use strict';var _=require(_0x5f05('0x0'));var util=require('util');var moment=require(_0x5f05('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f05('0x2'));var fs=require('fs');var Redis=require(_0x5f05('0x3'));var db=require(_0x5f05('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f05('0x5'))(_0x5f05('0x6'));var config=require('../../config/environment');var jayson=require(_0x5f05('0x7'));var client=jayson['client'][_0x5f05('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ab798,_0x17fd32,_0x2abc5e){return new BPromise(function(_0x292d6c,_0x1de58f){return client[_0x5f05('0x9')](_0x4ab798,_0x2abc5e)['then'](function(_0x53f29e){logger[_0x5f05('0xa')](_0x5f05('0xb'),_0x17fd32,'request\x20sent');logger['debug'](_0x5f05('0xc'),_0x17fd32,'request\x20sent',JSON[_0x5f05('0xd')](_0x53f29e));if(_0x53f29e[_0x5f05('0xe')]){if(_0x53f29e[_0x5f05('0xe')][_0x5f05('0xf')]===0x1f4){logger[_0x5f05('0xe')](_0x5f05('0xb'),_0x17fd32,_0x53f29e[_0x5f05('0xe')][_0x5f05('0x10')]);return _0x1de58f(_0x53f29e[_0x5f05('0xe')][_0x5f05('0x10')]);}logger['error'](_0x5f05('0xb'),_0x17fd32,_0x53f29e[_0x5f05('0xe')]['message']);return _0x292d6c(_0x53f29e[_0x5f05('0xe')][_0x5f05('0x10')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x17fd32,_0x5f05('0x11'));_0x292d6c(_0x53f29e[_0x5f05('0x12')]['message']);}})[_0x5f05('0x13')](function(_0x5390fd){logger[_0x5f05('0xe')](_0x5f05('0xb'),_0x17fd32,_0x5390fd);_0x1de58f(_0x5390fd);});});} \ No newline at end of file +var _0xfd10=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xfd10,0x155));var _0x0fd1=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xfd10[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x0fd1('0x0'));var util=require('util');var moment=require(_0x0fd1('0x1'));var BPromise=require(_0x0fd1('0x2'));var rs=require(_0x0fd1('0x3'));var fs=require('fs');var Redis=require(_0x0fd1('0x4'));var db=require(_0x0fd1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fd1('0x6'))('rpc');var config=require(_0x0fd1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fd1('0x8')][_0x0fd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c6dae,_0x5a6a6f,_0x3c8b11){return new BPromise(function(_0x3364d6,_0x452fa0){return client[_0x0fd1('0xa')](_0x5c6dae,_0x3c8b11)[_0x0fd1('0xb')](function(_0x354fc8){logger[_0x0fd1('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a6a6f,_0x0fd1('0xd'));logger[_0x0fd1('0xe')](_0x0fd1('0xf'),_0x5a6a6f,_0x0fd1('0xd'),JSON[_0x0fd1('0x10')](_0x354fc8));if(_0x354fc8[_0x0fd1('0x11')]){if(_0x354fc8['error'][_0x0fd1('0x12')]===0x1f4){logger[_0x0fd1('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a6a6f,_0x354fc8[_0x0fd1('0x11')]['message']);return _0x452fa0(_0x354fc8[_0x0fd1('0x11')][_0x0fd1('0x13')]);}logger[_0x0fd1('0x11')](_0x0fd1('0x14'),_0x5a6a6f,_0x354fc8[_0x0fd1('0x11')]['message']);return _0x3364d6(_0x354fc8[_0x0fd1('0x11')]['message']);}else{logger[_0x0fd1('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a6a6f,_0x0fd1('0xd'));_0x3364d6(_0x354fc8[_0x0fd1('0x15')]['message']);}})[_0x0fd1('0x16')](function(_0x54972a){logger['error'](_0x0fd1('0x14'),_0x5a6a6f,_0x54972a);_0x452fa0(_0x54972a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 436fa44..1a5f3aa 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 _0x55e0=['/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','show','post','create'];(function(_0xe405eb,_0x3b26fa){var _0x4bba5a=function(_0x48cc84){while(--_0x48cc84){_0xe405eb['push'](_0xe405eb['shift']());}};_0x4bba5a(++_0x3b26fa);}(_0x55e0,0xdc));var _0x055e=function(_0x3cae79,_0x56281c){_0x3cae79=_0x3cae79-0x0;var _0x3465be=_0x55e0[_0x3cae79];return _0x3465be;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/:id',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0xc')]('/',auth[_0x055e('0xa')](),controller[_0x055e('0xd')]);router['put'](_0x055e('0xe'),auth[_0x055e('0xa')](),controller[_0x055e('0xf')]);router[_0x055e('0x10')](_0x055e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x055e('0x11')]=router; \ No newline at end of file +var _0x295f=['path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x295f,0x168));var _0xf295=function(_0xd5150,_0x116a5f){_0xd5150=_0xd5150-0x0;var _0xfff381=_0x295f[_0xd5150];return _0xfff381;};'use strict';var multer=require('multer');var util=require(_0xf295('0x0'));var path=require(_0xf295('0x1'));var timeout=require(_0xf295('0x2'));var express=require('express');var router=express[_0xf295('0x3')]();var fs_extra=require(_0xf295('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf295('0x5'));var controller=require(_0xf295('0x6'));router[_0xf295('0x7')]('/',auth[_0xf295('0x8')](),controller[_0xf295('0x9')]);router['get'](_0xf295('0xa'),auth[_0xf295('0x8')](),controller[_0xf295('0xb')]);router[_0xf295('0xc')]('/',auth[_0xf295('0x8')](),controller[_0xf295('0xd')]);router[_0xf295('0xe')](_0xf295('0xa'),auth[_0xf295('0x8')](),controller[_0xf295('0xf')]);router[_0xf295('0x10')](_0xf295('0xa'),auth['isAuthenticated'](),controller[_0xf295('0x11')]);module[_0xf295('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 81dda3d..aecf624 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 _0xe0fc=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x35926b,_0x276c95){var _0x1ecd40=function(_0x812cf3){while(--_0x812cf3){_0x35926b['push'](_0x35926b['shift']());}};_0x1ecd40(++_0x276c95);}(_0xe0fc,0x1ae));var _0xce0f=function(_0x397843,_0xa7173e){_0x397843=_0x397843-0x0;var _0x2ba028=_0xe0fc[_0x397843];return _0x2ba028;};'use strict';var Sequelize=require(_0xce0f('0x0'));module[_0xce0f('0x1')]={'type':{'type':Sequelize[_0xce0f('0x2')](_0xce0f('0x3'),_0xce0f('0x4'),_0xce0f('0x5'),_0xce0f('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xce0f('0x7')]},'key':{'type':Sequelize[_0xce0f('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xce0f('0x3'),'variable',_0xce0f('0x5'))},'keyContent':{'type':Sequelize[_0xce0f('0x7')]},'idField':{'type':Sequelize[_0xce0f('0x7')]},'nameField':{'type':Sequelize[_0xce0f('0x7')]},'customField':{'type':Sequelize[_0xce0f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xce0f('0x7')]}}; \ No newline at end of file +var _0x22b7=['string','customVariable','picklist','STRING','BOOLEAN','ENUM'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x22b7,0x11f));var _0x722b=function(_0x21b57f,_0x9ba5fb){_0x21b57f=_0x21b57f-0x0;var _0x3dac6f=_0x22b7[_0x21b57f];return _0x3dac6f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x722b('0x0')](_0x722b('0x1'),'variable',_0x722b('0x2'),'keyValue',_0x722b('0x3')),'defaultValue':_0x722b('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x722b('0x4')]},'keyType':{'type':Sequelize[_0x722b('0x0')](_0x722b('0x1'),'variable',_0x722b('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x722b('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x722b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 046be07..b8bcfdb 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 _0x0f64=['show','params','keys','length','find','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../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','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','model','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows','catch'];(function(_0x39b148,_0x37726e){var _0x17a5ef=function(_0x35a1c0){while(--_0x35a1c0){_0x39b148['push'](_0x39b148['shift']());}};_0x17a5ef(++_0x37726e);}(_0x0f64,0x1c8));var _0x40f6=function(_0x179814,_0x1ab649){_0x179814=_0x179814-0x0;var _0x1c36c8=_0x0f64[_0x179814];return _0x1c36c8;};'use strict';var emlformat=require(_0x40f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40f6('0x1'));var jsonpatch=require(_0x40f6('0x2'));var rp=require(_0x40f6('0x3'));var moment=require(_0x40f6('0x4'));var BPromise=require(_0x40f6('0x5'));var Mustache=require(_0x40f6('0x6'));var util=require(_0x40f6('0x7'));var path=require(_0x40f6('0x8'));var sox=require(_0x40f6('0x9'));var csv=require('to-csv');var ejs=require(_0x40f6('0xa'));var fs=require('fs');var fs_extra=require(_0x40f6('0xb'));var _=require(_0x40f6('0xc'));var squel=require('squel');var crypto=require(_0x40f6('0xd'));var jsforce=require(_0x40f6('0xe'));var deskjs=require(_0x40f6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x40f6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x40f6('0x11'));var hardwareService=require(_0x40f6('0x12'));var logger=require(_0x40f6('0x13'))(_0x40f6('0x14'));var utils=require(_0x40f6('0x15'));var config=require(_0x40f6('0x16'));var licenseUtil=require(_0x40f6('0x17'));var db=require(_0x40f6('0x18'))['db'];function respondWithStatusCode(_0x39d219,_0x3e0851){_0x3e0851=_0x3e0851||0xcc;return function(_0x1dea86){if(_0x1dea86){return _0x39d219[_0x40f6('0x19')](_0x3e0851);}return _0x39d219[_0x40f6('0x1a')](_0x3e0851)[_0x40f6('0x1b')]();};}function respondWithResult(_0x352774,_0x39354a){_0x39354a=_0x39354a||0xc8;return function(_0x565b71){if(_0x565b71){return _0x352774[_0x40f6('0x1a')](_0x39354a)[_0x40f6('0x1c')](_0x565b71);}};}function respondWithFilteredResult(_0x5525ec,_0x57843d){return function(_0x17d77d){if(_0x17d77d){var _0x78b9bc=typeof _0x57843d['offset']==='undefined'&&typeof _0x57843d[_0x40f6('0x1d')]===_0x40f6('0x1e');var _0x84169a=_0x17d77d[_0x40f6('0x1f')];var _0x309a4b=_0x78b9bc?0x0:_0x57843d['offset'];var _0x14f874=_0x78b9bc?_0x17d77d[_0x40f6('0x1f')]:_0x57843d[_0x40f6('0x20')]+_0x57843d[_0x40f6('0x1d')];var _0x4c7dd5;if(_0x14f874>=_0x84169a){_0x14f874=_0x84169a;_0x4c7dd5=0xc8;}else{_0x4c7dd5=0xce;}_0x5525ec[_0x40f6('0x1a')](_0x4c7dd5);return _0x5525ec[_0x40f6('0x21')](_0x40f6('0x22'),_0x309a4b+'-'+_0x14f874+'/'+_0x84169a)[_0x40f6('0x1c')](_0x17d77d);}return null;};}function patchUpdates(_0x4471e4){return function(_0x4af454){try{jsonpatch[_0x40f6('0x23')](_0x4af454,_0x4471e4,!![]);}catch(_0x689690){return BPromise[_0x40f6('0x24')](_0x689690);}return _0x4af454[_0x40f6('0x25')]();};}function saveUpdates(_0x46aef8,_0x1858e5){return function(_0x2a0b00){if(_0x2a0b00){return _0x2a0b00[_0x40f6('0x26')](_0x46aef8)[_0x40f6('0x27')](function(_0x18db7c){return _0x18db7c;});}return null;};}function removeEntity(_0x1e572a,_0x2eeff0){return function(_0x301f2b){if(_0x301f2b){return _0x301f2b[_0x40f6('0x28')]()[_0x40f6('0x27')](function(){_0x1e572a[_0x40f6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fb374,_0x1fbdb0){return function(_0x2f89f2){if(!_0x2f89f2){_0x2fb374['sendStatus'](0x194);}return _0x2f89f2;};}function handleError(_0x3ab63c,_0x811dc1){_0x811dc1=_0x811dc1||0x1f4;return function(_0xb56aae){logger[_0x40f6('0x29')](_0xb56aae[_0x40f6('0x2a')]);if(_0xb56aae['name']){delete _0xb56aae[_0x40f6('0x2b')];}_0x3ab63c[_0x40f6('0x1a')](_0x811dc1)[_0x40f6('0x2c')](_0xb56aae);};}exports[_0x40f6('0x2d')]=function(_0x5a1214,_0x53d940){var _0x27a784={},_0x3a75e8={},_0xfbd07b={'count':0x0,'rows':[]};var _0xb3a3ef=_[_0x40f6('0x2e')](db[_0x40f6('0x2f')][_0x40f6('0x30')],function(_0x213d9a){return{'name':_0x213d9a[_0x40f6('0x31')],'type':_0x213d9a['type']['key']};});_0x3a75e8[_0x40f6('0x32')]=_[_0x40f6('0x2e')](_0xb3a3ef,_0x40f6('0x2b'));_0x3a75e8[_0x40f6('0x33')]=_['keys'](_0x5a1214[_0x40f6('0x33')]);_0x3a75e8['filters']=_[_0x40f6('0x34')](_0x3a75e8['model'],_0x3a75e8[_0x40f6('0x33')]);_0x27a784[_0x40f6('0x35')]=_[_0x40f6('0x34')](_0x3a75e8[_0x40f6('0x32')],qs['fields'](_0x5a1214[_0x40f6('0x33')][_0x40f6('0x36')]));_0x27a784['attributes']=_0x27a784[_0x40f6('0x35')]['length']?_0x27a784[_0x40f6('0x35')]:_0x3a75e8[_0x40f6('0x32')];if(!_0x5a1214[_0x40f6('0x33')]['hasOwnProperty'](_0x40f6('0x37'))){_0x27a784[_0x40f6('0x1d')]=qs[_0x40f6('0x1d')](_0x5a1214[_0x40f6('0x33')][_0x40f6('0x1d')]);_0x27a784[_0x40f6('0x20')]=qs[_0x40f6('0x20')](_0x5a1214[_0x40f6('0x33')][_0x40f6('0x20')]);}_0x27a784[_0x40f6('0x38')]=qs['sort'](_0x5a1214[_0x40f6('0x33')][_0x40f6('0x39')]);_0x27a784['where']=qs[_0x40f6('0x3a')](_[_0x40f6('0x3b')](_0x5a1214['query'],_0x3a75e8[_0x40f6('0x3a')]),_0xb3a3ef);if(_0x5a1214['query'][_0x40f6('0x3c')]){_0x27a784[_0x40f6('0x3d')]=_[_0x40f6('0x3e')](_0x27a784[_0x40f6('0x3d')],{'$or':_[_0x40f6('0x2e')](_0xb3a3ef,function(_0x285530){if(_0x285530[_0x40f6('0x3f')]!==_0x40f6('0x40')){var _0x1e96c4={};_0x1e96c4[_0x285530[_0x40f6('0x2b')]]={'$like':'%'+_0x5a1214['query'][_0x40f6('0x3c')]+'%'};return _0x1e96c4;}})});}_0x27a784=_['merge']({},_0x27a784,_0x5a1214[_0x40f6('0x41')]);var _0x98f7bb={'where':_0x27a784[_0x40f6('0x3d')]};return db[_0x40f6('0x2f')][_0x40f6('0x1f')](_0x98f7bb)[_0x40f6('0x27')](function(_0x1232ca){_0xfbd07b[_0x40f6('0x1f')]=_0x1232ca;if(_0x5a1214[_0x40f6('0x33')][_0x40f6('0x42')]){_0x27a784['include']=[{'all':!![]}];}return db[_0x40f6('0x2f')]['findAll'](_0x27a784);})[_0x40f6('0x27')](function(_0x2c958a){_0xfbd07b[_0x40f6('0x43')]=_0x2c958a;return _0xfbd07b;})[_0x40f6('0x27')](respondWithFilteredResult(_0x53d940,_0x27a784))[_0x40f6('0x44')](handleError(_0x53d940,null));};exports[_0x40f6('0x45')]=function(_0x5605f0,_0xdbdafd){var _0xf87612={'raw':!![],'where':{'id':_0x5605f0[_0x40f6('0x46')]['id']}},_0x8292c1={};_0x8292c1[_0x40f6('0x32')]=_[_0x40f6('0x47')](db[_0x40f6('0x2f')][_0x40f6('0x30')]);_0x8292c1[_0x40f6('0x33')]=_[_0x40f6('0x47')](_0x5605f0['query']);_0x8292c1[_0x40f6('0x3a')]=_[_0x40f6('0x34')](_0x8292c1[_0x40f6('0x32')],_0x8292c1['query']);_0xf87612[_0x40f6('0x35')]=_[_0x40f6('0x34')](_0x8292c1[_0x40f6('0x32')],qs[_0x40f6('0x36')](_0x5605f0[_0x40f6('0x33')][_0x40f6('0x36')]));_0xf87612[_0x40f6('0x35')]=_0xf87612[_0x40f6('0x35')][_0x40f6('0x48')]?_0xf87612[_0x40f6('0x35')]:_0x8292c1[_0x40f6('0x32')];if(_0x5605f0['query'][_0x40f6('0x42')]){_0xf87612['include']=[{'all':!![]}];}_0xf87612=_[_0x40f6('0x3e')]({},_0xf87612,_0x5605f0[_0x40f6('0x41')]);return db['FreshsalesField'][_0x40f6('0x49')](_0xf87612)[_0x40f6('0x27')](handleEntityNotFound(_0xdbdafd,null))[_0x40f6('0x27')](respondWithResult(_0xdbdafd,null))[_0x40f6('0x44')](handleError(_0xdbdafd,null));};exports['create']=function(_0x2cab6e,_0x5574a7){return db[_0x40f6('0x2f')]['create'](_0x2cab6e[_0x40f6('0x4a')],{})[_0x40f6('0x27')](respondWithResult(_0x5574a7,0xc9))[_0x40f6('0x44')](handleError(_0x5574a7,null));};exports[_0x40f6('0x26')]=function(_0x327f7a,_0x3daef2){if(_0x327f7a[_0x40f6('0x4a')]['id']){delete _0x327f7a[_0x40f6('0x4a')]['id'];}return db[_0x40f6('0x2f')][_0x40f6('0x49')]({'where':{'id':_0x327f7a['params']['id']}})[_0x40f6('0x27')](handleEntityNotFound(_0x3daef2,null))[_0x40f6('0x27')](saveUpdates(_0x327f7a[_0x40f6('0x4a')],null))[_0x40f6('0x27')](respondWithResult(_0x3daef2,null))[_0x40f6('0x44')](handleError(_0x3daef2,null));};exports[_0x40f6('0x28')]=function(_0x572bdb,_0x1089d0){return db[_0x40f6('0x2f')][_0x40f6('0x49')]({'where':{'id':_0x572bdb[_0x40f6('0x46')]['id']}})[_0x40f6('0x27')](handleEntityNotFound(_0x1089d0,null))[_0x40f6('0x27')](removeEntity(_0x1089d0,null))[_0x40f6('0x44')](handleError(_0x1089d0,null));}; \ No newline at end of file +var _0x3c1e=['fs-extra','lodash','squel','crypto','jsforce','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','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','rimraf','bluebird','mustache','path','sox','ejs'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x3c1e,0x1b0));var _0xe3c1=function(_0x2f41c6,_0x119aa2){_0x2f41c6=_0x2f41c6-0x0;var _0xf4502b=_0x3c1e[_0x2f41c6];return _0xf4502b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3c1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe3c1('0x1'));var Mustache=require(_0xe3c1('0x2'));var util=require('util');var path=require(_0xe3c1('0x3'));var sox=require(_0xe3c1('0x4'));var csv=require('to-csv');var ejs=require(_0xe3c1('0x5'));var fs=require('fs');var fs_extra=require(_0xe3c1('0x6'));var _=require(_0xe3c1('0x7'));var squel=require(_0xe3c1('0x8'));var crypto=require(_0xe3c1('0x9'));var jsforce=require(_0xe3c1('0xa'));var deskjs=require(_0xe3c1('0xb'));var toCsv=require(_0xe3c1('0xc'));var querystring=require(_0xe3c1('0xd'));var Papa=require(_0xe3c1('0xe'));var Redis=require('ioredis');var authService=require(_0xe3c1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe3c1('0x10'));var hardwareService=require(_0xe3c1('0x11'));var logger=require(_0xe3c1('0x12'))(_0xe3c1('0x13'));var utils=require(_0xe3c1('0x14'));var config=require(_0xe3c1('0x15'));var licenseUtil=require(_0xe3c1('0x16'));var db=require(_0xe3c1('0x17'))['db'];function respondWithStatusCode(_0x445ae0,_0x2493b2){_0x2493b2=_0x2493b2||0xcc;return function(_0x4e2f03){if(_0x4e2f03){return _0x445ae0[_0xe3c1('0x18')](_0x2493b2);}return _0x445ae0[_0xe3c1('0x19')](_0x2493b2)[_0xe3c1('0x1a')]();};}function respondWithResult(_0x3ddc5f,_0x407e0c){_0x407e0c=_0x407e0c||0xc8;return function(_0x4dec1b){if(_0x4dec1b){return _0x3ddc5f[_0xe3c1('0x19')](_0x407e0c)['json'](_0x4dec1b);}};}function respondWithFilteredResult(_0x54eccd,_0x28d4cb){return function(_0x1dad16){if(_0x1dad16){var _0x5fcdb8=typeof _0x28d4cb[_0xe3c1('0x1b')]===_0xe3c1('0x1c')&&typeof _0x28d4cb[_0xe3c1('0x1d')]===_0xe3c1('0x1c');var _0x5878a8=_0x1dad16['count'];var _0x5c4823=_0x5fcdb8?0x0:_0x28d4cb[_0xe3c1('0x1b')];var _0x287f93=_0x5fcdb8?_0x1dad16[_0xe3c1('0x1e')]:_0x28d4cb['offset']+_0x28d4cb[_0xe3c1('0x1d')];var _0x394a40;if(_0x287f93>=_0x5878a8){_0x287f93=_0x5878a8;_0x394a40=0xc8;}else{_0x394a40=0xce;}_0x54eccd[_0xe3c1('0x19')](_0x394a40);return _0x54eccd[_0xe3c1('0x1f')]('Content-Range',_0x5c4823+'-'+_0x287f93+'/'+_0x5878a8)['json'](_0x1dad16);}return null;};}function patchUpdates(_0x14ba74){return function(_0x593afa){try{jsonpatch[_0xe3c1('0x20')](_0x593afa,_0x14ba74,!![]);}catch(_0x43edfa){return BPromise['reject'](_0x43edfa);}return _0x593afa[_0xe3c1('0x21')]();};}function saveUpdates(_0xedc82b,_0x424bca){return function(_0x3b6b08){if(_0x3b6b08){return _0x3b6b08['update'](_0xedc82b)[_0xe3c1('0x22')](function(_0x4618a2){return _0x4618a2;});}return null;};}function removeEntity(_0x565f03,_0x314b08){return function(_0xd75789){if(_0xd75789){return _0xd75789[_0xe3c1('0x23')]()[_0xe3c1('0x22')](function(){_0x565f03[_0xe3c1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29f06d,_0x4aece2){return function(_0x405721){if(!_0x405721){_0x29f06d[_0xe3c1('0x18')](0x194);}return _0x405721;};}function handleError(_0x4095a3,_0x1b2ffc){_0x1b2ffc=_0x1b2ffc||0x1f4;return function(_0xa6e7ec){logger[_0xe3c1('0x24')](_0xa6e7ec[_0xe3c1('0x25')]);if(_0xa6e7ec[_0xe3c1('0x26')]){delete _0xa6e7ec[_0xe3c1('0x26')];}_0x4095a3['status'](_0x1b2ffc)[_0xe3c1('0x27')](_0xa6e7ec);};}exports[_0xe3c1('0x28')]=function(_0x44af26,_0x38b610){var _0x47339a={},_0x1dcd1e={},_0x140b04={'count':0x0,'rows':[]};var _0x546e79=_[_0xe3c1('0x29')](db[_0xe3c1('0x2a')][_0xe3c1('0x2b')],function(_0x453abb){return{'name':_0x453abb[_0xe3c1('0x2c')],'type':_0x453abb[_0xe3c1('0x2d')][_0xe3c1('0x2e')]};});_0x1dcd1e[_0xe3c1('0x2f')]=_[_0xe3c1('0x29')](_0x546e79,_0xe3c1('0x26'));_0x1dcd1e[_0xe3c1('0x30')]=_[_0xe3c1('0x31')](_0x44af26[_0xe3c1('0x30')]);_0x1dcd1e[_0xe3c1('0x32')]=_[_0xe3c1('0x33')](_0x1dcd1e[_0xe3c1('0x2f')],_0x1dcd1e[_0xe3c1('0x30')]);_0x47339a[_0xe3c1('0x34')]=_[_0xe3c1('0x33')](_0x1dcd1e[_0xe3c1('0x2f')],qs[_0xe3c1('0x35')](_0x44af26[_0xe3c1('0x30')][_0xe3c1('0x35')]));_0x47339a[_0xe3c1('0x34')]=_0x47339a[_0xe3c1('0x34')]['length']?_0x47339a[_0xe3c1('0x34')]:_0x1dcd1e['model'];if(!_0x44af26[_0xe3c1('0x30')][_0xe3c1('0x36')](_0xe3c1('0x37'))){_0x47339a['limit']=qs[_0xe3c1('0x1d')](_0x44af26[_0xe3c1('0x30')][_0xe3c1('0x1d')]);_0x47339a[_0xe3c1('0x1b')]=qs[_0xe3c1('0x1b')](_0x44af26[_0xe3c1('0x30')][_0xe3c1('0x1b')]);}_0x47339a['order']=qs['sort'](_0x44af26[_0xe3c1('0x30')][_0xe3c1('0x38')]);_0x47339a['where']=qs['filters'](_[_0xe3c1('0x39')](_0x44af26[_0xe3c1('0x30')],_0x1dcd1e['filters']),_0x546e79);if(_0x44af26[_0xe3c1('0x30')][_0xe3c1('0x3a')]){_0x47339a['where']=_[_0xe3c1('0x3b')](_0x47339a[_0xe3c1('0x3c')],{'$or':_[_0xe3c1('0x29')](_0x546e79,function(_0x43ec46){if(_0x43ec46[_0xe3c1('0x2d')]!==_0xe3c1('0x3d')){var _0x445772={};_0x445772[_0x43ec46[_0xe3c1('0x26')]]={'$like':'%'+_0x44af26['query']['filter']+'%'};return _0x445772;}})});}_0x47339a=_['merge']({},_0x47339a,_0x44af26[_0xe3c1('0x3e')]);var _0x454343={'where':_0x47339a['where']};return db[_0xe3c1('0x2a')][_0xe3c1('0x1e')](_0x454343)[_0xe3c1('0x22')](function(_0x17b70d){_0x140b04['count']=_0x17b70d;if(_0x44af26[_0xe3c1('0x30')][_0xe3c1('0x3f')]){_0x47339a[_0xe3c1('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0xe3c1('0x41')](_0x47339a);})[_0xe3c1('0x22')](function(_0x2d8632){_0x140b04['rows']=_0x2d8632;return _0x140b04;})[_0xe3c1('0x22')](respondWithFilteredResult(_0x38b610,_0x47339a))[_0xe3c1('0x42')](handleError(_0x38b610,null));};exports[_0xe3c1('0x43')]=function(_0x2d8ec8,_0x40302f){var _0x32f993={'raw':!![],'where':{'id':_0x2d8ec8[_0xe3c1('0x44')]['id']}},_0x48d874={};_0x48d874['model']=_[_0xe3c1('0x31')](db[_0xe3c1('0x2a')][_0xe3c1('0x2b')]);_0x48d874[_0xe3c1('0x30')]=_['keys'](_0x2d8ec8[_0xe3c1('0x30')]);_0x48d874[_0xe3c1('0x32')]=_[_0xe3c1('0x33')](_0x48d874[_0xe3c1('0x2f')],_0x48d874[_0xe3c1('0x30')]);_0x32f993[_0xe3c1('0x34')]=_[_0xe3c1('0x33')](_0x48d874[_0xe3c1('0x2f')],qs[_0xe3c1('0x35')](_0x2d8ec8[_0xe3c1('0x30')][_0xe3c1('0x35')]));_0x32f993['attributes']=_0x32f993['attributes'][_0xe3c1('0x45')]?_0x32f993['attributes']:_0x48d874['model'];if(_0x2d8ec8[_0xe3c1('0x30')][_0xe3c1('0x3f')]){_0x32f993[_0xe3c1('0x40')]=[{'all':!![]}];}_0x32f993=_[_0xe3c1('0x3b')]({},_0x32f993,_0x2d8ec8['options']);return db[_0xe3c1('0x2a')][_0xe3c1('0x46')](_0x32f993)[_0xe3c1('0x22')](handleEntityNotFound(_0x40302f,null))[_0xe3c1('0x22')](respondWithResult(_0x40302f,null))[_0xe3c1('0x42')](handleError(_0x40302f,null));};exports['create']=function(_0x5592bb,_0x258380){return db[_0xe3c1('0x2a')][_0xe3c1('0x47')](_0x5592bb[_0xe3c1('0x48')],{})[_0xe3c1('0x22')](respondWithResult(_0x258380,0xc9))[_0xe3c1('0x42')](handleError(_0x258380,null));};exports['update']=function(_0x5cba18,_0x598d57){if(_0x5cba18[_0xe3c1('0x48')]['id']){delete _0x5cba18[_0xe3c1('0x48')]['id'];}return db['FreshsalesField'][_0xe3c1('0x46')]({'where':{'id':_0x5cba18[_0xe3c1('0x44')]['id']}})[_0xe3c1('0x22')](handleEntityNotFound(_0x598d57,null))[_0xe3c1('0x22')](saveUpdates(_0x5cba18['body'],null))[_0xe3c1('0x22')](respondWithResult(_0x598d57,null))[_0xe3c1('0x42')](handleError(_0x598d57,null));};exports[_0xe3c1('0x23')]=function(_0x29b682,_0x3b1003){return db['FreshsalesField'][_0xe3c1('0x46')]({'where':{'id':_0x29b682[_0xe3c1('0x44')]['id']}})[_0xe3c1('0x22')](handleEntityNotFound(_0x3b1003,null))['then'](removeEntity(_0x3b1003,null))[_0xe3c1('0x42')](handleError(_0x3b1003,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index fadb8c2..4df4044 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 _0x2deb=['int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1a2c72,_0x53c7f0){var _0x413211=function(_0x91ba8){while(--_0x91ba8){_0x1a2c72['push'](_0x1a2c72['shift']());}};_0x413211(++_0x53c7f0);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var logger=require(_0xb2de('0x2'))(_0xb2de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb2de('0x4'));var fs=require('fs');var path=require(_0xb2de('0x5'));var rimraf=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x201fcc,_0x2ed8ec){return _0x201fcc[_0xb2de('0x8')]('FreshsalesField',attributes,{'tableName':_0xb2de('0x9'),'paranoid':![],'indexes':[{'name':_0xb2de('0xa'),'fields':['idField',_0xb2de('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['api','moment','bluebird','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash'];(function(_0x52f121,_0x8d0a2e){var _0x7af517=function(_0x229b25){while(--_0x229b25){_0x52f121['push'](_0x52f121['shift']());}};_0x7af517(++_0x8d0a2e);}(_0x430c,0x1a1));var _0xc430=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x430c[_0x2a558d];return _0xa7bc9c;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('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(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x9'),_0xc430('0xa')],'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 26e461b..cb32f60 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 _0x7a54=['info','FreshsalesField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x3fc78f,_0x3d0972){_0x3fc78f=_0x3fc78f-0x0;var _0x15bbb5=_0x7a54[_0x3fc78f];return _0x15bbb5;};'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')]('FreshsalesField,\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 _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x259720,_0x4b4e6c){var _0xd8993b=function(_0x3f3a3b){while(--_0x3f3a3b){_0x259720['push'](_0x259720['shift']());}};_0xd8993b(++_0x4b4e6c);}(_0x5496,0x175));var _0x6549=function(_0x5b2c54,_0x24ad96){_0x5b2c54=_0x5b2c54-0x0;var _0x14712e=_0x5496[_0x5b2c54];return _0x14712e;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 1655ba9..754fd28 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x405c64,_0x36c3a1){var _0x487905=function(_0x147031){while(--_0x147031){_0x405c64['push'](_0x405c64['shift']());}};_0x487905(++_0x36c3a1);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x3bdfed,_0xf5b3e9){var _0x5d0578=function(_0x575896){while(--_0x575896){_0x3bdfed['push'](_0x3bdfed['shift']());}};_0x5d0578(++_0xf5b3e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 2dfd0b2..7841096 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 _0xfb0b=['newTab','sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x443cfa,_0x2f3e91){var _0x2bff11=function(_0x33ea06){while(--_0x33ea06){_0x443cfa['push'](_0x443cfa['shift']());}};_0x2bff11(++_0x2f3e91);}(_0xfb0b,0x94));var _0xbfb0=function(_0x437603,_0x579243){_0x437603=_0x437603-0x0;var _0x3e5762=_0xfb0b[_0x437603];return _0x3e5762;};'use strict';var Sequelize=require(_0xbfb0('0x0'));module[_0xbfb0('0x1')]={'name':{'type':Sequelize[_0xbfb0('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbfb0('0x2')],'unique':_0xbfb0('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbfb0('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xbfb0('0x2')]},'serverUrl':{'type':Sequelize[_0xbfb0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbfb0('0x4')](_0xbfb0('0x5'),_0xbfb0('0x6')),'defaultValue':_0xbfb0('0x5')}}; \ No newline at end of file +var _0x1967=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x40d8a3,_0x4f3ac1){var _0x4d9ecd=function(_0x26c87b){while(--_0x26c87b){_0x40d8a3['push'](_0x40d8a3['shift']());}};_0x4d9ecd(++_0x4f3ac1);}(_0x1967,0x173));var _0x7196=function(_0x1b6844,_0xc53c12){_0x1b6844=_0x1b6844-0x0;var _0x57fbd1=_0x1967[_0x1b6844];return _0x57fbd1;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'remoteUri':{'type':Sequelize[_0x7196('0x1')]},'password':{'type':Sequelize[_0x7196('0x1')]},'clientId':{'type':Sequelize[_0x7196('0x1')]},'clientSecret':{'type':Sequelize[_0x7196('0x1')]},'securityToken':{'type':Sequelize[_0x7196('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7196('0x3')](_0x7196('0x4'),_0x7196('0x5')),'defaultValue':_0x7196('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3ab7e7c..e601180 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 _0x095f=['ticketType','describe','OwnerId','ActivityDate','IsReminderSet','Subject','picklist','textarea','phone','remove','includes','label','custom','picklistValues','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','limit','undefined','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Task','remoteUri','clientId','clientSecret','password','substring','lastIndexOf','concat','securityToken','isNil'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x095f,0x8c));var _0xf095=function(_0x541d1f,_0x4c51d2){_0x541d1f=_0x541d1f-0x0;var _0x38d62d=_0x095f[_0x541d1f];return _0x38d62d;};'use strict';var emlformat=require(_0xf095('0x0'));var rimraf=require(_0xf095('0x1'));var zipdir=require(_0xf095('0x2'));var jsonpatch=require(_0xf095('0x3'));var rp=require(_0xf095('0x4'));var moment=require(_0xf095('0x5'));var BPromise=require(_0xf095('0x6'));var Mustache=require(_0xf095('0x7'));var util=require(_0xf095('0x8'));var path=require(_0xf095('0x9'));var sox=require(_0xf095('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf095('0xb'));var _=require('lodash');var squel=require(_0xf095('0xc'));var crypto=require(_0xf095('0xd'));var jsforce=require(_0xf095('0xe'));var deskjs=require(_0xf095('0xf'));var toCsv=require(_0xf095('0x10'));var querystring=require(_0xf095('0x11'));var Papa=require(_0xf095('0x12'));var Redis=require(_0xf095('0x13'));var authService=require(_0xf095('0x14'));var qs=require(_0xf095('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf095('0x16'))(_0xf095('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf095('0x18'));var db=require(_0xf095('0x19'))['db'];var integrations=require(_0xf095('0x1a'));function respondWithStatusCode(_0x51c2b1,_0x573dfb){_0x573dfb=_0x573dfb||0xcc;return function(_0x178e88){if(_0x178e88){return _0x51c2b1['sendStatus'](_0x573dfb);}return _0x51c2b1[_0xf095('0x1b')](_0x573dfb)['end']();};}function respondWithResult(_0x3db301,_0x8ef065){_0x8ef065=_0x8ef065||0xc8;return function(_0x121064){if(_0x121064){return _0x3db301[_0xf095('0x1b')](_0x8ef065)['json'](_0x121064);}};}function respondWithFilteredResult(_0x1711fd,_0x27f15b){return function(_0x4222c6){if(_0x4222c6){var _0x40add2=typeof _0x27f15b[_0xf095('0x1c')]==='undefined'&&typeof _0x27f15b[_0xf095('0x1d')]===_0xf095('0x1e');var _0x17dda5=_0x4222c6['count'];var _0x53604a=_0x40add2?0x0:_0x27f15b['offset'];var _0x52a2f7=_0x40add2?_0x4222c6['count']:_0x27f15b['offset']+_0x27f15b[_0xf095('0x1d')];var _0x46de1b;if(_0x52a2f7>=_0x17dda5){_0x52a2f7=_0x17dda5;_0x46de1b=0xc8;}else{_0x46de1b=0xce;}_0x1711fd[_0xf095('0x1b')](_0x46de1b);return _0x1711fd['set'](_0xf095('0x1f'),_0x53604a+'-'+_0x52a2f7+'/'+_0x17dda5)[_0xf095('0x20')](_0x4222c6);}return null;};}function patchUpdates(_0xdf8dd7){return function(_0x3b089f){try{jsonpatch[_0xf095('0x21')](_0x3b089f,_0xdf8dd7,!![]);}catch(_0x383993){return BPromise[_0xf095('0x22')](_0x383993);}return _0x3b089f['save']();};}function saveUpdates(_0x40fbad,_0x375632){return function(_0x2138f5){if(_0x2138f5){return _0x2138f5[_0xf095('0x23')](_0x40fbad)[_0xf095('0x24')](function(_0x1417c4){return _0x1417c4;});}return null;};}function removeEntity(_0x5de1de,_0x44131f){return function(_0x10076c){if(_0x10076c){return _0x10076c[_0xf095('0x25')]()['then'](function(){_0x5de1de['status'](0xcc)[_0xf095('0x26')]();});}};}function handleEntityNotFound(_0x423025,_0x459dde){return function(_0x1100b7){if(!_0x1100b7){_0x423025['sendStatus'](0x194);}return _0x1100b7;};}function handleError(_0x1bc2c6,_0x12fc67){_0x12fc67=_0x12fc67||0x1f4;return function(_0x389c6b){logger[_0xf095('0x27')](_0x389c6b[_0xf095('0x28')]);if(_0x389c6b[_0xf095('0x29')]){delete _0x389c6b[_0xf095('0x29')];}_0x1bc2c6[_0xf095('0x1b')](_0x12fc67)[_0xf095('0x2a')](_0x389c6b);};}exports[_0xf095('0x2b')]=function(_0x46e638,_0x108900){var _0x85e828={},_0x51ad81={},_0x552d54={'count':0x0,'rows':[]};var _0x1666ca=_[_0xf095('0x2c')](db[_0xf095('0x2d')][_0xf095('0x2e')],function(_0x6b1d34){return{'name':_0x6b1d34[_0xf095('0x2f')],'type':_0x6b1d34['type'][_0xf095('0x30')]};});_0x51ad81[_0xf095('0x31')]=_[_0xf095('0x2c')](_0x1666ca,'name');_0x51ad81[_0xf095('0x32')]=_[_0xf095('0x33')](_0x46e638[_0xf095('0x32')]);_0x51ad81[_0xf095('0x34')]=_[_0xf095('0x35')](_0x51ad81[_0xf095('0x31')],_0x51ad81[_0xf095('0x32')]);_0x85e828[_0xf095('0x36')]=_[_0xf095('0x35')](_0x51ad81[_0xf095('0x31')],qs[_0xf095('0x37')](_0x46e638[_0xf095('0x32')][_0xf095('0x37')]));_0x85e828[_0xf095('0x36')]=_0x85e828[_0xf095('0x36')][_0xf095('0x38')]?_0x85e828[_0xf095('0x36')]:_0x51ad81['model'];if(!_0x46e638[_0xf095('0x32')][_0xf095('0x39')]('nolimit')){_0x85e828[_0xf095('0x1d')]=qs[_0xf095('0x1d')](_0x46e638['query']['limit']);_0x85e828[_0xf095('0x1c')]=qs['offset'](_0x46e638['query'][_0xf095('0x1c')]);}_0x85e828['order']=qs[_0xf095('0x3a')](_0x46e638['query'][_0xf095('0x3a')]);_0x85e828['where']=qs[_0xf095('0x34')](_['pick'](_0x46e638[_0xf095('0x32')],_0x51ad81[_0xf095('0x34')]),_0x1666ca);if(_0x46e638[_0xf095('0x32')][_0xf095('0x3b')]){_0x85e828[_0xf095('0x3c')]=_[_0xf095('0x3d')](_0x85e828['where'],{'$or':_[_0xf095('0x2c')](_0x1666ca,function(_0x426ce6){if(_0x426ce6[_0xf095('0x3e')]!==_0xf095('0x3f')){var _0x5c94a7={};_0x5c94a7[_0x426ce6['name']]={'$like':'%'+_0x46e638[_0xf095('0x32')]['filter']+'%'};return _0x5c94a7;}})});}_0x85e828=_['merge']({},_0x85e828,_0x46e638[_0xf095('0x40')]);var _0x30f0d8={'where':_0x85e828[_0xf095('0x3c')]};return db[_0xf095('0x2d')][_0xf095('0x41')](_0x30f0d8)[_0xf095('0x24')](function(_0x50fe72){_0x552d54[_0xf095('0x41')]=_0x50fe72;if(_0x46e638[_0xf095('0x32')][_0xf095('0x42')]){_0x85e828[_0xf095('0x43')]=[{'all':!![]}];}return db[_0xf095('0x2d')][_0xf095('0x44')](_0x85e828);})['then'](function(_0x58394d){_0x552d54[_0xf095('0x45')]=_0x58394d;return _0x552d54;})[_0xf095('0x24')](respondWithFilteredResult(_0x108900,_0x85e828))[_0xf095('0x46')](handleError(_0x108900,null));};exports[_0xf095('0x47')]=function(_0x2c70a5,_0xf1beea){var _0x53df61={'raw':![],'where':{'id':_0x2c70a5[_0xf095('0x48')]['id']}},_0x32f92a={};_0x32f92a[_0xf095('0x31')]=_[_0xf095('0x33')](db['SalesforceAccount']['rawAttributes']);_0x32f92a[_0xf095('0x32')]=_[_0xf095('0x33')](_0x2c70a5[_0xf095('0x32')]);_0x32f92a['filters']=_[_0xf095('0x35')](_0x32f92a[_0xf095('0x31')],_0x32f92a[_0xf095('0x32')]);_0x53df61[_0xf095('0x36')]=_['intersection'](_0x32f92a['model'],qs['fields'](_0x2c70a5[_0xf095('0x32')]['fields']));_0x53df61[_0xf095('0x36')]=_0x53df61[_0xf095('0x36')][_0xf095('0x38')]?_0x53df61[_0xf095('0x36')]:_0x32f92a[_0xf095('0x31')];if(_0x2c70a5[_0xf095('0x32')]['includeAll']){_0x53df61[_0xf095('0x43')]=[{'all':!![]}];}_0x53df61=_['merge']({},_0x53df61,_0x2c70a5[_0xf095('0x40')]);return db[_0xf095('0x2d')][_0xf095('0x49')](_0x53df61)[_0xf095('0x24')](handleEntityNotFound(_0xf1beea,null))[_0xf095('0x24')](respondWithResult(_0xf1beea,null))['catch'](handleError(_0xf1beea,null));};exports[_0xf095('0x4a')]=function(_0x250335,_0x42ef84){return db[_0xf095('0x2d')][_0xf095('0x4a')](_0x250335[_0xf095('0x4b')],{})[_0xf095('0x24')](respondWithResult(_0x42ef84,0xc9))[_0xf095('0x46')](handleError(_0x42ef84,null));};exports[_0xf095('0x23')]=function(_0x22e90c,_0x3bea48){if(_0x22e90c[_0xf095('0x4b')]['id']){delete _0x22e90c[_0xf095('0x4b')]['id'];}return db[_0xf095('0x2d')][_0xf095('0x49')]({'where':{'id':_0x22e90c['params']['id']}})[_0xf095('0x24')](handleEntityNotFound(_0x3bea48,null))[_0xf095('0x24')](saveUpdates(_0x22e90c[_0xf095('0x4b')],null))[_0xf095('0x24')](respondWithResult(_0x3bea48,null))[_0xf095('0x46')](handleError(_0x3bea48,null));};exports[_0xf095('0x25')]=function(_0xdb0298,_0x2c4f9c){return db['SalesforceAccount']['find']({'where':{'id':_0xdb0298['params']['id']}})['then'](handleEntityNotFound(_0x2c4f9c,null))[_0xf095('0x24')](removeEntity(_0x2c4f9c,null))['catch'](handleError(_0x2c4f9c,null));};exports[_0xf095('0x4c')]=function(_0x32532e,_0x22dafc,_0x20f9f0){var _0x43ccf2={};var _0x31890e={};var _0x3f66a1;var _0x51bfe4;return db['SalesforceAccount'][_0xf095('0x4d')]({'where':{'id':_0x32532e[_0xf095('0x48')]['id']}})[_0xf095('0x24')](handleEntityNotFound(_0x22dafc,null))['then'](function(_0x5ca66a){if(_0x5ca66a){_0x3f66a1=_0x5ca66a;_0x31890e[_0xf095('0x31')]=_[_0xf095('0x33')](db[_0xf095('0x4e')][_0xf095('0x2e')]);_0x31890e[_0xf095('0x32')]=_['keys'](_0x32532e[_0xf095('0x32')]);_0x31890e[_0xf095('0x34')]=_[_0xf095('0x35')](_0x31890e[_0xf095('0x31')],_0x31890e['query']);_0x43ccf2[_0xf095('0x36')]=_[_0xf095('0x35')](_0x31890e[_0xf095('0x31')],qs[_0xf095('0x37')](_0x32532e[_0xf095('0x32')][_0xf095('0x37')]));_0x43ccf2[_0xf095('0x36')]=_0x43ccf2['attributes']['length']?_0x43ccf2[_0xf095('0x36')]:_0x31890e[_0xf095('0x31')];_0x43ccf2['order']=qs[_0xf095('0x3a')](_0x32532e[_0xf095('0x32')][_0xf095('0x3a')]);_0x43ccf2[_0xf095('0x3c')]=qs[_0xf095('0x34')](_[_0xf095('0x4f')](_0x32532e[_0xf095('0x32')],_0x31890e[_0xf095('0x34')]));if(_0x32532e[_0xf095('0x32')]['filter']){_0x43ccf2[_0xf095('0x3c')]=_[_0xf095('0x3d')](_0x43ccf2[_0xf095('0x3c')],{'$or':_['map'](_0x43ccf2[_0xf095('0x36')],function(_0x424dcd){var _0x29eb50={};_0x29eb50[_0x424dcd]={'$like':'%'+_0x32532e[_0xf095('0x32')][_0xf095('0x3b')]+'%'};return _0x29eb50;})});}_0x43ccf2=_[_0xf095('0x3d')]({},_0x43ccf2,_0x32532e['options']);return _0x3f66a1[_0xf095('0x4c')](_0x43ccf2);}})[_0xf095('0x24')](function(_0x54840a){if(_0x54840a){_0x51bfe4=_0x54840a['length'];if(!_0x32532e[_0xf095('0x32')][_0xf095('0x39')](_0xf095('0x50'))){_0x43ccf2[_0xf095('0x1d')]=qs[_0xf095('0x1d')](_0x32532e[_0xf095('0x32')][_0xf095('0x1d')]);_0x43ccf2[_0xf095('0x1c')]=qs[_0xf095('0x1c')](_0x32532e[_0xf095('0x32')][_0xf095('0x1c')]);}return _0x3f66a1[_0xf095('0x4c')](_0x43ccf2);}})[_0xf095('0x24')](function(_0x257d50){if(_0x257d50){return _0x257d50?{'count':_0x51bfe4,'rows':_0x257d50}:null;}})[_0xf095('0x24')](respondWithResult(_0x22dafc,null))[_0xf095('0x46')](handleError(_0x22dafc,null));};exports[_0xf095('0x51')]=function(_0x253e2a,_0x34235a,_0x340659){if(_0x253e2a['body']['id']){delete _0x253e2a['body']['id'];}return db[_0xf095('0x2d')][_0xf095('0x4d')]({'where':{'id':_0x253e2a[_0xf095('0x48')]['id']}})[_0xf095('0x24')](handleEntityNotFound(_0x34235a,null))[_0xf095('0x24')](function(_0x484ccf){if(_0x484ccf){_0x253e2a[_0xf095('0x4b')]['AccountId']=_0x484ccf['id'];_0x253e2a[_0xf095('0x4b')][_0xf095('0x52')]=integrations[_0xf095('0x53')](_0x253e2a[_0xf095('0x4b')]['channel'],_0x253e2a[_0xf095('0x4b')][_0xf095('0x3e')]);_0x253e2a['body'][_0xf095('0x54')]=integrations[_0xf095('0x55')](_0x253e2a[_0xf095('0x4b')][_0xf095('0x56')],_0x253e2a[_0xf095('0x4b')][_0xf095('0x3e')]);return db['SalesforceConfiguration'][_0xf095('0x4a')](_0x253e2a[_0xf095('0x4b')],{'include':[{'model':db[_0xf095('0x57')],'as':_0xf095('0x52')},{'model':db[_0xf095('0x57')],'as':'Descriptions'}]});}return null;})[_0xf095('0x24')](respondWithResult(_0x34235a,null))[_0xf095('0x46')](handleError(_0x34235a,null));};exports['getFields']=function(_0x1039f5,_0x11e9e9,_0x41970b){var _0x2e8466;var _0x535d14='';var _0x3a1a26=_0xf095('0x58');return db[_0xf095('0x2d')][_0xf095('0x4d')]({'where':{'id':_0x1039f5[_0xf095('0x48')]['id']},'attributes':['id',_0xf095('0x59'),_0xf095('0x5a'),_0xf095('0x5b'),'username',_0xf095('0x5c'),'securityToken']})[_0xf095('0x24')](handleEntityNotFound(_0x11e9e9,null))[_0xf095('0x24')](function(_0x2764b1){if(_0x2764b1){_0x535d14=_0x2764b1[_0xf095('0x59')];var _0x1dd36f=_0x535d14['slice'](-0x1);if(_0x1dd36f==='/'){_0x535d14=_0x535d14[_0xf095('0x5d')](0x0,_0x535d14[_0xf095('0x5e')](_0x1dd36f));}_0x2e8466=new jsforce['Connection']({'oauth2':{'loginUrl':_0x535d14,'clientId':_0x2764b1[_0xf095('0x5a')],'clientSecret':_0x2764b1[_0xf095('0x5b')]}});return _0x2e8466['login'](_0x2764b1['username'],_0x2764b1[_0xf095('0x5c')][_0xf095('0x5f')](_0x2764b1[_0xf095('0x60')]));}})['then'](function(_0x125047){if(_0x125047){if(!_[_0xf095('0x61')](_0x1039f5[_0xf095('0x32')][_0xf095('0x62')])){_0x3a1a26=_0x1039f5['query']['ticketType'];}return _0x2e8466['sobject'](_0x3a1a26)[_0xf095('0x63')]();}})[_0xf095('0x24')](function(_0xf8562a){var _0x118b7a=[_0xf095('0x64'),_0xf095('0x65'),_0xf095('0x66'),'IsRecurrence',_0xf095('0x67'),'Description'];var _0x2200a9=['string','int',_0xf095('0x68'),'boolean','email',_0xf095('0x69'),_0xf095('0x6a')];if(_0xf8562a){_[_0xf095('0x6b')](_0xf8562a['fields'],function(_0x96dd7){return _0x118b7a[_0xf095('0x6c')](_0x96dd7['name'])||!_0x2200a9[_0xf095('0x6c')](_0x96dd7[_0xf095('0x3e')]);});return{'count':_0xf8562a[_0xf095('0x37')][_0xf095('0x38')],'rows':_[_0xf095('0x2c')](_0xf8562a[_0xf095('0x37')],function(_0x2f6c94){return{'id':_0x2f6c94[_0xf095('0x29')],'name':_0x2f6c94[_0xf095('0x6d')],'custom':_0x2f6c94[_0xf095('0x6e')],'options':_0x2f6c94[_0xf095('0x6f')][_0xf095('0x38')]>0x0?_[_0xf095('0x2c')](_0x2f6c94['picklistValues'],function(_0x22887d){return{'name':_0x22887d[_0xf095('0x6d')],'value':_0x22887d['value']};}):_0x2f6c94[_0xf095('0x3e')]=='boolean'?[{'name':_0xf095('0x70'),'value':_0xf095('0x71')},{'name':_0xf095('0x72'),'value':'false'}]:[]};})};}})[_0xf095('0x24')](respondWithResult(_0x11e9e9,null))[_0xf095('0x46')](function(_0x522798){var _0x1a9ce2=_0x1039f5[_0xf095('0x32')][_0xf095('0x73')]?0x1f4:_0x522798[_0xf095('0x74')]||0x1f4;logger[_0xf095('0x27')](_0xf095('0x75'),_0xf095('0x76'),_0x1a9ce2,JSON['stringify'](_0x522798));delete _0x522798['name'];if(_0x1a9ce2===0x191){_0x1a9ce2=0x190;}_0x11e9e9[_0xf095('0x1b')](_0x1a9ce2)[_0xf095('0x2a')](_0x1039f5[_0xf095('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x522798[_0xf095('0x74')]}:_0x522798);});}; \ No newline at end of file +var _0x7f6f=['error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','keys','length','create','body','find','destroy','findOne','SalesforceConfiguration','pick','addConfiguration','Subjects','channel','getDescriptions','SalesforceField','Descriptions','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','login','username','concat','isNil','sobject','describe','IsReminderSet','IsRecurrence','Subject','int','picklist','boolean','email','textarea','remove','includes','picklistValues','label','value','True','False','false','test'];(function(_0x1be493,_0x571dc7){var _0x5ee1e5=function(_0x14cd66){while(--_0x14cd66){_0x1be493['push'](_0x1be493['shift']());}};_0x5ee1e5(++_0x571dc7);}(_0x7f6f,0xf2));var _0xf7f6=function(_0xb40f40,_0x41708a){_0xb40f40=_0xb40f40-0x0;var _0x55c108=_0x7f6f[_0xb40f40];return _0x55c108;};'use strict';var emlformat=require(_0xf7f6('0x0'));var rimraf=require(_0xf7f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7f6('0x2'));var rp=require('request-promise');var moment=require(_0xf7f6('0x3'));var BPromise=require(_0xf7f6('0x4'));var Mustache=require(_0xf7f6('0x5'));var util=require('util');var path=require(_0xf7f6('0x6'));var sox=require(_0xf7f6('0x7'));var csv=require('to-csv');var ejs=require(_0xf7f6('0x8'));var fs=require('fs');var fs_extra=require(_0xf7f6('0x9'));var _=require(_0xf7f6('0xa'));var squel=require('squel');var crypto=require(_0xf7f6('0xb'));var jsforce=require(_0xf7f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf7f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf7f6('0xe'));var qs=require(_0xf7f6('0xf'));var as=require(_0xf7f6('0x10'));var hardwareService=require(_0xf7f6('0x11'));var logger=require(_0xf7f6('0x12'))('api');var utils=require(_0xf7f6('0x13'));var config=require(_0xf7f6('0x14'));var licenseUtil=require(_0xf7f6('0x15'));var db=require(_0xf7f6('0x16'))['db'];var integrations=require(_0xf7f6('0x17'));function respondWithStatusCode(_0x220706,_0x2e33fc){_0x2e33fc=_0x2e33fc||0xcc;return function(_0x43bae3){if(_0x43bae3){return _0x220706[_0xf7f6('0x18')](_0x2e33fc);}return _0x220706[_0xf7f6('0x19')](_0x2e33fc)[_0xf7f6('0x1a')]();};}function respondWithResult(_0x350050,_0x23b200){_0x23b200=_0x23b200||0xc8;return function(_0x4153e2){if(_0x4153e2){return _0x350050[_0xf7f6('0x19')](_0x23b200)[_0xf7f6('0x1b')](_0x4153e2);}};}function respondWithFilteredResult(_0x3d861c,_0x26dcdc){return function(_0x34c286){if(_0x34c286){var _0x379e9a=typeof _0x26dcdc[_0xf7f6('0x1c')]==='undefined'&&typeof _0x26dcdc[_0xf7f6('0x1d')]===_0xf7f6('0x1e');var _0x55c739=_0x34c286[_0xf7f6('0x1f')];var _0x17ad77=_0x379e9a?0x0:_0x26dcdc[_0xf7f6('0x1c')];var _0x221c2f=_0x379e9a?_0x34c286['count']:_0x26dcdc['offset']+_0x26dcdc[_0xf7f6('0x1d')];var _0x2a5310;if(_0x221c2f>=_0x55c739){_0x221c2f=_0x55c739;_0x2a5310=0xc8;}else{_0x2a5310=0xce;}_0x3d861c[_0xf7f6('0x19')](_0x2a5310);return _0x3d861c[_0xf7f6('0x20')]('Content-Range',_0x17ad77+'-'+_0x221c2f+'/'+_0x55c739)[_0xf7f6('0x1b')](_0x34c286);}return null;};}function patchUpdates(_0x688d39){return function(_0x2e7922){try{jsonpatch[_0xf7f6('0x21')](_0x2e7922,_0x688d39,!![]);}catch(_0x27ebde){return BPromise[_0xf7f6('0x22')](_0x27ebde);}return _0x2e7922['save']();};}function saveUpdates(_0x5f1022,_0xb4fbd5){return function(_0x5855b5){if(_0x5855b5){return _0x5855b5[_0xf7f6('0x23')](_0x5f1022)['then'](function(_0x1f571e){return _0x1f571e;});}return null;};}function removeEntity(_0x4a5e3c,_0x46f259){return function(_0x7f263f){if(_0x7f263f){return _0x7f263f['destroy']()[_0xf7f6('0x24')](function(){_0x4a5e3c[_0xf7f6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5479b3,_0x204101){return function(_0x30113f){if(!_0x30113f){_0x5479b3[_0xf7f6('0x18')](0x194);}return _0x30113f;};}function handleError(_0x316cd3,_0x2e3abc){_0x2e3abc=_0x2e3abc||0x1f4;return function(_0x18790a){logger['error'](_0x18790a['stack']);if(_0x18790a[_0xf7f6('0x25')]){delete _0x18790a[_0xf7f6('0x25')];}_0x316cd3['status'](_0x2e3abc)[_0xf7f6('0x26')](_0x18790a);};}exports['index']=function(_0x95d8c,_0x25756e){var _0xad3a5={},_0x205b97={},_0x7a9ff7={'count':0x0,'rows':[]};var _0x4b00a7=_[_0xf7f6('0x27')](db[_0xf7f6('0x28')][_0xf7f6('0x29')],function(_0x59c8ff){return{'name':_0x59c8ff[_0xf7f6('0x2a')],'type':_0x59c8ff[_0xf7f6('0x2b')][_0xf7f6('0x2c')]};});_0x205b97[_0xf7f6('0x2d')]=_[_0xf7f6('0x27')](_0x4b00a7,_0xf7f6('0x25'));_0x205b97[_0xf7f6('0x2e')]=_['keys'](_0x95d8c['query']);_0x205b97[_0xf7f6('0x2f')]=_[_0xf7f6('0x30')](_0x205b97[_0xf7f6('0x2d')],_0x205b97[_0xf7f6('0x2e')]);_0xad3a5['attributes']=_['intersection'](_0x205b97[_0xf7f6('0x2d')],qs[_0xf7f6('0x31')](_0x95d8c[_0xf7f6('0x2e')][_0xf7f6('0x31')]));_0xad3a5[_0xf7f6('0x32')]=_0xad3a5['attributes']['length']?_0xad3a5['attributes']:_0x205b97[_0xf7f6('0x2d')];if(!_0x95d8c[_0xf7f6('0x2e')]['hasOwnProperty'](_0xf7f6('0x33'))){_0xad3a5[_0xf7f6('0x1d')]=qs['limit'](_0x95d8c[_0xf7f6('0x2e')]['limit']);_0xad3a5[_0xf7f6('0x1c')]=qs[_0xf7f6('0x1c')](_0x95d8c[_0xf7f6('0x2e')]['offset']);}_0xad3a5[_0xf7f6('0x34')]=qs[_0xf7f6('0x35')](_0x95d8c[_0xf7f6('0x2e')][_0xf7f6('0x35')]);_0xad3a5[_0xf7f6('0x36')]=qs[_0xf7f6('0x2f')](_['pick'](_0x95d8c[_0xf7f6('0x2e')],_0x205b97[_0xf7f6('0x2f')]),_0x4b00a7);if(_0x95d8c['query'][_0xf7f6('0x37')]){_0xad3a5[_0xf7f6('0x36')]=_[_0xf7f6('0x38')](_0xad3a5[_0xf7f6('0x36')],{'$or':_[_0xf7f6('0x27')](_0x4b00a7,function(_0x385a12){if(_0x385a12[_0xf7f6('0x2b')]!=='VIRTUAL'){var _0x54ff7a={};_0x54ff7a[_0x385a12[_0xf7f6('0x25')]]={'$like':'%'+_0x95d8c[_0xf7f6('0x2e')][_0xf7f6('0x37')]+'%'};return _0x54ff7a;}})});}_0xad3a5=_[_0xf7f6('0x38')]({},_0xad3a5,_0x95d8c[_0xf7f6('0x39')]);var _0x2278de={'where':_0xad3a5[_0xf7f6('0x36')]};return db['SalesforceAccount'][_0xf7f6('0x1f')](_0x2278de)[_0xf7f6('0x24')](function(_0x5125ed){_0x7a9ff7[_0xf7f6('0x1f')]=_0x5125ed;if(_0x95d8c[_0xf7f6('0x2e')][_0xf7f6('0x3a')]){_0xad3a5[_0xf7f6('0x3b')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0xad3a5);})[_0xf7f6('0x24')](function(_0x297e5d){_0x7a9ff7[_0xf7f6('0x3c')]=_0x297e5d;return _0x7a9ff7;})[_0xf7f6('0x24')](respondWithFilteredResult(_0x25756e,_0xad3a5))[_0xf7f6('0x3d')](handleError(_0x25756e,null));};exports[_0xf7f6('0x3e')]=function(_0x59b0e7,_0x3240f0){var _0x11aaa4={'raw':![],'where':{'id':_0x59b0e7[_0xf7f6('0x3f')]['id']}},_0x624d0e={};_0x624d0e[_0xf7f6('0x2d')]=_['keys'](db[_0xf7f6('0x28')][_0xf7f6('0x29')]);_0x624d0e[_0xf7f6('0x2e')]=_[_0xf7f6('0x40')](_0x59b0e7[_0xf7f6('0x2e')]);_0x624d0e['filters']=_[_0xf7f6('0x30')](_0x624d0e[_0xf7f6('0x2d')],_0x624d0e[_0xf7f6('0x2e')]);_0x11aaa4['attributes']=_[_0xf7f6('0x30')](_0x624d0e[_0xf7f6('0x2d')],qs[_0xf7f6('0x31')](_0x59b0e7[_0xf7f6('0x2e')][_0xf7f6('0x31')]));_0x11aaa4[_0xf7f6('0x32')]=_0x11aaa4['attributes'][_0xf7f6('0x41')]?_0x11aaa4[_0xf7f6('0x32')]:_0x624d0e['model'];if(_0x59b0e7[_0xf7f6('0x2e')][_0xf7f6('0x3a')]){_0x11aaa4['include']=[{'all':!![]}];}_0x11aaa4=_[_0xf7f6('0x38')]({},_0x11aaa4,_0x59b0e7[_0xf7f6('0x39')]);return db[_0xf7f6('0x28')]['find'](_0x11aaa4)[_0xf7f6('0x24')](handleEntityNotFound(_0x3240f0,null))['then'](respondWithResult(_0x3240f0,null))[_0xf7f6('0x3d')](handleError(_0x3240f0,null));};exports[_0xf7f6('0x42')]=function(_0x24182e,_0x331710){return db[_0xf7f6('0x28')]['create'](_0x24182e[_0xf7f6('0x43')],{})[_0xf7f6('0x24')](respondWithResult(_0x331710,0xc9))['catch'](handleError(_0x331710,null));};exports[_0xf7f6('0x23')]=function(_0x5f47da,_0x1e881c){if(_0x5f47da['body']['id']){delete _0x5f47da[_0xf7f6('0x43')]['id'];}return db['SalesforceAccount'][_0xf7f6('0x44')]({'where':{'id':_0x5f47da[_0xf7f6('0x3f')]['id']}})[_0xf7f6('0x24')](handleEntityNotFound(_0x1e881c,null))[_0xf7f6('0x24')](saveUpdates(_0x5f47da[_0xf7f6('0x43')],null))[_0xf7f6('0x24')](respondWithResult(_0x1e881c,null))[_0xf7f6('0x3d')](handleError(_0x1e881c,null));};exports[_0xf7f6('0x45')]=function(_0x306173,_0x218e1e){return db[_0xf7f6('0x28')]['find']({'where':{'id':_0x306173[_0xf7f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x218e1e,null))[_0xf7f6('0x24')](removeEntity(_0x218e1e,null))['catch'](handleError(_0x218e1e,null));};exports['getConfigurations']=function(_0x5dd072,_0x282817,_0x8a3e98){var _0x6e9899={};var _0x1a5581={};var _0xb5a895;var _0x33ab73;return db['SalesforceAccount'][_0xf7f6('0x46')]({'where':{'id':_0x5dd072[_0xf7f6('0x3f')]['id']}})[_0xf7f6('0x24')](handleEntityNotFound(_0x282817,null))['then'](function(_0x1a447d){if(_0x1a447d){_0xb5a895=_0x1a447d;_0x1a5581['model']=_['keys'](db[_0xf7f6('0x47')][_0xf7f6('0x29')]);_0x1a5581['query']=_['keys'](_0x5dd072['query']);_0x1a5581[_0xf7f6('0x2f')]=_['intersection'](_0x1a5581[_0xf7f6('0x2d')],_0x1a5581[_0xf7f6('0x2e')]);_0x6e9899[_0xf7f6('0x32')]=_['intersection'](_0x1a5581[_0xf7f6('0x2d')],qs['fields'](_0x5dd072[_0xf7f6('0x2e')][_0xf7f6('0x31')]));_0x6e9899['attributes']=_0x6e9899[_0xf7f6('0x32')][_0xf7f6('0x41')]?_0x6e9899[_0xf7f6('0x32')]:_0x1a5581['model'];_0x6e9899['order']=qs[_0xf7f6('0x35')](_0x5dd072[_0xf7f6('0x2e')][_0xf7f6('0x35')]);_0x6e9899['where']=qs[_0xf7f6('0x2f')](_[_0xf7f6('0x48')](_0x5dd072[_0xf7f6('0x2e')],_0x1a5581['filters']));if(_0x5dd072[_0xf7f6('0x2e')]['filter']){_0x6e9899[_0xf7f6('0x36')]=_['merge'](_0x6e9899['where'],{'$or':_[_0xf7f6('0x27')](_0x6e9899[_0xf7f6('0x32')],function(_0x5224a7){var _0x2f0d15={};_0x2f0d15[_0x5224a7]={'$like':'%'+_0x5dd072['query']['filter']+'%'};return _0x2f0d15;})});}_0x6e9899=_[_0xf7f6('0x38')]({},_0x6e9899,_0x5dd072[_0xf7f6('0x39')]);return _0xb5a895['getConfigurations'](_0x6e9899);}})[_0xf7f6('0x24')](function(_0x16d851){if(_0x16d851){_0x33ab73=_0x16d851[_0xf7f6('0x41')];if(!_0x5dd072[_0xf7f6('0x2e')]['hasOwnProperty'](_0xf7f6('0x33'))){_0x6e9899[_0xf7f6('0x1d')]=qs[_0xf7f6('0x1d')](_0x5dd072[_0xf7f6('0x2e')][_0xf7f6('0x1d')]);_0x6e9899[_0xf7f6('0x1c')]=qs[_0xf7f6('0x1c')](_0x5dd072[_0xf7f6('0x2e')][_0xf7f6('0x1c')]);}return _0xb5a895['getConfigurations'](_0x6e9899);}})[_0xf7f6('0x24')](function(_0x1e552d){if(_0x1e552d){return _0x1e552d?{'count':_0x33ab73,'rows':_0x1e552d}:null;}})[_0xf7f6('0x24')](respondWithResult(_0x282817,null))[_0xf7f6('0x3d')](handleError(_0x282817,null));};exports[_0xf7f6('0x49')]=function(_0x153f66,_0x4b872e,_0x2ba8dc){if(_0x153f66[_0xf7f6('0x43')]['id']){delete _0x153f66['body']['id'];}return db['SalesforceAccount'][_0xf7f6('0x46')]({'where':{'id':_0x153f66['params']['id']}})[_0xf7f6('0x24')](handleEntityNotFound(_0x4b872e,null))[_0xf7f6('0x24')](function(_0xd26673){if(_0xd26673){_0x153f66[_0xf7f6('0x43')]['AccountId']=_0xd26673['id'];_0x153f66[_0xf7f6('0x43')][_0xf7f6('0x4a')]=integrations['getSubjects'](_0x153f66[_0xf7f6('0x43')][_0xf7f6('0x4b')],_0x153f66[_0xf7f6('0x43')][_0xf7f6('0x2b')]);_0x153f66[_0xf7f6('0x43')]['Descriptions']=integrations[_0xf7f6('0x4c')](_0x153f66['body'][_0xf7f6('0x4b')],_0x153f66['body']['type']);return db[_0xf7f6('0x47')][_0xf7f6('0x42')](_0x153f66[_0xf7f6('0x43')],{'include':[{'model':db[_0xf7f6('0x4d')],'as':_0xf7f6('0x4a')},{'model':db[_0xf7f6('0x4d')],'as':_0xf7f6('0x4e')}]});}return null;})['then'](respondWithResult(_0x4b872e,null))[_0xf7f6('0x3d')](handleError(_0x4b872e,null));};exports['getFields']=function(_0x45a10b,_0x51dc32,_0x25bc07){var _0x5d2cc5;var _0x1e0261='';var _0x451b3d=_0xf7f6('0x4f');return db[_0xf7f6('0x28')]['findOne']({'where':{'id':_0x45a10b[_0xf7f6('0x3f')]['id']},'attributes':['id',_0xf7f6('0x50'),_0xf7f6('0x51'),_0xf7f6('0x52'),'username',_0xf7f6('0x53'),_0xf7f6('0x54')]})[_0xf7f6('0x24')](handleEntityNotFound(_0x51dc32,null))[_0xf7f6('0x24')](function(_0x2104b5){if(_0x2104b5){_0x1e0261=_0x2104b5[_0xf7f6('0x50')];var _0x4ad854=_0x1e0261[_0xf7f6('0x55')](-0x1);if(_0x4ad854==='/'){_0x1e0261=_0x1e0261[_0xf7f6('0x56')](0x0,_0x1e0261[_0xf7f6('0x57')](_0x4ad854));}_0x5d2cc5=new jsforce[(_0xf7f6('0x58'))]({'oauth2':{'loginUrl':_0x1e0261,'clientId':_0x2104b5[_0xf7f6('0x51')],'clientSecret':_0x2104b5[_0xf7f6('0x52')]}});return _0x5d2cc5[_0xf7f6('0x59')](_0x2104b5[_0xf7f6('0x5a')],_0x2104b5[_0xf7f6('0x53')][_0xf7f6('0x5b')](_0x2104b5[_0xf7f6('0x54')]));}})[_0xf7f6('0x24')](function(_0x49716a){if(_0x49716a){if(!_[_0xf7f6('0x5c')](_0x45a10b['query']['ticketType'])){_0x451b3d=_0x45a10b['query']['ticketType'];}return _0x5d2cc5[_0xf7f6('0x5d')](_0x451b3d)[_0xf7f6('0x5e')]();}})['then'](function(_0x583bd7){var _0x456aac=['OwnerId','ActivityDate',_0xf7f6('0x5f'),_0xf7f6('0x60'),_0xf7f6('0x61'),'Description'];var _0x5d171c=['string',_0xf7f6('0x62'),_0xf7f6('0x63'),_0xf7f6('0x64'),_0xf7f6('0x65'),_0xf7f6('0x66'),'phone'];if(_0x583bd7){_[_0xf7f6('0x67')](_0x583bd7[_0xf7f6('0x31')],function(_0x397664){return _0x456aac[_0xf7f6('0x68')](_0x397664[_0xf7f6('0x25')])||!_0x5d171c[_0xf7f6('0x68')](_0x397664[_0xf7f6('0x2b')]);});return{'count':_0x583bd7['fields'][_0xf7f6('0x41')],'rows':_['map'](_0x583bd7[_0xf7f6('0x31')],function(_0x2dbcf6){return{'id':_0x2dbcf6[_0xf7f6('0x25')],'name':_0x2dbcf6['label'],'custom':_0x2dbcf6['custom'],'options':_0x2dbcf6['picklistValues'][_0xf7f6('0x41')]>0x0?_[_0xf7f6('0x27')](_0x2dbcf6[_0xf7f6('0x69')],function(_0x15ee48){return{'name':_0x15ee48[_0xf7f6('0x6a')],'value':_0x15ee48[_0xf7f6('0x6b')]};}):_0x2dbcf6['type']=='boolean'?[{'name':_0xf7f6('0x6c'),'value':'true'},{'name':_0xf7f6('0x6d'),'value':_0xf7f6('0x6e')}]:[]};})};}})['then'](respondWithResult(_0x51dc32,null))['catch'](function(_0x1f9910){var _0x5a4af1=_0x45a10b[_0xf7f6('0x2e')][_0xf7f6('0x6f')]?0x1f4:_0x1f9910['statusCode']||0x1f4;logger[_0xf7f6('0x70')](_0xf7f6('0x71'),_0xf7f6('0x72'),_0x5a4af1,JSON[_0xf7f6('0x73')](_0x1f9910));delete _0x1f9910['name'];if(_0x5a4af1===0x191){_0x5a4af1=0x190;}_0x51dc32[_0xf7f6('0x19')](_0x5a4af1)[_0xf7f6('0x26')](_0x45a10b['query'][_0xf7f6('0x6f')]?{'message':_0xf7f6('0x74'),'statusCode':_0x1f9910[_0xf7f6('0x75')]}:_0x1f9910);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 24d1aaa..c323b89 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 _0x2239=['api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','util'];(function(_0x310335,_0x493f01){var _0x11f933=function(_0x50fa01){while(--_0x50fa01){_0x310335['push'](_0x310335['shift']());}};_0x11f933(++_0x493f01);}(_0x2239,0x18b));var _0x9223=function(_0x49104b,_0x5d3e4b){_0x49104b=_0x49104b-0x0;var _0x10eca5=_0x2239[_0x49104b];return _0x10eca5;};'use strict';var _=require('lodash');var util=require(_0x9223('0x0'));var logger=require('../../config/logger')(_0x9223('0x1'));var moment=require(_0x9223('0x2'));var BPromise=require(_0x9223('0x3'));var rp=require(_0x9223('0x4'));var fs=require('fs');var path=require(_0x9223('0x5'));var rimraf=require(_0x9223('0x6'));var config=require('../../config/environment');var attributes=require(_0x9223('0x7'));var integrations=require(_0x9223('0x8'));module[_0x9223('0x9')]=function(_0x25ccdd,_0x1c6104){return _0x25ccdd[_0x9223('0xa')]('SalesforceAccount',attributes,{'tableName':_0x9223('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a39=['rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','lodash','../../config/logger','api','bluebird','path'];(function(_0x292fa8,_0x2ac884){var _0x52d357=function(_0xca4082){while(--_0xca4082){_0x292fa8['push'](_0x292fa8['shift']());}};_0x52d357(++_0x2ac884);}(_0x4a39,0x9b));var _0x94a3=function(_0x68d97e,_0x33e5f9){_0x68d97e=_0x68d97e-0x0;var _0x99cebc=_0x4a39[_0x68d97e];return _0x99cebc;};'use strict';var _=require(_0x94a3('0x0'));var util=require('util');var logger=require(_0x94a3('0x1'))(_0x94a3('0x2'));var moment=require('moment');var BPromise=require(_0x94a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94a3('0x4'));var rimraf=require(_0x94a3('0x5'));var config=require(_0x94a3('0x6'));var attributes=require(_0x94a3('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x94a3('0x8')]=function(_0x192137,_0x48e86a){return _0x192137[_0x94a3('0x9')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','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 6917fec..bb453a8 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 _0x3be2=['../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','find','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x30a6ce,_0x5daa6f){var _0x18f306=function(_0x3a5953){while(--_0x3a5953){_0x30a6ce['push'](_0x30a6ce['shift']());}};_0x18f306(++_0x5daa6f);}(_0x3be2,0xfa));var _0x23be=function(_0x253414,_0x278dc5){_0x253414=_0x253414-0x0;var _0x56957b=_0x3be2[_0x253414];return _0x56957b;};'use strict';var _=require(_0x23be('0x0'));var util=require(_0x23be('0x1'));var moment=require('moment');var BPromise=require(_0x23be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23be('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x23be('0x4'));var logger=require(_0x23be('0x5'))('rpc');var config=require(_0x23be('0x6'));var jayson=require(_0x23be('0x7'));var client=jayson[_0x23be('0x8')][_0x23be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xab1196,_0x4b266d,_0x23d2da){return new BPromise(function(_0x433b01,_0x489a9f){return client[_0x23be('0xa')](_0xab1196,_0x23d2da)[_0x23be('0xb')](function(_0x48eb27){logger[_0x23be('0xc')](_0x23be('0xd'),_0x4b266d,_0x23be('0xe'));logger[_0x23be('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4b266d,'request\x20sent',JSON['stringify'](_0x48eb27));if(_0x48eb27['error']){if(_0x48eb27[_0x23be('0x10')]['code']===0x1f4){logger[_0x23be('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x4b266d,_0x48eb27[_0x23be('0x10')][_0x23be('0x11')]);return _0x489a9f(_0x48eb27[_0x23be('0x10')][_0x23be('0x11')]);}logger['error'](_0x23be('0xd'),_0x4b266d,_0x48eb27['error'][_0x23be('0x11')]);return _0x433b01(_0x48eb27[_0x23be('0x10')][_0x23be('0x11')]);}else{logger[_0x23be('0xc')](_0x23be('0xd'),_0x4b266d,_0x23be('0xe'));_0x433b01(_0x48eb27[_0x23be('0x12')][_0x23be('0x11')]);}})['catch'](function(_0x2f9ec9){logger['error'](_0x23be('0xd'),_0x4b266d,_0x2f9ec9);_0x489a9f(_0x2f9ec9);});});}exports[_0x23be('0x13')]=function(_0x182abe){var _0x4d5d4f=this;return new Promise(function(_0x2efe9c,_0x491472){return db[_0x23be('0x14')]['findAll']({'raw':_0x182abe[_0x23be('0x15')]?_0x182abe[_0x23be('0x15')][_0x23be('0x16')]===undefined?!![]:![]:!![],'where':_0x182abe[_0x23be('0x15')]?_0x182abe[_0x23be('0x15')][_0x23be('0x17')]||null:null,'attributes':_0x182abe[_0x23be('0x15')]?_0x182abe[_0x23be('0x15')][_0x23be('0x18')]||null:null,'limit':_0x182abe[_0x23be('0x15')]?_0x182abe[_0x23be('0x15')][_0x23be('0x19')]||null:null,'include':_0x182abe[_0x23be('0x15')]?_0x182abe['options']['include']?_['map'](_0x182abe[_0x23be('0x15')][_0x23be('0x1a')],function(_0x269557){return{'model':db[_0x269557['model']],'as':_0x269557['as'],'attributes':_0x269557[_0x23be('0x18')],'include':_0x269557[_0x23be('0x1a')]?_[_0x23be('0x1b')](_0x269557[_0x23be('0x1a')],function(_0x176b5f){return{'model':db[_0x176b5f[_0x23be('0x1c')]],'as':_0x176b5f['as'],'attributes':_0x176b5f[_0x23be('0x18')],'include':_0x176b5f['include']?_[_0x23be('0x1b')](_0x176b5f['include'],function(_0xfd714a){return{'model':db[_0xfd714a['model']],'as':_0xfd714a['as'],'attributes':_0xfd714a[_0x23be('0x18')]};}):[]};}):[]};}):[]:[]})[_0x23be('0xb')](function(_0x2d6554){logger['info']('GetSalesforceAccount',_0x182abe);logger[_0x23be('0xf')](_0x23be('0x13'),_0x182abe,JSON[_0x23be('0x1d')](_0x2d6554));_0x2efe9c(_0x2d6554);})['catch'](function(_0x5762ac){logger[_0x23be('0x10')](_0x23be('0x13'),_0x5762ac[_0x23be('0x11')],_0x182abe);_0x491472(_0x4d5d4f[_0x23be('0x10')](0x1f4,_0x5762ac[_0x23be('0x11')]));});});};exports[_0x23be('0x1e')]=function(_0x2e9bd6){var _0x3efd44=this;return new Promise(function(_0x5b6766,_0x3a5094){return db[_0x23be('0x14')][_0x23be('0x1f')]({'raw':_0x2e9bd6['options']?_0x2e9bd6['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e9bd6[_0x23be('0x15')]?_0x2e9bd6[_0x23be('0x15')][_0x23be('0x17')]||null:null,'attributes':_0x2e9bd6[_0x23be('0x15')]?_0x2e9bd6[_0x23be('0x15')]['attributes']||null:null,'include':_0x2e9bd6['options']?_0x2e9bd6['options'][_0x23be('0x1a')]?_[_0x23be('0x1b')](_0x2e9bd6[_0x23be('0x15')][_0x23be('0x1a')],function(_0x48c9bd){return{'model':db[_0x48c9bd[_0x23be('0x1c')]],'as':_0x48c9bd['as'],'attributes':_0x48c9bd[_0x23be('0x18')],'include':_0x48c9bd[_0x23be('0x1a')]?_['map'](_0x48c9bd[_0x23be('0x1a')],function(_0x3e93d1){return{'model':db[_0x3e93d1['model']],'as':_0x3e93d1['as'],'attributes':_0x3e93d1[_0x23be('0x18')],'include':_0x3e93d1[_0x23be('0x1a')]?_[_0x23be('0x1b')](_0x3e93d1[_0x23be('0x1a')],function(_0x3bb29b){return{'model':db[_0x3bb29b[_0x23be('0x1c')]],'as':_0x3bb29b['as'],'attributes':_0x3bb29b[_0x23be('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fbd56){logger['info']('ShowSalesforceAccount',_0x2e9bd6);logger[_0x23be('0xf')](_0x23be('0x1e'),_0x2e9bd6,JSON[_0x23be('0x1d')](_0x4fbd56));_0x5b6766(_0x4fbd56);})['catch'](function(_0xc45cf9){logger[_0x23be('0x10')]('ShowSalesforceAccount',_0xc45cf9[_0x23be('0x11')],_0x2e9bd6);_0x3a5094(_0x3efd44[_0x23be('0x10')](0x1f4,_0xc45cf9[_0x23be('0x11')]));});});}; \ No newline at end of file +var _0xe66c=['client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','attributes','limit','include','map','model','ShowSalesforceAccount','find','where','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xe66c,0x12b));var _0xce66=function(_0x152018,_0x1876a7){_0x152018=_0x152018-0x0;var _0x22bbfe=_0xe66c[_0x152018];return _0x22bbfe;};'use strict';var _=require('lodash');var util=require(_0xce66('0x0'));var moment=require(_0xce66('0x1'));var BPromise=require(_0xce66('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce66('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce66('0x4'));var logger=require('../../config/logger')(_0xce66('0x5'));var config=require('../../config/environment');var jayson=require(_0xce66('0x6'));var client=jayson[_0xce66('0x7')][_0xce66('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2767d7,_0x2a6df9,_0x5a38a4){return new BPromise(function(_0x156d97,_0x155ad3){return client[_0xce66('0x9')](_0x2767d7,_0x5a38a4)[_0xce66('0xa')](function(_0x8f77e1){logger[_0xce66('0xb')](_0xce66('0xc'),_0x2a6df9,_0xce66('0xd'));logger[_0xce66('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2a6df9,_0xce66('0xd'),JSON[_0xce66('0xf')](_0x8f77e1));if(_0x8f77e1[_0xce66('0x10')]){if(_0x8f77e1['error'][_0xce66('0x11')]===0x1f4){logger[_0xce66('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x2a6df9,_0x8f77e1[_0xce66('0x10')]['message']);return _0x155ad3(_0x8f77e1[_0xce66('0x10')][_0xce66('0x12')]);}logger[_0xce66('0x10')](_0xce66('0xc'),_0x2a6df9,_0x8f77e1[_0xce66('0x10')][_0xce66('0x12')]);return _0x156d97(_0x8f77e1['error'][_0xce66('0x12')]);}else{logger[_0xce66('0xb')](_0xce66('0xc'),_0x2a6df9,_0xce66('0xd'));_0x156d97(_0x8f77e1[_0xce66('0x13')][_0xce66('0x12')]);}})[_0xce66('0x14')](function(_0x338984){logger[_0xce66('0x10')](_0xce66('0xc'),_0x2a6df9,_0x338984);_0x155ad3(_0x338984);});});}exports[_0xce66('0x15')]=function(_0x54492d){var _0x24de0d=this;return new Promise(function(_0x366257,_0x29e384){return db[_0xce66('0x16')][_0xce66('0x17')]({'raw':_0x54492d['options']?_0x54492d['options'][_0xce66('0x18')]===undefined?!![]:![]:!![],'where':_0x54492d[_0xce66('0x19')]?_0x54492d[_0xce66('0x19')]['where']||null:null,'attributes':_0x54492d[_0xce66('0x19')]?_0x54492d[_0xce66('0x19')][_0xce66('0x1a')]||null:null,'limit':_0x54492d['options']?_0x54492d[_0xce66('0x19')][_0xce66('0x1b')]||null:null,'include':_0x54492d[_0xce66('0x19')]?_0x54492d[_0xce66('0x19')][_0xce66('0x1c')]?_[_0xce66('0x1d')](_0x54492d[_0xce66('0x19')]['include'],function(_0x3ebef3){return{'model':db[_0x3ebef3[_0xce66('0x1e')]],'as':_0x3ebef3['as'],'attributes':_0x3ebef3['attributes'],'include':_0x3ebef3[_0xce66('0x1c')]?_['map'](_0x3ebef3['include'],function(_0x553adb){return{'model':db[_0x553adb['model']],'as':_0x553adb['as'],'attributes':_0x553adb[_0xce66('0x1a')],'include':_0x553adb['include']?_[_0xce66('0x1d')](_0x553adb[_0xce66('0x1c')],function(_0x1b3d6b){return{'model':db[_0x1b3d6b[_0xce66('0x1e')]],'as':_0x1b3d6b['as'],'attributes':_0x1b3d6b[_0xce66('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xce66('0xa')](function(_0x47b2d0){logger['info'](_0xce66('0x15'),_0x54492d);logger[_0xce66('0xe')](_0xce66('0x15'),_0x54492d,JSON[_0xce66('0xf')](_0x47b2d0));_0x366257(_0x47b2d0);})[_0xce66('0x14')](function(_0x542c09){logger[_0xce66('0x10')](_0xce66('0x15'),_0x542c09[_0xce66('0x12')],_0x54492d);_0x29e384(_0x24de0d['error'](0x1f4,_0x542c09['message']));});});};exports[_0xce66('0x1f')]=function(_0x1ad10b){var _0x18aa03=this;return new Promise(function(_0x40ea81,_0x29b6f3){return db[_0xce66('0x16')][_0xce66('0x20')]({'raw':_0x1ad10b[_0xce66('0x19')]?_0x1ad10b[_0xce66('0x19')][_0xce66('0x18')]===undefined?!![]:![]:!![],'where':_0x1ad10b[_0xce66('0x19')]?_0x1ad10b['options'][_0xce66('0x21')]||null:null,'attributes':_0x1ad10b[_0xce66('0x19')]?_0x1ad10b[_0xce66('0x19')][_0xce66('0x1a')]||null:null,'include':_0x1ad10b[_0xce66('0x19')]?_0x1ad10b['options'][_0xce66('0x1c')]?_['map'](_0x1ad10b['options'][_0xce66('0x1c')],function(_0x623e68){return{'model':db[_0x623e68[_0xce66('0x1e')]],'as':_0x623e68['as'],'attributes':_0x623e68[_0xce66('0x1a')],'include':_0x623e68[_0xce66('0x1c')]?_[_0xce66('0x1d')](_0x623e68[_0xce66('0x1c')],function(_0x137844){return{'model':db[_0x137844[_0xce66('0x1e')]],'as':_0x137844['as'],'attributes':_0x137844[_0xce66('0x1a')],'include':_0x137844[_0xce66('0x1c')]?_[_0xce66('0x1d')](_0x137844[_0xce66('0x1c')],function(_0x905fac){return{'model':db[_0x905fac[_0xce66('0x1e')]],'as':_0x905fac['as'],'attributes':_0x905fac[_0xce66('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xce66('0xa')](function(_0x51733b){logger[_0xce66('0xb')](_0xce66('0x1f'),_0x1ad10b);logger['debug'](_0xce66('0x1f'),_0x1ad10b,JSON[_0xce66('0xf')](_0x51733b));_0x40ea81(_0x51733b);})[_0xce66('0x14')](function(_0x593aea){logger[_0xce66('0x10')](_0xce66('0x1f'),_0x593aea[_0xce66('0x12')],_0x1ad10b);_0x29b6f3(_0x18aa03[_0xce66('0x10')](0x1f4,_0x593aea[_0xce66('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 835d4a2..f06d588 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x58fe34,_0x4951a2){var _0x502f28=function(_0xccc95c){while(--_0xccc95c){_0x58fe34['push'](_0x58fe34['shift']());}};_0x502f28(++_0x4951a2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xdb28,0x106));var _0x8db2=function(_0x3e9817,_0x469a3e){_0x3e9817=_0x3e9817-0x0;var _0x4c3e8c=_0xdb28[_0x3e9817];return _0x4c3e8c;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index cebcc1a..9d2bc91 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 _0x9296=['ENUM','Task','Case','contact_lead','account_contact_lead','account','nothing','contact','lead','STRING'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x9296,0x10d));var _0x6929=function(_0x6cfd94,_0x58576f){_0x6cfd94=_0x6cfd94-0x0;var _0x21a5fe=_0x9296[_0x6cfd94];return _0x21a5fe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6929('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x6929('0x1')](_0x6929('0x2'),_0x6929('0x3')),'defaultValue':_0x6929('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x6929('0x4'),'contact','lead',_0x6929('0x5'),_0x6929('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x6929('0x1')](_0x6929('0x7'),_0x6929('0x8'),'lead',_0x6929('0x6')),'defaultValue':_0x6929('0x9')},'leadId':{'type':Sequelize[_0x6929('0x0')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x19f3=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account','nothing','sequelize','exports'];(function(_0x480b19,_0x31f3db){var _0x1191a5=function(_0x237307){while(--_0x237307){_0x480b19['push'](_0x480b19['shift']());}};_0x1191a5(++_0x31f3db);}(_0x19f3,0x1e2));var _0x319f=function(_0x42c282,_0x2c14c7){_0x42c282=_0x42c282-0x0;var _0x537c85=_0x19f3[_0x42c282];return _0x537c85;};'use strict';var Sequelize=require(_0x319f('0x0'));module[_0x319f('0x1')]={'name':{'type':Sequelize[_0x319f('0x2')]},'description':{'type':Sequelize[_0x319f('0x2')]},'ticketType':{'type':Sequelize[_0x319f('0x3')](_0x319f('0x4'),_0x319f('0x5')),'defaultValue':_0x319f('0x4')},'moduleSearch':{'type':Sequelize[_0x319f('0x3')](_0x319f('0x6'),_0x319f('0x7'),_0x319f('0x8'),'account_contact_lead',_0x319f('0x9')),'defaultValue':_0x319f('0x6')},'moduleCreate':{'type':Sequelize[_0x319f('0x3')](_0x319f('0xa'),_0x319f('0x7'),_0x319f('0x8'),_0x319f('0x9')),'defaultValue':_0x319f('0x8')},'leadId':{'type':Sequelize[_0x319f('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x319f('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x319f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c37b549..4668bbd 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 _0xa1aa=['where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','find','create','body','catch','getFields','findOne','SalesforceField','length','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','end','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort'];(function(_0x5516e8,_0x441d7c){var _0x2fefa4=function(_0x172c32){while(--_0x172c32){_0x5516e8['push'](_0x5516e8['shift']());}};_0x2fefa4(++_0x441d7c);}(_0xa1aa,0x1a1));var _0xaa1a=function(_0x531d03,_0x5de745){_0x531d03=_0x531d03-0x0;var _0x9d832=_0xa1aa[_0x531d03];return _0x9d832;};'use strict';var emlformat=require(_0xaa1a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa1a('0x1'));var jsonpatch=require(_0xaa1a('0x2'));var rp=require(_0xaa1a('0x3'));var moment=require(_0xaa1a('0x4'));var BPromise=require(_0xaa1a('0x5'));var Mustache=require(_0xaa1a('0x6'));var util=require(_0xaa1a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xaa1a('0x8'));var ejs=require(_0xaa1a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa1a('0xa'));var squel=require(_0xaa1a('0xb'));var crypto=require('crypto');var jsforce=require(_0xaa1a('0xc'));var deskjs=require(_0xaa1a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa1a('0xe'));var Papa=require(_0xaa1a('0xf'));var Redis=require('ioredis');var authService=require(_0xaa1a('0x10'));var qs=require(_0xaa1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa1a('0x12'));var logger=require(_0xaa1a('0x13'))(_0xaa1a('0x14'));var utils=require(_0xaa1a('0x15'));var config=require(_0xaa1a('0x16'));var licenseUtil=require(_0xaa1a('0x17'));var db=require(_0xaa1a('0x18'))['db'];function respondWithStatusCode(_0x2eeb99,_0x2e9e34){_0x2e9e34=_0x2e9e34||0xcc;return function(_0x1b15ef){if(_0x1b15ef){return _0x2eeb99[_0xaa1a('0x19')](_0x2e9e34);}return _0x2eeb99[_0xaa1a('0x1a')](_0x2e9e34)['end']();};}function respondWithResult(_0x3fe707,_0x4aee31){_0x4aee31=_0x4aee31||0xc8;return function(_0x156955){if(_0x156955){return _0x3fe707[_0xaa1a('0x1a')](_0x4aee31)[_0xaa1a('0x1b')](_0x156955);}};}function respondWithFilteredResult(_0x68b186,_0xe772fc){return function(_0x14e775){if(_0x14e775){var _0x1e08aa=typeof _0xe772fc[_0xaa1a('0x1c')]===_0xaa1a('0x1d')&&typeof _0xe772fc[_0xaa1a('0x1e')]==='undefined';var _0x2c0fa6=_0x14e775[_0xaa1a('0x1f')];var _0x1aa2f5=_0x1e08aa?0x0:_0xe772fc[_0xaa1a('0x1c')];var _0x10a339=_0x1e08aa?_0x14e775[_0xaa1a('0x1f')]:_0xe772fc[_0xaa1a('0x1c')]+_0xe772fc['limit'];var _0x2222a6;if(_0x10a339>=_0x2c0fa6){_0x10a339=_0x2c0fa6;_0x2222a6=0xc8;}else{_0x2222a6=0xce;}_0x68b186[_0xaa1a('0x1a')](_0x2222a6);return _0x68b186[_0xaa1a('0x20')]('Content-Range',_0x1aa2f5+'-'+_0x10a339+'/'+_0x2c0fa6)['json'](_0x14e775);}return null;};}function patchUpdates(_0xdb1def){return function(_0x6dde4e){try{jsonpatch[_0xaa1a('0x21')](_0x6dde4e,_0xdb1def,!![]);}catch(_0xb13881){return BPromise['reject'](_0xb13881);}return _0x6dde4e['save']();};}function saveUpdates(_0x294020,_0x5d0400){return function(_0xfec897){if(_0xfec897){return _0xfec897[_0xaa1a('0x22')](_0x294020)[_0xaa1a('0x23')](function(_0x5a3f59){return _0x5a3f59;});}return null;};}function removeEntity(_0x20471d,_0x56007e){return function(_0xc13801){if(_0xc13801){return _0xc13801[_0xaa1a('0x24')]()['then'](function(){_0x20471d[_0xaa1a('0x1a')](0xcc)[_0xaa1a('0x25')]();});}};}function handleEntityNotFound(_0x447513,_0x13ac7d){return function(_0x139efa){if(!_0x139efa){_0x447513['sendStatus'](0x194);}return _0x139efa;};}function handleError(_0x44ef1d,_0x5afdfb){_0x5afdfb=_0x5afdfb||0x1f4;return function(_0x4dea4f){logger[_0xaa1a('0x26')](_0x4dea4f[_0xaa1a('0x27')]);if(_0x4dea4f[_0xaa1a('0x28')]){delete _0x4dea4f[_0xaa1a('0x28')];}_0x44ef1d['status'](_0x5afdfb)['send'](_0x4dea4f);};}exports[_0xaa1a('0x29')]=function(_0x47bd41,_0x4893b6){var _0x3a6707={},_0x2584a8={},_0x258258={'count':0x0,'rows':[]};var _0x297c24=_[_0xaa1a('0x2a')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')],function(_0x40a5cc){return{'name':_0x40a5cc[_0xaa1a('0x2d')],'type':_0x40a5cc[_0xaa1a('0x2e')]['key']};});_0x2584a8[_0xaa1a('0x2f')]=_[_0xaa1a('0x2a')](_0x297c24,_0xaa1a('0x28'));_0x2584a8[_0xaa1a('0x30')]=_[_0xaa1a('0x31')](_0x47bd41[_0xaa1a('0x30')]);_0x2584a8[_0xaa1a('0x32')]=_['intersection'](_0x2584a8[_0xaa1a('0x2f')],_0x2584a8[_0xaa1a('0x30')]);_0x3a6707[_0xaa1a('0x33')]=_[_0xaa1a('0x34')](_0x2584a8[_0xaa1a('0x2f')],qs[_0xaa1a('0x35')](_0x47bd41[_0xaa1a('0x30')][_0xaa1a('0x35')]));_0x3a6707['attributes']=_0x3a6707[_0xaa1a('0x33')]['length']?_0x3a6707[_0xaa1a('0x33')]:_0x2584a8[_0xaa1a('0x2f')];if(!_0x47bd41[_0xaa1a('0x30')][_0xaa1a('0x36')]('nolimit')){_0x3a6707['limit']=qs[_0xaa1a('0x1e')](_0x47bd41['query'][_0xaa1a('0x1e')]);_0x3a6707[_0xaa1a('0x1c')]=qs[_0xaa1a('0x1c')](_0x47bd41['query'][_0xaa1a('0x1c')]);}_0x3a6707[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x47bd41[_0xaa1a('0x30')][_0xaa1a('0x38')]);_0x3a6707[_0xaa1a('0x39')]=qs['filters'](_[_0xaa1a('0x3a')](_0x47bd41[_0xaa1a('0x30')],_0x2584a8[_0xaa1a('0x32')]),_0x297c24);if(_0x47bd41[_0xaa1a('0x30')]['filter']){_0x3a6707[_0xaa1a('0x39')]=_[_0xaa1a('0x3b')](_0x3a6707[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x297c24,function(_0x50244b){if(_0x50244b[_0xaa1a('0x2e')]!==_0xaa1a('0x3c')){var _0x3cb97b={};_0x3cb97b[_0x50244b[_0xaa1a('0x28')]]={'$like':'%'+_0x47bd41[_0xaa1a('0x30')][_0xaa1a('0x3d')]+'%'};return _0x3cb97b;}})});}_0x3a6707=_[_0xaa1a('0x3b')]({},_0x3a6707,_0x47bd41['options']);var _0x1e3a74={'where':_0x3a6707['where']};return db[_0xaa1a('0x2b')][_0xaa1a('0x1f')](_0x1e3a74)[_0xaa1a('0x23')](function(_0x2aaa7d){_0x258258['count']=_0x2aaa7d;if(_0x47bd41[_0xaa1a('0x30')][_0xaa1a('0x3e')]){_0x3a6707[_0xaa1a('0x3f')]=[{'all':!![]}];}return db[_0xaa1a('0x2b')][_0xaa1a('0x40')](_0x3a6707);})['then'](function(_0x1d491d){_0x258258[_0xaa1a('0x41')]=_0x1d491d;return _0x258258;})['then'](respondWithFilteredResult(_0x4893b6,_0x3a6707))['catch'](handleError(_0x4893b6,null));};exports['show']=function(_0x51b45d,_0xe8ef42){var _0x165877={'raw':![],'where':{'id':_0x51b45d[_0xaa1a('0x42')]['id']}},_0x3779e6={};_0x3779e6[_0xaa1a('0x2f')]=_[_0xaa1a('0x31')](db[_0xaa1a('0x2b')][_0xaa1a('0x2c')]);_0x3779e6['query']=_['keys'](_0x51b45d['query']);_0x3779e6[_0xaa1a('0x32')]=_[_0xaa1a('0x34')](_0x3779e6['model'],_0x3779e6[_0xaa1a('0x30')]);_0x165877['attributes']=_[_0xaa1a('0x34')](_0x3779e6[_0xaa1a('0x2f')],qs[_0xaa1a('0x35')](_0x51b45d['query']['fields']));_0x165877[_0xaa1a('0x33')]=_0x165877['attributes']['length']?_0x165877[_0xaa1a('0x33')]:_0x3779e6['model'];if(_0x51b45d[_0xaa1a('0x30')][_0xaa1a('0x3e')]){_0x165877[_0xaa1a('0x3f')]=[{'all':!![]}];}_0x165877=_['merge']({},_0x165877,_0x51b45d[_0xaa1a('0x43')]);return db[_0xaa1a('0x2b')][_0xaa1a('0x44')](_0x165877)[_0xaa1a('0x23')](handleEntityNotFound(_0xe8ef42,null))['then'](respondWithResult(_0xe8ef42,null))['catch'](handleError(_0xe8ef42,null));};exports['create']=function(_0x17149c,_0x20078d){return db[_0xaa1a('0x2b')][_0xaa1a('0x45')](_0x17149c[_0xaa1a('0x46')],{})[_0xaa1a('0x23')](respondWithResult(_0x20078d,0xc9))[_0xaa1a('0x47')](handleError(_0x20078d,null));};exports[_0xaa1a('0x22')]=function(_0x50ae2f,_0x4853be){if(_0x50ae2f[_0xaa1a('0x46')]['id']){delete _0x50ae2f[_0xaa1a('0x46')]['id'];}return db[_0xaa1a('0x2b')][_0xaa1a('0x44')]({'where':{'id':_0x50ae2f[_0xaa1a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4853be,null))[_0xaa1a('0x23')](saveUpdates(_0x50ae2f[_0xaa1a('0x46')],null))[_0xaa1a('0x23')](respondWithResult(_0x4853be,null))[_0xaa1a('0x47')](handleError(_0x4853be,null));};exports['destroy']=function(_0x1ccc28,_0x5dfa87){return db[_0xaa1a('0x2b')]['find']({'where':{'id':_0x1ccc28['params']['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x5dfa87,null))['then'](removeEntity(_0x5dfa87,null))[_0xaa1a('0x47')](handleError(_0x5dfa87,null));};exports[_0xaa1a('0x48')]=function(_0x2df132,_0x54ce1c,_0x39857e){var _0x5bbd78={};var _0x1ac09d={};var _0x328db4;var _0xae564a;return db[_0xaa1a('0x2b')][_0xaa1a('0x49')]({'where':{'id':_0x2df132[_0xaa1a('0x42')]['id']}})['then'](handleEntityNotFound(_0x54ce1c,null))[_0xaa1a('0x23')](function(_0x5b8e8c){if(_0x5b8e8c){_0x328db4=_0x5b8e8c;_0x1ac09d[_0xaa1a('0x2f')]=_[_0xaa1a('0x31')](db[_0xaa1a('0x4a')][_0xaa1a('0x2c')]);_0x1ac09d[_0xaa1a('0x30')]=_[_0xaa1a('0x31')](_0x2df132[_0xaa1a('0x30')]);_0x1ac09d[_0xaa1a('0x32')]=_[_0xaa1a('0x34')](_0x1ac09d[_0xaa1a('0x2f')],_0x1ac09d[_0xaa1a('0x30')]);_0x5bbd78['attributes']=_[_0xaa1a('0x34')](_0x1ac09d['model'],qs[_0xaa1a('0x35')](_0x2df132[_0xaa1a('0x30')][_0xaa1a('0x35')]));_0x5bbd78[_0xaa1a('0x33')]=_0x5bbd78[_0xaa1a('0x33')][_0xaa1a('0x4b')]?_0x5bbd78[_0xaa1a('0x33')]:_0x1ac09d[_0xaa1a('0x2f')];_0x5bbd78[_0xaa1a('0x37')]=qs['sort'](_0x2df132[_0xaa1a('0x30')][_0xaa1a('0x38')]);_0x5bbd78[_0xaa1a('0x39')]=qs[_0xaa1a('0x32')](_[_0xaa1a('0x3a')](_0x2df132[_0xaa1a('0x30')],_0x1ac09d['filters']));if(_0x2df132[_0xaa1a('0x30')]['filter']){_0x5bbd78[_0xaa1a('0x39')]=_[_0xaa1a('0x3b')](_0x5bbd78['where'],{'$or':_[_0xaa1a('0x2a')](_0x5bbd78[_0xaa1a('0x33')],function(_0x4ae023){var _0x5a8d0c={};_0x5a8d0c[_0x4ae023]={'$like':'%'+_0x2df132[_0xaa1a('0x30')][_0xaa1a('0x3d')]+'%'};return _0x5a8d0c;})});}_0x5bbd78=_[_0xaa1a('0x3b')]({},_0x5bbd78,_0x2df132[_0xaa1a('0x43')]);return _0x328db4[_0xaa1a('0x48')](_0x5bbd78);}})[_0xaa1a('0x23')](function(_0x2187bf){if(_0x2187bf){_0xae564a=_0x2187bf['length'];if(!_0x2df132[_0xaa1a('0x30')]['hasOwnProperty'](_0xaa1a('0x4c'))){_0x5bbd78[_0xaa1a('0x1e')]=qs[_0xaa1a('0x1e')](_0x2df132[_0xaa1a('0x30')][_0xaa1a('0x1e')]);_0x5bbd78[_0xaa1a('0x1c')]=qs['offset'](_0x2df132[_0xaa1a('0x30')]['offset']);}return _0x328db4['getFields'](_0x5bbd78);}})[_0xaa1a('0x23')](function(_0x338b28){if(_0x338b28){return _0x338b28?{'count':_0xae564a,'rows':_0x338b28}:null;}})[_0xaa1a('0x23')](respondWithResult(_0x54ce1c,null))[_0xaa1a('0x47')](handleError(_0x54ce1c,null));};exports[_0xaa1a('0x4d')]=function(_0x5118b6,_0x58180a,_0x464f8c){var _0x49e3cb={};var _0x490b17={};var _0x31b7e8;var _0x460ccd;return db[_0xaa1a('0x2b')]['findOne']({'where':{'id':_0x5118b6['params']['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x58180a,null))[_0xaa1a('0x23')](function(_0x39b387){if(_0x39b387){_0x31b7e8=_0x39b387;_0x490b17[_0xaa1a('0x2f')]=_[_0xaa1a('0x31')](db[_0xaa1a('0x4a')]['rawAttributes']);_0x490b17[_0xaa1a('0x30')]=_[_0xaa1a('0x31')](_0x5118b6['query']);_0x490b17[_0xaa1a('0x32')]=_[_0xaa1a('0x34')](_0x490b17[_0xaa1a('0x2f')],_0x490b17[_0xaa1a('0x30')]);_0x49e3cb[_0xaa1a('0x33')]=_[_0xaa1a('0x34')](_0x490b17[_0xaa1a('0x2f')],qs[_0xaa1a('0x35')](_0x5118b6[_0xaa1a('0x30')][_0xaa1a('0x35')]));_0x49e3cb['attributes']=_0x49e3cb[_0xaa1a('0x33')][_0xaa1a('0x4b')]?_0x49e3cb['attributes']:_0x490b17[_0xaa1a('0x2f')];_0x49e3cb[_0xaa1a('0x37')]=qs[_0xaa1a('0x38')](_0x5118b6[_0xaa1a('0x30')][_0xaa1a('0x38')]);_0x49e3cb[_0xaa1a('0x39')]=qs[_0xaa1a('0x32')](_['pick'](_0x5118b6[_0xaa1a('0x30')],_0x490b17['filters']));if(_0x5118b6[_0xaa1a('0x30')][_0xaa1a('0x3d')]){_0x49e3cb['where']=_['merge'](_0x49e3cb[_0xaa1a('0x39')],{'$or':_[_0xaa1a('0x2a')](_0x49e3cb[_0xaa1a('0x33')],function(_0x5dcf02){var _0x16721d={};_0x16721d[_0x5dcf02]={'$like':'%'+_0x5118b6[_0xaa1a('0x30')][_0xaa1a('0x3d')]+'%'};return _0x16721d;})});}_0x49e3cb=_['merge']({},_0x49e3cb,_0x5118b6[_0xaa1a('0x43')]);return _0x31b7e8[_0xaa1a('0x4d')](_0x49e3cb);}})[_0xaa1a('0x23')](function(_0x57b406){if(_0x57b406){_0x460ccd=_0x57b406[_0xaa1a('0x4b')];if(!_0x5118b6[_0xaa1a('0x30')][_0xaa1a('0x36')](_0xaa1a('0x4c'))){_0x49e3cb[_0xaa1a('0x1e')]=qs[_0xaa1a('0x1e')](_0x5118b6[_0xaa1a('0x30')][_0xaa1a('0x1e')]);_0x49e3cb[_0xaa1a('0x1c')]=qs['offset'](_0x5118b6[_0xaa1a('0x30')][_0xaa1a('0x1c')]);}return _0x31b7e8['getSubjects'](_0x49e3cb);}})[_0xaa1a('0x23')](function(_0x2d9b73){if(_0x2d9b73){return _0x2d9b73?{'count':_0x460ccd,'rows':_0x2d9b73}:null;}})[_0xaa1a('0x23')](respondWithResult(_0x58180a,null))[_0xaa1a('0x47')](handleError(_0x58180a,null));};exports['getDescriptions']=function(_0x830939,_0x571d84,_0x119fe4){var _0x439aa2={};var _0x2d4e13={};var _0xa32e39;var _0x3ceb5f;return db[_0xaa1a('0x2b')][_0xaa1a('0x49')]({'where':{'id':_0x830939[_0xaa1a('0x42')]['id']}})[_0xaa1a('0x23')](handleEntityNotFound(_0x571d84,null))[_0xaa1a('0x23')](function(_0x91bc67){if(_0x91bc67){_0xa32e39=_0x91bc67;_0x2d4e13['model']=_[_0xaa1a('0x31')](db['SalesforceField'][_0xaa1a('0x2c')]);_0x2d4e13[_0xaa1a('0x30')]=_[_0xaa1a('0x31')](_0x830939['query']);_0x2d4e13[_0xaa1a('0x32')]=_[_0xaa1a('0x34')](_0x2d4e13[_0xaa1a('0x2f')],_0x2d4e13[_0xaa1a('0x30')]);_0x439aa2[_0xaa1a('0x33')]=_['intersection'](_0x2d4e13[_0xaa1a('0x2f')],qs['fields'](_0x830939[_0xaa1a('0x30')]['fields']));_0x439aa2[_0xaa1a('0x33')]=_0x439aa2[_0xaa1a('0x33')]['length']?_0x439aa2[_0xaa1a('0x33')]:_0x2d4e13[_0xaa1a('0x2f')];_0x439aa2['order']=qs[_0xaa1a('0x38')](_0x830939[_0xaa1a('0x30')][_0xaa1a('0x38')]);_0x439aa2['where']=qs['filters'](_[_0xaa1a('0x3a')](_0x830939[_0xaa1a('0x30')],_0x2d4e13[_0xaa1a('0x32')]));if(_0x830939[_0xaa1a('0x30')]['filter']){_0x439aa2[_0xaa1a('0x39')]=_[_0xaa1a('0x3b')](_0x439aa2[_0xaa1a('0x39')],{'$or':_['map'](_0x439aa2[_0xaa1a('0x33')],function(_0x495f51){var _0x472bd6={};_0x472bd6[_0x495f51]={'$like':'%'+_0x830939[_0xaa1a('0x30')][_0xaa1a('0x3d')]+'%'};return _0x472bd6;})});}_0x439aa2=_[_0xaa1a('0x3b')]({},_0x439aa2,_0x830939[_0xaa1a('0x43')]);return _0xa32e39[_0xaa1a('0x4e')](_0x439aa2);}})[_0xaa1a('0x23')](function(_0x134df5){if(_0x134df5){_0x3ceb5f=_0x134df5[_0xaa1a('0x4b')];if(!_0x830939[_0xaa1a('0x30')][_0xaa1a('0x36')]('nolimit')){_0x439aa2['limit']=qs[_0xaa1a('0x1e')](_0x830939[_0xaa1a('0x30')]['limit']);_0x439aa2[_0xaa1a('0x1c')]=qs[_0xaa1a('0x1c')](_0x830939[_0xaa1a('0x30')][_0xaa1a('0x1c')]);}return _0xa32e39[_0xaa1a('0x4e')](_0x439aa2);}})[_0xaa1a('0x23')](function(_0x3a3cbf){if(_0x3a3cbf){return _0x3a3cbf?{'count':_0x3ceb5f,'rows':_0x3a3cbf}:null;}})[_0xaa1a('0x23')](respondWithResult(_0x571d84,null))[_0xaa1a('0x47')](handleError(_0x571d84,null));}; \ No newline at end of file +var _0xd698=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','params','includeAll','include','find','catch','create','body','getFields','SalesforceField','pick','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x41d3e2,_0x69b37){var _0x358d7b=function(_0x2324cf){while(--_0x2324cf){_0x41d3e2['push'](_0x41d3e2['shift']());}};_0x358d7b(++_0x69b37);}(_0xd698,0xe2));var _0x8d69=function(_0x34e9b5,_0x3c0d07){_0x34e9b5=_0x34e9b5-0x0;var _0x531179=_0xd698[_0x34e9b5];return _0x531179;};'use strict';var emlformat=require(_0x8d69('0x0'));var rimraf=require(_0x8d69('0x1'));var zipdir=require(_0x8d69('0x2'));var jsonpatch=require(_0x8d69('0x3'));var rp=require(_0x8d69('0x4'));var moment=require('moment');var BPromise=require(_0x8d69('0x5'));var Mustache=require(_0x8d69('0x6'));var util=require(_0x8d69('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8d69('0x8'));var fs=require('fs');var fs_extra=require(_0x8d69('0x9'));var _=require(_0x8d69('0xa'));var squel=require(_0x8d69('0xb'));var crypto=require(_0x8d69('0xc'));var jsforce=require(_0x8d69('0xd'));var deskjs=require(_0x8d69('0xe'));var toCsv=require(_0x8d69('0xf'));var querystring=require(_0x8d69('0x10'));var Papa=require(_0x8d69('0x11'));var Redis=require(_0x8d69('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8d69('0x13'));var as=require(_0x8d69('0x14'));var hardwareService=require(_0x8d69('0x15'));var logger=require(_0x8d69('0x16'))('api');var utils=require(_0x8d69('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8d69('0x18'));var db=require(_0x8d69('0x19'))['db'];function respondWithStatusCode(_0x36c8ac,_0x40b728){_0x40b728=_0x40b728||0xcc;return function(_0x157936){if(_0x157936){return _0x36c8ac[_0x8d69('0x1a')](_0x40b728);}return _0x36c8ac[_0x8d69('0x1b')](_0x40b728)[_0x8d69('0x1c')]();};}function respondWithResult(_0x54cf67,_0x3d5130){_0x3d5130=_0x3d5130||0xc8;return function(_0x37a57b){if(_0x37a57b){return _0x54cf67['status'](_0x3d5130)['json'](_0x37a57b);}};}function respondWithFilteredResult(_0x2e00c2,_0x477492){return function(_0xc8deee){if(_0xc8deee){var _0x3ce8a5=typeof _0x477492['offset']===_0x8d69('0x1d')&&typeof _0x477492[_0x8d69('0x1e')]===_0x8d69('0x1d');var _0x444d0b=_0xc8deee[_0x8d69('0x1f')];var _0x2784f3=_0x3ce8a5?0x0:_0x477492[_0x8d69('0x20')];var _0x1c93d1=_0x3ce8a5?_0xc8deee[_0x8d69('0x1f')]:_0x477492[_0x8d69('0x20')]+_0x477492[_0x8d69('0x1e')];var _0x300d0d;if(_0x1c93d1>=_0x444d0b){_0x1c93d1=_0x444d0b;_0x300d0d=0xc8;}else{_0x300d0d=0xce;}_0x2e00c2[_0x8d69('0x1b')](_0x300d0d);return _0x2e00c2[_0x8d69('0x21')](_0x8d69('0x22'),_0x2784f3+'-'+_0x1c93d1+'/'+_0x444d0b)[_0x8d69('0x23')](_0xc8deee);}return null;};}function patchUpdates(_0x253292){return function(_0x384c00){try{jsonpatch[_0x8d69('0x24')](_0x384c00,_0x253292,!![]);}catch(_0x35f7ff){return BPromise[_0x8d69('0x25')](_0x35f7ff);}return _0x384c00['save']();};}function saveUpdates(_0x4b633c,_0x3ef50e){return function(_0x42ebca){if(_0x42ebca){return _0x42ebca[_0x8d69('0x26')](_0x4b633c)['then'](function(_0x1308ff){return _0x1308ff;});}return null;};}function removeEntity(_0x1464eb,_0x163e5d){return function(_0x4a911f){if(_0x4a911f){return _0x4a911f[_0x8d69('0x27')]()[_0x8d69('0x28')](function(){_0x1464eb[_0x8d69('0x1b')](0xcc)[_0x8d69('0x1c')]();});}};}function handleEntityNotFound(_0x85a988,_0x542d89){return function(_0x1a39cc){if(!_0x1a39cc){_0x85a988[_0x8d69('0x1a')](0x194);}return _0x1a39cc;};}function handleError(_0x5bd4b7,_0x42f1fc){_0x42f1fc=_0x42f1fc||0x1f4;return function(_0x3d5588){logger[_0x8d69('0x29')](_0x3d5588[_0x8d69('0x2a')]);if(_0x3d5588[_0x8d69('0x2b')]){delete _0x3d5588[_0x8d69('0x2b')];}_0x5bd4b7[_0x8d69('0x1b')](_0x42f1fc)[_0x8d69('0x2c')](_0x3d5588);};}exports[_0x8d69('0x2d')]=function(_0x5e36b3,_0x2202d7){var _0x599ab4={},_0x4e5871={},_0x53de11={'count':0x0,'rows':[]};var _0x9dca31=_['map'](db[_0x8d69('0x2e')][_0x8d69('0x2f')],function(_0x265039){return{'name':_0x265039[_0x8d69('0x30')],'type':_0x265039[_0x8d69('0x31')]['key']};});_0x4e5871['model']=_[_0x8d69('0x32')](_0x9dca31,'name');_0x4e5871['query']=_[_0x8d69('0x33')](_0x5e36b3[_0x8d69('0x34')]);_0x4e5871[_0x8d69('0x35')]=_[_0x8d69('0x36')](_0x4e5871[_0x8d69('0x37')],_0x4e5871['query']);_0x599ab4[_0x8d69('0x38')]=_[_0x8d69('0x36')](_0x4e5871[_0x8d69('0x37')],qs[_0x8d69('0x39')](_0x5e36b3[_0x8d69('0x34')]['fields']));_0x599ab4[_0x8d69('0x38')]=_0x599ab4[_0x8d69('0x38')][_0x8d69('0x3a')]?_0x599ab4['attributes']:_0x4e5871[_0x8d69('0x37')];if(!_0x5e36b3['query'][_0x8d69('0x3b')](_0x8d69('0x3c'))){_0x599ab4[_0x8d69('0x1e')]=qs['limit'](_0x5e36b3[_0x8d69('0x34')][_0x8d69('0x1e')]);_0x599ab4[_0x8d69('0x20')]=qs[_0x8d69('0x20')](_0x5e36b3[_0x8d69('0x34')][_0x8d69('0x20')]);}_0x599ab4[_0x8d69('0x3d')]=qs[_0x8d69('0x3e')](_0x5e36b3['query'][_0x8d69('0x3e')]);_0x599ab4[_0x8d69('0x3f')]=qs['filters'](_['pick'](_0x5e36b3['query'],_0x4e5871[_0x8d69('0x35')]),_0x9dca31);if(_0x5e36b3[_0x8d69('0x34')][_0x8d69('0x40')]){_0x599ab4[_0x8d69('0x3f')]=_[_0x8d69('0x41')](_0x599ab4[_0x8d69('0x3f')],{'$or':_[_0x8d69('0x32')](_0x9dca31,function(_0x50e379){if(_0x50e379['type']!==_0x8d69('0x42')){var _0x38c90e={};_0x38c90e[_0x50e379[_0x8d69('0x2b')]]={'$like':'%'+_0x5e36b3[_0x8d69('0x34')][_0x8d69('0x40')]+'%'};return _0x38c90e;}})});}_0x599ab4=_[_0x8d69('0x41')]({},_0x599ab4,_0x5e36b3[_0x8d69('0x43')]);var _0x103422={'where':_0x599ab4['where']};return db['SalesforceConfiguration'][_0x8d69('0x1f')](_0x103422)[_0x8d69('0x28')](function(_0x37bd91){_0x53de11[_0x8d69('0x1f')]=_0x37bd91;if(_0x5e36b3[_0x8d69('0x34')]['includeAll']){_0x599ab4['include']=[{'all':!![]}];}return db[_0x8d69('0x2e')]['findAll'](_0x599ab4);})[_0x8d69('0x28')](function(_0x1812a7){_0x53de11[_0x8d69('0x44')]=_0x1812a7;return _0x53de11;})[_0x8d69('0x28')](respondWithFilteredResult(_0x2202d7,_0x599ab4))['catch'](handleError(_0x2202d7,null));};exports['show']=function(_0x319160,_0x3fa929){var _0xb84194={'raw':![],'where':{'id':_0x319160[_0x8d69('0x45')]['id']}},_0x100b08={};_0x100b08[_0x8d69('0x37')]=_[_0x8d69('0x33')](db[_0x8d69('0x2e')][_0x8d69('0x2f')]);_0x100b08[_0x8d69('0x34')]=_[_0x8d69('0x33')](_0x319160[_0x8d69('0x34')]);_0x100b08['filters']=_['intersection'](_0x100b08[_0x8d69('0x37')],_0x100b08[_0x8d69('0x34')]);_0xb84194[_0x8d69('0x38')]=_[_0x8d69('0x36')](_0x100b08[_0x8d69('0x37')],qs['fields'](_0x319160[_0x8d69('0x34')]['fields']));_0xb84194[_0x8d69('0x38')]=_0xb84194['attributes'][_0x8d69('0x3a')]?_0xb84194[_0x8d69('0x38')]:_0x100b08[_0x8d69('0x37')];if(_0x319160['query'][_0x8d69('0x46')]){_0xb84194[_0x8d69('0x47')]=[{'all':!![]}];}_0xb84194=_[_0x8d69('0x41')]({},_0xb84194,_0x319160[_0x8d69('0x43')]);return db['SalesforceConfiguration'][_0x8d69('0x48')](_0xb84194)[_0x8d69('0x28')](handleEntityNotFound(_0x3fa929,null))[_0x8d69('0x28')](respondWithResult(_0x3fa929,null))[_0x8d69('0x49')](handleError(_0x3fa929,null));};exports[_0x8d69('0x4a')]=function(_0x46badb,_0xdc15e2){return db[_0x8d69('0x2e')][_0x8d69('0x4a')](_0x46badb['body'],{})['then'](respondWithResult(_0xdc15e2,0xc9))[_0x8d69('0x49')](handleError(_0xdc15e2,null));};exports[_0x8d69('0x26')]=function(_0x467186,_0x131214){if(_0x467186['body']['id']){delete _0x467186[_0x8d69('0x4b')]['id'];}return db['SalesforceConfiguration'][_0x8d69('0x48')]({'where':{'id':_0x467186[_0x8d69('0x45')]['id']}})[_0x8d69('0x28')](handleEntityNotFound(_0x131214,null))[_0x8d69('0x28')](saveUpdates(_0x467186['body'],null))[_0x8d69('0x28')](respondWithResult(_0x131214,null))[_0x8d69('0x49')](handleError(_0x131214,null));};exports[_0x8d69('0x27')]=function(_0x459c19,_0x171c95){return db['SalesforceConfiguration'][_0x8d69('0x48')]({'where':{'id':_0x459c19[_0x8d69('0x45')]['id']}})[_0x8d69('0x28')](handleEntityNotFound(_0x171c95,null))[_0x8d69('0x28')](removeEntity(_0x171c95,null))[_0x8d69('0x49')](handleError(_0x171c95,null));};exports[_0x8d69('0x4c')]=function(_0x1b176c,_0x565d5d,_0x4cc29a){var _0x1a3ea4={};var _0x43cc23={};var _0x1c109c;var _0x356b9f;return db[_0x8d69('0x2e')]['findOne']({'where':{'id':_0x1b176c[_0x8d69('0x45')]['id']}})[_0x8d69('0x28')](handleEntityNotFound(_0x565d5d,null))['then'](function(_0x4b3348){if(_0x4b3348){_0x1c109c=_0x4b3348;_0x43cc23[_0x8d69('0x37')]=_[_0x8d69('0x33')](db[_0x8d69('0x4d')]['rawAttributes']);_0x43cc23[_0x8d69('0x34')]=_[_0x8d69('0x33')](_0x1b176c['query']);_0x43cc23[_0x8d69('0x35')]=_[_0x8d69('0x36')](_0x43cc23[_0x8d69('0x37')],_0x43cc23['query']);_0x1a3ea4[_0x8d69('0x38')]=_[_0x8d69('0x36')](_0x43cc23[_0x8d69('0x37')],qs[_0x8d69('0x39')](_0x1b176c[_0x8d69('0x34')][_0x8d69('0x39')]));_0x1a3ea4['attributes']=_0x1a3ea4[_0x8d69('0x38')][_0x8d69('0x3a')]?_0x1a3ea4['attributes']:_0x43cc23[_0x8d69('0x37')];_0x1a3ea4['order']=qs[_0x8d69('0x3e')](_0x1b176c[_0x8d69('0x34')]['sort']);_0x1a3ea4[_0x8d69('0x3f')]=qs[_0x8d69('0x35')](_[_0x8d69('0x4e')](_0x1b176c[_0x8d69('0x34')],_0x43cc23['filters']));if(_0x1b176c['query']['filter']){_0x1a3ea4[_0x8d69('0x3f')]=_[_0x8d69('0x41')](_0x1a3ea4[_0x8d69('0x3f')],{'$or':_[_0x8d69('0x32')](_0x1a3ea4['attributes'],function(_0x142290){var _0x1b065b={};_0x1b065b[_0x142290]={'$like':'%'+_0x1b176c[_0x8d69('0x34')]['filter']+'%'};return _0x1b065b;})});}_0x1a3ea4=_[_0x8d69('0x41')]({},_0x1a3ea4,_0x1b176c[_0x8d69('0x43')]);return _0x1c109c['getFields'](_0x1a3ea4);}})[_0x8d69('0x28')](function(_0x5e2b56){if(_0x5e2b56){_0x356b9f=_0x5e2b56[_0x8d69('0x3a')];if(!_0x1b176c['query'][_0x8d69('0x3b')](_0x8d69('0x3c'))){_0x1a3ea4[_0x8d69('0x1e')]=qs[_0x8d69('0x1e')](_0x1b176c[_0x8d69('0x34')][_0x8d69('0x1e')]);_0x1a3ea4[_0x8d69('0x20')]=qs[_0x8d69('0x20')](_0x1b176c['query'][_0x8d69('0x20')]);}return _0x1c109c[_0x8d69('0x4c')](_0x1a3ea4);}})[_0x8d69('0x28')](function(_0x42c01d){if(_0x42c01d){return _0x42c01d?{'count':_0x356b9f,'rows':_0x42c01d}:null;}})[_0x8d69('0x28')](respondWithResult(_0x565d5d,null))[_0x8d69('0x49')](handleError(_0x565d5d,null));};exports[_0x8d69('0x4f')]=function(_0x599c2c,_0x580279,_0x3db8b6){var _0x162066={};var _0x192afe={};var _0x4b2597;var _0x548da3;return db[_0x8d69('0x2e')][_0x8d69('0x50')]({'where':{'id':_0x599c2c[_0x8d69('0x45')]['id']}})['then'](handleEntityNotFound(_0x580279,null))['then'](function(_0x3e3025){if(_0x3e3025){_0x4b2597=_0x3e3025;_0x192afe[_0x8d69('0x37')]=_[_0x8d69('0x33')](db[_0x8d69('0x4d')][_0x8d69('0x2f')]);_0x192afe[_0x8d69('0x34')]=_[_0x8d69('0x33')](_0x599c2c[_0x8d69('0x34')]);_0x192afe['filters']=_[_0x8d69('0x36')](_0x192afe[_0x8d69('0x37')],_0x192afe[_0x8d69('0x34')]);_0x162066[_0x8d69('0x38')]=_[_0x8d69('0x36')](_0x192afe[_0x8d69('0x37')],qs['fields'](_0x599c2c[_0x8d69('0x34')][_0x8d69('0x39')]));_0x162066[_0x8d69('0x38')]=_0x162066[_0x8d69('0x38')]['length']?_0x162066[_0x8d69('0x38')]:_0x192afe[_0x8d69('0x37')];_0x162066[_0x8d69('0x3d')]=qs[_0x8d69('0x3e')](_0x599c2c[_0x8d69('0x34')]['sort']);_0x162066[_0x8d69('0x3f')]=qs[_0x8d69('0x35')](_[_0x8d69('0x4e')](_0x599c2c['query'],_0x192afe[_0x8d69('0x35')]));if(_0x599c2c[_0x8d69('0x34')]['filter']){_0x162066[_0x8d69('0x3f')]=_[_0x8d69('0x41')](_0x162066['where'],{'$or':_[_0x8d69('0x32')](_0x162066['attributes'],function(_0x39b30b){var _0x26dbfa={};_0x26dbfa[_0x39b30b]={'$like':'%'+_0x599c2c[_0x8d69('0x34')][_0x8d69('0x40')]+'%'};return _0x26dbfa;})});}_0x162066=_[_0x8d69('0x41')]({},_0x162066,_0x599c2c[_0x8d69('0x43')]);return _0x4b2597[_0x8d69('0x4f')](_0x162066);}})[_0x8d69('0x28')](function(_0x5c1cf2){if(_0x5c1cf2){_0x548da3=_0x5c1cf2[_0x8d69('0x3a')];if(!_0x599c2c[_0x8d69('0x34')]['hasOwnProperty']('nolimit')){_0x162066[_0x8d69('0x1e')]=qs['limit'](_0x599c2c[_0x8d69('0x34')]['limit']);_0x162066[_0x8d69('0x20')]=qs['offset'](_0x599c2c[_0x8d69('0x34')][_0x8d69('0x20')]);}return _0x4b2597[_0x8d69('0x4f')](_0x162066);}})[_0x8d69('0x28')](function(_0x1ab275){if(_0x1ab275){return _0x1ab275?{'count':_0x548da3,'rows':_0x1ab275}:null;}})[_0x8d69('0x28')](respondWithResult(_0x580279,null))[_0x8d69('0x49')](handleError(_0x580279,null));};exports[_0x8d69('0x51')]=function(_0x312df6,_0x45f247,_0x1ad724){var _0x23b9b3={};var _0x362924={};var _0x256dae;var _0x2bfdf1;return db[_0x8d69('0x2e')][_0x8d69('0x50')]({'where':{'id':_0x312df6[_0x8d69('0x45')]['id']}})['then'](handleEntityNotFound(_0x45f247,null))[_0x8d69('0x28')](function(_0x14021f){if(_0x14021f){_0x256dae=_0x14021f;_0x362924[_0x8d69('0x37')]=_['keys'](db[_0x8d69('0x4d')][_0x8d69('0x2f')]);_0x362924[_0x8d69('0x34')]=_[_0x8d69('0x33')](_0x312df6[_0x8d69('0x34')]);_0x362924[_0x8d69('0x35')]=_['intersection'](_0x362924[_0x8d69('0x37')],_0x362924[_0x8d69('0x34')]);_0x23b9b3[_0x8d69('0x38')]=_[_0x8d69('0x36')](_0x362924['model'],qs[_0x8d69('0x39')](_0x312df6['query'][_0x8d69('0x39')]));_0x23b9b3['attributes']=_0x23b9b3['attributes'][_0x8d69('0x3a')]?_0x23b9b3[_0x8d69('0x38')]:_0x362924[_0x8d69('0x37')];_0x23b9b3['order']=qs['sort'](_0x312df6[_0x8d69('0x34')][_0x8d69('0x3e')]);_0x23b9b3[_0x8d69('0x3f')]=qs[_0x8d69('0x35')](_[_0x8d69('0x4e')](_0x312df6[_0x8d69('0x34')],_0x362924[_0x8d69('0x35')]));if(_0x312df6[_0x8d69('0x34')][_0x8d69('0x40')]){_0x23b9b3['where']=_[_0x8d69('0x41')](_0x23b9b3[_0x8d69('0x3f')],{'$or':_[_0x8d69('0x32')](_0x23b9b3[_0x8d69('0x38')],function(_0x35c8fb){var _0x1f3792={};_0x1f3792[_0x35c8fb]={'$like':'%'+_0x312df6['query'][_0x8d69('0x40')]+'%'};return _0x1f3792;})});}_0x23b9b3=_['merge']({},_0x23b9b3,_0x312df6[_0x8d69('0x43')]);return _0x256dae['getDescriptions'](_0x23b9b3);}})[_0x8d69('0x28')](function(_0x431273){if(_0x431273){_0x2bfdf1=_0x431273[_0x8d69('0x3a')];if(!_0x312df6[_0x8d69('0x34')][_0x8d69('0x3b')]('nolimit')){_0x23b9b3[_0x8d69('0x1e')]=qs['limit'](_0x312df6[_0x8d69('0x34')][_0x8d69('0x1e')]);_0x23b9b3[_0x8d69('0x20')]=qs[_0x8d69('0x20')](_0x312df6[_0x8d69('0x34')][_0x8d69('0x20')]);}return _0x256dae[_0x8d69('0x51')](_0x23b9b3);}})[_0x8d69('0x28')](function(_0x49631e){if(_0x49631e){return _0x49631e?{'count':_0x2bfdf1,'rows':_0x49631e}:null;}})['then'](respondWithResult(_0x45f247,null))[_0x8d69('0x49')](handleError(_0x45f247,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 27ea23b..a4cf7ee 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 _0xf61c=['exports','define','SalesforceConfiguration','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x553342,_0x439dc3){var _0xad83da=function(_0x366822){while(--_0x366822){_0x553342['push'](_0x553342['shift']());}};_0xad83da(++_0x439dc3);}(_0xf61c,0xd5));var _0xcf61=function(_0x2b255b,_0xd616ee){_0x2b255b=_0x2b255b-0x0;var _0xe83c9d=_0xf61c[_0x2b255b];return _0xe83c9d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf61('0x0'))('api');var moment=require(_0xcf61('0x1'));var BPromise=require(_0xcf61('0x2'));var rp=require(_0xcf61('0x3'));var fs=require('fs');var path=require(_0xcf61('0x4'));var rimraf=require('rimraf');var config=require(_0xcf61('0x5'));var attributes=require(_0xcf61('0x6'));module[_0xcf61('0x7')]=function(_0x4f9966,_0x5181bf){return _0x4f9966[_0xcf61('0x8')](_0xcf61('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42c0=['rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x488304,_0x5b5b0e){var _0x51f958=function(_0xdc55ce){while(--_0xdc55ce){_0x488304['push'](_0x488304['shift']());}};_0x51f958(++_0x5b5b0e);}(_0x42c0,0x192));var _0x042c=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x42c0[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x042c('0x0'));var util=require(_0x042c('0x1'));var logger=require(_0x042c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x042c('0x3'));var rp=require(_0x042c('0x4'));var fs=require('fs');var path=require(_0x042c('0x5'));var rimraf=require(_0x042c('0x6'));var config=require('../../config/environment');var attributes=require(_0x042c('0x7'));module[_0x042c('0x8')]=function(_0x4c94ec,_0x50ae11){return _0x4c94ec[_0x042c('0x9')](_0x042c('0xa'),attributes,{'tableName':_0x042c('0xb'),'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 16e588d..b858d15 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 _0x2717=['client','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2717,0x70));var _0x7271=function(_0x53b1e6,_0x1edb92){_0x53b1e6=_0x53b1e6-0x0;var _0x477fa4=_0x2717[_0x53b1e6];return _0x477fa4;};'use strict';var _=require('lodash');var util=require(_0x7271('0x0'));var moment=require('moment');var BPromise=require(_0x7271('0x1'));var rs=require(_0x7271('0x2'));var fs=require('fs');var Redis=require(_0x7271('0x3'));var db=require(_0x7271('0x4'))['db'];var utils=require(_0x7271('0x5'));var logger=require(_0x7271('0x6'))(_0x7271('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7271('0x8')][_0x7271('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19e1d7,_0x8e1baf,_0x5de5d5){return new BPromise(function(_0x44dc4c,_0x8bce20){return client['request'](_0x19e1d7,_0x5de5d5)['then'](function(_0x5b2109){logger[_0x7271('0xa')](_0x7271('0xb'),_0x8e1baf,_0x7271('0xc'));logger[_0x7271('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x8e1baf,_0x7271('0xc'),JSON[_0x7271('0xe')](_0x5b2109));if(_0x5b2109['error']){if(_0x5b2109[_0x7271('0xf')][_0x7271('0x10')]===0x1f4){logger[_0x7271('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x8e1baf,_0x5b2109['error'][_0x7271('0x11')]);return _0x8bce20(_0x5b2109[_0x7271('0xf')][_0x7271('0x11')]);}logger['error'](_0x7271('0xb'),_0x8e1baf,_0x5b2109[_0x7271('0xf')][_0x7271('0x11')]);return _0x44dc4c(_0x5b2109[_0x7271('0xf')][_0x7271('0x11')]);}else{logger[_0x7271('0xa')](_0x7271('0xb'),_0x8e1baf,_0x7271('0xc'));_0x44dc4c(_0x5b2109[_0x7271('0x12')][_0x7271('0x11')]);}})[_0x7271('0x13')](function(_0x2ca455){logger[_0x7271('0xf')](_0x7271('0xb'),_0x8e1baf,_0x2ca455);_0x8bce20(_0x2ca455);});});} \ No newline at end of file +var _0x74c0=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x74c0,0x1ee));var _0x074c=function(_0x3cb7c1,_0x1bde10){_0x3cb7c1=_0x3cb7c1-0x0;var _0x3f6ffc=_0x74c0[_0x3cb7c1];return _0x3f6ffc;};'use strict';var _=require(_0x074c('0x0'));var util=require(_0x074c('0x1'));var moment=require(_0x074c('0x2'));var BPromise=require(_0x074c('0x3'));var rs=require(_0x074c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x074c('0x5'))['db'];var utils=require(_0x074c('0x6'));var logger=require(_0x074c('0x7'))('rpc');var config=require(_0x074c('0x8'));var jayson=require(_0x074c('0x9'));var client=jayson['client'][_0x074c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c5d1,_0x69f055,_0x19b1da){return new BPromise(function(_0x3743cf,_0x4753b6){return client['request'](_0x16c5d1,_0x19b1da)[_0x074c('0xb')](function(_0x190fd2){logger[_0x074c('0xc')](_0x074c('0xd'),_0x69f055,_0x074c('0xe'));logger[_0x074c('0xf')](_0x074c('0x10'),_0x69f055,_0x074c('0xe'),JSON[_0x074c('0x11')](_0x190fd2));if(_0x190fd2[_0x074c('0x12')]){if(_0x190fd2[_0x074c('0x12')][_0x074c('0x13')]===0x1f4){logger[_0x074c('0x12')](_0x074c('0xd'),_0x69f055,_0x190fd2[_0x074c('0x12')][_0x074c('0x14')]);return _0x4753b6(_0x190fd2[_0x074c('0x12')]['message']);}logger[_0x074c('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x69f055,_0x190fd2[_0x074c('0x12')]['message']);return _0x3743cf(_0x190fd2[_0x074c('0x12')][_0x074c('0x14')]);}else{logger[_0x074c('0xc')](_0x074c('0xd'),_0x69f055,_0x074c('0xe'));_0x3743cf(_0x190fd2[_0x074c('0x15')][_0x074c('0x14')]);}})['catch'](function(_0x583496){logger[_0x074c('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x69f055,_0x583496);_0x4753b6(_0x583496);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f0a7733..9c22271 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 _0xcb4d=['put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5b7257,_0x3e79ac){var _0x32bc7a=function(_0x1c794d){while(--_0x1c794d){_0x5b7257['push'](_0x5b7257['shift']());}};_0x32bc7a(++_0x3e79ac);}(_0xcb4d,0x12a));var _0xdcb4=function(_0x1c832f,_0x80eeff){_0x1c832f=_0x1c832f-0x0;var _0x11e742=_0xcb4d[_0x1c832f];return _0x11e742;};'use strict';var multer=require(_0xdcb4('0x0'));var util=require(_0xdcb4('0x1'));var path=require(_0xdcb4('0x2'));var timeout=require(_0xdcb4('0x3'));var express=require('express');var router=express[_0xdcb4('0x4')]();var fs_extra=require(_0xdcb4('0x5'));var auth=require(_0xdcb4('0x6'));var interaction=require(_0xdcb4('0x7'));var config=require(_0xdcb4('0x8'));var controller=require(_0xdcb4('0x9'));router[_0xdcb4('0xa')]('/',auth[_0xdcb4('0xb')](),controller[_0xdcb4('0xc')]);router[_0xdcb4('0xa')](_0xdcb4('0xd'),auth[_0xdcb4('0xb')](),controller[_0xdcb4('0xe')]);router[_0xdcb4('0xf')]('/',auth[_0xdcb4('0xb')](),controller[_0xdcb4('0x10')]);router[_0xdcb4('0x11')]('/:id',auth[_0xdcb4('0xb')](),controller[_0xdcb4('0x12')]);router[_0xdcb4('0x13')]('/:id',auth[_0xdcb4('0xb')](),controller[_0xdcb4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xba96=['isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x3ba093,_0x836b9e){var _0x3643a8=function(_0x1d4c41){while(--_0x1d4c41){_0x3ba093['push'](_0x3ba093['shift']());}};_0x3643a8(++_0x836b9e);}(_0xba96,0x180));var _0x6ba9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xba96[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6ba9('0x0'));var util=require(_0x6ba9('0x1'));var path=require(_0x6ba9('0x2'));var timeout=require(_0x6ba9('0x3'));var express=require(_0x6ba9('0x4'));var router=express[_0x6ba9('0x5')]();var fs_extra=require(_0x6ba9('0x6'));var auth=require(_0x6ba9('0x7'));var interaction=require(_0x6ba9('0x8'));var config=require(_0x6ba9('0x9'));var controller=require(_0x6ba9('0xa'));router[_0x6ba9('0xb')]('/',auth[_0x6ba9('0xc')](),controller[_0x6ba9('0xd')]);router[_0x6ba9('0xb')](_0x6ba9('0xe'),auth['isAuthenticated'](),controller[_0x6ba9('0xf')]);router['post']('/',auth[_0x6ba9('0xc')](),controller[_0x6ba9('0x10')]);router[_0x6ba9('0x11')](_0x6ba9('0xe'),auth[_0x6ba9('0xc')](),controller[_0x6ba9('0x12')]);router[_0x6ba9('0x13')](_0x6ba9('0xe'),auth['isAuthenticated'](),controller[_0x6ba9('0x14')]);module[_0x6ba9('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 58977b3..dc22186 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 _0xc0de=['keyValue','picklist','STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x4d7d5c,_0x1a456d){var _0x2c0910=function(_0x11b008){while(--_0x11b008){_0x4d7d5c['push'](_0x4d7d5c['shift']());}};_0x2c0910(++_0x1a456d);}(_0xc0de,0x123));var _0xec0d=function(_0x252ac9,_0x62c320){_0x252ac9=_0x252ac9-0x0;var _0x35f731=_0xc0de[_0x252ac9];return _0x35f731;};'use strict';var Sequelize=require(_0xec0d('0x0'));module['exports']={'type':{'type':Sequelize[_0xec0d('0x1')](_0xec0d('0x2'),_0xec0d('0x3'),_0xec0d('0x4'),_0xec0d('0x5'),_0xec0d('0x6')),'defaultValue':_0xec0d('0x2')},'content':{'type':Sequelize[_0xec0d('0x7')]},'key':{'type':Sequelize[_0xec0d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xec0d('0x2'),_0xec0d('0x3'),_0xec0d('0x4'))},'keyContent':{'type':Sequelize[_0xec0d('0x7')]},'idField':{'type':Sequelize[_0xec0d('0x7')]},'variableName':{'type':Sequelize[_0xec0d('0x7')]}}; \ No newline at end of file +var _0x9ac9=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x4b5f62,_0x4a6c6f){var _0x1e9d3b=function(_0x3436f7){while(--_0x3436f7){_0x4b5f62['push'](_0x4b5f62['shift']());}};_0x1e9d3b(++_0x4a6c6f);}(_0x9ac9,0x115));var _0x99ac=function(_0x26f1a3,_0x53aede){_0x26f1a3=_0x26f1a3-0x0;var _0x387899=_0x9ac9[_0x26f1a3];return _0x387899;};'use strict';var Sequelize=require(_0x99ac('0x0'));module[_0x99ac('0x1')]={'type':{'type':Sequelize[_0x99ac('0x2')](_0x99ac('0x3'),_0x99ac('0x4'),_0x99ac('0x5'),_0x99ac('0x6'),_0x99ac('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x99ac('0x8')]},'key':{'type':Sequelize[_0x99ac('0x8')]},'keyType':{'type':Sequelize[_0x99ac('0x2')](_0x99ac('0x3'),'variable',_0x99ac('0x5'))},'keyContent':{'type':Sequelize[_0x99ac('0x8')]},'idField':{'type':Sequelize[_0x99ac('0x8')]},'variableName':{'type':Sequelize[_0x99ac('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 8bf1345..b853de9 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 _0x1b71=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','reject','save','destroy','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','SalesforceField','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x1b71,0x86));var _0x11b7=function(_0x307f7c,_0x18906b){_0x307f7c=_0x307f7c-0x0;var _0x52d9d5=_0x1b71[_0x307f7c];return _0x52d9d5;};'use strict';var emlformat=require(_0x11b7('0x0'));var rimraf=require(_0x11b7('0x1'));var zipdir=require(_0x11b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11b7('0x3'));var moment=require(_0x11b7('0x4'));var BPromise=require(_0x11b7('0x5'));var Mustache=require(_0x11b7('0x6'));var util=require(_0x11b7('0x7'));var path=require(_0x11b7('0x8'));var sox=require(_0x11b7('0x9'));var csv=require(_0x11b7('0xa'));var ejs=require(_0x11b7('0xb'));var fs=require('fs');var fs_extra=require(_0x11b7('0xc'));var _=require(_0x11b7('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x11b7('0xe'));var deskjs=require(_0x11b7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x11b7('0x10'));var Papa=require(_0x11b7('0x11'));var Redis=require('ioredis');var authService=require(_0x11b7('0x12'));var qs=require(_0x11b7('0x13'));var as=require(_0x11b7('0x14'));var hardwareService=require(_0x11b7('0x15'));var logger=require(_0x11b7('0x16'))(_0x11b7('0x17'));var utils=require(_0x11b7('0x18'));var config=require(_0x11b7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x11b7('0x1a'))['db'];function respondWithStatusCode(_0x3857fd,_0x23db7a){_0x23db7a=_0x23db7a||0xcc;return function(_0x1ecb45){if(_0x1ecb45){return _0x3857fd[_0x11b7('0x1b')](_0x23db7a);}return _0x3857fd['status'](_0x23db7a)['end']();};}function respondWithResult(_0x5bb258,_0x3e46f4){_0x3e46f4=_0x3e46f4||0xc8;return function(_0x1ef719){if(_0x1ef719){return _0x5bb258['status'](_0x3e46f4)[_0x11b7('0x1c')](_0x1ef719);}};}function respondWithFilteredResult(_0x5cb81c,_0x2ab4d5){return function(_0x553a2d){if(_0x553a2d){var _0x44f8b8=typeof _0x2ab4d5[_0x11b7('0x1d')]==='undefined'&&typeof _0x2ab4d5[_0x11b7('0x1e')]===_0x11b7('0x1f');var _0x126827=_0x553a2d[_0x11b7('0x20')];var _0x29de74=_0x44f8b8?0x0:_0x2ab4d5[_0x11b7('0x1d')];var _0x4ef420=_0x44f8b8?_0x553a2d[_0x11b7('0x20')]:_0x2ab4d5[_0x11b7('0x1d')]+_0x2ab4d5[_0x11b7('0x1e')];var _0x289c4f;if(_0x4ef420>=_0x126827){_0x4ef420=_0x126827;_0x289c4f=0xc8;}else{_0x289c4f=0xce;}_0x5cb81c[_0x11b7('0x21')](_0x289c4f);return _0x5cb81c['set']('Content-Range',_0x29de74+'-'+_0x4ef420+'/'+_0x126827)['json'](_0x553a2d);}return null;};}function patchUpdates(_0x2b6eda){return function(_0x1d88ed){try{jsonpatch['apply'](_0x1d88ed,_0x2b6eda,!![]);}catch(_0x4f9920){return BPromise[_0x11b7('0x22')](_0x4f9920);}return _0x1d88ed[_0x11b7('0x23')]();};}function saveUpdates(_0x7f30ec,_0x14c92f){return function(_0x59d7ef){if(_0x59d7ef){return _0x59d7ef['update'](_0x7f30ec)['then'](function(_0x1f7491){return _0x1f7491;});}return null;};}function removeEntity(_0x370d79,_0x5657d9){return function(_0x6d34d4){if(_0x6d34d4){return _0x6d34d4[_0x11b7('0x24')]()[_0x11b7('0x25')](function(){_0x370d79[_0x11b7('0x21')](0xcc)[_0x11b7('0x26')]();});}};}function handleEntityNotFound(_0x27f7db,_0x234728){return function(_0x32bb68){if(!_0x32bb68){_0x27f7db[_0x11b7('0x1b')](0x194);}return _0x32bb68;};}function handleError(_0x5ab054,_0x479380){_0x479380=_0x479380||0x1f4;return function(_0x4626de){logger[_0x11b7('0x27')](_0x4626de[_0x11b7('0x28')]);if(_0x4626de[_0x11b7('0x29')]){delete _0x4626de[_0x11b7('0x29')];}_0x5ab054['status'](_0x479380)['send'](_0x4626de);};}exports[_0x11b7('0x2a')]=function(_0x14fcae,_0x1650f2){var _0x3acfd0={},_0x24b4ad={},_0x4c4e13={'count':0x0,'rows':[]};var _0x1283e1=_[_0x11b7('0x2b')](db['SalesforceField'][_0x11b7('0x2c')],function(_0x114acc){return{'name':_0x114acc[_0x11b7('0x2d')],'type':_0x114acc[_0x11b7('0x2e')]['key']};});_0x24b4ad['model']=_[_0x11b7('0x2b')](_0x1283e1,'name');_0x24b4ad[_0x11b7('0x2f')]=_[_0x11b7('0x30')](_0x14fcae[_0x11b7('0x2f')]);_0x24b4ad[_0x11b7('0x31')]=_[_0x11b7('0x32')](_0x24b4ad[_0x11b7('0x33')],_0x24b4ad['query']);_0x3acfd0[_0x11b7('0x34')]=_[_0x11b7('0x32')](_0x24b4ad[_0x11b7('0x33')],qs[_0x11b7('0x35')](_0x14fcae[_0x11b7('0x2f')][_0x11b7('0x35')]));_0x3acfd0[_0x11b7('0x34')]=_0x3acfd0[_0x11b7('0x34')][_0x11b7('0x36')]?_0x3acfd0[_0x11b7('0x34')]:_0x24b4ad[_0x11b7('0x33')];if(!_0x14fcae[_0x11b7('0x2f')][_0x11b7('0x37')]('nolimit')){_0x3acfd0[_0x11b7('0x1e')]=qs[_0x11b7('0x1e')](_0x14fcae[_0x11b7('0x2f')][_0x11b7('0x1e')]);_0x3acfd0['offset']=qs[_0x11b7('0x1d')](_0x14fcae[_0x11b7('0x2f')]['offset']);}_0x3acfd0[_0x11b7('0x38')]=qs[_0x11b7('0x39')](_0x14fcae[_0x11b7('0x2f')]['sort']);_0x3acfd0[_0x11b7('0x3a')]=qs[_0x11b7('0x31')](_[_0x11b7('0x3b')](_0x14fcae[_0x11b7('0x2f')],_0x24b4ad[_0x11b7('0x31')]),_0x1283e1);if(_0x14fcae['query'][_0x11b7('0x3c')]){_0x3acfd0[_0x11b7('0x3a')]=_[_0x11b7('0x3d')](_0x3acfd0[_0x11b7('0x3a')],{'$or':_['map'](_0x1283e1,function(_0x377ec4){if(_0x377ec4['type']!=='VIRTUAL'){var _0x1e88a6={};_0x1e88a6[_0x377ec4[_0x11b7('0x29')]]={'$like':'%'+_0x14fcae[_0x11b7('0x2f')][_0x11b7('0x3c')]+'%'};return _0x1e88a6;}})});}_0x3acfd0=_[_0x11b7('0x3d')]({},_0x3acfd0,_0x14fcae[_0x11b7('0x3e')]);var _0x3d3769={'where':_0x3acfd0['where']};return db[_0x11b7('0x3f')][_0x11b7('0x20')](_0x3d3769)[_0x11b7('0x25')](function(_0x35015f){_0x4c4e13['count']=_0x35015f;if(_0x14fcae[_0x11b7('0x2f')][_0x11b7('0x40')]){_0x3acfd0[_0x11b7('0x41')]=[{'all':!![]}];}return db[_0x11b7('0x3f')][_0x11b7('0x42')](_0x3acfd0);})[_0x11b7('0x25')](function(_0x59fa57){_0x4c4e13[_0x11b7('0x43')]=_0x59fa57;return _0x4c4e13;})[_0x11b7('0x25')](respondWithFilteredResult(_0x1650f2,_0x3acfd0))['catch'](handleError(_0x1650f2,null));};exports[_0x11b7('0x44')]=function(_0x53583c,_0x3dbcd4){var _0x307a6f={'raw':!![],'where':{'id':_0x53583c[_0x11b7('0x45')]['id']}},_0x3312dd={};_0x3312dd[_0x11b7('0x33')]=_[_0x11b7('0x30')](db[_0x11b7('0x3f')][_0x11b7('0x2c')]);_0x3312dd[_0x11b7('0x2f')]=_['keys'](_0x53583c[_0x11b7('0x2f')]);_0x3312dd[_0x11b7('0x31')]=_[_0x11b7('0x32')](_0x3312dd[_0x11b7('0x33')],_0x3312dd[_0x11b7('0x2f')]);_0x307a6f[_0x11b7('0x34')]=_[_0x11b7('0x32')](_0x3312dd[_0x11b7('0x33')],qs[_0x11b7('0x35')](_0x53583c[_0x11b7('0x2f')][_0x11b7('0x35')]));_0x307a6f[_0x11b7('0x34')]=_0x307a6f[_0x11b7('0x34')][_0x11b7('0x36')]?_0x307a6f['attributes']:_0x3312dd[_0x11b7('0x33')];if(_0x53583c[_0x11b7('0x2f')][_0x11b7('0x40')]){_0x307a6f[_0x11b7('0x41')]=[{'all':!![]}];}_0x307a6f=_[_0x11b7('0x3d')]({},_0x307a6f,_0x53583c['options']);return db[_0x11b7('0x3f')]['find'](_0x307a6f)[_0x11b7('0x25')](handleEntityNotFound(_0x3dbcd4,null))[_0x11b7('0x25')](respondWithResult(_0x3dbcd4,null))[_0x11b7('0x46')](handleError(_0x3dbcd4,null));};exports[_0x11b7('0x47')]=function(_0x427504,_0x501a1c){return db[_0x11b7('0x3f')]['create'](_0x427504[_0x11b7('0x48')],{})[_0x11b7('0x25')](respondWithResult(_0x501a1c,0xc9))[_0x11b7('0x46')](handleError(_0x501a1c,null));};exports['update']=function(_0x3fe62d,_0x343da5){if(_0x3fe62d['body']['id']){delete _0x3fe62d[_0x11b7('0x48')]['id'];}return db[_0x11b7('0x3f')][_0x11b7('0x49')]({'where':{'id':_0x3fe62d[_0x11b7('0x45')]['id']}})[_0x11b7('0x25')](handleEntityNotFound(_0x343da5,null))[_0x11b7('0x25')](saveUpdates(_0x3fe62d[_0x11b7('0x48')],null))[_0x11b7('0x25')](respondWithResult(_0x343da5,null))[_0x11b7('0x46')](handleError(_0x343da5,null));};exports[_0x11b7('0x24')]=function(_0x20124e,_0x3d4cd0){return db[_0x11b7('0x3f')]['find']({'where':{'id':_0x20124e['params']['id']}})[_0x11b7('0x25')](handleEntityNotFound(_0x3d4cd0,null))[_0x11b7('0x25')](removeEntity(_0x3d4cd0,null))[_0x11b7('0x46')](handleError(_0x3d4cd0,null));}; \ No newline at end of file +var _0x198e=['../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','SalesforceField','includeAll','findAll','rows','options','create','body','catch','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0xd4c47b,_0x596756){var _0x2114f6=function(_0x4f5edf){while(--_0x4f5edf){_0xd4c47b['push'](_0xd4c47b['shift']());}};_0x2114f6(++_0x596756);}(_0x198e,0x79));var _0xe198=function(_0x24b20f,_0x38d0aa){_0x24b20f=_0x24b20f-0x0;var _0x52ce92=_0x198e[_0x24b20f];return _0x52ce92;};'use strict';var emlformat=require(_0xe198('0x0'));var rimraf=require(_0xe198('0x1'));var zipdir=require(_0xe198('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe198('0x3'));var moment=require(_0xe198('0x4'));var BPromise=require(_0xe198('0x5'));var Mustache=require(_0xe198('0x6'));var util=require(_0xe198('0x7'));var path=require(_0xe198('0x8'));var sox=require(_0xe198('0x9'));var csv=require(_0xe198('0xa'));var ejs=require(_0xe198('0xb'));var fs=require('fs');var fs_extra=require(_0xe198('0xc'));var _=require(_0xe198('0xd'));var squel=require('squel');var crypto=require(_0xe198('0xe'));var jsforce=require(_0xe198('0xf'));var deskjs=require(_0xe198('0x10'));var toCsv=require(_0xe198('0xa'));var querystring=require(_0xe198('0x11'));var Papa=require(_0xe198('0x12'));var Redis=require(_0xe198('0x13'));var authService=require(_0xe198('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe198('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe198('0x16'))(_0xe198('0x17'));var utils=require('../../config/utils');var config=require(_0xe198('0x18'));var licenseUtil=require(_0xe198('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x525ab5,_0x53bfc5){_0x53bfc5=_0x53bfc5||0xcc;return function(_0x18b0f5){if(_0x18b0f5){return _0x525ab5[_0xe198('0x1a')](_0x53bfc5);}return _0x525ab5['status'](_0x53bfc5)[_0xe198('0x1b')]();};}function respondWithResult(_0x1df26d,_0x53be82){_0x53be82=_0x53be82||0xc8;return function(_0x5307a9){if(_0x5307a9){return _0x1df26d[_0xe198('0x1c')](_0x53be82)['json'](_0x5307a9);}};}function respondWithFilteredResult(_0x1594ec,_0x3428b8){return function(_0x57fdda){if(_0x57fdda){var _0x37c4e9=typeof _0x3428b8[_0xe198('0x1d')]===_0xe198('0x1e')&&typeof _0x3428b8[_0xe198('0x1f')]===_0xe198('0x1e');var _0xf4f94a=_0x57fdda[_0xe198('0x20')];var _0x55a936=_0x37c4e9?0x0:_0x3428b8[_0xe198('0x1d')];var _0xf8017f=_0x37c4e9?_0x57fdda[_0xe198('0x20')]:_0x3428b8[_0xe198('0x1d')]+_0x3428b8[_0xe198('0x1f')];var _0x10d5ac;if(_0xf8017f>=_0xf4f94a){_0xf8017f=_0xf4f94a;_0x10d5ac=0xc8;}else{_0x10d5ac=0xce;}_0x1594ec[_0xe198('0x1c')](_0x10d5ac);return _0x1594ec['set'](_0xe198('0x21'),_0x55a936+'-'+_0xf8017f+'/'+_0xf4f94a)[_0xe198('0x22')](_0x57fdda);}return null;};}function patchUpdates(_0x164df6){return function(_0x1799c9){try{jsonpatch[_0xe198('0x23')](_0x1799c9,_0x164df6,!![]);}catch(_0x86baab){return BPromise['reject'](_0x86baab);}return _0x1799c9[_0xe198('0x24')]();};}function saveUpdates(_0x1e7373,_0x599729){return function(_0x1f2f34){if(_0x1f2f34){return _0x1f2f34[_0xe198('0x25')](_0x1e7373)[_0xe198('0x26')](function(_0x48f4d8){return _0x48f4d8;});}return null;};}function removeEntity(_0x3d0c61,_0x57425f){return function(_0x3537bb){if(_0x3537bb){return _0x3537bb[_0xe198('0x27')]()[_0xe198('0x26')](function(){_0x3d0c61[_0xe198('0x1c')](0xcc)[_0xe198('0x1b')]();});}};}function handleEntityNotFound(_0x470d59,_0x19f2cb){return function(_0x3f3542){if(!_0x3f3542){_0x470d59[_0xe198('0x1a')](0x194);}return _0x3f3542;};}function handleError(_0x20c08,_0x2ae233){_0x2ae233=_0x2ae233||0x1f4;return function(_0x4a580b){logger[_0xe198('0x28')](_0x4a580b[_0xe198('0x29')]);if(_0x4a580b[_0xe198('0x2a')]){delete _0x4a580b[_0xe198('0x2a')];}_0x20c08[_0xe198('0x1c')](_0x2ae233)[_0xe198('0x2b')](_0x4a580b);};}exports['index']=function(_0x19fd14,_0x3998fc){var _0x206c58={},_0x4e8dcc={},_0x48a147={'count':0x0,'rows':[]};var _0x30d174=_[_0xe198('0x2c')](db['SalesforceField'][_0xe198('0x2d')],function(_0x37ce14){return{'name':_0x37ce14[_0xe198('0x2e')],'type':_0x37ce14[_0xe198('0x2f')][_0xe198('0x30')]};});_0x4e8dcc[_0xe198('0x31')]=_[_0xe198('0x2c')](_0x30d174,_0xe198('0x2a'));_0x4e8dcc[_0xe198('0x32')]=_[_0xe198('0x33')](_0x19fd14[_0xe198('0x32')]);_0x4e8dcc['filters']=_[_0xe198('0x34')](_0x4e8dcc[_0xe198('0x31')],_0x4e8dcc[_0xe198('0x32')]);_0x206c58['attributes']=_['intersection'](_0x4e8dcc[_0xe198('0x31')],qs[_0xe198('0x35')](_0x19fd14[_0xe198('0x32')][_0xe198('0x35')]));_0x206c58[_0xe198('0x36')]=_0x206c58[_0xe198('0x36')]['length']?_0x206c58[_0xe198('0x36')]:_0x4e8dcc['model'];if(!_0x19fd14[_0xe198('0x32')][_0xe198('0x37')](_0xe198('0x38'))){_0x206c58['limit']=qs[_0xe198('0x1f')](_0x19fd14[_0xe198('0x32')][_0xe198('0x1f')]);_0x206c58[_0xe198('0x1d')]=qs[_0xe198('0x1d')](_0x19fd14[_0xe198('0x32')]['offset']);}_0x206c58[_0xe198('0x39')]=qs[_0xe198('0x3a')](_0x19fd14[_0xe198('0x32')][_0xe198('0x3a')]);_0x206c58[_0xe198('0x3b')]=qs[_0xe198('0x3c')](_['pick'](_0x19fd14['query'],_0x4e8dcc[_0xe198('0x3c')]),_0x30d174);if(_0x19fd14[_0xe198('0x32')]['filter']){_0x206c58[_0xe198('0x3b')]=_[_0xe198('0x3d')](_0x206c58['where'],{'$or':_[_0xe198('0x2c')](_0x30d174,function(_0x5cb74d){if(_0x5cb74d[_0xe198('0x2f')]!==_0xe198('0x3e')){var _0xf81df5={};_0xf81df5[_0x5cb74d[_0xe198('0x2a')]]={'$like':'%'+_0x19fd14[_0xe198('0x32')]['filter']+'%'};return _0xf81df5;}})});}_0x206c58=_[_0xe198('0x3d')]({},_0x206c58,_0x19fd14['options']);var _0x2ec9dc={'where':_0x206c58[_0xe198('0x3b')]};return db[_0xe198('0x3f')][_0xe198('0x20')](_0x2ec9dc)['then'](function(_0x232b1c){_0x48a147[_0xe198('0x20')]=_0x232b1c;if(_0x19fd14['query'][_0xe198('0x40')]){_0x206c58['include']=[{'all':!![]}];}return db['SalesforceField'][_0xe198('0x41')](_0x206c58);})['then'](function(_0x287f16){_0x48a147[_0xe198('0x42')]=_0x287f16;return _0x48a147;})['then'](respondWithFilteredResult(_0x3998fc,_0x206c58))['catch'](handleError(_0x3998fc,null));};exports['show']=function(_0x26ef83,_0x17003c){var _0x5f5515={'raw':!![],'where':{'id':_0x26ef83['params']['id']}},_0x3b94bc={};_0x3b94bc[_0xe198('0x31')]=_['keys'](db[_0xe198('0x3f')][_0xe198('0x2d')]);_0x3b94bc[_0xe198('0x32')]=_[_0xe198('0x33')](_0x26ef83[_0xe198('0x32')]);_0x3b94bc[_0xe198('0x3c')]=_['intersection'](_0x3b94bc['model'],_0x3b94bc[_0xe198('0x32')]);_0x5f5515['attributes']=_[_0xe198('0x34')](_0x3b94bc['model'],qs[_0xe198('0x35')](_0x26ef83[_0xe198('0x32')]['fields']));_0x5f5515[_0xe198('0x36')]=_0x5f5515[_0xe198('0x36')]['length']?_0x5f5515['attributes']:_0x3b94bc[_0xe198('0x31')];if(_0x26ef83[_0xe198('0x32')]['includeAll']){_0x5f5515['include']=[{'all':!![]}];}_0x5f5515=_[_0xe198('0x3d')]({},_0x5f5515,_0x26ef83[_0xe198('0x43')]);return db['SalesforceField']['find'](_0x5f5515)[_0xe198('0x26')](handleEntityNotFound(_0x17003c,null))[_0xe198('0x26')](respondWithResult(_0x17003c,null))['catch'](handleError(_0x17003c,null));};exports[_0xe198('0x44')]=function(_0x48fbe7,_0x1d9c71){return db[_0xe198('0x3f')][_0xe198('0x44')](_0x48fbe7[_0xe198('0x45')],{})['then'](respondWithResult(_0x1d9c71,0xc9))[_0xe198('0x46')](handleError(_0x1d9c71,null));};exports['update']=function(_0x31a642,_0x3b6773){if(_0x31a642[_0xe198('0x45')]['id']){delete _0x31a642[_0xe198('0x45')]['id'];}return db['SalesforceField'][_0xe198('0x47')]({'where':{'id':_0x31a642[_0xe198('0x48')]['id']}})[_0xe198('0x26')](handleEntityNotFound(_0x3b6773,null))[_0xe198('0x26')](saveUpdates(_0x31a642['body'],null))['then'](respondWithResult(_0x3b6773,null))[_0xe198('0x46')](handleError(_0x3b6773,null));};exports[_0xe198('0x27')]=function(_0x3fca94,_0x4a81b6){return db[_0xe198('0x3f')][_0xe198('0x47')]({'where':{'id':_0x3fca94['params']['id']}})['then'](handleEntityNotFound(_0x4a81b6,null))['then'](removeEntity(_0x4a81b6,null))[_0xe198('0x46')](handleError(_0x4a81b6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 3b21bcc..741209c 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 _0xa9a6=['int_salesforce_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','define','SalesforceField'];(function(_0x3b6f53,_0x52e2b5){var _0x5e0755=function(_0x15d50e){while(--_0x15d50e){_0x3b6f53['push'](_0x3b6f53['shift']());}};_0x5e0755(++_0x52e2b5);}(_0xa9a6,0x1d1));var _0x6a9a=function(_0x38ea4c,_0x2e2a44){_0x38ea4c=_0x38ea4c-0x0;var _0x4b6ec9=_0xa9a6[_0x38ea4c];return _0x4b6ec9;};'use strict';var _=require('lodash');var util=require(_0x6a9a('0x0'));var logger=require(_0x6a9a('0x1'))(_0x6a9a('0x2'));var moment=require(_0x6a9a('0x3'));var BPromise=require(_0x6a9a('0x4'));var rp=require(_0x6a9a('0x5'));var fs=require('fs');var path=require(_0x6a9a('0x6'));var rimraf=require(_0x6a9a('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a9a('0x8'));module['exports']=function(_0x554e65,_0x480783){return _0x554e65[_0x6a9a('0x9')](_0x6a9a('0xa'),attributes,{'tableName':_0x6a9a('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x6a9a('0xc'),_0x6a9a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa829=['../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa829,0x157));var _0x9a82=function(_0x1f169d,_0x1b918e){_0x1f169d=_0x1f169d-0x0;var _0x30fefe=_0xa829[_0x1f169d];return _0x30fefe;};'use strict';var _=require(_0x9a82('0x0'));var util=require('util');var logger=require(_0x9a82('0x1'))(_0x9a82('0x2'));var moment=require(_0x9a82('0x3'));var BPromise=require(_0x9a82('0x4'));var rp=require(_0x9a82('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a82('0x6'));var config=require(_0x9a82('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x9a82('0x8')]=function(_0x5467b2,_0x1aaeb2){return _0x5467b2[_0x9a82('0x9')](_0x9a82('0xa'),attributes,{'tableName':_0x9a82('0xb'),'paranoid':![],'indexes':[{'name':_0x9a82('0xc'),'fields':['idField',_0x9a82('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index e268d36..b6dc026 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 _0x6a1b=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6a1b,0xa8));var _0xb6a1=function(_0x856d38,_0x5cadf8){_0x856d38=_0x856d38-0x0;var _0x251696=_0x6a1b[_0x856d38];return _0x251696;};'use strict';var _=require(_0xb6a1('0x0'));var util=require(_0xb6a1('0x1'));var moment=require('moment');var BPromise=require(_0xb6a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6a1('0x3'));var db=require(_0xb6a1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6a1('0x5'))(_0xb6a1('0x6'));var config=require(_0xb6a1('0x7'));var jayson=require(_0xb6a1('0x8'));var client=jayson[_0xb6a1('0x9')][_0xb6a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286b0f,_0x2399ca,_0x404e3e){return new BPromise(function(_0x194d5f,_0x8ad35a){return client[_0xb6a1('0xb')](_0x286b0f,_0x404e3e)['then'](function(_0xb3d539){logger[_0xb6a1('0xc')](_0xb6a1('0xd'),_0x2399ca,_0xb6a1('0xe'));logger[_0xb6a1('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2399ca,_0xb6a1('0xe'),JSON['stringify'](_0xb3d539));if(_0xb3d539[_0xb6a1('0x10')]){if(_0xb3d539[_0xb6a1('0x10')][_0xb6a1('0x11')]===0x1f4){logger[_0xb6a1('0x10')](_0xb6a1('0xd'),_0x2399ca,_0xb3d539[_0xb6a1('0x10')][_0xb6a1('0x12')]);return _0x8ad35a(_0xb3d539[_0xb6a1('0x10')][_0xb6a1('0x12')]);}logger[_0xb6a1('0x10')]('SalesforceField,\x20%s,\x20%s',_0x2399ca,_0xb3d539[_0xb6a1('0x10')]['message']);return _0x194d5f(_0xb3d539[_0xb6a1('0x10')][_0xb6a1('0x12')]);}else{logger[_0xb6a1('0xc')](_0xb6a1('0xd'),_0x2399ca,'request\x20sent');_0x194d5f(_0xb3d539[_0xb6a1('0x13')]['message']);}})['catch'](function(_0x5dc69b){logger['error'](_0xb6a1('0xd'),_0x2399ca,_0x5dc69b);_0x8ad35a(_0x5dc69b);});});} \ No newline at end of file +var _0x716c=['request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client'];(function(_0x7eee32,_0x582ddc){var _0x4b8ef7=function(_0x788b43){while(--_0x788b43){_0x7eee32['push'](_0x7eee32['shift']());}};_0x4b8ef7(++_0x582ddc);}(_0x716c,0xab));var _0xc716=function(_0x3262a8,_0x514236){_0x3262a8=_0x3262a8-0x0;var _0x5f422c=_0x716c[_0x3262a8];return _0x5f422c;};'use strict';var _=require(_0xc716('0x0'));var util=require(_0xc716('0x1'));var moment=require(_0xc716('0x2'));var BPromise=require(_0xc716('0x3'));var rs=require(_0xc716('0x4'));var fs=require('fs');var Redis=require(_0xc716('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc716('0x6'));var logger=require(_0xc716('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc716('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x173ee2,_0xf46d05,_0x545281){return new BPromise(function(_0x337670,_0x1b7451){return client[_0xc716('0x9')](_0x173ee2,_0x545281)[_0xc716('0xa')](function(_0x116637){logger['info'](_0xc716('0xb'),_0xf46d05,_0xc716('0xc'));logger[_0xc716('0xd')](_0xc716('0xe'),_0xf46d05,_0xc716('0xc'),JSON[_0xc716('0xf')](_0x116637));if(_0x116637[_0xc716('0x10')]){if(_0x116637[_0xc716('0x10')]['code']===0x1f4){logger[_0xc716('0x10')](_0xc716('0xb'),_0xf46d05,_0x116637[_0xc716('0x10')][_0xc716('0x11')]);return _0x1b7451(_0x116637[_0xc716('0x10')][_0xc716('0x11')]);}logger[_0xc716('0x10')](_0xc716('0xb'),_0xf46d05,_0x116637[_0xc716('0x10')][_0xc716('0x11')]);return _0x337670(_0x116637['error']['message']);}else{logger[_0xc716('0x12')](_0xc716('0xb'),_0xf46d05,_0xc716('0xc'));_0x337670(_0x116637[_0xc716('0x13')][_0xc716('0x11')]);}})['catch'](function(_0x358af8){logger[_0xc716('0x10')](_0xc716('0xb'),_0xf46d05,_0x358af8);_0x1b7451(_0x358af8);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 78a6578..4df24ae 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 _0x705f=['destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update'];(function(_0x275045,_0x2f5d5b){var _0x2021c4=function(_0x56a813){while(--_0x56a813){_0x275045['push'](_0x275045['shift']());}};_0x2021c4(++_0x2f5d5b);}(_0x705f,0x75));var _0xf705=function(_0x285b48,_0x41b4c6){_0x285b48=_0x285b48-0x0;var _0x5020e9=_0x705f[_0x285b48];return _0x5020e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf705('0x0'));var timeout=require('connect-timeout');var express=require(_0xf705('0x1'));var router=express[_0xf705('0x2')]();var fs_extra=require(_0xf705('0x3'));var auth=require(_0xf705('0x4'));var interaction=require(_0xf705('0x5'));var config=require(_0xf705('0x6'));var controller=require(_0xf705('0x7'));router[_0xf705('0x8')]('/',auth[_0xf705('0x9')](),controller[_0xf705('0xa')]);router[_0xf705('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf705('0xb')]);router['get'](_0xf705('0xc'),auth[_0xf705('0x9')](),controller['getConfigurations']);router['get'](_0xf705('0xd'),auth[_0xf705('0x9')](),controller[_0xf705('0xe')]);router[_0xf705('0xf')]('/',auth[_0xf705('0x9')](),controller[_0xf705('0x10')]);router[_0xf705('0xf')](_0xf705('0xc'),auth['isAuthenticated'](),controller[_0xf705('0x11')]);router[_0xf705('0x12')](_0xf705('0x13'),auth[_0xf705('0x9')](),controller[_0xf705('0x14')]);router['delete']('/:id',auth[_0xf705('0x9')](),controller[_0xf705('0x15')]);module[_0xf705('0x16')]=router; \ No newline at end of file +var _0xe5cd=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x2a99f1,_0x198fd7){var _0x6948e5=function(_0x2ae413){while(--_0x2ae413){_0x2a99f1['push'](_0x2a99f1['shift']());}};_0x6948e5(++_0x198fd7);}(_0xe5cd,0xa5));var _0xde5c=function(_0x52ab89,_0x58a774){_0x52ab89=_0x52ab89-0x0;var _0x5e689d=_0xe5cd[_0x52ab89];return _0x5e689d;};'use strict';var multer=require(_0xde5c('0x0'));var util=require('util');var path=require(_0xde5c('0x1'));var timeout=require(_0xde5c('0x2'));var express=require(_0xde5c('0x3'));var router=express['Router']();var fs_extra=require(_0xde5c('0x4'));var auth=require(_0xde5c('0x5'));var interaction=require(_0xde5c('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xde5c('0x7')]('/',auth[_0xde5c('0x8')](),controller[_0xde5c('0x9')]);router[_0xde5c('0x7')](_0xde5c('0xa'),auth['isAuthenticated'](),controller[_0xde5c('0xb')]);router[_0xde5c('0x7')](_0xde5c('0xc'),auth[_0xde5c('0x8')](),controller[_0xde5c('0xd')]);router['get'](_0xde5c('0xe'),auth[_0xde5c('0x8')](),controller[_0xde5c('0xf')]);router[_0xde5c('0x10')]('/',auth[_0xde5c('0x8')](),controller[_0xde5c('0x11')]);router[_0xde5c('0x10')](_0xde5c('0xc'),auth['isAuthenticated'](),controller[_0xde5c('0x12')]);router[_0xde5c('0x13')](_0xde5c('0xa'),auth['isAuthenticated'](),controller[_0xde5c('0x14')]);router[_0xde5c('0x15')](_0xde5c('0xa'),auth[_0xde5c('0x8')](),controller[_0xde5c('0x16')]);module[_0xde5c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index d95d9e2..f03450c 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 _0x7f30=['exports','STRING','remoteUri'];(function(_0xc1505b,_0x535e96){var _0x594f0f=function(_0x18c1a1){while(--_0x18c1a1){_0xc1505b['push'](_0xc1505b['shift']());}};_0x594f0f(++_0x535e96);}(_0x7f30,0x87));var _0x07f3=function(_0x477ea5,_0x2621a6){_0x477ea5=_0x477ea5-0x0;var _0x5b7f6f=_0x7f30[_0x477ea5];return _0x5b7f6f;};'use strict';var Sequelize=require('sequelize');module[_0x07f3('0x0')]={'name':{'type':Sequelize[_0x07f3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x07f3('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x07f3('0x1')]},'email':{'type':Sequelize[_0x07f3('0x1')]},'remoteUri':{'type':Sequelize[_0x07f3('0x1')],'unique':_0x07f3('0x2')},'serverUrl':{'type':Sequelize[_0x07f3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8068=['exports','STRING','username','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8068,0x1ab));var _0x8806=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0x8068[_0x130719];return _0x159865;};'use strict';var Sequelize=require(_0x8806('0x0'));module[_0x8806('0x1')]={'name':{'type':Sequelize[_0x8806('0x2')]},'description':{'type':Sequelize[_0x8806('0x2')]},'username':{'type':Sequelize[_0x8806('0x2')],'unique':_0x8806('0x3')},'password':{'type':Sequelize[_0x8806('0x2')]},'email':{'type':Sequelize[_0x8806('0x2')]},'remoteUri':{'type':Sequelize[_0x8806('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x8806('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 cd34119..5bbcc18 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 _0x9385=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','findOne','merge','addConfiguration','AccountId','getSubjects','channel','type','getDescriptions','ServicenowField','Subjects','Descriptions','getFields','made_sla','knowledge','subcategory','close_code','incident_state','severity','category','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','delivery_plan','impact','work_notes_list','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','approval_set','work_notes','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','format','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','fast-json-patch'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9385,0x171));var _0x5938=function(_0x5752aa,_0x454e5e){_0x5752aa=_0x5752aa-0x0;var _0x5b2aa3=_0x9385[_0x5752aa];return _0x5b2aa3;};'use strict';var emlformat=require(_0x5938('0x0'));var rimraf=require(_0x5938('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5938('0x2'));var rp=require(_0x5938('0x3'));var moment=require(_0x5938('0x4'));var BPromise=require(_0x5938('0x5'));var Mustache=require(_0x5938('0x6'));var util=require(_0x5938('0x7'));var path=require(_0x5938('0x8'));var sox=require(_0x5938('0x9'));var csv=require(_0x5938('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5938('0xb'));var _=require(_0x5938('0xc'));var squel=require('squel');var crypto=require(_0x5938('0xd'));var jsforce=require(_0x5938('0xe'));var deskjs=require(_0x5938('0xf'));var toCsv=require(_0x5938('0xa'));var querystring=require(_0x5938('0x10'));var Papa=require(_0x5938('0x11'));var Redis=require(_0x5938('0x12'));var authService=require(_0x5938('0x13'));var qs=require(_0x5938('0x14'));var as=require(_0x5938('0x15'));var hardwareService=require(_0x5938('0x16'));var logger=require(_0x5938('0x17'))('api');var utils=require(_0x5938('0x18'));var config=require(_0x5938('0x19'));var licenseUtil=require(_0x5938('0x1a'));var db=require(_0x5938('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x403e62,_0x4ffba2){_0x4ffba2=_0x4ffba2||0xcc;return function(_0xc7ba18){if(_0xc7ba18){return _0x403e62['sendStatus'](_0x4ffba2);}return _0x403e62['status'](_0x4ffba2)[_0x5938('0x1c')]();};}function respondWithResult(_0x3c691a,_0x4943a5){_0x4943a5=_0x4943a5||0xc8;return function(_0xd1fd90){if(_0xd1fd90){return _0x3c691a[_0x5938('0x1d')](_0x4943a5)[_0x5938('0x1e')](_0xd1fd90);}};}function respondWithFilteredResult(_0x1e04c9,_0x15b4bf){return function(_0x5b1799){if(_0x5b1799){var _0x2a15e1=typeof _0x15b4bf['offset']===_0x5938('0x1f')&&typeof _0x15b4bf[_0x5938('0x20')]==='undefined';var _0x10b296=_0x5b1799[_0x5938('0x21')];var _0x31d05f=_0x2a15e1?0x0:_0x15b4bf[_0x5938('0x22')];var _0x44db80=_0x2a15e1?_0x5b1799[_0x5938('0x21')]:_0x15b4bf[_0x5938('0x22')]+_0x15b4bf[_0x5938('0x20')];var _0x415dc1;if(_0x44db80>=_0x10b296){_0x44db80=_0x10b296;_0x415dc1=0xc8;}else{_0x415dc1=0xce;}_0x1e04c9[_0x5938('0x1d')](_0x415dc1);return _0x1e04c9['set'](_0x5938('0x23'),_0x31d05f+'-'+_0x44db80+'/'+_0x10b296)[_0x5938('0x1e')](_0x5b1799);}return null;};}function patchUpdates(_0x547432){return function(_0x417ca8){try{jsonpatch['apply'](_0x417ca8,_0x547432,!![]);}catch(_0x1bc9b7){return BPromise[_0x5938('0x24')](_0x1bc9b7);}return _0x417ca8[_0x5938('0x25')]();};}function saveUpdates(_0x5cc43a,_0x46434b){return function(_0x4ac169){if(_0x4ac169){return _0x4ac169[_0x5938('0x26')](_0x5cc43a)[_0x5938('0x27')](function(_0x1391f9){return _0x1391f9;});}return null;};}function removeEntity(_0x4355cf,_0x3120f9){return function(_0x74febc){if(_0x74febc){return _0x74febc[_0x5938('0x28')]()[_0x5938('0x27')](function(){_0x4355cf[_0x5938('0x1d')](0xcc)[_0x5938('0x1c')]();});}};}function handleEntityNotFound(_0x12f644,_0x5e9945){return function(_0x5ba30b){if(!_0x5ba30b){_0x12f644['sendStatus'](0x194);}return _0x5ba30b;};}function handleError(_0x5e8d96,_0x4ada71){_0x4ada71=_0x4ada71||0x1f4;return function(_0x190e5a){logger[_0x5938('0x29')](_0x190e5a[_0x5938('0x2a')]);if(_0x190e5a[_0x5938('0x2b')]){delete _0x190e5a[_0x5938('0x2b')];}_0x5e8d96[_0x5938('0x1d')](_0x4ada71)[_0x5938('0x2c')](_0x190e5a);};}exports[_0x5938('0x2d')]=function(_0x1a1025,_0x36722d){var _0x563ccc={},_0x4ac739={},_0x108b1c={'count':0x0,'rows':[]};var _0xec18ed=_[_0x5938('0x2e')](db[_0x5938('0x2f')][_0x5938('0x30')],function(_0x5c3f15){return{'name':_0x5c3f15[_0x5938('0x31')],'type':_0x5c3f15['type'][_0x5938('0x32')]};});_0x4ac739[_0x5938('0x33')]=_[_0x5938('0x2e')](_0xec18ed,_0x5938('0x2b'));_0x4ac739[_0x5938('0x34')]=_[_0x5938('0x35')](_0x1a1025[_0x5938('0x34')]);_0x4ac739['filters']=_[_0x5938('0x36')](_0x4ac739[_0x5938('0x33')],_0x4ac739[_0x5938('0x34')]);_0x563ccc['attributes']=_[_0x5938('0x36')](_0x4ac739[_0x5938('0x33')],qs[_0x5938('0x37')](_0x1a1025[_0x5938('0x34')]['fields']));_0x563ccc[_0x5938('0x38')]=_0x563ccc['attributes'][_0x5938('0x39')]?_0x563ccc[_0x5938('0x38')]:_0x4ac739[_0x5938('0x33')];if(!_0x1a1025[_0x5938('0x34')][_0x5938('0x3a')](_0x5938('0x3b'))){_0x563ccc[_0x5938('0x20')]=qs[_0x5938('0x20')](_0x1a1025['query'][_0x5938('0x20')]);_0x563ccc['offset']=qs['offset'](_0x1a1025[_0x5938('0x34')][_0x5938('0x22')]);}_0x563ccc[_0x5938('0x3c')]=qs['sort'](_0x1a1025[_0x5938('0x34')][_0x5938('0x3d')]);_0x563ccc['where']=qs[_0x5938('0x3e')](_[_0x5938('0x3f')](_0x1a1025['query'],_0x4ac739[_0x5938('0x3e')]),_0xec18ed);if(_0x1a1025[_0x5938('0x34')][_0x5938('0x40')]){_0x563ccc[_0x5938('0x41')]=_['merge'](_0x563ccc['where'],{'$or':_[_0x5938('0x2e')](_0xec18ed,function(_0x4e0fd0){if(_0x4e0fd0['type']!==_0x5938('0x42')){var _0x4a7980={};_0x4a7980[_0x4e0fd0[_0x5938('0x2b')]]={'$like':'%'+_0x1a1025['query']['filter']+'%'};return _0x4a7980;}})});}_0x563ccc=_['merge']({},_0x563ccc,_0x1a1025[_0x5938('0x43')]);var _0xbe3c5a={'where':_0x563ccc['where']};return db['ServicenowAccount']['count'](_0xbe3c5a)[_0x5938('0x27')](function(_0x261d0b){_0x108b1c[_0x5938('0x21')]=_0x261d0b;if(_0x1a1025[_0x5938('0x34')][_0x5938('0x44')]){_0x563ccc[_0x5938('0x45')]=[{'all':!![]}];}return db[_0x5938('0x2f')][_0x5938('0x46')](_0x563ccc);})[_0x5938('0x27')](function(_0x1bdf60){_0x108b1c[_0x5938('0x47')]=_0x1bdf60;return _0x108b1c;})[_0x5938('0x27')](respondWithFilteredResult(_0x36722d,_0x563ccc))[_0x5938('0x48')](handleError(_0x36722d,null));};exports['show']=function(_0x154cf7,_0x4bc885){var _0x118f1e={'raw':![],'where':{'id':_0x154cf7['params']['id']}},_0x1428e9={};_0x1428e9[_0x5938('0x33')]=_[_0x5938('0x35')](db['ServicenowAccount'][_0x5938('0x30')]);_0x1428e9['query']=_['keys'](_0x154cf7[_0x5938('0x34')]);_0x1428e9[_0x5938('0x3e')]=_[_0x5938('0x36')](_0x1428e9[_0x5938('0x33')],_0x1428e9[_0x5938('0x34')]);_0x118f1e['attributes']=_[_0x5938('0x36')](_0x1428e9[_0x5938('0x33')],qs[_0x5938('0x37')](_0x154cf7[_0x5938('0x34')][_0x5938('0x37')]));_0x118f1e['attributes']=_0x118f1e[_0x5938('0x38')][_0x5938('0x39')]?_0x118f1e[_0x5938('0x38')]:_0x1428e9[_0x5938('0x33')];if(_0x154cf7[_0x5938('0x34')][_0x5938('0x44')]){_0x118f1e[_0x5938('0x45')]=[{'all':!![]}];}_0x118f1e=_['merge']({},_0x118f1e,_0x154cf7[_0x5938('0x43')]);return db[_0x5938('0x2f')][_0x5938('0x49')](_0x118f1e)['then'](handleEntityNotFound(_0x4bc885,null))[_0x5938('0x27')](respondWithResult(_0x4bc885,null))['catch'](handleError(_0x4bc885,null));};exports[_0x5938('0x4a')]=function(_0x573994,_0x297d29){return db[_0x5938('0x2f')][_0x5938('0x4a')](_0x573994[_0x5938('0x4b')],{})[_0x5938('0x27')](respondWithResult(_0x297d29,0xc9))[_0x5938('0x48')](handleError(_0x297d29,null));};exports['update']=function(_0x3737e2,_0x4254eb){if(_0x3737e2[_0x5938('0x4b')]['id']){delete _0x3737e2[_0x5938('0x4b')]['id'];}return db[_0x5938('0x2f')][_0x5938('0x49')]({'where':{'id':_0x3737e2[_0x5938('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4254eb,null))[_0x5938('0x27')](saveUpdates(_0x3737e2[_0x5938('0x4b')],null))[_0x5938('0x27')](respondWithResult(_0x4254eb,null))[_0x5938('0x48')](handleError(_0x4254eb,null));};exports[_0x5938('0x28')]=function(_0x50f6d5,_0x4d4fbd){return db[_0x5938('0x2f')][_0x5938('0x49')]({'where':{'id':_0x50f6d5['params']['id']}})[_0x5938('0x27')](handleEntityNotFound(_0x4d4fbd,null))[_0x5938('0x27')](removeEntity(_0x4d4fbd,null))[_0x5938('0x48')](handleError(_0x4d4fbd,null));};exports[_0x5938('0x4d')]=function(_0x1fac47,_0x465c0c,_0x146ad0){var _0x22c6d2={};var _0x4bf4c2={};var _0x37b89d;var _0x425164;return db[_0x5938('0x2f')][_0x5938('0x4e')]({'where':{'id':_0x1fac47[_0x5938('0x4c')]['id']}})[_0x5938('0x27')](handleEntityNotFound(_0x465c0c,null))['then'](function(_0x565057){if(_0x565057){_0x37b89d=_0x565057;_0x4bf4c2[_0x5938('0x33')]=_[_0x5938('0x35')](db['ServicenowConfiguration'][_0x5938('0x30')]);_0x4bf4c2[_0x5938('0x34')]=_[_0x5938('0x35')](_0x1fac47['query']);_0x4bf4c2['filters']=_['intersection'](_0x4bf4c2[_0x5938('0x33')],_0x4bf4c2[_0x5938('0x34')]);_0x22c6d2[_0x5938('0x38')]=_[_0x5938('0x36')](_0x4bf4c2['model'],qs['fields'](_0x1fac47[_0x5938('0x34')][_0x5938('0x37')]));_0x22c6d2['attributes']=_0x22c6d2['attributes'][_0x5938('0x39')]?_0x22c6d2[_0x5938('0x38')]:_0x4bf4c2[_0x5938('0x33')];_0x22c6d2['order']=qs['sort'](_0x1fac47[_0x5938('0x34')][_0x5938('0x3d')]);_0x22c6d2[_0x5938('0x41')]=qs[_0x5938('0x3e')](_['pick'](_0x1fac47[_0x5938('0x34')],_0x4bf4c2[_0x5938('0x3e')]));if(_0x1fac47[_0x5938('0x34')][_0x5938('0x40')]){_0x22c6d2[_0x5938('0x41')]=_[_0x5938('0x4f')](_0x22c6d2[_0x5938('0x41')],{'$or':_['map'](_0x22c6d2[_0x5938('0x38')],function(_0x5e54b1){var _0x3a6c4a={};_0x3a6c4a[_0x5e54b1]={'$like':'%'+_0x1fac47[_0x5938('0x34')]['filter']+'%'};return _0x3a6c4a;})});}_0x22c6d2=_[_0x5938('0x4f')]({},_0x22c6d2,_0x1fac47['options']);return _0x37b89d['getConfigurations'](_0x22c6d2);}})[_0x5938('0x27')](function(_0x5269cc){if(_0x5269cc){_0x425164=_0x5269cc[_0x5938('0x39')];if(!_0x1fac47[_0x5938('0x34')][_0x5938('0x3a')](_0x5938('0x3b'))){_0x22c6d2[_0x5938('0x20')]=qs[_0x5938('0x20')](_0x1fac47[_0x5938('0x34')]['limit']);_0x22c6d2[_0x5938('0x22')]=qs[_0x5938('0x22')](_0x1fac47['query']['offset']);}return _0x37b89d['getConfigurations'](_0x22c6d2);}})['then'](function(_0x7393aa){if(_0x7393aa){return _0x7393aa?{'count':_0x425164,'rows':_0x7393aa}:null;}})[_0x5938('0x27')](respondWithResult(_0x465c0c,null))[_0x5938('0x48')](handleError(_0x465c0c,null));};exports[_0x5938('0x50')]=function(_0x4cfcaf,_0x2dc0a4,_0x3b6948){if(_0x4cfcaf[_0x5938('0x4b')]['id']){delete _0x4cfcaf[_0x5938('0x4b')]['id'];}return db[_0x5938('0x2f')][_0x5938('0x4e')]({'where':{'id':_0x4cfcaf[_0x5938('0x4c')]['id']}})[_0x5938('0x27')](handleEntityNotFound(_0x2dc0a4,null))[_0x5938('0x27')](function(_0x380514){if(_0x380514){_0x4cfcaf['body'][_0x5938('0x51')]=_0x380514['id'];_0x4cfcaf[_0x5938('0x4b')]['Subjects']=integrations[_0x5938('0x52')](_0x4cfcaf['body'][_0x5938('0x53')],_0x4cfcaf[_0x5938('0x4b')][_0x5938('0x54')]);_0x4cfcaf[_0x5938('0x4b')]['Descriptions']=integrations[_0x5938('0x55')](_0x4cfcaf['body'][_0x5938('0x53')],_0x4cfcaf['body'][_0x5938('0x54')]);return db['ServicenowConfiguration'][_0x5938('0x4a')](_0x4cfcaf[_0x5938('0x4b')],{'include':[{'model':db[_0x5938('0x56')],'as':_0x5938('0x57')},{'model':db[_0x5938('0x56')],'as':_0x5938('0x58')}]});}return null;})[_0x5938('0x27')](respondWithResult(_0x2dc0a4,null))[_0x5938('0x48')](handleError(_0x2dc0a4,null));};exports[_0x5938('0x59')]=function(_0x1bfcbc,_0x1495fc,_0x5cbcf6){var _0x6cd200=[_0x5938('0x5a'),'hold_reason',_0x5938('0x5b'),_0x5938('0x5c'),_0x5938('0x5d'),'notify',_0x5938('0x5e'),_0x5938('0x5f'),_0x5938('0x60')];var _0x41a592=['parent',_0x5938('0x5a'),_0x5938('0x61'),'watch_list',_0x5938('0x62'),_0x5938('0x63'),_0x5938('0x64'),_0x5938('0x65'),_0x5938('0x66'),_0x5938('0x67'),_0x5938('0x68'),_0x5938('0x69'),_0x5938('0x6a'),'user_input',_0x5938('0x6b'),_0x5938('0x6c'),_0x5938('0x6d'),'sys_created_by',_0x5938('0x5b'),_0x5938('0x3c'),_0x5938('0x6e'),'closed_at','cmdb_ci',_0x5938('0x6f'),_0x5938('0x70'),'active',_0x5938('0x71'),'business_service','priority',_0x5938('0x72'),_0x5938('0x73'),_0x5938('0x74'),_0x5938('0x75'),_0x5938('0x76'),_0x5938('0x77'),_0x5938('0x78'),'work_end',_0x5938('0x79'),_0x5938('0x7a'),'caller_id',_0x5938('0x7b'),'subcategory',_0x5938('0x7c'),'short_description',_0x5938('0x5d'),_0x5938('0x7d'),_0x5938('0x7e'),_0x5938('0x7f'),'assignment_group',_0x5938('0x80'),_0x5938('0x81'),_0x5938('0x82'),_0x5938('0x83'),'notify',_0x5938('0x84'),_0x5938('0x85'),'closed_by',_0x5938('0x86'),_0x5938('0x87'),_0x5938('0x88'),_0x5938('0x89'),_0x5938('0x8a'),_0x5938('0x5e'),_0x5938('0x8b'),'problem_id',_0x5938('0x8c'),'reassignment_count',_0x5938('0x8d'),_0x5938('0x8e'),_0x5938('0x5f'),'comments',_0x5938('0x8f'),_0x5938('0x90'),_0x5938('0x91'),'due_date',_0x5938('0x92'),_0x5938('0x93'),_0x5938('0x94'),'escalation',_0x5938('0x95'),_0x5938('0x96'),_0x5938('0x97'),_0x5938('0x60')];var _0x3e223c='';var _0x4be56a='';var _0x1a8c4b=[];var _0x29c682='';var _0x47a965='';var _0x1a51a8=[];var _0x30f1ba='';var _0x2c9aa4='';var _0x861a8b={};var _0x426ea4='';return db['ServicenowAccount'][_0x5938('0x4e')]({'where':{'id':_0x1bfcbc[_0x5938('0x4c')]['id']},'attributes':['id',_0x5938('0x98'),_0x5938('0x99'),_0x5938('0x9a'),_0x5938('0x9b'),_0x5938('0x9c')]})['then'](handleEntityNotFound(_0x1495fc,null))[_0x5938('0x27')](function(_0x151862){if(_0x151862){_0x426ea4=_0x151862[_0x5938('0x9b')];var _0xd2766=_0x426ea4[_0x5938('0x9d')](-0x1);if(_0xd2766==='/'){_0x426ea4=_0x426ea4[_0x5938('0x9e')](0x0,_0x426ea4['lastIndexOf'](_0xd2766));}_0x2c9aa4=util[_0x5938('0x9f')]('%s/api/now/doc/table/schema/',_0x426ea4);_0x30f1ba=util[_0x5938('0x9f')]('%s/api/now/table/',_0x426ea4);_0x861a8b={'user':_0x151862['username'],'pass':_0x151862['password']};var _0x99a545={'method':_0x5938('0xa0'),'uri':_0x2c9aa4+_0x5938('0xa1'),'auth':_0x861a8b,'json':!![]};return rp(_0x99a545);}})['then'](function(_0x117890){if(_0x117890[_0x5938('0xa2')][_0x5938('0x39')]>0x0){_0x3e223c=_0x117890['result'];}console[_0x5938('0xa3')](_0x5938('0xa4'),_0x3e223c);_0x1a51a8=[];_0x4be56a=Object[_0x5938('0xa5')]([],_0x3e223c);_[_0x5938('0xa6')](_0x4be56a,function(_0x1649d8){return!_0x6cd200[_0x5938('0xa7')](_0x1649d8[_0x5938('0x2b')]);});_0x4be56a[_0x5938('0xa8')](function(_0x2bffbc){var _0x43bfd4=createFieldObject(_0x30f1ba,_0x861a8b,_0x2bffbc[_0x5938('0xa9')],_0x2bffbc[_0x5938('0x2b')],_0x2bffbc[_0x5938('0xaa')],![]);_0x1a51a8[_0x5938('0xab')](_0x43bfd4);});return Promise[_0x5938('0xac')](_0x1a51a8);})[_0x5938('0x27')](function(_0x3d904f){_0x1a8c4b=_0x3d904f;_0x29c682=Object[_0x5938('0xa5')]([],_0x3e223c);console[_0x5938('0xa3')](_0x5938('0xad'),_0x3e223c);_['remove'](_0x29c682,function(_0x51aac6){return _0x41a592[_0x5938('0xa7')](_0x51aac6[_0x5938('0x2b')]);});console[_0x5938('0xa3')](_0x5938('0xae'),_0x29c682);_0x1a51a8=[];_0x29c682[_0x5938('0xa8')](function(_0x594c04){var _0xf09f5f=createFieldObject(_0x30f1ba,_0x861a8b,_0x594c04[_0x5938('0xa9')],_0x594c04[_0x5938('0x2b')],_0x594c04[_0x5938('0xaa')],!![]);_0x1a51a8[_0x5938('0xab')](_0xf09f5f);});return Promise[_0x5938('0xac')](_0x1a51a8);})[_0x5938('0x27')](function(_0x11859c){_0x47a965=_0x11859c;var _0x1b9a8a=_0x1a8c4b[_0x5938('0xaf')](_0x47a965);return{'count':_0x1b9a8a['length'],'rows':_0x1b9a8a};})[_0x5938('0x27')](respondWithResult(_0x1495fc,null))['catch'](function(_0x9db444){console[_0x5938('0xa3')](_0x5938('0xb0')+_0x9db444);var _0x3c4582=_0x1bfcbc[_0x5938('0x34')][_0x5938('0xb1')]?0x1f4:_0x9db444[_0x5938('0xb2')]||0x1f4;logger[_0x5938('0x29')](_0x9db444['stack']);delete _0x9db444[_0x5938('0x2b')];if(_0x3c4582===0x191){_0x3c4582=0x190;}_0x1495fc[_0x5938('0x1d')](_0x3c4582)[_0x5938('0x2c')](_0x1bfcbc[_0x5938('0x34')][_0x5938('0xb1')]?{'message':_0x5938('0xb3'),'statusCode':_0x9db444['statusCode']}:_0x9db444);});};function createFieldObject(_0x58f9f7,_0x242695,_0x2c8955,_0x3e9973,_0x2a778e,_0x1be1da){return new Promise(function(_0x243b2e,_0x46607f){var _0x77240a={'id':_0x3e9973,'name':_0x2a778e,'custom':_0x1be1da};if(_0x2c8955==='boolean'){_0x77240a['options']=[{'name':_0x5938('0xb4'),'value':_0x5938('0xb5')},{'name':_0x5938('0xb6'),'value':_0x5938('0xb7')}];_0x243b2e(_0x77240a);}else{var _0x37f0c0={'method':_0x5938('0xa0'),'uri':_0x58f9f7+_0x5938('0xb8')+_0x3e9973,'auth':_0x242695,'json':!![]};return rp(_0x37f0c0)[_0x5938('0x27')](function(_0x48dbdb){var _0x16858e=[];if(_0x48dbdb[_0x5938('0xa2')][_0x5938('0x39')]>0x0){_0x48dbdb[_0x5938('0xa2')][_0x5938('0xa8')](function(_0x2d5554){if(_0x2d5554['inactive']==='false'){var _0xf70e4c={'name':_0x2d5554['label'],'value':_0x2d5554[_0x5938('0xb9')]};_0x16858e[_0x5938('0xab')](_0xf70e4c);}});}_0x77240a[_0x5938('0x43')]=_0x16858e;if(_0x77240a['options']['length']>0x0){_0x243b2e(_0x77240a);}else{if(_0x1be1da==![]){_0x243b2e();}else{_0x243b2e(_0x77240a);}}});}});} \ No newline at end of file +var _0x8bea=['comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','assign','concat','ServiceNow\x20error:\x20','stack','send','test','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','json','reject','save','update','destroy','end','error','name','ServicenowAccount','rawAttributes','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','then','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','findOne','ServicenowConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','type','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','incident_state','severity','category','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','priority','rfc','expected_start','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','close_code','correlation_display','work_start','additional_assignee_list','description','calendar_duration','close_notes','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','sla_due'];(function(_0x54270c,_0x50242d){var _0x12b172=function(_0x5488ca){while(--_0x5488ca){_0x54270c['push'](_0x54270c['shift']());}};_0x12b172(++_0x50242d);}(_0x8bea,0xd4));var _0xa8be=function(_0x20c961,_0xe9fbd){_0x20c961=_0x20c961-0x0;var _0x7f04d7=_0x8bea[_0x20c961];return _0x7f04d7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8be('0x0'));var zipdir=require(_0xa8be('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8be('0x2'));var moment=require('moment');var BPromise=require(_0xa8be('0x3'));var Mustache=require(_0xa8be('0x4'));var util=require('util');var path=require(_0xa8be('0x5'));var sox=require(_0xa8be('0x6'));var csv=require(_0xa8be('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8be('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa8be('0x9'));var jsforce=require(_0xa8be('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa8be('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa8be('0xb'));var authService=require(_0xa8be('0xc'));var qs=require(_0xa8be('0xd'));var as=require(_0xa8be('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa8be('0xf'));var utils=require(_0xa8be('0x10'));var config=require(_0xa8be('0x11'));var licenseUtil=require(_0xa8be('0x12'));var db=require(_0xa8be('0x13'))['db'];var integrations=require(_0xa8be('0x14'));function respondWithStatusCode(_0x16d13b,_0x198646){_0x198646=_0x198646||0xcc;return function(_0x58e1fe){if(_0x58e1fe){return _0x16d13b[_0xa8be('0x15')](_0x198646);}return _0x16d13b['status'](_0x198646)['end']();};}function respondWithResult(_0x246645,_0x2e5749){_0x2e5749=_0x2e5749||0xc8;return function(_0x3e36d0){if(_0x3e36d0){return _0x246645[_0xa8be('0x16')](_0x2e5749)['json'](_0x3e36d0);}};}function respondWithFilteredResult(_0x33bd44,_0x1bea0f){return function(_0x3d537b){if(_0x3d537b){var _0x34e733=typeof _0x1bea0f[_0xa8be('0x17')]===_0xa8be('0x18')&&typeof _0x1bea0f[_0xa8be('0x19')]===_0xa8be('0x18');var _0x246a63=_0x3d537b[_0xa8be('0x1a')];var _0x13b84b=_0x34e733?0x0:_0x1bea0f[_0xa8be('0x17')];var _0x22f6dd=_0x34e733?_0x3d537b[_0xa8be('0x1a')]:_0x1bea0f[_0xa8be('0x17')]+_0x1bea0f[_0xa8be('0x19')];var _0x30a4ca;if(_0x22f6dd>=_0x246a63){_0x22f6dd=_0x246a63;_0x30a4ca=0xc8;}else{_0x30a4ca=0xce;}_0x33bd44[_0xa8be('0x16')](_0x30a4ca);return _0x33bd44['set']('Content-Range',_0x13b84b+'-'+_0x22f6dd+'/'+_0x246a63)[_0xa8be('0x1b')](_0x3d537b);}return null;};}function patchUpdates(_0x6b7f86){return function(_0x4cc560){try{jsonpatch['apply'](_0x4cc560,_0x6b7f86,!![]);}catch(_0x2597e8){return BPromise[_0xa8be('0x1c')](_0x2597e8);}return _0x4cc560[_0xa8be('0x1d')]();};}function saveUpdates(_0x2fe464,_0x4da4fe){return function(_0x775de8){if(_0x775de8){return _0x775de8[_0xa8be('0x1e')](_0x2fe464)['then'](function(_0x5a76e4){return _0x5a76e4;});}return null;};}function removeEntity(_0x192baa,_0x8ac29){return function(_0x59e338){if(_0x59e338){return _0x59e338[_0xa8be('0x1f')]()['then'](function(){_0x192baa[_0xa8be('0x16')](0xcc)[_0xa8be('0x20')]();});}};}function handleEntityNotFound(_0xb76fd1,_0x507f45){return function(_0x152eeb){if(!_0x152eeb){_0xb76fd1['sendStatus'](0x194);}return _0x152eeb;};}function handleError(_0x27f996,_0x8ceb2a){_0x8ceb2a=_0x8ceb2a||0x1f4;return function(_0x29ca5a){logger[_0xa8be('0x21')](_0x29ca5a['stack']);if(_0x29ca5a[_0xa8be('0x22')]){delete _0x29ca5a[_0xa8be('0x22')];}_0x27f996[_0xa8be('0x16')](_0x8ceb2a)['send'](_0x29ca5a);};}exports['index']=function(_0x58a72e,_0x1b638d){var _0x2d08ff={},_0x2bc5f6={},_0xcc1ff8={'count':0x0,'rows':[]};var _0x13e9eb=_['map'](db[_0xa8be('0x23')][_0xa8be('0x24')],function(_0x3be6db){return{'name':_0x3be6db['fieldName'],'type':_0x3be6db['type'][_0xa8be('0x25')]};});_0x2bc5f6['model']=_[_0xa8be('0x26')](_0x13e9eb,_0xa8be('0x22'));_0x2bc5f6[_0xa8be('0x27')]=_['keys'](_0x58a72e[_0xa8be('0x27')]);_0x2bc5f6['filters']=_[_0xa8be('0x28')](_0x2bc5f6['model'],_0x2bc5f6[_0xa8be('0x27')]);_0x2d08ff[_0xa8be('0x29')]=_[_0xa8be('0x28')](_0x2bc5f6[_0xa8be('0x2a')],qs[_0xa8be('0x2b')](_0x58a72e[_0xa8be('0x27')]['fields']));_0x2d08ff[_0xa8be('0x29')]=_0x2d08ff[_0xa8be('0x29')][_0xa8be('0x2c')]?_0x2d08ff['attributes']:_0x2bc5f6[_0xa8be('0x2a')];if(!_0x58a72e[_0xa8be('0x27')][_0xa8be('0x2d')](_0xa8be('0x2e'))){_0x2d08ff[_0xa8be('0x19')]=qs[_0xa8be('0x19')](_0x58a72e[_0xa8be('0x27')]['limit']);_0x2d08ff[_0xa8be('0x17')]=qs[_0xa8be('0x17')](_0x58a72e[_0xa8be('0x27')][_0xa8be('0x17')]);}_0x2d08ff[_0xa8be('0x2f')]=qs[_0xa8be('0x30')](_0x58a72e[_0xa8be('0x27')][_0xa8be('0x30')]);_0x2d08ff[_0xa8be('0x31')]=qs[_0xa8be('0x32')](_['pick'](_0x58a72e[_0xa8be('0x27')],_0x2bc5f6[_0xa8be('0x32')]),_0x13e9eb);if(_0x58a72e[_0xa8be('0x27')][_0xa8be('0x33')]){_0x2d08ff[_0xa8be('0x31')]=_['merge'](_0x2d08ff[_0xa8be('0x31')],{'$or':_[_0xa8be('0x26')](_0x13e9eb,function(_0x129121){if(_0x129121['type']!==_0xa8be('0x34')){var _0x49d9ed={};_0x49d9ed[_0x129121[_0xa8be('0x22')]]={'$like':'%'+_0x58a72e['query'][_0xa8be('0x33')]+'%'};return _0x49d9ed;}})});}_0x2d08ff=_[_0xa8be('0x35')]({},_0x2d08ff,_0x58a72e[_0xa8be('0x36')]);var _0xee177e={'where':_0x2d08ff[_0xa8be('0x31')]};return db[_0xa8be('0x23')][_0xa8be('0x1a')](_0xee177e)[_0xa8be('0x37')](function(_0x3a231e){_0xcc1ff8[_0xa8be('0x1a')]=_0x3a231e;if(_0x58a72e[_0xa8be('0x27')]['includeAll']){_0x2d08ff[_0xa8be('0x38')]=[{'all':!![]}];}return db[_0xa8be('0x23')][_0xa8be('0x39')](_0x2d08ff);})['then'](function(_0x654829){_0xcc1ff8[_0xa8be('0x3a')]=_0x654829;return _0xcc1ff8;})['then'](respondWithFilteredResult(_0x1b638d,_0x2d08ff))[_0xa8be('0x3b')](handleError(_0x1b638d,null));};exports[_0xa8be('0x3c')]=function(_0x40eb5a,_0x5540c5){var _0x50ffaa={'raw':![],'where':{'id':_0x40eb5a[_0xa8be('0x3d')]['id']}},_0x1364a9={};_0x1364a9[_0xa8be('0x2a')]=_[_0xa8be('0x3e')](db[_0xa8be('0x23')][_0xa8be('0x24')]);_0x1364a9[_0xa8be('0x27')]=_['keys'](_0x40eb5a[_0xa8be('0x27')]);_0x1364a9[_0xa8be('0x32')]=_['intersection'](_0x1364a9[_0xa8be('0x2a')],_0x1364a9[_0xa8be('0x27')]);_0x50ffaa[_0xa8be('0x29')]=_['intersection'](_0x1364a9[_0xa8be('0x2a')],qs['fields'](_0x40eb5a[_0xa8be('0x27')]['fields']));_0x50ffaa[_0xa8be('0x29')]=_0x50ffaa['attributes'][_0xa8be('0x2c')]?_0x50ffaa[_0xa8be('0x29')]:_0x1364a9[_0xa8be('0x2a')];if(_0x40eb5a['query'][_0xa8be('0x3f')]){_0x50ffaa[_0xa8be('0x38')]=[{'all':!![]}];}_0x50ffaa=_[_0xa8be('0x35')]({},_0x50ffaa,_0x40eb5a['options']);return db['ServicenowAccount']['find'](_0x50ffaa)[_0xa8be('0x37')](handleEntityNotFound(_0x5540c5,null))[_0xa8be('0x37')](respondWithResult(_0x5540c5,null))[_0xa8be('0x3b')](handleError(_0x5540c5,null));};exports[_0xa8be('0x40')]=function(_0x564196,_0x218148){return db[_0xa8be('0x23')][_0xa8be('0x40')](_0x564196[_0xa8be('0x41')],{})['then'](respondWithResult(_0x218148,0xc9))[_0xa8be('0x3b')](handleError(_0x218148,null));};exports[_0xa8be('0x1e')]=function(_0x58180f,_0x142659){if(_0x58180f[_0xa8be('0x41')]['id']){delete _0x58180f[_0xa8be('0x41')]['id'];}return db[_0xa8be('0x23')][_0xa8be('0x42')]({'where':{'id':_0x58180f[_0xa8be('0x3d')]['id']}})['then'](handleEntityNotFound(_0x142659,null))[_0xa8be('0x37')](saveUpdates(_0x58180f[_0xa8be('0x41')],null))[_0xa8be('0x37')](respondWithResult(_0x142659,null))[_0xa8be('0x3b')](handleError(_0x142659,null));};exports[_0xa8be('0x1f')]=function(_0x166aab,_0x1ac287){return db[_0xa8be('0x23')]['find']({'where':{'id':_0x166aab['params']['id']}})[_0xa8be('0x37')](handleEntityNotFound(_0x1ac287,null))[_0xa8be('0x37')](removeEntity(_0x1ac287,null))[_0xa8be('0x3b')](handleError(_0x1ac287,null));};exports['getConfigurations']=function(_0x4758af,_0x266847,_0x5453f7){var _0x37af46={};var _0x56066={};var _0x2ef153;var _0x2873f4;return db[_0xa8be('0x23')][_0xa8be('0x43')]({'where':{'id':_0x4758af['params']['id']}})['then'](handleEntityNotFound(_0x266847,null))[_0xa8be('0x37')](function(_0x20c90b){if(_0x20c90b){_0x2ef153=_0x20c90b;_0x56066[_0xa8be('0x2a')]=_[_0xa8be('0x3e')](db[_0xa8be('0x44')][_0xa8be('0x24')]);_0x56066[_0xa8be('0x27')]=_['keys'](_0x4758af['query']);_0x56066[_0xa8be('0x32')]=_['intersection'](_0x56066[_0xa8be('0x2a')],_0x56066[_0xa8be('0x27')]);_0x37af46[_0xa8be('0x29')]=_[_0xa8be('0x28')](_0x56066[_0xa8be('0x2a')],qs['fields'](_0x4758af['query'][_0xa8be('0x2b')]));_0x37af46[_0xa8be('0x29')]=_0x37af46['attributes'][_0xa8be('0x2c')]?_0x37af46[_0xa8be('0x29')]:_0x56066[_0xa8be('0x2a')];_0x37af46[_0xa8be('0x2f')]=qs[_0xa8be('0x30')](_0x4758af[_0xa8be('0x27')][_0xa8be('0x30')]);_0x37af46[_0xa8be('0x31')]=qs[_0xa8be('0x32')](_['pick'](_0x4758af[_0xa8be('0x27')],_0x56066[_0xa8be('0x32')]));if(_0x4758af[_0xa8be('0x27')]['filter']){_0x37af46[_0xa8be('0x31')]=_['merge'](_0x37af46[_0xa8be('0x31')],{'$or':_[_0xa8be('0x26')](_0x37af46['attributes'],function(_0x12ee90){var _0x3a15dd={};_0x3a15dd[_0x12ee90]={'$like':'%'+_0x4758af['query']['filter']+'%'};return _0x3a15dd;})});}_0x37af46=_['merge']({},_0x37af46,_0x4758af[_0xa8be('0x36')]);return _0x2ef153[_0xa8be('0x45')](_0x37af46);}})[_0xa8be('0x37')](function(_0x3f6924){if(_0x3f6924){_0x2873f4=_0x3f6924[_0xa8be('0x2c')];if(!_0x4758af['query'][_0xa8be('0x2d')](_0xa8be('0x2e'))){_0x37af46[_0xa8be('0x19')]=qs['limit'](_0x4758af[_0xa8be('0x27')][_0xa8be('0x19')]);_0x37af46[_0xa8be('0x17')]=qs[_0xa8be('0x17')](_0x4758af[_0xa8be('0x27')][_0xa8be('0x17')]);}return _0x2ef153[_0xa8be('0x45')](_0x37af46);}})[_0xa8be('0x37')](function(_0xa868ee){if(_0xa868ee){return _0xa868ee?{'count':_0x2873f4,'rows':_0xa868ee}:null;}})[_0xa8be('0x37')](respondWithResult(_0x266847,null))[_0xa8be('0x3b')](handleError(_0x266847,null));};exports['addConfiguration']=function(_0x38309e,_0x273cae,_0x3c2720){if(_0x38309e[_0xa8be('0x41')]['id']){delete _0x38309e[_0xa8be('0x41')]['id'];}return db[_0xa8be('0x23')][_0xa8be('0x43')]({'where':{'id':_0x38309e[_0xa8be('0x3d')]['id']}})['then'](handleEntityNotFound(_0x273cae,null))[_0xa8be('0x37')](function(_0x2a4968){if(_0x2a4968){_0x38309e['body'][_0xa8be('0x46')]=_0x2a4968['id'];_0x38309e[_0xa8be('0x41')][_0xa8be('0x47')]=integrations[_0xa8be('0x48')](_0x38309e[_0xa8be('0x41')][_0xa8be('0x49')],_0x38309e[_0xa8be('0x41')][_0xa8be('0x4a')]);_0x38309e['body'][_0xa8be('0x4b')]=integrations['getDescriptions'](_0x38309e[_0xa8be('0x41')][_0xa8be('0x49')],_0x38309e[_0xa8be('0x41')]['type']);return db[_0xa8be('0x44')][_0xa8be('0x40')](_0x38309e[_0xa8be('0x41')],{'include':[{'model':db[_0xa8be('0x4c')],'as':_0xa8be('0x47')},{'model':db['ServicenowField'],'as':_0xa8be('0x4b')}]});}return null;})[_0xa8be('0x37')](respondWithResult(_0x273cae,null))[_0xa8be('0x3b')](handleError(_0x273cae,null));};exports[_0xa8be('0x4d')]=function(_0x20f8e4,_0x462bfd,_0x1fab45){var _0x110418=[_0xa8be('0x4e'),_0xa8be('0x4f'),_0xa8be('0x50'),'subcategory','close_code',_0xa8be('0x51'),_0xa8be('0x52'),_0xa8be('0x53'),_0xa8be('0x54')];var _0x3c04c0=['parent',_0xa8be('0x4e'),'caused_by',_0xa8be('0x55'),_0xa8be('0x56'),'sys_updated_on',_0xa8be('0x57'),_0xa8be('0x4f'),_0xa8be('0x58'),_0xa8be('0x59'),_0xa8be('0x5a'),_0xa8be('0x5b'),'opened_by',_0xa8be('0x5c'),_0xa8be('0x5d'),_0xa8be('0x5e'),_0xa8be('0x5f'),'sys_created_by','knowledge',_0xa8be('0x2f'),_0xa8be('0x60'),_0xa8be('0x61'),_0xa8be('0x62'),'delivery_plan',_0xa8be('0x63'),_0xa8be('0x64'),_0xa8be('0x65'),'business_service',_0xa8be('0x66'),'sys_domain_path',_0xa8be('0x67'),'time_worked',_0xa8be('0x68'),'opened_at',_0xa8be('0x69'),_0xa8be('0x6a'),'work_end',_0xa8be('0x6b'),_0xa8be('0x6c'),_0xa8be('0x6d'),_0xa8be('0x6e'),'subcategory',_0xa8be('0x6f'),'short_description',_0xa8be('0x70'),_0xa8be('0x71'),'delivery_task',_0xa8be('0x72'),'assignment_group','business_stc',_0xa8be('0x73'),_0xa8be('0x74'),_0xa8be('0x75'),'notify','sys_class_name',_0xa8be('0x76'),'closed_by','follow_up',_0xa8be('0x77'),_0xa8be('0x78'),_0xa8be('0x79'),_0xa8be('0x7a'),_0xa8be('0x52'),_0xa8be('0x7b'),_0xa8be('0x7c'),_0xa8be('0x7d'),'reassignment_count',_0xa8be('0x7e'),'assigned_to',_0xa8be('0x53'),'comments',_0xa8be('0x7f'),'approval',_0xa8be('0x80'),'due_date',_0xa8be('0x81'),_0xa8be('0x82'),_0xa8be('0x83'),_0xa8be('0x84'),'upon_approval',_0xa8be('0x85'),_0xa8be('0x86'),_0xa8be('0x54')];var _0xfc40e8='';var _0x2a7336='';var _0x4b3c85=[];var _0x599871='';var _0x214e2c='';var _0x3d453d=[];var _0x23b1df='';var _0x455a15='';var _0x99b34a={};var _0x228a97='';return db[_0xa8be('0x23')][_0xa8be('0x43')]({'where':{'id':_0x20f8e4[_0xa8be('0x3d')]['id']},'attributes':['id',_0xa8be('0x87'),_0xa8be('0x88'),_0xa8be('0x89'),'remoteUri',_0xa8be('0x8a')]})[_0xa8be('0x37')](handleEntityNotFound(_0x462bfd,null))['then'](function(_0x5e3d78){if(_0x5e3d78){_0x228a97=_0x5e3d78[_0xa8be('0x8b')];var _0x37f147=_0x228a97[_0xa8be('0x8c')](-0x1);if(_0x37f147==='/'){_0x228a97=_0x228a97['substring'](0x0,_0x228a97[_0xa8be('0x8d')](_0x37f147));}_0x455a15=util['format'](_0xa8be('0x8e'),_0x228a97);_0x23b1df=util[_0xa8be('0x8f')](_0xa8be('0x90'),_0x228a97);_0x99b34a={'user':_0x5e3d78[_0xa8be('0x87')],'pass':_0x5e3d78['password']};var _0x3a6818={'method':_0xa8be('0x91'),'uri':_0x455a15+'incident?sysparm_display_value=all','auth':_0x99b34a,'json':!![]};return rp(_0x3a6818);}})[_0xa8be('0x37')](function(_0x59d052){if(_0x59d052[_0xa8be('0x92')][_0xa8be('0x2c')]>0x0){_0xfc40e8=_0x59d052[_0xa8be('0x92')];}console[_0xa8be('0x93')](_0xa8be('0x94'),_0xfc40e8);_0x3d453d=[];_0x2a7336=Object['assign']([],_0xfc40e8);_[_0xa8be('0x95')](_0x2a7336,function(_0x4f60e2){return!_0x110418[_0xa8be('0x96')](_0x4f60e2[_0xa8be('0x22')]);});_0x2a7336[_0xa8be('0x97')](function(_0x2bbcac){var _0x568f0b=createFieldObject(_0x23b1df,_0x99b34a,_0x2bbcac[_0xa8be('0x98')],_0x2bbcac[_0xa8be('0x22')],_0x2bbcac[_0xa8be('0x99')],![]);_0x3d453d[_0xa8be('0x9a')](_0x568f0b);});return Promise[_0xa8be('0x9b')](_0x3d453d);})[_0xa8be('0x37')](function(_0xb31320){_0x4b3c85=_0xb31320;_0x599871=Object[_0xa8be('0x9c')]([],_0xfc40e8);console[_0xa8be('0x93')]('TCL:\x20_object',_0xfc40e8);_[_0xa8be('0x95')](_0x599871,function(_0x5cb9c5){return _0x3c04c0[_0xa8be('0x96')](_0x5cb9c5[_0xa8be('0x22')]);});console[_0xa8be('0x93')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x599871);_0x3d453d=[];_0x599871[_0xa8be('0x97')](function(_0x4496e0){var _0x24b814=createFieldObject(_0x23b1df,_0x99b34a,_0x4496e0[_0xa8be('0x98')],_0x4496e0[_0xa8be('0x22')],_0x4496e0[_0xa8be('0x99')],!![]);_0x3d453d[_0xa8be('0x9a')](_0x24b814);});return Promise['all'](_0x3d453d);})[_0xa8be('0x37')](function(_0x5d01cf){_0x214e2c=_0x5d01cf;var _0x435acd=_0x4b3c85[_0xa8be('0x9d')](_0x214e2c);return{'count':_0x435acd[_0xa8be('0x2c')],'rows':_0x435acd};})['then'](respondWithResult(_0x462bfd,null))[_0xa8be('0x3b')](function(_0x42d990){console['log'](_0xa8be('0x9e')+_0x42d990);var _0x397589=_0x20f8e4[_0xa8be('0x27')]['test']?0x1f4:_0x42d990['statusCode']||0x1f4;logger[_0xa8be('0x21')](_0x42d990[_0xa8be('0x9f')]);delete _0x42d990[_0xa8be('0x22')];if(_0x397589===0x191){_0x397589=0x190;}_0x462bfd[_0xa8be('0x16')](_0x397589)[_0xa8be('0xa0')](_0x20f8e4[_0xa8be('0x27')][_0xa8be('0xa1')]?{'message':_0xa8be('0xa2'),'statusCode':_0x42d990['statusCode']}:_0x42d990);});};function createFieldObject(_0x34f90f,_0x51ac7a,_0x1e413b,_0x26dbbd,_0x46e1b4,_0x4bc1b8){return new Promise(function(_0x29f34d,_0xa09877){var _0x1baf55={'id':_0x26dbbd,'name':_0x46e1b4,'custom':_0x4bc1b8};if(_0x1e413b===_0xa8be('0xa3')){_0x1baf55[_0xa8be('0x36')]=[{'name':_0xa8be('0xa4'),'value':'true'},{'name':_0xa8be('0xa5'),'value':_0xa8be('0xa6')}];_0x29f34d(_0x1baf55);}else{var _0x2739d0={'method':_0xa8be('0x91'),'uri':_0x34f90f+_0xa8be('0xa7')+_0x26dbbd,'auth':_0x51ac7a,'json':!![]};return rp(_0x2739d0)[_0xa8be('0x37')](function(_0x3ea1a0){var _0x460c44=[];if(_0x3ea1a0[_0xa8be('0x92')]['length']>0x0){_0x3ea1a0[_0xa8be('0x92')][_0xa8be('0x97')](function(_0x45cc31){if(_0x45cc31[_0xa8be('0xa8')]===_0xa8be('0xa6')){var _0x49d652={'name':_0x45cc31[_0xa8be('0x99')],'value':_0x45cc31[_0xa8be('0xa9')]};_0x460c44[_0xa8be('0x9a')](_0x49d652);}});}_0x1baf55[_0xa8be('0x36')]=_0x460c44;if(_0x1baf55[_0xa8be('0x36')][_0xa8be('0x2c')]>0x0){_0x29f34d(_0x1baf55);}else{if(_0x4bc1b8==![]){_0x29f34d();}else{_0x29f34d(_0x1baf55);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 13f37d6..64a3fde 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 _0x2675=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','moment','bluebird'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x2675,0x75));var _0x5267=function(_0xb846d9,_0x56bc0e){_0xb846d9=_0xb846d9-0x0;var _0x4d5c17=_0x2675[_0xb846d9];return _0x4d5c17;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));var integrations=require(_0x5267('0x6'));module[_0x5267('0x7')]=function(_0x10f92c,_0x20f065){return _0x10f92c[_0x5267('0x8')]('ServicenowAccount',attributes,{'tableName':_0x5267('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x5df61d,_0x158640){var _0x24cc4c=function(_0x2de006){while(--_0x2de006){_0x5df61d['push'](_0x5df61d['shift']());}};_0x24cc4c(++_0x158640);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3a93b7,_0x658183){_0x3a93b7=_0x3a93b7-0x0;var _0x2ed891=_0xf2ca[_0x3a93b7];return _0x2ed891;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xaf2c('0x9'));module[_0xaf2c('0xa')]=function(_0x297740,_0x1f9531){return _0x297740['define'](_0xaf2c('0xb'),attributes,{'tableName':_0xaf2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index c98c180..37042cf 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 _0xc4b7=['find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','model','map','then','ShowServicenowAccount'];(function(_0x3fdcdf,_0x555d97){var _0x2965c3=function(_0x451683){while(--_0x451683){_0x3fdcdf['push'](_0x3fdcdf['shift']());}};_0x2965c3(++_0x555d97);}(_0xc4b7,0x129));var _0x7c4b=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xc4b7[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x7c4b('0x0'));var util=require(_0x7c4b('0x1'));var moment=require(_0x7c4b('0x2'));var BPromise=require(_0x7c4b('0x3'));var rs=require(_0x7c4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c4b('0x5'))['db'];var utils=require(_0x7c4b('0x6'));var logger=require(_0x7c4b('0x7'))('rpc');var config=require(_0x7c4b('0x8'));var jayson=require(_0x7c4b('0x9'));var client=jayson[_0x7c4b('0xa')][_0x7c4b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec983,_0xbe20af,_0x2cb7ea){return new BPromise(function(_0x293e67,_0x4c0e0f){return client[_0x7c4b('0xc')](_0x3ec983,_0x2cb7ea)['then'](function(_0x546838){logger[_0x7c4b('0xd')](_0x7c4b('0xe'),_0xbe20af,_0x7c4b('0xf'));logger[_0x7c4b('0x10')](_0x7c4b('0x11'),_0xbe20af,_0x7c4b('0xf'),JSON[_0x7c4b('0x12')](_0x546838));if(_0x546838[_0x7c4b('0x13')]){if(_0x546838[_0x7c4b('0x13')][_0x7c4b('0x14')]===0x1f4){logger['error'](_0x7c4b('0xe'),_0xbe20af,_0x546838[_0x7c4b('0x13')][_0x7c4b('0x15')]);return _0x4c0e0f(_0x546838['error'][_0x7c4b('0x15')]);}logger[_0x7c4b('0x13')](_0x7c4b('0xe'),_0xbe20af,_0x546838['error'][_0x7c4b('0x15')]);return _0x293e67(_0x546838[_0x7c4b('0x13')]['message']);}else{logger[_0x7c4b('0xd')](_0x7c4b('0xe'),_0xbe20af,'request\x20sent');_0x293e67(_0x546838[_0x7c4b('0x16')][_0x7c4b('0x15')]);}})[_0x7c4b('0x17')](function(_0x2ae890){logger['error'](_0x7c4b('0xe'),_0xbe20af,_0x2ae890);_0x4c0e0f(_0x2ae890);});});}exports[_0x7c4b('0x18')]=function(_0x487549){var _0x5882b5=this;return new Promise(function(_0x31249f,_0x40108f){return db[_0x7c4b('0x19')][_0x7c4b('0x1a')]({'raw':_0x487549['options']?_0x487549[_0x7c4b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x487549[_0x7c4b('0x1b')]?_0x487549[_0x7c4b('0x1b')][_0x7c4b('0x1c')]||null:null,'attributes':_0x487549[_0x7c4b('0x1b')]?_0x487549[_0x7c4b('0x1b')][_0x7c4b('0x1d')]||null:null,'limit':_0x487549['options']?_0x487549[_0x7c4b('0x1b')][_0x7c4b('0x1e')]||null:null,'include':_0x487549['options']?_0x487549[_0x7c4b('0x1b')]['include']?_['map'](_0x487549[_0x7c4b('0x1b')][_0x7c4b('0x1f')],function(_0x158c79){return{'model':db[_0x158c79[_0x7c4b('0x20')]],'as':_0x158c79['as'],'attributes':_0x158c79[_0x7c4b('0x1d')],'include':_0x158c79['include']?_[_0x7c4b('0x21')](_0x158c79['include'],function(_0x54f470){return{'model':db[_0x54f470[_0x7c4b('0x20')]],'as':_0x54f470['as'],'attributes':_0x54f470['attributes'],'include':_0x54f470[_0x7c4b('0x1f')]?_[_0x7c4b('0x21')](_0x54f470[_0x7c4b('0x1f')],function(_0x54715e){return{'model':db[_0x54715e[_0x7c4b('0x20')]],'as':_0x54715e['as'],'attributes':_0x54715e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c4b('0x22')](function(_0x39625d){logger[_0x7c4b('0xd')](_0x7c4b('0x18'),_0x487549);logger[_0x7c4b('0x10')](_0x7c4b('0x18'),_0x487549,JSON[_0x7c4b('0x12')](_0x39625d));_0x31249f(_0x39625d);})[_0x7c4b('0x17')](function(_0x3e40d0){logger[_0x7c4b('0x13')]('GetServicenowAccount',_0x3e40d0[_0x7c4b('0x15')],_0x487549);_0x40108f(_0x5882b5[_0x7c4b('0x13')](0x1f4,_0x3e40d0[_0x7c4b('0x15')]));});});};exports[_0x7c4b('0x23')]=function(_0x3c915a){var _0x5df9f6=this;return new Promise(function(_0x26724e,_0x4a603c){return db[_0x7c4b('0x19')][_0x7c4b('0x24')]({'raw':_0x3c915a[_0x7c4b('0x1b')]?_0x3c915a[_0x7c4b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3c915a[_0x7c4b('0x1b')]?_0x3c915a['options'][_0x7c4b('0x1c')]||null:null,'attributes':_0x3c915a[_0x7c4b('0x1b')]?_0x3c915a[_0x7c4b('0x1b')][_0x7c4b('0x1d')]||null:null,'include':_0x3c915a[_0x7c4b('0x1b')]?_0x3c915a['options'][_0x7c4b('0x1f')]?_[_0x7c4b('0x21')](_0x3c915a[_0x7c4b('0x1b')]['include'],function(_0x283c62){return{'model':db[_0x283c62[_0x7c4b('0x20')]],'as':_0x283c62['as'],'attributes':_0x283c62[_0x7c4b('0x1d')],'include':_0x283c62['include']?_[_0x7c4b('0x21')](_0x283c62['include'],function(_0x312d7b){return{'model':db[_0x312d7b[_0x7c4b('0x20')]],'as':_0x312d7b['as'],'attributes':_0x312d7b['attributes'],'include':_0x312d7b[_0x7c4b('0x1f')]?_[_0x7c4b('0x21')](_0x312d7b['include'],function(_0xc5bdd7){return{'model':db[_0xc5bdd7['model']],'as':_0xc5bdd7['as'],'attributes':_0xc5bdd7[_0x7c4b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x183ff3){logger[_0x7c4b('0xd')](_0x7c4b('0x23'),_0x3c915a);logger[_0x7c4b('0x10')]('ShowServicenowAccount',_0x3c915a,JSON['stringify'](_0x183ff3));_0x26724e(_0x183ff3);})[_0x7c4b('0x17')](function(_0x2d6e2e){logger[_0x7c4b('0x13')](_0x7c4b('0x23'),_0x2d6e2e[_0x7c4b('0x15')],_0x3c915a);_0x4a603c(_0x5df9f6[_0x7c4b('0x13')](0x1f4,_0x2d6e2e[_0x7c4b('0x15')]));});});}; \ No newline at end of file +var _0x1f1c=['ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetServicenowAccount','options','raw','where','attributes','include','map','model','stringify','catch','ShowServicenowAccount','ServicenowAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x50dba9,_0x2fe5f7){var _0x37a156=function(_0x31e2e0){while(--_0x31e2e0){_0x50dba9['push'](_0x50dba9['shift']());}};_0x37a156(++_0x2fe5f7);}(_0x1f1c,0x17d));var _0xc1f1=function(_0x578b37,_0x44ee2a){_0x578b37=_0x578b37-0x0;var _0x1efcf5=_0x1f1c[_0x578b37];return _0x1efcf5;};'use strict';var _=require(_0xc1f1('0x0'));var util=require(_0xc1f1('0x1'));var moment=require(_0xc1f1('0x2'));var BPromise=require(_0xc1f1('0x3'));var rs=require(_0xc1f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1f1('0x5'))['db'];var utils=require(_0xc1f1('0x6'));var logger=require(_0xc1f1('0x7'))(_0xc1f1('0x8'));var config=require(_0xc1f1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc1f1('0xa')][_0xc1f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2de682,_0x2928c0,_0x3758b5){return new BPromise(function(_0x10f16d,_0x5e1b2e){return client[_0xc1f1('0xc')](_0x2de682,_0x3758b5)[_0xc1f1('0xd')](function(_0x4173ab){logger[_0xc1f1('0xe')](_0xc1f1('0xf'),_0x2928c0,'request\x20sent');logger[_0xc1f1('0x10')](_0xc1f1('0x11'),_0x2928c0,_0xc1f1('0x12'),JSON['stringify'](_0x4173ab));if(_0x4173ab['error']){if(_0x4173ab[_0xc1f1('0x13')][_0xc1f1('0x14')]===0x1f4){logger[_0xc1f1('0x13')](_0xc1f1('0xf'),_0x2928c0,_0x4173ab[_0xc1f1('0x13')][_0xc1f1('0x15')]);return _0x5e1b2e(_0x4173ab[_0xc1f1('0x13')][_0xc1f1('0x15')]);}logger['error'](_0xc1f1('0xf'),_0x2928c0,_0x4173ab['error'][_0xc1f1('0x15')]);return _0x10f16d(_0x4173ab[_0xc1f1('0x13')]['message']);}else{logger[_0xc1f1('0xe')](_0xc1f1('0xf'),_0x2928c0,_0xc1f1('0x12'));_0x10f16d(_0x4173ab[_0xc1f1('0x16')][_0xc1f1('0x15')]);}})['catch'](function(_0x529e54){logger[_0xc1f1('0x13')](_0xc1f1('0xf'),_0x2928c0,_0x529e54);_0x5e1b2e(_0x529e54);});});}exports[_0xc1f1('0x17')]=function(_0x42094c){var _0x53b2de=this;return new Promise(function(_0x1b41a0,_0x9feaea){return db['ServicenowAccount']['findAll']({'raw':_0x42094c[_0xc1f1('0x18')]?_0x42094c['options'][_0xc1f1('0x19')]===undefined?!![]:![]:!![],'where':_0x42094c[_0xc1f1('0x18')]?_0x42094c[_0xc1f1('0x18')][_0xc1f1('0x1a')]||null:null,'attributes':_0x42094c[_0xc1f1('0x18')]?_0x42094c['options'][_0xc1f1('0x1b')]||null:null,'limit':_0x42094c[_0xc1f1('0x18')]?_0x42094c[_0xc1f1('0x18')]['limit']||null:null,'include':_0x42094c[_0xc1f1('0x18')]?_0x42094c['options'][_0xc1f1('0x1c')]?_[_0xc1f1('0x1d')](_0x42094c[_0xc1f1('0x18')][_0xc1f1('0x1c')],function(_0x219df0){return{'model':db[_0x219df0[_0xc1f1('0x1e')]],'as':_0x219df0['as'],'attributes':_0x219df0['attributes'],'include':_0x219df0[_0xc1f1('0x1c')]?_[_0xc1f1('0x1d')](_0x219df0[_0xc1f1('0x1c')],function(_0x189a42){return{'model':db[_0x189a42[_0xc1f1('0x1e')]],'as':_0x189a42['as'],'attributes':_0x189a42[_0xc1f1('0x1b')],'include':_0x189a42[_0xc1f1('0x1c')]?_[_0xc1f1('0x1d')](_0x189a42[_0xc1f1('0x1c')],function(_0x45cc24){return{'model':db[_0x45cc24[_0xc1f1('0x1e')]],'as':_0x45cc24['as'],'attributes':_0x45cc24[_0xc1f1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc1f1('0xd')](function(_0x45e595){logger[_0xc1f1('0xe')](_0xc1f1('0x17'),_0x42094c);logger['debug'](_0xc1f1('0x17'),_0x42094c,JSON[_0xc1f1('0x1f')](_0x45e595));_0x1b41a0(_0x45e595);})[_0xc1f1('0x20')](function(_0x1030c8){logger[_0xc1f1('0x13')]('GetServicenowAccount',_0x1030c8[_0xc1f1('0x15')],_0x42094c);_0x9feaea(_0x53b2de[_0xc1f1('0x13')](0x1f4,_0x1030c8[_0xc1f1('0x15')]));});});};exports[_0xc1f1('0x21')]=function(_0x5dec90){var _0x3d1d41=this;return new Promise(function(_0x12e1fa,_0x5f5963){return db[_0xc1f1('0x22')][_0xc1f1('0x23')]({'raw':_0x5dec90[_0xc1f1('0x18')]?_0x5dec90[_0xc1f1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5dec90[_0xc1f1('0x18')]?_0x5dec90[_0xc1f1('0x18')]['where']||null:null,'attributes':_0x5dec90[_0xc1f1('0x18')]?_0x5dec90[_0xc1f1('0x18')][_0xc1f1('0x1b')]||null:null,'include':_0x5dec90['options']?_0x5dec90['options'][_0xc1f1('0x1c')]?_[_0xc1f1('0x1d')](_0x5dec90[_0xc1f1('0x18')][_0xc1f1('0x1c')],function(_0xf80d52){return{'model':db[_0xf80d52[_0xc1f1('0x1e')]],'as':_0xf80d52['as'],'attributes':_0xf80d52[_0xc1f1('0x1b')],'include':_0xf80d52['include']?_[_0xc1f1('0x1d')](_0xf80d52[_0xc1f1('0x1c')],function(_0x59c4bf){return{'model':db[_0x59c4bf[_0xc1f1('0x1e')]],'as':_0x59c4bf['as'],'attributes':_0x59c4bf[_0xc1f1('0x1b')],'include':_0x59c4bf[_0xc1f1('0x1c')]?_['map'](_0x59c4bf[_0xc1f1('0x1c')],function(_0x22910e){return{'model':db[_0x22910e['model']],'as':_0x22910e['as'],'attributes':_0x22910e[_0xc1f1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fbfca){logger[_0xc1f1('0xe')](_0xc1f1('0x21'),_0x5dec90);logger[_0xc1f1('0x10')]('ShowServicenowAccount',_0x5dec90,JSON[_0xc1f1('0x1f')](_0x4fbfca));_0x12e1fa(_0x4fbfca);})[_0xc1f1('0x20')](function(_0x8cd1bb){logger[_0xc1f1('0x13')](_0xc1f1('0x21'),_0x8cd1bb['message'],_0x5dec90);_0x5f5963(_0x3d1d41[_0xc1f1('0x13')](0x1f4,_0x8cd1bb[_0xc1f1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 2e49955..bbc790c 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 _0xcc2e=['put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xcc2e,0xf6));var _0xecc2=function(_0x13bdb6,_0x5062d7){_0x13bdb6=_0x13bdb6-0x0;var _0x48883c=_0xcc2e[_0x13bdb6];return _0x48883c;};'use strict';var multer=require(_0xecc2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xecc2('0x1'));var express=require(_0xecc2('0x2'));var router=express[_0xecc2('0x3')]();var fs_extra=require(_0xecc2('0x4'));var auth=require(_0xecc2('0x5'));var interaction=require(_0xecc2('0x6'));var config=require(_0xecc2('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xecc2('0x8')]('/',auth[_0xecc2('0x9')](),controller[_0xecc2('0xa')]);router[_0xecc2('0x8')](_0xecc2('0xb'),auth[_0xecc2('0x9')](),controller['show']);router['get']('/:id/fields',auth[_0xecc2('0x9')](),controller[_0xecc2('0xc')]);router[_0xecc2('0x8')](_0xecc2('0xd'),auth[_0xecc2('0x9')](),controller[_0xecc2('0xe')]);router[_0xecc2('0x8')](_0xecc2('0xf'),auth['isAuthenticated'](),controller[_0xecc2('0x10')]);router['post']('/',auth[_0xecc2('0x9')](),controller[_0xecc2('0x11')]);router[_0xecc2('0x12')](_0xecc2('0xb'),auth[_0xecc2('0x9')](),controller[_0xecc2('0x13')]);router['delete']('/:id',auth[_0xecc2('0x9')](),controller[_0xecc2('0x14')]);module[_0xecc2('0x15')]=router; \ No newline at end of file +var _0x8cd3=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','create','update'];(function(_0x152a89,_0x213455){var _0x47f1cb=function(_0x4d554e){while(--_0x4d554e){_0x152a89['push'](_0x152a89['shift']());}};_0x47f1cb(++_0x213455);}(_0x8cd3,0x1cf));var _0x38cd=function(_0x16b266,_0x3699e7){_0x16b266=_0x16b266-0x0;var _0x246e06=_0x8cd3[_0x16b266];return _0x246e06;};'use strict';var multer=require(_0x38cd('0x0'));var util=require(_0x38cd('0x1'));var path=require(_0x38cd('0x2'));var timeout=require('connect-timeout');var express=require(_0x38cd('0x3'));var router=express[_0x38cd('0x4')]();var fs_extra=require(_0x38cd('0x5'));var auth=require(_0x38cd('0x6'));var interaction=require(_0x38cd('0x7'));var config=require(_0x38cd('0x8'));var controller=require(_0x38cd('0x9'));router['get']('/',auth[_0x38cd('0xa')](),controller['index']);router[_0x38cd('0xb')](_0x38cd('0xc'),auth['isAuthenticated'](),controller[_0x38cd('0xd')]);router['get'](_0x38cd('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x38cd('0xb')](_0x38cd('0xf'),auth[_0x38cd('0xa')](),controller[_0x38cd('0x10')]);router[_0x38cd('0xb')](_0x38cd('0x11'),auth[_0x38cd('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x38cd('0xa')](),controller[_0x38cd('0x12')]);router['put'](_0x38cd('0xc'),auth[_0x38cd('0xa')](),controller[_0x38cd('0x13')]);router['delete'](_0x38cd('0xc'),auth['isAuthenticated'](),controller[_0x38cd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 1570819..cc38a4c 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 _0x9b25=['STRING'];(function(_0x2498d6,_0x318e3e){var _0x2753d4=function(_0x468b97){while(--_0x468b97){_0x2498d6['push'](_0x2498d6['shift']());}};_0x2753d4(++_0x318e3e);}(_0x9b25,0x6d));var _0x59b2=function(_0x3693cc,_0x193fbb){_0x3693cc=_0x3693cc-0x0;var _0x353025=_0x9b25[_0x3693cc];return _0x353025;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x59b2('0x0')]},'description':{'type':Sequelize[_0x59b2('0x0')]}}; \ No newline at end of file +var _0x345d=['STRING'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x345d,0x7a));var _0xd345=function(_0xe8a81,_0x553451){_0xe8a81=_0xe8a81-0x0;var _0x423a8c=_0x345d[_0xe8a81];return _0x423a8c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd345('0x0')]},'description':{'type':Sequelize[_0xd345('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 1697c9e..3263743 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 _0x8876=['json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','ServicenowConfiguration','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','getFields','findOne','order','pick','getSubjects','ServicenowField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x8876,0x85));var _0x6887=function(_0x52ec1f,_0x1f46ae){_0x52ec1f=_0x52ec1f-0x0;var _0x48766e=_0x8876[_0x52ec1f];return _0x48766e;};'use strict';var emlformat=require(_0x6887('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6887('0x1'));var jsonpatch=require(_0x6887('0x2'));var rp=require(_0x6887('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6887('0x4'));var util=require(_0x6887('0x5'));var path=require(_0x6887('0x6'));var sox=require('sox');var csv=require(_0x6887('0x7'));var ejs=require(_0x6887('0x8'));var fs=require('fs');var fs_extra=require(_0x6887('0x9'));var _=require('lodash');var squel=require(_0x6887('0xa'));var crypto=require(_0x6887('0xb'));var jsforce=require(_0x6887('0xc'));var deskjs=require(_0x6887('0xd'));var toCsv=require(_0x6887('0x7'));var querystring=require(_0x6887('0xe'));var Papa=require(_0x6887('0xf'));var Redis=require('ioredis');var authService=require(_0x6887('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6887('0x11'))(_0x6887('0x12'));var utils=require('../../config/utils');var config=require(_0x6887('0x13'));var licenseUtil=require(_0x6887('0x14'));var db=require(_0x6887('0x15'))['db'];function respondWithStatusCode(_0x35cdd2,_0x5c8de5){_0x5c8de5=_0x5c8de5||0xcc;return function(_0xe0f0ac){if(_0xe0f0ac){return _0x35cdd2[_0x6887('0x16')](_0x5c8de5);}return _0x35cdd2['status'](_0x5c8de5)['end']();};}function respondWithResult(_0x2c3655,_0x207720){_0x207720=_0x207720||0xc8;return function(_0x7b4f48){if(_0x7b4f48){return _0x2c3655['status'](_0x207720)[_0x6887('0x17')](_0x7b4f48);}};}function respondWithFilteredResult(_0x33d15c,_0x4ac007){return function(_0x359748){if(_0x359748){var _0x416ef3=typeof _0x4ac007[_0x6887('0x18')]===_0x6887('0x19')&&typeof _0x4ac007[_0x6887('0x1a')]===_0x6887('0x19');var _0x3a42d8=_0x359748[_0x6887('0x1b')];var _0x5ce375=_0x416ef3?0x0:_0x4ac007[_0x6887('0x18')];var _0x23984d=_0x416ef3?_0x359748[_0x6887('0x1b')]:_0x4ac007[_0x6887('0x18')]+_0x4ac007[_0x6887('0x1a')];var _0x4f432f;if(_0x23984d>=_0x3a42d8){_0x23984d=_0x3a42d8;_0x4f432f=0xc8;}else{_0x4f432f=0xce;}_0x33d15c[_0x6887('0x1c')](_0x4f432f);return _0x33d15c[_0x6887('0x1d')](_0x6887('0x1e'),_0x5ce375+'-'+_0x23984d+'/'+_0x3a42d8)['json'](_0x359748);}return null;};}function patchUpdates(_0x5f11cb){return function(_0x9ae7c0){try{jsonpatch[_0x6887('0x1f')](_0x9ae7c0,_0x5f11cb,!![]);}catch(_0x339c4f){return BPromise[_0x6887('0x20')](_0x339c4f);}return _0x9ae7c0[_0x6887('0x21')]();};}function saveUpdates(_0x3d406c,_0x398cce){return function(_0x2bdfc8){if(_0x2bdfc8){return _0x2bdfc8['update'](_0x3d406c)[_0x6887('0x22')](function(_0x4f3369){return _0x4f3369;});}return null;};}function removeEntity(_0x48903b,_0x27e57d){return function(_0x589074){if(_0x589074){return _0x589074['destroy']()[_0x6887('0x22')](function(){_0x48903b[_0x6887('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d2a36,_0x5f18e2){return function(_0x38d534){if(!_0x38d534){_0x3d2a36['sendStatus'](0x194);}return _0x38d534;};}function handleError(_0xa913b6,_0x356888){_0x356888=_0x356888||0x1f4;return function(_0x43b8fa){logger[_0x6887('0x23')](_0x43b8fa[_0x6887('0x24')]);if(_0x43b8fa[_0x6887('0x25')]){delete _0x43b8fa[_0x6887('0x25')];}_0xa913b6[_0x6887('0x1c')](_0x356888)[_0x6887('0x26')](_0x43b8fa);};}exports[_0x6887('0x27')]=function(_0x2af680,_0x18e715){var _0x16140b={},_0x4ba3e8={},_0x75d32a={'count':0x0,'rows':[]};var _0x5277ae=_[_0x6887('0x28')](db['ServicenowConfiguration']['rawAttributes'],function(_0x2c508b){return{'name':_0x2c508b[_0x6887('0x29')],'type':_0x2c508b[_0x6887('0x2a')][_0x6887('0x2b')]};});_0x4ba3e8[_0x6887('0x2c')]=_[_0x6887('0x28')](_0x5277ae,_0x6887('0x25'));_0x4ba3e8[_0x6887('0x2d')]=_[_0x6887('0x2e')](_0x2af680['query']);_0x4ba3e8[_0x6887('0x2f')]=_[_0x6887('0x30')](_0x4ba3e8['model'],_0x4ba3e8[_0x6887('0x2d')]);_0x16140b[_0x6887('0x31')]=_[_0x6887('0x30')](_0x4ba3e8['model'],qs['fields'](_0x2af680['query'][_0x6887('0x32')]));_0x16140b['attributes']=_0x16140b[_0x6887('0x31')][_0x6887('0x33')]?_0x16140b[_0x6887('0x31')]:_0x4ba3e8[_0x6887('0x2c')];if(!_0x2af680[_0x6887('0x2d')][_0x6887('0x34')](_0x6887('0x35'))){_0x16140b[_0x6887('0x1a')]=qs['limit'](_0x2af680[_0x6887('0x2d')][_0x6887('0x1a')]);_0x16140b['offset']=qs[_0x6887('0x18')](_0x2af680[_0x6887('0x2d')]['offset']);}_0x16140b['order']=qs[_0x6887('0x36')](_0x2af680['query']['sort']);_0x16140b[_0x6887('0x37')]=qs[_0x6887('0x2f')](_['pick'](_0x2af680[_0x6887('0x2d')],_0x4ba3e8[_0x6887('0x2f')]),_0x5277ae);if(_0x2af680[_0x6887('0x2d')][_0x6887('0x38')]){_0x16140b[_0x6887('0x37')]=_[_0x6887('0x39')](_0x16140b[_0x6887('0x37')],{'$or':_[_0x6887('0x28')](_0x5277ae,function(_0x566bb5){if(_0x566bb5[_0x6887('0x2a')]!=='VIRTUAL'){var _0x14bc65={};_0x14bc65[_0x566bb5[_0x6887('0x25')]]={'$like':'%'+_0x2af680[_0x6887('0x2d')]['filter']+'%'};return _0x14bc65;}})});}_0x16140b=_[_0x6887('0x39')]({},_0x16140b,_0x2af680[_0x6887('0x3a')]);var _0x45976e={'where':_0x16140b[_0x6887('0x37')]};return db[_0x6887('0x3b')]['count'](_0x45976e)[_0x6887('0x22')](function(_0x1fcdf6){_0x75d32a[_0x6887('0x1b')]=_0x1fcdf6;if(_0x2af680[_0x6887('0x2d')][_0x6887('0x3c')]){_0x16140b[_0x6887('0x3d')]=[{'all':!![]}];}return db[_0x6887('0x3b')][_0x6887('0x3e')](_0x16140b);})[_0x6887('0x22')](function(_0x5ab131){_0x75d32a[_0x6887('0x3f')]=_0x5ab131;return _0x75d32a;})[_0x6887('0x22')](respondWithFilteredResult(_0x18e715,_0x16140b))[_0x6887('0x40')](handleError(_0x18e715,null));};exports['show']=function(_0xc3590a,_0x3cd4ef){var _0x29128f={'raw':![],'where':{'id':_0xc3590a[_0x6887('0x41')]['id']}},_0x5111bc={};_0x5111bc['model']=_[_0x6887('0x2e')](db['ServicenowConfiguration'][_0x6887('0x42')]);_0x5111bc['query']=_[_0x6887('0x2e')](_0xc3590a[_0x6887('0x2d')]);_0x5111bc['filters']=_[_0x6887('0x30')](_0x5111bc[_0x6887('0x2c')],_0x5111bc[_0x6887('0x2d')]);_0x29128f[_0x6887('0x31')]=_[_0x6887('0x30')](_0x5111bc[_0x6887('0x2c')],qs[_0x6887('0x32')](_0xc3590a[_0x6887('0x2d')][_0x6887('0x32')]));_0x29128f[_0x6887('0x31')]=_0x29128f[_0x6887('0x31')][_0x6887('0x33')]?_0x29128f[_0x6887('0x31')]:_0x5111bc[_0x6887('0x2c')];if(_0xc3590a[_0x6887('0x2d')][_0x6887('0x3c')]){_0x29128f[_0x6887('0x3d')]=[{'all':!![]}];}_0x29128f=_[_0x6887('0x39')]({},_0x29128f,_0xc3590a[_0x6887('0x3a')]);return db[_0x6887('0x3b')][_0x6887('0x43')](_0x29128f)[_0x6887('0x22')](handleEntityNotFound(_0x3cd4ef,null))['then'](respondWithResult(_0x3cd4ef,null))[_0x6887('0x40')](handleError(_0x3cd4ef,null));};exports[_0x6887('0x44')]=function(_0x534f61,_0x3646b4){return db[_0x6887('0x3b')][_0x6887('0x44')](_0x534f61[_0x6887('0x45')],{})['then'](respondWithResult(_0x3646b4,0xc9))['catch'](handleError(_0x3646b4,null));};exports['update']=function(_0x5683b3,_0x87e327){if(_0x5683b3[_0x6887('0x45')]['id']){delete _0x5683b3[_0x6887('0x45')]['id'];}return db['ServicenowConfiguration'][_0x6887('0x43')]({'where':{'id':_0x5683b3[_0x6887('0x41')]['id']}})[_0x6887('0x22')](handleEntityNotFound(_0x87e327,null))['then'](saveUpdates(_0x5683b3[_0x6887('0x45')],null))[_0x6887('0x22')](respondWithResult(_0x87e327,null))[_0x6887('0x40')](handleError(_0x87e327,null));};exports[_0x6887('0x46')]=function(_0x86415a,_0x2699b2){return db[_0x6887('0x3b')]['find']({'where':{'id':_0x86415a[_0x6887('0x41')]['id']}})[_0x6887('0x22')](handleEntityNotFound(_0x2699b2,null))['then'](removeEntity(_0x2699b2,null))[_0x6887('0x40')](handleError(_0x2699b2,null));};exports[_0x6887('0x47')]=function(_0x26d9a2,_0x1564c5,_0x517c85){var _0x428a13={};var _0x495141={};var _0x337791;var _0x49cfb4;return db[_0x6887('0x3b')][_0x6887('0x48')]({'where':{'id':_0x26d9a2[_0x6887('0x41')]['id']}})[_0x6887('0x22')](handleEntityNotFound(_0x1564c5,null))[_0x6887('0x22')](function(_0xbbec26){if(_0xbbec26){_0x337791=_0xbbec26;_0x495141[_0x6887('0x2c')]=_[_0x6887('0x2e')](db['ServicenowField']['rawAttributes']);_0x495141[_0x6887('0x2d')]=_[_0x6887('0x2e')](_0x26d9a2['query']);_0x495141[_0x6887('0x2f')]=_['intersection'](_0x495141[_0x6887('0x2c')],_0x495141[_0x6887('0x2d')]);_0x428a13['attributes']=_['intersection'](_0x495141[_0x6887('0x2c')],qs[_0x6887('0x32')](_0x26d9a2[_0x6887('0x2d')][_0x6887('0x32')]));_0x428a13[_0x6887('0x31')]=_0x428a13[_0x6887('0x31')][_0x6887('0x33')]?_0x428a13[_0x6887('0x31')]:_0x495141['model'];_0x428a13[_0x6887('0x49')]=qs[_0x6887('0x36')](_0x26d9a2[_0x6887('0x2d')][_0x6887('0x36')]);_0x428a13[_0x6887('0x37')]=qs[_0x6887('0x2f')](_[_0x6887('0x4a')](_0x26d9a2['query'],_0x495141[_0x6887('0x2f')]));if(_0x26d9a2[_0x6887('0x2d')][_0x6887('0x38')]){_0x428a13[_0x6887('0x37')]=_[_0x6887('0x39')](_0x428a13[_0x6887('0x37')],{'$or':_[_0x6887('0x28')](_0x428a13[_0x6887('0x31')],function(_0x575d59){var _0x1087f1={};_0x1087f1[_0x575d59]={'$like':'%'+_0x26d9a2[_0x6887('0x2d')][_0x6887('0x38')]+'%'};return _0x1087f1;})});}_0x428a13=_[_0x6887('0x39')]({},_0x428a13,_0x26d9a2['options']);return _0x337791['getFields'](_0x428a13);}})['then'](function(_0x14ad32){if(_0x14ad32){_0x49cfb4=_0x14ad32['length'];if(!_0x26d9a2[_0x6887('0x2d')]['hasOwnProperty']('nolimit')){_0x428a13[_0x6887('0x1a')]=qs[_0x6887('0x1a')](_0x26d9a2[_0x6887('0x2d')]['limit']);_0x428a13['offset']=qs['offset'](_0x26d9a2[_0x6887('0x2d')][_0x6887('0x18')]);}return _0x337791[_0x6887('0x47')](_0x428a13);}})['then'](function(_0x142561){if(_0x142561){return _0x142561?{'count':_0x49cfb4,'rows':_0x142561}:null;}})[_0x6887('0x22')](respondWithResult(_0x1564c5,null))[_0x6887('0x40')](handleError(_0x1564c5,null));};exports[_0x6887('0x4b')]=function(_0x569123,_0x5906f1,_0x6b1736){var _0x58004e={};var _0x2bb24c={};var _0x3eefdd;var _0x2672af;return db[_0x6887('0x3b')][_0x6887('0x48')]({'where':{'id':_0x569123[_0x6887('0x41')]['id']}})[_0x6887('0x22')](handleEntityNotFound(_0x5906f1,null))[_0x6887('0x22')](function(_0x5cf074){if(_0x5cf074){_0x3eefdd=_0x5cf074;_0x2bb24c['model']=_[_0x6887('0x2e')](db[_0x6887('0x4c')][_0x6887('0x42')]);_0x2bb24c[_0x6887('0x2d')]=_[_0x6887('0x2e')](_0x569123['query']);_0x2bb24c[_0x6887('0x2f')]=_[_0x6887('0x30')](_0x2bb24c['model'],_0x2bb24c[_0x6887('0x2d')]);_0x58004e['attributes']=_[_0x6887('0x30')](_0x2bb24c[_0x6887('0x2c')],qs[_0x6887('0x32')](_0x569123['query'][_0x6887('0x32')]));_0x58004e[_0x6887('0x31')]=_0x58004e[_0x6887('0x31')][_0x6887('0x33')]?_0x58004e['attributes']:_0x2bb24c[_0x6887('0x2c')];_0x58004e[_0x6887('0x49')]=qs[_0x6887('0x36')](_0x569123[_0x6887('0x2d')]['sort']);_0x58004e[_0x6887('0x37')]=qs[_0x6887('0x2f')](_['pick'](_0x569123[_0x6887('0x2d')],_0x2bb24c[_0x6887('0x2f')]));if(_0x569123[_0x6887('0x2d')][_0x6887('0x38')]){_0x58004e[_0x6887('0x37')]=_[_0x6887('0x39')](_0x58004e[_0x6887('0x37')],{'$or':_['map'](_0x58004e[_0x6887('0x31')],function(_0x3bb276){var _0x1af003={};_0x1af003[_0x3bb276]={'$like':'%'+_0x569123[_0x6887('0x2d')]['filter']+'%'};return _0x1af003;})});}_0x58004e=_[_0x6887('0x39')]({},_0x58004e,_0x569123[_0x6887('0x3a')]);return _0x3eefdd[_0x6887('0x4b')](_0x58004e);}})[_0x6887('0x22')](function(_0x4de806){if(_0x4de806){_0x2672af=_0x4de806[_0x6887('0x33')];if(!_0x569123[_0x6887('0x2d')][_0x6887('0x34')]('nolimit')){_0x58004e[_0x6887('0x1a')]=qs[_0x6887('0x1a')](_0x569123['query'][_0x6887('0x1a')]);_0x58004e[_0x6887('0x18')]=qs[_0x6887('0x18')](_0x569123[_0x6887('0x2d')][_0x6887('0x18')]);}return _0x3eefdd['getSubjects'](_0x58004e);}})['then'](function(_0x315f01){if(_0x315f01){return _0x315f01?{'count':_0x2672af,'rows':_0x315f01}:null;}})[_0x6887('0x22')](respondWithResult(_0x5906f1,null))[_0x6887('0x40')](handleError(_0x5906f1,null));};exports[_0x6887('0x4d')]=function(_0xe2d80c,_0x570dbb,_0x25b185){var _0x5edbe4={};var _0x469cea={};var _0x19a8c4;var _0x391ed8;return db['ServicenowConfiguration'][_0x6887('0x48')]({'where':{'id':_0xe2d80c[_0x6887('0x41')]['id']}})[_0x6887('0x22')](handleEntityNotFound(_0x570dbb,null))[_0x6887('0x22')](function(_0x76b36){if(_0x76b36){_0x19a8c4=_0x76b36;_0x469cea[_0x6887('0x2c')]=_[_0x6887('0x2e')](db[_0x6887('0x4c')][_0x6887('0x42')]);_0x469cea[_0x6887('0x2d')]=_[_0x6887('0x2e')](_0xe2d80c[_0x6887('0x2d')]);_0x469cea['filters']=_[_0x6887('0x30')](_0x469cea[_0x6887('0x2c')],_0x469cea['query']);_0x5edbe4[_0x6887('0x31')]=_[_0x6887('0x30')](_0x469cea['model'],qs[_0x6887('0x32')](_0xe2d80c[_0x6887('0x2d')][_0x6887('0x32')]));_0x5edbe4[_0x6887('0x31')]=_0x5edbe4[_0x6887('0x31')][_0x6887('0x33')]?_0x5edbe4['attributes']:_0x469cea[_0x6887('0x2c')];_0x5edbe4[_0x6887('0x49')]=qs['sort'](_0xe2d80c[_0x6887('0x2d')][_0x6887('0x36')]);_0x5edbe4[_0x6887('0x37')]=qs['filters'](_[_0x6887('0x4a')](_0xe2d80c['query'],_0x469cea[_0x6887('0x2f')]));if(_0xe2d80c[_0x6887('0x2d')][_0x6887('0x38')]){_0x5edbe4['where']=_['merge'](_0x5edbe4[_0x6887('0x37')],{'$or':_['map'](_0x5edbe4['attributes'],function(_0x47df48){var _0x25977c={};_0x25977c[_0x47df48]={'$like':'%'+_0xe2d80c[_0x6887('0x2d')][_0x6887('0x38')]+'%'};return _0x25977c;})});}_0x5edbe4=_['merge']({},_0x5edbe4,_0xe2d80c[_0x6887('0x3a')]);return _0x19a8c4[_0x6887('0x4d')](_0x5edbe4);}})[_0x6887('0x22')](function(_0xb13c2b){if(_0xb13c2b){_0x391ed8=_0xb13c2b[_0x6887('0x33')];if(!_0xe2d80c[_0x6887('0x2d')][_0x6887('0x34')](_0x6887('0x35'))){_0x5edbe4['limit']=qs['limit'](_0xe2d80c[_0x6887('0x2d')]['limit']);_0x5edbe4['offset']=qs[_0x6887('0x18')](_0xe2d80c[_0x6887('0x2d')][_0x6887('0x18')]);}return _0x19a8c4[_0x6887('0x4d')](_0x5edbe4);}})[_0x6887('0x22')](function(_0x59f670){if(_0x59f670){return _0x59f670?{'count':_0x391ed8,'rows':_0x59f670}:null;}})['then'](respondWithResult(_0x570dbb,null))[_0x6887('0x40')](handleError(_0x570dbb,null));}; \ No newline at end of file +var _0x219b=['nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','keys','query','model','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','filters','intersection','length','includeAll','find','create','body','params','getFields','findOne','ServicenowField','order'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x219b,0xff));var _0xb219=function(_0x5c912e,_0x141294){_0x5c912e=_0x5c912e-0x0;var _0x5d74f4=_0x219b[_0x5c912e];return _0x5d74f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb219('0x0'));var zipdir=require(_0xb219('0x1'));var jsonpatch=require(_0xb219('0x2'));var rp=require(_0xb219('0x3'));var moment=require(_0xb219('0x4'));var BPromise=require(_0xb219('0x5'));var Mustache=require(_0xb219('0x6'));var util=require(_0xb219('0x7'));var path=require(_0xb219('0x8'));var sox=require(_0xb219('0x9'));var csv=require(_0xb219('0xa'));var ejs=require(_0xb219('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb219('0xc'));var squel=require(_0xb219('0xd'));var crypto=require(_0xb219('0xe'));var jsforce=require(_0xb219('0xf'));var deskjs=require(_0xb219('0x10'));var toCsv=require(_0xb219('0xa'));var querystring=require('querystring');var Papa=require(_0xb219('0x11'));var Redis=require(_0xb219('0x12'));var authService=require(_0xb219('0x13'));var qs=require(_0xb219('0x14'));var as=require(_0xb219('0x15'));var hardwareService=require(_0xb219('0x16'));var logger=require('../../config/logger')(_0xb219('0x17'));var utils=require('../../config/utils');var config=require(_0xb219('0x18'));var licenseUtil=require(_0xb219('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40d07b,_0x102417){_0x102417=_0x102417||0xcc;return function(_0x42de66){if(_0x42de66){return _0x40d07b[_0xb219('0x1a')](_0x102417);}return _0x40d07b[_0xb219('0x1b')](_0x102417)['end']();};}function respondWithResult(_0x49f77b,_0xd131b5){_0xd131b5=_0xd131b5||0xc8;return function(_0x3e1d41){if(_0x3e1d41){return _0x49f77b[_0xb219('0x1b')](_0xd131b5)[_0xb219('0x1c')](_0x3e1d41);}};}function respondWithFilteredResult(_0x2e84b9,_0x46ea1d){return function(_0x5679b0){if(_0x5679b0){var _0x5a9fc0=typeof _0x46ea1d['offset']===_0xb219('0x1d')&&typeof _0x46ea1d[_0xb219('0x1e')]===_0xb219('0x1d');var _0x56b388=_0x5679b0[_0xb219('0x1f')];var _0x839e87=_0x5a9fc0?0x0:_0x46ea1d[_0xb219('0x20')];var _0x392b10=_0x5a9fc0?_0x5679b0['count']:_0x46ea1d[_0xb219('0x20')]+_0x46ea1d[_0xb219('0x1e')];var _0x585d95;if(_0x392b10>=_0x56b388){_0x392b10=_0x56b388;_0x585d95=0xc8;}else{_0x585d95=0xce;}_0x2e84b9['status'](_0x585d95);return _0x2e84b9[_0xb219('0x21')](_0xb219('0x22'),_0x839e87+'-'+_0x392b10+'/'+_0x56b388)[_0xb219('0x1c')](_0x5679b0);}return null;};}function patchUpdates(_0x425346){return function(_0x51efe2){try{jsonpatch[_0xb219('0x23')](_0x51efe2,_0x425346,!![]);}catch(_0x489591){return BPromise[_0xb219('0x24')](_0x489591);}return _0x51efe2['save']();};}function saveUpdates(_0x247a08,_0x6c0e37){return function(_0x2840ee){if(_0x2840ee){return _0x2840ee[_0xb219('0x25')](_0x247a08)[_0xb219('0x26')](function(_0x2192ed){return _0x2192ed;});}return null;};}function removeEntity(_0x124c37,_0x4a6832){return function(_0x24e234){if(_0x24e234){return _0x24e234[_0xb219('0x27')]()[_0xb219('0x26')](function(){_0x124c37[_0xb219('0x1b')](0xcc)[_0xb219('0x28')]();});}};}function handleEntityNotFound(_0x1cbcac,_0x110b80){return function(_0x140e93){if(!_0x140e93){_0x1cbcac['sendStatus'](0x194);}return _0x140e93;};}function handleError(_0x6b2fc8,_0x827a91){_0x827a91=_0x827a91||0x1f4;return function(_0x1b6961){logger['error'](_0x1b6961[_0xb219('0x29')]);if(_0x1b6961['name']){delete _0x1b6961[_0xb219('0x2a')];}_0x6b2fc8['status'](_0x827a91)[_0xb219('0x2b')](_0x1b6961);};}exports[_0xb219('0x2c')]=function(_0x59219c,_0x54c4fc){var _0xe77180={},_0x488ee6={},_0x702b97={'count':0x0,'rows':[]};var _0x235f1e=_[_0xb219('0x2d')](db[_0xb219('0x2e')][_0xb219('0x2f')],function(_0x336409){return{'name':_0x336409[_0xb219('0x30')],'type':_0x336409[_0xb219('0x31')][_0xb219('0x32')]};});_0x488ee6['model']=_['map'](_0x235f1e,_0xb219('0x2a'));_0x488ee6['query']=_[_0xb219('0x33')](_0x59219c[_0xb219('0x34')]);_0x488ee6['filters']=_['intersection'](_0x488ee6['model'],_0x488ee6[_0xb219('0x34')]);_0xe77180['attributes']=_['intersection'](_0x488ee6[_0xb219('0x35')],qs[_0xb219('0x36')](_0x59219c[_0xb219('0x34')][_0xb219('0x36')]));_0xe77180[_0xb219('0x37')]=_0xe77180[_0xb219('0x37')]['length']?_0xe77180[_0xb219('0x37')]:_0x488ee6[_0xb219('0x35')];if(!_0x59219c[_0xb219('0x34')][_0xb219('0x38')]('nolimit')){_0xe77180[_0xb219('0x1e')]=qs[_0xb219('0x1e')](_0x59219c[_0xb219('0x34')][_0xb219('0x1e')]);_0xe77180['offset']=qs[_0xb219('0x20')](_0x59219c[_0xb219('0x34')][_0xb219('0x20')]);}_0xe77180['order']=qs[_0xb219('0x39')](_0x59219c[_0xb219('0x34')]['sort']);_0xe77180['where']=qs['filters'](_[_0xb219('0x3a')](_0x59219c[_0xb219('0x34')],_0x488ee6['filters']),_0x235f1e);if(_0x59219c[_0xb219('0x34')][_0xb219('0x3b')]){_0xe77180[_0xb219('0x3c')]=_[_0xb219('0x3d')](_0xe77180[_0xb219('0x3c')],{'$or':_[_0xb219('0x2d')](_0x235f1e,function(_0x2a628b){if(_0x2a628b['type']!==_0xb219('0x3e')){var _0x5a8a6c={};_0x5a8a6c[_0x2a628b['name']]={'$like':'%'+_0x59219c['query']['filter']+'%'};return _0x5a8a6c;}})});}_0xe77180=_[_0xb219('0x3d')]({},_0xe77180,_0x59219c[_0xb219('0x3f')]);var _0x15f951={'where':_0xe77180[_0xb219('0x3c')]};return db[_0xb219('0x2e')][_0xb219('0x1f')](_0x15f951)[_0xb219('0x26')](function(_0x2a0885){_0x702b97[_0xb219('0x1f')]=_0x2a0885;if(_0x59219c[_0xb219('0x34')]['includeAll']){_0xe77180[_0xb219('0x40')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xb219('0x41')](_0xe77180);})[_0xb219('0x26')](function(_0x394233){_0x702b97[_0xb219('0x42')]=_0x394233;return _0x702b97;})['then'](respondWithFilteredResult(_0x54c4fc,_0xe77180))[_0xb219('0x43')](handleError(_0x54c4fc,null));};exports[_0xb219('0x44')]=function(_0x50e7b2,_0x247a49){var _0x1b5268={'raw':![],'where':{'id':_0x50e7b2['params']['id']}},_0x33ba2b={};_0x33ba2b[_0xb219('0x35')]=_[_0xb219('0x33')](db['ServicenowConfiguration']['rawAttributes']);_0x33ba2b['query']=_[_0xb219('0x33')](_0x50e7b2['query']);_0x33ba2b[_0xb219('0x45')]=_[_0xb219('0x46')](_0x33ba2b[_0xb219('0x35')],_0x33ba2b[_0xb219('0x34')]);_0x1b5268[_0xb219('0x37')]=_[_0xb219('0x46')](_0x33ba2b[_0xb219('0x35')],qs['fields'](_0x50e7b2['query'][_0xb219('0x36')]));_0x1b5268[_0xb219('0x37')]=_0x1b5268[_0xb219('0x37')][_0xb219('0x47')]?_0x1b5268[_0xb219('0x37')]:_0x33ba2b['model'];if(_0x50e7b2[_0xb219('0x34')][_0xb219('0x48')]){_0x1b5268[_0xb219('0x40')]=[{'all':!![]}];}_0x1b5268=_[_0xb219('0x3d')]({},_0x1b5268,_0x50e7b2[_0xb219('0x3f')]);return db[_0xb219('0x2e')][_0xb219('0x49')](_0x1b5268)[_0xb219('0x26')](handleEntityNotFound(_0x247a49,null))[_0xb219('0x26')](respondWithResult(_0x247a49,null))[_0xb219('0x43')](handleError(_0x247a49,null));};exports[_0xb219('0x4a')]=function(_0x308d07,_0x47a4ca){return db[_0xb219('0x2e')][_0xb219('0x4a')](_0x308d07[_0xb219('0x4b')],{})['then'](respondWithResult(_0x47a4ca,0xc9))[_0xb219('0x43')](handleError(_0x47a4ca,null));};exports[_0xb219('0x25')]=function(_0x29deb0,_0x20f100){if(_0x29deb0[_0xb219('0x4b')]['id']){delete _0x29deb0[_0xb219('0x4b')]['id'];}return db[_0xb219('0x2e')]['find']({'where':{'id':_0x29deb0[_0xb219('0x4c')]['id']}})[_0xb219('0x26')](handleEntityNotFound(_0x20f100,null))[_0xb219('0x26')](saveUpdates(_0x29deb0[_0xb219('0x4b')],null))['then'](respondWithResult(_0x20f100,null))[_0xb219('0x43')](handleError(_0x20f100,null));};exports['destroy']=function(_0x21e4e1,_0x2e1048){return db[_0xb219('0x2e')]['find']({'where':{'id':_0x21e4e1[_0xb219('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e1048,null))[_0xb219('0x26')](removeEntity(_0x2e1048,null))[_0xb219('0x43')](handleError(_0x2e1048,null));};exports[_0xb219('0x4d')]=function(_0x1abcfb,_0x35eb7f,_0x511676){var _0x2e6d58={};var _0x5b1059={};var _0x5368f4;var _0x2d1fed;return db[_0xb219('0x2e')][_0xb219('0x4e')]({'where':{'id':_0x1abcfb[_0xb219('0x4c')]['id']}})['then'](handleEntityNotFound(_0x35eb7f,null))[_0xb219('0x26')](function(_0x4cff16){if(_0x4cff16){_0x5368f4=_0x4cff16;_0x5b1059['model']=_[_0xb219('0x33')](db[_0xb219('0x4f')][_0xb219('0x2f')]);_0x5b1059[_0xb219('0x34')]=_[_0xb219('0x33')](_0x1abcfb[_0xb219('0x34')]);_0x5b1059[_0xb219('0x45')]=_['intersection'](_0x5b1059['model'],_0x5b1059[_0xb219('0x34')]);_0x2e6d58['attributes']=_['intersection'](_0x5b1059[_0xb219('0x35')],qs[_0xb219('0x36')](_0x1abcfb[_0xb219('0x34')]['fields']));_0x2e6d58[_0xb219('0x37')]=_0x2e6d58[_0xb219('0x37')][_0xb219('0x47')]?_0x2e6d58['attributes']:_0x5b1059['model'];_0x2e6d58[_0xb219('0x50')]=qs[_0xb219('0x39')](_0x1abcfb['query'][_0xb219('0x39')]);_0x2e6d58[_0xb219('0x3c')]=qs[_0xb219('0x45')](_[_0xb219('0x3a')](_0x1abcfb[_0xb219('0x34')],_0x5b1059['filters']));if(_0x1abcfb['query'][_0xb219('0x3b')]){_0x2e6d58['where']=_['merge'](_0x2e6d58[_0xb219('0x3c')],{'$or':_[_0xb219('0x2d')](_0x2e6d58[_0xb219('0x37')],function(_0x2c4d4d){var _0x55d286={};_0x55d286[_0x2c4d4d]={'$like':'%'+_0x1abcfb[_0xb219('0x34')][_0xb219('0x3b')]+'%'};return _0x55d286;})});}_0x2e6d58=_[_0xb219('0x3d')]({},_0x2e6d58,_0x1abcfb[_0xb219('0x3f')]);return _0x5368f4[_0xb219('0x4d')](_0x2e6d58);}})[_0xb219('0x26')](function(_0x4bf431){if(_0x4bf431){_0x2d1fed=_0x4bf431[_0xb219('0x47')];if(!_0x1abcfb['query'][_0xb219('0x38')](_0xb219('0x51'))){_0x2e6d58[_0xb219('0x1e')]=qs[_0xb219('0x1e')](_0x1abcfb[_0xb219('0x34')][_0xb219('0x1e')]);_0x2e6d58['offset']=qs[_0xb219('0x20')](_0x1abcfb['query']['offset']);}return _0x5368f4['getFields'](_0x2e6d58);}})[_0xb219('0x26')](function(_0x8ff681){if(_0x8ff681){return _0x8ff681?{'count':_0x2d1fed,'rows':_0x8ff681}:null;}})['then'](respondWithResult(_0x35eb7f,null))[_0xb219('0x43')](handleError(_0x35eb7f,null));};exports[_0xb219('0x52')]=function(_0x4d4ad8,_0x2f27f9,_0x3623f9){var _0x1d712f={};var _0x4fd901={};var _0x2da8d2;var _0xbca55;return db[_0xb219('0x2e')][_0xb219('0x4e')]({'where':{'id':_0x4d4ad8['params']['id']}})[_0xb219('0x26')](handleEntityNotFound(_0x2f27f9,null))[_0xb219('0x26')](function(_0x56d6aa){if(_0x56d6aa){_0x2da8d2=_0x56d6aa;_0x4fd901[_0xb219('0x35')]=_['keys'](db[_0xb219('0x4f')]['rawAttributes']);_0x4fd901[_0xb219('0x34')]=_['keys'](_0x4d4ad8[_0xb219('0x34')]);_0x4fd901[_0xb219('0x45')]=_[_0xb219('0x46')](_0x4fd901['model'],_0x4fd901[_0xb219('0x34')]);_0x1d712f[_0xb219('0x37')]=_[_0xb219('0x46')](_0x4fd901[_0xb219('0x35')],qs['fields'](_0x4d4ad8[_0xb219('0x34')][_0xb219('0x36')]));_0x1d712f[_0xb219('0x37')]=_0x1d712f[_0xb219('0x37')][_0xb219('0x47')]?_0x1d712f[_0xb219('0x37')]:_0x4fd901[_0xb219('0x35')];_0x1d712f[_0xb219('0x50')]=qs[_0xb219('0x39')](_0x4d4ad8[_0xb219('0x34')][_0xb219('0x39')]);_0x1d712f[_0xb219('0x3c')]=qs[_0xb219('0x45')](_[_0xb219('0x3a')](_0x4d4ad8['query'],_0x4fd901['filters']));if(_0x4d4ad8[_0xb219('0x34')][_0xb219('0x3b')]){_0x1d712f[_0xb219('0x3c')]=_[_0xb219('0x3d')](_0x1d712f[_0xb219('0x3c')],{'$or':_[_0xb219('0x2d')](_0x1d712f[_0xb219('0x37')],function(_0x553f70){var _0xceb757={};_0xceb757[_0x553f70]={'$like':'%'+_0x4d4ad8[_0xb219('0x34')][_0xb219('0x3b')]+'%'};return _0xceb757;})});}_0x1d712f=_[_0xb219('0x3d')]({},_0x1d712f,_0x4d4ad8['options']);return _0x2da8d2[_0xb219('0x52')](_0x1d712f);}})['then'](function(_0x3ee2f4){if(_0x3ee2f4){_0xbca55=_0x3ee2f4[_0xb219('0x47')];if(!_0x4d4ad8[_0xb219('0x34')][_0xb219('0x38')](_0xb219('0x51'))){_0x1d712f[_0xb219('0x1e')]=qs[_0xb219('0x1e')](_0x4d4ad8[_0xb219('0x34')][_0xb219('0x1e')]);_0x1d712f['offset']=qs[_0xb219('0x20')](_0x4d4ad8[_0xb219('0x34')][_0xb219('0x20')]);}return _0x2da8d2[_0xb219('0x52')](_0x1d712f);}})[_0xb219('0x26')](function(_0x59efec){if(_0x59efec){return _0x59efec?{'count':_0xbca55,'rows':_0x59efec}:null;}})['then'](respondWithResult(_0x2f27f9,null))[_0xb219('0x43')](handleError(_0x2f27f9,null));};exports['getDescriptions']=function(_0x1fa4d0,_0x2654fe,_0x584957){var _0x167cc0={};var _0x535062={};var _0x33a33f;var _0x153fa6;return db[_0xb219('0x2e')][_0xb219('0x4e')]({'where':{'id':_0x1fa4d0[_0xb219('0x4c')]['id']}})[_0xb219('0x26')](handleEntityNotFound(_0x2654fe,null))[_0xb219('0x26')](function(_0x35f5b7){if(_0x35f5b7){_0x33a33f=_0x35f5b7;_0x535062[_0xb219('0x35')]=_['keys'](db[_0xb219('0x4f')]['rawAttributes']);_0x535062[_0xb219('0x34')]=_[_0xb219('0x33')](_0x1fa4d0[_0xb219('0x34')]);_0x535062[_0xb219('0x45')]=_[_0xb219('0x46')](_0x535062[_0xb219('0x35')],_0x535062[_0xb219('0x34')]);_0x167cc0[_0xb219('0x37')]=_[_0xb219('0x46')](_0x535062['model'],qs[_0xb219('0x36')](_0x1fa4d0[_0xb219('0x34')][_0xb219('0x36')]));_0x167cc0[_0xb219('0x37')]=_0x167cc0[_0xb219('0x37')][_0xb219('0x47')]?_0x167cc0[_0xb219('0x37')]:_0x535062[_0xb219('0x35')];_0x167cc0[_0xb219('0x50')]=qs[_0xb219('0x39')](_0x1fa4d0[_0xb219('0x34')][_0xb219('0x39')]);_0x167cc0[_0xb219('0x3c')]=qs[_0xb219('0x45')](_['pick'](_0x1fa4d0[_0xb219('0x34')],_0x535062[_0xb219('0x45')]));if(_0x1fa4d0[_0xb219('0x34')]['filter']){_0x167cc0[_0xb219('0x3c')]=_['merge'](_0x167cc0[_0xb219('0x3c')],{'$or':_[_0xb219('0x2d')](_0x167cc0['attributes'],function(_0x2bc922){var _0x1c4fe5={};_0x1c4fe5[_0x2bc922]={'$like':'%'+_0x1fa4d0['query']['filter']+'%'};return _0x1c4fe5;})});}_0x167cc0=_[_0xb219('0x3d')]({},_0x167cc0,_0x1fa4d0[_0xb219('0x3f')]);return _0x33a33f['getDescriptions'](_0x167cc0);}})['then'](function(_0x2702b1){if(_0x2702b1){_0x153fa6=_0x2702b1[_0xb219('0x47')];if(!_0x1fa4d0['query'][_0xb219('0x38')](_0xb219('0x51'))){_0x167cc0[_0xb219('0x1e')]=qs['limit'](_0x1fa4d0['query'][_0xb219('0x1e')]);_0x167cc0['offset']=qs[_0xb219('0x20')](_0x1fa4d0['query']['offset']);}return _0x33a33f[_0xb219('0x53')](_0x167cc0);}})[_0xb219('0x26')](function(_0x4fb63f){if(_0x4fb63f){return _0x4fb63f?{'count':_0x153fa6,'rows':_0x4fb63f}:null;}})['then'](respondWithResult(_0x2654fe,null))[_0xb219('0x43')](handleError(_0x2654fe,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f371c95..706d960 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 _0x3609=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3609,0x101));var _0x9360=function(_0x21c8a4,_0x14b02b){_0x21c8a4=_0x21c8a4-0x0;var _0x1ef9dd=_0x3609[_0x21c8a4];return _0x1ef9dd;};'use strict';var _=require(_0x9360('0x0'));var util=require(_0x9360('0x1'));var logger=require(_0x9360('0x2'))(_0x9360('0x3'));var moment=require(_0x9360('0x4'));var BPromise=require(_0x9360('0x5'));var rp=require(_0x9360('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9360('0x7'));var config=require(_0x9360('0x8'));var attributes=require(_0x9360('0x9'));module['exports']=function(_0x5548c1,_0x48aeae){return _0x5548c1[_0x9360('0xa')](_0x9360('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c59=['moment','request-promise','path','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util','../../config/logger','api'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7c59,0x147));var _0x97c5=function(_0x4d7155,_0xa0c16d){_0x4d7155=_0x4d7155-0x0;var _0x337ad7=_0x7c59[_0x4d7155];return _0x337ad7;};'use strict';var _=require('lodash');var util=require(_0x97c5('0x0'));var logger=require(_0x97c5('0x1'))(_0x97c5('0x2'));var moment=require(_0x97c5('0x3'));var BPromise=require('bluebird');var rp=require(_0x97c5('0x4'));var fs=require('fs');var path=require(_0x97c5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x97c5('0x6'));module[_0x97c5('0x7')]=function(_0x29832f,_0xb7c5e1){return _0x29832f[_0x97c5('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x97c5('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 aeaba5a..4faae9e 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 _0x1a3b=['stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x427c85,_0xc58e9f){var _0x1030fc=function(_0x523ea6){while(--_0x523ea6){_0x427c85['push'](_0x427c85['shift']());}};_0x1030fc(++_0xc58e9f);}(_0x1a3b,0x83));var _0xb1a3=function(_0x562b67,_0x170d1d){_0x562b67=_0x562b67-0x0;var _0x267d7e=_0x1a3b[_0x562b67];return _0x267d7e;};'use strict';var _=require(_0xb1a3('0x0'));var util=require(_0xb1a3('0x1'));var moment=require(_0xb1a3('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1a3('0x3'));var fs=require('fs');var Redis=require(_0xb1a3('0x4'));var db=require(_0xb1a3('0x5'))['db'];var utils=require(_0xb1a3('0x6'));var logger=require('../../config/logger')(_0xb1a3('0x7'));var config=require(_0xb1a3('0x8'));var jayson=require(_0xb1a3('0x9'));var client=jayson[_0xb1a3('0xa')][_0xb1a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ffe02,_0x219e3b,_0x26ca81){return new BPromise(function(_0x3334c4,_0x93e6c){return client[_0xb1a3('0xc')](_0x4ffe02,_0x26ca81)[_0xb1a3('0xd')](function(_0x497492){logger[_0xb1a3('0xe')](_0xb1a3('0xf'),_0x219e3b,_0xb1a3('0x10'));logger[_0xb1a3('0x11')](_0xb1a3('0x12'),_0x219e3b,_0xb1a3('0x10'),JSON[_0xb1a3('0x13')](_0x497492));if(_0x497492['error']){if(_0x497492['error'][_0xb1a3('0x14')]===0x1f4){logger[_0xb1a3('0x15')]('ServicenowConfiguration,\x20%s,\x20%s',_0x219e3b,_0x497492['error'][_0xb1a3('0x16')]);return _0x93e6c(_0x497492[_0xb1a3('0x15')]['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x219e3b,_0x497492[_0xb1a3('0x15')][_0xb1a3('0x16')]);return _0x3334c4(_0x497492['error'][_0xb1a3('0x16')]);}else{logger[_0xb1a3('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x219e3b,_0xb1a3('0x10'));_0x3334c4(_0x497492[_0xb1a3('0x17')][_0xb1a3('0x16')]);}})[_0xb1a3('0x18')](function(_0x251935){logger[_0xb1a3('0x15')](_0xb1a3('0xf'),_0x219e3b,_0x251935);_0x93e6c(_0x251935);});});} \ No newline at end of file +var _0x0ff2=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x0ff2,0xe4));var _0x20ff=function(_0xda8b33,_0x7096f3){_0xda8b33=_0xda8b33-0x0;var _0x41c45f=_0x0ff2[_0xda8b33];return _0x41c45f;};'use strict';var _=require(_0x20ff('0x0'));var util=require(_0x20ff('0x1'));var moment=require(_0x20ff('0x2'));var BPromise=require(_0x20ff('0x3'));var rs=require(_0x20ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x20ff('0x6'))('rpc');var config=require(_0x20ff('0x7'));var jayson=require(_0x20ff('0x8'));var client=jayson['client'][_0x20ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21e140,_0x58b14c,_0x356b8e){return new BPromise(function(_0x3fb447,_0x439d6d){return client[_0x20ff('0xa')](_0x21e140,_0x356b8e)[_0x20ff('0xb')](function(_0x406504){logger[_0x20ff('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x58b14c,_0x20ff('0xd'));logger[_0x20ff('0xe')](_0x20ff('0xf'),_0x58b14c,_0x20ff('0xd'),JSON[_0x20ff('0x10')](_0x406504));if(_0x406504[_0x20ff('0x11')]){if(_0x406504[_0x20ff('0x11')][_0x20ff('0x12')]===0x1f4){logger['error'](_0x20ff('0x13'),_0x58b14c,_0x406504[_0x20ff('0x11')][_0x20ff('0x14')]);return _0x439d6d(_0x406504[_0x20ff('0x11')][_0x20ff('0x14')]);}logger['error'](_0x20ff('0x13'),_0x58b14c,_0x406504[_0x20ff('0x11')]['message']);return _0x3fb447(_0x406504['error'][_0x20ff('0x14')]);}else{logger[_0x20ff('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x58b14c,'request\x20sent');_0x3fb447(_0x406504[_0x20ff('0x15')][_0x20ff('0x14')]);}})['catch'](function(_0x29963b){logger['error'](_0x20ff('0x13'),_0x58b14c,_0x29963b);_0x439d6d(_0x29963b);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index d4639f4..3edbf2f 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 _0xed9e=['./intServicenowField.controller','index','get','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path','fs-extra','../../config/environment'];(function(_0x524cc4,_0x627b20){var _0x44a5de=function(_0x4497dc){while(--_0x4497dc){_0x524cc4['push'](_0x524cc4['shift']());}};_0x44a5de(++_0x627b20);}(_0xed9e,0x10b));var _0xeed9=function(_0x5bcdb9,_0x2bef44){_0x5bcdb9=_0x5bcdb9-0x0;var _0x4f0dda=_0xed9e[_0x5bcdb9];return _0x4f0dda;};'use strict';var multer=require(_0xeed9('0x0'));var util=require(_0xeed9('0x1'));var path=require(_0xeed9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xeed9('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeed9('0x4'));var controller=require(_0xeed9('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xeed9('0x6')]);router[_0xeed9('0x7')](_0xeed9('0x8'),auth[_0xeed9('0x9')](),controller['show']);router[_0xeed9('0xa')]('/',auth[_0xeed9('0x9')](),controller[_0xeed9('0xb')]);router['put'](_0xeed9('0x8'),auth[_0xeed9('0x9')](),controller[_0xeed9('0xc')]);router[_0xeed9('0xd')](_0xeed9('0x8'),auth[_0xeed9('0x9')](),controller[_0xeed9('0xe')]);module[_0xeed9('0xf')]=router; \ No newline at end of file +var _0x2991=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0xcc8102,_0xac3fde){var _0x36e0b6=function(_0xab5749){while(--_0xab5749){_0xcc8102['push'](_0xcc8102['shift']());}};_0x36e0b6(++_0xac3fde);}(_0x2991,0x1a5));var _0x1299=function(_0x2b38bc,_0x5ef8b4){_0x2b38bc=_0x2b38bc-0x0;var _0x25bf3a=_0x2991[_0x2b38bc];return _0x25bf3a;};'use strict';var multer=require(_0x1299('0x0'));var util=require('util');var path=require(_0x1299('0x1'));var timeout=require(_0x1299('0x2'));var express=require(_0x1299('0x3'));var router=express[_0x1299('0x4')]();var fs_extra=require(_0x1299('0x5'));var auth=require(_0x1299('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1299('0x7'));var controller=require(_0x1299('0x8'));router[_0x1299('0x9')]('/',auth['isAuthenticated'](),controller[_0x1299('0xa')]);router[_0x1299('0x9')](_0x1299('0xb'),auth[_0x1299('0xc')](),controller[_0x1299('0xd')]);router[_0x1299('0xe')]('/',auth[_0x1299('0xc')](),controller[_0x1299('0xf')]);router[_0x1299('0x10')](_0x1299('0xb'),auth[_0x1299('0xc')](),controller[_0x1299('0x11')]);router[_0x1299('0x12')](_0x1299('0xb'),auth[_0x1299('0xc')](),controller[_0x1299('0x13')]);module[_0x1299('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 25d53a5..e1ab2b9 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 _0x5494=['keyValue','variable','STRING','sequelize','ENUM','string','customVariable'];(function(_0x50dd44,_0x7a67d){var _0x1ebb0c=function(_0x4a6dd7){while(--_0x4a6dd7){_0x50dd44['push'](_0x50dd44['shift']());}};_0x1ebb0c(++_0x7a67d);}(_0x5494,0x18b));var _0x4549=function(_0x1c2aeb,_0x48433c){_0x1c2aeb=_0x1c2aeb-0x0;var _0x783379=_0x5494[_0x1c2aeb];return _0x783379;};'use strict';var Sequelize=require(_0x4549('0x0'));module['exports']={'type':{'type':Sequelize[_0x4549('0x1')](_0x4549('0x2'),'variable',_0x4549('0x3'),_0x4549('0x4'),'picklist'),'defaultValue':_0x4549('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x4549('0x2'),_0x4549('0x5'),_0x4549('0x3'))},'keyContent':{'type':Sequelize[_0x4549('0x6')]},'idField':{'type':Sequelize[_0x4549('0x6')]},'nameField':{'type':Sequelize[_0x4549('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda35=['keyValue','STRING','ENUM','variable','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0x5be7c6,_0x169bf0){var _0x196125=function(_0x1f75a0){while(--_0x1f75a0){_0x5be7c6['push'](_0x5be7c6['shift']());}};_0x196125(++_0x169bf0);}(_0xda35,0x17f));var _0x5da3=function(_0x332bb4,_0x24246d){_0x332bb4=_0x332bb4-0x0;var _0x136f0b=_0xda35[_0x332bb4];return _0x136f0b;};'use strict';var Sequelize=require(_0x5da3('0x0'));module[_0x5da3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5da3('0x2'),'variable',_0x5da3('0x3'),_0x5da3('0x4'),'picklist'),'defaultValue':_0x5da3('0x2')},'content':{'type':Sequelize[_0x5da3('0x5')]},'key':{'type':Sequelize[_0x5da3('0x5')]},'keyType':{'type':Sequelize[_0x5da3('0x6')](_0x5da3('0x2'),_0x5da3('0x7'),_0x5da3('0x3'))},'keyContent':{'type':Sequelize[_0x5da3('0x5')]},'idField':{'type':Sequelize[_0x5da3('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5da3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5da3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 2e33532..d3682a4 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 _0x7018=['body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','ServicenowField','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','create'];(function(_0x1bca0,_0x2b7d42){var _0x5836f1=function(_0x3c60d8){while(--_0x3c60d8){_0x1bca0['push'](_0x1bca0['shift']());}};_0x5836f1(++_0x2b7d42);}(_0x7018,0x1ac));var _0x8701=function(_0x32b52a,_0x5a5b02){_0x32b52a=_0x32b52a-0x0;var _0x3b904c=_0x7018[_0x32b52a];return _0x3b904c;};'use strict';var emlformat=require(_0x8701('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8701('0x1'));var jsonpatch=require(_0x8701('0x2'));var rp=require(_0x8701('0x3'));var moment=require(_0x8701('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8701('0x5'));var util=require(_0x8701('0x6'));var path=require(_0x8701('0x7'));var sox=require(_0x8701('0x8'));var csv=require('to-csv');var ejs=require(_0x8701('0x9'));var fs=require('fs');var fs_extra=require(_0x8701('0xa'));var _=require(_0x8701('0xb'));var squel=require('squel');var crypto=require(_0x8701('0xc'));var jsforce=require(_0x8701('0xd'));var deskjs=require(_0x8701('0xe'));var toCsv=require(_0x8701('0xf'));var querystring=require(_0x8701('0x10'));var Papa=require('papaparse');var Redis=require(_0x8701('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8701('0x12'));var utils=require(_0x8701('0x13'));var config=require(_0x8701('0x14'));var licenseUtil=require(_0x8701('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x290620,_0x2b0135){_0x2b0135=_0x2b0135||0xcc;return function(_0x128c1a){if(_0x128c1a){return _0x290620['sendStatus'](_0x2b0135);}return _0x290620['status'](_0x2b0135)[_0x8701('0x16')]();};}function respondWithResult(_0x31ded0,_0x484209){_0x484209=_0x484209||0xc8;return function(_0x161545){if(_0x161545){return _0x31ded0['status'](_0x484209)['json'](_0x161545);}};}function respondWithFilteredResult(_0x42f380,_0x343ccd){return function(_0x18d1d2){if(_0x18d1d2){var _0x483cf3=typeof _0x343ccd[_0x8701('0x17')]==='undefined'&&typeof _0x343ccd[_0x8701('0x18')]===_0x8701('0x19');var _0x35cab4=_0x18d1d2[_0x8701('0x1a')];var _0x54f286=_0x483cf3?0x0:_0x343ccd[_0x8701('0x17')];var _0x1893f4=_0x483cf3?_0x18d1d2['count']:_0x343ccd[_0x8701('0x17')]+_0x343ccd['limit'];var _0x11844f;if(_0x1893f4>=_0x35cab4){_0x1893f4=_0x35cab4;_0x11844f=0xc8;}else{_0x11844f=0xce;}_0x42f380[_0x8701('0x1b')](_0x11844f);return _0x42f380[_0x8701('0x1c')](_0x8701('0x1d'),_0x54f286+'-'+_0x1893f4+'/'+_0x35cab4)[_0x8701('0x1e')](_0x18d1d2);}return null;};}function patchUpdates(_0x40d673){return function(_0x4f3f65){try{jsonpatch['apply'](_0x4f3f65,_0x40d673,!![]);}catch(_0x1e8b2d){return BPromise[_0x8701('0x1f')](_0x1e8b2d);}return _0x4f3f65[_0x8701('0x20')]();};}function saveUpdates(_0x4a50fc,_0x1b5bce){return function(_0x4ead4f){if(_0x4ead4f){return _0x4ead4f[_0x8701('0x21')](_0x4a50fc)[_0x8701('0x22')](function(_0x4ad07a){return _0x4ad07a;});}return null;};}function removeEntity(_0xd21a26,_0x28ad73){return function(_0x223b98){if(_0x223b98){return _0x223b98[_0x8701('0x23')]()[_0x8701('0x22')](function(){_0xd21a26['status'](0xcc)[_0x8701('0x16')]();});}};}function handleEntityNotFound(_0x354c5a,_0x50c3b5){return function(_0x11e8b3){if(!_0x11e8b3){_0x354c5a['sendStatus'](0x194);}return _0x11e8b3;};}function handleError(_0x8f3240,_0x59e9a7){_0x59e9a7=_0x59e9a7||0x1f4;return function(_0x54da39){logger['error'](_0x54da39[_0x8701('0x24')]);if(_0x54da39[_0x8701('0x25')]){delete _0x54da39[_0x8701('0x25')];}_0x8f3240[_0x8701('0x1b')](_0x59e9a7)[_0x8701('0x26')](_0x54da39);};}exports['index']=function(_0x5a6086,_0x3e1164){var _0x135a6f={},_0x256711={},_0x544a50={'count':0x0,'rows':[]};var _0x5cc83f=_[_0x8701('0x27')](db[_0x8701('0x28')][_0x8701('0x29')],function(_0x27e0b2){return{'name':_0x27e0b2['fieldName'],'type':_0x27e0b2[_0x8701('0x2a')]['key']};});_0x256711[_0x8701('0x2b')]=_['map'](_0x5cc83f,_0x8701('0x25'));_0x256711[_0x8701('0x2c')]=_[_0x8701('0x2d')](_0x5a6086[_0x8701('0x2c')]);_0x256711[_0x8701('0x2e')]=_['intersection'](_0x256711[_0x8701('0x2b')],_0x256711[_0x8701('0x2c')]);_0x135a6f[_0x8701('0x2f')]=_[_0x8701('0x30')](_0x256711[_0x8701('0x2b')],qs[_0x8701('0x31')](_0x5a6086[_0x8701('0x2c')]['fields']));_0x135a6f['attributes']=_0x135a6f[_0x8701('0x2f')][_0x8701('0x32')]?_0x135a6f[_0x8701('0x2f')]:_0x256711[_0x8701('0x2b')];if(!_0x5a6086[_0x8701('0x2c')][_0x8701('0x33')](_0x8701('0x34'))){_0x135a6f[_0x8701('0x18')]=qs[_0x8701('0x18')](_0x5a6086[_0x8701('0x2c')][_0x8701('0x18')]);_0x135a6f[_0x8701('0x17')]=qs[_0x8701('0x17')](_0x5a6086[_0x8701('0x2c')][_0x8701('0x17')]);}_0x135a6f[_0x8701('0x35')]=qs[_0x8701('0x36')](_0x5a6086[_0x8701('0x2c')][_0x8701('0x36')]);_0x135a6f['where']=qs[_0x8701('0x2e')](_[_0x8701('0x37')](_0x5a6086[_0x8701('0x2c')],_0x256711[_0x8701('0x2e')]),_0x5cc83f);if(_0x5a6086['query']['filter']){_0x135a6f[_0x8701('0x38')]=_[_0x8701('0x39')](_0x135a6f[_0x8701('0x38')],{'$or':_[_0x8701('0x27')](_0x5cc83f,function(_0x1b4a32){if(_0x1b4a32['type']!==_0x8701('0x3a')){var _0x312448={};_0x312448[_0x1b4a32['name']]={'$like':'%'+_0x5a6086[_0x8701('0x2c')][_0x8701('0x3b')]+'%'};return _0x312448;}})});}_0x135a6f=_[_0x8701('0x39')]({},_0x135a6f,_0x5a6086['options']);var _0x4ee52a={'where':_0x135a6f[_0x8701('0x38')]};return db[_0x8701('0x28')][_0x8701('0x1a')](_0x4ee52a)[_0x8701('0x22')](function(_0x333545){_0x544a50['count']=_0x333545;if(_0x5a6086[_0x8701('0x2c')][_0x8701('0x3c')]){_0x135a6f[_0x8701('0x3d')]=[{'all':!![]}];}return db[_0x8701('0x28')][_0x8701('0x3e')](_0x135a6f);})[_0x8701('0x22')](function(_0x13fa71){_0x544a50[_0x8701('0x3f')]=_0x13fa71;return _0x544a50;})[_0x8701('0x22')](respondWithFilteredResult(_0x3e1164,_0x135a6f))[_0x8701('0x40')](handleError(_0x3e1164,null));};exports[_0x8701('0x41')]=function(_0x13ed36,_0x55e0df){var _0x300ece={'raw':!![],'where':{'id':_0x13ed36[_0x8701('0x42')]['id']}},_0x8d3ddd={};_0x8d3ddd[_0x8701('0x2b')]=_['keys'](db[_0x8701('0x28')][_0x8701('0x29')]);_0x8d3ddd[_0x8701('0x2c')]=_['keys'](_0x13ed36[_0x8701('0x2c')]);_0x8d3ddd[_0x8701('0x2e')]=_[_0x8701('0x30')](_0x8d3ddd[_0x8701('0x2b')],_0x8d3ddd['query']);_0x300ece[_0x8701('0x2f')]=_[_0x8701('0x30')](_0x8d3ddd[_0x8701('0x2b')],qs[_0x8701('0x31')](_0x13ed36['query'][_0x8701('0x31')]));_0x300ece[_0x8701('0x2f')]=_0x300ece[_0x8701('0x2f')][_0x8701('0x32')]?_0x300ece[_0x8701('0x2f')]:_0x8d3ddd['model'];if(_0x13ed36[_0x8701('0x2c')][_0x8701('0x3c')]){_0x300ece[_0x8701('0x3d')]=[{'all':!![]}];}_0x300ece=_[_0x8701('0x39')]({},_0x300ece,_0x13ed36[_0x8701('0x43')]);return db[_0x8701('0x28')]['find'](_0x300ece)[_0x8701('0x22')](handleEntityNotFound(_0x55e0df,null))[_0x8701('0x22')](respondWithResult(_0x55e0df,null))['catch'](handleError(_0x55e0df,null));};exports['create']=function(_0x5b7e43,_0x4239e5){return db[_0x8701('0x28')][_0x8701('0x44')](_0x5b7e43['body'],{})['then'](respondWithResult(_0x4239e5,0xc9))[_0x8701('0x40')](handleError(_0x4239e5,null));};exports['update']=function(_0x31eae7,_0x5dacd6){if(_0x31eae7[_0x8701('0x45')]['id']){delete _0x31eae7['body']['id'];}return db[_0x8701('0x28')][_0x8701('0x46')]({'where':{'id':_0x31eae7[_0x8701('0x42')]['id']}})['then'](handleEntityNotFound(_0x5dacd6,null))[_0x8701('0x22')](saveUpdates(_0x31eae7[_0x8701('0x45')],null))[_0x8701('0x22')](respondWithResult(_0x5dacd6,null))[_0x8701('0x40')](handleError(_0x5dacd6,null));};exports[_0x8701('0x23')]=function(_0x2b53c7,_0x3951ef){return db['ServicenowField'][_0x8701('0x46')]({'where':{'id':_0x2b53c7[_0x8701('0x42')]['id']}})[_0x8701('0x22')](handleEntityNotFound(_0x3951ef,null))[_0x8701('0x22')](removeEntity(_0x3951ef,null))[_0x8701('0x40')](handleError(_0x3951ef,null));}; \ No newline at end of file +var _0x82bd=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ServicenowField','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf'];(function(_0x1dce00,_0x226d78){var _0x5181c9=function(_0x3bfd19){while(--_0x3bfd19){_0x1dce00['push'](_0x1dce00['shift']());}};_0x5181c9(++_0x226d78);}(_0x82bd,0x1ba));var _0xd82b=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x82bd[_0x160248];return _0x4e589d;};'use strict';var emlformat=require(_0xd82b('0x0'));var rimraf=require(_0xd82b('0x1'));var zipdir=require(_0xd82b('0x2'));var jsonpatch=require(_0xd82b('0x3'));var rp=require(_0xd82b('0x4'));var moment=require(_0xd82b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd82b('0x6'));var util=require(_0xd82b('0x7'));var path=require(_0xd82b('0x8'));var sox=require(_0xd82b('0x9'));var csv=require('to-csv');var ejs=require(_0xd82b('0xa'));var fs=require('fs');var fs_extra=require(_0xd82b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd82b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd82b('0xd'));var querystring=require(_0xd82b('0xe'));var Papa=require('papaparse');var Redis=require(_0xd82b('0xf'));var authService=require(_0xd82b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd82b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd82b('0x12'))(_0xd82b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd82b('0x14'));var db=require(_0xd82b('0x15'))['db'];function respondWithStatusCode(_0x458f17,_0x59bde6){_0x59bde6=_0x59bde6||0xcc;return function(_0x3f9fc9){if(_0x3f9fc9){return _0x458f17[_0xd82b('0x16')](_0x59bde6);}return _0x458f17[_0xd82b('0x17')](_0x59bde6)[_0xd82b('0x18')]();};}function respondWithResult(_0x342fce,_0xb03138){_0xb03138=_0xb03138||0xc8;return function(_0x56fd1a){if(_0x56fd1a){return _0x342fce[_0xd82b('0x17')](_0xb03138)[_0xd82b('0x19')](_0x56fd1a);}};}function respondWithFilteredResult(_0x28e8c0,_0xc4851){return function(_0x346ea8){if(_0x346ea8){var _0x13a8b0=typeof _0xc4851[_0xd82b('0x1a')]==='undefined'&&typeof _0xc4851[_0xd82b('0x1b')]===_0xd82b('0x1c');var _0x246c42=_0x346ea8['count'];var _0x3fe0ff=_0x13a8b0?0x0:_0xc4851[_0xd82b('0x1a')];var _0x144d5c=_0x13a8b0?_0x346ea8[_0xd82b('0x1d')]:_0xc4851[_0xd82b('0x1a')]+_0xc4851[_0xd82b('0x1b')];var _0x38d764;if(_0x144d5c>=_0x246c42){_0x144d5c=_0x246c42;_0x38d764=0xc8;}else{_0x38d764=0xce;}_0x28e8c0[_0xd82b('0x17')](_0x38d764);return _0x28e8c0[_0xd82b('0x1e')](_0xd82b('0x1f'),_0x3fe0ff+'-'+_0x144d5c+'/'+_0x246c42)[_0xd82b('0x19')](_0x346ea8);}return null;};}function patchUpdates(_0x2ecfae){return function(_0x58b5a3){try{jsonpatch[_0xd82b('0x20')](_0x58b5a3,_0x2ecfae,!![]);}catch(_0x308f18){return BPromise[_0xd82b('0x21')](_0x308f18);}return _0x58b5a3['save']();};}function saveUpdates(_0x3d6db7,_0x2252f4){return function(_0x35f407){if(_0x35f407){return _0x35f407[_0xd82b('0x22')](_0x3d6db7)[_0xd82b('0x23')](function(_0x54b035){return _0x54b035;});}return null;};}function removeEntity(_0xb5e845,_0x1526ff){return function(_0x444fe0){if(_0x444fe0){return _0x444fe0[_0xd82b('0x24')]()[_0xd82b('0x23')](function(){_0xb5e845[_0xd82b('0x17')](0xcc)[_0xd82b('0x18')]();});}};}function handleEntityNotFound(_0x3fdbdf,_0x38ccfe){return function(_0x3ee7ad){if(!_0x3ee7ad){_0x3fdbdf[_0xd82b('0x16')](0x194);}return _0x3ee7ad;};}function handleError(_0xb51d1b,_0x448071){_0x448071=_0x448071||0x1f4;return function(_0x53de9e){logger[_0xd82b('0x25')](_0x53de9e['stack']);if(_0x53de9e[_0xd82b('0x26')]){delete _0x53de9e['name'];}_0xb51d1b[_0xd82b('0x17')](_0x448071)[_0xd82b('0x27')](_0x53de9e);};}exports[_0xd82b('0x28')]=function(_0x4ea150,_0x1a556a){var _0x276464={},_0x291394={},_0x15df5b={'count':0x0,'rows':[]};var _0x1fa6a0=_[_0xd82b('0x29')](db[_0xd82b('0x2a')][_0xd82b('0x2b')],function(_0x35d2a9){return{'name':_0x35d2a9['fieldName'],'type':_0x35d2a9['type'][_0xd82b('0x2c')]};});_0x291394[_0xd82b('0x2d')]=_[_0xd82b('0x29')](_0x1fa6a0,_0xd82b('0x26'));_0x291394[_0xd82b('0x2e')]=_[_0xd82b('0x2f')](_0x4ea150[_0xd82b('0x2e')]);_0x291394['filters']=_[_0xd82b('0x30')](_0x291394[_0xd82b('0x2d')],_0x291394[_0xd82b('0x2e')]);_0x276464['attributes']=_[_0xd82b('0x30')](_0x291394['model'],qs['fields'](_0x4ea150['query'][_0xd82b('0x31')]));_0x276464['attributes']=_0x276464[_0xd82b('0x32')][_0xd82b('0x33')]?_0x276464['attributes']:_0x291394[_0xd82b('0x2d')];if(!_0x4ea150[_0xd82b('0x2e')][_0xd82b('0x34')](_0xd82b('0x35'))){_0x276464['limit']=qs[_0xd82b('0x1b')](_0x4ea150[_0xd82b('0x2e')][_0xd82b('0x1b')]);_0x276464[_0xd82b('0x1a')]=qs[_0xd82b('0x1a')](_0x4ea150['query']['offset']);}_0x276464[_0xd82b('0x36')]=qs[_0xd82b('0x37')](_0x4ea150[_0xd82b('0x2e')][_0xd82b('0x37')]);_0x276464[_0xd82b('0x38')]=qs['filters'](_[_0xd82b('0x39')](_0x4ea150['query'],_0x291394[_0xd82b('0x3a')]),_0x1fa6a0);if(_0x4ea150[_0xd82b('0x2e')][_0xd82b('0x3b')]){_0x276464['where']=_['merge'](_0x276464['where'],{'$or':_[_0xd82b('0x29')](_0x1fa6a0,function(_0x2d3f76){if(_0x2d3f76[_0xd82b('0x3c')]!==_0xd82b('0x3d')){var _0x1d5758={};_0x1d5758[_0x2d3f76[_0xd82b('0x26')]]={'$like':'%'+_0x4ea150[_0xd82b('0x2e')][_0xd82b('0x3b')]+'%'};return _0x1d5758;}})});}_0x276464=_[_0xd82b('0x3e')]({},_0x276464,_0x4ea150[_0xd82b('0x3f')]);var _0x52b830={'where':_0x276464['where']};return db[_0xd82b('0x2a')]['count'](_0x52b830)[_0xd82b('0x23')](function(_0x3c43c1){_0x15df5b[_0xd82b('0x1d')]=_0x3c43c1;if(_0x4ea150[_0xd82b('0x2e')][_0xd82b('0x40')]){_0x276464[_0xd82b('0x41')]=[{'all':!![]}];}return db[_0xd82b('0x2a')][_0xd82b('0x42')](_0x276464);})['then'](function(_0xa4700){_0x15df5b[_0xd82b('0x43')]=_0xa4700;return _0x15df5b;})[_0xd82b('0x23')](respondWithFilteredResult(_0x1a556a,_0x276464))[_0xd82b('0x44')](handleError(_0x1a556a,null));};exports[_0xd82b('0x45')]=function(_0x247f85,_0x49bc08){var _0x5eef11={'raw':!![],'where':{'id':_0x247f85[_0xd82b('0x46')]['id']}},_0x146428={};_0x146428[_0xd82b('0x2d')]=_[_0xd82b('0x2f')](db['ServicenowField'][_0xd82b('0x2b')]);_0x146428[_0xd82b('0x2e')]=_[_0xd82b('0x2f')](_0x247f85[_0xd82b('0x2e')]);_0x146428[_0xd82b('0x3a')]=_['intersection'](_0x146428['model'],_0x146428[_0xd82b('0x2e')]);_0x5eef11[_0xd82b('0x32')]=_[_0xd82b('0x30')](_0x146428[_0xd82b('0x2d')],qs['fields'](_0x247f85[_0xd82b('0x2e')]['fields']));_0x5eef11['attributes']=_0x5eef11['attributes'][_0xd82b('0x33')]?_0x5eef11[_0xd82b('0x32')]:_0x146428['model'];if(_0x247f85[_0xd82b('0x2e')][_0xd82b('0x40')]){_0x5eef11[_0xd82b('0x41')]=[{'all':!![]}];}_0x5eef11=_[_0xd82b('0x3e')]({},_0x5eef11,_0x247f85[_0xd82b('0x3f')]);return db[_0xd82b('0x2a')]['find'](_0x5eef11)[_0xd82b('0x23')](handleEntityNotFound(_0x49bc08,null))['then'](respondWithResult(_0x49bc08,null))['catch'](handleError(_0x49bc08,null));};exports[_0xd82b('0x47')]=function(_0x50c030,_0x8a3552){return db[_0xd82b('0x2a')][_0xd82b('0x47')](_0x50c030[_0xd82b('0x48')],{})[_0xd82b('0x23')](respondWithResult(_0x8a3552,0xc9))[_0xd82b('0x44')](handleError(_0x8a3552,null));};exports[_0xd82b('0x22')]=function(_0x194886,_0x593ea3){if(_0x194886[_0xd82b('0x48')]['id']){delete _0x194886[_0xd82b('0x48')]['id'];}return db[_0xd82b('0x2a')][_0xd82b('0x49')]({'where':{'id':_0x194886[_0xd82b('0x46')]['id']}})[_0xd82b('0x23')](handleEntityNotFound(_0x593ea3,null))[_0xd82b('0x23')](saveUpdates(_0x194886[_0xd82b('0x48')],null))[_0xd82b('0x23')](respondWithResult(_0x593ea3,null))[_0xd82b('0x44')](handleError(_0x593ea3,null));};exports[_0xd82b('0x24')]=function(_0x1ac7e2,_0x55a16a){return db[_0xd82b('0x2a')][_0xd82b('0x49')]({'where':{'id':_0x1ac7e2[_0xd82b('0x46')]['id']}})['then'](handleEntityNotFound(_0x55a16a,null))[_0xd82b('0x23')](removeEntity(_0x55a16a,null))['catch'](handleError(_0x55a16a,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index d03f1ad..6431879 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 _0xecd1=['moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','FieldId','lodash','api'];(function(_0x3252b6,_0x5b5f84){var _0x3a9164=function(_0x5e3890){while(--_0x5e3890){_0x3252b6['push'](_0x3252b6['shift']());}};_0x3a9164(++_0x5b5f84);}(_0xecd1,0xe8));var _0x1ecd=function(_0x306b80,_0x5bb1b1){_0x306b80=_0x306b80-0x0;var _0x30c495=_0xecd1[_0x306b80];return _0x30c495;};'use strict';var _=require(_0x1ecd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1ecd('0x1'));var moment=require(_0x1ecd('0x2'));var BPromise=require(_0x1ecd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ecd('0x4'));var rimraf=require(_0x1ecd('0x5'));var config=require(_0x1ecd('0x6'));var attributes=require(_0x1ecd('0x7'));module[_0x1ecd('0x8')]=function(_0x31b1f5,_0x523539){return _0x31b1f5[_0x1ecd('0x9')](_0x1ecd('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x1ecd('0xb'),'fields':['idField',_0x1ecd('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xec45=['int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField'];(function(_0x32cdd0,_0x55f124){var _0x55c95d=function(_0x1afe69){while(--_0x1afe69){_0x32cdd0['push'](_0x32cdd0['shift']());}};_0x55c95d(++_0x55f124);}(_0xec45,0x6c));var _0x5ec4=function(_0x31ebab,_0x29027a){_0x31ebab=_0x31ebab-0x0;var _0x5e5419=_0xec45[_0x31ebab];return _0x5e5419;};'use strict';var _=require(_0x5ec4('0x0'));var util=require(_0x5ec4('0x1'));var logger=require(_0x5ec4('0x2'))(_0x5ec4('0x3'));var moment=require('moment');var BPromise=require(_0x5ec4('0x4'));var rp=require(_0x5ec4('0x5'));var fs=require('fs');var path=require(_0x5ec4('0x6'));var rimraf=require(_0x5ec4('0x7'));var config=require(_0x5ec4('0x8'));var attributes=require(_0x5ec4('0x9'));module['exports']=function(_0x5e364a,_0x150e5){return _0x5e364a[_0x5ec4('0xa')](_0x5ec4('0xb'),attributes,{'tableName':_0x5ec4('0xc'),'paranoid':![],'indexes':[{'name':_0x5ec4('0xd'),'fields':['idField',_0x5ec4('0xe')],'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 def3860..15dd5fa 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x1e47ce,_0x47bf41){var _0x22cdb9=function(_0x49923c){while(--_0x49923c){_0x1e47ce['push'](_0x1e47ce['shift']());}};_0x22cdb9(++_0x47bf41);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3a0a8c,_0x50f4ab){_0x3a0a8c=_0x3a0a8c-0x0;var _0x4b92f4=_0x9ffd[_0x3a0a8c];return _0x4b92f4;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x239a74,_0x1490e3){var _0x1b5415=function(_0x106842){while(--_0x106842){_0x239a74['push'](_0x239a74['shift']());}};_0x1b5415(++_0x1490e3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5b8ef6,_0x5b8a32){_0x5b8ef6=_0x5b8ef6-0x0;var _0x356d5b=_0xf4eb[_0x5b8ef6];return _0x356d5b;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 9966e76..ef163fb 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x528110,_0x196fac){var _0xeb5ed3=function(_0x764d5){while(--_0x764d5){_0x528110['push'](_0x528110['shift']());}};_0xeb5ed3(++_0x196fac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5bda5d,_0xae1ec9){var _0x59e9e1=function(_0x2ce445){while(--_0x2ce445){_0x5bda5d['push'](_0x5bda5d['shift']());}};_0x59e9e1(++_0xae1ec9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index fe67a26..3a4f9fd 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(_0x117fad,_0x33bbe5){var _0x102eb3=function(_0x54b921){while(--_0x54b921){_0x117fad['push'](_0x117fad['shift']());}};_0x102eb3(++_0x33bbe5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x59d6e2,_0x4f9114){var _0x4ba1d4=function(_0xb8cb1b){while(--_0xb8cb1b){_0x59d6e2['push'](_0x59d6e2['shift']());}};_0x4ba1d4(++_0x4f9114);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 ba0ac73..9c79c0a 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 _0x27b9=['filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','test','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','model','keys','intersection','attributes','fields','query','hasOwnProperty','sort','filters','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','getConfigurations','findOne','SugarcrmConfiguration','order'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x27b9,0x119));var _0x927b=function(_0x4904c2,_0x2c0844){_0x4904c2=_0x4904c2-0x0;var _0x58116e=_0x27b9[_0x4904c2];return _0x58116e;};'use strict';var emlformat=require(_0x927b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x927b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x927b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x927b('0x3'));var util=require(_0x927b('0x4'));var path=require(_0x927b('0x5'));var sox=require(_0x927b('0x6'));var csv=require(_0x927b('0x7'));var ejs=require(_0x927b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x927b('0x9'));var squel=require(_0x927b('0xa'));var crypto=require(_0x927b('0xb'));var jsforce=require(_0x927b('0xc'));var deskjs=require(_0x927b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x927b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x927b('0xf'));var qs=require(_0x927b('0x10'));var as=require(_0x927b('0x11'));var hardwareService=require(_0x927b('0x12'));var logger=require('../../config/logger')(_0x927b('0x13'));var utils=require(_0x927b('0x14'));var config=require(_0x927b('0x15'));var licenseUtil=require(_0x927b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x927b('0x17'));function respondWithStatusCode(_0x4eaa90,_0x3f934e){_0x3f934e=_0x3f934e||0xcc;return function(_0x2a7e9a){if(_0x2a7e9a){return _0x4eaa90[_0x927b('0x18')](_0x3f934e);}return _0x4eaa90[_0x927b('0x19')](_0x3f934e)[_0x927b('0x1a')]();};}function respondWithResult(_0x428e62,_0x329ee6){_0x329ee6=_0x329ee6||0xc8;return function(_0x192d28){if(_0x192d28){return _0x428e62[_0x927b('0x19')](_0x329ee6)[_0x927b('0x1b')](_0x192d28);}};}function respondWithFilteredResult(_0x1467d0,_0x4eb987){return function(_0x13c32f){if(_0x13c32f){var _0x441ec5=typeof _0x4eb987[_0x927b('0x1c')]===_0x927b('0x1d')&&typeof _0x4eb987[_0x927b('0x1e')]===_0x927b('0x1d');var _0x2c9ded=_0x13c32f['count'];var _0x3165e0=_0x441ec5?0x0:_0x4eb987['offset'];var _0x469a69=_0x441ec5?_0x13c32f[_0x927b('0x1f')]:_0x4eb987['offset']+_0x4eb987[_0x927b('0x1e')];var _0x4e5f70;if(_0x469a69>=_0x2c9ded){_0x469a69=_0x2c9ded;_0x4e5f70=0xc8;}else{_0x4e5f70=0xce;}_0x1467d0[_0x927b('0x19')](_0x4e5f70);return _0x1467d0[_0x927b('0x20')]('Content-Range',_0x3165e0+'-'+_0x469a69+'/'+_0x2c9ded)[_0x927b('0x1b')](_0x13c32f);}return null;};}function patchUpdates(_0x513fb3){return function(_0x508dfd){try{jsonpatch[_0x927b('0x21')](_0x508dfd,_0x513fb3,!![]);}catch(_0x4644f6){return BPromise[_0x927b('0x22')](_0x4644f6);}return _0x508dfd[_0x927b('0x23')]();};}function saveUpdates(_0x13f77a,_0x570dc4){return function(_0x52bfd6){if(_0x52bfd6){return _0x52bfd6[_0x927b('0x24')](_0x13f77a)[_0x927b('0x25')](function(_0x420183){return _0x420183;});}return null;};}function removeEntity(_0x35cf9d,_0x2ca68a){return function(_0x59193f){if(_0x59193f){return _0x59193f[_0x927b('0x26')]()[_0x927b('0x25')](function(){_0x35cf9d[_0x927b('0x19')](0xcc)[_0x927b('0x1a')]();});}};}function handleEntityNotFound(_0x5e6265,_0xe1fdd3){return function(_0x4f5fa0){if(!_0x4f5fa0){_0x5e6265['sendStatus'](0x194);}return _0x4f5fa0;};}function handleError(_0x41ad48,_0x3756be){_0x3756be=_0x3756be||0x1f4;return function(_0x34b38a){logger[_0x927b('0x27')](_0x34b38a[_0x927b('0x28')]);if(_0x34b38a[_0x927b('0x29')]){delete _0x34b38a[_0x927b('0x29')];}_0x41ad48['status'](_0x3756be)['send'](_0x34b38a);};}exports[_0x927b('0x2a')]=function(_0xbf1dd9,_0x1283c6){var _0x100cd8={},_0x3646b9={},_0x2186e0={'count':0x0,'rows':[]};var _0x16a5b7=_[_0x927b('0x2b')](db[_0x927b('0x2c')][_0x927b('0x2d')],function(_0x5cc40f){return{'name':_0x5cc40f['fieldName'],'type':_0x5cc40f['type']['key']};});_0x3646b9[_0x927b('0x2e')]=_['map'](_0x16a5b7,_0x927b('0x29'));_0x3646b9['query']=_[_0x927b('0x2f')](_0xbf1dd9['query']);_0x3646b9['filters']=_[_0x927b('0x30')](_0x3646b9['model'],_0x3646b9['query']);_0x100cd8[_0x927b('0x31')]=_[_0x927b('0x30')](_0x3646b9['model'],qs[_0x927b('0x32')](_0xbf1dd9[_0x927b('0x33')][_0x927b('0x32')]));_0x100cd8[_0x927b('0x31')]=_0x100cd8['attributes']['length']?_0x100cd8[_0x927b('0x31')]:_0x3646b9[_0x927b('0x2e')];if(!_0xbf1dd9['query'][_0x927b('0x34')]('nolimit')){_0x100cd8[_0x927b('0x1e')]=qs[_0x927b('0x1e')](_0xbf1dd9[_0x927b('0x33')]['limit']);_0x100cd8[_0x927b('0x1c')]=qs[_0x927b('0x1c')](_0xbf1dd9[_0x927b('0x33')][_0x927b('0x1c')]);}_0x100cd8['order']=qs[_0x927b('0x35')](_0xbf1dd9[_0x927b('0x33')][_0x927b('0x35')]);_0x100cd8['where']=qs[_0x927b('0x36')](_['pick'](_0xbf1dd9[_0x927b('0x33')],_0x3646b9['filters']),_0x16a5b7);if(_0xbf1dd9['query']['filter']){_0x100cd8[_0x927b('0x37')]=_[_0x927b('0x38')](_0x100cd8[_0x927b('0x37')],{'$or':_[_0x927b('0x2b')](_0x16a5b7,function(_0x2b329f){if(_0x2b329f[_0x927b('0x39')]!==_0x927b('0x3a')){var _0x1def16={};_0x1def16[_0x2b329f[_0x927b('0x29')]]={'$like':'%'+_0xbf1dd9['query']['filter']+'%'};return _0x1def16;}})});}_0x100cd8=_['merge']({},_0x100cd8,_0xbf1dd9[_0x927b('0x3b')]);var _0x58f779={'where':_0x100cd8['where']};return db[_0x927b('0x2c')][_0x927b('0x1f')](_0x58f779)[_0x927b('0x25')](function(_0x1e3fe3){_0x2186e0[_0x927b('0x1f')]=_0x1e3fe3;if(_0xbf1dd9[_0x927b('0x33')][_0x927b('0x3c')]){_0x100cd8[_0x927b('0x3d')]=[{'all':!![]}];}return db[_0x927b('0x2c')][_0x927b('0x3e')](_0x100cd8);})[_0x927b('0x25')](function(_0x1ffc72){_0x2186e0[_0x927b('0x3f')]=_0x1ffc72;return _0x2186e0;})[_0x927b('0x25')](respondWithFilteredResult(_0x1283c6,_0x100cd8))[_0x927b('0x40')](handleError(_0x1283c6,null));};exports['show']=function(_0x4af552,_0x3b503d){var _0x39a2a4={'raw':![],'where':{'id':_0x4af552[_0x927b('0x41')]['id']}},_0x249338={};_0x249338[_0x927b('0x2e')]=_[_0x927b('0x2f')](db[_0x927b('0x2c')][_0x927b('0x2d')]);_0x249338[_0x927b('0x33')]=_[_0x927b('0x2f')](_0x4af552[_0x927b('0x33')]);_0x249338[_0x927b('0x36')]=_['intersection'](_0x249338[_0x927b('0x2e')],_0x249338[_0x927b('0x33')]);_0x39a2a4[_0x927b('0x31')]=_['intersection'](_0x249338['model'],qs[_0x927b('0x32')](_0x4af552[_0x927b('0x33')]['fields']));_0x39a2a4[_0x927b('0x31')]=_0x39a2a4[_0x927b('0x31')][_0x927b('0x42')]?_0x39a2a4['attributes']:_0x249338[_0x927b('0x2e')];if(_0x4af552[_0x927b('0x33')]['includeAll']){_0x39a2a4['include']=[{'all':!![]}];}_0x39a2a4=_['merge']({},_0x39a2a4,_0x4af552[_0x927b('0x3b')]);return db[_0x927b('0x2c')]['find'](_0x39a2a4)[_0x927b('0x25')](handleEntityNotFound(_0x3b503d,null))[_0x927b('0x25')](respondWithResult(_0x3b503d,null))[_0x927b('0x40')](handleError(_0x3b503d,null));};exports['create']=function(_0xd43ee4,_0x58b9d0){return db['SugarcrmAccount'][_0x927b('0x43')](_0xd43ee4[_0x927b('0x44')],{})[_0x927b('0x25')](respondWithResult(_0x58b9d0,0xc9))[_0x927b('0x40')](handleError(_0x58b9d0,null));};exports['update']=function(_0x2a37a5,_0x642f8b){if(_0x2a37a5[_0x927b('0x44')]['id']){delete _0x2a37a5[_0x927b('0x44')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x2a37a5[_0x927b('0x41')]['id']}})[_0x927b('0x25')](handleEntityNotFound(_0x642f8b,null))[_0x927b('0x25')](saveUpdates(_0x2a37a5[_0x927b('0x44')],null))[_0x927b('0x25')](respondWithResult(_0x642f8b,null))[_0x927b('0x40')](handleError(_0x642f8b,null));};exports[_0x927b('0x26')]=function(_0x7a0d68,_0x262ec3){return db[_0x927b('0x2c')]['find']({'where':{'id':_0x7a0d68['params']['id']}})[_0x927b('0x25')](handleEntityNotFound(_0x262ec3,null))[_0x927b('0x25')](removeEntity(_0x262ec3,null))[_0x927b('0x40')](handleError(_0x262ec3,null));};exports[_0x927b('0x45')]=function(_0x1ddd1d,_0x1b1119,_0x40dcd0){var _0x1b261c={};var _0x32e7f6={};var _0x3fe743;var _0x3cabe6;return db[_0x927b('0x2c')][_0x927b('0x46')]({'where':{'id':_0x1ddd1d[_0x927b('0x41')]['id']}})[_0x927b('0x25')](handleEntityNotFound(_0x1b1119,null))[_0x927b('0x25')](function(_0x1e4e09){if(_0x1e4e09){_0x3fe743=_0x1e4e09;_0x32e7f6[_0x927b('0x2e')]=_[_0x927b('0x2f')](db[_0x927b('0x47')][_0x927b('0x2d')]);_0x32e7f6[_0x927b('0x33')]=_[_0x927b('0x2f')](_0x1ddd1d[_0x927b('0x33')]);_0x32e7f6[_0x927b('0x36')]=_['intersection'](_0x32e7f6[_0x927b('0x2e')],_0x32e7f6['query']);_0x1b261c[_0x927b('0x31')]=_['intersection'](_0x32e7f6[_0x927b('0x2e')],qs[_0x927b('0x32')](_0x1ddd1d['query'][_0x927b('0x32')]));_0x1b261c[_0x927b('0x31')]=_0x1b261c['attributes']['length']?_0x1b261c['attributes']:_0x32e7f6[_0x927b('0x2e')];_0x1b261c[_0x927b('0x48')]=qs['sort'](_0x1ddd1d['query'][_0x927b('0x35')]);_0x1b261c[_0x927b('0x37')]=qs[_0x927b('0x36')](_['pick'](_0x1ddd1d[_0x927b('0x33')],_0x32e7f6[_0x927b('0x36')]));if(_0x1ddd1d['query']['filter']){_0x1b261c[_0x927b('0x37')]=_[_0x927b('0x38')](_0x1b261c[_0x927b('0x37')],{'$or':_['map'](_0x1b261c[_0x927b('0x31')],function(_0x35e226){var _0x530865={};_0x530865[_0x35e226]={'$like':'%'+_0x1ddd1d[_0x927b('0x33')][_0x927b('0x49')]+'%'};return _0x530865;})});}_0x1b261c=_[_0x927b('0x38')]({},_0x1b261c,_0x1ddd1d[_0x927b('0x3b')]);return _0x3fe743[_0x927b('0x45')](_0x1b261c);}})[_0x927b('0x25')](function(_0x368d82){if(_0x368d82){_0x3cabe6=_0x368d82[_0x927b('0x42')];if(!_0x1ddd1d[_0x927b('0x33')][_0x927b('0x34')](_0x927b('0x4a'))){_0x1b261c[_0x927b('0x1e')]=qs[_0x927b('0x1e')](_0x1ddd1d[_0x927b('0x33')][_0x927b('0x1e')]);_0x1b261c['offset']=qs['offset'](_0x1ddd1d[_0x927b('0x33')][_0x927b('0x1c')]);}return _0x3fe743['getConfigurations'](_0x1b261c);}})['then'](function(_0x5809db){if(_0x5809db){return _0x5809db?{'count':_0x3cabe6,'rows':_0x5809db}:null;}})[_0x927b('0x25')](respondWithResult(_0x1b1119,null))[_0x927b('0x40')](handleError(_0x1b1119,null));};exports[_0x927b('0x4b')]=function(_0xd7bced,_0x5848f3,_0x2b4934){if(_0xd7bced[_0x927b('0x44')]['id']){delete _0xd7bced['body']['id'];}return db[_0x927b('0x2c')][_0x927b('0x46')]({'where':{'id':_0xd7bced[_0x927b('0x41')]['id']}})[_0x927b('0x25')](handleEntityNotFound(_0x5848f3,null))['then'](function(_0x5c7736){if(_0x5c7736){_0xd7bced[_0x927b('0x44')][_0x927b('0x4c')]=_0x5c7736['id'];_0xd7bced[_0x927b('0x44')][_0x927b('0x4d')]=integrations[_0x927b('0x4e')](_0xd7bced[_0x927b('0x44')]['channel'],_0xd7bced['body'][_0x927b('0x39')]);_0xd7bced[_0x927b('0x44')][_0x927b('0x4f')]=integrations[_0x927b('0x50')](_0xd7bced[_0x927b('0x44')]['channel'],_0xd7bced[_0x927b('0x44')][_0x927b('0x39')]);return db[_0x927b('0x47')][_0x927b('0x43')](_0xd7bced['body'],{'include':[{'model':db[_0x927b('0x51')],'as':'Subjects'},{'model':db[_0x927b('0x51')],'as':_0x927b('0x4f')}]});}return null;})[_0x927b('0x25')](respondWithResult(_0x5848f3,null))[_0x927b('0x40')](handleError(_0x5848f3,null));};exports['getFields']=function(_0x79aca2,_0x1b88f7,_0x5741f8){var _0x353653='';var _0x37e788=['id',_0x927b('0x29'),_0x927b('0x52'),_0x927b('0x53'),_0x927b('0x54'),_0x927b('0x55'),_0x927b('0x56'),_0x927b('0x57'),_0x927b('0x58'),'parent_type',_0x927b('0x59'),_0x927b('0x5a')];return db[_0x927b('0x2c')][_0x927b('0x46')]({'where':{'id':_0x79aca2['params']['id']},'attributes':['id',_0x927b('0x5b'),_0x927b('0x5c'),_0x927b('0x5d')]})['then'](handleEntityNotFound(_0x1b88f7,null))[_0x927b('0x25')](function(_0x42b8d5){if(_0x42b8d5){_0x353653=_0x42b8d5[_0x927b('0x5d')];var _0x2a178f=_0x353653[_0x927b('0x5e')](-0x1);if(_0x2a178f==='/'){_0x353653=_0x353653[_0x927b('0x5f')](0x0,_0x353653[_0x927b('0x60')](_0x2a178f));}return rp({'method':_0x927b('0x61'),'uri':util[_0x927b('0x62')](_0x927b('0x63'),_0x353653,_0x927b('0x64')),'json':!![],'form':{'method':_0x927b('0x65'),'input_type':_0x927b('0x66'),'response_type':_0x927b('0x66'),'rest_data':JSON[_0x927b('0x67')]({'user_auth':{'user_name':_0x42b8d5[_0x927b('0x5b')],'password':_0x42b8d5[_0x927b('0x5c')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x927b('0x25')](function(_0x12a7de){if(_0x12a7de&&_0x12a7de[_0x927b('0x29')]!==_0x927b('0x68')&&_0x12a7de[_0x927b('0x29')]!==_0x927b('0x69')){return rp({'method':_0x927b('0x61'),'uri':util[_0x927b('0x62')]('%s%s',_0x353653,_0x927b('0x64')),'json':!![],'form':{'method':_0x927b('0x6a'),'input_type':_0x927b('0x66'),'response_type':_0x927b('0x66'),'rest_data':JSON[_0x927b('0x67')]({'session':_0x12a7de['id'],'module_name':_0x927b('0x6b')})}})[_0x927b('0x25')](function(_0x161af0){if(_0x161af0){var _0x274af7=_[_0x927b('0x6c')](_0x161af0[_0x927b('0x6d')]);_[_0x927b('0x6e')](_0x274af7,function(_0x202fed){return _0x37e788[_0x927b('0x6f')](_0x202fed[_0x927b('0x29')]);});return{'count':_0x274af7[_0x927b('0x42')],'rows':_['map'](_0x274af7,function(_0x6d61a2){return{'id':_0x6d61a2[_0x927b('0x29')],'name':_0x6d61a2[_0x927b('0x70')],'custom':_[_0x927b('0x71')](_0x6d61a2['name'],'_c')?!![]:![],'options':_0x6d61a2[_0x927b('0x3b')]?_[_0x927b('0x2b')](_['values'](_0x6d61a2['options']),function(_0x5c7481){return{'name':_0x5c7481['value'],'value':_0x5c7481[_0x927b('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x1b88f7,null))[_0x927b('0x40')](function(_0x3e5158){var _0x247e10=_0x79aca2[_0x927b('0x33')][_0x927b('0x72')]?0x1f4:_0x3e5158['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x927b('0x73'),_0x247e10,JSON[_0x927b('0x67')](_0x3e5158));delete _0x3e5158[_0x927b('0x29')];if(_0x247e10===0x191){_0x247e10=0x190;}_0x1b88f7[_0x927b('0x19')](_0x247e10)['send'](_0x79aca2[_0x927b('0x33')][_0x927b('0x72')]?{'message':_0x927b('0x74'),'statusCode':_0x3e5158[_0x927b('0x75')]}:_0x3e5158);});}else{var _0x791f06=0x1f4;_0x1b88f7['status'](_0x791f06)['send']({'message':_0x927b('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x3af7=['json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','filter','options','includeAll','SugarcrmAccount','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','length','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','module_fields','remove','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x3af7,0x14f));var _0x73af=function(_0x4c398c,_0x76bbca){_0x4c398c=_0x4c398c-0x0;var _0x45ccd2=_0x3af7[_0x4c398c];return _0x45ccd2;};'use strict';var emlformat=require(_0x73af('0x0'));var rimraf=require(_0x73af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x73af('0x2'));var moment=require('moment');var BPromise=require(_0x73af('0x3'));var Mustache=require(_0x73af('0x4'));var util=require(_0x73af('0x5'));var path=require(_0x73af('0x6'));var sox=require(_0x73af('0x7'));var csv=require(_0x73af('0x8'));var ejs=require(_0x73af('0x9'));var fs=require('fs');var fs_extra=require(_0x73af('0xa'));var _=require(_0x73af('0xb'));var squel=require(_0x73af('0xc'));var crypto=require(_0x73af('0xd'));var jsforce=require(_0x73af('0xe'));var deskjs=require(_0x73af('0xf'));var toCsv=require(_0x73af('0x8'));var querystring=require('querystring');var Papa=require(_0x73af('0x10'));var Redis=require('ioredis');var authService=require(_0x73af('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x73af('0x12'))(_0x73af('0x13'));var utils=require(_0x73af('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x73af('0x15'));function respondWithStatusCode(_0xf9ad74,_0x5d6b53){_0x5d6b53=_0x5d6b53||0xcc;return function(_0x4a420b){if(_0x4a420b){return _0xf9ad74[_0x73af('0x16')](_0x5d6b53);}return _0xf9ad74['status'](_0x5d6b53)[_0x73af('0x17')]();};}function respondWithResult(_0x4aa2f6,_0x38f3b0){_0x38f3b0=_0x38f3b0||0xc8;return function(_0x3e8332){if(_0x3e8332){return _0x4aa2f6[_0x73af('0x18')](_0x38f3b0)[_0x73af('0x19')](_0x3e8332);}};}function respondWithFilteredResult(_0xfa2eec,_0x28de26){return function(_0x440f61){if(_0x440f61){var _0x2fb2af=typeof _0x28de26['offset']===_0x73af('0x1a')&&typeof _0x28de26['limit']==='undefined';var _0x34f4c2=_0x440f61[_0x73af('0x1b')];var _0x2d062b=_0x2fb2af?0x0:_0x28de26[_0x73af('0x1c')];var _0x4a1f24=_0x2fb2af?_0x440f61['count']:_0x28de26[_0x73af('0x1c')]+_0x28de26[_0x73af('0x1d')];var _0x19283c;if(_0x4a1f24>=_0x34f4c2){_0x4a1f24=_0x34f4c2;_0x19283c=0xc8;}else{_0x19283c=0xce;}_0xfa2eec[_0x73af('0x18')](_0x19283c);return _0xfa2eec['set'](_0x73af('0x1e'),_0x2d062b+'-'+_0x4a1f24+'/'+_0x34f4c2)['json'](_0x440f61);}return null;};}function patchUpdates(_0x30c09c){return function(_0x525244){try{jsonpatch[_0x73af('0x1f')](_0x525244,_0x30c09c,!![]);}catch(_0x2859c4){return BPromise[_0x73af('0x20')](_0x2859c4);}return _0x525244[_0x73af('0x21')]();};}function saveUpdates(_0x3dd617,_0x5ebded){return function(_0x2755ab){if(_0x2755ab){return _0x2755ab[_0x73af('0x22')](_0x3dd617)['then'](function(_0x3509ff){return _0x3509ff;});}return null;};}function removeEntity(_0x43bf6d,_0x3c7c3f){return function(_0x422dd1){if(_0x422dd1){return _0x422dd1[_0x73af('0x23')]()[_0x73af('0x24')](function(){_0x43bf6d[_0x73af('0x18')](0xcc)[_0x73af('0x17')]();});}};}function handleEntityNotFound(_0x1346bc,_0x290b8e){return function(_0x352dd1){if(!_0x352dd1){_0x1346bc[_0x73af('0x16')](0x194);}return _0x352dd1;};}function handleError(_0x111b9f,_0x3debad){_0x3debad=_0x3debad||0x1f4;return function(_0x4b8f79){logger[_0x73af('0x25')](_0x4b8f79[_0x73af('0x26')]);if(_0x4b8f79[_0x73af('0x27')]){delete _0x4b8f79[_0x73af('0x27')];}_0x111b9f[_0x73af('0x18')](_0x3debad)[_0x73af('0x28')](_0x4b8f79);};}exports[_0x73af('0x29')]=function(_0x1f9700,_0x308b56){var _0x4cf0fd={},_0x365395={},_0x2dd61e={'count':0x0,'rows':[]};var _0x432d06=_[_0x73af('0x2a')](db['SugarcrmAccount'][_0x73af('0x2b')],function(_0x290ceb){return{'name':_0x290ceb[_0x73af('0x2c')],'type':_0x290ceb[_0x73af('0x2d')][_0x73af('0x2e')]};});_0x365395[_0x73af('0x2f')]=_['map'](_0x432d06,_0x73af('0x27'));_0x365395[_0x73af('0x30')]=_[_0x73af('0x31')](_0x1f9700[_0x73af('0x30')]);_0x365395[_0x73af('0x32')]=_[_0x73af('0x33')](_0x365395[_0x73af('0x2f')],_0x365395[_0x73af('0x30')]);_0x4cf0fd[_0x73af('0x34')]=_['intersection'](_0x365395['model'],qs[_0x73af('0x35')](_0x1f9700[_0x73af('0x30')]['fields']));_0x4cf0fd['attributes']=_0x4cf0fd[_0x73af('0x34')]['length']?_0x4cf0fd[_0x73af('0x34')]:_0x365395[_0x73af('0x2f')];if(!_0x1f9700[_0x73af('0x30')]['hasOwnProperty']('nolimit')){_0x4cf0fd[_0x73af('0x1d')]=qs[_0x73af('0x1d')](_0x1f9700[_0x73af('0x30')][_0x73af('0x1d')]);_0x4cf0fd['offset']=qs[_0x73af('0x1c')](_0x1f9700[_0x73af('0x30')][_0x73af('0x1c')]);}_0x4cf0fd[_0x73af('0x36')]=qs[_0x73af('0x37')](_0x1f9700[_0x73af('0x30')][_0x73af('0x37')]);_0x4cf0fd[_0x73af('0x38')]=qs[_0x73af('0x32')](_[_0x73af('0x39')](_0x1f9700[_0x73af('0x30')],_0x365395[_0x73af('0x32')]),_0x432d06);if(_0x1f9700[_0x73af('0x30')]['filter']){_0x4cf0fd[_0x73af('0x38')]=_[_0x73af('0x3a')](_0x4cf0fd[_0x73af('0x38')],{'$or':_[_0x73af('0x2a')](_0x432d06,function(_0x2d2732){if(_0x2d2732[_0x73af('0x2d')]!=='VIRTUAL'){var _0x538f84={};_0x538f84[_0x2d2732[_0x73af('0x27')]]={'$like':'%'+_0x1f9700[_0x73af('0x30')][_0x73af('0x3b')]+'%'};return _0x538f84;}})});}_0x4cf0fd=_[_0x73af('0x3a')]({},_0x4cf0fd,_0x1f9700[_0x73af('0x3c')]);var _0x2530c1={'where':_0x4cf0fd['where']};return db['SugarcrmAccount'][_0x73af('0x1b')](_0x2530c1)[_0x73af('0x24')](function(_0x3dbb63){_0x2dd61e[_0x73af('0x1b')]=_0x3dbb63;if(_0x1f9700[_0x73af('0x30')][_0x73af('0x3d')]){_0x4cf0fd['include']=[{'all':!![]}];}return db[_0x73af('0x3e')]['findAll'](_0x4cf0fd);})[_0x73af('0x24')](function(_0x395c50){_0x2dd61e[_0x73af('0x3f')]=_0x395c50;return _0x2dd61e;})['then'](respondWithFilteredResult(_0x308b56,_0x4cf0fd))[_0x73af('0x40')](handleError(_0x308b56,null));};exports[_0x73af('0x41')]=function(_0x41fd89,_0x3fb1cb){var _0x50651f={'raw':![],'where':{'id':_0x41fd89[_0x73af('0x42')]['id']}},_0x2127bb={};_0x2127bb[_0x73af('0x2f')]=_[_0x73af('0x31')](db[_0x73af('0x3e')][_0x73af('0x2b')]);_0x2127bb[_0x73af('0x30')]=_[_0x73af('0x31')](_0x41fd89[_0x73af('0x30')]);_0x2127bb[_0x73af('0x32')]=_['intersection'](_0x2127bb[_0x73af('0x2f')],_0x2127bb[_0x73af('0x30')]);_0x50651f[_0x73af('0x34')]=_[_0x73af('0x33')](_0x2127bb[_0x73af('0x2f')],qs[_0x73af('0x35')](_0x41fd89[_0x73af('0x30')][_0x73af('0x35')]));_0x50651f[_0x73af('0x34')]=_0x50651f[_0x73af('0x34')]['length']?_0x50651f['attributes']:_0x2127bb['model'];if(_0x41fd89['query'][_0x73af('0x3d')]){_0x50651f[_0x73af('0x43')]=[{'all':!![]}];}_0x50651f=_[_0x73af('0x3a')]({},_0x50651f,_0x41fd89[_0x73af('0x3c')]);return db[_0x73af('0x3e')][_0x73af('0x44')](_0x50651f)[_0x73af('0x24')](handleEntityNotFound(_0x3fb1cb,null))[_0x73af('0x24')](respondWithResult(_0x3fb1cb,null))[_0x73af('0x40')](handleError(_0x3fb1cb,null));};exports[_0x73af('0x45')]=function(_0x3f2d4f,_0x523e83){return db[_0x73af('0x3e')][_0x73af('0x45')](_0x3f2d4f['body'],{})[_0x73af('0x24')](respondWithResult(_0x523e83,0xc9))[_0x73af('0x40')](handleError(_0x523e83,null));};exports[_0x73af('0x22')]=function(_0x2be247,_0x3d4e92){if(_0x2be247[_0x73af('0x46')]['id']){delete _0x2be247[_0x73af('0x46')]['id'];}return db[_0x73af('0x3e')][_0x73af('0x44')]({'where':{'id':_0x2be247[_0x73af('0x42')]['id']}})[_0x73af('0x24')](handleEntityNotFound(_0x3d4e92,null))[_0x73af('0x24')](saveUpdates(_0x2be247['body'],null))[_0x73af('0x24')](respondWithResult(_0x3d4e92,null))[_0x73af('0x40')](handleError(_0x3d4e92,null));};exports[_0x73af('0x23')]=function(_0x4982dd,_0x4baf6e){return db[_0x73af('0x3e')][_0x73af('0x44')]({'where':{'id':_0x4982dd[_0x73af('0x42')]['id']}})[_0x73af('0x24')](handleEntityNotFound(_0x4baf6e,null))[_0x73af('0x24')](removeEntity(_0x4baf6e,null))[_0x73af('0x40')](handleError(_0x4baf6e,null));};exports[_0x73af('0x47')]=function(_0x3e50d6,_0x27556b,_0x4bb2a4){var _0x412b23={};var _0x2562be={};var _0x24b46f;var _0x29e914;return db[_0x73af('0x3e')][_0x73af('0x48')]({'where':{'id':_0x3e50d6['params']['id']}})['then'](handleEntityNotFound(_0x27556b,null))[_0x73af('0x24')](function(_0x427b43){if(_0x427b43){_0x24b46f=_0x427b43;_0x2562be[_0x73af('0x2f')]=_['keys'](db[_0x73af('0x49')][_0x73af('0x2b')]);_0x2562be[_0x73af('0x30')]=_[_0x73af('0x31')](_0x3e50d6[_0x73af('0x30')]);_0x2562be[_0x73af('0x32')]=_[_0x73af('0x33')](_0x2562be[_0x73af('0x2f')],_0x2562be[_0x73af('0x30')]);_0x412b23[_0x73af('0x34')]=_['intersection'](_0x2562be[_0x73af('0x2f')],qs[_0x73af('0x35')](_0x3e50d6[_0x73af('0x30')]['fields']));_0x412b23[_0x73af('0x34')]=_0x412b23[_0x73af('0x34')][_0x73af('0x4a')]?_0x412b23[_0x73af('0x34')]:_0x2562be[_0x73af('0x2f')];_0x412b23[_0x73af('0x36')]=qs[_0x73af('0x37')](_0x3e50d6[_0x73af('0x30')][_0x73af('0x37')]);_0x412b23[_0x73af('0x38')]=qs[_0x73af('0x32')](_[_0x73af('0x39')](_0x3e50d6[_0x73af('0x30')],_0x2562be['filters']));if(_0x3e50d6[_0x73af('0x30')][_0x73af('0x3b')]){_0x412b23['where']=_[_0x73af('0x3a')](_0x412b23['where'],{'$or':_['map'](_0x412b23[_0x73af('0x34')],function(_0x1169e0){var _0x233d32={};_0x233d32[_0x1169e0]={'$like':'%'+_0x3e50d6['query'][_0x73af('0x3b')]+'%'};return _0x233d32;})});}_0x412b23=_[_0x73af('0x3a')]({},_0x412b23,_0x3e50d6[_0x73af('0x3c')]);return _0x24b46f[_0x73af('0x47')](_0x412b23);}})[_0x73af('0x24')](function(_0x3b2a6d){if(_0x3b2a6d){_0x29e914=_0x3b2a6d['length'];if(!_0x3e50d6[_0x73af('0x30')][_0x73af('0x4b')](_0x73af('0x4c'))){_0x412b23['limit']=qs['limit'](_0x3e50d6[_0x73af('0x30')][_0x73af('0x1d')]);_0x412b23['offset']=qs['offset'](_0x3e50d6[_0x73af('0x30')]['offset']);}return _0x24b46f[_0x73af('0x47')](_0x412b23);}})[_0x73af('0x24')](function(_0x5ee0f3){if(_0x5ee0f3){return _0x5ee0f3?{'count':_0x29e914,'rows':_0x5ee0f3}:null;}})[_0x73af('0x24')](respondWithResult(_0x27556b,null))['catch'](handleError(_0x27556b,null));};exports[_0x73af('0x4d')]=function(_0x1dc797,_0x3ce4fa,_0x2c8945){if(_0x1dc797[_0x73af('0x46')]['id']){delete _0x1dc797[_0x73af('0x46')]['id'];}return db[_0x73af('0x3e')]['findOne']({'where':{'id':_0x1dc797[_0x73af('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ce4fa,null))['then'](function(_0x4f3936){if(_0x4f3936){_0x1dc797['body'][_0x73af('0x4e')]=_0x4f3936['id'];_0x1dc797[_0x73af('0x46')][_0x73af('0x4f')]=integrations[_0x73af('0x50')](_0x1dc797[_0x73af('0x46')]['channel'],_0x1dc797[_0x73af('0x46')][_0x73af('0x2d')]);_0x1dc797[_0x73af('0x46')][_0x73af('0x51')]=integrations[_0x73af('0x52')](_0x1dc797[_0x73af('0x46')]['channel'],_0x1dc797['body'][_0x73af('0x2d')]);return db[_0x73af('0x49')][_0x73af('0x45')](_0x1dc797['body'],{'include':[{'model':db[_0x73af('0x53')],'as':_0x73af('0x4f')},{'model':db[_0x73af('0x53')],'as':_0x73af('0x51')}]});}return null;})[_0x73af('0x24')](respondWithResult(_0x3ce4fa,null))[_0x73af('0x40')](handleError(_0x3ce4fa,null));};exports[_0x73af('0x54')]=function(_0x442d25,_0xc082d,_0x2f8cec){var _0x53a22d='';var _0x40fda7=['id',_0x73af('0x27'),_0x73af('0x55'),_0x73af('0x56'),'description',_0x73af('0x57'),_0x73af('0x58'),_0x73af('0x59'),_0x73af('0x5a'),_0x73af('0x5b'),_0x73af('0x5c'),_0x73af('0x5d')];return db[_0x73af('0x3e')][_0x73af('0x48')]({'where':{'id':_0x442d25[_0x73af('0x42')]['id']},'attributes':['id','username','password',_0x73af('0x5e')]})[_0x73af('0x24')](handleEntityNotFound(_0xc082d,null))[_0x73af('0x24')](function(_0x1a4abb){if(_0x1a4abb){_0x53a22d=_0x1a4abb[_0x73af('0x5e')];var _0x2ea12c=_0x53a22d[_0x73af('0x5f')](-0x1);if(_0x2ea12c==='/'){_0x53a22d=_0x53a22d[_0x73af('0x60')](0x0,_0x53a22d[_0x73af('0x61')](_0x2ea12c));}return rp({'method':_0x73af('0x62'),'uri':util['format'](_0x73af('0x63'),_0x53a22d,_0x73af('0x64')),'json':!![],'form':{'method':_0x73af('0x65'),'input_type':'JSON','response_type':_0x73af('0x66'),'rest_data':JSON[_0x73af('0x67')]({'user_auth':{'user_name':_0x1a4abb['username'],'password':_0x1a4abb[_0x73af('0x68')],'encryption':_0x73af('0x69')},'application':_0x73af('0x6a')})}});}})[_0x73af('0x24')](function(_0x2053aa){if(_0x2053aa&&_0x2053aa[_0x73af('0x27')]!==_0x73af('0x6b')&&_0x2053aa[_0x73af('0x27')]!==_0x73af('0x6c')){return rp({'method':'POST','uri':util[_0x73af('0x6d')]('%s%s',_0x53a22d,_0x73af('0x64')),'json':!![],'form':{'method':_0x73af('0x6e'),'input_type':_0x73af('0x66'),'response_type':_0x73af('0x66'),'rest_data':JSON['stringify']({'session':_0x2053aa['id'],'module_name':_0x73af('0x6f')})}})[_0x73af('0x24')](function(_0x3c99bc){if(_0x3c99bc){var _0x727480=_[_0x73af('0x70')](_0x3c99bc[_0x73af('0x71')]);_[_0x73af('0x72')](_0x727480,function(_0x1f1f91){return _0x40fda7['includes'](_0x1f1f91['name']);});return{'count':_0x727480[_0x73af('0x4a')],'rows':_['map'](_0x727480,function(_0x1dcf61){return{'id':_0x1dcf61['name'],'name':_0x1dcf61[_0x73af('0x73')],'custom':_['endsWith'](_0x1dcf61['name'],'_c')?!![]:![],'options':_0x1dcf61[_0x73af('0x3c')]?_[_0x73af('0x2a')](_['values'](_0x1dcf61[_0x73af('0x3c')]),function(_0x399935){return{'name':_0x399935['value'],'value':_0x399935[_0x73af('0x27')]};}):[]};})};}})[_0x73af('0x24')](respondWithResult(_0xc082d,null))[_0x73af('0x40')](function(_0x482f5d){var _0x2b8550=_0x442d25[_0x73af('0x30')][_0x73af('0x74')]?0x1f4:_0x482f5d[_0x73af('0x75')]||0x1f4;logger[_0x73af('0x25')](_0x73af('0x76'),_0x73af('0x54'),_0x2b8550,JSON[_0x73af('0x67')](_0x482f5d));delete _0x482f5d[_0x73af('0x27')];if(_0x2b8550===0x191){_0x2b8550=0x190;}_0xc082d[_0x73af('0x18')](_0x2b8550)[_0x73af('0x28')](_0x442d25[_0x73af('0x30')][_0x73af('0x74')]?{'message':_0x73af('0x77'),'statusCode':_0x482f5d[_0x73af('0x75')]}:_0x482f5d);});}else{var _0x26d5b9=0x1f4;_0xc082d[_0x73af('0x18')](_0x26d5b9)[_0x73af('0x28')]({'message':_0x73af('0x77'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 1f7f689..464a9e7 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 _0x6755=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash','util','api','moment'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x6755,0x193));var _0x5675=function(_0x3575c5,_0x551008){_0x3575c5=_0x3575c5-0x0;var _0x3f3130=_0x6755[_0x3575c5];return _0x3f3130;};'use strict';var _=require(_0x5675('0x0'));var util=require(_0x5675('0x1'));var logger=require('../../config/logger')(_0x5675('0x2'));var moment=require(_0x5675('0x3'));var BPromise=require('bluebird');var rp=require(_0x5675('0x4'));var fs=require('fs');var path=require(_0x5675('0x5'));var rimraf=require(_0x5675('0x6'));var config=require(_0x5675('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x5675('0x8'));module[_0x5675('0x9')]=function(_0x425a6c,_0x323b58){return _0x425a6c['define']('SugarcrmAccount',attributes,{'tableName':_0x5675('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x233e=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','moment'];(function(_0x21a62c,_0x44876){var _0x5f1141=function(_0x5ae9d0){while(--_0x5ae9d0){_0x21a62c['push'](_0x21a62c['shift']());}};_0x5f1141(++_0x44876);}(_0x233e,0x1dd));var _0xe233=function(_0x178b95,_0x5dabf1){_0x178b95=_0x178b95-0x0;var _0xa8d853=_0x233e[_0x178b95];return _0xa8d853;};'use strict';var _=require('lodash');var util=require(_0xe233('0x0'));var logger=require(_0xe233('0x1'))('api');var moment=require(_0xe233('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe233('0x3'));var rimraf=require(_0xe233('0x4'));var config=require(_0xe233('0x5'));var attributes=require(_0xe233('0x6'));var integrations=require(_0xe233('0x7'));module[_0xe233('0x8')]=function(_0x4e0c5b,_0x74df9a){return _0x4e0c5b[_0xe233('0x9')](_0xe233('0xa'),attributes,{'tableName':_0xe233('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 66098f5..54e0993 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 _0xe32b=['include','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','findAll','options','raw','attributes','limit','map'];(function(_0xb51d0,_0x3f00c6){var _0x321e96=function(_0x2a805d){while(--_0x2a805d){_0xb51d0['push'](_0xb51d0['shift']());}};_0x321e96(++_0x3f00c6);}(_0xe32b,0x10e));var _0xbe32=function(_0x6981cc,_0xcfed1a){_0x6981cc=_0x6981cc-0x0;var _0xa6eefc=_0xe32b[_0x6981cc];return _0xa6eefc;};'use strict';var _=require(_0xbe32('0x0'));var util=require(_0xbe32('0x1'));var moment=require('moment');var BPromise=require(_0xbe32('0x2'));var rs=require(_0xbe32('0x3'));var fs=require('fs');var Redis=require(_0xbe32('0x4'));var db=require(_0xbe32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe32('0x6'))(_0xbe32('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe32('0x8'));var client=jayson[_0xbe32('0x9')][_0xbe32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d20a3,_0x41e03b,_0xfba074){return new BPromise(function(_0x14922f,_0x5ae6a7){return client['request'](_0x3d20a3,_0xfba074)[_0xbe32('0xb')](function(_0x54f52f){logger[_0xbe32('0xc')](_0xbe32('0xd'),_0x41e03b,_0xbe32('0xe'));logger[_0xbe32('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x41e03b,'request\x20sent',JSON[_0xbe32('0x10')](_0x54f52f));if(_0x54f52f[_0xbe32('0x11')]){if(_0x54f52f[_0xbe32('0x11')][_0xbe32('0x12')]===0x1f4){logger['error'](_0xbe32('0xd'),_0x41e03b,_0x54f52f['error'][_0xbe32('0x13')]);return _0x5ae6a7(_0x54f52f['error'][_0xbe32('0x13')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x41e03b,_0x54f52f[_0xbe32('0x11')]['message']);return _0x14922f(_0x54f52f['error'][_0xbe32('0x13')]);}else{logger[_0xbe32('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x41e03b,_0xbe32('0xe'));_0x14922f(_0x54f52f['result'][_0xbe32('0x13')]);}})[_0xbe32('0x14')](function(_0xabcf3a){logger[_0xbe32('0x11')](_0xbe32('0xd'),_0x41e03b,_0xabcf3a);_0x5ae6a7(_0xabcf3a);});});}exports['GetSugarcrmAccount']=function(_0x4f9a07){var _0x1b4d81=this;return new Promise(function(_0x2bd4f6,_0x3e1835){return db['SugarcrmAccount'][_0xbe32('0x15')]({'raw':_0x4f9a07[_0xbe32('0x16')]?_0x4f9a07['options'][_0xbe32('0x17')]===undefined?!![]:![]:!![],'where':_0x4f9a07[_0xbe32('0x16')]?_0x4f9a07['options']['where']||null:null,'attributes':_0x4f9a07[_0xbe32('0x16')]?_0x4f9a07[_0xbe32('0x16')][_0xbe32('0x18')]||null:null,'limit':_0x4f9a07[_0xbe32('0x16')]?_0x4f9a07[_0xbe32('0x16')][_0xbe32('0x19')]||null:null,'include':_0x4f9a07[_0xbe32('0x16')]?_0x4f9a07[_0xbe32('0x16')]['include']?_[_0xbe32('0x1a')](_0x4f9a07[_0xbe32('0x16')][_0xbe32('0x1b')],function(_0x12c858){return{'model':db[_0x12c858[_0xbe32('0x1c')]],'as':_0x12c858['as'],'attributes':_0x12c858[_0xbe32('0x18')],'include':_0x12c858[_0xbe32('0x1b')]?_['map'](_0x12c858[_0xbe32('0x1b')],function(_0x35a392){return{'model':db[_0x35a392['model']],'as':_0x35a392['as'],'attributes':_0x35a392[_0xbe32('0x18')],'include':_0x35a392[_0xbe32('0x1b')]?_[_0xbe32('0x1a')](_0x35a392[_0xbe32('0x1b')],function(_0x3f87ca){return{'model':db[_0x3f87ca[_0xbe32('0x1c')]],'as':_0x3f87ca['as'],'attributes':_0x3f87ca['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe32('0xb')](function(_0x478c94){logger[_0xbe32('0xc')](_0xbe32('0x1d'),_0x4f9a07);logger['debug'](_0xbe32('0x1d'),_0x4f9a07,JSON[_0xbe32('0x10')](_0x478c94));_0x2bd4f6(_0x478c94);})[_0xbe32('0x14')](function(_0x57161a){logger[_0xbe32('0x11')](_0xbe32('0x1d'),_0x57161a['message'],_0x4f9a07);_0x3e1835(_0x1b4d81[_0xbe32('0x11')](0x1f4,_0x57161a[_0xbe32('0x13')]));});});};exports[_0xbe32('0x1e')]=function(_0x3bf022){var _0x5daf00=this;return new Promise(function(_0x566aa4,_0x5284a2){return db['SugarcrmAccount'][_0xbe32('0x1f')]({'raw':_0x3bf022[_0xbe32('0x16')]?_0x3bf022[_0xbe32('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3bf022[_0xbe32('0x16')]?_0x3bf022[_0xbe32('0x16')][_0xbe32('0x20')]||null:null,'attributes':_0x3bf022[_0xbe32('0x16')]?_0x3bf022[_0xbe32('0x16')]['attributes']||null:null,'include':_0x3bf022[_0xbe32('0x16')]?_0x3bf022['options']['include']?_[_0xbe32('0x1a')](_0x3bf022[_0xbe32('0x16')][_0xbe32('0x1b')],function(_0x591538){return{'model':db[_0x591538[_0xbe32('0x1c')]],'as':_0x591538['as'],'attributes':_0x591538[_0xbe32('0x18')],'include':_0x591538[_0xbe32('0x1b')]?_[_0xbe32('0x1a')](_0x591538['include'],function(_0x7eb817){return{'model':db[_0x7eb817[_0xbe32('0x1c')]],'as':_0x7eb817['as'],'attributes':_0x7eb817[_0xbe32('0x18')],'include':_0x7eb817[_0xbe32('0x1b')]?_[_0xbe32('0x1a')](_0x7eb817[_0xbe32('0x1b')],function(_0x1adb7e){return{'model':db[_0x1adb7e[_0xbe32('0x1c')]],'as':_0x1adb7e['as'],'attributes':_0x1adb7e[_0xbe32('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbe32('0xb')](function(_0x138511){logger[_0xbe32('0xc')](_0xbe32('0x1e'),_0x3bf022);logger['debug'](_0xbe32('0x1e'),_0x3bf022,JSON[_0xbe32('0x10')](_0x138511));_0x566aa4(_0x138511);})['catch'](function(_0x3b43d7){logger[_0xbe32('0x11')](_0xbe32('0x1e'),_0x3b43d7[_0xbe32('0x13')],_0x3bf022);_0x5284a2(_0x5daf00['error'](0x1f4,_0x3b43d7[_0xbe32('0x13')]));});});}; \ No newline at end of file +var _0xc2c7=['request\x20sent','stringify','code','SugarcrmAccount,\x20%s,\x20%s','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0xc2c7,0x13e));var _0x7c2c=function(_0xa9602c,_0x5052c4){_0xa9602c=_0xa9602c-0x0;var _0x5629e0=_0xc2c7[_0xa9602c];return _0x5629e0;};'use strict';var _=require(_0x7c2c('0x0'));var util=require(_0x7c2c('0x1'));var moment=require(_0x7c2c('0x2'));var BPromise=require(_0x7c2c('0x3'));var rs=require(_0x7c2c('0x4'));var fs=require('fs');var Redis=require(_0x7c2c('0x5'));var db=require(_0x7c2c('0x6'))['db'];var utils=require(_0x7c2c('0x7'));var logger=require(_0x7c2c('0x8'))(_0x7c2c('0x9'));var config=require(_0x7c2c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7c2c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39628a,_0x366c09,_0x33cbde){return new BPromise(function(_0x3f8b51,_0x21bae0){return client['request'](_0x39628a,_0x33cbde)['then'](function(_0x56a55b){logger[_0x7c2c('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x366c09,'request\x20sent');logger[_0x7c2c('0xd')](_0x7c2c('0xe'),_0x366c09,_0x7c2c('0xf'),JSON[_0x7c2c('0x10')](_0x56a55b));if(_0x56a55b['error']){if(_0x56a55b['error'][_0x7c2c('0x11')]===0x1f4){logger['error'](_0x7c2c('0x12'),_0x366c09,_0x56a55b[_0x7c2c('0x13')][_0x7c2c('0x14')]);return _0x21bae0(_0x56a55b['error'][_0x7c2c('0x14')]);}logger[_0x7c2c('0x13')](_0x7c2c('0x12'),_0x366c09,_0x56a55b[_0x7c2c('0x13')][_0x7c2c('0x14')]);return _0x3f8b51(_0x56a55b[_0x7c2c('0x13')][_0x7c2c('0x14')]);}else{logger[_0x7c2c('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x366c09,_0x7c2c('0xf'));_0x3f8b51(_0x56a55b[_0x7c2c('0x15')][_0x7c2c('0x14')]);}})['catch'](function(_0x444be9){logger[_0x7c2c('0x13')](_0x7c2c('0x12'),_0x366c09,_0x444be9);_0x21bae0(_0x444be9);});});}exports[_0x7c2c('0x16')]=function(_0x1671f7){var _0x506a21=this;return new Promise(function(_0x8f4fa8,_0x123076){return db[_0x7c2c('0x17')][_0x7c2c('0x18')]({'raw':_0x1671f7[_0x7c2c('0x19')]?_0x1671f7[_0x7c2c('0x19')][_0x7c2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x1671f7[_0x7c2c('0x19')]?_0x1671f7[_0x7c2c('0x19')][_0x7c2c('0x1b')]||null:null,'attributes':_0x1671f7['options']?_0x1671f7[_0x7c2c('0x19')][_0x7c2c('0x1c')]||null:null,'limit':_0x1671f7[_0x7c2c('0x19')]?_0x1671f7[_0x7c2c('0x19')][_0x7c2c('0x1d')]||null:null,'include':_0x1671f7['options']?_0x1671f7['options'][_0x7c2c('0x1e')]?_[_0x7c2c('0x1f')](_0x1671f7[_0x7c2c('0x19')]['include'],function(_0x33d90e){return{'model':db[_0x33d90e[_0x7c2c('0x20')]],'as':_0x33d90e['as'],'attributes':_0x33d90e['attributes'],'include':_0x33d90e[_0x7c2c('0x1e')]?_[_0x7c2c('0x1f')](_0x33d90e['include'],function(_0x2ee2b5){return{'model':db[_0x2ee2b5[_0x7c2c('0x20')]],'as':_0x2ee2b5['as'],'attributes':_0x2ee2b5[_0x7c2c('0x1c')],'include':_0x2ee2b5[_0x7c2c('0x1e')]?_['map'](_0x2ee2b5[_0x7c2c('0x1e')],function(_0x2b4f06){return{'model':db[_0x2b4f06[_0x7c2c('0x20')]],'as':_0x2b4f06['as'],'attributes':_0x2b4f06[_0x7c2c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0x21')](function(_0x4b14af){logger[_0x7c2c('0xc')]('GetSugarcrmAccount',_0x1671f7);logger[_0x7c2c('0xd')](_0x7c2c('0x16'),_0x1671f7,JSON[_0x7c2c('0x10')](_0x4b14af));_0x8f4fa8(_0x4b14af);})[_0x7c2c('0x22')](function(_0x484927){logger['error'](_0x7c2c('0x16'),_0x484927[_0x7c2c('0x14')],_0x1671f7);_0x123076(_0x506a21[_0x7c2c('0x13')](0x1f4,_0x484927[_0x7c2c('0x14')]));});});};exports[_0x7c2c('0x23')]=function(_0x348d7d){var _0x51cf53=this;return new Promise(function(_0x3274be,_0x3aa96b){return db[_0x7c2c('0x17')][_0x7c2c('0x24')]({'raw':_0x348d7d[_0x7c2c('0x19')]?_0x348d7d[_0x7c2c('0x19')][_0x7c2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x348d7d[_0x7c2c('0x19')]?_0x348d7d['options'][_0x7c2c('0x1b')]||null:null,'attributes':_0x348d7d[_0x7c2c('0x19')]?_0x348d7d[_0x7c2c('0x19')][_0x7c2c('0x1c')]||null:null,'include':_0x348d7d[_0x7c2c('0x19')]?_0x348d7d[_0x7c2c('0x19')]['include']?_['map'](_0x348d7d[_0x7c2c('0x19')]['include'],function(_0x12cabf){return{'model':db[_0x12cabf[_0x7c2c('0x20')]],'as':_0x12cabf['as'],'attributes':_0x12cabf[_0x7c2c('0x1c')],'include':_0x12cabf['include']?_[_0x7c2c('0x1f')](_0x12cabf[_0x7c2c('0x1e')],function(_0x1ee9b5){return{'model':db[_0x1ee9b5[_0x7c2c('0x20')]],'as':_0x1ee9b5['as'],'attributes':_0x1ee9b5[_0x7c2c('0x1c')],'include':_0x1ee9b5[_0x7c2c('0x1e')]?_['map'](_0x1ee9b5[_0x7c2c('0x1e')],function(_0x4f94a0){return{'model':db[_0x4f94a0['model']],'as':_0x4f94a0['as'],'attributes':_0x4f94a0[_0x7c2c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0x21')](function(_0x56d8f8){logger[_0x7c2c('0xc')]('ShowSugarcrmAccount',_0x348d7d);logger[_0x7c2c('0xd')](_0x7c2c('0x23'),_0x348d7d,JSON[_0x7c2c('0x10')](_0x56d8f8));_0x3274be(_0x56d8f8);})[_0x7c2c('0x22')](function(_0x2deef1){logger[_0x7c2c('0x13')](_0x7c2c('0x23'),_0x2deef1['message'],_0x348d7d);_0x3aa96b(_0x51cf53[_0x7c2c('0x13')](0x1f4,_0x2deef1[_0x7c2c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 83f6777..18993ce 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 _0x9918=['./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x43f006,_0x2815f6){var _0x1f6ed5=function(_0x240548){while(--_0x240548){_0x43f006['push'](_0x43f006['shift']());}};_0x1f6ed5(++_0x2815f6);}(_0x9918,0x186));var _0x8991=function(_0x3f8fa5,_0xa2656){_0x3f8fa5=_0x3f8fa5-0x0;var _0x42542e=_0x9918[_0x3f8fa5];return _0x42542e;};'use strict';var multer=require(_0x8991('0x0'));var util=require(_0x8991('0x1'));var path=require('path');var timeout=require(_0x8991('0x2'));var express=require(_0x8991('0x3'));var router=express[_0x8991('0x4')]();var fs_extra=require(_0x8991('0x5'));var auth=require(_0x8991('0x6'));var interaction=require(_0x8991('0x7'));var config=require(_0x8991('0x8'));var controller=require(_0x8991('0x9'));router[_0x8991('0xa')]('/',auth[_0x8991('0xb')](),controller[_0x8991('0xc')]);router[_0x8991('0xa')](_0x8991('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8991('0xe'),auth[_0x8991('0xb')](),controller['getFields']);router[_0x8991('0xa')](_0x8991('0xf'),auth[_0x8991('0xb')](),controller[_0x8991('0x10')]);router['get'](_0x8991('0x11'),auth[_0x8991('0xb')](),controller['getDescriptions']);router[_0x8991('0x12')]('/',auth[_0x8991('0xb')](),controller['create']);router['put'](_0x8991('0xd'),auth[_0x8991('0xb')](),controller['update']);router['delete'](_0x8991('0xd'),auth[_0x8991('0xb')](),controller[_0x8991('0x13')]);module[_0x8991('0x14')]=router; \ No newline at end of file +var _0xd22e=['/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index'];(function(_0x13cd20,_0x1d9211){var _0x22b6de=function(_0x4b574f){while(--_0x4b574f){_0x13cd20['push'](_0x13cd20['shift']());}};_0x22b6de(++_0x1d9211);}(_0xd22e,0x1ac));var _0xed22=function(_0x896663,_0x4231f6){_0x896663=_0x896663-0x0;var _0x122747=_0xd22e[_0x896663];return _0x122747;};'use strict';var multer=require(_0xed22('0x0'));var util=require(_0xed22('0x1'));var path=require('path');var timeout=require(_0xed22('0x2'));var express=require(_0xed22('0x3'));var router=express[_0xed22('0x4')]();var fs_extra=require(_0xed22('0x5'));var auth=require(_0xed22('0x6'));var interaction=require(_0xed22('0x7'));var config=require(_0xed22('0x8'));var controller=require(_0xed22('0x9'));router[_0xed22('0xa')]('/',auth[_0xed22('0xb')](),controller[_0xed22('0xc')]);router[_0xed22('0xa')](_0xed22('0xd'),auth[_0xed22('0xb')](),controller['show']);router[_0xed22('0xa')](_0xed22('0xe'),auth[_0xed22('0xb')](),controller[_0xed22('0xf')]);router[_0xed22('0xa')](_0xed22('0x10'),auth[_0xed22('0xb')](),controller['getSubjects']);router['get'](_0xed22('0x11'),auth[_0xed22('0xb')](),controller['getDescriptions']);router[_0xed22('0x12')]('/',auth[_0xed22('0xb')](),controller['create']);router[_0xed22('0x13')](_0xed22('0xd'),auth[_0xed22('0xb')](),controller['update']);router[_0xed22('0x14')](_0xed22('0xd'),auth[_0xed22('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index e2bb142..88145c5 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 _0xd24c=['STRING','sequelize','exports'];(function(_0x2fe3e4,_0x5c3560){var _0x27e608=function(_0x4b7259){while(--_0x4b7259){_0x2fe3e4['push'](_0x2fe3e4['shift']());}};_0x27e608(++_0x5c3560);}(_0xd24c,0xb5));var _0xcd24=function(_0x69a830,_0x5547a5){_0x69a830=_0x69a830-0x0;var _0x16fd2a=_0xd24c[_0x69a830];return _0x16fd2a;};'use strict';var Sequelize=require(_0xcd24('0x0'));module[_0xcd24('0x1')]={'name':{'type':Sequelize[_0xcd24('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1bef=['sequelize','exports','STRING'];(function(_0x122826,_0x4a44ed){var _0xbfc95e=function(_0x42dfa1){while(--_0x42dfa1){_0x122826['push'](_0x122826['shift']());}};_0xbfc95e(++_0x4a44ed);}(_0x1bef,0xb1));var _0xf1be=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1bef[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xf1be('0x0'));module[_0xf1be('0x1')]={'name':{'type':Sequelize[_0xf1be('0x2')]},'description':{'type':Sequelize[_0xf1be('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 2eb6a46..f753ffc 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 _0x6aee=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length'];(function(_0xf520d9,_0x1fa87c){var _0x33af6f=function(_0x4aabcb){while(--_0x4aabcb){_0xf520d9['push'](_0xf520d9['shift']());}};_0x33af6f(++_0x1fa87c);}(_0x6aee,0x159));var _0xe6ae=function(_0x255cd1,_0x22c2bf){_0x255cd1=_0x255cd1-0x0;var _0x2dd60c=_0x6aee[_0x255cd1];return _0x2dd60c;};'use strict';var emlformat=require(_0xe6ae('0x0'));var rimraf=require(_0xe6ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6ae('0x2'));var rp=require(_0xe6ae('0x3'));var moment=require(_0xe6ae('0x4'));var BPromise=require(_0xe6ae('0x5'));var Mustache=require('mustache');var util=require(_0xe6ae('0x6'));var path=require(_0xe6ae('0x7'));var sox=require('sox');var csv=require(_0xe6ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6ae('0x9'));var _=require('lodash');var squel=require(_0xe6ae('0xa'));var crypto=require(_0xe6ae('0xb'));var jsforce=require(_0xe6ae('0xc'));var deskjs=require(_0xe6ae('0xd'));var toCsv=require(_0xe6ae('0x8'));var querystring=require(_0xe6ae('0xe'));var Papa=require(_0xe6ae('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe6ae('0x10'));var as=require(_0xe6ae('0x11'));var hardwareService=require(_0xe6ae('0x12'));var logger=require(_0xe6ae('0x13'))(_0xe6ae('0x14'));var utils=require(_0xe6ae('0x15'));var config=require(_0xe6ae('0x16'));var licenseUtil=require(_0xe6ae('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1245a7,_0x93deea){_0x93deea=_0x93deea||0xcc;return function(_0x422691){if(_0x422691){return _0x1245a7[_0xe6ae('0x18')](_0x93deea);}return _0x1245a7[_0xe6ae('0x19')](_0x93deea)[_0xe6ae('0x1a')]();};}function respondWithResult(_0x250bd2,_0x2d3770){_0x2d3770=_0x2d3770||0xc8;return function(_0x465188){if(_0x465188){return _0x250bd2[_0xe6ae('0x19')](_0x2d3770)[_0xe6ae('0x1b')](_0x465188);}};}function respondWithFilteredResult(_0x4862a9,_0x23a2c0){return function(_0x3c06e0){if(_0x3c06e0){var _0x4ada91=typeof _0x23a2c0[_0xe6ae('0x1c')]===_0xe6ae('0x1d')&&typeof _0x23a2c0['limit']===_0xe6ae('0x1d');var _0x1881bd=_0x3c06e0[_0xe6ae('0x1e')];var _0x68e382=_0x4ada91?0x0:_0x23a2c0['offset'];var _0x3728aa=_0x4ada91?_0x3c06e0['count']:_0x23a2c0['offset']+_0x23a2c0[_0xe6ae('0x1f')];var _0x2c3b72;if(_0x3728aa>=_0x1881bd){_0x3728aa=_0x1881bd;_0x2c3b72=0xc8;}else{_0x2c3b72=0xce;}_0x4862a9['status'](_0x2c3b72);return _0x4862a9['set'](_0xe6ae('0x20'),_0x68e382+'-'+_0x3728aa+'/'+_0x1881bd)[_0xe6ae('0x1b')](_0x3c06e0);}return null;};}function patchUpdates(_0x45b0e6){return function(_0x328a2a){try{jsonpatch['apply'](_0x328a2a,_0x45b0e6,!![]);}catch(_0x43b22d){return BPromise['reject'](_0x43b22d);}return _0x328a2a[_0xe6ae('0x21')]();};}function saveUpdates(_0x11ff66,_0x55db4a){return function(_0x21f584){if(_0x21f584){return _0x21f584[_0xe6ae('0x22')](_0x11ff66)[_0xe6ae('0x23')](function(_0x216c34){return _0x216c34;});}return null;};}function removeEntity(_0x2c47a5,_0x4054cd){return function(_0x4e6290){if(_0x4e6290){return _0x4e6290[_0xe6ae('0x24')]()['then'](function(){_0x2c47a5[_0xe6ae('0x19')](0xcc)[_0xe6ae('0x1a')]();});}};}function handleEntityNotFound(_0x95d375,_0x223350){return function(_0x147b8f){if(!_0x147b8f){_0x95d375[_0xe6ae('0x18')](0x194);}return _0x147b8f;};}function handleError(_0xfdc828,_0x4d5278){_0x4d5278=_0x4d5278||0x1f4;return function(_0x3dc275){logger[_0xe6ae('0x25')](_0x3dc275[_0xe6ae('0x26')]);if(_0x3dc275['name']){delete _0x3dc275['name'];}_0xfdc828['status'](_0x4d5278)['send'](_0x3dc275);};}exports[_0xe6ae('0x27')]=function(_0x121cf8,_0x59f272){var _0x3e6142={},_0x4c01ee={},_0x293e11={'count':0x0,'rows':[]};var _0x5a20ef=_[_0xe6ae('0x28')](db[_0xe6ae('0x29')][_0xe6ae('0x2a')],function(_0x363988){return{'name':_0x363988[_0xe6ae('0x2b')],'type':_0x363988[_0xe6ae('0x2c')][_0xe6ae('0x2d')]};});_0x4c01ee[_0xe6ae('0x2e')]=_[_0xe6ae('0x28')](_0x5a20ef,_0xe6ae('0x2f'));_0x4c01ee['query']=_[_0xe6ae('0x30')](_0x121cf8[_0xe6ae('0x31')]);_0x4c01ee[_0xe6ae('0x32')]=_[_0xe6ae('0x33')](_0x4c01ee['model'],_0x4c01ee['query']);_0x3e6142[_0xe6ae('0x34')]=_['intersection'](_0x4c01ee[_0xe6ae('0x2e')],qs[_0xe6ae('0x35')](_0x121cf8['query'][_0xe6ae('0x35')]));_0x3e6142['attributes']=_0x3e6142[_0xe6ae('0x34')][_0xe6ae('0x36')]?_0x3e6142[_0xe6ae('0x34')]:_0x4c01ee['model'];if(!_0x121cf8[_0xe6ae('0x31')][_0xe6ae('0x37')](_0xe6ae('0x38'))){_0x3e6142[_0xe6ae('0x1f')]=qs['limit'](_0x121cf8[_0xe6ae('0x31')][_0xe6ae('0x1f')]);_0x3e6142['offset']=qs['offset'](_0x121cf8[_0xe6ae('0x31')][_0xe6ae('0x1c')]);}_0x3e6142[_0xe6ae('0x39')]=qs[_0xe6ae('0x3a')](_0x121cf8['query']['sort']);_0x3e6142['where']=qs[_0xe6ae('0x32')](_[_0xe6ae('0x3b')](_0x121cf8[_0xe6ae('0x31')],_0x4c01ee[_0xe6ae('0x32')]),_0x5a20ef);if(_0x121cf8['query'][_0xe6ae('0x3c')]){_0x3e6142[_0xe6ae('0x3d')]=_['merge'](_0x3e6142[_0xe6ae('0x3d')],{'$or':_[_0xe6ae('0x28')](_0x5a20ef,function(_0x159939){if(_0x159939[_0xe6ae('0x2c')]!==_0xe6ae('0x3e')){var _0x26f46e={};_0x26f46e[_0x159939[_0xe6ae('0x2f')]]={'$like':'%'+_0x121cf8[_0xe6ae('0x31')]['filter']+'%'};return _0x26f46e;}})});}_0x3e6142=_[_0xe6ae('0x3f')]({},_0x3e6142,_0x121cf8['options']);var _0x3e8a45={'where':_0x3e6142['where']};return db['SugarcrmConfiguration'][_0xe6ae('0x1e')](_0x3e8a45)['then'](function(_0x2bc984){_0x293e11[_0xe6ae('0x1e')]=_0x2bc984;if(_0x121cf8['query'][_0xe6ae('0x40')]){_0x3e6142[_0xe6ae('0x41')]=[{'all':!![]}];}return db[_0xe6ae('0x29')][_0xe6ae('0x42')](_0x3e6142);})[_0xe6ae('0x23')](function(_0x17f178){_0x293e11[_0xe6ae('0x43')]=_0x17f178;return _0x293e11;})[_0xe6ae('0x23')](respondWithFilteredResult(_0x59f272,_0x3e6142))[_0xe6ae('0x44')](handleError(_0x59f272,null));};exports[_0xe6ae('0x45')]=function(_0x1f3b93,_0xf4ec99){var _0x39044b={'raw':![],'where':{'id':_0x1f3b93[_0xe6ae('0x46')]['id']}},_0x4b3559={};_0x4b3559[_0xe6ae('0x2e')]=_['keys'](db[_0xe6ae('0x29')][_0xe6ae('0x2a')]);_0x4b3559[_0xe6ae('0x31')]=_['keys'](_0x1f3b93[_0xe6ae('0x31')]);_0x4b3559[_0xe6ae('0x32')]=_[_0xe6ae('0x33')](_0x4b3559[_0xe6ae('0x2e')],_0x4b3559[_0xe6ae('0x31')]);_0x39044b[_0xe6ae('0x34')]=_[_0xe6ae('0x33')](_0x4b3559[_0xe6ae('0x2e')],qs[_0xe6ae('0x35')](_0x1f3b93[_0xe6ae('0x31')]['fields']));_0x39044b['attributes']=_0x39044b[_0xe6ae('0x34')][_0xe6ae('0x36')]?_0x39044b['attributes']:_0x4b3559['model'];if(_0x1f3b93[_0xe6ae('0x31')][_0xe6ae('0x40')]){_0x39044b[_0xe6ae('0x41')]=[{'all':!![]}];}_0x39044b=_[_0xe6ae('0x3f')]({},_0x39044b,_0x1f3b93[_0xe6ae('0x47')]);return db[_0xe6ae('0x29')]['find'](_0x39044b)[_0xe6ae('0x23')](handleEntityNotFound(_0xf4ec99,null))[_0xe6ae('0x23')](respondWithResult(_0xf4ec99,null))[_0xe6ae('0x44')](handleError(_0xf4ec99,null));};exports[_0xe6ae('0x48')]=function(_0x68cad4,_0x4a0670){return db[_0xe6ae('0x29')][_0xe6ae('0x48')](_0x68cad4['body'],{})[_0xe6ae('0x23')](respondWithResult(_0x4a0670,0xc9))[_0xe6ae('0x44')](handleError(_0x4a0670,null));};exports[_0xe6ae('0x22')]=function(_0x5991b3,_0x43dc5e){if(_0x5991b3[_0xe6ae('0x49')]['id']){delete _0x5991b3[_0xe6ae('0x49')]['id'];}return db[_0xe6ae('0x29')][_0xe6ae('0x4a')]({'where':{'id':_0x5991b3['params']['id']}})[_0xe6ae('0x23')](handleEntityNotFound(_0x43dc5e,null))[_0xe6ae('0x23')](saveUpdates(_0x5991b3[_0xe6ae('0x49')],null))[_0xe6ae('0x23')](respondWithResult(_0x43dc5e,null))['catch'](handleError(_0x43dc5e,null));};exports['destroy']=function(_0x44cefc,_0x2e7014){return db['SugarcrmConfiguration'][_0xe6ae('0x4a')]({'where':{'id':_0x44cefc[_0xe6ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e7014,null))[_0xe6ae('0x23')](removeEntity(_0x2e7014,null))[_0xe6ae('0x44')](handleError(_0x2e7014,null));};exports[_0xe6ae('0x4b')]=function(_0x563e59,_0x2f9732,_0x25bc81){var _0x49e778={};var _0x33ad7a={};var _0x329635;var _0x33a971;return db['SugarcrmConfiguration'][_0xe6ae('0x4c')]({'where':{'id':_0x563e59[_0xe6ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f9732,null))[_0xe6ae('0x23')](function(_0x12c0c3){if(_0x12c0c3){_0x329635=_0x12c0c3;_0x33ad7a[_0xe6ae('0x2e')]=_[_0xe6ae('0x30')](db[_0xe6ae('0x4d')][_0xe6ae('0x2a')]);_0x33ad7a[_0xe6ae('0x31')]=_[_0xe6ae('0x30')](_0x563e59[_0xe6ae('0x31')]);_0x33ad7a['filters']=_['intersection'](_0x33ad7a['model'],_0x33ad7a['query']);_0x49e778[_0xe6ae('0x34')]=_[_0xe6ae('0x33')](_0x33ad7a[_0xe6ae('0x2e')],qs[_0xe6ae('0x35')](_0x563e59[_0xe6ae('0x31')][_0xe6ae('0x35')]));_0x49e778[_0xe6ae('0x34')]=_0x49e778[_0xe6ae('0x34')][_0xe6ae('0x36')]?_0x49e778['attributes']:_0x33ad7a[_0xe6ae('0x2e')];_0x49e778['order']=qs['sort'](_0x563e59['query'][_0xe6ae('0x3a')]);_0x49e778[_0xe6ae('0x3d')]=qs[_0xe6ae('0x32')](_[_0xe6ae('0x3b')](_0x563e59[_0xe6ae('0x31')],_0x33ad7a[_0xe6ae('0x32')]));if(_0x563e59[_0xe6ae('0x31')][_0xe6ae('0x3c')]){_0x49e778['where']=_[_0xe6ae('0x3f')](_0x49e778[_0xe6ae('0x3d')],{'$or':_[_0xe6ae('0x28')](_0x49e778['attributes'],function(_0x258f36){var _0x5012d9={};_0x5012d9[_0x258f36]={'$like':'%'+_0x563e59[_0xe6ae('0x31')]['filter']+'%'};return _0x5012d9;})});}_0x49e778=_[_0xe6ae('0x3f')]({},_0x49e778,_0x563e59[_0xe6ae('0x47')]);return _0x329635[_0xe6ae('0x4b')](_0x49e778);}})[_0xe6ae('0x23')](function(_0x1e6d16){if(_0x1e6d16){_0x33a971=_0x1e6d16[_0xe6ae('0x36')];if(!_0x563e59[_0xe6ae('0x31')][_0xe6ae('0x37')](_0xe6ae('0x38'))){_0x49e778[_0xe6ae('0x1f')]=qs[_0xe6ae('0x1f')](_0x563e59[_0xe6ae('0x31')][_0xe6ae('0x1f')]);_0x49e778[_0xe6ae('0x1c')]=qs[_0xe6ae('0x1c')](_0x563e59['query'][_0xe6ae('0x1c')]);}return _0x329635['getFields'](_0x49e778);}})[_0xe6ae('0x23')](function(_0x51e265){if(_0x51e265){return _0x51e265?{'count':_0x33a971,'rows':_0x51e265}:null;}})[_0xe6ae('0x23')](respondWithResult(_0x2f9732,null))[_0xe6ae('0x44')](handleError(_0x2f9732,null));};exports[_0xe6ae('0x4e')]=function(_0x4236c9,_0x46909b,_0x563000){var _0x848991={};var _0x53b5bd={};var _0x4654de;var _0x361bc9;return db[_0xe6ae('0x29')][_0xe6ae('0x4c')]({'where':{'id':_0x4236c9['params']['id']}})[_0xe6ae('0x23')](handleEntityNotFound(_0x46909b,null))['then'](function(_0x24b3aa){if(_0x24b3aa){_0x4654de=_0x24b3aa;_0x53b5bd[_0xe6ae('0x2e')]=_[_0xe6ae('0x30')](db['SugarcrmField'][_0xe6ae('0x2a')]);_0x53b5bd[_0xe6ae('0x31')]=_[_0xe6ae('0x30')](_0x4236c9[_0xe6ae('0x31')]);_0x53b5bd['filters']=_[_0xe6ae('0x33')](_0x53b5bd[_0xe6ae('0x2e')],_0x53b5bd[_0xe6ae('0x31')]);_0x848991['attributes']=_[_0xe6ae('0x33')](_0x53b5bd['model'],qs[_0xe6ae('0x35')](_0x4236c9['query']['fields']));_0x848991[_0xe6ae('0x34')]=_0x848991['attributes'][_0xe6ae('0x36')]?_0x848991[_0xe6ae('0x34')]:_0x53b5bd[_0xe6ae('0x2e')];_0x848991[_0xe6ae('0x39')]=qs[_0xe6ae('0x3a')](_0x4236c9[_0xe6ae('0x31')][_0xe6ae('0x3a')]);_0x848991['where']=qs[_0xe6ae('0x32')](_[_0xe6ae('0x3b')](_0x4236c9['query'],_0x53b5bd[_0xe6ae('0x32')]));if(_0x4236c9['query'][_0xe6ae('0x3c')]){_0x848991[_0xe6ae('0x3d')]=_[_0xe6ae('0x3f')](_0x848991[_0xe6ae('0x3d')],{'$or':_[_0xe6ae('0x28')](_0x848991[_0xe6ae('0x34')],function(_0x23138a){var _0x13083c={};_0x13083c[_0x23138a]={'$like':'%'+_0x4236c9['query'][_0xe6ae('0x3c')]+'%'};return _0x13083c;})});}_0x848991=_[_0xe6ae('0x3f')]({},_0x848991,_0x4236c9[_0xe6ae('0x47')]);return _0x4654de['getSubjects'](_0x848991);}})['then'](function(_0x50461b){if(_0x50461b){_0x361bc9=_0x50461b['length'];if(!_0x4236c9[_0xe6ae('0x31')][_0xe6ae('0x37')](_0xe6ae('0x38'))){_0x848991[_0xe6ae('0x1f')]=qs[_0xe6ae('0x1f')](_0x4236c9[_0xe6ae('0x31')]['limit']);_0x848991[_0xe6ae('0x1c')]=qs['offset'](_0x4236c9[_0xe6ae('0x31')][_0xe6ae('0x1c')]);}return _0x4654de[_0xe6ae('0x4e')](_0x848991);}})[_0xe6ae('0x23')](function(_0x5cf310){if(_0x5cf310){return _0x5cf310?{'count':_0x361bc9,'rows':_0x5cf310}:null;}})[_0xe6ae('0x23')](respondWithResult(_0x46909b,null))[_0xe6ae('0x44')](handleError(_0x46909b,null));};exports[_0xe6ae('0x4f')]=function(_0x1da584,_0x4ed4c0,_0x1ce515){var _0x17cb37={};var _0x2ec096={};var _0x15a90c;var _0x25e22f;return db[_0xe6ae('0x29')][_0xe6ae('0x4c')]({'where':{'id':_0x1da584[_0xe6ae('0x46')]['id']}})[_0xe6ae('0x23')](handleEntityNotFound(_0x4ed4c0,null))[_0xe6ae('0x23')](function(_0x2bf7f3){if(_0x2bf7f3){_0x15a90c=_0x2bf7f3;_0x2ec096[_0xe6ae('0x2e')]=_['keys'](db[_0xe6ae('0x4d')][_0xe6ae('0x2a')]);_0x2ec096[_0xe6ae('0x31')]=_[_0xe6ae('0x30')](_0x1da584[_0xe6ae('0x31')]);_0x2ec096[_0xe6ae('0x32')]=_[_0xe6ae('0x33')](_0x2ec096['model'],_0x2ec096[_0xe6ae('0x31')]);_0x17cb37[_0xe6ae('0x34')]=_[_0xe6ae('0x33')](_0x2ec096['model'],qs[_0xe6ae('0x35')](_0x1da584[_0xe6ae('0x31')][_0xe6ae('0x35')]));_0x17cb37[_0xe6ae('0x34')]=_0x17cb37['attributes'][_0xe6ae('0x36')]?_0x17cb37[_0xe6ae('0x34')]:_0x2ec096[_0xe6ae('0x2e')];_0x17cb37[_0xe6ae('0x39')]=qs[_0xe6ae('0x3a')](_0x1da584[_0xe6ae('0x31')][_0xe6ae('0x3a')]);_0x17cb37[_0xe6ae('0x3d')]=qs['filters'](_['pick'](_0x1da584[_0xe6ae('0x31')],_0x2ec096[_0xe6ae('0x32')]));if(_0x1da584[_0xe6ae('0x31')][_0xe6ae('0x3c')]){_0x17cb37[_0xe6ae('0x3d')]=_[_0xe6ae('0x3f')](_0x17cb37['where'],{'$or':_[_0xe6ae('0x28')](_0x17cb37['attributes'],function(_0x236f40){var _0x5610f7={};_0x5610f7[_0x236f40]={'$like':'%'+_0x1da584['query'][_0xe6ae('0x3c')]+'%'};return _0x5610f7;})});}_0x17cb37=_['merge']({},_0x17cb37,_0x1da584[_0xe6ae('0x47')]);return _0x15a90c['getDescriptions'](_0x17cb37);}})[_0xe6ae('0x23')](function(_0xd37c0d){if(_0xd37c0d){_0x25e22f=_0xd37c0d['length'];if(!_0x1da584[_0xe6ae('0x31')]['hasOwnProperty'](_0xe6ae('0x38'))){_0x17cb37[_0xe6ae('0x1f')]=qs[_0xe6ae('0x1f')](_0x1da584[_0xe6ae('0x31')][_0xe6ae('0x1f')]);_0x17cb37[_0xe6ae('0x1c')]=qs[_0xe6ae('0x1c')](_0x1da584['query'][_0xe6ae('0x1c')]);}return _0x15a90c['getDescriptions'](_0x17cb37);}})[_0xe6ae('0x23')](function(_0x85d60f){if(_0x85d60f){return _0x85d60f?{'count':_0x25e22f,'rows':_0x85d60f}:null;}})['then'](respondWithResult(_0x4ed4c0,null))['catch'](handleError(_0x4ed4c0,null));}; \ No newline at end of file +var _0x0d87=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','body','find','getFields','findOne','rawAttributes','order','nolimit','getSubjects','SugarcrmField','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse'];(function(_0xe821a7,_0x3bb43f){var _0x82959c=function(_0x586207){while(--_0x586207){_0xe821a7['push'](_0xe821a7['shift']());}};_0x82959c(++_0x3bb43f);}(_0x0d87,0x91));var _0x70d8=function(_0xc3f3e3,_0x43a328){_0xc3f3e3=_0xc3f3e3-0x0;var _0x212cef=_0x0d87[_0xc3f3e3];return _0x212cef;};'use strict';var emlformat=require(_0x70d8('0x0'));var rimraf=require(_0x70d8('0x1'));var zipdir=require(_0x70d8('0x2'));var jsonpatch=require(_0x70d8('0x3'));var rp=require(_0x70d8('0x4'));var moment=require(_0x70d8('0x5'));var BPromise=require(_0x70d8('0x6'));var Mustache=require(_0x70d8('0x7'));var util=require(_0x70d8('0x8'));var path=require(_0x70d8('0x9'));var sox=require('sox');var csv=require(_0x70d8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70d8('0xb'));var _=require(_0x70d8('0xc'));var squel=require('squel');var crypto=require(_0x70d8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x70d8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x70d8('0xf'));var Papa=require(_0x70d8('0x10'));var Redis=require(_0x70d8('0x11'));var authService=require(_0x70d8('0x12'));var qs=require(_0x70d8('0x13'));var as=require(_0x70d8('0x14'));var hardwareService=require(_0x70d8('0x15'));var logger=require(_0x70d8('0x16'))(_0x70d8('0x17'));var utils=require('../../config/utils');var config=require(_0x70d8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x70d8('0x19'))['db'];function respondWithStatusCode(_0x86c2e3,_0x4b455d){_0x4b455d=_0x4b455d||0xcc;return function(_0x47e2f0){if(_0x47e2f0){return _0x86c2e3['sendStatus'](_0x4b455d);}return _0x86c2e3['status'](_0x4b455d)[_0x70d8('0x1a')]();};}function respondWithResult(_0x490aa0,_0x4da9ec){_0x4da9ec=_0x4da9ec||0xc8;return function(_0x3aafe0){if(_0x3aafe0){return _0x490aa0[_0x70d8('0x1b')](_0x4da9ec)[_0x70d8('0x1c')](_0x3aafe0);}};}function respondWithFilteredResult(_0x22aaa4,_0x297215){return function(_0x468ccc){if(_0x468ccc){var _0x580772=typeof _0x297215[_0x70d8('0x1d')]===_0x70d8('0x1e')&&typeof _0x297215[_0x70d8('0x1f')]==='undefined';var _0xca8d6e=_0x468ccc['count'];var _0x278670=_0x580772?0x0:_0x297215[_0x70d8('0x1d')];var _0x1d298d=_0x580772?_0x468ccc['count']:_0x297215['offset']+_0x297215[_0x70d8('0x1f')];var _0x4fc339;if(_0x1d298d>=_0xca8d6e){_0x1d298d=_0xca8d6e;_0x4fc339=0xc8;}else{_0x4fc339=0xce;}_0x22aaa4[_0x70d8('0x1b')](_0x4fc339);return _0x22aaa4[_0x70d8('0x20')](_0x70d8('0x21'),_0x278670+'-'+_0x1d298d+'/'+_0xca8d6e)[_0x70d8('0x1c')](_0x468ccc);}return null;};}function patchUpdates(_0x490d9c){return function(_0x376152){try{jsonpatch[_0x70d8('0x22')](_0x376152,_0x490d9c,!![]);}catch(_0x419704){return BPromise[_0x70d8('0x23')](_0x419704);}return _0x376152[_0x70d8('0x24')]();};}function saveUpdates(_0x4e00b0,_0x4c4a06){return function(_0x36d352){if(_0x36d352){return _0x36d352[_0x70d8('0x25')](_0x4e00b0)[_0x70d8('0x26')](function(_0x486f71){return _0x486f71;});}return null;};}function removeEntity(_0x5070f7,_0x399657){return function(_0x52cdc7){if(_0x52cdc7){return _0x52cdc7['destroy']()[_0x70d8('0x26')](function(){_0x5070f7[_0x70d8('0x1b')](0xcc)[_0x70d8('0x1a')]();});}};}function handleEntityNotFound(_0x4b7a77,_0x3b52af){return function(_0x392678){if(!_0x392678){_0x4b7a77[_0x70d8('0x27')](0x194);}return _0x392678;};}function handleError(_0x50aea8,_0x5acfbe){_0x5acfbe=_0x5acfbe||0x1f4;return function(_0x3014bd){logger['error'](_0x3014bd['stack']);if(_0x3014bd[_0x70d8('0x28')]){delete _0x3014bd[_0x70d8('0x28')];}_0x50aea8[_0x70d8('0x1b')](_0x5acfbe)[_0x70d8('0x29')](_0x3014bd);};}exports[_0x70d8('0x2a')]=function(_0x3133f5,_0x42cd48){var _0x4c043a={},_0x388178={},_0x70073e={'count':0x0,'rows':[]};var _0x36a4a6=_[_0x70d8('0x2b')](db[_0x70d8('0x2c')]['rawAttributes'],function(_0x1accdb){return{'name':_0x1accdb[_0x70d8('0x2d')],'type':_0x1accdb[_0x70d8('0x2e')][_0x70d8('0x2f')]};});_0x388178['model']=_[_0x70d8('0x2b')](_0x36a4a6,_0x70d8('0x28'));_0x388178[_0x70d8('0x30')]=_[_0x70d8('0x31')](_0x3133f5[_0x70d8('0x30')]);_0x388178[_0x70d8('0x32')]=_['intersection'](_0x388178[_0x70d8('0x33')],_0x388178[_0x70d8('0x30')]);_0x4c043a[_0x70d8('0x34')]=_[_0x70d8('0x35')](_0x388178[_0x70d8('0x33')],qs['fields'](_0x3133f5[_0x70d8('0x30')][_0x70d8('0x36')]));_0x4c043a[_0x70d8('0x34')]=_0x4c043a[_0x70d8('0x34')][_0x70d8('0x37')]?_0x4c043a['attributes']:_0x388178[_0x70d8('0x33')];if(!_0x3133f5['query']['hasOwnProperty']('nolimit')){_0x4c043a[_0x70d8('0x1f')]=qs[_0x70d8('0x1f')](_0x3133f5[_0x70d8('0x30')][_0x70d8('0x1f')]);_0x4c043a[_0x70d8('0x1d')]=qs[_0x70d8('0x1d')](_0x3133f5[_0x70d8('0x30')][_0x70d8('0x1d')]);}_0x4c043a['order']=qs[_0x70d8('0x38')](_0x3133f5[_0x70d8('0x30')]['sort']);_0x4c043a[_0x70d8('0x39')]=qs['filters'](_[_0x70d8('0x3a')](_0x3133f5[_0x70d8('0x30')],_0x388178[_0x70d8('0x32')]),_0x36a4a6);if(_0x3133f5[_0x70d8('0x30')][_0x70d8('0x3b')]){_0x4c043a[_0x70d8('0x39')]=_[_0x70d8('0x3c')](_0x4c043a[_0x70d8('0x39')],{'$or':_['map'](_0x36a4a6,function(_0x21735c){if(_0x21735c[_0x70d8('0x2e')]!==_0x70d8('0x3d')){var _0x5d2193={};_0x5d2193[_0x21735c['name']]={'$like':'%'+_0x3133f5[_0x70d8('0x30')]['filter']+'%'};return _0x5d2193;}})});}_0x4c043a=_[_0x70d8('0x3c')]({},_0x4c043a,_0x3133f5[_0x70d8('0x3e')]);var _0x350c7a={'where':_0x4c043a[_0x70d8('0x39')]};return db['SugarcrmConfiguration'][_0x70d8('0x3f')](_0x350c7a)['then'](function(_0xd90fff){_0x70073e[_0x70d8('0x3f')]=_0xd90fff;if(_0x3133f5[_0x70d8('0x30')][_0x70d8('0x40')]){_0x4c043a[_0x70d8('0x41')]=[{'all':!![]}];}return db[_0x70d8('0x2c')][_0x70d8('0x42')](_0x4c043a);})[_0x70d8('0x26')](function(_0x2d70f0){_0x70073e['rows']=_0x2d70f0;return _0x70073e;})[_0x70d8('0x26')](respondWithFilteredResult(_0x42cd48,_0x4c043a))[_0x70d8('0x43')](handleError(_0x42cd48,null));};exports[_0x70d8('0x44')]=function(_0x9bc752,_0x5f2264){var _0x4a00fc={'raw':![],'where':{'id':_0x9bc752[_0x70d8('0x45')]['id']}},_0x59cbea={};_0x59cbea[_0x70d8('0x33')]=_[_0x70d8('0x31')](db['SugarcrmConfiguration']['rawAttributes']);_0x59cbea['query']=_[_0x70d8('0x31')](_0x9bc752[_0x70d8('0x30')]);_0x59cbea[_0x70d8('0x32')]=_['intersection'](_0x59cbea[_0x70d8('0x33')],_0x59cbea[_0x70d8('0x30')]);_0x4a00fc['attributes']=_[_0x70d8('0x35')](_0x59cbea[_0x70d8('0x33')],qs[_0x70d8('0x36')](_0x9bc752[_0x70d8('0x30')][_0x70d8('0x36')]));_0x4a00fc['attributes']=_0x4a00fc[_0x70d8('0x34')][_0x70d8('0x37')]?_0x4a00fc[_0x70d8('0x34')]:_0x59cbea[_0x70d8('0x33')];if(_0x9bc752[_0x70d8('0x30')][_0x70d8('0x40')]){_0x4a00fc[_0x70d8('0x41')]=[{'all':!![]}];}_0x4a00fc=_[_0x70d8('0x3c')]({},_0x4a00fc,_0x9bc752[_0x70d8('0x3e')]);return db[_0x70d8('0x2c')]['find'](_0x4a00fc)[_0x70d8('0x26')](handleEntityNotFound(_0x5f2264,null))[_0x70d8('0x26')](respondWithResult(_0x5f2264,null))['catch'](handleError(_0x5f2264,null));};exports['create']=function(_0x1df63e,_0xf0c23c){return db['SugarcrmConfiguration']['create'](_0x1df63e[_0x70d8('0x46')],{})['then'](respondWithResult(_0xf0c23c,0xc9))['catch'](handleError(_0xf0c23c,null));};exports['update']=function(_0x48738b,_0x46a3c0){if(_0x48738b['body']['id']){delete _0x48738b['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x48738b[_0x70d8('0x45')]['id']}})[_0x70d8('0x26')](handleEntityNotFound(_0x46a3c0,null))[_0x70d8('0x26')](saveUpdates(_0x48738b[_0x70d8('0x46')],null))[_0x70d8('0x26')](respondWithResult(_0x46a3c0,null))[_0x70d8('0x43')](handleError(_0x46a3c0,null));};exports['destroy']=function(_0x44c1c9,_0x57dc09){return db[_0x70d8('0x2c')][_0x70d8('0x47')]({'where':{'id':_0x44c1c9[_0x70d8('0x45')]['id']}})[_0x70d8('0x26')](handleEntityNotFound(_0x57dc09,null))[_0x70d8('0x26')](removeEntity(_0x57dc09,null))[_0x70d8('0x43')](handleError(_0x57dc09,null));};exports[_0x70d8('0x48')]=function(_0x129c04,_0x2af286,_0x918431){var _0x22a8c5={};var _0x5ba8cc={};var _0x5e55bb;var _0x156c09;return db[_0x70d8('0x2c')][_0x70d8('0x49')]({'where':{'id':_0x129c04[_0x70d8('0x45')]['id']}})[_0x70d8('0x26')](handleEntityNotFound(_0x2af286,null))['then'](function(_0x1ea570){if(_0x1ea570){_0x5e55bb=_0x1ea570;_0x5ba8cc[_0x70d8('0x33')]=_[_0x70d8('0x31')](db['SugarcrmField'][_0x70d8('0x4a')]);_0x5ba8cc[_0x70d8('0x30')]=_['keys'](_0x129c04[_0x70d8('0x30')]);_0x5ba8cc[_0x70d8('0x32')]=_['intersection'](_0x5ba8cc[_0x70d8('0x33')],_0x5ba8cc[_0x70d8('0x30')]);_0x22a8c5[_0x70d8('0x34')]=_['intersection'](_0x5ba8cc['model'],qs[_0x70d8('0x36')](_0x129c04['query'][_0x70d8('0x36')]));_0x22a8c5[_0x70d8('0x34')]=_0x22a8c5[_0x70d8('0x34')][_0x70d8('0x37')]?_0x22a8c5[_0x70d8('0x34')]:_0x5ba8cc[_0x70d8('0x33')];_0x22a8c5[_0x70d8('0x4b')]=qs[_0x70d8('0x38')](_0x129c04[_0x70d8('0x30')][_0x70d8('0x38')]);_0x22a8c5[_0x70d8('0x39')]=qs[_0x70d8('0x32')](_[_0x70d8('0x3a')](_0x129c04['query'],_0x5ba8cc[_0x70d8('0x32')]));if(_0x129c04['query']['filter']){_0x22a8c5['where']=_['merge'](_0x22a8c5[_0x70d8('0x39')],{'$or':_[_0x70d8('0x2b')](_0x22a8c5[_0x70d8('0x34')],function(_0x55018b){var _0x261ee9={};_0x261ee9[_0x55018b]={'$like':'%'+_0x129c04[_0x70d8('0x30')][_0x70d8('0x3b')]+'%'};return _0x261ee9;})});}_0x22a8c5=_[_0x70d8('0x3c')]({},_0x22a8c5,_0x129c04['options']);return _0x5e55bb[_0x70d8('0x48')](_0x22a8c5);}})['then'](function(_0x10d259){if(_0x10d259){_0x156c09=_0x10d259[_0x70d8('0x37')];if(!_0x129c04[_0x70d8('0x30')]['hasOwnProperty'](_0x70d8('0x4c'))){_0x22a8c5[_0x70d8('0x1f')]=qs[_0x70d8('0x1f')](_0x129c04[_0x70d8('0x30')]['limit']);_0x22a8c5[_0x70d8('0x1d')]=qs[_0x70d8('0x1d')](_0x129c04[_0x70d8('0x30')]['offset']);}return _0x5e55bb['getFields'](_0x22a8c5);}})[_0x70d8('0x26')](function(_0x314239){if(_0x314239){return _0x314239?{'count':_0x156c09,'rows':_0x314239}:null;}})[_0x70d8('0x26')](respondWithResult(_0x2af286,null))[_0x70d8('0x43')](handleError(_0x2af286,null));};exports[_0x70d8('0x4d')]=function(_0x24c082,_0x1f7791,_0x3bd6a5){var _0xd7d2e6={};var _0x1abf97={};var _0x27557b;var _0x212093;return db[_0x70d8('0x2c')][_0x70d8('0x49')]({'where':{'id':_0x24c082[_0x70d8('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f7791,null))[_0x70d8('0x26')](function(_0x962673){if(_0x962673){_0x27557b=_0x962673;_0x1abf97['model']=_['keys'](db[_0x70d8('0x4e')][_0x70d8('0x4a')]);_0x1abf97['query']=_[_0x70d8('0x31')](_0x24c082[_0x70d8('0x30')]);_0x1abf97['filters']=_[_0x70d8('0x35')](_0x1abf97['model'],_0x1abf97[_0x70d8('0x30')]);_0xd7d2e6[_0x70d8('0x34')]=_[_0x70d8('0x35')](_0x1abf97[_0x70d8('0x33')],qs['fields'](_0x24c082[_0x70d8('0x30')]['fields']));_0xd7d2e6['attributes']=_0xd7d2e6[_0x70d8('0x34')][_0x70d8('0x37')]?_0xd7d2e6[_0x70d8('0x34')]:_0x1abf97[_0x70d8('0x33')];_0xd7d2e6['order']=qs[_0x70d8('0x38')](_0x24c082[_0x70d8('0x30')][_0x70d8('0x38')]);_0xd7d2e6[_0x70d8('0x39')]=qs[_0x70d8('0x32')](_[_0x70d8('0x3a')](_0x24c082['query'],_0x1abf97['filters']));if(_0x24c082['query'][_0x70d8('0x3b')]){_0xd7d2e6[_0x70d8('0x39')]=_[_0x70d8('0x3c')](_0xd7d2e6[_0x70d8('0x39')],{'$or':_[_0x70d8('0x2b')](_0xd7d2e6[_0x70d8('0x34')],function(_0x40e107){var _0x1bcc09={};_0x1bcc09[_0x40e107]={'$like':'%'+_0x24c082[_0x70d8('0x30')][_0x70d8('0x3b')]+'%'};return _0x1bcc09;})});}_0xd7d2e6=_[_0x70d8('0x3c')]({},_0xd7d2e6,_0x24c082[_0x70d8('0x3e')]);return _0x27557b[_0x70d8('0x4d')](_0xd7d2e6);}})['then'](function(_0x3871e9){if(_0x3871e9){_0x212093=_0x3871e9[_0x70d8('0x37')];if(!_0x24c082['query'][_0x70d8('0x4f')](_0x70d8('0x4c'))){_0xd7d2e6[_0x70d8('0x1f')]=qs[_0x70d8('0x1f')](_0x24c082[_0x70d8('0x30')]['limit']);_0xd7d2e6[_0x70d8('0x1d')]=qs[_0x70d8('0x1d')](_0x24c082['query']['offset']);}return _0x27557b['getSubjects'](_0xd7d2e6);}})[_0x70d8('0x26')](function(_0x30bad5){if(_0x30bad5){return _0x30bad5?{'count':_0x212093,'rows':_0x30bad5}:null;}})['then'](respondWithResult(_0x1f7791,null))['catch'](handleError(_0x1f7791,null));};exports[_0x70d8('0x50')]=function(_0x375b2b,_0x36f989,_0x164185){var _0x263fae={};var _0x18b2db={};var _0xffbafb;var _0xc74a01;return db[_0x70d8('0x2c')][_0x70d8('0x49')]({'where':{'id':_0x375b2b[_0x70d8('0x45')]['id']}})[_0x70d8('0x26')](handleEntityNotFound(_0x36f989,null))['then'](function(_0x43c610){if(_0x43c610){_0xffbafb=_0x43c610;_0x18b2db[_0x70d8('0x33')]=_['keys'](db['SugarcrmField'][_0x70d8('0x4a')]);_0x18b2db['query']=_[_0x70d8('0x31')](_0x375b2b[_0x70d8('0x30')]);_0x18b2db[_0x70d8('0x32')]=_[_0x70d8('0x35')](_0x18b2db['model'],_0x18b2db['query']);_0x263fae[_0x70d8('0x34')]=_['intersection'](_0x18b2db[_0x70d8('0x33')],qs[_0x70d8('0x36')](_0x375b2b[_0x70d8('0x30')][_0x70d8('0x36')]));_0x263fae[_0x70d8('0x34')]=_0x263fae[_0x70d8('0x34')]['length']?_0x263fae[_0x70d8('0x34')]:_0x18b2db[_0x70d8('0x33')];_0x263fae[_0x70d8('0x4b')]=qs[_0x70d8('0x38')](_0x375b2b[_0x70d8('0x30')][_0x70d8('0x38')]);_0x263fae[_0x70d8('0x39')]=qs['filters'](_[_0x70d8('0x3a')](_0x375b2b[_0x70d8('0x30')],_0x18b2db[_0x70d8('0x32')]));if(_0x375b2b['query'][_0x70d8('0x3b')]){_0x263fae[_0x70d8('0x39')]=_[_0x70d8('0x3c')](_0x263fae[_0x70d8('0x39')],{'$or':_[_0x70d8('0x2b')](_0x263fae['attributes'],function(_0x171320){var _0x2de4c5={};_0x2de4c5[_0x171320]={'$like':'%'+_0x375b2b[_0x70d8('0x30')][_0x70d8('0x3b')]+'%'};return _0x2de4c5;})});}_0x263fae=_[_0x70d8('0x3c')]({},_0x263fae,_0x375b2b['options']);return _0xffbafb['getDescriptions'](_0x263fae);}})['then'](function(_0x13a74d){if(_0x13a74d){_0xc74a01=_0x13a74d[_0x70d8('0x37')];if(!_0x375b2b[_0x70d8('0x30')]['hasOwnProperty'](_0x70d8('0x4c'))){_0x263fae['limit']=qs[_0x70d8('0x1f')](_0x375b2b[_0x70d8('0x30')]['limit']);_0x263fae['offset']=qs['offset'](_0x375b2b['query'][_0x70d8('0x1d')]);}return _0xffbafb[_0x70d8('0x50')](_0x263fae);}})[_0x70d8('0x26')](function(_0x16a89d){if(_0x16a89d){return _0x16a89d?{'count':_0xc74a01,'rows':_0x16a89d}:null;}})[_0x70d8('0x26')](respondWithResult(_0x36f989,null))[_0x70d8('0x43')](handleError(_0x36f989,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 981dfd5..0235344 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 _0x1f7a=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4f1e52,_0x3f2100){var _0x213a54=function(_0x91aaf2){while(--_0x91aaf2){_0x4f1e52['push'](_0x4f1e52['shift']());}};_0x213a54(++_0x3f2100);}(_0x1f7a,0x1da));var _0xa1f7=function(_0x266062,_0x24760f){_0x266062=_0x266062-0x0;var _0x18c24f=_0x1f7a[_0x266062];return _0x18c24f;};'use strict';var _=require(_0xa1f7('0x0'));var util=require(_0xa1f7('0x1'));var logger=require(_0xa1f7('0x2'))(_0xa1f7('0x3'));var moment=require('moment');var BPromise=require(_0xa1f7('0x4'));var rp=require(_0xa1f7('0x5'));var fs=require('fs');var path=require(_0xa1f7('0x6'));var rimraf=require('rimraf');var config=require(_0xa1f7('0x7'));var attributes=require(_0xa1f7('0x8'));module[_0xa1f7('0x9')]=function(_0x384993,_0xb13c9c){return _0x384993[_0xa1f7('0xa')](_0xa1f7('0xb'),attributes,{'tableName':_0xa1f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a61=['api','moment','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x4ebe31,_0x3f06f1){var _0x4900eb=function(_0x18a59a){while(--_0x18a59a){_0x4ebe31['push'](_0x4ebe31['shift']());}};_0x4900eb(++_0x3f06f1);}(_0x5a61,0xa2));var _0x15a6=function(_0x251851,_0x240ca6){_0x251851=_0x251851-0x0;var _0x3a051b=_0x5a61[_0x251851];return _0x3a051b;};'use strict';var _=require(_0x15a6('0x0'));var util=require(_0x15a6('0x1'));var logger=require(_0x15a6('0x2'))(_0x15a6('0x3'));var moment=require(_0x15a6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15a6('0x5'));var rimraf=require(_0x15a6('0x6'));var config=require('../../config/environment');var attributes=require(_0x15a6('0x7'));module['exports']=function(_0x1bdaa3,_0x2aef36){return _0x1bdaa3[_0x15a6('0x8')](_0x15a6('0x9'),attributes,{'tableName':_0x15a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index db96ac9..aef7c75 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 _0x4a00=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0x4a00,0xbe));var _0x04a0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4a00[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x04a0('0x0'));var moment=require('moment');var BPromise=require(_0x04a0('0x1'));var rs=require(_0x04a0('0x2'));var fs=require('fs');var Redis=require(_0x04a0('0x3'));var db=require(_0x04a0('0x4'))['db'];var utils=require(_0x04a0('0x5'));var logger=require(_0x04a0('0x6'))(_0x04a0('0x7'));var config=require(_0x04a0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x04a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f36a0,_0x545ca5,_0x3ba835){return new BPromise(function(_0xe19926,_0x5ab5b4){return client[_0x04a0('0xa')](_0x1f36a0,_0x3ba835)['then'](function(_0x328929){logger[_0x04a0('0xb')](_0x04a0('0xc'),_0x545ca5,_0x04a0('0xd'));logger[_0x04a0('0xe')](_0x04a0('0xf'),_0x545ca5,_0x04a0('0xd'),JSON[_0x04a0('0x10')](_0x328929));if(_0x328929[_0x04a0('0x11')]){if(_0x328929[_0x04a0('0x11')]['code']===0x1f4){logger[_0x04a0('0x11')](_0x04a0('0xc'),_0x545ca5,_0x328929[_0x04a0('0x11')]['message']);return _0x5ab5b4(_0x328929[_0x04a0('0x11')][_0x04a0('0x12')]);}logger[_0x04a0('0x11')](_0x04a0('0xc'),_0x545ca5,_0x328929[_0x04a0('0x11')][_0x04a0('0x12')]);return _0xe19926(_0x328929[_0x04a0('0x11')]['message']);}else{logger['info'](_0x04a0('0xc'),_0x545ca5,'request\x20sent');_0xe19926(_0x328929[_0x04a0('0x13')][_0x04a0('0x12')]);}})[_0x04a0('0x14')](function(_0x7f9e0){logger[_0x04a0('0x11')](_0x04a0('0xc'),_0x545ca5,_0x7f9e0);_0x5ab5b4(_0x7f9e0);});});} \ No newline at end of file +var _0xb320=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb320,0x1de));var _0x0b32=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb320[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x0b32('0x0'));var util=require(_0x0b32('0x1'));var moment=require(_0x0b32('0x2'));var BPromise=require(_0x0b32('0x3'));var rs=require(_0x0b32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b32('0x5'))['db'];var utils=require(_0x0b32('0x6'));var logger=require(_0x0b32('0x7'))(_0x0b32('0x8'));var config=require(_0x0b32('0x9'));var jayson=require(_0x0b32('0xa'));var client=jayson[_0x0b32('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48b91a,_0x1c258b,_0x971384){return new BPromise(function(_0x4c1a48,_0x48903b){return client[_0x0b32('0xc')](_0x48b91a,_0x971384)[_0x0b32('0xd')](function(_0x4135c2){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x1c258b,_0x0b32('0xe'));logger['debug'](_0x0b32('0xf'),_0x1c258b,'request\x20sent',JSON[_0x0b32('0x10')](_0x4135c2));if(_0x4135c2[_0x0b32('0x11')]){if(_0x4135c2[_0x0b32('0x11')][_0x0b32('0x12')]===0x1f4){logger[_0x0b32('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1c258b,_0x4135c2[_0x0b32('0x11')]['message']);return _0x48903b(_0x4135c2[_0x0b32('0x11')][_0x0b32('0x13')]);}logger[_0x0b32('0x11')](_0x0b32('0x14'),_0x1c258b,_0x4135c2[_0x0b32('0x11')]['message']);return _0x4c1a48(_0x4135c2[_0x0b32('0x11')][_0x0b32('0x13')]);}else{logger[_0x0b32('0x15')](_0x0b32('0x14'),_0x1c258b,_0x0b32('0xe'));_0x4c1a48(_0x4135c2['result'][_0x0b32('0x13')]);}})['catch'](function(_0x5ef6a1){logger[_0x0b32('0x11')](_0x0b32('0x14'),_0x1c258b,_0x5ef6a1);_0x48903b(_0x5ef6a1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index a134d8b..f4d4415 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 _0x365f=['/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1ac938,_0x3d12eb){var _0x286b59=function(_0x12c132){while(--_0x12c132){_0x1ac938['push'](_0x1ac938['shift']());}};_0x286b59(++_0x3d12eb);}(_0x365f,0xaa));var _0xf365=function(_0x483472,_0x4f6e9b){_0x483472=_0x483472-0x0;var _0xef8a65=_0x365f[_0x483472];return _0xef8a65;};'use strict';var multer=require(_0xf365('0x0'));var util=require(_0xf365('0x1'));var path=require(_0xf365('0x2'));var timeout=require(_0xf365('0x3'));var express=require(_0xf365('0x4'));var router=express['Router']();var fs_extra=require(_0xf365('0x5'));var auth=require(_0xf365('0x6'));var interaction=require(_0xf365('0x7'));var config=require(_0xf365('0x8'));var controller=require('./intSugarcrmField.controller');router[_0xf365('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf365('0xa'),auth[_0xf365('0xb')](),controller[_0xf365('0xc')]);router['post']('/',auth[_0xf365('0xb')](),controller[_0xf365('0xd')]);router[_0xf365('0xe')](_0xf365('0xa'),auth[_0xf365('0xb')](),controller[_0xf365('0xf')]);router['delete'](_0xf365('0xa'),auth[_0xf365('0xb')](),controller[_0xf365('0x10')]);module[_0xf365('0x11')]=router; \ No newline at end of file +var _0x6d5e=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy'];(function(_0x3d760c,_0x3600e1){var _0x399178=function(_0x4db7eb){while(--_0x4db7eb){_0x3d760c['push'](_0x3d760c['shift']());}};_0x399178(++_0x3600e1);}(_0x6d5e,0x110));var _0xe6d5=function(_0x2b2f58,_0x38cb7a){_0x2b2f58=_0x2b2f58-0x0;var _0x1a02bf=_0x6d5e[_0x2b2f58];return _0x1a02bf;};'use strict';var multer=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var path=require(_0xe6d5('0x2'));var timeout=require(_0xe6d5('0x3'));var express=require('express');var router=express[_0xe6d5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe6d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe6d5('0x6'));var controller=require('./intSugarcrmField.controller');router[_0xe6d5('0x7')]('/',auth[_0xe6d5('0x8')](),controller[_0xe6d5('0x9')]);router[_0xe6d5('0x7')]('/:id',auth[_0xe6d5('0x8')](),controller[_0xe6d5('0xa')]);router[_0xe6d5('0xb')]('/',auth[_0xe6d5('0x8')](),controller[_0xe6d5('0xc')]);router['put'](_0xe6d5('0xd'),auth['isAuthenticated'](),controller[_0xe6d5('0xe')]);router[_0xe6d5('0xf')](_0xe6d5('0xd'),auth['isAuthenticated'](),controller[_0xe6d5('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 730b1a1..abcbf2c 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 _0xa24a=['string','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa24a,0x84));var _0xaa24=function(_0x1c6022,_0x53649d){_0x1c6022=_0x1c6022-0x0;var _0x46062d=_0xa24a[_0x1c6022];return _0x46062d;};'use strict';var Sequelize=require(_0xaa24('0x0'));module[_0xaa24('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xaa24('0x2'),_0xaa24('0x3'),_0xaa24('0x4'),_0xaa24('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xaa24('0x6')]},'key':{'type':Sequelize[_0xaa24('0x6')]},'keyType':{'type':Sequelize[_0xaa24('0x7')](_0xaa24('0x8'),_0xaa24('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xaa24('0x6')]},'nameField':{'type':Sequelize[_0xaa24('0x6')]},'customField':{'type':Sequelize[_0xaa24('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x88fa=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x88fa,0x1a6));var _0xa88f=function(_0x4e2806,_0x29bddf){_0x4e2806=_0x4e2806-0x0;var _0xd5a5a1=_0x88fa[_0x4e2806];return _0xd5a5a1;};'use strict';var Sequelize=require(_0xa88f('0x0'));module[_0xa88f('0x1')]={'type':{'type':Sequelize[_0xa88f('0x2')]('string',_0xa88f('0x3'),_0xa88f('0x4'),_0xa88f('0x5'),_0xa88f('0x6')),'defaultValue':_0xa88f('0x7')},'content':{'type':Sequelize[_0xa88f('0x8')]},'key':{'type':Sequelize[_0xa88f('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa88f('0x3'),_0xa88f('0x4'))},'keyContent':{'type':Sequelize[_0xa88f('0x8')]},'idField':{'type':Sequelize[_0xa88f('0x8')]},'nameField':{'type':Sequelize[_0xa88f('0x8')]},'customField':{'type':Sequelize[_0xa88f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa88f('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 8731a9a..0d56032 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 _0x4409=['fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','keys','include','find','catch','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','SugarcrmField','rawAttributes'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x4409,0x181));var _0x9440=function(_0x2898e3,_0x205de5){_0x2898e3=_0x2898e3-0x0;var _0x289930=_0x4409[_0x2898e3];return _0x289930;};'use strict';var emlformat=require(_0x9440('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9440('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9440('0x2'));var moment=require(_0x9440('0x3'));var BPromise=require(_0x9440('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9440('0x5'));var sox=require(_0x9440('0x6'));var csv=require('to-csv');var ejs=require(_0x9440('0x7'));var fs=require('fs');var fs_extra=require(_0x9440('0x8'));var _=require(_0x9440('0x9'));var squel=require(_0x9440('0xa'));var crypto=require(_0x9440('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9440('0xc'));var Papa=require(_0x9440('0xd'));var Redis=require('ioredis');var authService=require(_0x9440('0xe'));var qs=require(_0x9440('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9440('0x10'));var logger=require(_0x9440('0x11'))(_0x9440('0x12'));var utils=require('../../config/utils');var config=require(_0x9440('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9440('0x14'))['db'];function respondWithStatusCode(_0x409e4e,_0x2502b2){_0x2502b2=_0x2502b2||0xcc;return function(_0xfd398a){if(_0xfd398a){return _0x409e4e[_0x9440('0x15')](_0x2502b2);}return _0x409e4e[_0x9440('0x16')](_0x2502b2)[_0x9440('0x17')]();};}function respondWithResult(_0x29e0a8,_0x582344){_0x582344=_0x582344||0xc8;return function(_0x3767e8){if(_0x3767e8){return _0x29e0a8['status'](_0x582344)['json'](_0x3767e8);}};}function respondWithFilteredResult(_0x58d882,_0x4cab7c){return function(_0x580cad){if(_0x580cad){var _0x384f50=typeof _0x4cab7c[_0x9440('0x18')]==='undefined'&&typeof _0x4cab7c['limit']===_0x9440('0x19');var _0x54227e=_0x580cad[_0x9440('0x1a')];var _0x3148db=_0x384f50?0x0:_0x4cab7c['offset'];var _0x431ba6=_0x384f50?_0x580cad[_0x9440('0x1a')]:_0x4cab7c[_0x9440('0x18')]+_0x4cab7c['limit'];var _0x14b60d;if(_0x431ba6>=_0x54227e){_0x431ba6=_0x54227e;_0x14b60d=0xc8;}else{_0x14b60d=0xce;}_0x58d882['status'](_0x14b60d);return _0x58d882['set'](_0x9440('0x1b'),_0x3148db+'-'+_0x431ba6+'/'+_0x54227e)[_0x9440('0x1c')](_0x580cad);}return null;};}function patchUpdates(_0x902a8b){return function(_0x2aa378){try{jsonpatch['apply'](_0x2aa378,_0x902a8b,!![]);}catch(_0x418e20){return BPromise[_0x9440('0x1d')](_0x418e20);}return _0x2aa378[_0x9440('0x1e')]();};}function saveUpdates(_0x288f21,_0x5ba2a3){return function(_0x259e85){if(_0x259e85){return _0x259e85[_0x9440('0x1f')](_0x288f21)[_0x9440('0x20')](function(_0x18b7a4){return _0x18b7a4;});}return null;};}function removeEntity(_0x4126b1,_0x1a8767){return function(_0x1cbe32){if(_0x1cbe32){return _0x1cbe32[_0x9440('0x21')]()[_0x9440('0x20')](function(){_0x4126b1[_0x9440('0x16')](0xcc)[_0x9440('0x17')]();});}};}function handleEntityNotFound(_0x473696,_0x5092cf){return function(_0x138ec3){if(!_0x138ec3){_0x473696['sendStatus'](0x194);}return _0x138ec3;};}function handleError(_0x11097e,_0x548ac9){_0x548ac9=_0x548ac9||0x1f4;return function(_0x190c7f){logger[_0x9440('0x22')](_0x190c7f[_0x9440('0x23')]);if(_0x190c7f[_0x9440('0x24')]){delete _0x190c7f['name'];}_0x11097e[_0x9440('0x16')](_0x548ac9)[_0x9440('0x25')](_0x190c7f);};}exports['index']=function(_0x14fe2a,_0x33c6df){var _0x19ab3a={},_0x4b2590={},_0x1ea3f6={'count':0x0,'rows':[]};var _0x10f5ed=_[_0x9440('0x26')](db[_0x9440('0x27')][_0x9440('0x28')],function(_0x1b7e39){return{'name':_0x1b7e39[_0x9440('0x29')],'type':_0x1b7e39[_0x9440('0x2a')][_0x9440('0x2b')]};});_0x4b2590['model']=_['map'](_0x10f5ed,'name');_0x4b2590[_0x9440('0x2c')]=_['keys'](_0x14fe2a['query']);_0x4b2590['filters']=_[_0x9440('0x2d')](_0x4b2590[_0x9440('0x2e')],_0x4b2590[_0x9440('0x2c')]);_0x19ab3a['attributes']=_[_0x9440('0x2d')](_0x4b2590['model'],qs[_0x9440('0x2f')](_0x14fe2a[_0x9440('0x2c')][_0x9440('0x2f')]));_0x19ab3a[_0x9440('0x30')]=_0x19ab3a[_0x9440('0x30')][_0x9440('0x31')]?_0x19ab3a[_0x9440('0x30')]:_0x4b2590[_0x9440('0x2e')];if(!_0x14fe2a[_0x9440('0x2c')][_0x9440('0x32')]('nolimit')){_0x19ab3a[_0x9440('0x33')]=qs[_0x9440('0x33')](_0x14fe2a[_0x9440('0x2c')][_0x9440('0x33')]);_0x19ab3a[_0x9440('0x18')]=qs['offset'](_0x14fe2a[_0x9440('0x2c')][_0x9440('0x18')]);}_0x19ab3a[_0x9440('0x34')]=qs[_0x9440('0x35')](_0x14fe2a['query'][_0x9440('0x35')]);_0x19ab3a[_0x9440('0x36')]=qs[_0x9440('0x37')](_[_0x9440('0x38')](_0x14fe2a['query'],_0x4b2590[_0x9440('0x37')]),_0x10f5ed);if(_0x14fe2a[_0x9440('0x2c')][_0x9440('0x39')]){_0x19ab3a['where']=_[_0x9440('0x3a')](_0x19ab3a[_0x9440('0x36')],{'$or':_[_0x9440('0x26')](_0x10f5ed,function(_0xb5a9f3){if(_0xb5a9f3[_0x9440('0x2a')]!==_0x9440('0x3b')){var _0x1cabd5={};_0x1cabd5[_0xb5a9f3[_0x9440('0x24')]]={'$like':'%'+_0x14fe2a[_0x9440('0x2c')][_0x9440('0x39')]+'%'};return _0x1cabd5;}})});}_0x19ab3a=_['merge']({},_0x19ab3a,_0x14fe2a[_0x9440('0x3c')]);var _0x2a4b96={'where':_0x19ab3a[_0x9440('0x36')]};return db[_0x9440('0x27')][_0x9440('0x1a')](_0x2a4b96)[_0x9440('0x20')](function(_0xffa97a){_0x1ea3f6[_0x9440('0x1a')]=_0xffa97a;if(_0x14fe2a[_0x9440('0x2c')][_0x9440('0x3d')]){_0x19ab3a['include']=[{'all':!![]}];}return db[_0x9440('0x27')]['findAll'](_0x19ab3a);})['then'](function(_0x1ff6f4){_0x1ea3f6[_0x9440('0x3e')]=_0x1ff6f4;return _0x1ea3f6;})[_0x9440('0x20')](respondWithFilteredResult(_0x33c6df,_0x19ab3a))['catch'](handleError(_0x33c6df,null));};exports[_0x9440('0x3f')]=function(_0x9f4900,_0x26269d){var _0x462f9a={'raw':!![],'where':{'id':_0x9f4900['params']['id']}},_0x273f0d={};_0x273f0d[_0x9440('0x2e')]=_[_0x9440('0x40')](db[_0x9440('0x27')][_0x9440('0x28')]);_0x273f0d[_0x9440('0x2c')]=_[_0x9440('0x40')](_0x9f4900['query']);_0x273f0d[_0x9440('0x37')]=_[_0x9440('0x2d')](_0x273f0d[_0x9440('0x2e')],_0x273f0d['query']);_0x462f9a[_0x9440('0x30')]=_[_0x9440('0x2d')](_0x273f0d[_0x9440('0x2e')],qs[_0x9440('0x2f')](_0x9f4900[_0x9440('0x2c')][_0x9440('0x2f')]));_0x462f9a[_0x9440('0x30')]=_0x462f9a['attributes'][_0x9440('0x31')]?_0x462f9a['attributes']:_0x273f0d[_0x9440('0x2e')];if(_0x9f4900[_0x9440('0x2c')]['includeAll']){_0x462f9a[_0x9440('0x41')]=[{'all':!![]}];}_0x462f9a=_['merge']({},_0x462f9a,_0x9f4900[_0x9440('0x3c')]);return db[_0x9440('0x27')][_0x9440('0x42')](_0x462f9a)['then'](handleEntityNotFound(_0x26269d,null))[_0x9440('0x20')](respondWithResult(_0x26269d,null))[_0x9440('0x43')](handleError(_0x26269d,null));};exports[_0x9440('0x44')]=function(_0x4bc0f0,_0x1345ea){return db['SugarcrmField'][_0x9440('0x44')](_0x4bc0f0[_0x9440('0x45')],{})[_0x9440('0x20')](respondWithResult(_0x1345ea,0xc9))[_0x9440('0x43')](handleError(_0x1345ea,null));};exports[_0x9440('0x1f')]=function(_0x279f82,_0x10940d){if(_0x279f82[_0x9440('0x45')]['id']){delete _0x279f82[_0x9440('0x45')]['id'];}return db['SugarcrmField'][_0x9440('0x42')]({'where':{'id':_0x279f82['params']['id']}})['then'](handleEntityNotFound(_0x10940d,null))[_0x9440('0x20')](saveUpdates(_0x279f82[_0x9440('0x45')],null))[_0x9440('0x20')](respondWithResult(_0x10940d,null))[_0x9440('0x43')](handleError(_0x10940d,null));};exports[_0x9440('0x21')]=function(_0x3aa806,_0x50b427){return db['SugarcrmField'][_0x9440('0x42')]({'where':{'id':_0x3aa806[_0x9440('0x46')]['id']}})['then'](handleEntityNotFound(_0x50b427,null))[_0x9440('0x20')](removeEntity(_0x50b427,null))['catch'](handleError(_0x50b427,null));}; \ No newline at end of file +var _0x62fe=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','name','index','map','SugarcrmField','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','findAll','rows','show','params','keys','includeAll','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x62fe,0x15b));var _0xe62f=function(_0x379dc0,_0x48ca90){_0x379dc0=_0x379dc0-0x0;var _0x56ce84=_0x62fe[_0x379dc0];return _0x56ce84;};'use strict';var emlformat=require(_0xe62f('0x0'));var rimraf=require(_0xe62f('0x1'));var zipdir=require(_0xe62f('0x2'));var jsonpatch=require(_0xe62f('0x3'));var rp=require(_0xe62f('0x4'));var moment=require('moment');var BPromise=require(_0xe62f('0x5'));var Mustache=require(_0xe62f('0x6'));var util=require(_0xe62f('0x7'));var path=require('path');var sox=require(_0xe62f('0x8'));var csv=require(_0xe62f('0x9'));var ejs=require(_0xe62f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe62f('0xb'));var squel=require(_0xe62f('0xc'));var crypto=require(_0xe62f('0xd'));var jsforce=require(_0xe62f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe62f('0x9'));var querystring=require(_0xe62f('0xf'));var Papa=require(_0xe62f('0x10'));var Redis=require(_0xe62f('0x11'));var authService=require(_0xe62f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe62f('0x13'));var hardwareService=require(_0xe62f('0x14'));var logger=require(_0xe62f('0x15'))('api');var utils=require(_0xe62f('0x16'));var config=require(_0xe62f('0x17'));var licenseUtil=require(_0xe62f('0x18'));var db=require(_0xe62f('0x19'))['db'];function respondWithStatusCode(_0x3eab20,_0x342ab5){_0x342ab5=_0x342ab5||0xcc;return function(_0x4cd567){if(_0x4cd567){return _0x3eab20[_0xe62f('0x1a')](_0x342ab5);}return _0x3eab20[_0xe62f('0x1b')](_0x342ab5)['end']();};}function respondWithResult(_0x4b0c95,_0x21e69f){_0x21e69f=_0x21e69f||0xc8;return function(_0xa2721){if(_0xa2721){return _0x4b0c95[_0xe62f('0x1b')](_0x21e69f)[_0xe62f('0x1c')](_0xa2721);}};}function respondWithFilteredResult(_0x369cb5,_0x31a2cf){return function(_0x4ca802){if(_0x4ca802){var _0x4e4a08=typeof _0x31a2cf[_0xe62f('0x1d')]===_0xe62f('0x1e')&&typeof _0x31a2cf[_0xe62f('0x1f')]===_0xe62f('0x1e');var _0xc079cf=_0x4ca802[_0xe62f('0x20')];var _0x31cb5e=_0x4e4a08?0x0:_0x31a2cf['offset'];var _0x38f5b6=_0x4e4a08?_0x4ca802[_0xe62f('0x20')]:_0x31a2cf['offset']+_0x31a2cf[_0xe62f('0x1f')];var _0x556a5d;if(_0x38f5b6>=_0xc079cf){_0x38f5b6=_0xc079cf;_0x556a5d=0xc8;}else{_0x556a5d=0xce;}_0x369cb5[_0xe62f('0x1b')](_0x556a5d);return _0x369cb5[_0xe62f('0x21')](_0xe62f('0x22'),_0x31cb5e+'-'+_0x38f5b6+'/'+_0xc079cf)[_0xe62f('0x1c')](_0x4ca802);}return null;};}function patchUpdates(_0xb659c2){return function(_0x2deac9){try{jsonpatch['apply'](_0x2deac9,_0xb659c2,!![]);}catch(_0x20d88c){return BPromise['reject'](_0x20d88c);}return _0x2deac9[_0xe62f('0x23')]();};}function saveUpdates(_0x112c97,_0x4b04b1){return function(_0x40337e){if(_0x40337e){return _0x40337e[_0xe62f('0x24')](_0x112c97)[_0xe62f('0x25')](function(_0xa3bf1a){return _0xa3bf1a;});}return null;};}function removeEntity(_0x3c7737,_0x589a92){return function(_0x3a950c){if(_0x3a950c){return _0x3a950c[_0xe62f('0x26')]()['then'](function(){_0x3c7737[_0xe62f('0x1b')](0xcc)[_0xe62f('0x27')]();});}};}function handleEntityNotFound(_0x299214,_0x5122de){return function(_0x269359){if(!_0x269359){_0x299214['sendStatus'](0x194);}return _0x269359;};}function handleError(_0x24eb78,_0x11f7f2){_0x11f7f2=_0x11f7f2||0x1f4;return function(_0x33ac5d){logger[_0xe62f('0x28')](_0x33ac5d['stack']);if(_0x33ac5d['name']){delete _0x33ac5d[_0xe62f('0x29')];}_0x24eb78[_0xe62f('0x1b')](_0x11f7f2)['send'](_0x33ac5d);};}exports[_0xe62f('0x2a')]=function(_0x31645e,_0x2e4ca0){var _0x244781={},_0x118517={},_0x5e8ec8={'count':0x0,'rows':[]};var _0x4f65c7=_[_0xe62f('0x2b')](db[_0xe62f('0x2c')]['rawAttributes'],function(_0x1ce3d8){return{'name':_0x1ce3d8[_0xe62f('0x2d')],'type':_0x1ce3d8[_0xe62f('0x2e')][_0xe62f('0x2f')]};});_0x118517['model']=_[_0xe62f('0x2b')](_0x4f65c7,_0xe62f('0x29'));_0x118517[_0xe62f('0x30')]=_['keys'](_0x31645e[_0xe62f('0x30')]);_0x118517[_0xe62f('0x31')]=_[_0xe62f('0x32')](_0x118517[_0xe62f('0x33')],_0x118517[_0xe62f('0x30')]);_0x244781['attributes']=_[_0xe62f('0x32')](_0x118517['model'],qs[_0xe62f('0x34')](_0x31645e[_0xe62f('0x30')][_0xe62f('0x34')]));_0x244781[_0xe62f('0x35')]=_0x244781['attributes'][_0xe62f('0x36')]?_0x244781[_0xe62f('0x35')]:_0x118517[_0xe62f('0x33')];if(!_0x31645e['query'][_0xe62f('0x37')]('nolimit')){_0x244781[_0xe62f('0x1f')]=qs[_0xe62f('0x1f')](_0x31645e[_0xe62f('0x30')][_0xe62f('0x1f')]);_0x244781[_0xe62f('0x1d')]=qs[_0xe62f('0x1d')](_0x31645e[_0xe62f('0x30')][_0xe62f('0x1d')]);}_0x244781[_0xe62f('0x38')]=qs[_0xe62f('0x39')](_0x31645e[_0xe62f('0x30')][_0xe62f('0x39')]);_0x244781['where']=qs[_0xe62f('0x31')](_[_0xe62f('0x3a')](_0x31645e[_0xe62f('0x30')],_0x118517['filters']),_0x4f65c7);if(_0x31645e['query'][_0xe62f('0x3b')]){_0x244781[_0xe62f('0x3c')]=_[_0xe62f('0x3d')](_0x244781[_0xe62f('0x3c')],{'$or':_['map'](_0x4f65c7,function(_0x45c601){if(_0x45c601[_0xe62f('0x2e')]!=='VIRTUAL'){var _0x27adba={};_0x27adba[_0x45c601[_0xe62f('0x29')]]={'$like':'%'+_0x31645e[_0xe62f('0x30')][_0xe62f('0x3b')]+'%'};return _0x27adba;}})});}_0x244781=_['merge']({},_0x244781,_0x31645e[_0xe62f('0x3e')]);var _0x314039={'where':_0x244781['where']};return db[_0xe62f('0x2c')][_0xe62f('0x20')](_0x314039)[_0xe62f('0x25')](function(_0x45d9a0){_0x5e8ec8[_0xe62f('0x20')]=_0x45d9a0;if(_0x31645e[_0xe62f('0x30')]['includeAll']){_0x244781['include']=[{'all':!![]}];}return db[_0xe62f('0x2c')][_0xe62f('0x3f')](_0x244781);})[_0xe62f('0x25')](function(_0x2b4051){_0x5e8ec8[_0xe62f('0x40')]=_0x2b4051;return _0x5e8ec8;})['then'](respondWithFilteredResult(_0x2e4ca0,_0x244781))['catch'](handleError(_0x2e4ca0,null));};exports[_0xe62f('0x41')]=function(_0x3d7059,_0x3b7f3a){var _0x519fbe={'raw':!![],'where':{'id':_0x3d7059[_0xe62f('0x42')]['id']}},_0x3d7acd={};_0x3d7acd['model']=_[_0xe62f('0x43')](db[_0xe62f('0x2c')]['rawAttributes']);_0x3d7acd[_0xe62f('0x30')]=_[_0xe62f('0x43')](_0x3d7059[_0xe62f('0x30')]);_0x3d7acd[_0xe62f('0x31')]=_[_0xe62f('0x32')](_0x3d7acd['model'],_0x3d7acd[_0xe62f('0x30')]);_0x519fbe[_0xe62f('0x35')]=_[_0xe62f('0x32')](_0x3d7acd[_0xe62f('0x33')],qs[_0xe62f('0x34')](_0x3d7059[_0xe62f('0x30')][_0xe62f('0x34')]));_0x519fbe['attributes']=_0x519fbe[_0xe62f('0x35')][_0xe62f('0x36')]?_0x519fbe['attributes']:_0x3d7acd['model'];if(_0x3d7059[_0xe62f('0x30')][_0xe62f('0x44')]){_0x519fbe['include']=[{'all':!![]}];}_0x519fbe=_[_0xe62f('0x3d')]({},_0x519fbe,_0x3d7059[_0xe62f('0x3e')]);return db[_0xe62f('0x2c')]['find'](_0x519fbe)[_0xe62f('0x25')](handleEntityNotFound(_0x3b7f3a,null))['then'](respondWithResult(_0x3b7f3a,null))[_0xe62f('0x45')](handleError(_0x3b7f3a,null));};exports[_0xe62f('0x46')]=function(_0x44afc6,_0x351c58){return db[_0xe62f('0x2c')][_0xe62f('0x46')](_0x44afc6['body'],{})[_0xe62f('0x25')](respondWithResult(_0x351c58,0xc9))[_0xe62f('0x45')](handleError(_0x351c58,null));};exports[_0xe62f('0x24')]=function(_0x52639a,_0x5ae608){if(_0x52639a[_0xe62f('0x47')]['id']){delete _0x52639a[_0xe62f('0x47')]['id'];}return db[_0xe62f('0x2c')]['find']({'where':{'id':_0x52639a[_0xe62f('0x42')]['id']}})['then'](handleEntityNotFound(_0x5ae608,null))['then'](saveUpdates(_0x52639a[_0xe62f('0x47')],null))[_0xe62f('0x25')](respondWithResult(_0x5ae608,null))[_0xe62f('0x45')](handleError(_0x5ae608,null));};exports[_0xe62f('0x26')]=function(_0x60674b,_0xbe5e37){return db[_0xe62f('0x2c')][_0xe62f('0x48')]({'where':{'id':_0x60674b['params']['id']}})[_0xe62f('0x25')](handleEntityNotFound(_0xbe5e37,null))[_0xe62f('0x25')](removeEntity(_0xbe5e37,null))[_0xe62f('0x45')](handleError(_0xbe5e37,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a46d989..bab31de 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 _0x8a8d=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x8a8d,0xc2));var _0xd8a8=function(_0x4dff20,_0x448381){_0x4dff20=_0x4dff20-0x0;var _0x4f31a0=_0x8a8d[_0x4dff20];return _0x4f31a0;};'use strict';var _=require(_0xd8a8('0x0'));var util=require(_0xd8a8('0x1'));var logger=require(_0xd8a8('0x2'))(_0xd8a8('0x3'));var moment=require(_0xd8a8('0x4'));var BPromise=require(_0xd8a8('0x5'));var rp=require(_0xd8a8('0x6'));var fs=require('fs');var path=require(_0xd8a8('0x7'));var rimraf=require(_0xd8a8('0x8'));var config=require(_0xd8a8('0x9'));var attributes=require(_0xd8a8('0xa'));module['exports']=function(_0x3ba859,_0x11f468){return _0x3ba859['define'](_0xd8a8('0xb'),attributes,{'tableName':_0xd8a8('0xc'),'paranoid':![],'indexes':[{'name':_0xd8a8('0xd'),'fields':[_0xd8a8('0xe'),_0xd8a8('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0aee=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util'];(function(_0x4ded16,_0x23fcbf){var _0x4a525a=function(_0x2c6b5e){while(--_0x2c6b5e){_0x4ded16['push'](_0x4ded16['shift']());}};_0x4a525a(++_0x23fcbf);}(_0x0aee,0xdb));var _0xe0ae=function(_0x1bbb96,_0x5b689f){_0x1bbb96=_0x1bbb96-0x0;var _0x3c622d=_0x0aee[_0x1bbb96];return _0x3c622d;};'use strict';var _=require(_0xe0ae('0x0'));var util=require(_0xe0ae('0x1'));var logger=require(_0xe0ae('0x2'))(_0xe0ae('0x3'));var moment=require(_0xe0ae('0x4'));var BPromise=require(_0xe0ae('0x5'));var rp=require(_0xe0ae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe0ae('0x7'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x13d50,_0x4bd9dd){return _0x13d50['define'](_0xe0ae('0x8'),attributes,{'tableName':_0xe0ae('0x9'),'paranoid':![],'indexes':[{'name':_0xe0ae('0xa'),'fields':[_0xe0ae('0xb'),_0xe0ae('0xc')],'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 8e937f5..0e83138 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 _0x06dd=['request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0xdcfc29,_0x1d2d24){var _0x310085=function(_0x33890b){while(--_0x33890b){_0xdcfc29['push'](_0xdcfc29['shift']());}};_0x310085(++_0x1d2d24);}(_0x06dd,0x13c));var _0xd06d=function(_0xf2602c,_0x4d4fcb){_0xf2602c=_0xf2602c-0x0;var _0x221e53=_0x06dd[_0xf2602c];return _0x221e53;};'use strict';var _=require(_0xd06d('0x0'));var util=require(_0xd06d('0x1'));var moment=require(_0xd06d('0x2'));var BPromise=require(_0xd06d('0x3'));var rs=require(_0xd06d('0x4'));var fs=require('fs');var Redis=require(_0xd06d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd06d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd06d('0x7'));var client=jayson[_0xd06d('0x8')][_0xd06d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8e4dd9,_0x312fd8,_0x284658){return new BPromise(function(_0x4a28f0,_0x46da3a){return client[_0xd06d('0xa')](_0x8e4dd9,_0x284658)[_0xd06d('0xb')](function(_0x33fd46){logger[_0xd06d('0xc')](_0xd06d('0xd'),_0x312fd8,_0xd06d('0xe'));logger[_0xd06d('0xf')](_0xd06d('0x10'),_0x312fd8,_0xd06d('0xe'),JSON[_0xd06d('0x11')](_0x33fd46));if(_0x33fd46['error']){if(_0x33fd46['error'][_0xd06d('0x12')]===0x1f4){logger[_0xd06d('0x13')](_0xd06d('0xd'),_0x312fd8,_0x33fd46[_0xd06d('0x13')][_0xd06d('0x14')]);return _0x46da3a(_0x33fd46['error'][_0xd06d('0x14')]);}logger[_0xd06d('0x13')](_0xd06d('0xd'),_0x312fd8,_0x33fd46[_0xd06d('0x13')][_0xd06d('0x14')]);return _0x4a28f0(_0x33fd46['error']['message']);}else{logger['info'](_0xd06d('0xd'),_0x312fd8,_0xd06d('0xe'));_0x4a28f0(_0x33fd46[_0xd06d('0x15')][_0xd06d('0x14')]);}})['catch'](function(_0x598063){logger['error'](_0xd06d('0xd'),_0x312fd8,_0x598063);_0x46da3a(_0x598063);});});} \ No newline at end of file +var _0xa7a5=['jayson/promise','http','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4f84c3,_0x6d094d){var _0x460f9f=function(_0x5af5bd){while(--_0x5af5bd){_0x4f84c3['push'](_0x4f84c3['shift']());}};_0x460f9f(++_0x6d094d);}(_0xa7a5,0x199));var _0x5a7a=function(_0x328020,_0x2ed9ee){_0x328020=_0x328020-0x0;var _0x10873d=_0xa7a5[_0x328020];return _0x10873d;};'use strict';var _=require(_0x5a7a('0x0'));var util=require(_0x5a7a('0x1'));var moment=require(_0x5a7a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a7a('0x3'));var db=require(_0x5a7a('0x4'))['db'];var utils=require(_0x5a7a('0x5'));var logger=require(_0x5a7a('0x6'))(_0x5a7a('0x7'));var config=require(_0x5a7a('0x8'));var jayson=require(_0x5a7a('0x9'));var client=jayson['client'][_0x5a7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59593c,_0x3830aa,_0xe8a9cd){return new BPromise(function(_0x134b19,_0x3c8264){return client['request'](_0x59593c,_0xe8a9cd)['then'](function(_0x1580dd){logger[_0x5a7a('0xb')](_0x5a7a('0xc'),_0x3830aa,'request\x20sent');logger['debug'](_0x5a7a('0xd'),_0x3830aa,'request\x20sent',JSON[_0x5a7a('0xe')](_0x1580dd));if(_0x1580dd[_0x5a7a('0xf')]){if(_0x1580dd['error']['code']===0x1f4){logger[_0x5a7a('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x3830aa,_0x1580dd[_0x5a7a('0xf')][_0x5a7a('0x10')]);return _0x3c8264(_0x1580dd['error'][_0x5a7a('0x10')]);}logger['error'](_0x5a7a('0xc'),_0x3830aa,_0x1580dd[_0x5a7a('0xf')][_0x5a7a('0x10')]);return _0x134b19(_0x1580dd[_0x5a7a('0xf')]['message']);}else{logger[_0x5a7a('0xb')](_0x5a7a('0xc'),_0x3830aa,_0x5a7a('0x11'));_0x134b19(_0x1580dd[_0x5a7a('0x12')]['message']);}})['catch'](function(_0x292b88){logger[_0x5a7a('0xf')](_0x5a7a('0xc'),_0x3830aa,_0x292b88);_0x3c8264(_0x292b88);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 732d119..7aa27b6 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 _0x9933=['getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','index','/:id','/:id/configurations','isAuthenticated'];(function(_0x1f9e87,_0x129493){var _0x36d1a6=function(_0x1d6e5b){while(--_0x1d6e5b){_0x1f9e87['push'](_0x1f9e87['shift']());}};_0x36d1a6(++_0x129493);}(_0x9933,0xe5));var _0x3993=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9933[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x3993('0x0'));var util=require(_0x3993('0x1'));var path=require('path');var timeout=require(_0x3993('0x2'));var express=require('express');var router=express[_0x3993('0x3')]();var fs_extra=require(_0x3993('0x4'));var auth=require(_0x3993('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x3993('0x6')]('/',auth['isAuthenticated'](),controller[_0x3993('0x7')]);router[_0x3993('0x6')](_0x3993('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x3993('0x6')](_0x3993('0x9'),auth[_0x3993('0xa')](),controller[_0x3993('0xb')]);router['get']('/:id/fields',auth[_0x3993('0xa')](),controller[_0x3993('0xc')]);router[_0x3993('0xd')]('/',auth['isAuthenticated'](),controller[_0x3993('0xe')]);router[_0x3993('0xd')](_0x3993('0x9'),auth['isAuthenticated'](),controller[_0x3993('0xf')]);router[_0x3993('0x10')](_0x3993('0x8'),auth[_0x3993('0xa')](),controller[_0x3993('0x11')]);router[_0x3993('0x12')](_0x3993('0x8'),auth[_0x3993('0xa')](),controller['destroy']);module[_0x3993('0x13')]=router; \ No newline at end of file +var _0xad68=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x297691,_0x1bcaa8){var _0x475f66=function(_0x788cba){while(--_0x788cba){_0x297691['push'](_0x297691['shift']());}};_0x475f66(++_0x1bcaa8);}(_0xad68,0x102));var _0x8ad6=function(_0x208b7a,_0x2e3baa){_0x208b7a=_0x208b7a-0x0;var _0x37b7ec=_0xad68[_0x208b7a];return _0x37b7ec;};'use strict';var multer=require(_0x8ad6('0x0'));var util=require(_0x8ad6('0x1'));var path=require(_0x8ad6('0x2'));var timeout=require(_0x8ad6('0x3'));var express=require('express');var router=express[_0x8ad6('0x4')]();var fs_extra=require(_0x8ad6('0x5'));var auth=require(_0x8ad6('0x6'));var interaction=require(_0x8ad6('0x7'));var config=require(_0x8ad6('0x8'));var controller=require(_0x8ad6('0x9'));router[_0x8ad6('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ad6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8ad6('0xc')]);router[_0x8ad6('0xa')](_0x8ad6('0xd'),auth[_0x8ad6('0xe')](),controller[_0x8ad6('0xf')]);router[_0x8ad6('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8ad6('0x10')]);router[_0x8ad6('0x11')]('/',auth['isAuthenticated'](),controller[_0x8ad6('0x12')]);router[_0x8ad6('0x11')](_0x8ad6('0xd'),auth['isAuthenticated'](),controller[_0x8ad6('0x13')]);router[_0x8ad6('0x14')]('/:id',auth[_0x8ad6('0xe')](),controller[_0x8ad6('0x15')]);router[_0x8ad6('0x16')](_0x8ad6('0x17'),auth[_0x8ad6('0xe')](),controller[_0x8ad6('0x18')]);module[_0x8ad6('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e2f4267..9d494b1 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 _0xa839=['STRING','HelpDesk','sequelize'];(function(_0x21c3c9,_0x25ba19){var _0x431668=function(_0x32b2e3){while(--_0x32b2e3){_0x21c3c9['push'](_0x21c3c9['shift']());}};_0x431668(++_0x25ba19);}(_0xa839,0xda));var _0x9a83=function(_0x20b6c5,_0x20cda5){_0x20b6c5=_0x20b6c5-0x0;var _0x5f4327=_0xa839[_0x20b6c5];return _0x5f4327;};'use strict';var Sequelize=require(_0x9a83('0x0'));module['exports']={'name':{'type':Sequelize[_0x9a83('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9a83('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9a83('0x1')],'allowNull':![],'defaultValue':_0x9a83('0x2')},'remoteUri':{'type':Sequelize[_0x9a83('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9a83('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1bde=['exports','STRING','HelpDesk'];(function(_0x1890a8,_0x42a2b2){var _0x420c6d=function(_0x2baa82){while(--_0x2baa82){_0x1890a8['push'](_0x1890a8['shift']());}};_0x420c6d(++_0x42a2b2);}(_0x1bde,0x186));var _0xe1bd=function(_0x23dc29,_0x4127b3){_0x23dc29=_0x23dc29-0x0;var _0x5a79bb=_0x1bde[_0x23dc29];return _0x5a79bb;};'use strict';var Sequelize=require('sequelize');module[_0xe1bd('0x0')]={'name':{'type':Sequelize[_0xe1bd('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe1bd('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe1bd('0x1')],'allowNull':![],'defaultValue':_0xe1bd('0x2')},'remoteUri':{'type':Sequelize[_0xe1bd('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe1bd('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe1bd('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index b45fa2c..5ca2263 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 _0x4004=['Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','description','serverUrl','accessKey','moduleName','lastIndexOf','format','%s/webservice.php','GET','username','success','POST','token','describe','result','sessionName','reference','owner','remove','includes','editable','false','label','picklist','log','vTiger\x20error:\x20','test','statusCode','stringify','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration'];(function(_0x296a00,_0x48ffff){var _0x717c81=function(_0x1ca56e){while(--_0x1ca56e){_0x296a00['push'](_0x296a00['shift']());}};_0x717c81(++_0x48ffff);}(_0x4004,0x9a));var _0x4400=function(_0x179118,_0x5ad20f){_0x179118=_0x179118-0x0;var _0x18b819=_0x4004[_0x179118];return _0x18b819;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4400('0x0'));var zipdir=require(_0x4400('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4400('0x2'));var moment=require(_0x4400('0x3'));var BPromise=require(_0x4400('0x4'));var Mustache=require(_0x4400('0x5'));var util=require(_0x4400('0x6'));var path=require(_0x4400('0x7'));var sox=require(_0x4400('0x8'));var csv=require(_0x4400('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4400('0xa'));var _=require(_0x4400('0xb'));var squel=require('squel');var crypto=require(_0x4400('0xc'));var jsforce=require(_0x4400('0xd'));var deskjs=require(_0x4400('0xe'));var toCsv=require(_0x4400('0x9'));var querystring=require(_0x4400('0xf'));var Papa=require(_0x4400('0x10'));var Redis=require(_0x4400('0x11'));var authService=require(_0x4400('0x12'));var qs=require(_0x4400('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4400('0x14'));var logger=require('../../config/logger')(_0x4400('0x15'));var utils=require(_0x4400('0x16'));var config=require(_0x4400('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4400('0x18'))['db'];var integrations=require(_0x4400('0x19'));function respondWithStatusCode(_0x39221b,_0x35b5e5){_0x35b5e5=_0x35b5e5||0xcc;return function(_0x184813){if(_0x184813){return _0x39221b[_0x4400('0x1a')](_0x35b5e5);}return _0x39221b[_0x4400('0x1b')](_0x35b5e5)[_0x4400('0x1c')]();};}function respondWithResult(_0x209cf0,_0x3e6f07){_0x3e6f07=_0x3e6f07||0xc8;return function(_0x4918e8){if(_0x4918e8){return _0x209cf0[_0x4400('0x1b')](_0x3e6f07)[_0x4400('0x1d')](_0x4918e8);}};}function respondWithFilteredResult(_0x35f139,_0x45676f){return function(_0x1072db){if(_0x1072db){var _0x5a24d4=typeof _0x45676f[_0x4400('0x1e')]===_0x4400('0x1f')&&typeof _0x45676f[_0x4400('0x20')]===_0x4400('0x1f');var _0x354e0d=_0x1072db[_0x4400('0x21')];var _0xdc56ad=_0x5a24d4?0x0:_0x45676f[_0x4400('0x1e')];var _0x28e4f7=_0x5a24d4?_0x1072db['count']:_0x45676f[_0x4400('0x1e')]+_0x45676f[_0x4400('0x20')];var _0x4a7410;if(_0x28e4f7>=_0x354e0d){_0x28e4f7=_0x354e0d;_0x4a7410=0xc8;}else{_0x4a7410=0xce;}_0x35f139[_0x4400('0x1b')](_0x4a7410);return _0x35f139['set'](_0x4400('0x22'),_0xdc56ad+'-'+_0x28e4f7+'/'+_0x354e0d)[_0x4400('0x1d')](_0x1072db);}return null;};}function patchUpdates(_0x1750f7){return function(_0x17af3e){try{jsonpatch[_0x4400('0x23')](_0x17af3e,_0x1750f7,!![]);}catch(_0x549ec3){return BPromise[_0x4400('0x24')](_0x549ec3);}return _0x17af3e[_0x4400('0x25')]();};}function saveUpdates(_0x190f7a,_0x1b0858){return function(_0x19ac92){if(_0x19ac92){return _0x19ac92[_0x4400('0x26')](_0x190f7a)[_0x4400('0x27')](function(_0x1a1920){return _0x1a1920;});}return null;};}function removeEntity(_0x15c22a,_0x18bff9){return function(_0x42941d){if(_0x42941d){return _0x42941d[_0x4400('0x28')]()[_0x4400('0x27')](function(){_0x15c22a[_0x4400('0x1b')](0xcc)[_0x4400('0x1c')]();});}};}function handleEntityNotFound(_0xb0e249,_0x5ce422){return function(_0x3661e5){if(!_0x3661e5){_0xb0e249['sendStatus'](0x194);}return _0x3661e5;};}function handleError(_0x165824,_0x4e2d6f){_0x4e2d6f=_0x4e2d6f||0x1f4;return function(_0x3082a5){logger['error'](_0x3082a5['stack']);if(_0x3082a5[_0x4400('0x29')]){delete _0x3082a5[_0x4400('0x29')];}_0x165824[_0x4400('0x1b')](_0x4e2d6f)[_0x4400('0x2a')](_0x3082a5);};}exports[_0x4400('0x2b')]=function(_0x3a74ed,_0x52ec96){var _0x432fc0={},_0x26d626={},_0x4bc043={'count':0x0,'rows':[]};var _0x3af081=_[_0x4400('0x2c')](db[_0x4400('0x2d')][_0x4400('0x2e')],function(_0x300217){return{'name':_0x300217[_0x4400('0x2f')],'type':_0x300217[_0x4400('0x30')][_0x4400('0x31')]};});_0x26d626[_0x4400('0x32')]=_[_0x4400('0x2c')](_0x3af081,_0x4400('0x29'));_0x26d626[_0x4400('0x33')]=_[_0x4400('0x34')](_0x3a74ed[_0x4400('0x33')]);_0x26d626[_0x4400('0x35')]=_[_0x4400('0x36')](_0x26d626[_0x4400('0x32')],_0x26d626[_0x4400('0x33')]);_0x432fc0[_0x4400('0x37')]=_[_0x4400('0x36')](_0x26d626[_0x4400('0x32')],qs[_0x4400('0x38')](_0x3a74ed[_0x4400('0x33')]['fields']));_0x432fc0[_0x4400('0x37')]=_0x432fc0['attributes'][_0x4400('0x39')]?_0x432fc0[_0x4400('0x37')]:_0x26d626[_0x4400('0x32')];if(!_0x3a74ed['query'][_0x4400('0x3a')](_0x4400('0x3b'))){_0x432fc0[_0x4400('0x20')]=qs[_0x4400('0x20')](_0x3a74ed[_0x4400('0x33')][_0x4400('0x20')]);_0x432fc0['offset']=qs[_0x4400('0x1e')](_0x3a74ed[_0x4400('0x33')]['offset']);}_0x432fc0[_0x4400('0x3c')]=qs[_0x4400('0x3d')](_0x3a74ed[_0x4400('0x33')][_0x4400('0x3d')]);_0x432fc0[_0x4400('0x3e')]=qs[_0x4400('0x35')](_[_0x4400('0x3f')](_0x3a74ed[_0x4400('0x33')],_0x26d626[_0x4400('0x35')]),_0x3af081);if(_0x3a74ed[_0x4400('0x33')]['filter']){_0x432fc0[_0x4400('0x3e')]=_[_0x4400('0x40')](_0x432fc0['where'],{'$or':_['map'](_0x3af081,function(_0x50af51){if(_0x50af51[_0x4400('0x30')]!==_0x4400('0x41')){var _0x5e60d0={};_0x5e60d0[_0x50af51[_0x4400('0x29')]]={'$like':'%'+_0x3a74ed['query'][_0x4400('0x42')]+'%'};return _0x5e60d0;}})});}_0x432fc0=_[_0x4400('0x40')]({},_0x432fc0,_0x3a74ed['options']);var _0x4d51f0={'where':_0x432fc0[_0x4400('0x3e')]};return db[_0x4400('0x2d')][_0x4400('0x21')](_0x4d51f0)['then'](function(_0x3c37fa){_0x4bc043[_0x4400('0x21')]=_0x3c37fa;if(_0x3a74ed['query'][_0x4400('0x43')]){_0x432fc0[_0x4400('0x44')]=[{'all':!![]}];}return db[_0x4400('0x2d')][_0x4400('0x45')](_0x432fc0);})[_0x4400('0x27')](function(_0x2cbd93){_0x4bc043[_0x4400('0x46')]=_0x2cbd93;return _0x4bc043;})[_0x4400('0x27')](respondWithFilteredResult(_0x52ec96,_0x432fc0))[_0x4400('0x47')](handleError(_0x52ec96,null));};exports[_0x4400('0x48')]=function(_0x39ef96,_0x3c2477){var _0x4fcdc9={'raw':![],'where':{'id':_0x39ef96[_0x4400('0x49')]['id']}},_0x33742d={};_0x33742d[_0x4400('0x32')]=_[_0x4400('0x34')](db[_0x4400('0x2d')][_0x4400('0x2e')]);_0x33742d[_0x4400('0x33')]=_[_0x4400('0x34')](_0x39ef96[_0x4400('0x33')]);_0x33742d[_0x4400('0x35')]=_[_0x4400('0x36')](_0x33742d[_0x4400('0x32')],_0x33742d['query']);_0x4fcdc9['attributes']=_[_0x4400('0x36')](_0x33742d[_0x4400('0x32')],qs[_0x4400('0x38')](_0x39ef96['query']['fields']));_0x4fcdc9['attributes']=_0x4fcdc9['attributes'][_0x4400('0x39')]?_0x4fcdc9[_0x4400('0x37')]:_0x33742d['model'];if(_0x39ef96['query'][_0x4400('0x43')]){_0x4fcdc9[_0x4400('0x44')]=[{'all':!![]}];}_0x4fcdc9=_[_0x4400('0x40')]({},_0x4fcdc9,_0x39ef96[_0x4400('0x4a')]);return db[_0x4400('0x2d')][_0x4400('0x4b')](_0x4fcdc9)[_0x4400('0x27')](handleEntityNotFound(_0x3c2477,null))['then'](respondWithResult(_0x3c2477,null))[_0x4400('0x47')](handleError(_0x3c2477,null));};exports[_0x4400('0x4c')]=function(_0x39ac7d,_0xfd19fe){return db[_0x4400('0x2d')]['create'](_0x39ac7d[_0x4400('0x4d')],{})['then'](respondWithResult(_0xfd19fe,0xc9))[_0x4400('0x47')](handleError(_0xfd19fe,null));};exports[_0x4400('0x26')]=function(_0x41d1c5,_0xb159ba){if(_0x41d1c5[_0x4400('0x4d')]['id']){delete _0x41d1c5[_0x4400('0x4d')]['id'];}return db[_0x4400('0x2d')][_0x4400('0x4b')]({'where':{'id':_0x41d1c5[_0x4400('0x49')]['id']}})['then'](handleEntityNotFound(_0xb159ba,null))[_0x4400('0x27')](saveUpdates(_0x41d1c5[_0x4400('0x4d')],null))[_0x4400('0x27')](respondWithResult(_0xb159ba,null))[_0x4400('0x47')](handleError(_0xb159ba,null));};exports[_0x4400('0x28')]=function(_0x3f90c3,_0x4c3a2d){return db[_0x4400('0x2d')]['find']({'where':{'id':_0x3f90c3[_0x4400('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c3a2d,null))[_0x4400('0x27')](removeEntity(_0x4c3a2d,null))[_0x4400('0x47')](handleError(_0x4c3a2d,null));};exports[_0x4400('0x4e')]=function(_0x76463c,_0x564c4c,_0x59a23d){var _0x4efa2a={};var _0x175765={};var _0x5c07ca;var _0x43818b;return db[_0x4400('0x2d')][_0x4400('0x4f')]({'where':{'id':_0x76463c['params']['id']}})['then'](handleEntityNotFound(_0x564c4c,null))['then'](function(_0x382241){if(_0x382241){_0x5c07ca=_0x382241;_0x175765['model']=_['keys'](db[_0x4400('0x50')]['rawAttributes']);_0x175765[_0x4400('0x33')]=_[_0x4400('0x34')](_0x76463c['query']);_0x175765[_0x4400('0x35')]=_[_0x4400('0x36')](_0x175765[_0x4400('0x32')],_0x175765['query']);_0x4efa2a[_0x4400('0x37')]=_[_0x4400('0x36')](_0x175765[_0x4400('0x32')],qs[_0x4400('0x38')](_0x76463c['query'][_0x4400('0x38')]));_0x4efa2a['attributes']=_0x4efa2a[_0x4400('0x37')][_0x4400('0x39')]?_0x4efa2a['attributes']:_0x175765['model'];_0x4efa2a['order']=qs[_0x4400('0x3d')](_0x76463c[_0x4400('0x33')]['sort']);_0x4efa2a['where']=qs[_0x4400('0x35')](_['pick'](_0x76463c[_0x4400('0x33')],_0x175765['filters']));if(_0x76463c[_0x4400('0x33')][_0x4400('0x42')]){_0x4efa2a[_0x4400('0x3e')]=_[_0x4400('0x40')](_0x4efa2a['where'],{'$or':_['map'](_0x4efa2a[_0x4400('0x37')],function(_0x6bc38c){var _0x3543b6={};_0x3543b6[_0x6bc38c]={'$like':'%'+_0x76463c[_0x4400('0x33')][_0x4400('0x42')]+'%'};return _0x3543b6;})});}_0x4efa2a=_['merge']({},_0x4efa2a,_0x76463c['options']);return _0x5c07ca[_0x4400('0x4e')](_0x4efa2a);}})[_0x4400('0x27')](function(_0x148980){if(_0x148980){_0x43818b=_0x148980[_0x4400('0x39')];if(!_0x76463c[_0x4400('0x33')][_0x4400('0x3a')](_0x4400('0x3b'))){_0x4efa2a[_0x4400('0x20')]=qs[_0x4400('0x20')](_0x76463c[_0x4400('0x33')][_0x4400('0x20')]);_0x4efa2a[_0x4400('0x1e')]=qs[_0x4400('0x1e')](_0x76463c[_0x4400('0x33')][_0x4400('0x1e')]);}return _0x5c07ca['getConfigurations'](_0x4efa2a);}})['then'](function(_0x3c4c55){if(_0x3c4c55){return _0x3c4c55?{'count':_0x43818b,'rows':_0x3c4c55}:null;}})[_0x4400('0x27')](respondWithResult(_0x564c4c,null))[_0x4400('0x47')](handleError(_0x564c4c,null));};exports[_0x4400('0x51')]=function(_0x2f959d,_0x29a2d5,_0x17736f){if(_0x2f959d['body']['id']){delete _0x2f959d[_0x4400('0x4d')]['id'];}return db[_0x4400('0x2d')][_0x4400('0x4f')]({'where':{'id':_0x2f959d[_0x4400('0x49')]['id']}})['then'](handleEntityNotFound(_0x29a2d5,null))['then'](function(_0x5e86f2){if(_0x5e86f2){_0x2f959d[_0x4400('0x4d')]['AccountId']=_0x5e86f2['id'];_0x2f959d[_0x4400('0x4d')][_0x4400('0x52')]=integrations[_0x4400('0x53')](_0x2f959d[_0x4400('0x4d')][_0x4400('0x54')],_0x2f959d['body'][_0x4400('0x30')]);_0x2f959d[_0x4400('0x4d')][_0x4400('0x55')]=integrations[_0x4400('0x56')](_0x2f959d[_0x4400('0x4d')]['channel'],_0x2f959d[_0x4400('0x4d')]['type']);return db[_0x4400('0x50')][_0x4400('0x4c')](_0x2f959d[_0x4400('0x4d')],{'include':[{'model':db[_0x4400('0x57')],'as':_0x4400('0x52')},{'model':db[_0x4400('0x57')],'as':_0x4400('0x55')}]});}return null;})[_0x4400('0x27')](respondWithResult(_0x29a2d5,null))[_0x4400('0x47')](handleError(_0x29a2d5,null));};var md5=require(_0x4400('0x58'));exports[_0x4400('0x59')]=function(_0x342110,_0x11727a,_0x1bb270){var _0x341546=null;var _0x48280c=null;var _0x1aad1f=null;var _0x276ce0=null;var _0x447e73='';return db[_0x4400('0x2d')][_0x4400('0x4f')]({'where':{'id':_0x342110[_0x4400('0x49')]['id']},'attributes':['id',_0x4400('0x29'),'username',_0x4400('0x5a'),'moduleName','remoteUri',_0x4400('0x5b'),_0x4400('0x5c')]})[_0x4400('0x27')](handleEntityNotFound(_0x11727a,null))[_0x4400('0x27')](function(_0x152a8a){if(_0x152a8a){_0x341546=_0x152a8a['username'];_0x48280c=_0x152a8a[_0x4400('0x5c')];_0x1aad1f=_0x152a8a[_0x4400('0x5d')];_0x447e73=_0x152a8a['remoteUri'];var _0x1b0e13=_0x447e73['slice'](-0x1);if(_0x1b0e13==='/'){_0x447e73=_0x447e73['substring'](0x0,_0x447e73[_0x4400('0x5e')](_0x1b0e13));}_0x276ce0=util[_0x4400('0x5f')](_0x4400('0x60'),_0x447e73);var _0x4f88d7={'method':_0x4400('0x61'),'uri':_0x276ce0,'qs':{'operation':'getchallenge','username':_0x152a8a[_0x4400('0x62')]},'json':!![]};return rp(_0x4f88d7);}})[_0x4400('0x27')](function(_0x1f0321){if(_0x1f0321[_0x4400('0x63')]){var _0x313aa3={'method':_0x4400('0x64'),'uri':_0x276ce0,'form':{'operation':'login','username':_0x341546,'accessKey':md5(_0x1f0321['result'][_0x4400('0x65')]+_0x48280c)},'json':!![]};return rp(_0x313aa3);}})['then'](function(_0x6b44a5){if(_0x6b44a5['success']){var _0x331f9f={'method':_0x4400('0x61'),'uri':_0x276ce0,'qs':{'operation':_0x4400('0x66'),'username':_0x341546,'sessionName':_0x6b44a5[_0x4400('0x67')][_0x4400('0x68')],'elementType':_0x1aad1f},'json':!![]};return rp(_0x331f9f);}})[_0x4400('0x27')](function(_0x21ada0){if(_0x21ada0['success']){var _0x1762b2=['autogenerated',_0x4400('0x69'),_0x4400('0x6a')];_[_0x4400('0x6b')](_0x21ada0['result']['fields'],function(_0x971312){return _0x1762b2[_0x4400('0x6c')](_0x971312[_0x4400('0x30')][_0x4400('0x29')]);});_[_0x4400('0x6b')](_0x21ada0[_0x4400('0x67')][_0x4400('0x38')],function(_0x170280){return _0x170280[_0x4400('0x6d')]===_0x4400('0x6e');});return{'count':_0x21ada0[_0x4400('0x67')][_0x4400('0x38')][_0x4400('0x39')],'rows':_[_0x4400('0x2c')](_0x21ada0['result']['fields'],function(_0x175050){return{'id':_0x175050[_0x4400('0x29')],'name':_0x175050[_0x4400('0x6f')],'custom':_['startsWith'](_0x175050[_0x4400('0x29')],'cf_')?!![]:![],'options':_0x175050[_0x4400('0x30')]['name']===_0x4400('0x70')&&_0x175050['type']['picklistValues'][_0x4400('0x39')]>0x0?_['map'](_0x175050[_0x4400('0x30')]['picklistValues'],function(_0xb04d6e){return{'name':_0xb04d6e['label'],'value':_0xb04d6e['value']};}):[]};})};}})['then'](respondWithResult(_0x11727a,null))[_0x4400('0x47')](function(_0x5ab149){console[_0x4400('0x71')](_0x4400('0x72')+_0x5ab149);var _0x27425b=_0x342110[_0x4400('0x33')][_0x4400('0x73')]?0x1f4:_0x5ab149[_0x4400('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4400('0x59'),_0x27425b,JSON[_0x4400('0x75')](_0x5ab149));delete _0x5ab149[_0x4400('0x29')];if(_0x27425b===0x191){_0x27425b=0x190;}_0x11727a[_0x4400('0x1b')](_0x27425b)[_0x4400('0x2a')](_0x342110[_0x4400('0x33')][_0x4400('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x5ab149[_0x4400('0x74')]}:_0x5ab149);});}; \ No newline at end of file +var _0xe3f6=['catch','show','params','includeAll','find','create','body','update','destroy','pick','hasOwnProperty','getConfigurations','findOne','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','GET','getchallenge','success','login','token','describe','result','sessionName','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','limit','set','apply','reject','save','then','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows'];(function(_0xeb9d93,_0x11a816){var _0xcdfcce=function(_0x3c71fa){while(--_0x3c71fa){_0xeb9d93['push'](_0xeb9d93['shift']());}};_0xcdfcce(++_0x11a816);}(_0xe3f6,0x1aa));var _0x6e3f=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xe3f6[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require(_0x6e3f('0x0'));var rimraf=require(_0x6e3f('0x1'));var zipdir=require(_0x6e3f('0x2'));var jsonpatch=require(_0x6e3f('0x3'));var rp=require(_0x6e3f('0x4'));var moment=require(_0x6e3f('0x5'));var BPromise=require(_0x6e3f('0x6'));var Mustache=require('mustache');var util=require(_0x6e3f('0x7'));var path=require(_0x6e3f('0x8'));var sox=require(_0x6e3f('0x9'));var csv=require(_0x6e3f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e3f('0xb'));var _=require(_0x6e3f('0xc'));var squel=require(_0x6e3f('0xd'));var crypto=require(_0x6e3f('0xe'));var jsforce=require(_0x6e3f('0xf'));var deskjs=require(_0x6e3f('0x10'));var toCsv=require(_0x6e3f('0xa'));var querystring=require(_0x6e3f('0x11'));var Papa=require(_0x6e3f('0x12'));var Redis=require(_0x6e3f('0x13'));var authService=require(_0x6e3f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6e3f('0x15'));var hardwareService=require(_0x6e3f('0x16'));var logger=require('../../config/logger')(_0x6e3f('0x17'));var utils=require(_0x6e3f('0x18'));var config=require(_0x6e3f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x6e3f('0x1a'));function respondWithStatusCode(_0x1144c4,_0x3f11bc){_0x3f11bc=_0x3f11bc||0xcc;return function(_0x5f5027){if(_0x5f5027){return _0x1144c4[_0x6e3f('0x1b')](_0x3f11bc);}return _0x1144c4[_0x6e3f('0x1c')](_0x3f11bc)[_0x6e3f('0x1d')]();};}function respondWithResult(_0x360091,_0x1be69f){_0x1be69f=_0x1be69f||0xc8;return function(_0xbb61de){if(_0xbb61de){return _0x360091['status'](_0x1be69f)[_0x6e3f('0x1e')](_0xbb61de);}};}function respondWithFilteredResult(_0x29ea3c,_0x494aba){return function(_0x164636){if(_0x164636){var _0x15f891=typeof _0x494aba['offset']===_0x6e3f('0x1f')&&typeof _0x494aba['limit']===_0x6e3f('0x1f');var _0x11537e=_0x164636[_0x6e3f('0x20')];var _0x51adf5=_0x15f891?0x0:_0x494aba['offset'];var _0x4b5946=_0x15f891?_0x164636[_0x6e3f('0x20')]:_0x494aba['offset']+_0x494aba[_0x6e3f('0x21')];var _0x1c29e0;if(_0x4b5946>=_0x11537e){_0x4b5946=_0x11537e;_0x1c29e0=0xc8;}else{_0x1c29e0=0xce;}_0x29ea3c[_0x6e3f('0x1c')](_0x1c29e0);return _0x29ea3c[_0x6e3f('0x22')]('Content-Range',_0x51adf5+'-'+_0x4b5946+'/'+_0x11537e)[_0x6e3f('0x1e')](_0x164636);}return null;};}function patchUpdates(_0x55f7d0){return function(_0x3a7c67){try{jsonpatch[_0x6e3f('0x23')](_0x3a7c67,_0x55f7d0,!![]);}catch(_0x5ae0fe){return BPromise[_0x6e3f('0x24')](_0x5ae0fe);}return _0x3a7c67[_0x6e3f('0x25')]();};}function saveUpdates(_0x52880c,_0x16bd2a){return function(_0x49e879){if(_0x49e879){return _0x49e879['update'](_0x52880c)[_0x6e3f('0x26')](function(_0x4d69c2){return _0x4d69c2;});}return null;};}function removeEntity(_0x38fc95,_0x549cee){return function(_0x79f657){if(_0x79f657){return _0x79f657['destroy']()['then'](function(){_0x38fc95[_0x6e3f('0x1c')](0xcc)[_0x6e3f('0x1d')]();});}};}function handleEntityNotFound(_0x113f89,_0x29272e){return function(_0x3077b9){if(!_0x3077b9){_0x113f89[_0x6e3f('0x1b')](0x194);}return _0x3077b9;};}function handleError(_0x5be96e,_0x517a23){_0x517a23=_0x517a23||0x1f4;return function(_0x1549c2){logger[_0x6e3f('0x27')](_0x1549c2[_0x6e3f('0x28')]);if(_0x1549c2[_0x6e3f('0x29')]){delete _0x1549c2['name'];}_0x5be96e['status'](_0x517a23)[_0x6e3f('0x2a')](_0x1549c2);};}exports[_0x6e3f('0x2b')]=function(_0x14036e,_0xbaeed5){var _0x34adf4={},_0x27cfbf={},_0x3165ad={'count':0x0,'rows':[]};var _0xac656b=_['map'](db[_0x6e3f('0x2c')][_0x6e3f('0x2d')],function(_0x3357bc){return{'name':_0x3357bc[_0x6e3f('0x2e')],'type':_0x3357bc[_0x6e3f('0x2f')][_0x6e3f('0x30')]};});_0x27cfbf[_0x6e3f('0x31')]=_[_0x6e3f('0x32')](_0xac656b,_0x6e3f('0x29'));_0x27cfbf[_0x6e3f('0x33')]=_[_0x6e3f('0x34')](_0x14036e[_0x6e3f('0x33')]);_0x27cfbf[_0x6e3f('0x35')]=_[_0x6e3f('0x36')](_0x27cfbf[_0x6e3f('0x31')],_0x27cfbf[_0x6e3f('0x33')]);_0x34adf4[_0x6e3f('0x37')]=_[_0x6e3f('0x36')](_0x27cfbf['model'],qs['fields'](_0x14036e[_0x6e3f('0x33')][_0x6e3f('0x38')]));_0x34adf4['attributes']=_0x34adf4[_0x6e3f('0x37')][_0x6e3f('0x39')]?_0x34adf4[_0x6e3f('0x37')]:_0x27cfbf[_0x6e3f('0x31')];if(!_0x14036e[_0x6e3f('0x33')]['hasOwnProperty'](_0x6e3f('0x3a'))){_0x34adf4[_0x6e3f('0x21')]=qs[_0x6e3f('0x21')](_0x14036e[_0x6e3f('0x33')][_0x6e3f('0x21')]);_0x34adf4[_0x6e3f('0x3b')]=qs[_0x6e3f('0x3b')](_0x14036e[_0x6e3f('0x33')][_0x6e3f('0x3b')]);}_0x34adf4[_0x6e3f('0x3c')]=qs[_0x6e3f('0x3d')](_0x14036e['query'][_0x6e3f('0x3d')]);_0x34adf4[_0x6e3f('0x3e')]=qs['filters'](_['pick'](_0x14036e['query'],_0x27cfbf[_0x6e3f('0x35')]),_0xac656b);if(_0x14036e[_0x6e3f('0x33')][_0x6e3f('0x3f')]){_0x34adf4[_0x6e3f('0x3e')]=_[_0x6e3f('0x40')](_0x34adf4[_0x6e3f('0x3e')],{'$or':_[_0x6e3f('0x32')](_0xac656b,function(_0x3797d6){if(_0x3797d6[_0x6e3f('0x2f')]!==_0x6e3f('0x41')){var _0x10984b={};_0x10984b[_0x3797d6['name']]={'$like':'%'+_0x14036e['query'][_0x6e3f('0x3f')]+'%'};return _0x10984b;}})});}_0x34adf4=_[_0x6e3f('0x40')]({},_0x34adf4,_0x14036e[_0x6e3f('0x42')]);var _0x591d03={'where':_0x34adf4['where']};return db[_0x6e3f('0x2c')][_0x6e3f('0x20')](_0x591d03)[_0x6e3f('0x26')](function(_0xafc794){_0x3165ad[_0x6e3f('0x20')]=_0xafc794;if(_0x14036e[_0x6e3f('0x33')]['includeAll']){_0x34adf4[_0x6e3f('0x43')]=[{'all':!![]}];}return db['VtigerAccount'][_0x6e3f('0x44')](_0x34adf4);})[_0x6e3f('0x26')](function(_0x502ecb){_0x3165ad[_0x6e3f('0x45')]=_0x502ecb;return _0x3165ad;})['then'](respondWithFilteredResult(_0xbaeed5,_0x34adf4))[_0x6e3f('0x46')](handleError(_0xbaeed5,null));};exports[_0x6e3f('0x47')]=function(_0x5af479,_0x616e75){var _0x438054={'raw':![],'where':{'id':_0x5af479[_0x6e3f('0x48')]['id']}},_0x17c851={};_0x17c851[_0x6e3f('0x31')]=_['keys'](db[_0x6e3f('0x2c')][_0x6e3f('0x2d')]);_0x17c851[_0x6e3f('0x33')]=_[_0x6e3f('0x34')](_0x5af479[_0x6e3f('0x33')]);_0x17c851[_0x6e3f('0x35')]=_[_0x6e3f('0x36')](_0x17c851[_0x6e3f('0x31')],_0x17c851[_0x6e3f('0x33')]);_0x438054[_0x6e3f('0x37')]=_[_0x6e3f('0x36')](_0x17c851[_0x6e3f('0x31')],qs[_0x6e3f('0x38')](_0x5af479[_0x6e3f('0x33')][_0x6e3f('0x38')]));_0x438054[_0x6e3f('0x37')]=_0x438054[_0x6e3f('0x37')][_0x6e3f('0x39')]?_0x438054[_0x6e3f('0x37')]:_0x17c851['model'];if(_0x5af479['query'][_0x6e3f('0x49')]){_0x438054[_0x6e3f('0x43')]=[{'all':!![]}];}_0x438054=_[_0x6e3f('0x40')]({},_0x438054,_0x5af479[_0x6e3f('0x42')]);return db[_0x6e3f('0x2c')][_0x6e3f('0x4a')](_0x438054)[_0x6e3f('0x26')](handleEntityNotFound(_0x616e75,null))[_0x6e3f('0x26')](respondWithResult(_0x616e75,null))['catch'](handleError(_0x616e75,null));};exports['create']=function(_0x217e04,_0x2e07b7){return db['VtigerAccount'][_0x6e3f('0x4b')](_0x217e04[_0x6e3f('0x4c')],{})[_0x6e3f('0x26')](respondWithResult(_0x2e07b7,0xc9))[_0x6e3f('0x46')](handleError(_0x2e07b7,null));};exports[_0x6e3f('0x4d')]=function(_0x3ae18b,_0x493030){if(_0x3ae18b[_0x6e3f('0x4c')]['id']){delete _0x3ae18b[_0x6e3f('0x4c')]['id'];}return db[_0x6e3f('0x2c')][_0x6e3f('0x4a')]({'where':{'id':_0x3ae18b[_0x6e3f('0x48')]['id']}})['then'](handleEntityNotFound(_0x493030,null))[_0x6e3f('0x26')](saveUpdates(_0x3ae18b[_0x6e3f('0x4c')],null))[_0x6e3f('0x26')](respondWithResult(_0x493030,null))[_0x6e3f('0x46')](handleError(_0x493030,null));};exports[_0x6e3f('0x4e')]=function(_0x5d0faa,_0x58b706){return db[_0x6e3f('0x2c')][_0x6e3f('0x4a')]({'where':{'id':_0x5d0faa[_0x6e3f('0x48')]['id']}})['then'](handleEntityNotFound(_0x58b706,null))[_0x6e3f('0x26')](removeEntity(_0x58b706,null))['catch'](handleError(_0x58b706,null));};exports['getConfigurations']=function(_0x234ead,_0x3326d7,_0x2b6d3d){var _0x1b4951={};var _0x48684b={};var _0x39dd12;var _0x58972a;return db['VtigerAccount']['findOne']({'where':{'id':_0x234ead[_0x6e3f('0x48')]['id']}})[_0x6e3f('0x26')](handleEntityNotFound(_0x3326d7,null))['then'](function(_0xb9c8dc){if(_0xb9c8dc){_0x39dd12=_0xb9c8dc;_0x48684b[_0x6e3f('0x31')]=_['keys'](db['VtigerConfiguration'][_0x6e3f('0x2d')]);_0x48684b['query']=_[_0x6e3f('0x34')](_0x234ead['query']);_0x48684b['filters']=_[_0x6e3f('0x36')](_0x48684b[_0x6e3f('0x31')],_0x48684b['query']);_0x1b4951[_0x6e3f('0x37')]=_[_0x6e3f('0x36')](_0x48684b[_0x6e3f('0x31')],qs[_0x6e3f('0x38')](_0x234ead[_0x6e3f('0x33')][_0x6e3f('0x38')]));_0x1b4951[_0x6e3f('0x37')]=_0x1b4951['attributes']['length']?_0x1b4951[_0x6e3f('0x37')]:_0x48684b[_0x6e3f('0x31')];_0x1b4951[_0x6e3f('0x3c')]=qs[_0x6e3f('0x3d')](_0x234ead[_0x6e3f('0x33')][_0x6e3f('0x3d')]);_0x1b4951['where']=qs[_0x6e3f('0x35')](_[_0x6e3f('0x4f')](_0x234ead['query'],_0x48684b[_0x6e3f('0x35')]));if(_0x234ead[_0x6e3f('0x33')][_0x6e3f('0x3f')]){_0x1b4951[_0x6e3f('0x3e')]=_[_0x6e3f('0x40')](_0x1b4951[_0x6e3f('0x3e')],{'$or':_['map'](_0x1b4951['attributes'],function(_0x2edb3a){var _0x1df873={};_0x1df873[_0x2edb3a]={'$like':'%'+_0x234ead['query'][_0x6e3f('0x3f')]+'%'};return _0x1df873;})});}_0x1b4951=_[_0x6e3f('0x40')]({},_0x1b4951,_0x234ead[_0x6e3f('0x42')]);return _0x39dd12['getConfigurations'](_0x1b4951);}})[_0x6e3f('0x26')](function(_0x1478bb){if(_0x1478bb){_0x58972a=_0x1478bb[_0x6e3f('0x39')];if(!_0x234ead[_0x6e3f('0x33')][_0x6e3f('0x50')]('nolimit')){_0x1b4951[_0x6e3f('0x21')]=qs[_0x6e3f('0x21')](_0x234ead[_0x6e3f('0x33')][_0x6e3f('0x21')]);_0x1b4951['offset']=qs[_0x6e3f('0x3b')](_0x234ead[_0x6e3f('0x33')]['offset']);}return _0x39dd12[_0x6e3f('0x51')](_0x1b4951);}})[_0x6e3f('0x26')](function(_0x392851){if(_0x392851){return _0x392851?{'count':_0x58972a,'rows':_0x392851}:null;}})[_0x6e3f('0x26')](respondWithResult(_0x3326d7,null))[_0x6e3f('0x46')](handleError(_0x3326d7,null));};exports['addConfiguration']=function(_0x1ed9a4,_0x56e50a,_0x1bb877){if(_0x1ed9a4[_0x6e3f('0x4c')]['id']){delete _0x1ed9a4[_0x6e3f('0x4c')]['id'];}return db['VtigerAccount'][_0x6e3f('0x52')]({'where':{'id':_0x1ed9a4[_0x6e3f('0x48')]['id']}})[_0x6e3f('0x26')](handleEntityNotFound(_0x56e50a,null))[_0x6e3f('0x26')](function(_0x46bb25){if(_0x46bb25){_0x1ed9a4[_0x6e3f('0x4c')]['AccountId']=_0x46bb25['id'];_0x1ed9a4[_0x6e3f('0x4c')][_0x6e3f('0x53')]=integrations['getSubjects'](_0x1ed9a4[_0x6e3f('0x4c')][_0x6e3f('0x54')],_0x1ed9a4['body']['type']);_0x1ed9a4[_0x6e3f('0x4c')][_0x6e3f('0x55')]=integrations[_0x6e3f('0x56')](_0x1ed9a4['body'][_0x6e3f('0x54')],_0x1ed9a4[_0x6e3f('0x4c')][_0x6e3f('0x2f')]);return db['VtigerConfiguration']['create'](_0x1ed9a4[_0x6e3f('0x4c')],{'include':[{'model':db[_0x6e3f('0x57')],'as':_0x6e3f('0x53')},{'model':db[_0x6e3f('0x57')],'as':_0x6e3f('0x55')}]});}return null;})['then'](respondWithResult(_0x56e50a,null))[_0x6e3f('0x46')](handleError(_0x56e50a,null));};var md5=require(_0x6e3f('0x58'));exports['getFields']=function(_0x2b6323,_0x40ba89,_0x4b6437){var _0x45d5ac=null;var _0x4e7da3=null;var _0x1cb904=null;var _0x473baa=null;var _0x4629bd='';return db['VtigerAccount']['findOne']({'where':{'id':_0x2b6323[_0x6e3f('0x48')]['id']},'attributes':['id',_0x6e3f('0x29'),_0x6e3f('0x59'),_0x6e3f('0x5a'),_0x6e3f('0x5b'),_0x6e3f('0x5c'),_0x6e3f('0x5d'),_0x6e3f('0x5e')]})[_0x6e3f('0x26')](handleEntityNotFound(_0x40ba89,null))['then'](function(_0x3e63c3){if(_0x3e63c3){_0x45d5ac=_0x3e63c3[_0x6e3f('0x59')];_0x4e7da3=_0x3e63c3[_0x6e3f('0x5e')];_0x1cb904=_0x3e63c3[_0x6e3f('0x5b')];_0x4629bd=_0x3e63c3[_0x6e3f('0x5c')];var _0x4a72d7=_0x4629bd[_0x6e3f('0x5f')](-0x1);if(_0x4a72d7==='/'){_0x4629bd=_0x4629bd[_0x6e3f('0x60')](0x0,_0x4629bd[_0x6e3f('0x61')](_0x4a72d7));}_0x473baa=util['format']('%s/webservice.php',_0x4629bd);var _0x3ecb84={'method':_0x6e3f('0x62'),'uri':_0x473baa,'qs':{'operation':_0x6e3f('0x63'),'username':_0x3e63c3[_0x6e3f('0x59')]},'json':!![]};return rp(_0x3ecb84);}})[_0x6e3f('0x26')](function(_0xadd256){if(_0xadd256[_0x6e3f('0x64')]){var _0x80f9bd={'method':'POST','uri':_0x473baa,'form':{'operation':_0x6e3f('0x65'),'username':_0x45d5ac,'accessKey':md5(_0xadd256['result'][_0x6e3f('0x66')]+_0x4e7da3)},'json':!![]};return rp(_0x80f9bd);}})['then'](function(_0x4a5225){if(_0x4a5225[_0x6e3f('0x64')]){var _0x1cbbce={'method':'GET','uri':_0x473baa,'qs':{'operation':_0x6e3f('0x67'),'username':_0x45d5ac,'sessionName':_0x4a5225[_0x6e3f('0x68')][_0x6e3f('0x69')],'elementType':_0x1cb904},'json':!![]};return rp(_0x1cbbce);}})[_0x6e3f('0x26')](function(_0x23ea61){if(_0x23ea61[_0x6e3f('0x64')]){var _0x482677=['autogenerated',_0x6e3f('0x6a'),_0x6e3f('0x6b')];_[_0x6e3f('0x6c')](_0x23ea61['result']['fields'],function(_0x2a8f9f){return _0x482677[_0x6e3f('0x6d')](_0x2a8f9f[_0x6e3f('0x2f')][_0x6e3f('0x29')]);});_[_0x6e3f('0x6c')](_0x23ea61[_0x6e3f('0x68')]['fields'],function(_0x36bae5){return _0x36bae5[_0x6e3f('0x6e')]===_0x6e3f('0x6f');});return{'count':_0x23ea61[_0x6e3f('0x68')][_0x6e3f('0x38')][_0x6e3f('0x39')],'rows':_[_0x6e3f('0x32')](_0x23ea61[_0x6e3f('0x68')][_0x6e3f('0x38')],function(_0x3133e5){return{'id':_0x3133e5['name'],'name':_0x3133e5[_0x6e3f('0x70')],'custom':_[_0x6e3f('0x71')](_0x3133e5['name'],_0x6e3f('0x72'))?!![]:![],'options':_0x3133e5[_0x6e3f('0x2f')][_0x6e3f('0x29')]===_0x6e3f('0x73')&&_0x3133e5[_0x6e3f('0x2f')]['picklistValues']['length']>0x0?_[_0x6e3f('0x32')](_0x3133e5[_0x6e3f('0x2f')][_0x6e3f('0x74')],function(_0x46b9ce){return{'name':_0x46b9ce[_0x6e3f('0x70')],'value':_0x46b9ce[_0x6e3f('0x75')]};}):[]};})};}})[_0x6e3f('0x26')](respondWithResult(_0x40ba89,null))['catch'](function(_0x2785e9){console[_0x6e3f('0x76')](_0x6e3f('0x77')+_0x2785e9);var _0x4e4a10=_0x2b6323[_0x6e3f('0x33')][_0x6e3f('0x78')]?0x1f4:_0x2785e9[_0x6e3f('0x79')]||0x1f4;logger[_0x6e3f('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x6e3f('0x7a'),_0x4e4a10,JSON[_0x6e3f('0x7b')](_0x2785e9));delete _0x2785e9[_0x6e3f('0x29')];if(_0x4e4a10===0x191){_0x4e4a10=0x190;}_0x40ba89['status'](_0x4e4a10)[_0x6e3f('0x2a')](_0x2b6323['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x2785e9['statusCode']}:_0x2785e9);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0145ac5..8300996 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 _0xc80d=['define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc80d,0x121));var _0xdc80=function(_0x5b5590,_0x318208){_0x5b5590=_0x5b5590-0x0;var _0x54ad13=_0xc80d[_0x5b5590];return _0x54ad13;};'use strict';var _=require('lodash');var util=require(_0xdc80('0x0'));var logger=require(_0xdc80('0x1'))(_0xdc80('0x2'));var moment=require(_0xdc80('0x3'));var BPromise=require(_0xdc80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc80('0x5'));var rimraf=require(_0xdc80('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc80('0x7'));var integrations=require(_0xdc80('0x8'));module[_0xdc80('0x9')]=function(_0x13d0cd,_0x111d6f){return _0x13d0cd[_0xdc80('0xa')](_0xdc80('0xb'),attributes,{'tableName':_0xdc80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8875=['../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1d1c15,_0x52c88b){var _0x34d98d=function(_0x5a540b){while(--_0x5a540b){_0x1d1c15['push'](_0x1d1c15['shift']());}};_0x34d98d(++_0x52c88b);}(_0x8875,0xf3));var _0x5887=function(_0x514991,_0x319f52){_0x514991=_0x514991-0x0;var _0x158640=_0x8875[_0x514991];return _0x158640;};'use strict';var _=require(_0x5887('0x0'));var util=require(_0x5887('0x1'));var logger=require(_0x5887('0x2'))(_0x5887('0x3'));var moment=require(_0x5887('0x4'));var BPromise=require(_0x5887('0x5'));var rp=require(_0x5887('0x6'));var fs=require('fs');var path=require(_0x5887('0x7'));var rimraf=require(_0x5887('0x8'));var config=require(_0x5887('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x5887('0xa'));module[_0x5887('0xb')]=function(_0x3e4bd5,_0x2935f0){return _0x3e4bd5[_0x5887('0xc')](_0x5887('0xd'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 2cab26f..37009d3 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 _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','findAll'];(function(_0x49f28e,_0x5daa56){var _0x1b24e0=function(_0x18d85a){while(--_0x18d85a){_0x49f28e['push'](_0x49f28e['shift']());}};_0x1b24e0(++_0x5daa56);}(_0xe706,0xa3));var _0x6e70=function(_0x197115,_0x14d69a){_0x197115=_0x197115-0x0;var _0x19d830=_0xe706[_0x197115];return _0x19d830;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['VtigerAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetVtigerAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file +var _0x3f8c=['jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','debug','catch','find','raw','ShowVtigerAccount','moment','bluebird','randomstring','ioredis'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0x3f8c,0x104));var _0xc3f8=function(_0x1eff34,_0x415087){_0x1eff34=_0x1eff34-0x0;var _0x5015b9=_0x3f8c[_0x1eff34];return _0x5015b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});}exports[_0xc3f8('0x12')]=function(_0x2e7c0f){var _0x35500f=this;return new Promise(function(_0xb4ab67,_0x47a185){return db[_0xc3f8('0x13')][_0xc3f8('0x14')]({'raw':_0x2e7c0f['options']?_0x2e7c0f[_0xc3f8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x16')]||null:null,'attributes':_0x2e7c0f['options']?_0x2e7c0f['options'][_0xc3f8('0x17')]||null:null,'limit':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x18')]||null:null,'include':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2e7c0f['options']['include'],function(_0x4b83f0){return{'model':db[_0x4b83f0[_0xc3f8('0x1b')]],'as':_0x4b83f0['as'],'attributes':_0x4b83f0['attributes'],'include':_0x4b83f0[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4b83f0['include'],function(_0x4569c2){return{'model':db[_0x4569c2[_0xc3f8('0x1b')]],'as':_0x4569c2['as'],'attributes':_0x4569c2[_0xc3f8('0x17')],'include':_0x4569c2[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4569c2[_0xc3f8('0x19')],function(_0xf1d460){return{'model':db[_0xf1d460[_0xc3f8('0x1b')]],'as':_0xf1d460['as'],'attributes':_0xf1d460[_0xc3f8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x22c8e6){logger[_0xc3f8('0x9')](_0xc3f8('0x12'),_0x2e7c0f);logger[_0xc3f8('0x1c')]('GetVtigerAccount',_0x2e7c0f,JSON[_0xc3f8('0xd')](_0x22c8e6));_0xb4ab67(_0x22c8e6);})[_0xc3f8('0x1d')](function(_0x218029){logger['error'](_0xc3f8('0x12'),_0x218029['message'],_0x2e7c0f);_0x47a185(_0x35500f[_0xc3f8('0xe')](0x1f4,_0x218029[_0xc3f8('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x48b32e){var _0x21a225=this;return new Promise(function(_0x25df65,_0xd32b09){return db[_0xc3f8('0x13')][_0xc3f8('0x1e')]({'raw':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x1f')]===undefined?!![]:![]:!![],'where':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['where']||null:null,'attributes':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x17')]||null:null,'include':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['include']?_['map'](_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x19')],function(_0x76ef00){return{'model':db[_0x76ef00[_0xc3f8('0x1b')]],'as':_0x76ef00['as'],'attributes':_0x76ef00[_0xc3f8('0x17')],'include':_0x76ef00['include']?_[_0xc3f8('0x1a')](_0x76ef00[_0xc3f8('0x19')],function(_0x2ba6aa){return{'model':db[_0x2ba6aa['model']],'as':_0x2ba6aa['as'],'attributes':_0x2ba6aa[_0xc3f8('0x17')],'include':_0x2ba6aa[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2ba6aa['include'],function(_0x21a725){return{'model':db[_0x21a725[_0xc3f8('0x1b')]],'as':_0x21a725['as'],'attributes':_0x21a725['attributes']};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x84d5d2){logger[_0xc3f8('0x9')](_0xc3f8('0x20'),_0x48b32e);logger[_0xc3f8('0x1c')](_0xc3f8('0x20'),_0x48b32e,JSON['stringify'](_0x84d5d2));_0x25df65(_0x84d5d2);})[_0xc3f8('0x1d')](function(_0x2e4880){logger[_0xc3f8('0xe')](_0xc3f8('0x20'),_0x2e4880[_0xc3f8('0x10')],_0x48b32e);_0xd32b09(_0x21a225['error'](0x1f4,_0x2e4880[_0xc3f8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 7125d93..a4ad4ff 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 _0xd79d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','get','show','getFields','getDescriptions','post','create','put','/:id','update','delete','destroy'];(function(_0x5d0084,_0x1a989e){var _0x5e6ef1=function(_0x154613){while(--_0x154613){_0x5d0084['push'](_0x5d0084['shift']());}};_0x5e6ef1(++_0x1a989e);}(_0xd79d,0x1cf));var _0xdd79=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0xd79d[_0x466af7];return _0x348c96;};'use strict';var multer=require(_0xdd79('0x0'));var util=require(_0xdd79('0x1'));var path=require(_0xdd79('0x2'));var timeout=require(_0xdd79('0x3'));var express=require(_0xdd79('0x4'));var router=express[_0xdd79('0x5')]();var fs_extra=require(_0xdd79('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdd79('0x7'));var controller=require(_0xdd79('0x8'));router['get']('/',auth[_0xdd79('0x9')](),controller['index']);router[_0xdd79('0xa')]('/:id',auth[_0xdd79('0x9')](),controller[_0xdd79('0xb')]);router['get']('/:id/fields',auth[_0xdd79('0x9')](),controller[_0xdd79('0xc')]);router['get']('/:id/subjects',auth[_0xdd79('0x9')](),controller['getSubjects']);router[_0xdd79('0xa')]('/:id/descriptions',auth[_0xdd79('0x9')](),controller[_0xdd79('0xd')]);router[_0xdd79('0xe')]('/',auth['isAuthenticated'](),controller[_0xdd79('0xf')]);router[_0xdd79('0x10')](_0xdd79('0x11'),auth[_0xdd79('0x9')](),controller[_0xdd79('0x12')]);router[_0xdd79('0x13')](_0xdd79('0x11'),auth[_0xdd79('0x9')](),controller[_0xdd79('0x14')]);module[_0xdd79('0x15')]=router; \ No newline at end of file +var _0xf63b=['get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1fecfa,_0x5720dc){var _0x58532d=function(_0x41e801){while(--_0x41e801){_0x1fecfa['push'](_0x1fecfa['shift']());}};_0x58532d(++_0x5720dc);}(_0xf63b,0xde));var _0xbf63=function(_0x3fe57c,_0x513473){_0x3fe57c=_0x3fe57c-0x0;var _0x26f96e=_0xf63b[_0x3fe57c];return _0x26f96e;};'use strict';var multer=require(_0xbf63('0x0'));var util=require(_0xbf63('0x1'));var path=require(_0xbf63('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf63('0x3'));var router=express[_0xbf63('0x4')]();var fs_extra=require(_0xbf63('0x5'));var auth=require(_0xbf63('0x6'));var interaction=require(_0xbf63('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xbf63('0x8')]('/',auth[_0xbf63('0x9')](),controller[_0xbf63('0xa')]);router['get'](_0xbf63('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xbf63('0xc'),auth['isAuthenticated'](),controller[_0xbf63('0xd')]);router[_0xbf63('0x8')](_0xbf63('0xe'),auth[_0xbf63('0x9')](),controller[_0xbf63('0xf')]);router[_0xbf63('0x8')](_0xbf63('0x10'),auth[_0xbf63('0x9')](),controller[_0xbf63('0x11')]);router[_0xbf63('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf63('0x13')]('/:id',auth[_0xbf63('0x9')](),controller[_0xbf63('0x14')]);router[_0xbf63('0x15')](_0xbf63('0xb'),auth[_0xbf63('0x9')](),controller['destroy']);module[_0xbf63('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 63daff1..d4ff932 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 _0x5001=['sequelize','STRING'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x5001,0xb0));var _0x1500=function(_0x31cc4a,_0x49fcf6){_0x31cc4a=_0x31cc4a-0x0;var _0x11d222=_0x5001[_0x31cc4a];return _0x11d222;};'use strict';var Sequelize=require(_0x1500('0x0'));module['exports']={'name':{'type':Sequelize[_0x1500('0x1')]},'description':{'type':Sequelize[_0x1500('0x1')]}}; \ No newline at end of file +var _0xd553=['STRING','sequelize'];(function(_0x107ba7,_0x5c808e){var _0x2fefef=function(_0x39c16){while(--_0x39c16){_0x107ba7['push'](_0x107ba7['shift']());}};_0x2fefef(++_0x5c808e);}(_0xd553,0x1e5));var _0x3d55=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0xd553[_0x35c5a8];return _0x34782c;};'use strict';var Sequelize=require(_0x3d55('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d55('0x1')]},'description':{'type':Sequelize[_0x3d55('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7139c11..3535022 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 _0xaaf6=['request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','error','stack','name','index','VtigerConfiguration','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','then','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','findOne','VtigerField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x13a42c,_0x4b724e){var _0x4e3ac4=function(_0x5b37b9){while(--_0x5b37b9){_0x13a42c['push'](_0x13a42c['shift']());}};_0x4e3ac4(++_0x4b724e);}(_0xaaf6,0x182));var _0x6aaf=function(_0x17828f,_0x4b5211){_0x17828f=_0x17828f-0x0;var _0x65680a=_0xaaf6[_0x17828f];return _0x65680a;};'use strict';var emlformat=require(_0x6aaf('0x0'));var rimraf=require(_0x6aaf('0x1'));var zipdir=require(_0x6aaf('0x2'));var jsonpatch=require(_0x6aaf('0x3'));var rp=require(_0x6aaf('0x4'));var moment=require('moment');var BPromise=require(_0x6aaf('0x5'));var Mustache=require(_0x6aaf('0x6'));var util=require(_0x6aaf('0x7'));var path=require(_0x6aaf('0x8'));var sox=require(_0x6aaf('0x9'));var csv=require('to-csv');var ejs=require(_0x6aaf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6aaf('0xb'));var crypto=require(_0x6aaf('0xc'));var jsforce=require(_0x6aaf('0xd'));var deskjs=require(_0x6aaf('0xe'));var toCsv=require(_0x6aaf('0xf'));var querystring=require(_0x6aaf('0x10'));var Papa=require(_0x6aaf('0x11'));var Redis=require(_0x6aaf('0x12'));var authService=require(_0x6aaf('0x13'));var qs=require(_0x6aaf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aaf('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6aaf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6aaf('0x17'))['db'];function respondWithStatusCode(_0x22051a,_0x5eca7b){_0x5eca7b=_0x5eca7b||0xcc;return function(_0x4d00bb){if(_0x4d00bb){return _0x22051a['sendStatus'](_0x5eca7b);}return _0x22051a[_0x6aaf('0x18')](_0x5eca7b)[_0x6aaf('0x19')]();};}function respondWithResult(_0x1a4e58,_0xcf920f){_0xcf920f=_0xcf920f||0xc8;return function(_0x42bca8){if(_0x42bca8){return _0x1a4e58[_0x6aaf('0x18')](_0xcf920f)[_0x6aaf('0x1a')](_0x42bca8);}};}function respondWithFilteredResult(_0x1783f5,_0x2d08a5){return function(_0x427a39){if(_0x427a39){var _0x4d92a7=typeof _0x2d08a5[_0x6aaf('0x1b')]===_0x6aaf('0x1c')&&typeof _0x2d08a5[_0x6aaf('0x1d')]===_0x6aaf('0x1c');var _0x26e608=_0x427a39[_0x6aaf('0x1e')];var _0x5a1618=_0x4d92a7?0x0:_0x2d08a5[_0x6aaf('0x1b')];var _0x12f8d0=_0x4d92a7?_0x427a39[_0x6aaf('0x1e')]:_0x2d08a5[_0x6aaf('0x1b')]+_0x2d08a5[_0x6aaf('0x1d')];var _0xe5e90d;if(_0x12f8d0>=_0x26e608){_0x12f8d0=_0x26e608;_0xe5e90d=0xc8;}else{_0xe5e90d=0xce;}_0x1783f5[_0x6aaf('0x18')](_0xe5e90d);return _0x1783f5['set'](_0x6aaf('0x1f'),_0x5a1618+'-'+_0x12f8d0+'/'+_0x26e608)[_0x6aaf('0x1a')](_0x427a39);}return null;};}function patchUpdates(_0x550d47){return function(_0x5bd31b){try{jsonpatch[_0x6aaf('0x20')](_0x5bd31b,_0x550d47,!![]);}catch(_0x7f37db){return BPromise[_0x6aaf('0x21')](_0x7f37db);}return _0x5bd31b['save']();};}function saveUpdates(_0x503698,_0xd4290d){return function(_0x57d24a){if(_0x57d24a){return _0x57d24a['update'](_0x503698)['then'](function(_0x1e060b){return _0x1e060b;});}return null;};}function removeEntity(_0x147dbd,_0x529d60){return function(_0x5ca30f){if(_0x5ca30f){return _0x5ca30f[_0x6aaf('0x22')]()['then'](function(){_0x147dbd[_0x6aaf('0x18')](0xcc)[_0x6aaf('0x19')]();});}};}function handleEntityNotFound(_0x4485f0,_0x5cc070){return function(_0x1bef64){if(!_0x1bef64){_0x4485f0['sendStatus'](0x194);}return _0x1bef64;};}function handleError(_0x2e3f5f,_0x5c39a1){_0x5c39a1=_0x5c39a1||0x1f4;return function(_0x4ba28e){logger[_0x6aaf('0x23')](_0x4ba28e[_0x6aaf('0x24')]);if(_0x4ba28e[_0x6aaf('0x25')]){delete _0x4ba28e['name'];}_0x2e3f5f[_0x6aaf('0x18')](_0x5c39a1)['send'](_0x4ba28e);};}exports[_0x6aaf('0x26')]=function(_0x49747f,_0x5e7d87){var _0x293fdb={},_0x20342b={},_0x496487={'count':0x0,'rows':[]};var _0x382a0b=_['map'](db[_0x6aaf('0x27')][_0x6aaf('0x28')],function(_0x335f3a){return{'name':_0x335f3a[_0x6aaf('0x29')],'type':_0x335f3a[_0x6aaf('0x2a')]['key']};});_0x20342b[_0x6aaf('0x2b')]=_[_0x6aaf('0x2c')](_0x382a0b,_0x6aaf('0x25'));_0x20342b[_0x6aaf('0x2d')]=_[_0x6aaf('0x2e')](_0x49747f[_0x6aaf('0x2d')]);_0x20342b['filters']=_[_0x6aaf('0x2f')](_0x20342b[_0x6aaf('0x2b')],_0x20342b[_0x6aaf('0x2d')]);_0x293fdb[_0x6aaf('0x30')]=_[_0x6aaf('0x2f')](_0x20342b[_0x6aaf('0x2b')],qs[_0x6aaf('0x31')](_0x49747f[_0x6aaf('0x2d')]['fields']));_0x293fdb['attributes']=_0x293fdb['attributes'][_0x6aaf('0x32')]?_0x293fdb['attributes']:_0x20342b[_0x6aaf('0x2b')];if(!_0x49747f[_0x6aaf('0x2d')][_0x6aaf('0x33')](_0x6aaf('0x34'))){_0x293fdb[_0x6aaf('0x1d')]=qs[_0x6aaf('0x1d')](_0x49747f['query'][_0x6aaf('0x1d')]);_0x293fdb[_0x6aaf('0x1b')]=qs['offset'](_0x49747f[_0x6aaf('0x2d')]['offset']);}_0x293fdb[_0x6aaf('0x35')]=qs[_0x6aaf('0x36')](_0x49747f[_0x6aaf('0x2d')][_0x6aaf('0x36')]);_0x293fdb['where']=qs[_0x6aaf('0x37')](_['pick'](_0x49747f['query'],_0x20342b['filters']),_0x382a0b);if(_0x49747f[_0x6aaf('0x2d')][_0x6aaf('0x38')]){_0x293fdb[_0x6aaf('0x39')]=_[_0x6aaf('0x3a')](_0x293fdb['where'],{'$or':_[_0x6aaf('0x2c')](_0x382a0b,function(_0x380737){if(_0x380737[_0x6aaf('0x2a')]!=='VIRTUAL'){var _0xa6665={};_0xa6665[_0x380737[_0x6aaf('0x25')]]={'$like':'%'+_0x49747f['query'][_0x6aaf('0x38')]+'%'};return _0xa6665;}})});}_0x293fdb=_[_0x6aaf('0x3a')]({},_0x293fdb,_0x49747f['options']);var _0xbc8417={'where':_0x293fdb['where']};return db[_0x6aaf('0x27')][_0x6aaf('0x1e')](_0xbc8417)[_0x6aaf('0x3b')](function(_0x27110f){_0x496487[_0x6aaf('0x1e')]=_0x27110f;if(_0x49747f[_0x6aaf('0x2d')][_0x6aaf('0x3c')]){_0x293fdb[_0x6aaf('0x3d')]=[{'all':!![]}];}return db[_0x6aaf('0x27')][_0x6aaf('0x3e')](_0x293fdb);})[_0x6aaf('0x3b')](function(_0x3ef7e8){_0x496487[_0x6aaf('0x3f')]=_0x3ef7e8;return _0x496487;})['then'](respondWithFilteredResult(_0x5e7d87,_0x293fdb))[_0x6aaf('0x40')](handleError(_0x5e7d87,null));};exports[_0x6aaf('0x41')]=function(_0x3525b7,_0x14ff27){var _0x415863={'raw':![],'where':{'id':_0x3525b7['params']['id']}},_0x4a1238={};_0x4a1238[_0x6aaf('0x2b')]=_[_0x6aaf('0x2e')](db[_0x6aaf('0x27')][_0x6aaf('0x28')]);_0x4a1238[_0x6aaf('0x2d')]=_[_0x6aaf('0x2e')](_0x3525b7['query']);_0x4a1238['filters']=_[_0x6aaf('0x2f')](_0x4a1238['model'],_0x4a1238['query']);_0x415863['attributes']=_[_0x6aaf('0x2f')](_0x4a1238[_0x6aaf('0x2b')],qs[_0x6aaf('0x31')](_0x3525b7[_0x6aaf('0x2d')][_0x6aaf('0x31')]));_0x415863[_0x6aaf('0x30')]=_0x415863['attributes'][_0x6aaf('0x32')]?_0x415863[_0x6aaf('0x30')]:_0x4a1238['model'];if(_0x3525b7[_0x6aaf('0x2d')][_0x6aaf('0x3c')]){_0x415863[_0x6aaf('0x3d')]=[{'all':!![]}];}_0x415863=_[_0x6aaf('0x3a')]({},_0x415863,_0x3525b7[_0x6aaf('0x42')]);return db[_0x6aaf('0x27')][_0x6aaf('0x43')](_0x415863)[_0x6aaf('0x3b')](handleEntityNotFound(_0x14ff27,null))[_0x6aaf('0x3b')](respondWithResult(_0x14ff27,null))['catch'](handleError(_0x14ff27,null));};exports[_0x6aaf('0x44')]=function(_0x38a4a6,_0x4d27d6){return db['VtigerConfiguration'][_0x6aaf('0x44')](_0x38a4a6[_0x6aaf('0x45')],{})[_0x6aaf('0x3b')](respondWithResult(_0x4d27d6,0xc9))['catch'](handleError(_0x4d27d6,null));};exports[_0x6aaf('0x46')]=function(_0x5e3929,_0x1aeb53){if(_0x5e3929[_0x6aaf('0x45')]['id']){delete _0x5e3929[_0x6aaf('0x45')]['id'];}return db[_0x6aaf('0x27')][_0x6aaf('0x43')]({'where':{'id':_0x5e3929['params']['id']}})['then'](handleEntityNotFound(_0x1aeb53,null))['then'](saveUpdates(_0x5e3929[_0x6aaf('0x45')],null))['then'](respondWithResult(_0x1aeb53,null))[_0x6aaf('0x40')](handleError(_0x1aeb53,null));};exports['destroy']=function(_0x5ea58e,_0x4e446d){return db[_0x6aaf('0x27')][_0x6aaf('0x43')]({'where':{'id':_0x5ea58e[_0x6aaf('0x47')]['id']}})[_0x6aaf('0x3b')](handleEntityNotFound(_0x4e446d,null))[_0x6aaf('0x3b')](removeEntity(_0x4e446d,null))['catch'](handleError(_0x4e446d,null));};exports['getFields']=function(_0x599001,_0x109c06,_0x37ca2a){var _0x4317e0={};var _0x5f292f={};var _0x2e6712;var _0x93d351;return db[_0x6aaf('0x27')][_0x6aaf('0x48')]({'where':{'id':_0x599001[_0x6aaf('0x47')]['id']}})[_0x6aaf('0x3b')](handleEntityNotFound(_0x109c06,null))[_0x6aaf('0x3b')](function(_0x2a5a02){if(_0x2a5a02){_0x2e6712=_0x2a5a02;_0x5f292f[_0x6aaf('0x2b')]=_[_0x6aaf('0x2e')](db[_0x6aaf('0x49')][_0x6aaf('0x28')]);_0x5f292f[_0x6aaf('0x2d')]=_[_0x6aaf('0x2e')](_0x599001[_0x6aaf('0x2d')]);_0x5f292f[_0x6aaf('0x37')]=_[_0x6aaf('0x2f')](_0x5f292f[_0x6aaf('0x2b')],_0x5f292f['query']);_0x4317e0[_0x6aaf('0x30')]=_[_0x6aaf('0x2f')](_0x5f292f[_0x6aaf('0x2b')],qs['fields'](_0x599001[_0x6aaf('0x2d')]['fields']));_0x4317e0[_0x6aaf('0x30')]=_0x4317e0[_0x6aaf('0x30')][_0x6aaf('0x32')]?_0x4317e0['attributes']:_0x5f292f[_0x6aaf('0x2b')];_0x4317e0['order']=qs[_0x6aaf('0x36')](_0x599001['query'][_0x6aaf('0x36')]);_0x4317e0[_0x6aaf('0x39')]=qs[_0x6aaf('0x37')](_[_0x6aaf('0x4a')](_0x599001[_0x6aaf('0x2d')],_0x5f292f[_0x6aaf('0x37')]));if(_0x599001[_0x6aaf('0x2d')][_0x6aaf('0x38')]){_0x4317e0['where']=_['merge'](_0x4317e0[_0x6aaf('0x39')],{'$or':_['map'](_0x4317e0[_0x6aaf('0x30')],function(_0x1c96b7){var _0x107f58={};_0x107f58[_0x1c96b7]={'$like':'%'+_0x599001[_0x6aaf('0x2d')][_0x6aaf('0x38')]+'%'};return _0x107f58;})});}_0x4317e0=_[_0x6aaf('0x3a')]({},_0x4317e0,_0x599001['options']);return _0x2e6712[_0x6aaf('0x4b')](_0x4317e0);}})[_0x6aaf('0x3b')](function(_0x5d1434){if(_0x5d1434){_0x93d351=_0x5d1434['length'];if(!_0x599001['query']['hasOwnProperty']('nolimit')){_0x4317e0[_0x6aaf('0x1d')]=qs['limit'](_0x599001[_0x6aaf('0x2d')][_0x6aaf('0x1d')]);_0x4317e0['offset']=qs[_0x6aaf('0x1b')](_0x599001[_0x6aaf('0x2d')][_0x6aaf('0x1b')]);}return _0x2e6712[_0x6aaf('0x4b')](_0x4317e0);}})[_0x6aaf('0x3b')](function(_0x1914fe){if(_0x1914fe){return _0x1914fe?{'count':_0x93d351,'rows':_0x1914fe}:null;}})[_0x6aaf('0x3b')](respondWithResult(_0x109c06,null))[_0x6aaf('0x40')](handleError(_0x109c06,null));};exports[_0x6aaf('0x4c')]=function(_0x31c8b8,_0x47ab06,_0x258d12){var _0x1d7ee6={};var _0x3541f6={};var _0x222f43;var _0x3fcbf1;return db[_0x6aaf('0x27')][_0x6aaf('0x48')]({'where':{'id':_0x31c8b8[_0x6aaf('0x47')]['id']}})[_0x6aaf('0x3b')](handleEntityNotFound(_0x47ab06,null))[_0x6aaf('0x3b')](function(_0x103750){if(_0x103750){_0x222f43=_0x103750;_0x3541f6['model']=_['keys'](db[_0x6aaf('0x49')][_0x6aaf('0x28')]);_0x3541f6[_0x6aaf('0x2d')]=_['keys'](_0x31c8b8[_0x6aaf('0x2d')]);_0x3541f6[_0x6aaf('0x37')]=_['intersection'](_0x3541f6[_0x6aaf('0x2b')],_0x3541f6[_0x6aaf('0x2d')]);_0x1d7ee6[_0x6aaf('0x30')]=_[_0x6aaf('0x2f')](_0x3541f6['model'],qs[_0x6aaf('0x31')](_0x31c8b8[_0x6aaf('0x2d')][_0x6aaf('0x31')]));_0x1d7ee6[_0x6aaf('0x30')]=_0x1d7ee6[_0x6aaf('0x30')]['length']?_0x1d7ee6[_0x6aaf('0x30')]:_0x3541f6[_0x6aaf('0x2b')];_0x1d7ee6[_0x6aaf('0x35')]=qs[_0x6aaf('0x36')](_0x31c8b8['query'][_0x6aaf('0x36')]);_0x1d7ee6[_0x6aaf('0x39')]=qs[_0x6aaf('0x37')](_[_0x6aaf('0x4a')](_0x31c8b8[_0x6aaf('0x2d')],_0x3541f6['filters']));if(_0x31c8b8[_0x6aaf('0x2d')][_0x6aaf('0x38')]){_0x1d7ee6[_0x6aaf('0x39')]=_[_0x6aaf('0x3a')](_0x1d7ee6['where'],{'$or':_['map'](_0x1d7ee6['attributes'],function(_0x5b2faf){var _0x536d67={};_0x536d67[_0x5b2faf]={'$like':'%'+_0x31c8b8[_0x6aaf('0x2d')][_0x6aaf('0x38')]+'%'};return _0x536d67;})});}_0x1d7ee6=_[_0x6aaf('0x3a')]({},_0x1d7ee6,_0x31c8b8[_0x6aaf('0x42')]);return _0x222f43[_0x6aaf('0x4c')](_0x1d7ee6);}})['then'](function(_0x1e8bcc){if(_0x1e8bcc){_0x3fcbf1=_0x1e8bcc['length'];if(!_0x31c8b8['query']['hasOwnProperty'](_0x6aaf('0x34'))){_0x1d7ee6['limit']=qs['limit'](_0x31c8b8[_0x6aaf('0x2d')][_0x6aaf('0x1d')]);_0x1d7ee6[_0x6aaf('0x1b')]=qs[_0x6aaf('0x1b')](_0x31c8b8[_0x6aaf('0x2d')]['offset']);}return _0x222f43[_0x6aaf('0x4c')](_0x1d7ee6);}})['then'](function(_0x22a2f2){if(_0x22a2f2){return _0x22a2f2?{'count':_0x3fcbf1,'rows':_0x22a2f2}:null;}})['then'](respondWithResult(_0x47ab06,null))[_0x6aaf('0x40')](handleError(_0x47ab06,null));};exports[_0x6aaf('0x4d')]=function(_0x42aa09,_0x41d7c4,_0xc71458){var _0x11d794={};var _0x4d3572={};var _0x5248d3;var _0x8e6d68;return db[_0x6aaf('0x27')][_0x6aaf('0x48')]({'where':{'id':_0x42aa09[_0x6aaf('0x47')]['id']}})[_0x6aaf('0x3b')](handleEntityNotFound(_0x41d7c4,null))[_0x6aaf('0x3b')](function(_0x4f7321){if(_0x4f7321){_0x5248d3=_0x4f7321;_0x4d3572['model']=_['keys'](db[_0x6aaf('0x49')][_0x6aaf('0x28')]);_0x4d3572[_0x6aaf('0x2d')]=_[_0x6aaf('0x2e')](_0x42aa09['query']);_0x4d3572[_0x6aaf('0x37')]=_['intersection'](_0x4d3572[_0x6aaf('0x2b')],_0x4d3572[_0x6aaf('0x2d')]);_0x11d794[_0x6aaf('0x30')]=_['intersection'](_0x4d3572['model'],qs['fields'](_0x42aa09[_0x6aaf('0x2d')][_0x6aaf('0x31')]));_0x11d794[_0x6aaf('0x30')]=_0x11d794[_0x6aaf('0x30')][_0x6aaf('0x32')]?_0x11d794[_0x6aaf('0x30')]:_0x4d3572[_0x6aaf('0x2b')];_0x11d794[_0x6aaf('0x35')]=qs[_0x6aaf('0x36')](_0x42aa09[_0x6aaf('0x2d')][_0x6aaf('0x36')]);_0x11d794[_0x6aaf('0x39')]=qs[_0x6aaf('0x37')](_['pick'](_0x42aa09[_0x6aaf('0x2d')],_0x4d3572[_0x6aaf('0x37')]));if(_0x42aa09[_0x6aaf('0x2d')][_0x6aaf('0x38')]){_0x11d794[_0x6aaf('0x39')]=_['merge'](_0x11d794['where'],{'$or':_[_0x6aaf('0x2c')](_0x11d794['attributes'],function(_0x326ad8){var _0x28df7c={};_0x28df7c[_0x326ad8]={'$like':'%'+_0x42aa09[_0x6aaf('0x2d')][_0x6aaf('0x38')]+'%'};return _0x28df7c;})});}_0x11d794=_[_0x6aaf('0x3a')]({},_0x11d794,_0x42aa09[_0x6aaf('0x42')]);return _0x5248d3[_0x6aaf('0x4d')](_0x11d794);}})[_0x6aaf('0x3b')](function(_0x413cfd){if(_0x413cfd){_0x8e6d68=_0x413cfd[_0x6aaf('0x32')];if(!_0x42aa09['query'][_0x6aaf('0x33')](_0x6aaf('0x34'))){_0x11d794['limit']=qs[_0x6aaf('0x1d')](_0x42aa09['query'][_0x6aaf('0x1d')]);_0x11d794['offset']=qs[_0x6aaf('0x1b')](_0x42aa09[_0x6aaf('0x2d')][_0x6aaf('0x1b')]);}return _0x5248d3[_0x6aaf('0x4d')](_0x11d794);}})[_0x6aaf('0x3b')](function(_0x335049){if(_0x335049){return _0x335049?{'count':_0x8e6d68,'rows':_0x335049}:null;}})[_0x6aaf('0x3b')](respondWithResult(_0x41d7c4,null))['catch'](handleError(_0x41d7c4,null));}; \ No newline at end of file +var _0x1b58=['end','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','getFields','findOne','VtigerField','options','getSubjects','getDescriptions','pick','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','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x206904,_0x24ca79){var _0x4adeea=function(_0x21001a){while(--_0x21001a){_0x206904['push'](_0x206904['shift']());}};_0x4adeea(++_0x24ca79);}(_0x1b58,0x184));var _0x81b5=function(_0x5d804e,_0x10d70c){_0x5d804e=_0x5d804e-0x0;var _0x199c00=_0x1b58[_0x5d804e];return _0x199c00;};'use strict';var emlformat=require(_0x81b5('0x0'));var rimraf=require(_0x81b5('0x1'));var zipdir=require(_0x81b5('0x2'));var jsonpatch=require(_0x81b5('0x3'));var rp=require(_0x81b5('0x4'));var moment=require(_0x81b5('0x5'));var BPromise=require(_0x81b5('0x6'));var Mustache=require(_0x81b5('0x7'));var util=require(_0x81b5('0x8'));var path=require(_0x81b5('0x9'));var sox=require(_0x81b5('0xa'));var csv=require(_0x81b5('0xb'));var ejs=require(_0x81b5('0xc'));var fs=require('fs');var fs_extra=require(_0x81b5('0xd'));var _=require(_0x81b5('0xe'));var squel=require(_0x81b5('0xf'));var crypto=require(_0x81b5('0x10'));var jsforce=require(_0x81b5('0x11'));var deskjs=require(_0x81b5('0x12'));var toCsv=require('to-csv');var querystring=require(_0x81b5('0x13'));var Papa=require('papaparse');var Redis=require(_0x81b5('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x81b5('0x15'));var hardwareService=require(_0x81b5('0x16'));var logger=require(_0x81b5('0x17'))(_0x81b5('0x18'));var utils=require(_0x81b5('0x19'));var config=require(_0x81b5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x81b5('0x1b'))['db'];function respondWithStatusCode(_0xc2d09,_0x2733fd){_0x2733fd=_0x2733fd||0xcc;return function(_0x178e4b){if(_0x178e4b){return _0xc2d09['sendStatus'](_0x2733fd);}return _0xc2d09[_0x81b5('0x1c')](_0x2733fd)['end']();};}function respondWithResult(_0x1db2db,_0x74bfba){_0x74bfba=_0x74bfba||0xc8;return function(_0x51f456){if(_0x51f456){return _0x1db2db[_0x81b5('0x1c')](_0x74bfba)[_0x81b5('0x1d')](_0x51f456);}};}function respondWithFilteredResult(_0x211fc3,_0x5c5050){return function(_0x4630d5){if(_0x4630d5){var _0x5040fe=typeof _0x5c5050[_0x81b5('0x1e')]===_0x81b5('0x1f')&&typeof _0x5c5050[_0x81b5('0x20')]==='undefined';var _0x55740a=_0x4630d5['count'];var _0x3749d1=_0x5040fe?0x0:_0x5c5050[_0x81b5('0x1e')];var _0x262f1d=_0x5040fe?_0x4630d5[_0x81b5('0x21')]:_0x5c5050[_0x81b5('0x1e')]+_0x5c5050[_0x81b5('0x20')];var _0x533ab4;if(_0x262f1d>=_0x55740a){_0x262f1d=_0x55740a;_0x533ab4=0xc8;}else{_0x533ab4=0xce;}_0x211fc3[_0x81b5('0x1c')](_0x533ab4);return _0x211fc3[_0x81b5('0x22')](_0x81b5('0x23'),_0x3749d1+'-'+_0x262f1d+'/'+_0x55740a)[_0x81b5('0x1d')](_0x4630d5);}return null;};}function patchUpdates(_0x343404){return function(_0x3abc77){try{jsonpatch[_0x81b5('0x24')](_0x3abc77,_0x343404,!![]);}catch(_0x4080ae){return BPromise[_0x81b5('0x25')](_0x4080ae);}return _0x3abc77[_0x81b5('0x26')]();};}function saveUpdates(_0x21864b,_0x46cdf1){return function(_0x4819d5){if(_0x4819d5){return _0x4819d5[_0x81b5('0x27')](_0x21864b)[_0x81b5('0x28')](function(_0x503fc9){return _0x503fc9;});}return null;};}function removeEntity(_0x49edd1,_0x4aaa53){return function(_0x1aabb4){if(_0x1aabb4){return _0x1aabb4[_0x81b5('0x29')]()['then'](function(){_0x49edd1[_0x81b5('0x1c')](0xcc)[_0x81b5('0x2a')]();});}};}function handleEntityNotFound(_0x2b1300,_0x5464cb){return function(_0x264b18){if(!_0x264b18){_0x2b1300[_0x81b5('0x2b')](0x194);}return _0x264b18;};}function handleError(_0x1b02e7,_0x576e2c){_0x576e2c=_0x576e2c||0x1f4;return function(_0x4fcd89){logger[_0x81b5('0x2c')](_0x4fcd89[_0x81b5('0x2d')]);if(_0x4fcd89[_0x81b5('0x2e')]){delete _0x4fcd89[_0x81b5('0x2e')];}_0x1b02e7[_0x81b5('0x1c')](_0x576e2c)[_0x81b5('0x2f')](_0x4fcd89);};}exports[_0x81b5('0x30')]=function(_0x551dbd,_0x20b723){var _0x18b83c={},_0x25fd58={},_0x5e668b={'count':0x0,'rows':[]};var _0x588d53=_[_0x81b5('0x31')](db[_0x81b5('0x32')]['rawAttributes'],function(_0x253b01){return{'name':_0x253b01[_0x81b5('0x33')],'type':_0x253b01['type'][_0x81b5('0x34')]};});_0x25fd58['model']=_[_0x81b5('0x31')](_0x588d53,_0x81b5('0x2e'));_0x25fd58[_0x81b5('0x35')]=_[_0x81b5('0x36')](_0x551dbd['query']);_0x25fd58[_0x81b5('0x37')]=_[_0x81b5('0x38')](_0x25fd58[_0x81b5('0x39')],_0x25fd58[_0x81b5('0x35')]);_0x18b83c[_0x81b5('0x3a')]=_[_0x81b5('0x38')](_0x25fd58[_0x81b5('0x39')],qs['fields'](_0x551dbd[_0x81b5('0x35')][_0x81b5('0x3b')]));_0x18b83c[_0x81b5('0x3a')]=_0x18b83c[_0x81b5('0x3a')]['length']?_0x18b83c[_0x81b5('0x3a')]:_0x25fd58['model'];if(!_0x551dbd['query'][_0x81b5('0x3c')](_0x81b5('0x3d'))){_0x18b83c[_0x81b5('0x20')]=qs[_0x81b5('0x20')](_0x551dbd['query']['limit']);_0x18b83c[_0x81b5('0x1e')]=qs[_0x81b5('0x1e')](_0x551dbd[_0x81b5('0x35')][_0x81b5('0x1e')]);}_0x18b83c[_0x81b5('0x3e')]=qs['sort'](_0x551dbd[_0x81b5('0x35')][_0x81b5('0x3f')]);_0x18b83c[_0x81b5('0x40')]=qs[_0x81b5('0x37')](_['pick'](_0x551dbd[_0x81b5('0x35')],_0x25fd58[_0x81b5('0x37')]),_0x588d53);if(_0x551dbd[_0x81b5('0x35')]['filter']){_0x18b83c['where']=_['merge'](_0x18b83c[_0x81b5('0x40')],{'$or':_[_0x81b5('0x31')](_0x588d53,function(_0x540555){if(_0x540555[_0x81b5('0x41')]!==_0x81b5('0x42')){var _0x195cf5={};_0x195cf5[_0x540555[_0x81b5('0x2e')]]={'$like':'%'+_0x551dbd['query'][_0x81b5('0x43')]+'%'};return _0x195cf5;}})});}_0x18b83c=_[_0x81b5('0x44')]({},_0x18b83c,_0x551dbd['options']);var _0x3008d4={'where':_0x18b83c['where']};return db[_0x81b5('0x32')][_0x81b5('0x21')](_0x3008d4)['then'](function(_0x116ae9){_0x5e668b[_0x81b5('0x21')]=_0x116ae9;if(_0x551dbd[_0x81b5('0x35')][_0x81b5('0x45')]){_0x18b83c[_0x81b5('0x46')]=[{'all':!![]}];}return db[_0x81b5('0x32')][_0x81b5('0x47')](_0x18b83c);})[_0x81b5('0x28')](function(_0x1727ca){_0x5e668b['rows']=_0x1727ca;return _0x5e668b;})[_0x81b5('0x28')](respondWithFilteredResult(_0x20b723,_0x18b83c))[_0x81b5('0x48')](handleError(_0x20b723,null));};exports['show']=function(_0x214f17,_0x5b1c84){var _0x4bd455={'raw':![],'where':{'id':_0x214f17[_0x81b5('0x49')]['id']}},_0x47663a={};_0x47663a[_0x81b5('0x39')]=_[_0x81b5('0x36')](db[_0x81b5('0x32')][_0x81b5('0x4a')]);_0x47663a['query']=_['keys'](_0x214f17[_0x81b5('0x35')]);_0x47663a[_0x81b5('0x37')]=_[_0x81b5('0x38')](_0x47663a[_0x81b5('0x39')],_0x47663a[_0x81b5('0x35')]);_0x4bd455[_0x81b5('0x3a')]=_[_0x81b5('0x38')](_0x47663a[_0x81b5('0x39')],qs[_0x81b5('0x3b')](_0x214f17['query'][_0x81b5('0x3b')]));_0x4bd455['attributes']=_0x4bd455['attributes'][_0x81b5('0x4b')]?_0x4bd455[_0x81b5('0x3a')]:_0x47663a[_0x81b5('0x39')];if(_0x214f17[_0x81b5('0x35')]['includeAll']){_0x4bd455[_0x81b5('0x46')]=[{'all':!![]}];}_0x4bd455=_[_0x81b5('0x44')]({},_0x4bd455,_0x214f17['options']);return db['VtigerConfiguration'][_0x81b5('0x4c')](_0x4bd455)[_0x81b5('0x28')](handleEntityNotFound(_0x5b1c84,null))[_0x81b5('0x28')](respondWithResult(_0x5b1c84,null))[_0x81b5('0x48')](handleError(_0x5b1c84,null));};exports[_0x81b5('0x4d')]=function(_0x5f261c,_0x8aa214){return db['VtigerConfiguration']['create'](_0x5f261c[_0x81b5('0x4e')],{})[_0x81b5('0x28')](respondWithResult(_0x8aa214,0xc9))[_0x81b5('0x48')](handleError(_0x8aa214,null));};exports[_0x81b5('0x27')]=function(_0x174856,_0x30fc19){if(_0x174856[_0x81b5('0x4e')]['id']){delete _0x174856[_0x81b5('0x4e')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x174856['params']['id']}})[_0x81b5('0x28')](handleEntityNotFound(_0x30fc19,null))['then'](saveUpdates(_0x174856['body'],null))[_0x81b5('0x28')](respondWithResult(_0x30fc19,null))[_0x81b5('0x48')](handleError(_0x30fc19,null));};exports[_0x81b5('0x29')]=function(_0x3cc642,_0x251a10){return db[_0x81b5('0x32')][_0x81b5('0x4c')]({'where':{'id':_0x3cc642[_0x81b5('0x49')]['id']}})[_0x81b5('0x28')](handleEntityNotFound(_0x251a10,null))[_0x81b5('0x28')](removeEntity(_0x251a10,null))[_0x81b5('0x48')](handleError(_0x251a10,null));};exports[_0x81b5('0x4f')]=function(_0x472476,_0xe66784,_0x475754){var _0x1dba9e={};var _0x5be630={};var _0x28f882;var _0x376d5d;return db[_0x81b5('0x32')][_0x81b5('0x50')]({'where':{'id':_0x472476['params']['id']}})[_0x81b5('0x28')](handleEntityNotFound(_0xe66784,null))[_0x81b5('0x28')](function(_0x33658f){if(_0x33658f){_0x28f882=_0x33658f;_0x5be630[_0x81b5('0x39')]=_[_0x81b5('0x36')](db[_0x81b5('0x51')][_0x81b5('0x4a')]);_0x5be630['query']=_[_0x81b5('0x36')](_0x472476['query']);_0x5be630['filters']=_[_0x81b5('0x38')](_0x5be630['model'],_0x5be630['query']);_0x1dba9e[_0x81b5('0x3a')]=_[_0x81b5('0x38')](_0x5be630['model'],qs[_0x81b5('0x3b')](_0x472476[_0x81b5('0x35')][_0x81b5('0x3b')]));_0x1dba9e[_0x81b5('0x3a')]=_0x1dba9e[_0x81b5('0x3a')][_0x81b5('0x4b')]?_0x1dba9e[_0x81b5('0x3a')]:_0x5be630['model'];_0x1dba9e['order']=qs['sort'](_0x472476[_0x81b5('0x35')][_0x81b5('0x3f')]);_0x1dba9e[_0x81b5('0x40')]=qs[_0x81b5('0x37')](_['pick'](_0x472476[_0x81b5('0x35')],_0x5be630['filters']));if(_0x472476[_0x81b5('0x35')][_0x81b5('0x43')]){_0x1dba9e[_0x81b5('0x40')]=_[_0x81b5('0x44')](_0x1dba9e[_0x81b5('0x40')],{'$or':_[_0x81b5('0x31')](_0x1dba9e[_0x81b5('0x3a')],function(_0x29cc55){var _0x4611b8={};_0x4611b8[_0x29cc55]={'$like':'%'+_0x472476['query'][_0x81b5('0x43')]+'%'};return _0x4611b8;})});}_0x1dba9e=_['merge']({},_0x1dba9e,_0x472476[_0x81b5('0x52')]);return _0x28f882[_0x81b5('0x4f')](_0x1dba9e);}})[_0x81b5('0x28')](function(_0x16adb0){if(_0x16adb0){_0x376d5d=_0x16adb0[_0x81b5('0x4b')];if(!_0x472476[_0x81b5('0x35')][_0x81b5('0x3c')](_0x81b5('0x3d'))){_0x1dba9e['limit']=qs[_0x81b5('0x20')](_0x472476[_0x81b5('0x35')][_0x81b5('0x20')]);_0x1dba9e['offset']=qs[_0x81b5('0x1e')](_0x472476[_0x81b5('0x35')][_0x81b5('0x1e')]);}return _0x28f882[_0x81b5('0x4f')](_0x1dba9e);}})[_0x81b5('0x28')](function(_0x3d12fe){if(_0x3d12fe){return _0x3d12fe?{'count':_0x376d5d,'rows':_0x3d12fe}:null;}})[_0x81b5('0x28')](respondWithResult(_0xe66784,null))[_0x81b5('0x48')](handleError(_0xe66784,null));};exports[_0x81b5('0x53')]=function(_0x4e6d88,_0x46451d,_0x171fea){var _0x3394c1={};var _0x1b006d={};var _0x2a824f;var _0x5214e3;return db[_0x81b5('0x32')][_0x81b5('0x50')]({'where':{'id':_0x4e6d88['params']['id']}})[_0x81b5('0x28')](handleEntityNotFound(_0x46451d,null))[_0x81b5('0x28')](function(_0x2c5dce){if(_0x2c5dce){_0x2a824f=_0x2c5dce;_0x1b006d[_0x81b5('0x39')]=_[_0x81b5('0x36')](db[_0x81b5('0x51')][_0x81b5('0x4a')]);_0x1b006d['query']=_[_0x81b5('0x36')](_0x4e6d88[_0x81b5('0x35')]);_0x1b006d[_0x81b5('0x37')]=_[_0x81b5('0x38')](_0x1b006d['model'],_0x1b006d[_0x81b5('0x35')]);_0x3394c1[_0x81b5('0x3a')]=_[_0x81b5('0x38')](_0x1b006d['model'],qs[_0x81b5('0x3b')](_0x4e6d88[_0x81b5('0x35')][_0x81b5('0x3b')]));_0x3394c1['attributes']=_0x3394c1[_0x81b5('0x3a')][_0x81b5('0x4b')]?_0x3394c1[_0x81b5('0x3a')]:_0x1b006d['model'];_0x3394c1[_0x81b5('0x3e')]=qs[_0x81b5('0x3f')](_0x4e6d88[_0x81b5('0x35')][_0x81b5('0x3f')]);_0x3394c1[_0x81b5('0x40')]=qs[_0x81b5('0x37')](_['pick'](_0x4e6d88[_0x81b5('0x35')],_0x1b006d[_0x81b5('0x37')]));if(_0x4e6d88[_0x81b5('0x35')][_0x81b5('0x43')]){_0x3394c1['where']=_['merge'](_0x3394c1['where'],{'$or':_[_0x81b5('0x31')](_0x3394c1['attributes'],function(_0x4427c9){var _0x2b9e53={};_0x2b9e53[_0x4427c9]={'$like':'%'+_0x4e6d88[_0x81b5('0x35')]['filter']+'%'};return _0x2b9e53;})});}_0x3394c1=_[_0x81b5('0x44')]({},_0x3394c1,_0x4e6d88[_0x81b5('0x52')]);return _0x2a824f['getSubjects'](_0x3394c1);}})[_0x81b5('0x28')](function(_0x365701){if(_0x365701){_0x5214e3=_0x365701[_0x81b5('0x4b')];if(!_0x4e6d88[_0x81b5('0x35')][_0x81b5('0x3c')](_0x81b5('0x3d'))){_0x3394c1['limit']=qs[_0x81b5('0x20')](_0x4e6d88['query'][_0x81b5('0x20')]);_0x3394c1[_0x81b5('0x1e')]=qs[_0x81b5('0x1e')](_0x4e6d88[_0x81b5('0x35')]['offset']);}return _0x2a824f[_0x81b5('0x53')](_0x3394c1);}})[_0x81b5('0x28')](function(_0x117f70){if(_0x117f70){return _0x117f70?{'count':_0x5214e3,'rows':_0x117f70}:null;}})[_0x81b5('0x28')](respondWithResult(_0x46451d,null))[_0x81b5('0x48')](handleError(_0x46451d,null));};exports[_0x81b5('0x54')]=function(_0x56a9cd,_0x5a1b7b,_0x4c2d21){var _0x47181a={};var _0x330c1d={};var _0xf3a533;var _0x458832;return db[_0x81b5('0x32')]['findOne']({'where':{'id':_0x56a9cd['params']['id']}})['then'](handleEntityNotFound(_0x5a1b7b,null))[_0x81b5('0x28')](function(_0x757d3a){if(_0x757d3a){_0xf3a533=_0x757d3a;_0x330c1d['model']=_[_0x81b5('0x36')](db[_0x81b5('0x51')][_0x81b5('0x4a')]);_0x330c1d['query']=_[_0x81b5('0x36')](_0x56a9cd[_0x81b5('0x35')]);_0x330c1d[_0x81b5('0x37')]=_[_0x81b5('0x38')](_0x330c1d[_0x81b5('0x39')],_0x330c1d['query']);_0x47181a[_0x81b5('0x3a')]=_[_0x81b5('0x38')](_0x330c1d['model'],qs[_0x81b5('0x3b')](_0x56a9cd[_0x81b5('0x35')]['fields']));_0x47181a[_0x81b5('0x3a')]=_0x47181a[_0x81b5('0x3a')][_0x81b5('0x4b')]?_0x47181a[_0x81b5('0x3a')]:_0x330c1d[_0x81b5('0x39')];_0x47181a[_0x81b5('0x3e')]=qs['sort'](_0x56a9cd['query'][_0x81b5('0x3f')]);_0x47181a['where']=qs[_0x81b5('0x37')](_[_0x81b5('0x55')](_0x56a9cd['query'],_0x330c1d[_0x81b5('0x37')]));if(_0x56a9cd[_0x81b5('0x35')][_0x81b5('0x43')]){_0x47181a[_0x81b5('0x40')]=_['merge'](_0x47181a['where'],{'$or':_[_0x81b5('0x31')](_0x47181a['attributes'],function(_0x2f5491){var _0x337b46={};_0x337b46[_0x2f5491]={'$like':'%'+_0x56a9cd[_0x81b5('0x35')][_0x81b5('0x43')]+'%'};return _0x337b46;})});}_0x47181a=_[_0x81b5('0x44')]({},_0x47181a,_0x56a9cd['options']);return _0xf3a533[_0x81b5('0x54')](_0x47181a);}})[_0x81b5('0x28')](function(_0x505895){if(_0x505895){_0x458832=_0x505895[_0x81b5('0x4b')];if(!_0x56a9cd[_0x81b5('0x35')]['hasOwnProperty']('nolimit')){_0x47181a[_0x81b5('0x20')]=qs['limit'](_0x56a9cd[_0x81b5('0x35')][_0x81b5('0x20')]);_0x47181a[_0x81b5('0x1e')]=qs[_0x81b5('0x1e')](_0x56a9cd[_0x81b5('0x35')][_0x81b5('0x1e')]);}return _0xf3a533['getDescriptions'](_0x47181a);}})['then'](function(_0x3b40a4){if(_0x3b40a4){return _0x3b40a4?{'count':_0x458832,'rows':_0x3b40a4}:null;}})[_0x81b5('0x28')](respondWithResult(_0x5a1b7b,null))['catch'](handleError(_0x5a1b7b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 3c2d7eb..00e8f44 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 _0xede8=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash'];(function(_0x3e329a,_0x4cc1e0){var _0x456f4e=function(_0x4c6d3a){while(--_0x4c6d3a){_0x3e329a['push'](_0x3e329a['shift']());}};_0x456f4e(++_0x4cc1e0);}(_0xede8,0x192));var _0x8ede=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xede8[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x8ede('0x0'));var util=require(_0x8ede('0x1'));var logger=require('../../config/logger')(_0x8ede('0x2'));var moment=require(_0x8ede('0x3'));var BPromise=require(_0x8ede('0x4'));var rp=require(_0x8ede('0x5'));var fs=require('fs');var path=require(_0x8ede('0x6'));var rimraf=require(_0x8ede('0x7'));var config=require(_0x8ede('0x8'));var attributes=require(_0x8ede('0x9'));module[_0x8ede('0xa')]=function(_0x4d4859,_0x5d7e4a){return _0x4d4859[_0x8ede('0xb')](_0x8ede('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1929=['exports','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x109685,_0x444ba7){var _0x4c8b3c=function(_0x479393){while(--_0x479393){_0x109685['push'](_0x109685['shift']());}};_0x4c8b3c(++_0x444ba7);}(_0x1929,0x1d0));var _0x9192=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x1929[_0x695b76];return _0x1dc21f;};'use strict';var _=require(_0x9192('0x0'));var util=require(_0x9192('0x1'));var logger=require(_0x9192('0x2'))(_0x9192('0x3'));var moment=require('moment');var BPromise=require(_0x9192('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9192('0x5'));var rimraf=require(_0x9192('0x6'));var config=require(_0x9192('0x7'));var attributes=require(_0x9192('0x8'));module[_0x9192('0x9')]=function(_0x5f521d,_0x2a21cf){return _0x5f521d['define']('VtigerConfiguration',attributes,{'tableName':_0x9192('0xa'),'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 8126f16..b081eff 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 _0x8d95=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x2af3e2,_0x4d79b7){var _0x26bc20=function(_0x37f37e){while(--_0x37f37e){_0x2af3e2['push'](_0x2af3e2['shift']());}};_0x26bc20(++_0x4d79b7);}(_0x8d95,0x1ed));var _0x58d9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8d95[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x58d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x58d9('0x1'));var rs=require(_0x58d9('0x2'));var fs=require('fs');var Redis=require(_0x58d9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x58d9('0x4'));var logger=require(_0x58d9('0x5'))('rpc');var config=require(_0x58d9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x58d9('0x7')][_0x58d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ad4f8,_0x4a1e91,_0x52599e){return new BPromise(function(_0x5ecece,_0x178bbd){return client[_0x58d9('0x9')](_0x1ad4f8,_0x52599e)[_0x58d9('0xa')](function(_0x1f5cd0){logger[_0x58d9('0xb')](_0x58d9('0xc'),_0x4a1e91,_0x58d9('0xd'));logger[_0x58d9('0xe')](_0x58d9('0xf'),_0x4a1e91,'request\x20sent',JSON[_0x58d9('0x10')](_0x1f5cd0));if(_0x1f5cd0[_0x58d9('0x11')]){if(_0x1f5cd0[_0x58d9('0x11')]['code']===0x1f4){logger[_0x58d9('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x4a1e91,_0x1f5cd0['error']['message']);return _0x178bbd(_0x1f5cd0[_0x58d9('0x11')][_0x58d9('0x12')]);}logger[_0x58d9('0x11')](_0x58d9('0xc'),_0x4a1e91,_0x1f5cd0[_0x58d9('0x11')][_0x58d9('0x12')]);return _0x5ecece(_0x1f5cd0[_0x58d9('0x11')]['message']);}else{logger[_0x58d9('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x4a1e91,_0x58d9('0xd'));_0x5ecece(_0x1f5cd0[_0x58d9('0x13')][_0x58d9('0x12')]);}})[_0x58d9('0x14')](function(_0x587093){logger[_0x58d9('0x11')](_0x58d9('0xc'),_0x4a1e91,_0x587093);_0x178bbd(_0x587093);});});} \ No newline at end of file +var _0xb81e=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xb81e,0x194));var _0xeb81=function(_0x54fff5,_0x308889){_0x54fff5=_0x54fff5-0x0;var _0x7198fb=_0xb81e[_0x54fff5];return _0x7198fb;};'use strict';var _=require(_0xeb81('0x0'));var util=require(_0xeb81('0x1'));var moment=require(_0xeb81('0x2'));var BPromise=require(_0xeb81('0x3'));var rs=require(_0xeb81('0x4'));var fs=require('fs');var Redis=require(_0xeb81('0x5'));var db=require(_0xeb81('0x6'))['db'];var utils=require(_0xeb81('0x7'));var logger=require(_0xeb81('0x8'))(_0xeb81('0x9'));var config=require(_0xeb81('0xa'));var jayson=require(_0xeb81('0xb'));var client=jayson[_0xeb81('0xc')][_0xeb81('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4044f0,_0x27bd7b,_0x5c23c5){return new BPromise(function(_0x4e03ae,_0x9a7527){return client['request'](_0x4044f0,_0x5c23c5)[_0xeb81('0xe')](function(_0x2d1dff){logger['info'](_0xeb81('0xf'),_0x27bd7b,'request\x20sent');logger[_0xeb81('0x10')](_0xeb81('0x11'),_0x27bd7b,_0xeb81('0x12'),JSON[_0xeb81('0x13')](_0x2d1dff));if(_0x2d1dff[_0xeb81('0x14')]){if(_0x2d1dff[_0xeb81('0x14')][_0xeb81('0x15')]===0x1f4){logger[_0xeb81('0x14')](_0xeb81('0xf'),_0x27bd7b,_0x2d1dff[_0xeb81('0x14')][_0xeb81('0x16')]);return _0x9a7527(_0x2d1dff[_0xeb81('0x14')][_0xeb81('0x16')]);}logger['error'](_0xeb81('0xf'),_0x27bd7b,_0x2d1dff['error'][_0xeb81('0x16')]);return _0x4e03ae(_0x2d1dff['error']['message']);}else{logger[_0xeb81('0x17')](_0xeb81('0xf'),_0x27bd7b,_0xeb81('0x12'));_0x4e03ae(_0x2d1dff['result']['message']);}})[_0xeb81('0x18')](function(_0x54f163){logger[_0xeb81('0x14')](_0xeb81('0xf'),_0x27bd7b,_0x54f163);_0x9a7527(_0x54f163);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 0238226..616bcd7 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 _0x57c9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','multer','util','path'];(function(_0x578062,_0x2858e9){var _0x2ba7f5=function(_0x238e56){while(--_0x238e56){_0x578062['push'](_0x578062['shift']());}};_0x2ba7f5(++_0x2858e9);}(_0x57c9,0x1f1));var _0x957c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x57c9[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x957c('0x0'));var util=require(_0x957c('0x1'));var path=require(_0x957c('0x2'));var timeout=require(_0x957c('0x3'));var express=require(_0x957c('0x4'));var router=express[_0x957c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x957c('0x6'));var interaction=require(_0x957c('0x7'));var config=require(_0x957c('0x8'));var controller=require(_0x957c('0x9'));router[_0x957c('0xa')]('/',auth[_0x957c('0xb')](),controller[_0x957c('0xc')]);router[_0x957c('0xa')]('/:id',auth[_0x957c('0xb')](),controller[_0x957c('0xd')]);router[_0x957c('0xe')]('/',auth[_0x957c('0xb')](),controller[_0x957c('0xf')]);router[_0x957c('0x10')](_0x957c('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x957c('0x12')](_0x957c('0x11'),auth[_0x957c('0xb')](),controller[_0x957c('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf35b=['isAuthenticated','index','/:id','show','post','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x2aba39,_0x3d2062){var _0x1adbe8=function(_0x4469e5){while(--_0x4469e5){_0x2aba39['push'](_0x2aba39['shift']());}};_0x1adbe8(++_0x3d2062);}(_0xf35b,0x1c3));var _0xbf35=function(_0x131932,_0x2312e9){_0x131932=_0x131932-0x0;var _0x2e20e2=_0xf35b[_0x131932];return _0x2e20e2;};'use strict';var multer=require('multer');var util=require(_0xbf35('0x0'));var path=require(_0xbf35('0x1'));var timeout=require(_0xbf35('0x2'));var express=require(_0xbf35('0x3'));var router=express[_0xbf35('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf35('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbf35('0x6'));var controller=require('./intVtigerField.controller');router[_0xbf35('0x7')]('/',auth[_0xbf35('0x8')](),controller[_0xbf35('0x9')]);router[_0xbf35('0x7')](_0xbf35('0xa'),auth[_0xbf35('0x8')](),controller[_0xbf35('0xb')]);router[_0xbf35('0xc')]('/',auth[_0xbf35('0x8')](),controller['create']);router[_0xbf35('0xd')](_0xbf35('0xa'),auth[_0xbf35('0x8')](),controller[_0xbf35('0xe')]);router[_0xbf35('0xf')](_0xbf35('0xa'),auth[_0xbf35('0x8')](),controller['destroy']);module[_0xbf35('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e936434..e17a7b4 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 _0xf1fa=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xf1fa,0x7f));var _0xaf1f=function(_0x4c2514,_0x3282b5){_0x4c2514=_0x4c2514-0x0;var _0x246b5f=_0xf1fa[_0x4c2514];return _0x246b5f;};'use strict';var Sequelize=require(_0xaf1f('0x0'));module[_0xaf1f('0x1')]={'type':{'type':Sequelize[_0xaf1f('0x2')](_0xaf1f('0x3'),'variable',_0xaf1f('0x4'),_0xaf1f('0x5'),'picklist'),'defaultValue':_0xaf1f('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaf1f('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xaf1f('0x3'),_0xaf1f('0x7'),_0xaf1f('0x4'))},'keyContent':{'type':Sequelize[_0xaf1f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaf1f('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf1f('0x6')]}}; \ No newline at end of file +var _0x4918=['variable','customVariable','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x3692a9,_0xb15338){var _0x1f7696=function(_0xe2907a){while(--_0xe2907a){_0x3692a9['push'](_0x3692a9['shift']());}};_0x1f7696(++_0xb15338);}(_0x4918,0x74));var _0x8491=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x4918[_0x27530d];return _0x59e561;};'use strict';var Sequelize=require(_0x8491('0x0'));module[_0x8491('0x1')]={'type':{'type':Sequelize[_0x8491('0x2')](_0x8491('0x3'),_0x8491('0x4'),_0x8491('0x5'),'keyValue',_0x8491('0x6')),'defaultValue':_0x8491('0x3')},'content':{'type':Sequelize[_0x8491('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8491('0x2')](_0x8491('0x3'),_0x8491('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x8491('0x7')]},'idField':{'type':Sequelize[_0x8491('0x7')]},'nameField':{'type':Sequelize[_0x8491('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8491('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b6d1954..9fc3abd 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 _0x9433=['fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util'];(function(_0x5a366c,_0x11c04a){var _0x248030=function(_0x22aed){while(--_0x22aed){_0x5a366c['push'](_0x5a366c['shift']());}};_0x248030(++_0x11c04a);}(_0x9433,0x112));var _0x3943=function(_0x39f60d,_0x2f5385){_0x39f60d=_0x39f60d-0x0;var _0x2bf065=_0x9433[_0x39f60d];return _0x2bf065;};'use strict';var emlformat=require(_0x3943('0x0'));var rimraf=require(_0x3943('0x1'));var zipdir=require(_0x3943('0x2'));var jsonpatch=require(_0x3943('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3943('0x4'));var util=require(_0x3943('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3943('0x6'));var _=require('lodash');var squel=require(_0x3943('0x7'));var crypto=require(_0x3943('0x8'));var jsforce=require(_0x3943('0x9'));var deskjs=require(_0x3943('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3943('0xb'));var Papa=require('papaparse');var Redis=require(_0x3943('0xc'));var authService=require(_0x3943('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x3943('0xe'));var hardwareService=require(_0x3943('0xf'));var logger=require(_0x3943('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x3943('0x11'));var licenseUtil=require(_0x3943('0x12'));var db=require(_0x3943('0x13'))['db'];function respondWithStatusCode(_0x163911,_0x5f1bc8){_0x5f1bc8=_0x5f1bc8||0xcc;return function(_0x142f26){if(_0x142f26){return _0x163911[_0x3943('0x14')](_0x5f1bc8);}return _0x163911[_0x3943('0x15')](_0x5f1bc8)[_0x3943('0x16')]();};}function respondWithResult(_0x454e97,_0x30f351){_0x30f351=_0x30f351||0xc8;return function(_0xfa403b){if(_0xfa403b){return _0x454e97[_0x3943('0x15')](_0x30f351)[_0x3943('0x17')](_0xfa403b);}};}function respondWithFilteredResult(_0x214c19,_0x456871){return function(_0x2e9578){if(_0x2e9578){var _0xca07a=typeof _0x456871[_0x3943('0x18')]==='undefined'&&typeof _0x456871[_0x3943('0x19')]===_0x3943('0x1a');var _0x3c11f8=_0x2e9578[_0x3943('0x1b')];var _0x12840e=_0xca07a?0x0:_0x456871[_0x3943('0x18')];var _0x474eb2=_0xca07a?_0x2e9578[_0x3943('0x1b')]:_0x456871[_0x3943('0x18')]+_0x456871[_0x3943('0x19')];var _0x1a9c4b;if(_0x474eb2>=_0x3c11f8){_0x474eb2=_0x3c11f8;_0x1a9c4b=0xc8;}else{_0x1a9c4b=0xce;}_0x214c19[_0x3943('0x15')](_0x1a9c4b);return _0x214c19[_0x3943('0x1c')](_0x3943('0x1d'),_0x12840e+'-'+_0x474eb2+'/'+_0x3c11f8)['json'](_0x2e9578);}return null;};}function patchUpdates(_0x4fda8c){return function(_0x56cc4f){try{jsonpatch['apply'](_0x56cc4f,_0x4fda8c,!![]);}catch(_0x39d87c){return BPromise[_0x3943('0x1e')](_0x39d87c);}return _0x56cc4f[_0x3943('0x1f')]();};}function saveUpdates(_0x2a6fab,_0x301d82){return function(_0x555bff){if(_0x555bff){return _0x555bff[_0x3943('0x20')](_0x2a6fab)['then'](function(_0x2be97e){return _0x2be97e;});}return null;};}function removeEntity(_0x394c1c,_0x2d2e13){return function(_0x4634e1){if(_0x4634e1){return _0x4634e1[_0x3943('0x21')]()[_0x3943('0x22')](function(){_0x394c1c[_0x3943('0x15')](0xcc)[_0x3943('0x16')]();});}};}function handleEntityNotFound(_0x57cde7,_0x568747){return function(_0x5b775b){if(!_0x5b775b){_0x57cde7[_0x3943('0x14')](0x194);}return _0x5b775b;};}function handleError(_0x5a917b,_0x51f6c7){_0x51f6c7=_0x51f6c7||0x1f4;return function(_0x36ff59){logger['error'](_0x36ff59[_0x3943('0x23')]);if(_0x36ff59[_0x3943('0x24')]){delete _0x36ff59[_0x3943('0x24')];}_0x5a917b[_0x3943('0x15')](_0x51f6c7)[_0x3943('0x25')](_0x36ff59);};}exports['index']=function(_0xe62ea3,_0x2ba71e){var _0x15e9af={},_0x5df9e2={},_0x4142e8={'count':0x0,'rows':[]};var _0x82f455=_[_0x3943('0x26')](db[_0x3943('0x27')][_0x3943('0x28')],function(_0x4ef2f2){return{'name':_0x4ef2f2[_0x3943('0x29')],'type':_0x4ef2f2[_0x3943('0x2a')][_0x3943('0x2b')]};});_0x5df9e2[_0x3943('0x2c')]=_[_0x3943('0x26')](_0x82f455,_0x3943('0x24'));_0x5df9e2[_0x3943('0x2d')]=_[_0x3943('0x2e')](_0xe62ea3[_0x3943('0x2d')]);_0x5df9e2['filters']=_[_0x3943('0x2f')](_0x5df9e2[_0x3943('0x2c')],_0x5df9e2[_0x3943('0x2d')]);_0x15e9af[_0x3943('0x30')]=_[_0x3943('0x2f')](_0x5df9e2['model'],qs[_0x3943('0x31')](_0xe62ea3[_0x3943('0x2d')][_0x3943('0x31')]));_0x15e9af['attributes']=_0x15e9af[_0x3943('0x30')][_0x3943('0x32')]?_0x15e9af['attributes']:_0x5df9e2['model'];if(!_0xe62ea3[_0x3943('0x2d')]['hasOwnProperty'](_0x3943('0x33'))){_0x15e9af['limit']=qs[_0x3943('0x19')](_0xe62ea3[_0x3943('0x2d')]['limit']);_0x15e9af['offset']=qs[_0x3943('0x18')](_0xe62ea3['query']['offset']);}_0x15e9af[_0x3943('0x34')]=qs[_0x3943('0x35')](_0xe62ea3[_0x3943('0x2d')][_0x3943('0x35')]);_0x15e9af[_0x3943('0x36')]=qs[_0x3943('0x37')](_[_0x3943('0x38')](_0xe62ea3['query'],_0x5df9e2[_0x3943('0x37')]),_0x82f455);if(_0xe62ea3['query'][_0x3943('0x39')]){_0x15e9af[_0x3943('0x36')]=_['merge'](_0x15e9af[_0x3943('0x36')],{'$or':_[_0x3943('0x26')](_0x82f455,function(_0x2c42d6){if(_0x2c42d6['type']!==_0x3943('0x3a')){var _0x51f946={};_0x51f946[_0x2c42d6['name']]={'$like':'%'+_0xe62ea3['query'][_0x3943('0x39')]+'%'};return _0x51f946;}})});}_0x15e9af=_[_0x3943('0x3b')]({},_0x15e9af,_0xe62ea3[_0x3943('0x3c')]);var _0x2348b3={'where':_0x15e9af[_0x3943('0x36')]};return db['VtigerField'][_0x3943('0x1b')](_0x2348b3)[_0x3943('0x22')](function(_0x18fd37){_0x4142e8['count']=_0x18fd37;if(_0xe62ea3[_0x3943('0x2d')][_0x3943('0x3d')]){_0x15e9af[_0x3943('0x3e')]=[{'all':!![]}];}return db[_0x3943('0x27')][_0x3943('0x3f')](_0x15e9af);})[_0x3943('0x22')](function(_0x2f47ac){_0x4142e8['rows']=_0x2f47ac;return _0x4142e8;})[_0x3943('0x22')](respondWithFilteredResult(_0x2ba71e,_0x15e9af))[_0x3943('0x40')](handleError(_0x2ba71e,null));};exports[_0x3943('0x41')]=function(_0x263fa5,_0xeca247){var _0x27ef3e={'raw':!![],'where':{'id':_0x263fa5['params']['id']}},_0x1a6bf7={};_0x1a6bf7[_0x3943('0x2c')]=_[_0x3943('0x2e')](db[_0x3943('0x27')][_0x3943('0x28')]);_0x1a6bf7[_0x3943('0x2d')]=_['keys'](_0x263fa5[_0x3943('0x2d')]);_0x1a6bf7[_0x3943('0x37')]=_[_0x3943('0x2f')](_0x1a6bf7[_0x3943('0x2c')],_0x1a6bf7[_0x3943('0x2d')]);_0x27ef3e[_0x3943('0x30')]=_['intersection'](_0x1a6bf7[_0x3943('0x2c')],qs[_0x3943('0x31')](_0x263fa5[_0x3943('0x2d')][_0x3943('0x31')]));_0x27ef3e[_0x3943('0x30')]=_0x27ef3e[_0x3943('0x30')]['length']?_0x27ef3e[_0x3943('0x30')]:_0x1a6bf7['model'];if(_0x263fa5[_0x3943('0x2d')]['includeAll']){_0x27ef3e[_0x3943('0x3e')]=[{'all':!![]}];}_0x27ef3e=_[_0x3943('0x3b')]({},_0x27ef3e,_0x263fa5['options']);return db[_0x3943('0x27')]['find'](_0x27ef3e)[_0x3943('0x22')](handleEntityNotFound(_0xeca247,null))['then'](respondWithResult(_0xeca247,null))[_0x3943('0x40')](handleError(_0xeca247,null));};exports[_0x3943('0x42')]=function(_0x37d3d7,_0x46bd4d){return db['VtigerField']['create'](_0x37d3d7[_0x3943('0x43')],{})[_0x3943('0x22')](respondWithResult(_0x46bd4d,0xc9))['catch'](handleError(_0x46bd4d,null));};exports[_0x3943('0x20')]=function(_0x2b710e,_0x568a96){if(_0x2b710e[_0x3943('0x43')]['id']){delete _0x2b710e[_0x3943('0x43')]['id'];}return db['VtigerField'][_0x3943('0x44')]({'where':{'id':_0x2b710e[_0x3943('0x45')]['id']}})[_0x3943('0x22')](handleEntityNotFound(_0x568a96,null))['then'](saveUpdates(_0x2b710e[_0x3943('0x43')],null))[_0x3943('0x22')](respondWithResult(_0x568a96,null))['catch'](handleError(_0x568a96,null));};exports[_0x3943('0x21')]=function(_0x6763f6,_0x42bed9){return db[_0x3943('0x27')][_0x3943('0x44')]({'where':{'id':_0x6763f6[_0x3943('0x45')]['id']}})[_0x3943('0x22')](handleEntityNotFound(_0x42bed9,null))[_0x3943('0x22')](removeEntity(_0x42bed9,null))['catch'](handleError(_0x42bed9,null));}; \ No newline at end of file +var _0x5be4=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','VtigerField','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x3118eb,_0x386259){var _0x3166f3=function(_0x3e99f3){while(--_0x3e99f3){_0x3118eb['push'](_0x3118eb['shift']());}};_0x3166f3(++_0x386259);}(_0x5be4,0x1eb));var _0x45be=function(_0x1dcb51,_0x261645){_0x1dcb51=_0x1dcb51-0x0;var _0x416444=_0x5be4[_0x1dcb51];return _0x416444;};'use strict';var emlformat=require(_0x45be('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x45be('0x1'));var rp=require(_0x45be('0x2'));var moment=require(_0x45be('0x3'));var BPromise=require(_0x45be('0x4'));var Mustache=require(_0x45be('0x5'));var util=require(_0x45be('0x6'));var path=require('path');var sox=require(_0x45be('0x7'));var csv=require(_0x45be('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45be('0x9'));var _=require(_0x45be('0xa'));var squel=require(_0x45be('0xb'));var crypto=require(_0x45be('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x45be('0xd'));var toCsv=require(_0x45be('0x8'));var querystring=require(_0x45be('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x45be('0xf'));var qs=require(_0x45be('0x10'));var as=require(_0x45be('0x11'));var hardwareService=require(_0x45be('0x12'));var logger=require(_0x45be('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x45be('0x14'));var licenseUtil=require(_0x45be('0x15'));var db=require(_0x45be('0x16'))['db'];function respondWithStatusCode(_0x3e891d,_0x7e2d1c){_0x7e2d1c=_0x7e2d1c||0xcc;return function(_0x4edecc){if(_0x4edecc){return _0x3e891d[_0x45be('0x17')](_0x7e2d1c);}return _0x3e891d[_0x45be('0x18')](_0x7e2d1c)[_0x45be('0x19')]();};}function respondWithResult(_0x3601a2,_0x35070e){_0x35070e=_0x35070e||0xc8;return function(_0x1f8247){if(_0x1f8247){return _0x3601a2[_0x45be('0x18')](_0x35070e)[_0x45be('0x1a')](_0x1f8247);}};}function respondWithFilteredResult(_0x25724a,_0x98d5ab){return function(_0x30661f){if(_0x30661f){var _0x230260=typeof _0x98d5ab[_0x45be('0x1b')]===_0x45be('0x1c')&&typeof _0x98d5ab[_0x45be('0x1d')]===_0x45be('0x1c');var _0x149cf1=_0x30661f[_0x45be('0x1e')];var _0x3ab5f6=_0x230260?0x0:_0x98d5ab[_0x45be('0x1b')];var _0x33d164=_0x230260?_0x30661f[_0x45be('0x1e')]:_0x98d5ab['offset']+_0x98d5ab[_0x45be('0x1d')];var _0x3b994e;if(_0x33d164>=_0x149cf1){_0x33d164=_0x149cf1;_0x3b994e=0xc8;}else{_0x3b994e=0xce;}_0x25724a[_0x45be('0x18')](_0x3b994e);return _0x25724a[_0x45be('0x1f')](_0x45be('0x20'),_0x3ab5f6+'-'+_0x33d164+'/'+_0x149cf1)[_0x45be('0x1a')](_0x30661f);}return null;};}function patchUpdates(_0x1e2550){return function(_0x4e0cae){try{jsonpatch[_0x45be('0x21')](_0x4e0cae,_0x1e2550,!![]);}catch(_0x28fac4){return BPromise[_0x45be('0x22')](_0x28fac4);}return _0x4e0cae[_0x45be('0x23')]();};}function saveUpdates(_0x5e617,_0x4b6dc7){return function(_0x36abda){if(_0x36abda){return _0x36abda[_0x45be('0x24')](_0x5e617)[_0x45be('0x25')](function(_0xcaa219){return _0xcaa219;});}return null;};}function removeEntity(_0x26ee3b,_0x5bc581){return function(_0x5c2029){if(_0x5c2029){return _0x5c2029[_0x45be('0x26')]()[_0x45be('0x25')](function(){_0x26ee3b['status'](0xcc)[_0x45be('0x19')]();});}};}function handleEntityNotFound(_0x403f1e,_0x5a0287){return function(_0x323686){if(!_0x323686){_0x403f1e[_0x45be('0x17')](0x194);}return _0x323686;};}function handleError(_0x5e0d89,_0xb24eec){_0xb24eec=_0xb24eec||0x1f4;return function(_0x484cb8){logger[_0x45be('0x27')](_0x484cb8['stack']);if(_0x484cb8['name']){delete _0x484cb8[_0x45be('0x28')];}_0x5e0d89[_0x45be('0x18')](_0xb24eec)['send'](_0x484cb8);};}exports[_0x45be('0x29')]=function(_0x452261,_0x11cbf5){var _0x3befe9={},_0x56c598={},_0x23f9f8={'count':0x0,'rows':[]};var _0x1f4264=_['map'](db['VtigerField'][_0x45be('0x2a')],function(_0x1d13cd){return{'name':_0x1d13cd['fieldName'],'type':_0x1d13cd[_0x45be('0x2b')][_0x45be('0x2c')]};});_0x56c598['model']=_['map'](_0x1f4264,'name');_0x56c598[_0x45be('0x2d')]=_['keys'](_0x452261['query']);_0x56c598[_0x45be('0x2e')]=_[_0x45be('0x2f')](_0x56c598['model'],_0x56c598[_0x45be('0x2d')]);_0x3befe9['attributes']=_[_0x45be('0x2f')](_0x56c598[_0x45be('0x30')],qs[_0x45be('0x31')](_0x452261[_0x45be('0x2d')][_0x45be('0x31')]));_0x3befe9['attributes']=_0x3befe9[_0x45be('0x32')]['length']?_0x3befe9[_0x45be('0x32')]:_0x56c598[_0x45be('0x30')];if(!_0x452261[_0x45be('0x2d')][_0x45be('0x33')](_0x45be('0x34'))){_0x3befe9['limit']=qs[_0x45be('0x1d')](_0x452261[_0x45be('0x2d')]['limit']);_0x3befe9[_0x45be('0x1b')]=qs['offset'](_0x452261[_0x45be('0x2d')][_0x45be('0x1b')]);}_0x3befe9[_0x45be('0x35')]=qs[_0x45be('0x36')](_0x452261[_0x45be('0x2d')]['sort']);_0x3befe9[_0x45be('0x37')]=qs[_0x45be('0x2e')](_[_0x45be('0x38')](_0x452261[_0x45be('0x2d')],_0x56c598['filters']),_0x1f4264);if(_0x452261[_0x45be('0x2d')][_0x45be('0x39')]){_0x3befe9['where']=_[_0x45be('0x3a')](_0x3befe9[_0x45be('0x37')],{'$or':_[_0x45be('0x3b')](_0x1f4264,function(_0x1962a1){if(_0x1962a1[_0x45be('0x2b')]!=='VIRTUAL'){var _0x5413d3={};_0x5413d3[_0x1962a1['name']]={'$like':'%'+_0x452261[_0x45be('0x2d')]['filter']+'%'};return _0x5413d3;}})});}_0x3befe9=_[_0x45be('0x3a')]({},_0x3befe9,_0x452261[_0x45be('0x3c')]);var _0x223a90={'where':_0x3befe9['where']};return db[_0x45be('0x3d')]['count'](_0x223a90)[_0x45be('0x25')](function(_0x193188){_0x23f9f8[_0x45be('0x1e')]=_0x193188;if(_0x452261[_0x45be('0x2d')][_0x45be('0x3e')]){_0x3befe9[_0x45be('0x3f')]=[{'all':!![]}];}return db[_0x45be('0x3d')][_0x45be('0x40')](_0x3befe9);})['then'](function(_0x94c88f){_0x23f9f8['rows']=_0x94c88f;return _0x23f9f8;})[_0x45be('0x25')](respondWithFilteredResult(_0x11cbf5,_0x3befe9))[_0x45be('0x41')](handleError(_0x11cbf5,null));};exports[_0x45be('0x42')]=function(_0x362d9a,_0x3cb09a){var _0x5d8001={'raw':!![],'where':{'id':_0x362d9a[_0x45be('0x43')]['id']}},_0x155d17={};_0x155d17[_0x45be('0x30')]=_[_0x45be('0x44')](db[_0x45be('0x3d')][_0x45be('0x2a')]);_0x155d17['query']=_['keys'](_0x362d9a[_0x45be('0x2d')]);_0x155d17[_0x45be('0x2e')]=_[_0x45be('0x2f')](_0x155d17[_0x45be('0x30')],_0x155d17['query']);_0x5d8001['attributes']=_['intersection'](_0x155d17['model'],qs[_0x45be('0x31')](_0x362d9a['query'][_0x45be('0x31')]));_0x5d8001[_0x45be('0x32')]=_0x5d8001[_0x45be('0x32')]['length']?_0x5d8001[_0x45be('0x32')]:_0x155d17['model'];if(_0x362d9a[_0x45be('0x2d')]['includeAll']){_0x5d8001[_0x45be('0x3f')]=[{'all':!![]}];}_0x5d8001=_['merge']({},_0x5d8001,_0x362d9a[_0x45be('0x3c')]);return db['VtigerField'][_0x45be('0x45')](_0x5d8001)['then'](handleEntityNotFound(_0x3cb09a,null))['then'](respondWithResult(_0x3cb09a,null))['catch'](handleError(_0x3cb09a,null));};exports['create']=function(_0x3eb760,_0x325496){return db['VtigerField'][_0x45be('0x46')](_0x3eb760[_0x45be('0x47')],{})[_0x45be('0x25')](respondWithResult(_0x325496,0xc9))[_0x45be('0x41')](handleError(_0x325496,null));};exports[_0x45be('0x24')]=function(_0x50d6e7,_0x181ed6){if(_0x50d6e7[_0x45be('0x47')]['id']){delete _0x50d6e7[_0x45be('0x47')]['id'];}return db[_0x45be('0x3d')]['find']({'where':{'id':_0x50d6e7[_0x45be('0x43')]['id']}})[_0x45be('0x25')](handleEntityNotFound(_0x181ed6,null))[_0x45be('0x25')](saveUpdates(_0x50d6e7[_0x45be('0x47')],null))[_0x45be('0x25')](respondWithResult(_0x181ed6,null))[_0x45be('0x41')](handleError(_0x181ed6,null));};exports[_0x45be('0x26')]=function(_0x293f5e,_0x3d2763){return db[_0x45be('0x3d')][_0x45be('0x45')]({'where':{'id':_0x293f5e['params']['id']}})[_0x45be('0x25')](handleEntityNotFound(_0x3d2763,null))['then'](removeEntity(_0x3d2763,null))[_0x45be('0x41')](handleError(_0x3d2763,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 0e6f0d1..50527ac 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 _0xbc32=['exports','define','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intVtigerField.attributes'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xbc32,0xbb));var _0x2bc3=function(_0x3fdefe,_0x48a6c9){_0x3fdefe=_0x3fdefe-0x0;var _0x46d16b=_0xbc32[_0x3fdefe];return _0x46d16b;};'use strict';var _=require('lodash');var util=require(_0x2bc3('0x0'));var logger=require(_0x2bc3('0x1'))(_0x2bc3('0x2'));var moment=require(_0x2bc3('0x3'));var BPromise=require('bluebird');var rp=require(_0x2bc3('0x4'));var fs=require('fs');var path=require(_0x2bc3('0x5'));var rimraf=require('rimraf');var config=require(_0x2bc3('0x6'));var attributes=require(_0x2bc3('0x7'));module[_0x2bc3('0x8')]=function(_0x5df53a,_0x5a602e){return _0x5df53a[_0x2bc3('0x9')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x2bc3('0xa'),'fields':[_0x2bc3('0xb'),_0x2bc3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x738c=['lodash','util','api','moment','bluebird','path','../../config/environment','./intVtigerField.attributes','define','vtiger_unique_index','idField','FieldId'];(function(_0x38a729,_0x285de7){var _0x4074fc=function(_0x3b0ee1){while(--_0x3b0ee1){_0x38a729['push'](_0x38a729['shift']());}};_0x4074fc(++_0x285de7);}(_0x738c,0xcc));var _0xc738=function(_0x403c57,_0x280a51){_0x403c57=_0x403c57-0x0;var _0x35fa69=_0x738c[_0x403c57];return _0x35fa69;};'use strict';var _=require(_0xc738('0x0'));var util=require(_0xc738('0x1'));var logger=require('../../config/logger')(_0xc738('0x2'));var moment=require(_0xc738('0x3'));var BPromise=require(_0xc738('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc738('0x5'));var rimraf=require('rimraf');var config=require(_0xc738('0x6'));var attributes=require(_0xc738('0x7'));module['exports']=function(_0x15bc3f,_0x46b0e9){return _0x15bc3f[_0xc738('0x8')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xc738('0x9'),'fields':[_0xc738('0xa'),_0xc738('0xb')],'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 e9f0cbb..7f61fcb 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 _0xcc01=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','debug','stringify','error','code','message','info','VtigerField,\x20%s,\x20%s','result','catch','util','moment'];(function(_0x3fdfeb,_0x1cddff){var _0x9874=function(_0x13ec64){while(--_0x13ec64){_0x3fdfeb['push'](_0x3fdfeb['shift']());}};_0x9874(++_0x1cddff);}(_0xcc01,0xfa));var _0x1cc0=function(_0x40c25c,_0x25e8eb){_0x40c25c=_0x40c25c-0x0;var _0x43b5de=_0xcc01[_0x40c25c];return _0x43b5de;};'use strict';var _=require('lodash');var util=require(_0x1cc0('0x0'));var moment=require(_0x1cc0('0x1'));var BPromise=require(_0x1cc0('0x2'));var rs=require(_0x1cc0('0x3'));var fs=require('fs');var Redis=require(_0x1cc0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cc0('0x5'));var logger=require('../../config/logger')(_0x1cc0('0x6'));var config=require(_0x1cc0('0x7'));var jayson=require(_0x1cc0('0x8'));var client=jayson[_0x1cc0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25238b,_0x63b1e7,_0x388597){return new BPromise(function(_0x5d565f,_0x3a6fa2){return client['request'](_0x25238b,_0x388597)[_0x1cc0('0xa')](function(_0x13c88a){logger['info']('VtigerField,\x20%s,\x20%s',_0x63b1e7,_0x1cc0('0xb'));logger[_0x1cc0('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x63b1e7,_0x1cc0('0xb'),JSON[_0x1cc0('0xd')](_0x13c88a));if(_0x13c88a[_0x1cc0('0xe')]){if(_0x13c88a[_0x1cc0('0xe')][_0x1cc0('0xf')]===0x1f4){logger[_0x1cc0('0xe')]('VtigerField,\x20%s,\x20%s',_0x63b1e7,_0x13c88a[_0x1cc0('0xe')][_0x1cc0('0x10')]);return _0x3a6fa2(_0x13c88a[_0x1cc0('0xe')][_0x1cc0('0x10')]);}logger[_0x1cc0('0xe')]('VtigerField,\x20%s,\x20%s',_0x63b1e7,_0x13c88a[_0x1cc0('0xe')][_0x1cc0('0x10')]);return _0x5d565f(_0x13c88a[_0x1cc0('0xe')][_0x1cc0('0x10')]);}else{logger[_0x1cc0('0x11')](_0x1cc0('0x12'),_0x63b1e7,_0x1cc0('0xb'));_0x5d565f(_0x13c88a[_0x1cc0('0x13')][_0x1cc0('0x10')]);}})[_0x1cc0('0x14')](function(_0x58a94c){logger[_0x1cc0('0xe')](_0x1cc0('0x12'),_0x63b1e7,_0x58a94c);_0x3a6fa2(_0x58a94c);});});} \ No newline at end of file +var _0x4768=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x29ad8e,_0x3295f8){var _0x1cfa8d=function(_0x482118){while(--_0x482118){_0x29ad8e['push'](_0x29ad8e['shift']());}};_0x1cfa8d(++_0x3295f8);}(_0x4768,0x19f));var _0x8476=function(_0x251d15,_0x9a6392){_0x251d15=_0x251d15-0x0;var _0x3fa86e=_0x4768[_0x251d15];return _0x3fa86e;};'use strict';var _=require(_0x8476('0x0'));var util=require(_0x8476('0x1'));var moment=require('moment');var BPromise=require(_0x8476('0x2'));var rs=require(_0x8476('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8476('0x4'))['db'];var utils=require(_0x8476('0x5'));var logger=require(_0x8476('0x6'))(_0x8476('0x7'));var config=require(_0x8476('0x8'));var jayson=require(_0x8476('0x9'));var client=jayson['client'][_0x8476('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33cfee,_0x30c33a,_0x4f9e07){return new BPromise(function(_0x1f62db,_0xc2a12){return client[_0x8476('0xb')](_0x33cfee,_0x4f9e07)[_0x8476('0xc')](function(_0x1f6c5c){logger[_0x8476('0xd')]('VtigerField,\x20%s,\x20%s',_0x30c33a,_0x8476('0xe'));logger[_0x8476('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x30c33a,_0x8476('0xe'),JSON['stringify'](_0x1f6c5c));if(_0x1f6c5c['error']){if(_0x1f6c5c[_0x8476('0x10')][_0x8476('0x11')]===0x1f4){logger[_0x8476('0x10')](_0x8476('0x12'),_0x30c33a,_0x1f6c5c[_0x8476('0x10')][_0x8476('0x13')]);return _0xc2a12(_0x1f6c5c[_0x8476('0x10')][_0x8476('0x13')]);}logger[_0x8476('0x10')]('VtigerField,\x20%s,\x20%s',_0x30c33a,_0x1f6c5c[_0x8476('0x10')]['message']);return _0x1f62db(_0x1f6c5c[_0x8476('0x10')][_0x8476('0x13')]);}else{logger[_0x8476('0xd')](_0x8476('0x12'),_0x30c33a,_0x8476('0xe'));_0x1f62db(_0x1f6c5c['result'][_0x8476('0x13')]);}})[_0x8476('0x14')](function(_0x2b50d7){logger['error'](_0x8476('0x12'),_0x30c33a,_0x2b50d7);_0xc2a12(_0x2b50d7);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index e8cb2a1..7ba93cf 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 _0x2087=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2087,0xf3));var _0x7208=function(_0x3c3b01,_0xbaa847){_0x3c3b01=_0x3c3b01-0x0;var _0xda6617=_0x2087[_0x3c3b01];return _0xda6617;};'use strict';var multer=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var path=require(_0x7208('0x2'));var timeout=require(_0x7208('0x3'));var express=require('express');var router=express[_0x7208('0x4')]();var fs_extra=require(_0x7208('0x5'));var auth=require(_0x7208('0x6'));var interaction=require(_0x7208('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0x7208('0x8')]('/',auth['isAuthenticated'](),controller[_0x7208('0x9')]);router['get'](_0x7208('0xa'),auth[_0x7208('0xb')](),controller[_0x7208('0xc')]);router[_0x7208('0x8')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0xe')]);router['get'](_0x7208('0xf'),auth[_0x7208('0xb')](),controller[_0x7208('0x10')]);router[_0x7208('0x11')]('/',auth[_0x7208('0xb')](),controller[_0x7208('0x12')]);router['post'](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0x13')]);router[_0x7208('0x14')](_0x7208('0xa'),auth[_0x7208('0xb')](),controller['update']);router[_0x7208('0x15')](_0x7208('0xa'),auth[_0x7208('0xb')](),controller[_0x7208('0x16')]);module[_0x7208('0x17')]=router; \ No newline at end of file +var _0xf22d=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','multer','path','connect-timeout','express'];(function(_0x13fa67,_0x5aa1c7){var _0x200f70=function(_0x5baf4d){while(--_0x5baf4d){_0x13fa67['push'](_0x13fa67['shift']());}};_0x200f70(++_0x5aa1c7);}(_0xf22d,0x150));var _0xdf22=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0xf22d[_0x5a26f5];return _0x2e9ef7;};'use strict';var multer=require(_0xdf22('0x0'));var util=require('util');var path=require(_0xdf22('0x1'));var timeout=require(_0xdf22('0x2'));var express=require(_0xdf22('0x3'));var router=express['Router']();var fs_extra=require(_0xdf22('0x4'));var auth=require(_0xdf22('0x5'));var interaction=require(_0xdf22('0x6'));var config=require('../../config/environment');var controller=require(_0xdf22('0x7'));router[_0xdf22('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf22('0x9')]);router[_0xdf22('0x8')](_0xdf22('0xa'),auth[_0xdf22('0xb')](),controller[_0xdf22('0xc')]);router[_0xdf22('0x8')](_0xdf22('0xd'),auth['isAuthenticated'](),controller[_0xdf22('0xe')]);router[_0xdf22('0x8')](_0xdf22('0xf'),auth[_0xdf22('0xb')](),controller[_0xdf22('0x10')]);router[_0xdf22('0x11')]('/',auth[_0xdf22('0xb')](),controller[_0xdf22('0x12')]);router[_0xdf22('0x11')](_0xdf22('0xd'),auth[_0xdf22('0xb')](),controller['addConfiguration']);router[_0xdf22('0x13')](_0xdf22('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdf22('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index aad6c12..a929416 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 _0xe626=['username','remoteUri','password','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xe626,0x9d));var _0x6e62=function(_0x3db95e,_0xe88db5){_0x3db95e=_0x3db95e-0x0;var _0x5b9312=_0xe626[_0x3db95e];return _0x5b9312;};'use strict';var Sequelize=require(_0x6e62('0x0'));module[_0x6e62('0x1')]={'name':{'type':Sequelize[_0x6e62('0x2')]},'description':{'type':Sequelize[_0x6e62('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6e62('0x3')},'password':{'type':Sequelize[_0x6e62('0x2')]},'token':{'type':Sequelize[_0x6e62('0x2')]},'remoteUri':{'type':Sequelize[_0x6e62('0x2')],'unique':_0x6e62('0x4')},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':_0x6e62('0x5')},'serverUrl':{'type':Sequelize[_0x6e62('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6e62('0x6'),_0x6e62('0x7')),'defaultValue':_0x6e62('0x6')}}; \ No newline at end of file +var _0x6c45=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x125f8c,_0x424ff2){var _0xaaadba=function(_0x165e62){while(--_0x165e62){_0x125f8c['push'](_0x125f8c['shift']());}};_0xaaadba(++_0x424ff2);}(_0x6c45,0xb1));var _0x56c4=function(_0x1a10af,_0x5738c4){_0x1a10af=_0x1a10af-0x0;var _0x11203b=_0x6c45[_0x1a10af];return _0x11203b;};'use strict';var Sequelize=require(_0x56c4('0x0'));module[_0x56c4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x56c4('0x2')]},'username':{'type':Sequelize[_0x56c4('0x2')],'unique':_0x56c4('0x3')},'password':{'type':Sequelize[_0x56c4('0x2')]},'token':{'type':Sequelize[_0x56c4('0x2')]},'remoteUri':{'type':Sequelize[_0x56c4('0x2')],'unique':_0x56c4('0x4')},'authType':{'type':Sequelize[_0x56c4('0x5')](_0x56c4('0x6'),_0x56c4('0x7')),'defaultValue':_0x56c4('0x6')},'serverUrl':{'type':Sequelize[_0x56c4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x56c4('0x5')](_0x56c4('0x8'),_0x56c4('0x9')),'defaultValue':_0x56c4('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index b2b5aa8..9bf0824 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 _0xa74f=['Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskAccount','findAll','rows','params','length','find','catch','create','body','findOne','getConfigurations','addConfiguration'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xa74f,0x9a));var _0xfa74=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xa74f[_0x249e96];return _0x17444c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfa74('0x16'));function respondWithStatusCode(_0x998585,_0x78173f){_0x78173f=_0x78173f||0xcc;return function(_0x278e8b){if(_0x278e8b){return _0x998585['sendStatus'](_0x78173f);}return _0x998585[_0xfa74('0x17')](_0x78173f)[_0xfa74('0x18')]();};}function respondWithResult(_0x3eb49b,_0x3947ca){_0x3947ca=_0x3947ca||0xc8;return function(_0xe3c97e){if(_0xe3c97e){return _0x3eb49b['status'](_0x3947ca)[_0xfa74('0x19')](_0xe3c97e);}};}function respondWithFilteredResult(_0x13d911,_0x947da6){return function(_0x1f1de0){if(_0x1f1de0){var _0x3867f8=typeof _0x947da6[_0xfa74('0x1a')]===_0xfa74('0x1b')&&typeof _0x947da6['limit']===_0xfa74('0x1b');var _0xe0e33d=_0x1f1de0['count'];var _0x4928b6=_0x3867f8?0x0:_0x947da6[_0xfa74('0x1a')];var _0x25a36b=_0x3867f8?_0x1f1de0[_0xfa74('0x1c')]:_0x947da6['offset']+_0x947da6[_0xfa74('0x1d')];var _0x2edebb;if(_0x25a36b>=_0xe0e33d){_0x25a36b=_0xe0e33d;_0x2edebb=0xc8;}else{_0x2edebb=0xce;}_0x13d911[_0xfa74('0x17')](_0x2edebb);return _0x13d911['set'](_0xfa74('0x1e'),_0x4928b6+'-'+_0x25a36b+'/'+_0xe0e33d)[_0xfa74('0x19')](_0x1f1de0);}return null;};}function patchUpdates(_0x2e6c33){return function(_0x4a5ee4){try{jsonpatch['apply'](_0x4a5ee4,_0x2e6c33,!![]);}catch(_0x100851){return BPromise[_0xfa74('0x1f')](_0x100851);}return _0x4a5ee4[_0xfa74('0x20')]();};}function saveUpdates(_0xeaaa19,_0x1a453d){return function(_0x554e0e){if(_0x554e0e){return _0x554e0e['update'](_0xeaaa19)[_0xfa74('0x21')](function(_0x5aa8a7){return _0x5aa8a7;});}return null;};}function removeEntity(_0x48cbd3,_0x529810){return function(_0x42c439){if(_0x42c439){return _0x42c439[_0xfa74('0x22')]()[_0xfa74('0x21')](function(){_0x48cbd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9eb68c,_0xeb6c11){return function(_0x5ed1c8){if(!_0x5ed1c8){_0x9eb68c[_0xfa74('0x23')](0x194);}return _0x5ed1c8;};}function handleError(_0x5d3b26,_0x1a8cf7){_0x1a8cf7=_0x1a8cf7||0x1f4;return function(_0x153b2a){logger['error'](_0x153b2a[_0xfa74('0x24')]);if(_0x153b2a[_0xfa74('0x25')]){delete _0x153b2a[_0xfa74('0x25')];}_0x5d3b26[_0xfa74('0x17')](_0x1a8cf7)['send'](_0x153b2a);};}exports[_0xfa74('0x26')]=function(_0x2f7cd7,_0x204e01){var _0x57d90e={},_0x4d4bed={},_0x1322a4={'count':0x0,'rows':[]};var _0x8b706e=_['map'](db['ZendeskAccount'][_0xfa74('0x27')],function(_0x564060){return{'name':_0x564060[_0xfa74('0x28')],'type':_0x564060['type'][_0xfa74('0x29')]};});_0x4d4bed[_0xfa74('0x2a')]=_[_0xfa74('0x2b')](_0x8b706e,_0xfa74('0x25'));_0x4d4bed['query']=_[_0xfa74('0x2c')](_0x2f7cd7[_0xfa74('0x2d')]);_0x4d4bed[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x4d4bed[_0xfa74('0x2a')],_0x4d4bed[_0xfa74('0x2d')]);_0x57d90e[_0xfa74('0x30')]=_['intersection'](_0x4d4bed[_0xfa74('0x2a')],qs['fields'](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x57d90e[_0xfa74('0x30')]=_0x57d90e[_0xfa74('0x30')]['length']?_0x57d90e['attributes']:_0x4d4bed[_0xfa74('0x2a')];if(!_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x32')](_0xfa74('0x33'))){_0x57d90e['limit']=qs[_0xfa74('0x1d')](_0x2f7cd7[_0xfa74('0x2d')]['limit']);_0x57d90e['offset']=qs['offset'](_0x2f7cd7['query']['offset']);}_0x57d90e[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x57d90e[_0xfa74('0x36')]=qs[_0xfa74('0x2e')](_[_0xfa74('0x37')](_0x2f7cd7[_0xfa74('0x2d')],_0x4d4bed[_0xfa74('0x2e')]),_0x8b706e);if(_0x2f7cd7['query'][_0xfa74('0x38')]){_0x57d90e[_0xfa74('0x36')]=_[_0xfa74('0x39')](_0x57d90e[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x8b706e,function(_0x186126){if(_0x186126['type']!==_0xfa74('0x3a')){var _0x1f0806={};_0x1f0806[_0x186126[_0xfa74('0x25')]]={'$like':'%'+_0x2f7cd7[_0xfa74('0x2d')]['filter']+'%'};return _0x1f0806;}})});}_0x57d90e=_[_0xfa74('0x39')]({},_0x57d90e,_0x2f7cd7[_0xfa74('0x3b')]);var _0xe8491b={'where':_0x57d90e[_0xfa74('0x36')]};return db['ZendeskAccount'][_0xfa74('0x1c')](_0xe8491b)[_0xfa74('0x21')](function(_0x3dacc2){_0x1322a4['count']=_0x3dacc2;if(_0x2f7cd7['query'][_0xfa74('0x3c')]){_0x57d90e[_0xfa74('0x3d')]=[{'all':!![]}];}return db[_0xfa74('0x3e')][_0xfa74('0x3f')](_0x57d90e);})['then'](function(_0x1ab026){_0x1322a4[_0xfa74('0x40')]=_0x1ab026;return _0x1322a4;})['then'](respondWithFilteredResult(_0x204e01,_0x57d90e))['catch'](handleError(_0x204e01,null));};exports['show']=function(_0x492c7d,_0x95c891){var _0x3098ca={'raw':![],'where':{'id':_0x492c7d[_0xfa74('0x41')]['id']}},_0x3f92b2={};_0x3f92b2[_0xfa74('0x2a')]=_[_0xfa74('0x2c')](db[_0xfa74('0x3e')]['rawAttributes']);_0x3f92b2[_0xfa74('0x2d')]=_[_0xfa74('0x2c')](_0x492c7d[_0xfa74('0x2d')]);_0x3f92b2[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x3f92b2['model'],_0x3f92b2[_0xfa74('0x2d')]);_0x3098ca[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x3f92b2[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x492c7d[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x3098ca[_0xfa74('0x30')]=_0x3098ca[_0xfa74('0x30')][_0xfa74('0x42')]?_0x3098ca['attributes']:_0x3f92b2[_0xfa74('0x2a')];if(_0x492c7d['query'][_0xfa74('0x3c')]){_0x3098ca[_0xfa74('0x3d')]=[{'all':!![]}];}_0x3098ca=_[_0xfa74('0x39')]({},_0x3098ca,_0x492c7d[_0xfa74('0x3b')]);return db['ZendeskAccount'][_0xfa74('0x43')](_0x3098ca)[_0xfa74('0x21')](handleEntityNotFound(_0x95c891,null))['then'](respondWithResult(_0x95c891,null))[_0xfa74('0x44')](handleError(_0x95c891,null));};exports[_0xfa74('0x45')]=function(_0x5cbb70,_0x2be89f){return db[_0xfa74('0x3e')][_0xfa74('0x45')](_0x5cbb70[_0xfa74('0x46')],{})[_0xfa74('0x21')](respondWithResult(_0x2be89f,0xc9))['catch'](handleError(_0x2be89f,null));};exports['update']=function(_0x36f6ca,_0x91df44){if(_0x36f6ca['body']['id']){delete _0x36f6ca[_0xfa74('0x46')]['id'];}return db[_0xfa74('0x3e')][_0xfa74('0x43')]({'where':{'id':_0x36f6ca['params']['id']}})['then'](handleEntityNotFound(_0x91df44,null))[_0xfa74('0x21')](saveUpdates(_0x36f6ca[_0xfa74('0x46')],null))[_0xfa74('0x21')](respondWithResult(_0x91df44,null))[_0xfa74('0x44')](handleError(_0x91df44,null));};exports[_0xfa74('0x22')]=function(_0x3cb23d,_0x2d217d){return db[_0xfa74('0x3e')]['find']({'where':{'id':_0x3cb23d[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2d217d,null))[_0xfa74('0x21')](removeEntity(_0x2d217d,null))[_0xfa74('0x44')](handleError(_0x2d217d,null));};exports['getConfigurations']=function(_0x4ec218,_0x3146de,_0x5b3404){var _0x152eaa={};var _0x221dc7={};var _0x427469;var _0x33e31e;return db[_0xfa74('0x3e')][_0xfa74('0x47')]({'where':{'id':_0x4ec218[_0xfa74('0x41')]['id']}})['then'](handleEntityNotFound(_0x3146de,null))[_0xfa74('0x21')](function(_0x4bcee3){if(_0x4bcee3){_0x427469=_0x4bcee3;_0x221dc7[_0xfa74('0x2a')]=_['keys'](db['ZendeskConfiguration'][_0xfa74('0x27')]);_0x221dc7[_0xfa74('0x2d')]=_['keys'](_0x4ec218['query']);_0x221dc7[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],_0x221dc7[_0xfa74('0x2d')]);_0x152eaa[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x152eaa['attributes']=_0x152eaa[_0xfa74('0x30')][_0xfa74('0x42')]?_0x152eaa['attributes']:_0x221dc7['model'];_0x152eaa[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x152eaa[_0xfa74('0x36')]=qs['filters'](_[_0xfa74('0x37')](_0x4ec218['query'],_0x221dc7[_0xfa74('0x2e')]));if(_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]){_0x152eaa['where']=_['merge'](_0x152eaa[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x152eaa[_0xfa74('0x30')],function(_0x1b3484){var _0x53eca4={};_0x53eca4[_0x1b3484]={'$like':'%'+_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]+'%'};return _0x53eca4;})});}_0x152eaa=_['merge']({},_0x152eaa,_0x4ec218[_0xfa74('0x3b')]);return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x1681e7){if(_0x1681e7){_0x33e31e=_0x1681e7['length'];if(!_0x4ec218[_0xfa74('0x2d')]['hasOwnProperty'](_0xfa74('0x33'))){_0x152eaa[_0xfa74('0x1d')]=qs[_0xfa74('0x1d')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1d')]);_0x152eaa[_0xfa74('0x1a')]=qs[_0xfa74('0x1a')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1a')]);}return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x930728){if(_0x930728){return _0x930728?{'count':_0x33e31e,'rows':_0x930728}:null;}})[_0xfa74('0x21')](respondWithResult(_0x3146de,null))[_0xfa74('0x44')](handleError(_0x3146de,null));};exports[_0xfa74('0x49')]=function(_0x512b58,_0x2361d2,_0x3b0dd5){if(_0x512b58['body']['id']){delete _0x512b58['body']['id'];}return db[_0xfa74('0x3e')]['findOne']({'where':{'id':_0x512b58[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2361d2,null))[_0xfa74('0x21')](function(_0x529921){if(_0x529921){_0x512b58[_0xfa74('0x46')]['AccountId']=_0x529921['id'];_0x512b58['body'][_0xfa74('0x4a')]=integrations[_0xfa74('0x4b')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58[_0xfa74('0x46')][_0xfa74('0x4d')]);_0x512b58[_0xfa74('0x46')][_0xfa74('0x4e')]=integrations[_0xfa74('0x4f')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58['body'][_0xfa74('0x4d')]);return db['ZendeskConfiguration'][_0xfa74('0x45')](_0x512b58[_0xfa74('0x46')],{'include':[{'model':db[_0xfa74('0x50')],'as':'Subjects'},{'model':db[_0xfa74('0x50')],'as':_0xfa74('0x4e')}]});}return null;})[_0xfa74('0x21')](respondWithResult(_0x2361d2,null))['catch'](handleError(_0x2361d2,null));};exports[_0xfa74('0x51')]=function(_0x34e772,_0x474462,_0x1105e5){var _0x10e5f5='';return db['ZendeskAccount'][_0xfa74('0x47')]({'where':{'id':_0x34e772[_0xfa74('0x41')]['id']},'attributes':['id',_0xfa74('0x52'),_0xfa74('0x53'),_0xfa74('0x54'),_0xfa74('0x55'),_0xfa74('0x56')]})[_0xfa74('0x21')](handleEntityNotFound(_0x474462,null))[_0xfa74('0x21')](function(_0x3526d7){if(_0x3526d7){_0x10e5f5=_0x3526d7[_0xfa74('0x56')];var _0x30aec7=_0x10e5f5['slice'](-0x1);if(_0x30aec7==='/'){_0x10e5f5=_0x10e5f5[_0xfa74('0x57')](0x0,_0x10e5f5[_0xfa74('0x58')](_0x30aec7));}var _0xdffc88={'method':_0xfa74('0x59'),'uri':util[_0xfa74('0x5a')](_0xfa74('0x5b'),_0x10e5f5,_0xfa74('0x5c')),'json':!![]};switch(_0x3526d7[_0xfa74('0x55')]){case'password':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util[_0xfa74('0x5a')](_0xfa74('0x5e'),new Buffer(util[_0xfa74('0x5a')]('%s:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x53')]))[_0xfa74('0x5f')](_0xfa74('0x60')))};break;case'token':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xfa74('0x5a')]('%s/token:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x54')]))['toString']('base64'))};break;default:throw new db[(_0xfa74('0x61'))][(_0xfa74('0x62'))](_0xfa74('0x63'));}return rp(_0xdffc88);}})[_0xfa74('0x21')](function(_0x4f1acc){if(_0x4f1acc){var _0x5acb9b=['subject',_0xfa74('0x64'),_0xfa74('0x65'),_0xfa74('0x66')];_[_0xfa74('0x67')](_0x4f1acc[_0xfa74('0x5c')],function(_0x52e8ac){return _0x5acb9b[_0xfa74('0x68')](_0x52e8ac[_0xfa74('0x4d')]);});return{'count':_0x4f1acc[_0xfa74('0x5c')][_0xfa74('0x42')],'rows':_[_0xfa74('0x2b')](_0x4f1acc[_0xfa74('0x5c')],function(_0x358db2){return{'id':_0x358db2['id'],'name':_0x358db2[_0xfa74('0x69')]>0x7?_0x358db2[_0xfa74('0x6a')]:_0x358db2['type'],'custom':_0x358db2['position']>0x7?!![]:![],'options':_0x358db2['system_field_options']?_0x358db2[_0xfa74('0x6b')]:_0x358db2[_0xfa74('0x6c')]?_0x358db2[_0xfa74('0x6c')]:[]};})};}})[_0xfa74('0x21')](respondWithResult(_0x474462,null))[_0xfa74('0x44')](function(_0x533649){var _0x3e4323=_0x34e772[_0xfa74('0x2d')]['test']?0x1f4:_0x533649[_0xfa74('0x6d')]||0x1f4;logger['error'](_0xfa74('0x6e'),_0xfa74('0x51'),_0x3e4323,JSON[_0xfa74('0x6f')](_0x533649));delete _0x533649[_0xfa74('0x25')];if(_0x3e4323===0x191){_0x3e4323=0x190;}_0x474462[_0xfa74('0x17')](_0x3e4323)[_0xfa74('0x70')](_0x34e772[_0xfa74('0x2d')][_0xfa74('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x533649['statusCode']}:_0x533649);});}; \ No newline at end of file +var _0xeb74=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','AccountId','channel','Descriptions','ZendeskField','Subjects','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','Sequelize','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xeb74,0xe3));var _0x4eb7=function(_0x49f34c,_0xd56b37){_0x49f34c=_0x49f34c-0x0;var _0x10253d=_0xeb74[_0x49f34c];return _0x10253d;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];var integrations=require(_0x4eb7('0x19'));function respondWithStatusCode(_0x4194e1,_0x3c9f45){_0x3c9f45=_0x3c9f45||0xcc;return function(_0x4c27a4){if(_0x4c27a4){return _0x4194e1['sendStatus'](_0x3c9f45);}return _0x4194e1['status'](_0x3c9f45)[_0x4eb7('0x1a')]();};}function respondWithResult(_0x51f09d,_0x84c68b){_0x84c68b=_0x84c68b||0xc8;return function(_0x119afa){if(_0x119afa){return _0x51f09d[_0x4eb7('0x1b')](_0x84c68b)[_0x4eb7('0x1c')](_0x119afa);}};}function respondWithFilteredResult(_0x5d6d5,_0x21433d){return function(_0x11674f){if(_0x11674f){var _0x76988=typeof _0x21433d[_0x4eb7('0x1d')]===_0x4eb7('0x1e')&&typeof _0x21433d['limit']===_0x4eb7('0x1e');var _0x11ac9f=_0x11674f[_0x4eb7('0x1f')];var _0xf14478=_0x76988?0x0:_0x21433d[_0x4eb7('0x1d')];var _0x44f1b9=_0x76988?_0x11674f[_0x4eb7('0x1f')]:_0x21433d[_0x4eb7('0x1d')]+_0x21433d['limit'];var _0x3cf53a;if(_0x44f1b9>=_0x11ac9f){_0x44f1b9=_0x11ac9f;_0x3cf53a=0xc8;}else{_0x3cf53a=0xce;}_0x5d6d5[_0x4eb7('0x1b')](_0x3cf53a);return _0x5d6d5[_0x4eb7('0x20')](_0x4eb7('0x21'),_0xf14478+'-'+_0x44f1b9+'/'+_0x11ac9f)[_0x4eb7('0x1c')](_0x11674f);}return null;};}function patchUpdates(_0x2efd67){return function(_0x11fb0a){try{jsonpatch['apply'](_0x11fb0a,_0x2efd67,!![]);}catch(_0x214a28){return BPromise[_0x4eb7('0x22')](_0x214a28);}return _0x11fb0a[_0x4eb7('0x23')]();};}function saveUpdates(_0x164515,_0x14a7be){return function(_0x1b4640){if(_0x1b4640){return _0x1b4640[_0x4eb7('0x24')](_0x164515)[_0x4eb7('0x25')](function(_0x1a2b8b){return _0x1a2b8b;});}return null;};}function removeEntity(_0x13e871,_0x4de2d9){return function(_0x3e72cd){if(_0x3e72cd){return _0x3e72cd[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x13e871[_0x4eb7('0x1b')](0xcc)[_0x4eb7('0x1a')]();});}};}function handleEntityNotFound(_0x25eb74,_0x365060){return function(_0xe9db8){if(!_0xe9db8){_0x25eb74[_0x4eb7('0x27')](0x194);}return _0xe9db8;};}function handleError(_0x248759,_0xf83c11){_0xf83c11=_0xf83c11||0x1f4;return function(_0x2984b2){logger[_0x4eb7('0x28')](_0x2984b2[_0x4eb7('0x29')]);if(_0x2984b2[_0x4eb7('0x2a')]){delete _0x2984b2[_0x4eb7('0x2a')];}_0x248759[_0x4eb7('0x1b')](_0xf83c11)[_0x4eb7('0x2b')](_0x2984b2);};}exports[_0x4eb7('0x2c')]=function(_0x28fda8,_0x114c68){var _0x17030a={},_0x3ed224={},_0x50209d={'count':0x0,'rows':[]};var _0x34515c=_['map'](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')],function(_0xc5aa21){return{'name':_0xc5aa21[_0x4eb7('0x2f')],'type':_0xc5aa21[_0x4eb7('0x30')][_0x4eb7('0x31')]};});_0x3ed224[_0x4eb7('0x32')]=_[_0x4eb7('0x33')](_0x34515c,_0x4eb7('0x2a'));_0x3ed224['query']=_[_0x4eb7('0x34')](_0x28fda8['query']);_0x3ed224[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x3ed224['model'],_0x3ed224['query']);_0x17030a[_0x4eb7('0x37')]=_[_0x4eb7('0x36')](_0x3ed224[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x28fda8['query'][_0x4eb7('0x38')]));_0x17030a[_0x4eb7('0x37')]=_0x17030a[_0x4eb7('0x37')][_0x4eb7('0x39')]?_0x17030a[_0x4eb7('0x37')]:_0x3ed224['model'];if(!_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3b')](_0x4eb7('0x3c'))){_0x17030a['limit']=qs[_0x4eb7('0x3d')](_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3d')]);_0x17030a['offset']=qs[_0x4eb7('0x1d')](_0x28fda8['query'][_0x4eb7('0x1d')]);}_0x17030a[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x28fda8[_0x4eb7('0x3a')]['sort']);_0x17030a[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_[_0x4eb7('0x41')](_0x28fda8[_0x4eb7('0x3a')],_0x3ed224['filters']),_0x34515c);if(_0x28fda8['query']['filter']){_0x17030a[_0x4eb7('0x40')]=_[_0x4eb7('0x42')](_0x17030a[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x34515c,function(_0x210c20){if(_0x210c20[_0x4eb7('0x30')]!==_0x4eb7('0x43')){var _0x20d2bc={};_0x20d2bc[_0x210c20[_0x4eb7('0x2a')]]={'$like':'%'+_0x28fda8[_0x4eb7('0x3a')]['filter']+'%'};return _0x20d2bc;}})});}_0x17030a=_[_0x4eb7('0x42')]({},_0x17030a,_0x28fda8[_0x4eb7('0x44')]);var _0xe04d76={'where':_0x17030a[_0x4eb7('0x40')]};return db[_0x4eb7('0x2d')][_0x4eb7('0x1f')](_0xe04d76)[_0x4eb7('0x25')](function(_0xef998f){_0x50209d[_0x4eb7('0x1f')]=_0xef998f;if(_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x17030a[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x2d')][_0x4eb7('0x47')](_0x17030a);})[_0x4eb7('0x25')](function(_0x5b819f){_0x50209d[_0x4eb7('0x48')]=_0x5b819f;return _0x50209d;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x114c68,_0x17030a))[_0x4eb7('0x49')](handleError(_0x114c68,null));};exports[_0x4eb7('0x4a')]=function(_0x5eff9e,_0x2fd5c2){var _0x2df542={'raw':![],'where':{'id':_0x5eff9e[_0x4eb7('0x4b')]['id']}},_0x482357={};_0x482357[_0x4eb7('0x32')]=_[_0x4eb7('0x34')](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')]);_0x482357[_0x4eb7('0x3a')]=_['keys'](_0x5eff9e[_0x4eb7('0x3a')]);_0x482357['filters']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],_0x482357[_0x4eb7('0x3a')]);_0x2df542['attributes']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x5eff9e[_0x4eb7('0x3a')]['fields']));_0x2df542[_0x4eb7('0x37')]=_0x2df542['attributes'][_0x4eb7('0x39')]?_0x2df542[_0x4eb7('0x37')]:_0x482357[_0x4eb7('0x32')];if(_0x5eff9e[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x2df542['include']=[{'all':!![]}];}_0x2df542=_['merge']({},_0x2df542,_0x5eff9e[_0x4eb7('0x44')]);return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')](_0x2df542)[_0x4eb7('0x25')](handleEntityNotFound(_0x2fd5c2,null))[_0x4eb7('0x25')](respondWithResult(_0x2fd5c2,null))['catch'](handleError(_0x2fd5c2,null));};exports[_0x4eb7('0x4d')]=function(_0x104284,_0x56609e){return db[_0x4eb7('0x2d')][_0x4eb7('0x4d')](_0x104284['body'],{})[_0x4eb7('0x25')](respondWithResult(_0x56609e,0xc9))[_0x4eb7('0x49')](handleError(_0x56609e,null));};exports[_0x4eb7('0x24')]=function(_0x5774d5,_0x130113){if(_0x5774d5['body']['id']){delete _0x5774d5['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x5774d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x130113,null))[_0x4eb7('0x25')](saveUpdates(_0x5774d5[_0x4eb7('0x4e')],null))[_0x4eb7('0x25')](respondWithResult(_0x130113,null))[_0x4eb7('0x49')](handleError(_0x130113,null));};exports[_0x4eb7('0x26')]=function(_0x23c0d5,_0x42a1d9){return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x23c0d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x42a1d9,null))[_0x4eb7('0x25')](removeEntity(_0x42a1d9,null))[_0x4eb7('0x49')](handleError(_0x42a1d9,null));};exports[_0x4eb7('0x4f')]=function(_0x1411c9,_0x11cc3d,_0x4cfba8){var _0x3f3d41={};var _0x550888={};var _0x4db5f7;var _0x3f3a5f;return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x1411c9[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x11cc3d,null))['then'](function(_0x4e3163){if(_0x4e3163){_0x4db5f7=_0x4e3163;_0x550888[_0x4eb7('0x32')]=_['keys'](db[_0x4eb7('0x51')][_0x4eb7('0x2e')]);_0x550888[_0x4eb7('0x3a')]=_[_0x4eb7('0x34')](_0x1411c9['query']);_0x550888[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],_0x550888[_0x4eb7('0x3a')]);_0x3f3d41['attributes']=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],qs['fields'](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x38')]));_0x3f3d41['attributes']=_0x3f3d41[_0x4eb7('0x37')]['length']?_0x3f3d41[_0x4eb7('0x37')]:_0x550888['model'];_0x3f3d41[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x3f')]);_0x3f3d41[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_['pick'](_0x1411c9['query'],_0x550888[_0x4eb7('0x35')]));if(_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]){_0x3f3d41[_0x4eb7('0x40')]=_['merge'](_0x3f3d41[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x3f3d41['attributes'],function(_0x452f21){var _0xba9272={};_0xba9272[_0x452f21]={'$like':'%'+_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]+'%'};return _0xba9272;})});}_0x3f3d41=_[_0x4eb7('0x42')]({},_0x3f3d41,_0x1411c9[_0x4eb7('0x44')]);return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})['then'](function(_0x5839f1){if(_0x5839f1){_0x3f3a5f=_0x5839f1[_0x4eb7('0x39')];if(!_0x1411c9['query'][_0x4eb7('0x3b')]('nolimit')){_0x3f3d41[_0x4eb7('0x3d')]=qs['limit'](_0x1411c9['query'][_0x4eb7('0x3d')]);_0x3f3d41[_0x4eb7('0x1d')]=qs['offset'](_0x1411c9[_0x4eb7('0x3a')]['offset']);}return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})[_0x4eb7('0x25')](function(_0x4ab8e8){if(_0x4ab8e8){return _0x4ab8e8?{'count':_0x3f3a5f,'rows':_0x4ab8e8}:null;}})[_0x4eb7('0x25')](respondWithResult(_0x11cc3d,null))[_0x4eb7('0x49')](handleError(_0x11cc3d,null));};exports['addConfiguration']=function(_0x4b492a,_0x5c8d45,_0x59e2f2){if(_0x4b492a[_0x4eb7('0x4e')]['id']){delete _0x4b492a['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x4b492a['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5c8d45,null))[_0x4eb7('0x25')](function(_0x463ab6){if(_0x463ab6){_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x53')]=_0x463ab6['id'];_0x4b492a[_0x4eb7('0x4e')]['Subjects']=integrations['getSubjects'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x55')]=integrations['getDescriptions'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);return db[_0x4eb7('0x51')][_0x4eb7('0x4d')](_0x4b492a['body'],{'include':[{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x57')},{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x55')}]});}return null;})['then'](respondWithResult(_0x5c8d45,null))['catch'](handleError(_0x5c8d45,null));};exports[_0x4eb7('0x58')]=function(_0x3883f3,_0x4e8125,_0x1911ad){var _0x4b698b='';return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x3883f3[_0x4eb7('0x4b')]['id']},'attributes':['id',_0x4eb7('0x59'),'password',_0x4eb7('0x5a'),_0x4eb7('0x5b'),_0x4eb7('0x5c')]})[_0x4eb7('0x25')](handleEntityNotFound(_0x4e8125,null))[_0x4eb7('0x25')](function(_0x3271d0){if(_0x3271d0){_0x4b698b=_0x3271d0[_0x4eb7('0x5c')];var _0x232242=_0x4b698b[_0x4eb7('0x5d')](-0x1);if(_0x232242==='/'){_0x4b698b=_0x4b698b[_0x4eb7('0x5e')](0x0,_0x4b698b[_0x4eb7('0x5f')](_0x232242));}var _0x713b0a={'method':_0x4eb7('0x60'),'uri':util[_0x4eb7('0x61')](_0x4eb7('0x62'),_0x4b698b,_0x4eb7('0x63')),'json':!![]};switch(_0x3271d0[_0x4eb7('0x5b')]){case _0x4eb7('0x64'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x66'),_0x3271d0[_0x4eb7('0x59')],_0x3271d0[_0x4eb7('0x64')]))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;case _0x4eb7('0x5a'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format'](_0x4eb7('0x69'),new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x6a'),_0x3271d0['username'],_0x3271d0['token']))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;default:throw new db[(_0x4eb7('0x6b'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x713b0a);}})[_0x4eb7('0x25')](function(_0x1a1525){if(_0x1a1525){var _0x4778f9=[_0x4eb7('0x6c'),_0x4eb7('0x6d'),_0x4eb7('0x6e'),_0x4eb7('0x6f')];_[_0x4eb7('0x70')](_0x1a1525[_0x4eb7('0x63')],function(_0x2e531e){return _0x4778f9[_0x4eb7('0x71')](_0x2e531e[_0x4eb7('0x30')]);});return{'count':_0x1a1525['ticket_fields']['length'],'rows':_[_0x4eb7('0x33')](_0x1a1525[_0x4eb7('0x63')],function(_0x14648d){return{'id':_0x14648d['id'],'name':_0x14648d[_0x4eb7('0x72')]>0x7?_0x14648d[_0x4eb7('0x73')]:_0x14648d[_0x4eb7('0x30')],'custom':_0x14648d['position']>0x7?!![]:![],'options':_0x14648d['system_field_options']?_0x14648d[_0x4eb7('0x74')]:_0x14648d[_0x4eb7('0x75')]?_0x14648d[_0x4eb7('0x75')]:[]};})};}})[_0x4eb7('0x25')](respondWithResult(_0x4e8125,null))[_0x4eb7('0x49')](function(_0x2480ed){var _0x13f574=_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?0x1f4:_0x2480ed[_0x4eb7('0x77')]||0x1f4;logger[_0x4eb7('0x28')](_0x4eb7('0x78'),_0x4eb7('0x58'),_0x13f574,JSON[_0x4eb7('0x79')](_0x2480ed));delete _0x2480ed['name'];if(_0x13f574===0x191){_0x13f574=0x190;}_0x4e8125[_0x4eb7('0x1b')](_0x13f574)[_0x4eb7('0x2b')](_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x2480ed[_0x4eb7('0x77')]}:_0x2480ed);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index a37e7d8..151ec90 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 _0x8706=['api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x3a691d,_0x269909){var _0x57ccf4=function(_0x177c6d){while(--_0x177c6d){_0x3a691d['push'](_0x3a691d['shift']());}};_0x57ccf4(++_0x269909);}(_0x8706,0xda));var _0x6870=function(_0x32e6b9,_0x1ba001){_0x32e6b9=_0x32e6b9-0x0;var _0xd18132=_0x8706[_0x32e6b9];return _0xd18132;};'use strict';var _=require(_0x6870('0x0'));var util=require(_0x6870('0x1'));var logger=require(_0x6870('0x2'))(_0x6870('0x3'));var moment=require(_0x6870('0x4'));var BPromise=require(_0x6870('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6870('0x6'));var rimraf=require(_0x6870('0x7'));var config=require(_0x6870('0x8'));var attributes=require(_0x6870('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x6870('0xa')]=function(_0x45d068,_0x3d4a67){return _0x45d068['define'](_0x6870('0xb'),attributes,{'tableName':_0x6870('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9731=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9731,0xeb));var _0x1973=function(_0x3d5e27,_0x23565f){_0x3d5e27=_0x3d5e27-0x0;var _0x21cc29=_0x9731[_0x3d5e27];return _0x21cc29;};'use strict';var _=require(_0x1973('0x0'));var util=require(_0x1973('0x1'));var logger=require(_0x1973('0x2'))(_0x1973('0x3'));var moment=require(_0x1973('0x4'));var BPromise=require(_0x1973('0x5'));var rp=require(_0x1973('0x6'));var fs=require('fs');var path=require(_0x1973('0x7'));var rimraf=require(_0x1973('0x8'));var config=require(_0x1973('0x9'));var attributes=require(_0x1973('0xa'));var integrations=require(_0x1973('0xb'));module[_0x1973('0xc')]=function(_0x572618,_0x2eace9){return _0x572618[_0x1973('0xd')](_0x1973('0xe'),attributes,{'tableName':_0x1973('0xf'),'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 80b77bd..468e4cf 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 _0x5d08=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','ZendeskAccount,\x20%s,\x20%s','result','GetZendeskAccount','ZendeskAccount','options','limit','include','model','map','attributes','stringify','catch','ShowZendeskAccount','find','raw','where','lodash'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5d08,0x1e0));var _0x85d0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5d08[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x85d0('0x0'));var util=require(_0x85d0('0x1'));var moment=require(_0x85d0('0x2'));var BPromise=require('bluebird');var rs=require(_0x85d0('0x3'));var fs=require('fs');var Redis=require(_0x85d0('0x4'));var db=require(_0x85d0('0x5'))['db'];var utils=require(_0x85d0('0x6'));var logger=require(_0x85d0('0x7'))(_0x85d0('0x8'));var config=require(_0x85d0('0x9'));var jayson=require(_0x85d0('0xa'));var client=jayson[_0x85d0('0xb')][_0x85d0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f4663,_0x23c2ba,_0x2e4326){return new BPromise(function(_0x306803,_0x3c6270){return client[_0x85d0('0xd')](_0x5f4663,_0x2e4326)[_0x85d0('0xe')](function(_0xd17356){logger[_0x85d0('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x23c2ba,_0x85d0('0x10'));logger[_0x85d0('0x11')](_0x85d0('0x12'),_0x23c2ba,_0x85d0('0x10'),JSON['stringify'](_0xd17356));if(_0xd17356[_0x85d0('0x13')]){if(_0xd17356['error']['code']===0x1f4){logger[_0x85d0('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x23c2ba,_0xd17356[_0x85d0('0x13')][_0x85d0('0x14')]);return _0x3c6270(_0xd17356['error'][_0x85d0('0x14')]);}logger[_0x85d0('0x13')](_0x85d0('0x15'),_0x23c2ba,_0xd17356[_0x85d0('0x13')][_0x85d0('0x14')]);return _0x306803(_0xd17356[_0x85d0('0x13')][_0x85d0('0x14')]);}else{logger[_0x85d0('0xf')](_0x85d0('0x15'),_0x23c2ba,_0x85d0('0x10'));_0x306803(_0xd17356[_0x85d0('0x16')][_0x85d0('0x14')]);}})['catch'](function(_0x4539e9){logger[_0x85d0('0x13')](_0x85d0('0x15'),_0x23c2ba,_0x4539e9);_0x3c6270(_0x4539e9);});});}exports[_0x85d0('0x17')]=function(_0x2df1b6){var _0x1a5c49=this;return new Promise(function(_0x9d880,_0x196537){return db[_0x85d0('0x18')]['findAll']({'raw':_0x2df1b6[_0x85d0('0x19')]?_0x2df1b6['options']['raw']===undefined?!![]:![]:!![],'where':_0x2df1b6[_0x85d0('0x19')]?_0x2df1b6[_0x85d0('0x19')]['where']||null:null,'attributes':_0x2df1b6[_0x85d0('0x19')]?_0x2df1b6[_0x85d0('0x19')]['attributes']||null:null,'limit':_0x2df1b6[_0x85d0('0x19')]?_0x2df1b6[_0x85d0('0x19')][_0x85d0('0x1a')]||null:null,'include':_0x2df1b6['options']?_0x2df1b6[_0x85d0('0x19')][_0x85d0('0x1b')]?_['map'](_0x2df1b6[_0x85d0('0x19')]['include'],function(_0x56fcd5){return{'model':db[_0x56fcd5[_0x85d0('0x1c')]],'as':_0x56fcd5['as'],'attributes':_0x56fcd5['attributes'],'include':_0x56fcd5[_0x85d0('0x1b')]?_[_0x85d0('0x1d')](_0x56fcd5[_0x85d0('0x1b')],function(_0x26eb5f){return{'model':db[_0x26eb5f[_0x85d0('0x1c')]],'as':_0x26eb5f['as'],'attributes':_0x26eb5f[_0x85d0('0x1e')],'include':_0x26eb5f[_0x85d0('0x1b')]?_['map'](_0x26eb5f['include'],function(_0x5973af){return{'model':db[_0x5973af['model']],'as':_0x5973af['as'],'attributes':_0x5973af['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2242a7){logger[_0x85d0('0xf')](_0x85d0('0x17'),_0x2df1b6);logger['debug'](_0x85d0('0x17'),_0x2df1b6,JSON[_0x85d0('0x1f')](_0x2242a7));_0x9d880(_0x2242a7);})[_0x85d0('0x20')](function(_0x1beb88){logger[_0x85d0('0x13')](_0x85d0('0x17'),_0x1beb88['message'],_0x2df1b6);_0x196537(_0x1a5c49[_0x85d0('0x13')](0x1f4,_0x1beb88[_0x85d0('0x14')]));});});};exports[_0x85d0('0x21')]=function(_0x4f1d8d){var _0x231074=this;return new Promise(function(_0x2eb528,_0x46ec79){return db[_0x85d0('0x18')][_0x85d0('0x22')]({'raw':_0x4f1d8d[_0x85d0('0x19')]?_0x4f1d8d['options'][_0x85d0('0x23')]===undefined?!![]:![]:!![],'where':_0x4f1d8d[_0x85d0('0x19')]?_0x4f1d8d[_0x85d0('0x19')][_0x85d0('0x24')]||null:null,'attributes':_0x4f1d8d[_0x85d0('0x19')]?_0x4f1d8d[_0x85d0('0x19')][_0x85d0('0x1e')]||null:null,'include':_0x4f1d8d[_0x85d0('0x19')]?_0x4f1d8d[_0x85d0('0x19')][_0x85d0('0x1b')]?_['map'](_0x4f1d8d[_0x85d0('0x19')]['include'],function(_0x19be0e){return{'model':db[_0x19be0e[_0x85d0('0x1c')]],'as':_0x19be0e['as'],'attributes':_0x19be0e[_0x85d0('0x1e')],'include':_0x19be0e['include']?_[_0x85d0('0x1d')](_0x19be0e['include'],function(_0x2adb9e){return{'model':db[_0x2adb9e[_0x85d0('0x1c')]],'as':_0x2adb9e['as'],'attributes':_0x2adb9e[_0x85d0('0x1e')],'include':_0x2adb9e['include']?_[_0x85d0('0x1d')](_0x2adb9e['include'],function(_0x1b5e47){return{'model':db[_0x1b5e47[_0x85d0('0x1c')]],'as':_0x1b5e47['as'],'attributes':_0x1b5e47[_0x85d0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x98f399){logger[_0x85d0('0xf')](_0x85d0('0x21'),_0x4f1d8d);logger[_0x85d0('0x11')]('ShowZendeskAccount',_0x4f1d8d,JSON[_0x85d0('0x1f')](_0x98f399));_0x2eb528(_0x98f399);})[_0x85d0('0x20')](function(_0x1d24ae){logger['error']('ShowZendeskAccount',_0x1d24ae[_0x85d0('0x14')],_0x4f1d8d);_0x46ec79(_0x231074['error'](0x1f4,_0x1d24ae[_0x85d0('0x14')]));});});}; \ No newline at end of file +var _0x0737=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','limit','include','map','model','attributes','ShowZendeskAccount','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x449371,_0x30f9e7){var _0x2f5c1d=function(_0x4cfca2){while(--_0x4cfca2){_0x449371['push'](_0x449371['shift']());}};_0x2f5c1d(++_0x30f9e7);}(_0x0737,0xfc));var _0x7073=function(_0x415ade,_0x55e64f){_0x415ade=_0x415ade-0x0;var _0x3e6ad8=_0x0737[_0x415ade];return _0x3e6ad8;};'use strict';var _=require(_0x7073('0x0'));var util=require(_0x7073('0x1'));var moment=require(_0x7073('0x2'));var BPromise=require(_0x7073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7073('0x4'));var db=require(_0x7073('0x5'))['db'];var utils=require(_0x7073('0x6'));var logger=require(_0x7073('0x7'))('rpc');var config=require(_0x7073('0x8'));var jayson=require(_0x7073('0x9'));var client=jayson[_0x7073('0xa')][_0x7073('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27f3b0,_0x3e87a0,_0x26c6e3){return new BPromise(function(_0x2f2d15,_0x2555de){return client['request'](_0x27f3b0,_0x26c6e3)[_0x7073('0xc')](function(_0x18ef2a){logger[_0x7073('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x3e87a0,_0x7073('0xe'));logger[_0x7073('0xf')](_0x7073('0x10'),_0x3e87a0,_0x7073('0xe'),JSON[_0x7073('0x11')](_0x18ef2a));if(_0x18ef2a[_0x7073('0x12')]){if(_0x18ef2a[_0x7073('0x12')][_0x7073('0x13')]===0x1f4){logger[_0x7073('0x12')](_0x7073('0x14'),_0x3e87a0,_0x18ef2a[_0x7073('0x12')][_0x7073('0x15')]);return _0x2555de(_0x18ef2a[_0x7073('0x12')][_0x7073('0x15')]);}logger[_0x7073('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x3e87a0,_0x18ef2a[_0x7073('0x12')]['message']);return _0x2f2d15(_0x18ef2a['error']['message']);}else{logger[_0x7073('0xd')](_0x7073('0x14'),_0x3e87a0,_0x7073('0xe'));_0x2f2d15(_0x18ef2a[_0x7073('0x16')]['message']);}})[_0x7073('0x17')](function(_0x24a219){logger[_0x7073('0x12')](_0x7073('0x14'),_0x3e87a0,_0x24a219);_0x2555de(_0x24a219);});});}exports[_0x7073('0x18')]=function(_0x372554){var _0x50ff69=this;return new Promise(function(_0x54f03d,_0x2aa742){return db[_0x7073('0x19')][_0x7073('0x1a')]({'raw':_0x372554[_0x7073('0x1b')]?_0x372554[_0x7073('0x1b')][_0x7073('0x1c')]===undefined?!![]:![]:!![],'where':_0x372554['options']?_0x372554[_0x7073('0x1b')]['where']||null:null,'attributes':_0x372554[_0x7073('0x1b')]?_0x372554[_0x7073('0x1b')]['attributes']||null:null,'limit':_0x372554[_0x7073('0x1b')]?_0x372554[_0x7073('0x1b')][_0x7073('0x1d')]||null:null,'include':_0x372554['options']?_0x372554[_0x7073('0x1b')][_0x7073('0x1e')]?_[_0x7073('0x1f')](_0x372554['options'][_0x7073('0x1e')],function(_0x54d3a8){return{'model':db[_0x54d3a8[_0x7073('0x20')]],'as':_0x54d3a8['as'],'attributes':_0x54d3a8[_0x7073('0x21')],'include':_0x54d3a8[_0x7073('0x1e')]?_[_0x7073('0x1f')](_0x54d3a8[_0x7073('0x1e')],function(_0x54b9dc){return{'model':db[_0x54b9dc[_0x7073('0x20')]],'as':_0x54b9dc['as'],'attributes':_0x54b9dc[_0x7073('0x21')],'include':_0x54b9dc[_0x7073('0x1e')]?_[_0x7073('0x1f')](_0x54b9dc[_0x7073('0x1e')],function(_0x585b10){return{'model':db[_0x585b10[_0x7073('0x20')]],'as':_0x585b10['as'],'attributes':_0x585b10[_0x7073('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7073('0xc')](function(_0x2903e3){logger[_0x7073('0xd')]('GetZendeskAccount',_0x372554);logger[_0x7073('0xf')](_0x7073('0x18'),_0x372554,JSON['stringify'](_0x2903e3));_0x54f03d(_0x2903e3);})[_0x7073('0x17')](function(_0x154123){logger['error']('GetZendeskAccount',_0x154123[_0x7073('0x15')],_0x372554);_0x2aa742(_0x50ff69['error'](0x1f4,_0x154123[_0x7073('0x15')]));});});};exports[_0x7073('0x22')]=function(_0x204614){var _0x51a7a7=this;return new Promise(function(_0x4861ab,_0x55ba94){return db[_0x7073('0x19')][_0x7073('0x23')]({'raw':_0x204614[_0x7073('0x1b')]?_0x204614['options'][_0x7073('0x1c')]===undefined?!![]:![]:!![],'where':_0x204614[_0x7073('0x1b')]?_0x204614[_0x7073('0x1b')][_0x7073('0x24')]||null:null,'attributes':_0x204614['options']?_0x204614[_0x7073('0x1b')]['attributes']||null:null,'include':_0x204614[_0x7073('0x1b')]?_0x204614['options'][_0x7073('0x1e')]?_['map'](_0x204614[_0x7073('0x1b')][_0x7073('0x1e')],function(_0xdf5e06){return{'model':db[_0xdf5e06[_0x7073('0x20')]],'as':_0xdf5e06['as'],'attributes':_0xdf5e06[_0x7073('0x21')],'include':_0xdf5e06[_0x7073('0x1e')]?_['map'](_0xdf5e06[_0x7073('0x1e')],function(_0x3e3cd4){return{'model':db[_0x3e3cd4[_0x7073('0x20')]],'as':_0x3e3cd4['as'],'attributes':_0x3e3cd4['attributes'],'include':_0x3e3cd4[_0x7073('0x1e')]?_[_0x7073('0x1f')](_0x3e3cd4[_0x7073('0x1e')],function(_0x4ac678){return{'model':db[_0x4ac678[_0x7073('0x20')]],'as':_0x4ac678['as'],'attributes':_0x4ac678[_0x7073('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4a02){logger['info']('ShowZendeskAccount',_0x204614);logger[_0x7073('0xf')](_0x7073('0x22'),_0x204614,JSON[_0x7073('0x11')](_0x4f4a02));_0x4861ab(_0x4f4a02);})[_0x7073('0x17')](function(_0x98773e){logger[_0x7073('0x12')]('ShowZendeskAccount',_0x98773e[_0x7073('0x15')],_0x204614);_0x55ba94(_0x51a7a7[_0x7073('0x12')](0x1f4,_0x98773e[_0x7073('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 1815308..8e61ce0 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 _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1973fa,_0x3ee9bf){var _0x71ba36=function(_0x38d385){while(--_0x38d385){_0x1973fa['push'](_0x1973fa['shift']());}};_0x71ba36(++_0x3ee9bf);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0xe5b5[_0x5d7227];return _0x15ac55;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file +var _0x0abf=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf0ab('0x7')]('/:id/descriptions',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0x7')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0x12')]);router[_0xf0ab('0x11')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x18')]);module[_0xf0ab('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 7751bd5..65085c5 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 _0x46dd=['exports','STRING','sequelize'];(function(_0x3bad44,_0x54227c){var _0x29e376=function(_0xea0067){while(--_0xea0067){_0x3bad44['push'](_0x3bad44['shift']());}};_0x29e376(++_0x54227c);}(_0x46dd,0x173));var _0xd46d=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x46dd[_0x5f46e7];return _0x567e95;};'use strict';var Sequelize=require(_0xd46d('0x0'));module[_0xd46d('0x1')]={'name':{'type':Sequelize[_0xd46d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6f0e=['STRING','sequelize','exports'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x6f0e,0xaf));var _0xe6f0=function(_0x3d720a,_0x5dbc23){_0x3d720a=_0x3d720a-0x0;var _0x4eaac6=_0x6f0e[_0x3d720a];return _0x4eaac6;};'use strict';var Sequelize=require(_0xe6f0('0x0'));module[_0xe6f0('0x1')]={'name':{'type':Sequelize[_0xe6f0('0x2')]},'description':{'type':Sequelize[_0xe6f0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d0dc248..f66b1fa 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 _0x3021=['getDescriptions','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','filter','count','includeAll','include','findAll','catch','show','length','merge','options','create','body','find','params','getFields','ZendeskField','nolimit','getSubjects','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3021,0x1ea));var _0x1302=function(_0x1d5bfe,_0x164956){_0x1d5bfe=_0x1d5bfe-0x0;var _0x45a4d0=_0x3021[_0x1d5bfe];return _0x45a4d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1302('0x0'));var zipdir=require(_0x1302('0x1'));var jsonpatch=require(_0x1302('0x2'));var rp=require(_0x1302('0x3'));var moment=require(_0x1302('0x4'));var BPromise=require(_0x1302('0x5'));var Mustache=require('mustache');var util=require(_0x1302('0x6'));var path=require('path');var sox=require(_0x1302('0x7'));var csv=require(_0x1302('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1302('0x9'));var _=require(_0x1302('0xa'));var squel=require('squel');var crypto=require(_0x1302('0xb'));var jsforce=require(_0x1302('0xc'));var deskjs=require(_0x1302('0xd'));var toCsv=require(_0x1302('0x8'));var querystring=require(_0x1302('0xe'));var Papa=require(_0x1302('0xf'));var Redis=require('ioredis');var authService=require(_0x1302('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1302('0x11'));var logger=require(_0x1302('0x12'))(_0x1302('0x13'));var utils=require(_0x1302('0x14'));var config=require(_0x1302('0x15'));var licenseUtil=require(_0x1302('0x16'));var db=require(_0x1302('0x17'))['db'];function respondWithStatusCode(_0x2866fd,_0x21f269){_0x21f269=_0x21f269||0xcc;return function(_0x4c1e6b){if(_0x4c1e6b){return _0x2866fd['sendStatus'](_0x21f269);}return _0x2866fd[_0x1302('0x18')](_0x21f269)[_0x1302('0x19')]();};}function respondWithResult(_0x9e82e3,_0x39769c){_0x39769c=_0x39769c||0xc8;return function(_0x20fa18){if(_0x20fa18){return _0x9e82e3['status'](_0x39769c)[_0x1302('0x1a')](_0x20fa18);}};}function respondWithFilteredResult(_0x4c316c,_0x326d03){return function(_0x257959){if(_0x257959){var _0x51f121=typeof _0x326d03[_0x1302('0x1b')]===_0x1302('0x1c')&&typeof _0x326d03['limit']===_0x1302('0x1c');var _0x3fe8b7=_0x257959['count'];var _0x4763bd=_0x51f121?0x0:_0x326d03[_0x1302('0x1b')];var _0x264550=_0x51f121?_0x257959['count']:_0x326d03[_0x1302('0x1b')]+_0x326d03['limit'];var _0x32b6e9;if(_0x264550>=_0x3fe8b7){_0x264550=_0x3fe8b7;_0x32b6e9=0xc8;}else{_0x32b6e9=0xce;}_0x4c316c[_0x1302('0x18')](_0x32b6e9);return _0x4c316c['set'](_0x1302('0x1d'),_0x4763bd+'-'+_0x264550+'/'+_0x3fe8b7)[_0x1302('0x1a')](_0x257959);}return null;};}function patchUpdates(_0x2d1fe2){return function(_0x57edce){try{jsonpatch[_0x1302('0x1e')](_0x57edce,_0x2d1fe2,!![]);}catch(_0x4ec57b){return BPromise[_0x1302('0x1f')](_0x4ec57b);}return _0x57edce[_0x1302('0x20')]();};}function saveUpdates(_0xeb69e0,_0x3f1082){return function(_0x90c3a2){if(_0x90c3a2){return _0x90c3a2[_0x1302('0x21')](_0xeb69e0)[_0x1302('0x22')](function(_0x31296f){return _0x31296f;});}return null;};}function removeEntity(_0x26866b,_0x1fb216){return function(_0x305cc2){if(_0x305cc2){return _0x305cc2[_0x1302('0x23')]()[_0x1302('0x22')](function(){_0x26866b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x355952,_0x1aa162){return function(_0x49ad0f){if(!_0x49ad0f){_0x355952['sendStatus'](0x194);}return _0x49ad0f;};}function handleError(_0x1123a0,_0x563ffa){_0x563ffa=_0x563ffa||0x1f4;return function(_0x441fa0){logger[_0x1302('0x24')](_0x441fa0['stack']);if(_0x441fa0[_0x1302('0x25')]){delete _0x441fa0[_0x1302('0x25')];}_0x1123a0[_0x1302('0x18')](_0x563ffa)['send'](_0x441fa0);};}exports[_0x1302('0x26')]=function(_0x2defa9,_0x514c7e){var _0x347bfe={},_0x1fa6d0={},_0x192451={'count':0x0,'rows':[]};var _0x204dbf=_[_0x1302('0x27')](db[_0x1302('0x28')][_0x1302('0x29')],function(_0x37ed17){return{'name':_0x37ed17['fieldName'],'type':_0x37ed17[_0x1302('0x2a')][_0x1302('0x2b')]};});_0x1fa6d0[_0x1302('0x2c')]=_[_0x1302('0x27')](_0x204dbf,'name');_0x1fa6d0[_0x1302('0x2d')]=_[_0x1302('0x2e')](_0x2defa9[_0x1302('0x2d')]);_0x1fa6d0[_0x1302('0x2f')]=_['intersection'](_0x1fa6d0['model'],_0x1fa6d0[_0x1302('0x2d')]);_0x347bfe[_0x1302('0x30')]=_[_0x1302('0x31')](_0x1fa6d0['model'],qs['fields'](_0x2defa9[_0x1302('0x2d')][_0x1302('0x32')]));_0x347bfe['attributes']=_0x347bfe[_0x1302('0x30')]['length']?_0x347bfe[_0x1302('0x30')]:_0x1fa6d0[_0x1302('0x2c')];if(!_0x2defa9['query'][_0x1302('0x33')]('nolimit')){_0x347bfe[_0x1302('0x34')]=qs[_0x1302('0x34')](_0x2defa9[_0x1302('0x2d')]['limit']);_0x347bfe[_0x1302('0x1b')]=qs[_0x1302('0x1b')](_0x2defa9['query'][_0x1302('0x1b')]);}_0x347bfe[_0x1302('0x35')]=qs[_0x1302('0x36')](_0x2defa9[_0x1302('0x2d')][_0x1302('0x36')]);_0x347bfe[_0x1302('0x37')]=qs[_0x1302('0x2f')](_[_0x1302('0x38')](_0x2defa9[_0x1302('0x2d')],_0x1fa6d0[_0x1302('0x2f')]),_0x204dbf);if(_0x2defa9[_0x1302('0x2d')]['filter']){_0x347bfe[_0x1302('0x37')]=_['merge'](_0x347bfe[_0x1302('0x37')],{'$or':_['map'](_0x204dbf,function(_0x40a7bf){if(_0x40a7bf[_0x1302('0x2a')]!==_0x1302('0x39')){var _0x4c7e9b={};_0x4c7e9b[_0x40a7bf['name']]={'$like':'%'+_0x2defa9[_0x1302('0x2d')][_0x1302('0x3a')]+'%'};return _0x4c7e9b;}})});}_0x347bfe=_['merge']({},_0x347bfe,_0x2defa9['options']);var _0x3898d9={'where':_0x347bfe[_0x1302('0x37')]};return db['ZendeskConfiguration'][_0x1302('0x3b')](_0x3898d9)[_0x1302('0x22')](function(_0x2cda06){_0x192451[_0x1302('0x3b')]=_0x2cda06;if(_0x2defa9[_0x1302('0x2d')][_0x1302('0x3c')]){_0x347bfe[_0x1302('0x3d')]=[{'all':!![]}];}return db[_0x1302('0x28')][_0x1302('0x3e')](_0x347bfe);})[_0x1302('0x22')](function(_0x5c3bc4){_0x192451['rows']=_0x5c3bc4;return _0x192451;})['then'](respondWithFilteredResult(_0x514c7e,_0x347bfe))[_0x1302('0x3f')](handleError(_0x514c7e,null));};exports[_0x1302('0x40')]=function(_0x4fe1ff,_0x487816){var _0x3b6244={'raw':![],'where':{'id':_0x4fe1ff['params']['id']}},_0x4789ed={};_0x4789ed[_0x1302('0x2c')]=_['keys'](db[_0x1302('0x28')]['rawAttributes']);_0x4789ed[_0x1302('0x2d')]=_[_0x1302('0x2e')](_0x4fe1ff[_0x1302('0x2d')]);_0x4789ed['filters']=_[_0x1302('0x31')](_0x4789ed[_0x1302('0x2c')],_0x4789ed[_0x1302('0x2d')]);_0x3b6244[_0x1302('0x30')]=_[_0x1302('0x31')](_0x4789ed['model'],qs[_0x1302('0x32')](_0x4fe1ff[_0x1302('0x2d')][_0x1302('0x32')]));_0x3b6244[_0x1302('0x30')]=_0x3b6244[_0x1302('0x30')][_0x1302('0x41')]?_0x3b6244[_0x1302('0x30')]:_0x4789ed[_0x1302('0x2c')];if(_0x4fe1ff[_0x1302('0x2d')][_0x1302('0x3c')]){_0x3b6244[_0x1302('0x3d')]=[{'all':!![]}];}_0x3b6244=_[_0x1302('0x42')]({},_0x3b6244,_0x4fe1ff[_0x1302('0x43')]);return db[_0x1302('0x28')]['find'](_0x3b6244)[_0x1302('0x22')](handleEntityNotFound(_0x487816,null))[_0x1302('0x22')](respondWithResult(_0x487816,null))[_0x1302('0x3f')](handleError(_0x487816,null));};exports['create']=function(_0x198fb9,_0x447e53){return db[_0x1302('0x28')][_0x1302('0x44')](_0x198fb9[_0x1302('0x45')],{})[_0x1302('0x22')](respondWithResult(_0x447e53,0xc9))[_0x1302('0x3f')](handleError(_0x447e53,null));};exports['update']=function(_0x33a68a,_0x774f7b){if(_0x33a68a[_0x1302('0x45')]['id']){delete _0x33a68a['body']['id'];}return db[_0x1302('0x28')][_0x1302('0x46')]({'where':{'id':_0x33a68a[_0x1302('0x47')]['id']}})[_0x1302('0x22')](handleEntityNotFound(_0x774f7b,null))[_0x1302('0x22')](saveUpdates(_0x33a68a[_0x1302('0x45')],null))['then'](respondWithResult(_0x774f7b,null))[_0x1302('0x3f')](handleError(_0x774f7b,null));};exports[_0x1302('0x23')]=function(_0x253df7,_0x4dc18a){return db[_0x1302('0x28')][_0x1302('0x46')]({'where':{'id':_0x253df7[_0x1302('0x47')]['id']}})[_0x1302('0x22')](handleEntityNotFound(_0x4dc18a,null))['then'](removeEntity(_0x4dc18a,null))[_0x1302('0x3f')](handleError(_0x4dc18a,null));};exports[_0x1302('0x48')]=function(_0x1d13e6,_0x2094e0,_0x5cc50b){var _0x4e3b43={};var _0x3b790b={};var _0x5b10dd;var _0x2c6475;return db[_0x1302('0x28')]['findOne']({'where':{'id':_0x1d13e6[_0x1302('0x47')]['id']}})[_0x1302('0x22')](handleEntityNotFound(_0x2094e0,null))['then'](function(_0x1313b1){if(_0x1313b1){_0x5b10dd=_0x1313b1;_0x3b790b['model']=_[_0x1302('0x2e')](db[_0x1302('0x49')][_0x1302('0x29')]);_0x3b790b['query']=_[_0x1302('0x2e')](_0x1d13e6['query']);_0x3b790b[_0x1302('0x2f')]=_[_0x1302('0x31')](_0x3b790b[_0x1302('0x2c')],_0x3b790b[_0x1302('0x2d')]);_0x4e3b43[_0x1302('0x30')]=_[_0x1302('0x31')](_0x3b790b[_0x1302('0x2c')],qs[_0x1302('0x32')](_0x1d13e6[_0x1302('0x2d')][_0x1302('0x32')]));_0x4e3b43[_0x1302('0x30')]=_0x4e3b43[_0x1302('0x30')][_0x1302('0x41')]?_0x4e3b43[_0x1302('0x30')]:_0x3b790b[_0x1302('0x2c')];_0x4e3b43[_0x1302('0x35')]=qs[_0x1302('0x36')](_0x1d13e6[_0x1302('0x2d')][_0x1302('0x36')]);_0x4e3b43[_0x1302('0x37')]=qs[_0x1302('0x2f')](_['pick'](_0x1d13e6['query'],_0x3b790b[_0x1302('0x2f')]));if(_0x1d13e6['query'][_0x1302('0x3a')]){_0x4e3b43[_0x1302('0x37')]=_[_0x1302('0x42')](_0x4e3b43[_0x1302('0x37')],{'$or':_[_0x1302('0x27')](_0x4e3b43[_0x1302('0x30')],function(_0x10470d){var _0x2eef08={};_0x2eef08[_0x10470d]={'$like':'%'+_0x1d13e6[_0x1302('0x2d')][_0x1302('0x3a')]+'%'};return _0x2eef08;})});}_0x4e3b43=_[_0x1302('0x42')]({},_0x4e3b43,_0x1d13e6[_0x1302('0x43')]);return _0x5b10dd['getFields'](_0x4e3b43);}})['then'](function(_0x5af32b){if(_0x5af32b){_0x2c6475=_0x5af32b[_0x1302('0x41')];if(!_0x1d13e6[_0x1302('0x2d')]['hasOwnProperty'](_0x1302('0x4a'))){_0x4e3b43[_0x1302('0x34')]=qs['limit'](_0x1d13e6['query']['limit']);_0x4e3b43[_0x1302('0x1b')]=qs['offset'](_0x1d13e6[_0x1302('0x2d')][_0x1302('0x1b')]);}return _0x5b10dd[_0x1302('0x48')](_0x4e3b43);}})['then'](function(_0x53e14b){if(_0x53e14b){return _0x53e14b?{'count':_0x2c6475,'rows':_0x53e14b}:null;}})[_0x1302('0x22')](respondWithResult(_0x2094e0,null))[_0x1302('0x3f')](handleError(_0x2094e0,null));};exports[_0x1302('0x4b')]=function(_0x23be81,_0x220d75,_0x352364){var _0xd6ac77={};var _0x4d1a4c={};var _0x357b7c;var _0x530b0c;return db[_0x1302('0x28')][_0x1302('0x4c')]({'where':{'id':_0x23be81[_0x1302('0x47')]['id']}})[_0x1302('0x22')](handleEntityNotFound(_0x220d75,null))[_0x1302('0x22')](function(_0x4f4cd0){if(_0x4f4cd0){_0x357b7c=_0x4f4cd0;_0x4d1a4c[_0x1302('0x2c')]=_['keys'](db[_0x1302('0x49')][_0x1302('0x29')]);_0x4d1a4c['query']=_[_0x1302('0x2e')](_0x23be81['query']);_0x4d1a4c[_0x1302('0x2f')]=_[_0x1302('0x31')](_0x4d1a4c[_0x1302('0x2c')],_0x4d1a4c['query']);_0xd6ac77[_0x1302('0x30')]=_[_0x1302('0x31')](_0x4d1a4c[_0x1302('0x2c')],qs[_0x1302('0x32')](_0x23be81[_0x1302('0x2d')][_0x1302('0x32')]));_0xd6ac77[_0x1302('0x30')]=_0xd6ac77[_0x1302('0x30')][_0x1302('0x41')]?_0xd6ac77[_0x1302('0x30')]:_0x4d1a4c[_0x1302('0x2c')];_0xd6ac77[_0x1302('0x35')]=qs['sort'](_0x23be81[_0x1302('0x2d')][_0x1302('0x36')]);_0xd6ac77[_0x1302('0x37')]=qs[_0x1302('0x2f')](_['pick'](_0x23be81[_0x1302('0x2d')],_0x4d1a4c[_0x1302('0x2f')]));if(_0x23be81[_0x1302('0x2d')]['filter']){_0xd6ac77['where']=_[_0x1302('0x42')](_0xd6ac77[_0x1302('0x37')],{'$or':_[_0x1302('0x27')](_0xd6ac77[_0x1302('0x30')],function(_0x211032){var _0x56c682={};_0x56c682[_0x211032]={'$like':'%'+_0x23be81['query']['filter']+'%'};return _0x56c682;})});}_0xd6ac77=_['merge']({},_0xd6ac77,_0x23be81[_0x1302('0x43')]);return _0x357b7c[_0x1302('0x4b')](_0xd6ac77);}})[_0x1302('0x22')](function(_0x2a8fb6){if(_0x2a8fb6){_0x530b0c=_0x2a8fb6[_0x1302('0x41')];if(!_0x23be81[_0x1302('0x2d')][_0x1302('0x33')](_0x1302('0x4a'))){_0xd6ac77['limit']=qs['limit'](_0x23be81['query'][_0x1302('0x34')]);_0xd6ac77['offset']=qs[_0x1302('0x1b')](_0x23be81[_0x1302('0x2d')][_0x1302('0x1b')]);}return _0x357b7c[_0x1302('0x4b')](_0xd6ac77);}})[_0x1302('0x22')](function(_0x1a7515){if(_0x1a7515){return _0x1a7515?{'count':_0x530b0c,'rows':_0x1a7515}:null;}})['then'](respondWithResult(_0x220d75,null))[_0x1302('0x3f')](handleError(_0x220d75,null));};exports[_0x1302('0x4d')]=function(_0x56127d,_0x15db7e,_0x282772){var _0x1188ca={};var _0x39f232={};var _0x1c8f5d;var _0x4382df;return db[_0x1302('0x28')][_0x1302('0x4c')]({'where':{'id':_0x56127d[_0x1302('0x47')]['id']}})['then'](handleEntityNotFound(_0x15db7e,null))['then'](function(_0x176cb7){if(_0x176cb7){_0x1c8f5d=_0x176cb7;_0x39f232[_0x1302('0x2c')]=_['keys'](db[_0x1302('0x49')][_0x1302('0x29')]);_0x39f232[_0x1302('0x2d')]=_[_0x1302('0x2e')](_0x56127d['query']);_0x39f232[_0x1302('0x2f')]=_[_0x1302('0x31')](_0x39f232[_0x1302('0x2c')],_0x39f232[_0x1302('0x2d')]);_0x1188ca[_0x1302('0x30')]=_[_0x1302('0x31')](_0x39f232['model'],qs[_0x1302('0x32')](_0x56127d[_0x1302('0x2d')][_0x1302('0x32')]));_0x1188ca['attributes']=_0x1188ca['attributes'][_0x1302('0x41')]?_0x1188ca[_0x1302('0x30')]:_0x39f232[_0x1302('0x2c')];_0x1188ca[_0x1302('0x35')]=qs['sort'](_0x56127d[_0x1302('0x2d')][_0x1302('0x36')]);_0x1188ca['where']=qs[_0x1302('0x2f')](_[_0x1302('0x38')](_0x56127d['query'],_0x39f232[_0x1302('0x2f')]));if(_0x56127d['query'][_0x1302('0x3a')]){_0x1188ca[_0x1302('0x37')]=_['merge'](_0x1188ca['where'],{'$or':_[_0x1302('0x27')](_0x1188ca[_0x1302('0x30')],function(_0xce7074){var _0x2fcb8a={};_0x2fcb8a[_0xce7074]={'$like':'%'+_0x56127d['query'][_0x1302('0x3a')]+'%'};return _0x2fcb8a;})});}_0x1188ca=_[_0x1302('0x42')]({},_0x1188ca,_0x56127d[_0x1302('0x43')]);return _0x1c8f5d[_0x1302('0x4d')](_0x1188ca);}})[_0x1302('0x22')](function(_0x41447a){if(_0x41447a){_0x4382df=_0x41447a[_0x1302('0x41')];if(!_0x56127d['query'][_0x1302('0x33')](_0x1302('0x4a'))){_0x1188ca['limit']=qs['limit'](_0x56127d[_0x1302('0x2d')]['limit']);_0x1188ca['offset']=qs[_0x1302('0x1b')](_0x56127d[_0x1302('0x2d')][_0x1302('0x1b')]);}return _0x1c8f5d[_0x1302('0x4d')](_0x1188ca);}})[_0x1302('0x22')](function(_0x132d02){if(_0x132d02){return _0x132d02?{'count':_0x4382df,'rows':_0x132d02}:null;}})['then'](respondWithResult(_0x15db7e,null))[_0x1302('0x3f')](handleError(_0x15db7e,null));};exports['getTags']=function(_0x11435e,_0x404102,_0x35b58c){var _0x12225b={};var _0xb50988={};var _0x10b9e7;var _0x2af398;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x11435e[_0x1302('0x47')]['id']}})['then'](handleEntityNotFound(_0x404102,null))[_0x1302('0x22')](function(_0x4e9b29){if(_0x4e9b29){_0x10b9e7=_0x4e9b29;_0xb50988[_0x1302('0x2c')]=_[_0x1302('0x2e')](db[_0x1302('0x4e')][_0x1302('0x29')]);_0xb50988[_0x1302('0x2d')]=_['keys'](_0x11435e[_0x1302('0x2d')]);_0xb50988[_0x1302('0x2f')]=_[_0x1302('0x31')](_0xb50988[_0x1302('0x2c')],_0xb50988[_0x1302('0x2d')]);_0x12225b[_0x1302('0x30')]=_[_0x1302('0x31')](_0xb50988['model'],qs[_0x1302('0x32')](_0x11435e[_0x1302('0x2d')][_0x1302('0x32')]));_0x12225b[_0x1302('0x30')]=_0x12225b[_0x1302('0x30')]['length']?_0x12225b['attributes']:_0xb50988[_0x1302('0x2c')];_0x12225b[_0x1302('0x35')]=qs[_0x1302('0x36')](_0x11435e[_0x1302('0x2d')][_0x1302('0x36')]);_0x12225b[_0x1302('0x37')]=qs['filters'](_[_0x1302('0x38')](_0x11435e[_0x1302('0x2d')],_0xb50988[_0x1302('0x2f')]));if(_0x11435e['query'][_0x1302('0x3a')]){_0x12225b[_0x1302('0x37')]=_['merge'](_0x12225b[_0x1302('0x37')],{'$or':_[_0x1302('0x27')](_0x12225b['attributes'],function(_0x736f54){var _0x48f02c={};_0x48f02c[_0x736f54]={'$like':'%'+_0x11435e[_0x1302('0x2d')]['filter']+'%'};return _0x48f02c;})});}_0x12225b=_[_0x1302('0x42')]({},_0x12225b,_0x11435e['options']);return _0x10b9e7['getTags'](_0x12225b);}})[_0x1302('0x22')](function(_0x565090){if(_0x565090){_0x2af398=_0x565090[_0x1302('0x41')];if(!_0x11435e['query'][_0x1302('0x33')](_0x1302('0x4a'))){_0x12225b['limit']=qs[_0x1302('0x34')](_0x11435e[_0x1302('0x2d')]['limit']);_0x12225b[_0x1302('0x1b')]=qs[_0x1302('0x1b')](_0x11435e[_0x1302('0x2d')][_0x1302('0x1b')]);}return _0x10b9e7['getTags'](_0x12225b);}})[_0x1302('0x22')](function(_0x3e9102){if(_0x3e9102){return _0x3e9102?{'count':_0x2af398,'rows':_0x3e9102}:null;}})['then'](respondWithResult(_0x404102,null))[_0x1302('0x3f')](handleError(_0x404102,null));};exports[_0x1302('0x4f')]=function(_0x42a21e,_0x44202b,_0x50b905){if(_0x42a21e[_0x1302('0x45')]['id']){delete _0x42a21e[_0x1302('0x45')]['id'];}return db[_0x1302('0x28')][_0x1302('0x4c')]({'where':{'id':_0x42a21e['params']['id']}})[_0x1302('0x22')](handleEntityNotFound(_0x44202b,null))[_0x1302('0x22')](function(_0x38232b){if(_0x38232b){return _0x38232b[_0x1302('0x4f')](_0x42a21e[_0x1302('0x45')][_0x1302('0x50')]||[]);}return null;})[_0x1302('0x22')](respondWithResult(_0x44202b,null))['catch'](handleError(_0x44202b,null));}; \ No newline at end of file +var _0xec23=['attributes','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','findAll','catch','show','params','keys','length','includeAll','find','body','update','getFields','ZendeskField','pick','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','then','destroy','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','intersection','fields'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xec23,0x72));var _0x3ec2=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xec23[_0x2dea24];return _0x309d58;};'use strict';var emlformat=require(_0x3ec2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ec2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ec2('0x2'));var moment=require('moment');var BPromise=require(_0x3ec2('0x3'));var Mustache=require(_0x3ec2('0x4'));var util=require('util');var path=require(_0x3ec2('0x5'));var sox=require(_0x3ec2('0x6'));var csv=require(_0x3ec2('0x7'));var ejs=require(_0x3ec2('0x8'));var fs=require('fs');var fs_extra=require(_0x3ec2('0x9'));var _=require('lodash');var squel=require(_0x3ec2('0xa'));var crypto=require(_0x3ec2('0xb'));var jsforce=require(_0x3ec2('0xc'));var deskjs=require(_0x3ec2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3ec2('0xe'));var Papa=require(_0x3ec2('0xf'));var Redis=require(_0x3ec2('0x10'));var authService=require(_0x3ec2('0x11'));var qs=require(_0x3ec2('0x12'));var as=require(_0x3ec2('0x13'));var hardwareService=require(_0x3ec2('0x14'));var logger=require(_0x3ec2('0x15'))(_0x3ec2('0x16'));var utils=require(_0x3ec2('0x17'));var config=require(_0x3ec2('0x18'));var licenseUtil=require(_0x3ec2('0x19'));var db=require(_0x3ec2('0x1a'))['db'];function respondWithStatusCode(_0x145f28,_0x58a033){_0x58a033=_0x58a033||0xcc;return function(_0x317544){if(_0x317544){return _0x145f28[_0x3ec2('0x1b')](_0x58a033);}return _0x145f28[_0x3ec2('0x1c')](_0x58a033)[_0x3ec2('0x1d')]();};}function respondWithResult(_0x4ac422,_0x48ea87){_0x48ea87=_0x48ea87||0xc8;return function(_0x5f2b93){if(_0x5f2b93){return _0x4ac422['status'](_0x48ea87)[_0x3ec2('0x1e')](_0x5f2b93);}};}function respondWithFilteredResult(_0x243dad,_0x47fa48){return function(_0x131cad){if(_0x131cad){var _0x377a8b=typeof _0x47fa48['offset']===_0x3ec2('0x1f')&&typeof _0x47fa48[_0x3ec2('0x20')]===_0x3ec2('0x1f');var _0x526140=_0x131cad[_0x3ec2('0x21')];var _0x59e1bc=_0x377a8b?0x0:_0x47fa48[_0x3ec2('0x22')];var _0x165600=_0x377a8b?_0x131cad[_0x3ec2('0x21')]:_0x47fa48[_0x3ec2('0x22')]+_0x47fa48[_0x3ec2('0x20')];var _0x3ad370;if(_0x165600>=_0x526140){_0x165600=_0x526140;_0x3ad370=0xc8;}else{_0x3ad370=0xce;}_0x243dad['status'](_0x3ad370);return _0x243dad['set'](_0x3ec2('0x23'),_0x59e1bc+'-'+_0x165600+'/'+_0x526140)[_0x3ec2('0x1e')](_0x131cad);}return null;};}function patchUpdates(_0x3ccad4){return function(_0x31c828){try{jsonpatch['apply'](_0x31c828,_0x3ccad4,!![]);}catch(_0x20bad8){return BPromise[_0x3ec2('0x24')](_0x20bad8);}return _0x31c828[_0x3ec2('0x25')]();};}function saveUpdates(_0x4cf099,_0x7dff31){return function(_0x4c6a66){if(_0x4c6a66){return _0x4c6a66['update'](_0x4cf099)[_0x3ec2('0x26')](function(_0x4bdead){return _0x4bdead;});}return null;};}function removeEntity(_0x1c962b,_0x5546c0){return function(_0x468c85){if(_0x468c85){return _0x468c85[_0x3ec2('0x27')]()['then'](function(){_0x1c962b['status'](0xcc)[_0x3ec2('0x1d')]();});}};}function handleEntityNotFound(_0x1b17a5,_0x2a220a){return function(_0x2fcbbd){if(!_0x2fcbbd){_0x1b17a5['sendStatus'](0x194);}return _0x2fcbbd;};}function handleError(_0x24f790,_0x622284){_0x622284=_0x622284||0x1f4;return function(_0x32beb1){logger['error'](_0x32beb1['stack']);if(_0x32beb1[_0x3ec2('0x28')]){delete _0x32beb1[_0x3ec2('0x28')];}_0x24f790['status'](_0x622284)[_0x3ec2('0x29')](_0x32beb1);};}exports[_0x3ec2('0x2a')]=function(_0x2d8c3b,_0x2bdf07){var _0x4ee02f={},_0x12b3ae={},_0x1655fe={'count':0x0,'rows':[]};var _0x5bb33f=_[_0x3ec2('0x2b')](db[_0x3ec2('0x2c')][_0x3ec2('0x2d')],function(_0x418795){return{'name':_0x418795['fieldName'],'type':_0x418795[_0x3ec2('0x2e')][_0x3ec2('0x2f')]};});_0x12b3ae[_0x3ec2('0x30')]=_[_0x3ec2('0x2b')](_0x5bb33f,_0x3ec2('0x28'));_0x12b3ae[_0x3ec2('0x31')]=_['keys'](_0x2d8c3b[_0x3ec2('0x31')]);_0x12b3ae['filters']=_[_0x3ec2('0x32')](_0x12b3ae[_0x3ec2('0x30')],_0x12b3ae[_0x3ec2('0x31')]);_0x4ee02f['attributes']=_['intersection'](_0x12b3ae[_0x3ec2('0x30')],qs[_0x3ec2('0x33')](_0x2d8c3b['query'][_0x3ec2('0x33')]));_0x4ee02f[_0x3ec2('0x34')]=_0x4ee02f[_0x3ec2('0x34')]['length']?_0x4ee02f[_0x3ec2('0x34')]:_0x12b3ae[_0x3ec2('0x30')];if(!_0x2d8c3b[_0x3ec2('0x31')][_0x3ec2('0x35')](_0x3ec2('0x36'))){_0x4ee02f['limit']=qs['limit'](_0x2d8c3b[_0x3ec2('0x31')][_0x3ec2('0x20')]);_0x4ee02f[_0x3ec2('0x22')]=qs['offset'](_0x2d8c3b[_0x3ec2('0x31')][_0x3ec2('0x22')]);}_0x4ee02f[_0x3ec2('0x37')]=qs[_0x3ec2('0x38')](_0x2d8c3b[_0x3ec2('0x31')][_0x3ec2('0x38')]);_0x4ee02f['where']=qs[_0x3ec2('0x39')](_['pick'](_0x2d8c3b[_0x3ec2('0x31')],_0x12b3ae[_0x3ec2('0x39')]),_0x5bb33f);if(_0x2d8c3b[_0x3ec2('0x31')][_0x3ec2('0x3a')]){_0x4ee02f['where']=_[_0x3ec2('0x3b')](_0x4ee02f[_0x3ec2('0x3c')],{'$or':_['map'](_0x5bb33f,function(_0x2638a3){if(_0x2638a3[_0x3ec2('0x2e')]!==_0x3ec2('0x3d')){var _0x35e30c={};_0x35e30c[_0x2638a3[_0x3ec2('0x28')]]={'$like':'%'+_0x2d8c3b['query'][_0x3ec2('0x3a')]+'%'};return _0x35e30c;}})});}_0x4ee02f=_['merge']({},_0x4ee02f,_0x2d8c3b[_0x3ec2('0x3e')]);var _0x326fa5={'where':_0x4ee02f[_0x3ec2('0x3c')]};return db[_0x3ec2('0x2c')]['count'](_0x326fa5)[_0x3ec2('0x26')](function(_0x545aa5){_0x1655fe[_0x3ec2('0x21')]=_0x545aa5;if(_0x2d8c3b[_0x3ec2('0x31')]['includeAll']){_0x4ee02f[_0x3ec2('0x3f')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x3ec2('0x40')](_0x4ee02f);})[_0x3ec2('0x26')](function(_0x55475a){_0x1655fe['rows']=_0x55475a;return _0x1655fe;})[_0x3ec2('0x26')](respondWithFilteredResult(_0x2bdf07,_0x4ee02f))[_0x3ec2('0x41')](handleError(_0x2bdf07,null));};exports[_0x3ec2('0x42')]=function(_0xee2ff6,_0x2f5dac){var _0x30eb78={'raw':![],'where':{'id':_0xee2ff6[_0x3ec2('0x43')]['id']}},_0x49caa8={};_0x49caa8[_0x3ec2('0x30')]=_[_0x3ec2('0x44')](db[_0x3ec2('0x2c')][_0x3ec2('0x2d')]);_0x49caa8[_0x3ec2('0x31')]=_[_0x3ec2('0x44')](_0xee2ff6[_0x3ec2('0x31')]);_0x49caa8[_0x3ec2('0x39')]=_[_0x3ec2('0x32')](_0x49caa8[_0x3ec2('0x30')],_0x49caa8[_0x3ec2('0x31')]);_0x30eb78[_0x3ec2('0x34')]=_[_0x3ec2('0x32')](_0x49caa8[_0x3ec2('0x30')],qs[_0x3ec2('0x33')](_0xee2ff6['query'][_0x3ec2('0x33')]));_0x30eb78[_0x3ec2('0x34')]=_0x30eb78[_0x3ec2('0x34')][_0x3ec2('0x45')]?_0x30eb78['attributes']:_0x49caa8[_0x3ec2('0x30')];if(_0xee2ff6[_0x3ec2('0x31')][_0x3ec2('0x46')]){_0x30eb78[_0x3ec2('0x3f')]=[{'all':!![]}];}_0x30eb78=_[_0x3ec2('0x3b')]({},_0x30eb78,_0xee2ff6[_0x3ec2('0x3e')]);return db[_0x3ec2('0x2c')][_0x3ec2('0x47')](_0x30eb78)[_0x3ec2('0x26')](handleEntityNotFound(_0x2f5dac,null))['then'](respondWithResult(_0x2f5dac,null))[_0x3ec2('0x41')](handleError(_0x2f5dac,null));};exports['create']=function(_0x55f406,_0x40c646){return db[_0x3ec2('0x2c')]['create'](_0x55f406[_0x3ec2('0x48')],{})[_0x3ec2('0x26')](respondWithResult(_0x40c646,0xc9))[_0x3ec2('0x41')](handleError(_0x40c646,null));};exports[_0x3ec2('0x49')]=function(_0x255df4,_0x282d78){if(_0x255df4[_0x3ec2('0x48')]['id']){delete _0x255df4[_0x3ec2('0x48')]['id'];}return db[_0x3ec2('0x2c')][_0x3ec2('0x47')]({'where':{'id':_0x255df4[_0x3ec2('0x43')]['id']}})[_0x3ec2('0x26')](handleEntityNotFound(_0x282d78,null))['then'](saveUpdates(_0x255df4[_0x3ec2('0x48')],null))[_0x3ec2('0x26')](respondWithResult(_0x282d78,null))[_0x3ec2('0x41')](handleError(_0x282d78,null));};exports[_0x3ec2('0x27')]=function(_0x28a048,_0x15afca){return db[_0x3ec2('0x2c')][_0x3ec2('0x47')]({'where':{'id':_0x28a048[_0x3ec2('0x43')]['id']}})[_0x3ec2('0x26')](handleEntityNotFound(_0x15afca,null))[_0x3ec2('0x26')](removeEntity(_0x15afca,null))[_0x3ec2('0x41')](handleError(_0x15afca,null));};exports[_0x3ec2('0x4a')]=function(_0x47fef6,_0x58e2c2,_0x35557a){var _0x3aecb6={};var _0x2a2976={};var _0x3fbbf3;var _0x26c4cf;return db[_0x3ec2('0x2c')]['findOne']({'where':{'id':_0x47fef6[_0x3ec2('0x43')]['id']}})[_0x3ec2('0x26')](handleEntityNotFound(_0x58e2c2,null))[_0x3ec2('0x26')](function(_0x1a4006){if(_0x1a4006){_0x3fbbf3=_0x1a4006;_0x2a2976[_0x3ec2('0x30')]=_[_0x3ec2('0x44')](db[_0x3ec2('0x4b')][_0x3ec2('0x2d')]);_0x2a2976['query']=_[_0x3ec2('0x44')](_0x47fef6[_0x3ec2('0x31')]);_0x2a2976['filters']=_[_0x3ec2('0x32')](_0x2a2976[_0x3ec2('0x30')],_0x2a2976['query']);_0x3aecb6[_0x3ec2('0x34')]=_[_0x3ec2('0x32')](_0x2a2976['model'],qs[_0x3ec2('0x33')](_0x47fef6[_0x3ec2('0x31')][_0x3ec2('0x33')]));_0x3aecb6['attributes']=_0x3aecb6['attributes'][_0x3ec2('0x45')]?_0x3aecb6[_0x3ec2('0x34')]:_0x2a2976[_0x3ec2('0x30')];_0x3aecb6['order']=qs[_0x3ec2('0x38')](_0x47fef6['query'][_0x3ec2('0x38')]);_0x3aecb6['where']=qs[_0x3ec2('0x39')](_[_0x3ec2('0x4c')](_0x47fef6[_0x3ec2('0x31')],_0x2a2976[_0x3ec2('0x39')]));if(_0x47fef6[_0x3ec2('0x31')][_0x3ec2('0x3a')]){_0x3aecb6[_0x3ec2('0x3c')]=_[_0x3ec2('0x3b')](_0x3aecb6[_0x3ec2('0x3c')],{'$or':_[_0x3ec2('0x2b')](_0x3aecb6[_0x3ec2('0x34')],function(_0x5d00aa){var _0x28f773={};_0x28f773[_0x5d00aa]={'$like':'%'+_0x47fef6['query'][_0x3ec2('0x3a')]+'%'};return _0x28f773;})});}_0x3aecb6=_[_0x3ec2('0x3b')]({},_0x3aecb6,_0x47fef6[_0x3ec2('0x3e')]);return _0x3fbbf3[_0x3ec2('0x4a')](_0x3aecb6);}})[_0x3ec2('0x26')](function(_0x7d2e1d){if(_0x7d2e1d){_0x26c4cf=_0x7d2e1d[_0x3ec2('0x45')];if(!_0x47fef6[_0x3ec2('0x31')][_0x3ec2('0x35')](_0x3ec2('0x36'))){_0x3aecb6[_0x3ec2('0x20')]=qs[_0x3ec2('0x20')](_0x47fef6[_0x3ec2('0x31')]['limit']);_0x3aecb6['offset']=qs['offset'](_0x47fef6[_0x3ec2('0x31')][_0x3ec2('0x22')]);}return _0x3fbbf3[_0x3ec2('0x4a')](_0x3aecb6);}})[_0x3ec2('0x26')](function(_0x3aed20){if(_0x3aed20){return _0x3aed20?{'count':_0x26c4cf,'rows':_0x3aed20}:null;}})['then'](respondWithResult(_0x58e2c2,null))[_0x3ec2('0x41')](handleError(_0x58e2c2,null));};exports[_0x3ec2('0x4d')]=function(_0x2cf33b,_0x47f7d2,_0x57f1af){var _0x7332e1={};var _0x5a5c2f={};var _0x80cef;var _0x176688;return db[_0x3ec2('0x2c')][_0x3ec2('0x4e')]({'where':{'id':_0x2cf33b['params']['id']}})[_0x3ec2('0x26')](handleEntityNotFound(_0x47f7d2,null))[_0x3ec2('0x26')](function(_0x248979){if(_0x248979){_0x80cef=_0x248979;_0x5a5c2f[_0x3ec2('0x30')]=_[_0x3ec2('0x44')](db['ZendeskField'][_0x3ec2('0x2d')]);_0x5a5c2f[_0x3ec2('0x31')]=_[_0x3ec2('0x44')](_0x2cf33b[_0x3ec2('0x31')]);_0x5a5c2f[_0x3ec2('0x39')]=_[_0x3ec2('0x32')](_0x5a5c2f[_0x3ec2('0x30')],_0x5a5c2f[_0x3ec2('0x31')]);_0x7332e1[_0x3ec2('0x34')]=_[_0x3ec2('0x32')](_0x5a5c2f['model'],qs[_0x3ec2('0x33')](_0x2cf33b['query'][_0x3ec2('0x33')]));_0x7332e1[_0x3ec2('0x34')]=_0x7332e1[_0x3ec2('0x34')]['length']?_0x7332e1[_0x3ec2('0x34')]:_0x5a5c2f[_0x3ec2('0x30')];_0x7332e1[_0x3ec2('0x37')]=qs[_0x3ec2('0x38')](_0x2cf33b[_0x3ec2('0x31')][_0x3ec2('0x38')]);_0x7332e1[_0x3ec2('0x3c')]=qs[_0x3ec2('0x39')](_[_0x3ec2('0x4c')](_0x2cf33b[_0x3ec2('0x31')],_0x5a5c2f[_0x3ec2('0x39')]));if(_0x2cf33b[_0x3ec2('0x31')][_0x3ec2('0x3a')]){_0x7332e1['where']=_[_0x3ec2('0x3b')](_0x7332e1[_0x3ec2('0x3c')],{'$or':_[_0x3ec2('0x2b')](_0x7332e1[_0x3ec2('0x34')],function(_0x1b4f5c){var _0x274725={};_0x274725[_0x1b4f5c]={'$like':'%'+_0x2cf33b['query'][_0x3ec2('0x3a')]+'%'};return _0x274725;})});}_0x7332e1=_[_0x3ec2('0x3b')]({},_0x7332e1,_0x2cf33b[_0x3ec2('0x3e')]);return _0x80cef[_0x3ec2('0x4d')](_0x7332e1);}})['then'](function(_0x5e8aa6){if(_0x5e8aa6){_0x176688=_0x5e8aa6[_0x3ec2('0x45')];if(!_0x2cf33b[_0x3ec2('0x31')][_0x3ec2('0x35')](_0x3ec2('0x36'))){_0x7332e1[_0x3ec2('0x20')]=qs[_0x3ec2('0x20')](_0x2cf33b['query'][_0x3ec2('0x20')]);_0x7332e1[_0x3ec2('0x22')]=qs[_0x3ec2('0x22')](_0x2cf33b[_0x3ec2('0x31')][_0x3ec2('0x22')]);}return _0x80cef[_0x3ec2('0x4d')](_0x7332e1);}})[_0x3ec2('0x26')](function(_0xbbbbd0){if(_0xbbbbd0){return _0xbbbbd0?{'count':_0x176688,'rows':_0xbbbbd0}:null;}})['then'](respondWithResult(_0x47f7d2,null))['catch'](handleError(_0x47f7d2,null));};exports[_0x3ec2('0x4f')]=function(_0x1bf400,_0xd26e30,_0x116fbf){var _0xee81cb={};var _0x2590df={};var _0x345e70;var _0x2a9f4c;return db['ZendeskConfiguration'][_0x3ec2('0x4e')]({'where':{'id':_0x1bf400[_0x3ec2('0x43')]['id']}})[_0x3ec2('0x26')](handleEntityNotFound(_0xd26e30,null))[_0x3ec2('0x26')](function(_0x59fa52){if(_0x59fa52){_0x345e70=_0x59fa52;_0x2590df[_0x3ec2('0x30')]=_['keys'](db[_0x3ec2('0x4b')]['rawAttributes']);_0x2590df['query']=_[_0x3ec2('0x44')](_0x1bf400[_0x3ec2('0x31')]);_0x2590df[_0x3ec2('0x39')]=_['intersection'](_0x2590df['model'],_0x2590df[_0x3ec2('0x31')]);_0xee81cb[_0x3ec2('0x34')]=_[_0x3ec2('0x32')](_0x2590df[_0x3ec2('0x30')],qs[_0x3ec2('0x33')](_0x1bf400[_0x3ec2('0x31')][_0x3ec2('0x33')]));_0xee81cb[_0x3ec2('0x34')]=_0xee81cb[_0x3ec2('0x34')]['length']?_0xee81cb[_0x3ec2('0x34')]:_0x2590df['model'];_0xee81cb['order']=qs[_0x3ec2('0x38')](_0x1bf400[_0x3ec2('0x31')][_0x3ec2('0x38')]);_0xee81cb[_0x3ec2('0x3c')]=qs[_0x3ec2('0x39')](_[_0x3ec2('0x4c')](_0x1bf400[_0x3ec2('0x31')],_0x2590df[_0x3ec2('0x39')]));if(_0x1bf400[_0x3ec2('0x31')][_0x3ec2('0x3a')]){_0xee81cb['where']=_['merge'](_0xee81cb[_0x3ec2('0x3c')],{'$or':_[_0x3ec2('0x2b')](_0xee81cb[_0x3ec2('0x34')],function(_0x17179e){var _0x25eb02={};_0x25eb02[_0x17179e]={'$like':'%'+_0x1bf400[_0x3ec2('0x31')]['filter']+'%'};return _0x25eb02;})});}_0xee81cb=_[_0x3ec2('0x3b')]({},_0xee81cb,_0x1bf400[_0x3ec2('0x3e')]);return _0x345e70[_0x3ec2('0x4f')](_0xee81cb);}})[_0x3ec2('0x26')](function(_0x3ab89b){if(_0x3ab89b){_0x2a9f4c=_0x3ab89b[_0x3ec2('0x45')];if(!_0x1bf400['query']['hasOwnProperty'](_0x3ec2('0x36'))){_0xee81cb[_0x3ec2('0x20')]=qs[_0x3ec2('0x20')](_0x1bf400[_0x3ec2('0x31')][_0x3ec2('0x20')]);_0xee81cb['offset']=qs[_0x3ec2('0x22')](_0x1bf400[_0x3ec2('0x31')][_0x3ec2('0x22')]);}return _0x345e70[_0x3ec2('0x4f')](_0xee81cb);}})[_0x3ec2('0x26')](function(_0x2eb4a7){if(_0x2eb4a7){return _0x2eb4a7?{'count':_0x2a9f4c,'rows':_0x2eb4a7}:null;}})['then'](respondWithResult(_0xd26e30,null))[_0x3ec2('0x41')](handleError(_0xd26e30,null));};exports['getTags']=function(_0x51cd83,_0x1bf9ff,_0x5f4e01){var _0x61eadb={};var _0x2eed4c={};var _0x686782;var _0xd250f9;return db[_0x3ec2('0x2c')]['findOne']({'where':{'id':_0x51cd83[_0x3ec2('0x43')]['id']}})[_0x3ec2('0x26')](handleEntityNotFound(_0x1bf9ff,null))[_0x3ec2('0x26')](function(_0x4e9137){if(_0x4e9137){_0x686782=_0x4e9137;_0x2eed4c[_0x3ec2('0x30')]=_['keys'](db['Tag'][_0x3ec2('0x2d')]);_0x2eed4c['query']=_['keys'](_0x51cd83[_0x3ec2('0x31')]);_0x2eed4c['filters']=_[_0x3ec2('0x32')](_0x2eed4c[_0x3ec2('0x30')],_0x2eed4c[_0x3ec2('0x31')]);_0x61eadb[_0x3ec2('0x34')]=_[_0x3ec2('0x32')](_0x2eed4c['model'],qs[_0x3ec2('0x33')](_0x51cd83[_0x3ec2('0x31')][_0x3ec2('0x33')]));_0x61eadb['attributes']=_0x61eadb[_0x3ec2('0x34')]['length']?_0x61eadb[_0x3ec2('0x34')]:_0x2eed4c['model'];_0x61eadb[_0x3ec2('0x37')]=qs['sort'](_0x51cd83['query'][_0x3ec2('0x38')]);_0x61eadb[_0x3ec2('0x3c')]=qs[_0x3ec2('0x39')](_[_0x3ec2('0x4c')](_0x51cd83[_0x3ec2('0x31')],_0x2eed4c['filters']));if(_0x51cd83[_0x3ec2('0x31')]['filter']){_0x61eadb[_0x3ec2('0x3c')]=_[_0x3ec2('0x3b')](_0x61eadb['where'],{'$or':_['map'](_0x61eadb[_0x3ec2('0x34')],function(_0x29c39f){var _0x3b975f={};_0x3b975f[_0x29c39f]={'$like':'%'+_0x51cd83[_0x3ec2('0x31')][_0x3ec2('0x3a')]+'%'};return _0x3b975f;})});}_0x61eadb=_[_0x3ec2('0x3b')]({},_0x61eadb,_0x51cd83[_0x3ec2('0x3e')]);return _0x686782[_0x3ec2('0x50')](_0x61eadb);}})[_0x3ec2('0x26')](function(_0x58de1e){if(_0x58de1e){_0xd250f9=_0x58de1e[_0x3ec2('0x45')];if(!_0x51cd83[_0x3ec2('0x31')][_0x3ec2('0x35')](_0x3ec2('0x36'))){_0x61eadb[_0x3ec2('0x20')]=qs['limit'](_0x51cd83[_0x3ec2('0x31')]['limit']);_0x61eadb[_0x3ec2('0x22')]=qs['offset'](_0x51cd83[_0x3ec2('0x31')][_0x3ec2('0x22')]);}return _0x686782[_0x3ec2('0x50')](_0x61eadb);}})['then'](function(_0x2e9496){if(_0x2e9496){return _0x2e9496?{'count':_0xd250f9,'rows':_0x2e9496}:null;}})[_0x3ec2('0x26')](respondWithResult(_0x1bf9ff,null))[_0x3ec2('0x41')](handleError(_0x1bf9ff,null));};exports['setTags']=function(_0x573998,_0x4be6aa,_0x597368){if(_0x573998[_0x3ec2('0x48')]['id']){delete _0x573998['body']['id'];}return db[_0x3ec2('0x2c')][_0x3ec2('0x4e')]({'where':{'id':_0x573998['params']['id']}})[_0x3ec2('0x26')](handleEntityNotFound(_0x4be6aa,null))[_0x3ec2('0x26')](function(_0x374b63){if(_0x374b63){return _0x374b63[_0x3ec2('0x51')](_0x573998[_0x3ec2('0x48')][_0x3ec2('0x52')]||[]);}return null;})[_0x3ec2('0x26')](respondWithResult(_0x4be6aa,null))[_0x3ec2('0x41')](handleError(_0x4be6aa,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3ca0d7d..0acdd39 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 _0x0102=['api','moment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','util','../../config/logger'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x0102,0x186));var _0x2010=function(_0x207f57,_0x52faff){_0x207f57=_0x207f57-0x0;var _0x13e729=_0x0102[_0x207f57];return _0x13e729;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var moment=require(_0x2010('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2010('0x4'));module[_0x2010('0x5')]=function(_0x130725,_0x304264){return _0x130725['define'](_0x2010('0x6'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2e=['exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x5e6e76,_0x2cb0f5){_0x5e6e76=_0x5e6e76-0x0;var _0x11c993=_0x4e2e[_0x5e6e76];return _0x11c993;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 2921127..8835ac0 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 _0x0049=['request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3e5cb3,_0x5dc67e){var _0x4351b0=function(_0x2a7433){while(--_0x2a7433){_0x3e5cb3['push'](_0x3e5cb3['shift']());}};_0x4351b0(++_0x5dc67e);}(_0x0049,0xfd));var _0x9004=function(_0x43e392,_0x52b558){_0x43e392=_0x43e392-0x0;var _0x2f64bc=_0x0049[_0x43e392];return _0x2f64bc;};'use strict';var _=require(_0x9004('0x0'));var util=require(_0x9004('0x1'));var moment=require(_0x9004('0x2'));var BPromise=require(_0x9004('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9004('0x4'));var logger=require(_0x9004('0x5'))(_0x9004('0x6'));var config=require(_0x9004('0x7'));var jayson=require(_0x9004('0x8'));var client=jayson[_0x9004('0x9')][_0x9004('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ef1,_0xf3d01e,_0x4fc2af){return new BPromise(function(_0x34f8b3,_0xa6341b){return client[_0x9004('0xb')](_0x159ef1,_0x4fc2af)[_0x9004('0xc')](function(_0x6218eb){logger['info'](_0x9004('0xd'),_0xf3d01e,_0x9004('0xe'));logger[_0x9004('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xf3d01e,_0x9004('0xe'),JSON[_0x9004('0x10')](_0x6218eb));if(_0x6218eb[_0x9004('0x11')]){if(_0x6218eb[_0x9004('0x11')]['code']===0x1f4){logger[_0x9004('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0xf3d01e,_0x6218eb[_0x9004('0x11')][_0x9004('0x12')]);return _0xa6341b(_0x6218eb[_0x9004('0x11')]['message']);}logger[_0x9004('0x11')](_0x9004('0xd'),_0xf3d01e,_0x6218eb[_0x9004('0x11')][_0x9004('0x12')]);return _0x34f8b3(_0x6218eb[_0x9004('0x11')][_0x9004('0x12')]);}else{logger[_0x9004('0x13')](_0x9004('0xd'),_0xf3d01e,_0x9004('0xe'));_0x34f8b3(_0x6218eb[_0x9004('0x14')][_0x9004('0x12')]);}})[_0x9004('0x15')](function(_0x2e9ba0){logger[_0x9004('0x11')](_0x9004('0xd'),_0xf3d01e,_0x2e9ba0);_0xa6341b(_0x2e9ba0);});});} \ No newline at end of file +var _0x9938=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x350b4a,_0x6bc983){var _0x5d0cd2=function(_0x45cf8e){while(--_0x45cf8e){_0x350b4a['push'](_0x350b4a['shift']());}};_0x5d0cd2(++_0x6bc983);}(_0x9938,0x141));var _0x8993=function(_0x22f817,_0x1e1c9d){_0x22f817=_0x22f817-0x0;var _0x25a2a9=_0x9938[_0x22f817];return _0x25a2a9;};'use strict';var _=require(_0x8993('0x0'));var util=require(_0x8993('0x1'));var moment=require(_0x8993('0x2'));var BPromise=require(_0x8993('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8993('0x4'));var db=require(_0x8993('0x5'))['db'];var utils=require(_0x8993('0x6'));var logger=require(_0x8993('0x7'))(_0x8993('0x8'));var config=require(_0x8993('0x9'));var jayson=require(_0x8993('0xa'));var client=jayson[_0x8993('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x516f54,_0x5c6595,_0x26228d){return new BPromise(function(_0x515180,_0x4838fe){return client[_0x8993('0xc')](_0x516f54,_0x26228d)[_0x8993('0xd')](function(_0x2ab7e3){logger[_0x8993('0xe')](_0x8993('0xf'),_0x5c6595,_0x8993('0x10'));logger[_0x8993('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5c6595,_0x8993('0x10'),JSON[_0x8993('0x12')](_0x2ab7e3));if(_0x2ab7e3[_0x8993('0x13')]){if(_0x2ab7e3[_0x8993('0x13')][_0x8993('0x14')]===0x1f4){logger[_0x8993('0x13')](_0x8993('0xf'),_0x5c6595,_0x2ab7e3[_0x8993('0x13')][_0x8993('0x15')]);return _0x4838fe(_0x2ab7e3[_0x8993('0x13')][_0x8993('0x15')]);}logger[_0x8993('0x13')](_0x8993('0xf'),_0x5c6595,_0x2ab7e3['error']['message']);return _0x515180(_0x2ab7e3[_0x8993('0x13')]['message']);}else{logger[_0x8993('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5c6595,_0x8993('0x10'));_0x515180(_0x2ab7e3[_0x8993('0x16')]['message']);}})['catch'](function(_0x265e2a){logger[_0x8993('0x13')](_0x8993('0xf'),_0x5c6595,_0x265e2a);_0x4838fe(_0x265e2a);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 7602d0c..c2aa5fd 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 _0x5339=['index','show','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x289f4b,_0x40620b){var _0x926264=function(_0x175ab8){while(--_0x175ab8){_0x289f4b['push'](_0x289f4b['shift']());}};_0x926264(++_0x40620b);}(_0x5339,0x1c2));var _0x9533=function(_0x2900c0,_0x41e64b){_0x2900c0=_0x2900c0-0x0;var _0x3f81ef=_0x5339[_0x2900c0];return _0x3f81ef;};'use strict';var multer=require(_0x9533('0x0'));var util=require(_0x9533('0x1'));var path=require('path');var timeout=require(_0x9533('0x2'));var express=require('express');var router=express[_0x9533('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9533('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9533('0x5'));var controller=require(_0x9533('0x6'));router[_0x9533('0x7')]('/',auth[_0x9533('0x8')](),controller[_0x9533('0x9')]);router['get']('/:id',auth[_0x9533('0x8')](),controller[_0x9533('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9533('0xb')]);router[_0x9533('0xc')](_0x9533('0xd'),auth[_0x9533('0x8')](),controller[_0x9533('0xe')]);router[_0x9533('0xf')](_0x9533('0xd'),auth[_0x9533('0x8')](),controller[_0x9533('0x10')]);module['exports']=router; \ No newline at end of file +var _0x328b=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x17a05c,_0xff092f){var _0x297ef9=function(_0x167741){while(--_0x167741){_0x17a05c['push'](_0x17a05c['shift']());}};_0x297ef9(++_0xff092f);}(_0x328b,0x8b));var _0xb328=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0x328b[_0x38aeea];return _0x5e8d2c;};'use strict';var multer=require('multer');var util=require(_0xb328('0x0'));var path=require(_0xb328('0x1'));var timeout=require(_0xb328('0x2'));var express=require(_0xb328('0x3'));var router=express['Router']();var fs_extra=require(_0xb328('0x4'));var auth=require(_0xb328('0x5'));var interaction=require(_0xb328('0x6'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xb328('0x7')]('/',auth[_0xb328('0x8')](),controller[_0xb328('0x9')]);router[_0xb328('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb328('0xa')]('/',auth[_0xb328('0x8')](),controller[_0xb328('0xb')]);router[_0xb328('0xc')](_0xb328('0xd'),auth['isAuthenticated'](),controller[_0xb328('0xe')]);router[_0xb328('0xf')](_0xb328('0xd'),auth[_0xb328('0x8')](),controller[_0xb328('0x10')]);module[_0xb328('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 20e8248..2b90aec 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 _0xdbfb=['exports','ENUM','string','variable','customVariable','STRING'];(function(_0x14705d,_0x145e6f){var _0xb95cd=function(_0x30ae06){while(--_0x30ae06){_0x14705d['push'](_0x14705d['shift']());}};_0xb95cd(++_0x145e6f);}(_0xdbfb,0x1bc));var _0xbdbf=function(_0x3702f0,_0x638441){_0x3702f0=_0x3702f0-0x0;var _0x39f9cf=_0xdbfb[_0x3702f0];return _0x39f9cf;};'use strict';var Sequelize=require('sequelize');module[_0xbdbf('0x0')]={'type':{'type':Sequelize[_0xbdbf('0x1')](_0xbdbf('0x2'),_0xbdbf('0x3'),_0xbdbf('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xbdbf('0x5')]},'key':{'type':Sequelize[_0xbdbf('0x5')]},'keyType':{'type':Sequelize[_0xbdbf('0x1')](_0xbdbf('0x2'),_0xbdbf('0x3'),_0xbdbf('0x4'))},'keyContent':{'type':Sequelize[_0xbdbf('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbdbf('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1de4=['string','variable','customVariable','picklist','STRING','BOOLEAN','ENUM'];(function(_0x3efe8e,_0x37544a){var _0xdfe2e4=function(_0x1c2f94){while(--_0x1c2f94){_0x3efe8e['push'](_0x3efe8e['shift']());}};_0xdfe2e4(++_0x37544a);}(_0x1de4,0x1c6));var _0x41de=function(_0x1eb24f,_0x5229b6){_0x1eb24f=_0x1eb24f-0x0;var _0x23594a=_0x1de4[_0x1eb24f];return _0x23594a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x41de('0x0')](_0x41de('0x1'),_0x41de('0x2'),_0x41de('0x3'),'keyValue',_0x41de('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x41de('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x41de('0x0')](_0x41de('0x1'),_0x41de('0x2'),_0x41de('0x3'))},'keyContent':{'type':Sequelize[_0x41de('0x5')]},'idField':{'type':Sequelize[_0x41de('0x5')]},'nameField':{'type':Sequelize[_0x41de('0x5')]},'customField':{'type':Sequelize[_0x41de('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x41de('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2243de8..0e4c7b0 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 _0x0d9f=['then','rows','catch','show','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','merge','filter','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d9f,0x136));var _0xf0d9=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x0d9f[_0x58547b];return _0x1d3fd2;};'use strict';var emlformat=require(_0xf0d9('0x0'));var rimraf=require(_0xf0d9('0x1'));var zipdir=require(_0xf0d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0d9('0x3'));var moment=require(_0xf0d9('0x4'));var BPromise=require(_0xf0d9('0x5'));var Mustache=require(_0xf0d9('0x6'));var util=require(_0xf0d9('0x7'));var path=require(_0xf0d9('0x8'));var sox=require(_0xf0d9('0x9'));var csv=require(_0xf0d9('0xa'));var ejs=require(_0xf0d9('0xb'));var fs=require('fs');var fs_extra=require(_0xf0d9('0xc'));var _=require(_0xf0d9('0xd'));var squel=require('squel');var crypto=require(_0xf0d9('0xe'));var jsforce=require(_0xf0d9('0xf'));var deskjs=require(_0xf0d9('0x10'));var toCsv=require(_0xf0d9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0d9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf0d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0d9('0x13'));var logger=require(_0xf0d9('0x14'))('api');var utils=require(_0xf0d9('0x15'));var config=require(_0xf0d9('0x16'));var licenseUtil=require(_0xf0d9('0x17'));var db=require(_0xf0d9('0x18'))['db'];function respondWithStatusCode(_0x565dc1,_0x88e885){_0x88e885=_0x88e885||0xcc;return function(_0x176fc1){if(_0x176fc1){return _0x565dc1[_0xf0d9('0x19')](_0x88e885);}return _0x565dc1[_0xf0d9('0x1a')](_0x88e885)[_0xf0d9('0x1b')]();};}function respondWithResult(_0x31d39e,_0x542139){_0x542139=_0x542139||0xc8;return function(_0x4504cd){if(_0x4504cd){return _0x31d39e[_0xf0d9('0x1a')](_0x542139)['json'](_0x4504cd);}};}function respondWithFilteredResult(_0x206e0c,_0x16e284){return function(_0x4a25f2){if(_0x4a25f2){var _0x536ff2=typeof _0x16e284[_0xf0d9('0x1c')]===_0xf0d9('0x1d')&&typeof _0x16e284['limit']===_0xf0d9('0x1d');var _0x390bb5=_0x4a25f2[_0xf0d9('0x1e')];var _0x4bf934=_0x536ff2?0x0:_0x16e284[_0xf0d9('0x1c')];var _0x572569=_0x536ff2?_0x4a25f2[_0xf0d9('0x1e')]:_0x16e284[_0xf0d9('0x1c')]+_0x16e284['limit'];var _0x4c24f3;if(_0x572569>=_0x390bb5){_0x572569=_0x390bb5;_0x4c24f3=0xc8;}else{_0x4c24f3=0xce;}_0x206e0c[_0xf0d9('0x1a')](_0x4c24f3);return _0x206e0c['set'](_0xf0d9('0x1f'),_0x4bf934+'-'+_0x572569+'/'+_0x390bb5)[_0xf0d9('0x20')](_0x4a25f2);}return null;};}function patchUpdates(_0xd15391){return function(_0x5777ef){try{jsonpatch[_0xf0d9('0x21')](_0x5777ef,_0xd15391,!![]);}catch(_0x4f64aa){return BPromise[_0xf0d9('0x22')](_0x4f64aa);}return _0x5777ef[_0xf0d9('0x23')]();};}function saveUpdates(_0x14df50,_0x3f3b89){return function(_0x32eb32){if(_0x32eb32){return _0x32eb32[_0xf0d9('0x24')](_0x14df50)['then'](function(_0x4b3b99){return _0x4b3b99;});}return null;};}function removeEntity(_0x4570bb,_0x2c57dd){return function(_0x4fc4f5){if(_0x4fc4f5){return _0x4fc4f5[_0xf0d9('0x25')]()['then'](function(){_0x4570bb['status'](0xcc)[_0xf0d9('0x1b')]();});}};}function handleEntityNotFound(_0x4b2f90,_0x696799){return function(_0x4fcc7d){if(!_0x4fcc7d){_0x4b2f90[_0xf0d9('0x19')](0x194);}return _0x4fcc7d;};}function handleError(_0x5cbfba,_0x19a084){_0x19a084=_0x19a084||0x1f4;return function(_0x283f84){logger[_0xf0d9('0x26')](_0x283f84[_0xf0d9('0x27')]);if(_0x283f84[_0xf0d9('0x28')]){delete _0x283f84[_0xf0d9('0x28')];}_0x5cbfba[_0xf0d9('0x1a')](_0x19a084)[_0xf0d9('0x29')](_0x283f84);};}exports[_0xf0d9('0x2a')]=function(_0x329ae0,_0x22418b){var _0x6ffeda={},_0x4fecc3={},_0x3d3534={'count':0x0,'rows':[]};var _0x4f3958=_[_0xf0d9('0x2b')](db[_0xf0d9('0x2c')][_0xf0d9('0x2d')],function(_0x3f160f){return{'name':_0x3f160f[_0xf0d9('0x2e')],'type':_0x3f160f[_0xf0d9('0x2f')]['key']};});_0x4fecc3[_0xf0d9('0x30')]=_[_0xf0d9('0x2b')](_0x4f3958,_0xf0d9('0x28'));_0x4fecc3[_0xf0d9('0x31')]=_['keys'](_0x329ae0['query']);_0x4fecc3['filters']=_[_0xf0d9('0x32')](_0x4fecc3[_0xf0d9('0x30')],_0x4fecc3[_0xf0d9('0x31')]);_0x6ffeda['attributes']=_[_0xf0d9('0x32')](_0x4fecc3[_0xf0d9('0x30')],qs[_0xf0d9('0x33')](_0x329ae0[_0xf0d9('0x31')][_0xf0d9('0x33')]));_0x6ffeda[_0xf0d9('0x34')]=_0x6ffeda[_0xf0d9('0x34')][_0xf0d9('0x35')]?_0x6ffeda[_0xf0d9('0x34')]:_0x4fecc3[_0xf0d9('0x30')];if(!_0x329ae0[_0xf0d9('0x31')]['hasOwnProperty'](_0xf0d9('0x36'))){_0x6ffeda[_0xf0d9('0x37')]=qs[_0xf0d9('0x37')](_0x329ae0[_0xf0d9('0x31')][_0xf0d9('0x37')]);_0x6ffeda[_0xf0d9('0x1c')]=qs[_0xf0d9('0x1c')](_0x329ae0[_0xf0d9('0x31')]['offset']);}_0x6ffeda[_0xf0d9('0x38')]=qs['sort'](_0x329ae0['query'][_0xf0d9('0x39')]);_0x6ffeda[_0xf0d9('0x3a')]=qs[_0xf0d9('0x3b')](_[_0xf0d9('0x3c')](_0x329ae0[_0xf0d9('0x31')],_0x4fecc3[_0xf0d9('0x3b')]),_0x4f3958);if(_0x329ae0[_0xf0d9('0x31')]['filter']){_0x6ffeda[_0xf0d9('0x3a')]=_[_0xf0d9('0x3d')](_0x6ffeda['where'],{'$or':_[_0xf0d9('0x2b')](_0x4f3958,function(_0x3298a2){if(_0x3298a2[_0xf0d9('0x2f')]!=='VIRTUAL'){var _0x3b77b6={};_0x3b77b6[_0x3298a2[_0xf0d9('0x28')]]={'$like':'%'+_0x329ae0[_0xf0d9('0x31')][_0xf0d9('0x3e')]+'%'};return _0x3b77b6;}})});}_0x6ffeda=_[_0xf0d9('0x3d')]({},_0x6ffeda,_0x329ae0['options']);var _0x23b87a={'where':_0x6ffeda[_0xf0d9('0x3a')]};return db[_0xf0d9('0x2c')]['count'](_0x23b87a)['then'](function(_0x21e2c8){_0x3d3534['count']=_0x21e2c8;if(_0x329ae0[_0xf0d9('0x31')][_0xf0d9('0x3f')]){_0x6ffeda[_0xf0d9('0x40')]=[{'all':!![]}];}return db[_0xf0d9('0x2c')]['findAll'](_0x6ffeda);})[_0xf0d9('0x41')](function(_0x2192c5){_0x3d3534[_0xf0d9('0x42')]=_0x2192c5;return _0x3d3534;})[_0xf0d9('0x41')](respondWithFilteredResult(_0x22418b,_0x6ffeda))[_0xf0d9('0x43')](handleError(_0x22418b,null));};exports[_0xf0d9('0x44')]=function(_0x58f265,_0x349e19){var _0x486862={'raw':!![],'where':{'id':_0x58f265[_0xf0d9('0x45')]['id']}},_0x16c63c={};_0x16c63c[_0xf0d9('0x30')]=_[_0xf0d9('0x46')](db['ZendeskField']['rawAttributes']);_0x16c63c[_0xf0d9('0x31')]=_[_0xf0d9('0x46')](_0x58f265[_0xf0d9('0x31')]);_0x16c63c[_0xf0d9('0x3b')]=_[_0xf0d9('0x32')](_0x16c63c['model'],_0x16c63c[_0xf0d9('0x31')]);_0x486862[_0xf0d9('0x34')]=_['intersection'](_0x16c63c['model'],qs[_0xf0d9('0x33')](_0x58f265[_0xf0d9('0x31')][_0xf0d9('0x33')]));_0x486862['attributes']=_0x486862[_0xf0d9('0x34')][_0xf0d9('0x35')]?_0x486862['attributes']:_0x16c63c[_0xf0d9('0x30')];if(_0x58f265[_0xf0d9('0x31')][_0xf0d9('0x3f')]){_0x486862[_0xf0d9('0x40')]=[{'all':!![]}];}_0x486862=_[_0xf0d9('0x3d')]({},_0x486862,_0x58f265[_0xf0d9('0x47')]);return db['ZendeskField'][_0xf0d9('0x48')](_0x486862)['then'](handleEntityNotFound(_0x349e19,null))['then'](respondWithResult(_0x349e19,null))[_0xf0d9('0x43')](handleError(_0x349e19,null));};exports[_0xf0d9('0x49')]=function(_0x580ce4,_0x6898e1){return db[_0xf0d9('0x2c')][_0xf0d9('0x49')](_0x580ce4[_0xf0d9('0x4a')],{})['then'](respondWithResult(_0x6898e1,0xc9))[_0xf0d9('0x43')](handleError(_0x6898e1,null));};exports[_0xf0d9('0x24')]=function(_0x13d5e3,_0x2abba3){if(_0x13d5e3[_0xf0d9('0x4a')]['id']){delete _0x13d5e3[_0xf0d9('0x4a')]['id'];}return db['ZendeskField'][_0xf0d9('0x48')]({'where':{'id':_0x13d5e3[_0xf0d9('0x45')]['id']}})['then'](handleEntityNotFound(_0x2abba3,null))['then'](saveUpdates(_0x13d5e3[_0xf0d9('0x4a')],null))[_0xf0d9('0x41')](respondWithResult(_0x2abba3,null))[_0xf0d9('0x43')](handleError(_0x2abba3,null));};exports[_0xf0d9('0x25')]=function(_0x34d303,_0x2a99d2){return db[_0xf0d9('0x2c')][_0xf0d9('0x48')]({'where':{'id':_0x34d303[_0xf0d9('0x45')]['id']}})[_0xf0d9('0x41')](handleEntityNotFound(_0x2a99d2,null))[_0xf0d9('0x41')](removeEntity(_0x2a99d2,null))[_0xf0d9('0x43')](handleError(_0x2a99d2,null));}; \ No newline at end of file +var _0x21ce=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','name','send','index','ZendeskField','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','nolimit','sort','pick','where','merge','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x37004b,_0x1f0b3f){var _0x9df09a=function(_0x237ab7){while(--_0x237ab7){_0x37004b['push'](_0x37004b['shift']());}};_0x9df09a(++_0x1f0b3f);}(_0x21ce,0x196));var _0xe21c=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x21ce[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe21c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe21c('0x1'));var moment=require(_0xe21c('0x2'));var BPromise=require(_0xe21c('0x3'));var Mustache=require(_0xe21c('0x4'));var util=require(_0xe21c('0x5'));var path=require(_0xe21c('0x6'));var sox=require('sox');var csv=require(_0xe21c('0x7'));var ejs=require(_0xe21c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe21c('0x9'));var squel=require(_0xe21c('0xa'));var crypto=require('crypto');var jsforce=require(_0xe21c('0xb'));var deskjs=require(_0xe21c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe21c('0xd'));var Papa=require(_0xe21c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe21c('0xf'));var as=require(_0xe21c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe21c('0x11'))(_0xe21c('0x12'));var utils=require(_0xe21c('0x13'));var config=require(_0xe21c('0x14'));var licenseUtil=require(_0xe21c('0x15'));var db=require(_0xe21c('0x16'))['db'];function respondWithStatusCode(_0x199c5f,_0x36aca7){_0x36aca7=_0x36aca7||0xcc;return function(_0x32e169){if(_0x32e169){return _0x199c5f['sendStatus'](_0x36aca7);}return _0x199c5f[_0xe21c('0x17')](_0x36aca7)['end']();};}function respondWithResult(_0x2576ff,_0x33b379){_0x33b379=_0x33b379||0xc8;return function(_0x35b80f){if(_0x35b80f){return _0x2576ff[_0xe21c('0x17')](_0x33b379)['json'](_0x35b80f);}};}function respondWithFilteredResult(_0x108afb,_0x453146){return function(_0xc5108b){if(_0xc5108b){var _0x450df8=typeof _0x453146[_0xe21c('0x18')]==='undefined'&&typeof _0x453146[_0xe21c('0x19')]===_0xe21c('0x1a');var _0xa44f11=_0xc5108b[_0xe21c('0x1b')];var _0xd02d02=_0x450df8?0x0:_0x453146[_0xe21c('0x18')];var _0x4e7fe3=_0x450df8?_0xc5108b[_0xe21c('0x1b')]:_0x453146[_0xe21c('0x18')]+_0x453146[_0xe21c('0x19')];var _0x32041c;if(_0x4e7fe3>=_0xa44f11){_0x4e7fe3=_0xa44f11;_0x32041c=0xc8;}else{_0x32041c=0xce;}_0x108afb['status'](_0x32041c);return _0x108afb[_0xe21c('0x1c')](_0xe21c('0x1d'),_0xd02d02+'-'+_0x4e7fe3+'/'+_0xa44f11)[_0xe21c('0x1e')](_0xc5108b);}return null;};}function patchUpdates(_0x5365ec){return function(_0x27cbdd){try{jsonpatch[_0xe21c('0x1f')](_0x27cbdd,_0x5365ec,!![]);}catch(_0x56cb4c){return BPromise[_0xe21c('0x20')](_0x56cb4c);}return _0x27cbdd[_0xe21c('0x21')]();};}function saveUpdates(_0x5b1a03,_0x1559d6){return function(_0x35d44f){if(_0x35d44f){return _0x35d44f[_0xe21c('0x22')](_0x5b1a03)['then'](function(_0x19467f){return _0x19467f;});}return null;};}function removeEntity(_0x3f4303,_0x2132e7){return function(_0x5263e5){if(_0x5263e5){return _0x5263e5[_0xe21c('0x23')]()[_0xe21c('0x24')](function(){_0x3f4303[_0xe21c('0x17')](0xcc)[_0xe21c('0x25')]();});}};}function handleEntityNotFound(_0x5a3d2f,_0xff5750){return function(_0x4e633c){if(!_0x4e633c){_0x5a3d2f[_0xe21c('0x26')](0x194);}return _0x4e633c;};}function handleError(_0x46745d,_0x7409ef){_0x7409ef=_0x7409ef||0x1f4;return function(_0x2d61dd){logger['error'](_0x2d61dd['stack']);if(_0x2d61dd[_0xe21c('0x27')]){delete _0x2d61dd[_0xe21c('0x27')];}_0x46745d['status'](_0x7409ef)[_0xe21c('0x28')](_0x2d61dd);};}exports[_0xe21c('0x29')]=function(_0x38e1d0,_0x42dd3f){var _0x1458c0={},_0x270c92={},_0x43744b={'count':0x0,'rows':[]};var _0x472340=_['map'](db[_0xe21c('0x2a')]['rawAttributes'],function(_0x115e10){return{'name':_0x115e10[_0xe21c('0x2b')],'type':_0x115e10['type'][_0xe21c('0x2c')]};});_0x270c92[_0xe21c('0x2d')]=_[_0xe21c('0x2e')](_0x472340,_0xe21c('0x27'));_0x270c92['query']=_[_0xe21c('0x2f')](_0x38e1d0[_0xe21c('0x30')]);_0x270c92[_0xe21c('0x31')]=_['intersection'](_0x270c92[_0xe21c('0x2d')],_0x270c92[_0xe21c('0x30')]);_0x1458c0['attributes']=_[_0xe21c('0x32')](_0x270c92[_0xe21c('0x2d')],qs[_0xe21c('0x33')](_0x38e1d0[_0xe21c('0x30')][_0xe21c('0x33')]));_0x1458c0[_0xe21c('0x34')]=_0x1458c0[_0xe21c('0x34')]['length']?_0x1458c0[_0xe21c('0x34')]:_0x270c92[_0xe21c('0x2d')];if(!_0x38e1d0['query']['hasOwnProperty'](_0xe21c('0x35'))){_0x1458c0[_0xe21c('0x19')]=qs[_0xe21c('0x19')](_0x38e1d0[_0xe21c('0x30')][_0xe21c('0x19')]);_0x1458c0[_0xe21c('0x18')]=qs[_0xe21c('0x18')](_0x38e1d0[_0xe21c('0x30')][_0xe21c('0x18')]);}_0x1458c0['order']=qs[_0xe21c('0x36')](_0x38e1d0[_0xe21c('0x30')]['sort']);_0x1458c0['where']=qs[_0xe21c('0x31')](_[_0xe21c('0x37')](_0x38e1d0[_0xe21c('0x30')],_0x270c92[_0xe21c('0x31')]),_0x472340);if(_0x38e1d0[_0xe21c('0x30')]['filter']){_0x1458c0[_0xe21c('0x38')]=_['merge'](_0x1458c0[_0xe21c('0x38')],{'$or':_[_0xe21c('0x2e')](_0x472340,function(_0x42f951){if(_0x42f951['type']!=='VIRTUAL'){var _0x3242dd={};_0x3242dd[_0x42f951['name']]={'$like':'%'+_0x38e1d0[_0xe21c('0x30')]['filter']+'%'};return _0x3242dd;}})});}_0x1458c0=_[_0xe21c('0x39')]({},_0x1458c0,_0x38e1d0['options']);var _0x1085dd={'where':_0x1458c0['where']};return db[_0xe21c('0x2a')]['count'](_0x1085dd)[_0xe21c('0x24')](function(_0x5d74af){_0x43744b[_0xe21c('0x1b')]=_0x5d74af;if(_0x38e1d0['query']['includeAll']){_0x1458c0[_0xe21c('0x3a')]=[{'all':!![]}];}return db[_0xe21c('0x2a')][_0xe21c('0x3b')](_0x1458c0);})[_0xe21c('0x24')](function(_0x1be300){_0x43744b[_0xe21c('0x3c')]=_0x1be300;return _0x43744b;})[_0xe21c('0x24')](respondWithFilteredResult(_0x42dd3f,_0x1458c0))[_0xe21c('0x3d')](handleError(_0x42dd3f,null));};exports[_0xe21c('0x3e')]=function(_0x57442d,_0x23e193){var _0x2ae3d0={'raw':!![],'where':{'id':_0x57442d[_0xe21c('0x3f')]['id']}},_0x1835ff={};_0x1835ff['model']=_[_0xe21c('0x2f')](db[_0xe21c('0x2a')]['rawAttributes']);_0x1835ff[_0xe21c('0x30')]=_[_0xe21c('0x2f')](_0x57442d[_0xe21c('0x30')]);_0x1835ff[_0xe21c('0x31')]=_[_0xe21c('0x32')](_0x1835ff[_0xe21c('0x2d')],_0x1835ff[_0xe21c('0x30')]);_0x2ae3d0[_0xe21c('0x34')]=_[_0xe21c('0x32')](_0x1835ff[_0xe21c('0x2d')],qs['fields'](_0x57442d[_0xe21c('0x30')]['fields']));_0x2ae3d0[_0xe21c('0x34')]=_0x2ae3d0[_0xe21c('0x34')][_0xe21c('0x40')]?_0x2ae3d0[_0xe21c('0x34')]:_0x1835ff[_0xe21c('0x2d')];if(_0x57442d[_0xe21c('0x30')][_0xe21c('0x41')]){_0x2ae3d0[_0xe21c('0x3a')]=[{'all':!![]}];}_0x2ae3d0=_[_0xe21c('0x39')]({},_0x2ae3d0,_0x57442d[_0xe21c('0x42')]);return db['ZendeskField'][_0xe21c('0x43')](_0x2ae3d0)[_0xe21c('0x24')](handleEntityNotFound(_0x23e193,null))[_0xe21c('0x24')](respondWithResult(_0x23e193,null))[_0xe21c('0x3d')](handleError(_0x23e193,null));};exports[_0xe21c('0x44')]=function(_0x29a533,_0x59bda0){return db[_0xe21c('0x2a')][_0xe21c('0x44')](_0x29a533['body'],{})['then'](respondWithResult(_0x59bda0,0xc9))[_0xe21c('0x3d')](handleError(_0x59bda0,null));};exports[_0xe21c('0x22')]=function(_0x565906,_0x238703){if(_0x565906[_0xe21c('0x45')]['id']){delete _0x565906['body']['id'];}return db['ZendeskField'][_0xe21c('0x43')]({'where':{'id':_0x565906['params']['id']}})[_0xe21c('0x24')](handleEntityNotFound(_0x238703,null))[_0xe21c('0x24')](saveUpdates(_0x565906[_0xe21c('0x45')],null))[_0xe21c('0x24')](respondWithResult(_0x238703,null))[_0xe21c('0x3d')](handleError(_0x238703,null));};exports['destroy']=function(_0x390d14,_0x188697){return db[_0xe21c('0x2a')][_0xe21c('0x43')]({'where':{'id':_0x390d14['params']['id']}})[_0xe21c('0x24')](handleEntityNotFound(_0x188697,null))[_0xe21c('0x24')](removeEntity(_0x188697,null))[_0xe21c('0x3d')](handleError(_0x188697,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index f356261..2236e02 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 _0xd09d=['./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x44b057,_0x4f87f2){var _0x440a12=function(_0x4512a7){while(--_0x4512a7){_0x44b057['push'](_0x44b057['shift']());}};_0x440a12(++_0x4f87f2);}(_0xd09d,0xca));var _0xdd09=function(_0x46bfe4,_0x3fd21b){_0x46bfe4=_0x46bfe4-0x0;var _0x4378c2=_0xd09d[_0x46bfe4];return _0x4378c2;};'use strict';var _=require(_0xdd09('0x0'));var util=require(_0xdd09('0x1'));var logger=require(_0xdd09('0x2'))('api');var moment=require(_0xdd09('0x3'));var BPromise=require(_0xdd09('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd09('0x5'));var rimraf=require(_0xdd09('0x6'));var config=require(_0xdd09('0x7'));var attributes=require(_0xdd09('0x8'));module[_0xdd09('0x9')]=function(_0x78365,_0x2977e8){return _0x78365[_0xdd09('0xa')](_0xdd09('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xdd09('0xc'),'fields':[_0xdd09('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x66ec=['exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes'];(function(_0x39c084,_0xbc0456){var _0x5e6575=function(_0x39c5e7){while(--_0x39c5e7){_0x39c084['push'](_0x39c084['shift']());}};_0x5e6575(++_0xbc0456);}(_0x66ec,0x166));var _0xc66e=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x66ec[_0x468a77];return _0x2d1c33;};'use strict';var _=require(_0xc66e('0x0'));var util=require(_0xc66e('0x1'));var logger=require(_0xc66e('0x2'))(_0xc66e('0x3'));var moment=require(_0xc66e('0x4'));var BPromise=require(_0xc66e('0x5'));var rp=require(_0xc66e('0x6'));var fs=require('fs');var path=require(_0xc66e('0x7'));var rimraf=require(_0xc66e('0x8'));var config=require('../../config/environment');var attributes=require(_0xc66e('0x9'));module[_0xc66e('0xa')]=function(_0x4852a0,_0x421ed7){return _0x4852a0[_0xc66e('0xb')](_0xc66e('0xc'),attributes,{'tableName':_0xc66e('0xd'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc66e('0xe'),_0xc66e('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 1014a5b..8d19954 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 _0x12f3=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0xcb9df0,_0x3f9ef9){var _0x4372ab=function(_0x5163cc){while(--_0x5163cc){_0xcb9df0['push'](_0xcb9df0['shift']());}};_0x4372ab(++_0x3f9ef9);}(_0x12f3,0x1c8));var _0x312f=function(_0x43daa8,_0x2b964e){_0x43daa8=_0x43daa8-0x0;var _0x42a182=_0x12f3[_0x43daa8];return _0x42a182;};'use strict';var _=require(_0x312f('0x0'));var util=require(_0x312f('0x1'));var moment=require(_0x312f('0x2'));var BPromise=require(_0x312f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x312f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x312f('0x5'));var logger=require(_0x312f('0x6'))(_0x312f('0x7'));var config=require(_0x312f('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47b40f,_0x4e34f7,_0x5b6c7e){return new BPromise(function(_0x382c98,_0x15a1b0){return client[_0x312f('0x9')](_0x47b40f,_0x5b6c7e)['then'](function(_0x1284b7){logger[_0x312f('0xa')](_0x312f('0xb'),_0x4e34f7,_0x312f('0xc'));logger[_0x312f('0xd')](_0x312f('0xe'),_0x4e34f7,'request\x20sent',JSON[_0x312f('0xf')](_0x1284b7));if(_0x1284b7['error']){if(_0x1284b7[_0x312f('0x10')]['code']===0x1f4){logger[_0x312f('0x10')](_0x312f('0xb'),_0x4e34f7,_0x1284b7[_0x312f('0x10')]['message']);return _0x15a1b0(_0x1284b7[_0x312f('0x10')][_0x312f('0x11')]);}logger[_0x312f('0x10')](_0x312f('0xb'),_0x4e34f7,_0x1284b7[_0x312f('0x10')]['message']);return _0x382c98(_0x1284b7[_0x312f('0x10')][_0x312f('0x11')]);}else{logger['info'](_0x312f('0xb'),_0x4e34f7,_0x312f('0xc'));_0x382c98(_0x1284b7['result']['message']);}})[_0x312f('0x12')](function(_0x6e1bf5){logger[_0x312f('0x10')](_0x312f('0xb'),_0x4e34f7,_0x6e1bf5);_0x15a1b0(_0x6e1bf5);});});} \ No newline at end of file +var _0x6639=['error','code','ZendeskField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','stringify'];(function(_0x1d95e1,_0x2dac2f){var _0x542fa0=function(_0x2ad2d0){while(--_0x2ad2d0){_0x1d95e1['push'](_0x1d95e1['shift']());}};_0x542fa0(++_0x2dac2f);}(_0x6639,0x16f));var _0x9663=function(_0x4b0907,_0x110b7c){_0x4b0907=_0x4b0907-0x0;var _0x212c12=_0x6639[_0x4b0907];return _0x212c12;};'use strict';var _=require(_0x9663('0x0'));var util=require('util');var moment=require(_0x9663('0x1'));var BPromise=require(_0x9663('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9663('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9663('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9663('0x5'));var jayson=require(_0x9663('0x6'));var client=jayson[_0x9663('0x7')][_0x9663('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x337663,_0x44d396,_0x3d8188){return new BPromise(function(_0x132d2b,_0x32b81c){return client[_0x9663('0x9')](_0x337663,_0x3d8188)[_0x9663('0xa')](function(_0x62ab7b){logger[_0x9663('0xb')]('ZendeskField,\x20%s,\x20%s',_0x44d396,'request\x20sent');logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x44d396,'request\x20sent',JSON[_0x9663('0xc')](_0x62ab7b));if(_0x62ab7b[_0x9663('0xd')]){if(_0x62ab7b[_0x9663('0xd')][_0x9663('0xe')]===0x1f4){logger[_0x9663('0xd')](_0x9663('0xf'),_0x44d396,_0x62ab7b[_0x9663('0xd')][_0x9663('0x10')]);return _0x32b81c(_0x62ab7b['error'][_0x9663('0x10')]);}logger[_0x9663('0xd')](_0x9663('0xf'),_0x44d396,_0x62ab7b[_0x9663('0xd')][_0x9663('0x10')]);return _0x132d2b(_0x62ab7b['error'][_0x9663('0x10')]);}else{logger['info'](_0x9663('0xf'),_0x44d396,_0x9663('0x11'));_0x132d2b(_0x62ab7b[_0x9663('0x12')]['message']);}})[_0x9663('0x13')](function(_0x2e406a){logger['error'](_0x9663('0xf'),_0x44d396,_0x2e406a);_0x32b81c(_0x2e406a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ad5e2b1..731f6a9 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 _0xfd81=['exports','multer','util','path','express','Router','./intZohoAccount.controller','get','index','isAuthenticated','show','getConfigurations','/:id/fields','create','post','/:id/configurations','/:id','update','delete','destroy'];(function(_0x49d0a9,_0x149014){var _0x3d8343=function(_0x12227e){while(--_0x12227e){_0x49d0a9['push'](_0x49d0a9['shift']());}};_0x3d8343(++_0x149014);}(_0xfd81,0x17d));var _0x1fd8=function(_0x526b22,_0x4bab06){_0x526b22=_0x526b22-0x0;var _0x53cd58=_0xfd81[_0x526b22];return _0x53cd58;};'use strict';var multer=require(_0x1fd8('0x0'));var util=require(_0x1fd8('0x1'));var path=require(_0x1fd8('0x2'));var timeout=require('connect-timeout');var express=require(_0x1fd8('0x3'));var router=express[_0x1fd8('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(_0x1fd8('0x5'));router[_0x1fd8('0x6')]('/',auth['isAuthenticated'](),controller[_0x1fd8('0x7')]);router[_0x1fd8('0x6')]('/:id',auth[_0x1fd8('0x8')](),controller[_0x1fd8('0x9')]);router[_0x1fd8('0x6')]('/:id/configurations',auth[_0x1fd8('0x8')](),controller[_0x1fd8('0xa')]);router[_0x1fd8('0x6')](_0x1fd8('0xb'),auth[_0x1fd8('0x8')](),controller['getFields']);router['post']('/',auth[_0x1fd8('0x8')](),controller[_0x1fd8('0xc')]);router[_0x1fd8('0xd')](_0x1fd8('0xe'),auth[_0x1fd8('0x8')](),controller['addConfiguration']);router['put'](_0x1fd8('0xf'),auth[_0x1fd8('0x8')](),controller[_0x1fd8('0x10')]);router[_0x1fd8('0x11')](_0x1fd8('0xf'),auth[_0x1fd8('0x8')](),controller[_0x1fd8('0x12')]);module[_0x1fd8('0x13')]=router; \ No newline at end of file +var _0xf105=['getFields','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','show','/:id/configurations'];(function(_0x58a515,_0x5a3e59){var _0x316384=function(_0x519362){while(--_0x519362){_0x58a515['push'](_0x58a515['shift']());}};_0x316384(++_0x5a3e59);}(_0xf105,0x76));var _0x5f10=function(_0x5323cd,_0x130c8d){_0x5323cd=_0x5323cd-0x0;var _0x5ac7fc=_0xf105[_0x5323cd];return _0x5ac7fc;};'use strict';var multer=require(_0x5f10('0x0'));var util=require(_0x5f10('0x1'));var path=require(_0x5f10('0x2'));var timeout=require(_0x5f10('0x3'));var express=require(_0x5f10('0x4'));var router=express[_0x5f10('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5f10('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f10('0x7'));var controller=require(_0x5f10('0x8'));router[_0x5f10('0x9')]('/',auth['isAuthenticated'](),controller[_0x5f10('0xa')]);router[_0x5f10('0x9')]('/:id',auth[_0x5f10('0xb')](),controller[_0x5f10('0xc')]);router['get'](_0x5f10('0xd'),auth[_0x5f10('0xb')](),controller['getConfigurations']);router[_0x5f10('0x9')]('/:id/fields',auth[_0x5f10('0xb')](),controller[_0x5f10('0xe')]);router[_0x5f10('0xf')]('/',auth[_0x5f10('0xb')](),controller[_0x5f10('0x10')]);router[_0x5f10('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5f10('0x11')](_0x5f10('0x12'),auth['isAuthenticated'](),controller[_0x5f10('0x13')]);router['delete'](_0x5f10('0x12'),auth[_0x5f10('0xb')](),controller[_0x5f10('0x14')]);module[_0x5f10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 987d68d..932a9ae 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 _0x153f=['exports','STRING','sequelize'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0x153f,0x15b));var _0xf153=function(_0x255845,_0x4dd796){_0x255845=_0x255845-0x0;var _0x51875c=_0x153f[_0x255845];return _0x51875c;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'host':{'type':Sequelize[_0xf153('0x2')]},'zone':{'type':Sequelize[_0xf153('0x2')]},'clientId':{'type':Sequelize[_0xf153('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xf153('0x2')]}}; \ No newline at end of file +var _0x9f62=['exports','STRING'];(function(_0x13904c,_0x24b5c3){var _0xc3f36a=function(_0xbd6640){while(--_0xbd6640){_0x13904c['push'](_0x13904c['shift']());}};_0xc3f36a(++_0x24b5c3);}(_0x9f62,0x154));var _0x29f6=function(_0xb7115e,_0x413dd4){_0xb7115e=_0xb7115e-0x0;var _0xb3fa18=_0x9f62[_0xb7115e];return _0xb3fa18;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x29f6('0x1')]},'host':{'type':Sequelize[_0x29f6('0x1')]},'zone':{'type':Sequelize[_0x29f6('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x29f6('0x1')]},'refreshToken':{'type':Sequelize[_0x29f6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f187ec2..03cb900 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 _0x4332=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','getConfigurations','ZohoConfiguration','pick','options','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','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','code','zoho.eu','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','zip-dir','bluebird','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter'];(function(_0x1fbce5,_0x19e006){var _0x5f3e35=function(_0xb4e110){while(--_0xb4e110){_0x1fbce5['push'](_0x1fbce5['shift']());}};_0x5f3e35(++_0x19e006);}(_0x4332,0xce));var _0x2433=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4332[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x2433('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2433('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2433('0x2'));var Mustache=require('mustache');var util=require(_0x2433('0x3'));var path=require(_0x2433('0x4'));var sox=require(_0x2433('0x5'));var csv=require(_0x2433('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2433('0x7'));var _=require(_0x2433('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2433('0x9'));var toCsv=require(_0x2433('0x6'));var querystring=require(_0x2433('0xa'));var Papa=require(_0x2433('0xb'));var Redis=require(_0x2433('0xc'));var authService=require(_0x2433('0xd'));var qs=require(_0x2433('0xe'));var as=require(_0x2433('0xf'));var hardwareService=require(_0x2433('0x10'));var logger=require(_0x2433('0x11'))(_0x2433('0x12'));var utils=require(_0x2433('0x13'));var config=require(_0x2433('0x14'));var licenseUtil=require(_0x2433('0x15'));var db=require(_0x2433('0x16'))['db'];var integrations=require(_0x2433('0x17'));function respondWithStatusCode(_0x20dd4e,_0x25a50c){_0x25a50c=_0x25a50c||0xcc;return function(_0x490d9c){if(_0x490d9c){return _0x20dd4e[_0x2433('0x18')](_0x25a50c);}return _0x20dd4e[_0x2433('0x19')](_0x25a50c)[_0x2433('0x1a')]();};}function respondWithResult(_0x10bc05,_0x324761){_0x324761=_0x324761||0xc8;return function(_0x1ec3c1){if(_0x1ec3c1){return _0x10bc05[_0x2433('0x19')](_0x324761)[_0x2433('0x1b')](_0x1ec3c1);}};}function respondWithFilteredResult(_0x77d962,_0x4dd660){return function(_0x33745e){if(_0x33745e){var _0x38b3fb=typeof _0x4dd660[_0x2433('0x1c')]===_0x2433('0x1d')&&typeof _0x4dd660['limit']===_0x2433('0x1d');var _0x24cdde=_0x33745e['count'];var _0x5ad587=_0x38b3fb?0x0:_0x4dd660[_0x2433('0x1c')];var _0x27257b=_0x38b3fb?_0x33745e[_0x2433('0x1e')]:_0x4dd660[_0x2433('0x1c')]+_0x4dd660[_0x2433('0x1f')];var _0xa3e57f;if(_0x27257b>=_0x24cdde){_0x27257b=_0x24cdde;_0xa3e57f=0xc8;}else{_0xa3e57f=0xce;}_0x77d962[_0x2433('0x19')](_0xa3e57f);return _0x77d962[_0x2433('0x20')](_0x2433('0x21'),_0x5ad587+'-'+_0x27257b+'/'+_0x24cdde)[_0x2433('0x1b')](_0x33745e);}return null;};}function patchUpdates(_0x130feb){return function(_0x8fcd4b){try{jsonpatch['apply'](_0x8fcd4b,_0x130feb,!![]);}catch(_0x15deac){return BPromise['reject'](_0x15deac);}return _0x8fcd4b[_0x2433('0x22')]();};}function saveUpdates(_0x3aa712,_0x251713){return function(_0x5d8966){if(_0x5d8966){return _0x5d8966[_0x2433('0x23')](_0x3aa712)[_0x2433('0x24')](function(_0x5cfc6b){return _0x5cfc6b;});}return null;};}function removeEntity(_0x2e2923,_0xe2b6a3){return function(_0x323b71){if(_0x323b71){return _0x323b71[_0x2433('0x25')]()['then'](function(){_0x2e2923[_0x2433('0x19')](0xcc)[_0x2433('0x1a')]();});}};}function handleEntityNotFound(_0x23e76c,_0x10fe9e){return function(_0x5bd5d3){if(!_0x5bd5d3){_0x23e76c['sendStatus'](0x194);}return _0x5bd5d3;};}function handleError(_0x1974e9,_0x703d96){_0x703d96=_0x703d96||0x1f4;return function(_0x1def17){logger['error'](_0x1def17[_0x2433('0x26')]);if(_0x1def17[_0x2433('0x27')]){delete _0x1def17['name'];}_0x1974e9[_0x2433('0x19')](_0x703d96)[_0x2433('0x28')](_0x1def17);};}exports[_0x2433('0x29')]=function(_0x49ed5d,_0x2b983f){var _0x5e659b={},_0x2c45e9={},_0x76b56={'count':0x0,'rows':[]};var _0x53d82b=_[_0x2433('0x2a')](db[_0x2433('0x2b')][_0x2433('0x2c')],function(_0x26fe12){return{'name':_0x26fe12[_0x2433('0x2d')],'type':_0x26fe12[_0x2433('0x2e')][_0x2433('0x2f')]};});_0x2c45e9[_0x2433('0x30')]=_[_0x2433('0x2a')](_0x53d82b,'name');_0x2c45e9[_0x2433('0x31')]=_['keys'](_0x49ed5d[_0x2433('0x31')]);_0x2c45e9[_0x2433('0x32')]=_[_0x2433('0x33')](_0x2c45e9['model'],_0x2c45e9[_0x2433('0x31')]);_0x5e659b['attributes']=_['intersection'](_0x2c45e9[_0x2433('0x30')],qs['fields'](_0x49ed5d['query'][_0x2433('0x34')]));_0x5e659b[_0x2433('0x35')]=_0x5e659b[_0x2433('0x35')][_0x2433('0x36')]?_0x5e659b[_0x2433('0x35')]:_0x2c45e9[_0x2433('0x30')];if(!_0x49ed5d[_0x2433('0x31')]['hasOwnProperty'](_0x2433('0x37'))){_0x5e659b['limit']=qs[_0x2433('0x1f')](_0x49ed5d['query'][_0x2433('0x1f')]);_0x5e659b['offset']=qs[_0x2433('0x1c')](_0x49ed5d[_0x2433('0x31')][_0x2433('0x1c')]);}_0x5e659b[_0x2433('0x38')]=qs[_0x2433('0x39')](_0x49ed5d['query'][_0x2433('0x39')]);_0x5e659b[_0x2433('0x3a')]=qs[_0x2433('0x32')](_['pick'](_0x49ed5d[_0x2433('0x31')],_0x2c45e9[_0x2433('0x32')]),_0x53d82b);if(_0x49ed5d[_0x2433('0x31')][_0x2433('0x3b')]){_0x5e659b['where']=_[_0x2433('0x3c')](_0x5e659b[_0x2433('0x3a')],{'$or':_[_0x2433('0x2a')](_0x53d82b,function(_0x3022be){if(_0x3022be[_0x2433('0x2e')]!==_0x2433('0x3d')){var _0x4c2ba2={};_0x4c2ba2[_0x3022be[_0x2433('0x27')]]={'$like':'%'+_0x49ed5d['query']['filter']+'%'};return _0x4c2ba2;}})});}_0x5e659b=_[_0x2433('0x3c')]({},_0x5e659b,_0x49ed5d['options']);var _0x3891f5={'where':_0x5e659b[_0x2433('0x3a')]};return db[_0x2433('0x2b')]['count'](_0x3891f5)[_0x2433('0x24')](function(_0xf5995e){_0x76b56[_0x2433('0x1e')]=_0xf5995e;if(_0x49ed5d[_0x2433('0x31')][_0x2433('0x3e')]){_0x5e659b[_0x2433('0x3f')]=[{'all':!![]}];}return db['ZohoAccount'][_0x2433('0x40')](_0x5e659b);})['then'](function(_0x30e560){_0x76b56[_0x2433('0x41')]=_0x30e560;return _0x76b56;})[_0x2433('0x24')](respondWithFilteredResult(_0x2b983f,_0x5e659b))[_0x2433('0x42')](handleError(_0x2b983f,null));};exports[_0x2433('0x43')]=function(_0xb75b4,_0x5032e7){var _0x11ba93={'raw':![],'where':{'id':_0xb75b4['params']['id']}},_0x18c879={};_0x18c879[_0x2433('0x30')]=_[_0x2433('0x44')](db['ZohoAccount'][_0x2433('0x2c')]);_0x18c879[_0x2433('0x31')]=_['keys'](_0xb75b4[_0x2433('0x31')]);_0x18c879[_0x2433('0x32')]=_[_0x2433('0x33')](_0x18c879[_0x2433('0x30')],_0x18c879[_0x2433('0x31')]);_0x11ba93[_0x2433('0x35')]=_[_0x2433('0x33')](_0x18c879[_0x2433('0x30')],qs[_0x2433('0x34')](_0xb75b4[_0x2433('0x31')][_0x2433('0x34')]));_0x11ba93[_0x2433('0x35')]=_0x11ba93['attributes'][_0x2433('0x36')]?_0x11ba93[_0x2433('0x35')]:_0x18c879[_0x2433('0x30')];if(_0xb75b4[_0x2433('0x31')][_0x2433('0x3e')]){_0x11ba93['include']=[{'all':!![]}];}_0x11ba93=_[_0x2433('0x3c')]({},_0x11ba93,_0xb75b4['options']);return db['ZohoAccount']['find'](_0x11ba93)[_0x2433('0x24')](handleEntityNotFound(_0x5032e7,null))[_0x2433('0x24')](respondWithResult(_0x5032e7,null))[_0x2433('0x42')](handleError(_0x5032e7,null));};exports[_0x2433('0x45')]=function(_0x1443df,_0x18a2cf){return db[_0x2433('0x2b')]['create'](_0x1443df[_0x2433('0x46')],{})['then'](respondWithResult(_0x18a2cf,0xc9))[_0x2433('0x42')](handleError(_0x18a2cf,null));};exports[_0x2433('0x23')]=function(_0xc3de8c,_0x3bbb0d){if(_0xc3de8c['body']['id']){delete _0xc3de8c['body']['id'];}return db[_0x2433('0x2b')][_0x2433('0x47')]({'where':{'id':_0xc3de8c[_0x2433('0x48')]['id']}})[_0x2433('0x24')](handleEntityNotFound(_0x3bbb0d,null))[_0x2433('0x24')](saveUpdates(_0xc3de8c[_0x2433('0x46')],null))[_0x2433('0x24')](respondWithResult(_0x3bbb0d,null))[_0x2433('0x42')](handleError(_0x3bbb0d,null));};exports[_0x2433('0x25')]=function(_0x13b145,_0x3646dc){return db[_0x2433('0x2b')][_0x2433('0x47')]({'where':{'id':_0x13b145[_0x2433('0x48')]['id']}})[_0x2433('0x24')](handleEntityNotFound(_0x3646dc,null))[_0x2433('0x24')](removeEntity(_0x3646dc,null))['catch'](handleError(_0x3646dc,null));};exports[_0x2433('0x49')]=function(_0x53b477,_0x29b487,_0x3de313){var _0x373c55={};var _0x4046f7={};var _0x20213d;var _0x20f99b;return db['ZohoAccount']['findOne']({'where':{'id':_0x53b477[_0x2433('0x48')]['id']}})[_0x2433('0x24')](handleEntityNotFound(_0x29b487,null))[_0x2433('0x24')](function(_0x8e101a){if(_0x8e101a){_0x20213d=_0x8e101a;_0x4046f7[_0x2433('0x30')]=_[_0x2433('0x44')](db[_0x2433('0x4a')][_0x2433('0x2c')]);_0x4046f7[_0x2433('0x31')]=_[_0x2433('0x44')](_0x53b477['query']);_0x4046f7['filters']=_[_0x2433('0x33')](_0x4046f7[_0x2433('0x30')],_0x4046f7[_0x2433('0x31')]);_0x373c55[_0x2433('0x35')]=_[_0x2433('0x33')](_0x4046f7['model'],qs['fields'](_0x53b477[_0x2433('0x31')][_0x2433('0x34')]));_0x373c55[_0x2433('0x35')]=_0x373c55[_0x2433('0x35')][_0x2433('0x36')]?_0x373c55[_0x2433('0x35')]:_0x4046f7[_0x2433('0x30')];_0x373c55[_0x2433('0x38')]=qs[_0x2433('0x39')](_0x53b477[_0x2433('0x31')][_0x2433('0x39')]);_0x373c55[_0x2433('0x3a')]=qs[_0x2433('0x32')](_[_0x2433('0x4b')](_0x53b477[_0x2433('0x31')],_0x4046f7[_0x2433('0x32')]));if(_0x53b477[_0x2433('0x31')][_0x2433('0x3b')]){_0x373c55[_0x2433('0x3a')]=_[_0x2433('0x3c')](_0x373c55[_0x2433('0x3a')],{'$or':_[_0x2433('0x2a')](_0x373c55[_0x2433('0x35')],function(_0x323cf4){var _0x46cea4={};_0x46cea4[_0x323cf4]={'$like':'%'+_0x53b477[_0x2433('0x31')][_0x2433('0x3b')]+'%'};return _0x46cea4;})});}_0x373c55=_[_0x2433('0x3c')]({},_0x373c55,_0x53b477[_0x2433('0x4c')]);return _0x20213d[_0x2433('0x49')](_0x373c55);}})['then'](function(_0x1e4572){if(_0x1e4572){_0x20f99b=_0x1e4572['length'];if(!_0x53b477[_0x2433('0x31')][_0x2433('0x4d')]('nolimit')){_0x373c55[_0x2433('0x1f')]=qs[_0x2433('0x1f')](_0x53b477[_0x2433('0x31')][_0x2433('0x1f')]);_0x373c55[_0x2433('0x1c')]=qs[_0x2433('0x1c')](_0x53b477[_0x2433('0x31')][_0x2433('0x1c')]);}return _0x20213d[_0x2433('0x49')](_0x373c55);}})[_0x2433('0x24')](function(_0x306ee1){if(_0x306ee1){return _0x306ee1?{'count':_0x20f99b,'rows':_0x306ee1}:null;}})['then'](respondWithResult(_0x29b487,null))[_0x2433('0x42')](handleError(_0x29b487,null));};exports[_0x2433('0x4e')]=function(_0x3166a6,_0x371c0d,_0x4aed57){if(_0x3166a6[_0x2433('0x46')]['id']){delete _0x3166a6['body']['id'];}return db[_0x2433('0x2b')][_0x2433('0x4f')]({'where':{'id':_0x3166a6['params']['id']}})['then'](handleEntityNotFound(_0x371c0d,null))[_0x2433('0x24')](function(_0x39278a){if(_0x39278a){_0x3166a6['body'][_0x2433('0x50')]=_0x39278a['id'];_0x3166a6[_0x2433('0x46')][_0x2433('0x51')]=integrations['getSubjects'](_0x3166a6[_0x2433('0x46')][_0x2433('0x52')],_0x3166a6[_0x2433('0x46')][_0x2433('0x2e')]);_0x3166a6[_0x2433('0x46')][_0x2433('0x53')]=integrations[_0x2433('0x54')](_0x3166a6[_0x2433('0x46')]['channel'],_0x3166a6[_0x2433('0x46')][_0x2433('0x2e')]);return db[_0x2433('0x4a')][_0x2433('0x45')](_0x3166a6[_0x2433('0x46')],{'include':[{'model':db[_0x2433('0x55')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x2433('0x53')}]});}return null;})['then'](respondWithResult(_0x371c0d,null))[_0x2433('0x42')](handleError(_0x371c0d,null));};function getAccessToken(_0x4ef2c0){return new Promise(function(_0x2898e5,_0x48baaf){var _0x3a59c8;switch(_0x4ef2c0[_0x2433('0x56')]){case'US':_0x3a59c8=_0x2433('0x57');break;case'AU':_0x3a59c8=_0x2433('0x58');break;case'EU':_0x3a59c8=_0x2433('0x59');break;case'IN':_0x3a59c8=_0x2433('0x5a');break;case'CN':_0x3a59c8=_0x2433('0x5b');break;default:_0x3a59c8=_0x2433('0x59');break;}var _0x1aecad={'method':_0x2433('0x5c'),'uri':_0x3a59c8+_0x2433('0x5d'),'qs':{'refresh_token':_0x4ef2c0[_0x2433('0x5e')],'client_id':_0x4ef2c0[_0x2433('0x5f')],'client_secret':_0x4ef2c0[_0x2433('0x60')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1aecad)['then'](function(_0x364180){if(_0x364180[_0x2433('0x61')]){_0x2898e5(_0x364180[_0x2433('0x61')]);}else{_0x48baaf(_0x2433('0x62'));}})[_0x2433('0x42')](function(_0x341e6b){_0x48baaf(_0x341e6b);});});}exports[_0x2433('0x63')]=function(_0xb9211a,_0x2fb303,_0xc1ca3c){var _0x4642f7,_0x5d6032,_0x532c30,_0x32f209,_0x4205af;return db[_0x2433('0x2b')][_0x2433('0x4f')]({'where':{'id':_0xb9211a[_0x2433('0x48')]['id']},'attributes':['id',_0x2433('0x64'),_0x2433('0x56'),_0x2433('0x5f'),_0x2433('0x60'),_0x2433('0x65'),_0x2433('0x66'),_0x2433('0x5e')]})['then'](handleEntityNotFound(_0x2fb303,null))[_0x2433('0x24')](function(_0x4049db){_0x4205af=_0x4049db;_0x4642f7=_0x4205af['host'];_0x5d6032=_0x4642f7===_0x2433('0x67')?'eu':'com';_0x532c30=_0x4205af['serverUrl'];var _0x53bb62=_0x532c30['slice'](-0x1);if(_0x53bb62==='/'||_0x53bb62==='\x5c'||_0x53bb62===':'){_0x532c30=_0x532c30[_0x2433('0x68')](0x0,_0x532c30[_0x2433('0x69')](_0x53bb62));}if(!_0x4205af[_0x2433('0x5e')]){throw new Error(_0x2433('0x6a'));}return getAccessToken(_0x4205af);})['then'](function(_0x13c64d){if(_0x13c64d){return rp({'method':_0x2433('0x6b'),'uri':util[_0x2433('0x6c')](_0x2433('0x6d'),_0x5d6032),'qs':{'module':_0x2433('0x6e')},'headers':{'Authorization':_0x2433('0x6f')+_0x13c64d},'json':!![]});}})[_0x2433('0x24')](function(_0x4e5716){if(_0x4e5716){if(_0x4e5716[_0x2433('0x70')]&&_0x4e5716['response'][_0x2433('0x71')]){throw new Error(_0x4e5716[_0x2433('0x70')][_0x2433('0x71')][_0x2433('0x72')]);}var _0x49620b=[];var _0x2cbcf3=[];var _0x549628=[_0x2433('0x73'),_0x2433('0x74'),'Description','WhoId','Call_Duration',_0x2433('0x75'),_0x2433('0x76'),_0x2433('0x77')];_0x2cbcf3=_[_0x2433('0x78')](_0x4e5716[_0x2433('0x34')],function(_0x4afc73){return _0x549628[_0x2433('0x79')](_0x4afc73[_0x2433('0x7a')]);});for(var _0x357df1=0x0;_0x357df1<_0x2cbcf3[_0x2433('0x36')];_0x357df1++){if(_0x2cbcf3[_0x357df1][_0x2433('0x7b')]===![]){_0x49620b['push']({'id':_0x2cbcf3[_0x357df1]['id'],'name':_0x2cbcf3[_0x357df1][_0x2433('0x7c')],'custom':_0x2cbcf3[_0x357df1][_0x2433('0x7d')],'options':_0x2cbcf3[_0x357df1][_0x2433('0x7e')]==='picklist'&&_0x2cbcf3[_0x357df1]['pick_list_values'][_0x2433('0x36')]>-0x1?_[_0x2433('0x2a')](_0x2cbcf3[_0x357df1][_0x2433('0x7f')],function(_0x48c800){return{'name':_0x48c800,'value':_0x48c800};}):[]});}}return{'count':_0x49620b[_0x2433('0x36')],'rows':_0x49620b};}else{return{'count':0x0,'rows':[]};}})[_0x2433('0x24')](respondWithResult(_0x2fb303,null))[_0x2433('0x42')](function(_0x5d3a9c){var _0x22e76a=_0xb9211a['query']['test']?0x1f4:_0x5d3a9c[_0x2433('0x80')]||0x1f4;logger[_0x2433('0x71')](_0x2433('0x81'),_0x2433('0x63'),_0x22e76a,JSON[_0x2433('0x82')](_0x5d3a9c));delete _0x5d3a9c[_0x2433('0x27')];if(_0x22e76a===0x191){_0x22e76a=0x190;}_0x2fb303[_0x2433('0x19')](_0x22e76a)[_0x2433('0x28')](_0xb9211a[_0x2433('0x31')][_0x2433('0x83')]?{'message':_0x2433('0x84'),'statusCode':_0x5d3a9c['statusCode']}:_0x5d3a9c);});}; \ No newline at end of file +var _0xeadb=['api_name','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','ZohoAccount','rawAttributes','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','filter','options','count','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','order','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','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','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','refreshToken','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','includes'];(function(_0x4a452a,_0x2cdc4d){var _0x590166=function(_0x540974){while(--_0x540974){_0x4a452a['push'](_0x4a452a['shift']());}};_0x590166(++_0x2cdc4d);}(_0xeadb,0x18c));var _0xbead=function(_0x4f4d82,_0x7ced00){_0x4f4d82=_0x4f4d82-0x0;var _0x3a49cd=_0xeadb[_0x4f4d82];return _0x3a49cd;};'use strict';var emlformat=require(_0xbead('0x0'));var rimraf=require(_0xbead('0x1'));var zipdir=require(_0xbead('0x2'));var jsonpatch=require(_0xbead('0x3'));var rp=require(_0xbead('0x4'));var moment=require(_0xbead('0x5'));var BPromise=require(_0xbead('0x6'));var Mustache=require(_0xbead('0x7'));var util=require('util');var path=require(_0xbead('0x8'));var sox=require(_0xbead('0x9'));var csv=require(_0xbead('0xa'));var ejs=require(_0xbead('0xb'));var fs=require('fs');var fs_extra=require(_0xbead('0xc'));var _=require(_0xbead('0xd'));var squel=require(_0xbead('0xe'));var crypto=require(_0xbead('0xf'));var jsforce=require(_0xbead('0x10'));var deskjs=require(_0xbead('0x11'));var toCsv=require(_0xbead('0xa'));var querystring=require(_0xbead('0x12'));var Papa=require(_0xbead('0x13'));var Redis=require('ioredis');var authService=require(_0xbead('0x14'));var qs=require(_0xbead('0x15'));var as=require(_0xbead('0x16'));var hardwareService=require(_0xbead('0x17'));var logger=require(_0xbead('0x18'))('api');var utils=require(_0xbead('0x19'));var config=require(_0xbead('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbead('0x1b'))['db'];var integrations=require(_0xbead('0x1c'));function respondWithStatusCode(_0x3cf6b7,_0x1079a6){_0x1079a6=_0x1079a6||0xcc;return function(_0x2d6338){if(_0x2d6338){return _0x3cf6b7['sendStatus'](_0x1079a6);}return _0x3cf6b7[_0xbead('0x1d')](_0x1079a6)[_0xbead('0x1e')]();};}function respondWithResult(_0x245d1c,_0x371a65){_0x371a65=_0x371a65||0xc8;return function(_0x48a240){if(_0x48a240){return _0x245d1c['status'](_0x371a65)[_0xbead('0x1f')](_0x48a240);}};}function respondWithFilteredResult(_0x151849,_0x28148e){return function(_0x3c694f){if(_0x3c694f){var _0x132bc6=typeof _0x28148e[_0xbead('0x20')]===_0xbead('0x21')&&typeof _0x28148e['limit']===_0xbead('0x21');var _0x50402d=_0x3c694f['count'];var _0x5c7047=_0x132bc6?0x0:_0x28148e[_0xbead('0x20')];var _0x7dfb25=_0x132bc6?_0x3c694f['count']:_0x28148e[_0xbead('0x20')]+_0x28148e[_0xbead('0x22')];var _0x49cf59;if(_0x7dfb25>=_0x50402d){_0x7dfb25=_0x50402d;_0x49cf59=0xc8;}else{_0x49cf59=0xce;}_0x151849['status'](_0x49cf59);return _0x151849[_0xbead('0x23')]('Content-Range',_0x5c7047+'-'+_0x7dfb25+'/'+_0x50402d)[_0xbead('0x1f')](_0x3c694f);}return null;};}function patchUpdates(_0x233e7d){return function(_0x35aa28){try{jsonpatch[_0xbead('0x24')](_0x35aa28,_0x233e7d,!![]);}catch(_0x1c233b){return BPromise['reject'](_0x1c233b);}return _0x35aa28[_0xbead('0x25')]();};}function saveUpdates(_0x8ed8be,_0x22921a){return function(_0x31bb4b){if(_0x31bb4b){return _0x31bb4b[_0xbead('0x26')](_0x8ed8be)[_0xbead('0x27')](function(_0x2ad3f7){return _0x2ad3f7;});}return null;};}function removeEntity(_0x10920c,_0x1efded){return function(_0x335824){if(_0x335824){return _0x335824[_0xbead('0x28')]()[_0xbead('0x27')](function(){_0x10920c['status'](0xcc)[_0xbead('0x1e')]();});}};}function handleEntityNotFound(_0x1db61b,_0x320dd9){return function(_0x44eca3){if(!_0x44eca3){_0x1db61b[_0xbead('0x29')](0x194);}return _0x44eca3;};}function handleError(_0x261c9,_0x137dae){_0x137dae=_0x137dae||0x1f4;return function(_0x18d3a2){logger[_0xbead('0x2a')](_0x18d3a2[_0xbead('0x2b')]);if(_0x18d3a2[_0xbead('0x2c')]){delete _0x18d3a2[_0xbead('0x2c')];}_0x261c9[_0xbead('0x1d')](_0x137dae)[_0xbead('0x2d')](_0x18d3a2);};}exports['index']=function(_0x196d30,_0x4e0b40){var _0x28d05b={},_0xc6305a={},_0xfda052={'count':0x0,'rows':[]};var _0x37ccde=_[_0xbead('0x2e')](db[_0xbead('0x2f')][_0xbead('0x30')],function(_0x14d609){return{'name':_0x14d609['fieldName'],'type':_0x14d609['type']['key']};});_0xc6305a['model']=_['map'](_0x37ccde,_0xbead('0x2c'));_0xc6305a[_0xbead('0x31')]=_[_0xbead('0x32')](_0x196d30[_0xbead('0x31')]);_0xc6305a['filters']=_['intersection'](_0xc6305a['model'],_0xc6305a[_0xbead('0x31')]);_0x28d05b['attributes']=_[_0xbead('0x33')](_0xc6305a[_0xbead('0x34')],qs[_0xbead('0x35')](_0x196d30[_0xbead('0x31')]['fields']));_0x28d05b[_0xbead('0x36')]=_0x28d05b['attributes'][_0xbead('0x37')]?_0x28d05b['attributes']:_0xc6305a[_0xbead('0x34')];if(!_0x196d30[_0xbead('0x31')][_0xbead('0x38')](_0xbead('0x39'))){_0x28d05b['limit']=qs[_0xbead('0x22')](_0x196d30[_0xbead('0x31')][_0xbead('0x22')]);_0x28d05b[_0xbead('0x20')]=qs[_0xbead('0x20')](_0x196d30['query'][_0xbead('0x20')]);}_0x28d05b['order']=qs[_0xbead('0x3a')](_0x196d30[_0xbead('0x31')]['sort']);_0x28d05b['where']=qs[_0xbead('0x3b')](_[_0xbead('0x3c')](_0x196d30[_0xbead('0x31')],_0xc6305a[_0xbead('0x3b')]),_0x37ccde);if(_0x196d30[_0xbead('0x31')]['filter']){_0x28d05b['where']=_[_0xbead('0x3d')](_0x28d05b[_0xbead('0x3e')],{'$or':_['map'](_0x37ccde,function(_0xfa8101){if(_0xfa8101['type']!=='VIRTUAL'){var _0x228216={};_0x228216[_0xfa8101[_0xbead('0x2c')]]={'$like':'%'+_0x196d30[_0xbead('0x31')][_0xbead('0x3f')]+'%'};return _0x228216;}})});}_0x28d05b=_['merge']({},_0x28d05b,_0x196d30[_0xbead('0x40')]);var _0x7e9095={'where':_0x28d05b[_0xbead('0x3e')]};return db[_0xbead('0x2f')][_0xbead('0x41')](_0x7e9095)[_0xbead('0x27')](function(_0x6a06fc){_0xfda052['count']=_0x6a06fc;if(_0x196d30[_0xbead('0x31')]['includeAll']){_0x28d05b['include']=[{'all':!![]}];}return db[_0xbead('0x2f')][_0xbead('0x42')](_0x28d05b);})[_0xbead('0x27')](function(_0x35788d){_0xfda052[_0xbead('0x43')]=_0x35788d;return _0xfda052;})[_0xbead('0x27')](respondWithFilteredResult(_0x4e0b40,_0x28d05b))[_0xbead('0x44')](handleError(_0x4e0b40,null));};exports['show']=function(_0x340fc3,_0x5c75b6){var _0x1aabce={'raw':![],'where':{'id':_0x340fc3[_0xbead('0x45')]['id']}},_0x158aa1={};_0x158aa1[_0xbead('0x34')]=_[_0xbead('0x32')](db[_0xbead('0x2f')][_0xbead('0x30')]);_0x158aa1['query']=_[_0xbead('0x32')](_0x340fc3[_0xbead('0x31')]);_0x158aa1[_0xbead('0x3b')]=_[_0xbead('0x33')](_0x158aa1[_0xbead('0x34')],_0x158aa1[_0xbead('0x31')]);_0x1aabce[_0xbead('0x36')]=_[_0xbead('0x33')](_0x158aa1[_0xbead('0x34')],qs[_0xbead('0x35')](_0x340fc3[_0xbead('0x31')][_0xbead('0x35')]));_0x1aabce['attributes']=_0x1aabce[_0xbead('0x36')][_0xbead('0x37')]?_0x1aabce['attributes']:_0x158aa1[_0xbead('0x34')];if(_0x340fc3[_0xbead('0x31')]['includeAll']){_0x1aabce['include']=[{'all':!![]}];}_0x1aabce=_[_0xbead('0x3d')]({},_0x1aabce,_0x340fc3[_0xbead('0x40')]);return db['ZohoAccount'][_0xbead('0x46')](_0x1aabce)['then'](handleEntityNotFound(_0x5c75b6,null))[_0xbead('0x27')](respondWithResult(_0x5c75b6,null))[_0xbead('0x44')](handleError(_0x5c75b6,null));};exports[_0xbead('0x47')]=function(_0x3092f7,_0x40932c){return db['ZohoAccount']['create'](_0x3092f7[_0xbead('0x48')],{})['then'](respondWithResult(_0x40932c,0xc9))['catch'](handleError(_0x40932c,null));};exports[_0xbead('0x26')]=function(_0xea1a2b,_0x523c0d){if(_0xea1a2b['body']['id']){delete _0xea1a2b[_0xbead('0x48')]['id'];}return db[_0xbead('0x2f')]['find']({'where':{'id':_0xea1a2b[_0xbead('0x45')]['id']}})[_0xbead('0x27')](handleEntityNotFound(_0x523c0d,null))[_0xbead('0x27')](saveUpdates(_0xea1a2b[_0xbead('0x48')],null))[_0xbead('0x27')](respondWithResult(_0x523c0d,null))[_0xbead('0x44')](handleError(_0x523c0d,null));};exports[_0xbead('0x28')]=function(_0x3429b7,_0x2977e8){return db['ZohoAccount']['find']({'where':{'id':_0x3429b7[_0xbead('0x45')]['id']}})['then'](handleEntityNotFound(_0x2977e8,null))[_0xbead('0x27')](removeEntity(_0x2977e8,null))['catch'](handleError(_0x2977e8,null));};exports[_0xbead('0x49')]=function(_0x4296ad,_0xe63c4c,_0x528367){var _0x1e331d={};var _0x4c6b50={};var _0x1ff338;var _0xc9d77;return db['ZohoAccount'][_0xbead('0x4a')]({'where':{'id':_0x4296ad['params']['id']}})['then'](handleEntityNotFound(_0xe63c4c,null))[_0xbead('0x27')](function(_0x277d81){if(_0x277d81){_0x1ff338=_0x277d81;_0x4c6b50[_0xbead('0x34')]=_[_0xbead('0x32')](db['ZohoConfiguration'][_0xbead('0x30')]);_0x4c6b50[_0xbead('0x31')]=_[_0xbead('0x32')](_0x4296ad[_0xbead('0x31')]);_0x4c6b50['filters']=_[_0xbead('0x33')](_0x4c6b50[_0xbead('0x34')],_0x4c6b50[_0xbead('0x31')]);_0x1e331d[_0xbead('0x36')]=_[_0xbead('0x33')](_0x4c6b50[_0xbead('0x34')],qs[_0xbead('0x35')](_0x4296ad[_0xbead('0x31')][_0xbead('0x35')]));_0x1e331d[_0xbead('0x36')]=_0x1e331d[_0xbead('0x36')]['length']?_0x1e331d['attributes']:_0x4c6b50['model'];_0x1e331d[_0xbead('0x4b')]=qs[_0xbead('0x3a')](_0x4296ad[_0xbead('0x31')][_0xbead('0x3a')]);_0x1e331d[_0xbead('0x3e')]=qs[_0xbead('0x3b')](_[_0xbead('0x3c')](_0x4296ad[_0xbead('0x31')],_0x4c6b50[_0xbead('0x3b')]));if(_0x4296ad[_0xbead('0x31')][_0xbead('0x3f')]){_0x1e331d[_0xbead('0x3e')]=_[_0xbead('0x3d')](_0x1e331d[_0xbead('0x3e')],{'$or':_[_0xbead('0x2e')](_0x1e331d[_0xbead('0x36')],function(_0x35ad94){var _0x12e32c={};_0x12e32c[_0x35ad94]={'$like':'%'+_0x4296ad[_0xbead('0x31')][_0xbead('0x3f')]+'%'};return _0x12e32c;})});}_0x1e331d=_[_0xbead('0x3d')]({},_0x1e331d,_0x4296ad['options']);return _0x1ff338[_0xbead('0x49')](_0x1e331d);}})['then'](function(_0x56688f){if(_0x56688f){_0xc9d77=_0x56688f['length'];if(!_0x4296ad[_0xbead('0x31')]['hasOwnProperty'](_0xbead('0x39'))){_0x1e331d['limit']=qs[_0xbead('0x22')](_0x4296ad[_0xbead('0x31')][_0xbead('0x22')]);_0x1e331d[_0xbead('0x20')]=qs['offset'](_0x4296ad['query']['offset']);}return _0x1ff338[_0xbead('0x49')](_0x1e331d);}})['then'](function(_0x48fe1a){if(_0x48fe1a){return _0x48fe1a?{'count':_0xc9d77,'rows':_0x48fe1a}:null;}})[_0xbead('0x27')](respondWithResult(_0xe63c4c,null))[_0xbead('0x44')](handleError(_0xe63c4c,null));};exports['addConfiguration']=function(_0x52c994,_0x3ccd3a,_0x3d33d5){if(_0x52c994[_0xbead('0x48')]['id']){delete _0x52c994['body']['id'];}return db[_0xbead('0x2f')][_0xbead('0x4a')]({'where':{'id':_0x52c994[_0xbead('0x45')]['id']}})[_0xbead('0x27')](handleEntityNotFound(_0x3ccd3a,null))[_0xbead('0x27')](function(_0x193c27){if(_0x193c27){_0x52c994[_0xbead('0x48')][_0xbead('0x4c')]=_0x193c27['id'];_0x52c994['body'][_0xbead('0x4d')]=integrations[_0xbead('0x4e')](_0x52c994[_0xbead('0x48')][_0xbead('0x4f')],_0x52c994[_0xbead('0x48')][_0xbead('0x50')]);_0x52c994[_0xbead('0x48')][_0xbead('0x51')]=integrations[_0xbead('0x52')](_0x52c994['body'][_0xbead('0x4f')],_0x52c994['body'][_0xbead('0x50')]);return db[_0xbead('0x53')][_0xbead('0x47')](_0x52c994[_0xbead('0x48')],{'include':[{'model':db[_0xbead('0x54')],'as':_0xbead('0x4d')},{'model':db[_0xbead('0x54')],'as':_0xbead('0x51')}]});}return null;})[_0xbead('0x27')](respondWithResult(_0x3ccd3a,null))['catch'](handleError(_0x3ccd3a,null));};function getAccessToken(_0x3cab3c){return new Promise(function(_0xc62da3,_0x48497f){var _0x6b992c;switch(_0x3cab3c[_0xbead('0x55')]){case'US':_0x6b992c='https://accounts.zoho.com';break;case'AU':_0x6b992c=_0xbead('0x56');break;case'EU':_0x6b992c=_0xbead('0x57');break;case'IN':_0x6b992c=_0xbead('0x58');break;case'CN':_0x6b992c=_0xbead('0x59');break;default:_0x6b992c='https://accounts.zoho.eu';break;}var _0x4a7524={'method':_0xbead('0x5a'),'uri':_0x6b992c+_0xbead('0x5b'),'qs':{'refresh_token':_0x3cab3c['refreshToken'],'client_id':_0x3cab3c[_0xbead('0x5c')],'client_secret':_0x3cab3c[_0xbead('0x5d')],'grant_type':_0xbead('0x5e')},'json':!![]};return rp(_0x4a7524)[_0xbead('0x27')](function(_0x212072){if(_0x212072['access_token']){_0xc62da3(_0x212072['access_token']);}else{_0x48497f(_0xbead('0x5f'));}})['catch'](function(_0x22fc41){_0x48497f(_0x22fc41);});});}exports[_0xbead('0x60')]=function(_0x1d0ece,_0x5a111a,_0x43f393){var _0x34f4cf,_0x2539e3,_0x3c6f49,_0x400ef5,_0x397b69;return db[_0xbead('0x2f')][_0xbead('0x4a')]({'where':{'id':_0x1d0ece[_0xbead('0x45')]['id']},'attributes':['id',_0xbead('0x61'),_0xbead('0x55'),_0xbead('0x5c'),_0xbead('0x5d'),'serverUrl','code',_0xbead('0x62')]})['then'](handleEntityNotFound(_0x5a111a,null))[_0xbead('0x27')](function(_0x322643){_0x397b69=_0x322643;_0x34f4cf=_0x397b69[_0xbead('0x61')];_0x2539e3=_0x34f4cf===_0xbead('0x63')?'eu':_0xbead('0x64');_0x3c6f49=_0x397b69[_0xbead('0x65')];var _0x148666=_0x3c6f49[_0xbead('0x66')](-0x1);if(_0x148666==='/'||_0x148666==='\x5c'||_0x148666===':'){_0x3c6f49=_0x3c6f49[_0xbead('0x67')](0x0,_0x3c6f49[_0xbead('0x68')](_0x148666));}if(!_0x397b69[_0xbead('0x62')]){throw new Error(_0xbead('0x69'));}return getAccessToken(_0x397b69);})[_0xbead('0x27')](function(_0x557868){if(_0x557868){return rp({'method':_0xbead('0x6a'),'uri':util[_0xbead('0x6b')](_0xbead('0x6c'),_0x2539e3),'qs':{'module':_0xbead('0x6d')},'headers':{'Authorization':_0xbead('0x6e')+_0x557868},'json':!![]});}})['then'](function(_0x512383){if(_0x512383){if(_0x512383[_0xbead('0x6f')]&&_0x512383['response'][_0xbead('0x2a')]){throw new Error(_0x512383[_0xbead('0x6f')][_0xbead('0x2a')]['message']);}var _0xacb3cb=[];var _0x2329e1=[];var _0x287037=[_0xbead('0x70'),_0xbead('0x71'),_0xbead('0x72'),_0xbead('0x73'),_0xbead('0x74'),_0xbead('0x75'),'Call_Start_Time',_0xbead('0x76')];_0x2329e1=_['remove'](_0x512383[_0xbead('0x35')],function(_0x649ab7){return _0x287037[_0xbead('0x77')](_0x649ab7[_0xbead('0x78')]);});for(var _0x5dc1cf=0x0;_0x5dc1cf<_0x2329e1['length'];_0x5dc1cf++){if(_0x2329e1[_0x5dc1cf]['system_mandatory']===![]){_0xacb3cb['push']({'id':_0x2329e1[_0x5dc1cf]['id'],'name':_0x2329e1[_0x5dc1cf][_0xbead('0x79')],'custom':_0x2329e1[_0x5dc1cf][_0xbead('0x7a')],'options':_0x2329e1[_0x5dc1cf][_0xbead('0x7b')]==='picklist'&&_0x2329e1[_0x5dc1cf][_0xbead('0x7c')][_0xbead('0x37')]>-0x1?_[_0xbead('0x2e')](_0x2329e1[_0x5dc1cf][_0xbead('0x7c')],function(_0x15f44f){return{'name':_0x15f44f,'value':_0x15f44f};}):[]});}}return{'count':_0xacb3cb[_0xbead('0x37')],'rows':_0xacb3cb};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5a111a,null))[_0xbead('0x44')](function(_0x35da87){var _0x1304fe=_0x1d0ece[_0xbead('0x31')][_0xbead('0x7d')]?0x1f4:_0x35da87[_0xbead('0x7e')]||0x1f4;logger[_0xbead('0x2a')](_0xbead('0x7f'),_0xbead('0x60'),_0x1304fe,JSON['stringify'](_0x35da87));delete _0x35da87[_0xbead('0x2c')];if(_0x1304fe===0x191){_0x1304fe=0x190;}_0x5a111a[_0xbead('0x1d')](_0x1304fe)[_0xbead('0x2d')](_0x1d0ece[_0xbead('0x31')][_0xbead('0x7d')]?{'message':_0xbead('0x80'),'statusCode':_0x35da87[_0xbead('0x7e')]}:_0x35da87);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 27c6f5e..67f1db1 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 _0x2cbd=['./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','code','/oauth/v2/token','application/x-www-form-urlencoded','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x2cbd,0x7d));var _0xd2cb=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x2cbd[_0xadde88];return _0x3b8eb6;};'use strict';var _=require(_0xd2cb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd2cb('0x1'));var moment=require('moment');var BPromise=require(_0xd2cb('0x2'));var rp=require(_0xd2cb('0x3'));var fs=require('fs');var path=require(_0xd2cb('0x4'));var rimraf=require(_0xd2cb('0x5'));var config=require(_0xd2cb('0x6'));var attributes=require(_0xd2cb('0x7'));var integrations=require(_0xd2cb('0x8'));module[_0xd2cb('0x9')]=function(_0xeb6c35,_0x5b82b7){return _0xeb6c35[_0xd2cb('0xa')](_0xd2cb('0xb'),attributes,{'tableName':_0xd2cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x51c69b,_0x3b96b6,_0x5b4c36){if(_0x51c69b[_0xd2cb('0xd')](_0xd2cb('0xe'))||_0x51c69b[_0xd2cb('0xd')](_0xd2cb('0xf'))||_0x51c69b[_0xd2cb('0xd')](_0xd2cb('0x10'))||_0x51c69b['changed'](_0xd2cb('0x11'))||_0x51c69b[_0xd2cb('0xd')]('code')||_0x51c69b[_0xd2cb('0xd')](_0xd2cb('0x12'))){var _0x36afcb,_0x28f084;_0x36afcb=_0x51c69b[_0xd2cb('0xf')];var _0x420c1b=_0x36afcb[_0xd2cb('0x13')](-0x1);if(_0x420c1b==='/'||_0x420c1b==='\x5c'||_0x420c1b===':'){_0x36afcb=_0x36afcb[_0xd2cb('0x14')](0x0,_0x36afcb[_0xd2cb('0x15')](_0x420c1b));}switch(_0x51c69b[_0xd2cb('0xe')]){case'US':_0x28f084=_0xd2cb('0x16');break;case'AU':_0x28f084=_0xd2cb('0x17');break;case'IN':_0x28f084=_0xd2cb('0x18');break;case'CN':_0x28f084=_0xd2cb('0x19');break;default:_0x28f084=_0xd2cb('0x1a');break;}var _0x258890={'method':_0xd2cb('0x1b'),'uri':_0x28f084+'/oauth/v2/token','form':{'grant_type':_0xd2cb('0x1c'),'client_id':_0x51c69b[_0xd2cb('0x10')],'client_secret':_0x51c69b[_0xd2cb('0x11')],'redirect_uri':_0x51c69b[_0xd2cb('0xf')],'code':_0x51c69b['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x258890)[_0xd2cb('0x1d')](function(_0xe82783){var _0xe7efdd=JSON[_0xd2cb('0x1e')](_0xe82783);if(_0xe7efdd[_0xd2cb('0x1f')]){_0x51c69b[_0xd2cb('0x20')]=_0xe7efdd[_0xd2cb('0x1f')];logger[_0xd2cb('0x21')](util[_0xd2cb('0x22')](_0xd2cb('0x23'),_0x51c69b[_0xd2cb('0x24')],_0x51c69b['id']));}else{logger['error'](util[_0xd2cb('0x22')](_0xd2cb('0x25'),_0x51c69b[_0xd2cb('0x24')],_0x51c69b['id']),util[_0xd2cb('0x26')](_0xe7efdd,{'showHidden':![],'depth':null}));}return _0x5b4c36(null,_0x3b96b6);})[_0xd2cb('0x27')](function(_0x429835){logger[_0xd2cb('0x28')](util[_0xd2cb('0x22')](_0xd2cb('0x25'),_0x51c69b[_0xd2cb('0x24')],_0x51c69b['id']),util[_0xd2cb('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x5b4c36(_0x429835);});}else{return _0x5b4c36(null,_0x3b96b6);}},'beforeUpdate':function(_0x1b8b28,_0x1588a7,_0x17af58){if(_0x1b8b28[_0xd2cb('0xd')]('zone')||_0x1b8b28['changed'](_0xd2cb('0xf'))||_0x1b8b28[_0xd2cb('0xd')](_0xd2cb('0x10'))||_0x1b8b28[_0xd2cb('0xd')]('clientSecret')||_0x1b8b28[_0xd2cb('0xd')](_0xd2cb('0x29'))||_0x1b8b28['changed'](_0xd2cb('0x12'))){var _0x299e67,_0x4d71cd;_0x299e67=_0x1b8b28[_0xd2cb('0xf')];var _0x398333=_0x299e67[_0xd2cb('0x13')](-0x1);if(_0x398333==='/'||_0x398333==='\x5c'||_0x398333===':'){_0x299e67=_0x299e67[_0xd2cb('0x14')](0x0,_0x299e67['lastIndexOf'](_0x398333));}switch(_0x1b8b28['zone']){case'US':_0x4d71cd=_0xd2cb('0x16');break;case'AU':_0x4d71cd=_0xd2cb('0x17');break;case'IN':_0x4d71cd=_0xd2cb('0x18');break;case'CN':_0x4d71cd=_0xd2cb('0x19');break;default:_0x4d71cd='https://accounts.zoho.eu';break;}var _0x28c43b={'method':_0xd2cb('0x1b'),'uri':_0x4d71cd+_0xd2cb('0x2a'),'form':{'grant_type':'authorization_code','client_id':_0x1b8b28[_0xd2cb('0x10')],'client_secret':_0x1b8b28['clientSecret'],'redirect_uri':_0x1b8b28[_0xd2cb('0xf')],'code':_0x1b8b28['code']},'headers':{'Content-Type':_0xd2cb('0x2b')}};return rp(_0x28c43b)[_0xd2cb('0x1d')](function(_0x2ec917){var _0xbc4549=JSON[_0xd2cb('0x1e')](_0x2ec917);if(_0xbc4549['refresh_token']){_0x1b8b28[_0xd2cb('0x20')]=_0xbc4549['refresh_token'];logger[_0xd2cb('0x21')](util[_0xd2cb('0x22')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1b8b28['name'],_0x1b8b28['id']));}else{logger[_0xd2cb('0x28')](util[_0xd2cb('0x22')](_0xd2cb('0x25'),_0x1b8b28[_0xd2cb('0x24')],_0x1b8b28['id']),util[_0xd2cb('0x26')](_0xbc4549,{'showHidden':![],'depth':null}));}return _0x17af58(null,_0x1588a7);})['catch'](function(_0x65f0bd){logger[_0xd2cb('0x28')](util[_0xd2cb('0x22')](_0xd2cb('0x25'),_0x1b8b28['name'],_0x1b8b28['id']),util[_0xd2cb('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x17af58(_0x65f0bd);});}else{return _0x17af58(null,_0x1588a7);}}}});}; \ No newline at end of file +var _0xa26f=['substring','info','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','slice','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','error'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa26f,0x131));var _0xfa26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa26f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfa26('0x0'));var logger=require('../../config/logger')(_0xfa26('0x1'));var moment=require(_0xfa26('0x2'));var BPromise=require(_0xfa26('0x3'));var rp=require(_0xfa26('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa26('0x5'));var config=require(_0xfa26('0x6'));var attributes=require(_0xfa26('0x7'));var integrations=require(_0xfa26('0x8'));module['exports']=function(_0x67b820,_0x166206){return _0x67b820[_0xfa26('0x9')](_0xfa26('0xa'),attributes,{'tableName':_0xfa26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4709d2,_0x16227a,_0x20862a){if(_0x4709d2[_0xfa26('0xc')]('zone')||_0x4709d2[_0xfa26('0xc')](_0xfa26('0xd'))||_0x4709d2[_0xfa26('0xc')](_0xfa26('0xe'))||_0x4709d2[_0xfa26('0xc')](_0xfa26('0xf'))||_0x4709d2[_0xfa26('0xc')]('code')||_0x4709d2[_0xfa26('0xc')](_0xfa26('0x10'))){var _0x7e1809,_0x6f9a12;_0x7e1809=_0x4709d2[_0xfa26('0xd')];var _0x26f3e3=_0x7e1809[_0xfa26('0x11')](-0x1);if(_0x26f3e3==='/'||_0x26f3e3==='\x5c'||_0x26f3e3===':'){_0x7e1809=_0x7e1809['substring'](0x0,_0x7e1809[_0xfa26('0x12')](_0x26f3e3));}switch(_0x4709d2[_0xfa26('0x13')]){case'US':_0x6f9a12=_0xfa26('0x14');break;case'AU':_0x6f9a12=_0xfa26('0x15');break;case'IN':_0x6f9a12=_0xfa26('0x16');break;case'CN':_0x6f9a12=_0xfa26('0x17');break;default:_0x6f9a12=_0xfa26('0x18');break;}var _0x594342={'method':_0xfa26('0x19'),'uri':_0x6f9a12+_0xfa26('0x1a'),'form':{'grant_type':_0xfa26('0x1b'),'client_id':_0x4709d2[_0xfa26('0xe')],'client_secret':_0x4709d2[_0xfa26('0xf')],'redirect_uri':_0x4709d2[_0xfa26('0xd')],'code':_0x4709d2[_0xfa26('0x1c')]},'headers':{'Content-Type':_0xfa26('0x1d')}};return rp(_0x594342)[_0xfa26('0x1e')](function(_0x180e35){var _0x3420bc=JSON[_0xfa26('0x1f')](_0x180e35);if(_0x3420bc[_0xfa26('0x20')]){_0x4709d2[_0xfa26('0x21')]=_0x3420bc[_0xfa26('0x20')];logger['info'](util[_0xfa26('0x22')](_0xfa26('0x23'),_0x4709d2[_0xfa26('0x24')],_0x4709d2['id']));}else{logger['error'](util[_0xfa26('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4709d2['name'],_0x4709d2['id']),util[_0xfa26('0x25')](_0x3420bc,{'showHidden':![],'depth':null}));}return _0x20862a(null,_0x16227a);})['catch'](function(_0x1b2859){logger[_0xfa26('0x26')](util[_0xfa26('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4709d2[_0xfa26('0x24')],_0x4709d2['id']),util[_0xfa26('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x20862a(_0x1b2859);});}else{return _0x20862a(null,_0x16227a);}},'beforeUpdate':function(_0x3a70e8,_0x5958c3,_0x38c662){if(_0x3a70e8[_0xfa26('0xc')](_0xfa26('0x13'))||_0x3a70e8['changed'](_0xfa26('0xd'))||_0x3a70e8[_0xfa26('0xc')]('clientId')||_0x3a70e8[_0xfa26('0xc')](_0xfa26('0xf'))||_0x3a70e8[_0xfa26('0xc')](_0xfa26('0x1c'))||_0x3a70e8['changed'](_0xfa26('0x10'))){var _0x569868,_0x16baee;_0x569868=_0x3a70e8[_0xfa26('0xd')];var _0x10cef4=_0x569868[_0xfa26('0x11')](-0x1);if(_0x10cef4==='/'||_0x10cef4==='\x5c'||_0x10cef4===':'){_0x569868=_0x569868[_0xfa26('0x27')](0x0,_0x569868[_0xfa26('0x12')](_0x10cef4));}switch(_0x3a70e8[_0xfa26('0x13')]){case'US':_0x16baee=_0xfa26('0x14');break;case'AU':_0x16baee=_0xfa26('0x15');break;case'IN':_0x16baee=_0xfa26('0x16');break;case'CN':_0x16baee='https://accounts.zoho.com.cn';break;default:_0x16baee=_0xfa26('0x18');break;}var _0x3fcd4a={'method':'POST','uri':_0x16baee+'/oauth/v2/token','form':{'grant_type':_0xfa26('0x1b'),'client_id':_0x3a70e8[_0xfa26('0xe')],'client_secret':_0x3a70e8[_0xfa26('0xf')],'redirect_uri':_0x3a70e8[_0xfa26('0xd')],'code':_0x3a70e8['code']},'headers':{'Content-Type':_0xfa26('0x1d')}};return rp(_0x3fcd4a)[_0xfa26('0x1e')](function(_0x16a27e){var _0x3cc481=JSON[_0xfa26('0x1f')](_0x16a27e);if(_0x3cc481[_0xfa26('0x20')]){_0x3a70e8[_0xfa26('0x21')]=_0x3cc481[_0xfa26('0x20')];logger[_0xfa26('0x28')](util[_0xfa26('0x22')](_0xfa26('0x23'),_0x3a70e8['name'],_0x3a70e8['id']));}else{logger[_0xfa26('0x26')](util[_0xfa26('0x22')](_0xfa26('0x29'),_0x3a70e8[_0xfa26('0x24')],_0x3a70e8['id']),util[_0xfa26('0x25')](_0x3cc481,{'showHidden':![],'depth':null}));}return _0x38c662(null,_0x5958c3);})[_0xfa26('0x2a')](function(_0x40b591){logger[_0xfa26('0x26')](util[_0xfa26('0x22')](_0xfa26('0x29'),_0x3a70e8[_0xfa26('0x24')],_0x3a70e8['id']),util[_0xfa26('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x38c662(_0x40b591);});}else{return _0x38c662(null,_0x5958c3);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 1ed0355..bd843fd 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 _0x583c=['raw','where','attributes','limit','map','include','model','debug','stringify','catch','ShowZohoAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetZohoAccount','ZohoAccount','options'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x583c,0x12b));var _0xc583=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x583c[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});}exports[_0xc583('0x12')]=function(_0x8a2d84){var _0x12aac2=this;return new Promise(function(_0x36e0fd,_0x5433ec){return db[_0xc583('0x13')]['findAll']({'raw':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x15')]===undefined?!![]:![]:!![],'where':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x16')]||null:null,'attributes':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x17')]||null:null,'limit':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84[_0xc583('0x14')][_0xc583('0x18')]||null:null,'include':_0x8a2d84[_0xc583('0x14')]?_0x8a2d84['options']['include']?_[_0xc583('0x19')](_0x8a2d84[_0xc583('0x14')][_0xc583('0x1a')],function(_0x5ceef1){return{'model':db[_0x5ceef1[_0xc583('0x1b')]],'as':_0x5ceef1['as'],'attributes':_0x5ceef1[_0xc583('0x17')],'include':_0x5ceef1[_0xc583('0x1a')]?_[_0xc583('0x19')](_0x5ceef1[_0xc583('0x1a')],function(_0x48c95e){return{'model':db[_0x48c95e['model']],'as':_0x48c95e['as'],'attributes':_0x48c95e[_0xc583('0x17')],'include':_0x48c95e['include']?_[_0xc583('0x19')](_0x48c95e[_0xc583('0x1a')],function(_0xbabf24){return{'model':db[_0xbabf24[_0xc583('0x1b')]],'as':_0xbabf24['as'],'attributes':_0xbabf24[_0xc583('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dafb4){logger[_0xc583('0xb')]('GetZohoAccount',_0x8a2d84);logger[_0xc583('0x1c')]('GetZohoAccount',_0x8a2d84,JSON[_0xc583('0x1d')](_0x2dafb4));_0x36e0fd(_0x2dafb4);})[_0xc583('0x1e')](function(_0x1c80b1){logger[_0xc583('0xf')](_0xc583('0x12'),_0x1c80b1[_0xc583('0x10')],_0x8a2d84);_0x5433ec(_0x12aac2[_0xc583('0xf')](0x1f4,_0x1c80b1['message']));});});};exports[_0xc583('0x1f')]=function(_0x390bc3){var _0x23f3a4=this;return new Promise(function(_0xcbf1f1,_0x1dd665){return db[_0xc583('0x13')]['find']({'raw':_0x390bc3[_0xc583('0x14')]?_0x390bc3['options']['raw']===undefined?!![]:![]:!![],'where':_0x390bc3[_0xc583('0x14')]?_0x390bc3[_0xc583('0x14')][_0xc583('0x16')]||null:null,'attributes':_0x390bc3[_0xc583('0x14')]?_0x390bc3[_0xc583('0x14')]['attributes']||null:null,'include':_0x390bc3[_0xc583('0x14')]?_0x390bc3[_0xc583('0x14')][_0xc583('0x1a')]?_['map'](_0x390bc3[_0xc583('0x14')]['include'],function(_0x1aa62a){return{'model':db[_0x1aa62a[_0xc583('0x1b')]],'as':_0x1aa62a['as'],'attributes':_0x1aa62a[_0xc583('0x17')],'include':_0x1aa62a[_0xc583('0x1a')]?_[_0xc583('0x19')](_0x1aa62a['include'],function(_0x242728){return{'model':db[_0x242728['model']],'as':_0x242728['as'],'attributes':_0x242728[_0xc583('0x17')],'include':_0x242728['include']?_[_0xc583('0x19')](_0x242728[_0xc583('0x1a')],function(_0x7d89d0){return{'model':db[_0x7d89d0[_0xc583('0x1b')]],'as':_0x7d89d0['as'],'attributes':_0x7d89d0[_0xc583('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc583('0xa')](function(_0x54200c){logger['info'](_0xc583('0x1f'),_0x390bc3);logger[_0xc583('0x1c')]('ShowZohoAccount',_0x390bc3,JSON[_0xc583('0x1d')](_0x54200c));_0xcbf1f1(_0x54200c);})[_0xc583('0x1e')](function(_0x22de5a){logger[_0xc583('0xf')](_0xc583('0x1f'),_0x22de5a[_0xc583('0x10')],_0x390bc3);_0x1dd665(_0x23f3a4['error'](0x1f4,_0x22de5a[_0xc583('0x10')]));});});}; \ No newline at end of file +var _0x3014=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','limit','include','map','model','attributes','ShowZohoAccount','raw','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x5ad83e,_0xb3a929){var _0x1850a9=function(_0x3cb205){while(--_0x3cb205){_0x5ad83e['push'](_0x5ad83e['shift']());}};_0x1850a9(++_0xb3a929);}(_0x3014,0x1d7));var _0x4301=function(_0x3a7395,_0x1d8f1e){_0x3a7395=_0x3a7395-0x0;var _0x12453d=_0x3014[_0x3a7395];return _0x12453d;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});}exports[_0x4301('0x16')]=function(_0x13b229){var _0x5cfa58=this;return new Promise(function(_0xa1cbea,_0x351815){return db[_0x4301('0x17')][_0x4301('0x18')]({'raw':_0x13b229[_0x4301('0x19')]?_0x13b229[_0x4301('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x13b229[_0x4301('0x19')]?_0x13b229[_0x4301('0x19')][_0x4301('0x1a')]||null:null,'attributes':_0x13b229['options']?_0x13b229[_0x4301('0x19')]['attributes']||null:null,'limit':_0x13b229[_0x4301('0x19')]?_0x13b229[_0x4301('0x19')][_0x4301('0x1b')]||null:null,'include':_0x13b229[_0x4301('0x19')]?_0x13b229['options'][_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x13b229['options'][_0x4301('0x1c')],function(_0x5d47d1){return{'model':db[_0x5d47d1[_0x4301('0x1e')]],'as':_0x5d47d1['as'],'attributes':_0x5d47d1[_0x4301('0x1f')],'include':_0x5d47d1[_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x5d47d1[_0x4301('0x1c')],function(_0x11fe82){return{'model':db[_0x11fe82[_0x4301('0x1e')]],'as':_0x11fe82['as'],'attributes':_0x11fe82[_0x4301('0x1f')],'include':_0x11fe82[_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x11fe82[_0x4301('0x1c')],function(_0x4a60d7){return{'model':db[_0x4a60d7[_0x4301('0x1e')]],'as':_0x4a60d7['as'],'attributes':_0x4a60d7[_0x4301('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4301('0xb')](function(_0xe752f0){logger['info'](_0x4301('0x16'),_0x13b229);logger[_0x4301('0xe')](_0x4301('0x16'),_0x13b229,JSON['stringify'](_0xe752f0));_0xa1cbea(_0xe752f0);})[_0x4301('0x15')](function(_0x10a967){logger['error'](_0x4301('0x16'),_0x10a967['message'],_0x13b229);_0x351815(_0x5cfa58[_0x4301('0x11')](0x1f4,_0x10a967[_0x4301('0x13')]));});});};exports[_0x4301('0x20')]=function(_0xebb79b){var _0x4a6a55=this;return new Promise(function(_0x2b4abd,_0x4ee156){return db[_0x4301('0x17')]['find']({'raw':_0xebb79b['options']?_0xebb79b[_0x4301('0x19')][_0x4301('0x21')]===undefined?!![]:![]:!![],'where':_0xebb79b[_0x4301('0x19')]?_0xebb79b[_0x4301('0x19')][_0x4301('0x1a')]||null:null,'attributes':_0xebb79b[_0x4301('0x19')]?_0xebb79b[_0x4301('0x19')]['attributes']||null:null,'include':_0xebb79b[_0x4301('0x19')]?_0xebb79b[_0x4301('0x19')][_0x4301('0x1c')]?_['map'](_0xebb79b['options']['include'],function(_0x861809){return{'model':db[_0x861809[_0x4301('0x1e')]],'as':_0x861809['as'],'attributes':_0x861809[_0x4301('0x1f')],'include':_0x861809['include']?_['map'](_0x861809['include'],function(_0x3d35b6){return{'model':db[_0x3d35b6[_0x4301('0x1e')]],'as':_0x3d35b6['as'],'attributes':_0x3d35b6[_0x4301('0x1f')],'include':_0x3d35b6[_0x4301('0x1c')]?_[_0x4301('0x1d')](_0x3d35b6[_0x4301('0x1c')],function(_0x1c3aef){return{'model':db[_0x1c3aef[_0x4301('0x1e')]],'as':_0x1c3aef['as'],'attributes':_0x1c3aef[_0x4301('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4301('0xb')](function(_0x380e73){logger['info'](_0x4301('0x20'),_0xebb79b);logger[_0x4301('0xe')]('ShowZohoAccount',_0xebb79b,JSON[_0x4301('0x10')](_0x380e73));_0x2b4abd(_0x380e73);})[_0x4301('0x15')](function(_0x5890e3){logger[_0x4301('0x11')](_0x4301('0x20'),_0x5890e3[_0x4301('0x13')],_0xebb79b);_0x4ee156(_0x4a6a55[_0x4301('0x11')](0x1f4,_0x5890e3[_0x4301('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 8f305fd..ffd9ba2 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 _0x3d46=['/:id/descriptions','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects'];(function(_0x55d408,_0x25416e){var _0x46fec2=function(_0x287b60){while(--_0x287b60){_0x55d408['push'](_0x55d408['shift']());}};_0x46fec2(++_0x25416e);}(_0x3d46,0x1b1));var _0x63d4=function(_0xf1f326,_0x4d612a){_0xf1f326=_0xf1f326-0x0;var _0x4ba866=_0x3d46[_0xf1f326];return _0x4ba866;};'use strict';var multer=require(_0x63d4('0x0'));var util=require(_0x63d4('0x1'));var path=require(_0x63d4('0x2'));var timeout=require(_0x63d4('0x3'));var express=require(_0x63d4('0x4'));var router=express[_0x63d4('0x5')]();var fs_extra=require(_0x63d4('0x6'));var auth=require(_0x63d4('0x7'));var interaction=require(_0x63d4('0x8'));var config=require(_0x63d4('0x9'));var controller=require('./intZohoConfiguration.controller');router[_0x63d4('0xa')]('/',auth[_0x63d4('0xb')](),controller[_0x63d4('0xc')]);router[_0x63d4('0xa')]('/:id',auth[_0x63d4('0xb')](),controller[_0x63d4('0xd')]);router[_0x63d4('0xa')](_0x63d4('0xe'),auth[_0x63d4('0xb')](),controller[_0x63d4('0xf')]);router['get'](_0x63d4('0x10'),auth[_0x63d4('0xb')](),controller['getSubjects']);router[_0x63d4('0xa')](_0x63d4('0x11'),auth[_0x63d4('0xb')](),controller['getDescriptions']);router[_0x63d4('0x12')]('/',auth[_0x63d4('0xb')](),controller[_0x63d4('0x13')]);router[_0x63d4('0x14')]('/:id',auth[_0x63d4('0xb')](),controller[_0x63d4('0x15')]);router[_0x63d4('0x16')](_0x63d4('0x17'),auth[_0x63d4('0xb')](),controller[_0x63d4('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa76f=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xa76f,0xfd));var _0xfa76=function(_0x333554,_0x3903a4){_0x333554=_0x333554-0x0;var _0x5d1ff1=_0xa76f[_0x333554];return _0x5d1ff1;};'use strict';var multer=require(_0xfa76('0x0'));var util=require('util');var path=require(_0xfa76('0x1'));var timeout=require(_0xfa76('0x2'));var express=require(_0xfa76('0x3'));var router=express[_0xfa76('0x4')]();var fs_extra=require(_0xfa76('0x5'));var auth=require(_0xfa76('0x6'));var interaction=require(_0xfa76('0x7'));var config=require(_0xfa76('0x8'));var controller=require(_0xfa76('0x9'));router[_0xfa76('0xa')]('/',auth['isAuthenticated'](),controller[_0xfa76('0xb')]);router['get']('/:id',auth[_0xfa76('0xc')](),controller[_0xfa76('0xd')]);router[_0xfa76('0xa')](_0xfa76('0xe'),auth[_0xfa76('0xc')](),controller[_0xfa76('0xf')]);router[_0xfa76('0xa')](_0xfa76('0x10'),auth[_0xfa76('0xc')](),controller[_0xfa76('0x11')]);router[_0xfa76('0xa')](_0xfa76('0x12'),auth[_0xfa76('0xc')](),controller[_0xfa76('0x13')]);router[_0xfa76('0x14')]('/',auth[_0xfa76('0xc')](),controller['create']);router[_0xfa76('0x15')]('/:id',auth[_0xfa76('0xc')](),controller['update']);router['delete'](_0xfa76('0x16'),auth[_0xfa76('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 3913d3d..f720c67 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 _0xabd2=['sequelize','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x10d2dc,_0xe613c3){var _0x5a626f=function(_0x107ec2){while(--_0x107ec2){_0x10d2dc['push'](_0x10d2dc['shift']());}};_0x5a626f(++_0xe613c3);}(_0xabd2,0x93));var _0x2abd=function(_0x37a78d,_0x124949){_0x37a78d=_0x37a78d-0x0;var _0x110fce=_0xabd2[_0x37a78d];return _0x110fce;};'use strict';var Sequelize=require(_0x2abd('0x0'));module['exports']={'name':{'type':Sequelize[_0x2abd('0x1')]},'moduleCreate':{'type':Sequelize[_0x2abd('0x2')](_0x2abd('0x3'),_0x2abd('0x4'),_0x2abd('0x5')),'defaultValue':_0x2abd('0x3')},'moduleSearch':{'type':Sequelize[_0x2abd('0x2')](_0x2abd('0x6'),'contact','lead'),'defaultValue':_0x2abd('0x6')},'description':{'type':Sequelize[_0x2abd('0x1')]}}; \ No newline at end of file +var _0x9d9d=['lead','contact','contact_lead','exports','STRING','ENUM'];(function(_0x58329b,_0x4436a6){var _0x51b75c=function(_0xba2e04){while(--_0xba2e04){_0x58329b['push'](_0x58329b['shift']());}};_0x51b75c(++_0x4436a6);}(_0x9d9d,0x129));var _0xd9d9=function(_0x15358d,_0x178994){_0x15358d=_0x15358d-0x0;var _0x17e893=_0x9d9d[_0x15358d];return _0x17e893;};'use strict';var Sequelize=require('sequelize');module[_0xd9d9('0x0')]={'name':{'type':Sequelize[_0xd9d9('0x1')]},'moduleCreate':{'type':Sequelize[_0xd9d9('0x2')](_0xd9d9('0x3'),_0xd9d9('0x4'),'nothing'),'defaultValue':_0xd9d9('0x3')},'moduleSearch':{'type':Sequelize[_0xd9d9('0x2')](_0xd9d9('0x5'),_0xd9d9('0x4'),_0xd9d9('0x3')),'defaultValue':_0xd9d9('0x5')},'description':{'type':Sequelize[_0xd9d9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index b4cfad1..98f5398 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 _0x71d6=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','type','includeAll','include','show','params','options','create','body','catch','find','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x4f1b24,_0x1da24e){var _0x4811fc=function(_0x192fb3){while(--_0x192fb3){_0x4f1b24['push'](_0x4f1b24['shift']());}};_0x4811fc(++_0x1da24e);}(_0x71d6,0x12d));var _0x671d=function(_0x27be4d,_0x4007b4){_0x27be4d=_0x27be4d-0x0;var _0x3d2936=_0x71d6[_0x27be4d];return _0x3d2936;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x671d('0x0'));var jsonpatch=require(_0x671d('0x1'));var rp=require(_0x671d('0x2'));var moment=require(_0x671d('0x3'));var BPromise=require(_0x671d('0x4'));var Mustache=require(_0x671d('0x5'));var util=require(_0x671d('0x6'));var path=require('path');var sox=require(_0x671d('0x7'));var csv=require(_0x671d('0x8'));var ejs=require(_0x671d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x671d('0xa'));var squel=require(_0x671d('0xb'));var crypto=require(_0x671d('0xc'));var jsforce=require(_0x671d('0xd'));var deskjs=require(_0x671d('0xe'));var toCsv=require(_0x671d('0x8'));var querystring=require(_0x671d('0xf'));var Papa=require(_0x671d('0x10'));var Redis=require(_0x671d('0x11'));var authService=require(_0x671d('0x12'));var qs=require(_0x671d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x671d('0x14'));var logger=require(_0x671d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x671d('0x16'));var licenseUtil=require(_0x671d('0x17'));var db=require(_0x671d('0x18'))['db'];function respondWithStatusCode(_0x412428,_0x2eb9af){_0x2eb9af=_0x2eb9af||0xcc;return function(_0x680dd8){if(_0x680dd8){return _0x412428['sendStatus'](_0x2eb9af);}return _0x412428[_0x671d('0x19')](_0x2eb9af)[_0x671d('0x1a')]();};}function respondWithResult(_0x40ae23,_0x11360d){_0x11360d=_0x11360d||0xc8;return function(_0xdce92c){if(_0xdce92c){return _0x40ae23[_0x671d('0x19')](_0x11360d)[_0x671d('0x1b')](_0xdce92c);}};}function respondWithFilteredResult(_0x2070e6,_0x5bfdf0){return function(_0x3ef5b3){if(_0x3ef5b3){var _0x4bfdbb=typeof _0x5bfdf0[_0x671d('0x1c')]===_0x671d('0x1d')&&typeof _0x5bfdf0[_0x671d('0x1e')]===_0x671d('0x1d');var _0x301692=_0x3ef5b3[_0x671d('0x1f')];var _0x57a6ff=_0x4bfdbb?0x0:_0x5bfdf0['offset'];var _0x29a7b7=_0x4bfdbb?_0x3ef5b3['count']:_0x5bfdf0['offset']+_0x5bfdf0['limit'];var _0x21bc0e;if(_0x29a7b7>=_0x301692){_0x29a7b7=_0x301692;_0x21bc0e=0xc8;}else{_0x21bc0e=0xce;}_0x2070e6['status'](_0x21bc0e);return _0x2070e6['set'](_0x671d('0x20'),_0x57a6ff+'-'+_0x29a7b7+'/'+_0x301692)[_0x671d('0x1b')](_0x3ef5b3);}return null;};}function patchUpdates(_0x35f0e0){return function(_0x2b144b){try{jsonpatch[_0x671d('0x21')](_0x2b144b,_0x35f0e0,!![]);}catch(_0x46cd96){return BPromise['reject'](_0x46cd96);}return _0x2b144b[_0x671d('0x22')]();};}function saveUpdates(_0x4f9a1c,_0x2b2ffc){return function(_0x4748ba){if(_0x4748ba){return _0x4748ba[_0x671d('0x23')](_0x4f9a1c)['then'](function(_0x4d5c61){return _0x4d5c61;});}return null;};}function removeEntity(_0x306c66,_0x15cd02){return function(_0x2d78a3){if(_0x2d78a3){return _0x2d78a3[_0x671d('0x24')]()[_0x671d('0x25')](function(){_0x306c66[_0x671d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380e54,_0x5b2dde){return function(_0x2f4a3d){if(!_0x2f4a3d){_0x380e54['sendStatus'](0x194);}return _0x2f4a3d;};}function handleError(_0x2e71ae,_0x267643){_0x267643=_0x267643||0x1f4;return function(_0x39e790){logger[_0x671d('0x26')](_0x39e790[_0x671d('0x27')]);if(_0x39e790[_0x671d('0x28')]){delete _0x39e790[_0x671d('0x28')];}_0x2e71ae['status'](_0x267643)[_0x671d('0x29')](_0x39e790);};}exports['index']=function(_0x5b9823,_0x36c3ef){var _0x20bf93={},_0x42cf25={},_0x34c776={'count':0x0,'rows':[]};var _0x3f7632=_[_0x671d('0x2a')](db[_0x671d('0x2b')][_0x671d('0x2c')],function(_0x20dc56){return{'name':_0x20dc56[_0x671d('0x2d')],'type':_0x20dc56['type'][_0x671d('0x2e')]};});_0x42cf25[_0x671d('0x2f')]=_['map'](_0x3f7632,'name');_0x42cf25['query']=_[_0x671d('0x30')](_0x5b9823[_0x671d('0x31')]);_0x42cf25['filters']=_[_0x671d('0x32')](_0x42cf25[_0x671d('0x2f')],_0x42cf25['query']);_0x20bf93[_0x671d('0x33')]=_[_0x671d('0x32')](_0x42cf25[_0x671d('0x2f')],qs['fields'](_0x5b9823[_0x671d('0x31')][_0x671d('0x34')]));_0x20bf93[_0x671d('0x33')]=_0x20bf93[_0x671d('0x33')][_0x671d('0x35')]?_0x20bf93['attributes']:_0x42cf25[_0x671d('0x2f')];if(!_0x5b9823[_0x671d('0x31')]['hasOwnProperty'](_0x671d('0x36'))){_0x20bf93[_0x671d('0x1e')]=qs[_0x671d('0x1e')](_0x5b9823[_0x671d('0x31')]['limit']);_0x20bf93[_0x671d('0x1c')]=qs['offset'](_0x5b9823[_0x671d('0x31')][_0x671d('0x1c')]);}_0x20bf93[_0x671d('0x37')]=qs[_0x671d('0x38')](_0x5b9823[_0x671d('0x31')][_0x671d('0x38')]);_0x20bf93[_0x671d('0x39')]=qs['filters'](_[_0x671d('0x3a')](_0x5b9823['query'],_0x42cf25[_0x671d('0x3b')]),_0x3f7632);if(_0x5b9823['query'][_0x671d('0x3c')]){_0x20bf93[_0x671d('0x39')]=_[_0x671d('0x3d')](_0x20bf93[_0x671d('0x39')],{'$or':_['map'](_0x3f7632,function(_0x1ce9c5){if(_0x1ce9c5[_0x671d('0x3e')]!=='VIRTUAL'){var _0x51988e={};_0x51988e[_0x1ce9c5[_0x671d('0x28')]]={'$like':'%'+_0x5b9823['query'][_0x671d('0x3c')]+'%'};return _0x51988e;}})});}_0x20bf93=_[_0x671d('0x3d')]({},_0x20bf93,_0x5b9823['options']);var _0x539e86={'where':_0x20bf93['where']};return db[_0x671d('0x2b')][_0x671d('0x1f')](_0x539e86)[_0x671d('0x25')](function(_0xf32c23){_0x34c776['count']=_0xf32c23;if(_0x5b9823['query'][_0x671d('0x3f')]){_0x20bf93[_0x671d('0x40')]=[{'all':!![]}];}return db[_0x671d('0x2b')]['findAll'](_0x20bf93);})[_0x671d('0x25')](function(_0x2fbee3){_0x34c776['rows']=_0x2fbee3;return _0x34c776;})[_0x671d('0x25')](respondWithFilteredResult(_0x36c3ef,_0x20bf93))['catch'](handleError(_0x36c3ef,null));};exports[_0x671d('0x41')]=function(_0x21d03a,_0x1fe248){var _0x4fcd86={'raw':![],'where':{'id':_0x21d03a[_0x671d('0x42')]['id']}},_0x33e801={};_0x33e801[_0x671d('0x2f')]=_[_0x671d('0x30')](db[_0x671d('0x2b')]['rawAttributes']);_0x33e801[_0x671d('0x31')]=_[_0x671d('0x30')](_0x21d03a[_0x671d('0x31')]);_0x33e801[_0x671d('0x3b')]=_[_0x671d('0x32')](_0x33e801[_0x671d('0x2f')],_0x33e801[_0x671d('0x31')]);_0x4fcd86[_0x671d('0x33')]=_[_0x671d('0x32')](_0x33e801[_0x671d('0x2f')],qs[_0x671d('0x34')](_0x21d03a['query'][_0x671d('0x34')]));_0x4fcd86[_0x671d('0x33')]=_0x4fcd86[_0x671d('0x33')][_0x671d('0x35')]?_0x4fcd86[_0x671d('0x33')]:_0x33e801[_0x671d('0x2f')];if(_0x21d03a['query'][_0x671d('0x3f')]){_0x4fcd86[_0x671d('0x40')]=[{'all':!![]}];}_0x4fcd86=_[_0x671d('0x3d')]({},_0x4fcd86,_0x21d03a[_0x671d('0x43')]);return db['ZohoConfiguration']['find'](_0x4fcd86)[_0x671d('0x25')](handleEntityNotFound(_0x1fe248,null))[_0x671d('0x25')](respondWithResult(_0x1fe248,null))['catch'](handleError(_0x1fe248,null));};exports[_0x671d('0x44')]=function(_0x3da4f8,_0x336f24){return db[_0x671d('0x2b')][_0x671d('0x44')](_0x3da4f8[_0x671d('0x45')],{})['then'](respondWithResult(_0x336f24,0xc9))[_0x671d('0x46')](handleError(_0x336f24,null));};exports[_0x671d('0x23')]=function(_0x285bd6,_0x4354c0){if(_0x285bd6[_0x671d('0x45')]['id']){delete _0x285bd6[_0x671d('0x45')]['id'];}return db[_0x671d('0x2b')][_0x671d('0x47')]({'where':{'id':_0x285bd6[_0x671d('0x42')]['id']}})['then'](handleEntityNotFound(_0x4354c0,null))['then'](saveUpdates(_0x285bd6[_0x671d('0x45')],null))[_0x671d('0x25')](respondWithResult(_0x4354c0,null))[_0x671d('0x46')](handleError(_0x4354c0,null));};exports[_0x671d('0x24')]=function(_0xc75aa8,_0x318816){return db['ZohoConfiguration'][_0x671d('0x47')]({'where':{'id':_0xc75aa8[_0x671d('0x42')]['id']}})['then'](handleEntityNotFound(_0x318816,null))[_0x671d('0x25')](removeEntity(_0x318816,null))[_0x671d('0x46')](handleError(_0x318816,null));};exports[_0x671d('0x48')]=function(_0x564b9d,_0x1ff38e,_0x5ed5f1){var _0x3e4b21={};var _0x2828e5={};var _0x2cf38e;var _0x99112f;return db[_0x671d('0x2b')][_0x671d('0x49')]({'where':{'id':_0x564b9d[_0x671d('0x42')]['id']}})[_0x671d('0x25')](handleEntityNotFound(_0x1ff38e,null))['then'](function(_0x7a0142){if(_0x7a0142){_0x2cf38e=_0x7a0142;_0x2828e5['model']=_['keys'](db[_0x671d('0x4a')]['rawAttributes']);_0x2828e5['query']=_[_0x671d('0x30')](_0x564b9d[_0x671d('0x31')]);_0x2828e5['filters']=_[_0x671d('0x32')](_0x2828e5[_0x671d('0x2f')],_0x2828e5[_0x671d('0x31')]);_0x3e4b21[_0x671d('0x33')]=_[_0x671d('0x32')](_0x2828e5[_0x671d('0x2f')],qs[_0x671d('0x34')](_0x564b9d[_0x671d('0x31')][_0x671d('0x34')]));_0x3e4b21[_0x671d('0x33')]=_0x3e4b21[_0x671d('0x33')][_0x671d('0x35')]?_0x3e4b21[_0x671d('0x33')]:_0x2828e5[_0x671d('0x2f')];_0x3e4b21[_0x671d('0x37')]=qs[_0x671d('0x38')](_0x564b9d[_0x671d('0x31')]['sort']);_0x3e4b21[_0x671d('0x39')]=qs['filters'](_[_0x671d('0x3a')](_0x564b9d[_0x671d('0x31')],_0x2828e5[_0x671d('0x3b')]));if(_0x564b9d[_0x671d('0x31')][_0x671d('0x3c')]){_0x3e4b21['where']=_[_0x671d('0x3d')](_0x3e4b21[_0x671d('0x39')],{'$or':_[_0x671d('0x2a')](_0x3e4b21[_0x671d('0x33')],function(_0x38b8c1){var _0x163235={};_0x163235[_0x38b8c1]={'$like':'%'+_0x564b9d['query'][_0x671d('0x3c')]+'%'};return _0x163235;})});}_0x3e4b21=_[_0x671d('0x3d')]({},_0x3e4b21,_0x564b9d[_0x671d('0x43')]);return _0x2cf38e[_0x671d('0x48')](_0x3e4b21);}})[_0x671d('0x25')](function(_0x4902e0){if(_0x4902e0){_0x99112f=_0x4902e0['length'];if(!_0x564b9d[_0x671d('0x31')][_0x671d('0x4b')]('nolimit')){_0x3e4b21['limit']=qs[_0x671d('0x1e')](_0x564b9d['query'][_0x671d('0x1e')]);_0x3e4b21['offset']=qs[_0x671d('0x1c')](_0x564b9d[_0x671d('0x31')][_0x671d('0x1c')]);}return _0x2cf38e[_0x671d('0x48')](_0x3e4b21);}})[_0x671d('0x25')](function(_0x1915b0){if(_0x1915b0){return _0x1915b0?{'count':_0x99112f,'rows':_0x1915b0}:null;}})[_0x671d('0x25')](respondWithResult(_0x1ff38e,null))['catch'](handleError(_0x1ff38e,null));};exports[_0x671d('0x4c')]=function(_0x19c9a6,_0x5221aa,_0x106638){var _0x1bcb86={};var _0x7d75d8={};var _0x166582;var _0x4d5de3;return db[_0x671d('0x2b')][_0x671d('0x49')]({'where':{'id':_0x19c9a6[_0x671d('0x42')]['id']}})[_0x671d('0x25')](handleEntityNotFound(_0x5221aa,null))[_0x671d('0x25')](function(_0xd7d9fa){if(_0xd7d9fa){_0x166582=_0xd7d9fa;_0x7d75d8[_0x671d('0x2f')]=_['keys'](db[_0x671d('0x4a')][_0x671d('0x2c')]);_0x7d75d8[_0x671d('0x31')]=_[_0x671d('0x30')](_0x19c9a6[_0x671d('0x31')]);_0x7d75d8[_0x671d('0x3b')]=_[_0x671d('0x32')](_0x7d75d8[_0x671d('0x2f')],_0x7d75d8[_0x671d('0x31')]);_0x1bcb86['attributes']=_['intersection'](_0x7d75d8[_0x671d('0x2f')],qs['fields'](_0x19c9a6['query'][_0x671d('0x34')]));_0x1bcb86['attributes']=_0x1bcb86[_0x671d('0x33')][_0x671d('0x35')]?_0x1bcb86[_0x671d('0x33')]:_0x7d75d8[_0x671d('0x2f')];_0x1bcb86[_0x671d('0x37')]=qs['sort'](_0x19c9a6[_0x671d('0x31')][_0x671d('0x38')]);_0x1bcb86[_0x671d('0x39')]=qs['filters'](_[_0x671d('0x3a')](_0x19c9a6[_0x671d('0x31')],_0x7d75d8[_0x671d('0x3b')]));if(_0x19c9a6[_0x671d('0x31')][_0x671d('0x3c')]){_0x1bcb86['where']=_[_0x671d('0x3d')](_0x1bcb86[_0x671d('0x39')],{'$or':_[_0x671d('0x2a')](_0x1bcb86[_0x671d('0x33')],function(_0x1ce497){var _0x33e53a={};_0x33e53a[_0x1ce497]={'$like':'%'+_0x19c9a6[_0x671d('0x31')][_0x671d('0x3c')]+'%'};return _0x33e53a;})});}_0x1bcb86=_[_0x671d('0x3d')]({},_0x1bcb86,_0x19c9a6['options']);return _0x166582[_0x671d('0x4c')](_0x1bcb86);}})[_0x671d('0x25')](function(_0x402602){if(_0x402602){_0x4d5de3=_0x402602[_0x671d('0x35')];if(!_0x19c9a6[_0x671d('0x31')][_0x671d('0x4b')]('nolimit')){_0x1bcb86[_0x671d('0x1e')]=qs[_0x671d('0x1e')](_0x19c9a6['query'][_0x671d('0x1e')]);_0x1bcb86['offset']=qs[_0x671d('0x1c')](_0x19c9a6[_0x671d('0x31')]['offset']);}return _0x166582[_0x671d('0x4c')](_0x1bcb86);}})[_0x671d('0x25')](function(_0x2ce66f){if(_0x2ce66f){return _0x2ce66f?{'count':_0x4d5de3,'rows':_0x2ce66f}:null;}})[_0x671d('0x25')](respondWithResult(_0x5221aa,null))[_0x671d('0x46')](handleError(_0x5221aa,null));};exports[_0x671d('0x4d')]=function(_0x5d3a28,_0x4e9059,_0xa27319){var _0x7260c0={};var _0x5f568f={};var _0x41f36f;var _0xf890e3;return db[_0x671d('0x2b')][_0x671d('0x49')]({'where':{'id':_0x5d3a28[_0x671d('0x42')]['id']}})[_0x671d('0x25')](handleEntityNotFound(_0x4e9059,null))['then'](function(_0x3ebc9d){if(_0x3ebc9d){_0x41f36f=_0x3ebc9d;_0x5f568f['model']=_[_0x671d('0x30')](db[_0x671d('0x4a')][_0x671d('0x2c')]);_0x5f568f[_0x671d('0x31')]=_[_0x671d('0x30')](_0x5d3a28[_0x671d('0x31')]);_0x5f568f[_0x671d('0x3b')]=_[_0x671d('0x32')](_0x5f568f['model'],_0x5f568f[_0x671d('0x31')]);_0x7260c0[_0x671d('0x33')]=_['intersection'](_0x5f568f[_0x671d('0x2f')],qs[_0x671d('0x34')](_0x5d3a28[_0x671d('0x31')][_0x671d('0x34')]));_0x7260c0[_0x671d('0x33')]=_0x7260c0['attributes'][_0x671d('0x35')]?_0x7260c0['attributes']:_0x5f568f['model'];_0x7260c0['order']=qs[_0x671d('0x38')](_0x5d3a28[_0x671d('0x31')][_0x671d('0x38')]);_0x7260c0['where']=qs[_0x671d('0x3b')](_[_0x671d('0x3a')](_0x5d3a28['query'],_0x5f568f['filters']));if(_0x5d3a28['query'][_0x671d('0x3c')]){_0x7260c0[_0x671d('0x39')]=_[_0x671d('0x3d')](_0x7260c0[_0x671d('0x39')],{'$or':_[_0x671d('0x2a')](_0x7260c0[_0x671d('0x33')],function(_0x382f7f){var _0x523357={};_0x523357[_0x382f7f]={'$like':'%'+_0x5d3a28[_0x671d('0x31')][_0x671d('0x3c')]+'%'};return _0x523357;})});}_0x7260c0=_[_0x671d('0x3d')]({},_0x7260c0,_0x5d3a28[_0x671d('0x43')]);return _0x41f36f[_0x671d('0x4d')](_0x7260c0);}})[_0x671d('0x25')](function(_0x645354){if(_0x645354){_0xf890e3=_0x645354[_0x671d('0x35')];if(!_0x5d3a28[_0x671d('0x31')][_0x671d('0x4b')]('nolimit')){_0x7260c0['limit']=qs[_0x671d('0x1e')](_0x5d3a28['query'][_0x671d('0x1e')]);_0x7260c0[_0x671d('0x1c')]=qs['offset'](_0x5d3a28[_0x671d('0x31')][_0x671d('0x1c')]);}return _0x41f36f[_0x671d('0x4d')](_0x7260c0);}})[_0x671d('0x25')](function(_0x294d95){if(_0x294d95){return _0x294d95?{'count':_0xf890e3,'rows':_0x294d95}:null;}})[_0x671d('0x25')](respondWithResult(_0x4e9059,null))[_0x671d('0x46')](handleError(_0x4e9059,null));}; \ No newline at end of file +var _0x03a4=['create','body','update','destroy','getFields','findOne','nolimit','getSubjects','ZohoField','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','end','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x12c26a,_0x162966){var _0xe98aec=function(_0x2e9f10){while(--_0x2e9f10){_0x12c26a['push'](_0x12c26a['shift']());}};_0xe98aec(++_0x162966);}(_0x03a4,0xb6));var _0x403a=function(_0xb045d2,_0x258206){_0xb045d2=_0xb045d2-0x0;var _0x577872=_0x03a4[_0xb045d2];return _0x577872;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x403a('0x0'));var zipdir=require(_0x403a('0x1'));var jsonpatch=require(_0x403a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x403a('0x3'));var Mustache=require(_0x403a('0x4'));var util=require('util');var path=require(_0x403a('0x5'));var sox=require(_0x403a('0x6'));var csv=require('to-csv');var ejs=require(_0x403a('0x7'));var fs=require('fs');var fs_extra=require(_0x403a('0x8'));var _=require(_0x403a('0x9'));var squel=require(_0x403a('0xa'));var crypto=require(_0x403a('0xb'));var jsforce=require(_0x403a('0xc'));var deskjs=require(_0x403a('0xd'));var toCsv=require(_0x403a('0xe'));var querystring=require(_0x403a('0xf'));var Papa=require(_0x403a('0x10'));var Redis=require(_0x403a('0x11'));var authService=require(_0x403a('0x12'));var qs=require(_0x403a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x403a('0x14'));var logger=require(_0x403a('0x15'))(_0x403a('0x16'));var utils=require(_0x403a('0x17'));var config=require(_0x403a('0x18'));var licenseUtil=require(_0x403a('0x19'));var db=require(_0x403a('0x1a'))['db'];function respondWithStatusCode(_0x652a2,_0x47e2f1){_0x47e2f1=_0x47e2f1||0xcc;return function(_0x477a7c){if(_0x477a7c){return _0x652a2[_0x403a('0x1b')](_0x47e2f1);}return _0x652a2[_0x403a('0x1c')](_0x47e2f1)['end']();};}function respondWithResult(_0x33244d,_0x3970f1){_0x3970f1=_0x3970f1||0xc8;return function(_0x5961bf){if(_0x5961bf){return _0x33244d[_0x403a('0x1c')](_0x3970f1)[_0x403a('0x1d')](_0x5961bf);}};}function respondWithFilteredResult(_0x387fc8,_0x3845a0){return function(_0x3457c7){if(_0x3457c7){var _0x1cfb9c=typeof _0x3845a0[_0x403a('0x1e')]==='undefined'&&typeof _0x3845a0[_0x403a('0x1f')]===_0x403a('0x20');var _0x304908=_0x3457c7[_0x403a('0x21')];var _0x213762=_0x1cfb9c?0x0:_0x3845a0[_0x403a('0x1e')];var _0x2d9b8a=_0x1cfb9c?_0x3457c7[_0x403a('0x21')]:_0x3845a0[_0x403a('0x1e')]+_0x3845a0[_0x403a('0x1f')];var _0x35e65f;if(_0x2d9b8a>=_0x304908){_0x2d9b8a=_0x304908;_0x35e65f=0xc8;}else{_0x35e65f=0xce;}_0x387fc8[_0x403a('0x1c')](_0x35e65f);return _0x387fc8[_0x403a('0x22')](_0x403a('0x23'),_0x213762+'-'+_0x2d9b8a+'/'+_0x304908)[_0x403a('0x1d')](_0x3457c7);}return null;};}function patchUpdates(_0x1b55ff){return function(_0x1625f3){try{jsonpatch[_0x403a('0x24')](_0x1625f3,_0x1b55ff,!![]);}catch(_0x7530d3){return BPromise['reject'](_0x7530d3);}return _0x1625f3[_0x403a('0x25')]();};}function saveUpdates(_0x5e2b0b,_0x4a829d){return function(_0x4bf7e9){if(_0x4bf7e9){return _0x4bf7e9['update'](_0x5e2b0b)[_0x403a('0x26')](function(_0x1bbcab){return _0x1bbcab;});}return null;};}function removeEntity(_0x115331,_0x3e86cb){return function(_0x1cd811){if(_0x1cd811){return _0x1cd811['destroy']()[_0x403a('0x26')](function(){_0x115331['status'](0xcc)[_0x403a('0x27')]();});}};}function handleEntityNotFound(_0x130dd8,_0x23e435){return function(_0x5dbcc6){if(!_0x5dbcc6){_0x130dd8[_0x403a('0x1b')](0x194);}return _0x5dbcc6;};}function handleError(_0x569e37,_0x4bfdbb){_0x4bfdbb=_0x4bfdbb||0x1f4;return function(_0x5c69e0){logger[_0x403a('0x28')](_0x5c69e0[_0x403a('0x29')]);if(_0x5c69e0[_0x403a('0x2a')]){delete _0x5c69e0[_0x403a('0x2a')];}_0x569e37[_0x403a('0x1c')](_0x4bfdbb)[_0x403a('0x2b')](_0x5c69e0);};}exports[_0x403a('0x2c')]=function(_0x403c2f,_0x13bd28){var _0x1fc543={},_0x447c3f={},_0x279d27={'count':0x0,'rows':[]};var _0xff78e7=_[_0x403a('0x2d')](db[_0x403a('0x2e')]['rawAttributes'],function(_0x788047){return{'name':_0x788047[_0x403a('0x2f')],'type':_0x788047[_0x403a('0x30')][_0x403a('0x31')]};});_0x447c3f[_0x403a('0x32')]=_['map'](_0xff78e7,_0x403a('0x2a'));_0x447c3f[_0x403a('0x33')]=_[_0x403a('0x34')](_0x403c2f[_0x403a('0x33')]);_0x447c3f[_0x403a('0x35')]=_[_0x403a('0x36')](_0x447c3f['model'],_0x447c3f['query']);_0x1fc543[_0x403a('0x37')]=_[_0x403a('0x36')](_0x447c3f[_0x403a('0x32')],qs[_0x403a('0x38')](_0x403c2f[_0x403a('0x33')]['fields']));_0x1fc543['attributes']=_0x1fc543[_0x403a('0x37')][_0x403a('0x39')]?_0x1fc543[_0x403a('0x37')]:_0x447c3f[_0x403a('0x32')];if(!_0x403c2f[_0x403a('0x33')][_0x403a('0x3a')]('nolimit')){_0x1fc543[_0x403a('0x1f')]=qs[_0x403a('0x1f')](_0x403c2f[_0x403a('0x33')][_0x403a('0x1f')]);_0x1fc543[_0x403a('0x1e')]=qs[_0x403a('0x1e')](_0x403c2f['query'][_0x403a('0x1e')]);}_0x1fc543[_0x403a('0x3b')]=qs[_0x403a('0x3c')](_0x403c2f[_0x403a('0x33')][_0x403a('0x3c')]);_0x1fc543['where']=qs[_0x403a('0x35')](_[_0x403a('0x3d')](_0x403c2f['query'],_0x447c3f[_0x403a('0x35')]),_0xff78e7);if(_0x403c2f[_0x403a('0x33')][_0x403a('0x3e')]){_0x1fc543[_0x403a('0x3f')]=_[_0x403a('0x40')](_0x1fc543['where'],{'$or':_['map'](_0xff78e7,function(_0xf70bf2){if(_0xf70bf2[_0x403a('0x30')]!==_0x403a('0x41')){var _0x10c487={};_0x10c487[_0xf70bf2[_0x403a('0x2a')]]={'$like':'%'+_0x403c2f['query'][_0x403a('0x3e')]+'%'};return _0x10c487;}})});}_0x1fc543=_[_0x403a('0x40')]({},_0x1fc543,_0x403c2f[_0x403a('0x42')]);var _0x49ad8c={'where':_0x1fc543[_0x403a('0x3f')]};return db[_0x403a('0x2e')][_0x403a('0x21')](_0x49ad8c)['then'](function(_0x452e00){_0x279d27['count']=_0x452e00;if(_0x403c2f[_0x403a('0x33')][_0x403a('0x43')]){_0x1fc543[_0x403a('0x44')]=[{'all':!![]}];}return db[_0x403a('0x2e')][_0x403a('0x45')](_0x1fc543);})[_0x403a('0x26')](function(_0x302471){_0x279d27[_0x403a('0x46')]=_0x302471;return _0x279d27;})[_0x403a('0x26')](respondWithFilteredResult(_0x13bd28,_0x1fc543))[_0x403a('0x47')](handleError(_0x13bd28,null));};exports[_0x403a('0x48')]=function(_0x4b06e6,_0x50da1a){var _0x599074={'raw':![],'where':{'id':_0x4b06e6[_0x403a('0x49')]['id']}},_0x1c9afe={};_0x1c9afe[_0x403a('0x32')]=_[_0x403a('0x34')](db[_0x403a('0x2e')][_0x403a('0x4a')]);_0x1c9afe[_0x403a('0x33')]=_[_0x403a('0x34')](_0x4b06e6[_0x403a('0x33')]);_0x1c9afe[_0x403a('0x35')]=_[_0x403a('0x36')](_0x1c9afe[_0x403a('0x32')],_0x1c9afe[_0x403a('0x33')]);_0x599074[_0x403a('0x37')]=_[_0x403a('0x36')](_0x1c9afe['model'],qs['fields'](_0x4b06e6[_0x403a('0x33')][_0x403a('0x38')]));_0x599074[_0x403a('0x37')]=_0x599074['attributes'][_0x403a('0x39')]?_0x599074['attributes']:_0x1c9afe[_0x403a('0x32')];if(_0x4b06e6[_0x403a('0x33')][_0x403a('0x43')]){_0x599074['include']=[{'all':!![]}];}_0x599074=_[_0x403a('0x40')]({},_0x599074,_0x4b06e6[_0x403a('0x42')]);return db[_0x403a('0x2e')][_0x403a('0x4b')](_0x599074)[_0x403a('0x26')](handleEntityNotFound(_0x50da1a,null))[_0x403a('0x26')](respondWithResult(_0x50da1a,null))[_0x403a('0x47')](handleError(_0x50da1a,null));};exports['create']=function(_0x485610,_0x50c784){return db[_0x403a('0x2e')][_0x403a('0x4c')](_0x485610[_0x403a('0x4d')],{})[_0x403a('0x26')](respondWithResult(_0x50c784,0xc9))[_0x403a('0x47')](handleError(_0x50c784,null));};exports[_0x403a('0x4e')]=function(_0x3e34d0,_0x49ea19){if(_0x3e34d0[_0x403a('0x4d')]['id']){delete _0x3e34d0[_0x403a('0x4d')]['id'];}return db['ZohoConfiguration'][_0x403a('0x4b')]({'where':{'id':_0x3e34d0['params']['id']}})[_0x403a('0x26')](handleEntityNotFound(_0x49ea19,null))['then'](saveUpdates(_0x3e34d0[_0x403a('0x4d')],null))[_0x403a('0x26')](respondWithResult(_0x49ea19,null))[_0x403a('0x47')](handleError(_0x49ea19,null));};exports[_0x403a('0x4f')]=function(_0x34897e,_0x4a3f5d){return db['ZohoConfiguration'][_0x403a('0x4b')]({'where':{'id':_0x34897e[_0x403a('0x49')]['id']}})[_0x403a('0x26')](handleEntityNotFound(_0x4a3f5d,null))['then'](removeEntity(_0x4a3f5d,null))[_0x403a('0x47')](handleError(_0x4a3f5d,null));};exports[_0x403a('0x50')]=function(_0x52e89e,_0x44b49a,_0x1d11cc){var _0x19227d={};var _0x2b8d83={};var _0x16b979;var _0x37996c;return db['ZohoConfiguration'][_0x403a('0x51')]({'where':{'id':_0x52e89e[_0x403a('0x49')]['id']}})[_0x403a('0x26')](handleEntityNotFound(_0x44b49a,null))[_0x403a('0x26')](function(_0x24a24f){if(_0x24a24f){_0x16b979=_0x24a24f;_0x2b8d83[_0x403a('0x32')]=_['keys'](db['ZohoField'][_0x403a('0x4a')]);_0x2b8d83['query']=_[_0x403a('0x34')](_0x52e89e[_0x403a('0x33')]);_0x2b8d83[_0x403a('0x35')]=_[_0x403a('0x36')](_0x2b8d83[_0x403a('0x32')],_0x2b8d83[_0x403a('0x33')]);_0x19227d[_0x403a('0x37')]=_['intersection'](_0x2b8d83['model'],qs['fields'](_0x52e89e[_0x403a('0x33')][_0x403a('0x38')]));_0x19227d[_0x403a('0x37')]=_0x19227d[_0x403a('0x37')][_0x403a('0x39')]?_0x19227d[_0x403a('0x37')]:_0x2b8d83[_0x403a('0x32')];_0x19227d[_0x403a('0x3b')]=qs[_0x403a('0x3c')](_0x52e89e[_0x403a('0x33')][_0x403a('0x3c')]);_0x19227d['where']=qs[_0x403a('0x35')](_[_0x403a('0x3d')](_0x52e89e['query'],_0x2b8d83[_0x403a('0x35')]));if(_0x52e89e['query'][_0x403a('0x3e')]){_0x19227d[_0x403a('0x3f')]=_[_0x403a('0x40')](_0x19227d[_0x403a('0x3f')],{'$or':_['map'](_0x19227d[_0x403a('0x37')],function(_0x382dbe){var _0x177604={};_0x177604[_0x382dbe]={'$like':'%'+_0x52e89e[_0x403a('0x33')][_0x403a('0x3e')]+'%'};return _0x177604;})});}_0x19227d=_[_0x403a('0x40')]({},_0x19227d,_0x52e89e[_0x403a('0x42')]);return _0x16b979[_0x403a('0x50')](_0x19227d);}})[_0x403a('0x26')](function(_0x1157cf){if(_0x1157cf){_0x37996c=_0x1157cf['length'];if(!_0x52e89e[_0x403a('0x33')][_0x403a('0x3a')](_0x403a('0x52'))){_0x19227d['limit']=qs['limit'](_0x52e89e[_0x403a('0x33')]['limit']);_0x19227d['offset']=qs['offset'](_0x52e89e[_0x403a('0x33')][_0x403a('0x1e')]);}return _0x16b979['getFields'](_0x19227d);}})[_0x403a('0x26')](function(_0xedf809){if(_0xedf809){return _0xedf809?{'count':_0x37996c,'rows':_0xedf809}:null;}})[_0x403a('0x26')](respondWithResult(_0x44b49a,null))['catch'](handleError(_0x44b49a,null));};exports[_0x403a('0x53')]=function(_0x4767ba,_0xc7aae9,_0x5a24a9){var _0x64483f={};var _0x335557={};var _0x312635;var _0x57df82;return db[_0x403a('0x2e')]['findOne']({'where':{'id':_0x4767ba[_0x403a('0x49')]['id']}})[_0x403a('0x26')](handleEntityNotFound(_0xc7aae9,null))[_0x403a('0x26')](function(_0x3d8346){if(_0x3d8346){_0x312635=_0x3d8346;_0x335557[_0x403a('0x32')]=_[_0x403a('0x34')](db[_0x403a('0x54')]['rawAttributes']);_0x335557[_0x403a('0x33')]=_['keys'](_0x4767ba[_0x403a('0x33')]);_0x335557[_0x403a('0x35')]=_['intersection'](_0x335557[_0x403a('0x32')],_0x335557[_0x403a('0x33')]);_0x64483f[_0x403a('0x37')]=_[_0x403a('0x36')](_0x335557['model'],qs[_0x403a('0x38')](_0x4767ba[_0x403a('0x33')][_0x403a('0x38')]));_0x64483f['attributes']=_0x64483f['attributes'][_0x403a('0x39')]?_0x64483f['attributes']:_0x335557[_0x403a('0x32')];_0x64483f[_0x403a('0x3b')]=qs[_0x403a('0x3c')](_0x4767ba[_0x403a('0x33')][_0x403a('0x3c')]);_0x64483f[_0x403a('0x3f')]=qs['filters'](_['pick'](_0x4767ba['query'],_0x335557[_0x403a('0x35')]));if(_0x4767ba[_0x403a('0x33')][_0x403a('0x3e')]){_0x64483f['where']=_[_0x403a('0x40')](_0x64483f[_0x403a('0x3f')],{'$or':_['map'](_0x64483f[_0x403a('0x37')],function(_0x4949db){var _0x45fd57={};_0x45fd57[_0x4949db]={'$like':'%'+_0x4767ba[_0x403a('0x33')]['filter']+'%'};return _0x45fd57;})});}_0x64483f=_[_0x403a('0x40')]({},_0x64483f,_0x4767ba[_0x403a('0x42')]);return _0x312635[_0x403a('0x53')](_0x64483f);}})['then'](function(_0x24aa7b){if(_0x24aa7b){_0x57df82=_0x24aa7b[_0x403a('0x39')];if(!_0x4767ba['query'][_0x403a('0x3a')](_0x403a('0x52'))){_0x64483f[_0x403a('0x1f')]=qs[_0x403a('0x1f')](_0x4767ba[_0x403a('0x33')]['limit']);_0x64483f['offset']=qs['offset'](_0x4767ba[_0x403a('0x33')][_0x403a('0x1e')]);}return _0x312635[_0x403a('0x53')](_0x64483f);}})['then'](function(_0x111a93){if(_0x111a93){return _0x111a93?{'count':_0x57df82,'rows':_0x111a93}:null;}})['then'](respondWithResult(_0xc7aae9,null))['catch'](handleError(_0xc7aae9,null));};exports[_0x403a('0x55')]=function(_0x9b2b8e,_0xd189e1,_0x38b1ee){var _0x501488={};var _0x4af762={};var _0x170be3;var _0x2031d3;return db['ZohoConfiguration'][_0x403a('0x51')]({'where':{'id':_0x9b2b8e[_0x403a('0x49')]['id']}})[_0x403a('0x26')](handleEntityNotFound(_0xd189e1,null))[_0x403a('0x26')](function(_0x43f585){if(_0x43f585){_0x170be3=_0x43f585;_0x4af762[_0x403a('0x32')]=_[_0x403a('0x34')](db[_0x403a('0x54')][_0x403a('0x4a')]);_0x4af762[_0x403a('0x33')]=_['keys'](_0x9b2b8e['query']);_0x4af762[_0x403a('0x35')]=_['intersection'](_0x4af762[_0x403a('0x32')],_0x4af762['query']);_0x501488[_0x403a('0x37')]=_['intersection'](_0x4af762[_0x403a('0x32')],qs['fields'](_0x9b2b8e[_0x403a('0x33')][_0x403a('0x38')]));_0x501488[_0x403a('0x37')]=_0x501488[_0x403a('0x37')][_0x403a('0x39')]?_0x501488[_0x403a('0x37')]:_0x4af762[_0x403a('0x32')];_0x501488['order']=qs[_0x403a('0x3c')](_0x9b2b8e[_0x403a('0x33')][_0x403a('0x3c')]);_0x501488[_0x403a('0x3f')]=qs[_0x403a('0x35')](_[_0x403a('0x3d')](_0x9b2b8e['query'],_0x4af762[_0x403a('0x35')]));if(_0x9b2b8e[_0x403a('0x33')][_0x403a('0x3e')]){_0x501488[_0x403a('0x3f')]=_['merge'](_0x501488['where'],{'$or':_[_0x403a('0x2d')](_0x501488['attributes'],function(_0xd5e485){var _0x4f7544={};_0x4f7544[_0xd5e485]={'$like':'%'+_0x9b2b8e[_0x403a('0x33')][_0x403a('0x3e')]+'%'};return _0x4f7544;})});}_0x501488=_[_0x403a('0x40')]({},_0x501488,_0x9b2b8e[_0x403a('0x42')]);return _0x170be3[_0x403a('0x55')](_0x501488);}})[_0x403a('0x26')](function(_0x21b53c){if(_0x21b53c){_0x2031d3=_0x21b53c[_0x403a('0x39')];if(!_0x9b2b8e[_0x403a('0x33')]['hasOwnProperty'](_0x403a('0x52'))){_0x501488['limit']=qs[_0x403a('0x1f')](_0x9b2b8e[_0x403a('0x33')]['limit']);_0x501488[_0x403a('0x1e')]=qs['offset'](_0x9b2b8e[_0x403a('0x33')][_0x403a('0x1e')]);}return _0x170be3[_0x403a('0x55')](_0x501488);}})['then'](function(_0x45e746){if(_0x45e746){return _0x45e746?{'count':_0x2031d3,'rows':_0x45e746}:null;}})[_0x403a('0x26')](respondWithResult(_0xd189e1,null))[_0x403a('0x47')](handleError(_0xd189e1,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 5d72166..7070ebf 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 _0x5f2d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger'];(function(_0x214d3f,_0x5f0061){var _0x428464=function(_0x2a64e4){while(--_0x2a64e4){_0x214d3f['push'](_0x214d3f['shift']());}};_0x428464(++_0x5f0061);}(_0x5f2d,0x15c));var _0xd5f2=function(_0x5a2481,_0x3fa1c7){_0x5a2481=_0x5a2481-0x0;var _0x3ae45e=_0x5f2d[_0x5a2481];return _0x3ae45e;};'use strict';var _=require(_0xd5f2('0x0'));var util=require(_0xd5f2('0x1'));var logger=require(_0xd5f2('0x2'))(_0xd5f2('0x3'));var moment=require(_0xd5f2('0x4'));var BPromise=require(_0xd5f2('0x5'));var rp=require(_0xd5f2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5f2('0x7'));var config=require(_0xd5f2('0x8'));var attributes=require(_0xd5f2('0x9'));module[_0xd5f2('0xa')]=function(_0x3099de,_0x59e76c){return _0x3099de[_0xd5f2('0xb')](_0xd5f2('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19e7=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x19e7,0xbd));var _0x719e=function(_0x1c3e07,_0x4d31a5){_0x1c3e07=_0x1c3e07-0x0;var _0x1defcb=_0x19e7[_0x1c3e07];return _0x1defcb;};'use strict';var _=require(_0x719e('0x0'));var util=require(_0x719e('0x1'));var logger=require(_0x719e('0x2'))(_0x719e('0x3'));var moment=require(_0x719e('0x4'));var BPromise=require(_0x719e('0x5'));var rp=require(_0x719e('0x6'));var fs=require('fs');var path=require(_0x719e('0x7'));var rimraf=require(_0x719e('0x8'));var config=require(_0x719e('0x9'));var attributes=require(_0x719e('0xa'));module[_0x719e('0xb')]=function(_0x29eb97,_0x2c1fff){return _0x29eb97[_0x719e('0xc')](_0x719e('0xd'),attributes,{'tableName':_0x719e('0xe'),'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 7382559..1e6a376 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 _0x5ff8=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3001d9,_0x196245){var _0xbd0b61=function(_0x129eea){while(--_0x129eea){_0x3001d9['push'](_0x3001d9['shift']());}};_0xbd0b61(++_0x196245);}(_0x5ff8,0xa3));var _0x85ff=function(_0xf5e931,_0x27067d){_0xf5e931=_0xf5e931-0x0;var _0x1a796f=_0x5ff8[_0xf5e931];return _0x1a796f;};'use strict';var _=require(_0x85ff('0x0'));var util=require(_0x85ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x85ff('0x2'));var fs=require('fs');var Redis=require(_0x85ff('0x3'));var db=require(_0x85ff('0x4'))['db'];var utils=require(_0x85ff('0x5'));var logger=require('../../config/logger')(_0x85ff('0x6'));var config=require(_0x85ff('0x7'));var jayson=require(_0x85ff('0x8'));var client=jayson[_0x85ff('0x9')][_0x85ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4af928,_0x176be7,_0x1bda5a){return new BPromise(function(_0x10285d,_0xb043c6){return client['request'](_0x4af928,_0x1bda5a)[_0x85ff('0xb')](function(_0x48ffae){logger[_0x85ff('0xc')](_0x85ff('0xd'),_0x176be7,_0x85ff('0xe'));logger[_0x85ff('0xf')](_0x85ff('0x10'),_0x176be7,_0x85ff('0xe'),JSON[_0x85ff('0x11')](_0x48ffae));if(_0x48ffae['error']){if(_0x48ffae[_0x85ff('0x12')]['code']===0x1f4){logger['error'](_0x85ff('0xd'),_0x176be7,_0x48ffae[_0x85ff('0x12')]['message']);return _0xb043c6(_0x48ffae[_0x85ff('0x12')][_0x85ff('0x13')]);}logger[_0x85ff('0x12')](_0x85ff('0xd'),_0x176be7,_0x48ffae['error'][_0x85ff('0x13')]);return _0x10285d(_0x48ffae[_0x85ff('0x12')][_0x85ff('0x13')]);}else{logger['info'](_0x85ff('0xd'),_0x176be7,'request\x20sent');_0x10285d(_0x48ffae[_0x85ff('0x14')][_0x85ff('0x13')]);}})[_0x85ff('0x15')](function(_0x294845){logger[_0x85ff('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x176be7,_0x294845);_0xb043c6(_0x294845);});});} \ No newline at end of file +var _0xf476=['http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x13ef4f,_0x268dae){var _0x568fa4=function(_0x166586){while(--_0x166586){_0x13ef4f['push'](_0x13ef4f['shift']());}};_0x568fa4(++_0x268dae);}(_0xf476,0x11f));var _0x6f47=function(_0x34ca02,_0x3b716e){_0x34ca02=_0x34ca02-0x0;var _0x59b4e7=_0xf476[_0x34ca02];return _0x59b4e7;};'use strict';var _=require(_0x6f47('0x0'));var util=require(_0x6f47('0x1'));var moment=require(_0x6f47('0x2'));var BPromise=require(_0x6f47('0x3'));var rs=require(_0x6f47('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f47('0x5'))['db'];var utils=require(_0x6f47('0x6'));var logger=require(_0x6f47('0x7'))(_0x6f47('0x8'));var config=require(_0x6f47('0x9'));var jayson=require(_0x6f47('0xa'));var client=jayson[_0x6f47('0xb')][_0x6f47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cc55c,_0x1ee27b,_0x375e42){return new BPromise(function(_0x416fad,_0x52c99e){return client[_0x6f47('0xd')](_0x3cc55c,_0x375e42)[_0x6f47('0xe')](function(_0x12d80b){logger[_0x6f47('0xf')](_0x6f47('0x10'),_0x1ee27b,_0x6f47('0x11'));logger[_0x6f47('0x12')](_0x6f47('0x13'),_0x1ee27b,_0x6f47('0x11'),JSON['stringify'](_0x12d80b));if(_0x12d80b[_0x6f47('0x14')]){if(_0x12d80b[_0x6f47('0x14')]['code']===0x1f4){logger[_0x6f47('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x1ee27b,_0x12d80b[_0x6f47('0x14')][_0x6f47('0x15')]);return _0x52c99e(_0x12d80b[_0x6f47('0x14')][_0x6f47('0x15')]);}logger[_0x6f47('0x14')](_0x6f47('0x10'),_0x1ee27b,_0x12d80b[_0x6f47('0x14')]['message']);return _0x416fad(_0x12d80b[_0x6f47('0x14')][_0x6f47('0x15')]);}else{logger[_0x6f47('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1ee27b,_0x6f47('0x11'));_0x416fad(_0x12d80b['result'][_0x6f47('0x15')]);}})[_0x6f47('0x16')](function(_0x53b037){logger[_0x6f47('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x1ee27b,_0x53b037);_0x52c99e(_0x53b037);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index d5af741..9a95243 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 _0x9da6=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','/:id','isAuthenticated','post','put','update','delete','destroy','multer','path'];(function(_0x24a4dd,_0xb58e96){var _0x5e75c4=function(_0x167f42){while(--_0x167f42){_0x24a4dd['push'](_0x24a4dd['shift']());}};_0x5e75c4(++_0xb58e96);}(_0x9da6,0xae));var _0x69da=function(_0x58252c,_0x405c44){_0x58252c=_0x58252c-0x0;var _0x83c31b=_0x9da6[_0x58252c];return _0x83c31b;};'use strict';var multer=require(_0x69da('0x0'));var util=require('util');var path=require(_0x69da('0x1'));var timeout=require('connect-timeout');var express=require(_0x69da('0x2'));var router=express[_0x69da('0x3')]();var fs_extra=require(_0x69da('0x4'));var auth=require(_0x69da('0x5'));var interaction=require(_0x69da('0x6'));var config=require('../../config/environment');var controller=require(_0x69da('0x7'));router[_0x69da('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x69da('0x9'),auth[_0x69da('0xa')](),controller['show']);router[_0x69da('0xb')]('/',auth[_0x69da('0xa')](),controller['create']);router[_0x69da('0xc')](_0x69da('0x9'),auth[_0x69da('0xa')](),controller[_0x69da('0xd')]);router[_0x69da('0xe')](_0x69da('0x9'),auth[_0x69da('0xa')](),controller[_0x69da('0xf')]);module['exports']=router; \ No newline at end of file +var _0x21d7=['../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x4167e0,_0x955464){var _0x55a313=function(_0x48a6c7){while(--_0x48a6c7){_0x4167e0['push'](_0x4167e0['shift']());}};_0x55a313(++_0x955464);}(_0x21d7,0xf7));var _0x721d=function(_0x4ca6eb,_0x4495c0){_0x4ca6eb=_0x4ca6eb-0x0;var _0x19301c=_0x21d7[_0x4ca6eb];return _0x19301c;};'use strict';var multer=require(_0x721d('0x0'));var util=require(_0x721d('0x1'));var path=require(_0x721d('0x2'));var timeout=require('connect-timeout');var express=require(_0x721d('0x3'));var router=express[_0x721d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x721d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x721d('0x6'));var controller=require(_0x721d('0x7'));router[_0x721d('0x8')]('/',auth[_0x721d('0x9')](),controller[_0x721d('0xa')]);router['get'](_0x721d('0xb'),auth[_0x721d('0x9')](),controller['show']);router['post']('/',auth[_0x721d('0x9')](),controller[_0x721d('0xc')]);router[_0x721d('0xd')]('/:id',auth[_0x721d('0x9')](),controller[_0x721d('0xe')]);router[_0x721d('0xf')](_0x721d('0xb'),auth[_0x721d('0x9')](),controller[_0x721d('0x10')]);module[_0x721d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index f1caa45..fa35fa5 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 _0x5a55=['exports','customVariable','keyValue','string','STRING','variable','sequelize'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0x5a55,0x1c6));var _0x55a5=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x5a55[_0x2c2980];return _0x2a20a9;};'use strict';var Sequelize=require(_0x55a5('0x0'));module[_0x55a5('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x55a5('0x2'),_0x55a5('0x3'),'picklist'),'defaultValue':_0x55a5('0x4')},'content':{'type':Sequelize[_0x55a5('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x55a5('0x4'),_0x55a5('0x6'),_0x55a5('0x2'))},'keyContent':{'type':Sequelize[_0x55a5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x55a5('0x5')]}}; \ No newline at end of file +var _0x5443=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x1b1aee,_0x5994f5){var _0x2e62a3=function(_0x10e13e){while(--_0x10e13e){_0x1b1aee['push'](_0x1b1aee['shift']());}};_0x2e62a3(++_0x5994f5);}(_0x5443,0xdb));var _0x3544=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5443[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x3544('0x0'));module[_0x3544('0x1')]={'type':{'type':Sequelize[_0x3544('0x2')]('string',_0x3544('0x3'),_0x3544('0x4'),_0x3544('0x5'),_0x3544('0x6')),'defaultValue':_0x3544('0x7')},'content':{'type':Sequelize[_0x3544('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3544('0x2')]('string',_0x3544('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3544('0x8')]},'nameField':{'type':Sequelize[_0x3544('0x8')]},'customField':{'type':Sequelize[_0x3544('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3544('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b9c6896..ca13e44 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 _0x0404=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','ZohoField','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0404,0x12f));var _0x4040=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x0404[_0x367a3d];return _0x460539;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4040('0x0'));var zipdir=require(_0x4040('0x1'));var jsonpatch=require(_0x4040('0x2'));var rp=require(_0x4040('0x3'));var moment=require(_0x4040('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4040('0x5'));var util=require(_0x4040('0x6'));var path=require(_0x4040('0x7'));var sox=require(_0x4040('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4040('0x9'));var _=require(_0x4040('0xa'));var squel=require('squel');var crypto=require(_0x4040('0xb'));var jsforce=require(_0x4040('0xc'));var deskjs=require(_0x4040('0xd'));var toCsv=require(_0x4040('0xe'));var querystring=require(_0x4040('0xf'));var Papa=require('papaparse');var Redis=require(_0x4040('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4040('0x11'));var as=require(_0x4040('0x12'));var hardwareService=require(_0x4040('0x13'));var logger=require('../../config/logger')(_0x4040('0x14'));var utils=require(_0x4040('0x15'));var config=require(_0x4040('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4040('0x17'))['db'];function respondWithStatusCode(_0x1665d0,_0x5bab2f){_0x5bab2f=_0x5bab2f||0xcc;return function(_0x5ecfb4){if(_0x5ecfb4){return _0x1665d0[_0x4040('0x18')](_0x5bab2f);}return _0x1665d0[_0x4040('0x19')](_0x5bab2f)[_0x4040('0x1a')]();};}function respondWithResult(_0x2840b9,_0x47fb87){_0x47fb87=_0x47fb87||0xc8;return function(_0x49cd50){if(_0x49cd50){return _0x2840b9[_0x4040('0x19')](_0x47fb87)[_0x4040('0x1b')](_0x49cd50);}};}function respondWithFilteredResult(_0x2564e5,_0x162331){return function(_0xe7002a){if(_0xe7002a){var _0x2b394d=typeof _0x162331[_0x4040('0x1c')]==='undefined'&&typeof _0x162331[_0x4040('0x1d')]===_0x4040('0x1e');var _0x29f4c6=_0xe7002a[_0x4040('0x1f')];var _0x5d5628=_0x2b394d?0x0:_0x162331[_0x4040('0x1c')];var _0x2e88a7=_0x2b394d?_0xe7002a['count']:_0x162331['offset']+_0x162331[_0x4040('0x1d')];var _0x31ecdb;if(_0x2e88a7>=_0x29f4c6){_0x2e88a7=_0x29f4c6;_0x31ecdb=0xc8;}else{_0x31ecdb=0xce;}_0x2564e5[_0x4040('0x19')](_0x31ecdb);return _0x2564e5[_0x4040('0x20')](_0x4040('0x21'),_0x5d5628+'-'+_0x2e88a7+'/'+_0x29f4c6)[_0x4040('0x1b')](_0xe7002a);}return null;};}function patchUpdates(_0x3ed1d2){return function(_0x50b86d){try{jsonpatch['apply'](_0x50b86d,_0x3ed1d2,!![]);}catch(_0x43a0bb){return BPromise[_0x4040('0x22')](_0x43a0bb);}return _0x50b86d[_0x4040('0x23')]();};}function saveUpdates(_0x3b7391,_0x2ab54d){return function(_0x2e38d2){if(_0x2e38d2){return _0x2e38d2['update'](_0x3b7391)[_0x4040('0x24')](function(_0x3fe255){return _0x3fe255;});}return null;};}function removeEntity(_0x55bc4b,_0x1f0c01){return function(_0x1963e0){if(_0x1963e0){return _0x1963e0[_0x4040('0x25')]()[_0x4040('0x24')](function(){_0x55bc4b['status'](0xcc)[_0x4040('0x1a')]();});}};}function handleEntityNotFound(_0x58e4e0,_0x2a125e){return function(_0x352841){if(!_0x352841){_0x58e4e0[_0x4040('0x18')](0x194);}return _0x352841;};}function handleError(_0x4ec3bb,_0x408dbd){_0x408dbd=_0x408dbd||0x1f4;return function(_0x18d0f8){logger[_0x4040('0x26')](_0x18d0f8['stack']);if(_0x18d0f8[_0x4040('0x27')]){delete _0x18d0f8['name'];}_0x4ec3bb[_0x4040('0x19')](_0x408dbd)['send'](_0x18d0f8);};}exports[_0x4040('0x28')]=function(_0x7e861,_0x561920){var _0xa62834={},_0x5c8ce6={},_0x4ab8af={'count':0x0,'rows':[]};var _0x14b8b9=_[_0x4040('0x29')](db['ZohoField'][_0x4040('0x2a')],function(_0x5d5ee1){return{'name':_0x5d5ee1[_0x4040('0x2b')],'type':_0x5d5ee1[_0x4040('0x2c')][_0x4040('0x2d')]};});_0x5c8ce6[_0x4040('0x2e')]=_['map'](_0x14b8b9,_0x4040('0x27'));_0x5c8ce6['query']=_['keys'](_0x7e861[_0x4040('0x2f')]);_0x5c8ce6[_0x4040('0x30')]=_['intersection'](_0x5c8ce6[_0x4040('0x2e')],_0x5c8ce6['query']);_0xa62834['attributes']=_[_0x4040('0x31')](_0x5c8ce6['model'],qs[_0x4040('0x32')](_0x7e861['query'][_0x4040('0x32')]));_0xa62834[_0x4040('0x33')]=_0xa62834[_0x4040('0x33')][_0x4040('0x34')]?_0xa62834[_0x4040('0x33')]:_0x5c8ce6[_0x4040('0x2e')];if(!_0x7e861[_0x4040('0x2f')][_0x4040('0x35')](_0x4040('0x36'))){_0xa62834[_0x4040('0x1d')]=qs[_0x4040('0x1d')](_0x7e861[_0x4040('0x2f')][_0x4040('0x1d')]);_0xa62834[_0x4040('0x1c')]=qs[_0x4040('0x1c')](_0x7e861['query'][_0x4040('0x1c')]);}_0xa62834[_0x4040('0x37')]=qs[_0x4040('0x38')](_0x7e861[_0x4040('0x2f')]['sort']);_0xa62834['where']=qs[_0x4040('0x30')](_[_0x4040('0x39')](_0x7e861['query'],_0x5c8ce6[_0x4040('0x30')]),_0x14b8b9);if(_0x7e861[_0x4040('0x2f')][_0x4040('0x3a')]){_0xa62834[_0x4040('0x3b')]=_[_0x4040('0x3c')](_0xa62834[_0x4040('0x3b')],{'$or':_[_0x4040('0x29')](_0x14b8b9,function(_0x335304){if(_0x335304['type']!==_0x4040('0x3d')){var _0x2f10a7={};_0x2f10a7[_0x335304[_0x4040('0x27')]]={'$like':'%'+_0x7e861['query'][_0x4040('0x3a')]+'%'};return _0x2f10a7;}})});}_0xa62834=_['merge']({},_0xa62834,_0x7e861['options']);var _0x280f81={'where':_0xa62834['where']};return db[_0x4040('0x3e')][_0x4040('0x1f')](_0x280f81)['then'](function(_0xab56e6){_0x4ab8af[_0x4040('0x1f')]=_0xab56e6;if(_0x7e861['query'][_0x4040('0x3f')]){_0xa62834[_0x4040('0x40')]=[{'all':!![]}];}return db[_0x4040('0x3e')][_0x4040('0x41')](_0xa62834);})['then'](function(_0x506f1e){_0x4ab8af[_0x4040('0x42')]=_0x506f1e;return _0x4ab8af;})[_0x4040('0x24')](respondWithFilteredResult(_0x561920,_0xa62834))[_0x4040('0x43')](handleError(_0x561920,null));};exports[_0x4040('0x44')]=function(_0x2184ae,_0x2e20db){var _0x307c87={'raw':!![],'where':{'id':_0x2184ae[_0x4040('0x45')]['id']}},_0x2aff82={};_0x2aff82[_0x4040('0x2e')]=_[_0x4040('0x46')](db[_0x4040('0x3e')][_0x4040('0x2a')]);_0x2aff82[_0x4040('0x2f')]=_[_0x4040('0x46')](_0x2184ae[_0x4040('0x2f')]);_0x2aff82[_0x4040('0x30')]=_['intersection'](_0x2aff82[_0x4040('0x2e')],_0x2aff82['query']);_0x307c87[_0x4040('0x33')]=_['intersection'](_0x2aff82[_0x4040('0x2e')],qs[_0x4040('0x32')](_0x2184ae[_0x4040('0x2f')][_0x4040('0x32')]));_0x307c87[_0x4040('0x33')]=_0x307c87['attributes'][_0x4040('0x34')]?_0x307c87[_0x4040('0x33')]:_0x2aff82['model'];if(_0x2184ae[_0x4040('0x2f')][_0x4040('0x3f')]){_0x307c87[_0x4040('0x40')]=[{'all':!![]}];}_0x307c87=_[_0x4040('0x3c')]({},_0x307c87,_0x2184ae[_0x4040('0x47')]);return db[_0x4040('0x3e')][_0x4040('0x48')](_0x307c87)[_0x4040('0x24')](handleEntityNotFound(_0x2e20db,null))[_0x4040('0x24')](respondWithResult(_0x2e20db,null))[_0x4040('0x43')](handleError(_0x2e20db,null));};exports[_0x4040('0x49')]=function(_0x242558,_0x3c3b41){return db[_0x4040('0x3e')][_0x4040('0x49')](_0x242558[_0x4040('0x4a')],{})[_0x4040('0x24')](respondWithResult(_0x3c3b41,0xc9))[_0x4040('0x43')](handleError(_0x3c3b41,null));};exports[_0x4040('0x4b')]=function(_0x3e700e,_0x154304){if(_0x3e700e['body']['id']){delete _0x3e700e[_0x4040('0x4a')]['id'];}return db['ZohoField'][_0x4040('0x48')]({'where':{'id':_0x3e700e[_0x4040('0x45')]['id']}})[_0x4040('0x24')](handleEntityNotFound(_0x154304,null))[_0x4040('0x24')](saveUpdates(_0x3e700e['body'],null))[_0x4040('0x24')](respondWithResult(_0x154304,null))[_0x4040('0x43')](handleError(_0x154304,null));};exports[_0x4040('0x25')]=function(_0x4501dd,_0x4c3d4f){return db['ZohoField'][_0x4040('0x48')]({'where':{'id':_0x4501dd[_0x4040('0x45')]['id']}})[_0x4040('0x24')](handleEntityNotFound(_0x4c3d4f,null))[_0x4040('0x24')](removeEntity(_0x4c3d4f,null))[_0x4040('0x43')](handleError(_0x4c3d4f,null));}; \ No newline at end of file +var _0xa7cb=['send','index','map','ZohoField','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','VIRTUAL','merge','options','where','count','then','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','apply','reject','save','update','destroy','end','stack','name'];(function(_0x216734,_0x6b8be7){var _0x314217=function(_0x2e9a88){while(--_0x2e9a88){_0x216734['push'](_0x216734['shift']());}};_0x314217(++_0x6b8be7);}(_0xa7cb,0x1a7));var _0xba7c=function(_0x34986b,_0x56fb4a){_0x34986b=_0x34986b-0x0;var _0x28a0d1=_0xa7cb[_0x34986b];return _0x28a0d1;};'use strict';var emlformat=require(_0xba7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba7c('0x1'));var jsonpatch=require(_0xba7c('0x2'));var rp=require(_0xba7c('0x3'));var moment=require(_0xba7c('0x4'));var BPromise=require(_0xba7c('0x5'));var Mustache=require(_0xba7c('0x6'));var util=require(_0xba7c('0x7'));var path=require(_0xba7c('0x8'));var sox=require(_0xba7c('0x9'));var csv=require('to-csv');var ejs=require(_0xba7c('0xa'));var fs=require('fs');var fs_extra=require(_0xba7c('0xb'));var _=require(_0xba7c('0xc'));var squel=require(_0xba7c('0xd'));var crypto=require(_0xba7c('0xe'));var jsforce=require(_0xba7c('0xf'));var deskjs=require(_0xba7c('0x10'));var toCsv=require(_0xba7c('0x11'));var querystring=require(_0xba7c('0x12'));var Papa=require(_0xba7c('0x13'));var Redis=require('ioredis');var authService=require(_0xba7c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xba7c('0x15'));var hardwareService=require(_0xba7c('0x16'));var logger=require(_0xba7c('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xba7c('0x18'));var licenseUtil=require(_0xba7c('0x19'));var db=require(_0xba7c('0x1a'))['db'];function respondWithStatusCode(_0x2ff422,_0x41be4d){_0x41be4d=_0x41be4d||0xcc;return function(_0x246a76){if(_0x246a76){return _0x2ff422[_0xba7c('0x1b')](_0x41be4d);}return _0x2ff422[_0xba7c('0x1c')](_0x41be4d)['end']();};}function respondWithResult(_0x57f712,_0x20c28e){_0x20c28e=_0x20c28e||0xc8;return function(_0x3b8c69){if(_0x3b8c69){return _0x57f712['status'](_0x20c28e)[_0xba7c('0x1d')](_0x3b8c69);}};}function respondWithFilteredResult(_0x432b43,_0x5c801c){return function(_0x5d0b6e){if(_0x5d0b6e){var _0x3f32f7=typeof _0x5c801c['offset']==='undefined'&&typeof _0x5c801c['limit']==='undefined';var _0x50f16b=_0x5d0b6e['count'];var _0x16fe3d=_0x3f32f7?0x0:_0x5c801c['offset'];var _0x1e86a3=_0x3f32f7?_0x5d0b6e['count']:_0x5c801c['offset']+_0x5c801c[_0xba7c('0x1e')];var _0xa8da69;if(_0x1e86a3>=_0x50f16b){_0x1e86a3=_0x50f16b;_0xa8da69=0xc8;}else{_0xa8da69=0xce;}_0x432b43[_0xba7c('0x1c')](_0xa8da69);return _0x432b43['set']('Content-Range',_0x16fe3d+'-'+_0x1e86a3+'/'+_0x50f16b)['json'](_0x5d0b6e);}return null;};}function patchUpdates(_0x4616df){return function(_0x4b70f6){try{jsonpatch[_0xba7c('0x1f')](_0x4b70f6,_0x4616df,!![]);}catch(_0x3fe292){return BPromise[_0xba7c('0x20')](_0x3fe292);}return _0x4b70f6[_0xba7c('0x21')]();};}function saveUpdates(_0x533d1e,_0x55933d){return function(_0x2d888a){if(_0x2d888a){return _0x2d888a[_0xba7c('0x22')](_0x533d1e)['then'](function(_0x318bf0){return _0x318bf0;});}return null;};}function removeEntity(_0x55a6b2,_0x48cc12){return function(_0x422322){if(_0x422322){return _0x422322[_0xba7c('0x23')]()['then'](function(){_0x55a6b2[_0xba7c('0x1c')](0xcc)[_0xba7c('0x24')]();});}};}function handleEntityNotFound(_0x53e811,_0x3b9fcc){return function(_0x130836){if(!_0x130836){_0x53e811[_0xba7c('0x1b')](0x194);}return _0x130836;};}function handleError(_0x8dfd50,_0x1d5222){_0x1d5222=_0x1d5222||0x1f4;return function(_0x6aa6f8){logger['error'](_0x6aa6f8[_0xba7c('0x25')]);if(_0x6aa6f8[_0xba7c('0x26')]){delete _0x6aa6f8[_0xba7c('0x26')];}_0x8dfd50[_0xba7c('0x1c')](_0x1d5222)[_0xba7c('0x27')](_0x6aa6f8);};}exports[_0xba7c('0x28')]=function(_0x207aed,_0x1eb009){var _0xbdd54e={},_0x4e375e={},_0x493dbe={'count':0x0,'rows':[]};var _0x5bba84=_[_0xba7c('0x29')](db[_0xba7c('0x2a')][_0xba7c('0x2b')],function(_0x75be10){return{'name':_0x75be10['fieldName'],'type':_0x75be10[_0xba7c('0x2c')][_0xba7c('0x2d')]};});_0x4e375e[_0xba7c('0x2e')]=_[_0xba7c('0x29')](_0x5bba84,_0xba7c('0x26'));_0x4e375e['query']=_[_0xba7c('0x2f')](_0x207aed['query']);_0x4e375e[_0xba7c('0x30')]=_[_0xba7c('0x31')](_0x4e375e[_0xba7c('0x2e')],_0x4e375e[_0xba7c('0x32')]);_0xbdd54e['attributes']=_['intersection'](_0x4e375e[_0xba7c('0x2e')],qs[_0xba7c('0x33')](_0x207aed[_0xba7c('0x32')]['fields']));_0xbdd54e['attributes']=_0xbdd54e[_0xba7c('0x34')][_0xba7c('0x35')]?_0xbdd54e[_0xba7c('0x34')]:_0x4e375e[_0xba7c('0x2e')];if(!_0x207aed[_0xba7c('0x32')][_0xba7c('0x36')](_0xba7c('0x37'))){_0xbdd54e['limit']=qs[_0xba7c('0x1e')](_0x207aed['query'][_0xba7c('0x1e')]);_0xbdd54e[_0xba7c('0x38')]=qs['offset'](_0x207aed[_0xba7c('0x32')][_0xba7c('0x38')]);}_0xbdd54e[_0xba7c('0x39')]=qs[_0xba7c('0x3a')](_0x207aed['query'][_0xba7c('0x3a')]);_0xbdd54e['where']=qs['filters'](_[_0xba7c('0x3b')](_0x207aed[_0xba7c('0x32')],_0x4e375e[_0xba7c('0x30')]),_0x5bba84);if(_0x207aed['query'][_0xba7c('0x3c')]){_0xbdd54e['where']=_['merge'](_0xbdd54e['where'],{'$or':_[_0xba7c('0x29')](_0x5bba84,function(_0x186d55){if(_0x186d55['type']!==_0xba7c('0x3d')){var _0x2a6e22={};_0x2a6e22[_0x186d55[_0xba7c('0x26')]]={'$like':'%'+_0x207aed[_0xba7c('0x32')][_0xba7c('0x3c')]+'%'};return _0x2a6e22;}})});}_0xbdd54e=_[_0xba7c('0x3e')]({},_0xbdd54e,_0x207aed[_0xba7c('0x3f')]);var _0x8e07a8={'where':_0xbdd54e[_0xba7c('0x40')]};return db[_0xba7c('0x2a')][_0xba7c('0x41')](_0x8e07a8)[_0xba7c('0x42')](function(_0x3e472d){_0x493dbe[_0xba7c('0x41')]=_0x3e472d;if(_0x207aed[_0xba7c('0x32')][_0xba7c('0x43')]){_0xbdd54e[_0xba7c('0x44')]=[{'all':!![]}];}return db[_0xba7c('0x2a')][_0xba7c('0x45')](_0xbdd54e);})[_0xba7c('0x42')](function(_0x334fd7){_0x493dbe[_0xba7c('0x46')]=_0x334fd7;return _0x493dbe;})[_0xba7c('0x42')](respondWithFilteredResult(_0x1eb009,_0xbdd54e))['catch'](handleError(_0x1eb009,null));};exports[_0xba7c('0x47')]=function(_0x482e90,_0x2e9b3c){var _0x19e02b={'raw':!![],'where':{'id':_0x482e90[_0xba7c('0x48')]['id']}},_0x536e39={};_0x536e39[_0xba7c('0x2e')]=_[_0xba7c('0x2f')](db[_0xba7c('0x2a')]['rawAttributes']);_0x536e39[_0xba7c('0x32')]=_[_0xba7c('0x2f')](_0x482e90['query']);_0x536e39[_0xba7c('0x30')]=_[_0xba7c('0x31')](_0x536e39[_0xba7c('0x2e')],_0x536e39['query']);_0x19e02b[_0xba7c('0x34')]=_[_0xba7c('0x31')](_0x536e39[_0xba7c('0x2e')],qs['fields'](_0x482e90[_0xba7c('0x32')][_0xba7c('0x33')]));_0x19e02b[_0xba7c('0x34')]=_0x19e02b[_0xba7c('0x34')][_0xba7c('0x35')]?_0x19e02b[_0xba7c('0x34')]:_0x536e39['model'];if(_0x482e90['query'][_0xba7c('0x43')]){_0x19e02b[_0xba7c('0x44')]=[{'all':!![]}];}_0x19e02b=_[_0xba7c('0x3e')]({},_0x19e02b,_0x482e90[_0xba7c('0x3f')]);return db['ZohoField']['find'](_0x19e02b)['then'](handleEntityNotFound(_0x2e9b3c,null))[_0xba7c('0x42')](respondWithResult(_0x2e9b3c,null))[_0xba7c('0x49')](handleError(_0x2e9b3c,null));};exports[_0xba7c('0x4a')]=function(_0x4c0d7a,_0x3007c8){return db[_0xba7c('0x2a')]['create'](_0x4c0d7a[_0xba7c('0x4b')],{})[_0xba7c('0x42')](respondWithResult(_0x3007c8,0xc9))[_0xba7c('0x49')](handleError(_0x3007c8,null));};exports['update']=function(_0xb45124,_0x1f5079){if(_0xb45124[_0xba7c('0x4b')]['id']){delete _0xb45124[_0xba7c('0x4b')]['id'];}return db[_0xba7c('0x2a')][_0xba7c('0x4c')]({'where':{'id':_0xb45124[_0xba7c('0x48')]['id']}})[_0xba7c('0x42')](handleEntityNotFound(_0x1f5079,null))['then'](saveUpdates(_0xb45124[_0xba7c('0x4b')],null))[_0xba7c('0x42')](respondWithResult(_0x1f5079,null))[_0xba7c('0x49')](handleError(_0x1f5079,null));};exports['destroy']=function(_0x26d1e9,_0x3ddbbf){return db[_0xba7c('0x2a')][_0xba7c('0x4c')]({'where':{'id':_0x26d1e9['params']['id']}})[_0xba7c('0x42')](handleEntityNotFound(_0x3ddbbf,null))[_0xba7c('0x42')](removeEntity(_0x3ddbbf,null))[_0xba7c('0x49')](handleError(_0x3ddbbf,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index d8a1efb..d80a032 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 _0x0120=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2a50f7,_0x4c5ed1){var _0x5123ec=function(_0x552d41){while(--_0x552d41){_0x2a50f7['push'](_0x2a50f7['shift']());}};_0x5123ec(++_0x4c5ed1);}(_0x0120,0x6f));var _0x0012=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0120[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['moment','bluebird','request-promise','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0xdb494d,_0x28b7b4){var _0xa9c1bd=function(_0xaeca9c){while(--_0xaeca9c){_0xdb494d['push'](_0xdb494d['shift']());}};_0xa9c1bd(++_0x28b7b4);}(_0x82c4,0x1ca));var _0x482c=function(_0x183e5e,_0x5d178e){_0x183e5e=_0x183e5e-0x0;var _0x25d3a4=_0x82c4[_0x183e5e];return _0x25d3a4;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[{'name':_0x482c('0xc'),'fields':[_0x482c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index b13f19c..445a59e 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 _0x43a0=['then','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43a0,0x131));var _0x043a=function(_0x252b8a,_0x17c5ad){_0x252b8a=_0x252b8a-0x0;var _0x1a964d=_0x43a0[_0x252b8a];return _0x1a964d;};'use strict';var _=require(_0x043a('0x0'));var util=require(_0x043a('0x1'));var moment=require(_0x043a('0x2'));var BPromise=require('bluebird');var rs=require(_0x043a('0x3'));var fs=require('fs');var Redis=require(_0x043a('0x4'));var db=require(_0x043a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x043a('0x6'))('rpc');var config=require(_0x043a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x043a('0x8')][_0x043a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x437f39,_0x33b36a,_0x3f489a){return new BPromise(function(_0x31032d,_0x394c61){return client['request'](_0x437f39,_0x3f489a)[_0x043a('0xa')](function(_0x73e443){logger['info'](_0x043a('0xb'),_0x33b36a,'request\x20sent');logger[_0x043a('0xc')](_0x043a('0xd'),_0x33b36a,_0x043a('0xe'),JSON[_0x043a('0xf')](_0x73e443));if(_0x73e443[_0x043a('0x10')]){if(_0x73e443[_0x043a('0x10')][_0x043a('0x11')]===0x1f4){logger[_0x043a('0x10')](_0x043a('0xb'),_0x33b36a,_0x73e443[_0x043a('0x10')][_0x043a('0x12')]);return _0x394c61(_0x73e443[_0x043a('0x10')]['message']);}logger[_0x043a('0x10')](_0x043a('0xb'),_0x33b36a,_0x73e443['error'][_0x043a('0x12')]);return _0x31032d(_0x73e443[_0x043a('0x10')][_0x043a('0x12')]);}else{logger['info'](_0x043a('0xb'),_0x33b36a,'request\x20sent');_0x31032d(_0x73e443[_0x043a('0x13')]['message']);}})[_0x043a('0x14')](function(_0x5557ce){logger[_0x043a('0x10')](_0x043a('0xb'),_0x33b36a,_0x5557ce);_0x394c61(_0x5557ce);});});} \ No newline at end of file +var _0x2568=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x50ed28,_0x2d80f8){var _0x3849f6=function(_0x30026a){while(--_0x30026a){_0x50ed28['push'](_0x50ed28['shift']());}};_0x3849f6(++_0x2d80f8);}(_0x2568,0x71));var _0x8256=function(_0x53a56e,_0x1197dd){_0x53a56e=_0x53a56e-0x0;var _0x4c8ad8=_0x2568[_0x53a56e];return _0x4c8ad8;};'use strict';var _=require('lodash');var util=require(_0x8256('0x0'));var moment=require(_0x8256('0x1'));var BPromise=require(_0x8256('0x2'));var rs=require(_0x8256('0x3'));var fs=require('fs');var Redis=require(_0x8256('0x4'));var db=require(_0x8256('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8256('0x6'))('rpc');var config=require(_0x8256('0x7'));var jayson=require(_0x8256('0x8'));var client=jayson[_0x8256('0x9')][_0x8256('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4eb97d,_0x267fe7,_0x3eb462){return new BPromise(function(_0x3d1866,_0x68c8de){return client[_0x8256('0xb')](_0x4eb97d,_0x3eb462)[_0x8256('0xc')](function(_0x35df7d){logger[_0x8256('0xd')](_0x8256('0xe'),_0x267fe7,'request\x20sent');logger[_0x8256('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x267fe7,_0x8256('0x10'),JSON[_0x8256('0x11')](_0x35df7d));if(_0x35df7d[_0x8256('0x12')]){if(_0x35df7d[_0x8256('0x12')][_0x8256('0x13')]===0x1f4){logger[_0x8256('0x12')](_0x8256('0xe'),_0x267fe7,_0x35df7d[_0x8256('0x12')]['message']);return _0x68c8de(_0x35df7d[_0x8256('0x12')][_0x8256('0x14')]);}logger[_0x8256('0x12')](_0x8256('0xe'),_0x267fe7,_0x35df7d[_0x8256('0x12')][_0x8256('0x14')]);return _0x3d1866(_0x35df7d['error'][_0x8256('0x14')]);}else{logger['info'](_0x8256('0xe'),_0x267fe7,_0x8256('0x10'));_0x3d1866(_0x35df7d[_0x8256('0x15')][_0x8256('0x14')]);}})[_0x8256('0x16')](function(_0x14a7ed){logger[_0x8256('0x12')](_0x8256('0xe'),_0x267fe7,_0x14a7ed);_0x68c8de(_0x14a7ed);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c282be5..f9ef805 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5625a3,_0x2b81dd){var _0x376e8e=function(_0x4b756b){while(--_0x4b756b){_0x5625a3['push'](_0x5625a3['shift']());}};_0x376e8e(++_0x2b81dd);}(_0x70e0,0x17b));var _0x070e=function(_0x4e5691,_0x15e31e){_0x4e5691=_0x4e5691-0x0;var _0x2cfbc4=_0x70e0[_0x4e5691];return _0x2cfbc4;};'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(_0x28ef47,_0x16cfbc){var _0x16de93=function(_0x33fe2a){while(--_0x33fe2a){_0x28ef47['push'](_0x28ef47['shift']());}};_0x16de93(++_0x16cfbc);}(_0xe706,0xa3));var _0x6e70=function(_0x11fcba,_0x46ac13){_0x11fcba=_0x11fcba-0x0;var _0x2c792a=_0xe706[_0x11fcba];return _0x2c792a;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index be1994a..ca2979b 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 _0xb251=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x59c8c4,_0x427631){var _0x37b7fc=function(_0x5795bd){while(--_0x5795bd){_0x59c8c4['push'](_0x59c8c4['shift']());}};_0x37b7fc(++_0x427631);}(_0xb251,0x15a));var _0x1b25=function(_0x35ad67,_0x2731d2){_0x35ad67=_0x35ad67-0x0;var _0x32bf7a=_0xb251[_0x35ad67];return _0x32bf7a;};'use strict';var Sequelize=require(_0x1b25('0x0'));module[_0x1b25('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1b25('0x2')},'version':{'type':Sequelize[_0x1b25('0x3')],'allowNull':![],'unique':_0x1b25('0x2')},'main':{'type':Sequelize[_0x1b25('0x3')],'defaultValue':_0x1b25('0x4')},'filename':{'type':Sequelize[_0x1b25('0x3')]},'path':{'type':Sequelize[_0x1b25('0x3')]},'type':{'type':Sequelize[_0x1b25('0x3')]},'size':{'type':Sequelize[_0x1b25('0x5')]},'active':{'type':Sequelize[_0x1b25('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x1b25('0x3')]},'state':{'type':Sequelize['STRING'],'unique':_0x1b25('0x7')},'description':{'type':Sequelize[_0x1b25('0x3')]},'title':{'type':Sequelize[_0x1b25('0x3')]},'remoteUri':{'type':Sequelize[_0x1b25('0x3')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xdb3e=['INTEGER','BOOLEAN','exports','unique_name_and_version','STRING','app.js'];(function(_0x290fc9,_0x3069fe){var _0x31c8bd=function(_0x4bec21){while(--_0x4bec21){_0x290fc9['push'](_0x290fc9['shift']());}};_0x31c8bd(++_0x3069fe);}(_0xdb3e,0x1e2));var _0xedb3=function(_0x54772c,_0x4b90c7){_0x54772c=_0x54772c-0x0;var _0x8f15da=_0xdb3e[_0x54772c];return _0x8f15da;};'use strict';var Sequelize=require('sequelize');module[_0xedb3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xedb3('0x1')},'version':{'type':Sequelize[_0xedb3('0x2')],'allowNull':![],'unique':_0xedb3('0x1')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xedb3('0x3')},'filename':{'type':Sequelize[_0xedb3('0x2')]},'path':{'type':Sequelize[_0xedb3('0x2')]},'type':{'type':Sequelize[_0xedb3('0x2')]},'size':{'type':Sequelize[_0xedb3('0x4')]},'active':{'type':Sequelize[_0xedb3('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xedb3('0x2')]},'logo':{'type':Sequelize[_0xedb3('0x2')]},'state':{'type':Sequelize[_0xedb3('0x2')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xedb3('0x2')]},'remoteUri':{'type':Sequelize[_0xedb3('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 27cb808..05130d3 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 _0x5c3c=['VIRTUAL','options','Integration','includeAll','include','findAll','rows','params','merge','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type'];(function(_0x36a5c2,_0x1674d5){var _0x4692e9=function(_0x1877e5){while(--_0x1877e5){_0x36a5c2['push'](_0x36a5c2['shift']());}};_0x4692e9(++_0x1674d5);}(_0x5c3c,0x132));var _0xc5c3=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x5c3c[_0x5037ab];return _0x512adb;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['Integration'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['Integration'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['Integration'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['Integration'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));}; \ No newline at end of file +var _0x4991=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','Integration','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x168180,_0x5ad47b){var _0x1856c6=function(_0x492cda){while(--_0x492cda){_0x168180['push'](_0x168180['shift']());}};_0x1856c6(++_0x5ad47b);}(_0x4991,0xf7));var _0x1499=function(_0x5ce455,_0xa62c6c){_0x5ce455=_0x5ce455-0x0;var _0x506ed4=_0x4991[_0x5ce455];return _0x506ed4;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['Integration'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 61b5b44..c810358 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 _0x4336=['lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','Integration'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4336,0x14d));var _0x6433=function(_0xed2df4,_0x2766e3){_0xed2df4=_0xed2df4-0x0;var _0x30bab6=_0x4336[_0xed2df4];return _0x30bab6;};'use strict';var _=require(_0x6433('0x0'));var util=require('util');var logger=require(_0x6433('0x1'))('api');var moment=require(_0x6433('0x2'));var BPromise=require(_0x6433('0x3'));var rp=require(_0x6433('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6433('0x5'));var attributes=require('./integration.attributes');module[_0x6433('0x6')]=function(_0x21910a,_0xf4bbb2){return _0x21910a[_0x6433('0x7')](_0x6433('0x8'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06cf=['path','rimraf','./integration.attributes','define','Integration','integrations','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06cf,0x1be));var _0xf06c=function(_0x3f2155,_0x30d455){_0x3f2155=_0x3f2155-0x0;var _0x3cd605=_0x06cf[_0x3f2155];return _0x3cd605;};'use strict';var _=require(_0xf06c('0x0'));var util=require('util');var logger=require(_0xf06c('0x1'))(_0xf06c('0x2'));var moment=require('moment');var BPromise=require(_0xf06c('0x3'));var rp=require(_0xf06c('0x4'));var fs=require('fs');var path=require(_0xf06c('0x5'));var rimraf=require(_0xf06c('0x6'));var config=require('../../config/environment');var attributes=require(_0xf06c('0x7'));module['exports']=function(_0x3eda15,_0xa21b58){return _0x3eda15[_0xf06c('0x8')](_0xf06c('0x9'),attributes,{'tableName':_0xf06c('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 2094116..6f99b26 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 _0x955f=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x52dfa5,_0x3908fd){var _0x1eaf0b=function(_0x1d01c7){while(--_0x1d01c7){_0x52dfa5['push'](_0x52dfa5['shift']());}};_0x1eaf0b(++_0x3908fd);}(_0x955f,0x1eb));var _0xf955=function(_0x423214,_0x2e7812){_0x423214=_0x423214-0x0;var _0x122198=_0x955f[_0x423214];return _0x122198;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('Integration,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x442ccd,_0x415d61){var _0x1a2c10=function(_0x4ddd45){while(--_0x4ddd45){_0x442ccd['push'](_0x442ccd['shift']());}};_0x1a2c10(++_0x415d61);}(_0x2ef3,0xba));var _0x32ef=function(_0x52ddca,_0xbb1e80){_0x52ddca=_0x52ddca-0x0;var _0x2a1179=_0x2ef3[_0x52ddca];return _0x2a1179;};'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')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 4393aab..a588691 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 _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xda2d,0x102));var _0xdda2=function(_0x1efd56,_0x8d20f6){_0x1efd56=_0x1efd56-0x0;var _0x4270b5=_0xda2d[_0x1efd56];return _0x4270b5;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xdb28,0x106));var _0x8db2=function(_0x352f3b,_0x36719b){_0x352f3b=_0x352f3b-0x0;var _0x420774=_0xdb28[_0x352f3b];return _0x420774;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 686c20f..bbd4886 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 _0xf4f7=['BOOLEAN','TEXT','ENUM','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3a723e,_0x59d99a){var _0x3e9c03=function(_0x4a6947){while(--_0x4a6947){_0x3a723e['push'](_0x3a723e['shift']());}};_0x3e9c03(++_0x59d99a);}(_0xf4f7,0x14f));var _0x7f4f=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0xf4f7[_0x4cfa2e];return _0x279b50;};'use strict';var Sequelize=require(_0x7f4f('0x0'));module[_0x7f4f('0x1')]={'integration':{'type':Sequelize[_0x7f4f('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x7f4f('0x2')]},'ticketId':{'type':Sequelize[_0x7f4f('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x7f4f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7f4f('0x2')]},'calleridname':{'type':Sequelize[_0x7f4f('0x2')]},'queue':{'type':Sequelize[_0x7f4f('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7f4f('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7f4f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7f4f('0x3')]},'holdtime':{'type':Sequelize[_0x7f4f('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x7f4f('0x4')]},'agentacw':{'type':Sequelize[_0x7f4f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7f4f('0x4')]},'reason':{'type':Sequelize[_0x7f4f('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7f4f('0x3')]},'agentdump':{'type':Sequelize[_0x7f4f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x7f4f('0x2')]},'channel':{'type':Sequelize[_0x7f4f('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7f4f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7f4f('0x2')]},'connectedlinename':{'type':Sequelize[_0x7f4f('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7f4f('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7f4f('0x2')]},'destchannelstate':{'type':Sequelize[_0x7f4f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x7f4f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7f4f('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7f4f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7f4f('0x2')]},'destlanguage':{'type':Sequelize[_0x7f4f('0x2')]},'destaccountcode':{'type':Sequelize[_0x7f4f('0x2')]},'destcontext':{'type':Sequelize[_0x7f4f('0x2')]},'destexten':{'type':Sequelize[_0x7f4f('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x7f4f('0x2')]},'inReplyTo':{'type':Sequelize[_0x7f4f('0x2')]},'subject':{'type':Sequelize[_0x7f4f('0x2')]},'from':{'type':Sequelize[_0x7f4f('0x2')]},'to':{'type':Sequelize[_0x7f4f('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x7f4f('0x6')]},'html':{'type':Sequelize[_0x7f4f('0x6')]},'text':{'type':Sequelize[_0x7f4f('0x6')]},'status':{'type':Sequelize[_0x7f4f('0x7')]('SENT','SENDING',_0x7f4f('0x8'),_0x7f4f('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x7f4f('0x2')]},'appdata':{'type':Sequelize[_0x7f4f('0x2')]},'projectId':{'type':Sequelize[_0x7f4f('0x4')]}}; \ No newline at end of file +var _0x9426=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9426,0x1b6));var _0x6942=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9426[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6942('0x0'));module[_0x6942('0x1')]={'integration':{'type':Sequelize[_0x6942('0x2')]},'eventChannel':{'type':Sequelize[_0x6942('0x2')]},'exitStatus':{'type':Sequelize[_0x6942('0x2')]},'ticketId':{'type':Sequelize[_0x6942('0x2')]},'integrationId':{'type':Sequelize[_0x6942('0x3')]},'contacts':{'type':Sequelize[_0x6942('0x2')]},'uniqueid':{'type':Sequelize[_0x6942('0x2')]},'calleridnum':{'type':Sequelize[_0x6942('0x2')]},'calleridname':{'type':Sequelize[_0x6942('0x2')]},'queue':{'type':Sequelize[_0x6942('0x2')]},'interface':{'type':Sequelize[_0x6942('0x2')]},'membername':{'type':Sequelize[_0x6942('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6942('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6942('0x4')]},'holdtime':{'type':Sequelize[_0x6942('0x3')]},'agentcomplete':{'type':Sequelize[_0x6942('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6942('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x6942('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6942('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6942('0x4')]},'agentdump':{'type':Sequelize[_0x6942('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6942('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6942('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6942('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6942('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6942('0x2')]},'context':{'type':Sequelize[_0x6942('0x2')]},'exten':{'type':Sequelize[_0x6942('0x2')]},'priority':{'type':Sequelize[_0x6942('0x2')]},'destchannel':{'type':Sequelize[_0x6942('0x2')]},'destchannelstate':{'type':Sequelize[_0x6942('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6942('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x6942('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6942('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6942('0x2')]},'destaccountcode':{'type':Sequelize[_0x6942('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x6942('0x2')]},'destpriority':{'type':Sequelize[_0x6942('0x2')]},'destuniqueid':{'type':Sequelize[_0x6942('0x2')]},'messageId':{'type':Sequelize[_0x6942('0x2')]},'inReplyTo':{'type':Sequelize[_0x6942('0x2')]},'subject':{'type':Sequelize[_0x6942('0x2')]},'from':{'type':Sequelize[_0x6942('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x6942('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x6942('0x6')]},'status':{'type':Sequelize[_0x6942('0x7')]('SENT',_0x6942('0x8'),_0x6942('0x9'),_0x6942('0xa'))},'url':{'type':Sequelize[_0x6942('0x2')]},'app':{'type':Sequelize[_0x6942('0x2')]},'appdata':{'type':Sequelize[_0x6942('0x2')]},'projectId':{'type':Sequelize[_0x6942('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 4bc2395..da300a2 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 _0xf92a=['map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','error','name','send','index'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf92a,0xbb));var _0xaf92=function(_0xbe5564,_0x18b61a){_0xbe5564=_0xbe5564-0x0;var _0x507f83=_0xf92a[_0xbe5564];return _0x507f83;};'use strict';var emlformat=require(_0xaf92('0x0'));var rimraf=require(_0xaf92('0x1'));var zipdir=require(_0xaf92('0x2'));var jsonpatch=require(_0xaf92('0x3'));var rp=require(_0xaf92('0x4'));var moment=require(_0xaf92('0x5'));var BPromise=require(_0xaf92('0x6'));var Mustache=require('mustache');var util=require(_0xaf92('0x7'));var path=require(_0xaf92('0x8'));var sox=require(_0xaf92('0x9'));var csv=require(_0xaf92('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf92('0xb'));var _=require(_0xaf92('0xc'));var squel=require('squel');var crypto=require(_0xaf92('0xd'));var jsforce=require(_0xaf92('0xe'));var deskjs=require(_0xaf92('0xf'));var toCsv=require(_0xaf92('0xa'));var querystring=require(_0xaf92('0x10'));var Papa=require(_0xaf92('0x11'));var Redis=require(_0xaf92('0x12'));var authService=require(_0xaf92('0x13'));var qs=require(_0xaf92('0x14'));var as=require(_0xaf92('0x15'));var hardwareService=require(_0xaf92('0x16'));var logger=require(_0xaf92('0x17'))(_0xaf92('0x18'));var utils=require(_0xaf92('0x19'));var config=require(_0xaf92('0x1a'));var licenseUtil=require(_0xaf92('0x1b'));var db=require(_0xaf92('0x1c'))['db'];function respondWithStatusCode(_0x3af89b,_0x3d67c7){_0x3d67c7=_0x3d67c7||0xcc;return function(_0x1e6e8b){if(_0x1e6e8b){return _0x3af89b[_0xaf92('0x1d')](_0x3d67c7);}return _0x3af89b[_0xaf92('0x1e')](_0x3d67c7)[_0xaf92('0x1f')]();};}function respondWithResult(_0x28abed,_0x421686){_0x421686=_0x421686||0xc8;return function(_0x13d8ea){if(_0x13d8ea){return _0x28abed[_0xaf92('0x1e')](_0x421686)['json'](_0x13d8ea);}};}function respondWithFilteredResult(_0x2566db,_0x1c5e32){return function(_0x20c387){if(_0x20c387){var _0xe9c116=typeof _0x1c5e32[_0xaf92('0x20')]==='undefined'&&typeof _0x1c5e32[_0xaf92('0x21')]===_0xaf92('0x22');var _0x18addc=_0x20c387[_0xaf92('0x23')];var _0x2d844f=_0xe9c116?0x0:_0x1c5e32[_0xaf92('0x20')];var _0x15266d=_0xe9c116?_0x20c387[_0xaf92('0x23')]:_0x1c5e32['offset']+_0x1c5e32[_0xaf92('0x21')];var _0x48e8fd;if(_0x15266d>=_0x18addc){_0x15266d=_0x18addc;_0x48e8fd=0xc8;}else{_0x48e8fd=0xce;}_0x2566db[_0xaf92('0x1e')](_0x48e8fd);return _0x2566db[_0xaf92('0x24')]('Content-Range',_0x2d844f+'-'+_0x15266d+'/'+_0x18addc)[_0xaf92('0x25')](_0x20c387);}return null;};}function patchUpdates(_0x1108ba){return function(_0x540164){try{jsonpatch[_0xaf92('0x26')](_0x540164,_0x1108ba,!![]);}catch(_0x554f10){return BPromise[_0xaf92('0x27')](_0x554f10);}return _0x540164['save']();};}function saveUpdates(_0x1a4377,_0x2ceb45){return function(_0x40b830){if(_0x40b830){return _0x40b830[_0xaf92('0x28')](_0x1a4377)[_0xaf92('0x29')](function(_0x5c2845){return _0x5c2845;});}return null;};}function removeEntity(_0xbfa249,_0x897e64){return function(_0x544ef0){if(_0x544ef0){return _0x544ef0[_0xaf92('0x2a')]()[_0xaf92('0x29')](function(){_0xbfa249[_0xaf92('0x1e')](0xcc)[_0xaf92('0x1f')]();});}};}function handleEntityNotFound(_0x1acd20,_0x1ac0a6){return function(_0x1bceae){if(!_0x1bceae){_0x1acd20[_0xaf92('0x1d')](0x194);}return _0x1bceae;};}function handleError(_0x13583f,_0x5ba71c){_0x5ba71c=_0x5ba71c||0x1f4;return function(_0x407cc0){logger[_0xaf92('0x2b')](_0x407cc0['stack']);if(_0x407cc0[_0xaf92('0x2c')]){delete _0x407cc0[_0xaf92('0x2c')];}_0x13583f[_0xaf92('0x1e')](_0x5ba71c)[_0xaf92('0x2d')](_0x407cc0);};}exports[_0xaf92('0x2e')]=function(_0x3aadfa,_0x55717d){var _0x2175a4={},_0x4e648c={},_0x43fcc6={'count':0x0,'rows':[]};var _0x59ade1=_[_0xaf92('0x2f')](db[_0xaf92('0x30')][_0xaf92('0x31')],function(_0x573300){return{'name':_0x573300[_0xaf92('0x32')],'type':_0x573300[_0xaf92('0x33')][_0xaf92('0x34')]};});_0x4e648c[_0xaf92('0x35')]=_[_0xaf92('0x2f')](_0x59ade1,_0xaf92('0x2c'));_0x4e648c[_0xaf92('0x36')]=_[_0xaf92('0x37')](_0x3aadfa[_0xaf92('0x36')]);_0x4e648c[_0xaf92('0x38')]=_[_0xaf92('0x39')](_0x4e648c[_0xaf92('0x35')],_0x4e648c[_0xaf92('0x36')]);_0x2175a4[_0xaf92('0x3a')]=_[_0xaf92('0x39')](_0x4e648c['model'],qs[_0xaf92('0x3b')](_0x3aadfa[_0xaf92('0x36')]['fields']));_0x2175a4[_0xaf92('0x3a')]=_0x2175a4[_0xaf92('0x3a')][_0xaf92('0x3c')]?_0x2175a4['attributes']:_0x4e648c[_0xaf92('0x35')];if(!_0x3aadfa[_0xaf92('0x36')][_0xaf92('0x3d')]('nolimit')){_0x2175a4[_0xaf92('0x21')]=qs[_0xaf92('0x21')](_0x3aadfa[_0xaf92('0x36')][_0xaf92('0x21')]);_0x2175a4[_0xaf92('0x20')]=qs['offset'](_0x3aadfa[_0xaf92('0x36')][_0xaf92('0x20')]);}_0x2175a4['order']=qs[_0xaf92('0x3e')](_0x3aadfa[_0xaf92('0x36')][_0xaf92('0x3e')]);_0x2175a4[_0xaf92('0x3f')]=qs[_0xaf92('0x38')](_[_0xaf92('0x40')](_0x3aadfa[_0xaf92('0x36')],_0x4e648c[_0xaf92('0x38')]),_0x59ade1);if(_0x3aadfa[_0xaf92('0x36')]['filter']){_0x2175a4[_0xaf92('0x3f')]=_['merge'](_0x2175a4[_0xaf92('0x3f')],{'$or':_[_0xaf92('0x2f')](_0x59ade1,function(_0x2984e0){if(_0x2984e0['type']!=='VIRTUAL'){var _0x369f4c={};_0x369f4c[_0x2984e0['name']]={'$like':'%'+_0x3aadfa[_0xaf92('0x36')][_0xaf92('0x41')]+'%'};return _0x369f4c;}})});}_0x2175a4=_['merge']({},_0x2175a4,_0x3aadfa['options']);var _0x24fa89={'where':_0x2175a4[_0xaf92('0x3f')]};return db[_0xaf92('0x30')]['count'](_0x24fa89)[_0xaf92('0x29')](function(_0x4d64e1){_0x43fcc6[_0xaf92('0x23')]=_0x4d64e1;if(_0x3aadfa[_0xaf92('0x36')][_0xaf92('0x42')]){_0x2175a4[_0xaf92('0x43')]=[{'all':!![]}];}return db[_0xaf92('0x30')][_0xaf92('0x44')](_0x2175a4);})[_0xaf92('0x29')](function(_0x3d0e3b){_0x43fcc6[_0xaf92('0x45')]=_0x3d0e3b;return _0x43fcc6;})[_0xaf92('0x29')](respondWithFilteredResult(_0x55717d,_0x2175a4))[_0xaf92('0x46')](handleError(_0x55717d,null));};exports[_0xaf92('0x47')]=function(_0x1253b8,_0x2eafbc){var _0x273b8d={'raw':![],'where':{'id':_0x1253b8[_0xaf92('0x48')]['id']}},_0x51d989={};_0x51d989[_0xaf92('0x35')]=_[_0xaf92('0x37')](db[_0xaf92('0x30')][_0xaf92('0x31')]);_0x51d989[_0xaf92('0x36')]=_[_0xaf92('0x37')](_0x1253b8['query']);_0x51d989['filters']=_[_0xaf92('0x39')](_0x51d989[_0xaf92('0x35')],_0x51d989[_0xaf92('0x36')]);_0x273b8d[_0xaf92('0x3a')]=_[_0xaf92('0x39')](_0x51d989['model'],qs[_0xaf92('0x3b')](_0x1253b8['query'][_0xaf92('0x3b')]));_0x273b8d[_0xaf92('0x3a')]=_0x273b8d[_0xaf92('0x3a')][_0xaf92('0x3c')]?_0x273b8d[_0xaf92('0x3a')]:_0x51d989['model'];if(_0x1253b8['query'][_0xaf92('0x42')]){_0x273b8d[_0xaf92('0x43')]=[{'all':!![]}];}_0x273b8d=_[_0xaf92('0x49')]({},_0x273b8d,_0x1253b8['options']);return db['IntegrationReport'][_0xaf92('0x4a')](_0x273b8d)[_0xaf92('0x29')](handleEntityNotFound(_0x2eafbc,null))[_0xaf92('0x29')](respondWithResult(_0x2eafbc,null))['catch'](handleError(_0x2eafbc,null));};exports['create']=function(_0x43d733,_0x228b8a){return db[_0xaf92('0x30')][_0xaf92('0x4b')](_0x43d733['body'],{})[_0xaf92('0x29')](respondWithResult(_0x228b8a,0xc9))[_0xaf92('0x46')](handleError(_0x228b8a,null));};exports['update']=function(_0x94cd60,_0x290313){if(_0x94cd60[_0xaf92('0x4c')]['id']){delete _0x94cd60[_0xaf92('0x4c')]['id'];}return db[_0xaf92('0x30')]['find']({'where':{'id':_0x94cd60['params']['id']}})['then'](handleEntityNotFound(_0x290313,null))[_0xaf92('0x29')](saveUpdates(_0x94cd60['body'],null))[_0xaf92('0x29')](respondWithResult(_0x290313,null))[_0xaf92('0x46')](handleError(_0x290313,null));};exports[_0xaf92('0x2a')]=function(_0x2dd137,_0x867217){return db[_0xaf92('0x30')][_0xaf92('0x4a')]({'where':{'id':_0x2dd137['params']['id']}})[_0xaf92('0x29')](handleEntityNotFound(_0x867217,null))[_0xaf92('0x29')](removeEntity(_0x867217,null))['catch'](handleError(_0x867217,null));};exports[_0xaf92('0x4d')]=function(_0x2c46d9,_0x164551){return db[_0xaf92('0x30')][_0xaf92('0x4d')]()[_0xaf92('0x29')](respondWithResult(_0x164551,null))[_0xaf92('0x46')](handleError(_0x164551,null));}; \ No newline at end of file +var _0x14d5=['rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','IntegrationReport'];(function(_0x3747a3,_0x3f47a0){var _0xe4b645=function(_0x315b12){while(--_0x315b12){_0x3747a3['push'](_0x3747a3['shift']());}};_0xe4b645(++_0x3f47a0);}(_0x14d5,0xb7));var _0x514d=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0x14d5[_0x5951e8];return _0x20a1f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x514d('0x0'));var jsonpatch=require(_0x514d('0x1'));var rp=require(_0x514d('0x2'));var moment=require('moment');var BPromise=require(_0x514d('0x3'));var Mustache=require(_0x514d('0x4'));var util=require(_0x514d('0x5'));var path=require(_0x514d('0x6'));var sox=require(_0x514d('0x7'));var csv=require(_0x514d('0x8'));var ejs=require(_0x514d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x514d('0xa'));var squel=require(_0x514d('0xb'));var crypto=require('crypto');var jsforce=require(_0x514d('0xc'));var deskjs=require(_0x514d('0xd'));var toCsv=require(_0x514d('0x8'));var querystring=require(_0x514d('0xe'));var Papa=require(_0x514d('0xf'));var Redis=require('ioredis');var authService=require(_0x514d('0x10'));var qs=require(_0x514d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x514d('0x12'));var logger=require(_0x514d('0x13'))(_0x514d('0x14'));var utils=require(_0x514d('0x15'));var config=require(_0x514d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x514d('0x17'))['db'];function respondWithStatusCode(_0xf03a30,_0x118908){_0x118908=_0x118908||0xcc;return function(_0xa2cde4){if(_0xa2cde4){return _0xf03a30[_0x514d('0x18')](_0x118908);}return _0xf03a30[_0x514d('0x19')](_0x118908)[_0x514d('0x1a')]();};}function respondWithResult(_0x194780,_0x1a1d09){_0x1a1d09=_0x1a1d09||0xc8;return function(_0x2e4460){if(_0x2e4460){return _0x194780[_0x514d('0x19')](_0x1a1d09)[_0x514d('0x1b')](_0x2e4460);}};}function respondWithFilteredResult(_0xd7a3e1,_0x4f5e72){return function(_0x4ff048){if(_0x4ff048){var _0x286384=typeof _0x4f5e72['offset']==='undefined'&&typeof _0x4f5e72['limit']===_0x514d('0x1c');var _0x35d726=_0x4ff048[_0x514d('0x1d')];var _0x28e4ff=_0x286384?0x0:_0x4f5e72['offset'];var _0x38f901=_0x286384?_0x4ff048[_0x514d('0x1d')]:_0x4f5e72[_0x514d('0x1e')]+_0x4f5e72[_0x514d('0x1f')];var _0x8b37e5;if(_0x38f901>=_0x35d726){_0x38f901=_0x35d726;_0x8b37e5=0xc8;}else{_0x8b37e5=0xce;}_0xd7a3e1[_0x514d('0x19')](_0x8b37e5);return _0xd7a3e1[_0x514d('0x20')](_0x514d('0x21'),_0x28e4ff+'-'+_0x38f901+'/'+_0x35d726)[_0x514d('0x1b')](_0x4ff048);}return null;};}function patchUpdates(_0x4a54ed){return function(_0x259388){try{jsonpatch[_0x514d('0x22')](_0x259388,_0x4a54ed,!![]);}catch(_0x57221a){return BPromise[_0x514d('0x23')](_0x57221a);}return _0x259388['save']();};}function saveUpdates(_0xa2f940,_0x3b7f10){return function(_0xe8fd4e){if(_0xe8fd4e){return _0xe8fd4e[_0x514d('0x24')](_0xa2f940)['then'](function(_0x484301){return _0x484301;});}return null;};}function removeEntity(_0x12b703,_0x309812){return function(_0x513cb0){if(_0x513cb0){return _0x513cb0[_0x514d('0x25')]()[_0x514d('0x26')](function(){_0x12b703['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45bea4,_0x29f9f5){return function(_0x26f501){if(!_0x26f501){_0x45bea4['sendStatus'](0x194);}return _0x26f501;};}function handleError(_0x4b1f73,_0x4bfedf){_0x4bfedf=_0x4bfedf||0x1f4;return function(_0x311a3c){logger[_0x514d('0x27')](_0x311a3c['stack']);if(_0x311a3c[_0x514d('0x28')]){delete _0x311a3c[_0x514d('0x28')];}_0x4b1f73[_0x514d('0x19')](_0x4bfedf)[_0x514d('0x29')](_0x311a3c);};}exports[_0x514d('0x2a')]=function(_0x90aa33,_0x4a0071){var _0x98e1ce={},_0x3a3ea9={},_0x4be596={'count':0x0,'rows':[]};var _0x4597cb=_[_0x514d('0x2b')](db[_0x514d('0x2c')][_0x514d('0x2d')],function(_0x2fedfa){return{'name':_0x2fedfa[_0x514d('0x2e')],'type':_0x2fedfa[_0x514d('0x2f')]['key']};});_0x3a3ea9['model']=_[_0x514d('0x2b')](_0x4597cb,_0x514d('0x28'));_0x3a3ea9['query']=_[_0x514d('0x30')](_0x90aa33[_0x514d('0x31')]);_0x3a3ea9[_0x514d('0x32')]=_[_0x514d('0x33')](_0x3a3ea9['model'],_0x3a3ea9[_0x514d('0x31')]);_0x98e1ce[_0x514d('0x34')]=_[_0x514d('0x33')](_0x3a3ea9[_0x514d('0x35')],qs['fields'](_0x90aa33[_0x514d('0x31')][_0x514d('0x36')]));_0x98e1ce['attributes']=_0x98e1ce[_0x514d('0x34')][_0x514d('0x37')]?_0x98e1ce[_0x514d('0x34')]:_0x3a3ea9[_0x514d('0x35')];if(!_0x90aa33[_0x514d('0x31')][_0x514d('0x38')](_0x514d('0x39'))){_0x98e1ce[_0x514d('0x1f')]=qs[_0x514d('0x1f')](_0x90aa33['query']['limit']);_0x98e1ce['offset']=qs['offset'](_0x90aa33[_0x514d('0x31')][_0x514d('0x1e')]);}_0x98e1ce[_0x514d('0x3a')]=qs['sort'](_0x90aa33[_0x514d('0x31')][_0x514d('0x3b')]);_0x98e1ce[_0x514d('0x3c')]=qs[_0x514d('0x32')](_[_0x514d('0x3d')](_0x90aa33['query'],_0x3a3ea9[_0x514d('0x32')]),_0x4597cb);if(_0x90aa33[_0x514d('0x31')][_0x514d('0x3e')]){_0x98e1ce[_0x514d('0x3c')]=_[_0x514d('0x3f')](_0x98e1ce[_0x514d('0x3c')],{'$or':_[_0x514d('0x2b')](_0x4597cb,function(_0x496797){if(_0x496797[_0x514d('0x2f')]!==_0x514d('0x40')){var _0xdacb14={};_0xdacb14[_0x496797['name']]={'$like':'%'+_0x90aa33['query'][_0x514d('0x3e')]+'%'};return _0xdacb14;}})});}_0x98e1ce=_[_0x514d('0x3f')]({},_0x98e1ce,_0x90aa33['options']);var _0x31602b={'where':_0x98e1ce[_0x514d('0x3c')]};return db[_0x514d('0x2c')][_0x514d('0x1d')](_0x31602b)['then'](function(_0x26cd1c){_0x4be596[_0x514d('0x1d')]=_0x26cd1c;if(_0x90aa33[_0x514d('0x31')]['includeAll']){_0x98e1ce[_0x514d('0x41')]=[{'all':!![]}];}return db[_0x514d('0x2c')][_0x514d('0x42')](_0x98e1ce);})[_0x514d('0x26')](function(_0x5636c2){_0x4be596['rows']=_0x5636c2;return _0x4be596;})[_0x514d('0x26')](respondWithFilteredResult(_0x4a0071,_0x98e1ce))[_0x514d('0x43')](handleError(_0x4a0071,null));};exports[_0x514d('0x44')]=function(_0x925ea1,_0x100416){var _0x477220={'raw':![],'where':{'id':_0x925ea1[_0x514d('0x45')]['id']}},_0x1dfadf={};_0x1dfadf['model']=_[_0x514d('0x30')](db['IntegrationReport'][_0x514d('0x2d')]);_0x1dfadf[_0x514d('0x31')]=_[_0x514d('0x30')](_0x925ea1[_0x514d('0x31')]);_0x1dfadf[_0x514d('0x32')]=_['intersection'](_0x1dfadf[_0x514d('0x35')],_0x1dfadf[_0x514d('0x31')]);_0x477220[_0x514d('0x34')]=_[_0x514d('0x33')](_0x1dfadf[_0x514d('0x35')],qs[_0x514d('0x36')](_0x925ea1[_0x514d('0x31')][_0x514d('0x36')]));_0x477220[_0x514d('0x34')]=_0x477220[_0x514d('0x34')][_0x514d('0x37')]?_0x477220[_0x514d('0x34')]:_0x1dfadf[_0x514d('0x35')];if(_0x925ea1[_0x514d('0x31')][_0x514d('0x46')]){_0x477220[_0x514d('0x41')]=[{'all':!![]}];}_0x477220=_[_0x514d('0x3f')]({},_0x477220,_0x925ea1[_0x514d('0x47')]);return db['IntegrationReport'][_0x514d('0x48')](_0x477220)[_0x514d('0x26')](handleEntityNotFound(_0x100416,null))[_0x514d('0x26')](respondWithResult(_0x100416,null))['catch'](handleError(_0x100416,null));};exports[_0x514d('0x49')]=function(_0xd82f20,_0x3b2e6e){return db['IntegrationReport']['create'](_0xd82f20[_0x514d('0x4a')],{})[_0x514d('0x26')](respondWithResult(_0x3b2e6e,0xc9))[_0x514d('0x43')](handleError(_0x3b2e6e,null));};exports[_0x514d('0x24')]=function(_0xf66e04,_0x185f04){if(_0xf66e04['body']['id']){delete _0xf66e04[_0x514d('0x4a')]['id'];}return db['IntegrationReport'][_0x514d('0x48')]({'where':{'id':_0xf66e04[_0x514d('0x45')]['id']}})['then'](handleEntityNotFound(_0x185f04,null))[_0x514d('0x26')](saveUpdates(_0xf66e04[_0x514d('0x4a')],null))['then'](respondWithResult(_0x185f04,null))[_0x514d('0x43')](handleError(_0x185f04,null));};exports['destroy']=function(_0x560dc9,_0x119ab5){return db[_0x514d('0x2c')][_0x514d('0x48')]({'where':{'id':_0x560dc9[_0x514d('0x45')]['id']}})[_0x514d('0x26')](handleEntityNotFound(_0x119ab5,null))[_0x514d('0x26')](removeEntity(_0x119ab5,null))['catch'](handleError(_0x119ab5,null));};exports['describe']=function(_0x4db045,_0x197bf1){return db[_0x514d('0x2c')][_0x514d('0x4b')]()[_0x514d('0x26')](respondWithResult(_0x197bf1,null))[_0x514d('0x43')](handleError(_0x197bf1,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 92d3e96..ed85dbf 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 _0x91aa=['request-promise','rimraf','./integrationReport.attributes','exports','IntegrationReport','util','../../config/logger','api','bluebird'];(function(_0x3f97c8,_0xd81fb7){var _0x4bc2e6=function(_0x2e2bf4){while(--_0x2e2bf4){_0x3f97c8['push'](_0x3f97c8['shift']());}};_0x4bc2e6(++_0xd81fb7);}(_0x91aa,0xa7));var _0xa91a=function(_0x42ebb8,_0x32cf52){_0x42ebb8=_0x42ebb8-0x0;var _0x234d77=_0x91aa[_0x42ebb8];return _0x234d77;};'use strict';var _=require('lodash');var util=require(_0xa91a('0x0'));var logger=require(_0xa91a('0x1'))(_0xa91a('0x2'));var moment=require('moment');var BPromise=require(_0xa91a('0x3'));var rp=require(_0xa91a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa91a('0x5'));var config=require('../../config/environment');var attributes=require(_0xa91a('0x6'));module[_0xa91a('0x7')]=function(_0x370296,_0x3ef097){return _0x370296['define'](_0xa91a('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5db7=['./integrationReport.attributes','exports','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x14a623,_0x3ba271){var _0x5a6b5a=function(_0x5cca40){while(--_0x5cca40){_0x14a623['push'](_0x14a623['shift']());}};_0x5a6b5a(++_0x3ba271);}(_0x5db7,0x12e));var _0x75db=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x5db7[_0x3cba93];return _0x4a2991;};'use strict';var _=require(_0x75db('0x0'));var util=require(_0x75db('0x1'));var logger=require(_0x75db('0x2'))(_0x75db('0x3'));var moment=require(_0x75db('0x4'));var BPromise=require(_0x75db('0x5'));var rp=require(_0x75db('0x6'));var fs=require('fs');var path=require(_0x75db('0x7'));var rimraf=require(_0x75db('0x8'));var config=require(_0x75db('0x9'));var attributes=require(_0x75db('0xa'));module[_0x75db('0xb')]=function(_0x5e55ef,_0x3e2101){return _0x5e55ef['define']('IntegrationReport',attributes,{'tableName':_0x75db('0xc'),'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 9dd5339..e064aaa 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x53ec,0x192));var _0xc53e=function(_0x53174f,_0x986a3b){_0x53174f=_0x53174f-0x0;var _0x1cbd1c=_0x53ec[_0x53174f];return _0x1cbd1c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x687b,0x14a));var _0xb687=function(_0x15a2cb,_0x571a10){_0x15a2cb=_0x15a2cb-0x0;var _0x26d3f6=_0x687b[_0x15a2cb];return _0x26d3f6;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index e36b14d..0a27735 100644 --- a/server/api/interval/index.js +++ b/server/api/interval/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7412=['/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','isAuthenticated','index','get','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7412,0x161));var _0x2741=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7412[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0x2741('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2741('0x1'));var express=require('express');var router=express[_0x2741('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./interval.controller');router['get']('/',auth[_0x2741('0x3')](),controller[_0x2741('0x4')]);router[_0x2741('0x5')]('/:id',auth[_0x2741('0x3')](),controller[_0x2741('0x6')]);router[_0x2741('0x5')](_0x2741('0x7'),auth['isAuthenticated'](),controller[_0x2741('0x8')]);router[_0x2741('0x9')]('/',auth[_0x2741('0x3')](),controller[_0x2741('0xa')]);router[_0x2741('0x9')]('/:id/sub_intervals',auth[_0x2741('0x3')](),controller[_0x2741('0xb')]);router[_0x2741('0x9')](_0x2741('0xc'),auth[_0x2741('0x3')](),controller[_0x2741('0xd')]);router[_0x2741('0xe')](_0x2741('0xf'),auth['isAuthenticated'](),controller[_0x2741('0x10')]);router[_0x2741('0x11')](_0x2741('0xf'),auth[_0x2741('0x3')](),controller[_0x2741('0x12')]);module[_0x2741('0x13')]=router; \ No newline at end of file +var _0x115f=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','/:id','show','/:id/sub_intervals','create','post','addInterval','addIntervals','put','update'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x115f,0x76));var _0xf115=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x115f[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xf115('0x0'));var util=require(_0xf115('0x1'));var path=require(_0xf115('0x2'));var timeout=require(_0xf115('0x3'));var express=require(_0xf115('0x4'));var router=express[_0xf115('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf115('0x6'));var config=require(_0xf115('0x7'));var controller=require(_0xf115('0x8'));router['get']('/',auth[_0xf115('0x9')](),controller[_0xf115('0xa')]);router['get'](_0xf115('0xb'),auth['isAuthenticated'](),controller[_0xf115('0xc')]);router['get'](_0xf115('0xd'),auth[_0xf115('0x9')](),controller['getIntervals']);router['post']('/',auth[_0xf115('0x9')](),controller[_0xf115('0xe')]);router[_0xf115('0xf')](_0xf115('0xd'),auth['isAuthenticated'](),controller[_0xf115('0x10')]);router['post']('/:id/sub_intervals/create_many',auth[_0xf115('0x9')](),controller[_0xf115('0x11')]);router[_0xf115('0x12')](_0xf115('0xb'),auth[_0xf115('0x9')](),controller[_0xf115('0x13')]);router[_0xf115('0x14')](_0xf115('0xb'),auth['isAuthenticated'](),controller[_0xf115('0x15')]);module[_0xf115('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index b5ccfc2..19621c1 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 _0x0300=['sequelize','exports','STRING'];(function(_0xc6bf05,_0x335389){var _0x409ce0=function(_0x35c9c2){while(--_0x35c9c2){_0xc6bf05['push'](_0xc6bf05['shift']());}};_0x409ce0(++_0x335389);}(_0x0300,0x180));var _0x0030=function(_0x2c8ef8,_0x23351c){_0x2c8ef8=_0x2c8ef8-0x0;var _0x556882=_0x0300[_0x2c8ef8];return _0x556882;};'use strict';var Sequelize=require(_0x0030('0x0'));module[_0x0030('0x1')]={'name':{'type':Sequelize[_0x0030('0x2')]},'description':{'type':Sequelize[_0x0030('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x0817=['STRING','sequelize'];(function(_0x4da6ba,_0x554ea7){var _0x4b8317=function(_0x573de2){while(--_0x573de2){_0x4da6ba['push'](_0x4da6ba['shift']());}};_0x4b8317(++_0x554ea7);}(_0x0817,0x1e9));var _0x7081=function(_0x1d6c49,_0x1d95e8){_0x1d6c49=_0x1d6c49-0x0;var _0x56010e=_0x0817[_0x1d6c49];return _0x56010e;};'use strict';var Sequelize=require(_0x7081('0x0'));module['exports']={'name':{'type':Sequelize[_0x7081('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7081('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 808f726..66663b3 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 _0x5ec2=['count','limit','set','Content-Range','apply','update','then','destroy','get','Intervals','error','stack','send','index','map','Interval','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','addInterval','IntervalId','findOne','getIntervals','nolimit','addIntervals','sequelize','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined'];(function(_0x1aebfe,_0xb00c5b){var _0x3f0f9b=function(_0x291391){while(--_0x291391){_0x1aebfe['push'](_0x1aebfe['shift']());}};_0x3f0f9b(++_0xb00c5b);}(_0x5ec2,0x1ae));var _0x25ec=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5ec2[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x25ec('0x0'));var rimraf=require(_0x25ec('0x1'));var zipdir=require(_0x25ec('0x2'));var jsonpatch=require(_0x25ec('0x3'));var rp=require(_0x25ec('0x4'));var moment=require(_0x25ec('0x5'));var BPromise=require(_0x25ec('0x6'));var Mustache=require(_0x25ec('0x7'));var util=require(_0x25ec('0x8'));var path=require(_0x25ec('0x9'));var sox=require('sox');var csv=require(_0x25ec('0xa'));var ejs=require(_0x25ec('0xb'));var fs=require('fs');var fs_extra=require(_0x25ec('0xc'));var _=require(_0x25ec('0xd'));var squel=require(_0x25ec('0xe'));var crypto=require(_0x25ec('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x25ec('0x10'));var toCsv=require(_0x25ec('0xa'));var querystring=require(_0x25ec('0x11'));var Papa=require(_0x25ec('0x12'));var Redis=require(_0x25ec('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(_0x25ec('0x14'))('api');var utils=require(_0x25ec('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x25ec('0x16'))['db'];var extensions=require(_0x25ec('0x17'));function respondWithStatusCode(_0x2bc6f0,_0x43ad3c){_0x43ad3c=_0x43ad3c||0xcc;return function(_0x4de86e){if(_0x4de86e){return _0x2bc6f0[_0x25ec('0x18')](_0x43ad3c);}return _0x2bc6f0[_0x25ec('0x19')](_0x43ad3c)[_0x25ec('0x1a')]();};}function respondWithResult(_0xd56d08,_0x45eb28){_0x45eb28=_0x45eb28||0xc8;return function(_0x30f77e){if(_0x30f77e){return _0xd56d08[_0x25ec('0x19')](_0x45eb28)[_0x25ec('0x1b')](_0x30f77e);}};}function respondWithFilteredResult(_0x200b36,_0xb862d7){return function(_0x372053){if(_0x372053){var _0x4af7bc=typeof _0xb862d7[_0x25ec('0x1c')]===_0x25ec('0x1d')&&typeof _0xb862d7['limit']==='undefined';var _0x276660=_0x372053[_0x25ec('0x1e')];var _0x228816=_0x4af7bc?0x0:_0xb862d7['offset'];var _0x184b1d=_0x4af7bc?_0x372053[_0x25ec('0x1e')]:_0xb862d7['offset']+_0xb862d7[_0x25ec('0x1f')];var _0x135975;if(_0x184b1d>=_0x276660){_0x184b1d=_0x276660;_0x135975=0xc8;}else{_0x135975=0xce;}_0x200b36['status'](_0x135975);return _0x200b36[_0x25ec('0x20')](_0x25ec('0x21'),_0x228816+'-'+_0x184b1d+'/'+_0x276660)[_0x25ec('0x1b')](_0x372053);}return null;};}function patchUpdates(_0x3bd12a){return function(_0x5e3ef2){try{jsonpatch[_0x25ec('0x22')](_0x5e3ef2,_0x3bd12a,!![]);}catch(_0x19cf13){return BPromise['reject'](_0x19cf13);}return _0x5e3ef2['save']();};}function saveUpdates(_0x49ebd5,_0x3f7f48){return function(_0x1bf803){if(_0x1bf803){return _0x1bf803[_0x25ec('0x23')](_0x49ebd5)[_0x25ec('0x24')](function(_0x298617){return _0x298617;});}return null;};}function removeEntity(_0x3f9a2b,_0x561974){return function(_0x518829){if(_0x518829){return _0x518829[_0x25ec('0x25')]()[_0x25ec('0x24')](function(){var _0x4b4a3c=_0x518829[_0x25ec('0x26')]({'plain':!![]});var _0x3fe3b1=_0x25ec('0x27');return db['UserProfileResource'][_0x25ec('0x25')]({'where':{'type':_0x3fe3b1,'resourceId':_0x4b4a3c['id']}})[_0x25ec('0x24')](function(){return _0x518829;});})[_0x25ec('0x24')](function(){_0x3f9a2b[_0x25ec('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f713,_0x304213){return function(_0x5c7b1f){if(!_0x5c7b1f){_0x54f713[_0x25ec('0x18')](0x194);}return _0x5c7b1f;};}function handleError(_0x55a7cd,_0x28caf2){_0x28caf2=_0x28caf2||0x1f4;return function(_0x45b307){logger[_0x25ec('0x28')](_0x45b307[_0x25ec('0x29')]);if(_0x45b307['name']){delete _0x45b307['name'];}_0x55a7cd['status'](_0x28caf2)[_0x25ec('0x2a')](_0x45b307);};}exports[_0x25ec('0x2b')]=function(_0x1a5b50,_0x54063f){var _0x240113={},_0x307a80={},_0x302aaf={'count':0x0,'rows':[]};var _0xb75058=_[_0x25ec('0x2c')](db[_0x25ec('0x2d')][_0x25ec('0x2e')],function(_0x5b18e7){return{'name':_0x5b18e7[_0x25ec('0x2f')],'type':_0x5b18e7[_0x25ec('0x30')][_0x25ec('0x31')]};});_0x307a80[_0x25ec('0x32')]=_[_0x25ec('0x2c')](_0xb75058,_0x25ec('0x33'));_0x307a80[_0x25ec('0x34')]=_[_0x25ec('0x35')](_0x1a5b50[_0x25ec('0x34')]);_0x307a80[_0x25ec('0x36')]=_[_0x25ec('0x37')](_0x307a80[_0x25ec('0x32')],_0x307a80['query']);_0x240113['attributes']=_[_0x25ec('0x37')](_0x307a80[_0x25ec('0x32')],qs[_0x25ec('0x38')](_0x1a5b50[_0x25ec('0x34')]['fields']));_0x240113[_0x25ec('0x39')]=_0x240113[_0x25ec('0x39')][_0x25ec('0x3a')]?_0x240113['attributes']:_0x307a80[_0x25ec('0x32')];if(!_0x1a5b50['query'][_0x25ec('0x3b')]('nolimit')){_0x240113['limit']=qs[_0x25ec('0x1f')](_0x1a5b50[_0x25ec('0x34')][_0x25ec('0x1f')]);_0x240113[_0x25ec('0x1c')]=qs['offset'](_0x1a5b50[_0x25ec('0x34')]['offset']);}_0x240113[_0x25ec('0x3c')]=qs[_0x25ec('0x3d')](_0x1a5b50[_0x25ec('0x34')][_0x25ec('0x3d')]);_0x240113[_0x25ec('0x3e')]=qs[_0x25ec('0x36')](_[_0x25ec('0x3f')](_0x1a5b50[_0x25ec('0x34')],_0x307a80[_0x25ec('0x36')]),_0xb75058);if(_0x1a5b50[_0x25ec('0x34')][_0x25ec('0x40')]){_0x240113[_0x25ec('0x3e')]=_[_0x25ec('0x41')](_0x240113[_0x25ec('0x3e')],{'$or':_[_0x25ec('0x2c')](_0xb75058,function(_0x1c8129){if(_0x1c8129['type']!=='VIRTUAL'){var _0x1967e6={};_0x1967e6[_0x1c8129[_0x25ec('0x33')]]={'$like':'%'+_0x1a5b50['query'][_0x25ec('0x40')]+'%'};return _0x1967e6;}})});}_0x240113=_[_0x25ec('0x41')]({},_0x240113,_0x1a5b50[_0x25ec('0x42')]);var _0x20cd99={'where':_0x240113[_0x25ec('0x3e')]};return db[_0x25ec('0x2d')][_0x25ec('0x1e')](_0x20cd99)[_0x25ec('0x24')](function(_0x195686){_0x302aaf[_0x25ec('0x1e')]=_0x195686;if(_0x1a5b50['query'][_0x25ec('0x43')]){_0x240113[_0x25ec('0x44')]=[{'all':!![]}];}return db[_0x25ec('0x2d')]['findAll'](_0x240113);})[_0x25ec('0x24')](function(_0x1a8f19){_0x302aaf[_0x25ec('0x45')]=_0x1a8f19;return _0x302aaf;})[_0x25ec('0x24')](respondWithFilteredResult(_0x54063f,_0x240113))[_0x25ec('0x46')](handleError(_0x54063f,null));};exports[_0x25ec('0x47')]=function(_0xb0d569,_0x414225){var _0x374f42={'raw':!![],'where':{'id':_0xb0d569[_0x25ec('0x48')]['id']}},_0x2744c4={};_0x2744c4[_0x25ec('0x32')]=_[_0x25ec('0x35')](db[_0x25ec('0x2d')]['rawAttributes']);_0x2744c4[_0x25ec('0x34')]=_['keys'](_0xb0d569[_0x25ec('0x34')]);_0x2744c4[_0x25ec('0x36')]=_[_0x25ec('0x37')](_0x2744c4[_0x25ec('0x32')],_0x2744c4[_0x25ec('0x34')]);_0x374f42[_0x25ec('0x39')]=_['intersection'](_0x2744c4[_0x25ec('0x32')],qs[_0x25ec('0x38')](_0xb0d569[_0x25ec('0x34')][_0x25ec('0x38')]));_0x374f42['attributes']=_0x374f42[_0x25ec('0x39')][_0x25ec('0x3a')]?_0x374f42['attributes']:_0x2744c4[_0x25ec('0x32')];if(_0xb0d569['query']['includeAll']){_0x374f42[_0x25ec('0x44')]=[{'all':!![]}];}_0x374f42=_['merge']({},_0x374f42,_0xb0d569['options']);return db[_0x25ec('0x2d')][_0x25ec('0x49')](_0x374f42)['then'](handleEntityNotFound(_0x414225,null))[_0x25ec('0x24')](respondWithResult(_0x414225,null))[_0x25ec('0x46')](handleError(_0x414225,null));};exports[_0x25ec('0x4a')]=function(_0x131502,_0x4fa63d){return db[_0x25ec('0x2d')][_0x25ec('0x4a')](_0x131502['body'],{})[_0x25ec('0x24')](function(_0x315c81){var _0x569e26=_0x131502[_0x25ec('0x4b')][_0x25ec('0x26')]({'plain':!![]});if(!_0x569e26)throw new Error(_0x25ec('0x4c'));if(_0x569e26[_0x25ec('0x4d')]==='user'){var _0x25802e=_0x315c81[_0x25ec('0x26')]({'plain':!![]});var _0x5193a4=_0x25ec('0x27');return db[_0x25ec('0x4e')][_0x25ec('0x49')]({'where':{'name':_0x5193a4,'userProfileId':_0x569e26[_0x25ec('0x4f')]},'raw':!![]})[_0x25ec('0x24')](function(_0x46deb6){if(_0x46deb6&&_0x46deb6[_0x25ec('0x50')]===0x0){return db[_0x25ec('0x51')][_0x25ec('0x4a')]({'name':_0x25802e[_0x25ec('0x33')],'resourceId':_0x25802e['id'],'type':_0x46deb6[_0x25ec('0x33')],'sectionId':_0x46deb6['id']},{})[_0x25ec('0x24')](function(){return _0x315c81;});}else{return _0x315c81;}})[_0x25ec('0x46')](function(_0x5552b7){logger[_0x25ec('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5552b7);throw _0x5552b7;});}return _0x315c81;})['then'](respondWithResult(_0x4fa63d,0xc9))[_0x25ec('0x46')](handleError(_0x4fa63d,null));};exports[_0x25ec('0x23')]=function(_0x3e5543,_0x163748){if(_0x3e5543[_0x25ec('0x52')]['id']){delete _0x3e5543['body']['id'];}return db[_0x25ec('0x2d')][_0x25ec('0x49')]({'where':{'id':_0x3e5543[_0x25ec('0x48')]['id']}})[_0x25ec('0x24')](handleEntityNotFound(_0x163748,null))[_0x25ec('0x24')](saveUpdates(_0x3e5543['body'],null))[_0x25ec('0x24')](respondWithResult(_0x163748,null))[_0x25ec('0x46')](handleError(_0x163748,null));};exports[_0x25ec('0x25')]=function(_0x43a699,_0x507a7f){return db['Interval'][_0x25ec('0x49')]({'where':{'id':_0x43a699[_0x25ec('0x48')]['id']}})['then'](handleEntityNotFound(_0x507a7f,null))[_0x25ec('0x24')](removeEntity(_0x507a7f,null))[_0x25ec('0x46')](handleError(_0x507a7f,null));};exports[_0x25ec('0x53')]=function(_0x5613a9,_0x15b79b,_0x4e8b3b){if(_0x5613a9['body']['id']){delete _0x5613a9['body']['id'];}return db[_0x25ec('0x2d')][_0x25ec('0x49')]({'where':{'id':_0x5613a9[_0x25ec('0x48')]['id']}})['then'](handleEntityNotFound(_0x15b79b,null))['then'](function(_0xa08ed5){if(_0xa08ed5){_0x5613a9[_0x25ec('0x52')][_0x25ec('0x54')]=_0xa08ed5['id'];return db[_0x25ec('0x2d')][_0x25ec('0x4a')](_0x5613a9['body']);}})[_0x25ec('0x24')](respondWithResult(_0x15b79b,null))[_0x25ec('0x46')](handleError(_0x15b79b,null));};exports['getIntervals']=function(_0x189962,_0x237fc1,_0x5a5a9c){var _0x2c797a={};var _0xf9982d={};var _0x1f74fe;var _0x368957;return db[_0x25ec('0x2d')][_0x25ec('0x55')]({'where':{'id':_0x189962['params']['id']}})[_0x25ec('0x24')](handleEntityNotFound(_0x237fc1,null))[_0x25ec('0x24')](function(_0x15e270){if(_0x15e270){_0x1f74fe=_0x15e270;_0xf9982d[_0x25ec('0x32')]=_['keys'](db['Interval'][_0x25ec('0x2e')]);_0xf9982d[_0x25ec('0x34')]=_[_0x25ec('0x35')](_0x189962['query']);_0xf9982d[_0x25ec('0x36')]=_['intersection'](_0xf9982d[_0x25ec('0x32')],_0xf9982d[_0x25ec('0x34')]);_0x2c797a['attributes']=_[_0x25ec('0x37')](_0xf9982d['model'],qs['fields'](_0x189962['query'][_0x25ec('0x38')]));_0x2c797a[_0x25ec('0x39')]=_0x2c797a[_0x25ec('0x39')][_0x25ec('0x3a')]?_0x2c797a[_0x25ec('0x39')]:_0xf9982d['model'];_0x2c797a['order']=qs[_0x25ec('0x3d')](_0x189962[_0x25ec('0x34')][_0x25ec('0x3d')]);_0x2c797a[_0x25ec('0x3e')]=qs['filters'](_[_0x25ec('0x3f')](_0x189962[_0x25ec('0x34')],_0xf9982d[_0x25ec('0x36')]));if(_0x189962['query']['filter']){_0x2c797a[_0x25ec('0x3e')]=_['merge'](_0x2c797a[_0x25ec('0x3e')],{'$or':_[_0x25ec('0x2c')](_0x2c797a[_0x25ec('0x39')],function(_0x5b9f50){var _0x1afc53={};_0x1afc53[_0x5b9f50]={'$like':'%'+_0x189962[_0x25ec('0x34')][_0x25ec('0x40')]+'%'};return _0x1afc53;})});}_0x2c797a=_[_0x25ec('0x41')]({},_0x2c797a,_0x189962['options']);return _0x1f74fe[_0x25ec('0x56')](_0x2c797a);}})[_0x25ec('0x24')](function(_0x30a226){if(_0x30a226){_0x368957=_0x30a226[_0x25ec('0x3a')];if(!_0x189962['query']['hasOwnProperty'](_0x25ec('0x57'))){_0x2c797a[_0x25ec('0x1f')]=qs[_0x25ec('0x1f')](_0x189962[_0x25ec('0x34')][_0x25ec('0x1f')]);_0x2c797a[_0x25ec('0x1c')]=qs['offset'](_0x189962[_0x25ec('0x34')][_0x25ec('0x1c')]);}return _0x1f74fe[_0x25ec('0x56')](_0x2c797a);}})[_0x25ec('0x24')](function(_0x53703e){if(_0x53703e){return _0x53703e?{'count':_0x368957,'rows':_0x53703e}:null;}})[_0x25ec('0x24')](respondWithResult(_0x237fc1,null))['catch'](handleError(_0x237fc1,null));};exports[_0x25ec('0x58')]=function(_0x354aad,_0x3ddb0a,_0xbe1619){return db[_0x25ec('0x2d')][_0x25ec('0x55')]({'where':{'id':_0x354aad[_0x25ec('0x48')]['id']}})[_0x25ec('0x24')](handleEntityNotFound(_0x3ddb0a,null))[_0x25ec('0x24')](function(_0x5dc99f){if(_0x5dc99f){return db[_0x25ec('0x59')]['transaction'](function(_0x300c45){return db[_0x25ec('0x2d')][_0x25ec('0x25')]({'where':{'IntervalId':_0x354aad[_0x25ec('0x48')]['id']},'transaction':_0x300c45})[_0x25ec('0x24')](function(_0x174a49){var _0x34c607=_[_0x25ec('0x2c')](_0x354aad[_0x25ec('0x52')],function(_0x198669){delete _0x198669['id'];_0x198669[_0x25ec('0x54')]=_0x354aad[_0x25ec('0x48')]['id'];return _0x198669;});return db[_0x25ec('0x2d')][_0x25ec('0x5a')](_0x34c607,{'transaction':_0x300c45});});})[_0x25ec('0x24')](function(){return db[_0x25ec('0x2d')][_0x25ec('0x5b')]({'where':{'IntervalId':_0x354aad['params']['id']}});});}})['then'](respondWithResult(_0x3ddb0a,null))[_0x25ec('0x46')](handleError(_0x3ddb0a,null));}; \ No newline at end of file +var _0x4446=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','Intervals','destroy','end','error','stack','name','send','Interval','rawAttributes','map','query','keys','model','attributes','intersection','fields','length','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','order','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','bulkCreate'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0x4446,0xb2));var _0x6444=function(_0x4dff8f,_0x25f6c5){_0x4dff8f=_0x4dff8f-0x0;var _0x51647b=_0x4446[_0x4dff8f];return _0x51647b;};'use strict';var emlformat=require(_0x6444('0x0'));var rimraf=require(_0x6444('0x1'));var zipdir=require(_0x6444('0x2'));var jsonpatch=require(_0x6444('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6444('0x4'));var Mustache=require(_0x6444('0x5'));var util=require(_0x6444('0x6'));var path=require(_0x6444('0x7'));var sox=require(_0x6444('0x8'));var csv=require(_0x6444('0x9'));var ejs=require(_0x6444('0xa'));var fs=require('fs');var fs_extra=require(_0x6444('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6444('0xc'));var jsforce=require(_0x6444('0xd'));var deskjs=require(_0x6444('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6444('0xf'));var Papa=require(_0x6444('0x10'));var Redis=require(_0x6444('0x11'));var authService=require(_0x6444('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6444('0x13'));var logger=require(_0x6444('0x14'))(_0x6444('0x15'));var utils=require(_0x6444('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6444('0x17'))['db'];var extensions=require(_0x6444('0x18'));function respondWithStatusCode(_0x255701,_0x248a68){_0x248a68=_0x248a68||0xcc;return function(_0x266189){if(_0x266189){return _0x255701[_0x6444('0x19')](_0x248a68);}return _0x255701['status'](_0x248a68)['end']();};}function respondWithResult(_0x1ffabf,_0x5ce7cd){_0x5ce7cd=_0x5ce7cd||0xc8;return function(_0x2ebd61){if(_0x2ebd61){return _0x1ffabf[_0x6444('0x1a')](_0x5ce7cd)[_0x6444('0x1b')](_0x2ebd61);}};}function respondWithFilteredResult(_0x389397,_0x4aca8d){return function(_0x206075){if(_0x206075){var _0x264ed6=typeof _0x4aca8d[_0x6444('0x1c')]===_0x6444('0x1d')&&typeof _0x4aca8d['limit']===_0x6444('0x1d');var _0x3f34d4=_0x206075['count'];var _0x1999f5=_0x264ed6?0x0:_0x4aca8d[_0x6444('0x1c')];var _0x123f81=_0x264ed6?_0x206075[_0x6444('0x1e')]:_0x4aca8d['offset']+_0x4aca8d[_0x6444('0x1f')];var _0xedd118;if(_0x123f81>=_0x3f34d4){_0x123f81=_0x3f34d4;_0xedd118=0xc8;}else{_0xedd118=0xce;}_0x389397[_0x6444('0x1a')](_0xedd118);return _0x389397['set'](_0x6444('0x20'),_0x1999f5+'-'+_0x123f81+'/'+_0x3f34d4)[_0x6444('0x1b')](_0x206075);}return null;};}function patchUpdates(_0x94491b){return function(_0x3060ac){try{jsonpatch[_0x6444('0x21')](_0x3060ac,_0x94491b,!![]);}catch(_0x583b1c){return BPromise['reject'](_0x583b1c);}return _0x3060ac[_0x6444('0x22')]();};}function saveUpdates(_0x14dd75,_0x45a098){return function(_0x58b5c7){if(_0x58b5c7){return _0x58b5c7['update'](_0x14dd75)[_0x6444('0x23')](function(_0x4e87de){return _0x4e87de;});}return null;};}function removeEntity(_0x24ddbd,_0x28aca9){return function(_0x155d63){if(_0x155d63){return _0x155d63['destroy']()[_0x6444('0x23')](function(){var _0x18d089=_0x155d63['get']({'plain':!![]});var _0x206671=_0x6444('0x24');return db['UserProfileResource'][_0x6444('0x25')]({'where':{'type':_0x206671,'resourceId':_0x18d089['id']}})['then'](function(){return _0x155d63;});})['then'](function(){_0x24ddbd[_0x6444('0x1a')](0xcc)[_0x6444('0x26')]();});}};}function handleEntityNotFound(_0x30b064,_0x203f85){return function(_0x1f32a7){if(!_0x1f32a7){_0x30b064['sendStatus'](0x194);}return _0x1f32a7;};}function handleError(_0x5a24c5,_0x5f1936){_0x5f1936=_0x5f1936||0x1f4;return function(_0x553870){logger[_0x6444('0x27')](_0x553870[_0x6444('0x28')]);if(_0x553870[_0x6444('0x29')]){delete _0x553870['name'];}_0x5a24c5[_0x6444('0x1a')](_0x5f1936)[_0x6444('0x2a')](_0x553870);};}exports['index']=function(_0xb16ab,_0x358e90){var _0x41404e={},_0x1f4e68={},_0xabf38c={'count':0x0,'rows':[]};var _0x28ab33=_['map'](db[_0x6444('0x2b')][_0x6444('0x2c')],function(_0x513c88){return{'name':_0x513c88['fieldName'],'type':_0x513c88['type']['key']};});_0x1f4e68['model']=_[_0x6444('0x2d')](_0x28ab33,_0x6444('0x29'));_0x1f4e68[_0x6444('0x2e')]=_[_0x6444('0x2f')](_0xb16ab[_0x6444('0x2e')]);_0x1f4e68['filters']=_['intersection'](_0x1f4e68[_0x6444('0x30')],_0x1f4e68[_0x6444('0x2e')]);_0x41404e[_0x6444('0x31')]=_[_0x6444('0x32')](_0x1f4e68['model'],qs[_0x6444('0x33')](_0xb16ab['query'][_0x6444('0x33')]));_0x41404e[_0x6444('0x31')]=_0x41404e['attributes'][_0x6444('0x34')]?_0x41404e[_0x6444('0x31')]:_0x1f4e68[_0x6444('0x30')];if(!_0xb16ab[_0x6444('0x2e')]['hasOwnProperty']('nolimit')){_0x41404e[_0x6444('0x1f')]=qs[_0x6444('0x1f')](_0xb16ab[_0x6444('0x2e')][_0x6444('0x1f')]);_0x41404e['offset']=qs[_0x6444('0x1c')](_0xb16ab[_0x6444('0x2e')]['offset']);}_0x41404e['order']=qs['sort'](_0xb16ab[_0x6444('0x2e')][_0x6444('0x35')]);_0x41404e['where']=qs[_0x6444('0x36')](_[_0x6444('0x37')](_0xb16ab['query'],_0x1f4e68[_0x6444('0x36')]),_0x28ab33);if(_0xb16ab[_0x6444('0x2e')][_0x6444('0x38')]){_0x41404e[_0x6444('0x39')]=_['merge'](_0x41404e[_0x6444('0x39')],{'$or':_[_0x6444('0x2d')](_0x28ab33,function(_0x1fb80e){if(_0x1fb80e[_0x6444('0x3a')]!==_0x6444('0x3b')){var _0x41866d={};_0x41866d[_0x1fb80e['name']]={'$like':'%'+_0xb16ab[_0x6444('0x2e')][_0x6444('0x38')]+'%'};return _0x41866d;}})});}_0x41404e=_[_0x6444('0x3c')]({},_0x41404e,_0xb16ab[_0x6444('0x3d')]);var _0x19ed9e={'where':_0x41404e[_0x6444('0x39')]};return db[_0x6444('0x2b')]['count'](_0x19ed9e)[_0x6444('0x23')](function(_0x3e8374){_0xabf38c[_0x6444('0x1e')]=_0x3e8374;if(_0xb16ab['query'][_0x6444('0x3e')]){_0x41404e[_0x6444('0x3f')]=[{'all':!![]}];}return db[_0x6444('0x2b')]['findAll'](_0x41404e);})[_0x6444('0x23')](function(_0x3e00bd){_0xabf38c[_0x6444('0x40')]=_0x3e00bd;return _0xabf38c;})[_0x6444('0x23')](respondWithFilteredResult(_0x358e90,_0x41404e))[_0x6444('0x41')](handleError(_0x358e90,null));};exports[_0x6444('0x42')]=function(_0x4f087d,_0x474d6f){var _0x43662e={'raw':!![],'where':{'id':_0x4f087d[_0x6444('0x43')]['id']}},_0x1b6f2f={};_0x1b6f2f[_0x6444('0x30')]=_[_0x6444('0x2f')](db['Interval']['rawAttributes']);_0x1b6f2f[_0x6444('0x2e')]=_['keys'](_0x4f087d[_0x6444('0x2e')]);_0x1b6f2f['filters']=_[_0x6444('0x32')](_0x1b6f2f[_0x6444('0x30')],_0x1b6f2f[_0x6444('0x2e')]);_0x43662e[_0x6444('0x31')]=_[_0x6444('0x32')](_0x1b6f2f[_0x6444('0x30')],qs[_0x6444('0x33')](_0x4f087d[_0x6444('0x2e')][_0x6444('0x33')]));_0x43662e['attributes']=_0x43662e[_0x6444('0x31')][_0x6444('0x34')]?_0x43662e[_0x6444('0x31')]:_0x1b6f2f[_0x6444('0x30')];if(_0x4f087d['query'][_0x6444('0x3e')]){_0x43662e[_0x6444('0x3f')]=[{'all':!![]}];}_0x43662e=_[_0x6444('0x3c')]({},_0x43662e,_0x4f087d[_0x6444('0x3d')]);return db[_0x6444('0x2b')][_0x6444('0x44')](_0x43662e)['then'](handleEntityNotFound(_0x474d6f,null))[_0x6444('0x23')](respondWithResult(_0x474d6f,null))['catch'](handleError(_0x474d6f,null));};exports[_0x6444('0x45')]=function(_0xb83236,_0xf255ae){return db[_0x6444('0x2b')]['create'](_0xb83236[_0x6444('0x46')],{})[_0x6444('0x23')](function(_0x399c77){var _0x45aa04=_0xb83236[_0x6444('0x47')][_0x6444('0x48')]({'plain':!![]});if(!_0x45aa04)throw new Error(_0x6444('0x49'));if(_0x45aa04[_0x6444('0x4a')]==='user'){var _0x51ec86=_0x399c77[_0x6444('0x48')]({'plain':!![]});var _0x47cc71=_0x6444('0x24');return db[_0x6444('0x4b')][_0x6444('0x44')]({'where':{'name':_0x47cc71,'userProfileId':_0x45aa04['userProfileId']},'raw':!![]})[_0x6444('0x23')](function(_0x963fb2){if(_0x963fb2&&_0x963fb2['autoAssociation']===0x0){return db['UserProfileResource'][_0x6444('0x45')]({'name':_0x51ec86[_0x6444('0x29')],'resourceId':_0x51ec86['id'],'type':_0x963fb2[_0x6444('0x29')],'sectionId':_0x963fb2['id']},{})[_0x6444('0x23')](function(){return _0x399c77;});}else{return _0x399c77;}})[_0x6444('0x41')](function(_0x229fd7){logger['error'](_0x6444('0x4c'),_0x229fd7);throw _0x229fd7;});}return _0x399c77;})[_0x6444('0x23')](respondWithResult(_0xf255ae,0xc9))[_0x6444('0x41')](handleError(_0xf255ae,null));};exports[_0x6444('0x4d')]=function(_0x24ca4d,_0x2ecd1d){if(_0x24ca4d[_0x6444('0x46')]['id']){delete _0x24ca4d['body']['id'];}return db[_0x6444('0x2b')][_0x6444('0x44')]({'where':{'id':_0x24ca4d['params']['id']}})[_0x6444('0x23')](handleEntityNotFound(_0x2ecd1d,null))['then'](saveUpdates(_0x24ca4d[_0x6444('0x46')],null))[_0x6444('0x23')](respondWithResult(_0x2ecd1d,null))[_0x6444('0x41')](handleError(_0x2ecd1d,null));};exports[_0x6444('0x25')]=function(_0xb08353,_0x2f93b9){return db['Interval'][_0x6444('0x44')]({'where':{'id':_0xb08353[_0x6444('0x43')]['id']}})[_0x6444('0x23')](handleEntityNotFound(_0x2f93b9,null))[_0x6444('0x23')](removeEntity(_0x2f93b9,null))['catch'](handleError(_0x2f93b9,null));};exports[_0x6444('0x4e')]=function(_0x21e55d,_0x18ee1d,_0x69042c){if(_0x21e55d['body']['id']){delete _0x21e55d[_0x6444('0x46')]['id'];}return db[_0x6444('0x2b')][_0x6444('0x44')]({'where':{'id':_0x21e55d[_0x6444('0x43')]['id']}})[_0x6444('0x23')](handleEntityNotFound(_0x18ee1d,null))[_0x6444('0x23')](function(_0x429238){if(_0x429238){_0x21e55d[_0x6444('0x46')][_0x6444('0x4f')]=_0x429238['id'];return db['Interval'][_0x6444('0x45')](_0x21e55d[_0x6444('0x46')]);}})[_0x6444('0x23')](respondWithResult(_0x18ee1d,null))[_0x6444('0x41')](handleError(_0x18ee1d,null));};exports[_0x6444('0x50')]=function(_0xfe0f65,_0x3ebc4b,_0x1dbd86){var _0x45e796={};var _0x310fc1={};var _0x436b7c;var _0x5baa79;return db['Interval'][_0x6444('0x51')]({'where':{'id':_0xfe0f65[_0x6444('0x43')]['id']}})[_0x6444('0x23')](handleEntityNotFound(_0x3ebc4b,null))[_0x6444('0x23')](function(_0x22620c){if(_0x22620c){_0x436b7c=_0x22620c;_0x310fc1[_0x6444('0x30')]=_[_0x6444('0x2f')](db[_0x6444('0x2b')][_0x6444('0x2c')]);_0x310fc1[_0x6444('0x2e')]=_[_0x6444('0x2f')](_0xfe0f65['query']);_0x310fc1[_0x6444('0x36')]=_['intersection'](_0x310fc1[_0x6444('0x30')],_0x310fc1[_0x6444('0x2e')]);_0x45e796['attributes']=_[_0x6444('0x32')](_0x310fc1[_0x6444('0x30')],qs[_0x6444('0x33')](_0xfe0f65[_0x6444('0x2e')][_0x6444('0x33')]));_0x45e796[_0x6444('0x31')]=_0x45e796[_0x6444('0x31')][_0x6444('0x34')]?_0x45e796[_0x6444('0x31')]:_0x310fc1[_0x6444('0x30')];_0x45e796[_0x6444('0x52')]=qs[_0x6444('0x35')](_0xfe0f65[_0x6444('0x2e')][_0x6444('0x35')]);_0x45e796['where']=qs['filters'](_[_0x6444('0x37')](_0xfe0f65[_0x6444('0x2e')],_0x310fc1[_0x6444('0x36')]));if(_0xfe0f65['query']['filter']){_0x45e796[_0x6444('0x39')]=_[_0x6444('0x3c')](_0x45e796['where'],{'$or':_[_0x6444('0x2d')](_0x45e796[_0x6444('0x31')],function(_0x1b5251){var _0x558bdb={};_0x558bdb[_0x1b5251]={'$like':'%'+_0xfe0f65[_0x6444('0x2e')]['filter']+'%'};return _0x558bdb;})});}_0x45e796=_[_0x6444('0x3c')]({},_0x45e796,_0xfe0f65[_0x6444('0x3d')]);return _0x436b7c[_0x6444('0x50')](_0x45e796);}})[_0x6444('0x23')](function(_0x5dccfa){if(_0x5dccfa){_0x5baa79=_0x5dccfa[_0x6444('0x34')];if(!_0xfe0f65[_0x6444('0x2e')][_0x6444('0x53')](_0x6444('0x54'))){_0x45e796[_0x6444('0x1f')]=qs[_0x6444('0x1f')](_0xfe0f65['query'][_0x6444('0x1f')]);_0x45e796[_0x6444('0x1c')]=qs[_0x6444('0x1c')](_0xfe0f65[_0x6444('0x2e')][_0x6444('0x1c')]);}return _0x436b7c[_0x6444('0x50')](_0x45e796);}})[_0x6444('0x23')](function(_0x17f6a7){if(_0x17f6a7){return _0x17f6a7?{'count':_0x5baa79,'rows':_0x17f6a7}:null;}})['then'](respondWithResult(_0x3ebc4b,null))['catch'](handleError(_0x3ebc4b,null));};exports[_0x6444('0x55')]=function(_0x14c31c,_0x23eff8,_0x2a785b){return db[_0x6444('0x2b')][_0x6444('0x51')]({'where':{'id':_0x14c31c[_0x6444('0x43')]['id']}})[_0x6444('0x23')](handleEntityNotFound(_0x23eff8,null))[_0x6444('0x23')](function(_0x1e1901){if(_0x1e1901){return db[_0x6444('0x56')][_0x6444('0x57')](function(_0x559b41){return db[_0x6444('0x2b')]['destroy']({'where':{'IntervalId':_0x14c31c['params']['id']},'transaction':_0x559b41})['then'](function(_0x3f65a2){var _0x217d0b=_[_0x6444('0x2d')](_0x14c31c[_0x6444('0x46')],function(_0x37df52){delete _0x37df52['id'];_0x37df52[_0x6444('0x4f')]=_0x14c31c[_0x6444('0x43')]['id'];return _0x37df52;});return db[_0x6444('0x2b')][_0x6444('0x58')](_0x217d0b,{'transaction':_0x559b41});});})[_0x6444('0x23')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x14c31c[_0x6444('0x43')]['id']}});});}})[_0x6444('0x23')](respondWithResult(_0x23eff8,null))['catch'](handleError(_0x23eff8,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index dbd5b7d..480d279 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 _0xa3f2=['Interval','rewrite','interval','string','then','all','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','exports'];(function(_0x22e288,_0x5b3d37){var _0x52423a=function(_0x56c96c){while(--_0x56c96c){_0x22e288['push'](_0x22e288['shift']());}};_0x52423a(++_0x5b3d37);}(_0xa3f2,0x110));var _0x2a3f=function(_0x127f4a,_0x396d33){_0x127f4a=_0x127f4a-0x0;var _0x338fcd=_0xa3f2[_0x127f4a];return _0x338fcd;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x2a3f('0x0'));var iftime=require(_0x2a3f('0x1'))['iftime'];module[_0x2a3f('0x2')]=function(_0x1f1a17){return _0x1f1a17['define'](_0x2a3f('0x3'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x93c4d3){extensions[_0x2a3f('0x4')](_0x1f1a17,_0x93c4d3);},'afterBulkCreate':function(_0xc9be4a,_0xef9a85,_0x27793f){_0x27793f();extensions[_0x2a3f('0x4')](_0x1f1a17,_0xc9be4a[0x0]);},'afterUpdate':function(_0x4a3957){extensions[_0x2a3f('0x4')](_0x1f1a17,_0x4a3957);},'afterDestroy':function(_0x6b5099){extensions['rewrite'](_0x1f1a17,_0x6b5099);}},'instanceMethods':{'ifTime':function(_0x1bf6c1=undefined,_0x593d7e=new Date()){if(typeof this[_0x2a3f('0x5')]===_0x2a3f('0x6')){return iftime(this[_0x2a3f('0x5')],_0x1bf6c1,_0x593d7e);}else{return this['getIntervals']()[_0x2a3f('0x7')](function(_0x56eb53){return Promise[_0x2a3f('0x8')](_0x56eb53['map'](function(_0x55472c){return _0x55472c[_0x2a3f('0x9')](_0x1bf6c1,_0x593d7e);}));})[_0x2a3f('0x7')](function(_0x1a2410){return _0x1a2410[_0x2a3f('0xa')](function(_0x30c1a5,_0x8778c){return _0x30c1a5||_0x8778c;},![]);});}}}});}; \ No newline at end of file +var _0x040d=['then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','interval','string','getIntervals'];(function(_0x2aedf9,_0x599351){var _0x2b7d76=function(_0x142d2c){while(--_0x142d2c){_0x2aedf9['push'](_0x2aedf9['shift']());}};_0x2b7d76(++_0x599351);}(_0x040d,0xe5));var _0xd040=function(_0x5afbd5,_0x48a693){_0x5afbd5=_0x5afbd5-0x0;var _0x298511=_0x040d[_0x5afbd5];return _0x298511;};'use strict';var attributes=require(_0xd040('0x0'));var extensions=require(_0xd040('0x1'));var iftime=require('../../utils/iftime')['iftime'];module[_0xd040('0x2')]=function(_0x123bf2){return _0x123bf2[_0xd040('0x3')](_0xd040('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xd6b260){extensions[_0xd040('0x5')](_0x123bf2,_0xd6b260);},'afterBulkCreate':function(_0x5385d8,_0x136c58,_0x19c335){_0x19c335();extensions[_0xd040('0x5')](_0x123bf2,_0x5385d8[0x0]);},'afterUpdate':function(_0xf48fca){extensions[_0xd040('0x5')](_0x123bf2,_0xf48fca);},'afterDestroy':function(_0x866287){extensions['rewrite'](_0x123bf2,_0x866287);}},'instanceMethods':{'ifTime':function(_0x5d9948=undefined,_0x3c4d3e=new Date()){if(typeof this[_0xd040('0x6')]===_0xd040('0x7')){return iftime(this[_0xd040('0x6')],_0x5d9948,_0x3c4d3e);}else{return this[_0xd040('0x8')]()[_0xd040('0x9')](function(_0x18d3f8){return Promise[_0xd040('0xa')](_0x18d3f8[_0xd040('0xb')](function(_0x97386b){return _0x97386b[_0xd040('0xc')](_0x5d9948,_0x3c4d3e);}));})['then'](function(_0x4460f1){return _0x4460f1[_0xd040('0xd')](function(_0x42ed0c,_0x546b3e){return _0x42ed0c||_0x546b3e;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8238c73..a991c60 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 _0x4f0a=['silly','IntervalIftime','resolve','reduce','lodash','../../mysqldb','iftime','../../config/logger','rpc','GetInterval','findAll','options','raw','attributes','limit','map','model','include','info','debug','stringify','catch','error','message','ShowInterval','Interval','find','where','then','all','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20timezone\x20=\x20%s','Iftime'];(function(_0x594b60,_0x474f29){var _0x3d24ec=function(_0x32d063){while(--_0x32d063){_0x594b60['push'](_0x594b60['shift']());}};_0x3d24ec(++_0x474f29);}(_0x4f0a,0x85));var _0xa4f0=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x4f0a[_0x15ec4e];return _0xb5e5dd;};'use strict';var _=require(_0xa4f0('0x0'));var util=require('util');var db=require(_0xa4f0('0x1'))['db'];var iftime=require('../../utils/iftime')[_0xa4f0('0x2')];var logger=require(_0xa4f0('0x3'))(_0xa4f0('0x4'));exports[_0xa4f0('0x5')]=function(_0x356ce0){var _0x42cb48=this;return new Promise(function(_0xfe4ca,_0x5c8242){return db['Interval'][_0xa4f0('0x6')]({'raw':_0x356ce0[_0xa4f0('0x7')]?_0x356ce0[_0xa4f0('0x7')][_0xa4f0('0x8')]===undefined?!![]:![]:!![],'where':_0x356ce0[_0xa4f0('0x7')]?_0x356ce0[_0xa4f0('0x7')]['where']||null:null,'attributes':_0x356ce0[_0xa4f0('0x7')]?_0x356ce0[_0xa4f0('0x7')][_0xa4f0('0x9')]||null:null,'limit':_0x356ce0[_0xa4f0('0x7')]?_0x356ce0[_0xa4f0('0x7')][_0xa4f0('0xa')]||null:null,'include':_0x356ce0[_0xa4f0('0x7')]?_0x356ce0[_0xa4f0('0x7')]['include']?_[_0xa4f0('0xb')](_0x356ce0[_0xa4f0('0x7')]['include'],function(_0x519af3){return{'model':db[_0x519af3[_0xa4f0('0xc')]],'as':_0x519af3['as'],'attributes':_0x519af3[_0xa4f0('0x9')],'include':_0x519af3['include']?_[_0xa4f0('0xb')](_0x519af3[_0xa4f0('0xd')],function(_0x2befd1){return{'model':db[_0x2befd1[_0xa4f0('0xc')]],'as':_0x2befd1['as'],'attributes':_0x2befd1[_0xa4f0('0x9')],'include':_0x2befd1[_0xa4f0('0xd')]?_[_0xa4f0('0xb')](_0x2befd1[_0xa4f0('0xd')],function(_0x3249c7){return{'model':db[_0x3249c7[_0xa4f0('0xc')]],'as':_0x3249c7['as'],'attributes':_0x3249c7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x190d3b){logger[_0xa4f0('0xe')](_0xa4f0('0x5'),_0x356ce0);logger[_0xa4f0('0xf')]('GetInterval',_0x356ce0,JSON[_0xa4f0('0x10')](_0x190d3b));_0xfe4ca(_0x190d3b);})[_0xa4f0('0x11')](function(_0x532920){logger[_0xa4f0('0x12')](_0xa4f0('0x5'),_0x532920[_0xa4f0('0x13')],_0x356ce0);_0x5c8242(_0x42cb48[_0xa4f0('0x12')](0x1f4,_0x532920[_0xa4f0('0x13')]));});});};exports[_0xa4f0('0x14')]=function(_0x16b336){var _0x527add=this;return new Promise(function(_0x142593,_0x820a31){return db[_0xa4f0('0x15')][_0xa4f0('0x16')]({'raw':_0x16b336[_0xa4f0('0x7')]?_0x16b336[_0xa4f0('0x7')][_0xa4f0('0x8')]===undefined?!![]:![]:!![],'where':_0x16b336[_0xa4f0('0x7')]?_0x16b336[_0xa4f0('0x7')][_0xa4f0('0x17')]||null:null,'attributes':_0x16b336[_0xa4f0('0x7')]?_0x16b336[_0xa4f0('0x7')][_0xa4f0('0x9')]||null:null,'include':_0x16b336[_0xa4f0('0x7')]?_0x16b336[_0xa4f0('0x7')][_0xa4f0('0xd')]?_['map'](_0x16b336[_0xa4f0('0x7')][_0xa4f0('0xd')],function(_0x2b89e3){return{'model':db[_0x2b89e3[_0xa4f0('0xc')]],'as':_0x2b89e3['as'],'attributes':_0x2b89e3[_0xa4f0('0x9')],'include':_0x2b89e3[_0xa4f0('0xd')]?_[_0xa4f0('0xb')](_0x2b89e3[_0xa4f0('0xd')],function(_0x2f1b6e){return{'model':db[_0x2f1b6e[_0xa4f0('0xc')]],'as':_0x2f1b6e['as'],'attributes':_0x2f1b6e[_0xa4f0('0x9')],'include':_0x2f1b6e[_0xa4f0('0xd')]?_[_0xa4f0('0xb')](_0x2f1b6e[_0xa4f0('0xd')],function(_0x11ce0c){return{'model':db[_0x11ce0c[_0xa4f0('0xc')]],'as':_0x11ce0c['as'],'attributes':_0x11ce0c[_0xa4f0('0x9')]};}):[]};}):[]};}):[]:[]})[_0xa4f0('0x18')](function(_0x3f560c){logger[_0xa4f0('0xe')](_0xa4f0('0x14'),_0x16b336);logger[_0xa4f0('0xf')](_0xa4f0('0x14'),_0x16b336,JSON[_0xa4f0('0x10')](_0x3f560c));_0x142593(_0x3f560c);})[_0xa4f0('0x11')](function(_0x3257d0){logger[_0xa4f0('0x12')]('ShowInterval',_0x3257d0[_0xa4f0('0x13')],_0x16b336);_0x820a31(_0x527add['error'](0x1f4,_0x3257d0[_0xa4f0('0x13')]));});});};function checkArrayOfIntervals(_0x344037,_0x35c13a){var _0x2c4fc3=[];return db['Interval']['findAll']({'where':{'id':_0x344037}})[_0xa4f0('0x18')](function(_0x3890f2){_0x2c4fc3=_0x3890f2;return Promise[_0xa4f0('0x19')](_0x2c4fc3[_0xa4f0('0xb')](function(_0x4f5cc3){return _0x4f5cc3['ifTime'](_0x35c13a);}));})[_0xa4f0('0x18')](function(_0x27cdce){var _0x5f5a70=_0x27cdce['reduce'](function(_0x17cfb1,_0xa59578){return _0x17cfb1||_0xa59578;},![]);logger['info'](util[_0xa4f0('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x2c4fc3[_0xa4f0('0xb')](function(_0x2807c0){return _0x2807c0[_0xa4f0('0x1b')];})[_0xa4f0('0x1c')](',\x20'),_0x2c4fc3[_0xa4f0('0xb')](function(_0x1cbe06){return _0x1cbe06['id'];})[_0xa4f0('0x1c')](',\x20')));return _0x5f5a70;});}function checkSingleInterval(_0x4c895c,_0x4a5d6d){return db[_0xa4f0('0x15')][_0xa4f0('0x1d')](_0x4c895c)[_0xa4f0('0x18')](function(_0x2f78c8){if(_0x2f78c8){logger[_0xa4f0('0xe')](util[_0xa4f0('0x1a')](_0xa4f0('0x1e'),_0x2f78c8[_0xa4f0('0x1b')],_0x2f78c8['id']));return _0x2f78c8[_0xa4f0('0x1f')](_0x4a5d6d);}});}exports['IntervalIftime']=function(_0x2dbf0c){var _0x50febe=_0x2dbf0c[_0xa4f0('0x20')];var _0xc3e3a2=Array[_0xa4f0('0x21')](_0x2dbf0c[_0xa4f0('0x22')])?_0x2dbf0c[_0xa4f0('0x22')]:typeof _0x2dbf0c['intervals']===_0xa4f0('0x23')?[_0x2dbf0c[_0xa4f0('0x22')]]:[];var _0x164844=_0x2dbf0c[_0xa4f0('0x24')]||undefined;var _0xdd12cf=![];if(_0xc3e3a2['length']){logger[_0xa4f0('0xe')](util[_0xa4f0('0x1a')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0xc3e3a2[_0xa4f0('0x1c')](';\x20')));}if(_0x164844){logger[_0xa4f0('0xe')](util['format'](_0xa4f0('0x25'),_0x164844));}logger['debug'](_0xa4f0('0x26'),_0xdd12cf);logger[_0xa4f0('0x27')](_0xa4f0('0x28'),_0x2dbf0c);return Promise[_0xa4f0('0x29')]()[_0xa4f0('0x18')](function(){if(Array['isArray'](_0x50febe)){return checkArrayOfIntervals(_0x50febe,_0x164844);}else if(_0x50febe){return checkSingleInterval(_0x50febe,_0x164844);}})[_0xa4f0('0x18')](function(_0x284c2d){var _0x1a41e5=_0xc3e3a2[_0xa4f0('0x2a')](function(_0x2d0c9c,_0x455523){return _0x2d0c9c||iftime(_0x455523,_0x164844);},![]);_0xdd12cf=_0x284c2d||_0x1a41e5;return _0xdd12cf;})[_0xa4f0('0x11')](function(_0x4d7820){logger[_0xa4f0('0x12')](_0xa4f0('0x28'),_0x2dbf0c,_0x4d7820);throw this[_0xa4f0('0x12')](0x1f4,_0x4d7820[_0xa4f0('0x13')]);});}; \ No newline at end of file +var _0x1a35=['catch','message','error','ShowInterval','Interval','where','stringify','all','ifTime','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','then','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','lodash','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','findAll','options','raw','limit','map','include','model','attributes','info','debug'];(function(_0x311e77,_0x49a459){var _0x559c54=function(_0x283a97){while(--_0x283a97){_0x311e77['push'](_0x311e77['shift']());}};_0x559c54(++_0x49a459);}(_0x1a35,0x131));var _0x51a3=function(_0x138799,_0x454c04){_0x138799=_0x138799-0x0;var _0x4359c7=_0x1a35[_0x138799];return _0x4359c7;};'use strict';var _=require(_0x51a3('0x0'));var util=require(_0x51a3('0x1'));var db=require(_0x51a3('0x2'))['db'];var iftime=require(_0x51a3('0x3'))[_0x51a3('0x4')];var logger=require('../../config/logger')(_0x51a3('0x5'));exports[_0x51a3('0x6')]=function(_0x3b927c){var _0x11a659=this;return new Promise(function(_0x58dfae,_0x5bb0da){return db['Interval'][_0x51a3('0x7')]({'raw':_0x3b927c[_0x51a3('0x8')]?_0x3b927c['options'][_0x51a3('0x9')]===undefined?!![]:![]:!![],'where':_0x3b927c['options']?_0x3b927c[_0x51a3('0x8')]['where']||null:null,'attributes':_0x3b927c[_0x51a3('0x8')]?_0x3b927c[_0x51a3('0x8')]['attributes']||null:null,'limit':_0x3b927c[_0x51a3('0x8')]?_0x3b927c[_0x51a3('0x8')][_0x51a3('0xa')]||null:null,'include':_0x3b927c[_0x51a3('0x8')]?_0x3b927c['options']['include']?_[_0x51a3('0xb')](_0x3b927c[_0x51a3('0x8')][_0x51a3('0xc')],function(_0x108404){return{'model':db[_0x108404[_0x51a3('0xd')]],'as':_0x108404['as'],'attributes':_0x108404[_0x51a3('0xe')],'include':_0x108404[_0x51a3('0xc')]?_['map'](_0x108404[_0x51a3('0xc')],function(_0x461f64){return{'model':db[_0x461f64[_0x51a3('0xd')]],'as':_0x461f64['as'],'attributes':_0x461f64['attributes'],'include':_0x461f64[_0x51a3('0xc')]?_['map'](_0x461f64['include'],function(_0x7fe4ef){return{'model':db[_0x7fe4ef[_0x51a3('0xd')]],'as':_0x7fe4ef['as'],'attributes':_0x7fe4ef[_0x51a3('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xefe246){logger[_0x51a3('0xf')](_0x51a3('0x6'),_0x3b927c);logger[_0x51a3('0x10')](_0x51a3('0x6'),_0x3b927c,JSON['stringify'](_0xefe246));_0x58dfae(_0xefe246);})[_0x51a3('0x11')](function(_0x2969c4){logger['error']('GetInterval',_0x2969c4[_0x51a3('0x12')],_0x3b927c);_0x5bb0da(_0x11a659[_0x51a3('0x13')](0x1f4,_0x2969c4[_0x51a3('0x12')]));});});};exports[_0x51a3('0x14')]=function(_0x59474d){var _0x81e686=this;return new Promise(function(_0x373dce,_0x13ebfe){return db[_0x51a3('0x15')]['find']({'raw':_0x59474d['options']?_0x59474d[_0x51a3('0x8')][_0x51a3('0x9')]===undefined?!![]:![]:!![],'where':_0x59474d[_0x51a3('0x8')]?_0x59474d[_0x51a3('0x8')][_0x51a3('0x16')]||null:null,'attributes':_0x59474d[_0x51a3('0x8')]?_0x59474d[_0x51a3('0x8')][_0x51a3('0xe')]||null:null,'include':_0x59474d[_0x51a3('0x8')]?_0x59474d[_0x51a3('0x8')]['include']?_[_0x51a3('0xb')](_0x59474d[_0x51a3('0x8')][_0x51a3('0xc')],function(_0x482397){return{'model':db[_0x482397[_0x51a3('0xd')]],'as':_0x482397['as'],'attributes':_0x482397[_0x51a3('0xe')],'include':_0x482397['include']?_[_0x51a3('0xb')](_0x482397[_0x51a3('0xc')],function(_0x216f9d){return{'model':db[_0x216f9d['model']],'as':_0x216f9d['as'],'attributes':_0x216f9d[_0x51a3('0xe')],'include':_0x216f9d[_0x51a3('0xc')]?_[_0x51a3('0xb')](_0x216f9d[_0x51a3('0xc')],function(_0x522fc9){return{'model':db[_0x522fc9[_0x51a3('0xd')]],'as':_0x522fc9['as'],'attributes':_0x522fc9[_0x51a3('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18305f){logger['info'](_0x51a3('0x14'),_0x59474d);logger[_0x51a3('0x10')](_0x51a3('0x14'),_0x59474d,JSON[_0x51a3('0x17')](_0x18305f));_0x373dce(_0x18305f);})[_0x51a3('0x11')](function(_0xb7f95d){logger[_0x51a3('0x13')](_0x51a3('0x14'),_0xb7f95d['message'],_0x59474d);_0x13ebfe(_0x81e686[_0x51a3('0x13')](0x1f4,_0xb7f95d[_0x51a3('0x12')]));});});};function checkArrayOfIntervals(_0x37bbfc,_0x68721b){var _0x577db7=[];return db[_0x51a3('0x15')]['findAll']({'where':{'id':_0x37bbfc}})['then'](function(_0x3adf52){_0x577db7=_0x3adf52;return Promise[_0x51a3('0x18')](_0x577db7[_0x51a3('0xb')](function(_0x291c0c){return _0x291c0c[_0x51a3('0x19')](_0x68721b);}));})['then'](function(_0x113aa5){var _0x1a94a9=_0x113aa5[_0x51a3('0x1a')](function(_0x4fa682,_0x2fa707){return _0x4fa682||_0x2fa707;},![]);logger[_0x51a3('0xf')](util['format'](_0x51a3('0x1b'),_0x577db7[_0x51a3('0xb')](function(_0x224630){return _0x224630[_0x51a3('0x1c')];})[_0x51a3('0x1d')](',\x20'),_0x577db7[_0x51a3('0xb')](function(_0x4c7f64){return _0x4c7f64['id'];})[_0x51a3('0x1d')](',\x20')));return _0x1a94a9;});}function checkSingleInterval(_0x21ccd5,_0x1d31b5){return db[_0x51a3('0x15')][_0x51a3('0x1e')](_0x21ccd5)[_0x51a3('0x1f')](function(_0x127e20){if(_0x127e20){logger['info'](util[_0x51a3('0x20')](_0x51a3('0x21'),_0x127e20[_0x51a3('0x1c')],_0x127e20['id']));return _0x127e20[_0x51a3('0x19')](_0x1d31b5);}});}exports[_0x51a3('0x22')]=function(_0x1ab634){var _0x382870=_0x1ab634[_0x51a3('0x23')];var _0x191f43=Array['isArray'](_0x1ab634[_0x51a3('0x24')])?_0x1ab634['intervals']:typeof _0x1ab634[_0x51a3('0x24')]===_0x51a3('0x25')?[_0x1ab634[_0x51a3('0x24')]]:[];var _0x455131=_0x1ab634[_0x51a3('0x26')]||undefined;var _0x2d5972=![];if(_0x191f43[_0x51a3('0x27')]){logger[_0x51a3('0xf')](util[_0x51a3('0x20')](_0x51a3('0x28'),_0x191f43[_0x51a3('0x1d')](';\x20')));}if(_0x455131){logger[_0x51a3('0xf')](util['format'](_0x51a3('0x29'),_0x455131));}logger[_0x51a3('0x10')](_0x51a3('0x2a'),_0x2d5972);logger[_0x51a3('0x2b')](_0x51a3('0x22'),_0x1ab634);return Promise[_0x51a3('0x2c')]()[_0x51a3('0x1f')](function(){if(Array[_0x51a3('0x2d')](_0x382870)){return checkArrayOfIntervals(_0x382870,_0x455131);}else if(_0x382870){return checkSingleInterval(_0x382870,_0x455131);}})['then'](function(_0x348605){var _0x457103=_0x191f43[_0x51a3('0x1a')](function(_0x52bdd9,_0x59f5b8){return _0x52bdd9||iftime(_0x59f5b8,_0x455131);},![]);_0x2d5972=_0x348605||_0x457103;return _0x2d5972;})[_0x51a3('0x11')](function(_0x18b4ed){logger[_0x51a3('0x13')]('IntervalIftime',_0x1ab634,_0x18b4ed);throw this[_0x51a3('0x13')](0x1f4,_0x18b4ed[_0x51a3('0x12')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 5df1dbe..4e0a141 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x5cb112,_0x342d5a){var _0x515870=function(_0x582bed){while(--_0x582bed){_0x5cb112['push'](_0x5cb112['shift']());}};_0x515870(++_0x342d5a);}(_0xdb28,0x106));var _0x8db2=function(_0x4528fb,_0x987978){_0x4528fb=_0x4528fb-0x0;var _0x3592ca=_0xdb28[_0x4528fb];return _0x3592ca;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x2c684e,_0xd7f2a2){var _0x3a35a6=function(_0x41cb9d){while(--_0x41cb9d){_0x2c684e['push'](_0x2c684e['shift']());}};_0x3a35a6(++_0xd7f2a2);}(_0x2ef3,0xba));var _0x32ef=function(_0x569a18,_0x393e62){_0x569a18=_0x569a18-0x0;var _0x2405d3=_0x2ef3[_0x569a18];return _0x2405d3;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6f5356f..faaa3d4 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 _0x8160=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','\x20from\x20','description','stringify','fields','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','toString','setEncoding','utf8','data','end','status','statusCode','parse','error','json'];(function(_0x60fb10,_0xd27019){var _0x1de1ef=function(_0x3e0eda){while(--_0x3e0eda){_0x60fb10['push'](_0x60fb10['shift']());}};_0x1de1ef(++_0xd27019);}(_0x8160,0xe2));var _0x0816=function(_0x19f14b,_0x56aa54){_0x19f14b=_0x19f14b-0x0;var _0x4515d3=_0x8160[_0x19f14b];return _0x4515d3;};'use strict';var BPromise=require(_0x0816('0x0'));var https=require(_0x0816('0x1'));var logger=require(_0x0816('0x2'))(_0x0816('0x3'));var USERNAME=_0x0816('0x4');var PASSWORD=_0x0816('0x5');function openIssue(_0x2a737b,_0x2b6d1b){var _0x57adbb={'fields':{'project':{'key':_0x2a737b['key']||_0x0816('0x6')},'summary':(_0x2a737b[_0x0816('0x7')]||'Report')+_0x0816('0x8')+_0x2a737b['ip'],'description':_0x2a737b[_0x0816('0x9')]||JSON[_0x0816('0xa')](_0x2a737b),'issuetype':{'name':_0x2a737b['issuetype']||'Bug'}}};_0x57adbb[_0x0816('0xb')]['customfield_11500']=_0x2a737b[_0x0816('0xc')];_0x57adbb['fields'][_0x0816('0xd')]=_0x2a737b['oldToken'];_0x57adbb['fields'][_0x0816('0xe')]=_0x2a737b[_0x0816('0xf')];_0x57adbb[_0x0816('0xb')][_0x0816('0x10')]=_0x2a737b[_0x0816('0x11')];_0x57adbb[_0x0816('0xb')]['customfield_11504']=_0x2a737b['reason'];_0x57adbb[_0x0816('0xb')][_0x0816('0x12')]=_0x2a737b['ip'];var _0xbce6a8={'host':_0x0816('0x13'),'port':0x1bb,'path':_0x0816('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x0816('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x0816('0x16')]('base64')}};var _0x28749d=JSON['stringify'](_0x57adbb);var _0x3ab0f5=https['request'](_0xbce6a8,function(_0xe64aba){_0xe64aba[_0x0816('0x17')](_0x0816('0x18'));var _0x4330a1='';_0xe64aba['on'](_0x0816('0x19'),function(_0x4e5166){_0x4330a1+=_0x4e5166;});_0xe64aba['on'](_0x0816('0x1a'),function(){if(_0x2b6d1b){return _0x2b6d1b[_0x0816('0x1b')](_0xe64aba[_0x0816('0x1c')])['json'](JSON[_0x0816('0x1d')](_0x4330a1));}});});_0x3ab0f5['on'](_0x0816('0x1e'),function(_0x7f3104){if(_0x2b6d1b){return _0x2b6d1b[_0x0816('0x1b')](0x1f4)[_0x0816('0x1f')]({'errors':[{'message':_0x0816('0x20'),'type':_0x0816('0x21')}]});}});_0x3ab0f5[_0x0816('0x22')](_0x28749d);_0x3ab0f5[_0x0816('0x1a')]();}exports[_0x0816('0x23')]=openIssue;exports[_0x0816('0x24')]=function(_0x36098d,_0x30f031){_0x36098d[_0x0816('0x25')]['ip']=_0x36098d[_0x0816('0x26')][_0x0816('0x27')]||_0x36098d[_0x0816('0x28')][_0x0816('0x29')]||_0x36098d[_0x0816('0x2a')]['remoteAddress']||_0x36098d[_0x0816('0x28')][_0x0816('0x2a')][_0x0816('0x29')];return openIssue(_0x36098d[_0x0816('0x25')],_0x30f031);}; \ No newline at end of file +var _0xf7bb=['json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','summary','Report','description','stringify','issuetype','Bug','fields','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','end','status'];(function(_0x103939,_0x1ddda0){var _0x35ac3a=function(_0x554b15){while(--_0x554b15){_0x103939['push'](_0x103939['shift']());}};_0x35ac3a(++_0x1ddda0);}(_0xf7bb,0x1a4));var _0xbf7b=function(_0x1f7f83,_0x7e44ba){_0x1f7f83=_0x1f7f83-0x0;var _0x3a487f=_0xf7bb[_0x1f7f83];return _0x3a487f;};'use strict';var BPromise=require(_0xbf7b('0x0'));var https=require(_0xbf7b('0x1'));var logger=require(_0xbf7b('0x2'))('api');var USERNAME=_0xbf7b('0x3');var PASSWORD=_0xbf7b('0x4');function openIssue(_0x2af77a,_0x1ba10d){var _0x3bc151={'fields':{'project':{'key':_0x2af77a[_0xbf7b('0x5')]||'MOTGUI'},'summary':(_0x2af77a[_0xbf7b('0x6')]||_0xbf7b('0x7'))+'\x20from\x20'+_0x2af77a['ip'],'description':_0x2af77a[_0xbf7b('0x8')]||JSON[_0xbf7b('0x9')](_0x2af77a),'issuetype':{'name':_0x2af77a[_0xbf7b('0xa')]||_0xbf7b('0xb')}}};_0x3bc151[_0xbf7b('0xc')]['customfield_11500']=_0x2af77a[_0xbf7b('0xd')];_0x3bc151[_0xbf7b('0xc')][_0xbf7b('0xe')]=_0x2af77a['oldToken'];_0x3bc151[_0xbf7b('0xc')][_0xbf7b('0xf')]=_0x2af77a[_0xbf7b('0x10')];_0x3bc151['fields'][_0xbf7b('0x11')]=_0x2af77a[_0xbf7b('0x12')];_0x3bc151[_0xbf7b('0xc')]['customfield_11504']=_0x2af77a[_0xbf7b('0x13')];_0x3bc151['fields'][_0xbf7b('0x14')]=_0x2af77a['ip'];var _0x4685d1={'host':_0xbf7b('0x15'),'port':0x1bb,'path':_0xbf7b('0x16'),'method':_0xbf7b('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xbf7b('0x18'),'Authorization':_0xbf7b('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xbf7b('0x1a')](_0xbf7b('0x1b'))}};var _0x2ce961=JSON[_0xbf7b('0x9')](_0x3bc151);var _0x5032d8=https[_0xbf7b('0x1c')](_0x4685d1,function(_0x47c27a){_0x47c27a['setEncoding']('utf8');var _0x3c008e='';_0x47c27a['on']('data',function(_0x38ed8a){_0x3c008e+=_0x38ed8a;});_0x47c27a['on'](_0xbf7b('0x1d'),function(){if(_0x1ba10d){return _0x1ba10d[_0xbf7b('0x1e')](_0x47c27a['statusCode'])['json'](JSON['parse'](_0x3c008e));}});});_0x5032d8['on']('error',function(_0x1003b5){if(_0x1ba10d){return _0x1ba10d[_0xbf7b('0x1e')](0x1f4)[_0xbf7b('0x1f')]({'errors':[{'message':_0xbf7b('0x20'),'type':_0xbf7b('0x21')}]});}});_0x5032d8[_0xbf7b('0x22')](_0x2ce961);_0x5032d8[_0xbf7b('0x1d')]();}exports[_0xbf7b('0x23')]=openIssue;exports['send']=function(_0x46a7db,_0x2a3769){_0x46a7db[_0xbf7b('0x24')]['ip']=_0x46a7db['headers'][_0xbf7b('0x25')]||_0x46a7db[_0xbf7b('0x26')]['remoteAddress']||_0x46a7db[_0xbf7b('0x27')][_0xbf7b('0x28')]||_0x46a7db['connection'][_0xbf7b('0x27')][_0xbf7b('0x28')];return openIssue(_0x46a7db['body'],_0x2a3769);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5164e47..21bd9ee 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 _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x144c41,_0x2ca219){var _0x57553c=function(_0x2c6d7d){while(--_0x2c6d7d){_0x144c41['push'](_0x144c41['shift']());}};_0x57553c(++_0x2ca219);}(_0x0bb5,0x148));var _0x50bb=function(_0xb74821,_0x237aba){_0xb74821=_0xb74821-0x0;var _0x3f0107=_0x0bb5[_0xb74821];return _0x3f0107;};'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',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file +var _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x1ab681,_0x204fb8){var _0x32bf08=function(_0x2de4ad){while(--_0x2de4ad){_0x1ab681['push'](_0x1ab681['shift']());}};_0x32bf08(++_0x204fb8);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4085b4,_0x27c904){_0x4085b4=_0x4085b4-0x0;var _0x2afa41=_0xf4eb[_0x4085b4];return _0x2afa41;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 7c505d3..b147576 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x239a5b,_0x40295b){_0x239a5b=_0x239a5b-0x0;var _0x5dc1d1=_0x7a54[_0x239a5b];return _0x5dc1d1;};'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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x2e7373,_0x4546f2){_0x2e7373=_0x2e7373-0x0;var _0x22b955=_0x7a54[_0x2e7373];return _0x22b955;};'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 fc7d6f6..275c32d 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 _0x5d17=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','update','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox'];(function(_0x16a9cc,_0x5da558){var _0x3f6e18=function(_0x51589f){while(--_0x51589f){_0x16a9cc['push'](_0x16a9cc['shift']());}};_0x3f6e18(++_0x5da558);}(_0x5d17,0x114));var _0x75d1=function(_0x23b1d5,_0x3043fa){_0x23b1d5=_0x23b1d5-0x0;var _0x3f5702=_0x5d17[_0x23b1d5];return _0x3f5702;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['JscriptyAnswerReport'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')](_0x12bd67['body'],{})['then'](respondWithResult(_0x16f744,0xc9))[_0x75d1('0x3e')](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x50def3,_0x2d380d){if(_0x50def3[_0x75d1('0x44')]['id']){delete _0x50def3[_0x75d1('0x44')]['id'];}return db['JscriptyAnswerReport'][_0x75d1('0x45')]({'where':{'id':_0x50def3[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x2d380d,null))[_0x75d1('0x24')](saveUpdates(_0x50def3[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x2d380d,null))[_0x75d1('0x3e')](handleError(_0x2d380d,null));};exports['destroy']=function(_0x1eaa66,_0x382195){return db[_0x75d1('0x28')][_0x75d1('0x45')]({'where':{'id':_0x1eaa66[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x382195,null))[_0x75d1('0x24')](removeEntity(_0x382195,null))['catch'](handleError(_0x382195,null));};exports[_0x75d1('0x46')]=function(_0x3af9c5,_0x42d587){return db['JscriptyAnswerReport'][_0x75d1('0x46')]()[_0x75d1('0x24')](respondWithResult(_0x42d587,null))[_0x75d1('0x3e')](handleError(_0x42d587,null));}; \ No newline at end of file +var _0x3837=['find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','JscriptyAnswerReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length'];(function(_0x1260eb,_0x3e0895){var _0x4f7682=function(_0x2c77fb){while(--_0x2c77fb){_0x1260eb['push'](_0x1260eb['shift']());}};_0x4f7682(++_0x3e0895);}(_0x3837,0x1d1));var _0x7383=function(_0x1fd17e,_0x2c2722){_0x1fd17e=_0x1fd17e-0x0;var _0x2e11f9=_0x3837[_0x1fd17e];return _0x2e11f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7383('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7383('0x1'));var rp=require('request-promise');var moment=require(_0x7383('0x2'));var BPromise=require(_0x7383('0x3'));var Mustache=require(_0x7383('0x4'));var util=require(_0x7383('0x5'));var path=require(_0x7383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7383('0x7'));var fs=require('fs');var fs_extra=require(_0x7383('0x8'));var _=require(_0x7383('0x9'));var squel=require(_0x7383('0xa'));var crypto=require(_0x7383('0xb'));var jsforce=require(_0x7383('0xc'));var deskjs=require(_0x7383('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7383('0xe'));var Papa=require(_0x7383('0xf'));var Redis=require(_0x7383('0x10'));var authService=require(_0x7383('0x11'));var qs=require(_0x7383('0x12'));var as=require(_0x7383('0x13'));var hardwareService=require(_0x7383('0x14'));var logger=require('../../config/logger')(_0x7383('0x15'));var utils=require(_0x7383('0x16'));var config=require(_0x7383('0x17'));var licenseUtil=require(_0x7383('0x18'));var db=require(_0x7383('0x19'))['db'];function respondWithStatusCode(_0x35e5f4,_0xe359e8){_0xe359e8=_0xe359e8||0xcc;return function(_0x70b32){if(_0x70b32){return _0x35e5f4[_0x7383('0x1a')](_0xe359e8);}return _0x35e5f4[_0x7383('0x1b')](_0xe359e8)[_0x7383('0x1c')]();};}function respondWithResult(_0x5b018f,_0x43c1d6){_0x43c1d6=_0x43c1d6||0xc8;return function(_0x3a2c78){if(_0x3a2c78){return _0x5b018f[_0x7383('0x1b')](_0x43c1d6)[_0x7383('0x1d')](_0x3a2c78);}};}function respondWithFilteredResult(_0x4aa59d,_0x566949){return function(_0x47b4c4){if(_0x47b4c4){var _0x5cf093=typeof _0x566949[_0x7383('0x1e')]===_0x7383('0x1f')&&typeof _0x566949[_0x7383('0x20')]===_0x7383('0x1f');var _0x1f733d=_0x47b4c4['count'];var _0x1cf7bb=_0x5cf093?0x0:_0x566949[_0x7383('0x1e')];var _0x1c7645=_0x5cf093?_0x47b4c4[_0x7383('0x21')]:_0x566949[_0x7383('0x1e')]+_0x566949[_0x7383('0x20')];var _0x115ff6;if(_0x1c7645>=_0x1f733d){_0x1c7645=_0x1f733d;_0x115ff6=0xc8;}else{_0x115ff6=0xce;}_0x4aa59d[_0x7383('0x1b')](_0x115ff6);return _0x4aa59d[_0x7383('0x22')](_0x7383('0x23'),_0x1cf7bb+'-'+_0x1c7645+'/'+_0x1f733d)['json'](_0x47b4c4);}return null;};}function patchUpdates(_0x42d970){return function(_0x2aebe0){try{jsonpatch[_0x7383('0x24')](_0x2aebe0,_0x42d970,!![]);}catch(_0x4a65e9){return BPromise[_0x7383('0x25')](_0x4a65e9);}return _0x2aebe0[_0x7383('0x26')]();};}function saveUpdates(_0x47e145,_0x316204){return function(_0x57420d){if(_0x57420d){return _0x57420d[_0x7383('0x27')](_0x47e145)[_0x7383('0x28')](function(_0x5c617a){return _0x5c617a;});}return null;};}function removeEntity(_0x1afeab,_0x3c5467){return function(_0x1edf1d){if(_0x1edf1d){return _0x1edf1d[_0x7383('0x29')]()[_0x7383('0x28')](function(){_0x1afeab['status'](0xcc)[_0x7383('0x1c')]();});}};}function handleEntityNotFound(_0x5eaf6a,_0x4c3e40){return function(_0x388964){if(!_0x388964){_0x5eaf6a[_0x7383('0x1a')](0x194);}return _0x388964;};}function handleError(_0x82bd92,_0x208ef9){_0x208ef9=_0x208ef9||0x1f4;return function(_0x4a1840){logger[_0x7383('0x2a')](_0x4a1840['stack']);if(_0x4a1840[_0x7383('0x2b')]){delete _0x4a1840[_0x7383('0x2b')];}_0x82bd92[_0x7383('0x1b')](_0x208ef9)[_0x7383('0x2c')](_0x4a1840);};}exports[_0x7383('0x2d')]=function(_0x439d09,_0x272d78){var _0x43f7a5={},_0x2b550d={},_0x15b14c={'count':0x0,'rows':[]};var _0x512a98=_[_0x7383('0x2e')](db[_0x7383('0x2f')]['rawAttributes'],function(_0x5e52ce){return{'name':_0x5e52ce['fieldName'],'type':_0x5e52ce[_0x7383('0x30')][_0x7383('0x31')]};});_0x2b550d[_0x7383('0x32')]=_[_0x7383('0x2e')](_0x512a98,_0x7383('0x2b'));_0x2b550d[_0x7383('0x33')]=_[_0x7383('0x34')](_0x439d09[_0x7383('0x33')]);_0x2b550d[_0x7383('0x35')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],_0x2b550d[_0x7383('0x33')]);_0x43f7a5[_0x7383('0x37')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],qs[_0x7383('0x38')](_0x439d09[_0x7383('0x33')][_0x7383('0x38')]));_0x43f7a5[_0x7383('0x37')]=_0x43f7a5[_0x7383('0x37')]['length']?_0x43f7a5[_0x7383('0x37')]:_0x2b550d[_0x7383('0x32')];if(!_0x439d09['query'][_0x7383('0x39')](_0x7383('0x3a'))){_0x43f7a5[_0x7383('0x20')]=qs[_0x7383('0x20')](_0x439d09[_0x7383('0x33')]['limit']);_0x43f7a5[_0x7383('0x1e')]=qs[_0x7383('0x1e')](_0x439d09[_0x7383('0x33')][_0x7383('0x1e')]);}_0x43f7a5[_0x7383('0x3b')]=qs[_0x7383('0x3c')](_0x439d09[_0x7383('0x33')]['sort']);_0x43f7a5['where']=qs['filters'](_[_0x7383('0x3d')](_0x439d09[_0x7383('0x33')],_0x2b550d[_0x7383('0x35')]),_0x512a98);if(_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]){_0x43f7a5[_0x7383('0x3f')]=_[_0x7383('0x40')](_0x43f7a5[_0x7383('0x3f')],{'$or':_[_0x7383('0x2e')](_0x512a98,function(_0x4f307a){if(_0x4f307a[_0x7383('0x30')]!==_0x7383('0x41')){var _0x3c2795={};_0x3c2795[_0x4f307a[_0x7383('0x2b')]]={'$like':'%'+_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]+'%'};return _0x3c2795;}})});}_0x43f7a5=_['merge']({},_0x43f7a5,_0x439d09[_0x7383('0x42')]);var _0x5329a6={'where':_0x43f7a5['where']};return db[_0x7383('0x2f')][_0x7383('0x21')](_0x5329a6)[_0x7383('0x28')](function(_0x3f14a6){_0x15b14c[_0x7383('0x21')]=_0x3f14a6;if(_0x439d09['query']['includeAll']){_0x43f7a5[_0x7383('0x43')]=[{'all':!![]}];}return db[_0x7383('0x2f')]['findAll'](_0x43f7a5);})['then'](function(_0x271cd5){_0x15b14c[_0x7383('0x44')]=_0x271cd5;return _0x15b14c;})[_0x7383('0x28')](respondWithFilteredResult(_0x272d78,_0x43f7a5))[_0x7383('0x45')](handleError(_0x272d78,null));};exports[_0x7383('0x46')]=function(_0x53c999,_0x141728){var _0x5d9085={'raw':!![],'where':{'id':_0x53c999[_0x7383('0x47')]['id']}},_0x3951d1={};_0x3951d1[_0x7383('0x32')]=_[_0x7383('0x34')](db['JscriptyAnswerReport'][_0x7383('0x48')]);_0x3951d1[_0x7383('0x33')]=_[_0x7383('0x34')](_0x53c999[_0x7383('0x33')]);_0x3951d1['filters']=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],_0x3951d1[_0x7383('0x33')]);_0x5d9085[_0x7383('0x37')]=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],qs[_0x7383('0x38')](_0x53c999[_0x7383('0x33')][_0x7383('0x38')]));_0x5d9085[_0x7383('0x37')]=_0x5d9085[_0x7383('0x37')][_0x7383('0x49')]?_0x5d9085[_0x7383('0x37')]:_0x3951d1['model'];if(_0x53c999[_0x7383('0x33')]['includeAll']){_0x5d9085[_0x7383('0x43')]=[{'all':!![]}];}_0x5d9085=_[_0x7383('0x40')]({},_0x5d9085,_0x53c999[_0x7383('0x42')]);return db['JscriptyAnswerReport'][_0x7383('0x4a')](_0x5d9085)[_0x7383('0x28')](handleEntityNotFound(_0x141728,null))['then'](respondWithResult(_0x141728,null))[_0x7383('0x45')](handleError(_0x141728,null));};exports['create']=function(_0x10ac80,_0x49e4f1){return db[_0x7383('0x2f')]['create'](_0x10ac80[_0x7383('0x4b')],{})[_0x7383('0x28')](respondWithResult(_0x49e4f1,0xc9))[_0x7383('0x45')](handleError(_0x49e4f1,null));};exports['update']=function(_0xd6ea61,_0x15ed37){if(_0xd6ea61[_0x7383('0x4b')]['id']){delete _0xd6ea61['body']['id'];}return db['JscriptyAnswerReport'][_0x7383('0x4a')]({'where':{'id':_0xd6ea61[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x15ed37,null))[_0x7383('0x28')](saveUpdates(_0xd6ea61[_0x7383('0x4b')],null))[_0x7383('0x28')](respondWithResult(_0x15ed37,null))[_0x7383('0x45')](handleError(_0x15ed37,null));};exports[_0x7383('0x29')]=function(_0x380316,_0x65a7d2){return db['JscriptyAnswerReport'][_0x7383('0x4a')]({'where':{'id':_0x380316[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x65a7d2,null))[_0x7383('0x28')](removeEntity(_0x65a7d2,null))[_0x7383('0x45')](handleError(_0x65a7d2,null));};exports['describe']=function(_0x210351,_0xa7233a){return db['JscriptyAnswerReport'][_0x7383('0x4c')]()[_0x7383('0x28')](respondWithResult(_0xa7233a,null))[_0x7383('0x45')](handleError(_0xa7233a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index e8dc98e..5c75101 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 _0xf9f6=['util','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x4ef7ee,_0x16e755){var _0x5e2a5d=function(_0x1757b8){while(--_0x1757b8){_0x4ef7ee['push'](_0x4ef7ee['shift']());}};_0x5e2a5d(++_0x16e755);}(_0xf9f6,0x81));var _0x6f9f=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xf9f6[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x6f9f('0x0'));var util=require(_0x6f9f('0x1'));var logger=require(_0x6f9f('0x2'))(_0x6f9f('0x3'));var moment=require(_0x6f9f('0x4'));var BPromise=require(_0x6f9f('0x5'));var rp=require(_0x6f9f('0x6'));var fs=require('fs');var path=require(_0x6f9f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f9f('0x8'));module[_0x6f9f('0x9')]=function(_0x51461c,_0x289d3d){return _0x51461c[_0x6f9f('0xa')](_0x6f9f('0xb'),attributes,{'tableName':_0x6f9f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd33=['JscriptyAnswerReport','report_jscripty_answers','lodash','moment','bluebird','request-promise','path','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x550859,_0x5efee8){var _0x3d70b5=function(_0x247b08){while(--_0x247b08){_0x550859['push'](_0x550859['shift']());}};_0x3d70b5(++_0x5efee8);}(_0xdd33,0x14c));var _0x3dd3=function(_0x128a75,_0x1173c5){_0x128a75=_0x128a75-0x0;var _0x3be03b=_0xdd33[_0x128a75];return _0x3be03b;};'use strict';var _=require(_0x3dd3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3dd3('0x1'));var BPromise=require(_0x3dd3('0x2'));var rp=require(_0x3dd3('0x3'));var fs=require('fs');var path=require(_0x3dd3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3dd3('0x5'));module[_0x3dd3('0x6')]=function(_0x47c67f,_0x2c3c60){return _0x47c67f[_0x3dd3('0x7')](_0x3dd3('0x8'),attributes,{'tableName':_0x3dd3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index da94c08..2606c64 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 _0xb760=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xb760,0x161));var _0x0b76=function(_0x3849e1,_0x2ddbf1){_0x3849e1=_0x3849e1-0x0;var _0x5b8324=_0xb760[_0x3849e1];return _0x5b8324;};'use strict';var _=require('lodash');var util=require(_0x0b76('0x0'));var moment=require('moment');var BPromise=require(_0x0b76('0x1'));var rs=require(_0x0b76('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b76('0x3'))['db'];var utils=require(_0x0b76('0x4'));var logger=require(_0x0b76('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0b76('0x6'));var client=jayson[_0x0b76('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6d77,_0xd9bc7e,_0x2dfd32){return new BPromise(function(_0x53e159,_0x11bab6){return client[_0x0b76('0x8')](_0x5e6d77,_0x2dfd32)[_0x0b76('0x9')](function(_0x175997){logger[_0x0b76('0xa')](_0x0b76('0xb'),_0xd9bc7e,_0x0b76('0xc'));logger[_0x0b76('0xd')](_0x0b76('0xe'),_0xd9bc7e,_0x0b76('0xc'),JSON[_0x0b76('0xf')](_0x175997));if(_0x175997['error']){if(_0x175997[_0x0b76('0x10')][_0x0b76('0x11')]===0x1f4){logger[_0x0b76('0x10')](_0x0b76('0xb'),_0xd9bc7e,_0x175997['error'][_0x0b76('0x12')]);return _0x11bab6(_0x175997['error']['message']);}logger[_0x0b76('0x10')](_0x0b76('0xb'),_0xd9bc7e,_0x175997['error'][_0x0b76('0x12')]);return _0x53e159(_0x175997[_0x0b76('0x10')][_0x0b76('0x12')]);}else{logger[_0x0b76('0xa')](_0x0b76('0xb'),_0xd9bc7e,_0x0b76('0xc'));_0x53e159(_0x175997[_0x0b76('0x13')][_0x0b76('0x12')]);}})[_0x0b76('0x14')](function(_0x4df78c){logger[_0x0b76('0x10')](_0x0b76('0xb'),_0xd9bc7e,_0x4df78c);_0x11bab6(_0x4df78c);});});} \ No newline at end of file +var _0xe850=['info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe850,0x1f0));var _0x0e85=function(_0x4d5f29,_0x425e26){_0x4d5f29=_0x4d5f29-0x0;var _0x2c1240=_0xe850[_0x4d5f29];return _0x2c1240;};'use strict';var _=require(_0x0e85('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e85('0x1'));var rs=require(_0x0e85('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e85('0x3'))['db'];var utils=require(_0x0e85('0x4'));var logger=require('../../config/logger')(_0x0e85('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e85('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2adadf,_0x45b5fb,_0xca8e29){return new BPromise(function(_0x412164,_0x370452){return client[_0x0e85('0x7')](_0x2adadf,_0xca8e29)['then'](function(_0x50793c){logger[_0x0e85('0x8')](_0x0e85('0x9'),_0x45b5fb,'request\x20sent');logger[_0x0e85('0xa')](_0x0e85('0xb'),_0x45b5fb,_0x0e85('0xc'),JSON[_0x0e85('0xd')](_0x50793c));if(_0x50793c[_0x0e85('0xe')]){if(_0x50793c[_0x0e85('0xe')]['code']===0x1f4){logger[_0x0e85('0xe')](_0x0e85('0x9'),_0x45b5fb,_0x50793c[_0x0e85('0xe')]['message']);return _0x370452(_0x50793c[_0x0e85('0xe')]['message']);}logger[_0x0e85('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x45b5fb,_0x50793c[_0x0e85('0xe')][_0x0e85('0xf')]);return _0x412164(_0x50793c[_0x0e85('0xe')][_0x0e85('0xf')]);}else{logger[_0x0e85('0x8')](_0x0e85('0x9'),_0x45b5fb,_0x0e85('0xc'));_0x412164(_0x50793c[_0x0e85('0x10')]['message']);}})[_0x0e85('0x11')](function(_0x2bb2cc){logger[_0x0e85('0xe')](_0x0e85('0x9'),_0x45b5fb,_0x2bb2cc);_0x370452(_0x2bb2cc);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 4c21048..7c11ef8 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 _0xe601=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','clone','put','update'];(function(_0x22d19d,_0x379051){var _0x103fc2=function(_0x10b414){while(--_0x10b414){_0x22d19d['push'](_0x22d19d['shift']());}};_0x103fc2(++_0x379051);}(_0xe601,0xab));var _0x1e60=function(_0x1cf67b,_0x4bba44){_0x1cf67b=_0x1cf67b-0x0;var _0x38055e=_0xe601[_0x1cf67b];return _0x38055e;};'use strict';var multer=require(_0x1e60('0x0'));var util=require(_0x1e60('0x1'));var path=require(_0x1e60('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e60('0x3'));var router=express[_0x1e60('0x4')]();var fs_extra=require(_0x1e60('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e60('0x6'));var config=require(_0x1e60('0x7'));var controller=require(_0x1e60('0x8'));router[_0x1e60('0x9')]('/',auth[_0x1e60('0xa')](),controller[_0x1e60('0xb')]);router[_0x1e60('0x9')](_0x1e60('0xc'),auth[_0x1e60('0xa')](),controller[_0x1e60('0xd')]);router[_0x1e60('0x9')](_0x1e60('0xe'),auth[_0x1e60('0xa')](),controller[_0x1e60('0xf')]);router[_0x1e60('0x9')]('/:id/answers',auth[_0x1e60('0xa')](),controller[_0x1e60('0x10')]);router[_0x1e60('0x9')](_0x1e60('0x11'),auth[_0x1e60('0xa')](),timeout(_0x1e60('0x12')),controller[_0x1e60('0x13')]);router[_0x1e60('0x14')]('/',auth[_0x1e60('0xa')](),controller[_0x1e60('0x15')]);router[_0x1e60('0x14')]('/:id/clone',auth[_0x1e60('0xa')](),controller[_0x1e60('0x16')]);router[_0x1e60('0x17')](_0x1e60('0xc'),auth[_0x1e60('0xa')](),controller[_0x1e60('0x18')]);router[_0x1e60('0x19')]('/:id',auth[_0x1e60('0xa')](),controller[_0x1e60('0x1a')]);module[_0x1e60('0x1b')]=router; \ No newline at end of file +var _0xf026=['index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x34e2ec,_0x5dab65){var _0x44e169=function(_0x3ead94){while(--_0x3ead94){_0x34e2ec['push'](_0x34e2ec['shift']());}};_0x44e169(++_0x5dab65);}(_0xf026,0x113));var _0x6f02=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xf026[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0x6f02('0x0'));var util=require(_0x6f02('0x1'));var path=require('path');var timeout=require(_0x6f02('0x2'));var express=require(_0x6f02('0x3'));var router=express[_0x6f02('0x4')]();var fs_extra=require(_0x6f02('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6f02('0x6'));var config=require(_0x6f02('0x7'));var controller=require(_0x6f02('0x8'));router[_0x6f02('0x9')]('/',auth[_0x6f02('0xa')](),controller[_0x6f02('0xb')]);router[_0x6f02('0x9')](_0x6f02('0xc'),auth[_0x6f02('0xa')](),controller['show']);router[_0x6f02('0x9')](_0x6f02('0xd'),auth['isAuthenticated'](),controller[_0x6f02('0xe')]);router[_0x6f02('0x9')](_0x6f02('0xf'),auth[_0x6f02('0xa')](),controller[_0x6f02('0x10')]);router[_0x6f02('0x9')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x6f02('0x11')),controller[_0x6f02('0x12')]);router[_0x6f02('0x13')]('/',auth[_0x6f02('0xa')](),controller[_0x6f02('0x14')]);router[_0x6f02('0x13')](_0x6f02('0x15'),auth['isAuthenticated'](),controller[_0x6f02('0x16')]);router['put'](_0x6f02('0xc'),auth[_0x6f02('0xa')](),controller['update']);router[_0x6f02('0x17')](_0x6f02('0xc'),auth['isAuthenticated'](),controller[_0x6f02('0x18')]);module[_0x6f02('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6ffe000..f396678 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 _0xc4e9=['stringify','isString','formData','format','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue'];(function(_0x1e65ae,_0x5ee276){var _0x59ef7c=function(_0xc3f648){while(--_0xc3f648){_0x1e65ae['push'](_0x1e65ae['shift']());}};_0x59ef7c(++_0x5ee276);}(_0xc4e9,0x6d));var _0x9c4e=function(_0x112aa9,_0x51a391){_0x112aa9=_0x112aa9-0x0;var _0xebc169=_0xc4e9[_0x112aa9];return _0xebc169;};'use strict';var Sequelize=require(_0x9c4e('0x0'));var _=require(_0x9c4e('0x1'));var util=require(_0x9c4e('0x2'));module[_0x9c4e('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c4e('0x4')},'description':{'type':Sequelize[_0x9c4e('0x5')]},'formData':{'type':Sequelize[_0x9c4e('0x6')](_0x9c4e('0x7')),'set':function(_0x4dae7c){if(_[_0x9c4e('0x8')](_0x4dae7c)){this[_0x9c4e('0x9')]('formData',JSON[_0x9c4e('0xa')](_0x4dae7c));}else if(_[_0x9c4e('0xb')](_0x4dae7c)){this[_0x9c4e('0x9')]('formData',_0x4dae7c);}else{this['setDataValue'](_0x9c4e('0xc'),util[_0x9c4e('0xd')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x9c4e('0xe')](_0x9c4e('0x4'))||'',this['getDataValue'](_0x9c4e('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9c4e('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xab4a=['name','description','BOOLEAN','sequelize','STRING','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x595d29,_0x3cab2a){var _0x254cdf=function(_0x2f3b9c){while(--_0x2f3b9c){_0x595d29['push'](_0x595d29['shift']());}};_0x254cdf(++_0x3cab2a);}(_0xab4a,0xed));var _0xaab4=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0xab4a[_0x3a4f18];return _0x4c20fc;};'use strict';var Sequelize=require(_0xaab4('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0xaab4('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xaab4('0x1')]},'formData':{'type':Sequelize['TEXT'](_0xaab4('0x2')),'set':function(_0x37b938){if(_['isObjectLike'](_0x37b938)){this[_0xaab4('0x3')](_0xaab4('0x4'),JSON[_0xaab4('0x5')](_0x37b938));}else if(_[_0xaab4('0x6')](_0x37b938)){this['setDataValue'](_0xaab4('0x4'),_0x37b938);}else{this['setDataValue'](_0xaab4('0x4'),util[_0xaab4('0x7')](_0xaab4('0x8'),this[_0xaab4('0x9')](_0xaab4('0xa'))||'',this['getDataValue'](_0xaab4('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xaab4('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xaab4('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 742d08f..a1af704 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 _0x5276=['isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Projects','error','stack','name','send','map','JscriptyProject','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','create','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','answer','push'];(function(_0x20a618,_0x3d1a7b){var _0x3be658=function(_0x2cef18){while(--_0x2cef18){_0x20a618['push'](_0x20a618['shift']());}};_0x3be658(++_0x3d1a7b);}(_0x5276,0x163));var _0x6527=function(_0x48afa0,_0x20db0f){_0x48afa0=_0x48afa0-0x0;var _0x43ab46=_0x5276[_0x48afa0];return _0x43ab46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6527('0x0'));var jsonpatch=require(_0x6527('0x1'));var rp=require(_0x6527('0x2'));var moment=require(_0x6527('0x3'));var BPromise=require(_0x6527('0x4'));var Mustache=require(_0x6527('0x5'));var util=require(_0x6527('0x6'));var path=require(_0x6527('0x7'));var sox=require(_0x6527('0x8'));var csv=require(_0x6527('0x9'));var ejs=require(_0x6527('0xa'));var fs=require('fs');var fs_extra=require(_0x6527('0xb'));var _=require(_0x6527('0xc'));var squel=require('squel');var crypto=require(_0x6527('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6527('0xe'));var toCsv=require(_0x6527('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6527('0xf'));var as=require(_0x6527('0x10'));var hardwareService=require(_0x6527('0x11'));var logger=require(_0x6527('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6527('0x13'));var licenseUtil=require(_0x6527('0x14'));var db=require(_0x6527('0x15'))['db'];function respondWithStatusCode(_0x577337,_0x5c3bee){_0x5c3bee=_0x5c3bee||0xcc;return function(_0x5f2990){if(_0x5f2990){return _0x577337[_0x6527('0x16')](_0x5c3bee);}return _0x577337[_0x6527('0x17')](_0x5c3bee)['end']();};}function respondWithResult(_0x23e61a,_0x5287dc){_0x5287dc=_0x5287dc||0xc8;return function(_0x3b56ee){if(_0x3b56ee){return _0x23e61a[_0x6527('0x17')](_0x5287dc)[_0x6527('0x18')](_0x3b56ee);}};}function respondWithFilteredResult(_0x1b7f18,_0x64f951){return function(_0x2fbcef){if(_0x2fbcef){var _0x495c14=typeof _0x64f951[_0x6527('0x19')]==='undefined'&&typeof _0x64f951[_0x6527('0x1a')]===_0x6527('0x1b');var _0x2cb6e9=_0x2fbcef[_0x6527('0x1c')];var _0x508f67=_0x495c14?0x0:_0x64f951[_0x6527('0x19')];var _0x7a2c89=_0x495c14?_0x2fbcef[_0x6527('0x1c')]:_0x64f951[_0x6527('0x19')]+_0x64f951[_0x6527('0x1a')];var _0x5014b2;if(_0x7a2c89>=_0x2cb6e9){_0x7a2c89=_0x2cb6e9;_0x5014b2=0xc8;}else{_0x5014b2=0xce;}_0x1b7f18['status'](_0x5014b2);return _0x1b7f18[_0x6527('0x1d')](_0x6527('0x1e'),_0x508f67+'-'+_0x7a2c89+'/'+_0x2cb6e9)[_0x6527('0x18')](_0x2fbcef);}return null;};}function patchUpdates(_0x20ef21){return function(_0x3352e4){try{jsonpatch[_0x6527('0x1f')](_0x3352e4,_0x20ef21,!![]);}catch(_0x3ba0e0){return BPromise[_0x6527('0x20')](_0x3ba0e0);}return _0x3352e4[_0x6527('0x21')]();};}function saveUpdates(_0x1a569a,_0xa731f8){return function(_0x2e7450){if(_0x2e7450){return _0x2e7450['update'](_0x1a569a)[_0x6527('0x22')](function(_0x7ce319){return _0x7ce319;});}return null;};}function removeEntity(_0x5d81c2,_0xc6d06b){return function(_0x188c3a){if(_0x188c3a){return _0x188c3a[_0x6527('0x23')]()[_0x6527('0x22')](function(){var _0x2b1294=_0x188c3a[_0x6527('0x24')]({'plain':!![]});var _0x8341b=_0x6527('0x25');return db['UserProfileResource'][_0x6527('0x23')]({'where':{'type':_0x8341b,'resourceId':_0x2b1294['id']}})[_0x6527('0x22')](function(){return _0x188c3a;});})[_0x6527('0x22')](function(){_0x5d81c2[_0x6527('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcc7305,_0x4b2cde){return function(_0x5c69d4){if(!_0x5c69d4){_0xcc7305[_0x6527('0x16')](0x194);}return _0x5c69d4;};}function handleError(_0x38b8be,_0x3130e6){_0x3130e6=_0x3130e6||0x1f4;return function(_0x4e3616){logger[_0x6527('0x26')](_0x4e3616[_0x6527('0x27')]);if(_0x4e3616[_0x6527('0x28')]){delete _0x4e3616[_0x6527('0x28')];}_0x38b8be[_0x6527('0x17')](_0x3130e6)[_0x6527('0x29')](_0x4e3616);};}exports['index']=function(_0x25b08b,_0x19f894){var _0x1ad33c={},_0x22e2dd={},_0x99997a={'count':0x0,'rows':[]};var _0x54ec7d=_[_0x6527('0x2a')](db[_0x6527('0x2b')]['rawAttributes'],function(_0x41016f){return{'name':_0x41016f[_0x6527('0x2c')],'type':_0x41016f[_0x6527('0x2d')][_0x6527('0x2e')]};});_0x22e2dd[_0x6527('0x2f')]=_[_0x6527('0x2a')](_0x54ec7d,_0x6527('0x28'));_0x22e2dd[_0x6527('0x30')]=_[_0x6527('0x31')](_0x25b08b['query']);_0x22e2dd[_0x6527('0x32')]=_[_0x6527('0x33')](_0x22e2dd[_0x6527('0x2f')],_0x22e2dd[_0x6527('0x30')]);_0x1ad33c['attributes']=_['intersection'](_0x22e2dd[_0x6527('0x2f')],qs['fields'](_0x25b08b[_0x6527('0x30')]['fields']));_0x1ad33c['attributes']=_0x1ad33c[_0x6527('0x34')][_0x6527('0x35')]?_0x1ad33c['attributes']:_0x22e2dd[_0x6527('0x2f')];if(!_0x25b08b[_0x6527('0x30')][_0x6527('0x36')](_0x6527('0x37'))){_0x1ad33c[_0x6527('0x1a')]=qs[_0x6527('0x1a')](_0x25b08b[_0x6527('0x30')][_0x6527('0x1a')]);_0x1ad33c[_0x6527('0x19')]=qs[_0x6527('0x19')](_0x25b08b['query'][_0x6527('0x19')]);}_0x1ad33c[_0x6527('0x38')]=qs['sort'](_0x25b08b[_0x6527('0x30')][_0x6527('0x39')]);_0x1ad33c[_0x6527('0x3a')]=qs['filters'](_[_0x6527('0x3b')](_0x25b08b[_0x6527('0x30')],_0x22e2dd[_0x6527('0x32')]),_0x54ec7d);if(_0x25b08b[_0x6527('0x30')]['filter']){_0x1ad33c['where']=_['merge'](_0x1ad33c[_0x6527('0x3a')],{'$or':_[_0x6527('0x2a')](_0x54ec7d,function(_0x49f82f){if(_0x49f82f[_0x6527('0x2d')]!==_0x6527('0x3c')){var _0xfe3517={};_0xfe3517[_0x49f82f[_0x6527('0x28')]]={'$like':'%'+_0x25b08b['query'][_0x6527('0x3d')]+'%'};return _0xfe3517;}})});}_0x1ad33c=_['merge']({},_0x1ad33c,_0x25b08b[_0x6527('0x3e')]);var _0x1e0e7c={'where':_0x1ad33c[_0x6527('0x3a')]};return db[_0x6527('0x2b')][_0x6527('0x1c')](_0x1e0e7c)[_0x6527('0x22')](function(_0x280dde){_0x99997a[_0x6527('0x1c')]=_0x280dde;if(_0x25b08b[_0x6527('0x30')][_0x6527('0x3f')]){_0x1ad33c[_0x6527('0x40')]=[{'all':!![]}];}return db[_0x6527('0x2b')][_0x6527('0x41')](_0x1ad33c);})[_0x6527('0x22')](function(_0xa904a0){_0x99997a[_0x6527('0x42')]=_0xa904a0;return _0x99997a;})[_0x6527('0x22')](respondWithFilteredResult(_0x19f894,_0x1ad33c))[_0x6527('0x43')](handleError(_0x19f894,null));};exports[_0x6527('0x44')]=function(_0xacffe3,_0x53b432){var _0x3af50f={'raw':![],'where':{'id':_0xacffe3[_0x6527('0x45')]['id']}},_0x11b103={};_0x11b103[_0x6527('0x2f')]=_[_0x6527('0x31')](db[_0x6527('0x2b')][_0x6527('0x46')]);_0x11b103[_0x6527('0x30')]=_[_0x6527('0x31')](_0xacffe3[_0x6527('0x30')]);_0x11b103[_0x6527('0x32')]=_[_0x6527('0x33')](_0x11b103[_0x6527('0x2f')],_0x11b103[_0x6527('0x30')]);_0x3af50f['attributes']=_['intersection'](_0x11b103[_0x6527('0x2f')],qs[_0x6527('0x47')](_0xacffe3[_0x6527('0x30')][_0x6527('0x47')]));_0x3af50f['attributes']=_0x3af50f[_0x6527('0x34')]['length']?_0x3af50f[_0x6527('0x34')]:_0x11b103[_0x6527('0x2f')];if(_0xacffe3[_0x6527('0x30')]['includeAll']){_0x3af50f['include']=[{'all':!![]}];}_0x3af50f=_[_0x6527('0x48')]({},_0x3af50f,_0xacffe3[_0x6527('0x3e')]);return db[_0x6527('0x2b')][_0x6527('0x49')](_0x3af50f)[_0x6527('0x22')](handleEntityNotFound(_0x53b432,null))['then'](respondWithResult(_0x53b432,null))['catch'](handleError(_0x53b432,null));};exports['create']=function(_0x51a105,_0x42752e){return db['JscriptyProject']['create'](_0x51a105[_0x6527('0x4a')],{})[_0x6527('0x22')](function(_0x576bac){var _0x529f9e=_0x51a105[_0x6527('0x4b')]['get']({'plain':!![]});if(!_0x529f9e)throw new Error(_0x6527('0x4c'));if(_0x529f9e[_0x6527('0x4d')]===_0x6527('0x4b')){var _0x3a10db=_0x576bac[_0x6527('0x24')]({'plain':!![]});var _0x227dcf=_0x6527('0x25');return db[_0x6527('0x4e')][_0x6527('0x49')]({'where':{'name':_0x227dcf,'userProfileId':_0x529f9e[_0x6527('0x4f')]},'raw':!![]})['then'](function(_0x5cb561){if(_0x5cb561&&_0x5cb561[_0x6527('0x50')]===0x0){return db[_0x6527('0x51')]['create']({'name':_0x3a10db[_0x6527('0x28')],'resourceId':_0x3a10db['id'],'type':_0x5cb561[_0x6527('0x28')],'sectionId':_0x5cb561['id']},{})[_0x6527('0x22')](function(){return _0x576bac;});}else{return _0x576bac;}})[_0x6527('0x43')](function(_0x113d33){logger['error'](_0x6527('0x52'),_0x113d33);throw _0x113d33;});}return _0x576bac;})[_0x6527('0x22')](respondWithResult(_0x42752e,0xc9))['catch'](handleError(_0x42752e,null));};exports['clone']=function(_0x4b6977,_0x2f6f54){var _0x4859c6={'where':{'id':_0x4b6977[_0x6527('0x45')]['id']}},_0x303a4b={};_0x303a4b['model']=_[_0x6527('0x31')](db[_0x6527('0x2b')][_0x6527('0x46')]);_0x4859c6['attributes']=_['intersection'](_0x303a4b[_0x6527('0x2f')],qs[_0x6527('0x47')](_0x4b6977[_0x6527('0x30')][_0x6527('0x47')]));_0x4859c6['attributes']=_0x4859c6['attributes'][_0x6527('0x35')]?_0x4859c6[_0x6527('0x34')]:_0x303a4b[_0x6527('0x2f')];if(_0x4b6977[_0x6527('0x30')][_0x6527('0x3f')]){_0x4859c6[_0x6527('0x40')]=[{'all':!![]}];}_0x4859c6=_[_0x6527('0x48')]({},_0x4859c6,_0x4b6977['options']);return db[_0x6527('0x2b')][_0x6527('0x49')](_0x4859c6)[_0x6527('0x22')](handleEntityNotFound(_0x2f6f54,null))[_0x6527('0x22')](function(_0x5c85e4){if(_0x5c85e4){var _0x1243e9=_0x5c85e4[_0x6527('0x24')]({'plain':!![]});_0x1243e9=qs['omit'](_0x1243e9,['id',_0x6527('0x53'),_0x6527('0x54')]);_0x4b6977[_0x6527('0x4a')]=_[_0x6527('0x55')](_0x4b6977[_0x6527('0x4a')],['id',_0x6527('0x53'),_0x6527('0x54')]);return db[_0x6527('0x2b')][_0x6527('0x56')](_['merge'](_0x1243e9,_0x4b6977[_0x6527('0x4a')]),{'include':_0x4b6977[_0x6527('0x30')][_0x6527('0x3f')]?[{'all':!![]}]:undefined})[_0x6527('0x22')](function(_0x1b9d82){var _0x82ade1=_0x4b6977['user'][_0x6527('0x24')]({'plain':!![]});if(!_0x82ade1)throw new Error(_0x6527('0x4c'));if(_0x82ade1[_0x6527('0x4d')]===_0x6527('0x4b')){var _0x2ac14e=_0x1b9d82[_0x6527('0x24')]({'plain':!![]});var _0x5d8206=_0x6527('0x25');return db[_0x6527('0x4e')]['find']({'where':{'name':_0x5d8206,'userProfileId':_0x82ade1[_0x6527('0x4f')]},'raw':!![]})[_0x6527('0x22')](function(_0x130a8b){if(_0x130a8b&&_0x130a8b['autoAssociation']===0x0){return db['UserProfileResource'][_0x6527('0x56')]({'name':_0x2ac14e['name'],'resourceId':_0x2ac14e['id'],'type':_0x130a8b[_0x6527('0x28')],'sectionId':_0x130a8b['id']},{})[_0x6527('0x22')](function(){return _0x1b9d82;});}else{return _0x1b9d82;}})['catch'](function(_0x4c6272){logger[_0x6527('0x26')](_0x6527('0x52'),_0x4c6272);throw _0x4c6272;});}return _0x1b9d82;});}})[_0x6527('0x22')](respondWithResult(_0x2f6f54,0xc9))[_0x6527('0x43')](handleError(_0x2f6f54,null));};exports['update']=function(_0x5864a8,_0x180104){if(_0x5864a8[_0x6527('0x4a')]['id']){delete _0x5864a8[_0x6527('0x4a')]['id'];}return db['JscriptyProject'][_0x6527('0x49')]({'where':{'id':_0x5864a8[_0x6527('0x45')]['id']}})['then'](handleEntityNotFound(_0x180104,null))[_0x6527('0x22')](saveUpdates(_0x5864a8[_0x6527('0x4a')],null))[_0x6527('0x22')](respondWithResult(_0x180104,null))[_0x6527('0x43')](handleError(_0x180104,null));};exports[_0x6527('0x23')]=function(_0x446e5e,_0x5bc4c6){return db[_0x6527('0x2b')][_0x6527('0x49')]({'where':{'id':_0x446e5e[_0x6527('0x45')]['id']}})[_0x6527('0x22')](handleEntityNotFound(_0x5bc4c6,null))[_0x6527('0x22')](removeEntity(_0x5bc4c6,null))['catch'](handleError(_0x5bc4c6,null));};exports['getSessions']=function(_0x367b08,_0x1f1f1e,_0x5e7bc5){var _0x2a5613={'raw':!![],'where':{}};var _0x346cb7={};var _0x17b4e4={'count':0x0,'rows':[]};return db[_0x6527('0x2b')][_0x6527('0x57')]({'where':{'id':_0x367b08[_0x6527('0x45')]['id']}})[_0x6527('0x22')](handleEntityNotFound(_0x1f1f1e,null))[_0x6527('0x22')](function(_0x26b784){if(_0x26b784){_0x346cb7[_0x6527('0x2f')]=_[_0x6527('0x31')](db['JscriptySessionReport']['rawAttributes']);_0x346cb7['query']=_['keys'](_0x367b08[_0x6527('0x30')]);_0x346cb7[_0x6527('0x32')]=_['intersection'](_0x346cb7[_0x6527('0x2f')],_0x346cb7[_0x6527('0x30')]);_0x2a5613[_0x6527('0x34')]=_[_0x6527('0x33')](_0x346cb7[_0x6527('0x2f')],qs[_0x6527('0x47')](_0x367b08[_0x6527('0x30')][_0x6527('0x47')]));_0x2a5613[_0x6527('0x34')]=_0x2a5613[_0x6527('0x34')][_0x6527('0x35')]?_0x2a5613[_0x6527('0x34')]:_0x346cb7[_0x6527('0x2f')];if(!_0x367b08[_0x6527('0x30')]['hasOwnProperty'](_0x6527('0x37'))){_0x2a5613[_0x6527('0x1a')]=qs[_0x6527('0x1a')](_0x367b08[_0x6527('0x30')][_0x6527('0x1a')]);_0x2a5613[_0x6527('0x19')]=qs['offset'](_0x367b08[_0x6527('0x30')]['offset']);}_0x2a5613[_0x6527('0x38')]=qs[_0x6527('0x39')](_0x367b08['query'][_0x6527('0x39')]);_0x2a5613[_0x6527('0x3a')]=qs[_0x6527('0x32')](_[_0x6527('0x3b')](_0x367b08[_0x6527('0x30')],_0x346cb7[_0x6527('0x32')]));_0x2a5613[_0x6527('0x3a')][_0x6527('0x58')]=_0x26b784['id'];if(_0x367b08[_0x6527('0x30')][_0x6527('0x3d')]){_0x2a5613[_0x6527('0x3a')]=_[_0x6527('0x48')](_0x2a5613[_0x6527('0x3a')],{'$or':_[_0x6527('0x2a')](_0x2a5613[_0x6527('0x34')],function(_0x5458c9){var _0x17de3c={};_0x17de3c[_0x5458c9]={'$like':'%'+_0x367b08['query']['filter']+'%'};return _0x17de3c;})});}_0x2a5613=_['merge']({},_0x2a5613,_0x367b08[_0x6527('0x3e')]);return db[_0x6527('0x59')][_0x6527('0x1c')]({'where':_0x2a5613[_0x6527('0x3a')]})[_0x6527('0x22')](function(_0x6c131){_0x17b4e4['count']=_0x6c131;if(_0x367b08[_0x6527('0x30')][_0x6527('0x3f')]){_0x2a5613[_0x6527('0x40')]=[{'all':!![]}];}return db[_0x6527('0x59')][_0x6527('0x41')](_0x2a5613);})['then'](function(_0x50fe07){_0x17b4e4[_0x6527('0x42')]=_0x50fe07;return _0x17b4e4;});}})['then'](respondWithFilteredResult(_0x1f1f1e,_0x2a5613))[_0x6527('0x43')](handleError(_0x1f1f1e,null));};exports[_0x6527('0x5a')]=function(_0x36a431,_0x5c0387,_0x3ce872){var _0x41f31f={'raw':!![],'where':{}};var _0x43e672={};var _0x511800={'count':0x0,'rows':[]};return db[_0x6527('0x2b')][_0x6527('0x57')]({'where':{'id':_0x36a431[_0x6527('0x45')]['id']}})[_0x6527('0x22')](handleEntityNotFound(_0x5c0387,null))[_0x6527('0x22')](function(_0x4cfdbf){if(_0x4cfdbf){_0x43e672[_0x6527('0x2f')]=_[_0x6527('0x31')](db[_0x6527('0x5b')][_0x6527('0x46')]);_0x43e672[_0x6527('0x30')]=_[_0x6527('0x31')](_0x36a431[_0x6527('0x30')]);_0x43e672['filters']=_[_0x6527('0x33')](_0x43e672['model'],_0x43e672[_0x6527('0x30')]);_0x41f31f[_0x6527('0x34')]=_[_0x6527('0x33')](_0x43e672['model'],qs[_0x6527('0x47')](_0x36a431[_0x6527('0x30')][_0x6527('0x47')]));_0x41f31f[_0x6527('0x34')]=_0x41f31f[_0x6527('0x34')][_0x6527('0x35')]?_0x41f31f[_0x6527('0x34')]:_0x43e672[_0x6527('0x2f')];if(!_0x36a431[_0x6527('0x30')][_0x6527('0x36')](_0x6527('0x37'))){_0x41f31f[_0x6527('0x1a')]=qs[_0x6527('0x1a')](_0x36a431[_0x6527('0x30')][_0x6527('0x1a')]);_0x41f31f[_0x6527('0x19')]=qs['offset'](_0x36a431['query'][_0x6527('0x19')]);}_0x41f31f[_0x6527('0x38')]=qs[_0x6527('0x39')](_0x36a431[_0x6527('0x30')]['sort']);_0x41f31f[_0x6527('0x3a')]=qs[_0x6527('0x32')](_[_0x6527('0x3b')](_0x36a431[_0x6527('0x30')],_0x43e672[_0x6527('0x32')]));_0x41f31f[_0x6527('0x3a')]['ProjectId']=_0x4cfdbf['id'];if(_0x36a431[_0x6527('0x30')][_0x6527('0x3d')]){_0x41f31f[_0x6527('0x3a')]=_[_0x6527('0x48')](_0x41f31f['where'],{'$or':_[_0x6527('0x2a')](_0x41f31f[_0x6527('0x34')],function(_0x344832){var _0x5e2eb9={};_0x5e2eb9[_0x344832]={'$like':'%'+_0x36a431['query']['filter']+'%'};return _0x5e2eb9;})});}_0x41f31f=_[_0x6527('0x48')]({},_0x41f31f,_0x36a431['options']);return db[_0x6527('0x5b')]['count']({'where':_0x41f31f[_0x6527('0x3a')]})['then'](function(_0x4548d7){_0x511800['count']=_0x4548d7;if(_0x36a431[_0x6527('0x30')]['includeAll']){_0x41f31f[_0x6527('0x40')]=[{'all':!![]}];}return db[_0x6527('0x5b')][_0x6527('0x41')](_0x41f31f);})[_0x6527('0x22')](function(_0x13572b){_0x511800[_0x6527('0x42')]=_0x13572b;return _0x511800;});}})['then'](respondWithFilteredResult(_0x5c0387,_0x41f31f))[_0x6527('0x43')](handleError(_0x5c0387,null));};function char(_0x41f8c6){return'number'===typeof _0x41f8c6?String['fromCharCode'][_0x6527('0x1f')](null,arguments):_0x41f8c6;}function needsEncapsulation(_0x5a8626){return!!_0x5a8626&&(_0x5a8626[_0x6527('0x5c')]()[_0x6527('0x5d')](char(0xd))>=0x0||_0x5a8626[_0x6527('0x5c')]()[_0x6527('0x5d')](char(0xa))>=0x0||_0x5a8626[_0x6527('0x5c')]()[_0x6527('0x5d')](char(0x2c))>=0x0||_0x5a8626[_0x6527('0x5c')]()[_0x6527('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x28b084){var _0x1de6b3=char(0x22),_0x4f228c='\x5c'+char(0x22),_0xa6dea7=_0x28b084[_0x6527('0x5c')]()[_0x6527('0x5e')](new RegExp(_0x1de6b3,'g'),_0x4f228c);return _0x1de6b3+_0xa6dea7+_0x1de6b3;}exports[_0x6527('0x5f')]=function(_0x3dbcf0,_0x213470,_0x117dc2){var _0x47268a,_0x3d215e;var _0x4f24c2={'where':{'ProjectId':_0x3dbcf0[_0x6527('0x45')]['id']}};if(_0x3dbcf0[_0x6527('0x30')][_0x6527('0x60')]){_0x4f24c2[_0x6527('0x3a')]['starttime']=JSON['parse'](_0x3dbcf0['query'][_0x6527('0x60')]);}return db[_0x6527('0x59')][_0x6527('0x41')](_0x4f24c2)[_0x6527('0x22')](handleEntityNotFound(_0x213470,null))[_0x6527('0x22')](function(_0x405843){if(_0x405843){_0x47268a=_0x405843;return db[_0x6527('0x61')][_0x6527('0x41')]({'where':{'SessionId':{'$in':_[_0x6527('0x2a')](_0x47268a,'id')},'ProjectId':_0x3dbcf0[_0x6527('0x45')]['id']},'order':_0x6527('0x62')});}})[_0x6527('0x22')](handleEntityNotFound(_0x213470,null))['then'](function(_0xcbc9d7){if(_0xcbc9d7){_0x3d215e=_0xcbc9d7;var _0x2419db={};for(var _0x4aa719=0x0,_0x1972ec=_0x3d215e['length'];_0x4aa719<_0x1972ec;_0x4aa719++){if(!_0x2419db[_0x6527('0x36')](_0x3d215e[_0x4aa719]['questionId'])){_0x2419db[_0x3d215e[_0x4aa719][_0x6527('0x63')]]=needsEncapsulation(_0x3d215e[_0x4aa719]['question'])?encapsulate(_0x3d215e[_0x4aa719][_0x6527('0x64')]):_0x3d215e[_0x4aa719]['question'];}}var _0x550ca4=[],_0x2a08a1={};for(var _0x149b24=0x0,_0x45de31=_0x47268a[_0x6527('0x35')];_0x149b24<_0x45de31;_0x149b24++){_0x2a08a1={'ProjectId':_0x3dbcf0['params']['id'],'SessionId':_0x47268a[_0x149b24]['id'],'StartTime':moment(_0x47268a[_0x149b24][_0x6527('0x65')])[_0x6527('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x40a73c=0x0,_0x120dbd=_0x3d215e['length'];_0x40a73c<_0x120dbd;_0x40a73c++){if(_0x3d215e[_0x40a73c]['SessionId']==_0x47268a[_0x149b24]['id']&&_0x2419db['hasOwnProperty'](_0x3d215e[_0x40a73c]['questionId'])){_0x2a08a1[_0x2419db[_0x3d215e[_0x40a73c][_0x6527('0x63')]]]=_0x3d215e[_0x40a73c][_0x6527('0x67')];}}for(var _0x344d3a in _0x2419db){if(!_0x2a08a1['hasOwnProperty'](_0x2419db[_0x344d3a])){_0x2a08a1[_0x2419db[_0x344d3a]]=null;}}_0x550ca4[_0x6527('0x68')](_0x2a08a1);}return _0x550ca4;}})[_0x6527('0x22')](function(_0x4f1272){if(!_[_0x6527('0x69')](_0x4f1272)){var _0x3ee2cf=toCsv(_0x4f1272);var _0x5a87d=Date[_0x6527('0x6a')]();fs[_0x6527('0x6b')](util['format'](_0x6527('0x6c'),_0x3dbcf0[_0x6527('0x45')]['id'],_0x5a87d),_0x3ee2cf);_0x213470[_0x6527('0x6d')](_0x6527('0x6e'),_0x6527('0x6f')+util[_0x6527('0x66')](_0x6527('0x70'),_0x3dbcf0[_0x6527('0x45')]['id'],_0x5a87d));_0x213470[_0x6527('0x6d')](_0x6527('0x71'),'text/csv');return _0x213470[_0x6527('0x72')](util['format'](_0x6527('0x6c'),_0x3dbcf0[_0x6527('0x45')]['id'],_0x5a87d));}else{return _0x213470[_0x6527('0x16')](0xcc);}})[_0x6527('0x43')](handleError(_0x213470,null));}; \ No newline at end of file +var _0x21c9=['error','name','map','JscriptyProject','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','JscriptySessionReport','ProjectId','findAll','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','get','Projects','UserProfileResource','end'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x21c9,0x19e));var _0x921c=function(_0x2c20e7,_0x218066){_0x2c20e7=_0x2c20e7-0x0;var _0x38f9c2=_0x21c9[_0x2c20e7];return _0x38f9c2;};'use strict';var emlformat=require(_0x921c('0x0'));var rimraf=require(_0x921c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x921c('0x2'));var Mustache=require(_0x921c('0x3'));var util=require('util');var path=require(_0x921c('0x4'));var sox=require(_0x921c('0x5'));var csv=require(_0x921c('0x6'));var ejs=require(_0x921c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x921c('0x8'));var squel=require(_0x921c('0x9'));var crypto=require('crypto');var jsforce=require(_0x921c('0xa'));var deskjs=require(_0x921c('0xb'));var toCsv=require(_0x921c('0x6'));var querystring=require('querystring');var Papa=require(_0x921c('0xc'));var Redis=require('ioredis');var authService=require(_0x921c('0xd'));var qs=require(_0x921c('0xe'));var as=require(_0x921c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x921c('0x10'));var utils=require(_0x921c('0x11'));var config=require(_0x921c('0x12'));var licenseUtil=require(_0x921c('0x13'));var db=require(_0x921c('0x14'))['db'];function respondWithStatusCode(_0x2d2900,_0x35e2a5){_0x35e2a5=_0x35e2a5||0xcc;return function(_0x27c911){if(_0x27c911){return _0x2d2900[_0x921c('0x15')](_0x35e2a5);}return _0x2d2900['status'](_0x35e2a5)['end']();};}function respondWithResult(_0x30f963,_0x23078c){_0x23078c=_0x23078c||0xc8;return function(_0x3844f4){if(_0x3844f4){return _0x30f963[_0x921c('0x16')](_0x23078c)[_0x921c('0x17')](_0x3844f4);}};}function respondWithFilteredResult(_0x5ceefa,_0x4625af){return function(_0xe10db5){if(_0xe10db5){var _0x4d9138=typeof _0x4625af[_0x921c('0x18')]==='undefined'&&typeof _0x4625af[_0x921c('0x19')]===_0x921c('0x1a');var _0x37741c=_0xe10db5[_0x921c('0x1b')];var _0x48b227=_0x4d9138?0x0:_0x4625af['offset'];var _0x2bf896=_0x4d9138?_0xe10db5[_0x921c('0x1b')]:_0x4625af[_0x921c('0x18')]+_0x4625af['limit'];var _0x6dda6;if(_0x2bf896>=_0x37741c){_0x2bf896=_0x37741c;_0x6dda6=0xc8;}else{_0x6dda6=0xce;}_0x5ceefa['status'](_0x6dda6);return _0x5ceefa[_0x921c('0x1c')]('Content-Range',_0x48b227+'-'+_0x2bf896+'/'+_0x37741c)[_0x921c('0x17')](_0xe10db5);}return null;};}function patchUpdates(_0x5e629f){return function(_0x269383){try{jsonpatch[_0x921c('0x1d')](_0x269383,_0x5e629f,!![]);}catch(_0x270e2c){return BPromise[_0x921c('0x1e')](_0x270e2c);}return _0x269383[_0x921c('0x1f')]();};}function saveUpdates(_0x554eda,_0x203cda){return function(_0x218710){if(_0x218710){return _0x218710['update'](_0x554eda)[_0x921c('0x20')](function(_0x17178e){return _0x17178e;});}return null;};}function removeEntity(_0xc82ef4,_0x6f912c){return function(_0x5d3a8f){if(_0x5d3a8f){return _0x5d3a8f[_0x921c('0x21')]()['then'](function(){var _0x119466=_0x5d3a8f[_0x921c('0x22')]({'plain':!![]});var _0x1cf7f8=_0x921c('0x23');return db[_0x921c('0x24')][_0x921c('0x21')]({'where':{'type':_0x1cf7f8,'resourceId':_0x119466['id']}})['then'](function(){return _0x5d3a8f;});})[_0x921c('0x20')](function(){_0xc82ef4[_0x921c('0x16')](0xcc)[_0x921c('0x25')]();});}};}function handleEntityNotFound(_0x3599b5,_0x3649dc){return function(_0x4a8ebc){if(!_0x4a8ebc){_0x3599b5['sendStatus'](0x194);}return _0x4a8ebc;};}function handleError(_0x239f2d,_0x1d356b){_0x1d356b=_0x1d356b||0x1f4;return function(_0x36cf2e){logger[_0x921c('0x26')](_0x36cf2e['stack']);if(_0x36cf2e[_0x921c('0x27')]){delete _0x36cf2e[_0x921c('0x27')];}_0x239f2d[_0x921c('0x16')](_0x1d356b)['send'](_0x36cf2e);};}exports['index']=function(_0x204600,_0xbbda5f){var _0x50238f={},_0x30e483={},_0x2e205f={'count':0x0,'rows':[]};var _0x3a4eb6=_[_0x921c('0x28')](db[_0x921c('0x29')]['rawAttributes'],function(_0x5da36f){return{'name':_0x5da36f['fieldName'],'type':_0x5da36f[_0x921c('0x2a')][_0x921c('0x2b')]};});_0x30e483['model']=_['map'](_0x3a4eb6,'name');_0x30e483['query']=_[_0x921c('0x2c')](_0x204600[_0x921c('0x2d')]);_0x30e483[_0x921c('0x2e')]=_[_0x921c('0x2f')](_0x30e483[_0x921c('0x30')],_0x30e483[_0x921c('0x2d')]);_0x50238f[_0x921c('0x31')]=_['intersection'](_0x30e483[_0x921c('0x30')],qs[_0x921c('0x32')](_0x204600['query'][_0x921c('0x32')]));_0x50238f['attributes']=_0x50238f['attributes'][_0x921c('0x33')]?_0x50238f[_0x921c('0x31')]:_0x30e483[_0x921c('0x30')];if(!_0x204600[_0x921c('0x2d')][_0x921c('0x34')](_0x921c('0x35'))){_0x50238f[_0x921c('0x19')]=qs[_0x921c('0x19')](_0x204600[_0x921c('0x2d')][_0x921c('0x19')]);_0x50238f[_0x921c('0x18')]=qs[_0x921c('0x18')](_0x204600['query']['offset']);}_0x50238f[_0x921c('0x36')]=qs[_0x921c('0x37')](_0x204600[_0x921c('0x2d')][_0x921c('0x37')]);_0x50238f[_0x921c('0x38')]=qs[_0x921c('0x2e')](_[_0x921c('0x39')](_0x204600[_0x921c('0x2d')],_0x30e483[_0x921c('0x2e')]),_0x3a4eb6);if(_0x204600['query'][_0x921c('0x3a')]){_0x50238f[_0x921c('0x38')]=_[_0x921c('0x3b')](_0x50238f[_0x921c('0x38')],{'$or':_[_0x921c('0x28')](_0x3a4eb6,function(_0x1efb9b){if(_0x1efb9b[_0x921c('0x2a')]!==_0x921c('0x3c')){var _0x84337f={};_0x84337f[_0x1efb9b['name']]={'$like':'%'+_0x204600['query'][_0x921c('0x3a')]+'%'};return _0x84337f;}})});}_0x50238f=_[_0x921c('0x3b')]({},_0x50238f,_0x204600['options']);var _0x2185f5={'where':_0x50238f[_0x921c('0x38')]};return db[_0x921c('0x29')][_0x921c('0x1b')](_0x2185f5)[_0x921c('0x20')](function(_0x4fe96d){_0x2e205f[_0x921c('0x1b')]=_0x4fe96d;if(_0x204600[_0x921c('0x2d')][_0x921c('0x3d')]){_0x50238f[_0x921c('0x3e')]=[{'all':!![]}];}return db[_0x921c('0x29')]['findAll'](_0x50238f);})[_0x921c('0x20')](function(_0x39de6e){_0x2e205f[_0x921c('0x3f')]=_0x39de6e;return _0x2e205f;})['then'](respondWithFilteredResult(_0xbbda5f,_0x50238f))['catch'](handleError(_0xbbda5f,null));};exports[_0x921c('0x40')]=function(_0x3387b9,_0x28efc2){var _0x16c51e={'raw':![],'where':{'id':_0x3387b9[_0x921c('0x41')]['id']}},_0x163e3b={};_0x163e3b[_0x921c('0x30')]=_[_0x921c('0x2c')](db[_0x921c('0x29')][_0x921c('0x42')]);_0x163e3b[_0x921c('0x2d')]=_['keys'](_0x3387b9[_0x921c('0x2d')]);_0x163e3b[_0x921c('0x2e')]=_[_0x921c('0x2f')](_0x163e3b[_0x921c('0x30')],_0x163e3b[_0x921c('0x2d')]);_0x16c51e['attributes']=_[_0x921c('0x2f')](_0x163e3b[_0x921c('0x30')],qs['fields'](_0x3387b9['query']['fields']));_0x16c51e[_0x921c('0x31')]=_0x16c51e[_0x921c('0x31')][_0x921c('0x33')]?_0x16c51e[_0x921c('0x31')]:_0x163e3b[_0x921c('0x30')];if(_0x3387b9['query'][_0x921c('0x3d')]){_0x16c51e[_0x921c('0x3e')]=[{'all':!![]}];}_0x16c51e=_[_0x921c('0x3b')]({},_0x16c51e,_0x3387b9[_0x921c('0x43')]);return db[_0x921c('0x29')][_0x921c('0x44')](_0x16c51e)[_0x921c('0x20')](handleEntityNotFound(_0x28efc2,null))['then'](respondWithResult(_0x28efc2,null))[_0x921c('0x45')](handleError(_0x28efc2,null));};exports['create']=function(_0x1a2947,_0x4d5ef4){return db[_0x921c('0x29')][_0x921c('0x46')](_0x1a2947[_0x921c('0x47')],{})['then'](function(_0x5d238f){var _0x1509fe=_0x1a2947[_0x921c('0x48')][_0x921c('0x22')]({'plain':!![]});if(!_0x1509fe)throw new Error(_0x921c('0x49'));if(_0x1509fe[_0x921c('0x4a')]===_0x921c('0x48')){var _0x52c9cb=_0x5d238f[_0x921c('0x22')]({'plain':!![]});var _0x35d0bd=_0x921c('0x23');return db[_0x921c('0x4b')][_0x921c('0x44')]({'where':{'name':_0x35d0bd,'userProfileId':_0x1509fe[_0x921c('0x4c')]},'raw':!![]})[_0x921c('0x20')](function(_0x370c2a){if(_0x370c2a&&_0x370c2a[_0x921c('0x4d')]===0x0){return db[_0x921c('0x24')][_0x921c('0x46')]({'name':_0x52c9cb[_0x921c('0x27')],'resourceId':_0x52c9cb['id'],'type':_0x370c2a['name'],'sectionId':_0x370c2a['id']},{})['then'](function(){return _0x5d238f;});}else{return _0x5d238f;}})[_0x921c('0x45')](function(_0x190a6a){logger[_0x921c('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x190a6a);throw _0x190a6a;});}return _0x5d238f;})[_0x921c('0x20')](respondWithResult(_0x4d5ef4,0xc9))[_0x921c('0x45')](handleError(_0x4d5ef4,null));};exports[_0x921c('0x4e')]=function(_0x499d1c,_0x3c4ac1){var _0x19036a={'where':{'id':_0x499d1c[_0x921c('0x41')]['id']}},_0x52db1e={};_0x52db1e[_0x921c('0x30')]=_[_0x921c('0x2c')](db[_0x921c('0x29')][_0x921c('0x42')]);_0x19036a['attributes']=_['intersection'](_0x52db1e[_0x921c('0x30')],qs[_0x921c('0x32')](_0x499d1c[_0x921c('0x2d')]['fields']));_0x19036a[_0x921c('0x31')]=_0x19036a[_0x921c('0x31')][_0x921c('0x33')]?_0x19036a[_0x921c('0x31')]:_0x52db1e['model'];if(_0x499d1c['query'][_0x921c('0x3d')]){_0x19036a['include']=[{'all':!![]}];}_0x19036a=_[_0x921c('0x3b')]({},_0x19036a,_0x499d1c[_0x921c('0x43')]);return db[_0x921c('0x29')][_0x921c('0x44')](_0x19036a)[_0x921c('0x20')](handleEntityNotFound(_0x3c4ac1,null))[_0x921c('0x20')](function(_0x37e28f){if(_0x37e28f){var _0x4b68b0=_0x37e28f[_0x921c('0x22')]({'plain':!![]});_0x4b68b0=qs[_0x921c('0x4f')](_0x4b68b0,['id',_0x921c('0x50'),_0x921c('0x51')]);_0x499d1c['body']=_[_0x921c('0x4f')](_0x499d1c[_0x921c('0x47')],['id',_0x921c('0x50'),_0x921c('0x51')]);return db[_0x921c('0x29')][_0x921c('0x46')](_[_0x921c('0x3b')](_0x4b68b0,_0x499d1c[_0x921c('0x47')]),{'include':_0x499d1c[_0x921c('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x921c('0x20')](function(_0x2fac83){var _0x35a445=_0x499d1c[_0x921c('0x48')][_0x921c('0x22')]({'plain':!![]});if(!_0x35a445)throw new Error(_0x921c('0x49'));if(_0x35a445[_0x921c('0x4a')]===_0x921c('0x48')){var _0x2d7b1c=_0x2fac83[_0x921c('0x22')]({'plain':!![]});var _0x32274f=_0x921c('0x23');return db['UserProfileSection'][_0x921c('0x44')]({'where':{'name':_0x32274f,'userProfileId':_0x35a445[_0x921c('0x4c')]},'raw':!![]})[_0x921c('0x20')](function(_0xfba0d4){if(_0xfba0d4&&_0xfba0d4[_0x921c('0x4d')]===0x0){return db[_0x921c('0x24')][_0x921c('0x46')]({'name':_0x2d7b1c[_0x921c('0x27')],'resourceId':_0x2d7b1c['id'],'type':_0xfba0d4['name'],'sectionId':_0xfba0d4['id']},{})[_0x921c('0x20')](function(){return _0x2fac83;});}else{return _0x2fac83;}})[_0x921c('0x45')](function(_0x6e4ddc){logger[_0x921c('0x26')](_0x921c('0x52'),_0x6e4ddc);throw _0x6e4ddc;});}return _0x2fac83;});}})[_0x921c('0x20')](respondWithResult(_0x3c4ac1,0xc9))[_0x921c('0x45')](handleError(_0x3c4ac1,null));};exports['update']=function(_0x21de57,_0x449590){if(_0x21de57[_0x921c('0x47')]['id']){delete _0x21de57[_0x921c('0x47')]['id'];}return db[_0x921c('0x29')][_0x921c('0x44')]({'where':{'id':_0x21de57[_0x921c('0x41')]['id']}})['then'](handleEntityNotFound(_0x449590,null))[_0x921c('0x20')](saveUpdates(_0x21de57['body'],null))[_0x921c('0x20')](respondWithResult(_0x449590,null))[_0x921c('0x45')](handleError(_0x449590,null));};exports[_0x921c('0x21')]=function(_0x5b4f64,_0x2d4f3b){return db['JscriptyProject'][_0x921c('0x44')]({'where':{'id':_0x5b4f64['params']['id']}})[_0x921c('0x20')](handleEntityNotFound(_0x2d4f3b,null))['then'](removeEntity(_0x2d4f3b,null))[_0x921c('0x45')](handleError(_0x2d4f3b,null));};exports['getSessions']=function(_0x23e5c1,_0x1ef768,_0x32c509){var _0x5f19ac={'raw':!![],'where':{}};var _0x35de00={};var _0x33c1d5={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x921c('0x53')]({'where':{'id':_0x23e5c1[_0x921c('0x41')]['id']}})[_0x921c('0x20')](handleEntityNotFound(_0x1ef768,null))[_0x921c('0x20')](function(_0x360a9a){if(_0x360a9a){_0x35de00[_0x921c('0x30')]=_['keys'](db[_0x921c('0x54')][_0x921c('0x42')]);_0x35de00[_0x921c('0x2d')]=_['keys'](_0x23e5c1[_0x921c('0x2d')]);_0x35de00[_0x921c('0x2e')]=_['intersection'](_0x35de00[_0x921c('0x30')],_0x35de00['query']);_0x5f19ac[_0x921c('0x31')]=_[_0x921c('0x2f')](_0x35de00['model'],qs[_0x921c('0x32')](_0x23e5c1[_0x921c('0x2d')][_0x921c('0x32')]));_0x5f19ac[_0x921c('0x31')]=_0x5f19ac['attributes'][_0x921c('0x33')]?_0x5f19ac[_0x921c('0x31')]:_0x35de00['model'];if(!_0x23e5c1[_0x921c('0x2d')]['hasOwnProperty']('nolimit')){_0x5f19ac[_0x921c('0x19')]=qs[_0x921c('0x19')](_0x23e5c1[_0x921c('0x2d')]['limit']);_0x5f19ac[_0x921c('0x18')]=qs['offset'](_0x23e5c1['query'][_0x921c('0x18')]);}_0x5f19ac['order']=qs[_0x921c('0x37')](_0x23e5c1[_0x921c('0x2d')][_0x921c('0x37')]);_0x5f19ac[_0x921c('0x38')]=qs[_0x921c('0x2e')](_['pick'](_0x23e5c1[_0x921c('0x2d')],_0x35de00[_0x921c('0x2e')]));_0x5f19ac['where'][_0x921c('0x55')]=_0x360a9a['id'];if(_0x23e5c1['query'][_0x921c('0x3a')]){_0x5f19ac['where']=_['merge'](_0x5f19ac[_0x921c('0x38')],{'$or':_[_0x921c('0x28')](_0x5f19ac[_0x921c('0x31')],function(_0xdfeebd){var _0xf2d8d={};_0xf2d8d[_0xdfeebd]={'$like':'%'+_0x23e5c1[_0x921c('0x2d')]['filter']+'%'};return _0xf2d8d;})});}_0x5f19ac=_['merge']({},_0x5f19ac,_0x23e5c1[_0x921c('0x43')]);return db[_0x921c('0x54')][_0x921c('0x1b')]({'where':_0x5f19ac[_0x921c('0x38')]})[_0x921c('0x20')](function(_0x38a6c8){_0x33c1d5[_0x921c('0x1b')]=_0x38a6c8;if(_0x23e5c1['query']['includeAll']){_0x5f19ac['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x921c('0x56')](_0x5f19ac);})['then'](function(_0x58e547){_0x33c1d5[_0x921c('0x3f')]=_0x58e547;return _0x33c1d5;});}})[_0x921c('0x20')](respondWithFilteredResult(_0x1ef768,_0x5f19ac))['catch'](handleError(_0x1ef768,null));};exports[_0x921c('0x57')]=function(_0x217abd,_0x2c0d11,_0x16a553){var _0x33b76d={'raw':!![],'where':{}};var _0x9c8255={};var _0x4aa0ba={'count':0x0,'rows':[]};return db[_0x921c('0x29')][_0x921c('0x53')]({'where':{'id':_0x217abd[_0x921c('0x41')]['id']}})[_0x921c('0x20')](handleEntityNotFound(_0x2c0d11,null))[_0x921c('0x20')](function(_0x1bdcd7){if(_0x1bdcd7){_0x9c8255[_0x921c('0x30')]=_[_0x921c('0x2c')](db[_0x921c('0x58')][_0x921c('0x42')]);_0x9c8255['query']=_[_0x921c('0x2c')](_0x217abd[_0x921c('0x2d')]);_0x9c8255['filters']=_['intersection'](_0x9c8255[_0x921c('0x30')],_0x9c8255[_0x921c('0x2d')]);_0x33b76d[_0x921c('0x31')]=_[_0x921c('0x2f')](_0x9c8255['model'],qs[_0x921c('0x32')](_0x217abd[_0x921c('0x2d')][_0x921c('0x32')]));_0x33b76d[_0x921c('0x31')]=_0x33b76d[_0x921c('0x31')][_0x921c('0x33')]?_0x33b76d['attributes']:_0x9c8255['model'];if(!_0x217abd[_0x921c('0x2d')][_0x921c('0x34')](_0x921c('0x35'))){_0x33b76d[_0x921c('0x19')]=qs['limit'](_0x217abd[_0x921c('0x2d')][_0x921c('0x19')]);_0x33b76d[_0x921c('0x18')]=qs[_0x921c('0x18')](_0x217abd[_0x921c('0x2d')]['offset']);}_0x33b76d[_0x921c('0x36')]=qs[_0x921c('0x37')](_0x217abd['query']['sort']);_0x33b76d[_0x921c('0x38')]=qs[_0x921c('0x2e')](_[_0x921c('0x39')](_0x217abd['query'],_0x9c8255[_0x921c('0x2e')]));_0x33b76d[_0x921c('0x38')]['ProjectId']=_0x1bdcd7['id'];if(_0x217abd[_0x921c('0x2d')][_0x921c('0x3a')]){_0x33b76d[_0x921c('0x38')]=_[_0x921c('0x3b')](_0x33b76d['where'],{'$or':_[_0x921c('0x28')](_0x33b76d['attributes'],function(_0x31c8e2){var _0x489071={};_0x489071[_0x31c8e2]={'$like':'%'+_0x217abd[_0x921c('0x2d')][_0x921c('0x3a')]+'%'};return _0x489071;})});}_0x33b76d=_[_0x921c('0x3b')]({},_0x33b76d,_0x217abd[_0x921c('0x43')]);return db['JscriptyAnswerReport'][_0x921c('0x1b')]({'where':_0x33b76d['where']})[_0x921c('0x20')](function(_0x24972d){_0x4aa0ba[_0x921c('0x1b')]=_0x24972d;if(_0x217abd[_0x921c('0x2d')][_0x921c('0x3d')]){_0x33b76d['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x921c('0x56')](_0x33b76d);})[_0x921c('0x20')](function(_0x4deddc){_0x4aa0ba[_0x921c('0x3f')]=_0x4deddc;return _0x4aa0ba;});}})[_0x921c('0x20')](respondWithFilteredResult(_0x2c0d11,_0x33b76d))['catch'](handleError(_0x2c0d11,null));};function char(_0x548f5b){return'number'===typeof _0x548f5b?String[_0x921c('0x59')][_0x921c('0x1d')](null,arguments):_0x548f5b;}function needsEncapsulation(_0x239a73){return!!_0x239a73&&(_0x239a73[_0x921c('0x5a')]()['indexOf'](char(0xd))>=0x0||_0x239a73[_0x921c('0x5a')]()[_0x921c('0x5b')](char(0xa))>=0x0||_0x239a73[_0x921c('0x5a')]()['indexOf'](char(0x2c))>=0x0||_0x239a73[_0x921c('0x5a')]()[_0x921c('0x5b')](char(0x22))>=0x0);}function encapsulate(_0x4682ca){var _0x51e4e1=char(0x22),_0x3fb3c4='\x5c'+char(0x22),_0x37325b=_0x4682ca[_0x921c('0x5a')]()[_0x921c('0x5c')](new RegExp(_0x51e4e1,'g'),_0x3fb3c4);return _0x51e4e1+_0x37325b+_0x51e4e1;}exports[_0x921c('0x5d')]=function(_0x638017,_0x1e403e,_0x44aafb){var _0x3d77bd,_0x3ef0c4;var _0x131e2d={'where':{'ProjectId':_0x638017[_0x921c('0x41')]['id']}};if(_0x638017[_0x921c('0x2d')][_0x921c('0x5e')]){_0x131e2d[_0x921c('0x38')]['starttime']=JSON['parse'](_0x638017[_0x921c('0x2d')][_0x921c('0x5e')]);}return db[_0x921c('0x54')][_0x921c('0x56')](_0x131e2d)[_0x921c('0x20')](handleEntityNotFound(_0x1e403e,null))['then'](function(_0x2e26b1){if(_0x2e26b1){_0x3d77bd=_0x2e26b1;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_['map'](_0x3d77bd,'id')},'ProjectId':_0x638017[_0x921c('0x41')]['id']},'order':_0x921c('0x5f')});}})[_0x921c('0x20')](handleEntityNotFound(_0x1e403e,null))[_0x921c('0x20')](function(_0x121ffb){if(_0x121ffb){_0x3ef0c4=_0x121ffb;var _0x216fa1={};for(var _0x688914=0x0,_0x5af810=_0x3ef0c4['length'];_0x688914<_0x5af810;_0x688914++){if(!_0x216fa1[_0x921c('0x34')](_0x3ef0c4[_0x688914][_0x921c('0x60')])){_0x216fa1[_0x3ef0c4[_0x688914][_0x921c('0x60')]]=needsEncapsulation(_0x3ef0c4[_0x688914][_0x921c('0x61')])?encapsulate(_0x3ef0c4[_0x688914]['question']):_0x3ef0c4[_0x688914]['question'];}}var _0x156ca7=[],_0x96fa82={};for(var _0x22bbb4=0x0,_0x265409=_0x3d77bd[_0x921c('0x33')];_0x22bbb4<_0x265409;_0x22bbb4++){_0x96fa82={'ProjectId':_0x638017[_0x921c('0x41')]['id'],'SessionId':_0x3d77bd[_0x22bbb4]['id'],'StartTime':moment(_0x3d77bd[_0x22bbb4][_0x921c('0x62')])[_0x921c('0x63')](_0x921c('0x64'))};for(var _0x1d2e4f=0x0,_0x1606fb=_0x3ef0c4[_0x921c('0x33')];_0x1d2e4f<_0x1606fb;_0x1d2e4f++){if(_0x3ef0c4[_0x1d2e4f][_0x921c('0x65')]==_0x3d77bd[_0x22bbb4]['id']&&_0x216fa1[_0x921c('0x34')](_0x3ef0c4[_0x1d2e4f]['questionId'])){_0x96fa82[_0x216fa1[_0x3ef0c4[_0x1d2e4f][_0x921c('0x60')]]]=_0x3ef0c4[_0x1d2e4f][_0x921c('0x66')];}}for(var _0x7f373b in _0x216fa1){if(!_0x96fa82[_0x921c('0x34')](_0x216fa1[_0x7f373b])){_0x96fa82[_0x216fa1[_0x7f373b]]=null;}}_0x156ca7[_0x921c('0x67')](_0x96fa82);}return _0x156ca7;}})[_0x921c('0x20')](function(_0x1e5390){if(!_[_0x921c('0x68')](_0x1e5390)){var _0x48a87a=toCsv(_0x1e5390);var _0x2d188b=Date['now']();fs[_0x921c('0x69')](util[_0x921c('0x63')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x638017[_0x921c('0x41')]['id'],_0x2d188b),_0x48a87a);_0x1e403e['setHeader'](_0x921c('0x6a'),_0x921c('0x6b')+util['format'](_0x921c('0x6c'),_0x638017[_0x921c('0x41')]['id'],_0x2d188b));_0x1e403e[_0x921c('0x6d')](_0x921c('0x6e'),_0x921c('0x6f'));return _0x1e403e[_0x921c('0x70')](util[_0x921c('0x63')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x638017['params']['id'],_0x2d188b));}else{return _0x1e403e['sendStatus'](0xcc);}})[_0x921c('0x45')](handleError(_0x1e403e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 3f89aac..bf99eb8 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 _0xe77f=['request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects','lodash','util','api','moment'];(function(_0x44d31a,_0x4544ce){var _0x395e3c=function(_0x1dec4f){while(--_0x1dec4f){_0x44d31a['push'](_0x44d31a['shift']());}};_0x395e3c(++_0x4544ce);}(_0xe77f,0xba));var _0xfe77=function(_0x15336e,_0x1be967){_0x15336e=_0x15336e-0x0;var _0x173768=_0xe77f[_0x15336e];return _0x173768;};'use strict';var _=require(_0xfe77('0x0'));var util=require(_0xfe77('0x1'));var logger=require('../../config/logger')(_0xfe77('0x2'));var moment=require(_0xfe77('0x3'));var BPromise=require('bluebird');var rp=require(_0xfe77('0x4'));var fs=require('fs');var path=require(_0xfe77('0x5'));var rimraf=require('rimraf');var config=require(_0xfe77('0x6'));var attributes=require(_0xfe77('0x7'));module[_0xfe77('0x8')]=function(_0x1ce970,_0x130b85){return _0x1ce970['define']('JscriptyProject',attributes,{'tableName':_0xfe77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ce=['define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','request-promise','./jscriptyProject.attributes','exports'];(function(_0x5a54cf,_0x5b7f0c){var _0x25c04d=function(_0x2c66ea){while(--_0x2c66ea){_0x5a54cf['push'](_0x5a54cf['shift']());}};_0x25c04d(++_0x5b7f0c);}(_0xd7ce,0x16b));var _0xed7c=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0xd7ce[_0x36940e];return _0x3283f2;};'use strict';var _=require(_0xed7c('0x0'));var util=require(_0xed7c('0x1'));var logger=require(_0xed7c('0x2'))(_0xed7c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xed7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed7c('0x5'));module[_0xed7c('0x6')]=function(_0x194d4b,_0x1aa7a0){return _0x194d4b[_0xed7c('0x7')](_0xed7c('0x8'),attributes,{'tableName':_0xed7c('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 f8961b3..69e1f1d 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 _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x47d606,_0x4fa6b6){var _0x1520be=function(_0x4b92fc){while(--_0x4b92fc){_0x47d606['push'](_0x47d606['shift']());}};_0x1520be(++_0x4fa6b6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x429b26,_0x5af647){_0x429b26=_0x429b26-0x0;var _0x76b21a=_0xf4eb[_0x429b26];return _0x76b21a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x7d36ab,_0x1cd7d3){var _0x459ed6=function(_0x4a36ed){while(--_0x4a36ed){_0x7d36ab['push'](_0x7d36ab['shift']());}};_0x459ed6(++_0x1cd7d3);}(_0x54ef,0x112));var _0xf54e=function(_0x63a25d,_0x51817b){_0x63a25d=_0x63a25d-0x0;var _0x58ab82=_0x54ef[_0x63a25d];return _0x58ab82;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 31cd7d4..1c596a7 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 _0x537d=['isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./jscriptyQuestionReport.controller'];(function(_0x5d51f4,_0x1da285){var _0x4114d4=function(_0x1d32e5){while(--_0x1d32e5){_0x5d51f4['push'](_0x5d51f4['shift']());}};_0x4114d4(++_0x1da285);}(_0x537d,0x19c));var _0xd537=function(_0x24f052,_0x2d48e6){_0x24f052=_0x24f052-0x0;var _0x26d48f=_0x537d[_0x24f052];return _0x26d48f;};'use strict';var multer=require(_0xd537('0x0'));var util=require(_0xd537('0x1'));var path=require(_0xd537('0x2'));var timeout=require(_0xd537('0x3'));var express=require(_0xd537('0x4'));var router=express['Router']();var fs_extra=require(_0xd537('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd537('0x6'));var controller=require(_0xd537('0x7'));router['get']('/',auth[_0xd537('0x8')](),controller[_0xd537('0x9')]);router[_0xd537('0xa')](_0xd537('0xb'),auth[_0xd537('0x8')](),controller[_0xd537('0xc')]);router[_0xd537('0xa')](_0xd537('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xd537('0xe')]('/',auth['isAuthenticated'](),controller[_0xd537('0xf')]);router[_0xd537('0x10')](_0xd537('0xd'),auth['isAuthenticated'](),controller[_0xd537('0x11')]);router[_0xd537('0x12')]('/:id',auth[_0xd537('0x8')](),controller[_0xd537('0x13')]);module[_0xd537('0x14')]=router; \ No newline at end of file +var _0x0e2d=['post','/:id','update','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x51244e,_0x24c7e6){var _0x58d71c=function(_0x3a8ea5){while(--_0x3a8ea5){_0x51244e['push'](_0x51244e['shift']());}};_0x58d71c(++_0x24c7e6);}(_0x0e2d,0x137));var _0xd0e2=function(_0x5f2792,_0x46699d){_0x5f2792=_0x5f2792-0x0;var _0xb1c2ba=_0x0e2d[_0x5f2792];return _0xb1c2ba;};'use strict';var multer=require(_0xd0e2('0x0'));var util=require(_0xd0e2('0x1'));var path=require(_0xd0e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd0e2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd0e2('0x4'));var controller=require(_0xd0e2('0x5'));router[_0xd0e2('0x6')]('/',auth[_0xd0e2('0x7')](),controller[_0xd0e2('0x8')]);router[_0xd0e2('0x6')](_0xd0e2('0x9'),auth[_0xd0e2('0x7')](),controller[_0xd0e2('0xa')]);router[_0xd0e2('0x6')]('/:id',auth[_0xd0e2('0x7')](),controller[_0xd0e2('0xb')]);router[_0xd0e2('0xc')]('/',auth[_0xd0e2('0x7')](),controller['create']);router['put'](_0xd0e2('0xd'),auth[_0xd0e2('0x7')](),controller[_0xd0e2('0xe')]);router['delete'](_0xd0e2('0xd'),auth[_0xd0e2('0x7')](),controller[_0xd0e2('0xf')]);module[_0xd0e2('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 351d7a6..df103d2 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(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7a54,0x106));var _0x47a5=function(_0x5bb3c0,_0x2f730a){_0x5bb3c0=_0x5bb3c0-0x0;var _0x3baf6a=_0x7a54[_0x5bb3c0];return _0x3baf6a;};'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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x39e9ce,_0x78df21){_0x39e9ce=_0x39e9ce-0x0;var _0x170b9c=_0x7a54[_0x39e9ce];return _0x170b9c;};'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 a05a9bd..c6a5125 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 _0xbc2c=['filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','body','destroy','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','sendStatus','stack','name','JscriptyQuestionReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5b6da2,_0x326ba3){var _0x2dd112=function(_0x5972e7){while(--_0x5972e7){_0x5b6da2['push'](_0x5b6da2['shift']());}};_0x2dd112(++_0x326ba3);}(_0xbc2c,0x12f));var _0xcbc2=function(_0x13f3f5,_0x36c339){_0x13f3f5=_0x13f3f5-0x0;var _0x20f54f=_0xbc2c[_0x13f3f5];return _0x20f54f;};'use strict';var emlformat=require(_0xcbc2('0x0'));var rimraf=require(_0xcbc2('0x1'));var zipdir=require(_0xcbc2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbc2('0x3'));var moment=require('moment');var BPromise=require(_0xcbc2('0x4'));var Mustache=require(_0xcbc2('0x5'));var util=require(_0xcbc2('0x6'));var path=require('path');var sox=require(_0xcbc2('0x7'));var csv=require(_0xcbc2('0x8'));var ejs=require(_0xcbc2('0x9'));var fs=require('fs');var fs_extra=require(_0xcbc2('0xa'));var _=require(_0xcbc2('0xb'));var squel=require(_0xcbc2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcbc2('0xd'));var toCsv=require(_0xcbc2('0x8'));var querystring=require(_0xcbc2('0xe'));var Papa=require(_0xcbc2('0xf'));var Redis=require(_0xcbc2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcbc2('0x11'));var as=require(_0xcbc2('0x12'));var hardwareService=require(_0xcbc2('0x13'));var logger=require(_0xcbc2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xcbc2('0x15'));var licenseUtil=require(_0xcbc2('0x16'));var db=require(_0xcbc2('0x17'))['db'];function respondWithStatusCode(_0x36aab6,_0x5873c2){_0x5873c2=_0x5873c2||0xcc;return function(_0x110108){if(_0x110108){return _0x36aab6['sendStatus'](_0x5873c2);}return _0x36aab6['status'](_0x5873c2)[_0xcbc2('0x18')]();};}function respondWithResult(_0x3b5f8f,_0x51111f){_0x51111f=_0x51111f||0xc8;return function(_0x1057bc){if(_0x1057bc){return _0x3b5f8f[_0xcbc2('0x19')](_0x51111f)[_0xcbc2('0x1a')](_0x1057bc);}};}function respondWithFilteredResult(_0x5d238f,_0x4dc293){return function(_0x39d7a4){if(_0x39d7a4){var _0x1b5b36=typeof _0x4dc293[_0xcbc2('0x1b')]==='undefined'&&typeof _0x4dc293['limit']===_0xcbc2('0x1c');var _0x455067=_0x39d7a4[_0xcbc2('0x1d')];var _0x4e19e0=_0x1b5b36?0x0:_0x4dc293['offset'];var _0x14c5f2=_0x1b5b36?_0x39d7a4['count']:_0x4dc293[_0xcbc2('0x1b')]+_0x4dc293[_0xcbc2('0x1e')];var _0x5f5959;if(_0x14c5f2>=_0x455067){_0x14c5f2=_0x455067;_0x5f5959=0xc8;}else{_0x5f5959=0xce;}_0x5d238f[_0xcbc2('0x19')](_0x5f5959);return _0x5d238f[_0xcbc2('0x1f')](_0xcbc2('0x20'),_0x4e19e0+'-'+_0x14c5f2+'/'+_0x455067)[_0xcbc2('0x1a')](_0x39d7a4);}return null;};}function patchUpdates(_0x311100){return function(_0x3c8f7f){try{jsonpatch['apply'](_0x3c8f7f,_0x311100,!![]);}catch(_0x2d2fc1){return BPromise[_0xcbc2('0x21')](_0x2d2fc1);}return _0x3c8f7f['save']();};}function saveUpdates(_0x432d42,_0x525edc){return function(_0x1da718){if(_0x1da718){return _0x1da718[_0xcbc2('0x22')](_0x432d42)[_0xcbc2('0x23')](function(_0x32a6e7){return _0x32a6e7;});}return null;};}function removeEntity(_0x5c2135,_0x272054){return function(_0x1c5807){if(_0x1c5807){return _0x1c5807['destroy']()['then'](function(){_0x5c2135['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5bd1,_0x1f00a5){return function(_0x126177){if(!_0x126177){_0x2d5bd1[_0xcbc2('0x24')](0x194);}return _0x126177;};}function handleError(_0x2191fc,_0x14977a){_0x14977a=_0x14977a||0x1f4;return function(_0x9d77d1){logger['error'](_0x9d77d1[_0xcbc2('0x25')]);if(_0x9d77d1[_0xcbc2('0x26')]){delete _0x9d77d1[_0xcbc2('0x26')];}_0x2191fc[_0xcbc2('0x19')](_0x14977a)['send'](_0x9d77d1);};}exports['index']=function(_0x523f4a,_0x119631){var _0x25a78f={},_0x199a48={},_0x3024b9={'count':0x0,'rows':[]};var _0x48cfd8=_['map'](db[_0xcbc2('0x27')][_0xcbc2('0x28')],function(_0x584d13){return{'name':_0x584d13[_0xcbc2('0x29')],'type':_0x584d13['type'][_0xcbc2('0x2a')]};});_0x199a48[_0xcbc2('0x2b')]=_[_0xcbc2('0x2c')](_0x48cfd8,_0xcbc2('0x26'));_0x199a48[_0xcbc2('0x2d')]=_[_0xcbc2('0x2e')](_0x523f4a[_0xcbc2('0x2d')]);_0x199a48[_0xcbc2('0x2f')]=_[_0xcbc2('0x30')](_0x199a48['model'],_0x199a48[_0xcbc2('0x2d')]);_0x25a78f['attributes']=_[_0xcbc2('0x30')](_0x199a48['model'],qs['fields'](_0x523f4a[_0xcbc2('0x2d')][_0xcbc2('0x31')]));_0x25a78f[_0xcbc2('0x32')]=_0x25a78f[_0xcbc2('0x32')][_0xcbc2('0x33')]?_0x25a78f['attributes']:_0x199a48['model'];if(!_0x523f4a[_0xcbc2('0x2d')][_0xcbc2('0x34')](_0xcbc2('0x35'))){_0x25a78f[_0xcbc2('0x1e')]=qs[_0xcbc2('0x1e')](_0x523f4a[_0xcbc2('0x2d')]['limit']);_0x25a78f[_0xcbc2('0x1b')]=qs[_0xcbc2('0x1b')](_0x523f4a[_0xcbc2('0x2d')][_0xcbc2('0x1b')]);}_0x25a78f['order']=qs[_0xcbc2('0x36')](_0x523f4a[_0xcbc2('0x2d')][_0xcbc2('0x36')]);_0x25a78f[_0xcbc2('0x37')]=qs['filters'](_[_0xcbc2('0x38')](_0x523f4a[_0xcbc2('0x2d')],_0x199a48[_0xcbc2('0x2f')]),_0x48cfd8);if(_0x523f4a[_0xcbc2('0x2d')][_0xcbc2('0x39')]){_0x25a78f[_0xcbc2('0x37')]=_['merge'](_0x25a78f[_0xcbc2('0x37')],{'$or':_['map'](_0x48cfd8,function(_0x2c37be){if(_0x2c37be[_0xcbc2('0x3a')]!=='VIRTUAL'){var _0x457a85={};_0x457a85[_0x2c37be[_0xcbc2('0x26')]]={'$like':'%'+_0x523f4a['query'][_0xcbc2('0x39')]+'%'};return _0x457a85;}})});}_0x25a78f=_[_0xcbc2('0x3b')]({},_0x25a78f,_0x523f4a[_0xcbc2('0x3c')]);var _0x35840a={'where':_0x25a78f[_0xcbc2('0x37')]};return db[_0xcbc2('0x27')][_0xcbc2('0x1d')](_0x35840a)[_0xcbc2('0x23')](function(_0x448b1f){_0x3024b9['count']=_0x448b1f;if(_0x523f4a[_0xcbc2('0x2d')][_0xcbc2('0x3d')]){_0x25a78f[_0xcbc2('0x3e')]=[{'all':!![]}];}return db[_0xcbc2('0x27')][_0xcbc2('0x3f')](_0x25a78f);})[_0xcbc2('0x23')](function(_0x4ed050){_0x3024b9[_0xcbc2('0x40')]=_0x4ed050;return _0x3024b9;})[_0xcbc2('0x23')](respondWithFilteredResult(_0x119631,_0x25a78f))[_0xcbc2('0x41')](handleError(_0x119631,null));};exports[_0xcbc2('0x42')]=function(_0xd1ded3,_0x23b7d1){var _0x533d72={'raw':!![],'where':{'id':_0xd1ded3[_0xcbc2('0x43')]['id']}},_0x1c213f={};_0x1c213f[_0xcbc2('0x2b')]=_[_0xcbc2('0x2e')](db[_0xcbc2('0x27')][_0xcbc2('0x28')]);_0x1c213f[_0xcbc2('0x2d')]=_['keys'](_0xd1ded3[_0xcbc2('0x2d')]);_0x1c213f[_0xcbc2('0x2f')]=_[_0xcbc2('0x30')](_0x1c213f[_0xcbc2('0x2b')],_0x1c213f[_0xcbc2('0x2d')]);_0x533d72[_0xcbc2('0x32')]=_[_0xcbc2('0x30')](_0x1c213f[_0xcbc2('0x2b')],qs[_0xcbc2('0x31')](_0xd1ded3[_0xcbc2('0x2d')][_0xcbc2('0x31')]));_0x533d72[_0xcbc2('0x32')]=_0x533d72[_0xcbc2('0x32')][_0xcbc2('0x33')]?_0x533d72[_0xcbc2('0x32')]:_0x1c213f[_0xcbc2('0x2b')];if(_0xd1ded3[_0xcbc2('0x2d')][_0xcbc2('0x3d')]){_0x533d72['include']=[{'all':!![]}];}_0x533d72=_['merge']({},_0x533d72,_0xd1ded3[_0xcbc2('0x3c')]);return db[_0xcbc2('0x27')]['find'](_0x533d72)[_0xcbc2('0x23')](handleEntityNotFound(_0x23b7d1,null))[_0xcbc2('0x23')](respondWithResult(_0x23b7d1,null))[_0xcbc2('0x41')](handleError(_0x23b7d1,null));};exports['create']=function(_0x18e127,_0x244e4c){return db[_0xcbc2('0x27')]['create'](_0x18e127[_0xcbc2('0x44')],{})[_0xcbc2('0x23')](respondWithResult(_0x244e4c,0xc9))[_0xcbc2('0x41')](handleError(_0x244e4c,null));};exports[_0xcbc2('0x22')]=function(_0x2ee08c,_0x275f8e){if(_0x2ee08c['body']['id']){delete _0x2ee08c[_0xcbc2('0x44')]['id'];}return db[_0xcbc2('0x27')]['find']({'where':{'id':_0x2ee08c[_0xcbc2('0x43')]['id']}})[_0xcbc2('0x23')](handleEntityNotFound(_0x275f8e,null))[_0xcbc2('0x23')](saveUpdates(_0x2ee08c[_0xcbc2('0x44')],null))[_0xcbc2('0x23')](respondWithResult(_0x275f8e,null))[_0xcbc2('0x41')](handleError(_0x275f8e,null));};exports[_0xcbc2('0x45')]=function(_0x598196,_0x8f6f60){return db[_0xcbc2('0x27')][_0xcbc2('0x46')]({'where':{'id':_0x598196[_0xcbc2('0x43')]['id']}})[_0xcbc2('0x23')](handleEntityNotFound(_0x8f6f60,null))[_0xcbc2('0x23')](removeEntity(_0x8f6f60,null))[_0xcbc2('0x41')](handleError(_0x8f6f60,null));};exports['describe']=function(_0x31bd84,_0x240738){return db[_0xcbc2('0x27')][_0xcbc2('0x47')]()[_0xcbc2('0x23')](respondWithResult(_0x240738,null))[_0xcbc2('0x41')](handleError(_0x240738,null));}; \ No newline at end of file +var _0x7382=['intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','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','status','end','offset','undefined','limit','count','set','json','update','then','destroy','stack','name','send','index','map','JscriptyQuestionReport','fieldName','key','model','query','keys'];(function(_0x5e70e8,_0x4b10c6){var _0x439fc9=function(_0x2cebdb){while(--_0x2cebdb){_0x5e70e8['push'](_0x5e70e8['shift']());}};_0x439fc9(++_0x4b10c6);}(_0x7382,0xf3));var _0x2738=function(_0x25cd74,_0x5b4364){_0x25cd74=_0x25cd74-0x0;var _0x1bfbab=_0x7382[_0x25cd74];return _0x1bfbab;};'use strict';var emlformat=require(_0x2738('0x0'));var rimraf=require(_0x2738('0x1'));var zipdir=require(_0x2738('0x2'));var jsonpatch=require(_0x2738('0x3'));var rp=require(_0x2738('0x4'));var moment=require(_0x2738('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2738('0x6'));var path=require(_0x2738('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2738('0x8'));var fs=require('fs');var fs_extra=require(_0x2738('0x9'));var _=require('lodash');var squel=require(_0x2738('0xa'));var crypto=require(_0x2738('0xb'));var jsforce=require(_0x2738('0xc'));var deskjs=require(_0x2738('0xd'));var toCsv=require(_0x2738('0xe'));var querystring=require(_0x2738('0xf'));var Papa=require(_0x2738('0x10'));var Redis=require(_0x2738('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2738('0x12'));var as=require(_0x2738('0x13'));var hardwareService=require(_0x2738('0x14'));var logger=require(_0x2738('0x15'))(_0x2738('0x16'));var utils=require(_0x2738('0x17'));var config=require(_0x2738('0x18'));var licenseUtil=require(_0x2738('0x19'));var db=require(_0x2738('0x1a'))['db'];function respondWithStatusCode(_0x3586a3,_0x3af016){_0x3af016=_0x3af016||0xcc;return function(_0x393973){if(_0x393973){return _0x3586a3['sendStatus'](_0x3af016);}return _0x3586a3[_0x2738('0x1b')](_0x3af016)[_0x2738('0x1c')]();};}function respondWithResult(_0x115522,_0x59df7f){_0x59df7f=_0x59df7f||0xc8;return function(_0x3a3af9){if(_0x3a3af9){return _0x115522[_0x2738('0x1b')](_0x59df7f)['json'](_0x3a3af9);}};}function respondWithFilteredResult(_0x1a9d14,_0xcb3c53){return function(_0x34ce79){if(_0x34ce79){var _0x136da3=typeof _0xcb3c53[_0x2738('0x1d')]===_0x2738('0x1e')&&typeof _0xcb3c53[_0x2738('0x1f')]===_0x2738('0x1e');var _0x209d4c=_0x34ce79[_0x2738('0x20')];var _0x19f016=_0x136da3?0x0:_0xcb3c53[_0x2738('0x1d')];var _0x2ee20a=_0x136da3?_0x34ce79[_0x2738('0x20')]:_0xcb3c53[_0x2738('0x1d')]+_0xcb3c53['limit'];var _0x4d4708;if(_0x2ee20a>=_0x209d4c){_0x2ee20a=_0x209d4c;_0x4d4708=0xc8;}else{_0x4d4708=0xce;}_0x1a9d14[_0x2738('0x1b')](_0x4d4708);return _0x1a9d14[_0x2738('0x21')]('Content-Range',_0x19f016+'-'+_0x2ee20a+'/'+_0x209d4c)[_0x2738('0x22')](_0x34ce79);}return null;};}function patchUpdates(_0x173495){return function(_0x257c10){try{jsonpatch['apply'](_0x257c10,_0x173495,!![]);}catch(_0x2fe505){return BPromise['reject'](_0x2fe505);}return _0x257c10['save']();};}function saveUpdates(_0xa57763,_0x46cc15){return function(_0xc454cd){if(_0xc454cd){return _0xc454cd[_0x2738('0x23')](_0xa57763)[_0x2738('0x24')](function(_0x109fa5){return _0x109fa5;});}return null;};}function removeEntity(_0x4e1045,_0x128248){return function(_0x3bce9a){if(_0x3bce9a){return _0x3bce9a[_0x2738('0x25')]()[_0x2738('0x24')](function(){_0x4e1045[_0x2738('0x1b')](0xcc)[_0x2738('0x1c')]();});}};}function handleEntityNotFound(_0x5d1642,_0x3afe53){return function(_0x561a9f){if(!_0x561a9f){_0x5d1642['sendStatus'](0x194);}return _0x561a9f;};}function handleError(_0xcaa4c4,_0x2280a8){_0x2280a8=_0x2280a8||0x1f4;return function(_0x17b42e){logger['error'](_0x17b42e[_0x2738('0x26')]);if(_0x17b42e[_0x2738('0x27')]){delete _0x17b42e[_0x2738('0x27')];}_0xcaa4c4[_0x2738('0x1b')](_0x2280a8)[_0x2738('0x28')](_0x17b42e);};}exports[_0x2738('0x29')]=function(_0x182299,_0x11e439){var _0x4b434={},_0x20905b={},_0x30df64={'count':0x0,'rows':[]};var _0x54a892=_[_0x2738('0x2a')](db[_0x2738('0x2b')]['rawAttributes'],function(_0x386ab4){return{'name':_0x386ab4[_0x2738('0x2c')],'type':_0x386ab4['type'][_0x2738('0x2d')]};});_0x20905b[_0x2738('0x2e')]=_[_0x2738('0x2a')](_0x54a892,_0x2738('0x27'));_0x20905b[_0x2738('0x2f')]=_[_0x2738('0x30')](_0x182299[_0x2738('0x2f')]);_0x20905b['filters']=_[_0x2738('0x31')](_0x20905b[_0x2738('0x2e')],_0x20905b[_0x2738('0x2f')]);_0x4b434[_0x2738('0x32')]=_[_0x2738('0x31')](_0x20905b['model'],qs['fields'](_0x182299['query'][_0x2738('0x33')]));_0x4b434['attributes']=_0x4b434[_0x2738('0x32')]['length']?_0x4b434[_0x2738('0x32')]:_0x20905b[_0x2738('0x2e')];if(!_0x182299[_0x2738('0x2f')]['hasOwnProperty'](_0x2738('0x34'))){_0x4b434['limit']=qs[_0x2738('0x1f')](_0x182299['query'][_0x2738('0x1f')]);_0x4b434[_0x2738('0x1d')]=qs['offset'](_0x182299[_0x2738('0x2f')]['offset']);}_0x4b434['order']=qs[_0x2738('0x35')](_0x182299['query'][_0x2738('0x35')]);_0x4b434[_0x2738('0x36')]=qs[_0x2738('0x37')](_[_0x2738('0x38')](_0x182299[_0x2738('0x2f')],_0x20905b['filters']),_0x54a892);if(_0x182299['query'][_0x2738('0x39')]){_0x4b434[_0x2738('0x36')]=_[_0x2738('0x3a')](_0x4b434['where'],{'$or':_['map'](_0x54a892,function(_0x4ee416){if(_0x4ee416['type']!=='VIRTUAL'){var _0x39c372={};_0x39c372[_0x4ee416[_0x2738('0x27')]]={'$like':'%'+_0x182299[_0x2738('0x2f')][_0x2738('0x39')]+'%'};return _0x39c372;}})});}_0x4b434=_[_0x2738('0x3a')]({},_0x4b434,_0x182299['options']);var _0x1bdbd0={'where':_0x4b434[_0x2738('0x36')]};return db[_0x2738('0x2b')][_0x2738('0x20')](_0x1bdbd0)[_0x2738('0x24')](function(_0x2f223d){_0x30df64[_0x2738('0x20')]=_0x2f223d;if(_0x182299[_0x2738('0x2f')][_0x2738('0x3b')]){_0x4b434[_0x2738('0x3c')]=[{'all':!![]}];}return db[_0x2738('0x2b')][_0x2738('0x3d')](_0x4b434);})[_0x2738('0x24')](function(_0x3e83b9){_0x30df64[_0x2738('0x3e')]=_0x3e83b9;return _0x30df64;})[_0x2738('0x24')](respondWithFilteredResult(_0x11e439,_0x4b434))[_0x2738('0x3f')](handleError(_0x11e439,null));};exports[_0x2738('0x40')]=function(_0x11f589,_0x1df835){var _0xac1399={'raw':!![],'where':{'id':_0x11f589['params']['id']}},_0x30c6f4={};_0x30c6f4[_0x2738('0x2e')]=_['keys'](db[_0x2738('0x2b')][_0x2738('0x41')]);_0x30c6f4['query']=_[_0x2738('0x30')](_0x11f589[_0x2738('0x2f')]);_0x30c6f4['filters']=_[_0x2738('0x31')](_0x30c6f4['model'],_0x30c6f4[_0x2738('0x2f')]);_0xac1399[_0x2738('0x32')]=_['intersection'](_0x30c6f4[_0x2738('0x2e')],qs[_0x2738('0x33')](_0x11f589[_0x2738('0x2f')][_0x2738('0x33')]));_0xac1399[_0x2738('0x32')]=_0xac1399[_0x2738('0x32')][_0x2738('0x42')]?_0xac1399['attributes']:_0x30c6f4['model'];if(_0x11f589[_0x2738('0x2f')][_0x2738('0x3b')]){_0xac1399['include']=[{'all':!![]}];}_0xac1399=_[_0x2738('0x3a')]({},_0xac1399,_0x11f589[_0x2738('0x43')]);return db[_0x2738('0x2b')][_0x2738('0x44')](_0xac1399)[_0x2738('0x24')](handleEntityNotFound(_0x1df835,null))[_0x2738('0x24')](respondWithResult(_0x1df835,null))[_0x2738('0x3f')](handleError(_0x1df835,null));};exports[_0x2738('0x45')]=function(_0x4d81d3,_0x39f5e8){return db[_0x2738('0x2b')][_0x2738('0x45')](_0x4d81d3[_0x2738('0x46')],{})[_0x2738('0x24')](respondWithResult(_0x39f5e8,0xc9))[_0x2738('0x3f')](handleError(_0x39f5e8,null));};exports[_0x2738('0x23')]=function(_0x2b0eac,_0x3f3119){if(_0x2b0eac[_0x2738('0x46')]['id']){delete _0x2b0eac[_0x2738('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x2738('0x44')]({'where':{'id':_0x2b0eac[_0x2738('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f3119,null))['then'](saveUpdates(_0x2b0eac[_0x2738('0x46')],null))[_0x2738('0x24')](respondWithResult(_0x3f3119,null))['catch'](handleError(_0x3f3119,null));};exports['destroy']=function(_0x38b43b,_0xec5660){return db[_0x2738('0x2b')][_0x2738('0x44')]({'where':{'id':_0x38b43b['params']['id']}})[_0x2738('0x24')](handleEntityNotFound(_0xec5660,null))[_0x2738('0x24')](removeEntity(_0xec5660,null))[_0x2738('0x3f')](handleError(_0xec5660,null));};exports[_0x2738('0x48')]=function(_0x2685d0,_0xa6722b){return db[_0x2738('0x2b')][_0x2738('0x48')]()[_0x2738('0x24')](respondWithResult(_0xa6722b,null))[_0x2738('0x3f')](handleError(_0xa6722b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 0bb5ea0..537a0da 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 _0x0c34=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x340945,_0x20874f){var _0x2ad37e=function(_0x502f75){while(--_0x502f75){_0x340945['push'](_0x340945['shift']());}};_0x2ad37e(++_0x20874f);}(_0x0c34,0x1a7));var _0x40c3=function(_0x3ba2c1,_0x36aec2){_0x3ba2c1=_0x3ba2c1-0x0;var _0x20030e=_0x0c34[_0x3ba2c1];return _0x20030e;};'use strict';var _=require(_0x40c3('0x0'));var util=require(_0x40c3('0x1'));var logger=require(_0x40c3('0x2'))(_0x40c3('0x3'));var moment=require(_0x40c3('0x4'));var BPromise=require('bluebird');var rp=require(_0x40c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40c3('0x6'));var config=require(_0x40c3('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x40c3('0x8')]=function(_0x31d018,_0x146238){return _0x31d018[_0x40c3('0x9')](_0x40c3('0xa'),attributes,{'tableName':_0x40c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d79=['report_jscripty_questions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x2397be,_0x4046c2){var _0x4b5e37=function(_0xb0e0dc){while(--_0xb0e0dc){_0x2397be['push'](_0x2397be['shift']());}};_0x4b5e37(++_0x4046c2);}(_0x3d79,0xeb));var _0x93d7=function(_0x58a3e1,_0x304e17){_0x58a3e1=_0x58a3e1-0x0;var _0x4af78d=_0x3d79[_0x58a3e1];return _0x4af78d;};'use strict';var _=require(_0x93d7('0x0'));var util=require(_0x93d7('0x1'));var logger=require('../../config/logger')(_0x93d7('0x2'));var moment=require(_0x93d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x93d7('0x4'));var fs=require('fs');var path=require(_0x93d7('0x5'));var rimraf=require(_0x93d7('0x6'));var config=require(_0x93d7('0x7'));var attributes=require(_0x93d7('0x8'));module[_0x93d7('0x9')]=function(_0x20797a,_0x4a515c){return _0x20797a[_0x93d7('0xa')](_0x93d7('0xb'),attributes,{'tableName':_0x93d7('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 6dbde27..717296c 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 _0x4ca0=['../../config/environment','jayson/promise','http','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','randomstring','ioredis','../../config/utils'];(function(_0x25a909,_0x15c027){var _0x1aca6d=function(_0x176207){while(--_0x176207){_0x25a909['push'](_0x25a909['shift']());}};_0x1aca6d(++_0x15c027);}(_0x4ca0,0xcc));var _0x04ca=function(_0x3c1312,_0x45bfdb){_0x3c1312=_0x3c1312-0x0;var _0x5b4831=_0x4ca0[_0x3c1312];return _0x5b4831;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x04ca('0x0'));var BPromise=require('bluebird');var rs=require(_0x04ca('0x1'));var fs=require('fs');var Redis=require(_0x04ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x04ca('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x04ca('0x4'));var jayson=require(_0x04ca('0x5'));var client=jayson['client'][_0x04ca('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2f5e0d,_0x37ffb5,_0x10313a){return new BPromise(function(_0x55d088,_0x5675e8){return client['request'](_0x2f5e0d,_0x10313a)['then'](function(_0x87bcfe){logger[_0x04ca('0x7')](_0x04ca('0x8'),_0x37ffb5,_0x04ca('0x9'));logger[_0x04ca('0xa')](_0x04ca('0xb'),_0x37ffb5,_0x04ca('0x9'),JSON['stringify'](_0x87bcfe));if(_0x87bcfe[_0x04ca('0xc')]){if(_0x87bcfe[_0x04ca('0xc')][_0x04ca('0xd')]===0x1f4){logger[_0x04ca('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x37ffb5,_0x87bcfe[_0x04ca('0xc')][_0x04ca('0xe')]);return _0x5675e8(_0x87bcfe[_0x04ca('0xc')][_0x04ca('0xe')]);}logger[_0x04ca('0xc')](_0x04ca('0x8'),_0x37ffb5,_0x87bcfe['error'][_0x04ca('0xe')]);return _0x55d088(_0x87bcfe[_0x04ca('0xc')]['message']);}else{logger[_0x04ca('0x7')](_0x04ca('0x8'),_0x37ffb5,_0x04ca('0x9'));_0x55d088(_0x87bcfe[_0x04ca('0xf')][_0x04ca('0xe')]);}})['catch'](function(_0x4667a9){logger['error'](_0x04ca('0x8'),_0x37ffb5,_0x4667a9);_0x5675e8(_0x4667a9);});});} \ No newline at end of file +var _0xb243=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x43dee1,_0x2e6469){var _0x7f761=function(_0x26abfe){while(--_0x26abfe){_0x43dee1['push'](_0x43dee1['shift']());}};_0x7f761(++_0x2e6469);}(_0xb243,0x111));var _0x3b24=function(_0x2d51b4,_0x47ae04){_0x2d51b4=_0x2d51b4-0x0;var _0x47b218=_0xb243[_0x2d51b4];return _0x47b218;};'use strict';var _=require(_0x3b24('0x0'));var util=require(_0x3b24('0x1'));var moment=require('moment');var BPromise=require(_0x3b24('0x2'));var rs=require(_0x3b24('0x3'));var fs=require('fs');var Redis=require(_0x3b24('0x4'));var db=require(_0x3b24('0x5'))['db'];var utils=require(_0x3b24('0x6'));var logger=require(_0x3b24('0x7'))(_0x3b24('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3b24('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d633a,_0x2ffc3c,_0x58d8cd){return new BPromise(function(_0x226aae,_0x55f633){return client[_0x3b24('0xa')](_0x3d633a,_0x58d8cd)[_0x3b24('0xb')](function(_0x80d961){logger['info'](_0x3b24('0xc'),_0x2ffc3c,_0x3b24('0xd'));logger[_0x3b24('0xe')](_0x3b24('0xf'),_0x2ffc3c,_0x3b24('0xd'),JSON['stringify'](_0x80d961));if(_0x80d961[_0x3b24('0x10')]){if(_0x80d961['error'][_0x3b24('0x11')]===0x1f4){logger[_0x3b24('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2ffc3c,_0x80d961[_0x3b24('0x10')]['message']);return _0x55f633(_0x80d961[_0x3b24('0x10')][_0x3b24('0x12')]);}logger['error'](_0x3b24('0xc'),_0x2ffc3c,_0x80d961[_0x3b24('0x10')][_0x3b24('0x12')]);return _0x226aae(_0x80d961[_0x3b24('0x10')][_0x3b24('0x12')]);}else{logger[_0x3b24('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2ffc3c,'request\x20sent');_0x226aae(_0x80d961[_0x3b24('0x14')]['message']);}})[_0x3b24('0x15')](function(_0x20ef17){logger[_0x3b24('0x10')](_0x3b24('0xc'),_0x2ffc3c,_0x20ef17);_0x55f633(_0x20ef17);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ec3e933..38d31fc 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 _0x1eac=['path','Router','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id/questions','getQuestions','post','create','update','/:id','destroy','multer'];(function(_0x42890a,_0x4e6dd4){var _0x459102=function(_0x47b2bb){while(--_0x47b2bb){_0x42890a['push'](_0x42890a['shift']());}};_0x459102(++_0x4e6dd4);}(_0x1eac,0x8f));var _0xc1ea=function(_0x231482,_0x22f587){_0x231482=_0x231482-0x0;var _0x5a329a=_0x1eac[_0x231482];return _0x5a329a;};'use strict';var multer=require(_0xc1ea('0x0'));var util=require('util');var path=require(_0xc1ea('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc1ea('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc1ea('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc1ea('0x4'));var controller=require(_0xc1ea('0x5'));router[_0xc1ea('0x6')]('/',auth[_0xc1ea('0x7')](),controller[_0xc1ea('0x8')]);router[_0xc1ea('0x6')](_0xc1ea('0x9'),auth[_0xc1ea('0x7')](),controller[_0xc1ea('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc1ea('0x6')](_0xc1ea('0xb'),auth[_0xc1ea('0x7')](),controller[_0xc1ea('0xc')]);router[_0xc1ea('0xd')]('/',auth[_0xc1ea('0x7')](),controller[_0xc1ea('0xe')]);router['put']('/:id',auth[_0xc1ea('0x7')](),controller[_0xc1ea('0xf')]);router['delete'](_0xc1ea('0x10'),auth['isAuthenticated'](),controller[_0xc1ea('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5565=['../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/questions','getQuestions','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x5565,0x12c));var _0x5556=function(_0x1679c9,_0x5300f8){_0x1679c9=_0x1679c9-0x0;var _0x4164a7=_0x5565[_0x1679c9];return _0x4164a7;};'use strict';var multer=require(_0x5556('0x0'));var util=require(_0x5556('0x1'));var path=require(_0x5556('0x2'));var timeout=require(_0x5556('0x3'));var express=require(_0x5556('0x4'));var router=express['Router']();var fs_extra=require(_0x5556('0x5'));var auth=require(_0x5556('0x6'));var interaction=require(_0x5556('0x7'));var config=require(_0x5556('0x8'));var controller=require(_0x5556('0x9'));router['get']('/',auth[_0x5556('0xa')](),controller['index']);router[_0x5556('0xb')](_0x5556('0xc'),auth['isAuthenticated'](),controller[_0x5556('0xd')]);router[_0x5556('0xb')](_0x5556('0xe'),auth['isAuthenticated'](),controller[_0x5556('0xf')]);router[_0x5556('0xb')](_0x5556('0x10'),auth[_0x5556('0xa')](),controller[_0x5556('0x11')]);router['post']('/',auth[_0x5556('0xa')](),controller[_0x5556('0x12')]);router['put'](_0x5556('0xe'),auth['isAuthenticated'](),controller[_0x5556('0x13')]);router['delete'](_0x5556('0xe'),auth[_0x5556('0xa')](),controller[_0x5556('0x14')]);module[_0x5556('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 8092246..d1d5bee 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 _0x9edb=['setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x14a15b,_0x4b6efa){var _0x4bcd16=function(_0x29d8cb){while(--_0x29d8cb){_0x14a15b['push'](_0x14a15b['shift']());}};_0x4bcd16(++_0x4b6efa);}(_0x9edb,0x7b));var _0xb9ed=function(_0x1589fb,_0x3b2eda){_0x1589fb=_0x1589fb-0x0;var _0x4e8fcf=_0x9edb[_0x1589fb];return _0x4e8fcf;};'use strict';var moment=require(_0xb9ed('0x0'));var Sequelize=require(_0xb9ed('0x1'));module[_0xb9ed('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x9525c6){this[_0xb9ed('0x3')]('starttime',_0x9525c6);this[_0xb9ed('0x3')]('endtime',moment()[_0xb9ed('0x4')](_0xb9ed('0x5')));}},'endtime':{'type':Sequelize[_0xb9ed('0x6')]},'membername':{'type':Sequelize[_0xb9ed('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb9ed('0x7')]},'uniqueid':{'type':Sequelize[_0xb9ed('0x7')]},'calleridname':{'type':Sequelize[_0xb9ed('0x7')]},'calleridnum':{'type':Sequelize[_0xb9ed('0x7')]},'completed':{'type':Sequelize[_0xb9ed('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xbaf0=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE','setDataValue','endtime','format'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbaf0,0xff));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var moment=require('moment');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'starttime':{'type':Sequelize[_0x0baf('0x2')],'set':function(_0x2ecb40){this[_0x0baf('0x3')]('starttime',_0x2ecb40);this['setDataValue'](_0x0baf('0x4'),moment()[_0x0baf('0x5')](_0x0baf('0x6')));}},'endtime':{'type':Sequelize[_0x0baf('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0baf('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x0baf('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 da3a313..2f2bf53 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 _0x944c=['where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','order','pick','SessionId','include','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','end','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','filter'];(function(_0x549548,_0x1c23db){var _0x5df818=function(_0x4d4452){while(--_0x4d4452){_0x549548['push'](_0x549548['shift']());}};_0x5df818(++_0x1c23db);}(_0x944c,0x69));var _0xc944=function(_0x7b6072,_0x1654f0){_0x7b6072=_0x7b6072-0x0;var _0x2de11d=_0x944c[_0x7b6072];return _0x2de11d;};'use strict';var emlformat=require(_0xc944('0x0'));var rimraf=require(_0xc944('0x1'));var zipdir=require(_0xc944('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc944('0x3'));var moment=require(_0xc944('0x4'));var BPromise=require(_0xc944('0x5'));var Mustache=require('mustache');var util=require(_0xc944('0x6'));var path=require(_0xc944('0x7'));var sox=require(_0xc944('0x8'));var csv=require(_0xc944('0x9'));var ejs=require(_0xc944('0xa'));var fs=require('fs');var fs_extra=require(_0xc944('0xb'));var _=require(_0xc944('0xc'));var squel=require(_0xc944('0xd'));var crypto=require(_0xc944('0xe'));var jsforce=require(_0xc944('0xf'));var deskjs=require(_0xc944('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc944('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc944('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc944('0x13'));var logger=require(_0xc944('0x14'))(_0xc944('0x15'));var utils=require(_0xc944('0x16'));var config=require(_0xc944('0x17'));var licenseUtil=require(_0xc944('0x18'));var db=require(_0xc944('0x19'))['db'];function respondWithStatusCode(_0x21f800,_0x272f18){_0x272f18=_0x272f18||0xcc;return function(_0x43c538){if(_0x43c538){return _0x21f800['sendStatus'](_0x272f18);}return _0x21f800[_0xc944('0x1a')](_0x272f18)['end']();};}function respondWithResult(_0x4e874b,_0x492611){_0x492611=_0x492611||0xc8;return function(_0x5e38ed){if(_0x5e38ed){return _0x4e874b[_0xc944('0x1a')](_0x492611)[_0xc944('0x1b')](_0x5e38ed);}};}function respondWithFilteredResult(_0x4b7bf0,_0x4770e7){return function(_0x215f17){if(_0x215f17){var _0x37fdbc=typeof _0x4770e7[_0xc944('0x1c')]===_0xc944('0x1d')&&typeof _0x4770e7[_0xc944('0x1e')]==='undefined';var _0x412c51=_0x215f17['count'];var _0x4b3b52=_0x37fdbc?0x0:_0x4770e7[_0xc944('0x1c')];var _0x443203=_0x37fdbc?_0x215f17[_0xc944('0x1f')]:_0x4770e7['offset']+_0x4770e7[_0xc944('0x1e')];var _0x4e13d8;if(_0x443203>=_0x412c51){_0x443203=_0x412c51;_0x4e13d8=0xc8;}else{_0x4e13d8=0xce;}_0x4b7bf0[_0xc944('0x1a')](_0x4e13d8);return _0x4b7bf0['set'](_0xc944('0x20'),_0x4b3b52+'-'+_0x443203+'/'+_0x412c51)[_0xc944('0x1b')](_0x215f17);}return null;};}function patchUpdates(_0x3e1466){return function(_0x143712){try{jsonpatch[_0xc944('0x21')](_0x143712,_0x3e1466,!![]);}catch(_0x1e6e5a){return BPromise[_0xc944('0x22')](_0x1e6e5a);}return _0x143712[_0xc944('0x23')]();};}function saveUpdates(_0x5395d0,_0x13823c){return function(_0x5eb59b){if(_0x5eb59b){return _0x5eb59b['update'](_0x5395d0)['then'](function(_0x465cef){return _0x465cef;});}return null;};}function removeEntity(_0x285b15,_0x424cae){return function(_0x1a71a3){if(_0x1a71a3){return _0x1a71a3[_0xc944('0x24')]()[_0xc944('0x25')](function(){_0x285b15[_0xc944('0x1a')](0xcc)[_0xc944('0x26')]();});}};}function handleEntityNotFound(_0x283f43,_0xa73079){return function(_0x5a0b1a){if(!_0x5a0b1a){_0x283f43[_0xc944('0x27')](0x194);}return _0x5a0b1a;};}function handleError(_0x19ec24,_0x14f035){_0x14f035=_0x14f035||0x1f4;return function(_0x5bef6b){logger[_0xc944('0x28')](_0x5bef6b[_0xc944('0x29')]);if(_0x5bef6b[_0xc944('0x2a')]){delete _0x5bef6b[_0xc944('0x2a')];}_0x19ec24[_0xc944('0x1a')](_0x14f035)[_0xc944('0x2b')](_0x5bef6b);};}exports[_0xc944('0x2c')]=function(_0x2ed85f,_0x4a101a){var _0x812a2e={},_0x359ff8={},_0xc60d={'count':0x0,'rows':[]};var _0x1cef2e=_[_0xc944('0x2d')](db[_0xc944('0x2e')][_0xc944('0x2f')],function(_0x3ce1eb){return{'name':_0x3ce1eb['fieldName'],'type':_0x3ce1eb['type'][_0xc944('0x30')]};});_0x359ff8[_0xc944('0x31')]=_[_0xc944('0x2d')](_0x1cef2e,_0xc944('0x2a'));_0x359ff8[_0xc944('0x32')]=_[_0xc944('0x33')](_0x2ed85f[_0xc944('0x32')]);_0x359ff8[_0xc944('0x34')]=_[_0xc944('0x35')](_0x359ff8[_0xc944('0x31')],_0x359ff8[_0xc944('0x32')]);_0x812a2e['attributes']=_[_0xc944('0x35')](_0x359ff8[_0xc944('0x31')],qs[_0xc944('0x36')](_0x2ed85f[_0xc944('0x32')][_0xc944('0x36')]));_0x812a2e['attributes']=_0x812a2e['attributes'][_0xc944('0x37')]?_0x812a2e[_0xc944('0x38')]:_0x359ff8[_0xc944('0x31')];if(!_0x2ed85f[_0xc944('0x32')][_0xc944('0x39')](_0xc944('0x3a'))){_0x812a2e[_0xc944('0x1e')]=qs[_0xc944('0x1e')](_0x2ed85f[_0xc944('0x32')][_0xc944('0x1e')]);_0x812a2e[_0xc944('0x1c')]=qs[_0xc944('0x1c')](_0x2ed85f['query'][_0xc944('0x1c')]);}_0x812a2e['order']=qs[_0xc944('0x3b')](_0x2ed85f[_0xc944('0x32')]['sort']);_0x812a2e['where']=qs[_0xc944('0x34')](_['pick'](_0x2ed85f['query'],_0x359ff8['filters']),_0x1cef2e);if(_0x2ed85f[_0xc944('0x32')][_0xc944('0x3c')]){_0x812a2e[_0xc944('0x3d')]=_['merge'](_0x812a2e[_0xc944('0x3d')],{'$or':_['map'](_0x1cef2e,function(_0x5e6a11){if(_0x5e6a11['type']!==_0xc944('0x3e')){var _0x20ff98={};_0x20ff98[_0x5e6a11['name']]={'$like':'%'+_0x2ed85f['query']['filter']+'%'};return _0x20ff98;}})});}_0x812a2e=_[_0xc944('0x3f')]({},_0x812a2e,_0x2ed85f[_0xc944('0x40')]);var _0x5053de={'where':_0x812a2e[_0xc944('0x3d')]};return db[_0xc944('0x2e')][_0xc944('0x1f')](_0x5053de)['then'](function(_0x38413c){_0xc60d['count']=_0x38413c;if(_0x2ed85f[_0xc944('0x32')][_0xc944('0x41')]){_0x812a2e['include']=[{'all':!![]}];}return db[_0xc944('0x2e')][_0xc944('0x42')](_0x812a2e);})[_0xc944('0x25')](function(_0x426d7b){_0xc60d[_0xc944('0x43')]=_0x426d7b;return _0xc60d;})[_0xc944('0x25')](respondWithFilteredResult(_0x4a101a,_0x812a2e))[_0xc944('0x44')](handleError(_0x4a101a,null));};exports[_0xc944('0x45')]=function(_0x101f50,_0x1b5944){var _0x4a4d11={'raw':!![],'where':{'id':_0x101f50[_0xc944('0x46')]['id']}},_0x13db81={};_0x13db81[_0xc944('0x31')]=_[_0xc944('0x33')](db['JscriptySessionReport'][_0xc944('0x2f')]);_0x13db81[_0xc944('0x32')]=_[_0xc944('0x33')](_0x101f50[_0xc944('0x32')]);_0x13db81[_0xc944('0x34')]=_[_0xc944('0x35')](_0x13db81[_0xc944('0x31')],_0x13db81[_0xc944('0x32')]);_0x4a4d11[_0xc944('0x38')]=_['intersection'](_0x13db81['model'],qs[_0xc944('0x36')](_0x101f50[_0xc944('0x32')]['fields']));_0x4a4d11['attributes']=_0x4a4d11['attributes'][_0xc944('0x37')]?_0x4a4d11[_0xc944('0x38')]:_0x13db81[_0xc944('0x31')];if(_0x101f50[_0xc944('0x32')][_0xc944('0x41')]){_0x4a4d11['include']=[{'all':!![]}];}_0x4a4d11=_[_0xc944('0x3f')]({},_0x4a4d11,_0x101f50[_0xc944('0x40')]);return db[_0xc944('0x2e')][_0xc944('0x47')](_0x4a4d11)[_0xc944('0x25')](handleEntityNotFound(_0x1b5944,null))[_0xc944('0x25')](respondWithResult(_0x1b5944,null))[_0xc944('0x44')](handleError(_0x1b5944,null));};exports[_0xc944('0x48')]=function(_0x3dd548,_0x17f906){return db[_0xc944('0x2e')][_0xc944('0x48')](_0x3dd548[_0xc944('0x49')],{})[_0xc944('0x25')](respondWithResult(_0x17f906,0xc9))[_0xc944('0x44')](handleError(_0x17f906,null));};exports[_0xc944('0x4a')]=function(_0x36d7ef,_0xfc13c4){if(_0x36d7ef[_0xc944('0x49')]['id']){delete _0x36d7ef[_0xc944('0x49')]['id'];}return db[_0xc944('0x2e')][_0xc944('0x47')]({'where':{'id':_0x36d7ef[_0xc944('0x46')]['id']}})[_0xc944('0x25')](handleEntityNotFound(_0xfc13c4,null))[_0xc944('0x25')](saveUpdates(_0x36d7ef['body'],null))[_0xc944('0x25')](respondWithResult(_0xfc13c4,null))[_0xc944('0x44')](handleError(_0xfc13c4,null));};exports[_0xc944('0x24')]=function(_0x36a77a,_0x395c66){return db[_0xc944('0x2e')]['find']({'where':{'id':_0x36a77a[_0xc944('0x46')]['id']}})[_0xc944('0x25')](handleEntityNotFound(_0x395c66,null))[_0xc944('0x25')](removeEntity(_0x395c66,null))[_0xc944('0x44')](handleError(_0x395c66,null));};exports[_0xc944('0x4b')]=function(_0x55146f,_0x229d45){return db[_0xc944('0x2e')][_0xc944('0x4b')]()['then'](respondWithResult(_0x229d45,null))[_0xc944('0x44')](handleError(_0x229d45,null));};exports[_0xc944('0x4c')]=function(_0x50e0bf,_0x2f0f6e,_0x12c550){var _0x2d0ed9={'raw':!![],'where':{}};var _0x9fb0b1={};var _0x15b05b={'count':0x0,'rows':[]};return db[_0xc944('0x2e')][_0xc944('0x4d')]({'where':{'id':_0x50e0bf['params']['id']}})[_0xc944('0x25')](handleEntityNotFound(_0x2f0f6e,null))['then'](function(_0x228eae){if(_0x228eae){_0x9fb0b1[_0xc944('0x31')]=_[_0xc944('0x33')](db[_0xc944('0x4e')][_0xc944('0x2f')]);_0x9fb0b1[_0xc944('0x32')]=_[_0xc944('0x33')](_0x50e0bf[_0xc944('0x32')]);_0x9fb0b1[_0xc944('0x34')]=_[_0xc944('0x35')](_0x9fb0b1[_0xc944('0x31')],_0x9fb0b1['query']);_0x2d0ed9[_0xc944('0x38')]=_[_0xc944('0x35')](_0x9fb0b1[_0xc944('0x31')],qs[_0xc944('0x36')](_0x50e0bf[_0xc944('0x32')]['fields']));_0x2d0ed9[_0xc944('0x38')]=_0x2d0ed9[_0xc944('0x38')][_0xc944('0x37')]?_0x2d0ed9[_0xc944('0x38')]:_0x9fb0b1[_0xc944('0x31')];if(!_0x50e0bf['query']['hasOwnProperty'](_0xc944('0x3a'))){_0x2d0ed9[_0xc944('0x1e')]=qs['limit'](_0x50e0bf['query']['limit']);_0x2d0ed9[_0xc944('0x1c')]=qs[_0xc944('0x1c')](_0x50e0bf[_0xc944('0x32')][_0xc944('0x1c')]);}_0x2d0ed9[_0xc944('0x4f')]=qs[_0xc944('0x3b')](_0x50e0bf['query']['sort']);_0x2d0ed9[_0xc944('0x3d')]=qs['filters'](_[_0xc944('0x50')](_0x50e0bf[_0xc944('0x32')],_0x9fb0b1[_0xc944('0x34')]));_0x2d0ed9['where'][_0xc944('0x51')]=_0x228eae['id'];if(_0x50e0bf[_0xc944('0x32')]['filter']){_0x2d0ed9[_0xc944('0x3d')]=_[_0xc944('0x3f')](_0x2d0ed9[_0xc944('0x3d')],{'$or':_[_0xc944('0x2d')](_0x2d0ed9[_0xc944('0x38')],function(_0x259224){var _0x55fac1={};_0x55fac1[_0x259224]={'$like':'%'+_0x50e0bf['query'][_0xc944('0x3c')]+'%'};return _0x55fac1;})});}_0x2d0ed9=_[_0xc944('0x3f')]({},_0x2d0ed9,_0x50e0bf['options']);return db[_0xc944('0x4e')][_0xc944('0x1f')]({'where':_0x2d0ed9[_0xc944('0x3d')]})[_0xc944('0x25')](function(_0x5d3871){_0x15b05b[_0xc944('0x1f')]=_0x5d3871;if(_0x50e0bf[_0xc944('0x32')]['includeAll']){_0x2d0ed9[_0xc944('0x52')]=[{'all':!![]}];}return db[_0xc944('0x4e')][_0xc944('0x42')](_0x2d0ed9);})['then'](function(_0xf8108d){_0x15b05b['rows']=_0xf8108d;return _0x15b05b;});}})[_0xc944('0x25')](respondWithFilteredResult(_0x2f0f6e,_0x2d0ed9))['catch'](handleError(_0x2f0f6e,null));}; \ No newline at end of file +var _0xf941=['options','JscriptySessionReport','include','findAll','rows','show','params','keys','length','includeAll','catch','create','body','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter'];(function(_0x531071,_0xfd8c){var _0x3c78bf=function(_0x953f6f){while(--_0x953f6f){_0x531071['push'](_0x531071['shift']());}};_0x3c78bf(++_0xfd8c);}(_0xf941,0x14c));var _0x1f94=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xf941[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0x1f94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f94('0x1'));var jsonpatch=require(_0x1f94('0x2'));var rp=require(_0x1f94('0x3'));var moment=require(_0x1f94('0x4'));var BPromise=require(_0x1f94('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1f94('0x6'));var sox=require(_0x1f94('0x7'));var csv=require('to-csv');var ejs=require(_0x1f94('0x8'));var fs=require('fs');var fs_extra=require(_0x1f94('0x9'));var _=require(_0x1f94('0xa'));var squel=require(_0x1f94('0xb'));var crypto=require(_0x1f94('0xc'));var jsforce=require(_0x1f94('0xd'));var deskjs=require(_0x1f94('0xe'));var toCsv=require(_0x1f94('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f94('0x10'));var qs=require(_0x1f94('0x11'));var as=require(_0x1f94('0x12'));var hardwareService=require(_0x1f94('0x13'));var logger=require('../../config/logger')(_0x1f94('0x14'));var utils=require('../../config/utils');var config=require(_0x1f94('0x15'));var licenseUtil=require(_0x1f94('0x16'));var db=require(_0x1f94('0x17'))['db'];function respondWithStatusCode(_0x2b732d,_0x1a156e){_0x1a156e=_0x1a156e||0xcc;return function(_0xbac00){if(_0xbac00){return _0x2b732d['sendStatus'](_0x1a156e);}return _0x2b732d[_0x1f94('0x18')](_0x1a156e)[_0x1f94('0x19')]();};}function respondWithResult(_0x48e9ba,_0x295db7){_0x295db7=_0x295db7||0xc8;return function(_0x1aeb30){if(_0x1aeb30){return _0x48e9ba['status'](_0x295db7)[_0x1f94('0x1a')](_0x1aeb30);}};}function respondWithFilteredResult(_0x2b6805,_0x243e06){return function(_0x525201){if(_0x525201){var _0x2e3e0b=typeof _0x243e06['offset']===_0x1f94('0x1b')&&typeof _0x243e06[_0x1f94('0x1c')]===_0x1f94('0x1b');var _0x5bfb57=_0x525201[_0x1f94('0x1d')];var _0x1c385f=_0x2e3e0b?0x0:_0x243e06[_0x1f94('0x1e')];var _0x5d9b71=_0x2e3e0b?_0x525201[_0x1f94('0x1d')]:_0x243e06['offset']+_0x243e06['limit'];var _0x28d40d;if(_0x5d9b71>=_0x5bfb57){_0x5d9b71=_0x5bfb57;_0x28d40d=0xc8;}else{_0x28d40d=0xce;}_0x2b6805[_0x1f94('0x18')](_0x28d40d);return _0x2b6805[_0x1f94('0x1f')]('Content-Range',_0x1c385f+'-'+_0x5d9b71+'/'+_0x5bfb57)[_0x1f94('0x1a')](_0x525201);}return null;};}function patchUpdates(_0x32134e){return function(_0x3252fe){try{jsonpatch['apply'](_0x3252fe,_0x32134e,!![]);}catch(_0xda21ad){return BPromise['reject'](_0xda21ad);}return _0x3252fe['save']();};}function saveUpdates(_0x5c3d89,_0x4dd6b0){return function(_0x433d09){if(_0x433d09){return _0x433d09[_0x1f94('0x20')](_0x5c3d89)[_0x1f94('0x21')](function(_0x310caf){return _0x310caf;});}return null;};}function removeEntity(_0x57d198,_0x5b00eb){return function(_0x15cbec){if(_0x15cbec){return _0x15cbec['destroy']()[_0x1f94('0x21')](function(){_0x57d198[_0x1f94('0x18')](0xcc)[_0x1f94('0x19')]();});}};}function handleEntityNotFound(_0x5d6a6d,_0x43b5e7){return function(_0x589a96){if(!_0x589a96){_0x5d6a6d[_0x1f94('0x22')](0x194);}return _0x589a96;};}function handleError(_0x162d69,_0x5b74eb){_0x5b74eb=_0x5b74eb||0x1f4;return function(_0x5055b5){logger[_0x1f94('0x23')](_0x5055b5[_0x1f94('0x24')]);if(_0x5055b5[_0x1f94('0x25')]){delete _0x5055b5[_0x1f94('0x25')];}_0x162d69[_0x1f94('0x18')](_0x5b74eb)[_0x1f94('0x26')](_0x5055b5);};}exports[_0x1f94('0x27')]=function(_0xded0be,_0xde160e){var _0x35f1ec={},_0x52c126={},_0x199075={'count':0x0,'rows':[]};var _0x31ba1f=_[_0x1f94('0x28')](db['JscriptySessionReport'][_0x1f94('0x29')],function(_0xe34847){return{'name':_0xe34847[_0x1f94('0x2a')],'type':_0xe34847[_0x1f94('0x2b')][_0x1f94('0x2c')]};});_0x52c126[_0x1f94('0x2d')]=_[_0x1f94('0x28')](_0x31ba1f,_0x1f94('0x25'));_0x52c126[_0x1f94('0x2e')]=_['keys'](_0xded0be[_0x1f94('0x2e')]);_0x52c126[_0x1f94('0x2f')]=_[_0x1f94('0x30')](_0x52c126[_0x1f94('0x2d')],_0x52c126[_0x1f94('0x2e')]);_0x35f1ec[_0x1f94('0x31')]=_[_0x1f94('0x30')](_0x52c126[_0x1f94('0x2d')],qs[_0x1f94('0x32')](_0xded0be[_0x1f94('0x2e')][_0x1f94('0x32')]));_0x35f1ec[_0x1f94('0x31')]=_0x35f1ec[_0x1f94('0x31')]['length']?_0x35f1ec[_0x1f94('0x31')]:_0x52c126[_0x1f94('0x2d')];if(!_0xded0be['query'][_0x1f94('0x33')](_0x1f94('0x34'))){_0x35f1ec[_0x1f94('0x1c')]=qs['limit'](_0xded0be[_0x1f94('0x2e')][_0x1f94('0x1c')]);_0x35f1ec['offset']=qs[_0x1f94('0x1e')](_0xded0be['query'][_0x1f94('0x1e')]);}_0x35f1ec['order']=qs[_0x1f94('0x35')](_0xded0be[_0x1f94('0x2e')]['sort']);_0x35f1ec[_0x1f94('0x36')]=qs[_0x1f94('0x2f')](_[_0x1f94('0x37')](_0xded0be[_0x1f94('0x2e')],_0x52c126[_0x1f94('0x2f')]),_0x31ba1f);if(_0xded0be[_0x1f94('0x2e')]['filter']){_0x35f1ec[_0x1f94('0x36')]=_[_0x1f94('0x38')](_0x35f1ec[_0x1f94('0x36')],{'$or':_[_0x1f94('0x28')](_0x31ba1f,function(_0x760192){if(_0x760192[_0x1f94('0x2b')]!=='VIRTUAL'){var _0x47fe32={};_0x47fe32[_0x760192['name']]={'$like':'%'+_0xded0be[_0x1f94('0x2e')][_0x1f94('0x39')]+'%'};return _0x47fe32;}})});}_0x35f1ec=_['merge']({},_0x35f1ec,_0xded0be[_0x1f94('0x3a')]);var _0x41b5a3={'where':_0x35f1ec['where']};return db[_0x1f94('0x3b')][_0x1f94('0x1d')](_0x41b5a3)[_0x1f94('0x21')](function(_0xe6ce87){_0x199075['count']=_0xe6ce87;if(_0xded0be[_0x1f94('0x2e')]['includeAll']){_0x35f1ec[_0x1f94('0x3c')]=[{'all':!![]}];}return db[_0x1f94('0x3b')][_0x1f94('0x3d')](_0x35f1ec);})[_0x1f94('0x21')](function(_0xc2b836){_0x199075[_0x1f94('0x3e')]=_0xc2b836;return _0x199075;})[_0x1f94('0x21')](respondWithFilteredResult(_0xde160e,_0x35f1ec))['catch'](handleError(_0xde160e,null));};exports[_0x1f94('0x3f')]=function(_0x329d76,_0x1267eb){var _0x271df4={'raw':!![],'where':{'id':_0x329d76[_0x1f94('0x40')]['id']}},_0x5cb5fd={};_0x5cb5fd[_0x1f94('0x2d')]=_['keys'](db['JscriptySessionReport'][_0x1f94('0x29')]);_0x5cb5fd[_0x1f94('0x2e')]=_[_0x1f94('0x41')](_0x329d76[_0x1f94('0x2e')]);_0x5cb5fd['filters']=_[_0x1f94('0x30')](_0x5cb5fd[_0x1f94('0x2d')],_0x5cb5fd['query']);_0x271df4['attributes']=_[_0x1f94('0x30')](_0x5cb5fd['model'],qs[_0x1f94('0x32')](_0x329d76['query'][_0x1f94('0x32')]));_0x271df4[_0x1f94('0x31')]=_0x271df4[_0x1f94('0x31')][_0x1f94('0x42')]?_0x271df4[_0x1f94('0x31')]:_0x5cb5fd[_0x1f94('0x2d')];if(_0x329d76['query'][_0x1f94('0x43')]){_0x271df4[_0x1f94('0x3c')]=[{'all':!![]}];}_0x271df4=_[_0x1f94('0x38')]({},_0x271df4,_0x329d76[_0x1f94('0x3a')]);return db[_0x1f94('0x3b')]['find'](_0x271df4)[_0x1f94('0x21')](handleEntityNotFound(_0x1267eb,null))['then'](respondWithResult(_0x1267eb,null))[_0x1f94('0x44')](handleError(_0x1267eb,null));};exports['create']=function(_0x2d127f,_0x4d9ded){return db['JscriptySessionReport'][_0x1f94('0x45')](_0x2d127f['body'],{})[_0x1f94('0x21')](respondWithResult(_0x4d9ded,0xc9))['catch'](handleError(_0x4d9ded,null));};exports['update']=function(_0x2847c2,_0x192669){if(_0x2847c2[_0x1f94('0x46')]['id']){delete _0x2847c2[_0x1f94('0x46')]['id'];}return db[_0x1f94('0x3b')][_0x1f94('0x47')]({'where':{'id':_0x2847c2[_0x1f94('0x40')]['id']}})[_0x1f94('0x21')](handleEntityNotFound(_0x192669,null))[_0x1f94('0x21')](saveUpdates(_0x2847c2[_0x1f94('0x46')],null))[_0x1f94('0x21')](respondWithResult(_0x192669,null))['catch'](handleError(_0x192669,null));};exports[_0x1f94('0x48')]=function(_0x22af82,_0x544f25){return db[_0x1f94('0x3b')][_0x1f94('0x47')]({'where':{'id':_0x22af82[_0x1f94('0x40')]['id']}})[_0x1f94('0x21')](handleEntityNotFound(_0x544f25,null))[_0x1f94('0x21')](removeEntity(_0x544f25,null))[_0x1f94('0x44')](handleError(_0x544f25,null));};exports[_0x1f94('0x49')]=function(_0x93ee1b,_0x365970){return db[_0x1f94('0x3b')]['describe']()[_0x1f94('0x21')](respondWithResult(_0x365970,null))[_0x1f94('0x44')](handleError(_0x365970,null));};exports[_0x1f94('0x4a')]=function(_0x3410d1,_0x2a3cc7,_0x4a691d){var _0x32dbbe={'raw':!![],'where':{}};var _0x4b46d2={};var _0x45acdc={'count':0x0,'rows':[]};return db[_0x1f94('0x3b')][_0x1f94('0x4b')]({'where':{'id':_0x3410d1[_0x1f94('0x40')]['id']}})['then'](handleEntityNotFound(_0x2a3cc7,null))[_0x1f94('0x21')](function(_0x4c6a6b){if(_0x4c6a6b){_0x4b46d2['model']=_[_0x1f94('0x41')](db[_0x1f94('0x4c')][_0x1f94('0x29')]);_0x4b46d2[_0x1f94('0x2e')]=_[_0x1f94('0x41')](_0x3410d1[_0x1f94('0x2e')]);_0x4b46d2[_0x1f94('0x2f')]=_[_0x1f94('0x30')](_0x4b46d2[_0x1f94('0x2d')],_0x4b46d2['query']);_0x32dbbe[_0x1f94('0x31')]=_[_0x1f94('0x30')](_0x4b46d2['model'],qs['fields'](_0x3410d1[_0x1f94('0x2e')]['fields']));_0x32dbbe['attributes']=_0x32dbbe[_0x1f94('0x31')][_0x1f94('0x42')]?_0x32dbbe['attributes']:_0x4b46d2[_0x1f94('0x2d')];if(!_0x3410d1[_0x1f94('0x2e')][_0x1f94('0x33')](_0x1f94('0x34'))){_0x32dbbe[_0x1f94('0x1c')]=qs[_0x1f94('0x1c')](_0x3410d1[_0x1f94('0x2e')][_0x1f94('0x1c')]);_0x32dbbe[_0x1f94('0x1e')]=qs[_0x1f94('0x1e')](_0x3410d1[_0x1f94('0x2e')]['offset']);}_0x32dbbe[_0x1f94('0x4d')]=qs['sort'](_0x3410d1['query'][_0x1f94('0x35')]);_0x32dbbe['where']=qs[_0x1f94('0x2f')](_['pick'](_0x3410d1[_0x1f94('0x2e')],_0x4b46d2[_0x1f94('0x2f')]));_0x32dbbe[_0x1f94('0x36')]['SessionId']=_0x4c6a6b['id'];if(_0x3410d1[_0x1f94('0x2e')][_0x1f94('0x39')]){_0x32dbbe[_0x1f94('0x36')]=_['merge'](_0x32dbbe[_0x1f94('0x36')],{'$or':_['map'](_0x32dbbe[_0x1f94('0x31')],function(_0x11754c){var _0x4067f8={};_0x4067f8[_0x11754c]={'$like':'%'+_0x3410d1[_0x1f94('0x2e')][_0x1f94('0x39')]+'%'};return _0x4067f8;})});}_0x32dbbe=_[_0x1f94('0x38')]({},_0x32dbbe,_0x3410d1['options']);return db[_0x1f94('0x4c')]['count']({'where':_0x32dbbe['where']})['then'](function(_0x248bc6){_0x45acdc[_0x1f94('0x1d')]=_0x248bc6;if(_0x3410d1[_0x1f94('0x2e')][_0x1f94('0x43')]){_0x32dbbe[_0x1f94('0x3c')]=[{'all':!![]}];}return db[_0x1f94('0x4c')][_0x1f94('0x3d')](_0x32dbbe);})[_0x1f94('0x21')](function(_0x23e9fe){_0x45acdc['rows']=_0x23e9fe;return _0x45acdc;});}})[_0x1f94('0x21')](respondWithFilteredResult(_0x2a3cc7,_0x32dbbe))[_0x1f94('0x44')](handleError(_0x2a3cc7,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 39ee61d..95a8c82 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 _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x885a,0x180));var _0xa885=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x885a[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index b96a63c..6b23198 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 _0x6455=['client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5c826a,_0x803e22){var _0x4be72b=function(_0x1fac17){while(--_0x1fac17){_0x5c826a['push'](_0x5c826a['shift']());}};_0x4be72b(++_0x803e22);}(_0x6455,0x97));var _0x5645=function(_0x3c1adf,_0x304540){_0x3c1adf=_0x3c1adf-0x0;var _0x1fca46=_0x6455[_0x3c1adf];return _0x1fca46;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});} \ No newline at end of file +var _0x430c=['then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request'];(function(_0x38aeea,_0x57522a){var _0x5e8d2c=function(_0xff08ce){while(--_0xff08ce){_0x38aeea['push'](_0x38aeea['shift']());}};_0x5e8d2c(++_0x57522a);}(_0x430c,0x1a1));var _0xc430=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0x430c[_0x2272b5];return _0x110156;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d508f1c..072c6ac 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 _0x5264=['Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','express'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x5264,0x1b6));var _0x4526=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5264[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4526('0x0'));var util=require(_0x4526('0x1'));var path=require(_0x4526('0x2'));var timeout=require('connect-timeout');var express=require(_0x4526('0x3'));var router=express[_0x4526('0x4')]();var fs_extra=require(_0x4526('0x5'));var auth=require(_0x4526('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4526('0x7'));var controller=require(_0x4526('0x8'));router['get']('/',controller[_0x4526('0x9')]);router[_0x4526('0xa')](_0x4526('0xb'),auth[_0x4526('0xc')](),controller[_0x4526('0xd')]);router['get'](_0x4526('0xe'),auth['isAuthenticated'](),controller[_0x4526('0xf')]);module[_0x4526('0x10')]=router; \ No newline at end of file +var _0x8baf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','/download_log_file','exports','util','path','connect-timeout','express','Router'];(function(_0x57f59e,_0x3cdc0d){var _0x58f9af=function(_0x3a6584){while(--_0x3a6584){_0x57f59e['push'](_0x57f59e['shift']());}};_0x58f9af(++_0x3cdc0d);}(_0x8baf,0x14f));var _0xf8ba=function(_0x4325ac,_0x27c984){_0x4325ac=_0x4325ac-0x0;var _0x37323b=_0x8baf[_0x4325ac];return _0x37323b;};'use strict';var multer=require('multer');var util=require(_0xf8ba('0x0'));var path=require(_0xf8ba('0x1'));var timeout=require(_0xf8ba('0x2'));var express=require(_0xf8ba('0x3'));var router=express[_0xf8ba('0x4')]();var fs_extra=require(_0xf8ba('0x5'));var auth=require(_0xf8ba('0x6'));var interaction=require(_0xf8ba('0x7'));var config=require(_0xf8ba('0x8'));var controller=require(_0xf8ba('0x9'));router[_0xf8ba('0xa')]('/',controller['index']);router[_0xf8ba('0xb')](_0xf8ba('0xc'),auth[_0xf8ba('0xd')](),controller[_0xf8ba('0xe')]);router[_0xf8ba('0xa')](_0xf8ba('0xf'),auth[_0xf8ba('0xd')](),controller['downloadLogFile']);module[_0xf8ba('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 1f8a6fe..4e1e3f1 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 _0x8aa4=['exports','STRING','sequelize'];(function(_0x5c5ea3,_0x353665){var _0x280703=function(_0x4e976a){while(--_0x4e976a){_0x5c5ea3['push'](_0x5c5ea3['shift']());}};_0x280703(++_0x353665);}(_0x8aa4,0x7a));var _0x48aa=function(_0x2bb958,_0xbfadac){_0x2bb958=_0x2bb958-0x0;var _0xe36c62=_0x8aa4[_0x2bb958];return _0xe36c62;};'use strict';var Sequelize=require(_0x48aa('0x0'));module[_0x48aa('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x48aa('0x2')]},'data2':{'type':Sequelize[_0x48aa('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9d62=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x5a10b2,_0x1b83ee){var _0x177550=function(_0x3bce24){while(--_0x3bce24){_0x5a10b2['push'](_0x5a10b2['shift']());}};_0x177550(++_0x1b83ee);}(_0x9d62,0x86));var _0x29d6=function(_0x20a176,_0x3d000c){_0x20a176=_0x20a176-0x0;var _0x3abfa1=_0x9d62[_0x20a176];return _0x3abfa1;};'use strict';var Sequelize=require(_0x29d6('0x0'));module[_0x29d6('0x1')]={'license':{'type':Sequelize[_0x29d6('0x2')]},'data1':{'type':Sequelize[_0x29d6('0x3')]},'data2':{'type':Sequelize[_0x29d6('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x29d6('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 7b5ed40..28eac0d 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 _0xd911=['catch','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','apply','save','update','destroy','then','end','error','stack','name','send','index','model','keys','License','rawAttributes','filters','intersection','query','attributes','fields','merge','options','getLicense','find','params','checkLicense','body','key','demo'];(function(_0x4b01b7,_0x5aa460){var _0x3ea044=function(_0x40d465){while(--_0x40d465){_0x4b01b7['push'](_0x4b01b7['shift']());}};_0x3ea044(++_0x5aa460);}(_0xd911,0xda));var _0x1d91=function(_0x3acb89,_0x2ca05e){_0x3acb89=_0x3acb89-0x0;var _0x4d38f2=_0xd911[_0x3acb89];return _0x4d38f2;};'use strict';var emlformat=require(_0x1d91('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d91('0x1'));var rp=require(_0x1d91('0x2'));var moment=require(_0x1d91('0x3'));var BPromise=require(_0x1d91('0x4'));var Mustache=require(_0x1d91('0x5'));var util=require('util');var path=require(_0x1d91('0x6'));var sox=require('sox');var csv=require(_0x1d91('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d91('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d91('0x9'));var jsforce=require(_0x1d91('0xa'));var deskjs=require(_0x1d91('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1d91('0xc'));var Papa=require(_0x1d91('0xd'));var Redis=require(_0x1d91('0xe'));var authService=require(_0x1d91('0xf'));var qs=require(_0x1d91('0x10'));var as=require(_0x1d91('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1d91('0x12'));var utils=require(_0x1d91('0x13'));var config=require(_0x1d91('0x14'));var licenseUtil=require(_0x1d91('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24d68f,_0x575443){_0x575443=_0x575443||0xcc;return function(_0x4adf68){if(_0x4adf68){return _0x24d68f[_0x1d91('0x16')](_0x575443);}return _0x24d68f['status'](_0x575443)['end']();};}function respondWithResult(_0x3fe679,_0x1b621b){_0x1b621b=_0x1b621b||0xc8;return function(_0x1c2440){if(_0x1c2440){return _0x3fe679[_0x1d91('0x17')](_0x1b621b)[_0x1d91('0x18')](_0x1c2440);}};}function respondWithFilteredResult(_0xa6e744,_0x5dc2ff){return function(_0x421298){if(_0x421298){var _0x3e87af=typeof _0x5dc2ff[_0x1d91('0x19')]==='undefined'&&typeof _0x5dc2ff[_0x1d91('0x1a')]===_0x1d91('0x1b');var _0x444590=_0x421298[_0x1d91('0x1c')];var _0x3384a9=_0x3e87af?0x0:_0x5dc2ff[_0x1d91('0x19')];var _0x2f6b5d=_0x3e87af?_0x421298[_0x1d91('0x1c')]:_0x5dc2ff[_0x1d91('0x19')]+_0x5dc2ff[_0x1d91('0x1a')];var _0x2bbd63;if(_0x2f6b5d>=_0x444590){_0x2f6b5d=_0x444590;_0x2bbd63=0xc8;}else{_0x2bbd63=0xce;}_0xa6e744[_0x1d91('0x17')](_0x2bbd63);return _0xa6e744['set']('Content-Range',_0x3384a9+'-'+_0x2f6b5d+'/'+_0x444590)['json'](_0x421298);}return null;};}function patchUpdates(_0x18527d){return function(_0x1f6d95){try{jsonpatch[_0x1d91('0x1d')](_0x1f6d95,_0x18527d,!![]);}catch(_0x4cda9a){return BPromise['reject'](_0x4cda9a);}return _0x1f6d95[_0x1d91('0x1e')]();};}function saveUpdates(_0x24921f,_0x4df1c2){return function(_0x1a65aa){if(_0x1a65aa){return _0x1a65aa[_0x1d91('0x1f')](_0x24921f)['then'](function(_0x4b4e2a){return _0x4b4e2a;});}return null;};}function removeEntity(_0x804a4c,_0x142653){return function(_0x385ba4){if(_0x385ba4){return _0x385ba4[_0x1d91('0x20')]()[_0x1d91('0x21')](function(){_0x804a4c[_0x1d91('0x17')](0xcc)[_0x1d91('0x22')]();});}};}function handleEntityNotFound(_0x4befff,_0x2802ca){return function(_0x9910dd){if(!_0x9910dd){_0x4befff[_0x1d91('0x16')](0x194);}return _0x9910dd;};}function handleError(_0x296f02,_0x4d91b2){_0x4d91b2=_0x4d91b2||0x1f4;return function(_0x2efdf4){logger[_0x1d91('0x23')](_0x2efdf4[_0x1d91('0x24')]);if(_0x2efdf4[_0x1d91('0x25')]){delete _0x2efdf4[_0x1d91('0x25')];}_0x296f02[_0x1d91('0x17')](_0x4d91b2)[_0x1d91('0x26')](_0x2efdf4);};}var utilLicense=require(_0x1d91('0x15'));exports[_0x1d91('0x27')]=function(_0x5977c8,_0x4f26b2){var _0x4027a7={'raw':!![],'where':{'id':0x1}},_0x9edc34={};_0x9edc34[_0x1d91('0x28')]=_[_0x1d91('0x29')](db[_0x1d91('0x2a')][_0x1d91('0x2b')]);_0x9edc34['query']=_[_0x1d91('0x29')](_0x5977c8['query']);_0x9edc34[_0x1d91('0x2c')]=_[_0x1d91('0x2d')](_0x9edc34[_0x1d91('0x28')],_0x9edc34[_0x1d91('0x2e')]);_0x4027a7[_0x1d91('0x2f')]=_[_0x1d91('0x2d')](_0x9edc34[_0x1d91('0x28')],qs[_0x1d91('0x30')](_0x5977c8[_0x1d91('0x2e')][_0x1d91('0x30')]));_0x4027a7[_0x1d91('0x2f')]=_0x4027a7['attributes']['length']?_0x4027a7[_0x1d91('0x2f')]:_0x9edc34['model'];_0x4027a7=_[_0x1d91('0x31')]({},_0x4027a7,_0x5977c8[_0x1d91('0x32')]);return utilLicense[_0x1d91('0x33')](_0x4027a7)[_0x1d91('0x21')](respondWithResult(_0x4f26b2,null))['catch'](handleError(_0x4f26b2,null));};exports[_0x1d91('0x1f')]=function(_0x30e1c7,_0x3b0139){if(_0x30e1c7['body']['id']){delete _0x30e1c7['body']['id'];}return db[_0x1d91('0x2a')][_0x1d91('0x34')]({'where':{'id':_0x30e1c7[_0x1d91('0x35')]['id']}})[_0x1d91('0x21')](handleEntityNotFound(_0x3b0139,null))[_0x1d91('0x21')](function(_0x77953){var _0x54f0b1=_0x77953['get']({'plain':!![]});return utilLicense[_0x1d91('0x36')](_0x54f0b1,_0x30e1c7[_0x1d91('0x37')][_0x1d91('0x38')]);})[_0x1d91('0x21')](function(_0x50f845){if(!_0x50f845[_0x1d91('0x39')]){return saveUpdates(_0x30e1c7[_0x1d91('0x37')],null);}return _0x50f845;})[_0x1d91('0x21')](respondWithResult(_0x3b0139,null))[_0x1d91('0x3a')](handleError(_0x3b0139,null));};exports['downloadLogFile']=function(_0x1c1cf5,_0x4cd62e){var _0x3c2ce7=_0x1d91('0x3b');var _0x1c6b85=path[_0x1d91('0x3c')](_0x1d91('0x3d'),_0x1d91('0x3e'),_0x1d91('0x3f'),_0x3c2ce7);_0x4cd62e[_0x1d91('0x40')](_0x1d91('0x41'),_0x1d91('0x42')+_0x3c2ce7);_0x4cd62e['set'](_0x1d91('0x43'),_0x1d91('0x44'));_0x4cd62e['download'](_0x1c6b85);}; \ No newline at end of file +var _0x3b29=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','body','find','params','get','checkLicense','key','demo','catch','join','/var','log','xcally','setHeader','attachment;\x20filename=','text/plain','download'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x3b29,0xd5));var _0x93b2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3b29[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x93b2('0x0'));var rimraf=require(_0x93b2('0x1'));var zipdir=require(_0x93b2('0x2'));var jsonpatch=require(_0x93b2('0x3'));var rp=require('request-promise');var moment=require(_0x93b2('0x4'));var BPromise=require(_0x93b2('0x5'));var Mustache=require('mustache');var util=require(_0x93b2('0x6'));var path=require(_0x93b2('0x7'));var sox=require('sox');var csv=require(_0x93b2('0x8'));var ejs=require(_0x93b2('0x9'));var fs=require('fs');var fs_extra=require(_0x93b2('0xa'));var _=require(_0x93b2('0xb'));var squel=require(_0x93b2('0xc'));var crypto=require(_0x93b2('0xd'));var jsforce=require(_0x93b2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x93b2('0x8'));var querystring=require('querystring');var Papa=require(_0x93b2('0xf'));var Redis=require(_0x93b2('0x10'));var authService=require(_0x93b2('0x11'));var qs=require(_0x93b2('0x12'));var as=require(_0x93b2('0x13'));var hardwareService=require(_0x93b2('0x14'));var logger=require('../../config/logger')(_0x93b2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x93b2('0x16'));var db=require(_0x93b2('0x17'))['db'];function respondWithStatusCode(_0x362988,_0x2da366){_0x2da366=_0x2da366||0xcc;return function(_0x2e5e0b){if(_0x2e5e0b){return _0x362988['sendStatus'](_0x2da366);}return _0x362988['status'](_0x2da366)[_0x93b2('0x18')]();};}function respondWithResult(_0x4f5b34,_0x3e403e){_0x3e403e=_0x3e403e||0xc8;return function(_0x3929a3){if(_0x3929a3){return _0x4f5b34['status'](_0x3e403e)[_0x93b2('0x19')](_0x3929a3);}};}function respondWithFilteredResult(_0x2150b9,_0x2e524e){return function(_0x427646){if(_0x427646){var _0x4ac426=typeof _0x2e524e[_0x93b2('0x1a')]===_0x93b2('0x1b')&&typeof _0x2e524e[_0x93b2('0x1c')]==='undefined';var _0x4f1180=_0x427646[_0x93b2('0x1d')];var _0x50c763=_0x4ac426?0x0:_0x2e524e[_0x93b2('0x1a')];var _0x40d93a=_0x4ac426?_0x427646[_0x93b2('0x1d')]:_0x2e524e[_0x93b2('0x1a')]+_0x2e524e[_0x93b2('0x1c')];var _0x3dff94;if(_0x40d93a>=_0x4f1180){_0x40d93a=_0x4f1180;_0x3dff94=0xc8;}else{_0x3dff94=0xce;}_0x2150b9[_0x93b2('0x1e')](_0x3dff94);return _0x2150b9[_0x93b2('0x1f')]('Content-Range',_0x50c763+'-'+_0x40d93a+'/'+_0x4f1180)['json'](_0x427646);}return null;};}function patchUpdates(_0x2de6b4){return function(_0x7b2de7){try{jsonpatch[_0x93b2('0x20')](_0x7b2de7,_0x2de6b4,!![]);}catch(_0x528f2f){return BPromise[_0x93b2('0x21')](_0x528f2f);}return _0x7b2de7[_0x93b2('0x22')]();};}function saveUpdates(_0x5864e9,_0x577067){return function(_0x4db3f6){if(_0x4db3f6){return _0x4db3f6[_0x93b2('0x23')](_0x5864e9)[_0x93b2('0x24')](function(_0xdb292b){return _0xdb292b;});}return null;};}function removeEntity(_0x203043,_0x1a276d){return function(_0x4fe9b4){if(_0x4fe9b4){return _0x4fe9b4[_0x93b2('0x25')]()[_0x93b2('0x24')](function(){_0x203043['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aebf2,_0x12fc10){return function(_0x5a65ae){if(!_0x5a65ae){_0x2aebf2[_0x93b2('0x26')](0x194);}return _0x5a65ae;};}function handleError(_0x34cc5c,_0x2fb653){_0x2fb653=_0x2fb653||0x1f4;return function(_0x39bb2f){logger[_0x93b2('0x27')](_0x39bb2f[_0x93b2('0x28')]);if(_0x39bb2f[_0x93b2('0x29')]){delete _0x39bb2f[_0x93b2('0x29')];}_0x34cc5c[_0x93b2('0x1e')](_0x2fb653)['send'](_0x39bb2f);};}var utilLicense=require(_0x93b2('0x16'));exports[_0x93b2('0x2a')]=function(_0x4f3403,_0x1ee171){var _0x128e03={'raw':!![],'where':{'id':0x1}},_0x3cc0a1={};_0x3cc0a1[_0x93b2('0x2b')]=_[_0x93b2('0x2c')](db[_0x93b2('0x2d')][_0x93b2('0x2e')]);_0x3cc0a1[_0x93b2('0x2f')]=_['keys'](_0x4f3403[_0x93b2('0x2f')]);_0x3cc0a1['filters']=_[_0x93b2('0x30')](_0x3cc0a1[_0x93b2('0x2b')],_0x3cc0a1[_0x93b2('0x2f')]);_0x128e03[_0x93b2('0x31')]=_[_0x93b2('0x30')](_0x3cc0a1[_0x93b2('0x2b')],qs[_0x93b2('0x32')](_0x4f3403['query'][_0x93b2('0x32')]));_0x128e03[_0x93b2('0x31')]=_0x128e03[_0x93b2('0x31')][_0x93b2('0x33')]?_0x128e03['attributes']:_0x3cc0a1[_0x93b2('0x2b')];_0x128e03=_[_0x93b2('0x34')]({},_0x128e03,_0x4f3403[_0x93b2('0x35')]);return utilLicense[_0x93b2('0x36')](_0x128e03)[_0x93b2('0x24')](respondWithResult(_0x1ee171,null))['catch'](handleError(_0x1ee171,null));};exports['update']=function(_0x5e1c05,_0x3e1eac){if(_0x5e1c05['body']['id']){delete _0x5e1c05[_0x93b2('0x37')]['id'];}return db[_0x93b2('0x2d')][_0x93b2('0x38')]({'where':{'id':_0x5e1c05[_0x93b2('0x39')]['id']}})[_0x93b2('0x24')](handleEntityNotFound(_0x3e1eac,null))[_0x93b2('0x24')](function(_0x37669a){var _0x524547=_0x37669a[_0x93b2('0x3a')]({'plain':!![]});return utilLicense[_0x93b2('0x3b')](_0x524547,_0x5e1c05['body'][_0x93b2('0x3c')]);})[_0x93b2('0x24')](function(_0x33bd5d){if(!_0x33bd5d[_0x93b2('0x3d')]){return saveUpdates(_0x5e1c05['body'],null);}return _0x33bd5d;})[_0x93b2('0x24')](respondWithResult(_0x3e1eac,null))[_0x93b2('0x3e')](handleError(_0x3e1eac,null));};exports['downloadLogFile']=function(_0x5e1048,_0x3a066d){var _0x5526cd='license-info.log';var _0xd4521d=path[_0x93b2('0x3f')](_0x93b2('0x40'),_0x93b2('0x41'),_0x93b2('0x42'),_0x5526cd);_0x3a066d[_0x93b2('0x43')]('Content-disposition',_0x93b2('0x44')+_0x5526cd);_0x3a066d[_0x93b2('0x1f')]('Content-Type',_0x93b2('0x45'));_0x3a066d[_0x93b2('0x46')](_0xd4521d);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1ee4d0e..8068d51 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 _0x2444=['rimraf','../../config/environment','./license.attributes','exports','License','license','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x302f5d,_0x9f2dbb){var _0x1a8ec1=function(_0x36fb35){while(--_0x36fb35){_0x302f5d['push'](_0x302f5d['shift']());}};_0x1a8ec1(++_0x9f2dbb);}(_0x2444,0x1c2));var _0x4244=function(_0x1ef023,_0x1a7c19){_0x1ef023=_0x1ef023-0x0;var _0x5098d5=_0x2444[_0x1ef023];return _0x5098d5;};'use strict';var _=require('lodash');var util=require(_0x4244('0x0'));var logger=require(_0x4244('0x1'))(_0x4244('0x2'));var moment=require('moment');var BPromise=require(_0x4244('0x3'));var rp=require(_0x4244('0x4'));var fs=require('fs');var path=require(_0x4244('0x5'));var rimraf=require(_0x4244('0x6'));var config=require(_0x4244('0x7'));var attributes=require(_0x4244('0x8'));module[_0x4244('0x9')]=function(_0x31692f,_0x4eebd1){return _0x31692f['define'](_0x4244('0xa'),attributes,{'tableName':_0x4244('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8dae=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license'];(function(_0x2b1d6e,_0x3b6ab6){var _0x7fe6cd=function(_0x5df195){while(--_0x5df195){_0x2b1d6e['push'](_0x2b1d6e['shift']());}};_0x7fe6cd(++_0x3b6ab6);}(_0x8dae,0x10e));var _0xe8da=function(_0x7335e9,_0x4b20a6){_0x7335e9=_0x7335e9-0x0;var _0xa2c218=_0x8dae[_0x7335e9];return _0xa2c218;};'use strict';var _=require(_0xe8da('0x0'));var util=require(_0xe8da('0x1'));var logger=require(_0xe8da('0x2'))(_0xe8da('0x3'));var moment=require(_0xe8da('0x4'));var BPromise=require(_0xe8da('0x5'));var rp=require(_0xe8da('0x6'));var fs=require('fs');var path=require(_0xe8da('0x7'));var rimraf=require(_0xe8da('0x8'));var config=require(_0xe8da('0x9'));var attributes=require(_0xe8da('0xa'));module[_0xe8da('0xb')]=function(_0x5d5d07,_0x46f5ae){return _0x5d5d07[_0xe8da('0xc')](_0xe8da('0xd'),attributes,{'tableName':_0xe8da('0xe'),'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 0956c08..06404da 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 _0xb016=['../../config/logger','rpc','../../config/environment','client','http','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xb016,0x1b1));var _0x6b01=function(_0x56d179,_0x521060){_0x56d179=_0x56d179-0x0;var _0x4ae4c1=_0xb016[_0x56d179];return _0x4ae4c1;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require(_0x6b01('0x2'));var BPromise=require(_0x6b01('0x3'));var rs=require(_0x6b01('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x5'))['db'];var utils=require(_0x6b01('0x6'));var logger=require(_0x6b01('0x7'))(_0x6b01('0x8'));var config=require(_0x6b01('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6b01('0xa')][_0x6b01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa5f927,_0x347904,_0x2fbe52){return new BPromise(function(_0x21010b,_0x8cc726){return client['request'](_0xa5f927,_0x2fbe52)[_0x6b01('0xc')](function(_0xe100ee){logger['info'](_0x6b01('0xd'),_0x347904,_0x6b01('0xe'));logger[_0x6b01('0xf')](_0x6b01('0x10'),_0x347904,_0x6b01('0xe'),JSON[_0x6b01('0x11')](_0xe100ee));if(_0xe100ee[_0x6b01('0x12')]){if(_0xe100ee[_0x6b01('0x12')][_0x6b01('0x13')]===0x1f4){logger['error'](_0x6b01('0xd'),_0x347904,_0xe100ee['error'][_0x6b01('0x14')]);return _0x8cc726(_0xe100ee[_0x6b01('0x12')][_0x6b01('0x14')]);}logger[_0x6b01('0x12')](_0x6b01('0xd'),_0x347904,_0xe100ee[_0x6b01('0x12')][_0x6b01('0x14')]);return _0x21010b(_0xe100ee[_0x6b01('0x12')][_0x6b01('0x14')]);}else{logger['info'](_0x6b01('0xd'),_0x347904,'request\x20sent');_0x21010b(_0xe100ee[_0x6b01('0x15')][_0x6b01('0x14')]);}})['catch'](function(_0x3459c3){logger['error'](_0x6b01('0xd'),_0x347904,_0x3459c3);_0x8cc726(_0x3459c3);});});} \ No newline at end of file +var _0x2929=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird'];(function(_0x41e96,_0x4c9b00){var _0x2f16cf=function(_0x3c6cb4){while(--_0x3c6cb4){_0x41e96['push'](_0x41e96['shift']());}};_0x2f16cf(++_0x4c9b00);}(_0x2929,0x164));var _0x9292=function(_0x4c557e,_0x32ac29){_0x4c557e=_0x4c557e-0x0;var _0x113015=_0x2929[_0x4c557e];return _0x113015;};'use strict';var _=require(_0x9292('0x0'));var util=require(_0x9292('0x1'));var moment=require(_0x9292('0x2'));var BPromise=require(_0x9292('0x3'));var rs=require(_0x9292('0x4'));var fs=require('fs');var Redis=require(_0x9292('0x5'));var db=require(_0x9292('0x6'))['db'];var utils=require(_0x9292('0x7'));var logger=require(_0x9292('0x8'))(_0x9292('0x9'));var config=require(_0x9292('0xa'));var jayson=require(_0x9292('0xb'));var client=jayson[_0x9292('0xc')][_0x9292('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x42fc08,_0x1f2af4,_0x536c87){return new BPromise(function(_0x3c34a8,_0x3e5917){return client[_0x9292('0xe')](_0x42fc08,_0x536c87)['then'](function(_0x1fe33a){logger['info'](_0x9292('0xf'),_0x1f2af4,_0x9292('0x10'));logger[_0x9292('0x11')](_0x9292('0x12'),_0x1f2af4,_0x9292('0x10'),JSON[_0x9292('0x13')](_0x1fe33a));if(_0x1fe33a['error']){if(_0x1fe33a[_0x9292('0x14')]['code']===0x1f4){logger['error'](_0x9292('0xf'),_0x1f2af4,_0x1fe33a[_0x9292('0x14')]['message']);return _0x3e5917(_0x1fe33a[_0x9292('0x14')][_0x9292('0x15')]);}logger[_0x9292('0x14')]('License,\x20%s,\x20%s',_0x1f2af4,_0x1fe33a[_0x9292('0x14')][_0x9292('0x15')]);return _0x3c34a8(_0x1fe33a[_0x9292('0x14')][_0x9292('0x15')]);}else{logger[_0x9292('0x16')](_0x9292('0xf'),_0x1f2af4,_0x9292('0x10'));_0x3c34a8(_0x1fe33a['result'][_0x9292('0x15')]);}})[_0x9292('0x17')](function(_0x2aa9ed){logger['error'](_0x9292('0xf'),_0x1f2af4,_0x2aa9ed);_0x3e5917(_0x2aa9ed);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 335a9f5..4e8c39a 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 _0xe7d3=['delete','removeImap','removeSmtp','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','describe','/:id','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','/:id/users','addAgents','put','update','/:id/dispositions','removeDispositions'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xe7d3,0x1c5));var _0x3e7d=function(_0x1da391,_0x11c082){_0x1da391=_0x1da391-0x0;var _0x351b6f=_0xe7d3[_0x1da391];return _0x351b6f;};'use strict';var multer=require(_0x3e7d('0x0'));var util=require(_0x3e7d('0x1'));var path=require(_0x3e7d('0x2'));var timeout=require(_0x3e7d('0x3'));var express=require('express');var router=express[_0x3e7d('0x4')]();var fs_extra=require(_0x3e7d('0x5'));var auth=require(_0x3e7d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3e7d('0x7'));var controller=require(_0x3e7d('0x8'));router['get']('/',auth[_0x3e7d('0x9')](),controller[_0x3e7d('0xa')]);router[_0x3e7d('0xb')]('/describe',auth[_0x3e7d('0x9')](),controller[_0x3e7d('0xc')]);router[_0x3e7d('0xb')](_0x3e7d('0xd'),auth[_0x3e7d('0x9')](),controller['show']);router[_0x3e7d('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x3e7d('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3e7d('0xe')]);router['get'](_0x3e7d('0xf'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x10')]);router['get'](_0x3e7d('0x11'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x12')]);router[_0x3e7d('0xb')](_0x3e7d('0x13'),auth['isAuthenticated'](),controller[_0x3e7d('0x14')]);router['get'](_0x3e7d('0x15'),auth[_0x3e7d('0x9')](),controller['getApplications']);router['get'](_0x3e7d('0x16'),auth['isAuthenticated'](),controller[_0x3e7d('0x17')]);router['get'](_0x3e7d('0x18'),auth[_0x3e7d('0x9')](),controller['verifySmtp']);router[_0x3e7d('0xb')]('/:id/users',auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x19')]);router[_0x3e7d('0x1a')]('/:id/dispositions',auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x1b')]);router[_0x3e7d('0x1a')](_0x3e7d('0x1c'),auth['isAuthenticated'](),controller[_0x3e7d('0x1d')]);router['post']('/',auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x1e')]);router['post'](_0x3e7d('0xf'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x1f')]);router[_0x3e7d('0x1a')](_0x3e7d('0x11'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x20')]);router[_0x3e7d('0x1a')](_0x3e7d('0x13'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x21')]);router[_0x3e7d('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3e7d('0x22')]);router[_0x3e7d('0x1a')](_0x3e7d('0x23'),auth[_0x3e7d('0x9')](),controller['send']);router[_0x3e7d('0x1a')](_0x3e7d('0x24'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x25')]);router[_0x3e7d('0x26')](_0x3e7d('0xd'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x27')]);router['delete'](_0x3e7d('0x28'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x29')]);router[_0x3e7d('0x2a')]('/:id/canned_answers',auth[_0x3e7d('0x9')](),controller['removeAnswers']);router[_0x3e7d('0x2a')](_0x3e7d('0xf'),auth['isAuthenticated'](),controller[_0x3e7d('0x2b')]);router[_0x3e7d('0x2a')](_0x3e7d('0x11'),auth[_0x3e7d('0x9')](),controller[_0x3e7d('0x2c')]);router[_0x3e7d('0x2a')](_0x3e7d('0xd'),auth[_0x3e7d('0x9')](),controller['destroy']);router[_0x3e7d('0x2a')](_0x3e7d('0x24'),auth[_0x3e7d('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x71b3=['/:id/applications','addApplications','/:id/send','send','update','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','removeAgents','multer','connect-timeout','Router','fs-extra','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x71b3,0x8f));var _0x371b=function(_0x5bc300,_0x4fd234){_0x5bc300=_0x5bc300-0x0;var _0x350259=_0x71b3[_0x5bc300];return _0x350259;};'use strict';var multer=require(_0x371b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x371b('0x1'));var express=require('express');var router=express[_0x371b('0x2')]();var fs_extra=require(_0x371b('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x371b('0x4'));var controller=require(_0x371b('0x5'));router[_0x371b('0x6')]('/',auth[_0x371b('0x7')](),controller[_0x371b('0x8')]);router[_0x371b('0x6')](_0x371b('0x9'),auth[_0x371b('0x7')](),controller[_0x371b('0xa')]);router[_0x371b('0x6')](_0x371b('0xb'),auth['isAuthenticated'](),controller[_0x371b('0xc')]);router[_0x371b('0x6')](_0x371b('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x371b('0x6')]('/:id/canned_answers',auth[_0x371b('0x7')](),controller[_0x371b('0xe')]);router[_0x371b('0x6')](_0x371b('0xf'),auth[_0x371b('0x7')](),controller[_0x371b('0x10')]);router[_0x371b('0x6')](_0x371b('0x11'),auth['isAuthenticated'](),controller[_0x371b('0x12')]);router[_0x371b('0x6')](_0x371b('0x13'),auth[_0x371b('0x7')](),controller[_0x371b('0x14')]);router[_0x371b('0x6')]('/:id/applications',auth[_0x371b('0x7')](),controller[_0x371b('0x15')]);router['get']('/:id/messages',auth[_0x371b('0x7')](),controller[_0x371b('0x16')]);router[_0x371b('0x6')](_0x371b('0x17'),auth[_0x371b('0x7')](),controller['verifySmtp']);router[_0x371b('0x6')](_0x371b('0x18'),auth[_0x371b('0x7')](),controller[_0x371b('0x19')]);router[_0x371b('0x1a')](_0x371b('0xd'),auth['isAuthenticated'](),controller[_0x371b('0x1b')]);router[_0x371b('0x1a')]('/:id/canned_answers',auth[_0x371b('0x7')](),controller[_0x371b('0x1c')]);router[_0x371b('0x1a')]('/',auth[_0x371b('0x7')](),controller[_0x371b('0x1d')]);router[_0x371b('0x1a')](_0x371b('0xf'),auth[_0x371b('0x7')](),controller[_0x371b('0x1e')]);router[_0x371b('0x1a')](_0x371b('0x11'),auth[_0x371b('0x7')](),controller[_0x371b('0x1f')]);router[_0x371b('0x1a')]('/:id/interactions',auth[_0x371b('0x7')](),controller[_0x371b('0x20')]);router[_0x371b('0x1a')](_0x371b('0x21'),auth['isAuthenticated'](),controller[_0x371b('0x22')]);router['post'](_0x371b('0x23'),auth[_0x371b('0x7')](),controller[_0x371b('0x24')]);router[_0x371b('0x1a')]('/:id/users',auth[_0x371b('0x7')](),controller['addAgents']);router['put'](_0x371b('0xb'),auth[_0x371b('0x7')](),controller[_0x371b('0x25')]);router[_0x371b('0x26')](_0x371b('0xd'),auth[_0x371b('0x7')](),controller[_0x371b('0x27')]);router[_0x371b('0x26')](_0x371b('0x28'),auth[_0x371b('0x7')](),controller[_0x371b('0x29')]);router['delete'](_0x371b('0xf'),auth[_0x371b('0x7')](),controller[_0x371b('0x2a')]);router[_0x371b('0x26')]('/:id/out_servers',auth[_0x371b('0x7')](),controller['removeSmtp']);router[_0x371b('0x26')](_0x371b('0xb'),auth[_0x371b('0x7')](),controller['destroy']);router['delete'](_0x371b('0x18'),auth[_0x371b('0x7')](),controller[_0x371b('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f1ed1c9..175279a 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 _0x4fa2=['INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','custom','setDataValue','provider','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif'];(function(_0x444f3d,_0x4efd70){var _0x590e65=function(_0x3532f4){while(--_0x3532f4){_0x444f3d['push'](_0x444f3d['shift']());}};_0x590e65(++_0x4efd70);}(_0x4fa2,0xe5));var _0x24fa=function(_0x32d423,_0x3b464){_0x32d423=_0x32d423-0x0;var _0x118ed4=_0x4fa2[_0x32d423];return _0x118ed4;};'use strict';var Sequelize=require('sequelize');module[_0x24fa('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x24fa('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x24fa('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x24fa('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x24fa('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x24fa('0x3')]},'markAsUnread':{'type':Sequelize[_0x24fa('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x24fa('0x2')],'allowNull':![],'defaultValue':_0x24fa('0x4')},'fontSize':{'type':Sequelize[_0x24fa('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x24fa('0x3')],'defaultValue':function(){return _0x24fa('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x24fa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x24fa('0x5')],'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[_0x24fa('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x24fa('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x24fa('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x24fa('0x8'),'set':function(_0x3255af){if(!_0x3255af)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x3255af);}},'provider':{'type':Sequelize[_0x24fa('0x9')](_0x24fa('0xa'),_0x24fa('0xb'),_0x24fa('0xc'),_0x24fa('0xd')),'defaultValue':null,'get':function(){if(!this[_0x24fa('0xe')]('provider'))return'custom';return this[_0x24fa('0xe')]('provider');},'set':function(_0xfb78a1){if(_0xfb78a1===_0x24fa('0xf'))_0xfb78a1=null;return this[_0x24fa('0x10')](_0x24fa('0x11'),_0xfb78a1);}}}; \ No newline at end of file +var _0xf292=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','hotmail','yahoo','outlook365','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}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x44d85d,_0x477ae2){var _0x55f365=function(_0x84b597){while(--_0x84b597){_0x44d85d['push'](_0x44d85d['shift']());}};_0x55f365(++_0x477ae2);}(_0xf292,0x1ea));var _0x2f29=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xf292[_0x119d5a];return _0x15bff4;};'use strict';var Sequelize=require(_0x2f29('0x0'));module['exports']={'description':{'type':Sequelize[_0x2f29('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2f29('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x2f29('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x2f29('0x3')]},'markAsUnread':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2f29('0x1')],'allowNull':![],'defaultValue':_0x2f29('0x4')},'fontSize':{'type':Sequelize[_0x2f29('0x5')](0x2)[_0x2f29('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2f29('0x3')],'defaultValue':function(){return _0x2f29('0x7');}},'notificationSound':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2f29('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2f29('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2f29('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x2f29('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x2f29('0x2')],'defaultValue':![],'comment':_0x2f29('0x9'),'set':function(_0x367e14){if(!_0x367e14)this[_0x2f29('0xa')](_0x2f29('0xb'),null);this[_0x2f29('0xa')](_0x2f29('0xc'),_0x367e14);}},'provider':{'type':Sequelize[_0x2f29('0xd')]('gmail',_0x2f29('0xe'),_0x2f29('0xf'),_0x2f29('0x10')),'defaultValue':null,'get':function(){if(!this[_0x2f29('0x11')]('provider'))return'custom';return this[_0x2f29('0x11')](_0x2f29('0x12'));},'set':function(_0x5bc512){if(_0x5bc512===_0x2f29('0x13'))_0x5bc512=null;return this['setDataValue']('provider',_0x5bc512);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 3f1da82..5270e40 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 _0xac10=['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','addInteraction','MailInteraction','ids','getInteractions','order','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','stack','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','true','send','split','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','defaults','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','bluebird','lodash','juice','ioredis','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','name','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','password','modernAuthentication','CloudProviderId','host','service','authentication','username','pass','port','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','model','query','filters','fields','attributes','sort','pick','filter','merge','VIRTUAL','options','where','count','includeAll','include','rows','show','keys','intersection','length','update','body','provider','custom','secure','find','params','Pause','describe','MailAccountId','create','getDispositions','findOne','hasOwnProperty','nolimit','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','email','ListId','isNil','active','description'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xac10,0x118));var _0x0ac1=function(_0x656c05,_0x1d4b18){_0x656c05=_0x656c05-0x0;var _0x28475a=_0xac10[_0x656c05];return _0x28475a;};'use strict';var moment=require('moment');var BPromise=require(_0x0ac1('0x0'));var util=require('util');var path=require('path');var _=require(_0x0ac1('0x1'));var juice=require(_0x0ac1('0x2'));var Redis=require(_0x0ac1('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0ac1('0x4'));var config=require(_0x0ac1('0x5'));var db=require(_0x0ac1('0x6'))['db'];config[_0x0ac1('0x7')]=_['defaults'](config[_0x0ac1('0x7')],{'host':_0x0ac1('0x8'),'port':0x18eb});var socket=require(_0x0ac1('0x9'))(new Redis(config[_0x0ac1('0x7')]));require(_0x0ac1('0xa'))[_0x0ac1('0xb')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0ac1('0xc')][_0x0ac1('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x4b1933,_0x3f7a50,_0x1f2579,_0xbea05d){return new BPromise(function(_0x50f3a8,_0x27383b){var _0x34766d=_0xbea05d||client;return _0x34766d[_0x0ac1('0xe')](_0x4b1933,_0x1f2579)[_0x0ac1('0xf')](function(_0x14ba68){logger[_0x0ac1('0x10')]('MailAccount,\x20%s,\x20%s',_0x3f7a50,'request\x20sent');logger[_0x0ac1('0x11')](_0x0ac1('0x12'),_0x3f7a50,_0x0ac1('0x13'),JSON[_0x0ac1('0x14')](_0x14ba68));if(_0x14ba68[_0x0ac1('0x15')]){if(_0x14ba68[_0x0ac1('0x15')][_0x0ac1('0x16')]===0x1f4){logger[_0x0ac1('0x15')](_0x0ac1('0x17'),_0x3f7a50,_0x14ba68[_0x0ac1('0x15')][_0x0ac1('0x18')]);return _0x27383b(_0x14ba68['error']['message']);}logger['error'](_0x0ac1('0x17'),_0x3f7a50,_0x14ba68[_0x0ac1('0x15')][_0x0ac1('0x18')]);return _0x50f3a8(_0x14ba68['error'][_0x0ac1('0x18')]);}else{logger[_0x0ac1('0x10')]('MailAccount,\x20%s,\x20%s',_0x3f7a50,_0x0ac1('0x13'));_0x50f3a8(_0x14ba68['result'][_0x0ac1('0x18')]);}})[_0x0ac1('0x19')](function(_0x1f6c38){logger[_0x0ac1('0x15')](_0x0ac1('0x17'),_0x3f7a50,_0x1f6c38);_0x27383b(_0x1f6c38);});});}function respondWithStatusCode(_0x3e1b46,_0xf3c142){_0xf3c142=_0xf3c142||0xcc;return function(_0x3aa4d9){if(_0x3aa4d9){return _0x3e1b46[_0x0ac1('0x1a')](_0xf3c142);}return _0x3e1b46[_0x0ac1('0x1b')](_0xf3c142)[_0x0ac1('0x1c')]();};}function respondWithResult(_0x5d3277,_0xcf268){_0xcf268=_0xcf268||0xc8;return function(_0x3f285e){if(_0x3f285e){return _0x5d3277['status'](_0xcf268)[_0x0ac1('0x1d')](_0x3f285e);}};}function respondWithFilteredResult(_0x2c3fe8,_0x1df08f){return function(_0x4d958e){if(_0x4d958e){var _0x5186ae=typeof _0x1df08f[_0x0ac1('0x1e')]===_0x0ac1('0x1f')&&typeof _0x1df08f[_0x0ac1('0x20')]===_0x0ac1('0x1f');var _0x80c1e=_0x4d958e['count'];var _0x3aa196=_0x5186ae?0x0:_0x1df08f[_0x0ac1('0x1e')];var _0x5947f8=_0x5186ae?_0x4d958e['count']:_0x1df08f[_0x0ac1('0x1e')]+_0x1df08f[_0x0ac1('0x20')];var _0x164187;if(_0x5947f8>=_0x80c1e){_0x5947f8=_0x80c1e;_0x164187=0xc8;}else{_0x164187=0xce;}_0x2c3fe8[_0x0ac1('0x1b')](_0x164187);return _0x2c3fe8[_0x0ac1('0x21')](_0x0ac1('0x22'),_0x3aa196+'-'+_0x5947f8+'/'+_0x80c1e)[_0x0ac1('0x1d')](_0x4d958e);}return null;};}function saveUpdates(_0x2c2acd){return function(_0x561bf1){if(_0x561bf1){return _0x561bf1['update'](_0x2c2acd)['then'](function(_0x275c98){return _0x275c98;});}return null;};}function removeEntity(_0x5a8555){return function(_0x198a08){if(_0x198a08){return _0x198a08[_0x0ac1('0x23')]()[_0x0ac1('0xf')](function(){var _0xf4c99e=_0x198a08[_0x0ac1('0x24')]({'plain':!![]});var _0x173fb4=_0x0ac1('0x25');return db[_0x0ac1('0x26')]['destroy']({'where':{'type':_0x173fb4,'resourceId':_0xf4c99e['id']}})['then'](function(){return _0x198a08;});})[_0x0ac1('0xf')](function(){_0x5a8555[_0x0ac1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a69e9){return function(_0x4cef61){if(!_0x4cef61){_0x1a69e9[_0x0ac1('0x1a')](0x194);}return _0x4cef61;};}function handleError(_0x1b79ba,_0x2cbc23){_0x2cbc23=_0x2cbc23||0x1f4;return function(_0x7a2093){logger[_0x0ac1('0x15')](_0x7a2093['stack']);if(_0x7a2093[_0x0ac1('0x27')]){delete _0x7a2093[_0x0ac1('0x27')];}_0x1b79ba[_0x0ac1('0x1b')](_0x2cbc23)['send'](_0x7a2093);};}function getImapHost(_0x1ad5ce){switch(_0x1ad5ce){case'gmail':return _0x0ac1('0x28');case _0x0ac1('0x29'):return _0x0ac1('0x2a');case _0x0ac1('0x2b'):return'imap-mail.outlook.com';case'outlook365':return _0x0ac1('0x2c');}throw new Error('Unknown\x20email\x20service\x20provider',_0x1ad5ce);}function getSmtpHost(_0x2aa2ea){switch(_0x2aa2ea){case _0x0ac1('0x2d'):return _0x0ac1('0x2e');case _0x0ac1('0x29'):return _0x0ac1('0x2f');case _0x0ac1('0x2b'):return _0x0ac1('0x30');case _0x0ac1('0x31'):return _0x0ac1('0x32');}throw new Error(_0x0ac1('0x33'),_0x2aa2ea);}function getAuthenticationOptions(_0x877a10,_0x3281c7){var _0x54b537={};var _0x4c3694={};if(_0x877a10){_0x54b537[_0x0ac1('0x34')]=_0x4c3694[_0x0ac1('0x34')]=_0x3281c7['username'];_0x54b537[_0x0ac1('0x35')]=_0x4c3694['pass']=_0x3281c7['password'];if(_0x3281c7['modernAuthentication']){_0x54b537[_0x0ac1('0x36')]=_0x4c3694[_0x0ac1('0x36')]=!![];_0x54b537[_0x0ac1('0x37')]=_0x4c3694[_0x0ac1('0x37')]=_0x3281c7[_0x0ac1('0x37')];_0x54b537[_0x0ac1('0x35')]=_0x4c3694['pass']=null;}else{_0x54b537[_0x0ac1('0x37')]=_0x4c3694['CloudProviderId']=null;}_0x54b537[_0x0ac1('0x38')]=getImapHost(_0x877a10);_0x54b537['port']=0x3e1;_0x4c3694[_0x0ac1('0x38')]=getSmtpHost(_0x877a10);_0x4c3694['port']=0x24b;_0x4c3694['secure']=![];_0x54b537[_0x0ac1('0x39')]=_0x4c3694[_0x0ac1('0x39')]=null;}else{if(_0x3281c7[_0x0ac1('0x3a')]){_0x54b537['user']=_0x4c3694[_0x0ac1('0x34')]=_0x3281c7[_0x0ac1('0x3b')];_0x54b537[_0x0ac1('0x35')]=_0x4c3694['pass']=_0x3281c7[_0x0ac1('0x35')];}else{_0x54b537[_0x0ac1('0x3a')]=_0x4c3694[_0x0ac1('0x3a')]=![];_0x54b537['user']=_0x4c3694[_0x0ac1('0x34')]=null;_0x54b537[_0x0ac1('0x35')]=_0x4c3694[_0x0ac1('0x3c')]=null;}_0x54b537[_0x0ac1('0x38')]=_0x3281c7['Imap']['host'];_0x54b537[_0x0ac1('0x3d')]=_0x3281c7[_0x0ac1('0x3e')][_0x0ac1('0x3d')];_0x4c3694[_0x0ac1('0x38')]=_0x3281c7[_0x0ac1('0x3f')][_0x0ac1('0x38')];_0x4c3694['port']=_0x3281c7['Smtp'][_0x0ac1('0x3d')];}return{'Imap':_0x54b537,'Smtp':_0x4c3694};}exports[_0x0ac1('0x40')]=function(_0x2449b4,_0x2616cc){var _0xc5aa04={'include':[{'model':db[_0x0ac1('0x41')],'as':'Imap'},{'model':db[_0x0ac1('0x42')],'as':_0x0ac1('0x3f')},{'model':db['Pause'],'as':_0x0ac1('0x43')}]},_0x2376ff={},_0x5669aa={'count':0x0,'rows':[]};var _0xc1a0a8=_[_0x0ac1('0x44')](db[_0x0ac1('0x45')][_0x0ac1('0x46')],function(_0x895662){return{'name':_0x895662['fieldName'],'type':_0x895662[_0x0ac1('0x47')]['key']};});_0x2376ff[_0x0ac1('0x48')]=_[_0x0ac1('0x44')](_0xc1a0a8,'name');_0x2376ff[_0x0ac1('0x49')]=_['keys'](_0x2449b4['query']);_0x2376ff[_0x0ac1('0x4a')]=_['intersection'](_0x2376ff[_0x0ac1('0x48')],_0x2376ff[_0x0ac1('0x49')]);_0xc5aa04['attributes']=_['intersection'](_0x2376ff['model'],qs[_0x0ac1('0x4b')](_0x2449b4[_0x0ac1('0x49')][_0x0ac1('0x4b')]));_0xc5aa04['attributes']=_0xc5aa04[_0x0ac1('0x4c')]['length']?_0xc5aa04['attributes']:_0x2376ff[_0x0ac1('0x48')];if(!_0x2449b4[_0x0ac1('0x49')]['hasOwnProperty']('nolimit')){_0xc5aa04[_0x0ac1('0x20')]=qs['limit'](_0x2449b4[_0x0ac1('0x49')]['limit']);_0xc5aa04[_0x0ac1('0x1e')]=qs[_0x0ac1('0x1e')](_0x2449b4[_0x0ac1('0x49')][_0x0ac1('0x1e')]);}_0xc5aa04['order']=qs[_0x0ac1('0x4d')](_0x2449b4[_0x0ac1('0x49')][_0x0ac1('0x4d')]);_0xc5aa04['where']=qs[_0x0ac1('0x4a')](_[_0x0ac1('0x4e')](_0x2449b4[_0x0ac1('0x49')],_0x2376ff[_0x0ac1('0x4a')]),_0xc1a0a8);if(_0x2449b4[_0x0ac1('0x49')][_0x0ac1('0x4f')]){_0xc5aa04['where']=_[_0x0ac1('0x50')](_0xc5aa04['where'],{'$or':_['map'](_0xc1a0a8,function(_0x7dd8a2){if(_0x7dd8a2['type']!==_0x0ac1('0x51')){var _0x432c00={};_0x432c00[_0x7dd8a2[_0x0ac1('0x27')]]={'$like':'%'+_0x2449b4[_0x0ac1('0x49')]['filter']+'%'};return _0x432c00;}})});}_0xc5aa04=_['merge']({},_0xc5aa04,_0x2449b4[_0x0ac1('0x52')]);var _0x59ec1e={'where':_0xc5aa04[_0x0ac1('0x53')]};return db['MailAccount'][_0x0ac1('0x54')](_0x59ec1e)[_0x0ac1('0xf')](function(_0x4228b0){_0x5669aa[_0x0ac1('0x54')]=_0x4228b0;if(_0x2449b4[_0x0ac1('0x49')][_0x0ac1('0x55')]){_0xc5aa04[_0x0ac1('0x56')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0xc5aa04);})[_0x0ac1('0xf')](function(_0x40d1dc){_0x5669aa[_0x0ac1('0x57')]=_0x40d1dc;return _0x5669aa;})[_0x0ac1('0xf')](respondWithFilteredResult(_0x2616cc,_0xc5aa04))[_0x0ac1('0x19')](handleError(_0x2616cc,null));};exports[_0x0ac1('0x58')]=function(_0x56ddb0,_0x48d9e3){var _0x4034cd={'raw':![],'where':{'id':_0x56ddb0['params']['id']},'include':[{'model':db[_0x0ac1('0x41')],'as':_0x0ac1('0x3e')},{'model':db['MailServerOut'],'as':_0x0ac1('0x3f')},{'model':db['Pause'],'as':_0x0ac1('0x43')}]},_0x5e28cc={};_0x5e28cc[_0x0ac1('0x48')]=_[_0x0ac1('0x59')](db[_0x0ac1('0x45')][_0x0ac1('0x46')]);_0x5e28cc[_0x0ac1('0x49')]=_[_0x0ac1('0x59')](_0x56ddb0[_0x0ac1('0x49')]);_0x5e28cc['filters']=_[_0x0ac1('0x5a')](_0x5e28cc['model'],_0x5e28cc[_0x0ac1('0x49')]);_0x4034cd[_0x0ac1('0x4c')]=_[_0x0ac1('0x5a')](_0x5e28cc[_0x0ac1('0x48')],qs[_0x0ac1('0x4b')](_0x56ddb0[_0x0ac1('0x49')][_0x0ac1('0x4b')]));_0x4034cd[_0x0ac1('0x4c')]=_0x4034cd[_0x0ac1('0x4c')][_0x0ac1('0x5b')]?_0x4034cd['attributes']:_0x5e28cc['model'];if(_0x56ddb0['query'][_0x0ac1('0x55')]){_0x4034cd[_0x0ac1('0x56')]=[{'all':!![]}];}_0x4034cd=_[_0x0ac1('0x50')]({},_0x4034cd,_0x56ddb0[_0x0ac1('0x52')]);return db[_0x0ac1('0x45')]['find'](_0x4034cd)[_0x0ac1('0xf')](handleEntityNotFound(_0x48d9e3,null))[_0x0ac1('0xf')](respondWithResult(_0x48d9e3,null))[_0x0ac1('0x19')](handleError(_0x48d9e3,null));};exports[_0x0ac1('0x5c')]=function(_0x2b0e87,_0x166964){if(_0x2b0e87[_0x0ac1('0x5d')]['id']){delete _0x2b0e87[_0x0ac1('0x5d')]['id'];}var _0x1ca038=_0x2b0e87[_0x0ac1('0x5d')][_0x0ac1('0x5e')]===_0x0ac1('0x5f')?null:_0x2b0e87[_0x0ac1('0x5d')][_0x0ac1('0x5e')];var _0x14ef4f=_0x2b0e87[_0x0ac1('0x5d')][_0x0ac1('0x3e')]||{};var _0x13a6c8=_0x2b0e87[_0x0ac1('0x5d')][_0x0ac1('0x3f')]||{};if(_0x1ca038){_0x14ef4f[_0x0ac1('0x38')]=getImapHost(_0x1ca038);_0x14ef4f[_0x0ac1('0x3d')]=0x3e1;_0x13a6c8['host']=getSmtpHost(_0x1ca038);_0x13a6c8[_0x0ac1('0x3d')]=0x24b;_0x13a6c8[_0x0ac1('0x60')]=![];}if(_0x13a6c8['modernAuthentication']){_0x13a6c8[_0x0ac1('0x60')]=![];}else{_0x13a6c8[_0x0ac1('0x37')]=null;}if(!_0x14ef4f[_0x0ac1('0x36')])_0x14ef4f[_0x0ac1('0x37')]=null;_0x2b0e87['body'][_0x0ac1('0x3e')]=_0x14ef4f;_0x2b0e87[_0x0ac1('0x5d')]['Smtp']=_0x13a6c8;return db[_0x0ac1('0x45')][_0x0ac1('0x61')]({'where':{'id':_0x2b0e87[_0x0ac1('0x62')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0ac1('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x0ac1('0x63')],'as':_0x0ac1('0x43')}]})['then'](handleEntityNotFound(_0x166964,null))[_0x0ac1('0xf')](function(_0xb78130){if(!_0xb78130)throw new Error('Mail\x20Account\x20not\x20found');if(_0xb78130['service'])delete _0x2b0e87[_0x0ac1('0x5d')][_0x0ac1('0x3e')];return _0xb78130;})[_0x0ac1('0xf')](saveUpdates(_0x2b0e87['body'],null))['then'](function(_0x268a9e){if(!_0x2b0e87[_0x0ac1('0x5d')][_0x0ac1('0x3e')])return _0x268a9e;return db[_0x0ac1('0x41')][_0x0ac1('0x5c')](_0x2b0e87[_0x0ac1('0x5d')][_0x0ac1('0x3e')],{'where':{'MailAccountId':_0x268a9e['id']}})['then'](function(){return _0x268a9e;});})[_0x0ac1('0xf')](function(_0x230dda){if(!_0x2b0e87[_0x0ac1('0x5d')]['Smtp'])return _0x230dda;return db[_0x0ac1('0x42')]['update'](_0x2b0e87['body']['Smtp'],{'where':{'MailAccountId':_0x230dda['id']}})['then'](function(){return _0x230dda;});})[_0x0ac1('0xf')](respondWithResult(_0x166964,null))[_0x0ac1('0x19')](handleError(_0x166964,null));};exports[_0x0ac1('0x64')]=function(_0x25cb0e,_0x546190){return db[_0x0ac1('0x45')][_0x0ac1('0x64')]()[_0x0ac1('0xf')](respondWithResult(_0x546190,null))[_0x0ac1('0x19')](handleError(_0x546190,null));};exports['addDisposition']=function(_0x36eea2,_0x3673ac){if(_0x36eea2[_0x0ac1('0x5d')]['id']){delete _0x36eea2[_0x0ac1('0x5d')]['id'];}return db['MailAccount'][_0x0ac1('0x61')]({'where':{'id':_0x36eea2['params']['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x3673ac,null))[_0x0ac1('0xf')](function(_0x4fd02e){if(_0x4fd02e){_0x36eea2['body'][_0x0ac1('0x65')]=_0x4fd02e['id'];return db['Disposition'][_0x0ac1('0x66')](_0x36eea2[_0x0ac1('0x5d')]);}})[_0x0ac1('0xf')](respondWithResult(_0x3673ac,null))[_0x0ac1('0x19')](handleError(_0x3673ac,null));};exports[_0x0ac1('0x67')]=function(_0xf3b10e,_0x3d12e2){var _0x38fc8c={'raw':![],'where':{}};var _0x1a3d16={};var _0x5dc6e2={'count':0x0,'rows':[]};return db[_0x0ac1('0x45')][_0x0ac1('0x68')]({'where':{'id':_0xf3b10e[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x3d12e2,null))['then'](function(_0x558d9d){if(_0x558d9d){_0x1a3d16[_0x0ac1('0x48')]=_[_0x0ac1('0x59')](db['Disposition'][_0x0ac1('0x46')]);_0x1a3d16[_0x0ac1('0x49')]=_[_0x0ac1('0x59')](_0xf3b10e[_0x0ac1('0x49')]);_0x1a3d16[_0x0ac1('0x4a')]=_[_0x0ac1('0x5a')](_0x1a3d16[_0x0ac1('0x48')],_0x1a3d16[_0x0ac1('0x49')]);_0x38fc8c[_0x0ac1('0x4c')]=_[_0x0ac1('0x5a')](_0x1a3d16[_0x0ac1('0x48')],qs[_0x0ac1('0x4b')](_0xf3b10e[_0x0ac1('0x49')][_0x0ac1('0x4b')]));_0x38fc8c['attributes']=_0x38fc8c['attributes'][_0x0ac1('0x5b')]?_0x38fc8c[_0x0ac1('0x4c')]:_0x1a3d16['model'];if(!_0xf3b10e[_0x0ac1('0x49')][_0x0ac1('0x69')](_0x0ac1('0x6a'))){_0x38fc8c[_0x0ac1('0x20')]=qs[_0x0ac1('0x20')](_0xf3b10e['query'][_0x0ac1('0x20')]);_0x38fc8c['offset']=qs[_0x0ac1('0x1e')](_0xf3b10e[_0x0ac1('0x49')][_0x0ac1('0x1e')]);}_0x38fc8c['order']=qs[_0x0ac1('0x4d')](_0xf3b10e[_0x0ac1('0x49')]['sort']);_0x38fc8c[_0x0ac1('0x53')]=qs['filters'](_['pick'](_0xf3b10e['query'],_0x1a3d16['filters']));_0x38fc8c[_0x0ac1('0x53')]['MailAccountId']=_0x558d9d['id'];if(_0xf3b10e[_0x0ac1('0x49')][_0x0ac1('0x4f')]){_0x38fc8c[_0x0ac1('0x53')]=_[_0x0ac1('0x50')](_0x38fc8c[_0x0ac1('0x53')],{'$or':_[_0x0ac1('0x44')](_0x38fc8c['attributes'],function(_0x31a6bc){var _0x20e169={};_0x20e169[_0x31a6bc]={'$like':'%'+_0xf3b10e[_0x0ac1('0x49')][_0x0ac1('0x4f')]+'%'};return _0x20e169;})});}_0x38fc8c=_['merge']({},_0x38fc8c,_0xf3b10e['options']);return db['Disposition'][_0x0ac1('0x54')]({'where':_0x38fc8c['where']})[_0x0ac1('0xf')](function(_0x505378){_0x5dc6e2[_0x0ac1('0x54')]=_0x505378;if(_0xf3b10e[_0x0ac1('0x49')][_0x0ac1('0x55')]){_0x38fc8c[_0x0ac1('0x56')]=[{'all':!![]}];}return db[_0x0ac1('0x6b')][_0x0ac1('0x6c')](_0x38fc8c);})[_0x0ac1('0xf')](function(_0x1c038c){_0x5dc6e2[_0x0ac1('0x57')]=_0x1c038c;return _0x5dc6e2;});}})[_0x0ac1('0xf')](respondWithFilteredResult(_0x3d12e2,_0x38fc8c))[_0x0ac1('0x19')](handleError(_0x3d12e2,null));};exports[_0x0ac1('0x6d')]=function(_0x541688,_0x1633be){return db[_0x0ac1('0x45')][_0x0ac1('0x61')]({'where':{'id':_0x541688[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x1633be,null))['then'](function(_0x54fd83){if(_0x54fd83){return _0x54fd83['removeDispositions'](_0x541688[_0x0ac1('0x49')]['ids']);}})[_0x0ac1('0xf')](respondWithStatusCode(_0x1633be,null))['catch'](handleError(_0x1633be,null));};exports[_0x0ac1('0x6e')]=function(_0x435f2e,_0x35408e){if(_0x435f2e[_0x0ac1('0x5d')]['id']){delete _0x435f2e[_0x0ac1('0x5d')]['id'];}return db[_0x0ac1('0x45')][_0x0ac1('0x61')]({'where':{'id':_0x435f2e[_0x0ac1('0x62')]['id']}})['then'](handleEntityNotFound(_0x35408e,null))['then'](function(_0xe6ff71){if(_0xe6ff71){_0x435f2e['body'][_0x0ac1('0x65')]=_0xe6ff71['id'];return db[_0x0ac1('0x6f')]['create'](_0x435f2e['body']);}})[_0x0ac1('0xf')](respondWithResult(_0x35408e,null))[_0x0ac1('0x19')](handleError(_0x35408e,null));};exports[_0x0ac1('0x70')]=function(_0x52f709,_0x1d788a){var _0x4b3a93={'raw':![],'where':{}};var _0x1a182e={};var _0xde2f06={'count':0x0,'rows':[]};return db[_0x0ac1('0x45')]['findOne']({'where':{'id':_0x52f709[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x1d788a,null))[_0x0ac1('0xf')](function(_0xa58438){if(_0xa58438){_0x1a182e[_0x0ac1('0x48')]=_[_0x0ac1('0x59')](db[_0x0ac1('0x6f')]['rawAttributes']);_0x1a182e[_0x0ac1('0x49')]=_['keys'](_0x52f709[_0x0ac1('0x49')]);_0x1a182e['filters']=_[_0x0ac1('0x5a')](_0x1a182e[_0x0ac1('0x48')],_0x1a182e[_0x0ac1('0x49')]);_0x4b3a93[_0x0ac1('0x4c')]=_[_0x0ac1('0x5a')](_0x1a182e[_0x0ac1('0x48')],qs[_0x0ac1('0x4b')](_0x52f709[_0x0ac1('0x49')]['fields']));_0x4b3a93[_0x0ac1('0x4c')]=_0x4b3a93[_0x0ac1('0x4c')][_0x0ac1('0x5b')]?_0x4b3a93[_0x0ac1('0x4c')]:_0x1a182e[_0x0ac1('0x48')];if(!_0x52f709[_0x0ac1('0x49')][_0x0ac1('0x69')](_0x0ac1('0x6a'))){_0x4b3a93['limit']=qs[_0x0ac1('0x20')](_0x52f709[_0x0ac1('0x49')][_0x0ac1('0x20')]);_0x4b3a93['offset']=qs[_0x0ac1('0x1e')](_0x52f709[_0x0ac1('0x49')][_0x0ac1('0x1e')]);}_0x4b3a93['order']=qs['sort'](_0x52f709[_0x0ac1('0x49')][_0x0ac1('0x4d')]);_0x4b3a93['where']=qs[_0x0ac1('0x4a')](_[_0x0ac1('0x4e')](_0x52f709[_0x0ac1('0x49')],_0x1a182e['filters']));_0x4b3a93[_0x0ac1('0x53')][_0x0ac1('0x65')]=_0xa58438['id'];if(_0x52f709[_0x0ac1('0x49')][_0x0ac1('0x4f')]){_0x4b3a93['where']=_['merge'](_0x4b3a93['where'],{'$or':_[_0x0ac1('0x44')](_0x4b3a93[_0x0ac1('0x4c')],function(_0x241246){var _0x37aff4={};_0x37aff4[_0x241246]={'$like':'%'+_0x52f709['query']['filter']+'%'};return _0x37aff4;})});}_0x4b3a93=_['merge']({},_0x4b3a93,_0x52f709[_0x0ac1('0x52')]);return db[_0x0ac1('0x6f')][_0x0ac1('0x54')]({'where':_0x4b3a93['where']})[_0x0ac1('0xf')](function(_0x1cd143){_0xde2f06[_0x0ac1('0x54')]=_0x1cd143;if(_0x52f709[_0x0ac1('0x49')][_0x0ac1('0x55')]){_0x4b3a93[_0x0ac1('0x56')]=[{'all':!![]}];}return db[_0x0ac1('0x6f')][_0x0ac1('0x6c')](_0x4b3a93);})[_0x0ac1('0xf')](function(_0x49d0d3){_0xde2f06[_0x0ac1('0x57')]=_0x49d0d3;return _0xde2f06;});}})[_0x0ac1('0xf')](respondWithFilteredResult(_0x1d788a,_0x4b3a93))['catch'](handleError(_0x1d788a,null));};exports['removeAnswers']=function(_0x30eb64,_0x57a88e){return db[_0x0ac1('0x45')][_0x0ac1('0x61')]({'where':{'id':_0x30eb64['params']['id']}})['then'](handleEntityNotFound(_0x57a88e,null))['then'](function(_0x43ff1f){if(_0x43ff1f){return _0x43ff1f[_0x0ac1('0x71')](_0x30eb64[_0x0ac1('0x49')]['ids']);}})[_0x0ac1('0xf')](respondWithStatusCode(_0x57a88e,null))[_0x0ac1('0x19')](handleError(_0x57a88e,null));};exports[_0x0ac1('0x66')]=function(_0x4b50d7,_0x388ea2){var _0x4510f0={'name':_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x27')],'key':_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x72')],'provider':_0x4b50d7['body'][_0x0ac1('0x5e')]===_0x0ac1('0x5f')?null:_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x5e')],'email':_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x73')],'ListId':_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x74')],'active':!_[_0x0ac1('0x75')](_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x76')])?_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x76')]:!![],'description':_0x4b50d7[_0x0ac1('0x5d')][_0x0ac1('0x77')]||null};var _0x40d6a6=getAuthenticationOptions(_0x4510f0[_0x0ac1('0x5e')],_0x4b50d7[_0x0ac1('0x5d')]);_0x4510f0['Imap']=_0x40d6a6[_0x0ac1('0x3e')];_0x4510f0['Smtp']=_0x40d6a6[_0x0ac1('0x3f')];return db[_0x0ac1('0x45')][_0x0ac1('0x66')](_0x4510f0,{'include':[{'model':db[_0x0ac1('0x42')],'as':_0x0ac1('0x3f')},{'model':db[_0x0ac1('0x41')],'as':_0x0ac1('0x3e')}]})[_0x0ac1('0xf')](function(_0x5018e4){var _0x22fae7=_0x4b50d7[_0x0ac1('0x34')]['get']({'plain':!![]});if(!_0x22fae7)throw new Error(_0x0ac1('0x78'));if(_0x22fae7[_0x0ac1('0x79')]==='user'){var _0x2790e8=_0x5018e4[_0x0ac1('0x24')]({'plain':!![]});return db[_0x0ac1('0x7a')][_0x0ac1('0x61')]({'where':{'name':_0x0ac1('0x25'),'userProfileId':_0x22fae7[_0x0ac1('0x7b')]},'raw':!![]})['then'](function(_0x52f872){if(_0x52f872&&_0x52f872[_0x0ac1('0x7c')]===0x0){return db[_0x0ac1('0x26')][_0x0ac1('0x66')]({'name':_0x2790e8[_0x0ac1('0x27')],'resourceId':_0x2790e8['id'],'type':_0x52f872['name'],'sectionId':_0x52f872['id']},{})[_0x0ac1('0xf')](function(){return _0x5018e4;});}else{return _0x5018e4;}})[_0x0ac1('0x19')](function(_0x5cdda5){logger[_0x0ac1('0x15')](_0x0ac1('0x7d'),_0x5cdda5);throw _0x5cdda5;});}return _0x5018e4;})[_0x0ac1('0xf')](respondWithResult(_0x388ea2,0xc9))['catch'](handleError(_0x388ea2,null));};exports[_0x0ac1('0x7e')]=function(_0x15ec1b,_0x5d637c){return db[_0x0ac1('0x45')][_0x0ac1('0x68')]({'where':{'id':_0x15ec1b[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x5d637c,null))[_0x0ac1('0xf')](function(_0x1ebdb9){if(_0x1ebdb9){return _0x1ebdb9[_0x0ac1('0x7e')]();}return null;})[_0x0ac1('0xf')](respondWithResult(_0x5d637c,null))['catch'](handleError(_0x5d637c,null));};exports[_0x0ac1('0x7f')]=function(_0x2a13a9,_0x4fbef6){if(_0x2a13a9[_0x0ac1('0x5d')]['id']){delete _0x2a13a9[_0x0ac1('0x5d')]['id'];}return db[_0x0ac1('0x45')][_0x0ac1('0x61')]({'where':{'id':_0x2a13a9['params']['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x4fbef6,null))[_0x0ac1('0xf')](function(_0x59de60){if(_0x59de60){_0x2a13a9[_0x0ac1('0x5d')]['MailAccountId']=_0x59de60['id'];return db[_0x0ac1('0x41')]['create'](_0x2a13a9[_0x0ac1('0x5d')]);}})['then'](respondWithResult(_0x4fbef6,null))[_0x0ac1('0x19')](handleError(_0x4fbef6,null));};exports[_0x0ac1('0x80')]=function(_0x1d56f5,_0x597c51){return db['MailAccount'][_0x0ac1('0x68')]({'where':{'id':_0x1d56f5[_0x0ac1('0x62')]['id']}})['then'](handleEntityNotFound(_0x597c51,null))['then'](function(_0x50708e){if(_0x50708e){return _0x50708e[_0x0ac1('0x81')](null);}return null;})[_0x0ac1('0xf')](respondWithStatusCode(_0x597c51,null))[_0x0ac1('0x19')](handleError(_0x597c51,null));};exports[_0x0ac1('0x82')]=function(_0x2a5464,_0x1d5595){return db['MailAccount'][_0x0ac1('0x68')]({'where':{'id':_0x2a5464['params']['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x1d5595,null))[_0x0ac1('0xf')](function(_0x373e8d){if(_0x373e8d){return _0x373e8d[_0x0ac1('0x82')]();}return null;})[_0x0ac1('0xf')](respondWithResult(_0x1d5595,null))[_0x0ac1('0x19')](handleError(_0x1d5595,null));};exports[_0x0ac1('0x83')]=function(_0x51955d,_0x2920df){if(_0x51955d['body']['id']){delete _0x51955d['body']['id'];}return db[_0x0ac1('0x45')][_0x0ac1('0x61')]({'where':{'id':_0x51955d[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x2920df,null))[_0x0ac1('0xf')](function(_0x57ed91){if(_0x57ed91){_0x51955d[_0x0ac1('0x5d')][_0x0ac1('0x65')]=_0x57ed91['id'];return db[_0x0ac1('0x42')][_0x0ac1('0x66')](_0x51955d[_0x0ac1('0x5d')]);}})[_0x0ac1('0xf')](respondWithResult(_0x2920df,null))[_0x0ac1('0x19')](handleError(_0x2920df,null));};exports[_0x0ac1('0x84')]=function(_0x9dbe14,_0x42ff95){return db[_0x0ac1('0x45')][_0x0ac1('0x68')]({'where':{'id':_0x9dbe14[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x42ff95,null))[_0x0ac1('0xf')](function(_0x47121c){if(_0x47121c){return _0x47121c['setSmtp'](null);}return null;})[_0x0ac1('0xf')](respondWithStatusCode(_0x42ff95,null))[_0x0ac1('0x19')](handleError(_0x42ff95,null));};exports[_0x0ac1('0x85')]=function(_0x220c64,_0x3d272d){return db[_0x0ac1('0x86')][_0x0ac1('0x61')]({'where':{'id':_0x220c64[_0x0ac1('0x62')]['id']}})['then'](handleEntityNotFound(_0x3d272d,null))[_0x0ac1('0xf')](function(_0x356c4a){if(_0x356c4a){return _0x356c4a[_0x0ac1('0x85')](_0x220c64[_0x0ac1('0x5d')][_0x0ac1('0x87')],_['omit'](_0x220c64[_0x0ac1('0x5d')],[_0x0ac1('0x87'),'id'])||{});}})[_0x0ac1('0xf')](respondWithResult(_0x3d272d,null))['catch'](handleError(_0x3d272d,null));};exports[_0x0ac1('0x88')]=function(_0x2c8a8e,_0xd07dca){var _0x2676ad={'raw':![],'where':{}};var _0x4c4582={};var _0x2476e3={'count':0x0,'rows':[]};return db['MailAccount'][_0x0ac1('0x68')]({'where':{'id':_0x2c8a8e[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0xd07dca,null))[_0x0ac1('0xf')](function(_0x1186c0){if(_0x1186c0){_0x4c4582[_0x0ac1('0x48')]=_[_0x0ac1('0x59')](db[_0x0ac1('0x86')][_0x0ac1('0x46')]);_0x4c4582['query']=_[_0x0ac1('0x59')](_0x2c8a8e[_0x0ac1('0x49')]);_0x4c4582[_0x0ac1('0x4a')]=_[_0x0ac1('0x5a')](_0x4c4582[_0x0ac1('0x48')],_0x4c4582['query']);_0x2676ad['attributes']=_[_0x0ac1('0x5a')](_0x4c4582['model'],qs[_0x0ac1('0x4b')](_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x4b')]));_0x2676ad[_0x0ac1('0x4c')]=_0x2676ad['attributes'][_0x0ac1('0x5b')]?_0x2676ad[_0x0ac1('0x4c')]:_0x4c4582[_0x0ac1('0x48')];if(!_0x2c8a8e['query']['hasOwnProperty'](_0x0ac1('0x6a'))){_0x2676ad[_0x0ac1('0x20')]=qs[_0x0ac1('0x20')](_0x2c8a8e['query']['limit']);_0x2676ad[_0x0ac1('0x1e')]=qs['offset'](_0x2c8a8e['query'][_0x0ac1('0x1e')]);}_0x2676ad[_0x0ac1('0x89')]=qs[_0x0ac1('0x4d')](_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x4d')]);_0x2676ad[_0x0ac1('0x53')]=qs['filters'](_[_0x0ac1('0x4e')](_0x2c8a8e[_0x0ac1('0x49')],_0x4c4582[_0x0ac1('0x4a')]));_0x2676ad[_0x0ac1('0x53')][_0x0ac1('0x65')]=_0x1186c0['id'];if(_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x4f')]){_0x2676ad['where']=_[_0x0ac1('0x50')](_0x2676ad['where'],{'$or':_[_0x0ac1('0x44')](_0x2676ad[_0x0ac1('0x4c')],function(_0x171d77){var _0xf864b9={};_0xf864b9[_0x171d77]={'$like':'%'+_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x4f')]+'%'};return _0xf864b9;})});}_0x2676ad=_[_0x0ac1('0x50')]({},_0x2676ad,_0x2c8a8e[_0x0ac1('0x52')]);return db['MailInteraction'][_0x0ac1('0x54')]({'where':_0x2676ad[_0x0ac1('0x53')]})['then'](function(_0x5633b1){_0x2476e3[_0x0ac1('0x54')]=_0x5633b1;if(_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x55')]){_0x2676ad[_0x0ac1('0x56')]=[{'model':db[_0x0ac1('0x8a')],'as':_0x0ac1('0x8b'),'required':![]},{'model':db['User'],'as':_0x0ac1('0x8c'),'attributes':[_0x0ac1('0x27'),'fullname',_0x0ac1('0x8d')],'required':![]},{'model':db[_0x0ac1('0x8e')],'as':_0x0ac1('0x8f'),'attributes':['id',_0x0ac1('0x27'),_0x0ac1('0x90')],'where':_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x91')]?{'id':_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x91')]}:undefined,'required':_0x2c8a8e[_0x0ac1('0x49')][_0x0ac1('0x91')]?!![]:![]}];}return db[_0x0ac1('0x86')][_0x0ac1('0x6c')](_0x2676ad);})[_0x0ac1('0xf')](function(_0x5231a7){_0x2476e3['rows']=_0x5231a7;return _0x2476e3;});}})[_0x0ac1('0xf')](respondWithFilteredResult(_0xd07dca,_0x2676ad))['catch'](handleError(_0xd07dca,null));};exports['addApplications']=function addApplications(_0x5da1f1,_0x39939d){var _0x5aa760=_0x5da1f1[_0x0ac1('0x62')]['id'];var _0x49f307=_0x5da1f1[_0x0ac1('0x5d')];var _0x50aa81=0xc8;var _0x1bc7f9=null;return db[_0x0ac1('0x92')][_0x0ac1('0x93')]({'isolationLevel':db[_0x0ac1('0x92')][_0x0ac1('0x94')][_0x0ac1('0x95')][_0x0ac1('0x96')]},function(_0x57f065){return db[_0x0ac1('0x45')][_0x0ac1('0x68')]({'where':{'id':_0x5aa760},'transaction':_0x57f065})['then'](function(_0x5e975a){if(_0x5e975a){return db[_0x0ac1('0x97')][_0x0ac1('0x23')]({'where':{'MailAccountId':_0x5aa760},'transaction':_0x57f065})[_0x0ac1('0xf')](function(){var _0x273a32=_[_0x0ac1('0x44')](_0x49f307,function(_0xb98eb0){_0xb98eb0[_0x0ac1('0x65')]=_0x5aa760;return _0xb98eb0;});return db[_0x0ac1('0x97')]['bulkCreate'](_0x273a32,{'transaction':_0x57f065});});}else{_0x50aa81=0x194;_0x1bc7f9=[];}});})[_0x0ac1('0xf')](function(){if(_0x50aa81!==0x194){return db[_0x0ac1('0x97')]['findAndCountAll']({'where':{'MailAccountId':_0x5aa760},'order':_0x0ac1('0x98')})[_0x0ac1('0xf')](function(_0x34a658){_0x1bc7f9=_0x34a658;});}})[_0x0ac1('0x19')](function(_0x719982){_0x50aa81=0x1f4;logger[_0x0ac1('0x15')](_0x719982[_0x0ac1('0x99')]);if(_0x719982[_0x0ac1('0x27')]){delete _0x719982[_0x0ac1('0x27')];}_0x1bc7f9=_0x719982;})[_0x0ac1('0x9a')](function(){if(_0x1bc7f9===null){_0x39939d[_0x0ac1('0x1a')](_0x50aa81);}else{if(_0x50aa81===0x1f4){_0x39939d[_0x0ac1('0x1b')](_0x50aa81)['send'](_0x1bc7f9);}else{_0x39939d['status'](_0x50aa81)[_0x0ac1('0x1d')](_0x1bc7f9);}}});};exports['getApplications']=function(_0x8bac22,_0x3d763b){var _0x2f0e19={};var _0x38624a={};var _0x4d23ae;var _0x2a4ea2;return db[_0x0ac1('0x45')][_0x0ac1('0x68')]({'where':{'id':_0x8bac22[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x3d763b,null))[_0x0ac1('0xf')](function(_0x53aced){if(_0x53aced){_0x4d23ae=_0x53aced;_0x38624a[_0x0ac1('0x48')]=_[_0x0ac1('0x59')](db[_0x0ac1('0x97')]['rawAttributes']);_0x38624a[_0x0ac1('0x49')]=_[_0x0ac1('0x59')](_0x8bac22['query']);_0x38624a[_0x0ac1('0x4a')]=_[_0x0ac1('0x5a')](_0x38624a['model'],_0x38624a[_0x0ac1('0x49')]);_0x2f0e19[_0x0ac1('0x4c')]=_[_0x0ac1('0x5a')](_0x38624a['model'],qs['fields'](_0x8bac22['query'][_0x0ac1('0x4b')]));_0x2f0e19[_0x0ac1('0x4c')]=_0x2f0e19[_0x0ac1('0x4c')][_0x0ac1('0x5b')]?_0x2f0e19[_0x0ac1('0x4c')]:_0x38624a[_0x0ac1('0x48')];_0x2f0e19[_0x0ac1('0x89')]=qs[_0x0ac1('0x4d')](_0x8bac22['query']['sort']);_0x2f0e19[_0x0ac1('0x53')]=qs[_0x0ac1('0x4a')](_['pick'](_0x8bac22['query'],_0x38624a[_0x0ac1('0x4a')]));if(_0x8bac22[_0x0ac1('0x49')][_0x0ac1('0x4f')]){_0x2f0e19[_0x0ac1('0x53')]=_[_0x0ac1('0x50')](_0x2f0e19[_0x0ac1('0x53')],{'$or':_['map'](_0x2f0e19[_0x0ac1('0x4c')],function(_0x2a0ccb){var _0x5802cc={};_0x5802cc[_0x2a0ccb]={'$like':'%'+_0x8bac22[_0x0ac1('0x49')][_0x0ac1('0x4f')]+'%'};return _0x5802cc;})});}_0x2f0e19=_['merge']({},_0x2f0e19,_0x8bac22[_0x0ac1('0x52')]);return _0x4d23ae[_0x0ac1('0x9b')](_0x2f0e19);}})[_0x0ac1('0xf')](function(_0x33c35b){if(_0x33c35b){_0x2a4ea2=_0x33c35b[_0x0ac1('0x5b')];if(!_0x8bac22[_0x0ac1('0x49')][_0x0ac1('0x69')](_0x0ac1('0x6a'))){_0x2f0e19['limit']=qs['limit'](_0x8bac22[_0x0ac1('0x49')][_0x0ac1('0x20')]);_0x2f0e19[_0x0ac1('0x1e')]=qs[_0x0ac1('0x1e')](_0x8bac22[_0x0ac1('0x49')]['offset']);}return _0x4d23ae[_0x0ac1('0x9b')](_0x2f0e19);}})[_0x0ac1('0xf')](function(_0x386b90){if(_0x386b90){return _0x386b90?{'count':_0x2a4ea2,'rows':_0x386b90}:null;}})[_0x0ac1('0xf')](respondWithResult(_0x3d763b,null))[_0x0ac1('0x19')](handleError(_0x3d763b,null));};exports[_0x0ac1('0x9c')]=function(_0x5629cb,_0x15f7cb){var _0x2d0927={'raw':!![],'where':{}};var _0x3d4385={};var _0x3ccfa3={'count':0x0,'rows':[]};return db[_0x0ac1('0x45')]['findOne']({'where':{'id':_0x5629cb[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x15f7cb,null))[_0x0ac1('0xf')](function(_0x3173e3){if(_0x3173e3){_0x3d4385[_0x0ac1('0x48')]=_[_0x0ac1('0x59')](db[_0x0ac1('0x9d')][_0x0ac1('0x46')]);_0x3d4385[_0x0ac1('0x49')]=_['keys'](_0x5629cb[_0x0ac1('0x49')]);_0x3d4385[_0x0ac1('0x4a')]=_[_0x0ac1('0x5a')](_0x3d4385['model'],_0x3d4385[_0x0ac1('0x49')]);_0x2d0927[_0x0ac1('0x4c')]=_[_0x0ac1('0x5a')](_0x3d4385['model'],qs[_0x0ac1('0x4b')](_0x5629cb[_0x0ac1('0x49')][_0x0ac1('0x4b')]));_0x2d0927[_0x0ac1('0x4c')]=_0x2d0927[_0x0ac1('0x4c')][_0x0ac1('0x5b')]?_0x2d0927[_0x0ac1('0x4c')]:_0x3d4385[_0x0ac1('0x48')];if(!_0x5629cb[_0x0ac1('0x49')]['hasOwnProperty']('nolimit')){_0x2d0927[_0x0ac1('0x20')]=qs['limit'](_0x5629cb[_0x0ac1('0x49')]['limit']);_0x2d0927['offset']=qs['offset'](_0x5629cb['query'][_0x0ac1('0x1e')]);}_0x2d0927['order']=qs[_0x0ac1('0x4d')](_0x5629cb[_0x0ac1('0x49')][_0x0ac1('0x4d')]);_0x2d0927['where']=qs[_0x0ac1('0x4a')](_['pick'](_0x5629cb[_0x0ac1('0x49')],_0x3d4385[_0x0ac1('0x4a')]));_0x2d0927[_0x0ac1('0x53')][_0x0ac1('0x65')]=_0x3173e3['id'];if(_0x5629cb[_0x0ac1('0x49')][_0x0ac1('0x4f')]){_0x2d0927[_0x0ac1('0x53')]=_[_0x0ac1('0x50')](_0x2d0927[_0x0ac1('0x53')],{'$or':_[_0x0ac1('0x44')](_0x2d0927['attributes'],function(_0x381c07){var _0x4a7123={};_0x4a7123[_0x381c07]={'$like':'%'+_0x5629cb[_0x0ac1('0x49')]['filter']+'%'};return _0x4a7123;})});}if(_0x5629cb[_0x0ac1('0x49')][_0x0ac1('0x9e')]){var _0x55bf62=_0x5629cb[_0x0ac1('0x49')][_0x0ac1('0x9e')]['split'](',');var _0x1da69b={};_0x1da69b[_0x55bf62[0x0]]={'$gte':moment(_0x55bf62[0x1])[_0x0ac1('0x9f')](_0x0ac1('0xa0'))};_0x2d0927[_0x0ac1('0x53')]=_['merge'](_0x2d0927['where'],_0x1da69b);}_0x2d0927=_[_0x0ac1('0x50')]({},_0x2d0927,_0x5629cb[_0x0ac1('0x52')]);return db[_0x0ac1('0x9d')][_0x0ac1('0x54')]({'where':_0x2d0927[_0x0ac1('0x53')]})['then'](function(_0x280b3d){_0x3ccfa3['count']=_0x280b3d;if(_0x5629cb[_0x0ac1('0x49')][_0x0ac1('0x55')]){_0x2d0927[_0x0ac1('0x56')]=[{'all':!![]}];}return db[_0x0ac1('0x9d')][_0x0ac1('0x6c')](_0x2d0927);})[_0x0ac1('0xf')](function(_0x23a916){if(_0x5629cb[_0x0ac1('0x49')]['inlineCss']===_0x0ac1('0xa1')){for(var _0x45610=0x0;_0x45610<_0x23a916[_0x0ac1('0x5b')];_0x45610++){_0x23a916[_0x45610][_0x0ac1('0x5d')]=juice(_0x23a916[_0x45610][_0x0ac1('0x5d')]);}}_0x3ccfa3[_0x0ac1('0x57')]=_0x23a916;return _0x3ccfa3;});}})['then'](respondWithFilteredResult(_0x15f7cb,_0x2d0927))[_0x0ac1('0x19')](handleError(_0x15f7cb,null));};exports[_0x0ac1('0xa2')]=function(_0x549bb4,_0x5f77c4){var _0x16a406,_0x2aa8df={},_0x277c80;if(_0x549bb4[_0x0ac1('0x5d')]['to']){_0x277c80=_0x549bb4['body']['to'][_0x0ac1('0xa3')](',')[0x0];}return db[_0x0ac1('0x45')]['find']({'where':{'id':_0x549bb4['params']['id']},'include':[{'model':db['CmList'],'as':_0x0ac1('0xa4'),'include':[{'model':db[_0x0ac1('0x8a')],'as':_0x0ac1('0xa5'),'where':{'email':_0x277c80},'limit':0x1,'order':[['updatedAt',_0x0ac1('0xa6')]]}]},{'model':db[_0x0ac1('0x42')],'as':_0x0ac1('0x3f'),'raw':!![],'include':[{'model':db[_0x0ac1('0xa7')],'as':_0x0ac1('0xa7'),'raw':!![]}]}]})[_0x0ac1('0xf')](handleEntityNotFound(_0x5f77c4,null))[_0x0ac1('0xf')](function(_0x3fcbb9){if(!_0x3fcbb9)return;_0x16a406=_0x3fcbb9;if(!_0x3fcbb9[_0x0ac1('0x3f')])throw new Error(_0x0ac1('0xa8'));if(_[_0x0ac1('0x75')](_0x549bb4[_0x0ac1('0x5d')]['from'])){_0x549bb4['body'][_0x0ac1('0xa9')]=util['format'](_0x0ac1('0xaa'),_0x3fcbb9[_0x0ac1('0x27')],_0x3fcbb9[_0x0ac1('0x73')]||_0x3fcbb9[_0x0ac1('0x3f')][_0x0ac1('0x34')]);}if(_0x549bb4['body'][_0x0ac1('0xab')]&&_0x549bb4[_0x0ac1('0x5d')][_0x0ac1('0xab')][_0x0ac1('0x5b')]){for(var _0x807034=0x0;_0x807034<_0x549bb4[_0x0ac1('0x5d')][_0x0ac1('0xab')][_0x0ac1('0x5b')];_0x807034+=0x1){_0x549bb4[_0x0ac1('0x5d')]['attachments'][_0x807034]={'filename':_0x549bb4[_0x0ac1('0x5d')]['attachments'][_0x807034][_0x0ac1('0x27')],'path':path[_0x0ac1('0xac')](config[_0x0ac1('0xad')],_0x0ac1('0xae'),_0x549bb4[_0x0ac1('0x5d')][_0x0ac1('0xab')][_0x807034][_0x0ac1('0xaf')])};}}var _0x503abc=_0x3fcbb9['getSmtpOptions']();return respondWithRpcPromise(_0x0ac1('0xb0'),_0x0ac1('0xb1'),{'account':_0x503abc,'message':_0x549bb4[_0x0ac1('0x5d')]});})[_0x0ac1('0xf')](function(_0x2ccbc5){if(!_0x2ccbc5)return;_0x2aa8df=_0x2ccbc5;if(!_0x16a406['List'])throw new Error('List\x20not\x20found');if(_0x16a406['List'][_0x0ac1('0xa5')][_0x0ac1('0x5b')])return _0x16a406[_0x0ac1('0xa4')][_0x0ac1('0xa5')][0x0];return db[_0x0ac1('0x8a')][_0x0ac1('0x66')](_[_0x0ac1('0xb2')](_0x549bb4[_0x0ac1('0x5d')],{'firstName':_0x549bb4['body']['to'],'email':_0x549bb4['body']['to'],'phone':_0x549bb4[_0x0ac1('0x5d')]['to'],'ListId':_0x16a406[_0x0ac1('0x74')]}));})['then'](function(_0x81237d){if(!_0x81237d)return;var _0x3bbdf4={'UserId':_0x549bb4[_0x0ac1('0x34')]['id'],'ContactId':_0x81237d['id'],'MailAccountId':_0x16a406['id'],'inReplyTo':_0x2aa8df[_0x0ac1('0xb3')],'to':_0x549bb4[_0x0ac1('0x5d')]['from'],'cc':_0x549bb4[_0x0ac1('0x5d')]['cc'],'subject':_0x549bb4['body'][_0x0ac1('0xb4')],'attach':_0x549bb4[_0x0ac1('0x5d')][_0x0ac1('0xb5')],'firstMsgDirection':_0x0ac1('0xb6'),'lastMsgAt':moment()[_0x0ac1('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x0ac1('0xb6'),'Messages':[_[_0x0ac1('0x50')](_0x549bb4[_0x0ac1('0x5d')],{'messageId':_0x2aa8df[_0x0ac1('0xb3')],'sentAt':moment()[_0x0ac1('0x9f')](_0x0ac1('0xa0')),'read':!![],'MailAccountId':_0x16a406['id'],'UserId':_0x549bb4['user']['id'],'ContactId':_0x81237d['id']})]};if(_0x549bb4[_0x0ac1('0x5d')][_0x0ac1('0xb7')]){_0x3bbdf4=_[_0x0ac1('0x50')](_0x3bbdf4,_0x549bb4['body']['Interaction']);}return db[_0x0ac1('0x86')][_0x0ac1('0x66')](_0x3bbdf4,{'include':[{'model':db['MailMessage'],'as':_0x0ac1('0xb8')}]});})[_0x0ac1('0xf')](respondWithResult(_0x5f77c4,null))[_0x0ac1('0x19')](handleError(_0x5f77c4,null));};exports[_0x0ac1('0xb9')]=function(_0x4902ef,_0x4e9038){return db[_0x0ac1('0x45')][_0x0ac1('0x61')]({'where':{'id':_0x4902ef[_0x0ac1('0x62')]['id']},'include':[{'model':db[_0x0ac1('0x42')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0ac1('0xa7')],'as':'CloudProvider','raw':!![]}]}]})[_0x0ac1('0xf')](handleEntityNotFound(_0x4e9038,null))[_0x0ac1('0xf')](function(_0x434a56){if(!_0x434a56[_0x0ac1('0x3f')])return;var _0x18ba6c=_0x434a56['getSmtpOptions']();return respondWithRpcPromise(_0x0ac1('0xba'),_0x0ac1('0xb9'),{'account':_0x18ba6c});})[_0x0ac1('0xf')](respondWithResult(_0x4e9038,null))[_0x0ac1('0x19')](handleError(_0x4e9038,null));};exports['destroy']=function(_0x83a6b5,_0x3b721b){return db['MailAccount'][_0x0ac1('0x61')]({'where':{'id':_0x83a6b5[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x3b721b,null))[_0x0ac1('0xf')](function(_0x40574c){if(_0x40574c&&_0x40574c['service']){throw new db[(_0x0ac1('0xbb'))][(_0x0ac1('0xbc'))](_0x0ac1('0xbd'));}return _0x40574c;})[_0x0ac1('0xf')](removeEntity(_0x3b721b,null))[_0x0ac1('0x19')](handleError(_0x3b721b,null));};exports[_0x0ac1('0xbe')]=function(_0x5441b0,_0x38a7c7){return db[_0x0ac1('0x45')]['find']({'where':{'id':_0x5441b0[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x38a7c7,null))[_0x0ac1('0xf')](function(_0x507e5c){if(_0x507e5c){return _0x507e5c[_0x0ac1('0xbe')](_0x5441b0['body'][_0x0ac1('0x87')],_[_0x0ac1('0xbf')](_0x5441b0['body'],[_0x0ac1('0x87'),'id'])||{})[_0x0ac1('0xc0')](function(_0x1bf09f){for(var _0x53c412=0x0;_0x53c412<_0x5441b0[_0x0ac1('0x5d')]['ids']['length'];_0x53c412+=0x1){socket[_0x0ac1('0xc1')](_0x0ac1('0xc2'),{'UserId':Number(_0x5441b0[_0x0ac1('0x5d')][_0x0ac1('0x87')][_0x53c412]),'MailAccountId':Number(_0x5441b0['params']['id'])});}return _0x1bf09f;});}})['then'](respondWithResult(_0x38a7c7,null))[_0x0ac1('0x19')](handleError(_0x38a7c7,null));};exports[_0x0ac1('0xc3')]=function(_0x2bc7c6,_0x40af30){return db['MailAccount'][_0x0ac1('0x61')]({'where':{'id':_0x2bc7c6[_0x0ac1('0x62')]['id']}})['then'](handleEntityNotFound(_0x40af30,null))[_0x0ac1('0xf')](function(_0x4d1b7e){if(_0x4d1b7e){return _0x4d1b7e[_0x0ac1('0xc3')](_0x2bc7c6[_0x0ac1('0x49')][_0x0ac1('0x87')])[_0x0ac1('0xf')](function(){if(_[_0x0ac1('0xc4')](_0x2bc7c6[_0x0ac1('0x49')]['ids'])){for(var _0x59e1e2=0x0;_0x59e1e2<_0x2bc7c6[_0x0ac1('0x49')][_0x0ac1('0x87')]['length'];_0x59e1e2+=0x1){socket[_0x0ac1('0xc1')](_0x0ac1('0xc5'),{'UserId':Number(_0x2bc7c6[_0x0ac1('0x49')][_0x0ac1('0x87')][_0x59e1e2]),'MailAccountId':Number(_0x2bc7c6['params']['id'])});}}else{socket[_0x0ac1('0xc1')](_0x0ac1('0xc5'),{'UserId':Number(_0x2bc7c6[_0x0ac1('0x49')]['ids']),'MailAccountId':Number(_0x2bc7c6['params']['id'])});}});}})[_0x0ac1('0xf')](respondWithStatusCode(_0x40af30,null))[_0x0ac1('0x19')](handleError(_0x40af30,null));};exports[_0x0ac1('0xc6')]=function(_0x57d378,_0x48316a){var _0x1fed3e={};var _0x4374d1={};var _0x55bbf8;var _0x71e7e0;return db[_0x0ac1('0x45')]['findOne']({'where':{'id':_0x57d378[_0x0ac1('0x62')]['id']}})[_0x0ac1('0xf')](handleEntityNotFound(_0x48316a,null))[_0x0ac1('0xf')](function(_0x2baba2){if(_0x2baba2){_0x55bbf8=_0x2baba2;_0x4374d1[_0x0ac1('0x48')]=_[_0x0ac1('0x59')](db[_0x0ac1('0xc7')][_0x0ac1('0x46')]);_0x4374d1[_0x0ac1('0x49')]=_[_0x0ac1('0x59')](_0x57d378[_0x0ac1('0x49')]);_0x4374d1['filters']=_['intersection'](_0x4374d1[_0x0ac1('0x48')],_0x4374d1['query']);_0x1fed3e[_0x0ac1('0x4c')]=_[_0x0ac1('0x5a')](_0x4374d1['model'],qs['fields'](_0x57d378[_0x0ac1('0x49')][_0x0ac1('0x4b')]));_0x1fed3e['attributes']=_0x1fed3e[_0x0ac1('0x4c')][_0x0ac1('0x5b')]?_0x1fed3e[_0x0ac1('0x4c')]:_0x4374d1['model'];_0x1fed3e[_0x0ac1('0x89')]=qs[_0x0ac1('0x4d')](_0x57d378[_0x0ac1('0x49')][_0x0ac1('0x4d')]);_0x1fed3e[_0x0ac1('0x53')]=qs[_0x0ac1('0x4a')](_['pick'](_0x57d378['query'],_0x4374d1[_0x0ac1('0x4a')]));if(_0x57d378[_0x0ac1('0x49')]['filter']){_0x1fed3e['where']=_[_0x0ac1('0x50')](_0x1fed3e['where'],{'$or':_['map'](_0x1fed3e[_0x0ac1('0x4c')],function(_0x40994d){var _0x42df16={};_0x42df16[_0x40994d]={'$like':'%'+_0x57d378['query'][_0x0ac1('0x4f')]+'%'};return _0x42df16;})});}_0x1fed3e=_[_0x0ac1('0x50')]({},_0x1fed3e,_0x57d378[_0x0ac1('0x52')]);return _0x55bbf8[_0x0ac1('0xc6')](_0x1fed3e);}})[_0x0ac1('0xf')](function(_0x2b7642){if(_0x2b7642){_0x71e7e0=_0x2b7642[_0x0ac1('0x5b')];if(!_0x57d378[_0x0ac1('0x49')][_0x0ac1('0x69')]('nolimit')){_0x1fed3e[_0x0ac1('0x20')]=qs[_0x0ac1('0x20')](_0x57d378[_0x0ac1('0x49')]['limit']);_0x1fed3e['offset']=qs[_0x0ac1('0x1e')](_0x57d378['query']['offset']);}return _0x55bbf8['getAgents'](_0x1fed3e);}})[_0x0ac1('0xf')](function(_0x2fbf3e){if(_0x2fbf3e){return _0x2fbf3e?{'count':_0x71e7e0,'rows':_0x2fbf3e}:null;}})[_0x0ac1('0xf')](respondWithResult(_0x48316a,null))[_0x0ac1('0x19')](handleError(_0x48316a,null));}; \ No newline at end of file +var _0xedc7=['color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','CmContact','Contacts','updatedAt','CloudProvider','from','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','messageId','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','destroy','MailAccounts','UserProfileResource','stack','name','send','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.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','body','provider','MailServerIn','describe','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','length','removeAnswers','custom','email','ListId','isNil','description','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','MailInteraction','addInteraction','omit','Contact','User','Owner','fullname','internal','Tag','Tags'];(function(_0x40ce42,_0x25d8fd){var _0x3ebb52=function(_0x5cd35a){while(--_0x5cd35a){_0x40ce42['push'](_0x40ce42['shift']());}};_0x3ebb52(++_0x25d8fd);}(_0xedc7,0x1b2));var _0x7edc=function(_0x23b130,_0x52e735){_0x23b130=_0x23b130-0x0;var _0xabf8de=_0xedc7[_0x23b130];return _0xabf8de;};'use strict';var moment=require(_0x7edc('0x0'));var BPromise=require(_0x7edc('0x1'));var util=require(_0x7edc('0x2'));var path=require(_0x7edc('0x3'));var _=require('lodash');var juice=require('juice');var Redis=require(_0x7edc('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x7edc('0x5'))(_0x7edc('0x6'));var config=require(_0x7edc('0x7'));var db=require(_0x7edc('0x8'))['db'];config[_0x7edc('0x9')]=_[_0x7edc('0xa')](config[_0x7edc('0x9')],{'host':_0x7edc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7edc('0x9')]));require('./mailAccount.socket')[_0x7edc('0xc')](socket);var jayson=require(_0x7edc('0xd'));var client=jayson[_0x7edc('0xe')][_0x7edc('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x53e722,_0x3b758d,_0x1d8faa,_0x5db818){return new BPromise(function(_0x5e80b7,_0x18e758){var _0x1ef630=_0x5db818||client;return _0x1ef630[_0x7edc('0x10')](_0x53e722,_0x1d8faa)[_0x7edc('0x11')](function(_0x3704af){logger[_0x7edc('0x12')](_0x7edc('0x13'),_0x3b758d,_0x7edc('0x14'));logger[_0x7edc('0x15')](_0x7edc('0x16'),_0x3b758d,_0x7edc('0x14'),JSON['stringify'](_0x3704af));if(_0x3704af[_0x7edc('0x17')]){if(_0x3704af['error'][_0x7edc('0x18')]===0x1f4){logger[_0x7edc('0x17')](_0x7edc('0x13'),_0x3b758d,_0x3704af[_0x7edc('0x17')][_0x7edc('0x19')]);return _0x18e758(_0x3704af['error'][_0x7edc('0x19')]);}logger['error'](_0x7edc('0x13'),_0x3b758d,_0x3704af[_0x7edc('0x17')][_0x7edc('0x19')]);return _0x5e80b7(_0x3704af['error'][_0x7edc('0x19')]);}else{logger[_0x7edc('0x12')](_0x7edc('0x13'),_0x3b758d,_0x7edc('0x14'));_0x5e80b7(_0x3704af[_0x7edc('0x1a')][_0x7edc('0x19')]);}})[_0x7edc('0x1b')](function(_0x5dacc8){logger[_0x7edc('0x17')](_0x7edc('0x13'),_0x3b758d,_0x5dacc8);_0x18e758(_0x5dacc8);});});}function respondWithStatusCode(_0x25c76f,_0x15f6a7){_0x15f6a7=_0x15f6a7||0xcc;return function(_0x38a20a){if(_0x38a20a){return _0x25c76f[_0x7edc('0x1c')](_0x15f6a7);}return _0x25c76f[_0x7edc('0x1d')](_0x15f6a7)[_0x7edc('0x1e')]();};}function respondWithResult(_0x54012e,_0x500d2a){_0x500d2a=_0x500d2a||0xc8;return function(_0x42392e){if(_0x42392e){return _0x54012e[_0x7edc('0x1d')](_0x500d2a)['json'](_0x42392e);}};}function respondWithFilteredResult(_0x4bcd90,_0x539780){return function(_0x38c4fc){if(_0x38c4fc){var _0x233e68=typeof _0x539780[_0x7edc('0x1f')]==='undefined'&&typeof _0x539780[_0x7edc('0x20')]===_0x7edc('0x21');var _0x13d446=_0x38c4fc[_0x7edc('0x22')];var _0x2a18d7=_0x233e68?0x0:_0x539780[_0x7edc('0x1f')];var _0x30b666=_0x233e68?_0x38c4fc['count']:_0x539780[_0x7edc('0x1f')]+_0x539780[_0x7edc('0x20')];var _0x2251c8;if(_0x30b666>=_0x13d446){_0x30b666=_0x13d446;_0x2251c8=0xc8;}else{_0x2251c8=0xce;}_0x4bcd90[_0x7edc('0x1d')](_0x2251c8);return _0x4bcd90[_0x7edc('0x23')](_0x7edc('0x24'),_0x2a18d7+'-'+_0x30b666+'/'+_0x13d446)[_0x7edc('0x25')](_0x38c4fc);}return null;};}function saveUpdates(_0x33fd49){return function(_0x2c34f8){if(_0x2c34f8){return _0x2c34f8[_0x7edc('0x26')](_0x33fd49)['then'](function(_0x37ded4){return _0x37ded4;});}return null;};}function removeEntity(_0x5cb82c){return function(_0x1bb862){if(_0x1bb862){return _0x1bb862[_0x7edc('0x27')]()['then'](function(){var _0x2c6611=_0x1bb862['get']({'plain':!![]});var _0xcc91b=_0x7edc('0x28');return db[_0x7edc('0x29')][_0x7edc('0x27')]({'where':{'type':_0xcc91b,'resourceId':_0x2c6611['id']}})['then'](function(){return _0x1bb862;});})['then'](function(){_0x5cb82c[_0x7edc('0x1d')](0xcc)[_0x7edc('0x1e')]();});}};}function handleEntityNotFound(_0xc7712c){return function(_0x968c2c){if(!_0x968c2c){_0xc7712c[_0x7edc('0x1c')](0x194);}return _0x968c2c;};}function handleError(_0x2384cb,_0x5b383){_0x5b383=_0x5b383||0x1f4;return function(_0x366d78){logger['error'](_0x366d78[_0x7edc('0x2a')]);if(_0x366d78[_0x7edc('0x2b')]){delete _0x366d78[_0x7edc('0x2b')];}_0x2384cb[_0x7edc('0x1d')](_0x5b383)[_0x7edc('0x2c')](_0x366d78);};}function getImapHost(_0x27bfde){switch(_0x27bfde){case _0x7edc('0x2d'):return _0x7edc('0x2e');case _0x7edc('0x2f'):return _0x7edc('0x30');case _0x7edc('0x31'):return _0x7edc('0x32');case _0x7edc('0x33'):return'outlook.office365.com';}throw new Error(_0x7edc('0x34'),_0x27bfde);}function getSmtpHost(_0x30cf13){switch(_0x30cf13){case _0x7edc('0x2d'):return _0x7edc('0x35');case _0x7edc('0x2f'):return _0x7edc('0x36');case _0x7edc('0x31'):return'smtp-mail.outlook.com';case _0x7edc('0x33'):return _0x7edc('0x37');}throw new Error(_0x7edc('0x34'),_0x30cf13);}function getAuthenticationOptions(_0x5e1689,_0x348b3b){var _0x17da3a={};var _0xe94800={};if(_0x5e1689){_0x17da3a[_0x7edc('0x38')]=_0xe94800[_0x7edc('0x38')]=_0x348b3b[_0x7edc('0x39')];_0x17da3a[_0x7edc('0x3a')]=_0xe94800[_0x7edc('0x3b')]=_0x348b3b[_0x7edc('0x3a')];if(_0x348b3b[_0x7edc('0x3c')]){_0x17da3a[_0x7edc('0x3c')]=_0xe94800[_0x7edc('0x3c')]=!![];_0x17da3a[_0x7edc('0x3d')]=_0xe94800[_0x7edc('0x3d')]=_0x348b3b['CloudProviderId'];_0x17da3a[_0x7edc('0x3a')]=_0xe94800['pass']=null;}else{_0x17da3a[_0x7edc('0x3d')]=_0xe94800[_0x7edc('0x3d')]=null;}_0x17da3a[_0x7edc('0x3e')]=getImapHost(_0x5e1689);_0x17da3a[_0x7edc('0x3f')]=0x3e1;_0xe94800[_0x7edc('0x3e')]=getSmtpHost(_0x5e1689);_0xe94800['port']=0x24b;_0xe94800[_0x7edc('0x40')]=![];_0x17da3a[_0x7edc('0x41')]=_0xe94800[_0x7edc('0x41')]=null;}else{if(_0x348b3b[_0x7edc('0x42')]){_0x17da3a['user']=_0xe94800['user']=_0x348b3b[_0x7edc('0x39')];_0x17da3a[_0x7edc('0x3a')]=_0xe94800[_0x7edc('0x3b')]=_0x348b3b[_0x7edc('0x3a')];}else{_0x17da3a[_0x7edc('0x42')]=_0xe94800[_0x7edc('0x42')]=![];_0x17da3a[_0x7edc('0x38')]=_0xe94800['user']=null;_0x17da3a[_0x7edc('0x3a')]=_0xe94800['pass']=null;}_0x17da3a[_0x7edc('0x3e')]=_0x348b3b['Imap'][_0x7edc('0x3e')];_0x17da3a['port']=_0x348b3b['Imap'][_0x7edc('0x3f')];_0xe94800[_0x7edc('0x3e')]=_0x348b3b['Smtp'][_0x7edc('0x3e')];_0xe94800[_0x7edc('0x3f')]=_0x348b3b[_0x7edc('0x43')]['port'];}return{'Imap':_0x17da3a,'Smtp':_0xe94800};}exports[_0x7edc('0x44')]=function(_0x35dfc6,_0x3fc534){var _0x188164={'include':[{'model':db['MailServerIn'],'as':_0x7edc('0x45')},{'model':db[_0x7edc('0x46')],'as':_0x7edc('0x43')},{'model':db[_0x7edc('0x47')],'as':_0x7edc('0x48')}]},_0xdb9ff6={},_0x36d188={'count':0x0,'rows':[]};var _0x11973c=_[_0x7edc('0x49')](db[_0x7edc('0x4a')][_0x7edc('0x4b')],function(_0x565115){return{'name':_0x565115[_0x7edc('0x4c')],'type':_0x565115[_0x7edc('0x4d')][_0x7edc('0x4e')]};});_0xdb9ff6['model']=_[_0x7edc('0x49')](_0x11973c,_0x7edc('0x2b'));_0xdb9ff6[_0x7edc('0x4f')]=_[_0x7edc('0x50')](_0x35dfc6[_0x7edc('0x4f')]);_0xdb9ff6['filters']=_[_0x7edc('0x51')](_0xdb9ff6['model'],_0xdb9ff6[_0x7edc('0x4f')]);_0x188164[_0x7edc('0x52')]=_[_0x7edc('0x51')](_0xdb9ff6[_0x7edc('0x53')],qs[_0x7edc('0x54')](_0x35dfc6[_0x7edc('0x4f')][_0x7edc('0x54')]));_0x188164[_0x7edc('0x52')]=_0x188164[_0x7edc('0x52')]['length']?_0x188164[_0x7edc('0x52')]:_0xdb9ff6[_0x7edc('0x53')];if(!_0x35dfc6[_0x7edc('0x4f')][_0x7edc('0x55')](_0x7edc('0x56'))){_0x188164[_0x7edc('0x20')]=qs[_0x7edc('0x20')](_0x35dfc6['query'][_0x7edc('0x20')]);_0x188164[_0x7edc('0x1f')]=qs['offset'](_0x35dfc6[_0x7edc('0x4f')]['offset']);}_0x188164[_0x7edc('0x57')]=qs[_0x7edc('0x58')](_0x35dfc6[_0x7edc('0x4f')][_0x7edc('0x58')]);_0x188164[_0x7edc('0x59')]=qs[_0x7edc('0x5a')](_[_0x7edc('0x5b')](_0x35dfc6['query'],_0xdb9ff6[_0x7edc('0x5a')]),_0x11973c);if(_0x35dfc6['query'][_0x7edc('0x5c')]){_0x188164[_0x7edc('0x59')]=_['merge'](_0x188164[_0x7edc('0x59')],{'$or':_['map'](_0x11973c,function(_0x67107){if(_0x67107[_0x7edc('0x4d')]!=='VIRTUAL'){var _0x28c686={};_0x28c686[_0x67107['name']]={'$like':'%'+_0x35dfc6[_0x7edc('0x4f')][_0x7edc('0x5c')]+'%'};return _0x28c686;}})});}_0x188164=_[_0x7edc('0x5d')]({},_0x188164,_0x35dfc6[_0x7edc('0x5e')]);var _0x10b725={'where':_0x188164[_0x7edc('0x59')]};return db[_0x7edc('0x4a')][_0x7edc('0x22')](_0x10b725)['then'](function(_0xcc30da){_0x36d188['count']=_0xcc30da;if(_0x35dfc6[_0x7edc('0x4f')][_0x7edc('0x5f')]){_0x188164['include']=[{'all':!![]}];}return db[_0x7edc('0x4a')][_0x7edc('0x60')](_0x188164);})[_0x7edc('0x11')](function(_0x5eeec7){_0x36d188[_0x7edc('0x61')]=_0x5eeec7;return _0x36d188;})[_0x7edc('0x11')](respondWithFilteredResult(_0x3fc534,_0x188164))[_0x7edc('0x1b')](handleError(_0x3fc534,null));};exports[_0x7edc('0x62')]=function(_0x143f6,_0x161ee4){var _0x5c8346={'raw':![],'where':{'id':_0x143f6[_0x7edc('0x63')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x7edc('0x45')},{'model':db[_0x7edc('0x46')],'as':'Smtp'},{'model':db[_0x7edc('0x47')],'as':_0x7edc('0x48')}]},_0x3b92b4={};_0x3b92b4['model']=_[_0x7edc('0x50')](db[_0x7edc('0x4a')][_0x7edc('0x4b')]);_0x3b92b4['query']=_[_0x7edc('0x50')](_0x143f6[_0x7edc('0x4f')]);_0x3b92b4[_0x7edc('0x5a')]=_[_0x7edc('0x51')](_0x3b92b4[_0x7edc('0x53')],_0x3b92b4[_0x7edc('0x4f')]);_0x5c8346[_0x7edc('0x52')]=_['intersection'](_0x3b92b4[_0x7edc('0x53')],qs[_0x7edc('0x54')](_0x143f6['query'][_0x7edc('0x54')]));_0x5c8346[_0x7edc('0x52')]=_0x5c8346[_0x7edc('0x52')]['length']?_0x5c8346['attributes']:_0x3b92b4[_0x7edc('0x53')];if(_0x143f6[_0x7edc('0x4f')][_0x7edc('0x5f')]){_0x5c8346[_0x7edc('0x64')]=[{'all':!![]}];}_0x5c8346=_[_0x7edc('0x5d')]({},_0x5c8346,_0x143f6[_0x7edc('0x5e')]);return db[_0x7edc('0x4a')][_0x7edc('0x65')](_0x5c8346)['then'](handleEntityNotFound(_0x161ee4,null))['then'](respondWithResult(_0x161ee4,null))[_0x7edc('0x1b')](handleError(_0x161ee4,null));};exports['update']=function(_0x596685,_0x5e391a){if(_0x596685[_0x7edc('0x66')]['id']){delete _0x596685[_0x7edc('0x66')]['id'];}var _0x28f6bb=_0x596685[_0x7edc('0x66')][_0x7edc('0x67')]==='custom'?null:_0x596685[_0x7edc('0x66')][_0x7edc('0x67')];var _0x3c8fa5=_0x596685[_0x7edc('0x66')][_0x7edc('0x45')]||{};var _0x14efce=_0x596685[_0x7edc('0x66')][_0x7edc('0x43')]||{};if(_0x28f6bb){_0x3c8fa5[_0x7edc('0x3e')]=getImapHost(_0x28f6bb);_0x3c8fa5[_0x7edc('0x3f')]=0x3e1;_0x14efce['host']=getSmtpHost(_0x28f6bb);_0x14efce['port']=0x24b;_0x14efce[_0x7edc('0x40')]=![];}if(_0x14efce[_0x7edc('0x3c')]){_0x14efce[_0x7edc('0x40')]=![];}else{_0x14efce['CloudProviderId']=null;}if(!_0x3c8fa5[_0x7edc('0x3c')])_0x3c8fa5['CloudProviderId']=null;_0x596685[_0x7edc('0x66')]['Imap']=_0x3c8fa5;_0x596685[_0x7edc('0x66')][_0x7edc('0x43')]=_0x14efce;return db[_0x7edc('0x4a')][_0x7edc('0x65')]({'where':{'id':_0x596685['params']['id']},'include':[{'model':db[_0x7edc('0x68')],'as':_0x7edc('0x45')},{'model':db['MailServerOut'],'as':_0x7edc('0x43')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x7edc('0x11')](handleEntityNotFound(_0x5e391a,null))[_0x7edc('0x11')](function(_0xce1233){if(!_0xce1233)throw new Error('Mail\x20Account\x20not\x20found');if(_0xce1233['service'])delete _0x596685[_0x7edc('0x66')][_0x7edc('0x45')];return _0xce1233;})['then'](saveUpdates(_0x596685[_0x7edc('0x66')],null))[_0x7edc('0x11')](function(_0x36ae6b){if(!_0x596685[_0x7edc('0x66')][_0x7edc('0x45')])return _0x36ae6b;return db[_0x7edc('0x68')][_0x7edc('0x26')](_0x596685[_0x7edc('0x66')][_0x7edc('0x45')],{'where':{'MailAccountId':_0x36ae6b['id']}})[_0x7edc('0x11')](function(){return _0x36ae6b;});})['then'](function(_0xf47b79){if(!_0x596685[_0x7edc('0x66')][_0x7edc('0x43')])return _0xf47b79;return db[_0x7edc('0x46')]['update'](_0x596685[_0x7edc('0x66')][_0x7edc('0x43')],{'where':{'MailAccountId':_0xf47b79['id']}})[_0x7edc('0x11')](function(){return _0xf47b79;});})[_0x7edc('0x11')](respondWithResult(_0x5e391a,null))[_0x7edc('0x1b')](handleError(_0x5e391a,null));};exports[_0x7edc('0x69')]=function(_0x238b09,_0x573914){return db[_0x7edc('0x4a')][_0x7edc('0x69')]()[_0x7edc('0x11')](respondWithResult(_0x573914,null))['catch'](handleError(_0x573914,null));};exports['addDisposition']=function(_0x807c6e,_0x1fbdc9){if(_0x807c6e[_0x7edc('0x66')]['id']){delete _0x807c6e['body']['id'];}return db[_0x7edc('0x4a')]['find']({'where':{'id':_0x807c6e[_0x7edc('0x63')]['id']}})['then'](handleEntityNotFound(_0x1fbdc9,null))[_0x7edc('0x11')](function(_0x562f08){if(_0x562f08){_0x807c6e[_0x7edc('0x66')][_0x7edc('0x6a')]=_0x562f08['id'];return db[_0x7edc('0x6b')][_0x7edc('0x6c')](_0x807c6e[_0x7edc('0x66')]);}})[_0x7edc('0x11')](respondWithResult(_0x1fbdc9,null))[_0x7edc('0x1b')](handleError(_0x1fbdc9,null));};exports[_0x7edc('0x6d')]=function(_0x30a45a,_0xcac4cd){var _0xbabff0={'raw':![],'where':{}};var _0xf94059={};var _0x412c64={'count':0x0,'rows':[]};return db['MailAccount'][_0x7edc('0x6e')]({'where':{'id':_0x30a45a['params']['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0xcac4cd,null))[_0x7edc('0x11')](function(_0x40ccfc){if(_0x40ccfc){_0xf94059[_0x7edc('0x53')]=_[_0x7edc('0x50')](db[_0x7edc('0x6b')][_0x7edc('0x4b')]);_0xf94059[_0x7edc('0x4f')]=_['keys'](_0x30a45a[_0x7edc('0x4f')]);_0xf94059['filters']=_[_0x7edc('0x51')](_0xf94059[_0x7edc('0x53')],_0xf94059[_0x7edc('0x4f')]);_0xbabff0['attributes']=_['intersection'](_0xf94059[_0x7edc('0x53')],qs['fields'](_0x30a45a['query']['fields']));_0xbabff0[_0x7edc('0x52')]=_0xbabff0[_0x7edc('0x52')]['length']?_0xbabff0[_0x7edc('0x52')]:_0xf94059[_0x7edc('0x53')];if(!_0x30a45a['query']['hasOwnProperty'](_0x7edc('0x56'))){_0xbabff0[_0x7edc('0x20')]=qs['limit'](_0x30a45a[_0x7edc('0x4f')][_0x7edc('0x20')]);_0xbabff0[_0x7edc('0x1f')]=qs['offset'](_0x30a45a[_0x7edc('0x4f')][_0x7edc('0x1f')]);}_0xbabff0[_0x7edc('0x57')]=qs[_0x7edc('0x58')](_0x30a45a[_0x7edc('0x4f')][_0x7edc('0x58')]);_0xbabff0[_0x7edc('0x59')]=qs['filters'](_[_0x7edc('0x5b')](_0x30a45a[_0x7edc('0x4f')],_0xf94059[_0x7edc('0x5a')]));_0xbabff0[_0x7edc('0x59')][_0x7edc('0x6a')]=_0x40ccfc['id'];if(_0x30a45a['query']['filter']){_0xbabff0[_0x7edc('0x59')]=_['merge'](_0xbabff0['where'],{'$or':_['map'](_0xbabff0[_0x7edc('0x52')],function(_0x50bdbb){var _0x5d58c4={};_0x5d58c4[_0x50bdbb]={'$like':'%'+_0x30a45a[_0x7edc('0x4f')]['filter']+'%'};return _0x5d58c4;})});}_0xbabff0=_[_0x7edc('0x5d')]({},_0xbabff0,_0x30a45a[_0x7edc('0x5e')]);return db['Disposition'][_0x7edc('0x22')]({'where':_0xbabff0[_0x7edc('0x59')]})[_0x7edc('0x11')](function(_0x55d017){_0x412c64[_0x7edc('0x22')]=_0x55d017;if(_0x30a45a[_0x7edc('0x4f')][_0x7edc('0x5f')]){_0xbabff0[_0x7edc('0x64')]=[{'all':!![]}];}return db[_0x7edc('0x6b')]['findAll'](_0xbabff0);})['then'](function(_0x5c38ee){_0x412c64[_0x7edc('0x61')]=_0x5c38ee;return _0x412c64;});}})['then'](respondWithFilteredResult(_0xcac4cd,_0xbabff0))['catch'](handleError(_0xcac4cd,null));};exports[_0x7edc('0x6f')]=function(_0x3d6663,_0x2fce28){return db['MailAccount'][_0x7edc('0x65')]({'where':{'id':_0x3d6663[_0x7edc('0x63')]['id']}})['then'](handleEntityNotFound(_0x2fce28,null))['then'](function(_0x3f3c85){if(_0x3f3c85){return _0x3f3c85['removeDispositions'](_0x3d6663[_0x7edc('0x4f')][_0x7edc('0x70')]);}})[_0x7edc('0x11')](respondWithStatusCode(_0x2fce28,null))[_0x7edc('0x1b')](handleError(_0x2fce28,null));};exports[_0x7edc('0x71')]=function(_0x29c28f,_0x4d9ab3){if(_0x29c28f[_0x7edc('0x66')]['id']){delete _0x29c28f[_0x7edc('0x66')]['id'];}return db[_0x7edc('0x4a')]['find']({'where':{'id':_0x29c28f[_0x7edc('0x63')]['id']}})['then'](handleEntityNotFound(_0x4d9ab3,null))[_0x7edc('0x11')](function(_0x2ef22a){if(_0x2ef22a){_0x29c28f[_0x7edc('0x66')][_0x7edc('0x6a')]=_0x2ef22a['id'];return db[_0x7edc('0x72')][_0x7edc('0x6c')](_0x29c28f[_0x7edc('0x66')]);}})['then'](respondWithResult(_0x4d9ab3,null))['catch'](handleError(_0x4d9ab3,null));};exports['getAnswers']=function(_0x3c7ab7,_0xc04747){var _0x4234e2={'raw':![],'where':{}};var _0xf206ef={};var _0x95b54e={'count':0x0,'rows':[]};return db[_0x7edc('0x4a')][_0x7edc('0x6e')]({'where':{'id':_0x3c7ab7[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0xc04747,null))[_0x7edc('0x11')](function(_0x294a68){if(_0x294a68){_0xf206ef[_0x7edc('0x53')]=_[_0x7edc('0x50')](db[_0x7edc('0x72')][_0x7edc('0x4b')]);_0xf206ef[_0x7edc('0x4f')]=_['keys'](_0x3c7ab7[_0x7edc('0x4f')]);_0xf206ef[_0x7edc('0x5a')]=_[_0x7edc('0x51')](_0xf206ef['model'],_0xf206ef[_0x7edc('0x4f')]);_0x4234e2[_0x7edc('0x52')]=_[_0x7edc('0x51')](_0xf206ef['model'],qs['fields'](_0x3c7ab7[_0x7edc('0x4f')][_0x7edc('0x54')]));_0x4234e2[_0x7edc('0x52')]=_0x4234e2['attributes'][_0x7edc('0x73')]?_0x4234e2[_0x7edc('0x52')]:_0xf206ef[_0x7edc('0x53')];if(!_0x3c7ab7[_0x7edc('0x4f')][_0x7edc('0x55')](_0x7edc('0x56'))){_0x4234e2[_0x7edc('0x20')]=qs[_0x7edc('0x20')](_0x3c7ab7[_0x7edc('0x4f')][_0x7edc('0x20')]);_0x4234e2[_0x7edc('0x1f')]=qs[_0x7edc('0x1f')](_0x3c7ab7[_0x7edc('0x4f')]['offset']);}_0x4234e2[_0x7edc('0x57')]=qs[_0x7edc('0x58')](_0x3c7ab7[_0x7edc('0x4f')]['sort']);_0x4234e2['where']=qs[_0x7edc('0x5a')](_[_0x7edc('0x5b')](_0x3c7ab7[_0x7edc('0x4f')],_0xf206ef[_0x7edc('0x5a')]));_0x4234e2['where']['MailAccountId']=_0x294a68['id'];if(_0x3c7ab7[_0x7edc('0x4f')]['filter']){_0x4234e2[_0x7edc('0x59')]=_[_0x7edc('0x5d')](_0x4234e2[_0x7edc('0x59')],{'$or':_[_0x7edc('0x49')](_0x4234e2['attributes'],function(_0x18defa){var _0x728d1d={};_0x728d1d[_0x18defa]={'$like':'%'+_0x3c7ab7['query'][_0x7edc('0x5c')]+'%'};return _0x728d1d;})});}_0x4234e2=_[_0x7edc('0x5d')]({},_0x4234e2,_0x3c7ab7['options']);return db[_0x7edc('0x72')][_0x7edc('0x22')]({'where':_0x4234e2['where']})[_0x7edc('0x11')](function(_0x50c0d7){_0x95b54e[_0x7edc('0x22')]=_0x50c0d7;if(_0x3c7ab7[_0x7edc('0x4f')][_0x7edc('0x5f')]){_0x4234e2[_0x7edc('0x64')]=[{'all':!![]}];}return db[_0x7edc('0x72')][_0x7edc('0x60')](_0x4234e2);})[_0x7edc('0x11')](function(_0xbd1980){_0x95b54e['rows']=_0xbd1980;return _0x95b54e;});}})[_0x7edc('0x11')](respondWithFilteredResult(_0xc04747,_0x4234e2))[_0x7edc('0x1b')](handleError(_0xc04747,null));};exports['removeAnswers']=function(_0x31355d,_0x166c57){return db[_0x7edc('0x4a')][_0x7edc('0x65')]({'where':{'id':_0x31355d['params']['id']}})['then'](handleEntityNotFound(_0x166c57,null))[_0x7edc('0x11')](function(_0x284484){if(_0x284484){return _0x284484[_0x7edc('0x74')](_0x31355d['query']['ids']);}})[_0x7edc('0x11')](respondWithStatusCode(_0x166c57,null))['catch'](handleError(_0x166c57,null));};exports[_0x7edc('0x6c')]=function(_0x1fbc18,_0x118a1d){var _0x29ac69={'name':_0x1fbc18[_0x7edc('0x66')]['name'],'key':_0x1fbc18[_0x7edc('0x66')][_0x7edc('0x4e')],'provider':_0x1fbc18[_0x7edc('0x66')][_0x7edc('0x67')]===_0x7edc('0x75')?null:_0x1fbc18[_0x7edc('0x66')]['provider'],'email':_0x1fbc18[_0x7edc('0x66')][_0x7edc('0x76')],'ListId':_0x1fbc18[_0x7edc('0x66')][_0x7edc('0x77')],'active':!_[_0x7edc('0x78')](_0x1fbc18[_0x7edc('0x66')]['active'])?_0x1fbc18[_0x7edc('0x66')]['active']:!![],'description':_0x1fbc18['body'][_0x7edc('0x79')]||null};var _0x291d68=getAuthenticationOptions(_0x29ac69[_0x7edc('0x67')],_0x1fbc18['body']);_0x29ac69[_0x7edc('0x45')]=_0x291d68[_0x7edc('0x45')];_0x29ac69[_0x7edc('0x43')]=_0x291d68['Smtp'];return db[_0x7edc('0x4a')][_0x7edc('0x6c')](_0x29ac69,{'include':[{'model':db[_0x7edc('0x46')],'as':_0x7edc('0x43')},{'model':db[_0x7edc('0x68')],'as':_0x7edc('0x45')}]})[_0x7edc('0x11')](function(_0x52e09d){var _0x130dec=_0x1fbc18[_0x7edc('0x38')]['get']({'plain':!![]});if(!_0x130dec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x130dec[_0x7edc('0x7a')]==='user'){var _0x5d410b=_0x52e09d[_0x7edc('0x7b')]({'plain':!![]});return db[_0x7edc('0x7c')]['find']({'where':{'name':_0x7edc('0x28'),'userProfileId':_0x130dec['userProfileId']},'raw':!![]})['then'](function(_0x24c2c6){if(_0x24c2c6&&_0x24c2c6['autoAssociation']===0x0){return db[_0x7edc('0x29')][_0x7edc('0x6c')]({'name':_0x5d410b['name'],'resourceId':_0x5d410b['id'],'type':_0x24c2c6[_0x7edc('0x2b')],'sectionId':_0x24c2c6['id']},{})[_0x7edc('0x11')](function(){return _0x52e09d;});}else{return _0x52e09d;}})[_0x7edc('0x1b')](function(_0x9bd94c){logger[_0x7edc('0x17')](_0x7edc('0x7d'),_0x9bd94c);throw _0x9bd94c;});}return _0x52e09d;})[_0x7edc('0x11')](respondWithResult(_0x118a1d,0xc9))['catch'](handleError(_0x118a1d,null));};exports[_0x7edc('0x7e')]=function(_0x4b5523,_0x8d6aff){return db[_0x7edc('0x4a')][_0x7edc('0x6e')]({'where':{'id':_0x4b5523[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x8d6aff,null))[_0x7edc('0x11')](function(_0x4b0cf8){if(_0x4b0cf8){return _0x4b0cf8[_0x7edc('0x7e')]();}return null;})[_0x7edc('0x11')](respondWithResult(_0x8d6aff,null))[_0x7edc('0x1b')](handleError(_0x8d6aff,null));};exports[_0x7edc('0x7f')]=function(_0x35389f,_0x1e4ca8){if(_0x35389f[_0x7edc('0x66')]['id']){delete _0x35389f[_0x7edc('0x66')]['id'];}return db[_0x7edc('0x4a')][_0x7edc('0x65')]({'where':{'id':_0x35389f[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x1e4ca8,null))[_0x7edc('0x11')](function(_0x340af1){if(_0x340af1){_0x35389f[_0x7edc('0x66')][_0x7edc('0x6a')]=_0x340af1['id'];return db[_0x7edc('0x68')][_0x7edc('0x6c')](_0x35389f[_0x7edc('0x66')]);}})['then'](respondWithResult(_0x1e4ca8,null))[_0x7edc('0x1b')](handleError(_0x1e4ca8,null));};exports[_0x7edc('0x80')]=function(_0x13c2af,_0x403ea9){return db[_0x7edc('0x4a')][_0x7edc('0x6e')]({'where':{'id':_0x13c2af['params']['id']}})['then'](handleEntityNotFound(_0x403ea9,null))[_0x7edc('0x11')](function(_0x4c7aaf){if(_0x4c7aaf){return _0x4c7aaf[_0x7edc('0x81')](null);}return null;})['then'](respondWithStatusCode(_0x403ea9,null))[_0x7edc('0x1b')](handleError(_0x403ea9,null));};exports['getSmtp']=function(_0x401135,_0x5742c8){return db[_0x7edc('0x4a')][_0x7edc('0x6e')]({'where':{'id':_0x401135[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x5742c8,null))['then'](function(_0x3932fa){if(_0x3932fa){return _0x3932fa[_0x7edc('0x82')]();}return null;})[_0x7edc('0x11')](respondWithResult(_0x5742c8,null))['catch'](handleError(_0x5742c8,null));};exports['addSmtp']=function(_0x3b4fa4,_0x4b81e8){if(_0x3b4fa4[_0x7edc('0x66')]['id']){delete _0x3b4fa4[_0x7edc('0x66')]['id'];}return db[_0x7edc('0x4a')][_0x7edc('0x65')]({'where':{'id':_0x3b4fa4['params']['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x4b81e8,null))[_0x7edc('0x11')](function(_0x3efa8d){if(_0x3efa8d){_0x3b4fa4['body'][_0x7edc('0x6a')]=_0x3efa8d['id'];return db[_0x7edc('0x46')][_0x7edc('0x6c')](_0x3b4fa4['body']);}})['then'](respondWithResult(_0x4b81e8,null))[_0x7edc('0x1b')](handleError(_0x4b81e8,null));};exports[_0x7edc('0x83')]=function(_0x59ccbe,_0x4408b2){return db[_0x7edc('0x4a')][_0x7edc('0x6e')]({'where':{'id':_0x59ccbe['params']['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x4408b2,null))[_0x7edc('0x11')](function(_0x18855e){if(_0x18855e){return _0x18855e['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x4408b2,null))[_0x7edc('0x1b')](handleError(_0x4408b2,null));};exports['addInteraction']=function(_0x2668b3,_0x5a80f5){return db[_0x7edc('0x84')]['find']({'where':{'id':_0x2668b3[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x5a80f5,null))['then'](function(_0x56a025){if(_0x56a025){return _0x56a025[_0x7edc('0x85')](_0x2668b3[_0x7edc('0x66')][_0x7edc('0x70')],_[_0x7edc('0x86')](_0x2668b3[_0x7edc('0x66')],['ids','id'])||{});}})[_0x7edc('0x11')](respondWithResult(_0x5a80f5,null))['catch'](handleError(_0x5a80f5,null));};exports['getInteractions']=function(_0x59f31c,_0x56d856){var _0x345350={'raw':![],'where':{}};var _0x34280c={};var _0x27154c={'count':0x0,'rows':[]};return db['MailAccount'][_0x7edc('0x6e')]({'where':{'id':_0x59f31c[_0x7edc('0x63')]['id']}})['then'](handleEntityNotFound(_0x56d856,null))[_0x7edc('0x11')](function(_0x5d40af){if(_0x5d40af){_0x34280c['model']=_[_0x7edc('0x50')](db[_0x7edc('0x84')][_0x7edc('0x4b')]);_0x34280c[_0x7edc('0x4f')]=_[_0x7edc('0x50')](_0x59f31c[_0x7edc('0x4f')]);_0x34280c[_0x7edc('0x5a')]=_[_0x7edc('0x51')](_0x34280c[_0x7edc('0x53')],_0x34280c[_0x7edc('0x4f')]);_0x345350[_0x7edc('0x52')]=_['intersection'](_0x34280c[_0x7edc('0x53')],qs[_0x7edc('0x54')](_0x59f31c['query'][_0x7edc('0x54')]));_0x345350[_0x7edc('0x52')]=_0x345350[_0x7edc('0x52')][_0x7edc('0x73')]?_0x345350[_0x7edc('0x52')]:_0x34280c[_0x7edc('0x53')];if(!_0x59f31c[_0x7edc('0x4f')][_0x7edc('0x55')](_0x7edc('0x56'))){_0x345350[_0x7edc('0x20')]=qs[_0x7edc('0x20')](_0x59f31c['query']['limit']);_0x345350[_0x7edc('0x1f')]=qs[_0x7edc('0x1f')](_0x59f31c[_0x7edc('0x4f')][_0x7edc('0x1f')]);}_0x345350[_0x7edc('0x57')]=qs['sort'](_0x59f31c['query']['sort']);_0x345350[_0x7edc('0x59')]=qs[_0x7edc('0x5a')](_['pick'](_0x59f31c[_0x7edc('0x4f')],_0x34280c[_0x7edc('0x5a')]));_0x345350[_0x7edc('0x59')][_0x7edc('0x6a')]=_0x5d40af['id'];if(_0x59f31c['query'][_0x7edc('0x5c')]){_0x345350[_0x7edc('0x59')]=_[_0x7edc('0x5d')](_0x345350[_0x7edc('0x59')],{'$or':_[_0x7edc('0x49')](_0x345350[_0x7edc('0x52')],function(_0x303b57){var _0x2553f1={};_0x2553f1[_0x303b57]={'$like':'%'+_0x59f31c[_0x7edc('0x4f')][_0x7edc('0x5c')]+'%'};return _0x2553f1;})});}_0x345350=_[_0x7edc('0x5d')]({},_0x345350,_0x59f31c[_0x7edc('0x5e')]);return db[_0x7edc('0x84')][_0x7edc('0x22')]({'where':_0x345350[_0x7edc('0x59')]})[_0x7edc('0x11')](function(_0x1ea9bf){_0x27154c['count']=_0x1ea9bf;if(_0x59f31c[_0x7edc('0x4f')][_0x7edc('0x5f')]){_0x345350[_0x7edc('0x64')]=[{'model':db['CmContact'],'as':_0x7edc('0x87'),'required':![]},{'model':db[_0x7edc('0x88')],'as':_0x7edc('0x89'),'attributes':['name',_0x7edc('0x8a'),_0x7edc('0x8b')],'required':![]},{'model':db[_0x7edc('0x8c')],'as':_0x7edc('0x8d'),'attributes':['id','name',_0x7edc('0x8e')],'where':_0x59f31c[_0x7edc('0x4f')][_0x7edc('0x8f')]?{'id':_0x59f31c[_0x7edc('0x4f')]['tag']}:undefined,'required':_0x59f31c[_0x7edc('0x4f')][_0x7edc('0x8f')]?!![]:![]}];}return db[_0x7edc('0x84')]['findAll'](_0x345350);})[_0x7edc('0x11')](function(_0x2759f2){_0x27154c[_0x7edc('0x61')]=_0x2759f2;return _0x27154c;});}})['then'](respondWithFilteredResult(_0x56d856,_0x345350))[_0x7edc('0x1b')](handleError(_0x56d856,null));};exports[_0x7edc('0x90')]=function addApplications(_0x3f6e15,_0x2416c6){var _0x358225=_0x3f6e15['params']['id'];var _0x3dbc68=_0x3f6e15[_0x7edc('0x66')];var _0x42ad9d=0xc8;var _0x20c4e8=null;return db['sequelize'][_0x7edc('0x91')]({'isolationLevel':db[_0x7edc('0x92')][_0x7edc('0x93')][_0x7edc('0x94')][_0x7edc('0x95')]},function(_0xa7f1f4){return db[_0x7edc('0x4a')][_0x7edc('0x6e')]({'where':{'id':_0x358225},'transaction':_0xa7f1f4})[_0x7edc('0x11')](function(_0x13de46){if(_0x13de46){return db['MailApplication'][_0x7edc('0x27')]({'where':{'MailAccountId':_0x358225},'transaction':_0xa7f1f4})['then'](function(){var _0x51bb4b=_[_0x7edc('0x49')](_0x3dbc68,function(_0x2dfd45){_0x2dfd45[_0x7edc('0x6a')]=_0x358225;return _0x2dfd45;});return db[_0x7edc('0x96')]['bulkCreate'](_0x51bb4b,{'transaction':_0xa7f1f4});});}else{_0x42ad9d=0x194;_0x20c4e8=[];}});})[_0x7edc('0x11')](function(){if(_0x42ad9d!==0x194){return db['MailApplication'][_0x7edc('0x97')]({'where':{'MailAccountId':_0x358225},'order':_0x7edc('0x98')})[_0x7edc('0x11')](function(_0x2c6dd7){_0x20c4e8=_0x2c6dd7;});}})[_0x7edc('0x1b')](function(_0x2cd2d9){_0x42ad9d=0x1f4;logger[_0x7edc('0x17')](_0x2cd2d9[_0x7edc('0x2a')]);if(_0x2cd2d9[_0x7edc('0x2b')]){delete _0x2cd2d9['name'];}_0x20c4e8=_0x2cd2d9;})[_0x7edc('0x99')](function(){if(_0x20c4e8===null){_0x2416c6['sendStatus'](_0x42ad9d);}else{if(_0x42ad9d===0x1f4){_0x2416c6[_0x7edc('0x1d')](_0x42ad9d)[_0x7edc('0x2c')](_0x20c4e8);}else{_0x2416c6[_0x7edc('0x1d')](_0x42ad9d)[_0x7edc('0x25')](_0x20c4e8);}}});};exports[_0x7edc('0x9a')]=function(_0x4f70c9,_0x3943ee){var _0x293779={};var _0x514598={};var _0x53dd76;var _0x33753e;return db[_0x7edc('0x4a')]['findOne']({'where':{'id':_0x4f70c9[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x3943ee,null))['then'](function(_0x357639){if(_0x357639){_0x53dd76=_0x357639;_0x514598[_0x7edc('0x53')]=_[_0x7edc('0x50')](db[_0x7edc('0x96')][_0x7edc('0x4b')]);_0x514598[_0x7edc('0x4f')]=_[_0x7edc('0x50')](_0x4f70c9[_0x7edc('0x4f')]);_0x514598[_0x7edc('0x5a')]=_[_0x7edc('0x51')](_0x514598[_0x7edc('0x53')],_0x514598[_0x7edc('0x4f')]);_0x293779[_0x7edc('0x52')]=_['intersection'](_0x514598[_0x7edc('0x53')],qs['fields'](_0x4f70c9[_0x7edc('0x4f')][_0x7edc('0x54')]));_0x293779[_0x7edc('0x52')]=_0x293779[_0x7edc('0x52')][_0x7edc('0x73')]?_0x293779[_0x7edc('0x52')]:_0x514598[_0x7edc('0x53')];_0x293779[_0x7edc('0x57')]=qs[_0x7edc('0x58')](_0x4f70c9[_0x7edc('0x4f')]['sort']);_0x293779[_0x7edc('0x59')]=qs[_0x7edc('0x5a')](_[_0x7edc('0x5b')](_0x4f70c9[_0x7edc('0x4f')],_0x514598[_0x7edc('0x5a')]));if(_0x4f70c9['query'][_0x7edc('0x5c')]){_0x293779[_0x7edc('0x59')]=_['merge'](_0x293779['where'],{'$or':_[_0x7edc('0x49')](_0x293779[_0x7edc('0x52')],function(_0x68c00c){var _0x4af2fe={};_0x4af2fe[_0x68c00c]={'$like':'%'+_0x4f70c9[_0x7edc('0x4f')]['filter']+'%'};return _0x4af2fe;})});}_0x293779=_[_0x7edc('0x5d')]({},_0x293779,_0x4f70c9['options']);return _0x53dd76[_0x7edc('0x9a')](_0x293779);}})[_0x7edc('0x11')](function(_0x2869ac){if(_0x2869ac){_0x33753e=_0x2869ac[_0x7edc('0x73')];if(!_0x4f70c9[_0x7edc('0x4f')][_0x7edc('0x55')](_0x7edc('0x56'))){_0x293779['limit']=qs[_0x7edc('0x20')](_0x4f70c9[_0x7edc('0x4f')][_0x7edc('0x20')]);_0x293779['offset']=qs[_0x7edc('0x1f')](_0x4f70c9['query'][_0x7edc('0x1f')]);}return _0x53dd76[_0x7edc('0x9a')](_0x293779);}})[_0x7edc('0x11')](function(_0x1d68a4){if(_0x1d68a4){return _0x1d68a4?{'count':_0x33753e,'rows':_0x1d68a4}:null;}})[_0x7edc('0x11')](respondWithResult(_0x3943ee,null))[_0x7edc('0x1b')](handleError(_0x3943ee,null));};exports['getMessages']=function(_0x24a093,_0x3bb1db){var _0x251b9f={'raw':!![],'where':{}};var _0x5f5c41={};var _0x5229ba={'count':0x0,'rows':[]};return db[_0x7edc('0x4a')][_0x7edc('0x6e')]({'where':{'id':_0x24a093[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x3bb1db,null))[_0x7edc('0x11')](function(_0x5d9083){if(_0x5d9083){_0x5f5c41[_0x7edc('0x53')]=_[_0x7edc('0x50')](db[_0x7edc('0x9b')][_0x7edc('0x4b')]);_0x5f5c41['query']=_[_0x7edc('0x50')](_0x24a093[_0x7edc('0x4f')]);_0x5f5c41[_0x7edc('0x5a')]=_[_0x7edc('0x51')](_0x5f5c41[_0x7edc('0x53')],_0x5f5c41[_0x7edc('0x4f')]);_0x251b9f['attributes']=_[_0x7edc('0x51')](_0x5f5c41['model'],qs[_0x7edc('0x54')](_0x24a093['query'][_0x7edc('0x54')]));_0x251b9f[_0x7edc('0x52')]=_0x251b9f['attributes'][_0x7edc('0x73')]?_0x251b9f[_0x7edc('0x52')]:_0x5f5c41['model'];if(!_0x24a093[_0x7edc('0x4f')][_0x7edc('0x55')]('nolimit')){_0x251b9f[_0x7edc('0x20')]=qs['limit'](_0x24a093[_0x7edc('0x4f')][_0x7edc('0x20')]);_0x251b9f[_0x7edc('0x1f')]=qs[_0x7edc('0x1f')](_0x24a093[_0x7edc('0x4f')][_0x7edc('0x1f')]);}_0x251b9f[_0x7edc('0x57')]=qs[_0x7edc('0x58')](_0x24a093[_0x7edc('0x4f')][_0x7edc('0x58')]);_0x251b9f['where']=qs[_0x7edc('0x5a')](_[_0x7edc('0x5b')](_0x24a093[_0x7edc('0x4f')],_0x5f5c41[_0x7edc('0x5a')]));_0x251b9f['where'][_0x7edc('0x6a')]=_0x5d9083['id'];if(_0x24a093[_0x7edc('0x4f')]['filter']){_0x251b9f['where']=_['merge'](_0x251b9f[_0x7edc('0x59')],{'$or':_['map'](_0x251b9f['attributes'],function(_0x414528){var _0x3b1ec8={};_0x3b1ec8[_0x414528]={'$like':'%'+_0x24a093[_0x7edc('0x4f')][_0x7edc('0x5c')]+'%'};return _0x3b1ec8;})});}if(_0x24a093['query'][_0x7edc('0x9c')]){var _0xbb1906=_0x24a093[_0x7edc('0x4f')]['$gte']['split'](',');var _0x5941c3={};_0x5941c3[_0xbb1906[0x0]]={'$gte':moment(_0xbb1906[0x1])[_0x7edc('0x9d')](_0x7edc('0x9e'))};_0x251b9f[_0x7edc('0x59')]=_[_0x7edc('0x5d')](_0x251b9f[_0x7edc('0x59')],_0x5941c3);}_0x251b9f=_[_0x7edc('0x5d')]({},_0x251b9f,_0x24a093[_0x7edc('0x5e')]);return db[_0x7edc('0x9b')][_0x7edc('0x22')]({'where':_0x251b9f[_0x7edc('0x59')]})[_0x7edc('0x11')](function(_0xf39522){_0x5229ba[_0x7edc('0x22')]=_0xf39522;if(_0x24a093[_0x7edc('0x4f')][_0x7edc('0x5f')]){_0x251b9f[_0x7edc('0x64')]=[{'all':!![]}];}return db['MailMessage'][_0x7edc('0x60')](_0x251b9f);})[_0x7edc('0x11')](function(_0x4d0e7f){if(_0x24a093[_0x7edc('0x4f')][_0x7edc('0x9f')]===_0x7edc('0xa0')){for(var _0x55c2ec=0x0;_0x55c2ec<_0x4d0e7f[_0x7edc('0x73')];_0x55c2ec++){_0x4d0e7f[_0x55c2ec][_0x7edc('0x66')]=juice(_0x4d0e7f[_0x55c2ec][_0x7edc('0x66')]);}}_0x5229ba[_0x7edc('0x61')]=_0x4d0e7f;return _0x5229ba;});}})[_0x7edc('0x11')](respondWithFilteredResult(_0x3bb1db,_0x251b9f))[_0x7edc('0x1b')](handleError(_0x3bb1db,null));};exports[_0x7edc('0x2c')]=function(_0x9e746,_0x9f34b5){var _0x3c059d,_0x190a57={},_0x16bb11;if(_0x9e746[_0x7edc('0x66')]['to']){_0x16bb11=_0x9e746[_0x7edc('0x66')]['to'][_0x7edc('0xa1')](',')[0x0];}return db['MailAccount'][_0x7edc('0x65')]({'where':{'id':_0x9e746[_0x7edc('0x63')]['id']},'include':[{'model':db[_0x7edc('0xa2')],'as':_0x7edc('0xa3'),'include':[{'model':db[_0x7edc('0xa4')],'as':_0x7edc('0xa5'),'where':{'email':_0x16bb11},'limit':0x1,'order':[[_0x7edc('0xa6'),'DESC']]}]},{'model':db[_0x7edc('0x46')],'as':_0x7edc('0x43'),'raw':!![],'include':[{'model':db[_0x7edc('0xa7')],'as':_0x7edc('0xa7'),'raw':!![]}]}]})[_0x7edc('0x11')](handleEntityNotFound(_0x9f34b5,null))[_0x7edc('0x11')](function(_0x4e383c){if(!_0x4e383c)return;_0x3c059d=_0x4e383c;if(!_0x4e383c[_0x7edc('0x43')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x7edc('0x78')](_0x9e746[_0x7edc('0x66')][_0x7edc('0xa8')])){_0x9e746[_0x7edc('0x66')][_0x7edc('0xa8')]=util[_0x7edc('0x9d')](_0x7edc('0xa9'),_0x4e383c[_0x7edc('0x2b')],_0x4e383c['email']||_0x4e383c[_0x7edc('0x43')][_0x7edc('0x38')]);}if(_0x9e746[_0x7edc('0x66')][_0x7edc('0xaa')]&&_0x9e746[_0x7edc('0x66')]['attachments'][_0x7edc('0x73')]){for(var _0xc180a8=0x0;_0xc180a8<_0x9e746['body'][_0x7edc('0xaa')]['length'];_0xc180a8+=0x1){_0x9e746[_0x7edc('0x66')][_0x7edc('0xaa')][_0xc180a8]={'filename':_0x9e746[_0x7edc('0x66')][_0x7edc('0xaa')][_0xc180a8][_0x7edc('0x2b')],'path':path[_0x7edc('0xab')](config[_0x7edc('0xac')],'server/files/attachments',_0x9e746[_0x7edc('0x66')][_0x7edc('0xaa')][_0xc180a8]['basename'])};}}var _0x1e0c69=_0x4e383c[_0x7edc('0xad')]();return respondWithRpcPromise(_0x7edc('0xae'),_0x7edc('0xaf'),{'account':_0x1e0c69,'message':_0x9e746['body']});})[_0x7edc('0x11')](function(_0x2bc6bf){if(!_0x2bc6bf)return;_0x190a57=_0x2bc6bf;if(!_0x3c059d['List'])throw new Error('List\x20not\x20found');if(_0x3c059d[_0x7edc('0xa3')][_0x7edc('0xa5')][_0x7edc('0x73')])return _0x3c059d['List'][_0x7edc('0xa5')][0x0];return db[_0x7edc('0xa4')][_0x7edc('0x6c')](_[_0x7edc('0xa')](_0x9e746['body'],{'firstName':_0x9e746['body']['to'],'email':_0x9e746[_0x7edc('0x66')]['to'],'phone':_0x9e746[_0x7edc('0x66')]['to'],'ListId':_0x3c059d[_0x7edc('0x77')]}));})[_0x7edc('0x11')](function(_0x22af9a){if(!_0x22af9a)return;var _0x4002b3={'UserId':_0x9e746[_0x7edc('0x38')]['id'],'ContactId':_0x22af9a['id'],'MailAccountId':_0x3c059d['id'],'inReplyTo':_0x190a57[_0x7edc('0xb0')],'to':_0x9e746['body'][_0x7edc('0xa8')],'cc':_0x9e746['body']['cc'],'subject':_0x9e746[_0x7edc('0x66')][_0x7edc('0xb1')],'attach':_0x9e746['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x7edc('0xb2'),'Messages':[_[_0x7edc('0x5d')](_0x9e746[_0x7edc('0x66')],{'messageId':_0x190a57['messageId'],'sentAt':moment()[_0x7edc('0x9d')](_0x7edc('0x9e')),'read':!![],'MailAccountId':_0x3c059d['id'],'UserId':_0x9e746[_0x7edc('0x38')]['id'],'ContactId':_0x22af9a['id']})]};if(_0x9e746[_0x7edc('0x66')][_0x7edc('0xb3')]){_0x4002b3=_[_0x7edc('0x5d')](_0x4002b3,_0x9e746[_0x7edc('0x66')]['Interaction']);}return db['MailInteraction']['create'](_0x4002b3,{'include':[{'model':db[_0x7edc('0x9b')],'as':_0x7edc('0xb4')}]});})[_0x7edc('0x11')](respondWithResult(_0x9f34b5,null))[_0x7edc('0x1b')](handleError(_0x9f34b5,null));};exports[_0x7edc('0xb5')]=function(_0x1ffbd9,_0x165e97){return db['MailAccount'][_0x7edc('0x65')]({'where':{'id':_0x1ffbd9[_0x7edc('0x63')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x7edc('0xa7'),'raw':!![]}]}]})[_0x7edc('0x11')](handleEntityNotFound(_0x165e97,null))['then'](function(_0x49a9a8){if(!_0x49a9a8[_0x7edc('0x43')])return;var _0x26379f=_0x49a9a8['getSmtpOptions']();return respondWithRpcPromise(_0x7edc('0xb6'),_0x7edc('0xb5'),{'account':_0x26379f});})[_0x7edc('0x11')](respondWithResult(_0x165e97,null))[_0x7edc('0x1b')](handleError(_0x165e97,null));};exports[_0x7edc('0x27')]=function(_0x5cc3cb,_0x19f73f){return db[_0x7edc('0x4a')][_0x7edc('0x65')]({'where':{'id':_0x5cc3cb[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x19f73f,null))[_0x7edc('0x11')](function(_0x347145){if(_0x347145&&_0x347145[_0x7edc('0x41')]){throw new db[(_0x7edc('0xb7'))]['ValidationError'](_0x7edc('0xb8'));}return _0x347145;})[_0x7edc('0x11')](removeEntity(_0x19f73f,null))[_0x7edc('0x1b')](handleError(_0x19f73f,null));};exports['addAgents']=function(_0x476f17,_0x4d70f6){return db['MailAccount']['find']({'where':{'id':_0x476f17[_0x7edc('0x63')]['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x4d70f6,null))[_0x7edc('0x11')](function(_0x3b116e){if(_0x3b116e){return _0x3b116e['addAgents'](_0x476f17['body']['ids'],_[_0x7edc('0x86')](_0x476f17[_0x7edc('0x66')],['ids','id'])||{})[_0x7edc('0xb9')](function(_0xf57728){for(var _0x493cd7=0x0;_0x493cd7<_0x476f17[_0x7edc('0x66')][_0x7edc('0x70')][_0x7edc('0x73')];_0x493cd7+=0x1){socket['emit'](_0x7edc('0xba'),{'UserId':Number(_0x476f17[_0x7edc('0x66')][_0x7edc('0x70')][_0x493cd7]),'MailAccountId':Number(_0x476f17[_0x7edc('0x63')]['id'])});}return _0xf57728;});}})[_0x7edc('0x11')](respondWithResult(_0x4d70f6,null))[_0x7edc('0x1b')](handleError(_0x4d70f6,null));};exports['removeAgents']=function(_0x455a73,_0x27923b){return db[_0x7edc('0x4a')]['find']({'where':{'id':_0x455a73['params']['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0x27923b,null))['then'](function(_0x191624){if(_0x191624){return _0x191624[_0x7edc('0xbb')](_0x455a73[_0x7edc('0x4f')][_0x7edc('0x70')])[_0x7edc('0x11')](function(){if(_[_0x7edc('0xbc')](_0x455a73['query'][_0x7edc('0x70')])){for(var _0x5084ee=0x0;_0x5084ee<_0x455a73[_0x7edc('0x4f')][_0x7edc('0x70')][_0x7edc('0x73')];_0x5084ee+=0x1){socket[_0x7edc('0xbd')](_0x7edc('0xbe'),{'UserId':Number(_0x455a73['query'][_0x7edc('0x70')][_0x5084ee]),'MailAccountId':Number(_0x455a73[_0x7edc('0x63')]['id'])});}}else{socket[_0x7edc('0xbd')](_0x7edc('0xbe'),{'UserId':Number(_0x455a73['query']['ids']),'MailAccountId':Number(_0x455a73['params']['id'])});}});}})[_0x7edc('0x11')](respondWithStatusCode(_0x27923b,null))[_0x7edc('0x1b')](handleError(_0x27923b,null));};exports[_0x7edc('0xbf')]=function(_0x2d358b,_0xba985d){var _0x5122f9={};var _0x39a5dc={};var _0x325baf;var _0x24d50a;return db[_0x7edc('0x4a')]['findOne']({'where':{'id':_0x2d358b['params']['id']}})[_0x7edc('0x11')](handleEntityNotFound(_0xba985d,null))[_0x7edc('0x11')](function(_0x784aea){if(_0x784aea){_0x325baf=_0x784aea;_0x39a5dc['model']=_['keys'](db['User'][_0x7edc('0x4b')]);_0x39a5dc['query']=_[_0x7edc('0x50')](_0x2d358b[_0x7edc('0x4f')]);_0x39a5dc[_0x7edc('0x5a')]=_[_0x7edc('0x51')](_0x39a5dc[_0x7edc('0x53')],_0x39a5dc[_0x7edc('0x4f')]);_0x5122f9['attributes']=_[_0x7edc('0x51')](_0x39a5dc['model'],qs[_0x7edc('0x54')](_0x2d358b[_0x7edc('0x4f')][_0x7edc('0x54')]));_0x5122f9[_0x7edc('0x52')]=_0x5122f9[_0x7edc('0x52')][_0x7edc('0x73')]?_0x5122f9[_0x7edc('0x52')]:_0x39a5dc[_0x7edc('0x53')];_0x5122f9['order']=qs[_0x7edc('0x58')](_0x2d358b[_0x7edc('0x4f')][_0x7edc('0x58')]);_0x5122f9[_0x7edc('0x59')]=qs[_0x7edc('0x5a')](_[_0x7edc('0x5b')](_0x2d358b[_0x7edc('0x4f')],_0x39a5dc[_0x7edc('0x5a')]));if(_0x2d358b[_0x7edc('0x4f')][_0x7edc('0x5c')]){_0x5122f9[_0x7edc('0x59')]=_[_0x7edc('0x5d')](_0x5122f9[_0x7edc('0x59')],{'$or':_[_0x7edc('0x49')](_0x5122f9[_0x7edc('0x52')],function(_0x13dde6){var _0x44131d={};_0x44131d[_0x13dde6]={'$like':'%'+_0x2d358b['query']['filter']+'%'};return _0x44131d;})});}_0x5122f9=_['merge']({},_0x5122f9,_0x2d358b[_0x7edc('0x5e')]);return _0x325baf[_0x7edc('0xbf')](_0x5122f9);}})['then'](function(_0x5a3ddb){if(_0x5a3ddb){_0x24d50a=_0x5a3ddb[_0x7edc('0x73')];if(!_0x2d358b[_0x7edc('0x4f')][_0x7edc('0x55')](_0x7edc('0x56'))){_0x5122f9[_0x7edc('0x20')]=qs[_0x7edc('0x20')](_0x2d358b[_0x7edc('0x4f')][_0x7edc('0x20')]);_0x5122f9['offset']=qs[_0x7edc('0x1f')](_0x2d358b[_0x7edc('0x4f')][_0x7edc('0x1f')]);}return _0x325baf[_0x7edc('0xbf')](_0x5122f9);}})[_0x7edc('0x11')](function(_0x31a38d){if(_0x31a38d){return _0x31a38d?{'count':_0x24d50a,'rows':_0x31a38d}:null;}})['then'](respondWithResult(_0xba985d,null))[_0x7edc('0x1b')](handleError(_0xba985d,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5a89267..963fb91 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 _0x2d85=['events','../../mysqldb','MailAccount','setMaxListeners','save','remove','hasOwnProperty','hook','exports'];(function(_0x1dcfba,_0x5d8e4b){var _0x3e5535=function(_0x1bf5e9){while(--_0x1bf5e9){_0x1dcfba['push'](_0x1dcfba['shift']());}};_0x3e5535(++_0x5d8e4b);}(_0x2d85,0xd8));var _0x52d8=function(_0x3b68e1,_0x45b599){_0x3b68e1=_0x3b68e1-0x0;var _0x410ec5=_0x2d85[_0x3b68e1];return _0x410ec5;};'use strict';var EventEmitter=require(_0x52d8('0x0'));var MailAccount=require(_0x52d8('0x1'))['db'][_0x52d8('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x52d8('0x3')](0x0);var events={'afterCreate':_0x52d8('0x4'),'afterUpdate':'update','afterDestroy':_0x52d8('0x5')};function emitEvent(_0x543d20){return function(_0x406f82,_0x1607d6,_0x5f2076){MailAccountEvents['emit'](_0x543d20+':'+_0x406f82['id'],_0x406f82);MailAccountEvents['emit'](_0x543d20,_0x406f82);_0x5f2076(null);};}for(var e in events){if(events[_0x52d8('0x6')](e)){var event=events[e];MailAccount[_0x52d8('0x7')](e,emitEvent(event));}}module[_0x52d8('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x6515=['../../mysqldb','MailAccount','save','update','remove','emit','hook','exports','events'];(function(_0x12fcaa,_0x54a756){var _0x1e4346=function(_0x31a502){while(--_0x31a502){_0x12fcaa['push'](_0x12fcaa['shift']());}};_0x1e4346(++_0x54a756);}(_0x6515,0x1e5));var _0x5651=function(_0x31d59d,_0x2ce0a2){_0x31d59d=_0x31d59d-0x0;var _0x4953fb=_0x6515[_0x31d59d];return _0x4953fb;};'use strict';var EventEmitter=require(_0x5651('0x0'));var MailAccount=require(_0x5651('0x1'))['db'][_0x5651('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5651('0x3'),'afterUpdate':_0x5651('0x4'),'afterDestroy':_0x5651('0x5')};function emitEvent(_0x299ab0){return function(_0x1f4316,_0x188390,_0x27f505){MailAccountEvents[_0x5651('0x6')](_0x299ab0+':'+_0x1f4316['id'],_0x1f4316);MailAccountEvents[_0x5651('0x6')](_0x299ab0,_0x1f4316);_0x27f505(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x5651('0x7')](e,emitEvent(event));}}module[_0x5651('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 e9bf1f0..9d9cd10 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 _0x68e7=['secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','define','MailAccount','provider','host','Smtp','port'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0x68e7,0x14e));var _0x768e=function(_0x166aa4,_0x14a75f){_0x166aa4=_0x166aa4-0x0;var _0x1cd8cc=_0x68e7[_0x166aa4];return _0x1cd8cc;};'use strict';var attributes=require(_0x768e('0x0'));module[_0x768e('0x1')]=function(_0x59fe5d){return _0x59fe5d[_0x768e('0x2')](_0x768e('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x361691=this;var _0x2b46c0={'id':_0x361691['id'],'tls':{'rejectUnauthorized':![]}};if(_0x361691[_0x768e('0x4')]!=='custom'){_0x2b46c0['service']=_0x361691[_0x768e('0x4')];}else{_0x2b46c0[_0x768e('0x5')]=_0x361691[_0x768e('0x6')][_0x768e('0x5')];_0x2b46c0[_0x768e('0x7')]=_0x361691[_0x768e('0x6')][_0x768e('0x7')];_0x2b46c0[_0x768e('0x8')]=_0x361691['Smtp']['secure'];}if(_0x361691[_0x768e('0x6')][_0x768e('0x9')]){if(_0x361691[_0x768e('0x6')][_0x768e('0xa')]){if(!_0x361691[_0x768e('0x6')][_0x768e('0xb')])throw new Error(_0x768e('0xc'));_0x2b46c0[_0x768e('0xd')]={'type':_0x768e('0xe'),'user':_0x361691[_0x768e('0x6')][_0x768e('0xf')],'accessToken':_0x361691[_0x768e('0x6')][_0x768e('0xb')][_0x768e('0x10')]};}else{_0x2b46c0[_0x768e('0xd')]={'user':_0x361691['Smtp'][_0x768e('0xf')],'pass':_0x361691['Smtp'][_0x768e('0x11')]};}}return _0x2b46c0;}}});}; \ No newline at end of file +var _0x1972=['./mailAccount.attributes','mail_accounts','provider','custom','service','host','port','Smtp','secure','CloudProvider','auth','user','data5','pass'];(function(_0x15eb0e,_0x5e21ac){var _0x4e98e7=function(_0x487f4d){while(--_0x487f4d){_0x15eb0e['push'](_0x15eb0e['shift']());}};_0x4e98e7(++_0x5e21ac);}(_0x1972,0xb6));var _0x2197=function(_0x27aaf3,_0x4de544){_0x27aaf3=_0x27aaf3-0x0;var _0x5a2e47=_0x1972[_0x27aaf3];return _0x5a2e47;};'use strict';var attributes=require(_0x2197('0x0'));module['exports']=function(_0x2dd8e6){return _0x2dd8e6['define']('MailAccount',attributes,{'tableName':_0x2197('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x15ebf7=this;var _0x23fe1a={'id':_0x15ebf7['id'],'tls':{'rejectUnauthorized':![]}};if(_0x15ebf7[_0x2197('0x2')]!==_0x2197('0x3')){_0x23fe1a[_0x2197('0x4')]=_0x15ebf7[_0x2197('0x2')];}else{_0x23fe1a[_0x2197('0x5')]=_0x15ebf7['Smtp'][_0x2197('0x5')];_0x23fe1a[_0x2197('0x6')]=_0x15ebf7[_0x2197('0x7')]['port'];_0x23fe1a['secure']=_0x15ebf7['Smtp'][_0x2197('0x8')];}if(_0x15ebf7[_0x2197('0x7')]['authentication']){if(_0x15ebf7[_0x2197('0x7')]['modernAuthentication']){if(!_0x15ebf7[_0x2197('0x7')][_0x2197('0x9')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x23fe1a[_0x2197('0xa')]={'type':'OAuth2','user':_0x15ebf7[_0x2197('0x7')][_0x2197('0xb')],'accessToken':_0x15ebf7[_0x2197('0x7')][_0x2197('0x9')][_0x2197('0xc')]};}else{_0x23fe1a[_0x2197('0xa')]={'user':_0x15ebf7['Smtp'][_0x2197('0xb')],'pass':_0x15ebf7[_0x2197('0x7')][_0x2197('0xd')]};}}return _0x23fe1a;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 6f32825..e72ee45 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 _0x0689=['MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','limit','include','map','model','attributes','then','debug','ShowMailAccount','find','where','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','List','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','create','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','interaction','get','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId'];(function(_0x53e532,_0x2f3f0c){var _0x38e801=function(_0x3f9dc0){while(--_0x3f9dc0){_0x53e532['push'](_0x53e532['shift']());}};_0x38e801(++_0x2f3f0c);}(_0x0689,0x161));var _0x9068=function(_0x3bd1fd,_0x1472ce){_0x3bd1fd=_0x3bd1fd-0x0;var _0x28ea80=_0x0689[_0x3bd1fd];return _0x28ea80;};'use strict';var _=require('lodash');var moment=require(_0x9068('0x0'));var BPromise=require('bluebird');var rs=require(_0x9068('0x1'));var Redis=require(_0x9068('0x2'));var db=require(_0x9068('0x3'))['db'];var logger=require(_0x9068('0x4'))(_0x9068('0x5'));var config=require(_0x9068('0x6'));var jayson=require(_0x9068('0x7'));var client=jayson[_0x9068('0x8')][_0x9068('0x9')]({'port':0x232c});config[_0x9068('0xa')]=_['defaults'](config[_0x9068('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9068('0xa')]));require(_0x9068('0xb'))[_0x9068('0xc')](socket);function respondWithRpcPromise(_0x77a2db,_0x1c63d2,_0xf611cf){return new BPromise(function(_0x451a17,_0x141e26){return client[_0x9068('0xd')](_0x77a2db,_0xf611cf)['then'](function(_0x364bd5){logger[_0x9068('0xe')](_0x9068('0xf'),_0x1c63d2,_0x9068('0x10'));logger['debug'](_0x9068('0x11'),_0x1c63d2,_0x9068('0x10'),JSON[_0x9068('0x12')](_0x364bd5));if(_0x364bd5['error']){if(_0x364bd5[_0x9068('0x13')][_0x9068('0x14')]===0x1f4){logger[_0x9068('0x13')]('MailAccount,\x20%s,\x20%s',_0x1c63d2,_0x364bd5[_0x9068('0x13')][_0x9068('0x15')]);return _0x141e26(_0x364bd5['error'][_0x9068('0x15')]);}logger[_0x9068('0x13')]('MailAccount,\x20%s,\x20%s',_0x1c63d2,_0x364bd5[_0x9068('0x13')][_0x9068('0x15')]);return _0x451a17(_0x364bd5[_0x9068('0x13')][_0x9068('0x15')]);}else{logger['info'](_0x9068('0xf'),_0x1c63d2,_0x9068('0x10'));_0x451a17(_0x364bd5[_0x9068('0x16')][_0x9068('0x15')]);}})[_0x9068('0x17')](function(_0x1d09bf){logger[_0x9068('0x13')](_0x9068('0xf'),_0x1c63d2,_0x1d09bf);_0x141e26(_0x1d09bf);});});}exports[_0x9068('0x18')]=function(_0x5844b6){var _0x409a02=this;return new Promise(function(_0x39ed88,_0x424f73){return db[_0x9068('0x19')][_0x9068('0x1a')]({'raw':_0x5844b6[_0x9068('0x1b')]?_0x5844b6[_0x9068('0x1b')][_0x9068('0x1c')]===undefined?!![]:![]:!![],'where':_0x5844b6['options']?_0x5844b6['options']['where']||null:null,'attributes':_0x5844b6[_0x9068('0x1b')]?_0x5844b6['options']['attributes']||null:null,'limit':_0x5844b6[_0x9068('0x1b')]?_0x5844b6[_0x9068('0x1b')][_0x9068('0x1d')]||null:null,'include':_0x5844b6[_0x9068('0x1b')]?_0x5844b6['options'][_0x9068('0x1e')]?_[_0x9068('0x1f')](_0x5844b6[_0x9068('0x1b')][_0x9068('0x1e')],function(_0x12f17f){return{'model':db[_0x12f17f[_0x9068('0x20')]],'as':_0x12f17f['as'],'attributes':_0x12f17f['attributes'],'include':_0x12f17f[_0x9068('0x1e')]?_[_0x9068('0x1f')](_0x12f17f['include'],function(_0x12369a){return{'model':db[_0x12369a[_0x9068('0x20')]],'as':_0x12369a['as'],'attributes':_0x12369a['attributes'],'include':_0x12369a['include']?_[_0x9068('0x1f')](_0x12369a['include'],function(_0x1d197a){return{'model':db[_0x1d197a[_0x9068('0x20')]],'as':_0x1d197a['as'],'attributes':_0x1d197a[_0x9068('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9068('0x22')](function(_0x2f14ab){logger['info'](_0x9068('0x18'),_0x5844b6);logger[_0x9068('0x23')](_0x9068('0x18'),_0x5844b6,JSON[_0x9068('0x12')](_0x2f14ab));_0x39ed88(_0x2f14ab);})['catch'](function(_0x5a49b8){logger[_0x9068('0x13')](_0x9068('0x18'),_0x5a49b8[_0x9068('0x15')],_0x5844b6);_0x424f73(_0x409a02[_0x9068('0x13')](0x1f4,_0x5a49b8[_0x9068('0x15')]));});});};exports[_0x9068('0x24')]=function(_0x1c130b){var _0x31d1f6=this;return new Promise(function(_0xcd8a0d,_0x339b03){return db['MailAccount'][_0x9068('0x25')]({'raw':_0x1c130b[_0x9068('0x1b')]?_0x1c130b[_0x9068('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1c130b[_0x9068('0x1b')]?_0x1c130b[_0x9068('0x1b')][_0x9068('0x26')]||null:null,'attributes':_0x1c130b[_0x9068('0x1b')]?_0x1c130b['options'][_0x9068('0x21')]||null:null,'include':_0x1c130b['options']?_0x1c130b[_0x9068('0x1b')]['include']?_[_0x9068('0x1f')](_0x1c130b[_0x9068('0x1b')][_0x9068('0x1e')],function(_0x526c3a){return{'model':db[_0x526c3a[_0x9068('0x20')]],'as':_0x526c3a['as'],'attributes':_0x526c3a['attributes'],'include':_0x526c3a[_0x9068('0x1e')]?_[_0x9068('0x1f')](_0x526c3a[_0x9068('0x1e')],function(_0x247a76){return{'model':db[_0x247a76[_0x9068('0x20')]],'as':_0x247a76['as'],'attributes':_0x247a76[_0x9068('0x21')],'include':_0x247a76[_0x9068('0x1e')]?_[_0x9068('0x1f')](_0x247a76[_0x9068('0x1e')],function(_0x509483){return{'model':db[_0x509483[_0x9068('0x20')]],'as':_0x509483['as'],'attributes':_0x509483[_0x9068('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9068('0x22')](function(_0xe6f096){if(_0x1c130b['options']['smtp']===!![])_0xe6f096[_0x9068('0x27')](_0x9068('0x28'),_0xe6f096[_0x9068('0x29')]());logger[_0x9068('0xe')](_0x9068('0x24'),_0x1c130b);logger[_0x9068('0x23')](_0x9068('0x24'),_0x1c130b,JSON[_0x9068('0x12')](_0xe6f096));_0xcd8a0d(_0xe6f096);})[_0x9068('0x17')](function(_0x58e2a4){logger[_0x9068('0x13')](_0x9068('0x24'),_0x58e2a4[_0x9068('0x15')],_0x1c130b);_0x339b03(_0x31d1f6[_0x9068('0x13')](0x1f4,_0x58e2a4[_0x9068('0x15')]));});});};exports[_0x9068('0x2a')]=function(_0x3c4b6a){var _0x93800d=this;return new Promise(function(_0x53201f,_0x145881){var _0x45eb4c={'body':_0x3c4b6a[_0x9068('0x2b')],'channel':_0x9068('0x2c')};var _0x49f711=_[_0x9068('0x2d')](_['keys'](db[_0x9068('0x2e')]['rawAttributes']),[_0x9068('0x2f'),_0x9068('0x30'),_0x9068('0x31'),_0x9068('0x32')]);var _0x4a1efd=![];if(_0x3c4b6a[_0x9068('0x2b')]['id']){delete _0x3c4b6a[_0x9068('0x2b')]['id'];}if(_[_0x9068('0x33')](_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x34')])){return _0x145881(_0x93800d[_0x9068('0x13')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x2b')])||_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x2b')]===''){return _0x145881(_0x93800d[_0x9068('0x13')](0x1f4,_0x9068('0x35')));}if(_[_0x9068('0x33')](_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x36')])){return _0x145881(_0x93800d[_0x9068('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49f711));}if(!_[_0x9068('0x37')](_0x49f711,_0x3c4b6a[_0x9068('0x2b')]['mapKey'])){return _0x145881(_0x93800d[_0x9068('0x13')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49f711));}var _0xad12b7={};_0xad12b7[_0x3c4b6a['body'][_0x9068('0x36')]]=_0x3c4b6a[_0x9068('0x2b')]['from'];return db[_0x9068('0x19')][_0x9068('0x25')]({'where':{'id':_0x3c4b6a[_0x9068('0x38')]['id']},'include':[{'model':db[_0x9068('0x39')],'as':'List','include':[{'model':db[_0x9068('0x2e')],'as':_0x9068('0x3a'),'where':_0xad12b7,'limit':0x1,'order':[['updatedAt',_0x9068('0x3b')]]}]},{'model':db[_0x9068('0x3c')],'as':_0x9068('0x3d')},{'model':db[_0x9068('0x3e')],'as':_0x9068('0x3f'),'include':[{'model':db[_0x9068('0x40')],'as':_0x9068('0x40')}]}]})['then'](function(_0x49513f){if(_0x49513f&&_0x49513f['List']){var _0x5e29b5=_0x49513f['get']({'plain':!![]});_0x45eb4c[_0x9068('0x38')]=_[_0x9068('0x41')](_0x5e29b5,[_0x9068('0x3d'),_0x9068('0x42')]);_0x45eb4c[_0x9068('0x38')][_0x9068('0x28')]=_0x49513f['getSmtpOptions']();_0x45eb4c[_0x9068('0x43')]=_0x5e29b5['Applications'];_0x45eb4c[_0x9068('0x44')]=_0x5e29b5[_0x9068('0x42')];_0x45eb4c['applications']=_[_0x9068('0x45')](_0x45eb4c[_0x9068('0x43')],[_0x9068('0x46')],[_0x9068('0x47')]);if(_0x45eb4c[_0x9068('0x38')]&&_0x45eb4c[_0x9068('0x38')][_0x9068('0x48')]){_0x45eb4c[_0x9068('0x43')][_0x9068('0x49')]({'id':0x0,'priority':_0x45eb4c[_0x9068('0x43')][_0x9068('0x4a')]+0x1,'app':_0x9068('0x4b'),'appdata':_0x9068('0x48'),'interval':_0x9068('0x4c')});}if(_0x45eb4c[_0x9068('0x38')][_0x9068('0x3d')]){delete _0x45eb4c[_0x9068('0x38')][_0x9068('0x3d')];}if(_0x45eb4c[_0x9068('0x38')]['List']){delete _0x45eb4c[_0x9068('0x38')][_0x9068('0x42')];}if(_0x5e29b5['List'][_0x9068('0x3a')]['length']){return _0x5e29b5[_0x9068('0x42')][_0x9068('0x3a')][0x0];}var _0x44638f=_[_0x9068('0x4d')](_0x3c4b6a[_0x9068('0x2b')],{'firstName':_0x3c4b6a[_0x9068('0x2b')]['from'],'ListId':_0x5e29b5[_0x9068('0x32')]});_0x44638f[_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x36')]]=_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x34')];return db['CmContact'][_0x9068('0x4e')](_0x44638f);}else{throw new Error(_0x9068('0x4f'));}})[_0x9068('0x22')](function(_0x5a65e9){_0x45eb4c['contact']=_0x5a65e9;if(_0x5a65e9){if(!_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x50')]){_0x3c4b6a[_0x9068('0x2b')]['message']['messageId']=rs['generate']()+'\x20'+_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')]['from'];}var _0x553ee4={'ContactId':_0x5a65e9['id'],'MailAccountId':_0x3c4b6a[_0x9068('0x38')]['id'],'inReplyTo':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x50')],'to':_0x3c4b6a[_0x9068('0x2b')]['message'][_0x9068('0x34')],'cc':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')]['cc'],'subject':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x51')],'attach':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x52')],'lastMsgAt':moment()[_0x9068('0x53')](_0x9068('0x54')),'lastMsgDirection':'in'};return db[_0x9068('0x55')][_0x9068('0x25')]({'where':{'closed':![],'MailAccountId':_0x3c4b6a['account']['id']},'include':[{'model':db[_0x9068('0x56')],'as':_0x9068('0x57'),'attributes':['messageId'],'where':{'messageId':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x58')]}}]})[_0x9068('0x22')](function(_0x3d7112){if(_0x3d7112){return[_0x3d7112,![]];}return db[_0x9068('0x55')][_0x9068('0x4e')](_0x553ee4)['then'](function(_0x4aedb4){return[_0x4aedb4,!![]];});});}else{throw new Error(_0x9068('0x59'));}})['spread'](function(_0x591770,_0x12c95b){if(_0x591770){_0x4a1efd=_0x12c95b;if(!_0x12c95b){return _0x591770[_0x9068('0x5a')]({'inReplyTo':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x50')],'to':_0x3c4b6a[_0x9068('0x2b')]['message']['from'],'cc':_0x3c4b6a['body']['message']['cc'],'subject':_0x3c4b6a[_0x9068('0x2b')]['message'][_0x9068('0x51')],'attach':_0x591770[_0x9068('0x52')]?_0x591770['attach']:_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x52')],'substatus':null,'substatusAt':moment()[_0x9068('0x53')](_0x9068('0x54')),'lastMsgAt':moment()[_0x9068('0x53')](_0x9068('0x54')),'lastMsgDirection':'in'});}else{return _0x591770;}}})[_0x9068('0x22')](function(_0x5273c1){_0x45eb4c[_0x9068('0x5b')]=_0x5273c1[_0x9068('0x5c')]({'plain':!![]});_0x45eb4c[_0x9068('0x5b')][_0x9068('0x5d')]=_0x4a1efd;return db[_0x9068('0x56')][_0x9068('0x4e')]({'body':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x2b')],'MailAccountId':_0x3c4b6a[_0x9068('0x38')]['id'],'MailInteractionId':_0x5273c1['id'],'direction':'in','ContactId':_0x45eb4c[_0x9068('0x5e')]['id'],'messageId':_0x3c4b6a['body'][_0x9068('0x15')]['messageId'],'from':_0x3c4b6a['body']['message'][_0x9068('0x34')],'to':_0x3c4b6a[_0x9068('0x2b')]['message']['to'],'cc':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')]['cc'],'subject':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')]['subject'],'attach':_0x3c4b6a[_0x9068('0x2b')]['message'][_0x9068('0x52')],'Attachments':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x5f')],'originTo':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x60')],'originCc':_0x3c4b6a[_0x9068('0x2b')]['message'][_0x9068('0x61')],'bcc':_0x3c4b6a['body']['message'][_0x9068('0x62')],'ChatWebsiteId':_0x3c4b6a[_0x9068('0x2b')]['message'][_0x9068('0x63')]||null,'originChannel':_0x3c4b6a[_0x9068('0x2b')][_0x9068('0x15')][_0x9068('0x64')]||'Email','ChatOfflineMessageId':_0x3c4b6a[_0x9068('0x2b')]['message'][_0x9068('0x65')]||null},{'include':[{'model':db[_0x9068('0x66')],'as':_0x9068('0x67')}]});})['then'](function(_0x2f2ba7){_0x45eb4c[_0x9068('0x15')]=_0x2f2ba7;if(!_0x45eb4c[_0x9068('0x5b')][_0x9068('0x68')]){return;}return db[_0x9068('0x69')]['find']({'attributes':['id',_0x9068('0x6a')],'where':{'id':_0x45eb4c['interaction'][_0x9068('0x68')]}});})[_0x9068('0x22')](function(_0x30bde5){if(_0x30bde5){_0x45eb4c[_0x9068('0x43')][_0x9068('0x6b')]({'id':0x0,'priority':0x0,'app':_0x9068('0x6c'),'appdata':_0x30bde5[_0x9068('0x6a')]+','+(_0x45eb4c[_0x9068('0x38')][_0x9068('0x6d')]||0xa),'interval':_0x9068('0x4c')});}if(!_0x45eb4c['interaction'][_0x9068('0x6e')]){return;}return db[_0x9068('0x6f')][_0x9068('0x25')]({'attributes':['id','name'],'where':{'id':_0x45eb4c['interaction'][_0x9068('0x6e')]}});})[_0x9068('0x22')](function(_0x1ffeb8){if(_0x1ffeb8){_0x45eb4c[_0x9068('0x43')][_0x9068('0x6b')]({'id':0x0,'priority':0x1,'app':_0x9068('0x70'),'appdata':_0x1ffeb8[_0x9068('0x6a')]+','+(_0x45eb4c[_0x9068('0x38')][_0x9068('0x71')]||0x12c),'interval':_0x9068('0x4c')});}return respondWithRpcPromise(_0x9068('0x72'),_0x9068('0x73'),_0x45eb4c);})[_0x9068('0x22')](function(_0x4d0a62){_0x53201f(_0x4d0a62);})[_0x9068('0x17')](function(_0x344755){_0x145881(_0x93800d[_0x9068('0x13')](0x1f4,_0x344755[_0x9068('0x15')]));});});}; \ No newline at end of file +var _0xbd10=['get','interaction','created','attachments','originTo','bcc','originChannel','Email','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','MailQueue','queue','Start','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','List','omit','applications','Applications','orderBy','asc','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','attach'];(function(_0x4c25ba,_0x50e591){var _0x225109=function(_0x40cb60){while(--_0x40cb60){_0x4c25ba['push'](_0x4c25ba['shift']());}};_0x225109(++_0x50e591);}(_0xbd10,0x85));var _0x0bd1=function(_0x2ac35a,_0x1f68f7){_0x2ac35a=_0x2ac35a-0x0;var _0x40ba19=_0xbd10[_0x2ac35a];return _0x40ba19;};'use strict';var _=require(_0x0bd1('0x0'));var moment=require(_0x0bd1('0x1'));var BPromise=require(_0x0bd1('0x2'));var rs=require('randomstring');var Redis=require(_0x0bd1('0x3'));var db=require(_0x0bd1('0x4'))['db'];var logger=require(_0x0bd1('0x5'))('rpc');var config=require(_0x0bd1('0x6'));var jayson=require(_0x0bd1('0x7'));var client=jayson[_0x0bd1('0x8')][_0x0bd1('0x9')]({'port':0x232c});config[_0x0bd1('0xa')]=_[_0x0bd1('0xb')](config['redis'],{'host':_0x0bd1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd1('0xa')]));require(_0x0bd1('0xd'))[_0x0bd1('0xe')](socket);function respondWithRpcPromise(_0x468e7c,_0x540a32,_0x22b38f){return new BPromise(function(_0x631d20,_0x6e9f80){return client[_0x0bd1('0xf')](_0x468e7c,_0x22b38f)[_0x0bd1('0x10')](function(_0x216523){logger['info'](_0x0bd1('0x11'),_0x540a32,_0x0bd1('0x12'));logger[_0x0bd1('0x13')](_0x0bd1('0x14'),_0x540a32,_0x0bd1('0x12'),JSON[_0x0bd1('0x15')](_0x216523));if(_0x216523['error']){if(_0x216523[_0x0bd1('0x16')][_0x0bd1('0x17')]===0x1f4){logger[_0x0bd1('0x16')]('MailAccount,\x20%s,\x20%s',_0x540a32,_0x216523['error'][_0x0bd1('0x18')]);return _0x6e9f80(_0x216523[_0x0bd1('0x16')][_0x0bd1('0x18')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x540a32,_0x216523[_0x0bd1('0x16')][_0x0bd1('0x18')]);return _0x631d20(_0x216523[_0x0bd1('0x16')]['message']);}else{logger[_0x0bd1('0x19')](_0x0bd1('0x11'),_0x540a32,_0x0bd1('0x12'));_0x631d20(_0x216523[_0x0bd1('0x1a')]['message']);}})[_0x0bd1('0x1b')](function(_0x3d1170){logger['error'](_0x0bd1('0x11'),_0x540a32,_0x3d1170);_0x6e9f80(_0x3d1170);});});}exports[_0x0bd1('0x1c')]=function(_0x59d106){var _0x503b57=this;return new Promise(function(_0x5ab684,_0x134431){return db[_0x0bd1('0x1d')][_0x0bd1('0x1e')]({'raw':_0x59d106[_0x0bd1('0x1f')]?_0x59d106[_0x0bd1('0x1f')][_0x0bd1('0x20')]===undefined?!![]:![]:!![],'where':_0x59d106[_0x0bd1('0x1f')]?_0x59d106['options'][_0x0bd1('0x21')]||null:null,'attributes':_0x59d106[_0x0bd1('0x1f')]?_0x59d106[_0x0bd1('0x1f')][_0x0bd1('0x22')]||null:null,'limit':_0x59d106[_0x0bd1('0x1f')]?_0x59d106['options'][_0x0bd1('0x23')]||null:null,'include':_0x59d106['options']?_0x59d106['options'][_0x0bd1('0x24')]?_[_0x0bd1('0x25')](_0x59d106[_0x0bd1('0x1f')][_0x0bd1('0x24')],function(_0x237f4a){return{'model':db[_0x237f4a[_0x0bd1('0x26')]],'as':_0x237f4a['as'],'attributes':_0x237f4a[_0x0bd1('0x22')],'include':_0x237f4a[_0x0bd1('0x24')]?_[_0x0bd1('0x25')](_0x237f4a['include'],function(_0x5cb236){return{'model':db[_0x5cb236[_0x0bd1('0x26')]],'as':_0x5cb236['as'],'attributes':_0x5cb236['attributes'],'include':_0x5cb236[_0x0bd1('0x24')]?_[_0x0bd1('0x25')](_0x5cb236['include'],function(_0x5423a7){return{'model':db[_0x5423a7['model']],'as':_0x5423a7['as'],'attributes':_0x5423a7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4616b9){logger[_0x0bd1('0x19')](_0x0bd1('0x1c'),_0x59d106);logger['debug'](_0x0bd1('0x1c'),_0x59d106,JSON[_0x0bd1('0x15')](_0x4616b9));_0x5ab684(_0x4616b9);})['catch'](function(_0x49debf){logger[_0x0bd1('0x16')]('GetMailAccount',_0x49debf['message'],_0x59d106);_0x134431(_0x503b57['error'](0x1f4,_0x49debf[_0x0bd1('0x18')]));});});};exports[_0x0bd1('0x27')]=function(_0x12e9bb){var _0x534abf=this;return new Promise(function(_0x62b713,_0x2cd5c0){return db['MailAccount']['find']({'raw':_0x12e9bb[_0x0bd1('0x1f')]?_0x12e9bb['options'][_0x0bd1('0x20')]===undefined?!![]:![]:!![],'where':_0x12e9bb[_0x0bd1('0x1f')]?_0x12e9bb['options'][_0x0bd1('0x21')]||null:null,'attributes':_0x12e9bb[_0x0bd1('0x1f')]?_0x12e9bb[_0x0bd1('0x1f')]['attributes']||null:null,'include':_0x12e9bb[_0x0bd1('0x1f')]?_0x12e9bb['options'][_0x0bd1('0x24')]?_[_0x0bd1('0x25')](_0x12e9bb[_0x0bd1('0x1f')][_0x0bd1('0x24')],function(_0x484195){return{'model':db[_0x484195[_0x0bd1('0x26')]],'as':_0x484195['as'],'attributes':_0x484195[_0x0bd1('0x22')],'include':_0x484195[_0x0bd1('0x24')]?_[_0x0bd1('0x25')](_0x484195[_0x0bd1('0x24')],function(_0x24943a){return{'model':db[_0x24943a[_0x0bd1('0x26')]],'as':_0x24943a['as'],'attributes':_0x24943a['attributes'],'include':_0x24943a[_0x0bd1('0x24')]?_[_0x0bd1('0x25')](_0x24943a['include'],function(_0x224159){return{'model':db[_0x224159[_0x0bd1('0x26')]],'as':_0x224159['as'],'attributes':_0x224159[_0x0bd1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0bd1('0x10')](function(_0x1008e3){if(_0x12e9bb[_0x0bd1('0x1f')][_0x0bd1('0x28')]===!![])_0x1008e3[_0x0bd1('0x29')](_0x0bd1('0x2a'),_0x1008e3[_0x0bd1('0x2b')]());logger[_0x0bd1('0x19')](_0x0bd1('0x27'),_0x12e9bb);logger[_0x0bd1('0x13')](_0x0bd1('0x27'),_0x12e9bb,JSON[_0x0bd1('0x15')](_0x1008e3));_0x62b713(_0x1008e3);})[_0x0bd1('0x1b')](function(_0x3d858e){logger[_0x0bd1('0x16')]('ShowMailAccount',_0x3d858e['message'],_0x12e9bb);_0x2cd5c0(_0x534abf[_0x0bd1('0x16')](0x1f4,_0x3d858e[_0x0bd1('0x18')]));});});};exports[_0x0bd1('0x2c')]=function(_0x2446d3){var _0x316c37=this;return new Promise(function(_0x5fcd17,_0x4f00e7){var _0x55415c={'body':_0x2446d3[_0x0bd1('0x2d')],'channel':_0x0bd1('0x2e')};var _0x22c0b2=_[_0x0bd1('0x2f')](_['keys'](db[_0x0bd1('0x30')]['rawAttributes']),[_0x0bd1('0x31'),'updatedAt',_0x0bd1('0x32'),_0x0bd1('0x33')]);var _0x32cff5=![];if(_0x2446d3[_0x0bd1('0x2d')]['id']){delete _0x2446d3['body']['id'];}if(_[_0x0bd1('0x34')](_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x35')])){return _0x4f00e7(_0x316c37['error'](0x1f4,_0x0bd1('0x36')));}if(_[_0x0bd1('0x34')](_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x2d')])||_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x2d')]===''){return _0x4f00e7(_0x316c37[_0x0bd1('0x16')](0x1f4,_0x0bd1('0x37')));}if(_[_0x0bd1('0x34')](_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x38')])){return _0x4f00e7(_0x316c37['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22c0b2));}if(!_[_0x0bd1('0x39')](_0x22c0b2,_0x2446d3['body'][_0x0bd1('0x38')])){return _0x4f00e7(_0x316c37['error'](0x1f4,_0x0bd1('0x3a')+_0x22c0b2));}var _0x1b6f2b={};_0x1b6f2b[_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x38')]]=_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x35')];return db[_0x0bd1('0x1d')][_0x0bd1('0x3b')]({'where':{'id':_0x2446d3[_0x0bd1('0x3c')]['id']},'include':[{'model':db[_0x0bd1('0x3d')],'as':'List','include':[{'model':db[_0x0bd1('0x30')],'as':_0x0bd1('0x3e'),'where':_0x1b6f2b,'limit':0x1,'order':[[_0x0bd1('0x3f'),_0x0bd1('0x40')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x0bd1('0x41')],'as':_0x0bd1('0x42'),'include':[{'model':db[_0x0bd1('0x43')],'as':'CloudProvider'}]}]})[_0x0bd1('0x10')](function(_0x2cf6cb){if(_0x2cf6cb&&_0x2cf6cb[_0x0bd1('0x44')]){var _0x1c5299=_0x2cf6cb['get']({'plain':!![]});_0x55415c['account']=_[_0x0bd1('0x45')](_0x1c5299,['Applications',_0x0bd1('0x44')]);_0x55415c['account'][_0x0bd1('0x2a')]=_0x2cf6cb['getSmtpOptions']();_0x55415c[_0x0bd1('0x46')]=_0x1c5299[_0x0bd1('0x47')];_0x55415c['list']=_0x1c5299['List'];_0x55415c[_0x0bd1('0x46')]=_[_0x0bd1('0x48')](_0x55415c['applications'],['priority'],[_0x0bd1('0x49')]);if(_0x55415c[_0x0bd1('0x3c')]&&_0x55415c[_0x0bd1('0x3c')]['autoclose']){_0x55415c['applications'][_0x0bd1('0x4a')]({'id':0x0,'priority':_0x55415c[_0x0bd1('0x46')][_0x0bd1('0x4b')]+0x1,'app':_0x0bd1('0x4c'),'appdata':'autoclose','interval':_0x0bd1('0x4d')});}if(_0x55415c['account']['Applications']){delete _0x55415c[_0x0bd1('0x3c')]['Applications'];}if(_0x55415c[_0x0bd1('0x3c')]['List']){delete _0x55415c['account'][_0x0bd1('0x44')];}if(_0x1c5299[_0x0bd1('0x44')][_0x0bd1('0x3e')]['length']){return _0x1c5299[_0x0bd1('0x44')]['Contacts'][0x0];}var _0x2a6d46=_['defaults'](_0x2446d3['body'],{'firstName':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x35')],'ListId':_0x1c5299['ListId']});_0x2a6d46[_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x38')]]=_0x2446d3['body'][_0x0bd1('0x35')];return db[_0x0bd1('0x30')][_0x0bd1('0x4e')](_0x2a6d46);}else{throw new Error(_0x0bd1('0x4f'));}})[_0x0bd1('0x10')](function(_0x254f5b){_0x55415c[_0x0bd1('0x50')]=_0x254f5b;if(_0x254f5b){if(!_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x51')]){_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x51')]=rs[_0x0bd1('0x52')]()+'\x20'+_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')]['from'];}var _0x5b2845={'ContactId':_0x254f5b['id'],'MailAccountId':_0x2446d3[_0x0bd1('0x3c')]['id'],'inReplyTo':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x51')],'to':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x35')],'cc':_0x2446d3['body']['message']['cc'],'subject':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x53')],'attach':_0x2446d3[_0x0bd1('0x2d')]['message']['attach'],'lastMsgAt':moment()[_0x0bd1('0x54')](_0x0bd1('0x55')),'lastMsgDirection':'in'};return db[_0x0bd1('0x56')][_0x0bd1('0x3b')]({'where':{'closed':![],'MailAccountId':_0x2446d3[_0x0bd1('0x3c')]['id']},'include':[{'model':db[_0x0bd1('0x57')],'as':'Messages','attributes':[_0x0bd1('0x51')],'where':{'messageId':_0x2446d3['body'][_0x0bd1('0x18')][_0x0bd1('0x58')]}}]})[_0x0bd1('0x10')](function(_0x249cde){if(_0x249cde){return[_0x249cde,![]];}return db[_0x0bd1('0x56')][_0x0bd1('0x4e')](_0x5b2845)[_0x0bd1('0x10')](function(_0x4e3067){return[_0x4e3067,!![]];});});}else{throw new Error(_0x0bd1('0x59'));}})[_0x0bd1('0x5a')](function(_0x17b3ba,_0x4c05e7){if(_0x17b3ba){_0x32cff5=_0x4c05e7;if(!_0x4c05e7){return _0x17b3ba[_0x0bd1('0x5b')]({'inReplyTo':_0x2446d3[_0x0bd1('0x2d')]['message']['messageId'],'to':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')]['from'],'cc':_0x2446d3[_0x0bd1('0x2d')]['message']['cc'],'subject':_0x2446d3[_0x0bd1('0x2d')]['message'][_0x0bd1('0x53')],'attach':_0x17b3ba[_0x0bd1('0x5c')]?_0x17b3ba[_0x0bd1('0x5c')]:_0x2446d3[_0x0bd1('0x2d')]['message'][_0x0bd1('0x5c')],'substatus':null,'substatusAt':moment()[_0x0bd1('0x54')](_0x0bd1('0x55')),'lastMsgAt':moment()['format'](_0x0bd1('0x55')),'lastMsgDirection':'in'});}else{return _0x17b3ba;}}})[_0x0bd1('0x10')](function(_0x53d77c){_0x55415c['interaction']=_0x53d77c[_0x0bd1('0x5d')]({'plain':!![]});_0x55415c[_0x0bd1('0x5e')][_0x0bd1('0x5f')]=_0x32cff5;return db[_0x0bd1('0x57')]['create']({'body':_0x2446d3['body'][_0x0bd1('0x2d')],'MailAccountId':_0x2446d3[_0x0bd1('0x3c')]['id'],'MailInteractionId':_0x53d77c['id'],'direction':'in','ContactId':_0x55415c['contact']['id'],'messageId':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x51')],'from':_0x2446d3[_0x0bd1('0x2d')]['message']['from'],'to':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')]['to'],'cc':_0x2446d3[_0x0bd1('0x2d')]['message']['cc'],'subject':_0x2446d3['body']['message'][_0x0bd1('0x53')],'attach':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x5c')],'Attachments':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x60')],'originTo':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')][_0x0bd1('0x61')],'originCc':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')]['originCc'],'bcc':_0x2446d3[_0x0bd1('0x2d')]['message'][_0x0bd1('0x62')],'ChatWebsiteId':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')]['ChatWebsiteId']||null,'originChannel':_0x2446d3[_0x0bd1('0x2d')]['message'][_0x0bd1('0x63')]||_0x0bd1('0x64'),'ChatOfflineMessageId':_0x2446d3[_0x0bd1('0x2d')][_0x0bd1('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x0bd1('0x65')],'as':_0x0bd1('0x66')}]});})[_0x0bd1('0x10')](function(_0x459408){_0x55415c[_0x0bd1('0x18')]=_0x459408;if(!_0x55415c[_0x0bd1('0x5e')][_0x0bd1('0x67')]){return;}return db[_0x0bd1('0x68')][_0x0bd1('0x3b')]({'attributes':['id',_0x0bd1('0x69')],'where':{'id':_0x55415c[_0x0bd1('0x5e')][_0x0bd1('0x67')]}});})[_0x0bd1('0x10')](function(_0x115fdb){if(_0x115fdb){_0x55415c[_0x0bd1('0x46')][_0x0bd1('0x6a')]({'id':0x0,'priority':0x0,'app':_0x0bd1('0x6b'),'appdata':_0x115fdb['name']+','+(_0x55415c[_0x0bd1('0x3c')][_0x0bd1('0x6c')]||0xa),'interval':_0x0bd1('0x4d')});}if(!_0x55415c[_0x0bd1('0x5e')][_0x0bd1('0x6d')]){return;}return db[_0x0bd1('0x6e')][_0x0bd1('0x3b')]({'attributes':['id','name'],'where':{'id':_0x55415c['interaction'][_0x0bd1('0x6d')]}});})[_0x0bd1('0x10')](function(_0x1f8c2a){if(_0x1f8c2a){_0x55415c[_0x0bd1('0x46')]['unshift']({'id':0x0,'priority':0x1,'app':_0x0bd1('0x6f'),'appdata':_0x1f8c2a[_0x0bd1('0x69')]+','+(_0x55415c[_0x0bd1('0x3c')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0bd1('0x70'),'startRouting',_0x55415c);})[_0x0bd1('0x10')](function(_0x18cc47){_0x5fcd17(_0x18cc47);})[_0x0bd1('0x1b')](function(_0xb1361c){_0x4f00e7(_0x316c37[_0x0bd1('0x16')](0x1f4,_0xb1361c[_0x0bd1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ade4c27..312c631 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 _0x0efb=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x47a9b1,_0x1adfe7){var _0x4c06d6=function(_0xa2c51){while(--_0xa2c51){_0x47a9b1['push'](_0x47a9b1['shift']());}};_0x4c06d6(++_0x1adfe7);}(_0x0efb,0x163));var _0xb0ef=function(_0x481af3,_0x483fac){_0x481af3=_0x481af3-0x0;var _0x3354ea=_0x0efb[_0x481af3];return _0x3354ea;};'use strict';var MailAccountEvents=require(_0xb0ef('0x0'));var events=[_0xb0ef('0x1'),_0xb0ef('0x2'),_0xb0ef('0x3')];function createListener(_0x36e29f,_0x486d61){return function(_0x2c0ecb){_0x486d61[_0xb0ef('0x4')](_0x36e29f,_0x2c0ecb);};}function removeListener(_0x55c305,_0x38ad70){return function(){MailAccountEvents['removeListener'](_0x55c305,_0x38ad70);};}exports[_0xb0ef('0x5')]=function(_0x4ad968){for(var _0x13a2ac=0x0,_0x345b3a=events[_0xb0ef('0x6')];_0x13a2ac<_0x345b3a;_0x13a2ac++){var _0x2d6e4e=events[_0x13a2ac];var _0xa3f67c=createListener(_0xb0ef('0x7')+_0x2d6e4e,_0x4ad968);MailAccountEvents['on'](_0x2d6e4e,_0xa3f67c);}}; \ No newline at end of file +var _0x9464=['update','emit','removeListener','register','length','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9464,0xd7));var _0x4946=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0x9464[_0x252328];return _0xaa85b7;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x4946('0x0'),'remove',_0x4946('0x1')];function createListener(_0x310d55,_0x3758a7){return function(_0x28f641){_0x3758a7[_0x4946('0x2')](_0x310d55,_0x28f641);};}function removeListener(_0x421600,_0x474838){return function(){MailAccountEvents[_0x4946('0x3')](_0x421600,_0x474838);};}exports[_0x4946('0x4')]=function(_0x182e5b){for(var _0x39c0f6=0x0,_0x34015d=events[_0x4946('0x5')];_0x39c0f6<_0x34015d;_0x39c0f6++){var _0x55e3bd=events[_0x39c0f6];var _0x45f06b=createListener('mailAccount:'+_0x55e3bd,_0x182e5b);MailAccountEvents['on'](_0x55e3bd,_0x45f06b);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 00662e2..f0ce85b 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 _0x92c8=['/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put'];(function(_0x4f6fcc,_0xd8bd68){var _0x4b363c=function(_0x39691d){while(--_0x39691d){_0x4f6fcc['push'](_0x4f6fcc['shift']());}};_0x4b363c(++_0xd8bd68);}(_0x92c8,0x16a));var _0x892c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x92c8[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x892c('0x0'));var util=require('util');var path=require(_0x892c('0x1'));var timeout=require('connect-timeout');var express=require(_0x892c('0x2'));var router=express[_0x892c('0x3')]();var fs_extra=require(_0x892c('0x4'));var auth=require(_0x892c('0x5'));var interaction=require(_0x892c('0x6'));var config=require(_0x892c('0x7'));var controller=require(_0x892c('0x8'));router['get']('/:id',auth[_0x892c('0x9')](),controller[_0x892c('0xa')]);router[_0x892c('0xb')](_0x892c('0xc'),auth[_0x892c('0x9')](),controller[_0x892c('0xd')]);router[_0x892c('0xe')](_0x892c('0xc'),auth[_0x892c('0x9')](),controller[_0x892c('0xf')]);module[_0x892c('0x10')]=router; \ No newline at end of file +var _0xc3ba=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4c00f3,_0x343f94){var _0x5a7b6f=function(_0x2f9d8a){while(--_0x2f9d8a){_0x4c00f3['push'](_0x4c00f3['shift']());}};_0x5a7b6f(++_0x343f94);}(_0xc3ba,0x11d));var _0xac3b=function(_0x5cf534,_0x3eb673){_0x5cf534=_0x5cf534-0x0;var _0x4cc5f6=_0xc3ba[_0x5cf534];return _0x4cc5f6;};'use strict';var multer=require(_0xac3b('0x0'));var util=require('util');var path=require(_0xac3b('0x1'));var timeout=require(_0xac3b('0x2'));var express=require('express');var router=express[_0xac3b('0x3')]();var fs_extra=require(_0xac3b('0x4'));var auth=require(_0xac3b('0x5'));var interaction=require(_0xac3b('0x6'));var config=require(_0xac3b('0x7'));var controller=require(_0xac3b('0x8'));router[_0xac3b('0x9')](_0xac3b('0xa'),auth[_0xac3b('0xb')](),controller['show']);router['put'](_0xac3b('0xa'),auth['isAuthenticated'](),controller[_0xac3b('0xc')]);router[_0xac3b('0xd')]('/:id',auth[_0xac3b('0xb')](),controller[_0xac3b('0xe')]);module[_0xac3b('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ae454be..cd94ae9 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 _0xce64=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x28f731,_0x5923c9){var _0xf913ba=function(_0x36257f){while(--_0x36257f){_0x28f731['push'](_0x28f731['shift']());}};_0xf913ba(++_0x5923c9);}(_0xce64,0xa6));var _0x4ce6=function(_0x20e789,_0x56ec6f){_0x20e789=_0x20e789-0x0;var _0x2b2b0d=_0xce64[_0x20e789];return _0x2b2b0d;};'use strict';var Sequelize=require(_0x4ce6('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4ce6('0x1')],'allowNull':![],'defaultValue':_0x4ce6('0x2')},'appdata':{'type':Sequelize[_0x4ce6('0x3')]()},'description':{'type':Sequelize[_0x4ce6('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4ce6('0x4')}}; \ No newline at end of file +var _0xcdcb=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x28d973,_0x38981f){var _0x110740=function(_0x3dddb3){while(--_0x3dddb3){_0x28d973['push'](_0x28d973['shift']());}};_0x110740(++_0x38981f);}(_0xcdcb,0x1ed));var _0xbcdc=function(_0x55cd22,_0x50a96f){_0x55cd22=_0x55cd22-0x0;var _0x3c5ec8=_0xcdcb[_0x55cd22];return _0x3c5ec8;};'use strict';var Sequelize=require(_0xbcdc('0x0'));module[_0xbcdc('0x1')]={'priority':{'type':Sequelize[_0xbcdc('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbcdc('0x3')},'appdata':{'type':Sequelize[_0xbcdc('0x4')]()},'description':{'type':Sequelize[_0xbcdc('0x5')]},'interval':{'type':Sequelize[_0xbcdc('0x5')],'defaultValue':_0xbcdc('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a50f206..ff0fd8d 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 _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x1aea3a,_0x5cfb7f){var _0x1081bb=function(_0x30c1b7){while(--_0x30c1b7){_0x1aea3a['push'](_0x1aea3a['shift']());}};_0x1081bb(++_0x5cfb7f);}(_0xac4a,0x13f));var _0xaac4=function(_0x4fcb72,_0x59d1c0){_0x4fcb72=_0x4fcb72-0x0;var _0x3237cd=_0xac4a[_0x4fcb72];return _0x3237cd;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file +var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xaa88[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 17efd19..073975a 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 _0x1e45=['./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','rimraf'];(function(_0x3da1de,_0x19a7da){var _0x270d37=function(_0x59203f){while(--_0x59203f){_0x3da1de['push'](_0x3da1de['shift']());}};_0x270d37(++_0x19a7da);}(_0x1e45,0x87));var _0x51e4=function(_0x5c52bc,_0x43638d){_0x5c52bc=_0x5c52bc-0x0;var _0xa236e5=_0x1e45[_0x5c52bc];return _0xa236e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x51e4('0x0'));var moment=require(_0x51e4('0x1'));var BPromise=require(_0x51e4('0x2'));var rp=require(_0x51e4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51e4('0x4'));var config=require('../../config/environment');var attributes=require(_0x51e4('0x5'));module['exports']=function(_0x49d509,_0x55f09e){return _0x49d509[_0x51e4('0x6')](_0x51e4('0x7'),attributes,{'tableName':_0x51e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x51e4('0x9')});}; \ No newline at end of file +var _0xc184=['MailApplication','utf8mb4','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xc184,0xff));var _0x4c18=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0xc184[_0x1fb1c1];return _0x1622df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c18('0x0'))(_0x4c18('0x1'));var moment=require('moment');var BPromise=require(_0x4c18('0x2'));var rp=require(_0x4c18('0x3'));var fs=require('fs');var path=require(_0x4c18('0x4'));var rimraf=require('rimraf');var config=require(_0x4c18('0x5'));var attributes=require(_0x4c18('0x6'));module[_0x4c18('0x7')]=function(_0x4c9a32,_0x32f6b3){return _0x4c9a32[_0x4c18('0x8')](_0x4c18('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c18('0xa'),'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 d6cc4ec..1dc816e 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 _0xdba4=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','MailApplication','update','options','raw','where','attributes','limit','UpdateMailApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x512c89,_0x428f8e){var _0x487e6e=function(_0x3eb274){while(--_0x3eb274){_0x512c89['push'](_0x512c89['shift']());}};_0x487e6e(++_0x428f8e);}(_0xdba4,0x97));var _0x4dba=function(_0x191216,_0x567a85){_0x191216=_0x191216-0x0;var _0x43bf34=_0xdba4[_0x191216];return _0x43bf34;};'use strict';var _=require(_0x4dba('0x0'));var util=require(_0x4dba('0x1'));var moment=require(_0x4dba('0x2'));var BPromise=require(_0x4dba('0x3'));var rs=require(_0x4dba('0x4'));var fs=require('fs');var Redis=require(_0x4dba('0x5'));var db=require(_0x4dba('0x6'))['db'];var utils=require(_0x4dba('0x7'));var logger=require(_0x4dba('0x8'))(_0x4dba('0x9'));var config=require(_0x4dba('0xa'));var jayson=require(_0x4dba('0xb'));var client=jayson[_0x4dba('0xc')][_0x4dba('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x22ce2c,_0x3a69d6,_0x52cb99){return new BPromise(function(_0x3f867e,_0x17af93){return client['request'](_0x22ce2c,_0x52cb99)[_0x4dba('0xe')](function(_0x1375fe){logger[_0x4dba('0xf')](_0x4dba('0x10'),_0x3a69d6,_0x4dba('0x11'));logger[_0x4dba('0x12')](_0x4dba('0x13'),_0x3a69d6,_0x4dba('0x11'),JSON['stringify'](_0x1375fe));if(_0x1375fe[_0x4dba('0x14')]){if(_0x1375fe['error']['code']===0x1f4){logger['error'](_0x4dba('0x10'),_0x3a69d6,_0x1375fe['error'][_0x4dba('0x15')]);return _0x17af93(_0x1375fe['error']['message']);}logger[_0x4dba('0x14')](_0x4dba('0x10'),_0x3a69d6,_0x1375fe['error']['message']);return _0x3f867e(_0x1375fe['error'][_0x4dba('0x15')]);}else{logger[_0x4dba('0xf')](_0x4dba('0x10'),_0x3a69d6,_0x4dba('0x11'));_0x3f867e(_0x1375fe[_0x4dba('0x16')][_0x4dba('0x15')]);}})[_0x4dba('0x17')](function(_0x523a77){logger[_0x4dba('0x14')](_0x4dba('0x10'),_0x3a69d6,_0x523a77);_0x17af93(_0x523a77);});});}exports['UpdateMailApplication']=function(_0x1985a3){var _0x334db5=this;return new Promise(function(_0x42d01c,_0x468854){return db[_0x4dba('0x18')][_0x4dba('0x19')](_0x1985a3['body'],{'raw':_0x1985a3[_0x4dba('0x1a')]?_0x1985a3[_0x4dba('0x1a')][_0x4dba('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1985a3[_0x4dba('0x1a')]?_0x1985a3[_0x4dba('0x1a')][_0x4dba('0x1c')]||null:null,'attributes':_0x1985a3[_0x4dba('0x1a')]?_0x1985a3[_0x4dba('0x1a')][_0x4dba('0x1d')]||null:null,'limit':_0x1985a3[_0x4dba('0x1a')]?_0x1985a3[_0x4dba('0x1a')][_0x4dba('0x1e')]||null:null})[_0x4dba('0xe')](function(_0x17a51e){logger[_0x4dba('0xf')]('UpdateMailApplication',_0x1985a3);logger[_0x4dba('0x12')](_0x4dba('0x1f'),_0x1985a3,JSON[_0x4dba('0x20')](_0x17a51e));_0x42d01c(_0x17a51e);})['catch'](function(_0x2258ee){logger[_0x4dba('0x14')](_0x4dba('0x1f'),_0x2258ee['message'],_0x1985a3);_0x468854(_0x334db5[_0x4dba('0x14')](0x1f4,_0x2258ee['message']));});});}; \ No newline at end of file +var _0x06fb=['../../config/environment','jayson/promise','client','request','then','debug','request\x20sent','stringify','error','code','MailApplication,\x20%s,\x20%s','message','info','catch','MailApplication','update','options','raw','where','attributes','limit','UpdateMailApplication','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x06fb,0x190));var _0xb06f=function(_0x4aeb02,_0x34a282){_0x4aeb02=_0x4aeb02-0x0;var _0x39410d=_0x06fb[_0x4aeb02];return _0x39410d;};'use strict';var _=require('lodash');var util=require(_0xb06f('0x0'));var moment=require('moment');var BPromise=require(_0xb06f('0x1'));var rs=require(_0xb06f('0x2'));var fs=require('fs');var Redis=require(_0xb06f('0x3'));var db=require(_0xb06f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb06f('0x5'));var jayson=require(_0xb06f('0x6'));var client=jayson[_0xb06f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x370010,_0x12c261,_0x1971ec){return new BPromise(function(_0x486e74,_0x41f626){return client[_0xb06f('0x8')](_0x370010,_0x1971ec)[_0xb06f('0x9')](function(_0x1d20b8){logger['info']('MailApplication,\x20%s,\x20%s',_0x12c261,'request\x20sent');logger[_0xb06f('0xa')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x12c261,_0xb06f('0xb'),JSON[_0xb06f('0xc')](_0x1d20b8));if(_0x1d20b8[_0xb06f('0xd')]){if(_0x1d20b8['error'][_0xb06f('0xe')]===0x1f4){logger[_0xb06f('0xd')](_0xb06f('0xf'),_0x12c261,_0x1d20b8[_0xb06f('0xd')][_0xb06f('0x10')]);return _0x41f626(_0x1d20b8[_0xb06f('0xd')][_0xb06f('0x10')]);}logger[_0xb06f('0xd')](_0xb06f('0xf'),_0x12c261,_0x1d20b8[_0xb06f('0xd')][_0xb06f('0x10')]);return _0x486e74(_0x1d20b8[_0xb06f('0xd')][_0xb06f('0x10')]);}else{logger[_0xb06f('0x11')]('MailApplication,\x20%s,\x20%s',_0x12c261,'request\x20sent');_0x486e74(_0x1d20b8['result'][_0xb06f('0x10')]);}})[_0xb06f('0x12')](function(_0x5b3a06){logger[_0xb06f('0xd')](_0xb06f('0xf'),_0x12c261,_0x5b3a06);_0x41f626(_0x5b3a06);});});}exports['UpdateMailApplication']=function(_0x2bac5e){var _0x4e5af5=this;return new Promise(function(_0x34214b,_0x41933f){return db[_0xb06f('0x13')][_0xb06f('0x14')](_0x2bac5e['body'],{'raw':_0x2bac5e[_0xb06f('0x15')]?_0x2bac5e[_0xb06f('0x15')][_0xb06f('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bac5e[_0xb06f('0x15')]?_0x2bac5e[_0xb06f('0x15')][_0xb06f('0x17')]||null:null,'attributes':_0x2bac5e[_0xb06f('0x15')]?_0x2bac5e[_0xb06f('0x15')][_0xb06f('0x18')]||null:null,'limit':_0x2bac5e[_0xb06f('0x15')]?_0x2bac5e[_0xb06f('0x15')][_0xb06f('0x19')]||null:null})['then'](function(_0xf83f76){logger['info'](_0xb06f('0x1a'),_0x2bac5e);logger[_0xb06f('0xa')](_0xb06f('0x1a'),_0x2bac5e,JSON[_0xb06f('0xc')](_0xf83f76));_0x34214b(_0xf83f76);})[_0xb06f('0x12')](function(_0x138c62){logger[_0xb06f('0xd')](_0xb06f('0x1a'),_0x138c62[_0xb06f('0x10')],_0x2bac5e);_0x41933f(_0x4e5af5['error'](0x1f4,_0x138c62[_0xb06f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a6bcb46..c463640 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 _0xaf11=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','post','create','/:id/tags','tracked','mail','mailinteraction:update','update','delete','removeTags','exports','express','Router','../../components/auth/service'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0xaf11,0xfa));var _0x1af1=function(_0x4d7f38,_0x35bd6b){_0x4d7f38=_0x4d7f38-0x0;var _0x51b02c=_0xaf11[_0x4d7f38];return _0x51b02c;};'use strict';var express=require(_0x1af1('0x0'));var router=express[_0x1af1('0x1')]();var auth=require(_0x1af1('0x2'));var interaction=require(_0x1af1('0x3'));var controller=require('./mailInteraction.controller');router[_0x1af1('0x4')]('/',auth[_0x1af1('0x5')](),controller[_0x1af1('0x6')]);router[_0x1af1('0x4')](_0x1af1('0x7'),auth[_0x1af1('0x5')](),controller[_0x1af1('0x8')]);router[_0x1af1('0x4')](_0x1af1('0x9'),auth[_0x1af1('0x5')](),controller[_0x1af1('0xa')]);router[_0x1af1('0x4')](_0x1af1('0xb'),auth['isAuthenticated'](),controller['getMessages']);router[_0x1af1('0x4')](_0x1af1('0xc'),auth[_0x1af1('0x5')](),controller['download']);router[_0x1af1('0xd')]('/',auth[_0x1af1('0x5')](),controller[_0x1af1('0xe')]);router[_0x1af1('0xd')]('/:id/messages',auth[_0x1af1('0x5')](),controller['addMessage']);router[_0x1af1('0xd')](_0x1af1('0xf'),auth[_0x1af1('0x5')](),interaction[_0x1af1('0x10')](_0x1af1('0x11'),'mailinteraction:addtags'),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x1af1('0x10')]('mail',_0x1af1('0x12')),controller[_0x1af1('0x13')]);router[_0x1af1('0x14')](_0x1af1('0x9'),auth[_0x1af1('0x5')](),interaction[_0x1af1('0x10')](_0x1af1('0x11'),'mailinteraction:destroy'),controller['destroy']);router[_0x1af1('0x14')](_0x1af1('0xf'),auth['isAuthenticated'](),controller[_0x1af1('0x15')]);module[_0x1af1('0x16')]=router; \ No newline at end of file +var _0xd6d0=['Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','post','create','/:id/tags','tracked','mailinteraction:addtags','put','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','express'];(function(_0x35b982,_0x3b0c0e){var _0x12fdb5=function(_0x5de377){while(--_0x5de377){_0x35b982['push'](_0x35b982['shift']());}};_0x12fdb5(++_0x3b0c0e);}(_0xd6d0,0x167));var _0x0d6d=function(_0xf3a1,_0xe34e0d){_0xf3a1=_0xf3a1-0x0;var _0x5b60c3=_0xd6d0[_0xf3a1];return _0x5b60c3;};'use strict';var express=require(_0x0d6d('0x0'));var router=express[_0x0d6d('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x0d6d('0x2'));var controller=require(_0x0d6d('0x3'));router[_0x0d6d('0x4')]('/',auth[_0x0d6d('0x5')](),controller[_0x0d6d('0x6')]);router[_0x0d6d('0x4')](_0x0d6d('0x7'),auth['isAuthenticated'](),controller[_0x0d6d('0x8')]);router[_0x0d6d('0x4')](_0x0d6d('0x9'),auth[_0x0d6d('0x5')](),controller['show']);router[_0x0d6d('0x4')](_0x0d6d('0xa'),auth[_0x0d6d('0x5')](),controller[_0x0d6d('0xb')]);router[_0x0d6d('0x4')]('/:id/download',auth[_0x0d6d('0x5')](),controller['download']);router[_0x0d6d('0xc')]('/',auth[_0x0d6d('0x5')](),controller[_0x0d6d('0xd')]);router[_0x0d6d('0xc')](_0x0d6d('0xa'),auth[_0x0d6d('0x5')](),controller['addMessage']);router[_0x0d6d('0xc')](_0x0d6d('0xe'),auth[_0x0d6d('0x5')](),interaction[_0x0d6d('0xf')]('mail',_0x0d6d('0x10')),controller['addTags']);router[_0x0d6d('0x11')]('/:id',auth[_0x0d6d('0x5')](),interaction[_0x0d6d('0xf')](_0x0d6d('0x12'),_0x0d6d('0x13')),controller[_0x0d6d('0x14')]);router[_0x0d6d('0x15')](_0x0d6d('0x9'),auth[_0x0d6d('0x5')](),interaction[_0x0d6d('0xf')]('mail',_0x0d6d('0x16')),controller[_0x0d6d('0x17')]);router[_0x0d6d('0x15')](_0x0d6d('0xe'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 888693b..77b186d 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 _0x7854=['TEXT','long','out','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7854,0x18a));var _0x4785=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x7854[_0x5d860f];return _0x236490;};'use strict';var Sequelize=require(_0x4785('0x0'));var iconv=require(_0x4785('0x1'));module[_0x4785('0x2')]={'closed':{'type':Sequelize[_0x4785('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4785('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4785('0x5')]},'note':{'type':Sequelize[_0x4785('0x5')]},'inReplyTo':{'type':Sequelize[_0x4785('0x5')](0x1fe)},'to':{'type':Sequelize[_0x4785('0x5')]},'cc':{'type':Sequelize[_0x4785('0x6')](_0x4785('0x7'))},'subject':{'type':Sequelize[_0x4785('0x6')]()},'attach':{'type':Sequelize[_0x4785('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4785('0x4')]},'substatus':{'type':Sequelize[_0x4785('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4785('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4785('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4785('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4785('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4785('0x9')]}}; \ No newline at end of file +var _0x6ee9=['exports','DATE','STRING','long','BOOLEAN','ENUM','out','INTEGER','sequelize','iconv'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x6ee9,0x1ca));var _0x96ee=function(_0x2cde3d,_0x37644){_0x2cde3d=_0x2cde3d-0x0;var _0x2a7e9c=_0x6ee9[_0x2cde3d];return _0x2a7e9c;};'use strict';var Sequelize=require(_0x96ee('0x0'));var iconv=require(_0x96ee('0x1'));module[_0x96ee('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x96ee('0x3')]},'disposition':{'type':Sequelize[_0x96ee('0x4')]},'secondDisposition':{'type':Sequelize[_0x96ee('0x4')]},'thirdDisposition':{'type':Sequelize[_0x96ee('0x4')]},'note':{'type':Sequelize[_0x96ee('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x96ee('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x96ee('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x96ee('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x96ee('0x3')]},'substatus':{'type':Sequelize[_0x96ee('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x96ee('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x96ee('0x7')]('in',_0x96ee('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x96ee('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x96ee('0x7')]('in',_0x96ee('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x96ee('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x96ee('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index eb234d4..d9cc6ee 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 _0x5860=['join','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','from','bcc','subject','createdAt','Messages','get','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','eml-format','rimraf','zip-dir','bluebird','util','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','type','findAll','mail','user','model','keys','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','MailInteraction','body','params','describe','addMessage','omit','ids','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','MailInteractionId','where','map','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','rows','addTags','setTags','Tag','color','emit','mailInteractionTags:save','download','unix','root','server','files'];(function(_0x54783e,_0xe85a52){var _0x4b03f4=function(_0x4095ba){while(--_0x4095ba){_0x54783e['push'](_0x54783e['shift']());}};_0x4b03f4(++_0xe85a52);}(_0x5860,0xfb));var _0x0586=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x5860[_0x5311e8];return _0x582ad8;};'use strict';var emlformat=require(_0x0586('0x0'));var rimraf=require(_0x0586('0x1'));var zipdir=require(_0x0586('0x2'));var moment=require('moment');var BPromise=require(_0x0586('0x3'));var util=require(_0x0586('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x0586('0x5'));var juice=require('juice');var Redis=require('ioredis');var interaction=require(_0x0586('0x6'));var qs=require(_0x0586('0x7'));var logger=require(_0x0586('0x8'))(_0x0586('0x9'));var config=require(_0x0586('0xa'));var db=require(_0x0586('0xb'))['db'];var htmlEntities=require(_0x0586('0xc'));config[_0x0586('0xd')]=_[_0x0586('0xe')](config[_0x0586('0xd')],{'host':_0x0586('0xf'),'port':0x18eb});var socket=require(_0x0586('0x10'))(new Redis(config['redis']));require(_0x0586('0x11'))['register'](socket);function respondWithStatusCode(_0x5c4909,_0x1eb731){_0x1eb731=_0x1eb731||0xcc;return function(_0x285400){if(_0x285400){return _0x5c4909['sendStatus'](_0x1eb731);}return _0x5c4909[_0x0586('0x12')](_0x1eb731)['end']();};}function respondWithResult(_0x36dc2c,_0x477e3e){_0x477e3e=_0x477e3e||0xc8;return function(_0x3cb4a1){if(_0x3cb4a1){return _0x36dc2c[_0x0586('0x12')](_0x477e3e)[_0x0586('0x13')](_0x3cb4a1);}};}function respondWithFilteredResult(_0x4c893a,_0x3ff05c){return function(_0x3cde27){if(_0x3cde27){var _0x4f6360=typeof _0x3ff05c[_0x0586('0x14')]===_0x0586('0x15')&&typeof _0x3ff05c[_0x0586('0x16')]==='undefined';var _0x23060e=_0x3cde27[_0x0586('0x17')];var _0x3fa70f=_0x4f6360?0x0:_0x3ff05c['offset'];var _0x36c6d3=_0x4f6360?_0x3cde27[_0x0586('0x17')]:_0x3ff05c['offset']+_0x3ff05c[_0x0586('0x16')];var _0x591890;if(_0x36c6d3>=_0x23060e){_0x36c6d3=_0x23060e;_0x591890=0xc8;}else{_0x591890=0xce;}_0x4c893a['status'](_0x591890);return _0x4c893a[_0x0586('0x18')](_0x0586('0x19'),_0x3fa70f+'-'+_0x36c6d3+'/'+_0x23060e)[_0x0586('0x13')](_0x3cde27);}return null;};}function saveUpdates(_0x13c3b7){return function(_0x16810a){if(_0x16810a){return _0x16810a[_0x0586('0x1a')](_0x13c3b7)[_0x0586('0x1b')](function(_0x54d2f7){return _0x54d2f7;});}return null;};}function removeEntity(_0xb026b3){return function(_0x361ca9){if(_0x361ca9){return _0x361ca9[_0x0586('0x1c')]()['then'](function(){_0xb026b3[_0x0586('0x12')](0xcc)[_0x0586('0x1d')]();});}};}function handleEntityNotFound(_0xb6c29){return function(_0x41b2a1){if(!_0x41b2a1){_0xb6c29[_0x0586('0x1e')](0x194);}return _0x41b2a1;};}function handleError(_0x54c952,_0x234113){_0x234113=_0x234113||0x1f4;return function(_0x110519){logger[_0x0586('0x1f')](_0x110519[_0x0586('0x20')]);if(_0x110519['name']){delete _0x110519[_0x0586('0x21')];}_0x54c952[_0x0586('0x12')](_0x234113)[_0x0586('0x22')](_0x110519);};}exports[_0x0586('0x23')]=function(_0x3b49c0,_0x1b860c){var _0x229c79={};var _0x572187=_['map'](db['MailInteraction']['rawAttributes'],function(_0x9b66c7){return{'name':_0x9b66c7['fieldName'],'type':_0x9b66c7[_0x0586('0x24')]['key']};});_0x229c79=qs['getOptions'](_0x572187,_0x3b49c0);return interaction[_0x0586('0x25')](_0x0586('0x26'),_0x3b49c0['query'],_0x3b49c0[_0x0586('0x27')],_0x229c79,_0x572187)[_0x0586('0x1b')](respondWithFilteredResult(_0x1b860c,_0x229c79))['catch'](handleError(_0x1b860c,null));};exports['show']=function(_0x5536bc,_0x108100){var _0x2c54f6={'raw':![],'where':{'id':_0x5536bc['params']['id']}},_0x548733={};_0x548733[_0x0586('0x28')]=_[_0x0586('0x29')](db['MailInteraction']['rawAttributes']);_0x548733[_0x0586('0x2a')]=_['keys'](_0x5536bc[_0x0586('0x2a')]);_0x548733[_0x0586('0x2b')]=_['intersection'](_0x548733[_0x0586('0x28')],_0x548733[_0x0586('0x2a')]);_0x2c54f6[_0x0586('0x2c')]=_[_0x0586('0x2d')](_0x548733[_0x0586('0x28')],qs[_0x0586('0x2e')](_0x5536bc[_0x0586('0x2a')][_0x0586('0x2e')]));_0x2c54f6['attributes']=_0x2c54f6['attributes'][_0x0586('0x2f')]?_0x2c54f6[_0x0586('0x2c')]:_0x548733['model'];if(_0x5536bc[_0x0586('0x2a')][_0x0586('0x30')]){_0x2c54f6[_0x0586('0x31')]=[{'all':!![]}];}_0x2c54f6=_[_0x0586('0x32')]({},_0x2c54f6,_0x5536bc[_0x0586('0x33')]);return db['MailInteraction'][_0x0586('0x34')](_0x2c54f6)[_0x0586('0x1b')](handleEntityNotFound(_0x108100,null))[_0x0586('0x1b')](respondWithResult(_0x108100,null))[_0x0586('0x35')](handleError(_0x108100,null));};exports[_0x0586('0x36')]=function(_0x582a41,_0x23566c){return db[_0x0586('0x37')]['create'](_0x582a41[_0x0586('0x38')],{})[_0x0586('0x1b')](respondWithResult(_0x23566c,0xc9))[_0x0586('0x35')](handleError(_0x23566c,null));};exports[_0x0586('0x1a')]=function(_0x20ceed,_0x3060d0){if(_0x20ceed[_0x0586('0x38')]['id']){delete _0x20ceed['body']['id'];}return db['MailInteraction']['find']({'where':{'id':_0x20ceed['params']['id']}})[_0x0586('0x1b')](handleEntityNotFound(_0x3060d0,null))[_0x0586('0x1b')](saveUpdates(_0x20ceed[_0x0586('0x38')],null))[_0x0586('0x1b')](respondWithResult(_0x3060d0,null))[_0x0586('0x35')](handleError(_0x3060d0,null));};exports[_0x0586('0x1c')]=function(_0x1bcc9f,_0x323217){return db[_0x0586('0x37')][_0x0586('0x34')]({'where':{'id':_0x1bcc9f[_0x0586('0x39')]['id']}})[_0x0586('0x1b')](handleEntityNotFound(_0x323217,null))[_0x0586('0x1b')](removeEntity(_0x323217,null))[_0x0586('0x35')](handleError(_0x323217,null));};exports[_0x0586('0x3a')]=function(_0x596c79,_0x4571e8){return db[_0x0586('0x37')][_0x0586('0x3a')]()['then'](respondWithResult(_0x4571e8,null))[_0x0586('0x35')](handleError(_0x4571e8,null));};exports[_0x0586('0x3b')]=function(_0x300a33,_0x3ba3e9){return db['MailMessage']['find']({'where':{'id':_0x300a33[_0x0586('0x39')]['id']}})[_0x0586('0x1b')](handleEntityNotFound(_0x3ba3e9,null))[_0x0586('0x1b')](function(_0x826d18){if(_0x826d18){return _0x826d18[_0x0586('0x3b')](_0x300a33[_0x0586('0x38')]['ids'],_[_0x0586('0x3c')](_0x300a33[_0x0586('0x38')],[_0x0586('0x3d'),'id'])||{});}})[_0x0586('0x1b')](respondWithResult(_0x3ba3e9,null))['catch'](handleError(_0x3ba3e9,null));};exports['getMessages']=function(_0x29a1c5,_0x5b84a4){var _0x2ab7c7={'raw':![],'where':{}};var _0xef8d18={};var _0x3bee5c={'count':0x0,'rows':[]};return db[_0x0586('0x37')][_0x0586('0x3e')]({'where':{'id':_0x29a1c5['params']['id']}})[_0x0586('0x1b')](handleEntityNotFound(_0x5b84a4,null))[_0x0586('0x1b')](function(_0x51c1fa){if(_0x51c1fa){_0xef8d18[_0x0586('0x28')]=_[_0x0586('0x29')](db['MailMessage'][_0x0586('0x3f')]);_0xef8d18[_0x0586('0x2a')]=_[_0x0586('0x29')](_0x29a1c5[_0x0586('0x2a')]);_0xef8d18[_0x0586('0x2b')]=_[_0x0586('0x2d')](_0xef8d18[_0x0586('0x28')],_0xef8d18['query']);_0x2ab7c7[_0x0586('0x2c')]=_['intersection'](_0xef8d18['model'],qs['fields'](_0x29a1c5['query'][_0x0586('0x2e')]));_0x2ab7c7[_0x0586('0x2c')]=_0x2ab7c7[_0x0586('0x2c')][_0x0586('0x2f')]?_0x2ab7c7[_0x0586('0x2c')]:_0xef8d18['model'];if(!_0x29a1c5[_0x0586('0x2a')][_0x0586('0x40')](_0x0586('0x41'))){_0x2ab7c7[_0x0586('0x16')]=qs['limit'](_0x29a1c5[_0x0586('0x2a')]['limit']);_0x2ab7c7[_0x0586('0x14')]=qs[_0x0586('0x14')](_0x29a1c5[_0x0586('0x2a')][_0x0586('0x14')]);}_0x2ab7c7[_0x0586('0x42')]=qs[_0x0586('0x43')](_0x29a1c5[_0x0586('0x2a')]['sort']);_0x2ab7c7['where']=qs[_0x0586('0x2b')](_[_0x0586('0x44')](_0x29a1c5[_0x0586('0x2a')],_0xef8d18[_0x0586('0x2b')]));_0x2ab7c7['where'][_0x0586('0x45')]=_0x51c1fa['id'];if(_0x29a1c5['query']['filter']){_0x2ab7c7['where']=_['merge'](_0x2ab7c7[_0x0586('0x46')],{'$or':_[_0x0586('0x47')](_0x2ab7c7[_0x0586('0x2c')],function(_0x3f7ff5){var _0x4a2b82={};_0x4a2b82[_0x3f7ff5]={'$like':'%'+_0x29a1c5[_0x0586('0x2a')][_0x0586('0x48')]+'%'};return _0x4a2b82;})});}if(_0x29a1c5[_0x0586('0x2a')][_0x0586('0x49')]){var _0x5ea9bc=_0x29a1c5[_0x0586('0x2a')][_0x0586('0x49')]['split'](',');var _0x4f5d80={};_0x4f5d80[_0x5ea9bc[0x0]]={'$gte':moment(_0x5ea9bc[0x1])[_0x0586('0x4a')](_0x0586('0x4b'))};_0x2ab7c7[_0x0586('0x46')]=_[_0x0586('0x32')](_0x2ab7c7[_0x0586('0x46')],_0x4f5d80);}_0x2ab7c7=_[_0x0586('0x32')]({},_0x2ab7c7,_0x29a1c5[_0x0586('0x33')]);return db[_0x0586('0x4c')]['count']({'where':_0x2ab7c7[_0x0586('0x46')]})[_0x0586('0x1b')](function(_0x317995){_0x3bee5c[_0x0586('0x17')]=_0x317995;if(_0x29a1c5[_0x0586('0x2a')][_0x0586('0x30')]){_0x2ab7c7[_0x0586('0x31')]=[{'all':!![]}];}return db[_0x0586('0x4c')][_0x0586('0x25')](_0x2ab7c7);})[_0x0586('0x1b')](function(_0x337709){if(_0x29a1c5[_0x0586('0x2a')][_0x0586('0x4d')]===_0x0586('0x4e')){for(var _0x432b7b=0x0;_0x432b7b<_0x337709['length'];_0x432b7b++){_0x337709[_0x432b7b][_0x0586('0x38')]=juice(_0x337709[_0x432b7b]['body']);}}_0x3bee5c[_0x0586('0x4f')]=_0x337709;return _0x3bee5c;});}})['then'](respondWithFilteredResult(_0x5b84a4,_0x2ab7c7))[_0x0586('0x35')](handleError(_0x5b84a4,null));};exports[_0x0586('0x50')]=function(_0x201dba,_0x23382b){return db[_0x0586('0x37')]['find']({'where':{'id':_0x201dba['params']['id']}})[_0x0586('0x1b')](handleEntityNotFound(_0x23382b,null))[_0x0586('0x1b')](function(_0x17416c){if(_0x17416c){return _0x17416c[_0x0586('0x51')](_0x201dba[_0x0586('0x38')][_0x0586('0x3d')],_[_0x0586('0x3c')](_0x201dba['body'],[_0x0586('0x3d'),'id'])||{})['spread'](function(){return db[_0x0586('0x52')][_0x0586('0x25')]({'attributes':['id',_0x0586('0x21'),_0x0586('0x53')],'where':{'id':_0x201dba[_0x0586('0x38')][_0x0586('0x3d')]}});})[_0x0586('0x1b')](function(_0x3fe591){socket[_0x0586('0x54')](_0x0586('0x55'),{'id':Number(_0x201dba[_0x0586('0x39')]['id']),'tags':_0x3fe591||[]});return{'id':Number(_0x201dba[_0x0586('0x39')]['id']),'tags':_0x3fe591||[]};});}})[_0x0586('0x1b')](respondWithResult(_0x23382b,null))[_0x0586('0x35')](handleError(_0x23382b,null));};exports['removeTags']=function(_0x492868,_0x49ebd1){return db[_0x0586('0x37')][_0x0586('0x34')]({'where':{'id':_0x492868[_0x0586('0x39')]['id']}})[_0x0586('0x1b')](handleEntityNotFound(_0x49ebd1,null))[_0x0586('0x1b')](function(_0xd4bb17){if(_0xd4bb17){return _0xd4bb17['removeTags'](_0x492868['query']['ids']);}})[_0x0586('0x1b')](respondWithStatusCode(_0x49ebd1,null))['catch'](handleError(_0x49ebd1,null));};exports[_0x0586('0x56')]=function(_0x391303,_0x14888d){var _0x18eb66=moment()[_0x0586('0x57')]()['toString']();var _0x3ee627=path['join'](config[_0x0586('0x58')],_0x0586('0x59'),_0x0586('0x5a'),'tmp');var _0x5756f3=path[_0x0586('0x5b')](config[_0x0586('0x58')],_0x0586('0x59'),_0x0586('0x5a'),_0x0586('0x5c'));var _0x5f08b5=path[_0x0586('0x5b')](_0x3ee627,_0x18eb66);var _0x5b3c65=util[_0x0586('0x4a')](_0x0586('0x5d'),_0x391303['params']['id'],_0x18eb66);var _0x36b769=path[_0x0586('0x5b')](_0x3ee627,_0x5b3c65);var _0x1fde4f=[];if(_0x391303['query'][_0x0586('0x5c')]){_0x1fde4f[_0x0586('0x5e')]({'model':db[_0x0586('0x5f')],'as':_0x0586('0x60'),'raw':!![]});}var _0x4db875=[{'model':db[_0x0586('0x4c')],'as':'Messages','attributes':['id',_0x0586('0x38'),_0x0586('0x61'),'to','cc',_0x0586('0x62'),_0x0586('0x63'),_0x0586('0x64')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x1fde4f}];return db[_0x0586('0x37')]['find']({'where':{'id':_0x391303['params']['id']},'include':_0x4db875})['then'](handleEntityNotFound(_0x14888d,null))['then'](function(_0x500a64){if(_0x500a64&&_0x500a64[_0x0586('0x65')]){var _0x2d51db=_0x500a64[_0x0586('0x66')]({'plain':!![]});fs[_0x0586('0x67')](_0x5f08b5);return BPromise[_0x0586('0x68')](_0x2d51db[_0x0586('0x65')],function(_0xe003a6,_0x4f8397){var _0x39e9af={'from':_0xe003a6[_0x0586('0x61')],'to':_0xe003a6['to']||_0x0586('0x69'),'subject':_0xe003a6[_0x0586('0x63')],'html':htmlEntities[_0x0586('0x6a')](_0xe003a6['body']),'headers':{'Date':moment(_0xe003a6['createdAt'])['format'](_0x0586('0x6b'))},'attachments':[]};if(_0xe003a6['cc']){_0x39e9af[_0x0586('0x6c')]['Cc']=_0xe003a6['cc'];}if(_0xe003a6[_0x0586('0x62')]){_0x39e9af[_0x0586('0x6c')][_0x0586('0x6d')]=_0xe003a6[_0x0586('0x62')];}return new BPromise(function(_0x82a62e,_0x117100){if(_0xe003a6[_0x0586('0x60')]){for(var _0x34511b=0x0;_0x34511b<_0xe003a6[_0x0586('0x60')][_0x0586('0x2f')];_0x34511b++){var _0x2e7744=_0xe003a6[_0x0586('0x60')][_0x34511b];var _0x43c612=path[_0x0586('0x5b')](_0x5756f3,_0x2e7744[_0x0586('0x6e')]);if(fs[_0x0586('0x6f')](_0x43c612)){_0x39e9af[_0x0586('0x5c')][_0x0586('0x5e')]({'name':_0x2e7744[_0x0586('0x21')],'contentType':_0x2e7744['type'],'data':fs['readFileSync'](_0x43c612)});}}}emlformat[_0x0586('0x70')](_0x39e9af,function(_0xae076c,_0x4a5b97){if(_0xae076c)return _0x117100(_0xae076c);fs[_0x0586('0x71')](path[_0x0586('0x5b')](_0x5f08b5,util[_0x0586('0x4a')]('message%d.eml',_0x4f8397)),_0x4a5b97);return _0x82a62e(_0x4a5b97);});});})[_0x0586('0x1b')](function(){return new BPromise(function(_0x104ac2,_0x4f30a9){zipdir(_0x5f08b5,{'saveTo':_0x36b769},function(_0x1973c8,_0x231bbb){if(_0x1973c8)return _0x4f30a9(_0x1973c8);return _0x104ac2(_0x231bbb);});})[_0x0586('0x1b')](function(){return new BPromise(function(_0xf132d9,_0x329f52){rimraf(_0x5f08b5,function(_0x23b49b){if(_0x23b49b)_0x329f52(_0x23b49b);return _0xf132d9();});});})['then'](function(){return _0x14888d[_0x0586('0x56')](_0x36b769,_0x5b3c65,function(_0x2a4f54){if(!_0x2a4f54)fs['unlinkSync'](_0x36b769);});});});}else{return _0x14888d[_0x0586('0x1e')](0xc8);}})['catch'](handleError(_0x14888d,null));}; \ No newline at end of file +var _0x3d1e=['api','../../config/environment','../../mysqldb','html-entities','redis','localhost','./mailInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','set','update','destroy','then','error','stack','name','index','map','MailInteraction','rawAttributes','fieldName','type','getOptions','findAll','mail','catch','show','params','model','keys','intersection','query','attributes','fields','length','includeAll','merge','options','create','body','find','describe','addMessage','MailMessage','ids','omit','findOne','filters','nolimit','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','include','inlineCss','true','rows','addTags','spread','Tag','color','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Messages','subject','createdAt','get','mkdirSync','each','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','Attachments','basename','existsSync','readFileSync','writeFileSync','eml-format','rimraf','moment','bluebird','util','path','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3d1e,0x65));var _0xe3d1=function(_0x450366,_0x2f02b0){_0x450366=_0x450366-0x0;var _0x1b6a3b=_0x3d1e[_0x450366];return _0x1b6a3b;};'use strict';var emlformat=require(_0xe3d1('0x0'));var rimraf=require(_0xe3d1('0x1'));var zipdir=require('zip-dir');var moment=require(_0xe3d1('0x2'));var BPromise=require(_0xe3d1('0x3'));var util=require(_0xe3d1('0x4'));var path=require(_0xe3d1('0x5'));var fs=require('fs');var _=require(_0xe3d1('0x6'));var juice=require(_0xe3d1('0x7'));var Redis=require('ioredis');var interaction=require(_0xe3d1('0x8'));var qs=require(_0xe3d1('0x9'));var logger=require(_0xe3d1('0xa'))(_0xe3d1('0xb'));var config=require(_0xe3d1('0xc'));var db=require(_0xe3d1('0xd'))['db'];var htmlEntities=require(_0xe3d1('0xe'));config[_0xe3d1('0xf')]=_['defaults'](config[_0xe3d1('0xf')],{'host':_0xe3d1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3d1('0xf')]));require(_0xe3d1('0x11'))['register'](socket);function respondWithStatusCode(_0x189bce,_0x55058d){_0x55058d=_0x55058d||0xcc;return function(_0x3897b8){if(_0x3897b8){return _0x189bce[_0xe3d1('0x12')](_0x55058d);}return _0x189bce[_0xe3d1('0x13')](_0x55058d)[_0xe3d1('0x14')]();};}function respondWithResult(_0xc64c56,_0x5082f7){_0x5082f7=_0x5082f7||0xc8;return function(_0x14f0e2){if(_0x14f0e2){return _0xc64c56['status'](_0x5082f7)[_0xe3d1('0x15')](_0x14f0e2);}};}function respondWithFilteredResult(_0x38dee5,_0xc28a4f){return function(_0x34ee2c){if(_0x34ee2c){var _0x53d6e3=typeof _0xc28a4f[_0xe3d1('0x16')]===_0xe3d1('0x17')&&typeof _0xc28a4f[_0xe3d1('0x18')]===_0xe3d1('0x17');var _0x3ca3fe=_0x34ee2c['count'];var _0x5359ad=_0x53d6e3?0x0:_0xc28a4f['offset'];var _0x2b9e35=_0x53d6e3?_0x34ee2c['count']:_0xc28a4f[_0xe3d1('0x16')]+_0xc28a4f[_0xe3d1('0x18')];var _0x403877;if(_0x2b9e35>=_0x3ca3fe){_0x2b9e35=_0x3ca3fe;_0x403877=0xc8;}else{_0x403877=0xce;}_0x38dee5[_0xe3d1('0x13')](_0x403877);return _0x38dee5[_0xe3d1('0x19')]('Content-Range',_0x5359ad+'-'+_0x2b9e35+'/'+_0x3ca3fe)['json'](_0x34ee2c);}return null;};}function saveUpdates(_0x2a78d5){return function(_0x395a97){if(_0x395a97){return _0x395a97[_0xe3d1('0x1a')](_0x2a78d5)['then'](function(_0x35173b){return _0x35173b;});}return null;};}function removeEntity(_0x34f0b3){return function(_0x12438b){if(_0x12438b){return _0x12438b[_0xe3d1('0x1b')]()[_0xe3d1('0x1c')](function(){_0x34f0b3[_0xe3d1('0x13')](0xcc)[_0xe3d1('0x14')]();});}};}function handleEntityNotFound(_0x43c8f3){return function(_0xd193f7){if(!_0xd193f7){_0x43c8f3[_0xe3d1('0x12')](0x194);}return _0xd193f7;};}function handleError(_0xc80f2b,_0x5853ae){_0x5853ae=_0x5853ae||0x1f4;return function(_0x71d01d){logger[_0xe3d1('0x1d')](_0x71d01d[_0xe3d1('0x1e')]);if(_0x71d01d[_0xe3d1('0x1f')]){delete _0x71d01d[_0xe3d1('0x1f')];}_0xc80f2b[_0xe3d1('0x13')](_0x5853ae)['send'](_0x71d01d);};}exports[_0xe3d1('0x20')]=function(_0x5ebc11,_0x9010c3){var _0x8ec1d5={};var _0x334d6a=_[_0xe3d1('0x21')](db[_0xe3d1('0x22')][_0xe3d1('0x23')],function(_0x26c4a0){return{'name':_0x26c4a0[_0xe3d1('0x24')],'type':_0x26c4a0[_0xe3d1('0x25')]['key']};});_0x8ec1d5=qs[_0xe3d1('0x26')](_0x334d6a,_0x5ebc11);return interaction[_0xe3d1('0x27')](_0xe3d1('0x28'),_0x5ebc11['query'],_0x5ebc11['user'],_0x8ec1d5,_0x334d6a)[_0xe3d1('0x1c')](respondWithFilteredResult(_0x9010c3,_0x8ec1d5))[_0xe3d1('0x29')](handleError(_0x9010c3,null));};exports[_0xe3d1('0x2a')]=function(_0x240c5d,_0x34d172){var _0x22736d={'raw':![],'where':{'id':_0x240c5d[_0xe3d1('0x2b')]['id']}},_0x19f7a8={};_0x19f7a8[_0xe3d1('0x2c')]=_[_0xe3d1('0x2d')](db[_0xe3d1('0x22')][_0xe3d1('0x23')]);_0x19f7a8['query']=_[_0xe3d1('0x2d')](_0x240c5d['query']);_0x19f7a8['filters']=_[_0xe3d1('0x2e')](_0x19f7a8[_0xe3d1('0x2c')],_0x19f7a8[_0xe3d1('0x2f')]);_0x22736d[_0xe3d1('0x30')]=_[_0xe3d1('0x2e')](_0x19f7a8['model'],qs['fields'](_0x240c5d[_0xe3d1('0x2f')][_0xe3d1('0x31')]));_0x22736d[_0xe3d1('0x30')]=_0x22736d[_0xe3d1('0x30')][_0xe3d1('0x32')]?_0x22736d['attributes']:_0x19f7a8[_0xe3d1('0x2c')];if(_0x240c5d['query'][_0xe3d1('0x33')]){_0x22736d['include']=[{'all':!![]}];}_0x22736d=_[_0xe3d1('0x34')]({},_0x22736d,_0x240c5d[_0xe3d1('0x35')]);return db[_0xe3d1('0x22')]['find'](_0x22736d)['then'](handleEntityNotFound(_0x34d172,null))[_0xe3d1('0x1c')](respondWithResult(_0x34d172,null))[_0xe3d1('0x29')](handleError(_0x34d172,null));};exports['create']=function(_0x19cd5e,_0x4afbe3){return db[_0xe3d1('0x22')][_0xe3d1('0x36')](_0x19cd5e[_0xe3d1('0x37')],{})[_0xe3d1('0x1c')](respondWithResult(_0x4afbe3,0xc9))[_0xe3d1('0x29')](handleError(_0x4afbe3,null));};exports[_0xe3d1('0x1a')]=function(_0x5d72f4,_0x3bdb03){if(_0x5d72f4['body']['id']){delete _0x5d72f4[_0xe3d1('0x37')]['id'];}return db[_0xe3d1('0x22')][_0xe3d1('0x38')]({'where':{'id':_0x5d72f4[_0xe3d1('0x2b')]['id']}})[_0xe3d1('0x1c')](handleEntityNotFound(_0x3bdb03,null))[_0xe3d1('0x1c')](saveUpdates(_0x5d72f4[_0xe3d1('0x37')],null))[_0xe3d1('0x1c')](respondWithResult(_0x3bdb03,null))[_0xe3d1('0x29')](handleError(_0x3bdb03,null));};exports['destroy']=function(_0x12ed86,_0x2eb4fb){return db[_0xe3d1('0x22')][_0xe3d1('0x38')]({'where':{'id':_0x12ed86[_0xe3d1('0x2b')]['id']}})[_0xe3d1('0x1c')](handleEntityNotFound(_0x2eb4fb,null))[_0xe3d1('0x1c')](removeEntity(_0x2eb4fb,null))['catch'](handleError(_0x2eb4fb,null));};exports[_0xe3d1('0x39')]=function(_0x51e22a,_0x4f551b){return db['MailInteraction'][_0xe3d1('0x39')]()['then'](respondWithResult(_0x4f551b,null))['catch'](handleError(_0x4f551b,null));};exports[_0xe3d1('0x3a')]=function(_0x513159,_0x144af0){return db[_0xe3d1('0x3b')][_0xe3d1('0x38')]({'where':{'id':_0x513159[_0xe3d1('0x2b')]['id']}})[_0xe3d1('0x1c')](handleEntityNotFound(_0x144af0,null))[_0xe3d1('0x1c')](function(_0x5cb25f){if(_0x5cb25f){return _0x5cb25f[_0xe3d1('0x3a')](_0x513159['body'][_0xe3d1('0x3c')],_[_0xe3d1('0x3d')](_0x513159[_0xe3d1('0x37')],[_0xe3d1('0x3c'),'id'])||{});}})[_0xe3d1('0x1c')](respondWithResult(_0x144af0,null))[_0xe3d1('0x29')](handleError(_0x144af0,null));};exports['getMessages']=function(_0x5da46a,_0x5a9fac){var _0x1fd1ef={'raw':![],'where':{}};var _0x2f3780={};var _0x1ef1c7={'count':0x0,'rows':[]};return db[_0xe3d1('0x22')][_0xe3d1('0x3e')]({'where':{'id':_0x5da46a[_0xe3d1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5a9fac,null))[_0xe3d1('0x1c')](function(_0x530746){if(_0x530746){_0x2f3780[_0xe3d1('0x2c')]=_[_0xe3d1('0x2d')](db[_0xe3d1('0x3b')][_0xe3d1('0x23')]);_0x2f3780[_0xe3d1('0x2f')]=_['keys'](_0x5da46a[_0xe3d1('0x2f')]);_0x2f3780[_0xe3d1('0x3f')]=_['intersection'](_0x2f3780[_0xe3d1('0x2c')],_0x2f3780[_0xe3d1('0x2f')]);_0x1fd1ef['attributes']=_[_0xe3d1('0x2e')](_0x2f3780[_0xe3d1('0x2c')],qs['fields'](_0x5da46a[_0xe3d1('0x2f')]['fields']));_0x1fd1ef[_0xe3d1('0x30')]=_0x1fd1ef[_0xe3d1('0x30')][_0xe3d1('0x32')]?_0x1fd1ef['attributes']:_0x2f3780[_0xe3d1('0x2c')];if(!_0x5da46a[_0xe3d1('0x2f')]['hasOwnProperty'](_0xe3d1('0x40'))){_0x1fd1ef[_0xe3d1('0x18')]=qs['limit'](_0x5da46a['query'][_0xe3d1('0x18')]);_0x1fd1ef[_0xe3d1('0x16')]=qs[_0xe3d1('0x16')](_0x5da46a[_0xe3d1('0x2f')][_0xe3d1('0x16')]);}_0x1fd1ef['order']=qs[_0xe3d1('0x41')](_0x5da46a[_0xe3d1('0x2f')]['sort']);_0x1fd1ef[_0xe3d1('0x42')]=qs['filters'](_[_0xe3d1('0x43')](_0x5da46a[_0xe3d1('0x2f')],_0x2f3780[_0xe3d1('0x3f')]));_0x1fd1ef[_0xe3d1('0x42')]['MailInteractionId']=_0x530746['id'];if(_0x5da46a['query'][_0xe3d1('0x44')]){_0x1fd1ef[_0xe3d1('0x42')]=_['merge'](_0x1fd1ef[_0xe3d1('0x42')],{'$or':_[_0xe3d1('0x21')](_0x1fd1ef[_0xe3d1('0x30')],function(_0x19e8d1){var _0x33960e={};_0x33960e[_0x19e8d1]={'$like':'%'+_0x5da46a[_0xe3d1('0x2f')]['filter']+'%'};return _0x33960e;})});}if(_0x5da46a['query'][_0xe3d1('0x45')]){var _0x5b8079=_0x5da46a[_0xe3d1('0x2f')]['$gte'][_0xe3d1('0x46')](',');var _0x398867={};_0x398867[_0x5b8079[0x0]]={'$gte':moment(_0x5b8079[0x1])[_0xe3d1('0x47')](_0xe3d1('0x48'))};_0x1fd1ef['where']=_[_0xe3d1('0x34')](_0x1fd1ef[_0xe3d1('0x42')],_0x398867);}_0x1fd1ef=_[_0xe3d1('0x34')]({},_0x1fd1ef,_0x5da46a['options']);return db['MailMessage'][_0xe3d1('0x49')]({'where':_0x1fd1ef['where']})['then'](function(_0x34475a){_0x1ef1c7[_0xe3d1('0x49')]=_0x34475a;if(_0x5da46a[_0xe3d1('0x2f')][_0xe3d1('0x33')]){_0x1fd1ef[_0xe3d1('0x4a')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x1fd1ef);})['then'](function(_0x2bb7a6){if(_0x5da46a[_0xe3d1('0x2f')][_0xe3d1('0x4b')]===_0xe3d1('0x4c')){for(var _0x57fa2a=0x0;_0x57fa2a<_0x2bb7a6[_0xe3d1('0x32')];_0x57fa2a++){_0x2bb7a6[_0x57fa2a][_0xe3d1('0x37')]=juice(_0x2bb7a6[_0x57fa2a][_0xe3d1('0x37')]);}}_0x1ef1c7[_0xe3d1('0x4d')]=_0x2bb7a6;return _0x1ef1c7;});}})[_0xe3d1('0x1c')](respondWithFilteredResult(_0x5a9fac,_0x1fd1ef))[_0xe3d1('0x29')](handleError(_0x5a9fac,null));};exports[_0xe3d1('0x4e')]=function(_0x512a8a,_0x27630c){return db[_0xe3d1('0x22')][_0xe3d1('0x38')]({'where':{'id':_0x512a8a[_0xe3d1('0x2b')]['id']}})[_0xe3d1('0x1c')](handleEntityNotFound(_0x27630c,null))['then'](function(_0x1c49e2){if(_0x1c49e2){return _0x1c49e2['setTags'](_0x512a8a[_0xe3d1('0x37')][_0xe3d1('0x3c')],_[_0xe3d1('0x3d')](_0x512a8a[_0xe3d1('0x37')],['ids','id'])||{})[_0xe3d1('0x4f')](function(){return db[_0xe3d1('0x50')][_0xe3d1('0x27')]({'attributes':['id',_0xe3d1('0x1f'),_0xe3d1('0x51')],'where':{'id':_0x512a8a[_0xe3d1('0x37')]['ids']}});})['then'](function(_0x262d3b){socket['emit'](_0xe3d1('0x52'),{'id':Number(_0x512a8a[_0xe3d1('0x2b')]['id']),'tags':_0x262d3b||[]});return{'id':Number(_0x512a8a[_0xe3d1('0x2b')]['id']),'tags':_0x262d3b||[]};});}})['then'](respondWithResult(_0x27630c,null))[_0xe3d1('0x29')](handleError(_0x27630c,null));};exports[_0xe3d1('0x53')]=function(_0x5dc2f2,_0x3bcbf8){return db[_0xe3d1('0x22')][_0xe3d1('0x38')]({'where':{'id':_0x5dc2f2[_0xe3d1('0x2b')]['id']}})[_0xe3d1('0x1c')](handleEntityNotFound(_0x3bcbf8,null))[_0xe3d1('0x1c')](function(_0x36b4ac){if(_0x36b4ac){return _0x36b4ac[_0xe3d1('0x53')](_0x5dc2f2[_0xe3d1('0x2f')][_0xe3d1('0x3c')]);}})[_0xe3d1('0x1c')](respondWithStatusCode(_0x3bcbf8,null))[_0xe3d1('0x29')](handleError(_0x3bcbf8,null));};exports[_0xe3d1('0x54')]=function(_0x3ec002,_0x479ffd){var _0x390d81=moment()[_0xe3d1('0x55')]()[_0xe3d1('0x56')]();var _0x1f3f2e=path[_0xe3d1('0x57')](config[_0xe3d1('0x58')],_0xe3d1('0x59'),_0xe3d1('0x5a'),_0xe3d1('0x5b'));var _0xb9f289=path[_0xe3d1('0x57')](config[_0xe3d1('0x58')],_0xe3d1('0x59'),_0xe3d1('0x5a'),_0xe3d1('0x5c'));var _0x27e4a3=path['join'](_0x1f3f2e,_0x390d81);var _0x47b915=util[_0xe3d1('0x47')](_0xe3d1('0x5d'),_0x3ec002[_0xe3d1('0x2b')]['id'],_0x390d81);var _0x4f262e=path[_0xe3d1('0x57')](_0x1f3f2e,_0x47b915);var _0x5f3799=[];if(_0x3ec002['query'][_0xe3d1('0x5c')]){_0x5f3799[_0xe3d1('0x5e')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x3b2a47=[{'model':db['MailMessage'],'as':_0xe3d1('0x5f'),'attributes':['id',_0xe3d1('0x37'),'from','to','cc','bcc',_0xe3d1('0x60'),_0xe3d1('0x61')],'where':{'secret':![]},'order':qs[_0xe3d1('0x41')]('id'),'include':_0x5f3799}];return db['MailInteraction'][_0xe3d1('0x38')]({'where':{'id':_0x3ec002['params']['id']},'include':_0x3b2a47})[_0xe3d1('0x1c')](handleEntityNotFound(_0x479ffd,null))['then'](function(_0x457789){if(_0x457789&&_0x457789['Messages']){var _0x51f618=_0x457789[_0xe3d1('0x62')]({'plain':!![]});fs[_0xe3d1('0x63')](_0x27e4a3);return BPromise[_0xe3d1('0x64')](_0x51f618[_0xe3d1('0x5f')],function(_0x3f985a,_0x2f960c){var _0x4c4ee2={'from':_0x3f985a[_0xe3d1('0x65')],'to':_0x3f985a['to']||'missing.recipient@your.company.com','subject':_0x3f985a[_0xe3d1('0x60')],'html':htmlEntities[_0xe3d1('0x66')](_0x3f985a[_0xe3d1('0x37')]),'headers':{'Date':moment(_0x3f985a[_0xe3d1('0x61')])['format'](_0xe3d1('0x67'))},'attachments':[]};if(_0x3f985a['cc']){_0x4c4ee2['headers']['Cc']=_0x3f985a['cc'];}if(_0x3f985a[_0xe3d1('0x68')]){_0x4c4ee2[_0xe3d1('0x69')][_0xe3d1('0x6a')]=_0x3f985a[_0xe3d1('0x68')];}return new BPromise(function(_0x43bee2,_0x1bfa7a){if(_0x3f985a[_0xe3d1('0x6b')]){for(var _0x1284bb=0x0;_0x1284bb<_0x3f985a[_0xe3d1('0x6b')][_0xe3d1('0x32')];_0x1284bb++){var _0x420c04=_0x3f985a['Attachments'][_0x1284bb];var _0x112dfd=path[_0xe3d1('0x57')](_0xb9f289,_0x420c04[_0xe3d1('0x6c')]);if(fs[_0xe3d1('0x6d')](_0x112dfd)){_0x4c4ee2['attachments'][_0xe3d1('0x5e')]({'name':_0x420c04[_0xe3d1('0x1f')],'contentType':_0x420c04[_0xe3d1('0x25')],'data':fs[_0xe3d1('0x6e')](_0x112dfd)});}}}emlformat['build'](_0x4c4ee2,function(_0x23f047,_0x172881){if(_0x23f047)return _0x1bfa7a(_0x23f047);fs[_0xe3d1('0x6f')](path['join'](_0x27e4a3,util['format']('message%d.eml',_0x2f960c)),_0x172881);return _0x43bee2(_0x172881);});});})[_0xe3d1('0x1c')](function(){return new BPromise(function(_0x32b906,_0x5ce2d7){zipdir(_0x27e4a3,{'saveTo':_0x4f262e},function(_0x366377,_0x328211){if(_0x366377)return _0x5ce2d7(_0x366377);return _0x32b906(_0x328211);});})[_0xe3d1('0x1c')](function(){return new BPromise(function(_0x1f864e,_0x1d2641){rimraf(_0x27e4a3,function(_0xaf262c){if(_0xaf262c)_0x1d2641(_0xaf262c);return _0x1f864e();});});})[_0xe3d1('0x1c')](function(){return _0x479ffd[_0xe3d1('0x54')](_0x4f262e,_0x47b915,function(_0x3bfe42){if(!_0x3bfe42)fs['unlinkSync'](_0x4f262e);});});});}else{return _0x479ffd[_0xe3d1('0x12')](0xc8);}})['catch'](handleError(_0x479ffd,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a12be1b..499b768 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 _0x7183=['map','findAll','setDataValue','unreadMessages','length','emit','catch','exports','MailInteraction','setMaxListeners','save','update','remove','getUsers','then','Users'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7183,0x198));var _0x3718=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7183[_0x25e7cb];return _0x375d92;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x3718('0x0')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3718('0x1')](0x0);var events={'afterCreate':_0x3718('0x2'),'afterUpdate':_0x3718('0x3'),'afterDestroy':_0x3718('0x4')};function emitEvent(_0x1b3ca5){return function(_0x29ca63,_0x57f66f,_0x52d937){_0x29ca63[_0x3718('0x5')]({'attributes':['id'],'raw':!![]})[_0x3718('0x6')](function(_0x8c0ee5){_0x29ca63['setDataValue'](_0x3718('0x7'),_0x8c0ee5[_0x3718('0x8')](function(_0x2e117b){return{'id':_0x2e117b['id']};}));return MailMessage[_0x3718('0x9')]({'where':{'MailInteractionId':_0x29ca63['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3718('0x6')](function(_0xa749de){_0x29ca63[_0x3718('0xa')](_0x3718('0xb'),_0xa749de[_0x3718('0xc')]);MailInteractionEvents[_0x3718('0xd')](_0x1b3ca5+':'+_0x29ca63['id'],_0x29ca63);MailInteractionEvents[_0x3718('0xd')](_0x1b3ca5,_0x29ca63);_0x52d937(null);})[_0x3718('0xe')](_0x52d937(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x3718('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xc756=['map','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','getUsers','Users'];(function(_0x4de727,_0xddd42e){var _0x353383=function(_0x115446){while(--_0x115446){_0x4de727['push'](_0x4de727['shift']());}};_0x353383(++_0xddd42e);}(_0xc756,0x14f));var _0x6c75=function(_0x1fbe66,_0x601c47){_0x1fbe66=_0x1fbe66-0x0;var _0x444544=_0xc756[_0x1fbe66];return _0x444544;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x6c75('0x0')];var MailMessage=require(_0x6c75('0x1'))['db'][_0x6c75('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6c75('0x3')](0x0);var events={'afterCreate':_0x6c75('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1930e6){return function(_0x44333e,_0x2c6602,_0x26052b){_0x44333e[_0x6c75('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e2295){_0x44333e['setDataValue'](_0x6c75('0x6'),_0x2e2295[_0x6c75('0x7')](function(_0x53ddae){return{'id':_0x53ddae['id']};}));return MailMessage[_0x6c75('0x8')]({'where':{'MailInteractionId':_0x44333e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6c75('0x9')](function(_0x2fc7fc){_0x44333e[_0x6c75('0xa')](_0x6c75('0xb'),_0x2fc7fc[_0x6c75('0xc')]);MailInteractionEvents[_0x6c75('0xd')](_0x1930e6+':'+_0x44333e['id'],_0x44333e);MailInteractionEvents[_0x6c75('0xd')](_0x1930e6,_0x44333e);_0x26052b(null);})[_0x6c75('0xe')](_0x26052b(null));};}for(var e in events){if(events[_0x6c75('0xf')](e)){var event=events[e];MailInteraction[_0x6c75('0x10')](e,emitEvent(event));}}module[_0x6c75('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 810f99c..b18fdda 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 _0x7f84=['../../config/logger','api','moment','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7f84,0x1d3));var _0x47f8=function(_0x2ce0df,_0x4f9bb0){_0x2ce0df=_0x2ce0df-0x0;var _0x243c28=_0x7f84[_0x2ce0df];return _0x243c28;};'use strict';var _=require(_0x47f8('0x0'));var util=require('util');var logger=require(_0x47f8('0x1'))(_0x47f8('0x2'));var moment=require(_0x47f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x47f8('0x4'));var fs=require('fs');var path=require(_0x47f8('0x5'));var rimraf=require('rimraf');var config=require(_0x47f8('0x6'));var attributes=require(_0x47f8('0x7'));module[_0x47f8('0x8')]=function(_0xfc0985,_0x4f4b87){return _0xfc0985['define'](_0x47f8('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x47f8('0xa'),'to'],'type':_0x47f8('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25baf9,_0x328393,_0x160e0a){if(_0x25baf9[_0x47f8('0xc')]){_0x25baf9[_0x47f8('0xd')]=moment()[_0x47f8('0xe')](_0x47f8('0xf'));}if(_0x25baf9[_0x47f8('0x10')]){_0x25baf9[_0x47f8('0x11')]=moment()[_0x47f8('0xe')](_0x47f8('0xf'));}_0x160e0a(null,_0x328393);},'beforeUpdate':function(_0x1b0fe6,_0x34285b,_0x3bd2b0){if(_0x1b0fe6[_0x47f8('0x12')](_0x47f8('0xc'))){_0x1b0fe6['substatusAt']=_0x1b0fe6[_0x47f8('0xc')]?moment()[_0x47f8('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x1b0fe6['changed'](_0x47f8('0x10'))){_0x1b0fe6[_0x47f8('0x11')]=moment()['format'](_0x47f8('0xf'));_0x1b0fe6[_0x47f8('0xc')]=null;_0x1b0fe6['substatusAt']=null;}_0x3bd2b0(null,_0x1b0fe6);},'afterUpdate':function(_0x762f20,_0x50bfa1,_0x32aa3c){var _0x5be5df=_0xfc0985[_0x47f8('0x13')];var _0x5b002e=_0x762f20[_0x47f8('0x14')]({'plain':!![]});if(_0x5b002e['closed']){return _0x5be5df[_0x47f8('0x15')][_0x47f8('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x5b002e['id']}})[_0x47f8('0x17')](function(){_0x32aa3c();})[_0x47f8('0x18')](function(_0x1198fb){_0x32aa3c(_0x1198fb);});}else{_0x32aa3c();}}},'charset':_0x47f8('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7a25=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT'];(function(_0x34e3e0,_0x45f438){var _0x4a3584=function(_0x1345d9){while(--_0x1345d9){_0x34e3e0['push'](_0x34e3e0['shift']());}};_0x4a3584(++_0x45f438);}(_0x7a25,0xbb));var _0x57a2=function(_0x18f64a,_0x1c8248){_0x18f64a=_0x18f64a-0x0;var _0x44687f=_0x7a25[_0x18f64a];return _0x44687f;};'use strict';var _=require(_0x57a2('0x0'));var util=require(_0x57a2('0x1'));var logger=require(_0x57a2('0x2'))(_0x57a2('0x3'));var moment=require('moment');var BPromise=require(_0x57a2('0x4'));var rp=require(_0x57a2('0x5'));var fs=require('fs');var path=require(_0x57a2('0x6'));var rimraf=require(_0x57a2('0x7'));var config=require(_0x57a2('0x8'));var attributes=require(_0x57a2('0x9'));module[_0x57a2('0xa')]=function(_0x38a7b5,_0x73c676){return _0x38a7b5[_0x57a2('0xb')](_0x57a2('0xc'),attributes,{'tableName':_0x57a2('0xd'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x57a2('0xe'),'to'],'type':_0x57a2('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x316281,_0x403057,_0x5c8333){if(_0x316281['substatus']){_0x316281[_0x57a2('0x10')]=moment()[_0x57a2('0x11')](_0x57a2('0x12'));}if(_0x316281[_0x57a2('0x13')]){_0x316281[_0x57a2('0x14')]=moment()[_0x57a2('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5c8333(null,_0x403057);},'beforeUpdate':function(_0x541211,_0x3da353,_0x1fe0c7){if(_0x541211[_0x57a2('0x15')](_0x57a2('0x16'))){_0x541211['substatusAt']=_0x541211[_0x57a2('0x16')]?moment()[_0x57a2('0x11')](_0x57a2('0x12')):null;}if(_0x541211['changed'](_0x57a2('0x13'))){_0x541211[_0x57a2('0x14')]=moment()[_0x57a2('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x541211[_0x57a2('0x16')]=null;_0x541211[_0x57a2('0x10')]=null;}_0x1fe0c7(null,_0x541211);},'afterUpdate':function(_0x19c54a,_0x56c3d2,_0x556e6d){var _0x35fbbd=_0x38a7b5['models'];var _0x3e92ef=_0x19c54a[_0x57a2('0x17')]({'plain':!![]});if(_0x3e92ef[_0x57a2('0x13')]){return _0x35fbbd[_0x57a2('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x3e92ef['id']}})[_0x57a2('0x19')](function(){_0x556e6d();})[_0x57a2('0x1a')](function(_0xa7eded){_0x556e6d(_0xa7eded);});}else{_0x556e6d();}}},'charset':_0x57a2('0x1b'),'collate':_0x57a2('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 64a70a9..0756ae7 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 _0x6f47=['body','options','where','attributes','limit','find','ids','omit','AddTags','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f47,0xc7));var _0x76f4=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x6f47[_0x298ed3];return _0x5aad28;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});config[_0x76f4('0x9')]=_[_0x76f4('0xa')](config['redis'],{'host':_0x76f4('0xb'),'port':0x18eb});var socket=require(_0x76f4('0xc'))(new Redis(config[_0x76f4('0x9')]));require(_0x76f4('0xd'))[_0x76f4('0xe')](socket);function respondWithRpcPromise(_0x4c6b5c,_0x5367d6,_0x3347ef){return new BPromise(function(_0x18e41a,_0x5af83c){return client['request'](_0x4c6b5c,_0x3347ef)[_0x76f4('0xf')](function(_0x458c22){logger[_0x76f4('0x10')](_0x76f4('0x11'),_0x5367d6,_0x76f4('0x12'));logger[_0x76f4('0x13')](_0x76f4('0x14'),_0x5367d6,_0x76f4('0x12'),JSON[_0x76f4('0x15')](_0x458c22));if(_0x458c22['error']){if(_0x458c22[_0x76f4('0x16')][_0x76f4('0x17')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x5367d6,_0x458c22['error'][_0x76f4('0x18')]);return _0x5af83c(_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);}logger[_0x76f4('0x16')](_0x76f4('0x11'),_0x5367d6,_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);return _0x18e41a(_0x458c22[_0x76f4('0x16')][_0x76f4('0x18')]);}else{logger[_0x76f4('0x10')](_0x76f4('0x11'),_0x5367d6,_0x76f4('0x12'));_0x18e41a(_0x458c22[_0x76f4('0x19')][_0x76f4('0x18')]);}})[_0x76f4('0x1a')](function(_0x397360){logger[_0x76f4('0x16')](_0x76f4('0x11'),_0x5367d6,_0x397360);_0x5af83c(_0x397360);});});}exports[_0x76f4('0x1b')]=function(_0x35b406){var _0x46f057=this;return new Promise(function(_0x285232,_0x5bf3d5){return db[_0x76f4('0x1c')]['update'](_0x35b406[_0x76f4('0x1d')],{'raw':_0x35b406[_0x76f4('0x1e')]?_0x35b406[_0x76f4('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35b406['options']?_0x35b406['options'][_0x76f4('0x1f')]||null:null,'attributes':_0x35b406[_0x76f4('0x1e')]?_0x35b406[_0x76f4('0x1e')][_0x76f4('0x20')]||null:null,'limit':_0x35b406[_0x76f4('0x1e')]?_0x35b406[_0x76f4('0x1e')][_0x76f4('0x21')]||null:null})['then'](function(_0x504aa8){logger[_0x76f4('0x10')]('UpdateMailInteraction',_0x35b406);logger[_0x76f4('0x13')]('UpdateMailInteraction',_0x35b406,JSON['stringify'](_0x504aa8));_0x285232(_0x504aa8);})['catch'](function(_0x470242){logger[_0x76f4('0x16')](_0x76f4('0x1b'),_0x470242[_0x76f4('0x18')],_0x35b406);_0x5bf3d5(_0x46f057[_0x76f4('0x16')](0x1f4,_0x470242[_0x76f4('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x306cb4){return new Promise(function(_0x59d133,_0x5346be){return db['MailInteraction'][_0x76f4('0x22')]({'where':_0x306cb4[_0x76f4('0x1e')]?_0x306cb4[_0x76f4('0x1e')][_0x76f4('0x1f')]||null:null})['then'](function(_0x431b33){if(_0x431b33){return _0x431b33['addTags'](_0x306cb4[_0x76f4('0x1d')][_0x76f4('0x23')],_[_0x76f4('0x24')](_0x306cb4[_0x76f4('0x1d')],[_0x76f4('0x23'),'id'])||{});}})['spread'](function(_0x51019e){logger[_0x76f4('0x10')](_0x76f4('0x25'),_0x306cb4);logger[_0x76f4('0x13')](_0x76f4('0x25'),_0x306cb4,JSON[_0x76f4('0x15')](_0x51019e));_0x59d133(_0x51019e);})[_0x76f4('0x1a')](function(_0x2a13ca){logger[_0x76f4('0x16')](_0x76f4('0x25'),_0x2a13ca[_0x76f4('0x18')],_0x306cb4);_0x5346be(_this[_0x76f4('0x16')](0x1f4,_0x2a13ca[_0x76f4('0x18')]));});});}; \ No newline at end of file +var _0xc23e=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','attributes','then','catch','AddTagsToMailInteraction','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xc23e,0x68));var _0xec23=function(_0xc01cc,_0x1d8e2d){_0xc01cc=_0xc01cc-0x0;var _0x6ea309=_0xc23e[_0xc01cc];return _0x6ea309;};'use strict';var _=require('lodash');var util=require(_0xec23('0x0'));var moment=require(_0xec23('0x1'));var BPromise=require(_0xec23('0x2'));var rs=require(_0xec23('0x3'));var fs=require('fs');var Redis=require(_0xec23('0x4'));var db=require(_0xec23('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec23('0x6'))(_0xec23('0x7'));var config=require('../../config/environment');var jayson=require(_0xec23('0x8'));var client=jayson['client'][_0xec23('0x9')]({'port':0x232a});config[_0xec23('0xa')]=_['defaults'](config['redis'],{'host':_0xec23('0xb'),'port':0x18eb});var socket=require(_0xec23('0xc'))(new Redis(config[_0xec23('0xa')]));require(_0xec23('0xd'))[_0xec23('0xe')](socket);function respondWithRpcPromise(_0x5abb58,_0x2c820c,_0x127f06){return new BPromise(function(_0x11d1d9,_0x141329){return client[_0xec23('0xf')](_0x5abb58,_0x127f06)['then'](function(_0x1a5d7e){logger[_0xec23('0x10')](_0xec23('0x11'),_0x2c820c,_0xec23('0x12'));logger[_0xec23('0x13')](_0xec23('0x14'),_0x2c820c,'request\x20sent',JSON[_0xec23('0x15')](_0x1a5d7e));if(_0x1a5d7e['error']){if(_0x1a5d7e[_0xec23('0x16')][_0xec23('0x17')]===0x1f4){logger['error'](_0xec23('0x11'),_0x2c820c,_0x1a5d7e[_0xec23('0x16')][_0xec23('0x18')]);return _0x141329(_0x1a5d7e[_0xec23('0x16')][_0xec23('0x18')]);}logger[_0xec23('0x16')](_0xec23('0x11'),_0x2c820c,_0x1a5d7e[_0xec23('0x16')][_0xec23('0x18')]);return _0x11d1d9(_0x1a5d7e['error'][_0xec23('0x18')]);}else{logger[_0xec23('0x10')](_0xec23('0x11'),_0x2c820c,'request\x20sent');_0x11d1d9(_0x1a5d7e[_0xec23('0x19')]['message']);}})['catch'](function(_0x38b7e0){logger[_0xec23('0x16')](_0xec23('0x11'),_0x2c820c,_0x38b7e0);_0x141329(_0x38b7e0);});});}exports[_0xec23('0x1a')]=function(_0x456658){var _0x2ea9e2=this;return new Promise(function(_0x40a77c,_0x1f7727){return db[_0xec23('0x1b')][_0xec23('0x1c')](_0x456658[_0xec23('0x1d')],{'raw':_0x456658[_0xec23('0x1e')]?_0x456658['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x456658[_0xec23('0x1e')]?_0x456658[_0xec23('0x1e')]['where']||null:null,'attributes':_0x456658['options']?_0x456658[_0xec23('0x1e')][_0xec23('0x1f')]||null:null,'limit':_0x456658[_0xec23('0x1e')]?_0x456658[_0xec23('0x1e')]['limit']||null:null})[_0xec23('0x20')](function(_0x525524){logger['info'](_0xec23('0x1a'),_0x456658);logger[_0xec23('0x13')](_0xec23('0x1a'),_0x456658,JSON[_0xec23('0x15')](_0x525524));_0x40a77c(_0x525524);})[_0xec23('0x21')](function(_0x3f7c99){logger[_0xec23('0x16')](_0xec23('0x1a'),_0x3f7c99[_0xec23('0x18')],_0x456658);_0x1f7727(_0x2ea9e2[_0xec23('0x16')](0x1f4,_0x3f7c99[_0xec23('0x18')]));});});};exports[_0xec23('0x22')]=function(_0x3126c1){return new Promise(function(_0x2884e2,_0x2a7fdc){return db[_0xec23('0x1b')]['find']({'where':_0x3126c1[_0xec23('0x1e')]?_0x3126c1[_0xec23('0x1e')][_0xec23('0x23')]||null:null})[_0xec23('0x20')](function(_0x50811b){if(_0x50811b){return _0x50811b[_0xec23('0x24')](_0x3126c1[_0xec23('0x1d')][_0xec23('0x25')],_[_0xec23('0x26')](_0x3126c1[_0xec23('0x1d')],[_0xec23('0x25'),'id'])||{});}})[_0xec23('0x27')](function(_0x5f061f){logger['info'](_0xec23('0x28'),_0x3126c1);logger[_0xec23('0x13')]('AddTags',_0x3126c1,JSON[_0xec23('0x15')](_0x5f061f));_0x2884e2(_0x5f061f);})[_0xec23('0x21')](function(_0x42b4e8){logger['error'](_0xec23('0x28'),_0x42b4e8['message'],_0x3126c1);_0x2a7fdc(_this['error'](0x1f4,_0x42b4e8[_0xec23('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 204ee69..f1c3c22 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 _0xd363=['save','remove','update','emit','removeListener','length','mailInteraction:','./mailInteraction.events'];(function(_0x444731,_0x465f83){var _0x4ada91=function(_0x37a8f5){while(--_0x37a8f5){_0x444731['push'](_0x444731['shift']());}};_0x4ada91(++_0x465f83);}(_0xd363,0xdf));var _0x3d36=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0xd363[_0x2ca2d0];return _0x521c23;};'use strict';var MailInteractionEvents=require(_0x3d36('0x0'));var events=[_0x3d36('0x1'),_0x3d36('0x2'),_0x3d36('0x3')];function createListener(_0x14ee60,_0xd6fc48){return function(_0x5f3619){_0xd6fc48[_0x3d36('0x4')](_0x14ee60,_0x5f3619);};}function removeListener(_0x30add9,_0x3c33a9){return function(){MailInteractionEvents[_0x3d36('0x5')](_0x30add9,_0x3c33a9);};}exports['register']=function(_0x371aec){for(var _0x5d2480=0x0,_0x409ddb=events[_0x3d36('0x6')];_0x5d2480<_0x409ddb;_0x5d2480++){var _0x249a2b=events[_0x5d2480];var _0x30e390=createListener(_0x3d36('0x7')+_0x249a2b,_0x371aec);MailInteractionEvents['on'](_0x249a2b,_0x30e390);}}; \ No newline at end of file +var _0xd74a=['register','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x4d650f,_0x50314f){var _0x16ebc4=function(_0x49e084){while(--_0x49e084){_0x4d650f['push'](_0x4d650f['shift']());}};_0x16ebc4(++_0x50314f);}(_0xd74a,0x11a));var _0xad74=function(_0x5c5d7b,_0x1c8419){_0x5c5d7b=_0x5c5d7b-0x0;var _0xeb383=_0xd74a[_0x5c5d7b];return _0xeb383;};'use strict';var MailInteractionEvents=require(_0xad74('0x0'));var events=[_0xad74('0x1'),_0xad74('0x2'),_0xad74('0x3')];function createListener(_0x416f33,_0x4231b7){return function(_0x39c2af){_0x4231b7[_0xad74('0x4')](_0x416f33,_0x39c2af);};}function removeListener(_0x5f4d05,_0x2ebe98){return function(){MailInteractionEvents[_0xad74('0x5')](_0x5f4d05,_0x2ebe98);};}exports[_0xad74('0x6')]=function(_0x1e2681){for(var _0x5d1513=0x0,_0x2b4202=events['length'];_0x5d1513<_0x2b4202;_0x5d1513++){var _0x4df7ff=events[_0x5d1513];var _0x45b392=createListener(_0xad74('0x7')+_0x4df7ff,_0x1e2681);MailInteractionEvents['on'](_0x4df7ff,_0x45b392);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index e558dbd..09717ed 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 _0x24cf=['/:id','isAuthenticated','/:id/download','download','post','mail','mailmessage:create','create','/:id/accept','accept','put','reject','delete','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','describe'];(function(_0x572468,_0x374ac5){var _0x52b510=function(_0x5c25d6){while(--_0x5c25d6){_0x572468['push'](_0x572468['shift']());}};_0x52b510(++_0x374ac5);}(_0x24cf,0x1d5));var _0xf24c=function(_0x3edae6,_0x3e3ad2){_0x3edae6=_0x3edae6-0x0;var _0x378392=_0x24cf[_0x3edae6];return _0x378392;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf24c('0x0'));var timeout=require(_0xf24c('0x1'));var express=require(_0xf24c('0x2'));var router=express[_0xf24c('0x3')]();var fs_extra=require(_0xf24c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf24c('0x5'));var config=require(_0xf24c('0x6'));var controller=require(_0xf24c('0x7'));router[_0xf24c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf24c('0x9'),auth['isAuthenticated'](),controller[_0xf24c('0xa')]);router[_0xf24c('0x8')](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['show']);router[_0xf24c('0x8')](_0xf24c('0xd'),auth[_0xf24c('0xc')](),controller[_0xf24c('0xe')]);router[_0xf24c('0xf')]('/',auth[_0xf24c('0xc')](),interaction['tracked'](_0xf24c('0x10'),_0xf24c('0x11')),controller[_0xf24c('0x12')]);router['put'](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['update']);router['put'](_0xf24c('0x13'),auth['isAuthenticated'](),controller[_0xf24c('0x14')]);router[_0xf24c('0x15')]('/:id/reject',auth[_0xf24c('0xc')](),controller[_0xf24c('0x16')]);router[_0xf24c('0x17')](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x85cf=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','download','tracked','mail','create','put','/:id/accept','accept','/:id/reject','reject','destroy','util','path'];(function(_0x4c4363,_0x45e80e){var _0xc82c91=function(_0x5dc20c){while(--_0x5dc20c){_0x4c4363['push'](_0x4c4363['shift']());}};_0xc82c91(++_0x45e80e);}(_0x85cf,0x76));var _0xf85c=function(_0x24659c,_0x4d65a0){_0x24659c=_0x24659c-0x0;var _0x48c11c=_0x85cf[_0x24659c];return _0x48c11c;};'use strict';var multer=require('multer');var util=require(_0xf85c('0x0'));var path=require(_0xf85c('0x1'));var timeout=require(_0xf85c('0x2'));var express=require(_0xf85c('0x3'));var router=express[_0xf85c('0x4')]();var fs_extra=require(_0xf85c('0x5'));var auth=require(_0xf85c('0x6'));var interaction=require(_0xf85c('0x7'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xf85c('0x8')]('/',auth[_0xf85c('0x9')](),controller['index']);router[_0xf85c('0x8')](_0xf85c('0xa'),auth[_0xf85c('0x9')](),controller[_0xf85c('0xb')]);router[_0xf85c('0x8')](_0xf85c('0xc'),auth['isAuthenticated'](),controller[_0xf85c('0xd')]);router[_0xf85c('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xf85c('0xe')]);router['post']('/',auth[_0xf85c('0x9')](),interaction[_0xf85c('0xf')](_0xf85c('0x10'),'mailmessage:create'),controller[_0xf85c('0x11')]);router[_0xf85c('0x12')](_0xf85c('0xc'),auth[_0xf85c('0x9')](),controller['update']);router[_0xf85c('0x12')](_0xf85c('0x13'),auth[_0xf85c('0x9')](),controller[_0xf85c('0x14')]);router['put'](_0xf85c('0x15'),auth['isAuthenticated'](),controller[_0xf85c('0x16')]);router['delete'](_0xf85c('0xc'),auth['isAuthenticated'](),controller[_0xf85c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 2c54ae1..bd42e60 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 _0xac9b=['DATE','Email','lodash','long','TEXT','medium','BOOLEAN','ENUM','STRING','INTEGER'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xac9b,0x7a));var _0xbac9=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0xac9b[_0x54ea7a];return _0x65a10d;};'use strict';var Sequelize=require('sequelize');var _=require(_0xbac9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xbac9('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbac9('0x2')](_0xbac9('0x3'))},'read':{'type':Sequelize[_0xbac9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbac9('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xbac9('0x6')]},'to':{'type':Sequelize['TEXT'](_0xbac9('0x1'))},'cc':{'type':Sequelize[_0xbac9('0x2')](_0xbac9('0x1'))},'bcc':{'type':Sequelize[_0xbac9('0x2')](_0xbac9('0x1'))},'subject':{'type':Sequelize[_0xbac9('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xbac9('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xbac9('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xbac9('0x8')]},'originTo':{'type':Sequelize[_0xbac9('0x2')](_0xbac9('0x1'))},'originCc':{'type':Sequelize[_0xbac9('0x2')]('long')},'originChannel':{'type':Sequelize[_0xbac9('0x5')]('Email','Chat'),'defaultValue':_0xbac9('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0x2912=['exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email','lodash'];(function(_0xcb8bb4,_0x2238ec){var _0x54113d=function(_0x619ea){while(--_0x619ea){_0xcb8bb4['push'](_0xcb8bb4['shift']());}};_0x54113d(++_0x2238ec);}(_0x2912,0x15b));var _0x2291=function(_0x9d3c77,_0x1dc75d){_0x9d3c77=_0x9d3c77-0x0;var _0x1043b2=_0x2912[_0x9d3c77];return _0x1043b2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x2291('0x0'));module[_0x2291('0x1')]={'body':{'type':Sequelize[_0x2291('0x2')](_0x2291('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2291('0x2')](_0x2291('0x4'))},'read':{'type':Sequelize[_0x2291('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2291('0x6')]('in',_0x2291('0x7')),'defaultValue':_0x2291('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2291('0x8')](0x1fe)},'from':{'type':Sequelize[_0x2291('0x8')]},'to':{'type':Sequelize[_0x2291('0x2')](_0x2291('0x3'))},'cc':{'type':Sequelize[_0x2291('0x2')](_0x2291('0x3'))},'bcc':{'type':Sequelize[_0x2291('0x2')](_0x2291('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x2291('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2291('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2291('0xa')]},'originTo':{'type':Sequelize[_0x2291('0x2')](_0x2291('0x3'))},'originCc':{'type':Sequelize[_0x2291('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0x2291('0xb'),'Chat'),'defaultValue':_0x2291('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 3094a74..e65daff 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 _0xcf61=['where','filters','pick','filter','merge','type','options','includeAll','include','rows','catch','params','fields','body','find','describe','create','direction','out','secret','split','findOne','CmList','List','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','CmContact','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','motionChannel','channel','event','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize','email','unix','server','files','tmp','message-%s.eml','subject','Attachment','Attachments','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','offset','undefined','limit','count','Content-Range','json','update','then','destroy','end','sendStatus','stack','name','map','MailMessage','rawAttributes','key','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x54ee0f,_0x1da564){var _0x4376fc=function(_0x243562){while(--_0x243562){_0x54ee0f['push'](_0x54ee0f['shift']());}};_0x4376fc(++_0x1da564);}(_0xcf61,0x1a2));var _0x1cf6=function(_0x1b047c,_0x464024){_0x1b047c=_0x1b047c-0x0;var _0x39281b=_0xcf61[_0x1b047c];return _0x39281b;};'use strict';var emlformat=require(_0x1cf6('0x0'));var moment=require(_0x1cf6('0x1'));var BPromise=require('bluebird');var util=require(_0x1cf6('0x2'));var path=require(_0x1cf6('0x3'));var fs=require('fs');var _=require(_0x1cf6('0x4'));var Redis=require(_0x1cf6('0x5'));var htmlToText=require(_0x1cf6('0x6'));var qs=require(_0x1cf6('0x7'));var logger=require('../../config/logger')(_0x1cf6('0x8'));var interaction_log=require(_0x1cf6('0x9'))('mail-interactions');var config=require(_0x1cf6('0xa'));var db=require(_0x1cf6('0xb'))['db'];config[_0x1cf6('0xc')]=_[_0x1cf6('0xd')](config[_0x1cf6('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0x1cf6('0xe'));require(_0x1cf6('0xf'))[_0x1cf6('0x10')](socket);var jayson=require(_0x1cf6('0x11'));var client=jayson[_0x1cf6('0x12')][_0x1cf6('0x13')]({'port':0x232c});var client9003=jayson[_0x1cf6('0x12')][_0x1cf6('0x13')]({'port':0x232b});var client9002=jayson[_0x1cf6('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11000a,_0x3682a2,_0x1a418c,_0x1a8e50){return new BPromise(function(_0x8d65a1,_0x5cd1e5){var _0x445953=_0x1a8e50||client;return _0x445953[_0x1cf6('0x14')](_0x11000a,_0x1a418c)['then'](function(_0x28cd14){logger[_0x1cf6('0x15')](_0x1cf6('0x16'),_0x3682a2,_0x1cf6('0x17'));logger[_0x1cf6('0x18')](_0x1cf6('0x19'),_0x3682a2,_0x1cf6('0x17'),JSON[_0x1cf6('0x1a')](_0x28cd14));if(_0x28cd14['error']){if(_0x28cd14[_0x1cf6('0x1b')][_0x1cf6('0x1c')]===0x1f4){logger['error'](_0x1cf6('0x16'),_0x3682a2,_0x28cd14[_0x1cf6('0x1b')][_0x1cf6('0x1d')]);return _0x5cd1e5(_0x28cd14[_0x1cf6('0x1b')]['message']);}logger[_0x1cf6('0x1b')]('MailMessage,\x20%s,\x20%s',_0x3682a2,_0x28cd14[_0x1cf6('0x1b')]['message']);return _0x8d65a1(_0x28cd14[_0x1cf6('0x1b')]['message']);}else{logger[_0x1cf6('0x15')](_0x1cf6('0x16'),_0x3682a2,'request\x20sent');_0x8d65a1(_0x28cd14[_0x1cf6('0x1e')][_0x1cf6('0x1d')]);}})['catch'](function(_0x303a81){logger['error']('MailMessage,\x20%s,\x20%s',_0x3682a2,_0x303a81);_0x5cd1e5(_0x303a81);});});}function respondWithResult(_0x32cb83,_0x1c5d08){_0x1c5d08=_0x1c5d08||0xc8;return function(_0x1b1dbb){if(_0x1b1dbb){return _0x32cb83[_0x1cf6('0x1f')](_0x1c5d08)['json'](_0x1b1dbb);}};}function respondWithFilteredResult(_0x40c823,_0x22bb64){return function(_0x23623e){if(_0x23623e){var _0x250f5c=typeof _0x22bb64[_0x1cf6('0x20')]===_0x1cf6('0x21')&&typeof _0x22bb64[_0x1cf6('0x22')]===_0x1cf6('0x21');var _0x416c37=_0x23623e[_0x1cf6('0x23')];var _0x94cd6b=_0x250f5c?0x0:_0x22bb64[_0x1cf6('0x20')];var _0x3a4963=_0x250f5c?_0x23623e[_0x1cf6('0x23')]:_0x22bb64['offset']+_0x22bb64['limit'];var _0x254e32;if(_0x3a4963>=_0x416c37){_0x3a4963=_0x416c37;_0x254e32=0xc8;}else{_0x254e32=0xce;}_0x40c823[_0x1cf6('0x1f')](_0x254e32);return _0x40c823['set'](_0x1cf6('0x24'),_0x94cd6b+'-'+_0x3a4963+'/'+_0x416c37)[_0x1cf6('0x25')](_0x23623e);}return null;};}function saveUpdates(_0x5c0076){return function(_0xacc6f4){if(_0xacc6f4){return _0xacc6f4[_0x1cf6('0x26')](_0x5c0076)[_0x1cf6('0x27')](function(_0x4203e8){return _0x4203e8;});}return null;};}function removeEntity(_0x368810){return function(_0x83550f){if(_0x83550f){return _0x83550f[_0x1cf6('0x28')]()[_0x1cf6('0x27')](function(){_0x368810[_0x1cf6('0x1f')](0xcc)[_0x1cf6('0x29')]();});}};}function handleEntityNotFound(_0x4682c9){return function(_0x355648){if(!_0x355648){_0x4682c9[_0x1cf6('0x2a')](0x194);}return _0x355648;};}function handleError(_0x52e47e,_0xc5427b){_0xc5427b=_0xc5427b||0x1f4;return function(_0x546bde){logger[_0x1cf6('0x1b')](_0x546bde[_0x1cf6('0x2b')]);if(_0x546bde[_0x1cf6('0x2c')]){delete _0x546bde['name'];}_0x52e47e['status'](_0xc5427b)['send'](_0x546bde);};}exports['index']=function(_0x2b6909,_0x5b7195){var _0x2c9325={},_0x131f9a={},_0x14658c={'count':0x0,'rows':[]};var _0x5d2b54=_[_0x1cf6('0x2d')](db[_0x1cf6('0x2e')][_0x1cf6('0x2f')],function(_0x4840a0){return{'name':_0x4840a0['fieldName'],'type':_0x4840a0['type'][_0x1cf6('0x30')]};});_0x131f9a['model']=_[_0x1cf6('0x2d')](_0x5d2b54,_0x1cf6('0x2c'));_0x131f9a['query']=_[_0x1cf6('0x31')](_0x2b6909[_0x1cf6('0x32')]);_0x131f9a['filters']=_[_0x1cf6('0x33')](_0x131f9a[_0x1cf6('0x34')],_0x131f9a[_0x1cf6('0x32')]);_0x2c9325[_0x1cf6('0x35')]=_['intersection'](_0x131f9a[_0x1cf6('0x34')],qs['fields'](_0x2b6909[_0x1cf6('0x32')]['fields']));_0x2c9325['attributes']=_0x2c9325['attributes'][_0x1cf6('0x36')]?_0x2c9325['attributes']:_0x131f9a[_0x1cf6('0x34')];if(!_0x2b6909[_0x1cf6('0x32')][_0x1cf6('0x37')](_0x1cf6('0x38'))){_0x2c9325[_0x1cf6('0x22')]=qs[_0x1cf6('0x22')](_0x2b6909[_0x1cf6('0x32')][_0x1cf6('0x22')]);_0x2c9325[_0x1cf6('0x20')]=qs['offset'](_0x2b6909[_0x1cf6('0x32')]['offset']);}_0x2c9325[_0x1cf6('0x39')]=qs[_0x1cf6('0x3a')](_0x2b6909[_0x1cf6('0x32')][_0x1cf6('0x3a')]);_0x2c9325[_0x1cf6('0x3b')]=qs[_0x1cf6('0x3c')](_[_0x1cf6('0x3d')](_0x2b6909[_0x1cf6('0x32')],_0x131f9a[_0x1cf6('0x3c')]),_0x5d2b54);if(_0x2b6909[_0x1cf6('0x32')][_0x1cf6('0x3e')]){_0x2c9325[_0x1cf6('0x3b')]=_[_0x1cf6('0x3f')](_0x2c9325[_0x1cf6('0x3b')],{'$or':_['map'](_0x5d2b54,function(_0x72c61d){if(_0x72c61d[_0x1cf6('0x40')]!=='VIRTUAL'){var _0x1d5e6e={};_0x1d5e6e[_0x72c61d[_0x1cf6('0x2c')]]={'$like':'%'+_0x2b6909[_0x1cf6('0x32')][_0x1cf6('0x3e')]+'%'};return _0x1d5e6e;}})});}_0x2c9325=_[_0x1cf6('0x3f')]({},_0x2c9325,_0x2b6909[_0x1cf6('0x41')]);var _0x14be33={'where':_0x2c9325[_0x1cf6('0x3b')]};return db[_0x1cf6('0x2e')][_0x1cf6('0x23')](_0x14be33)[_0x1cf6('0x27')](function(_0x50fe91){_0x14658c[_0x1cf6('0x23')]=_0x50fe91;if(_0x2b6909[_0x1cf6('0x32')][_0x1cf6('0x42')]){_0x2c9325[_0x1cf6('0x43')]=[{'all':!![]}];}return db[_0x1cf6('0x2e')]['findAll'](_0x2c9325);})[_0x1cf6('0x27')](function(_0x1b43ee){_0x14658c[_0x1cf6('0x44')]=_0x1b43ee;return _0x14658c;})[_0x1cf6('0x27')](respondWithFilteredResult(_0x5b7195,_0x2c9325))[_0x1cf6('0x45')](handleError(_0x5b7195,null));};exports['show']=function(_0x54104b,_0x4b05b5){var _0x2fdb42={'raw':!![],'where':{'id':_0x54104b[_0x1cf6('0x46')]['id']}},_0x2947bd={};_0x2947bd[_0x1cf6('0x34')]=_[_0x1cf6('0x31')](db['MailMessage'][_0x1cf6('0x2f')]);_0x2947bd[_0x1cf6('0x32')]=_['keys'](_0x54104b[_0x1cf6('0x32')]);_0x2947bd['filters']=_[_0x1cf6('0x33')](_0x2947bd[_0x1cf6('0x34')],_0x2947bd['query']);_0x2fdb42['attributes']=_[_0x1cf6('0x33')](_0x2947bd[_0x1cf6('0x34')],qs[_0x1cf6('0x47')](_0x54104b[_0x1cf6('0x32')][_0x1cf6('0x47')]));_0x2fdb42['attributes']=_0x2fdb42['attributes'][_0x1cf6('0x36')]?_0x2fdb42['attributes']:_0x2947bd['model'];if(_0x54104b[_0x1cf6('0x32')][_0x1cf6('0x42')]){_0x2fdb42['include']=[{'all':!![]}];}_0x2fdb42=_[_0x1cf6('0x3f')]({},_0x2fdb42,_0x54104b['options']);return db['MailMessage']['find'](_0x2fdb42)[_0x1cf6('0x27')](handleEntityNotFound(_0x4b05b5,null))[_0x1cf6('0x27')](respondWithResult(_0x4b05b5,null))[_0x1cf6('0x45')](handleError(_0x4b05b5,null));};exports['update']=function(_0x55c981,_0x88ae57){if(_0x55c981['body']['id']){delete _0x55c981[_0x1cf6('0x48')]['id'];}return db[_0x1cf6('0x2e')][_0x1cf6('0x49')]({'where':{'id':_0x55c981[_0x1cf6('0x46')]['id']}})[_0x1cf6('0x27')](handleEntityNotFound(_0x88ae57,null))[_0x1cf6('0x27')](saveUpdates(_0x55c981['body'],null))['then'](respondWithResult(_0x88ae57,null))[_0x1cf6('0x45')](handleError(_0x88ae57,null));};exports[_0x1cf6('0x28')]=function(_0x57e3a1,_0x381d22){return db[_0x1cf6('0x2e')][_0x1cf6('0x49')]({'where':{'id':_0x57e3a1['params']['id']}})['then'](handleEntityNotFound(_0x381d22,null))[_0x1cf6('0x27')](removeEntity(_0x381d22,null))[_0x1cf6('0x45')](handleError(_0x381d22,null));};exports[_0x1cf6('0x4a')]=function(_0x1c6f0c,_0xee4e21){return db[_0x1cf6('0x2e')]['describe']()[_0x1cf6('0x27')](respondWithResult(_0xee4e21,null))[_0x1cf6('0x45')](handleError(_0xee4e21,null));};exports[_0x1cf6('0x4b')]=function(_0x47c862,_0xac8756){return db[_0x1cf6('0x2e')][_0x1cf6('0x4b')](_0x47c862[_0x1cf6('0x48')])['then'](function(_0x2d52a0){if(_0x2d52a0){if(_0x2d52a0[_0x1cf6('0x4c')]===_0x1cf6('0x4d')&&!_0x2d52a0[_0x1cf6('0x4e')]){var _0x4e12ea,_0x2c936e,_0x56c10d;if(_0x47c862['body']['to']){_0x2c936e=_0x47c862[_0x1cf6('0x48')]['to'][_0x1cf6('0x4f')](',')[0x0];}return db['MailAccount'][_0x1cf6('0x50')]({'where':{'id':_0x2d52a0['MailAccountId']},'include':[{'model':db[_0x1cf6('0x51')],'as':_0x1cf6('0x52'),'include':[{'model':db['CmContact'],'as':_0x1cf6('0x53'),'where':{'email':_0x2c936e},'limit':0x1,'order':[[_0x1cf6('0x54'),_0x1cf6('0x55')]]}]},{'model':db[_0x1cf6('0x56')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1cf6('0x57')],'as':'CloudProvider','raw':!![]}]}]})[_0x1cf6('0x27')](function(_0x5f04fb){_0x4e12ea=_0x5f04fb;if(!_0x4e12ea||!_0x4e12ea[_0x1cf6('0x58')])return;var _0x2e63dd=_0x4e12ea[_0x1cf6('0x59')]();if(_0x47c862[_0x1cf6('0x48')][_0x1cf6('0x5a')]&&_0x47c862[_0x1cf6('0x48')][_0x1cf6('0x5a')][_0x1cf6('0x36')]){for(var _0x30cfac=0x0;_0x30cfac<_0x47c862[_0x1cf6('0x48')][_0x1cf6('0x5a')][_0x1cf6('0x36')];_0x30cfac+=0x1){_0x47c862[_0x1cf6('0x48')][_0x1cf6('0x5a')][_0x30cfac]={'filename':_0x47c862[_0x1cf6('0x48')]['attachments'][_0x30cfac][_0x1cf6('0x2c')],'path':path[_0x1cf6('0x5b')](config['root'],_0x1cf6('0x5c'),_0x47c862[_0x1cf6('0x48')]['attachments'][_0x30cfac][_0x1cf6('0x5d')])};}}_0x56c10d={'account':_0x2e63dd,'message':_0x47c862['body']};return;})[_0x1cf6('0x27')](function(){if(_0x4e12ea[_0x1cf6('0x52')]){if(_0x4e12ea[_0x1cf6('0x52')][_0x1cf6('0x53')][_0x1cf6('0x36')]){return _0x4e12ea[_0x1cf6('0x52')]['Contacts'][0x0];}else{return db[_0x1cf6('0x5e')][_0x1cf6('0x4b')](_[_0x1cf6('0xd')](_0x47c862['body'],{'firstName':_0x47c862[_0x1cf6('0x48')]['to'],'email':_0x47c862[_0x1cf6('0x48')]['to'],'phone':_0x47c862[_0x1cf6('0x48')]['to'],'ListId':_0x4e12ea['ListId']}));}}else{throw new Error(_0x1cf6('0x5f'));}})['then'](function(){if(_0x56c10d){return respondWithRpcPromise('SendMail',_0x1cf6('0x60'),_0x56c10d,client9003)['then'](function(_0x4bafb6){return _0x2d52a0[_0x1cf6('0x26')]({'read':!![],'messageId':_0x4bafb6[_0x1cf6('0x61')],'sentAt':moment()[_0x1cf6('0x62')](_0x1cf6('0x63'))});})[_0x1cf6('0x45')](function(_0x2b66d2){logger['error']('%s',JSON[_0x1cf6('0x1a')](_0x2b66d2));return _0x2d52a0;});}return _0x2d52a0;});}return _0x2d52a0;}})[_0x1cf6('0x27')](respondWithResult(_0xac8756,0xc9))[_0x1cf6('0x45')](handleError(_0xac8756,null));};exports[_0x1cf6('0x64')]=function(_0x2041ba,_0x4e1e19){var _0x27154f={'agent':{},'channel':_0x1cf6('0x65')};if(_0x2041ba[_0x1cf6('0x48')]['id']){delete _0x2041ba[_0x1cf6('0x48')]['id'];}_0x2041ba[_0x1cf6('0x48')][_0x1cf6('0x66')]=!![];_0x2041ba[_0x1cf6('0x48')][_0x1cf6('0x67')]=moment()[_0x1cf6('0x62')](_0x1cf6('0x63'));_0x2041ba[_0x1cf6('0x48')][_0x1cf6('0x68')]=_0x2041ba[_0x1cf6('0x48')]['UserId']||_0x2041ba['user']['id'];_0x27154f[_0x1cf6('0x69')]['id']=_0x2041ba['body'][_0x1cf6('0x68')];return db[_0x1cf6('0x2e')][_0x1cf6('0x49')]({'where':{'id':_0x2041ba[_0x1cf6('0x46')]['id'],'UserId':null}})[_0x1cf6('0x27')](handleEntityNotFound(_0x4e1e19,null))[_0x1cf6('0x27')](saveUpdates(_0x2041ba['body'],null))[_0x1cf6('0x27')](function(_0x38af20){if(_0x38af20){_0x27154f[_0x1cf6('0x1d')]=_0x38af20[_0x1cf6('0x6a')]({'plain':!![]});return db[_0x1cf6('0x6b')]['find']({'where':{'id':_0x38af20['MailInteractionId']}});}return null;})[_0x1cf6('0x27')](handleEntityNotFound(_0x4e1e19,null))['then'](function(_0x2b4609){if(_0x2b4609){return _0x2b4609[_0x1cf6('0x26')]({'UserId':_0x2041ba[_0x1cf6('0x48')][_0x1cf6('0x68')],'read1stAt':_[_0x1cf6('0x6c')](_0x2b4609[_0x1cf6('0x6d')])?moment()[_0x1cf6('0x62')](_0x1cf6('0x63')):undefined});}return null;})[_0x1cf6('0x27')](function(_0x175929){if(_0x175929){_0x27154f[_0x1cf6('0x6e')]=_0x175929['get']({'plain':!![]});interaction_log[_0x1cf6('0x15')](_0x1cf6('0x6f'),_0x2041ba['user']['id'],_0x2041ba[_0x1cf6('0x70')][_0x1cf6('0x2c')],_0x2041ba['user'][_0x1cf6('0x71')],_0x27154f[_0x1cf6('0x6e')]['id'],_0x2041ba[_0x1cf6('0x48')]?JSON[_0x1cf6('0x1a')](_0x2041ba['body']):_0x1cf6('0x72'));return respondWithRpcPromise(_0x1cf6('0x73'),_0x1cf6('0x74'),_0x27154f);}return null;})[_0x1cf6('0x27')](function(_0x3c76da){var _0x2f139c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3c76da[_0x1cf6('0x1d')][_0x1cf6('0x75')];return db['sequelize'][_0x1cf6('0x32')](_0x2f139c,{'type':db['Sequelize'][_0x1cf6('0x76')][_0x1cf6('0x77')],'raw':!![]})[_0x1cf6('0x27')](function(_0x290a75){return _0x290a75;});})['then'](function(_0x8021f8){if(_0x8021f8){_0x27154f[_0x1cf6('0x1d')][_0x1cf6('0x78')]=_0x8021f8[0x0];if(!_0x2041ba[_0x1cf6('0x48')][_0x1cf6('0x68')])return;return db[_0x1cf6('0x79')][_0x1cf6('0x49')]({'where':{'id':_0x2041ba[_0x1cf6('0x48')][_0x1cf6('0x68')],'role':_0x1cf6('0x69')},'attributes':['id',_0x1cf6('0x2c'),_0x1cf6('0x7a'),'email',_0x1cf6('0x7b')],'raw':!![]});}return null;})[_0x1cf6('0x27')](function(_0x419322){if(!_0x419322)return null;_0x27154f[_0x1cf6('0x1d')][_0x1cf6('0x69')]=_0x419322;return _0x27154f;})[_0x1cf6('0x27')](function(_0x1218a1){if(_0x1218a1){if(_0x2041ba['body']['manual']){_0x27154f[_0x1cf6('0x1d')][_0x1cf6('0x7c')]=util[_0x1cf6('0x62')](_0x1cf6('0x7d'),_0x2041ba[_0x1cf6('0x70')][_0x1cf6('0x2c')]);_0x27154f[_0x1cf6('0x1d')]['channel']=_0x27154f['channel'];_0x27154f[_0x1cf6('0x1d')][_0x1cf6('0x7e')]=_0x27154f[_0x1cf6('0x7f')];_0x27154f[_0x1cf6('0x1d')][_0x1cf6('0x80')]=_0x1cf6('0x64');_0x27154f[_0x1cf6('0x1d')][_0x1cf6('0x48')]=htmlToText[_0x1cf6('0x81')](_0x27154f[_0x1cf6('0x1d')][_0x1cf6('0x48')]);return respondWithRpcPromise(_0x1cf6('0x82'),_0x1cf6('0x82'),{'event':'acceptmessage','message':_0x27154f[_0x1cf6('0x1d')]},client9002)[_0x1cf6('0x27')](function(){return _0x27154f;});}return _0x27154f;}return null;})[_0x1cf6('0x27')](respondWithResult(_0x4e1e19,null))[_0x1cf6('0x45')](handleError(_0x4e1e19,null));};exports[_0x1cf6('0x83')]=function(_0x2e27ba,_0x12603b){var _0x5bc141={'agent':{},'channel':_0x1cf6('0x65')};if(_0x2e27ba['body']['id']){delete _0x2e27ba[_0x1cf6('0x48')]['id'];}_0x2e27ba[_0x1cf6('0x48')][_0x1cf6('0x68')]=_0x2e27ba[_0x1cf6('0x48')][_0x1cf6('0x68')]||_0x2e27ba[_0x1cf6('0x70')]['id'];_0x5bc141[_0x1cf6('0x69')]['id']=_0x2e27ba[_0x1cf6('0x48')][_0x1cf6('0x68')];return db[_0x1cf6('0x2e')][_0x1cf6('0x49')]({'where':{'id':_0x2e27ba[_0x1cf6('0x46')]['id'],'UserId':null}})[_0x1cf6('0x27')](handleEntityNotFound(_0x12603b,null))[_0x1cf6('0x27')](function(_0x2af093){if(_0x2af093){_0x5bc141[_0x1cf6('0x1d')]=_0x2af093[_0x1cf6('0x6a')]({'plain':!![]});return db[_0x1cf6('0x6b')]['find']({'where':{'id':_0x2af093[_0x1cf6('0x84')]}});}return null;})['then'](handleEntityNotFound(_0x12603b,null))['then'](function(_0x2ebc85){if(_0x2ebc85){_0x5bc141[_0x1cf6('0x6e')]=_0x2ebc85[_0x1cf6('0x6a')]({'plain':!![]});interaction_log['info'](_0x1cf6('0x85'),_0x2e27ba[_0x1cf6('0x70')]['id'],_0x2e27ba['user'][_0x1cf6('0x2c')],_0x2e27ba[_0x1cf6('0x70')][_0x1cf6('0x71')],_0x5bc141['interaction']['id'],_0x2e27ba[_0x1cf6('0x48')]?JSON[_0x1cf6('0x1a')](_0x2e27ba['body']):_0x1cf6('0x72'));return respondWithRpcPromise(_0x1cf6('0x86'),'rejectMessage',_0x5bc141);}return null;})[_0x1cf6('0x27')](function(_0x8b0c56){var _0x46d467='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x8b0c56[_0x1cf6('0x1d')][_0x1cf6('0x75')];return db[_0x1cf6('0x87')][_0x1cf6('0x32')](_0x46d467,{'type':db[_0x1cf6('0x88')][_0x1cf6('0x76')][_0x1cf6('0x77')],'raw':!![]})[_0x1cf6('0x27')](function(_0x321270){return _0x321270;});})[_0x1cf6('0x27')](function(_0x3428d3){if(_0x3428d3){_0x5bc141[_0x1cf6('0x1d')][_0x1cf6('0x78')]=_0x3428d3[0x0];if(!_0x2e27ba['body']['UserId'])return;return db['User'][_0x1cf6('0x49')]({'where':{'id':_0x2e27ba[_0x1cf6('0x48')]['UserId'],'role':_0x1cf6('0x69')},'attributes':['id',_0x1cf6('0x2c'),_0x1cf6('0x7a'),_0x1cf6('0x89'),_0x1cf6('0x7b')],'raw':!![]});}return null;})['then'](function(_0x30aee7){if(!_0x30aee7)return null;_0x5bc141[_0x1cf6('0x1d')][_0x1cf6('0x69')]=_0x30aee7;return _0x5bc141;})[_0x1cf6('0x27')](function(_0x45698b){if(_0x45698b){_0x45698b[_0x1cf6('0x1d')]['interface']=util[_0x1cf6('0x62')](_0x1cf6('0x7d'),_0x2e27ba[_0x1cf6('0x70')]['name']);_0x45698b['message'][_0x1cf6('0x7f')]=_0x5bc141['channel'];_0x45698b[_0x1cf6('0x1d')]['motionChannel']=_0x5bc141['channel'];_0x45698b[_0x1cf6('0x1d')][_0x1cf6('0x80')]=_0x1cf6('0x83');_0x45698b['message'][_0x1cf6('0x48')]=htmlToText['fromString'](_0x5bc141['message'][_0x1cf6('0x48')]);respondWithRpcPromise('EventManager',_0x1cf6('0x82'),{'event':'rejectmessage','message':_0x45698b[_0x1cf6('0x1d')]},client9002);return _0x5bc141;}return null;})['then'](respondWithResult(_0x12603b,null))['catch'](handleError(_0x12603b,null));};exports['download']=function(_0x14b26d,_0x48b0c6){var _0x5b6498=moment()[_0x1cf6('0x8a')]()['toString']();var _0x1e4a9a=path['join'](config['root'],_0x1cf6('0x8b'),_0x1cf6('0x8c'),_0x1cf6('0x8d'));var _0x5894a1=path[_0x1cf6('0x5b')](config['root'],_0x1cf6('0x8b'),_0x1cf6('0x8c'),_0x1cf6('0x5a'));var _0x15d386=util['format'](_0x1cf6('0x8e'),_0x5b6498);return db[_0x1cf6('0x2e')][_0x1cf6('0x49')]({'where':{'id':_0x14b26d[_0x1cf6('0x46')]['id']},'attributes':['id',_0x1cf6('0x48'),'from','to','cc','bcc',_0x1cf6('0x8f'),'createdAt'],'include':_0x14b26d[_0x1cf6('0x32')][_0x1cf6('0x5a')]?[{'model':db[_0x1cf6('0x90')],'as':_0x1cf6('0x91')}]:undefined})[_0x1cf6('0x27')](handleEntityNotFound(_0x48b0c6,null))[_0x1cf6('0x27')](function(_0x15811f){if(_0x15811f){var _0x32293b=_0x15811f;var _0x2f4af0={'from':_0x32293b[_0x1cf6('0x92')],'to':_0x32293b['to'],'subject':_0x32293b[_0x1cf6('0x8f')],'html':htmlEntities[_0x1cf6('0x93')](_0x32293b[_0x1cf6('0x48')]),'headers':{'Date':moment(_0x32293b[_0x1cf6('0x94')])[_0x1cf6('0x62')](_0x1cf6('0x95'))},'attachments':[]};if(_0x15811f['cc']){_0x2f4af0[_0x1cf6('0x96')]['Cc']=_0x15811f['cc'];}if(_0x15811f[_0x1cf6('0x97')]){_0x2f4af0[_0x1cf6('0x96')]['Bcc']=_0x15811f['bcc'];}return new BPromise(function(_0x432c88,_0x11e564){if(_0x15811f[_0x1cf6('0x91')]){for(var _0x687bb8=0x0;_0x687bb8<_0x15811f[_0x1cf6('0x91')][_0x1cf6('0x36')];_0x687bb8++){var _0x303c3e=_0x15811f[_0x1cf6('0x91')][_0x687bb8];var _0x1aec9c=path[_0x1cf6('0x5b')](_0x5894a1,_0x303c3e[_0x1cf6('0x5d')]);if(fs[_0x1cf6('0x98')](_0x1aec9c)){_0x2f4af0[_0x1cf6('0x5a')][_0x1cf6('0x99')]({'name':_0x303c3e[_0x1cf6('0x2c')],'contentType':_0x303c3e[_0x1cf6('0x40')],'data':fs[_0x1cf6('0x9a')](_0x1aec9c)});}}}emlformat[_0x1cf6('0x9b')](_0x2f4af0,function(_0x46acbd,_0xfbe524){if(_0x46acbd)return _0x11e564(_0x46acbd);fs[_0x1cf6('0x9c')](path[_0x1cf6('0x5b')](_0x1e4a9a,_0x15d386),_0xfbe524);return _0x432c88(_0xfbe524);});});}})[_0x1cf6('0x27')](function(_0x23d891){if(_0x23d891){return _0x48b0c6[_0x1cf6('0x9d')](path[_0x1cf6('0x5b')](_0x1e4a9a,_0x15d386),_0x15d386,function(_0x3a5ae2){if(!_0x3a5ae2)fs[_0x1cf6('0x9e')](path['join'](_0x1e4a9a,_0x15d386));});}})[_0x1cf6('0x45')](handleError(_0x48b0c6,null));}; \ No newline at end of file +var _0xdb71=['lodash','ioredis','html-to-text','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','offset','undefined','limit','count','set','json','then','destroy','end','stack','name','send','index','MailMessage','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','update','body','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','CloudProvider','attachments','join','server/files/attachments','defaults','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','UserId','user','agent','get','MailInteractionId','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','QueryTypes','SELECT','contact','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','mail','MailInteraction','rejectMessage','internal','reject','rejectmessage','download','unix','toString','root','server','files','tmp','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment'];(function(_0x1c3b1b,_0xbacb42){var _0x4ec334=function(_0x545b38){while(--_0x545b38){_0x1c3b1b['push'](_0x1c3b1b['shift']());}};_0x4ec334(++_0xbacb42);}(_0xdb71,0x1c9));var _0x1db7=function(_0x2aee0a,_0x3e5333){_0x2aee0a=_0x2aee0a-0x0;var _0x2362f5=_0xdb71[_0x2aee0a];return _0x2362f5;};'use strict';var emlformat=require(_0x1db7('0x0'));var moment=require(_0x1db7('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x1db7('0x2'));var Redis=require(_0x1db7('0x3'));var htmlToText=require(_0x1db7('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var interaction_log=require(_0x1db7('0x5'))(_0x1db7('0x6'));var config=require(_0x1db7('0x7'));var db=require(_0x1db7('0x8'))['db'];config['redis']=_['defaults'](config[_0x1db7('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x1db7('0xa')](socket);var jayson=require(_0x1db7('0xb'));var client=jayson['client'][_0x1db7('0xc')]({'port':0x232c});var client9003=jayson[_0x1db7('0xd')][_0x1db7('0xc')]({'port':0x232b});var client9002=jayson[_0x1db7('0xd')][_0x1db7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e0789,_0x1d1520,_0x40a480,_0x2d5dc5){return new BPromise(function(_0x4e3cfa,_0x5d7a1b){var _0x497a6d=_0x2d5dc5||client;return _0x497a6d[_0x1db7('0xe')](_0x4e0789,_0x40a480)['then'](function(_0x2fc59e){logger[_0x1db7('0xf')](_0x1db7('0x10'),_0x1d1520,_0x1db7('0x11'));logger[_0x1db7('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1d1520,'request\x20sent',JSON[_0x1db7('0x13')](_0x2fc59e));if(_0x2fc59e[_0x1db7('0x14')]){if(_0x2fc59e['error'][_0x1db7('0x15')]===0x1f4){logger[_0x1db7('0x14')](_0x1db7('0x10'),_0x1d1520,_0x2fc59e[_0x1db7('0x14')][_0x1db7('0x16')]);return _0x5d7a1b(_0x2fc59e['error'][_0x1db7('0x16')]);}logger['error'](_0x1db7('0x10'),_0x1d1520,_0x2fc59e['error'][_0x1db7('0x16')]);return _0x4e3cfa(_0x2fc59e[_0x1db7('0x14')][_0x1db7('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x1d1520,_0x1db7('0x11'));_0x4e3cfa(_0x2fc59e['result'][_0x1db7('0x16')]);}})[_0x1db7('0x17')](function(_0x22d8ba){logger[_0x1db7('0x14')]('MailMessage,\x20%s,\x20%s',_0x1d1520,_0x22d8ba);_0x5d7a1b(_0x22d8ba);});});}function respondWithResult(_0x3db2d5,_0xd36b50){_0xd36b50=_0xd36b50||0xc8;return function(_0x5d4b6d){if(_0x5d4b6d){return _0x3db2d5[_0x1db7('0x18')](_0xd36b50)['json'](_0x5d4b6d);}};}function respondWithFilteredResult(_0x15a3f0,_0x4997ab){return function(_0x2f5f57){if(_0x2f5f57){var _0x15facb=typeof _0x4997ab[_0x1db7('0x19')]===_0x1db7('0x1a')&&typeof _0x4997ab[_0x1db7('0x1b')]==='undefined';var _0x22f864=_0x2f5f57[_0x1db7('0x1c')];var _0x53bc23=_0x15facb?0x0:_0x4997ab[_0x1db7('0x19')];var _0x2bd1c2=_0x15facb?_0x2f5f57[_0x1db7('0x1c')]:_0x4997ab[_0x1db7('0x19')]+_0x4997ab[_0x1db7('0x1b')];var _0x277e0a;if(_0x2bd1c2>=_0x22f864){_0x2bd1c2=_0x22f864;_0x277e0a=0xc8;}else{_0x277e0a=0xce;}_0x15a3f0['status'](_0x277e0a);return _0x15a3f0[_0x1db7('0x1d')]('Content-Range',_0x53bc23+'-'+_0x2bd1c2+'/'+_0x22f864)[_0x1db7('0x1e')](_0x2f5f57);}return null;};}function saveUpdates(_0x1f526b){return function(_0xb1be79){if(_0xb1be79){return _0xb1be79['update'](_0x1f526b)[_0x1db7('0x1f')](function(_0x12ba6b){return _0x12ba6b;});}return null;};}function removeEntity(_0x5d840b){return function(_0x451312){if(_0x451312){return _0x451312[_0x1db7('0x20')]()[_0x1db7('0x1f')](function(){_0x5d840b[_0x1db7('0x18')](0xcc)[_0x1db7('0x21')]();});}};}function handleEntityNotFound(_0x6bf42b){return function(_0x39a03a){if(!_0x39a03a){_0x6bf42b['sendStatus'](0x194);}return _0x39a03a;};}function handleError(_0x384a22,_0x2b2302){_0x2b2302=_0x2b2302||0x1f4;return function(_0x5f280f){logger['error'](_0x5f280f[_0x1db7('0x22')]);if(_0x5f280f[_0x1db7('0x23')]){delete _0x5f280f[_0x1db7('0x23')];}_0x384a22[_0x1db7('0x18')](_0x2b2302)[_0x1db7('0x24')](_0x5f280f);};}exports[_0x1db7('0x25')]=function(_0x753832,_0x512739){var _0x26a2fc={},_0x2102c9={},_0x4384f0={'count':0x0,'rows':[]};var _0x1b2a4d=_['map'](db[_0x1db7('0x26')][_0x1db7('0x27')],function(_0x33385f){return{'name':_0x33385f[_0x1db7('0x28')],'type':_0x33385f['type'][_0x1db7('0x29')]};});_0x2102c9[_0x1db7('0x2a')]=_[_0x1db7('0x2b')](_0x1b2a4d,_0x1db7('0x23'));_0x2102c9[_0x1db7('0x2c')]=_[_0x1db7('0x2d')](_0x753832[_0x1db7('0x2c')]);_0x2102c9['filters']=_[_0x1db7('0x2e')](_0x2102c9[_0x1db7('0x2a')],_0x2102c9[_0x1db7('0x2c')]);_0x26a2fc[_0x1db7('0x2f')]=_[_0x1db7('0x2e')](_0x2102c9[_0x1db7('0x2a')],qs[_0x1db7('0x30')](_0x753832[_0x1db7('0x2c')][_0x1db7('0x30')]));_0x26a2fc[_0x1db7('0x2f')]=_0x26a2fc['attributes'][_0x1db7('0x31')]?_0x26a2fc[_0x1db7('0x2f')]:_0x2102c9[_0x1db7('0x2a')];if(!_0x753832[_0x1db7('0x2c')][_0x1db7('0x32')](_0x1db7('0x33'))){_0x26a2fc[_0x1db7('0x1b')]=qs[_0x1db7('0x1b')](_0x753832['query']['limit']);_0x26a2fc[_0x1db7('0x19')]=qs['offset'](_0x753832['query'][_0x1db7('0x19')]);}_0x26a2fc[_0x1db7('0x34')]=qs[_0x1db7('0x35')](_0x753832['query'][_0x1db7('0x35')]);_0x26a2fc[_0x1db7('0x36')]=qs[_0x1db7('0x37')](_[_0x1db7('0x38')](_0x753832[_0x1db7('0x2c')],_0x2102c9[_0x1db7('0x37')]),_0x1b2a4d);if(_0x753832[_0x1db7('0x2c')][_0x1db7('0x39')]){_0x26a2fc[_0x1db7('0x36')]=_[_0x1db7('0x3a')](_0x26a2fc[_0x1db7('0x36')],{'$or':_[_0x1db7('0x2b')](_0x1b2a4d,function(_0x535488){if(_0x535488[_0x1db7('0x3b')]!==_0x1db7('0x3c')){var _0x1bc84f={};_0x1bc84f[_0x535488[_0x1db7('0x23')]]={'$like':'%'+_0x753832['query']['filter']+'%'};return _0x1bc84f;}})});}_0x26a2fc=_[_0x1db7('0x3a')]({},_0x26a2fc,_0x753832[_0x1db7('0x3d')]);var _0x53c472={'where':_0x26a2fc[_0x1db7('0x36')]};return db[_0x1db7('0x26')][_0x1db7('0x1c')](_0x53c472)[_0x1db7('0x1f')](function(_0x271a7a){_0x4384f0[_0x1db7('0x1c')]=_0x271a7a;if(_0x753832['query'][_0x1db7('0x3e')]){_0x26a2fc[_0x1db7('0x3f')]=[{'all':!![]}];}return db[_0x1db7('0x26')]['findAll'](_0x26a2fc);})[_0x1db7('0x1f')](function(_0xb0e5f0){_0x4384f0[_0x1db7('0x40')]=_0xb0e5f0;return _0x4384f0;})[_0x1db7('0x1f')](respondWithFilteredResult(_0x512739,_0x26a2fc))[_0x1db7('0x17')](handleError(_0x512739,null));};exports[_0x1db7('0x41')]=function(_0xb6b737,_0x30af9f){var _0x2351cc={'raw':!![],'where':{'id':_0xb6b737[_0x1db7('0x42')]['id']}},_0x38cfb3={};_0x38cfb3[_0x1db7('0x2a')]=_[_0x1db7('0x2d')](db[_0x1db7('0x26')][_0x1db7('0x27')]);_0x38cfb3['query']=_[_0x1db7('0x2d')](_0xb6b737['query']);_0x38cfb3[_0x1db7('0x37')]=_[_0x1db7('0x2e')](_0x38cfb3['model'],_0x38cfb3[_0x1db7('0x2c')]);_0x2351cc[_0x1db7('0x2f')]=_[_0x1db7('0x2e')](_0x38cfb3['model'],qs['fields'](_0xb6b737['query'][_0x1db7('0x30')]));_0x2351cc[_0x1db7('0x2f')]=_0x2351cc[_0x1db7('0x2f')][_0x1db7('0x31')]?_0x2351cc[_0x1db7('0x2f')]:_0x38cfb3[_0x1db7('0x2a')];if(_0xb6b737['query'][_0x1db7('0x3e')]){_0x2351cc[_0x1db7('0x3f')]=[{'all':!![]}];}_0x2351cc=_[_0x1db7('0x3a')]({},_0x2351cc,_0xb6b737[_0x1db7('0x3d')]);return db[_0x1db7('0x26')][_0x1db7('0x43')](_0x2351cc)[_0x1db7('0x1f')](handleEntityNotFound(_0x30af9f,null))['then'](respondWithResult(_0x30af9f,null))[_0x1db7('0x17')](handleError(_0x30af9f,null));};exports[_0x1db7('0x44')]=function(_0x3a41cd,_0x3a87da){if(_0x3a41cd[_0x1db7('0x45')]['id']){delete _0x3a41cd[_0x1db7('0x45')]['id'];}return db[_0x1db7('0x26')]['find']({'where':{'id':_0x3a41cd[_0x1db7('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a87da,null))['then'](saveUpdates(_0x3a41cd['body'],null))[_0x1db7('0x1f')](respondWithResult(_0x3a87da,null))[_0x1db7('0x17')](handleError(_0x3a87da,null));};exports[_0x1db7('0x20')]=function(_0xa68037,_0x5d3d1d){return db['MailMessage'][_0x1db7('0x43')]({'where':{'id':_0xa68037[_0x1db7('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d3d1d,null))[_0x1db7('0x1f')](removeEntity(_0x5d3d1d,null))[_0x1db7('0x17')](handleError(_0x5d3d1d,null));};exports[_0x1db7('0x46')]=function(_0x177fc8,_0x17c678){return db[_0x1db7('0x26')]['describe']()[_0x1db7('0x1f')](respondWithResult(_0x17c678,null))[_0x1db7('0x17')](handleError(_0x17c678,null));};exports[_0x1db7('0x47')]=function(_0x5db859,_0x40ce97){return db['MailMessage'][_0x1db7('0x47')](_0x5db859['body'])[_0x1db7('0x1f')](function(_0x105e2a){if(_0x105e2a){if(_0x105e2a[_0x1db7('0x48')]===_0x1db7('0x49')&&!_0x105e2a[_0x1db7('0x4a')]){var _0x48563a,_0x5aafa7,_0x142525;if(_0x5db859[_0x1db7('0x45')]['to']){_0x5aafa7=_0x5db859[_0x1db7('0x45')]['to'][_0x1db7('0x4b')](',')[0x0];}return db['MailAccount'][_0x1db7('0x4c')]({'where':{'id':_0x105e2a[_0x1db7('0x4d')]},'include':[{'model':db[_0x1db7('0x4e')],'as':_0x1db7('0x4f'),'include':[{'model':db[_0x1db7('0x50')],'as':_0x1db7('0x51'),'where':{'email':_0x5aafa7},'limit':0x1,'order':[[_0x1db7('0x52'),'DESC']]}]},{'model':db[_0x1db7('0x53')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1db7('0x54')],'as':_0x1db7('0x54'),'raw':!![]}]}]})[_0x1db7('0x1f')](function(_0x54cb60){_0x48563a=_0x54cb60;if(!_0x48563a||!_0x48563a['Smtp'])return;var _0x2b3f75=_0x48563a['getSmtpOptions']();if(_0x5db859[_0x1db7('0x45')]['attachments']&&_0x5db859[_0x1db7('0x45')][_0x1db7('0x55')][_0x1db7('0x31')]){for(var _0x1566a7=0x0;_0x1566a7<_0x5db859[_0x1db7('0x45')][_0x1db7('0x55')][_0x1db7('0x31')];_0x1566a7+=0x1){_0x5db859[_0x1db7('0x45')][_0x1db7('0x55')][_0x1566a7]={'filename':_0x5db859[_0x1db7('0x45')][_0x1db7('0x55')][_0x1566a7][_0x1db7('0x23')],'path':path[_0x1db7('0x56')](config['root'],_0x1db7('0x57'),_0x5db859[_0x1db7('0x45')]['attachments'][_0x1566a7]['basename'])};}}_0x142525={'account':_0x2b3f75,'message':_0x5db859['body']};return;})[_0x1db7('0x1f')](function(){if(_0x48563a[_0x1db7('0x4f')]){if(_0x48563a[_0x1db7('0x4f')][_0x1db7('0x51')]['length']){return _0x48563a['List'][_0x1db7('0x51')][0x0];}else{return db['CmContact'][_0x1db7('0x47')](_[_0x1db7('0x58')](_0x5db859[_0x1db7('0x45')],{'firstName':_0x5db859['body']['to'],'email':_0x5db859[_0x1db7('0x45')]['to'],'phone':_0x5db859[_0x1db7('0x45')]['to'],'ListId':_0x48563a['ListId']}));}}else{throw new Error(_0x1db7('0x59'));}})['then'](function(){if(_0x142525){return respondWithRpcPromise(_0x1db7('0x5a'),_0x1db7('0x5b'),_0x142525,client9003)[_0x1db7('0x1f')](function(_0x199432){return _0x105e2a[_0x1db7('0x44')]({'read':!![],'messageId':_0x199432['messageId'],'sentAt':moment()[_0x1db7('0x5c')](_0x1db7('0x5d'))});})[_0x1db7('0x17')](function(_0x116c08){logger[_0x1db7('0x14')]('%s',JSON['stringify'](_0x116c08));return _0x105e2a;});}return _0x105e2a;});}return _0x105e2a;}})['then'](respondWithResult(_0x40ce97,0xc9))[_0x1db7('0x17')](handleError(_0x40ce97,null));};exports[_0x1db7('0x5e')]=function(_0x44590d,_0x1832a5){var _0x2af496={'agent':{},'channel':'mail'};if(_0x44590d[_0x1db7('0x45')]['id']){delete _0x44590d[_0x1db7('0x45')]['id'];}_0x44590d[_0x1db7('0x45')][_0x1db7('0x5f')]=!![];_0x44590d[_0x1db7('0x45')]['readAt']=moment()['format'](_0x1db7('0x5d'));_0x44590d[_0x1db7('0x45')][_0x1db7('0x60')]=_0x44590d['body'][_0x1db7('0x60')]||_0x44590d[_0x1db7('0x61')]['id'];_0x2af496[_0x1db7('0x62')]['id']=_0x44590d['body'][_0x1db7('0x60')];return db[_0x1db7('0x26')][_0x1db7('0x43')]({'where':{'id':_0x44590d[_0x1db7('0x42')]['id'],'UserId':null}})[_0x1db7('0x1f')](handleEntityNotFound(_0x1832a5,null))[_0x1db7('0x1f')](saveUpdates(_0x44590d[_0x1db7('0x45')],null))[_0x1db7('0x1f')](function(_0x424879){if(_0x424879){_0x2af496[_0x1db7('0x16')]=_0x424879[_0x1db7('0x63')]({'plain':!![]});return db['MailInteraction'][_0x1db7('0x43')]({'where':{'id':_0x424879[_0x1db7('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x1832a5,null))['then'](function(_0x38ff68){if(_0x38ff68){return _0x38ff68[_0x1db7('0x44')]({'UserId':_0x44590d['body'][_0x1db7('0x60')],'read1stAt':_[_0x1db7('0x65')](_0x38ff68['read1stAt'])?moment()[_0x1db7('0x5c')](_0x1db7('0x5d')):undefined});}return null;})[_0x1db7('0x1f')](function(_0x1359d8){if(_0x1359d8){_0x2af496['interaction']=_0x1359d8['get']({'plain':!![]});interaction_log[_0x1db7('0xf')](_0x1db7('0x66'),_0x44590d[_0x1db7('0x61')]['id'],_0x44590d[_0x1db7('0x61')][_0x1db7('0x23')],_0x44590d[_0x1db7('0x61')][_0x1db7('0x67')],_0x2af496[_0x1db7('0x68')]['id'],_0x44590d['body']?JSON[_0x1db7('0x13')](_0x44590d[_0x1db7('0x45')]):_0x1db7('0x69'));return respondWithRpcPromise(_0x1db7('0x6a'),_0x1db7('0x6b'),_0x2af496);}return null;})['then'](function(_0x21d01c){var _0x2fdffa=_0x1db7('0x6c')+_0x21d01c[_0x1db7('0x16')][_0x1db7('0x6d')];return db[_0x1db7('0x6e')][_0x1db7('0x2c')](_0x2fdffa,{'type':db['Sequelize'][_0x1db7('0x6f')][_0x1db7('0x70')],'raw':!![]})[_0x1db7('0x1f')](function(_0x367ed1){return _0x367ed1;});})['then'](function(_0x3578e3){if(_0x3578e3){_0x2af496[_0x1db7('0x16')][_0x1db7('0x71')]=_0x3578e3[0x0];if(!_0x44590d['body'][_0x1db7('0x60')])return;return db[_0x1db7('0x72')]['find']({'where':{'id':_0x44590d[_0x1db7('0x45')][_0x1db7('0x60')],'role':'agent'},'attributes':['id',_0x1db7('0x23'),_0x1db7('0x73'),'email','internal'],'raw':!![]});}return null;})[_0x1db7('0x1f')](function(_0x4ea679){if(!_0x4ea679)return null;_0x2af496[_0x1db7('0x16')][_0x1db7('0x62')]=_0x4ea679;return _0x2af496;})[_0x1db7('0x1f')](function(_0x80d96a){if(_0x80d96a){if(_0x44590d['body'][_0x1db7('0x74')]){_0x2af496[_0x1db7('0x16')][_0x1db7('0x75')]=util[_0x1db7('0x5c')](_0x1db7('0x76'),_0x44590d['user']['name']);_0x2af496[_0x1db7('0x16')][_0x1db7('0x77')]=_0x2af496[_0x1db7('0x77')];_0x2af496['message'][_0x1db7('0x78')]=_0x2af496['channel'];_0x2af496[_0x1db7('0x16')][_0x1db7('0x79')]=_0x1db7('0x5e');_0x2af496[_0x1db7('0x16')][_0x1db7('0x45')]=htmlToText[_0x1db7('0x7a')](_0x2af496['message'][_0x1db7('0x45')]);return respondWithRpcPromise('EventManager',_0x1db7('0x7b'),{'event':_0x1db7('0x7c'),'message':_0x2af496[_0x1db7('0x16')]},client9002)[_0x1db7('0x1f')](function(){return _0x2af496;});}return _0x2af496;}return null;})['then'](respondWithResult(_0x1832a5,null))[_0x1db7('0x17')](handleError(_0x1832a5,null));};exports['reject']=function(_0x5f92be,_0x35e8ce){var _0x5b7823={'agent':{},'channel':_0x1db7('0x7d')};if(_0x5f92be[_0x1db7('0x45')]['id']){delete _0x5f92be[_0x1db7('0x45')]['id'];}_0x5f92be[_0x1db7('0x45')]['UserId']=_0x5f92be['body'][_0x1db7('0x60')]||_0x5f92be[_0x1db7('0x61')]['id'];_0x5b7823[_0x1db7('0x62')]['id']=_0x5f92be[_0x1db7('0x45')][_0x1db7('0x60')];return db[_0x1db7('0x26')][_0x1db7('0x43')]({'where':{'id':_0x5f92be[_0x1db7('0x42')]['id'],'UserId':null}})[_0x1db7('0x1f')](handleEntityNotFound(_0x35e8ce,null))[_0x1db7('0x1f')](function(_0x1031c4){if(_0x1031c4){_0x5b7823[_0x1db7('0x16')]=_0x1031c4['get']({'plain':!![]});return db[_0x1db7('0x7e')][_0x1db7('0x43')]({'where':{'id':_0x1031c4['MailInteractionId']}});}return null;})[_0x1db7('0x1f')](handleEntityNotFound(_0x35e8ce,null))[_0x1db7('0x1f')](function(_0x4d99fe){if(_0x4d99fe){_0x5b7823[_0x1db7('0x68')]=_0x4d99fe[_0x1db7('0x63')]({'plain':!![]});interaction_log[_0x1db7('0xf')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5f92be[_0x1db7('0x61')]['id'],_0x5f92be[_0x1db7('0x61')][_0x1db7('0x23')],_0x5f92be[_0x1db7('0x61')]['role'],_0x5b7823[_0x1db7('0x68')]['id'],_0x5f92be[_0x1db7('0x45')]?JSON[_0x1db7('0x13')](_0x5f92be[_0x1db7('0x45')]):'null');return respondWithRpcPromise('RejectMessage',_0x1db7('0x7f'),_0x5b7823);}return null;})['then'](function(_0x16a0d6){var _0x51a6ef=_0x1db7('0x6c')+_0x16a0d6[_0x1db7('0x16')][_0x1db7('0x6d')];return db[_0x1db7('0x6e')][_0x1db7('0x2c')](_0x51a6ef,{'type':db['Sequelize'][_0x1db7('0x6f')][_0x1db7('0x70')],'raw':!![]})[_0x1db7('0x1f')](function(_0x598bad){return _0x598bad;});})[_0x1db7('0x1f')](function(_0xa44d77){if(_0xa44d77){_0x5b7823[_0x1db7('0x16')]['contact']=_0xa44d77[0x0];if(!_0x5f92be[_0x1db7('0x45')][_0x1db7('0x60')])return;return db['User'][_0x1db7('0x43')]({'where':{'id':_0x5f92be[_0x1db7('0x45')][_0x1db7('0x60')],'role':_0x1db7('0x62')},'attributes':['id',_0x1db7('0x23'),_0x1db7('0x73'),'email',_0x1db7('0x80')],'raw':!![]});}return null;})[_0x1db7('0x1f')](function(_0x4beb4a){if(!_0x4beb4a)return null;_0x5b7823[_0x1db7('0x16')][_0x1db7('0x62')]=_0x4beb4a;return _0x5b7823;})[_0x1db7('0x1f')](function(_0x4552d3){if(_0x4552d3){_0x4552d3[_0x1db7('0x16')][_0x1db7('0x75')]=util[_0x1db7('0x5c')](_0x1db7('0x76'),_0x5f92be[_0x1db7('0x61')][_0x1db7('0x23')]);_0x4552d3[_0x1db7('0x16')][_0x1db7('0x77')]=_0x5b7823[_0x1db7('0x77')];_0x4552d3[_0x1db7('0x16')][_0x1db7('0x78')]=_0x5b7823['channel'];_0x4552d3[_0x1db7('0x16')][_0x1db7('0x79')]=_0x1db7('0x81');_0x4552d3[_0x1db7('0x16')][_0x1db7('0x45')]=htmlToText[_0x1db7('0x7a')](_0x5b7823[_0x1db7('0x16')]['body']);respondWithRpcPromise('EventManager',_0x1db7('0x7b'),{'event':_0x1db7('0x82'),'message':_0x4552d3[_0x1db7('0x16')]},client9002);return _0x5b7823;}return null;})[_0x1db7('0x1f')](respondWithResult(_0x35e8ce,null))[_0x1db7('0x17')](handleError(_0x35e8ce,null));};exports[_0x1db7('0x83')]=function(_0x30ce57,_0x58988e){var _0x1ab32b=moment()[_0x1db7('0x84')]()[_0x1db7('0x85')]();var _0x26c3a0=path[_0x1db7('0x56')](config[_0x1db7('0x86')],_0x1db7('0x87'),_0x1db7('0x88'),_0x1db7('0x89'));var _0x433ce2=path[_0x1db7('0x56')](config['root'],_0x1db7('0x87'),_0x1db7('0x88'),_0x1db7('0x55'));var _0x5338a4=util[_0x1db7('0x5c')]('message-%s.eml',_0x1ab32b);return db[_0x1db7('0x26')][_0x1db7('0x43')]({'where':{'id':_0x30ce57[_0x1db7('0x42')]['id']},'attributes':['id','body','from','to','cc',_0x1db7('0x8a'),_0x1db7('0x8b'),_0x1db7('0x8c')],'include':_0x30ce57[_0x1db7('0x2c')][_0x1db7('0x55')]?[{'model':db[_0x1db7('0x8d')],'as':_0x1db7('0x8e')}]:undefined})[_0x1db7('0x1f')](handleEntityNotFound(_0x58988e,null))[_0x1db7('0x1f')](function(_0x241abe){if(_0x241abe){var _0x39acd7=_0x241abe;var _0x1ea1da={'from':_0x39acd7[_0x1db7('0x8f')],'to':_0x39acd7['to'],'subject':_0x39acd7[_0x1db7('0x8b')],'html':htmlEntities['decode'](_0x39acd7['body']),'headers':{'Date':moment(_0x39acd7['createdAt'])['format'](_0x1db7('0x90'))},'attachments':[]};if(_0x241abe['cc']){_0x1ea1da['headers']['Cc']=_0x241abe['cc'];}if(_0x241abe[_0x1db7('0x8a')]){_0x1ea1da[_0x1db7('0x91')]['Bcc']=_0x241abe[_0x1db7('0x8a')];}return new BPromise(function(_0x2ef551,_0xa54bff){if(_0x241abe[_0x1db7('0x8e')]){for(var _0x2fadf0=0x0;_0x2fadf0<_0x241abe[_0x1db7('0x8e')]['length'];_0x2fadf0++){var _0x528c68=_0x241abe[_0x1db7('0x8e')][_0x2fadf0];var _0x47d24d=path[_0x1db7('0x56')](_0x433ce2,_0x528c68[_0x1db7('0x92')]);if(fs[_0x1db7('0x93')](_0x47d24d)){_0x1ea1da['attachments'][_0x1db7('0x94')]({'name':_0x528c68['name'],'contentType':_0x528c68[_0x1db7('0x3b')],'data':fs[_0x1db7('0x95')](_0x47d24d)});}}}emlformat[_0x1db7('0x96')](_0x1ea1da,function(_0x515ad1,_0xeb33c){if(_0x515ad1)return _0xa54bff(_0x515ad1);fs[_0x1db7('0x97')](path[_0x1db7('0x56')](_0x26c3a0,_0x5338a4),_0xeb33c);return _0x2ef551(_0xeb33c);});});}})[_0x1db7('0x1f')](function(_0x145d09){if(_0x145d09){return _0x58988e['download'](path['join'](_0x26c3a0,_0x5338a4),_0x5338a4,function(_0x2afb61){if(!_0x2afb61)fs[_0x1db7('0x98')](path['join'](_0x26c3a0,_0x5338a4));});}})['catch'](handleError(_0x58988e,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8bd295d..51eedd6 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 _0x76de=['events','../../mysqldb','update','emit'];(function(_0x286305,_0x413532){var _0x130437=function(_0x4c8f4a){while(--_0x4c8f4a){_0x286305['push'](_0x286305['shift']());}};_0x130437(++_0x413532);}(_0x76de,0x74));var _0xe76d=function(_0x45174f,_0x22995d){_0x45174f=_0x45174f-0x0;var _0x2add9e=_0x76de[_0x45174f];return _0x2add9e;};'use strict';var EventEmitter=require(_0xe76d('0x0'));var MailMessage=require(_0xe76d('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe76d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4e50ac){return function(_0x205a45,_0xc3c17d,_0x2c4947){MailMessageEvents['emit'](_0x4e50ac+':'+_0x205a45['id'],_0x205a45);MailMessageEvents[_0xe76d('0x3')](_0x4e50ac,_0x205a45);_0x2c4947(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xf432=['hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf432,0x1bb));var _0x2f43=function(_0x2f23c6,_0x8eacbc){_0x2f23c6=_0x2f23c6-0x0;var _0x12e26a=_0xf432[_0x2f23c6];return _0x12e26a;};'use strict';var EventEmitter=require(_0x2f43('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x2f43('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2f43('0x2')](0x0);var events={'afterCreate':_0x2f43('0x3'),'afterUpdate':_0x2f43('0x4'),'afterDestroy':_0x2f43('0x5')};function emitEvent(_0x2d3c17){return function(_0x4c1da7,_0xadf316,_0x5f4bd8){MailMessageEvents['emit'](_0x2d3c17+':'+_0x4c1da7['id'],_0x4c1da7);MailMessageEvents[_0x2f43('0x6')](_0x2d3c17,_0x4c1da7);_0x5f4bd8(null);};}for(var e in events){if(events[_0x2f43('0x7')](e)){var event=events[e];MailMessage[_0x2f43('0x8')](e,emitEvent(event));}}module[_0x2f43('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 debcc93..30a29db 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 _0x433a=['request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','fromString','body','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','update','catch','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0x433a,0x165));var _0xa433=function(_0x207d91,_0x15bc96){_0x207d91=_0x207d91-0x0;var _0x73c4c9=_0x433a[_0x207d91];return _0x73c4c9;};'use strict';var _=require(_0xa433('0x0'));var util=require('util');var logger=require(_0xa433('0x1'))('api');var moment=require(_0xa433('0x2'));var BPromise=require('bluebird');var rp=require(_0xa433('0x3'));var htmlToText=require(_0xa433('0x4'));var fs=require('fs');var path=require(_0xa433('0x5'));var rimraf=require(_0xa433('0x6'));var config=require(_0xa433('0x7'));var attributes=require('./mailMessage.attributes');module[_0xa433('0x8')]=function(_0x5add26,_0x44ed92){return _0x5add26[_0xa433('0x9')](_0xa433('0xa'),attributes,{'tableName':_0xa433('0xb'),'paranoid':![],'indexes':[{'name':_0xa433('0xc'),'fields':['messageId']},{'name':_0xa433('0xd'),'fields':[_0xa433('0xe'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x74ab10,_0x3867da,_0x1f1025){if(_0x74ab10['body']){_0x74ab10[_0xa433('0xe')]=htmlToText[_0xa433('0xf')](_0x74ab10[_0xa433('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1f1025(null,_0x3867da);},'afterCreate':function(_0x3f88e4,_0x4d2f36,_0x345910){var _0x1dc9af=_0x5add26[_0xa433('0x11')];var _0x4a3151=_0x3f88e4[_0xa433('0x12')]({'plain':!![]});if(_0x4a3151[_0xa433('0x13')][_0xa433('0x14')]()==='in'||_0x4a3151[_0xa433('0x13')]['toLowerCase']()===_0xa433('0x15')&&!_0x4a3151[_0xa433('0x16')]&&!_[_0xa433('0x17')](_0x4a3151['UserId'])){_0x1dc9af[_0xa433('0x18')][_0xa433('0x19')]({'where':{'id':_0x4a3151[_0xa433('0x1a')]}})['then'](function(_0x261022){if(_0x261022){_0x261022[_0xa433('0x1b')]({'lastMsgAt':_0x4a3151['createdAt'],'lastMsgDirection':_0x4a3151[_0xa433('0x13')]['toLowerCase']()});}})[_0xa433('0x1c')](function(_0x48927d){console['error'](_0x48927d);});}_0x345910();}},'charset':'utf8mb4','collate':_0xa433('0x1d')});}; \ No newline at end of file +var _0x296d=['request-promise','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','get','toLowerCase','direction','out','secret','UserId','MailInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x44d28c,_0x3a197b){var _0x754673=function(_0x5a5773){while(--_0x5a5773){_0x44d28c['push'](_0x44d28c['shift']());}};_0x754673(++_0x3a197b);}(_0x296d,0x1e8));var _0xd296=function(_0xb98825,_0x554182){_0xb98825=_0xb98825-0x0;var _0x451d90=_0x296d[_0xb98825];return _0x451d90;};'use strict';var _=require(_0xd296('0x0'));var util=require(_0xd296('0x1'));var logger=require('../../config/logger')(_0xd296('0x2'));var moment=require(_0xd296('0x3'));var BPromise=require(_0xd296('0x4'));var rp=require(_0xd296('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module['exports']=function(_0xa471c6,_0x27aada){return _0xa471c6[_0xd296('0x6')](_0xd296('0x7'),attributes,{'tableName':_0xd296('0x8'),'paranoid':![],'indexes':[{'name':_0xd296('0x9'),'fields':[_0xd296('0x9')]},{'name':_0xd296('0xa'),'fields':[_0xd296('0xb'),_0xd296('0xc')],'type':_0xd296('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x272163,_0x33640c,_0x4875c5){if(_0x272163[_0xd296('0xe')]){_0x272163[_0xd296('0xb')]=htmlToText['fromString'](_0x272163[_0xd296('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4875c5(null,_0x33640c);},'afterCreate':function(_0x1f7d5c,_0x4a668e,_0x4b939d){var _0x3f4b6b=_0xa471c6['models'];var _0x335c79=_0x1f7d5c[_0xd296('0xf')]({'plain':!![]});if(_0x335c79['direction'][_0xd296('0x10')]()==='in'||_0x335c79[_0xd296('0x11')][_0xd296('0x10')]()===_0xd296('0x12')&&!_0x335c79[_0xd296('0x13')]&&!_['isNil'](_0x335c79[_0xd296('0x14')])){_0x3f4b6b[_0xd296('0x15')][_0xd296('0x16')]({'where':{'id':_0x335c79['MailInteractionId']}})[_0xd296('0x17')](function(_0x2bea6b){if(_0x2bea6b){_0x2bea6b[_0xd296('0x18')]({'lastMsgAt':_0x335c79[_0xd296('0x19')],'lastMsgDirection':_0x335c79['direction'][_0xd296('0x10')]()});}})[_0xd296('0x1a')](function(_0x37f066){console['error'](_0x37f066);});}_0x4b939d();}},'charset':_0xd296('0x1b'),'collate':_0xd296('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 306c735..df27d8d 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 _0xeb3b=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','body','options','then','CreateMailMessage','stringify','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x3b23bb,_0xbc62f5){var _0x485203=function(_0x4c93c7){while(--_0x4c93c7){_0x3b23bb['push'](_0x3b23bb['shift']());}};_0x485203(++_0xbc62f5);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0xeb3b[_0x59145a];return _0xf04d7;};'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});config[_0xbeb3('0xa')]=_[_0xbeb3('0xb')](config[_0xbeb3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbeb3('0xc'))(new Redis(config[_0xbeb3('0xa')]));require(_0xbeb3('0xd'))[_0xbeb3('0xe')](socket);function respondWithRpcPromise(_0x443396,_0x550805,_0x10161e){return new BPromise(function(_0x567333,_0x2d1e06){return client[_0xbeb3('0xf')](_0x443396,_0x10161e)['then'](function(_0x1dfff3){logger[_0xbeb3('0x10')](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));logger[_0xbeb3('0x13')](_0xbeb3('0x14'),_0x550805,'request\x20sent',JSON['stringify'](_0x1dfff3));if(_0x1dfff3[_0xbeb3('0x15')]){if(_0x1dfff3[_0xbeb3('0x15')]['code']===0x1f4){logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);return _0x2d1e06(_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);}logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3['error'][_0xbeb3('0x16')]);return _0x567333(_0x1dfff3['error']['message']);}else{logger['info'](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));_0x567333(_0x1dfff3[_0xbeb3('0x17')][_0xbeb3('0x16')]);}})['catch'](function(_0x233a62){logger[_0xbeb3('0x15')](_0xbeb3('0x11'),_0x550805,_0x233a62);_0x2d1e06(_0x233a62);});});}exports['CreateMailMessage']=function(_0x4af96f){var _0x31c1bf=this;return new Promise(function(_0x57e8b6,_0x1d917b){return db['MailMessage']['create'](_0x4af96f[_0xbeb3('0x18')],{'raw':_0x4af96f[_0xbeb3('0x19')]?_0x4af96f[_0xbeb3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbeb3('0x1a')](function(_0x18ea0f){logger['info'](_0xbeb3('0x1b'),_0x4af96f);logger[_0xbeb3('0x13')]('CreateMailMessage',_0x4af96f,JSON[_0xbeb3('0x1c')](_0x18ea0f));_0x57e8b6(_0x18ea0f);})[_0xbeb3('0x1d')](function(_0x16b079){logger[_0xbeb3('0x15')](_0xbeb3('0x1b'),_0x16b079[_0xbeb3('0x16')],_0x4af96f);_0x1d917b(_0x31c1bf[_0xbeb3('0x15')](0x1f4,_0x16b079[_0xbeb3('0x16')]));});});}; \ No newline at end of file +var _0x9582=['client','http','redis','defaults','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x18d45c,_0x114e31){var _0x5bdb10=function(_0x1d0bdd){while(--_0x1d0bdd){_0x18d45c['push'](_0x18d45c['shift']());}};_0x5bdb10(++_0x114e31);}(_0x9582,0x95));var _0x2958=function(_0x965cd2,_0x2959ba){_0x965cd2=_0x965cd2-0x0;var _0x771a05=_0x9582[_0x965cd2];return _0x771a05;};'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});config[_0x2958('0xd')]=_[_0x2958('0xe')](config[_0x2958('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2958('0xd')]));require('./mailMessage.socket')[_0x2958('0xf')](socket);function respondWithRpcPromise(_0x51e460,_0x44cccc,_0x5ef23c){return new BPromise(function(_0x3aacfa,_0x29776c){return client[_0x2958('0x10')](_0x51e460,_0x5ef23c)[_0x2958('0x11')](function(_0x11ec8d){logger['info'](_0x2958('0x12'),_0x44cccc,_0x2958('0x13'));logger[_0x2958('0x14')](_0x2958('0x15'),_0x44cccc,_0x2958('0x13'),JSON[_0x2958('0x16')](_0x11ec8d));if(_0x11ec8d[_0x2958('0x17')]){if(_0x11ec8d[_0x2958('0x17')]['code']===0x1f4){logger[_0x2958('0x17')](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x29776c(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}logger['error'](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x3aacfa(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x44cccc,_0x2958('0x13'));_0x3aacfa(_0x11ec8d[_0x2958('0x19')][_0x2958('0x18')]);}})[_0x2958('0x1a')](function(_0x27599c){logger['error'](_0x2958('0x12'),_0x44cccc,_0x27599c);_0x29776c(_0x27599c);});});}exports[_0x2958('0x1b')]=function(_0x1a12fa){var _0x57b6c5=this;return new Promise(function(_0x1e77eb,_0x53b100){return db[_0x2958('0x1c')]['create'](_0x1a12fa['body'],{'raw':_0x1a12fa[_0x2958('0x1d')]?_0x1a12fa[_0x2958('0x1d')][_0x2958('0x1e')]===undefined?!![]:![]:!![]})[_0x2958('0x11')](function(_0x2202f8){logger[_0x2958('0x1f')](_0x2958('0x1b'),_0x1a12fa);logger[_0x2958('0x14')](_0x2958('0x1b'),_0x1a12fa,JSON[_0x2958('0x16')](_0x2202f8));_0x1e77eb(_0x2202f8);})[_0x2958('0x1a')](function(_0xd58ae1){logger[_0x2958('0x17')](_0x2958('0x1b'),_0xd58ae1[_0x2958('0x18')],_0x1a12fa);_0x53b100(_0x57b6c5['error'](0x1f4,_0xd58ae1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 37469f4..6ac2124 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 _0x49df=['removeListener','length','save','update','emit'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x49df,0x156));var _0xf49d=function(_0x2cfc8c,_0x5472df){_0x2cfc8c=_0x2cfc8c-0x0;var _0x1de813=_0x49df[_0x2cfc8c];return _0x1de813;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xf49d('0x0'),'remove',_0xf49d('0x1')];function createListener(_0x50238b,_0xe47e93){return function(_0x3f650f){_0xe47e93[_0xf49d('0x2')](_0x50238b,_0x3f650f);};}function removeListener(_0x3a13f1,_0x3ec5f6){return function(){MailMessageEvents[_0xf49d('0x3')](_0x3a13f1,_0x3ec5f6);};}exports['register']=function(_0x4e6992){for(var _0x38724d=0x0,_0x44bab9=events[_0xf49d('0x4')];_0x38724d<_0x44bab9;_0x38724d++){var _0x34c100=events[_0x38724d];var _0x19a6e8=createListener('mailMessage:'+_0x34c100,_0x4e6992);MailMessageEvents['on'](_0x34c100,_0x19a6e8);}}; \ No newline at end of file +var _0x18a5=['length','mailMessage:','./mailMessage.events','save','emit','removeListener'];(function(_0xf670c7,_0x185949){var _0x58cfa0=function(_0x189a5f){while(--_0x189a5f){_0xf670c7['push'](_0xf670c7['shift']());}};_0x58cfa0(++_0x185949);}(_0x18a5,0x164));var _0x518a=function(_0x2f3454,_0x4617c1){_0x2f3454=_0x2f3454-0x0;var _0x2bee75=_0x18a5[_0x2f3454];return _0x2bee75;};'use strict';var MailMessageEvents=require(_0x518a('0x0'));var events=[_0x518a('0x1'),'remove','update'];function createListener(_0x14cd9c,_0x47e255){return function(_0x2f5840){_0x47e255[_0x518a('0x2')](_0x14cd9c,_0x2f5840);};}function removeListener(_0x44c5f0,_0x1937bd){return function(){MailMessageEvents[_0x518a('0x3')](_0x44c5f0,_0x1937bd);};}exports['register']=function(_0x5dcff1){for(var _0x4b150f=0x0,_0x2ea311=events[_0x518a('0x4')];_0x4b150f<_0x2ea311;_0x4b150f++){var _0x19a2df=events[_0x4b150f];var _0x2a5fa6=createListener(_0x518a('0x5')+_0x19a2df,_0x5dcff1);MailMessageEvents['on'](_0x19a2df,_0x2a5fa6);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index acfeaba..e703a41 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 _0x687c=['/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create'];(function(_0x47c27c,_0x55ee71){var _0x5264bf=function(_0x1c1396){while(--_0x1c1396){_0x47c27c['push'](_0x47c27c['shift']());}};_0x5264bf(++_0x55ee71);}(_0x687c,0xaa));var _0xc687=function(_0x397db2,_0x24073c){_0x397db2=_0x397db2-0x0;var _0x265e22=_0x687c[_0x397db2];return _0x265e22;};'use strict';var multer=require(_0xc687('0x0'));var util=require(_0xc687('0x1'));var path=require(_0xc687('0x2'));var timeout=require(_0xc687('0x3'));var express=require(_0xc687('0x4'));var router=express[_0xc687('0x5')]();var fs_extra=require(_0xc687('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc687('0x7'));var controller=require(_0xc687('0x8'));router[_0xc687('0x9')]('/',auth[_0xc687('0xa')](),controller[_0xc687('0xb')]);router[_0xc687('0x9')](_0xc687('0xc'),auth['isAuthenticated'](),controller[_0xc687('0xd')]);router['get'](_0xc687('0xe'),auth[_0xc687('0xa')](),controller[_0xc687('0xf')]);router['get'](_0xc687('0x10'),auth[_0xc687('0xa')](),controller[_0xc687('0x11')]);router[_0xc687('0x9')]('/:id/teams',auth[_0xc687('0xa')](),controller['getTeams']);router['get'](_0xc687('0x12'),auth[_0xc687('0xa')](),controller[_0xc687('0x13')]);router[_0xc687('0x14')]('/',auth['isAuthenticated'](),controller[_0xc687('0x15')]);router[_0xc687('0x14')](_0xc687('0x16'),auth['isAuthenticated'](),controller[_0xc687('0x17')]);router[_0xc687('0x14')](_0xc687('0x12'),auth['isAuthenticated'](),controller[_0xc687('0x18')]);router[_0xc687('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xc687('0x1a')]);router['delete']('/:id',auth[_0xc687('0xa')](),controller[_0xc687('0x1b')]);router[_0xc687('0x1c')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc687('0x1d')]);router[_0xc687('0x1c')](_0xc687('0x12'),auth[_0xc687('0xa')](),controller[_0xc687('0x1e')]);module[_0xc687('0x1f')]=router; \ No newline at end of file +var _0x7240=['removeAgents','exports','util','fs-extra','../../components/auth/service','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','destroy','delete','removeTeams'];(function(_0x35ca0d,_0x6fccae){var _0xd9ea4=function(_0x471a03){while(--_0x471a03){_0x35ca0d['push'](_0x35ca0d['shift']());}};_0xd9ea4(++_0x6fccae);}(_0x7240,0xfc));var _0x0724=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7240[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x0724('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0724('0x1'));var auth=require(_0x0724('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0724('0x3'));router[_0x0724('0x4')]('/',auth[_0x0724('0x5')](),controller[_0x0724('0x6')]);router[_0x0724('0x4')]('/describe',auth[_0x0724('0x5')](),controller[_0x0724('0x7')]);router['get'](_0x0724('0x8'),auth[_0x0724('0x5')](),controller[_0x0724('0x9')]);router['get'](_0x0724('0xa'),auth[_0x0724('0x5')](),controller[_0x0724('0xb')]);router[_0x0724('0x4')](_0x0724('0xc'),auth[_0x0724('0x5')](),controller[_0x0724('0xd')]);router['get'](_0x0724('0xe'),auth[_0x0724('0x5')](),controller[_0x0724('0xf')]);router['post']('/',auth[_0x0724('0x5')](),controller['create']);router[_0x0724('0x10')](_0x0724('0xc'),auth[_0x0724('0x5')](),controller[_0x0724('0x11')]);router[_0x0724('0x10')]('/:id/users',auth[_0x0724('0x5')](),controller['addAgents']);router[_0x0724('0x12')](_0x0724('0x8'),auth['isAuthenticated'](),controller[_0x0724('0x13')]);router['delete'](_0x0724('0x8'),auth['isAuthenticated'](),controller[_0x0724('0x14')]);router[_0x0724('0x15')](_0x0724('0xc'),auth[_0x0724('0x5')](),controller[_0x0724('0x16')]);router[_0x0724('0x15')](_0x0724('0xe'),auth[_0x0724('0x5')](),controller[_0x0724('0x17')]);module[_0x0724('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 46116b4..af77367 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 _0x084a=['roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x084a,0x9d));var _0xa084=function(_0x438cd1,_0x13c857){_0x438cd1=_0x438cd1-0x0;var _0x11b977=_0x084a[_0x438cd1];return _0x11b977;};'use strict';var Sequelize=require(_0xa084('0x0'));module['exports']={'name':{'type':Sequelize[_0xa084('0x1')],'unique':_0xa084('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa084('0x1')]},'timeout':{'type':Sequelize[_0xa084('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa084('0x4')]('rrmemory','beepall',_0xa084('0x5'))}}; \ No newline at end of file +var _0xf32c=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0xa1d334,_0x42413f){var _0x477792=function(_0x3ca31d){while(--_0x3ca31d){_0xa1d334['push'](_0xa1d334['shift']());}};_0x477792(++_0x42413f);}(_0xf32c,0x80));var _0xcf32=function(_0x534e63,_0x11a9c9){_0x534e63=_0x534e63-0x0;var _0x253cae=_0xf32c[_0x534e63];return _0x253cae;};'use strict';var Sequelize=require(_0xcf32('0x0'));module[_0xcf32('0x1')]={'name':{'type':Sequelize[_0xcf32('0x2')],'unique':_0xcf32('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcf32('0x2')]},'timeout':{'type':Sequelize[_0xcf32('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcf32('0x5')](_0xcf32('0x6'),_0xcf32('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 134b7c5..a887bea 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 _0x6e08=['../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','key','getOptions','include','query','findAll','catch','show','params','model','keys','attributes','intersection','fields','length','includeAll','options','find','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','filters','hasOwnProperty','sort','pick','where','merge','filter','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','%s/%s','SIP','mailPause','getTeams','findOne','Team','order','nolimit','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','spread','isArray','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs'];(function(_0x3bfafd,_0x66165c){var _0x2e4cc6=function(_0x4cd307){while(--_0x4cd307){_0x3bfafd['push'](_0x3bfafd['shift']());}};_0x2e4cc6(++_0x66165c);}(_0x6e08,0x16d));var _0x86e0=function(_0xb61d88,_0x388bba){_0xb61d88=_0xb61d88-0x0;var _0x196a0d=_0x6e08[_0xb61d88];return _0x196a0d;};'use strict';var BPromise=require(_0x86e0('0x0'));var util=require('util');var _=require(_0x86e0('0x1'));var squel=require('squel');var Redis=require(_0x86e0('0x2'));var qs=require(_0x86e0('0x3'));var logger=require(_0x86e0('0x4'))(_0x86e0('0x5'));var config=require('../../config/environment');var db=require(_0x86e0('0x6'))['db'];config[_0x86e0('0x7')]=_[_0x86e0('0x8')](config[_0x86e0('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x86e0('0x9'))(new Redis(config[_0x86e0('0x7')]));require(_0x86e0('0xa'))['register'](socket);function respondWithStatusCode(_0x167bdb,_0x25b50f){_0x25b50f=_0x25b50f||0xcc;return function(_0x1769b8){if(_0x1769b8){return _0x167bdb[_0x86e0('0xb')](_0x25b50f);}return _0x167bdb[_0x86e0('0xc')](_0x25b50f)[_0x86e0('0xd')]();};}function respondWithResult(_0x48a725,_0x2ed432){_0x2ed432=_0x2ed432||0xc8;return function(_0x5f4b9b){if(_0x5f4b9b){return _0x48a725[_0x86e0('0xc')](_0x2ed432)['json'](_0x5f4b9b);}};}function respondWithFilteredResult(_0x1ea8c9,_0x2aa52c){return function(_0x27e985){if(_0x27e985){var _0x4b6839=typeof _0x2aa52c[_0x86e0('0xe')]==='undefined'&&typeof _0x2aa52c[_0x86e0('0xf')]===_0x86e0('0x10');var _0x4dbe04=_0x27e985[_0x86e0('0x11')];var _0x23e4bf=_0x4b6839?0x0:_0x2aa52c[_0x86e0('0xe')];var _0x1ee592=_0x4b6839?_0x27e985[_0x86e0('0x11')]:_0x2aa52c[_0x86e0('0xe')]+_0x2aa52c[_0x86e0('0xf')];var _0x594b72;if(_0x1ee592>=_0x4dbe04){_0x1ee592=_0x4dbe04;_0x594b72=0xc8;}else{_0x594b72=0xce;}_0x1ea8c9[_0x86e0('0xc')](_0x594b72);return _0x1ea8c9[_0x86e0('0x12')](_0x86e0('0x13'),_0x23e4bf+'-'+_0x1ee592+'/'+_0x4dbe04)['json'](_0x27e985);}return null;};}function saveUpdates(_0x338c1e){return function(_0x3a735a){if(_0x3a735a){return _0x3a735a[_0x86e0('0x14')](_0x338c1e)[_0x86e0('0x15')](function(_0x291092){return _0x291092;});}return null;};}function removeEntity(_0x3f3f7f){return function(_0x1f8be9){if(_0x1f8be9){return _0x1f8be9[_0x86e0('0x16')]()['then'](function(){var _0x3fa52f=_0x1f8be9[_0x86e0('0x17')]({'plain':!![]});var _0x57106a=_0x86e0('0x18');return db[_0x86e0('0x19')][_0x86e0('0x16')]({'where':{'type':_0x57106a,'resourceId':_0x3fa52f['id']}})['then'](function(){return _0x1f8be9;});})[_0x86e0('0x15')](function(){_0x3f3f7f['status'](0xcc)[_0x86e0('0xd')]();});}};}function handleEntityNotFound(_0xda5646){return function(_0x5999b1){if(!_0x5999b1){_0xda5646[_0x86e0('0xb')](0x194);}return _0x5999b1;};}function handleError(_0x318f72,_0x29ce65){_0x29ce65=_0x29ce65||0x1f4;return function(_0x4ee7b9){logger[_0x86e0('0x1a')](_0x4ee7b9[_0x86e0('0x1b')]);if(_0x4ee7b9[_0x86e0('0x1c')]){delete _0x4ee7b9[_0x86e0('0x1c')];}_0x318f72[_0x86e0('0xc')](_0x29ce65)[_0x86e0('0x1d')](_0x4ee7b9);};}exports['index']=function(_0x5a4649,_0x2077d9){var _0xad650c={};var _0x5d92d0={'count':0x0,'rows':[]};var _0x5565ab=_[_0x86e0('0x1e')](db[_0x86e0('0x1f')][_0x86e0('0x20')],function(_0x10dda0){return{'name':_0x10dda0[_0x86e0('0x21')],'type':_0x10dda0['type'][_0x86e0('0x22')]};});_0xad650c=qs[_0x86e0('0x23')](_0x5565ab,_0x5a4649);var _0x4e1e8d={'where':_0xad650c['where']};return db[_0x86e0('0x1f')][_0x86e0('0x11')](_0x4e1e8d)['then'](function(_0x3b3762){_0x5d92d0['count']=_0x3b3762;_0xad650c[_0x86e0('0x24')]=qs[_0x86e0('0x24')](_0x5a4649[_0x86e0('0x25')]);return db[_0x86e0('0x1f')][_0x86e0('0x26')](_0xad650c);})[_0x86e0('0x15')](function(_0x3b61cd){_0x5d92d0['rows']=_0x3b61cd;return _0x5d92d0;})[_0x86e0('0x15')](respondWithFilteredResult(_0x2077d9,_0xad650c))[_0x86e0('0x27')](handleError(_0x2077d9,null));};exports[_0x86e0('0x28')]=function(_0x4ccf11,_0x3ecab2){var _0x379e67={'raw':!![],'where':{'id':_0x4ccf11[_0x86e0('0x29')]['id']}},_0x20bb76={};_0x20bb76[_0x86e0('0x2a')]=_[_0x86e0('0x2b')](db[_0x86e0('0x1f')]['rawAttributes']);_0x20bb76[_0x86e0('0x25')]=_[_0x86e0('0x2b')](_0x4ccf11[_0x86e0('0x25')]);_0x20bb76['filters']=_['intersection'](_0x20bb76['model'],_0x20bb76['query']);_0x379e67[_0x86e0('0x2c')]=_[_0x86e0('0x2d')](_0x20bb76[_0x86e0('0x2a')],qs[_0x86e0('0x2e')](_0x4ccf11[_0x86e0('0x25')][_0x86e0('0x2e')]));_0x379e67[_0x86e0('0x2c')]=_0x379e67[_0x86e0('0x2c')][_0x86e0('0x2f')]?_0x379e67[_0x86e0('0x2c')]:_0x20bb76['model'];if(_0x4ccf11[_0x86e0('0x25')][_0x86e0('0x30')]){_0x379e67['include']=[{'all':!![]}];}_0x379e67=_['merge']({},_0x379e67,_0x4ccf11[_0x86e0('0x31')]);return db[_0x86e0('0x1f')][_0x86e0('0x32')](_0x379e67)[_0x86e0('0x15')](handleEntityNotFound(_0x3ecab2,null))[_0x86e0('0x15')](respondWithResult(_0x3ecab2,null))[_0x86e0('0x27')](handleError(_0x3ecab2,null));};exports['create']=function(_0x31839f,_0x18f287){return db['MailQueue']['create'](_0x31839f[_0x86e0('0x33')],{})['then'](function(_0x3155b7){var _0x31f211=_0x31839f[_0x86e0('0x34')][_0x86e0('0x17')]({'plain':!![]});if(!_0x31f211)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31f211[_0x86e0('0x35')]===_0x86e0('0x34')){var _0x532c18=_0x3155b7[_0x86e0('0x17')]({'plain':!![]});var _0x3cd18a=_0x86e0('0x18');return db[_0x86e0('0x36')][_0x86e0('0x32')]({'where':{'name':_0x3cd18a,'userProfileId':_0x31f211['userProfileId']},'raw':!![]})[_0x86e0('0x15')](function(_0x10376b){if(_0x10376b&&_0x10376b['autoAssociation']===0x0){return db[_0x86e0('0x19')]['create']({'name':_0x532c18[_0x86e0('0x1c')],'resourceId':_0x532c18['id'],'type':_0x10376b[_0x86e0('0x1c')],'sectionId':_0x10376b['id']},{})['then'](function(){return _0x3155b7;});}else{return _0x3155b7;}})[_0x86e0('0x27')](function(_0x40dff7){logger['error'](_0x86e0('0x37'),_0x40dff7);throw _0x40dff7;});}return _0x3155b7;})[_0x86e0('0x15')](respondWithResult(_0x18f287,0xc9))['catch'](handleError(_0x18f287,null));};exports[_0x86e0('0x14')]=function(_0x28ff0e,_0x5cbb4c){if(_0x28ff0e['body']['id']){delete _0x28ff0e[_0x86e0('0x33')]['id'];}return db[_0x86e0('0x1f')][_0x86e0('0x32')]({'where':{'id':_0x28ff0e['params']['id']}})['then'](handleEntityNotFound(_0x5cbb4c,null))[_0x86e0('0x15')](saveUpdates(_0x28ff0e[_0x86e0('0x33')],null))['then'](respondWithResult(_0x5cbb4c,null))[_0x86e0('0x27')](handleError(_0x5cbb4c,null));};exports['destroy']=function(_0x5f4edb,_0x9eef7c){return db[_0x86e0('0x1f')][_0x86e0('0x32')]({'where':{'id':_0x5f4edb['params']['id']}})[_0x86e0('0x15')](handleEntityNotFound(_0x9eef7c,null))[_0x86e0('0x15')](removeEntity(_0x9eef7c,null))[_0x86e0('0x27')](handleError(_0x9eef7c,null));};exports[_0x86e0('0x38')]=function(_0x12efeb,_0x4d8891){return db[_0x86e0('0x1f')][_0x86e0('0x38')]()[_0x86e0('0x15')](respondWithResult(_0x4d8891,null))['catch'](handleError(_0x4d8891,null));};exports[_0x86e0('0x39')]=function(_0x288865,_0x27da87){var _0x12879e={'raw':!![],'where':{}},_0x5a9ff8={},_0x5d3002;return db[_0x86e0('0x1f')]['findOne']({'where':{'id':_0x288865[_0x86e0('0x29')]['id']}})[_0x86e0('0x15')](handleEntityNotFound(_0x27da87,null))[_0x86e0('0x15')](function(_0x450768){if(_0x450768){_0x5d3002=_0x450768[_0x86e0('0x17')]({'plain':!![]});_0x5a9ff8['model']=_['keys'](db[_0x86e0('0x3a')]['rawAttributes']);_0x5a9ff8[_0x86e0('0x25')]=_[_0x86e0('0x2b')](_0x288865[_0x86e0('0x25')]);_0x5a9ff8[_0x86e0('0x3b')]=_['intersection'](_0x5a9ff8[_0x86e0('0x2a')],_0x5a9ff8[_0x86e0('0x25')]);_0x12879e[_0x86e0('0x2c')]=_[_0x86e0('0x2d')](_0x5a9ff8[_0x86e0('0x2a')],qs['fields'](_0x288865[_0x86e0('0x25')][_0x86e0('0x2e')]));_0x12879e[_0x86e0('0x2c')]=_0x12879e[_0x86e0('0x2c')][_0x86e0('0x2f')]?_0x12879e[_0x86e0('0x2c')]:_0x5a9ff8[_0x86e0('0x2a')];if(!_0x288865[_0x86e0('0x25')][_0x86e0('0x3c')]('nolimit')){_0x12879e[_0x86e0('0xf')]=qs[_0x86e0('0xf')](_0x288865[_0x86e0('0x25')][_0x86e0('0xf')]);_0x12879e[_0x86e0('0xe')]=qs[_0x86e0('0xe')](_0x288865[_0x86e0('0x25')][_0x86e0('0xe')]);}_0x12879e['order']=qs[_0x86e0('0x3d')](_0x288865[_0x86e0('0x25')][_0x86e0('0x3d')]);_0x12879e['where']=qs['filters'](_[_0x86e0('0x3e')](_0x288865['query'],_0x5a9ff8[_0x86e0('0x3b')]));_0x12879e['where']['MailQueueId']=_0x450768['id'];if(_0x288865['query']['filter']){_0x12879e[_0x86e0('0x3f')]=_[_0x86e0('0x40')](_0x12879e[_0x86e0('0x3f')],{'$or':_[_0x86e0('0x1e')](_0x12879e['attributes'],function(_0x33e688){var _0x4c69eb={};_0x4c69eb[_0x33e688]={'$like':'%'+_0x288865['query'][_0x86e0('0x41')]+'%'};return _0x4c69eb;})});}_0x12879e=_[_0x86e0('0x40')]({},_0x12879e,_0x288865[_0x86e0('0x31')]);return db['UserMailQueue'][_0x86e0('0x26')](_0x12879e);}})['then'](function(_0x29a158){if(_0x29a158){return db['User'][_0x86e0('0x42')]({'where':{'id':_[_0x86e0('0x1e')](_0x29a158,_0x86e0('0x43')),'role':_0x86e0('0x44')},'attributes':['id',_0x86e0('0x1c'),'mailPause',_0x86e0('0x45'),_0x86e0('0x46')]});}})[_0x86e0('0x15')](function(_0x274a6e){if(_0x274a6e){return{'count':_0x274a6e['count'],'rows':_['map'](_0x274a6e[_0x86e0('0x47')],function(_0x36a84a){return{'membername':_0x36a84a[_0x86e0('0x1c')],'UserId':_0x36a84a['id'],'queue_name':_0x5d3002[_0x86e0('0x1c')],'MailQueueId':_0x5d3002['id'],'interface':util['format'](_0x86e0('0x48'),_0x86e0('0x49'),_0x36a84a[_0x86e0('0x1c')]),'penalty':0x0,'paused':_0x36a84a[_0x86e0('0x4a')],'createdAt':_0x36a84a['createdAt'],'updatedAt':_0x36a84a[_0x86e0('0x45')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x27da87,_0x12879e))[_0x86e0('0x27')](handleError(_0x27da87,null));};exports[_0x86e0('0x4b')]=function(_0x10b34f,_0x5647e8){var _0x33a3a6={};var _0x2fd5a3={};var _0x396902;var _0x19d34c;return db[_0x86e0('0x1f')][_0x86e0('0x4c')]({'where':{'id':_0x10b34f[_0x86e0('0x29')]['id']}})['then'](handleEntityNotFound(_0x5647e8,null))['then'](function(_0x14650b){if(_0x14650b){_0x396902=_0x14650b;_0x2fd5a3[_0x86e0('0x2a')]=_[_0x86e0('0x2b')](db[_0x86e0('0x4d')][_0x86e0('0x20')]);_0x2fd5a3[_0x86e0('0x25')]=_[_0x86e0('0x2b')](_0x10b34f[_0x86e0('0x25')]);_0x2fd5a3[_0x86e0('0x3b')]=_[_0x86e0('0x2d')](_0x2fd5a3['model'],_0x2fd5a3[_0x86e0('0x25')]);_0x33a3a6[_0x86e0('0x2c')]=_[_0x86e0('0x2d')](_0x2fd5a3[_0x86e0('0x2a')],qs['fields'](_0x10b34f[_0x86e0('0x25')][_0x86e0('0x2e')]));_0x33a3a6['attributes']=_0x33a3a6[_0x86e0('0x2c')][_0x86e0('0x2f')]?_0x33a3a6[_0x86e0('0x2c')]:_0x2fd5a3['model'];_0x33a3a6[_0x86e0('0x4e')]=qs['sort'](_0x10b34f[_0x86e0('0x25')][_0x86e0('0x3d')]);_0x33a3a6[_0x86e0('0x3f')]=qs[_0x86e0('0x3b')](_['pick'](_0x10b34f[_0x86e0('0x25')],_0x2fd5a3['filters']));if(_0x10b34f['query'][_0x86e0('0x41')]){_0x33a3a6[_0x86e0('0x3f')]=_[_0x86e0('0x40')](_0x33a3a6[_0x86e0('0x3f')],{'$or':_[_0x86e0('0x1e')](_0x33a3a6[_0x86e0('0x2c')],function(_0x2c358f){var _0x251078={};_0x251078[_0x2c358f]={'$like':'%'+_0x10b34f[_0x86e0('0x25')]['filter']+'%'};return _0x251078;})});}_0x33a3a6=_[_0x86e0('0x40')]({},_0x33a3a6,_0x10b34f['options']);return _0x396902[_0x86e0('0x4b')](_0x33a3a6);}})[_0x86e0('0x15')](function(_0x2a235c){if(_0x2a235c){_0x19d34c=_0x2a235c['length'];if(!_0x10b34f[_0x86e0('0x25')][_0x86e0('0x3c')](_0x86e0('0x4f'))){_0x33a3a6['limit']=qs['limit'](_0x10b34f[_0x86e0('0x25')]['limit']);_0x33a3a6[_0x86e0('0xe')]=qs[_0x86e0('0xe')](_0x10b34f[_0x86e0('0x25')]['offset']);}return _0x396902[_0x86e0('0x4b')](_0x33a3a6);}})[_0x86e0('0x15')](function(_0x250656){if(_0x250656){return _0x250656?{'count':_0x19d34c,'rows':_0x250656}:null;}})[_0x86e0('0x15')](respondWithResult(_0x5647e8,null))[_0x86e0('0x27')](handleError(_0x5647e8,null));};exports[_0x86e0('0x50')]=function(_0x49f98a,_0x3e7191){var _0x5c33ed=_0x49f98a[_0x86e0('0x33')][_0x86e0('0x51')];return db[_0x86e0('0x4d')][_0x86e0('0x26')]({'where':{'id':_0x5c33ed},'attributes':['id'],'include':[{'model':db[_0x86e0('0x52')],'as':_0x86e0('0x53'),'attributes':['id',_0x86e0('0x1c'),_0x86e0('0x54'),'voicePause',_0x86e0('0x55')],'raw':!![]}]})[_0x86e0('0x15')](function(_0x4b0ac6){if(_0x4b0ac6){var _0x4251a1=_[_0x86e0('0x56')](_0x4b0ac6,function(_0x168c68){var _0x455a8f=_0x168c68[_0x86e0('0x17')]({'plain':!![]});return _0x455a8f['Agents'];});return db[_0x86e0('0x1f')]['find']({'where':{'id':_0x49f98a[_0x86e0('0x29')]['id']}})[_0x86e0('0x15')](function(_0x486702){return db[_0x86e0('0x57')][_0x86e0('0x58')](function(_0x1f57c2){return _0x486702[_0x86e0('0x50')](_0x5c33ed,{'transaction':_0x1f57c2})[_0x86e0('0x15')](function(){return BPromise[_0x86e0('0x59')](_0x4251a1,function(_0x4377b0){return db['UserMailQueue'][_0x86e0('0x5a')]({'where':{'UserId':_0x4377b0['id'],'MailQueueId':_0x49f98a['params']['id']},'transaction':_0x1f57c2});});})['then'](function(){_0x4251a1[_0x86e0('0x5b')](function(_0x262033){socket['emit'](_0x86e0('0x5c'),{'UserId':_0x262033['id'],'MailQueueId':_0x486702['id']});});});});});}})['then'](respondWithStatusCode(_0x3e7191,null))[_0x86e0('0x27')](handleError(_0x3e7191,null));};exports[_0x86e0('0x5d')]=function(_0x270ac2,_0x4e178b){return db[_0x86e0('0x4d')][_0x86e0('0x26')]({'where':{'id':_0x270ac2[_0x86e0('0x25')][_0x86e0('0x51')]},'attributes':['id'],'include':[{'model':db[_0x86e0('0x52')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x86e0('0x15')](handleEntityNotFound(_0x4e178b,null))['then'](function(_0xb028d3){var _0x470edd=_[_0x86e0('0x1e')](_0xb028d3,'id');var _0x4893b7=[];var _0x1af9f6=[];var _0x3817bf=squel[_0x86e0('0x5e')]();_0x3817bf[_0x86e0('0x5f')](_0x86e0('0x60'))[_0x86e0('0x61')](_0x86e0('0x62'),'tq')[_0x86e0('0x63')](_0x86e0('0x64'),'ut',_0x86e0('0x65'))[_0x86e0('0x3f')](_0x86e0('0x66'),_0x270ac2['params']['id']);for(var _0x5ecc0f=0x0;_0x5ecc0f<_0xb028d3[_0x86e0('0x2f')];_0x5ecc0f+=0x1){let _0x4e3c42=_0xb028d3[_0x5ecc0f];for(var _0x548ed7=0x0;_0x548ed7<_0x4e3c42['Agents'][_0x86e0('0x2f')];_0x548ed7+=0x1){let _0x43438c=_0x4e3c42[_0x86e0('0x53')][_0x548ed7];var _0x34717f=_0x3817bf[_0x86e0('0x67')]();_0x34717f[_0x86e0('0x3f')](_0x86e0('0x68'),_0x43438c['id']);_0x1af9f6[_0x86e0('0x69')](db['sequelize']['query'](_0x34717f[_0x86e0('0x6a')](),{'type':db['sequelize'][_0x86e0('0x6b')][_0x86e0('0x6c')]})['then'](function(_0x589048){if(_0x589048[_0x86e0('0x2f')]===0x1){return _0x43438c['id'];}else{var _0x27171d=_[_0x86e0('0x6d')](_['map'](_0x589048,_0x86e0('0x6e')),function(_0x42f92b){return _[_0x86e0('0x6f')](_0x470edd,_0x42f92b);});if(_0x27171d){return _0x43438c['id'];}}}));}}return BPromise[_0x86e0('0x70')](_0x1af9f6)['then'](function(_0x5d4c12){_0x4893b7=_(_0x4893b7)[_0x86e0('0x71')](_0x5d4c12)[_0x86e0('0x72')]()['value']();return db['MailQueue'][_0x86e0('0x32')]({'where':{'id':_0x270ac2['params']['id']}})[_0x86e0('0x15')](function(_0x41c9a2){return db[_0x86e0('0x57')]['transaction'](function(_0x4a3219){return _0x41c9a2[_0x86e0('0x5d')](_0x270ac2[_0x86e0('0x25')]['ids'],{'transaction':_0x4a3219})[_0x86e0('0x15')](function(){if(!_[_0x86e0('0x73')](_0x4893b7)){return _0x41c9a2[_0x86e0('0x74')](_0x4893b7,{'transaction':_0x4a3219});}})[_0x86e0('0x15')](function(){_0x4893b7[_0x86e0('0x5b')](function(_0xcfaebc){socket[_0x86e0('0x75')](_0x86e0('0x76'),{'UserId':_0xcfaebc,'MailQueueId':_0x41c9a2['id']});});});});});});})[_0x86e0('0x15')](respondWithStatusCode(_0x4e178b,null))[_0x86e0('0x27')](handleError(_0x4e178b,null));};exports['addAgents']=function(_0x9513db,_0x23f3c4){return db['MailQueue'][_0x86e0('0x32')]({'where':{'id':_0x9513db[_0x86e0('0x29')]['id']}})['then'](handleEntityNotFound(_0x23f3c4,null))[_0x86e0('0x15')](function(_0x31ffae){if(_0x31ffae){return _0x31ffae[_0x86e0('0x77')](_0x9513db[_0x86e0('0x33')][_0x86e0('0x51')],_['omit'](_0x9513db['body'],['ids','id'])||{})[_0x86e0('0x78')](function(_0x18178e){for(var _0x161e0d=0x0;_0x161e0d<_0x9513db[_0x86e0('0x33')][_0x86e0('0x51')]['length'];_0x161e0d+=0x1){socket[_0x86e0('0x75')]('userMailQueue:save',{'UserId':Number(_0x9513db['body'][_0x86e0('0x51')][_0x161e0d]),'MailQueueId':Number(_0x9513db['params']['id'])});}return _0x18178e;});}})[_0x86e0('0x15')](respondWithResult(_0x23f3c4,null))['catch'](handleError(_0x23f3c4,null));};exports[_0x86e0('0x74')]=function(_0x21e581,_0x11b0f8){return db[_0x86e0('0x1f')][_0x86e0('0x32')]({'where':{'id':_0x21e581[_0x86e0('0x29')]['id']}})[_0x86e0('0x15')](handleEntityNotFound(_0x11b0f8,null))[_0x86e0('0x15')](function(_0x50466b){if(_0x50466b){return _0x50466b[_0x86e0('0x74')](_0x21e581[_0x86e0('0x25')]['ids'])['then'](function(){if(_[_0x86e0('0x79')](_0x21e581['query'][_0x86e0('0x51')])){for(var _0x3a8a88=0x0;_0x3a8a88<_0x21e581[_0x86e0('0x25')][_0x86e0('0x51')][_0x86e0('0x2f')];_0x3a8a88+=0x1){socket[_0x86e0('0x75')](_0x86e0('0x76'),{'UserId':Number(_0x21e581['query'][_0x86e0('0x51')][_0x3a8a88]),'MailQueueId':Number(_0x21e581[_0x86e0('0x29')]['id'])});}}else{socket[_0x86e0('0x75')]('userMailQueue:remove',{'UserId':Number(_0x21e581[_0x86e0('0x25')][_0x86e0('0x51')]),'MailQueueId':Number(_0x21e581[_0x86e0('0x29')]['id'])});}});}})[_0x86e0('0x15')](respondWithStatusCode(_0x11b0f8,null))[_0x86e0('0x27')](handleError(_0x11b0f8,null));};exports[_0x86e0('0x7a')]=function(_0x44d1b8,_0x16cb16){var _0x295ed2={};var _0x4194d2={};var _0x364a41;var _0xf57ff8;return db[_0x86e0('0x1f')][_0x86e0('0x4c')]({'where':{'id':_0x44d1b8['params']['id']}})[_0x86e0('0x15')](handleEntityNotFound(_0x16cb16,null))['then'](function(_0x56c750){if(_0x56c750){_0x364a41=_0x56c750;_0x4194d2[_0x86e0('0x2a')]=_[_0x86e0('0x2b')](db['User']['rawAttributes']);_0x4194d2[_0x86e0('0x25')]=_[_0x86e0('0x2b')](_0x44d1b8[_0x86e0('0x25')]);_0x4194d2[_0x86e0('0x3b')]=_['intersection'](_0x4194d2[_0x86e0('0x2a')],_0x4194d2[_0x86e0('0x25')]);_0x295ed2['attributes']=_[_0x86e0('0x2d')](_0x4194d2[_0x86e0('0x2a')],qs[_0x86e0('0x2e')](_0x44d1b8[_0x86e0('0x25')][_0x86e0('0x2e')]));_0x295ed2[_0x86e0('0x2c')]=_0x295ed2['attributes'][_0x86e0('0x2f')]?_0x295ed2[_0x86e0('0x2c')]:_0x4194d2[_0x86e0('0x2a')];_0x295ed2[_0x86e0('0x4e')]=qs[_0x86e0('0x3d')](_0x44d1b8[_0x86e0('0x25')][_0x86e0('0x3d')]);_0x295ed2[_0x86e0('0x3f')]=qs['filters'](_[_0x86e0('0x3e')](_0x44d1b8[_0x86e0('0x25')],_0x4194d2[_0x86e0('0x3b')]));if(_0x44d1b8[_0x86e0('0x25')][_0x86e0('0x41')]){_0x295ed2[_0x86e0('0x3f')]=_[_0x86e0('0x40')](_0x295ed2[_0x86e0('0x3f')],{'$or':_['map'](_0x295ed2['attributes'],function(_0x1d874b){var _0x2e26eb={};_0x2e26eb[_0x1d874b]={'$like':'%'+_0x44d1b8[_0x86e0('0x25')]['filter']+'%'};return _0x2e26eb;})});}_0x295ed2=_['merge']({},_0x295ed2,_0x44d1b8['options']);return _0x364a41[_0x86e0('0x7a')](_0x295ed2);}})['then'](function(_0x76fef2){if(_0x76fef2){_0xf57ff8=_0x76fef2[_0x86e0('0x2f')];if(!_0x44d1b8[_0x86e0('0x25')][_0x86e0('0x3c')](_0x86e0('0x4f'))){_0x295ed2[_0x86e0('0xf')]=qs[_0x86e0('0xf')](_0x44d1b8[_0x86e0('0x25')][_0x86e0('0xf')]);_0x295ed2[_0x86e0('0xe')]=qs[_0x86e0('0xe')](_0x44d1b8['query'][_0x86e0('0xe')]);}return _0x364a41[_0x86e0('0x7a')](_0x295ed2);}})[_0x86e0('0x15')](function(_0x27e346){if(_0x27e346){return _0x27e346?{'count':_0xf57ff8,'rows':_0x27e346}:null;}})[_0x86e0('0x15')](respondWithResult(_0x16cb16,null))['catch'](handleError(_0x16cb16,null));}; \ No newline at end of file +var _0xbb39=['includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','order','sort','pick','where','MailQueueId','filter','User','findAndCountAll','UserId','agent','mailPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','end','status','limit','undefined','count','offset','set','Content-Range','json','update','then','destroy','get','MailQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','getOptions','MailQueue','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','fields','attributes','length'];(function(_0x5904b2,_0x2af109){var _0xf5afba=function(_0x5601bd){while(--_0x5601bd){_0x5904b2['push'](_0x5904b2['shift']());}};_0xf5afba(++_0x2af109);}(_0xbb39,0x1cb));var _0x9bb3=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xbb39[_0x476bf4];return _0x788ffe;};'use strict';var BPromise=require(_0x9bb3('0x0'));var util=require(_0x9bb3('0x1'));var _=require(_0x9bb3('0x2'));var squel=require(_0x9bb3('0x3'));var Redis=require(_0x9bb3('0x4'));var qs=require(_0x9bb3('0x5'));var logger=require(_0x9bb3('0x6'))('api');var config=require(_0x9bb3('0x7'));var db=require(_0x9bb3('0x8'))['db'];config[_0x9bb3('0x9')]=_[_0x9bb3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9bb3('0xb'))(new Redis(config[_0x9bb3('0x9')]));require(_0x9bb3('0xc'))[_0x9bb3('0xd')](socket);function respondWithStatusCode(_0x488359,_0x3fbaa6){_0x3fbaa6=_0x3fbaa6||0xcc;return function(_0x37a052){if(_0x37a052){return _0x488359['sendStatus'](_0x3fbaa6);}return _0x488359['status'](_0x3fbaa6)[_0x9bb3('0xe')]();};}function respondWithResult(_0x15677b,_0x453638){_0x453638=_0x453638||0xc8;return function(_0x506ac0){if(_0x506ac0){return _0x15677b[_0x9bb3('0xf')](_0x453638)['json'](_0x506ac0);}};}function respondWithFilteredResult(_0x2f1250,_0x1dff97){return function(_0x4ebec3){if(_0x4ebec3){var _0x3b8ec2=typeof _0x1dff97['offset']==='undefined'&&typeof _0x1dff97[_0x9bb3('0x10')]===_0x9bb3('0x11');var _0x3d3868=_0x4ebec3[_0x9bb3('0x12')];var _0x19e3ab=_0x3b8ec2?0x0:_0x1dff97['offset'];var _0x4c8573=_0x3b8ec2?_0x4ebec3[_0x9bb3('0x12')]:_0x1dff97[_0x9bb3('0x13')]+_0x1dff97[_0x9bb3('0x10')];var _0x69fb31;if(_0x4c8573>=_0x3d3868){_0x4c8573=_0x3d3868;_0x69fb31=0xc8;}else{_0x69fb31=0xce;}_0x2f1250[_0x9bb3('0xf')](_0x69fb31);return _0x2f1250[_0x9bb3('0x14')](_0x9bb3('0x15'),_0x19e3ab+'-'+_0x4c8573+'/'+_0x3d3868)[_0x9bb3('0x16')](_0x4ebec3);}return null;};}function saveUpdates(_0x53ce08){return function(_0x25fa8c){if(_0x25fa8c){return _0x25fa8c[_0x9bb3('0x17')](_0x53ce08)[_0x9bb3('0x18')](function(_0x1b7dfa){return _0x1b7dfa;});}return null;};}function removeEntity(_0x137d72){return function(_0x3a6f3c){if(_0x3a6f3c){return _0x3a6f3c[_0x9bb3('0x19')]()[_0x9bb3('0x18')](function(){var _0x1d4712=_0x3a6f3c[_0x9bb3('0x1a')]({'plain':!![]});var _0x447544=_0x9bb3('0x1b');return db[_0x9bb3('0x1c')][_0x9bb3('0x19')]({'where':{'type':_0x447544,'resourceId':_0x1d4712['id']}})[_0x9bb3('0x18')](function(){return _0x3a6f3c;});})['then'](function(){_0x137d72['status'](0xcc)[_0x9bb3('0xe')]();});}};}function handleEntityNotFound(_0x5b9be2){return function(_0x524e60){if(!_0x524e60){_0x5b9be2['sendStatus'](0x194);}return _0x524e60;};}function handleError(_0x104af9,_0x59ca16){_0x59ca16=_0x59ca16||0x1f4;return function(_0x3704a6){logger[_0x9bb3('0x1d')](_0x3704a6['stack']);if(_0x3704a6[_0x9bb3('0x1e')]){delete _0x3704a6[_0x9bb3('0x1e')];}_0x104af9[_0x9bb3('0xf')](_0x59ca16)[_0x9bb3('0x1f')](_0x3704a6);};}exports[_0x9bb3('0x20')]=function(_0x306c77,_0x5a3ac5){var _0x165697={};var _0x2f1e6d={'count':0x0,'rows':[]};var _0x25a45b=_[_0x9bb3('0x21')](db['MailQueue'][_0x9bb3('0x22')],function(_0x1a3bcd){return{'name':_0x1a3bcd[_0x9bb3('0x23')],'type':_0x1a3bcd[_0x9bb3('0x24')]['key']};});_0x165697=qs[_0x9bb3('0x25')](_0x25a45b,_0x306c77);var _0xb45687={'where':_0x165697['where']};return db[_0x9bb3('0x26')][_0x9bb3('0x12')](_0xb45687)[_0x9bb3('0x18')](function(_0x586210){_0x2f1e6d[_0x9bb3('0x12')]=_0x586210;_0x165697[_0x9bb3('0x27')]=qs[_0x9bb3('0x27')](_0x306c77['query']);return db['MailQueue'][_0x9bb3('0x28')](_0x165697);})[_0x9bb3('0x18')](function(_0x870a8f){_0x2f1e6d[_0x9bb3('0x29')]=_0x870a8f;return _0x2f1e6d;})[_0x9bb3('0x18')](respondWithFilteredResult(_0x5a3ac5,_0x165697))[_0x9bb3('0x2a')](handleError(_0x5a3ac5,null));};exports[_0x9bb3('0x2b')]=function(_0x331543,_0x2dd664){var _0x3780f9={'raw':!![],'where':{'id':_0x331543[_0x9bb3('0x2c')]['id']}},_0x1a4a9e={};_0x1a4a9e[_0x9bb3('0x2d')]=_[_0x9bb3('0x2e')](db['MailQueue'][_0x9bb3('0x22')]);_0x1a4a9e[_0x9bb3('0x2f')]=_['keys'](_0x331543[_0x9bb3('0x2f')]);_0x1a4a9e[_0x9bb3('0x30')]=_[_0x9bb3('0x31')](_0x1a4a9e[_0x9bb3('0x2d')],_0x1a4a9e[_0x9bb3('0x2f')]);_0x3780f9['attributes']=_[_0x9bb3('0x31')](_0x1a4a9e[_0x9bb3('0x2d')],qs[_0x9bb3('0x32')](_0x331543[_0x9bb3('0x2f')][_0x9bb3('0x32')]));_0x3780f9[_0x9bb3('0x33')]=_0x3780f9[_0x9bb3('0x33')][_0x9bb3('0x34')]?_0x3780f9[_0x9bb3('0x33')]:_0x1a4a9e[_0x9bb3('0x2d')];if(_0x331543[_0x9bb3('0x2f')][_0x9bb3('0x35')]){_0x3780f9['include']=[{'all':!![]}];}_0x3780f9=_[_0x9bb3('0x36')]({},_0x3780f9,_0x331543[_0x9bb3('0x37')]);return db[_0x9bb3('0x26')][_0x9bb3('0x38')](_0x3780f9)[_0x9bb3('0x18')](handleEntityNotFound(_0x2dd664,null))[_0x9bb3('0x18')](respondWithResult(_0x2dd664,null))[_0x9bb3('0x2a')](handleError(_0x2dd664,null));};exports[_0x9bb3('0x39')]=function(_0x1ebfa8,_0x202d3d){return db[_0x9bb3('0x26')][_0x9bb3('0x39')](_0x1ebfa8[_0x9bb3('0x3a')],{})[_0x9bb3('0x18')](function(_0x4d57d9){var _0x1b1421=_0x1ebfa8[_0x9bb3('0x3b')][_0x9bb3('0x1a')]({'plain':!![]});if(!_0x1b1421)throw new Error(_0x9bb3('0x3c'));if(_0x1b1421['role']===_0x9bb3('0x3b')){var _0x5788c0=_0x4d57d9[_0x9bb3('0x1a')]({'plain':!![]});var _0x49d042=_0x9bb3('0x1b');return db[_0x9bb3('0x3d')][_0x9bb3('0x38')]({'where':{'name':_0x49d042,'userProfileId':_0x1b1421[_0x9bb3('0x3e')]},'raw':!![]})[_0x9bb3('0x18')](function(_0x288f24){if(_0x288f24&&_0x288f24[_0x9bb3('0x3f')]===0x0){return db['UserProfileResource'][_0x9bb3('0x39')]({'name':_0x5788c0[_0x9bb3('0x1e')],'resourceId':_0x5788c0['id'],'type':_0x288f24[_0x9bb3('0x1e')],'sectionId':_0x288f24['id']},{})[_0x9bb3('0x18')](function(){return _0x4d57d9;});}else{return _0x4d57d9;}})['catch'](function(_0x37e826){logger[_0x9bb3('0x1d')](_0x9bb3('0x40'),_0x37e826);throw _0x37e826;});}return _0x4d57d9;})[_0x9bb3('0x18')](respondWithResult(_0x202d3d,0xc9))[_0x9bb3('0x2a')](handleError(_0x202d3d,null));};exports['update']=function(_0x5786f4,_0x4a5107){if(_0x5786f4[_0x9bb3('0x3a')]['id']){delete _0x5786f4[_0x9bb3('0x3a')]['id'];}return db[_0x9bb3('0x26')][_0x9bb3('0x38')]({'where':{'id':_0x5786f4[_0x9bb3('0x2c')]['id']}})[_0x9bb3('0x18')](handleEntityNotFound(_0x4a5107,null))['then'](saveUpdates(_0x5786f4[_0x9bb3('0x3a')],null))['then'](respondWithResult(_0x4a5107,null))['catch'](handleError(_0x4a5107,null));};exports['destroy']=function(_0xd241ea,_0x208dd0){return db[_0x9bb3('0x26')]['find']({'where':{'id':_0xd241ea[_0x9bb3('0x2c')]['id']}})[_0x9bb3('0x18')](handleEntityNotFound(_0x208dd0,null))['then'](removeEntity(_0x208dd0,null))[_0x9bb3('0x2a')](handleError(_0x208dd0,null));};exports[_0x9bb3('0x41')]=function(_0x2d4e30,_0x2eba23){return db[_0x9bb3('0x26')][_0x9bb3('0x41')]()[_0x9bb3('0x18')](respondWithResult(_0x2eba23,null))[_0x9bb3('0x2a')](handleError(_0x2eba23,null));};exports[_0x9bb3('0x42')]=function(_0x208250,_0x2f3d2e){var _0x4ce5f0={'raw':!![],'where':{}},_0xcf0b54={},_0x4a9fab;return db[_0x9bb3('0x26')][_0x9bb3('0x43')]({'where':{'id':_0x208250['params']['id']}})[_0x9bb3('0x18')](handleEntityNotFound(_0x2f3d2e,null))[_0x9bb3('0x18')](function(_0xca716c){if(_0xca716c){_0x4a9fab=_0xca716c[_0x9bb3('0x1a')]({'plain':!![]});_0xcf0b54[_0x9bb3('0x2d')]=_[_0x9bb3('0x2e')](db[_0x9bb3('0x44')][_0x9bb3('0x22')]);_0xcf0b54[_0x9bb3('0x2f')]=_[_0x9bb3('0x2e')](_0x208250['query']);_0xcf0b54[_0x9bb3('0x30')]=_[_0x9bb3('0x31')](_0xcf0b54[_0x9bb3('0x2d')],_0xcf0b54['query']);_0x4ce5f0['attributes']=_[_0x9bb3('0x31')](_0xcf0b54[_0x9bb3('0x2d')],qs[_0x9bb3('0x32')](_0x208250[_0x9bb3('0x2f')][_0x9bb3('0x32')]));_0x4ce5f0['attributes']=_0x4ce5f0[_0x9bb3('0x33')][_0x9bb3('0x34')]?_0x4ce5f0[_0x9bb3('0x33')]:_0xcf0b54[_0x9bb3('0x2d')];if(!_0x208250[_0x9bb3('0x2f')]['hasOwnProperty'](_0x9bb3('0x45'))){_0x4ce5f0[_0x9bb3('0x10')]=qs[_0x9bb3('0x10')](_0x208250[_0x9bb3('0x2f')]['limit']);_0x4ce5f0[_0x9bb3('0x13')]=qs['offset'](_0x208250[_0x9bb3('0x2f')][_0x9bb3('0x13')]);}_0x4ce5f0[_0x9bb3('0x46')]=qs[_0x9bb3('0x47')](_0x208250[_0x9bb3('0x2f')][_0x9bb3('0x47')]);_0x4ce5f0['where']=qs['filters'](_[_0x9bb3('0x48')](_0x208250['query'],_0xcf0b54[_0x9bb3('0x30')]));_0x4ce5f0[_0x9bb3('0x49')][_0x9bb3('0x4a')]=_0xca716c['id'];if(_0x208250['query'][_0x9bb3('0x4b')]){_0x4ce5f0[_0x9bb3('0x49')]=_[_0x9bb3('0x36')](_0x4ce5f0[_0x9bb3('0x49')],{'$or':_['map'](_0x4ce5f0[_0x9bb3('0x33')],function(_0x28205d){var _0x291160={};_0x291160[_0x28205d]={'$like':'%'+_0x208250[_0x9bb3('0x2f')][_0x9bb3('0x4b')]+'%'};return _0x291160;})});}_0x4ce5f0=_[_0x9bb3('0x36')]({},_0x4ce5f0,_0x208250[_0x9bb3('0x37')]);return db[_0x9bb3('0x44')][_0x9bb3('0x28')](_0x4ce5f0);}})['then'](function(_0x488aef){if(_0x488aef){return db[_0x9bb3('0x4c')][_0x9bb3('0x4d')]({'where':{'id':_['map'](_0x488aef,_0x9bb3('0x4e')),'role':_0x9bb3('0x4f')},'attributes':['id',_0x9bb3('0x1e'),_0x9bb3('0x50'),'updatedAt','createdAt']});}})[_0x9bb3('0x18')](function(_0xf00390){if(_0xf00390){return{'count':_0xf00390[_0x9bb3('0x12')],'rows':_[_0x9bb3('0x21')](_0xf00390['rows'],function(_0x86e3e5){return{'membername':_0x86e3e5[_0x9bb3('0x1e')],'UserId':_0x86e3e5['id'],'queue_name':_0x4a9fab[_0x9bb3('0x1e')],'MailQueueId':_0x4a9fab['id'],'interface':util[_0x9bb3('0x51')](_0x9bb3('0x52'),_0x9bb3('0x53'),_0x86e3e5[_0x9bb3('0x1e')]),'penalty':0x0,'paused':_0x86e3e5[_0x9bb3('0x50')],'createdAt':_0x86e3e5[_0x9bb3('0x54')],'updatedAt':_0x86e3e5[_0x9bb3('0x55')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2f3d2e,_0x4ce5f0))[_0x9bb3('0x2a')](handleError(_0x2f3d2e,null));};exports[_0x9bb3('0x56')]=function(_0x9840fb,_0x530678){var _0x579113={};var _0x22218a={};var _0x113812;var _0x557a26;return db['MailQueue'][_0x9bb3('0x43')]({'where':{'id':_0x9840fb['params']['id']}})[_0x9bb3('0x18')](handleEntityNotFound(_0x530678,null))[_0x9bb3('0x18')](function(_0xe6f7f9){if(_0xe6f7f9){_0x113812=_0xe6f7f9;_0x22218a[_0x9bb3('0x2d')]=_[_0x9bb3('0x2e')](db[_0x9bb3('0x57')][_0x9bb3('0x22')]);_0x22218a['query']=_['keys'](_0x9840fb['query']);_0x22218a['filters']=_[_0x9bb3('0x31')](_0x22218a['model'],_0x22218a[_0x9bb3('0x2f')]);_0x579113[_0x9bb3('0x33')]=_[_0x9bb3('0x31')](_0x22218a[_0x9bb3('0x2d')],qs[_0x9bb3('0x32')](_0x9840fb['query']['fields']));_0x579113[_0x9bb3('0x33')]=_0x579113[_0x9bb3('0x33')][_0x9bb3('0x34')]?_0x579113[_0x9bb3('0x33')]:_0x22218a[_0x9bb3('0x2d')];_0x579113['order']=qs[_0x9bb3('0x47')](_0x9840fb[_0x9bb3('0x2f')]['sort']);_0x579113[_0x9bb3('0x49')]=qs[_0x9bb3('0x30')](_['pick'](_0x9840fb[_0x9bb3('0x2f')],_0x22218a[_0x9bb3('0x30')]));if(_0x9840fb[_0x9bb3('0x2f')]['filter']){_0x579113[_0x9bb3('0x49')]=_['merge'](_0x579113[_0x9bb3('0x49')],{'$or':_[_0x9bb3('0x21')](_0x579113[_0x9bb3('0x33')],function(_0x158c3c){var _0x6f37cc={};_0x6f37cc[_0x158c3c]={'$like':'%'+_0x9840fb[_0x9bb3('0x2f')][_0x9bb3('0x4b')]+'%'};return _0x6f37cc;})});}_0x579113=_[_0x9bb3('0x36')]({},_0x579113,_0x9840fb[_0x9bb3('0x37')]);return _0x113812['getTeams'](_0x579113);}})[_0x9bb3('0x18')](function(_0x4703ee){if(_0x4703ee){_0x557a26=_0x4703ee[_0x9bb3('0x34')];if(!_0x9840fb['query'][_0x9bb3('0x58')](_0x9bb3('0x45'))){_0x579113['limit']=qs[_0x9bb3('0x10')](_0x9840fb[_0x9bb3('0x2f')][_0x9bb3('0x10')]);_0x579113['offset']=qs[_0x9bb3('0x13')](_0x9840fb[_0x9bb3('0x2f')]['offset']);}return _0x113812[_0x9bb3('0x56')](_0x579113);}})[_0x9bb3('0x18')](function(_0x47f1a0){if(_0x47f1a0){return _0x47f1a0?{'count':_0x557a26,'rows':_0x47f1a0}:null;}})['then'](respondWithResult(_0x530678,null))[_0x9bb3('0x2a')](handleError(_0x530678,null));};exports[_0x9bb3('0x59')]=function(_0x5cc489,_0x15bde9){var _0x56b309=_0x5cc489[_0x9bb3('0x3a')][_0x9bb3('0x5a')];return db[_0x9bb3('0x57')][_0x9bb3('0x28')]({'where':{'id':_0x56b309},'attributes':['id'],'include':[{'model':db[_0x9bb3('0x4c')],'as':_0x9bb3('0x5b'),'attributes':['id',_0x9bb3('0x1e'),'online',_0x9bb3('0x5c'),_0x9bb3('0x5d')],'raw':!![]}]})[_0x9bb3('0x18')](function(_0x1139bb){if(_0x1139bb){var _0x4baee1=_[_0x9bb3('0x5e')](_0x1139bb,function(_0x4a52a3){var _0x34d3dc=_0x4a52a3[_0x9bb3('0x1a')]({'plain':!![]});return _0x34d3dc[_0x9bb3('0x5b')];});return db[_0x9bb3('0x26')][_0x9bb3('0x38')]({'where':{'id':_0x5cc489[_0x9bb3('0x2c')]['id']}})[_0x9bb3('0x18')](function(_0x1706aa){return db['sequelize'][_0x9bb3('0x5f')](function(_0xf6f922){return _0x1706aa[_0x9bb3('0x59')](_0x56b309,{'transaction':_0xf6f922})[_0x9bb3('0x18')](function(){return BPromise['each'](_0x4baee1,function(_0x36e32d){return db[_0x9bb3('0x44')][_0x9bb3('0x60')]({'where':{'UserId':_0x36e32d['id'],'MailQueueId':_0x5cc489[_0x9bb3('0x2c')]['id']},'transaction':_0xf6f922});});})[_0x9bb3('0x18')](function(){_0x4baee1[_0x9bb3('0x61')](function(_0xdb7709){socket[_0x9bb3('0x62')]('userMailQueue:save',{'UserId':_0xdb7709['id'],'MailQueueId':_0x1706aa['id']});});});});});}})[_0x9bb3('0x18')](respondWithStatusCode(_0x15bde9,null))[_0x9bb3('0x2a')](handleError(_0x15bde9,null));};exports['removeTeams']=function(_0x341f3e,_0x413648){return db['Team'][_0x9bb3('0x28')]({'where':{'id':_0x341f3e[_0x9bb3('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9bb3('0x4c')],'as':_0x9bb3('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x9bb3('0x18')](handleEntityNotFound(_0x413648,null))[_0x9bb3('0x18')](function(_0x2fad36){var _0x480752=_['map'](_0x2fad36,'id');var _0x1e05da=[];var _0x1466e2=[];var _0x568273=squel[_0x9bb3('0x63')]();_0x568273[_0x9bb3('0x64')](_0x9bb3('0x65'))[_0x9bb3('0x66')](_0x9bb3('0x67'),'tq')[_0x9bb3('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9bb3('0x49')](_0x9bb3('0x69'),_0x341f3e[_0x9bb3('0x2c')]['id']);for(var _0x423425=0x0;_0x423425<_0x2fad36[_0x9bb3('0x34')];_0x423425+=0x1){let _0x216f9c=_0x2fad36[_0x423425];for(var _0xf4e436=0x0;_0xf4e436<_0x216f9c[_0x9bb3('0x5b')]['length'];_0xf4e436+=0x1){let _0xc39cc4=_0x216f9c[_0x9bb3('0x5b')][_0xf4e436];var _0x1c06ea=_0x568273[_0x9bb3('0x6a')]();_0x1c06ea[_0x9bb3('0x49')]('ut.UserId\x20=\x20?',_0xc39cc4['id']);_0x1466e2[_0x9bb3('0x6b')](db[_0x9bb3('0x6c')][_0x9bb3('0x2f')](_0x1c06ea[_0x9bb3('0x6d')](),{'type':db[_0x9bb3('0x6c')][_0x9bb3('0x6e')][_0x9bb3('0x6f')]})[_0x9bb3('0x18')](function(_0x35c413){if(_0x35c413['length']===0x1){return _0xc39cc4['id'];}else{var _0x5387f4=_[_0x9bb3('0x70')](_[_0x9bb3('0x21')](_0x35c413,_0x9bb3('0x71')),function(_0x42feb7){return _[_0x9bb3('0x72')](_0x480752,_0x42feb7);});if(_0x5387f4){return _0xc39cc4['id'];}}}));}}return BPromise[_0x9bb3('0x73')](_0x1466e2)['then'](function(_0x4d2dc0){_0x1e05da=_(_0x1e05da)[_0x9bb3('0x74')](_0x4d2dc0)[_0x9bb3('0x75')]()[_0x9bb3('0x76')]();return db[_0x9bb3('0x26')][_0x9bb3('0x38')]({'where':{'id':_0x341f3e[_0x9bb3('0x2c')]['id']}})[_0x9bb3('0x18')](function(_0x19dbd0){return db['sequelize'][_0x9bb3('0x5f')](function(_0x3b5afa){return _0x19dbd0[_0x9bb3('0x77')](_0x341f3e[_0x9bb3('0x2f')][_0x9bb3('0x5a')],{'transaction':_0x3b5afa})['then'](function(){if(!_[_0x9bb3('0x78')](_0x1e05da)){return _0x19dbd0[_0x9bb3('0x79')](_0x1e05da,{'transaction':_0x3b5afa});}})[_0x9bb3('0x18')](function(){_0x1e05da['forEach'](function(_0x57d926){socket['emit'](_0x9bb3('0x7a'),{'UserId':_0x57d926,'MailQueueId':_0x19dbd0['id']});});});});});});})['then'](respondWithStatusCode(_0x413648,null))['catch'](handleError(_0x413648,null));};exports[_0x9bb3('0x7b')]=function(_0x4cc125,_0x56c7cf){return db[_0x9bb3('0x26')][_0x9bb3('0x38')]({'where':{'id':_0x4cc125['params']['id']}})[_0x9bb3('0x18')](handleEntityNotFound(_0x56c7cf,null))[_0x9bb3('0x18')](function(_0x312a33){if(_0x312a33){return _0x312a33['addAgents'](_0x4cc125[_0x9bb3('0x3a')]['ids'],_[_0x9bb3('0x7c')](_0x4cc125[_0x9bb3('0x3a')],[_0x9bb3('0x5a'),'id'])||{})[_0x9bb3('0x7d')](function(_0x137122){for(var _0x7fbeea=0x0;_0x7fbeea<_0x4cc125[_0x9bb3('0x3a')][_0x9bb3('0x5a')][_0x9bb3('0x34')];_0x7fbeea+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x4cc125[_0x9bb3('0x3a')][_0x9bb3('0x5a')][_0x7fbeea]),'MailQueueId':Number(_0x4cc125['params']['id'])});}return _0x137122;});}})[_0x9bb3('0x18')](respondWithResult(_0x56c7cf,null))['catch'](handleError(_0x56c7cf,null));};exports[_0x9bb3('0x79')]=function(_0x51de0a,_0x247993){return db[_0x9bb3('0x26')][_0x9bb3('0x38')]({'where':{'id':_0x51de0a[_0x9bb3('0x2c')]['id']}})[_0x9bb3('0x18')](handleEntityNotFound(_0x247993,null))[_0x9bb3('0x18')](function(_0x417586){if(_0x417586){return _0x417586[_0x9bb3('0x79')](_0x51de0a['query'][_0x9bb3('0x5a')])[_0x9bb3('0x18')](function(){if(_[_0x9bb3('0x7e')](_0x51de0a[_0x9bb3('0x2f')]['ids'])){for(var _0x565ceb=0x0;_0x565ceb<_0x51de0a[_0x9bb3('0x2f')][_0x9bb3('0x5a')]['length'];_0x565ceb+=0x1){socket['emit'](_0x9bb3('0x7a'),{'UserId':Number(_0x51de0a['query']['ids'][_0x565ceb]),'MailQueueId':Number(_0x51de0a[_0x9bb3('0x2c')]['id'])});}}else{socket[_0x9bb3('0x62')]('userMailQueue:remove',{'UserId':Number(_0x51de0a[_0x9bb3('0x2f')][_0x9bb3('0x5a')]),'MailQueueId':Number(_0x51de0a[_0x9bb3('0x2c')]['id'])});}});}})[_0x9bb3('0x18')](respondWithStatusCode(_0x247993,null))[_0x9bb3('0x2a')](handleError(_0x247993,null));};exports[_0x9bb3('0x7f')]=function(_0x3256fe,_0x1565cc){var _0xc64844={};var _0xa37cd5={};var _0x40672b;var _0x1b529b;return db['MailQueue'][_0x9bb3('0x43')]({'where':{'id':_0x3256fe[_0x9bb3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1565cc,null))[_0x9bb3('0x18')](function(_0x5f72c4){if(_0x5f72c4){_0x40672b=_0x5f72c4;_0xa37cd5['model']=_[_0x9bb3('0x2e')](db[_0x9bb3('0x4c')]['rawAttributes']);_0xa37cd5[_0x9bb3('0x2f')]=_['keys'](_0x3256fe[_0x9bb3('0x2f')]);_0xa37cd5[_0x9bb3('0x30')]=_[_0x9bb3('0x31')](_0xa37cd5[_0x9bb3('0x2d')],_0xa37cd5[_0x9bb3('0x2f')]);_0xc64844[_0x9bb3('0x33')]=_[_0x9bb3('0x31')](_0xa37cd5[_0x9bb3('0x2d')],qs[_0x9bb3('0x32')](_0x3256fe[_0x9bb3('0x2f')][_0x9bb3('0x32')]));_0xc64844[_0x9bb3('0x33')]=_0xc64844[_0x9bb3('0x33')][_0x9bb3('0x34')]?_0xc64844[_0x9bb3('0x33')]:_0xa37cd5[_0x9bb3('0x2d')];_0xc64844[_0x9bb3('0x46')]=qs[_0x9bb3('0x47')](_0x3256fe[_0x9bb3('0x2f')][_0x9bb3('0x47')]);_0xc64844[_0x9bb3('0x49')]=qs[_0x9bb3('0x30')](_['pick'](_0x3256fe[_0x9bb3('0x2f')],_0xa37cd5[_0x9bb3('0x30')]));if(_0x3256fe[_0x9bb3('0x2f')][_0x9bb3('0x4b')]){_0xc64844[_0x9bb3('0x49')]=_[_0x9bb3('0x36')](_0xc64844[_0x9bb3('0x49')],{'$or':_['map'](_0xc64844[_0x9bb3('0x33')],function(_0x26ec17){var _0x489bc3={};_0x489bc3[_0x26ec17]={'$like':'%'+_0x3256fe[_0x9bb3('0x2f')][_0x9bb3('0x4b')]+'%'};return _0x489bc3;})});}_0xc64844=_[_0x9bb3('0x36')]({},_0xc64844,_0x3256fe[_0x9bb3('0x37')]);return _0x40672b[_0x9bb3('0x7f')](_0xc64844);}})[_0x9bb3('0x18')](function(_0x539f22){if(_0x539f22){_0x1b529b=_0x539f22['length'];if(!_0x3256fe[_0x9bb3('0x2f')]['hasOwnProperty'](_0x9bb3('0x45'))){_0xc64844['limit']=qs[_0x9bb3('0x10')](_0x3256fe[_0x9bb3('0x2f')]['limit']);_0xc64844[_0x9bb3('0x13')]=qs[_0x9bb3('0x13')](_0x3256fe['query']['offset']);}return _0x40672b['getAgents'](_0xc64844);}})[_0x9bb3('0x18')](function(_0xdd1392){if(_0xdd1392){return _0xdd1392?{'count':_0x1b529b,'rows':_0xdd1392}:null;}})[_0x9bb3('0x18')](respondWithResult(_0x1565cc,null))[_0x9bb3('0x2a')](handleError(_0x1565cc,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 11d60d5..21e6e5b 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 _0xf91f=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x16c73b,_0x2e05e3){var _0x1d2bba=function(_0xe11c6){while(--_0xe11c6){_0x16c73b['push'](_0x16c73b['shift']());}};_0x1d2bba(++_0x2e05e3);}(_0xf91f,0xae));var _0xff91=function(_0x4e090b,_0xb074f3){_0x4e090b=_0x4e090b-0x0;var _0x45d643=_0xf91f[_0x4e090b];return _0x45d643;};'use strict';var EventEmitter=require(_0xff91('0x0'));var MailQueue=require(_0xff91('0x1'))['db'][_0xff91('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xff91('0x3')](0x0);var events={'afterCreate':_0xff91('0x4'),'afterUpdate':_0xff91('0x5'),'afterDestroy':_0xff91('0x6')};function emitEvent(_0x5878f6){return function(_0x536088,_0x3f7648,_0x229cd7){MailQueueEvents[_0xff91('0x7')](_0x5878f6+':'+_0x536088['id'],_0x536088);MailQueueEvents['emit'](_0x5878f6,_0x536088);_0x229cd7(null);};}for(var e in events){if(events[_0xff91('0x8')](e)){var event=events[e];MailQueue[_0xff91('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xb7b9=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x5a8e4c,_0x138b0f){var _0x38ca27=function(_0x1dbcfe){while(--_0x1dbcfe){_0x5a8e4c['push'](_0x5a8e4c['shift']());}};_0x38ca27(++_0x138b0f);}(_0xb7b9,0x6b));var _0x9b7b=function(_0x4a9677,_0x4c2c76){_0x4a9677=_0x4a9677-0x0;var _0x224629=_0xb7b9[_0x4a9677];return _0x224629;};'use strict';var EventEmitter=require(_0x9b7b('0x0'));var MailQueue=require(_0x9b7b('0x1'))['db'][_0x9b7b('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9b7b('0x3')](0x0);var events={'afterCreate':_0x9b7b('0x4'),'afterUpdate':_0x9b7b('0x5'),'afterDestroy':_0x9b7b('0x6')};function emitEvent(_0x53166f){return function(_0x1c811b,_0x53a78a,_0x410e9e){MailQueueEvents['emit'](_0x53166f+':'+_0x1c811b['id'],_0x1c811b);MailQueueEvents[_0x9b7b('0x7')](_0x53166f,_0x1c811b);_0x410e9e(null);};}for(var e in events){if(events[_0x9b7b('0x8')](e)){var event=events[e];MailQueue[_0x9b7b('0x9')](e,emitEvent(event));}}module[_0x9b7b('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 3995bad..8ca6947 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 _0x6299=['path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x3dda0f,_0x5b9902){var _0x1b0488=function(_0x267031){while(--_0x267031){_0x3dda0f['push'](_0x3dda0f['shift']());}};_0x1b0488(++_0x5b9902);}(_0x6299,0xf2));var _0x9629=function(_0x32dd4,_0x452033){_0x32dd4=_0x32dd4-0x0;var _0x11f913=_0x6299[_0x32dd4];return _0x11f913;};'use strict';var _=require('lodash');var util=require(_0x9629('0x0'));var logger=require(_0x9629('0x1'))(_0x9629('0x2'));var moment=require(_0x9629('0x3'));var BPromise=require('bluebird');var rp=require(_0x9629('0x4'));var fs=require('fs');var path=require(_0x9629('0x5'));var rimraf=require(_0x9629('0x6'));var config=require(_0x9629('0x7'));var attributes=require(_0x9629('0x8'));module[_0x9629('0x9')]=function(_0x4df6cf,_0x3e9266){return _0x4df6cf[_0x9629('0xa')](_0x9629('0xb'),attributes,{'tableName':_0x9629('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff0=['moment','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api'];(function(_0x519527,_0x47486e){var _0x5c9599=function(_0x265f1d){while(--_0x265f1d){_0x519527['push'](_0x519527['shift']());}};_0x5c9599(++_0x47486e);}(_0x5ff0,0x1f4));var _0x05ff=function(_0x34b84c,_0x30cb90){_0x34b84c=_0x34b84c-0x0;var _0x38f2b4=_0x5ff0[_0x34b84c];return _0x38f2b4;};'use strict';var _=require(_0x05ff('0x0'));var util=require(_0x05ff('0x1'));var logger=require(_0x05ff('0x2'))(_0x05ff('0x3'));var moment=require(_0x05ff('0x4'));var BPromise=require('bluebird');var rp=require(_0x05ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05ff('0x6'));var config=require(_0x05ff('0x7'));var attributes=require(_0x05ff('0x8'));module[_0x05ff('0x9')]=function(_0x4a57d8,_0x1527f8){return _0x4a57d8[_0x05ff('0xa')](_0x05ff('0xb'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 23aa140..ecd88c3 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 _0x6a98=['socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','MailQueue','findAll','options','raw','where','attributes','include','map','model','GetMailQueue','stringify','ShowMailQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x42e030,_0x4e48dc){var _0x285f73=function(_0x28941c){while(--_0x28941c){_0x42e030['push'](_0x42e030['shift']());}};_0x285f73(++_0x4e48dc);}(_0x6a98,0xc7));var _0x86a9=function(_0xe83ac5,_0x279b67){_0xe83ac5=_0xe83ac5-0x0;var _0x3df16e=_0x6a98[_0xe83ac5];return _0x3df16e;};'use strict';var _=require('lodash');var util=require(_0x86a9('0x0'));var moment=require('moment');var BPromise=require(_0x86a9('0x1'));var rs=require(_0x86a9('0x2'));var fs=require('fs');var Redis=require(_0x86a9('0x3'));var db=require(_0x86a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x86a9('0x5'))('rpc');var config=require(_0x86a9('0x6'));var jayson=require(_0x86a9('0x7'));var client=jayson[_0x86a9('0x8')]['http']({'port':0x232a});config[_0x86a9('0x9')]=_['defaults'](config[_0x86a9('0x9')],{'host':_0x86a9('0xa'),'port':0x18eb});var socket=require(_0x86a9('0xb'))(new Redis(config[_0x86a9('0x9')]));require(_0x86a9('0xc'))['register'](socket);function respondWithRpcPromise(_0x46509d,_0x16775b,_0x455b4a){return new BPromise(function(_0x8aa0cf,_0x2a31f5){return client[_0x86a9('0xd')](_0x46509d,_0x455b4a)[_0x86a9('0xe')](function(_0x47d689){logger['info'](_0x86a9('0xf'),_0x16775b,_0x86a9('0x10'));logger[_0x86a9('0x11')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x16775b,'request\x20sent',JSON['stringify'](_0x47d689));if(_0x47d689[_0x86a9('0x12')]){if(_0x47d689[_0x86a9('0x12')]['code']===0x1f4){logger[_0x86a9('0x12')](_0x86a9('0xf'),_0x16775b,_0x47d689[_0x86a9('0x12')][_0x86a9('0x13')]);return _0x2a31f5(_0x47d689[_0x86a9('0x12')][_0x86a9('0x13')]);}logger[_0x86a9('0x12')]('MailQueue,\x20%s,\x20%s',_0x16775b,_0x47d689[_0x86a9('0x12')]['message']);return _0x8aa0cf(_0x47d689[_0x86a9('0x12')][_0x86a9('0x13')]);}else{logger[_0x86a9('0x14')](_0x86a9('0xf'),_0x16775b,_0x86a9('0x10'));_0x8aa0cf(_0x47d689[_0x86a9('0x15')][_0x86a9('0x13')]);}})[_0x86a9('0x16')](function(_0x22512e){logger[_0x86a9('0x12')]('MailQueue,\x20%s,\x20%s',_0x16775b,_0x22512e);_0x2a31f5(_0x22512e);});});}exports['GetMailQueue']=function(_0x1c770c){var _0x30b279=this;return new Promise(function(_0x3d64d8,_0x55cdd4){return db[_0x86a9('0x17')][_0x86a9('0x18')]({'raw':_0x1c770c[_0x86a9('0x19')]?_0x1c770c['options'][_0x86a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c770c[_0x86a9('0x19')]?_0x1c770c['options'][_0x86a9('0x1b')]||null:null,'attributes':_0x1c770c[_0x86a9('0x19')]?_0x1c770c[_0x86a9('0x19')][_0x86a9('0x1c')]||null:null,'limit':_0x1c770c[_0x86a9('0x19')]?_0x1c770c[_0x86a9('0x19')]['limit']||null:null,'include':_0x1c770c[_0x86a9('0x19')]?_0x1c770c['options'][_0x86a9('0x1d')]?_[_0x86a9('0x1e')](_0x1c770c['options'][_0x86a9('0x1d')],function(_0x189ba6){return{'model':db[_0x189ba6['model']],'as':_0x189ba6['as'],'attributes':_0x189ba6[_0x86a9('0x1c')],'include':_0x189ba6[_0x86a9('0x1d')]?_[_0x86a9('0x1e')](_0x189ba6[_0x86a9('0x1d')],function(_0x2cef97){return{'model':db[_0x2cef97[_0x86a9('0x1f')]],'as':_0x2cef97['as'],'attributes':_0x2cef97[_0x86a9('0x1c')],'include':_0x2cef97[_0x86a9('0x1d')]?_[_0x86a9('0x1e')](_0x2cef97[_0x86a9('0x1d')],function(_0x4f509d){return{'model':db[_0x4f509d[_0x86a9('0x1f')]],'as':_0x4f509d['as'],'attributes':_0x4f509d[_0x86a9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x86a9('0xe')](function(_0x50982d){logger[_0x86a9('0x14')](_0x86a9('0x20'),_0x1c770c);logger['debug'](_0x86a9('0x20'),_0x1c770c,JSON[_0x86a9('0x21')](_0x50982d));_0x3d64d8(_0x50982d);})['catch'](function(_0x4135c4){logger[_0x86a9('0x12')](_0x86a9('0x20'),_0x4135c4[_0x86a9('0x13')],_0x1c770c);_0x55cdd4(_0x30b279[_0x86a9('0x12')](0x1f4,_0x4135c4[_0x86a9('0x13')]));});});};exports[_0x86a9('0x22')]=function(_0xf75ecb){var _0x4cd5cd=this;return new Promise(function(_0x2cb2eb,_0x1aeb8f){return db[_0x86a9('0x17')]['find']({'raw':_0xf75ecb[_0x86a9('0x19')]?_0xf75ecb[_0x86a9('0x19')][_0x86a9('0x1a')]===undefined?!![]:![]:!![],'where':_0xf75ecb[_0x86a9('0x19')]?_0xf75ecb[_0x86a9('0x19')]['where']||null:null,'attributes':_0xf75ecb[_0x86a9('0x19')]?_0xf75ecb[_0x86a9('0x19')][_0x86a9('0x1c')]||null:null,'include':_0xf75ecb[_0x86a9('0x19')]?_0xf75ecb[_0x86a9('0x19')][_0x86a9('0x1d')]?_[_0x86a9('0x1e')](_0xf75ecb['options'][_0x86a9('0x1d')],function(_0x5d4ab9){return{'model':db[_0x5d4ab9[_0x86a9('0x1f')]],'as':_0x5d4ab9['as'],'attributes':_0x5d4ab9[_0x86a9('0x1c')],'include':_0x5d4ab9[_0x86a9('0x1d')]?_[_0x86a9('0x1e')](_0x5d4ab9[_0x86a9('0x1d')],function(_0x3624fb){return{'model':db[_0x3624fb[_0x86a9('0x1f')]],'as':_0x3624fb['as'],'attributes':_0x3624fb['attributes'],'include':_0x3624fb['include']?_[_0x86a9('0x1e')](_0x3624fb[_0x86a9('0x1d')],function(_0x1669cc){return{'model':db[_0x1669cc[_0x86a9('0x1f')]],'as':_0x1669cc['as'],'attributes':_0x1669cc[_0x86a9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x86a9('0xe')](function(_0x71c2bd){logger[_0x86a9('0x14')](_0x86a9('0x22'),_0xf75ecb);logger[_0x86a9('0x11')](_0x86a9('0x22'),_0xf75ecb,JSON[_0x86a9('0x21')](_0x71c2bd));_0x2cb2eb(_0x71c2bd);})[_0x86a9('0x16')](function(_0x3a28a2){logger[_0x86a9('0x12')]('ShowMailQueue',_0x3a28a2[_0x86a9('0x13')],_0xf75ecb);_0x1aeb8f(_0x4cd5cd['error'](0x1f4,_0x3a28a2[_0x86a9('0x13')]));});});}; \ No newline at end of file +var _0xf9f7=['ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','debug','request\x20sent','stringify','error','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','options','where','include','map','model','attributes','catch','then'];(function(_0x551fbe,_0x3a78b3){var _0x5b02ac=function(_0x1948ec){while(--_0x1948ec){_0x551fbe['push'](_0x551fbe['shift']());}};_0x5b02ac(++_0x3a78b3);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x42ecb5,_0x20b4d2){_0x42ecb5=_0x42ecb5-0x0;var _0x487442=_0xf9f7[_0x42ecb5];return _0x487442;};'use strict';var _=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var moment=require(_0x7f9f('0x2'));var BPromise=require(_0x7f9f('0x3'));var rs=require(_0x7f9f('0x4'));var fs=require('fs');var Redis=require(_0x7f9f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f9f('0x6'))(_0x7f9f('0x7'));var config=require(_0x7f9f('0x8'));var jayson=require(_0x7f9f('0x9'));var client=jayson[_0x7f9f('0xa')][_0x7f9f('0xb')]({'port':0x232a});config['redis']=_[_0x7f9f('0xc')](config[_0x7f9f('0xd')],{'host':_0x7f9f('0xe'),'port':0x18eb});var socket=require(_0x7f9f('0xf'))(new Redis(config[_0x7f9f('0xd')]));require('./mailQueue.socket')[_0x7f9f('0x10')](socket);function respondWithRpcPromise(_0x229d32,_0x39d8a2,_0x25bbfb){return new BPromise(function(_0x12fefe,_0x3ff15a){return client[_0x7f9f('0x11')](_0x229d32,_0x25bbfb)['then'](function(_0x45bf92){logger[_0x7f9f('0x12')]('MailQueue,\x20%s,\x20%s',_0x39d8a2,'request\x20sent');logger[_0x7f9f('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x39d8a2,_0x7f9f('0x14'),JSON[_0x7f9f('0x15')](_0x45bf92));if(_0x45bf92['error']){if(_0x45bf92[_0x7f9f('0x16')]['code']===0x1f4){logger[_0x7f9f('0x16')](_0x7f9f('0x17'),_0x39d8a2,_0x45bf92[_0x7f9f('0x16')][_0x7f9f('0x18')]);return _0x3ff15a(_0x45bf92[_0x7f9f('0x16')]['message']);}logger[_0x7f9f('0x16')](_0x7f9f('0x17'),_0x39d8a2,_0x45bf92['error'][_0x7f9f('0x18')]);return _0x12fefe(_0x45bf92['error'][_0x7f9f('0x18')]);}else{logger[_0x7f9f('0x12')](_0x7f9f('0x17'),_0x39d8a2,_0x7f9f('0x14'));_0x12fefe(_0x45bf92[_0x7f9f('0x19')][_0x7f9f('0x18')]);}})['catch'](function(_0xb277b3){logger[_0x7f9f('0x16')]('MailQueue,\x20%s,\x20%s',_0x39d8a2,_0xb277b3);_0x3ff15a(_0xb277b3);});});}exports[_0x7f9f('0x1a')]=function(_0x52af88){var _0x2659c9=this;return new Promise(function(_0x15c06a,_0x8ad1b2){return db[_0x7f9f('0x1b')]['findAll']({'raw':_0x52af88[_0x7f9f('0x1c')]?_0x52af88['options']['raw']===undefined?!![]:![]:!![],'where':_0x52af88[_0x7f9f('0x1c')]?_0x52af88[_0x7f9f('0x1c')][_0x7f9f('0x1d')]||null:null,'attributes':_0x52af88[_0x7f9f('0x1c')]?_0x52af88[_0x7f9f('0x1c')]['attributes']||null:null,'limit':_0x52af88['options']?_0x52af88[_0x7f9f('0x1c')]['limit']||null:null,'include':_0x52af88[_0x7f9f('0x1c')]?_0x52af88[_0x7f9f('0x1c')][_0x7f9f('0x1e')]?_[_0x7f9f('0x1f')](_0x52af88[_0x7f9f('0x1c')][_0x7f9f('0x1e')],function(_0x56af13){return{'model':db[_0x56af13[_0x7f9f('0x20')]],'as':_0x56af13['as'],'attributes':_0x56af13['attributes'],'include':_0x56af13[_0x7f9f('0x1e')]?_[_0x7f9f('0x1f')](_0x56af13[_0x7f9f('0x1e')],function(_0x59eba2){return{'model':db[_0x59eba2[_0x7f9f('0x20')]],'as':_0x59eba2['as'],'attributes':_0x59eba2[_0x7f9f('0x21')],'include':_0x59eba2[_0x7f9f('0x1e')]?_['map'](_0x59eba2[_0x7f9f('0x1e')],function(_0x3b6e4c){return{'model':db[_0x3b6e4c['model']],'as':_0x3b6e4c['as'],'attributes':_0x3b6e4c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d7600){logger['info'](_0x7f9f('0x1a'),_0x52af88);logger[_0x7f9f('0x13')]('GetMailQueue',_0x52af88,JSON['stringify'](_0x3d7600));_0x15c06a(_0x3d7600);})[_0x7f9f('0x22')](function(_0x4d7945){logger[_0x7f9f('0x16')]('GetMailQueue',_0x4d7945['message'],_0x52af88);_0x8ad1b2(_0x2659c9['error'](0x1f4,_0x4d7945[_0x7f9f('0x18')]));});});};exports['ShowMailQueue']=function(_0x348e0f){var _0x298193=this;return new Promise(function(_0x1f8ac0,_0xa890c3){return db[_0x7f9f('0x1b')]['find']({'raw':_0x348e0f['options']?_0x348e0f[_0x7f9f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x348e0f['options']?_0x348e0f[_0x7f9f('0x1c')][_0x7f9f('0x1d')]||null:null,'attributes':_0x348e0f[_0x7f9f('0x1c')]?_0x348e0f[_0x7f9f('0x1c')][_0x7f9f('0x21')]||null:null,'include':_0x348e0f[_0x7f9f('0x1c')]?_0x348e0f[_0x7f9f('0x1c')][_0x7f9f('0x1e')]?_[_0x7f9f('0x1f')](_0x348e0f[_0x7f9f('0x1c')][_0x7f9f('0x1e')],function(_0x583165){return{'model':db[_0x583165[_0x7f9f('0x20')]],'as':_0x583165['as'],'attributes':_0x583165[_0x7f9f('0x21')],'include':_0x583165['include']?_[_0x7f9f('0x1f')](_0x583165['include'],function(_0x42673c){return{'model':db[_0x42673c[_0x7f9f('0x20')]],'as':_0x42673c['as'],'attributes':_0x42673c[_0x7f9f('0x21')],'include':_0x42673c[_0x7f9f('0x1e')]?_[_0x7f9f('0x1f')](_0x42673c['include'],function(_0x760419){return{'model':db[_0x760419[_0x7f9f('0x20')]],'as':_0x760419['as'],'attributes':_0x760419['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f9f('0x23')](function(_0x1bf58a){logger[_0x7f9f('0x12')](_0x7f9f('0x24'),_0x348e0f);logger[_0x7f9f('0x13')](_0x7f9f('0x24'),_0x348e0f,JSON[_0x7f9f('0x15')](_0x1bf58a));_0x1f8ac0(_0x1bf58a);})[_0x7f9f('0x22')](function(_0x3b1cad){logger[_0x7f9f('0x16')](_0x7f9f('0x24'),_0x3b1cad['message'],_0x348e0f);_0xa890c3(_0x298193[_0x7f9f('0x16')](0x1f4,_0x3b1cad[_0x7f9f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index fa0f7fe..facdf27 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 _0xf8ff=['length','remove','register'];(function(_0x4430b8,_0x37992c){var _0x390cee=function(_0x4692e8){while(--_0x4692e8){_0x4430b8['push'](_0x4430b8['shift']());}};_0x390cee(++_0x37992c);}(_0xf8ff,0x127));var _0xff8f=function(_0x1fcf1b,_0x214549){_0x1fcf1b=_0x1fcf1b-0x0;var _0x5d2952=_0xf8ff[_0x1fcf1b];return _0x5d2952;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xff8f('0x0'),'update'];function createListener(_0x252103,_0x2e0180){return function(_0x45423f){_0x2e0180['emit'](_0x252103,_0x45423f);};}function removeListener(_0x5c0fa0,_0x3a5744){return function(){MailQueueEvents['removeListener'](_0x5c0fa0,_0x3a5744);};}exports[_0xff8f('0x1')]=function(_0x11ab12){for(var _0x3c6a96=0x0,_0x4d1e1b=events[_0xff8f('0x2')];_0x3c6a96<_0x4d1e1b;_0x3c6a96++){var _0x10bb20=events[_0x3c6a96];var _0x2898af=createListener('mailQueue:'+_0x10bb20,_0x11ab12);MailQueueEvents['on'](_0x10bb20,_0x2898af);}}; \ No newline at end of file +var _0xdd8c=['update','removeListener','register','length','mailQueue:','save'];(function(_0x15d700,_0x56b0f9){var _0x1630fc=function(_0x417825){while(--_0x417825){_0x15d700['push'](_0x15d700['shift']());}};_0x1630fc(++_0x56b0f9);}(_0xdd8c,0xcb));var _0xcdd8=function(_0x21f79c,_0x5d3a38){_0x21f79c=_0x21f79c-0x0;var _0x5ecf74=_0xdd8c[_0x21f79c];return _0x5ecf74;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xcdd8('0x0'),'remove',_0xcdd8('0x1')];function createListener(_0x9d1b00,_0x36674b){return function(_0x1b3987){_0x36674b['emit'](_0x9d1b00,_0x1b3987);};}function removeListener(_0x2a710b,_0x5bc84c){return function(){MailQueueEvents[_0xcdd8('0x2')](_0x2a710b,_0x5bc84c);};}exports[_0xcdd8('0x3')]=function(_0x2b8bc5){for(var _0x334327=0x0,_0x5cc13a=events[_0xcdd8('0x4')];_0x334327<_0x5cc13a;_0x334327++){var _0x40e2c3=events[_0x334327];var _0x508cf5=createListener(_0xcdd8('0x5')+_0x40e2c3,_0x2b8bc5);MailQueueEvents['on'](_0x40e2c3,_0x508cf5);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f12fb97..fba8cb0 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 _0x68c0=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x68c0,0x151));var _0x068c=function(_0x29891f,_0x25178f){_0x29891f=_0x29891f-0x0;var _0x4d43fa=_0x68c0[_0x29891f];return _0x4d43fa;};'use strict';var multer=require(_0x068c('0x0'));var util=require(_0x068c('0x1'));var path=require(_0x068c('0x2'));var timeout=require(_0x068c('0x3'));var express=require('express');var router=express[_0x068c('0x4')]();var fs_extra=require(_0x068c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x068c('0x6'));var config=require(_0x068c('0x7'));var controller=require('./mailQueueReport.controller');router[_0x068c('0x8')]('/',auth[_0x068c('0x9')](),controller[_0x068c('0xa')]);router['get'](_0x068c('0xb'),auth[_0x068c('0x9')](),controller[_0x068c('0xc')]);router[_0x068c('0x8')](_0x068c('0xd'),auth[_0x068c('0x9')](),controller[_0x068c('0xe')]);router[_0x068c('0xf')]('/',auth['isAuthenticated'](),controller[_0x068c('0x10')]);router[_0x068c('0x11')](_0x068c('0xd'),auth['isAuthenticated'](),controller[_0x068c('0x12')]);router[_0x068c('0x13')](_0x068c('0xd'),auth['isAuthenticated'](),controller[_0x068c('0x14')]);module[_0x068c('0x15')]=router; \ No newline at end of file +var _0x0be5=['../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','/:id','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x564e9f,_0x225a15){var _0x3a9f3e=function(_0x1bbe48){while(--_0x1bbe48){_0x564e9f['push'](_0x564e9f['shift']());}};_0x3a9f3e(++_0x225a15);}(_0x0be5,0xf6));var _0x50be=function(_0x229971,_0x3961f7){_0x229971=_0x229971-0x0;var _0x1d5266=_0x0be5[_0x229971];return _0x1d5266;};'use strict';var multer=require(_0x50be('0x0'));var util=require(_0x50be('0x1'));var path=require('path');var timeout=require(_0x50be('0x2'));var express=require(_0x50be('0x3'));var router=express[_0x50be('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50be('0x5'));var config=require(_0x50be('0x6'));var controller=require(_0x50be('0x7'));router[_0x50be('0x8')]('/',auth[_0x50be('0x9')](),controller[_0x50be('0xa')]);router[_0x50be('0x8')]('/describe',auth[_0x50be('0x9')](),controller[_0x50be('0xb')]);router[_0x50be('0x8')]('/:id',auth[_0x50be('0x9')](),controller[_0x50be('0xc')]);router[_0x50be('0xd')]('/',auth[_0x50be('0x9')](),controller[_0x50be('0xe')]);router['put'](_0x50be('0xf'),auth[_0x50be('0x9')](),controller[_0x50be('0x10')]);router['delete'](_0x50be('0xf'),auth[_0x50be('0x9')](),controller[_0x50be('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 d688ac5..7879af5 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 _0xdb15=['exports','STRING','DATE','moment','sequelize'];(function(_0x525370,_0x5abe18){var _0x4a1ae9=function(_0x257f97){while(--_0x257f97){_0x525370['push'](_0x525370['shift']());}};_0x4a1ae9(++_0x5abe18);}(_0xdb15,0x94));var _0x5db1=function(_0x354c4b,_0x1b8630){_0x354c4b=_0x354c4b-0x0;var _0x37b698=_0xdb15[_0x354c4b];return _0x37b698;};'use strict';var moment=require(_0x5db1('0x0'));var Sequelize=require(_0x5db1('0x1'));module[_0x5db1('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5db1('0x3')]},'joinAt':{'type':Sequelize[_0x5db1('0x4')]},'leaveAt':{'type':Sequelize[_0x5db1('0x4')]},'acceptAt':{'type':Sequelize[_0x5db1('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5db1('0x3')]}}; \ No newline at end of file +var _0xe9b9=['STRING','DATE','moment','sequelize','exports'];(function(_0x20a25e,_0x1a932a){var _0x38a8cf=function(_0x1add0f){while(--_0x1add0f){_0x20a25e['push'](_0x20a25e['shift']());}};_0x38a8cf(++_0x1a932a);}(_0xe9b9,0xd4));var _0x9e9b=function(_0x23e2a3,_0x13e18e){_0x23e2a3=_0x23e2a3-0x0;var _0x27901b=_0xe9b9[_0x23e2a3];return _0x27901b;};'use strict';var moment=require(_0x9e9b('0x0'));var Sequelize=require(_0x9e9b('0x1'));module[_0x9e9b('0x2')]={'uniqueid':{'type':Sequelize[_0x9e9b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9e9b('0x3')]},'joinAt':{'type':Sequelize[_0x9e9b('0x4')]},'leaveAt':{'type':Sequelize[_0x9e9b('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9e9b('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d3085d2..6fd40ec 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 _0x0adf=['find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','MailQueueReport','count','includeAll','include','findAll','rows','catch','show','params','fields'];(function(_0x386078,_0x49ad4f){var _0xd6675c=function(_0x1573c9){while(--_0x1573c9){_0x386078['push'](_0x386078['shift']());}};_0xd6675c(++_0x49ad4f);}(_0x0adf,0x1d2));var _0xf0ad=function(_0xc3db9c,_0x120261){_0xc3db9c=_0xc3db9c-0x0;var _0x1bf790=_0x0adf[_0xc3db9c];return _0x1bf790;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require(_0xf0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require(_0xf0ad('0x5'));var Mustache=require(_0xf0ad('0x6'));var util=require(_0xf0ad('0x7'));var path=require(_0xf0ad('0x8'));var sox=require(_0xf0ad('0x9'));var csv=require('to-csv');var ejs=require(_0xf0ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0x10'));var querystring=require(_0xf0ad('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require(_0xf0ad('0x16'))(_0xf0ad('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];function respondWithStatusCode(_0x3646a2,_0x238c3b){_0x238c3b=_0x238c3b||0xcc;return function(_0x597c40){if(_0x597c40){return _0x3646a2[_0xf0ad('0x1a')](_0x238c3b);}return _0x3646a2[_0xf0ad('0x1b')](_0x238c3b)['end']();};}function respondWithResult(_0x49df92,_0x5332e9){_0x5332e9=_0x5332e9||0xc8;return function(_0x221d7b){if(_0x221d7b){return _0x49df92['status'](_0x5332e9)[_0xf0ad('0x1c')](_0x221d7b);}};}function respondWithFilteredResult(_0x313ad6,_0xfa544c){return function(_0xfa829e){if(_0xfa829e){var _0x237dd9=typeof _0xfa544c['offset']===_0xf0ad('0x1d')&&typeof _0xfa544c[_0xf0ad('0x1e')]===_0xf0ad('0x1d');var _0x1c9fac=_0xfa829e['count'];var _0x4e9970=_0x237dd9?0x0:_0xfa544c[_0xf0ad('0x1f')];var _0x46fb20=_0x237dd9?_0xfa829e['count']:_0xfa544c[_0xf0ad('0x1f')]+_0xfa544c[_0xf0ad('0x1e')];var _0x9a95bf;if(_0x46fb20>=_0x1c9fac){_0x46fb20=_0x1c9fac;_0x9a95bf=0xc8;}else{_0x9a95bf=0xce;}_0x313ad6[_0xf0ad('0x1b')](_0x9a95bf);return _0x313ad6['set']('Content-Range',_0x4e9970+'-'+_0x46fb20+'/'+_0x1c9fac)[_0xf0ad('0x1c')](_0xfa829e);}return null;};}function patchUpdates(_0x2da425){return function(_0x37b968){try{jsonpatch[_0xf0ad('0x20')](_0x37b968,_0x2da425,!![]);}catch(_0x2ac8ba){return BPromise[_0xf0ad('0x21')](_0x2ac8ba);}return _0x37b968['save']();};}function saveUpdates(_0x33c95d,_0x16e62a){return function(_0x31635b){if(_0x31635b){return _0x31635b[_0xf0ad('0x22')](_0x33c95d)[_0xf0ad('0x23')](function(_0x88b47b){return _0x88b47b;});}return null;};}function removeEntity(_0xb91769,_0x276322){return function(_0x3fc97e){if(_0x3fc97e){return _0x3fc97e[_0xf0ad('0x24')]()[_0xf0ad('0x23')](function(){_0xb91769[_0xf0ad('0x1b')](0xcc)[_0xf0ad('0x25')]();});}};}function handleEntityNotFound(_0x456f81,_0x879f89){return function(_0x557f90){if(!_0x557f90){_0x456f81[_0xf0ad('0x1a')](0x194);}return _0x557f90;};}function handleError(_0x1507a3,_0x248794){_0x248794=_0x248794||0x1f4;return function(_0x7377d7){logger[_0xf0ad('0x26')](_0x7377d7[_0xf0ad('0x27')]);if(_0x7377d7['name']){delete _0x7377d7[_0xf0ad('0x28')];}_0x1507a3[_0xf0ad('0x1b')](_0x248794)[_0xf0ad('0x29')](_0x7377d7);};}exports[_0xf0ad('0x2a')]=function(_0x1b6880,_0x1ac25c){var _0x267b7a={},_0x1bee71={},_0x2386e8={'count':0x0,'rows':[]};var _0x39c46c=_[_0xf0ad('0x2b')](db['MailQueueReport'][_0xf0ad('0x2c')],function(_0x5f5115){return{'name':_0x5f5115[_0xf0ad('0x2d')],'type':_0x5f5115['type'][_0xf0ad('0x2e')]};});_0x1bee71[_0xf0ad('0x2f')]=_[_0xf0ad('0x2b')](_0x39c46c,_0xf0ad('0x28'));_0x1bee71[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x1b6880[_0xf0ad('0x30')]);_0x1bee71[_0xf0ad('0x32')]=_['intersection'](_0x1bee71['model'],_0x1bee71[_0xf0ad('0x30')]);_0x267b7a[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1bee71[_0xf0ad('0x2f')],qs['fields'](_0x1b6880[_0xf0ad('0x30')]['fields']));_0x267b7a[_0xf0ad('0x33')]=_0x267b7a['attributes'][_0xf0ad('0x35')]?_0x267b7a['attributes']:_0x1bee71[_0xf0ad('0x2f')];if(!_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x36')](_0xf0ad('0x37'))){_0x267b7a[_0xf0ad('0x1e')]=qs[_0xf0ad('0x1e')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x1e')]);_0x267b7a['offset']=qs[_0xf0ad('0x1f')](_0x1b6880['query'][_0xf0ad('0x1f')]);}_0x267b7a['order']=qs[_0xf0ad('0x38')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x38')]);_0x267b7a[_0xf0ad('0x39')]=qs[_0xf0ad('0x32')](_['pick'](_0x1b6880[_0xf0ad('0x30')],_0x1bee71[_0xf0ad('0x32')]),_0x39c46c);if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]){_0x267b7a[_0xf0ad('0x39')]=_[_0xf0ad('0x3b')](_0x267b7a[_0xf0ad('0x39')],{'$or':_['map'](_0x39c46c,function(_0x2e0c7a){if(_0x2e0c7a[_0xf0ad('0x3c')]!==_0xf0ad('0x3d')){var _0x189f67={};_0x189f67[_0x2e0c7a[_0xf0ad('0x28')]]={'$like':'%'+_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]+'%'};return _0x189f67;}})});}_0x267b7a=_[_0xf0ad('0x3b')]({},_0x267b7a,_0x1b6880[_0xf0ad('0x3e')]);var _0x5dd631={'where':_0x267b7a[_0xf0ad('0x39')]};return db[_0xf0ad('0x3f')][_0xf0ad('0x40')](_0x5dd631)['then'](function(_0x510f54){_0x2386e8['count']=_0x510f54;if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x267b7a[_0xf0ad('0x42')]=[{'all':!![]}];}return db[_0xf0ad('0x3f')][_0xf0ad('0x43')](_0x267b7a);})[_0xf0ad('0x23')](function(_0x39083d){_0x2386e8[_0xf0ad('0x44')]=_0x39083d;return _0x2386e8;})[_0xf0ad('0x23')](respondWithFilteredResult(_0x1ac25c,_0x267b7a))[_0xf0ad('0x45')](handleError(_0x1ac25c,null));};exports[_0xf0ad('0x46')]=function(_0x516a72,_0x4ea947){var _0x5cd1dc={'raw':!![],'where':{'id':_0x516a72[_0xf0ad('0x47')]['id']}},_0x1c0609={};_0x1c0609['model']=_[_0xf0ad('0x31')](db[_0xf0ad('0x3f')]['rawAttributes']);_0x1c0609[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x516a72[_0xf0ad('0x30')]);_0x1c0609[_0xf0ad('0x32')]=_['intersection'](_0x1c0609[_0xf0ad('0x2f')],_0x1c0609[_0xf0ad('0x30')]);_0x5cd1dc[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1c0609[_0xf0ad('0x2f')],qs[_0xf0ad('0x48')](_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x48')]));_0x5cd1dc[_0xf0ad('0x33')]=_0x5cd1dc[_0xf0ad('0x33')][_0xf0ad('0x35')]?_0x5cd1dc['attributes']:_0x1c0609[_0xf0ad('0x2f')];if(_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x5cd1dc['include']=[{'all':!![]}];}_0x5cd1dc=_['merge']({},_0x5cd1dc,_0x516a72[_0xf0ad('0x3e')]);return db[_0xf0ad('0x3f')][_0xf0ad('0x49')](_0x5cd1dc)[_0xf0ad('0x23')](handleEntityNotFound(_0x4ea947,null))[_0xf0ad('0x23')](respondWithResult(_0x4ea947,null))[_0xf0ad('0x45')](handleError(_0x4ea947,null));};exports[_0xf0ad('0x4a')]=function(_0x561f2a,_0x1e35ce){return db['MailQueueReport'][_0xf0ad('0x4a')](_0x561f2a[_0xf0ad('0x4b')],{})[_0xf0ad('0x23')](respondWithResult(_0x1e35ce,0xc9))[_0xf0ad('0x45')](handleError(_0x1e35ce,null));};exports[_0xf0ad('0x22')]=function(_0x5b18a7,_0x4e8ef5){if(_0x5b18a7[_0xf0ad('0x4b')]['id']){delete _0x5b18a7[_0xf0ad('0x4b')]['id'];}return db[_0xf0ad('0x3f')][_0xf0ad('0x49')]({'where':{'id':_0x5b18a7[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x4e8ef5,null))[_0xf0ad('0x23')](saveUpdates(_0x5b18a7['body'],null))[_0xf0ad('0x23')](respondWithResult(_0x4e8ef5,null))[_0xf0ad('0x45')](handleError(_0x4e8ef5,null));};exports[_0xf0ad('0x24')]=function(_0xda0e52,_0x2cb082){return db['MailQueueReport'][_0xf0ad('0x49')]({'where':{'id':_0xda0e52[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x2cb082,null))[_0xf0ad('0x23')](removeEntity(_0x2cb082,null))[_0xf0ad('0x45')](handleError(_0x2cb082,null));};exports[_0xf0ad('0x4c')]=function(_0x3d156d,_0x5e75d0){return db[_0xf0ad('0x3f')][_0xf0ad('0x4c')]()[_0xf0ad('0x23')](respondWithResult(_0x5e75d0,null))['catch'](handleError(_0x5e75d0,null));}; \ No newline at end of file +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','MailQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x5d0500,_0x275669){var _0x2c4f52=function(_0x477561){while(--_0x477561){_0x5d0500['push'](_0x5d0500['shift']());}};_0x2c4f52(++_0x275669);}(_0x5b12,0xa3));var _0x25b1=function(_0x5e7ce1,_0xc99dea){_0x5e7ce1=_0x5e7ce1-0x0;var _0x5987ea=_0x5b12[_0x5e7ce1];return _0x5987ea;};'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['MailQueueReport'][_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 diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c1aee61..af5af41 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 _0x0a3c=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x143d34,_0x462642){var _0x4234d3=function(_0x5f2618){while(--_0x5f2618){_0x143d34['push'](_0x143d34['shift']());}};_0x4234d3(++_0x462642);}(_0x0a3c,0x1f4));var _0xc0a3=function(_0x29af29,_0x43e7a4){_0x29af29=_0x29af29-0x0;var _0x215398=_0x0a3c[_0x29af29];return _0x215398;};'use strict';var _=require(_0xc0a3('0x0'));var util=require(_0xc0a3('0x1'));var logger=require(_0xc0a3('0x2'))(_0xc0a3('0x3'));var moment=require(_0xc0a3('0x4'));var BPromise=require(_0xc0a3('0x5'));var rp=require(_0xc0a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0a3('0x7'));var config=require(_0xc0a3('0x8'));var attributes=require(_0xc0a3('0x9'));module[_0xc0a3('0xa')]=function(_0x142873,_0xd463b9){return _0x142873[_0xc0a3('0xb')](_0xc0a3('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xc0a3('0xd'),'fields':[_0xc0a3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x152d=['path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x274302,_0x4a60d4){var _0x16137b=function(_0x3d25e8){while(--_0x3d25e8){_0x274302['push'](_0x274302['shift']());}};_0x16137b(++_0x4a60d4);}(_0x152d,0xaf));var _0xd152=function(_0x2a8e10,_0x5e2c96){_0x2a8e10=_0x2a8e10-0x0;var _0x1097ba=_0x152d[_0x2a8e10];return _0x1097ba;};'use strict';var _=require(_0xd152('0x0'));var util=require(_0xd152('0x1'));var logger=require(_0xd152('0x2'))(_0xd152('0x3'));var moment=require(_0xd152('0x4'));var BPromise=require(_0xd152('0x5'));var rp=require(_0xd152('0x6'));var fs=require('fs');var path=require(_0xd152('0x7'));var rimraf=require(_0xd152('0x8'));var config=require(_0xd152('0x9'));var attributes=require(_0xd152('0xa'));module[_0xd152('0xb')]=function(_0x52318b,_0x4c9db1){return _0x52318b['define'](_0xd152('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd152('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3bebe9f..f94e415 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x42d1c8,_0xc13c44){var _0x22f990=function(_0x3ce85f){while(--_0x3ce85f){_0x42d1c8['push'](_0x42d1c8['shift']());}};_0x22f990(++_0xc13c44);}(_0x2ef3,0xba));var _0x32ef=function(_0x8804a0,_0x1ce5e6){_0x8804a0=_0x8804a0-0x0;var _0x478a8d=_0x2ef3[_0x8804a0];return _0x478a8d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _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(_0x5d988b,_0x14f1c0){var _0x17d258=function(_0xeb1f73){while(--_0xeb1f73){_0x5d988b['push'](_0x5d988b['shift']());}};_0x17d258(++_0x14f1c0);}(_0x7a54,0x106));var _0x47a5=function(_0x341910,_0x33a75d){_0x341910=_0x341910-0x0;var _0x2a32e1=_0x7a54[_0x341910];return _0x2a32e1;};'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 7f180ad..30162d8 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3c59c5,_0x527f24){var _0x271aad=function(_0x44b9c6){while(--_0x44b9c6){_0x3c59c5['push'](_0x3c59c5['shift']());}};_0x271aad(++_0x527f24);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x11fa7d,_0x2afab9){var _0x1100e9=function(_0x1b1c77){while(--_0x1b1c77){_0x11fa7d['push'](_0x11fa7d['shift']());}};_0x1100e9(++_0x2afab9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xcb91[_0x485b5a];return _0xd2b34d;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index afe656b..620dd5b 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 _0xe0c1=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0xe0c1,0x175));var _0x1e0c=function(_0xf702a9,_0x11a4d2){_0xf702a9=_0xf702a9-0x0;var _0x9055b3=_0xe0c1[_0xf702a9];return _0x9055b3;};'use strict';var Sequelize=require(_0x1e0c('0x0'));module[_0x1e0c('0x1')]={'description':{'type':Sequelize[_0x1e0c('0x2')]},'host':{'type':Sequelize[_0x1e0c('0x2')]},'authentication':{'type':Sequelize[_0x1e0c('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1e0c('0x2')]},'password':{'type':Sequelize[_0x1e0c('0x2')]},'port':{'type':Sequelize[_0x1e0c('0x4')]},'tls':{'type':Sequelize[_0x1e0c('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1e0c('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x1e0c('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x1e0c('0x2')]},'modernAuthentication':{'type':Sequelize[_0x1e0c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9d14=['BOOLEAN','INBOX','INTEGER','exports','STRING'];(function(_0x502949,_0x55d430){var _0x22dbe2=function(_0x1a594f){while(--_0x1a594f){_0x502949['push'](_0x502949['shift']());}};_0x22dbe2(++_0x55d430);}(_0x9d14,0x111));var _0x49d1=function(_0x1380ed,_0x2a3bf4){_0x1380ed=_0x1380ed-0x0;var _0x44dcb1=_0x9d14[_0x1380ed];return _0x44dcb1;};'use strict';var Sequelize=require('sequelize');module[_0x49d1('0x0')]={'description':{'type':Sequelize[_0x49d1('0x1')]},'host':{'type':Sequelize[_0x49d1('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x49d1('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x49d1('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x49d1('0x1')],'defaultValue':_0x49d1('0x3')},'connTimeout':{'type':Sequelize[_0x49d1('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x49d1('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x49d1('0x1')]},'modernAuthentication':{'type':Sequelize[_0x49d1('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 99b88b8..e27c179 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 _0xef5f=['util','api','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash'];(function(_0x3ef2eb,_0x4b1db7){var _0x4e9b8a=function(_0xed7565){while(--_0xed7565){_0x3ef2eb['push'](_0x3ef2eb['shift']());}};_0x4e9b8a(++_0x4b1db7);}(_0xef5f,0x1b7));var _0xfef5=function(_0xcad3ae,_0x19be03){_0xcad3ae=_0xcad3ae-0x0;var _0x18157f=_0xef5f[_0xcad3ae];return _0x18157f;};'use strict';var _=require(_0xfef5('0x0'));var util=require(_0xfef5('0x1'));var logger=require('../../config/logger')(_0xfef5('0x2'));var moment=require('moment');var BPromise=require(_0xfef5('0x3'));var rp=require(_0xfef5('0x4'));var fs=require('fs');var path=require(_0xfef5('0x5'));var rimraf=require(_0xfef5('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef5('0x7'));module[_0xfef5('0x8')]=function(_0x5cb49d,_0x212441){return _0x5cb49d['define'](_0xfef5('0x9'),attributes,{'tableName':_0xfef5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e95=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x43a10b,_0x466572){var _0x595e3c=function(_0x1c51bd){while(--_0x1c51bd){_0x43a10b['push'](_0x43a10b['shift']());}};_0x595e3c(++_0x466572);}(_0x9e95,0x195));var _0x59e9=function(_0x400513,_0x1ae982){_0x400513=_0x400513-0x0;var _0x24bf8a=_0x9e95[_0x400513];return _0x24bf8a;};'use strict';var _=require(_0x59e9('0x0'));var util=require(_0x59e9('0x1'));var logger=require(_0x59e9('0x2'))('api');var moment=require(_0x59e9('0x3'));var BPromise=require(_0x59e9('0x4'));var rp=require(_0x59e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59e9('0x6'));var config=require(_0x59e9('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x97d193,_0x2551f3){return _0x97d193[_0x59e9('0x8')](_0x59e9('0x9'),attributes,{'tableName':_0x59e9('0xa'),'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 c21ef05..2e4a9b6 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 _0x756e=['GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0x756e,0x94));var _0xe756=function(_0x48a5d7,_0x53f764){_0x48a5d7=_0x48a5d7-0x0;var _0x521068=_0x756e[_0x48a5d7];return _0x521068;};'use strict';var _=require(_0xe756('0x0'));var util=require(_0xe756('0x1'));var moment=require(_0xe756('0x2'));var BPromise=require(_0xe756('0x3'));var rs=require(_0xe756('0x4'));var fs=require('fs');var Redis=require(_0xe756('0x5'));var db=require(_0xe756('0x6'))['db'];var utils=require(_0xe756('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe756('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe756('0x9')][_0xe756('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e5a4b,_0x3952a4,_0x5b8595){return new BPromise(function(_0x40a651,_0x25bc10){return client[_0xe756('0xb')](_0x1e5a4b,_0x5b8595)['then'](function(_0x132d12){logger[_0xe756('0xc')]('MailServerIn,\x20%s,\x20%s',_0x3952a4,_0xe756('0xd'));logger[_0xe756('0xe')](_0xe756('0xf'),_0x3952a4,_0xe756('0xd'),JSON[_0xe756('0x10')](_0x132d12));if(_0x132d12[_0xe756('0x11')]){if(_0x132d12['error'][_0xe756('0x12')]===0x1f4){logger['error'](_0xe756('0x13'),_0x3952a4,_0x132d12['error'][_0xe756('0x14')]);return _0x25bc10(_0x132d12[_0xe756('0x11')][_0xe756('0x14')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x3952a4,_0x132d12[_0xe756('0x11')][_0xe756('0x14')]);return _0x40a651(_0x132d12[_0xe756('0x11')][_0xe756('0x14')]);}else{logger['info'](_0xe756('0x13'),_0x3952a4,_0xe756('0xd'));_0x40a651(_0x132d12[_0xe756('0x15')]['message']);}})['catch'](function(_0x4e6be4){logger[_0xe756('0x11')]('MailServerIn,\x20%s,\x20%s',_0x3952a4,_0x4e6be4);_0x25bc10(_0x4e6be4);});});}exports[_0xe756('0x16')]=function(_0x6a9d62){var _0x32b3e9=this;return new Promise(function(_0x51e060,_0x5dd0cd){return db[_0xe756('0x17')][_0xe756('0x18')]({'raw':_0x6a9d62[_0xe756('0x19')]?_0x6a9d62[_0xe756('0x19')][_0xe756('0x1a')]===undefined?!![]:![]:!![],'where':_0x6a9d62[_0xe756('0x19')]?_0x6a9d62[_0xe756('0x19')][_0xe756('0x1b')]||null:null,'attributes':_0x6a9d62[_0xe756('0x19')]?_0x6a9d62[_0xe756('0x19')][_0xe756('0x1c')]||null:null,'limit':_0x6a9d62['options']?_0x6a9d62['options'][_0xe756('0x1d')]||null:null,'include':_0x6a9d62['options']?_0x6a9d62['options'][_0xe756('0x1e')]?_[_0xe756('0x1f')](_0x6a9d62[_0xe756('0x19')][_0xe756('0x1e')],function(_0x127d8f){return{'model':db[_0x127d8f['model']],'as':_0x127d8f['as'],'attributes':_0x127d8f[_0xe756('0x1c')],'include':_0x127d8f[_0xe756('0x1e')]?_[_0xe756('0x1f')](_0x127d8f[_0xe756('0x1e')],function(_0x1afad4){return{'model':db[_0x1afad4[_0xe756('0x20')]],'as':_0x1afad4['as'],'attributes':_0x1afad4[_0xe756('0x1c')],'include':_0x1afad4[_0xe756('0x1e')]?_['map'](_0x1afad4[_0xe756('0x1e')],function(_0x3d075d){return{'model':db[_0x3d075d[_0xe756('0x20')]],'as':_0x3d075d['as'],'attributes':_0x3d075d[_0xe756('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x324670){logger[_0xe756('0xc')](_0xe756('0x16'),_0x6a9d62);logger[_0xe756('0xe')](_0xe756('0x16'),_0x6a9d62,JSON['stringify'](_0x324670));_0x51e060(_0x324670);})[_0xe756('0x21')](function(_0x43542b){logger[_0xe756('0x11')](_0xe756('0x16'),_0x43542b['message'],_0x6a9d62);_0x5dd0cd(_0x32b3e9['error'](0x1f4,_0x43542b[_0xe756('0x14')]));});});}; \ No newline at end of file +var _0x4724=['catch','GetMailServerIn','MailServerIn','options','where','attributes','include','map','model','then','info','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x5bd60b,_0x13465a){var _0x2dcff0=function(_0x31079c){while(--_0x31079c){_0x5bd60b['push'](_0x5bd60b['shift']());}};_0x2dcff0(++_0x13465a);}(_0x4724,0xcf));var _0x4472=function(_0x528342,_0x17a981){_0x528342=_0x528342-0x0;var _0x27dd91=_0x4724[_0x528342];return _0x27dd91;};'use strict';var _=require(_0x4472('0x0'));var util=require(_0x4472('0x1'));var moment=require(_0x4472('0x2'));var BPromise=require(_0x4472('0x3'));var rs=require(_0x4472('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4472('0x5'));var config=require('../../config/environment');var jayson=require(_0x4472('0x6'));var client=jayson[_0x4472('0x7')][_0x4472('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a2fdf,_0x444800,_0x1a8af3){return new BPromise(function(_0x330383,_0x2c079b){return client[_0x4472('0x9')](_0x4a2fdf,_0x1a8af3)['then'](function(_0x5650b6){logger['info'](_0x4472('0xa'),_0x444800,_0x4472('0xb'));logger[_0x4472('0xc')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x444800,_0x4472('0xb'),JSON['stringify'](_0x5650b6));if(_0x5650b6[_0x4472('0xd')]){if(_0x5650b6[_0x4472('0xd')][_0x4472('0xe')]===0x1f4){logger[_0x4472('0xd')](_0x4472('0xa'),_0x444800,_0x5650b6[_0x4472('0xd')][_0x4472('0xf')]);return _0x2c079b(_0x5650b6[_0x4472('0xd')][_0x4472('0xf')]);}logger[_0x4472('0xd')](_0x4472('0xa'),_0x444800,_0x5650b6[_0x4472('0xd')][_0x4472('0xf')]);return _0x330383(_0x5650b6[_0x4472('0xd')][_0x4472('0xf')]);}else{logger['info'](_0x4472('0xa'),_0x444800,_0x4472('0xb'));_0x330383(_0x5650b6[_0x4472('0x10')]['message']);}})[_0x4472('0x11')](function(_0x375b8e){logger[_0x4472('0xd')]('MailServerIn,\x20%s,\x20%s',_0x444800,_0x375b8e);_0x2c079b(_0x375b8e);});});}exports[_0x4472('0x12')]=function(_0x2fc3c5){var _0x143b9c=this;return new Promise(function(_0x2fac2e,_0x52ef17){return db[_0x4472('0x13')]['findAll']({'raw':_0x2fc3c5[_0x4472('0x14')]?_0x2fc3c5[_0x4472('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2fc3c5['options']?_0x2fc3c5[_0x4472('0x14')][_0x4472('0x15')]||null:null,'attributes':_0x2fc3c5[_0x4472('0x14')]?_0x2fc3c5[_0x4472('0x14')][_0x4472('0x16')]||null:null,'limit':_0x2fc3c5['options']?_0x2fc3c5[_0x4472('0x14')]['limit']||null:null,'include':_0x2fc3c5['options']?_0x2fc3c5['options'][_0x4472('0x17')]?_[_0x4472('0x18')](_0x2fc3c5['options'][_0x4472('0x17')],function(_0x531efe){return{'model':db[_0x531efe[_0x4472('0x19')]],'as':_0x531efe['as'],'attributes':_0x531efe[_0x4472('0x16')],'include':_0x531efe[_0x4472('0x17')]?_['map'](_0x531efe[_0x4472('0x17')],function(_0x2f23d9){return{'model':db[_0x2f23d9['model']],'as':_0x2f23d9['as'],'attributes':_0x2f23d9[_0x4472('0x16')],'include':_0x2f23d9[_0x4472('0x17')]?_[_0x4472('0x18')](_0x2f23d9[_0x4472('0x17')],function(_0x373ed2){return{'model':db[_0x373ed2['model']],'as':_0x373ed2['as'],'attributes':_0x373ed2[_0x4472('0x16')]};}):[]};}):[]};}):[]:[]})[_0x4472('0x1a')](function(_0x101a61){logger[_0x4472('0x1b')]('GetMailServerIn',_0x2fc3c5);logger['debug']('GetMailServerIn',_0x2fc3c5,JSON['stringify'](_0x101a61));_0x2fac2e(_0x101a61);})[_0x4472('0x11')](function(_0x1b1b10){logger[_0x4472('0xd')](_0x4472('0x12'),_0x1b1b10[_0x4472('0xf')],_0x2fc3c5);_0x52ef17(_0x143b9c[_0x4472('0xd')](0x1f4,_0x1b1b10[_0x4472('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index db6b65e..6c19e31 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7a54,0x106));var _0x47a5=function(_0x67e839,_0x4dea6c){_0x67e839=_0x67e839-0x0;var _0x34cb54=_0x7a54[_0x67e839];return _0x34cb54;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x7a54,0x106));var _0x47a5=function(_0xd827b6,_0x29b99a){_0xd827b6=_0xd827b6-0x0;var _0x4f8a71=_0x7a54[_0xd827b6];return _0x4f8a71;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 944f93a..b258354 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 _0xefda=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x36b6bf,_0x3b24e6){var _0x57a2e5=function(_0x11a743){while(--_0x11a743){_0x36b6bf['push'](_0x36b6bf['shift']());}};_0x57a2e5(++_0x3b24e6);}(_0xefda,0x96));var _0xaefd=function(_0x4aefc7,_0x582812){_0x4aefc7=_0x4aefc7-0x0;var _0x4d0264=_0xefda[_0x4aefc7];return _0x4d0264;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xaefd('0x1')]},'user':{'type':Sequelize[_0xaefd('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xaefd('0x2')]},'secure':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xaefd('0x1')]},'authentication':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x69d3=['exports','STRING','sequelize'];(function(_0x1e87c2,_0x1a41c1){var _0x4ec05e=function(_0x432c7c){while(--_0x432c7c){_0x1e87c2['push'](_0x1e87c2['shift']());}};_0x4ec05e(++_0x1a41c1);}(_0x69d3,0xda));var _0x369d=function(_0x2d5c04,_0x2b4c78){_0x2d5c04=_0x2d5c04-0x0;var _0x3dba68=_0x69d3[_0x2d5c04];return _0x3dba68;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'description':{'type':Sequelize[_0x369d('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x369d('0x2')]},'pass':{'type':Sequelize[_0x369d('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x369d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 1ea3cfb..1f12a5d 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 _0xd24a=['../../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','reject','save','destroy','sendStatus','error','name','send','index','map','MailServerOut','type','key','model','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','merge','then','includeAll','findAll','catch','show','params','rawAttributes','length','include','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x54f7c0,_0x27af83){var _0x245d03=function(_0x1ad6c4){while(--_0x1ad6c4){_0x54f7c0['push'](_0x54f7c0['shift']());}};_0x245d03(++_0x27af83);}(_0xd24a,0x1d3));var _0xad24=function(_0x193fa5,_0x3a77d5){_0x193fa5=_0x193fa5-0x0;var _0x520251=_0xd24a[_0x193fa5];return _0x520251;};'use strict';var emlformat=require(_0xad24('0x0'));var rimraf=require(_0xad24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad24('0x2'));var rp=require(_0xad24('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad24('0x4'));var util=require(_0xad24('0x5'));var path=require('path');var sox=require(_0xad24('0x6'));var csv=require(_0xad24('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad24('0x8'));var _=require(_0xad24('0x9'));var squel=require(_0xad24('0xa'));var crypto=require(_0xad24('0xb'));var jsforce=require(_0xad24('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xad24('0x7'));var querystring=require(_0xad24('0xd'));var Papa=require(_0xad24('0xe'));var Redis=require(_0xad24('0xf'));var authService=require(_0xad24('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xad24('0x11'));var hardwareService=require(_0xad24('0x12'));var logger=require(_0xad24('0x13'))(_0xad24('0x14'));var utils=require(_0xad24('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xad24('0x16'));var db=require(_0xad24('0x17'))['db'];function respondWithStatusCode(_0x24da84,_0x1b5a73){_0x1b5a73=_0x1b5a73||0xcc;return function(_0x47cd38){if(_0x47cd38){return _0x24da84['sendStatus'](_0x1b5a73);}return _0x24da84[_0xad24('0x18')](_0x1b5a73)[_0xad24('0x19')]();};}function respondWithResult(_0x33c40d,_0xe9183f){_0xe9183f=_0xe9183f||0xc8;return function(_0x558631){if(_0x558631){return _0x33c40d['status'](_0xe9183f)[_0xad24('0x1a')](_0x558631);}};}function respondWithFilteredResult(_0x3ec476,_0x542e30){return function(_0x28418b){if(_0x28418b){var _0x3a9786=typeof _0x542e30[_0xad24('0x1b')]===_0xad24('0x1c')&&typeof _0x542e30[_0xad24('0x1d')]===_0xad24('0x1c');var _0x1f2a9e=_0x28418b[_0xad24('0x1e')];var _0x5f521b=_0x3a9786?0x0:_0x542e30[_0xad24('0x1b')];var _0x12fce4=_0x3a9786?_0x28418b['count']:_0x542e30['offset']+_0x542e30[_0xad24('0x1d')];var _0xd7a9da;if(_0x12fce4>=_0x1f2a9e){_0x12fce4=_0x1f2a9e;_0xd7a9da=0xc8;}else{_0xd7a9da=0xce;}_0x3ec476[_0xad24('0x18')](_0xd7a9da);return _0x3ec476['set']('Content-Range',_0x5f521b+'-'+_0x12fce4+'/'+_0x1f2a9e)[_0xad24('0x1a')](_0x28418b);}return null;};}function patchUpdates(_0xe28f57){return function(_0x444817){try{jsonpatch['apply'](_0x444817,_0xe28f57,!![]);}catch(_0x3fe44d){return BPromise[_0xad24('0x1f')](_0x3fe44d);}return _0x444817[_0xad24('0x20')]();};}function saveUpdates(_0x40602a,_0x28dc5c){return function(_0x42aa53){if(_0x42aa53){return _0x42aa53['update'](_0x40602a)['then'](function(_0x31123a){return _0x31123a;});}return null;};}function removeEntity(_0x4c0a11,_0x2ca437){return function(_0x2b31bf){if(_0x2b31bf){return _0x2b31bf[_0xad24('0x21')]()['then'](function(){_0x4c0a11[_0xad24('0x18')](0xcc)[_0xad24('0x19')]();});}};}function handleEntityNotFound(_0x845129,_0x5e651a){return function(_0x6c0767){if(!_0x6c0767){_0x845129[_0xad24('0x22')](0x194);}return _0x6c0767;};}function handleError(_0x5a8369,_0x1e6a79){_0x1e6a79=_0x1e6a79||0x1f4;return function(_0x26068d){logger[_0xad24('0x23')](_0x26068d['stack']);if(_0x26068d[_0xad24('0x24')]){delete _0x26068d[_0xad24('0x24')];}_0x5a8369[_0xad24('0x18')](_0x1e6a79)[_0xad24('0x25')](_0x26068d);};}exports[_0xad24('0x26')]=function(_0x411195,_0x346494){var _0x421828={},_0x18963={},_0x620d73={'count':0x0,'rows':[]};var _0x36f2b5=_[_0xad24('0x27')](db[_0xad24('0x28')]['rawAttributes'],function(_0x1dd40a){return{'name':_0x1dd40a['fieldName'],'type':_0x1dd40a[_0xad24('0x29')][_0xad24('0x2a')]};});_0x18963[_0xad24('0x2b')]=_[_0xad24('0x27')](_0x36f2b5,'name');_0x18963['query']=_[_0xad24('0x2c')](_0x411195[_0xad24('0x2d')]);_0x18963[_0xad24('0x2e')]=_[_0xad24('0x2f')](_0x18963[_0xad24('0x2b')],_0x18963['query']);_0x421828[_0xad24('0x30')]=_[_0xad24('0x2f')](_0x18963['model'],qs[_0xad24('0x31')](_0x411195['query']['fields']));_0x421828[_0xad24('0x30')]=_0x421828['attributes']['length']?_0x421828[_0xad24('0x30')]:_0x18963['model'];if(!_0x411195['query']['hasOwnProperty']('nolimit')){_0x421828[_0xad24('0x1d')]=qs[_0xad24('0x1d')](_0x411195[_0xad24('0x2d')][_0xad24('0x1d')]);_0x421828['offset']=qs[_0xad24('0x1b')](_0x411195['query'][_0xad24('0x1b')]);}_0x421828['order']=qs[_0xad24('0x32')](_0x411195[_0xad24('0x2d')][_0xad24('0x32')]);_0x421828[_0xad24('0x33')]=qs['filters'](_[_0xad24('0x34')](_0x411195[_0xad24('0x2d')],_0x18963[_0xad24('0x2e')]),_0x36f2b5);if(_0x411195['query'][_0xad24('0x35')]){_0x421828['where']=_['merge'](_0x421828[_0xad24('0x33')],{'$or':_[_0xad24('0x27')](_0x36f2b5,function(_0x312608){if(_0x312608['type']!=='VIRTUAL'){var _0x4d2a50={};_0x4d2a50[_0x312608[_0xad24('0x24')]]={'$like':'%'+_0x411195[_0xad24('0x2d')]['filter']+'%'};return _0x4d2a50;}})});}_0x421828=_[_0xad24('0x36')]({},_0x421828,_0x411195['options']);var _0x34a9e1={'where':_0x421828[_0xad24('0x33')]};return db[_0xad24('0x28')][_0xad24('0x1e')](_0x34a9e1)[_0xad24('0x37')](function(_0x2fb40c){_0x620d73[_0xad24('0x1e')]=_0x2fb40c;if(_0x411195[_0xad24('0x2d')][_0xad24('0x38')]){_0x421828['include']=[{'all':!![]}];}return db[_0xad24('0x28')][_0xad24('0x39')](_0x421828);})[_0xad24('0x37')](function(_0x2ec544){_0x620d73['rows']=_0x2ec544;return _0x620d73;})[_0xad24('0x37')](respondWithFilteredResult(_0x346494,_0x421828))[_0xad24('0x3a')](handleError(_0x346494,null));};exports[_0xad24('0x3b')]=function(_0x4609f6,_0x38cda9){var _0x36d5b7={'raw':!![],'where':{'id':_0x4609f6[_0xad24('0x3c')]['id']}},_0x3d2e25={};_0x3d2e25[_0xad24('0x2b')]=_[_0xad24('0x2c')](db[_0xad24('0x28')][_0xad24('0x3d')]);_0x3d2e25[_0xad24('0x2d')]=_['keys'](_0x4609f6[_0xad24('0x2d')]);_0x3d2e25[_0xad24('0x2e')]=_[_0xad24('0x2f')](_0x3d2e25['model'],_0x3d2e25[_0xad24('0x2d')]);_0x36d5b7['attributes']=_['intersection'](_0x3d2e25[_0xad24('0x2b')],qs[_0xad24('0x31')](_0x4609f6[_0xad24('0x2d')][_0xad24('0x31')]));_0x36d5b7[_0xad24('0x30')]=_0x36d5b7['attributes'][_0xad24('0x3e')]?_0x36d5b7[_0xad24('0x30')]:_0x3d2e25[_0xad24('0x2b')];if(_0x4609f6[_0xad24('0x2d')][_0xad24('0x38')]){_0x36d5b7[_0xad24('0x3f')]=[{'all':!![]}];}_0x36d5b7=_['merge']({},_0x36d5b7,_0x4609f6[_0xad24('0x40')]);return db[_0xad24('0x28')][_0xad24('0x41')](_0x36d5b7)[_0xad24('0x37')](handleEntityNotFound(_0x38cda9,null))[_0xad24('0x37')](respondWithResult(_0x38cda9,null))[_0xad24('0x3a')](handleError(_0x38cda9,null));};exports[_0xad24('0x42')]=function(_0x3a2708,_0x4f7d88){return db['MailServerOut']['create'](_0x3a2708[_0xad24('0x43')],{})[_0xad24('0x37')](respondWithResult(_0x4f7d88,0xc9))[_0xad24('0x3a')](handleError(_0x4f7d88,null));};exports[_0xad24('0x44')]=function(_0x1e8e6f,_0x2fd9f0){if(_0x1e8e6f['body']['id']){delete _0x1e8e6f['body']['id'];}return db[_0xad24('0x28')][_0xad24('0x41')]({'where':{'id':_0x1e8e6f[_0xad24('0x3c')]['id']}})[_0xad24('0x37')](handleEntityNotFound(_0x2fd9f0,null))[_0xad24('0x37')](saveUpdates(_0x1e8e6f[_0xad24('0x43')],null))[_0xad24('0x37')](respondWithResult(_0x2fd9f0,null))[_0xad24('0x3a')](handleError(_0x2fd9f0,null));};exports[_0xad24('0x21')]=function(_0x28755d,_0x4c4b1a){return db[_0xad24('0x28')]['find']({'where':{'id':_0x28755d[_0xad24('0x3c')]['id']}})[_0xad24('0x37')](handleEntityNotFound(_0x4c4b1a,null))['then'](removeEntity(_0x4c4b1a,null))[_0xad24('0x3a')](handleError(_0x4c4b1a,null));}; \ No newline at end of file +var _0x24f7=['filter','merge','VIRTUAL','name','options','MailServerOut','includeAll','findAll','catch','show','include','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick'];(function(_0x5ed928,_0x2dbbdc){var _0x2effcc=function(_0x19ba45){while(--_0x19ba45){_0x5ed928['push'](_0x5ed928['shift']());}};_0x2effcc(++_0x2dbbdc);}(_0x24f7,0x18b));var _0x724f=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x24f7[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x724f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x724f('0x1'));var jsonpatch=require(_0x724f('0x2'));var rp=require('request-promise');var moment=require(_0x724f('0x3'));var BPromise=require(_0x724f('0x4'));var Mustache=require(_0x724f('0x5'));var util=require(_0x724f('0x6'));var path=require('path');var sox=require(_0x724f('0x7'));var csv=require(_0x724f('0x8'));var ejs=require(_0x724f('0x9'));var fs=require('fs');var fs_extra=require(_0x724f('0xa'));var _=require('lodash');var squel=require(_0x724f('0xb'));var crypto=require(_0x724f('0xc'));var jsforce=require(_0x724f('0xd'));var deskjs=require(_0x724f('0xe'));var toCsv=require(_0x724f('0x8'));var querystring=require('querystring');var Papa=require(_0x724f('0xf'));var Redis=require(_0x724f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x724f('0x11'));var as=require(_0x724f('0x12'));var hardwareService=require(_0x724f('0x13'));var logger=require(_0x724f('0x14'))(_0x724f('0x15'));var utils=require(_0x724f('0x16'));var config=require(_0x724f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x724f('0x18'))['db'];function respondWithStatusCode(_0x3b1cab,_0x5f363e){_0x5f363e=_0x5f363e||0xcc;return function(_0x3c876f){if(_0x3c876f){return _0x3b1cab[_0x724f('0x19')](_0x5f363e);}return _0x3b1cab[_0x724f('0x1a')](_0x5f363e)[_0x724f('0x1b')]();};}function respondWithResult(_0x2a8858,_0xd40441){_0xd40441=_0xd40441||0xc8;return function(_0x3761fd){if(_0x3761fd){return _0x2a8858['status'](_0xd40441)[_0x724f('0x1c')](_0x3761fd);}};}function respondWithFilteredResult(_0xd4bd2,_0x355aac){return function(_0x5d1d06){if(_0x5d1d06){var _0x1404d4=typeof _0x355aac[_0x724f('0x1d')]==='undefined'&&typeof _0x355aac[_0x724f('0x1e')]===_0x724f('0x1f');var _0x36e7ff=_0x5d1d06[_0x724f('0x20')];var _0x2699e5=_0x1404d4?0x0:_0x355aac[_0x724f('0x1d')];var _0x3a6c7d=_0x1404d4?_0x5d1d06[_0x724f('0x20')]:_0x355aac[_0x724f('0x1d')]+_0x355aac[_0x724f('0x1e')];var _0x15aad7;if(_0x3a6c7d>=_0x36e7ff){_0x3a6c7d=_0x36e7ff;_0x15aad7=0xc8;}else{_0x15aad7=0xce;}_0xd4bd2[_0x724f('0x1a')](_0x15aad7);return _0xd4bd2[_0x724f('0x21')](_0x724f('0x22'),_0x2699e5+'-'+_0x3a6c7d+'/'+_0x36e7ff)['json'](_0x5d1d06);}return null;};}function patchUpdates(_0x15ea62){return function(_0x29392e){try{jsonpatch[_0x724f('0x23')](_0x29392e,_0x15ea62,!![]);}catch(_0x5291ca){return BPromise[_0x724f('0x24')](_0x5291ca);}return _0x29392e[_0x724f('0x25')]();};}function saveUpdates(_0x4060d4,_0xc3b17a){return function(_0x1093b3){if(_0x1093b3){return _0x1093b3[_0x724f('0x26')](_0x4060d4)[_0x724f('0x27')](function(_0x1a3852){return _0x1a3852;});}return null;};}function removeEntity(_0x516194,_0x51fc95){return function(_0x5930bb){if(_0x5930bb){return _0x5930bb[_0x724f('0x28')]()['then'](function(){_0x516194['status'](0xcc)[_0x724f('0x1b')]();});}};}function handleEntityNotFound(_0x21d31b,_0x3db040){return function(_0x1bf862){if(!_0x1bf862){_0x21d31b[_0x724f('0x19')](0x194);}return _0x1bf862;};}function handleError(_0x3e8fd8,_0x3bc270){_0x3bc270=_0x3bc270||0x1f4;return function(_0x4a2591){logger['error'](_0x4a2591['stack']);if(_0x4a2591['name']){delete _0x4a2591['name'];}_0x3e8fd8[_0x724f('0x1a')](_0x3bc270)[_0x724f('0x29')](_0x4a2591);};}exports[_0x724f('0x2a')]=function(_0x1aba02,_0x3d2d6f){var _0x1ccae2={},_0x252a22={},_0x61f8cf={'count':0x0,'rows':[]};var _0x4ec528=_[_0x724f('0x2b')](db['MailServerOut'][_0x724f('0x2c')],function(_0x594017){return{'name':_0x594017[_0x724f('0x2d')],'type':_0x594017[_0x724f('0x2e')][_0x724f('0x2f')]};});_0x252a22[_0x724f('0x30')]=_[_0x724f('0x2b')](_0x4ec528,'name');_0x252a22[_0x724f('0x31')]=_[_0x724f('0x32')](_0x1aba02['query']);_0x252a22['filters']=_[_0x724f('0x33')](_0x252a22[_0x724f('0x30')],_0x252a22[_0x724f('0x31')]);_0x1ccae2[_0x724f('0x34')]=_[_0x724f('0x33')](_0x252a22[_0x724f('0x30')],qs[_0x724f('0x35')](_0x1aba02[_0x724f('0x31')][_0x724f('0x35')]));_0x1ccae2[_0x724f('0x34')]=_0x1ccae2['attributes'][_0x724f('0x36')]?_0x1ccae2[_0x724f('0x34')]:_0x252a22[_0x724f('0x30')];if(!_0x1aba02[_0x724f('0x31')][_0x724f('0x37')]('nolimit')){_0x1ccae2[_0x724f('0x1e')]=qs['limit'](_0x1aba02[_0x724f('0x31')][_0x724f('0x1e')]);_0x1ccae2[_0x724f('0x1d')]=qs['offset'](_0x1aba02[_0x724f('0x31')][_0x724f('0x1d')]);}_0x1ccae2[_0x724f('0x38')]=qs[_0x724f('0x39')](_0x1aba02[_0x724f('0x31')][_0x724f('0x39')]);_0x1ccae2[_0x724f('0x3a')]=qs[_0x724f('0x3b')](_[_0x724f('0x3c')](_0x1aba02[_0x724f('0x31')],_0x252a22['filters']),_0x4ec528);if(_0x1aba02[_0x724f('0x31')][_0x724f('0x3d')]){_0x1ccae2['where']=_[_0x724f('0x3e')](_0x1ccae2['where'],{'$or':_[_0x724f('0x2b')](_0x4ec528,function(_0xc4f14e){if(_0xc4f14e['type']!==_0x724f('0x3f')){var _0x1f29ef={};_0x1f29ef[_0xc4f14e[_0x724f('0x40')]]={'$like':'%'+_0x1aba02[_0x724f('0x31')][_0x724f('0x3d')]+'%'};return _0x1f29ef;}})});}_0x1ccae2=_[_0x724f('0x3e')]({},_0x1ccae2,_0x1aba02[_0x724f('0x41')]);var _0x3f66af={'where':_0x1ccae2[_0x724f('0x3a')]};return db[_0x724f('0x42')]['count'](_0x3f66af)[_0x724f('0x27')](function(_0x59d6f6){_0x61f8cf[_0x724f('0x20')]=_0x59d6f6;if(_0x1aba02[_0x724f('0x31')][_0x724f('0x43')]){_0x1ccae2['include']=[{'all':!![]}];}return db['MailServerOut'][_0x724f('0x44')](_0x1ccae2);})[_0x724f('0x27')](function(_0x4f63e5){_0x61f8cf['rows']=_0x4f63e5;return _0x61f8cf;})[_0x724f('0x27')](respondWithFilteredResult(_0x3d2d6f,_0x1ccae2))[_0x724f('0x45')](handleError(_0x3d2d6f,null));};exports[_0x724f('0x46')]=function(_0x1dfd9b,_0x18c33c){var _0x50eb4f={'raw':!![],'where':{'id':_0x1dfd9b['params']['id']}},_0x591d8c={};_0x591d8c[_0x724f('0x30')]=_[_0x724f('0x32')](db[_0x724f('0x42')][_0x724f('0x2c')]);_0x591d8c[_0x724f('0x31')]=_[_0x724f('0x32')](_0x1dfd9b[_0x724f('0x31')]);_0x591d8c['filters']=_[_0x724f('0x33')](_0x591d8c[_0x724f('0x30')],_0x591d8c[_0x724f('0x31')]);_0x50eb4f[_0x724f('0x34')]=_[_0x724f('0x33')](_0x591d8c[_0x724f('0x30')],qs[_0x724f('0x35')](_0x1dfd9b[_0x724f('0x31')][_0x724f('0x35')]));_0x50eb4f['attributes']=_0x50eb4f[_0x724f('0x34')][_0x724f('0x36')]?_0x50eb4f['attributes']:_0x591d8c['model'];if(_0x1dfd9b[_0x724f('0x31')][_0x724f('0x43')]){_0x50eb4f[_0x724f('0x47')]=[{'all':!![]}];}_0x50eb4f=_['merge']({},_0x50eb4f,_0x1dfd9b[_0x724f('0x41')]);return db[_0x724f('0x42')][_0x724f('0x48')](_0x50eb4f)['then'](handleEntityNotFound(_0x18c33c,null))[_0x724f('0x27')](respondWithResult(_0x18c33c,null))[_0x724f('0x45')](handleError(_0x18c33c,null));};exports[_0x724f('0x49')]=function(_0xa394df,_0x23c352){return db[_0x724f('0x42')][_0x724f('0x49')](_0xa394df[_0x724f('0x4a')],{})[_0x724f('0x27')](respondWithResult(_0x23c352,0xc9))[_0x724f('0x45')](handleError(_0x23c352,null));};exports[_0x724f('0x26')]=function(_0x22bb6c,_0x37de7e){if(_0x22bb6c[_0x724f('0x4a')]['id']){delete _0x22bb6c[_0x724f('0x4a')]['id'];}return db[_0x724f('0x42')][_0x724f('0x48')]({'where':{'id':_0x22bb6c[_0x724f('0x4b')]['id']}})[_0x724f('0x27')](handleEntityNotFound(_0x37de7e,null))[_0x724f('0x27')](saveUpdates(_0x22bb6c[_0x724f('0x4a')],null))[_0x724f('0x27')](respondWithResult(_0x37de7e,null))['catch'](handleError(_0x37de7e,null));};exports['destroy']=function(_0x5dc0c8,_0x59b188){return db[_0x724f('0x42')][_0x724f('0x48')]({'where':{'id':_0x5dc0c8[_0x724f('0x4b')]['id']}})[_0x724f('0x27')](handleEntityNotFound(_0x59b188,null))[_0x724f('0x27')](removeEntity(_0x59b188,null))[_0x724f('0x45')](handleError(_0x59b188,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 22fac82..9258b82 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 _0x017f=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','mail_servers_out'];(function(_0x47dcf5,_0x19333f){var _0x1754be=function(_0x2e3679){while(--_0x2e3679){_0x47dcf5['push'](_0x47dcf5['shift']());}};_0x1754be(++_0x19333f);}(_0x017f,0x1d4));var _0xf017=function(_0xf33147,_0x4496a6){_0xf33147=_0xf33147-0x0;var _0x637271=_0x017f[_0xf33147];return _0x637271;};'use strict';var _=require(_0xf017('0x0'));var util=require(_0xf017('0x1'));var logger=require(_0xf017('0x2'))('api');var moment=require(_0xf017('0x3'));var BPromise=require(_0xf017('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf017('0x5'));var rimraf=require(_0xf017('0x6'));var config=require(_0xf017('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x152da9,_0x3b8021){return _0x152da9['define']('MailServerOut',attributes,{'tableName':_0xf017('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08ea=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','MailServerOut','lodash'];(function(_0xa38152,_0x33fb6c){var _0x271fe3=function(_0x4eb06f){while(--_0x4eb06f){_0xa38152['push'](_0xa38152['shift']());}};_0x271fe3(++_0x33fb6c);}(_0x08ea,0x6d));var _0xa08e=function(_0x38873d,_0x56d75c){_0x38873d=_0x38873d-0x0;var _0x520f9b=_0x08ea[_0x38873d];return _0x520f9b;};'use strict';var _=require(_0xa08e('0x0'));var util=require(_0xa08e('0x1'));var logger=require(_0xa08e('0x2'))(_0xa08e('0x3'));var moment=require(_0xa08e('0x4'));var BPromise=require(_0xa08e('0x5'));var rp=require(_0xa08e('0x6'));var fs=require('fs');var path=require(_0xa08e('0x7'));var rimraf=require('rimraf');var config=require(_0xa08e('0x8'));var attributes=require('./mailServerOut.attributes');module[_0xa08e('0x9')]=function(_0x10de8a,_0x3a163b){return _0x10de8a['define'](_0xa08e('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 409fb20..04545d4 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x299dba,_0x1355c4){var _0x1289b7=function(_0xaf2e3e){while(--_0xaf2e3e){_0x299dba['push'](_0x299dba['shift']());}};_0x1289b7(++_0x1355c4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x3c0eba,_0x2309df){_0x3c0eba=_0x3c0eba-0x0;var _0x5d242b=_0x7a54[_0x3c0eba];return _0x5d242b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 7d0c48a..6b2ff8f 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 _0x9d0e=['/describe','isAuthenticated','/:id','post','create','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get'];(function(_0x38aa8c,_0x51d7b3){var _0x3e43ac=function(_0x3c135e){while(--_0x3c135e){_0x38aa8c['push'](_0x38aa8c['shift']());}};_0x3e43ac(++_0x51d7b3);}(_0x9d0e,0x70));var _0xe9d0=function(_0x1c57cc,_0x37fa4b){_0x1c57cc=_0x1c57cc-0x0;var _0x34b086=_0x9d0e[_0x1c57cc];return _0x34b086;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe9d0('0x0'));var timeout=require('connect-timeout');var express=require(_0xe9d0('0x1'));var router=express[_0xe9d0('0x2')]();var fs_extra=require(_0xe9d0('0x3'));var auth=require(_0xe9d0('0x4'));var interaction=require(_0xe9d0('0x5'));var config=require('../../config/environment');var controller=require(_0xe9d0('0x6'));router[_0xe9d0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9d0('0x7')](_0xe9d0('0x8'),auth[_0xe9d0('0x9')](),controller['describe']);router[_0xe9d0('0x7')](_0xe9d0('0xa'),auth[_0xe9d0('0x9')](),controller['show']);router[_0xe9d0('0xb')]('/',auth[_0xe9d0('0x9')](),controller[_0xe9d0('0xc')]);router['put']('/:id',auth[_0xe9d0('0x9')](),controller['update']);router['delete'](_0xe9d0('0xa'),auth['isAuthenticated'](),controller[_0xe9d0('0xd')]);module[_0xe9d0('0xe')]=router; \ No newline at end of file +var _0x96f2=['show','post','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x5a4968,_0x3bf248){var _0x46302c=function(_0x4b5225){while(--_0x4b5225){_0x5a4968['push'](_0x5a4968['shift']());}};_0x46302c(++_0x3bf248);}(_0x96f2,0x73));var _0x296f=function(_0x5496e5,_0x5afbb8){_0x5496e5=_0x5496e5-0x0;var _0x320607=_0x96f2[_0x5496e5];return _0x320607;};'use strict';var multer=require(_0x296f('0x0'));var util=require('util');var path=require(_0x296f('0x1'));var timeout=require('connect-timeout');var express=require(_0x296f('0x2'));var router=express[_0x296f('0x3')]();var fs_extra=require(_0x296f('0x4'));var auth=require(_0x296f('0x5'));var interaction=require(_0x296f('0x6'));var config=require(_0x296f('0x7'));var controller=require('./mailSubstatus.controller');router[_0x296f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x296f('0x8')]('/describe',auth[_0x296f('0x9')](),controller['describe']);router[_0x296f('0x8')](_0x296f('0xa'),auth[_0x296f('0x9')](),controller[_0x296f('0xb')]);router[_0x296f('0xc')]('/',auth['isAuthenticated'](),controller[_0x296f('0xd')]);router[_0x296f('0xe')](_0x296f('0xa'),auth[_0x296f('0x9')](),controller['update']);router[_0x296f('0xf')](_0x296f('0xa'),auth[_0x296f('0x9')](),controller[_0x296f('0x10')]);module[_0x296f('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index ec599cb..b0d4dca 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 _0xdf98=['STRING','sequelize'];(function(_0x4353b9,_0x1e8c39){var _0x4ccfa3=function(_0x4d3fde){while(--_0x4d3fde){_0x4353b9['push'](_0x4353b9['shift']());}};_0x4ccfa3(++_0x1e8c39);}(_0xdf98,0xcf));var _0x8df9=function(_0x1f5974,_0x11540c){_0x1f5974=_0x1f5974-0x0;var _0x5cb353=_0xdf98[_0x1f5974];return _0x5cb353;};'use strict';var Sequelize=require(_0x8df9('0x0'));module['exports']={'name':{'type':Sequelize[_0x8df9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6455=['name','sequelize','STRING'];(function(_0x5fd31c,_0x5d3c8a){var _0xc2787c=function(_0x4f8c23){while(--_0x4f8c23){_0x5fd31c['push'](_0x5fd31c['shift']());}};_0xc2787c(++_0x5d3c8a);}(_0x6455,0x97));var _0x5645=function(_0x1d1496,_0x320b41){_0x1d1496=_0x1d1496-0x0;var _0x44cff5=_0x6455[_0x1d1496];return _0x44cff5;};'use strict';var Sequelize=require(_0x5645('0x0'));module['exports']={'name':{'type':Sequelize[_0x5645('0x1')],'unique':_0x5645('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5645('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 8a191d9..77d9583 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 _0x1dae=['map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','filter','merge','type','options','where','includeAll','show','params','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index'];(function(_0x2ca6db,_0x2977ec){var _0x166e30=function(_0x27e0ee){while(--_0x27e0ee){_0x2ca6db['push'](_0x2ca6db['shift']());}};_0x166e30(++_0x2977ec);}(_0x1dae,0x1df));var _0xe1da=function(_0x3e7bb6,_0x2ad232){_0x3e7bb6=_0x3e7bb6-0x0;var _0x1fdf32=_0x1dae[_0x3e7bb6];return _0x1fdf32;};'use strict';var emlformat=require(_0xe1da('0x0'));var rimraf=require(_0xe1da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1da('0x2'));var rp=require(_0xe1da('0x3'));var moment=require(_0xe1da('0x4'));var BPromise=require(_0xe1da('0x5'));var Mustache=require('mustache');var util=require(_0xe1da('0x6'));var path=require(_0xe1da('0x7'));var sox=require('sox');var csv=require(_0xe1da('0x8'));var ejs=require(_0xe1da('0x9'));var fs=require('fs');var fs_extra=require(_0xe1da('0xa'));var _=require(_0xe1da('0xb'));var squel=require(_0xe1da('0xc'));var crypto=require(_0xe1da('0xd'));var jsforce=require(_0xe1da('0xe'));var deskjs=require(_0xe1da('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe1da('0x10'));var Redis=require(_0xe1da('0x11'));var authService=require(_0xe1da('0x12'));var qs=require(_0xe1da('0x13'));var as=require(_0xe1da('0x14'));var hardwareService=require(_0xe1da('0x15'));var logger=require('../../config/logger')(_0xe1da('0x16'));var utils=require(_0xe1da('0x17'));var config=require(_0xe1da('0x18'));var licenseUtil=require(_0xe1da('0x19'));var db=require(_0xe1da('0x1a'))['db'];function respondWithStatusCode(_0x36f5a9,_0x460efc){_0x460efc=_0x460efc||0xcc;return function(_0x150213){if(_0x150213){return _0x36f5a9[_0xe1da('0x1b')](_0x460efc);}return _0x36f5a9[_0xe1da('0x1c')](_0x460efc)[_0xe1da('0x1d')]();};}function respondWithResult(_0x1fa046,_0x56c06c){_0x56c06c=_0x56c06c||0xc8;return function(_0x505db0){if(_0x505db0){return _0x1fa046[_0xe1da('0x1c')](_0x56c06c)[_0xe1da('0x1e')](_0x505db0);}};}function respondWithFilteredResult(_0x486749,_0x5db5e){return function(_0x14f538){if(_0x14f538){var _0x902716=typeof _0x5db5e['offset']===_0xe1da('0x1f')&&typeof _0x5db5e['limit']===_0xe1da('0x1f');var _0xd7ae3d=_0x14f538[_0xe1da('0x20')];var _0x1ca34e=_0x902716?0x0:_0x5db5e[_0xe1da('0x21')];var _0x414550=_0x902716?_0x14f538[_0xe1da('0x20')]:_0x5db5e['offset']+_0x5db5e[_0xe1da('0x22')];var _0x1fcba7;if(_0x414550>=_0xd7ae3d){_0x414550=_0xd7ae3d;_0x1fcba7=0xc8;}else{_0x1fcba7=0xce;}_0x486749[_0xe1da('0x1c')](_0x1fcba7);return _0x486749[_0xe1da('0x23')](_0xe1da('0x24'),_0x1ca34e+'-'+_0x414550+'/'+_0xd7ae3d)[_0xe1da('0x1e')](_0x14f538);}return null;};}function patchUpdates(_0x5ced63){return function(_0x53360f){try{jsonpatch['apply'](_0x53360f,_0x5ced63,!![]);}catch(_0x224e25){return BPromise['reject'](_0x224e25);}return _0x53360f[_0xe1da('0x25')]();};}function saveUpdates(_0x54e31b,_0x3fde62){return function(_0x34cb04){if(_0x34cb04){return _0x34cb04[_0xe1da('0x26')](_0x54e31b)[_0xe1da('0x27')](function(_0x57bf47){return _0x57bf47;});}return null;};}function removeEntity(_0x47378d,_0x460b60){return function(_0x12495a){if(_0x12495a){return _0x12495a[_0xe1da('0x28')]()[_0xe1da('0x27')](function(){_0x47378d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23d4dd,_0x2042d0){return function(_0x3f60e1){if(!_0x3f60e1){_0x23d4dd[_0xe1da('0x1b')](0x194);}return _0x3f60e1;};}function handleError(_0x2f60d9,_0x36478e){_0x36478e=_0x36478e||0x1f4;return function(_0x4bc136){logger[_0xe1da('0x29')](_0x4bc136[_0xe1da('0x2a')]);if(_0x4bc136[_0xe1da('0x2b')]){delete _0x4bc136[_0xe1da('0x2b')];}_0x2f60d9[_0xe1da('0x1c')](_0x36478e)[_0xe1da('0x2c')](_0x4bc136);};}exports[_0xe1da('0x2d')]=function(_0x75862f,_0x31537e){var _0xd3968a={},_0x2596b2={},_0x4a096a={'count':0x0,'rows':[]};var _0x28827e=_[_0xe1da('0x2e')](db[_0xe1da('0x2f')][_0xe1da('0x30')],function(_0x5ef4c9){return{'name':_0x5ef4c9[_0xe1da('0x31')],'type':_0x5ef4c9['type'][_0xe1da('0x32')]};});_0x2596b2[_0xe1da('0x33')]=_[_0xe1da('0x2e')](_0x28827e,'name');_0x2596b2[_0xe1da('0x34')]=_[_0xe1da('0x35')](_0x75862f[_0xe1da('0x34')]);_0x2596b2['filters']=_[_0xe1da('0x36')](_0x2596b2['model'],_0x2596b2[_0xe1da('0x34')]);_0xd3968a['attributes']=_[_0xe1da('0x36')](_0x2596b2['model'],qs[_0xe1da('0x37')](_0x75862f[_0xe1da('0x34')][_0xe1da('0x37')]));_0xd3968a[_0xe1da('0x38')]=_0xd3968a['attributes'][_0xe1da('0x39')]?_0xd3968a[_0xe1da('0x38')]:_0x2596b2[_0xe1da('0x33')];if(!_0x75862f['query'][_0xe1da('0x3a')]('nolimit')){_0xd3968a[_0xe1da('0x22')]=qs[_0xe1da('0x22')](_0x75862f[_0xe1da('0x34')][_0xe1da('0x22')]);_0xd3968a['offset']=qs[_0xe1da('0x21')](_0x75862f['query'][_0xe1da('0x21')]);}_0xd3968a['order']=qs[_0xe1da('0x3b')](_0x75862f['query'][_0xe1da('0x3b')]);_0xd3968a['where']=qs[_0xe1da('0x3c')](_[_0xe1da('0x3d')](_0x75862f[_0xe1da('0x34')],_0x2596b2['filters']),_0x28827e);if(_0x75862f[_0xe1da('0x34')][_0xe1da('0x3e')]){_0xd3968a['where']=_[_0xe1da('0x3f')](_0xd3968a['where'],{'$or':_[_0xe1da('0x2e')](_0x28827e,function(_0x4af80c){if(_0x4af80c[_0xe1da('0x40')]!=='VIRTUAL'){var _0x3c0350={};_0x3c0350[_0x4af80c[_0xe1da('0x2b')]]={'$like':'%'+_0x75862f[_0xe1da('0x34')][_0xe1da('0x3e')]+'%'};return _0x3c0350;}})});}_0xd3968a=_['merge']({},_0xd3968a,_0x75862f[_0xe1da('0x41')]);var _0x53a058={'where':_0xd3968a[_0xe1da('0x42')]};return db[_0xe1da('0x2f')][_0xe1da('0x20')](_0x53a058)[_0xe1da('0x27')](function(_0x499438){_0x4a096a['count']=_0x499438;if(_0x75862f[_0xe1da('0x34')][_0xe1da('0x43')]){_0xd3968a['include']=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0xd3968a);})[_0xe1da('0x27')](function(_0x4eb83f){_0x4a096a['rows']=_0x4eb83f;return _0x4a096a;})[_0xe1da('0x27')](respondWithFilteredResult(_0x31537e,_0xd3968a))['catch'](handleError(_0x31537e,null));};exports[_0xe1da('0x44')]=function(_0x2ed359,_0x351a79){var _0x15983f={'raw':!![],'where':{'id':_0x2ed359[_0xe1da('0x45')]['id']}},_0x35ef7b={};_0x35ef7b[_0xe1da('0x33')]=_[_0xe1da('0x35')](db[_0xe1da('0x2f')][_0xe1da('0x30')]);_0x35ef7b[_0xe1da('0x34')]=_['keys'](_0x2ed359[_0xe1da('0x34')]);_0x35ef7b[_0xe1da('0x3c')]=_[_0xe1da('0x36')](_0x35ef7b[_0xe1da('0x33')],_0x35ef7b[_0xe1da('0x34')]);_0x15983f['attributes']=_[_0xe1da('0x36')](_0x35ef7b['model'],qs['fields'](_0x2ed359[_0xe1da('0x34')][_0xe1da('0x37')]));_0x15983f['attributes']=_0x15983f[_0xe1da('0x38')][_0xe1da('0x39')]?_0x15983f[_0xe1da('0x38')]:_0x35ef7b['model'];if(_0x2ed359[_0xe1da('0x34')]['includeAll']){_0x15983f['include']=[{'all':!![]}];}_0x15983f=_['merge']({},_0x15983f,_0x2ed359[_0xe1da('0x41')]);return db['MailSubstatus'][_0xe1da('0x46')](_0x15983f)[_0xe1da('0x27')](handleEntityNotFound(_0x351a79,null))['then'](respondWithResult(_0x351a79,null))[_0xe1da('0x47')](handleError(_0x351a79,null));};exports[_0xe1da('0x48')]=function(_0x221d6e,_0xe3f032){return db[_0xe1da('0x2f')][_0xe1da('0x48')](_0x221d6e['body'],{})[_0xe1da('0x27')](respondWithResult(_0xe3f032,0xc9))[_0xe1da('0x47')](handleError(_0xe3f032,null));};exports[_0xe1da('0x26')]=function(_0x280a39,_0x4c1d90){if(_0x280a39[_0xe1da('0x49')]['id']){delete _0x280a39[_0xe1da('0x49')]['id'];}return db[_0xe1da('0x2f')]['find']({'where':{'id':_0x280a39['params']['id']}})[_0xe1da('0x27')](handleEntityNotFound(_0x4c1d90,null))[_0xe1da('0x27')](saveUpdates(_0x280a39[_0xe1da('0x49')],null))['then'](respondWithResult(_0x4c1d90,null))[_0xe1da('0x47')](handleError(_0x4c1d90,null));};exports[_0xe1da('0x28')]=function(_0x1a01a8,_0xa14a79){return db[_0xe1da('0x2f')][_0xe1da('0x46')]({'where':{'id':_0x1a01a8[_0xe1da('0x45')]['id']}})[_0xe1da('0x27')](handleEntityNotFound(_0xa14a79,null))[_0xe1da('0x27')](removeEntity(_0xa14a79,null))['catch'](handleError(_0xa14a79,null));};exports[_0xe1da('0x4a')]=function(_0x1ea148,_0x16614e){return db['MailSubstatus'][_0xe1da('0x4a')]()[_0xe1da('0x27')](respondWithResult(_0x16614e,null))[_0xe1da('0x47')](handleError(_0x16614e,null));}; \ No newline at end of file +var _0x0230=['count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','MailSubstatus','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','limit','undefined'];(function(_0x3b97f0,_0x45ea2c){var _0x2abbd8=function(_0x256a0f){while(--_0x256a0f){_0x3b97f0['push'](_0x3b97f0['shift']());}};_0x2abbd8(++_0x45ea2c);}(_0x0230,0x163));var _0x0023=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x0230[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0x0023('0x0'));var rimraf=require(_0x0023('0x1'));var zipdir=require(_0x0023('0x2'));var jsonpatch=require(_0x0023('0x3'));var rp=require('request-promise');var moment=require(_0x0023('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0023('0x5'));var util=require(_0x0023('0x6'));var path=require(_0x0023('0x7'));var sox=require(_0x0023('0x8'));var csv=require(_0x0023('0x9'));var ejs=require(_0x0023('0xa'));var fs=require('fs');var fs_extra=require(_0x0023('0xb'));var _=require(_0x0023('0xc'));var squel=require(_0x0023('0xd'));var crypto=require(_0x0023('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0023('0xf'));var toCsv=require(_0x0023('0x9'));var querystring=require(_0x0023('0x10'));var Papa=require(_0x0023('0x11'));var Redis=require(_0x0023('0x12'));var authService=require(_0x0023('0x13'));var qs=require(_0x0023('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0023('0x15'));var logger=require(_0x0023('0x16'))(_0x0023('0x17'));var utils=require(_0x0023('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0023('0x19'));var db=require(_0x0023('0x1a'))['db'];function respondWithStatusCode(_0x39ab74,_0x11563b){_0x11563b=_0x11563b||0xcc;return function(_0x58c264){if(_0x58c264){return _0x39ab74['sendStatus'](_0x11563b);}return _0x39ab74[_0x0023('0x1b')](_0x11563b)['end']();};}function respondWithResult(_0x384208,_0x50a459){_0x50a459=_0x50a459||0xc8;return function(_0x4b4da6){if(_0x4b4da6){return _0x384208[_0x0023('0x1b')](_0x50a459)['json'](_0x4b4da6);}};}function respondWithFilteredResult(_0x150576,_0x4824fb){return function(_0x111f9c){if(_0x111f9c){var _0x27e582=typeof _0x4824fb['offset']==='undefined'&&typeof _0x4824fb[_0x0023('0x1c')]===_0x0023('0x1d');var _0xe157fd=_0x111f9c[_0x0023('0x1e')];var _0xb40602=_0x27e582?0x0:_0x4824fb[_0x0023('0x1f')];var _0x509cf6=_0x27e582?_0x111f9c[_0x0023('0x1e')]:_0x4824fb[_0x0023('0x1f')]+_0x4824fb[_0x0023('0x1c')];var _0x55ddd3;if(_0x509cf6>=_0xe157fd){_0x509cf6=_0xe157fd;_0x55ddd3=0xc8;}else{_0x55ddd3=0xce;}_0x150576['status'](_0x55ddd3);return _0x150576[_0x0023('0x20')](_0x0023('0x21'),_0xb40602+'-'+_0x509cf6+'/'+_0xe157fd)['json'](_0x111f9c);}return null;};}function patchUpdates(_0x106554){return function(_0x2a3326){try{jsonpatch[_0x0023('0x22')](_0x2a3326,_0x106554,!![]);}catch(_0x5a3570){return BPromise[_0x0023('0x23')](_0x5a3570);}return _0x2a3326[_0x0023('0x24')]();};}function saveUpdates(_0xe1dfc6,_0x39627d){return function(_0x546fd4){if(_0x546fd4){return _0x546fd4[_0x0023('0x25')](_0xe1dfc6)['then'](function(_0x364962){return _0x364962;});}return null;};}function removeEntity(_0x84b6f8,_0x50e7ff){return function(_0x2205a5){if(_0x2205a5){return _0x2205a5[_0x0023('0x26')]()[_0x0023('0x27')](function(){_0x84b6f8[_0x0023('0x1b')](0xcc)[_0x0023('0x28')]();});}};}function handleEntityNotFound(_0x1a66e7,_0x1f9111){return function(_0x50e5e7){if(!_0x50e5e7){_0x1a66e7['sendStatus'](0x194);}return _0x50e5e7;};}function handleError(_0x50a7ec,_0x4df897){_0x4df897=_0x4df897||0x1f4;return function(_0x461cf2){logger[_0x0023('0x29')](_0x461cf2[_0x0023('0x2a')]);if(_0x461cf2[_0x0023('0x2b')]){delete _0x461cf2['name'];}_0x50a7ec[_0x0023('0x1b')](_0x4df897)[_0x0023('0x2c')](_0x461cf2);};}exports['index']=function(_0x145151,_0x359d43){var _0x227046={},_0x193c30={},_0x19c527={'count':0x0,'rows':[]};var _0xd68b87=_[_0x0023('0x2d')](db[_0x0023('0x2e')]['rawAttributes'],function(_0x48a26c){return{'name':_0x48a26c[_0x0023('0x2f')],'type':_0x48a26c[_0x0023('0x30')][_0x0023('0x31')]};});_0x193c30[_0x0023('0x32')]=_[_0x0023('0x2d')](_0xd68b87,_0x0023('0x2b'));_0x193c30[_0x0023('0x33')]=_[_0x0023('0x34')](_0x145151[_0x0023('0x33')]);_0x193c30['filters']=_[_0x0023('0x35')](_0x193c30[_0x0023('0x32')],_0x193c30[_0x0023('0x33')]);_0x227046[_0x0023('0x36')]=_[_0x0023('0x35')](_0x193c30[_0x0023('0x32')],qs['fields'](_0x145151[_0x0023('0x33')][_0x0023('0x37')]));_0x227046[_0x0023('0x36')]=_0x227046[_0x0023('0x36')]['length']?_0x227046[_0x0023('0x36')]:_0x193c30['model'];if(!_0x145151[_0x0023('0x33')][_0x0023('0x38')]('nolimit')){_0x227046[_0x0023('0x1c')]=qs[_0x0023('0x1c')](_0x145151[_0x0023('0x33')]['limit']);_0x227046[_0x0023('0x1f')]=qs['offset'](_0x145151[_0x0023('0x33')][_0x0023('0x1f')]);}_0x227046[_0x0023('0x39')]=qs[_0x0023('0x3a')](_0x145151[_0x0023('0x33')][_0x0023('0x3a')]);_0x227046[_0x0023('0x3b')]=qs[_0x0023('0x3c')](_['pick'](_0x145151[_0x0023('0x33')],_0x193c30['filters']),_0xd68b87);if(_0x145151[_0x0023('0x33')]['filter']){_0x227046['where']=_['merge'](_0x227046[_0x0023('0x3b')],{'$or':_[_0x0023('0x2d')](_0xd68b87,function(_0x17647f){if(_0x17647f['type']!==_0x0023('0x3d')){var _0x525059={};_0x525059[_0x17647f[_0x0023('0x2b')]]={'$like':'%'+_0x145151[_0x0023('0x33')][_0x0023('0x3e')]+'%'};return _0x525059;}})});}_0x227046=_['merge']({},_0x227046,_0x145151['options']);var _0x3efe97={'where':_0x227046[_0x0023('0x3b')]};return db[_0x0023('0x2e')][_0x0023('0x1e')](_0x3efe97)['then'](function(_0x243e85){_0x19c527['count']=_0x243e85;if(_0x145151[_0x0023('0x33')][_0x0023('0x3f')]){_0x227046[_0x0023('0x40')]=[{'all':!![]}];}return db[_0x0023('0x2e')][_0x0023('0x41')](_0x227046);})[_0x0023('0x27')](function(_0x1d1d7e){_0x19c527[_0x0023('0x42')]=_0x1d1d7e;return _0x19c527;})['then'](respondWithFilteredResult(_0x359d43,_0x227046))[_0x0023('0x43')](handleError(_0x359d43,null));};exports[_0x0023('0x44')]=function(_0x4cb95f,_0x2ce046){var _0x455fd9={'raw':!![],'where':{'id':_0x4cb95f[_0x0023('0x45')]['id']}},_0x23b73a={};_0x23b73a[_0x0023('0x32')]=_[_0x0023('0x34')](db[_0x0023('0x2e')][_0x0023('0x46')]);_0x23b73a[_0x0023('0x33')]=_['keys'](_0x4cb95f[_0x0023('0x33')]);_0x23b73a[_0x0023('0x3c')]=_[_0x0023('0x35')](_0x23b73a[_0x0023('0x32')],_0x23b73a[_0x0023('0x33')]);_0x455fd9[_0x0023('0x36')]=_[_0x0023('0x35')](_0x23b73a[_0x0023('0x32')],qs[_0x0023('0x37')](_0x4cb95f[_0x0023('0x33')][_0x0023('0x37')]));_0x455fd9['attributes']=_0x455fd9[_0x0023('0x36')]['length']?_0x455fd9[_0x0023('0x36')]:_0x23b73a['model'];if(_0x4cb95f[_0x0023('0x33')][_0x0023('0x3f')]){_0x455fd9[_0x0023('0x40')]=[{'all':!![]}];}_0x455fd9=_[_0x0023('0x47')]({},_0x455fd9,_0x4cb95f[_0x0023('0x48')]);return db[_0x0023('0x2e')][_0x0023('0x49')](_0x455fd9)[_0x0023('0x27')](handleEntityNotFound(_0x2ce046,null))[_0x0023('0x27')](respondWithResult(_0x2ce046,null))[_0x0023('0x43')](handleError(_0x2ce046,null));};exports[_0x0023('0x4a')]=function(_0x944487,_0x403edb){return db[_0x0023('0x2e')][_0x0023('0x4a')](_0x944487['body'],{})[_0x0023('0x27')](respondWithResult(_0x403edb,0xc9))[_0x0023('0x43')](handleError(_0x403edb,null));};exports[_0x0023('0x25')]=function(_0x4aeb6e,_0x143f37){if(_0x4aeb6e[_0x0023('0x4b')]['id']){delete _0x4aeb6e[_0x0023('0x4b')]['id'];}return db['MailSubstatus'][_0x0023('0x49')]({'where':{'id':_0x4aeb6e[_0x0023('0x45')]['id']}})[_0x0023('0x27')](handleEntityNotFound(_0x143f37,null))['then'](saveUpdates(_0x4aeb6e[_0x0023('0x4b')],null))[_0x0023('0x27')](respondWithResult(_0x143f37,null))[_0x0023('0x43')](handleError(_0x143f37,null));};exports[_0x0023('0x26')]=function(_0x3a51ec,_0x3096b8){return db[_0x0023('0x2e')][_0x0023('0x49')]({'where':{'id':_0x3a51ec[_0x0023('0x45')]['id']}})[_0x0023('0x27')](handleEntityNotFound(_0x3096b8,null))[_0x0023('0x27')](removeEntity(_0x3096b8,null))[_0x0023('0x43')](handleError(_0x3096b8,null));};exports[_0x0023('0x4c')]=function(_0x2d608c,_0x21191f){return db[_0x0023('0x2e')]['describe']()[_0x0023('0x27')](respondWithResult(_0x21191f,null))[_0x0023('0x43')](handleError(_0x21191f,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0b5f26c..592fccd 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 _0x8421=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x50dbfa,_0x4a4439){var _0x36adfa=function(_0x517bee){while(--_0x517bee){_0x50dbfa['push'](_0x50dbfa['shift']());}};_0x36adfa(++_0x4a4439);}(_0x8421,0x10f));var _0x1842=function(_0x4a43a5,_0x4adff7){_0x4a43a5=_0x4a43a5-0x0;var _0x2d6521=_0x8421[_0x4a43a5];return _0x2d6521;};'use strict';var EventEmitter=require(_0x1842('0x0'));var MailSubstatus=require(_0x1842('0x1'))['db'][_0x1842('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x1842('0x3')](0x0);var events={'afterUpdate':_0x1842('0x4')};function emitEvent(_0x11aaec){return function(_0x2bac2f,_0x4e19c4,_0x2e1d69){MailSubstatusEvents[_0x1842('0x5')](_0x11aaec+':'+_0x2bac2f['id'],_0x2bac2f);MailSubstatusEvents[_0x1842('0x5')](_0x11aaec,_0x2bac2f);_0x2e1d69(null);};}for(var e in events){if(events[_0x1842('0x6')](e)){var event=events[e];MailSubstatus[_0x1842('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x26e6=['../../mysqldb','MailSubstatus','update','emit','hook'];(function(_0x2ad9ae,_0x29a5f0){var _0x36a84a=function(_0x23f86f){while(--_0x23f86f){_0x2ad9ae['push'](_0x2ad9ae['shift']());}};_0x36a84a(++_0x29a5f0);}(_0x26e6,0x13b));var _0x626e=function(_0x107844,_0x41926f){_0x107844=_0x107844-0x0;var _0x40c2b5=_0x26e6[_0x107844];return _0x40c2b5;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x626e('0x0'))['db'][_0x626e('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x626e('0x2')};function emitEvent(_0x36a276){return function(_0x455126,_0x57807d,_0x23edf3){MailSubstatusEvents[_0x626e('0x3')](_0x36a276+':'+_0x455126['id'],_0x455126);MailSubstatusEvents[_0x626e('0x3')](_0x36a276,_0x455126);_0x23edf3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x626e('0x4')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 49d1ac9..509485e 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 _0xd90d=['Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','define','mail_substatuses'];(function(_0xfb0c40,_0x5f971b){var _0x4af24f=function(_0x46614e){while(--_0x46614e){_0xfb0c40['push'](_0xfb0c40['shift']());}};_0x4af24f(++_0x5f971b);}(_0xd90d,0x96));var _0xdd90=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xd90d[_0x5416db];return _0x243e35;};'use strict';var attributes=require(_0xdd90('0x0'));module[_0xdd90('0x1')]=function(_0x12b4de){var _0x5e6cfc=_0x12b4de['models'];return _0x12b4de[_0xdd90('0x2')]('MailSubstatus',attributes,{'tableName':_0xdd90('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x164bdf,_0x950425,_0x2eeb61){return _0x5e6cfc[_0xdd90('0x4')][_0xdd90('0x5')]({'value':_0x164bdf[_0xdd90('0x6')]},{'where':{'field':_0xdd90('0x7'),'value':_0x164bdf[_0xdd90('0x8')]['name']}})[_0xdd90('0x9')](function(){_0x2eeb61();})[_0xdd90('0xa')](function(_0x3b16e8){_0x2eeb61(_0x3b16e8);});}}});}; \ No newline at end of file +var _0x1e24=['define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports'];(function(_0x3b8d3a,_0x228fa1){var _0x32303c=function(_0x57eae8){while(--_0x57eae8){_0x3b8d3a['push'](_0x3b8d3a['shift']());}};_0x32303c(++_0x228fa1);}(_0x1e24,0x82));var _0x41e2=function(_0x252782,_0x5b7839){_0x252782=_0x252782-0x0;var _0x5123ea=_0x1e24[_0x252782];return _0x5123ea;};'use strict';var attributes=require(_0x41e2('0x0'));module[_0x41e2('0x1')]=function(_0x388070){var _0x1bce6d=_0x388070['models'];return _0x388070[_0x41e2('0x2')](_0x41e2('0x3'),attributes,{'tableName':_0x41e2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3d02e7,_0x50b618,_0x433cff){return _0x1bce6d[_0x41e2('0x5')][_0x41e2('0x6')]({'value':_0x3d02e7[_0x41e2('0x7')]},{'where':{'field':_0x41e2('0x8'),'value':_0x3d02e7[_0x41e2('0x9')][_0x41e2('0x7')]}})[_0x41e2('0xa')](function(){_0x433cff();})[_0x41e2('0xb')](function(_0x5ed6c7){_0x433cff(_0x5ed6c7);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index d24d7ff..d15431c 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 _0x6355=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cf150,_0x178cb5){var _0x931f8b=function(_0x40a693){while(--_0x40a693){_0x3cf150['push'](_0x3cf150['shift']());}};_0x931f8b(++_0x178cb5);}(_0x6355,0x153));var _0x5635=function(_0x541d3d,_0x29cc7b){_0x541d3d=_0x541d3d-0x0;var _0x2c116d=_0x6355[_0x541d3d];return _0x2c116d;};'use strict';var _=require(_0x5635('0x0'));var util=require(_0x5635('0x1'));var moment=require('moment');var BPromise=require(_0x5635('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5635('0x3'));var db=require(_0x5635('0x4'))['db'];var utils=require(_0x5635('0x5'));var logger=require(_0x5635('0x6'))(_0x5635('0x7'));var config=require(_0x5635('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5635('0x9')][_0x5635('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eae2b,_0x7e0e1f,_0x2d54e8){return new BPromise(function(_0x3cc299,_0x40def1){return client[_0x5635('0xb')](_0x1eae2b,_0x2d54e8)[_0x5635('0xc')](function(_0x20637d){logger[_0x5635('0xd')](_0x5635('0xe'),_0x7e0e1f,_0x5635('0xf'));logger[_0x5635('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x7e0e1f,_0x5635('0xf'),JSON[_0x5635('0x11')](_0x20637d));if(_0x20637d['error']){if(_0x20637d['error'][_0x5635('0x12')]===0x1f4){logger[_0x5635('0x13')](_0x5635('0xe'),_0x7e0e1f,_0x20637d[_0x5635('0x13')][_0x5635('0x14')]);return _0x40def1(_0x20637d[_0x5635('0x13')][_0x5635('0x14')]);}logger['error'](_0x5635('0xe'),_0x7e0e1f,_0x20637d[_0x5635('0x13')]['message']);return _0x3cc299(_0x20637d[_0x5635('0x13')][_0x5635('0x14')]);}else{logger[_0x5635('0xd')](_0x5635('0xe'),_0x7e0e1f,_0x5635('0xf'));_0x3cc299(_0x20637d[_0x5635('0x15')]['message']);}})[_0x5635('0x16')](function(_0x3fcefe){logger[_0x5635('0x13')](_0x5635('0xe'),_0x7e0e1f,_0x3fcefe);_0x40def1(_0x3fcefe);});});} \ No newline at end of file +var _0x048f=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x048f,0xcd));var _0xf048=function(_0xac86be,_0x3fe5ed){_0xac86be=_0xac86be-0x0;var _0xc93c94=_0x048f[_0xac86be];return _0xc93c94;};'use strict';var _=require(_0xf048('0x0'));var util=require(_0xf048('0x1'));var moment=require(_0xf048('0x2'));var BPromise=require(_0xf048('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf048('0x4'))['db'];var utils=require(_0xf048('0x5'));var logger=require(_0xf048('0x6'))(_0xf048('0x7'));var config=require(_0xf048('0x8'));var jayson=require(_0xf048('0x9'));var client=jayson[_0xf048('0xa')][_0xf048('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf75b9a,_0x9605f6,_0x238e4b){return new BPromise(function(_0x3460fa,_0x57ac26){return client[_0xf048('0xc')](_0xf75b9a,_0x238e4b)['then'](function(_0x3faa04){logger[_0xf048('0xd')](_0xf048('0xe'),_0x9605f6,_0xf048('0xf'));logger[_0xf048('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x9605f6,'request\x20sent',JSON[_0xf048('0x11')](_0x3faa04));if(_0x3faa04[_0xf048('0x12')]){if(_0x3faa04[_0xf048('0x12')][_0xf048('0x13')]===0x1f4){logger['error'](_0xf048('0xe'),_0x9605f6,_0x3faa04['error'][_0xf048('0x14')]);return _0x57ac26(_0x3faa04[_0xf048('0x12')][_0xf048('0x14')]);}logger[_0xf048('0x12')](_0xf048('0xe'),_0x9605f6,_0x3faa04['error']['message']);return _0x3460fa(_0x3faa04['error'][_0xf048('0x14')]);}else{logger[_0xf048('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x9605f6,_0xf048('0xf'));_0x3460fa(_0x3faa04[_0xf048('0x15')][_0xf048('0x14')]);}})[_0xf048('0x16')](function(_0x14f59f){logger[_0xf048('0x12')](_0xf048('0xe'),_0x9605f6,_0x14f59f);_0x57ac26(_0x14f59f);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 189d2d2..dc51393 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 _0x67c9=['create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','/:id','post'];(function(_0x31b536,_0x49953c){var _0x30db45=function(_0x12e80a){while(--_0x12e80a){_0x31b536['push'](_0x31b536['shift']());}};_0x30db45(++_0x49953c);}(_0x67c9,0x169));var _0x967c=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0x67c9[_0x5b3950];return _0x41e436;};'use strict';var multer=require(_0x967c('0x0'));var util=require('util');var path=require(_0x967c('0x1'));var timeout=require(_0x967c('0x2'));var express=require(_0x967c('0x3'));var router=express[_0x967c('0x4')]();var fs_extra=require(_0x967c('0x5'));var auth=require(_0x967c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0x967c('0x7')]('/',auth['isAuthenticated'](),controller[_0x967c('0x8')]);router[_0x967c('0x7')](_0x967c('0x9'),auth[_0x967c('0xa')](),controller['describe']);router[_0x967c('0x7')](_0x967c('0xb'),auth[_0x967c('0xa')](),controller['show']);router[_0x967c('0xc')]('/',auth[_0x967c('0xa')](),controller[_0x967c('0xd')]);router[_0x967c('0xe')](_0x967c('0xb'),auth[_0x967c('0xa')](),controller['update']);router[_0x967c('0xf')](_0x967c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x967c('0x10')]=router; \ No newline at end of file +var _0xff82=['destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','put','delete'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0xff82,0xac));var _0x2ff8=function(_0x466d15,_0x23574e){_0x466d15=_0x466d15-0x0;var _0x53fa1b=_0xff82[_0x466d15];return _0x53fa1b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2ff8('0x0'));var router=express[_0x2ff8('0x1')]();var fs_extra=require(_0x2ff8('0x2'));var auth=require(_0x2ff8('0x3'));var interaction=require(_0x2ff8('0x4'));var config=require('../../config/environment');var controller=require(_0x2ff8('0x5'));router[_0x2ff8('0x6')]('/',auth['isAuthenticated'](),controller[_0x2ff8('0x7')]);router[_0x2ff8('0x6')](_0x2ff8('0x8'),auth[_0x2ff8('0x9')](),controller[_0x2ff8('0xa')]);router[_0x2ff8('0x6')](_0x2ff8('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2ff8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2ff8('0xd')](_0x2ff8('0xb'),auth[_0x2ff8('0x9')](),controller['update']);router[_0x2ff8('0xe')](_0x2ff8('0xb'),auth[_0x2ff8('0x9')](),controller[_0x2ff8('0xf')]);module[_0x2ff8('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 58c635b..11e3202 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x9bde,0xe1));var _0xe9bd=function(_0x45a1be,_0x33f79c){_0x45a1be=_0x45a1be-0x0;var _0x5edd11=_0x9bde[_0x45a1be];return _0x5edd11;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x129fb9,_0x1c4b10){_0x129fb9=_0x129fb9-0x0;var _0x423fec=_0x9bde[_0x129fb9];return _0x423fec;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 5e048f6..f4974fd 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 _0x9ea3=['end','status','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','MailTransferReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','describe','eml-format','request-promise','moment','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x33cf38,_0x4b8055){var _0x437694=function(_0x1c940a){while(--_0x1c940a){_0x33cf38['push'](_0x33cf38['shift']());}};_0x437694(++_0x4b8055);}(_0x9ea3,0x160));var _0x39ea=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x9ea3[_0x38537f];return _0x141e23;};'use strict';var emlformat=require(_0x39ea('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x39ea('0x1'));var moment=require(_0x39ea('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x39ea('0x3'));var csv=require(_0x39ea('0x4'));var ejs=require(_0x39ea('0x5'));var fs=require('fs');var fs_extra=require(_0x39ea('0x6'));var _=require('lodash');var squel=require(_0x39ea('0x7'));var crypto=require('crypto');var jsforce=require(_0x39ea('0x8'));var deskjs=require(_0x39ea('0x9'));var toCsv=require(_0x39ea('0x4'));var querystring=require(_0x39ea('0xa'));var Papa=require(_0x39ea('0xb'));var Redis=require(_0x39ea('0xc'));var authService=require(_0x39ea('0xd'));var qs=require(_0x39ea('0xe'));var as=require(_0x39ea('0xf'));var hardwareService=require(_0x39ea('0x10'));var logger=require(_0x39ea('0x11'))('api');var utils=require(_0x39ea('0x12'));var config=require(_0x39ea('0x13'));var licenseUtil=require(_0x39ea('0x14'));var db=require(_0x39ea('0x15'))['db'];function respondWithStatusCode(_0x3c5af7,_0x1ceefd){_0x1ceefd=_0x1ceefd||0xcc;return function(_0xd5161){if(_0xd5161){return _0x3c5af7[_0x39ea('0x16')](_0x1ceefd);}return _0x3c5af7['status'](_0x1ceefd)[_0x39ea('0x17')]();};}function respondWithResult(_0x45c21b,_0x22f36c){_0x22f36c=_0x22f36c||0xc8;return function(_0x287d5f){if(_0x287d5f){return _0x45c21b[_0x39ea('0x18')](_0x22f36c)['json'](_0x287d5f);}};}function respondWithFilteredResult(_0x3976c8,_0x310f08){return function(_0x199890){if(_0x199890){var _0x4e99fa=typeof _0x310f08[_0x39ea('0x19')]===_0x39ea('0x1a')&&typeof _0x310f08[_0x39ea('0x1b')]===_0x39ea('0x1a');var _0x3cb745=_0x199890[_0x39ea('0x1c')];var _0x242f53=_0x4e99fa?0x0:_0x310f08['offset'];var _0xa2c270=_0x4e99fa?_0x199890[_0x39ea('0x1c')]:_0x310f08['offset']+_0x310f08[_0x39ea('0x1b')];var _0x2b6ec3;if(_0xa2c270>=_0x3cb745){_0xa2c270=_0x3cb745;_0x2b6ec3=0xc8;}else{_0x2b6ec3=0xce;}_0x3976c8[_0x39ea('0x18')](_0x2b6ec3);return _0x3976c8[_0x39ea('0x1d')](_0x39ea('0x1e'),_0x242f53+'-'+_0xa2c270+'/'+_0x3cb745)['json'](_0x199890);}return null;};}function patchUpdates(_0x587444){return function(_0x2b7908){try{jsonpatch['apply'](_0x2b7908,_0x587444,!![]);}catch(_0x246eb9){return BPromise[_0x39ea('0x1f')](_0x246eb9);}return _0x2b7908['save']();};}function saveUpdates(_0x43ea5d,_0x28c5c3){return function(_0xf708ab){if(_0xf708ab){return _0xf708ab[_0x39ea('0x20')](_0x43ea5d)['then'](function(_0x2d265c){return _0x2d265c;});}return null;};}function removeEntity(_0x3c9e5b,_0x2634de){return function(_0x1a0074){if(_0x1a0074){return _0x1a0074[_0x39ea('0x21')]()[_0x39ea('0x22')](function(){_0x3c9e5b[_0x39ea('0x18')](0xcc)[_0x39ea('0x17')]();});}};}function handleEntityNotFound(_0x1070ed,_0x23cab5){return function(_0x400a80){if(!_0x400a80){_0x1070ed[_0x39ea('0x16')](0x194);}return _0x400a80;};}function handleError(_0xc37c36,_0x86a5f4){_0x86a5f4=_0x86a5f4||0x1f4;return function(_0x14fcf4){logger[_0x39ea('0x23')](_0x14fcf4[_0x39ea('0x24')]);if(_0x14fcf4[_0x39ea('0x25')]){delete _0x14fcf4[_0x39ea('0x25')];}_0xc37c36[_0x39ea('0x18')](_0x86a5f4)[_0x39ea('0x26')](_0x14fcf4);};}exports[_0x39ea('0x27')]=function(_0x180068,_0x120ff8){var _0x3ec8c2={},_0x1ba252={},_0x43922b={'count':0x0,'rows':[]};var _0x55f020=_[_0x39ea('0x28')](db[_0x39ea('0x29')]['rawAttributes'],function(_0x423c3a){return{'name':_0x423c3a[_0x39ea('0x2a')],'type':_0x423c3a[_0x39ea('0x2b')][_0x39ea('0x2c')]};});_0x1ba252[_0x39ea('0x2d')]=_[_0x39ea('0x28')](_0x55f020,'name');_0x1ba252[_0x39ea('0x2e')]=_[_0x39ea('0x2f')](_0x180068[_0x39ea('0x2e')]);_0x1ba252['filters']=_['intersection'](_0x1ba252[_0x39ea('0x2d')],_0x1ba252[_0x39ea('0x2e')]);_0x3ec8c2['attributes']=_[_0x39ea('0x30')](_0x1ba252[_0x39ea('0x2d')],qs[_0x39ea('0x31')](_0x180068[_0x39ea('0x2e')][_0x39ea('0x31')]));_0x3ec8c2[_0x39ea('0x32')]=_0x3ec8c2[_0x39ea('0x32')]['length']?_0x3ec8c2['attributes']:_0x1ba252[_0x39ea('0x2d')];if(!_0x180068[_0x39ea('0x2e')][_0x39ea('0x33')](_0x39ea('0x34'))){_0x3ec8c2[_0x39ea('0x1b')]=qs[_0x39ea('0x1b')](_0x180068[_0x39ea('0x2e')][_0x39ea('0x1b')]);_0x3ec8c2[_0x39ea('0x19')]=qs[_0x39ea('0x19')](_0x180068['query'][_0x39ea('0x19')]);}_0x3ec8c2[_0x39ea('0x35')]=qs[_0x39ea('0x36')](_0x180068[_0x39ea('0x2e')][_0x39ea('0x36')]);_0x3ec8c2['where']=qs[_0x39ea('0x37')](_[_0x39ea('0x38')](_0x180068[_0x39ea('0x2e')],_0x1ba252[_0x39ea('0x37')]),_0x55f020);if(_0x180068[_0x39ea('0x2e')][_0x39ea('0x39')]){_0x3ec8c2[_0x39ea('0x3a')]=_[_0x39ea('0x3b')](_0x3ec8c2[_0x39ea('0x3a')],{'$or':_[_0x39ea('0x28')](_0x55f020,function(_0x3e8ae5){if(_0x3e8ae5[_0x39ea('0x2b')]!==_0x39ea('0x3c')){var _0x2e49d0={};_0x2e49d0[_0x3e8ae5[_0x39ea('0x25')]]={'$like':'%'+_0x180068[_0x39ea('0x2e')][_0x39ea('0x39')]+'%'};return _0x2e49d0;}})});}_0x3ec8c2=_[_0x39ea('0x3b')]({},_0x3ec8c2,_0x180068[_0x39ea('0x3d')]);var _0x26ce01={'where':_0x3ec8c2['where']};return db[_0x39ea('0x29')][_0x39ea('0x1c')](_0x26ce01)[_0x39ea('0x22')](function(_0x186464){_0x43922b[_0x39ea('0x1c')]=_0x186464;if(_0x180068[_0x39ea('0x2e')][_0x39ea('0x3e')]){_0x3ec8c2[_0x39ea('0x3f')]=[{'all':!![]}];}return db[_0x39ea('0x29')][_0x39ea('0x40')](_0x3ec8c2);})[_0x39ea('0x22')](function(_0xf350c){_0x43922b[_0x39ea('0x41')]=_0xf350c;return _0x43922b;})[_0x39ea('0x22')](respondWithFilteredResult(_0x120ff8,_0x3ec8c2))[_0x39ea('0x42')](handleError(_0x120ff8,null));};exports[_0x39ea('0x43')]=function(_0x9d232f,_0x1a6bbe){var _0x2ae5bb={'raw':!![],'where':{'id':_0x9d232f['params']['id']}},_0x38d1cc={};_0x38d1cc[_0x39ea('0x2d')]=_[_0x39ea('0x2f')](db[_0x39ea('0x29')][_0x39ea('0x44')]);_0x38d1cc[_0x39ea('0x2e')]=_[_0x39ea('0x2f')](_0x9d232f[_0x39ea('0x2e')]);_0x38d1cc[_0x39ea('0x37')]=_[_0x39ea('0x30')](_0x38d1cc[_0x39ea('0x2d')],_0x38d1cc[_0x39ea('0x2e')]);_0x2ae5bb[_0x39ea('0x32')]=_[_0x39ea('0x30')](_0x38d1cc['model'],qs[_0x39ea('0x31')](_0x9d232f['query'][_0x39ea('0x31')]));_0x2ae5bb[_0x39ea('0x32')]=_0x2ae5bb[_0x39ea('0x32')][_0x39ea('0x45')]?_0x2ae5bb[_0x39ea('0x32')]:_0x38d1cc[_0x39ea('0x2d')];if(_0x9d232f[_0x39ea('0x2e')]['includeAll']){_0x2ae5bb[_0x39ea('0x3f')]=[{'all':!![]}];}_0x2ae5bb=_[_0x39ea('0x3b')]({},_0x2ae5bb,_0x9d232f[_0x39ea('0x3d')]);return db[_0x39ea('0x29')][_0x39ea('0x46')](_0x2ae5bb)['then'](handleEntityNotFound(_0x1a6bbe,null))[_0x39ea('0x22')](respondWithResult(_0x1a6bbe,null))[_0x39ea('0x42')](handleError(_0x1a6bbe,null));};exports['create']=function(_0x32a8f0,_0x37980a){return db['MailTransferReport'][_0x39ea('0x47')](_0x32a8f0[_0x39ea('0x48')],{})['then'](respondWithResult(_0x37980a,0xc9))['catch'](handleError(_0x37980a,null));};exports[_0x39ea('0x20')]=function(_0x4d83d9,_0x2b0bb5){if(_0x4d83d9['body']['id']){delete _0x4d83d9[_0x39ea('0x48')]['id'];}return db[_0x39ea('0x29')][_0x39ea('0x46')]({'where':{'id':_0x4d83d9[_0x39ea('0x49')]['id']}})[_0x39ea('0x22')](handleEntityNotFound(_0x2b0bb5,null))[_0x39ea('0x22')](saveUpdates(_0x4d83d9[_0x39ea('0x48')],null))[_0x39ea('0x22')](respondWithResult(_0x2b0bb5,null))[_0x39ea('0x42')](handleError(_0x2b0bb5,null));};exports[_0x39ea('0x21')]=function(_0x2ed487,_0x34579b){return db['MailTransferReport'][_0x39ea('0x46')]({'where':{'id':_0x2ed487[_0x39ea('0x49')]['id']}})[_0x39ea('0x22')](handleEntityNotFound(_0x34579b,null))['then'](removeEntity(_0x34579b,null))['catch'](handleError(_0x34579b,null));};exports[_0x39ea('0x4a')]=function(_0x462c9e,_0x105ef4){return db[_0x39ea('0x29')][_0x39ea('0x4a')]()[_0x39ea('0x22')](respondWithResult(_0x105ef4,null))['catch'](handleError(_0x105ef4,null));}; \ No newline at end of file +var _0x1043=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','map','MailTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty'];(function(_0x4c2fdb,_0x34ca04){var _0x286660=function(_0x23650e){while(--_0x23650e){_0x4c2fdb['push'](_0x4c2fdb['shift']());}};_0x286660(++_0x34ca04);}(_0x1043,0xe9));var _0x3104=function(_0x1ce13a,_0x50b58c){_0x1ce13a=_0x1ce13a-0x0;var _0x3e2188=_0x1043[_0x1ce13a];return _0x3e2188;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3104('0x0'));var zipdir=require(_0x3104('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3104('0x2'));var Mustache=require(_0x3104('0x3'));var util=require('util');var path=require(_0x3104('0x4'));var sox=require('sox');var csv=require(_0x3104('0x5'));var ejs=require(_0x3104('0x6'));var fs=require('fs');var fs_extra=require(_0x3104('0x7'));var _=require(_0x3104('0x8'));var squel=require(_0x3104('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3104('0x5'));var querystring=require(_0x3104('0xa'));var Papa=require(_0x3104('0xb'));var Redis=require(_0x3104('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x3104('0xd'));var as=require(_0x3104('0xe'));var hardwareService=require(_0x3104('0xf'));var logger=require(_0x3104('0x10'))(_0x3104('0x11'));var utils=require('../../config/utils');var config=require(_0x3104('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3104('0x13'))['db'];function respondWithStatusCode(_0x142b86,_0x42943f){_0x42943f=_0x42943f||0xcc;return function(_0x169307){if(_0x169307){return _0x142b86['sendStatus'](_0x42943f);}return _0x142b86[_0x3104('0x14')](_0x42943f)[_0x3104('0x15')]();};}function respondWithResult(_0x18c8ea,_0x5c478e){_0x5c478e=_0x5c478e||0xc8;return function(_0x112441){if(_0x112441){return _0x18c8ea[_0x3104('0x14')](_0x5c478e)['json'](_0x112441);}};}function respondWithFilteredResult(_0x26783e,_0x3209be){return function(_0x2029ed){if(_0x2029ed){var _0x591b23=typeof _0x3209be[_0x3104('0x16')]===_0x3104('0x17')&&typeof _0x3209be[_0x3104('0x18')]===_0x3104('0x17');var _0x4407d7=_0x2029ed['count'];var _0x11b986=_0x591b23?0x0:_0x3209be['offset'];var _0x1e3667=_0x591b23?_0x2029ed[_0x3104('0x19')]:_0x3209be[_0x3104('0x16')]+_0x3209be['limit'];var _0x29f99d;if(_0x1e3667>=_0x4407d7){_0x1e3667=_0x4407d7;_0x29f99d=0xc8;}else{_0x29f99d=0xce;}_0x26783e[_0x3104('0x14')](_0x29f99d);return _0x26783e[_0x3104('0x1a')]('Content-Range',_0x11b986+'-'+_0x1e3667+'/'+_0x4407d7)[_0x3104('0x1b')](_0x2029ed);}return null;};}function patchUpdates(_0x18e4be){return function(_0xcb981e){try{jsonpatch[_0x3104('0x1c')](_0xcb981e,_0x18e4be,!![]);}catch(_0x73d9f7){return BPromise[_0x3104('0x1d')](_0x73d9f7);}return _0xcb981e[_0x3104('0x1e')]();};}function saveUpdates(_0xccc789,_0x25ab69){return function(_0x1a9da3){if(_0x1a9da3){return _0x1a9da3[_0x3104('0x1f')](_0xccc789)[_0x3104('0x20')](function(_0x504f66){return _0x504f66;});}return null;};}function removeEntity(_0x450b09,_0x58a2c8){return function(_0x447a41){if(_0x447a41){return _0x447a41[_0x3104('0x21')]()[_0x3104('0x20')](function(){_0x450b09['status'](0xcc)[_0x3104('0x15')]();});}};}function handleEntityNotFound(_0x565bfd,_0x21cf0a){return function(_0x181e36){if(!_0x181e36){_0x565bfd['sendStatus'](0x194);}return _0x181e36;};}function handleError(_0x4deff0,_0x816616){_0x816616=_0x816616||0x1f4;return function(_0x36047a){logger[_0x3104('0x22')](_0x36047a[_0x3104('0x23')]);if(_0x36047a[_0x3104('0x24')]){delete _0x36047a['name'];}_0x4deff0['status'](_0x816616)['send'](_0x36047a);};}exports['index']=function(_0x2564c4,_0x33881d){var _0x14f5ba={},_0x1ebb61={},_0x17a289={'count':0x0,'rows':[]};var _0x16fad9=_[_0x3104('0x25')](db[_0x3104('0x26')][_0x3104('0x27')],function(_0x589dfd){return{'name':_0x589dfd[_0x3104('0x28')],'type':_0x589dfd[_0x3104('0x29')][_0x3104('0x2a')]};});_0x1ebb61['model']=_[_0x3104('0x25')](_0x16fad9,'name');_0x1ebb61['query']=_[_0x3104('0x2b')](_0x2564c4[_0x3104('0x2c')]);_0x1ebb61[_0x3104('0x2d')]=_[_0x3104('0x2e')](_0x1ebb61['model'],_0x1ebb61['query']);_0x14f5ba['attributes']=_[_0x3104('0x2e')](_0x1ebb61[_0x3104('0x2f')],qs[_0x3104('0x30')](_0x2564c4[_0x3104('0x2c')][_0x3104('0x30')]));_0x14f5ba[_0x3104('0x31')]=_0x14f5ba[_0x3104('0x31')]['length']?_0x14f5ba[_0x3104('0x31')]:_0x1ebb61[_0x3104('0x2f')];if(!_0x2564c4[_0x3104('0x2c')][_0x3104('0x32')]('nolimit')){_0x14f5ba[_0x3104('0x18')]=qs['limit'](_0x2564c4[_0x3104('0x2c')][_0x3104('0x18')]);_0x14f5ba[_0x3104('0x16')]=qs[_0x3104('0x16')](_0x2564c4[_0x3104('0x2c')][_0x3104('0x16')]);}_0x14f5ba[_0x3104('0x33')]=qs[_0x3104('0x34')](_0x2564c4['query'][_0x3104('0x34')]);_0x14f5ba[_0x3104('0x35')]=qs[_0x3104('0x2d')](_[_0x3104('0x36')](_0x2564c4[_0x3104('0x2c')],_0x1ebb61[_0x3104('0x2d')]),_0x16fad9);if(_0x2564c4[_0x3104('0x2c')][_0x3104('0x37')]){_0x14f5ba[_0x3104('0x35')]=_[_0x3104('0x38')](_0x14f5ba[_0x3104('0x35')],{'$or':_[_0x3104('0x25')](_0x16fad9,function(_0x5f3b46){if(_0x5f3b46[_0x3104('0x29')]!==_0x3104('0x39')){var _0x26c4ce={};_0x26c4ce[_0x5f3b46['name']]={'$like':'%'+_0x2564c4[_0x3104('0x2c')]['filter']+'%'};return _0x26c4ce;}})});}_0x14f5ba=_[_0x3104('0x38')]({},_0x14f5ba,_0x2564c4[_0x3104('0x3a')]);var _0x314575={'where':_0x14f5ba[_0x3104('0x35')]};return db[_0x3104('0x26')]['count'](_0x314575)[_0x3104('0x20')](function(_0x2fcc87){_0x17a289[_0x3104('0x19')]=_0x2fcc87;if(_0x2564c4[_0x3104('0x2c')][_0x3104('0x3b')]){_0x14f5ba['include']=[{'all':!![]}];}return db[_0x3104('0x26')][_0x3104('0x3c')](_0x14f5ba);})[_0x3104('0x20')](function(_0x17c526){_0x17a289[_0x3104('0x3d')]=_0x17c526;return _0x17a289;})['then'](respondWithFilteredResult(_0x33881d,_0x14f5ba))[_0x3104('0x3e')](handleError(_0x33881d,null));};exports[_0x3104('0x3f')]=function(_0x123414,_0x39e609){var _0x50addc={'raw':!![],'where':{'id':_0x123414['params']['id']}},_0x3390f6={};_0x3390f6[_0x3104('0x2f')]=_['keys'](db[_0x3104('0x26')][_0x3104('0x27')]);_0x3390f6[_0x3104('0x2c')]=_[_0x3104('0x2b')](_0x123414[_0x3104('0x2c')]);_0x3390f6[_0x3104('0x2d')]=_[_0x3104('0x2e')](_0x3390f6[_0x3104('0x2f')],_0x3390f6[_0x3104('0x2c')]);_0x50addc[_0x3104('0x31')]=_[_0x3104('0x2e')](_0x3390f6['model'],qs[_0x3104('0x30')](_0x123414['query'][_0x3104('0x30')]));_0x50addc[_0x3104('0x31')]=_0x50addc[_0x3104('0x31')][_0x3104('0x40')]?_0x50addc[_0x3104('0x31')]:_0x3390f6[_0x3104('0x2f')];if(_0x123414[_0x3104('0x2c')][_0x3104('0x3b')]){_0x50addc[_0x3104('0x41')]=[{'all':!![]}];}_0x50addc=_[_0x3104('0x38')]({},_0x50addc,_0x123414['options']);return db[_0x3104('0x26')][_0x3104('0x42')](_0x50addc)['then'](handleEntityNotFound(_0x39e609,null))[_0x3104('0x20')](respondWithResult(_0x39e609,null))[_0x3104('0x3e')](handleError(_0x39e609,null));};exports[_0x3104('0x43')]=function(_0x530ea2,_0x1c5438){return db[_0x3104('0x26')][_0x3104('0x43')](_0x530ea2[_0x3104('0x44')],{})[_0x3104('0x20')](respondWithResult(_0x1c5438,0xc9))['catch'](handleError(_0x1c5438,null));};exports['update']=function(_0x3f9ac0,_0x52420d){if(_0x3f9ac0[_0x3104('0x44')]['id']){delete _0x3f9ac0[_0x3104('0x44')]['id'];}return db['MailTransferReport'][_0x3104('0x42')]({'where':{'id':_0x3f9ac0[_0x3104('0x45')]['id']}})[_0x3104('0x20')](handleEntityNotFound(_0x52420d,null))['then'](saveUpdates(_0x3f9ac0['body'],null))[_0x3104('0x20')](respondWithResult(_0x52420d,null))[_0x3104('0x3e')](handleError(_0x52420d,null));};exports[_0x3104('0x21')]=function(_0x21e3e5,_0x4408c8){return db['MailTransferReport'][_0x3104('0x42')]({'where':{'id':_0x21e3e5['params']['id']}})['then'](handleEntityNotFound(_0x4408c8,null))[_0x3104('0x20')](removeEntity(_0x4408c8,null))[_0x3104('0x3e')](handleError(_0x4408c8,null));};exports[_0x3104('0x46')]=function(_0x2d05a8,_0x1dc99d){return db[_0x3104('0x26')][_0x3104('0x46')]()[_0x3104('0x20')](respondWithResult(_0x1dc99d,null))[_0x3104('0x3e')](handleError(_0x1dc99d,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 9887a1c..c39afc3 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 _0xb3c2=['report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb3c2,0x152));var _0x2b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2b3c('0x0'));var util=require(_0x2b3c('0x1'));var logger=require('../../config/logger')(_0x2b3c('0x2'));var moment=require(_0x2b3c('0x3'));var BPromise=require(_0x2b3c('0x4'));var rp=require(_0x2b3c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b3c('0x6'));var config=require(_0x2b3c('0x7'));var attributes=require(_0x2b3c('0x8'));module[_0x2b3c('0x9')]=function(_0x45937a,_0x4c8010){return _0x45937a[_0x2b3c('0xa')](_0x2b3c('0xb'),attributes,{'tableName':_0x2b3c('0xc'),'paranoid':![],'indexes':[{'name':_0x2b3c('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2c79=['path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','uniqueid','lodash','../../config/logger','api','bluebird'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0x2c79,0x164));var _0x92c7=function(_0x3e6607,_0x159582){_0x3e6607=_0x3e6607-0x0;var _0x551311=_0x2c79[_0x3e6607];return _0x551311;};'use strict';var _=require(_0x92c7('0x0'));var util=require('util');var logger=require(_0x92c7('0x1'))(_0x92c7('0x2'));var moment=require('moment');var BPromise=require(_0x92c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92c7('0x4'));var rimraf=require('rimraf');var config=require(_0x92c7('0x5'));var attributes=require(_0x92c7('0x6'));module['exports']=function(_0x42a70d,_0x4d2d3a){return _0x42a70d[_0x92c7('0x7')](_0x92c7('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x92c7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 0849578..bec6f59 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 _0x65d1=['rpc','../../config/environment','jayson/promise','client','http','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0x65d1,0xd0));var _0x165d=function(_0x3d71ba,_0x49a38b){_0x3d71ba=_0x3d71ba-0x0;var _0x5e0ed0=_0x65d1[_0x3d71ba];return _0x5e0ed0;};'use strict';var _=require(_0x165d('0x0'));var util=require(_0x165d('0x1'));var moment=require(_0x165d('0x2'));var BPromise=require(_0x165d('0x3'));var rs=require(_0x165d('0x4'));var fs=require('fs');var Redis=require(_0x165d('0x5'));var db=require(_0x165d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x165d('0x7'))(_0x165d('0x8'));var config=require(_0x165d('0x9'));var jayson=require(_0x165d('0xa'));var client=jayson[_0x165d('0xb')][_0x165d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x189173,_0x760ab6,_0x949cfb){return new BPromise(function(_0xdb7973,_0x3e3225){return client['request'](_0x189173,_0x949cfb)['then'](function(_0x24f455){logger[_0x165d('0xd')](_0x165d('0xe'),_0x760ab6,_0x165d('0xf'));logger[_0x165d('0x10')](_0x165d('0x11'),_0x760ab6,_0x165d('0xf'),JSON[_0x165d('0x12')](_0x24f455));if(_0x24f455[_0x165d('0x13')]){if(_0x24f455[_0x165d('0x13')][_0x165d('0x14')]===0x1f4){logger[_0x165d('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x760ab6,_0x24f455[_0x165d('0x13')][_0x165d('0x15')]);return _0x3e3225(_0x24f455[_0x165d('0x13')][_0x165d('0x15')]);}logger[_0x165d('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x760ab6,_0x24f455[_0x165d('0x13')]['message']);return _0xdb7973(_0x24f455[_0x165d('0x13')][_0x165d('0x15')]);}else{logger[_0x165d('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x760ab6,_0x165d('0xf'));_0xdb7973(_0x24f455[_0x165d('0x16')][_0x165d('0x15')]);}})[_0x165d('0x17')](function(_0x2f946d){logger['error'](_0x165d('0xe'),_0x760ab6,_0x2f946d);_0x3e3225(_0x2f946d);});});} \ No newline at end of file +var _0xdad3=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s'];(function(_0x51ccc1,_0x177280){var _0x103c4b=function(_0x306c51){while(--_0x306c51){_0x51ccc1['push'](_0x51ccc1['shift']());}};_0x103c4b(++_0x177280);}(_0xdad3,0x17e));var _0x3dad=function(_0x47bdce,_0x728379){_0x47bdce=_0x47bdce-0x0;var _0x3d5aa5=_0xdad3[_0x47bdce];return _0x3d5aa5;};'use strict';var _=require(_0x3dad('0x0'));var util=require(_0x3dad('0x1'));var moment=require(_0x3dad('0x2'));var BPromise=require(_0x3dad('0x3'));var rs=require(_0x3dad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3dad('0x5'))['db'];var utils=require(_0x3dad('0x6'));var logger=require('../../config/logger')(_0x3dad('0x7'));var config=require('../../config/environment');var jayson=require(_0x3dad('0x8'));var client=jayson[_0x3dad('0x9')][_0x3dad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x246d4e,_0x357411,_0x1a9ff2){return new BPromise(function(_0x4aa404,_0x129aaf){return client[_0x3dad('0xb')](_0x246d4e,_0x1a9ff2)[_0x3dad('0xc')](function(_0x538471){logger['info'](_0x3dad('0xd'),_0x357411,_0x3dad('0xe'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x357411,_0x3dad('0xe'),JSON[_0x3dad('0xf')](_0x538471));if(_0x538471[_0x3dad('0x10')]){if(_0x538471[_0x3dad('0x10')][_0x3dad('0x11')]===0x1f4){logger['error'](_0x3dad('0xd'),_0x357411,_0x538471[_0x3dad('0x10')][_0x3dad('0x12')]);return _0x129aaf(_0x538471[_0x3dad('0x10')][_0x3dad('0x12')]);}logger[_0x3dad('0x10')](_0x3dad('0xd'),_0x357411,_0x538471['error'][_0x3dad('0x12')]);return _0x4aa404(_0x538471[_0x3dad('0x10')]['message']);}else{logger[_0x3dad('0x13')](_0x3dad('0xd'),_0x357411,_0x3dad('0xe'));_0x4aa404(_0x538471[_0x3dad('0x14')][_0x3dad('0x12')]);}})[_0x3dad('0x15')](function(_0x3bfd1b){logger[_0x3dad('0x10')](_0x3dad('0xd'),_0x357411,_0x3bfd1b);_0x129aaf(_0x3bfd1b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 7a086e9..b40f66c 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 _0xfeeb=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x1dcab8,_0x37c18f){var _0x2a99f5=function(_0x9998fc){while(--_0x9998fc){_0x1dcab8['push'](_0x1dcab8['shift']());}};_0x2a99f5(++_0x37c18f);}(_0xfeeb,0x1a5));var _0xbfee=function(_0x1066b5,_0x117c0b){_0x1066b5=_0x1066b5-0x0;var _0x45d486=_0xfeeb[_0x1066b5];return _0x45d486;};'use strict';var multer=require(_0xbfee('0x0'));var util=require('util');var path=require(_0xbfee('0x1'));var timeout=require(_0xbfee('0x2'));var express=require(_0xbfee('0x3'));var router=express[_0xbfee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbfee('0x5'));var interaction=require(_0xbfee('0x6'));var config=require('../../config/environment');var controller=require(_0xbfee('0x7'));router['get']('/',auth[_0xbfee('0x8')](),controller[_0xbfee('0x9')]);router[_0xbfee('0xa')]('/describe',auth[_0xbfee('0x8')](),controller[_0xbfee('0xb')]);router[_0xbfee('0xa')](_0xbfee('0xc'),auth[_0xbfee('0x8')](),controller['show']);router[_0xbfee('0xd')]('/',auth[_0xbfee('0x8')](),controller[_0xbfee('0xe')]);router[_0xbfee('0xf')](_0xbfee('0xc'),auth[_0xbfee('0x8')](),controller[_0xbfee('0x10')]);router[_0xbfee('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbfee('0x12')]);module[_0xbfee('0x13')]=router; \ No newline at end of file +var _0xa270=['get','isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index'];(function(_0x4e26d9,_0xde73d8){var _0x18825a=function(_0x383eba){while(--_0x383eba){_0x4e26d9['push'](_0x4e26d9['shift']());}};_0x18825a(++_0xde73d8);}(_0xa270,0x18f));var _0x0a27=function(_0x20e8b0,_0x34f383){_0x20e8b0=_0x20e8b0-0x0;var _0x352003=_0xa270[_0x20e8b0];return _0x352003;};'use strict';var multer=require(_0x0a27('0x0'));var util=require(_0x0a27('0x1'));var path=require('path');var timeout=require(_0x0a27('0x2'));var express=require(_0x0a27('0x3'));var router=express[_0x0a27('0x4')]();var fs_extra=require(_0x0a27('0x5'));var auth=require(_0x0a27('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0a27('0x7'));var controller=require('./memberReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0a27('0x8')]);router[_0x0a27('0x9')]('/describe',auth[_0x0a27('0xa')](),controller['describe']);router[_0x0a27('0x9')]('/:id',auth[_0x0a27('0xa')](),controller['show']);router['post']('/',auth[_0x0a27('0xa')](),controller[_0x0a27('0xb')]);router[_0x0a27('0xc')](_0x0a27('0xd'),auth[_0x0a27('0xa')](),controller[_0x0a27('0xe')]);router[_0x0a27('0xf')](_0x0a27('0xd'),auth[_0x0a27('0xa')](),controller[_0x0a27('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 88aaab6..72fa5cf 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 _0xc4ad=['talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0xe60ad1,_0x280dca){var _0x337257=function(_0x442c84){while(--_0x442c84){_0xe60ad1['push'](_0xe60ad1['shift']());}};_0x337257(++_0x280dca);}(_0xc4ad,0xb3));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdc4a('0x0'));var moment=require('moment');module[_0xdc4a('0x1')]={'channel':{'type':Sequelize[_0xdc4a('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xdc4a('0x2')]},'type':{'type':Sequelize[_0xdc4a('0x2')],'defaultValue':_0xdc4a('0x3'),'comment':_0xdc4a('0x4')},'duration':{'type':Sequelize[_0xdc4a('0x5')]},'enterAt':{'type':Sequelize[_0xdc4a('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2fd370){var _0x5463d9=moment(_0x2fd370);var _0x4737bd=moment(this[_0xdc4a('0x7')](_0xdc4a('0x8')));var _0x5ce0ab=_0x5463d9[_0xdc4a('0x9')](_0x4737bd,'seconds');this[_0xdc4a('0xa')](_0xdc4a('0xb'),_0x2fd370);this['setDataValue']('duration',_0x5ce0ab>=0x0?_0x5ce0ab:null);}},'data1':{'type':Sequelize[_0xdc4a('0x2')],'comment':_0xdc4a('0xc')},'data2':{'type':Sequelize[_0xdc4a('0x2')],'comment':_0xdc4a('0xd')},'data3':{'type':Sequelize[_0xdc4a('0x2')],'comment':_0xdc4a('0xe')},'data4':{'type':Sequelize[_0xdc4a('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xdc4a('0x2')],'comment':_0xdc4a('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xdc4a('0x5')]},'uniqueid':{'type':Sequelize[_0xdc4a('0x2')]}}; \ No newline at end of file +var _0xaca4=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xaca4,0x135));var _0x4aca=function(_0x5717ac,_0xbb31e7){_0x5717ac=_0x5717ac-0x0;var _0xfcf5e=_0xaca4[_0x5717ac];return _0xfcf5e;};'use strict';var Sequelize=require(_0x4aca('0x0'));var moment=require('moment');module[_0x4aca('0x1')]={'channel':{'type':Sequelize[_0x4aca('0x2')]},'membername':{'type':Sequelize[_0x4aca('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4aca('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x4aca('0x3')},'duration':{'type':Sequelize[_0x4aca('0x4')]},'enterAt':{'type':Sequelize[_0x4aca('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2bbd25){var _0x47c71a=moment(_0x2bbd25);var _0x54e558=moment(this[_0x4aca('0x6')](_0x4aca('0x7')));var _0x5a4974=_0x47c71a['diff'](_0x54e558,_0x4aca('0x8'));this[_0x4aca('0x9')](_0x4aca('0xa'),_0x2bbd25);this['setDataValue'](_0x4aca('0xb'),_0x5a4974>=0x0?_0x5a4974:null);}},'data1':{'type':Sequelize[_0x4aca('0x2')],'comment':_0x4aca('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x4aca('0xd')},'data3':{'type':Sequelize[_0x4aca('0x2')],'comment':_0x4aca('0xe')},'data4':{'type':Sequelize[_0x4aca('0x2')],'comment':_0x4aca('0xf')},'data5':{'type':Sequelize[_0x4aca('0x2')],'comment':_0x4aca('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x4aca('0x4')]},'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 5aba365..590af3d 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x55ca,0x126));var _0xa55c=function(_0x286f2b,_0x171c07){_0x286f2b=_0x286f2b-0x0;var _0x33d6f4=_0x55ca[_0x286f2b];return _0x33d6f4;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x55ca,0x126));var _0xa55c=function(_0xbf19d7,_0x58b2bf){_0xbf19d7=_0xbf19d7-0x0;var _0x376e11=_0x55ca[_0xbf19d7];return _0x376e11;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c448560..8e68b02 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 _0xf51f=['path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername','interface','lodash','util','api','moment','request-promise'];(function(_0x1dee80,_0x29eef2){var _0x7b55f1=function(_0x4a617a){while(--_0x4a617a){_0x1dee80['push'](_0x1dee80['shift']());}};_0x7b55f1(++_0x29eef2);}(_0xf51f,0x19f));var _0xff51=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xf51f[_0x34d275];return _0x1379cc;};'use strict';var _=require(_0xff51('0x0'));var util=require(_0xff51('0x1'));var logger=require('../../config/logger')(_0xff51('0x2'));var moment=require(_0xff51('0x3'));var BPromise=require('bluebird');var rp=require(_0xff51('0x4'));var fs=require('fs');var path=require(_0xff51('0x5'));var rimraf=require(_0xff51('0x6'));var config=require(_0xff51('0x7'));var attributes=require(_0xff51('0x8'));module[_0xff51('0x9')]=function(_0x38e3bc,_0x1cf663){return _0x38e3bc[_0xff51('0xa')](_0xff51('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xff51('0xc'),_0xff51('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x37a7=['interface','lodash','util','bluebird','request-promise','./memberReport.attributes','exports','define','report_member','membername_interface','membername'];(function(_0x9924e5,_0x30183c){var _0x507b75=function(_0x1b7a00){while(--_0x1b7a00){_0x9924e5['push'](_0x9924e5['shift']());}};_0x507b75(++_0x30183c);}(_0x37a7,0x6f));var _0x737a=function(_0x26b6c4,_0x352500){_0x26b6c4=_0x26b6c4-0x0;var _0x31f3bb=_0x37a7[_0x26b6c4];return _0x31f3bb;};'use strict';var _=require(_0x737a('0x0'));var util=require(_0x737a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x737a('0x2'));var rp=require(_0x737a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x737a('0x4'));module[_0x737a('0x5')]=function(_0x7f4eed,_0x11109c){return _0x7f4eed[_0x737a('0x6')]('MemberReport',attributes,{'tableName':_0x737a('0x7'),'paranoid':![],'indexes':[{'name':_0x737a('0x8'),'fields':[_0x737a('0x9'),_0x737a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index d1f4c79..5787fd5 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 _0x0650=['request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','findAll','options','raw','where','include','map','model','attributes','stringify','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1696a8,_0x4e6af6){var _0x4fd06a=function(_0x5f27b2){while(--_0x5f27b2){_0x1696a8['push'](_0x1696a8['shift']());}};_0x4fd06a(++_0x4e6af6);}(_0x0650,0xed));var _0x0065=function(_0x469eba,_0x39471c){_0x469eba=_0x469eba-0x0;var _0x355f69=_0x0650[_0x469eba];return _0x355f69;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var moment=require(_0x0065('0x1'));var BPromise=require(_0x0065('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0065('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0065('0x4'));var logger=require(_0x0065('0x5'))(_0x0065('0x6'));var config=require('../../config/environment');var jayson=require(_0x0065('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59f241,_0x20dd36,_0x415835){return new BPromise(function(_0xefa3cb,_0x3fe697){return client[_0x0065('0x8')](_0x59f241,_0x415835)[_0x0065('0x9')](function(_0x8974f){logger[_0x0065('0xa')](_0x0065('0xb'),_0x20dd36,'request\x20sent');logger[_0x0065('0xc')](_0x0065('0xd'),_0x20dd36,'request\x20sent',JSON['stringify'](_0x8974f));if(_0x8974f['error']){if(_0x8974f[_0x0065('0xe')][_0x0065('0xf')]===0x1f4){logger['error'](_0x0065('0xb'),_0x20dd36,_0x8974f[_0x0065('0xe')]['message']);return _0x3fe697(_0x8974f[_0x0065('0xe')][_0x0065('0x10')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x20dd36,_0x8974f[_0x0065('0xe')]['message']);return _0xefa3cb(_0x8974f['error'][_0x0065('0x10')]);}else{logger['info'](_0x0065('0xb'),_0x20dd36,'request\x20sent');_0xefa3cb(_0x8974f[_0x0065('0x11')][_0x0065('0x10')]);}})[_0x0065('0x12')](function(_0x2b5df9){logger[_0x0065('0xe')](_0x0065('0xb'),_0x20dd36,_0x2b5df9);_0x3fe697(_0x2b5df9);});});}exports[_0x0065('0x13')]=function(_0x393d6e){var _0x595816=this;return new Promise(function(_0x18bfa1,_0x3f3b56){return db['MemberReport'][_0x0065('0x14')]({'raw':_0x393d6e[_0x0065('0x15')]?_0x393d6e[_0x0065('0x15')][_0x0065('0x16')]===undefined?!![]:![]:!![],'where':_0x393d6e[_0x0065('0x15')]?_0x393d6e[_0x0065('0x15')][_0x0065('0x17')]||null:null,'attributes':_0x393d6e['options']?_0x393d6e['options']['attributes']||null:null,'limit':_0x393d6e[_0x0065('0x15')]?_0x393d6e[_0x0065('0x15')]['limit']||null:null,'include':_0x393d6e[_0x0065('0x15')]?_0x393d6e['options'][_0x0065('0x18')]?_[_0x0065('0x19')](_0x393d6e[_0x0065('0x15')][_0x0065('0x18')],function(_0x161b4c){return{'model':db[_0x161b4c[_0x0065('0x1a')]],'as':_0x161b4c['as'],'attributes':_0x161b4c[_0x0065('0x1b')],'include':_0x161b4c['include']?_[_0x0065('0x19')](_0x161b4c['include'],function(_0x4b4a4e){return{'model':db[_0x4b4a4e[_0x0065('0x1a')]],'as':_0x4b4a4e['as'],'attributes':_0x4b4a4e['attributes'],'include':_0x4b4a4e[_0x0065('0x18')]?_[_0x0065('0x19')](_0x4b4a4e['include'],function(_0x123604){return{'model':db[_0x123604['model']],'as':_0x123604['as'],'attributes':_0x123604['attributes']};}):[]};}):[]};}):[]:[]})[_0x0065('0x9')](function(_0x221be2){logger['info']('GetMemberReport',_0x393d6e);logger['debug'](_0x0065('0x13'),_0x393d6e,JSON[_0x0065('0x1c')](_0x221be2));_0x18bfa1(_0x221be2);})[_0x0065('0x12')](function(_0x1f8813){logger[_0x0065('0xe')]('GetMemberReport',_0x1f8813['message'],_0x393d6e);_0x3f3b56(_0x595816['error'](0x1f4,_0x1f8813[_0x0065('0x10')]));});});};exports[_0x0065('0x1d')]=function(_0x171af7){var _0x5746da=this;return new Promise(function(_0x3572f4,_0x14c876){return db['MemberReport'][_0x0065('0x1e')](_0x171af7[_0x0065('0x1f')],{'raw':_0x171af7[_0x0065('0x15')]?_0x171af7[_0x0065('0x15')][_0x0065('0x16')]===undefined?!![]:![]:!![]})[_0x0065('0x9')](function(_0x15bfb8){logger[_0x0065('0xa')]('CreateMemberReport',_0x171af7);logger['debug']('CreateMemberReport',_0x171af7,JSON[_0x0065('0x1c')](_0x15bfb8));_0x3572f4(_0x15bfb8);})[_0x0065('0x12')](function(_0x2e15dd){logger[_0x0065('0xe')](_0x0065('0x1d'),_0x2e15dd[_0x0065('0x10')],_0x171af7);_0x14c876(_0x5746da[_0x0065('0xe')](0x1f4,_0x2e15dd['message']));});});};exports[_0x0065('0x20')]=function(_0xcbc2ba){var _0xdaed75=this;return new Promise(function(_0x3fbbad,_0x4d2cd5){return db['MemberReport'][_0x0065('0x21')](_0xcbc2ba[_0x0065('0x1f')],{'raw':_0xcbc2ba[_0x0065('0x15')]?_0xcbc2ba[_0x0065('0x15')][_0x0065('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcbc2ba[_0x0065('0x15')]?_0xcbc2ba[_0x0065('0x15')][_0x0065('0x17')]||null:null,'attributes':_0xcbc2ba[_0x0065('0x15')]?_0xcbc2ba[_0x0065('0x15')]['attributes']||null:null,'limit':_0xcbc2ba[_0x0065('0x15')]?_0xcbc2ba[_0x0065('0x15')][_0x0065('0x22')]||null:null})['then'](function(_0x226a45){logger[_0x0065('0xa')](_0x0065('0x20'),_0xcbc2ba);logger[_0x0065('0xc')](_0x0065('0x20'),_0xcbc2ba,JSON[_0x0065('0x1c')](_0x226a45));_0x3fbbad(_0x226a45);})['catch'](function(_0x32e6f){logger[_0x0065('0xe')](_0x0065('0x20'),_0x32e6f['message'],_0xcbc2ba);_0x4d2cd5(_0xdaed75[_0x0065('0xe')](0x1f4,_0x32e6f['message']));});});}; \ No newline at end of file +var _0x21b7=['GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','debug','CreateMemberReport','create','body','UpdateMemberReport','update','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x21b7,0xef));var _0x721b=function(_0x22fb7d,_0x598ff0){_0x22fb7d=_0x22fb7d-0x0;var _0x426e34=_0x21b7[_0x22fb7d];return _0x426e34;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x721b('0x0'));var rs=require(_0x721b('0x1'));var fs=require('fs');var Redis=require(_0x721b('0x2'));var db=require(_0x721b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x721b('0x4'));var config=require(_0x721b('0x5'));var jayson=require(_0x721b('0x6'));var client=jayson[_0x721b('0x7')][_0x721b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x470ee0,_0x5aeb49,_0x45ca24){return new BPromise(function(_0x2c4096,_0x47b1ff){return client['request'](_0x470ee0,_0x45ca24)[_0x721b('0x9')](function(_0x1bfe2d){logger[_0x721b('0xa')](_0x721b('0xb'),_0x5aeb49,_0x721b('0xc'));logger['debug'](_0x721b('0xd'),_0x5aeb49,_0x721b('0xc'),JSON[_0x721b('0xe')](_0x1bfe2d));if(_0x1bfe2d[_0x721b('0xf')]){if(_0x1bfe2d[_0x721b('0xf')][_0x721b('0x10')]===0x1f4){logger[_0x721b('0xf')]('MemberReport,\x20%s,\x20%s',_0x5aeb49,_0x1bfe2d['error'][_0x721b('0x11')]);return _0x47b1ff(_0x1bfe2d['error'][_0x721b('0x11')]);}logger[_0x721b('0xf')]('MemberReport,\x20%s,\x20%s',_0x5aeb49,_0x1bfe2d['error'][_0x721b('0x11')]);return _0x2c4096(_0x1bfe2d[_0x721b('0xf')][_0x721b('0x11')]);}else{logger[_0x721b('0xa')](_0x721b('0xb'),_0x5aeb49,_0x721b('0xc'));_0x2c4096(_0x1bfe2d[_0x721b('0x12')][_0x721b('0x11')]);}})[_0x721b('0x13')](function(_0x3e6214){logger[_0x721b('0xf')](_0x721b('0xb'),_0x5aeb49,_0x3e6214);_0x47b1ff(_0x3e6214);});});}exports[_0x721b('0x14')]=function(_0x3f76af){var _0x4e2d24=this;return new Promise(function(_0x81745a,_0x1eca0d){return db[_0x721b('0x15')][_0x721b('0x16')]({'raw':_0x3f76af[_0x721b('0x17')]?_0x3f76af[_0x721b('0x17')][_0x721b('0x18')]===undefined?!![]:![]:!![],'where':_0x3f76af['options']?_0x3f76af[_0x721b('0x17')][_0x721b('0x19')]||null:null,'attributes':_0x3f76af[_0x721b('0x17')]?_0x3f76af[_0x721b('0x17')][_0x721b('0x1a')]||null:null,'limit':_0x3f76af[_0x721b('0x17')]?_0x3f76af[_0x721b('0x17')][_0x721b('0x1b')]||null:null,'include':_0x3f76af[_0x721b('0x17')]?_0x3f76af[_0x721b('0x17')]['include']?_[_0x721b('0x1c')](_0x3f76af[_0x721b('0x17')][_0x721b('0x1d')],function(_0x4e7d37){return{'model':db[_0x4e7d37['model']],'as':_0x4e7d37['as'],'attributes':_0x4e7d37[_0x721b('0x1a')],'include':_0x4e7d37[_0x721b('0x1d')]?_[_0x721b('0x1c')](_0x4e7d37[_0x721b('0x1d')],function(_0x20da5f){return{'model':db[_0x20da5f[_0x721b('0x1e')]],'as':_0x20da5f['as'],'attributes':_0x20da5f['attributes'],'include':_0x20da5f[_0x721b('0x1d')]?_[_0x721b('0x1c')](_0x20da5f['include'],function(_0x1fb2fc){return{'model':db[_0x1fb2fc[_0x721b('0x1e')]],'as':_0x1fb2fc['as'],'attributes':_0x1fb2fc[_0x721b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b1610){logger['info'](_0x721b('0x14'),_0x3f76af);logger[_0x721b('0x1f')](_0x721b('0x14'),_0x3f76af,JSON['stringify'](_0x3b1610));_0x81745a(_0x3b1610);})[_0x721b('0x13')](function(_0x383077){logger[_0x721b('0xf')]('GetMemberReport',_0x383077[_0x721b('0x11')],_0x3f76af);_0x1eca0d(_0x4e2d24['error'](0x1f4,_0x383077[_0x721b('0x11')]));});});};exports[_0x721b('0x20')]=function(_0x5c7c71){var _0x7451ad=this;return new Promise(function(_0x39cb7c,_0x1d9e1f){return db['MemberReport'][_0x721b('0x21')](_0x5c7c71[_0x721b('0x22')],{'raw':_0x5c7c71[_0x721b('0x17')]?_0x5c7c71['options'][_0x721b('0x18')]===undefined?!![]:![]:!![]})[_0x721b('0x9')](function(_0x24e37a){logger[_0x721b('0xa')]('CreateMemberReport',_0x5c7c71);logger[_0x721b('0x1f')](_0x721b('0x20'),_0x5c7c71,JSON[_0x721b('0xe')](_0x24e37a));_0x39cb7c(_0x24e37a);})[_0x721b('0x13')](function(_0x17b2a1){logger[_0x721b('0xf')](_0x721b('0x20'),_0x17b2a1[_0x721b('0x11')],_0x5c7c71);_0x1d9e1f(_0x7451ad[_0x721b('0xf')](0x1f4,_0x17b2a1[_0x721b('0x11')]));});});};exports[_0x721b('0x23')]=function(_0x22f129){var _0x1e44fc=this;return new Promise(function(_0x3c696a,_0x3a3b55){return db[_0x721b('0x15')][_0x721b('0x24')](_0x22f129[_0x721b('0x22')],{'raw':_0x22f129[_0x721b('0x17')]?_0x22f129[_0x721b('0x17')][_0x721b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22f129[_0x721b('0x17')]?_0x22f129['options'][_0x721b('0x19')]||null:null,'attributes':_0x22f129[_0x721b('0x17')]?_0x22f129[_0x721b('0x17')][_0x721b('0x1a')]||null:null,'limit':_0x22f129[_0x721b('0x17')]?_0x22f129[_0x721b('0x17')][_0x721b('0x1b')]||null:null})[_0x721b('0x9')](function(_0x14ff20){logger[_0x721b('0xa')](_0x721b('0x23'),_0x22f129);logger[_0x721b('0x1f')](_0x721b('0x23'),_0x22f129,JSON[_0x721b('0xe')](_0x14ff20));_0x3c696a(_0x14ff20);})[_0x721b('0x13')](function(_0x39fb56){logger[_0x721b('0xf')](_0x721b('0x23'),_0x39fb56[_0x721b('0x11')],_0x22f129);_0x3a3b55(_0x1e44fc['error'](0x1f4,_0x39fb56['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index a66661e..e9b5761 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 _0xb024=['express','Router','../../components/auth/service','../../config/environment','get','exports','util','path','connect-timeout'];(function(_0x31a60b,_0x85ed80){var _0x5bae05=function(_0x6cbe54){while(--_0x6cbe54){_0x31a60b['push'](_0x31a60b['shift']());}};_0x5bae05(++_0x85ed80);}(_0xb024,0x1ad));var _0x4b02=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb024[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require(_0x4b02('0x0'));var path=require(_0x4b02('0x1'));var timeout=require(_0x4b02('0x2'));var express=require(_0x4b02('0x3'));var router=express[_0x4b02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4b02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b02('0x6'));var controller=require('./migration.controller');router[_0x4b02('0x7')]('/',controller['index']);module[_0x4b02('0x8')]=router; \ No newline at end of file +var _0x15ff=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','multer','util','connect-timeout','Router'];(function(_0x363319,_0x4fa1a1){var _0x182a62=function(_0x78f65b){while(--_0x78f65b){_0x363319['push'](_0x363319['shift']());}};_0x182a62(++_0x4fa1a1);}(_0x15ff,0x74));var _0xf15f=function(_0x244a2c,_0x5eb691){_0x244a2c=_0x244a2c-0x0;var _0x1bb2db=_0x15ff[_0x244a2c];return _0x1bb2db;};'use strict';var multer=require(_0xf15f('0x0'));var util=require(_0xf15f('0x1'));var path=require('path');var timeout=require(_0xf15f('0x2'));var express=require('express');var router=express[_0xf15f('0x3')]();var fs_extra=require(_0xf15f('0x4'));var auth=require(_0xf15f('0x5'));var interaction=require(_0xf15f('0x6'));var config=require(_0xf15f('0x7'));var controller=require(_0xf15f('0x8'));router['get']('/',controller[_0xf15f('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 1e76141..4b764a2 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 _0x23b1=['sequelize','exports','STRING','version'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x23b1,0x180));var _0x123b=function(_0x342743,_0x3c9a0e){_0x342743=_0x342743-0x0;var _0x28b32a=_0x23b1[_0x342743];return _0x28b32a;};'use strict';var Sequelize=require(_0x123b('0x0'));module[_0x123b('0x1')]={'version':{'type':Sequelize[_0x123b('0x2')],'unique':_0x123b('0x3')}}; \ No newline at end of file +var _0x6f7e=['exports','STRING','sequelize'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6f7e,0x7a));var _0xe6f7=function(_0x5d82e6,_0x7bbef7){_0x5d82e6=_0x5d82e6-0x0;var _0x464c67=_0x6f7e[_0x5d82e6];return _0x464c67;};'use strict';var Sequelize=require(_0xe6f7('0x0'));module[_0xe6f7('0x1')]={'version':{'type':Sequelize[_0xe6f7('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index d3ac0d6..38ec583 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 _0x393a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','eml-format'];(function(_0x28af3c,_0x2d6abf){var _0x2fcdc8=function(_0x31c640){while(--_0x31c640){_0x28af3c['push'](_0x28af3c['shift']());}};_0x2fcdc8(++_0x2d6abf);}(_0x393a,0x89));var _0xa393=function(_0x567ea1,_0x3cb026){_0x567ea1=_0x567ea1-0x0;var _0x20964d=_0x393a[_0x567ea1];return _0x20964d;};'use strict';var emlformat=require(_0xa393('0x0'));var rimraf=require(_0xa393('0x1'));var zipdir=require(_0xa393('0x2'));var jsonpatch=require(_0xa393('0x3'));var rp=require('request-promise');var moment=require(_0xa393('0x4'));var BPromise=require(_0xa393('0x5'));var Mustache=require(_0xa393('0x6'));var util=require(_0xa393('0x7'));var path=require(_0xa393('0x8'));var sox=require(_0xa393('0x9'));var csv=require(_0xa393('0xa'));var ejs=require(_0xa393('0xb'));var fs=require('fs');var fs_extra=require(_0xa393('0xc'));var _=require('lodash');var squel=require(_0xa393('0xd'));var crypto=require(_0xa393('0xe'));var jsforce=require(_0xa393('0xf'));var deskjs=require(_0xa393('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa393('0x11'));var Papa=require('papaparse');var Redis=require(_0xa393('0x12'));var authService=require(_0xa393('0x13'));var qs=require(_0xa393('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa393('0x15'));var logger=require(_0xa393('0x16'))('api');var utils=require(_0xa393('0x17'));var config=require(_0xa393('0x18'));var licenseUtil=require(_0xa393('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x292ae,_0x1311cc){_0x1311cc=_0x1311cc||0xcc;return function(_0x5844f2){if(_0x5844f2){return _0x292ae['sendStatus'](_0x1311cc);}return _0x292ae[_0xa393('0x1a')](_0x1311cc)[_0xa393('0x1b')]();};}function respondWithResult(_0x43f6e0,_0x5a697a){_0x5a697a=_0x5a697a||0xc8;return function(_0x3567eb){if(_0x3567eb){return _0x43f6e0[_0xa393('0x1a')](_0x5a697a)['json'](_0x3567eb);}};}function respondWithFilteredResult(_0x353ff2,_0x53ba0e){return function(_0x1e8b9b){if(_0x1e8b9b){var _0x2e1f9f=typeof _0x53ba0e[_0xa393('0x1c')]==='undefined'&&typeof _0x53ba0e[_0xa393('0x1d')]===_0xa393('0x1e');var _0x25bedd=_0x1e8b9b['count'];var _0x44aa29=_0x2e1f9f?0x0:_0x53ba0e['offset'];var _0x101512=_0x2e1f9f?_0x1e8b9b['count']:_0x53ba0e[_0xa393('0x1c')]+_0x53ba0e[_0xa393('0x1d')];var _0x14c325;if(_0x101512>=_0x25bedd){_0x101512=_0x25bedd;_0x14c325=0xc8;}else{_0x14c325=0xce;}_0x353ff2[_0xa393('0x1a')](_0x14c325);return _0x353ff2['set'](_0xa393('0x1f'),_0x44aa29+'-'+_0x101512+'/'+_0x25bedd)[_0xa393('0x20')](_0x1e8b9b);}return null;};}function patchUpdates(_0x3cc66a){return function(_0x20a6fb){try{jsonpatch[_0xa393('0x21')](_0x20a6fb,_0x3cc66a,!![]);}catch(_0x5485ac){return BPromise[_0xa393('0x22')](_0x5485ac);}return _0x20a6fb[_0xa393('0x23')]();};}function saveUpdates(_0xb999d0,_0x23df1b){return function(_0x3f51d6){if(_0x3f51d6){return _0x3f51d6[_0xa393('0x24')](_0xb999d0)[_0xa393('0x25')](function(_0x301d9b){return _0x301d9b;});}return null;};}function removeEntity(_0x138574,_0x50ce20){return function(_0x5da987){if(_0x5da987){return _0x5da987[_0xa393('0x26')]()[_0xa393('0x25')](function(){_0x138574['status'](0xcc)[_0xa393('0x1b')]();});}};}function handleEntityNotFound(_0x229651,_0x1a5d16){return function(_0x11db51){if(!_0x11db51){_0x229651['sendStatus'](0x194);}return _0x11db51;};}function handleError(_0x2245e4,_0x14d25b){_0x14d25b=_0x14d25b||0x1f4;return function(_0x2d4219){logger[_0xa393('0x27')](_0x2d4219[_0xa393('0x28')]);if(_0x2d4219[_0xa393('0x29')]){delete _0x2d4219[_0xa393('0x29')];}_0x2245e4['status'](_0x14d25b)[_0xa393('0x2a')](_0x2d4219);};}exports['index']=function(_0x6ea780,_0x45bc2b){var _0x313268={},_0x5b70a2={},_0x1a2108={'count':0x0,'rows':[]};var _0x54af4e=_[_0xa393('0x2b')](db[_0xa393('0x2c')][_0xa393('0x2d')],function(_0x274d13){return{'name':_0x274d13[_0xa393('0x2e')],'type':_0x274d13[_0xa393('0x2f')][_0xa393('0x30')]};});_0x5b70a2[_0xa393('0x31')]=_[_0xa393('0x2b')](_0x54af4e,'name');_0x5b70a2[_0xa393('0x32')]=_['keys'](_0x6ea780[_0xa393('0x32')]);_0x5b70a2['filters']=_[_0xa393('0x33')](_0x5b70a2['model'],_0x5b70a2[_0xa393('0x32')]);_0x313268['attributes']=_[_0xa393('0x33')](_0x5b70a2[_0xa393('0x31')],qs[_0xa393('0x34')](_0x6ea780[_0xa393('0x32')][_0xa393('0x34')]));_0x313268['attributes']=_0x313268[_0xa393('0x35')][_0xa393('0x36')]?_0x313268[_0xa393('0x35')]:_0x5b70a2[_0xa393('0x31')];if(!_0x6ea780[_0xa393('0x32')][_0xa393('0x37')](_0xa393('0x38'))){_0x313268[_0xa393('0x1d')]=qs[_0xa393('0x1d')](_0x6ea780[_0xa393('0x32')][_0xa393('0x1d')]);_0x313268[_0xa393('0x1c')]=qs[_0xa393('0x1c')](_0x6ea780[_0xa393('0x32')]['offset']);}_0x313268[_0xa393('0x39')]=qs['sort'](_0x6ea780[_0xa393('0x32')][_0xa393('0x3a')]);_0x313268[_0xa393('0x3b')]=qs[_0xa393('0x3c')](_[_0xa393('0x3d')](_0x6ea780[_0xa393('0x32')],_0x5b70a2[_0xa393('0x3c')]),_0x54af4e);if(_0x6ea780[_0xa393('0x32')][_0xa393('0x3e')]){_0x313268[_0xa393('0x3b')]=_[_0xa393('0x3f')](_0x313268[_0xa393('0x3b')],{'$or':_[_0xa393('0x2b')](_0x54af4e,function(_0x2e18ad){if(_0x2e18ad[_0xa393('0x2f')]!=='VIRTUAL'){var _0xb98078={};_0xb98078[_0x2e18ad[_0xa393('0x29')]]={'$like':'%'+_0x6ea780[_0xa393('0x32')][_0xa393('0x3e')]+'%'};return _0xb98078;}})});}_0x313268=_[_0xa393('0x3f')]({},_0x313268,_0x6ea780[_0xa393('0x40')]);var _0x19d60a={'where':_0x313268[_0xa393('0x3b')]};return db[_0xa393('0x2c')][_0xa393('0x41')](_0x19d60a)[_0xa393('0x25')](function(_0x32bfd7){_0x1a2108[_0xa393('0x41')]=_0x32bfd7;if(_0x6ea780[_0xa393('0x32')][_0xa393('0x42')]){_0x313268['include']=[{'all':!![]}];}return db[_0xa393('0x2c')][_0xa393('0x43')](_0x313268);})[_0xa393('0x25')](function(_0x27eda3){_0x1a2108[_0xa393('0x44')]=_0x27eda3;return _0x1a2108;})[_0xa393('0x25')](respondWithFilteredResult(_0x45bc2b,_0x313268))['catch'](handleError(_0x45bc2b,null));}; \ No newline at end of file +var _0x446e=['keys','attributes','intersection','fields','length','order','sort','where','filters','pick','type','filter','options','include','findAll','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','name','index','Migration','fieldName','key','model','map','query'];(function(_0x2bfb43,_0x27592c){var _0x1f49fb=function(_0x1ceb1f){while(--_0x1ceb1f){_0x2bfb43['push'](_0x2bfb43['shift']());}};_0x1f49fb(++_0x27592c);}(_0x446e,0x1f0));var _0xe446=function(_0x58eb9a,_0x1ac70c){_0x58eb9a=_0x58eb9a-0x0;var _0x2508ea=_0x446e[_0x58eb9a];return _0x2508ea;};'use strict';var emlformat=require(_0xe446('0x0'));var rimraf=require(_0xe446('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe446('0x2'));var rp=require(_0xe446('0x3'));var moment=require(_0xe446('0x4'));var BPromise=require(_0xe446('0x5'));var Mustache=require(_0xe446('0x6'));var util=require(_0xe446('0x7'));var path=require(_0xe446('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe446('0x9'));var _=require('lodash');var squel=require(_0xe446('0xa'));var crypto=require(_0xe446('0xb'));var jsforce=require(_0xe446('0xc'));var deskjs=require(_0xe446('0xd'));var toCsv=require(_0xe446('0xe'));var querystring=require('querystring');var Papa=require(_0xe446('0xf'));var Redis=require('ioredis');var authService=require(_0xe446('0x10'));var qs=require(_0xe446('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe446('0x12'));var logger=require('../../config/logger')(_0xe446('0x13'));var utils=require(_0xe446('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe446('0x15'))['db'];function respondWithStatusCode(_0x4d6644,_0x3b5ca4){_0x3b5ca4=_0x3b5ca4||0xcc;return function(_0x57e18e){if(_0x57e18e){return _0x4d6644[_0xe446('0x16')](_0x3b5ca4);}return _0x4d6644[_0xe446('0x17')](_0x3b5ca4)[_0xe446('0x18')]();};}function respondWithResult(_0xd92d2c,_0x12bd3c){_0x12bd3c=_0x12bd3c||0xc8;return function(_0x510a06){if(_0x510a06){return _0xd92d2c[_0xe446('0x17')](_0x12bd3c)[_0xe446('0x19')](_0x510a06);}};}function respondWithFilteredResult(_0x478ff4,_0x380a08){return function(_0x4a0349){if(_0x4a0349){var _0x336049=typeof _0x380a08[_0xe446('0x1a')]===_0xe446('0x1b')&&typeof _0x380a08[_0xe446('0x1c')]===_0xe446('0x1b');var _0xcdffaa=_0x4a0349['count'];var _0x448ede=_0x336049?0x0:_0x380a08['offset'];var _0x1c41c4=_0x336049?_0x4a0349[_0xe446('0x1d')]:_0x380a08[_0xe446('0x1a')]+_0x380a08[_0xe446('0x1c')];var _0x6abc6d;if(_0x1c41c4>=_0xcdffaa){_0x1c41c4=_0xcdffaa;_0x6abc6d=0xc8;}else{_0x6abc6d=0xce;}_0x478ff4[_0xe446('0x17')](_0x6abc6d);return _0x478ff4['set'](_0xe446('0x1e'),_0x448ede+'-'+_0x1c41c4+'/'+_0xcdffaa)[_0xe446('0x19')](_0x4a0349);}return null;};}function patchUpdates(_0x781181){return function(_0x1e3d29){try{jsonpatch[_0xe446('0x1f')](_0x1e3d29,_0x781181,!![]);}catch(_0x5dda9b){return BPromise['reject'](_0x5dda9b);}return _0x1e3d29[_0xe446('0x20')]();};}function saveUpdates(_0x4879bc,_0x503cca){return function(_0x466a44){if(_0x466a44){return _0x466a44['update'](_0x4879bc)[_0xe446('0x21')](function(_0x13cb39){return _0x13cb39;});}return null;};}function removeEntity(_0x29a2e2,_0x31f0f4){return function(_0xf7d8c3){if(_0xf7d8c3){return _0xf7d8c3[_0xe446('0x22')]()[_0xe446('0x21')](function(){_0x29a2e2[_0xe446('0x17')](0xcc)[_0xe446('0x18')]();});}};}function handleEntityNotFound(_0x35511d,_0xeba72b){return function(_0x1342a6){if(!_0x1342a6){_0x35511d[_0xe446('0x16')](0x194);}return _0x1342a6;};}function handleError(_0xe8b2cc,_0x43cd84){_0x43cd84=_0x43cd84||0x1f4;return function(_0x142dfe){logger[_0xe446('0x23')](_0x142dfe['stack']);if(_0x142dfe[_0xe446('0x24')]){delete _0x142dfe[_0xe446('0x24')];}_0xe8b2cc['status'](_0x43cd84)['send'](_0x142dfe);};}exports[_0xe446('0x25')]=function(_0x35517e,_0x3b6795){var _0x577044={},_0x457787={},_0x3ea442={'count':0x0,'rows':[]};var _0x4df08f=_['map'](db[_0xe446('0x26')]['rawAttributes'],function(_0xb1bbfc){return{'name':_0xb1bbfc[_0xe446('0x27')],'type':_0xb1bbfc['type'][_0xe446('0x28')]};});_0x457787[_0xe446('0x29')]=_[_0xe446('0x2a')](_0x4df08f,_0xe446('0x24'));_0x457787[_0xe446('0x2b')]=_[_0xe446('0x2c')](_0x35517e['query']);_0x457787['filters']=_['intersection'](_0x457787[_0xe446('0x29')],_0x457787[_0xe446('0x2b')]);_0x577044[_0xe446('0x2d')]=_[_0xe446('0x2e')](_0x457787[_0xe446('0x29')],qs[_0xe446('0x2f')](_0x35517e[_0xe446('0x2b')][_0xe446('0x2f')]));_0x577044[_0xe446('0x2d')]=_0x577044[_0xe446('0x2d')][_0xe446('0x30')]?_0x577044[_0xe446('0x2d')]:_0x457787[_0xe446('0x29')];if(!_0x35517e[_0xe446('0x2b')]['hasOwnProperty']('nolimit')){_0x577044[_0xe446('0x1c')]=qs[_0xe446('0x1c')](_0x35517e['query'][_0xe446('0x1c')]);_0x577044[_0xe446('0x1a')]=qs[_0xe446('0x1a')](_0x35517e[_0xe446('0x2b')][_0xe446('0x1a')]);}_0x577044[_0xe446('0x31')]=qs[_0xe446('0x32')](_0x35517e[_0xe446('0x2b')][_0xe446('0x32')]);_0x577044[_0xe446('0x33')]=qs[_0xe446('0x34')](_[_0xe446('0x35')](_0x35517e[_0xe446('0x2b')],_0x457787[_0xe446('0x34')]),_0x4df08f);if(_0x35517e[_0xe446('0x2b')]['filter']){_0x577044[_0xe446('0x33')]=_['merge'](_0x577044[_0xe446('0x33')],{'$or':_[_0xe446('0x2a')](_0x4df08f,function(_0x4038f8){if(_0x4038f8[_0xe446('0x36')]!=='VIRTUAL'){var _0x27406d={};_0x27406d[_0x4038f8['name']]={'$like':'%'+_0x35517e['query'][_0xe446('0x37')]+'%'};return _0x27406d;}})});}_0x577044=_['merge']({},_0x577044,_0x35517e[_0xe446('0x38')]);var _0x19402f={'where':_0x577044[_0xe446('0x33')]};return db[_0xe446('0x26')][_0xe446('0x1d')](_0x19402f)[_0xe446('0x21')](function(_0x14e4e5){_0x3ea442[_0xe446('0x1d')]=_0x14e4e5;if(_0x35517e[_0xe446('0x2b')]['includeAll']){_0x577044[_0xe446('0x39')]=[{'all':!![]}];}return db[_0xe446('0x26')][_0xe446('0x3a')](_0x577044);})[_0xe446('0x21')](function(_0x7d77a){_0x3ea442[_0xe446('0x3b')]=_0x7d77a;return _0x3ea442;})[_0xe446('0x21')](respondWithFilteredResult(_0x3b6795,_0x577044))['catch'](handleError(_0x3b6795,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 579644c..77faaab 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 _0x72fe=['exports','define','Migration','migrations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes'];(function(_0x5759f3,_0x4bd3cf){var _0x90e730=function(_0xc575eb){while(--_0xc575eb){_0x5759f3['push'](_0x5759f3['shift']());}};_0x90e730(++_0x4bd3cf);}(_0x72fe,0x94));var _0xe72f=function(_0x46cdd0,_0x43596a){_0x46cdd0=_0x46cdd0-0x0;var _0x40266d=_0x72fe[_0x46cdd0];return _0x40266d;};'use strict';var _=require(_0xe72f('0x0'));var util=require('util');var logger=require(_0xe72f('0x1'))('api');var moment=require(_0xe72f('0x2'));var BPromise=require(_0xe72f('0x3'));var rp=require(_0xe72f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe72f('0x5'));var config=require(_0xe72f('0x6'));var attributes=require(_0xe72f('0x7'));module[_0xe72f('0x8')]=function(_0x20ab0f,_0x2d9066){return _0x20ab0f[_0xe72f('0x9')](_0xe72f('0xa'),attributes,{'tableName':_0xe72f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd64=['Migration','migrations','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x3721cb,_0x9441b6){var _0xdaddc2=function(_0x2be210){while(--_0x2be210){_0x3721cb['push'](_0x3721cb['shift']());}};_0xdaddc2(++_0x9441b6);}(_0xcd64,0x136));var _0x4cd6=function(_0xcc43d6,_0x5d49f0){_0xcc43d6=_0xcc43d6-0x0;var _0x132e87=_0xcd64[_0xcc43d6];return _0x132e87;};'use strict';var _=require('lodash');var util=require(_0x4cd6('0x0'));var logger=require(_0x4cd6('0x1'))(_0x4cd6('0x2'));var moment=require('moment');var BPromise=require(_0x4cd6('0x3'));var rp=require(_0x4cd6('0x4'));var fs=require('fs');var path=require(_0x4cd6('0x5'));var rimraf=require('rimraf');var config=require(_0x4cd6('0x6'));var attributes=require('./migration.attributes');module[_0x4cd6('0x7')]=function(_0x19df22,_0x571f2b){return _0x19df22[_0x4cd6('0x8')](_0x4cd6('0x9'),attributes,{'tableName':_0x4cd6('0xa'),'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 7fabcce..4adbf23 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 _0x7cda=['rpc','../../config/environment','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x275017,_0x5504e0){var _0x20d46b=function(_0x2cb46c){while(--_0x2cb46c){_0x275017['push'](_0x275017['shift']());}};_0x20d46b(++_0x5504e0);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa7cd('0x0'));var moment=require(_0xa7cd('0x1'));var BPromise=require(_0xa7cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7cd('0x3'));var db=require(_0xa7cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7cd('0x5'))(_0xa7cd('0x6'));var config=require(_0xa7cd('0x7'));var jayson=require(_0xa7cd('0x8'));var client=jayson['client'][_0xa7cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c2b39,_0x596ad6,_0x6525a){return new BPromise(function(_0x4a9e39,_0x2554e8){return client[_0xa7cd('0xa')](_0x5c2b39,_0x6525a)[_0xa7cd('0xb')](function(_0x6d21d3){logger[_0xa7cd('0xc')](_0xa7cd('0xd'),_0x596ad6,_0xa7cd('0xe'));logger[_0xa7cd('0xf')](_0xa7cd('0x10'),_0x596ad6,'request\x20sent',JSON['stringify'](_0x6d21d3));if(_0x6d21d3[_0xa7cd('0x11')]){if(_0x6d21d3[_0xa7cd('0x11')]['code']===0x1f4){logger[_0xa7cd('0x11')](_0xa7cd('0xd'),_0x596ad6,_0x6d21d3['error'][_0xa7cd('0x12')]);return _0x2554e8(_0x6d21d3[_0xa7cd('0x11')][_0xa7cd('0x12')]);}logger['error'](_0xa7cd('0xd'),_0x596ad6,_0x6d21d3[_0xa7cd('0x11')][_0xa7cd('0x12')]);return _0x4a9e39(_0x6d21d3[_0xa7cd('0x11')][_0xa7cd('0x12')]);}else{logger[_0xa7cd('0xc')]('Migration,\x20%s,\x20%s',_0x596ad6,'request\x20sent');_0x4a9e39(_0x6d21d3[_0xa7cd('0x13')][_0xa7cd('0x12')]);}})[_0xa7cd('0x14')](function(_0x5dd129){logger[_0xa7cd('0x11')](_0xa7cd('0xd'),_0x596ad6,_0x5dd129);_0x2554e8(_0x5dd129);});});} \ No newline at end of file +var _0xa45c=['code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x358004,_0x26f5eb){var _0xea3c83=function(_0x3f2a3f){while(--_0x3f2a3f){_0x358004['push'](_0x358004['shift']());}};_0xea3c83(++_0x26f5eb);}(_0xa45c,0x6d));var _0xca45=function(_0x5a38d6,_0x4450a7){_0x5a38d6=_0x5a38d6-0x0;var _0x91bd43=_0xa45c[_0x5a38d6];return _0x91bd43;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca45('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xca45('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca45('0x5'));var client=jayson[_0xca45('0x6')][_0xca45('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15628b,_0x578a7b,_0x1a8b9c){return new BPromise(function(_0x276897,_0x7ceab1){return client[_0xca45('0x8')](_0x15628b,_0x1a8b9c)[_0xca45('0x9')](function(_0x5c18b9){logger[_0xca45('0xa')](_0xca45('0xb'),_0x578a7b,_0xca45('0xc'));logger[_0xca45('0xd')](_0xca45('0xe'),_0x578a7b,_0xca45('0xc'),JSON[_0xca45('0xf')](_0x5c18b9));if(_0x5c18b9['error']){if(_0x5c18b9[_0xca45('0x10')][_0xca45('0x11')]===0x1f4){logger[_0xca45('0x10')](_0xca45('0xb'),_0x578a7b,_0x5c18b9['error'][_0xca45('0x12')]);return _0x7ceab1(_0x5c18b9[_0xca45('0x10')][_0xca45('0x12')]);}logger['error'](_0xca45('0xb'),_0x578a7b,_0x5c18b9['error'][_0xca45('0x12')]);return _0x276897(_0x5c18b9[_0xca45('0x10')][_0xca45('0x12')]);}else{logger[_0xca45('0xa')](_0xca45('0xb'),_0x578a7b,_0xca45('0xc'));_0x276897(_0x5c18b9[_0xca45('0x13')]['message']);}})[_0xca45('0x14')](function(_0x5b4e29){logger['error'](_0xca45('0xb'),_0x578a7b,_0x5b4e29);_0x7ceab1(_0x5b4e29);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 365643b..07eaaa4 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 _0x3b90=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports'];(function(_0x1ebc6c,_0x58a00b){var _0x3a826d=function(_0x27d7eb){while(--_0x27d7eb){_0x1ebc6c['push'](_0x1ebc6c['shift']());}};_0x3a826d(++_0x58a00b);}(_0x3b90,0x143));var _0x03b9=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0x3b90[_0x38ff1e];return _0x3755d4;};'use strict';var multer=require('multer');var util=require(_0x03b9('0x0'));var path=require(_0x03b9('0x1'));var timeout=require(_0x03b9('0x2'));var express=require(_0x03b9('0x3'));var router=express[_0x03b9('0x4')]();var fs_extra=require(_0x03b9('0x5'));var auth=require(_0x03b9('0x6'));var interaction=require(_0x03b9('0x7'));var config=require('../../config/environment');var controller=require(_0x03b9('0x8'));router['get']('/',auth[_0x03b9('0x9')](),controller[_0x03b9('0xa')]);router[_0x03b9('0xb')](_0x03b9('0xc'),auth[_0x03b9('0x9')](),controller[_0x03b9('0xd')]);router[_0x03b9('0xe')]('/',auth[_0x03b9('0x9')](),controller['create']);router['put']('/:id',auth[_0x03b9('0x9')](),controller[_0x03b9('0xf')]);router[_0x03b9('0x10')](_0x03b9('0xc'),auth['isAuthenticated'](),controller[_0x03b9('0x11')]);module[_0x03b9('0x12')]=router; \ No newline at end of file +var _0xd481=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x202015,_0x1b94e2){var _0x124a84=function(_0x4b8ad8){while(--_0x4b8ad8){_0x202015['push'](_0x202015['shift']());}};_0x124a84(++_0x1b94e2);}(_0xd481,0x1e4));var _0x1d48=function(_0x2f62b7,_0x27465f){_0x2f62b7=_0x2f62b7-0x0;var _0x21086c=_0xd481[_0x2f62b7];return _0x21086c;};'use strict';var multer=require(_0x1d48('0x0'));var util=require('util');var path=require(_0x1d48('0x1'));var timeout=require(_0x1d48('0x2'));var express=require('express');var router=express[_0x1d48('0x3')]();var fs_extra=require(_0x1d48('0x4'));var auth=require(_0x1d48('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1d48('0x6'));var controller=require('./network.controller');router[_0x1d48('0x7')]('/',auth[_0x1d48('0x8')](),controller['index']);router[_0x1d48('0x7')](_0x1d48('0x9'),auth[_0x1d48('0x8')](),controller[_0x1d48('0xa')]);router[_0x1d48('0xb')]('/',auth[_0x1d48('0x8')](),controller[_0x1d48('0xc')]);router[_0x1d48('0xd')](_0x1d48('0x9'),auth[_0x1d48('0x8')](),controller[_0x1d48('0xe')]);router[_0x1d48('0xf')]('/:id',auth[_0x1d48('0x8')](),controller[_0x1d48('0x10')]);module[_0x1d48('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index f08e836..9db3102 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 _0xe173=['STRING','sequelize','exports','ENUM','localnet','externip','turn'];(function(_0x442b72,_0x1401e){var _0x13f180=function(_0x532730){while(--_0x532730){_0x442b72['push'](_0x442b72['shift']());}};_0x13f180(++_0x1401e);}(_0xe173,0x12e));var _0x3e17=function(_0x4e28ab,_0x1291aa){_0x4e28ab=_0x4e28ab-0x0;var _0x566692=_0xe173[_0x4e28ab];return _0x566692;};'use strict';var Sequelize=require(_0x3e17('0x0'));module[_0x3e17('0x1')]={'type':{'type':Sequelize[_0x3e17('0x2')](_0x3e17('0x3'),_0x3e17('0x4'),'stun',_0x3e17('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3e17('0x6')]},'password':{'type':Sequelize[_0x3e17('0x6')]}}; \ No newline at end of file +var _0xf93f=['exports','ENUM','localnet','stun','STRING'];(function(_0x3b1d1e,_0x10d8d9){var _0x5670b7=function(_0x2ed53a){while(--_0x2ed53a){_0x3b1d1e['push'](_0x3b1d1e['shift']());}};_0x5670b7(++_0x10d8d9);}(_0xf93f,0x1ea));var _0xff93=function(_0x42544b,_0xd0d2de){_0x42544b=_0x42544b-0x0;var _0x32e22c=_0xf93f[_0x42544b];return _0x32e22c;};'use strict';var Sequelize=require('sequelize');module[_0xff93('0x0')]={'type':{'type':Sequelize[_0xff93('0x1')](_0xff93('0x2'),'externip',_0xff93('0x3'),'turn')},'value':{'type':Sequelize[_0xff93('0x4')]},'username':{'type':Sequelize[_0xff93('0x4')]},'password':{'type':Sequelize[_0xff93('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 87d429f..2ff680a 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 _0xe944=['lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','status','send','map','Network','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','TURN','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','find','server/files/templates/turn_multiple.ejs','util','ejs'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe944,0x1bb));var _0x4e94=function(_0x1a0c45,_0x54df5f){_0x1a0c45=_0x1a0c45-0x0;var _0x538817=_0xe944[_0x1a0c45];return _0x538817;};'use strict';var util=require(_0x4e94('0x0'));var path=require('path');var ejs=require(_0x4e94('0x1'));var fs=require('fs');var _=require(_0x4e94('0x2'));var qs=require(_0x4e94('0x3'));var logger=require(_0x4e94('0x4'))(_0x4e94('0x5'));var config=require(_0x4e94('0x6'));var db=require(_0x4e94('0x7'))['db'];var jayson=require(_0x4e94('0x8'));var client=jayson[_0x4e94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc0f521,_0x3843a5,_0x1b9ca7,_0x421c89){return new Promise(function(_0x2ca1ee,_0x1335be){var _0x4b7ae5=_0x421c89||client;return _0x4b7ae5[_0x4e94('0xa')](_0xc0f521,_0x1b9ca7)['then'](function(_0x5485d0){logger[_0x4e94('0xb')](_0x4e94('0xc'),_0x3843a5,_0x4e94('0xd'));logger[_0x4e94('0xe')]('Network,\x20%s,\x20%s,\x20%s',_0x3843a5,'request\x20sent',JSON[_0x4e94('0xf')](_0x5485d0));if(_0x5485d0[_0x4e94('0x10')]){if(_0x5485d0[_0x4e94('0x10')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x3843a5,_0x5485d0['error'][_0x4e94('0x11')]);return _0x1335be(_0x5485d0[_0x4e94('0x10')][_0x4e94('0x11')]);}logger[_0x4e94('0x10')](_0x4e94('0xc'),_0x3843a5,_0x5485d0[_0x4e94('0x10')][_0x4e94('0x11')]);return _0x2ca1ee(_0x5485d0[_0x4e94('0x10')]['message']);}else{logger[_0x4e94('0xb')]('Network,\x20%s,\x20%s',_0x3843a5,_0x4e94('0xd'));_0x2ca1ee(_0x5485d0[_0x4e94('0x12')][_0x4e94('0x11')]);}})[_0x4e94('0x13')](function(_0x36da1c){logger[_0x4e94('0x10')](_0x4e94('0xc'),_0x3843a5,_0x36da1c);_0x1335be(_0x36da1c);});});}function respondWithResult(_0x5ba776,_0x21842e){_0x21842e=_0x21842e||0xc8;return function(_0x34167e){if(_0x34167e){return _0x5ba776['status'](_0x21842e)[_0x4e94('0x14')](_0x34167e);}};}function respondWithFilteredResult(_0x1ed6b4,_0x1fb1e0){return function(_0x4ac556){if(_0x4ac556){var _0x26f3d4=typeof _0x1fb1e0[_0x4e94('0x15')]===_0x4e94('0x16')&&typeof _0x1fb1e0[_0x4e94('0x17')]==='undefined';var _0x1792d1=_0x4ac556[_0x4e94('0x18')];var _0x4829ac=_0x26f3d4?0x0:_0x1fb1e0[_0x4e94('0x15')];var _0x520ba4=_0x26f3d4?_0x4ac556[_0x4e94('0x18')]:_0x1fb1e0[_0x4e94('0x15')]+_0x1fb1e0[_0x4e94('0x17')];var _0x4cc944;if(_0x520ba4>=_0x1792d1){_0x520ba4=_0x1792d1;_0x4cc944=0xc8;}else{_0x4cc944=0xce;}_0x1ed6b4['status'](_0x4cc944);return _0x1ed6b4[_0x4e94('0x19')](_0x4e94('0x1a'),_0x4829ac+'-'+_0x520ba4+'/'+_0x1792d1)['json'](_0x4ac556);}return null;};}function saveUpdates(_0x3f66eb){return function(_0x511785){if(_0x511785){return _0x511785[_0x4e94('0x1b')](_0x3f66eb)[_0x4e94('0x1c')](function(_0x363dd4){return _0x363dd4;});}return null;};}function removeEntity(_0x342a76){return function(_0x4ad1fd){if(_0x4ad1fd){return _0x4ad1fd[_0x4e94('0x1d')]()['then'](function(){_0x342a76['status'](0xcc)[_0x4e94('0x1e')]();});}};}function handleEntityNotFound(_0x4868e1){return function(_0x42d9e8){if(!_0x42d9e8){_0x4868e1[_0x4e94('0x1f')](0x194);}return _0x42d9e8;};}function handleError(_0x564fec,_0x1c36a8){_0x1c36a8=_0x1c36a8||0x1f4;return function(_0x2599c7){logger[_0x4e94('0x10')](_0x2599c7[_0x4e94('0x20')]);if(_0x2599c7[_0x4e94('0x21')]){delete _0x2599c7['name'];}_0x564fec[_0x4e94('0x22')](_0x1c36a8)[_0x4e94('0x23')](_0x2599c7);};}exports['index']=function(_0x15459c,_0xd9273e){var _0x4d4218={},_0x3cb508={},_0x1aacf8={'count':0x0,'rows':[]};var _0x929c6a=_[_0x4e94('0x24')](db[_0x4e94('0x25')][_0x4e94('0x26')],function(_0x80736d){return{'name':_0x80736d[_0x4e94('0x27')],'type':_0x80736d[_0x4e94('0x28')][_0x4e94('0x29')]};});_0x3cb508['model']=_[_0x4e94('0x24')](_0x929c6a,_0x4e94('0x21'));_0x3cb508[_0x4e94('0x2a')]=_[_0x4e94('0x2b')](_0x15459c[_0x4e94('0x2a')]);_0x3cb508[_0x4e94('0x2c')]=_[_0x4e94('0x2d')](_0x3cb508[_0x4e94('0x2e')],_0x3cb508['query']);_0x4d4218['attributes']=_[_0x4e94('0x2d')](_0x3cb508[_0x4e94('0x2e')],qs[_0x4e94('0x2f')](_0x15459c[_0x4e94('0x2a')][_0x4e94('0x2f')]));_0x4d4218['attributes']=_0x4d4218[_0x4e94('0x30')]['length']?_0x4d4218[_0x4e94('0x30')]:_0x3cb508['model'];if(!_0x15459c[_0x4e94('0x2a')][_0x4e94('0x31')](_0x4e94('0x32'))){_0x4d4218['limit']=qs['limit'](_0x15459c[_0x4e94('0x2a')][_0x4e94('0x17')]);_0x4d4218[_0x4e94('0x15')]=qs[_0x4e94('0x15')](_0x15459c[_0x4e94('0x2a')][_0x4e94('0x15')]);}_0x4d4218[_0x4e94('0x33')]=qs['sort'](_0x15459c[_0x4e94('0x2a')][_0x4e94('0x34')]);_0x4d4218[_0x4e94('0x35')]=qs[_0x4e94('0x2c')](_[_0x4e94('0x36')](_0x15459c[_0x4e94('0x2a')],_0x3cb508[_0x4e94('0x2c')]),_0x929c6a);if(_0x15459c[_0x4e94('0x2a')][_0x4e94('0x37')]){_0x4d4218['where']=_[_0x4e94('0x38')](_0x4d4218['where'],{'$or':_[_0x4e94('0x24')](_0x929c6a,function(_0x17b16c){if(_0x17b16c[_0x4e94('0x28')]!==_0x4e94('0x39')){var _0x53d989={};_0x53d989[_0x17b16c[_0x4e94('0x21')]]={'$like':'%'+_0x15459c['query'][_0x4e94('0x37')]+'%'};return _0x53d989;}})});}_0x4d4218=_[_0x4e94('0x38')]({},_0x4d4218,_0x15459c[_0x4e94('0x3a')]);var _0x212dca={'where':_0x4d4218[_0x4e94('0x35')]};return db[_0x4e94('0x25')][_0x4e94('0x18')](_0x212dca)[_0x4e94('0x1c')](function(_0x27c694){_0x1aacf8['count']=_0x27c694;if(_0x15459c[_0x4e94('0x2a')]['includeAll']){_0x4d4218[_0x4e94('0x3b')]=[{'all':!![]}];}return db[_0x4e94('0x25')][_0x4e94('0x3c')](_0x4d4218);})[_0x4e94('0x1c')](function(_0x2afb18){_0x1aacf8[_0x4e94('0x3d')]=_0x2afb18;return _0x1aacf8;})['then'](respondWithFilteredResult(_0xd9273e,_0x4d4218))[_0x4e94('0x13')](handleError(_0xd9273e,null));};exports[_0x4e94('0x3e')]=function(_0x4a0718,_0x5b8182){var _0x47767d={'raw':!![],'where':{'id':_0x4a0718[_0x4e94('0x3f')]['id']}},_0x45b12e={};_0x45b12e['model']=_[_0x4e94('0x2b')](db['Network'][_0x4e94('0x26')]);_0x45b12e[_0x4e94('0x2a')]=_[_0x4e94('0x2b')](_0x4a0718[_0x4e94('0x2a')]);_0x45b12e[_0x4e94('0x2c')]=_[_0x4e94('0x2d')](_0x45b12e[_0x4e94('0x2e')],_0x45b12e[_0x4e94('0x2a')]);_0x47767d[_0x4e94('0x30')]=_[_0x4e94('0x2d')](_0x45b12e[_0x4e94('0x2e')],qs[_0x4e94('0x2f')](_0x4a0718[_0x4e94('0x2a')][_0x4e94('0x2f')]));_0x47767d[_0x4e94('0x30')]=_0x47767d[_0x4e94('0x30')][_0x4e94('0x40')]?_0x47767d['attributes']:_0x45b12e[_0x4e94('0x2e')];if(_0x4a0718[_0x4e94('0x2a')][_0x4e94('0x41')]){_0x47767d[_0x4e94('0x3b')]=[{'all':!![]}];}_0x47767d=_[_0x4e94('0x38')]({},_0x47767d,_0x4a0718['options']);return db[_0x4e94('0x25')]['find'](_0x47767d)[_0x4e94('0x1c')](handleEntityNotFound(_0x5b8182,null))['then'](respondWithResult(_0x5b8182,null))[_0x4e94('0x13')](handleError(_0x5b8182,null));};exports[_0x4e94('0x42')]=function(_0x2e6ad4,_0xf6a3c1){var _0x2643c5;return db[_0x4e94('0x25')]['create'](_0x2e6ad4[_0x4e94('0x43')],{'raw':!![]})[_0x4e94('0x1c')](function(_0x5857a6){_0x2643c5=_0x5857a6;return db[_0x4e94('0x25')][_0x4e94('0x3c')]({'where':{'type':_0x2e6ad4[_0x4e94('0x43')][_0x4e94('0x28')]},'raw':!![]});})[_0x4e94('0x1c')](function(_0x3b22b8){if(_0x2643c5[_0x4e94('0x28')][_0x4e94('0x44')]()==_0x4e94('0x45')){var _0x5ef8c4=fs[_0x4e94('0x46')](path[_0x4e94('0x47')](config[_0x4e94('0x48')],_0x4e94('0x49')),_0x4e94('0x4a'));var _0x2b309f=ejs[_0x4e94('0x4b')](_0x5ef8c4,{'networks':_0x3b22b8||[]});fs['writeFileSync'](_0x4e94('0x4c'),_0x2b309f);return respondWithRpcPromise('Reload',_0x4e94('0x42'),{'module':'res_stun_monitor.so'});}else if(_0x2643c5[_0x4e94('0x28')][_0x4e94('0x44')]()==_0x4e94('0x4d')){var _0x2e311e=fs[_0x4e94('0x46')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x4e94('0x4a'));var _0x5c34ab=ejs['render'](_0x2e311e,{'networks':_0x3b22b8||[]});fs['writeFileSync'](_0x4e94('0x4e'),_0x5c34ab);return respondWithRpcPromise('Reload','create',{'module':_0x4e94('0x4f')});}else{var _0x2c008e=fs[_0x4e94('0x46')](path[_0x4e94('0x47')](config[_0x4e94('0x48')],_0x4e94('0x50')),'utf8');var _0x3a6397=ejs[_0x4e94('0x4b')](_0x2c008e,{'networks':_0x3b22b8||[]});fs[_0x4e94('0x51')](util[_0x4e94('0x52')](_0x4e94('0x53'),_0x2e6ad4[_0x4e94('0x43')][_0x4e94('0x28')][_0x4e94('0x54')]()),_0x3a6397);return respondWithRpcPromise(_0x4e94('0x55'),_0x4e94('0x42'),{'module':_0x4e94('0x56')});}})['then'](function(){return _0x2643c5;})[_0x4e94('0x1c')](respondWithResult(_0xf6a3c1,0xc9))[_0x4e94('0x13')](handleError(_0xf6a3c1,null));};exports['update']=function(_0x46cc42,_0x45eb84){var _0x3b2a0c;return db['Network'][_0x4e94('0x57')]({'where':{'id':_0x46cc42['params']['id']}})[_0x4e94('0x1c')](handleEntityNotFound(_0x45eb84,null))[_0x4e94('0x1c')](saveUpdates(_0x46cc42[_0x4e94('0x43')],null))[_0x4e94('0x1c')](function(_0x479af2){if(_0x479af2){_0x3b2a0c=_0x479af2;return db[_0x4e94('0x25')]['findAll']({'where':{'type':_0x3b2a0c[_0x4e94('0x28')]},'raw':!![]});}return null;})[_0x4e94('0x1c')](function(_0x307450){if(_0x3b2a0c['type'][_0x4e94('0x44')]()==_0x4e94('0x45')){var _0x481eb0=fs[_0x4e94('0x46')](path[_0x4e94('0x47')](config['root'],_0x4e94('0x49')),_0x4e94('0x4a'));var _0x2d227d=ejs[_0x4e94('0x4b')](_0x481eb0,{'networks':_0x307450||[]});fs[_0x4e94('0x51')](_0x4e94('0x4c'),_0x2d227d);return respondWithRpcPromise('Reload',_0x4e94('0x1b'),{'module':_0x4e94('0x4f')});}else if(_0x3b2a0c[_0x4e94('0x28')][_0x4e94('0x44')]()=='TURN'){var _0x561a6a=fs[_0x4e94('0x46')](path['join'](config[_0x4e94('0x48')],_0x4e94('0x58')),'utf8');var _0x1e2479=ejs[_0x4e94('0x4b')](_0x561a6a,{'networks':_0x307450||[]});fs[_0x4e94('0x51')](_0x4e94('0x4e'),_0x1e2479);return respondWithRpcPromise(_0x4e94('0x55'),'update',{'module':'res_stun_monitor.so'});}else{var _0x183240=fs[_0x4e94('0x46')](path[_0x4e94('0x47')](config['root'],_0x4e94('0x50')),_0x4e94('0x4a'));var _0xfdf0ee=ejs[_0x4e94('0x4b')](_0x183240,{'networks':_0x307450||[]});fs[_0x4e94('0x51')](util[_0x4e94('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0x46cc42[_0x4e94('0x43')][_0x4e94('0x28')][_0x4e94('0x54')]()),_0xfdf0ee);return respondWithRpcPromise(_0x4e94('0x55'),_0x4e94('0x1b'),{'module':_0x4e94('0x56')});}})[_0x4e94('0x1c')](function(_0x4c3185){if(_0x4c3185){return _0x3b2a0c;}return null;})[_0x4e94('0x1c')](respondWithResult(_0x45eb84,null))['catch'](handleError(_0x45eb84,null));};exports[_0x4e94('0x1d')]=function(_0x49c603,_0x38ceca){var _0x15ac28;return db[_0x4e94('0x25')][_0x4e94('0x57')]({'where':{'id':_0x49c603[_0x4e94('0x3f')]['id']}})[_0x4e94('0x1c')](function(_0xd67183){_0x15ac28=_0xd67183;return _0xd67183;})[_0x4e94('0x1c')](handleEntityNotFound(_0x38ceca,null))[_0x4e94('0x1c')](removeEntity(_0x38ceca,null))[_0x4e94('0x1c')](function(){if(_0x15ac28){return db[_0x4e94('0x25')][_0x4e94('0x3c')]({'where':{'type':_0x15ac28[_0x4e94('0x28')]},'raw':!![]});}})[_0x4e94('0x1c')](function(_0x51adc3){if(_0x15ac28[_0x4e94('0x28')][_0x4e94('0x44')]()=='STUN'){var _0x58ec28=fs[_0x4e94('0x46')](path[_0x4e94('0x47')](config[_0x4e94('0x48')],_0x4e94('0x49')),_0x4e94('0x4a'));var _0x318db2=ejs['render'](_0x58ec28,{'networks':_0x51adc3||[]});fs['writeFileSync'](_0x4e94('0x4c'),_0x318db2);return respondWithRpcPromise(_0x4e94('0x55'),_0x4e94('0x1d'),{'module':_0x4e94('0x4f')});}else if(_0x15ac28['type'][_0x4e94('0x44')]()==_0x4e94('0x4d')){var _0x3bf076=fs[_0x4e94('0x46')](path['join'](config['root'],_0x4e94('0x58')),_0x4e94('0x4a'));var _0x3a371c=ejs[_0x4e94('0x4b')](_0x3bf076,{'networks':_0x51adc3||[]});fs[_0x4e94('0x51')]('/etc/asterisk/turn_xcally.conf',_0x3a371c);return respondWithRpcPromise('Reload',_0x4e94('0x1d'),{'module':_0x4e94('0x4f')});}else{var _0x479e12=fs[_0x4e94('0x46')](path['join'](config['root'],_0x4e94('0x50')),_0x4e94('0x4a'));var _0x391d73=ejs[_0x4e94('0x4b')](_0x479e12,{'networks':_0x51adc3||[]});fs[_0x4e94('0x51')](util[_0x4e94('0x52')](_0x4e94('0x53'),_0x15ac28[_0x4e94('0x28')][_0x4e94('0x54')]()),_0x391d73);return respondWithRpcPromise(_0x4e94('0x55'),_0x4e94('0x1d'),{'module':'chan_sip.so'});}})[_0x4e94('0x13')](handleError(_0x38ceca,null));}; \ No newline at end of file +var _0xdeae=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','json','undefined','limit','count','offset','set','update','destroy','then','end','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0xdeae,0x1d3));var _0xedea=function(_0x43ab53,_0x4715e6){_0x43ab53=_0x43ab53-0x0;var _0x2bf9b1=_0xdeae[_0x43ab53];return _0x2bf9b1;};'use strict';var util=require(_0xedea('0x0'));var path=require(_0xedea('0x1'));var ejs=require(_0xedea('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0xedea('0x3'));var logger=require(_0xedea('0x4'))(_0xedea('0x5'));var config=require(_0xedea('0x6'));var db=require(_0xedea('0x7'))['db'];var jayson=require(_0xedea('0x8'));var client=jayson[_0xedea('0x9')][_0xedea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14edde,_0x552d24,_0x474697,_0x3d47af){return new Promise(function(_0xbd4b18,_0x14ea65){var _0x152f8d=_0x3d47af||client;return _0x152f8d[_0xedea('0xb')](_0x14edde,_0x474697)['then'](function(_0x5ed862){logger['info'](_0xedea('0xc'),_0x552d24,_0xedea('0xd'));logger[_0xedea('0xe')](_0xedea('0xf'),_0x552d24,_0xedea('0xd'),JSON['stringify'](_0x5ed862));if(_0x5ed862[_0xedea('0x10')]){if(_0x5ed862[_0xedea('0x10')][_0xedea('0x11')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x552d24,_0x5ed862[_0xedea('0x10')][_0xedea('0x12')]);return _0x14ea65(_0x5ed862['error']['message']);}logger[_0xedea('0x10')](_0xedea('0xc'),_0x552d24,_0x5ed862[_0xedea('0x10')][_0xedea('0x12')]);return _0xbd4b18(_0x5ed862[_0xedea('0x10')]['message']);}else{logger[_0xedea('0x13')](_0xedea('0xc'),_0x552d24,_0xedea('0xd'));_0xbd4b18(_0x5ed862[_0xedea('0x14')][_0xedea('0x12')]);}})['catch'](function(_0x283e63){logger[_0xedea('0x10')]('Network,\x20%s,\x20%s',_0x552d24,_0x283e63);_0x14ea65(_0x283e63);});});}function respondWithResult(_0x299fa4,_0x5dadc2){_0x5dadc2=_0x5dadc2||0xc8;return function(_0x4a9787){if(_0x4a9787){return _0x299fa4[_0xedea('0x15')](_0x5dadc2)[_0xedea('0x16')](_0x4a9787);}};}function respondWithFilteredResult(_0x24100f,_0x31c5c6){return function(_0x2bbecc){if(_0x2bbecc){var _0x2a6893=typeof _0x31c5c6['offset']===_0xedea('0x17')&&typeof _0x31c5c6[_0xedea('0x18')]==='undefined';var _0x459633=_0x2bbecc[_0xedea('0x19')];var _0x5761bd=_0x2a6893?0x0:_0x31c5c6[_0xedea('0x1a')];var _0x359cfe=_0x2a6893?_0x2bbecc[_0xedea('0x19')]:_0x31c5c6[_0xedea('0x1a')]+_0x31c5c6[_0xedea('0x18')];var _0x59c062;if(_0x359cfe>=_0x459633){_0x359cfe=_0x459633;_0x59c062=0xc8;}else{_0x59c062=0xce;}_0x24100f['status'](_0x59c062);return _0x24100f[_0xedea('0x1b')]('Content-Range',_0x5761bd+'-'+_0x359cfe+'/'+_0x459633)[_0xedea('0x16')](_0x2bbecc);}return null;};}function saveUpdates(_0x2c071e){return function(_0x51bd16){if(_0x51bd16){return _0x51bd16[_0xedea('0x1c')](_0x2c071e)['then'](function(_0x292296){return _0x292296;});}return null;};}function removeEntity(_0x4d0c03){return function(_0x29c2b2){if(_0x29c2b2){return _0x29c2b2[_0xedea('0x1d')]()[_0xedea('0x1e')](function(){_0x4d0c03[_0xedea('0x15')](0xcc)[_0xedea('0x1f')]();});}};}function handleEntityNotFound(_0x169e9a){return function(_0x283621){if(!_0x283621){_0x169e9a['sendStatus'](0x194);}return _0x283621;};}function handleError(_0x299764,_0x490b61){_0x490b61=_0x490b61||0x1f4;return function(_0x496cea){logger[_0xedea('0x10')](_0x496cea[_0xedea('0x20')]);if(_0x496cea[_0xedea('0x21')]){delete _0x496cea[_0xedea('0x21')];}_0x299764[_0xedea('0x15')](_0x490b61)[_0xedea('0x22')](_0x496cea);};}exports[_0xedea('0x23')]=function(_0x1f6697,_0x4b97fd){var _0x1c8076={},_0x461d62={},_0x19ce05={'count':0x0,'rows':[]};var _0xa66cd4=_[_0xedea('0x24')](db[_0xedea('0x25')][_0xedea('0x26')],function(_0x51697c){return{'name':_0x51697c[_0xedea('0x27')],'type':_0x51697c[_0xedea('0x28')][_0xedea('0x29')]};});_0x461d62['model']=_[_0xedea('0x24')](_0xa66cd4,_0xedea('0x21'));_0x461d62['query']=_['keys'](_0x1f6697[_0xedea('0x2a')]);_0x461d62[_0xedea('0x2b')]=_[_0xedea('0x2c')](_0x461d62[_0xedea('0x2d')],_0x461d62[_0xedea('0x2a')]);_0x1c8076[_0xedea('0x2e')]=_[_0xedea('0x2c')](_0x461d62[_0xedea('0x2d')],qs['fields'](_0x1f6697[_0xedea('0x2a')][_0xedea('0x2f')]));_0x1c8076[_0xedea('0x2e')]=_0x1c8076['attributes'][_0xedea('0x30')]?_0x1c8076[_0xedea('0x2e')]:_0x461d62[_0xedea('0x2d')];if(!_0x1f6697[_0xedea('0x2a')][_0xedea('0x31')](_0xedea('0x32'))){_0x1c8076[_0xedea('0x18')]=qs[_0xedea('0x18')](_0x1f6697[_0xedea('0x2a')]['limit']);_0x1c8076[_0xedea('0x1a')]=qs[_0xedea('0x1a')](_0x1f6697[_0xedea('0x2a')][_0xedea('0x1a')]);}_0x1c8076[_0xedea('0x33')]=qs[_0xedea('0x34')](_0x1f6697[_0xedea('0x2a')][_0xedea('0x34')]);_0x1c8076[_0xedea('0x35')]=qs[_0xedea('0x2b')](_['pick'](_0x1f6697['query'],_0x461d62['filters']),_0xa66cd4);if(_0x1f6697[_0xedea('0x2a')][_0xedea('0x36')]){_0x1c8076[_0xedea('0x35')]=_[_0xedea('0x37')](_0x1c8076[_0xedea('0x35')],{'$or':_['map'](_0xa66cd4,function(_0x46b01f){if(_0x46b01f[_0xedea('0x28')]!==_0xedea('0x38')){var _0x4c87b6={};_0x4c87b6[_0x46b01f[_0xedea('0x21')]]={'$like':'%'+_0x1f6697['query'][_0xedea('0x36')]+'%'};return _0x4c87b6;}})});}_0x1c8076=_[_0xedea('0x37')]({},_0x1c8076,_0x1f6697[_0xedea('0x39')]);var _0x4351e1={'where':_0x1c8076[_0xedea('0x35')]};return db[_0xedea('0x25')][_0xedea('0x19')](_0x4351e1)[_0xedea('0x1e')](function(_0x4c320a){_0x19ce05[_0xedea('0x19')]=_0x4c320a;if(_0x1f6697[_0xedea('0x2a')][_0xedea('0x3a')]){_0x1c8076[_0xedea('0x3b')]=[{'all':!![]}];}return db[_0xedea('0x25')][_0xedea('0x3c')](_0x1c8076);})[_0xedea('0x1e')](function(_0x22a02e){_0x19ce05[_0xedea('0x3d')]=_0x22a02e;return _0x19ce05;})[_0xedea('0x1e')](respondWithFilteredResult(_0x4b97fd,_0x1c8076))[_0xedea('0x3e')](handleError(_0x4b97fd,null));};exports['show']=function(_0x408fc2,_0xc05850){var _0x2f63c0={'raw':!![],'where':{'id':_0x408fc2[_0xedea('0x3f')]['id']}},_0x5583fc={};_0x5583fc[_0xedea('0x2d')]=_['keys'](db[_0xedea('0x25')][_0xedea('0x26')]);_0x5583fc[_0xedea('0x2a')]=_[_0xedea('0x40')](_0x408fc2['query']);_0x5583fc[_0xedea('0x2b')]=_[_0xedea('0x2c')](_0x5583fc[_0xedea('0x2d')],_0x5583fc[_0xedea('0x2a')]);_0x2f63c0[_0xedea('0x2e')]=_['intersection'](_0x5583fc['model'],qs[_0xedea('0x2f')](_0x408fc2[_0xedea('0x2a')][_0xedea('0x2f')]));_0x2f63c0['attributes']=_0x2f63c0[_0xedea('0x2e')][_0xedea('0x30')]?_0x2f63c0['attributes']:_0x5583fc['model'];if(_0x408fc2[_0xedea('0x2a')][_0xedea('0x3a')]){_0x2f63c0[_0xedea('0x3b')]=[{'all':!![]}];}_0x2f63c0=_[_0xedea('0x37')]({},_0x2f63c0,_0x408fc2['options']);return db['Network'][_0xedea('0x41')](_0x2f63c0)[_0xedea('0x1e')](handleEntityNotFound(_0xc05850,null))[_0xedea('0x1e')](respondWithResult(_0xc05850,null))[_0xedea('0x3e')](handleError(_0xc05850,null));};exports[_0xedea('0x42')]=function(_0x403a1c,_0x155e3c){var _0x5a2d8f;return db[_0xedea('0x25')][_0xedea('0x42')](_0x403a1c[_0xedea('0x43')],{'raw':!![]})[_0xedea('0x1e')](function(_0x3b618a){_0x5a2d8f=_0x3b618a;return db[_0xedea('0x25')]['findAll']({'where':{'type':_0x403a1c['body'][_0xedea('0x28')]},'raw':!![]});})['then'](function(_0x315e06){if(_0x5a2d8f[_0xedea('0x28')][_0xedea('0x44')]()==_0xedea('0x45')){var _0x3d439f=fs[_0xedea('0x46')](path['join'](config[_0xedea('0x47')],_0xedea('0x48')),'utf8');var _0x3328ca=ejs[_0xedea('0x49')](_0x3d439f,{'networks':_0x315e06||[]});fs[_0xedea('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x3328ca);return respondWithRpcPromise('Reload',_0xedea('0x42'),{'module':_0xedea('0x4b')});}else if(_0x5a2d8f[_0xedea('0x28')][_0xedea('0x44')]()==_0xedea('0x4c')){var _0x31a4b0=fs[_0xedea('0x46')](path[_0xedea('0x4d')](config['root'],_0xedea('0x4e')),_0xedea('0x4f'));var _0x1545b6=ejs[_0xedea('0x49')](_0x31a4b0,{'networks':_0x315e06||[]});fs[_0xedea('0x4a')](_0xedea('0x50'),_0x1545b6);return respondWithRpcPromise(_0xedea('0x51'),_0xedea('0x42'),{'module':_0xedea('0x4b')});}else{var _0x564f4b=fs[_0xedea('0x46')](path['join'](config[_0xedea('0x47')],'server/files/templates/network.ejs'),_0xedea('0x4f'));var _0x1d7377=ejs[_0xedea('0x49')](_0x564f4b,{'networks':_0x315e06||[]});fs[_0xedea('0x4a')](util[_0xedea('0x52')](_0xedea('0x53'),_0x403a1c['body'][_0xedea('0x28')][_0xedea('0x54')]()),_0x1d7377);return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});}})[_0xedea('0x1e')](function(){return _0x5a2d8f;})[_0xedea('0x1e')](respondWithResult(_0x155e3c,0xc9))[_0xedea('0x3e')](handleError(_0x155e3c,null));};exports[_0xedea('0x1c')]=function(_0x270e9c,_0x15a9ce){var _0x2bd9fe;return db[_0xedea('0x25')][_0xedea('0x41')]({'where':{'id':_0x270e9c[_0xedea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x15a9ce,null))[_0xedea('0x1e')](saveUpdates(_0x270e9c['body'],null))[_0xedea('0x1e')](function(_0x8d303f){if(_0x8d303f){_0x2bd9fe=_0x8d303f;return db[_0xedea('0x25')][_0xedea('0x3c')]({'where':{'type':_0x2bd9fe[_0xedea('0x28')]},'raw':!![]});}return null;})[_0xedea('0x1e')](function(_0x57acc5){if(_0x2bd9fe[_0xedea('0x28')][_0xedea('0x44')]()==_0xedea('0x45')){var _0x26a84a=fs[_0xedea('0x46')](path[_0xedea('0x4d')](config['root'],_0xedea('0x48')),_0xedea('0x4f'));var _0x582f0e=ejs['render'](_0x26a84a,{'networks':_0x57acc5||[]});fs[_0xedea('0x4a')](_0xedea('0x55'),_0x582f0e);return respondWithRpcPromise(_0xedea('0x51'),'update',{'module':'res_stun_monitor.so'});}else if(_0x2bd9fe[_0xedea('0x28')][_0xedea('0x44')]()==_0xedea('0x4c')){var _0x545956=fs[_0xedea('0x46')](path[_0xedea('0x4d')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xedea('0x4f'));var _0x5b6787=ejs['render'](_0x545956,{'networks':_0x57acc5||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x5b6787);return respondWithRpcPromise('Reload',_0xedea('0x1c'),{'module':_0xedea('0x4b')});}else{var _0x12b9bf=fs['readFileSync'](path[_0xedea('0x4d')](config[_0xedea('0x47')],_0xedea('0x56')),_0xedea('0x4f'));var _0x328549=ejs[_0xedea('0x49')](_0x12b9bf,{'networks':_0x57acc5||[]});fs['writeFileSync'](util[_0xedea('0x52')](_0xedea('0x53'),_0x270e9c[_0xedea('0x43')][_0xedea('0x28')][_0xedea('0x54')]()),_0x328549);return respondWithRpcPromise(_0xedea('0x51'),_0xedea('0x1c'),{'module':'chan_sip.so'});}})[_0xedea('0x1e')](function(_0x29bfcf){if(_0x29bfcf){return _0x2bd9fe;}return null;})[_0xedea('0x1e')](respondWithResult(_0x15a9ce,null))[_0xedea('0x3e')](handleError(_0x15a9ce,null));};exports[_0xedea('0x1d')]=function(_0x44d92d,_0x416b2e){var _0x1cceb5;return db['Network'][_0xedea('0x41')]({'where':{'id':_0x44d92d[_0xedea('0x3f')]['id']}})[_0xedea('0x1e')](function(_0x59128c){_0x1cceb5=_0x59128c;return _0x59128c;})[_0xedea('0x1e')](handleEntityNotFound(_0x416b2e,null))['then'](removeEntity(_0x416b2e,null))[_0xedea('0x1e')](function(){if(_0x1cceb5){return db[_0xedea('0x25')][_0xedea('0x3c')]({'where':{'type':_0x1cceb5[_0xedea('0x28')]},'raw':!![]});}})[_0xedea('0x1e')](function(_0x280127){if(_0x1cceb5[_0xedea('0x28')][_0xedea('0x44')]()==_0xedea('0x45')){var _0x22a799=fs[_0xedea('0x46')](path[_0xedea('0x4d')](config[_0xedea('0x47')],'server/files/templates/stun_multiple.ejs'),_0xedea('0x4f'));var _0x196f92=ejs[_0xedea('0x49')](_0x22a799,{'networks':_0x280127||[]});fs[_0xedea('0x4a')](_0xedea('0x55'),_0x196f92);return respondWithRpcPromise(_0xedea('0x51'),_0xedea('0x1d'),{'module':_0xedea('0x4b')});}else if(_0x1cceb5['type']['toUpperCase']()==_0xedea('0x4c')){var _0x474dac=fs[_0xedea('0x46')](path['join'](config[_0xedea('0x47')],_0xedea('0x4e')),_0xedea('0x4f'));var _0x4d3448=ejs[_0xedea('0x49')](_0x474dac,{'networks':_0x280127||[]});fs[_0xedea('0x4a')](_0xedea('0x50'),_0x4d3448);return respondWithRpcPromise('Reload','destroy',{'module':_0xedea('0x4b')});}else{var _0x25b8be=fs[_0xedea('0x46')](path['join'](config['root'],_0xedea('0x56')),'utf8');var _0xc8661d=ejs['render'](_0x25b8be,{'networks':_0x280127||[]});fs['writeFileSync'](util[_0xedea('0x52')](_0xedea('0x53'),_0x1cceb5[_0xedea('0x28')][_0xedea('0x54')]()),_0xc8661d);return respondWithRpcPromise(_0xedea('0x51'),_0xedea('0x1d'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x416b2e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 4b98a8f..dcb7bba 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 _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./network.attributes','exports','network'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0a12,0xb8));var _0x20a1=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x0a12[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('Network',attributes,{'tableName':_0x20a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x867f=['define','Network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x42fbdb,_0x23f532){var _0x12bdcc=function(_0x565b64){while(--_0x565b64){_0x42fbdb['push'](_0x42fbdb['shift']());}};_0x12bdcc(++_0x23f532);}(_0x867f,0xe6));var _0xf867=function(_0x340fc7,_0x12a901){_0x340fc7=_0x340fc7-0x0;var _0x586c93=_0x867f[_0x340fc7];return _0x586c93;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require(_0xf867('0x7'));var rimraf=require(_0xf867('0x8'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xf867('0x9')]=function(_0x2e0691,_0x2c09b1){return _0x2e0691[_0xf867('0xa')](_0xf867('0xb'),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 c14de2d..3e0b5a8 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x4107e4,_0x53df7f){_0x4107e4=_0x4107e4-0x0;var _0x437e2f=_0x7a54[_0x4107e4];return _0x437e2f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x160e22,_0x22408f){_0x160e22=_0x160e22-0x0;var _0xff4f65=_0x7a54[_0x160e22];return _0xff4f65;};'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 c9ea41f..baa5c4a 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 _0x5b91=['getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications','addAgents','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x9a3f7c,_0xfa1ee1){var _0x15e236=function(_0x5ad368){while(--_0x5ad368){_0x9a3f7c['push'](_0x9a3f7c['shift']());}};_0x15e236(++_0xfa1ee1);}(_0x5b91,0x108));var _0x15b9=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x5b91[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require(_0x15b9('0x0'));var util=require(_0x15b9('0x1'));var path=require(_0x15b9('0x2'));var timeout=require(_0x15b9('0x3'));var express=require(_0x15b9('0x4'));var router=express['Router']();var fs_extra=require(_0x15b9('0x5'));var auth=require(_0x15b9('0x6'));var interaction=require(_0x15b9('0x7'));var config=require(_0x15b9('0x8'));var controller=require(_0x15b9('0x9'));router[_0x15b9('0xa')]('/',auth[_0x15b9('0xb')](),controller[_0x15b9('0xc')]);router[_0x15b9('0xa')](_0x15b9('0xd'),auth[_0x15b9('0xb')](),controller[_0x15b9('0xe')]);router[_0x15b9('0xa')](_0x15b9('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x15b9('0xa')](_0x15b9('0x10'),auth[_0x15b9('0xb')](),controller[_0x15b9('0x11')]);router[_0x15b9('0xa')](_0x15b9('0x12'),auth[_0x15b9('0xb')](),controller[_0x15b9('0x13')]);router[_0x15b9('0xa')](_0x15b9('0x14'),auth[_0x15b9('0xb')](),controller[_0x15b9('0x15')]);router[_0x15b9('0xa')](_0x15b9('0x16'),auth[_0x15b9('0xb')](),controller[_0x15b9('0x17')]);router[_0x15b9('0xa')](_0x15b9('0x18'),auth['isAuthenticated'](),controller[_0x15b9('0x19')]);router[_0x15b9('0x1a')]('/',auth[_0x15b9('0xb')](),controller[_0x15b9('0x1b')]);router[_0x15b9('0x1a')](_0x15b9('0x10'),auth[_0x15b9('0xb')](),controller['addDisposition']);router[_0x15b9('0x1a')]('/:id/canned_answers',auth[_0x15b9('0xb')](),controller[_0x15b9('0x1c')]);router['post'](_0x15b9('0x1d'),controller[_0x15b9('0x1e')]);router[_0x15b9('0x1a')](_0x15b9('0x14'),auth[_0x15b9('0xb')](),controller[_0x15b9('0x1f')]);router[_0x15b9('0x1a')](_0x15b9('0x18'),auth['isAuthenticated'](),controller[_0x15b9('0x20')]);router[_0x15b9('0x1a')]('/:id/send',auth[_0x15b9('0xb')](),controller[_0x15b9('0x21')]);router['put'](_0x15b9('0xf'),auth[_0x15b9('0xb')](),controller[_0x15b9('0x22')]);router[_0x15b9('0x23')](_0x15b9('0xf'),auth['isAuthenticated'](),controller[_0x15b9('0x24')]);router[_0x15b9('0x23')](_0x15b9('0x10'),auth[_0x15b9('0xb')](),controller[_0x15b9('0x25')]);router[_0x15b9('0x23')]('/:id/canned_answers',auth[_0x15b9('0xb')](),controller[_0x15b9('0x26')]);router[_0x15b9('0x23')](_0x15b9('0x18'),auth['isAuthenticated'](),controller[_0x15b9('0x27')]);module[_0x15b9('0x28')]=router; \ No newline at end of file +var _0x4fd1=['notify','/:id/applications','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','./openchannelAccount.controller','isAuthenticated','get','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4fd1,0xea));var _0x14fd=function(_0x2cd42b,_0x4e3d10){_0x2cd42b=_0x2cd42b-0x0;var _0x329ab9=_0x4fd1[_0x2cd42b];return _0x329ab9;};'use strict';var multer=require(_0x14fd('0x0'));var util=require('util');var path=require(_0x14fd('0x1'));var timeout=require('connect-timeout');var express=require(_0x14fd('0x2'));var router=express[_0x14fd('0x3')]();var fs_extra=require(_0x14fd('0x4'));var auth=require(_0x14fd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x14fd('0x6'));router['get']('/',auth[_0x14fd('0x7')](),controller['index']);router[_0x14fd('0x8')]('/describe',auth[_0x14fd('0x7')](),controller[_0x14fd('0x9')]);router['get'](_0x14fd('0xa'),auth[_0x14fd('0x7')](),controller['show']);router[_0x14fd('0x8')](_0x14fd('0xb'),auth[_0x14fd('0x7')](),controller[_0x14fd('0xc')]);router[_0x14fd('0x8')](_0x14fd('0xd'),auth[_0x14fd('0x7')](),controller[_0x14fd('0xe')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x14fd('0xf')]);router[_0x14fd('0x8')](_0x14fd('0x10'),auth['isAuthenticated'](),controller[_0x14fd('0x11')]);router[_0x14fd('0x8')](_0x14fd('0x12'),auth['isAuthenticated'](),controller[_0x14fd('0x13')]);router[_0x14fd('0x14')]('/',auth[_0x14fd('0x7')](),controller[_0x14fd('0x15')]);router[_0x14fd('0x14')](_0x14fd('0xb'),auth[_0x14fd('0x7')](),controller[_0x14fd('0x16')]);router[_0x14fd('0x14')](_0x14fd('0xd'),auth['isAuthenticated'](),controller[_0x14fd('0x17')]);router['post'](_0x14fd('0x18'),controller[_0x14fd('0x19')]);router[_0x14fd('0x14')](_0x14fd('0x1a'),auth[_0x14fd('0x7')](),controller[_0x14fd('0x1b')]);router[_0x14fd('0x14')](_0x14fd('0x12'),auth['isAuthenticated'](),controller[_0x14fd('0x1c')]);router['post']('/:id/send',auth[_0x14fd('0x7')](),controller[_0x14fd('0x1d')]);router[_0x14fd('0x1e')](_0x14fd('0xa'),auth[_0x14fd('0x7')](),controller[_0x14fd('0x1f')]);router[_0x14fd('0x20')](_0x14fd('0xa'),auth['isAuthenticated'](),controller[_0x14fd('0x21')]);router[_0x14fd('0x20')](_0x14fd('0xb'),auth[_0x14fd('0x7')](),controller[_0x14fd('0x22')]);router[_0x14fd('0x20')]('/:id/canned_answers',auth[_0x14fd('0x7')](),controller[_0x14fd('0x23')]);router['delete'](_0x14fd('0x12'),auth[_0x14fd('0x7')](),controller[_0x14fd('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index b88f84d..431a520 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 _0x550d=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x48dc7a,_0x31474f){var _0x2faaa0=function(_0x2483f9){while(--_0x2483f9){_0x48dc7a['push'](_0x48dc7a['shift']());}};_0x2faaa0(++_0x31474f);}(_0x550d,0x189));var _0xd550=function(_0x29f6b1,_0x5e0c7d){_0x29f6b1=_0x29f6b1-0x0;var _0x409699=_0x550d[_0x29f6b1];return _0x409699;};'use strict';var Sequelize=require(_0xd550('0x0'));var rs=require(_0xd550('0x1'));module['exports']={'name':{'type':Sequelize[_0xd550('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd550('0x2')],'defaultValue':function(){return rs[_0xd550('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd550('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd550('0x4')],'defaultValue':function(){return _0xd550('0x5');}},'notificationSound':{'type':Sequelize[_0xd550('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd550('0x2')]},'queueTransfer':{'type':Sequelize[_0xd550('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd550('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd550('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xd550('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2f244e){if(!_0x2f244e)this[_0xd550('0x9')]('mandatoryDispositionPauseId',null);this[_0xd550('0x9')](_0xd550('0xa'),_0x2f244e);}}}; \ No newline at end of file +var _0xe68e=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0xe68e,0x1f2));var _0xee68=function(_0x164b96,_0x12f735){_0x164b96=_0x164b96-0x0;var _0x5489d9=_0xe68e[_0x164b96];return _0x5489d9;};'use strict';var Sequelize=require(_0xee68('0x0'));var rs=require(_0xee68('0x1'));module[_0xee68('0x2')]={'name':{'type':Sequelize[_0xee68('0x3')],'unique':_0xee68('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xee68('0x3')]},'token':{'type':Sequelize[_0xee68('0x3')],'defaultValue':function(){return rs[_0xee68('0x5')]();}},'replyUri':{'type':Sequelize[_0xee68('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xee68('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xee68('0x6')],'defaultValue':function(){return _0xee68('0x7');}},'notificationSound':{'type':Sequelize[_0xee68('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xee68('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xee68('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xee68('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xee68('0x3')]},'queueTransfer':{'type':Sequelize[_0xee68('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xee68('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xee68('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xee68('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xee68('0x8')],'defaultValue':![],'comment':_0xee68('0xb'),'set':function(_0x2dec40){if(!_0x2dec40)this[_0xee68('0xc')]('mandatoryDispositionPauseId',null);this[_0xee68('0xc')](_0xee68('0xd'),_0x2dec40);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index c3068f8..56e286b 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 _0x4819=['user','out','Messages','dataValues','push','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','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','get','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','show','length','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','Disposition','getDispositions','rawAttributes','hasOwnProperty','OpenchannelAccountId','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','addAgents','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','defaults'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x4819,0xcd));var _0x9481=function(_0x17efa3,_0x39ef4b){_0x17efa3=_0x17efa3-0x0;var _0x5caced=_0x4819[_0x17efa3];return _0x5caced;};'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'];config[_0x9481('0x1a')]=_['defaults'](config['redis'],{'host':_0x9481('0x1b'),'port':0x18eb});var socket=require(_0x9481('0x1c'))(new Redis(config[_0x9481('0x1a')]));require(_0x9481('0x1d'))[_0x9481('0x1e')](socket);var jayson=require(_0x9481('0x1f'));var client=jayson[_0x9481('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x9481('0x20')][_0x9481('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5b1fe6,_0x2266d5,_0x518150,_0x34108d){return new BPromise(function(_0x7a2ac8,_0x2bc12a){var _0x2bb2a4=_0x34108d||client;return _0x2bb2a4['request'](_0x5b1fe6,_0x518150)['then'](function(_0x20473d){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2266d5,_0x9481('0x22'));logger[_0x9481('0x23')](_0x9481('0x24'),_0x2266d5,_0x9481('0x22'),JSON[_0x9481('0x25')](_0x20473d));if(_0x20473d[_0x9481('0x26')]){if(_0x20473d['error'][_0x9481('0x27')]===0x1f4){logger[_0x9481('0x26')](_0x9481('0x28'),_0x2266d5,_0x20473d[_0x9481('0x26')][_0x9481('0x29')]);return _0x2bc12a(_0x20473d['error'][_0x9481('0x29')]);}logger[_0x9481('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x2266d5,_0x20473d[_0x9481('0x26')][_0x9481('0x29')]);return _0x7a2ac8(_0x20473d[_0x9481('0x26')][_0x9481('0x29')]);}else{logger[_0x9481('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x2266d5,_0x9481('0x22'));_0x7a2ac8(_0x20473d[_0x9481('0x2b')]['message']);}})['catch'](function(_0x12b0c3){logger[_0x9481('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x2266d5,_0x12b0c3);_0x2bc12a(_0x12b0c3);});});}function respondWithStatusCode(_0x1e6f28,_0x20ff9a){_0x20ff9a=_0x20ff9a||0xcc;return function(_0xeff0a5){if(_0xeff0a5){return _0x1e6f28[_0x9481('0x2c')](_0x20ff9a);}return _0x1e6f28['status'](_0x20ff9a)[_0x9481('0x2d')]();};}function respondWithResult(_0x3ca064,_0x3c2585){_0x3c2585=_0x3c2585||0xc8;return function(_0x587706){if(_0x587706){return _0x3ca064[_0x9481('0x2e')](_0x3c2585)['json'](_0x587706);}};}function respondWithFilteredResult(_0x2e1eff,_0xe153ab){return function(_0x22ab26){if(_0x22ab26){var _0x13ef93=typeof _0xe153ab[_0x9481('0x2f')]==='undefined'&&typeof _0xe153ab[_0x9481('0x30')]===_0x9481('0x31');var _0x46e4ab=_0x22ab26['count'];var _0x56752e=_0x13ef93?0x0:_0xe153ab[_0x9481('0x2f')];var _0x427c25=_0x13ef93?_0x22ab26[_0x9481('0x32')]:_0xe153ab[_0x9481('0x2f')]+_0xe153ab['limit'];var _0x5163e3;if(_0x427c25>=_0x46e4ab){_0x427c25=_0x46e4ab;_0x5163e3=0xc8;}else{_0x5163e3=0xce;}_0x2e1eff['status'](_0x5163e3);return _0x2e1eff[_0x9481('0x33')]('Content-Range',_0x56752e+'-'+_0x427c25+'/'+_0x46e4ab)[_0x9481('0x34')](_0x22ab26);}return null;};}function patchUpdates(_0x59135e){return function(_0x3b328b){try{jsonpatch[_0x9481('0x35')](_0x3b328b,_0x59135e,!![]);}catch(_0x40a2d7){return BPromise[_0x9481('0x36')](_0x40a2d7);}return _0x3b328b[_0x9481('0x37')]();};}function saveUpdates(_0x5dc8e6,_0x30ec){return function(_0x45a1fd){if(_0x45a1fd){return _0x45a1fd[_0x9481('0x38')](_0x5dc8e6)['then'](function(_0x30063f){return _0x30063f;});}return null;};}function removeEntity(_0x2079b1,_0x38d114){return function(_0x221aa2){if(_0x221aa2){return _0x221aa2[_0x9481('0x39')]()[_0x9481('0x3a')](function(){var _0x5d7299=_0x221aa2[_0x9481('0x3b')]({'plain':!![]});var _0x53af85=_0x9481('0x3c');return db[_0x9481('0x3d')][_0x9481('0x39')]({'where':{'type':_0x53af85,'resourceId':_0x5d7299['id']}})[_0x9481('0x3a')](function(){return _0x221aa2;});})[_0x9481('0x3a')](function(){_0x2079b1[_0x9481('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6043a4,_0x15e27f){return function(_0x4ed991){if(!_0x4ed991){_0x6043a4['sendStatus'](0x194);}return _0x4ed991;};}function handleError(_0x31ea6a,_0x5ab28f){_0x5ab28f=_0x5ab28f||0x1f4;return function(_0x224b88){logger[_0x9481('0x26')](_0x224b88[_0x9481('0x3e')]);if(_0x224b88[_0x9481('0x3f')]){delete _0x224b88['name'];}_0x31ea6a[_0x9481('0x2e')](_0x5ab28f)['send'](_0x224b88);};}exports[_0x9481('0x40')]=function(_0x56f151,_0x2ce972){var _0x4d6a13={'include':[{'model':db[_0x9481('0x41')],'as':_0x9481('0x42')}]},_0x315fb9={},_0x22e916={'count':0x0,'rows':[]};var _0x97dc3e=_[_0x9481('0x43')](db[_0x9481('0x44')]['rawAttributes'],function(_0x464080){return{'name':_0x464080[_0x9481('0x45')],'type':_0x464080[_0x9481('0x46')][_0x9481('0x47')]};});_0x315fb9[_0x9481('0x48')]=_[_0x9481('0x43')](_0x97dc3e,_0x9481('0x3f'));_0x315fb9['query']=_[_0x9481('0x49')](_0x56f151[_0x9481('0x4a')]);_0x315fb9['filters']=_[_0x9481('0x4b')](_0x315fb9[_0x9481('0x48')],_0x315fb9[_0x9481('0x4a')]);_0x4d6a13[_0x9481('0x4c')]=_[_0x9481('0x4b')](_0x315fb9['model'],qs[_0x9481('0x4d')](_0x56f151['query'][_0x9481('0x4d')]));_0x4d6a13[_0x9481('0x4c')]=_0x4d6a13['attributes']['length']?_0x4d6a13[_0x9481('0x4c')]:_0x315fb9[_0x9481('0x48')];if(!_0x56f151[_0x9481('0x4a')]['hasOwnProperty'](_0x9481('0x4e'))){_0x4d6a13[_0x9481('0x30')]=qs['limit'](_0x56f151['query'][_0x9481('0x30')]);_0x4d6a13['offset']=qs[_0x9481('0x2f')](_0x56f151[_0x9481('0x4a')][_0x9481('0x2f')]);}_0x4d6a13[_0x9481('0x4f')]=qs[_0x9481('0x50')](_0x56f151['query'][_0x9481('0x50')]);_0x4d6a13[_0x9481('0x51')]=qs['filters'](_[_0x9481('0x52')](_0x56f151[_0x9481('0x4a')],_0x315fb9[_0x9481('0x53')]),_0x97dc3e);if(_0x56f151[_0x9481('0x4a')][_0x9481('0x54')]){_0x4d6a13[_0x9481('0x51')]=_[_0x9481('0x55')](_0x4d6a13[_0x9481('0x51')],{'$or':_[_0x9481('0x43')](_0x97dc3e,function(_0x5ab395){if(_0x5ab395[_0x9481('0x46')]!=='VIRTUAL'){var _0x5c4d18={};_0x5c4d18[_0x5ab395[_0x9481('0x3f')]]={'$like':'%'+_0x56f151['query'][_0x9481('0x54')]+'%'};return _0x5c4d18;}})});}_0x4d6a13=_[_0x9481('0x55')]({},_0x4d6a13,_0x56f151['options']);var _0x277e2a={'where':_0x4d6a13[_0x9481('0x51')]};return db[_0x9481('0x44')][_0x9481('0x32')](_0x277e2a)[_0x9481('0x3a')](function(_0x4257df){_0x22e916['count']=_0x4257df;if(_0x56f151['query'][_0x9481('0x56')]){_0x4d6a13[_0x9481('0x57')]=[{'all':!![]}];}return db[_0x9481('0x44')][_0x9481('0x58')](_0x4d6a13);})[_0x9481('0x3a')](function(_0x353aab){_0x22e916[_0x9481('0x59')]=_0x353aab;return _0x22e916;})[_0x9481('0x3a')](respondWithFilteredResult(_0x2ce972,_0x4d6a13))['catch'](handleError(_0x2ce972,null));};exports[_0x9481('0x5a')]=function(_0x143c80,_0x54a755){var _0x3b29bc={'raw':![],'where':{'id':_0x143c80['params']['id']},'include':[{'model':db['Pause'],'as':_0x9481('0x42')}]},_0x1b3eac={};_0x1b3eac[_0x9481('0x48')]=_[_0x9481('0x49')](db['OpenchannelAccount']['rawAttributes']);_0x1b3eac['query']=_['keys'](_0x143c80['query']);_0x1b3eac['filters']=_['intersection'](_0x1b3eac[_0x9481('0x48')],_0x1b3eac[_0x9481('0x4a')]);_0x3b29bc['attributes']=_[_0x9481('0x4b')](_0x1b3eac['model'],qs[_0x9481('0x4d')](_0x143c80[_0x9481('0x4a')][_0x9481('0x4d')]));_0x3b29bc[_0x9481('0x4c')]=_0x3b29bc[_0x9481('0x4c')][_0x9481('0x5b')]?_0x3b29bc[_0x9481('0x4c')]:_0x1b3eac['model'];if(_0x143c80[_0x9481('0x4a')][_0x9481('0x56')]){_0x3b29bc['include']=[{'all':!![]}];}_0x3b29bc=_[_0x9481('0x55')]({},_0x3b29bc,_0x143c80[_0x9481('0x5c')]);return db[_0x9481('0x44')][_0x9481('0x5d')](_0x3b29bc)[_0x9481('0x3a')](handleEntityNotFound(_0x54a755,null))['then'](respondWithResult(_0x54a755,null))[_0x9481('0x5e')](handleError(_0x54a755,null));};exports[_0x9481('0x5f')]=function(_0x382f0,_0x3fc0f9){return db[_0x9481('0x44')][_0x9481('0x5f')](_0x382f0[_0x9481('0x60')],{})[_0x9481('0x3a')](function(_0x2dfcb5){var _0x4e3379=_0x382f0['user']['get']({'plain':!![]});if(!_0x4e3379)throw new Error(_0x9481('0x61'));if(_0x4e3379[_0x9481('0x62')]==='user'){var _0xe8ce2a=_0x2dfcb5[_0x9481('0x3b')]({'plain':!![]});var _0x36fd7d=_0x9481('0x3c');return db[_0x9481('0x63')][_0x9481('0x5d')]({'where':{'name':_0x36fd7d,'userProfileId':_0x4e3379['userProfileId']},'raw':!![]})['then'](function(_0xfa9737){if(_0xfa9737&&_0xfa9737[_0x9481('0x64')]===0x0){return db[_0x9481('0x3d')][_0x9481('0x5f')]({'name':_0xe8ce2a[_0x9481('0x3f')],'resourceId':_0xe8ce2a['id'],'type':_0xfa9737[_0x9481('0x3f')],'sectionId':_0xfa9737['id']},{})['then'](function(){return _0x2dfcb5;});}else{return _0x2dfcb5;}})['catch'](function(_0x17edbc){logger['error'](_0x9481('0x65'),_0x17edbc);throw _0x17edbc;});}return _0x2dfcb5;})['then'](respondWithResult(_0x3fc0f9,0xc9))[_0x9481('0x5e')](handleError(_0x3fc0f9,null));};exports[_0x9481('0x38')]=function(_0x3836fe,_0x492464){if(_0x3836fe[_0x9481('0x60')]['id']){delete _0x3836fe[_0x9481('0x60')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x3836fe['params']['id']},'include':[{'model':db['Pause'],'as':_0x9481('0x42')}]})['then'](handleEntityNotFound(_0x492464,null))[_0x9481('0x3a')](saveUpdates(_0x3836fe[_0x9481('0x60')],null))[_0x9481('0x3a')](respondWithResult(_0x492464,null))['catch'](handleError(_0x492464,null));};exports[_0x9481('0x39')]=function(_0x5a8034,_0x1f8120){return db[_0x9481('0x44')][_0x9481('0x5d')]({'where':{'id':_0x5a8034['params']['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x1f8120,null))[_0x9481('0x3a')](removeEntity(_0x1f8120,null))['catch'](handleError(_0x1f8120,null));};exports[_0x9481('0x66')]=function(_0x1070e5,_0x221942){return db[_0x9481('0x44')][_0x9481('0x66')]()[_0x9481('0x3a')](respondWithResult(_0x221942,null))[_0x9481('0x5e')](handleError(_0x221942,null));};exports[_0x9481('0x67')]=function(_0x51d395,_0x12abc6,_0x237d9b){if(_0x51d395[_0x9481('0x60')]['id']){delete _0x51d395[_0x9481('0x60')]['id'];}return db[_0x9481('0x44')][_0x9481('0x5d')]({'where':{'id':_0x51d395[_0x9481('0x68')]['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x12abc6,null))['then'](function(_0x1e05f8){if(_0x1e05f8){_0x51d395['body']['OpenchannelAccountId']=_0x1e05f8['id'];return db[_0x9481('0x69')]['create'](_0x51d395['body']);}})['then'](respondWithResult(_0x12abc6,null))[_0x9481('0x5e')](handleError(_0x12abc6,null));};exports[_0x9481('0x6a')]=function(_0x2486a7,_0x2507ee,_0x59bffa){var _0xa83176={'raw':![],'where':{}};var _0x265f1c={};var _0x2a053a={'count':0x0,'rows':[]};return db[_0x9481('0x44')]['findOne']({'where':{'id':_0x2486a7['params']['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x2507ee,null))[_0x9481('0x3a')](function(_0x193992){if(_0x193992){_0x265f1c[_0x9481('0x48')]=_[_0x9481('0x49')](db['Disposition'][_0x9481('0x6b')]);_0x265f1c[_0x9481('0x4a')]=_[_0x9481('0x49')](_0x2486a7[_0x9481('0x4a')]);_0x265f1c[_0x9481('0x53')]=_[_0x9481('0x4b')](_0x265f1c[_0x9481('0x48')],_0x265f1c[_0x9481('0x4a')]);_0xa83176[_0x9481('0x4c')]=_[_0x9481('0x4b')](_0x265f1c[_0x9481('0x48')],qs[_0x9481('0x4d')](_0x2486a7[_0x9481('0x4a')][_0x9481('0x4d')]));_0xa83176[_0x9481('0x4c')]=_0xa83176['attributes'][_0x9481('0x5b')]?_0xa83176[_0x9481('0x4c')]:_0x265f1c[_0x9481('0x48')];if(!_0x2486a7[_0x9481('0x4a')][_0x9481('0x6c')](_0x9481('0x4e'))){_0xa83176[_0x9481('0x30')]=qs['limit'](_0x2486a7[_0x9481('0x4a')][_0x9481('0x30')]);_0xa83176['offset']=qs['offset'](_0x2486a7[_0x9481('0x4a')]['offset']);}_0xa83176['order']=qs[_0x9481('0x50')](_0x2486a7['query'][_0x9481('0x50')]);_0xa83176[_0x9481('0x51')]=qs[_0x9481('0x53')](_[_0x9481('0x52')](_0x2486a7['query'],_0x265f1c[_0x9481('0x53')]));_0xa83176['where'][_0x9481('0x6d')]=_0x193992['id'];if(_0x2486a7[_0x9481('0x4a')][_0x9481('0x54')]){_0xa83176['where']=_['merge'](_0xa83176['where'],{'$or':_[_0x9481('0x43')](_0xa83176['attributes'],function(_0x56e35a){var _0xe43ae6={};_0xe43ae6[_0x56e35a]={'$like':'%'+_0x2486a7[_0x9481('0x4a')][_0x9481('0x54')]+'%'};return _0xe43ae6;})});}_0xa83176=_['merge']({},_0xa83176,_0x2486a7[_0x9481('0x5c')]);return db[_0x9481('0x69')]['count']({'where':_0xa83176[_0x9481('0x51')]})[_0x9481('0x3a')](function(_0x1ea93a){_0x2a053a[_0x9481('0x32')]=_0x1ea93a;if(_0x2486a7['query'][_0x9481('0x56')]){_0xa83176['include']=[{'all':!![]}];}return db[_0x9481('0x69')][_0x9481('0x58')](_0xa83176);})['then'](function(_0x1c82a1){_0x2a053a[_0x9481('0x59')]=_0x1c82a1;return _0x2a053a;});}})[_0x9481('0x3a')](respondWithFilteredResult(_0x2507ee,_0xa83176))['catch'](handleError(_0x2507ee,null));};exports['removeDispositions']=function(_0xcc7bd9,_0x50d75b,_0x14de3f){return db[_0x9481('0x44')][_0x9481('0x5d')]({'where':{'id':_0xcc7bd9['params']['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x50d75b,null))[_0x9481('0x3a')](function(_0x133b11){if(_0x133b11){return _0x133b11['removeDispositions'](_0xcc7bd9[_0x9481('0x4a')][_0x9481('0x6e')]);}})[_0x9481('0x3a')](respondWithStatusCode(_0x50d75b,null))[_0x9481('0x5e')](handleError(_0x50d75b,null));};exports[_0x9481('0x6f')]=function(_0x2f1c28,_0x25f284,_0x25899d){if(_0x2f1c28[_0x9481('0x60')]['id']){delete _0x2f1c28[_0x9481('0x60')]['id'];}return db['OpenchannelAccount'][_0x9481('0x5d')]({'where':{'id':_0x2f1c28['params']['id']}})['then'](handleEntityNotFound(_0x25f284,null))['then'](function(_0x2d4967){if(_0x2d4967){_0x2f1c28[_0x9481('0x60')][_0x9481('0x6d')]=_0x2d4967['id'];return db[_0x9481('0x70')][_0x9481('0x5f')](_0x2f1c28['body']);}})[_0x9481('0x3a')](respondWithResult(_0x25f284,null))[_0x9481('0x5e')](handleError(_0x25f284,null));};exports[_0x9481('0x71')]=function(_0x455a85,_0x27355e,_0x4e054){var _0x1c50f1={'raw':![],'where':{}};var _0x1ab165={};var _0x28d924={'count':0x0,'rows':[]};return db[_0x9481('0x44')]['findOne']({'where':{'id':_0x455a85[_0x9481('0x68')]['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x27355e,null))[_0x9481('0x3a')](function(_0x1cbc8c){if(_0x1cbc8c){_0x1ab165[_0x9481('0x48')]=_[_0x9481('0x49')](db[_0x9481('0x70')][_0x9481('0x6b')]);_0x1ab165[_0x9481('0x4a')]=_[_0x9481('0x49')](_0x455a85['query']);_0x1ab165[_0x9481('0x53')]=_[_0x9481('0x4b')](_0x1ab165[_0x9481('0x48')],_0x1ab165[_0x9481('0x4a')]);_0x1c50f1[_0x9481('0x4c')]=_[_0x9481('0x4b')](_0x1ab165[_0x9481('0x48')],qs[_0x9481('0x4d')](_0x455a85[_0x9481('0x4a')]['fields']));_0x1c50f1[_0x9481('0x4c')]=_0x1c50f1['attributes']['length']?_0x1c50f1[_0x9481('0x4c')]:_0x1ab165[_0x9481('0x48')];if(!_0x455a85[_0x9481('0x4a')][_0x9481('0x6c')](_0x9481('0x4e'))){_0x1c50f1[_0x9481('0x30')]=qs['limit'](_0x455a85[_0x9481('0x4a')]['limit']);_0x1c50f1[_0x9481('0x2f')]=qs[_0x9481('0x2f')](_0x455a85[_0x9481('0x4a')]['offset']);}_0x1c50f1['order']=qs[_0x9481('0x50')](_0x455a85[_0x9481('0x4a')][_0x9481('0x50')]);_0x1c50f1[_0x9481('0x51')]=qs[_0x9481('0x53')](_[_0x9481('0x52')](_0x455a85[_0x9481('0x4a')],_0x1ab165[_0x9481('0x53')]));_0x1c50f1[_0x9481('0x51')]['OpenchannelAccountId']=_0x1cbc8c['id'];if(_0x455a85[_0x9481('0x4a')][_0x9481('0x54')]){_0x1c50f1['where']=_[_0x9481('0x55')](_0x1c50f1['where'],{'$or':_[_0x9481('0x43')](_0x1c50f1[_0x9481('0x4c')],function(_0x579b93){var _0x2d4409={};_0x2d4409[_0x579b93]={'$like':'%'+_0x455a85[_0x9481('0x4a')][_0x9481('0x54')]+'%'};return _0x2d4409;})});}_0x1c50f1=_['merge']({},_0x1c50f1,_0x455a85[_0x9481('0x5c')]);return db[_0x9481('0x70')]['count']({'where':_0x1c50f1[_0x9481('0x51')]})['then'](function(_0x1129ec){_0x28d924[_0x9481('0x32')]=_0x1129ec;if(_0x455a85[_0x9481('0x4a')]['includeAll']){_0x1c50f1['include']=[{'all':!![]}];}return db[_0x9481('0x70')][_0x9481('0x58')](_0x1c50f1);})[_0x9481('0x3a')](function(_0x338403){_0x28d924[_0x9481('0x59')]=_0x338403;return _0x28d924;});}})[_0x9481('0x3a')](respondWithFilteredResult(_0x27355e,_0x1c50f1))['catch'](handleError(_0x27355e,null));};exports[_0x9481('0x72')]=function(_0x619ca8,_0x232b8c,_0x38254c){return db[_0x9481('0x44')][_0x9481('0x5d')]({'where':{'id':_0x619ca8[_0x9481('0x68')]['id']}})['then'](handleEntityNotFound(_0x232b8c,null))[_0x9481('0x3a')](function(_0x12e604){if(_0x12e604){return _0x12e604[_0x9481('0x72')](_0x619ca8[_0x9481('0x4a')]['ids']);}})[_0x9481('0x3a')](respondWithStatusCode(_0x232b8c,null))[_0x9481('0x5e')](handleError(_0x232b8c,null));};exports[_0x9481('0x73')]=function(_0xc0443,_0x4e0ff1,_0x19a60e){var _0xc79c={'body':_0xc0443[_0x9481('0x60')],'channel':_0x9481('0x74')};var _0x7d5f0=[];var _0x1ad5bf=[];var _0x10a43e={};var _0x11c00f=![];return db[_0x9481('0x75')][_0x9481('0x66')]()[_0x9481('0x3a')](function(_0x5930d6){if(!_0x5930d6){throw new db[(_0x9481('0x76'))]['ValidationError'](_0x9481('0x77'));}_0x7d5f0=_[_0x9481('0x78')](_[_0x9481('0x49')](_0x5930d6),[_0x9481('0x79'),_0x9481('0x7a')]);_0x1ad5bf=_['difference'](_[_0x9481('0x49')](_0x5930d6),[_0x9481('0x79'),_0x9481('0x7a'),_0x9481('0x7b'),_0x9481('0x7c')]);if(_0xc0443[_0x9481('0x60')]['id']){delete _0xc0443['body']['id'];}if(_[_0x9481('0x7d')](_0xc0443[_0x9481('0x60')][_0x9481('0x7e')])){throw new db[(_0x9481('0x76'))][(_0x9481('0x7f'))](_0x9481('0x80'));}if(_[_0x9481('0x7d')](_0xc0443[_0x9481('0x60')][_0x9481('0x60')])||_0xc0443[_0x9481('0x60')][_0x9481('0x60')]===''){throw new db[(_0x9481('0x76'))]['ValidationError'](_0x9481('0x81'));}if(_[_0x9481('0x7d')](_0xc0443[_0x9481('0x60')][_0x9481('0x82')])){throw new db[(_0x9481('0x76'))][(_0x9481('0x7f'))](_0x9481('0x83')+_0x1ad5bf);}if(!_[_0x9481('0x84')](_0x1ad5bf,_0xc0443[_0x9481('0x60')][_0x9481('0x82')])){throw new db[(_0x9481('0x76'))][(_0x9481('0x7f'))](_0x9481('0x85')+_0x1ad5bf);}_0x10a43e[_0xc0443[_0x9481('0x60')][_0x9481('0x82')]]=_0xc0443[_0x9481('0x60')][_0x9481('0x7e')];})[_0x9481('0x3a')](function(){return db[_0x9481('0x44')][_0x9481('0x5d')]({'where':{'id':_0xc0443['params']['id']},'include':[{'model':db[_0x9481('0x86')],'as':_0x9481('0x87'),'include':[{'model':db[_0x9481('0x75')],'as':_0x9481('0x88'),'where':_0x10a43e,'limit':0x1,'order':[[_0x9481('0x7a'),_0x9481('0x89')]]}]},{'model':db[_0x9481('0x8a')],'as':_0x9481('0x8b')}]});})[_0x9481('0x3a')](handleEntityNotFound(_0x4e0ff1,null))[_0x9481('0x3a')](function(_0x445e9){if(_0x445e9&&_0x445e9[_0x9481('0x87')]){_0xc79c['account']=_0x445e9;_0xc79c['applications']=_0x445e9['Applications'];_0xc79c['list']=_0x445e9['List'];_0xc79c[_0x9481('0x8c')]=_['orderBy'](_0xc79c[_0x9481('0x8c')],[_0x9481('0x8d')],[_0x9481('0x8e')]);if(_0xc79c[_0x9481('0x8f')]['Applications']){delete _0xc79c[_0x9481('0x8f')][_0x9481('0x8b')];}if(_0xc79c[_0x9481('0x8f')][_0x9481('0x87')]&&_0xc79c[_0x9481('0x8f')][_0x9481('0x87')][_0x9481('0x88')][_0x9481('0x5b')]){return _0xc79c[_0x9481('0x8f')]['List']['Contacts'][0x0];}var _0x762cba=_['defaults'](_0xc0443[_0x9481('0x60')],{'firstName':_0xc0443[_0x9481('0x60')][_0x9481('0x7e')],'ListId':_0x445e9[_0x9481('0x7c')]});_0x762cba[_0xc0443[_0x9481('0x60')]['mapKey']]=_0xc0443[_0x9481('0x60')][_0x9481('0x7e')];return db['CmContact']['create'](_0x762cba,{'fields':_0x7d5f0,'raw':!![]});}})[_0x9481('0x3a')](handleEntityNotFound(_0x4e0ff1,null))[_0x9481('0x3a')](function(_0x3cc62d){_0xc79c[_0x9481('0x90')]=_0x3cc62d;if(_0x3cc62d){var _0x7ee854={'ContactId':_0x3cc62d['id'],'OpenchannelAccountId':_0xc0443[_0x9481('0x68')]['id'],'from':(_0x3cc62d[_0x9481('0x91')]||'')+'\x20'+(_0x3cc62d[_0x9481('0x92')]||'')};var _0x14ec8e={'OpenchannelAccountId':_0xc0443[_0x9481('0x68')]['id'],'closed':![]};if(_0xc0443['body'][_0x9481('0x93')]){_0x14ec8e[_0x9481('0x93')]=_0xc0443[_0x9481('0x60')][_0x9481('0x93')];return db[_0x9481('0x94')]['find']({'where':_0x14ec8e})[_0x9481('0x3a')](function(_0x3f45b4){if(_0x3f45b4){return[_0x3f45b4,![]];}_0x7ee854['threadId']=_0xc0443['body'][_0x9481('0x93')];_0x7ee854[_0x9481('0x95')]=_0xc0443['body'][_0x9481('0x95')];return db[_0x9481('0x94')]['create'](_0x7ee854)[_0x9481('0x3a')](function(_0x12a914){return[_0x12a914,!![]];});});}else{_0x14ec8e[_0x9481('0x93')]=null;}_0x14ec8e[_0x9481('0x96')]=_0x3cc62d['id'];return db['OpenchannelInteraction'][_0x9481('0x5d')]({'where':_0x14ec8e})['then'](function(_0x1aa716){if(_0x1aa716){return[_0x1aa716,![]];}return db[_0x9481('0x94')][_0x9481('0x5f')](_0x7ee854)[_0x9481('0x3a')](function(_0x14f0c7){return[_0x14f0c7,!![]];});});}})[_0x9481('0x97')](function(_0x50bb7e,_0x320038){if(_0x50bb7e){_0x11c00f=_0x320038;if(!_0x320038){var _0x14b6a4={'from':(_0xc79c[_0x9481('0x90')]['firstName']||'')+'\x20'+(_0xc79c['contact'][_0x9481('0x92')]||'')};if(_0xc0443['body'][_0x9481('0x93')]&&_0xc0443['body'][_0x9481('0x98')]&&_0xc0443[_0x9481('0x60')]['threadId']!=_0xc0443[_0x9481('0x60')][_0x9481('0x98')]){_0x14b6a4[_0x9481('0x93')]=_0xc0443['body'][_0x9481('0x98')];}return _0x50bb7e[_0x9481('0x38')](_0x14b6a4);}else{return _0x50bb7e;}}})[_0x9481('0x3a')](function(_0x4708ee){_0xc79c[_0x9481('0x99')]=_0x4708ee[_0x9481('0x3b')]({'plain':!![]});_0xc79c[_0x9481('0x99')]['created']=_0x11c00f;if(_0xc79c[_0x9481('0x99')][_0x9481('0x9a')]){if(_0xc79c[_0x9481('0x8f')][_0x9481('0x9b')]){_0xc79c[_0x9481('0x8c')]['push']({'id':0x0,'priority':_0xc79c[_0x9481('0x8c')][_0x9481('0x5b')]+0x1,'app':_0x9481('0x9c'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x9481('0x9d')][_0x9481('0x5f')]({'body':_0xc0443[_0x9481('0x60')][_0x9481('0x60')],'OpenchannelAccountId':_0xc0443[_0x9481('0x68')]['id'],'OpenchannelInteractionId':_0x4708ee['id'],'direction':'in','ContactId':_0xc79c[_0x9481('0x90')]['id'],'AttachmentId':_0xc0443[_0x9481('0x60')][_0x9481('0x9e')]});})[_0x9481('0x3a')](function(_0x2fb5d9){_0xc79c['message']=_0x2fb5d9;if(!_0xc79c[_0x9481('0x99')][_0x9481('0x9f')])return;return db[_0x9481('0xa0')][_0x9481('0x5d')]({'attributes':['id',_0x9481('0x3f')],'where':{'id':_0xc79c[_0x9481('0x99')]['UserId']}});})[_0x9481('0x3a')](function(_0x3f1b8b){if(_0x3f1b8b){_0xc79c['applications'][_0x9481('0xa1')]({'id':0x0,'priority':0x0,'app':_0x9481('0xa2'),'appdata':_0x3f1b8b[_0x9481('0x3f')]+','+(_0xc79c['account'][_0x9481('0xa3')]||0xa),'interval':_0x9481('0xa4')});}if(!_0xc79c[_0x9481('0x99')][_0x9481('0xa5')])return;return db['OpenchannelQueue'][_0x9481('0x5d')]({'attributes':['id',_0x9481('0x3f')],'where':{'id':_0xc79c[_0x9481('0x99')][_0x9481('0xa5')]}});})['then'](function(_0x123152){if(_0x123152){_0xc79c[_0x9481('0x8c')][_0x9481('0xa1')]({'id':0x0,'priority':0x1,'app':_0x9481('0xa6'),'appdata':_0x123152[_0x9481('0x3f')]+','+(_0xc79c[_0x9481('0x8f')][_0x9481('0xa7')]||0x12c),'interval':_0x9481('0xa4')});}return respondWithRpcPromise(_0x9481('0xa8'),_0x9481('0xa9'),_0xc79c);})['then'](function(_0x42b001){respondWithRpcPromise(_0x9481('0xaa'),_0x9481('0xaa'),{'event':'notify','message':_0x42b001},client9002);return _0x42b001;})[_0x9481('0x3a')](respondWithResult(_0x4e0ff1,null))[_0x9481('0x5e')](handleError(_0x4e0ff1,null));};exports['addApplications']=function(_0x42c2ea,_0x48a539){var _0x55130c=_0x42c2ea[_0x9481('0x68')]['id'];var _0x1de343=_0x42c2ea[_0x9481('0x60')];var _0x5b293e=0xc8;var _0x297a46=null;return db[_0x9481('0xab')][_0x9481('0xac')]({'isolationLevel':db['sequelize'][_0x9481('0xad')][_0x9481('0xae')]['READ_COMMITTED']},function(_0x5e7b01){return db['OpenchannelAccount'][_0x9481('0xaf')]({'where':{'id':_0x55130c},'transaction':_0x5e7b01})[_0x9481('0x3a')](function(_0x46bc7f){if(_0x46bc7f){return db[_0x9481('0x8a')][_0x9481('0x39')]({'where':{'OpenchannelAccountId':_0x55130c},'transaction':_0x5e7b01})['then'](function(){var _0x3c8981=_[_0x9481('0x43')](_0x1de343,function(_0x511ae6){_0x511ae6[_0x9481('0x6d')]=_0x55130c;return _0x511ae6;});return db[_0x9481('0x8a')][_0x9481('0xb0')](_0x3c8981,{'transaction':_0x5e7b01});});}else{_0x5b293e=0x194;_0x297a46=[];}});})[_0x9481('0x3a')](function(){if(_0x5b293e!==0x194){return db[_0x9481('0x8a')][_0x9481('0xb1')]({'where':{'OpenchannelAccountId':_0x55130c},'order':_0x9481('0x8d')})[_0x9481('0x3a')](function(_0x1c8eed){_0x297a46=_0x1c8eed;});}})[_0x9481('0x5e')](function(_0x2e469e){_0x5b293e=0x1f4;logger['error'](_0x2e469e[_0x9481('0x3e')]);if(_0x2e469e[_0x9481('0x3f')]){delete _0x2e469e[_0x9481('0x3f')];}_0x297a46=_0x2e469e;})[_0x9481('0xb2')](function(){if(_0x297a46===null){_0x48a539['sendStatus'](_0x5b293e);}else{if(_0x5b293e===0x1f4){_0x48a539[_0x9481('0x2e')](_0x5b293e)[_0x9481('0xb3')](_0x297a46);}else{_0x48a539[_0x9481('0x2e')](_0x5b293e)['json'](_0x297a46);}}});};exports[_0x9481('0xb4')]=function(_0x3915b6,_0x1c0775,_0x12387b){var _0x3ce835={};var _0xfebf78={};var _0x3ab372;var _0x162b80;return db[_0x9481('0x44')][_0x9481('0xaf')]({'where':{'id':_0x3915b6[_0x9481('0x68')]['id']}})['then'](handleEntityNotFound(_0x1c0775,null))[_0x9481('0x3a')](function(_0x5de592){if(_0x5de592){_0x3ab372=_0x5de592;_0xfebf78[_0x9481('0x48')]=_[_0x9481('0x49')](db[_0x9481('0x8a')]['rawAttributes']);_0xfebf78[_0x9481('0x4a')]=_[_0x9481('0x49')](_0x3915b6[_0x9481('0x4a')]);_0xfebf78[_0x9481('0x53')]=_[_0x9481('0x4b')](_0xfebf78[_0x9481('0x48')],_0xfebf78[_0x9481('0x4a')]);_0x3ce835['attributes']=_[_0x9481('0x4b')](_0xfebf78[_0x9481('0x48')],qs['fields'](_0x3915b6['query'][_0x9481('0x4d')]));_0x3ce835[_0x9481('0x4c')]=_0x3ce835['attributes']['length']?_0x3ce835[_0x9481('0x4c')]:_0xfebf78[_0x9481('0x48')];_0x3ce835[_0x9481('0x4f')]=qs[_0x9481('0x50')](_0x3915b6['query']['sort']);_0x3ce835[_0x9481('0x51')]=qs[_0x9481('0x53')](_[_0x9481('0x52')](_0x3915b6[_0x9481('0x4a')],_0xfebf78[_0x9481('0x53')]));if(_0x3915b6['query'][_0x9481('0x54')]){_0x3ce835[_0x9481('0x51')]=_[_0x9481('0x55')](_0x3ce835['where'],{'$or':_[_0x9481('0x43')](_0x3ce835[_0x9481('0x4c')],function(_0xc513ca){var _0xf31ed8={};_0xf31ed8[_0xc513ca]={'$like':'%'+_0x3915b6[_0x9481('0x4a')][_0x9481('0x54')]+'%'};return _0xf31ed8;})});}_0x3ce835=_[_0x9481('0x55')]({},_0x3ce835,_0x3915b6['options']);return _0x3ab372['getApplications'](_0x3ce835);}})[_0x9481('0x3a')](function(_0x5d3e87){if(_0x5d3e87){_0x162b80=_0x5d3e87[_0x9481('0x5b')];if(!_0x3915b6[_0x9481('0x4a')][_0x9481('0x6c')]('nolimit')){_0x3ce835['limit']=qs[_0x9481('0x30')](_0x3915b6['query'][_0x9481('0x30')]);_0x3ce835[_0x9481('0x2f')]=qs[_0x9481('0x2f')](_0x3915b6['query']['offset']);}return _0x3ab372[_0x9481('0xb4')](_0x3ce835);}})['then'](function(_0x38d22a){if(_0x38d22a){return _0x38d22a?{'count':_0x162b80,'rows':_0x38d22a}:null;}})[_0x9481('0x3a')](respondWithResult(_0x1c0775,null))[_0x9481('0x5e')](handleError(_0x1c0775,null));};exports[_0x9481('0xb5')]=function(_0x3af3d6,_0x3a70b1,_0x257523){var _0x45cbf7={'raw':![],'where':{}};var _0x860909={};var _0x40d557={'count':0x0,'rows':[]};return db[_0x9481('0x44')]['findOne']({'where':{'id':_0x3af3d6[_0x9481('0x68')]['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x3a70b1,null))['then'](function(_0x4f6a83){if(_0x4f6a83){_0x860909[_0x9481('0x48')]=_[_0x9481('0x49')](db[_0x9481('0x94')][_0x9481('0x6b')]);_0x860909['query']=_['keys'](_0x3af3d6['query']);_0x860909[_0x9481('0x53')]=_[_0x9481('0x4b')](_0x860909[_0x9481('0x48')],_0x860909[_0x9481('0x4a')]);_0x45cbf7[_0x9481('0x4c')]=_[_0x9481('0x4b')](_0x860909[_0x9481('0x48')],qs[_0x9481('0x4d')](_0x3af3d6[_0x9481('0x4a')][_0x9481('0x4d')]));_0x45cbf7[_0x9481('0x4c')]=_0x45cbf7[_0x9481('0x4c')]['length']?_0x45cbf7['attributes']:_0x860909[_0x9481('0x48')];if(!_0x3af3d6[_0x9481('0x4a')]['hasOwnProperty']('nolimit')){_0x45cbf7['limit']=qs[_0x9481('0x30')](_0x3af3d6['query'][_0x9481('0x30')]);_0x45cbf7[_0x9481('0x2f')]=qs[_0x9481('0x2f')](_0x3af3d6[_0x9481('0x4a')]['offset']);}_0x45cbf7[_0x9481('0x4f')]=qs[_0x9481('0x50')](_0x3af3d6[_0x9481('0x4a')][_0x9481('0x50')]);_0x45cbf7[_0x9481('0x51')]=qs[_0x9481('0x53')](_['pick'](_0x3af3d6[_0x9481('0x4a')],_0x860909[_0x9481('0x53')]));_0x45cbf7[_0x9481('0x51')][_0x9481('0x6d')]=_0x4f6a83['id'];if(_0x3af3d6[_0x9481('0x4a')][_0x9481('0x54')]){_0x45cbf7[_0x9481('0x51')]=_[_0x9481('0x55')](_0x45cbf7[_0x9481('0x51')],{'$or':_[_0x9481('0x43')](_0x45cbf7[_0x9481('0x4c')],function(_0x5db8d1){var _0x5185b1={};_0x5185b1[_0x5db8d1]={'$like':'%'+_0x3af3d6['query'][_0x9481('0x54')]+'%'};return _0x5185b1;})});}_0x45cbf7=_[_0x9481('0x55')]({},_0x45cbf7,_0x3af3d6['options']);return db[_0x9481('0x94')][_0x9481('0x32')]({'where':_0x45cbf7[_0x9481('0x51')]})[_0x9481('0x3a')](function(_0x2534e9){_0x40d557['count']=_0x2534e9;if(_0x3af3d6[_0x9481('0x4a')][_0x9481('0x56')]){_0x45cbf7[_0x9481('0x57')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x9481('0xa0')],'as':'Owner','attributes':[_0x9481('0x3f'),_0x9481('0xb6'),_0x9481('0xb7')],'required':![]},{'model':db[_0x9481('0xb8')],'as':_0x9481('0xb9'),'attributes':['id',_0x9481('0x3f'),_0x9481('0xba')],'where':_0x3af3d6[_0x9481('0x4a')]['tag']?{'id':_0x3af3d6[_0x9481('0x4a')][_0x9481('0xbb')]}:undefined,'required':_0x3af3d6[_0x9481('0x4a')][_0x9481('0xbb')]?!![]:![]}];}return db[_0x9481('0x94')][_0x9481('0x58')](_0x45cbf7);})[_0x9481('0x3a')](function(_0x281770){_0x40d557[_0x9481('0x59')]=_0x281770;return _0x40d557;});}})[_0x9481('0x3a')](respondWithFilteredResult(_0x3a70b1,_0x45cbf7))[_0x9481('0x5e')](handleError(_0x3a70b1,null));};exports[_0x9481('0xbc')]=function(_0x36125f,_0x1d7c63,_0x543313){return db[_0x9481('0x44')][_0x9481('0x5d')]({'where':{'id':_0x36125f[_0x9481('0x68')]['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x1d7c63,null))[_0x9481('0x3a')](function(_0x10ee06){if(_0x10ee06){return _0x10ee06['addAgents'](_0x36125f[_0x9481('0x60')]['ids'],_['omit'](_0x36125f[_0x9481('0x60')],['ids','id'])||{})[_0x9481('0x97')](function(_0x29bbdc){for(var _0x22a434=0x0;_0x22a434<_0x36125f[_0x9481('0x60')][_0x9481('0x6e')][_0x9481('0x5b')];_0x22a434+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x36125f[_0x9481('0x60')][_0x9481('0x6e')][_0x22a434]),'OpenchannelAccountId':Number(_0x36125f[_0x9481('0x68')]['id'])});}return _0x29bbdc;});}})[_0x9481('0x3a')](respondWithResult(_0x1d7c63,null))[_0x9481('0x5e')](handleError(_0x1d7c63,null));};exports[_0x9481('0xbd')]=function(_0x410571,_0x8b44ec,_0x5d739f){return db['OpenchannelAccount'][_0x9481('0x5d')]({'where':{'id':_0x410571[_0x9481('0x68')]['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x8b44ec,null))[_0x9481('0x3a')](function(_0x34e06b){if(_0x34e06b){return _0x34e06b[_0x9481('0xbd')](_0x410571[_0x9481('0x4a')][_0x9481('0x6e')])[_0x9481('0x3a')](function(){if(_[_0x9481('0xbe')](_0x410571[_0x9481('0x4a')][_0x9481('0x6e')])){for(var _0x45c550=0x0;_0x45c550<_0x410571['query'][_0x9481('0x6e')][_0x9481('0x5b')];_0x45c550+=0x1){socket[_0x9481('0xbf')](_0x9481('0xc0'),{'UserId':Number(_0x410571['query'][_0x9481('0x6e')][_0x45c550]),'OpenchannelAccountId':Number(_0x410571[_0x9481('0x68')]['id'])});}}else{socket[_0x9481('0xbf')](_0x9481('0xc0'),{'UserId':Number(_0x410571[_0x9481('0x4a')][_0x9481('0x6e')]),'OpenchannelAccountId':Number(_0x410571[_0x9481('0x68')]['id'])});}});}})[_0x9481('0x3a')](respondWithStatusCode(_0x8b44ec,null))[_0x9481('0x5e')](handleError(_0x8b44ec,null));};exports['getAgents']=function(_0x378cd5,_0x142957,_0x1dfb2e){var _0x1dc153={};var _0x259aec={};var _0x5dcaa4;var _0x55c660;return db['OpenchannelAccount'][_0x9481('0xaf')]({'where':{'id':_0x378cd5[_0x9481('0x68')]['id']}})['then'](handleEntityNotFound(_0x142957,null))[_0x9481('0x3a')](function(_0x44c064){if(_0x44c064){_0x5dcaa4=_0x44c064;_0x259aec[_0x9481('0x48')]=_[_0x9481('0x49')](db[_0x9481('0xa0')][_0x9481('0x6b')]);_0x259aec[_0x9481('0x4a')]=_[_0x9481('0x49')](_0x378cd5[_0x9481('0x4a')]);_0x259aec[_0x9481('0x53')]=_[_0x9481('0x4b')](_0x259aec[_0x9481('0x48')],_0x259aec[_0x9481('0x4a')]);_0x1dc153[_0x9481('0x4c')]=_[_0x9481('0x4b')](_0x259aec['model'],qs['fields'](_0x378cd5[_0x9481('0x4a')]['fields']));_0x1dc153['attributes']=_0x1dc153[_0x9481('0x4c')]['length']?_0x1dc153['attributes']:_0x259aec[_0x9481('0x48')];_0x1dc153[_0x9481('0x4f')]=qs[_0x9481('0x50')](_0x378cd5['query'][_0x9481('0x50')]);_0x1dc153[_0x9481('0x51')]=qs[_0x9481('0x53')](_['pick'](_0x378cd5[_0x9481('0x4a')],_0x259aec[_0x9481('0x53')]));if(_0x378cd5['query'][_0x9481('0x54')]){_0x1dc153[_0x9481('0x51')]=_[_0x9481('0x55')](_0x1dc153[_0x9481('0x51')],{'$or':_[_0x9481('0x43')](_0x1dc153[_0x9481('0x4c')],function(_0x160353){var _0x32423b={};_0x32423b[_0x160353]={'$like':'%'+_0x378cd5[_0x9481('0x4a')][_0x9481('0x54')]+'%'};return _0x32423b;})});}_0x1dc153=_[_0x9481('0x55')]({},_0x1dc153,_0x378cd5[_0x9481('0x5c')]);return _0x5dcaa4[_0x9481('0xc1')](_0x1dc153);}})[_0x9481('0x3a')](function(_0x5358f2){if(_0x5358f2){_0x55c660=_0x5358f2[_0x9481('0x5b')];if(!_0x378cd5[_0x9481('0x4a')][_0x9481('0x6c')](_0x9481('0x4e'))){_0x1dc153[_0x9481('0x30')]=qs[_0x9481('0x30')](_0x378cd5[_0x9481('0x4a')][_0x9481('0x30')]);_0x1dc153[_0x9481('0x2f')]=qs['offset'](_0x378cd5['query']['offset']);}return _0x5dcaa4[_0x9481('0xc1')](_0x1dc153);}})[_0x9481('0x3a')](function(_0x3181a5){if(_0x3181a5){return _0x3181a5?{'count':_0x55c660,'rows':_0x3181a5}:null;}})[_0x9481('0x3a')](respondWithResult(_0x142957,null))[_0x9481('0x5e')](handleError(_0x142957,null));};exports[_0x9481('0xb3')]=function(_0x139c51,_0x18ce9e,_0x3d7528){var _0x2d5825,_0x4806ea,_0x467705;if(_['isNil'](_0x139c51[_0x9481('0x60')][_0x9481('0x60')])||_0x139c51[_0x9481('0x60')][_0x9481('0x60')]===''){throw new db[(_0x9481('0x76'))][(_0x9481('0x7f'))](_0x9481('0x81'));}if(_[_0x9481('0x7d')](_0x139c51[_0x9481('0x60')]['to'])){}_0x2d5825=_0x139c51['body']['to'];return db[_0x9481('0x44')]['findOne']({'where':{'id':_0x139c51[_0x9481('0x68')]['id']}})[_0x9481('0x3a')](handleEntityNotFound(_0x18ce9e,null))['then'](function(_0x52bf7e){if(_0x52bf7e){return db[_0x9481('0x44')][_0x9481('0x5d')]({'where':{'id':_0x52bf7e['id']},'include':[{'model':db[_0x9481('0x86')],'as':'List','include':[{'model':db[_0x9481('0x75')],'as':_0x9481('0x88'),'where':{[_0x52bf7e[_0x9481('0x82')]]:_0x2d5825},'limit':0x1,'order':[[_0x9481('0x7a'),_0x9481('0x89')]]}]}]})['then'](handleEntityNotFound(_0x18ce9e,null))[_0x9481('0x3a')](function(_0x2280d5){if(_0x2280d5&&_0x2280d5[_0x9481('0x87')]){_0x4806ea=_0x2280d5['get']({'plain':!![]});if(_0x4806ea['List']&&_0x4806ea['List'][_0x9481('0x88')][_0x9481('0x5b')]){return _0x4806ea[_0x9481('0x87')][_0x9481('0x88')][0x0];}return db['CmContact'][_0x9481('0x5f')](_[_0x9481('0xc2')](_0x139c51[_0x9481('0x60')],{'firstName':_0x2d5825,[_0x2280d5[_0x9481('0x82')]]:_0x2d5825,'phone':_0x2d5825,'ListId':_0x4806ea[_0x9481('0x7c')]}));}})[_0x9481('0x3a')](handleEntityNotFound(_0x18ce9e,null))[_0x9481('0x3a')](function(_0x226635){if(_0x226635){_0x467705=_0x226635;return db[_0x9481('0x94')][_0x9481('0x5d')]({'where':{'ContactId':_0x467705['id'],'closed':![],'OpenchannelAccountId':_0x4806ea['id']}})[_0x9481('0x3a')](function(_0x5bc334){if(_0x5bc334){return[_0x5bc334,![]];}return db[_0x9481('0x94')][_0x9481('0x5f')]({'UserId':_0x139c51[_0x9481('0xc3')]['id'],'ContactId':_0x467705['id'],'OpenchannelAccountId':_0x4806ea['id'],'lastMsgDirection':_0x9481('0xc4'),'firstMsgDirection':'out','Messages':[_[_0x9481('0x55')](_0x139c51['body'],{'read':![],'body':_0x139c51['body'][_0x9481('0x60')],'OpenchannelAccountId':_0x4806ea['id'],'UserId':_0x139c51[_0x9481('0xc3')]['id'],'ContactId':_0x467705['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x9481('0xc5')}]})['then'](function(_0x2ab377){return[_0x2ab377,!![]];});});}})['spread'](function(_0x3e8b79,_0x5ba3c2){if(_0x5ba3c2){return _0x3e8b79;}return db['OpenchannelMessage'][_0x9481('0x5f')](_['merge'](_0x139c51[_0x9481('0x60')],{'read':![],'body':_0x139c51[_0x9481('0x60')][_0x9481('0x60')],'OpenchannelAccountId':_0x4806ea['id'],'OpenchannelInteractionId':_0x3e8b79['id'],'UserId':_0x139c51[_0x9481('0xc3')]['id'],'ContactId':_0x467705['id']}))['then'](function(_0x2cf7c2){_0x3e8b79[_0x9481('0xc6')][_0x9481('0xc5')]=[];_0x3e8b79[_0x9481('0xc6')][_0x9481('0xc5')][_0x9481('0xc7')](_0x2cf7c2['dataValues']);return _0x3e8b79;});});}})[_0x9481('0x3a')](respondWithResult(_0x18ce9e,null))[_0x9481('0x5e')](handleError(_0x18ce9e,null));}; \ No newline at end of file +var _0x1c9c=['defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','map','OpenchannelAccount','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','mandatoryDispositionPause','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','pick','include','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','asc','ListId','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','firstName','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','waitForTheAssignedAgent','OpenchannelQueue','queueId','waitForTheAssignedQueue','startRouting','EventManager','sequelize','transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','priority','finally','getApplications','nolimit','order','Contact','Owner','internal','Tags','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','push','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x1c9c,0xa7));var _0xc1c9=function(_0xb4e052,_0x1d3cb6){_0xb4e052=_0xb4e052-0x0;var _0x5197e7=_0x1c9c[_0xb4e052];return _0x5197e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1c9('0x0'));var zipdir=require(_0xc1c9('0x1'));var jsonpatch=require(_0xc1c9('0x2'));var rp=require(_0xc1c9('0x3'));var moment=require('moment');var BPromise=require(_0xc1c9('0x4'));var Mustache=require(_0xc1c9('0x5'));var util=require(_0xc1c9('0x6'));var path=require(_0xc1c9('0x7'));var sox=require(_0xc1c9('0x8'));var csv=require(_0xc1c9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1c9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc1c9('0xb'));var jsforce=require(_0xc1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1c9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc1c9('0xd'));var authService=require(_0xc1c9('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1c9('0xf'));var logger=require(_0xc1c9('0x10'))(_0xc1c9('0x11'));var utils=require(_0xc1c9('0x12'));var config=require(_0xc1c9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c9('0x14'))['db'];config['redis']=_[_0xc1c9('0x15')](config[_0xc1c9('0x16')],{'host':_0xc1c9('0x17'),'port':0x18eb});var socket=require(_0xc1c9('0x18'))(new Redis(config[_0xc1c9('0x16')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xc1c9('0x19'));var client=jayson[_0xc1c9('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0xc1c9('0x1a')][_0xc1c9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1abd7a,_0x3a0947,_0x35a90a,_0x12f51a){return new BPromise(function(_0x3bc28c,_0x507ea4){var _0xe29a5a=_0x12f51a||client;return _0xe29a5a[_0xc1c9('0x1c')](_0x1abd7a,_0x35a90a)[_0xc1c9('0x1d')](function(_0x504351){logger[_0xc1c9('0x1e')](_0xc1c9('0x1f'),_0x3a0947,_0xc1c9('0x20'));logger[_0xc1c9('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3a0947,_0xc1c9('0x20'),JSON[_0xc1c9('0x22')](_0x504351));if(_0x504351[_0xc1c9('0x23')]){if(_0x504351[_0xc1c9('0x23')][_0xc1c9('0x24')]===0x1f4){logger[_0xc1c9('0x23')](_0xc1c9('0x1f'),_0x3a0947,_0x504351['error'][_0xc1c9('0x25')]);return _0x507ea4(_0x504351[_0xc1c9('0x23')]['message']);}logger[_0xc1c9('0x23')](_0xc1c9('0x1f'),_0x3a0947,_0x504351[_0xc1c9('0x23')][_0xc1c9('0x25')]);return _0x3bc28c(_0x504351[_0xc1c9('0x23')][_0xc1c9('0x25')]);}else{logger[_0xc1c9('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x3a0947,'request\x20sent');_0x3bc28c(_0x504351['result'][_0xc1c9('0x25')]);}})[_0xc1c9('0x26')](function(_0x517381){logger[_0xc1c9('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x3a0947,_0x517381);_0x507ea4(_0x517381);});});}function respondWithStatusCode(_0x1571e4,_0x3fbc2c){_0x3fbc2c=_0x3fbc2c||0xcc;return function(_0x5622b2){if(_0x5622b2){return _0x1571e4[_0xc1c9('0x27')](_0x3fbc2c);}return _0x1571e4['status'](_0x3fbc2c)[_0xc1c9('0x28')]();};}function respondWithResult(_0x2bf744,_0x460e1c){_0x460e1c=_0x460e1c||0xc8;return function(_0x357671){if(_0x357671){return _0x2bf744[_0xc1c9('0x29')](_0x460e1c)[_0xc1c9('0x2a')](_0x357671);}};}function respondWithFilteredResult(_0x367559,_0x39e875){return function(_0x472a5b){if(_0x472a5b){var _0x1c261b=typeof _0x39e875[_0xc1c9('0x2b')]===_0xc1c9('0x2c')&&typeof _0x39e875[_0xc1c9('0x2d')]==='undefined';var _0x46b6b7=_0x472a5b[_0xc1c9('0x2e')];var _0x31a2d9=_0x1c261b?0x0:_0x39e875['offset'];var _0x2d6b20=_0x1c261b?_0x472a5b[_0xc1c9('0x2e')]:_0x39e875[_0xc1c9('0x2b')]+_0x39e875['limit'];var _0x5335c3;if(_0x2d6b20>=_0x46b6b7){_0x2d6b20=_0x46b6b7;_0x5335c3=0xc8;}else{_0x5335c3=0xce;}_0x367559['status'](_0x5335c3);return _0x367559['set'](_0xc1c9('0x2f'),_0x31a2d9+'-'+_0x2d6b20+'/'+_0x46b6b7)[_0xc1c9('0x2a')](_0x472a5b);}return null;};}function patchUpdates(_0x5d70bf){return function(_0x47b3b5){try{jsonpatch[_0xc1c9('0x30')](_0x47b3b5,_0x5d70bf,!![]);}catch(_0x34424d){return BPromise['reject'](_0x34424d);}return _0x47b3b5[_0xc1c9('0x31')]();};}function saveUpdates(_0x38bcfe,_0x4d70cd){return function(_0x484449){if(_0x484449){return _0x484449[_0xc1c9('0x32')](_0x38bcfe)['then'](function(_0xa75f02){return _0xa75f02;});}return null;};}function removeEntity(_0x2252b9,_0x5e6c78){return function(_0x4efe3d){if(_0x4efe3d){return _0x4efe3d[_0xc1c9('0x33')]()['then'](function(){var _0x43b4a2=_0x4efe3d['get']({'plain':!![]});var _0x4622cc=_0xc1c9('0x34');return db[_0xc1c9('0x35')][_0xc1c9('0x33')]({'where':{'type':_0x4622cc,'resourceId':_0x43b4a2['id']}})['then'](function(){return _0x4efe3d;});})[_0xc1c9('0x1d')](function(){_0x2252b9[_0xc1c9('0x29')](0xcc)[_0xc1c9('0x28')]();});}};}function handleEntityNotFound(_0x3e0485,_0x255967){return function(_0x583075){if(!_0x583075){_0x3e0485['sendStatus'](0x194);}return _0x583075;};}function handleError(_0x454db5,_0x1c1674){_0x1c1674=_0x1c1674||0x1f4;return function(_0x592ca6){logger[_0xc1c9('0x23')](_0x592ca6[_0xc1c9('0x36')]);if(_0x592ca6[_0xc1c9('0x37')]){delete _0x592ca6[_0xc1c9('0x37')];}_0x454db5[_0xc1c9('0x29')](_0x1c1674)[_0xc1c9('0x38')](_0x592ca6);};}exports[_0xc1c9('0x39')]=function(_0x5ab2fd,_0x142cb8){var _0x19e806={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1e4e9f={},_0x2bcf85={'count':0x0,'rows':[]};var _0x144dfd=_[_0xc1c9('0x3a')](db[_0xc1c9('0x3b')][_0xc1c9('0x3c')],function(_0x4de169){return{'name':_0x4de169[_0xc1c9('0x3d')],'type':_0x4de169[_0xc1c9('0x3e')][_0xc1c9('0x3f')]};});_0x1e4e9f['model']=_['map'](_0x144dfd,'name');_0x1e4e9f['query']=_[_0xc1c9('0x40')](_0x5ab2fd[_0xc1c9('0x41')]);_0x1e4e9f[_0xc1c9('0x42')]=_['intersection'](_0x1e4e9f[_0xc1c9('0x43')],_0x1e4e9f[_0xc1c9('0x41')]);_0x19e806[_0xc1c9('0x44')]=_[_0xc1c9('0x45')](_0x1e4e9f[_0xc1c9('0x43')],qs[_0xc1c9('0x46')](_0x5ab2fd[_0xc1c9('0x41')]['fields']));_0x19e806[_0xc1c9('0x44')]=_0x19e806[_0xc1c9('0x44')][_0xc1c9('0x47')]?_0x19e806[_0xc1c9('0x44')]:_0x1e4e9f[_0xc1c9('0x43')];if(!_0x5ab2fd['query'][_0xc1c9('0x48')]('nolimit')){_0x19e806[_0xc1c9('0x2d')]=qs[_0xc1c9('0x2d')](_0x5ab2fd[_0xc1c9('0x41')][_0xc1c9('0x2d')]);_0x19e806[_0xc1c9('0x2b')]=qs[_0xc1c9('0x2b')](_0x5ab2fd[_0xc1c9('0x41')][_0xc1c9('0x2b')]);}_0x19e806['order']=qs[_0xc1c9('0x49')](_0x5ab2fd['query'][_0xc1c9('0x49')]);_0x19e806[_0xc1c9('0x4a')]=qs[_0xc1c9('0x42')](_['pick'](_0x5ab2fd[_0xc1c9('0x41')],_0x1e4e9f[_0xc1c9('0x42')]),_0x144dfd);if(_0x5ab2fd['query'][_0xc1c9('0x4b')]){_0x19e806[_0xc1c9('0x4a')]=_[_0xc1c9('0x4c')](_0x19e806[_0xc1c9('0x4a')],{'$or':_[_0xc1c9('0x3a')](_0x144dfd,function(_0xb0ca14){if(_0xb0ca14[_0xc1c9('0x3e')]!==_0xc1c9('0x4d')){var _0x3a9b24={};_0x3a9b24[_0xb0ca14[_0xc1c9('0x37')]]={'$like':'%'+_0x5ab2fd[_0xc1c9('0x41')][_0xc1c9('0x4b')]+'%'};return _0x3a9b24;}})});}_0x19e806=_[_0xc1c9('0x4c')]({},_0x19e806,_0x5ab2fd[_0xc1c9('0x4e')]);var _0x39d5e1={'where':_0x19e806[_0xc1c9('0x4a')]};return db[_0xc1c9('0x3b')]['count'](_0x39d5e1)[_0xc1c9('0x1d')](function(_0x35ed42){_0x2bcf85['count']=_0x35ed42;if(_0x5ab2fd['query'][_0xc1c9('0x4f')]){_0x19e806['include']=[{'all':!![]}];}return db[_0xc1c9('0x3b')][_0xc1c9('0x50')](_0x19e806);})[_0xc1c9('0x1d')](function(_0x4c2075){_0x2bcf85[_0xc1c9('0x51')]=_0x4c2075;return _0x2bcf85;})[_0xc1c9('0x1d')](respondWithFilteredResult(_0x142cb8,_0x19e806))[_0xc1c9('0x26')](handleError(_0x142cb8,null));};exports['show']=function(_0x3d3b61,_0x428b1c){var _0x46ac67={'raw':![],'where':{'id':_0x3d3b61[_0xc1c9('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0xc1c9('0x53')}]},_0x47cc22={};_0x47cc22['model']=_[_0xc1c9('0x40')](db[_0xc1c9('0x3b')][_0xc1c9('0x3c')]);_0x47cc22[_0xc1c9('0x41')]=_[_0xc1c9('0x40')](_0x3d3b61[_0xc1c9('0x41')]);_0x47cc22[_0xc1c9('0x42')]=_[_0xc1c9('0x45')](_0x47cc22['model'],_0x47cc22[_0xc1c9('0x41')]);_0x46ac67[_0xc1c9('0x44')]=_[_0xc1c9('0x45')](_0x47cc22[_0xc1c9('0x43')],qs[_0xc1c9('0x46')](_0x3d3b61[_0xc1c9('0x41')]['fields']));_0x46ac67[_0xc1c9('0x44')]=_0x46ac67['attributes']['length']?_0x46ac67[_0xc1c9('0x44')]:_0x47cc22[_0xc1c9('0x43')];if(_0x3d3b61[_0xc1c9('0x41')][_0xc1c9('0x4f')]){_0x46ac67['include']=[{'all':!![]}];}_0x46ac67=_[_0xc1c9('0x4c')]({},_0x46ac67,_0x3d3b61[_0xc1c9('0x4e')]);return db[_0xc1c9('0x3b')][_0xc1c9('0x54')](_0x46ac67)[_0xc1c9('0x1d')](handleEntityNotFound(_0x428b1c,null))['then'](respondWithResult(_0x428b1c,null))[_0xc1c9('0x26')](handleError(_0x428b1c,null));};exports['create']=function(_0x29365a,_0x2d1cd5){return db[_0xc1c9('0x3b')][_0xc1c9('0x55')](_0x29365a[_0xc1c9('0x56')],{})['then'](function(_0x42fa4f){var _0x54196b=_0x29365a['user'][_0xc1c9('0x57')]({'plain':!![]});if(!_0x54196b)throw new Error(_0xc1c9('0x58'));if(_0x54196b[_0xc1c9('0x59')]===_0xc1c9('0x5a')){var _0x3724f4=_0x42fa4f[_0xc1c9('0x57')]({'plain':!![]});var _0x59b6f0=_0xc1c9('0x34');return db[_0xc1c9('0x5b')][_0xc1c9('0x54')]({'where':{'name':_0x59b6f0,'userProfileId':_0x54196b[_0xc1c9('0x5c')]},'raw':!![]})[_0xc1c9('0x1d')](function(_0x34bc75){if(_0x34bc75&&_0x34bc75['autoAssociation']===0x0){return db[_0xc1c9('0x35')][_0xc1c9('0x55')]({'name':_0x3724f4[_0xc1c9('0x37')],'resourceId':_0x3724f4['id'],'type':_0x34bc75[_0xc1c9('0x37')],'sectionId':_0x34bc75['id']},{})['then'](function(){return _0x42fa4f;});}else{return _0x42fa4f;}})[_0xc1c9('0x26')](function(_0x58255b){logger[_0xc1c9('0x23')](_0xc1c9('0x5d'),_0x58255b);throw _0x58255b;});}return _0x42fa4f;})[_0xc1c9('0x1d')](respondWithResult(_0x2d1cd5,0xc9))['catch'](handleError(_0x2d1cd5,null));};exports[_0xc1c9('0x32')]=function(_0xc765d6,_0x534437){if(_0xc765d6['body']['id']){delete _0xc765d6[_0xc1c9('0x56')]['id'];}return db[_0xc1c9('0x3b')][_0xc1c9('0x54')]({'where':{'id':_0xc765d6['params']['id']},'include':[{'model':db[_0xc1c9('0x5e')],'as':_0xc1c9('0x53')}]})['then'](handleEntityNotFound(_0x534437,null))[_0xc1c9('0x1d')](saveUpdates(_0xc765d6['body'],null))[_0xc1c9('0x1d')](respondWithResult(_0x534437,null))['catch'](handleError(_0x534437,null));};exports[_0xc1c9('0x33')]=function(_0x306e0e,_0x367f14){return db[_0xc1c9('0x3b')][_0xc1c9('0x54')]({'where':{'id':_0x306e0e[_0xc1c9('0x52')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x367f14,null))['then'](removeEntity(_0x367f14,null))[_0xc1c9('0x26')](handleError(_0x367f14,null));};exports[_0xc1c9('0x5f')]=function(_0x12f082,_0x5184f4){return db[_0xc1c9('0x3b')][_0xc1c9('0x5f')]()[_0xc1c9('0x1d')](respondWithResult(_0x5184f4,null))[_0xc1c9('0x26')](handleError(_0x5184f4,null));};exports[_0xc1c9('0x60')]=function(_0x1fc33a,_0x56648d,_0xc30951){if(_0x1fc33a[_0xc1c9('0x56')]['id']){delete _0x1fc33a[_0xc1c9('0x56')]['id'];}return db[_0xc1c9('0x3b')][_0xc1c9('0x54')]({'where':{'id':_0x1fc33a['params']['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x56648d,null))[_0xc1c9('0x1d')](function(_0x48a28e){if(_0x48a28e){_0x1fc33a[_0xc1c9('0x56')][_0xc1c9('0x61')]=_0x48a28e['id'];return db[_0xc1c9('0x62')]['create'](_0x1fc33a['body']);}})[_0xc1c9('0x1d')](respondWithResult(_0x56648d,null))[_0xc1c9('0x26')](handleError(_0x56648d,null));};exports[_0xc1c9('0x63')]=function(_0x161192,_0x4831b3,_0x5ac05a){var _0x4dc64d={'raw':![],'where':{}};var _0x37a8f4={};var _0x2388e8={'count':0x0,'rows':[]};return db[_0xc1c9('0x3b')][_0xc1c9('0x64')]({'where':{'id':_0x161192[_0xc1c9('0x52')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x4831b3,null))['then'](function(_0x11afdb){if(_0x11afdb){_0x37a8f4[_0xc1c9('0x43')]=_[_0xc1c9('0x40')](db[_0xc1c9('0x62')][_0xc1c9('0x3c')]);_0x37a8f4[_0xc1c9('0x41')]=_[_0xc1c9('0x40')](_0x161192['query']);_0x37a8f4[_0xc1c9('0x42')]=_['intersection'](_0x37a8f4['model'],_0x37a8f4[_0xc1c9('0x41')]);_0x4dc64d[_0xc1c9('0x44')]=_[_0xc1c9('0x45')](_0x37a8f4[_0xc1c9('0x43')],qs['fields'](_0x161192[_0xc1c9('0x41')][_0xc1c9('0x46')]));_0x4dc64d[_0xc1c9('0x44')]=_0x4dc64d[_0xc1c9('0x44')][_0xc1c9('0x47')]?_0x4dc64d[_0xc1c9('0x44')]:_0x37a8f4['model'];if(!_0x161192['query'][_0xc1c9('0x48')]('nolimit')){_0x4dc64d['limit']=qs[_0xc1c9('0x2d')](_0x161192[_0xc1c9('0x41')][_0xc1c9('0x2d')]);_0x4dc64d[_0xc1c9('0x2b')]=qs[_0xc1c9('0x2b')](_0x161192[_0xc1c9('0x41')][_0xc1c9('0x2b')]);}_0x4dc64d['order']=qs[_0xc1c9('0x49')](_0x161192['query'][_0xc1c9('0x49')]);_0x4dc64d[_0xc1c9('0x4a')]=qs[_0xc1c9('0x42')](_[_0xc1c9('0x65')](_0x161192[_0xc1c9('0x41')],_0x37a8f4[_0xc1c9('0x42')]));_0x4dc64d[_0xc1c9('0x4a')][_0xc1c9('0x61')]=_0x11afdb['id'];if(_0x161192[_0xc1c9('0x41')][_0xc1c9('0x4b')]){_0x4dc64d[_0xc1c9('0x4a')]=_[_0xc1c9('0x4c')](_0x4dc64d[_0xc1c9('0x4a')],{'$or':_[_0xc1c9('0x3a')](_0x4dc64d[_0xc1c9('0x44')],function(_0x6f467e){var _0x5aeefd={};_0x5aeefd[_0x6f467e]={'$like':'%'+_0x161192[_0xc1c9('0x41')]['filter']+'%'};return _0x5aeefd;})});}_0x4dc64d=_[_0xc1c9('0x4c')]({},_0x4dc64d,_0x161192[_0xc1c9('0x4e')]);return db['Disposition'][_0xc1c9('0x2e')]({'where':_0x4dc64d[_0xc1c9('0x4a')]})[_0xc1c9('0x1d')](function(_0x1f0c74){_0x2388e8[_0xc1c9('0x2e')]=_0x1f0c74;if(_0x161192[_0xc1c9('0x41')][_0xc1c9('0x4f')]){_0x4dc64d[_0xc1c9('0x66')]=[{'all':!![]}];}return db['Disposition'][_0xc1c9('0x50')](_0x4dc64d);})[_0xc1c9('0x1d')](function(_0x1ed3d0){_0x2388e8[_0xc1c9('0x51')]=_0x1ed3d0;return _0x2388e8;});}})[_0xc1c9('0x1d')](respondWithFilteredResult(_0x4831b3,_0x4dc64d))[_0xc1c9('0x26')](handleError(_0x4831b3,null));};exports['removeDispositions']=function(_0x15de9d,_0xbfa3f9,_0x3df674){return db['OpenchannelAccount'][_0xc1c9('0x54')]({'where':{'id':_0x15de9d[_0xc1c9('0x52')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0xbfa3f9,null))[_0xc1c9('0x1d')](function(_0x19a8fd){if(_0x19a8fd){return _0x19a8fd[_0xc1c9('0x67')](_0x15de9d[_0xc1c9('0x41')]['ids']);}})['then'](respondWithStatusCode(_0xbfa3f9,null))[_0xc1c9('0x26')](handleError(_0xbfa3f9,null));};exports[_0xc1c9('0x68')]=function(_0x50a400,_0x82397,_0x11d19f){if(_0x50a400['body']['id']){delete _0x50a400[_0xc1c9('0x56')]['id'];}return db[_0xc1c9('0x3b')][_0xc1c9('0x54')]({'where':{'id':_0x50a400[_0xc1c9('0x52')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x82397,null))['then'](function(_0x124328){if(_0x124328){_0x50a400['body'][_0xc1c9('0x61')]=_0x124328['id'];return db[_0xc1c9('0x69')][_0xc1c9('0x55')](_0x50a400[_0xc1c9('0x56')]);}})['then'](respondWithResult(_0x82397,null))[_0xc1c9('0x26')](handleError(_0x82397,null));};exports[_0xc1c9('0x6a')]=function(_0x242a67,_0x3cdb96,_0x2f29ee){var _0x1ce6b0={'raw':![],'where':{}};var _0x2766e4={};var _0x469208={'count':0x0,'rows':[]};return db[_0xc1c9('0x3b')][_0xc1c9('0x64')]({'where':{'id':_0x242a67['params']['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x3cdb96,null))[_0xc1c9('0x1d')](function(_0xa4471b){if(_0xa4471b){_0x2766e4[_0xc1c9('0x43')]=_[_0xc1c9('0x40')](db['CannedAnswer'][_0xc1c9('0x3c')]);_0x2766e4['query']=_['keys'](_0x242a67['query']);_0x2766e4[_0xc1c9('0x42')]=_[_0xc1c9('0x45')](_0x2766e4[_0xc1c9('0x43')],_0x2766e4[_0xc1c9('0x41')]);_0x1ce6b0['attributes']=_[_0xc1c9('0x45')](_0x2766e4[_0xc1c9('0x43')],qs['fields'](_0x242a67[_0xc1c9('0x41')][_0xc1c9('0x46')]));_0x1ce6b0['attributes']=_0x1ce6b0[_0xc1c9('0x44')]['length']?_0x1ce6b0[_0xc1c9('0x44')]:_0x2766e4[_0xc1c9('0x43')];if(!_0x242a67[_0xc1c9('0x41')]['hasOwnProperty']('nolimit')){_0x1ce6b0[_0xc1c9('0x2d')]=qs['limit'](_0x242a67[_0xc1c9('0x41')][_0xc1c9('0x2d')]);_0x1ce6b0[_0xc1c9('0x2b')]=qs[_0xc1c9('0x2b')](_0x242a67['query'][_0xc1c9('0x2b')]);}_0x1ce6b0['order']=qs['sort'](_0x242a67[_0xc1c9('0x41')]['sort']);_0x1ce6b0[_0xc1c9('0x4a')]=qs[_0xc1c9('0x42')](_['pick'](_0x242a67['query'],_0x2766e4['filters']));_0x1ce6b0['where']['OpenchannelAccountId']=_0xa4471b['id'];if(_0x242a67[_0xc1c9('0x41')][_0xc1c9('0x4b')]){_0x1ce6b0[_0xc1c9('0x4a')]=_[_0xc1c9('0x4c')](_0x1ce6b0[_0xc1c9('0x4a')],{'$or':_['map'](_0x1ce6b0[_0xc1c9('0x44')],function(_0x1b285e){var _0x2d1fd4={};_0x2d1fd4[_0x1b285e]={'$like':'%'+_0x242a67['query'][_0xc1c9('0x4b')]+'%'};return _0x2d1fd4;})});}_0x1ce6b0=_[_0xc1c9('0x4c')]({},_0x1ce6b0,_0x242a67[_0xc1c9('0x4e')]);return db['CannedAnswer'][_0xc1c9('0x2e')]({'where':_0x1ce6b0[_0xc1c9('0x4a')]})['then'](function(_0x528da1){_0x469208['count']=_0x528da1;if(_0x242a67[_0xc1c9('0x41')][_0xc1c9('0x4f')]){_0x1ce6b0[_0xc1c9('0x66')]=[{'all':!![]}];}return db[_0xc1c9('0x69')][_0xc1c9('0x50')](_0x1ce6b0);})[_0xc1c9('0x1d')](function(_0x58b672){_0x469208[_0xc1c9('0x51')]=_0x58b672;return _0x469208;});}})[_0xc1c9('0x1d')](respondWithFilteredResult(_0x3cdb96,_0x1ce6b0))[_0xc1c9('0x26')](handleError(_0x3cdb96,null));};exports['removeAnswers']=function(_0x50fb52,_0x2fadd7,_0x480793){return db[_0xc1c9('0x3b')][_0xc1c9('0x54')]({'where':{'id':_0x50fb52['params']['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x2fadd7,null))[_0xc1c9('0x1d')](function(_0x14765a){if(_0x14765a){return _0x14765a[_0xc1c9('0x6b')](_0x50fb52[_0xc1c9('0x41')]['ids']);}})[_0xc1c9('0x1d')](respondWithStatusCode(_0x2fadd7,null))[_0xc1c9('0x26')](handleError(_0x2fadd7,null));};exports[_0xc1c9('0x6c')]=function(_0x14b67b,_0x2b2cab,_0x5b1e7f){var _0x249c41={'body':_0x14b67b['body'],'channel':_0xc1c9('0x6d')};var _0x2f7f10=[];var _0x14a978=[];var _0x498e60={};var _0xea974f=![];return db['CmContact']['describe']()['then'](function(_0x18c3d5){if(!_0x18c3d5){throw new db[(_0xc1c9('0x6e'))][(_0xc1c9('0x6f'))](_0xc1c9('0x70'));}_0x2f7f10=_['difference'](_['keys'](_0x18c3d5),[_0xc1c9('0x71'),'updatedAt']);_0x14a978=_[_0xc1c9('0x72')](_[_0xc1c9('0x40')](_0x18c3d5),['createdAt',_0xc1c9('0x73'),'CompanyId','ListId']);if(_0x14b67b[_0xc1c9('0x56')]['id']){delete _0x14b67b[_0xc1c9('0x56')]['id'];}if(_[_0xc1c9('0x74')](_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x75')])){throw new db[(_0xc1c9('0x6e'))][(_0xc1c9('0x6f'))](_0xc1c9('0x76'));}if(_['isNil'](_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x56')])||_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x56')]===''){throw new db[(_0xc1c9('0x6e'))]['ValidationError'](_0xc1c9('0x77'));}if(_[_0xc1c9('0x74')](_0x14b67b['body'][_0xc1c9('0x78')])){throw new db[(_0xc1c9('0x6e'))][(_0xc1c9('0x6f'))](_0xc1c9('0x79')+_0x14a978);}if(!_['includes'](_0x14a978,_0x14b67b[_0xc1c9('0x56')]['mapKey'])){throw new db[(_0xc1c9('0x6e'))][(_0xc1c9('0x6f'))](_0xc1c9('0x7a')+_0x14a978);}_0x498e60[_0x14b67b['body'][_0xc1c9('0x78')]]=_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x75')];})[_0xc1c9('0x1d')](function(){return db[_0xc1c9('0x3b')][_0xc1c9('0x54')]({'where':{'id':_0x14b67b['params']['id']},'include':[{'model':db[_0xc1c9('0x7b')],'as':_0xc1c9('0x7c'),'include':[{'model':db[_0xc1c9('0x7d')],'as':_0xc1c9('0x7e'),'where':_0x498e60,'limit':0x1,'order':[['updatedAt',_0xc1c9('0x7f')]]}]},{'model':db[_0xc1c9('0x80')],'as':_0xc1c9('0x81')}]});})[_0xc1c9('0x1d')](handleEntityNotFound(_0x2b2cab,null))[_0xc1c9('0x1d')](function(_0x4f293c){if(_0x4f293c&&_0x4f293c[_0xc1c9('0x7c')]){_0x249c41[_0xc1c9('0x82')]=_0x4f293c;_0x249c41[_0xc1c9('0x83')]=_0x4f293c[_0xc1c9('0x81')];_0x249c41[_0xc1c9('0x84')]=_0x4f293c[_0xc1c9('0x7c')];_0x249c41['applications']=_[_0xc1c9('0x85')](_0x249c41['applications'],['priority'],[_0xc1c9('0x86')]);if(_0x249c41['account'][_0xc1c9('0x81')]){delete _0x249c41[_0xc1c9('0x82')][_0xc1c9('0x81')];}if(_0x249c41['account']['List']&&_0x249c41['account'][_0xc1c9('0x7c')]['Contacts'][_0xc1c9('0x47')]){return _0x249c41['account']['List'][_0xc1c9('0x7e')][0x0];}var _0x9ea057=_[_0xc1c9('0x15')](_0x14b67b['body'],{'firstName':_0x14b67b[_0xc1c9('0x56')]['from'],'ListId':_0x4f293c[_0xc1c9('0x87')]});_0x9ea057[_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x78')]]=_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x75')];return db['CmContact']['create'](_0x9ea057,{'fields':_0x2f7f10,'raw':!![]});}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x2b2cab,null))['then'](function(_0x557a2f){_0x249c41['contact']=_0x557a2f;if(_0x557a2f){var _0x4baa96={'ContactId':_0x557a2f['id'],'OpenchannelAccountId':_0x14b67b[_0xc1c9('0x52')]['id'],'from':(_0x557a2f['firstName']||'')+'\x20'+(_0x557a2f[_0xc1c9('0x88')]||'')};var _0xccd4a4={'OpenchannelAccountId':_0x14b67b[_0xc1c9('0x52')]['id'],'closed':![]};if(_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x89')]){_0xccd4a4[_0xc1c9('0x89')]=_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x89')];return db[_0xc1c9('0x8a')]['find']({'where':_0xccd4a4})['then'](function(_0x1de7fc){if(_0x1de7fc){return[_0x1de7fc,![]];}_0x4baa96[_0xc1c9('0x89')]=_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x89')];_0x4baa96[_0xc1c9('0x8b')]=_0x14b67b['body'][_0xc1c9('0x8b')];return db[_0xc1c9('0x8a')]['create'](_0x4baa96)[_0xc1c9('0x1d')](function(_0x560f30){return[_0x560f30,!![]];});});}else{_0xccd4a4[_0xc1c9('0x89')]=null;}_0xccd4a4[_0xc1c9('0x8c')]=_0x557a2f['id'];return db[_0xc1c9('0x8a')][_0xc1c9('0x54')]({'where':_0xccd4a4})[_0xc1c9('0x1d')](function(_0x189365){if(_0x189365){return[_0x189365,![]];}return db['OpenchannelInteraction'][_0xc1c9('0x55')](_0x4baa96)[_0xc1c9('0x1d')](function(_0x4f849e){return[_0x4f849e,!![]];});});}})[_0xc1c9('0x8d')](function(_0x30acc3,_0xada8a7){if(_0x30acc3){_0xea974f=_0xada8a7;if(!_0xada8a7){var _0x54be8e={'from':(_0x249c41[_0xc1c9('0x8e')][_0xc1c9('0x8f')]||'')+'\x20'+(_0x249c41[_0xc1c9('0x8e')][_0xc1c9('0x88')]||'')};if(_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x89')]&&_0x14b67b['body'][_0xc1c9('0x90')]&&_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x89')]!=_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x90')]){_0x54be8e['threadId']=_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x90')];}return _0x30acc3[_0xc1c9('0x32')](_0x54be8e);}else{return _0x30acc3;}}})[_0xc1c9('0x1d')](function(_0x438e68){_0x249c41[_0xc1c9('0x91')]=_0x438e68['get']({'plain':!![]});_0x249c41[_0xc1c9('0x91')][_0xc1c9('0x92')]=_0xea974f;if(_0x249c41[_0xc1c9('0x91')][_0xc1c9('0x92')]){if(_0x249c41[_0xc1c9('0x82')][_0xc1c9('0x93')]){_0x249c41['applications']['push']({'id':0x0,'priority':_0x249c41[_0xc1c9('0x83')][_0xc1c9('0x47')]+0x1,'app':_0xc1c9('0x94'),'appdata':'unmanaged','interval':_0xc1c9('0x95')});}}return db[_0xc1c9('0x96')][_0xc1c9('0x55')]({'body':_0x14b67b['body'][_0xc1c9('0x56')],'OpenchannelAccountId':_0x14b67b[_0xc1c9('0x52')]['id'],'OpenchannelInteractionId':_0x438e68['id'],'direction':'in','ContactId':_0x249c41[_0xc1c9('0x8e')]['id'],'AttachmentId':_0x14b67b[_0xc1c9('0x56')][_0xc1c9('0x97')]});})[_0xc1c9('0x1d')](function(_0x189952){_0x249c41['message']=_0x189952;if(!_0x249c41[_0xc1c9('0x91')]['UserId'])return;return db[_0xc1c9('0x98')][_0xc1c9('0x54')]({'attributes':['id',_0xc1c9('0x37')],'where':{'id':_0x249c41[_0xc1c9('0x91')]['UserId']}});})[_0xc1c9('0x1d')](function(_0x56212d){if(_0x56212d){_0x249c41['applications'][_0xc1c9('0x99')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x56212d[_0xc1c9('0x37')]+','+(_0x249c41[_0xc1c9('0x82')][_0xc1c9('0x9a')]||0xa),'interval':'*,*,*,*'});}if(!_0x249c41[_0xc1c9('0x91')]['queueId'])return;return db[_0xc1c9('0x9b')][_0xc1c9('0x54')]({'attributes':['id','name'],'where':{'id':_0x249c41[_0xc1c9('0x91')][_0xc1c9('0x9c')]}});})['then'](function(_0x2f092f){if(_0x2f092f){_0x249c41[_0xc1c9('0x83')][_0xc1c9('0x99')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2f092f[_0xc1c9('0x37')]+','+(_0x249c41[_0xc1c9('0x82')][_0xc1c9('0x9d')]||0x12c),'interval':_0xc1c9('0x95')});}return respondWithRpcPromise('Start',_0xc1c9('0x9e'),_0x249c41);})[_0xc1c9('0x1d')](function(_0x251ae0){respondWithRpcPromise('EventManager',_0xc1c9('0x9f'),{'event':_0xc1c9('0x6c'),'message':_0x251ae0},client9002);return _0x251ae0;})[_0xc1c9('0x1d')](respondWithResult(_0x2b2cab,null))[_0xc1c9('0x26')](handleError(_0x2b2cab,null));};exports['addApplications']=function(_0x5dfafa,_0x5e3a32){var _0x314555=_0x5dfafa[_0xc1c9('0x52')]['id'];var _0x134910=_0x5dfafa['body'];var _0x5d87f8=0xc8;var _0x57a01b=null;return db[_0xc1c9('0xa0')][_0xc1c9('0xa1')]({'isolationLevel':db[_0xc1c9('0xa0')]['Transaction'][_0xc1c9('0xa2')]['READ_COMMITTED']},function(_0x573ae4){return db[_0xc1c9('0x3b')][_0xc1c9('0x64')]({'where':{'id':_0x314555},'transaction':_0x573ae4})[_0xc1c9('0x1d')](function(_0x1b0493){if(_0x1b0493){return db[_0xc1c9('0x80')][_0xc1c9('0x33')]({'where':{'OpenchannelAccountId':_0x314555},'transaction':_0x573ae4})[_0xc1c9('0x1d')](function(){var _0x514311=_[_0xc1c9('0x3a')](_0x134910,function(_0x4d324b){_0x4d324b[_0xc1c9('0x61')]=_0x314555;return _0x4d324b;});return db[_0xc1c9('0x80')][_0xc1c9('0xa3')](_0x514311,{'transaction':_0x573ae4});});}else{_0x5d87f8=0x194;_0x57a01b=[];}});})[_0xc1c9('0x1d')](function(){if(_0x5d87f8!==0x194){return db[_0xc1c9('0x80')][_0xc1c9('0xa4')]({'where':{'OpenchannelAccountId':_0x314555},'order':_0xc1c9('0xa5')})['then'](function(_0x5019f3){_0x57a01b=_0x5019f3;});}})[_0xc1c9('0x26')](function(_0x57ec57){_0x5d87f8=0x1f4;logger['error'](_0x57ec57[_0xc1c9('0x36')]);if(_0x57ec57[_0xc1c9('0x37')]){delete _0x57ec57[_0xc1c9('0x37')];}_0x57a01b=_0x57ec57;})[_0xc1c9('0xa6')](function(){if(_0x57a01b===null){_0x5e3a32['sendStatus'](_0x5d87f8);}else{if(_0x5d87f8===0x1f4){_0x5e3a32[_0xc1c9('0x29')](_0x5d87f8)[_0xc1c9('0x38')](_0x57a01b);}else{_0x5e3a32[_0xc1c9('0x29')](_0x5d87f8)['json'](_0x57a01b);}}});};exports[_0xc1c9('0xa7')]=function(_0x1e7f11,_0xd03d33,_0x3958ad){var _0x530820={};var _0x1c9665={};var _0x583dd8;var _0x186ffe;return db[_0xc1c9('0x3b')][_0xc1c9('0x64')]({'where':{'id':_0x1e7f11[_0xc1c9('0x52')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0xd03d33,null))[_0xc1c9('0x1d')](function(_0x528dfb){if(_0x528dfb){_0x583dd8=_0x528dfb;_0x1c9665[_0xc1c9('0x43')]=_[_0xc1c9('0x40')](db['OpenchannelApplication'][_0xc1c9('0x3c')]);_0x1c9665[_0xc1c9('0x41')]=_[_0xc1c9('0x40')](_0x1e7f11['query']);_0x1c9665[_0xc1c9('0x42')]=_[_0xc1c9('0x45')](_0x1c9665[_0xc1c9('0x43')],_0x1c9665[_0xc1c9('0x41')]);_0x530820['attributes']=_[_0xc1c9('0x45')](_0x1c9665[_0xc1c9('0x43')],qs[_0xc1c9('0x46')](_0x1e7f11[_0xc1c9('0x41')]['fields']));_0x530820[_0xc1c9('0x44')]=_0x530820[_0xc1c9('0x44')][_0xc1c9('0x47')]?_0x530820[_0xc1c9('0x44')]:_0x1c9665[_0xc1c9('0x43')];_0x530820['order']=qs[_0xc1c9('0x49')](_0x1e7f11['query'][_0xc1c9('0x49')]);_0x530820[_0xc1c9('0x4a')]=qs['filters'](_[_0xc1c9('0x65')](_0x1e7f11[_0xc1c9('0x41')],_0x1c9665[_0xc1c9('0x42')]));if(_0x1e7f11[_0xc1c9('0x41')][_0xc1c9('0x4b')]){_0x530820[_0xc1c9('0x4a')]=_[_0xc1c9('0x4c')](_0x530820[_0xc1c9('0x4a')],{'$or':_[_0xc1c9('0x3a')](_0x530820['attributes'],function(_0x4c7dcb){var _0x405f9e={};_0x405f9e[_0x4c7dcb]={'$like':'%'+_0x1e7f11[_0xc1c9('0x41')][_0xc1c9('0x4b')]+'%'};return _0x405f9e;})});}_0x530820=_[_0xc1c9('0x4c')]({},_0x530820,_0x1e7f11['options']);return _0x583dd8[_0xc1c9('0xa7')](_0x530820);}})[_0xc1c9('0x1d')](function(_0x59f826){if(_0x59f826){_0x186ffe=_0x59f826['length'];if(!_0x1e7f11['query'][_0xc1c9('0x48')](_0xc1c9('0xa8'))){_0x530820[_0xc1c9('0x2d')]=qs[_0xc1c9('0x2d')](_0x1e7f11['query']['limit']);_0x530820[_0xc1c9('0x2b')]=qs[_0xc1c9('0x2b')](_0x1e7f11[_0xc1c9('0x41')]['offset']);}return _0x583dd8['getApplications'](_0x530820);}})[_0xc1c9('0x1d')](function(_0xfbe419){if(_0xfbe419){return _0xfbe419?{'count':_0x186ffe,'rows':_0xfbe419}:null;}})[_0xc1c9('0x1d')](respondWithResult(_0xd03d33,null))[_0xc1c9('0x26')](handleError(_0xd03d33,null));};exports['getInteractions']=function(_0x3e413b,_0x30b0e8,_0x4c788d){var _0x1cfa38={'raw':![],'where':{}};var _0x5d5957={};var _0x5c249c={'count':0x0,'rows':[]};return db[_0xc1c9('0x3b')]['findOne']({'where':{'id':_0x3e413b[_0xc1c9('0x52')]['id']}})['then'](handleEntityNotFound(_0x30b0e8,null))['then'](function(_0x30d991){if(_0x30d991){_0x5d5957['model']=_[_0xc1c9('0x40')](db[_0xc1c9('0x8a')][_0xc1c9('0x3c')]);_0x5d5957['query']=_[_0xc1c9('0x40')](_0x3e413b[_0xc1c9('0x41')]);_0x5d5957[_0xc1c9('0x42')]=_[_0xc1c9('0x45')](_0x5d5957[_0xc1c9('0x43')],_0x5d5957['query']);_0x1cfa38[_0xc1c9('0x44')]=_['intersection'](_0x5d5957[_0xc1c9('0x43')],qs[_0xc1c9('0x46')](_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0x46')]));_0x1cfa38[_0xc1c9('0x44')]=_0x1cfa38['attributes'][_0xc1c9('0x47')]?_0x1cfa38['attributes']:_0x5d5957['model'];if(!_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0x48')](_0xc1c9('0xa8'))){_0x1cfa38[_0xc1c9('0x2d')]=qs[_0xc1c9('0x2d')](_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0x2d')]);_0x1cfa38[_0xc1c9('0x2b')]=qs[_0xc1c9('0x2b')](_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0x2b')]);}_0x1cfa38[_0xc1c9('0xa9')]=qs[_0xc1c9('0x49')](_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0x49')]);_0x1cfa38[_0xc1c9('0x4a')]=qs[_0xc1c9('0x42')](_[_0xc1c9('0x65')](_0x3e413b[_0xc1c9('0x41')],_0x5d5957[_0xc1c9('0x42')]));_0x1cfa38[_0xc1c9('0x4a')]['OpenchannelAccountId']=_0x30d991['id'];if(_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0x4b')]){_0x1cfa38[_0xc1c9('0x4a')]=_[_0xc1c9('0x4c')](_0x1cfa38[_0xc1c9('0x4a')],{'$or':_[_0xc1c9('0x3a')](_0x1cfa38['attributes'],function(_0x214911){var _0x575ab7={};_0x575ab7[_0x214911]={'$like':'%'+_0x3e413b[_0xc1c9('0x41')]['filter']+'%'};return _0x575ab7;})});}_0x1cfa38=_[_0xc1c9('0x4c')]({},_0x1cfa38,_0x3e413b[_0xc1c9('0x4e')]);return db[_0xc1c9('0x8a')][_0xc1c9('0x2e')]({'where':_0x1cfa38[_0xc1c9('0x4a')]})[_0xc1c9('0x1d')](function(_0x26f83e){_0x5c249c['count']=_0x26f83e;if(_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0x4f')]){_0x1cfa38[_0xc1c9('0x66')]=[{'model':db['CmContact'],'as':_0xc1c9('0xaa'),'required':![]},{'model':db[_0xc1c9('0x98')],'as':_0xc1c9('0xab'),'attributes':['name','fullname',_0xc1c9('0xac')],'required':![]},{'model':db['Tag'],'as':_0xc1c9('0xad'),'attributes':['id',_0xc1c9('0x37'),'color'],'where':_0x3e413b['query'][_0xc1c9('0xae')]?{'id':_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0xae')]}:undefined,'required':_0x3e413b[_0xc1c9('0x41')][_0xc1c9('0xae')]?!![]:![]}];}return db[_0xc1c9('0x8a')][_0xc1c9('0x50')](_0x1cfa38);})[_0xc1c9('0x1d')](function(_0x267c4a){_0x5c249c[_0xc1c9('0x51')]=_0x267c4a;return _0x5c249c;});}})[_0xc1c9('0x1d')](respondWithFilteredResult(_0x30b0e8,_0x1cfa38))[_0xc1c9('0x26')](handleError(_0x30b0e8,null));};exports[_0xc1c9('0xaf')]=function(_0x3d442e,_0x1e4aed,_0x199ab8){return db['OpenchannelAccount'][_0xc1c9('0x54')]({'where':{'id':_0x3d442e[_0xc1c9('0x52')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x1e4aed,null))['then'](function(_0x67761a){if(_0x67761a){return _0x67761a[_0xc1c9('0xaf')](_0x3d442e[_0xc1c9('0x56')][_0xc1c9('0xb0')],_[_0xc1c9('0xb1')](_0x3d442e['body'],[_0xc1c9('0xb0'),'id'])||{})[_0xc1c9('0x8d')](function(_0x23849e){for(var _0x2e40de=0x0;_0x2e40de<_0x3d442e['body'][_0xc1c9('0xb0')]['length'];_0x2e40de+=0x1){socket[_0xc1c9('0xb2')](_0xc1c9('0xb3'),{'UserId':Number(_0x3d442e[_0xc1c9('0x56')][_0xc1c9('0xb0')][_0x2e40de]),'OpenchannelAccountId':Number(_0x3d442e[_0xc1c9('0x52')]['id'])});}return _0x23849e;});}})[_0xc1c9('0x1d')](respondWithResult(_0x1e4aed,null))[_0xc1c9('0x26')](handleError(_0x1e4aed,null));};exports['removeAgents']=function(_0x1b8134,_0x519633,_0x3f9e7c){return db[_0xc1c9('0x3b')][_0xc1c9('0x54')]({'where':{'id':_0x1b8134[_0xc1c9('0x52')]['id']}})['then'](handleEntityNotFound(_0x519633,null))[_0xc1c9('0x1d')](function(_0x586490){if(_0x586490){return _0x586490[_0xc1c9('0xb4')](_0x1b8134[_0xc1c9('0x41')][_0xc1c9('0xb0')])[_0xc1c9('0x1d')](function(){if(_[_0xc1c9('0xb5')](_0x1b8134[_0xc1c9('0x41')]['ids'])){for(var _0x1d029e=0x0;_0x1d029e<_0x1b8134[_0xc1c9('0x41')]['ids'][_0xc1c9('0x47')];_0x1d029e+=0x1){socket['emit'](_0xc1c9('0xb6'),{'UserId':Number(_0x1b8134[_0xc1c9('0x41')]['ids'][_0x1d029e]),'OpenchannelAccountId':Number(_0x1b8134[_0xc1c9('0x52')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x1b8134[_0xc1c9('0x41')]['ids']),'OpenchannelAccountId':Number(_0x1b8134['params']['id'])});}});}})['then'](respondWithStatusCode(_0x519633,null))[_0xc1c9('0x26')](handleError(_0x519633,null));};exports[_0xc1c9('0xb7')]=function(_0x5ee193,_0x5f4d58,_0x14a9a4){var _0x2378c5={};var _0x13452a={};var _0xa6e22d;var _0x3d6d00;return db[_0xc1c9('0x3b')][_0xc1c9('0x64')]({'where':{'id':_0x5ee193[_0xc1c9('0x52')]['id']}})['then'](handleEntityNotFound(_0x5f4d58,null))[_0xc1c9('0x1d')](function(_0x2e5be0){if(_0x2e5be0){_0xa6e22d=_0x2e5be0;_0x13452a[_0xc1c9('0x43')]=_[_0xc1c9('0x40')](db[_0xc1c9('0x98')][_0xc1c9('0x3c')]);_0x13452a[_0xc1c9('0x41')]=_[_0xc1c9('0x40')](_0x5ee193['query']);_0x13452a['filters']=_[_0xc1c9('0x45')](_0x13452a['model'],_0x13452a['query']);_0x2378c5[_0xc1c9('0x44')]=_[_0xc1c9('0x45')](_0x13452a[_0xc1c9('0x43')],qs['fields'](_0x5ee193['query']['fields']));_0x2378c5[_0xc1c9('0x44')]=_0x2378c5['attributes'][_0xc1c9('0x47')]?_0x2378c5[_0xc1c9('0x44')]:_0x13452a['model'];_0x2378c5[_0xc1c9('0xa9')]=qs[_0xc1c9('0x49')](_0x5ee193[_0xc1c9('0x41')][_0xc1c9('0x49')]);_0x2378c5['where']=qs[_0xc1c9('0x42')](_[_0xc1c9('0x65')](_0x5ee193[_0xc1c9('0x41')],_0x13452a[_0xc1c9('0x42')]));if(_0x5ee193[_0xc1c9('0x41')][_0xc1c9('0x4b')]){_0x2378c5[_0xc1c9('0x4a')]=_[_0xc1c9('0x4c')](_0x2378c5[_0xc1c9('0x4a')],{'$or':_[_0xc1c9('0x3a')](_0x2378c5['attributes'],function(_0x1be1a6){var _0x3f4794={};_0x3f4794[_0x1be1a6]={'$like':'%'+_0x5ee193[_0xc1c9('0x41')][_0xc1c9('0x4b')]+'%'};return _0x3f4794;})});}_0x2378c5=_[_0xc1c9('0x4c')]({},_0x2378c5,_0x5ee193[_0xc1c9('0x4e')]);return _0xa6e22d['getAgents'](_0x2378c5);}})[_0xc1c9('0x1d')](function(_0x20e874){if(_0x20e874){_0x3d6d00=_0x20e874[_0xc1c9('0x47')];if(!_0x5ee193[_0xc1c9('0x41')]['hasOwnProperty'](_0xc1c9('0xa8'))){_0x2378c5[_0xc1c9('0x2d')]=qs['limit'](_0x5ee193[_0xc1c9('0x41')]['limit']);_0x2378c5[_0xc1c9('0x2b')]=qs[_0xc1c9('0x2b')](_0x5ee193['query']['offset']);}return _0xa6e22d['getAgents'](_0x2378c5);}})[_0xc1c9('0x1d')](function(_0x307da1){if(_0x307da1){return _0x307da1?{'count':_0x3d6d00,'rows':_0x307da1}:null;}})[_0xc1c9('0x1d')](respondWithResult(_0x5f4d58,null))[_0xc1c9('0x26')](handleError(_0x5f4d58,null));};exports['send']=function(_0x2111bb,_0x227ff1,_0x261767){var _0x5a1319,_0x45f247,_0x49f633;if(_['isNil'](_0x2111bb['body'][_0xc1c9('0x56')])||_0x2111bb[_0xc1c9('0x56')][_0xc1c9('0x56')]===''){throw new db[(_0xc1c9('0x6e'))][(_0xc1c9('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc1c9('0x74')](_0x2111bb['body']['to'])){}_0x5a1319=_0x2111bb[_0xc1c9('0x56')]['to'];return db[_0xc1c9('0x3b')][_0xc1c9('0x64')]({'where':{'id':_0x2111bb['params']['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x227ff1,null))[_0xc1c9('0x1d')](function(_0x541df1){if(_0x541df1){return db[_0xc1c9('0x3b')]['find']({'where':{'id':_0x541df1['id']},'include':[{'model':db['CmList'],'as':_0xc1c9('0x7c'),'include':[{'model':db[_0xc1c9('0x7d')],'as':'Contacts','where':{[_0x541df1['mapKey']]:_0x5a1319},'limit':0x1,'order':[[_0xc1c9('0x73'),'DESC']]}]}]})[_0xc1c9('0x1d')](handleEntityNotFound(_0x227ff1,null))['then'](function(_0xa5acb4){if(_0xa5acb4&&_0xa5acb4[_0xc1c9('0x7c')]){_0x45f247=_0xa5acb4['get']({'plain':!![]});if(_0x45f247[_0xc1c9('0x7c')]&&_0x45f247[_0xc1c9('0x7c')][_0xc1c9('0x7e')][_0xc1c9('0x47')]){return _0x45f247[_0xc1c9('0x7c')][_0xc1c9('0x7e')][0x0];}return db[_0xc1c9('0x7d')][_0xc1c9('0x55')](_[_0xc1c9('0x15')](_0x2111bb[_0xc1c9('0x56')],{'firstName':_0x5a1319,[_0xa5acb4[_0xc1c9('0x78')]]:_0x5a1319,'phone':_0x5a1319,'ListId':_0x45f247[_0xc1c9('0x87')]}));}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x227ff1,null))[_0xc1c9('0x1d')](function(_0x381a06){if(_0x381a06){_0x49f633=_0x381a06;return db['OpenchannelInteraction'][_0xc1c9('0x54')]({'where':{'ContactId':_0x49f633['id'],'closed':![],'OpenchannelAccountId':_0x45f247['id']}})[_0xc1c9('0x1d')](function(_0x5947b1){if(_0x5947b1){return[_0x5947b1,![]];}return db[_0xc1c9('0x8a')][_0xc1c9('0x55')]({'UserId':_0x2111bb[_0xc1c9('0x5a')]['id'],'ContactId':_0x49f633['id'],'OpenchannelAccountId':_0x45f247['id'],'lastMsgDirection':_0xc1c9('0xb8'),'firstMsgDirection':'out','Messages':[_['merge'](_0x2111bb['body'],{'read':![],'body':_0x2111bb[_0xc1c9('0x56')][_0xc1c9('0x56')],'OpenchannelAccountId':_0x45f247['id'],'UserId':_0x2111bb['user']['id'],'ContactId':_0x49f633['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xc1c9('0xb9')}]})[_0xc1c9('0x1d')](function(_0x12f879){return[_0x12f879,!![]];});});}})[_0xc1c9('0x8d')](function(_0x59e973,_0x436a7e){if(_0x436a7e){return _0x59e973;}return db[_0xc1c9('0x96')][_0xc1c9('0x55')](_['merge'](_0x2111bb[_0xc1c9('0x56')],{'read':![],'body':_0x2111bb[_0xc1c9('0x56')][_0xc1c9('0x56')],'OpenchannelAccountId':_0x45f247['id'],'OpenchannelInteractionId':_0x59e973['id'],'UserId':_0x2111bb[_0xc1c9('0x5a')]['id'],'ContactId':_0x49f633['id']}))[_0xc1c9('0x1d')](function(_0xad151a){_0x59e973['dataValues'][_0xc1c9('0xb9')]=[];_0x59e973['dataValues']['Messages'][_0xc1c9('0xba')](_0xad151a[_0xc1c9('0xbb')]);return _0x59e973;});});}})[_0xc1c9('0x1d')](respondWithResult(_0x227ff1,null))[_0xc1c9('0x26')](handleError(_0x227ff1,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 01ad7a9..81b0e5f 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 _0xb903=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb','OpenchannelAccount'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xb903,0x185));var _0x3b90=function(_0x2431cc,_0x2f3ad7){_0x2431cc=_0x2431cc-0x0;var _0x1643d1=_0xb903[_0x2431cc];return _0x1643d1;};'use strict';var EventEmitter=require(_0x3b90('0x0'));var OpenchannelAccount=require(_0x3b90('0x1'))['db'][_0x3b90('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3b90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b90('0x4'),'afterDestroy':_0x3b90('0x5')};function emitEvent(_0x3b024a){return function(_0x1cd5d8,_0x30d8db,_0x40f726){OpenchannelAccountEvents[_0x3b90('0x6')](_0x3b024a+':'+_0x1cd5d8['id'],_0x1cd5d8);OpenchannelAccountEvents['emit'](_0x3b024a,_0x1cd5d8);_0x40f726(null);};}for(var e in events){if(events[_0x3b90('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x6f7a=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x3e1a0d,_0xcf5c64){_0x3e1a0d=_0x3e1a0d-0x0;var _0x316488=_0x6f7a[_0x3e1a0d];return _0x316488;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var OpenchannelAccount=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];OpenchannelAccount[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 7eb5d8a..df744f4 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(_0x2023c7,_0x30877a){var _0x3b12cf=function(_0x2cbbda){while(--_0x2cbbda){_0x2023c7['push'](_0x2023c7['shift']());}};_0x3b12cf(++_0x30877a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x23a38c,_0x2edd){var _0x3618ac=function(_0x1499e4){while(--_0x1499e4){_0x23a38c['push'](_0x23a38c['shift']());}};_0x3618ac(++_0x2edd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 50bbb9d..35bac67 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 _0x407f=['register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket'];(function(_0x11071b,_0x29f817){var _0x1ae833=function(_0x460d32){while(--_0x460d32){_0x11071b['push'](_0x11071b['shift']());}};_0x1ae833(++_0x29f817);}(_0x407f,0xc2));var _0xf407=function(_0x208d46,_0x3721ee){_0x208d46=_0x208d46-0x0;var _0x498f19=_0x407f[_0x208d46];return _0x498f19;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf407('0x0'));var rs=require(_0xf407('0x1'));var fs=require('fs');var Redis=require(_0xf407('0x2'));var db=require(_0xf407('0x3'))['db'];var utils=require(_0xf407('0x4'));var logger=require(_0xf407('0x5'))(_0xf407('0x6'));var config=require(_0xf407('0x7'));var jayson=require(_0xf407('0x8'));var client=jayson[_0xf407('0x9')][_0xf407('0xa')]({'port':0x232a});config[_0xf407('0xb')]=_[_0xf407('0xc')](config[_0xf407('0xb')],{'host':_0xf407('0xd'),'port':0x18eb});var socket=require(_0xf407('0xe'))(new Redis(config['redis']));require(_0xf407('0xf'))[_0xf407('0x10')](socket);function respondWithRpcPromise(_0x436e03,_0x5af7b8,_0x4ff28e){return new BPromise(function(_0x4f4840,_0x5583fc){return client[_0xf407('0x11')](_0x436e03,_0x4ff28e)[_0xf407('0x12')](function(_0x31ac1b){logger[_0xf407('0x13')](_0xf407('0x14'),_0x5af7b8,'request\x20sent');logger[_0xf407('0x15')](_0xf407('0x16'),_0x5af7b8,_0xf407('0x17'),JSON[_0xf407('0x18')](_0x31ac1b));if(_0x31ac1b[_0xf407('0x19')]){if(_0x31ac1b[_0xf407('0x19')][_0xf407('0x1a')]===0x1f4){logger[_0xf407('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x5af7b8,_0x31ac1b['error'][_0xf407('0x1b')]);return _0x5583fc(_0x31ac1b['error'][_0xf407('0x1b')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5af7b8,_0x31ac1b[_0xf407('0x19')][_0xf407('0x1b')]);return _0x4f4840(_0x31ac1b[_0xf407('0x19')][_0xf407('0x1b')]);}else{logger[_0xf407('0x13')](_0xf407('0x14'),_0x5af7b8,_0xf407('0x17'));_0x4f4840(_0x31ac1b[_0xf407('0x1c')]['message']);}})[_0xf407('0x1d')](function(_0x1cd48f){logger[_0xf407('0x19')](_0xf407('0x14'),_0x5af7b8,_0x1cd48f);_0x5583fc(_0x1cd48f);});});} \ No newline at end of file +var _0x8580=['http','redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x64954c,_0x3ebec3){var _0x47c88b=function(_0x203439){while(--_0x203439){_0x64954c['push'](_0x64954c['shift']());}};_0x47c88b(++_0x3ebec3);}(_0x8580,0x1c7));var _0x0858=function(_0x4dec30,_0x53aa4e){_0x4dec30=_0x4dec30-0x0;var _0x49664d=_0x8580[_0x4dec30];return _0x49664d;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});config[_0x0858('0x8')]=_[_0x0858('0x9')](config['redis'],{'host':_0x0858('0xa'),'port':0x18eb});var socket=require(_0x0858('0xb'))(new Redis(config[_0x0858('0x8')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x470459,_0x4b5072,_0x24996d){return new BPromise(function(_0x1c214c,_0x38371f){return client[_0x0858('0xc')](_0x470459,_0x24996d)[_0x0858('0xd')](function(_0x207cda){logger[_0x0858('0xe')](_0x0858('0xf'),_0x4b5072,'request\x20sent');logger['debug'](_0x0858('0x10'),_0x4b5072,'request\x20sent',JSON['stringify'](_0x207cda));if(_0x207cda['error']){if(_0x207cda[_0x0858('0x11')][_0x0858('0x12')]===0x1f4){logger['error'](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x38371f(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x1c214c(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}else{logger[_0x0858('0xe')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b5072,_0x0858('0x14'));_0x1c214c(_0x207cda['result'][_0x0858('0x13')]);}})[_0x0858('0x15')](function(_0x3a2d96){logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x3a2d96);_0x38371f(_0x3a2d96);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 200b4d1..488a1a2 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 _0xe14d=['update','removeListener','register','openchannelAccount:','./openchannelAccount.events','save','remove'];(function(_0x2ca73b,_0x5363e){var _0x42b1f2=function(_0x220172){while(--_0x220172){_0x2ca73b['push'](_0x2ca73b['shift']());}};_0x42b1f2(++_0x5363e);}(_0xe14d,0x1ee));var _0xde14=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xe14d[_0x3826ad];return _0x17b900;};'use strict';var OpenchannelAccountEvents=require(_0xde14('0x0'));var events=[_0xde14('0x1'),_0xde14('0x2'),_0xde14('0x3')];function createListener(_0x48b392,_0x1c5b4){return function(_0x28965b){_0x1c5b4['emit'](_0x48b392,_0x28965b);};}function removeListener(_0x1c3e94,_0x13c24e){return function(){OpenchannelAccountEvents[_0xde14('0x4')](_0x1c3e94,_0x13c24e);};}exports[_0xde14('0x5')]=function(_0x461af3){for(var _0xba1514=0x0,_0x4b1f6b=events['length'];_0xba1514<_0x4b1f6b;_0xba1514++){var _0x1bd49d=events[_0xba1514];var _0x115b7d=createListener(_0xde14('0x6')+_0x1bd49d,_0x461af3);OpenchannelAccountEvents['on'](_0x1bd49d,_0x115b7d);}}; \ No newline at end of file +var _0xd547=['openchannelAccount:','remove','update','removeListener'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0xd547,0x1c1));var _0x7d54=function(_0x27fe26,_0x3b8ca7){_0x27fe26=_0x27fe26-0x0;var _0x4fcb35=_0xd547[_0x27fe26];return _0x4fcb35;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x7d54('0x0'),_0x7d54('0x1')];function createListener(_0x15a0c7,_0x1611f6){return function(_0x54ffc5){_0x1611f6['emit'](_0x15a0c7,_0x54ffc5);};}function removeListener(_0x21c23f,_0x5d21c1){return function(){OpenchannelAccountEvents[_0x7d54('0x2')](_0x21c23f,_0x5d21c1);};}exports['register']=function(_0x296dd6){for(var _0x37defc=0x0,_0x1b7fc1=events['length'];_0x37defc<_0x1b7fc1;_0x37defc++){var _0x5b0b16=events[_0x37defc];var _0x478f9b=createListener(_0x7d54('0x3')+_0x5b0b16,_0x296dd6);OpenchannelAccountEvents['on'](_0x5b0b16,_0x478f9b);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 051b91a..d363c86 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 _0x49a0=['/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0x59572f,_0x23d090){var _0x3b77fd=function(_0x3d85d7){while(--_0x3d85d7){_0x59572f['push'](_0x59572f['shift']());}};_0x3b77fd(++_0x23d090);}(_0x49a0,0x144));var _0x049a=function(_0x593c1b,_0x35c524){_0x593c1b=_0x593c1b-0x0;var _0x4e0c07=_0x49a0[_0x593c1b];return _0x4e0c07;};'use strict';var multer=require('multer');var util=require(_0x049a('0x0'));var path=require('path');var timeout=require(_0x049a('0x1'));var express=require(_0x049a('0x2'));var router=express[_0x049a('0x3')]();var fs_extra=require(_0x049a('0x4'));var auth=require(_0x049a('0x5'));var interaction=require(_0x049a('0x6'));var config=require(_0x049a('0x7'));var controller=require(_0x049a('0x8'));router[_0x049a('0x9')]('/',auth[_0x049a('0xa')](),controller[_0x049a('0xb')]);router[_0x049a('0x9')](_0x049a('0xc'),auth['isAuthenticated'](),controller[_0x049a('0xd')]);router[_0x049a('0xe')]('/',auth[_0x049a('0xa')](),controller[_0x049a('0xf')]);router[_0x049a('0x10')](_0x049a('0xc'),auth['isAuthenticated'](),controller[_0x049a('0x11')]);router[_0x049a('0x12')](_0x049a('0xc'),auth[_0x049a('0xa')](),controller[_0x049a('0x13')]);module[_0x049a('0x14')]=router; \ No newline at end of file +var _0xd719=['create','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x9dd172,_0x1a49de){var _0xca52fa=function(_0x209cfe){while(--_0x209cfe){_0x9dd172['push'](_0x9dd172['shift']());}};_0xca52fa(++_0x1a49de);}(_0xd719,0x16d));var _0x9d71=function(_0xb5d151,_0x4535bb){_0xb5d151=_0xb5d151-0x0;var _0x22fa8d=_0xd719[_0xb5d151];return _0x22fa8d;};'use strict';var multer=require(_0x9d71('0x0'));var util=require(_0x9d71('0x1'));var path=require(_0x9d71('0x2'));var timeout=require(_0x9d71('0x3'));var express=require(_0x9d71('0x4'));var router=express[_0x9d71('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d71('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9d71('0x7'));var controller=require(_0x9d71('0x8'));router[_0x9d71('0x9')]('/',auth[_0x9d71('0xa')](),controller[_0x9d71('0xb')]);router[_0x9d71('0x9')](_0x9d71('0xc'),auth['isAuthenticated'](),controller[_0x9d71('0xd')]);router[_0x9d71('0xe')]('/',auth[_0x9d71('0xa')](),controller[_0x9d71('0xf')]);router[_0x9d71('0x10')](_0x9d71('0xc'),auth[_0x9d71('0xa')](),controller[_0x9d71('0x11')]);router['delete'](_0x9d71('0xc'),auth[_0x9d71('0xa')](),controller[_0x9d71('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index ad4818e..9ca74dc 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 _0xb652=['exports','STRING','*,*,*,*'];(function(_0x1c9b4d,_0x5c0f71){var _0x42b672=function(_0x6e7fd2){while(--_0x6e7fd2){_0x1c9b4d['push'](_0x1c9b4d['shift']());}};_0x42b672(++_0x5c0f71);}(_0xb652,0x1ce));var _0x2b65=function(_0x40b011,_0x24af3d){_0x40b011=_0x40b011-0x0;var _0x240616=_0xb652[_0x40b011];return _0x240616;};'use strict';var Sequelize=require('sequelize');module[_0x2b65('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2b65('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2b65('0x2')}}; \ No newline at end of file +var _0x8d09=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x1d45e7,_0x4ce877){var _0x1ac9d9=function(_0x1a45a6){while(--_0x1a45a6){_0x1d45e7['push'](_0x1d45e7['shift']());}};_0x1ac9d9(++_0x4ce877);}(_0x8d09,0x16d));var _0x98d0=function(_0x2c00b3,_0x29b200){_0x2c00b3=_0x2c00b3-0x0;var _0x595512=_0x8d09[_0x2c00b3];return _0x595512;};'use strict';var Sequelize=require(_0x98d0('0x0'));module[_0x98d0('0x1')]={'priority':{'type':Sequelize[_0x98d0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x98d0('0x3')],'allowNull':![],'defaultValue':_0x98d0('0x4')},'appdata':{'type':Sequelize[_0x98d0('0x5')]()},'description':{'type':Sequelize[_0x98d0('0x3')]},'interval':{'type':Sequelize[_0x98d0('0x3')],'defaultValue':_0x98d0('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 8e0a8a3..d91caf3 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 _0xa06b=['options','includeAll','include','findAll','rows','catch','params','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../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','name','index','OpenchannelApplication','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0xa06b,0x173));var _0xba06=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa06b[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba06('0x0'));var zipdir=require(_0xba06('0x1'));var jsonpatch=require(_0xba06('0x2'));var rp=require('request-promise');var moment=require(_0xba06('0x3'));var BPromise=require(_0xba06('0x4'));var Mustache=require(_0xba06('0x5'));var util=require(_0xba06('0x6'));var path=require(_0xba06('0x7'));var sox=require('sox');var csv=require(_0xba06('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba06('0x9'));var _=require(_0xba06('0xa'));var squel=require(_0xba06('0xb'));var crypto=require(_0xba06('0xc'));var jsforce=require(_0xba06('0xd'));var deskjs=require(_0xba06('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba06('0xf'));var qs=require(_0xba06('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba06('0x11'))(_0xba06('0x12'));var utils=require(_0xba06('0x13'));var config=require(_0xba06('0x14'));var licenseUtil=require(_0xba06('0x15'));var db=require(_0xba06('0x16'))['db'];function respondWithStatusCode(_0x3b6730,_0x1a3bef){_0x1a3bef=_0x1a3bef||0xcc;return function(_0x3295ad){if(_0x3295ad){return _0x3b6730[_0xba06('0x17')](_0x1a3bef);}return _0x3b6730[_0xba06('0x18')](_0x1a3bef)[_0xba06('0x19')]();};}function respondWithResult(_0x318937,_0x1aeef7){_0x1aeef7=_0x1aeef7||0xc8;return function(_0x4c30c9){if(_0x4c30c9){return _0x318937[_0xba06('0x18')](_0x1aeef7)[_0xba06('0x1a')](_0x4c30c9);}};}function respondWithFilteredResult(_0x42ee18,_0x34e1e4){return function(_0x17c632){if(_0x17c632){var _0x24d087=typeof _0x34e1e4['offset']===_0xba06('0x1b')&&typeof _0x34e1e4[_0xba06('0x1c')]===_0xba06('0x1b');var _0x30c8a8=_0x17c632[_0xba06('0x1d')];var _0x31886f=_0x24d087?0x0:_0x34e1e4[_0xba06('0x1e')];var _0x45573c=_0x24d087?_0x17c632[_0xba06('0x1d')]:_0x34e1e4[_0xba06('0x1e')]+_0x34e1e4[_0xba06('0x1c')];var _0x2321b9;if(_0x45573c>=_0x30c8a8){_0x45573c=_0x30c8a8;_0x2321b9=0xc8;}else{_0x2321b9=0xce;}_0x42ee18[_0xba06('0x18')](_0x2321b9);return _0x42ee18[_0xba06('0x1f')](_0xba06('0x20'),_0x31886f+'-'+_0x45573c+'/'+_0x30c8a8)[_0xba06('0x1a')](_0x17c632);}return null;};}function patchUpdates(_0x53824f){return function(_0x53563f){try{jsonpatch[_0xba06('0x21')](_0x53563f,_0x53824f,!![]);}catch(_0x4a40b5){return BPromise[_0xba06('0x22')](_0x4a40b5);}return _0x53563f[_0xba06('0x23')]();};}function saveUpdates(_0x2e2dcf,_0x1cc7a8){return function(_0x117156){if(_0x117156){return _0x117156['update'](_0x2e2dcf)[_0xba06('0x24')](function(_0x387695){return _0x387695;});}return null;};}function removeEntity(_0x4f2a31,_0x482586){return function(_0x6135ec){if(_0x6135ec){return _0x6135ec[_0xba06('0x25')]()[_0xba06('0x24')](function(){_0x4f2a31['status'](0xcc)[_0xba06('0x19')]();});}};}function handleEntityNotFound(_0x4de905,_0x4ad756){return function(_0x302cd3){if(!_0x302cd3){_0x4de905[_0xba06('0x17')](0x194);}return _0x302cd3;};}function handleError(_0x14ea7c,_0x1af333){_0x1af333=_0x1af333||0x1f4;return function(_0xe9723f){logger[_0xba06('0x26')](_0xe9723f['stack']);if(_0xe9723f['name']){delete _0xe9723f[_0xba06('0x27')];}_0x14ea7c[_0xba06('0x18')](_0x1af333)['send'](_0xe9723f);};}exports[_0xba06('0x28')]=function(_0x29c508,_0x4f1685){var _0x4fd107={},_0x3a31ca={},_0x249955={'count':0x0,'rows':[]};var _0xcb7cdf=_['map'](db[_0xba06('0x29')][_0xba06('0x2a')],function(_0x5314fd){return{'name':_0x5314fd['fieldName'],'type':_0x5314fd[_0xba06('0x2b')][_0xba06('0x2c')]};});_0x3a31ca['model']=_[_0xba06('0x2d')](_0xcb7cdf,_0xba06('0x27'));_0x3a31ca[_0xba06('0x2e')]=_[_0xba06('0x2f')](_0x29c508[_0xba06('0x2e')]);_0x3a31ca[_0xba06('0x30')]=_[_0xba06('0x31')](_0x3a31ca[_0xba06('0x32')],_0x3a31ca['query']);_0x4fd107[_0xba06('0x33')]=_[_0xba06('0x31')](_0x3a31ca[_0xba06('0x32')],qs[_0xba06('0x34')](_0x29c508[_0xba06('0x2e')][_0xba06('0x34')]));_0x4fd107[_0xba06('0x33')]=_0x4fd107[_0xba06('0x33')][_0xba06('0x35')]?_0x4fd107[_0xba06('0x33')]:_0x3a31ca[_0xba06('0x32')];if(!_0x29c508[_0xba06('0x2e')]['hasOwnProperty'](_0xba06('0x36'))){_0x4fd107[_0xba06('0x1c')]=qs[_0xba06('0x1c')](_0x29c508[_0xba06('0x2e')]['limit']);_0x4fd107['offset']=qs[_0xba06('0x1e')](_0x29c508[_0xba06('0x2e')][_0xba06('0x1e')]);}_0x4fd107[_0xba06('0x37')]=qs['sort'](_0x29c508[_0xba06('0x2e')][_0xba06('0x38')]);_0x4fd107['where']=qs[_0xba06('0x30')](_[_0xba06('0x39')](_0x29c508[_0xba06('0x2e')],_0x3a31ca[_0xba06('0x30')]),_0xcb7cdf);if(_0x29c508[_0xba06('0x2e')][_0xba06('0x3a')]){_0x4fd107[_0xba06('0x3b')]=_['merge'](_0x4fd107[_0xba06('0x3b')],{'$or':_[_0xba06('0x2d')](_0xcb7cdf,function(_0x13b4e8){if(_0x13b4e8[_0xba06('0x2b')]!=='VIRTUAL'){var _0x447b29={};_0x447b29[_0x13b4e8['name']]={'$like':'%'+_0x29c508[_0xba06('0x2e')]['filter']+'%'};return _0x447b29;}})});}_0x4fd107=_[_0xba06('0x3c')]({},_0x4fd107,_0x29c508[_0xba06('0x3d')]);var _0x5a2cf9={'where':_0x4fd107['where']};return db['OpenchannelApplication'][_0xba06('0x1d')](_0x5a2cf9)[_0xba06('0x24')](function(_0x3a980f){_0x249955[_0xba06('0x1d')]=_0x3a980f;if(_0x29c508[_0xba06('0x2e')][_0xba06('0x3e')]){_0x4fd107[_0xba06('0x3f')]=[{'all':!![]}];}return db[_0xba06('0x29')][_0xba06('0x40')](_0x4fd107);})[_0xba06('0x24')](function(_0x27d6a6){_0x249955[_0xba06('0x41')]=_0x27d6a6;return _0x249955;})[_0xba06('0x24')](respondWithFilteredResult(_0x4f1685,_0x4fd107))[_0xba06('0x42')](handleError(_0x4f1685,null));};exports['show']=function(_0x22bff7,_0x126790){var _0x4527ea={'raw':!![],'where':{'id':_0x22bff7[_0xba06('0x43')]['id']}},_0x362020={};_0x362020[_0xba06('0x32')]=_[_0xba06('0x2f')](db[_0xba06('0x29')][_0xba06('0x2a')]);_0x362020['query']=_['keys'](_0x22bff7['query']);_0x362020['filters']=_[_0xba06('0x31')](_0x362020[_0xba06('0x32')],_0x362020[_0xba06('0x2e')]);_0x4527ea[_0xba06('0x33')]=_[_0xba06('0x31')](_0x362020[_0xba06('0x32')],qs[_0xba06('0x34')](_0x22bff7[_0xba06('0x2e')][_0xba06('0x34')]));_0x4527ea['attributes']=_0x4527ea['attributes'][_0xba06('0x35')]?_0x4527ea['attributes']:_0x362020[_0xba06('0x32')];if(_0x22bff7[_0xba06('0x2e')][_0xba06('0x3e')]){_0x4527ea[_0xba06('0x3f')]=[{'all':!![]}];}_0x4527ea=_[_0xba06('0x3c')]({},_0x4527ea,_0x22bff7['options']);return db[_0xba06('0x29')][_0xba06('0x44')](_0x4527ea)[_0xba06('0x24')](handleEntityNotFound(_0x126790,null))[_0xba06('0x24')](respondWithResult(_0x126790,null))[_0xba06('0x42')](handleError(_0x126790,null));};exports[_0xba06('0x45')]=function(_0x537af0,_0xfd7ee){return db[_0xba06('0x29')][_0xba06('0x45')](_0x537af0[_0xba06('0x46')],{})[_0xba06('0x24')](respondWithResult(_0xfd7ee,0xc9))[_0xba06('0x42')](handleError(_0xfd7ee,null));};exports[_0xba06('0x47')]=function(_0x49c01f,_0xdb6c0e){if(_0x49c01f[_0xba06('0x46')]['id']){delete _0x49c01f['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x49c01f['params']['id']}})[_0xba06('0x24')](handleEntityNotFound(_0xdb6c0e,null))[_0xba06('0x24')](saveUpdates(_0x49c01f[_0xba06('0x46')],null))[_0xba06('0x24')](respondWithResult(_0xdb6c0e,null))['catch'](handleError(_0xdb6c0e,null));};exports['destroy']=function(_0x5c6531,_0x4d4b58){return db[_0xba06('0x29')]['find']({'where':{'id':_0x5c6531[_0xba06('0x43')]['id']}})[_0xba06('0x24')](handleEntityNotFound(_0x4d4b58,null))[_0xba06('0x24')](removeEntity(_0x4d4b58,null))['catch'](handleError(_0x4d4b58,null));}; \ No newline at end of file +var _0xefc8=['catch','show','rawAttributes','includeAll','include','create','body','find','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','map','OpenchannelApplication','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','findAll','rows'];(function(_0x1264cb,_0x3a2d49){var _0x73f2ee=function(_0x19a194){while(--_0x19a194){_0x1264cb['push'](_0x1264cb['shift']());}};_0x73f2ee(++_0x3a2d49);}(_0xefc8,0xed));var _0x8efc=function(_0x446d0f,_0x5a1fe7){_0x446d0f=_0x446d0f-0x0;var _0x5502eb=_0xefc8[_0x446d0f];return _0x5502eb;};'use strict';var emlformat=require(_0x8efc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8efc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8efc('0x2'));var moment=require(_0x8efc('0x3'));var BPromise=require(_0x8efc('0x4'));var Mustache=require(_0x8efc('0x5'));var util=require(_0x8efc('0x6'));var path=require('path');var sox=require(_0x8efc('0x7'));var csv=require(_0x8efc('0x8'));var ejs=require(_0x8efc('0x9'));var fs=require('fs');var fs_extra=require(_0x8efc('0xa'));var _=require(_0x8efc('0xb'));var squel=require(_0x8efc('0xc'));var crypto=require(_0x8efc('0xd'));var jsforce=require(_0x8efc('0xe'));var deskjs=require(_0x8efc('0xf'));var toCsv=require(_0x8efc('0x8'));var querystring=require(_0x8efc('0x10'));var Papa=require('papaparse');var Redis=require(_0x8efc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8efc('0x12'));var as=require(_0x8efc('0x13'));var hardwareService=require(_0x8efc('0x14'));var logger=require(_0x8efc('0x15'))(_0x8efc('0x16'));var utils=require(_0x8efc('0x17'));var config=require(_0x8efc('0x18'));var licenseUtil=require(_0x8efc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51cd27,_0x1b50eb){_0x1b50eb=_0x1b50eb||0xcc;return function(_0x5512ac){if(_0x5512ac){return _0x51cd27['sendStatus'](_0x1b50eb);}return _0x51cd27[_0x8efc('0x1a')](_0x1b50eb)[_0x8efc('0x1b')]();};}function respondWithResult(_0x33f8c0,_0x9d00d6){_0x9d00d6=_0x9d00d6||0xc8;return function(_0x25b976){if(_0x25b976){return _0x33f8c0[_0x8efc('0x1a')](_0x9d00d6)['json'](_0x25b976);}};}function respondWithFilteredResult(_0x2ca351,_0x169af3){return function(_0x14354e){if(_0x14354e){var _0x439481=typeof _0x169af3[_0x8efc('0x1c')]===_0x8efc('0x1d')&&typeof _0x169af3[_0x8efc('0x1e')]===_0x8efc('0x1d');var _0x1b23d9=_0x14354e[_0x8efc('0x1f')];var _0x382519=_0x439481?0x0:_0x169af3[_0x8efc('0x1c')];var _0x1b7740=_0x439481?_0x14354e[_0x8efc('0x1f')]:_0x169af3[_0x8efc('0x1c')]+_0x169af3[_0x8efc('0x1e')];var _0x3e439f;if(_0x1b7740>=_0x1b23d9){_0x1b7740=_0x1b23d9;_0x3e439f=0xc8;}else{_0x3e439f=0xce;}_0x2ca351[_0x8efc('0x1a')](_0x3e439f);return _0x2ca351['set'](_0x8efc('0x20'),_0x382519+'-'+_0x1b7740+'/'+_0x1b23d9)[_0x8efc('0x21')](_0x14354e);}return null;};}function patchUpdates(_0x59be1b){return function(_0x57164f){try{jsonpatch[_0x8efc('0x22')](_0x57164f,_0x59be1b,!![]);}catch(_0x1f17b7){return BPromise[_0x8efc('0x23')](_0x1f17b7);}return _0x57164f[_0x8efc('0x24')]();};}function saveUpdates(_0x432551,_0x2e41c9){return function(_0x39c785){if(_0x39c785){return _0x39c785[_0x8efc('0x25')](_0x432551)['then'](function(_0x5169da){return _0x5169da;});}return null;};}function removeEntity(_0x4d7947,_0x3f4113){return function(_0x1193fe){if(_0x1193fe){return _0x1193fe[_0x8efc('0x26')]()[_0x8efc('0x27')](function(){_0x4d7947['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e087,_0x21dd41){return function(_0x13bc98){if(!_0x13bc98){_0x41e087[_0x8efc('0x28')](0x194);}return _0x13bc98;};}function handleError(_0x4b1092,_0x427427){_0x427427=_0x427427||0x1f4;return function(_0x43aa0c){logger['error'](_0x43aa0c[_0x8efc('0x29')]);if(_0x43aa0c[_0x8efc('0x2a')]){delete _0x43aa0c[_0x8efc('0x2a')];}_0x4b1092['status'](_0x427427)[_0x8efc('0x2b')](_0x43aa0c);};}exports['index']=function(_0x105a51,_0x20acd4){var _0x177d01={},_0x9cbf9={},_0x29e218={'count':0x0,'rows':[]};var _0x5c32ed=_[_0x8efc('0x2c')](db[_0x8efc('0x2d')]['rawAttributes'],function(_0x358c92){return{'name':_0x358c92[_0x8efc('0x2e')],'type':_0x358c92[_0x8efc('0x2f')][_0x8efc('0x30')]};});_0x9cbf9['model']=_[_0x8efc('0x2c')](_0x5c32ed,_0x8efc('0x2a'));_0x9cbf9[_0x8efc('0x31')]=_[_0x8efc('0x32')](_0x105a51[_0x8efc('0x31')]);_0x9cbf9[_0x8efc('0x33')]=_[_0x8efc('0x34')](_0x9cbf9[_0x8efc('0x35')],_0x9cbf9[_0x8efc('0x31')]);_0x177d01[_0x8efc('0x36')]=_[_0x8efc('0x34')](_0x9cbf9[_0x8efc('0x35')],qs[_0x8efc('0x37')](_0x105a51[_0x8efc('0x31')][_0x8efc('0x37')]));_0x177d01[_0x8efc('0x36')]=_0x177d01['attributes'][_0x8efc('0x38')]?_0x177d01['attributes']:_0x9cbf9[_0x8efc('0x35')];if(!_0x105a51[_0x8efc('0x31')]['hasOwnProperty'](_0x8efc('0x39'))){_0x177d01[_0x8efc('0x1e')]=qs[_0x8efc('0x1e')](_0x105a51[_0x8efc('0x31')][_0x8efc('0x1e')]);_0x177d01['offset']=qs[_0x8efc('0x1c')](_0x105a51[_0x8efc('0x31')][_0x8efc('0x1c')]);}_0x177d01[_0x8efc('0x3a')]=qs['sort'](_0x105a51[_0x8efc('0x31')]['sort']);_0x177d01[_0x8efc('0x3b')]=qs['filters'](_[_0x8efc('0x3c')](_0x105a51['query'],_0x9cbf9[_0x8efc('0x33')]),_0x5c32ed);if(_0x105a51[_0x8efc('0x31')][_0x8efc('0x3d')]){_0x177d01[_0x8efc('0x3b')]=_[_0x8efc('0x3e')](_0x177d01[_0x8efc('0x3b')],{'$or':_['map'](_0x5c32ed,function(_0x1376ed){if(_0x1376ed[_0x8efc('0x2f')]!==_0x8efc('0x3f')){var _0xd8e12f={};_0xd8e12f[_0x1376ed[_0x8efc('0x2a')]]={'$like':'%'+_0x105a51[_0x8efc('0x31')][_0x8efc('0x3d')]+'%'};return _0xd8e12f;}})});}_0x177d01=_[_0x8efc('0x3e')]({},_0x177d01,_0x105a51[_0x8efc('0x40')]);var _0x335c71={'where':_0x177d01[_0x8efc('0x3b')]};return db[_0x8efc('0x2d')]['count'](_0x335c71)[_0x8efc('0x27')](function(_0xf7eadc){_0x29e218['count']=_0xf7eadc;if(_0x105a51['query']['includeAll']){_0x177d01['include']=[{'all':!![]}];}return db[_0x8efc('0x2d')][_0x8efc('0x41')](_0x177d01);})[_0x8efc('0x27')](function(_0x3e6c6b){_0x29e218[_0x8efc('0x42')]=_0x3e6c6b;return _0x29e218;})[_0x8efc('0x27')](respondWithFilteredResult(_0x20acd4,_0x177d01))[_0x8efc('0x43')](handleError(_0x20acd4,null));};exports[_0x8efc('0x44')]=function(_0x7d4819,_0xb87c6d){var _0x1a982b={'raw':!![],'where':{'id':_0x7d4819['params']['id']}},_0x4e4641={};_0x4e4641[_0x8efc('0x35')]=_[_0x8efc('0x32')](db[_0x8efc('0x2d')][_0x8efc('0x45')]);_0x4e4641[_0x8efc('0x31')]=_[_0x8efc('0x32')](_0x7d4819['query']);_0x4e4641[_0x8efc('0x33')]=_['intersection'](_0x4e4641['model'],_0x4e4641[_0x8efc('0x31')]);_0x1a982b['attributes']=_[_0x8efc('0x34')](_0x4e4641[_0x8efc('0x35')],qs['fields'](_0x7d4819[_0x8efc('0x31')][_0x8efc('0x37')]));_0x1a982b[_0x8efc('0x36')]=_0x1a982b[_0x8efc('0x36')][_0x8efc('0x38')]?_0x1a982b[_0x8efc('0x36')]:_0x4e4641[_0x8efc('0x35')];if(_0x7d4819[_0x8efc('0x31')][_0x8efc('0x46')]){_0x1a982b[_0x8efc('0x47')]=[{'all':!![]}];}_0x1a982b=_[_0x8efc('0x3e')]({},_0x1a982b,_0x7d4819['options']);return db[_0x8efc('0x2d')]['find'](_0x1a982b)[_0x8efc('0x27')](handleEntityNotFound(_0xb87c6d,null))['then'](respondWithResult(_0xb87c6d,null))['catch'](handleError(_0xb87c6d,null));};exports['create']=function(_0x2cf2e8,_0x3c4501){return db['OpenchannelApplication'][_0x8efc('0x48')](_0x2cf2e8[_0x8efc('0x49')],{})['then'](respondWithResult(_0x3c4501,0xc9))[_0x8efc('0x43')](handleError(_0x3c4501,null));};exports[_0x8efc('0x25')]=function(_0x390e44,_0x355a9a){if(_0x390e44[_0x8efc('0x49')]['id']){delete _0x390e44[_0x8efc('0x49')]['id'];}return db['OpenchannelApplication'][_0x8efc('0x4a')]({'where':{'id':_0x390e44[_0x8efc('0x4b')]['id']}})[_0x8efc('0x27')](handleEntityNotFound(_0x355a9a,null))[_0x8efc('0x27')](saveUpdates(_0x390e44[_0x8efc('0x49')],null))[_0x8efc('0x27')](respondWithResult(_0x355a9a,null))[_0x8efc('0x43')](handleError(_0x355a9a,null));};exports['destroy']=function(_0x55b4a8,_0x48cd3d){return db[_0x8efc('0x2d')]['find']({'where':{'id':_0x55b4a8[_0x8efc('0x4b')]['id']}})[_0x8efc('0x27')](handleEntityNotFound(_0x48cd3d,null))['then'](removeEntity(_0x48cd3d,null))[_0x8efc('0x43')](handleError(_0x48cd3d,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 663d978..b417341 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 _0x7485=['util','../../config/logger','moment','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash'];(function(_0x17cfb8,_0x48fd7f){var _0x481555=function(_0x5b63c1){while(--_0x5b63c1){_0x17cfb8['push'](_0x17cfb8['shift']());}};_0x481555(++_0x48fd7f);}(_0x7485,0xcf));var _0x5748=function(_0x52ffbf,_0x258fa9){_0x52ffbf=_0x52ffbf-0x0;var _0x168713=_0x7485[_0x52ffbf];return _0x168713;};'use strict';var _=require(_0x5748('0x0'));var util=require(_0x5748('0x1'));var logger=require(_0x5748('0x2'))('api');var moment=require(_0x5748('0x3'));var BPromise=require('bluebird');var rp=require(_0x5748('0x4'));var fs=require('fs');var path=require(_0x5748('0x5'));var rimraf=require('rimraf');var config=require(_0x5748('0x6'));var attributes=require(_0x5748('0x7'));module[_0x5748('0x8')]=function(_0xe6b2a1,_0x1f506c){return _0xe6b2a1[_0x5748('0x9')](_0x5748('0xa'),attributes,{'tableName':_0x5748('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5748('0xc')});}; \ No newline at end of file +var _0xe020=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications'];(function(_0x2556e6,_0x34a4fe){var _0x5c1423=function(_0x587cd0){while(--_0x587cd0){_0x2556e6['push'](_0x2556e6['shift']());}};_0x5c1423(++_0x34a4fe);}(_0xe020,0x1c1));var _0x0e02=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xe020[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x0e02('0x0'));var util=require(_0x0e02('0x1'));var logger=require('../../config/logger')(_0x0e02('0x2'));var moment=require(_0x0e02('0x3'));var BPromise=require(_0x0e02('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e02('0x5'));var rimraf=require(_0x0e02('0x6'));var config=require(_0x0e02('0x7'));var attributes=require(_0x0e02('0x8'));module[_0x0e02('0x9')]=function(_0x579900,_0x322ae8){return _0x579900[_0x0e02('0xa')](_0x0e02('0xb'),attributes,{'tableName':_0x0e02('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e02('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 134cc34..14f5208 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 _0x6f99=['options','raw','where','attributes','limit','info','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelApplication','update'];(function(_0x3c397a,_0x51d09f){var _0x4d65ef=function(_0x404e4e){while(--_0x404e4e){_0x3c397a['push'](_0x3c397a['shift']());}};_0x4d65ef(++_0x51d09f);}(_0x6f99,0xf7));var _0x96f9=function(_0x9d9e20,_0x18af8b){_0x9d9e20=_0x9d9e20-0x0;var _0x3c8a6e=_0x6f99[_0x9d9e20];return _0x3c8a6e;};'use strict';var _=require(_0x96f9('0x0'));var util=require(_0x96f9('0x1'));var moment=require(_0x96f9('0x2'));var BPromise=require(_0x96f9('0x3'));var rs=require(_0x96f9('0x4'));var fs=require('fs');var Redis=require(_0x96f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x96f9('0x6'));var logger=require('../../config/logger')(_0x96f9('0x7'));var config=require(_0x96f9('0x8'));var jayson=require(_0x96f9('0x9'));var client=jayson['client'][_0x96f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x414561,_0x469426,_0x12a006){return new BPromise(function(_0x367b29,_0x3a1fdb){return client['request'](_0x414561,_0x12a006)[_0x96f9('0xb')](function(_0x5e3153){logger['info'](_0x96f9('0xc'),_0x469426,_0x96f9('0xd'));logger[_0x96f9('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x469426,_0x96f9('0xd'),JSON[_0x96f9('0xf')](_0x5e3153));if(_0x5e3153['error']){if(_0x5e3153[_0x96f9('0x10')][_0x96f9('0x11')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x469426,_0x5e3153['error'][_0x96f9('0x12')]);return _0x3a1fdb(_0x5e3153[_0x96f9('0x10')][_0x96f9('0x12')]);}logger[_0x96f9('0x10')](_0x96f9('0xc'),_0x469426,_0x5e3153[_0x96f9('0x10')][_0x96f9('0x12')]);return _0x367b29(_0x5e3153[_0x96f9('0x10')]['message']);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x469426,_0x96f9('0xd'));_0x367b29(_0x5e3153[_0x96f9('0x13')][_0x96f9('0x12')]);}})[_0x96f9('0x14')](function(_0x47906a){logger[_0x96f9('0x10')](_0x96f9('0xc'),_0x469426,_0x47906a);_0x3a1fdb(_0x47906a);});});}exports['UpdateOpenchannelApplication']=function(_0x5cd19a){var _0x1cad9d=this;return new Promise(function(_0x7955aa,_0x126052){return db[_0x96f9('0x15')][_0x96f9('0x16')](_0x5cd19a['body'],{'raw':_0x5cd19a[_0x96f9('0x17')]?_0x5cd19a[_0x96f9('0x17')][_0x96f9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd19a['options']?_0x5cd19a[_0x96f9('0x17')][_0x96f9('0x19')]||null:null,'attributes':_0x5cd19a[_0x96f9('0x17')]?_0x5cd19a['options'][_0x96f9('0x1a')]||null:null,'limit':_0x5cd19a['options']?_0x5cd19a['options'][_0x96f9('0x1b')]||null:null})[_0x96f9('0xb')](function(_0x3f1b15){logger[_0x96f9('0x1c')](_0x96f9('0x1d'),_0x5cd19a);logger[_0x96f9('0xe')](_0x96f9('0x1d'),_0x5cd19a,JSON[_0x96f9('0xf')](_0x3f1b15));_0x7955aa(_0x3f1b15);})[_0x96f9('0x14')](function(_0x1743b9){logger[_0x96f9('0x10')](_0x96f9('0x1d'),_0x1743b9[_0x96f9('0x12')],_0x5cd19a);_0x126052(_0x1cad9d['error'](0x1f4,_0x1743b9[_0x96f9('0x12')]));});});}; \ No newline at end of file +var _0x65ae=['attributes','lodash','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw'];(function(_0x45f133,_0x17c20f){var _0x2ff2ea=function(_0xada865){while(--_0xada865){_0x45f133['push'](_0x45f133['shift']());}};_0x2ff2ea(++_0x17c20f);}(_0x65ae,0xe2));var _0xe65a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65ae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe65a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe65a('0x1'));var rs=require(_0xe65a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe65a('0x3'));var logger=require('../../config/logger')(_0xe65a('0x4'));var config=require(_0xe65a('0x5'));var jayson=require(_0xe65a('0x6'));var client=jayson[_0xe65a('0x7')][_0xe65a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x315ecb,_0x5d28cd,_0xda416b){return new BPromise(function(_0x5a2859,_0x5022d1){return client['request'](_0x315ecb,_0xda416b)[_0xe65a('0x9')](function(_0x51e253){logger['info'](_0xe65a('0xa'),_0x5d28cd,_0xe65a('0xb'));logger[_0xe65a('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5d28cd,_0xe65a('0xb'),JSON[_0xe65a('0xd')](_0x51e253));if(_0x51e253[_0xe65a('0xe')]){if(_0x51e253[_0xe65a('0xe')][_0xe65a('0xf')]===0x1f4){logger[_0xe65a('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x5d28cd,_0x51e253[_0xe65a('0xe')]['message']);return _0x5022d1(_0x51e253['error'][_0xe65a('0x10')]);}logger[_0xe65a('0xe')](_0xe65a('0xa'),_0x5d28cd,_0x51e253['error']['message']);return _0x5a2859(_0x51e253[_0xe65a('0xe')][_0xe65a('0x10')]);}else{logger[_0xe65a('0x11')](_0xe65a('0xa'),_0x5d28cd,'request\x20sent');_0x5a2859(_0x51e253['result'][_0xe65a('0x10')]);}})[_0xe65a('0x12')](function(_0x2c11e0){logger['error'](_0xe65a('0xa'),_0x5d28cd,_0x2c11e0);_0x5022d1(_0x2c11e0);});});}exports[_0xe65a('0x13')]=function(_0x177e02){var _0x2a45da=this;return new Promise(function(_0x142cc7,_0x14d5af){return db[_0xe65a('0x14')]['update'](_0x177e02[_0xe65a('0x15')],{'raw':_0x177e02[_0xe65a('0x16')]?_0x177e02[_0xe65a('0x16')][_0xe65a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x177e02[_0xe65a('0x16')]?_0x177e02['options']['where']||null:null,'attributes':_0x177e02[_0xe65a('0x16')]?_0x177e02['options'][_0xe65a('0x18')]||null:null,'limit':_0x177e02[_0xe65a('0x16')]?_0x177e02[_0xe65a('0x16')]['limit']||null:null})[_0xe65a('0x9')](function(_0x385cdc){logger[_0xe65a('0x11')]('UpdateOpenchannelApplication',_0x177e02);logger[_0xe65a('0xc')](_0xe65a('0x13'),_0x177e02,JSON[_0xe65a('0xd')](_0x385cdc));_0x142cc7(_0x385cdc);})[_0xe65a('0x12')](function(_0x1fa8cf){logger[_0xe65a('0xe')]('UpdateOpenchannelApplication',_0x1fa8cf[_0xe65a('0x10')],_0x177e02);_0x14d5af(_0x2a45da[_0xe65a('0xe')](0x1f4,_0x1fa8cf[_0xe65a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 2ae6858..a886466 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 _0x4747=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','download','post','create','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x47a11c,_0x303721){var _0x38ee89=function(_0x4fbf4d){while(--_0x4fbf4d){_0x47a11c['push'](_0x47a11c['shift']());}};_0x38ee89(++_0x303721);}(_0x4747,0x112));var _0x7474=function(_0x31aa84,_0x3bcc8b){_0x31aa84=_0x31aa84-0x0;var _0x2d9e3e=_0x4747[_0x31aa84];return _0x2d9e3e;};'use strict';var multer=require('multer');var util=require(_0x7474('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7474('0x1'));var router=express[_0x7474('0x2')]();var fs_extra=require(_0x7474('0x3'));var auth=require(_0x7474('0x4'));var interaction=require(_0x7474('0x5'));var config=require(_0x7474('0x6'));var controller=require(_0x7474('0x7'));router[_0x7474('0x8')]('/',auth[_0x7474('0x9')](),controller[_0x7474('0xa')]);router[_0x7474('0x8')]('/describe',auth[_0x7474('0x9')](),controller[_0x7474('0xb')]);router[_0x7474('0x8')](_0x7474('0xc'),auth['isAuthenticated'](),controller[_0x7474('0xd')]);router[_0x7474('0x8')]('/:id/messages',auth[_0x7474('0x9')](),controller[_0x7474('0xe')]);router[_0x7474('0x8')]('/:id/download',auth[_0x7474('0x9')](),controller[_0x7474('0xf')]);router[_0x7474('0x10')]('/',auth['isAuthenticated'](),controller[_0x7474('0x11')]);router[_0x7474('0x10')](_0x7474('0x12'),auth[_0x7474('0x9')](),controller['addMessage']);router[_0x7474('0x10')](_0x7474('0x13'),auth[_0x7474('0x9')](),interaction[_0x7474('0x14')](_0x7474('0x15'),_0x7474('0x16')),controller[_0x7474('0x17')]);router['put'](_0x7474('0xc'),auth[_0x7474('0x9')](),interaction[_0x7474('0x14')](_0x7474('0x15'),_0x7474('0x18')),controller[_0x7474('0x19')]);router['delete'](_0x7474('0xc'),auth[_0x7474('0x9')](),interaction[_0x7474('0x14')](_0x7474('0x15'),_0x7474('0x1a')),controller[_0x7474('0x1b')]);router['delete']('/:id/tags',auth[_0x7474('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x5c87=['openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked'];(function(_0x18451c,_0x1f5c0a){var _0x268d83=function(_0x15e4b2){while(--_0x15e4b2){_0x18451c['push'](_0x18451c['shift']());}};_0x268d83(++_0x1f5c0a);}(_0x5c87,0x1e9));var _0x75c8=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x5c87[_0x58dc25];return _0x21b0a7;};'use strict';var multer=require(_0x75c8('0x0'));var util=require('util');var path=require(_0x75c8('0x1'));var timeout=require(_0x75c8('0x2'));var express=require(_0x75c8('0x3'));var router=express[_0x75c8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x75c8('0x5'));var config=require(_0x75c8('0x6'));var controller=require(_0x75c8('0x7'));router[_0x75c8('0x8')]('/',auth[_0x75c8('0x9')](),controller['index']);router[_0x75c8('0x8')](_0x75c8('0xa'),auth[_0x75c8('0x9')](),controller[_0x75c8('0xb')]);router[_0x75c8('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x75c8('0xc'),auth[_0x75c8('0x9')](),controller[_0x75c8('0xd')]);router[_0x75c8('0x8')](_0x75c8('0xe'),auth['isAuthenticated'](),controller[_0x75c8('0xf')]);router['post']('/',auth[_0x75c8('0x9')](),controller[_0x75c8('0x10')]);router[_0x75c8('0x11')](_0x75c8('0xc'),auth[_0x75c8('0x9')](),controller[_0x75c8('0x12')]);router[_0x75c8('0x11')](_0x75c8('0x13'),auth[_0x75c8('0x9')](),interaction[_0x75c8('0x14')](_0x75c8('0x15'),_0x75c8('0x16')),controller[_0x75c8('0x17')]);router['put']('/:id',auth[_0x75c8('0x9')](),interaction[_0x75c8('0x14')]('openchannel',_0x75c8('0x18')),controller[_0x75c8('0x19')]);router[_0x75c8('0x1a')]('/:id',auth[_0x75c8('0x9')](),interaction[_0x75c8('0x14')](_0x75c8('0x15'),_0x75c8('0x1b')),controller[_0x75c8('0x1c')]);router['delete'](_0x75c8('0x13'),auth['isAuthenticated'](),controller[_0x75c8('0x1d')]);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 9b7e430..0f4bcd8 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 _0x6427=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x6427,0xbe));var _0x7642=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x6427[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require('sequelize');module[_0x7642('0x0')]={'closed':{'type':Sequelize[_0x7642('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7642('0x2')]},'disposition':{'type':Sequelize[_0x7642('0x3')]},'secondDisposition':{'type':Sequelize[_0x7642('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7642('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7642('0x2')]},'threadId':{'type':Sequelize[_0x7642('0x3')]},'externalUrl':{'type':Sequelize[_0x7642('0x3')]},'lastMsgAt':{'type':Sequelize[_0x7642('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x7642('0x4')]('in',_0x7642('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7642('0x4')]('in',_0x7642('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7642('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x7642('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8286=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3169fc,_0xf3d81e){var _0xcd8048=function(_0x3fefec){while(--_0x3fefec){_0x3169fc['push'](_0x3169fc['shift']());}};_0xcd8048(++_0xf3d81e);}(_0x8286,0x66));var _0x6828=function(_0x1c23ec,_0x4f632f){_0x1c23ec=_0x1c23ec-0x0;var _0x1e97a4=_0x8286[_0x1c23ec];return _0x1e97a4;};'use strict';var Sequelize=require(_0x6828('0x0'));module[_0x6828('0x1')]={'closed':{'type':Sequelize[_0x6828('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6828('0x3')]},'disposition':{'type':Sequelize[_0x6828('0x4')]},'secondDisposition':{'type':Sequelize[_0x6828('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6828('0x4')]},'note':{'type':Sequelize[_0x6828('0x4')]},'read1stAt':{'type':Sequelize[_0x6828('0x3')]},'threadId':{'type':Sequelize[_0x6828('0x4')]},'externalUrl':{'type':Sequelize[_0x6828('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x6828('0x5')]('in',_0x6828('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6828('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6828('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x6828('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 5310102..ab6505c 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 _0xaf34=['status','json','limit','count','offset','Content-Range','update','destroy','end','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','key','findAll','openchannel','query','user','then','catch','show','type','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','OpenchannelMessage','addMessage','omit','ids','findOne','hasOwnProperty','order','sort','where','OpenchannelInteractionId','filter','$gte','split','format','rows','addTags','spread','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','User','fullname','CmContact','Contact','lastName','Attachment','Messages','direction','secret','read','push','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','firstName','renderFile','views','downloadInteraction.ejs','.pdf','error','Unable\x20to\x20delete\x20zip\x20file','zip-dir','moment','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus'];(function(_0xb13d17,_0x1cd499){var _0x23c99e=function(_0x309af3){while(--_0x309af3){_0xb13d17['push'](_0xb13d17['shift']());}};_0x23c99e(++_0x1cd499);}(_0xaf34,0x1de));var _0x4af3=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xaf34[_0x53ccf2];return _0x5a2964;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4af3('0x0'));var moment=require(_0x4af3('0x1'));var util=require(_0x4af3('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4af3('0x3'));var Redis=require(_0x4af3('0x4'));var interaction=require(_0x4af3('0x5'));var qs=require(_0x4af3('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require(_0x4af3('0x7'));var db=require('../../mysqldb')['db'];config[_0x4af3('0x8')]=_[_0x4af3('0x9')](config[_0x4af3('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4af3('0xa'))(new Redis(config[_0x4af3('0x8')]));require(_0x4af3('0xb'))[_0x4af3('0xc')](socket);function respondWithStatusCode(_0xa2a8d0,_0x4bdac3){_0x4bdac3=_0x4bdac3||0xcc;return function(_0x565c8e){if(_0x565c8e){return _0xa2a8d0[_0x4af3('0xd')](_0x4bdac3);}return _0xa2a8d0[_0x4af3('0xe')](_0x4bdac3)['end']();};}function respondWithResult(_0x2cf927,_0x5f2726){_0x5f2726=_0x5f2726||0xc8;return function(_0x2fe025){if(_0x2fe025){return _0x2cf927[_0x4af3('0xe')](_0x5f2726)[_0x4af3('0xf')](_0x2fe025);}};}function respondWithFilteredResult(_0x45a2a5,_0x4ed2db){return function(_0x1cf435){if(_0x1cf435){var _0x346d2e=typeof _0x4ed2db['offset']==='undefined'&&typeof _0x4ed2db[_0x4af3('0x10')]==='undefined';var _0x48b73e=_0x1cf435[_0x4af3('0x11')];var _0x29064d=_0x346d2e?0x0:_0x4ed2db[_0x4af3('0x12')];var _0x593485=_0x346d2e?_0x1cf435[_0x4af3('0x11')]:_0x4ed2db[_0x4af3('0x12')]+_0x4ed2db['limit'];var _0x6d7e36;if(_0x593485>=_0x48b73e){_0x593485=_0x48b73e;_0x6d7e36=0xc8;}else{_0x6d7e36=0xce;}_0x45a2a5['status'](_0x6d7e36);return _0x45a2a5['set'](_0x4af3('0x13'),_0x29064d+'-'+_0x593485+'/'+_0x48b73e)[_0x4af3('0xf')](_0x1cf435);}return null;};}function saveUpdates(_0x5b0d14){return function(_0x542427){if(_0x542427){return _0x542427[_0x4af3('0x14')](_0x5b0d14)['then'](function(_0x561795){return _0x561795;});}return null;};}function removeEntity(_0x553588){return function(_0x25a6fc){if(_0x25a6fc){return _0x25a6fc[_0x4af3('0x15')]()['then'](function(){_0x553588[_0x4af3('0xe')](0xcc)[_0x4af3('0x16')]();});}};}function handleEntityNotFound(_0x42a7dc){return function(_0x271f47){if(!_0x271f47){_0x42a7dc[_0x4af3('0xd')](0x194);}return _0x271f47;};}function handleError(_0x470e2a,_0x3687fb){_0x3687fb=_0x3687fb||0x1f4;return function(_0xce51c7){logger['error'](_0xce51c7[_0x4af3('0x17')]);if(_0xce51c7[_0x4af3('0x18')]){delete _0xce51c7[_0x4af3('0x18')];}_0x470e2a[_0x4af3('0xe')](_0x3687fb)[_0x4af3('0x19')](_0xce51c7);};}exports[_0x4af3('0x1a')]=function(_0x4779b3,_0x1c91a8){var _0x13eb2d={};var _0x306c7a=_[_0x4af3('0x1b')](db[_0x4af3('0x1c')][_0x4af3('0x1d')],function(_0x59bf54){return{'name':_0x59bf54['fieldName'],'type':_0x59bf54['type'][_0x4af3('0x1e')]};});_0x13eb2d=qs['getOptions'](_0x306c7a,_0x4779b3);return interaction[_0x4af3('0x1f')](_0x4af3('0x20'),_0x4779b3[_0x4af3('0x21')],_0x4779b3[_0x4af3('0x22')],_0x13eb2d,_0x306c7a)[_0x4af3('0x23')](respondWithFilteredResult(_0x1c91a8,_0x13eb2d))[_0x4af3('0x24')](handleError(_0x1c91a8,null));};exports[_0x4af3('0x25')]=function(_0x3e3e2c,_0xa0574){var _0x247c09={};if(_0x3e3e2c[_0x4af3('0x21')][_0x4af3('0x26')]&&_0x3e3e2c[_0x4af3('0x21')]['type']==='from'){_0x247c09[_0x4af3('0x27')]=_0x3e3e2c[_0x4af3('0x28')]['id'];}else{_0x247c09['id']=_0x3e3e2c[_0x4af3('0x28')]['id'];}var _0x3dd150={'raw':![],'where':_0x247c09},_0x5a0244={};_0x5a0244[_0x4af3('0x29')]=_[_0x4af3('0x2a')](db[_0x4af3('0x1c')][_0x4af3('0x1d')]);_0x5a0244[_0x4af3('0x21')]=_['keys'](_0x3e3e2c[_0x4af3('0x21')]);_0x5a0244[_0x4af3('0x2b')]=_[_0x4af3('0x2c')](_0x5a0244[_0x4af3('0x29')],_0x5a0244[_0x4af3('0x21')]);_0x3dd150[_0x4af3('0x2d')]=_[_0x4af3('0x2c')](_0x5a0244[_0x4af3('0x29')],qs[_0x4af3('0x2e')](_0x3e3e2c[_0x4af3('0x21')][_0x4af3('0x2e')]));_0x3dd150[_0x4af3('0x2d')]=_0x3dd150[_0x4af3('0x2d')][_0x4af3('0x2f')]?_0x3dd150[_0x4af3('0x2d')]:_0x5a0244[_0x4af3('0x29')];if(_0x3e3e2c['query'][_0x4af3('0x30')]){_0x3dd150[_0x4af3('0x31')]=[{'all':!![]}];}_0x3dd150=_[_0x4af3('0x32')]({},_0x3dd150,_0x3e3e2c[_0x4af3('0x33')]);return db[_0x4af3('0x1c')][_0x4af3('0x34')](_0x3dd150)['then'](handleEntityNotFound(_0xa0574,null))['then'](respondWithResult(_0xa0574,null))[_0x4af3('0x24')](handleError(_0xa0574,null));};exports[_0x4af3('0x35')]=function(_0x2d8989,_0x5b5f43){return db[_0x4af3('0x1c')]['create'](_0x2d8989[_0x4af3('0x36')],{})['then'](respondWithResult(_0x5b5f43,0xc9))[_0x4af3('0x24')](handleError(_0x5b5f43,null));};exports[_0x4af3('0x14')]=function(_0x9e3d,_0x35bf5a){if(_0x9e3d[_0x4af3('0x36')]['id']){delete _0x9e3d[_0x4af3('0x36')]['id'];}return db[_0x4af3('0x1c')][_0x4af3('0x34')]({'where':{'id':_0x9e3d['params']['id']}})[_0x4af3('0x23')](handleEntityNotFound(_0x35bf5a,null))['then'](saveUpdates(_0x9e3d[_0x4af3('0x36')],null))[_0x4af3('0x23')](respondWithResult(_0x35bf5a,null))[_0x4af3('0x24')](handleError(_0x35bf5a,null));};exports[_0x4af3('0x15')]=function(_0xd11350,_0x38078f){return db[_0x4af3('0x1c')][_0x4af3('0x34')]({'where':{'id':_0xd11350[_0x4af3('0x28')]['id']}})[_0x4af3('0x23')](handleEntityNotFound(_0x38078f,null))[_0x4af3('0x23')](removeEntity(_0x38078f,null))[_0x4af3('0x24')](handleError(_0x38078f,null));};exports['describe']=function(_0xa4b341,_0x49d63a){return db['OpenchannelInteraction']['describe']()[_0x4af3('0x23')](respondWithResult(_0x49d63a,null))[_0x4af3('0x24')](handleError(_0x49d63a,null));};exports['addMessage']=function(_0x226bd2,_0x428e50){return db[_0x4af3('0x37')][_0x4af3('0x34')]({'where':{'id':_0x226bd2[_0x4af3('0x28')]['id']}})[_0x4af3('0x23')](handleEntityNotFound(_0x428e50,null))[_0x4af3('0x23')](function(_0x2747ac){if(_0x2747ac){return _0x2747ac[_0x4af3('0x38')](_0x226bd2['body']['ids'],_[_0x4af3('0x39')](_0x226bd2['body'],[_0x4af3('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x428e50,null))['catch'](handleError(_0x428e50,null));};exports['getMessages']=function(_0x17b635,_0x10ceba){var _0x15fbf7={'raw':![],'where':{}};var _0x7b108f={};var _0x5f9f98={'count':0x0,'rows':[]};return db[_0x4af3('0x1c')][_0x4af3('0x3b')]({'where':{'id':_0x17b635[_0x4af3('0x28')]['id']}})['then'](handleEntityNotFound(_0x10ceba,null))[_0x4af3('0x23')](function(_0x5130c3){if(_0x5130c3){_0x7b108f[_0x4af3('0x29')]=_[_0x4af3('0x2a')](db[_0x4af3('0x37')][_0x4af3('0x1d')]);_0x7b108f[_0x4af3('0x21')]=_[_0x4af3('0x2a')](_0x17b635['query']);_0x7b108f[_0x4af3('0x2b')]=_[_0x4af3('0x2c')](_0x7b108f[_0x4af3('0x29')],_0x7b108f[_0x4af3('0x21')]);_0x15fbf7['attributes']=_['intersection'](_0x7b108f['model'],qs[_0x4af3('0x2e')](_0x17b635[_0x4af3('0x21')][_0x4af3('0x2e')]));_0x15fbf7[_0x4af3('0x2d')]=_0x15fbf7[_0x4af3('0x2d')]['length']?_0x15fbf7[_0x4af3('0x2d')]:_0x7b108f[_0x4af3('0x29')];if(!_0x17b635[_0x4af3('0x21')][_0x4af3('0x3c')]('nolimit')){_0x15fbf7['limit']=qs[_0x4af3('0x10')](_0x17b635['query'][_0x4af3('0x10')]);_0x15fbf7[_0x4af3('0x12')]=qs[_0x4af3('0x12')](_0x17b635['query']['offset']);}_0x15fbf7[_0x4af3('0x3d')]=qs[_0x4af3('0x3e')](_0x17b635[_0x4af3('0x21')][_0x4af3('0x3e')]);_0x15fbf7['where']=qs[_0x4af3('0x2b')](_['pick'](_0x17b635['query'],_0x7b108f[_0x4af3('0x2b')]));_0x15fbf7[_0x4af3('0x3f')][_0x4af3('0x40')]=_0x5130c3['id'];if(_0x17b635[_0x4af3('0x21')][_0x4af3('0x41')]){_0x15fbf7['where']=_[_0x4af3('0x32')](_0x15fbf7[_0x4af3('0x3f')],{'$or':_[_0x4af3('0x1b')](_0x15fbf7['attributes'],function(_0xaaa08a){var _0x2da05d={};_0x2da05d[_0xaaa08a]={'$like':'%'+_0x17b635[_0x4af3('0x21')][_0x4af3('0x41')]+'%'};return _0x2da05d;})});}if(_0x17b635['query'][_0x4af3('0x42')]){var _0x5606d=_0x17b635[_0x4af3('0x21')][_0x4af3('0x42')][_0x4af3('0x43')](',');var _0x2c326c={};_0x2c326c[_0x5606d[0x0]]={'$gte':moment(_0x5606d[0x1])[_0x4af3('0x44')]('YYYY-MM-DD\x20HH:mm:ss')};_0x15fbf7['where']=_['merge'](_0x15fbf7[_0x4af3('0x3f')],_0x2c326c);}_0x15fbf7=_[_0x4af3('0x32')]({},_0x15fbf7,_0x17b635['options']);return db[_0x4af3('0x37')]['count']({'where':_0x15fbf7['where']})[_0x4af3('0x23')](function(_0x5c3e8a){_0x5f9f98[_0x4af3('0x11')]=_0x5c3e8a;if(_0x17b635[_0x4af3('0x21')]['includeAll']){_0x15fbf7[_0x4af3('0x31')]=[{'all':!![]}];}return db[_0x4af3('0x37')][_0x4af3('0x1f')](_0x15fbf7);})['then'](function(_0x3c495c){_0x5f9f98[_0x4af3('0x45')]=_0x3c495c;return _0x5f9f98;});}})['then'](respondWithFilteredResult(_0x10ceba,_0x15fbf7))['catch'](handleError(_0x10ceba,null));};exports[_0x4af3('0x46')]=function(_0x486b8e,_0x1ba292){return db['OpenchannelInteraction'][_0x4af3('0x34')]({'where':{'id':_0x486b8e[_0x4af3('0x28')]['id']}})['then'](handleEntityNotFound(_0x1ba292,null))[_0x4af3('0x23')](function(_0x4b9ecc){if(_0x4b9ecc){return _0x4b9ecc['setTags'](_0x486b8e[_0x4af3('0x36')][_0x4af3('0x3a')],_[_0x4af3('0x39')](_0x486b8e[_0x4af3('0x36')],[_0x4af3('0x3a'),'id'])||{})[_0x4af3('0x47')](function(){return db[_0x4af3('0x48')][_0x4af3('0x1f')]({'attributes':['id',_0x4af3('0x18'),_0x4af3('0x49')],'where':{'id':_0x486b8e[_0x4af3('0x36')][_0x4af3('0x3a')]}});})['then'](function(_0x4a3574){socket['emit'](_0x4af3('0x4a'),{'id':Number(_0x486b8e['params']['id']),'tags':_0x4a3574||[]});return{'id':Number(_0x486b8e['params']['id']),'tags':_0x4a3574||[]};});}})['then'](respondWithResult(_0x1ba292,null))[_0x4af3('0x24')](handleError(_0x1ba292,null));};exports[_0x4af3('0x4b')]=function(_0x1f021c,_0x111f43){return db[_0x4af3('0x1c')]['find']({'where':{'id':_0x1f021c[_0x4af3('0x28')]['id']}})['then'](handleEntityNotFound(_0x111f43,null))['then'](function(_0x1c02f1){if(_0x1c02f1){return _0x1c02f1['removeTags'](_0x1f021c[_0x4af3('0x21')][_0x4af3('0x3a')]);}})['then'](respondWithStatusCode(_0x111f43,null))[_0x4af3('0x24')](handleError(_0x111f43,null));};exports[_0x4af3('0x4c')]=function(_0x3460cd,_0x253c75){var _0x2322df=moment()[_0x4af3('0x4d')]()[_0x4af3('0x4e')]();var _0x237519=path[_0x4af3('0x4f')](config[_0x4af3('0x50')],_0x4af3('0x51'),'files',_0x4af3('0x52'));var _0x5a1084=path['join'](config[_0x4af3('0x50')],_0x4af3('0x51'),_0x4af3('0x53'),_0x4af3('0x54'));var _0x3ae197=path['join'](_0x237519,_0x2322df);var _0x3fb853=util[_0x4af3('0x44')](_0x4af3('0x55'),_0x3460cd['params']['id'],_0x2322df);var _0x492947=path[_0x4af3('0x4f')](_0x237519,_0x3fb853);var _0x21e7e6=[];_0x21e7e6['push']({'model':db[_0x4af3('0x56')],'as':_0x4af3('0x56'),'attributes':['id',_0x4af3('0x57')],'raw':!![]});_0x21e7e6['push']({'model':db[_0x4af3('0x58')],'as':_0x4af3('0x59'),'attributes':['id','firstName',_0x4af3('0x5a')],'raw':!![]});if(_0x3460cd[_0x4af3('0x21')][_0x4af3('0x54')]){_0x21e7e6['push']({'model':db[_0x4af3('0x5b')],'as':_0x4af3('0x5b'),'raw':!![]});}var _0x47b1f1=[{'model':db[_0x4af3('0x37')],'as':_0x4af3('0x5c'),'attributes':['id',_0x4af3('0x36'),'createdAt',_0x4af3('0x5d'),_0x4af3('0x5e'),_0x4af3('0x5f')],'include':_0x21e7e6}];_0x47b1f1[_0x4af3('0x60')]({'model':db[_0x4af3('0x61')],'as':_0x4af3('0x62'),'attributes':['id',_0x4af3('0x18')]});_0x47b1f1[_0x4af3('0x60')]({'model':db[_0x4af3('0x56')],'as':_0x4af3('0x63'),'attributes':['id',_0x4af3('0x57')]});return db[_0x4af3('0x1c')][_0x4af3('0x34')]({'where':{'id':_0x3460cd[_0x4af3('0x28')]['id']},'include':_0x47b1f1})[_0x4af3('0x23')](handleEntityNotFound(_0x253c75,null))['then'](function(_0x315ea2){if(_0x315ea2){var _0x365dfa=_0x315ea2['get']({'plain':!![]});fs[_0x4af3('0x64')](_0x3ae197);var _0x226df7={'channel':_0x4af3('0x65'),'account':_0x365dfa[_0x4af3('0x62')]['name'],'agent':_0x365dfa[_0x4af3('0x63')]?_0x365dfa['Owner'][_0x4af3('0x57')]:'N.A.','createdAt':moment(_0x365dfa[_0x4af3('0x66')])[_0x4af3('0x44')](_0x4af3('0x67'))[_0x4af3('0x4e')](),'closedAt':_0x365dfa[_0x4af3('0x68')]?moment(_0x365dfa[_0x4af3('0x69')])['format'](_0x4af3('0x67'))[_0x4af3('0x4e')]():'','disposition':_0x365dfa[_0x4af3('0x6a')],'visibility':_0x365dfa[_0x4af3('0x6b')]?_0x4af3('0x6c'):_0x4af3('0x6d'),'messages':_(_0x365dfa['Messages'])[_0x4af3('0x41')]({'secret':![]})[_0x4af3('0x1b')](function(_0x2dd896){if(_0x2dd896[_0x4af3('0x5b')]){var _0x2bd53c=path[_0x4af3('0x4f')](_0x5a1084,_0x2dd896[_0x4af3('0x5b')][_0x4af3('0x6e')]);if(fs[_0x4af3('0x6f')](_0x2bd53c)){fs['createReadStream'](_0x2bd53c)[_0x4af3('0x70')](fs[_0x4af3('0x71')](path['join'](_0x3ae197,_0x2dd896['Attachment'][_0x4af3('0x6e')])));}}return{'date':moment(_0x2dd896[_0x4af3('0x66')])['format'](_0x4af3('0x67'))[_0x4af3('0x4e')](),'sender':_0x2dd896[_0x4af3('0x5d')]===_0x4af3('0x72')?_0x2dd896[_0x4af3('0x56')]?_0x2dd896[_0x4af3('0x56')][_0x4af3('0x57')]:_0x4af3('0x73'):_0x2dd896[_0x4af3('0x59')][_0x4af3('0x74')]+(_0x2dd896[_0x4af3('0x59')][_0x4af3('0x5a')]?'\x20'+_0x2dd896[_0x4af3('0x59')][_0x4af3('0x5a')]:''),'body':_0x2dd896['Attachment']?_0x2dd896['Attachment'][_0x4af3('0x6e')]:_0x2dd896[_0x4af3('0x36')],'direction':_0x2dd896[_0x4af3('0x5d')]==='out'?'A':'C','secret':_0x2dd896['secret'],'read':_0x2dd896[_0x4af3('0x5f')],'attachment':_0x2dd896[_0x4af3('0x5b')]};})['value']()};return ejs[_0x4af3('0x75')](path[_0x4af3('0x4f')](config[_0x4af3('0x50')],_0x4af3('0x51'),_0x4af3('0x76'),_0x4af3('0x77')),{'interaction':_0x226df7})['then'](function(_0x1fc477){var _0x5e2949=path['join'](_0x3ae197,'transcript-'+_0x365dfa['id']+'-'+_0x2322df+_0x4af3('0x78'));var _0x562612={'path':_0x5e2949,'channel':_0x4af3('0x65'),'interactionId':_0x365dfa['id']};return pdf['createPdfFromHTML'](_0x1fc477,_0x562612);})[_0x4af3('0x23')](function(){return new Promise(function(_0x195c04,_0x43d1eb){zipdir(_0x3ae197,{'saveTo':_0x492947},function(_0x3eb796,_0x22839f){if(_0x3eb796)return _0x43d1eb(_0x3eb796);return _0x195c04(_0x22839f);});})[_0x4af3('0x23')](function(){return new Promise(function(_0x66105a,_0x5ec17b){rimraf(_0x3ae197,function(_0x3562c0){if(_0x3562c0)_0x5ec17b(_0x3562c0);return _0x66105a();});});})[_0x4af3('0x23')](function(){return _0x253c75[_0x4af3('0x4c')](_0x492947,_0x3fb853,function(_0x550564){if(_0x550564){logger[_0x4af3('0x79')](_0x4af3('0x7a'),_0x550564);}else{fs['unlinkSync'](_0x492947);}});});});}else{return _0x253c75[_0x4af3('0xd')](0xc8);}})[_0x4af3('0x24')](handleError(_0x253c75,null));}; \ No newline at end of file +var _0x4f1f=['read','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','disposition','threadId','Public','Private','basename','createReadStream','pipe','toString','System','Contact','firstName','lastName','out','renderFile','views','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','destroy','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','length','nolimit','sort','where','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Attachment','Messages','createdAt','direction','secret'];(function(_0x4591c7,_0x4e56bf){var _0x5eb6f5=function(_0x283f08){while(--_0x283f08){_0x4591c7['push'](_0x4591c7['shift']());}};_0x5eb6f5(++_0x4e56bf);}(_0x4f1f,0x195));var _0xf4f1=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x4f1f[_0x24061a];return _0x82054e;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xf4f1('0x0'));var moment=require(_0xf4f1('0x1'));var util=require('util');var path=require('path');var ejs=require(_0xf4f1('0x2'));var fs=require('fs');var _=require(_0xf4f1('0x3'));var Redis=require(_0xf4f1('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0xf4f1('0x5'));var pdf=require('../../components/export/pdf');var logger=require(_0xf4f1('0x6'))(_0xf4f1('0x7'));var config=require(_0xf4f1('0x8'));var db=require('../../mysqldb')['db'];config[_0xf4f1('0x9')]=_['defaults'](config[_0xf4f1('0x9')],{'host':_0xf4f1('0xa'),'port':0x18eb});var socket=require(_0xf4f1('0xb'))(new Redis(config[_0xf4f1('0x9')]));require(_0xf4f1('0xc'))[_0xf4f1('0xd')](socket);function respondWithStatusCode(_0x29146c,_0x45ebf6){_0x45ebf6=_0x45ebf6||0xcc;return function(_0x18996f){if(_0x18996f){return _0x29146c[_0xf4f1('0xe')](_0x45ebf6);}return _0x29146c[_0xf4f1('0xf')](_0x45ebf6)[_0xf4f1('0x10')]();};}function respondWithResult(_0x52ce59,_0x1b9442){_0x1b9442=_0x1b9442||0xc8;return function(_0x1efde6){if(_0x1efde6){return _0x52ce59[_0xf4f1('0xf')](_0x1b9442)[_0xf4f1('0x11')](_0x1efde6);}};}function respondWithFilteredResult(_0x2c32a7,_0x1a0ec5){return function(_0x2e3dc5){if(_0x2e3dc5){var _0x5274a4=typeof _0x1a0ec5[_0xf4f1('0x12')]===_0xf4f1('0x13')&&typeof _0x1a0ec5[_0xf4f1('0x14')]===_0xf4f1('0x13');var _0x4ccbee=_0x2e3dc5[_0xf4f1('0x15')];var _0x12bae3=_0x5274a4?0x0:_0x1a0ec5[_0xf4f1('0x12')];var _0xa6e710=_0x5274a4?_0x2e3dc5['count']:_0x1a0ec5[_0xf4f1('0x12')]+_0x1a0ec5[_0xf4f1('0x14')];var _0x428257;if(_0xa6e710>=_0x4ccbee){_0xa6e710=_0x4ccbee;_0x428257=0xc8;}else{_0x428257=0xce;}_0x2c32a7['status'](_0x428257);return _0x2c32a7[_0xf4f1('0x16')]('Content-Range',_0x12bae3+'-'+_0xa6e710+'/'+_0x4ccbee)[_0xf4f1('0x11')](_0x2e3dc5);}return null;};}function saveUpdates(_0x54581a){return function(_0x57a7cf){if(_0x57a7cf){return _0x57a7cf[_0xf4f1('0x17')](_0x54581a)['then'](function(_0x1703d3){return _0x1703d3;});}return null;};}function removeEntity(_0x3ff8d3){return function(_0x5455bc){if(_0x5455bc){return _0x5455bc['destroy']()[_0xf4f1('0x18')](function(){_0x3ff8d3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b014){return function(_0x30c42e){if(!_0x30c42e){_0x14b014[_0xf4f1('0xe')](0x194);}return _0x30c42e;};}function handleError(_0x5cfb47,_0x503805){_0x503805=_0x503805||0x1f4;return function(_0xaa9413){logger[_0xf4f1('0x19')](_0xaa9413[_0xf4f1('0x1a')]);if(_0xaa9413[_0xf4f1('0x1b')]){delete _0xaa9413[_0xf4f1('0x1b')];}_0x5cfb47[_0xf4f1('0xf')](_0x503805)[_0xf4f1('0x1c')](_0xaa9413);};}exports[_0xf4f1('0x1d')]=function(_0x45ae12,_0x5edf31){var _0x69c0ee={};var _0x64e921=_[_0xf4f1('0x1e')](db[_0xf4f1('0x1f')][_0xf4f1('0x20')],function(_0x447139){return{'name':_0x447139[_0xf4f1('0x21')],'type':_0x447139[_0xf4f1('0x22')][_0xf4f1('0x23')]};});_0x69c0ee=qs[_0xf4f1('0x24')](_0x64e921,_0x45ae12);return interaction[_0xf4f1('0x25')](_0xf4f1('0x26'),_0x45ae12[_0xf4f1('0x27')],_0x45ae12[_0xf4f1('0x28')],_0x69c0ee,_0x64e921)[_0xf4f1('0x18')](respondWithFilteredResult(_0x5edf31,_0x69c0ee))[_0xf4f1('0x29')](handleError(_0x5edf31,null));};exports[_0xf4f1('0x2a')]=function(_0x2f1ec2,_0x2368de){var _0xe3b2d7={};if(_0x2f1ec2[_0xf4f1('0x27')][_0xf4f1('0x22')]&&_0x2f1ec2[_0xf4f1('0x27')][_0xf4f1('0x22')]==='from'){_0xe3b2d7[_0xf4f1('0x2b')]=_0x2f1ec2[_0xf4f1('0x2c')]['id'];}else{_0xe3b2d7['id']=_0x2f1ec2[_0xf4f1('0x2c')]['id'];}var _0x49ea0b={'raw':![],'where':_0xe3b2d7},_0x1ba4d7={};_0x1ba4d7[_0xf4f1('0x2d')]=_[_0xf4f1('0x2e')](db[_0xf4f1('0x1f')][_0xf4f1('0x20')]);_0x1ba4d7['query']=_[_0xf4f1('0x2e')](_0x2f1ec2[_0xf4f1('0x27')]);_0x1ba4d7[_0xf4f1('0x2f')]=_[_0xf4f1('0x30')](_0x1ba4d7[_0xf4f1('0x2d')],_0x1ba4d7['query']);_0x49ea0b[_0xf4f1('0x31')]=_[_0xf4f1('0x30')](_0x1ba4d7[_0xf4f1('0x2d')],qs[_0xf4f1('0x32')](_0x2f1ec2[_0xf4f1('0x27')][_0xf4f1('0x32')]));_0x49ea0b[_0xf4f1('0x31')]=_0x49ea0b[_0xf4f1('0x31')]['length']?_0x49ea0b[_0xf4f1('0x31')]:_0x1ba4d7[_0xf4f1('0x2d')];if(_0x2f1ec2['query'][_0xf4f1('0x33')]){_0x49ea0b['include']=[{'all':!![]}];}_0x49ea0b=_[_0xf4f1('0x34')]({},_0x49ea0b,_0x2f1ec2[_0xf4f1('0x35')]);return db[_0xf4f1('0x1f')][_0xf4f1('0x36')](_0x49ea0b)[_0xf4f1('0x18')](handleEntityNotFound(_0x2368de,null))[_0xf4f1('0x18')](respondWithResult(_0x2368de,null))['catch'](handleError(_0x2368de,null));};exports[_0xf4f1('0x37')]=function(_0x272103,_0x1dde94){return db[_0xf4f1('0x1f')][_0xf4f1('0x37')](_0x272103[_0xf4f1('0x38')],{})['then'](respondWithResult(_0x1dde94,0xc9))[_0xf4f1('0x29')](handleError(_0x1dde94,null));};exports[_0xf4f1('0x17')]=function(_0x10d983,_0x5f3691){if(_0x10d983[_0xf4f1('0x38')]['id']){delete _0x10d983[_0xf4f1('0x38')]['id'];}return db[_0xf4f1('0x1f')][_0xf4f1('0x36')]({'where':{'id':_0x10d983['params']['id']}})[_0xf4f1('0x18')](handleEntityNotFound(_0x5f3691,null))[_0xf4f1('0x18')](saveUpdates(_0x10d983['body'],null))[_0xf4f1('0x18')](respondWithResult(_0x5f3691,null))['catch'](handleError(_0x5f3691,null));};exports[_0xf4f1('0x39')]=function(_0x4dbc1c,_0x32efb9){return db[_0xf4f1('0x1f')][_0xf4f1('0x36')]({'where':{'id':_0x4dbc1c['params']['id']}})[_0xf4f1('0x18')](handleEntityNotFound(_0x32efb9,null))[_0xf4f1('0x18')](removeEntity(_0x32efb9,null))[_0xf4f1('0x29')](handleError(_0x32efb9,null));};exports[_0xf4f1('0x3a')]=function(_0x3603d0,_0x942ddd){return db['OpenchannelInteraction'][_0xf4f1('0x3a')]()['then'](respondWithResult(_0x942ddd,null))[_0xf4f1('0x29')](handleError(_0x942ddd,null));};exports['addMessage']=function(_0x3b4226,_0x212f60){return db[_0xf4f1('0x3b')][_0xf4f1('0x36')]({'where':{'id':_0x3b4226[_0xf4f1('0x2c')]['id']}})[_0xf4f1('0x18')](handleEntityNotFound(_0x212f60,null))[_0xf4f1('0x18')](function(_0x1a58ce){if(_0x1a58ce){return _0x1a58ce[_0xf4f1('0x3c')](_0x3b4226[_0xf4f1('0x38')][_0xf4f1('0x3d')],_[_0xf4f1('0x3e')](_0x3b4226[_0xf4f1('0x38')],[_0xf4f1('0x3d'),'id'])||{});}})[_0xf4f1('0x18')](respondWithResult(_0x212f60,null))['catch'](handleError(_0x212f60,null));};exports[_0xf4f1('0x3f')]=function(_0x235461,_0x245b83){var _0x5d3d86={'raw':![],'where':{}};var _0x298911={};var _0x35b4e6={'count':0x0,'rows':[]};return db[_0xf4f1('0x1f')]['findOne']({'where':{'id':_0x235461[_0xf4f1('0x2c')]['id']}})[_0xf4f1('0x18')](handleEntityNotFound(_0x245b83,null))[_0xf4f1('0x18')](function(_0x52b344){if(_0x52b344){_0x298911[_0xf4f1('0x2d')]=_['keys'](db[_0xf4f1('0x3b')][_0xf4f1('0x20')]);_0x298911['query']=_['keys'](_0x235461[_0xf4f1('0x27')]);_0x298911[_0xf4f1('0x2f')]=_['intersection'](_0x298911[_0xf4f1('0x2d')],_0x298911[_0xf4f1('0x27')]);_0x5d3d86[_0xf4f1('0x31')]=_[_0xf4f1('0x30')](_0x298911[_0xf4f1('0x2d')],qs[_0xf4f1('0x32')](_0x235461[_0xf4f1('0x27')][_0xf4f1('0x32')]));_0x5d3d86[_0xf4f1('0x31')]=_0x5d3d86['attributes'][_0xf4f1('0x40')]?_0x5d3d86['attributes']:_0x298911[_0xf4f1('0x2d')];if(!_0x235461[_0xf4f1('0x27')]['hasOwnProperty'](_0xf4f1('0x41'))){_0x5d3d86[_0xf4f1('0x14')]=qs['limit'](_0x235461['query'][_0xf4f1('0x14')]);_0x5d3d86['offset']=qs['offset'](_0x235461['query']['offset']);}_0x5d3d86['order']=qs[_0xf4f1('0x42')](_0x235461['query'][_0xf4f1('0x42')]);_0x5d3d86[_0xf4f1('0x43')]=qs[_0xf4f1('0x2f')](_[_0xf4f1('0x44')](_0x235461[_0xf4f1('0x27')],_0x298911[_0xf4f1('0x2f')]));_0x5d3d86[_0xf4f1('0x43')]['OpenchannelInteractionId']=_0x52b344['id'];if(_0x235461[_0xf4f1('0x27')][_0xf4f1('0x45')]){_0x5d3d86[_0xf4f1('0x43')]=_[_0xf4f1('0x34')](_0x5d3d86[_0xf4f1('0x43')],{'$or':_['map'](_0x5d3d86[_0xf4f1('0x31')],function(_0x11ff04){var _0x1e3773={};_0x1e3773[_0x11ff04]={'$like':'%'+_0x235461['query'][_0xf4f1('0x45')]+'%'};return _0x1e3773;})});}if(_0x235461['query'][_0xf4f1('0x46')]){var _0x11451c=_0x235461[_0xf4f1('0x27')][_0xf4f1('0x46')]['split'](',');var _0x21bb51={};_0x21bb51[_0x11451c[0x0]]={'$gte':moment(_0x11451c[0x1])[_0xf4f1('0x47')](_0xf4f1('0x48'))};_0x5d3d86['where']=_[_0xf4f1('0x34')](_0x5d3d86[_0xf4f1('0x43')],_0x21bb51);}_0x5d3d86=_[_0xf4f1('0x34')]({},_0x5d3d86,_0x235461[_0xf4f1('0x35')]);return db[_0xf4f1('0x3b')][_0xf4f1('0x15')]({'where':_0x5d3d86[_0xf4f1('0x43')]})[_0xf4f1('0x18')](function(_0x520128){_0x35b4e6['count']=_0x520128;if(_0x235461[_0xf4f1('0x27')][_0xf4f1('0x33')]){_0x5d3d86[_0xf4f1('0x49')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xf4f1('0x25')](_0x5d3d86);})['then'](function(_0x125b26){_0x35b4e6[_0xf4f1('0x4a')]=_0x125b26;return _0x35b4e6;});}})[_0xf4f1('0x18')](respondWithFilteredResult(_0x245b83,_0x5d3d86))[_0xf4f1('0x29')](handleError(_0x245b83,null));};exports[_0xf4f1('0x4b')]=function(_0x21103c,_0x25302b){return db[_0xf4f1('0x1f')]['find']({'where':{'id':_0x21103c[_0xf4f1('0x2c')]['id']}})[_0xf4f1('0x18')](handleEntityNotFound(_0x25302b,null))[_0xf4f1('0x18')](function(_0x18b482){if(_0x18b482){return _0x18b482['setTags'](_0x21103c[_0xf4f1('0x38')]['ids'],_['omit'](_0x21103c[_0xf4f1('0x38')],[_0xf4f1('0x3d'),'id'])||{})[_0xf4f1('0x4c')](function(){return db['Tag'][_0xf4f1('0x25')]({'attributes':['id',_0xf4f1('0x1b'),_0xf4f1('0x4d')],'where':{'id':_0x21103c['body'][_0xf4f1('0x3d')]}});})[_0xf4f1('0x18')](function(_0x54ed75){socket[_0xf4f1('0x4e')](_0xf4f1('0x4f'),{'id':Number(_0x21103c['params']['id']),'tags':_0x54ed75||[]});return{'id':Number(_0x21103c[_0xf4f1('0x2c')]['id']),'tags':_0x54ed75||[]};});}})[_0xf4f1('0x18')](respondWithResult(_0x25302b,null))[_0xf4f1('0x29')](handleError(_0x25302b,null));};exports['removeTags']=function(_0x56f631,_0xeea638){return db[_0xf4f1('0x1f')][_0xf4f1('0x36')]({'where':{'id':_0x56f631[_0xf4f1('0x2c')]['id']}})[_0xf4f1('0x18')](handleEntityNotFound(_0xeea638,null))[_0xf4f1('0x18')](function(_0x5c6a85){if(_0x5c6a85){return _0x5c6a85[_0xf4f1('0x50')](_0x56f631[_0xf4f1('0x27')][_0xf4f1('0x3d')]);}})[_0xf4f1('0x18')](respondWithStatusCode(_0xeea638,null))['catch'](handleError(_0xeea638,null));};exports[_0xf4f1('0x51')]=function(_0x4eb7e7,_0x3bd3e7){var _0xd2329=moment()[_0xf4f1('0x52')]()['toString']();var _0x10b14e=path[_0xf4f1('0x53')](config['root'],'server',_0xf4f1('0x54'),_0xf4f1('0x55'));var _0x6e06ef=path[_0xf4f1('0x53')](config[_0xf4f1('0x56')],_0xf4f1('0x57'),_0xf4f1('0x54'),_0xf4f1('0x58'));var _0x4c7446=path[_0xf4f1('0x53')](_0x10b14e,_0xd2329);var _0x2b02f7=util[_0xf4f1('0x47')](_0xf4f1('0x59'),_0x4eb7e7[_0xf4f1('0x2c')]['id'],_0xd2329);var _0x331651=path[_0xf4f1('0x53')](_0x10b14e,_0x2b02f7);var _0x4f9084=[];_0x4f9084[_0xf4f1('0x5a')]({'model':db[_0xf4f1('0x5b')],'as':_0xf4f1('0x5b'),'attributes':['id',_0xf4f1('0x5c')],'raw':!![]});_0x4f9084[_0xf4f1('0x5a')]({'model':db[_0xf4f1('0x5d')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4eb7e7[_0xf4f1('0x27')][_0xf4f1('0x58')]){_0x4f9084[_0xf4f1('0x5a')]({'model':db[_0xf4f1('0x5e')],'as':_0xf4f1('0x5e'),'raw':!![]});}var _0x1c67d5=[{'model':db[_0xf4f1('0x3b')],'as':_0xf4f1('0x5f'),'attributes':['id',_0xf4f1('0x38'),_0xf4f1('0x60'),_0xf4f1('0x61'),_0xf4f1('0x62'),_0xf4f1('0x63')],'include':_0x4f9084}];_0x1c67d5[_0xf4f1('0x5a')]({'model':db['OpenchannelAccount'],'as':_0xf4f1('0x64'),'attributes':['id','name']});_0x1c67d5[_0xf4f1('0x5a')]({'model':db['User'],'as':_0xf4f1('0x65'),'attributes':['id','fullname']});return db[_0xf4f1('0x1f')][_0xf4f1('0x36')]({'where':{'id':_0x4eb7e7[_0xf4f1('0x2c')]['id']},'include':_0x1c67d5})[_0xf4f1('0x18')](handleEntityNotFound(_0x3bd3e7,null))[_0xf4f1('0x18')](function(_0x34bf37){if(_0x34bf37){var _0x4ed0d5=_0x34bf37[_0xf4f1('0x66')]({'plain':!![]});fs[_0xf4f1('0x67')](_0x4c7446);var _0x35e80d={'channel':_0xf4f1('0x68'),'account':_0x4ed0d5['Account'][_0xf4f1('0x1b')],'agent':_0x4ed0d5[_0xf4f1('0x65')]?_0x4ed0d5[_0xf4f1('0x65')]['fullname']:_0xf4f1('0x69'),'createdAt':moment(_0x4ed0d5[_0xf4f1('0x60')])['format'](_0xf4f1('0x48'))['toString'](),'closedAt':_0x4ed0d5[_0xf4f1('0x6a')]?moment(_0x4ed0d5['closedAt'])[_0xf4f1('0x47')](_0xf4f1('0x48'))['toString']():'','disposition':_0x4ed0d5[_0xf4f1('0x6b')],'visibility':_0x4ed0d5[_0xf4f1('0x6c')]?_0xf4f1('0x6d'):_0xf4f1('0x6e'),'messages':_(_0x4ed0d5[_0xf4f1('0x5f')])[_0xf4f1('0x45')]({'secret':![]})[_0xf4f1('0x1e')](function(_0x23536d){if(_0x23536d[_0xf4f1('0x5e')]){var _0x3b51d7=path[_0xf4f1('0x53')](_0x6e06ef,_0x23536d[_0xf4f1('0x5e')][_0xf4f1('0x6f')]);if(fs['existsSync'](_0x3b51d7)){fs[_0xf4f1('0x70')](_0x3b51d7)[_0xf4f1('0x71')](fs['createWriteStream'](path[_0xf4f1('0x53')](_0x4c7446,_0x23536d[_0xf4f1('0x5e')][_0xf4f1('0x6f')])));}}return{'date':moment(_0x23536d['createdAt'])[_0xf4f1('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf4f1('0x72')](),'sender':_0x23536d[_0xf4f1('0x61')]==='out'?_0x23536d[_0xf4f1('0x5b')]?_0x23536d[_0xf4f1('0x5b')][_0xf4f1('0x5c')]:_0xf4f1('0x73'):_0x23536d[_0xf4f1('0x74')][_0xf4f1('0x75')]+(_0x23536d[_0xf4f1('0x74')][_0xf4f1('0x76')]?'\x20'+_0x23536d[_0xf4f1('0x74')][_0xf4f1('0x76')]:''),'body':_0x23536d['Attachment']?_0x23536d[_0xf4f1('0x5e')][_0xf4f1('0x6f')]:_0x23536d[_0xf4f1('0x38')],'direction':_0x23536d[_0xf4f1('0x61')]===_0xf4f1('0x77')?'A':'C','secret':_0x23536d[_0xf4f1('0x62')],'read':_0x23536d[_0xf4f1('0x63')],'attachment':_0x23536d[_0xf4f1('0x5e')]};})['value']()};return ejs[_0xf4f1('0x78')](path['join'](config[_0xf4f1('0x56')],_0xf4f1('0x57'),_0xf4f1('0x79'),'downloadInteraction.ejs'),{'interaction':_0x35e80d})[_0xf4f1('0x18')](function(_0x4aee94){var _0x287b2b=path[_0xf4f1('0x53')](_0x4c7446,'transcript-'+_0x4ed0d5['id']+'-'+_0xd2329+_0xf4f1('0x7a'));var _0xc2b6bf={'path':_0x287b2b,'channel':_0xf4f1('0x68'),'interactionId':_0x4ed0d5['id']};return pdf[_0xf4f1('0x7b')](_0x4aee94,_0xc2b6bf);})[_0xf4f1('0x18')](function(){return new Promise(function(_0x4b4731,_0x2721de){zipdir(_0x4c7446,{'saveTo':_0x331651},function(_0x2362d9,_0x4da8be){if(_0x2362d9)return _0x2721de(_0x2362d9);return _0x4b4731(_0x4da8be);});})[_0xf4f1('0x18')](function(){return new Promise(function(_0x507308,_0x423dae){rimraf(_0x4c7446,function(_0x3c9d9a){if(_0x3c9d9a)_0x423dae(_0x3c9d9a);return _0x507308();});});})[_0xf4f1('0x18')](function(){return _0x3bd3e7[_0xf4f1('0x51')](_0x331651,_0x2b02f7,function(_0x5afe73){if(_0x5afe73){logger['error'](_0xf4f1('0x7c'),_0x5afe73);}else{fs[_0xf4f1('0x7d')](_0x331651);}});});});}else{return _0x3bd3e7[_0xf4f1('0xe')](0xc8);}})[_0xf4f1('0x29')](handleError(_0x3bd3e7,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index e837fa5..711325e 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 _0xde83=['OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','events','OpenchannelInteraction'];(function(_0x5d40e2,_0x4a967c){var _0x845291=function(_0x59d0dd){while(--_0x59d0dd){_0x5d40e2['push'](_0x5d40e2['shift']());}};_0x845291(++_0x4a967c);}(_0xde83,0xfd));var _0x3de8=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xde83[_0x2cde0a];return _0x260610;};'use strict';var EventEmitter=require(_0x3de8('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3de8('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x3de8('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3de8('0x3')](0x0);var events={'afterCreate':_0x3de8('0x4'),'afterUpdate':_0x3de8('0x5'),'afterDestroy':_0x3de8('0x6')};function emitEvent(_0x5eedd3){return function(_0xd8d738,_0x3c81c3,_0x59f2c5){_0xd8d738[_0x3de8('0x7')]({'attributes':['id'],'raw':!![]})[_0x3de8('0x8')](function(_0x2652f2){_0xd8d738[_0x3de8('0x9')](_0x3de8('0xa'),_0x2652f2[_0x3de8('0xb')](function(_0x450946){return{'id':_0x450946['id']};}));return OpenchannelMessage[_0x3de8('0xc')]({'where':{'OpenchannelInteractionId':_0xd8d738['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x283795){_0xd8d738[_0x3de8('0x9')]('unreadMessages',_0x283795['length']);OpenchannelInteractionEvents[_0x3de8('0xd')](_0x5eedd3+':'+_0xd8d738['id'],_0xd8d738);OpenchannelInteractionEvents[_0x3de8('0xd')](_0x5eedd3,_0xd8d738);_0x59f2c5(null);})[_0x3de8('0xe')](_0x59f2c5(null));};}for(var e in events){if(events[_0x3de8('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x3de8('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xb7b0=['update','getUsers','then','setDataValue','Users','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7b0,0x1d7));var _0x0b7b=function(_0x28b7a2,_0x40aa58){_0x28b7a2=_0x28b7a2-0x0;var _0x404e08=_0xb7b0[_0x28b7a2];return _0x404e08;};'use strict';var EventEmitter=require(_0x0b7b('0x0'));var OpenchannelInteraction=require(_0x0b7b('0x1'))['db'][_0x0b7b('0x2')];var OpenchannelMessage=require(_0x0b7b('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0b7b('0x3')](0x0);var events={'afterCreate':_0x0b7b('0x4'),'afterUpdate':_0x0b7b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a2a7f){return function(_0x1429c8,_0x532b88,_0x73f4ba){_0x1429c8[_0x0b7b('0x6')]({'attributes':['id'],'raw':!![]})[_0x0b7b('0x7')](function(_0x40e1f5){_0x1429c8[_0x0b7b('0x8')](_0x0b7b('0x9'),_0x40e1f5['map'](function(_0x258dc8){return{'id':_0x258dc8['id']};}));return OpenchannelMessage[_0x0b7b('0xa')]({'where':{'OpenchannelInteractionId':_0x1429c8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0b7b('0x7')](function(_0x4041cd){_0x1429c8[_0x0b7b('0x8')]('unreadMessages',_0x4041cd[_0x0b7b('0xb')]);OpenchannelInteractionEvents[_0x0b7b('0xc')](_0x4a2a7f+':'+_0x1429c8['id'],_0x1429c8);OpenchannelInteractionEvents[_0x0b7b('0xc')](_0x4a2a7f,_0x1429c8);_0x73f4ba(null);})[_0x0b7b('0xd')](_0x73f4ba(null));};}for(var e in events){if(events[_0x0b7b('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x0b7b('0xf')](e,emitEvent(event));}}module[_0x0b7b('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ff91a45..b842a65 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 _0xe277=['OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x19cbac,_0x4a7597){var _0x180da3=function(_0x219c1a){while(--_0x219c1a){_0x19cbac['push'](_0x19cbac['shift']());}};_0x180da3(++_0x4a7597);}(_0xe277,0xe6));var _0x7e27=function(_0x265c56,_0x1181cd){_0x265c56=_0x265c56-0x0;var _0x1186f9=_0xe277[_0x265c56];return _0x1186f9;};'use strict';var _=require('lodash');var util=require(_0x7e27('0x0'));var logger=require('../../config/logger')(_0x7e27('0x1'));var moment=require(_0x7e27('0x2'));var BPromise=require('bluebird');var rp=require(_0x7e27('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e27('0x4'));var config=require(_0x7e27('0x5'));var attributes=require('./openchannelInteraction.attributes');module[_0x7e27('0x6')]=function(_0x429376,_0x9f8f4d){return _0x429376[_0x7e27('0x7')](_0x7e27('0x8'),attributes,{'tableName':_0x7e27('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e27('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x20b133,_0xb4b504,_0x27ae46){if(_0x20b133[_0x7e27('0xb')](_0x7e27('0xc'))){_0x20b133['closedAt']=moment()['format'](_0x7e27('0xd'));}_0x27ae46(null,_0x20b133);}}});}; \ No newline at end of file +var _0x9e58=['api','moment','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x2caedc,_0x208068){var _0x3f2ec3=function(_0x55670d){while(--_0x55670d){_0x2caedc['push'](_0x2caedc['shift']());}};_0x3f2ec3(++_0x208068);}(_0x9e58,0xec));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x89e5('0x0'));var logger=require(_0x89e5('0x1'))(_0x89e5('0x2'));var moment=require(_0x89e5('0x3'));var BPromise=require(_0x89e5('0x4'));var rp=require(_0x89e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x89e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x89e5('0x7'));module[_0x89e5('0x8')]=function(_0x213136,_0x4641d1){return _0x213136[_0x89e5('0x9')](_0x89e5('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5f3d70,_0x53c18b,_0x3d1029){if(_0x5f3d70[_0x89e5('0xb')](_0x89e5('0xc'))){_0x5f3d70['closedAt']=moment()['format'](_0x89e5('0xd'));}_0x3d1029(null,_0x5f3d70);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e0d9ff9..4449a85 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 _0xd40d=['debug','stringify','code','error','message','request\x20sent','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','omit','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0x1e6f4f,_0x20f5ac){var _0x2db30d=function(_0x1274f5){while(--_0x1274f5){_0x1e6f4f['push'](_0x1e6f4f['shift']());}};_0x2db30d(++_0x20f5ac);}(_0xd40d,0xc2));var _0xdd40=function(_0x5301c8,_0x46a6e5){_0x5301c8=_0x5301c8-0x0;var _0x3fd1e9=_0xd40d[_0x5301c8];return _0x3fd1e9;};'use strict';var _=require('lodash');var util=require(_0xdd40('0x0'));var moment=require(_0xdd40('0x1'));var BPromise=require(_0xdd40('0x2'));var rs=require(_0xdd40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd40('0x4'))['db'];var utils=require(_0xdd40('0x5'));var logger=require(_0xdd40('0x6'))(_0xdd40('0x7'));var config=require(_0xdd40('0x8'));var jayson=require(_0xdd40('0x9'));var client=jayson[_0xdd40('0xa')][_0xdd40('0xb')]({'port':0x232a});config[_0xdd40('0xc')]=_[_0xdd40('0xd')](config[_0xdd40('0xc')],{'host':_0xdd40('0xe'),'port':0x18eb});var socket=require(_0xdd40('0xf'))(new Redis(config[_0xdd40('0xc')]));require(_0xdd40('0x10'))[_0xdd40('0x11')](socket);function respondWithRpcPromise(_0x2491f4,_0x1c1f1f,_0x51b0b1){return new BPromise(function(_0x4bd32d,_0x32e4f5){return client['request'](_0x2491f4,_0x51b0b1)[_0xdd40('0x12')](function(_0x5a87dd){logger[_0xdd40('0x13')](_0xdd40('0x14'),_0x1c1f1f,'request\x20sent');logger[_0xdd40('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1c1f1f,'request\x20sent',JSON[_0xdd40('0x16')](_0x5a87dd));if(_0x5a87dd['error']){if(_0x5a87dd['error'][_0xdd40('0x17')]===0x1f4){logger[_0xdd40('0x18')](_0xdd40('0x14'),_0x1c1f1f,_0x5a87dd[_0xdd40('0x18')][_0xdd40('0x19')]);return _0x32e4f5(_0x5a87dd[_0xdd40('0x18')][_0xdd40('0x19')]);}logger[_0xdd40('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1c1f1f,_0x5a87dd[_0xdd40('0x18')][_0xdd40('0x19')]);return _0x4bd32d(_0x5a87dd[_0xdd40('0x18')][_0xdd40('0x19')]);}else{logger[_0xdd40('0x13')](_0xdd40('0x14'),_0x1c1f1f,_0xdd40('0x1a'));_0x4bd32d(_0x5a87dd[_0xdd40('0x1b')]['message']);}})[_0xdd40('0x1c')](function(_0x214afd){logger[_0xdd40('0x18')](_0xdd40('0x14'),_0x1c1f1f,_0x214afd);_0x32e4f5(_0x214afd);});});}exports[_0xdd40('0x1d')]=function(_0x156628){var _0x3812ab=this;return new Promise(function(_0x4854af,_0x3b6b5c){return db['OpenchannelInteraction'][_0xdd40('0x1e')](_0x156628[_0xdd40('0x1f')],{'raw':_0x156628[_0xdd40('0x20')]?_0x156628[_0xdd40('0x20')][_0xdd40('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x156628[_0xdd40('0x20')]?_0x156628[_0xdd40('0x20')][_0xdd40('0x22')]||null:null,'attributes':_0x156628[_0xdd40('0x20')]?_0x156628[_0xdd40('0x20')][_0xdd40('0x23')]||null:null,'limit':_0x156628[_0xdd40('0x20')]?_0x156628['options'][_0xdd40('0x24')]||null:null})['then'](function(_0x574654){logger[_0xdd40('0x13')](_0xdd40('0x1d'),_0x156628);logger[_0xdd40('0x15')](_0xdd40('0x1d'),_0x156628,JSON[_0xdd40('0x16')](_0x574654));_0x4854af(_0x574654);})[_0xdd40('0x1c')](function(_0x26c045){logger[_0xdd40('0x18')](_0xdd40('0x1d'),_0x26c045['message'],_0x156628);_0x3b6b5c(_0x3812ab['error'](0x1f4,_0x26c045[_0xdd40('0x19')]));});});};exports[_0xdd40('0x25')]=function(_0x1349e1){return new Promise(function(_0x12f2a6,_0x4a05c0){return db[_0xdd40('0x26')][_0xdd40('0x27')]({'where':_0x1349e1[_0xdd40('0x20')]?_0x1349e1['options']['where']||null:null})[_0xdd40('0x12')](function(_0xd0d832){if(_0xd0d832){return _0xd0d832[_0xdd40('0x28')](_0x1349e1[_0xdd40('0x1f')]['ids'],_[_0xdd40('0x29')](_0x1349e1[_0xdd40('0x1f')],['ids','id'])||{});}})['spread'](function(_0xee6095){logger['info']('AddTags',_0x1349e1);logger[_0xdd40('0x15')](_0xdd40('0x2a'),_0x1349e1,JSON[_0xdd40('0x16')](_0xee6095));_0x12f2a6(_0xee6095);})[_0xdd40('0x1c')](function(_0x53fc20){logger[_0xdd40('0x18')](_0xdd40('0x2a'),_0x53fc20[_0xdd40('0x19')],_0x1349e1);_0x4a05c0(_this[_0xdd40('0x18')](0x1f4,_0x53fc20['message']));});});}; \ No newline at end of file +var _0x8b37=['update','body','options','where','limit','catch','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','then','info','debug','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b37,0xae));var _0x78b3=function(_0x5064f5,_0xea3026){_0x5064f5=_0x5064f5-0x0;var _0x7b709=_0x8b37[_0x5064f5];return _0x7b709;};'use strict';var _=require(_0x78b3('0x0'));var util=require(_0x78b3('0x1'));var moment=require(_0x78b3('0x2'));var BPromise=require(_0x78b3('0x3'));var rs=require(_0x78b3('0x4'));var fs=require('fs');var Redis=require(_0x78b3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x78b3('0x6'));var logger=require('../../config/logger')(_0x78b3('0x7'));var config=require(_0x78b3('0x8'));var jayson=require(_0x78b3('0x9'));var client=jayson['client'][_0x78b3('0xa')]({'port':0x232a});config[_0x78b3('0xb')]=_[_0x78b3('0xc')](config[_0x78b3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x78b3('0xd'))(new Redis(config[_0x78b3('0xb')]));require(_0x78b3('0xe'))[_0x78b3('0xf')](socket);function respondWithRpcPromise(_0x2952aa,_0x22593f,_0x3c74bf){return new BPromise(function(_0x3b1ca8,_0x54bf15){return client['request'](_0x2952aa,_0x3c74bf)[_0x78b3('0x10')](function(_0x19bc93){logger[_0x78b3('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x22593f,'request\x20sent');logger[_0x78b3('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x22593f,_0x78b3('0x13'),JSON[_0x78b3('0x14')](_0x19bc93));if(_0x19bc93[_0x78b3('0x15')]){if(_0x19bc93['error'][_0x78b3('0x16')]===0x1f4){logger['error'](_0x78b3('0x17'),_0x22593f,_0x19bc93[_0x78b3('0x15')][_0x78b3('0x18')]);return _0x54bf15(_0x19bc93[_0x78b3('0x15')][_0x78b3('0x18')]);}logger[_0x78b3('0x15')](_0x78b3('0x17'),_0x22593f,_0x19bc93[_0x78b3('0x15')][_0x78b3('0x18')]);return _0x3b1ca8(_0x19bc93['error']['message']);}else{logger['info'](_0x78b3('0x17'),_0x22593f,_0x78b3('0x13'));_0x3b1ca8(_0x19bc93[_0x78b3('0x19')][_0x78b3('0x18')]);}})['catch'](function(_0x33247b){logger[_0x78b3('0x15')](_0x78b3('0x17'),_0x22593f,_0x33247b);_0x54bf15(_0x33247b);});});}exports['UpdateOpenchannelInteraction']=function(_0x311351){var _0x27e27d=this;return new Promise(function(_0x40d5a8,_0x3746f7){return db['OpenchannelInteraction'][_0x78b3('0x1a')](_0x311351[_0x78b3('0x1b')],{'raw':_0x311351[_0x78b3('0x1c')]?_0x311351[_0x78b3('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x311351['options']?_0x311351['options'][_0x78b3('0x1d')]||null:null,'attributes':_0x311351[_0x78b3('0x1c')]?_0x311351[_0x78b3('0x1c')]['attributes']||null:null,'limit':_0x311351[_0x78b3('0x1c')]?_0x311351[_0x78b3('0x1c')][_0x78b3('0x1e')]||null:null})[_0x78b3('0x10')](function(_0x297720){logger[_0x78b3('0x11')]('UpdateOpenchannelInteraction',_0x311351);logger[_0x78b3('0x12')]('UpdateOpenchannelInteraction',_0x311351,JSON[_0x78b3('0x14')](_0x297720));_0x40d5a8(_0x297720);})[_0x78b3('0x1f')](function(_0x4f2b84){logger[_0x78b3('0x15')](_0x78b3('0x20'),_0x4f2b84[_0x78b3('0x18')],_0x311351);_0x3746f7(_0x27e27d[_0x78b3('0x15')](0x1f4,_0x4f2b84['message']));});});};exports[_0x78b3('0x21')]=function(_0x56f1fe){return new Promise(function(_0x22625e,_0x32df90){return db[_0x78b3('0x22')][_0x78b3('0x23')]({'where':_0x56f1fe['options']?_0x56f1fe[_0x78b3('0x1c')][_0x78b3('0x1d')]||null:null})[_0x78b3('0x10')](function(_0x99b870){if(_0x99b870){return _0x99b870[_0x78b3('0x24')](_0x56f1fe[_0x78b3('0x1b')]['ids'],_['omit'](_0x56f1fe[_0x78b3('0x1b')],[_0x78b3('0x25'),'id'])||{});}})[_0x78b3('0x26')](function(_0x4a216b){logger['info'](_0x78b3('0x27'),_0x56f1fe);logger[_0x78b3('0x12')](_0x78b3('0x27'),_0x56f1fe,JSON['stringify'](_0x4a216b));_0x22625e(_0x4a216b);})[_0x78b3('0x1f')](function(_0x5b54f0){logger[_0x78b3('0x15')](_0x78b3('0x27'),_0x5b54f0[_0x78b3('0x18')],_0x56f1fe);_0x32df90(_this[_0x78b3('0x15')](0x1f4,_0x5b54f0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 3f6a7dd..d0e3280 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 _0x6b30=['register','length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener'];(function(_0x167051,_0x1952a7){var _0x48663f=function(_0x4bfa95){while(--_0x4bfa95){_0x167051['push'](_0x167051['shift']());}};_0x48663f(++_0x1952a7);}(_0x6b30,0x6b));var _0x06b3=function(_0x23aeaf,_0x241fa7){_0x23aeaf=_0x23aeaf-0x0;var _0x118109=_0x6b30[_0x23aeaf];return _0x118109;};'use strict';var OpenchannelInteractionEvents=require(_0x06b3('0x0'));var events=['save',_0x06b3('0x1'),_0x06b3('0x2')];function createListener(_0x1a9d3d,_0x5ccd61){return function(_0x3b9a20){_0x5ccd61[_0x06b3('0x3')](_0x1a9d3d,_0x3b9a20);};}function removeListener(_0x3dbb2d,_0x172b46){return function(){OpenchannelInteractionEvents[_0x06b3('0x4')](_0x3dbb2d,_0x172b46);};}exports[_0x06b3('0x5')]=function(_0x55eac5){for(var _0x297ed0=0x0,_0xb2b811=events[_0x06b3('0x6')];_0x297ed0<_0xb2b811;_0x297ed0++){var _0x455abe=events[_0x297ed0];var _0x2ac117=createListener(_0x06b3('0x7')+_0x455abe,_0x55eac5);OpenchannelInteractionEvents['on'](_0x455abe,_0x2ac117);}}; \ No newline at end of file +var _0xb9fb=['update','removeListener','register','length','./openchannelInteraction.events','save','remove'];(function(_0x58ad48,_0x14e054){var _0x173539=function(_0x52291a){while(--_0x52291a){_0x58ad48['push'](_0x58ad48['shift']());}};_0x173539(++_0x14e054);}(_0xb9fb,0xa5));var _0xbb9f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb9fb[_0xa464c9];return _0x3d73c4;};'use strict';var OpenchannelInteractionEvents=require(_0xbb9f('0x0'));var events=[_0xbb9f('0x1'),_0xbb9f('0x2'),_0xbb9f('0x3')];function createListener(_0x311a81,_0xacb07c){return function(_0x226ee8){_0xacb07c['emit'](_0x311a81,_0x226ee8);};}function removeListener(_0x5584b8,_0x5b5b13){return function(){OpenchannelInteractionEvents[_0xbb9f('0x4')](_0x5584b8,_0x5b5b13);};}exports[_0xbb9f('0x5')]=function(_0x3ad074){for(var _0x4afcee=0x0,_0x1b55e6=events[_0xbb9f('0x6')];_0x4afcee<_0x1b55e6;_0x4afcee++){var _0x1a778c=events[_0x4afcee];var _0x149cef=createListener('openchannelInteraction:'+_0x1a778c,_0x3ad074);OpenchannelInteractionEvents['on'](_0x1a778c,_0x149cef);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 6c1800c..d029363 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x4a5ca4,_0x212195){_0x4a5ca4=_0x4a5ca4-0x0;var _0x1c8fbe=_0x70e0[_0x4a5ca4];return _0x1c8fbe;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x260d03,_0x1fd42c){var _0x12ea8e=function(_0x1ca216){while(--_0x1ca216){_0x260d03['push'](_0x260d03['shift']());}};_0x12ea8e(++_0x1fd42c);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 1d2c163..6dff360 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 _0xc901=['sequelize','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x4c13b8,_0x5f5964){var _0x5698fc=function(_0x21a114){while(--_0x21a114){_0x4c13b8['push'](_0x4c13b8['shift']());}};_0x5698fc(++_0x5f5964);}(_0xc901,0x142));var _0x1c90=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc901[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1c90('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1c90('0x2')]('in','out'),'defaultValue':_0x1c90('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1c90('0x4')]},'providerName':{'type':Sequelize[_0x1c90('0x5')]},'providerResponse':{'type':Sequelize[_0x1c90('0x6')]}}; \ No newline at end of file +var _0xdca3=['ENUM','out','DATE','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0x2d2c5c,_0x1a06fe){var _0x46a8ad=function(_0x334ac9){while(--_0x334ac9){_0x2d2c5c['push'](_0x2d2c5c['shift']());}};_0x46a8ad(++_0x1a06fe);}(_0xdca3,0x64));var _0x3dca=function(_0x1db15c,_0xb7e2bd){_0x1db15c=_0x1db15c-0x0;var _0x45932e=_0xdca3[_0x1db15c];return _0x45932e;};'use strict';var Sequelize=require(_0x3dca('0x0'));module['exports']={'body':{'type':Sequelize[_0x3dca('0x1')](_0x3dca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3dca('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3dca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3dca('0x4')]('in',_0x3dca('0x5')),'defaultValue':_0x3dca('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3dca('0x6')]},'providerName':{'type':Sequelize[_0x3dca('0x7')]},'providerResponse':{'type':Sequelize[_0x3dca('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 9474a54..09f839c 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 _0x9b7c=['ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','rejectMessage','fullname','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','end','status','json','offset','count','set','apply','reject','save','destroy','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','filter','where','type','includeAll','include','findAll','rows','catch','params','merge','options','find','create','body','update','describe','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b7c,0x176));var _0xc9b7=function(_0x3bbd2d,_0xf8ba3c){_0x3bbd2d=_0x3bbd2d-0x0;var _0x241bd4=_0x9b7c[_0x3bbd2d];return _0x241bd4;};'use strict';var emlformat=require(_0xc9b7('0x0'));var rimraf=require(_0xc9b7('0x1'));var zipdir=require(_0xc9b7('0x2'));var jsonpatch=require(_0xc9b7('0x3'));var rp=require('request-promise');var moment=require(_0xc9b7('0x4'));var BPromise=require(_0xc9b7('0x5'));var Mustache=require(_0xc9b7('0x6'));var util=require(_0xc9b7('0x7'));var path=require(_0xc9b7('0x8'));var sox=require('sox');var csv=require(_0xc9b7('0x9'));var ejs=require(_0xc9b7('0xa'));var fs=require('fs');var fs_extra=require(_0xc9b7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc9b7('0xc'));var deskjs=require(_0xc9b7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc9b7('0xe'));var Papa=require('papaparse');var Redis=require(_0xc9b7('0xf'));var authService=require(_0xc9b7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc9b7('0x11'));var hardwareService=require(_0xc9b7('0x12'));var logger=require(_0xc9b7('0x13'))('api');var utils=require(_0xc9b7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc9b7('0x15'));var db=require('../../mysqldb')['db'];config[_0xc9b7('0x16')]=_[_0xc9b7('0x17')](config[_0xc9b7('0x16')],{'host':_0xc9b7('0x18'),'port':0x18eb});var socket=require(_0xc9b7('0x19'))(new Redis(config[_0xc9b7('0x16')]));require(_0xc9b7('0x1a'))['register'](socket);var jayson=require(_0xc9b7('0x1b'));var client=jayson[_0xc9b7('0x1c')][_0xc9b7('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xc9b7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4ca2ff,_0x4a5692,_0x544203,_0xbde9a){return new BPromise(function(_0x57391b,_0xe15bbc){var _0x37505b=_0xbde9a||client;return _0x37505b['request'](_0x4ca2ff,_0x544203)[_0xc9b7('0x1e')](function(_0x39bb45){logger[_0xc9b7('0x1f')](_0xc9b7('0x20'),_0x4a5692,_0xc9b7('0x21'));logger['debug'](_0xc9b7('0x22'),_0x4a5692,_0xc9b7('0x21'),JSON[_0xc9b7('0x23')](_0x39bb45));if(_0x39bb45[_0xc9b7('0x24')]){if(_0x39bb45[_0xc9b7('0x24')]['code']===0x1f4){logger['error'](_0xc9b7('0x20'),_0x4a5692,_0x39bb45[_0xc9b7('0x24')][_0xc9b7('0x25')]);return _0xe15bbc(_0x39bb45[_0xc9b7('0x24')]['message']);}logger[_0xc9b7('0x24')](_0xc9b7('0x20'),_0x4a5692,_0x39bb45[_0xc9b7('0x24')][_0xc9b7('0x25')]);return _0x57391b(_0x39bb45[_0xc9b7('0x24')][_0xc9b7('0x25')]);}else{logger[_0xc9b7('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x4a5692,_0xc9b7('0x21'));_0x57391b(_0x39bb45[_0xc9b7('0x26')][_0xc9b7('0x25')]);}})['catch'](function(_0x50c80e){logger[_0xc9b7('0x24')](_0xc9b7('0x20'),_0x4a5692,_0x50c80e);_0xe15bbc(_0x50c80e);});});}function respondWithStatusCode(_0x2a66a5,_0x25a05f){_0x25a05f=_0x25a05f||0xcc;return function(_0x5ae295){if(_0x5ae295){return _0x2a66a5['sendStatus'](_0x25a05f);}return _0x2a66a5['status'](_0x25a05f)[_0xc9b7('0x27')]();};}function respondWithResult(_0xba9eef,_0x1823a7){_0x1823a7=_0x1823a7||0xc8;return function(_0x49f985){if(_0x49f985){return _0xba9eef[_0xc9b7('0x28')](_0x1823a7)[_0xc9b7('0x29')](_0x49f985);}};}function respondWithFilteredResult(_0x4e2b2f,_0x54bab7){return function(_0x257557){if(_0x257557){var _0x1679ea=typeof _0x54bab7[_0xc9b7('0x2a')]==='undefined'&&typeof _0x54bab7['limit']==='undefined';var _0x1d0bb5=_0x257557[_0xc9b7('0x2b')];var _0x189811=_0x1679ea?0x0:_0x54bab7[_0xc9b7('0x2a')];var _0x1fca5c=_0x1679ea?_0x257557['count']:_0x54bab7[_0xc9b7('0x2a')]+_0x54bab7['limit'];var _0x1c09a0;if(_0x1fca5c>=_0x1d0bb5){_0x1fca5c=_0x1d0bb5;_0x1c09a0=0xc8;}else{_0x1c09a0=0xce;}_0x4e2b2f[_0xc9b7('0x28')](_0x1c09a0);return _0x4e2b2f[_0xc9b7('0x2c')]('Content-Range',_0x189811+'-'+_0x1fca5c+'/'+_0x1d0bb5)[_0xc9b7('0x29')](_0x257557);}return null;};}function patchUpdates(_0x3de1c9){return function(_0x2052b8){try{jsonpatch[_0xc9b7('0x2d')](_0x2052b8,_0x3de1c9,!![]);}catch(_0x2ebf7a){return BPromise[_0xc9b7('0x2e')](_0x2ebf7a);}return _0x2052b8[_0xc9b7('0x2f')]();};}function saveUpdates(_0xeb011a,_0x917229){return function(_0x3c9f3b){if(_0x3c9f3b){return _0x3c9f3b['update'](_0xeb011a)['then'](function(_0x3e4c4d){return _0x3e4c4d;});}return null;};}function removeEntity(_0x1d2c95,_0x47082a){return function(_0x284cba){if(_0x284cba){return _0x284cba[_0xc9b7('0x30')]()[_0xc9b7('0x1e')](function(){_0x1d2c95[_0xc9b7('0x28')](0xcc)[_0xc9b7('0x27')]();});}};}function handleEntityNotFound(_0x360b13,_0x1d05fa){return function(_0x8acb48){if(!_0x8acb48){_0x360b13['sendStatus'](0x194);}return _0x8acb48;};}function handleError(_0x228232,_0x38810f){_0x38810f=_0x38810f||0x1f4;return function(_0x3d0ac2){logger[_0xc9b7('0x24')](_0x3d0ac2[_0xc9b7('0x31')]);if(_0x3d0ac2[_0xc9b7('0x32')]){delete _0x3d0ac2[_0xc9b7('0x32')];}_0x228232[_0xc9b7('0x28')](_0x38810f)['send'](_0x3d0ac2);};}exports[_0xc9b7('0x33')]=function(_0x3bf938,_0x4410a4){var _0x37ff89={},_0x59fa34={},_0x5aa1d0={'count':0x0,'rows':[]};var _0x451ba9=_[_0xc9b7('0x34')](db[_0xc9b7('0x35')][_0xc9b7('0x36')],function(_0x18301c){return{'name':_0x18301c[_0xc9b7('0x37')],'type':_0x18301c['type']['key']};});_0x59fa34[_0xc9b7('0x38')]=_[_0xc9b7('0x34')](_0x451ba9,_0xc9b7('0x32'));_0x59fa34[_0xc9b7('0x39')]=_[_0xc9b7('0x3a')](_0x3bf938[_0xc9b7('0x39')]);_0x59fa34[_0xc9b7('0x3b')]=_[_0xc9b7('0x3c')](_0x59fa34[_0xc9b7('0x38')],_0x59fa34['query']);_0x37ff89['attributes']=_[_0xc9b7('0x3c')](_0x59fa34[_0xc9b7('0x38')],qs[_0xc9b7('0x3d')](_0x3bf938['query']['fields']));_0x37ff89[_0xc9b7('0x3e')]=_0x37ff89[_0xc9b7('0x3e')][_0xc9b7('0x3f')]?_0x37ff89[_0xc9b7('0x3e')]:_0x59fa34['model'];if(!_0x3bf938[_0xc9b7('0x39')]['hasOwnProperty'](_0xc9b7('0x40'))){_0x37ff89['limit']=qs[_0xc9b7('0x41')](_0x3bf938['query'][_0xc9b7('0x41')]);_0x37ff89['offset']=qs[_0xc9b7('0x2a')](_0x3bf938[_0xc9b7('0x39')]['offset']);}_0x37ff89[_0xc9b7('0x42')]=qs[_0xc9b7('0x43')](_0x3bf938['query'][_0xc9b7('0x43')]);_0x37ff89['where']=qs[_0xc9b7('0x3b')](_['pick'](_0x3bf938[_0xc9b7('0x39')],_0x59fa34[_0xc9b7('0x3b')]),_0x451ba9);if(_0x3bf938['query'][_0xc9b7('0x44')]){_0x37ff89[_0xc9b7('0x45')]=_['merge'](_0x37ff89[_0xc9b7('0x45')],{'$or':_[_0xc9b7('0x34')](_0x451ba9,function(_0x3ee666){if(_0x3ee666[_0xc9b7('0x46')]!=='VIRTUAL'){var _0x36ac60={};_0x36ac60[_0x3ee666[_0xc9b7('0x32')]]={'$like':'%'+_0x3bf938['query'][_0xc9b7('0x44')]+'%'};return _0x36ac60;}})});}_0x37ff89=_['merge']({},_0x37ff89,_0x3bf938['options']);var _0x4d9869={'where':_0x37ff89[_0xc9b7('0x45')]};return db[_0xc9b7('0x35')][_0xc9b7('0x2b')](_0x4d9869)[_0xc9b7('0x1e')](function(_0x327e4a){_0x5aa1d0['count']=_0x327e4a;if(_0x3bf938[_0xc9b7('0x39')][_0xc9b7('0x47')]){_0x37ff89[_0xc9b7('0x48')]=[{'all':!![]}];}return db[_0xc9b7('0x35')][_0xc9b7('0x49')](_0x37ff89);})['then'](function(_0x4e6ae5){_0x5aa1d0[_0xc9b7('0x4a')]=_0x4e6ae5;return _0x5aa1d0;})[_0xc9b7('0x1e')](respondWithFilteredResult(_0x4410a4,_0x37ff89))[_0xc9b7('0x4b')](handleError(_0x4410a4,null));};exports['show']=function(_0x66a728,_0x2e435f){var _0x5a27d5={'raw':!![],'where':{'id':_0x66a728[_0xc9b7('0x4c')]['id']}},_0x6fbb72={};_0x6fbb72[_0xc9b7('0x38')]=_['keys'](db[_0xc9b7('0x35')][_0xc9b7('0x36')]);_0x6fbb72['query']=_[_0xc9b7('0x3a')](_0x66a728['query']);_0x6fbb72[_0xc9b7('0x3b')]=_[_0xc9b7('0x3c')](_0x6fbb72[_0xc9b7('0x38')],_0x6fbb72['query']);_0x5a27d5['attributes']=_[_0xc9b7('0x3c')](_0x6fbb72[_0xc9b7('0x38')],qs['fields'](_0x66a728['query'][_0xc9b7('0x3d')]));_0x5a27d5[_0xc9b7('0x3e')]=_0x5a27d5[_0xc9b7('0x3e')]['length']?_0x5a27d5[_0xc9b7('0x3e')]:_0x6fbb72['model'];if(_0x66a728[_0xc9b7('0x39')]['includeAll']){_0x5a27d5['include']=[{'all':!![]}];}_0x5a27d5=_[_0xc9b7('0x4d')]({},_0x5a27d5,_0x66a728[_0xc9b7('0x4e')]);return db[_0xc9b7('0x35')][_0xc9b7('0x4f')](_0x5a27d5)['then'](handleEntityNotFound(_0x2e435f,null))[_0xc9b7('0x1e')](respondWithResult(_0x2e435f,null))[_0xc9b7('0x4b')](handleError(_0x2e435f,null));};exports[_0xc9b7('0x50')]=function(_0x2939e2,_0x6a3c7){return db['OpenchannelMessage'][_0xc9b7('0x50')](_0x2939e2[_0xc9b7('0x51')],{})[_0xc9b7('0x1e')](respondWithResult(_0x6a3c7,0xc9))[_0xc9b7('0x4b')](handleError(_0x6a3c7,null));};exports[_0xc9b7('0x52')]=function(_0x5d7b84,_0x562567){if(_0x5d7b84[_0xc9b7('0x51')]['id']){delete _0x5d7b84[_0xc9b7('0x51')]['id'];}return db[_0xc9b7('0x35')][_0xc9b7('0x4f')]({'where':{'id':_0x5d7b84[_0xc9b7('0x4c')]['id']}})[_0xc9b7('0x1e')](handleEntityNotFound(_0x562567,null))['then'](saveUpdates(_0x5d7b84['body'],null))[_0xc9b7('0x1e')](respondWithResult(_0x562567,null))[_0xc9b7('0x4b')](handleError(_0x562567,null));};exports[_0xc9b7('0x30')]=function(_0xc9a0dd,_0x291f11){return db['OpenchannelMessage'][_0xc9b7('0x4f')]({'where':{'id':_0xc9a0dd[_0xc9b7('0x4c')]['id']}})[_0xc9b7('0x1e')](handleEntityNotFound(_0x291f11,null))[_0xc9b7('0x1e')](removeEntity(_0x291f11,null))[_0xc9b7('0x4b')](handleError(_0x291f11,null));};exports['describe']=function(_0x5b36be,_0x321819){return db['OpenchannelMessage'][_0xc9b7('0x53')]()[_0xc9b7('0x1e')](respondWithResult(_0x321819,null))[_0xc9b7('0x4b')](handleError(_0x321819,null));};var interaction_log=require(_0xc9b7('0x13'))('openchannel-interactions');exports[_0xc9b7('0x54')]=function(_0x10eb09,_0x2d49f5,_0x540181){var _0x4156b9={'agent':{},'channel':_0xc9b7('0x55')};if(_0x10eb09[_0xc9b7('0x51')]['id']){delete _0x10eb09['body']['id'];}_0x10eb09[_0xc9b7('0x51')][_0xc9b7('0x56')]=!![];_0x10eb09[_0xc9b7('0x51')]['readAt']=moment()[_0xc9b7('0x57')](_0xc9b7('0x58'));_0x10eb09[_0xc9b7('0x51')][_0xc9b7('0x59')]=_0x10eb09['body'][_0xc9b7('0x59')]||_0x10eb09[_0xc9b7('0x5a')]['id'];_0x4156b9[_0xc9b7('0x5b')]['id']=_0x10eb09['body'][_0xc9b7('0x59')];return db['OpenchannelMessage'][_0xc9b7('0x4f')]({'where':{'id':_0x10eb09['params']['id'],'UserId':null}})[_0xc9b7('0x1e')](handleEntityNotFound(_0x2d49f5,null))[_0xc9b7('0x1e')](saveUpdates(_0x10eb09[_0xc9b7('0x51')],null))[_0xc9b7('0x1e')](function(_0x244e9d){if(_0x244e9d){_0x4156b9['message']=_0x244e9d[_0xc9b7('0x5c')]({'plain':!![]});return db['OpenchannelInteraction'][_0xc9b7('0x4f')]({'where':{'id':_0x244e9d['OpenchannelInteractionId']}});}return null;})[_0xc9b7('0x1e')](handleEntityNotFound(_0x2d49f5,null))[_0xc9b7('0x1e')](function(_0x4ed322){if(_0x4ed322){return _0x4ed322[_0xc9b7('0x52')]({'UserId':_0x10eb09[_0xc9b7('0x51')][_0xc9b7('0x59')],'read1stAt':_[_0xc9b7('0x5d')](_0x4ed322[_0xc9b7('0x5e')])?moment()['format'](_0xc9b7('0x58')):undefined});}return null;})[_0xc9b7('0x1e')](function(_0x3bc4aa){if(_0x3bc4aa){_0x4156b9[_0xc9b7('0x5f')]=_0x3bc4aa[_0xc9b7('0x5c')]({'plain':!![]});interaction_log[_0xc9b7('0x1f')](_0xc9b7('0x60'),_0x10eb09[_0xc9b7('0x5a')]['id'],_0x10eb09[_0xc9b7('0x5a')][_0xc9b7('0x32')],_0x10eb09[_0xc9b7('0x5a')][_0xc9b7('0x61')],_0x4156b9[_0xc9b7('0x5f')]['id'],_0x10eb09['body']?JSON['stringify'](_0x10eb09[_0xc9b7('0x51')]):_0xc9b7('0x62'));return respondWithRpcPromise(_0xc9b7('0x63'),_0xc9b7('0x64'),_0x4156b9);}return null;})[_0xc9b7('0x1e')](function(_0x2e8923){var _0x11f669=_0xc9b7('0x65')+_0x2e8923[_0xc9b7('0x25')][_0xc9b7('0x66')];return db[_0xc9b7('0x67')][_0xc9b7('0x39')](_0x11f669,{'type':db[_0xc9b7('0x68')][_0xc9b7('0x69')][_0xc9b7('0x6a')],'raw':!![]})[_0xc9b7('0x1e')](function(_0x258689){return _0x258689;});})['then'](function(_0x3061db){if(_0x3061db){_0x4156b9[_0xc9b7('0x25')][_0xc9b7('0x6b')]=_0x3061db[0x0];if(!_0x10eb09[_0xc9b7('0x51')][_0xc9b7('0x59')])return;return db['User']['find']({'where':{'id':_0x10eb09['body'][_0xc9b7('0x59')],'role':_0xc9b7('0x5b')},'attributes':['id',_0xc9b7('0x32'),'fullname',_0xc9b7('0x6c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x12df78){if(!_0x12df78)return null;_0x4156b9['message']['agent']=_0x12df78;return _0x4156b9;})[_0xc9b7('0x1e')](function(_0x35c876){if(_0x35c876){if(_0x10eb09['body'][_0xc9b7('0x6d')]){_0x4156b9[_0xc9b7('0x25')][_0xc9b7('0x6e')]=util[_0xc9b7('0x57')](_0xc9b7('0x6f'),_0x10eb09['user']['name']);_0x4156b9[_0xc9b7('0x25')][_0xc9b7('0x70')]=_0x4156b9['channel'];_0x4156b9[_0xc9b7('0x25')][_0xc9b7('0x71')]=_0x4156b9[_0xc9b7('0x70')];_0x4156b9[_0xc9b7('0x25')][_0xc9b7('0x72')]='accept';return respondWithRpcPromise(_0xc9b7('0x73'),_0xc9b7('0x73'),{'event':_0xc9b7('0x74'),'message':_0x4156b9[_0xc9b7('0x25')]},client9002)['then'](function(){return _0x4156b9;});}return _0x4156b9;}return null;})[_0xc9b7('0x1e')](respondWithResult(_0x2d49f5,null))[_0xc9b7('0x4b')](handleError(_0x2d49f5,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xc9b7('0x2e')]=function(_0x5a0889,_0x4a43c4,_0x445946){var _0xae99e9={'agent':{},'channel':'openchannel'};if(_0x5a0889[_0xc9b7('0x51')]['id']){delete _0x5a0889[_0xc9b7('0x51')]['id'];}_0x5a0889[_0xc9b7('0x51')][_0xc9b7('0x59')]=_0x5a0889[_0xc9b7('0x51')][_0xc9b7('0x59')]||_0x5a0889['user']['id'];_0xae99e9[_0xc9b7('0x5b')]['id']=_0x5a0889[_0xc9b7('0x51')][_0xc9b7('0x59')];return db[_0xc9b7('0x35')][_0xc9b7('0x4f')]({'where':{'id':_0x5a0889['params']['id'],'UserId':null}})[_0xc9b7('0x1e')](handleEntityNotFound(_0x4a43c4,null))[_0xc9b7('0x1e')](function(_0x27f484){if(_0x27f484){_0xae99e9[_0xc9b7('0x25')]=_0x27f484[_0xc9b7('0x5c')]({'plain':!![]});return db['OpenchannelInteraction'][_0xc9b7('0x4f')]({'where':{'id':_0x27f484['OpenchannelInteractionId']}});}return null;})[_0xc9b7('0x1e')](handleEntityNotFound(_0x4a43c4,null))[_0xc9b7('0x1e')](function(_0x13ae88){if(_0x13ae88){_0xae99e9[_0xc9b7('0x5f')]=_0x13ae88[_0xc9b7('0x5c')]({'plain':!![]});interaction_log[_0xc9b7('0x1f')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5a0889[_0xc9b7('0x5a')]['id'],_0x5a0889[_0xc9b7('0x5a')]['name'],_0x5a0889[_0xc9b7('0x5a')][_0xc9b7('0x61')],_0xae99e9[_0xc9b7('0x5f')]['id'],_0x5a0889[_0xc9b7('0x51')]?JSON['stringify'](_0x5a0889['body']):_0xc9b7('0x62'));return respondWithRpcPromise('RejectMessage',_0xc9b7('0x75'),_0xae99e9);}return null;})['then'](function(_0x2b7f28){var _0x4ffbc4=_0xc9b7('0x65')+_0x2b7f28[_0xc9b7('0x25')][_0xc9b7('0x66')];return db[_0xc9b7('0x67')][_0xc9b7('0x39')](_0x4ffbc4,{'type':db[_0xc9b7('0x68')][_0xc9b7('0x69')][_0xc9b7('0x6a')],'raw':!![]})['then'](function(_0x8fe036){return _0x8fe036;});})[_0xc9b7('0x1e')](function(_0x389170){if(_0x389170){_0xae99e9[_0xc9b7('0x25')]['contact']=_0x389170[0x0];if(!_0x5a0889[_0xc9b7('0x51')][_0xc9b7('0x59')])return;return db['User'][_0xc9b7('0x4f')]({'where':{'id':_0x5a0889['body']['UserId'],'role':_0xc9b7('0x5b')},'attributes':['id',_0xc9b7('0x32'),_0xc9b7('0x76'),_0xc9b7('0x6c'),'internal'],'raw':!![]});}return null;})[_0xc9b7('0x1e')](function(_0x272967){if(!_0x272967)return null;_0xae99e9['message'][_0xc9b7('0x5b')]=_0x272967;return _0xae99e9;})[_0xc9b7('0x1e')](function(_0x537f04){if(_0x537f04){_0x537f04['message'][_0xc9b7('0x6e')]=util['format'](_0xc9b7('0x6f'),_0x5a0889[_0xc9b7('0x5a')][_0xc9b7('0x32')]);_0x537f04[_0xc9b7('0x25')][_0xc9b7('0x70')]=_0xae99e9[_0xc9b7('0x70')];_0x537f04[_0xc9b7('0x25')]['motionChannel']=_0xae99e9[_0xc9b7('0x70')];_0x537f04[_0xc9b7('0x25')]['event']=_0xc9b7('0x2e');respondWithRpcPromise(_0xc9b7('0x73'),_0xc9b7('0x73'),{'event':'rejectmessage','message':_0x537f04[_0xc9b7('0x25')]},client9002);return _0xae99e9;}return null;})['then'](respondWithResult(_0x4a43c4,null))[_0xc9b7('0x4b')](handleError(_0x4a43c4,null));}; \ No newline at end of file +var _0xfef2=['../../mysqldb','redis','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','OpenchannelMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','describe','openchannel-interactions','accept','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','event','EventManager','openchannel','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','internal','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x16a7d8,_0x326d5c){var _0xa4b589=function(_0x17add5){while(--_0x17add5){_0x16a7d8['push'](_0x16a7d8['shift']());}};_0xa4b589(++_0x326d5c);}(_0xfef2,0x1e0));var _0x2fef=function(_0x376de5,_0x1b44a9){_0x376de5=_0x376de5-0x0;var _0x58d8f7=_0xfef2[_0x376de5];return _0x58d8f7;};'use strict';var emlformat=require(_0x2fef('0x0'));var rimraf=require(_0x2fef('0x1'));var zipdir=require(_0x2fef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fef('0x3'));var moment=require(_0x2fef('0x4'));var BPromise=require(_0x2fef('0x5'));var Mustache=require(_0x2fef('0x6'));var util=require('util');var path=require(_0x2fef('0x7'));var sox=require('sox');var csv=require(_0x2fef('0x8'));var ejs=require(_0x2fef('0x9'));var fs=require('fs');var fs_extra=require(_0x2fef('0xa'));var _=require(_0x2fef('0xb'));var squel=require(_0x2fef('0xc'));var crypto=require(_0x2fef('0xd'));var jsforce=require(_0x2fef('0xe'));var deskjs=require(_0x2fef('0xf'));var toCsv=require(_0x2fef('0x8'));var querystring=require(_0x2fef('0x10'));var Papa=require(_0x2fef('0x11'));var Redis=require('ioredis');var authService=require(_0x2fef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2fef('0x13'));var hardwareService=require(_0x2fef('0x14'));var logger=require(_0x2fef('0x15'))(_0x2fef('0x16'));var utils=require(_0x2fef('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2fef('0x18'))['db'];config[_0x2fef('0x19')]=_['defaults'](config[_0x2fef('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2fef('0x19')]));require(_0x2fef('0x1a'))[_0x2fef('0x1b')](socket);var jayson=require(_0x2fef('0x1c'));var client=jayson[_0x2fef('0x1d')][_0x2fef('0x1e')]({'port':0x232c});var client9002=jayson[_0x2fef('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524fdc,_0x134b67,_0x26dff2,_0x4b6862){return new BPromise(function(_0x5773d3,_0x1a0939){var _0x2483ac=_0x4b6862||client;return _0x2483ac[_0x2fef('0x1f')](_0x524fdc,_0x26dff2)[_0x2fef('0x20')](function(_0x2051ce){logger[_0x2fef('0x21')](_0x2fef('0x22'),_0x134b67,_0x2fef('0x23'));logger[_0x2fef('0x24')](_0x2fef('0x25'),_0x134b67,_0x2fef('0x23'),JSON[_0x2fef('0x26')](_0x2051ce));if(_0x2051ce[_0x2fef('0x27')]){if(_0x2051ce[_0x2fef('0x27')][_0x2fef('0x28')]===0x1f4){logger['error'](_0x2fef('0x22'),_0x134b67,_0x2051ce[_0x2fef('0x27')]['message']);return _0x1a0939(_0x2051ce[_0x2fef('0x27')][_0x2fef('0x29')]);}logger[_0x2fef('0x27')](_0x2fef('0x22'),_0x134b67,_0x2051ce[_0x2fef('0x27')][_0x2fef('0x29')]);return _0x5773d3(_0x2051ce[_0x2fef('0x27')][_0x2fef('0x29')]);}else{logger[_0x2fef('0x21')](_0x2fef('0x22'),_0x134b67,'request\x20sent');_0x5773d3(_0x2051ce[_0x2fef('0x2a')][_0x2fef('0x29')]);}})['catch'](function(_0x561c4b){logger['error'](_0x2fef('0x22'),_0x134b67,_0x561c4b);_0x1a0939(_0x561c4b);});});}function respondWithStatusCode(_0x2cf989,_0x5ab7ea){_0x5ab7ea=_0x5ab7ea||0xcc;return function(_0x343053){if(_0x343053){return _0x2cf989['sendStatus'](_0x5ab7ea);}return _0x2cf989[_0x2fef('0x2b')](_0x5ab7ea)[_0x2fef('0x2c')]();};}function respondWithResult(_0x2780cb,_0x5d5f5e){_0x5d5f5e=_0x5d5f5e||0xc8;return function(_0x2ec3a1){if(_0x2ec3a1){return _0x2780cb[_0x2fef('0x2b')](_0x5d5f5e)[_0x2fef('0x2d')](_0x2ec3a1);}};}function respondWithFilteredResult(_0x103bd9,_0x16fe17){return function(_0x1c8aed){if(_0x1c8aed){var _0x1c9e52=typeof _0x16fe17[_0x2fef('0x2e')]===_0x2fef('0x2f')&&typeof _0x16fe17[_0x2fef('0x30')]===_0x2fef('0x2f');var _0x10fa8a=_0x1c8aed['count'];var _0x19394a=_0x1c9e52?0x0:_0x16fe17['offset'];var _0x3bb0c1=_0x1c9e52?_0x1c8aed['count']:_0x16fe17['offset']+_0x16fe17[_0x2fef('0x30')];var _0x438a24;if(_0x3bb0c1>=_0x10fa8a){_0x3bb0c1=_0x10fa8a;_0x438a24=0xc8;}else{_0x438a24=0xce;}_0x103bd9['status'](_0x438a24);return _0x103bd9['set'](_0x2fef('0x31'),_0x19394a+'-'+_0x3bb0c1+'/'+_0x10fa8a)['json'](_0x1c8aed);}return null;};}function patchUpdates(_0x193965){return function(_0x3fe971){try{jsonpatch[_0x2fef('0x32')](_0x3fe971,_0x193965,!![]);}catch(_0x22fa04){return BPromise[_0x2fef('0x33')](_0x22fa04);}return _0x3fe971[_0x2fef('0x34')]();};}function saveUpdates(_0x23592d,_0x28ccd7){return function(_0x2b0746){if(_0x2b0746){return _0x2b0746[_0x2fef('0x35')](_0x23592d)[_0x2fef('0x20')](function(_0x4f9f98){return _0x4f9f98;});}return null;};}function removeEntity(_0x384142,_0x54ba3e){return function(_0x293eaf){if(_0x293eaf){return _0x293eaf['destroy']()[_0x2fef('0x20')](function(){_0x384142['status'](0xcc)[_0x2fef('0x2c')]();});}};}function handleEntityNotFound(_0x34b3b6,_0x3de987){return function(_0x548c71){if(!_0x548c71){_0x34b3b6[_0x2fef('0x36')](0x194);}return _0x548c71;};}function handleError(_0x57155e,_0x16a417){_0x16a417=_0x16a417||0x1f4;return function(_0x6cbfa7){logger[_0x2fef('0x27')](_0x6cbfa7[_0x2fef('0x37')]);if(_0x6cbfa7[_0x2fef('0x38')]){delete _0x6cbfa7[_0x2fef('0x38')];}_0x57155e[_0x2fef('0x2b')](_0x16a417)[_0x2fef('0x39')](_0x6cbfa7);};}exports['index']=function(_0x5e93db,_0xda2966){var _0x1ca16b={},_0x37e42a={},_0x42c4aa={'count':0x0,'rows':[]};var _0x46a034=_['map'](db[_0x2fef('0x3a')][_0x2fef('0x3b')],function(_0x10af02){return{'name':_0x10af02[_0x2fef('0x3c')],'type':_0x10af02[_0x2fef('0x3d')][_0x2fef('0x3e')]};});_0x37e42a[_0x2fef('0x3f')]=_[_0x2fef('0x40')](_0x46a034,_0x2fef('0x38'));_0x37e42a[_0x2fef('0x41')]=_[_0x2fef('0x42')](_0x5e93db[_0x2fef('0x41')]);_0x37e42a[_0x2fef('0x43')]=_[_0x2fef('0x44')](_0x37e42a['model'],_0x37e42a[_0x2fef('0x41')]);_0x1ca16b[_0x2fef('0x45')]=_[_0x2fef('0x44')](_0x37e42a[_0x2fef('0x3f')],qs[_0x2fef('0x46')](_0x5e93db[_0x2fef('0x41')]['fields']));_0x1ca16b[_0x2fef('0x45')]=_0x1ca16b[_0x2fef('0x45')]['length']?_0x1ca16b[_0x2fef('0x45')]:_0x37e42a[_0x2fef('0x3f')];if(!_0x5e93db[_0x2fef('0x41')][_0x2fef('0x47')]('nolimit')){_0x1ca16b[_0x2fef('0x30')]=qs['limit'](_0x5e93db[_0x2fef('0x41')][_0x2fef('0x30')]);_0x1ca16b['offset']=qs[_0x2fef('0x2e')](_0x5e93db[_0x2fef('0x41')][_0x2fef('0x2e')]);}_0x1ca16b['order']=qs['sort'](_0x5e93db[_0x2fef('0x41')][_0x2fef('0x48')]);_0x1ca16b[_0x2fef('0x49')]=qs[_0x2fef('0x43')](_['pick'](_0x5e93db[_0x2fef('0x41')],_0x37e42a[_0x2fef('0x43')]),_0x46a034);if(_0x5e93db['query']['filter']){_0x1ca16b[_0x2fef('0x49')]=_[_0x2fef('0x4a')](_0x1ca16b['where'],{'$or':_[_0x2fef('0x40')](_0x46a034,function(_0x54ea80){if(_0x54ea80[_0x2fef('0x3d')]!==_0x2fef('0x4b')){var _0x458d54={};_0x458d54[_0x54ea80[_0x2fef('0x38')]]={'$like':'%'+_0x5e93db[_0x2fef('0x41')]['filter']+'%'};return _0x458d54;}})});}_0x1ca16b=_[_0x2fef('0x4a')]({},_0x1ca16b,_0x5e93db[_0x2fef('0x4c')]);var _0x11b96b={'where':_0x1ca16b[_0x2fef('0x49')]};return db[_0x2fef('0x3a')][_0x2fef('0x4d')](_0x11b96b)[_0x2fef('0x20')](function(_0x3c0132){_0x42c4aa['count']=_0x3c0132;if(_0x5e93db['query'][_0x2fef('0x4e')]){_0x1ca16b[_0x2fef('0x4f')]=[{'all':!![]}];}return db[_0x2fef('0x3a')][_0x2fef('0x50')](_0x1ca16b);})[_0x2fef('0x20')](function(_0x47dac0){_0x42c4aa[_0x2fef('0x51')]=_0x47dac0;return _0x42c4aa;})[_0x2fef('0x20')](respondWithFilteredResult(_0xda2966,_0x1ca16b))[_0x2fef('0x52')](handleError(_0xda2966,null));};exports[_0x2fef('0x53')]=function(_0x3c30b4,_0x87441c){var _0x49edeb={'raw':!![],'where':{'id':_0x3c30b4['params']['id']}},_0x2c6f4b={};_0x2c6f4b[_0x2fef('0x3f')]=_[_0x2fef('0x42')](db[_0x2fef('0x3a')][_0x2fef('0x3b')]);_0x2c6f4b[_0x2fef('0x41')]=_[_0x2fef('0x42')](_0x3c30b4[_0x2fef('0x41')]);_0x2c6f4b[_0x2fef('0x43')]=_['intersection'](_0x2c6f4b['model'],_0x2c6f4b['query']);_0x49edeb['attributes']=_['intersection'](_0x2c6f4b[_0x2fef('0x3f')],qs[_0x2fef('0x46')](_0x3c30b4['query'][_0x2fef('0x46')]));_0x49edeb[_0x2fef('0x45')]=_0x49edeb[_0x2fef('0x45')]['length']?_0x49edeb[_0x2fef('0x45')]:_0x2c6f4b[_0x2fef('0x3f')];if(_0x3c30b4['query'][_0x2fef('0x4e')]){_0x49edeb[_0x2fef('0x4f')]=[{'all':!![]}];}_0x49edeb=_[_0x2fef('0x4a')]({},_0x49edeb,_0x3c30b4['options']);return db[_0x2fef('0x3a')][_0x2fef('0x54')](_0x49edeb)[_0x2fef('0x20')](handleEntityNotFound(_0x87441c,null))[_0x2fef('0x20')](respondWithResult(_0x87441c,null))[_0x2fef('0x52')](handleError(_0x87441c,null));};exports[_0x2fef('0x55')]=function(_0x37d193,_0x2a045e){return db[_0x2fef('0x3a')][_0x2fef('0x55')](_0x37d193['body'],{})[_0x2fef('0x20')](respondWithResult(_0x2a045e,0xc9))[_0x2fef('0x52')](handleError(_0x2a045e,null));};exports[_0x2fef('0x35')]=function(_0x8110fe,_0x37f862){if(_0x8110fe[_0x2fef('0x56')]['id']){delete _0x8110fe[_0x2fef('0x56')]['id'];}return db[_0x2fef('0x3a')][_0x2fef('0x54')]({'where':{'id':_0x8110fe[_0x2fef('0x57')]['id']}})[_0x2fef('0x20')](handleEntityNotFound(_0x37f862,null))[_0x2fef('0x20')](saveUpdates(_0x8110fe['body'],null))['then'](respondWithResult(_0x37f862,null))['catch'](handleError(_0x37f862,null));};exports[_0x2fef('0x58')]=function(_0x5f1715,_0x423c1b){return db['OpenchannelMessage'][_0x2fef('0x54')]({'where':{'id':_0x5f1715[_0x2fef('0x57')]['id']}})[_0x2fef('0x20')](handleEntityNotFound(_0x423c1b,null))[_0x2fef('0x20')](removeEntity(_0x423c1b,null))[_0x2fef('0x52')](handleError(_0x423c1b,null));};exports[_0x2fef('0x59')]=function(_0x299d6f,_0x476ec1){return db[_0x2fef('0x3a')][_0x2fef('0x59')]()['then'](respondWithResult(_0x476ec1,null))[_0x2fef('0x52')](handleError(_0x476ec1,null));};var interaction_log=require(_0x2fef('0x15'))(_0x2fef('0x5a'));exports[_0x2fef('0x5b')]=function(_0x2a1990,_0x4609b0,_0x4f0eb9){var _0x2638a3={'agent':{},'channel':'openchannel'};if(_0x2a1990[_0x2fef('0x56')]['id']){delete _0x2a1990[_0x2fef('0x56')]['id'];}_0x2a1990['body'][_0x2fef('0x5c')]=!![];_0x2a1990[_0x2fef('0x56')][_0x2fef('0x5d')]=moment()[_0x2fef('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a1990[_0x2fef('0x56')]['UserId']=_0x2a1990[_0x2fef('0x56')][_0x2fef('0x5f')]||_0x2a1990[_0x2fef('0x60')]['id'];_0x2638a3[_0x2fef('0x61')]['id']=_0x2a1990['body'][_0x2fef('0x5f')];return db[_0x2fef('0x3a')][_0x2fef('0x54')]({'where':{'id':_0x2a1990[_0x2fef('0x57')]['id'],'UserId':null}})[_0x2fef('0x20')](handleEntityNotFound(_0x4609b0,null))[_0x2fef('0x20')](saveUpdates(_0x2a1990[_0x2fef('0x56')],null))['then'](function(_0x3b05d){if(_0x3b05d){_0x2638a3[_0x2fef('0x29')]=_0x3b05d[_0x2fef('0x62')]({'plain':!![]});return db[_0x2fef('0x63')][_0x2fef('0x54')]({'where':{'id':_0x3b05d['OpenchannelInteractionId']}});}return null;})[_0x2fef('0x20')](handleEntityNotFound(_0x4609b0,null))[_0x2fef('0x20')](function(_0x327cb4){if(_0x327cb4){return _0x327cb4['update']({'UserId':_0x2a1990[_0x2fef('0x56')][_0x2fef('0x5f')],'read1stAt':_['isNil'](_0x327cb4['read1stAt'])?moment()[_0x2fef('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x101442){if(_0x101442){_0x2638a3[_0x2fef('0x64')]=_0x101442[_0x2fef('0x62')]({'plain':!![]});interaction_log[_0x2fef('0x21')](_0x2fef('0x65'),_0x2a1990[_0x2fef('0x60')]['id'],_0x2a1990['user'][_0x2fef('0x38')],_0x2a1990['user'][_0x2fef('0x66')],_0x2638a3[_0x2fef('0x64')]['id'],_0x2a1990[_0x2fef('0x56')]?JSON[_0x2fef('0x26')](_0x2a1990[_0x2fef('0x56')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2638a3);}return null;})['then'](function(_0x27db0a){var _0x4720ba='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x27db0a[_0x2fef('0x29')]['ContactId'];return db['sequelize'][_0x2fef('0x41')](_0x4720ba,{'type':db[_0x2fef('0x67')][_0x2fef('0x68')][_0x2fef('0x69')],'raw':!![]})[_0x2fef('0x20')](function(_0xe4e447){return _0xe4e447;});})[_0x2fef('0x20')](function(_0x27f4e6){if(_0x27f4e6){_0x2638a3[_0x2fef('0x29')][_0x2fef('0x6a')]=_0x27f4e6[0x0];if(!_0x2a1990[_0x2fef('0x56')][_0x2fef('0x5f')])return;return db[_0x2fef('0x6b')][_0x2fef('0x54')]({'where':{'id':_0x2a1990['body'][_0x2fef('0x5f')],'role':'agent'},'attributes':['id',_0x2fef('0x38'),_0x2fef('0x6c'),_0x2fef('0x6d'),'internal'],'raw':!![]});}return null;})[_0x2fef('0x20')](function(_0x18b891){if(!_0x18b891)return null;_0x2638a3[_0x2fef('0x29')][_0x2fef('0x61')]=_0x18b891;return _0x2638a3;})[_0x2fef('0x20')](function(_0x488f84){if(_0x488f84){if(_0x2a1990[_0x2fef('0x56')]['manual']){_0x2638a3['message'][_0x2fef('0x6e')]=util[_0x2fef('0x5e')]('SIP/%s',_0x2a1990[_0x2fef('0x60')][_0x2fef('0x38')]);_0x2638a3['message'][_0x2fef('0x6f')]=_0x2638a3[_0x2fef('0x6f')];_0x2638a3['message']['motionChannel']=_0x2638a3['channel'];_0x2638a3[_0x2fef('0x29')][_0x2fef('0x70')]='accept';return respondWithRpcPromise('EventManager',_0x2fef('0x71'),{'event':'acceptmessage','message':_0x2638a3[_0x2fef('0x29')]},client9002)['then'](function(){return _0x2638a3;});}return _0x2638a3;}return null;})[_0x2fef('0x20')](respondWithResult(_0x4609b0,null))['catch'](handleError(_0x4609b0,null));};var interaction_log=require(_0x2fef('0x15'))(_0x2fef('0x5a'));exports[_0x2fef('0x33')]=function(_0x43648b,_0x642894,_0x5015db){var _0x2f3d54={'agent':{},'channel':_0x2fef('0x72')};if(_0x43648b[_0x2fef('0x56')]['id']){delete _0x43648b[_0x2fef('0x56')]['id'];}_0x43648b[_0x2fef('0x56')][_0x2fef('0x5f')]=_0x43648b[_0x2fef('0x56')][_0x2fef('0x5f')]||_0x43648b[_0x2fef('0x60')]['id'];_0x2f3d54[_0x2fef('0x61')]['id']=_0x43648b[_0x2fef('0x56')][_0x2fef('0x5f')];return db[_0x2fef('0x3a')][_0x2fef('0x54')]({'where':{'id':_0x43648b[_0x2fef('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x642894,null))[_0x2fef('0x20')](function(_0x434c6d){if(_0x434c6d){_0x2f3d54[_0x2fef('0x29')]=_0x434c6d[_0x2fef('0x62')]({'plain':!![]});return db[_0x2fef('0x63')][_0x2fef('0x54')]({'where':{'id':_0x434c6d[_0x2fef('0x73')]}});}return null;})[_0x2fef('0x20')](handleEntityNotFound(_0x642894,null))[_0x2fef('0x20')](function(_0x4477ef){if(_0x4477ef){_0x2f3d54[_0x2fef('0x64')]=_0x4477ef[_0x2fef('0x62')]({'plain':!![]});interaction_log[_0x2fef('0x21')](_0x2fef('0x74'),_0x43648b[_0x2fef('0x60')]['id'],_0x43648b[_0x2fef('0x60')]['name'],_0x43648b[_0x2fef('0x60')]['role'],_0x2f3d54[_0x2fef('0x64')]['id'],_0x43648b['body']?JSON['stringify'](_0x43648b[_0x2fef('0x56')]):_0x2fef('0x75'));return respondWithRpcPromise(_0x2fef('0x76'),'rejectMessage',_0x2f3d54);}return null;})[_0x2fef('0x20')](function(_0x45f14e){var _0x3d8f18=_0x2fef('0x77')+_0x45f14e[_0x2fef('0x29')][_0x2fef('0x78')];return db[_0x2fef('0x79')]['query'](_0x3d8f18,{'type':db[_0x2fef('0x67')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2fef('0x20')](function(_0x56075e){return _0x56075e;});})[_0x2fef('0x20')](function(_0x294b4c){if(_0x294b4c){_0x2f3d54[_0x2fef('0x29')][_0x2fef('0x6a')]=_0x294b4c[0x0];if(!_0x43648b[_0x2fef('0x56')][_0x2fef('0x5f')])return;return db['User'][_0x2fef('0x54')]({'where':{'id':_0x43648b[_0x2fef('0x56')]['UserId'],'role':_0x2fef('0x61')},'attributes':['id',_0x2fef('0x38'),_0x2fef('0x6c'),_0x2fef('0x6d'),_0x2fef('0x7a')],'raw':!![]});}return null;})[_0x2fef('0x20')](function(_0x56b7e8){if(!_0x56b7e8)return null;_0x2f3d54[_0x2fef('0x29')]['agent']=_0x56b7e8;return _0x2f3d54;})[_0x2fef('0x20')](function(_0x19928f){if(_0x19928f){_0x19928f['message']['interface']=util['format'](_0x2fef('0x7b'),_0x43648b[_0x2fef('0x60')][_0x2fef('0x38')]);_0x19928f[_0x2fef('0x29')][_0x2fef('0x6f')]=_0x2f3d54[_0x2fef('0x6f')];_0x19928f[_0x2fef('0x29')][_0x2fef('0x7c')]=_0x2f3d54[_0x2fef('0x6f')];_0x19928f[_0x2fef('0x29')]['event']=_0x2fef('0x33');respondWithRpcPromise('EventManager',_0x2fef('0x71'),{'event':_0x2fef('0x7d'),'message':_0x19928f[_0x2fef('0x29')]},client9002);return _0x2f3d54;}return null;})[_0x2fef('0x20')](respondWithResult(_0x642894,null))[_0x2fef('0x52')](handleError(_0x642894,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6ecd857..5d4aca5 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 _0x2036=['emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','save','update','remove'];(function(_0x1a9df8,_0x4c0692){var _0x1f6e18=function(_0x4624fe){while(--_0x4624fe){_0x1a9df8['push'](_0x1a9df8['shift']());}};_0x1f6e18(++_0x4c0692);}(_0x2036,0x12c));var _0x6203=function(_0x23153a,_0xa2e784){_0x23153a=_0x23153a-0x0;var _0x25b6ef=_0x2036[_0x23153a];return _0x25b6ef;};'use strict';var EventEmitter=require(_0x6203('0x0'));var OpenchannelMessage=require(_0x6203('0x1'))['db'][_0x6203('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6203('0x3'),'afterUpdate':_0x6203('0x4'),'afterDestroy':_0x6203('0x5')};function emitEvent(_0x2ad3cb){return function(_0x347bd9,_0x31ecd0,_0x3821b7){OpenchannelMessageEvents[_0x6203('0x6')](_0x2ad3cb+':'+_0x347bd9['id'],_0x347bd9);OpenchannelMessageEvents['emit'](_0x2ad3cb,_0x347bd9);_0x3821b7(null);};}for(var e in events){if(events[_0x6203('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x6203('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7441=['remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x20f63f,_0x41f75c){var _0x4f1963=function(_0x2329ac){while(--_0x2329ac){_0x20f63f['push'](_0x20f63f['shift']());}};_0x4f1963(++_0x41f75c);}(_0x7441,0xa4));var _0x1744=function(_0x56e7d6,_0x2971f4){_0x56e7d6=_0x56e7d6-0x0;var _0x3ebdcc=_0x7441[_0x56e7d6];return _0x3ebdcc;};'use strict';var EventEmitter=require(_0x1744('0x0'));var OpenchannelMessage=require(_0x1744('0x1'))['db'][_0x1744('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1744('0x3')](0x0);var events={'afterCreate':_0x1744('0x4'),'afterUpdate':_0x1744('0x5'),'afterDestroy':_0x1744('0x6')};function emitEvent(_0x3ef758){return function(_0xb755dc,_0x3e732b,_0x252cda){OpenchannelMessageEvents[_0x1744('0x7')](_0x3ef758+':'+_0xb755dc['id'],_0xb755dc);OpenchannelMessageEvents[_0x1744('0x7')](_0x3ef758,_0xb755dc);_0x252cda(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x1744('0x8')](e,emitEvent(event));}}module[_0x1744('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index add8467..ab26447 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 _0x23a8=['info','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','error','out','CmContact','OpenchannelAccount','find','Interactions','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','omit','Contact','POST'];(function(_0x24b274,_0x980455){var _0x3dd85e=function(_0x2f34be){while(--_0x2f34be){_0x24b274['push'](_0x24b274['shift']());}};_0x3dd85e(++_0x980455);}(_0x23a8,0x175));var _0x823a=function(_0x2bc523,_0x4a6575){_0x2bc523=_0x2bc523-0x0;var _0x3540bc=_0x23a8[_0x2bc523];return _0x3540bc;};'use strict';var _=require(_0x823a('0x0'));var util=require(_0x823a('0x1'));var logger=require(_0x823a('0x2'))(_0x823a('0x3'));var moment=require(_0x823a('0x4'));var BPromise=require(_0x823a('0x5'));var rp=require(_0x823a('0x6'));var fs=require('fs');var path=require(_0x823a('0x7'));var rimraf=require(_0x823a('0x8'));var config=require(_0x823a('0x9'));var attributes=require(_0x823a('0xa'));module[_0x823a('0xb')]=function(_0x3d0310,_0x2c701b){return _0x3d0310[_0x823a('0xc')](_0x823a('0xd'),attributes,{'tableName':_0x823a('0xe'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x823a('0xf')],'type':_0x823a('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x209188,_0x24f3af,_0x504026){var _0x12b630=_0x3d0310[_0x823a('0x11')];var _0x27c863=_0x209188[_0x823a('0x12')]({'plain':!![]});if(_0x27c863[_0x823a('0x13')][_0x823a('0x14')]()==='in'||_0x27c863[_0x823a('0x13')][_0x823a('0x14')]()==='out'&&!_0x27c863[_0x823a('0x15')]&&!_['isNil'](_0x27c863[_0x823a('0x16')])){_0x12b630[_0x823a('0x17')][_0x823a('0x18')]({'where':{'id':_0x27c863[_0x823a('0x19')]}})[_0x823a('0x1a')](function(_0x1d5588){if(_0x1d5588){_0x1d5588[_0x823a('0x1b')]({'lastMsgAt':_0x27c863[_0x823a('0x1c')],'lastMsgDirection':_0x27c863[_0x823a('0x13')]['toLowerCase']()});}})['catch'](function(_0x23244b){console[_0x823a('0x1d')](_0x23244b);});}if(_0x27c863['direction']===_0x823a('0x1e')&&!_0x27c863['secret']){var _0x13a364;_0x12b630[_0x823a('0x1f')]['describe']()[_0x823a('0x1a')](function(_0x2f711b){return _0x12b630[_0x823a('0x20')][_0x823a('0x21')]({'where':{'id':_0x27c863['OpenchannelAccountId']},'include':[{'model':_0x12b630[_0x823a('0x17')],'as':_0x823a('0x22'),'where':{'id':_0x27c863[_0x823a('0x19')]},'limit':0x1,'include':[{'model':_0x12b630[_0x823a('0x1f')],'as':'Contact','attributes':_[_0x823a('0x23')](_0x2f711b)}]}]});})[_0x823a('0x1a')](function(_0x2b5556){_0x13a364=_0x2b5556[_0x823a('0x12')]({'plain':!![]});if(_0x13a364&&_0x13a364[_0x823a('0x24')]){logger['info'](_0x823a('0x25'),_0x823a('0x26'),util['format'](_0x823a('0x27'),_0x27c863['id'],_0x13a364[_0x823a('0x24')]));if(_0x13a364[_0x823a('0x22')]&&_0x13a364[_0x823a('0x22')]['length']){_0x27c863['Interaction']=_[_0x823a('0x28')](_0x13a364['Interactions'][0x0],_0x823a('0x29'));_0x27c863[_0x823a('0x29')]=_0x13a364['Interactions'][0x0][_0x823a('0x29')];}var _0x24f3af={'method':'POST','uri':encodeURI(_0x13a364[_0x823a('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x24f3af['method']){case'GET':_0x24f3af['qs']=_0x27c863;break;case _0x823a('0x2a'):_0x24f3af['body']=_0x27c863;break;}return rp(_0x24f3af)['then'](function(_0x280947){logger[_0x823a('0x2b')](_0x823a('0x25'),_0x823a('0x26'),util[_0x823a('0x2c')](_0x823a('0x2d'),_0x27c863['id'],_0x13a364[_0x823a('0x24')]));if(_0x280947[_0x823a('0xf')][_0x823a('0x2e')]&&_0x280947[_0x823a('0xf')][_0x823a('0x2e')]!=_0x27c863[_0x823a('0x2f')][_0x823a('0x2e')]){return _0x12b630[_0x823a('0x17')][_0x823a('0x1b')]({'threadId':_0x280947[_0x823a('0xf')][_0x823a('0x2e')]},{'where':{'id':_0x27c863[_0x823a('0x2f')]['id']}});}else{return;}})['then'](function(){return _0x209188[_0x823a('0x1b')]({'read':!![]});})['catch'](function(_0x2eba62){logger[_0x823a('0x1d')](_0x823a('0x25'),_0x823a('0x26'),util[_0x823a('0x30')](_0x2eba62,{'showHidden':![],'depth':null}));_0x504026();});}else{_0x504026();}})[_0x823a('0x31')](function(){_0x504026();});}else{_0x504026();}}},'charset':_0x823a('0x32'),'collate':_0x823a('0x33')});}; \ No newline at end of file +var _0xfd3e=['toLowerCase','out','isNil','UserId','OpenchannelInteraction','then','createdAt','catch','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','threadId','update','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','direction'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xfd3e,0xb1));var _0xefd3=function(_0x3131b1,_0x19e1fe){_0x3131b1=_0x3131b1-0x0;var _0x19e5d4=_0xfd3e[_0x3131b1];return _0x19e5d4;};'use strict';var _=require(_0xefd3('0x0'));var util=require(_0xefd3('0x1'));var logger=require('../../config/logger')(_0xefd3('0x2'));var moment=require(_0xefd3('0x3'));var BPromise=require(_0xefd3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefd3('0x5'));var rimraf=require(_0xefd3('0x6'));var config=require(_0xefd3('0x7'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x15b78b,_0x15931c){return _0x15b78b['define'](_0xefd3('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xefd3('0x9'),'fields':[_0xefd3('0xa')],'type':_0xefd3('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x428a58,_0x562180,_0x5212d5){var _0x4c712d=_0x15b78b[_0xefd3('0xc')];var _0x2a7ebe=_0x428a58[_0xefd3('0xd')]({'plain':!![]});if(_0x2a7ebe[_0xefd3('0xe')][_0xefd3('0xf')]()==='in'||_0x2a7ebe[_0xefd3('0xe')]['toLowerCase']()===_0xefd3('0x10')&&!_0x2a7ebe['secret']&&!_[_0xefd3('0x11')](_0x2a7ebe[_0xefd3('0x12')])){_0x4c712d[_0xefd3('0x13')]['findOne']({'where':{'id':_0x2a7ebe['OpenchannelInteractionId']}})[_0xefd3('0x14')](function(_0x11d4f7){if(_0x11d4f7){_0x11d4f7['update']({'lastMsgAt':_0x2a7ebe[_0xefd3('0x15')],'lastMsgDirection':_0x2a7ebe[_0xefd3('0xe')][_0xefd3('0xf')]()});}})[_0xefd3('0x16')](function(_0x26819e){console[_0xefd3('0x17')](_0x26819e);});}if(_0x2a7ebe[_0xefd3('0xe')]===_0xefd3('0x10')&&!_0x2a7ebe[_0xefd3('0x18')]){var _0x536700;_0x4c712d[_0xefd3('0x19')][_0xefd3('0x1a')]()[_0xefd3('0x14')](function(_0x316c41){return _0x4c712d[_0xefd3('0x1b')][_0xefd3('0x1c')]({'where':{'id':_0x2a7ebe[_0xefd3('0x1d')]},'include':[{'model':_0x4c712d[_0xefd3('0x13')],'as':_0xefd3('0x1e'),'where':{'id':_0x2a7ebe[_0xefd3('0x1f')]},'limit':0x1,'include':[{'model':_0x4c712d['CmContact'],'as':_0xefd3('0x20'),'attributes':_['keys'](_0x316c41)}]}]});})[_0xefd3('0x14')](function(_0x13c88c){_0x536700=_0x13c88c[_0xefd3('0xd')]({'plain':!![]});if(_0x536700&&_0x536700[_0xefd3('0x21')]){logger[_0xefd3('0x22')](_0xefd3('0x23'),_0xefd3('0x24'),util['format'](_0xefd3('0x25'),_0x2a7ebe['id'],_0x536700['replyUri']));if(_0x536700[_0xefd3('0x1e')]&&_0x536700['Interactions'][_0xefd3('0x26')]){_0x2a7ebe[_0xefd3('0x27')]=_[_0xefd3('0x28')](_0x536700[_0xefd3('0x1e')][0x0],'Contact');_0x2a7ebe[_0xefd3('0x20')]=_0x536700[_0xefd3('0x1e')][0x0]['Contact'];}var _0x562180={'method':_0xefd3('0x29'),'uri':encodeURI(_0x536700[_0xefd3('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x562180[_0xefd3('0x2a')]){case'GET':_0x562180['qs']=_0x2a7ebe;break;case _0xefd3('0x29'):_0x562180[_0xefd3('0xa')]=_0x2a7ebe;break;}return rp(_0x562180)[_0xefd3('0x14')](function(_0x12dc50){logger[_0xefd3('0x22')](_0xefd3('0x23'),_0xefd3('0x24'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x2a7ebe['id'],_0x536700[_0xefd3('0x21')]));if(_0x12dc50['body'][_0xefd3('0x2b')]&&_0x12dc50[_0xefd3('0xa')][_0xefd3('0x2b')]!=_0x2a7ebe[_0xefd3('0x27')][_0xefd3('0x2b')]){return _0x4c712d[_0xefd3('0x13')][_0xefd3('0x2c')]({'threadId':_0x12dc50['body']['threadId']},{'where':{'id':_0x2a7ebe[_0xefd3('0x27')]['id']}});}else{return;}})[_0xefd3('0x14')](function(){return _0x428a58[_0xefd3('0x2c')]({'read':!![]});})[_0xefd3('0x16')](function(_0x94f65f){logger[_0xefd3('0x17')](_0xefd3('0x23'),_0xefd3('0x24'),util[_0xefd3('0x2d')](_0x94f65f,{'showHidden':![],'depth':null}));_0x5212d5();});}else{_0x5212d5();}})['finally'](function(){_0x5212d5();});}else{_0x5212d5();}}},'charset':_0xefd3('0x2e'),'collate':_0xefd3('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 4d9814a..905fa51 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x13b66a,_0x40599b){var _0x326b8a=function(_0x11a2fc){while(--_0x11a2fc){_0x13b66a['push'](_0x13b66a['shift']());}};_0x326b8a(++_0x40599b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2dae5a,_0x178986){var _0x59c5a6=function(_0x2c6393){while(--_0x2c6393){_0x2dae5a['push'](_0x2dae5a['shift']());}};_0x59c5a6(++_0x178986);}(_0x7a54,0x106));var _0x47a5=function(_0x471be5,_0x485102){_0x471be5=_0x471be5-0x0;var _0xc4ad0=_0x7a54[_0x471be5];return _0xc4ad0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b89be58..72e7fcf 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 _0x3836=['update','emit','removeListener','register','length','./openchannelMessage.events','remove'];(function(_0x5d770f,_0x549b3f){var _0x8cbb15=function(_0xb918a2){while(--_0xb918a2){_0x5d770f['push'](_0x5d770f['shift']());}};_0x8cbb15(++_0x549b3f);}(_0x3836,0x140));var _0x6383=function(_0x219c80,_0x37f586){_0x219c80=_0x219c80-0x0;var _0x52cd36=_0x3836[_0x219c80];return _0x52cd36;};'use strict';var OpenchannelMessageEvents=require(_0x6383('0x0'));var events=['save',_0x6383('0x1'),_0x6383('0x2')];function createListener(_0x2fdcd8,_0x37645f){return function(_0x3183f8){_0x37645f[_0x6383('0x3')](_0x2fdcd8,_0x3183f8);};}function removeListener(_0x4ca96d,_0xbccbc3){return function(){OpenchannelMessageEvents[_0x6383('0x4')](_0x4ca96d,_0xbccbc3);};}exports[_0x6383('0x5')]=function(_0x3c51f3){for(var _0x176daa=0x0,_0x338653=events[_0x6383('0x6')];_0x176daa<_0x338653;_0x176daa++){var _0x25c287=events[_0x176daa];var _0x3d2182=createListener('openchannelMessage:'+_0x25c287,_0x3c51f3);OpenchannelMessageEvents['on'](_0x25c287,_0x3d2182);}}; \ No newline at end of file +var _0xca66=['remove','update','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x125eb3,_0x4171a9){var _0x1b19c5=function(_0x26260c){while(--_0x26260c){_0x125eb3['push'](_0x125eb3['shift']());}};_0x1b19c5(++_0x4171a9);}(_0xca66,0x141));var _0x6ca6=function(_0x3d16ea,_0x13bc1f){_0x3d16ea=_0x3d16ea-0x0;var _0x4f712e=_0xca66[_0x3d16ea];return _0x4f712e;};'use strict';var OpenchannelMessageEvents=require(_0x6ca6('0x0'));var events=['save',_0x6ca6('0x1'),_0x6ca6('0x2')];function createListener(_0xb4318f,_0x5611a2){return function(_0x1a8a0b){_0x5611a2[_0x6ca6('0x3')](_0xb4318f,_0x1a8a0b);};}function removeListener(_0x2e8071,_0x141d6f){return function(){OpenchannelMessageEvents[_0x6ca6('0x4')](_0x2e8071,_0x141d6f);};}exports['register']=function(_0x16591a){for(var _0x1f872c=0x0,_0x1e8e30=events[_0x6ca6('0x5')];_0x1f872c<_0x1e8e30;_0x1f872c++){var _0x981bb7=events[_0x1f872c];var _0x435572=createListener(_0x6ca6('0x6')+_0x981bb7,_0x16591a);OpenchannelMessageEvents['on'](_0x981bb7,_0x435572);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 126b7a0..d56b57b 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 _0x4afa=['update','delete','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x4afa,0x80));var _0xa4af=function(_0xfdf926,_0x49e41a){_0xfdf926=_0xfdf926-0x0;var _0x20d688=_0x4afa[_0xfdf926];return _0x20d688;};'use strict';var multer=require(_0xa4af('0x0'));var util=require(_0xa4af('0x1'));var path=require('path');var timeout=require(_0xa4af('0x2'));var express=require(_0xa4af('0x3'));var router=express[_0xa4af('0x4')]();var fs_extra=require(_0xa4af('0x5'));var auth=require(_0xa4af('0x6'));var interaction=require(_0xa4af('0x7'));var config=require(_0xa4af('0x8'));var controller=require(_0xa4af('0x9'));router[_0xa4af('0xa')]('/',auth[_0xa4af('0xb')](),controller[_0xa4af('0xc')]);router['get'](_0xa4af('0xd'),auth[_0xa4af('0xb')](),controller[_0xa4af('0xe')]);router[_0xa4af('0xa')](_0xa4af('0xf'),auth[_0xa4af('0xb')](),controller[_0xa4af('0x10')]);router[_0xa4af('0xa')](_0xa4af('0x11'),auth['isAuthenticated'](),controller[_0xa4af('0x12')]);router[_0xa4af('0xa')](_0xa4af('0x13'),auth[_0xa4af('0xb')](),controller[_0xa4af('0x14')]);router[_0xa4af('0xa')](_0xa4af('0x15'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa4af('0x16')]('/',auth[_0xa4af('0xb')](),controller[_0xa4af('0x17')]);router['post'](_0xa4af('0x13'),auth['isAuthenticated'](),controller[_0xa4af('0x18')]);router['post'](_0xa4af('0x15'),auth[_0xa4af('0xb')](),controller[_0xa4af('0x19')]);router[_0xa4af('0x1a')](_0xa4af('0xf'),auth[_0xa4af('0xb')](),controller[_0xa4af('0x1b')]);router[_0xa4af('0x1c')](_0xa4af('0xf'),auth[_0xa4af('0xb')](),controller['destroy']);router[_0xa4af('0x1c')]('/:id/teams',auth[_0xa4af('0xb')](),controller[_0xa4af('0x1d')]);router[_0xa4af('0x1c')]('/:id/users',auth[_0xa4af('0xb')](),controller['removeAgents']);module[_0xa4af('0x1e')]=router; \ No newline at end of file +var _0x799d=['Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams','post','create','addTeams','/:id/users','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express'];(function(_0x31f7b0,_0x348609){var _0x4ca05c=function(_0x5228df){while(--_0x5228df){_0x31f7b0['push'](_0x31f7b0['shift']());}};_0x4ca05c(++_0x348609);}(_0x799d,0x114));var _0xd799=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x799d[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xd799('0x0'));var util=require(_0xd799('0x1'));var path=require('path');var timeout=require(_0xd799('0x2'));var express=require(_0xd799('0x3'));var router=express[_0xd799('0x4')]();var fs_extra=require(_0xd799('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd799('0x6'));var config=require(_0xd799('0x7'));var controller=require(_0xd799('0x8'));router[_0xd799('0x9')]('/',auth[_0xd799('0xa')](),controller[_0xd799('0xb')]);router[_0xd799('0x9')](_0xd799('0xc'),auth[_0xd799('0xa')](),controller[_0xd799('0xd')]);router['get'](_0xd799('0xe'),auth[_0xd799('0xa')](),controller[_0xd799('0xf')]);router[_0xd799('0x9')]('/:id/members',auth[_0xd799('0xa')](),controller['getMembers']);router[_0xd799('0x9')](_0xd799('0x10'),auth['isAuthenticated'](),controller[_0xd799('0x11')]);router[_0xd799('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xd799('0x12')]('/',auth[_0xd799('0xa')](),controller[_0xd799('0x13')]);router[_0xd799('0x12')](_0xd799('0x10'),auth[_0xd799('0xa')](),controller[_0xd799('0x14')]);router[_0xd799('0x12')](_0xd799('0x15'),auth[_0xd799('0xa')](),controller['addAgents']);router[_0xd799('0x16')](_0xd799('0xe'),auth[_0xd799('0xa')](),controller[_0xd799('0x17')]);router[_0xd799('0x18')]('/:id',auth[_0xd799('0xa')](),controller[_0xd799('0x19')]);router[_0xd799('0x18')](_0xd799('0x10'),auth[_0xd799('0xa')](),controller[_0xd799('0x1a')]);router['delete'](_0xd799('0x15'),auth[_0xd799('0xa')](),controller['removeAgents']);module[_0xd799('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index a7eca31..9b48ef9 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 _0x334a=['beepall','roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x548302,_0x5d548e){var _0x6934db=function(_0x552a69){while(--_0x552a69){_0x548302['push'](_0x548302['shift']());}};_0x6934db(++_0x5d548e);}(_0x334a,0xcd));var _0xa334=function(_0x579abc,_0x1b2dba){_0x579abc=_0x579abc-0x0;var _0x46bb97=_0x334a[_0x579abc];return _0x46bb97;};'use strict';var Sequelize=require(_0xa334('0x0'));module['exports']={'name':{'type':Sequelize[_0xa334('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa334('0x1')]},'timeout':{'type':Sequelize[_0xa334('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa334('0x3')](_0xa334('0x4'),_0xa334('0x5'),_0xa334('0x6'))}}; \ No newline at end of file +var _0xf158=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0xec02db,_0x3fa48e){var _0x21db30=function(_0xe193cd){while(--_0xe193cd){_0xec02db['push'](_0xec02db['shift']());}};_0x21db30(++_0x3fa48e);}(_0xf158,0x1cf));var _0x8f15=function(_0x471582,_0x23c445){_0x471582=_0x471582-0x0;var _0x474082=_0xf158[_0x471582];return _0x474082;};'use strict';var Sequelize=require(_0x8f15('0x0'));module[_0x8f15('0x1')]={'name':{'type':Sequelize[_0x8f15('0x2')],'unique':_0x8f15('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8f15('0x2')]},'timeout':{'type':Sequelize[_0x8f15('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f15('0x5')](_0x8f15('0x6'),_0x8f15('0x7'),_0x8f15('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 58bca4a..9293d78 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 _0xc4dc=['OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','query','findAll','rows','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','order','sort','pick','filter','map','options','User','UserId','agent','openchannelPause','updatedAt','count','format','SIP','createdAt','Team','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','spread','getAgents','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','limit','set','json','update','then','destroy','get','UserProfileResource','error','stack','name','send'];(function(_0xedf4c2,_0x4cf75e){var _0x77f667=function(_0x5582ec){while(--_0x5582ec){_0xedf4c2['push'](_0xedf4c2['shift']());}};_0x77f667(++_0x4cf75e);}(_0xc4dc,0x140));var _0xcc4d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc4dc[_0x502c7d];return _0x30b7ed;};'use strict';var BPromise=require(_0xcc4d('0x0'));var util=require(_0xcc4d('0x1'));var _=require(_0xcc4d('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xcc4d('0x3'));var logger=require(_0xcc4d('0x4'))(_0xcc4d('0x5'));var config=require(_0xcc4d('0x6'));var db=require(_0xcc4d('0x7'))['db'];config[_0xcc4d('0x8')]=_['defaults'](config[_0xcc4d('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc4d('0x8')]));require(_0xcc4d('0x9'))[_0xcc4d('0xa')](socket);function respondWithStatusCode(_0x2985a1,_0x3103df){_0x3103df=_0x3103df||0xcc;return function(_0x8357f1){if(_0x8357f1){return _0x2985a1[_0xcc4d('0xb')](_0x3103df);}return _0x2985a1[_0xcc4d('0xc')](_0x3103df)[_0xcc4d('0xd')]();};}function respondWithResult(_0x4c28c7,_0x288ef1){_0x288ef1=_0x288ef1||0xc8;return function(_0x9e161e){if(_0x9e161e){return _0x4c28c7[_0xcc4d('0xc')](_0x288ef1)['json'](_0x9e161e);}};}function respondWithFilteredResult(_0x11b1f7,_0x4faa80){return function(_0x250204){if(_0x250204){var _0x438adf=typeof _0x4faa80[_0xcc4d('0xe')]===_0xcc4d('0xf')&&typeof _0x4faa80[_0xcc4d('0x10')]===_0xcc4d('0xf');var _0x33c635=_0x250204['count'];var _0x3eeaa0=_0x438adf?0x0:_0x4faa80['offset'];var _0x4a75ca=_0x438adf?_0x250204['count']:_0x4faa80[_0xcc4d('0xe')]+_0x4faa80[_0xcc4d('0x10')];var _0x302bc4;if(_0x4a75ca>=_0x33c635){_0x4a75ca=_0x33c635;_0x302bc4=0xc8;}else{_0x302bc4=0xce;}_0x11b1f7[_0xcc4d('0xc')](_0x302bc4);return _0x11b1f7[_0xcc4d('0x11')]('Content-Range',_0x3eeaa0+'-'+_0x4a75ca+'/'+_0x33c635)[_0xcc4d('0x12')](_0x250204);}return null;};}function saveUpdates(_0x4fa4ca){return function(_0x93225c){if(_0x93225c){return _0x93225c[_0xcc4d('0x13')](_0x4fa4ca)[_0xcc4d('0x14')](function(_0x2445f3){return _0x2445f3;});}return null;};}function removeEntity(_0x2eaf90){return function(_0x2bb0bd){if(_0x2bb0bd){return _0x2bb0bd[_0xcc4d('0x15')]()[_0xcc4d('0x14')](function(){var _0x379476=_0x2bb0bd[_0xcc4d('0x16')]({'plain':!![]});var _0x1126a4='OpenchannelQueues';return db[_0xcc4d('0x17')]['destroy']({'where':{'type':_0x1126a4,'resourceId':_0x379476['id']}})[_0xcc4d('0x14')](function(){return _0x2bb0bd;});})[_0xcc4d('0x14')](function(){_0x2eaf90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x467f04){return function(_0x50f733){if(!_0x50f733){_0x467f04['sendStatus'](0x194);}return _0x50f733;};}function handleError(_0x5af25c,_0x5221f7){_0x5221f7=_0x5221f7||0x1f4;return function(_0x256a5a){logger[_0xcc4d('0x18')](_0x256a5a[_0xcc4d('0x19')]);if(_0x256a5a['name']){delete _0x256a5a[_0xcc4d('0x1a')];}_0x5af25c['status'](_0x5221f7)[_0xcc4d('0x1b')](_0x256a5a);};}exports['index']=function(_0x171f78,_0x168aca){var _0x45d815={};var _0x581ac5={'count':0x0,'rows':[]};var _0x26836f=_['map'](db[_0xcc4d('0x1c')][_0xcc4d('0x1d')],function(_0x1832cd){return{'name':_0x1832cd[_0xcc4d('0x1e')],'type':_0x1832cd[_0xcc4d('0x1f')][_0xcc4d('0x20')]};});_0x45d815=qs[_0xcc4d('0x21')](_0x26836f,_0x171f78);var _0x24c52f={'where':_0x45d815[_0xcc4d('0x22')]};return db['OpenchannelQueue']['count'](_0x24c52f)['then'](function(_0x5e71e6){_0x581ac5['count']=_0x5e71e6;_0x45d815['include']=qs['include'](_0x171f78[_0xcc4d('0x23')]);return db[_0xcc4d('0x1c')][_0xcc4d('0x24')](_0x45d815);})[_0xcc4d('0x14')](function(_0x33c0d0){_0x581ac5[_0xcc4d('0x25')]=_0x33c0d0;return _0x581ac5;})[_0xcc4d('0x14')](respondWithFilteredResult(_0x168aca,_0x45d815))['catch'](handleError(_0x168aca,null));};exports['show']=function(_0x599692,_0xe53bcb){var _0x3886b4={'raw':!![],'where':{'id':_0x599692[_0xcc4d('0x26')]['id']}},_0x59af4f={};_0x59af4f[_0xcc4d('0x27')]=_[_0xcc4d('0x28')](db[_0xcc4d('0x1c')][_0xcc4d('0x1d')]);_0x59af4f[_0xcc4d('0x23')]=_[_0xcc4d('0x28')](_0x599692['query']);_0x59af4f[_0xcc4d('0x29')]=_[_0xcc4d('0x2a')](_0x59af4f['model'],_0x59af4f[_0xcc4d('0x23')]);_0x3886b4[_0xcc4d('0x2b')]=_[_0xcc4d('0x2a')](_0x59af4f['model'],qs['fields'](_0x599692['query'][_0xcc4d('0x2c')]));_0x3886b4[_0xcc4d('0x2b')]=_0x3886b4[_0xcc4d('0x2b')][_0xcc4d('0x2d')]?_0x3886b4[_0xcc4d('0x2b')]:_0x59af4f[_0xcc4d('0x27')];if(_0x599692[_0xcc4d('0x23')][_0xcc4d('0x2e')]){_0x3886b4['include']=[{'all':!![]}];}_0x3886b4=_[_0xcc4d('0x2f')]({},_0x3886b4,_0x599692['options']);return db[_0xcc4d('0x1c')][_0xcc4d('0x30')](_0x3886b4)[_0xcc4d('0x14')](handleEntityNotFound(_0xe53bcb,null))[_0xcc4d('0x14')](respondWithResult(_0xe53bcb,null))[_0xcc4d('0x31')](handleError(_0xe53bcb,null));};exports[_0xcc4d('0x32')]=function(_0x2effa5,_0x531207){return db[_0xcc4d('0x1c')][_0xcc4d('0x32')](_0x2effa5[_0xcc4d('0x33')],{})[_0xcc4d('0x14')](function(_0x48c632){var _0x19f6d6=_0x2effa5[_0xcc4d('0x34')][_0xcc4d('0x16')]({'plain':!![]});if(!_0x19f6d6)throw new Error(_0xcc4d('0x35'));if(_0x19f6d6[_0xcc4d('0x36')]===_0xcc4d('0x34')){var _0x3b616e=_0x48c632[_0xcc4d('0x16')]({'plain':!![]});var _0x4720d9=_0xcc4d('0x37');return db[_0xcc4d('0x38')]['find']({'where':{'name':_0x4720d9,'userProfileId':_0x19f6d6[_0xcc4d('0x39')]},'raw':!![]})[_0xcc4d('0x14')](function(_0x2db419){if(_0x2db419&&_0x2db419[_0xcc4d('0x3a')]===0x0){return db[_0xcc4d('0x17')]['create']({'name':_0x3b616e[_0xcc4d('0x1a')],'resourceId':_0x3b616e['id'],'type':_0x2db419['name'],'sectionId':_0x2db419['id']},{})[_0xcc4d('0x14')](function(){return _0x48c632;});}else{return _0x48c632;}})[_0xcc4d('0x31')](function(_0x228a3e){logger[_0xcc4d('0x18')](_0xcc4d('0x3b'),_0x228a3e);throw _0x228a3e;});}return _0x48c632;})['then'](respondWithResult(_0x531207,0xc9))[_0xcc4d('0x31')](handleError(_0x531207,null));};exports['update']=function(_0x16c79b,_0x53aca6){if(_0x16c79b[_0xcc4d('0x33')]['id']){delete _0x16c79b[_0xcc4d('0x33')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x16c79b[_0xcc4d('0x26')]['id']}})[_0xcc4d('0x14')](handleEntityNotFound(_0x53aca6,null))[_0xcc4d('0x14')](saveUpdates(_0x16c79b[_0xcc4d('0x33')],null))[_0xcc4d('0x14')](respondWithResult(_0x53aca6,null))[_0xcc4d('0x31')](handleError(_0x53aca6,null));};exports[_0xcc4d('0x15')]=function(_0x693539,_0x551908){return db[_0xcc4d('0x1c')][_0xcc4d('0x30')]({'where':{'id':_0x693539[_0xcc4d('0x26')]['id']}})['then'](handleEntityNotFound(_0x551908,null))[_0xcc4d('0x14')](removeEntity(_0x551908,null))[_0xcc4d('0x31')](handleError(_0x551908,null));};exports[_0xcc4d('0x3c')]=function(_0x4fc274,_0x37298e){return db[_0xcc4d('0x1c')][_0xcc4d('0x3c')]()[_0xcc4d('0x14')](respondWithResult(_0x37298e,null))[_0xcc4d('0x31')](handleError(_0x37298e,null));};exports[_0xcc4d('0x3d')]=function(_0x2a650d,_0x54cda0){var _0x238ec4={'raw':!![],'where':{}},_0xd561e2={},_0x511078;return db[_0xcc4d('0x1c')][_0xcc4d('0x3e')]({'where':{'id':_0x2a650d[_0xcc4d('0x26')]['id']}})[_0xcc4d('0x14')](handleEntityNotFound(_0x54cda0,null))[_0xcc4d('0x14')](function(_0x259805){if(_0x259805){_0x511078=_0x259805[_0xcc4d('0x16')]({'plain':!![]});_0xd561e2['model']=_['keys'](db[_0xcc4d('0x3f')][_0xcc4d('0x1d')]);_0xd561e2[_0xcc4d('0x23')]=_['keys'](_0x2a650d[_0xcc4d('0x23')]);_0xd561e2['filters']=_[_0xcc4d('0x2a')](_0xd561e2[_0xcc4d('0x27')],_0xd561e2[_0xcc4d('0x23')]);_0x238ec4[_0xcc4d('0x2b')]=_[_0xcc4d('0x2a')](_0xd561e2['model'],qs['fields'](_0x2a650d['query']['fields']));_0x238ec4[_0xcc4d('0x2b')]=_0x238ec4[_0xcc4d('0x2b')][_0xcc4d('0x2d')]?_0x238ec4['attributes']:_0xd561e2[_0xcc4d('0x27')];if(!_0x2a650d[_0xcc4d('0x23')][_0xcc4d('0x40')]('nolimit')){_0x238ec4['limit']=qs[_0xcc4d('0x10')](_0x2a650d[_0xcc4d('0x23')]['limit']);_0x238ec4[_0xcc4d('0xe')]=qs[_0xcc4d('0xe')](_0x2a650d[_0xcc4d('0x23')][_0xcc4d('0xe')]);}_0x238ec4[_0xcc4d('0x41')]=qs[_0xcc4d('0x42')](_0x2a650d[_0xcc4d('0x23')][_0xcc4d('0x42')]);_0x238ec4[_0xcc4d('0x22')]=qs[_0xcc4d('0x29')](_[_0xcc4d('0x43')](_0x2a650d[_0xcc4d('0x23')],_0xd561e2[_0xcc4d('0x29')]));_0x238ec4[_0xcc4d('0x22')]['OpenchannelQueueId']=_0x259805['id'];if(_0x2a650d['query'][_0xcc4d('0x44')]){_0x238ec4[_0xcc4d('0x22')]=_[_0xcc4d('0x2f')](_0x238ec4[_0xcc4d('0x22')],{'$or':_[_0xcc4d('0x45')](_0x238ec4['attributes'],function(_0x18abb4){var _0x550a59={};_0x550a59[_0x18abb4]={'$like':'%'+_0x2a650d['query']['filter']+'%'};return _0x550a59;})});}_0x238ec4=_[_0xcc4d('0x2f')]({},_0x238ec4,_0x2a650d[_0xcc4d('0x46')]);return db[_0xcc4d('0x3f')]['findAll'](_0x238ec4);}})[_0xcc4d('0x14')](function(_0x53664d){if(_0x53664d){return db[_0xcc4d('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x53664d,_0xcc4d('0x48')),'role':_0xcc4d('0x49')},'attributes':['id',_0xcc4d('0x1a'),_0xcc4d('0x4a'),_0xcc4d('0x4b'),'createdAt']});}})[_0xcc4d('0x14')](function(_0x261172){if(_0x261172){return{'count':_0x261172[_0xcc4d('0x4c')],'rows':_[_0xcc4d('0x45')](_0x261172['rows'],function(_0x15db26){return{'membername':_0x15db26[_0xcc4d('0x1a')],'UserId':_0x15db26['id'],'queue_name':_0x511078['name'],'OpenchannelQueueId':_0x511078['id'],'interface':util[_0xcc4d('0x4d')]('%s/%s',_0xcc4d('0x4e'),_0x15db26[_0xcc4d('0x1a')]),'penalty':0x0,'paused':_0x15db26[_0xcc4d('0x4a')],'createdAt':_0x15db26[_0xcc4d('0x4f')],'updatedAt':_0x15db26[_0xcc4d('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcc4d('0x14')](respondWithFilteredResult(_0x54cda0,_0x238ec4))[_0xcc4d('0x31')](handleError(_0x54cda0,null));};exports['getTeams']=function(_0x569f72,_0xd7b9c){var _0x5351d9={};var _0x2b5a9b={};var _0x37b1f3;var _0x531dee;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x569f72[_0xcc4d('0x26')]['id']}})[_0xcc4d('0x14')](handleEntityNotFound(_0xd7b9c,null))[_0xcc4d('0x14')](function(_0x11c5c6){if(_0x11c5c6){_0x37b1f3=_0x11c5c6;_0x2b5a9b[_0xcc4d('0x27')]=_['keys'](db[_0xcc4d('0x50')]['rawAttributes']);_0x2b5a9b[_0xcc4d('0x23')]=_[_0xcc4d('0x28')](_0x569f72[_0xcc4d('0x23')]);_0x2b5a9b['filters']=_['intersection'](_0x2b5a9b[_0xcc4d('0x27')],_0x2b5a9b[_0xcc4d('0x23')]);_0x5351d9[_0xcc4d('0x2b')]=_[_0xcc4d('0x2a')](_0x2b5a9b[_0xcc4d('0x27')],qs[_0xcc4d('0x2c')](_0x569f72['query'][_0xcc4d('0x2c')]));_0x5351d9[_0xcc4d('0x2b')]=_0x5351d9['attributes'][_0xcc4d('0x2d')]?_0x5351d9[_0xcc4d('0x2b')]:_0x2b5a9b['model'];_0x5351d9['order']=qs[_0xcc4d('0x42')](_0x569f72[_0xcc4d('0x23')]['sort']);_0x5351d9[_0xcc4d('0x22')]=qs['filters'](_[_0xcc4d('0x43')](_0x569f72[_0xcc4d('0x23')],_0x2b5a9b[_0xcc4d('0x29')]));if(_0x569f72[_0xcc4d('0x23')]['filter']){_0x5351d9[_0xcc4d('0x22')]=_[_0xcc4d('0x2f')](_0x5351d9['where'],{'$or':_[_0xcc4d('0x45')](_0x5351d9[_0xcc4d('0x2b')],function(_0x2ae19d){var _0xdc10={};_0xdc10[_0x2ae19d]={'$like':'%'+_0x569f72[_0xcc4d('0x23')]['filter']+'%'};return _0xdc10;})});}_0x5351d9=_[_0xcc4d('0x2f')]({},_0x5351d9,_0x569f72[_0xcc4d('0x46')]);return _0x37b1f3[_0xcc4d('0x51')](_0x5351d9);}})[_0xcc4d('0x14')](function(_0x580c35){if(_0x580c35){_0x531dee=_0x580c35[_0xcc4d('0x2d')];if(!_0x569f72[_0xcc4d('0x23')][_0xcc4d('0x40')](_0xcc4d('0x52'))){_0x5351d9[_0xcc4d('0x10')]=qs[_0xcc4d('0x10')](_0x569f72[_0xcc4d('0x23')][_0xcc4d('0x10')]);_0x5351d9[_0xcc4d('0xe')]=qs['offset'](_0x569f72[_0xcc4d('0x23')][_0xcc4d('0xe')]);}return _0x37b1f3[_0xcc4d('0x51')](_0x5351d9);}})[_0xcc4d('0x14')](function(_0x461f3b){if(_0x461f3b){return _0x461f3b?{'count':_0x531dee,'rows':_0x461f3b}:null;}})['then'](respondWithResult(_0xd7b9c,null))[_0xcc4d('0x31')](handleError(_0xd7b9c,null));};exports[_0xcc4d('0x53')]=function(_0x2ec9d8,_0x1183a4){var _0x1c6afd=_0x2ec9d8[_0xcc4d('0x33')][_0xcc4d('0x54')];return db[_0xcc4d('0x50')][_0xcc4d('0x24')]({'where':{'id':_0x1c6afd},'attributes':['id'],'include':[{'model':db[_0xcc4d('0x47')],'as':_0xcc4d('0x55'),'attributes':['id',_0xcc4d('0x1a'),_0xcc4d('0x56'),_0xcc4d('0x57'),_0xcc4d('0x58')],'raw':!![]}]})[_0xcc4d('0x14')](function(_0x2c9316){if(_0x2c9316){var _0x9e52e5=_[_0xcc4d('0x59')](_0x2c9316,function(_0x2277e4){var _0x2fbeda=_0x2277e4[_0xcc4d('0x16')]({'plain':!![]});return _0x2fbeda[_0xcc4d('0x55')];});return db[_0xcc4d('0x1c')][_0xcc4d('0x30')]({'where':{'id':_0x2ec9d8[_0xcc4d('0x26')]['id']}})[_0xcc4d('0x14')](function(_0x3f89dd){return db[_0xcc4d('0x5a')][_0xcc4d('0x5b')](function(_0xeaa08b){return _0x3f89dd[_0xcc4d('0x53')](_0x1c6afd,{'transaction':_0xeaa08b})[_0xcc4d('0x14')](function(){return BPromise['each'](_0x9e52e5,function(_0x43d264){return db[_0xcc4d('0x3f')][_0xcc4d('0x5c')]({'where':{'UserId':_0x43d264['id'],'OpenchannelQueueId':_0x2ec9d8[_0xcc4d('0x26')]['id']},'transaction':_0xeaa08b});});})[_0xcc4d('0x14')](function(){_0x9e52e5[_0xcc4d('0x5d')](function(_0x2b833e){socket[_0xcc4d('0x5e')](_0xcc4d('0x5f'),{'UserId':_0x2b833e['id'],'OpenchannelQueueId':_0x3f89dd['id']});});});});});}})[_0xcc4d('0x14')](respondWithStatusCode(_0x1183a4,null))['catch'](handleError(_0x1183a4,null));};exports[_0xcc4d('0x60')]=function(_0x1c3372,_0x2f8083){return db[_0xcc4d('0x50')][_0xcc4d('0x24')]({'where':{'id':_0x1c3372[_0xcc4d('0x23')][_0xcc4d('0x54')]},'attributes':['id'],'include':[{'model':db[_0xcc4d('0x47')],'as':_0xcc4d('0x55'),'attributes':['id'],'raw':!![]}]})[_0xcc4d('0x14')](handleEntityNotFound(_0x2f8083,null))[_0xcc4d('0x14')](function(_0x307cad){var _0x873184=_['map'](_0x307cad,'id');var _0x466206=[];var _0x466026=[];var _0x425625=squel[_0xcc4d('0x61')]();_0x425625['field'](_0xcc4d('0x62'))[_0xcc4d('0x63')](_0xcc4d('0x64'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('OpenchannelQueueId\x20=\x20?',_0x1c3372['params']['id']);for(var _0x1d2ae6=0x0;_0x1d2ae6<_0x307cad['length'];_0x1d2ae6+=0x1){let _0x43d2f2=_0x307cad[_0x1d2ae6];for(var _0x51941a=0x0;_0x51941a<_0x43d2f2[_0xcc4d('0x55')][_0xcc4d('0x2d')];_0x51941a+=0x1){let _0x55e620=_0x43d2f2[_0xcc4d('0x55')][_0x51941a];var _0x3d35c5=_0x425625[_0xcc4d('0x65')]();_0x3d35c5['where'](_0xcc4d('0x66'),_0x55e620['id']);_0x466026[_0xcc4d('0x67')](db[_0xcc4d('0x5a')]['query'](_0x3d35c5[_0xcc4d('0x68')](),{'type':db[_0xcc4d('0x5a')][_0xcc4d('0x69')]['SELECT']})[_0xcc4d('0x14')](function(_0x3bdffc){if(_0x3bdffc[_0xcc4d('0x2d')]===0x1){return _0x55e620['id'];}else{var _0x287556=_['every'](_[_0xcc4d('0x45')](_0x3bdffc,'TeamId'),function(_0x5d7761){return _[_0xcc4d('0x6a')](_0x873184,_0x5d7761);});if(_0x287556){return _0x55e620['id'];}}}));}}return BPromise[_0xcc4d('0x6b')](_0x466026)[_0xcc4d('0x14')](function(_0x58190f){_0x466206=_(_0x466206)[_0xcc4d('0x6c')](_0x58190f)[_0xcc4d('0x6d')]()[_0xcc4d('0x6e')]();return db[_0xcc4d('0x1c')][_0xcc4d('0x30')]({'where':{'id':_0x1c3372['params']['id']}})['then'](function(_0x59b720){return db['sequelize']['transaction'](function(_0x125275){return _0x59b720[_0xcc4d('0x60')](_0x1c3372[_0xcc4d('0x23')][_0xcc4d('0x54')],{'transaction':_0x125275})[_0xcc4d('0x14')](function(){if(!_['isEmpty'](_0x466206)){return _0x59b720[_0xcc4d('0x6f')](_0x466206,{'transaction':_0x125275});}})['then'](function(){_0x466206['forEach'](function(_0x23b28a){socket[_0xcc4d('0x5e')](_0xcc4d('0x70'),{'UserId':_0x23b28a,'OpenchannelQueueId':_0x59b720['id']});});});});});});})[_0xcc4d('0x14')](respondWithStatusCode(_0x2f8083,null))[_0xcc4d('0x31')](handleError(_0x2f8083,null));};exports[_0xcc4d('0x71')]=function(_0x524ac7,_0x1bd793){return db[_0xcc4d('0x1c')][_0xcc4d('0x30')]({'where':{'id':_0x524ac7['params']['id']}})[_0xcc4d('0x14')](handleEntityNotFound(_0x1bd793,null))[_0xcc4d('0x14')](function(_0x33e37a){if(_0x33e37a){return _0x33e37a['addAgents'](_0x524ac7[_0xcc4d('0x33')][_0xcc4d('0x54')],_['omit'](_0x524ac7['body'],[_0xcc4d('0x54'),'id'])||{})[_0xcc4d('0x72')](function(_0x5473b4){for(var _0x38c3d5=0x0;_0x38c3d5<_0x524ac7[_0xcc4d('0x33')][_0xcc4d('0x54')][_0xcc4d('0x2d')];_0x38c3d5+=0x1){socket[_0xcc4d('0x5e')](_0xcc4d('0x5f'),{'UserId':Number(_0x524ac7['body'][_0xcc4d('0x54')][_0x38c3d5]),'OpenchannelQueueId':Number(_0x524ac7[_0xcc4d('0x26')]['id'])});}return _0x5473b4;});}})[_0xcc4d('0x14')](respondWithResult(_0x1bd793,null))['catch'](handleError(_0x1bd793,null));};exports[_0xcc4d('0x6f')]=function(_0x352f22,_0x5c8f33){return db[_0xcc4d('0x1c')][_0xcc4d('0x30')]({'where':{'id':_0x352f22[_0xcc4d('0x26')]['id']}})[_0xcc4d('0x14')](handleEntityNotFound(_0x5c8f33,null))[_0xcc4d('0x14')](function(_0x5ee903){if(_0x5ee903){return _0x5ee903['removeAgents'](_0x352f22[_0xcc4d('0x23')][_0xcc4d('0x54')])[_0xcc4d('0x14')](function(){if(_['isArray'](_0x352f22['query'][_0xcc4d('0x54')])){for(var _0x48fe26=0x0;_0x48fe26<_0x352f22[_0xcc4d('0x23')][_0xcc4d('0x54')]['length'];_0x48fe26+=0x1){socket['emit'](_0xcc4d('0x70'),{'UserId':Number(_0x352f22['query'][_0xcc4d('0x54')][_0x48fe26]),'OpenchannelQueueId':Number(_0x352f22[_0xcc4d('0x26')]['id'])});}}else{socket[_0xcc4d('0x5e')](_0xcc4d('0x70'),{'UserId':Number(_0x352f22[_0xcc4d('0x23')]['ids']),'OpenchannelQueueId':Number(_0x352f22[_0xcc4d('0x26')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c8f33,null))[_0xcc4d('0x31')](handleError(_0x5c8f33,null));};exports['getAgents']=function(_0x23f9a3,_0x1db9d1){var _0x53105f={};var _0x224809={};var _0x25688a;var _0x34d194;return db[_0xcc4d('0x1c')][_0xcc4d('0x3e')]({'where':{'id':_0x23f9a3[_0xcc4d('0x26')]['id']}})[_0xcc4d('0x14')](handleEntityNotFound(_0x1db9d1,null))['then'](function(_0x5ae136){if(_0x5ae136){_0x25688a=_0x5ae136;_0x224809[_0xcc4d('0x27')]=_[_0xcc4d('0x28')](db[_0xcc4d('0x47')]['rawAttributes']);_0x224809[_0xcc4d('0x23')]=_['keys'](_0x23f9a3[_0xcc4d('0x23')]);_0x224809[_0xcc4d('0x29')]=_[_0xcc4d('0x2a')](_0x224809['model'],_0x224809['query']);_0x53105f[_0xcc4d('0x2b')]=_[_0xcc4d('0x2a')](_0x224809[_0xcc4d('0x27')],qs[_0xcc4d('0x2c')](_0x23f9a3['query'][_0xcc4d('0x2c')]));_0x53105f['attributes']=_0x53105f[_0xcc4d('0x2b')][_0xcc4d('0x2d')]?_0x53105f[_0xcc4d('0x2b')]:_0x224809[_0xcc4d('0x27')];_0x53105f[_0xcc4d('0x41')]=qs[_0xcc4d('0x42')](_0x23f9a3[_0xcc4d('0x23')][_0xcc4d('0x42')]);_0x53105f[_0xcc4d('0x22')]=qs[_0xcc4d('0x29')](_['pick'](_0x23f9a3[_0xcc4d('0x23')],_0x224809['filters']));if(_0x23f9a3[_0xcc4d('0x23')]['filter']){_0x53105f['where']=_[_0xcc4d('0x2f')](_0x53105f[_0xcc4d('0x22')],{'$or':_['map'](_0x53105f['attributes'],function(_0x4cfad2){var _0xd44eb9={};_0xd44eb9[_0x4cfad2]={'$like':'%'+_0x23f9a3[_0xcc4d('0x23')][_0xcc4d('0x44')]+'%'};return _0xd44eb9;})});}_0x53105f=_[_0xcc4d('0x2f')]({},_0x53105f,_0x23f9a3['options']);return _0x25688a[_0xcc4d('0x73')](_0x53105f);}})[_0xcc4d('0x14')](function(_0x1d4a97){if(_0x1d4a97){_0x34d194=_0x1d4a97['length'];if(!_0x23f9a3[_0xcc4d('0x23')][_0xcc4d('0x40')](_0xcc4d('0x52'))){_0x53105f['limit']=qs[_0xcc4d('0x10')](_0x23f9a3['query']['limit']);_0x53105f['offset']=qs['offset'](_0x23f9a3['query'][_0xcc4d('0xe')]);}return _0x25688a[_0xcc4d('0x73')](_0x53105f);}})[_0xcc4d('0x14')](function(_0x22823a){if(_0x22823a){return _0x22823a?{'count':_0x34d194,'rows':_0x22823a}:null;}})[_0xcc4d('0x14')](respondWithResult(_0x1db9d1,null))['catch'](handleError(_0x1db9d1,null));}; \ No newline at end of file +var _0xf7c8=['ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','emit','addAgents','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','offset','undefined','limit','count','set','Content-Range','update','then','destroy','OpenchannelQueues','UserProfileResource','status','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','getOptions','include','findAll','rows','catch','show','params','query','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','get','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','sort','where','pick','OpenchannelQueueId','filter','User','findAndCountAll','UserId','createdAt','%s/%s','openchannelPause','updatedAt','getTeams','Team','order','ids','online','voicePause','interface','flatMap','transaction','findOrCreate','removeTeams','Agents','select','tq.TeamId','from','user_has_teams','OpenchannelQueueId\x20=\x20?','clone'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xf7c8,0x1f4));var _0x8f7c=function(_0xd4538e,_0x31153f){_0xd4538e=_0xd4538e-0x0;var _0xf8a2ca=_0xf7c8[_0xd4538e];return _0xf8a2ca;};'use strict';var BPromise=require('bluebird');var util=require(_0x8f7c('0x0'));var _=require('lodash');var squel=require(_0x8f7c('0x1'));var Redis=require(_0x8f7c('0x2'));var qs=require(_0x8f7c('0x3'));var logger=require(_0x8f7c('0x4'))(_0x8f7c('0x5'));var config=require(_0x8f7c('0x6'));var db=require(_0x8f7c('0x7'))['db'];config[_0x8f7c('0x8')]=_[_0x8f7c('0x9')](config[_0x8f7c('0x8')],{'host':_0x8f7c('0xa'),'port':0x18eb});var socket=require(_0x8f7c('0xb'))(new Redis(config[_0x8f7c('0x8')]));require(_0x8f7c('0xc'))[_0x8f7c('0xd')](socket);function respondWithStatusCode(_0x555c7c,_0x1cad25){_0x1cad25=_0x1cad25||0xcc;return function(_0x5a59b9){if(_0x5a59b9){return _0x555c7c[_0x8f7c('0xe')](_0x1cad25);}return _0x555c7c['status'](_0x1cad25)[_0x8f7c('0xf')]();};}function respondWithResult(_0x477848,_0xac69b0){_0xac69b0=_0xac69b0||0xc8;return function(_0x567724){if(_0x567724){return _0x477848['status'](_0xac69b0)['json'](_0x567724);}};}function respondWithFilteredResult(_0x996183,_0x5c3d02){return function(_0x362cce){if(_0x362cce){var _0x39cb73=typeof _0x5c3d02[_0x8f7c('0x10')]===_0x8f7c('0x11')&&typeof _0x5c3d02[_0x8f7c('0x12')]==='undefined';var _0x530b5b=_0x362cce[_0x8f7c('0x13')];var _0x41576f=_0x39cb73?0x0:_0x5c3d02[_0x8f7c('0x10')];var _0x5408e1=_0x39cb73?_0x362cce[_0x8f7c('0x13')]:_0x5c3d02[_0x8f7c('0x10')]+_0x5c3d02['limit'];var _0x19b887;if(_0x5408e1>=_0x530b5b){_0x5408e1=_0x530b5b;_0x19b887=0xc8;}else{_0x19b887=0xce;}_0x996183['status'](_0x19b887);return _0x996183[_0x8f7c('0x14')](_0x8f7c('0x15'),_0x41576f+'-'+_0x5408e1+'/'+_0x530b5b)['json'](_0x362cce);}return null;};}function saveUpdates(_0x34c368){return function(_0x418bc1){if(_0x418bc1){return _0x418bc1[_0x8f7c('0x16')](_0x34c368)[_0x8f7c('0x17')](function(_0x284e32){return _0x284e32;});}return null;};}function removeEntity(_0x463040){return function(_0x364afe){if(_0x364afe){return _0x364afe[_0x8f7c('0x18')]()[_0x8f7c('0x17')](function(){var _0x5a0ade=_0x364afe['get']({'plain':!![]});var _0x2ea60b=_0x8f7c('0x19');return db[_0x8f7c('0x1a')][_0x8f7c('0x18')]({'where':{'type':_0x2ea60b,'resourceId':_0x5a0ade['id']}})['then'](function(){return _0x364afe;});})[_0x8f7c('0x17')](function(){_0x463040[_0x8f7c('0x1b')](0xcc)[_0x8f7c('0xf')]();});}};}function handleEntityNotFound(_0x15530b){return function(_0x2ae638){if(!_0x2ae638){_0x15530b[_0x8f7c('0xe')](0x194);}return _0x2ae638;};}function handleError(_0x5de816,_0x55866d){_0x55866d=_0x55866d||0x1f4;return function(_0x5783db){logger[_0x8f7c('0x1c')](_0x5783db[_0x8f7c('0x1d')]);if(_0x5783db[_0x8f7c('0x1e')]){delete _0x5783db[_0x8f7c('0x1e')];}_0x5de816[_0x8f7c('0x1b')](_0x55866d)[_0x8f7c('0x1f')](_0x5783db);};}exports[_0x8f7c('0x20')]=function(_0x276496,_0x5ce1f9){var _0x37a6b6={};var _0x37e9b5={'count':0x0,'rows':[]};var _0xb1cbd4=_[_0x8f7c('0x21')](db[_0x8f7c('0x22')][_0x8f7c('0x23')],function(_0x5bc82f){return{'name':_0x5bc82f[_0x8f7c('0x24')],'type':_0x5bc82f[_0x8f7c('0x25')]['key']};});_0x37a6b6=qs[_0x8f7c('0x26')](_0xb1cbd4,_0x276496);var _0x3d857a={'where':_0x37a6b6['where']};return db[_0x8f7c('0x22')][_0x8f7c('0x13')](_0x3d857a)[_0x8f7c('0x17')](function(_0x1490a3){_0x37e9b5[_0x8f7c('0x13')]=_0x1490a3;_0x37a6b6[_0x8f7c('0x27')]=qs[_0x8f7c('0x27')](_0x276496['query']);return db['OpenchannelQueue'][_0x8f7c('0x28')](_0x37a6b6);})[_0x8f7c('0x17')](function(_0x3f894e){_0x37e9b5[_0x8f7c('0x29')]=_0x3f894e;return _0x37e9b5;})['then'](respondWithFilteredResult(_0x5ce1f9,_0x37a6b6))[_0x8f7c('0x2a')](handleError(_0x5ce1f9,null));};exports[_0x8f7c('0x2b')]=function(_0x42cbf4,_0xfa76a2){var _0x15c633={'raw':!![],'where':{'id':_0x42cbf4[_0x8f7c('0x2c')]['id']}},_0x3f2a8d={};_0x3f2a8d['model']=_['keys'](db[_0x8f7c('0x22')]['rawAttributes']);_0x3f2a8d[_0x8f7c('0x2d')]=_[_0x8f7c('0x2e')](_0x42cbf4[_0x8f7c('0x2d')]);_0x3f2a8d[_0x8f7c('0x2f')]=_[_0x8f7c('0x30')](_0x3f2a8d[_0x8f7c('0x31')],_0x3f2a8d[_0x8f7c('0x2d')]);_0x15c633[_0x8f7c('0x32')]=_[_0x8f7c('0x30')](_0x3f2a8d[_0x8f7c('0x31')],qs[_0x8f7c('0x33')](_0x42cbf4['query']['fields']));_0x15c633[_0x8f7c('0x32')]=_0x15c633[_0x8f7c('0x32')][_0x8f7c('0x34')]?_0x15c633[_0x8f7c('0x32')]:_0x3f2a8d[_0x8f7c('0x31')];if(_0x42cbf4[_0x8f7c('0x2d')][_0x8f7c('0x35')]){_0x15c633[_0x8f7c('0x27')]=[{'all':!![]}];}_0x15c633=_[_0x8f7c('0x36')]({},_0x15c633,_0x42cbf4[_0x8f7c('0x37')]);return db[_0x8f7c('0x22')][_0x8f7c('0x38')](_0x15c633)[_0x8f7c('0x17')](handleEntityNotFound(_0xfa76a2,null))[_0x8f7c('0x17')](respondWithResult(_0xfa76a2,null))[_0x8f7c('0x2a')](handleError(_0xfa76a2,null));};exports[_0x8f7c('0x39')]=function(_0x2db1d4,_0xe1273e){return db[_0x8f7c('0x22')][_0x8f7c('0x39')](_0x2db1d4[_0x8f7c('0x3a')],{})[_0x8f7c('0x17')](function(_0x252fca){var _0x7b4f8f=_0x2db1d4['user'][_0x8f7c('0x3b')]({'plain':!![]});if(!_0x7b4f8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7b4f8f[_0x8f7c('0x3c')]===_0x8f7c('0x3d')){var _0x382cc9=_0x252fca['get']({'plain':!![]});var _0x37f1de=_0x8f7c('0x19');return db[_0x8f7c('0x3e')][_0x8f7c('0x38')]({'where':{'name':_0x37f1de,'userProfileId':_0x7b4f8f['userProfileId']},'raw':!![]})[_0x8f7c('0x17')](function(_0x4b9646){if(_0x4b9646&&_0x4b9646[_0x8f7c('0x3f')]===0x0){return db[_0x8f7c('0x1a')][_0x8f7c('0x39')]({'name':_0x382cc9[_0x8f7c('0x1e')],'resourceId':_0x382cc9['id'],'type':_0x4b9646['name'],'sectionId':_0x4b9646['id']},{})[_0x8f7c('0x17')](function(){return _0x252fca;});}else{return _0x252fca;}})['catch'](function(_0x4cae40){logger['error'](_0x8f7c('0x40'),_0x4cae40);throw _0x4cae40;});}return _0x252fca;})[_0x8f7c('0x17')](respondWithResult(_0xe1273e,0xc9))[_0x8f7c('0x2a')](handleError(_0xe1273e,null));};exports[_0x8f7c('0x16')]=function(_0x133f7e,_0x532fca){if(_0x133f7e[_0x8f7c('0x3a')]['id']){delete _0x133f7e['body']['id'];}return db[_0x8f7c('0x22')][_0x8f7c('0x38')]({'where':{'id':_0x133f7e[_0x8f7c('0x2c')]['id']}})[_0x8f7c('0x17')](handleEntityNotFound(_0x532fca,null))[_0x8f7c('0x17')](saveUpdates(_0x133f7e['body'],null))[_0x8f7c('0x17')](respondWithResult(_0x532fca,null))['catch'](handleError(_0x532fca,null));};exports[_0x8f7c('0x18')]=function(_0x442411,_0x26f219){return db[_0x8f7c('0x22')][_0x8f7c('0x38')]({'where':{'id':_0x442411[_0x8f7c('0x2c')]['id']}})[_0x8f7c('0x17')](handleEntityNotFound(_0x26f219,null))[_0x8f7c('0x17')](removeEntity(_0x26f219,null))['catch'](handleError(_0x26f219,null));};exports[_0x8f7c('0x41')]=function(_0x5882d1,_0x1d1b10){return db[_0x8f7c('0x22')][_0x8f7c('0x41')]()[_0x8f7c('0x17')](respondWithResult(_0x1d1b10,null))[_0x8f7c('0x2a')](handleError(_0x1d1b10,null));};exports['getMembers']=function(_0x384e30,_0x20945c){var _0xc21e03={'raw':!![],'where':{}},_0xeabe15={},_0xdea006;return db[_0x8f7c('0x22')][_0x8f7c('0x42')]({'where':{'id':_0x384e30[_0x8f7c('0x2c')]['id']}})[_0x8f7c('0x17')](handleEntityNotFound(_0x20945c,null))[_0x8f7c('0x17')](function(_0x4eb7ac){if(_0x4eb7ac){_0xdea006=_0x4eb7ac[_0x8f7c('0x3b')]({'plain':!![]});_0xeabe15[_0x8f7c('0x31')]=_[_0x8f7c('0x2e')](db[_0x8f7c('0x43')][_0x8f7c('0x23')]);_0xeabe15[_0x8f7c('0x2d')]=_['keys'](_0x384e30[_0x8f7c('0x2d')]);_0xeabe15['filters']=_['intersection'](_0xeabe15['model'],_0xeabe15[_0x8f7c('0x2d')]);_0xc21e03[_0x8f7c('0x32')]=_[_0x8f7c('0x30')](_0xeabe15[_0x8f7c('0x31')],qs[_0x8f7c('0x33')](_0x384e30['query'][_0x8f7c('0x33')]));_0xc21e03[_0x8f7c('0x32')]=_0xc21e03[_0x8f7c('0x32')][_0x8f7c('0x34')]?_0xc21e03['attributes']:_0xeabe15[_0x8f7c('0x31')];if(!_0x384e30['query'][_0x8f7c('0x44')](_0x8f7c('0x45'))){_0xc21e03[_0x8f7c('0x12')]=qs[_0x8f7c('0x12')](_0x384e30['query']['limit']);_0xc21e03['offset']=qs['offset'](_0x384e30['query'][_0x8f7c('0x10')]);}_0xc21e03['order']=qs[_0x8f7c('0x46')](_0x384e30['query'][_0x8f7c('0x46')]);_0xc21e03[_0x8f7c('0x47')]=qs[_0x8f7c('0x2f')](_[_0x8f7c('0x48')](_0x384e30[_0x8f7c('0x2d')],_0xeabe15[_0x8f7c('0x2f')]));_0xc21e03[_0x8f7c('0x47')][_0x8f7c('0x49')]=_0x4eb7ac['id'];if(_0x384e30[_0x8f7c('0x2d')][_0x8f7c('0x4a')]){_0xc21e03['where']=_[_0x8f7c('0x36')](_0xc21e03['where'],{'$or':_[_0x8f7c('0x21')](_0xc21e03[_0x8f7c('0x32')],function(_0x39ebd8){var _0x5ab36c={};_0x5ab36c[_0x39ebd8]={'$like':'%'+_0x384e30[_0x8f7c('0x2d')][_0x8f7c('0x4a')]+'%'};return _0x5ab36c;})});}_0xc21e03=_['merge']({},_0xc21e03,_0x384e30[_0x8f7c('0x37')]);return db[_0x8f7c('0x43')]['findAll'](_0xc21e03);}})[_0x8f7c('0x17')](function(_0x10bad2){if(_0x10bad2){return db[_0x8f7c('0x4b')][_0x8f7c('0x4c')]({'where':{'id':_[_0x8f7c('0x21')](_0x10bad2,_0x8f7c('0x4d')),'role':'agent'},'attributes':['id',_0x8f7c('0x1e'),'openchannelPause','updatedAt',_0x8f7c('0x4e')]});}})[_0x8f7c('0x17')](function(_0x595e5b){if(_0x595e5b){return{'count':_0x595e5b[_0x8f7c('0x13')],'rows':_['map'](_0x595e5b[_0x8f7c('0x29')],function(_0xeac6c3){return{'membername':_0xeac6c3[_0x8f7c('0x1e')],'UserId':_0xeac6c3['id'],'queue_name':_0xdea006['name'],'OpenchannelQueueId':_0xdea006['id'],'interface':util['format'](_0x8f7c('0x4f'),'SIP',_0xeac6c3[_0x8f7c('0x1e')]),'penalty':0x0,'paused':_0xeac6c3[_0x8f7c('0x50')],'createdAt':_0xeac6c3[_0x8f7c('0x4e')],'updatedAt':_0xeac6c3[_0x8f7c('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8f7c('0x17')](respondWithFilteredResult(_0x20945c,_0xc21e03))[_0x8f7c('0x2a')](handleError(_0x20945c,null));};exports[_0x8f7c('0x52')]=function(_0x519dfe,_0x4fb141){var _0x2aae86={};var _0x5ce0d7={};var _0x468333;var _0x4766b0;return db['OpenchannelQueue'][_0x8f7c('0x42')]({'where':{'id':_0x519dfe[_0x8f7c('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4fb141,null))[_0x8f7c('0x17')](function(_0x1ee7e5){if(_0x1ee7e5){_0x468333=_0x1ee7e5;_0x5ce0d7[_0x8f7c('0x31')]=_[_0x8f7c('0x2e')](db[_0x8f7c('0x53')][_0x8f7c('0x23')]);_0x5ce0d7['query']=_['keys'](_0x519dfe[_0x8f7c('0x2d')]);_0x5ce0d7[_0x8f7c('0x2f')]=_[_0x8f7c('0x30')](_0x5ce0d7['model'],_0x5ce0d7[_0x8f7c('0x2d')]);_0x2aae86['attributes']=_['intersection'](_0x5ce0d7[_0x8f7c('0x31')],qs[_0x8f7c('0x33')](_0x519dfe[_0x8f7c('0x2d')][_0x8f7c('0x33')]));_0x2aae86[_0x8f7c('0x32')]=_0x2aae86['attributes']['length']?_0x2aae86[_0x8f7c('0x32')]:_0x5ce0d7[_0x8f7c('0x31')];_0x2aae86[_0x8f7c('0x54')]=qs[_0x8f7c('0x46')](_0x519dfe[_0x8f7c('0x2d')]['sort']);_0x2aae86[_0x8f7c('0x47')]=qs[_0x8f7c('0x2f')](_[_0x8f7c('0x48')](_0x519dfe[_0x8f7c('0x2d')],_0x5ce0d7['filters']));if(_0x519dfe['query'][_0x8f7c('0x4a')]){_0x2aae86['where']=_[_0x8f7c('0x36')](_0x2aae86['where'],{'$or':_[_0x8f7c('0x21')](_0x2aae86[_0x8f7c('0x32')],function(_0x1c3fec){var _0x507296={};_0x507296[_0x1c3fec]={'$like':'%'+_0x519dfe[_0x8f7c('0x2d')][_0x8f7c('0x4a')]+'%'};return _0x507296;})});}_0x2aae86=_[_0x8f7c('0x36')]({},_0x2aae86,_0x519dfe[_0x8f7c('0x37')]);return _0x468333[_0x8f7c('0x52')](_0x2aae86);}})[_0x8f7c('0x17')](function(_0x3d3200){if(_0x3d3200){_0x4766b0=_0x3d3200[_0x8f7c('0x34')];if(!_0x519dfe[_0x8f7c('0x2d')][_0x8f7c('0x44')](_0x8f7c('0x45'))){_0x2aae86[_0x8f7c('0x12')]=qs[_0x8f7c('0x12')](_0x519dfe[_0x8f7c('0x2d')][_0x8f7c('0x12')]);_0x2aae86[_0x8f7c('0x10')]=qs[_0x8f7c('0x10')](_0x519dfe[_0x8f7c('0x2d')]['offset']);}return _0x468333[_0x8f7c('0x52')](_0x2aae86);}})[_0x8f7c('0x17')](function(_0x4ff6bb){if(_0x4ff6bb){return _0x4ff6bb?{'count':_0x4766b0,'rows':_0x4ff6bb}:null;}})[_0x8f7c('0x17')](respondWithResult(_0x4fb141,null))['catch'](handleError(_0x4fb141,null));};exports['addTeams']=function(_0xf6682e,_0x148bbb){var _0x347902=_0xf6682e[_0x8f7c('0x3a')][_0x8f7c('0x55')];return db[_0x8f7c('0x53')]['findAll']({'where':{'id':_0x347902},'attributes':['id'],'include':[{'model':db[_0x8f7c('0x4b')],'as':'Agents','attributes':['id','name',_0x8f7c('0x56'),_0x8f7c('0x57'),_0x8f7c('0x58')],'raw':!![]}]})['then'](function(_0x5847af){if(_0x5847af){var _0xa33596=_[_0x8f7c('0x59')](_0x5847af,function(_0x333119){var _0x3ff511=_0x333119[_0x8f7c('0x3b')]({'plain':!![]});return _0x3ff511['Agents'];});return db[_0x8f7c('0x22')]['find']({'where':{'id':_0xf6682e[_0x8f7c('0x2c')]['id']}})[_0x8f7c('0x17')](function(_0x1837e0){return db['sequelize'][_0x8f7c('0x5a')](function(_0x16dd7f){return _0x1837e0['addTeams'](_0x347902,{'transaction':_0x16dd7f})['then'](function(){return BPromise['each'](_0xa33596,function(_0x2b7c19){return db['UserOpenchannelQueue'][_0x8f7c('0x5b')]({'where':{'UserId':_0x2b7c19['id'],'OpenchannelQueueId':_0xf6682e['params']['id']},'transaction':_0x16dd7f});});})[_0x8f7c('0x17')](function(){_0xa33596['forEach'](function(_0x59bdcf){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x59bdcf['id'],'OpenchannelQueueId':_0x1837e0['id']});});});});});}})[_0x8f7c('0x17')](respondWithStatusCode(_0x148bbb,null))[_0x8f7c('0x2a')](handleError(_0x148bbb,null));};exports[_0x8f7c('0x5c')]=function(_0x1c80a8,_0x1c7306){return db[_0x8f7c('0x53')]['findAll']({'where':{'id':_0x1c80a8[_0x8f7c('0x2d')][_0x8f7c('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8f7c('0x5d'),'attributes':['id'],'raw':!![]}]})[_0x8f7c('0x17')](handleEntityNotFound(_0x1c7306,null))[_0x8f7c('0x17')](function(_0x80372f){var _0x5e04c9=_[_0x8f7c('0x21')](_0x80372f,'id');var _0x2153c5=[];var _0x5edad2=[];var _0x23e6bf=squel[_0x8f7c('0x5e')]();_0x23e6bf['field'](_0x8f7c('0x5f'))[_0x8f7c('0x60')]('team_has_openchannel_queues','tq')['join'](_0x8f7c('0x61'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8f7c('0x62'),_0x1c80a8[_0x8f7c('0x2c')]['id']);for(var _0x4348ab=0x0;_0x4348ab<_0x80372f['length'];_0x4348ab+=0x1){let _0x4750c7=_0x80372f[_0x4348ab];for(var _0x319043=0x0;_0x319043<_0x4750c7[_0x8f7c('0x5d')][_0x8f7c('0x34')];_0x319043+=0x1){let _0x1ad50f=_0x4750c7['Agents'][_0x319043];var _0x3bf266=_0x23e6bf[_0x8f7c('0x63')]();_0x3bf266[_0x8f7c('0x47')](_0x8f7c('0x64'),_0x1ad50f['id']);_0x5edad2[_0x8f7c('0x65')](db[_0x8f7c('0x66')]['query'](_0x3bf266['toString'](),{'type':db['sequelize'][_0x8f7c('0x67')][_0x8f7c('0x68')]})[_0x8f7c('0x17')](function(_0x288bf2){if(_0x288bf2[_0x8f7c('0x34')]===0x1){return _0x1ad50f['id'];}else{var _0x54fb6a=_[_0x8f7c('0x69')](_[_0x8f7c('0x21')](_0x288bf2,_0x8f7c('0x6a')),function(_0x12d029){return _[_0x8f7c('0x6b')](_0x5e04c9,_0x12d029);});if(_0x54fb6a){return _0x1ad50f['id'];}}}));}}return BPromise[_0x8f7c('0x6c')](_0x5edad2)[_0x8f7c('0x17')](function(_0x3bfda8){_0x2153c5=_(_0x2153c5)[_0x8f7c('0x6d')](_0x3bfda8)['compact']()[_0x8f7c('0x6e')]();return db[_0x8f7c('0x22')][_0x8f7c('0x38')]({'where':{'id':_0x1c80a8['params']['id']}})['then'](function(_0x34e69c){return db['sequelize'][_0x8f7c('0x5a')](function(_0x52ac01){return _0x34e69c[_0x8f7c('0x5c')](_0x1c80a8['query'][_0x8f7c('0x55')],{'transaction':_0x52ac01})[_0x8f7c('0x17')](function(){if(!_[_0x8f7c('0x6f')](_0x2153c5)){return _0x34e69c[_0x8f7c('0x70')](_0x2153c5,{'transaction':_0x52ac01});}})[_0x8f7c('0x17')](function(){_0x2153c5['forEach'](function(_0x38db98){socket[_0x8f7c('0x71')]('userOpenchannelQueue:remove',{'UserId':_0x38db98,'OpenchannelQueueId':_0x34e69c['id']});});});});});});})[_0x8f7c('0x17')](respondWithStatusCode(_0x1c7306,null))[_0x8f7c('0x2a')](handleError(_0x1c7306,null));};exports[_0x8f7c('0x72')]=function(_0x272c08,_0x4f2f08){return db[_0x8f7c('0x22')][_0x8f7c('0x38')]({'where':{'id':_0x272c08[_0x8f7c('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4f2f08,null))[_0x8f7c('0x17')](function(_0x5b2098){if(_0x5b2098){return _0x5b2098[_0x8f7c('0x72')](_0x272c08[_0x8f7c('0x3a')]['ids'],_['omit'](_0x272c08[_0x8f7c('0x3a')],[_0x8f7c('0x55'),'id'])||{})[_0x8f7c('0x73')](function(_0x5a51c1){for(var _0x26576c=0x0;_0x26576c<_0x272c08[_0x8f7c('0x3a')][_0x8f7c('0x55')][_0x8f7c('0x34')];_0x26576c+=0x1){socket['emit'](_0x8f7c('0x74'),{'UserId':Number(_0x272c08[_0x8f7c('0x3a')]['ids'][_0x26576c]),'OpenchannelQueueId':Number(_0x272c08[_0x8f7c('0x2c')]['id'])});}return _0x5a51c1;});}})['then'](respondWithResult(_0x4f2f08,null))[_0x8f7c('0x2a')](handleError(_0x4f2f08,null));};exports[_0x8f7c('0x70')]=function(_0xdc0ef4,_0x2d56bb){return db[_0x8f7c('0x22')][_0x8f7c('0x38')]({'where':{'id':_0xdc0ef4[_0x8f7c('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2d56bb,null))[_0x8f7c('0x17')](function(_0x563d97){if(_0x563d97){return _0x563d97[_0x8f7c('0x70')](_0xdc0ef4['query'][_0x8f7c('0x55')])[_0x8f7c('0x17')](function(){if(_[_0x8f7c('0x75')](_0xdc0ef4[_0x8f7c('0x2d')]['ids'])){for(var _0x4934b4=0x0;_0x4934b4<_0xdc0ef4['query'][_0x8f7c('0x55')]['length'];_0x4934b4+=0x1){socket[_0x8f7c('0x71')](_0x8f7c('0x76'),{'UserId':Number(_0xdc0ef4[_0x8f7c('0x2d')][_0x8f7c('0x55')][_0x4934b4]),'OpenchannelQueueId':Number(_0xdc0ef4[_0x8f7c('0x2c')]['id'])});}}else{socket['emit'](_0x8f7c('0x76'),{'UserId':Number(_0xdc0ef4[_0x8f7c('0x2d')]['ids']),'OpenchannelQueueId':Number(_0xdc0ef4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2d56bb,null))['catch'](handleError(_0x2d56bb,null));};exports[_0x8f7c('0x77')]=function(_0x2574f8,_0x272a18){var _0x40990d={};var _0x108052={};var _0x2b1200;var _0x1b3f30;return db['OpenchannelQueue'][_0x8f7c('0x42')]({'where':{'id':_0x2574f8['params']['id']}})[_0x8f7c('0x17')](handleEntityNotFound(_0x272a18,null))[_0x8f7c('0x17')](function(_0x4afb30){if(_0x4afb30){_0x2b1200=_0x4afb30;_0x108052[_0x8f7c('0x31')]=_[_0x8f7c('0x2e')](db['User']['rawAttributes']);_0x108052['query']=_['keys'](_0x2574f8[_0x8f7c('0x2d')]);_0x108052[_0x8f7c('0x2f')]=_[_0x8f7c('0x30')](_0x108052[_0x8f7c('0x31')],_0x108052[_0x8f7c('0x2d')]);_0x40990d[_0x8f7c('0x32')]=_['intersection'](_0x108052['model'],qs['fields'](_0x2574f8[_0x8f7c('0x2d')][_0x8f7c('0x33')]));_0x40990d[_0x8f7c('0x32')]=_0x40990d[_0x8f7c('0x32')][_0x8f7c('0x34')]?_0x40990d['attributes']:_0x108052[_0x8f7c('0x31')];_0x40990d[_0x8f7c('0x54')]=qs['sort'](_0x2574f8[_0x8f7c('0x2d')][_0x8f7c('0x46')]);_0x40990d['where']=qs[_0x8f7c('0x2f')](_['pick'](_0x2574f8[_0x8f7c('0x2d')],_0x108052[_0x8f7c('0x2f')]));if(_0x2574f8[_0x8f7c('0x2d')][_0x8f7c('0x4a')]){_0x40990d['where']=_[_0x8f7c('0x36')](_0x40990d[_0x8f7c('0x47')],{'$or':_['map'](_0x40990d[_0x8f7c('0x32')],function(_0x7fc53c){var _0x189955={};_0x189955[_0x7fc53c]={'$like':'%'+_0x2574f8['query']['filter']+'%'};return _0x189955;})});}_0x40990d=_['merge']({},_0x40990d,_0x2574f8[_0x8f7c('0x37')]);return _0x2b1200[_0x8f7c('0x77')](_0x40990d);}})['then'](function(_0x36ed45){if(_0x36ed45){_0x1b3f30=_0x36ed45[_0x8f7c('0x34')];if(!_0x2574f8[_0x8f7c('0x2d')]['hasOwnProperty'](_0x8f7c('0x45'))){_0x40990d[_0x8f7c('0x12')]=qs[_0x8f7c('0x12')](_0x2574f8[_0x8f7c('0x2d')][_0x8f7c('0x12')]);_0x40990d[_0x8f7c('0x10')]=qs['offset'](_0x2574f8[_0x8f7c('0x2d')][_0x8f7c('0x10')]);}return _0x2b1200[_0x8f7c('0x77')](_0x40990d);}})['then'](function(_0x3d9e17){if(_0x3d9e17){return _0x3d9e17?{'count':_0x1b3f30,'rows':_0x3d9e17}:null;}})[_0x8f7c('0x17')](respondWithResult(_0x272a18,null))['catch'](handleError(_0x272a18,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index a2615b8..b42fced 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 _0x29aa=['setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb','OpenchannelQueue'];(function(_0xca2035,_0x45c2a9){var _0x59bc26=function(_0x373095){while(--_0x373095){_0xca2035['push'](_0xca2035['shift']());}};_0x59bc26(++_0x45c2a9);}(_0x29aa,0xd5));var _0xa29a=function(_0x5cb1cd,_0x1465d0){_0x5cb1cd=_0x5cb1cd-0x0;var _0x40a91b=_0x29aa[_0x5cb1cd];return _0x40a91b;};'use strict';var EventEmitter=require(_0xa29a('0x0'));var OpenchannelQueue=require(_0xa29a('0x1'))['db'][_0xa29a('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa29a('0x3')](0x0);var events={'afterCreate':_0xa29a('0x4'),'afterUpdate':_0xa29a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50ad07){return function(_0x4b8213,_0x53c3ce,_0x5b2a2a){OpenchannelQueueEvents[_0xa29a('0x6')](_0x50ad07+':'+_0x4b8213['id'],_0x4b8213);OpenchannelQueueEvents[_0xa29a('0x6')](_0x50ad07,_0x4b8213);_0x5b2a2a(null);};}for(var e in events){if(events[_0xa29a('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x11d4=['emit','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove'];(function(_0x30ab77,_0x21bfa4){var _0x392650=function(_0x24ea18){while(--_0x24ea18){_0x30ab77['push'](_0x30ab77['shift']());}};_0x392650(++_0x21bfa4);}(_0x11d4,0x1aa));var _0x411d=function(_0x36cbd,_0x339fb2){_0x36cbd=_0x36cbd-0x0;var _0x38082a=_0x11d4[_0x36cbd];return _0x38082a;};'use strict';var EventEmitter=require(_0x411d('0x0'));var OpenchannelQueue=require(_0x411d('0x1'))['db'][_0x411d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x411d('0x3')](0x0);var events={'afterCreate':_0x411d('0x4'),'afterUpdate':'update','afterDestroy':_0x411d('0x5')};function emitEvent(_0x2ed0f4){return function(_0xa1c4c1,_0xa305ed,_0x3ece31){OpenchannelQueueEvents[_0x411d('0x6')](_0x2ed0f4+':'+_0xa1c4c1['id'],_0xa1c4c1);OpenchannelQueueEvents[_0x411d('0x6')](_0x2ed0f4,_0xa1c4c1);_0x3ece31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x411d('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index cc2b3b7..6282831 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 _0xa587=['rimraf','./openchannelQueue.attributes','OpenchannelQueue','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x24547b,_0x238bca){var _0x4840f4=function(_0x4e036b){while(--_0x4e036b){_0x24547b['push'](_0x24547b['shift']());}};_0x4840f4(++_0x238bca);}(_0xa587,0xc0));var _0x7a58=function(_0x2d411a,_0x451f24){_0x2d411a=_0x2d411a-0x0;var _0x13b725=_0xa587[_0x2d411a];return _0x13b725;};'use strict';var _=require('lodash');var util=require(_0x7a58('0x0'));var logger=require(_0x7a58('0x1'))(_0x7a58('0x2'));var moment=require('moment');var BPromise=require(_0x7a58('0x3'));var rp=require(_0x7a58('0x4'));var fs=require('fs');var path=require(_0x7a58('0x5'));var rimraf=require(_0x7a58('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a58('0x7'));module['exports']=function(_0x355fa0,_0x5b84cd){return _0x355fa0['define'](_0x7a58('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1275=['openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','OpenchannelQueue'];(function(_0x4f9abb,_0x108e0f){var _0x4ba87b=function(_0x369724){while(--_0x369724){_0x4f9abb['push'](_0x4f9abb['shift']());}};_0x4ba87b(++_0x108e0f);}(_0x1275,0xde));var _0x5127=function(_0x54c837,_0x371468){_0x54c837=_0x54c837-0x0;var _0x22fb45=_0x1275[_0x54c837];return _0x22fb45;};'use strict';var _=require(_0x5127('0x0'));var util=require(_0x5127('0x1'));var logger=require(_0x5127('0x2'))(_0x5127('0x3'));var moment=require(_0x5127('0x4'));var BPromise=require(_0x5127('0x5'));var rp=require(_0x5127('0x6'));var fs=require('fs');var path=require(_0x5127('0x7'));var rimraf=require(_0x5127('0x8'));var config=require(_0x5127('0x9'));var attributes=require(_0x5127('0xa'));module['exports']=function(_0x3dfef3,_0x5b3529){return _0x3dfef3['define'](_0x5127('0xb'),attributes,{'tableName':_0x5127('0xc'),'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 4966b21..b46f932 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 _0x4d6f=['ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model'];(function(_0x57b9c6,_0x1173fb){var _0x35da3d=function(_0x11ccc5){while(--_0x11ccc5){_0x57b9c6['push'](_0x57b9c6['shift']());}};_0x35da3d(++_0x1173fb);}(_0x4d6f,0xa2));var _0xf4d6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4d6f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf4d6('0x0'));var util=require(_0xf4d6('0x1'));var moment=require('moment');var BPromise=require(_0xf4d6('0x2'));var rs=require(_0xf4d6('0x3'));var fs=require('fs');var Redis=require(_0xf4d6('0x4'));var db=require(_0xf4d6('0x5'))['db'];var utils=require(_0xf4d6('0x6'));var logger=require(_0xf4d6('0x7'))(_0xf4d6('0x8'));var config=require('../../config/environment');var jayson=require(_0xf4d6('0x9'));var client=jayson['client'][_0xf4d6('0xa')]({'port':0x232a});config[_0xf4d6('0xb')]=_[_0xf4d6('0xc')](config[_0xf4d6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf4d6('0xd'))(new Redis(config[_0xf4d6('0xb')]));require(_0xf4d6('0xe'))[_0xf4d6('0xf')](socket);function respondWithRpcPromise(_0x3d6855,_0x4e6931,_0x3bbcad){return new BPromise(function(_0x2b7aab,_0x25bacf){return client[_0xf4d6('0x10')](_0x3d6855,_0x3bbcad)[_0xf4d6('0x11')](function(_0x3c5dd9){logger[_0xf4d6('0x12')](_0xf4d6('0x13'),_0x4e6931,'request\x20sent');logger[_0xf4d6('0x14')](_0xf4d6('0x15'),_0x4e6931,_0xf4d6('0x16'),JSON[_0xf4d6('0x17')](_0x3c5dd9));if(_0x3c5dd9[_0xf4d6('0x18')]){if(_0x3c5dd9[_0xf4d6('0x18')]['code']===0x1f4){logger[_0xf4d6('0x18')](_0xf4d6('0x13'),_0x4e6931,_0x3c5dd9[_0xf4d6('0x18')]['message']);return _0x25bacf(_0x3c5dd9[_0xf4d6('0x18')]['message']);}logger[_0xf4d6('0x18')](_0xf4d6('0x13'),_0x4e6931,_0x3c5dd9['error'][_0xf4d6('0x19')]);return _0x2b7aab(_0x3c5dd9['error'][_0xf4d6('0x19')]);}else{logger[_0xf4d6('0x12')](_0xf4d6('0x13'),_0x4e6931,_0xf4d6('0x16'));_0x2b7aab(_0x3c5dd9[_0xf4d6('0x1a')][_0xf4d6('0x19')]);}})[_0xf4d6('0x1b')](function(_0x3be9e2){logger['error'](_0xf4d6('0x13'),_0x4e6931,_0x3be9e2);_0x25bacf(_0x3be9e2);});});}exports[_0xf4d6('0x1c')]=function(_0x5d9408){var _0x45df5f=this;return new Promise(function(_0x52108d,_0x3d9718){return db[_0xf4d6('0x1d')][_0xf4d6('0x1e')]({'raw':_0x5d9408[_0xf4d6('0x1f')]?_0x5d9408['options'][_0xf4d6('0x20')]===undefined?!![]:![]:!![],'where':_0x5d9408['options']?_0x5d9408[_0xf4d6('0x1f')][_0xf4d6('0x21')]||null:null,'attributes':_0x5d9408[_0xf4d6('0x1f')]?_0x5d9408['options'][_0xf4d6('0x22')]||null:null,'limit':_0x5d9408['options']?_0x5d9408['options']['limit']||null:null,'include':_0x5d9408[_0xf4d6('0x1f')]?_0x5d9408[_0xf4d6('0x1f')][_0xf4d6('0x23')]?_[_0xf4d6('0x24')](_0x5d9408[_0xf4d6('0x1f')][_0xf4d6('0x23')],function(_0x171b73){return{'model':db[_0x171b73['model']],'as':_0x171b73['as'],'attributes':_0x171b73[_0xf4d6('0x22')],'include':_0x171b73[_0xf4d6('0x23')]?_['map'](_0x171b73[_0xf4d6('0x23')],function(_0x28a9fb){return{'model':db[_0x28a9fb[_0xf4d6('0x25')]],'as':_0x28a9fb['as'],'attributes':_0x28a9fb[_0xf4d6('0x22')],'include':_0x28a9fb[_0xf4d6('0x23')]?_[_0xf4d6('0x24')](_0x28a9fb[_0xf4d6('0x23')],function(_0x4da671){return{'model':db[_0x4da671['model']],'as':_0x4da671['as'],'attributes':_0x4da671[_0xf4d6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf4d6('0x11')](function(_0x548d90){logger['info'](_0xf4d6('0x1c'),_0x5d9408);logger[_0xf4d6('0x14')](_0xf4d6('0x1c'),_0x5d9408,JSON['stringify'](_0x548d90));_0x52108d(_0x548d90);})[_0xf4d6('0x1b')](function(_0x2bce5e){logger[_0xf4d6('0x18')](_0xf4d6('0x1c'),_0x2bce5e['message'],_0x5d9408);_0x3d9718(_0x45df5f['error'](0x1f4,_0x2bce5e[_0xf4d6('0x19')]));});});};exports[_0xf4d6('0x26')]=function(_0x101fbd){var _0x314524=this;return new Promise(function(_0x257136,_0x2d0d61){return db[_0xf4d6('0x1d')][_0xf4d6('0x27')]({'raw':_0x101fbd['options']?_0x101fbd['options'][_0xf4d6('0x20')]===undefined?!![]:![]:!![],'where':_0x101fbd[_0xf4d6('0x1f')]?_0x101fbd[_0xf4d6('0x1f')][_0xf4d6('0x21')]||null:null,'attributes':_0x101fbd[_0xf4d6('0x1f')]?_0x101fbd['options'][_0xf4d6('0x22')]||null:null,'include':_0x101fbd[_0xf4d6('0x1f')]?_0x101fbd[_0xf4d6('0x1f')][_0xf4d6('0x23')]?_[_0xf4d6('0x24')](_0x101fbd['options'][_0xf4d6('0x23')],function(_0x442997){return{'model':db[_0x442997[_0xf4d6('0x25')]],'as':_0x442997['as'],'attributes':_0x442997[_0xf4d6('0x22')],'include':_0x442997[_0xf4d6('0x23')]?_[_0xf4d6('0x24')](_0x442997[_0xf4d6('0x23')],function(_0x39d3ae){return{'model':db[_0x39d3ae['model']],'as':_0x39d3ae['as'],'attributes':_0x39d3ae[_0xf4d6('0x22')],'include':_0x39d3ae[_0xf4d6('0x23')]?_[_0xf4d6('0x24')](_0x39d3ae['include'],function(_0x137270){return{'model':db[_0x137270['model']],'as':_0x137270['as'],'attributes':_0x137270[_0xf4d6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf4d6('0x11')](function(_0x7dd77f){logger['info']('ShowOpenchannelQueue',_0x101fbd);logger[_0xf4d6('0x14')]('ShowOpenchannelQueue',_0x101fbd,JSON[_0xf4d6('0x17')](_0x7dd77f));_0x257136(_0x7dd77f);})[_0xf4d6('0x1b')](function(_0x28af08){logger['error'](_0xf4d6('0x26'),_0x28af08[_0xf4d6('0x19')],_0x101fbd);_0x2d0d61(_0x314524[_0xf4d6('0x18')](0x1f4,_0x28af08[_0xf4d6('0x19')]));});});}; \ No newline at end of file +var _0x4a4d=['error','OpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','raw','options','where','attributes','include','map','model','debug','stringify','ShowOpenchannelQueue','find','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x22a8eb,_0x225ebe){var _0x15b30d=function(_0x5327f1){while(--_0x5327f1){_0x22a8eb['push'](_0x22a8eb['shift']());}};_0x15b30d(++_0x225ebe);}(_0x4a4d,0x1cf));var _0xd4a4=function(_0x21c1f2,_0x2cb2a4){_0x21c1f2=_0x21c1f2-0x0;var _0x4dace6=_0x4a4d[_0x21c1f2];return _0x4dace6;};'use strict';var _=require('lodash');var util=require(_0xd4a4('0x0'));var moment=require(_0xd4a4('0x1'));var BPromise=require(_0xd4a4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd4a4('0x3'));var logger=require(_0xd4a4('0x4'))(_0xd4a4('0x5'));var config=require(_0xd4a4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd4a4('0x7')][_0xd4a4('0x8')]({'port':0x232a});config[_0xd4a4('0x9')]=_[_0xd4a4('0xa')](config[_0xd4a4('0x9')],{'host':_0xd4a4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd4a4('0xc'))[_0xd4a4('0xd')](socket);function respondWithRpcPromise(_0x4c89ab,_0x30ee58,_0x535327){return new BPromise(function(_0x162137,_0x1b56fa){return client[_0xd4a4('0xe')](_0x4c89ab,_0x535327)[_0xd4a4('0xf')](function(_0x1f07a1){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x30ee58,_0xd4a4('0x10'));logger['debug'](_0xd4a4('0x11'),_0x30ee58,_0xd4a4('0x10'),JSON['stringify'](_0x1f07a1));if(_0x1f07a1[_0xd4a4('0x12')]){if(_0x1f07a1['error']['code']===0x1f4){logger[_0xd4a4('0x12')](_0xd4a4('0x13'),_0x30ee58,_0x1f07a1['error'][_0xd4a4('0x14')]);return _0x1b56fa(_0x1f07a1[_0xd4a4('0x12')][_0xd4a4('0x14')]);}logger['error'](_0xd4a4('0x13'),_0x30ee58,_0x1f07a1['error'][_0xd4a4('0x14')]);return _0x162137(_0x1f07a1[_0xd4a4('0x12')]['message']);}else{logger[_0xd4a4('0x15')](_0xd4a4('0x13'),_0x30ee58,_0xd4a4('0x10'));_0x162137(_0x1f07a1[_0xd4a4('0x16')]['message']);}})[_0xd4a4('0x17')](function(_0x46e0ea){logger[_0xd4a4('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x30ee58,_0x46e0ea);_0x1b56fa(_0x46e0ea);});});}exports[_0xd4a4('0x18')]=function(_0x273aeb){var _0x396c9e=this;return new Promise(function(_0x2e29cb,_0x4d2a80){return db[_0xd4a4('0x19')]['findAll']({'raw':_0x273aeb['options']?_0x273aeb['options'][_0xd4a4('0x1a')]===undefined?!![]:![]:!![],'where':_0x273aeb[_0xd4a4('0x1b')]?_0x273aeb['options'][_0xd4a4('0x1c')]||null:null,'attributes':_0x273aeb[_0xd4a4('0x1b')]?_0x273aeb[_0xd4a4('0x1b')][_0xd4a4('0x1d')]||null:null,'limit':_0x273aeb[_0xd4a4('0x1b')]?_0x273aeb['options']['limit']||null:null,'include':_0x273aeb['options']?_0x273aeb[_0xd4a4('0x1b')][_0xd4a4('0x1e')]?_['map'](_0x273aeb[_0xd4a4('0x1b')][_0xd4a4('0x1e')],function(_0x5b1ef7){return{'model':db[_0x5b1ef7['model']],'as':_0x5b1ef7['as'],'attributes':_0x5b1ef7[_0xd4a4('0x1d')],'include':_0x5b1ef7[_0xd4a4('0x1e')]?_[_0xd4a4('0x1f')](_0x5b1ef7[_0xd4a4('0x1e')],function(_0x5e7152){return{'model':db[_0x5e7152[_0xd4a4('0x20')]],'as':_0x5e7152['as'],'attributes':_0x5e7152['attributes'],'include':_0x5e7152[_0xd4a4('0x1e')]?_[_0xd4a4('0x1f')](_0x5e7152['include'],function(_0x377454){return{'model':db[_0x377454[_0xd4a4('0x20')]],'as':_0x377454['as'],'attributes':_0x377454['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4a4('0xf')](function(_0x112913){logger[_0xd4a4('0x15')]('GetOpenchannelQueue',_0x273aeb);logger[_0xd4a4('0x21')](_0xd4a4('0x18'),_0x273aeb,JSON[_0xd4a4('0x22')](_0x112913));_0x2e29cb(_0x112913);})[_0xd4a4('0x17')](function(_0x27a18d){logger[_0xd4a4('0x12')](_0xd4a4('0x18'),_0x27a18d['message'],_0x273aeb);_0x4d2a80(_0x396c9e[_0xd4a4('0x12')](0x1f4,_0x27a18d[_0xd4a4('0x14')]));});});};exports[_0xd4a4('0x23')]=function(_0x15cb69){var _0x306c50=this;return new Promise(function(_0x1fffb7,_0x3f2673){return db[_0xd4a4('0x19')][_0xd4a4('0x24')]({'raw':_0x15cb69[_0xd4a4('0x1b')]?_0x15cb69[_0xd4a4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x15cb69[_0xd4a4('0x1b')]?_0x15cb69['options'][_0xd4a4('0x1c')]||null:null,'attributes':_0x15cb69['options']?_0x15cb69[_0xd4a4('0x1b')]['attributes']||null:null,'include':_0x15cb69[_0xd4a4('0x1b')]?_0x15cb69[_0xd4a4('0x1b')][_0xd4a4('0x1e')]?_[_0xd4a4('0x1f')](_0x15cb69[_0xd4a4('0x1b')][_0xd4a4('0x1e')],function(_0x4252d6){return{'model':db[_0x4252d6['model']],'as':_0x4252d6['as'],'attributes':_0x4252d6['attributes'],'include':_0x4252d6[_0xd4a4('0x1e')]?_[_0xd4a4('0x1f')](_0x4252d6[_0xd4a4('0x1e')],function(_0xf9e9f6){return{'model':db[_0xf9e9f6[_0xd4a4('0x20')]],'as':_0xf9e9f6['as'],'attributes':_0xf9e9f6[_0xd4a4('0x1d')],'include':_0xf9e9f6[_0xd4a4('0x1e')]?_[_0xd4a4('0x1f')](_0xf9e9f6[_0xd4a4('0x1e')],function(_0x1a2290){return{'model':db[_0x1a2290[_0xd4a4('0x20')]],'as':_0x1a2290['as'],'attributes':_0x1a2290[_0xd4a4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd4a4('0xf')](function(_0x2a9c64){logger[_0xd4a4('0x15')](_0xd4a4('0x23'),_0x15cb69);logger[_0xd4a4('0x21')]('ShowOpenchannelQueue',_0x15cb69,JSON[_0xd4a4('0x22')](_0x2a9c64));_0x1fffb7(_0x2a9c64);})[_0xd4a4('0x17')](function(_0x432f92){logger[_0xd4a4('0x12')]('ShowOpenchannelQueue',_0x432f92[_0xd4a4('0x14')],_0x15cb69);_0x3f2673(_0x306c50['error'](0x1f4,_0x432f92[_0xd4a4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 20453d7..14b8364 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 _0xba25=['save','remove','update','removeListener','register','openchannelQueue:'];(function(_0x105674,_0x29ba7d){var _0x41ac1d=function(_0x1be499){while(--_0x1be499){_0x105674['push'](_0x105674['shift']());}};_0x41ac1d(++_0x29ba7d);}(_0xba25,0x78));var _0x5ba2=function(_0x58d7de,_0x4798b5){_0x58d7de=_0x58d7de-0x0;var _0x1f94c8=_0xba25[_0x58d7de];return _0x1f94c8;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x5ba2('0x0'),_0x5ba2('0x1'),_0x5ba2('0x2')];function createListener(_0x319510,_0x316278){return function(_0x433ac3){_0x316278['emit'](_0x319510,_0x433ac3);};}function removeListener(_0x204490,_0x3a9fd3){return function(){OpenchannelQueueEvents[_0x5ba2('0x3')](_0x204490,_0x3a9fd3);};}exports[_0x5ba2('0x4')]=function(_0xd23847){for(var _0x5d1b4a=0x0,_0x297a9d=events['length'];_0x5d1b4a<_0x297a9d;_0x5d1b4a++){var _0x485113=events[_0x5d1b4a];var _0x1644e9=createListener(_0x5ba2('0x5')+_0x485113,_0xd23847);OpenchannelQueueEvents['on'](_0x485113,_0x1644e9);}}; \ No newline at end of file +var _0x3848=['register','openchannelQueue:','remove','update','emit','removeListener'];(function(_0x1ef509,_0x31d8ef){var _0xca0544=function(_0xf4fda7){while(--_0xf4fda7){_0x1ef509['push'](_0x1ef509['shift']());}};_0xca0544(++_0x31d8ef);}(_0x3848,0x1be));var _0x8384=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x3848[_0x4c80d7];return _0x3c5095;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x8384('0x0'),_0x8384('0x1')];function createListener(_0x3ad5da,_0xe40290){return function(_0x498474){_0xe40290[_0x8384('0x2')](_0x3ad5da,_0x498474);};}function removeListener(_0x22963f,_0x272d95){return function(){OpenchannelQueueEvents[_0x8384('0x3')](_0x22963f,_0x272d95);};}exports[_0x8384('0x4')]=function(_0x3e4d50){for(var _0x11c3b4=0x0,_0x15cce0=events['length'];_0x11c3b4<_0x15cce0;_0x11c3b4++){var _0x40aea1=events[_0x11c3b4];var _0x4b0f60=createListener(_0x8384('0x5')+_0x40aea1,_0x3e4d50);OpenchannelQueueEvents['on'](_0x40aea1,_0x4b0f60);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 2f1f6db..c57b01b 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 _0x1206=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x1c1cf9,_0x526011){var _0x259095=function(_0x305d60){while(--_0x305d60){_0x1c1cf9['push'](_0x1c1cf9['shift']());}};_0x259095(++_0x526011);}(_0x1206,0x19f));var _0x6120=function(_0x294c42,_0xbd23ad){_0x294c42=_0x294c42-0x0;var _0x4c73d9=_0x1206[_0x294c42];return _0x4c73d9;};'use strict';var multer=require(_0x6120('0x0'));var util=require(_0x6120('0x1'));var path=require(_0x6120('0x2'));var timeout=require(_0x6120('0x3'));var express=require('express');var router=express[_0x6120('0x4')]();var fs_extra=require(_0x6120('0x5'));var auth=require(_0x6120('0x6'));var interaction=require(_0x6120('0x7'));var config=require(_0x6120('0x8'));var controller=require(_0x6120('0x9'));router['get']('/',auth[_0x6120('0xa')](),controller[_0x6120('0xb')]);router['get'](_0x6120('0xc'),auth[_0x6120('0xa')](),controller[_0x6120('0xd')]);router[_0x6120('0xe')](_0x6120('0xf'),auth[_0x6120('0xa')](),controller[_0x6120('0x10')]);router[_0x6120('0x11')]('/',auth[_0x6120('0xa')](),controller[_0x6120('0x12')]);router[_0x6120('0x13')](_0x6120('0xf'),auth['isAuthenticated'](),controller[_0x6120('0x14')]);router[_0x6120('0x15')](_0x6120('0xf'),auth['isAuthenticated'](),controller[_0x6120('0x16')]);module[_0x6120('0x17')]=router; \ No newline at end of file +var _0x46a1=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x1122b0,_0x3259ce){var _0x4dc9c9=function(_0x477a3e){while(--_0x477a3e){_0x1122b0['push'](_0x1122b0['shift']());}};_0x4dc9c9(++_0x3259ce);}(_0x46a1,0x17a));var _0x146a=function(_0x956d5b,_0x3376c1){_0x956d5b=_0x956d5b-0x0;var _0x2d1672=_0x46a1[_0x956d5b];return _0x2d1672;};'use strict';var multer=require('multer');var util=require(_0x146a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x146a('0x1'));var router=express[_0x146a('0x2')]();var fs_extra=require(_0x146a('0x3'));var auth=require(_0x146a('0x4'));var interaction=require(_0x146a('0x5'));var config=require(_0x146a('0x6'));var controller=require(_0x146a('0x7'));router[_0x146a('0x8')]('/',auth['isAuthenticated'](),controller[_0x146a('0x9')]);router[_0x146a('0x8')](_0x146a('0xa'),auth[_0x146a('0xb')](),controller[_0x146a('0xc')]);router['get'](_0x146a('0xd'),auth[_0x146a('0xb')](),controller[_0x146a('0xe')]);router[_0x146a('0xf')]('/',auth[_0x146a('0xb')](),controller[_0x146a('0x10')]);router[_0x146a('0x11')](_0x146a('0xd'),auth[_0x146a('0xb')](),controller[_0x146a('0x12')]);router[_0x146a('0x13')](_0x146a('0xd'),auth[_0x146a('0xb')](),controller['destroy']);module[_0x146a('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 67e3fb9..7fa6283 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 _0x35dc=['DATE','moment','exports','STRING'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x35dc,0x1cd));var _0xc35d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x35dc[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xc35d('0x0'));var Sequelize=require('sequelize');module[_0xc35d('0x1')]={'uniqueid':{'type':Sequelize[_0xc35d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc35d('0x3')]},'acceptAt':{'type':Sequelize[_0xc35d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfe51=['STRING','DATE','moment','sequelize','exports'];(function(_0x379c8d,_0x2e252f){var _0x4fa5ad=function(_0x17f20a){while(--_0x17f20a){_0x379c8d['push'](_0x379c8d['shift']());}};_0x4fa5ad(++_0x2e252f);}(_0xfe51,0x1ab));var _0x1fe5=function(_0x3721e8,_0x3619d4){_0x3721e8=_0x3721e8-0x0;var _0xf9336e=_0xfe51[_0x3721e8];return _0xf9336e;};'use strict';var moment=require(_0x1fe5('0x0'));var Sequelize=require(_0x1fe5('0x1'));module[_0x1fe5('0x2')]={'uniqueid':{'type':Sequelize[_0x1fe5('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1fe5('0x4')]},'leaveAt':{'type':Sequelize[_0x1fe5('0x4')]},'acceptAt':{'type':Sequelize[_0x1fe5('0x4')]},'exitAt':{'type':Sequelize[_0x1fe5('0x4')]},'reason':{'type':Sequelize[_0x1fe5('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b1e01d5..cd5dd42 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 _0x0a4f=['end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','show','find','create','body','catch','params','describe','rimraf','fast-json-patch','request-promise','moment','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x205c48,_0x4d0c4a){var _0x4d8d79=function(_0xf0b7fa){while(--_0xf0b7fa){_0x205c48['push'](_0x205c48['shift']());}};_0x4d8d79(++_0x4d0c4a);}(_0x0a4f,0x1a7));var _0xf0a4=function(_0x2dbb28,_0x345025){_0x2dbb28=_0x2dbb28-0x0;var _0x563d71=_0x0a4f[_0x2dbb28];return _0x563d71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0a4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0a4('0x1'));var rp=require(_0xf0a4('0x2'));var moment=require(_0xf0a4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0a4('0x4'));var util=require('util');var path=require(_0xf0a4('0x5'));var sox=require(_0xf0a4('0x6'));var csv=require('to-csv');var ejs=require(_0xf0a4('0x7'));var fs=require('fs');var fs_extra=require(_0xf0a4('0x8'));var _=require(_0xf0a4('0x9'));var squel=require('squel');var crypto=require(_0xf0a4('0xa'));var jsforce=require(_0xf0a4('0xb'));var deskjs=require(_0xf0a4('0xc'));var toCsv=require(_0xf0a4('0xd'));var querystring=require(_0xf0a4('0xe'));var Papa=require(_0xf0a4('0xf'));var Redis=require(_0xf0a4('0x10'));var authService=require(_0xf0a4('0x11'));var qs=require(_0xf0a4('0x12'));var as=require(_0xf0a4('0x13'));var hardwareService=require(_0xf0a4('0x14'));var logger=require(_0xf0a4('0x15'))(_0xf0a4('0x16'));var utils=require(_0xf0a4('0x17'));var config=require(_0xf0a4('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x489098,_0x5f2188){_0x5f2188=_0x5f2188||0xcc;return function(_0x10afe0){if(_0x10afe0){return _0x489098[_0xf0a4('0x19')](_0x5f2188);}return _0x489098[_0xf0a4('0x1a')](_0x5f2188)[_0xf0a4('0x1b')]();};}function respondWithResult(_0x53df94,_0x25dec2){_0x25dec2=_0x25dec2||0xc8;return function(_0x2eb426){if(_0x2eb426){return _0x53df94[_0xf0a4('0x1a')](_0x25dec2)['json'](_0x2eb426);}};}function respondWithFilteredResult(_0x5a27c5,_0x20f298){return function(_0x12fd6a){if(_0x12fd6a){var _0x320b19=typeof _0x20f298[_0xf0a4('0x1c')]===_0xf0a4('0x1d')&&typeof _0x20f298[_0xf0a4('0x1e')]===_0xf0a4('0x1d');var _0x954933=_0x12fd6a[_0xf0a4('0x1f')];var _0x37fe9f=_0x320b19?0x0:_0x20f298[_0xf0a4('0x1c')];var _0x52c2e4=_0x320b19?_0x12fd6a['count']:_0x20f298[_0xf0a4('0x1c')]+_0x20f298[_0xf0a4('0x1e')];var _0x218c9b;if(_0x52c2e4>=_0x954933){_0x52c2e4=_0x954933;_0x218c9b=0xc8;}else{_0x218c9b=0xce;}_0x5a27c5['status'](_0x218c9b);return _0x5a27c5[_0xf0a4('0x20')](_0xf0a4('0x21'),_0x37fe9f+'-'+_0x52c2e4+'/'+_0x954933)['json'](_0x12fd6a);}return null;};}function patchUpdates(_0x59bb67){return function(_0xf1da07){try{jsonpatch[_0xf0a4('0x22')](_0xf1da07,_0x59bb67,!![]);}catch(_0x146555){return BPromise[_0xf0a4('0x23')](_0x146555);}return _0xf1da07[_0xf0a4('0x24')]();};}function saveUpdates(_0x48befd,_0x1a81de){return function(_0x535b80){if(_0x535b80){return _0x535b80[_0xf0a4('0x25')](_0x48befd)[_0xf0a4('0x26')](function(_0x46cddd){return _0x46cddd;});}return null;};}function removeEntity(_0x3b155a,_0x19ff77){return function(_0x5177a8){if(_0x5177a8){return _0x5177a8[_0xf0a4('0x27')]()[_0xf0a4('0x26')](function(){_0x3b155a[_0xf0a4('0x1a')](0xcc)[_0xf0a4('0x1b')]();});}};}function handleEntityNotFound(_0x365473,_0x47e37a){return function(_0x4ec650){if(!_0x4ec650){_0x365473['sendStatus'](0x194);}return _0x4ec650;};}function handleError(_0x207941,_0x27f529){_0x27f529=_0x27f529||0x1f4;return function(_0x407fa7){logger[_0xf0a4('0x28')](_0x407fa7['stack']);if(_0x407fa7[_0xf0a4('0x29')]){delete _0x407fa7[_0xf0a4('0x29')];}_0x207941[_0xf0a4('0x1a')](_0x27f529)[_0xf0a4('0x2a')](_0x407fa7);};}exports[_0xf0a4('0x2b')]=function(_0x511b27,_0x4bc9ba){var _0x1c5325={},_0x4c84af={},_0x33b32b={'count':0x0,'rows':[]};var _0x280727=_[_0xf0a4('0x2c')](db['OpenchannelQueueReport'][_0xf0a4('0x2d')],function(_0x174193){return{'name':_0x174193[_0xf0a4('0x2e')],'type':_0x174193[_0xf0a4('0x2f')][_0xf0a4('0x30')]};});_0x4c84af[_0xf0a4('0x31')]=_['map'](_0x280727,_0xf0a4('0x29'));_0x4c84af[_0xf0a4('0x32')]=_[_0xf0a4('0x33')](_0x511b27['query']);_0x4c84af[_0xf0a4('0x34')]=_[_0xf0a4('0x35')](_0x4c84af[_0xf0a4('0x31')],_0x4c84af['query']);_0x1c5325[_0xf0a4('0x36')]=_[_0xf0a4('0x35')](_0x4c84af['model'],qs[_0xf0a4('0x37')](_0x511b27[_0xf0a4('0x32')][_0xf0a4('0x37')]));_0x1c5325[_0xf0a4('0x36')]=_0x1c5325[_0xf0a4('0x36')][_0xf0a4('0x38')]?_0x1c5325['attributes']:_0x4c84af[_0xf0a4('0x31')];if(!_0x511b27[_0xf0a4('0x32')][_0xf0a4('0x39')]('nolimit')){_0x1c5325[_0xf0a4('0x1e')]=qs['limit'](_0x511b27['query'][_0xf0a4('0x1e')]);_0x1c5325[_0xf0a4('0x1c')]=qs[_0xf0a4('0x1c')](_0x511b27[_0xf0a4('0x32')][_0xf0a4('0x1c')]);}_0x1c5325[_0xf0a4('0x3a')]=qs['sort'](_0x511b27[_0xf0a4('0x32')]['sort']);_0x1c5325[_0xf0a4('0x3b')]=qs[_0xf0a4('0x34')](_['pick'](_0x511b27[_0xf0a4('0x32')],_0x4c84af[_0xf0a4('0x34')]),_0x280727);if(_0x511b27[_0xf0a4('0x32')][_0xf0a4('0x3c')]){_0x1c5325[_0xf0a4('0x3b')]=_[_0xf0a4('0x3d')](_0x1c5325['where'],{'$or':_[_0xf0a4('0x2c')](_0x280727,function(_0x41554a){if(_0x41554a[_0xf0a4('0x2f')]!==_0xf0a4('0x3e')){var _0x371f53={};_0x371f53[_0x41554a[_0xf0a4('0x29')]]={'$like':'%'+_0x511b27[_0xf0a4('0x32')][_0xf0a4('0x3c')]+'%'};return _0x371f53;}})});}_0x1c5325=_[_0xf0a4('0x3d')]({},_0x1c5325,_0x511b27[_0xf0a4('0x3f')]);var _0x5f639e={'where':_0x1c5325[_0xf0a4('0x3b')]};return db[_0xf0a4('0x40')][_0xf0a4('0x1f')](_0x5f639e)[_0xf0a4('0x26')](function(_0x446f42){_0x33b32b[_0xf0a4('0x1f')]=_0x446f42;if(_0x511b27[_0xf0a4('0x32')][_0xf0a4('0x41')]){_0x1c5325[_0xf0a4('0x42')]=[{'all':!![]}];}return db[_0xf0a4('0x40')][_0xf0a4('0x43')](_0x1c5325);})[_0xf0a4('0x26')](function(_0x21b3b2){_0x33b32b['rows']=_0x21b3b2;return _0x33b32b;})[_0xf0a4('0x26')](respondWithFilteredResult(_0x4bc9ba,_0x1c5325))['catch'](handleError(_0x4bc9ba,null));};exports[_0xf0a4('0x44')]=function(_0x20f0d2,_0x59cfbc){var _0x17b03c={'raw':!![],'where':{'id':_0x20f0d2['params']['id']}},_0x58180d={};_0x58180d[_0xf0a4('0x31')]=_[_0xf0a4('0x33')](db[_0xf0a4('0x40')][_0xf0a4('0x2d')]);_0x58180d['query']=_[_0xf0a4('0x33')](_0x20f0d2['query']);_0x58180d[_0xf0a4('0x34')]=_[_0xf0a4('0x35')](_0x58180d['model'],_0x58180d[_0xf0a4('0x32')]);_0x17b03c[_0xf0a4('0x36')]=_[_0xf0a4('0x35')](_0x58180d[_0xf0a4('0x31')],qs[_0xf0a4('0x37')](_0x20f0d2[_0xf0a4('0x32')][_0xf0a4('0x37')]));_0x17b03c[_0xf0a4('0x36')]=_0x17b03c[_0xf0a4('0x36')]['length']?_0x17b03c['attributes']:_0x58180d['model'];if(_0x20f0d2[_0xf0a4('0x32')][_0xf0a4('0x41')]){_0x17b03c[_0xf0a4('0x42')]=[{'all':!![]}];}_0x17b03c=_[_0xf0a4('0x3d')]({},_0x17b03c,_0x20f0d2[_0xf0a4('0x3f')]);return db[_0xf0a4('0x40')][_0xf0a4('0x45')](_0x17b03c)[_0xf0a4('0x26')](handleEntityNotFound(_0x59cfbc,null))[_0xf0a4('0x26')](respondWithResult(_0x59cfbc,null))['catch'](handleError(_0x59cfbc,null));};exports['create']=function(_0x262254,_0x5998e2){return db[_0xf0a4('0x40')][_0xf0a4('0x46')](_0x262254[_0xf0a4('0x47')],{})['then'](respondWithResult(_0x5998e2,0xc9))[_0xf0a4('0x48')](handleError(_0x5998e2,null));};exports[_0xf0a4('0x25')]=function(_0x46c837,_0x308475){if(_0x46c837[_0xf0a4('0x47')]['id']){delete _0x46c837['body']['id'];}return db['OpenchannelQueueReport'][_0xf0a4('0x45')]({'where':{'id':_0x46c837[_0xf0a4('0x49')]['id']}})[_0xf0a4('0x26')](handleEntityNotFound(_0x308475,null))[_0xf0a4('0x26')](saveUpdates(_0x46c837['body'],null))[_0xf0a4('0x26')](respondWithResult(_0x308475,null))[_0xf0a4('0x48')](handleError(_0x308475,null));};exports[_0xf0a4('0x27')]=function(_0x42e017,_0x23a9c4){return db[_0xf0a4('0x40')]['find']({'where':{'id':_0x42e017['params']['id']}})[_0xf0a4('0x26')](handleEntityNotFound(_0x23a9c4,null))[_0xf0a4('0x26')](removeEntity(_0x23a9c4,null))[_0xf0a4('0x48')](handleError(_0x23a9c4,null));};exports[_0xf0a4('0x4a')]=function(_0x30ed0c,_0x5f50ad){return db[_0xf0a4('0x40')][_0xf0a4('0x4a')]()['then'](respondWithResult(_0x5f50ad,null))['catch'](handleError(_0x5f50ad,null));}; \ No newline at end of file +var _0xa2b0=['pick','filter','merge','VIRTUAL','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','where'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xa2b0,0x1ad));var _0x0a2b=function(_0x5f4ff6,_0x2a2b16){_0x5f4ff6=_0x5f4ff6-0x0;var _0x5ecc5b=_0xa2b0[_0x5f4ff6];return _0x5ecc5b;};'use strict';var emlformat=require(_0x0a2b('0x0'));var rimraf=require(_0x0a2b('0x1'));var zipdir=require(_0x0a2b('0x2'));var jsonpatch=require(_0x0a2b('0x3'));var rp=require(_0x0a2b('0x4'));var moment=require(_0x0a2b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0a2b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0a2b('0x7'));var fs=require('fs');var fs_extra=require(_0x0a2b('0x8'));var _=require(_0x0a2b('0x9'));var squel=require(_0x0a2b('0xa'));var crypto=require(_0x0a2b('0xb'));var jsforce=require(_0x0a2b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0a2b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0a2b('0xe'));var qs=require(_0x0a2b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a2b('0x10'));var logger=require(_0x0a2b('0x11'))('api');var utils=require(_0x0a2b('0x12'));var config=require(_0x0a2b('0x13'));var licenseUtil=require(_0x0a2b('0x14'));var db=require(_0x0a2b('0x15'))['db'];function respondWithStatusCode(_0x2d3dc2,_0x32b339){_0x32b339=_0x32b339||0xcc;return function(_0x43fa02){if(_0x43fa02){return _0x2d3dc2[_0x0a2b('0x16')](_0x32b339);}return _0x2d3dc2['status'](_0x32b339)['end']();};}function respondWithResult(_0x311a80,_0x3be86e){_0x3be86e=_0x3be86e||0xc8;return function(_0xadd911){if(_0xadd911){return _0x311a80[_0x0a2b('0x17')](_0x3be86e)['json'](_0xadd911);}};}function respondWithFilteredResult(_0x363285,_0x30d173){return function(_0x182492){if(_0x182492){var _0xee42b5=typeof _0x30d173[_0x0a2b('0x18')]==='undefined'&&typeof _0x30d173[_0x0a2b('0x19')]===_0x0a2b('0x1a');var _0x3aba9e=_0x182492['count'];var _0x4cfcf1=_0xee42b5?0x0:_0x30d173[_0x0a2b('0x18')];var _0xa782da=_0xee42b5?_0x182492[_0x0a2b('0x1b')]:_0x30d173[_0x0a2b('0x18')]+_0x30d173[_0x0a2b('0x19')];var _0x52b78f;if(_0xa782da>=_0x3aba9e){_0xa782da=_0x3aba9e;_0x52b78f=0xc8;}else{_0x52b78f=0xce;}_0x363285[_0x0a2b('0x17')](_0x52b78f);return _0x363285['set'](_0x0a2b('0x1c'),_0x4cfcf1+'-'+_0xa782da+'/'+_0x3aba9e)[_0x0a2b('0x1d')](_0x182492);}return null;};}function patchUpdates(_0x249134){return function(_0x4c27ea){try{jsonpatch[_0x0a2b('0x1e')](_0x4c27ea,_0x249134,!![]);}catch(_0x13b4c3){return BPromise['reject'](_0x13b4c3);}return _0x4c27ea[_0x0a2b('0x1f')]();};}function saveUpdates(_0x426556,_0x1b37f7){return function(_0xd99219){if(_0xd99219){return _0xd99219[_0x0a2b('0x20')](_0x426556)[_0x0a2b('0x21')](function(_0x5051c8){return _0x5051c8;});}return null;};}function removeEntity(_0xda0cf8,_0x1d50c3){return function(_0x3e1218){if(_0x3e1218){return _0x3e1218[_0x0a2b('0x22')]()[_0x0a2b('0x21')](function(){_0xda0cf8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42808f,_0x172ff2){return function(_0x328030){if(!_0x328030){_0x42808f[_0x0a2b('0x16')](0x194);}return _0x328030;};}function handleError(_0x46423e,_0x3f8ae6){_0x3f8ae6=_0x3f8ae6||0x1f4;return function(_0x118784){logger['error'](_0x118784['stack']);if(_0x118784[_0x0a2b('0x23')]){delete _0x118784['name'];}_0x46423e['status'](_0x3f8ae6)[_0x0a2b('0x24')](_0x118784);};}exports[_0x0a2b('0x25')]=function(_0xc20e2e,_0x43fc78){var _0x364437={},_0x46656b={},_0x545e55={'count':0x0,'rows':[]};var _0x156a1e=_[_0x0a2b('0x26')](db[_0x0a2b('0x27')]['rawAttributes'],function(_0x35f404){return{'name':_0x35f404[_0x0a2b('0x28')],'type':_0x35f404[_0x0a2b('0x29')][_0x0a2b('0x2a')]};});_0x46656b[_0x0a2b('0x2b')]=_[_0x0a2b('0x26')](_0x156a1e,'name');_0x46656b['query']=_[_0x0a2b('0x2c')](_0xc20e2e['query']);_0x46656b[_0x0a2b('0x2d')]=_[_0x0a2b('0x2e')](_0x46656b['model'],_0x46656b['query']);_0x364437[_0x0a2b('0x2f')]=_[_0x0a2b('0x2e')](_0x46656b[_0x0a2b('0x2b')],qs[_0x0a2b('0x30')](_0xc20e2e[_0x0a2b('0x31')][_0x0a2b('0x30')]));_0x364437[_0x0a2b('0x2f')]=_0x364437[_0x0a2b('0x2f')][_0x0a2b('0x32')]?_0x364437[_0x0a2b('0x2f')]:_0x46656b[_0x0a2b('0x2b')];if(!_0xc20e2e[_0x0a2b('0x31')]['hasOwnProperty']('nolimit')){_0x364437[_0x0a2b('0x19')]=qs[_0x0a2b('0x19')](_0xc20e2e[_0x0a2b('0x31')][_0x0a2b('0x19')]);_0x364437['offset']=qs[_0x0a2b('0x18')](_0xc20e2e[_0x0a2b('0x31')][_0x0a2b('0x18')]);}_0x364437[_0x0a2b('0x33')]=qs[_0x0a2b('0x34')](_0xc20e2e['query']['sort']);_0x364437[_0x0a2b('0x35')]=qs[_0x0a2b('0x2d')](_[_0x0a2b('0x36')](_0xc20e2e[_0x0a2b('0x31')],_0x46656b[_0x0a2b('0x2d')]),_0x156a1e);if(_0xc20e2e[_0x0a2b('0x31')][_0x0a2b('0x37')]){_0x364437['where']=_[_0x0a2b('0x38')](_0x364437[_0x0a2b('0x35')],{'$or':_['map'](_0x156a1e,function(_0x3b86ed){if(_0x3b86ed[_0x0a2b('0x29')]!==_0x0a2b('0x39')){var _0x286352={};_0x286352[_0x3b86ed[_0x0a2b('0x23')]]={'$like':'%'+_0xc20e2e[_0x0a2b('0x31')][_0x0a2b('0x37')]+'%'};return _0x286352;}})});}_0x364437=_[_0x0a2b('0x38')]({},_0x364437,_0xc20e2e['options']);var _0x51cd5f={'where':_0x364437[_0x0a2b('0x35')]};return db[_0x0a2b('0x27')]['count'](_0x51cd5f)[_0x0a2b('0x21')](function(_0x5aa245){_0x545e55['count']=_0x5aa245;if(_0xc20e2e[_0x0a2b('0x31')]['includeAll']){_0x364437['include']=[{'all':!![]}];}return db[_0x0a2b('0x27')]['findAll'](_0x364437);})['then'](function(_0xc90d31){_0x545e55[_0x0a2b('0x3a')]=_0xc90d31;return _0x545e55;})['then'](respondWithFilteredResult(_0x43fc78,_0x364437))[_0x0a2b('0x3b')](handleError(_0x43fc78,null));};exports[_0x0a2b('0x3c')]=function(_0xe63d59,_0x791d0){var _0x164964={'raw':!![],'where':{'id':_0xe63d59[_0x0a2b('0x3d')]['id']}},_0x5aa701={};_0x5aa701[_0x0a2b('0x2b')]=_[_0x0a2b('0x2c')](db[_0x0a2b('0x27')][_0x0a2b('0x3e')]);_0x5aa701[_0x0a2b('0x31')]=_['keys'](_0xe63d59[_0x0a2b('0x31')]);_0x5aa701[_0x0a2b('0x2d')]=_[_0x0a2b('0x2e')](_0x5aa701[_0x0a2b('0x2b')],_0x5aa701[_0x0a2b('0x31')]);_0x164964[_0x0a2b('0x2f')]=_[_0x0a2b('0x2e')](_0x5aa701['model'],qs['fields'](_0xe63d59[_0x0a2b('0x31')][_0x0a2b('0x30')]));_0x164964['attributes']=_0x164964[_0x0a2b('0x2f')]['length']?_0x164964[_0x0a2b('0x2f')]:_0x5aa701['model'];if(_0xe63d59[_0x0a2b('0x31')][_0x0a2b('0x3f')]){_0x164964[_0x0a2b('0x40')]=[{'all':!![]}];}_0x164964=_[_0x0a2b('0x38')]({},_0x164964,_0xe63d59['options']);return db['OpenchannelQueueReport'][_0x0a2b('0x41')](_0x164964)[_0x0a2b('0x21')](handleEntityNotFound(_0x791d0,null))[_0x0a2b('0x21')](respondWithResult(_0x791d0,null))[_0x0a2b('0x3b')](handleError(_0x791d0,null));};exports[_0x0a2b('0x42')]=function(_0x232d17,_0x459459){return db[_0x0a2b('0x27')][_0x0a2b('0x42')](_0x232d17[_0x0a2b('0x43')],{})['then'](respondWithResult(_0x459459,0xc9))[_0x0a2b('0x3b')](handleError(_0x459459,null));};exports[_0x0a2b('0x20')]=function(_0x2ee63f,_0x78aa5a){if(_0x2ee63f[_0x0a2b('0x43')]['id']){delete _0x2ee63f[_0x0a2b('0x43')]['id'];}return db[_0x0a2b('0x27')]['find']({'where':{'id':_0x2ee63f[_0x0a2b('0x3d')]['id']}})[_0x0a2b('0x21')](handleEntityNotFound(_0x78aa5a,null))[_0x0a2b('0x21')](saveUpdates(_0x2ee63f[_0x0a2b('0x43')],null))['then'](respondWithResult(_0x78aa5a,null))['catch'](handleError(_0x78aa5a,null));};exports[_0x0a2b('0x22')]=function(_0x215aa1,_0x1bc415){return db[_0x0a2b('0x27')][_0x0a2b('0x41')]({'where':{'id':_0x215aa1['params']['id']}})['then'](handleEntityNotFound(_0x1bc415,null))['then'](removeEntity(_0x1bc415,null))[_0x0a2b('0x3b')](handleError(_0x1bc415,null));};exports[_0x0a2b('0x44')]=function(_0x463513,_0x32a57e){return db['OpenchannelQueueReport'][_0x0a2b('0x44')]()[_0x0a2b('0x21')](respondWithResult(_0x32a57e,null))[_0x0a2b('0x3b')](handleError(_0x32a57e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ef42feb..3308a2a 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x441c11,_0x177dd8){var _0x3ea9da=function(_0x251e24){while(--_0x251e24){_0x441c11['push'](_0x441c11['shift']());}};_0x3ea9da(++_0x177dd8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x814b,0x1a2));var _0xb814=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x814b[_0x525af9];return _0x129fbf;};'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_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index e0987da..aeec14b 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 _0x6582=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueueReport','create','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x57394e,_0x2d24ee){var _0x7ef150=function(_0x48a3a8){while(--_0x48a3a8){_0x57394e['push'](_0x57394e['shift']());}};_0x7ef150(++_0x2d24ee);}(_0x6582,0x108));var _0x2658=function(_0x265f52,_0x2d59d1){_0x265f52=_0x265f52-0x0;var _0x108c85=_0x6582[_0x265f52];return _0x108c85;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});}exports['CreateOpenchannelQueueReport']=function(_0x4eb90d){var _0x57337e=this;return new Promise(function(_0xf4193a,_0x260fc7){return db[_0x2658('0x16')][_0x2658('0x17')](_0x4eb90d['body'],{'raw':_0x4eb90d[_0x2658('0x18')]?_0x4eb90d[_0x2658('0x18')][_0x2658('0x19')]===undefined?!![]:![]:!![]})[_0x2658('0xb')](function(_0x23cf70){logger[_0x2658('0xc')]('CreateOpenchannelQueueReport',_0x4eb90d);logger[_0x2658('0xf')]('CreateOpenchannelQueueReport',_0x4eb90d,JSON['stringify'](_0x23cf70));_0xf4193a(_0x23cf70);})[_0x2658('0x15')](function(_0x132000){logger['error'](_0x2658('0x1a'),_0x132000['message'],_0x4eb90d);_0x260fc7(_0x57337e[_0x2658('0x11')](0x1f4,_0x132000[_0x2658('0x13')]));});});};exports[_0x2658('0x1b')]=function(_0x2e6d6a){var _0x31231c=this;return new Promise(function(_0x2e80fc,_0xe9f81){return db[_0x2658('0x16')][_0x2658('0x1c')](_0x2e6d6a[_0x2658('0x1d')],{'raw':_0x2e6d6a['options']?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x1e')]||null:null,'attributes':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a['options'][_0x2658('0x1f')]||null:null,'limit':_0x2e6d6a[_0x2658('0x18')]?_0x2e6d6a[_0x2658('0x18')][_0x2658('0x20')]||null:null})[_0x2658('0xb')](function(_0x1492cb){logger[_0x2658('0xc')](_0x2658('0x1b'),_0x2e6d6a);logger[_0x2658('0xf')](_0x2658('0x1b'),_0x2e6d6a,JSON[_0x2658('0x21')](_0x1492cb));_0x2e80fc(_0x1492cb);})[_0x2658('0x15')](function(_0x291bb4){logger[_0x2658('0x11')](_0x2658('0x1b'),_0x291bb4[_0x2658('0x13')],_0x2e6d6a);_0xe9f81(_0x31231c[_0x2658('0x11')](0x1f4,_0x291bb4[_0x2658('0x13')]));});});}; \ No newline at end of file +var _0x26f9=['rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','options','CreateOpenchannelQueueReport','update','body','where','attributes','UpdateOpenchannelQueueReport','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x288fdf,_0x13b4c5){var _0x177996=function(_0xf00331){while(--_0xf00331){_0x288fdf['push'](_0x288fdf['shift']());}};_0x177996(++_0x13b4c5);}(_0x26f9,0x16f));var _0x926f=function(_0x55257d,_0x3998ec){_0x55257d=_0x55257d-0x0;var _0x4d296d=_0x26f9[_0x55257d];return _0x4d296d;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var moment=require('moment');var BPromise=require(_0x926f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x926f('0x3'))['db'];var utils=require(_0x926f('0x4'));var logger=require('../../config/logger')(_0x926f('0x5'));var config=require(_0x926f('0x6'));var jayson=require(_0x926f('0x7'));var client=jayson[_0x926f('0x8')][_0x926f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2ded,_0xf56fcb,_0x1e455d){return new BPromise(function(_0x41a7ed,_0x2af11e){return client['request'](_0x3d2ded,_0x1e455d)[_0x926f('0xa')](function(_0x593c13){logger[_0x926f('0xb')](_0x926f('0xc'),_0xf56fcb,'request\x20sent');logger[_0x926f('0xd')](_0x926f('0xe'),_0xf56fcb,_0x926f('0xf'),JSON[_0x926f('0x10')](_0x593c13));if(_0x593c13[_0x926f('0x11')]){if(_0x593c13['error'][_0x926f('0x12')]===0x1f4){logger[_0x926f('0x11')](_0x926f('0xc'),_0xf56fcb,_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);return _0x2af11e(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x593c13['error'][_0x926f('0x13')]);return _0x41a7ed(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}else{logger[_0x926f('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x926f('0xf'));_0x41a7ed(_0x593c13[_0x926f('0x14')]['message']);}})[_0x926f('0x15')](function(_0x52865b){logger[_0x926f('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x52865b);_0x2af11e(_0x52865b);});});}exports['CreateOpenchannelQueueReport']=function(_0x36ead3){var _0xab29b3=this;return new Promise(function(_0x4f25e3,_0x3ed07d){return db[_0x926f('0x16')][_0x926f('0x17')](_0x36ead3['body'],{'raw':_0x36ead3[_0x926f('0x18')]?_0x36ead3[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x926f('0xa')](function(_0x4241ac){logger['info'](_0x926f('0x19'),_0x36ead3);logger[_0x926f('0xd')](_0x926f('0x19'),_0x36ead3,JSON[_0x926f('0x10')](_0x4241ac));_0x4f25e3(_0x4241ac);})[_0x926f('0x15')](function(_0x3b7179){logger[_0x926f('0x11')](_0x926f('0x19'),_0x3b7179[_0x926f('0x13')],_0x36ead3);_0x3ed07d(_0xab29b3[_0x926f('0x11')](0x1f4,_0x3b7179[_0x926f('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2d76eb){var _0x151f71=this;return new Promise(function(_0x53f10c,_0x640fe0){return db[_0x926f('0x16')][_0x926f('0x1a')](_0x2d76eb[_0x926f('0x1b')],{'raw':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb['options'][_0x926f('0x1c')]||null:null,'attributes':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')][_0x926f('0x1d')]||null:null,'limit':_0x2d76eb['options']?_0x2d76eb[_0x926f('0x18')]['limit']||null:null})[_0x926f('0xa')](function(_0x2556ce){logger['info']('UpdateOpenchannelQueueReport',_0x2d76eb);logger[_0x926f('0xd')](_0x926f('0x1e'),_0x2d76eb,JSON['stringify'](_0x2556ce));_0x53f10c(_0x2556ce);})[_0x926f('0x15')](function(_0xb6b509){logger['error']('UpdateOpenchannelQueueReport',_0xb6b509[_0x926f('0x13')],_0x2d76eb);_0x640fe0(_0x151f71[_0x926f('0x11')](0x1f4,_0xb6b509[_0x926f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0c7ef19..3ae0e22 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 _0xaf11=['show','create','put','update','delete','/:id','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x40c99c,_0xce351d){var _0x1af760=function(_0x379ea3){while(--_0x379ea3){_0x40c99c['push'](_0x40c99c['shift']());}};_0x1af760(++_0xce351d);}(_0xaf11,0x67));var _0x1af1=function(_0x4b4bca,_0x2e6861){_0x4b4bca=_0x4b4bca-0x0;var _0x2063c0=_0xaf11[_0x4b4bca];return _0x2063c0;};'use strict';var multer=require(_0x1af1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1af1('0x1'));var router=express[_0x1af1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1af1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1af1('0x4'));var controller=require(_0x1af1('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x1af1('0x6')]);router[_0x1af1('0x7')](_0x1af1('0x8'),auth[_0x1af1('0x9')](),controller[_0x1af1('0xa')]);router[_0x1af1('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1af1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1af1('0xc')]);router[_0x1af1('0xd')]('/:id',auth[_0x1af1('0x9')](),controller[_0x1af1('0xe')]);router[_0x1af1('0xf')](_0x1af1('0x10'),auth['isAuthenticated'](),controller[_0x1af1('0x11')]);module[_0x1af1('0x12')]=router; \ No newline at end of file +var _0xa000=['../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x23f49a,_0xf5538e){var _0x3934e1=function(_0x48b1ae){while(--_0x48b1ae){_0x23f49a['push'](_0x23f49a['shift']());}};_0x3934e1(++_0xf5538e);}(_0xa000,0x14b));var _0x0a00=function(_0x35638f,_0xfaf9d9){_0x35638f=_0x35638f-0x0;var _0x666e37=_0xa000[_0x35638f];return _0x666e37;};'use strict';var multer=require(_0x0a00('0x0'));var util=require(_0x0a00('0x1'));var path=require(_0x0a00('0x2'));var timeout=require(_0x0a00('0x3'));var express=require(_0x0a00('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0a00('0x5'));var interaction=require(_0x0a00('0x6'));var config=require('../../config/environment');var controller=require(_0x0a00('0x7'));router[_0x0a00('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a00('0x9')]);router[_0x0a00('0x8')](_0x0a00('0xa'),auth[_0x0a00('0xb')](),controller[_0x0a00('0xc')]);router[_0x0a00('0x8')](_0x0a00('0xd'),auth[_0x0a00('0xb')](),controller[_0x0a00('0xe')]);router[_0x0a00('0xf')]('/',auth[_0x0a00('0xb')](),controller[_0x0a00('0x10')]);router[_0x0a00('0x11')](_0x0a00('0xd'),auth[_0x0a00('0xb')](),controller['update']);router[_0x0a00('0x12')](_0x0a00('0xd'),auth[_0x0a00('0xb')](),controller[_0x0a00('0x13')]);module[_0x0a00('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 56c3e78..af7d39e 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x26489a,_0x10290d){var _0x2c789c=function(_0xd0d405){while(--_0xd0d405){_0x26489a['push'](_0x26489a['shift']());}};_0x2c789c(++_0x10290d);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x2b73b9,_0x28364e){var _0x11463d=function(_0x3ccf29){while(--_0x3ccf29){_0x2b73b9['push'](_0x2b73b9['shift']());}};_0x11463d(++_0x28364e);}(_0xedd9,0xfc));var _0x9edd=function(_0x340e5f,_0x5b5642){_0x340e5f=_0x340e5f-0x0;var _0x40974c=_0xedd9[_0x340e5f];return _0x40974c;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index bd8a181..995d22b 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 _0xfbc1=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','then','end','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x1efdce,_0x10ed22){var _0x3e16df=function(_0x1b1bb3){while(--_0x1b1bb3){_0x1efdce['push'](_0x1efdce['shift']());}};_0x3e16df(++_0x10ed22);}(_0xfbc1,0x8f));var _0x1fbc=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0xfbc1[_0x2ca616];return _0x53155f;};'use strict';var emlformat=require(_0x1fbc('0x0'));var rimraf=require(_0x1fbc('0x1'));var zipdir=require(_0x1fbc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fbc('0x3'));var moment=require('moment');var BPromise=require(_0x1fbc('0x4'));var Mustache=require(_0x1fbc('0x5'));var util=require(_0x1fbc('0x6'));var path=require(_0x1fbc('0x7'));var sox=require(_0x1fbc('0x8'));var csv=require(_0x1fbc('0x9'));var ejs=require(_0x1fbc('0xa'));var fs=require('fs');var fs_extra=require(_0x1fbc('0xb'));var _=require(_0x1fbc('0xc'));var squel=require('squel');var crypto=require(_0x1fbc('0xd'));var jsforce=require(_0x1fbc('0xe'));var deskjs=require(_0x1fbc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1fbc('0x10'));var Papa=require('papaparse');var Redis=require(_0x1fbc('0x11'));var authService=require(_0x1fbc('0x12'));var qs=require(_0x1fbc('0x13'));var as=require(_0x1fbc('0x14'));var hardwareService=require(_0x1fbc('0x15'));var logger=require(_0x1fbc('0x16'))(_0x1fbc('0x17'));var utils=require('../../config/utils');var config=require(_0x1fbc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fbc('0x19'))['db'];function respondWithStatusCode(_0xcd2717,_0x3a935f){_0x3a935f=_0x3a935f||0xcc;return function(_0x424089){if(_0x424089){return _0xcd2717[_0x1fbc('0x1a')](_0x3a935f);}return _0xcd2717[_0x1fbc('0x1b')](_0x3a935f)['end']();};}function respondWithResult(_0x2e32dc,_0x3b4b8b){_0x3b4b8b=_0x3b4b8b||0xc8;return function(_0x44d923){if(_0x44d923){return _0x2e32dc[_0x1fbc('0x1b')](_0x3b4b8b)[_0x1fbc('0x1c')](_0x44d923);}};}function respondWithFilteredResult(_0x460adc,_0x2892d5){return function(_0x3fe557){if(_0x3fe557){var _0xab7b2b=typeof _0x2892d5[_0x1fbc('0x1d')]==='undefined'&&typeof _0x2892d5['limit']===_0x1fbc('0x1e');var _0x11333b=_0x3fe557[_0x1fbc('0x1f')];var _0x32989c=_0xab7b2b?0x0:_0x2892d5[_0x1fbc('0x1d')];var _0xd35be0=_0xab7b2b?_0x3fe557[_0x1fbc('0x1f')]:_0x2892d5[_0x1fbc('0x1d')]+_0x2892d5[_0x1fbc('0x20')];var _0x58e7bb;if(_0xd35be0>=_0x11333b){_0xd35be0=_0x11333b;_0x58e7bb=0xc8;}else{_0x58e7bb=0xce;}_0x460adc[_0x1fbc('0x1b')](_0x58e7bb);return _0x460adc[_0x1fbc('0x21')]('Content-Range',_0x32989c+'-'+_0xd35be0+'/'+_0x11333b)[_0x1fbc('0x1c')](_0x3fe557);}return null;};}function patchUpdates(_0xc77f70){return function(_0x3ecd73){try{jsonpatch[_0x1fbc('0x22')](_0x3ecd73,_0xc77f70,!![]);}catch(_0x2e8f47){return BPromise[_0x1fbc('0x23')](_0x2e8f47);}return _0x3ecd73['save']();};}function saveUpdates(_0x2c7567,_0x2d483c){return function(_0x1d3915){if(_0x1d3915){return _0x1d3915['update'](_0x2c7567)[_0x1fbc('0x24')](function(_0x2e657f){return _0x2e657f;});}return null;};}function removeEntity(_0x5e83d6,_0x370a6f){return function(_0x479aca){if(_0x479aca){return _0x479aca['destroy']()['then'](function(){_0x5e83d6[_0x1fbc('0x1b')](0xcc)[_0x1fbc('0x25')]();});}};}function handleEntityNotFound(_0x1c0118,_0x464831){return function(_0x16405f){if(!_0x16405f){_0x1c0118[_0x1fbc('0x1a')](0x194);}return _0x16405f;};}function handleError(_0x1a9d25,_0x2bac3b){_0x2bac3b=_0x2bac3b||0x1f4;return function(_0x1940aa){logger[_0x1fbc('0x26')](_0x1940aa[_0x1fbc('0x27')]);if(_0x1940aa[_0x1fbc('0x28')]){delete _0x1940aa['name'];}_0x1a9d25['status'](_0x2bac3b)['send'](_0x1940aa);};}exports[_0x1fbc('0x29')]=function(_0x24abe7,_0x11cc1a){var _0x3ceb2f={},_0x29f5c9={},_0x1d179c={'count':0x0,'rows':[]};var _0x4d427f=_[_0x1fbc('0x2a')](db[_0x1fbc('0x2b')][_0x1fbc('0x2c')],function(_0x563f44){return{'name':_0x563f44[_0x1fbc('0x2d')],'type':_0x563f44[_0x1fbc('0x2e')]['key']};});_0x29f5c9[_0x1fbc('0x2f')]=_['map'](_0x4d427f,_0x1fbc('0x28'));_0x29f5c9[_0x1fbc('0x30')]=_[_0x1fbc('0x31')](_0x24abe7['query']);_0x29f5c9[_0x1fbc('0x32')]=_[_0x1fbc('0x33')](_0x29f5c9[_0x1fbc('0x2f')],_0x29f5c9[_0x1fbc('0x30')]);_0x3ceb2f[_0x1fbc('0x34')]=_[_0x1fbc('0x33')](_0x29f5c9[_0x1fbc('0x2f')],qs['fields'](_0x24abe7[_0x1fbc('0x30')][_0x1fbc('0x35')]));_0x3ceb2f[_0x1fbc('0x34')]=_0x3ceb2f[_0x1fbc('0x34')][_0x1fbc('0x36')]?_0x3ceb2f[_0x1fbc('0x34')]:_0x29f5c9[_0x1fbc('0x2f')];if(!_0x24abe7[_0x1fbc('0x30')][_0x1fbc('0x37')](_0x1fbc('0x38'))){_0x3ceb2f[_0x1fbc('0x20')]=qs[_0x1fbc('0x20')](_0x24abe7[_0x1fbc('0x30')]['limit']);_0x3ceb2f[_0x1fbc('0x1d')]=qs['offset'](_0x24abe7[_0x1fbc('0x30')]['offset']);}_0x3ceb2f['order']=qs[_0x1fbc('0x39')](_0x24abe7[_0x1fbc('0x30')]['sort']);_0x3ceb2f[_0x1fbc('0x3a')]=qs[_0x1fbc('0x32')](_['pick'](_0x24abe7[_0x1fbc('0x30')],_0x29f5c9['filters']),_0x4d427f);if(_0x24abe7[_0x1fbc('0x30')][_0x1fbc('0x3b')]){_0x3ceb2f[_0x1fbc('0x3a')]=_[_0x1fbc('0x3c')](_0x3ceb2f[_0x1fbc('0x3a')],{'$or':_['map'](_0x4d427f,function(_0x1c2590){if(_0x1c2590['type']!==_0x1fbc('0x3d')){var _0x4b6da9={};_0x4b6da9[_0x1c2590['name']]={'$like':'%'+_0x24abe7[_0x1fbc('0x30')][_0x1fbc('0x3b')]+'%'};return _0x4b6da9;}})});}_0x3ceb2f=_[_0x1fbc('0x3c')]({},_0x3ceb2f,_0x24abe7['options']);var _0x1a7bb3={'where':_0x3ceb2f[_0x1fbc('0x3a')]};return db[_0x1fbc('0x2b')]['count'](_0x1a7bb3)[_0x1fbc('0x24')](function(_0x5536ed){_0x1d179c['count']=_0x5536ed;if(_0x24abe7[_0x1fbc('0x30')][_0x1fbc('0x3e')]){_0x3ceb2f[_0x1fbc('0x3f')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x1fbc('0x40')](_0x3ceb2f);})[_0x1fbc('0x24')](function(_0x5ea57f){_0x1d179c[_0x1fbc('0x41')]=_0x5ea57f;return _0x1d179c;})[_0x1fbc('0x24')](respondWithFilteredResult(_0x11cc1a,_0x3ceb2f))[_0x1fbc('0x42')](handleError(_0x11cc1a,null));};exports[_0x1fbc('0x43')]=function(_0x542f4b,_0x43b2f9){var _0x3a876c={'raw':!![],'where':{'id':_0x542f4b[_0x1fbc('0x44')]['id']}},_0x1dda4d={};_0x1dda4d[_0x1fbc('0x2f')]=_['keys'](db[_0x1fbc('0x2b')][_0x1fbc('0x2c')]);_0x1dda4d[_0x1fbc('0x30')]=_['keys'](_0x542f4b['query']);_0x1dda4d[_0x1fbc('0x32')]=_['intersection'](_0x1dda4d[_0x1fbc('0x2f')],_0x1dda4d['query']);_0x3a876c[_0x1fbc('0x34')]=_[_0x1fbc('0x33')](_0x1dda4d[_0x1fbc('0x2f')],qs[_0x1fbc('0x35')](_0x542f4b[_0x1fbc('0x30')][_0x1fbc('0x35')]));_0x3a876c[_0x1fbc('0x34')]=_0x3a876c[_0x1fbc('0x34')][_0x1fbc('0x36')]?_0x3a876c[_0x1fbc('0x34')]:_0x1dda4d['model'];if(_0x542f4b[_0x1fbc('0x30')][_0x1fbc('0x3e')]){_0x3a876c[_0x1fbc('0x3f')]=[{'all':!![]}];}_0x3a876c=_['merge']({},_0x3a876c,_0x542f4b['options']);return db['OpenchannelTransferReport'][_0x1fbc('0x45')](_0x3a876c)[_0x1fbc('0x24')](handleEntityNotFound(_0x43b2f9,null))[_0x1fbc('0x24')](respondWithResult(_0x43b2f9,null))['catch'](handleError(_0x43b2f9,null));};exports[_0x1fbc('0x46')]=function(_0x1aef4c,_0xf479c8){return db[_0x1fbc('0x2b')][_0x1fbc('0x46')](_0x1aef4c[_0x1fbc('0x47')],{})[_0x1fbc('0x24')](respondWithResult(_0xf479c8,0xc9))['catch'](handleError(_0xf479c8,null));};exports[_0x1fbc('0x48')]=function(_0x40f854,_0xc888da){if(_0x40f854[_0x1fbc('0x47')]['id']){delete _0x40f854['body']['id'];}return db['OpenchannelTransferReport'][_0x1fbc('0x45')]({'where':{'id':_0x40f854[_0x1fbc('0x44')]['id']}})[_0x1fbc('0x24')](handleEntityNotFound(_0xc888da,null))[_0x1fbc('0x24')](saveUpdates(_0x40f854[_0x1fbc('0x47')],null))[_0x1fbc('0x24')](respondWithResult(_0xc888da,null))['catch'](handleError(_0xc888da,null));};exports[_0x1fbc('0x49')]=function(_0x242f80,_0x2004c6){return db[_0x1fbc('0x2b')]['find']({'where':{'id':_0x242f80[_0x1fbc('0x44')]['id']}})[_0x1fbc('0x24')](handleEntityNotFound(_0x2004c6,null))['then'](removeEntity(_0x2004c6,null))[_0x1fbc('0x42')](handleError(_0x2004c6,null));};exports[_0x1fbc('0x4a')]=function(_0x4810c2,_0x25dbb4){return db[_0x1fbc('0x2b')][_0x1fbc('0x4a')]()[_0x1fbc('0x24')](respondWithResult(_0x25dbb4,null))[_0x1fbc('0x42')](handleError(_0x25dbb4,null));}; \ No newline at end of file +var _0xb497=['params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','destroy','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','keys','merge','find','create','body','update'];(function(_0x4b66c0,_0x13a216){var _0x270e8a=function(_0xb7df0d){while(--_0xb7df0d){_0x4b66c0['push'](_0x4b66c0['shift']());}};_0x270e8a(++_0x13a216);}(_0xb497,0x12a));var _0x7b49=function(_0x5c2c21,_0x240b0a){_0x5c2c21=_0x5c2c21-0x0;var _0x49a0b1=_0xb497[_0x5c2c21];return _0x49a0b1;};'use strict';var emlformat=require(_0x7b49('0x0'));var rimraf=require(_0x7b49('0x1'));var zipdir=require(_0x7b49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b49('0x3'));var moment=require(_0x7b49('0x4'));var BPromise=require(_0x7b49('0x5'));var Mustache=require(_0x7b49('0x6'));var util=require(_0x7b49('0x7'));var path=require(_0x7b49('0x8'));var sox=require(_0x7b49('0x9'));var csv=require(_0x7b49('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b49('0xb'));var _=require(_0x7b49('0xc'));var squel=require(_0x7b49('0xd'));var crypto=require(_0x7b49('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7b49('0xf'));var toCsv=require(_0x7b49('0xa'));var querystring=require(_0x7b49('0x10'));var Papa=require(_0x7b49('0x11'));var Redis=require(_0x7b49('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7b49('0x13'));var as=require(_0x7b49('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b49('0x15'))(_0x7b49('0x16'));var utils=require(_0x7b49('0x17'));var config=require(_0x7b49('0x18'));var licenseUtil=require(_0x7b49('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x194cc9,_0x1a2aa4){_0x1a2aa4=_0x1a2aa4||0xcc;return function(_0x39cfe8){if(_0x39cfe8){return _0x194cc9[_0x7b49('0x1a')](_0x1a2aa4);}return _0x194cc9[_0x7b49('0x1b')](_0x1a2aa4)[_0x7b49('0x1c')]();};}function respondWithResult(_0x10f475,_0x2e13e2){_0x2e13e2=_0x2e13e2||0xc8;return function(_0x471e12){if(_0x471e12){return _0x10f475[_0x7b49('0x1b')](_0x2e13e2)[_0x7b49('0x1d')](_0x471e12);}};}function respondWithFilteredResult(_0x4199c4,_0x54edeb){return function(_0x219272){if(_0x219272){var _0x53b928=typeof _0x54edeb[_0x7b49('0x1e')]===_0x7b49('0x1f')&&typeof _0x54edeb[_0x7b49('0x20')]==='undefined';var _0x2b395b=_0x219272[_0x7b49('0x21')];var _0x53a101=_0x53b928?0x0:_0x54edeb[_0x7b49('0x1e')];var _0x31b5c1=_0x53b928?_0x219272[_0x7b49('0x21')]:_0x54edeb[_0x7b49('0x1e')]+_0x54edeb[_0x7b49('0x20')];var _0x1c43e4;if(_0x31b5c1>=_0x2b395b){_0x31b5c1=_0x2b395b;_0x1c43e4=0xc8;}else{_0x1c43e4=0xce;}_0x4199c4['status'](_0x1c43e4);return _0x4199c4[_0x7b49('0x22')]('Content-Range',_0x53a101+'-'+_0x31b5c1+'/'+_0x2b395b)['json'](_0x219272);}return null;};}function patchUpdates(_0x381598){return function(_0x17e389){try{jsonpatch['apply'](_0x17e389,_0x381598,!![]);}catch(_0x17c870){return BPromise[_0x7b49('0x23')](_0x17c870);}return _0x17e389['save']();};}function saveUpdates(_0x2ae0f7,_0x25f1a5){return function(_0x202630){if(_0x202630){return _0x202630['update'](_0x2ae0f7)['then'](function(_0x365219){return _0x365219;});}return null;};}function removeEntity(_0x1d349d,_0x504cc3){return function(_0xbdf6e4){if(_0xbdf6e4){return _0xbdf6e4[_0x7b49('0x24')]()[_0x7b49('0x25')](function(){_0x1d349d[_0x7b49('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7787b8,_0x888eed){return function(_0x5d0722){if(!_0x5d0722){_0x7787b8[_0x7b49('0x1a')](0x194);}return _0x5d0722;};}function handleError(_0x114e0c,_0x572c2c){_0x572c2c=_0x572c2c||0x1f4;return function(_0x3dab0d){logger[_0x7b49('0x26')](_0x3dab0d[_0x7b49('0x27')]);if(_0x3dab0d[_0x7b49('0x28')]){delete _0x3dab0d[_0x7b49('0x28')];}_0x114e0c[_0x7b49('0x1b')](_0x572c2c)[_0x7b49('0x29')](_0x3dab0d);};}exports[_0x7b49('0x2a')]=function(_0x3ce062,_0x3a94ab){var _0x57d6b={},_0x3fc7e1={},_0x1367ca={'count':0x0,'rows':[]};var _0x1c3660=_[_0x7b49('0x2b')](db[_0x7b49('0x2c')][_0x7b49('0x2d')],function(_0x587773){return{'name':_0x587773['fieldName'],'type':_0x587773['type']['key']};});_0x3fc7e1['model']=_[_0x7b49('0x2b')](_0x1c3660,_0x7b49('0x28'));_0x3fc7e1[_0x7b49('0x2e')]=_['keys'](_0x3ce062[_0x7b49('0x2e')]);_0x3fc7e1['filters']=_[_0x7b49('0x2f')](_0x3fc7e1['model'],_0x3fc7e1['query']);_0x57d6b['attributes']=_['intersection'](_0x3fc7e1[_0x7b49('0x30')],qs[_0x7b49('0x31')](_0x3ce062['query'][_0x7b49('0x31')]));_0x57d6b[_0x7b49('0x32')]=_0x57d6b[_0x7b49('0x32')][_0x7b49('0x33')]?_0x57d6b[_0x7b49('0x32')]:_0x3fc7e1[_0x7b49('0x30')];if(!_0x3ce062['query'][_0x7b49('0x34')](_0x7b49('0x35'))){_0x57d6b[_0x7b49('0x20')]=qs['limit'](_0x3ce062['query'][_0x7b49('0x20')]);_0x57d6b[_0x7b49('0x1e')]=qs['offset'](_0x3ce062[_0x7b49('0x2e')][_0x7b49('0x1e')]);}_0x57d6b['order']=qs['sort'](_0x3ce062['query'][_0x7b49('0x36')]);_0x57d6b[_0x7b49('0x37')]=qs[_0x7b49('0x38')](_[_0x7b49('0x39')](_0x3ce062['query'],_0x3fc7e1[_0x7b49('0x38')]),_0x1c3660);if(_0x3ce062[_0x7b49('0x2e')]['filter']){_0x57d6b[_0x7b49('0x37')]=_['merge'](_0x57d6b[_0x7b49('0x37')],{'$or':_[_0x7b49('0x2b')](_0x1c3660,function(_0x4ff14d){if(_0x4ff14d['type']!==_0x7b49('0x3a')){var _0x425083={};_0x425083[_0x4ff14d[_0x7b49('0x28')]]={'$like':'%'+_0x3ce062[_0x7b49('0x2e')][_0x7b49('0x3b')]+'%'};return _0x425083;}})});}_0x57d6b=_['merge']({},_0x57d6b,_0x3ce062[_0x7b49('0x3c')]);var _0xcac96d={'where':_0x57d6b[_0x7b49('0x37')]};return db[_0x7b49('0x2c')]['count'](_0xcac96d)['then'](function(_0x4ee49a){_0x1367ca[_0x7b49('0x21')]=_0x4ee49a;if(_0x3ce062['query'][_0x7b49('0x3d')]){_0x57d6b[_0x7b49('0x3e')]=[{'all':!![]}];}return db[_0x7b49('0x2c')][_0x7b49('0x3f')](_0x57d6b);})['then'](function(_0x1c47ab){_0x1367ca['rows']=_0x1c47ab;return _0x1367ca;})['then'](respondWithFilteredResult(_0x3a94ab,_0x57d6b))[_0x7b49('0x40')](handleError(_0x3a94ab,null));};exports[_0x7b49('0x41')]=function(_0x112af9,_0x1b902c){var _0x34a8cb={'raw':!![],'where':{'id':_0x112af9['params']['id']}},_0x5926ed={};_0x5926ed[_0x7b49('0x30')]=_[_0x7b49('0x42')](db[_0x7b49('0x2c')][_0x7b49('0x2d')]);_0x5926ed['query']=_[_0x7b49('0x42')](_0x112af9[_0x7b49('0x2e')]);_0x5926ed[_0x7b49('0x38')]=_['intersection'](_0x5926ed[_0x7b49('0x30')],_0x5926ed['query']);_0x34a8cb[_0x7b49('0x32')]=_['intersection'](_0x5926ed[_0x7b49('0x30')],qs[_0x7b49('0x31')](_0x112af9[_0x7b49('0x2e')][_0x7b49('0x31')]));_0x34a8cb[_0x7b49('0x32')]=_0x34a8cb[_0x7b49('0x32')][_0x7b49('0x33')]?_0x34a8cb[_0x7b49('0x32')]:_0x5926ed[_0x7b49('0x30')];if(_0x112af9[_0x7b49('0x2e')][_0x7b49('0x3d')]){_0x34a8cb[_0x7b49('0x3e')]=[{'all':!![]}];}_0x34a8cb=_[_0x7b49('0x43')]({},_0x34a8cb,_0x112af9[_0x7b49('0x3c')]);return db[_0x7b49('0x2c')][_0x7b49('0x44')](_0x34a8cb)[_0x7b49('0x25')](handleEntityNotFound(_0x1b902c,null))[_0x7b49('0x25')](respondWithResult(_0x1b902c,null))[_0x7b49('0x40')](handleError(_0x1b902c,null));};exports[_0x7b49('0x45')]=function(_0x5670dd,_0x38c6ee){return db[_0x7b49('0x2c')][_0x7b49('0x45')](_0x5670dd[_0x7b49('0x46')],{})[_0x7b49('0x25')](respondWithResult(_0x38c6ee,0xc9))[_0x7b49('0x40')](handleError(_0x38c6ee,null));};exports[_0x7b49('0x47')]=function(_0x2441de,_0x44be91){if(_0x2441de[_0x7b49('0x46')]['id']){delete _0x2441de[_0x7b49('0x46')]['id'];}return db[_0x7b49('0x2c')]['find']({'where':{'id':_0x2441de[_0x7b49('0x48')]['id']}})[_0x7b49('0x25')](handleEntityNotFound(_0x44be91,null))['then'](saveUpdates(_0x2441de[_0x7b49('0x46')],null))[_0x7b49('0x25')](respondWithResult(_0x44be91,null))['catch'](handleError(_0x44be91,null));};exports[_0x7b49('0x24')]=function(_0x2421d3,_0x232b28){return db[_0x7b49('0x2c')]['find']({'where':{'id':_0x2421d3['params']['id']}})['then'](handleEntityNotFound(_0x232b28,null))[_0x7b49('0x25')](removeEntity(_0x232b28,null))[_0x7b49('0x40')](handleError(_0x232b28,null));};exports[_0x7b49('0x49')]=function(_0x6bc6e2,_0x2aac3b){return db[_0x7b49('0x2c')][_0x7b49('0x49')]()['then'](respondWithResult(_0x2aac3b,null))['catch'](handleError(_0x2aac3b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 500c579..564bbb4 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 _0x2c04=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid'];(function(_0x346962,_0x4f69d6){var _0x3f2a3d=function(_0x5cf591){while(--_0x5cf591){_0x346962['push'](_0x346962['shift']());}};_0x3f2a3d(++_0x4f69d6);}(_0x2c04,0x9c));var _0x42c0=function(_0x4bc1e4,_0x5577dd){_0x4bc1e4=_0x4bc1e4-0x0;var _0x351637=_0x2c04[_0x4bc1e4];return _0x351637;};'use strict';var _=require('lodash');var util=require(_0x42c0('0x0'));var logger=require(_0x42c0('0x1'))(_0x42c0('0x2'));var moment=require(_0x42c0('0x3'));var BPromise=require(_0x42c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42c0('0x5'));var rimraf=require(_0x42c0('0x6'));var config=require(_0x42c0('0x7'));var attributes=require(_0x42c0('0x8'));module[_0x42c0('0x9')]=function(_0x1813f8,_0x371bcb){return _0x1813f8[_0x42c0('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x42c0('0xb'),'paranoid':![],'indexes':[{'name':_0x42c0('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf705=['bluebird','request-promise','../../config/environment','exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x1daf6d,_0x123588){var _0x269705=function(_0x19295b){while(--_0x19295b){_0x1daf6d['push'](_0x1daf6d['shift']());}};_0x269705(++_0x123588);}(_0xf705,0xcd));var _0x5f70=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf705[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5f70('0x0'));var util=require('util');var logger=require(_0x5f70('0x1'))(_0x5f70('0x2'));var moment=require(_0x5f70('0x3'));var BPromise=require(_0x5f70('0x4'));var rp=require(_0x5f70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5f70('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x5f70('0x7')]=function(_0x4052dc,_0x4557e5){return _0x4052dc[_0x5f70('0x8')](_0x5f70('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x5f70('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index a72b6f8..7356a73 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 _0x83d3=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result'];(function(_0x12276f,_0xbfb887){var _0x2250e8=function(_0x25d4cf){while(--_0x25d4cf){_0x12276f['push'](_0x12276f['shift']());}};_0x2250e8(++_0xbfb887);}(_0x83d3,0x17c));var _0x383d=function(_0x205e83,_0x2df5a4){_0x205e83=_0x205e83-0x0;var _0x10bb19=_0x83d3[_0x205e83];return _0x10bb19;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var moment=require(_0x383d('0x2'));var BPromise=require(_0x383d('0x3'));var rs=require(_0x383d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x383d('0x5'))['db'];var utils=require(_0x383d('0x6'));var logger=require(_0x383d('0x7'))(_0x383d('0x8'));var config=require('../../config/environment');var jayson=require(_0x383d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbc074b,_0x2c3cab,_0x360bee){return new BPromise(function(_0x5641df,_0x303c1d){return client['request'](_0xbc074b,_0x360bee)['then'](function(_0x221079){logger[_0x383d('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));logger[_0x383d('0xc')](_0x383d('0xd'),_0x2c3cab,_0x383d('0xb'),JSON[_0x383d('0xe')](_0x221079));if(_0x221079[_0x383d('0xf')]){if(_0x221079['error']['code']===0x1f4){logger['error'](_0x383d('0x10'),_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x303c1d(_0x221079[_0x383d('0xf')][_0x383d('0x11')]);}logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x5641df(_0x221079['error'][_0x383d('0x11')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));_0x5641df(_0x221079[_0x383d('0x12')]['message']);}})['catch'](function(_0x11c1f9){logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x11c1f9);_0x303c1d(_0x11c1f9);});});} \ No newline at end of file +var _0xea31=['stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xbbc9a5,_0x336029){var _0x57fc50=function(_0x51f21b){while(--_0x51f21b){_0xbbc9a5['push'](_0xbbc9a5['shift']());}};_0x57fc50(++_0x336029);}(_0xea31,0x6b));var _0x1ea3=function(_0x5a5d90,_0x17105f){_0x5a5d90=_0x5a5d90-0x0;var _0x538185=_0xea31[_0x5a5d90];return _0x538185;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var moment=require(_0x1ea3('0x1'));var BPromise=require(_0x1ea3('0x2'));var rs=require(_0x1ea3('0x3'));var fs=require('fs');var Redis=require(_0x1ea3('0x4'));var db=require(_0x1ea3('0x5'))['db'];var utils=require(_0x1ea3('0x6'));var logger=require(_0x1ea3('0x7'))('rpc');var config=require(_0x1ea3('0x8'));var jayson=require(_0x1ea3('0x9'));var client=jayson[_0x1ea3('0xa')][_0x1ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e6fb,_0x4c8f83,_0x1fa3a8){return new BPromise(function(_0x1b578e,_0x30a6db){return client[_0x1ea3('0xc')](_0x13e6fb,_0x1fa3a8)[_0x1ea3('0xd')](function(_0x2ff19a){logger['info'](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));logger[_0x1ea3('0x10')](_0x1ea3('0x11'),_0x4c8f83,_0x1ea3('0xf'),JSON[_0x1ea3('0x12')](_0x2ff19a));if(_0x2ff19a[_0x1ea3('0x13')]){if(_0x2ff19a['error'][_0x1ea3('0x14')]===0x1f4){logger['error'](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);return _0x30a6db(_0x2ff19a['error'][_0x1ea3('0x15')]);}logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a['error'][_0x1ea3('0x15')]);return _0x1b578e(_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);}else{logger[_0x1ea3('0x16')](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));_0x1b578e(_0x2ff19a[_0x1ea3('0x17')]['message']);}})[_0x1ea3('0x18')](function(_0x199728){logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x199728);_0x30a6db(_0x199728);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a8bdff8..3406c43 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 _0x976f=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','destroy'];(function(_0x9c80f6,_0x313ad6){var _0x5a237b=function(_0x439137){while(--_0x439137){_0x9c80f6['push'](_0x9c80f6['shift']());}};_0x5a237b(++_0x313ad6);}(_0x976f,0x121));var _0xf976=function(_0x25a73d,_0x133cb7){_0x25a73d=_0x25a73d-0x0;var _0x529b1b=_0x976f[_0x25a73d];return _0x529b1b;};'use strict';var multer=require(_0xf976('0x0'));var util=require(_0xf976('0x1'));var path=require(_0xf976('0x2'));var timeout=require(_0xf976('0x3'));var express=require('express');var router=express[_0xf976('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf976('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf976('0x6'));var controller=require('./pause.controller');router[_0xf976('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf976('0x7')](_0xf976('0x8'),auth[_0xf976('0x9')](),controller[_0xf976('0xa')]);router[_0xf976('0xb')]('/',auth[_0xf976('0x9')](),controller[_0xf976('0xc')]);router[_0xf976('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf976('0x9')](),controller[_0xf976('0xe')]);module[_0xf976('0xf')]=router; \ No newline at end of file +var _0x2fbf=['index','get','show','post','create','/:id','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','isAuthenticated'];(function(_0x1feeec,_0x3fd021){var _0x35edef=function(_0x5b5c6c){while(--_0x5b5c6c){_0x1feeec['push'](_0x1feeec['shift']());}};_0x35edef(++_0x3fd021);}(_0x2fbf,0xbc));var _0xf2fb=function(_0x398e76,_0x579389){_0x398e76=_0x398e76-0x0;var _0x2c6861=_0x2fbf[_0x398e76];return _0x2c6861;};'use strict';var multer=require(_0xf2fb('0x0'));var util=require(_0xf2fb('0x1'));var path=require(_0xf2fb('0x2'));var timeout=require('connect-timeout');var express=require(_0xf2fb('0x3'));var router=express[_0xf2fb('0x4')]();var fs_extra=require(_0xf2fb('0x5'));var auth=require(_0xf2fb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf2fb('0x7'));var controller=require(_0xf2fb('0x8'));router['get']('/',auth[_0xf2fb('0x9')](),controller[_0xf2fb('0xa')]);router[_0xf2fb('0xb')]('/:id',auth[_0xf2fb('0x9')](),controller[_0xf2fb('0xc')]);router[_0xf2fb('0xd')]('/',auth[_0xf2fb('0x9')](),controller[_0xf2fb('0xe')]);router['put'](_0xf2fb('0xf'),auth[_0xf2fb('0x9')](),controller['update']);router[_0xf2fb('0x10')](_0xf2fb('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf2fb('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 db858be..9b61d2d 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 _0x3890=['exports','STRING'];(function(_0x126002,_0x52c5a6){var _0x2101c9=function(_0x541dd2){while(--_0x541dd2){_0x126002['push'](_0x126002['shift']());}};_0x2101c9(++_0x52c5a6);}(_0x3890,0x172));var _0x0389=function(_0x4f121d,_0x25b9f5){_0x4f121d=_0x4f121d-0x0;var _0xd4311c=_0x3890[_0x4f121d];return _0xd4311c;};'use strict';var Sequelize=require('sequelize');module[_0x0389('0x0')]={'name':{'type':Sequelize[_0x0389('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0389('0x1')]}}; \ No newline at end of file +var _0x6da6=['name','sequelize','exports','STRING'];(function(_0x1437d5,_0x5f1de7){var _0x27c4fc=function(_0x32a5f3){while(--_0x32a5f3){_0x1437d5['push'](_0x1437d5['shift']());}};_0x27c4fc(++_0x5f1de7);}(_0x6da6,0x191));var _0x66da=function(_0x24ddf0,_0x4ef5a2){_0x24ddf0=_0x24ddf0-0x0;var _0x1d454e=_0x6da6[_0x24ddf0];return _0x1d454e;};'use strict';var Sequelize=require(_0x66da('0x0'));module[_0x66da('0x1')]={'name':{'type':Sequelize[_0x66da('0x2')],'unique':_0x66da('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x66da('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 63c1b0e..45fa80d 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 _0x3f4e=['attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','map','merge','options','includeAll','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','end','sendStatus','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x4144ca,_0x3f22e3){var _0x2de8ee=function(_0x160005){while(--_0x160005){_0x4144ca['push'](_0x4144ca['shift']());}};_0x2de8ee(++_0x3f22e3);}(_0x3f4e,0x14c));var _0xe3f4=function(_0x32c443,_0x58feaa){_0x32c443=_0x32c443-0x0;var _0x172bd3=_0x3f4e[_0x32c443];return _0x172bd3;};'use strict';var emlformat=require(_0xe3f4('0x0'));var rimraf=require(_0xe3f4('0x1'));var zipdir=require(_0xe3f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3f4('0x3'));var moment=require('moment');var BPromise=require(_0xe3f4('0x4'));var Mustache=require(_0xe3f4('0x5'));var util=require('util');var path=require(_0xe3f4('0x6'));var sox=require(_0xe3f4('0x7'));var csv=require('to-csv');var ejs=require(_0xe3f4('0x8'));var fs=require('fs');var fs_extra=require(_0xe3f4('0x9'));var _=require(_0xe3f4('0xa'));var squel=require(_0xe3f4('0xb'));var crypto=require(_0xe3f4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe3f4('0xd'));var toCsv=require(_0xe3f4('0xe'));var querystring=require(_0xe3f4('0xf'));var Papa=require('papaparse');var Redis=require(_0xe3f4('0x10'));var authService=require(_0xe3f4('0x11'));var qs=require(_0xe3f4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3f4('0x13'));var logger=require('../../config/logger')(_0xe3f4('0x14'));var utils=require('../../config/utils');var config=require(_0xe3f4('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x896269,_0x46e6ec){_0x46e6ec=_0x46e6ec||0xcc;return function(_0x243b9f){if(_0x243b9f){return _0x896269['sendStatus'](_0x46e6ec);}return _0x896269[_0xe3f4('0x16')](_0x46e6ec)['end']();};}function respondWithResult(_0x12bf51,_0x16ecc2){_0x16ecc2=_0x16ecc2||0xc8;return function(_0x5f1556){if(_0x5f1556){return _0x12bf51[_0xe3f4('0x16')](_0x16ecc2)['json'](_0x5f1556);}};}function respondWithFilteredResult(_0x34d555,_0x3ea6e6){return function(_0x5bc86f){if(_0x5bc86f){var _0x307944=typeof _0x3ea6e6[_0xe3f4('0x17')]===_0xe3f4('0x18')&&typeof _0x3ea6e6[_0xe3f4('0x19')]===_0xe3f4('0x18');var _0x50aa77=_0x5bc86f[_0xe3f4('0x1a')];var _0x3e977e=_0x307944?0x0:_0x3ea6e6['offset'];var _0x1417cf=_0x307944?_0x5bc86f[_0xe3f4('0x1a')]:_0x3ea6e6[_0xe3f4('0x17')]+_0x3ea6e6[_0xe3f4('0x19')];var _0x504cae;if(_0x1417cf>=_0x50aa77){_0x1417cf=_0x50aa77;_0x504cae=0xc8;}else{_0x504cae=0xce;}_0x34d555[_0xe3f4('0x16')](_0x504cae);return _0x34d555[_0xe3f4('0x1b')](_0xe3f4('0x1c'),_0x3e977e+'-'+_0x1417cf+'/'+_0x50aa77)['json'](_0x5bc86f);}return null;};}function patchUpdates(_0x14eae0){return function(_0x1c0efc){try{jsonpatch[_0xe3f4('0x1d')](_0x1c0efc,_0x14eae0,!![]);}catch(_0x10fbcb){return BPromise[_0xe3f4('0x1e')](_0x10fbcb);}return _0x1c0efc[_0xe3f4('0x1f')]();};}function saveUpdates(_0x395cb8,_0x3d35a4){return function(_0x5e66eb){if(_0x5e66eb){return _0x5e66eb[_0xe3f4('0x20')](_0x395cb8)[_0xe3f4('0x21')](function(_0x20c090){return _0x20c090;});}return null;};}function removeEntity(_0x5bf705,_0x27ed26){return function(_0x1ebf7e){if(_0x1ebf7e){return _0x1ebf7e[_0xe3f4('0x22')]()['then'](function(){var _0x3aee85=_0x1ebf7e[_0xe3f4('0x23')]({'plain':!![]});var _0x17115e=_0xe3f4('0x24');return db['UserProfileResource'][_0xe3f4('0x22')]({'where':{'type':_0x17115e,'resourceId':_0x3aee85['id']}})['then'](function(){return _0x1ebf7e;});})[_0xe3f4('0x21')](function(){_0x5bf705[_0xe3f4('0x16')](0xcc)[_0xe3f4('0x25')]();});}};}function handleEntityNotFound(_0x54d953,_0x39e3b6){return function(_0x519e54){if(!_0x519e54){_0x54d953[_0xe3f4('0x26')](0x194);}return _0x519e54;};}function handleError(_0x22f83a,_0x1d980b){_0x1d980b=_0x1d980b||0x1f4;return function(_0x4d29ce){logger['error'](_0x4d29ce[_0xe3f4('0x27')]);if(_0x4d29ce[_0xe3f4('0x28')]){delete _0x4d29ce[_0xe3f4('0x28')];}_0x22f83a[_0xe3f4('0x16')](_0x1d980b)[_0xe3f4('0x29')](_0x4d29ce);};}exports[_0xe3f4('0x2a')]=function(_0x28b3b5,_0x2d8445){var _0x174b3f={},_0x373d16={},_0x7be38={'count':0x0,'rows':[]};var _0x59bb5e=_['map'](db[_0xe3f4('0x2b')][_0xe3f4('0x2c')],function(_0x13e6f9){return{'name':_0x13e6f9[_0xe3f4('0x2d')],'type':_0x13e6f9[_0xe3f4('0x2e')][_0xe3f4('0x2f')]};});_0x373d16['model']=_['map'](_0x59bb5e,_0xe3f4('0x28'));_0x373d16[_0xe3f4('0x30')]=_[_0xe3f4('0x31')](_0x28b3b5[_0xe3f4('0x30')]);_0x373d16[_0xe3f4('0x32')]=_[_0xe3f4('0x33')](_0x373d16[_0xe3f4('0x34')],_0x373d16[_0xe3f4('0x30')]);_0x174b3f[_0xe3f4('0x35')]=_[_0xe3f4('0x33')](_0x373d16[_0xe3f4('0x34')],qs[_0xe3f4('0x36')](_0x28b3b5[_0xe3f4('0x30')]['fields']));_0x174b3f[_0xe3f4('0x35')]=_0x174b3f[_0xe3f4('0x35')][_0xe3f4('0x37')]?_0x174b3f['attributes']:_0x373d16['model'];if(!_0x28b3b5[_0xe3f4('0x30')][_0xe3f4('0x38')](_0xe3f4('0x39'))){_0x174b3f[_0xe3f4('0x19')]=qs[_0xe3f4('0x19')](_0x28b3b5[_0xe3f4('0x30')]['limit']);_0x174b3f[_0xe3f4('0x17')]=qs['offset'](_0x28b3b5[_0xe3f4('0x30')]['offset']);}_0x174b3f['order']=qs[_0xe3f4('0x3a')](_0x28b3b5['query'][_0xe3f4('0x3a')]);_0x174b3f['where']=qs['filters'](_[_0xe3f4('0x3b')](_0x28b3b5['query'],_0x373d16[_0xe3f4('0x32')]),_0x59bb5e);if(_0x28b3b5[_0xe3f4('0x30')]['filter']){_0x174b3f[_0xe3f4('0x3c')]=_['merge'](_0x174b3f['where'],{'$or':_[_0xe3f4('0x3d')](_0x59bb5e,function(_0x81b7ac){if(_0x81b7ac[_0xe3f4('0x2e')]!=='VIRTUAL'){var _0x441797={};_0x441797[_0x81b7ac['name']]={'$like':'%'+_0x28b3b5['query']['filter']+'%'};return _0x441797;}})});}_0x174b3f=_[_0xe3f4('0x3e')]({},_0x174b3f,_0x28b3b5[_0xe3f4('0x3f')]);var _0x397123={'where':_0x174b3f[_0xe3f4('0x3c')]};return db['Pause'][_0xe3f4('0x1a')](_0x397123)['then'](function(_0x596419){_0x7be38[_0xe3f4('0x1a')]=_0x596419;if(_0x28b3b5['query'][_0xe3f4('0x40')]){_0x174b3f['include']=[{'all':!![]}];}return db[_0xe3f4('0x2b')][_0xe3f4('0x41')](_0x174b3f);})[_0xe3f4('0x21')](function(_0x3972ec){_0x7be38['rows']=_0x3972ec;return _0x7be38;})['then'](respondWithFilteredResult(_0x2d8445,_0x174b3f))[_0xe3f4('0x42')](handleError(_0x2d8445,null));};exports[_0xe3f4('0x43')]=function(_0x3cd0c4,_0x5c876d){var _0x279215={'raw':!![],'where':{'id':_0x3cd0c4['params']['id']}},_0x441e8f={};_0x441e8f[_0xe3f4('0x34')]=_[_0xe3f4('0x31')](db['Pause']['rawAttributes']);_0x441e8f[_0xe3f4('0x30')]=_[_0xe3f4('0x31')](_0x3cd0c4[_0xe3f4('0x30')]);_0x441e8f['filters']=_[_0xe3f4('0x33')](_0x441e8f[_0xe3f4('0x34')],_0x441e8f[_0xe3f4('0x30')]);_0x279215[_0xe3f4('0x35')]=_[_0xe3f4('0x33')](_0x441e8f[_0xe3f4('0x34')],qs[_0xe3f4('0x36')](_0x3cd0c4[_0xe3f4('0x30')][_0xe3f4('0x36')]));_0x279215['attributes']=_0x279215[_0xe3f4('0x35')][_0xe3f4('0x37')]?_0x279215[_0xe3f4('0x35')]:_0x441e8f[_0xe3f4('0x34')];if(_0x3cd0c4['query'][_0xe3f4('0x40')]){_0x279215['include']=[{'all':!![]}];}_0x279215=_[_0xe3f4('0x3e')]({},_0x279215,_0x3cd0c4['options']);return db[_0xe3f4('0x2b')][_0xe3f4('0x44')](_0x279215)['then'](handleEntityNotFound(_0x5c876d,null))[_0xe3f4('0x21')](respondWithResult(_0x5c876d,null))['catch'](handleError(_0x5c876d,null));};exports[_0xe3f4('0x45')]=function(_0x3f04a5,_0x50547b){return db[_0xe3f4('0x2b')][_0xe3f4('0x45')](_0x3f04a5[_0xe3f4('0x46')],{})[_0xe3f4('0x21')](function(_0xe25114){var _0x2d2f21=_0x3f04a5[_0xe3f4('0x47')][_0xe3f4('0x23')]({'plain':!![]});if(!_0x2d2f21)throw new Error(_0xe3f4('0x48'));if(_0x2d2f21[_0xe3f4('0x49')]===_0xe3f4('0x47')){var _0x3742d6=_0xe25114['get']({'plain':!![]});var _0x45b75c=_0xe3f4('0x24');return db[_0xe3f4('0x4a')][_0xe3f4('0x44')]({'where':{'name':_0x45b75c,'userProfileId':_0x2d2f21['userProfileId']},'raw':!![]})[_0xe3f4('0x21')](function(_0x11b665){if(_0x11b665&&_0x11b665[_0xe3f4('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x3742d6[_0xe3f4('0x28')],'resourceId':_0x3742d6['id'],'type':_0x11b665[_0xe3f4('0x28')],'sectionId':_0x11b665['id']},{})[_0xe3f4('0x21')](function(){return _0xe25114;});}else{return _0xe25114;}})[_0xe3f4('0x42')](function(_0xb6da98){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb6da98);throw _0xb6da98;});}return _0xe25114;})[_0xe3f4('0x21')](respondWithResult(_0x50547b,0xc9))[_0xe3f4('0x42')](handleError(_0x50547b,null));};exports[_0xe3f4('0x20')]=function(_0x1a2d59,_0x4fcab3){if(_0x1a2d59[_0xe3f4('0x46')]['id']){delete _0x1a2d59[_0xe3f4('0x46')]['id'];}return db[_0xe3f4('0x2b')][_0xe3f4('0x44')]({'where':{'id':_0x1a2d59[_0xe3f4('0x4c')]['id']}})[_0xe3f4('0x21')](handleEntityNotFound(_0x4fcab3,null))['then'](saveUpdates(_0x1a2d59[_0xe3f4('0x46')],null))['then'](respondWithResult(_0x4fcab3,null))[_0xe3f4('0x42')](handleError(_0x4fcab3,null));};exports['destroy']=function(_0x46cfb6,_0x376941){return db[_0xe3f4('0x2b')][_0xe3f4('0x44')]({'where':{'id':_0x46cfb6[_0xe3f4('0x4c')]['id']}})[_0xe3f4('0x21')](handleEntityNotFound(_0x376941,null))[_0xe3f4('0x21')](removeEntity(_0x376941,null))[_0xe3f4('0x42')](handleError(_0x376941,null));}; \ No newline at end of file +var _0xe6c8=['findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','find','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','filter','options','includeAll'];(function(_0x916ccc,_0x19734f){var _0xfd449b=function(_0xa31c4b){while(--_0xa31c4b){_0x916ccc['push'](_0x916ccc['shift']());}};_0xfd449b(++_0x19734f);}(_0xe6c8,0xf2));var _0x8e6c=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xe6c8[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require(_0x8e6c('0x0'));var rimraf=require(_0x8e6c('0x1'));var zipdir=require(_0x8e6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8e6c('0x3'));var Mustache=require(_0x8e6c('0x4'));var util=require('util');var path=require(_0x8e6c('0x5'));var sox=require(_0x8e6c('0x6'));var csv=require(_0x8e6c('0x7'));var ejs=require(_0x8e6c('0x8'));var fs=require('fs');var fs_extra=require(_0x8e6c('0x9'));var _=require(_0x8e6c('0xa'));var squel=require('squel');var crypto=require(_0x8e6c('0xb'));var jsforce=require(_0x8e6c('0xc'));var deskjs=require(_0x8e6c('0xd'));var toCsv=require(_0x8e6c('0x7'));var querystring=require('querystring');var Papa=require(_0x8e6c('0xe'));var Redis=require(_0x8e6c('0xf'));var authService=require(_0x8e6c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8e6c('0x11'));var hardwareService=require(_0x8e6c('0x12'));var logger=require(_0x8e6c('0x13'))(_0x8e6c('0x14'));var utils=require(_0x8e6c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8e6c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc20fc8,_0x4e1c75){_0x4e1c75=_0x4e1c75||0xcc;return function(_0x438098){if(_0x438098){return _0xc20fc8[_0x8e6c('0x17')](_0x4e1c75);}return _0xc20fc8[_0x8e6c('0x18')](_0x4e1c75)['end']();};}function respondWithResult(_0x4e78d1,_0x262179){_0x262179=_0x262179||0xc8;return function(_0x53c514){if(_0x53c514){return _0x4e78d1[_0x8e6c('0x18')](_0x262179)[_0x8e6c('0x19')](_0x53c514);}};}function respondWithFilteredResult(_0x266dcc,_0x444228){return function(_0x4c0f1e){if(_0x4c0f1e){var _0x50f2db=typeof _0x444228[_0x8e6c('0x1a')]===_0x8e6c('0x1b')&&typeof _0x444228[_0x8e6c('0x1c')]===_0x8e6c('0x1b');var _0x3bc975=_0x4c0f1e['count'];var _0x2ea61f=_0x50f2db?0x0:_0x444228['offset'];var _0x462b78=_0x50f2db?_0x4c0f1e[_0x8e6c('0x1d')]:_0x444228[_0x8e6c('0x1a')]+_0x444228[_0x8e6c('0x1c')];var _0x43d69a;if(_0x462b78>=_0x3bc975){_0x462b78=_0x3bc975;_0x43d69a=0xc8;}else{_0x43d69a=0xce;}_0x266dcc[_0x8e6c('0x18')](_0x43d69a);return _0x266dcc['set'](_0x8e6c('0x1e'),_0x2ea61f+'-'+_0x462b78+'/'+_0x3bc975)[_0x8e6c('0x19')](_0x4c0f1e);}return null;};}function patchUpdates(_0x17616f){return function(_0x31bf74){try{jsonpatch[_0x8e6c('0x1f')](_0x31bf74,_0x17616f,!![]);}catch(_0x81c758){return BPromise[_0x8e6c('0x20')](_0x81c758);}return _0x31bf74[_0x8e6c('0x21')]();};}function saveUpdates(_0x444b03,_0x4c6f1b){return function(_0x12c61f){if(_0x12c61f){return _0x12c61f[_0x8e6c('0x22')](_0x444b03)['then'](function(_0x4eb3f0){return _0x4eb3f0;});}return null;};}function removeEntity(_0x4177d7,_0x26b50a){return function(_0xc9e991){if(_0xc9e991){return _0xc9e991[_0x8e6c('0x23')]()[_0x8e6c('0x24')](function(){var _0xd4dda0=_0xc9e991[_0x8e6c('0x25')]({'plain':!![]});var _0x213abe='Pauses';return db[_0x8e6c('0x26')][_0x8e6c('0x23')]({'where':{'type':_0x213abe,'resourceId':_0xd4dda0['id']}})['then'](function(){return _0xc9e991;});})[_0x8e6c('0x24')](function(){_0x4177d7[_0x8e6c('0x18')](0xcc)[_0x8e6c('0x27')]();});}};}function handleEntityNotFound(_0x91c198,_0x183354){return function(_0x26a5f5){if(!_0x26a5f5){_0x91c198['sendStatus'](0x194);}return _0x26a5f5;};}function handleError(_0x28d28e,_0x557f02){_0x557f02=_0x557f02||0x1f4;return function(_0x6bf581){logger[_0x8e6c('0x28')](_0x6bf581['stack']);if(_0x6bf581[_0x8e6c('0x29')]){delete _0x6bf581[_0x8e6c('0x29')];}_0x28d28e[_0x8e6c('0x18')](_0x557f02)[_0x8e6c('0x2a')](_0x6bf581);};}exports[_0x8e6c('0x2b')]=function(_0x32b909,_0x4f7498){var _0xd674f={},_0x5c022c={},_0x20a8bc={'count':0x0,'rows':[]};var _0x3b2ea5=_[_0x8e6c('0x2c')](db[_0x8e6c('0x2d')][_0x8e6c('0x2e')],function(_0x1084e6){return{'name':_0x1084e6[_0x8e6c('0x2f')],'type':_0x1084e6[_0x8e6c('0x30')][_0x8e6c('0x31')]};});_0x5c022c['model']=_[_0x8e6c('0x2c')](_0x3b2ea5,'name');_0x5c022c[_0x8e6c('0x32')]=_[_0x8e6c('0x33')](_0x32b909[_0x8e6c('0x32')]);_0x5c022c['filters']=_[_0x8e6c('0x34')](_0x5c022c[_0x8e6c('0x35')],_0x5c022c[_0x8e6c('0x32')]);_0xd674f[_0x8e6c('0x36')]=_[_0x8e6c('0x34')](_0x5c022c[_0x8e6c('0x35')],qs[_0x8e6c('0x37')](_0x32b909['query']['fields']));_0xd674f[_0x8e6c('0x36')]=_0xd674f[_0x8e6c('0x36')][_0x8e6c('0x38')]?_0xd674f['attributes']:_0x5c022c[_0x8e6c('0x35')];if(!_0x32b909[_0x8e6c('0x32')][_0x8e6c('0x39')](_0x8e6c('0x3a'))){_0xd674f[_0x8e6c('0x1c')]=qs[_0x8e6c('0x1c')](_0x32b909['query'][_0x8e6c('0x1c')]);_0xd674f[_0x8e6c('0x1a')]=qs[_0x8e6c('0x1a')](_0x32b909['query']['offset']);}_0xd674f['order']=qs[_0x8e6c('0x3b')](_0x32b909['query'][_0x8e6c('0x3b')]);_0xd674f[_0x8e6c('0x3c')]=qs[_0x8e6c('0x3d')](_['pick'](_0x32b909[_0x8e6c('0x32')],_0x5c022c[_0x8e6c('0x3d')]),_0x3b2ea5);if(_0x32b909[_0x8e6c('0x32')]['filter']){_0xd674f[_0x8e6c('0x3c')]=_[_0x8e6c('0x3e')](_0xd674f[_0x8e6c('0x3c')],{'$or':_[_0x8e6c('0x2c')](_0x3b2ea5,function(_0x4bb6f0){if(_0x4bb6f0['type']!=='VIRTUAL'){var _0x39c750={};_0x39c750[_0x4bb6f0[_0x8e6c('0x29')]]={'$like':'%'+_0x32b909['query'][_0x8e6c('0x3f')]+'%'};return _0x39c750;}})});}_0xd674f=_['merge']({},_0xd674f,_0x32b909[_0x8e6c('0x40')]);var _0x3a2c3c={'where':_0xd674f[_0x8e6c('0x3c')]};return db[_0x8e6c('0x2d')]['count'](_0x3a2c3c)[_0x8e6c('0x24')](function(_0x41d25e){_0x20a8bc['count']=_0x41d25e;if(_0x32b909[_0x8e6c('0x32')][_0x8e6c('0x41')]){_0xd674f['include']=[{'all':!![]}];}return db[_0x8e6c('0x2d')][_0x8e6c('0x42')](_0xd674f);})[_0x8e6c('0x24')](function(_0x1fc793){_0x20a8bc[_0x8e6c('0x43')]=_0x1fc793;return _0x20a8bc;})[_0x8e6c('0x24')](respondWithFilteredResult(_0x4f7498,_0xd674f))[_0x8e6c('0x44')](handleError(_0x4f7498,null));};exports['show']=function(_0x36e305,_0x3ebc7c){var _0x5bc209={'raw':!![],'where':{'id':_0x36e305[_0x8e6c('0x45')]['id']}},_0x9ac0cc={};_0x9ac0cc[_0x8e6c('0x35')]=_[_0x8e6c('0x33')](db['Pause'][_0x8e6c('0x2e')]);_0x9ac0cc['query']=_[_0x8e6c('0x33')](_0x36e305[_0x8e6c('0x32')]);_0x9ac0cc['filters']=_[_0x8e6c('0x34')](_0x9ac0cc['model'],_0x9ac0cc['query']);_0x5bc209[_0x8e6c('0x36')]=_['intersection'](_0x9ac0cc[_0x8e6c('0x35')],qs['fields'](_0x36e305['query'][_0x8e6c('0x37')]));_0x5bc209[_0x8e6c('0x36')]=_0x5bc209[_0x8e6c('0x36')][_0x8e6c('0x38')]?_0x5bc209[_0x8e6c('0x36')]:_0x9ac0cc[_0x8e6c('0x35')];if(_0x36e305[_0x8e6c('0x32')][_0x8e6c('0x41')]){_0x5bc209['include']=[{'all':!![]}];}_0x5bc209=_[_0x8e6c('0x3e')]({},_0x5bc209,_0x36e305['options']);return db['Pause']['find'](_0x5bc209)[_0x8e6c('0x24')](handleEntityNotFound(_0x3ebc7c,null))[_0x8e6c('0x24')](respondWithResult(_0x3ebc7c,null))['catch'](handleError(_0x3ebc7c,null));};exports[_0x8e6c('0x46')]=function(_0x398665,_0x5f2d17){return db[_0x8e6c('0x2d')][_0x8e6c('0x46')](_0x398665[_0x8e6c('0x47')],{})[_0x8e6c('0x24')](function(_0x386397){var _0xaf7489=_0x398665[_0x8e6c('0x48')][_0x8e6c('0x25')]({'plain':!![]});if(!_0xaf7489)throw new Error(_0x8e6c('0x49'));if(_0xaf7489[_0x8e6c('0x4a')]===_0x8e6c('0x48')){var _0x3b0e9a=_0x386397['get']({'plain':!![]});var _0x30d227='Pauses';return db['UserProfileSection']['find']({'where':{'name':_0x30d227,'userProfileId':_0xaf7489['userProfileId']},'raw':!![]})['then'](function(_0x2f2531){if(_0x2f2531&&_0x2f2531[_0x8e6c('0x4b')]===0x0){return db[_0x8e6c('0x26')][_0x8e6c('0x46')]({'name':_0x3b0e9a[_0x8e6c('0x29')],'resourceId':_0x3b0e9a['id'],'type':_0x2f2531[_0x8e6c('0x29')],'sectionId':_0x2f2531['id']},{})[_0x8e6c('0x24')](function(){return _0x386397;});}else{return _0x386397;}})[_0x8e6c('0x44')](function(_0x3b401b){logger[_0x8e6c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b401b);throw _0x3b401b;});}return _0x386397;})[_0x8e6c('0x24')](respondWithResult(_0x5f2d17,0xc9))[_0x8e6c('0x44')](handleError(_0x5f2d17,null));};exports[_0x8e6c('0x22')]=function(_0x29e42b,_0x4c9114){if(_0x29e42b[_0x8e6c('0x47')]['id']){delete _0x29e42b['body']['id'];}return db['Pause'][_0x8e6c('0x4c')]({'where':{'id':_0x29e42b['params']['id']}})[_0x8e6c('0x24')](handleEntityNotFound(_0x4c9114,null))[_0x8e6c('0x24')](saveUpdates(_0x29e42b[_0x8e6c('0x47')],null))[_0x8e6c('0x24')](respondWithResult(_0x4c9114,null))[_0x8e6c('0x44')](handleError(_0x4c9114,null));};exports[_0x8e6c('0x23')]=function(_0x153343,_0x682efb){return db[_0x8e6c('0x2d')][_0x8e6c('0x4c')]({'where':{'id':_0x153343[_0x8e6c('0x45')]['id']}})[_0x8e6c('0x24')](handleEntityNotFound(_0x682efb,null))[_0x8e6c('0x24')](removeEntity(_0x682efb,null))[_0x8e6c('0x44')](handleError(_0x682efb,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e7bf58e..652ee2b 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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x7217,0x19e));var _0x7721=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x7217[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x1fabb5,_0xa37190){var _0x40b255=function(_0x5d3ce0){while(--_0x5d3ce0){_0x1fabb5['push'](_0x1fabb5['shift']());}};_0x40b255(++_0xa37190);}(_0x53ec,0x192));var _0xc53e=function(_0x372400,_0xdaeb10){_0x372400=_0x372400-0x0;var _0x4cd28c=_0x53ec[_0x372400];return _0x4cd28c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'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 c0913fa..ca3aefe 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(_0x19667d,_0x308d32){var _0x3e60a4=function(_0x432c76){while(--_0x432c76){_0x19667d['push'](_0x19667d['shift']());}};_0x3e60a4(++_0x308d32);}(_0x7a54,0x106));var _0x47a5=function(_0x5372bb,_0x3e412d){_0x5372bb=_0x5372bb-0x0;var _0x223465=_0x7a54[_0x5372bb];return _0x223465;};'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(_0x2d4a70,_0xa0640c){var _0x45aeaf=function(_0x42f90c){while(--_0x42f90c){_0x2d4a70['push'](_0x2d4a70['shift']());}};_0x45aeaf(++_0xa0640c);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d4460,_0x400e28){_0x5d4460=_0x5d4460-0x0;var _0x5bdc5e=_0xb10b[_0x5d4460];return _0x5bdc5e;};'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 319fb9c..afab816 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 _0xadb8=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','/:id/download','join','root','server/files/plugins','originalname','%s-%s%s','extname','post','single','file','upload','webhookPost','update','delete','exports'];(function(_0x383aac,_0xca54da){var _0x308e42=function(_0x3dd501){while(--_0x3dd501){_0x383aac['push'](_0x383aac['shift']());}};_0x308e42(++_0xca54da);}(_0xadb8,0x1d0));var _0x8adb=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0xadb8[_0x5aa1e2];return _0x399098;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8adb('0x0'));var timeout=require('connect-timeout');var express=require(_0x8adb('0x1'));var router=express[_0x8adb('0x2')]();var fs_extra=require(_0x8adb('0x3'));var auth=require(_0x8adb('0x4'));var interaction=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var controller=require(_0x8adb('0x7'));router['get']('/',auth[_0x8adb('0x8')](),controller[_0x8adb('0x9')]);router[_0x8adb('0xa')](_0x8adb('0xb'),controller[_0x8adb('0xc')]);router[_0x8adb('0xa')](_0x8adb('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8adb('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa095e1,_0x628c45,_0x46c6fb){_0x46c6fb(null,path[_0x8adb('0xf')](config[_0x8adb('0x10')],_0x8adb('0x11')));},'filename':function(_0x2a6574,_0x2828f1,_0x2d6b55){_0x2828f1[_0x8adb('0x12')]=_0x2828f1['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d6b55(null,util['format'](_0x8adb('0x13'),path['basename'](_0x2828f1[_0x8adb('0x12')],path[_0x8adb('0x14')](_0x2828f1[_0x8adb('0x12')])),Date['now'](),path[_0x8adb('0x14')](_0x2828f1[_0x8adb('0x12')])));}})});router[_0x8adb('0x15')]('/',upload[_0x8adb('0x16')](_0x8adb('0x17')),controller[_0x8adb('0x18')]);router['post'](_0x8adb('0xb'),controller[_0x8adb('0x19')]);router['put']('/:id',auth[_0x8adb('0x8')](),controller[_0x8adb('0x1a')]);router[_0x8adb('0x1b')](_0x8adb('0xd'),auth[_0x8adb('0x8')](),controller[_0x8adb('0x1b')]);module[_0x8adb('0x1c')]=router; \ No newline at end of file +var _0x4bc3=['single','file','webhookPost','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','/:id','show','/:id/download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post'];(function(_0x30121d,_0x18cb1f){var _0x7f6a05=function(_0x154dc8){while(--_0x154dc8){_0x30121d['push'](_0x30121d['shift']());}};_0x7f6a05(++_0x18cb1f);}(_0x4bc3,0x16e));var _0x34bc=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x4bc3[_0x20589d];return _0x422de9;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/webhook',controller['webhookGet']);router[_0x34bc('0x9')](_0x34bc('0xb'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xc')]);router[_0x34bc('0x9')](_0x34bc('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x34bc('0xe')]({'destination':function(_0x33025c,_0x2a35f3,_0x5a608a){_0x5a608a(null,path[_0x34bc('0xf')](config['root'],_0x34bc('0x10')));},'filename':function(_0x124b87,_0x164fb2,_0x536ebd){_0x164fb2[_0x34bc('0x11')]=_0x164fb2['originalname'][_0x34bc('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x536ebd(null,util[_0x34bc('0x13')](_0x34bc('0x14'),path['basename'](_0x164fb2['originalname'],path[_0x34bc('0x15')](_0x164fb2['originalname'])),Date[_0x34bc('0x16')](),path[_0x34bc('0x15')](_0x164fb2[_0x34bc('0x11')])));}})});router[_0x34bc('0x17')]('/',upload[_0x34bc('0x18')](_0x34bc('0x19')),controller['upload']);router['post']('/webhook',controller[_0x34bc('0x1a')]);router[_0x34bc('0x1b')](_0x34bc('0xb'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x1c')](_0x34bc('0xb'),auth['isAuthenticated'](),controller[_0x34bc('0x1c')]);module[_0x34bc('0x1d')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 6a013e0..4997611 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 _0xcba6=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','always','never'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcba6,0x90));var _0x6cba=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xcba6[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x6cba('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cba('0x1')]},'type':{'type':Sequelize[_0x6cba('0x2')](_0x6cba('0x3'),'script')},'description':{'type':Sequelize[_0x6cba('0x4')]},'version':{'type':Sequelize[_0x6cba('0x4')]},'path':{'type':Sequelize[_0x6cba('0x1')],'comment':_0x6cba('0x5')},'active':{'type':Sequelize[_0x6cba('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x6cba('0x2')](_0x6cba('0x7'),'agentOnly',_0x6cba('0x8'),_0x6cba('0x9')),'defaultValue':_0x6cba('0x8'),'comment':_0x6cba('0xa')},'icon':{'type':Sequelize[_0x6cba('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x6cba('0x1')]},'scriptName':{'type':Sequelize[_0x6cba('0x1')]},'scriptPath':{'type':Sequelize[_0x6cba('0x1')]}}; \ No newline at end of file +var _0x0879=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','exports','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0xf8f6bf,_0x110a1e){var _0x1e8c78=function(_0x119063){while(--_0x119063){_0xf8f6bf['push'](_0xf8f6bf['shift']());}};_0x1e8c78(++_0x110a1e);}(_0x0879,0x180));var _0x9087=function(_0x37b643,_0x2b3368){_0x37b643=_0x37b643-0x0;var _0xeda57e=_0x0879[_0x37b643];return _0xeda57e;};'use strict';var Sequelize=require('sequelize');module[_0x9087('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9087('0x1')](_0x9087('0x2'),'script')},'description':{'type':Sequelize[_0x9087('0x3')]},'version':{'type':Sequelize[_0x9087('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0x9087('0x4')},'active':{'type':Sequelize[_0x9087('0x5')],'defaultValue':0x0,'comment':_0x9087('0x6')},'sidebar':{'type':Sequelize[_0x9087('0x1')](_0x9087('0x7'),_0x9087('0x8'),'always',_0x9087('0x9')),'defaultValue':_0x9087('0xa'),'comment':_0x9087('0xb')},'icon':{'type':Sequelize[_0x9087('0xc')]},'adminUrl':{'type':Sequelize[_0x9087('0xc')]},'agentUrl':{'type':Sequelize[_0x9087('0xc')]},'scriptName':{'type':Sequelize[_0x9087('0xc')]},'scriptPath':{'type':Sequelize[_0x9087('0xc')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 07d8ec1..b4158f3 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 _0xff22=['Plugin','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','merge','options','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','code','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','attachments/**/*','existsSync','Plugin\x20not\x20found','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','description','sidebar','always','icon','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','method','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','Plugins','UserProfileResource','stack','name','send','index'];(function(_0x1843de,_0x159b22){var _0x46edac=function(_0x133a22){while(--_0x133a22){_0x1843de['push'](_0x1843de['shift']());}};_0x46edac(++_0x159b22);}(_0xff22,0x7a));var _0x2ff2=function(_0x5009d6,_0x1d0148){_0x5009d6=_0x5009d6-0x0;var _0x5a4a58=_0xff22[_0x5009d6];return _0x5a4a58;};'use strict';var emlformat=require(_0x2ff2('0x0'));var rimraf=require(_0x2ff2('0x1'));var zipdir=require(_0x2ff2('0x2'));var jsonpatch=require(_0x2ff2('0x3'));var rp=require('request-promise');var moment=require(_0x2ff2('0x4'));var BPromise=require(_0x2ff2('0x5'));var Mustache=require(_0x2ff2('0x6'));var util=require(_0x2ff2('0x7'));var path=require(_0x2ff2('0x8'));var sox=require(_0x2ff2('0x9'));var csv=require(_0x2ff2('0xa'));var ejs=require(_0x2ff2('0xb'));var fs=require('fs');var fs_extra=require(_0x2ff2('0xc'));var _=require(_0x2ff2('0xd'));var squel=require(_0x2ff2('0xe'));var crypto=require(_0x2ff2('0xf'));var jsforce=require(_0x2ff2('0x10'));var deskjs=require(_0x2ff2('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2ff2('0x12'));var Papa=require(_0x2ff2('0x13'));var extract=require(_0x2ff2('0x14'));var rimraf=require(_0x2ff2('0x1'));var archiver=require(_0x2ff2('0x15'));var Redis=require(_0x2ff2('0x16'));var authService=require(_0x2ff2('0x17'));var qs=require(_0x2ff2('0x18'));var as=require(_0x2ff2('0x19'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ff2('0x1a'))(_0x2ff2('0x1b'));var utils=require(_0x2ff2('0x1c'));var config=require(_0x2ff2('0x1d'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ff2('0x1e'))['db'];config['redis']=_[_0x2ff2('0x1f')](config[_0x2ff2('0x20')],{'host':_0x2ff2('0x21'),'port':0x18eb});var socket=require(_0x2ff2('0x22'))(new Redis(config[_0x2ff2('0x20')]));require(_0x2ff2('0x23'))[_0x2ff2('0x24')](socket);function respondWithStatusCode(_0x573792,_0x17562e){_0x17562e=_0x17562e||0xcc;return function(_0x26220b){if(_0x26220b){return _0x573792[_0x2ff2('0x25')](_0x17562e);}return _0x573792['status'](_0x17562e)[_0x2ff2('0x26')]();};}function respondWithResult(_0x4eae5b,_0x485e45){_0x485e45=_0x485e45||0xc8;return function(_0x27eb1b){if(_0x27eb1b){return _0x4eae5b[_0x2ff2('0x27')](_0x485e45)[_0x2ff2('0x28')](_0x27eb1b);}};}function respondWithFilteredResult(_0x2ec369,_0x3f5cf6){return function(_0x4a75a6){if(_0x4a75a6){var _0x38aa1e=typeof _0x3f5cf6['offset']==='undefined'&&typeof _0x3f5cf6[_0x2ff2('0x29')]===_0x2ff2('0x2a');var _0x3a63f0=_0x4a75a6[_0x2ff2('0x2b')];var _0x43ec05=_0x38aa1e?0x0:_0x3f5cf6[_0x2ff2('0x2c')];var _0x4eb874=_0x38aa1e?_0x4a75a6[_0x2ff2('0x2b')]:_0x3f5cf6[_0x2ff2('0x2c')]+_0x3f5cf6['limit'];var _0x35e0f8;if(_0x4eb874>=_0x3a63f0){_0x4eb874=_0x3a63f0;_0x35e0f8=0xc8;}else{_0x35e0f8=0xce;}_0x2ec369[_0x2ff2('0x27')](_0x35e0f8);return _0x2ec369[_0x2ff2('0x2d')](_0x2ff2('0x2e'),_0x43ec05+'-'+_0x4eb874+'/'+_0x3a63f0)[_0x2ff2('0x28')](_0x4a75a6);}return null;};}function patchUpdates(_0x279667){return function(_0x1353a1){try{jsonpatch[_0x2ff2('0x2f')](_0x1353a1,_0x279667,!![]);}catch(_0x54fcf2){return BPromise[_0x2ff2('0x30')](_0x54fcf2);}return _0x1353a1[_0x2ff2('0x31')]();};}function saveUpdates(_0x1d0d7c,_0x589f9f){return function(_0x7e4d72){if(_0x7e4d72){return _0x7e4d72['update'](_0x1d0d7c)[_0x2ff2('0x32')](function(_0x3abf43){return _0x3abf43;});}return null;};}function removeEntity(_0x146cfd,_0x57b079){return function(_0x4bd016){if(_0x4bd016){return _0x4bd016[_0x2ff2('0x33')]()['then'](function(){var _0x37e1f9=_0x4bd016['get']({'plain':!![]});var _0xc1ccb4=_0x2ff2('0x34');return db[_0x2ff2('0x35')][_0x2ff2('0x33')]({'where':{'type':_0xc1ccb4,'resourceId':_0x37e1f9['id']}})[_0x2ff2('0x32')](function(){return _0x4bd016;});})[_0x2ff2('0x32')](function(){_0x146cfd[_0x2ff2('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5399f0,_0x5c5955){return function(_0x15c764){if(!_0x15c764){_0x5399f0[_0x2ff2('0x25')](0x194);}return _0x15c764;};}function handleError(_0x1dfc25,_0x14d1ef){_0x14d1ef=_0x14d1ef||0x1f4;return function(_0x30ed70){logger['error'](_0x30ed70[_0x2ff2('0x36')]);if(_0x30ed70[_0x2ff2('0x37')]){delete _0x30ed70['name'];}_0x1dfc25[_0x2ff2('0x27')](_0x14d1ef)[_0x2ff2('0x38')](_0x30ed70);};}exports[_0x2ff2('0x39')]=function(_0x4bd805,_0x2863da){var _0x5d4fde={},_0x431a8f={},_0xaac9b3={'count':0x0,'rows':[]};var _0x5275ab=_['map'](db[_0x2ff2('0x3a')][_0x2ff2('0x3b')],function(_0x24c296){return{'name':_0x24c296[_0x2ff2('0x3c')],'type':_0x24c296[_0x2ff2('0x3d')][_0x2ff2('0x3e')]};});_0x431a8f[_0x2ff2('0x3f')]=_[_0x2ff2('0x40')](_0x5275ab,_0x2ff2('0x37'));_0x431a8f[_0x2ff2('0x41')]=_['keys'](_0x4bd805[_0x2ff2('0x41')]);_0x431a8f[_0x2ff2('0x42')]=_[_0x2ff2('0x43')](_0x431a8f[_0x2ff2('0x3f')],_0x431a8f[_0x2ff2('0x41')]);_0x5d4fde[_0x2ff2('0x44')]=_['intersection'](_0x431a8f[_0x2ff2('0x3f')],qs['fields'](_0x4bd805[_0x2ff2('0x41')][_0x2ff2('0x45')]));_0x5d4fde[_0x2ff2('0x44')]=_0x5d4fde[_0x2ff2('0x44')]['length']?_0x5d4fde[_0x2ff2('0x44')]:_0x431a8f[_0x2ff2('0x3f')];if(!_0x4bd805['query'][_0x2ff2('0x46')](_0x2ff2('0x47'))){_0x5d4fde[_0x2ff2('0x29')]=qs[_0x2ff2('0x29')](_0x4bd805[_0x2ff2('0x41')]['limit']);_0x5d4fde[_0x2ff2('0x2c')]=qs[_0x2ff2('0x2c')](_0x4bd805[_0x2ff2('0x41')][_0x2ff2('0x2c')]);}_0x5d4fde[_0x2ff2('0x48')]=qs['sort'](_0x4bd805[_0x2ff2('0x41')][_0x2ff2('0x49')]);_0x5d4fde['where']=qs[_0x2ff2('0x42')](_[_0x2ff2('0x4a')](_0x4bd805['query'],_0x431a8f['filters']),_0x5275ab);if(_0x4bd805['query'][_0x2ff2('0x4b')]){_0x5d4fde[_0x2ff2('0x4c')]=_['merge'](_0x5d4fde[_0x2ff2('0x4c')],{'$or':_[_0x2ff2('0x40')](_0x5275ab,function(_0xb198ee){if(_0xb198ee['type']!==_0x2ff2('0x4d')){var _0xe5995d={};_0xe5995d[_0xb198ee[_0x2ff2('0x37')]]={'$like':'%'+_0x4bd805[_0x2ff2('0x41')][_0x2ff2('0x4b')]+'%'};return _0xe5995d;}})});}_0x5d4fde=_['merge']({},_0x5d4fde,_0x4bd805['options']);var _0x306f1b={'where':_0x5d4fde[_0x2ff2('0x4c')]};return db[_0x2ff2('0x3a')][_0x2ff2('0x2b')](_0x306f1b)['then'](function(_0x3a7330){_0xaac9b3[_0x2ff2('0x2b')]=_0x3a7330;if(_0x4bd805[_0x2ff2('0x41')][_0x2ff2('0x4e')]){_0x5d4fde[_0x2ff2('0x4f')]=[{'all':!![]}];}return db[_0x2ff2('0x3a')][_0x2ff2('0x50')](_0x5d4fde);})['then'](function(_0x2f8c9a){_0xaac9b3[_0x2ff2('0x51')]=_0x2f8c9a;return _0xaac9b3;})['then'](respondWithFilteredResult(_0x2863da,_0x5d4fde))[_0x2ff2('0x52')](handleError(_0x2863da,null));};exports[_0x2ff2('0x53')]=function(_0x4ecc94,_0x556a3){var _0x98ced7={'raw':!![],'where':{'id':_0x4ecc94[_0x2ff2('0x54')]['id']}},_0x359358={};_0x359358[_0x2ff2('0x3f')]=_['keys'](db[_0x2ff2('0x3a')][_0x2ff2('0x3b')]);_0x359358[_0x2ff2('0x41')]=_[_0x2ff2('0x55')](_0x4ecc94[_0x2ff2('0x41')]);_0x359358[_0x2ff2('0x42')]=_[_0x2ff2('0x43')](_0x359358['model'],_0x359358[_0x2ff2('0x41')]);_0x98ced7[_0x2ff2('0x44')]=_[_0x2ff2('0x43')](_0x359358[_0x2ff2('0x3f')],qs['fields'](_0x4ecc94[_0x2ff2('0x41')][_0x2ff2('0x45')]));_0x98ced7['attributes']=_0x98ced7['attributes'][_0x2ff2('0x56')]?_0x98ced7[_0x2ff2('0x44')]:_0x359358['model'];if(_0x4ecc94[_0x2ff2('0x41')][_0x2ff2('0x4e')]){_0x98ced7[_0x2ff2('0x4f')]=[{'all':!![]}];}_0x98ced7=_[_0x2ff2('0x57')]({},_0x98ced7,_0x4ecc94[_0x2ff2('0x58')]);return db[_0x2ff2('0x3a')][_0x2ff2('0x59')](_0x98ced7)[_0x2ff2('0x32')](handleEntityNotFound(_0x556a3,null))['then'](respondWithResult(_0x556a3,null))[_0x2ff2('0x52')](handleError(_0x556a3,null));};exports[_0x2ff2('0x5a')]=function(_0xdde6ac,_0x269ea9,_0x211234){return db[_0x2ff2('0x3a')][_0x2ff2('0x59')]({'where':{'id':_0xdde6ac[_0x2ff2('0x54')]['id']},'attributes':[_0x2ff2('0x37'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x269ea9,null))[_0x2ff2('0x32')](function(_0x5bfcc7){if(_0x5bfcc7){var _0xbc5e01=path[_0x2ff2('0x5b')](config[_0x2ff2('0x5c')],_0x2ff2('0x5d'),util[_0x2ff2('0x5e')](_0x2ff2('0x5f'),path['basename'](_0x5bfcc7[_0x2ff2('0x8')])));var _0x45fccb=fs[_0x2ff2('0x60')](_0xbc5e01);var _0x16c49e=archiver(_0x2ff2('0x61'),{'zlib':{'level':0x9}});_0x16c49e['on']('warning',function(_0xe7342e){if(_0xe7342e[_0x2ff2('0x62')]===_0x2ff2('0x63')){logger[_0x2ff2('0x64')](_0xe7342e);}else{throw new db[(_0x2ff2('0x65'))]['Error'](_0x2ff2('0x66'));}});_0x16c49e['on'](_0x2ff2('0x64'),function(_0x3885ff){throw new db[(_0x2ff2('0x65'))][(_0x2ff2('0x67'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x16c49e[_0x2ff2('0x68')](_0x45fccb);_0x16c49e[_0x2ff2('0x69')](_0x2ff2('0x6a'),{'cwd':path['join'](config[_0x2ff2('0x5c')],_0x2ff2('0x5d'),path[_0x2ff2('0x6b')](_0x5bfcc7[_0x2ff2('0x8')])),'ignore':[path[_0x2ff2('0x5b')](path['basename'](_0x5bfcc7[_0x2ff2('0x8')]),'node_modules/**/*'),path[_0x2ff2('0x5b')](path['basename'](_0x5bfcc7[_0x2ff2('0x8')]),_0x2ff2('0x6c'))],'nodir':!![]})['finalize']();_0x45fccb['on']('close',function(){if(!fs[_0x2ff2('0x6d')](_0xbc5e01)){throw new db[(_0x2ff2('0x65'))][(_0x2ff2('0x67'))](_0x2ff2('0x6e'));}return _0x269ea9[_0x2ff2('0x5a')](_0xbc5e01,util['format']('%s.zip',path[_0x2ff2('0x6f')](_0x5bfcc7[_0x2ff2('0x8')])),function(_0x1be154){if(_0x1be154){throw new db[(_0x2ff2('0x65'))][(_0x2ff2('0x67'))](_0x2ff2('0x70'));}fs[_0x2ff2('0x71')](_0xbc5e01);logger[_0x2ff2('0x72')]('Download\x20completed');logger['info'](_0x2ff2('0x73'));});});}return null;})['catch'](handleError(_0x269ea9,null));};exports[_0x2ff2('0x74')]=function(_0x523711,_0x104151,_0x46c7ed){var _0x12eb5f=path[_0x2ff2('0x6f')](_0x523711[_0x2ff2('0x75')]['filename'],path[_0x2ff2('0x76')](_0x523711[_0x2ff2('0x75')][_0x2ff2('0x77')]));var _0x5aa4d4=path[_0x2ff2('0x5b')](config[_0x2ff2('0x5c')],'server/files/plugins',_0x523711[_0x2ff2('0x75')][_0x2ff2('0x77')]);var _0x237faa=path[_0x2ff2('0x5b')](config[_0x2ff2('0x5c')],_0x2ff2('0x5d'),_0x12eb5f);logger[_0x2ff2('0x72')](_0x2ff2('0x78'),_0x5aa4d4);logger[_0x2ff2('0x72')](_0x2ff2('0x79'),_0x237faa);try{fs[_0x2ff2('0x7a')](_0x5aa4d4,parseInt('0777',0x8));extract(_0x5aa4d4,{'dir':_0x237faa},function(_0x542116){if(_0x542116){logger[_0x2ff2('0x64')](_0x542116);handleError(_0x542116,!![]);};var _0x62fe15=fs[_0x2ff2('0x7b')](_0x237faa);if(_0x62fe15[_0x2ff2('0x56')]>0x1){removeReferences(_0x5aa4d4,_0x237faa);logger[_0x2ff2('0x64')](_0x2ff2('0x7c'));return _0x46c7ed(new Error(_0x2ff2('0x7c')));}var _0xa6f17b=fs['lstatSync'](path['join'](_0x237faa,_0x62fe15[0x0]));if(_0xa6f17b[_0x2ff2('0x7d')]()){removeReferences(_0x5aa4d4,_0x237faa);logger[_0x2ff2('0x64')]('Invalid\x20plugin\x20structure');return _0x46c7ed(new Error(_0x2ff2('0x7c')));}if(_0xa6f17b['isDirectory']()){var _0x4a8a09=fs[_0x2ff2('0x7b')](path[_0x2ff2('0x5b')](_0x237faa,_0x62fe15[0x0]));if(_0x4a8a09[_0x2ff2('0x56')]===0x0){removeReferences(_0x5aa4d4,_0x237faa);logger[_0x2ff2('0x64')](_0x2ff2('0x7c'));return _0x46c7ed(new Error('Invalid\x20plugin\x20structure'));}var _0xcc3c4a=_0x4a8a09[_0x2ff2('0x7e')](function(_0x2d1304){return _0x2d1304==='manifest.json';});if(!_0xcc3c4a){return _0x46c7ed(new Error(_0x2ff2('0x7f')));}var _0x406f71=fs[_0x2ff2('0x80')](path[_0x2ff2('0x5b')](_0x237faa,_0x62fe15[0x0],_0x2ff2('0x81')));var _0x8e0ffe=JSON['parse'](_0x406f71);if('undefined'==typeof _0x8e0ffe[_0x2ff2('0x37')]){return _0x46c7ed(new Error(_0x2ff2('0x82')));}if('undefined'==typeof _0x8e0ffe['type']){return _0x46c7ed(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x2ff2('0x2a')==typeof _0x8e0ffe[_0x2ff2('0x83')]){return _0x46c7ed(new Error(_0x2ff2('0x84')));}if(_0x2ff2('0x2a')==typeof _0x8e0ffe[_0x2ff2('0x85')]){return _0x46c7ed(new Error(_0x2ff2('0x86')));}if(_0x8e0ffe[_0x2ff2('0x3d')]===_0x2ff2('0x87')){if(_0x2ff2('0x2a')==typeof _0x8e0ffe['parameters'][_0x2ff2('0x88')]){return _0x46c7ed(new Error(_0x2ff2('0x89')));}if(_0x2ff2('0x2a')==typeof _0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')]['admin']&&_0x2ff2('0x2a')==typeof _0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')][_0x2ff2('0x8a')]){return _0x46c7ed(new Error(_0x2ff2('0x8b')));}}else if(_0x8e0ffe['type']===_0x2ff2('0x8c')){if(_0x2ff2('0x2a')==typeof _0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x8d')]){return _0x46c7ed(new Error(_0x2ff2('0x8e')));}if(_0x2ff2('0x2a')==typeof _0x8e0ffe[_0x2ff2('0x85')]['scriptPath']){return _0x46c7ed(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x46c7ed(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x13ee5e=_0x8e0ffe[_0x2ff2('0x37')];var _0xb35e93=_0x8e0ffe[_0x2ff2('0x8f')];var _0x44a7dd=_0x8e0ffe[_0x2ff2('0x3d')];var _0x18b0df=_0x8e0ffe[_0x2ff2('0x90')]?_0x8e0ffe[_0x2ff2('0x90')]:_0x2ff2('0x91');var _0x3efa15=_0x8e0ffe[_0x2ff2('0x92')]?_0x8e0ffe[_0x2ff2('0x92')]:'icon-apps';var _0xe6a94='';var _0x431c1d='';var _0x3b9cba='';var _0x15ab66='';var _0x1fda53=_0x8e0ffe[_0x2ff2('0x83')];if(_0x44a7dd===_0x2ff2('0x87')){if(_0x2ff2('0x2a')!=typeof _0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')][_0x2ff2('0x93')]){var _0x1b259b=_0x8e0ffe['parameters']['views'][_0x2ff2('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x2ff2('0x94')](_0x1b259b)){_0xe6a94=path['join'](_0x2ff2('0x95'),_0x12eb5f,_0x62fe15[0x0],_0x1b259b);}else{_0xe6a94=_0x1b259b;}}else{logger['info'](_0x2ff2('0x96'));}if(_0x2ff2('0x2a')!=typeof _0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')]['agent']){var _0x17ab5a=_0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')][_0x2ff2('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x2ff2('0x94')](_0x17ab5a)){_0x431c1d=path[_0x2ff2('0x5b')](_0x2ff2('0x95'),_0x12eb5f,_0x62fe15[0x0],_0x17ab5a);}else{_0x431c1d=_0x17ab5a;}}else{logger[_0x2ff2('0x72')](_0x2ff2('0x97'));}}else if(_0x44a7dd===_0x2ff2('0x8c')){_0x3b9cba=_0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x8d')];_0x15ab66=_0x8e0ffe['parameters'][_0x2ff2('0x98')];if(_0x2ff2('0x2a')!=typeof _0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')]){if(_0x2ff2('0x2a')!=typeof _0x8e0ffe['parameters'][_0x2ff2('0x88')][_0x2ff2('0x93')]){var _0x1b259b=_0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x2ff2('0x94')](_0x1b259b)){_0xe6a94=path['join'](_0x2ff2('0x95'),_0x12eb5f,_0x62fe15[0x0],_0x1b259b);}else{_0xe6a94=_0x1b259b;}}if(_0x2ff2('0x2a')!=typeof _0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')][_0x2ff2('0x8a')]){var _0x17ab5a=_0x8e0ffe[_0x2ff2('0x85')][_0x2ff2('0x88')][_0x2ff2('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x2ff2('0x94')](_0x17ab5a)){_0x431c1d=path[_0x2ff2('0x5b')](_0x2ff2('0x95'),_0x12eb5f,_0x62fe15[0x0],_0x17ab5a);}else{_0x431c1d=_0x17ab5a;}}}}var _0x264094={'name':_0x13ee5e,'description':_0xb35e93,'path':path[_0x2ff2('0x5b')](_0x12eb5f,_0x62fe15[0x0]),'type':_0x44a7dd,'sidebar':_0x18b0df,'icon':_0x3efa15,'adminUrl':_0xe6a94,'agentUrl':_0x431c1d,'scriptName':_0x3b9cba,'scriptPath':_0x15ab66,'version':_0x1fda53};removeReferences(_0x5aa4d4,null);return db[_0x2ff2('0x3a')]['create'](_0x264094)[_0x2ff2('0x32')](function(_0xe3bc76){var _0x2f4067={'role':_0x523711[_0x2ff2('0x99')][_0x2ff2('0x9a')],'userProfileId':_0x523711[_0x2ff2('0x99')][_0x2ff2('0x9b')]};if(!_0x2f4067)throw new Error(_0x2ff2('0x9c'));if(_0x2f4067[_0x2ff2('0x9a')]===_0x2ff2('0x9d')){var _0x14c056=_0xe3bc76[_0x2ff2('0x9e')]({'plain':!![]});return db[_0x2ff2('0x9f')][_0x2ff2('0x59')]({'where':{'name':_0x2ff2('0x34'),'userProfileId':_0x2f4067[_0x2ff2('0x9b')]},'raw':!![]})[_0x2ff2('0x32')](function(_0x38ebcd){if(_0x38ebcd&&_0x38ebcd[_0x2ff2('0xa0')]===0x0){return db[_0x2ff2('0x35')][_0x2ff2('0xa1')]({'name':_0x14c056['name'],'resourceId':_0x14c056['id'],'type':_0x38ebcd[_0x2ff2('0x37')],'sectionId':_0x38ebcd['id']},{})[_0x2ff2('0x32')](function(){return _0xe3bc76;});}else{return _0xe3bc76;}})[_0x2ff2('0x52')](function(_0x3256bd){logger['error'](_0x2ff2('0xa2'),_0x3256bd);throw _0x3256bd;});}return _0xe3bc76;})[_0x2ff2('0x32')](respondWithResult(_0x104151,null))['catch'](handleError(_0x104151,null));}});}catch(_0x52b4bf){_0x104151['status'](0x1f4)['send'](_0x52b4bf);}};function removeReferences(_0x159d93,_0x5c6620){try{if(_0x159d93){fs['unlinkSync'](_0x159d93);logger[_0x2ff2('0x72')](_0x2ff2('0xa3'));}if(_0x5c6620){rimraf(_0x5c6620,function(){});logger[_0x2ff2('0x72')]('Extracted\x20folder\x20removed');}}catch(_0x179c01){logger[_0x2ff2('0x64')](_0x179c01);}}exports[_0x2ff2('0xa4')]=function(_0x5e4eb9,_0x12c02a,_0xef0046){return db[_0x2ff2('0x3a')][_0x2ff2('0x59')]({'where':{'id':_0x5e4eb9['params']['id']}})[_0x2ff2('0x32')](handleEntityNotFound(_0x12c02a,null))[_0x2ff2('0x32')](saveUpdates(_0x5e4eb9[_0x2ff2('0x99')],null))[_0x2ff2('0x32')](respondWithResult(_0x12c02a,null))['catch'](handleError(_0x12c02a,null));};exports['delete']=function(_0x443477,_0x1bc6ed,_0x426bb2){return db[_0x2ff2('0x3a')]['find']({'where':{'id':_0x443477[_0x2ff2('0x54')]['id']}})['then'](function(_0x20d481){if(_0x20d481){return _0x20d481[_0x2ff2('0x33')]();}})[_0x2ff2('0x32')](function(_0x160137){rimraf(path['join'](config[_0x2ff2('0x5c')],_0x2ff2('0x5d'),path['dirname'](_0x160137[_0x2ff2('0x8')])),function(){});return _0x160137;})[_0x2ff2('0x32')](handleEntityNotFound(_0x1bc6ed,null))[_0x2ff2('0x32')](respondWithStatusCode(_0x1bc6ed,null))['catch'](handleError(_0x1bc6ed,null));};exports[_0x2ff2('0xa5')]=function(_0x145114,_0x1fa955,_0x411d2f){return BPromise['resolve']()[_0x2ff2('0x32')](function(){if(!_0x145114[_0x2ff2('0x41')][_0x2ff2('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x145114['query'][_0x2ff2('0xa6')]){throw new Error(_0x2ff2('0xa7'));}var _0x43817e=_0x145114[_0x2ff2('0x41')][_0x2ff2('0xa8')]?_0x145114[_0x2ff2('0x41')]['hostname']+':'+_0x145114['query'][_0x2ff2('0xa6')]:_0x2ff2('0xa9')+_0x145114[_0x2ff2('0x41')][_0x2ff2('0xa6')];var _0x3fa6a9=_0x145114[_0x2ff2('0x41')][_0x2ff2('0x28')]?_0x145114['query'][_0x2ff2('0x28')]:!![];var _0x331d67=_0x145114['query'][_0x2ff2('0xaa')]?_0x145114[_0x2ff2('0x41')][_0x2ff2('0xaa')]:null;var _0xb8df18={'method':_0x145114['method'],'uri':util[_0x2ff2('0x5e')]('%s%s',_0x43817e,_0x145114['query'][_0x2ff2('0x8')]),'json':_0x3fa6a9,'resolveWithFullResponse':!![],'encoding':_0x331d67,'qs':_0x145114[_0x2ff2('0x41')]};if(_0x145114[_0x2ff2('0xab')]){_0xb8df18['headers']=_0x145114['headers'];if(_0xb8df18[_0x2ff2('0xab')][_0x2ff2('0xac')]){delete _0xb8df18[_0x2ff2('0xab')][_0x2ff2('0xac')];}}if(_0xb8df18[_0x2ff2('0xab')]['content-type']){delete _0xb8df18[_0x2ff2('0xab')][_0x2ff2('0xad')];}return rp(_0xb8df18);})['then'](function(_0x42c7f7){if(_0x42c7f7){_0x1fa955[_0x2ff2('0x2d')](_0x42c7f7['headers']);logger[_0x2ff2('0x72')](_0x42c7f7[_0x2ff2('0x99')]);if(_[_0x2ff2('0xae')](_0x145114[_0x2ff2('0x41')]['path'],'download')&&_0x42c7f7[_0x2ff2('0xaf')]==0x1f4){return _0x1fa955[_0x2ff2('0x25')](_0x42c7f7[_0x2ff2('0xaf')]);}else{return _0x1fa955[_0x2ff2('0x27')](_0x42c7f7[_0x2ff2('0xaf')])[_0x2ff2('0x38')](_0x42c7f7[_0x2ff2('0x99')]);}}else{return _0x1fa955[_0x2ff2('0x25')](0xc8);}})[_0x2ff2('0x52')](handleError(_0x1fa955,null));};exports[_0x2ff2('0xb0')]=function(_0x5e007a,_0x394725,_0x3c3c77){return BPromise[_0x2ff2('0xb1')]()[_0x2ff2('0x32')](function(){if(!_0x5e007a[_0x2ff2('0x41')]['path']){throw new Error(_0x2ff2('0xb2'));}if(!_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0xa6')]){throw new Error(_0x2ff2('0xa7'));}var _0x452c62=_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0xa8')]?_0x5e007a['query'][_0x2ff2('0xa8')]+':'+_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0xa6')]:_0x2ff2('0xa9')+_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0xa6')];var _0x52e110=_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0x28')]?_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0x28')]:!![];var _0x326bbf=_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0xaa')]?_0x5e007a['query'][_0x2ff2('0xaa')]:null;var _0x586956={'method':_0x5e007a[_0x2ff2('0xb3')],'uri':util[_0x2ff2('0x5e')]('%s%s',_0x452c62,_0x5e007a[_0x2ff2('0x41')][_0x2ff2('0x8')]),'json':_0x52e110,'resolveWithFullResponse':!![],'encoding':_0x326bbf,'body':_0x5e007a['body']};if(_0x5e007a[_0x2ff2('0xab')]){_0x586956[_0x2ff2('0xab')]=_0x5e007a[_0x2ff2('0xab')];if(_0x586956[_0x2ff2('0xab')]['content-length']){delete _0x586956[_0x2ff2('0xab')][_0x2ff2('0xac')];}}if(_0x586956['headers']['content-type']){delete _0x586956[_0x2ff2('0xab')][_0x2ff2('0xad')];}return rp(_0x586956);})[_0x2ff2('0x32')](function(_0x5f2772){if(_0x5f2772){_0x394725[_0x2ff2('0x2d')](_0x5f2772[_0x2ff2('0xab')]);logger[_0x2ff2('0x72')](_0x5f2772[_0x2ff2('0x99')]);return _0x394725['status'](_0x5f2772[_0x2ff2('0xaf')])['send'](_0x5f2772[_0x2ff2('0x99')]);}else{return _0x394725[_0x2ff2('0x25')](0xc8);}})['catch'](handleError(_0x394725,null));}; \ No newline at end of file +var _0x505a=['order','sort','where','pick','filter','merge','count','include','rows','catch','find','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','role','body','user','get','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','method','%s%s','headers','content-length','content-type','endsWith','statusCode','sendStatus','send','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','error','stack','name','index','Plugin','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x18ff75,_0x599762){var _0x3d283e=function(_0x52b657){while(--_0x52b657){_0x18ff75['push'](_0x18ff75['shift']());}};_0x3d283e(++_0x599762);}(_0x505a,0x6b));var _0xa505=function(_0x36cbae,_0x266039){_0x36cbae=_0x36cbae-0x0;var _0x2cdd1e=_0x505a[_0x36cbae];return _0x2cdd1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa505('0x0'));var jsonpatch=require(_0xa505('0x1'));var rp=require('request-promise');var moment=require(_0xa505('0x2'));var BPromise=require(_0xa505('0x3'));var Mustache=require(_0xa505('0x4'));var util=require('util');var path=require(_0xa505('0x5'));var sox=require('sox');var csv=require(_0xa505('0x6'));var ejs=require(_0xa505('0x7'));var fs=require('fs');var fs_extra=require(_0xa505('0x8'));var _=require(_0xa505('0x9'));var squel=require(_0xa505('0xa'));var crypto=require(_0xa505('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa505('0xc'));var toCsv=require(_0xa505('0x6'));var querystring=require('querystring');var Papa=require(_0xa505('0xd'));var extract=require('extract-zip');var rimraf=require(_0xa505('0xe'));var archiver=require(_0xa505('0xf'));var Redis=require(_0xa505('0x10'));var authService=require(_0xa505('0x11'));var qs=require(_0xa505('0x12'));var as=require(_0xa505('0x13'));var hardwareService=require(_0xa505('0x14'));var logger=require('../../config/logger')(_0xa505('0x15'));var utils=require(_0xa505('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa505('0x17'));var db=require(_0xa505('0x18'))['db'];config[_0xa505('0x19')]=_[_0xa505('0x1a')](config[_0xa505('0x19')],{'host':_0xa505('0x1b'),'port':0x18eb});var socket=require(_0xa505('0x1c'))(new Redis(config[_0xa505('0x19')]));require(_0xa505('0x1d'))[_0xa505('0x1e')](socket);function respondWithStatusCode(_0x20e83b,_0x200232){_0x200232=_0x200232||0xcc;return function(_0x361881){if(_0x361881){return _0x20e83b['sendStatus'](_0x200232);}return _0x20e83b[_0xa505('0x1f')](_0x200232)[_0xa505('0x20')]();};}function respondWithResult(_0x2af741,_0x510eb6){_0x510eb6=_0x510eb6||0xc8;return function(_0x594174){if(_0x594174){return _0x2af741[_0xa505('0x1f')](_0x510eb6)['json'](_0x594174);}};}function respondWithFilteredResult(_0x4c0af6,_0x1efe55){return function(_0x13ecfe){if(_0x13ecfe){var _0x92f7=typeof _0x1efe55[_0xa505('0x21')]===_0xa505('0x22')&&typeof _0x1efe55[_0xa505('0x23')]===_0xa505('0x22');var _0x6c84ab=_0x13ecfe['count'];var _0x445dd1=_0x92f7?0x0:_0x1efe55[_0xa505('0x21')];var _0x37ff33=_0x92f7?_0x13ecfe['count']:_0x1efe55[_0xa505('0x21')]+_0x1efe55[_0xa505('0x23')];var _0x21d2fc;if(_0x37ff33>=_0x6c84ab){_0x37ff33=_0x6c84ab;_0x21d2fc=0xc8;}else{_0x21d2fc=0xce;}_0x4c0af6[_0xa505('0x1f')](_0x21d2fc);return _0x4c0af6[_0xa505('0x24')]('Content-Range',_0x445dd1+'-'+_0x37ff33+'/'+_0x6c84ab)[_0xa505('0x25')](_0x13ecfe);}return null;};}function patchUpdates(_0xc56411){return function(_0x2ce39a){try{jsonpatch[_0xa505('0x26')](_0x2ce39a,_0xc56411,!![]);}catch(_0x124f92){return BPromise[_0xa505('0x27')](_0x124f92);}return _0x2ce39a[_0xa505('0x28')]();};}function saveUpdates(_0x7eb2e2,_0x3f85f5){return function(_0x193d70){if(_0x193d70){return _0x193d70[_0xa505('0x29')](_0x7eb2e2)[_0xa505('0x2a')](function(_0x5943ec){return _0x5943ec;});}return null;};}function removeEntity(_0x2520a2,_0x122159){return function(_0x45e9b4){if(_0x45e9b4){return _0x45e9b4[_0xa505('0x2b')]()['then'](function(){var _0x1a50f5=_0x45e9b4['get']({'plain':!![]});var _0x325235=_0xa505('0x2c');return db[_0xa505('0x2d')][_0xa505('0x2b')]({'where':{'type':_0x325235,'resourceId':_0x1a50f5['id']}})['then'](function(){return _0x45e9b4;});})[_0xa505('0x2a')](function(){_0x2520a2[_0xa505('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3558e1,_0x3336b3){return function(_0x1b9856){if(!_0x1b9856){_0x3558e1['sendStatus'](0x194);}return _0x1b9856;};}function handleError(_0x3f6be7,_0x193869){_0x193869=_0x193869||0x1f4;return function(_0x404fe3){logger[_0xa505('0x2e')](_0x404fe3[_0xa505('0x2f')]);if(_0x404fe3[_0xa505('0x30')]){delete _0x404fe3[_0xa505('0x30')];}_0x3f6be7['status'](_0x193869)['send'](_0x404fe3);};}exports[_0xa505('0x31')]=function(_0x1c10b1,_0x26c67e){var _0x38bebb={},_0x242ab0={},_0xc368a4={'count':0x0,'rows':[]};var _0x45d04d=_['map'](db[_0xa505('0x32')][_0xa505('0x33')],function(_0x2ce337){return{'name':_0x2ce337[_0xa505('0x34')],'type':_0x2ce337[_0xa505('0x35')][_0xa505('0x36')]};});_0x242ab0[_0xa505('0x37')]=_[_0xa505('0x38')](_0x45d04d,'name');_0x242ab0['query']=_[_0xa505('0x39')](_0x1c10b1[_0xa505('0x3a')]);_0x242ab0[_0xa505('0x3b')]=_[_0xa505('0x3c')](_0x242ab0[_0xa505('0x37')],_0x242ab0[_0xa505('0x3a')]);_0x38bebb[_0xa505('0x3d')]=_[_0xa505('0x3c')](_0x242ab0[_0xa505('0x37')],qs[_0xa505('0x3e')](_0x1c10b1[_0xa505('0x3a')][_0xa505('0x3e')]));_0x38bebb['attributes']=_0x38bebb['attributes'][_0xa505('0x3f')]?_0x38bebb[_0xa505('0x3d')]:_0x242ab0[_0xa505('0x37')];if(!_0x1c10b1[_0xa505('0x3a')][_0xa505('0x40')]('nolimit')){_0x38bebb[_0xa505('0x23')]=qs[_0xa505('0x23')](_0x1c10b1[_0xa505('0x3a')][_0xa505('0x23')]);_0x38bebb['offset']=qs['offset'](_0x1c10b1[_0xa505('0x3a')][_0xa505('0x21')]);}_0x38bebb[_0xa505('0x41')]=qs[_0xa505('0x42')](_0x1c10b1[_0xa505('0x3a')]['sort']);_0x38bebb[_0xa505('0x43')]=qs[_0xa505('0x3b')](_[_0xa505('0x44')](_0x1c10b1[_0xa505('0x3a')],_0x242ab0[_0xa505('0x3b')]),_0x45d04d);if(_0x1c10b1['query'][_0xa505('0x45')]){_0x38bebb['where']=_[_0xa505('0x46')](_0x38bebb[_0xa505('0x43')],{'$or':_['map'](_0x45d04d,function(_0x3a59f6){if(_0x3a59f6['type']!=='VIRTUAL'){var _0x1cae96={};_0x1cae96[_0x3a59f6[_0xa505('0x30')]]={'$like':'%'+_0x1c10b1[_0xa505('0x3a')]['filter']+'%'};return _0x1cae96;}})});}_0x38bebb=_[_0xa505('0x46')]({},_0x38bebb,_0x1c10b1['options']);var _0x192a20={'where':_0x38bebb[_0xa505('0x43')]};return db[_0xa505('0x32')][_0xa505('0x47')](_0x192a20)[_0xa505('0x2a')](function(_0x22ae58){_0xc368a4[_0xa505('0x47')]=_0x22ae58;if(_0x1c10b1[_0xa505('0x3a')]['includeAll']){_0x38bebb[_0xa505('0x48')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x38bebb);})[_0xa505('0x2a')](function(_0x7ce201){_0xc368a4[_0xa505('0x49')]=_0x7ce201;return _0xc368a4;})['then'](respondWithFilteredResult(_0x26c67e,_0x38bebb))[_0xa505('0x4a')](handleError(_0x26c67e,null));};exports['show']=function(_0x46a1ff,_0x1a8d65){var _0x1d163b={'raw':!![],'where':{'id':_0x46a1ff['params']['id']}},_0x2e38f0={};_0x2e38f0[_0xa505('0x37')]=_[_0xa505('0x39')](db[_0xa505('0x32')][_0xa505('0x33')]);_0x2e38f0[_0xa505('0x3a')]=_[_0xa505('0x39')](_0x46a1ff['query']);_0x2e38f0[_0xa505('0x3b')]=_[_0xa505('0x3c')](_0x2e38f0['model'],_0x2e38f0[_0xa505('0x3a')]);_0x1d163b[_0xa505('0x3d')]=_['intersection'](_0x2e38f0['model'],qs[_0xa505('0x3e')](_0x46a1ff[_0xa505('0x3a')][_0xa505('0x3e')]));_0x1d163b[_0xa505('0x3d')]=_0x1d163b['attributes'][_0xa505('0x3f')]?_0x1d163b[_0xa505('0x3d')]:_0x2e38f0['model'];if(_0x46a1ff[_0xa505('0x3a')]['includeAll']){_0x1d163b['include']=[{'all':!![]}];}_0x1d163b=_[_0xa505('0x46')]({},_0x1d163b,_0x46a1ff['options']);return db['Plugin'][_0xa505('0x4b')](_0x1d163b)[_0xa505('0x2a')](handleEntityNotFound(_0x1a8d65,null))[_0xa505('0x2a')](respondWithResult(_0x1a8d65,null))[_0xa505('0x4a')](handleError(_0x1a8d65,null));};exports['download']=function(_0x142a18,_0x394b48,_0x1e577b){return db[_0xa505('0x32')][_0xa505('0x4b')]({'where':{'id':_0x142a18[_0xa505('0x4c')]['id']},'attributes':[_0xa505('0x30'),_0xa505('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x394b48,null))[_0xa505('0x2a')](function(_0x23fd25){if(_0x23fd25){var _0x551131=path[_0xa505('0x4d')](config[_0xa505('0x4e')],_0xa505('0x4f'),util[_0xa505('0x50')](_0xa505('0x51'),path[_0xa505('0x52')](_0x23fd25[_0xa505('0x5')])));var _0xceae44=fs[_0xa505('0x53')](_0x551131);var _0x30179a=archiver('zip',{'zlib':{'level':0x9}});_0x30179a['on'](_0xa505('0x54'),function(_0x34b77f){if(_0x34b77f['code']===_0xa505('0x55')){logger['error'](_0x34b77f);}else{throw new db[(_0xa505('0x56'))]['Error'](_0xa505('0x57'));}});_0x30179a['on'](_0xa505('0x2e'),function(_0x528979){throw new db['Sequelize'][(_0xa505('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x30179a['pipe'](_0xceae44);_0x30179a[_0xa505('0x59')](_0xa505('0x5a'),{'cwd':path[_0xa505('0x4d')](config[_0xa505('0x4e')],_0xa505('0x4f'),path['dirname'](_0x23fd25[_0xa505('0x5')])),'ignore':[path[_0xa505('0x4d')](path[_0xa505('0x52')](_0x23fd25['path']),_0xa505('0x5b')),path[_0xa505('0x4d')](path[_0xa505('0x52')](_0x23fd25[_0xa505('0x5')]),_0xa505('0x5c'))],'nodir':!![]})[_0xa505('0x5d')]();_0xceae44['on'](_0xa505('0x5e'),function(){if(!fs[_0xa505('0x5f')](_0x551131)){throw new db[(_0xa505('0x56'))][(_0xa505('0x58'))]('Plugin\x20not\x20found');}return _0x394b48[_0xa505('0x60')](_0x551131,util[_0xa505('0x50')]('%s.zip',path['basename'](_0x23fd25[_0xa505('0x5')])),function(_0x26d9ce){if(_0x26d9ce){throw new db[(_0xa505('0x56'))]['Error'](_0xa505('0x61'));}fs[_0xa505('0x62')](_0x551131);logger[_0xa505('0x63')]('Download\x20completed');logger[_0xa505('0x63')]('Temporary\x20file\x20removed');});});}return null;})[_0xa505('0x4a')](handleError(_0x394b48,null));};exports[_0xa505('0x64')]=function(_0x2cd1cb,_0x318afc,_0x446d15){var _0x34c20c=path[_0xa505('0x52')](_0x2cd1cb[_0xa505('0x65')]['filename'],path[_0xa505('0x66')](_0x2cd1cb[_0xa505('0x65')][_0xa505('0x67')]));var _0x440cd5=path[_0xa505('0x4d')](config[_0xa505('0x4e')],_0xa505('0x4f'),_0x2cd1cb[_0xa505('0x65')][_0xa505('0x67')]);var _0x420d12=path[_0xa505('0x4d')](config[_0xa505('0x4e')],'server/files/plugins',_0x34c20c);logger[_0xa505('0x63')](_0xa505('0x68'),_0x440cd5);logger[_0xa505('0x63')](_0xa505('0x69'),_0x420d12);try{fs[_0xa505('0x6a')](_0x440cd5,parseInt(_0xa505('0x6b'),0x8));extract(_0x440cd5,{'dir':_0x420d12},function(_0x2acc72){if(_0x2acc72){logger[_0xa505('0x2e')](_0x2acc72);handleError(_0x2acc72,!![]);};var _0x5dc33c=fs[_0xa505('0x6c')](_0x420d12);if(_0x5dc33c[_0xa505('0x3f')]>0x1){removeReferences(_0x440cd5,_0x420d12);logger['error'](_0xa505('0x6d'));return _0x446d15(new Error(_0xa505('0x6d')));}var _0x5ec763=fs[_0xa505('0x6e')](path['join'](_0x420d12,_0x5dc33c[0x0]));if(_0x5ec763[_0xa505('0x6f')]()){removeReferences(_0x440cd5,_0x420d12);logger['error'](_0xa505('0x6d'));return _0x446d15(new Error('Invalid\x20plugin\x20structure'));}if(_0x5ec763[_0xa505('0x70')]()){var _0x21e4a1=fs[_0xa505('0x6c')](path['join'](_0x420d12,_0x5dc33c[0x0]));if(_0x21e4a1['length']===0x0){removeReferences(_0x440cd5,_0x420d12);logger[_0xa505('0x2e')](_0xa505('0x6d'));return _0x446d15(new Error(_0xa505('0x6d')));}var _0x2aac3e=_0x21e4a1[_0xa505('0x71')](function(_0x6dd785){return _0x6dd785===_0xa505('0x72');});if(!_0x2aac3e){return _0x446d15(new Error('Plugin\x20manifest\x20missing'));}var _0x1cb072=fs[_0xa505('0x73')](path[_0xa505('0x4d')](_0x420d12,_0x5dc33c[0x0],_0xa505('0x72')));var _0x3e69a5=JSON[_0xa505('0x74')](_0x1cb072);if(_0xa505('0x22')==typeof _0x3e69a5[_0xa505('0x30')]){return _0x446d15(new Error(_0xa505('0x75')));}if(_0xa505('0x22')==typeof _0x3e69a5['type']){return _0x446d15(new Error(_0xa505('0x76')));}if(_0xa505('0x22')==typeof _0x3e69a5[_0xa505('0x77')]){return _0x446d15(new Error(_0xa505('0x78')));}if('undefined'==typeof _0x3e69a5[_0xa505('0x79')]){return _0x446d15(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3e69a5[_0xa505('0x35')]==='html'){if(_0xa505('0x22')==typeof _0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')]){return _0x446d15(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xa505('0x22')==typeof _0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7b')]&&_0xa505('0x22')==typeof _0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7c')]){return _0x446d15(new Error(_0xa505('0x7d')));}}else if(_0x3e69a5[_0xa505('0x35')]===_0xa505('0x7e')){if('undefined'==typeof _0x3e69a5['parameters'][_0xa505('0x7f')]){return _0x446d15(new Error(_0xa505('0x80')));}if(_0xa505('0x22')==typeof _0x3e69a5['parameters']['scriptPath']){return _0x446d15(new Error(_0xa505('0x81')));}}else{return _0x446d15(new Error(_0xa505('0x82')));}var _0x26be3f=_0x3e69a5[_0xa505('0x30')];var _0x3860a8=_0x3e69a5[_0xa505('0x83')];var _0x57e153=_0x3e69a5[_0xa505('0x35')];var _0x580f01=_0x3e69a5[_0xa505('0x84')]?_0x3e69a5[_0xa505('0x84')]:_0xa505('0x85');var _0x1b1db4=_0x3e69a5[_0xa505('0x86')]?_0x3e69a5['icon']:_0xa505('0x87');var _0x4924f7='';var _0x1ca58f='';var _0x14d5f8='';var _0x772f27='';var _0x5bc8d4=_0x3e69a5[_0xa505('0x77')];if(_0x57e153===_0xa505('0x88')){if(_0xa505('0x22')!=typeof _0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')]['admin']){var _0x4af0b8=_0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xa505('0x89')](_0x4af0b8)){_0x4924f7=path[_0xa505('0x4d')]('plugins',_0x34c20c,_0x5dc33c[0x0],_0x4af0b8);}else{_0x4924f7=_0x4af0b8;}}else{logger[_0xa505('0x63')](_0xa505('0x8a'));}if(_0xa505('0x22')!=typeof _0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7c')]){var _0x10ce81=_0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x10ce81)){_0x1ca58f=path[_0xa505('0x4d')](_0xa505('0x8b'),_0x34c20c,_0x5dc33c[0x0],_0x10ce81);}else{_0x1ca58f=_0x10ce81;}}else{logger[_0xa505('0x63')](_0xa505('0x8c'));}}else if(_0x57e153===_0xa505('0x7e')){_0x14d5f8=_0x3e69a5[_0xa505('0x79')][_0xa505('0x7f')];_0x772f27=_0x3e69a5[_0xa505('0x79')][_0xa505('0x8d')];if(_0xa505('0x22')!=typeof _0x3e69a5['parameters'][_0xa505('0x7a')]){if(_0xa505('0x22')!=typeof _0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7b')]){var _0x4af0b8=_0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xa505('0x89')](_0x4af0b8)){_0x4924f7=path[_0xa505('0x4d')](_0xa505('0x8b'),_0x34c20c,_0x5dc33c[0x0],_0x4af0b8);}else{_0x4924f7=_0x4af0b8;}}if(_0xa505('0x22')!=typeof _0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')][_0xa505('0x7c')]){var _0x10ce81=_0x3e69a5[_0xa505('0x79')][_0xa505('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x10ce81)){_0x1ca58f=path[_0xa505('0x4d')]('plugins',_0x34c20c,_0x5dc33c[0x0],_0x10ce81);}else{_0x1ca58f=_0x10ce81;}}}}var _0x26e92e={'name':_0x26be3f,'description':_0x3860a8,'path':path[_0xa505('0x4d')](_0x34c20c,_0x5dc33c[0x0]),'type':_0x57e153,'sidebar':_0x580f01,'icon':_0x1b1db4,'adminUrl':_0x4924f7,'agentUrl':_0x1ca58f,'scriptName':_0x14d5f8,'scriptPath':_0x772f27,'version':_0x5bc8d4};removeReferences(_0x440cd5,null);return db[_0xa505('0x32')]['create'](_0x26e92e)['then'](function(_0x5b68b1){var _0x44f390={'role':_0x2cd1cb['body'][_0xa505('0x8e')],'userProfileId':_0x2cd1cb[_0xa505('0x8f')]['userProfileId']};if(!_0x44f390)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44f390[_0xa505('0x8e')]===_0xa505('0x90')){var _0xd7208b=_0x5b68b1[_0xa505('0x91')]({'plain':!![]});return db[_0xa505('0x92')][_0xa505('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x44f390[_0xa505('0x93')]},'raw':!![]})[_0xa505('0x2a')](function(_0x644c97){if(_0x644c97&&_0x644c97['autoAssociation']===0x0){return db['UserProfileResource'][_0xa505('0x94')]({'name':_0xd7208b[_0xa505('0x30')],'resourceId':_0xd7208b['id'],'type':_0x644c97['name'],'sectionId':_0x644c97['id']},{})[_0xa505('0x2a')](function(){return _0x5b68b1;});}else{return _0x5b68b1;}})[_0xa505('0x4a')](function(_0x33f4ed){logger[_0xa505('0x2e')](_0xa505('0x95'),_0x33f4ed);throw _0x33f4ed;});}return _0x5b68b1;})[_0xa505('0x2a')](respondWithResult(_0x318afc,null))[_0xa505('0x4a')](handleError(_0x318afc,null));}});}catch(_0x33324c){_0x318afc[_0xa505('0x1f')](0x1f4)['send'](_0x33324c);}};function removeReferences(_0x247df6,_0x335aa8){try{if(_0x247df6){fs[_0xa505('0x62')](_0x247df6);logger[_0xa505('0x63')](_0xa505('0x96'));}if(_0x335aa8){rimraf(_0x335aa8,function(){});logger[_0xa505('0x63')](_0xa505('0x97'));}}catch(_0x3bf274){logger[_0xa505('0x2e')](_0x3bf274);}}exports['update']=function(_0x3e2a78,_0x531e27,_0x1e6353){return db['Plugin'][_0xa505('0x4b')]({'where':{'id':_0x3e2a78[_0xa505('0x4c')]['id']}})[_0xa505('0x2a')](handleEntityNotFound(_0x531e27,null))[_0xa505('0x2a')](saveUpdates(_0x3e2a78[_0xa505('0x8f')],null))['then'](respondWithResult(_0x531e27,null))[_0xa505('0x4a')](handleError(_0x531e27,null));};exports[_0xa505('0x98')]=function(_0x2b4ee4,_0x461965,_0x5c11f7){return db['Plugin'][_0xa505('0x4b')]({'where':{'id':_0x2b4ee4['params']['id']}})[_0xa505('0x2a')](function(_0x3cc4aa){if(_0x3cc4aa){return _0x3cc4aa['destroy']();}})[_0xa505('0x2a')](function(_0x25fd81){rimraf(path[_0xa505('0x4d')](config[_0xa505('0x4e')],_0xa505('0x4f'),path[_0xa505('0x99')](_0x25fd81[_0xa505('0x5')])),function(){});return _0x25fd81;})[_0xa505('0x2a')](handleEntityNotFound(_0x461965,null))[_0xa505('0x2a')](respondWithStatusCode(_0x461965,null))[_0xa505('0x4a')](handleError(_0x461965,null));};exports[_0xa505('0x9a')]=function(_0x360140,_0x570370,_0x168f16){return BPromise[_0xa505('0x9b')]()[_0xa505('0x2a')](function(){if(!_0x360140[_0xa505('0x3a')][_0xa505('0x5')]){throw new Error(_0xa505('0x9c'));}if(!_0x360140['query'][_0xa505('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3a2743=_0x360140['query'][_0xa505('0x9e')]?_0x360140['query']['hostname']+':'+_0x360140['query'][_0xa505('0x9d')]:_0xa505('0x9f')+_0x360140[_0xa505('0x3a')][_0xa505('0x9d')];var _0x17476b=_0x360140[_0xa505('0x3a')][_0xa505('0x25')]?_0x360140[_0xa505('0x3a')]['json']:!![];var _0x38b2ba=_0x360140['query']['encoding']?_0x360140[_0xa505('0x3a')]['encoding']:null;var _0x582446={'method':_0x360140[_0xa505('0xa0')],'uri':util[_0xa505('0x50')](_0xa505('0xa1'),_0x3a2743,_0x360140[_0xa505('0x3a')][_0xa505('0x5')]),'json':_0x17476b,'resolveWithFullResponse':!![],'encoding':_0x38b2ba,'qs':_0x360140[_0xa505('0x3a')]};if(_0x360140[_0xa505('0xa2')]){_0x582446['headers']=_0x360140['headers'];if(_0x582446[_0xa505('0xa2')]['content-length']){delete _0x582446[_0xa505('0xa2')][_0xa505('0xa3')];}}if(_0x582446[_0xa505('0xa2')][_0xa505('0xa4')]){delete _0x582446[_0xa505('0xa2')][_0xa505('0xa4')];}return rp(_0x582446);})['then'](function(_0x14bb83){if(_0x14bb83){_0x570370['set'](_0x14bb83[_0xa505('0xa2')]);logger[_0xa505('0x63')](_0x14bb83['body']);if(_[_0xa505('0xa5')](_0x360140[_0xa505('0x3a')][_0xa505('0x5')],'download')&&_0x14bb83[_0xa505('0xa6')]==0x1f4){return _0x570370[_0xa505('0xa7')](_0x14bb83['statusCode']);}else{return _0x570370[_0xa505('0x1f')](_0x14bb83['statusCode'])[_0xa505('0xa8')](_0x14bb83[_0xa505('0x8f')]);}}else{return _0x570370[_0xa505('0xa7')](0xc8);}})[_0xa505('0x4a')](handleError(_0x570370,null));};exports[_0xa505('0xa9')]=function(_0x3f8891,_0x4c7f4e,_0x108451){return BPromise[_0xa505('0x9b')]()[_0xa505('0x2a')](function(){if(!_0x3f8891[_0xa505('0x3a')][_0xa505('0x5')]){throw new Error(_0xa505('0x9c'));}if(!_0x3f8891['query'][_0xa505('0x9d')]){throw new Error(_0xa505('0xaa'));}var _0x54a809=_0x3f8891[_0xa505('0x3a')][_0xa505('0x9e')]?_0x3f8891[_0xa505('0x3a')]['hostname']+':'+_0x3f8891[_0xa505('0x3a')][_0xa505('0x9d')]:_0xa505('0x9f')+_0x3f8891[_0xa505('0x3a')]['port'];var _0x1258cd=_0x3f8891[_0xa505('0x3a')]['json']?_0x3f8891['query'][_0xa505('0x25')]:!![];var _0x247108=_0x3f8891['query'][_0xa505('0xab')]?_0x3f8891['query'][_0xa505('0xab')]:null;var _0x3e635f={'method':_0x3f8891[_0xa505('0xa0')],'uri':util[_0xa505('0x50')](_0xa505('0xa1'),_0x54a809,_0x3f8891['query'][_0xa505('0x5')]),'json':_0x1258cd,'resolveWithFullResponse':!![],'encoding':_0x247108,'body':_0x3f8891['body']};if(_0x3f8891[_0xa505('0xa2')]){_0x3e635f[_0xa505('0xa2')]=_0x3f8891[_0xa505('0xa2')];if(_0x3e635f[_0xa505('0xa2')][_0xa505('0xa3')]){delete _0x3e635f[_0xa505('0xa2')][_0xa505('0xa3')];}}if(_0x3e635f[_0xa505('0xa2')][_0xa505('0xa4')]){delete _0x3e635f[_0xa505('0xa2')][_0xa505('0xa4')];}return rp(_0x3e635f);})[_0xa505('0x2a')](function(_0x4d90d5){if(_0x4d90d5){_0x4c7f4e['set'](_0x4d90d5['headers']);logger[_0xa505('0x63')](_0x4d90d5[_0xa505('0x8f')]);return _0x4c7f4e[_0xa505('0x1f')](_0x4d90d5[_0xa505('0xa6')])['send'](_0x4d90d5[_0xa505('0x8f')]);}else{return _0x4c7f4e['sendStatus'](0xc8);}})[_0xa505('0x4a')](handleError(_0x4c7f4e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 8b9ea17..c7d9833 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 _0x2d06=['Plugin','setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x325b59,_0x4a1400){var _0x3110b2=function(_0x3542b4){while(--_0x3542b4){_0x325b59['push'](_0x325b59['shift']());}};_0x3110b2(++_0x4a1400);}(_0x2d06,0x157));var _0x62d0=function(_0x5e0de8,_0x4fc62c){_0x5e0de8=_0x5e0de8-0x0;var _0x6e9b38=_0x2d06[_0x5e0de8];return _0x6e9b38;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x62d0('0x0'))['db'][_0x62d0('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x62d0('0x2')](0x0);var events={'afterCreate':_0x62d0('0x3'),'afterUpdate':'update','afterDestroy':_0x62d0('0x4')};function emitEvent(_0x32be50){return function(_0x2487bb,_0x984713,_0x5cf315){PluginEvents[_0x62d0('0x5')](_0x32be50+':'+_0x2487bb['id'],_0x2487bb);PluginEvents[_0x62d0('0x5')](_0x32be50,_0x2487bb);_0x5cf315(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x62d0('0x6')](e,emitEvent(event));}}module[_0x62d0('0x7')]=PluginEvents; \ No newline at end of file +var _0x49c1=['Plugin','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x49c1,0xef));var _0x149c=function(_0x43130c,_0x11548f){_0x43130c=_0x43130c-0x0;var _0x17687b=_0x49c1[_0x43130c];return _0x17687b;};'use strict';var EventEmitter=require(_0x149c('0x0'));var Plugin=require('../../mysqldb')['db'][_0x149c('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x149c('0x2')](0x0);var events={'afterCreate':_0x149c('0x3'),'afterUpdate':'update','afterDestroy':_0x149c('0x4')};function emitEvent(_0x2297bf){return function(_0x4c3294,_0xdb4fdf,_0x8c3ab2){PluginEvents['emit'](_0x2297bf+':'+_0x4c3294['id'],_0x4c3294);PluginEvents[_0x149c('0x5')](_0x2297bf,_0x4c3294);_0x8c3ab2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x149c('0x6')](e,emitEvent(event));}}module[_0x149c('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 8cf0165..ad0452c 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 _0x2cad=['define','plugins','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1532bc,_0x356c33){var _0x28bbe2=function(_0x2d7093){while(--_0x2d7093){_0x1532bc['push'](_0x1532bc['shift']());}};_0x28bbe2(++_0x356c33);}(_0x2cad,0x15a));var _0xd2ca=function(_0x472260,_0x55e796){_0x472260=_0x472260-0x0;var _0x5c890b=_0x2cad[_0x472260];return _0x5c890b;};'use strict';var _=require(_0xd2ca('0x0'));var util=require(_0xd2ca('0x1'));var logger=require(_0xd2ca('0x2'))(_0xd2ca('0x3'));var moment=require('moment');var BPromise=require(_0xd2ca('0x4'));var rp=require(_0xd2ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x37d7bd,_0x1b0cad){return _0x37d7bd[_0xd2ca('0x6')]('Plugin',attributes,{'tableName':_0xd2ca('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ec7=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','lodash','util'];(function(_0x8a9138,_0x3d5d9d){var _0x2f95b0=function(_0x1cd7b2){while(--_0x1cd7b2){_0x8a9138['push'](_0x8a9138['shift']());}};_0x2f95b0(++_0x3d5d9d);}(_0x7ec7,0x1a2));var _0x77ec=function(_0x160596,_0x997e82){_0x160596=_0x160596-0x0;var _0x269036=_0x7ec7[_0x160596];return _0x269036;};'use strict';var _=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var logger=require(_0x77ec('0x2'))(_0x77ec('0x3'));var moment=require('moment');var BPromise=require(_0x77ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x77ec('0x5'));var rimraf=require(_0x77ec('0x6'));var config=require(_0x77ec('0x7'));var attributes=require(_0x77ec('0x8'));module[_0x77ec('0x9')]=function(_0x3c03e5,_0x54f6f0){return _0x3c03e5[_0x77ec('0xa')]('Plugin',attributes,{'tableName':_0x77ec('0xb'),'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 863c4ff..e1fb788 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 _0xba6f=['defaults','socket.io-emitter','./plugin.socket','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','Plugin','create','body','options','CreatePlugin','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x31e961,_0x4b5ec9){var _0x24801e=function(_0x21c750){while(--_0x21c750){_0x31e961['push'](_0x31e961['shift']());}};_0x24801e(++_0x4b5ec9);}(_0xba6f,0xb5));var _0xfba6=function(_0x340c09,_0xc08941){_0x340c09=_0x340c09-0x0;var _0x1cc1b6=_0xba6f[_0x340c09];return _0x1cc1b6;};'use strict';var _=require(_0xfba6('0x0'));var util=require(_0xfba6('0x1'));var moment=require(_0xfba6('0x2'));var BPromise=require(_0xfba6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfba6('0x4'));var logger=require(_0xfba6('0x5'))('rpc');var config=require(_0xfba6('0x6'));var jayson=require(_0xfba6('0x7'));var client=jayson[_0xfba6('0x8')][_0xfba6('0x9')]({'port':0x232a});config[_0xfba6('0xa')]=_[_0xfba6('0xb')](config[_0xfba6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfba6('0xc'))(new Redis(config['redis']));require(_0xfba6('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ba833,_0x2b0342,_0x45da77){return new BPromise(function(_0x215e93,_0x23ef7f){return client[_0xfba6('0xe')](_0x3ba833,_0x45da77)[_0xfba6('0xf')](function(_0x76f378){logger[_0xfba6('0x10')]('Plugin,\x20%s,\x20%s',_0x2b0342,_0xfba6('0x11'));logger[_0xfba6('0x12')](_0xfba6('0x13'),_0x2b0342,_0xfba6('0x11'),JSON[_0xfba6('0x14')](_0x76f378));if(_0x76f378['error']){if(_0x76f378[_0xfba6('0x15')][_0xfba6('0x16')]===0x1f4){logger[_0xfba6('0x15')](_0xfba6('0x17'),_0x2b0342,_0x76f378['error'][_0xfba6('0x18')]);return _0x23ef7f(_0x76f378[_0xfba6('0x15')][_0xfba6('0x18')]);}logger[_0xfba6('0x15')](_0xfba6('0x17'),_0x2b0342,_0x76f378[_0xfba6('0x15')]['message']);return _0x215e93(_0x76f378[_0xfba6('0x15')][_0xfba6('0x18')]);}else{logger[_0xfba6('0x10')](_0xfba6('0x17'),_0x2b0342,_0xfba6('0x11'));_0x215e93(_0x76f378[_0xfba6('0x19')]['message']);}})[_0xfba6('0x1a')](function(_0x1339fb){logger[_0xfba6('0x15')]('Plugin,\x20%s,\x20%s',_0x2b0342,_0x1339fb);_0x23ef7f(_0x1339fb);});});}exports['CreatePlugin']=function(_0x12be71){var _0x126cfd=this;return new Promise(function(_0x2c77b0,_0x5de756){return db[_0xfba6('0x1b')][_0xfba6('0x1c')](_0x12be71[_0xfba6('0x1d')],{'raw':_0x12be71[_0xfba6('0x1e')]?_0x12be71[_0xfba6('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xfba6('0xf')](function(_0x16b28f){logger['info']('CreatePlugin',_0x12be71);logger[_0xfba6('0x12')](_0xfba6('0x1f'),_0x12be71,JSON['stringify'](_0x16b28f));_0x2c77b0(_0x16b28f);})[_0xfba6('0x1a')](function(_0x38dbf3){logger[_0xfba6('0x15')](_0xfba6('0x1f'),_0x38dbf3[_0xfba6('0x18')],_0x12be71);_0x5de756(_0x126cfd[_0xfba6('0x15')](0x1f4,_0x38dbf3[_0xfba6('0x18')]));});});}; \ No newline at end of file +var _0x2226=['redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5cbab1,_0x32afac){var _0x2637f4=function(_0x47abed){while(--_0x47abed){_0x5cbab1['push'](_0x5cbab1['shift']());}};_0x2637f4(++_0x32afac);}(_0x2226,0x138));var _0x6222=function(_0x477598,_0x4dab5c){_0x477598=_0x477598-0x0;var _0x4c7ffb=_0x2226[_0x477598];return _0x4c7ffb;};'use strict';var _=require(_0x6222('0x0'));var util=require(_0x6222('0x1'));var moment=require(_0x6222('0x2'));var BPromise=require(_0x6222('0x3'));var rs=require(_0x6222('0x4'));var fs=require('fs');var Redis=require(_0x6222('0x5'));var db=require(_0x6222('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6222('0x7'))(_0x6222('0x8'));var config=require(_0x6222('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6222('0xa')][_0x6222('0xb')]({'port':0x232a});config[_0x6222('0xc')]=_[_0x6222('0xd')](config['redis'],{'host':_0x6222('0xe'),'port':0x18eb});var socket=require(_0x6222('0xf'))(new Redis(config[_0x6222('0xc')]));require(_0x6222('0x10'))[_0x6222('0x11')](socket);function respondWithRpcPromise(_0x46dc84,_0x555cfa,_0x1fc670){return new BPromise(function(_0x4142e1,_0x45e61c){return client[_0x6222('0x12')](_0x46dc84,_0x1fc670)[_0x6222('0x13')](function(_0x12a463){logger['info'](_0x6222('0x14'),_0x555cfa,_0x6222('0x15'));logger[_0x6222('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0x555cfa,_0x6222('0x15'),JSON[_0x6222('0x17')](_0x12a463));if(_0x12a463[_0x6222('0x18')]){if(_0x12a463[_0x6222('0x18')][_0x6222('0x19')]===0x1f4){logger[_0x6222('0x18')](_0x6222('0x14'),_0x555cfa,_0x12a463['error'][_0x6222('0x1a')]);return _0x45e61c(_0x12a463['error'][_0x6222('0x1a')]);}logger[_0x6222('0x18')](_0x6222('0x14'),_0x555cfa,_0x12a463[_0x6222('0x18')][_0x6222('0x1a')]);return _0x4142e1(_0x12a463['error'][_0x6222('0x1a')]);}else{logger[_0x6222('0x1b')](_0x6222('0x14'),_0x555cfa,_0x6222('0x15'));_0x4142e1(_0x12a463[_0x6222('0x1c')][_0x6222('0x1a')]);}})[_0x6222('0x1d')](function(_0x5cb8b9){logger[_0x6222('0x18')](_0x6222('0x14'),_0x555cfa,_0x5cb8b9);_0x45e61c(_0x5cb8b9);});});}exports[_0x6222('0x1e')]=function(_0x4170d3){var _0x2fa25b=this;return new Promise(function(_0x1987c3,_0x579732){return db[_0x6222('0x1f')][_0x6222('0x20')](_0x4170d3[_0x6222('0x21')],{'raw':_0x4170d3[_0x6222('0x22')]?_0x4170d3[_0x6222('0x22')][_0x6222('0x23')]===undefined?!![]:![]:!![]})[_0x6222('0x13')](function(_0x28329a){logger[_0x6222('0x1b')]('CreatePlugin',_0x4170d3);logger['debug'](_0x6222('0x1e'),_0x4170d3,JSON[_0x6222('0x17')](_0x28329a));_0x1987c3(_0x28329a);})[_0x6222('0x1d')](function(_0xf49e88){logger[_0x6222('0x18')](_0x6222('0x1e'),_0xf49e88[_0x6222('0x1a')],_0x4170d3);_0x579732(_0x2fa25b[_0x6222('0x18')](0x1f4,_0xf49e88[_0x6222('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 25d985d..8814178 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 _0x9332=['length','./plugin.events','save','update','emit','removeListener'];(function(_0x5c5752,_0xa74d2e){var _0x36fcc4=function(_0x3b8d7b){while(--_0x3b8d7b){_0x5c5752['push'](_0x5c5752['shift']());}};_0x36fcc4(++_0xa74d2e);}(_0x9332,0x187));var _0x2933=function(_0x2dcbf3,_0xb261d3){_0x2dcbf3=_0x2dcbf3-0x0;var _0x2632af=_0x9332[_0x2dcbf3];return _0x2632af;};'use strict';var PluginEvents=require(_0x2933('0x0'));var events=[_0x2933('0x1'),'remove',_0x2933('0x2')];function createListener(_0x2fa627,_0x20f16b){return function(_0x59eaf3){_0x20f16b[_0x2933('0x3')](_0x2fa627,_0x59eaf3);};}function removeListener(_0x42badc,_0x427a89){return function(){PluginEvents[_0x2933('0x4')](_0x42badc,_0x427a89);};}exports['register']=function(_0x3a51fe){for(var _0x55c411=0x0,_0x194b30=events[_0x2933('0x5')];_0x55c411<_0x194b30;_0x55c411++){var _0x5afd86=events[_0x55c411];var _0x4dc774=createListener('plugin:'+_0x5afd86,_0x3a51fe);PluginEvents['on'](_0x5afd86,_0x4dc774);}}; \ No newline at end of file +var _0x18ae=['register','plugin:','remove','update','emit','removeListener'];(function(_0x1dacfa,_0x1c19ff){var _0x21649e=function(_0x39a67e){while(--_0x39a67e){_0x1dacfa['push'](_0x1dacfa['shift']());}};_0x21649e(++_0x1c19ff);}(_0x18ae,0x13a));var _0xe18a=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0x18ae[_0x485201];return _0x9ca98a;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0xe18a('0x0'),_0xe18a('0x1')];function createListener(_0x39f02d,_0x6b1f2e){return function(_0x54897d){_0x6b1f2e[_0xe18a('0x2')](_0x39f02d,_0x54897d);};}function removeListener(_0x51426c,_0xbb3f99){return function(){PluginEvents[_0xe18a('0x3')](_0x51426c,_0xbb3f99);};}exports[_0xe18a('0x4')]=function(_0x4c4599){for(var _0x5cf2fa=0x0,_0x23b4f7=events['length'];_0x5cf2fa<_0x23b4f7;_0x5cf2fa++){var _0x39a550=events[_0x5cf2fa];var _0x5148a2=createListener(_0xe18a('0x5')+_0x39a550,_0x4c4599);PluginEvents['on'](_0x39a550,_0x5148a2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 025bdfc..02f247b 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(_0x15f3e9,_0xe2a0e7){var _0x30b7aa=function(_0x498918){while(--_0x498918){_0x15f3e9['push'](_0x15f3e9['shift']());}};_0x30b7aa(++_0xe2a0e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x2a7e3c,_0x594e32){var _0xb9f547=function(_0x535722){while(--_0x535722){_0x2a7e3c['push'](_0x2a7e3c['shift']());}};_0xb9f547(++_0x594e32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 7382a1a..1adfcc6 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 _0x6f7a=['../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','dump','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','express','motion2','catch','show','params','body','script','join'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x14f4d7,_0x3312e3){_0x14f4d7=_0x14f4d7-0x0;var _0x3277f6=_0x6f7a[_0x14f4d7];return _0x3277f6;};'use strict';var _=require(_0xa6f7('0x0'));var pm2=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var path=require('path');var exec=require(_0xa6f7('0x4'))[_0xa6f7('0x5')];var BPromise=require(_0xa6f7('0x6'));function handleEntityNotFound(_0x1da6dc,_0x22e529){return function(_0x1f5922){if(!_0x1f5922){_0x1da6dc[_0xa6f7('0x7')](0x194);;}return _0x1f5922;};}function respondWithResult(_0x20cccd,_0x1fdd5f){_0x1fdd5f=_0x1fdd5f||0xc8;return function(_0x335aaa){if(_0x335aaa){return _0x20cccd[_0xa6f7('0x8')](_0x1fdd5f)['json'](_0x335aaa);}return null;};}function handleError(_0x4b4f9e,_0x30f2a7){_0x30f2a7=_0x30f2a7||0x1f4;return function(_0x2674c9){logger[_0xa6f7('0x9')](_0x2674c9[_0xa6f7('0xa')]);if(_0x2674c9[_0xa6f7('0xb')]){delete _0x2674c9['name'];}_0x4b4f9e['status'](_0x30f2a7)[_0xa6f7('0xc')](_0x2674c9);};}function execChildProcess(){return new BPromise(function(_0x225da4,_0x4e30bc){exec(_0xa6f7('0xd'),function(_0x5623bf,_0x315096,_0x1303c3){logger[_0xa6f7('0xe')](_0x315096);logger[_0xa6f7('0xe')](_0x1303c3);if(_0x5623bf){logger['error'](_0x5623bf);return _0x4e30bc(_0x5623bf);}return _0x225da4(_0x315096);});});}exports[_0xa6f7('0xf')]=function(_0x532352,_0x25b48f){return pm2[_0xa6f7('0x10')]()[_0xa6f7('0x11')](function(_0x4d3d59){if(_0x4d3d59){var _0x34c02d=_['reject'](_0x4d3d59,function(_0x41bc4d){return _0x41bc4d['name']===_0xa6f7('0x12')||_0x41bc4d[_0xa6f7('0xb')]===_0xa6f7('0x13');});return{'rows':_0x34c02d,'count':_0x34c02d['length']};}return null;})[_0xa6f7('0x11')](respondWithResult(_0x25b48f,null))[_0xa6f7('0x14')](handleError(_0x25b48f,null));};exports[_0xa6f7('0x15')]=function(_0x2401b9,_0x5681d5){return pm2['describe'](_0x2401b9[_0xa6f7('0x16')]['id'])['then'](respondWithResult(_0x5681d5,null))[_0xa6f7('0x11')](handleEntityNotFound(_0x5681d5,null))[_0xa6f7('0x14')](handleError(_0x5681d5,null));};exports['create']=function(_0x18fc4a,_0xb2cfaa){if(_0x18fc4a[_0xa6f7('0x17')][_0xa6f7('0xb')]&&_0x18fc4a[_0xa6f7('0x17')][_0xa6f7('0x18')]){var _0x4887ad=path[_0xa6f7('0x19')](__dirname,_0xa6f7('0x1a'),_0x18fc4a['body']['script']);var _0x5ddc8d=process[_0xa6f7('0x1b')]();process[_0xa6f7('0x1c')](path['dirname'](_0x4887ad));return execChildProcess()['then'](function(_0x50e2be){process[_0xa6f7('0x1c')](_0x5ddc8d);return pm2[_0xa6f7('0x1d')]({'name':_0x18fc4a[_0xa6f7('0x17')]['name'],'script':_0x4887ad});})['then'](function(_0x2f4907){pm2['dump']();return _0x2f4907[0x0];})['then'](respondWithResult(_0xb2cfaa,0xc9))[_0xa6f7('0x14')](handleError(_0xb2cfaa,null));}else{return _0xb2cfaa['status'](0x1f4)[_0xa6f7('0xc')]({'message':_0xa6f7('0x1e')});}};exports[_0xa6f7('0x1f')]=function(_0x2b4c6c,_0x3a3508){if(_0x2b4c6c['body']['id']){delete _0x2b4c6c['body']['id'];}var _0x1c419b={'online':_0xa6f7('0x20'),'stopped':'stop'};if(_0x1c419b[_0xa6f7('0x21')](_0x2b4c6c[_0xa6f7('0x17')][_0xa6f7('0x8')])){return pm2[_0x1c419b[_0x2b4c6c[_0xa6f7('0x17')][_0xa6f7('0x8')]]](_0x2b4c6c[_0xa6f7('0x16')]['id'])[_0xa6f7('0x11')](respondWithResult(_0x3a3508,0xc8))[_0xa6f7('0x14')](handleError(_0x3a3508,null));}else{return _0x3a3508[_0xa6f7('0x8')](0x1f4)[_0xa6f7('0xc')]({'message':_0xa6f7('0x22')});}};exports[_0xa6f7('0x23')]=function(_0x52f9c1,_0x442ccf){if(_0x52f9c1[_0xa6f7('0x17')]['id']){delete _0x52f9c1['body']['id'];}if(_0x52f9c1[_0xa6f7('0x16')]['id']){return pm2[_0xa6f7('0x24')](_0x52f9c1['params']['id'])['then'](function(_0x176378){pm2[_0xa6f7('0x25')]();return _0x176378[0x0];})[_0xa6f7('0x11')](respondWithResult(_0x442ccf,null))[_0xa6f7('0x14')](handleError(_0x442ccf,null));}else{return _0x442ccf[_0xa6f7('0x8')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x5b02=['../../files/plugins','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','catch','show','describe','params','create','body','script','join'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x5b02,0xe9));var _0x25b0=function(_0x449a8d,_0x8c3c4b){_0x449a8d=_0x449a8d-0x0;var _0x274ab0=_0x5b02[_0x449a8d];return _0x274ab0;};'use strict';var _=require(_0x25b0('0x0'));var pm2=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var path=require('path');var exec=require('child_process')[_0x25b0('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3e1d20,_0x31c9c2){return function(_0x38dc14){if(!_0x38dc14){_0x3e1d20[_0x25b0('0x5')](0x194);;}return _0x38dc14;};}function respondWithResult(_0x2d84a9,_0x4eea55){_0x4eea55=_0x4eea55||0xc8;return function(_0x1d82c6){if(_0x1d82c6){return _0x2d84a9[_0x25b0('0x6')](_0x4eea55)['json'](_0x1d82c6);}return null;};}function handleError(_0x412954,_0x4d3e71){_0x4d3e71=_0x4d3e71||0x1f4;return function(_0x56feca){logger[_0x25b0('0x7')](_0x56feca[_0x25b0('0x8')]);if(_0x56feca[_0x25b0('0x9')]){delete _0x56feca['name'];}_0x412954[_0x25b0('0x6')](_0x4d3e71)[_0x25b0('0xa')](_0x56feca);};}function execChildProcess(){return new BPromise(function(_0x135afb,_0x250d31){exec(_0x25b0('0xb'),function(_0x2f57af,_0x44afbc,_0x10c3fb){logger[_0x25b0('0xc')](_0x44afbc);logger[_0x25b0('0xc')](_0x10c3fb);if(_0x2f57af){logger[_0x25b0('0x7')](_0x2f57af);return _0x250d31(_0x2f57af);}return _0x135afb(_0x44afbc);});});}exports[_0x25b0('0xd')]=function(_0x2048dc,_0x3655c2){return pm2[_0x25b0('0xe')]()[_0x25b0('0xf')](function(_0x293203){if(_0x293203){var _0x211658=_[_0x25b0('0x10')](_0x293203,function(_0x3b89e7){return _0x3b89e7[_0x25b0('0x9')]==='express'||_0x3b89e7['name']===_0x25b0('0x11');});return{'rows':_0x211658,'count':_0x211658['length']};}return null;})[_0x25b0('0xf')](respondWithResult(_0x3655c2,null))[_0x25b0('0x12')](handleError(_0x3655c2,null));};exports[_0x25b0('0x13')]=function(_0x3267b9,_0x5e3a3a){return pm2[_0x25b0('0x14')](_0x3267b9[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x5e3a3a,null))[_0x25b0('0xf')](handleEntityNotFound(_0x5e3a3a,null))[_0x25b0('0x12')](handleError(_0x5e3a3a,null));};exports[_0x25b0('0x16')]=function(_0x54f458,_0x348d36){if(_0x54f458[_0x25b0('0x17')][_0x25b0('0x9')]&&_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]){var _0xea4162=path[_0x25b0('0x19')](__dirname,_0x25b0('0x1a'),_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]);var _0x2b2eda=process[_0x25b0('0x1b')]();process['chdir'](path[_0x25b0('0x1c')](_0xea4162));return execChildProcess()[_0x25b0('0xf')](function(_0x517ec5){process[_0x25b0('0x1d')](_0x2b2eda);return pm2[_0x25b0('0x1e')]({'name':_0x54f458[_0x25b0('0x17')]['name'],'script':_0xea4162});})['then'](function(_0x50089e){pm2[_0x25b0('0x1f')]();return _0x50089e[0x0];})[_0x25b0('0xf')](respondWithResult(_0x348d36,0xc9))[_0x25b0('0x12')](handleError(_0x348d36,null));}else{return _0x348d36[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x20')});}};exports[_0x25b0('0x21')]=function(_0x75ce7a,_0x22e024){if(_0x75ce7a['body']['id']){delete _0x75ce7a[_0x25b0('0x17')]['id'];}var _0xbfba84={'online':'restart','stopped':'stop'};if(_0xbfba84['hasOwnProperty'](_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')])){return pm2[_0xbfba84[_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')]]](_0x75ce7a[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x22e024,0xc8))[_0x25b0('0x12')](handleError(_0x22e024,null));}else{return _0x22e024[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x22')});}};exports[_0x25b0('0x23')]=function(_0x3161c1,_0x1ea374){if(_0x3161c1['body']['id']){delete _0x3161c1['body']['id'];}if(_0x3161c1[_0x25b0('0x15')]['id']){return pm2['delete'](_0x3161c1['params']['id'])[_0x25b0('0xf')](function(_0x419975){pm2[_0x25b0('0x1f')]();return _0x419975[0x0];})[_0x25b0('0xf')](respondWithResult(_0x1ea374,null))[_0x25b0('0x12')](handleError(_0x1ea374,null));}else{return _0x1ea374['status'](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 37b0e56..a6c1fe2 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 _0xd471=['get','/agents','isAuthenticated','getAgents','getQueues','exports','Router','../../components/auth/service'];(function(_0x490e7f,_0x4ac5e5){var _0x8b56e6=function(_0x508690){while(--_0x508690){_0x490e7f['push'](_0x490e7f['shift']());}};_0x8b56e6(++_0x4ac5e5);}(_0xd471,0x15e));var _0x1d47=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd471[_0x31e29a];return _0x32d892;};'use strict';var express=require('express');var router=express[_0x1d47('0x0')]();var auth=require(_0x1d47('0x1'));var controller=require('./realtime.controller');router[_0x1d47('0x2')](_0x1d47('0x3'),auth[_0x1d47('0x4')](),controller[_0x1d47('0x5')]);router[_0x1d47('0x2')]('/queues',auth['isAuthenticated'](),controller[_0x1d47('0x6')]);module[_0x1d47('0x7')]=router; \ No newline at end of file +var _0x2512=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','Router'];(function(_0x227bfa,_0x51bedc){var _0x331aba=function(_0x36e65b){while(--_0x36e65b){_0x227bfa['push'](_0x227bfa['shift']());}};_0x331aba(++_0x51bedc);}(_0x2512,0x9f));var _0x2251=function(_0xc0921a,_0x1f107f){_0xc0921a=_0xc0921a-0x0;var _0x3f6189=_0x2512[_0xc0921a];return _0x3f6189;};'use strict';var express=require('express');var router=express[_0x2251('0x0')]();var auth=require(_0x2251('0x1'));var controller=require(_0x2251('0x2'));router[_0x2251('0x3')](_0x2251('0x4'),auth[_0x2251('0x5')](),controller[_0x2251('0x6')]);router[_0x2251('0x3')](_0x2251('0x7'),auth[_0x2251('0x5')](),controller[_0x2251('0x8')]);module[_0x2251('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 7293195..2ddf8bb 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 _0xa11e=['sequelize','literal','FIELD(id,','order','*pause','Pause','forEach','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','findAndCountAll','rows','find','filterAgentAttributes','getAgentStatus','voiceStatus','sortAgentsByStatus','pick','catch','getQueues','isValidChannel','Queue','key','name','voice','outbound','QueueCampaigns','startCase','Queues','filter','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','getAgents','getChannels','globalQueueFilter','query','globalStatusFilter','pause','resolve','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','globalStatus','getUpdatedSortOptions','fields','join','then','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','role','agent','getOptions','push'];(function(_0x478aa1,_0x3ff008){var _0x222a0a=function(_0x56c809){while(--_0x56c809){_0x478aa1['push'](_0x478aa1['shift']());}};_0x222a0a(++_0x3ff008);}(_0xa11e,0x120));var _0xea11=function(_0x50337b,_0x35a8ee){_0x50337b=_0x50337b-0x0;var _0x53d607=_0xa11e[_0x50337b];return _0x53d607;};'use strict';var _=require(_0xea11('0x0'));var util=require(_0xea11('0x1'));var rta=require(_0xea11('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0xea11('0x3'));var utils=require(_0xea11('0x4'));var db=require(_0xea11('0x5'))['db'];var APIBadRequestError=require(_0xea11('0x6'))[_0xea11('0x7')];var APIHandleError=require(_0xea11('0x6'))[_0xea11('0x8')];function respondWithFilteredResult(_0x276ea2,_0x3f250e){return function(_0x556f01){if(_0x556f01){var _0x4f042c=typeof _0x3f250e[_0xea11('0x9')]===_0xea11('0xa')&&typeof _0x3f250e['limit']===_0xea11('0xa');var _0x37931e=_0x556f01[_0xea11('0xb')];var _0x5be926=_0x4f042c?0x0:_0x3f250e[_0xea11('0x9')];var _0x5cd618=_0x4f042c?_0x556f01['count']:_0x3f250e[_0xea11('0x9')]+_0x3f250e[_0xea11('0xc')];var _0x2bc23b;if(_0x5cd618>=_0x37931e){_0x5cd618=_0x37931e;_0x2bc23b=0xc8;}else{_0x2bc23b=0xce;}_0x276ea2[_0xea11('0xd')](_0x2bc23b);return _0x276ea2[_0xea11('0xe')]('Content-Range',_0x5be926+'-'+_0x5cd618+'/'+_0x37931e)['json'](_0x556f01);}return null;};}exports[_0xea11('0xf')]=function(_0x56430c,_0x2db641){var _0x4fc90f={'count':0x0,'rows':[]};var _0x98b1b7={};var _0xad1f67;var _0x2a0348=utils[_0xea11('0x10')]();var _0x2dedb2;var _0x479aad;var _0x1d6093=_0x56430c['query'][_0xea11('0x11')];var _0x47f28d=_0x56430c[_0xea11('0x12')][_0xea11('0x13')];var _0x114c95=_0x56430c[_0xea11('0x12')]['pauseTypeFilter'];var _0x5c7346=_0x47f28d===_0xea11('0x14')||_0x47f28d==='*pause'?!![]:![];var _0x57b637=[];var _0x48dd31;var _0x17bf36;Promise[_0xea11('0x15')]()['then'](function(){if(_0x56430c[_0xea11('0x12')][_0xea11('0x16')]){if(!utils['isValidChannel'](_0x56430c[_0xea11('0x12')][_0xea11('0x16')])){throw new APIBadRequestError(util[_0xea11('0x17')](_0xea11('0x18'),_0x56430c['query'][_0xea11('0x16')]));}_0xad1f67=_0x56430c[_0xea11('0x12')]['channel']['toLowerCase']();}if(!_0x56430c['query'][_0xea11('0x19')]||!_0x56430c['query'][_0xea11('0x19')]['includes'](_0xea11('0x1a'))){_0x56430c['query'][_0xea11('0x19')]=rta['validateSortParameter'](_0x56430c[_0xea11('0x12')][_0xea11('0x19')]);return;}var _0x3ab896=rta[_0xea11('0x1b')](_0x56430c[_0xea11('0x12')]['sort']);_0x56430c[_0xea11('0x12')][_0xea11('0x19')]=_0x3ab896[_0xea11('0x1c')][_0xea11('0x1d')](',');_0x48dd31=_0x3ab896['order'];})[_0xea11('0x1e')](function(){if(!_0x1d6093){return[];}return rta[_0xea11('0x1f')](_0x1d6093,_0xad1f67);})[_0xea11('0x1e')](function(_0x5b5582){_0x57b637=_0x5b5582;return rta[_0xea11('0x20')]();})[_0xea11('0x1e')](function(_0x5f1a21){_0x479aad=_0x5f1a21['rows'];if((!_0x47f28d||_0x5c7346)&&!_0x48dd31){return _0x57b637;}if(_0x48dd31&&!_0x47f28d){return rta[_0xea11('0x21')](_0x479aad,_0x57b637,_0x48dd31);}else{return rta[_0xea11('0x22')](_0x479aad,_0x57b637,_0x47f28d);}})[_0xea11('0x1e')](function(_0x9509e7){_0x57b637=_0x9509e7;var _0x141946=![];if(_0x57b637[_0xea11('0x23')]===0x0){if(_0x1d6093||_0x47f28d){_0x141946=!![];}if(_0x5c7346){_0x141946=![];}}if(_0x141946){return _0x4fc90f;}var _0x509952=_[_0xea11('0x24')](db['User'][_0xea11('0x25')],function(_0x425689){return{'name':_0x425689[_0xea11('0x26')],'type':_0x425689[_0xea11('0x27')]['key']};});_0x56430c[_0xea11('0x12')][_0xea11('0x28')]=_0xea11('0x29');_0x98b1b7=qs[_0xea11('0x2a')](_0x509952,_0x56430c);_0x98b1b7['raw']=!![];var _0x1a3de5=[];if(_0x57b637['length']>0x0){_0x1a3de5[_0xea11('0x2b')]({'id':{'$in':_0x57b637}});if(_0x48dd31&&!_0x47f28d){_0x17bf36=[db[_0xea11('0x2c')][_0xea11('0x2d')](_0xea11('0x2e')+_0x57b637+')')];_0x98b1b7[_0xea11('0x2f')]=_0x17bf36;}}if(_0x5c7346){_0x2a0348['forEach'](function(_0x5cdb8a){var _0x58dc29=!![];if(_0x47f28d===_0xea11('0x30')&&_0xad1f67!==_0x5cdb8a){_0x58dc29=![];}_0x1a3de5[_0xea11('0x2b')]({[_0x5cdb8a+_0xea11('0x31')]:_0x58dc29});});if(_0x114c95){_0x1a3de5[_0xea11('0x2b')]({'pauseType':_0x114c95});}}else if(_0x47f28d){_0x2a0348[_0xea11('0x32')](function(_0x540721){_0x1a3de5[_0xea11('0x2b')]({[_0x540721+'Pause']:![]});});}_0x98b1b7[_0xea11('0x33')]=_[_0xea11('0x34')](_0x98b1b7[_0xea11('0x33')],{'$and':_0x1a3de5});if(_0x56430c['user'][_0xea11('0x28')]===_0xea11('0x35')){var _0x14a15c={'params':{'id':_0x56430c[_0xea11('0x35')][_0xea11('0x36')]},'query':{'section':_0xea11('0x37'),'role':'agent','raw':!![],'ids':_0x57b637,'customSorting':_0x17bf36}};if(_0x56430c[_0xea11('0x12')]['online']){_0x14a15c[_0xea11('0x12')][_0xea11('0x38')]=!![];}if(_0x5c7346){_0x14a15c[_0xea11('0x12')][_0xea11('0x39')]=_0x1a3de5;}_0x14a15c[_0xea11('0x12')]=Object[_0xea11('0x3a')](_0x14a15c[_0xea11('0x12')],_0x56430c[_0xea11('0x12')]);return db[_0xea11('0x3b')]['getResources'](_0x14a15c);}return db['User'][_0xea11('0x3c')](_0x98b1b7);})['then'](function(_0x29ef7a){_0x4fc90f[_0xea11('0xb')]=_0x29ef7a[_0xea11('0xb')];_0x2dedb2=_0x29ef7a[_0xea11('0x3d')];return _0x2dedb2[_0xea11('0x24')](function(_0x4fc8bb){var _0x4fc95a=_[_0xea11('0x3e')](_0x479aad,['id',_0x4fc8bb['id']]);if(_0x4fc95a){var _0x32d0e1=rta[_0xea11('0x3f')](_0x4fc95a);_['merge'](_0x4fc8bb,_0x32d0e1);}_0x4fc8bb[_0xea11('0x1a')]=rta[_0xea11('0x40')](_0x4fc8bb);if(_0x4fc8bb['globalStatus']['includes'](_0xea11('0x14'))){_0x2a0348['forEach'](function(_0x1a749c){if(_0x4fc8bb[_0x1a749c+_0xea11('0x31')]){if(_0x1a749c==='voice'){if(_0x4fc8bb[_0xea11('0x41')]!=='talking'){_0x4fc8bb['voiceStatus']=_0xea11('0x14');}}else{_0x4fc8bb[_0x1a749c+'Status']=_0xea11('0x14');}}});}return _0x4fc8bb;});})['then'](function(_0x19e2c1){if(!_0x48dd31||_0x17bf36){return _0x19e2c1;}return rta[_0xea11('0x42')](_0x19e2c1,_0x48dd31);})[_0xea11('0x1e')](function(_0x1e1fcb){var _0x5eb3a6=rta['getRealtimeAgentsQueryFields']();_0x4fc90f['rows']=_0x1e1fcb[_0xea11('0x24')](function(_0x59cb11){return _[_0xea11('0x43')](_0x59cb11,_0x5eb3a6);});return _0x4fc90f;})[_0xea11('0x1e')](respondWithFilteredResult(_0x2db641,_0x98b1b7))[_0xea11('0x44')](APIHandleError(_0x2db641));};exports[_0xea11('0x45')]=function(_0xb75794,_0x4f9178){var _0x1ffd0c={'count':0x0,'rows':[]};var _0x1a9038={};var _0x5a6cd9;var _0x57c505;var _0x11a7bc;Promise[_0xea11('0x15')]()[_0xea11('0x1e')](function(){if(_0xb75794[_0xea11('0x12')][_0xea11('0x16')]){if(!utils[_0xea11('0x46')](_0xb75794[_0xea11('0x12')]['channel'])){throw new APIBadRequestError(util[_0xea11('0x17')](_0xea11('0x18'),_0xb75794['query'][_0xea11('0x16')]));}_0x5a6cd9=_0xb75794[_0xea11('0x12')][_0xea11('0x16')]['toLowerCase']();}var _0xd40569=_['startCase'](_0x5a6cd9)+_0xea11('0x47');var _0x32c7a3=_[_0xea11('0x24')](db[_0xd40569][_0xea11('0x25')],function(_0x1e4fa8){return{'name':_0x1e4fa8[_0xea11('0x26')],'type':_0x1e4fa8[_0xea11('0x27')][_0xea11('0x48')]};});if(!_0xb75794[_0xea11('0x12')][_0xea11('0x1c')]){var _0x527396=['id',_0xea11('0x49')];if(_0x5a6cd9===_0xea11('0x4a')){_0x527396[_0xea11('0x2b')](_0xea11('0x27'));if(_0xb75794[_0xea11('0x12')][_0xea11('0x27')]==='outbound'){_0x527396['push'](['dialActive','dialMethod']);}}_0xb75794['query'][_0xea11('0x1c')]=_0x527396[_0xea11('0x1d')](',');}_0x1a9038=qs['getOptions'](_0x32c7a3,_0xb75794);if(_0xb75794[_0xea11('0x35')]['role']===_0xea11('0x35')){var _0x31d28a={'params':{'id':_0xb75794['user'][_0xea11('0x36')]},'query':{'section':_0x5a6cd9==='voice'&&_0xb75794[_0xea11('0x12')][_0xea11('0x27')]===_0xea11('0x4b')?_0xea11('0x4c'):_[_0xea11('0x4d')](_0x5a6cd9)+_0xea11('0x4e'),'type':_0xb75794[_0xea11('0x12')][_0xea11('0x27')],'nolimit':!![],'sort':_0xea11('0x49'),'filter':_0xb75794[_0xea11('0x12')][_0xea11('0x4f')]}};_0x31d28a[_0xea11('0x12')]=Object[_0xea11('0x3a')](_0x31d28a['query'],_0xb75794[_0xea11('0x12')]);delete _0x31d28a[_0xea11('0x12')]['id'];return db['UserProfile'][_0xea11('0x50')](_0x31d28a);}return db[_0xd40569][_0xea11('0x3c')](_0x1a9038);})[_0xea11('0x1e')](function(_0x5c5db3){_0x1ffd0c['count']=_0x5c5db3['count'];_0x57c505=_0x5c5db3[_0xea11('0x3d')];return rtq[_0xea11('0x51')](_0xb75794,_0x5a6cd9);})[_0xea11('0x1e')](function(_0x98fd91){_0x11a7bc=_0x98fd91[_0xea11('0x3d')];return rtq[_0xea11('0x52')](_0x57c505,_0x11a7bc,_0x5a6cd9,_0xb75794[_0xea11('0x12')][_0xea11('0x27')]);})[_0xea11('0x1e')](function(_0xa918ce){_0x1ffd0c[_0xea11('0x3d')]=_0xa918ce;return _0x1ffd0c;})[_0xea11('0x1e')](respondWithFilteredResult(_0x4f9178,_0x1a9038))[_0xea11('0x44')](APIHandleError(_0x4f9178));}; \ No newline at end of file +var _0x60fa=['Queues','initializeQueues','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','offset','undefined','count','status','set','Content-Range','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','fields','join','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','forEach','Pause','where','user','userProfileId','Agents','online','extraQueryConditions','assign','getResources','findAndCountAll','find','merge','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','startCase','Queue','outbound','dialActive','dialMethod'];(function(_0x171797,_0x1e596c){var _0x4c3dd4=function(_0xbdf365){while(--_0xbdf365){_0x171797['push'](_0x171797['shift']());}};_0x4c3dd4(++_0x1e596c);}(_0x60fa,0x1dc));var _0xa60f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa60f('0x0'));var rta=require('../../components/realtime/agents');var rtq=require(_0xa60f('0x1'));var qs=require(_0xa60f('0x2'));var utils=require(_0xa60f('0x3'));var db=require(_0xa60f('0x4'))['db'];var APIBadRequestError=require(_0xa60f('0x5'))['APIBadRequestError'];var APIHandleError=require(_0xa60f('0x5'))[_0xa60f('0x6')];function respondWithFilteredResult(_0x47c22e,_0x274540){return function(_0x591535){if(_0x591535){var _0x5d14ea=typeof _0x274540[_0xa60f('0x7')]===_0xa60f('0x8')&&typeof _0x274540['limit']===_0xa60f('0x8');var _0xad8b9=_0x591535['count'];var _0x4fb465=_0x5d14ea?0x0:_0x274540[_0xa60f('0x7')];var _0x3505bd=_0x5d14ea?_0x591535[_0xa60f('0x9')]:_0x274540[_0xa60f('0x7')]+_0x274540['limit'];var _0x495bb3;if(_0x3505bd>=_0xad8b9){_0x3505bd=_0xad8b9;_0x495bb3=0xc8;}else{_0x495bb3=0xce;}_0x47c22e[_0xa60f('0xa')](_0x495bb3);return _0x47c22e[_0xa60f('0xb')](_0xa60f('0xc'),_0x4fb465+'-'+_0x3505bd+'/'+_0xad8b9)[_0xa60f('0xd')](_0x591535);}return null;};}exports[_0xa60f('0xe')]=function(_0xa877cb,_0x361595){var _0x22ed90={'count':0x0,'rows':[]};var _0x1368ac={};var _0x12d50c;var _0x28a239=utils[_0xa60f('0xf')]();var _0x2e5198;var _0x17e937;var _0xf77171=_0xa877cb[_0xa60f('0x10')]['globalQueueFilter'];var _0x55b089=_0xa877cb['query'][_0xa60f('0x11')];var _0x14fbb4=_0xa877cb[_0xa60f('0x10')][_0xa60f('0x12')];var _0x371731=_0x55b089===_0xa60f('0x13')||_0x55b089==='*pause'?!![]:![];var _0x1de413=[];var _0x15d54b;var _0x2eec74;Promise[_0xa60f('0x14')]()[_0xa60f('0x15')](function(){if(_0xa877cb[_0xa60f('0x10')][_0xa60f('0x16')]){if(!utils[_0xa60f('0x17')](_0xa877cb['query'][_0xa60f('0x16')])){throw new APIBadRequestError(util[_0xa60f('0x18')](_0xa60f('0x19'),_0xa877cb['query']['channel']));}_0x12d50c=_0xa877cb[_0xa60f('0x10')]['channel'][_0xa60f('0x1a')]();}if(!_0xa877cb[_0xa60f('0x10')][_0xa60f('0x1b')]||!_0xa877cb[_0xa60f('0x10')][_0xa60f('0x1b')][_0xa60f('0x1c')](_0xa60f('0x1d'))){_0xa877cb[_0xa60f('0x10')][_0xa60f('0x1b')]=rta[_0xa60f('0x1e')](_0xa877cb['query']['sort']);return;}var _0x28f9fd=rta['getUpdatedSortOptions'](_0xa877cb[_0xa60f('0x10')]['sort']);_0xa877cb[_0xa60f('0x10')][_0xa60f('0x1b')]=_0x28f9fd[_0xa60f('0x1f')][_0xa60f('0x20')](',');_0x15d54b=_0x28f9fd[_0xa60f('0x21')];})[_0xa60f('0x15')](function(){if(!_0xf77171){return[];}return rta['getAgentIdsByQueues'](_0xf77171,_0x12d50c);})['then'](function(_0x444cab){_0x1de413=_0x444cab;return rta[_0xa60f('0x22')]();})['then'](function(_0x5a0c59){_0x17e937=_0x5a0c59[_0xa60f('0x23')];if((!_0x55b089||_0x371731)&&!_0x15d54b){return _0x1de413;}if(_0x15d54b&&!_0x55b089){return rta[_0xa60f('0x24')](_0x17e937,_0x1de413,_0x15d54b);}else{return rta[_0xa60f('0x25')](_0x17e937,_0x1de413,_0x55b089);}})[_0xa60f('0x15')](function(_0x497ea5){_0x1de413=_0x497ea5;var _0x558e42=![];if(_0x1de413[_0xa60f('0x26')]===0x0){if(_0xf77171||_0x55b089){_0x558e42=!![];}if(_0x371731){_0x558e42=![];}}if(_0x558e42){return _0x22ed90;}var _0x3ff5d3=_[_0xa60f('0x27')](db[_0xa60f('0x28')][_0xa60f('0x29')],function(_0x23760d){return{'name':_0x23760d[_0xa60f('0x2a')],'type':_0x23760d[_0xa60f('0x2b')][_0xa60f('0x2c')]};});_0xa877cb[_0xa60f('0x10')][_0xa60f('0x2d')]=_0xa60f('0x2e');_0x1368ac=qs[_0xa60f('0x2f')](_0x3ff5d3,_0xa877cb);_0x1368ac[_0xa60f('0x30')]=!![];var _0x16c477=[];if(_0x1de413[_0xa60f('0x26')]>0x0){_0x16c477[_0xa60f('0x31')]({'id':{'$in':_0x1de413}});if(_0x15d54b&&!_0x55b089){_0x2eec74=[db['sequelize']['literal']('FIELD(id,'+_0x1de413+')')];_0x1368ac[_0xa60f('0x21')]=_0x2eec74;}}if(_0x371731){_0x28a239[_0xa60f('0x32')](function(_0x157ead){var _0x61941d=!![];if(_0x55b089==='*pause'&&_0x12d50c!==_0x157ead){_0x61941d=![];}_0x16c477[_0xa60f('0x31')]({[_0x157ead+_0xa60f('0x33')]:_0x61941d});});if(_0x14fbb4){_0x16c477[_0xa60f('0x31')]({'pauseType':_0x14fbb4});}}else if(_0x55b089){_0x28a239[_0xa60f('0x32')](function(_0x27de61){_0x16c477[_0xa60f('0x31')]({[_0x27de61+_0xa60f('0x33')]:![]});});}_0x1368ac[_0xa60f('0x34')]=_['merge'](_0x1368ac[_0xa60f('0x34')],{'$and':_0x16c477});if(_0xa877cb[_0xa60f('0x35')][_0xa60f('0x2d')]==='user'){var _0x3b82f9={'params':{'id':_0xa877cb['user'][_0xa60f('0x36')]},'query':{'section':_0xa60f('0x37'),'role':_0xa60f('0x2e'),'raw':!![],'ids':_0x1de413,'customSorting':_0x2eec74}};if(_0xa877cb[_0xa60f('0x10')][_0xa60f('0x38')]){_0x3b82f9['query'][_0xa60f('0x38')]=!![];}if(_0x371731){_0x3b82f9[_0xa60f('0x10')][_0xa60f('0x39')]=_0x16c477;}_0x3b82f9[_0xa60f('0x10')]=Object[_0xa60f('0x3a')](_0x3b82f9['query'],_0xa877cb[_0xa60f('0x10')]);return db['UserProfile'][_0xa60f('0x3b')](_0x3b82f9);}return db[_0xa60f('0x28')][_0xa60f('0x3c')](_0x1368ac);})[_0xa60f('0x15')](function(_0x46c6fe){_0x22ed90[_0xa60f('0x9')]=_0x46c6fe[_0xa60f('0x9')];_0x2e5198=_0x46c6fe['rows'];return _0x2e5198[_0xa60f('0x27')](function(_0x5b4f5e){var _0x1da433=_[_0xa60f('0x3d')](_0x17e937,['id',_0x5b4f5e['id']]);if(_0x1da433){var _0x30f976=rta['filterAgentAttributes'](_0x1da433);_[_0xa60f('0x3e')](_0x5b4f5e,_0x30f976);}_0x5b4f5e[_0xa60f('0x1d')]=rta[_0xa60f('0x3f')](_0x5b4f5e);if(_0x5b4f5e[_0xa60f('0x1d')][_0xa60f('0x1c')]('pause')){_0x28a239[_0xa60f('0x32')](function(_0x38e386){if(_0x5b4f5e[_0x38e386+_0xa60f('0x33')]){if(_0x38e386===_0xa60f('0x40')){if(_0x5b4f5e[_0xa60f('0x41')]!==_0xa60f('0x42')){_0x5b4f5e[_0xa60f('0x41')]=_0xa60f('0x13');}}else{_0x5b4f5e[_0x38e386+_0xa60f('0x43')]=_0xa60f('0x13');}}});}return _0x5b4f5e;});})[_0xa60f('0x15')](function(_0x59ef8f){if(!_0x15d54b||_0x2eec74){return _0x59ef8f;}return rta[_0xa60f('0x44')](_0x59ef8f,_0x15d54b);})['then'](function(_0x5bc39d){var _0x4359f3=rta[_0xa60f('0x45')]();_0x22ed90[_0xa60f('0x23')]=_0x5bc39d[_0xa60f('0x27')](function(_0x199bf8){return _[_0xa60f('0x46')](_0x199bf8,_0x4359f3);});return _0x22ed90;})[_0xa60f('0x15')](respondWithFilteredResult(_0x361595,_0x1368ac))[_0xa60f('0x47')](APIHandleError(_0x361595));};exports['getQueues']=function(_0x31b404,_0x3f8641){var _0x21d87a={'count':0x0,'rows':[]};var _0x3b7156={};var _0x9e567e;var _0x17fb76;var _0x40aebd;Promise['resolve']()[_0xa60f('0x15')](function(){if(_0x31b404['query'][_0xa60f('0x16')]){if(!utils[_0xa60f('0x17')](_0x31b404['query'][_0xa60f('0x16')])){throw new APIBadRequestError(util[_0xa60f('0x18')](_0xa60f('0x19'),_0x31b404[_0xa60f('0x10')]['channel']));}_0x9e567e=_0x31b404['query'][_0xa60f('0x16')][_0xa60f('0x1a')]();}var _0x1c41be=_[_0xa60f('0x48')](_0x9e567e)+_0xa60f('0x49');var _0x34c395=_['map'](db[_0x1c41be][_0xa60f('0x29')],function(_0xe6fcd5){return{'name':_0xe6fcd5[_0xa60f('0x2a')],'type':_0xe6fcd5['type']['key']};});if(!_0x31b404[_0xa60f('0x10')][_0xa60f('0x1f')]){var _0x426778=['id','name'];if(_0x9e567e===_0xa60f('0x40')){_0x426778[_0xa60f('0x31')](_0xa60f('0x2b'));if(_0x31b404['query']['type']===_0xa60f('0x4a')){_0x426778['push']([_0xa60f('0x4b'),_0xa60f('0x4c')]);}}_0x31b404[_0xa60f('0x10')][_0xa60f('0x1f')]=_0x426778[_0xa60f('0x20')](',');}_0x3b7156=qs[_0xa60f('0x2f')](_0x34c395,_0x31b404);if(_0x31b404[_0xa60f('0x35')][_0xa60f('0x2d')]===_0xa60f('0x35')){var _0x146230={'params':{'id':_0x31b404[_0xa60f('0x35')][_0xa60f('0x36')]},'query':{'section':_0x9e567e===_0xa60f('0x40')&&_0x31b404[_0xa60f('0x10')]['type']===_0xa60f('0x4a')?'QueueCampaigns':_['startCase'](_0x9e567e)+_0xa60f('0x4d'),'type':_0x31b404['query'][_0xa60f('0x2b')],'nolimit':!![],'sort':'name','filter':_0x31b404[_0xa60f('0x10')]['filter']}};_0x146230[_0xa60f('0x10')]=Object['assign'](_0x146230[_0xa60f('0x10')],_0x31b404[_0xa60f('0x10')]);delete _0x146230[_0xa60f('0x10')]['id'];return db['UserProfile']['getResources'](_0x146230);}return db[_0x1c41be][_0xa60f('0x3c')](_0x3b7156);})[_0xa60f('0x15')](function(_0x17987a){_0x21d87a[_0xa60f('0x9')]=_0x17987a[_0xa60f('0x9')];_0x17fb76=_0x17987a[_0xa60f('0x23')];return rtq['getRealtimeQueues'](_0x31b404,_0x9e567e);})[_0xa60f('0x15')](function(_0x42ae3d){_0x40aebd=_0x42ae3d[_0xa60f('0x23')];return rtq[_0xa60f('0x4e')](_0x17fb76,_0x40aebd,_0x9e567e,_0x31b404['query'][_0xa60f('0x2b')]);})[_0xa60f('0x15')](function(_0x485155){_0x21d87a[_0xa60f('0x23')]=_0x485155;return _0x21d87a;})[_0xa60f('0x15')](respondWithFilteredResult(_0x3f8641,_0x3b7156))[_0xa60f('0x47')](APIHandleError(_0x3f8641));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index c77d3f3..ffa3740 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(_0x2b9c0c,_0x4678a3){var _0xd8577b=function(_0x2dd9eb){while(--_0x2dd9eb){_0x2b9c0c['push'](_0x2b9c0c['shift']());}};_0xd8577b(++_0x4678a3);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e2a2c,_0x1c0399){var _0x2763c4=function(_0x2c3899){while(--_0x2c3899){_0x1e2a2c['push'](_0x1e2a2c['shift']());}};_0x2763c4(++_0x1c0399);}(_0x70e0,0x17b));var _0x070e=function(_0xfbf9f8,_0x1ee4ca){_0xfbf9f8=_0xfbf9f8-0x0;var _0x5b85db=_0x70e0[_0xfbf9f8];return _0x5b85db;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 42f80ea..37e3c18 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 _0x5294=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x2af946,_0x3d6088){var _0x3ae43d=function(_0x30ac1e){while(--_0x30ac1e){_0x2af946['push'](_0x2af946['shift']());}};_0x3ae43d(++_0x3d6088);}(_0x5294,0x111));var _0x4529=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x5294[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x4529('0x0'));module[_0x4529('0x1')]={'state':{'type':Sequelize[_0x4529('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4529('0x3')]},'scheduledat':{'type':Sequelize[_0x4529('0x4')]},'uniqueid':{'type':Sequelize[_0x4529('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x4529('0x4')]},'ringtime':{'type':Sequelize[_0x4529('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4529('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4529('0x3')]}}; \ No newline at end of file +var _0x6bb4=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x3bb787,_0x5a28a1){var _0x11b9c0=function(_0x364cbc){while(--_0x364cbc){_0x3bb787['push'](_0x3bb787['shift']());}};_0x11b9c0(++_0x5a28a1);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x537fff,_0x1a3cdc){_0x537fff=_0x537fff-0x0;var _0x34889b=_0x6bb4[_0x537fff];return _0x34889b;};'use strict';var Sequelize=require(_0x46bb('0x0'));module[_0x46bb('0x1')]={'state':{'type':Sequelize[_0x46bb('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x46bb('0x3')]},'uniqueid':{'type':Sequelize[_0x46bb('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x46bb('0x3')]},'ringtime':{'type':Sequelize[_0x46bb('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x46bb('0x4')]},'campaigntype':{'type':Sequelize[_0x46bb('0x4')]},'membername':{'type':Sequelize[_0x46bb('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 682cef3..dea540a 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 _0x79c3=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','../../config/logger','api','moment','request-promise'];(function(_0x2bfc60,_0xa254ab){var _0x44ea2c=function(_0x57ca7a){while(--_0x57ca7a){_0x2bfc60['push'](_0x2bfc60['shift']());}};_0x44ea2c(++_0xa254ab);}(_0x79c3,0xd4));var _0x379c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x79c3[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x379c('0x0'))(_0x379c('0x1'));var moment=require(_0x379c('0x2'));var BPromise=require('bluebird');var rp=require(_0x379c('0x3'));var fs=require('fs');var path=require(_0x379c('0x4'));var rimraf=require(_0x379c('0x5'));var config=require(_0x379c('0x6'));var attributes=require(_0x379c('0x7'));module[_0x379c('0x8')]=function(_0x2447f4,_0x18e036){return _0x2447f4[_0x379c('0x9')](_0x379c('0xa'),attributes,{'tableName':_0x379c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4202=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview'];(function(_0x58f472,_0xdbb060){var _0x4d7f8e=function(_0x26dc4c){while(--_0x26dc4c){_0x58f472['push'](_0x58f472['shift']());}};_0x4d7f8e(++_0xdbb060);}(_0x4202,0x1d4));var _0x2420=function(_0x30121e,_0x240c86){_0x30121e=_0x30121e-0x0;var _0x4ba328=_0x4202[_0x30121e];return _0x4ba328;};'use strict';var _=require(_0x2420('0x0'));var util=require(_0x2420('0x1'));var logger=require('../../config/logger')(_0x2420('0x2'));var moment=require(_0x2420('0x3'));var BPromise=require(_0x2420('0x4'));var rp=require(_0x2420('0x5'));var fs=require('fs');var path=require(_0x2420('0x6'));var rimraf=require(_0x2420('0x7'));var config=require(_0x2420('0x8'));var attributes=require(_0x2420('0x9'));module['exports']=function(_0xd69e6b,_0x3ff301){return _0xd69e6b[_0x2420('0xa')](_0x2420('0xb'),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 bc4ea51..fd94bc9 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 _0xcc0f=['ReportAgentPreview','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','CreateReportAgentPreview'];(function(_0x1daeaa,_0x297e73){var _0x2a6032=function(_0x11897b){while(--_0x11897b){_0x1daeaa['push'](_0x1daeaa['shift']());}};_0x2a6032(++_0x297e73);}(_0xcc0f,0x101));var _0xfcc0=function(_0x373925,_0x57badd){_0x373925=_0x373925-0x0;var _0x305525=_0xcc0f[_0x373925];return _0x305525;};'use strict';var _=require('lodash');var util=require(_0xfcc0('0x0'));var moment=require(_0xfcc0('0x1'));var BPromise=require(_0xfcc0('0x2'));var rs=require(_0xfcc0('0x3'));var fs=require('fs');var Redis=require(_0xfcc0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcc0('0x5'));var logger=require('../../config/logger')(_0xfcc0('0x6'));var config=require(_0xfcc0('0x7'));var jayson=require(_0xfcc0('0x8'));var client=jayson[_0xfcc0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1437d9,_0x1ea91b,_0x3aa68d){return new BPromise(function(_0x5e72a5,_0x3ddb82){return client[_0xfcc0('0xa')](_0x1437d9,_0x3aa68d)[_0xfcc0('0xb')](function(_0x3359c3){logger['info'](_0xfcc0('0xc'),_0x1ea91b,'request\x20sent');logger[_0xfcc0('0xd')](_0xfcc0('0xe'),_0x1ea91b,_0xfcc0('0xf'),JSON[_0xfcc0('0x10')](_0x3359c3));if(_0x3359c3['error']){if(_0x3359c3['error'][_0xfcc0('0x11')]===0x1f4){logger[_0xfcc0('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x1ea91b,_0x3359c3[_0xfcc0('0x12')][_0xfcc0('0x13')]);return _0x3ddb82(_0x3359c3[_0xfcc0('0x12')][_0xfcc0('0x13')]);}logger['error'](_0xfcc0('0xc'),_0x1ea91b,_0x3359c3[_0xfcc0('0x12')][_0xfcc0('0x13')]);return _0x5e72a5(_0x3359c3['error'][_0xfcc0('0x13')]);}else{logger[_0xfcc0('0x14')](_0xfcc0('0xc'),_0x1ea91b,_0xfcc0('0xf'));_0x5e72a5(_0x3359c3[_0xfcc0('0x15')]['message']);}})['catch'](function(_0x4a151e){logger[_0xfcc0('0x12')](_0xfcc0('0xc'),_0x1ea91b,_0x4a151e);_0x3ddb82(_0x4a151e);});});}exports[_0xfcc0('0x16')]=function(_0x543fe4){var _0x14994c=this;return new Promise(function(_0x5153b0,_0x5b4727){return db[_0xfcc0('0x17')][_0xfcc0('0x18')](_0x543fe4[_0xfcc0('0x19')],{'raw':_0x543fe4[_0xfcc0('0x1a')]?_0x543fe4[_0xfcc0('0x1a')][_0xfcc0('0x1b')]===undefined?!![]:![]:!![]})[_0xfcc0('0xb')](function(_0xc775fa){logger['info'](_0xfcc0('0x16'),_0x543fe4);logger[_0xfcc0('0xd')](_0xfcc0('0x16'),_0x543fe4,JSON[_0xfcc0('0x10')](_0xc775fa));_0x5153b0(_0xc775fa);})['catch'](function(_0x123242){logger['error'](_0xfcc0('0x16'),_0x123242[_0xfcc0('0x13')],_0x543fe4);_0x5b4727(_0x14994c[_0xfcc0('0x12')](0x1f4,_0x123242[_0xfcc0('0x13')]));});});}; \ No newline at end of file +var _0x2756=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','util'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x2756,0x151));var _0x6275=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0x2756[_0x59710f];return _0xaae66a;};'use strict';var _=require('lodash');var util=require(_0x6275('0x0'));var moment=require(_0x6275('0x1'));var BPromise=require(_0x6275('0x2'));var rs=require(_0x6275('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6275('0x4'));var logger=require(_0x6275('0x5'))(_0x6275('0x6'));var config=require(_0x6275('0x7'));var jayson=require(_0x6275('0x8'));var client=jayson[_0x6275('0x9')][_0x6275('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x320115,_0x271312,_0x4d47b9){return new BPromise(function(_0x5a6b51,_0x2c2627){return client['request'](_0x320115,_0x4d47b9)[_0x6275('0xb')](function(_0x5aeabe){logger[_0x6275('0xc')](_0x6275('0xd'),_0x271312,'request\x20sent');logger[_0x6275('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x271312,_0x6275('0xf'),JSON[_0x6275('0x10')](_0x5aeabe));if(_0x5aeabe[_0x6275('0x11')]){if(_0x5aeabe['error']['code']===0x1f4){logger[_0x6275('0x11')](_0x6275('0xd'),_0x271312,_0x5aeabe[_0x6275('0x11')]['message']);return _0x2c2627(_0x5aeabe['error'][_0x6275('0x12')]);}logger[_0x6275('0x11')](_0x6275('0xd'),_0x271312,_0x5aeabe['error'][_0x6275('0x12')]);return _0x5a6b51(_0x5aeabe['error']['message']);}else{logger[_0x6275('0xc')](_0x6275('0xd'),_0x271312,_0x6275('0xf'));_0x5a6b51(_0x5aeabe[_0x6275('0x13')]['message']);}})[_0x6275('0x14')](function(_0x4fd8a6){logger['error'](_0x6275('0xd'),_0x271312,_0x4fd8a6);_0x2c2627(_0x4fd8a6);});});}exports[_0x6275('0x15')]=function(_0xd908cc){var _0x202142=this;return new Promise(function(_0x25615,_0x2cf810){return db[_0x6275('0x16')]['create'](_0xd908cc[_0x6275('0x17')],{'raw':_0xd908cc[_0x6275('0x18')]?_0xd908cc[_0x6275('0x18')][_0x6275('0x19')]===undefined?!![]:![]:!![]})[_0x6275('0xb')](function(_0x9f955f){logger[_0x6275('0xc')]('CreateReportAgentPreview',_0xd908cc);logger[_0x6275('0xe')](_0x6275('0x15'),_0xd908cc,JSON[_0x6275('0x10')](_0x9f955f));_0x25615(_0x9f955f);})[_0x6275('0x14')](function(_0x2fb417){logger[_0x6275('0x11')]('CreateReportAgentPreview',_0x2fb417[_0x6275('0x12')],_0xd908cc);_0x2cf810(_0x202142[_0x6275('0x11')](0x1f4,_0x2fb417[_0x6275('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index e990de9..d1fe76f 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 _0x9a1f=['voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','exports','multer','util','path','express','Router','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels'];(function(_0x100e29,_0x1b210e){var _0x4ff1ce=function(_0x4fe8b7){while(--_0x4fe8b7){_0x100e29['push'](_0x100e29['shift']());}};_0x4ff1ce(++_0x1b210e);}(_0x9a1f,0xd9));var _0xf9a1=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x9a1f[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xf9a1('0x0'));var util=require(_0xf9a1('0x1'));var path=require(_0xf9a1('0x2'));var express=require(_0xf9a1('0x3'));var router=express[_0xf9a1('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get'](_0xf9a1('0x5'),auth['isAuthenticated'](),controller[_0xf9a1('0x6')]);router[_0xf9a1('0x7')](_0xf9a1('0x8'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0xa')]);router[_0xf9a1('0x7')](_0xf9a1('0xb'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0xc')]);router[_0xf9a1('0x7')](_0xf9a1('0xd'),auth['isAuthenticated'](),controller['voiceQueues']);router['get'](_0xf9a1('0xe'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0xf')]);router['get'](_0xf9a1('0x10'),auth['isAuthenticated'](),controller[_0xf9a1('0x11')]);router[_0xf9a1('0x7')](_0xf9a1('0x12'),auth[_0xf9a1('0x9')](),controller['mailAccounts']);router[_0xf9a1('0x7')](_0xf9a1('0x13'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x14')]);router[_0xf9a1('0x7')](_0xf9a1('0x15'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x16')]);router[_0xf9a1('0x7')](_0xf9a1('0x17'),auth[_0xf9a1('0x9')](),controller['whatsappQueues']);router[_0xf9a1('0x7')](_0xf9a1('0x18'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x19')]);router['get'](_0xf9a1('0x1a'),auth['isAuthenticated'](),controller[_0xf9a1('0x1b')]);router[_0xf9a1('0x7')](_0xf9a1('0x1c'),auth['isAuthenticated'](),controller[_0xf9a1('0x1d')]);router[_0xf9a1('0x7')](_0xf9a1('0x1e'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x1f')]);router[_0xf9a1('0x7')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x20')]);router[_0xf9a1('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0xf9a1('0x21')]);router[_0xf9a1('0x7')](_0xf9a1('0x22'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x23')]);router[_0xf9a1('0x24')](_0xf9a1('0x22'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x25')]);router[_0xf9a1('0x7')]('/outbound',auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x26')]);router[_0xf9a1('0x7')](_0xf9a1('0x27'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x28')]);router[_0xf9a1('0x7')](_0xf9a1('0x29'),auth['isAuthenticated'](),controller[_0xf9a1('0x2a')]);router[_0xf9a1('0x24')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0xf9a1('0x2b')]);router['get'](_0xf9a1('0x2c'),auth[_0xf9a1('0x9')](),controller['telephones']);router[_0xf9a1('0x7')](_0xf9a1('0x2d'),auth['isAuthenticated'](),controller['trunks']);router['get'](_0xf9a1('0x2e'),auth[_0xf9a1('0x9')](),controller['campaigns']);router[_0xf9a1('0x7')](_0xf9a1('0x2f'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x30')]);router[_0xf9a1('0x7')](_0xf9a1('0x31'),auth[_0xf9a1('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0xf9a1('0x7')](_0xf9a1('0x32'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x33')]);router[_0xf9a1('0x7')](_0xf9a1('0x34'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x35')]);router[_0xf9a1('0x7')](_0xf9a1('0x36'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x37')]);router[_0xf9a1('0x7')](_0xf9a1('0x38'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x39')]);router[_0xf9a1('0x7')](_0xf9a1('0x3a'),auth[_0xf9a1('0x9')](),controller['whatsappQueuesWaitingInteractions']);router[_0xf9a1('0x7')](_0xf9a1('0x3b'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x3c')]);router[_0xf9a1('0x3d')](_0xf9a1('0x3e'),auth[_0xf9a1('0x9')](),controller['queueNotify'](_0xf9a1('0x3f')));router[_0xf9a1('0x7')](_0xf9a1('0x40'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x41')]);router[_0xf9a1('0x3d')](_0xf9a1('0x42'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x43')](_0xf9a1('0x44')));router[_0xf9a1('0x7')](_0xf9a1('0x45'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x46')]);router[_0xf9a1('0x3d')](_0xf9a1('0x47'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x43')](_0xf9a1('0x48')));router[_0xf9a1('0x7')]('/fax/queues/:id',auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x49')]);router[_0xf9a1('0x3d')]('/openchannel/queues/:id/notify',auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x43')](_0xf9a1('0x4a')));router[_0xf9a1('0x7')]('/openchannel/queues/:id',auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x4b')]);router['post'](_0xf9a1('0x4c'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x43')](_0xf9a1('0x4d')));router[_0xf9a1('0x3d')](_0xf9a1('0x4e'),auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x43')](_0xf9a1('0x4f')));router[_0xf9a1('0x7')]('/sms/queues/:id',auth[_0xf9a1('0x9')](),controller[_0xf9a1('0x50')]);router[_0xf9a1('0x7')]('/whatsapp/queues/:id',auth[_0xf9a1('0x9')](),controller['showWhatsappQueues']);router['post']('/agents/:id/notify',auth['isAuthenticated'](),controller['agentNotify']);module[_0xf9a1('0x51')]=router; \ No newline at end of file +var _0xe6b2=['/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','outboundChannels','agents','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xe6b2,0x1c4));var _0x2e6b=function(_0x41232a,_0x20440d){_0x41232a=_0x41232a-0x0;var _0x1ab731=_0xe6b2[_0x41232a];return _0x1ab731;};'use strict';var multer=require('multer');var util=require(_0x2e6b('0x0'));var path=require(_0x2e6b('0x1'));var express=require(_0x2e6b('0x2'));var router=express[_0x2e6b('0x3')]();var auth=require(_0x2e6b('0x4'));var controller=require(_0x2e6b('0x5'));router[_0x2e6b('0x6')](_0x2e6b('0x7'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x9')]);router[_0x2e6b('0x6')](_0x2e6b('0xa'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0xb')]);router[_0x2e6b('0x6')](_0x2e6b('0xc'),auth['isAuthenticated'](),controller[_0x2e6b('0xd')]);router[_0x2e6b('0x6')](_0x2e6b('0xe'),auth['isAuthenticated'](),controller[_0x2e6b('0xf')]);router[_0x2e6b('0x6')](_0x2e6b('0x10'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x11')]);router['get']('/mail/queues',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x12')]);router['get'](_0x2e6b('0x13'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x14')]);router[_0x2e6b('0x6')](_0x2e6b('0x15'),auth[_0x2e6b('0x8')](),controller['openchannelQueues']);router[_0x2e6b('0x6')](_0x2e6b('0x16'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x17')]);router['get']('/whatsapp/queues',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x18')]);router[_0x2e6b('0x6')](_0x2e6b('0x19'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x1a')]);router[_0x2e6b('0x6')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x2e6b('0x1b')]);router[_0x2e6b('0x6')](_0x2e6b('0x1c'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x1d')]);router[_0x2e6b('0x6')](_0x2e6b('0x1e'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x1f')]);router[_0x2e6b('0x6')](_0x2e6b('0x20'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x21')]);router[_0x2e6b('0x6')](_0x2e6b('0x22'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x23')]);router['get'](_0x2e6b('0x24'),auth['isAuthenticated'](),controller[_0x2e6b('0x25')]);router[_0x2e6b('0x26')](_0x2e6b('0x24'),auth[_0x2e6b('0x8')](),controller['updateVoiceQueue']);router[_0x2e6b('0x6')](_0x2e6b('0x27'),auth['isAuthenticated'](),controller[_0x2e6b('0x28')]);router[_0x2e6b('0x6')]('/outbound/channels',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x29')]);router[_0x2e6b('0x6')]('/agents',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x2a')]);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller['agentCapacity']);router[_0x2e6b('0x6')]('/telephones',auth['isAuthenticated'](),controller[_0x2e6b('0x2b')]);router['get'](_0x2e6b('0x2c'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x2d')]);router[_0x2e6b('0x6')]('/campaigns',auth['isAuthenticated'](),controller[_0x2e6b('0x2e')]);router['get'](_0x2e6b('0x2f'),auth['isAuthenticated'](),controller[_0x2e6b('0x30')]);router[_0x2e6b('0x6')]('/chat/queues/waitinginteractions',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x31')]);router['get'](_0x2e6b('0x32'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x33')]);router[_0x2e6b('0x6')](_0x2e6b('0x34'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x2e6b('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x35')]);router['get'](_0x2e6b('0x36'),auth['isAuthenticated'](),controller[_0x2e6b('0x37')]);router['get'](_0x2e6b('0x38'),auth[_0x2e6b('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0x2e6b('0x6')](_0x2e6b('0x39'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x3a')]);router[_0x2e6b('0x3b')](_0x2e6b('0x3c'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x3d')](_0x2e6b('0x3e')));router[_0x2e6b('0x6')]('/mail/queues/:id',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x3f')]);router['post'](_0x2e6b('0x40'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x3d')](_0x2e6b('0x41')));router['get'](_0x2e6b('0x42'),auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x43')]);router[_0x2e6b('0x3b')](_0x2e6b('0x44'),auth['isAuthenticated'](),controller[_0x2e6b('0x3d')](_0x2e6b('0x45')));router[_0x2e6b('0x6')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x2e6b('0x46')]);router['post'](_0x2e6b('0x47'),auth['isAuthenticated'](),controller[_0x2e6b('0x3d')]('openchannel'));router[_0x2e6b('0x6')](_0x2e6b('0x48'),auth['isAuthenticated'](),controller[_0x2e6b('0x49')]);router['post']('/sms/queues/:id/notify',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x3d')]('sms'));router[_0x2e6b('0x3b')]('/whatsapp/queues/:id/notify',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x3d')]('whatsapp'));router[_0x2e6b('0x6')](_0x2e6b('0x4a'),auth[_0x2e6b('0x8')](),controller['showSmsQueues']);router[_0x2e6b('0x6')]('/whatsapp/queues/:id',auth[_0x2e6b('0x8')](),controller['showWhatsappQueues']);router[_0x2e6b('0x3b')]('/agents/:id/notify',auth[_0x2e6b('0x8')](),controller[_0x2e6b('0x4b')]);module[_0x2e6b('0x4c')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index af089db..f19ad89 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x3de787,_0x22d154){var _0x5b9f08=function(_0x3cd2b0){while(--_0x3cd2b0){_0x3de787['push'](_0x3de787['shift']());}};_0x5b9f08(++_0x22d154);}(_0xe706,0xa3));var _0x6e70=function(_0x2584bc,_0x35d9f5){_0x2584bc=_0x2584bc-0x0;var _0x405f2c=_0xe706[_0x2584bc];return _0x405f2c;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x2ec036,_0x365efa){var _0x1806dc=function(_0x1ec1dc){while(--_0x1ec1dc){_0x2ec036['push'](_0x2ec036['shift']());}};_0x1806dc(++_0x365efa);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 488977f..1a0a349 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 _0xdeee=['run','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./schedule.controller','index','/:id','show','isAuthenticated'];(function(_0x718f1f,_0x2e2338){var _0x48b289=function(_0x524e31){while(--_0x524e31){_0x718f1f['push'](_0x718f1f['shift']());}};_0x48b289(++_0x2e2338);}(_0xdeee,0x110));var _0xedee=function(_0x22db22,_0x203b71){_0x22db22=_0x22db22-0x0;var _0x4246f0=_0xdeee[_0x22db22];return _0x4246f0;};'use strict';var multer=require(_0xedee('0x0'));var util=require(_0xedee('0x1'));var path=require(_0xedee('0x2'));var timeout=require(_0xedee('0x3'));var express=require(_0xedee('0x4'));var router=express[_0xedee('0x5')]();var fs_extra=require(_0xedee('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xedee('0x7'));var config=require('../../config/environment');var controller=require(_0xedee('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xedee('0x9')]);router['get'](_0xedee('0xa'),auth['isAuthenticated'](),controller[_0xedee('0xb')]);router['get']('/:id/run',auth[_0xedee('0xc')](),controller[_0xedee('0xd')]);router[_0xedee('0xe')]('/',auth[_0xedee('0xc')](),controller[_0xedee('0xf')]);router[_0xedee('0x10')](_0xedee('0xa'),auth[_0xedee('0xc')](),controller[_0xedee('0x11')]);router[_0xedee('0x12')](_0xedee('0xa'),auth[_0xedee('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf9d7=['destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','show','/:id/run','run','post','create','/:id'];(function(_0x11792d,_0x4a9bb3){var _0x3086d2=function(_0x31c8ac){while(--_0x31c8ac){_0x11792d['push'](_0x11792d['shift']());}};_0x3086d2(++_0x4a9bb3);}(_0xf9d7,0xce));var _0x7f9d=function(_0x377199,_0x1439fa){_0x377199=_0x377199-0x0;var _0x501155=_0xf9d7[_0x377199];return _0x501155;};'use strict';var multer=require('multer');var util=require(_0x7f9d('0x0'));var path=require(_0x7f9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x7f9d('0x2'));var router=express[_0x7f9d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f9d('0x4'));var interaction=require(_0x7f9d('0x5'));var config=require('../../config/environment');var controller=require(_0x7f9d('0x6'));router[_0x7f9d('0x7')]('/',auth[_0x7f9d('0x8')](),controller['index']);router[_0x7f9d('0x7')]('/:id',auth[_0x7f9d('0x8')](),controller[_0x7f9d('0x9')]);router[_0x7f9d('0x7')](_0x7f9d('0xa'),auth[_0x7f9d('0x8')](),controller[_0x7f9d('0xb')]);router[_0x7f9d('0xc')]('/',auth['isAuthenticated'](),controller[_0x7f9d('0xd')]);router['put'](_0x7f9d('0xe'),auth[_0x7f9d('0x8')](),controller['update']);router['delete'](_0x7f9d('0xe'),auth['isAuthenticated'](),controller[_0x7f9d('0xf')]);module[_0x7f9d('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2e10dee..bed7d48 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 _0xbb25=['quarters','months','days','hours','minutes','ENUM','pdf','xlsx','csv','custom','default','TEXT','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbb25,0xa4));var _0x5bb2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbb25[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5bb2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5bb2('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5bb2('0x2')],'allowNull':![],'defaultValue':_0x5bb2('0x3')},'startAt':{'type':Sequelize[_0x5bb2('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5bb2('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x5bb2('0x6'),_0x5bb2('0x7'),_0x5bb2('0x8'),'weeks',_0x5bb2('0x9'),_0x5bb2('0xa'),_0x5bb2('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x5bb2('0xc')]('csv',_0x5bb2('0xd'),_0x5bb2('0xe')),'allowNull':![],'defaultValue':_0x5bb2('0xf')},'type':{'type':Sequelize[_0x5bb2('0xc')](_0x5bb2('0x10'),_0x5bb2('0x11')),'allowNull':![],'defaultValue':_0x5bb2('0x10')},'sendMail':{'type':Sequelize[_0x5bb2('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x5bb2('0x2')]},'cc':{'type':Sequelize[_0x5bb2('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xfb8f=['xlsx','custom','default','STRING','sequelize','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','days','csv','pdf'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfb8f,0x1e5));var _0xffb8=function(_0x34107f,_0x5a3ed1){_0x34107f=_0x34107f-0x0;var _0x563191=_0xfb8f[_0x34107f];return _0x563191;};'use strict';var Sequelize=require(_0xffb8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xffb8('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xffb8('0x2')},'startAt':{'type':Sequelize[_0xffb8('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xffb8('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xffb8('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xffb8('0x5'),'quarters','months','weeks','days','hours','minutes'),'allowNull':![],'defaultValue':_0xffb8('0x6')},'output':{'type':Sequelize['ENUM'](_0xffb8('0x7'),_0xffb8('0x8'),_0xffb8('0x9')),'allowNull':![],'defaultValue':_0xffb8('0x7')},'type':{'type':Sequelize['ENUM'](_0xffb8('0xa'),_0xffb8('0xb')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xffb8('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xffb8('0xc')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xffb8('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 0673ff4..7539a3a 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 _0x7f93=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','reject','save','update','then','get','Scheduler','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0xaaec73,_0x3b0d5a){var _0xfa096e=function(_0x249242){while(--_0x249242){_0xaaec73['push'](_0xaaec73['shift']());}};_0xfa096e(++_0x3b0d5a);}(_0x7f93,0x18d));var _0x37f9=function(_0x2a87c1,_0x170800){_0x2a87c1=_0x2a87c1-0x0;var _0x18eaa3=_0x7f93[_0x2a87c1];return _0x18eaa3;};'use strict';var emlformat=require(_0x37f9('0x0'));var rimraf=require(_0x37f9('0x1'));var zipdir=require(_0x37f9('0x2'));var jsonpatch=require(_0x37f9('0x3'));var rp=require(_0x37f9('0x4'));var moment=require('moment');var BPromise=require(_0x37f9('0x5'));var Mustache=require(_0x37f9('0x6'));var util=require(_0x37f9('0x7'));var path=require(_0x37f9('0x8'));var sox=require(_0x37f9('0x9'));var csv=require('to-csv');var ejs=require(_0x37f9('0xa'));var fs=require('fs');var fs_extra=require(_0x37f9('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x37f9('0xc'));var deskjs=require(_0x37f9('0xd'));var toCsv=require(_0x37f9('0xe'));var querystring=require(_0x37f9('0xf'));var Papa=require(_0x37f9('0x10'));var Redis=require(_0x37f9('0x11'));var authService=require(_0x37f9('0x12'));var qs=require(_0x37f9('0x13'));var as=require(_0x37f9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37f9('0x15'))(_0x37f9('0x16'));var utils=require(_0x37f9('0x17'));var config=require(_0x37f9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x37f9('0x19'))['db'];function respondWithStatusCode(_0x803eb7,_0x51e026){_0x51e026=_0x51e026||0xcc;return function(_0x314767){if(_0x314767){return _0x803eb7[_0x37f9('0x1a')](_0x51e026);}return _0x803eb7['status'](_0x51e026)['end']();};}function respondWithResult(_0x11b549,_0x20e146){_0x20e146=_0x20e146||0xc8;return function(_0x22251d){if(_0x22251d){return _0x11b549[_0x37f9('0x1b')](_0x20e146)['json'](_0x22251d);}};}function respondWithFilteredResult(_0x5cf5f0,_0x16fa76){return function(_0x586ab2){if(_0x586ab2){var _0x5a39b4=typeof _0x16fa76[_0x37f9('0x1c')]==='undefined'&&typeof _0x16fa76[_0x37f9('0x1d')]===_0x37f9('0x1e');var _0x159793=_0x586ab2['count'];var _0x131cee=_0x5a39b4?0x0:_0x16fa76[_0x37f9('0x1c')];var _0x1559e1=_0x5a39b4?_0x586ab2[_0x37f9('0x1f')]:_0x16fa76[_0x37f9('0x1c')]+_0x16fa76[_0x37f9('0x1d')];var _0x25229a;if(_0x1559e1>=_0x159793){_0x1559e1=_0x159793;_0x25229a=0xc8;}else{_0x25229a=0xce;}_0x5cf5f0['status'](_0x25229a);return _0x5cf5f0[_0x37f9('0x20')]('Content-Range',_0x131cee+'-'+_0x1559e1+'/'+_0x159793)[_0x37f9('0x21')](_0x586ab2);}return null;};}function patchUpdates(_0x5ae1d0){return function(_0x3af697){try{jsonpatch['apply'](_0x3af697,_0x5ae1d0,!![]);}catch(_0x1daed2){return BPromise[_0x37f9('0x22')](_0x1daed2);}return _0x3af697[_0x37f9('0x23')]();};}function saveUpdates(_0x19503a,_0x3eaa60){return function(_0x41ef4c){if(_0x41ef4c){return _0x41ef4c[_0x37f9('0x24')](_0x19503a)[_0x37f9('0x25')](function(_0x2fae24){return _0x2fae24;});}return null;};}function removeEntity(_0x1f8875,_0x5a7f91){return function(_0x7e4ef6){if(_0x7e4ef6){return _0x7e4ef6['destroy']()[_0x37f9('0x25')](function(){var _0x356e21=_0x7e4ef6[_0x37f9('0x26')]({'plain':!![]});var _0x168224=_0x37f9('0x27');return db['UserProfileResource'][_0x37f9('0x28')]({'where':{'type':_0x168224,'resourceId':_0x356e21['id']}})[_0x37f9('0x25')](function(){return _0x7e4ef6;});})[_0x37f9('0x25')](function(){_0x1f8875['status'](0xcc)[_0x37f9('0x29')]();});}};}function handleEntityNotFound(_0x500c43,_0x24f1fd){return function(_0x2315aa){if(!_0x2315aa){_0x500c43[_0x37f9('0x1a')](0x194);}return _0x2315aa;};}function handleError(_0x5b53eb,_0x32bb5d){_0x32bb5d=_0x32bb5d||0x1f4;return function(_0x5a97a5){logger[_0x37f9('0x2a')](_0x5a97a5[_0x37f9('0x2b')]);if(_0x5a97a5[_0x37f9('0x2c')]){delete _0x5a97a5[_0x37f9('0x2c')];}_0x5b53eb[_0x37f9('0x1b')](_0x32bb5d)[_0x37f9('0x2d')](_0x5a97a5);};}exports[_0x37f9('0x2e')]=function(_0x273b90,_0x152830){var _0x53e2ce={},_0x25a1b8={},_0x1b3275={'count':0x0,'rows':[]};var _0x592f23=_['map'](db['Schedule'][_0x37f9('0x2f')],function(_0x33a332){return{'name':_0x33a332[_0x37f9('0x30')],'type':_0x33a332['type']['key']};});_0x25a1b8['model']=_['map'](_0x592f23,_0x37f9('0x2c'));_0x25a1b8[_0x37f9('0x31')]=_[_0x37f9('0x32')](_0x273b90[_0x37f9('0x31')]);_0x25a1b8[_0x37f9('0x33')]=_[_0x37f9('0x34')](_0x25a1b8[_0x37f9('0x35')],_0x25a1b8['query']);_0x53e2ce[_0x37f9('0x36')]=_[_0x37f9('0x34')](_0x25a1b8[_0x37f9('0x35')],qs[_0x37f9('0x37')](_0x273b90[_0x37f9('0x31')][_0x37f9('0x37')]));_0x53e2ce[_0x37f9('0x36')]=_0x53e2ce[_0x37f9('0x36')][_0x37f9('0x38')]?_0x53e2ce['attributes']:_0x25a1b8['model'];if(!_0x273b90[_0x37f9('0x31')][_0x37f9('0x39')](_0x37f9('0x3a'))){_0x53e2ce[_0x37f9('0x1d')]=qs[_0x37f9('0x1d')](_0x273b90[_0x37f9('0x31')][_0x37f9('0x1d')]);_0x53e2ce[_0x37f9('0x1c')]=qs[_0x37f9('0x1c')](_0x273b90[_0x37f9('0x31')]['offset']);}_0x53e2ce['order']=qs['sort'](_0x273b90[_0x37f9('0x31')][_0x37f9('0x3b')]);_0x53e2ce[_0x37f9('0x3c')]=qs['filters'](_[_0x37f9('0x3d')](_0x273b90[_0x37f9('0x31')],_0x25a1b8[_0x37f9('0x33')]),_0x592f23);if(_0x273b90['query'][_0x37f9('0x3e')]){_0x53e2ce[_0x37f9('0x3c')]=_[_0x37f9('0x3f')](_0x53e2ce[_0x37f9('0x3c')],{'$or':_[_0x37f9('0x40')](_0x592f23,function(_0x355e1a){if(_0x355e1a['type']!==_0x37f9('0x41')){var _0x2f4e82={};_0x2f4e82[_0x355e1a[_0x37f9('0x2c')]]={'$like':'%'+_0x273b90['query']['filter']+'%'};return _0x2f4e82;}})});}_0x53e2ce=_[_0x37f9('0x3f')]({},_0x53e2ce,_0x273b90[_0x37f9('0x42')]);var _0x5bb2d4={'where':_0x53e2ce[_0x37f9('0x3c')]};return db[_0x37f9('0x43')][_0x37f9('0x1f')](_0x5bb2d4)[_0x37f9('0x25')](function(_0x4c6db7){_0x1b3275[_0x37f9('0x1f')]=_0x4c6db7;if(_0x273b90[_0x37f9('0x31')][_0x37f9('0x44')]){_0x53e2ce[_0x37f9('0x45')]=[{'all':!![]}];}return db[_0x37f9('0x43')][_0x37f9('0x46')](_0x53e2ce);})['then'](function(_0x4d0983){_0x1b3275[_0x37f9('0x47')]=_0x4d0983;return _0x1b3275;})[_0x37f9('0x25')](respondWithFilteredResult(_0x152830,_0x53e2ce))[_0x37f9('0x48')](handleError(_0x152830,null));};exports[_0x37f9('0x49')]=function(_0x2555a5,_0x2af866){var _0x1d1404={'raw':![],'where':{'id':_0x2555a5[_0x37f9('0x4a')]['id']}},_0x1a3da1={};_0x1a3da1[_0x37f9('0x35')]=_[_0x37f9('0x32')](db[_0x37f9('0x43')][_0x37f9('0x2f')]);_0x1a3da1[_0x37f9('0x31')]=_[_0x37f9('0x32')](_0x2555a5['query']);_0x1a3da1[_0x37f9('0x33')]=_[_0x37f9('0x34')](_0x1a3da1[_0x37f9('0x35')],_0x1a3da1[_0x37f9('0x31')]);_0x1d1404[_0x37f9('0x36')]=_[_0x37f9('0x34')](_0x1a3da1[_0x37f9('0x35')],qs[_0x37f9('0x37')](_0x2555a5[_0x37f9('0x31')][_0x37f9('0x37')]));_0x1d1404[_0x37f9('0x36')]=_0x1d1404[_0x37f9('0x36')][_0x37f9('0x38')]?_0x1d1404[_0x37f9('0x36')]:_0x1a3da1[_0x37f9('0x35')];if(_0x2555a5[_0x37f9('0x31')][_0x37f9('0x44')]){_0x1d1404['include']=[{'all':!![]}];}_0x1d1404=_[_0x37f9('0x3f')]({},_0x1d1404,_0x2555a5['options']);return db[_0x37f9('0x43')][_0x37f9('0x4b')](_0x1d1404)['then'](handleEntityNotFound(_0x2af866,null))['then'](respondWithResult(_0x2af866,null))['catch'](handleError(_0x2af866,null));};exports[_0x37f9('0x4c')]=function(_0x7e71be,_0x4eedb0){return db[_0x37f9('0x43')]['create'](_0x7e71be[_0x37f9('0x4d')],{})[_0x37f9('0x25')](function(_0x155333){var _0x1873d8=_0x7e71be['user'][_0x37f9('0x26')]({'plain':!![]});if(!_0x1873d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1873d8['role']===_0x37f9('0x4e')){var _0x568bbf=_0x155333[_0x37f9('0x26')]({'plain':!![]});var _0x13712e=_0x37f9('0x27');return db['UserProfileSection'][_0x37f9('0x4b')]({'where':{'name':_0x13712e,'userProfileId':_0x1873d8[_0x37f9('0x4f')]},'raw':!![]})[_0x37f9('0x25')](function(_0x1f3a54){if(_0x1f3a54&&_0x1f3a54['autoAssociation']===0x0){return db['UserProfileResource'][_0x37f9('0x4c')]({'name':_0x568bbf[_0x37f9('0x2c')],'resourceId':_0x568bbf['id'],'type':_0x1f3a54[_0x37f9('0x2c')],'sectionId':_0x1f3a54['id']},{})['then'](function(){return _0x155333;});}else{return _0x155333;}})[_0x37f9('0x48')](function(_0x5845b9){logger[_0x37f9('0x2a')](_0x37f9('0x50'),_0x5845b9);throw _0x5845b9;});}return _0x155333;})[_0x37f9('0x25')](respondWithResult(_0x4eedb0,0xc9))[_0x37f9('0x48')](handleError(_0x4eedb0,null));};exports['update']=function(_0x2283da,_0x2a136d){if(_0x2283da[_0x37f9('0x4d')]['id']){delete _0x2283da[_0x37f9('0x4d')]['id'];}return db['Schedule'][_0x37f9('0x4b')]({'where':{'id':_0x2283da[_0x37f9('0x4a')]['id']}})[_0x37f9('0x25')](handleEntityNotFound(_0x2a136d,null))[_0x37f9('0x25')](saveUpdates(_0x2283da[_0x37f9('0x4d')],null))['then'](respondWithResult(_0x2a136d,null))['catch'](handleError(_0x2a136d,null));};exports[_0x37f9('0x28')]=function(_0x52a5e6,_0x2a74b9){return db[_0x37f9('0x43')][_0x37f9('0x4b')]({'where':{'id':_0x52a5e6['params']['id']}})['then'](handleEntityNotFound(_0x2a74b9,null))[_0x37f9('0x25')](removeEntity(_0x2a74b9,null))[_0x37f9('0x48')](handleError(_0x2a74b9,null));};exports[_0x37f9('0x51')]=function(_0x298c0a,_0x217b5c,_0x2bcc35){var _0x36ccef=require(_0x37f9('0x52'));return db[_0x37f9('0x43')]['find']({'where':{'id':_0x298c0a[_0x37f9('0x4a')]['id']},'raw':!![]})[_0x37f9('0x25')](handleEntityNotFound(_0x217b5c,null))[_0x37f9('0x25')](function(){_0x36ccef[_0x37f9('0x51')](_0x298c0a[_0x37f9('0x4a')]['id']);})[_0x37f9('0x25')](respondWithStatusCode(_0x217b5c,null))[_0x37f9('0x48')](handleError(_0x217b5c,null));}; \ No newline at end of file +var _0x0f4f=['update','then','get','Scheduler','error','name','index','map','Schedule','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','params','destroy','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0f4f,0xd8));var _0xf0f4=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x0f4f[_0x1b95a1];return _0x57aef1;};'use strict';var emlformat=require(_0xf0f4('0x0'));var rimraf=require(_0xf0f4('0x1'));var zipdir=require(_0xf0f4('0x2'));var jsonpatch=require(_0xf0f4('0x3'));var rp=require(_0xf0f4('0x4'));var moment=require(_0xf0f4('0x5'));var BPromise=require(_0xf0f4('0x6'));var Mustache=require('mustache');var util=require(_0xf0f4('0x7'));var path=require('path');var sox=require(_0xf0f4('0x8'));var csv=require(_0xf0f4('0x9'));var ejs=require(_0xf0f4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0f4('0xb'));var squel=require(_0xf0f4('0xc'));var crypto=require(_0xf0f4('0xd'));var jsforce=require(_0xf0f4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf0f4('0x9'));var querystring=require('querystring');var Papa=require(_0xf0f4('0xf'));var Redis=require(_0xf0f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf0f4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0f4('0x12'));var logger=require(_0xf0f4('0x13'))('api');var utils=require(_0xf0f4('0x14'));var config=require(_0xf0f4('0x15'));var licenseUtil=require(_0xf0f4('0x16'));var db=require(_0xf0f4('0x17'))['db'];function respondWithStatusCode(_0x214e15,_0x22fb95){_0x22fb95=_0x22fb95||0xcc;return function(_0x92426f){if(_0x92426f){return _0x214e15[_0xf0f4('0x18')](_0x22fb95);}return _0x214e15[_0xf0f4('0x19')](_0x22fb95)[_0xf0f4('0x1a')]();};}function respondWithResult(_0x55ce4b,_0x58ca84){_0x58ca84=_0x58ca84||0xc8;return function(_0x5cbeb1){if(_0x5cbeb1){return _0x55ce4b[_0xf0f4('0x19')](_0x58ca84)[_0xf0f4('0x1b')](_0x5cbeb1);}};}function respondWithFilteredResult(_0x12bbe0,_0x57bbd4){return function(_0x21bec7){if(_0x21bec7){var _0x4fcc0a=typeof _0x57bbd4[_0xf0f4('0x1c')]===_0xf0f4('0x1d')&&typeof _0x57bbd4[_0xf0f4('0x1e')]===_0xf0f4('0x1d');var _0x458b15=_0x21bec7[_0xf0f4('0x1f')];var _0x28f512=_0x4fcc0a?0x0:_0x57bbd4[_0xf0f4('0x1c')];var _0x5cfdd8=_0x4fcc0a?_0x21bec7[_0xf0f4('0x1f')]:_0x57bbd4[_0xf0f4('0x1c')]+_0x57bbd4[_0xf0f4('0x1e')];var _0x148f56;if(_0x5cfdd8>=_0x458b15){_0x5cfdd8=_0x458b15;_0x148f56=0xc8;}else{_0x148f56=0xce;}_0x12bbe0[_0xf0f4('0x19')](_0x148f56);return _0x12bbe0[_0xf0f4('0x20')]('Content-Range',_0x28f512+'-'+_0x5cfdd8+'/'+_0x458b15)['json'](_0x21bec7);}return null;};}function patchUpdates(_0x3a3afa){return function(_0xdc7b3f){try{jsonpatch[_0xf0f4('0x21')](_0xdc7b3f,_0x3a3afa,!![]);}catch(_0x588205){return BPromise[_0xf0f4('0x22')](_0x588205);}return _0xdc7b3f[_0xf0f4('0x23')]();};}function saveUpdates(_0x4a069c,_0x2a8f2c){return function(_0x40df51){if(_0x40df51){return _0x40df51[_0xf0f4('0x24')](_0x4a069c)['then'](function(_0x1c54ea){return _0x1c54ea;});}return null;};}function removeEntity(_0x2b131a,_0x212593){return function(_0x37a18d){if(_0x37a18d){return _0x37a18d['destroy']()[_0xf0f4('0x25')](function(){var _0x3a1009=_0x37a18d[_0xf0f4('0x26')]({'plain':!![]});var _0x5ae6d2=_0xf0f4('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x5ae6d2,'resourceId':_0x3a1009['id']}})[_0xf0f4('0x25')](function(){return _0x37a18d;});})['then'](function(){_0x2b131a['status'](0xcc)[_0xf0f4('0x1a')]();});}};}function handleEntityNotFound(_0x4781e1,_0x4cd731){return function(_0x4dfd7c){if(!_0x4dfd7c){_0x4781e1[_0xf0f4('0x18')](0x194);}return _0x4dfd7c;};}function handleError(_0x112446,_0x5cdc8d){_0x5cdc8d=_0x5cdc8d||0x1f4;return function(_0xbb9850){logger[_0xf0f4('0x28')](_0xbb9850['stack']);if(_0xbb9850[_0xf0f4('0x29')]){delete _0xbb9850['name'];}_0x112446['status'](_0x5cdc8d)['send'](_0xbb9850);};}exports[_0xf0f4('0x2a')]=function(_0xc7775,_0x57e840){var _0x24a55e={},_0x15c30c={},_0x140aa3={'count':0x0,'rows':[]};var _0x3d4701=_[_0xf0f4('0x2b')](db[_0xf0f4('0x2c')][_0xf0f4('0x2d')],function(_0x1ec982){return{'name':_0x1ec982[_0xf0f4('0x2e')],'type':_0x1ec982[_0xf0f4('0x2f')][_0xf0f4('0x30')]};});_0x15c30c['model']=_[_0xf0f4('0x2b')](_0x3d4701,_0xf0f4('0x29'));_0x15c30c[_0xf0f4('0x31')]=_[_0xf0f4('0x32')](_0xc7775['query']);_0x15c30c[_0xf0f4('0x33')]=_[_0xf0f4('0x34')](_0x15c30c[_0xf0f4('0x35')],_0x15c30c[_0xf0f4('0x31')]);_0x24a55e[_0xf0f4('0x36')]=_[_0xf0f4('0x34')](_0x15c30c[_0xf0f4('0x35')],qs['fields'](_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x37')]));_0x24a55e[_0xf0f4('0x36')]=_0x24a55e['attributes']['length']?_0x24a55e['attributes']:_0x15c30c['model'];if(!_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x38')](_0xf0f4('0x39'))){_0x24a55e[_0xf0f4('0x1e')]=qs[_0xf0f4('0x1e')](_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x1e')]);_0x24a55e[_0xf0f4('0x1c')]=qs[_0xf0f4('0x1c')](_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x1c')]);}_0x24a55e[_0xf0f4('0x3a')]=qs[_0xf0f4('0x3b')](_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x3b')]);_0x24a55e[_0xf0f4('0x3c')]=qs['filters'](_[_0xf0f4('0x3d')](_0xc7775[_0xf0f4('0x31')],_0x15c30c[_0xf0f4('0x33')]),_0x3d4701);if(_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x3e')]){_0x24a55e[_0xf0f4('0x3c')]=_['merge'](_0x24a55e[_0xf0f4('0x3c')],{'$or':_[_0xf0f4('0x2b')](_0x3d4701,function(_0x562a78){if(_0x562a78[_0xf0f4('0x2f')]!==_0xf0f4('0x3f')){var _0x179b3f={};_0x179b3f[_0x562a78[_0xf0f4('0x29')]]={'$like':'%'+_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x3e')]+'%'};return _0x179b3f;}})});}_0x24a55e=_[_0xf0f4('0x40')]({},_0x24a55e,_0xc7775['options']);var _0x2db435={'where':_0x24a55e[_0xf0f4('0x3c')]};return db[_0xf0f4('0x2c')][_0xf0f4('0x1f')](_0x2db435)[_0xf0f4('0x25')](function(_0x1d58d1){_0x140aa3['count']=_0x1d58d1;if(_0xc7775[_0xf0f4('0x31')][_0xf0f4('0x41')]){_0x24a55e[_0xf0f4('0x42')]=[{'all':!![]}];}return db[_0xf0f4('0x2c')][_0xf0f4('0x43')](_0x24a55e);})[_0xf0f4('0x25')](function(_0x423573){_0x140aa3[_0xf0f4('0x44')]=_0x423573;return _0x140aa3;})['then'](respondWithFilteredResult(_0x57e840,_0x24a55e))[_0xf0f4('0x45')](handleError(_0x57e840,null));};exports[_0xf0f4('0x46')]=function(_0x485d15,_0xdd8c80){var _0x54a43b={'raw':![],'where':{'id':_0x485d15['params']['id']}},_0x574f7e={};_0x574f7e[_0xf0f4('0x35')]=_[_0xf0f4('0x32')](db[_0xf0f4('0x2c')]['rawAttributes']);_0x574f7e[_0xf0f4('0x31')]=_[_0xf0f4('0x32')](_0x485d15[_0xf0f4('0x31')]);_0x574f7e[_0xf0f4('0x33')]=_[_0xf0f4('0x34')](_0x574f7e[_0xf0f4('0x35')],_0x574f7e[_0xf0f4('0x31')]);_0x54a43b[_0xf0f4('0x36')]=_[_0xf0f4('0x34')](_0x574f7e[_0xf0f4('0x35')],qs[_0xf0f4('0x37')](_0x485d15['query'][_0xf0f4('0x37')]));_0x54a43b['attributes']=_0x54a43b[_0xf0f4('0x36')][_0xf0f4('0x47')]?_0x54a43b['attributes']:_0x574f7e[_0xf0f4('0x35')];if(_0x485d15[_0xf0f4('0x31')][_0xf0f4('0x41')]){_0x54a43b[_0xf0f4('0x42')]=[{'all':!![]}];}_0x54a43b=_[_0xf0f4('0x40')]({},_0x54a43b,_0x485d15[_0xf0f4('0x48')]);return db[_0xf0f4('0x2c')]['find'](_0x54a43b)[_0xf0f4('0x25')](handleEntityNotFound(_0xdd8c80,null))[_0xf0f4('0x25')](respondWithResult(_0xdd8c80,null))[_0xf0f4('0x45')](handleError(_0xdd8c80,null));};exports[_0xf0f4('0x49')]=function(_0x5ed9f7,_0xc43d07){return db[_0xf0f4('0x2c')][_0xf0f4('0x49')](_0x5ed9f7[_0xf0f4('0x4a')],{})['then'](function(_0x2b1ef6){var _0x76a871=_0x5ed9f7[_0xf0f4('0x4b')][_0xf0f4('0x26')]({'plain':!![]});if(!_0x76a871)throw new Error(_0xf0f4('0x4c'));if(_0x76a871[_0xf0f4('0x4d')]==='user'){var _0x54c566=_0x2b1ef6['get']({'plain':!![]});var _0x4afda4=_0xf0f4('0x27');return db['UserProfileSection'][_0xf0f4('0x4e')]({'where':{'name':_0x4afda4,'userProfileId':_0x76a871[_0xf0f4('0x4f')]},'raw':!![]})[_0xf0f4('0x25')](function(_0x50ecb7){if(_0x50ecb7&&_0x50ecb7[_0xf0f4('0x50')]===0x0){return db['UserProfileResource'][_0xf0f4('0x49')]({'name':_0x54c566[_0xf0f4('0x29')],'resourceId':_0x54c566['id'],'type':_0x50ecb7[_0xf0f4('0x29')],'sectionId':_0x50ecb7['id']},{})['then'](function(){return _0x2b1ef6;});}else{return _0x2b1ef6;}})[_0xf0f4('0x45')](function(_0x165a7e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x165a7e);throw _0x165a7e;});}return _0x2b1ef6;})[_0xf0f4('0x25')](respondWithResult(_0xc43d07,0xc9))[_0xf0f4('0x45')](handleError(_0xc43d07,null));};exports[_0xf0f4('0x24')]=function(_0x2737a7,_0x477cf5){if(_0x2737a7['body']['id']){delete _0x2737a7[_0xf0f4('0x4a')]['id'];}return db['Schedule'][_0xf0f4('0x4e')]({'where':{'id':_0x2737a7[_0xf0f4('0x51')]['id']}})[_0xf0f4('0x25')](handleEntityNotFound(_0x477cf5,null))[_0xf0f4('0x25')](saveUpdates(_0x2737a7['body'],null))[_0xf0f4('0x25')](respondWithResult(_0x477cf5,null))[_0xf0f4('0x45')](handleError(_0x477cf5,null));};exports[_0xf0f4('0x52')]=function(_0x2456dd,_0x5885d7){return db[_0xf0f4('0x2c')][_0xf0f4('0x4e')]({'where':{'id':_0x2456dd[_0xf0f4('0x51')]['id']}})[_0xf0f4('0x25')](handleEntityNotFound(_0x5885d7,null))[_0xf0f4('0x25')](removeEntity(_0x5885d7,null))[_0xf0f4('0x45')](handleError(_0x5885d7,null));};exports['run']=function(_0x377758,_0x4c501e,_0x42d575){var _0x189035=require(_0xf0f4('0x53'));return db[_0xf0f4('0x2c')][_0xf0f4('0x4e')]({'where':{'id':_0x377758[_0xf0f4('0x51')]['id']},'raw':!![]})[_0xf0f4('0x25')](handleEntityNotFound(_0x4c501e,null))[_0xf0f4('0x25')](function(){_0x189035['run'](_0x377758[_0xf0f4('0x51')]['id']);})['then'](respondWithStatusCode(_0x4c501e,null))[_0xf0f4('0x45')](handleError(_0x4c501e,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c94be86..e7910de 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 _0xe4e5=['define','Schedule','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe4e5,0xf2));var _0x5e4e=function(_0x4da885,_0x5831f4){_0x4da885=_0x4da885-0x0;var _0x5b7773=_0xe4e5[_0x4da885];return _0x5b7773;};'use strict';var _=require(_0x5e4e('0x0'));var util=require('util');var logger=require(_0x5e4e('0x1'))(_0x5e4e('0x2'));var moment=require(_0x5e4e('0x3'));var BPromise=require(_0x5e4e('0x4'));var rp=require(_0x5e4e('0x5'));var fs=require('fs');var path=require(_0x5e4e('0x6'));var rimraf=require(_0x5e4e('0x7'));var config=require(_0x5e4e('0x8'));var attributes=require(_0x5e4e('0x9'));module['exports']=function(_0x43846f,_0x553897){return _0x43846f[_0x5e4e('0xa')](_0x5e4e('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc231=['path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x23b966,_0x1e633d){var _0x4b15ff=function(_0x1b3282){while(--_0x1b3282){_0x23b966['push'](_0x23b966['shift']());}};_0x4b15ff(++_0x1e633d);}(_0xc231,0x192));var _0x1c23=function(_0x5036e9,_0x13a0e1){_0x5036e9=_0x5036e9-0x0;var _0x115fd9=_0xc231[_0x5036e9];return _0x115fd9;};'use strict';var _=require(_0x1c23('0x0'));var util=require(_0x1c23('0x1'));var logger=require(_0x1c23('0x2'))(_0x1c23('0x3'));var moment=require(_0x1c23('0x4'));var BPromise=require(_0x1c23('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c23('0x6'));var rimraf=require(_0x1c23('0x7'));var config=require(_0x1c23('0x8'));var attributes=require(_0x1c23('0x9'));module[_0x1c23('0xa')]=function(_0x57a9dc,_0x1d84c3){return _0x57a9dc['define'](_0x1c23('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index ce68111..f26172f 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 _0x53d4=['../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x53d4,0xac));var _0x453d=function(_0x53c469,_0x766db4){_0x53c469=_0x53c469-0x0;var _0xb33711=_0x53d4[_0x53c469];return _0xb33711;};'use strict';var _=require(_0x453d('0x0'));var util=require(_0x453d('0x1'));var moment=require(_0x453d('0x2'));var BPromise=require(_0x453d('0x3'));var rs=require(_0x453d('0x4'));var fs=require('fs');var Redis=require(_0x453d('0x5'));var db=require(_0x453d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x453d('0x7'))('rpc');var config=require(_0x453d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x453d('0x9')][_0x453d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8207b6,_0x5321fb,_0x1b3014){return new BPromise(function(_0x92fe9b,_0x543f2d){return client[_0x453d('0xb')](_0x8207b6,_0x1b3014)[_0x453d('0xc')](function(_0x36f06f){logger[_0x453d('0xd')](_0x453d('0xe'),_0x5321fb,_0x453d('0xf'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x5321fb,'request\x20sent',JSON['stringify'](_0x36f06f));if(_0x36f06f[_0x453d('0x10')]){if(_0x36f06f['error']['code']===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x5321fb,_0x36f06f['error'][_0x453d('0x11')]);return _0x543f2d(_0x36f06f['error'][_0x453d('0x11')]);}logger[_0x453d('0x10')](_0x453d('0xe'),_0x5321fb,_0x36f06f[_0x453d('0x10')][_0x453d('0x11')]);return _0x92fe9b(_0x36f06f[_0x453d('0x10')][_0x453d('0x11')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x5321fb,_0x453d('0xf'));_0x92fe9b(_0x36f06f['result'][_0x453d('0x11')]);}})['catch'](function(_0x5dcc67){logger[_0x453d('0x10')]('Schedule,\x20%s,\x20%s',_0x5321fb,_0x5dcc67);_0x543f2d(_0x5dcc67);});});} \ No newline at end of file +var _0xd188=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x7f58af,_0x5787cc){var _0x47f99d=function(_0x25a162){while(--_0x25a162){_0x7f58af['push'](_0x7f58af['shift']());}};_0x47f99d(++_0x5787cc);}(_0xd188,0x1f4));var _0x8d18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd188[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8d18('0x0'));var moment=require('moment');var BPromise=require(_0x8d18('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d18('0x2'));var db=require(_0x8d18('0x3'))['db'];var utils=require(_0x8d18('0x4'));var logger=require(_0x8d18('0x5'))(_0x8d18('0x6'));var config=require(_0x8d18('0x7'));var jayson=require(_0x8d18('0x8'));var client=jayson[_0x8d18('0x9')][_0x8d18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39b808,_0x1c3cb9,_0x2d2f43){return new BPromise(function(_0x21e5ac,_0x517d7a){return client[_0x8d18('0xb')](_0x39b808,_0x2d2f43)[_0x8d18('0xc')](function(_0x1eae74){logger[_0x8d18('0xd')](_0x8d18('0xe'),_0x1c3cb9,_0x8d18('0xf'));logger['debug'](_0x8d18('0x10'),_0x1c3cb9,_0x8d18('0xf'),JSON[_0x8d18('0x11')](_0x1eae74));if(_0x1eae74[_0x8d18('0x12')]){if(_0x1eae74[_0x8d18('0x12')][_0x8d18('0x13')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x1c3cb9,_0x1eae74[_0x8d18('0x12')][_0x8d18('0x14')]);return _0x517d7a(_0x1eae74[_0x8d18('0x12')][_0x8d18('0x14')]);}logger[_0x8d18('0x12')](_0x8d18('0xe'),_0x1c3cb9,_0x1eae74[_0x8d18('0x12')][_0x8d18('0x14')]);return _0x21e5ac(_0x1eae74[_0x8d18('0x12')]['message']);}else{logger[_0x8d18('0xd')](_0x8d18('0xe'),_0x1c3cb9,_0x8d18('0xf'));_0x21e5ac(_0x1eae74['result']['message']);}})[_0x8d18('0x15')](function(_0x512e2f){logger[_0x8d18('0x12')](_0x8d18('0xe'),_0x1c3cb9,_0x512e2f);_0x517d7a(_0x512e2f);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 591dfb0..cf8a257 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 _0x9e58=['download','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','./screenRecording.controller','get','index','describe','/:id','isAuthenticated','show'];(function(_0x2037e1,_0x18da29){var _0x256110=function(_0x2596ec){while(--_0x2596ec){_0x2037e1['push'](_0x2037e1['shift']());}};_0x256110(++_0x18da29);}(_0x9e58,0x80));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x89e5('0x0'));var path=require('path');var timeout=require(_0x89e5('0x1'));var express=require(_0x89e5('0x2'));var router=express[_0x89e5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x89e5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x89e5('0x5'));router[_0x89e5('0x6')]('/',auth['isAuthenticated'](),controller[_0x89e5('0x7')]);router[_0x89e5('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x89e5('0x8')]);router[_0x89e5('0x6')](_0x89e5('0x9'),auth[_0x89e5('0xa')](),controller[_0x89e5('0xb')]);router[_0x89e5('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x89e5('0xc')]);router[_0x89e5('0xd')]('/',auth[_0x89e5('0xa')](),controller[_0x89e5('0xe')]);router[_0x89e5('0xf')](_0x89e5('0x9'),auth[_0x89e5('0xa')](),controller[_0x89e5('0x10')]);router[_0x89e5('0x11')]('/:id',auth[_0x89e5('0xa')](),controller[_0x89e5('0x12')]);module[_0x89e5('0x13')]=router; \ No newline at end of file +var _0x8f23=['get','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index'];(function(_0x423a1f,_0x3039dc){var _0x52f2ba=function(_0x43bf69){while(--_0x43bf69){_0x423a1f['push'](_0x423a1f['shift']());}};_0x52f2ba(++_0x3039dc);}(_0x8f23,0x13b));var _0x38f2=function(_0x148425,_0x11224a){_0x148425=_0x148425-0x0;var _0x120049=_0x8f23[_0x148425];return _0x120049;};'use strict';var multer=require(_0x38f2('0x0'));var util=require('util');var path=require(_0x38f2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x38f2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x38f2('0x3'));var interaction=require(_0x38f2('0x4'));var config=require('../../config/environment');var controller=require(_0x38f2('0x5'));router['get']('/',auth[_0x38f2('0x6')](),controller[_0x38f2('0x7')]);router[_0x38f2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x38f2('0x9')]);router['get'](_0x38f2('0xa'),auth[_0x38f2('0x6')](),controller[_0x38f2('0xb')]);router[_0x38f2('0x8')]('/:id/download',auth[_0x38f2('0x6')](),controller['download']);router[_0x38f2('0xc')]('/',auth['isAuthenticated'](),controller[_0x38f2('0xd')]);router[_0x38f2('0xe')](_0x38f2('0xa'),auth['isAuthenticated'](),controller[_0x38f2('0xf')]);router[_0x38f2('0x10')](_0x38f2('0xa'),auth['isAuthenticated'](),controller[_0x38f2('0x11')]);module[_0x38f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 443de1f..a2fac25 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 _0x5bc1=['createdAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','DATE','toString'];(function(_0x20e512,_0x1d0348){var _0x24bbbd=function(_0x24b410){while(--_0x24b410){_0x20e512['push'](_0x20e512['shift']());}};_0x24bbbd(++_0x1d0348);}(_0x5bc1,0xb5));var _0x15bc=function(_0x1405c1,_0x532676){_0x1405c1=_0x1405c1-0x0;var _0x59aabc=_0x5bc1[_0x1405c1];return _0x59aabc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x15bc('0x0'));var path=require(_0x15bc('0x1'));var config=require(_0x15bc('0x2'));module[_0x15bc('0x3')]={'format':{'type':Sequelize[_0x15bc('0x4')],'get':function(){return this[_0x15bc('0x5')]('value')?path['extname'](this[_0x15bc('0x5')](_0x15bc('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x15bc('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x15bc('0x7')],'set':function(_0x483c6d){var _0x344121=_0x483c6d[_0x15bc('0x8')](/\\/g,'/');this[_0x15bc('0x9')](_0x15bc('0x6'),_0x344121);}},'rating':{'type':Sequelize[_0x15bc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x15bc('0xa')],'set':function(_0x2bc60a){this[_0x15bc('0x9')](_0x15bc('0xb'),moment()[_0x15bc('0xc')](_0x2bc60a,'ms'));this['setDataValue'](_0x15bc('0xd'),moment());this[_0x15bc('0x9')](_0x15bc('0xe'),_0x2bc60a);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0xb')))[_0x15bc('0xf')](_0x15bc('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0xd')))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}},'createdAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0x13')))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}},'updatedAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')]('updatedAt'))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}}}; \ No newline at end of file +var _0x8aad=['MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','../../config/environment','VIRTUAL','getDataValue','STRING','replace','setDataValue','value','INTEGER','startedAt','subtract','closedAt','duration','DATE','format'];(function(_0x2e4e3e,_0x75ae94){var _0x51476b=function(_0x53afdc){while(--_0x53afdc){_0x2e4e3e['push'](_0x2e4e3e['shift']());}};_0x51476b(++_0x75ae94);}(_0x8aad,0x146));var _0xd8aa=function(_0x50a2c6,_0x6ef01c){_0x50a2c6=_0x50a2c6-0x0;var _0x4b0de2=_0x8aad[_0x50a2c6];return _0x4b0de2;};'use strict';var Sequelize=require(_0xd8aa('0x0'));var moment=require(_0xd8aa('0x1'));var path=require('path');var config=require(_0xd8aa('0x2'));module['exports']={'format':{'type':Sequelize[_0xd8aa('0x3')],'get':function(){return this[_0xd8aa('0x4')]('value')?path['extname'](this[_0xd8aa('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd8aa('0x5')]},'value':{'type':Sequelize[_0xd8aa('0x5')],'set':function(_0x16ea12){var _0x4a4b10=_0x16ea12[_0xd8aa('0x6')](/\\/g,'/');this[_0xd8aa('0x7')](_0xd8aa('0x8'),_0x4a4b10);}},'rating':{'type':Sequelize[_0xd8aa('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5de228){this[_0xd8aa('0x7')](_0xd8aa('0xa'),moment()[_0xd8aa('0xb')](_0x5de228,'ms'));this[_0xd8aa('0x7')](_0xd8aa('0xc'),moment());this['setDataValue'](_0xd8aa('0xd'),_0x5de228);}},'startedAt':{'type':Sequelize[_0xd8aa('0xe')],'get':function(){return moment(this[_0xd8aa('0x4')](_0xd8aa('0xa')))[_0xd8aa('0xf')](_0xd8aa('0x10'))[_0xd8aa('0x11')]();}},'closedAt':{'type':Sequelize[_0xd8aa('0xe')],'get':function(){return moment(this[_0xd8aa('0x4')](_0xd8aa('0xc')))['format']('MM-DD-YYYY\x20HH:mm')[_0xd8aa('0x11')]();}},'createdAt':{'type':Sequelize[_0xd8aa('0xe')],'get':function(){return moment(this[_0xd8aa('0x4')]('createdAt'))[_0xd8aa('0xf')](_0xd8aa('0x10'))[_0xd8aa('0x11')]();}},'updatedAt':{'type':Sequelize[_0xd8aa('0xe')],'get':function(){return moment(this['getDataValue'](_0xd8aa('0x12')))[_0xd8aa('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xd8aa('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 574f742..105fd56 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 _0x0e85=['duration','createdAt','closedAt','params','describe','download','uniqueid','join','root','value','existsSync','secrets','recording','server/files/screen_recordings','filename','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','key','model','format','query','filters','intersection','attributes','length','nolimit','sort','filter','where','merge','type','options','include','findAll','rows','catch','keys','fields','find','create','body'];(function(_0x4828b1,_0x5c8cf3){var _0x1fec1b=function(_0x3f2e5a){while(--_0x3f2e5a){_0x4828b1['push'](_0x4828b1['shift']());}};_0x1fec1b(++_0x5c8cf3);}(_0x0e85,0x7c));var _0x50e8=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x0e85[_0x4a3898];return _0x25ceb0;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['differenceBy'](_['map'](_0x126c99,_0x50e8('0x26')),[_0x50e8('0x2e')]);_0x4f0b88[_0x50e8('0x2f')]=_['keys'](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x30')]=_[_0x50e8('0x31')](_0x4f0b88['model'],_0x4f0b88[_0x50e8('0x2f')]);_0x42bbef[_0x50e8('0x32')]=_[_0x50e8('0x31')](_0x4f0b88[_0x50e8('0x2d')],qs['fields'](_0x30fedf[_0x50e8('0x2f')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef[_0x50e8('0x32')][_0x50e8('0x33')]?_0x42bbef['attributes']:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf[_0x50e8('0x2f')]['hasOwnProperty'](_0x50e8('0x34'))){_0x42bbef[_0x50e8('0x1d')]=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2f')]['limit']);_0x42bbef[_0x50e8('0x1b')]=qs[_0x50e8('0x1b')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x1b')]);}_0x42bbef['order']=qs[_0x50e8('0x35')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x35')]);_0x42bbef['where']=qs['filters'](_['pick'](_0x30fedf[_0x50e8('0x2f')],_0x4f0b88[_0x50e8('0x30')]),_0x126c99);if(_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]){_0x42bbef[_0x50e8('0x37')]=_[_0x50e8('0x38')](_0x42bbef[_0x50e8('0x37')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0x35f802){if(_0x35f802[_0x50e8('0x39')]!=='VIRTUAL'){var _0x3371a4={};_0x3371a4[_0x35f802[_0x50e8('0x26')]]={'$like':'%'+_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]+'%'};return _0x3371a4;}})});}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x3a')]);var _0x944e46={'where':_0x42bbef[_0x50e8('0x37')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x944e46)['then'](function(_0x53b198){_0x1041b9[_0x50e8('0x1e')]=_0x53b198;if(_0x30fedf[_0x50e8('0x2f')]['includeAll']){_0x42bbef[_0x50e8('0x3b')]=[{'all':!![]}];}return db[_0x50e8('0x29')][_0x50e8('0x3c')](_0x42bbef);})[_0x50e8('0x23')](function(_0x251e1c){_0x1041b9[_0x50e8('0x3d')]=_0x251e1c;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x3e')](handleError(_0x39c0c6,null));};exports['show']=function(_0x3d26bd,_0x44e0ca){var _0x3ea251={'raw':![],'where':{'id':_0x3d26bd['params']['id']}},_0x2adae0={};_0x2adae0[_0x50e8('0x2d')]=_[_0x50e8('0x3f')](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x2adae0['query']=_[_0x50e8('0x3f')](_0x3d26bd['query']);_0x2adae0['filters']=_['intersection'](_0x2adae0[_0x50e8('0x2d')],_0x2adae0[_0x50e8('0x2f')]);_0x3ea251['attributes']=_[_0x50e8('0x31')](_0x2adae0[_0x50e8('0x2d')],qs[_0x50e8('0x40')](_0x3d26bd[_0x50e8('0x2f')][_0x50e8('0x40')]));_0x3ea251[_0x50e8('0x32')]=_0x3ea251['attributes'][_0x50e8('0x33')]?_0x3ea251['attributes']:_0x2adae0[_0x50e8('0x2d')];if(_0x3d26bd[_0x50e8('0x2f')]['includeAll']){_0x3ea251[_0x50e8('0x3b')]=[{'all':!![]}];}_0x3ea251=_['merge']({},_0x3ea251,_0x3d26bd[_0x50e8('0x3a')]);return db[_0x50e8('0x29')][_0x50e8('0x41')](_0x3ea251)[_0x50e8('0x23')](handleEntityNotFound(_0x44e0ca,null))[_0x50e8('0x23')](respondWithResult(_0x44e0ca,null))[_0x50e8('0x3e')](handleError(_0x44e0ca,null));};exports[_0x50e8('0x42')]=function(_0x3e52b3,_0x141bd4){return db[_0x50e8('0x29')][_0x50e8('0x42')](_0x3e52b3['body'],{})[_0x50e8('0x23')](respondWithResult(_0x141bd4,0xc9))[_0x50e8('0x3e')](handleError(_0x141bd4,null));};exports['update']=function(_0x3692ba,_0x58f14e){if(_0x3692ba[_0x50e8('0x43')]['id']){delete _0x3692ba['body']['id'];}delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x44')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x45')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x46')];delete _0x3692ba[_0x50e8('0x43')]['value'];return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x3692ba[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x58f14e,null))[_0x50e8('0x23')](saveUpdates(_0x3692ba[_0x50e8('0x43')],null))['then'](respondWithResult(_0x58f14e,null))[_0x50e8('0x3e')](handleError(_0x58f14e,null));};exports[_0x50e8('0x48')]=function(_0xff2e24,_0x27c80a){return db['ScreenRecording'][_0x50e8('0x48')]()[_0x50e8('0x23')](respondWithResult(_0x27c80a,null))[_0x50e8('0x3e')](handleError(_0x27c80a,null));};exports[_0x50e8('0x49')]=function(_0x207f06,_0x1372e3,_0x320b00){var _0x5f5220=require('../../components/encryptor');var _0x55083e=![];var _0x2b54ad={};if(_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]&&_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]===_0x50e8('0x4a')){_0x2b54ad['uniqueid']=_0x207f06[_0x50e8('0x47')]['id'];}else{_0x2b54ad['id']=_0x207f06[_0x50e8('0x47')]['id'];}return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':_0x2b54ad,'attributes':['id','value'],'raw':!![]})[_0x50e8('0x23')](handleEntityNotFound(_0x1372e3,null))[_0x50e8('0x23')](function(_0x373b41){if(_0x373b41){var _0x1cc5ba=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],'server/files/screen_recordings',_0x373b41[_0x50e8('0x4d')]);var _0x5d0d54=util['format']('%s.cypher',_0x1cc5ba);if(fs[_0x50e8('0x4e')](_0x5d0d54)){_0x55083e=!![];return _0x5f5220['decryptFile'](_0x5d0d54,_0x1cc5ba,config[_0x50e8('0x4f')][_0x50e8('0x50')])[_0x50e8('0x23')](function(){return _0x373b41;});}return _0x373b41;}})[_0x50e8('0x23')](function(_0x279cf4){if(_0x279cf4){var _0x12224d=path[_0x50e8('0x4b')](config['root'],_0x50e8('0x51'),_0x279cf4[_0x50e8('0x4d')]);if(!fs[_0x50e8('0x4e')](_0x12224d)){throw new db['Sequelize']['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x279cf4[_0x50e8('0x52')]){return _0x1372e3[_0x50e8('0x49')](_0x12224d,_0x279cf4[_0x50e8('0x52')]+path[_0x50e8('0x53')](_0x12224d),function(){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}else{return _0x1372e3[_0x50e8('0x49')](_0x12224d,function(_0x583d6a){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}}})['catch'](function(_0x255b48){if(_0x255b48[_0x50e8('0x55')]==='ScreenRecording\x20not\x20found'){_0x1372e3['status'](0x194)['send'](_0x50e8('0x56'));}else{return handleError(_0x1372e3,null);}});};exports[_0x50e8('0x57')]=function(_0x5d1fc8,_0x351047){return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x5d1fc8[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](function(_0x47b428){if(_[_0x50e8('0x58')](_0x47b428)){throw new ReferenceError(_0x50e8('0x59'));}return _0x47b428;})[_0x50e8('0x23')](function(_0x4b80ac){var _0x583e58=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],_0x50e8('0x51'),_0x4b80ac[_0x50e8('0x4d')]);logger[_0x50e8('0x5a')](_0x50e8('0x5b'),_0x583e58);if(!_['isNil'](_0x4b80ac['value'])&&fs[_0x50e8('0x4e')](_0x583e58)){logger['info'](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs['unlinkSync'](_0x583e58);}_0x583e58=_0x583e58+_0x50e8('0x5e');if(!_['isNil'](_0x4b80ac['value'])&&fs['existsSync'](_0x583e58)){logger[_0x50e8('0x5a')](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs[_0x50e8('0x5f')](_0x583e58);}return _0x4b80ac;})['then'](function(_0x480362){if(!_0x480362)throw new InternalError();return _0x480362[_0x50e8('0x57')]();})[_0x50e8('0x23')](function(){_0x351047[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();})[_0x50e8('0x3e')](handleError(_0x351047,null));}; \ No newline at end of file +var _0x98a8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','join','server/files/screen_recordings','value','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x25add9,_0x235f27){var _0x465181=function(_0x26eaa2){while(--_0x26eaa2){_0x25add9['push'](_0x25add9['shift']());}};_0x465181(++_0x235f27);}(_0x98a8,0x12c));var _0x898a=function(_0x2ff6b7,_0x34fb22){_0x2ff6b7=_0x2ff6b7-0x0;var _0x111de1=_0x98a8[_0x2ff6b7];return _0x111de1;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x1426e3,_0x5b7719){return function(_0x20bde0){if(!_0x20bde0){_0x1426e3['sendStatus'](0x194);}return _0x20bde0;};}function handleError(_0x513c6b,_0x53ddb2){_0x53ddb2=_0x53ddb2||0x1f4;return function(_0x3678be){logger[_0x898a('0x25')](_0x3678be[_0x898a('0x26')]);if(_0x3678be[_0x898a('0x27')]){delete _0x3678be[_0x898a('0x27')];}_0x513c6b[_0x898a('0x1a')](_0x53ddb2)[_0x898a('0x28')](_0x3678be);};}exports[_0x898a('0x29')]=function(_0xd31922,_0x58149d){var _0x4b3e68={},_0x47f1ed={},_0xe9c33d={'count':0x0,'rows':[]};var _0x62fe93=_[_0x898a('0x2a')](db[_0x898a('0x2b')][_0x898a('0x2c')],function(_0x560000){return{'name':_0x560000[_0x898a('0x2d')],'type':_0x560000[_0x898a('0x2e')][_0x898a('0x2f')]};});_0x47f1ed[_0x898a('0x30')]=_[_0x898a('0x31')](_[_0x898a('0x2a')](_0x62fe93,'name'),[_0x898a('0x32')]);_0x47f1ed[_0x898a('0x33')]=_[_0x898a('0x34')](_0xd31922[_0x898a('0x33')]);_0x47f1ed[_0x898a('0x35')]=_['intersection'](_0x47f1ed['model'],_0x47f1ed[_0x898a('0x33')]);_0x4b3e68[_0x898a('0x36')]=_[_0x898a('0x37')](_0x47f1ed['model'],qs[_0x898a('0x38')](_0xd31922[_0x898a('0x33')][_0x898a('0x38')]));_0x4b3e68[_0x898a('0x36')]=_0x4b3e68[_0x898a('0x36')][_0x898a('0x39')]?_0x4b3e68[_0x898a('0x36')]:_0x47f1ed[_0x898a('0x30')];if(!_0xd31922['query'][_0x898a('0x3a')]('nolimit')){_0x4b3e68['limit']=qs[_0x898a('0x3b')](_0xd31922['query'][_0x898a('0x3b')]);_0x4b3e68['offset']=qs[_0x898a('0x1e')](_0xd31922['query'][_0x898a('0x1e')]);}_0x4b3e68[_0x898a('0x3c')]=qs[_0x898a('0x3d')](_0xd31922['query']['sort']);_0x4b3e68['where']=qs[_0x898a('0x35')](_[_0x898a('0x3e')](_0xd31922['query'],_0x47f1ed[_0x898a('0x35')]),_0x62fe93);if(_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]){_0x4b3e68[_0x898a('0x40')]=_['merge'](_0x4b3e68['where'],{'$or':_[_0x898a('0x2a')](_0x62fe93,function(_0x454c8c){if(_0x454c8c['type']!=='VIRTUAL'){var _0x168f92={};_0x168f92[_0x454c8c[_0x898a('0x27')]]={'$like':'%'+_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]+'%'};return _0x168f92;}})});}_0x4b3e68=_['merge']({},_0x4b3e68,_0xd31922[_0x898a('0x41')]);var _0x369c02={'where':_0x4b3e68['where']};return db['ScreenRecording']['count'](_0x369c02)[_0x898a('0x23')](function(_0x477a9d){_0xe9c33d[_0x898a('0x1d')]=_0x477a9d;if(_0xd31922[_0x898a('0x33')][_0x898a('0x42')]){_0x4b3e68[_0x898a('0x43')]=[{'all':!![]}];}return db[_0x898a('0x2b')][_0x898a('0x44')](_0x4b3e68);})[_0x898a('0x23')](function(_0x235fcf){_0xe9c33d[_0x898a('0x45')]=_0x235fcf;return _0xe9c33d;})[_0x898a('0x23')](respondWithFilteredResult(_0x58149d,_0x4b3e68))[_0x898a('0x46')](handleError(_0x58149d,null));};exports[_0x898a('0x47')]=function(_0x21f307,_0x4c8628){var _0x26ad34={'raw':![],'where':{'id':_0x21f307[_0x898a('0x48')]['id']}},_0x11c437={};_0x11c437['model']=_[_0x898a('0x34')](db[_0x898a('0x2b')][_0x898a('0x2c')]);_0x11c437[_0x898a('0x33')]=_[_0x898a('0x34')](_0x21f307[_0x898a('0x33')]);_0x11c437[_0x898a('0x35')]=_[_0x898a('0x37')](_0x11c437['model'],_0x11c437[_0x898a('0x33')]);_0x26ad34[_0x898a('0x36')]=_[_0x898a('0x37')](_0x11c437[_0x898a('0x30')],qs['fields'](_0x21f307[_0x898a('0x33')][_0x898a('0x38')]));_0x26ad34['attributes']=_0x26ad34[_0x898a('0x36')]['length']?_0x26ad34[_0x898a('0x36')]:_0x11c437['model'];if(_0x21f307['query'][_0x898a('0x42')]){_0x26ad34['include']=[{'all':!![]}];}_0x26ad34=_[_0x898a('0x49')]({},_0x26ad34,_0x21f307[_0x898a('0x41')]);return db['ScreenRecording'][_0x898a('0x4a')](_0x26ad34)[_0x898a('0x23')](handleEntityNotFound(_0x4c8628,null))['then'](respondWithResult(_0x4c8628,null))[_0x898a('0x46')](handleError(_0x4c8628,null));};exports[_0x898a('0x4b')]=function(_0x11a0a3,_0x118240){return db['ScreenRecording'][_0x898a('0x4b')](_0x11a0a3[_0x898a('0x4c')],{})['then'](respondWithResult(_0x118240,0xc9))[_0x898a('0x46')](handleError(_0x118240,null));};exports[_0x898a('0x22')]=function(_0x4ab441,_0x28525b){if(_0x4ab441['body']['id']){delete _0x4ab441[_0x898a('0x4c')]['id'];}delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4d')];delete _0x4ab441['body'][_0x898a('0x4e')];delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4f')];delete _0x4ab441[_0x898a('0x4c')]['value'];return db[_0x898a('0x2b')]['find']({'where':{'id':_0x4ab441[_0x898a('0x48')]['id']}})[_0x898a('0x23')](handleEntityNotFound(_0x28525b,null))[_0x898a('0x23')](saveUpdates(_0x4ab441['body'],null))[_0x898a('0x23')](respondWithResult(_0x28525b,null))[_0x898a('0x46')](handleError(_0x28525b,null));};exports[_0x898a('0x50')]=function(_0x5d325a,_0x52f8c6){return db[_0x898a('0x2b')][_0x898a('0x50')]()[_0x898a('0x23')](respondWithResult(_0x52f8c6,null))[_0x898a('0x46')](handleError(_0x52f8c6,null));};exports[_0x898a('0x51')]=function(_0x36b63a,_0x369f33,_0x6c0f07){var _0x289167=require(_0x898a('0x52'));var _0x2382a9=![];var _0x5e9329={};if(_0x36b63a[_0x898a('0x33')][_0x898a('0x2e')]&&_0x36b63a['query'][_0x898a('0x2e')]==='uniqueid'){_0x5e9329['uniqueid']=_0x36b63a[_0x898a('0x48')]['id'];}else{_0x5e9329['id']=_0x36b63a[_0x898a('0x48')]['id'];}return db[_0x898a('0x2b')]['find']({'where':_0x5e9329,'attributes':['id','value'],'raw':!![]})[_0x898a('0x23')](handleEntityNotFound(_0x369f33,null))[_0x898a('0x23')](function(_0x515725){if(_0x515725){var _0xaa96f7=path[_0x898a('0x53')](config['root'],_0x898a('0x54'),_0x515725[_0x898a('0x55')]);var _0x3122cc=util['format'](_0x898a('0x56'),_0xaa96f7);if(fs[_0x898a('0x57')](_0x3122cc)){_0x2382a9=!![];return _0x289167[_0x898a('0x58')](_0x3122cc,_0xaa96f7,config[_0x898a('0x59')][_0x898a('0x5a')])[_0x898a('0x23')](function(){return _0x515725;});}return _0x515725;}})['then'](function(_0x22a08a){if(_0x22a08a){var _0x4df5f0=path[_0x898a('0x53')](config[_0x898a('0x5b')],_0x898a('0x54'),_0x22a08a[_0x898a('0x55')]);if(!fs[_0x898a('0x57')](_0x4df5f0)){throw new db[(_0x898a('0x5c'))][(_0x898a('0x5d'))](_0x898a('0x5e'));}if(_0x22a08a[_0x898a('0x5f')]){return _0x369f33['download'](_0x4df5f0,_0x22a08a[_0x898a('0x5f')]+path[_0x898a('0x60')](_0x4df5f0),function(){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}else{return _0x369f33[_0x898a('0x51')](_0x4df5f0,function(_0x219976){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}}})[_0x898a('0x46')](function(_0x68fd81){if(_0x68fd81[_0x898a('0x62')]===_0x898a('0x5e')){_0x369f33[_0x898a('0x1a')](0x194)[_0x898a('0x28')](_0x898a('0x63'));}else{return handleError(_0x369f33,null);}});};exports[_0x898a('0x24')]=function(_0x22f9ba,_0x5f42ae){return db[_0x898a('0x2b')][_0x898a('0x4a')]({'where':{'id':_0x22f9ba['params']['id']}})[_0x898a('0x23')](function(_0x4583a1){if(_['isNil'](_0x4583a1)){throw new ReferenceError(_0x898a('0x64'));}return _0x4583a1;})[_0x898a('0x23')](function(_0x21f0f8){var _0x1f3f5b=path['join'](config[_0x898a('0x5b')],_0x898a('0x54'),_0x21f0f8[_0x898a('0x55')]);logger[_0x898a('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f3f5b);if(!_[_0x898a('0x66')](_0x21f0f8[_0x898a('0x55')])&&fs['existsSync'](_0x1f3f5b)){logger[_0x898a('0x65')](_0x898a('0x67')+_0x1f3f5b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x898a('0x68')](_0x1f3f5b);}_0x1f3f5b=_0x1f3f5b+'.cypher';if(!_[_0x898a('0x66')](_0x21f0f8['value'])&&fs['existsSync'](_0x1f3f5b)){logger['info'](_0x898a('0x67')+_0x1f3f5b+_0x898a('0x69'));fs[_0x898a('0x68')](_0x1f3f5b);}return _0x21f0f8;})[_0x898a('0x23')](function(_0x5e0535){if(!_0x5e0535)throw new InternalError();return _0x5e0535['destroy']();})[_0x898a('0x23')](function(){_0x5f42ae[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();})[_0x898a('0x46')](handleError(_0x5f42ae,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index e275817..bf7a5a9 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 _0xac67=['request-promise','rimraf','../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac67,0x1dc));var _0x7ac6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xac67[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x7ac6('0x0'));var logger=require(_0x7ac6('0x1'))(_0x7ac6('0x2'));var moment=require(_0x7ac6('0x3'));var BPromise=require(_0x7ac6('0x4'));var rp=require(_0x7ac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ac6('0x6'));var config=require(_0x7ac6('0x7'));var attributes=require(_0x7ac6('0x8'));module['exports']=function(_0x48992e,_0x24bfa8){return _0x48992e[_0x7ac6('0x9')](_0x7ac6('0xa'),attributes,{'tableName':_0x7ac6('0xb'),'paranoid':![],'indexes':[{'name':_0x7ac6('0xc'),'fields':[_0x7ac6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8159=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','ScreenRecording','screen_recordings','lodash'];(function(_0x4ca731,_0x3d9665){var _0x1fd0a1=function(_0x2c938f){while(--_0x2c938f){_0x4ca731['push'](_0x4ca731['shift']());}};_0x1fd0a1(++_0x3d9665);}(_0x8159,0x6b));var _0x9815=function(_0x236912,_0x318e15){_0x236912=_0x236912-0x0;var _0x2e9733=_0x8159[_0x236912];return _0x2e9733;};'use strict';var _=require(_0x9815('0x0'));var util=require(_0x9815('0x1'));var logger=require(_0x9815('0x2'))(_0x9815('0x3'));var moment=require(_0x9815('0x4'));var BPromise=require(_0x9815('0x5'));var rp=require(_0x9815('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9815('0x7'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0x9815('0x8')]=function(_0x616262,_0x80c576){return _0x616262[_0x9815('0x9')](_0x9815('0xa'),attributes,{'tableName':_0x9815('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','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 94c4280..ba3b372 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 _0x412a=['client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2f6a5e,_0x8e885c){var _0x36dcd1=function(_0x4d3913){while(--_0x4d3913){_0x2f6a5e['push'](_0x2f6a5e['shift']());}};_0x36dcd1(++_0x8e885c);}(_0x412a,0xd4));var _0xa412=function(_0x3bf1e1,_0x13ebc1){_0x3bf1e1=_0x3bf1e1-0x0;var _0x3adf14=_0x412a[_0x3bf1e1];return _0x3adf14;};'use strict';var _=require('lodash');var util=require(_0xa412('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa412('0x1'));var fs=require('fs');var Redis=require(_0xa412('0x2'));var db=require(_0xa412('0x3'))['db'];var utils=require(_0xa412('0x4'));var logger=require('../../config/logger')(_0xa412('0x5'));var config=require(_0xa412('0x6'));var jayson=require(_0xa412('0x7'));var client=jayson[_0xa412('0x8')][_0xa412('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x386874,_0x41660e,_0x10922e){return new BPromise(function(_0x6cba3c,_0x16ce20){return client[_0xa412('0xa')](_0x386874,_0x10922e)[_0xa412('0xb')](function(_0x26c4f7){logger[_0xa412('0xc')](_0xa412('0xd'),_0x41660e,'request\x20sent');logger[_0xa412('0xe')](_0xa412('0xf'),_0x41660e,'request\x20sent',JSON[_0xa412('0x10')](_0x26c4f7));if(_0x26c4f7['error']){if(_0x26c4f7[_0xa412('0x11')]['code']===0x1f4){logger['error'](_0xa412('0xd'),_0x41660e,_0x26c4f7['error'][_0xa412('0x12')]);return _0x16ce20(_0x26c4f7[_0xa412('0x11')][_0xa412('0x12')]);}logger[_0xa412('0x11')](_0xa412('0xd'),_0x41660e,_0x26c4f7[_0xa412('0x11')][_0xa412('0x12')]);return _0x6cba3c(_0x26c4f7[_0xa412('0x11')][_0xa412('0x12')]);}else{logger[_0xa412('0xc')](_0xa412('0xd'),_0x41660e,_0xa412('0x13'));_0x6cba3c(_0x26c4f7[_0xa412('0x14')][_0xa412('0x12')]);}})[_0xa412('0x15')](function(_0x4ba4c5){logger['error'](_0xa412('0xd'),_0x41660e,_0x4ba4c5);_0x16ce20(_0x4ba4c5);});});} \ No newline at end of file +var _0x3da6=['stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x55291a,_0x814018){var _0x3c870c=function(_0x1fd787){while(--_0x1fd787){_0x55291a['push'](_0x55291a['shift']());}};_0x3c870c(++_0x814018);}(_0x3da6,0xe8));var _0x63da=function(_0x3ed211,_0x44ff7d){_0x3ed211=_0x3ed211-0x0;var _0x44e593=_0x3da6[_0x3ed211];return _0x44e593;};'use strict';var _=require(_0x63da('0x0'));var util=require(_0x63da('0x1'));var moment=require(_0x63da('0x2'));var BPromise=require(_0x63da('0x3'));var rs=require(_0x63da('0x4'));var fs=require('fs');var Redis=require(_0x63da('0x5'));var db=require(_0x63da('0x6'))['db'];var utils=require(_0x63da('0x7'));var logger=require(_0x63da('0x8'))(_0x63da('0x9'));var config=require(_0x63da('0xa'));var jayson=require(_0x63da('0xb'));var client=jayson[_0x63da('0xc')][_0x63da('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x240ffb,_0x6b8c66,_0x492cd0){return new BPromise(function(_0x2161c7,_0x17f575){return client['request'](_0x240ffb,_0x492cd0)[_0x63da('0xe')](function(_0x33eb41){logger[_0x63da('0xf')](_0x63da('0x10'),_0x6b8c66,'request\x20sent');logger['debug'](_0x63da('0x11'),_0x6b8c66,'request\x20sent',JSON[_0x63da('0x12')](_0x33eb41));if(_0x33eb41['error']){if(_0x33eb41[_0x63da('0x13')][_0x63da('0x14')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x6b8c66,_0x33eb41[_0x63da('0x13')][_0x63da('0x15')]);return _0x17f575(_0x33eb41['error']['message']);}logger[_0x63da('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x6b8c66,_0x33eb41[_0x63da('0x13')][_0x63da('0x15')]);return _0x2161c7(_0x33eb41['error']['message']);}else{logger[_0x63da('0xf')](_0x63da('0x10'),_0x6b8c66,_0x63da('0x16'));_0x2161c7(_0x33eb41[_0x63da('0x17')][_0x63da('0x15')]);}})[_0x63da('0x18')](function(_0xef0e38){logger['error'](_0x63da('0x10'),_0x6b8c66,_0xef0e38);_0x17f575(_0xef0e38);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d31e688..4ab445f 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 _0x839e=['diskStorage','join','root','server/files/images/logos/','format','logo','originalname','single','file','logologin','extname','post','%s%s','preferred','addPreferred','favicon','addFavicon','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon'];(function(_0x5129b4,_0x280862){var _0x37f22b=function(_0x51b9c9){while(--_0x51b9c9){_0x5129b4['push'](_0x5129b4['shift']());}};_0x37f22b(++_0x280862);}(_0x839e,0x1f2));var _0xe839=function(_0x28ee9c,_0x1ae563){_0x28ee9c=_0x28ee9c-0x0;var _0x36f796=_0x839e[_0x28ee9c];return _0x36f796;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe839('0x0'));var timeout=require(_0xe839('0x1'));var express=require(_0xe839('0x2'));var router=express[_0xe839('0x3')]();var fs_extra=require(_0xe839('0x4'));var auth=require(_0xe839('0x5'));var interaction=require(_0xe839('0x6'));var config=require(_0xe839('0x7'));var controller=require('./setting.controller');router[_0xe839('0x8')]('/',auth[_0xe839('0x9')](),controller[_0xe839('0xa')]);router[_0xe839('0x8')](_0xe839('0xb'),controller['getDate']);router[_0xe839('0x8')]('/:id',controller[_0xe839('0xc')]);router[_0xe839('0x8')](_0xe839('0xd'),controller[_0xe839('0xe')]);router[_0xe839('0x8')](_0xe839('0xf'),controller['getLogoLogin']);router[_0xe839('0x8')](_0xe839('0x10'),controller[_0xe839('0x11')]);router['get'](_0xe839('0x12'),controller['getPreferred']);router[_0xe839('0x8')](_0xe839('0x13'),controller['getFavicon']);var upload=multer({'storage':multer[_0xe839('0x14')]({'destination':function(_0x4fdf19,_0x5696c3,_0x48b372){_0x48b372(null,path[_0xe839('0x15')](config[_0xe839('0x16')],_0xe839('0x17')));},'filename':function(_0x653258,_0x4f99fc,_0x24cfe7){_0x24cfe7(null,util[_0xe839('0x18')]('%s%s',_0xe839('0x19'),path['extname'](_0x4f99fc[_0xe839('0x1a')])));}})});router['post'](_0xe839('0xd'),upload[_0xe839('0x1b')](_0xe839('0x1c')),controller['addLogo']);var upload=multer({'storage':multer[_0xe839('0x14')]({'destination':function(_0x2e6936,_0x39cd4e,_0xa32670){_0xa32670(null,path['join'](config[_0xe839('0x16')],_0xe839('0x17')));},'filename':function(_0x120c42,_0x3634a2,_0x4a1b8a){_0x4a1b8a(null,util[_0xe839('0x18')]('%s%s',_0xe839('0x1d'),path[_0xe839('0x1e')](_0x3634a2[_0xe839('0x1a')])));}})});router[_0xe839('0x1f')]('/:id/logo_login',upload[_0xe839('0x1b')](_0xe839('0x1c')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xe839('0x14')]({'destination':function(_0xa7783b,_0x47c542,_0x501eeb){_0x501eeb(null,path[_0xe839('0x15')](config[_0xe839('0x16')],_0xe839('0x17')));},'filename':function(_0x17559f,_0x1b968f,_0x4dd167){_0x4dd167(null,util[_0xe839('0x18')](_0xe839('0x20'),_0xe839('0x21'),path[_0xe839('0x1e')](_0x1b968f[_0xe839('0x1a')])));}})});router[_0xe839('0x1f')](_0xe839('0x12'),upload['single'](_0xe839('0x1c')),controller[_0xe839('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x414c0c,_0x103c8b,_0x5c9492){_0x5c9492(null,path[_0xe839('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x23bb6f,_0x1bd8ee,_0x1b9474){_0x1b9474(null,util['format'](_0xe839('0x20'),_0xe839('0x23'),path[_0xe839('0x1e')](_0x1bd8ee['originalname'])));}})});router[_0xe839('0x1f')]('/:id/favicon',upload[_0xe839('0x1b')](_0xe839('0x1c')),controller[_0xe839('0x24')]);router['put']('/:id',auth[_0xe839('0x9')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x8e23=['addLogo','extname','preferred','/:id/preferred','addPreferred','favicon','put','isAuthenticated','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./setting.controller','index','get','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','originalname','post','single','file'];(function(_0x47653a,_0x244de7){var _0x43a51f=function(_0x3de844){while(--_0x3de844){_0x47653a['push'](_0x47653a['shift']());}};_0x43a51f(++_0x244de7);}(_0x8e23,0xae));var _0x38e2=function(_0x220404,_0x1f5a75){_0x220404=_0x220404-0x0;var _0x5db6d2=_0x8e23[_0x220404];return _0x5db6d2;};'use strict';var multer=require(_0x38e2('0x0'));var util=require(_0x38e2('0x1'));var path=require('path');var timeout=require(_0x38e2('0x2'));var express=require('express');var router=express[_0x38e2('0x3')]();var fs_extra=require(_0x38e2('0x4'));var auth=require(_0x38e2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38e2('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x38e2('0x7')]);router[_0x38e2('0x8')](_0x38e2('0x9'),controller[_0x38e2('0xa')]);router['get'](_0x38e2('0xb'),controller[_0x38e2('0xc')]);router[_0x38e2('0x8')](_0x38e2('0xd'),controller['getLogo']);router[_0x38e2('0x8')](_0x38e2('0xe'),controller[_0x38e2('0xf')]);router[_0x38e2('0x8')](_0x38e2('0x10'),controller[_0x38e2('0x11')]);router[_0x38e2('0x8')]('/:id/preferred',controller[_0x38e2('0x12')]);router[_0x38e2('0x8')](_0x38e2('0x13'),controller[_0x38e2('0x14')]);var upload=multer({'storage':multer[_0x38e2('0x15')]({'destination':function(_0x559bf0,_0x2eec92,_0x4bfe6a){_0x4bfe6a(null,path[_0x38e2('0x16')](config[_0x38e2('0x17')],_0x38e2('0x18')));},'filename':function(_0x132a75,_0x8353ed,_0x1a997f){_0x1a997f(null,util[_0x38e2('0x19')](_0x38e2('0x1a'),'logo',path['extname'](_0x8353ed[_0x38e2('0x1b')])));}})});router[_0x38e2('0x1c')](_0x38e2('0xd'),upload[_0x38e2('0x1d')](_0x38e2('0x1e')),controller[_0x38e2('0x1f')]);var upload=multer({'storage':multer[_0x38e2('0x15')]({'destination':function(_0x51e482,_0x5b4d27,_0x229d70){_0x229d70(null,path[_0x38e2('0x16')](config['root'],_0x38e2('0x18')));},'filename':function(_0x2dc8ef,_0x587ab0,_0x1a60fd){_0x1a60fd(null,util['format'](_0x38e2('0x1a'),'logologin',path[_0x38e2('0x20')](_0x587ab0['originalname'])));}})});router[_0x38e2('0x1c')](_0x38e2('0xe'),upload[_0x38e2('0x1d')](_0x38e2('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x38e2('0x15')]({'destination':function(_0x3230ef,_0x3e5817,_0x49fa59){_0x49fa59(null,path[_0x38e2('0x16')](config[_0x38e2('0x17')],_0x38e2('0x18')));},'filename':function(_0x4069af,_0x4a38d1,_0x4d026e){_0x4d026e(null,util[_0x38e2('0x19')](_0x38e2('0x1a'),_0x38e2('0x21'),path[_0x38e2('0x20')](_0x4a38d1[_0x38e2('0x1b')])));}})});router[_0x38e2('0x1c')](_0x38e2('0x22'),upload['single'](_0x38e2('0x1e')),controller[_0x38e2('0x23')]);var upload=multer({'storage':multer[_0x38e2('0x15')]({'destination':function(_0x4b09eb,_0x23e627,_0x42b8b2){_0x42b8b2(null,path[_0x38e2('0x16')](config[_0x38e2('0x17')],_0x38e2('0x18')));},'filename':function(_0x2f8347,_0x2bed81,_0x3f7163){_0x3f7163(null,util[_0x38e2('0x19')]('%s%s',_0x38e2('0x24'),path['extname'](_0x2bed81[_0x38e2('0x1b')])));}})});router[_0x38e2('0x1c')](_0x38e2('0x13'),upload[_0x38e2('0x1d')](_0x38e2('0x1e')),controller['addFavicon']);router[_0x38e2('0x25')]('/:id',auth[_0x38e2('0x26')](),controller[_0x38e2('0x27')]);module[_0x38e2('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 9ca5629..d31f9fb 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(_0xc8052d,_0xf4a4a6){var _0x2b6f49=function(_0x3f6c52){while(--_0x3f6c52){_0xc8052d['push'](_0xc8052d['shift']());}};_0x2b6f49(++_0xf4a4a6);}(_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')]={'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(_0x20b527,_0x295c88){var _0x4e0689=function(_0x3f3058){while(--_0x3f3058){_0x20b527['push'](_0x20b527['shift']());}};_0x4e0689(++_0x295c88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 09be2f7..fc30c6a 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 _0x09a4=['end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','file','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','debug','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x09a4,0x147));var _0x409a=function(_0x1dc646,_0x496ce3){_0x1dc646=_0x1dc646-0x0;var _0x46daf1=_0x09a4[_0x1dc646];return _0x46daf1;};'use strict';var emlformat=require(_0x409a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x409a('0x1'));var rp=require(_0x409a('0x2'));var moment=require(_0x409a('0x3'));var BPromise=require(_0x409a('0x4'));var Mustache=require('mustache');var util=require(_0x409a('0x5'));var path=require(_0x409a('0x6'));var sox=require(_0x409a('0x7'));var csv=require(_0x409a('0x8'));var ejs=require(_0x409a('0x9'));var fs=require('fs');var fs_extra=require(_0x409a('0xa'));var _=require(_0x409a('0xb'));var squel=require(_0x409a('0xc'));var crypto=require(_0x409a('0xd'));var jsforce=require(_0x409a('0xe'));var deskjs=require(_0x409a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x409a('0x10'));var Papa=require('papaparse');var Redis=require(_0x409a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x409a('0x12'));var as=require(_0x409a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x409a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x409a('0x15'));var licenseUtil=require(_0x409a('0x16'));var db=require(_0x409a('0x17'))['db'];var jayson=require(_0x409a('0x18'));var client=jayson[_0x409a('0x19')][_0x409a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x6954ea,_0x3375b6,_0x37e20f,_0x4ff33a){return new BPromise(function(_0x2b50cd,_0xd4ca32){var _0x3bafda=_0x4ff33a||client;return _0x3bafda[_0x409a('0x1b')](_0x6954ea,_0x37e20f)['then'](function(_0x12a38c){logger[_0x409a('0x1c')]('Setting,\x20%s,\x20%s',_0x3375b6,'request\x20sent');logger[_0x409a('0x1d')](_0x409a('0x1e'),_0x3375b6,'request\x20sent',JSON['stringify'](_0x12a38c));if(_0x12a38c[_0x409a('0x1f')]){if(_0x12a38c[_0x409a('0x1f')]['code']===0x1f4){logger[_0x409a('0x1f')](_0x409a('0x20'),_0x3375b6,_0x12a38c[_0x409a('0x1f')][_0x409a('0x21')]);return _0xd4ca32(_0x12a38c[_0x409a('0x1f')][_0x409a('0x21')]);}logger[_0x409a('0x1f')](_0x409a('0x20'),_0x3375b6,_0x12a38c['error']['message']);return _0x2b50cd(_0x12a38c[_0x409a('0x1f')][_0x409a('0x21')]);}else{logger[_0x409a('0x1c')](_0x409a('0x20'),_0x3375b6,_0x409a('0x22'));_0x2b50cd(_0x12a38c[_0x409a('0x23')][_0x409a('0x21')]);}})[_0x409a('0x24')](function(_0x5b130e){logger['error'](_0x409a('0x20'),_0x3375b6,_0x5b130e);_0xd4ca32(_0x5b130e);});});}function respondWithStatusCode(_0x46de02,_0x5e4fe7){_0x5e4fe7=_0x5e4fe7||0xcc;return function(_0x2d51ff){if(_0x2d51ff){return _0x46de02[_0x409a('0x25')](_0x5e4fe7);}return _0x46de02[_0x409a('0x26')](_0x5e4fe7)[_0x409a('0x27')]();};}function respondWithResult(_0xc7f560,_0x49e7f3){_0x49e7f3=_0x49e7f3||0xc8;return function(_0xee595){if(_0xee595){return _0xc7f560[_0x409a('0x26')](_0x49e7f3)[_0x409a('0x28')](_0xee595);}};}function respondWithFilteredResult(_0x278811,_0x712dbc){return function(_0x9913dd){if(_0x9913dd){var _0x13c34b=typeof _0x712dbc[_0x409a('0x29')]==='undefined'&&typeof _0x712dbc['limit']===_0x409a('0x2a');var _0xb1eb9a=_0x9913dd[_0x409a('0x2b')];var _0x14960d=_0x13c34b?0x0:_0x712dbc['offset'];var _0x22143a=_0x13c34b?_0x9913dd[_0x409a('0x2b')]:_0x712dbc['offset']+_0x712dbc[_0x409a('0x2c')];var _0x2eb569;if(_0x22143a>=_0xb1eb9a){_0x22143a=_0xb1eb9a;_0x2eb569=0xc8;}else{_0x2eb569=0xce;}_0x278811[_0x409a('0x26')](_0x2eb569);return _0x278811['set'](_0x409a('0x2d'),_0x14960d+'-'+_0x22143a+'/'+_0xb1eb9a)[_0x409a('0x28')](_0x9913dd);}return null;};}function patchUpdates(_0x539a5c){return function(_0x216c7d){try{jsonpatch[_0x409a('0x2e')](_0x216c7d,_0x539a5c,!![]);}catch(_0x1b2e8a){return BPromise['reject'](_0x1b2e8a);}return _0x216c7d[_0x409a('0x2f')]();};}function saveUpdates(_0x53c5ac,_0x95317f){return function(_0x26acd6){if(_0x26acd6){return _0x26acd6[_0x409a('0x30')](_0x53c5ac)[_0x409a('0x31')](function(_0x18b247){return _0x18b247;});}return null;};}function removeEntity(_0x498a85,_0x2950fc){return function(_0x1f75a1){if(_0x1f75a1){return _0x1f75a1[_0x409a('0x32')]()[_0x409a('0x31')](function(){_0x498a85[_0x409a('0x26')](0xcc)[_0x409a('0x27')]();});}};}function handleEntityNotFound(_0x5e2059,_0x339512){return function(_0x36a1de){if(!_0x36a1de){_0x5e2059['sendStatus'](0x194);}return _0x36a1de;};}function handleError(_0xb55c5a,_0x56dffe){_0x56dffe=_0x56dffe||0x1f4;return function(_0x38d144){logger[_0x409a('0x1f')](_0x38d144[_0x409a('0x33')]);if(_0x38d144[_0x409a('0x34')]){delete _0x38d144['name'];}_0xb55c5a[_0x409a('0x26')](_0x56dffe)[_0x409a('0x35')](_0x38d144);};}exports[_0x409a('0x36')]=function(_0x3dd963,_0xe092a8){var _0x24947b={},_0x85fe32={},_0x2c9ce3={'count':0x0,'rows':[]};var _0x20645c=_[_0x409a('0x37')](db[_0x409a('0x38')][_0x409a('0x39')],function(_0x54f0c8){return{'name':_0x54f0c8[_0x409a('0x3a')],'type':_0x54f0c8['type'][_0x409a('0x3b')]};});_0x85fe32[_0x409a('0x3c')]=_['map'](_0x20645c,_0x409a('0x34'));_0x85fe32[_0x409a('0x3d')]=_[_0x409a('0x3e')](_0x3dd963['query']);_0x85fe32[_0x409a('0x3f')]=_['intersection'](_0x85fe32[_0x409a('0x3c')],_0x85fe32['query']);_0x24947b[_0x409a('0x40')]=_[_0x409a('0x41')](_0x85fe32[_0x409a('0x3c')],qs[_0x409a('0x42')](_0x3dd963[_0x409a('0x3d')][_0x409a('0x42')]));_0x24947b[_0x409a('0x40')]=_0x24947b[_0x409a('0x40')][_0x409a('0x43')]?_0x24947b[_0x409a('0x40')]:_0x85fe32[_0x409a('0x3c')];if(!_0x3dd963[_0x409a('0x3d')]['hasOwnProperty'](_0x409a('0x44'))){_0x24947b['limit']=qs['limit'](_0x3dd963[_0x409a('0x3d')]['limit']);_0x24947b[_0x409a('0x29')]=qs[_0x409a('0x29')](_0x3dd963[_0x409a('0x3d')][_0x409a('0x29')]);}_0x24947b['order']=qs[_0x409a('0x45')](_0x3dd963['query'][_0x409a('0x45')]);_0x24947b[_0x409a('0x46')]=qs[_0x409a('0x3f')](_['pick'](_0x3dd963[_0x409a('0x3d')],_0x85fe32[_0x409a('0x3f')]),_0x20645c);if(_0x3dd963[_0x409a('0x3d')][_0x409a('0x47')]){_0x24947b[_0x409a('0x46')]=_[_0x409a('0x48')](_0x24947b[_0x409a('0x46')],{'$or':_[_0x409a('0x37')](_0x20645c,function(_0x29b8d7){if(_0x29b8d7['type']!==_0x409a('0x49')){var _0x18b3a6={};_0x18b3a6[_0x29b8d7[_0x409a('0x34')]]={'$like':'%'+_0x3dd963[_0x409a('0x3d')]['filter']+'%'};return _0x18b3a6;}})});}_0x24947b=_['merge']({},_0x24947b,_0x3dd963[_0x409a('0x4a')]);var _0x275bd1={'where':_0x24947b[_0x409a('0x46')]};return db['Setting'][_0x409a('0x2b')](_0x275bd1)['then'](function(_0x2eddc0){_0x2c9ce3['count']=_0x2eddc0;if(_0x3dd963[_0x409a('0x3d')][_0x409a('0x4b')]){_0x24947b[_0x409a('0x4c')]=[{'all':!![]}];}return db['Setting'][_0x409a('0x4d')](_0x24947b);})[_0x409a('0x31')](function(_0x59f305){_0x2c9ce3[_0x409a('0x4e')]=_0x59f305;return _0x2c9ce3;})['then'](respondWithFilteredResult(_0xe092a8,_0x24947b))['catch'](handleError(_0xe092a8,null));};exports[_0x409a('0x4f')]=function(_0x2c4849,_0x53d160){var _0x48d77a={'raw':![],'where':{'id':_0x2c4849[_0x409a('0x50')]['id']}},_0x25605b={};_0x25605b[_0x409a('0x3c')]=_[_0x409a('0x3e')](db['Setting'][_0x409a('0x39')]);_0x25605b[_0x409a('0x3d')]=_[_0x409a('0x3e')](_0x2c4849[_0x409a('0x3d')]);_0x25605b['filters']=_[_0x409a('0x41')](_0x25605b['model'],_0x25605b[_0x409a('0x3d')]);_0x48d77a[_0x409a('0x40')]=_[_0x409a('0x41')](_0x25605b[_0x409a('0x3c')],qs[_0x409a('0x42')](_0x2c4849[_0x409a('0x3d')]['fields']));_0x48d77a[_0x409a('0x40')]=_0x48d77a[_0x409a('0x40')][_0x409a('0x43')]?_0x48d77a[_0x409a('0x40')]:_0x25605b[_0x409a('0x3c')];if(_0x2c4849[_0x409a('0x3d')][_0x409a('0x4b')]){_0x48d77a[_0x409a('0x4c')]=[{'all':!![]}];}_0x48d77a=_['merge']({},_0x48d77a,_0x2c4849[_0x409a('0x4a')]);return db['Setting'][_0x409a('0x51')](_0x48d77a)['then'](handleEntityNotFound(_0x53d160,null))[_0x409a('0x31')](respondWithResult(_0x53d160,null))[_0x409a('0x24')](handleError(_0x53d160,null));};exports[_0x409a('0x30')]=function(_0x2cea0e,_0x1a75c2){if(_0x2cea0e[_0x409a('0x52')]['id']){delete _0x2cea0e[_0x409a('0x52')]['id'];}return db['Setting'][_0x409a('0x51')]({'where':{'id':_0x2cea0e[_0x409a('0x50')]['id']}})[_0x409a('0x31')](handleEntityNotFound(_0x1a75c2,null))[_0x409a('0x31')](saveUpdates(_0x2cea0e[_0x409a('0x52')],null))['then'](respondWithResult(_0x1a75c2,null))[_0x409a('0x24')](handleError(_0x1a75c2,null));};exports['addLogo']=function(_0x152c71,_0x2eb189,_0x49572e){if(_0x152c71[_0x409a('0x53')]&&_0x152c71['file'][_0x409a('0x54')]){_0x152c71['body']['logo']=_0x152c71[_0x409a('0x53')]['filename'];}return db[_0x409a('0x38')]['find']({'where':{'id':_0x152c71[_0x409a('0x50')]['id']}})[_0x409a('0x31')](handleEntityNotFound(_0x2eb189,null))[_0x409a('0x31')](saveUpdates(_0x152c71['body'],null))[_0x409a('0x31')](respondWithResult(_0x2eb189,null))[_0x409a('0x24')](handleError(_0x2eb189,null));};exports[_0x409a('0x55')]=function(_0x50af71,_0x27cc99,_0x15cbe6){if(_0x50af71[_0x409a('0x53')]&&_0x50af71[_0x409a('0x53')][_0x409a('0x54')]){_0x50af71[_0x409a('0x52')][_0x409a('0x56')]=_0x50af71[_0x409a('0x53')]['filename'];}return db['Setting']['find']({'where':{'id':_0x50af71['params']['id']}})[_0x409a('0x31')](handleEntityNotFound(_0x27cc99,null))['then'](saveUpdates(_0x50af71[_0x409a('0x52')],null))[_0x409a('0x31')](respondWithResult(_0x27cc99,null))['catch'](handleError(_0x27cc99,null));};var utilLicense=require(_0x409a('0x16'));exports['getLogo']=function(_0x263bd4,_0x2fc708,_0x2120d5){var _0x5c837a=_0x409a('0x57');var _0x11df2e={'custom':![]};return utilLicense[_0x409a('0x58')]()[_0x409a('0x31')](function(_0x38884e){if(_0x38884e){_0x11df2e=_0x38884e;}return db[_0x409a('0x38')][_0x409a('0x51')]({'where':{'id':_0x263bd4[_0x409a('0x50')]['id']},'attributes':[_0x409a('0x59'),'loginLogo',_0x409a('0x5a'),_0x409a('0x5b'),'defaultLogo',_0x409a('0x5c'),_0x409a('0x5d'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2fc708,null))[_0x409a('0x31')](function(_0x50a672){if(_0x50a672){var _0x3084fb=_0x50a672['logo']&&fs[_0x409a('0x5e')](path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x5c837a,_['toLower'](_0x50a672['logo'])))?path[_0x409a('0x5f')](config['root'],_0x5c837a,_[_0x409a('0x61')](_0x50a672['logo'])):path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x5c837a,_[_0x409a('0x61')](_0x409a('0x62')));var _0x56522e=_0x409a('0x63')+_[_0x409a('0x64')]('logo');if(_0x50a672[_0x56522e]||!_0x11df2e[_0x409a('0x65')]){_0x3084fb=path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x5c837a,_[_0x409a('0x61')](_0x409a('0x62')));}if(!fs[_0x409a('0x5e')](_0x3084fb)){throw new db[(_0x409a('0x66'))][(_0x409a('0x67'))](_['upperFirst'](_0x409a('0x59'))+_0x409a('0x68'));}return _0x2fc708[_0x409a('0x69')](_0x3084fb);}})[_0x409a('0x24')](handleError(_0x2fc708,null));};var utilLicense=require('../../config/license/util');exports[_0x409a('0x6a')]=function(_0x293927,_0x4eb82b,_0x16b4b8){var _0x25faba=_0x409a('0x57');var _0x285084={'custom':![]};return utilLicense[_0x409a('0x58')]()[_0x409a('0x31')](function(_0x3be348){if(_0x3be348){_0x285084=_0x3be348;}return db[_0x409a('0x38')]['find']({'where':{'id':_0x293927[_0x409a('0x50')]['id']},'attributes':[_0x409a('0x59'),_0x409a('0x56'),'preferred',_0x409a('0x5b'),_0x409a('0x6b'),_0x409a('0x5c'),_0x409a('0x5d'),_0x409a('0x6c')],'raw':!![]});})[_0x409a('0x31')](handleEntityNotFound(_0x4eb82b,null))['then'](function(_0x96333d){if(_0x96333d){var _0xb8e590=_0x96333d['loginLogo']&&fs[_0x409a('0x5e')](path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x25faba,_[_0x409a('0x61')](_0x96333d['loginLogo'])))?path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x25faba,_[_0x409a('0x61')](_0x96333d[_0x409a('0x56')])):path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x25faba,_[_0x409a('0x61')](_0x409a('0x6d')));var _0x1a89d9=_0x409a('0x63')+_[_0x409a('0x64')](_0x409a('0x56'));if(_0x96333d[_0x1a89d9]||!_0x285084[_0x409a('0x65')]){_0xb8e590=path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x25faba,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x409a('0x5e')](_0xb8e590)){throw new db['Sequelize'][(_0x409a('0x67'))](_[_0x409a('0x64')]('loginLogo')+_0x409a('0x68'));}return _0x4eb82b['download'](_0xb8e590);}})[_0x409a('0x24')](handleError(_0x4eb82b,null));};exports[_0x409a('0x6e')]=function(_0xc5b58d,_0x30c2da){return db[_0x409a('0x38')][_0x409a('0x51')]({'where':{'id':_0xc5b58d[_0x409a('0x50')]['id']},'attributes':[_0x409a('0x6f')]})[_0x409a('0x31')](respondWithResult(_0x30c2da,null))['catch'](handleError(_0x30c2da,null));};exports[_0x409a('0x70')]=function(_0x52b032,_0xd985e,_0x341ac0){if(_0x52b032['file']&&_0x52b032[_0x409a('0x53')][_0x409a('0x54')]){_0x52b032['body'][_0x409a('0x5a')]=_0x52b032[_0x409a('0x53')][_0x409a('0x54')];}return db[_0x409a('0x38')][_0x409a('0x51')]({'where':{'id':_0x52b032[_0x409a('0x50')]['id']}})[_0x409a('0x31')](handleEntityNotFound(_0xd985e,null))[_0x409a('0x31')](saveUpdates(_0x52b032[_0x409a('0x52')],null))[_0x409a('0x31')](respondWithResult(_0xd985e,null))[_0x409a('0x24')](handleError(_0xd985e,null));};var utilLicense=require(_0x409a('0x16'));exports[_0x409a('0x71')]=function(_0x2ef273,_0x138d71,_0x43e84b){var _0x15e571=_0x409a('0x57');var _0x23cb14={'custom':![]};return utilLicense[_0x409a('0x58')]()['then'](function(_0x5be9ca){if(_0x5be9ca){_0x23cb14=_0x5be9ca;}return db[_0x409a('0x38')][_0x409a('0x51')]({'where':{'id':_0x2ef273[_0x409a('0x50')]['id']},'attributes':['logo',_0x409a('0x56'),_0x409a('0x5a'),_0x409a('0x5b'),_0x409a('0x6b'),_0x409a('0x5c'),_0x409a('0x5d'),_0x409a('0x6c')],'raw':!![]});})[_0x409a('0x31')](handleEntityNotFound(_0x138d71,null))[_0x409a('0x31')](function(_0x4c8497){if(_0x4c8497){var _0x1f50ca=_0x4c8497[_0x409a('0x5a')]&&fs[_0x409a('0x5e')](path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x15e571,_[_0x409a('0x61')](_0x4c8497[_0x409a('0x5a')])))?path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x15e571,_[_0x409a('0x61')](_0x4c8497[_0x409a('0x5a')])):path['join'](config['root'],_0x15e571,_[_0x409a('0x61')](_0x409a('0x72')));var _0x609f33='default'+_[_0x409a('0x64')]('preferred');if(_0x4c8497[_0x609f33]||!_0x23cb14['custom']||!_0x23cb14[_0x409a('0x5a')]){_0x1f50ca=path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x15e571,_[_0x409a('0x61')](_0x409a('0x72')));}if(!fs[_0x409a('0x5e')](_0x1f50ca)){throw new db['Sequelize'][(_0x409a('0x67'))](_['upperFirst'](_0x409a('0x5a'))+_0x409a('0x68'));}return _0x138d71['download'](_0x1f50ca);}})[_0x409a('0x24')](handleError(_0x138d71,null));};exports[_0x409a('0x73')]=function(_0x37b759,_0x12e96a,_0xefc0f1){if(_0x37b759[_0x409a('0x53')]&&_0x37b759[_0x409a('0x53')]['filename']){_0x37b759[_0x409a('0x52')][_0x409a('0x5b')]=_0x37b759[_0x409a('0x53')][_0x409a('0x54')];}return db['Setting'][_0x409a('0x51')]({'where':{'id':_0x37b759[_0x409a('0x50')]['id']}})['then'](handleEntityNotFound(_0x12e96a,null))[_0x409a('0x31')](saveUpdates(_0x37b759[_0x409a('0x52')],null))[_0x409a('0x31')](respondWithResult(_0x12e96a,null))[_0x409a('0x24')](handleError(_0x12e96a,null));};var utilLicense=require('../../config/license/util');exports[_0x409a('0x74')]=function(_0x475476,_0x5c4bd7,_0x594828){var _0x2c8425=_0x409a('0x57');var _0xfae8c7={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x15fc6a){if(_0x15fc6a){_0xfae8c7=_0x15fc6a;}return db[_0x409a('0x38')][_0x409a('0x51')]({'where':{'id':_0x475476[_0x409a('0x50')]['id']},'attributes':[_0x409a('0x59'),'loginLogo',_0x409a('0x5a'),'favicon',_0x409a('0x6b'),_0x409a('0x5c'),_0x409a('0x5d'),_0x409a('0x6c')],'raw':!![]});})[_0x409a('0x31')](handleEntityNotFound(_0x5c4bd7,null))[_0x409a('0x31')](function(_0x25c060){if(_0x25c060){var _0x260f22=_0x25c060['favicon']&&fs[_0x409a('0x5e')](path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x2c8425,_[_0x409a('0x61')](_0x25c060[_0x409a('0x5b')])))?path[_0x409a('0x5f')](config['root'],_0x2c8425,_[_0x409a('0x61')](_0x25c060[_0x409a('0x5b')])):path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x2c8425,_[_0x409a('0x61')]('default_favicon.ico'));var _0x528933='default'+_['upperFirst'](_0x409a('0x5b'));if(_0x25c060[_0x528933]||!_0xfae8c7['custom']){_0x260f22=path[_0x409a('0x5f')](config[_0x409a('0x60')],_0x2c8425,_[_0x409a('0x61')](_0x409a('0x75')));}if(!fs['existsSync'](_0x260f22)){throw new db[(_0x409a('0x66'))]['ValidationError'](_['upperFirst'](_0x409a('0x5b'))+_0x409a('0x68'));}return _0x5c4bd7[_0x409a('0x69')](_0x260f22);}})['catch'](handleError(_0x5c4bd7,null));};exports['getDate']=function(_0xdc01d2,_0x21cd78){var _0x13cb73={'offset':moment()[_0x409a('0x76')]()};_0x13cb73[_0x409a('0x77')]=moment()['utcOffset'](_0x13cb73[_0x409a('0x29')])[_0x409a('0x78')](_0x409a('0x79'));return _0x21cd78['status'](0xc8)[_0x409a('0x35')](_0x13cb73);}; \ No newline at end of file +var _0x3273=['api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','params','body','find','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','toLower','root','default_logo.svg','default','upperFirst','existsSync','Sequelize','ValidationError','getLogoLogin','getLicense','default_loginLogo.svg','custom','\x20not\x20found','download','gdpr','addPreferred','getPreferred','default_preferred.png','getFavicon','server/files/images/logos','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3273,0x1d1));var _0x3327=function(_0x30bdff,_0x308063){_0x30bdff=_0x30bdff-0x0;var _0x1e7ca9=_0x3273[_0x30bdff];return _0x1e7ca9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3327('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3327('0x1'));var rp=require('request-promise');var moment=require(_0x3327('0x2'));var BPromise=require(_0x3327('0x3'));var Mustache=require(_0x3327('0x4'));var util=require(_0x3327('0x5'));var path=require(_0x3327('0x6'));var sox=require(_0x3327('0x7'));var csv=require('to-csv');var ejs=require(_0x3327('0x8'));var fs=require('fs');var fs_extra=require(_0x3327('0x9'));var _=require(_0x3327('0xa'));var squel=require('squel');var crypto=require(_0x3327('0xb'));var jsforce=require(_0x3327('0xc'));var deskjs=require(_0x3327('0xd'));var toCsv=require(_0x3327('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3327('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3327('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3327('0x11'));var logger=require(_0x3327('0x12'))(_0x3327('0x13'));var utils=require(_0x3327('0x14'));var config=require(_0x3327('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3327('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3327('0x17')][_0x3327('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1140d4,_0x560103,_0x2aa8fa,_0x41342f){return new BPromise(function(_0x16b0f5,_0x1035ff){var _0xe7429a=_0x41342f||client;return _0xe7429a[_0x3327('0x19')](_0x1140d4,_0x2aa8fa)[_0x3327('0x1a')](function(_0x3af0ed){logger[_0x3327('0x1b')](_0x3327('0x1c'),_0x560103,_0x3327('0x1d'));logger['debug'](_0x3327('0x1e'),_0x560103,_0x3327('0x1d'),JSON[_0x3327('0x1f')](_0x3af0ed));if(_0x3af0ed['error']){if(_0x3af0ed[_0x3327('0x20')][_0x3327('0x21')]===0x1f4){logger[_0x3327('0x20')](_0x3327('0x1c'),_0x560103,_0x3af0ed['error'][_0x3327('0x22')]);return _0x1035ff(_0x3af0ed[_0x3327('0x20')][_0x3327('0x22')]);}logger[_0x3327('0x20')](_0x3327('0x1c'),_0x560103,_0x3af0ed[_0x3327('0x20')]['message']);return _0x16b0f5(_0x3af0ed['error']['message']);}else{logger[_0x3327('0x1b')](_0x3327('0x1c'),_0x560103,'request\x20sent');_0x16b0f5(_0x3af0ed[_0x3327('0x23')][_0x3327('0x22')]);}})[_0x3327('0x24')](function(_0xf34c9a){logger[_0x3327('0x20')]('Setting,\x20%s,\x20%s',_0x560103,_0xf34c9a);_0x1035ff(_0xf34c9a);});});}function respondWithStatusCode(_0x2e9e40,_0x1e8f0d){_0x1e8f0d=_0x1e8f0d||0xcc;return function(_0x2af3ba){if(_0x2af3ba){return _0x2e9e40[_0x3327('0x25')](_0x1e8f0d);}return _0x2e9e40['status'](_0x1e8f0d)[_0x3327('0x26')]();};}function respondWithResult(_0x545e9f,_0x578519){_0x578519=_0x578519||0xc8;return function(_0x5ad367){if(_0x5ad367){return _0x545e9f[_0x3327('0x27')](_0x578519)[_0x3327('0x28')](_0x5ad367);}};}function respondWithFilteredResult(_0x2db04d,_0x5d570d){return function(_0x162ca9){if(_0x162ca9){var _0x4f2d0f=typeof _0x5d570d['offset']===_0x3327('0x29')&&typeof _0x5d570d[_0x3327('0x2a')]===_0x3327('0x29');var _0x32d8d1=_0x162ca9['count'];var _0x501e03=_0x4f2d0f?0x0:_0x5d570d['offset'];var _0x5dda7c=_0x4f2d0f?_0x162ca9[_0x3327('0x2b')]:_0x5d570d[_0x3327('0x2c')]+_0x5d570d[_0x3327('0x2a')];var _0x2aa5b2;if(_0x5dda7c>=_0x32d8d1){_0x5dda7c=_0x32d8d1;_0x2aa5b2=0xc8;}else{_0x2aa5b2=0xce;}_0x2db04d[_0x3327('0x27')](_0x2aa5b2);return _0x2db04d[_0x3327('0x2d')](_0x3327('0x2e'),_0x501e03+'-'+_0x5dda7c+'/'+_0x32d8d1)['json'](_0x162ca9);}return null;};}function patchUpdates(_0xa47fb9){return function(_0x5da450){try{jsonpatch[_0x3327('0x2f')](_0x5da450,_0xa47fb9,!![]);}catch(_0x43ec4f){return BPromise['reject'](_0x43ec4f);}return _0x5da450[_0x3327('0x30')]();};}function saveUpdates(_0x158147,_0x5c339f){return function(_0x1b7149){if(_0x1b7149){return _0x1b7149[_0x3327('0x31')](_0x158147)['then'](function(_0x5de13b){return _0x5de13b;});}return null;};}function removeEntity(_0x4d7d1a,_0x3a641f){return function(_0x241c83){if(_0x241c83){return _0x241c83[_0x3327('0x32')]()[_0x3327('0x1a')](function(){_0x4d7d1a[_0x3327('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf204ed,_0xadd15e){return function(_0x1740eb){if(!_0x1740eb){_0xf204ed[_0x3327('0x25')](0x194);}return _0x1740eb;};}function handleError(_0x16791b,_0x59a32b){_0x59a32b=_0x59a32b||0x1f4;return function(_0x726997){logger[_0x3327('0x20')](_0x726997[_0x3327('0x33')]);if(_0x726997[_0x3327('0x34')]){delete _0x726997[_0x3327('0x34')];}_0x16791b[_0x3327('0x27')](_0x59a32b)[_0x3327('0x35')](_0x726997);};}exports[_0x3327('0x36')]=function(_0x384f0c,_0xae62f0){var _0x1a5499={},_0x42483d={},_0x475290={'count':0x0,'rows':[]};var _0x2baca0=_[_0x3327('0x37')](db[_0x3327('0x38')][_0x3327('0x39')],function(_0x1945db){return{'name':_0x1945db[_0x3327('0x3a')],'type':_0x1945db[_0x3327('0x3b')][_0x3327('0x3c')]};});_0x42483d[_0x3327('0x3d')]=_[_0x3327('0x37')](_0x2baca0,_0x3327('0x34'));_0x42483d[_0x3327('0x3e')]=_['keys'](_0x384f0c[_0x3327('0x3e')]);_0x42483d[_0x3327('0x3f')]=_['intersection'](_0x42483d[_0x3327('0x3d')],_0x42483d[_0x3327('0x3e')]);_0x1a5499[_0x3327('0x40')]=_[_0x3327('0x41')](_0x42483d[_0x3327('0x3d')],qs[_0x3327('0x42')](_0x384f0c['query'][_0x3327('0x42')]));_0x1a5499['attributes']=_0x1a5499[_0x3327('0x40')]['length']?_0x1a5499[_0x3327('0x40')]:_0x42483d[_0x3327('0x3d')];if(!_0x384f0c['query'][_0x3327('0x43')](_0x3327('0x44'))){_0x1a5499[_0x3327('0x2a')]=qs['limit'](_0x384f0c['query'][_0x3327('0x2a')]);_0x1a5499[_0x3327('0x2c')]=qs[_0x3327('0x2c')](_0x384f0c[_0x3327('0x3e')][_0x3327('0x2c')]);}_0x1a5499['order']=qs[_0x3327('0x45')](_0x384f0c[_0x3327('0x3e')][_0x3327('0x45')]);_0x1a5499['where']=qs['filters'](_[_0x3327('0x46')](_0x384f0c[_0x3327('0x3e')],_0x42483d[_0x3327('0x3f')]),_0x2baca0);if(_0x384f0c['query'][_0x3327('0x47')]){_0x1a5499[_0x3327('0x48')]=_[_0x3327('0x49')](_0x1a5499['where'],{'$or':_[_0x3327('0x37')](_0x2baca0,function(_0x744450){if(_0x744450[_0x3327('0x3b')]!=='VIRTUAL'){var _0x54b017={};_0x54b017[_0x744450[_0x3327('0x34')]]={'$like':'%'+_0x384f0c[_0x3327('0x3e')][_0x3327('0x47')]+'%'};return _0x54b017;}})});}_0x1a5499=_[_0x3327('0x49')]({},_0x1a5499,_0x384f0c[_0x3327('0x4a')]);var _0x5cc509={'where':_0x1a5499[_0x3327('0x48')]};return db[_0x3327('0x38')]['count'](_0x5cc509)[_0x3327('0x1a')](function(_0x177a67){_0x475290['count']=_0x177a67;if(_0x384f0c['query'][_0x3327('0x4b')]){_0x1a5499[_0x3327('0x4c')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x1a5499);})[_0x3327('0x1a')](function(_0x234111){_0x475290[_0x3327('0x4d')]=_0x234111;return _0x475290;})[_0x3327('0x1a')](respondWithFilteredResult(_0xae62f0,_0x1a5499))[_0x3327('0x24')](handleError(_0xae62f0,null));};exports['show']=function(_0x431b70,_0xdcccba){var _0x107fe4={'raw':![],'where':{'id':_0x431b70[_0x3327('0x4e')]['id']}},_0x3762ad={};_0x3762ad[_0x3327('0x3d')]=_['keys'](db['Setting'][_0x3327('0x39')]);_0x3762ad[_0x3327('0x3e')]=_['keys'](_0x431b70[_0x3327('0x3e')]);_0x3762ad['filters']=_[_0x3327('0x41')](_0x3762ad[_0x3327('0x3d')],_0x3762ad['query']);_0x107fe4[_0x3327('0x40')]=_['intersection'](_0x3762ad[_0x3327('0x3d')],qs[_0x3327('0x42')](_0x431b70['query'][_0x3327('0x42')]));_0x107fe4[_0x3327('0x40')]=_0x107fe4[_0x3327('0x40')]['length']?_0x107fe4['attributes']:_0x3762ad[_0x3327('0x3d')];if(_0x431b70['query'][_0x3327('0x4b')]){_0x107fe4[_0x3327('0x4c')]=[{'all':!![]}];}_0x107fe4=_[_0x3327('0x49')]({},_0x107fe4,_0x431b70[_0x3327('0x4a')]);return db[_0x3327('0x38')]['find'](_0x107fe4)['then'](handleEntityNotFound(_0xdcccba,null))[_0x3327('0x1a')](respondWithResult(_0xdcccba,null))['catch'](handleError(_0xdcccba,null));};exports[_0x3327('0x31')]=function(_0x1cdc50,_0x4e1e9e){if(_0x1cdc50[_0x3327('0x4f')]['id']){delete _0x1cdc50['body']['id'];}return db[_0x3327('0x38')][_0x3327('0x50')]({'where':{'id':_0x1cdc50[_0x3327('0x4e')]['id']}})[_0x3327('0x1a')](handleEntityNotFound(_0x4e1e9e,null))[_0x3327('0x1a')](saveUpdates(_0x1cdc50[_0x3327('0x4f')],null))[_0x3327('0x1a')](respondWithResult(_0x4e1e9e,null))[_0x3327('0x24')](handleError(_0x4e1e9e,null));};exports[_0x3327('0x51')]=function(_0x221750,_0x32b41c,_0x505780){if(_0x221750[_0x3327('0x52')]&&_0x221750['file'][_0x3327('0x53')]){_0x221750[_0x3327('0x4f')]['logo']=_0x221750[_0x3327('0x52')][_0x3327('0x53')];}return db[_0x3327('0x38')]['find']({'where':{'id':_0x221750['params']['id']}})['then'](handleEntityNotFound(_0x32b41c,null))[_0x3327('0x1a')](saveUpdates(_0x221750[_0x3327('0x4f')],null))[_0x3327('0x1a')](respondWithResult(_0x32b41c,null))['catch'](handleError(_0x32b41c,null));};exports[_0x3327('0x54')]=function(_0x28dece,_0x15d843,_0x306c96){if(_0x28dece[_0x3327('0x52')]&&_0x28dece[_0x3327('0x52')][_0x3327('0x53')]){_0x28dece['body'][_0x3327('0x55')]=_0x28dece[_0x3327('0x52')][_0x3327('0x53')];}return db[_0x3327('0x38')][_0x3327('0x50')]({'where':{'id':_0x28dece[_0x3327('0x4e')]['id']}})[_0x3327('0x1a')](handleEntityNotFound(_0x15d843,null))[_0x3327('0x1a')](saveUpdates(_0x28dece[_0x3327('0x4f')],null))[_0x3327('0x1a')](respondWithResult(_0x15d843,null))[_0x3327('0x24')](handleError(_0x15d843,null));};var utilLicense=require(_0x3327('0x56'));exports['getLogo']=function(_0x32c50b,_0x3d5710,_0x14fb63){var _0x2616d0='server/files/images/logos';var _0x350bad={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x132559){if(_0x132559){_0x350bad=_0x132559;}return db[_0x3327('0x38')][_0x3327('0x50')]({'where':{'id':_0x32c50b[_0x3327('0x4e')]['id']},'attributes':[_0x3327('0x57'),_0x3327('0x55'),_0x3327('0x58'),_0x3327('0x59'),_0x3327('0x5a'),_0x3327('0x5b'),_0x3327('0x5c'),_0x3327('0x5d')],'raw':!![]});})[_0x3327('0x1a')](handleEntityNotFound(_0x3d5710,null))[_0x3327('0x1a')](function(_0x4d8b75){if(_0x4d8b75){var _0x38101e=_0x4d8b75[_0x3327('0x57')]&&fs['existsSync'](path[_0x3327('0x5e')](config['root'],_0x2616d0,_[_0x3327('0x5f')](_0x4d8b75[_0x3327('0x57')])))?path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x2616d0,_[_0x3327('0x5f')](_0x4d8b75[_0x3327('0x57')])):path['join'](config['root'],_0x2616d0,_[_0x3327('0x5f')](_0x3327('0x61')));var _0x2dd799=_0x3327('0x62')+_[_0x3327('0x63')](_0x3327('0x57'));if(_0x4d8b75[_0x2dd799]||!_0x350bad['custom']){_0x38101e=path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x2616d0,_[_0x3327('0x5f')]('default_logo.svg'));}if(!fs[_0x3327('0x64')](_0x38101e)){throw new db[(_0x3327('0x65'))][(_0x3327('0x66'))](_[_0x3327('0x63')](_0x3327('0x57'))+'\x20not\x20found');}return _0x3d5710['download'](_0x38101e);}})[_0x3327('0x24')](handleError(_0x3d5710,null));};var utilLicense=require(_0x3327('0x56'));exports[_0x3327('0x67')]=function(_0x538025,_0x5d0207,_0x2df651){var _0x1040dd='server/files/images/logos';var _0x4d4ccd={'custom':![]};return utilLicense[_0x3327('0x68')]()[_0x3327('0x1a')](function(_0x132c5e){if(_0x132c5e){_0x4d4ccd=_0x132c5e;}return db[_0x3327('0x38')]['find']({'where':{'id':_0x538025[_0x3327('0x4e')]['id']},'attributes':[_0x3327('0x57'),_0x3327('0x55'),_0x3327('0x58'),'favicon',_0x3327('0x5a'),_0x3327('0x5b'),'defaultPreferred',_0x3327('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x5d0207,null))['then'](function(_0x1a3bba){if(_0x1a3bba){var _0x19492b=_0x1a3bba[_0x3327('0x55')]&&fs[_0x3327('0x64')](path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x1040dd,_[_0x3327('0x5f')](_0x1a3bba['loginLogo'])))?path['join'](config[_0x3327('0x60')],_0x1040dd,_[_0x3327('0x5f')](_0x1a3bba[_0x3327('0x55')])):path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x1040dd,_[_0x3327('0x5f')](_0x3327('0x69')));var _0xf60f69=_0x3327('0x62')+_[_0x3327('0x63')](_0x3327('0x55'));if(_0x1a3bba[_0xf60f69]||!_0x4d4ccd[_0x3327('0x6a')]){_0x19492b=path['join'](config[_0x3327('0x60')],_0x1040dd,_[_0x3327('0x5f')](_0x3327('0x69')));}if(!fs['existsSync'](_0x19492b)){throw new db['Sequelize'][(_0x3327('0x66'))](_['upperFirst'](_0x3327('0x55'))+_0x3327('0x6b'));}return _0x5d0207[_0x3327('0x6c')](_0x19492b);}})[_0x3327('0x24')](handleError(_0x5d0207,null));};exports[_0x3327('0x6d')]=function(_0xd6080c,_0x16110e){return db[_0x3327('0x38')][_0x3327('0x50')]({'where':{'id':_0xd6080c[_0x3327('0x4e')]['id']},'attributes':['securePassword']})[_0x3327('0x1a')](respondWithResult(_0x16110e,null))[_0x3327('0x24')](handleError(_0x16110e,null));};exports[_0x3327('0x6e')]=function(_0x4c763c,_0x5c0099,_0x44cf2b){if(_0x4c763c[_0x3327('0x52')]&&_0x4c763c[_0x3327('0x52')][_0x3327('0x53')]){_0x4c763c[_0x3327('0x4f')][_0x3327('0x58')]=_0x4c763c['file'][_0x3327('0x53')];}return db[_0x3327('0x38')][_0x3327('0x50')]({'where':{'id':_0x4c763c[_0x3327('0x4e')]['id']}})[_0x3327('0x1a')](handleEntityNotFound(_0x5c0099,null))[_0x3327('0x1a')](saveUpdates(_0x4c763c[_0x3327('0x4f')],null))[_0x3327('0x1a')](respondWithResult(_0x5c0099,null))[_0x3327('0x24')](handleError(_0x5c0099,null));};var utilLicense=require(_0x3327('0x56'));exports[_0x3327('0x6f')]=function(_0x215af8,_0x329cfb,_0x1eab32){var _0x4ea3f1='server/files/images/logos';var _0x286e85={'custom':![]};return utilLicense[_0x3327('0x68')]()['then'](function(_0x49c3a5){if(_0x49c3a5){_0x286e85=_0x49c3a5;}return db[_0x3327('0x38')]['find']({'where':{'id':_0x215af8[_0x3327('0x4e')]['id']},'attributes':[_0x3327('0x57'),_0x3327('0x55'),'preferred','favicon',_0x3327('0x5a'),_0x3327('0x5b'),_0x3327('0x5c'),_0x3327('0x5d')],'raw':!![]});})[_0x3327('0x1a')](handleEntityNotFound(_0x329cfb,null))['then'](function(_0x3fe427){if(_0x3fe427){var _0x13c099=_0x3fe427[_0x3327('0x58')]&&fs['existsSync'](path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x4ea3f1,_[_0x3327('0x5f')](_0x3fe427['preferred'])))?path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x4ea3f1,_['toLower'](_0x3fe427[_0x3327('0x58')])):path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x4ea3f1,_[_0x3327('0x5f')](_0x3327('0x70')));var _0x46095f=_0x3327('0x62')+_[_0x3327('0x63')](_0x3327('0x58'));if(_0x3fe427[_0x46095f]||!_0x286e85[_0x3327('0x6a')]||!_0x286e85[_0x3327('0x58')]){_0x13c099=path[_0x3327('0x5e')](config['root'],_0x4ea3f1,_[_0x3327('0x5f')](_0x3327('0x70')));}if(!fs[_0x3327('0x64')](_0x13c099)){throw new db[(_0x3327('0x65'))][(_0x3327('0x66'))](_[_0x3327('0x63')]('preferred')+_0x3327('0x6b'));}return _0x329cfb[_0x3327('0x6c')](_0x13c099);}})['catch'](handleError(_0x329cfb,null));};exports['addFavicon']=function(_0x135494,_0x5bd348,_0x15cc3e){if(_0x135494[_0x3327('0x52')]&&_0x135494[_0x3327('0x52')][_0x3327('0x53')]){_0x135494[_0x3327('0x4f')][_0x3327('0x59')]=_0x135494[_0x3327('0x52')][_0x3327('0x53')];}return db[_0x3327('0x38')]['find']({'where':{'id':_0x135494[_0x3327('0x4e')]['id']}})[_0x3327('0x1a')](handleEntityNotFound(_0x5bd348,null))['then'](saveUpdates(_0x135494['body'],null))[_0x3327('0x1a')](respondWithResult(_0x5bd348,null))[_0x3327('0x24')](handleError(_0x5bd348,null));};var utilLicense=require(_0x3327('0x56'));exports[_0x3327('0x71')]=function(_0x942d3f,_0x5b4b9f,_0x506b4f){var _0x4a185c=_0x3327('0x72');var _0x1c8e42={'custom':![]};return utilLicense['getLicense']()[_0x3327('0x1a')](function(_0x210e94){if(_0x210e94){_0x1c8e42=_0x210e94;}return db[_0x3327('0x38')]['find']({'where':{'id':_0x942d3f[_0x3327('0x4e')]['id']},'attributes':['logo',_0x3327('0x55'),_0x3327('0x58'),_0x3327('0x59'),_0x3327('0x5a'),_0x3327('0x5b'),_0x3327('0x5c'),'defaultFavicon'],'raw':!![]});})[_0x3327('0x1a')](handleEntityNotFound(_0x5b4b9f,null))[_0x3327('0x1a')](function(_0x3b455b){if(_0x3b455b){var _0xd70350=_0x3b455b[_0x3327('0x59')]&&fs[_0x3327('0x64')](path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x4a185c,_[_0x3327('0x5f')](_0x3b455b[_0x3327('0x59')])))?path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x4a185c,_[_0x3327('0x5f')](_0x3b455b[_0x3327('0x59')])):path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x4a185c,_[_0x3327('0x5f')](_0x3327('0x73')));var _0x539e8d='default'+_['upperFirst'](_0x3327('0x59'));if(_0x3b455b[_0x539e8d]||!_0x1c8e42[_0x3327('0x6a')]){_0xd70350=path[_0x3327('0x5e')](config[_0x3327('0x60')],_0x4a185c,_[_0x3327('0x5f')]('default_favicon.ico'));}if(!fs[_0x3327('0x64')](_0xd70350)){throw new db['Sequelize']['ValidationError'](_[_0x3327('0x63')](_0x3327('0x59'))+'\x20not\x20found');}return _0x5b4b9f[_0x3327('0x6c')](_0xd70350);}})['catch'](handleError(_0x5b4b9f,null));};exports[_0x3327('0x74')]=function(_0x15a934,_0x180eda){var _0x18c395={'offset':moment()[_0x3327('0x75')]()};_0x18c395[_0x3327('0x76')]=moment()['utcOffset'](_0x18c395['offset'])[_0x3327('0x77')](_0x3327('0x78'));return _0x180eda[_0x3327('0x27')](0xc8)[_0x3327('0x35')](_0x18c395);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 30de17c..6ba638d 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x3ada38,_0x4f584a){var _0x66b511=function(_0x5def79){while(--_0x5def79){_0x3ada38['push'](_0x3ada38['shift']());}};_0x66b511(++_0x4f584a);}(_0xedd9,0xfc));var _0x9edd=function(_0x2a7d88,_0x655229){_0x2a7d88=_0x2a7d88-0x0;var _0x26a5bb=_0xedd9[_0x2a7d88];return _0x26a5bb;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x4610f6,_0x5fe8c3){var _0x422a4d=function(_0x31f4c8){while(--_0x31f4c8){_0x4610f6['push'](_0x4610f6['shift']());}};_0x422a4d(++_0x5fe8c3);}(_0x3e74,0x175));var _0x43e7=function(_0x21b11c,_0x298eb9){_0x21b11c=_0x21b11c-0x0;var _0x5d7bf6=_0x3e74[_0x21b11c];return _0x5d7bf6;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 5071cb6..4a2ee0a 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 _0x88ec=['ShowSetting','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','request\x20sent','Setting','options','raw','where','attributes','include','map','model'];(function(_0x2dbb5f,_0x18e49){var _0x295067=function(_0x3a6abf){while(--_0x3a6abf){_0x2dbb5f['push'](_0x2dbb5f['shift']());}};_0x295067(++_0x18e49);}(_0x88ec,0xdb));var _0xc88e=function(_0x32d446,_0x439be7){_0x32d446=_0x32d446-0x0;var _0x4f3fca=_0x88ec[_0x32d446];return _0x4f3fca;};'use strict';var _=require(_0xc88e('0x0'));var util=require(_0xc88e('0x1'));var moment=require(_0xc88e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc88e('0x3'));var fs=require('fs');var Redis=require(_0xc88e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc88e('0x5'))(_0xc88e('0x6'));var config=require(_0xc88e('0x7'));var jayson=require(_0xc88e('0x8'));var client=jayson[_0xc88e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20e91f,_0x1bc30b,_0xd488b5){return new BPromise(function(_0x351d2a,_0x58e1d6){return client[_0xc88e('0xa')](_0x20e91f,_0xd488b5)[_0xc88e('0xb')](function(_0x58858b){logger[_0xc88e('0xc')]('Setting,\x20%s,\x20%s',_0x1bc30b,'request\x20sent');logger[_0xc88e('0xd')](_0xc88e('0xe'),_0x1bc30b,'request\x20sent',JSON[_0xc88e('0xf')](_0x58858b));if(_0x58858b[_0xc88e('0x10')]){if(_0x58858b[_0xc88e('0x10')][_0xc88e('0x11')]===0x1f4){logger[_0xc88e('0x10')]('Setting,\x20%s,\x20%s',_0x1bc30b,_0x58858b[_0xc88e('0x10')][_0xc88e('0x12')]);return _0x58e1d6(_0x58858b[_0xc88e('0x10')][_0xc88e('0x12')]);}logger['error'](_0xc88e('0x13'),_0x1bc30b,_0x58858b[_0xc88e('0x10')][_0xc88e('0x12')]);return _0x351d2a(_0x58858b[_0xc88e('0x10')][_0xc88e('0x12')]);}else{logger[_0xc88e('0xc')]('Setting,\x20%s,\x20%s',_0x1bc30b,_0xc88e('0x14'));_0x351d2a(_0x58858b['result']['message']);}})['catch'](function(_0x5df635){logger['error']('Setting,\x20%s,\x20%s',_0x1bc30b,_0x5df635);_0x58e1d6(_0x5df635);});});}exports['ShowSetting']=function(_0x4a8079){var _0x209347=this;return new Promise(function(_0x27b849,_0x3ca6cc){return db[_0xc88e('0x15')]['find']({'raw':_0x4a8079[_0xc88e('0x16')]?_0x4a8079[_0xc88e('0x16')][_0xc88e('0x17')]===undefined?!![]:![]:!![],'where':_0x4a8079[_0xc88e('0x16')]?_0x4a8079[_0xc88e('0x16')][_0xc88e('0x18')]||null:null,'attributes':_0x4a8079[_0xc88e('0x16')]?_0x4a8079['options'][_0xc88e('0x19')]||null:null,'include':_0x4a8079[_0xc88e('0x16')]?_0x4a8079[_0xc88e('0x16')][_0xc88e('0x1a')]?_['map'](_0x4a8079[_0xc88e('0x16')][_0xc88e('0x1a')],function(_0x7171){return{'model':db[_0x7171['model']],'as':_0x7171['as'],'attributes':_0x7171[_0xc88e('0x19')],'include':_0x7171['include']?_[_0xc88e('0x1b')](_0x7171[_0xc88e('0x1a')],function(_0x2e232d){return{'model':db[_0x2e232d['model']],'as':_0x2e232d['as'],'attributes':_0x2e232d['attributes'],'include':_0x2e232d['include']?_[_0xc88e('0x1b')](_0x2e232d[_0xc88e('0x1a')],function(_0x26e331){return{'model':db[_0x26e331[_0xc88e('0x1c')]],'as':_0x26e331['as'],'attributes':_0x26e331[_0xc88e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc88e('0xb')](function(_0x521b7c){logger['info'](_0xc88e('0x1d'),_0x4a8079);logger[_0xc88e('0xd')](_0xc88e('0x1d'),_0x4a8079,JSON[_0xc88e('0xf')](_0x521b7c));_0x27b849(_0x521b7c);})[_0xc88e('0x1e')](function(_0x716475){logger[_0xc88e('0x10')](_0xc88e('0x1d'),_0x716475[_0xc88e('0x12')],_0x4a8079);_0x3ca6cc(_0x209347['error'](0x1f4,_0x716475[_0xc88e('0x12')]));});});}; \ No newline at end of file +var _0x8b46=['find','options','where','attributes','map','include','model','debug','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSetting','Setting'];(function(_0x421a2d,_0xefe4a4){var _0x461f53=function(_0x42fdc3){while(--_0x42fdc3){_0x421a2d['push'](_0x421a2d['shift']());}};_0x461f53(++_0xefe4a4);}(_0x8b46,0x1d7));var _0x68b4=function(_0x42a0f4,_0x4c1ef2){_0x42a0f4=_0x42a0f4-0x0;var _0x36dca3=_0x8b46[_0x42a0f4];return _0x36dca3;};'use strict';var _=require(_0x68b4('0x0'));var util=require(_0x68b4('0x1'));var moment=require(_0x68b4('0x2'));var BPromise=require(_0x68b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68b4('0x4'));var db=require(_0x68b4('0x5'))['db'];var utils=require(_0x68b4('0x6'));var logger=require(_0x68b4('0x7'))(_0x68b4('0x8'));var config=require('../../config/environment');var jayson=require(_0x68b4('0x9'));var client=jayson['client'][_0x68b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3084a4,_0x46d1af,_0x4f2af0){return new BPromise(function(_0x2c4e60,_0x33f09f){return client[_0x68b4('0xb')](_0x3084a4,_0x4f2af0)[_0x68b4('0xc')](function(_0x364df0){logger[_0x68b4('0xd')](_0x68b4('0xe'),_0x46d1af,_0x68b4('0xf'));logger['debug'](_0x68b4('0x10'),_0x46d1af,_0x68b4('0xf'),JSON['stringify'](_0x364df0));if(_0x364df0[_0x68b4('0x11')]){if(_0x364df0[_0x68b4('0x11')][_0x68b4('0x12')]===0x1f4){logger[_0x68b4('0x11')](_0x68b4('0xe'),_0x46d1af,_0x364df0[_0x68b4('0x11')][_0x68b4('0x13')]);return _0x33f09f(_0x364df0[_0x68b4('0x11')][_0x68b4('0x13')]);}logger[_0x68b4('0x11')](_0x68b4('0xe'),_0x46d1af,_0x364df0['error'][_0x68b4('0x13')]);return _0x2c4e60(_0x364df0[_0x68b4('0x11')]['message']);}else{logger['info'](_0x68b4('0xe'),_0x46d1af,_0x68b4('0xf'));_0x2c4e60(_0x364df0[_0x68b4('0x14')][_0x68b4('0x13')]);}})[_0x68b4('0x15')](function(_0x3037f3){logger['error'](_0x68b4('0xe'),_0x46d1af,_0x3037f3);_0x33f09f(_0x3037f3);});});}exports[_0x68b4('0x16')]=function(_0x1e46df){var _0x45b635=this;return new Promise(function(_0x14effd,_0x14c9ff){return db[_0x68b4('0x17')][_0x68b4('0x18')]({'raw':_0x1e46df['options']?_0x1e46df['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e46df['options']?_0x1e46df[_0x68b4('0x19')][_0x68b4('0x1a')]||null:null,'attributes':_0x1e46df[_0x68b4('0x19')]?_0x1e46df['options'][_0x68b4('0x1b')]||null:null,'include':_0x1e46df[_0x68b4('0x19')]?_0x1e46df[_0x68b4('0x19')]['include']?_[_0x68b4('0x1c')](_0x1e46df['options'][_0x68b4('0x1d')],function(_0x269ef0){return{'model':db[_0x269ef0['model']],'as':_0x269ef0['as'],'attributes':_0x269ef0[_0x68b4('0x1b')],'include':_0x269ef0[_0x68b4('0x1d')]?_['map'](_0x269ef0[_0x68b4('0x1d')],function(_0x568dad){return{'model':db[_0x568dad[_0x68b4('0x1e')]],'as':_0x568dad['as'],'attributes':_0x568dad[_0x68b4('0x1b')],'include':_0x568dad['include']?_['map'](_0x568dad[_0x68b4('0x1d')],function(_0x3cbea6){return{'model':db[_0x3cbea6[_0x68b4('0x1e')]],'as':_0x3cbea6['as'],'attributes':_0x3cbea6[_0x68b4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x68b4('0xc')](function(_0x1793ff){logger[_0x68b4('0xd')](_0x68b4('0x16'),_0x1e46df);logger[_0x68b4('0x1f')](_0x68b4('0x16'),_0x1e46df,JSON[_0x68b4('0x20')](_0x1793ff));_0x14effd(_0x1793ff);})[_0x68b4('0x15')](function(_0x1a34aa){logger[_0x68b4('0x11')](_0x68b4('0x16'),_0x1a34aa[_0x68b4('0x13')],_0x1e46df);_0x14c9ff(_0x45b635[_0x68b4('0x11')](0x1f4,_0x1a34aa[_0x68b4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 80f5952..04f01af 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1b8139,_0x515e63){var _0x378143=function(_0x31569e){while(--_0x31569e){_0x1b8139['push'](_0x1b8139['shift']());}};_0x378143(++_0x515e63);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x4fdc3e,_0x47de79){var _0x3abc09=function(_0x1b8a37){while(--_0x1b8a37){_0x4fdc3e['push'](_0x4fdc3e['shift']());}};_0x3abc09(++_0x47de79);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 760b932..215df6c 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 _0x37da=['infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','twilio','clicksend','clickatell','bandwidth'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x37da,0x117));var _0xa37d=function(_0x553ccd,_0x4b68ec){_0x553ccd=_0x553ccd-0x0;var _0xb9b969=_0x37da[_0x553ccd];return _0xb9b969;};'use strict';var Sequelize=require(_0xa37d('0x0'));var rs=require(_0xa37d('0x1'));module[_0xa37d('0x2')]={'name':{'type':Sequelize[_0xa37d('0x3')],'unique':_0xa37d('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xa37d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa37d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa37d('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xa37d('0x3')]},'type':{'type':Sequelize['ENUM'](_0xa37d('0x5'),'skebby','connectel',_0xa37d('0x6'),'plivo',_0xa37d('0x7'),_0xa37d('0x8'),'csc',_0xa37d('0x9'),_0xa37d('0xa'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xa37d('0x3')]},'authToken':{'type':Sequelize[_0xa37d('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xa37d('0x3')]},'password':{'type':Sequelize[_0xa37d('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xa37d('0x3')]},'accountId':{'type':Sequelize[_0xa37d('0x3')]},'senderString':{'type':Sequelize[_0xa37d('0x3')]},'deliveryReport':{'type':Sequelize[_0xa37d('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xa37d('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa37d('0xc')],'defaultValue':function(){return _0xa37d('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa37d('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa37d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa37d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa37d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa37d('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa37d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa37d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa37d('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xa37d('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x20299d){if(!_0x20299d)this[_0xa37d('0x10')]('mandatoryDispositionPauseId',null);this[_0xa37d('0x10')](_0xa37d('0x11'),_0x20299d);}}}; \ No newline at end of file +var _0xdf8b=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','infobip','BOOLEAN','TEXT'];(function(_0x863e9e,_0x5854b0){var _0x24fa60=function(_0x346970){while(--_0x346970){_0x863e9e['push'](_0x863e9e['shift']());}};_0x24fa60(++_0x5854b0);}(_0xdf8b,0x10a));var _0xbdf8=function(_0x3b7976,_0x540132){_0x3b7976=_0x3b7976-0x0;var _0x51fc0f=_0xdf8b[_0x3b7976];return _0x51fc0f;};'use strict';var Sequelize=require(_0xbdf8('0x0'));var rs=require(_0xbdf8('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xbdf8('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xbdf8('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xbdf8('0x2')],'defaultValue':function(){return rs[_0xbdf8('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbdf8('0x4')](_0xbdf8('0x5'),_0xbdf8('0x6'),_0xbdf8('0x7'),'clicksend',_0xbdf8('0x8'),_0xbdf8('0x9'),_0xbdf8('0xa'),'csc',_0xbdf8('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0xbdf8('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xbdf8('0x2')]},'smsMethod':{'type':Sequelize[_0xbdf8('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbdf8('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xbdf8('0x2')]},'accountId':{'type':Sequelize[_0xbdf8('0x2')]},'senderString':{'type':Sequelize[_0xbdf8('0x2')]},'deliveryReport':{'type':Sequelize[_0xbdf8('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xbdf8('0x2')]},'notificationTemplate':{'type':Sequelize[_0xbdf8('0xd')],'defaultValue':function(){return _0xbdf8('0xe');}},'notificationSound':{'type':Sequelize[_0xbdf8('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbdf8('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbdf8('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbdf8('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbdf8('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbdf8('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbdf8('0xf')],'comment':_0xbdf8('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xbdf8('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1a351f){if(!_0x1a351f)this[_0xbdf8('0x11')](_0xbdf8('0x12'),null);this[_0xbdf8('0x11')](_0xbdf8('0x13'),_0x1a351f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 126f359..82fc782 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 _0x574f=['omit','SmsInteraction','spread','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','interaction','UserId','User','waitForTheAssignedAgent','SmsQueue','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','stack','finally','sendStatus','getApplications','Contact','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','bandwidth','redif','skebby','inspect','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','end','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','sort','where','filter','merge','type','includeAll','include','findAll','rows','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','nolimit','order','removeDispositions','ids','addAnswer','CannedAnswer','findOne','pick','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','ValidationError','difference','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','sender','text','connectel','from','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','intelepeer','isNil','Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list'];(function(_0x25c394,_0x29f188){var _0x35594a=function(_0x1363d0){while(--_0x1363d0){_0x25c394['push'](_0x25c394['shift']());}};_0x35594a(++_0x29f188);}(_0x574f,0x132));var _0xf574=function(_0x3dacf2,_0x2cd29e){_0x3dacf2=_0x3dacf2-0x0;var _0x3003be=_0x574f[_0x3dacf2];return _0x3003be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf574('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf574('0x1'));var rp=require(_0xf574('0x2'));var moment=require(_0xf574('0x3'));var BPromise=require(_0xf574('0x4'));var Mustache=require(_0xf574('0x5'));var util=require('util');var path=require(_0xf574('0x6'));var sox=require(_0xf574('0x7'));var csv=require(_0xf574('0x8'));var ejs=require(_0xf574('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf574('0xa'));var crypto=require(_0xf574('0xb'));var jsforce=require(_0xf574('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf574('0xd'));var Papa=require(_0xf574('0xe'));var Redis=require(_0xf574('0xf'));var authService=require(_0xf574('0x10'));var qs=require(_0xf574('0x11'));var as=require(_0xf574('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf574('0x13'))(_0xf574('0x14'));var utils=require(_0xf574('0x15'));var config=require(_0xf574('0x16'));var licenseUtil=require(_0xf574('0x17'));var db=require('../../mysqldb')['db'];config[_0xf574('0x18')]=_[_0xf574('0x19')](config[_0xf574('0x18')],{'host':_0xf574('0x1a'),'port':0x18eb});var socket=require(_0xf574('0x1b'))(new Redis(config[_0xf574('0x18')]));require(_0xf574('0x1c'))[_0xf574('0x1d')](socket);var jayson=require(_0xf574('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x183a04,_0x351d1e,_0x496618,_0x1645c3){return new BPromise(function(_0x2b4108,_0x4f0c3b){var _0x5f3a0a=_0x1645c3||client;return _0x5f3a0a[_0xf574('0x1f')](_0x183a04,_0x496618)[_0xf574('0x20')](function(_0x37e3a3){logger[_0xf574('0x21')](_0xf574('0x22'),_0x351d1e,_0xf574('0x23'));logger[_0xf574('0x24')](_0xf574('0x25'),_0x351d1e,_0xf574('0x23'),JSON[_0xf574('0x26')](_0x37e3a3));if(_0x37e3a3['error']){if(_0x37e3a3['error'][_0xf574('0x27')]===0x1f4){logger['error'](_0xf574('0x22'),_0x351d1e,_0x37e3a3[_0xf574('0x28')][_0xf574('0x29')]);return _0x4f0c3b(_0x37e3a3[_0xf574('0x28')]['message']);}logger[_0xf574('0x28')](_0xf574('0x22'),_0x351d1e,_0x37e3a3['error'][_0xf574('0x29')]);return _0x2b4108(_0x37e3a3[_0xf574('0x28')][_0xf574('0x29')]);}else{logger[_0xf574('0x21')](_0xf574('0x22'),_0x351d1e,_0xf574('0x23'));_0x2b4108(_0x37e3a3[_0xf574('0x2a')][_0xf574('0x29')]);}})[_0xf574('0x2b')](function(_0xd9fcf6){logger[_0xf574('0x28')](_0xf574('0x22'),_0x351d1e,_0xd9fcf6);_0x4f0c3b(_0xd9fcf6);});});}function respondWithStatusCode(_0x40778e,_0x5d3eed){_0x5d3eed=_0x5d3eed||0xcc;return function(_0xbdb2aa){if(_0xbdb2aa){return _0x40778e['sendStatus'](_0x5d3eed);}return _0x40778e['status'](_0x5d3eed)[_0xf574('0x2c')]();};}function respondWithResult(_0x4e6ba3,_0x229c9a){_0x229c9a=_0x229c9a||0xc8;return function(_0x30c326){if(_0x30c326){return _0x4e6ba3[_0xf574('0x2d')](_0x229c9a)['json'](_0x30c326);}};}function respondWithFilteredResult(_0xc29a7,_0x30aa57){return function(_0x1009f9){if(_0x1009f9){var _0x384c09=typeof _0x30aa57[_0xf574('0x2e')]==='undefined'&&typeof _0x30aa57[_0xf574('0x2f')]==='undefined';var _0x4f1347=_0x1009f9[_0xf574('0x30')];var _0x17b941=_0x384c09?0x0:_0x30aa57['offset'];var _0x12a69c=_0x384c09?_0x1009f9[_0xf574('0x30')]:_0x30aa57[_0xf574('0x2e')]+_0x30aa57[_0xf574('0x2f')];var _0x4e4fbc;if(_0x12a69c>=_0x4f1347){_0x12a69c=_0x4f1347;_0x4e4fbc=0xc8;}else{_0x4e4fbc=0xce;}_0xc29a7[_0xf574('0x2d')](_0x4e4fbc);return _0xc29a7[_0xf574('0x31')](_0xf574('0x32'),_0x17b941+'-'+_0x12a69c+'/'+_0x4f1347)[_0xf574('0x33')](_0x1009f9);}return null;};}function patchUpdates(_0x1c5469){return function(_0x23d66f){try{jsonpatch[_0xf574('0x34')](_0x23d66f,_0x1c5469,!![]);}catch(_0x1590a8){return BPromise[_0xf574('0x35')](_0x1590a8);}return _0x23d66f[_0xf574('0x36')]();};}function saveUpdates(_0x60c1df,_0x4fc18e){return function(_0x2f43ad){if(_0x2f43ad){return _0x2f43ad[_0xf574('0x37')](_0x60c1df)[_0xf574('0x20')](function(_0xbc37fa){return _0xbc37fa;});}return null;};}function removeEntity(_0xbf7b48,_0x5bfa86){return function(_0x426a52){if(_0x426a52){return _0x426a52[_0xf574('0x38')]()[_0xf574('0x20')](function(){var _0x304b27=_0x426a52[_0xf574('0x39')]({'plain':!![]});var _0x2f0179=_0xf574('0x3a');return db[_0xf574('0x3b')][_0xf574('0x38')]({'where':{'type':_0x2f0179,'resourceId':_0x304b27['id']}})[_0xf574('0x20')](function(){return _0x426a52;});})['then'](function(){_0xbf7b48[_0xf574('0x2d')](0xcc)[_0xf574('0x2c')]();});}};}function handleEntityNotFound(_0x52f727,_0xd0eed0){return function(_0x348d56){if(!_0x348d56){_0x52f727['sendStatus'](0x194);}return _0x348d56;};}function handleError(_0x50de12,_0xabb32e){_0xabb32e=_0xabb32e||0x1f4;return function(_0x296ca4){logger[_0xf574('0x28')](_0x296ca4['stack']);if(_0x296ca4[_0xf574('0x3c')]){delete _0x296ca4['name'];}_0x50de12[_0xf574('0x2d')](_0xabb32e)[_0xf574('0x3d')](_0x296ca4);};}exports[_0xf574('0x3e')]=function(_0x458671,_0x5c7277){var _0x5555b5={'include':[{'model':db[_0xf574('0x3f')],'as':_0xf574('0x40')}]},_0x45ef56={},_0x1a6d38={'count':0x0,'rows':[]};var _0x228159=_[_0xf574('0x41')](db[_0xf574('0x42')][_0xf574('0x43')],function(_0x53b4b1){return{'name':_0x53b4b1[_0xf574('0x44')],'type':_0x53b4b1['type'][_0xf574('0x45')]};});_0x45ef56[_0xf574('0x46')]=_[_0xf574('0x41')](_0x228159,_0xf574('0x3c'));_0x45ef56['query']=_[_0xf574('0x47')](_0x458671['query']);_0x45ef56[_0xf574('0x48')]=_[_0xf574('0x49')](_0x45ef56[_0xf574('0x46')],_0x45ef56['query']);_0x5555b5[_0xf574('0x4a')]=_[_0xf574('0x49')](_0x45ef56[_0xf574('0x46')],qs[_0xf574('0x4b')](_0x458671[_0xf574('0x4c')][_0xf574('0x4b')]));_0x5555b5[_0xf574('0x4a')]=_0x5555b5['attributes'][_0xf574('0x4d')]?_0x5555b5[_0xf574('0x4a')]:_0x45ef56['model'];if(!_0x458671[_0xf574('0x4c')][_0xf574('0x4e')]('nolimit')){_0x5555b5[_0xf574('0x2f')]=qs[_0xf574('0x2f')](_0x458671[_0xf574('0x4c')][_0xf574('0x2f')]);_0x5555b5[_0xf574('0x2e')]=qs[_0xf574('0x2e')](_0x458671[_0xf574('0x4c')][_0xf574('0x2e')]);}_0x5555b5['order']=qs[_0xf574('0x4f')](_0x458671['query'][_0xf574('0x4f')]);_0x5555b5[_0xf574('0x50')]=qs['filters'](_['pick'](_0x458671[_0xf574('0x4c')],_0x45ef56['filters']),_0x228159);if(_0x458671[_0xf574('0x4c')][_0xf574('0x51')]){_0x5555b5[_0xf574('0x50')]=_[_0xf574('0x52')](_0x5555b5['where'],{'$or':_['map'](_0x228159,function(_0x3bd87d){if(_0x3bd87d[_0xf574('0x53')]!=='VIRTUAL'){var _0x1b6251={};_0x1b6251[_0x3bd87d[_0xf574('0x3c')]]={'$like':'%'+_0x458671['query'][_0xf574('0x51')]+'%'};return _0x1b6251;}})});}_0x5555b5=_['merge']({},_0x5555b5,_0x458671['options']);var _0x1eba26={'where':_0x5555b5[_0xf574('0x50')]};return db[_0xf574('0x42')][_0xf574('0x30')](_0x1eba26)['then'](function(_0x3f5438){_0x1a6d38['count']=_0x3f5438;if(_0x458671['query'][_0xf574('0x54')]){_0x5555b5[_0xf574('0x55')]=[{'all':!![]}];}return db[_0xf574('0x42')][_0xf574('0x56')](_0x5555b5);})['then'](function(_0x3aae2c){_0x1a6d38[_0xf574('0x57')]=_0x3aae2c;return _0x1a6d38;})[_0xf574('0x20')](respondWithFilteredResult(_0x5c7277,_0x5555b5))[_0xf574('0x2b')](handleError(_0x5c7277,null));};exports[_0xf574('0x58')]=function(_0x19b52b,_0x58cc19){var _0xa27fa3={'raw':![],'where':{'id':_0x19b52b['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x338112={};_0x338112[_0xf574('0x46')]=_['keys'](db[_0xf574('0x42')][_0xf574('0x43')]);_0x338112[_0xf574('0x4c')]=_['keys'](_0x19b52b['query']);_0x338112[_0xf574('0x48')]=_[_0xf574('0x49')](_0x338112['model'],_0x338112[_0xf574('0x4c')]);_0xa27fa3[_0xf574('0x4a')]=_[_0xf574('0x49')](_0x338112[_0xf574('0x46')],qs[_0xf574('0x4b')](_0x19b52b[_0xf574('0x4c')]['fields']));_0xa27fa3[_0xf574('0x4a')]=_0xa27fa3[_0xf574('0x4a')][_0xf574('0x4d')]?_0xa27fa3[_0xf574('0x4a')]:_0x338112[_0xf574('0x46')];if(_0x19b52b['query'][_0xf574('0x54')]){_0xa27fa3[_0xf574('0x55')]=[{'all':!![]}];}_0xa27fa3=_['merge']({},_0xa27fa3,_0x19b52b[_0xf574('0x59')]);return db[_0xf574('0x42')][_0xf574('0x5a')](_0xa27fa3)[_0xf574('0x20')](handleEntityNotFound(_0x58cc19,null))[_0xf574('0x20')](respondWithResult(_0x58cc19,null))[_0xf574('0x2b')](handleError(_0x58cc19,null));};exports[_0xf574('0x5b')]=function(_0x349749,_0x372e5f){return db['SmsAccount'][_0xf574('0x5b')](_0x349749[_0xf574('0x5c')],{})[_0xf574('0x20')](function(_0x221977){var _0x5422af=_0x349749[_0xf574('0x5d')]['get']({'plain':!![]});if(!_0x5422af)throw new Error(_0xf574('0x5e'));if(_0x5422af[_0xf574('0x5f')]===_0xf574('0x5d')){var _0x59f9c6=_0x221977[_0xf574('0x39')]({'plain':!![]});var _0x2f379f=_0xf574('0x3a');return db['UserProfileSection'][_0xf574('0x5a')]({'where':{'name':_0x2f379f,'userProfileId':_0x5422af[_0xf574('0x60')]},'raw':!![]})['then'](function(_0x2c7785){if(_0x2c7785&&_0x2c7785['autoAssociation']===0x0){return db['UserProfileResource'][_0xf574('0x5b')]({'name':_0x59f9c6[_0xf574('0x3c')],'resourceId':_0x59f9c6['id'],'type':_0x2c7785[_0xf574('0x3c')],'sectionId':_0x2c7785['id']},{})[_0xf574('0x20')](function(){return _0x221977;});}else{return _0x221977;}})[_0xf574('0x2b')](function(_0x42e393){logger[_0xf574('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42e393);throw _0x42e393;});}return _0x221977;})[_0xf574('0x20')](respondWithResult(_0x372e5f,0xc9))['catch'](handleError(_0x372e5f,null));};exports['update']=function(_0xfc0f6a,_0x39db1e){if(_0xfc0f6a[_0xf574('0x5c')]['id']){delete _0xfc0f6a[_0xf574('0x5c')]['id'];}return db['SmsAccount'][_0xf574('0x5a')]({'where':{'id':_0xfc0f6a[_0xf574('0x61')]['id']},'include':[{'model':db[_0xf574('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xf574('0x20')](handleEntityNotFound(_0x39db1e,null))[_0xf574('0x20')](saveUpdates(_0xfc0f6a[_0xf574('0x5c')],null))['then'](respondWithResult(_0x39db1e,null))[_0xf574('0x2b')](handleError(_0x39db1e,null));};exports[_0xf574('0x38')]=function(_0x2bcee0,_0x561d39){return db[_0xf574('0x42')][_0xf574('0x5a')]({'where':{'id':_0x2bcee0[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x561d39,null))[_0xf574('0x20')](removeEntity(_0x561d39,null))[_0xf574('0x2b')](handleError(_0x561d39,null));};exports['describe']=function(_0x17a9bb,_0x363916){return db[_0xf574('0x42')][_0xf574('0x62')]()[_0xf574('0x20')](respondWithResult(_0x363916,null))['catch'](handleError(_0x363916,null));};exports[_0xf574('0x63')]=function(_0xe13d5c,_0x44f0de,_0x9407c9){if(_0xe13d5c['body']['id']){delete _0xe13d5c[_0xf574('0x5c')]['id'];}return db[_0xf574('0x42')][_0xf574('0x5a')]({'where':{'id':_0xe13d5c[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x44f0de,null))['then'](function(_0xc8cacb){if(_0xc8cacb){_0xe13d5c['body'][_0xf574('0x64')]=_0xc8cacb['id'];return db[_0xf574('0x65')][_0xf574('0x5b')](_0xe13d5c[_0xf574('0x5c')]);}})[_0xf574('0x20')](respondWithResult(_0x44f0de,null))['catch'](handleError(_0x44f0de,null));};exports[_0xf574('0x66')]=function(_0xd92c4c,_0x3ec467,_0x3bb231){var _0x3c57c1={'raw':![],'where':{}};var _0x265a3a={};var _0x55624d={'count':0x0,'rows':[]};return db[_0xf574('0x42')]['findOne']({'where':{'id':_0xd92c4c['params']['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x3ec467,null))[_0xf574('0x20')](function(_0x23f05b){if(_0x23f05b){_0x265a3a[_0xf574('0x46')]=_['keys'](db[_0xf574('0x65')][_0xf574('0x43')]);_0x265a3a[_0xf574('0x4c')]=_[_0xf574('0x47')](_0xd92c4c[_0xf574('0x4c')]);_0x265a3a[_0xf574('0x48')]=_['intersection'](_0x265a3a[_0xf574('0x46')],_0x265a3a[_0xf574('0x4c')]);_0x3c57c1[_0xf574('0x4a')]=_['intersection'](_0x265a3a[_0xf574('0x46')],qs[_0xf574('0x4b')](_0xd92c4c['query']['fields']));_0x3c57c1[_0xf574('0x4a')]=_0x3c57c1['attributes'][_0xf574('0x4d')]?_0x3c57c1[_0xf574('0x4a')]:_0x265a3a[_0xf574('0x46')];if(!_0xd92c4c[_0xf574('0x4c')]['hasOwnProperty'](_0xf574('0x67'))){_0x3c57c1[_0xf574('0x2f')]=qs['limit'](_0xd92c4c[_0xf574('0x4c')][_0xf574('0x2f')]);_0x3c57c1[_0xf574('0x2e')]=qs[_0xf574('0x2e')](_0xd92c4c[_0xf574('0x4c')][_0xf574('0x2e')]);}_0x3c57c1[_0xf574('0x68')]=qs[_0xf574('0x4f')](_0xd92c4c[_0xf574('0x4c')][_0xf574('0x4f')]);_0x3c57c1[_0xf574('0x50')]=qs[_0xf574('0x48')](_['pick'](_0xd92c4c[_0xf574('0x4c')],_0x265a3a[_0xf574('0x48')]));_0x3c57c1[_0xf574('0x50')]['SmsAccountId']=_0x23f05b['id'];if(_0xd92c4c[_0xf574('0x4c')][_0xf574('0x51')]){_0x3c57c1['where']=_[_0xf574('0x52')](_0x3c57c1[_0xf574('0x50')],{'$or':_[_0xf574('0x41')](_0x3c57c1[_0xf574('0x4a')],function(_0x26ec98){var _0x4f17c5={};_0x4f17c5[_0x26ec98]={'$like':'%'+_0xd92c4c['query'][_0xf574('0x51')]+'%'};return _0x4f17c5;})});}_0x3c57c1=_[_0xf574('0x52')]({},_0x3c57c1,_0xd92c4c[_0xf574('0x59')]);return db[_0xf574('0x65')][_0xf574('0x30')]({'where':_0x3c57c1[_0xf574('0x50')]})[_0xf574('0x20')](function(_0x2124c4){_0x55624d[_0xf574('0x30')]=_0x2124c4;if(_0xd92c4c[_0xf574('0x4c')][_0xf574('0x54')]){_0x3c57c1[_0xf574('0x55')]=[{'all':!![]}];}return db[_0xf574('0x65')][_0xf574('0x56')](_0x3c57c1);})['then'](function(_0x1b9a7b){_0x55624d[_0xf574('0x57')]=_0x1b9a7b;return _0x55624d;});}})[_0xf574('0x20')](respondWithFilteredResult(_0x3ec467,_0x3c57c1))['catch'](handleError(_0x3ec467,null));};exports[_0xf574('0x69')]=function(_0x59c894,_0x44cbb4,_0x150157){return db['SmsAccount'][_0xf574('0x5a')]({'where':{'id':_0x59c894[_0xf574('0x61')]['id']}})['then'](handleEntityNotFound(_0x44cbb4,null))[_0xf574('0x20')](function(_0x3d4996){if(_0x3d4996){return _0x3d4996[_0xf574('0x69')](_0x59c894['query'][_0xf574('0x6a')]);}})[_0xf574('0x20')](respondWithStatusCode(_0x44cbb4,null))[_0xf574('0x2b')](handleError(_0x44cbb4,null));};exports[_0xf574('0x6b')]=function(_0x4760ea,_0x420799,_0x1a5bf2){if(_0x4760ea['body']['id']){delete _0x4760ea['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x4760ea[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x420799,null))[_0xf574('0x20')](function(_0x420b73){if(_0x420b73){_0x4760ea[_0xf574('0x5c')][_0xf574('0x64')]=_0x420b73['id'];return db[_0xf574('0x6c')]['create'](_0x4760ea['body']);}})['then'](respondWithResult(_0x420799,null))[_0xf574('0x2b')](handleError(_0x420799,null));};exports['getAnswers']=function(_0xf3b6fb,_0x2b8ea6,_0x5b25a3){var _0x396c94={'raw':![],'where':{}};var _0x1b0ac7={};var _0x4395d7={'count':0x0,'rows':[]};return db['SmsAccount'][_0xf574('0x6d')]({'where':{'id':_0xf3b6fb[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x2b8ea6,null))[_0xf574('0x20')](function(_0x21042f){if(_0x21042f){_0x1b0ac7[_0xf574('0x46')]=_[_0xf574('0x47')](db[_0xf574('0x6c')][_0xf574('0x43')]);_0x1b0ac7[_0xf574('0x4c')]=_[_0xf574('0x47')](_0xf3b6fb[_0xf574('0x4c')]);_0x1b0ac7['filters']=_[_0xf574('0x49')](_0x1b0ac7['model'],_0x1b0ac7[_0xf574('0x4c')]);_0x396c94[_0xf574('0x4a')]=_[_0xf574('0x49')](_0x1b0ac7[_0xf574('0x46')],qs['fields'](_0xf3b6fb[_0xf574('0x4c')][_0xf574('0x4b')]));_0x396c94['attributes']=_0x396c94[_0xf574('0x4a')][_0xf574('0x4d')]?_0x396c94['attributes']:_0x1b0ac7[_0xf574('0x46')];if(!_0xf3b6fb[_0xf574('0x4c')]['hasOwnProperty'](_0xf574('0x67'))){_0x396c94[_0xf574('0x2f')]=qs[_0xf574('0x2f')](_0xf3b6fb[_0xf574('0x4c')][_0xf574('0x2f')]);_0x396c94['offset']=qs['offset'](_0xf3b6fb[_0xf574('0x4c')][_0xf574('0x2e')]);}_0x396c94['order']=qs['sort'](_0xf3b6fb['query']['sort']);_0x396c94[_0xf574('0x50')]=qs[_0xf574('0x48')](_[_0xf574('0x6e')](_0xf3b6fb[_0xf574('0x4c')],_0x1b0ac7[_0xf574('0x48')]));_0x396c94['where']['SmsAccountId']=_0x21042f['id'];if(_0xf3b6fb['query'][_0xf574('0x51')]){_0x396c94['where']=_[_0xf574('0x52')](_0x396c94[_0xf574('0x50')],{'$or':_[_0xf574('0x41')](_0x396c94['attributes'],function(_0x9b2c22){var _0x5a6b51={};_0x5a6b51[_0x9b2c22]={'$like':'%'+_0xf3b6fb['query'][_0xf574('0x51')]+'%'};return _0x5a6b51;})});}_0x396c94=_[_0xf574('0x52')]({},_0x396c94,_0xf3b6fb[_0xf574('0x59')]);return db['CannedAnswer'][_0xf574('0x30')]({'where':_0x396c94[_0xf574('0x50')]})[_0xf574('0x20')](function(_0x5a5cae){_0x4395d7[_0xf574('0x30')]=_0x5a5cae;if(_0xf3b6fb[_0xf574('0x4c')][_0xf574('0x54')]){_0x396c94[_0xf574('0x55')]=[{'all':!![]}];}return db[_0xf574('0x6c')][_0xf574('0x56')](_0x396c94);})[_0xf574('0x20')](function(_0x1ad4f8){_0x4395d7['rows']=_0x1ad4f8;return _0x4395d7;});}})['then'](respondWithFilteredResult(_0x2b8ea6,_0x396c94))[_0xf574('0x2b')](handleError(_0x2b8ea6,null));};exports[_0xf574('0x6f')]=function(_0x3708df,_0x2989d7,_0x355370){return db['SmsAccount']['find']({'where':{'id':_0x3708df[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x2989d7,null))['then'](function(_0x27f2ad){if(_0x27f2ad){return _0x27f2ad[_0xf574('0x6f')](_0x3708df[_0xf574('0x4c')][_0xf574('0x6a')]);}})['then'](respondWithStatusCode(_0x2989d7,null))[_0xf574('0x2b')](handleError(_0x2989d7,null));};exports[_0xf574('0x70')]=function(_0x3d24f2,_0x10913b,_0x2ab4e4){var _0x5e7dd1={'channel':_0xf574('0x71')};var _0x55b0b7=[];var _0x1a5063=[];var _0x1fe232={};return db[_0xf574('0x42')]['find']({'where':{'id':_0x3d24f2[_0xf574('0x61')]['id']},'include':[{'model':db[_0xf574('0x72')],'as':_0xf574('0x73')}]})[_0xf574('0x20')](handleEntityNotFound(_0x10913b,null))[_0xf574('0x20')](function(_0x296d52){_0x5e7dd1['account']=_0x296d52;_0x5e7dd1[_0xf574('0x74')]=_[_0xf574('0x75')](_0x296d52[_0xf574('0x73')],[_0xf574('0x76')],[_0xf574('0x77')]);if(_0x5e7dd1['account']['Applications']){delete _0x5e7dd1[_0xf574('0x78')][_0xf574('0x73')];}return db[_0xf574('0x79')]['describe']();})[_0xf574('0x20')](function(_0x5d47b5){if(!_0x5d47b5){throw new db['Sequelize'][(_0xf574('0x7a'))]('no\x20available\x20attributes');}_0x55b0b7=_[_0xf574('0x7b')](_['keys'](_0x5d47b5),['createdAt',_0xf574('0x7c')]);_0x1a5063=_['difference'](_[_0xf574('0x47')](_0x5d47b5),['createdAt',_0xf574('0x7c'),_0xf574('0x7d'),_0xf574('0x7e')]);_0x5e7dd1['body']={'mapKey':_0xf574('0x7f')};if(_0x5e7dd1[_0xf574('0x78')][_0xf574('0x53')]){switch(_0x5e7dd1[_0xf574('0x78')][_0xf574('0x53')]){case _0xf574('0x80'):_0x5e7dd1[_0xf574('0x5c')]['from']=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x81')];_0x5e7dd1[_0xf574('0x5c')]['body']=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x82')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x84')];break;case'skebby':_0x5e7dd1[_0xf574('0x5c')]['from']='+'+_0x3d24f2['body'][_0xf574('0x85')];_0x5e7dd1['body']['body']=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x86')];break;case _0xf574('0x87'):_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x88')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x29')];break;case _0xf574('0x89'):_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')]=_0x3d24f2[_0xf574('0x5c')]['from'];_0x5e7dd1['body'][_0xf574('0x5c')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x5c')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x8a')];break;case'plivo':_0x5e7dd1['body']['from']=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x81')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x8b')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x8c')];break;case _0xf574('0x8d'):_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')]='+'+_0x3d24f2[_0xf574('0x5c')][_0xf574('0x8e')][0x0][_0xf574('0x88')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')]=_0x3d24f2[_0xf574('0x5c')]['results'][0x0]['text'];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')]=_0x3d24f2[_0xf574('0x5c')]['results'][0x0]['messageId'];break;case _0xf574('0x8f'):_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x90')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')]=_0x3d24f2['body']['segmentedMessage']['message'];break;case _0xf574('0x91'):_0x5e7dd1['body'][_0xf574('0x88')]=_0x3d24f2[_0xf574('0x5c')]['fromNumber'];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x86')];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')]=_0x3d24f2[_0xf574('0x5c')]['replyMessageId'];break;case'bandwidth':_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')]=_0x3d24f2[_0xf574('0x5c')][0x0][_0xf574('0x29')]['id'];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')]=_0x3d24f2['body'][0x0][_0xf574('0x29')]['from'];_0x5e7dd1['body'][_0xf574('0x5c')]=_0x3d24f2[_0xf574('0x5c')][0x0]['message'][_0xf574('0x86')];break;case _0xf574('0x92'):_0x5e7dd1['body'][_0xf574('0x88')]=_0x3d24f2[_0xf574('0x5c')][_0xf574('0x88')];_0x5e7dd1['body'][_0xf574('0x5c')]=_0x3d24f2[_0xf574('0x5c')]['message'];_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')]=_0x3d24f2[_0xf574('0x5c')]['refid'];break;}}if(_0x5e7dd1[_0xf574('0x5c')]['id']){delete _0x5e7dd1[_0xf574('0x5c')]['id'];}if(_[_0xf574('0x93')](_0x5e7dd1['body'][_0xf574('0x88')])){throw new db[(_0xf574('0x94'))][(_0xf574('0x7a'))](_0xf574('0x95'));}if(_[_0xf574('0x93')](_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')])||_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')]===''){throw new db[(_0xf574('0x94'))][(_0xf574('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf574('0x93')](_0x5e7dd1[_0xf574('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0xf574('0x7a'))](_0xf574('0x96')+_0x1a5063);}if(!_['includes'](_0x1a5063,_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x97')])){throw new db[(_0xf574('0x94'))][(_0xf574('0x7a'))](_0xf574('0x98')+_0x1a5063);}_0x1fe232[_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x97')]]=_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')];return db[_0xf574('0x99')][_0xf574('0x5a')]({'where':{'id':_0x5e7dd1[_0xf574('0x78')]['ListId']},'include':[{'model':db[_0xf574('0x79')],'as':_0xf574('0x9a'),'where':_0x1fe232,'limit':0x1,'order':[[_0xf574('0x7c'),'DESC']]}]});})[_0xf574('0x20')](handleEntityNotFound(_0x10913b,null))['then'](function(_0x109c0b){if(_0x109c0b){_0x5e7dd1[_0xf574('0x9b')]=_[_0xf574('0x9c')](_0x109c0b,['Contacts']);if(_0x109c0b[_0xf574('0x9a')]['length']){return _0x109c0b[_0xf574('0x9a')][0x0];}var _0x233d7f=_[_0xf574('0x19')](_0x5e7dd1['body'],{'firstName':_0x5e7dd1[_0xf574('0x5c')]['from'],'ListId':_0x109c0b['id']});_0x233d7f[_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x97')]]=_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')];return db[_0xf574('0x79')][_0xf574('0x5b')](_0x233d7f,{'fields':_0x55b0b7,'raw':!![]});}})[_0xf574('0x20')](handleEntityNotFound(_0x10913b,null))[_0xf574('0x20')](function(_0x4dfe9f){if(_0x4dfe9f){_0x5e7dd1['contact']=_0x4dfe9f;var _0x4ea2dd={'ContactId':_0x4dfe9f['id'],'phone':_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')],'SmsAccountId':_0x3d24f2[_0xf574('0x61')]['id']};var _0x5b165f={'ContactId':_0x4dfe9f['id'],'SmsAccountId':_0x3d24f2[_0xf574('0x61')]['id'],'closed':![]};return db[_0xf574('0x9d')]['find']({'where':_0x5b165f})[_0xf574('0x20')](function(_0x343054){if(_0x343054){return[_0x343054,![]];}return db[_0xf574('0x9d')][_0xf574('0x5b')](_0x4ea2dd)[_0xf574('0x20')](function(_0x331338){return[_0x331338,!![]];});});}})[_0xf574('0x9e')](function(_0x44e0d5,_0x2e6f46){_0x5e7dd1['interaction']=_0x44e0d5['get']({'plain':!![]});_0x5e7dd1['interaction'][_0xf574('0x9f')]=![];if(_0x2e6f46){if(_0x5e7dd1[_0xf574('0x78')][_0xf574('0xa0')]){_0x5e7dd1[_0xf574('0x74')][_0xf574('0xa1')]({'id':0x0,'priority':_0x5e7dd1[_0xf574('0x74')][_0xf574('0x4d')]+0x1,'app':_0xf574('0xa2'),'appdata':_0xf574('0xa3'),'interval':'*,*,*,*'});}_0x5e7dd1['interaction']['created']=!![];}return db[_0xf574('0xa4')]['create']({'phone':_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x88')],'messageId':_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x83')],'body':_0x5e7dd1[_0xf574('0x5c')][_0xf574('0x5c')],'SmsAccountId':_0x3d24f2['params']['id'],'SmsInteractionId':_0x44e0d5['id'],'direction':'in','ContactId':_0x44e0d5[_0xf574('0xa5')],'AttachmentId':_0x5e7dd1['body'][_0xf574('0xa6')]});})[_0xf574('0x20')](function(_0x19223a){_0x5e7dd1[_0xf574('0x29')]=_0x19223a;if(!_0x5e7dd1[_0xf574('0xa7')][_0xf574('0xa8')])return;return db[_0xf574('0xa9')][_0xf574('0x5a')]({'attributes':['id','name'],'where':{'id':_0x5e7dd1[_0xf574('0xa7')]['UserId']}});})[_0xf574('0x20')](function(_0x5b4cd7){if(_0x5b4cd7){_0x5e7dd1[_0xf574('0x74')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b4cd7[_0xf574('0x3c')]+','+(_0x5e7dd1[_0xf574('0x78')][_0xf574('0xaa')]||0xa),'interval':'*,*,*,*'});}if(!_0x5e7dd1[_0xf574('0xa7')]['queueId'])return;return db[_0xf574('0xab')]['find']({'attributes':['id',_0xf574('0x3c')],'where':{'id':_0x5e7dd1[_0xf574('0xa7')][_0xf574('0xac')]}});})['then'](function(_0x415f3b){if(_0x415f3b){_0x5e7dd1[_0xf574('0x74')][_0xf574('0xad')]({'id':0x0,'priority':0x1,'app':_0xf574('0xae'),'appdata':_0x415f3b[_0xf574('0x3c')]+','+(_0x5e7dd1[_0xf574('0x78')][_0xf574('0xaf')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf574('0xb0'),_0xf574('0xb1'),_0x5e7dd1);})[_0xf574('0x20')](function(_0x405692){if(_0x405692){var _0x328b71=0xc8;var _0x123719=_0xf574('0xb2');logger[_0xf574('0x21')](_0xf574('0x25'),_0x123719,_0x328b71,'entity\x20found');logger[_0xf574('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x123719,_0x328b71,_0xf574('0xb3'),JSON[_0xf574('0x26')](_0x405692));if(_0x5e7dd1[_0xf574('0x78')][_0xf574('0x53')]===_0xf574('0x80')){return _0x10913b[_0xf574('0x2d')](_0x328b71)[_0xf574('0x31')](_0xf574('0xb4'),_0xf574('0xb5'))['send'](_0xf574('0xb6'));}else{return _0x10913b['status'](_0x328b71)[_0xf574('0x33')](_0x405692);}}})[_0xf574('0x2b')](handleError(_0x10913b,null));};exports[_0xf574('0xb7')]=function(_0x20c49c,_0x3dcde4){var _0x3ae5a7=_0x20c49c[_0xf574('0x61')]['id'];var _0x4470aa=_0x20c49c['body'];var _0x37cd2b=0xc8;var _0x2928a4=null;return db['sequelize'][_0xf574('0xb8')]({'isolationLevel':db[_0xf574('0xb9')][_0xf574('0xba')][_0xf574('0xbb')]['READ_COMMITTED']},function(_0x42b3fa){return db[_0xf574('0x42')][_0xf574('0x6d')]({'where':{'id':_0x3ae5a7},'transaction':_0x42b3fa})[_0xf574('0x20')](function(_0x1bbb2c){if(_0x1bbb2c){return db[_0xf574('0x72')][_0xf574('0x38')]({'where':{'SmsAccountId':_0x3ae5a7},'transaction':_0x42b3fa})[_0xf574('0x20')](function(){var _0x571890=_[_0xf574('0x41')](_0x4470aa,function(_0x407811){_0x407811['SmsAccountId']=_0x3ae5a7;return _0x407811;});return db[_0xf574('0x72')][_0xf574('0xbc')](_0x571890,{'transaction':_0x42b3fa});});}else{_0x37cd2b=0x194;_0x2928a4=[];}});})[_0xf574('0x20')](function(){if(_0x37cd2b!==0x194){return db[_0xf574('0x72')][_0xf574('0xbd')]({'where':{'SmsAccountId':_0x3ae5a7},'order':_0xf574('0x76')})[_0xf574('0x20')](function(_0x3f69c4){_0x2928a4=_0x3f69c4;});}})[_0xf574('0x2b')](function(_0x742d88){_0x37cd2b=0x1f4;logger[_0xf574('0x28')](_0x742d88[_0xf574('0xbe')]);if(_0x742d88[_0xf574('0x3c')]){delete _0x742d88[_0xf574('0x3c')];}_0x2928a4=_0x742d88;})[_0xf574('0xbf')](function(){if(_0x2928a4===null){_0x3dcde4[_0xf574('0xc0')](_0x37cd2b);}else{if(_0x37cd2b===0x1f4){_0x3dcde4['status'](_0x37cd2b)['send'](_0x2928a4);}else{_0x3dcde4[_0xf574('0x2d')](_0x37cd2b)['json'](_0x2928a4);}}});};exports[_0xf574('0xc1')]=function(_0x3e29f1,_0x2f2d09,_0x3f4ab8){var _0x8fc991={};var _0x565e4f={};var _0x588412;var _0x2eb068;return db[_0xf574('0x42')][_0xf574('0x6d')]({'where':{'id':_0x3e29f1[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x2f2d09,null))['then'](function(_0x2efcb5){if(_0x2efcb5){_0x588412=_0x2efcb5;_0x565e4f[_0xf574('0x46')]=_[_0xf574('0x47')](db[_0xf574('0x72')]['rawAttributes']);_0x565e4f[_0xf574('0x4c')]=_[_0xf574('0x47')](_0x3e29f1['query']);_0x565e4f[_0xf574('0x48')]=_['intersection'](_0x565e4f[_0xf574('0x46')],_0x565e4f[_0xf574('0x4c')]);_0x8fc991['attributes']=_[_0xf574('0x49')](_0x565e4f[_0xf574('0x46')],qs[_0xf574('0x4b')](_0x3e29f1[_0xf574('0x4c')][_0xf574('0x4b')]));_0x8fc991[_0xf574('0x4a')]=_0x8fc991[_0xf574('0x4a')][_0xf574('0x4d')]?_0x8fc991[_0xf574('0x4a')]:_0x565e4f[_0xf574('0x46')];_0x8fc991[_0xf574('0x68')]=qs['sort'](_0x3e29f1[_0xf574('0x4c')]['sort']);_0x8fc991[_0xf574('0x50')]=qs[_0xf574('0x48')](_[_0xf574('0x6e')](_0x3e29f1[_0xf574('0x4c')],_0x565e4f[_0xf574('0x48')]));if(_0x3e29f1['query']['filter']){_0x8fc991['where']=_[_0xf574('0x52')](_0x8fc991[_0xf574('0x50')],{'$or':_['map'](_0x8fc991[_0xf574('0x4a')],function(_0x1758c8){var _0x18a664={};_0x18a664[_0x1758c8]={'$like':'%'+_0x3e29f1[_0xf574('0x4c')][_0xf574('0x51')]+'%'};return _0x18a664;})});}_0x8fc991=_[_0xf574('0x52')]({},_0x8fc991,_0x3e29f1[_0xf574('0x59')]);return _0x588412[_0xf574('0xc1')](_0x8fc991);}})['then'](function(_0x59a887){if(_0x59a887){_0x2eb068=_0x59a887['length'];if(!_0x3e29f1[_0xf574('0x4c')][_0xf574('0x4e')](_0xf574('0x67'))){_0x8fc991[_0xf574('0x2f')]=qs[_0xf574('0x2f')](_0x3e29f1[_0xf574('0x4c')][_0xf574('0x2f')]);_0x8fc991[_0xf574('0x2e')]=qs[_0xf574('0x2e')](_0x3e29f1['query'][_0xf574('0x2e')]);}return _0x588412[_0xf574('0xc1')](_0x8fc991);}})[_0xf574('0x20')](function(_0x26264b){if(_0x26264b){return _0x26264b?{'count':_0x2eb068,'rows':_0x26264b}:null;}})[_0xf574('0x20')](respondWithResult(_0x2f2d09,null))[_0xf574('0x2b')](handleError(_0x2f2d09,null));};exports['getInteractions']=function(_0x1ea02d,_0x228988,_0x5516b2){var _0x1d3672={'raw':![],'where':{}};var _0x3544d4={};var _0x5a9d4c={'count':0x0,'rows':[]};return db[_0xf574('0x42')][_0xf574('0x6d')]({'where':{'id':_0x1ea02d['params']['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x228988,null))['then'](function(_0x493523){if(_0x493523){_0x3544d4[_0xf574('0x46')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x3544d4[_0xf574('0x4c')]=_[_0xf574('0x47')](_0x1ea02d[_0xf574('0x4c')]);_0x3544d4['filters']=_['intersection'](_0x3544d4[_0xf574('0x46')],_0x3544d4[_0xf574('0x4c')]);_0x1d3672[_0xf574('0x4a')]=_[_0xf574('0x49')](_0x3544d4[_0xf574('0x46')],qs['fields'](_0x1ea02d['query'][_0xf574('0x4b')]));_0x1d3672[_0xf574('0x4a')]=_0x1d3672['attributes'][_0xf574('0x4d')]?_0x1d3672[_0xf574('0x4a')]:_0x3544d4[_0xf574('0x46')];if(!_0x1ea02d[_0xf574('0x4c')]['hasOwnProperty'](_0xf574('0x67'))){_0x1d3672[_0xf574('0x2f')]=qs[_0xf574('0x2f')](_0x1ea02d['query']['limit']);_0x1d3672[_0xf574('0x2e')]=qs[_0xf574('0x2e')](_0x1ea02d[_0xf574('0x4c')][_0xf574('0x2e')]);}_0x1d3672[_0xf574('0x68')]=qs[_0xf574('0x4f')](_0x1ea02d[_0xf574('0x4c')]['sort']);_0x1d3672[_0xf574('0x50')]=qs['filters'](_[_0xf574('0x6e')](_0x1ea02d['query'],_0x3544d4['filters']));_0x1d3672[_0xf574('0x50')][_0xf574('0x64')]=_0x493523['id'];if(_0x1ea02d[_0xf574('0x4c')][_0xf574('0x51')]){_0x1d3672[_0xf574('0x50')]=_['merge'](_0x1d3672[_0xf574('0x50')],{'$or':_[_0xf574('0x41')](_0x1d3672[_0xf574('0x4a')],function(_0x25d13c){var _0x17cd00={};_0x17cd00[_0x25d13c]={'$like':'%'+_0x1ea02d[_0xf574('0x4c')][_0xf574('0x51')]+'%'};return _0x17cd00;})});}_0x1d3672=_['merge']({},_0x1d3672,_0x1ea02d['options']);return db[_0xf574('0x9d')][_0xf574('0x30')]({'where':_0x1d3672[_0xf574('0x50')]})['then'](function(_0x1c145d){_0x5a9d4c['count']=_0x1c145d;if(_0x1ea02d[_0xf574('0x4c')][_0xf574('0x54')]){_0x1d3672[_0xf574('0x55')]=[{'model':db['CmContact'],'as':_0xf574('0xc2'),'required':![]},{'model':db[_0xf574('0xa9')],'as':'Owner','attributes':[_0xf574('0x3c'),_0xf574('0xc3'),'internal'],'required':![]},{'model':db[_0xf574('0xc4')],'as':_0xf574('0xc5'),'attributes':['id',_0xf574('0x3c'),_0xf574('0xc6')],'where':_0x1ea02d['query'][_0xf574('0xc7')]?{'id':_0x1ea02d[_0xf574('0x4c')][_0xf574('0xc7')]}:undefined,'required':_0x1ea02d[_0xf574('0x4c')]['tag']?!![]:![]}];}return db[_0xf574('0x9d')][_0xf574('0x56')](_0x1d3672);})['then'](function(_0x397007){_0x5a9d4c[_0xf574('0x57')]=_0x397007;return _0x5a9d4c;});}})['then'](respondWithFilteredResult(_0x228988,_0x1d3672))[_0xf574('0x2b')](handleError(_0x228988,null));};exports[_0xf574('0x3d')]=function(_0x839043,_0x1608f8,_0x111209){var _0xd520c5,_0x4004e0,_0x11e2f0;if(_['isNil'](_0x839043[_0xf574('0x5c')][_0xf574('0x5c')])||_0x839043[_0xf574('0x5c')][_0xf574('0x5c')]===''){throw new db[(_0xf574('0x94'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf574('0x93')](_0x839043[_0xf574('0x5c')]['to'])){throw new db[(_0xf574('0x94'))][(_0xf574('0x7a'))](_0xf574('0xc8'));}_0xd520c5=_0x839043['body']['to'];return db['SmsAccount'][_0xf574('0x5a')]({'where':{'id':_0x839043['params']['id']},'include':[{'model':db[_0xf574('0x99')],'as':_0xf574('0xc9'),'include':[{'model':db[_0xf574('0x79')],'as':'Contacts','where':{'mobile':_0xd520c5},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xf574('0x20')](handleEntityNotFound(_0x1608f8,null))[_0xf574('0x20')](function(_0x4069eb){if(_0x4069eb&&_0x4069eb['List']){_0x4004e0=_0x4069eb['get']({'plain':!![]});if(_0x4004e0[_0xf574('0xc9')]&&_0x4004e0[_0xf574('0xc9')]['Contacts']['length']){return _0x4004e0[_0xf574('0xc9')][_0xf574('0x9a')][0x0];}return db[_0xf574('0x79')][_0xf574('0x5b')](_[_0xf574('0x19')](_0x839043[_0xf574('0x5c')],{'firstName':_0xd520c5,'mobile':_0xd520c5,'phone':_0xd520c5,'ListId':_0x4004e0[_0xf574('0x7e')]}));}})[_0xf574('0x20')](handleEntityNotFound(_0x1608f8,null))['then'](function(_0x1c78cf){if(_0x1c78cf){_0x11e2f0=_0x1c78cf;return db['SmsInteraction'][_0xf574('0x5a')]({'where':{'ContactId':_0x11e2f0['id'],'closed':![],'SmsAccountId':_0x4004e0['id']}})[_0xf574('0x20')](function(_0x50d841){if(_0x50d841){return[_0x50d841,![]];}return db[_0xf574('0x9d')][_0xf574('0x5b')]({'UserId':_0x839043[_0xf574('0x5d')]['id'],'ContactId':_0x11e2f0['id'],'SmsAccountId':_0x4004e0['id'],'phone':_0xd520c5,'firstMsgDirection':_0xf574('0xca'),'Messages':[_['merge'](_0x839043[_0xf574('0x5c')],{'read':![],'body':_0x839043[_0xf574('0x5c')][_0xf574('0x5c')],'phone':_0xd520c5,'SmsAccountId':_0x4004e0['id'],'UserId':_0x839043[_0xf574('0x5d')]['id'],'ContactId':_0x11e2f0['id']})]},{'include':[{'model':db[_0xf574('0xa4')],'as':_0xf574('0xcb')}]})[_0xf574('0x20')](function(_0x217c4b){return[_0x217c4b,!![]];});});}})[_0xf574('0x9e')](function(_0x153091,_0x1f5990){if(_0x1f5990){return _0x153091;}return db[_0xf574('0xa4')]['create'](_[_0xf574('0x52')](_0x839043[_0xf574('0x5c')],{'read':![],'body':_0x839043[_0xf574('0x5c')][_0xf574('0x5c')],'phone':_0xd520c5,'SmsAccountId':_0x4004e0['id'],'SmsInteractionId':_0x153091['id'],'UserId':_0x839043[_0xf574('0x5d')]['id'],'ContactId':_0x11e2f0['id']}))['then'](function(_0x365537){_0x153091[_0xf574('0xcc')][_0xf574('0xcb')]=[];_0x153091[_0xf574('0xcc')][_0xf574('0xcb')][_0xf574('0xa1')](_0x365537[_0xf574('0xcc')]);return _0x153091;});})[_0xf574('0x20')](respondWithResult(_0x1608f8,null))['catch'](handleError(_0x1608f8,null));};exports[_0xf574('0x2d')]=function(_0x44d2ce,_0x3c50a3,_0x4fde8a){if(_0x44d2ce[_0xf574('0x5c')]['id']){delete _0x44d2ce['body']['id'];}var _0x42ce91,_0x438248,_0x26b510;return db[_0xf574('0x42')][_0xf574('0x5a')]({'where':{'id':_0x44d2ce[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x3c50a3,null))[_0xf574('0x20')](function(_0x325615){if(_0x325615){_0x26b510=_0x325615;logger[_0xf574('0x24')](_0xf574('0x25'),'status',_0xf574('0xcd'),_0x325615[_0xf574('0x53')],util['inspect'](_0x44d2ce[_0xf574('0x5c')],{'showHidden':![],'depth':null}));switch(_0x325615[_0xf574('0x53')]){case'skebby':if(_0x44d2ce[_0xf574('0x5c')][_0xf574('0xce')]&&_0x44d2ce['body'][_0xf574('0x2d')]){_0x438248=_0x44d2ce[_0xf574('0x5c')]['status'];return db['SmsMessage'][_0xf574('0x5a')]({'where':{'messageId':_0x44d2ce['body']['skebby_dispatch_id']}});}break;case _0xf574('0x87'):if(_0x44d2ce['body']['requestid']&&_0x44d2ce['body'][_0xf574('0xcf')]){_0x438248=_0x44d2ce[_0xf574('0x5c')][_0xf574('0xcf')];return db[_0xf574('0xa4')][_0xf574('0x5a')]({'where':{'messageId':_0x44d2ce[_0xf574('0x5c')][_0xf574('0xd0')]}});}break;case _0xf574('0x89'):if(_0x44d2ce[_0xf574('0x5c')]['message_id']&&_0x44d2ce['body'][_0xf574('0xd1')]){_0x438248=_0x44d2ce['body'][_0xf574('0xd1')];return db['SmsMessage'][_0xf574('0x5a')]({'where':{'messageId':_0x44d2ce['body'][_0xf574('0x8a')]}});}break;case _0xf574('0x8d'):var _0x417e4=_0x44d2ce[_0xf574('0x5c')][_0xf574('0x8e')][0x0];if(_0x417e4[_0xf574('0x83')]&&_0x417e4[_0xf574('0x2d')][_0xf574('0xd2')]===_0xf574('0xd3')){_0x438248=_0x417e4['status'][_0xf574('0xd2')];return db[_0xf574('0xa4')]['find']({'where':{'messageId':_0x417e4[_0xf574('0x83')]}});}break;case _0xf574('0x91'):if(_0x44d2ce[_0xf574('0x5c')]['messageId']&&_0x44d2ce['body'][_0xf574('0x2d')]){_0x438248=_0x44d2ce[_0xf574('0x5c')]['status'];return db[_0xf574('0xa4')][_0xf574('0x5a')]({'where':{'messageId':_0x44d2ce[_0xf574('0x5c')]['messageId']}});}break;case _0xf574('0xd4'):if(_0x44d2ce[_0xf574('0x5c')][0x0][_0xf574('0x29')]['id']){_0x438248=_0x44d2ce[_0xf574('0x5c')][0x0][_0xf574('0x53')];return db['SmsMessage']['find']({'where':{'messageId':_0x44d2ce[_0xf574('0x5c')][0x0][_0xf574('0x29')]['id']}});}break;case _0xf574('0x92'):if(_0x44d2ce['body'][_0xf574('0xd5')]&&_0x44d2ce[_0xf574('0x5c')][_0xf574('0x2d')]){_0x438248=_0x44d2ce['body'][_0xf574('0x2d')];return db['SmsMessage']['find']({'where':{'messageId':_0x44d2ce[_0xf574('0x5c')][_0xf574('0xd5')]}});}break;}}})[_0xf574('0x20')](handleEntityNotFound(_0x3c50a3,null))[_0xf574('0x20')](function(_0x3724cf){if(_0x3724cf){_0x42ce91=_0x3724cf;switch(_0x26b510[_0xf574('0x53')]){case'skebby':if(_0x438248===_0xf574('0xd3')){return _0x42ce91[_0xf574('0x37')]({'read':!![]});}else{logger[_0xf574('0x28')](_0xf574('0x25'),_0xf574('0x2d'),_0xf574('0xd6'),util['inspect'](_0x44d2ce[_0xf574('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xf574('0x87'):if(_0x438248==='1'){return _0x42ce91[_0xf574('0x37')]({'read':!![]});}else{logger[_0xf574('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf574('0x2d'),_0xf574('0xd6'),util[_0xf574('0xd7')](_0x44d2ce[_0xf574('0x5c')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x44d2ce['body'][_0xf574('0xd8')]&&_0x438248>=0xc8&&_0x438248<=0xce){return _0x42ce91[_0xf574('0x37')]({'read':!![]});}else{logger[_0xf574('0x28')](_0xf574('0x25'),_0xf574('0x2d'),_0xf574('0x89'),util[_0xf574('0xd7')](_0x44d2ce[_0xf574('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xce086b=_0x44d2ce[_0xf574('0x5c')][_0xf574('0x8e')][0x0];if(_0xce086b[_0xf574('0x2d')][_0xf574('0xd2')]==='DELIVERED'){return _0x42ce91[_0xf574('0x37')]({'read':!![]});}else{logger[_0xf574('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf574('0x2d'),'infobip',util['inspect'](_0x44d2ce[_0xf574('0x5c')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x438248==_0xf574('0xd9')||_0x438248=='RECEIVED_BY_RECIPIENT'){return _0x42ce91['update']({'read':!![]});}else{logger[_0xf574('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf574('0x2d'),_0xf574('0x91'),util[_0xf574('0xd7')](_0x44d2ce[_0xf574('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xf574('0xd4'):if(_0x438248==_0xf574('0xda')){return _0x42ce91[_0xf574('0x37')]({'read':!![]});}else{logger['error'](_0xf574('0x25'),_0xf574('0x2d'),_0xf574('0xd4'),util[_0xf574('0xd7')](_0x44d2ce[_0xf574('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xf574('0x92'):if(_0x438248===_0xf574('0xdb')||_0x438248===_0xf574('0xdc')){return _0x42ce91[_0xf574('0x37')]({'read':!![]});}else{logger[_0xf574('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf574('0x92'),util['inspect'](_0x44d2ce['body'],{'showHidden':![],'depth':null}));}break;}return _0x42ce91;}})[_0xf574('0x20')](respondWithResult(_0x3c50a3,null))[_0xf574('0x2b')](handleError(_0x3c50a3,null));};exports[_0xf574('0xdd')]=function(_0x391bf4,_0x78b33e,_0x2ab500){var _0x46267e,_0x3546fa,_0x5e61aa;return db[_0xf574('0x42')][_0xf574('0x5a')]({'where':{'id':_0x391bf4[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x78b33e,null))[_0xf574('0x20')](function(_0x17ad43){if(_0x17ad43){_0x5e61aa=_0x17ad43;logger[_0xf574('0x24')](_0xf574('0x25'),_0xf574('0x2d'),_0xf574('0xcd'),_0x17ad43[_0xf574('0x53')],util[_0xf574('0xd7')](_0x391bf4[_0xf574('0x4c')],{'showHidden':![],'depth':null}));switch(_0x17ad43[_0xf574('0x53')]){case _0xf574('0x8f'):if(_0x391bf4[_0xf574('0x4c')][_0xf574('0xde')]&&_0x391bf4[_0xf574('0x4c')][_0xf574('0xdf')]){_0x3546fa=_0x391bf4[_0xf574('0x4c')]['state'];return db['SmsMessage'][_0xf574('0x5a')]({'where':{'messageId':_0x391bf4[_0xf574('0x4c')][_0xf574('0xde')]}});}break;}}})[_0xf574('0x20')](handleEntityNotFound(_0x78b33e,null))[_0xf574('0x20')](function(_0x194b4d){if(_0x194b4d){_0x46267e=_0x194b4d;switch(_0x5e61aa[_0xf574('0x53')]){case _0xf574('0x8f'):if(_0x3546fa==='2'||_0x3546fa==='6'){return _0x46267e['update']({'read':!![]});}else{logger[_0xf574('0x28')](_0xf574('0x25'),_0xf574('0x2d'),_0xf574('0x8f'),util[_0xf574('0xd7')](_0x391bf4[_0xf574('0x4c')],{'showHidden':![],'depth':null}));};break;}return _0x46267e;}})['then'](respondWithResult(_0x78b33e,null))[_0xf574('0x2b')](handleError(_0x78b33e,null));};exports['addAgents']=function(_0x2f2c94,_0x6df0bd,_0x131a74){return db[_0xf574('0x42')][_0xf574('0x5a')]({'where':{'id':_0x2f2c94[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x6df0bd,null))[_0xf574('0x20')](function(_0x14f46c){if(_0x14f46c){return _0x14f46c[_0xf574('0xe0')](_0x2f2c94[_0xf574('0x5c')][_0xf574('0x6a')],_[_0xf574('0x9c')](_0x2f2c94[_0xf574('0x5c')],[_0xf574('0x6a'),'id'])||{})[_0xf574('0x9e')](function(_0x4f91b1){for(var _0x196edf=0x0;_0x196edf<_0x2f2c94[_0xf574('0x5c')]['ids'][_0xf574('0x4d')];_0x196edf+=0x1){socket[_0xf574('0xe1')](_0xf574('0xe2'),{'UserId':Number(_0x2f2c94[_0xf574('0x5c')][_0xf574('0x6a')][_0x196edf]),'SmsAccountId':Number(_0x2f2c94[_0xf574('0x61')]['id'])});}return _0x4f91b1;});}})[_0xf574('0x20')](respondWithResult(_0x6df0bd,null))[_0xf574('0x2b')](handleError(_0x6df0bd,null));};exports['removeAgents']=function(_0xfeb82f,_0x13893e,_0xfa18f2){return db[_0xf574('0x42')][_0xf574('0x5a')]({'where':{'id':_0xfeb82f[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x13893e,null))[_0xf574('0x20')](function(_0x5d2bc0){if(_0x5d2bc0){return _0x5d2bc0[_0xf574('0xe3')](_0xfeb82f['query'][_0xf574('0x6a')])[_0xf574('0x20')](function(){if(_[_0xf574('0xe4')](_0xfeb82f[_0xf574('0x4c')][_0xf574('0x6a')])){for(var _0x294557=0x0;_0x294557<_0xfeb82f[_0xf574('0x4c')][_0xf574('0x6a')][_0xf574('0x4d')];_0x294557+=0x1){socket[_0xf574('0xe1')](_0xf574('0xe5'),{'UserId':Number(_0xfeb82f[_0xf574('0x4c')][_0xf574('0x6a')][_0x294557]),'SmsAccountId':Number(_0xfeb82f[_0xf574('0x61')]['id'])});}}else{socket[_0xf574('0xe1')](_0xf574('0xe5'),{'UserId':Number(_0xfeb82f['query'][_0xf574('0x6a')]),'SmsAccountId':Number(_0xfeb82f[_0xf574('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x13893e,null))[_0xf574('0x2b')](handleError(_0x13893e,null));};exports[_0xf574('0xe6')]=function(_0x8bb47c,_0x26ed48,_0x177e02){var _0x5e2d4f={};var _0x42fde3={};var _0x5d6f12;var _0xe1a5d2;return db[_0xf574('0x42')][_0xf574('0x6d')]({'where':{'id':_0x8bb47c[_0xf574('0x61')]['id']}})[_0xf574('0x20')](handleEntityNotFound(_0x26ed48,null))[_0xf574('0x20')](function(_0x5a2390){if(_0x5a2390){_0x5d6f12=_0x5a2390;_0x42fde3['model']=_[_0xf574('0x47')](db[_0xf574('0xa9')][_0xf574('0x43')]);_0x42fde3[_0xf574('0x4c')]=_[_0xf574('0x47')](_0x8bb47c[_0xf574('0x4c')]);_0x42fde3[_0xf574('0x48')]=_[_0xf574('0x49')](_0x42fde3[_0xf574('0x46')],_0x42fde3[_0xf574('0x4c')]);_0x5e2d4f[_0xf574('0x4a')]=_[_0xf574('0x49')](_0x42fde3[_0xf574('0x46')],qs['fields'](_0x8bb47c[_0xf574('0x4c')][_0xf574('0x4b')]));_0x5e2d4f[_0xf574('0x4a')]=_0x5e2d4f['attributes'][_0xf574('0x4d')]?_0x5e2d4f['attributes']:_0x42fde3[_0xf574('0x46')];_0x5e2d4f[_0xf574('0x68')]=qs[_0xf574('0x4f')](_0x8bb47c[_0xf574('0x4c')][_0xf574('0x4f')]);_0x5e2d4f['where']=qs[_0xf574('0x48')](_['pick'](_0x8bb47c[_0xf574('0x4c')],_0x42fde3[_0xf574('0x48')]));if(_0x8bb47c[_0xf574('0x4c')][_0xf574('0x51')]){_0x5e2d4f[_0xf574('0x50')]=_['merge'](_0x5e2d4f[_0xf574('0x50')],{'$or':_[_0xf574('0x41')](_0x5e2d4f[_0xf574('0x4a')],function(_0x1503a5){var _0x4bb4ff={};_0x4bb4ff[_0x1503a5]={'$like':'%'+_0x8bb47c['query'][_0xf574('0x51')]+'%'};return _0x4bb4ff;})});}_0x5e2d4f=_[_0xf574('0x52')]({},_0x5e2d4f,_0x8bb47c['options']);return _0x5d6f12['getAgents'](_0x5e2d4f);}})[_0xf574('0x20')](function(_0x54399f){if(_0x54399f){_0xe1a5d2=_0x54399f['length'];if(!_0x8bb47c[_0xf574('0x4c')][_0xf574('0x4e')](_0xf574('0x67'))){_0x5e2d4f[_0xf574('0x2f')]=qs[_0xf574('0x2f')](_0x8bb47c['query'][_0xf574('0x2f')]);_0x5e2d4f[_0xf574('0x2e')]=qs['offset'](_0x8bb47c[_0xf574('0x4c')][_0xf574('0x2e')]);}return _0x5d6f12[_0xf574('0xe6')](_0x5e2d4f);}})[_0xf574('0x20')](function(_0x455d68){if(_0x455d68){return _0x455d68?{'count':_0xe1a5d2,'rows':_0x455d68}:null;}})[_0xf574('0x20')](respondWithResult(_0x26ed48,null))[_0xf574('0x2b')](handleError(_0x26ed48,null));}; \ No newline at end of file +var _0xf062=['receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','send','\x0a','addApplications','sequelize','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','stack','finally','sendStatus','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','user','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','clicksend','message_id','status_code','infobip','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','eml-format','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','SmsAccounts','UserProfileResource','destroy','name','index','Pause','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','where','filter','merge','type','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','sort','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','notify','sms','Applications','account','orderBy','priority','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','Body','messageId','skebby','text','connectel','Text','MessageUUID','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','autoclose','applications','unmanaged','*,*,*,*','SmsMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue'];(function(_0x584308,_0x1379b3){var _0x45865b=function(_0x145a82){while(--_0x145a82){_0x584308['push'](_0x584308['shift']());}};_0x45865b(++_0x1379b3);}(_0xf062,0x128));var _0x2f06=function(_0x25d88d,_0x5e10ef){_0x25d88d=_0x25d88d-0x0;var _0x3269e5=_0xf062[_0x25d88d];return _0x3269e5;};'use strict';var emlformat=require(_0x2f06('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f06('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f06('0x2'));var Mustache=require('mustache');var util=require(_0x2f06('0x3'));var path=require(_0x2f06('0x4'));var sox=require(_0x2f06('0x5'));var csv=require(_0x2f06('0x6'));var ejs=require(_0x2f06('0x7'));var fs=require('fs');var fs_extra=require(_0x2f06('0x8'));var _=require('lodash');var squel=require(_0x2f06('0x9'));var crypto=require(_0x2f06('0xa'));var jsforce=require(_0x2f06('0xb'));var deskjs=require(_0x2f06('0xc'));var toCsv=require(_0x2f06('0x6'));var querystring=require(_0x2f06('0xd'));var Papa=require(_0x2f06('0xe'));var Redis=require(_0x2f06('0xf'));var authService=require(_0x2f06('0x10'));var qs=require(_0x2f06('0x11'));var as=require(_0x2f06('0x12'));var hardwareService=require(_0x2f06('0x13'));var logger=require('../../config/logger')(_0x2f06('0x14'));var utils=require(_0x2f06('0x15'));var config=require(_0x2f06('0x16'));var licenseUtil=require(_0x2f06('0x17'));var db=require(_0x2f06('0x18'))['db'];config['redis']=_[_0x2f06('0x19')](config[_0x2f06('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f06('0x1b'))(new Redis(config[_0x2f06('0x1a')]));require(_0x2f06('0x1c'))[_0x2f06('0x1d')](socket);var jayson=require(_0x2f06('0x1e'));var client=jayson[_0x2f06('0x1f')][_0x2f06('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x104c35,_0x2eeb86,_0x2fb3c4,_0x1f2480){return new BPromise(function(_0x2097cc,_0x3b268d){var _0x527412=_0x1f2480||client;return _0x527412[_0x2f06('0x21')](_0x104c35,_0x2fb3c4)['then'](function(_0x2ea0f6){logger[_0x2f06('0x22')](_0x2f06('0x23'),_0x2eeb86,_0x2f06('0x24'));logger[_0x2f06('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2eeb86,'request\x20sent',JSON[_0x2f06('0x26')](_0x2ea0f6));if(_0x2ea0f6[_0x2f06('0x27')]){if(_0x2ea0f6[_0x2f06('0x27')][_0x2f06('0x28')]===0x1f4){logger['error'](_0x2f06('0x23'),_0x2eeb86,_0x2ea0f6[_0x2f06('0x27')][_0x2f06('0x29')]);return _0x3b268d(_0x2ea0f6[_0x2f06('0x27')]['message']);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x2eeb86,_0x2ea0f6[_0x2f06('0x27')][_0x2f06('0x29')]);return _0x2097cc(_0x2ea0f6[_0x2f06('0x27')][_0x2f06('0x29')]);}else{logger['info'](_0x2f06('0x23'),_0x2eeb86,'request\x20sent');_0x2097cc(_0x2ea0f6[_0x2f06('0x2a')]['message']);}})['catch'](function(_0xac98c6){logger[_0x2f06('0x27')](_0x2f06('0x23'),_0x2eeb86,_0xac98c6);_0x3b268d(_0xac98c6);});});}function respondWithStatusCode(_0x2a4656,_0x409757){_0x409757=_0x409757||0xcc;return function(_0x395133){if(_0x395133){return _0x2a4656['sendStatus'](_0x409757);}return _0x2a4656[_0x2f06('0x2b')](_0x409757)[_0x2f06('0x2c')]();};}function respondWithResult(_0x54850f,_0x4c041b){_0x4c041b=_0x4c041b||0xc8;return function(_0x338fdb){if(_0x338fdb){return _0x54850f[_0x2f06('0x2b')](_0x4c041b)[_0x2f06('0x2d')](_0x338fdb);}};}function respondWithFilteredResult(_0x3cd371,_0x22a1b6){return function(_0x20cda1){if(_0x20cda1){var _0x43ab77=typeof _0x22a1b6[_0x2f06('0x2e')]===_0x2f06('0x2f')&&typeof _0x22a1b6['limit']===_0x2f06('0x2f');var _0x355ead=_0x20cda1[_0x2f06('0x30')];var _0x373929=_0x43ab77?0x0:_0x22a1b6['offset'];var _0x32a74d=_0x43ab77?_0x20cda1[_0x2f06('0x30')]:_0x22a1b6[_0x2f06('0x2e')]+_0x22a1b6[_0x2f06('0x31')];var _0x5014df;if(_0x32a74d>=_0x355ead){_0x32a74d=_0x355ead;_0x5014df=0xc8;}else{_0x5014df=0xce;}_0x3cd371[_0x2f06('0x2b')](_0x5014df);return _0x3cd371[_0x2f06('0x32')](_0x2f06('0x33'),_0x373929+'-'+_0x32a74d+'/'+_0x355ead)[_0x2f06('0x2d')](_0x20cda1);}return null;};}function patchUpdates(_0x56bd80){return function(_0x536938){try{jsonpatch[_0x2f06('0x34')](_0x536938,_0x56bd80,!![]);}catch(_0x72ff8f){return BPromise[_0x2f06('0x35')](_0x72ff8f);}return _0x536938[_0x2f06('0x36')]();};}function saveUpdates(_0x3d7804,_0x53d942){return function(_0x253ef6){if(_0x253ef6){return _0x253ef6[_0x2f06('0x37')](_0x3d7804)[_0x2f06('0x38')](function(_0x5ae835){return _0x5ae835;});}return null;};}function removeEntity(_0x4fcd2b,_0x3165ba){return function(_0x199572){if(_0x199572){return _0x199572['destroy']()['then'](function(){var _0x4c39bc=_0x199572[_0x2f06('0x39')]({'plain':!![]});var _0xaec7d2=_0x2f06('0x3a');return db[_0x2f06('0x3b')][_0x2f06('0x3c')]({'where':{'type':_0xaec7d2,'resourceId':_0x4c39bc['id']}})[_0x2f06('0x38')](function(){return _0x199572;});})[_0x2f06('0x38')](function(){_0x4fcd2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5ffa,_0x2ac471){return function(_0x1f2d04){if(!_0x1f2d04){_0x2f5ffa['sendStatus'](0x194);}return _0x1f2d04;};}function handleError(_0x4ad32e,_0x1ba353){_0x1ba353=_0x1ba353||0x1f4;return function(_0x17d181){logger[_0x2f06('0x27')](_0x17d181['stack']);if(_0x17d181[_0x2f06('0x3d')]){delete _0x17d181['name'];}_0x4ad32e[_0x2f06('0x2b')](_0x1ba353)['send'](_0x17d181);};}exports[_0x2f06('0x3e')]=function(_0x70630e,_0x3ca9c2){var _0x5c48b3={'include':[{'model':db[_0x2f06('0x3f')],'as':'mandatoryDispositionPause'}]},_0x25af26={},_0x4547e5={'count':0x0,'rows':[]};var _0x35ce4f=_[_0x2f06('0x40')](db['SmsAccount'][_0x2f06('0x41')],function(_0xd879a1){return{'name':_0xd879a1['fieldName'],'type':_0xd879a1['type'][_0x2f06('0x42')]};});_0x25af26['model']=_[_0x2f06('0x40')](_0x35ce4f,_0x2f06('0x3d'));_0x25af26[_0x2f06('0x43')]=_[_0x2f06('0x44')](_0x70630e[_0x2f06('0x43')]);_0x25af26[_0x2f06('0x45')]=_[_0x2f06('0x46')](_0x25af26[_0x2f06('0x47')],_0x25af26[_0x2f06('0x43')]);_0x5c48b3['attributes']=_[_0x2f06('0x46')](_0x25af26['model'],qs[_0x2f06('0x48')](_0x70630e[_0x2f06('0x43')][_0x2f06('0x48')]));_0x5c48b3[_0x2f06('0x49')]=_0x5c48b3[_0x2f06('0x49')][_0x2f06('0x4a')]?_0x5c48b3[_0x2f06('0x49')]:_0x25af26[_0x2f06('0x47')];if(!_0x70630e[_0x2f06('0x43')]['hasOwnProperty'](_0x2f06('0x4b'))){_0x5c48b3['limit']=qs[_0x2f06('0x31')](_0x70630e['query'][_0x2f06('0x31')]);_0x5c48b3[_0x2f06('0x2e')]=qs[_0x2f06('0x2e')](_0x70630e[_0x2f06('0x43')][_0x2f06('0x2e')]);}_0x5c48b3[_0x2f06('0x4c')]=qs['sort'](_0x70630e[_0x2f06('0x43')]['sort']);_0x5c48b3[_0x2f06('0x4d')]=qs[_0x2f06('0x45')](_['pick'](_0x70630e[_0x2f06('0x43')],_0x25af26[_0x2f06('0x45')]),_0x35ce4f);if(_0x70630e[_0x2f06('0x43')][_0x2f06('0x4e')]){_0x5c48b3[_0x2f06('0x4d')]=_[_0x2f06('0x4f')](_0x5c48b3[_0x2f06('0x4d')],{'$or':_[_0x2f06('0x40')](_0x35ce4f,function(_0x2c11f4){if(_0x2c11f4[_0x2f06('0x50')]!==_0x2f06('0x51')){var _0x2bd21={};_0x2bd21[_0x2c11f4[_0x2f06('0x3d')]]={'$like':'%'+_0x70630e[_0x2f06('0x43')]['filter']+'%'};return _0x2bd21;}})});}_0x5c48b3=_[_0x2f06('0x4f')]({},_0x5c48b3,_0x70630e[_0x2f06('0x52')]);var _0x97bf63={'where':_0x5c48b3[_0x2f06('0x4d')]};return db[_0x2f06('0x53')]['count'](_0x97bf63)['then'](function(_0x1848da){_0x4547e5['count']=_0x1848da;if(_0x70630e[_0x2f06('0x43')][_0x2f06('0x54')]){_0x5c48b3[_0x2f06('0x55')]=[{'all':!![]}];}return db[_0x2f06('0x53')][_0x2f06('0x56')](_0x5c48b3);})[_0x2f06('0x38')](function(_0x5026d3){_0x4547e5[_0x2f06('0x57')]=_0x5026d3;return _0x4547e5;})[_0x2f06('0x38')](respondWithFilteredResult(_0x3ca9c2,_0x5c48b3))[_0x2f06('0x58')](handleError(_0x3ca9c2,null));};exports[_0x2f06('0x59')]=function(_0x3eaabc,_0x45a718){var _0x41682c={'raw':![],'where':{'id':_0x3eaabc['params']['id']},'include':[{'model':db[_0x2f06('0x3f')],'as':'mandatoryDispositionPause'}]},_0x268c2={};_0x268c2[_0x2f06('0x47')]=_['keys'](db['SmsAccount'][_0x2f06('0x41')]);_0x268c2['query']=_[_0x2f06('0x44')](_0x3eaabc['query']);_0x268c2['filters']=_['intersection'](_0x268c2['model'],_0x268c2[_0x2f06('0x43')]);_0x41682c[_0x2f06('0x49')]=_[_0x2f06('0x46')](_0x268c2[_0x2f06('0x47')],qs['fields'](_0x3eaabc[_0x2f06('0x43')][_0x2f06('0x48')]));_0x41682c[_0x2f06('0x49')]=_0x41682c['attributes'][_0x2f06('0x4a')]?_0x41682c[_0x2f06('0x49')]:_0x268c2[_0x2f06('0x47')];if(_0x3eaabc[_0x2f06('0x43')]['includeAll']){_0x41682c[_0x2f06('0x55')]=[{'all':!![]}];}_0x41682c=_[_0x2f06('0x4f')]({},_0x41682c,_0x3eaabc[_0x2f06('0x52')]);return db[_0x2f06('0x53')][_0x2f06('0x5a')](_0x41682c)[_0x2f06('0x38')](handleEntityNotFound(_0x45a718,null))['then'](respondWithResult(_0x45a718,null))['catch'](handleError(_0x45a718,null));};exports['create']=function(_0xa4dcd8,_0x116fb6){return db['SmsAccount'][_0x2f06('0x5b')](_0xa4dcd8[_0x2f06('0x5c')],{})[_0x2f06('0x38')](function(_0x2c87cb){var _0x345f48=_0xa4dcd8['user'][_0x2f06('0x39')]({'plain':!![]});if(!_0x345f48)throw new Error(_0x2f06('0x5d'));if(_0x345f48[_0x2f06('0x5e')]==='user'){var _0x2d383d=_0x2c87cb[_0x2f06('0x39')]({'plain':!![]});var _0x39732c='SmsAccounts';return db[_0x2f06('0x5f')]['find']({'where':{'name':_0x39732c,'userProfileId':_0x345f48[_0x2f06('0x60')]},'raw':!![]})[_0x2f06('0x38')](function(_0x534569){if(_0x534569&&_0x534569[_0x2f06('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d383d[_0x2f06('0x3d')],'resourceId':_0x2d383d['id'],'type':_0x534569[_0x2f06('0x3d')],'sectionId':_0x534569['id']},{})[_0x2f06('0x38')](function(){return _0x2c87cb;});}else{return _0x2c87cb;}})[_0x2f06('0x58')](function(_0x1cca12){logger[_0x2f06('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cca12);throw _0x1cca12;});}return _0x2c87cb;})[_0x2f06('0x38')](respondWithResult(_0x116fb6,0xc9))[_0x2f06('0x58')](handleError(_0x116fb6,null));};exports['update']=function(_0x2c1d23,_0x4ba4fd){if(_0x2c1d23['body']['id']){delete _0x2c1d23[_0x2f06('0x5c')]['id'];}return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0x2c1d23[_0x2f06('0x62')]['id']},'include':[{'model':db[_0x2f06('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x2f06('0x38')](handleEntityNotFound(_0x4ba4fd,null))[_0x2f06('0x38')](saveUpdates(_0x2c1d23['body'],null))[_0x2f06('0x38')](respondWithResult(_0x4ba4fd,null))[_0x2f06('0x58')](handleError(_0x4ba4fd,null));};exports[_0x2f06('0x3c')]=function(_0x5e04d0,_0x4faab6){return db['SmsAccount'][_0x2f06('0x5a')]({'where':{'id':_0x5e04d0['params']['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x4faab6,null))[_0x2f06('0x38')](removeEntity(_0x4faab6,null))[_0x2f06('0x58')](handleError(_0x4faab6,null));};exports['describe']=function(_0x135f41,_0x4e718f){return db['SmsAccount'][_0x2f06('0x63')]()[_0x2f06('0x38')](respondWithResult(_0x4e718f,null))[_0x2f06('0x58')](handleError(_0x4e718f,null));};exports[_0x2f06('0x64')]=function(_0x10f016,_0xb9f876,_0x4b4a62){if(_0x10f016[_0x2f06('0x5c')]['id']){delete _0x10f016[_0x2f06('0x5c')]['id'];}return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0x10f016['params']['id']}})['then'](handleEntityNotFound(_0xb9f876,null))[_0x2f06('0x38')](function(_0x31079f){if(_0x31079f){_0x10f016[_0x2f06('0x5c')][_0x2f06('0x65')]=_0x31079f['id'];return db[_0x2f06('0x66')][_0x2f06('0x5b')](_0x10f016[_0x2f06('0x5c')]);}})['then'](respondWithResult(_0xb9f876,null))['catch'](handleError(_0xb9f876,null));};exports[_0x2f06('0x67')]=function(_0x29f7e8,_0x1175a2,_0x4661d4){var _0x106a17={'raw':![],'where':{}};var _0x1707b1={};var _0x28538e={'count':0x0,'rows':[]};return db[_0x2f06('0x53')][_0x2f06('0x68')]({'where':{'id':_0x29f7e8[_0x2f06('0x62')]['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x1175a2,null))[_0x2f06('0x38')](function(_0x5ab9b9){if(_0x5ab9b9){_0x1707b1['model']=_[_0x2f06('0x44')](db[_0x2f06('0x66')][_0x2f06('0x41')]);_0x1707b1[_0x2f06('0x43')]=_[_0x2f06('0x44')](_0x29f7e8['query']);_0x1707b1[_0x2f06('0x45')]=_[_0x2f06('0x46')](_0x1707b1[_0x2f06('0x47')],_0x1707b1[_0x2f06('0x43')]);_0x106a17[_0x2f06('0x49')]=_[_0x2f06('0x46')](_0x1707b1[_0x2f06('0x47')],qs[_0x2f06('0x48')](_0x29f7e8['query']['fields']));_0x106a17[_0x2f06('0x49')]=_0x106a17[_0x2f06('0x49')]['length']?_0x106a17[_0x2f06('0x49')]:_0x1707b1[_0x2f06('0x47')];if(!_0x29f7e8[_0x2f06('0x43')][_0x2f06('0x69')](_0x2f06('0x4b'))){_0x106a17[_0x2f06('0x31')]=qs[_0x2f06('0x31')](_0x29f7e8[_0x2f06('0x43')][_0x2f06('0x31')]);_0x106a17[_0x2f06('0x2e')]=qs['offset'](_0x29f7e8[_0x2f06('0x43')]['offset']);}_0x106a17[_0x2f06('0x4c')]=qs[_0x2f06('0x6a')](_0x29f7e8[_0x2f06('0x43')]['sort']);_0x106a17[_0x2f06('0x4d')]=qs[_0x2f06('0x45')](_[_0x2f06('0x6b')](_0x29f7e8[_0x2f06('0x43')],_0x1707b1[_0x2f06('0x45')]));_0x106a17[_0x2f06('0x4d')]['SmsAccountId']=_0x5ab9b9['id'];if(_0x29f7e8[_0x2f06('0x43')][_0x2f06('0x4e')]){_0x106a17[_0x2f06('0x4d')]=_[_0x2f06('0x4f')](_0x106a17['where'],{'$or':_[_0x2f06('0x40')](_0x106a17['attributes'],function(_0x4739fe){var _0x349a55={};_0x349a55[_0x4739fe]={'$like':'%'+_0x29f7e8[_0x2f06('0x43')][_0x2f06('0x4e')]+'%'};return _0x349a55;})});}_0x106a17=_['merge']({},_0x106a17,_0x29f7e8[_0x2f06('0x52')]);return db[_0x2f06('0x66')][_0x2f06('0x30')]({'where':_0x106a17[_0x2f06('0x4d')]})['then'](function(_0xc58df){_0x28538e['count']=_0xc58df;if(_0x29f7e8['query'][_0x2f06('0x54')]){_0x106a17[_0x2f06('0x55')]=[{'all':!![]}];}return db[_0x2f06('0x66')]['findAll'](_0x106a17);})[_0x2f06('0x38')](function(_0x56744b){_0x28538e[_0x2f06('0x57')]=_0x56744b;return _0x28538e;});}})[_0x2f06('0x38')](respondWithFilteredResult(_0x1175a2,_0x106a17))['catch'](handleError(_0x1175a2,null));};exports[_0x2f06('0x6c')]=function(_0x2ab755,_0x337c08,_0x1fec34){return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0x2ab755[_0x2f06('0x62')]['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x337c08,null))[_0x2f06('0x38')](function(_0x5558e6){if(_0x5558e6){return _0x5558e6[_0x2f06('0x6c')](_0x2ab755[_0x2f06('0x43')]['ids']);}})[_0x2f06('0x38')](respondWithStatusCode(_0x337c08,null))[_0x2f06('0x58')](handleError(_0x337c08,null));};exports[_0x2f06('0x6d')]=function(_0x1827a4,_0x3f54c8,_0x391535){if(_0x1827a4[_0x2f06('0x5c')]['id']){delete _0x1827a4[_0x2f06('0x5c')]['id'];}return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0x1827a4[_0x2f06('0x62')]['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x3f54c8,null))[_0x2f06('0x38')](function(_0x32075b){if(_0x32075b){_0x1827a4[_0x2f06('0x5c')]['SmsAccountId']=_0x32075b['id'];return db[_0x2f06('0x6e')]['create'](_0x1827a4['body']);}})[_0x2f06('0x38')](respondWithResult(_0x3f54c8,null))['catch'](handleError(_0x3f54c8,null));};exports[_0x2f06('0x6f')]=function(_0x362fd6,_0x13de41,_0x38f37f){var _0x3a5e6c={'raw':![],'where':{}};var _0x5c38ea={};var _0x21b7b9={'count':0x0,'rows':[]};return db[_0x2f06('0x53')]['findOne']({'where':{'id':_0x362fd6['params']['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x13de41,null))[_0x2f06('0x38')](function(_0x296dd1){if(_0x296dd1){_0x5c38ea[_0x2f06('0x47')]=_[_0x2f06('0x44')](db[_0x2f06('0x6e')][_0x2f06('0x41')]);_0x5c38ea[_0x2f06('0x43')]=_['keys'](_0x362fd6['query']);_0x5c38ea[_0x2f06('0x45')]=_[_0x2f06('0x46')](_0x5c38ea[_0x2f06('0x47')],_0x5c38ea['query']);_0x3a5e6c[_0x2f06('0x49')]=_[_0x2f06('0x46')](_0x5c38ea[_0x2f06('0x47')],qs[_0x2f06('0x48')](_0x362fd6[_0x2f06('0x43')][_0x2f06('0x48')]));_0x3a5e6c['attributes']=_0x3a5e6c[_0x2f06('0x49')][_0x2f06('0x4a')]?_0x3a5e6c[_0x2f06('0x49')]:_0x5c38ea[_0x2f06('0x47')];if(!_0x362fd6[_0x2f06('0x43')]['hasOwnProperty'](_0x2f06('0x4b'))){_0x3a5e6c[_0x2f06('0x31')]=qs['limit'](_0x362fd6[_0x2f06('0x43')][_0x2f06('0x31')]);_0x3a5e6c[_0x2f06('0x2e')]=qs[_0x2f06('0x2e')](_0x362fd6[_0x2f06('0x43')]['offset']);}_0x3a5e6c[_0x2f06('0x4c')]=qs['sort'](_0x362fd6['query'][_0x2f06('0x6a')]);_0x3a5e6c[_0x2f06('0x4d')]=qs[_0x2f06('0x45')](_[_0x2f06('0x6b')](_0x362fd6[_0x2f06('0x43')],_0x5c38ea[_0x2f06('0x45')]));_0x3a5e6c['where'][_0x2f06('0x65')]=_0x296dd1['id'];if(_0x362fd6['query'][_0x2f06('0x4e')]){_0x3a5e6c[_0x2f06('0x4d')]=_[_0x2f06('0x4f')](_0x3a5e6c['where'],{'$or':_['map'](_0x3a5e6c['attributes'],function(_0x4428f1){var _0x11e027={};_0x11e027[_0x4428f1]={'$like':'%'+_0x362fd6['query'][_0x2f06('0x4e')]+'%'};return _0x11e027;})});}_0x3a5e6c=_[_0x2f06('0x4f')]({},_0x3a5e6c,_0x362fd6[_0x2f06('0x52')]);return db['CannedAnswer']['count']({'where':_0x3a5e6c[_0x2f06('0x4d')]})[_0x2f06('0x38')](function(_0x3faa74){_0x21b7b9['count']=_0x3faa74;if(_0x362fd6[_0x2f06('0x43')]['includeAll']){_0x3a5e6c[_0x2f06('0x55')]=[{'all':!![]}];}return db[_0x2f06('0x6e')][_0x2f06('0x56')](_0x3a5e6c);})[_0x2f06('0x38')](function(_0x28969f){_0x21b7b9[_0x2f06('0x57')]=_0x28969f;return _0x21b7b9;});}})[_0x2f06('0x38')](respondWithFilteredResult(_0x13de41,_0x3a5e6c))[_0x2f06('0x58')](handleError(_0x13de41,null));};exports['removeAnswers']=function(_0xa997e1,_0x2d9bf4,_0x2c7fd9){return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0xa997e1[_0x2f06('0x62')]['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x2d9bf4,null))['then'](function(_0x5e66d5){if(_0x5e66d5){return _0x5e66d5['removeAnswers'](_0xa997e1[_0x2f06('0x43')][_0x2f06('0x70')]);}})[_0x2f06('0x38')](respondWithStatusCode(_0x2d9bf4,null))[_0x2f06('0x58')](handleError(_0x2d9bf4,null));};exports[_0x2f06('0x71')]=function(_0x890a00,_0x5271fb,_0x11a458){var _0x5c9bea={'channel':_0x2f06('0x72')};var _0x40481d=[];var _0x35a710=[];var _0x1129b3={};return db['SmsAccount'][_0x2f06('0x5a')]({'where':{'id':_0x890a00['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x2f06('0x73')}]})[_0x2f06('0x38')](handleEntityNotFound(_0x5271fb,null))[_0x2f06('0x38')](function(_0x102244){_0x5c9bea[_0x2f06('0x74')]=_0x102244;_0x5c9bea['applications']=_[_0x2f06('0x75')](_0x102244[_0x2f06('0x73')],[_0x2f06('0x76')],['asc']);if(_0x5c9bea[_0x2f06('0x74')]['Applications']){delete _0x5c9bea[_0x2f06('0x74')][_0x2f06('0x73')];}return db[_0x2f06('0x77')][_0x2f06('0x63')]();})[_0x2f06('0x38')](function(_0x24382c){if(!_0x24382c){throw new db[(_0x2f06('0x78'))]['ValidationError'](_0x2f06('0x79'));}_0x40481d=_[_0x2f06('0x7a')](_['keys'](_0x24382c),[_0x2f06('0x7b'),_0x2f06('0x7c')]);_0x35a710=_[_0x2f06('0x7a')](_[_0x2f06('0x44')](_0x24382c),[_0x2f06('0x7b'),_0x2f06('0x7c'),'CompanyId',_0x2f06('0x7d')]);_0x5c9bea[_0x2f06('0x5c')]={'mapKey':_0x2f06('0x7e')};if(_0x5c9bea['account'][_0x2f06('0x50')]){switch(_0x5c9bea['account'][_0x2f06('0x50')]){case'twilio':_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x80')];_0x5c9bea[_0x2f06('0x5c')]['body']=_0x890a00['body'][_0x2f06('0x81')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x82')]=_0x890a00['body']['MessageSid'];break;case _0x2f06('0x83'):_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')]='+'+_0x890a00['body']['sender'];_0x5c9bea['body'][_0x2f06('0x5c')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x84')];break;case _0x2f06('0x85'):_0x5c9bea[_0x2f06('0x5c')]['from']=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x7f')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x29')];break;case'clicksend':_0x5c9bea['body'][_0x2f06('0x7f')]=_0x890a00[_0x2f06('0x5c')]['from'];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x5c')];_0x5c9bea['body'][_0x2f06('0x82')]=_0x890a00[_0x2f06('0x5c')]['message_id'];break;case'plivo':_0x5c9bea[_0x2f06('0x5c')]['from']=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x80')];_0x5c9bea[_0x2f06('0x5c')]['body']=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x86')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x82')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x87')];break;case'infobip':_0x5c9bea['body'][_0x2f06('0x7f')]='+'+_0x890a00[_0x2f06('0x5c')][_0x2f06('0x88')][0x0]['from'];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')]=_0x890a00['body'][_0x2f06('0x88')][0x0][_0x2f06('0x84')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x82')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x88')][0x0][_0x2f06('0x82')];break;case _0x2f06('0x89'):_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')]=_0x890a00['body'][_0x2f06('0x8a')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')]=_0x890a00[_0x2f06('0x5c')]['segmentedMessage'][_0x2f06('0x29')];break;case _0x2f06('0x8b'):_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x8c')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')]=_0x890a00['body'][_0x2f06('0x84')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x82')]=_0x890a00['body'][_0x2f06('0x8d')];break;case _0x2f06('0x8e'):_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x82')]=_0x890a00['body'][0x0][_0x2f06('0x29')]['id'];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')]=_0x890a00[_0x2f06('0x5c')][0x0]['message'][_0x2f06('0x7f')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')]=_0x890a00[_0x2f06('0x5c')][0x0][_0x2f06('0x29')][_0x2f06('0x84')];break;case _0x2f06('0x8f'):_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x7f')];_0x5c9bea[_0x2f06('0x5c')]['body']=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x29')];_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x82')]=_0x890a00[_0x2f06('0x5c')][_0x2f06('0x90')];break;}}if(_0x5c9bea['body']['id']){delete _0x5c9bea[_0x2f06('0x5c')]['id'];}if(_[_0x2f06('0x91')](_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')])){throw new db[(_0x2f06('0x78'))]['ValidationError'](_0x2f06('0x92'));}if(_[_0x2f06('0x91')](_0x5c9bea[_0x2f06('0x5c')]['body'])||_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')]===''){throw new db[(_0x2f06('0x78'))][(_0x2f06('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2f06('0x91')](_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x94')])){throw new db[(_0x2f06('0x78'))]['ValidationError'](_0x2f06('0x95')+_0x35a710);}if(!_[_0x2f06('0x96')](_0x35a710,_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x94')])){throw new db['Sequelize']['ValidationError'](_0x2f06('0x97')+_0x35a710);}_0x1129b3[_0x5c9bea[_0x2f06('0x5c')]['mapKey']]=_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')];return db['CmList'][_0x2f06('0x5a')]({'where':{'id':_0x5c9bea[_0x2f06('0x74')]['ListId']},'include':[{'model':db[_0x2f06('0x77')],'as':_0x2f06('0x98'),'where':_0x1129b3,'limit':0x1,'order':[[_0x2f06('0x7c'),_0x2f06('0x99')]]}]});})[_0x2f06('0x38')](handleEntityNotFound(_0x5271fb,null))['then'](function(_0x57c064){if(_0x57c064){_0x5c9bea[_0x2f06('0x9a')]=_['omit'](_0x57c064,[_0x2f06('0x98')]);if(_0x57c064[_0x2f06('0x98')][_0x2f06('0x4a')]){return _0x57c064['Contacts'][0x0];}var _0x31e1c7=_[_0x2f06('0x19')](_0x5c9bea['body'],{'firstName':_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')],'ListId':_0x57c064['id']});_0x31e1c7[_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x94')]]=_0x5c9bea[_0x2f06('0x5c')]['from'];return db['CmContact'][_0x2f06('0x5b')](_0x31e1c7,{'fields':_0x40481d,'raw':!![]});}})[_0x2f06('0x38')](handleEntityNotFound(_0x5271fb,null))[_0x2f06('0x38')](function(_0x394ee6){if(_0x394ee6){_0x5c9bea[_0x2f06('0x9b')]=_0x394ee6;var _0x3c9abd={'ContactId':_0x394ee6['id'],'phone':_0x5c9bea[_0x2f06('0x5c')]['from'],'SmsAccountId':_0x890a00['params']['id']};var _0x3f690b={'ContactId':_0x394ee6['id'],'SmsAccountId':_0x890a00['params']['id'],'closed':![]};return db[_0x2f06('0x9c')][_0x2f06('0x5a')]({'where':_0x3f690b})[_0x2f06('0x38')](function(_0x5f4dbd){if(_0x5f4dbd){return[_0x5f4dbd,![]];}return db[_0x2f06('0x9c')]['create'](_0x3c9abd)['then'](function(_0x57ffae){return[_0x57ffae,!![]];});});}})[_0x2f06('0x9d')](function(_0x3e9068,_0x3da480){_0x5c9bea[_0x2f06('0x9e')]=_0x3e9068[_0x2f06('0x39')]({'plain':!![]});_0x5c9bea['interaction'][_0x2f06('0x9f')]=![];if(_0x3da480){if(_0x5c9bea[_0x2f06('0x74')][_0x2f06('0xa0')]){_0x5c9bea['applications']['push']({'id':0x0,'priority':_0x5c9bea[_0x2f06('0xa1')]['length']+0x1,'app':'close','appdata':_0x2f06('0xa2'),'interval':_0x2f06('0xa3')});}_0x5c9bea[_0x2f06('0x9e')][_0x2f06('0x9f')]=!![];}return db[_0x2f06('0xa4')]['create']({'phone':_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x7f')],'messageId':_0x5c9bea['body']['messageId'],'body':_0x5c9bea[_0x2f06('0x5c')][_0x2f06('0x5c')],'SmsAccountId':_0x890a00['params']['id'],'SmsInteractionId':_0x3e9068['id'],'direction':'in','ContactId':_0x3e9068['ContactId'],'AttachmentId':_0x5c9bea['body']['AttachmentId']});})[_0x2f06('0x38')](function(_0x125e21){_0x5c9bea[_0x2f06('0x29')]=_0x125e21;if(!_0x5c9bea[_0x2f06('0x9e')][_0x2f06('0xa5')])return;return db[_0x2f06('0xa6')][_0x2f06('0x5a')]({'attributes':['id',_0x2f06('0x3d')],'where':{'id':_0x5c9bea[_0x2f06('0x9e')][_0x2f06('0xa5')]}});})['then'](function(_0x1bc418){if(_0x1bc418){_0x5c9bea[_0x2f06('0xa1')][_0x2f06('0xa7')]({'id':0x0,'priority':0x0,'app':_0x2f06('0xa8'),'appdata':_0x1bc418[_0x2f06('0x3d')]+','+(_0x5c9bea[_0x2f06('0x74')][_0x2f06('0xa9')]||0xa),'interval':_0x2f06('0xa3')});}if(!_0x5c9bea[_0x2f06('0x9e')][_0x2f06('0xaa')])return;return db[_0x2f06('0xab')][_0x2f06('0x5a')]({'attributes':['id',_0x2f06('0x3d')],'where':{'id':_0x5c9bea['interaction'][_0x2f06('0xaa')]}});})['then'](function(_0x3a69ad){if(_0x3a69ad){_0x5c9bea[_0x2f06('0xa1')][_0x2f06('0xa7')]({'id':0x0,'priority':0x1,'app':_0x2f06('0xac'),'appdata':_0x3a69ad[_0x2f06('0x3d')]+','+(_0x5c9bea[_0x2f06('0x74')][_0x2f06('0xad')]||0x12c),'interval':_0x2f06('0xa3')});}return respondWithRpcPromise('Start','startRouting',_0x5c9bea);})['then'](function(_0x50a42f){if(_0x50a42f){var _0x20f605=0xc8;var _0x110742=_0x2f06('0xae');logger[_0x2f06('0x22')](_0x2f06('0xaf'),_0x110742,_0x20f605,_0x2f06('0xb0'));logger['debug'](_0x2f06('0xb1'),_0x110742,_0x20f605,'entity\x20found',JSON[_0x2f06('0x26')](_0x50a42f));if(_0x5c9bea[_0x2f06('0x74')][_0x2f06('0x50')]===_0x2f06('0xb2')){return _0x5271fb[_0x2f06('0x2b')](_0x20f605)[_0x2f06('0x32')](_0x2f06('0xb3'),_0x2f06('0xb4'))[_0x2f06('0xb5')](_0x2f06('0xb6'));}else{return _0x5271fb[_0x2f06('0x2b')](_0x20f605)['json'](_0x50a42f);}}})[_0x2f06('0x58')](handleError(_0x5271fb,null));};exports[_0x2f06('0xb7')]=function(_0x1cfb93,_0x2ca6e7){var _0x4de8b0=_0x1cfb93['params']['id'];var _0x596dcf=_0x1cfb93['body'];var _0x3e70ef=0xc8;var _0x426002=null;return db[_0x2f06('0xb8')]['transaction']({'isolationLevel':db[_0x2f06('0xb8')][_0x2f06('0xb9')]['ISOLATION_LEVELS'][_0x2f06('0xba')]},function(_0x1f18f6){return db['SmsAccount']['findOne']({'where':{'id':_0x4de8b0},'transaction':_0x1f18f6})[_0x2f06('0x38')](function(_0x5d0588){if(_0x5d0588){return db[_0x2f06('0xbb')][_0x2f06('0x3c')]({'where':{'SmsAccountId':_0x4de8b0},'transaction':_0x1f18f6})[_0x2f06('0x38')](function(){var _0x3bd7e0=_[_0x2f06('0x40')](_0x596dcf,function(_0x38ca80){_0x38ca80[_0x2f06('0x65')]=_0x4de8b0;return _0x38ca80;});return db[_0x2f06('0xbb')][_0x2f06('0xbc')](_0x3bd7e0,{'transaction':_0x1f18f6});});}else{_0x3e70ef=0x194;_0x426002=[];}});})['then'](function(){if(_0x3e70ef!==0x194){return db[_0x2f06('0xbb')][_0x2f06('0xbd')]({'where':{'SmsAccountId':_0x4de8b0},'order':'priority'})[_0x2f06('0x38')](function(_0x14442b){_0x426002=_0x14442b;});}})[_0x2f06('0x58')](function(_0x3392b7){_0x3e70ef=0x1f4;logger[_0x2f06('0x27')](_0x3392b7[_0x2f06('0xbe')]);if(_0x3392b7[_0x2f06('0x3d')]){delete _0x3392b7[_0x2f06('0x3d')];}_0x426002=_0x3392b7;})[_0x2f06('0xbf')](function(){if(_0x426002===null){_0x2ca6e7[_0x2f06('0xc0')](_0x3e70ef);}else{if(_0x3e70ef===0x1f4){_0x2ca6e7[_0x2f06('0x2b')](_0x3e70ef)[_0x2f06('0xb5')](_0x426002);}else{_0x2ca6e7[_0x2f06('0x2b')](_0x3e70ef)[_0x2f06('0x2d')](_0x426002);}}});};exports[_0x2f06('0xc1')]=function(_0x3935fb,_0xe79f44,_0x386a00){var _0x29ffe4={};var _0x4a1a31={};var _0x405733;var _0x5f3ae7;return db[_0x2f06('0x53')]['findOne']({'where':{'id':_0x3935fb[_0x2f06('0x62')]['id']}})['then'](handleEntityNotFound(_0xe79f44,null))[_0x2f06('0x38')](function(_0x5daa31){if(_0x5daa31){_0x405733=_0x5daa31;_0x4a1a31[_0x2f06('0x47')]=_[_0x2f06('0x44')](db['SmsApplication']['rawAttributes']);_0x4a1a31['query']=_[_0x2f06('0x44')](_0x3935fb[_0x2f06('0x43')]);_0x4a1a31['filters']=_[_0x2f06('0x46')](_0x4a1a31[_0x2f06('0x47')],_0x4a1a31['query']);_0x29ffe4['attributes']=_[_0x2f06('0x46')](_0x4a1a31[_0x2f06('0x47')],qs[_0x2f06('0x48')](_0x3935fb['query'][_0x2f06('0x48')]));_0x29ffe4['attributes']=_0x29ffe4['attributes'][_0x2f06('0x4a')]?_0x29ffe4[_0x2f06('0x49')]:_0x4a1a31[_0x2f06('0x47')];_0x29ffe4[_0x2f06('0x4c')]=qs[_0x2f06('0x6a')](_0x3935fb[_0x2f06('0x43')][_0x2f06('0x6a')]);_0x29ffe4[_0x2f06('0x4d')]=qs[_0x2f06('0x45')](_[_0x2f06('0x6b')](_0x3935fb['query'],_0x4a1a31['filters']));if(_0x3935fb[_0x2f06('0x43')][_0x2f06('0x4e')]){_0x29ffe4['where']=_[_0x2f06('0x4f')](_0x29ffe4['where'],{'$or':_[_0x2f06('0x40')](_0x29ffe4['attributes'],function(_0x7637fc){var _0x740280={};_0x740280[_0x7637fc]={'$like':'%'+_0x3935fb['query'][_0x2f06('0x4e')]+'%'};return _0x740280;})});}_0x29ffe4=_[_0x2f06('0x4f')]({},_0x29ffe4,_0x3935fb[_0x2f06('0x52')]);return _0x405733[_0x2f06('0xc1')](_0x29ffe4);}})[_0x2f06('0x38')](function(_0x539eb9){if(_0x539eb9){_0x5f3ae7=_0x539eb9[_0x2f06('0x4a')];if(!_0x3935fb[_0x2f06('0x43')][_0x2f06('0x69')](_0x2f06('0x4b'))){_0x29ffe4['limit']=qs[_0x2f06('0x31')](_0x3935fb[_0x2f06('0x43')][_0x2f06('0x31')]);_0x29ffe4[_0x2f06('0x2e')]=qs[_0x2f06('0x2e')](_0x3935fb[_0x2f06('0x43')][_0x2f06('0x2e')]);}return _0x405733[_0x2f06('0xc1')](_0x29ffe4);}})[_0x2f06('0x38')](function(_0x16c4c2){if(_0x16c4c2){return _0x16c4c2?{'count':_0x5f3ae7,'rows':_0x16c4c2}:null;}})[_0x2f06('0x38')](respondWithResult(_0xe79f44,null))[_0x2f06('0x58')](handleError(_0xe79f44,null));};exports[_0x2f06('0xc2')]=function(_0x54b88c,_0x372073,_0x2f7331){var _0x54ba53={'raw':![],'where':{}};var _0x3c7bf9={};var _0x374d55={'count':0x0,'rows':[]};return db[_0x2f06('0x53')][_0x2f06('0x68')]({'where':{'id':_0x54b88c['params']['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x372073,null))[_0x2f06('0x38')](function(_0x3fd8c1){if(_0x3fd8c1){_0x3c7bf9['model']=_['keys'](db[_0x2f06('0x9c')][_0x2f06('0x41')]);_0x3c7bf9[_0x2f06('0x43')]=_[_0x2f06('0x44')](_0x54b88c['query']);_0x3c7bf9[_0x2f06('0x45')]=_[_0x2f06('0x46')](_0x3c7bf9[_0x2f06('0x47')],_0x3c7bf9[_0x2f06('0x43')]);_0x54ba53[_0x2f06('0x49')]=_['intersection'](_0x3c7bf9[_0x2f06('0x47')],qs[_0x2f06('0x48')](_0x54b88c[_0x2f06('0x43')][_0x2f06('0x48')]));_0x54ba53['attributes']=_0x54ba53[_0x2f06('0x49')][_0x2f06('0x4a')]?_0x54ba53['attributes']:_0x3c7bf9['model'];if(!_0x54b88c[_0x2f06('0x43')][_0x2f06('0x69')]('nolimit')){_0x54ba53[_0x2f06('0x31')]=qs[_0x2f06('0x31')](_0x54b88c[_0x2f06('0x43')][_0x2f06('0x31')]);_0x54ba53[_0x2f06('0x2e')]=qs[_0x2f06('0x2e')](_0x54b88c[_0x2f06('0x43')]['offset']);}_0x54ba53[_0x2f06('0x4c')]=qs[_0x2f06('0x6a')](_0x54b88c[_0x2f06('0x43')][_0x2f06('0x6a')]);_0x54ba53[_0x2f06('0x4d')]=qs[_0x2f06('0x45')](_[_0x2f06('0x6b')](_0x54b88c['query'],_0x3c7bf9[_0x2f06('0x45')]));_0x54ba53[_0x2f06('0x4d')][_0x2f06('0x65')]=_0x3fd8c1['id'];if(_0x54b88c[_0x2f06('0x43')][_0x2f06('0x4e')]){_0x54ba53[_0x2f06('0x4d')]=_['merge'](_0x54ba53[_0x2f06('0x4d')],{'$or':_[_0x2f06('0x40')](_0x54ba53[_0x2f06('0x49')],function(_0x53953c){var _0x3a19c1={};_0x3a19c1[_0x53953c]={'$like':'%'+_0x54b88c[_0x2f06('0x43')][_0x2f06('0x4e')]+'%'};return _0x3a19c1;})});}_0x54ba53=_['merge']({},_0x54ba53,_0x54b88c[_0x2f06('0x52')]);return db[_0x2f06('0x9c')]['count']({'where':_0x54ba53[_0x2f06('0x4d')]})[_0x2f06('0x38')](function(_0x416901){_0x374d55['count']=_0x416901;if(_0x54b88c[_0x2f06('0x43')]['includeAll']){_0x54ba53[_0x2f06('0x55')]=[{'model':db[_0x2f06('0x77')],'as':_0x2f06('0xc3'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x2f06('0x3d'),_0x2f06('0xc4'),_0x2f06('0xc5')],'required':![]},{'model':db[_0x2f06('0xc6')],'as':'Tags','attributes':['id',_0x2f06('0x3d'),_0x2f06('0xc7')],'where':_0x54b88c['query'][_0x2f06('0xc8')]?{'id':_0x54b88c['query'][_0x2f06('0xc8')]}:undefined,'required':_0x54b88c[_0x2f06('0x43')][_0x2f06('0xc8')]?!![]:![]}];}return db[_0x2f06('0x9c')][_0x2f06('0x56')](_0x54ba53);})[_0x2f06('0x38')](function(_0x12824a){_0x374d55[_0x2f06('0x57')]=_0x12824a;return _0x374d55;});}})[_0x2f06('0x38')](respondWithFilteredResult(_0x372073,_0x54ba53))[_0x2f06('0x58')](handleError(_0x372073,null));};exports[_0x2f06('0xb5')]=function(_0x297361,_0x10ebd5,_0x212c63){var _0x424e7c,_0x240da7,_0x539446;if(_[_0x2f06('0x91')](_0x297361[_0x2f06('0x5c')]['body'])||_0x297361[_0x2f06('0x5c')][_0x2f06('0x5c')]===''){throw new db['Sequelize'][(_0x2f06('0x93'))](_0x2f06('0xc9'));}if(_[_0x2f06('0x91')](_0x297361['body']['to'])){throw new db[(_0x2f06('0x78'))][(_0x2f06('0x93'))](_0x2f06('0xca'));}_0x424e7c=_0x297361[_0x2f06('0x5c')]['to'];return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0x297361[_0x2f06('0x62')]['id']},'include':[{'model':db[_0x2f06('0xcb')],'as':_0x2f06('0xcc'),'include':[{'model':db[_0x2f06('0x77')],'as':_0x2f06('0x98'),'where':{'mobile':_0x424e7c},'limit':0x1,'order':[['updatedAt',_0x2f06('0x99')]]}]}]})[_0x2f06('0x38')](handleEntityNotFound(_0x10ebd5,null))[_0x2f06('0x38')](function(_0x208be6){if(_0x208be6&&_0x208be6[_0x2f06('0xcc')]){_0x240da7=_0x208be6[_0x2f06('0x39')]({'plain':!![]});if(_0x240da7['List']&&_0x240da7[_0x2f06('0xcc')][_0x2f06('0x98')]['length']){return _0x240da7['List'][_0x2f06('0x98')][0x0];}return db[_0x2f06('0x77')]['create'](_['defaults'](_0x297361[_0x2f06('0x5c')],{'firstName':_0x424e7c,'mobile':_0x424e7c,'phone':_0x424e7c,'ListId':_0x240da7[_0x2f06('0x7d')]}));}})[_0x2f06('0x38')](handleEntityNotFound(_0x10ebd5,null))['then'](function(_0x3c0c36){if(_0x3c0c36){_0x539446=_0x3c0c36;return db[_0x2f06('0x9c')][_0x2f06('0x5a')]({'where':{'ContactId':_0x539446['id'],'closed':![],'SmsAccountId':_0x240da7['id']}})[_0x2f06('0x38')](function(_0x4c0817){if(_0x4c0817){return[_0x4c0817,![]];}return db[_0x2f06('0x9c')][_0x2f06('0x5b')]({'UserId':_0x297361['user']['id'],'ContactId':_0x539446['id'],'SmsAccountId':_0x240da7['id'],'phone':_0x424e7c,'firstMsgDirection':_0x2f06('0xcd'),'Messages':[_['merge'](_0x297361[_0x2f06('0x5c')],{'read':![],'body':_0x297361['body'][_0x2f06('0x5c')],'phone':_0x424e7c,'SmsAccountId':_0x240da7['id'],'UserId':_0x297361[_0x2f06('0xce')]['id'],'ContactId':_0x539446['id']})]},{'include':[{'model':db[_0x2f06('0xa4')],'as':_0x2f06('0xcf')}]})['then'](function(_0x3fe455){return[_0x3fe455,!![]];});});}})[_0x2f06('0x9d')](function(_0xc3febe,_0xf6cf1a){if(_0xf6cf1a){return _0xc3febe;}return db[_0x2f06('0xa4')][_0x2f06('0x5b')](_[_0x2f06('0x4f')](_0x297361['body'],{'read':![],'body':_0x297361[_0x2f06('0x5c')][_0x2f06('0x5c')],'phone':_0x424e7c,'SmsAccountId':_0x240da7['id'],'SmsInteractionId':_0xc3febe['id'],'UserId':_0x297361[_0x2f06('0xce')]['id'],'ContactId':_0x539446['id']}))[_0x2f06('0x38')](function(_0x3e9971){_0xc3febe[_0x2f06('0xd0')]['Messages']=[];_0xc3febe['dataValues'][_0x2f06('0xcf')][_0x2f06('0xd1')](_0x3e9971[_0x2f06('0xd0')]);return _0xc3febe;});})['then'](respondWithResult(_0x10ebd5,null))['catch'](handleError(_0x10ebd5,null));};exports[_0x2f06('0x2b')]=function(_0x1fbde4,_0x652de,_0x272afb){if(_0x1fbde4[_0x2f06('0x5c')]['id']){delete _0x1fbde4[_0x2f06('0x5c')]['id'];}var _0x5311ff,_0x4964,_0xbfb69f;return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0x1fbde4[_0x2f06('0x62')]['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x652de,null))['then'](function(_0x34e0ce){if(_0x34e0ce){_0xbfb69f=_0x34e0ce;logger['debug'](_0x2f06('0xaf'),'status',_0x2f06('0xd2'),_0x34e0ce[_0x2f06('0x50')],util[_0x2f06('0xd3')](_0x1fbde4[_0x2f06('0x5c')],{'showHidden':![],'depth':null}));switch(_0x34e0ce[_0x2f06('0x50')]){case _0x2f06('0x83'):if(_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xd4')]&&_0x1fbde4['body'][_0x2f06('0x2b')]){_0x4964=_0x1fbde4[_0x2f06('0x5c')]['status'];return db[_0x2f06('0xa4')][_0x2f06('0x5a')]({'where':{'messageId':_0x1fbde4['body'][_0x2f06('0xd4')]}});}break;case _0x2f06('0x85'):if(_0x1fbde4[_0x2f06('0x5c')]['requestid']&&_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xd5')]){_0x4964=_0x1fbde4[_0x2f06('0x5c')]['statusInt'];return db['SmsMessage'][_0x2f06('0x5a')]({'where':{'messageId':_0x1fbde4[_0x2f06('0x5c')]['requestid']}});}break;case _0x2f06('0xd6'):if(_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xd7')]&&_0x1fbde4[_0x2f06('0x5c')]['status_code']){_0x4964=_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xd8')];return db[_0x2f06('0xa4')][_0x2f06('0x5a')]({'where':{'messageId':_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xd7')]}});}break;case _0x2f06('0xd9'):var _0x16d633=_0x1fbde4['body'][_0x2f06('0x88')][0x0];if(_0x16d633['messageId']&&_0x16d633[_0x2f06('0x2b')][_0x2f06('0xda')]===_0x2f06('0xdb')){_0x4964=_0x16d633[_0x2f06('0x2b')]['groupName'];return db['SmsMessage'][_0x2f06('0x5a')]({'where':{'messageId':_0x16d633[_0x2f06('0x82')]}});}break;case _0x2f06('0x8b'):if(_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0x82')]&&_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0x2b')]){_0x4964=_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0x2b')];return db[_0x2f06('0xa4')][_0x2f06('0x5a')]({'where':{'messageId':_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0x82')]}});}break;case _0x2f06('0x8e'):if(_0x1fbde4[_0x2f06('0x5c')][0x0][_0x2f06('0x29')]['id']){_0x4964=_0x1fbde4['body'][0x0][_0x2f06('0x50')];return db[_0x2f06('0xa4')][_0x2f06('0x5a')]({'where':{'messageId':_0x1fbde4['body'][0x0][_0x2f06('0x29')]['id']}});}break;case _0x2f06('0x8f'):if(_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xdc')]&&_0x1fbde4['body'][_0x2f06('0x2b')]){_0x4964=_0x1fbde4['body'][_0x2f06('0x2b')];return db[_0x2f06('0xa4')]['find']({'where':{'messageId':_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x652de,null))[_0x2f06('0x38')](function(_0xef020b){if(_0xef020b){_0x5311ff=_0xef020b;switch(_0xbfb69f['type']){case _0x2f06('0x83'):if(_0x4964===_0x2f06('0xdb')){return _0x5311ff[_0x2f06('0x37')]({'read':!![]});}else{logger[_0x2f06('0x27')](_0x2f06('0xaf'),_0x2f06('0x2b'),'skebby',util[_0x2f06('0xd3')](_0x1fbde4[_0x2f06('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2f06('0x85'):if(_0x4964==='1'){return _0x5311ff['update']({'read':!![]});}else{logger[_0x2f06('0x27')](_0x2f06('0xaf'),'status',_0x2f06('0x83'),util[_0x2f06('0xd3')](_0x1fbde4[_0x2f06('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2f06('0xd6'):if(!_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0xdd')]&&_0x4964>=0xc8&&_0x4964<=0xce){return _0x5311ff['update']({'read':!![]});}else{logger[_0x2f06('0x27')](_0x2f06('0xaf'),_0x2f06('0x2b'),_0x2f06('0xd6'),util['inspect'](_0x1fbde4['body'],{'showHidden':![],'depth':null}));}break;case _0x2f06('0xd9'):var _0x1dd74e=_0x1fbde4[_0x2f06('0x5c')][_0x2f06('0x88')][0x0];if(_0x1dd74e[_0x2f06('0x2b')]['groupName']===_0x2f06('0xdb')){return _0x5311ff['update']({'read':!![]});}else{logger[_0x2f06('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2f06('0x2b'),_0x2f06('0xd9'),util[_0x2f06('0xd3')](_0x1fbde4['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4964==_0x2f06('0xde')||_0x4964=='RECEIVED_BY_RECIPIENT'){return _0x5311ff[_0x2f06('0x37')]({'read':!![]});}else{logger[_0x2f06('0x27')](_0x2f06('0xaf'),_0x2f06('0x2b'),_0x2f06('0x8b'),util[_0x2f06('0xd3')](_0x1fbde4[_0x2f06('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2f06('0x8e'):if(_0x4964=='message-delivered'){return _0x5311ff['update']({'read':!![]});}else{logger[_0x2f06('0x27')](_0x2f06('0xaf'),_0x2f06('0x2b'),_0x2f06('0x8e'),util['inspect'](_0x1fbde4[_0x2f06('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2f06('0x8f'):if(_0x4964===_0x2f06('0xdf')||_0x4964===_0x2f06('0xe0')){return _0x5311ff[_0x2f06('0x37')]({'read':!![]});}else{logger[_0x2f06('0x27')](_0x2f06('0xaf'),_0x2f06('0x2b'),'intelepeer',util[_0x2f06('0xd3')](_0x1fbde4[_0x2f06('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x5311ff;}})[_0x2f06('0x38')](respondWithResult(_0x652de,null))[_0x2f06('0x58')](handleError(_0x652de,null));};exports[_0x2f06('0xe1')]=function(_0x21b500,_0x3b2257,_0x1e843f){var _0x122dbe,_0x56b589,_0x2eb3c9;return db[_0x2f06('0x53')][_0x2f06('0x5a')]({'where':{'id':_0x21b500['params']['id']}})['then'](handleEntityNotFound(_0x3b2257,null))[_0x2f06('0x38')](function(_0x354ecf){if(_0x354ecf){_0x2eb3c9=_0x354ecf;logger[_0x2f06('0x25')](_0x2f06('0xaf'),_0x2f06('0x2b'),_0x2f06('0xd2'),_0x354ecf[_0x2f06('0x50')],util[_0x2f06('0xd3')](_0x21b500['query'],{'showHidden':![],'depth':null}));switch(_0x354ecf[_0x2f06('0x50')]){case _0x2f06('0x89'):if(_0x21b500[_0x2f06('0x43')][_0x2f06('0xe2')]&&_0x21b500['query']['state']){_0x56b589=_0x21b500[_0x2f06('0x43')][_0x2f06('0xe3')];return db['SmsMessage'][_0x2f06('0x5a')]({'where':{'messageId':_0x21b500[_0x2f06('0x43')]['message-id']}});}break;}}})[_0x2f06('0x38')](handleEntityNotFound(_0x3b2257,null))['then'](function(_0x5964a2){if(_0x5964a2){_0x122dbe=_0x5964a2;switch(_0x2eb3c9[_0x2f06('0x50')]){case _0x2f06('0x89'):if(_0x56b589==='2'||_0x56b589==='6'){return _0x122dbe[_0x2f06('0x37')]({'read':!![]});}else{logger[_0x2f06('0x27')](_0x2f06('0xaf'),'status',_0x2f06('0x89'),util[_0x2f06('0xd3')](_0x21b500[_0x2f06('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x122dbe;}})['then'](respondWithResult(_0x3b2257,null))['catch'](handleError(_0x3b2257,null));};exports[_0x2f06('0xe4')]=function(_0x5f451c,_0x180589,_0x413e0c){return db['SmsAccount'][_0x2f06('0x5a')]({'where':{'id':_0x5f451c[_0x2f06('0x62')]['id']}})['then'](handleEntityNotFound(_0x180589,null))['then'](function(_0x29638d){if(_0x29638d){return _0x29638d[_0x2f06('0xe4')](_0x5f451c[_0x2f06('0x5c')][_0x2f06('0x70')],_[_0x2f06('0xe5')](_0x5f451c[_0x2f06('0x5c')],[_0x2f06('0x70'),'id'])||{})[_0x2f06('0x9d')](function(_0x432784){for(var _0x380e3e=0x0;_0x380e3e<_0x5f451c[_0x2f06('0x5c')][_0x2f06('0x70')][_0x2f06('0x4a')];_0x380e3e+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x5f451c['body']['ids'][_0x380e3e]),'SmsAccountId':Number(_0x5f451c[_0x2f06('0x62')]['id'])});}return _0x432784;});}})[_0x2f06('0x38')](respondWithResult(_0x180589,null))[_0x2f06('0x58')](handleError(_0x180589,null));};exports[_0x2f06('0xe6')]=function(_0xa0fcb2,_0x3a7dcb,_0x542dfb){return db['SmsAccount'][_0x2f06('0x5a')]({'where':{'id':_0xa0fcb2[_0x2f06('0x62')]['id']}})[_0x2f06('0x38')](handleEntityNotFound(_0x3a7dcb,null))[_0x2f06('0x38')](function(_0x2330f6){if(_0x2330f6){return _0x2330f6[_0x2f06('0xe6')](_0xa0fcb2[_0x2f06('0x43')][_0x2f06('0x70')])['then'](function(){if(_[_0x2f06('0xe7')](_0xa0fcb2[_0x2f06('0x43')][_0x2f06('0x70')])){for(var _0x290bfd=0x0;_0x290bfd<_0xa0fcb2['query'][_0x2f06('0x70')]['length'];_0x290bfd+=0x1){socket['emit'](_0x2f06('0xe8'),{'UserId':Number(_0xa0fcb2['query']['ids'][_0x290bfd]),'SmsAccountId':Number(_0xa0fcb2[_0x2f06('0x62')]['id'])});}}else{socket[_0x2f06('0xe9')](_0x2f06('0xe8'),{'UserId':Number(_0xa0fcb2['query']['ids']),'SmsAccountId':Number(_0xa0fcb2[_0x2f06('0x62')]['id'])});}});}})[_0x2f06('0x38')](respondWithStatusCode(_0x3a7dcb,null))['catch'](handleError(_0x3a7dcb,null));};exports['getAgents']=function(_0x3a7345,_0x2a535c,_0x541a14){var _0x3bb0fe={};var _0x3dfb76={};var _0x453ad0;var _0x123a6a;return db[_0x2f06('0x53')]['findOne']({'where':{'id':_0x3a7345[_0x2f06('0x62')]['id']}})['then'](handleEntityNotFound(_0x2a535c,null))['then'](function(_0x481968){if(_0x481968){_0x453ad0=_0x481968;_0x3dfb76[_0x2f06('0x47')]=_[_0x2f06('0x44')](db[_0x2f06('0xa6')]['rawAttributes']);_0x3dfb76['query']=_[_0x2f06('0x44')](_0x3a7345[_0x2f06('0x43')]);_0x3dfb76[_0x2f06('0x45')]=_[_0x2f06('0x46')](_0x3dfb76['model'],_0x3dfb76[_0x2f06('0x43')]);_0x3bb0fe[_0x2f06('0x49')]=_['intersection'](_0x3dfb76[_0x2f06('0x47')],qs[_0x2f06('0x48')](_0x3a7345[_0x2f06('0x43')][_0x2f06('0x48')]));_0x3bb0fe[_0x2f06('0x49')]=_0x3bb0fe[_0x2f06('0x49')][_0x2f06('0x4a')]?_0x3bb0fe[_0x2f06('0x49')]:_0x3dfb76['model'];_0x3bb0fe['order']=qs[_0x2f06('0x6a')](_0x3a7345['query'][_0x2f06('0x6a')]);_0x3bb0fe[_0x2f06('0x4d')]=qs[_0x2f06('0x45')](_['pick'](_0x3a7345[_0x2f06('0x43')],_0x3dfb76['filters']));if(_0x3a7345[_0x2f06('0x43')][_0x2f06('0x4e')]){_0x3bb0fe[_0x2f06('0x4d')]=_['merge'](_0x3bb0fe[_0x2f06('0x4d')],{'$or':_[_0x2f06('0x40')](_0x3bb0fe['attributes'],function(_0x82824d){var _0x5c4de5={};_0x5c4de5[_0x82824d]={'$like':'%'+_0x3a7345[_0x2f06('0x43')][_0x2f06('0x4e')]+'%'};return _0x5c4de5;})});}_0x3bb0fe=_[_0x2f06('0x4f')]({},_0x3bb0fe,_0x3a7345[_0x2f06('0x52')]);return _0x453ad0[_0x2f06('0xea')](_0x3bb0fe);}})[_0x2f06('0x38')](function(_0x2a51f0){if(_0x2a51f0){_0x123a6a=_0x2a51f0['length'];if(!_0x3a7345[_0x2f06('0x43')]['hasOwnProperty'](_0x2f06('0x4b'))){_0x3bb0fe[_0x2f06('0x31')]=qs[_0x2f06('0x31')](_0x3a7345[_0x2f06('0x43')][_0x2f06('0x31')]);_0x3bb0fe[_0x2f06('0x2e')]=qs[_0x2f06('0x2e')](_0x3a7345['query'][_0x2f06('0x2e')]);}return _0x453ad0[_0x2f06('0xea')](_0x3bb0fe);}})[_0x2f06('0x38')](function(_0x4d5aca){if(_0x4d5aca){return _0x4d5aca?{'count':_0x123a6a,'rows':_0x4d5aca}:null;}})[_0x2f06('0x38')](respondWithResult(_0x2a535c,null))['catch'](handleError(_0x2a535c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 7dbdf50..50f85f9 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 _0xaa3b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x49cbdc,_0x1ca6fd){var _0x185a82=function(_0x5a7c60){while(--_0x5a7c60){_0x49cbdc['push'](_0x49cbdc['shift']());}};_0x185a82(++_0x1ca6fd);}(_0xaa3b,0x19c));var _0xbaa3=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0xaa3b[_0x48b5e0];return _0x4287ea;};'use strict';var EventEmitter=require(_0xbaa3('0x0'));var SmsAccount=require(_0xbaa3('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xbaa3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbaa3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d1057){return function(_0x424013,_0x5744ff,_0x4a32d2){SmsAccountEvents[_0xbaa3('0x4')](_0x7d1057+':'+_0x424013['id'],_0x424013);SmsAccountEvents[_0xbaa3('0x4')](_0x7d1057,_0x424013);_0x4a32d2(null);};}for(var e in events){if(events[_0xbaa3('0x5')](e)){var event=events[e];SmsAccount[_0xbaa3('0x6')](e,emitEvent(event));}}module[_0xbaa3('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x02bb=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','remove','hasOwnProperty','hook'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x02bb,0x7f));var _0xb02b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x02bb[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require(_0xb02b('0x0'));var SmsAccount=require(_0xb02b('0x1'))['db'][_0xb02b('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xb02b('0x3')](0x0);var events={'afterCreate':_0xb02b('0x4'),'afterUpdate':'update','afterDestroy':_0xb02b('0x5')};function emitEvent(_0x4d0f17){return function(_0x4de8ef,_0x3b8ab2,_0x4d2a81){SmsAccountEvents['emit'](_0x4d0f17+':'+_0x4de8ef['id'],_0x4de8ef);SmsAccountEvents['emit'](_0x4d0f17,_0x4de8ef);_0x4d2a81(null);};}for(var e in events){if(events[_0xb02b('0x6')](e)){var event=events[e];SmsAccount[_0xb02b('0x7')](e,emitEvent(event));}}module[_0xb02b('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 2c4fb54..848c3f3 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 _0x021f=['bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','lodash','util','../../config/logger','moment'];(function(_0x3ae79d,_0x3f9238){var _0x542f7c=function(_0x4cb971){while(--_0x4cb971){_0x3ae79d['push'](_0x3ae79d['shift']());}};_0x542f7c(++_0x3f9238);}(_0x021f,0x74));var _0xf021=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x021f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xf021('0x0'));var util=require(_0xf021('0x1'));var logger=require(_0xf021('0x2'))('api');var moment=require(_0xf021('0x3'));var BPromise=require(_0xf021('0x4'));var rp=require(_0xf021('0x5'));var fs=require('fs');var path=require(_0xf021('0x6'));var rimraf=require(_0xf021('0x7'));var config=require(_0xf021('0x8'));var attributes=require(_0xf021('0x9'));module['exports']=function(_0x539136,_0x1da81b){return _0x539136[_0xf021('0xa')](_0xf021('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e74=['../../config/logger','path','rimraf','../../config/environment','exports','define','SmsAccount','lodash'];(function(_0x31b3ab,_0x3a9872){var _0x457aba=function(_0x2b02ca){while(--_0x2b02ca){_0x31b3ab['push'](_0x31b3ab['shift']());}};_0x457aba(++_0x3a9872);}(_0x6e74,0x1b7));var _0x46e7=function(_0x11b3bf,_0xca12c){_0x11b3bf=_0x11b3bf-0x0;var _0x2eeb8b=_0x6e74[_0x11b3bf];return _0x2eeb8b;};'use strict';var _=require(_0x46e7('0x0'));var util=require('util');var logger=require(_0x46e7('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46e7('0x2'));var rimraf=require(_0x46e7('0x3'));var config=require(_0x46e7('0x4'));var attributes=require('./smsAccount.attributes');module[_0x46e7('0x5')]=function(_0xf02dfa,_0x32a9){return _0xf02dfa[_0x46e7('0x6')](_0x46e7('0x7'),attributes,{'tableName':'sms_accounts','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 165caef..8488f02 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 _0x5d81=['util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSmsAccount','find','options','raw','where','attributes','include','map','model','stringify','catch','lodash'];(function(_0x4f777f,_0x368465){var _0x21b4e6=function(_0x443a15){while(--_0x443a15){_0x4f777f['push'](_0x4f777f['shift']());}};_0x21b4e6(++_0x368465);}(_0x5d81,0x196));var _0x15d8=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x5d81[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0x15d8('0x0'));var util=require(_0x15d8('0x1'));var moment=require(_0x15d8('0x2'));var BPromise=require(_0x15d8('0x3'));var rs=require(_0x15d8('0x4'));var fs=require('fs');var Redis=require(_0x15d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x15d8('0x6'))('rpc');var config=require(_0x15d8('0x7'));var jayson=require(_0x15d8('0x8'));var client=jayson[_0x15d8('0x9')]['http']({'port':0x232a});config[_0x15d8('0xa')]=_[_0x15d8('0xb')](config[_0x15d8('0xa')],{'host':_0x15d8('0xc'),'port':0x18eb});var socket=require(_0x15d8('0xd'))(new Redis(config[_0x15d8('0xa')]));require('./smsAccount.socket')[_0x15d8('0xe')](socket);function respondWithRpcPromise(_0x1c6ed2,_0x14a010,_0x523ad0){return new BPromise(function(_0x2494c2,_0x49d2ca){return client[_0x15d8('0xf')](_0x1c6ed2,_0x523ad0)[_0x15d8('0x10')](function(_0x2ed308){logger[_0x15d8('0x11')](_0x15d8('0x12'),_0x14a010,_0x15d8('0x13'));logger[_0x15d8('0x14')](_0x15d8('0x15'),_0x14a010,_0x15d8('0x13'),JSON['stringify'](_0x2ed308));if(_0x2ed308[_0x15d8('0x16')]){if(_0x2ed308[_0x15d8('0x16')][_0x15d8('0x17')]===0x1f4){logger['error'](_0x15d8('0x12'),_0x14a010,_0x2ed308['error']['message']);return _0x49d2ca(_0x2ed308[_0x15d8('0x16')][_0x15d8('0x18')]);}logger[_0x15d8('0x16')](_0x15d8('0x12'),_0x14a010,_0x2ed308['error'][_0x15d8('0x18')]);return _0x2494c2(_0x2ed308[_0x15d8('0x16')]['message']);}else{logger[_0x15d8('0x11')](_0x15d8('0x12'),_0x14a010,_0x15d8('0x13'));_0x2494c2(_0x2ed308[_0x15d8('0x19')][_0x15d8('0x18')]);}})['catch'](function(_0x2c6cb0){logger[_0x15d8('0x16')](_0x15d8('0x12'),_0x14a010,_0x2c6cb0);_0x49d2ca(_0x2c6cb0);});});}exports[_0x15d8('0x1a')]=function(_0x215cda){var _0x3282aa=this;return new Promise(function(_0x39b610,_0x43cb63){return db['SmsAccount'][_0x15d8('0x1b')]({'raw':_0x215cda[_0x15d8('0x1c')]?_0x215cda[_0x15d8('0x1c')][_0x15d8('0x1d')]===undefined?!![]:![]:!![],'where':_0x215cda['options']?_0x215cda['options'][_0x15d8('0x1e')]||null:null,'attributes':_0x215cda[_0x15d8('0x1c')]?_0x215cda[_0x15d8('0x1c')][_0x15d8('0x1f')]||null:null,'include':_0x215cda[_0x15d8('0x1c')]?_0x215cda['options'][_0x15d8('0x20')]?_[_0x15d8('0x21')](_0x215cda['options']['include'],function(_0x922a37){return{'model':db[_0x922a37[_0x15d8('0x22')]],'as':_0x922a37['as'],'attributes':_0x922a37[_0x15d8('0x1f')],'include':_0x922a37[_0x15d8('0x20')]?_[_0x15d8('0x21')](_0x922a37[_0x15d8('0x20')],function(_0x20f3e2){return{'model':db[_0x20f3e2[_0x15d8('0x22')]],'as':_0x20f3e2['as'],'attributes':_0x20f3e2[_0x15d8('0x1f')],'include':_0x20f3e2[_0x15d8('0x20')]?_[_0x15d8('0x21')](_0x20f3e2['include'],function(_0x504e21){return{'model':db[_0x504e21['model']],'as':_0x504e21['as'],'attributes':_0x504e21[_0x15d8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ea124){logger['info'](_0x15d8('0x1a'),_0x215cda);logger[_0x15d8('0x14')](_0x15d8('0x1a'),_0x215cda,JSON[_0x15d8('0x23')](_0x5ea124));_0x39b610(_0x5ea124);})[_0x15d8('0x24')](function(_0x49ffbd){logger[_0x15d8('0x16')](_0x15d8('0x1a'),_0x49ffbd[_0x15d8('0x18')],_0x215cda);_0x43cb63(_0x3282aa[_0x15d8('0x16')](0x1f4,_0x49ffbd[_0x15d8('0x18')]));});});}; \ No newline at end of file +var _0x92e2=['options','raw','where','include','map','attributes','model','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount'];(function(_0x2ac7f2,_0x4b80a6){var _0x441784=function(_0x2e5345){while(--_0x2e5345){_0x2ac7f2['push'](_0x2ac7f2['shift']());}};_0x441784(++_0x4b80a6);}(_0x92e2,0x87));var _0x292e=function(_0x46874f,_0x2e4bb2){_0x46874f=_0x46874f-0x0;var _0x37436c=_0x92e2[_0x46874f];return _0x37436c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x292e('0x0'));var BPromise=require(_0x292e('0x1'));var rs=require(_0x292e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x292e('0x3'))['db'];var utils=require(_0x292e('0x4'));var logger=require(_0x292e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x292e('0x6')][_0x292e('0x7')]({'port':0x232a});config[_0x292e('0x8')]=_[_0x292e('0x9')](config[_0x292e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x292e('0xa'))(new Redis(config[_0x292e('0x8')]));require(_0x292e('0xb'))[_0x292e('0xc')](socket);function respondWithRpcPromise(_0x99d19b,_0x3e3baa,_0x21ddac){return new BPromise(function(_0x4ea10f,_0x246a1d){return client['request'](_0x99d19b,_0x21ddac)[_0x292e('0xd')](function(_0xcf0e1a){logger[_0x292e('0xe')](_0x292e('0xf'),_0x3e3baa,_0x292e('0x10'));logger['debug'](_0x292e('0x11'),_0x3e3baa,'request\x20sent',JSON[_0x292e('0x12')](_0xcf0e1a));if(_0xcf0e1a[_0x292e('0x13')]){if(_0xcf0e1a[_0x292e('0x13')][_0x292e('0x14')]===0x1f4){logger[_0x292e('0x13')](_0x292e('0xf'),_0x3e3baa,_0xcf0e1a['error'][_0x292e('0x15')]);return _0x246a1d(_0xcf0e1a[_0x292e('0x13')][_0x292e('0x15')]);}logger[_0x292e('0x13')](_0x292e('0xf'),_0x3e3baa,_0xcf0e1a['error'][_0x292e('0x15')]);return _0x4ea10f(_0xcf0e1a[_0x292e('0x13')][_0x292e('0x15')]);}else{logger[_0x292e('0xe')](_0x292e('0xf'),_0x3e3baa,_0x292e('0x10'));_0x4ea10f(_0xcf0e1a['result'][_0x292e('0x15')]);}})[_0x292e('0x16')](function(_0x160be2){logger[_0x292e('0x13')](_0x292e('0xf'),_0x3e3baa,_0x160be2);_0x246a1d(_0x160be2);});});}exports[_0x292e('0x17')]=function(_0xae317d){var _0x5ab4c8=this;return new Promise(function(_0x3bcb97,_0x4a411b){return db[_0x292e('0x18')]['find']({'raw':_0xae317d[_0x292e('0x19')]?_0xae317d[_0x292e('0x19')][_0x292e('0x1a')]===undefined?!![]:![]:!![],'where':_0xae317d['options']?_0xae317d['options'][_0x292e('0x1b')]||null:null,'attributes':_0xae317d[_0x292e('0x19')]?_0xae317d[_0x292e('0x19')]['attributes']||null:null,'include':_0xae317d[_0x292e('0x19')]?_0xae317d[_0x292e('0x19')][_0x292e('0x1c')]?_[_0x292e('0x1d')](_0xae317d['options'][_0x292e('0x1c')],function(_0xe2da54){return{'model':db[_0xe2da54['model']],'as':_0xe2da54['as'],'attributes':_0xe2da54[_0x292e('0x1e')],'include':_0xe2da54['include']?_[_0x292e('0x1d')](_0xe2da54[_0x292e('0x1c')],function(_0x1be78c){return{'model':db[_0x1be78c[_0x292e('0x1f')]],'as':_0x1be78c['as'],'attributes':_0x1be78c[_0x292e('0x1e')],'include':_0x1be78c['include']?_['map'](_0x1be78c[_0x292e('0x1c')],function(_0x470339){return{'model':db[_0x470339[_0x292e('0x1f')]],'as':_0x470339['as'],'attributes':_0x470339[_0x292e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x292e('0xd')](function(_0x21d810){logger[_0x292e('0xe')](_0x292e('0x17'),_0xae317d);logger['debug'](_0x292e('0x17'),_0xae317d,JSON[_0x292e('0x12')](_0x21d810));_0x3bcb97(_0x21d810);})[_0x292e('0x16')](function(_0x3c642b){logger[_0x292e('0x13')](_0x292e('0x17'),_0x3c642b['message'],_0xae317d);_0x4a411b(_0x5ab4c8[_0x292e('0x13')](0x1f4,_0x3c642b[_0x292e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 911654c..08d24af 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(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 eff2e78..12918b5 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x12e8fa,_0x366a21){var _0x514e1f=function(_0x561d99){while(--_0x561d99){_0x12e8fa['push'](_0x12e8fa['shift']());}};_0x514e1f(++_0x366a21);}(_0x34e8,0x12c));var _0x834e=function(_0x4538c3,_0x42a3cd){_0x4538c3=_0x4538c3-0x0;var _0x4561b0=_0x34e8[_0x4538c3];return _0x4561b0;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x9db135,_0x5a12a0){var _0x5ec73d=function(_0x46efd5){while(--_0x46efd5){_0x9db135['push'](_0x9db135['shift']());}};_0x5ec73d(++_0x5a12a0);}(_0x7217,0x19e));var _0x7721=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x7217[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 09f13ae..08095e8 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 _0xc7fb=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x517cb2,_0x3005b8){var _0x14540c=function(_0x4067c1){while(--_0x4067c1){_0x517cb2['push'](_0x517cb2['shift']());}};_0x14540c(++_0x3005b8);}(_0xc7fb,0xb1));var _0xbc7f=function(_0xee1fee,_0x494196){_0xee1fee=_0xee1fee-0x0;var _0xe50c1a=_0xc7fb[_0xee1fee];return _0xe50c1a;};'use strict';var Sequelize=require(_0xbc7f('0x0'));module[_0xbc7f('0x1')]={'priority':{'type':Sequelize[_0xbc7f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc7f('0x3')},'appdata':{'type':Sequelize[_0xbc7f('0x4')]()},'description':{'type':Sequelize[_0xbc7f('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbc7f('0x6')}}; \ No newline at end of file +var _0x25f1=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x772dec,_0x2d583f){var _0x3001bf=function(_0x40e4ab){while(--_0x40e4ab){_0x772dec['push'](_0x772dec['shift']());}};_0x3001bf(++_0x2d583f);}(_0x25f1,0xa4));var _0x125f=function(_0x2713e0,_0x16fbf9){_0x2713e0=_0x2713e0-0x0;var _0x3ce6d7=_0x25f1[_0x2713e0];return _0x3ce6d7;};'use strict';var Sequelize=require(_0x125f('0x0'));module[_0x125f('0x1')]={'priority':{'type':Sequelize[_0x125f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x125f('0x3')},'appdata':{'type':Sequelize[_0x125f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x125f('0x5')],'defaultValue':_0x125f('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 76dc7a4..ac61985 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 _0x71c2=['type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SmsApplication','rawAttributes','fieldName'];(function(_0xa70736,_0x56a97e){var _0x2de011=function(_0x26082d){while(--_0x26082d){_0xa70736['push'](_0xa70736['shift']());}};_0x2de011(++_0x56a97e);}(_0x71c2,0x1e5));var _0x271c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x271c('0x0'));var rimraf=require(_0x271c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x271c('0x2'));var rp=require('request-promise');var moment=require(_0x271c('0x3'));var BPromise=require(_0x271c('0x4'));var Mustache=require(_0x271c('0x5'));var util=require(_0x271c('0x6'));var path=require(_0x271c('0x7'));var sox=require('sox');var csv=require(_0x271c('0x8'));var ejs=require(_0x271c('0x9'));var fs=require('fs');var fs_extra=require(_0x271c('0xa'));var _=require(_0x271c('0xb'));var squel=require('squel');var crypto=require(_0x271c('0xc'));var jsforce=require(_0x271c('0xd'));var deskjs=require(_0x271c('0xe'));var toCsv=require(_0x271c('0x8'));var querystring=require(_0x271c('0xf'));var Papa=require(_0x271c('0x10'));var Redis=require(_0x271c('0x11'));var authService=require(_0x271c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x271c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x271c('0x14'))(_0x271c('0x15'));var utils=require('../../config/utils');var config=require(_0x271c('0x16'));var licenseUtil=require(_0x271c('0x17'));var db=require(_0x271c('0x18'))['db'];function respondWithStatusCode(_0x5586de,_0x10a259){_0x10a259=_0x10a259||0xcc;return function(_0x566648){if(_0x566648){return _0x5586de[_0x271c('0x19')](_0x10a259);}return _0x5586de[_0x271c('0x1a')](_0x10a259)[_0x271c('0x1b')]();};}function respondWithResult(_0x272a5a,_0x34b750){_0x34b750=_0x34b750||0xc8;return function(_0x5e0175){if(_0x5e0175){return _0x272a5a['status'](_0x34b750)[_0x271c('0x1c')](_0x5e0175);}};}function respondWithFilteredResult(_0x5ef66f,_0x4b6911){return function(_0x18bde4){if(_0x18bde4){var _0x3bc382=typeof _0x4b6911[_0x271c('0x1d')]===_0x271c('0x1e')&&typeof _0x4b6911['limit']==='undefined';var _0x85f175=_0x18bde4[_0x271c('0x1f')];var _0x595cc8=_0x3bc382?0x0:_0x4b6911[_0x271c('0x1d')];var _0x834a33=_0x3bc382?_0x18bde4[_0x271c('0x1f')]:_0x4b6911['offset']+_0x4b6911['limit'];var _0x59666b;if(_0x834a33>=_0x85f175){_0x834a33=_0x85f175;_0x59666b=0xc8;}else{_0x59666b=0xce;}_0x5ef66f['status'](_0x59666b);return _0x5ef66f[_0x271c('0x20')](_0x271c('0x21'),_0x595cc8+'-'+_0x834a33+'/'+_0x85f175)[_0x271c('0x1c')](_0x18bde4);}return null;};}function patchUpdates(_0x49bd07){return function(_0x46415c){try{jsonpatch[_0x271c('0x22')](_0x46415c,_0x49bd07,!![]);}catch(_0x5c086f){return BPromise[_0x271c('0x23')](_0x5c086f);}return _0x46415c[_0x271c('0x24')]();};}function saveUpdates(_0x3477bc,_0x722138){return function(_0x193133){if(_0x193133){return _0x193133[_0x271c('0x25')](_0x3477bc)[_0x271c('0x26')](function(_0x88c9d7){return _0x88c9d7;});}return null;};}function removeEntity(_0x1454ea,_0x3ef6f3){return function(_0x5c284b){if(_0x5c284b){return _0x5c284b[_0x271c('0x27')]()['then'](function(){_0x1454ea[_0x271c('0x1a')](0xcc)[_0x271c('0x1b')]();});}};}function handleEntityNotFound(_0x491116,_0x3eddd9){return function(_0x1c083c){if(!_0x1c083c){_0x491116[_0x271c('0x19')](0x194);}return _0x1c083c;};}function handleError(_0x59f8c4,_0x398231){_0x398231=_0x398231||0x1f4;return function(_0x59d9d8){logger['error'](_0x59d9d8[_0x271c('0x28')]);if(_0x59d9d8[_0x271c('0x29')]){delete _0x59d9d8[_0x271c('0x29')];}_0x59f8c4[_0x271c('0x1a')](_0x398231)[_0x271c('0x2a')](_0x59d9d8);};}exports[_0x271c('0x2b')]=function(_0x1c3c0d,_0x27581b){var _0x29e04f={},_0x3f1693={},_0x59fc80={'count':0x0,'rows':[]};var _0x37f88a=_['map'](db[_0x271c('0x2c')][_0x271c('0x2d')],function(_0x1e2430){return{'name':_0x1e2430[_0x271c('0x2e')],'type':_0x1e2430[_0x271c('0x2f')]['key']};});_0x3f1693[_0x271c('0x30')]=_[_0x271c('0x31')](_0x37f88a,_0x271c('0x29'));_0x3f1693[_0x271c('0x32')]=_[_0x271c('0x33')](_0x1c3c0d[_0x271c('0x32')]);_0x3f1693['filters']=_['intersection'](_0x3f1693[_0x271c('0x30')],_0x3f1693[_0x271c('0x32')]);_0x29e04f['attributes']=_[_0x271c('0x34')](_0x3f1693[_0x271c('0x30')],qs[_0x271c('0x35')](_0x1c3c0d[_0x271c('0x32')][_0x271c('0x35')]));_0x29e04f['attributes']=_0x29e04f[_0x271c('0x36')][_0x271c('0x37')]?_0x29e04f[_0x271c('0x36')]:_0x3f1693[_0x271c('0x30')];if(!_0x1c3c0d[_0x271c('0x32')][_0x271c('0x38')]('nolimit')){_0x29e04f[_0x271c('0x39')]=qs[_0x271c('0x39')](_0x1c3c0d[_0x271c('0x32')]['limit']);_0x29e04f[_0x271c('0x1d')]=qs[_0x271c('0x1d')](_0x1c3c0d['query'][_0x271c('0x1d')]);}_0x29e04f['order']=qs[_0x271c('0x3a')](_0x1c3c0d['query']['sort']);_0x29e04f[_0x271c('0x3b')]=qs['filters'](_[_0x271c('0x3c')](_0x1c3c0d[_0x271c('0x32')],_0x3f1693[_0x271c('0x3d')]),_0x37f88a);if(_0x1c3c0d[_0x271c('0x32')][_0x271c('0x3e')]){_0x29e04f[_0x271c('0x3b')]=_[_0x271c('0x3f')](_0x29e04f[_0x271c('0x3b')],{'$or':_['map'](_0x37f88a,function(_0x4033c6){if(_0x4033c6['type']!==_0x271c('0x40')){var _0x43ed2f={};_0x43ed2f[_0x4033c6[_0x271c('0x29')]]={'$like':'%'+_0x1c3c0d[_0x271c('0x32')][_0x271c('0x3e')]+'%'};return _0x43ed2f;}})});}_0x29e04f=_[_0x271c('0x3f')]({},_0x29e04f,_0x1c3c0d['options']);var _0x198384={'where':_0x29e04f[_0x271c('0x3b')]};return db[_0x271c('0x2c')][_0x271c('0x1f')](_0x198384)['then'](function(_0x4e26e7){_0x59fc80[_0x271c('0x1f')]=_0x4e26e7;if(_0x1c3c0d[_0x271c('0x32')][_0x271c('0x41')]){_0x29e04f[_0x271c('0x42')]=[{'all':!![]}];}return db['SmsApplication'][_0x271c('0x43')](_0x29e04f);})[_0x271c('0x26')](function(_0x4679fa){_0x59fc80[_0x271c('0x44')]=_0x4679fa;return _0x59fc80;})['then'](respondWithFilteredResult(_0x27581b,_0x29e04f))['catch'](handleError(_0x27581b,null));};exports[_0x271c('0x45')]=function(_0x33befa,_0x457e1b){var _0x16dcc7={'raw':!![],'where':{'id':_0x33befa[_0x271c('0x46')]['id']}},_0x434481={};_0x434481[_0x271c('0x30')]=_['keys'](db[_0x271c('0x2c')][_0x271c('0x2d')]);_0x434481['query']=_['keys'](_0x33befa[_0x271c('0x32')]);_0x434481[_0x271c('0x3d')]=_[_0x271c('0x34')](_0x434481[_0x271c('0x30')],_0x434481[_0x271c('0x32')]);_0x16dcc7['attributes']=_[_0x271c('0x34')](_0x434481[_0x271c('0x30')],qs[_0x271c('0x35')](_0x33befa[_0x271c('0x32')]['fields']));_0x16dcc7[_0x271c('0x36')]=_0x16dcc7[_0x271c('0x36')][_0x271c('0x37')]?_0x16dcc7['attributes']:_0x434481['model'];if(_0x33befa[_0x271c('0x32')][_0x271c('0x41')]){_0x16dcc7[_0x271c('0x42')]=[{'all':!![]}];}_0x16dcc7=_[_0x271c('0x3f')]({},_0x16dcc7,_0x33befa[_0x271c('0x47')]);return db[_0x271c('0x2c')]['find'](_0x16dcc7)[_0x271c('0x26')](handleEntityNotFound(_0x457e1b,null))[_0x271c('0x26')](respondWithResult(_0x457e1b,null))[_0x271c('0x48')](handleError(_0x457e1b,null));};exports[_0x271c('0x49')]=function(_0x1ffbbf,_0x32034e){return db['SmsApplication'][_0x271c('0x49')](_0x1ffbbf[_0x271c('0x4a')],{})[_0x271c('0x26')](respondWithResult(_0x32034e,0xc9))[_0x271c('0x48')](handleError(_0x32034e,null));};exports[_0x271c('0x25')]=function(_0xb02c1b,_0x36373b){if(_0xb02c1b[_0x271c('0x4a')]['id']){delete _0xb02c1b[_0x271c('0x4a')]['id'];}return db['SmsApplication'][_0x271c('0x4b')]({'where':{'id':_0xb02c1b[_0x271c('0x46')]['id']}})[_0x271c('0x26')](handleEntityNotFound(_0x36373b,null))[_0x271c('0x26')](saveUpdates(_0xb02c1b[_0x271c('0x4a')],null))['then'](respondWithResult(_0x36373b,null))[_0x271c('0x48')](handleError(_0x36373b,null));};exports[_0x271c('0x27')]=function(_0x37e809,_0x21fbe4){return db['SmsApplication']['find']({'where':{'id':_0x37e809[_0x271c('0x46')]['id']}})[_0x271c('0x26')](handleEntityNotFound(_0x21fbe4,null))[_0x271c('0x26')](removeEntity(_0x21fbe4,null))[_0x271c('0x48')](handleError(_0x21fbe4,null));}; \ No newline at end of file +var _0xbcb8=['offset','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit'];(function(_0x1f0714,_0xde0530){var _0x33669d=function(_0x38cb83){while(--_0x38cb83){_0x1f0714['push'](_0x1f0714['shift']());}};_0x33669d(++_0xde0530);}(_0xbcb8,0xc6));var _0x8bcb=function(_0x5d3b00,_0xc62f64){_0x5d3b00=_0x5d3b00-0x0;var _0x24427e=_0xbcb8[_0x5d3b00];return _0x24427e;};'use strict';var emlformat=require(_0x8bcb('0x0'));var rimraf=require(_0x8bcb('0x1'));var zipdir=require(_0x8bcb('0x2'));var jsonpatch=require(_0x8bcb('0x3'));var rp=require(_0x8bcb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8bcb('0x5'));var util=require(_0x8bcb('0x6'));var path=require('path');var sox=require(_0x8bcb('0x7'));var csv=require(_0x8bcb('0x8'));var ejs=require(_0x8bcb('0x9'));var fs=require('fs');var fs_extra=require(_0x8bcb('0xa'));var _=require('lodash');var squel=require(_0x8bcb('0xb'));var crypto=require(_0x8bcb('0xc'));var jsforce=require(_0x8bcb('0xd'));var deskjs=require(_0x8bcb('0xe'));var toCsv=require(_0x8bcb('0x8'));var querystring=require(_0x8bcb('0xf'));var Papa=require(_0x8bcb('0x10'));var Redis=require('ioredis');var authService=require(_0x8bcb('0x11'));var qs=require(_0x8bcb('0x12'));var as=require(_0x8bcb('0x13'));var hardwareService=require(_0x8bcb('0x14'));var logger=require(_0x8bcb('0x15'))(_0x8bcb('0x16'));var utils=require(_0x8bcb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8bcb('0x18'));var db=require(_0x8bcb('0x19'))['db'];function respondWithStatusCode(_0x2bbd68,_0x1bbc44){_0x1bbc44=_0x1bbc44||0xcc;return function(_0x58f7e7){if(_0x58f7e7){return _0x2bbd68['sendStatus'](_0x1bbc44);}return _0x2bbd68[_0x8bcb('0x1a')](_0x1bbc44)['end']();};}function respondWithResult(_0x2efa0b,_0x1967c2){_0x1967c2=_0x1967c2||0xc8;return function(_0x3af097){if(_0x3af097){return _0x2efa0b[_0x8bcb('0x1a')](_0x1967c2)[_0x8bcb('0x1b')](_0x3af097);}};}function respondWithFilteredResult(_0x20f386,_0x2b470b){return function(_0x41f22d){if(_0x41f22d){var _0x446fc6=typeof _0x2b470b['offset']===_0x8bcb('0x1c')&&typeof _0x2b470b[_0x8bcb('0x1d')]==='undefined';var _0x17201f=_0x41f22d['count'];var _0x1259e4=_0x446fc6?0x0:_0x2b470b[_0x8bcb('0x1e')];var _0x23d7c0=_0x446fc6?_0x41f22d[_0x8bcb('0x1f')]:_0x2b470b[_0x8bcb('0x1e')]+_0x2b470b[_0x8bcb('0x1d')];var _0x36d788;if(_0x23d7c0>=_0x17201f){_0x23d7c0=_0x17201f;_0x36d788=0xc8;}else{_0x36d788=0xce;}_0x20f386[_0x8bcb('0x1a')](_0x36d788);return _0x20f386[_0x8bcb('0x20')](_0x8bcb('0x21'),_0x1259e4+'-'+_0x23d7c0+'/'+_0x17201f)[_0x8bcb('0x1b')](_0x41f22d);}return null;};}function patchUpdates(_0x214f0c){return function(_0x388cd7){try{jsonpatch[_0x8bcb('0x22')](_0x388cd7,_0x214f0c,!![]);}catch(_0x1bb1d0){return BPromise[_0x8bcb('0x23')](_0x1bb1d0);}return _0x388cd7[_0x8bcb('0x24')]();};}function saveUpdates(_0x3a13c0,_0x474131){return function(_0x199967){if(_0x199967){return _0x199967[_0x8bcb('0x25')](_0x3a13c0)['then'](function(_0x2bd6b6){return _0x2bd6b6;});}return null;};}function removeEntity(_0x25a96f,_0x507767){return function(_0x32d1fb){if(_0x32d1fb){return _0x32d1fb[_0x8bcb('0x26')]()[_0x8bcb('0x27')](function(){_0x25a96f[_0x8bcb('0x1a')](0xcc)[_0x8bcb('0x28')]();});}};}function handleEntityNotFound(_0x4503d2,_0x1500f6){return function(_0x518b22){if(!_0x518b22){_0x4503d2[_0x8bcb('0x29')](0x194);}return _0x518b22;};}function handleError(_0x5a8ca7,_0x530d96){_0x530d96=_0x530d96||0x1f4;return function(_0x1996e9){logger[_0x8bcb('0x2a')](_0x1996e9[_0x8bcb('0x2b')]);if(_0x1996e9[_0x8bcb('0x2c')]){delete _0x1996e9[_0x8bcb('0x2c')];}_0x5a8ca7[_0x8bcb('0x1a')](_0x530d96)[_0x8bcb('0x2d')](_0x1996e9);};}exports['index']=function(_0x2a6104,_0x483f34){var _0x2c1ee4={},_0x2994fa={},_0x4e7250={'count':0x0,'rows':[]};var _0x4b0605=_[_0x8bcb('0x2e')](db[_0x8bcb('0x2f')][_0x8bcb('0x30')],function(_0x5a6e85){return{'name':_0x5a6e85[_0x8bcb('0x31')],'type':_0x5a6e85[_0x8bcb('0x32')][_0x8bcb('0x33')]};});_0x2994fa[_0x8bcb('0x34')]=_[_0x8bcb('0x2e')](_0x4b0605,_0x8bcb('0x2c'));_0x2994fa[_0x8bcb('0x35')]=_[_0x8bcb('0x36')](_0x2a6104[_0x8bcb('0x35')]);_0x2994fa[_0x8bcb('0x37')]=_[_0x8bcb('0x38')](_0x2994fa[_0x8bcb('0x34')],_0x2994fa['query']);_0x2c1ee4[_0x8bcb('0x39')]=_['intersection'](_0x2994fa[_0x8bcb('0x34')],qs[_0x8bcb('0x3a')](_0x2a6104['query'][_0x8bcb('0x3a')]));_0x2c1ee4['attributes']=_0x2c1ee4[_0x8bcb('0x39')]['length']?_0x2c1ee4[_0x8bcb('0x39')]:_0x2994fa[_0x8bcb('0x34')];if(!_0x2a6104[_0x8bcb('0x35')][_0x8bcb('0x3b')]('nolimit')){_0x2c1ee4[_0x8bcb('0x1d')]=qs[_0x8bcb('0x1d')](_0x2a6104[_0x8bcb('0x35')][_0x8bcb('0x1d')]);_0x2c1ee4['offset']=qs[_0x8bcb('0x1e')](_0x2a6104[_0x8bcb('0x35')][_0x8bcb('0x1e')]);}_0x2c1ee4['order']=qs['sort'](_0x2a6104['query'][_0x8bcb('0x3c')]);_0x2c1ee4['where']=qs[_0x8bcb('0x37')](_['pick'](_0x2a6104[_0x8bcb('0x35')],_0x2994fa[_0x8bcb('0x37')]),_0x4b0605);if(_0x2a6104['query']['filter']){_0x2c1ee4[_0x8bcb('0x3d')]=_[_0x8bcb('0x3e')](_0x2c1ee4['where'],{'$or':_['map'](_0x4b0605,function(_0x219501){if(_0x219501[_0x8bcb('0x32')]!==_0x8bcb('0x3f')){var _0x11a6fb={};_0x11a6fb[_0x219501[_0x8bcb('0x2c')]]={'$like':'%'+_0x2a6104['query'][_0x8bcb('0x40')]+'%'};return _0x11a6fb;}})});}_0x2c1ee4=_['merge']({},_0x2c1ee4,_0x2a6104[_0x8bcb('0x41')]);var _0x1eea8d={'where':_0x2c1ee4[_0x8bcb('0x3d')]};return db['SmsApplication'][_0x8bcb('0x1f')](_0x1eea8d)['then'](function(_0x3a7490){_0x4e7250[_0x8bcb('0x1f')]=_0x3a7490;if(_0x2a6104[_0x8bcb('0x35')][_0x8bcb('0x42')]){_0x2c1ee4[_0x8bcb('0x43')]=[{'all':!![]}];}return db[_0x8bcb('0x2f')]['findAll'](_0x2c1ee4);})['then'](function(_0x55649d){_0x4e7250[_0x8bcb('0x44')]=_0x55649d;return _0x4e7250;})[_0x8bcb('0x27')](respondWithFilteredResult(_0x483f34,_0x2c1ee4))[_0x8bcb('0x45')](handleError(_0x483f34,null));};exports[_0x8bcb('0x46')]=function(_0xc882d6,_0x51309a){var _0xd6afb1={'raw':!![],'where':{'id':_0xc882d6[_0x8bcb('0x47')]['id']}},_0x68992e={};_0x68992e[_0x8bcb('0x34')]=_['keys'](db[_0x8bcb('0x2f')][_0x8bcb('0x30')]);_0x68992e[_0x8bcb('0x35')]=_[_0x8bcb('0x36')](_0xc882d6[_0x8bcb('0x35')]);_0x68992e['filters']=_[_0x8bcb('0x38')](_0x68992e[_0x8bcb('0x34')],_0x68992e['query']);_0xd6afb1['attributes']=_['intersection'](_0x68992e[_0x8bcb('0x34')],qs[_0x8bcb('0x3a')](_0xc882d6[_0x8bcb('0x35')][_0x8bcb('0x3a')]));_0xd6afb1[_0x8bcb('0x39')]=_0xd6afb1['attributes'][_0x8bcb('0x48')]?_0xd6afb1[_0x8bcb('0x39')]:_0x68992e[_0x8bcb('0x34')];if(_0xc882d6['query'][_0x8bcb('0x42')]){_0xd6afb1['include']=[{'all':!![]}];}_0xd6afb1=_[_0x8bcb('0x3e')]({},_0xd6afb1,_0xc882d6[_0x8bcb('0x41')]);return db['SmsApplication'][_0x8bcb('0x49')](_0xd6afb1)[_0x8bcb('0x27')](handleEntityNotFound(_0x51309a,null))['then'](respondWithResult(_0x51309a,null))[_0x8bcb('0x45')](handleError(_0x51309a,null));};exports['create']=function(_0x4f91f4,_0x4c722f){return db[_0x8bcb('0x2f')][_0x8bcb('0x4a')](_0x4f91f4[_0x8bcb('0x4b')],{})[_0x8bcb('0x27')](respondWithResult(_0x4c722f,0xc9))[_0x8bcb('0x45')](handleError(_0x4c722f,null));};exports[_0x8bcb('0x25')]=function(_0xbad065,_0x3e5c71){if(_0xbad065[_0x8bcb('0x4b')]['id']){delete _0xbad065[_0x8bcb('0x4b')]['id'];}return db[_0x8bcb('0x2f')]['find']({'where':{'id':_0xbad065[_0x8bcb('0x47')]['id']}})[_0x8bcb('0x27')](handleEntityNotFound(_0x3e5c71,null))['then'](saveUpdates(_0xbad065[_0x8bcb('0x4b')],null))[_0x8bcb('0x27')](respondWithResult(_0x3e5c71,null))[_0x8bcb('0x45')](handleError(_0x3e5c71,null));};exports[_0x8bcb('0x26')]=function(_0x54ba76,_0x49edd5){return db['SmsApplication'][_0x8bcb('0x49')]({'where':{'id':_0x54ba76[_0x8bcb('0x47')]['id']}})[_0x8bcb('0x27')](handleEntityNotFound(_0x49edd5,null))['then'](removeEntity(_0x49edd5,null))['catch'](handleError(_0x49edd5,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3953d98..db31be8 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 _0xc2d6=['../../config/environment','./smsApplication.attributes','define','sms_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1065b5,_0x697ee8){var _0x4be030=function(_0xe63f8e){while(--_0xe63f8e){_0x1065b5['push'](_0x1065b5['shift']());}};_0x4be030(++_0x697ee8);}(_0xc2d6,0x171));var _0x6c2d=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc2d6[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require(_0x6c2d('0x0'));var logger=require(_0x6c2d('0x1'))(_0x6c2d('0x2'));var moment=require(_0x6c2d('0x3'));var BPromise=require(_0x6c2d('0x4'));var rp=require(_0x6c2d('0x5'));var fs=require('fs');var path=require(_0x6c2d('0x6'));var rimraf=require(_0x6c2d('0x7'));var config=require(_0x6c2d('0x8'));var attributes=require(_0x6c2d('0x9'));module['exports']=function(_0x1141f7,_0x3cf33f){return _0x1141f7[_0x6c2d('0xa')]('SmsApplication',attributes,{'tableName':_0x6c2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6c2d('0xc')});}; \ No newline at end of file +var _0x36e2=['exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1b046f,_0x8e5fa6){var _0x1f6c8f=function(_0x4a2f64){while(--_0x4a2f64){_0x1b046f['push'](_0x1b046f['shift']());}};_0x1f6c8f(++_0x8e5fa6);}(_0x36e2,0x64));var _0x236e=function(_0xc6136c,_0x2113b8){_0xc6136c=_0xc6136c-0x0;var _0x210956=_0x36e2[_0xc6136c];return _0x210956;};'use strict';var _=require('lodash');var util=require(_0x236e('0x0'));var logger=require(_0x236e('0x1'))(_0x236e('0x2'));var moment=require(_0x236e('0x3'));var BPromise=require(_0x236e('0x4'));var rp=require(_0x236e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x236e('0x6'));var config=require(_0x236e('0x7'));var attributes=require('./smsApplication.attributes');module[_0x236e('0x8')]=function(_0x4a328f,_0x39cbe6){return _0x4a328f['define']('SmsApplication',attributes,{'tableName':_0x236e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x236e('0xa'),'collate':_0x236e('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 3488aa3..bdb8b3f 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 _0xd1ca=['../../mysqldb','../../config/utils','rpc','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','ioredis'];(function(_0x42b30f,_0x1cb512){var _0x3ef487=function(_0x46ff6c){while(--_0x46ff6c){_0x42b30f['push'](_0x42b30f['shift']());}};_0x3ef487(++_0x1cb512);}(_0xd1ca,0x140));var _0xad1c=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xd1ca[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require('../../config/logger')(_0xad1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad1c('0x6')][_0xad1c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3953ef,_0x5eb923,_0x353097){return new BPromise(function(_0x51b05c,_0x45bfc8){return client[_0xad1c('0x8')](_0x3953ef,_0x353097)[_0xad1c('0x9')](function(_0x8238ed){logger[_0xad1c('0xa')](_0xad1c('0xb'),_0x5eb923,_0xad1c('0xc'));logger[_0xad1c('0xd')](_0xad1c('0xe'),_0x5eb923,_0xad1c('0xc'),JSON['stringify'](_0x8238ed));if(_0x8238ed[_0xad1c('0xf')]){if(_0x8238ed[_0xad1c('0xf')]['code']===0x1f4){logger[_0xad1c('0xf')](_0xad1c('0xb'),_0x5eb923,_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);return _0x45bfc8(_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);}logger[_0xad1c('0xf')]('SmsApplication,\x20%s,\x20%s',_0x5eb923,_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);return _0x51b05c(_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);}else{logger[_0xad1c('0xa')]('SmsApplication,\x20%s,\x20%s',_0x5eb923,_0xad1c('0xc'));_0x51b05c(_0x8238ed[_0xad1c('0x11')][_0xad1c('0x10')]);}})[_0xad1c('0x12')](function(_0x4aa785){logger[_0xad1c('0xf')]('SmsApplication,\x20%s,\x20%s',_0x5eb923,_0x4aa785);_0x45bfc8(_0x4aa785);});});} \ No newline at end of file +var _0xd5a2=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0x3d3c7f,_0x1c76ba){var _0x455722=function(_0x4f5ca8){while(--_0x4f5ca8){_0x3d3c7f['push'](_0x3d3c7f['shift']());}};_0x455722(++_0x1c76ba);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x3f84ce,_0x48b0af){_0x3f84ce=_0x3f84ce-0x0;var _0x5a1676=_0xd5a2[_0x3f84ce];return _0x5a1676;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));var BPromise=require(_0x2d5a('0x2'));var rs=require(_0x2d5a('0x3'));var fs=require('fs');var Redis=require(_0x2d5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d5a('0x5'));var logger=require(_0x2d5a('0x6'))(_0x2d5a('0x7'));var config=require(_0x2d5a('0x8'));var jayson=require(_0x2d5a('0x9'));var client=jayson[_0x2d5a('0xa')][_0x2d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ae103,_0x1cdfc4,_0x7eb4c3){return new BPromise(function(_0x79898c,_0x4d5c52){return client['request'](_0x1ae103,_0x7eb4c3)[_0x2d5a('0xc')](function(_0x562b6a){logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,'request\x20sent');logger[_0x2d5a('0xf')](_0x2d5a('0x10'),_0x1cdfc4,_0x2d5a('0x11'),JSON[_0x2d5a('0x12')](_0x562b6a));if(_0x562b6a[_0x2d5a('0x13')]){if(_0x562b6a['error'][_0x2d5a('0x14')]===0x1f4){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x4d5c52(_0x562b6a['error'][_0x2d5a('0x15')]);}logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x79898c(_0x562b6a[_0x2d5a('0x13')][_0x2d5a('0x15')]);}else{logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,_0x2d5a('0x11'));_0x79898c(_0x562b6a['result'][_0x2d5a('0x15')]);}})[_0x2d5a('0x16')](function(_0x38de62){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x38de62);_0x4d5c52(_0x38de62);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index d429e3a..3df6d09 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 _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0x1c4e51,_0x1c7db9){var _0x15c865=function(_0x35d98f){while(--_0x35d98f){_0x1c4e51['push'](_0x1c4e51['shift']());}};_0x15c865(++_0x1c7db9);}(_0x13f6,0x124));var _0x613f=function(_0x1e25eb,_0x592a17){_0x1e25eb=_0x1e25eb-0x0;var _0x52b446=_0x13f6[_0x1e25eb];return _0x52b446;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['get'](_0x613f('0xf'),auth[_0x613f('0x8')](),controller[_0x613f('0x10')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),interaction[_0x613f('0x15')](_0x613f('0x16'),_0x613f('0x17')),controller[_0x613f('0x18')]);router[_0x613f('0x19')](_0x613f('0xb'),auth['isAuthenticated'](),interaction[_0x613f('0x15')]('sms','smsinteraction:update'),controller[_0x613f('0x1a')]);router[_0x613f('0x1b')]('/:id',auth[_0x613f('0x8')](),interaction['tracked'](_0x613f('0x16'),_0x613f('0x1c')),controller[_0x613f('0x1d')]);router[_0x613f('0x1b')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0x1eba[_0xfb0cfd];return _0x2fd8aa;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 8d66921..8436c1e 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 _0xe5af=['ENUM','out','BOOLEAN','INTEGER','moment','exports','DATE','STRING'];(function(_0x2762b5,_0x571119){var _0x2a09b5=function(_0x1e6151){while(--_0x1e6151){_0x2762b5['push'](_0x2762b5['shift']());}};_0x2a09b5(++_0x571119);}(_0xe5af,0x9c));var _0xfe5a=function(_0x13a27c,_0x3b0c0a){_0x13a27c=_0x13a27c-0x0;var _0x55628c=_0xe5af[_0x13a27c];return _0x55628c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe5a('0x0'));module[_0xfe5a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfe5a('0x2')]},'disposition':{'type':Sequelize[_0xfe5a('0x3')]},'secondDisposition':{'type':Sequelize[_0xfe5a('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfe5a('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xfe5a('0x4')]('in',_0xfe5a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfe5a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfe5a('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfe5a('0x7')]}}; \ No newline at end of file +var _0xa49b=['BOOLEAN','DATE','STRING','ENUM','out','INTEGER','moment','exports'];(function(_0x5cd1c8,_0xef075f){var _0x948379=function(_0x402136){while(--_0x402136){_0x5cd1c8['push'](_0x5cd1c8['shift']());}};_0x948379(++_0xef075f);}(_0xa49b,0x126));var _0xba49=function(_0x3b3a8e,_0x2549bd){_0x3b3a8e=_0x3b3a8e-0x0;var _0xbf80d2=_0xa49b[_0x3b3a8e];return _0xbf80d2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xba49('0x0'));module[_0xba49('0x1')]={'closed':{'type':Sequelize[_0xba49('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xba49('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xba49('0x4')]},'thirdDisposition':{'type':Sequelize[_0xba49('0x4')]},'note':{'type':Sequelize[_0xba49('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xba49('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xba49('0x5')]('in',_0xba49('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xba49('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xba49('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xba49('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 28d8d45..2c4900d 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 _0x1131=['root','files','tmp','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','System','out','renderFile','views','downloadInteraction.ejs','transcript-','log','err','rimraf','zip-dir','bluebird','util','path','lodash','../../components/export/pdf','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','offset','undefined','count','limit','status','Content-Range','json','update','then','destroy','name','map','rawAttributes','fieldName','type','key','query','user','catch','show','params','keys','SmsInteraction','filters','intersection','model','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','includeAll','findAll','rows','addTags','spread','Tag','color','smsInteractionTags:save','download','unix','toString','join'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1131,0x90));var _0x1113=function(_0x334660,_0x2f2f8d){_0x334660=_0x334660-0x0;var _0x2062ae=_0x1131[_0x334660];return _0x2062ae;};'use strict';var rimraf=require(_0x1113('0x0'));var zipdir=require(_0x1113('0x1'));var moment=require('moment');var BPromise=require(_0x1113('0x2'));var util=require(_0x1113('0x3'));var path=require(_0x1113('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1113('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x1113('0x6'));var logger=require('../../config/logger')('api');var config=require(_0x1113('0x7'));var db=require(_0x1113('0x8'))['db'];config['redis']=_[_0x1113('0x9')](config[_0x1113('0xa')],{'host':_0x1113('0xb'),'port':0x18eb});var socket=require(_0x1113('0xc'))(new Redis(config[_0x1113('0xa')]));require(_0x1113('0xd'))[_0x1113('0xe')](socket);function respondWithStatusCode(_0x3f3295,_0x5cd2a7){_0x5cd2a7=_0x5cd2a7||0xcc;return function(_0x30b292){if(_0x30b292){return _0x3f3295[_0x1113('0xf')](_0x5cd2a7);}return _0x3f3295['status'](_0x5cd2a7)[_0x1113('0x10')]();};}function respondWithResult(_0x4e4eab,_0x2e1589){_0x2e1589=_0x2e1589||0xc8;return function(_0xc8cc39){if(_0xc8cc39){return _0x4e4eab['status'](_0x2e1589)['json'](_0xc8cc39);}};}function respondWithFilteredResult(_0x30d373,_0x24daf8){return function(_0x3cfc91){if(_0x3cfc91){var _0x13f2b5=typeof _0x24daf8[_0x1113('0x11')]===_0x1113('0x12')&&typeof _0x24daf8['limit']===_0x1113('0x12');var _0x578ed7=_0x3cfc91[_0x1113('0x13')];var _0x34a995=_0x13f2b5?0x0:_0x24daf8[_0x1113('0x11')];var _0x4d952e=_0x13f2b5?_0x3cfc91[_0x1113('0x13')]:_0x24daf8[_0x1113('0x11')]+_0x24daf8[_0x1113('0x14')];var _0x3eee4c;if(_0x4d952e>=_0x578ed7){_0x4d952e=_0x578ed7;_0x3eee4c=0xc8;}else{_0x3eee4c=0xce;}_0x30d373[_0x1113('0x15')](_0x3eee4c);return _0x30d373['set'](_0x1113('0x16'),_0x34a995+'-'+_0x4d952e+'/'+_0x578ed7)[_0x1113('0x17')](_0x3cfc91);}return null;};}function saveUpdates(_0x14f61f){return function(_0x1cbd33){if(_0x1cbd33){return _0x1cbd33[_0x1113('0x18')](_0x14f61f)[_0x1113('0x19')](function(_0xe292a9){return _0xe292a9;});}return null;};}function removeEntity(_0x378e45){return function(_0x52fee6){if(_0x52fee6){return _0x52fee6[_0x1113('0x1a')]()['then'](function(){_0x378e45['status'](0xcc)[_0x1113('0x10')]();});}};}function handleEntityNotFound(_0x4b8de9){return function(_0x53e8a0){if(!_0x53e8a0){_0x4b8de9[_0x1113('0xf')](0x194);}return _0x53e8a0;};}function handleError(_0x2d0942,_0x268a3c){_0x268a3c=_0x268a3c||0x1f4;return function(_0x4c7d3b){logger['error'](_0x4c7d3b['stack']);if(_0x4c7d3b[_0x1113('0x1b')]){delete _0x4c7d3b[_0x1113('0x1b')];}_0x2d0942['status'](_0x268a3c)['send'](_0x4c7d3b);};}exports['index']=function(_0x4a5621,_0x3340f4){var _0x1be8cf={};var _0x1c7a47=_[_0x1113('0x1c')](db['SmsInteraction'][_0x1113('0x1d')],function(_0x4768d1){return{'name':_0x4768d1[_0x1113('0x1e')],'type':_0x4768d1[_0x1113('0x1f')][_0x1113('0x20')]};});_0x1be8cf=qs['getOptions'](_0x1c7a47,_0x4a5621);return interaction['findAll']('sms',_0x4a5621[_0x1113('0x21')],_0x4a5621[_0x1113('0x22')],_0x1be8cf,_0x1c7a47)[_0x1113('0x19')](respondWithFilteredResult(_0x3340f4,_0x1be8cf))[_0x1113('0x23')](handleError(_0x3340f4,null));};exports[_0x1113('0x24')]=function(_0x4c32a8,_0x2d2bca){var _0x1dbcf6={'raw':![],'where':{'id':_0x4c32a8[_0x1113('0x25')]['id']}},_0x15d6d8={};_0x15d6d8['model']=_[_0x1113('0x26')](db[_0x1113('0x27')]['rawAttributes']);_0x15d6d8[_0x1113('0x21')]=_[_0x1113('0x26')](_0x4c32a8[_0x1113('0x21')]);_0x15d6d8[_0x1113('0x28')]=_[_0x1113('0x29')](_0x15d6d8[_0x1113('0x2a')],_0x15d6d8[_0x1113('0x21')]);_0x1dbcf6[_0x1113('0x2b')]=_[_0x1113('0x29')](_0x15d6d8['model'],qs['fields'](_0x4c32a8[_0x1113('0x21')][_0x1113('0x2c')]));_0x1dbcf6[_0x1113('0x2b')]=_0x1dbcf6[_0x1113('0x2b')][_0x1113('0x2d')]?_0x1dbcf6[_0x1113('0x2b')]:_0x15d6d8[_0x1113('0x2a')];if(_0x4c32a8[_0x1113('0x21')]['includeAll']){_0x1dbcf6[_0x1113('0x2e')]=[{'all':!![]}];}_0x1dbcf6=_[_0x1113('0x2f')]({},_0x1dbcf6,_0x4c32a8[_0x1113('0x30')]);return db['SmsInteraction'][_0x1113('0x31')](_0x1dbcf6)[_0x1113('0x19')](handleEntityNotFound(_0x2d2bca,null))['then'](respondWithResult(_0x2d2bca,null))['catch'](handleError(_0x2d2bca,null));};exports[_0x1113('0x32')]=function(_0xcebd5c,_0x454fb6){return db[_0x1113('0x27')][_0x1113('0x32')](_0xcebd5c[_0x1113('0x33')],{})[_0x1113('0x19')](respondWithResult(_0x454fb6,0xc9))[_0x1113('0x23')](handleError(_0x454fb6,null));};exports['update']=function(_0x57f748,_0x210645){if(_0x57f748['body']['id']){delete _0x57f748[_0x1113('0x33')]['id'];}return db[_0x1113('0x27')][_0x1113('0x31')]({'where':{'id':_0x57f748[_0x1113('0x25')]['id']}})['then'](handleEntityNotFound(_0x210645,null))['then'](saveUpdates(_0x57f748[_0x1113('0x33')],null))[_0x1113('0x19')](respondWithResult(_0x210645,null))[_0x1113('0x23')](handleError(_0x210645,null));};exports[_0x1113('0x1a')]=function(_0x222261,_0x39c173){return db[_0x1113('0x27')][_0x1113('0x31')]({'where':{'id':_0x222261[_0x1113('0x25')]['id']}})[_0x1113('0x19')](handleEntityNotFound(_0x39c173,null))[_0x1113('0x19')](removeEntity(_0x39c173,null))['catch'](handleError(_0x39c173,null));};exports[_0x1113('0x34')]=function(_0x4b90d4,_0x2c23f9){return db[_0x1113('0x27')]['describe']()[_0x1113('0x19')](respondWithResult(_0x2c23f9,null))[_0x1113('0x23')](handleError(_0x2c23f9,null));};exports[_0x1113('0x35')]=function(_0x4861b8,_0x2d08bd){return db[_0x1113('0x36')]['find']({'where':{'id':_0x4861b8[_0x1113('0x25')]['id']}})[_0x1113('0x19')](handleEntityNotFound(_0x2d08bd,null))[_0x1113('0x19')](function(_0x4dc143){if(_0x4dc143){return _0x4dc143[_0x1113('0x35')](_0x4861b8[_0x1113('0x33')][_0x1113('0x37')],_['omit'](_0x4861b8['body'],[_0x1113('0x37'),'id'])||{});}})[_0x1113('0x19')](respondWithResult(_0x2d08bd,null))['catch'](handleError(_0x2d08bd,null));};exports[_0x1113('0x38')]=function(_0xc7bef9,_0x1d0a44){var _0x6b3ab3={'raw':![],'where':{}};var _0x909512={};var _0x428949={'count':0x0,'rows':[]};return db[_0x1113('0x27')][_0x1113('0x39')]({'where':{'id':_0xc7bef9[_0x1113('0x25')]['id']}})[_0x1113('0x19')](handleEntityNotFound(_0x1d0a44,null))['then'](function(_0x321505){if(_0x321505){_0x909512[_0x1113('0x2a')]=_['keys'](db[_0x1113('0x36')][_0x1113('0x1d')]);_0x909512['query']=_[_0x1113('0x26')](_0xc7bef9[_0x1113('0x21')]);_0x909512[_0x1113('0x28')]=_[_0x1113('0x29')](_0x909512[_0x1113('0x2a')],_0x909512[_0x1113('0x21')]);_0x6b3ab3[_0x1113('0x2b')]=_[_0x1113('0x29')](_0x909512['model'],qs['fields'](_0xc7bef9[_0x1113('0x21')]['fields']));_0x6b3ab3[_0x1113('0x2b')]=_0x6b3ab3[_0x1113('0x2b')][_0x1113('0x2d')]?_0x6b3ab3[_0x1113('0x2b')]:_0x909512[_0x1113('0x2a')];if(!_0xc7bef9[_0x1113('0x21')]['hasOwnProperty'](_0x1113('0x3a'))){_0x6b3ab3[_0x1113('0x14')]=qs[_0x1113('0x14')](_0xc7bef9[_0x1113('0x21')][_0x1113('0x14')]);_0x6b3ab3[_0x1113('0x11')]=qs[_0x1113('0x11')](_0xc7bef9[_0x1113('0x21')][_0x1113('0x11')]);}_0x6b3ab3[_0x1113('0x3b')]=qs[_0x1113('0x3c')](_0xc7bef9[_0x1113('0x21')][_0x1113('0x3c')]);_0x6b3ab3[_0x1113('0x3d')]=qs[_0x1113('0x28')](_[_0x1113('0x3e')](_0xc7bef9[_0x1113('0x21')],_0x909512[_0x1113('0x28')]));_0x6b3ab3['where'][_0x1113('0x3f')]=_0x321505['id'];if(_0xc7bef9[_0x1113('0x21')][_0x1113('0x40')]){_0x6b3ab3[_0x1113('0x3d')]=_[_0x1113('0x2f')](_0x6b3ab3[_0x1113('0x3d')],{'$or':_[_0x1113('0x1c')](_0x6b3ab3[_0x1113('0x2b')],function(_0x50ba82){var _0x3e60ce={};_0x3e60ce[_0x50ba82]={'$like':'%'+_0xc7bef9[_0x1113('0x21')]['filter']+'%'};return _0x3e60ce;})});}if(_0xc7bef9[_0x1113('0x21')]['$gte']){var _0x1cc0b0=_0xc7bef9['query'][_0x1113('0x41')][_0x1113('0x42')](',');var _0x4693bc={};_0x4693bc[_0x1cc0b0[0x0]]={'$gte':moment(_0x1cc0b0[0x1])[_0x1113('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0x6b3ab3[_0x1113('0x3d')]=_['merge'](_0x6b3ab3[_0x1113('0x3d')],_0x4693bc);}_0x6b3ab3=_['merge']({},_0x6b3ab3,_0xc7bef9[_0x1113('0x30')]);return db['SmsMessage'][_0x1113('0x13')]({'where':_0x6b3ab3[_0x1113('0x3d')]})[_0x1113('0x19')](function(_0x3e3517){_0x428949[_0x1113('0x13')]=_0x3e3517;if(_0xc7bef9['query'][_0x1113('0x44')]){_0x6b3ab3[_0x1113('0x2e')]=[{'all':!![]}];}return db[_0x1113('0x36')][_0x1113('0x45')](_0x6b3ab3);})[_0x1113('0x19')](function(_0xb6a0ce){_0x428949[_0x1113('0x46')]=_0xb6a0ce;return _0x428949;});}})[_0x1113('0x19')](respondWithFilteredResult(_0x1d0a44,_0x6b3ab3))[_0x1113('0x23')](handleError(_0x1d0a44,null));};exports[_0x1113('0x47')]=function(_0x143bce,_0x548940){return db['SmsInteraction'][_0x1113('0x31')]({'where':{'id':_0x143bce['params']['id']}})['then'](handleEntityNotFound(_0x548940,null))['then'](function(_0xf19fd2){if(_0xf19fd2){return _0xf19fd2['setTags'](_0x143bce[_0x1113('0x33')][_0x1113('0x37')],_['omit'](_0x143bce[_0x1113('0x33')],['ids','id'])||{})[_0x1113('0x48')](function(){return db[_0x1113('0x49')]['findAll']({'attributes':['id',_0x1113('0x1b'),_0x1113('0x4a')],'where':{'id':_0x143bce[_0x1113('0x33')][_0x1113('0x37')]}});})[_0x1113('0x19')](function(_0x1d5056){socket['emit'](_0x1113('0x4b'),{'id':Number(_0x143bce[_0x1113('0x25')]['id']),'tags':_0x1d5056||[]});return{'id':Number(_0x143bce[_0x1113('0x25')]['id']),'tags':_0x1d5056||[]};});}})[_0x1113('0x19')](respondWithResult(_0x548940,null))['catch'](handleError(_0x548940,null));};exports['removeTags']=function(_0x32a2f1,_0x4ac11e){return db[_0x1113('0x27')]['find']({'where':{'id':_0x32a2f1[_0x1113('0x25')]['id']}})[_0x1113('0x19')](handleEntityNotFound(_0x4ac11e,null))[_0x1113('0x19')](function(_0x4bbe5e){if(_0x4bbe5e){return _0x4bbe5e['removeTags'](_0x32a2f1['query'][_0x1113('0x37')]);}})['then'](respondWithStatusCode(_0x4ac11e,null))[_0x1113('0x23')](handleError(_0x4ac11e,null));};exports[_0x1113('0x4c')]=function(_0x25d39d,_0x587a60){var _0x1dad78=moment()[_0x1113('0x4d')]()[_0x1113('0x4e')]();var _0x26dfca=path[_0x1113('0x4f')](config[_0x1113('0x50')],'server',_0x1113('0x51'),_0x1113('0x52'));var _0xb82c9f=path[_0x1113('0x4f')](_0x26dfca,_0x1dad78);var _0x4195c4=util[_0x1113('0x43')]('transcript-%d-%s.zip',_0x25d39d[_0x1113('0x25')]['id'],_0x1dad78);var _0x23342a=path[_0x1113('0x4f')](_0x26dfca,_0x4195c4);var _0x12a835=[];_0x12a835[_0x1113('0x53')]({'model':db[_0x1113('0x54')],'as':_0x1113('0x54'),'attributes':['id',_0x1113('0x55')],'raw':!![]});_0x12a835[_0x1113('0x53')]({'model':db[_0x1113('0x56')],'as':_0x1113('0x57'),'attributes':['id',_0x1113('0x58'),_0x1113('0x59')],'raw':!![]});var _0x56f91f=[{'model':db[_0x1113('0x36')],'as':_0x1113('0x5a'),'attributes':['id',_0x1113('0x33'),_0x1113('0x5b'),_0x1113('0x5c'),_0x1113('0x5d'),_0x1113('0x5e')],'include':_0x12a835}];_0x56f91f[_0x1113('0x53')]({'model':db[_0x1113('0x5f')],'as':_0x1113('0x60'),'attributes':['id',_0x1113('0x1b')]});_0x56f91f[_0x1113('0x53')]({'model':db[_0x1113('0x54')],'as':_0x1113('0x61'),'attributes':['id',_0x1113('0x55')]});return db[_0x1113('0x27')][_0x1113('0x31')]({'where':{'id':_0x25d39d['params']['id']},'include':_0x56f91f})['then'](handleEntityNotFound(_0x587a60,null))[_0x1113('0x19')](function(_0x35cb3c){if(_0x35cb3c){var _0x5862c4=_0x35cb3c['get']({'plain':!![]});fs[_0x1113('0x62')](_0xb82c9f);var _0xf84382={'channel':_0x1113('0x63'),'account':_0x5862c4[_0x1113('0x60')][_0x1113('0x1b')],'agent':_0x5862c4[_0x1113('0x61')]?_0x5862c4[_0x1113('0x61')][_0x1113('0x55')]:_0x1113('0x64'),'createdAt':moment(_0x5862c4[_0x1113('0x5b')])[_0x1113('0x43')](_0x1113('0x65'))['toString'](),'closedAt':_0x5862c4[_0x1113('0x66')]?moment(_0x5862c4['closedAt'])[_0x1113('0x43')](_0x1113('0x65'))[_0x1113('0x4e')]():'','disposition':_0x5862c4[_0x1113('0x67')],'messages':_(_0x5862c4[_0x1113('0x5a')])[_0x1113('0x40')]({'secret':![]})[_0x1113('0x1c')](function(_0x1c7251){return{'date':moment(_0x1c7251['createdAt'])[_0x1113('0x43')](_0x1113('0x65'))[_0x1113('0x4e')](),'sender':_0x1c7251[_0x1113('0x5c')]==='out'?_0x1c7251[_0x1113('0x54')]?_0x1c7251['User'][_0x1113('0x55')]:_0x1113('0x68'):_0x1c7251[_0x1113('0x57')][_0x1113('0x58')]+(_0x1c7251[_0x1113('0x57')][_0x1113('0x59')]?'\x20'+_0x1c7251[_0x1113('0x57')]['lastName']:''),'body':_0x1c7251[_0x1113('0x33')],'direction':_0x1c7251[_0x1113('0x5c')]===_0x1113('0x69')?'A':'C','secret':_0x1c7251[_0x1113('0x5d')],'read':_0x1c7251[_0x1113('0x5e')]};})['value']()};return ejs[_0x1113('0x6a')](path['join'](config[_0x1113('0x50')],'server',_0x1113('0x6b'),_0x1113('0x6c')),{'interaction':_0xf84382})['then'](function(_0x32d356){var _0x15a342=path[_0x1113('0x4f')](_0xb82c9f,_0x1113('0x6d')+_0x5862c4['id']+'-'+_0x1dad78+'.pdf');var _0x4b4e64={'path':_0x15a342,'channel':_0x1113('0x63'),'interactionId':_0x5862c4['id']};return pdf['createPdfFromHTML'](_0x32d356,_0x4b4e64);})['then'](function(){return new BPromise(function(_0x22941f,_0x313fd6){zipdir(_0xb82c9f,{'saveTo':_0x23342a},function(_0x393a49,_0x4d45fa){if(_0x393a49)return _0x313fd6(_0x393a49);return _0x22941f(_0x4d45fa);});})[_0x1113('0x19')](function(){return new BPromise(function(_0x548706,_0x49daa3){rimraf(_0xb82c9f,function(_0xf39e2){if(_0xf39e2)_0x49daa3(_0xf39e2);return _0x548706();});});})['then'](function(){return _0x587a60[_0x1113('0x4c')](_0x23342a,_0x4195c4,function(_0x223683){if(_0x223683){console[_0x1113('0x6e')](_0x1113('0x6f'),_0x223683);}else{fs['unlinkSync'](_0x23342a);}});});});}else{return _0x587a60['sendStatus'](0xc8);}})['catch'](handleError(_0x587a60,null));}; \ No newline at end of file +var _0x7850=['unlinkSync','rimraf','zip-dir','moment','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','then','destroy','send','index','SmsInteraction','findAll','sms','query','user','catch','params','model','keys','rawAttributes','filters','attributes','intersection','fields','includeAll','include','merge','options','find','create','body','update','describe','addMessage','ids','getMessages','findOne','length','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','rows','addTags','setTags','omit','spread','Tag','name','emit','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','User','fullname','CmContact','Contact','lastName','Messages','createdAt','direction','secret','read','push','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt','disposition','map','firstName','out','value','renderFile','views','transcript-','createPdfFromHTML','err'];(function(_0x49bb70,_0x81f90e){var _0x3b0d52=function(_0x3b5ddc){while(--_0x3b5ddc){_0x49bb70['push'](_0x49bb70['shift']());}};_0x3b0d52(++_0x81f90e);}(_0x7850,0x1e1));var _0x0785=function(_0x147a04,_0x173f22){_0x147a04=_0x147a04-0x0;var _0x18fff2=_0x7850[_0x147a04];return _0x18fff2;};'use strict';var rimraf=require(_0x0785('0x0'));var zipdir=require(_0x0785('0x1'));var moment=require(_0x0785('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x0785('0x3'));var ejs=require(_0x0785('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0785('0x5'));var interaction=require(_0x0785('0x6'));var qs=require(_0x0785('0x7'));var pdf=require(_0x0785('0x8'));var logger=require(_0x0785('0x9'))(_0x0785('0xa'));var config=require(_0x0785('0xb'));var db=require(_0x0785('0xc'))['db'];config[_0x0785('0xd')]=_[_0x0785('0xe')](config[_0x0785('0xd')],{'host':_0x0785('0xf'),'port':0x18eb});var socket=require(_0x0785('0x10'))(new Redis(config[_0x0785('0xd')]));require(_0x0785('0x11'))[_0x0785('0x12')](socket);function respondWithStatusCode(_0x30185d,_0x23a54b){_0x23a54b=_0x23a54b||0xcc;return function(_0x5b2056){if(_0x5b2056){return _0x30185d[_0x0785('0x13')](_0x23a54b);}return _0x30185d[_0x0785('0x14')](_0x23a54b)[_0x0785('0x15')]();};}function respondWithResult(_0x385e13,_0x23311a){_0x23311a=_0x23311a||0xc8;return function(_0x2c5e8c){if(_0x2c5e8c){return _0x385e13[_0x0785('0x14')](_0x23311a)['json'](_0x2c5e8c);}};}function respondWithFilteredResult(_0x5c72d2,_0x2e9da6){return function(_0xc9179f){if(_0xc9179f){var _0x589362=typeof _0x2e9da6['offset']===_0x0785('0x16')&&typeof _0x2e9da6[_0x0785('0x17')]===_0x0785('0x16');var _0x4c76f7=_0xc9179f[_0x0785('0x18')];var _0x53ea15=_0x589362?0x0:_0x2e9da6[_0x0785('0x19')];var _0x341ece=_0x589362?_0xc9179f[_0x0785('0x18')]:_0x2e9da6['offset']+_0x2e9da6[_0x0785('0x17')];var _0x370de8;if(_0x341ece>=_0x4c76f7){_0x341ece=_0x4c76f7;_0x370de8=0xc8;}else{_0x370de8=0xce;}_0x5c72d2[_0x0785('0x14')](_0x370de8);return _0x5c72d2[_0x0785('0x1a')](_0x0785('0x1b'),_0x53ea15+'-'+_0x341ece+'/'+_0x4c76f7)[_0x0785('0x1c')](_0xc9179f);}return null;};}function saveUpdates(_0x45c69f){return function(_0x36bed2){if(_0x36bed2){return _0x36bed2['update'](_0x45c69f)[_0x0785('0x1d')](function(_0x4cfda9){return _0x4cfda9;});}return null;};}function removeEntity(_0x197746){return function(_0xc842e7){if(_0xc842e7){return _0xc842e7[_0x0785('0x1e')]()[_0x0785('0x1d')](function(){_0x197746[_0x0785('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4901b4){return function(_0x1d8c55){if(!_0x1d8c55){_0x4901b4[_0x0785('0x13')](0x194);}return _0x1d8c55;};}function handleError(_0x1d25aa,_0x3ab8f4){_0x3ab8f4=_0x3ab8f4||0x1f4;return function(_0x2059e5){logger['error'](_0x2059e5['stack']);if(_0x2059e5['name']){delete _0x2059e5['name'];}_0x1d25aa['status'](_0x3ab8f4)[_0x0785('0x1f')](_0x2059e5);};}exports[_0x0785('0x20')]=function(_0x320a6a,_0xec1096){var _0x7e5926={};var _0x1baeee=_['map'](db[_0x0785('0x21')]['rawAttributes'],function(_0x2312f8){return{'name':_0x2312f8['fieldName'],'type':_0x2312f8['type']['key']};});_0x7e5926=qs['getOptions'](_0x1baeee,_0x320a6a);return interaction[_0x0785('0x22')](_0x0785('0x23'),_0x320a6a[_0x0785('0x24')],_0x320a6a[_0x0785('0x25')],_0x7e5926,_0x1baeee)[_0x0785('0x1d')](respondWithFilteredResult(_0xec1096,_0x7e5926))[_0x0785('0x26')](handleError(_0xec1096,null));};exports['show']=function(_0x323f62,_0x13b522){var _0xaae7bc={'raw':![],'where':{'id':_0x323f62[_0x0785('0x27')]['id']}},_0x7001c0={};_0x7001c0[_0x0785('0x28')]=_[_0x0785('0x29')](db['SmsInteraction'][_0x0785('0x2a')]);_0x7001c0[_0x0785('0x24')]=_[_0x0785('0x29')](_0x323f62[_0x0785('0x24')]);_0x7001c0[_0x0785('0x2b')]=_['intersection'](_0x7001c0[_0x0785('0x28')],_0x7001c0['query']);_0xaae7bc[_0x0785('0x2c')]=_[_0x0785('0x2d')](_0x7001c0[_0x0785('0x28')],qs[_0x0785('0x2e')](_0x323f62[_0x0785('0x24')][_0x0785('0x2e')]));_0xaae7bc[_0x0785('0x2c')]=_0xaae7bc[_0x0785('0x2c')]['length']?_0xaae7bc[_0x0785('0x2c')]:_0x7001c0[_0x0785('0x28')];if(_0x323f62[_0x0785('0x24')][_0x0785('0x2f')]){_0xaae7bc[_0x0785('0x30')]=[{'all':!![]}];}_0xaae7bc=_[_0x0785('0x31')]({},_0xaae7bc,_0x323f62[_0x0785('0x32')]);return db[_0x0785('0x21')][_0x0785('0x33')](_0xaae7bc)[_0x0785('0x1d')](handleEntityNotFound(_0x13b522,null))[_0x0785('0x1d')](respondWithResult(_0x13b522,null))[_0x0785('0x26')](handleError(_0x13b522,null));};exports[_0x0785('0x34')]=function(_0x46fe10,_0x5bf37a){return db['SmsInteraction'][_0x0785('0x34')](_0x46fe10[_0x0785('0x35')],{})[_0x0785('0x1d')](respondWithResult(_0x5bf37a,0xc9))[_0x0785('0x26')](handleError(_0x5bf37a,null));};exports[_0x0785('0x36')]=function(_0x592842,_0x262ca4){if(_0x592842[_0x0785('0x35')]['id']){delete _0x592842[_0x0785('0x35')]['id'];}return db[_0x0785('0x21')]['find']({'where':{'id':_0x592842[_0x0785('0x27')]['id']}})[_0x0785('0x1d')](handleEntityNotFound(_0x262ca4,null))['then'](saveUpdates(_0x592842['body'],null))[_0x0785('0x1d')](respondWithResult(_0x262ca4,null))['catch'](handleError(_0x262ca4,null));};exports[_0x0785('0x1e')]=function(_0x318675,_0x1e9eb6){return db['SmsInteraction'][_0x0785('0x33')]({'where':{'id':_0x318675[_0x0785('0x27')]['id']}})[_0x0785('0x1d')](handleEntityNotFound(_0x1e9eb6,null))[_0x0785('0x1d')](removeEntity(_0x1e9eb6,null))['catch'](handleError(_0x1e9eb6,null));};exports[_0x0785('0x37')]=function(_0x1c8f35,_0x1027dc){return db[_0x0785('0x21')]['describe']()[_0x0785('0x1d')](respondWithResult(_0x1027dc,null))['catch'](handleError(_0x1027dc,null));};exports['addMessage']=function(_0x32dde8,_0xeb2f5f){return db['SmsMessage'][_0x0785('0x33')]({'where':{'id':_0x32dde8[_0x0785('0x27')]['id']}})[_0x0785('0x1d')](handleEntityNotFound(_0xeb2f5f,null))[_0x0785('0x1d')](function(_0x551ee5){if(_0x551ee5){return _0x551ee5[_0x0785('0x38')](_0x32dde8[_0x0785('0x35')][_0x0785('0x39')],_['omit'](_0x32dde8[_0x0785('0x35')],[_0x0785('0x39'),'id'])||{});}})[_0x0785('0x1d')](respondWithResult(_0xeb2f5f,null))[_0x0785('0x26')](handleError(_0xeb2f5f,null));};exports[_0x0785('0x3a')]=function(_0x19fff9,_0x452f36){var _0x133124={'raw':![],'where':{}};var _0x7c083f={};var _0x32e61c={'count':0x0,'rows':[]};return db[_0x0785('0x21')][_0x0785('0x3b')]({'where':{'id':_0x19fff9[_0x0785('0x27')]['id']}})[_0x0785('0x1d')](handleEntityNotFound(_0x452f36,null))[_0x0785('0x1d')](function(_0xbd81ed){if(_0xbd81ed){_0x7c083f[_0x0785('0x28')]=_[_0x0785('0x29')](db['SmsMessage'][_0x0785('0x2a')]);_0x7c083f[_0x0785('0x24')]=_[_0x0785('0x29')](_0x19fff9['query']);_0x7c083f[_0x0785('0x2b')]=_[_0x0785('0x2d')](_0x7c083f[_0x0785('0x28')],_0x7c083f[_0x0785('0x24')]);_0x133124[_0x0785('0x2c')]=_['intersection'](_0x7c083f[_0x0785('0x28')],qs[_0x0785('0x2e')](_0x19fff9[_0x0785('0x24')][_0x0785('0x2e')]));_0x133124[_0x0785('0x2c')]=_0x133124[_0x0785('0x2c')][_0x0785('0x3c')]?_0x133124['attributes']:_0x7c083f[_0x0785('0x28')];if(!_0x19fff9['query'][_0x0785('0x3d')]('nolimit')){_0x133124[_0x0785('0x17')]=qs['limit'](_0x19fff9[_0x0785('0x24')][_0x0785('0x17')]);_0x133124[_0x0785('0x19')]=qs[_0x0785('0x19')](_0x19fff9[_0x0785('0x24')][_0x0785('0x19')]);}_0x133124[_0x0785('0x3e')]=qs['sort'](_0x19fff9['query'][_0x0785('0x3f')]);_0x133124[_0x0785('0x40')]=qs[_0x0785('0x2b')](_[_0x0785('0x41')](_0x19fff9[_0x0785('0x24')],_0x7c083f['filters']));_0x133124[_0x0785('0x40')][_0x0785('0x42')]=_0xbd81ed['id'];if(_0x19fff9[_0x0785('0x24')][_0x0785('0x43')]){_0x133124[_0x0785('0x40')]=_[_0x0785('0x31')](_0x133124['where'],{'$or':_['map'](_0x133124['attributes'],function(_0x576ba7){var _0x4f5f21={};_0x4f5f21[_0x576ba7]={'$like':'%'+_0x19fff9[_0x0785('0x24')]['filter']+'%'};return _0x4f5f21;})});}if(_0x19fff9['query']['$gte']){var _0x20f143=_0x19fff9[_0x0785('0x24')][_0x0785('0x44')][_0x0785('0x45')](',');var _0x2c6245={};_0x2c6245[_0x20f143[0x0]]={'$gte':moment(_0x20f143[0x1])[_0x0785('0x46')](_0x0785('0x47'))};_0x133124[_0x0785('0x40')]=_[_0x0785('0x31')](_0x133124[_0x0785('0x40')],_0x2c6245);}_0x133124=_[_0x0785('0x31')]({},_0x133124,_0x19fff9[_0x0785('0x32')]);return db[_0x0785('0x48')][_0x0785('0x18')]({'where':_0x133124[_0x0785('0x40')]})['then'](function(_0x43402f){_0x32e61c[_0x0785('0x18')]=_0x43402f;if(_0x19fff9['query'][_0x0785('0x2f')]){_0x133124[_0x0785('0x30')]=[{'all':!![]}];}return db[_0x0785('0x48')]['findAll'](_0x133124);})['then'](function(_0x198f6c){_0x32e61c[_0x0785('0x49')]=_0x198f6c;return _0x32e61c;});}})[_0x0785('0x1d')](respondWithFilteredResult(_0x452f36,_0x133124))[_0x0785('0x26')](handleError(_0x452f36,null));};exports[_0x0785('0x4a')]=function(_0x105b8e,_0x165e54){return db[_0x0785('0x21')]['find']({'where':{'id':_0x105b8e[_0x0785('0x27')]['id']}})['then'](handleEntityNotFound(_0x165e54,null))[_0x0785('0x1d')](function(_0x76e462){if(_0x76e462){return _0x76e462[_0x0785('0x4b')](_0x105b8e[_0x0785('0x35')][_0x0785('0x39')],_[_0x0785('0x4c')](_0x105b8e[_0x0785('0x35')],[_0x0785('0x39'),'id'])||{})[_0x0785('0x4d')](function(){return db[_0x0785('0x4e')][_0x0785('0x22')]({'attributes':['id',_0x0785('0x4f'),'color'],'where':{'id':_0x105b8e['body'][_0x0785('0x39')]}});})[_0x0785('0x1d')](function(_0x1021de){socket[_0x0785('0x50')]('smsInteractionTags:save',{'id':Number(_0x105b8e['params']['id']),'tags':_0x1021de||[]});return{'id':Number(_0x105b8e[_0x0785('0x27')]['id']),'tags':_0x1021de||[]};});}})['then'](respondWithResult(_0x165e54,null))[_0x0785('0x26')](handleError(_0x165e54,null));};exports[_0x0785('0x51')]=function(_0x329825,_0x143b21){return db[_0x0785('0x21')][_0x0785('0x33')]({'where':{'id':_0x329825[_0x0785('0x27')]['id']}})[_0x0785('0x1d')](handleEntityNotFound(_0x143b21,null))['then'](function(_0x5532d9){if(_0x5532d9){return _0x5532d9['removeTags'](_0x329825[_0x0785('0x24')][_0x0785('0x39')]);}})[_0x0785('0x1d')](respondWithStatusCode(_0x143b21,null))[_0x0785('0x26')](handleError(_0x143b21,null));};exports[_0x0785('0x52')]=function(_0x46948a,_0x55a4be){var _0x46a56e=moment()[_0x0785('0x53')]()[_0x0785('0x54')]();var _0x2ecd83=path[_0x0785('0x55')](config[_0x0785('0x56')],_0x0785('0x57'),_0x0785('0x58'),_0x0785('0x59'));var _0x5b6766=path[_0x0785('0x55')](_0x2ecd83,_0x46a56e);var _0x2c06d7=util[_0x0785('0x46')](_0x0785('0x5a'),_0x46948a['params']['id'],_0x46a56e);var _0x2053f7=path['join'](_0x2ecd83,_0x2c06d7);var _0x57192d=[];_0x57192d['push']({'model':db['User'],'as':_0x0785('0x5b'),'attributes':['id',_0x0785('0x5c')],'raw':!![]});_0x57192d['push']({'model':db[_0x0785('0x5d')],'as':_0x0785('0x5e'),'attributes':['id','firstName',_0x0785('0x5f')],'raw':!![]});var _0x364a91=[{'model':db[_0x0785('0x48')],'as':_0x0785('0x60'),'attributes':['id',_0x0785('0x35'),_0x0785('0x61'),_0x0785('0x62'),_0x0785('0x63'),_0x0785('0x64')],'include':_0x57192d}];_0x364a91[_0x0785('0x65')]({'model':db['SmsAccount'],'as':_0x0785('0x66'),'attributes':['id',_0x0785('0x4f')]});_0x364a91[_0x0785('0x65')]({'model':db[_0x0785('0x5b')],'as':_0x0785('0x67'),'attributes':['id','fullname']});return db[_0x0785('0x21')][_0x0785('0x33')]({'where':{'id':_0x46948a['params']['id']},'include':_0x364a91})['then'](handleEntityNotFound(_0x55a4be,null))[_0x0785('0x1d')](function(_0x93a6c1){if(_0x93a6c1){var _0x4c095a=_0x93a6c1[_0x0785('0x68')]({'plain':!![]});fs[_0x0785('0x69')](_0x5b6766);var _0x398b52={'channel':_0x0785('0x6a'),'account':_0x4c095a[_0x0785('0x66')][_0x0785('0x4f')],'agent':_0x4c095a[_0x0785('0x67')]?_0x4c095a[_0x0785('0x67')][_0x0785('0x5c')]:_0x0785('0x6b'),'createdAt':moment(_0x4c095a[_0x0785('0x61')])[_0x0785('0x46')](_0x0785('0x47'))[_0x0785('0x54')](),'closedAt':_0x4c095a['closed']?moment(_0x4c095a[_0x0785('0x6c')])[_0x0785('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0785('0x54')]():'','disposition':_0x4c095a[_0x0785('0x6d')],'messages':_(_0x4c095a[_0x0785('0x60')])[_0x0785('0x43')]({'secret':![]})[_0x0785('0x6e')](function(_0x2905e1){return{'date':moment(_0x2905e1[_0x0785('0x61')])[_0x0785('0x46')](_0x0785('0x47'))[_0x0785('0x54')](),'sender':_0x2905e1[_0x0785('0x62')]==='out'?_0x2905e1[_0x0785('0x5b')]?_0x2905e1[_0x0785('0x5b')][_0x0785('0x5c')]:'System':_0x2905e1['Contact'][_0x0785('0x6f')]+(_0x2905e1[_0x0785('0x5e')]['lastName']?'\x20'+_0x2905e1[_0x0785('0x5e')][_0x0785('0x5f')]:''),'body':_0x2905e1[_0x0785('0x35')],'direction':_0x2905e1[_0x0785('0x62')]===_0x0785('0x70')?'A':'C','secret':_0x2905e1[_0x0785('0x63')],'read':_0x2905e1['read']};})[_0x0785('0x71')]()};return ejs[_0x0785('0x72')](path['join'](config['root'],_0x0785('0x57'),_0x0785('0x73'),'downloadInteraction.ejs'),{'interaction':_0x398b52})['then'](function(_0xc9b1){var _0x4b725c=path[_0x0785('0x55')](_0x5b6766,_0x0785('0x74')+_0x4c095a['id']+'-'+_0x46a56e+'.pdf');var _0x52c5c9={'path':_0x4b725c,'channel':_0x0785('0x6a'),'interactionId':_0x4c095a['id']};return pdf[_0x0785('0x75')](_0xc9b1,_0x52c5c9);})[_0x0785('0x1d')](function(){return new BPromise(function(_0x5c6f4e,_0x54982c){zipdir(_0x5b6766,{'saveTo':_0x2053f7},function(_0x322a0f,_0x162840){if(_0x322a0f)return _0x54982c(_0x322a0f);return _0x5c6f4e(_0x162840);});})[_0x0785('0x1d')](function(){return new BPromise(function(_0x30977a,_0x67a3bc){rimraf(_0x5b6766,function(_0x19225f){if(_0x19225f)_0x67a3bc(_0x19225f);return _0x30977a();});});})['then'](function(){return _0x55a4be[_0x0785('0x52')](_0x2053f7,_0x2c06d7,function(_0x1c4cda){if(_0x1c4cda){console['log'](_0x0785('0x76'),_0x1c4cda);}else{fs[_0x0785('0x77')](_0x2053f7);}});});});}else{return _0x55a4be[_0x0785('0x13')](0xc8);}})[_0x0785('0x26')](handleError(_0x55a4be,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 8a30b4a..7d4eb53 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 _0x056b=['hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty'];(function(_0xc4a0f,_0x10db37){var _0x143101=function(_0x1770d3){while(--_0x1770d3){_0xc4a0f['push'](_0xc4a0f['shift']());}};_0x143101(++_0x10db37);}(_0x056b,0xb6));var _0xb056=function(_0x1ed579,_0x206ebc){_0x1ed579=_0x1ed579-0x0;var _0x793273=_0x056b[_0x1ed579];return _0x793273;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xb056('0x0'))['db'][_0xb056('0x1')];var SmsMessage=require(_0xb056('0x0'))['db'][_0xb056('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xb056('0x3')](0x0);var events={'afterCreate':_0xb056('0x4'),'afterUpdate':_0xb056('0x5'),'afterDestroy':_0xb056('0x6')};function emitEvent(_0x343d88){return function(_0x2ff09d,_0x15a545,_0x515612){_0x2ff09d[_0xb056('0x7')]({'attributes':['id'],'raw':!![]})[_0xb056('0x8')](function(_0x3eae69){_0x2ff09d[_0xb056('0x9')](_0xb056('0xa'),_0x3eae69[_0xb056('0xb')](function(_0x539126){return{'id':_0x539126['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x2ff09d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb056('0x8')](function(_0x160c2a){_0x2ff09d[_0xb056('0x9')](_0xb056('0xc'),_0x160c2a['length']);SmsInteractionEvents[_0xb056('0xd')](_0x343d88+':'+_0x2ff09d['id'],_0x2ff09d);SmsInteractionEvents['emit'](_0x343d88,_0x2ff09d);_0x515612(null);})[_0xb056('0xe')](_0x515612(null));};}for(var e in events){if(events[_0xb056('0xf')](e)){var event=events[e];SmsInteraction[_0xb056('0x10')](e,emitEvent(event));}}module[_0xb056('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x4b17=['SmsInteraction','SmsMessage','setMaxListeners','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0xda0a8,_0x534718){var _0x1d65e2=function(_0x5b4c7f){while(--_0x5b4c7f){_0xda0a8['push'](_0xda0a8['shift']());}};_0x1d65e2(++_0x534718);}(_0x4b17,0x10f));var _0x74b1=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x4b17[_0x10791d];return _0x1b4f9c;};'use strict';var EventEmitter=require(_0x74b1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x74b1('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x74b1('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x74b1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74b1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fdea2){return function(_0x7b3c36,_0x30d910,_0x379dcc){_0x7b3c36[_0x74b1('0x5')]({'attributes':['id'],'raw':!![]})[_0x74b1('0x6')](function(_0x191d2b){_0x7b3c36[_0x74b1('0x7')]('Users',_0x191d2b[_0x74b1('0x8')](function(_0x98bb33){return{'id':_0x98bb33['id']};}));return SmsMessage[_0x74b1('0x9')]({'where':{'SmsInteractionId':_0x7b3c36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x74b1('0x6')](function(_0xc1952){_0x7b3c36['setDataValue'](_0x74b1('0xa'),_0xc1952[_0x74b1('0xb')]);SmsInteractionEvents['emit'](_0x4fdea2+':'+_0x7b3c36['id'],_0x7b3c36);SmsInteractionEvents[_0x74b1('0xc')](_0x4fdea2,_0x7b3c36);_0x379dcc(null);})[_0x74b1('0xd')](_0x379dcc(null));};}for(var e in events){if(events[_0x74b1('0xe')](e)){var event=events[e];SmsInteraction[_0x74b1('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 41d065b..29d6bf7 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 _0x16f3=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0x16f3,0x189));var _0x316f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16f3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x316f('0x0'));var util=require(_0x316f('0x1'));var logger=require(_0x316f('0x2'))(_0x316f('0x3'));var moment=require(_0x316f('0x4'));var BPromise=require(_0x316f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x316f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x316f('0x7'));module[_0x316f('0x8')]=function(_0x31bf88,_0x1823d1){return _0x31bf88[_0x316f('0x9')](_0x316f('0xa'),attributes,{'tableName':_0x316f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e48ee,_0x48fca1,_0x393fee){if(_0x3e48ee[_0x316f('0xc')](_0x316f('0xd'))){_0x3e48ee[_0x316f('0xe')]=moment()[_0x316f('0xf')](_0x316f('0x10'));}_0x393fee(null,_0x3e48ee);}}});}; \ No newline at end of file +var _0x43fa=['../../config/environment','./smsInteraction.attributes','define','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2ad76f,_0x538c95){var _0x1a387a=function(_0x5e045f){while(--_0x5e045f){_0x2ad76f['push'](_0x2ad76f['shift']());}};_0x1a387a(++_0x538c95);}(_0x43fa,0x90));var _0xa43f=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x43fa[_0x483d8b];return _0x6500f1;};'use strict';var _=require(_0xa43f('0x0'));var util=require(_0xa43f('0x1'));var logger=require(_0xa43f('0x2'))(_0xa43f('0x3'));var moment=require(_0xa43f('0x4'));var BPromise=require(_0xa43f('0x5'));var rp=require(_0xa43f('0x6'));var fs=require('fs');var path=require(_0xa43f('0x7'));var rimraf=require(_0xa43f('0x8'));var config=require(_0xa43f('0x9'));var attributes=require(_0xa43f('0xa'));module['exports']=function(_0x5af035,_0x25b567){return _0x5af035[_0xa43f('0xb')]('SmsInteraction',attributes,{'tableName':_0xa43f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x59ef30,_0x51c9bd,_0x152182){if(_0x59ef30[_0xa43f('0xd')]('closed')){_0x59ef30[_0xa43f('0xe')]=moment()[_0xa43f('0xf')](_0xa43f('0x10'));}_0x152182(null,_0x59ef30);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index f9da7e4..9354305 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 _0x1ad4=['stringify','error','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','localhost','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x3114aa,_0x4617e8){var _0x447e9e=function(_0x584d52){while(--_0x584d52){_0x3114aa['push'](_0x3114aa['shift']());}};_0x447e9e(++_0x4617e8);}(_0x1ad4,0x8e));var _0x41ad=function(_0x364e2b,_0x30b028){_0x364e2b=_0x364e2b-0x0;var _0x943fef=_0x1ad4[_0x364e2b];return _0x943fef;};'use strict';var _=require(_0x41ad('0x0'));var util=require('util');var moment=require(_0x41ad('0x1'));var BPromise=require(_0x41ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41ad('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x41ad('0x4'));var jayson=require(_0x41ad('0x5'));var client=jayson[_0x41ad('0x6')][_0x41ad('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x41ad('0x8')],{'host':_0x41ad('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41ad('0x8')]));require(_0x41ad('0xa'))[_0x41ad('0xb')](socket);function respondWithRpcPromise(_0x174a5e,_0x2704e9,_0x4f9039){return new BPromise(function(_0xa86dd6,_0x4920ae){return client[_0x41ad('0xc')](_0x174a5e,_0x4f9039)[_0x41ad('0xd')](function(_0x5a6050){logger['info'](_0x41ad('0xe'),_0x2704e9,_0x41ad('0xf'));logger[_0x41ad('0x10')](_0x41ad('0x11'),_0x2704e9,_0x41ad('0xf'),JSON[_0x41ad('0x12')](_0x5a6050));if(_0x5a6050[_0x41ad('0x13')]){if(_0x5a6050[_0x41ad('0x13')]['code']===0x1f4){logger[_0x41ad('0x13')](_0x41ad('0xe'),_0x2704e9,_0x5a6050[_0x41ad('0x13')][_0x41ad('0x14')]);return _0x4920ae(_0x5a6050[_0x41ad('0x13')][_0x41ad('0x14')]);}logger[_0x41ad('0x13')](_0x41ad('0xe'),_0x2704e9,_0x5a6050[_0x41ad('0x13')][_0x41ad('0x14')]);return _0xa86dd6(_0x5a6050['error']['message']);}else{logger[_0x41ad('0x15')](_0x41ad('0xe'),_0x2704e9,_0x41ad('0xf'));_0xa86dd6(_0x5a6050[_0x41ad('0x16')]['message']);}})[_0x41ad('0x17')](function(_0x16e8bb){logger[_0x41ad('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x2704e9,_0x16e8bb);_0x4920ae(_0x16e8bb);});});}exports[_0x41ad('0x18')]=function(_0x3ccd07){var _0x189c58=this;return new Promise(function(_0x1439ff,_0x1c745e){return db[_0x41ad('0x19')][_0x41ad('0x1a')](_0x3ccd07['body'],{'raw':_0x3ccd07['options']?_0x3ccd07[_0x41ad('0x1b')][_0x41ad('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ccd07[_0x41ad('0x1b')]?_0x3ccd07[_0x41ad('0x1b')][_0x41ad('0x1d')]||null:null,'attributes':_0x3ccd07[_0x41ad('0x1b')]?_0x3ccd07[_0x41ad('0x1b')][_0x41ad('0x1e')]||null:null,'limit':_0x3ccd07[_0x41ad('0x1b')]?_0x3ccd07[_0x41ad('0x1b')][_0x41ad('0x1f')]||null:null})[_0x41ad('0xd')](function(_0x38df57){logger[_0x41ad('0x15')](_0x41ad('0x18'),_0x3ccd07);logger[_0x41ad('0x10')](_0x41ad('0x18'),_0x3ccd07,JSON[_0x41ad('0x12')](_0x38df57));_0x1439ff(_0x38df57);})[_0x41ad('0x17')](function(_0x40e7c5){logger[_0x41ad('0x13')](_0x41ad('0x18'),_0x40e7c5[_0x41ad('0x14')],_0x3ccd07);_0x1c745e(_0x189c58[_0x41ad('0x13')](0x1f4,_0x40e7c5['message']));});});};exports[_0x41ad('0x20')]=function(_0x3636cd){return new Promise(function(_0x416837,_0x17f55e){return db['SmsInteraction'][_0x41ad('0x21')]({'where':_0x3636cd[_0x41ad('0x1b')]?_0x3636cd[_0x41ad('0x1b')][_0x41ad('0x1d')]||null:null})[_0x41ad('0xd')](function(_0x2c9b93){if(_0x2c9b93){return _0x2c9b93[_0x41ad('0x22')](_0x3636cd[_0x41ad('0x23')][_0x41ad('0x24')],_[_0x41ad('0x25')](_0x3636cd[_0x41ad('0x23')],[_0x41ad('0x24'),'id'])||{});}})[_0x41ad('0x26')](function(_0x3f5b5b){logger[_0x41ad('0x15')](_0x41ad('0x27'),_0x3636cd);logger[_0x41ad('0x10')]('AddTags',_0x3636cd,JSON[_0x41ad('0x12')](_0x3f5b5b));_0x416837(_0x3f5b5b);})[_0x41ad('0x17')](function(_0x271ad2){logger[_0x41ad('0x13')](_0x41ad('0x27'),_0x271ad2[_0x41ad('0x14')],_0x3636cd);_0x17f55e(_this[_0x41ad('0x13')](0x1f4,_0x271ad2[_0x41ad('0x14')]));});});}; \ No newline at end of file +var _0x711e=['raw','attributes','limit','then','debug','AddTagsToSmsInteraction','find','where','addTags','ids','omit','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','catch','UpdateSmsInteraction','SmsInteraction','update','body','options'];(function(_0x2dda96,_0x380a19){var _0x188657=function(_0x225ba1){while(--_0x225ba1){_0x2dda96['push'](_0x2dda96['shift']());}};_0x188657(++_0x380a19);}(_0x711e,0x1c4));var _0xe711=function(_0x2319b0,_0x215176){_0x2319b0=_0x2319b0-0x0;var _0x32039b=_0x711e[_0x2319b0];return _0x32039b;};'use strict';var _=require(_0xe711('0x0'));var util=require('util');var moment=require(_0xe711('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe711('0x2'));var db=require(_0xe711('0x3'))['db'];var utils=require(_0xe711('0x4'));var logger=require(_0xe711('0x5'))(_0xe711('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe711('0x7')]({'port':0x232a});config['redis']=_[_0xe711('0x8')](config[_0xe711('0x9')],{'host':_0xe711('0xa'),'port':0x18eb});var socket=require(_0xe711('0xb'))(new Redis(config[_0xe711('0x9')]));require(_0xe711('0xc'))[_0xe711('0xd')](socket);function respondWithRpcPromise(_0x4fe636,_0x3429f0,_0x4a6d37){return new BPromise(function(_0x1989fe,_0x66a9fe){return client[_0xe711('0xe')](_0x4fe636,_0x4a6d37)['then'](function(_0x390e22){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x3429f0,_0xe711('0xf'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3429f0,_0xe711('0xf'),JSON[_0xe711('0x10')](_0x390e22));if(_0x390e22[_0xe711('0x11')]){if(_0x390e22[_0xe711('0x11')][_0xe711('0x12')]===0x1f4){logger[_0xe711('0x11')](_0xe711('0x13'),_0x3429f0,_0x390e22[_0xe711('0x11')]['message']);return _0x66a9fe(_0x390e22['error'][_0xe711('0x14')]);}logger[_0xe711('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x3429f0,_0x390e22[_0xe711('0x11')]['message']);return _0x1989fe(_0x390e22['error']['message']);}else{logger[_0xe711('0x15')](_0xe711('0x13'),_0x3429f0,_0xe711('0xf'));_0x1989fe(_0x390e22['result'][_0xe711('0x14')]);}})[_0xe711('0x16')](function(_0x34094d){logger[_0xe711('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x3429f0,_0x34094d);_0x66a9fe(_0x34094d);});});}exports[_0xe711('0x17')]=function(_0x5b33a3){var _0x256a03=this;return new Promise(function(_0x314fe0,_0x112dca){return db[_0xe711('0x18')][_0xe711('0x19')](_0x5b33a3[_0xe711('0x1a')],{'raw':_0x5b33a3[_0xe711('0x1b')]?_0x5b33a3[_0xe711('0x1b')][_0xe711('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b33a3[_0xe711('0x1b')]?_0x5b33a3[_0xe711('0x1b')]['where']||null:null,'attributes':_0x5b33a3[_0xe711('0x1b')]?_0x5b33a3[_0xe711('0x1b')][_0xe711('0x1d')]||null:null,'limit':_0x5b33a3[_0xe711('0x1b')]?_0x5b33a3[_0xe711('0x1b')][_0xe711('0x1e')]||null:null})[_0xe711('0x1f')](function(_0x3176a2){logger[_0xe711('0x15')](_0xe711('0x17'),_0x5b33a3);logger[_0xe711('0x20')](_0xe711('0x17'),_0x5b33a3,JSON[_0xe711('0x10')](_0x3176a2));_0x314fe0(_0x3176a2);})[_0xe711('0x16')](function(_0x37d425){logger[_0xe711('0x11')](_0xe711('0x17'),_0x37d425[_0xe711('0x14')],_0x5b33a3);_0x112dca(_0x256a03[_0xe711('0x11')](0x1f4,_0x37d425[_0xe711('0x14')]));});});};exports[_0xe711('0x21')]=function(_0x5af347){return new Promise(function(_0x40677f,_0x11cf2c){return db[_0xe711('0x18')][_0xe711('0x22')]({'where':_0x5af347[_0xe711('0x1b')]?_0x5af347[_0xe711('0x1b')][_0xe711('0x23')]||null:null})[_0xe711('0x1f')](function(_0x5bef68){if(_0x5bef68){return _0x5bef68[_0xe711('0x24')](_0x5af347[_0xe711('0x1a')][_0xe711('0x25')],_[_0xe711('0x26')](_0x5af347[_0xe711('0x1a')],[_0xe711('0x25'),'id'])||{});}})['spread'](function(_0x3c8f1f){logger[_0xe711('0x15')](_0xe711('0x27'),_0x5af347);logger[_0xe711('0x20')](_0xe711('0x27'),_0x5af347,JSON[_0xe711('0x10')](_0x3c8f1f));_0x40677f(_0x3c8f1f);})['catch'](function(_0x51cd45){logger[_0xe711('0x11')]('AddTags',_0x51cd45[_0xe711('0x14')],_0x5af347);_0x11cf2c(_this[_0xe711('0x11')](0x1f4,_0x51cd45['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6cf8bb5..182d050 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 _0x2ff1=['smsInteraction:','save','remove','update','emit','removeListener','length'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x2ff1,0xef));var _0x12ff=function(_0x288b6b,_0x1e6ad0){_0x288b6b=_0x288b6b-0x0;var _0x1cfb9d=_0x2ff1[_0x288b6b];return _0x1cfb9d;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x12ff('0x0'),_0x12ff('0x1'),_0x12ff('0x2')];function createListener(_0xfb30ad,_0x232375){return function(_0x42bec0){_0x232375[_0x12ff('0x3')](_0xfb30ad,_0x42bec0);};}function removeListener(_0x2444e9,_0x151147){return function(){SmsInteractionEvents[_0x12ff('0x4')](_0x2444e9,_0x151147);};}exports['register']=function(_0x4b61c1){for(var _0x23c96b=0x0,_0x597952=events[_0x12ff('0x5')];_0x23c96b<_0x597952;_0x23c96b++){var _0x354a93=events[_0x23c96b];var _0x5dd54c=createListener(_0x12ff('0x6')+_0x354a93,_0x4b61c1);SmsInteractionEvents['on'](_0x354a93,_0x5dd54c);}}; \ No newline at end of file +var _0x6c1d=['removeListener','register','length','smsInteraction:','save','remove','update','emit'];(function(_0x4fc92d,_0x5765fc){var _0x1438e5=function(_0x527b2e){while(--_0x527b2e){_0x4fc92d['push'](_0x4fc92d['shift']());}};_0x1438e5(++_0x5765fc);}(_0x6c1d,0x174));var _0xd6c1=function(_0x4176b1,_0xeeebd3){_0x4176b1=_0x4176b1-0x0;var _0x23f92c=_0x6c1d[_0x4176b1];return _0x23f92c;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xd6c1('0x0'),_0xd6c1('0x1'),_0xd6c1('0x2')];function createListener(_0x3a78ea,_0x1de543){return function(_0x321e91){_0x1de543[_0xd6c1('0x3')](_0x3a78ea,_0x321e91);};}function removeListener(_0x540dd1,_0x599c5a){return function(){SmsInteractionEvents[_0xd6c1('0x4')](_0x540dd1,_0x599c5a);};}exports[_0xd6c1('0x5')]=function(_0x4a679b){for(var _0x5d0583=0x0,_0x42ed18=events[_0xd6c1('0x6')];_0x5d0583<_0x42ed18;_0x5d0583++){var _0x41e389=events[_0x5d0583];var _0x74b5c1=createListener(_0xd6c1('0x7')+_0x41e389,_0x4a679b);SmsInteractionEvents['on'](_0x41e389,_0x74b5c1);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8b11b8f..d1c774a 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 _0x2c5b=['/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms'];(function(_0x179bb6,_0xbb8b7a){var _0x12ecb9=function(_0x3e1c27){while(--_0x3e1c27){_0x179bb6['push'](_0x179bb6['shift']());}};_0x12ecb9(++_0xbb8b7a);}(_0x2c5b,0x193));var _0xb2c5=function(_0xcbbec6,_0x4fc6a9){_0xcbbec6=_0xcbbec6-0x0;var _0x3b7b26=_0x2c5b[_0xcbbec6];return _0x3b7b26;};'use strict';var multer=require(_0xb2c5('0x0'));var util=require('util');var path=require(_0xb2c5('0x1'));var timeout=require(_0xb2c5('0x2'));var express=require(_0xb2c5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2c5('0x4'));var interaction=require(_0xb2c5('0x5'));var config=require(_0xb2c5('0x6'));var controller=require(_0xb2c5('0x7'));router['get']('/',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x9')]);router[_0xb2c5('0xa')](_0xb2c5('0xb'),auth[_0xb2c5('0x8')](),controller[_0xb2c5('0xc')]);router['get']('/:id',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0xd')]);router[_0xb2c5('0xe')]('/',auth['isAuthenticated'](),interaction[_0xb2c5('0xf')](_0xb2c5('0x10'),'smsmessage:create'),controller['create']);router[_0xb2c5('0xe')](_0xb2c5('0x11'),controller[_0xb2c5('0x12')]);router[_0xb2c5('0x13')]('/:id',auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x14')]);router[_0xb2c5('0x13')](_0xb2c5('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xb2c5('0x13')](_0xb2c5('0x16'),auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x17')]);router[_0xb2c5('0x18')](_0xb2c5('0x19'),auth[_0xb2c5('0x8')](),controller[_0xb2c5('0x1a')]);module[_0xb2c5('0x1b')]=router; \ No newline at end of file +var _0x1afa=['/:id/accept','accept','reject','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','put','update'];(function(_0x5e30d6,_0xf30797){var _0x427273=function(_0x4896e3){while(--_0x4896e3){_0x5e30d6['push'](_0x5e30d6['shift']());}};_0x427273(++_0xf30797);}(_0x1afa,0x70));var _0xa1af=function(_0x19fe31,_0x4664eb){_0x19fe31=_0x19fe31-0x0;var _0x1ed7d0=_0x1afa[_0x19fe31];return _0x1ed7d0;};'use strict';var multer=require(_0xa1af('0x0'));var util=require(_0xa1af('0x1'));var path=require(_0xa1af('0x2'));var timeout=require(_0xa1af('0x3'));var express=require(_0xa1af('0x4'));var router=express[_0xa1af('0x5')]();var fs_extra=require(_0xa1af('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa1af('0x7'));var config=require(_0xa1af('0x8'));var controller=require(_0xa1af('0x9'));router[_0xa1af('0xa')]('/',auth[_0xa1af('0xb')](),controller[_0xa1af('0xc')]);router[_0xa1af('0xa')]('/describe',auth[_0xa1af('0xb')](),controller['describe']);router['get'](_0xa1af('0xd'),auth['isAuthenticated'](),controller[_0xa1af('0xe')]);router['post']('/',auth[_0xa1af('0xb')](),interaction[_0xa1af('0xf')](_0xa1af('0x10'),_0xa1af('0x11')),controller[_0xa1af('0x12')]);router[_0xa1af('0x13')](_0xa1af('0x14'),controller['status']);router[_0xa1af('0x15')]('/:id',auth[_0xa1af('0xb')](),controller[_0xa1af('0x16')]);router['put'](_0xa1af('0x17'),auth[_0xa1af('0xb')](),controller[_0xa1af('0x18')]);router['put']('/:id/reject',auth[_0xa1af('0xb')](),controller[_0xa1af('0x19')]);router['delete'](_0xa1af('0xd'),auth[_0xa1af('0xb')](),controller[_0xa1af('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 7b4e581..d232b24 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 _0x6d2a=['TEXT','BOOLEAN','out','STRING','sequelize','exports'];(function(_0x41d467,_0x3a62d4){var _0x3fd5bb=function(_0x45917b){while(--_0x45917b){_0x41d467['push'](_0x41d467['shift']());}};_0x3fd5bb(++_0x3a62d4);}(_0x6d2a,0x12a));var _0xa6d2=function(_0x198fc6,_0x5eaee9){_0x198fc6=_0x198fc6-0x0;var _0x4376bb=_0x6d2a[_0x198fc6];return _0x4376bb;};'use strict';var Sequelize=require(_0xa6d2('0x0'));module[_0xa6d2('0x1')]={'body':{'type':Sequelize[_0xa6d2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa6d2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa6d2('0x4')),'defaultValue':_0xa6d2('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa6d2('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xa6d2('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa6d2('0x5')]},'providerResponse':{'type':Sequelize[_0xa6d2('0x2')]}}; \ No newline at end of file +var _0x0af1=['DATE','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0af1,0x135));var _0x10af=function(_0x1f3eed,_0x1df117){_0x1f3eed=_0x1f3eed-0x0;var _0x2d8813=_0x0af1[_0x1f3eed];return _0x2d8813;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x10af('0x0')](_0x10af('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x10af('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x10af('0x3')]('in','out'),'defaultValue':_0x10af('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x10af('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x10af('0x6')]},'secret':{'type':Sequelize[_0x10af('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x10af('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8053cca..d9b7e91 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 _0x08d3=['localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','SmsMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','get','SmsInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','agent','fullname','email','internal','SIP/%s','channel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','contact','interface','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis'];(function(_0x229c16,_0x46ac63){var _0x122401=function(_0x4deced){while(--_0x4deced){_0x229c16['push'](_0x229c16['shift']());}};_0x122401(++_0x46ac63);}(_0x08d3,0x119));var _0x308d=function(_0x5e1afd,_0x1719d8){_0x5e1afd=_0x5e1afd-0x0;var _0x54b097=_0x08d3[_0x5e1afd];return _0x54b097;};'use strict';var emlformat=require(_0x308d('0x0'));var rimraf=require(_0x308d('0x1'));var zipdir=require(_0x308d('0x2'));var jsonpatch=require(_0x308d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x308d('0x4'));var Mustache=require(_0x308d('0x5'));var util=require(_0x308d('0x6'));var path=require(_0x308d('0x7'));var sox=require(_0x308d('0x8'));var csv=require('to-csv');var ejs=require(_0x308d('0x9'));var fs=require('fs');var fs_extra=require(_0x308d('0xa'));var _=require(_0x308d('0xb'));var squel=require(_0x308d('0xc'));var crypto=require(_0x308d('0xd'));var jsforce=require(_0x308d('0xe'));var deskjs=require(_0x308d('0xf'));var toCsv=require(_0x308d('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x308d('0x11'));var authService=require(_0x308d('0x12'));var qs=require(_0x308d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x308d('0x14'));var logger=require(_0x308d('0x15'))(_0x308d('0x16'));var utils=require(_0x308d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x308d('0x18'));var db=require(_0x308d('0x19'))['db'];config[_0x308d('0x1a')]=_['defaults'](config[_0x308d('0x1a')],{'host':_0x308d('0x1b'),'port':0x18eb});var socket=require(_0x308d('0x1c'))(new Redis(config[_0x308d('0x1a')]));require(_0x308d('0x1d'))[_0x308d('0x1e')](socket);var jayson=require(_0x308d('0x1f'));var client=jayson[_0x308d('0x20')][_0x308d('0x21')]({'port':0x232c});var client9002=jayson[_0x308d('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x392ba4,_0x53a763,_0x15b747,_0x2175c1){return new BPromise(function(_0x5dd012,_0x5ced7e){var _0x59ca07=_0x2175c1||client;return _0x59ca07[_0x308d('0x22')](_0x392ba4,_0x15b747)[_0x308d('0x23')](function(_0x5000d0){logger['info'](_0x308d('0x24'),_0x53a763,_0x308d('0x25'));logger[_0x308d('0x26')](_0x308d('0x27'),_0x53a763,_0x308d('0x25'),JSON[_0x308d('0x28')](_0x5000d0));if(_0x5000d0[_0x308d('0x29')]){if(_0x5000d0[_0x308d('0x29')][_0x308d('0x2a')]===0x1f4){logger[_0x308d('0x29')](_0x308d('0x24'),_0x53a763,_0x5000d0[_0x308d('0x29')][_0x308d('0x2b')]);return _0x5ced7e(_0x5000d0['error'][_0x308d('0x2b')]);}logger[_0x308d('0x29')](_0x308d('0x24'),_0x53a763,_0x5000d0[_0x308d('0x29')]['message']);return _0x5dd012(_0x5000d0[_0x308d('0x29')][_0x308d('0x2b')]);}else{logger[_0x308d('0x2c')](_0x308d('0x24'),_0x53a763,_0x308d('0x25'));_0x5dd012(_0x5000d0[_0x308d('0x2d')][_0x308d('0x2b')]);}})['catch'](function(_0x4508f2){logger[_0x308d('0x29')](_0x308d('0x24'),_0x53a763,_0x4508f2);_0x5ced7e(_0x4508f2);});});}function respondWithStatusCode(_0x45bfed,_0x127224){_0x127224=_0x127224||0xcc;return function(_0x462f3e){if(_0x462f3e){return _0x45bfed[_0x308d('0x2e')](_0x127224);}return _0x45bfed[_0x308d('0x2f')](_0x127224)[_0x308d('0x30')]();};}function respondWithResult(_0x2cc6b0,_0x4bdd9a){_0x4bdd9a=_0x4bdd9a||0xc8;return function(_0xfa7067){if(_0xfa7067){return _0x2cc6b0[_0x308d('0x2f')](_0x4bdd9a)[_0x308d('0x31')](_0xfa7067);}};}function respondWithFilteredResult(_0x1a5832,_0x13e9c2){return function(_0x29d354){if(_0x29d354){var _0x2e1048=typeof _0x13e9c2[_0x308d('0x32')]===_0x308d('0x33')&&typeof _0x13e9c2[_0x308d('0x34')]===_0x308d('0x33');var _0x27725d=_0x29d354[_0x308d('0x35')];var _0x442be5=_0x2e1048?0x0:_0x13e9c2['offset'];var _0x1bcbdd=_0x2e1048?_0x29d354[_0x308d('0x35')]:_0x13e9c2['offset']+_0x13e9c2['limit'];var _0x24d4c2;if(_0x1bcbdd>=_0x27725d){_0x1bcbdd=_0x27725d;_0x24d4c2=0xc8;}else{_0x24d4c2=0xce;}_0x1a5832[_0x308d('0x2f')](_0x24d4c2);return _0x1a5832[_0x308d('0x36')](_0x308d('0x37'),_0x442be5+'-'+_0x1bcbdd+'/'+_0x27725d)[_0x308d('0x31')](_0x29d354);}return null;};}function patchUpdates(_0x33149b){return function(_0x3aa296){try{jsonpatch[_0x308d('0x38')](_0x3aa296,_0x33149b,!![]);}catch(_0x5a293a){return BPromise[_0x308d('0x39')](_0x5a293a);}return _0x3aa296[_0x308d('0x3a')]();};}function saveUpdates(_0x1879c1,_0x177d0e){return function(_0x4637d6){if(_0x4637d6){return _0x4637d6[_0x308d('0x3b')](_0x1879c1)[_0x308d('0x23')](function(_0x1b87b9){return _0x1b87b9;});}return null;};}function removeEntity(_0x16077e,_0x51608d){return function(_0x14f3ab){if(_0x14f3ab){return _0x14f3ab[_0x308d('0x3c')]()[_0x308d('0x23')](function(){_0x16077e['status'](0xcc)[_0x308d('0x30')]();});}};}function handleEntityNotFound(_0x4deae9,_0x533420){return function(_0x44b7db){if(!_0x44b7db){_0x4deae9['sendStatus'](0x194);}return _0x44b7db;};}function handleError(_0x1a1161,_0x5adb1f){_0x5adb1f=_0x5adb1f||0x1f4;return function(_0x1e89b5){logger[_0x308d('0x29')](_0x1e89b5[_0x308d('0x3d')]);if(_0x1e89b5[_0x308d('0x3e')]){delete _0x1e89b5[_0x308d('0x3e')];}_0x1a1161[_0x308d('0x2f')](_0x5adb1f)[_0x308d('0x3f')](_0x1e89b5);};}exports['index']=function(_0x2003b0,_0x16907a){var _0x49b46b={},_0x4083af={},_0x1551ac={'count':0x0,'rows':[]};var _0x5714fe=_['map'](db[_0x308d('0x40')][_0x308d('0x41')],function(_0x1cc3c6){return{'name':_0x1cc3c6[_0x308d('0x42')],'type':_0x1cc3c6['type'][_0x308d('0x43')]};});_0x4083af[_0x308d('0x44')]=_['map'](_0x5714fe,_0x308d('0x3e'));_0x4083af[_0x308d('0x45')]=_[_0x308d('0x46')](_0x2003b0[_0x308d('0x45')]);_0x4083af['filters']=_[_0x308d('0x47')](_0x4083af[_0x308d('0x44')],_0x4083af['query']);_0x49b46b[_0x308d('0x48')]=_['intersection'](_0x4083af[_0x308d('0x44')],qs['fields'](_0x2003b0[_0x308d('0x45')][_0x308d('0x49')]));_0x49b46b[_0x308d('0x48')]=_0x49b46b['attributes'][_0x308d('0x4a')]?_0x49b46b[_0x308d('0x48')]:_0x4083af[_0x308d('0x44')];if(!_0x2003b0[_0x308d('0x45')][_0x308d('0x4b')](_0x308d('0x4c'))){_0x49b46b[_0x308d('0x34')]=qs[_0x308d('0x34')](_0x2003b0[_0x308d('0x45')][_0x308d('0x34')]);_0x49b46b['offset']=qs['offset'](_0x2003b0[_0x308d('0x45')][_0x308d('0x32')]);}_0x49b46b[_0x308d('0x4d')]=qs['sort'](_0x2003b0[_0x308d('0x45')][_0x308d('0x4e')]);_0x49b46b[_0x308d('0x4f')]=qs['filters'](_[_0x308d('0x50')](_0x2003b0[_0x308d('0x45')],_0x4083af[_0x308d('0x51')]),_0x5714fe);if(_0x2003b0[_0x308d('0x45')][_0x308d('0x52')]){_0x49b46b[_0x308d('0x4f')]=_[_0x308d('0x53')](_0x49b46b['where'],{'$or':_['map'](_0x5714fe,function(_0x570a05){if(_0x570a05[_0x308d('0x54')]!==_0x308d('0x55')){var _0x2fe882={};_0x2fe882[_0x570a05[_0x308d('0x3e')]]={'$like':'%'+_0x2003b0['query'][_0x308d('0x52')]+'%'};return _0x2fe882;}})});}_0x49b46b=_['merge']({},_0x49b46b,_0x2003b0['options']);var _0x10a7fa={'where':_0x49b46b[_0x308d('0x4f')]};return db[_0x308d('0x40')]['count'](_0x10a7fa)[_0x308d('0x23')](function(_0x123d5a){_0x1551ac[_0x308d('0x35')]=_0x123d5a;if(_0x2003b0['query'][_0x308d('0x56')]){_0x49b46b[_0x308d('0x57')]=[{'all':!![]}];}return db[_0x308d('0x40')][_0x308d('0x58')](_0x49b46b);})[_0x308d('0x23')](function(_0x3266fe){_0x1551ac[_0x308d('0x59')]=_0x3266fe;return _0x1551ac;})['then'](respondWithFilteredResult(_0x16907a,_0x49b46b))[_0x308d('0x5a')](handleError(_0x16907a,null));};exports[_0x308d('0x5b')]=function(_0x323790,_0x5f30ba){var _0x15c6aa={'raw':!![],'where':{'id':_0x323790['params']['id']}},_0x1a2c68={};_0x1a2c68[_0x308d('0x44')]=_[_0x308d('0x46')](db[_0x308d('0x40')]['rawAttributes']);_0x1a2c68[_0x308d('0x45')]=_[_0x308d('0x46')](_0x323790['query']);_0x1a2c68[_0x308d('0x51')]=_[_0x308d('0x47')](_0x1a2c68[_0x308d('0x44')],_0x1a2c68[_0x308d('0x45')]);_0x15c6aa[_0x308d('0x48')]=_[_0x308d('0x47')](_0x1a2c68[_0x308d('0x44')],qs[_0x308d('0x49')](_0x323790[_0x308d('0x45')][_0x308d('0x49')]));_0x15c6aa['attributes']=_0x15c6aa[_0x308d('0x48')][_0x308d('0x4a')]?_0x15c6aa[_0x308d('0x48')]:_0x1a2c68[_0x308d('0x44')];if(_0x323790[_0x308d('0x45')]['includeAll']){_0x15c6aa[_0x308d('0x57')]=[{'all':!![]}];}_0x15c6aa=_[_0x308d('0x53')]({},_0x15c6aa,_0x323790[_0x308d('0x5c')]);return db[_0x308d('0x40')][_0x308d('0x5d')](_0x15c6aa)['then'](handleEntityNotFound(_0x5f30ba,null))['then'](respondWithResult(_0x5f30ba,null))[_0x308d('0x5a')](handleError(_0x5f30ba,null));};exports[_0x308d('0x5e')]=function(_0x18a8db,_0xdb7720){return db['SmsMessage']['create'](_0x18a8db[_0x308d('0x5f')],{})[_0x308d('0x23')](respondWithResult(_0xdb7720,0xc9))['catch'](handleError(_0xdb7720,null));};exports['update']=function(_0x4a150c,_0x52fe27){if(_0x4a150c['body']['id']){delete _0x4a150c[_0x308d('0x5f')]['id'];}return db[_0x308d('0x40')][_0x308d('0x5d')]({'where':{'id':_0x4a150c['params']['id']}})['then'](handleEntityNotFound(_0x52fe27,null))[_0x308d('0x23')](saveUpdates(_0x4a150c[_0x308d('0x5f')],null))['then'](respondWithResult(_0x52fe27,null))[_0x308d('0x5a')](handleError(_0x52fe27,null));};exports[_0x308d('0x3c')]=function(_0x54c880,_0x41db21){return db[_0x308d('0x40')][_0x308d('0x5d')]({'where':{'id':_0x54c880[_0x308d('0x60')]['id']}})[_0x308d('0x23')](handleEntityNotFound(_0x41db21,null))[_0x308d('0x23')](removeEntity(_0x41db21,null))[_0x308d('0x5a')](handleError(_0x41db21,null));};exports[_0x308d('0x61')]=function(_0x53a2dd,_0x333754){return db[_0x308d('0x40')][_0x308d('0x61')]()[_0x308d('0x23')](respondWithResult(_0x333754,null))['catch'](handleError(_0x333754,null));};var interaction_log=require(_0x308d('0x15'))(_0x308d('0x62'));exports[_0x308d('0x63')]=function(_0x281eec,_0x10038c,_0x4924b0){var _0x581004={'agent':{},'channel':_0x308d('0x64')};if(_0x281eec['body']['id']){delete _0x281eec[_0x308d('0x5f')]['id'];}_0x281eec['body'][_0x308d('0x65')]=!![];_0x281eec[_0x308d('0x5f')][_0x308d('0x66')]=moment()[_0x308d('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x281eec[_0x308d('0x5f')][_0x308d('0x68')]=_0x281eec[_0x308d('0x5f')]['UserId']||_0x281eec[_0x308d('0x69')]['id'];_0x581004['agent']['id']=_0x281eec[_0x308d('0x5f')][_0x308d('0x68')];return db[_0x308d('0x40')][_0x308d('0x5d')]({'where':{'id':_0x281eec['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x10038c,null))['then'](saveUpdates(_0x281eec[_0x308d('0x5f')],null))['then'](function(_0x31002a){if(_0x31002a){_0x581004['message']=_0x31002a[_0x308d('0x6a')]({'plain':!![]});return db[_0x308d('0x6b')]['find']({'where':{'id':_0x31002a['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x10038c,null))[_0x308d('0x23')](function(_0x459967){if(_0x459967){return _0x459967[_0x308d('0x3b')]({'UserId':_0x281eec[_0x308d('0x5f')][_0x308d('0x68')],'read1stAt':_[_0x308d('0x6c')](_0x459967[_0x308d('0x6d')])?moment()[_0x308d('0x67')](_0x308d('0x6e')):undefined});}return null;})[_0x308d('0x23')](function(_0x42fae8){if(_0x42fae8){_0x581004[_0x308d('0x6f')]=_0x42fae8['get']({'plain':!![]});interaction_log[_0x308d('0x2c')](_0x308d('0x70'),_0x281eec[_0x308d('0x69')]['id'],_0x281eec['user']['name'],_0x281eec[_0x308d('0x69')][_0x308d('0x71')],_0x581004[_0x308d('0x6f')]['id'],_0x281eec[_0x308d('0x5f')]?JSON[_0x308d('0x28')](_0x281eec[_0x308d('0x5f')]):_0x308d('0x72'));return respondWithRpcPromise('AcceptMessage',_0x308d('0x73'),_0x581004);}return null;})[_0x308d('0x23')](function(_0xfbe145){var _0x448cbe=_0x308d('0x74')+_0xfbe145[_0x308d('0x2b')]['ContactId'];return db[_0x308d('0x75')][_0x308d('0x45')](_0x448cbe,{'type':db['Sequelize'][_0x308d('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x5bc5bc){return _0x5bc5bc;});})[_0x308d('0x23')](function(_0x471ec8){if(_0x471ec8){_0x581004[_0x308d('0x2b')]['contact']=_0x471ec8[0x0];if(!_0x281eec[_0x308d('0x5f')]['UserId'])return;return db['User'][_0x308d('0x5d')]({'where':{'id':_0x281eec[_0x308d('0x5f')][_0x308d('0x68')],'role':_0x308d('0x77')},'attributes':['id',_0x308d('0x3e'),_0x308d('0x78'),_0x308d('0x79'),_0x308d('0x7a')],'raw':!![]});}return null;})[_0x308d('0x23')](function(_0x4cfe92){if(!_0x4cfe92)return null;_0x581004[_0x308d('0x2b')][_0x308d('0x77')]=_0x4cfe92;return _0x581004;})[_0x308d('0x23')](function(_0x3e6ddf){if(_0x3e6ddf){if(_0x281eec[_0x308d('0x5f')]['manual']){_0x581004[_0x308d('0x2b')]['interface']=util[_0x308d('0x67')](_0x308d('0x7b'),_0x281eec[_0x308d('0x69')]['name']);_0x581004['message']['channel']=_0x581004[_0x308d('0x7c')];_0x581004[_0x308d('0x2b')]['motionChannel']=_0x581004[_0x308d('0x7c')];_0x581004['message'][_0x308d('0x7d')]='accept';return respondWithRpcPromise(_0x308d('0x7e'),_0x308d('0x7e'),{'event':_0x308d('0x7f'),'message':_0x581004[_0x308d('0x2b')]},client9002)[_0x308d('0x23')](function(){return _0x581004;});}return _0x581004;}return null;})[_0x308d('0x23')](respondWithResult(_0x10038c,null))[_0x308d('0x5a')](handleError(_0x10038c,null));};var interaction_log=require(_0x308d('0x15'))(_0x308d('0x62'));exports[_0x308d('0x39')]=function(_0x5ecff8,_0xa957fc,_0x327a34){var _0x8f38d1={'agent':{},'channel':_0x308d('0x64')};if(_0x5ecff8[_0x308d('0x5f')]['id']){delete _0x5ecff8[_0x308d('0x5f')]['id'];}_0x5ecff8[_0x308d('0x5f')][_0x308d('0x68')]=_0x5ecff8[_0x308d('0x5f')][_0x308d('0x68')]||_0x5ecff8[_0x308d('0x69')]['id'];_0x8f38d1['agent']['id']=_0x5ecff8[_0x308d('0x5f')][_0x308d('0x68')];return db[_0x308d('0x40')][_0x308d('0x5d')]({'where':{'id':_0x5ecff8[_0x308d('0x60')]['id'],'UserId':null}})[_0x308d('0x23')](handleEntityNotFound(_0xa957fc,null))['then'](function(_0x541028){if(_0x541028){_0x8f38d1[_0x308d('0x2b')]=_0x541028['get']({'plain':!![]});return db[_0x308d('0x6b')][_0x308d('0x5d')]({'where':{'id':_0x541028[_0x308d('0x80')]}});}return null;})[_0x308d('0x23')](handleEntityNotFound(_0xa957fc,null))['then'](function(_0x28c9ca){if(_0x28c9ca){_0x8f38d1['interaction']=_0x28c9ca['get']({'plain':!![]});interaction_log[_0x308d('0x2c')](_0x308d('0x81'),_0x5ecff8[_0x308d('0x69')]['id'],_0x5ecff8['user'][_0x308d('0x3e')],_0x5ecff8[_0x308d('0x69')][_0x308d('0x71')],_0x8f38d1['interaction']['id'],_0x5ecff8[_0x308d('0x5f')]?JSON[_0x308d('0x28')](_0x5ecff8[_0x308d('0x5f')]):_0x308d('0x72'));return respondWithRpcPromise(_0x308d('0x82'),_0x308d('0x83'),_0x8f38d1);}return null;})[_0x308d('0x23')](function(_0x14e113){var _0x322b00=_0x308d('0x74')+_0x14e113['message']['ContactId'];return db[_0x308d('0x75')][_0x308d('0x45')](_0x322b00,{'type':db[_0x308d('0x84')][_0x308d('0x76')][_0x308d('0x85')],'raw':!![]})[_0x308d('0x23')](function(_0x30a4f1){return _0x30a4f1;});})[_0x308d('0x23')](function(_0x260dd7){if(_0x260dd7){_0x8f38d1[_0x308d('0x2b')][_0x308d('0x86')]=_0x260dd7[0x0];if(!_0x5ecff8[_0x308d('0x5f')][_0x308d('0x68')])return;return db['User'][_0x308d('0x5d')]({'where':{'id':_0x5ecff8['body']['UserId'],'role':_0x308d('0x77')},'attributes':['id',_0x308d('0x3e'),_0x308d('0x78'),_0x308d('0x79'),_0x308d('0x7a')],'raw':!![]});}return null;})[_0x308d('0x23')](function(_0x5db07b){if(!_0x5db07b)return null;_0x8f38d1[_0x308d('0x2b')]['agent']=_0x5db07b;return _0x8f38d1;})[_0x308d('0x23')](function(_0x884eb7){if(_0x884eb7){_0x884eb7[_0x308d('0x2b')][_0x308d('0x87')]=util[_0x308d('0x67')](_0x308d('0x7b'),_0x5ecff8[_0x308d('0x69')][_0x308d('0x3e')]);_0x884eb7[_0x308d('0x2b')][_0x308d('0x7c')]=_0x8f38d1['channel'];_0x884eb7[_0x308d('0x2b')][_0x308d('0x88')]=_0x8f38d1[_0x308d('0x7c')];_0x884eb7['message'][_0x308d('0x7d')]=_0x308d('0x39');respondWithRpcPromise(_0x308d('0x7e'),_0x308d('0x7e'),{'event':_0x308d('0x89'),'message':_0x884eb7[_0x308d('0x2b')]},client9002);return _0x8f38d1;}return null;})['then'](respondWithResult(_0xa957fc,null))[_0x308d('0x5a')](handleError(_0xa957fc,null));};exports['status']=function(_0x9fb680,_0x1ca0fc,_0xdd090e){if(_0x9fb680[_0x308d('0x5f')]['id']){delete _0x9fb680[_0x308d('0x5f')]['id'];}var _0x384761;return db['SmsMessage'][_0x308d('0x5d')]({'where':{'id':_0x9fb680[_0x308d('0x60')]['id']}})[_0x308d('0x23')](handleEntityNotFound(_0x1ca0fc,null))[_0x308d('0x23')](function(_0x47c4d5){if(_0x47c4d5){_0x384761=_0x47c4d5;return db[_0x308d('0x8a')][_0x308d('0x5d')]({'where':{'id':_0x47c4d5[_0x308d('0x8b')]}});}})[_0x308d('0x23')](handleEntityNotFound(_0x1ca0fc,null))[_0x308d('0x23')](function(_0x187194){if(_0x187194){logger[_0x308d('0x26')](_0x308d('0x27'),'status',_0x308d('0x8c'),_0x187194[_0x308d('0x54')],util[_0x308d('0x8d')](_0x9fb680[_0x308d('0x5f')],{'showHidden':![],'depth':null}));switch(_0x187194[_0x308d('0x54')]){case _0x308d('0x8e'):if(_0x9fb680['body'][_0x308d('0x8f')]&&_0x9fb680[_0x308d('0x5f')][_0x308d('0x8f')]===_0x384761[_0x308d('0x90')]){return _0x384761[_0x308d('0x3b')]({'read':!![]});}else{logger[_0x308d('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x308d('0x2f'),_0x308d('0x8e'),util[_0x308d('0x8d')](_0x9fb680[_0x308d('0x5f')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x9fb680[_0x308d('0x5f')][_0x308d('0x91')]&&_0x9fb680[_0x308d('0x5f')][_0x308d('0x91')]===_0x384761[_0x308d('0x90')]&&_[_0x308d('0x92')]([_0x308d('0x93'),'delivered'],_0x9fb680[_0x308d('0x5f')][_0x308d('0x94')])>=0x0){return _0x384761[_0x308d('0x3b')]({'read':!![]});}else{logger[_0x308d('0x29')](_0x308d('0x95'),'status',_0x308d('0x96'),util[_0x308d('0x8d')](_0x9fb680[_0x308d('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x308d('0x97'):var _0x182c53=_0x9fb680['body']['results'][0x0];if(_0x182c53[_0x308d('0x2f')][_0x308d('0x98')]===_0x308d('0x99')){return _0x384761[_0x308d('0x3b')]({'read':!![]});}else{logger[_0x308d('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x308d('0x2f'),_0x308d('0x97'),util[_0x308d('0x8d')](_0x9fb680[_0x308d('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x384761;}})[_0x308d('0x23')](respondWithResult(_0x1ca0fc,null))['catch'](handleError(_0x1ca0fc,null));}; \ No newline at end of file +var _0xed1c=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','params','keys','find','create','body','destroy','describe','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','email','internal','SmsAccount','SmsAccountId','debug','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','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model'];(function(_0x39edc8,_0x45c197){var _0x271318=function(_0x4f9231){while(--_0x4f9231){_0x39edc8['push'](_0x39edc8['shift']());}};_0x271318(++_0x45c197);}(_0xed1c,0xe4));var _0xced1=function(_0x2ed304,_0x2b69d9){_0x2ed304=_0x2ed304-0x0;var _0x4ce71=_0xed1c[_0x2ed304];return _0x4ce71;};'use strict';var emlformat=require(_0xced1('0x0'));var rimraf=require(_0xced1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xced1('0x2'));var Mustache=require(_0xced1('0x3'));var util=require(_0xced1('0x4'));var path=require('path');var sox=require(_0xced1('0x5'));var csv=require(_0xced1('0x6'));var ejs=require(_0xced1('0x7'));var fs=require('fs');var fs_extra=require(_0xced1('0x8'));var _=require('lodash');var squel=require(_0xced1('0x9'));var crypto=require(_0xced1('0xa'));var jsforce=require(_0xced1('0xb'));var deskjs=require(_0xced1('0xc'));var toCsv=require(_0xced1('0x6'));var querystring=require(_0xced1('0xd'));var Papa=require(_0xced1('0xe'));var Redis=require(_0xced1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xced1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xced1('0x11'));var logger=require(_0xced1('0x12'))(_0xced1('0x13'));var utils=require(_0xced1('0x14'));var config=require(_0xced1('0x15'));var licenseUtil=require(_0xced1('0x16'));var db=require(_0xced1('0x17'))['db'];config['redis']=_[_0xced1('0x18')](config[_0xced1('0x19')],{'host':_0xced1('0x1a'),'port':0x18eb});var socket=require(_0xced1('0x1b'))(new Redis(config['redis']));require(_0xced1('0x1c'))[_0xced1('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xced1('0x1e')][_0xced1('0x1f')]({'port':0x232c});var client9002=jayson[_0xced1('0x1e')][_0xced1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x47baec,_0x5560af,_0x3eb3ac,_0x4178d8){return new BPromise(function(_0x236473,_0x17e8ab){var _0x3e53bd=_0x4178d8||client;return _0x3e53bd[_0xced1('0x20')](_0x47baec,_0x3eb3ac)['then'](function(_0x56fc50){logger[_0xced1('0x21')](_0xced1('0x22'),_0x5560af,_0xced1('0x23'));logger['debug'](_0xced1('0x24'),_0x5560af,_0xced1('0x23'),JSON[_0xced1('0x25')](_0x56fc50));if(_0x56fc50['error']){if(_0x56fc50[_0xced1('0x26')][_0xced1('0x27')]===0x1f4){logger[_0xced1('0x26')]('SmsMessage,\x20%s,\x20%s',_0x5560af,_0x56fc50[_0xced1('0x26')][_0xced1('0x28')]);return _0x17e8ab(_0x56fc50[_0xced1('0x26')]['message']);}logger['error'](_0xced1('0x22'),_0x5560af,_0x56fc50[_0xced1('0x26')][_0xced1('0x28')]);return _0x236473(_0x56fc50[_0xced1('0x26')][_0xced1('0x28')]);}else{logger['info'](_0xced1('0x22'),_0x5560af,_0xced1('0x23'));_0x236473(_0x56fc50['result']['message']);}})[_0xced1('0x29')](function(_0x258c9a){logger[_0xced1('0x26')](_0xced1('0x22'),_0x5560af,_0x258c9a);_0x17e8ab(_0x258c9a);});});}function respondWithStatusCode(_0x1c2ba7,_0x25b6e7){_0x25b6e7=_0x25b6e7||0xcc;return function(_0x50c543){if(_0x50c543){return _0x1c2ba7[_0xced1('0x2a')](_0x25b6e7);}return _0x1c2ba7[_0xced1('0x2b')](_0x25b6e7)[_0xced1('0x2c')]();};}function respondWithResult(_0x351afc,_0x34dd2e){_0x34dd2e=_0x34dd2e||0xc8;return function(_0x8b3ffb){if(_0x8b3ffb){return _0x351afc[_0xced1('0x2b')](_0x34dd2e)['json'](_0x8b3ffb);}};}function respondWithFilteredResult(_0x15c4f4,_0x4ef64e){return function(_0x45cb03){if(_0x45cb03){var _0x2c2269=typeof _0x4ef64e[_0xced1('0x2d')]===_0xced1('0x2e')&&typeof _0x4ef64e['limit']==='undefined';var _0xec7760=_0x45cb03[_0xced1('0x2f')];var _0x2bc785=_0x2c2269?0x0:_0x4ef64e['offset'];var _0x573146=_0x2c2269?_0x45cb03['count']:_0x4ef64e[_0xced1('0x2d')]+_0x4ef64e[_0xced1('0x30')];var _0x2a6197;if(_0x573146>=_0xec7760){_0x573146=_0xec7760;_0x2a6197=0xc8;}else{_0x2a6197=0xce;}_0x15c4f4[_0xced1('0x2b')](_0x2a6197);return _0x15c4f4['set'](_0xced1('0x31'),_0x2bc785+'-'+_0x573146+'/'+_0xec7760)[_0xced1('0x32')](_0x45cb03);}return null;};}function patchUpdates(_0x46b672){return function(_0x2109c4){try{jsonpatch[_0xced1('0x33')](_0x2109c4,_0x46b672,!![]);}catch(_0x33ac43){return BPromise[_0xced1('0x34')](_0x33ac43);}return _0x2109c4['save']();};}function saveUpdates(_0x5453e6,_0x31f14e){return function(_0x2091f6){if(_0x2091f6){return _0x2091f6[_0xced1('0x35')](_0x5453e6)[_0xced1('0x36')](function(_0x63d21e){return _0x63d21e;});}return null;};}function removeEntity(_0x3eb109,_0x512c76){return function(_0x486562){if(_0x486562){return _0x486562['destroy']()['then'](function(){_0x3eb109[_0xced1('0x2b')](0xcc)[_0xced1('0x2c')]();});}};}function handleEntityNotFound(_0x1b68a8,_0x12da46){return function(_0x5c76bb){if(!_0x5c76bb){_0x1b68a8[_0xced1('0x2a')](0x194);}return _0x5c76bb;};}function handleError(_0x3c32c5,_0x11205e){_0x11205e=_0x11205e||0x1f4;return function(_0x4021de){logger[_0xced1('0x26')](_0x4021de[_0xced1('0x37')]);if(_0x4021de[_0xced1('0x38')]){delete _0x4021de[_0xced1('0x38')];}_0x3c32c5['status'](_0x11205e)[_0xced1('0x39')](_0x4021de);};}exports[_0xced1('0x3a')]=function(_0x1116de,_0x376927){var _0x3bdc6f={},_0x1bfd61={},_0x4b8187={'count':0x0,'rows':[]};var _0xc7afa1=_[_0xced1('0x3b')](db[_0xced1('0x3c')][_0xced1('0x3d')],function(_0x282361){return{'name':_0x282361[_0xced1('0x3e')],'type':_0x282361[_0xced1('0x3f')][_0xced1('0x40')]};});_0x1bfd61[_0xced1('0x41')]=_[_0xced1('0x3b')](_0xc7afa1,_0xced1('0x38'));_0x1bfd61['query']=_['keys'](_0x1116de[_0xced1('0x42')]);_0x1bfd61[_0xced1('0x43')]=_[_0xced1('0x44')](_0x1bfd61['model'],_0x1bfd61[_0xced1('0x42')]);_0x3bdc6f[_0xced1('0x45')]=_[_0xced1('0x44')](_0x1bfd61['model'],qs[_0xced1('0x46')](_0x1116de[_0xced1('0x42')]['fields']));_0x3bdc6f[_0xced1('0x45')]=_0x3bdc6f['attributes'][_0xced1('0x47')]?_0x3bdc6f[_0xced1('0x45')]:_0x1bfd61['model'];if(!_0x1116de[_0xced1('0x42')][_0xced1('0x48')](_0xced1('0x49'))){_0x3bdc6f['limit']=qs[_0xced1('0x30')](_0x1116de[_0xced1('0x42')]['limit']);_0x3bdc6f[_0xced1('0x2d')]=qs['offset'](_0x1116de['query'][_0xced1('0x2d')]);}_0x3bdc6f['order']=qs[_0xced1('0x4a')](_0x1116de[_0xced1('0x42')][_0xced1('0x4a')]);_0x3bdc6f['where']=qs[_0xced1('0x43')](_['pick'](_0x1116de[_0xced1('0x42')],_0x1bfd61[_0xced1('0x43')]),_0xc7afa1);if(_0x1116de[_0xced1('0x42')][_0xced1('0x4b')]){_0x3bdc6f['where']=_[_0xced1('0x4c')](_0x3bdc6f[_0xced1('0x4d')],{'$or':_['map'](_0xc7afa1,function(_0x4733f0){if(_0x4733f0[_0xced1('0x3f')]!=='VIRTUAL'){var _0x1800c8={};_0x1800c8[_0x4733f0[_0xced1('0x38')]]={'$like':'%'+_0x1116de[_0xced1('0x42')]['filter']+'%'};return _0x1800c8;}})});}_0x3bdc6f=_[_0xced1('0x4c')]({},_0x3bdc6f,_0x1116de[_0xced1('0x4e')]);var _0x39fc4a={'where':_0x3bdc6f[_0xced1('0x4d')]};return db[_0xced1('0x3c')]['count'](_0x39fc4a)[_0xced1('0x36')](function(_0x5e6669){_0x4b8187[_0xced1('0x2f')]=_0x5e6669;if(_0x1116de[_0xced1('0x42')][_0xced1('0x4f')]){_0x3bdc6f[_0xced1('0x50')]=[{'all':!![]}];}return db[_0xced1('0x3c')][_0xced1('0x51')](_0x3bdc6f);})['then'](function(_0x3570ff){_0x4b8187[_0xced1('0x52')]=_0x3570ff;return _0x4b8187;})['then'](respondWithFilteredResult(_0x376927,_0x3bdc6f))[_0xced1('0x29')](handleError(_0x376927,null));};exports['show']=function(_0x5153a6,_0x296d62){var _0x43d982={'raw':!![],'where':{'id':_0x5153a6[_0xced1('0x53')]['id']}},_0x1b3a1c={};_0x1b3a1c['model']=_[_0xced1('0x54')](db[_0xced1('0x3c')][_0xced1('0x3d')]);_0x1b3a1c['query']=_['keys'](_0x5153a6[_0xced1('0x42')]);_0x1b3a1c[_0xced1('0x43')]=_[_0xced1('0x44')](_0x1b3a1c[_0xced1('0x41')],_0x1b3a1c['query']);_0x43d982['attributes']=_['intersection'](_0x1b3a1c[_0xced1('0x41')],qs[_0xced1('0x46')](_0x5153a6[_0xced1('0x42')][_0xced1('0x46')]));_0x43d982[_0xced1('0x45')]=_0x43d982[_0xced1('0x45')][_0xced1('0x47')]?_0x43d982[_0xced1('0x45')]:_0x1b3a1c[_0xced1('0x41')];if(_0x5153a6['query'][_0xced1('0x4f')]){_0x43d982[_0xced1('0x50')]=[{'all':!![]}];}_0x43d982=_[_0xced1('0x4c')]({},_0x43d982,_0x5153a6['options']);return db[_0xced1('0x3c')][_0xced1('0x55')](_0x43d982)[_0xced1('0x36')](handleEntityNotFound(_0x296d62,null))[_0xced1('0x36')](respondWithResult(_0x296d62,null))['catch'](handleError(_0x296d62,null));};exports[_0xced1('0x56')]=function(_0x4e96eb,_0x539ee2){return db[_0xced1('0x3c')][_0xced1('0x56')](_0x4e96eb['body'],{})['then'](respondWithResult(_0x539ee2,0xc9))['catch'](handleError(_0x539ee2,null));};exports[_0xced1('0x35')]=function(_0x5dfcf4,_0x1af125){if(_0x5dfcf4[_0xced1('0x57')]['id']){delete _0x5dfcf4[_0xced1('0x57')]['id'];}return db[_0xced1('0x3c')][_0xced1('0x55')]({'where':{'id':_0x5dfcf4[_0xced1('0x53')]['id']}})[_0xced1('0x36')](handleEntityNotFound(_0x1af125,null))[_0xced1('0x36')](saveUpdates(_0x5dfcf4['body'],null))['then'](respondWithResult(_0x1af125,null))[_0xced1('0x29')](handleError(_0x1af125,null));};exports[_0xced1('0x58')]=function(_0x235651,_0x34262e){return db['SmsMessage'][_0xced1('0x55')]({'where':{'id':_0x235651[_0xced1('0x53')]['id']}})[_0xced1('0x36')](handleEntityNotFound(_0x34262e,null))[_0xced1('0x36')](removeEntity(_0x34262e,null))['catch'](handleError(_0x34262e,null));};exports[_0xced1('0x59')]=function(_0x2abd02,_0xf0d72a){return db[_0xced1('0x3c')][_0xced1('0x59')]()[_0xced1('0x36')](respondWithResult(_0xf0d72a,null))[_0xced1('0x29')](handleError(_0xf0d72a,null));};var interaction_log=require(_0xced1('0x12'))('sms-interactions');exports['accept']=function(_0x4cc559,_0x440b22,_0x52e873){var _0x398264={'agent':{},'channel':'sms'};if(_0x4cc559['body']['id']){delete _0x4cc559[_0xced1('0x57')]['id'];}_0x4cc559[_0xced1('0x57')][_0xced1('0x5a')]=!![];_0x4cc559[_0xced1('0x57')][_0xced1('0x5b')]=moment()[_0xced1('0x5c')](_0xced1('0x5d'));_0x4cc559[_0xced1('0x57')][_0xced1('0x5e')]=_0x4cc559[_0xced1('0x57')][_0xced1('0x5e')]||_0x4cc559['user']['id'];_0x398264[_0xced1('0x5f')]['id']=_0x4cc559[_0xced1('0x57')]['UserId'];return db[_0xced1('0x3c')][_0xced1('0x55')]({'where':{'id':_0x4cc559['params']['id'],'UserId':null}})[_0xced1('0x36')](handleEntityNotFound(_0x440b22,null))[_0xced1('0x36')](saveUpdates(_0x4cc559[_0xced1('0x57')],null))[_0xced1('0x36')](function(_0x16a7ce){if(_0x16a7ce){_0x398264['message']=_0x16a7ce['get']({'plain':!![]});return db['SmsInteraction'][_0xced1('0x55')]({'where':{'id':_0x16a7ce[_0xced1('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x440b22,null))[_0xced1('0x36')](function(_0x10447b){if(_0x10447b){return _0x10447b[_0xced1('0x35')]({'UserId':_0x4cc559['body'][_0xced1('0x5e')],'read1stAt':_[_0xced1('0x61')](_0x10447b['read1stAt'])?moment()[_0xced1('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xced1('0x36')](function(_0x355046){if(_0x355046){_0x398264[_0xced1('0x62')]=_0x355046[_0xced1('0x63')]({'plain':!![]});interaction_log[_0xced1('0x21')](_0xced1('0x64'),_0x4cc559[_0xced1('0x65')]['id'],_0x4cc559['user'][_0xced1('0x38')],_0x4cc559[_0xced1('0x65')][_0xced1('0x66')],_0x398264['interaction']['id'],_0x4cc559['body']?JSON[_0xced1('0x25')](_0x4cc559[_0xced1('0x57')]):'null');return respondWithRpcPromise(_0xced1('0x67'),_0xced1('0x68'),_0x398264);}return null;})[_0xced1('0x36')](function(_0x51c879){var _0x57107b=_0xced1('0x69')+_0x51c879[_0xced1('0x28')][_0xced1('0x6a')];return db[_0xced1('0x6b')][_0xced1('0x42')](_0x57107b,{'type':db[_0xced1('0x6c')]['QueryTypes'][_0xced1('0x6d')],'raw':!![]})['then'](function(_0x513315){return _0x513315;});})['then'](function(_0x4ae2af){if(_0x4ae2af){_0x398264[_0xced1('0x28')][_0xced1('0x6e')]=_0x4ae2af[0x0];if(!_0x4cc559['body']['UserId'])return;return db[_0xced1('0x6f')][_0xced1('0x55')]({'where':{'id':_0x4cc559['body']['UserId'],'role':_0xced1('0x5f')},'attributes':['id',_0xced1('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x45bc94){if(!_0x45bc94)return null;_0x398264[_0xced1('0x28')][_0xced1('0x5f')]=_0x45bc94;return _0x398264;})[_0xced1('0x36')](function(_0x3314e4){if(_0x3314e4){if(_0x4cc559[_0xced1('0x57')]['manual']){_0x398264[_0xced1('0x28')][_0xced1('0x70')]=util[_0xced1('0x5c')](_0xced1('0x71'),_0x4cc559[_0xced1('0x65')][_0xced1('0x38')]);_0x398264[_0xced1('0x28')][_0xced1('0x72')]=_0x398264[_0xced1('0x72')];_0x398264['message']['motionChannel']=_0x398264[_0xced1('0x72')];_0x398264['message'][_0xced1('0x73')]='accept';return respondWithRpcPromise(_0xced1('0x74'),_0xced1('0x74'),{'event':_0xced1('0x75'),'message':_0x398264[_0xced1('0x28')]},client9002)[_0xced1('0x36')](function(){return _0x398264;});}return _0x398264;}return null;})[_0xced1('0x36')](respondWithResult(_0x440b22,null))['catch'](handleError(_0x440b22,null));};var interaction_log=require(_0xced1('0x12'))(_0xced1('0x76'));exports[_0xced1('0x34')]=function(_0x3e7070,_0x137460,_0x2ec441){var _0x4fc259={'agent':{},'channel':'sms'};if(_0x3e7070[_0xced1('0x57')]['id']){delete _0x3e7070[_0xced1('0x57')]['id'];}_0x3e7070[_0xced1('0x57')][_0xced1('0x5e')]=_0x3e7070[_0xced1('0x57')]['UserId']||_0x3e7070[_0xced1('0x65')]['id'];_0x4fc259[_0xced1('0x5f')]['id']=_0x3e7070[_0xced1('0x57')][_0xced1('0x5e')];return db['SmsMessage'][_0xced1('0x55')]({'where':{'id':_0x3e7070[_0xced1('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x137460,null))[_0xced1('0x36')](function(_0x5854ee){if(_0x5854ee){_0x4fc259[_0xced1('0x28')]=_0x5854ee[_0xced1('0x63')]({'plain':!![]});return db[_0xced1('0x77')][_0xced1('0x55')]({'where':{'id':_0x5854ee[_0xced1('0x60')]}});}return null;})[_0xced1('0x36')](handleEntityNotFound(_0x137460,null))[_0xced1('0x36')](function(_0x17137e){if(_0x17137e){_0x4fc259[_0xced1('0x62')]=_0x17137e[_0xced1('0x63')]({'plain':!![]});interaction_log['info'](_0xced1('0x78'),_0x3e7070[_0xced1('0x65')]['id'],_0x3e7070[_0xced1('0x65')][_0xced1('0x38')],_0x3e7070['user'][_0xced1('0x66')],_0x4fc259[_0xced1('0x62')]['id'],_0x3e7070[_0xced1('0x57')]?JSON[_0xced1('0x25')](_0x3e7070['body']):_0xced1('0x79'));return respondWithRpcPromise(_0xced1('0x7a'),_0xced1('0x7b'),_0x4fc259);}return null;})[_0xced1('0x36')](function(_0x3beefd){var _0x4fa469=_0xced1('0x69')+_0x3beefd['message'][_0xced1('0x6a')];return db[_0xced1('0x6b')][_0xced1('0x42')](_0x4fa469,{'type':db['Sequelize'][_0xced1('0x7c')][_0xced1('0x6d')],'raw':!![]})['then'](function(_0x217afb){return _0x217afb;});})['then'](function(_0xc4a5c8){if(_0xc4a5c8){_0x4fc259[_0xced1('0x28')][_0xced1('0x6e')]=_0xc4a5c8[0x0];if(!_0x3e7070['body']['UserId'])return;return db[_0xced1('0x6f')][_0xced1('0x55')]({'where':{'id':_0x3e7070[_0xced1('0x57')][_0xced1('0x5e')],'role':_0xced1('0x5f')},'attributes':['id','name','fullname',_0xced1('0x7d'),_0xced1('0x7e')],'raw':!![]});}return null;})[_0xced1('0x36')](function(_0x4cf606){if(!_0x4cf606)return null;_0x4fc259[_0xced1('0x28')]['agent']=_0x4cf606;return _0x4fc259;})['then'](function(_0xd54ed3){if(_0xd54ed3){_0xd54ed3['message'][_0xced1('0x70')]=util['format'](_0xced1('0x71'),_0x3e7070[_0xced1('0x65')][_0xced1('0x38')]);_0xd54ed3[_0xced1('0x28')][_0xced1('0x72')]=_0x4fc259[_0xced1('0x72')];_0xd54ed3[_0xced1('0x28')]['motionChannel']=_0x4fc259['channel'];_0xd54ed3[_0xced1('0x28')][_0xced1('0x73')]=_0xced1('0x34');respondWithRpcPromise(_0xced1('0x74'),'EventManager',{'event':'rejectmessage','message':_0xd54ed3[_0xced1('0x28')]},client9002);return _0x4fc259;}return null;})['then'](respondWithResult(_0x137460,null))[_0xced1('0x29')](handleError(_0x137460,null));};exports[_0xced1('0x2b')]=function(_0x36184c,_0x4e13d1,_0x41f0a6){if(_0x36184c[_0xced1('0x57')]['id']){delete _0x36184c['body']['id'];}var _0x2e1c96;return db[_0xced1('0x3c')][_0xced1('0x55')]({'where':{'id':_0x36184c['params']['id']}})[_0xced1('0x36')](handleEntityNotFound(_0x4e13d1,null))[_0xced1('0x36')](function(_0x273987){if(_0x273987){_0x2e1c96=_0x273987;return db[_0xced1('0x7f')][_0xced1('0x55')]({'where':{'id':_0x273987[_0xced1('0x80')]}});}})['then'](handleEntityNotFound(_0x4e13d1,null))['then'](function(_0x35aefb){if(_0x35aefb){logger[_0xced1('0x81')](_0xced1('0x24'),_0xced1('0x2b'),_0xced1('0x82'),_0x35aefb[_0xced1('0x3f')],util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));switch(_0x35aefb[_0xced1('0x3f')]){case _0xced1('0x84'):if(_0x36184c[_0xced1('0x57')]['MessageSid']&&_0x36184c['body'][_0xced1('0x85')]===_0x2e1c96[_0xced1('0x86')]){return _0x2e1c96[_0xced1('0x35')]({'read':!![]});}else{logger[_0xced1('0x26')](_0xced1('0x87'),_0xced1('0x2b'),_0xced1('0x84'),util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));}break;case _0xced1('0x88'):if(_0x36184c[_0xced1('0x57')][_0xced1('0x89')]&&_0x36184c[_0xced1('0x57')][_0xced1('0x89')]===_0x2e1c96[_0xced1('0x86')]&&_[_0xced1('0x8a')]([_0xced1('0x8b'),_0xced1('0x8c')],_0x36184c['body'][_0xced1('0x8d')])>=0x0){return _0x2e1c96['update']({'read':!![]});}else{logger[_0xced1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xced1('0x2b'),_0xced1('0x8e'),util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));}break;case _0xced1('0x8f'):var _0x3a0f4b=_0x36184c[_0xced1('0x57')][_0xced1('0x90')][0x0];if(_0x3a0f4b[_0xced1('0x2b')][_0xced1('0x91')]===_0xced1('0x92')){return _0x2e1c96[_0xced1('0x35')]({'read':!![]});}else{logger[_0xced1('0x26')](_0xced1('0x87'),_0xced1('0x2b'),_0xced1('0x8f'),util[_0xced1('0x83')](_0x36184c[_0xced1('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x2e1c96;}})[_0xced1('0x36')](respondWithResult(_0x4e13d1,null))[_0xced1('0x29')](handleError(_0x4e13d1,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index e24b222..245cfa9 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 _0x0392=['emit','hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0392,0x1bc));var _0x2039=function(_0x5224d9,_0x3431c6){_0x5224d9=_0x5224d9-0x0;var _0x421ea3=_0x0392[_0x5224d9];return _0x421ea3;};'use strict';var EventEmitter=require(_0x2039('0x0'));var SmsMessage=require(_0x2039('0x1'))['db'][_0x2039('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2039('0x3')](0x0);var events={'afterCreate':_0x2039('0x4'),'afterUpdate':_0x2039('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46b745){return function(_0x3efeba,_0x5a8a9c,_0x35aceb){SmsMessageEvents[_0x2039('0x6')](_0x46b745+':'+_0x3efeba['id'],_0x3efeba);SmsMessageEvents[_0x2039('0x6')](_0x46b745,_0x3efeba);_0x35aceb(null);};}for(var e in events){if(events[_0x2039('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x2039('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x80ba=['remove','emit','hook','exports','events','../../mysqldb','SmsMessage','save','update'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x80ba,0xee));var _0xa80b=function(_0x5ce2ab,_0x278694){_0x5ce2ab=_0x5ce2ab-0x0;var _0x28351f=_0x80ba[_0x5ce2ab];return _0x28351f;};'use strict';var EventEmitter=require(_0xa80b('0x0'));var SmsMessage=require(_0xa80b('0x1'))['db'][_0xa80b('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa80b('0x3'),'afterUpdate':_0xa80b('0x4'),'afterDestroy':_0xa80b('0x5')};function emitEvent(_0x1d06b2){return function(_0xf98b45,_0x3f8634,_0x156767){SmsMessageEvents[_0xa80b('0x6')](_0x1d06b2+':'+_0xf98b45['id'],_0xf98b45);SmsMessageEvents[_0xa80b('0x6')](_0x1d06b2,_0xf98b45);_0x156767(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xa80b('0x7')](e,emitEvent(event));}}module[_0xa80b('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7977703..fc4f54e 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 _0x99ee=['finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','error','out','find','SmsAccountId','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','inspect','skebby','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','catch','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','toString','plivo','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','md5','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received'];(function(_0x5dd81d,_0x32880b){var _0x2b66d4=function(_0x78429b){while(--_0x78429b){_0x5dd81d['push'](_0x5dd81d['shift']());}};_0x2b66d4(++_0x32880b);}(_0x99ee,0x165));var _0xe99e=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x99ee[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0xe99e('0x0'));var util=require(_0xe99e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe99e('0x2'));var fs=require('fs');var path=require(_0xe99e('0x3'));var rimraf=require(_0xe99e('0x4'));var config=require(_0xe99e('0x5'));var attributes=require(_0xe99e('0x6'));module[_0xe99e('0x7')]=function(_0xf7a59e,_0x3b292a){return _0xf7a59e[_0xe99e('0x8')](_0xe99e('0x9'),attributes,{'tableName':_0xe99e('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xe99e('0xb'),'fields':[_0xe99e('0xc')],'type':_0xe99e('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x397a23,_0x23914c,_0x54bc9e){var _0x40349b=_0xf7a59e[_0xe99e('0xe')];var _0x53f8b3=_0x397a23[_0xe99e('0xf')]({'plain':!![]});if(_0x53f8b3['direction'][_0xe99e('0x10')]()==='in'||_0x53f8b3[_0xe99e('0x11')][_0xe99e('0x10')]()==='out'&&!_0x53f8b3['secret']&&!_[_0xe99e('0x12')](_0x53f8b3['UserId'])&&!_['isNil'](_0x53f8b3['SmsInteractionId'])){_0x40349b[_0xe99e('0x13')][_0xe99e('0x14')]({'where':{'id':_0x53f8b3[_0xe99e('0x15')]}})[_0xe99e('0x16')](function(_0x3bb721){if(_0x3bb721){_0x3bb721[_0xe99e('0x17')]({'lastMsgAt':_0x53f8b3['createdAt'],'lastMsgDirection':_0x53f8b3[_0xe99e('0x11')][_0xe99e('0x10')]()});}})['catch'](function(_0xde3fef){console[_0xe99e('0x18')](_0xde3fef);});}if(_0x53f8b3[_0xe99e('0x11')]===_0xe99e('0x19')&&!_0x53f8b3['secret']){var _0x35bec4;_0x40349b['SmsAccount'][_0xe99e('0x1a')]({'where':{'id':_0x53f8b3[_0xe99e('0x1b')]},'raw':!![]})[_0xe99e('0x16')](function(_0x2534e4){_0x35bec4=_0x2534e4;if(_0x35bec4&&_0x35bec4['type']){switch(_0x35bec4['type']){case _0xe99e('0x1c'):var _0xc5d533=require(_0xe99e('0x1c'));if(_0x35bec4[_0xe99e('0x1d')]&&_0x35bec4[_0xe99e('0x1e')]&&_0x35bec4[_0xe99e('0x1f')]){var _0x257638=new _0xc5d533(_0x35bec4[_0xe99e('0x1d')],_0x35bec4[_0xe99e('0x1e')]);_0x257638[_0xe99e('0x20')][_0xe99e('0x21')]({'body':_0x53f8b3[_0xe99e('0xc')],'to':_0x53f8b3[_0xe99e('0x1f')],'from':_0x35bec4[_0xe99e('0x1f')],'statusCallback':_0x35bec4['remote']+_0xe99e('0x22')+_0x53f8b3['id']+_0xe99e('0x23')+_0x35bec4[_0xe99e('0x24')]})[_0xe99e('0x16')](function(_0x3dac8d){if(_0x3dac8d[_0xe99e('0x25')]){return _0x397a23[_0xe99e('0x17')]({'messageId':_0x3dac8d[_0xe99e('0x25')]});}})['catch'](function(_0x2e413a){logger['error'](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x1c'),util['inspect'](_0x2e413a,{'showHidden':![],'depth':null}));});}else{logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x1c'),_0xe99e('0x28'));}break;case'skebby':var _0x52fba1=_0xe99e('0x29');if(_0x35bec4['username']&&_0x35bec4[_0xe99e('0x2a')]){var _0x3708a8={'recipient':[_0x53f8b3[_0xe99e('0x1f')]],'message':_0x53f8b3[_0xe99e('0xc')],'message_type':_0x35bec4[_0xe99e('0x2b')]};if(_0x35bec4['smsMethod']&&_0x35bec4[_0xe99e('0x2b')]!=='SI'){_0x3708a8[_0xe99e('0x2c')]=_0x35bec4[_0xe99e('0x1f')];}var _0x26e4fa={'url':_0x52fba1+_0xe99e('0x2d')+_0x35bec4[_0xe99e('0x2e')]+_0xe99e('0x2f')+_0x35bec4[_0xe99e('0x2a')],'method':'GET'};rp(_0x26e4fa)['then'](function(_0x570bdb){var _0x4c1b6e=_0x570bdb[_0xe99e('0x30')](';');var _0x5a7d1a={'user_key':_0x4c1b6e[0x0],'session_key':_0x4c1b6e[0x1]};_0x26e4fa={'url':_0x52fba1+_0xe99e('0x31'),'method':_0xe99e('0x32'),'headers':{'user_key':_0x5a7d1a[_0xe99e('0x33')],'Session_key':_0x5a7d1a['session_key']},'json':!![],'body':_0x3708a8};return rp(_0x26e4fa);})[_0xe99e('0x16')](function(_0x55e644){if(_0x55e644[_0xe99e('0x34')]>=0x1){var _0x49c0f9={'messageId':_0x55e644[_0xe99e('0x35')]};if(_0x35bec4[_0xe99e('0x2b')]!=='GP'||!_0x35bec4[_0xe99e('0x36')]){_0x49c0f9[_0xe99e('0x37')]=!![];}return _0x397a23[_0xe99e('0x17')](_0x49c0f9);}else{return logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),'skebby',util[_0xe99e('0x38')](_0x55e644,{'showHidden':![],'depth':null}));}})['catch'](function(_0x418c69){return logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x39'),util[_0xe99e('0x38')](_0x418c69,{'showHidden':![],'depth':null}));});}else{logger[_0xe99e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe99e('0x27'),_0xe99e('0x39'),_0xe99e('0x3a'));}break;case _0xe99e('0x3b'):if(_0x35bec4['authToken']){var _0x2095d0={'recipient':_0x53f8b3['phone'],'message':_0x53f8b3[_0xe99e('0xc')],'sender':_0x35bec4['senderString']||_0x35bec4[_0xe99e('0x1f')],'authorization':_0x35bec4['authToken']};var _0x23914c={'method':_0xe99e('0x32'),'uri':_0xe99e('0x3c'),'body':_0x2095d0,'json':!![]};rp(_0x23914c)[_0xe99e('0x16')](function(_0x10e70c){var _0xc85ed8={'messageId':_0x10e70c[_0xe99e('0x3d')]};if(!_0x35bec4[_0xe99e('0x36')]){_0xc85ed8[_0xe99e('0x37')]=!![];}return _0x397a23[_0xe99e('0x17')](_0xc85ed8);})['catch'](function(_0x4a4be5){logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x3b'),util['inspect'](_0x4a4be5,{'showHidden':![],'depth':null}));});}else{logger[_0xe99e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe99e('0x27'),_0xe99e('0x3b'),_0xe99e('0x3e'));}break;case _0xe99e('0x3f'):if(_0x35bec4[_0xe99e('0x2e')]&&_0x35bec4[_0xe99e('0x2a')]){var _0x2095d0={'messages':[{'source':'xCALLY\x20Motion','to':_0x53f8b3[_0xe99e('0x1f')],'body':_0x53f8b3[_0xe99e('0xc')],'from':_0x35bec4['senderString']||_0x35bec4[_0xe99e('0x1f')]}]};var _0x2fa38c=util[_0xe99e('0x40')](_0xe99e('0x41'),_0x35bec4[_0xe99e('0x2e')],_0x35bec4[_0xe99e('0x2a')]);var _0x23914c={'method':'POST','uri':_0xe99e('0x42'),'body':_0x2095d0,'headers':{'Authorization':util[_0xe99e('0x40')](_0xe99e('0x43'),new Buffer(_0x2fa38c)['toString'](_0xe99e('0x44')))},'json':!![]};rp(_0x23914c)[_0xe99e('0x16')](function(_0x566988){if(_0x566988[_0xe99e('0x45')]>=0xc8&&_0x566988[_0xe99e('0x45')]<=0xce){if(_0x566988['data']&&_0x566988[_0xe99e('0x46')][_0xe99e('0x47')]>0x0){var _0x32ac6f=_[_0xe99e('0x48')](_0x566988[_0xe99e('0x46')]['messages']);var _0x1216db={'messageId':_0x32ac6f[_0xe99e('0x49')]};if(!_0x35bec4['deliveryReport']){_0x1216db[_0xe99e('0x37')]=!![];}return _0x397a23['update'](_0x1216db);}else{logger[_0xe99e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe99e('0x27'),'clickSend',util['inspect'](_0x566988,{'showHidden':![],'depth':null}));}}else{logger[_0xe99e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe99e('0x27'),'clickSend',util[_0xe99e('0x38')](_0x566988,{'showHidden':![],'depth':null}));}})[_0xe99e('0x4a')](function(_0x240dda){logger['error'](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x4b'),util[_0xe99e('0x38')](_0x240dda,{'showHidden':![],'depth':null}));});}else{logger[_0xe99e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe99e('0x27'),_0xe99e('0x4b'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x35bec4[_0xe99e('0x4c')]&&_0x35bec4[_0xe99e('0x1e')]){var _0x2095d0={'dst':_0x53f8b3[_0xe99e('0x1f')],'text':_0x53f8b3[_0xe99e('0xc')],'src':_0x35bec4['senderString']||_0x35bec4['phone'],'url':_0x35bec4[_0xe99e('0x4d')]+'/api/sms/messages/'+_0x53f8b3['id']+_0xe99e('0x23')+_0x35bec4[_0xe99e('0x24')]};var _0x2fa38c=util['format'](_0xe99e('0x41'),_0x35bec4[_0xe99e('0x4c')],_0x35bec4['authToken']);var _0x23914c={'method':_0xe99e('0x32'),'uri':util[_0xe99e('0x40')](_0xe99e('0x4e'),_0x35bec4[_0xe99e('0x4c')]),'body':_0x2095d0,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2fa38c)[_0xe99e('0x4f')](_0xe99e('0x44')))},'json':!![]};rp(_0x23914c)['then'](function(_0x3f98fc){var _0x336160={'messageId':_0x3f98fc['message_uuid'][0x0]};return _0x397a23[_0xe99e('0x17')](_0x336160);})[_0xe99e('0x4a')](function(_0x425755){logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),'plivo',util[_0xe99e('0x38')](_0x425755,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xe99e('0x51'):if(_0x35bec4[_0xe99e('0x2e')]&&_0x35bec4[_0xe99e('0x2a')]){if(_0x35bec4['baseUrl']){var _0x1ed05a={'method':_0xe99e('0x32'),'uri':_0x35bec4[_0xe99e('0x52')]+_0xe99e('0x53'),'body':{'username':_0x35bec4['username'],'password':_0x35bec4[_0xe99e('0x2a')]},'json':!![]};return rp(_0x1ed05a)['then'](function(_0x31b3a1){var _0x35f878={'method':'POST','uri':_0x35bec4[_0xe99e('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x35bec4[_0xe99e('0x1f')],'destinations':[{'to':_0x53f8b3[_0xe99e('0x1f')]}],'text':_0x53f8b3['body'],'notifyUrl':_0x35bec4[_0xe99e('0x4d')]+_0xe99e('0x22')+_0x53f8b3['id']+_0xe99e('0x23')+_0x35bec4[_0xe99e('0x24')],'notifyContentType':_0xe99e('0x54'),'callbackData':_0x35bec4['phone']+';'+_0x53f8b3[_0xe99e('0xc')]}]},'headers':{'Authorization':_0xe99e('0x55')+_0x31b3a1[_0xe99e('0x24')]},'json':!![]};return rp(_0x35f878)[_0xe99e('0x16')](function(_0x5b9504){if(_0x5b9504[_0xe99e('0x20')]){var _0x349d26={'messageId':_0x5b9504[_0xe99e('0x20')][0x0]['messageId']};if(!_0x35bec4[_0xe99e('0x36')]){_0x349d26[_0xe99e('0x37')]=!![];}return _0x397a23['update'](_0x349d26);}else{return logger[_0xe99e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe99e('0x27'),_0xe99e('0x51'),util[_0xe99e('0x38')](_0x5b9504,{'showHidden':![],'depth':null}));}});})[_0xe99e('0x4a')](function(_0x39fcea){return logger['error'](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x51'),util[_0xe99e('0x38')](_0x39fcea,{'showHidden':![],'depth':null}));});}else{logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x51'),_0xe99e('0x3a'));}break;case _0xe99e('0x56'):var _0x2b58b3=require(_0xe99e('0x57'));if(_0x35bec4[_0xe99e('0x58')]){var _0x589e39={};_0x589e39[_0xe99e('0x59')]=_0x35bec4['username'];_0x589e39[_0xe99e('0x1f')]=_0x53f8b3['phone'];_0x589e39['sender']=_0x35bec4[_0xe99e('0x1f')];_0x589e39[_0xe99e('0x5a')]=_0x53f8b3[_0xe99e('0xc')];_0x589e39[_0xe99e('0x5b')]=+new Date();var _0x5e5e49='';var _0x303cf8='';var _0xce9ec4=Object[_0xe99e('0x5c')](_0x589e39);_0xce9ec4[_0xe99e('0x5d')]();for(var _0x39fd3e=0x0;_0x39fd3e<_0xce9ec4[_0xe99e('0x5e')];_0x39fd3e++){if(_0x5e5e49!=''){_0x5e5e49+='&';}_0x5e5e49+=_0xce9ec4[_0x39fd3e]+'='+encodeURIComponent(_0x589e39[_0xce9ec4[_0x39fd3e]]);_0x303cf8+=_0x589e39[_0xce9ec4[_0x39fd3e]];}_0x303cf8+=_0x35bec4['apiKey'];_0x303cf8=_0x2b58b3['createHash'](_0xe99e('0x5f'))[_0xe99e('0x17')](_0x303cf8)['digest'](_0xe99e('0x60'));if(_0x5e5e49!==''){_0x5e5e49+='&';}_0x5e5e49+=_0xe99e('0x61')+_0x303cf8;var _0x26e4fa={'method':'GET','uri':_0x35bec4[_0xe99e('0x52')]+'/external/get/send.php?'+_0x5e5e49,'json':!![]};return rp(_0x26e4fa)[_0xe99e('0x16')](function(_0xe9d3a5){var _0x1e724e=Object[_0xe99e('0x5c')](_0xe9d3a5);if(_0xe9d3a5[_0x1e724e[0x0]][_0xe99e('0x18')]&&parseInt(_0xe9d3a5[_0x1e724e[0x0]]['error'])===0x0){var _0x273ca4={'messageId':_0xe9d3a5[_0x1e724e[0x0]][_0xe99e('0x62')]};if(!_0x35bec4[_0xe99e('0x36')]){_0x273ca4['read']=!![];}return _0x397a23[_0xe99e('0x17')](_0x273ca4);}else{return logger[_0xe99e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe99e('0x27'),_0xe99e('0x56'),util['inspect'](_0xe9d3a5['error'],{'showHidden':![],'depth':null}));}})[_0xe99e('0x4a')](function(_0x2f1f7d){return logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x56'),util[_0xe99e('0x38')](_0x2f1f7d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe99e('0x26'),_0xe99e('0x27'),'csc',_0xe99e('0x63'));}break;case _0xe99e('0x64'):if(_0x35bec4[_0xe99e('0x58')]){var _0x55d492={'method':'POST','uri':_0xe99e('0x65'),'headers':{'Authorization':_0x35bec4['apiKey']},'body':{'content':_0x53f8b3[_0xe99e('0xc')],'to':[_0x53f8b3[_0xe99e('0x1f')]],'from':_0x35bec4[_0xe99e('0x1f')],'binary':![],'clientMessageId':_0xe99e('0x66'),'charset':'UTF-8'},'json':!![]};rp(_0x55d492)['then'](function(_0x42ce86){if(!_0x42ce86[_0xe99e('0x18')]){var _0x5c5119={'messageId':_0x42ce86[_0xe99e('0x20')][0x0][_0xe99e('0x67')]};if(!_0x35bec4[_0xe99e('0x36')]){_0x5c5119[_0xe99e('0x37')]=!![];}return _0x397a23[_0xe99e('0x17')](_0x5c5119);}else{return logger['error'](_0xe99e('0x26'),'afterCreate',_0xe99e('0x64'),util[_0xe99e('0x38')](_0x42ce86['error'],{'showHidden':![],'depth':null}));}})[_0xe99e('0x4a')](function(_0x4c2c31){return logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x64'),util[_0xe99e('0x38')](_0x4c2c31,{'showHidden':![],'depth':null}));});}else{logger[_0xe99e('0x18')](_0xe99e('0x26'),'afterCreate',_0xe99e('0x64'),_0xe99e('0x63'));}break;case _0xe99e('0x68'):if(_0x35bec4[_0xe99e('0x2e')]&&_0x35bec4['password']){var _0x2fa38c=util['format'](_0xe99e('0x41'),_0x35bec4[_0xe99e('0x2e')],_0x35bec4[_0xe99e('0x2a')]);var _0x23914c={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x35bec4['accountId']+'/messages','body':{'to':[_0x53f8b3['phone']],'text':_0x53f8b3[_0xe99e('0xc')],'from':_0x35bec4[_0xe99e('0x1f')],'applicationId':_0x35bec4[_0xe99e('0x69')]},'headers':{'Authorization':util['format'](_0xe99e('0x43'),new Buffer(_0x2fa38c)[_0xe99e('0x4f')](_0xe99e('0x44')))},'json':!![]};rp(_0x23914c)[_0xe99e('0x16')](function(_0x2cfeb0){if(_0x2cfeb0['id']){var _0x5c48f3={'messageId':_0x2cfeb0['id']};return _0x397a23[_0xe99e('0x17')](_0x5c48f3);}else{logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x68'),util[_0xe99e('0x38')](_0x2cfeb0,{'showHidden':![],'depth':null}));}})[_0xe99e('0x4a')](function(_0x368f2d){logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),'bandwidth',util[_0xe99e('0x38')](_0x368f2d,{'showHidden':![],'depth':null}));});}else{logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),_0xe99e('0x68'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe99e('0x6a'):if(_0x35bec4[_0xe99e('0x58')]){var _0x45decf={};var _0x26e4fa={'method':'POST','uri':_0xe99e('0x6b'),'headers':{'Authorization':_0xe99e('0x6c')+_0x35bec4['apiKey'],'Content-Type':_0xe99e('0x54')},'body':{'from':_0x35bec4[_0xe99e('0x1f')],'to':_0x53f8b3[_0xe99e('0x1f')],'text':_0x53f8b3[_0xe99e('0xc')]},'json':!![]};return rp(_0x26e4fa)[_0xe99e('0x16')](function(_0x2a00c8){if(_0x2a00c8[_0xe99e('0x6d')]==0xca){_0x45decf[_0xe99e('0x6e')]=_0x2a00c8;var _0x49cea0={'method':'POST','uri':_0xe99e('0x6f'),'headers':{'Authorization':_0xe99e('0x6c')+_0x35bec4[_0xe99e('0x58')],'Content-Type':_0xe99e('0x54')},'body':{'refid':_0x45decf[_0xe99e('0x6e')][_0xe99e('0x70')]},'json':!![]};return rp(_0x49cea0)['then'](function(_0x23931b){_0x45decf[_0xe99e('0x71')]=_0x23931b;var _0x56e005={'messageId':_0x45decf['message']['refid'],'read':!![]};return _0x397a23[_0xe99e('0x17')](_0x56e005);});}else{return logger[_0xe99e('0x18')](_0xe99e('0x26'),_0xe99e('0x27'),'intelepeer',util['inspect'](_0x2a00c8,{'showHidden':![],'depth':null}));}})[_0xe99e('0x4a')](function(_0x576ede){return logger[_0xe99e('0x18')](_0xe99e('0x26'),'afterCreate',_0xe99e('0x6a'),util[_0xe99e('0x38')](_0x576ede,{'showHidden':![],'depth':null}));});}else{return logger[_0xe99e('0x18')](_0xe99e('0x26'),'afterCreate',_0xe99e('0x6a'),_0xe99e('0x72'));}break;}}})[_0xe99e('0x73')](function(){_0x54bc9e();});}else{_0x54bc9e();}}},'charset':_0xe99e('0x74'),'collate':_0xe99e('0x75')});}; \ No newline at end of file +var _0x6bde=['connectel','senderString','requestid','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','keys','sort','length','apiKey','createHash','md5','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','message','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','createdAt','catch','error','SmsAccount','find','then','type','twilio','authToken','phone','accountSid','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','update','Missing\x20parameters:\x20username,\x20password'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x6bde,0x13d));var _0xe6bd=function(_0x47cbee,_0x2c77d6){_0x47cbee=_0x47cbee-0x0;var _0x306a46=_0x6bde[_0x47cbee];return _0x306a46;};'use strict';var _=require('lodash');var util=require(_0xe6bd('0x0'));var logger=require(_0xe6bd('0x1'))(_0xe6bd('0x2'));var moment=require('moment');var BPromise=require(_0xe6bd('0x3'));var rp=require(_0xe6bd('0x4'));var fs=require('fs');var path=require(_0xe6bd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe6bd('0x6'));module[_0xe6bd('0x7')]=function(_0x4c13d5,_0xf19f83){return _0x4c13d5[_0xe6bd('0x8')]('SmsMessage',attributes,{'tableName':_0xe6bd('0x9'),'paranoid':![],'indexes':[{'name':_0xe6bd('0xa'),'fields':[_0xe6bd('0xa')]},{'name':_0xe6bd('0xb'),'fields':[_0xe6bd('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5eb77a,_0x3bf274,_0x5b72c1){var _0x4a5f52=_0x4c13d5[_0xe6bd('0xd')];var _0x3c3ed5=_0x5eb77a['get']({'plain':!![]});if(_0x3c3ed5[_0xe6bd('0xe')][_0xe6bd('0xf')]()==='in'||_0x3c3ed5[_0xe6bd('0xe')]['toLowerCase']()===_0xe6bd('0x10')&&!_0x3c3ed5[_0xe6bd('0x11')]&&!_[_0xe6bd('0x12')](_0x3c3ed5[_0xe6bd('0x13')])&&!_[_0xe6bd('0x12')](_0x3c3ed5[_0xe6bd('0x14')])){_0x4a5f52[_0xe6bd('0x15')][_0xe6bd('0x16')]({'where':{'id':_0x3c3ed5['SmsInteractionId']}})['then'](function(_0x245644){if(_0x245644){_0x245644['update']({'lastMsgAt':_0x3c3ed5[_0xe6bd('0x17')],'lastMsgDirection':_0x3c3ed5[_0xe6bd('0xe')][_0xe6bd('0xf')]()});}})[_0xe6bd('0x18')](function(_0x4cdf59){console[_0xe6bd('0x19')](_0x4cdf59);});}if(_0x3c3ed5[_0xe6bd('0xe')]==='out'&&!_0x3c3ed5['secret']){var _0x196ce0;_0x4a5f52[_0xe6bd('0x1a')][_0xe6bd('0x1b')]({'where':{'id':_0x3c3ed5['SmsAccountId']},'raw':!![]})[_0xe6bd('0x1c')](function(_0x155fc3){_0x196ce0=_0x155fc3;if(_0x196ce0&&_0x196ce0['type']){switch(_0x196ce0[_0xe6bd('0x1d')]){case _0xe6bd('0x1e'):var _0x38aa95=require(_0xe6bd('0x1e'));if(_0x196ce0['accountSid']&&_0x196ce0[_0xe6bd('0x1f')]&&_0x196ce0[_0xe6bd('0x20')]){var _0x58d4fc=new _0x38aa95(_0x196ce0[_0xe6bd('0x21')],_0x196ce0['authToken']);_0x58d4fc['messages']['create']({'body':_0x3c3ed5[_0xe6bd('0xc')],'to':_0x3c3ed5[_0xe6bd('0x20')],'from':_0x196ce0[_0xe6bd('0x20')],'statusCallback':_0x196ce0[_0xe6bd('0x22')]+_0xe6bd('0x23')+_0x3c3ed5['id']+_0xe6bd('0x24')+_0x196ce0['token']})['then'](function(_0x34f6b6){if(_0x34f6b6[_0xe6bd('0x25')]){return _0x5eb77a['update']({'messageId':_0x34f6b6[_0xe6bd('0x25')]});}})[_0xe6bd('0x18')](function(_0x344505){logger['error'](_0xe6bd('0x26'),'afterCreate','twilio',util[_0xe6bd('0x27')](_0x344505,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x1e'),_0xe6bd('0x29'));}break;case _0xe6bd('0x2a'):var _0x2497d3=_0xe6bd('0x2b');if(_0x196ce0[_0xe6bd('0x2c')]&&_0x196ce0[_0xe6bd('0x2d')]){var _0x567c8e={'recipient':[_0x3c3ed5['phone']],'message':_0x3c3ed5[_0xe6bd('0xc')],'message_type':_0x196ce0[_0xe6bd('0x2e')]};if(_0x196ce0[_0xe6bd('0x2e')]&&_0x196ce0[_0xe6bd('0x2e')]!=='SI'){_0x567c8e[_0xe6bd('0x2f')]=_0x196ce0[_0xe6bd('0x20')];}var _0x4024b9={'url':_0x2497d3+_0xe6bd('0x30')+_0x196ce0['username']+'&password='+_0x196ce0[_0xe6bd('0x2d')],'method':_0xe6bd('0x31')};rp(_0x4024b9)['then'](function(_0x5ac467){var _0x2d8651=_0x5ac467[_0xe6bd('0x32')](';');var _0x7e8732={'user_key':_0x2d8651[0x0],'session_key':_0x2d8651[0x1]};_0x4024b9={'url':_0x2497d3+_0xe6bd('0x33'),'method':_0xe6bd('0x34'),'headers':{'user_key':_0x7e8732[_0xe6bd('0x35')],'Session_key':_0x7e8732[_0xe6bd('0x36')]},'json':!![],'body':_0x567c8e};return rp(_0x4024b9);})[_0xe6bd('0x1c')](function(_0x2b0456){if(_0x2b0456[_0xe6bd('0x37')]>=0x1){var _0x55428c={'messageId':_0x2b0456[_0xe6bd('0x38')]};if(_0x196ce0[_0xe6bd('0x2e')]!=='GP'||!_0x196ce0[_0xe6bd('0x39')]){_0x55428c[_0xe6bd('0x3a')]=!![];}return _0x5eb77a[_0xe6bd('0x3b')](_0x55428c);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6bd('0x28'),_0xe6bd('0x2a'),util[_0xe6bd('0x27')](_0x2b0456,{'showHidden':![],'depth':null}));}})[_0xe6bd('0x18')](function(_0x1cb689){return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x2a'),util[_0xe6bd('0x27')](_0x1cb689,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6bd('0x28'),_0xe6bd('0x2a'),_0xe6bd('0x3c'));}break;case _0xe6bd('0x3d'):if(_0x196ce0['authToken']){var _0x3d8116={'recipient':_0x3c3ed5['phone'],'message':_0x3c3ed5[_0xe6bd('0xc')],'sender':_0x196ce0[_0xe6bd('0x3e')]||_0x196ce0[_0xe6bd('0x20')],'authorization':_0x196ce0[_0xe6bd('0x1f')]};var _0x3bf274={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x3d8116,'json':!![]};rp(_0x3bf274)[_0xe6bd('0x1c')](function(_0x10a509){var _0x2174c0={'messageId':_0x10a509[_0xe6bd('0x3f')]};if(!_0x196ce0[_0xe6bd('0x39')]){_0x2174c0[_0xe6bd('0x3a')]=!![];}return _0x5eb77a['update'](_0x2174c0);})[_0xe6bd('0x18')](function(_0xcb2232){logger[_0xe6bd('0x19')](_0xe6bd('0x26'),'afterCreate','connectel',util['inspect'](_0xcb2232,{'showHidden':![],'depth':null}));});}else{logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0xe6bd('0x40'):if(_0x196ce0['username']&&_0x196ce0[_0xe6bd('0x2d')]){var _0x3d8116={'messages':[{'source':'xCALLY\x20Motion','to':_0x3c3ed5['phone'],'body':_0x3c3ed5[_0xe6bd('0xc')],'from':_0x196ce0[_0xe6bd('0x3e')]||_0x196ce0[_0xe6bd('0x20')]}]};var _0x4ef43a=util[_0xe6bd('0x41')](_0xe6bd('0x42'),_0x196ce0['username'],_0x196ce0['password']);var _0x3bf274={'method':_0xe6bd('0x34'),'uri':_0xe6bd('0x43'),'body':_0x3d8116,'headers':{'Authorization':util[_0xe6bd('0x41')](_0xe6bd('0x44'),new Buffer(_0x4ef43a)[_0xe6bd('0x45')](_0xe6bd('0x46')))},'json':!![]};rp(_0x3bf274)[_0xe6bd('0x1c')](function(_0x248d2d){if(_0x248d2d[_0xe6bd('0x47')]>=0xc8&&_0x248d2d[_0xe6bd('0x47')]<=0xce){if(_0x248d2d[_0xe6bd('0x48')]&&_0x248d2d[_0xe6bd('0x48')][_0xe6bd('0x49')]>0x0){var _0x54d791=_[_0xe6bd('0x4a')](_0x248d2d['data'][_0xe6bd('0x4b')]);var _0x34c07d={'messageId':_0x54d791[_0xe6bd('0x4c')]};if(!_0x196ce0[_0xe6bd('0x39')]){_0x34c07d['read']=!![];}return _0x5eb77a[_0xe6bd('0x3b')](_0x34c07d);}else{logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x4d'),util['inspect'](_0x248d2d,{'showHidden':![],'depth':null}));}}else{logger[_0xe6bd('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6bd('0x28'),_0xe6bd('0x4d'),util[_0xe6bd('0x27')](_0x248d2d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3bc31c){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6bd('0x28'),'clickSend',util[_0xe6bd('0x27')](_0x3bc31c,{'showHidden':![],'depth':null}));});}else{logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),'clickSend',_0xe6bd('0x3c'));}break;case _0xe6bd('0x4e'):if(_0x196ce0[_0xe6bd('0x4f')]&&_0x196ce0[_0xe6bd('0x1f')]){var _0x3d8116={'dst':_0x3c3ed5[_0xe6bd('0x20')],'text':_0x3c3ed5[_0xe6bd('0xc')],'src':_0x196ce0[_0xe6bd('0x3e')]||_0x196ce0[_0xe6bd('0x20')],'url':_0x196ce0[_0xe6bd('0x22')]+_0xe6bd('0x23')+_0x3c3ed5['id']+'/status?token='+_0x196ce0['token']};var _0x4ef43a=util[_0xe6bd('0x41')](_0xe6bd('0x42'),_0x196ce0[_0xe6bd('0x4f')],_0x196ce0['authToken']);var _0x3bf274={'method':'POST','uri':util[_0xe6bd('0x41')](_0xe6bd('0x50'),_0x196ce0[_0xe6bd('0x4f')]),'body':_0x3d8116,'headers':{'Authorization':util['format'](_0xe6bd('0x44'),new Buffer(_0x4ef43a)[_0xe6bd('0x45')](_0xe6bd('0x46')))},'json':!![]};rp(_0x3bf274)['then'](function(_0x26f693){var _0x284883={'messageId':_0x26f693[_0xe6bd('0x51')][0x0]};return _0x5eb77a['update'](_0x284883);})['catch'](function(_0x1af47f){logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x4e'),util['inspect'](_0x1af47f,{'showHidden':![],'depth':null}));});}else{logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x4e'),_0xe6bd('0x52'));}break;case _0xe6bd('0x53'):if(_0x196ce0[_0xe6bd('0x2c')]&&_0x196ce0[_0xe6bd('0x2d')]){if(_0x196ce0[_0xe6bd('0x54')]){var _0x298ec9={'method':_0xe6bd('0x34'),'uri':_0x196ce0[_0xe6bd('0x54')]+_0xe6bd('0x55'),'body':{'username':_0x196ce0[_0xe6bd('0x2c')],'password':_0x196ce0[_0xe6bd('0x2d')]},'json':!![]};return rp(_0x298ec9)[_0xe6bd('0x1c')](function(_0x5acaf5){var _0x53c703={'method':_0xe6bd('0x34'),'uri':_0x196ce0[_0xe6bd('0x54')]+_0xe6bd('0x56'),'body':{'messages':[{'from':_0x196ce0[_0xe6bd('0x20')],'destinations':[{'to':_0x3c3ed5[_0xe6bd('0x20')]}],'text':_0x3c3ed5[_0xe6bd('0xc')],'notifyUrl':_0x196ce0['remote']+_0xe6bd('0x23')+_0x3c3ed5['id']+_0xe6bd('0x24')+_0x196ce0[_0xe6bd('0x57')],'notifyContentType':_0xe6bd('0x58'),'callbackData':_0x196ce0[_0xe6bd('0x20')]+';'+_0x3c3ed5[_0xe6bd('0xc')]}]},'headers':{'Authorization':_0xe6bd('0x59')+_0x5acaf5[_0xe6bd('0x57')]},'json':!![]};return rp(_0x53c703)[_0xe6bd('0x1c')](function(_0x512d3e){if(_0x512d3e[_0xe6bd('0x4b')]){var _0x4c6fa2={'messageId':_0x512d3e['messages'][0x0][_0xe6bd('0xa')]};if(!_0x196ce0[_0xe6bd('0x39')]){_0x4c6fa2[_0xe6bd('0x3a')]=!![];}return _0x5eb77a[_0xe6bd('0x3b')](_0x4c6fa2);}else{return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x53'),util['inspect'](_0x512d3e,{'showHidden':![],'depth':null}));}});})[_0xe6bd('0x18')](function(_0x358d54){return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x53'),util['inspect'](_0x358d54,{'showHidden':![],'depth':null}));});}else{logger[_0xe6bd('0x19')](_0xe6bd('0x26'),'afterCreate',_0xe6bd('0x53'),_0xe6bd('0x5a'));}}else{logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x53'),_0xe6bd('0x3c'));}break;case _0xe6bd('0x5b'):var _0x5383cb=require(_0xe6bd('0x5c'));if(_0x196ce0['apiKey']){var _0x327cb4={};_0x327cb4[_0xe6bd('0x5d')]=_0x196ce0['username'];_0x327cb4['phone']=_0x3c3ed5[_0xe6bd('0x20')];_0x327cb4[_0xe6bd('0x2f')]=_0x196ce0[_0xe6bd('0x20')];_0x327cb4['text']=_0x3c3ed5[_0xe6bd('0xc')];_0x327cb4[_0xe6bd('0x5e')]=+new Date();var _0x23e2c0='';var _0x500891='';var _0x2787e1=Object[_0xe6bd('0x5f')](_0x327cb4);_0x2787e1[_0xe6bd('0x60')]();for(var _0xe49fcb=0x0;_0xe49fcb<_0x2787e1[_0xe6bd('0x61')];_0xe49fcb++){if(_0x23e2c0!=''){_0x23e2c0+='&';}_0x23e2c0+=_0x2787e1[_0xe49fcb]+'='+encodeURIComponent(_0x327cb4[_0x2787e1[_0xe49fcb]]);_0x500891+=_0x327cb4[_0x2787e1[_0xe49fcb]];}_0x500891+=_0x196ce0[_0xe6bd('0x62')];_0x500891=_0x5383cb[_0xe6bd('0x63')](_0xe6bd('0x64'))['update'](_0x500891)[_0xe6bd('0x65')](_0xe6bd('0x66'));if(_0x23e2c0!==''){_0x23e2c0+='&';}_0x23e2c0+='signature='+_0x500891;var _0x4024b9={'method':_0xe6bd('0x31'),'uri':_0x196ce0['baseUrl']+_0xe6bd('0x67')+_0x23e2c0,'json':!![]};return rp(_0x4024b9)['then'](function(_0x5d0aa8){var _0x55f5b7=Object[_0xe6bd('0x5f')](_0x5d0aa8);if(_0x5d0aa8[_0x55f5b7[0x0]]['error']&&parseInt(_0x5d0aa8[_0x55f5b7[0x0]][_0xe6bd('0x19')])===0x0){var _0x1ed2f8={'messageId':_0x5d0aa8[_0x55f5b7[0x0]][_0xe6bd('0x68')]};if(!_0x196ce0[_0xe6bd('0x39')]){_0x1ed2f8[_0xe6bd('0x3a')]=!![];}return _0x5eb77a[_0xe6bd('0x3b')](_0x1ed2f8);}else{return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x5b'),util[_0xe6bd('0x27')](_0x5d0aa8[_0xe6bd('0x19')],{'showHidden':![],'depth':null}));}})[_0xe6bd('0x18')](function(_0x1e58a1){return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x5b'),util['inspect'](_0x1e58a1,{'showHidden':![],'depth':null}));});}else{logger[_0xe6bd('0x19')](_0xe6bd('0x26'),'afterCreate',_0xe6bd('0x5b'),_0xe6bd('0x69'));}break;case'clickatell':if(_0x196ce0[_0xe6bd('0x62')]){var _0x17bb90={'method':_0xe6bd('0x34'),'uri':_0xe6bd('0x6a'),'headers':{'Authorization':_0x196ce0['apiKey']},'body':{'content':_0x3c3ed5[_0xe6bd('0xc')],'to':[_0x3c3ed5[_0xe6bd('0x20')]],'from':_0x196ce0[_0xe6bd('0x20')],'binary':![],'clientMessageId':_0xe6bd('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x17bb90)['then'](function(_0x40bbd1){if(!_0x40bbd1[_0xe6bd('0x19')]){var _0x14935a={'messageId':_0x40bbd1['messages'][0x0][_0xe6bd('0x6c')]};if(!_0x196ce0[_0xe6bd('0x39')]){_0x14935a[_0xe6bd('0x3a')]=!![];}return _0x5eb77a['update'](_0x14935a);}else{return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x6d'),util[_0xe6bd('0x27')](_0x40bbd1[_0xe6bd('0x19')],{'showHidden':![],'depth':null}));}})[_0xe6bd('0x18')](function(_0x31ebf7){return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x6d'),util[_0xe6bd('0x27')](_0x31ebf7,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6bd('0x28'),_0xe6bd('0x6d'),_0xe6bd('0x69'));}break;case _0xe6bd('0x6e'):if(_0x196ce0[_0xe6bd('0x2c')]&&_0x196ce0[_0xe6bd('0x2d')]){var _0x4ef43a=util['format'](_0xe6bd('0x42'),_0x196ce0[_0xe6bd('0x2c')],_0x196ce0[_0xe6bd('0x2d')]);var _0x3bf274={'method':'POST','uri':_0xe6bd('0x6f')+_0x196ce0[_0xe6bd('0x70')]+_0xe6bd('0x71'),'body':{'to':[_0x3c3ed5[_0xe6bd('0x20')]],'text':_0x3c3ed5[_0xe6bd('0xc')],'from':_0x196ce0['phone'],'applicationId':_0x196ce0['applicationId']},'headers':{'Authorization':util[_0xe6bd('0x41')](_0xe6bd('0x44'),new Buffer(_0x4ef43a)['toString'](_0xe6bd('0x46')))},'json':!![]};rp(_0x3bf274)[_0xe6bd('0x1c')](function(_0xd631b2){if(_0xd631b2['id']){var _0x56fc77={'messageId':_0xd631b2['id']};return _0x5eb77a[_0xe6bd('0x3b')](_0x56fc77);}else{logger['error'](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x6e'),util[_0xe6bd('0x27')](_0xd631b2,{'showHidden':![],'depth':null}));}})[_0xe6bd('0x18')](function(_0x432030){logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x6e'),util[_0xe6bd('0x27')](_0x432030,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6bd('0x26'),_0xe6bd('0x28'),_0xe6bd('0x6e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe6bd('0x72'):if(_0x196ce0['apiKey']){var _0x45299a={};var _0x4024b9={'method':'POST','uri':_0xe6bd('0x73'),'headers':{'Authorization':_0xe6bd('0x74')+_0x196ce0[_0xe6bd('0x62')],'Content-Type':_0xe6bd('0x58')},'body':{'from':_0x196ce0[_0xe6bd('0x20')],'to':_0x3c3ed5[_0xe6bd('0x20')],'text':_0x3c3ed5[_0xe6bd('0xc')]},'json':!![]};return rp(_0x4024b9)[_0xe6bd('0x1c')](function(_0xc96afd){if(_0xc96afd[_0xe6bd('0x75')]==0xca){_0x45299a['message']=_0xc96afd;var _0x1eb364={'method':_0xe6bd('0x34'),'uri':_0xe6bd('0x76'),'headers':{'Authorization':_0xe6bd('0x74')+_0x196ce0[_0xe6bd('0x62')],'Content-Type':_0xe6bd('0x58')},'body':{'refid':_0x45299a['message'][_0xe6bd('0x77')]},'json':!![]};return rp(_0x1eb364)[_0xe6bd('0x1c')](function(_0x4886a5){_0x45299a[_0xe6bd('0x78')]=_0x4886a5;var _0x2dc9bd={'messageId':_0x45299a[_0xe6bd('0x79')][_0xe6bd('0x77')],'read':!![]};return _0x5eb77a[_0xe6bd('0x3b')](_0x2dc9bd);});}else{return logger[_0xe6bd('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6bd('0x28'),_0xe6bd('0x72'),util[_0xe6bd('0x27')](_0xc96afd,{'showHidden':![],'depth':null}));}})[_0xe6bd('0x18')](function(_0x4d69dd){return logger['error'](_0xe6bd('0x26'),_0xe6bd('0x28'),'intelepeer',util[_0xe6bd('0x27')](_0x4d69dd,{'showHidden':![],'depth':null}));});}else{return logger[_0xe6bd('0x19')](_0xe6bd('0x26'),_0xe6bd('0x28'),'intelepeer',_0xe6bd('0x7a'));}break;}}})[_0xe6bd('0x7b')](function(){_0x5b72c1();});}else{_0x5b72c1();}}},'charset':_0xe6bd('0x7c'),'collate':_0xe6bd('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 351b708..03698a7 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 _0x81bf=['request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','SmsMessage','body','options','raw','CreateSmsMessage','stringify','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x81bf,0x16f));var _0xf81b=function(_0x66f7bb,_0x358ff7){_0x66f7bb=_0x66f7bb-0x0;var _0x27bc12=_0x81bf[_0x66f7bb];return _0x27bc12;};'use strict';var _=require(_0xf81b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf81b('0x1'));var rs=require(_0xf81b('0x2'));var fs=require('fs');var Redis=require(_0xf81b('0x3'));var db=require(_0xf81b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf81b('0x5'))(_0xf81b('0x6'));var config=require(_0xf81b('0x7'));var jayson=require(_0xf81b('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xf81b('0x9')]=_['defaults'](config['redis'],{'host':_0xf81b('0xa'),'port':0x18eb});var socket=require(_0xf81b('0xb'))(new Redis(config[_0xf81b('0x9')]));require(_0xf81b('0xc'))[_0xf81b('0xd')](socket);function respondWithRpcPromise(_0x8ff7b7,_0x3e0151,_0x24ef26){return new BPromise(function(_0x1a1d92,_0x4d5adf){return client[_0xf81b('0xe')](_0x8ff7b7,_0x24ef26)[_0xf81b('0xf')](function(_0x266e32){logger['info'](_0xf81b('0x10'),_0x3e0151,_0xf81b('0x11'));logger[_0xf81b('0x12')](_0xf81b('0x13'),_0x3e0151,_0xf81b('0x11'),JSON['stringify'](_0x266e32));if(_0x266e32[_0xf81b('0x14')]){if(_0x266e32[_0xf81b('0x14')][_0xf81b('0x15')]===0x1f4){logger[_0xf81b('0x14')](_0xf81b('0x10'),_0x3e0151,_0x266e32[_0xf81b('0x14')][_0xf81b('0x16')]);return _0x4d5adf(_0x266e32['error'][_0xf81b('0x16')]);}logger[_0xf81b('0x14')]('SmsMessage,\x20%s,\x20%s',_0x3e0151,_0x266e32[_0xf81b('0x14')]['message']);return _0x1a1d92(_0x266e32[_0xf81b('0x14')][_0xf81b('0x16')]);}else{logger[_0xf81b('0x17')](_0xf81b('0x10'),_0x3e0151,_0xf81b('0x11'));_0x1a1d92(_0x266e32[_0xf81b('0x18')]['message']);}})['catch'](function(_0x1aa090){logger[_0xf81b('0x14')](_0xf81b('0x10'),_0x3e0151,_0x1aa090);_0x4d5adf(_0x1aa090);});});}exports['CreateSmsMessage']=function(_0x3dbe18){var _0x285bd4=this;return new Promise(function(_0x1c9b4c,_0x1e0fa9){return db[_0xf81b('0x19')]['create'](_0x3dbe18[_0xf81b('0x1a')],{'raw':_0x3dbe18[_0xf81b('0x1b')]?_0x3dbe18[_0xf81b('0x1b')][_0xf81b('0x1c')]===undefined?!![]:![]:!![]})[_0xf81b('0xf')](function(_0x4438c9){logger[_0xf81b('0x17')](_0xf81b('0x1d'),_0x3dbe18);logger[_0xf81b('0x12')]('CreateSmsMessage',_0x3dbe18,JSON[_0xf81b('0x1e')](_0x4438c9));_0x1c9b4c(_0x4438c9);})[_0xf81b('0x1f')](function(_0x2d6e13){logger[_0xf81b('0x14')](_0xf81b('0x1d'),_0x2d6e13['message'],_0x3dbe18);_0x1e0fa9(_0x285bd4[_0xf81b('0x14')](0x1f4,_0x2d6e13['message']));});});}; \ No newline at end of file +var _0xc388=['http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','catch','CreateSmsMessage','SmsMessage','options','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x52db4f,_0x4a4483){var _0x585142=function(_0x4e56c1){while(--_0x4e56c1){_0x52db4f['push'](_0x52db4f['shift']());}};_0x585142(++_0x4a4483);}(_0xc388,0x18b));var _0x8c38=function(_0x59f4ca,_0x39737b){_0x59f4ca=_0x59f4ca-0x0;var _0x136ff3=_0xc388[_0x59f4ca];return _0x136ff3;};'use strict';var _=require(_0x8c38('0x0'));var util=require('util');var moment=require(_0x8c38('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c38('0x2'));var fs=require('fs');var Redis=require(_0x8c38('0x3'));var db=require(_0x8c38('0x4'))['db'];var utils=require(_0x8c38('0x5'));var logger=require(_0x8c38('0x6'))(_0x8c38('0x7'));var config=require(_0x8c38('0x8'));var jayson=require(_0x8c38('0x9'));var client=jayson[_0x8c38('0xa')][_0x8c38('0xb')]({'port':0x232a});config[_0x8c38('0xc')]=_[_0x8c38('0xd')](config[_0x8c38('0xc')],{'host':_0x8c38('0xe'),'port':0x18eb});var socket=require(_0x8c38('0xf'))(new Redis(config[_0x8c38('0xc')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x9b8e81,_0x5797ff,_0x585df7){return new BPromise(function(_0x131a15,_0x69279d){return client['request'](_0x9b8e81,_0x585df7)[_0x8c38('0x10')](function(_0xc48e9b){logger[_0x8c38('0x11')]('SmsMessage,\x20%s,\x20%s',_0x5797ff,_0x8c38('0x12'));logger[_0x8c38('0x13')](_0x8c38('0x14'),_0x5797ff,_0x8c38('0x12'),JSON['stringify'](_0xc48e9b));if(_0xc48e9b[_0x8c38('0x15')]){if(_0xc48e9b[_0x8c38('0x15')][_0x8c38('0x16')]===0x1f4){logger[_0x8c38('0x15')](_0x8c38('0x17'),_0x5797ff,_0xc48e9b[_0x8c38('0x15')][_0x8c38('0x18')]);return _0x69279d(_0xc48e9b[_0x8c38('0x15')][_0x8c38('0x18')]);}logger[_0x8c38('0x15')](_0x8c38('0x17'),_0x5797ff,_0xc48e9b['error'][_0x8c38('0x18')]);return _0x131a15(_0xc48e9b[_0x8c38('0x15')]['message']);}else{logger[_0x8c38('0x11')](_0x8c38('0x17'),_0x5797ff,_0x8c38('0x12'));_0x131a15(_0xc48e9b['result']['message']);}})[_0x8c38('0x19')](function(_0x50b504){logger[_0x8c38('0x15')](_0x8c38('0x17'),_0x5797ff,_0x50b504);_0x69279d(_0x50b504);});});}exports[_0x8c38('0x1a')]=function(_0x3a24b8){var _0x38589c=this;return new Promise(function(_0x236484,_0x128727){return db[_0x8c38('0x1b')]['create'](_0x3a24b8['body'],{'raw':_0x3a24b8[_0x8c38('0x1c')]?_0x3a24b8[_0x8c38('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x8c38('0x10')](function(_0xa7a486){logger[_0x8c38('0x11')](_0x8c38('0x1a'),_0x3a24b8);logger['debug'](_0x8c38('0x1a'),_0x3a24b8,JSON['stringify'](_0xa7a486));_0x236484(_0xa7a486);})[_0x8c38('0x19')](function(_0x563e23){logger['error']('CreateSmsMessage',_0x563e23[_0x8c38('0x18')],_0x3a24b8);_0x128727(_0x38589c[_0x8c38('0x15')](0x1f4,_0x563e23['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index eab8f4c..e8e5680 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 _0x6c57=['register','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c57,0x71));var _0x76c5=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x6c57[_0x12bcf7];return _0x2825a;};'use strict';var SmsMessageEvents=require(_0x76c5('0x0'));var events=[_0x76c5('0x1'),_0x76c5('0x2'),_0x76c5('0x3')];function createListener(_0x208879,_0x166542){return function(_0x1c0eae){_0x166542[_0x76c5('0x4')](_0x208879,_0x1c0eae);};}function removeListener(_0x367829,_0x3d49bd){return function(){SmsMessageEvents[_0x76c5('0x5')](_0x367829,_0x3d49bd);};}exports[_0x76c5('0x6')]=function(_0x2dba76){for(var _0x5a3e9e=0x0,_0x25480c=events['length'];_0x5a3e9e<_0x25480c;_0x5a3e9e++){var _0x513233=events[_0x5a3e9e];var _0x56bb19=createListener('smsMessage:'+_0x513233,_0x2dba76);SmsMessageEvents['on'](_0x513233,_0x56bb19);}}; \ No newline at end of file +var _0x3488=['emit','removeListener','length','smsMessage:','./smsMessage.events','remove','update'];(function(_0x355a53,_0x4875bd){var _0x3a4721=function(_0x5919cd){while(--_0x5919cd){_0x355a53['push'](_0x355a53['shift']());}};_0x3a4721(++_0x4875bd);}(_0x3488,0x82));var _0x8348=function(_0x27933b,_0x2769ee){_0x27933b=_0x27933b-0x0;var _0x3065b9=_0x3488[_0x27933b];return _0x3065b9;};'use strict';var SmsMessageEvents=require(_0x8348('0x0'));var events=['save',_0x8348('0x1'),_0x8348('0x2')];function createListener(_0x1e6fab,_0x32afc5){return function(_0x520026){_0x32afc5[_0x8348('0x3')](_0x1e6fab,_0x520026);};}function removeListener(_0x360078,_0x40730e){return function(){SmsMessageEvents[_0x8348('0x4')](_0x360078,_0x40730e);};}exports['register']=function(_0x2ad262){for(var _0x489506=0x0,_0x32c596=events[_0x8348('0x5')];_0x489506<_0x32c596;_0x489506++){var _0x2d9568=events[_0x489506];var _0x4dbbd3=createListener(_0x8348('0x6')+_0x2d9568,_0x2ad262);SmsMessageEvents['on'](_0x2d9568,_0x4dbbd3);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 761161e..ee1bb63 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 _0x0dbb=['describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0xc8abf9,_0x4feae5){var _0x1e03a0=function(_0x2116a7){while(--_0x2116a7){_0xc8abf9['push'](_0xc8abf9['shift']());}};_0x1e03a0(++_0x4feae5);}(_0x0dbb,0x102));var _0xb0db=function(_0x32a55b,_0x484b22){_0x32a55b=_0x32a55b-0x0;var _0x47f732=_0x0dbb[_0x32a55b];return _0x47f732;};'use strict';var multer=require(_0xb0db('0x0'));var util=require('util');var path=require(_0xb0db('0x1'));var timeout=require(_0xb0db('0x2'));var express=require(_0xb0db('0x3'));var router=express[_0xb0db('0x4')]();var fs_extra=require(_0xb0db('0x5'));var auth=require(_0xb0db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb0db('0x7'));var controller=require('./smsQueue.controller');router[_0xb0db('0x8')]('/',auth['isAuthenticated'](),controller[_0xb0db('0x9')]);router[_0xb0db('0x8')](_0xb0db('0xa'),auth[_0xb0db('0xb')](),controller[_0xb0db('0xc')]);router[_0xb0db('0x8')](_0xb0db('0xd'),auth[_0xb0db('0xb')](),controller['show']);router[_0xb0db('0x8')](_0xb0db('0xe'),auth[_0xb0db('0xb')](),controller[_0xb0db('0xf')]);router[_0xb0db('0x8')](_0xb0db('0x10'),auth['isAuthenticated'](),controller[_0xb0db('0x11')]);router['get'](_0xb0db('0x12'),auth[_0xb0db('0xb')](),controller['getAgents']);router[_0xb0db('0x13')]('/',auth['isAuthenticated'](),controller[_0xb0db('0x14')]);router[_0xb0db('0x13')](_0xb0db('0x10'),auth[_0xb0db('0xb')](),controller['addTeams']);router[_0xb0db('0x13')](_0xb0db('0x12'),auth[_0xb0db('0xb')](),controller[_0xb0db('0x15')]);router[_0xb0db('0x16')](_0xb0db('0xd'),auth[_0xb0db('0xb')](),controller[_0xb0db('0x17')]);router[_0xb0db('0x18')]('/:id',auth[_0xb0db('0xb')](),controller[_0xb0db('0x19')]);router['delete'](_0xb0db('0x10'),auth[_0xb0db('0xb')](),controller['removeTeams']);router[_0xb0db('0x18')](_0xb0db('0x12'),auth[_0xb0db('0xb')](),controller['removeAgents']);module[_0xb0db('0x1a')]=router; \ No newline at end of file +var _0xeb28=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','create','post','addTeams','/:id/users','put','update','delete','destroy','removeAgents','multer','util'];(function(_0x47e5c6,_0x1da014){var _0x5aa374=function(_0x2d2068){while(--_0x2d2068){_0x47e5c6['push'](_0x47e5c6['shift']());}};_0x5aa374(++_0x1da014);}(_0xeb28,0x94));var _0x8eb2=function(_0x5ca169,_0x50cee4){_0x5ca169=_0x5ca169-0x0;var _0x285371=_0xeb28[_0x5ca169];return _0x285371;};'use strict';var multer=require(_0x8eb2('0x0'));var util=require(_0x8eb2('0x1'));var path=require(_0x8eb2('0x2'));var timeout=require(_0x8eb2('0x3'));var express=require(_0x8eb2('0x4'));var router=express[_0x8eb2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8eb2('0x6'));var config=require(_0x8eb2('0x7'));var controller=require('./smsQueue.controller');router[_0x8eb2('0x8')]('/',auth[_0x8eb2('0x9')](),controller['index']);router[_0x8eb2('0x8')]('/describe',auth[_0x8eb2('0x9')](),controller[_0x8eb2('0xa')]);router[_0x8eb2('0x8')](_0x8eb2('0xb'),auth[_0x8eb2('0x9')](),controller[_0x8eb2('0xc')]);router[_0x8eb2('0x8')](_0x8eb2('0xd'),auth[_0x8eb2('0x9')](),controller[_0x8eb2('0xe')]);router[_0x8eb2('0x8')](_0x8eb2('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x8eb2('0x8')]('/:id/users',auth[_0x8eb2('0x9')](),controller['getAgents']);router['post']('/',auth[_0x8eb2('0x9')](),controller[_0x8eb2('0x10')]);router[_0x8eb2('0x11')](_0x8eb2('0xf'),auth['isAuthenticated'](),controller[_0x8eb2('0x12')]);router[_0x8eb2('0x11')](_0x8eb2('0x13'),auth[_0x8eb2('0x9')](),controller['addAgents']);router[_0x8eb2('0x14')](_0x8eb2('0xb'),auth['isAuthenticated'](),controller[_0x8eb2('0x15')]);router[_0x8eb2('0x16')](_0x8eb2('0xb'),auth[_0x8eb2('0x9')](),controller[_0x8eb2('0x17')]);router[_0x8eb2('0x16')]('/:id/teams',auth[_0x8eb2('0x9')](),controller['removeTeams']);router['delete'](_0x8eb2('0x13'),auth['isAuthenticated'](),controller[_0x8eb2('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index efc0c21..a18c6f8 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 _0x69d5=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x22a7da,_0x222e19){var _0x144508=function(_0x548beb){while(--_0x548beb){_0x22a7da['push'](_0x22a7da['shift']());}};_0x144508(++_0x222e19);}(_0x69d5,0x11f));var _0x569d=function(_0x16babd,_0x4bd685){_0x16babd=_0x16babd-0x0;var _0x4f12cf=_0x69d5[_0x16babd];return _0x4f12cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x569d('0x0')]},'timeout':{'type':Sequelize[_0x569d('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x569d('0x2')](_0x569d('0x3'),_0x569d('0x4'),_0x569d('0x5'))}}; \ No newline at end of file +var _0x1c28=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','name'];(function(_0x48740a,_0x552ec1){var _0x41097e=function(_0x27ac03){while(--_0x27ac03){_0x48740a['push'](_0x48740a['shift']());}};_0x41097e(++_0x552ec1);}(_0x1c28,0x7d));var _0x81c2=function(_0x3c4165,_0x1ab0b1){_0x3c4165=_0x3c4165-0x0;var _0x4dc920=_0x1c28[_0x3c4165];return _0x4dc920;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x81c2('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x81c2('0x1')]},'timeout':{'type':Sequelize[_0x81c2('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x81c2('0x3')](_0x81c2('0x4'),_0x81c2('0x5'),_0x81c2('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d5c04ff..ad52e4e 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(_0x3cdd71,_0x49ad5d){var _0x22b5ef=function(_0x339138){while(--_0x339138){_0x3cdd71['push'](_0x3cdd71['shift']());}};_0x22b5ef(++_0x49ad5d);}(_0x7a54,0x106));var _0x47a5=function(_0x68434,_0xc9cb60){_0x68434=_0x68434-0x0;var _0x3b2fdd=_0x7a54[_0x68434];return _0x3b2fdd;};'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 _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xadb5,0xad));var _0x5adb=function(_0x29c0ac,_0x580408){_0x29c0ac=_0x29c0ac-0x0;var _0x13aa2c=_0xadb5[_0x29c0ac];return _0x13aa2c;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 17b99ea..3f9c102 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 _0x6154=['hook','exports','setMaxListeners','save','update','remove','emit'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x6154,0x72));var _0x4615=function(_0x3c4119,_0x9a4f74){_0x3c4119=_0x3c4119-0x0;var _0x5949dc=_0x6154[_0x3c4119];return _0x5949dc;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4615('0x0')](0x0);var events={'afterCreate':_0x4615('0x1'),'afterUpdate':_0x4615('0x2'),'afterDestroy':_0x4615('0x3')};function emitEvent(_0x2569ab){return function(_0x50a22a,_0x3fe216,_0x5d58a0){SmsQueueEvents[_0x4615('0x4')](_0x2569ab+':'+_0x50a22a['id'],_0x50a22a);SmsQueueEvents[_0x4615('0x4')](_0x2569ab,_0x50a22a);_0x5d58a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x4615('0x5')](e,emitEvent(event));}}module[_0x4615('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x24e1=['SmsQueue','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x14e9de,_0x1801af){var _0x3e1929=function(_0x5072e5){while(--_0x5072e5){_0x14e9de['push'](_0x14e9de['shift']());}};_0x3e1929(++_0x1801af);}(_0x24e1,0xcc));var _0x124e=function(_0x55f0f2,_0x20f85b){_0x55f0f2=_0x55f0f2-0x0;var _0x3b0734=_0x24e1[_0x55f0f2];return _0x3b0734;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x124e('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x124e('0x1')](0x0);var events={'afterCreate':_0x124e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x291841){return function(_0x3d7145,_0x56ae6c,_0x43344f){SmsQueueEvents[_0x124e('0x3')](_0x291841+':'+_0x3d7145['id'],_0x3d7145);SmsQueueEvents[_0x124e('0x3')](_0x291841,_0x3d7145);_0x43344f(null);};}for(var e in events){if(events[_0x124e('0x4')](e)){var event=events[e];SmsQueue[_0x124e('0x5')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 02535c5..611ff96 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 _0x738a=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','lodash'];(function(_0x2de62a,_0x340a14){var _0x52953a=function(_0x4aaf1b){while(--_0x4aaf1b){_0x2de62a['push'](_0x2de62a['shift']());}};_0x52953a(++_0x340a14);}(_0x738a,0x149));var _0xa738=function(_0x59943d,_0x2e751b){_0x59943d=_0x59943d-0x0;var _0x46ace9=_0x738a[_0x59943d];return _0x46ace9;};'use strict';var _=require(_0xa738('0x0'));var util=require(_0xa738('0x1'));var logger=require(_0xa738('0x2'))(_0xa738('0x3'));var moment=require(_0xa738('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa738('0x5'));var rimraf=require(_0xa738('0x6'));var config=require(_0xa738('0x7'));var attributes=require(_0xa738('0x8'));module[_0xa738('0x9')]=function(_0x349e37,_0xa74909){return _0x349e37['define'](_0xa738('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9379=['moment','request-promise','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api'];(function(_0x118272,_0x6d0b7a){var _0x213655=function(_0x43dae0){while(--_0x43dae0){_0x118272['push'](_0x118272['shift']());}};_0x213655(++_0x6d0b7a);}(_0x9379,0x1e1));var _0x9937=function(_0x44c731,_0x2e2259){_0x44c731=_0x44c731-0x0;var _0x509835=_0x9379[_0x44c731];return _0x509835;};'use strict';var _=require(_0x9937('0x0'));var util=require(_0x9937('0x1'));var logger=require('../../config/logger')(_0x9937('0x2'));var moment=require(_0x9937('0x3'));var BPromise=require('bluebird');var rp=require(_0x9937('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9937('0x5'));var attributes=require(_0x9937('0x6'));module[_0x9937('0x7')]=function(_0x581c77,_0x499e88){return _0x581c77[_0x9937('0x8')](_0x9937('0x9'),attributes,{'tableName':_0x9937('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 6974b04..cac50b1 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 _0xf407=['./smsQueue.socket','register','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','map','include','model','stringify','catch','ShowSmsQueue','find','where','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xf407,0x149));var _0x7f40=function(_0x524661,_0x3c0846){_0x524661=_0x524661-0x0;var _0x56b227=_0xf407[_0x524661];return _0x56b227;};'use strict';var _=require(_0x7f40('0x0'));var util=require(_0x7f40('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f40('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f40('0x3'))['db'];var utils=require(_0x7f40('0x4'));var logger=require(_0x7f40('0x5'))(_0x7f40('0x6'));var config=require(_0x7f40('0x7'));var jayson=require(_0x7f40('0x8'));var client=jayson[_0x7f40('0x9')][_0x7f40('0xa')]({'port':0x232a});config['redis']=_[_0x7f40('0xb')](config['redis'],{'host':_0x7f40('0xc'),'port':0x18eb});var socket=require(_0x7f40('0xd'))(new Redis(config[_0x7f40('0xe')]));require(_0x7f40('0xf'))[_0x7f40('0x10')](socket);function respondWithRpcPromise(_0x5c320a,_0x22da5a,_0x319874){return new BPromise(function(_0x41a1ef,_0x3bdc7c){return client[_0x7f40('0x11')](_0x5c320a,_0x319874)[_0x7f40('0x12')](function(_0x2c9695){logger[_0x7f40('0x13')]('SmsQueue,\x20%s,\x20%s',_0x22da5a,_0x7f40('0x14'));logger[_0x7f40('0x15')](_0x7f40('0x16'),_0x22da5a,_0x7f40('0x14'),JSON['stringify'](_0x2c9695));if(_0x2c9695[_0x7f40('0x17')]){if(_0x2c9695['error'][_0x7f40('0x18')]===0x1f4){logger[_0x7f40('0x17')](_0x7f40('0x19'),_0x22da5a,_0x2c9695[_0x7f40('0x17')]['message']);return _0x3bdc7c(_0x2c9695[_0x7f40('0x17')][_0x7f40('0x1a')]);}logger[_0x7f40('0x17')](_0x7f40('0x19'),_0x22da5a,_0x2c9695[_0x7f40('0x17')][_0x7f40('0x1a')]);return _0x41a1ef(_0x2c9695[_0x7f40('0x17')]['message']);}else{logger[_0x7f40('0x13')](_0x7f40('0x19'),_0x22da5a,'request\x20sent');_0x41a1ef(_0x2c9695[_0x7f40('0x1b')][_0x7f40('0x1a')]);}})['catch'](function(_0x4c8161){logger['error']('SmsQueue,\x20%s,\x20%s',_0x22da5a,_0x4c8161);_0x3bdc7c(_0x4c8161);});});}exports[_0x7f40('0x1c')]=function(_0x1f84b7){var _0x263c54=this;return new Promise(function(_0x3e9da8,_0x46915c){return db[_0x7f40('0x1d')][_0x7f40('0x1e')]({'raw':_0x1f84b7[_0x7f40('0x1f')]?_0x1f84b7[_0x7f40('0x1f')][_0x7f40('0x20')]===undefined?!![]:![]:!![],'where':_0x1f84b7[_0x7f40('0x1f')]?_0x1f84b7['options']['where']||null:null,'attributes':_0x1f84b7[_0x7f40('0x1f')]?_0x1f84b7[_0x7f40('0x1f')][_0x7f40('0x21')]||null:null,'limit':_0x1f84b7['options']?_0x1f84b7[_0x7f40('0x1f')][_0x7f40('0x22')]||null:null,'include':_0x1f84b7[_0x7f40('0x1f')]?_0x1f84b7['options']['include']?_[_0x7f40('0x23')](_0x1f84b7['options'][_0x7f40('0x24')],function(_0x37a3a0){return{'model':db[_0x37a3a0['model']],'as':_0x37a3a0['as'],'attributes':_0x37a3a0['attributes'],'include':_0x37a3a0[_0x7f40('0x24')]?_[_0x7f40('0x23')](_0x37a3a0[_0x7f40('0x24')],function(_0x2f1838){return{'model':db[_0x2f1838['model']],'as':_0x2f1838['as'],'attributes':_0x2f1838['attributes'],'include':_0x2f1838[_0x7f40('0x24')]?_[_0x7f40('0x23')](_0x2f1838[_0x7f40('0x24')],function(_0x32b22b){return{'model':db[_0x32b22b[_0x7f40('0x25')]],'as':_0x32b22b['as'],'attributes':_0x32b22b[_0x7f40('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7f40('0x12')](function(_0x377095){logger['info'](_0x7f40('0x1c'),_0x1f84b7);logger[_0x7f40('0x15')](_0x7f40('0x1c'),_0x1f84b7,JSON[_0x7f40('0x26')](_0x377095));_0x3e9da8(_0x377095);})[_0x7f40('0x27')](function(_0x3ad94e){logger['error'](_0x7f40('0x1c'),_0x3ad94e[_0x7f40('0x1a')],_0x1f84b7);_0x46915c(_0x263c54[_0x7f40('0x17')](0x1f4,_0x3ad94e['message']));});});};exports[_0x7f40('0x28')]=function(_0x35dc98){var _0x46ea3d=this;return new Promise(function(_0x22ec1f,_0x3eb7e3){return db[_0x7f40('0x1d')][_0x7f40('0x29')]({'raw':_0x35dc98[_0x7f40('0x1f')]?_0x35dc98[_0x7f40('0x1f')][_0x7f40('0x20')]===undefined?!![]:![]:!![],'where':_0x35dc98[_0x7f40('0x1f')]?_0x35dc98['options'][_0x7f40('0x2a')]||null:null,'attributes':_0x35dc98['options']?_0x35dc98[_0x7f40('0x1f')]['attributes']||null:null,'include':_0x35dc98['options']?_0x35dc98['options']['include']?_[_0x7f40('0x23')](_0x35dc98[_0x7f40('0x1f')]['include'],function(_0x59a239){return{'model':db[_0x59a239['model']],'as':_0x59a239['as'],'attributes':_0x59a239['attributes'],'include':_0x59a239['include']?_[_0x7f40('0x23')](_0x59a239['include'],function(_0xfb9c74){return{'model':db[_0xfb9c74[_0x7f40('0x25')]],'as':_0xfb9c74['as'],'attributes':_0xfb9c74[_0x7f40('0x21')],'include':_0xfb9c74['include']?_[_0x7f40('0x23')](_0xfb9c74[_0x7f40('0x24')],function(_0x4dc50c){return{'model':db[_0x4dc50c[_0x7f40('0x25')]],'as':_0x4dc50c['as'],'attributes':_0x4dc50c[_0x7f40('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7f40('0x12')](function(_0x109d8e){logger[_0x7f40('0x13')](_0x7f40('0x28'),_0x35dc98);logger['debug']('ShowSmsQueue',_0x35dc98,JSON[_0x7f40('0x26')](_0x109d8e));_0x22ec1f(_0x109d8e);})[_0x7f40('0x27')](function(_0x2dc631){logger[_0x7f40('0x17')](_0x7f40('0x28'),_0x2dc631[_0x7f40('0x1a')],_0x35dc98);_0x3eb7e3(_0x46ea3d[_0x7f40('0x17')](0x1f4,_0x2dc631['message']));});});}; \ No newline at end of file +var _0x6d8f=['limit','include','model','attributes','then','stringify','catch','ShowSmsQueue','find','map','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetSmsQueue','SmsQueue','options','raw','where'];(function(_0xebd34d,_0xc27e49){var _0x110926=function(_0x3a2e55){while(--_0x3a2e55){_0xebd34d['push'](_0xebd34d['shift']());}};_0x110926(++_0xc27e49);}(_0x6d8f,0x1b7));var _0xf6d8=function(_0x116c88,_0x1b27e6){_0x116c88=_0x116c88-0x0;var _0x7d2a72=_0x6d8f[_0x116c88];return _0x7d2a72;};'use strict';var _=require('lodash');var util=require(_0xf6d8('0x0'));var moment=require(_0xf6d8('0x1'));var BPromise=require(_0xf6d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6d8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6d8('0x4'))(_0xf6d8('0x5'));var config=require(_0xf6d8('0x6'));var jayson=require(_0xf6d8('0x7'));var client=jayson[_0xf6d8('0x8')][_0xf6d8('0x9')]({'port':0x232a});config[_0xf6d8('0xa')]=_[_0xf6d8('0xb')](config[_0xf6d8('0xa')],{'host':_0xf6d8('0xc'),'port':0x18eb});var socket=require(_0xf6d8('0xd'))(new Redis(config['redis']));require(_0xf6d8('0xe'))[_0xf6d8('0xf')](socket);function respondWithRpcPromise(_0x2076c9,_0x144270,_0x3e7101){return new BPromise(function(_0x364ba6,_0x3da693){return client['request'](_0x2076c9,_0x3e7101)['then'](function(_0x2e84f0){logger[_0xf6d8('0x10')](_0xf6d8('0x11'),_0x144270,_0xf6d8('0x12'));logger[_0xf6d8('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x144270,_0xf6d8('0x12'),JSON['stringify'](_0x2e84f0));if(_0x2e84f0[_0xf6d8('0x14')]){if(_0x2e84f0[_0xf6d8('0x14')][_0xf6d8('0x15')]===0x1f4){logger[_0xf6d8('0x14')]('SmsQueue,\x20%s,\x20%s',_0x144270,_0x2e84f0[_0xf6d8('0x14')][_0xf6d8('0x16')]);return _0x3da693(_0x2e84f0[_0xf6d8('0x14')][_0xf6d8('0x16')]);}logger['error'](_0xf6d8('0x11'),_0x144270,_0x2e84f0['error'][_0xf6d8('0x16')]);return _0x364ba6(_0x2e84f0[_0xf6d8('0x14')][_0xf6d8('0x16')]);}else{logger[_0xf6d8('0x10')](_0xf6d8('0x11'),_0x144270,'request\x20sent');_0x364ba6(_0x2e84f0[_0xf6d8('0x17')][_0xf6d8('0x16')]);}})['catch'](function(_0x16d07c){logger[_0xf6d8('0x14')](_0xf6d8('0x11'),_0x144270,_0x16d07c);_0x3da693(_0x16d07c);});});}exports[_0xf6d8('0x18')]=function(_0x57cbbf){var _0x45e70f=this;return new Promise(function(_0x3c2c29,_0x3e02c1){return db[_0xf6d8('0x19')]['findAll']({'raw':_0x57cbbf[_0xf6d8('0x1a')]?_0x57cbbf['options'][_0xf6d8('0x1b')]===undefined?!![]:![]:!![],'where':_0x57cbbf[_0xf6d8('0x1a')]?_0x57cbbf[_0xf6d8('0x1a')][_0xf6d8('0x1c')]||null:null,'attributes':_0x57cbbf['options']?_0x57cbbf[_0xf6d8('0x1a')]['attributes']||null:null,'limit':_0x57cbbf['options']?_0x57cbbf[_0xf6d8('0x1a')][_0xf6d8('0x1d')]||null:null,'include':_0x57cbbf[_0xf6d8('0x1a')]?_0x57cbbf['options'][_0xf6d8('0x1e')]?_['map'](_0x57cbbf[_0xf6d8('0x1a')][_0xf6d8('0x1e')],function(_0x454e31){return{'model':db[_0x454e31[_0xf6d8('0x1f')]],'as':_0x454e31['as'],'attributes':_0x454e31[_0xf6d8('0x20')],'include':_0x454e31[_0xf6d8('0x1e')]?_['map'](_0x454e31['include'],function(_0x3baf4c){return{'model':db[_0x3baf4c['model']],'as':_0x3baf4c['as'],'attributes':_0x3baf4c[_0xf6d8('0x20')],'include':_0x3baf4c[_0xf6d8('0x1e')]?_['map'](_0x3baf4c['include'],function(_0x139605){return{'model':db[_0x139605[_0xf6d8('0x1f')]],'as':_0x139605['as'],'attributes':_0x139605[_0xf6d8('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf6d8('0x21')](function(_0x5e9d19){logger[_0xf6d8('0x10')](_0xf6d8('0x18'),_0x57cbbf);logger[_0xf6d8('0x13')]('GetSmsQueue',_0x57cbbf,JSON[_0xf6d8('0x22')](_0x5e9d19));_0x3c2c29(_0x5e9d19);})[_0xf6d8('0x23')](function(_0x3aba28){logger['error'](_0xf6d8('0x18'),_0x3aba28[_0xf6d8('0x16')],_0x57cbbf);_0x3e02c1(_0x45e70f[_0xf6d8('0x14')](0x1f4,_0x3aba28['message']));});});};exports[_0xf6d8('0x24')]=function(_0x58ba74){var _0x331ec0=this;return new Promise(function(_0x35b926,_0x330082){return db['SmsQueue'][_0xf6d8('0x25')]({'raw':_0x58ba74['options']?_0x58ba74[_0xf6d8('0x1a')][_0xf6d8('0x1b')]===undefined?!![]:![]:!![],'where':_0x58ba74['options']?_0x58ba74[_0xf6d8('0x1a')]['where']||null:null,'attributes':_0x58ba74[_0xf6d8('0x1a')]?_0x58ba74['options'][_0xf6d8('0x20')]||null:null,'include':_0x58ba74[_0xf6d8('0x1a')]?_0x58ba74['options'][_0xf6d8('0x1e')]?_[_0xf6d8('0x26')](_0x58ba74[_0xf6d8('0x1a')]['include'],function(_0x56c20f){return{'model':db[_0x56c20f['model']],'as':_0x56c20f['as'],'attributes':_0x56c20f[_0xf6d8('0x20')],'include':_0x56c20f['include']?_[_0xf6d8('0x26')](_0x56c20f[_0xf6d8('0x1e')],function(_0x5441c7){return{'model':db[_0x5441c7['model']],'as':_0x5441c7['as'],'attributes':_0x5441c7[_0xf6d8('0x20')],'include':_0x5441c7[_0xf6d8('0x1e')]?_[_0xf6d8('0x26')](_0x5441c7[_0xf6d8('0x1e')],function(_0xdda290){return{'model':db[_0xdda290[_0xf6d8('0x1f')]],'as':_0xdda290['as'],'attributes':_0xdda290[_0xf6d8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x578f49){logger[_0xf6d8('0x10')](_0xf6d8('0x24'),_0x58ba74);logger[_0xf6d8('0x13')](_0xf6d8('0x24'),_0x58ba74,JSON[_0xf6d8('0x22')](_0x578f49));_0x35b926(_0x578f49);})[_0xf6d8('0x23')](function(_0x44ae05){logger[_0xf6d8('0x14')](_0xf6d8('0x24'),_0x44ae05[_0xf6d8('0x16')],_0x58ba74);_0x330082(_0x331ec0[_0xf6d8('0x14')](0x1f4,_0x44ae05[_0xf6d8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index ce5d532..deed998 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 _0xa470=['./smsQueue.events','save','remove','update','emit','register','length','smsQueue:'];(function(_0x1b4bda,_0x3bc5ab){var _0x5082a6=function(_0x87c72b){while(--_0x87c72b){_0x1b4bda['push'](_0x1b4bda['shift']());}};_0x5082a6(++_0x3bc5ab);}(_0xa470,0x128));var _0x0a47=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa470[_0x14add3];return _0x4a174f;};'use strict';var SmsQueueEvents=require(_0x0a47('0x0'));var events=[_0x0a47('0x1'),_0x0a47('0x2'),_0x0a47('0x3')];function createListener(_0x379158,_0xf5f69e){return function(_0x29effd){_0xf5f69e[_0x0a47('0x4')](_0x379158,_0x29effd);};}function removeListener(_0x35bbac,_0x442b90){return function(){SmsQueueEvents['removeListener'](_0x35bbac,_0x442b90);};}exports[_0x0a47('0x5')]=function(_0x5c2a6b){for(var _0x4571b9=0x0,_0x4cc439=events[_0x0a47('0x6')];_0x4571b9<_0x4cc439;_0x4571b9++){var _0x154ae6=events[_0x4571b9];var _0x175f7a=createListener(_0x0a47('0x7')+_0x154ae6,_0x5c2a6b);SmsQueueEvents['on'](_0x154ae6,_0x175f7a);}}; \ No newline at end of file +var _0x7abf=['emit','removeListener','register','./smsQueue.events','save','remove','update'];(function(_0x4e08ce,_0x1c95d5){var _0x583777=function(_0x3c2343){while(--_0x3c2343){_0x4e08ce['push'](_0x4e08ce['shift']());}};_0x583777(++_0x1c95d5);}(_0x7abf,0x81));var _0xf7ab=function(_0x7c506f,_0x23ab0e){_0x7c506f=_0x7c506f-0x0;var _0xbd4bf0=_0x7abf[_0x7c506f];return _0xbd4bf0;};'use strict';var SmsQueueEvents=require(_0xf7ab('0x0'));var events=[_0xf7ab('0x1'),_0xf7ab('0x2'),_0xf7ab('0x3')];function createListener(_0xcf148a,_0x4d52d1){return function(_0x3e3bd1){_0x4d52d1[_0xf7ab('0x4')](_0xcf148a,_0x3e3bd1);};}function removeListener(_0x571d43,_0x133c4e){return function(){SmsQueueEvents[_0xf7ab('0x5')](_0x571d43,_0x133c4e);};}exports[_0xf7ab('0x6')]=function(_0x24c82c){for(var _0x697883=0x0,_0xf48b46=events['length'];_0x697883<_0xf48b46;_0x697883++){var _0x420a2f=events[_0x697883];var _0x2e23f9=createListener('smsQueue:'+_0x420a2f,_0x24c82c);SmsQueueEvents['on'](_0x420a2f,_0x2e23f9);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f936610..2d3e80d 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 _0xd2b4=['post','create','put','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd2b4,0xa6));var _0x4d2b=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xd2b4[_0x5d9867];return _0x7d2118;};'use strict';var multer=require('multer');var util=require(_0x4d2b('0x0'));var path=require('path');var timeout=require(_0x4d2b('0x1'));var express=require(_0x4d2b('0x2'));var router=express[_0x4d2b('0x3')]();var fs_extra=require(_0x4d2b('0x4'));var auth=require(_0x4d2b('0x5'));var interaction=require(_0x4d2b('0x6'));var config=require(_0x4d2b('0x7'));var controller=require(_0x4d2b('0x8'));router[_0x4d2b('0x9')]('/',auth[_0x4d2b('0xa')](),controller[_0x4d2b('0xb')]);router['get'](_0x4d2b('0xc'),auth['isAuthenticated'](),controller[_0x4d2b('0xd')]);router[_0x4d2b('0x9')]('/:id',auth[_0x4d2b('0xa')](),controller['show']);router[_0x4d2b('0xe')]('/',auth[_0x4d2b('0xa')](),controller[_0x4d2b('0xf')]);router[_0x4d2b('0x10')](_0x4d2b('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4d2b('0x11'),auth[_0x4d2b('0xa')](),controller[_0x4d2b('0x12')]);module[_0x4d2b('0x13')]=router; \ No newline at end of file +var _0x158f=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x158f,0x137));var _0xf158=function(_0x444e21,_0x3f63fb){_0x444e21=_0x444e21-0x0;var _0x56227d=_0x158f[_0x444e21];return _0x56227d;};'use strict';var multer=require('multer');var util=require(_0xf158('0x0'));var path=require(_0xf158('0x1'));var timeout=require(_0xf158('0x2'));var express=require(_0xf158('0x3'));var router=express[_0xf158('0x4')]();var fs_extra=require(_0xf158('0x5'));var auth=require(_0xf158('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf158('0x7'));var controller=require('./smsQueueReport.controller');router[_0xf158('0x8')]('/',auth[_0xf158('0x9')](),controller[_0xf158('0xa')]);router[_0xf158('0x8')](_0xf158('0xb'),auth[_0xf158('0x9')](),controller[_0xf158('0xc')]);router[_0xf158('0x8')](_0xf158('0xd'),auth[_0xf158('0x9')](),controller[_0xf158('0xe')]);router[_0xf158('0xf')]('/',auth['isAuthenticated'](),controller[_0xf158('0x10')]);router[_0xf158('0x11')](_0xf158('0xd'),auth[_0xf158('0x9')](),controller['update']);router[_0xf158('0x12')](_0xf158('0xd'),auth[_0xf158('0x9')](),controller[_0xf158('0x13')]);module[_0xf158('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 1255516..3fb9f83 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 _0xea0c=['STRING','DATE','moment','sequelize'];(function(_0x29158c,_0x1ec5ca){var _0x3f7036=function(_0x25869d){while(--_0x25869d){_0x29158c['push'](_0x29158c['shift']());}};_0x3f7036(++_0x1ec5ca);}(_0xea0c,0x66));var _0xcea0=function(_0x58e39b,_0x2f8955){_0x58e39b=_0x58e39b-0x0;var _0x13185e=_0xea0c[_0x58e39b];return _0x13185e;};'use strict';var moment=require(_0xcea0('0x0'));var Sequelize=require(_0xcea0('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xcea0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcea0('0x3')]},'leaveAt':{'type':Sequelize[_0xcea0('0x3')]},'acceptAt':{'type':Sequelize[_0xcea0('0x3')]},'exitAt':{'type':Sequelize[_0xcea0('0x3')]},'reason':{'type':Sequelize[_0xcea0('0x2')]}}; \ No newline at end of file +var _0xbef8=['exports','DATE','moment','sequelize'];(function(_0x2f11,_0x9f5ca6){var _0x22f54c=function(_0x1850b4){while(--_0x1850b4){_0x2f11['push'](_0x2f11['shift']());}};_0x22f54c(++_0x9f5ca6);}(_0xbef8,0x1ea));var _0x8bef=function(_0x5b98f6,_0x404e48){_0x5b98f6=_0x5b98f6-0x0;var _0x13f65b=_0xbef8[_0x5b98f6];return _0x13f65b;};'use strict';var moment=require(_0x8bef('0x0'));var Sequelize=require(_0x8bef('0x1'));module[_0x8bef('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8bef('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8bef('0x3')]},'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 b312c9a..4c16d92 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 _0xfc5f=['rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','filters','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfc5f,0x105));var _0xffc5=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xfc5f[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0xffc5('0x0'));var rimraf=require(_0xffc5('0x1'));var zipdir=require(_0xffc5('0x2'));var jsonpatch=require(_0xffc5('0x3'));var rp=require(_0xffc5('0x4'));var moment=require(_0xffc5('0x5'));var BPromise=require(_0xffc5('0x6'));var Mustache=require(_0xffc5('0x7'));var util=require('util');var path=require(_0xffc5('0x8'));var sox=require(_0xffc5('0x9'));var csv=require(_0xffc5('0xa'));var ejs=require(_0xffc5('0xb'));var fs=require('fs');var fs_extra=require(_0xffc5('0xc'));var _=require(_0xffc5('0xd'));var squel=require(_0xffc5('0xe'));var crypto=require('crypto');var jsforce=require(_0xffc5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xffc5('0xa'));var querystring=require('querystring');var Papa=require(_0xffc5('0x10'));var Redis=require(_0xffc5('0x11'));var authService=require(_0xffc5('0x12'));var qs=require(_0xffc5('0x13'));var as=require(_0xffc5('0x14'));var hardwareService=require(_0xffc5('0x15'));var logger=require(_0xffc5('0x16'))(_0xffc5('0x17'));var utils=require(_0xffc5('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xffc5('0x19'))['db'];function respondWithStatusCode(_0x20aa4c,_0x303279){_0x303279=_0x303279||0xcc;return function(_0x115800){if(_0x115800){return _0x20aa4c['sendStatus'](_0x303279);}return _0x20aa4c[_0xffc5('0x1a')](_0x303279)[_0xffc5('0x1b')]();};}function respondWithResult(_0x9d7e11,_0x56f2af){_0x56f2af=_0x56f2af||0xc8;return function(_0x53c0f1){if(_0x53c0f1){return _0x9d7e11[_0xffc5('0x1a')](_0x56f2af)['json'](_0x53c0f1);}};}function respondWithFilteredResult(_0xe03e24,_0x122554){return function(_0x3620d1){if(_0x3620d1){var _0x37d6fb=typeof _0x122554['offset']===_0xffc5('0x1c')&&typeof _0x122554[_0xffc5('0x1d')]==='undefined';var _0x4b4ffd=_0x3620d1['count'];var _0x14b391=_0x37d6fb?0x0:_0x122554[_0xffc5('0x1e')];var _0x115563=_0x37d6fb?_0x3620d1[_0xffc5('0x1f')]:_0x122554['offset']+_0x122554[_0xffc5('0x1d')];var _0x55634c;if(_0x115563>=_0x4b4ffd){_0x115563=_0x4b4ffd;_0x55634c=0xc8;}else{_0x55634c=0xce;}_0xe03e24[_0xffc5('0x1a')](_0x55634c);return _0xe03e24[_0xffc5('0x20')](_0xffc5('0x21'),_0x14b391+'-'+_0x115563+'/'+_0x4b4ffd)['json'](_0x3620d1);}return null;};}function patchUpdates(_0x9c0f29){return function(_0x3e8b1d){try{jsonpatch[_0xffc5('0x22')](_0x3e8b1d,_0x9c0f29,!![]);}catch(_0x237903){return BPromise[_0xffc5('0x23')](_0x237903);}return _0x3e8b1d[_0xffc5('0x24')]();};}function saveUpdates(_0x3c7cb0,_0xfc0cc7){return function(_0x4611c7){if(_0x4611c7){return _0x4611c7[_0xffc5('0x25')](_0x3c7cb0)[_0xffc5('0x26')](function(_0x34e369){return _0x34e369;});}return null;};}function removeEntity(_0xe5d2f3,_0x5bd746){return function(_0x3741a9){if(_0x3741a9){return _0x3741a9[_0xffc5('0x27')]()[_0xffc5('0x26')](function(){_0xe5d2f3[_0xffc5('0x1a')](0xcc)[_0xffc5('0x1b')]();});}};}function handleEntityNotFound(_0x4eb76b,_0x41b742){return function(_0x3388d4){if(!_0x3388d4){_0x4eb76b['sendStatus'](0x194);}return _0x3388d4;};}function handleError(_0x728475,_0x5c39a7){_0x5c39a7=_0x5c39a7||0x1f4;return function(_0x46e62e){logger[_0xffc5('0x28')](_0x46e62e[_0xffc5('0x29')]);if(_0x46e62e[_0xffc5('0x2a')]){delete _0x46e62e[_0xffc5('0x2a')];}_0x728475[_0xffc5('0x1a')](_0x5c39a7)[_0xffc5('0x2b')](_0x46e62e);};}exports[_0xffc5('0x2c')]=function(_0x347cd6,_0x1d0dc5){var _0x5760f8={},_0xd3d4f8={},_0x4d5e0e={'count':0x0,'rows':[]};var _0x44b43b=_[_0xffc5('0x2d')](db[_0xffc5('0x2e')][_0xffc5('0x2f')],function(_0x52b754){return{'name':_0x52b754[_0xffc5('0x30')],'type':_0x52b754['type'][_0xffc5('0x31')]};});_0xd3d4f8[_0xffc5('0x32')]=_['map'](_0x44b43b,'name');_0xd3d4f8[_0xffc5('0x33')]=_[_0xffc5('0x34')](_0x347cd6['query']);_0xd3d4f8['filters']=_[_0xffc5('0x35')](_0xd3d4f8['model'],_0xd3d4f8[_0xffc5('0x33')]);_0x5760f8[_0xffc5('0x36')]=_[_0xffc5('0x35')](_0xd3d4f8[_0xffc5('0x32')],qs[_0xffc5('0x37')](_0x347cd6['query']['fields']));_0x5760f8['attributes']=_0x5760f8['attributes'][_0xffc5('0x38')]?_0x5760f8['attributes']:_0xd3d4f8[_0xffc5('0x32')];if(!_0x347cd6[_0xffc5('0x33')]['hasOwnProperty'](_0xffc5('0x39'))){_0x5760f8[_0xffc5('0x1d')]=qs[_0xffc5('0x1d')](_0x347cd6['query'][_0xffc5('0x1d')]);_0x5760f8['offset']=qs[_0xffc5('0x1e')](_0x347cd6[_0xffc5('0x33')]['offset']);}_0x5760f8['order']=qs[_0xffc5('0x3a')](_0x347cd6[_0xffc5('0x33')][_0xffc5('0x3a')]);_0x5760f8[_0xffc5('0x3b')]=qs['filters'](_[_0xffc5('0x3c')](_0x347cd6[_0xffc5('0x33')],_0xd3d4f8['filters']),_0x44b43b);if(_0x347cd6[_0xffc5('0x33')][_0xffc5('0x3d')]){_0x5760f8[_0xffc5('0x3b')]=_[_0xffc5('0x3e')](_0x5760f8[_0xffc5('0x3b')],{'$or':_[_0xffc5('0x2d')](_0x44b43b,function(_0x41271f){if(_0x41271f[_0xffc5('0x3f')]!==_0xffc5('0x40')){var _0x1ebfc6={};_0x1ebfc6[_0x41271f[_0xffc5('0x2a')]]={'$like':'%'+_0x347cd6[_0xffc5('0x33')]['filter']+'%'};return _0x1ebfc6;}})});}_0x5760f8=_[_0xffc5('0x3e')]({},_0x5760f8,_0x347cd6[_0xffc5('0x41')]);var _0x457702={'where':_0x5760f8[_0xffc5('0x3b')]};return db[_0xffc5('0x2e')][_0xffc5('0x1f')](_0x457702)[_0xffc5('0x26')](function(_0x584ba9){_0x4d5e0e[_0xffc5('0x1f')]=_0x584ba9;if(_0x347cd6[_0xffc5('0x33')]['includeAll']){_0x5760f8[_0xffc5('0x42')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xffc5('0x43')](_0x5760f8);})[_0xffc5('0x26')](function(_0x1bf42e){_0x4d5e0e[_0xffc5('0x44')]=_0x1bf42e;return _0x4d5e0e;})[_0xffc5('0x26')](respondWithFilteredResult(_0x1d0dc5,_0x5760f8))['catch'](handleError(_0x1d0dc5,null));};exports['show']=function(_0x34a590,_0x2cf2a5){var _0x59f796={'raw':!![],'where':{'id':_0x34a590['params']['id']}},_0x3769c6={};_0x3769c6[_0xffc5('0x32')]=_[_0xffc5('0x34')](db['SmsQueueReport'][_0xffc5('0x2f')]);_0x3769c6[_0xffc5('0x33')]=_[_0xffc5('0x34')](_0x34a590[_0xffc5('0x33')]);_0x3769c6[_0xffc5('0x45')]=_['intersection'](_0x3769c6[_0xffc5('0x32')],_0x3769c6[_0xffc5('0x33')]);_0x59f796['attributes']=_[_0xffc5('0x35')](_0x3769c6['model'],qs[_0xffc5('0x37')](_0x34a590[_0xffc5('0x33')][_0xffc5('0x37')]));_0x59f796[_0xffc5('0x36')]=_0x59f796[_0xffc5('0x36')][_0xffc5('0x38')]?_0x59f796['attributes']:_0x3769c6['model'];if(_0x34a590[_0xffc5('0x33')][_0xffc5('0x46')]){_0x59f796[_0xffc5('0x42')]=[{'all':!![]}];}_0x59f796=_[_0xffc5('0x3e')]({},_0x59f796,_0x34a590[_0xffc5('0x41')]);return db['SmsQueueReport'][_0xffc5('0x47')](_0x59f796)[_0xffc5('0x26')](handleEntityNotFound(_0x2cf2a5,null))[_0xffc5('0x26')](respondWithResult(_0x2cf2a5,null))[_0xffc5('0x48')](handleError(_0x2cf2a5,null));};exports[_0xffc5('0x49')]=function(_0x1e2a18,_0x3a51c2){return db[_0xffc5('0x2e')][_0xffc5('0x49')](_0x1e2a18[_0xffc5('0x4a')],{})[_0xffc5('0x26')](respondWithResult(_0x3a51c2,0xc9))[_0xffc5('0x48')](handleError(_0x3a51c2,null));};exports['update']=function(_0x298023,_0x1e57c2){if(_0x298023[_0xffc5('0x4a')]['id']){delete _0x298023[_0xffc5('0x4a')]['id'];}return db[_0xffc5('0x2e')][_0xffc5('0x47')]({'where':{'id':_0x298023['params']['id']}})[_0xffc5('0x26')](handleEntityNotFound(_0x1e57c2,null))['then'](saveUpdates(_0x298023[_0xffc5('0x4a')],null))[_0xffc5('0x26')](respondWithResult(_0x1e57c2,null))[_0xffc5('0x48')](handleError(_0x1e57c2,null));};exports['destroy']=function(_0x1ec668,_0x1e5e69){return db[_0xffc5('0x2e')][_0xffc5('0x47')]({'where':{'id':_0x1ec668[_0xffc5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e5e69,null))[_0xffc5('0x26')](removeEntity(_0x1e5e69,null))[_0xffc5('0x48')](handleError(_0x1e5e69,null));};exports[_0xffc5('0x4c')]=function(_0x52647a,_0x5b2666){return db['SmsQueueReport'][_0xffc5('0x4c')]()[_0xffc5('0x26')](respondWithResult(_0x5b2666,null))[_0xffc5('0x48')](handleError(_0x5b2666,null));}; \ No newline at end of file +var _0x0409=['to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','name','SmsQueueReport','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox'];(function(_0x1c41a9,_0x489de9){var _0x3e9d80=function(_0x4e4237){while(--_0x4e4237){_0x1c41a9['push'](_0x1c41a9['shift']());}};_0x3e9d80(++_0x489de9);}(_0x0409,0x123));var _0x9040=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0409[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x9040('0x0'));var rimraf=require(_0x9040('0x1'));var zipdir=require(_0x9040('0x2'));var jsonpatch=require(_0x9040('0x3'));var rp=require(_0x9040('0x4'));var moment=require(_0x9040('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9040('0x6'));var util=require('util');var path=require(_0x9040('0x7'));var sox=require(_0x9040('0x8'));var csv=require(_0x9040('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9040('0xa'));var squel=require('squel');var crypto=require(_0x9040('0xb'));var jsforce=require(_0x9040('0xc'));var deskjs=require(_0x9040('0xd'));var toCsv=require(_0x9040('0x9'));var querystring=require(_0x9040('0xe'));var Papa=require(_0x9040('0xf'));var Redis=require(_0x9040('0x10'));var authService=require(_0x9040('0x11'));var qs=require(_0x9040('0x12'));var as=require(_0x9040('0x13'));var hardwareService=require(_0x9040('0x14'));var logger=require(_0x9040('0x15'))(_0x9040('0x16'));var utils=require(_0x9040('0x17'));var config=require(_0x9040('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9040('0x19'))['db'];function respondWithStatusCode(_0x1d5ae7,_0x217950){_0x217950=_0x217950||0xcc;return function(_0x404248){if(_0x404248){return _0x1d5ae7[_0x9040('0x1a')](_0x217950);}return _0x1d5ae7[_0x9040('0x1b')](_0x217950)[_0x9040('0x1c')]();};}function respondWithResult(_0x50f5b8,_0x200710){_0x200710=_0x200710||0xc8;return function(_0x266cbe){if(_0x266cbe){return _0x50f5b8[_0x9040('0x1b')](_0x200710)[_0x9040('0x1d')](_0x266cbe);}};}function respondWithFilteredResult(_0x10820f,_0x3a0041){return function(_0x42c225){if(_0x42c225){var _0x347b4a=typeof _0x3a0041[_0x9040('0x1e')]===_0x9040('0x1f')&&typeof _0x3a0041[_0x9040('0x20')]===_0x9040('0x1f');var _0x15895c=_0x42c225[_0x9040('0x21')];var _0x15cc42=_0x347b4a?0x0:_0x3a0041[_0x9040('0x1e')];var _0x53cfa2=_0x347b4a?_0x42c225[_0x9040('0x21')]:_0x3a0041[_0x9040('0x1e')]+_0x3a0041[_0x9040('0x20')];var _0x49a609;if(_0x53cfa2>=_0x15895c){_0x53cfa2=_0x15895c;_0x49a609=0xc8;}else{_0x49a609=0xce;}_0x10820f[_0x9040('0x1b')](_0x49a609);return _0x10820f[_0x9040('0x22')](_0x9040('0x23'),_0x15cc42+'-'+_0x53cfa2+'/'+_0x15895c)[_0x9040('0x1d')](_0x42c225);}return null;};}function patchUpdates(_0xc2ed6b){return function(_0x2ca0f5){try{jsonpatch[_0x9040('0x24')](_0x2ca0f5,_0xc2ed6b,!![]);}catch(_0x3c9891){return BPromise['reject'](_0x3c9891);}return _0x2ca0f5['save']();};}function saveUpdates(_0x510ac4,_0x4995d6){return function(_0x1dbbb4){if(_0x1dbbb4){return _0x1dbbb4[_0x9040('0x25')](_0x510ac4)[_0x9040('0x26')](function(_0x3a47d3){return _0x3a47d3;});}return null;};}function removeEntity(_0x149608,_0x13cdc4){return function(_0xae7bde){if(_0xae7bde){return _0xae7bde[_0x9040('0x27')]()['then'](function(){_0x149608[_0x9040('0x1b')](0xcc)[_0x9040('0x1c')]();});}};}function handleEntityNotFound(_0x464f2c,_0x1a167d){return function(_0x542aec){if(!_0x542aec){_0x464f2c['sendStatus'](0x194);}return _0x542aec;};}function handleError(_0x47e1b6,_0x55499a){_0x55499a=_0x55499a||0x1f4;return function(_0x5bb95c){logger[_0x9040('0x28')](_0x5bb95c['stack']);if(_0x5bb95c['name']){delete _0x5bb95c[_0x9040('0x29')];}_0x47e1b6['status'](_0x55499a)['send'](_0x5bb95c);};}exports['index']=function(_0x5568f5,_0x2ddab6){var _0x5b9d8b={},_0x469748={},_0x543062={'count':0x0,'rows':[]};var _0x1bc376=_['map'](db[_0x9040('0x2a')]['rawAttributes'],function(_0x762115){return{'name':_0x762115[_0x9040('0x2b')],'type':_0x762115['type'][_0x9040('0x2c')]};});_0x469748[_0x9040('0x2d')]=_[_0x9040('0x2e')](_0x1bc376,'name');_0x469748[_0x9040('0x2f')]=_[_0x9040('0x30')](_0x5568f5[_0x9040('0x2f')]);_0x469748[_0x9040('0x31')]=_[_0x9040('0x32')](_0x469748[_0x9040('0x2d')],_0x469748[_0x9040('0x2f')]);_0x5b9d8b['attributes']=_[_0x9040('0x32')](_0x469748[_0x9040('0x2d')],qs[_0x9040('0x33')](_0x5568f5[_0x9040('0x2f')]['fields']));_0x5b9d8b[_0x9040('0x34')]=_0x5b9d8b[_0x9040('0x34')]['length']?_0x5b9d8b[_0x9040('0x34')]:_0x469748['model'];if(!_0x5568f5[_0x9040('0x2f')]['hasOwnProperty'](_0x9040('0x35'))){_0x5b9d8b[_0x9040('0x20')]=qs['limit'](_0x5568f5[_0x9040('0x2f')][_0x9040('0x20')]);_0x5b9d8b[_0x9040('0x1e')]=qs[_0x9040('0x1e')](_0x5568f5['query']['offset']);}_0x5b9d8b[_0x9040('0x36')]=qs[_0x9040('0x37')](_0x5568f5['query'][_0x9040('0x37')]);_0x5b9d8b[_0x9040('0x38')]=qs[_0x9040('0x31')](_[_0x9040('0x39')](_0x5568f5[_0x9040('0x2f')],_0x469748[_0x9040('0x31')]),_0x1bc376);if(_0x5568f5[_0x9040('0x2f')][_0x9040('0x3a')]){_0x5b9d8b['where']=_[_0x9040('0x3b')](_0x5b9d8b['where'],{'$or':_[_0x9040('0x2e')](_0x1bc376,function(_0x34cd4e){if(_0x34cd4e[_0x9040('0x3c')]!==_0x9040('0x3d')){var _0x2aa5cc={};_0x2aa5cc[_0x34cd4e[_0x9040('0x29')]]={'$like':'%'+_0x5568f5[_0x9040('0x2f')][_0x9040('0x3a')]+'%'};return _0x2aa5cc;}})});}_0x5b9d8b=_['merge']({},_0x5b9d8b,_0x5568f5[_0x9040('0x3e')]);var _0x2d4c5a={'where':_0x5b9d8b[_0x9040('0x38')]};return db['SmsQueueReport'][_0x9040('0x21')](_0x2d4c5a)[_0x9040('0x26')](function(_0x370f51){_0x543062[_0x9040('0x21')]=_0x370f51;if(_0x5568f5[_0x9040('0x2f')][_0x9040('0x3f')]){_0x5b9d8b[_0x9040('0x40')]=[{'all':!![]}];}return db[_0x9040('0x2a')][_0x9040('0x41')](_0x5b9d8b);})[_0x9040('0x26')](function(_0x452edd){_0x543062[_0x9040('0x42')]=_0x452edd;return _0x543062;})['then'](respondWithFilteredResult(_0x2ddab6,_0x5b9d8b))[_0x9040('0x43')](handleError(_0x2ddab6,null));};exports['show']=function(_0x17d8b9,_0x4b232b){var _0x4169d9={'raw':!![],'where':{'id':_0x17d8b9['params']['id']}},_0x432073={};_0x432073['model']=_['keys'](db[_0x9040('0x2a')][_0x9040('0x44')]);_0x432073[_0x9040('0x2f')]=_['keys'](_0x17d8b9['query']);_0x432073[_0x9040('0x31')]=_['intersection'](_0x432073['model'],_0x432073[_0x9040('0x2f')]);_0x4169d9['attributes']=_[_0x9040('0x32')](_0x432073[_0x9040('0x2d')],qs[_0x9040('0x33')](_0x17d8b9[_0x9040('0x2f')][_0x9040('0x33')]));_0x4169d9[_0x9040('0x34')]=_0x4169d9[_0x9040('0x34')][_0x9040('0x45')]?_0x4169d9[_0x9040('0x34')]:_0x432073[_0x9040('0x2d')];if(_0x17d8b9[_0x9040('0x2f')]['includeAll']){_0x4169d9['include']=[{'all':!![]}];}_0x4169d9=_[_0x9040('0x3b')]({},_0x4169d9,_0x17d8b9[_0x9040('0x3e')]);return db[_0x9040('0x2a')][_0x9040('0x46')](_0x4169d9)[_0x9040('0x26')](handleEntityNotFound(_0x4b232b,null))['then'](respondWithResult(_0x4b232b,null))[_0x9040('0x43')](handleError(_0x4b232b,null));};exports[_0x9040('0x47')]=function(_0x2d93fb,_0x3be4ff){return db[_0x9040('0x2a')][_0x9040('0x47')](_0x2d93fb[_0x9040('0x48')],{})[_0x9040('0x26')](respondWithResult(_0x3be4ff,0xc9))['catch'](handleError(_0x3be4ff,null));};exports['update']=function(_0x4855ab,_0x3e27bb){if(_0x4855ab['body']['id']){delete _0x4855ab[_0x9040('0x48')]['id'];}return db[_0x9040('0x2a')]['find']({'where':{'id':_0x4855ab[_0x9040('0x49')]['id']}})[_0x9040('0x26')](handleEntityNotFound(_0x3e27bb,null))[_0x9040('0x26')](saveUpdates(_0x4855ab['body'],null))[_0x9040('0x26')](respondWithResult(_0x3e27bb,null))[_0x9040('0x43')](handleError(_0x3e27bb,null));};exports[_0x9040('0x27')]=function(_0x22d1f8,_0x394738){return db['SmsQueueReport'][_0x9040('0x46')]({'where':{'id':_0x22d1f8[_0x9040('0x49')]['id']}})[_0x9040('0x26')](handleEntityNotFound(_0x394738,null))[_0x9040('0x26')](removeEntity(_0x394738,null))['catch'](handleError(_0x394738,null));};exports['describe']=function(_0x3bde1b,_0x235597){return db[_0x9040('0x2a')][_0x9040('0x4a')]()[_0x9040('0x26')](respondWithResult(_0x235597,null))[_0x9040('0x43')](handleError(_0x235597,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index aba1c16..6a5e960 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x333d35,_0x2b6b19){var _0x31e6c7=function(_0xb02e0c){while(--_0xb02e0c){_0x333d35['push'](_0x333d35['shift']());}};_0x31e6c7(++_0x2b6b19);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x9dc8be,_0x1bab69){var _0x115701=function(_0x5d563c){while(--_0x5d563c){_0x9dc8be['push'](_0x9dc8be['shift']());}};_0x115701(++_0x1bab69);}(_0xe706,0xa3));var _0x6e70=function(_0x1196b0,_0x36c47a){_0x1196b0=_0x1196b0-0x0;var _0x111c52=_0xe706[_0x1196b0];return _0x111c52;};'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/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 27c8c87..4326cc8 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 _0x7a3f=['CreateSmsQueueReport','UpdateSmsQueueReport','update','attributes','limit','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','body','options','raw'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0x7a3f,0x91));var _0xf7a3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a3f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf7a3('0x0'));var rs=require(_0xf7a3('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7a3('0x2'))['db'];var utils=require(_0xf7a3('0x3'));var logger=require(_0xf7a3('0x4'))('rpc');var config=require(_0xf7a3('0x5'));var jayson=require(_0xf7a3('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x54064d,_0x3e8128,_0x17870e){return new BPromise(function(_0x207ac9,_0x1a7fc6){return client['request'](_0x54064d,_0x17870e)[_0xf7a3('0x7')](function(_0x2b7964){logger[_0xf7a3('0x8')](_0xf7a3('0x9'),_0x3e8128,_0xf7a3('0xa'));logger[_0xf7a3('0xb')](_0xf7a3('0xc'),_0x3e8128,_0xf7a3('0xa'),JSON[_0xf7a3('0xd')](_0x2b7964));if(_0x2b7964['error']){if(_0x2b7964[_0xf7a3('0xe')][_0xf7a3('0xf')]===0x1f4){logger['error'](_0xf7a3('0x9'),_0x3e8128,_0x2b7964['error'][_0xf7a3('0x10')]);return _0x1a7fc6(_0x2b7964['error'][_0xf7a3('0x10')]);}logger[_0xf7a3('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x3e8128,_0x2b7964[_0xf7a3('0xe')]['message']);return _0x207ac9(_0x2b7964[_0xf7a3('0xe')][_0xf7a3('0x10')]);}else{logger[_0xf7a3('0x8')](_0xf7a3('0x9'),_0x3e8128,'request\x20sent');_0x207ac9(_0x2b7964[_0xf7a3('0x11')]['message']);}})[_0xf7a3('0x12')](function(_0x24da7f){logger[_0xf7a3('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x3e8128,_0x24da7f);_0x1a7fc6(_0x24da7f);});});}exports['CreateSmsQueueReport']=function(_0x5b5bb4){var _0x4364c9=this;return new Promise(function(_0x304a26,_0x100ed4){return db[_0xf7a3('0x13')]['create'](_0x5b5bb4[_0xf7a3('0x14')],{'raw':_0x5b5bb4[_0xf7a3('0x15')]?_0x5b5bb4[_0xf7a3('0x15')][_0xf7a3('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x56bc58){logger[_0xf7a3('0x8')](_0xf7a3('0x17'),_0x5b5bb4);logger[_0xf7a3('0xb')](_0xf7a3('0x17'),_0x5b5bb4,JSON['stringify'](_0x56bc58));_0x304a26(_0x56bc58);})[_0xf7a3('0x12')](function(_0x86e94d){logger[_0xf7a3('0xe')](_0xf7a3('0x17'),_0x86e94d['message'],_0x5b5bb4);_0x100ed4(_0x4364c9['error'](0x1f4,_0x86e94d[_0xf7a3('0x10')]));});});};exports[_0xf7a3('0x18')]=function(_0x28ae17){var _0x5ede51=this;return new Promise(function(_0xccc30c,_0xeb2d5d){return db[_0xf7a3('0x13')][_0xf7a3('0x19')](_0x28ae17[_0xf7a3('0x14')],{'raw':_0x28ae17['options']?_0x28ae17[_0xf7a3('0x15')][_0xf7a3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28ae17[_0xf7a3('0x15')]?_0x28ae17[_0xf7a3('0x15')]['where']||null:null,'attributes':_0x28ae17[_0xf7a3('0x15')]?_0x28ae17[_0xf7a3('0x15')][_0xf7a3('0x1a')]||null:null,'limit':_0x28ae17[_0xf7a3('0x15')]?_0x28ae17[_0xf7a3('0x15')][_0xf7a3('0x1b')]||null:null})['then'](function(_0x38bd8f){logger[_0xf7a3('0x8')](_0xf7a3('0x18'),_0x28ae17);logger[_0xf7a3('0xb')](_0xf7a3('0x18'),_0x28ae17,JSON[_0xf7a3('0xd')](_0x38bd8f));_0xccc30c(_0x38bd8f);})[_0xf7a3('0x12')](function(_0x4a5979){logger['error']('UpdateSmsQueueReport',_0x4a5979[_0xf7a3('0x10')],_0x28ae17);_0xeb2d5d(_0x5ede51[_0xf7a3('0xe')](0x1f4,_0x4a5979[_0xf7a3('0x10')]));});});}; \ No newline at end of file +var _0x4c0e=['body','options','CreateSmsQueueReport','catch','SmsQueueReport','update','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c0e,0xab));var _0xe4c0=function(_0x280dd8,_0x5c8eb8){_0x280dd8=_0x280dd8-0x0;var _0x2a6aa6=_0x4c0e[_0x280dd8];return _0x2a6aa6;};'use strict';var _=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var moment=require('moment');var BPromise=require(_0xe4c0('0x2'));var rs=require(_0xe4c0('0x3'));var fs=require('fs');var Redis=require(_0xe4c0('0x4'));var db=require(_0xe4c0('0x5'))['db'];var utils=require(_0xe4c0('0x6'));var logger=require('../../config/logger')(_0xe4c0('0x7'));var config=require(_0xe4c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x514d3e,_0x20753d,_0x21c251){return new BPromise(function(_0x4e4e7b,_0x2146eb){return client[_0xe4c0('0x9')](_0x514d3e,_0x21c251)[_0xe4c0('0xa')](function(_0x577547){logger[_0xe4c0('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x20753d,'request\x20sent');logger[_0xe4c0('0xc')](_0xe4c0('0xd'),_0x20753d,_0xe4c0('0xe'),JSON[_0xe4c0('0xf')](_0x577547));if(_0x577547[_0xe4c0('0x10')]){if(_0x577547[_0xe4c0('0x10')][_0xe4c0('0x11')]===0x1f4){logger['error'](_0xe4c0('0x12'),_0x20753d,_0x577547['error'][_0xe4c0('0x13')]);return _0x2146eb(_0x577547[_0xe4c0('0x10')]['message']);}logger[_0xe4c0('0x10')](_0xe4c0('0x12'),_0x20753d,_0x577547[_0xe4c0('0x10')]['message']);return _0x4e4e7b(_0x577547[_0xe4c0('0x10')][_0xe4c0('0x13')]);}else{logger[_0xe4c0('0xb')](_0xe4c0('0x12'),_0x20753d,_0xe4c0('0xe'));_0x4e4e7b(_0x577547[_0xe4c0('0x14')][_0xe4c0('0x13')]);}})['catch'](function(_0x29d8bf){logger[_0xe4c0('0x10')](_0xe4c0('0x12'),_0x20753d,_0x29d8bf);_0x2146eb(_0x29d8bf);});});}exports['CreateSmsQueueReport']=function(_0x1c91c0){var _0x3d1af2=this;return new Promise(function(_0xd13c49,_0x47649c){return db['SmsQueueReport']['create'](_0x1c91c0[_0xe4c0('0x15')],{'raw':_0x1c91c0[_0xe4c0('0x16')]?_0x1c91c0['options']['raw']===undefined?!![]:![]:!![]})[_0xe4c0('0xa')](function(_0x2aa325){logger[_0xe4c0('0xb')](_0xe4c0('0x17'),_0x1c91c0);logger[_0xe4c0('0xc')]('CreateSmsQueueReport',_0x1c91c0,JSON[_0xe4c0('0xf')](_0x2aa325));_0xd13c49(_0x2aa325);})[_0xe4c0('0x18')](function(_0x426932){logger[_0xe4c0('0x10')](_0xe4c0('0x17'),_0x426932[_0xe4c0('0x13')],_0x1c91c0);_0x47649c(_0x3d1af2['error'](0x1f4,_0x426932['message']));});});};exports['UpdateSmsQueueReport']=function(_0x2493ef){var _0x1148d0=this;return new Promise(function(_0xfbc14b,_0x111eb7){return db[_0xe4c0('0x19')][_0xe4c0('0x1a')](_0x2493ef[_0xe4c0('0x15')],{'raw':_0x2493ef[_0xe4c0('0x16')]?_0x2493ef[_0xe4c0('0x16')][_0xe4c0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2493ef[_0xe4c0('0x16')]?_0x2493ef[_0xe4c0('0x16')][_0xe4c0('0x1c')]||null:null,'attributes':_0x2493ef[_0xe4c0('0x16')]?_0x2493ef[_0xe4c0('0x16')][_0xe4c0('0x1d')]||null:null,'limit':_0x2493ef[_0xe4c0('0x16')]?_0x2493ef[_0xe4c0('0x16')][_0xe4c0('0x1e')]||null:null})['then'](function(_0x4e2d0e){logger['info'](_0xe4c0('0x1f'),_0x2493ef);logger[_0xe4c0('0xc')](_0xe4c0('0x1f'),_0x2493ef,JSON[_0xe4c0('0xf')](_0x4e2d0e));_0xfbc14b(_0x4e2d0e);})[_0xe4c0('0x18')](function(_0x167de2){logger[_0xe4c0('0x10')]('UpdateSmsQueueReport',_0x167de2['message'],_0x2493ef);_0x111eb7(_0x1148d0[_0xe4c0('0x10')](0x1f4,_0x167de2[_0xe4c0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 1747883..871be02 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 _0x6f47=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util'];(function(_0x2673bb,_0x292576){var _0x3edc1c=function(_0x210d91){while(--_0x210d91){_0x2673bb['push'](_0x2673bb['shift']());}};_0x3edc1c(++_0x292576);}(_0x6f47,0xc7));var _0x76f4=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x6f47[_0x174ef5];return _0x1cc379;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f4('0x8')]);router[_0x76f4('0x7')](_0x76f4('0x9'),auth['isAuthenticated'](),controller[_0x76f4('0xa')]);router[_0x76f4('0x7')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76f4('0xe')]);router[_0x76f4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x76f4('0x10')]);router[_0x76f4('0x11')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0x12')]);module[_0x76f4('0x13')]=router; \ No newline at end of file +var _0x029b=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','index','post','create','put','update','delete','/:id','exports'];(function(_0x593f68,_0x39dc51){var _0x160833=function(_0x56557e){while(--_0x56557e){_0x593f68['push'](_0x593f68['shift']());}};_0x160833(++_0x39dc51);}(_0x029b,0x66));var _0xb029=function(_0x1527ec,_0xa2afb9){_0x1527ec=_0x1527ec-0x0;var _0x22533d=_0x029b[_0x1527ec];return _0x22533d;};'use strict';var multer=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var path=require('path');var timeout=require(_0xb029('0x2'));var express=require(_0xb029('0x3'));var router=express['Router']();var fs_extra=require(_0xb029('0x4'));var auth=require(_0xb029('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb029('0x6'));router[_0xb029('0x7')]('/',auth[_0xb029('0x8')](),controller[_0xb029('0x9')]);router[_0xb029('0x7')]('/describe',auth[_0xb029('0x8')](),controller['describe']);router[_0xb029('0x7')]('/:id',auth[_0xb029('0x8')](),controller['show']);router[_0xb029('0xa')]('/',auth['isAuthenticated'](),controller[_0xb029('0xb')]);router[_0xb029('0xc')]('/:id',auth[_0xb029('0x8')](),controller[_0xb029('0xd')]);router[_0xb029('0xe')](_0xb029('0xf'),auth[_0xb029('0x8')](),controller['destroy']);module[_0xb029('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 15a005f..17b9166 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(_0x7d9aad,_0x1ba576){var _0x17c02f=function(_0x28fc9f){while(--_0x28fc9f){_0x7d9aad['push'](_0x7d9aad['shift']());}};_0x17c02f(++_0x1ba576);}(_0x70e0,0x17b));var _0x070e=function(_0x556e61,_0x23457f){_0x556e61=_0x556e61-0x0;var _0x3e86e8=_0x70e0[_0x556e61];return _0x3e86e8;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xb43b,0x1b2));var _0xbb43=function(_0x809db3,_0x4b7b5f){_0x809db3=_0x809db3-0x0;var _0x5b34a7=_0xb43b[_0x809db3];return _0x5b34a7;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 701974b..e6a50c2 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 _0x014c=['order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x1fc86d,_0x5481f0){var _0x282003=function(_0x129486){while(--_0x129486){_0x1fc86d['push'](_0x1fc86d['shift']());}};_0x282003(++_0x5481f0);}(_0x014c,0x17b));var _0xc014=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x014c[_0x4a0e68];return _0x4fb274;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc014('0x1'));var rp=require(_0xc014('0x2'));var moment=require(_0xc014('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc014('0x4'));var path=require(_0xc014('0x5'));var sox=require(_0xc014('0x6'));var csv=require(_0xc014('0x7'));var ejs=require(_0xc014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x7'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc014('0x14'))['db'];function respondWithStatusCode(_0xcde2d3,_0x2f8ac9){_0x2f8ac9=_0x2f8ac9||0xcc;return function(_0x1686f1){if(_0x1686f1){return _0xcde2d3['sendStatus'](_0x2f8ac9);}return _0xcde2d3[_0xc014('0x15')](_0x2f8ac9)[_0xc014('0x16')]();};}function respondWithResult(_0xe86dd,_0x5ced7d){_0x5ced7d=_0x5ced7d||0xc8;return function(_0x36b26e){if(_0x36b26e){return _0xe86dd['status'](_0x5ced7d)[_0xc014('0x17')](_0x36b26e);}};}function respondWithFilteredResult(_0x1c4d3b,_0x25fdf6){return function(_0x26f264){if(_0x26f264){var _0x9f6a26=typeof _0x25fdf6[_0xc014('0x18')]==='undefined'&&typeof _0x25fdf6[_0xc014('0x19')]===_0xc014('0x1a');var _0x263ad0=_0x26f264[_0xc014('0x1b')];var _0x5a2be0=_0x9f6a26?0x0:_0x25fdf6['offset'];var _0x42f93d=_0x9f6a26?_0x26f264['count']:_0x25fdf6['offset']+_0x25fdf6[_0xc014('0x19')];var _0x4287fe;if(_0x42f93d>=_0x263ad0){_0x42f93d=_0x263ad0;_0x4287fe=0xc8;}else{_0x4287fe=0xce;}_0x1c4d3b['status'](_0x4287fe);return _0x1c4d3b[_0xc014('0x1c')](_0xc014('0x1d'),_0x5a2be0+'-'+_0x42f93d+'/'+_0x263ad0)[_0xc014('0x17')](_0x26f264);}return null;};}function patchUpdates(_0x2dac66){return function(_0x1078c4){try{jsonpatch['apply'](_0x1078c4,_0x2dac66,!![]);}catch(_0xc8b0fb){return BPromise[_0xc014('0x1e')](_0xc8b0fb);}return _0x1078c4[_0xc014('0x1f')]();};}function saveUpdates(_0x3c58cc,_0x450b22){return function(_0x3f28b6){if(_0x3f28b6){return _0x3f28b6[_0xc014('0x20')](_0x3c58cc)['then'](function(_0x1089c6){return _0x1089c6;});}return null;};}function removeEntity(_0x1b905d,_0x16d8f9){return function(_0x174b46){if(_0x174b46){return _0x174b46[_0xc014('0x21')]()[_0xc014('0x22')](function(){_0x1b905d[_0xc014('0x15')](0xcc)[_0xc014('0x16')]();});}};}function handleEntityNotFound(_0xe4c68,_0x2e5c30){return function(_0x4850bb){if(!_0x4850bb){_0xe4c68[_0xc014('0x23')](0x194);}return _0x4850bb;};}function handleError(_0x17b6b4,_0x36b663){_0x36b663=_0x36b663||0x1f4;return function(_0x7f47ef){logger[_0xc014('0x24')](_0x7f47ef['stack']);if(_0x7f47ef[_0xc014('0x25')]){delete _0x7f47ef[_0xc014('0x25')];}_0x17b6b4[_0xc014('0x15')](_0x36b663)[_0xc014('0x26')](_0x7f47ef);};}exports['index']=function(_0x43af57,_0x40cf7c){var _0x151705={},_0x30e97a={},_0x21cd81={'count':0x0,'rows':[]};var _0x289f92=_[_0xc014('0x27')](db[_0xc014('0x28')][_0xc014('0x29')],function(_0x330869){return{'name':_0x330869[_0xc014('0x2a')],'type':_0x330869['type'][_0xc014('0x2b')]};});_0x30e97a['model']=_['map'](_0x289f92,'name');_0x30e97a[_0xc014('0x2c')]=_[_0xc014('0x2d')](_0x43af57['query']);_0x30e97a[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],_0x30e97a[_0xc014('0x2c')]);_0x151705[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],qs[_0xc014('0x32')](_0x43af57[_0xc014('0x2c')][_0xc014('0x32')]));_0x151705[_0xc014('0x31')]=_0x151705[_0xc014('0x31')]['length']?_0x151705[_0xc014('0x31')]:_0x30e97a['model'];if(!_0x43af57[_0xc014('0x2c')][_0xc014('0x33')](_0xc014('0x34'))){_0x151705[_0xc014('0x19')]=qs[_0xc014('0x19')](_0x43af57[_0xc014('0x2c')][_0xc014('0x19')]);_0x151705['offset']=qs[_0xc014('0x18')](_0x43af57['query'][_0xc014('0x18')]);}_0x151705[_0xc014('0x35')]=qs[_0xc014('0x36')](_0x43af57[_0xc014('0x2c')][_0xc014('0x36')]);_0x151705[_0xc014('0x37')]=qs[_0xc014('0x2e')](_['pick'](_0x43af57[_0xc014('0x2c')],_0x30e97a[_0xc014('0x2e')]),_0x289f92);if(_0x43af57[_0xc014('0x2c')]['filter']){_0x151705[_0xc014('0x37')]=_[_0xc014('0x38')](_0x151705[_0xc014('0x37')],{'$or':_['map'](_0x289f92,function(_0x473754){if(_0x473754['type']!==_0xc014('0x39')){var _0x19d374={};_0x19d374[_0x473754[_0xc014('0x25')]]={'$like':'%'+_0x43af57[_0xc014('0x2c')][_0xc014('0x3a')]+'%'};return _0x19d374;}})});}_0x151705=_[_0xc014('0x38')]({},_0x151705,_0x43af57[_0xc014('0x3b')]);var _0xb0149e={'where':_0x151705[_0xc014('0x37')]};return db[_0xc014('0x28')][_0xc014('0x1b')](_0xb0149e)[_0xc014('0x22')](function(_0x565433){_0x21cd81[_0xc014('0x1b')]=_0x565433;if(_0x43af57[_0xc014('0x2c')][_0xc014('0x3c')]){_0x151705[_0xc014('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xc014('0x3e')](_0x151705);})['then'](function(_0x3a7f90){_0x21cd81[_0xc014('0x3f')]=_0x3a7f90;return _0x21cd81;})[_0xc014('0x22')](respondWithFilteredResult(_0x40cf7c,_0x151705))[_0xc014('0x40')](handleError(_0x40cf7c,null));};exports[_0xc014('0x41')]=function(_0x46ea1c,_0x1f7dfb){var _0x2a0265={'raw':!![],'where':{'id':_0x46ea1c[_0xc014('0x42')]['id']}},_0x84720d={};_0x84720d[_0xc014('0x30')]=_['keys'](db[_0xc014('0x28')]['rawAttributes']);_0x84720d['query']=_[_0xc014('0x2d')](_0x46ea1c[_0xc014('0x2c')]);_0x84720d[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x84720d[_0xc014('0x30')],_0x84720d['query']);_0x2a0265[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x84720d['model'],qs[_0xc014('0x32')](_0x46ea1c[_0xc014('0x2c')][_0xc014('0x32')]));_0x2a0265[_0xc014('0x31')]=_0x2a0265[_0xc014('0x31')][_0xc014('0x43')]?_0x2a0265[_0xc014('0x31')]:_0x84720d[_0xc014('0x30')];if(_0x46ea1c[_0xc014('0x2c')]['includeAll']){_0x2a0265[_0xc014('0x3d')]=[{'all':!![]}];}_0x2a0265=_[_0xc014('0x38')]({},_0x2a0265,_0x46ea1c[_0xc014('0x3b')]);return db[_0xc014('0x28')][_0xc014('0x44')](_0x2a0265)[_0xc014('0x22')](handleEntityNotFound(_0x1f7dfb,null))[_0xc014('0x22')](respondWithResult(_0x1f7dfb,null))[_0xc014('0x40')](handleError(_0x1f7dfb,null));};exports[_0xc014('0x45')]=function(_0x541ad6,_0x2ce299){return db['SmsTransferReport']['create'](_0x541ad6[_0xc014('0x46')],{})['then'](respondWithResult(_0x2ce299,0xc9))[_0xc014('0x40')](handleError(_0x2ce299,null));};exports[_0xc014('0x20')]=function(_0x56595e,_0x359c24){if(_0x56595e[_0xc014('0x46')]['id']){delete _0x56595e[_0xc014('0x46')]['id'];}return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x56595e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x359c24,null))[_0xc014('0x22')](saveUpdates(_0x56595e[_0xc014('0x46')],null))[_0xc014('0x22')](respondWithResult(_0x359c24,null))[_0xc014('0x40')](handleError(_0x359c24,null));};exports[_0xc014('0x21')]=function(_0x464d3e,_0x255a3b){return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x464d3e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x255a3b,null))[_0xc014('0x22')](removeEntity(_0x255a3b,null))[_0xc014('0x40')](handleError(_0x255a3b,null));};exports[_0xc014('0x47')]=function(_0x1d37be,_0x53676a){return db[_0xc014('0x28')][_0xc014('0x47')]()[_0xc014('0x22')](respondWithResult(_0x53676a,null))[_0xc014('0x40')](handleError(_0x53676a,null));}; \ No newline at end of file +var _0xa20c=['intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','name','query','filters'];(function(_0x32ebbd,_0x856bd0){var _0x18e6b3=function(_0x3015c8){while(--_0x3015c8){_0x32ebbd['push'](_0x32ebbd['shift']());}};_0x18e6b3(++_0x856bd0);}(_0xa20c,0x141));var _0xca20=function(_0x5e70f4,_0x45206a){_0x5e70f4=_0x5e70f4-0x0;var _0x169695=_0xa20c[_0x5e70f4];return _0x169695;};'use strict';var emlformat=require(_0xca20('0x0'));var rimraf=require(_0xca20('0x1'));var zipdir=require(_0xca20('0x2'));var jsonpatch=require(_0xca20('0x3'));var rp=require(_0xca20('0x4'));var moment=require(_0xca20('0x5'));var BPromise=require(_0xca20('0x6'));var Mustache=require(_0xca20('0x7'));var util=require(_0xca20('0x8'));var path=require('path');var sox=require(_0xca20('0x9'));var csv=require(_0xca20('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca20('0xb'));var _=require(_0xca20('0xc'));var squel=require(_0xca20('0xd'));var crypto=require(_0xca20('0xe'));var jsforce=require(_0xca20('0xf'));var deskjs=require(_0xca20('0x10'));var toCsv=require(_0xca20('0xa'));var querystring=require(_0xca20('0x11'));var Papa=require('papaparse');var Redis=require(_0xca20('0x12'));var authService=require(_0xca20('0x13'));var qs=require(_0xca20('0x14'));var as=require(_0xca20('0x15'));var hardwareService=require(_0xca20('0x16'));var logger=require(_0xca20('0x17'))(_0xca20('0x18'));var utils=require(_0xca20('0x19'));var config=require(_0xca20('0x1a'));var licenseUtil=require(_0xca20('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c26da,_0x5c56e4){_0x5c56e4=_0x5c56e4||0xcc;return function(_0x3fb0ff){if(_0x3fb0ff){return _0x1c26da['sendStatus'](_0x5c56e4);}return _0x1c26da[_0xca20('0x1c')](_0x5c56e4)['end']();};}function respondWithResult(_0x16848e,_0x3f6449){_0x3f6449=_0x3f6449||0xc8;return function(_0x46ec8d){if(_0x46ec8d){return _0x16848e['status'](_0x3f6449)[_0xca20('0x1d')](_0x46ec8d);}};}function respondWithFilteredResult(_0x527f0a,_0x45a2a1){return function(_0x11425d){if(_0x11425d){var _0xe8aea2=typeof _0x45a2a1[_0xca20('0x1e')]==='undefined'&&typeof _0x45a2a1[_0xca20('0x1f')]==='undefined';var _0x41a31a=_0x11425d[_0xca20('0x20')];var _0x2cbd0e=_0xe8aea2?0x0:_0x45a2a1[_0xca20('0x1e')];var _0x447997=_0xe8aea2?_0x11425d['count']:_0x45a2a1[_0xca20('0x1e')]+_0x45a2a1['limit'];var _0x4efbcc;if(_0x447997>=_0x41a31a){_0x447997=_0x41a31a;_0x4efbcc=0xc8;}else{_0x4efbcc=0xce;}_0x527f0a['status'](_0x4efbcc);return _0x527f0a[_0xca20('0x21')](_0xca20('0x22'),_0x2cbd0e+'-'+_0x447997+'/'+_0x41a31a)[_0xca20('0x1d')](_0x11425d);}return null;};}function patchUpdates(_0xa4340e){return function(_0x5982cd){try{jsonpatch[_0xca20('0x23')](_0x5982cd,_0xa4340e,!![]);}catch(_0x49cb24){return BPromise[_0xca20('0x24')](_0x49cb24);}return _0x5982cd[_0xca20('0x25')]();};}function saveUpdates(_0x2e48dd,_0x38d316){return function(_0x2f9b72){if(_0x2f9b72){return _0x2f9b72[_0xca20('0x26')](_0x2e48dd)[_0xca20('0x27')](function(_0x1a6a2b){return _0x1a6a2b;});}return null;};}function removeEntity(_0x4610bf,_0x470f9b){return function(_0x98b00b){if(_0x98b00b){return _0x98b00b[_0xca20('0x28')]()[_0xca20('0x27')](function(){_0x4610bf['status'](0xcc)[_0xca20('0x29')]();});}};}function handleEntityNotFound(_0x414fe8,_0x1891cb){return function(_0x15e562){if(!_0x15e562){_0x414fe8[_0xca20('0x2a')](0x194);}return _0x15e562;};}function handleError(_0x4c4a94,_0x229dc9){_0x229dc9=_0x229dc9||0x1f4;return function(_0x32ec88){logger['error'](_0x32ec88[_0xca20('0x2b')]);if(_0x32ec88['name']){delete _0x32ec88['name'];}_0x4c4a94[_0xca20('0x1c')](_0x229dc9)['send'](_0x32ec88);};}exports[_0xca20('0x2c')]=function(_0x26236f,_0x25b55f){var _0x1ac53b={},_0x5c1e08={},_0x5d8909={'count':0x0,'rows':[]};var _0x2c8415=_[_0xca20('0x2d')](db[_0xca20('0x2e')][_0xca20('0x2f')],function(_0x3043a9){return{'name':_0x3043a9[_0xca20('0x30')],'type':_0x3043a9['type'][_0xca20('0x31')]};});_0x5c1e08[_0xca20('0x32')]=_[_0xca20('0x2d')](_0x2c8415,_0xca20('0x33'));_0x5c1e08[_0xca20('0x34')]=_['keys'](_0x26236f['query']);_0x5c1e08[_0xca20('0x35')]=_['intersection'](_0x5c1e08['model'],_0x5c1e08['query']);_0x1ac53b['attributes']=_[_0xca20('0x36')](_0x5c1e08[_0xca20('0x32')],qs[_0xca20('0x37')](_0x26236f[_0xca20('0x34')][_0xca20('0x37')]));_0x1ac53b[_0xca20('0x38')]=_0x1ac53b[_0xca20('0x38')][_0xca20('0x39')]?_0x1ac53b[_0xca20('0x38')]:_0x5c1e08['model'];if(!_0x26236f[_0xca20('0x34')][_0xca20('0x3a')]('nolimit')){_0x1ac53b[_0xca20('0x1f')]=qs[_0xca20('0x1f')](_0x26236f[_0xca20('0x34')][_0xca20('0x1f')]);_0x1ac53b['offset']=qs[_0xca20('0x1e')](_0x26236f[_0xca20('0x34')][_0xca20('0x1e')]);}_0x1ac53b['order']=qs[_0xca20('0x3b')](_0x26236f[_0xca20('0x34')][_0xca20('0x3b')]);_0x1ac53b[_0xca20('0x3c')]=qs[_0xca20('0x35')](_[_0xca20('0x3d')](_0x26236f[_0xca20('0x34')],_0x5c1e08['filters']),_0x2c8415);if(_0x26236f[_0xca20('0x34')][_0xca20('0x3e')]){_0x1ac53b[_0xca20('0x3c')]=_['merge'](_0x1ac53b[_0xca20('0x3c')],{'$or':_[_0xca20('0x2d')](_0x2c8415,function(_0x500a84){if(_0x500a84['type']!=='VIRTUAL'){var _0x23b0f8={};_0x23b0f8[_0x500a84[_0xca20('0x33')]]={'$like':'%'+_0x26236f[_0xca20('0x34')][_0xca20('0x3e')]+'%'};return _0x23b0f8;}})});}_0x1ac53b=_[_0xca20('0x3f')]({},_0x1ac53b,_0x26236f[_0xca20('0x40')]);var _0x4e6ea4={'where':_0x1ac53b['where']};return db[_0xca20('0x2e')][_0xca20('0x20')](_0x4e6ea4)[_0xca20('0x27')](function(_0x278079){_0x5d8909[_0xca20('0x20')]=_0x278079;if(_0x26236f[_0xca20('0x34')]['includeAll']){_0x1ac53b[_0xca20('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xca20('0x42')](_0x1ac53b);})[_0xca20('0x27')](function(_0x94c71){_0x5d8909[_0xca20('0x43')]=_0x94c71;return _0x5d8909;})[_0xca20('0x27')](respondWithFilteredResult(_0x25b55f,_0x1ac53b))[_0xca20('0x44')](handleError(_0x25b55f,null));};exports[_0xca20('0x45')]=function(_0x3f82f9,_0x361d68){var _0x160a57={'raw':!![],'where':{'id':_0x3f82f9[_0xca20('0x46')]['id']}},_0x2ce307={};_0x2ce307[_0xca20('0x32')]=_['keys'](db[_0xca20('0x2e')][_0xca20('0x2f')]);_0x2ce307[_0xca20('0x34')]=_['keys'](_0x3f82f9[_0xca20('0x34')]);_0x2ce307['filters']=_['intersection'](_0x2ce307['model'],_0x2ce307['query']);_0x160a57[_0xca20('0x38')]=_[_0xca20('0x36')](_0x2ce307[_0xca20('0x32')],qs[_0xca20('0x37')](_0x3f82f9['query'][_0xca20('0x37')]));_0x160a57[_0xca20('0x38')]=_0x160a57[_0xca20('0x38')][_0xca20('0x39')]?_0x160a57['attributes']:_0x2ce307[_0xca20('0x32')];if(_0x3f82f9[_0xca20('0x34')]['includeAll']){_0x160a57[_0xca20('0x41')]=[{'all':!![]}];}_0x160a57=_['merge']({},_0x160a57,_0x3f82f9[_0xca20('0x40')]);return db[_0xca20('0x2e')][_0xca20('0x47')](_0x160a57)['then'](handleEntityNotFound(_0x361d68,null))[_0xca20('0x27')](respondWithResult(_0x361d68,null))[_0xca20('0x44')](handleError(_0x361d68,null));};exports[_0xca20('0x48')]=function(_0xc269ec,_0x3a4c44){return db[_0xca20('0x2e')][_0xca20('0x48')](_0xc269ec[_0xca20('0x49')],{})[_0xca20('0x27')](respondWithResult(_0x3a4c44,0xc9))[_0xca20('0x44')](handleError(_0x3a4c44,null));};exports[_0xca20('0x26')]=function(_0x48ec05,_0x25649f){if(_0x48ec05[_0xca20('0x49')]['id']){delete _0x48ec05[_0xca20('0x49')]['id'];}return db[_0xca20('0x2e')][_0xca20('0x47')]({'where':{'id':_0x48ec05[_0xca20('0x46')]['id']}})['then'](handleEntityNotFound(_0x25649f,null))['then'](saveUpdates(_0x48ec05[_0xca20('0x49')],null))['then'](respondWithResult(_0x25649f,null))['catch'](handleError(_0x25649f,null));};exports['destroy']=function(_0x30f274,_0x27ddb8){return db['SmsTransferReport'][_0xca20('0x47')]({'where':{'id':_0x30f274[_0xca20('0x46')]['id']}})[_0xca20('0x27')](handleEntityNotFound(_0x27ddb8,null))[_0xca20('0x27')](removeEntity(_0x27ddb8,null))[_0xca20('0x44')](handleError(_0x27ddb8,null));};exports[_0xca20('0x4a')]=function(_0x449db0,_0x422e01){return db['SmsTransferReport']['describe']()[_0xca20('0x27')](respondWithResult(_0x422e01,null))['catch'](handleError(_0x422e01,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 110bfa0..da4a971 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 _0xff2a=['define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','moment','bluebird','path','../../config/environment','./smsTransferReport.attributes'];(function(_0x322b35,_0x331025){var _0x4a508a=function(_0x5f497a){while(--_0x5f497a){_0x322b35['push'](_0x322b35['shift']());}};_0x4a508a(++_0x331025);}(_0xff2a,0x93));var _0xaff2=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0xff2a[_0x256e32];return _0x464070;};'use strict';var _=require('lodash');var util=require(_0xaff2('0x0'));var logger=require(_0xaff2('0x1'))('api');var moment=require(_0xaff2('0x2'));var BPromise=require(_0xaff2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaff2('0x4'));var rimraf=require('rimraf');var config=require(_0xaff2('0x5'));var attributes=require(_0xaff2('0x6'));module['exports']=function(_0x70cadf,_0x8313e5){return _0x70cadf[_0xaff2('0x7')](_0xaff2('0x8'),attributes,{'tableName':_0xaff2('0x9'),'paranoid':![],'indexes':[{'name':_0xaff2('0xa'),'fields':[_0xaff2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6690=['uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','SmsTransferReport'];(function(_0x137a9c,_0x55841d){var _0x45ebe8=function(_0x2cc3bf){while(--_0x2cc3bf){_0x137a9c['push'](_0x137a9c['shift']());}};_0x45ebe8(++_0x55841d);}(_0x6690,0x7a));var _0x0669=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x6690[_0x1da04e];return _0xdd8c41;};'use strict';var _=require('lodash');var util=require(_0x0669('0x0'));var logger=require(_0x0669('0x1'))(_0x0669('0x2'));var moment=require(_0x0669('0x3'));var BPromise=require('bluebird');var rp=require(_0x0669('0x4'));var fs=require('fs');var path=require(_0x0669('0x5'));var rimraf=require(_0x0669('0x6'));var config=require(_0x0669('0x7'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x5419a0,_0x3d219e){return _0x5419a0[_0x0669('0x8')](_0x0669('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x0669('0xa'),'fields':[_0x0669('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 6841bc8..f5d222d 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 _0xce1a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xce1a,0xbf));var _0xace1=function(_0x239790,_0x39c001){_0x239790=_0x239790-0x0;var _0x381946=_0xce1a[_0x239790];return _0x381946;};'use strict';var _=require(_0xace1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xace1('0x1'));var fs=require('fs');var Redis=require(_0xace1('0x2'));var db=require(_0xace1('0x3'))['db'];var utils=require(_0xace1('0x4'));var logger=require(_0xace1('0x5'))('rpc');var config=require(_0xace1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xace1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7c8f64,_0x2203ef,_0x7f3613){return new BPromise(function(_0x576b34,_0x495cff){return client[_0xace1('0x8')](_0x7c8f64,_0x7f3613)['then'](function(_0x3c8579){logger[_0xace1('0x9')](_0xace1('0xa'),_0x2203ef,_0xace1('0xb'));logger['debug'](_0xace1('0xc'),_0x2203ef,_0xace1('0xb'),JSON['stringify'](_0x3c8579));if(_0x3c8579[_0xace1('0xd')]){if(_0x3c8579[_0xace1('0xd')]['code']===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2203ef,_0x3c8579[_0xace1('0xd')][_0xace1('0xe')]);return _0x495cff(_0x3c8579[_0xace1('0xd')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2203ef,_0x3c8579[_0xace1('0xd')][_0xace1('0xe')]);return _0x576b34(_0x3c8579[_0xace1('0xd')][_0xace1('0xe')]);}else{logger[_0xace1('0x9')](_0xace1('0xa'),_0x2203ef,_0xace1('0xb'));_0x576b34(_0x3c8579[_0xace1('0xf')]['message']);}})['catch'](function(_0x42dd0e){logger[_0xace1('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2203ef,_0x42dd0e);_0x495cff(_0x42dd0e);});});} \ No newline at end of file +var _0xdbbe=['../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x53e348,_0x2cf26b){var _0x1238c7=function(_0x2dd0c0){while(--_0x2dd0c0){_0x53e348['push'](_0x53e348['shift']());}};_0x1238c7(++_0x2cf26b);}(_0xdbbe,0x148));var _0xedbb=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0xdbbe[_0x390733];return _0x33beb9;};'use strict';var _=require('lodash');var util=require(_0xedbb('0x0'));var moment=require(_0xedbb('0x1'));var BPromise=require(_0xedbb('0x2'));var rs=require(_0xedbb('0x3'));var fs=require('fs');var Redis=require(_0xedbb('0x4'));var db=require(_0xedbb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xedbb('0x6'))(_0xedbb('0x7'));var config=require(_0xedbb('0x8'));var jayson=require(_0xedbb('0x9'));var client=jayson[_0xedbb('0xa')][_0xedbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bb3dd,_0x51f66c,_0xd9cf8c){return new BPromise(function(_0x1ba82a,_0x498ff2){return client[_0xedbb('0xc')](_0x2bb3dd,_0xd9cf8c)['then'](function(_0x1d67b5){logger[_0xedbb('0xd')](_0xedbb('0xe'),_0x51f66c,'request\x20sent');logger[_0xedbb('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x51f66c,_0xedbb('0x10'),JSON[_0xedbb('0x11')](_0x1d67b5));if(_0x1d67b5[_0xedbb('0x12')]){if(_0x1d67b5[_0xedbb('0x12')]['code']===0x1f4){logger[_0xedbb('0x12')](_0xedbb('0xe'),_0x51f66c,_0x1d67b5[_0xedbb('0x12')][_0xedbb('0x13')]);return _0x498ff2(_0x1d67b5[_0xedbb('0x12')][_0xedbb('0x13')]);}logger['error'](_0xedbb('0xe'),_0x51f66c,_0x1d67b5[_0xedbb('0x12')][_0xedbb('0x13')]);return _0x1ba82a(_0x1d67b5[_0xedbb('0x12')][_0xedbb('0x13')]);}else{logger[_0xedbb('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x51f66c,'request\x20sent');_0x1ba82a(_0x1d67b5[_0xedbb('0x14')][_0xedbb('0x13')]);}})['catch'](function(_0xb83c31){logger[_0xedbb('0x12')](_0xedbb('0xe'),_0x51f66c,_0xb83c31);_0x498ff2(_0xb83c31);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 2d0081f..378da95 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 _0x7f74=['isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get'];(function(_0x1684b8,_0x202340){var _0xed586=function(_0x31abd6){while(--_0x31abd6){_0x1684b8['push'](_0x1684b8['shift']());}};_0xed586(++_0x202340);}(_0x7f74,0x148));var _0x47f7=function(_0x2590fc,_0x5950b1){_0x2590fc=_0x2590fc-0x0;var _0x31aef1=_0x7f74[_0x2590fc];return _0x31aef1;};'use strict';var multer=require(_0x47f7('0x0'));var util=require(_0x47f7('0x1'));var path=require(_0x47f7('0x2'));var timeout=require(_0x47f7('0x3'));var express=require(_0x47f7('0x4'));var router=express[_0x47f7('0x5')]();var fs_extra=require(_0x47f7('0x6'));var auth=require(_0x47f7('0x7'));var interaction=require(_0x47f7('0x8'));var config=require(_0x47f7('0x9'));var controller=require(_0x47f7('0xa'));router[_0x47f7('0xb')]('/',auth[_0x47f7('0xc')](),controller[_0x47f7('0xd')]);router[_0x47f7('0xb')](_0x47f7('0xe'),auth[_0x47f7('0xc')](),controller['show']);router['get'](_0x47f7('0xf'),auth[_0x47f7('0xc')](),controller[_0x47f7('0x10')]);var upload=multer({'storage':multer[_0x47f7('0x11')]({'destination':function(_0x11a29c,_0x1428ae,_0xb90809){_0xb90809(null,path[_0x47f7('0x12')](config[_0x47f7('0x13')],_0x47f7('0x14')));},'filename':function(_0x30d379,_0xeed76c,_0x4edbd8){_0xeed76c[_0x47f7('0x15')]=_0xeed76c[_0x47f7('0x15')][_0x47f7('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4edbd8(null,util[_0x47f7('0x17')](_0x47f7('0x18'),path[_0x47f7('0x19')](_0xeed76c['originalname'],path[_0x47f7('0x1a')](_0xeed76c['originalname'])),Date['now'](),path[_0x47f7('0x1a')](_0xeed76c[_0x47f7('0x15')])));}})});router[_0x47f7('0x1b')]('/',upload[_0x47f7('0x1c')](_0x47f7('0x1d')),controller[_0x47f7('0x1e')]);router[_0x47f7('0x1f')](_0x47f7('0xe'),auth[_0x47f7('0xc')](),controller['update']);router[_0x47f7('0x20')](_0x47f7('0xe'),auth['isAuthenticated'](),controller['delete']);module[_0x47f7('0x21')]=router; \ No newline at end of file +var _0xf0a7=['single','file','create','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','show','/:id/download','isAuthenticated','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now'];(function(_0x119a01,_0x57e57e){var _0x2b7843=function(_0x490394){while(--_0x490394){_0x119a01['push'](_0x119a01['shift']());}};_0x2b7843(++_0x57e57e);}(_0xf0a7,0xfd));var _0x7f0a=function(_0x4b9a46,_0x4812bb){_0x4b9a46=_0x4b9a46-0x0;var _0x3a7334=_0xf0a7[_0x4b9a46];return _0x3a7334;};'use strict';var multer=require(_0x7f0a('0x0'));var util=require(_0x7f0a('0x1'));var path=require(_0x7f0a('0x2'));var timeout=require(_0x7f0a('0x3'));var express=require('express');var router=express[_0x7f0a('0x4')]();var fs_extra=require(_0x7f0a('0x5'));var auth=require(_0x7f0a('0x6'));var interaction=require(_0x7f0a('0x7'));var config=require(_0x7f0a('0x8'));var controller=require(_0x7f0a('0x9'));router[_0x7f0a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7f0a('0xb'),auth['isAuthenticated'](),controller[_0x7f0a('0xc')]);router['get'](_0x7f0a('0xd'),auth[_0x7f0a('0xe')](),controller[_0x7f0a('0xf')]);var upload=multer({'storage':multer[_0x7f0a('0x10')]({'destination':function(_0x489dc4,_0x442ba1,_0x3d5e93){_0x3d5e93(null,path[_0x7f0a('0x11')](config[_0x7f0a('0x12')],'server/files/sounds/original/'));},'filename':function(_0x334b8b,_0x45bec2,_0x101dfd){_0x45bec2[_0x7f0a('0x13')]=_0x45bec2[_0x7f0a('0x13')][_0x7f0a('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x101dfd(null,util[_0x7f0a('0x15')](_0x7f0a('0x16'),path[_0x7f0a('0x17')](_0x45bec2[_0x7f0a('0x13')],path[_0x7f0a('0x18')](_0x45bec2['originalname'])),Date[_0x7f0a('0x19')](),path['extname'](_0x45bec2[_0x7f0a('0x13')])));}})});router['post']('/',upload[_0x7f0a('0x1a')](_0x7f0a('0x1b')),controller[_0x7f0a('0x1c')]);router['put'](_0x7f0a('0xb'),auth['isAuthenticated'](),controller[_0x7f0a('0x1d')]);router[_0x7f0a('0x1e')]('/:id',auth[_0x7f0a('0xe')](),controller[_0x7f0a('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 12af8c6..8e957a4 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 _0xf6f0=['INTEGER','FLOAT','sequelize','exports','STRING','name','BIGINT'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf6f0,0xdb));var _0x0f6f=function(_0x646b70,_0x53d1e8){_0x646b70=_0x646b70-0x0;var _0x3c921a=_0xf6f0[_0x646b70];return _0x3c921a;};'use strict';var Sequelize=require(_0x0f6f('0x0'));module[_0x0f6f('0x1')]={'name':{'type':Sequelize[_0x0f6f('0x2')],'unique':_0x0f6f('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x0f6f('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x0f6f('0x2')]},'original_format':{'type':Sequelize[_0x0f6f('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x0f6f('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x0f6f('0x4')]},'original_sampleRate':{'type':Sequelize[_0x0f6f('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x0f6f('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x0f6f('0x4')]},'converted_channelCount':{'type':Sequelize[_0x0f6f('0x5')]},'converted_bitRate':{'type':Sequelize[_0x0f6f('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x0f6f('0x5')]}}; \ No newline at end of file +var _0x4b7b=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x1c351b,_0x177ebd){var _0x175344=function(_0x37d578){while(--_0x37d578){_0x1c351b['push'](_0x1c351b['shift']());}};_0x175344(++_0x177ebd);}(_0x4b7b,0x73));var _0xb4b7=function(_0x1907e4,_0x1dee82){_0x1907e4=_0x1907e4-0x0;var _0x1fbe98=_0x4b7b[_0x1907e4];return _0x1fbe98;};'use strict';var Sequelize=require(_0xb4b7('0x0'));module[_0xb4b7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb4b7('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xb4b7('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xb4b7('0x4')]},'original_sampleCount':{'type':Sequelize[_0xb4b7('0x5')]},'original_channelCount':{'type':Sequelize[_0xb4b7('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xb4b7('0x6')]},'converted_format':{'type':Sequelize[_0xb4b7('0x3')]},'converted_duration':{'type':Sequelize[_0xb4b7('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xb4b7('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xb4b7('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xb4b7('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 6f96fd7..d35fa3c 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 _0x11de=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','save_name','converted_format','existsSync','join','root','Sequelize','Sound\x20not\x20found','download','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x331613,_0x472bd6){var _0x4b5e57=function(_0x66ca42){while(--_0x66ca42){_0x331613['push'](_0x331613['shift']());}};_0x4b5e57(++_0x472bd6);}(_0x11de,0x13a));var _0xe11d=function(_0x3584fd,_0x52b234){_0x3584fd=_0x3584fd-0x0;var _0x1e4991=_0x11de[_0x3584fd];return _0x1e4991;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe11d('0x0'));var zipdir=require(_0xe11d('0x1'));var jsonpatch=require(_0xe11d('0x2'));var rp=require('request-promise');var moment=require(_0xe11d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe11d('0x4'));var util=require(_0xe11d('0x5'));var path=require(_0xe11d('0x6'));var sox=require(_0xe11d('0x7'));var csv=require(_0xe11d('0x8'));var ejs=require(_0xe11d('0x9'));var fs=require('fs');var fs_extra=require(_0xe11d('0xa'));var _=require(_0xe11d('0xb'));var squel=require(_0xe11d('0xc'));var crypto=require(_0xe11d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe11d('0xe'));var Papa=require(_0xe11d('0xf'));var Redis=require(_0xe11d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe11d('0x11'));var as=require(_0xe11d('0x12'));var hardwareService=require(_0xe11d('0x13'));var logger=require(_0xe11d('0x14'))(_0xe11d('0x15'));var utils=require('../../config/utils');var config=require(_0xe11d('0x16'));var licenseUtil=require(_0xe11d('0x17'));var db=require(_0xe11d('0x18'))['db'];function respondWithStatusCode(_0x3de21f,_0x202015){_0x202015=_0x202015||0xcc;return function(_0x5a004a){if(_0x5a004a){return _0x3de21f[_0xe11d('0x19')](_0x202015);}return _0x3de21f['status'](_0x202015)[_0xe11d('0x1a')]();};}function respondWithResult(_0x4acc6a,_0x143612){_0x143612=_0x143612||0xc8;return function(_0x70d6e7){if(_0x70d6e7){return _0x4acc6a[_0xe11d('0x1b')](_0x143612)['json'](_0x70d6e7);}};}function respondWithFilteredResult(_0x266a8d,_0x6d9911){return function(_0x2b1bd7){if(_0x2b1bd7){var _0x2587cd=typeof _0x6d9911[_0xe11d('0x1c')]===_0xe11d('0x1d')&&typeof _0x6d9911[_0xe11d('0x1e')]===_0xe11d('0x1d');var _0x1fed04=_0x2b1bd7['count'];var _0x3e9c10=_0x2587cd?0x0:_0x6d9911[_0xe11d('0x1c')];var _0x3e64dd=_0x2587cd?_0x2b1bd7[_0xe11d('0x1f')]:_0x6d9911[_0xe11d('0x1c')]+_0x6d9911[_0xe11d('0x1e')];var _0x5dfdfa;if(_0x3e64dd>=_0x1fed04){_0x3e64dd=_0x1fed04;_0x5dfdfa=0xc8;}else{_0x5dfdfa=0xce;}_0x266a8d['status'](_0x5dfdfa);return _0x266a8d[_0xe11d('0x20')](_0xe11d('0x21'),_0x3e9c10+'-'+_0x3e64dd+'/'+_0x1fed04)['json'](_0x2b1bd7);}return null;};}function patchUpdates(_0x2db1ee){return function(_0x4b8972){try{jsonpatch['apply'](_0x4b8972,_0x2db1ee,!![]);}catch(_0x233115){return BPromise['reject'](_0x233115);}return _0x4b8972[_0xe11d('0x22')]();};}function saveUpdates(_0x31f573,_0x4715e8){return function(_0xb7ac5a){if(_0xb7ac5a){return _0xb7ac5a[_0xe11d('0x23')](_0x31f573)[_0xe11d('0x24')](function(_0x47a59a){return _0x47a59a;});}return null;};}function removeEntity(_0x569844,_0x57774a){return function(_0x5b1e62){if(_0x5b1e62){return _0x5b1e62[_0xe11d('0x25')]()[_0xe11d('0x24')](function(){var _0x25a1dc=_0x5b1e62[_0xe11d('0x26')]({'plain':!![]});var _0x170e6d=_0xe11d('0x27');return db[_0xe11d('0x28')]['destroy']({'where':{'type':_0x170e6d,'resourceId':_0x25a1dc['id']}})[_0xe11d('0x24')](function(){return _0x5b1e62;});})[_0xe11d('0x24')](function(){_0x569844['status'](0xcc)[_0xe11d('0x1a')]();});}};}function handleEntityNotFound(_0x30c80c,_0x572f7c){return function(_0x567049){if(!_0x567049){_0x30c80c[_0xe11d('0x19')](0x194);}return _0x567049;};}function handleError(_0x570077,_0x4e976c){_0x4e976c=_0x4e976c||0x1f4;return function(_0x58f3e0){logger[_0xe11d('0x29')](_0x58f3e0[_0xe11d('0x2a')]);if(_0x58f3e0[_0xe11d('0x2b')]){delete _0x58f3e0[_0xe11d('0x2b')];}_0x570077[_0xe11d('0x1b')](_0x4e976c)[_0xe11d('0x2c')](_0x58f3e0);};}exports[_0xe11d('0x2d')]=function(_0x4f3fae,_0x2c9e27){var _0x36c5db={},_0x3c8329={},_0x5163fd={'count':0x0,'rows':[]};var _0x131631=_[_0xe11d('0x2e')](db[_0xe11d('0x2f')]['rawAttributes'],function(_0x4be38d){return{'name':_0x4be38d[_0xe11d('0x30')],'type':_0x4be38d[_0xe11d('0x31')]['key']};});_0x3c8329[_0xe11d('0x32')]=_[_0xe11d('0x2e')](_0x131631,_0xe11d('0x2b'));_0x3c8329[_0xe11d('0x33')]=_[_0xe11d('0x34')](_0x4f3fae[_0xe11d('0x33')]);_0x3c8329['filters']=_[_0xe11d('0x35')](_0x3c8329[_0xe11d('0x32')],_0x3c8329[_0xe11d('0x33')]);_0x36c5db['attributes']=_['intersection'](_0x3c8329[_0xe11d('0x32')],qs[_0xe11d('0x36')](_0x4f3fae[_0xe11d('0x33')][_0xe11d('0x36')]));_0x36c5db[_0xe11d('0x37')]=_0x36c5db[_0xe11d('0x37')][_0xe11d('0x38')]?_0x36c5db[_0xe11d('0x37')]:_0x3c8329[_0xe11d('0x32')];if(!_0x4f3fae[_0xe11d('0x33')][_0xe11d('0x39')](_0xe11d('0x3a'))){_0x36c5db[_0xe11d('0x1e')]=qs[_0xe11d('0x1e')](_0x4f3fae[_0xe11d('0x33')][_0xe11d('0x1e')]);_0x36c5db[_0xe11d('0x1c')]=qs[_0xe11d('0x1c')](_0x4f3fae['query'][_0xe11d('0x1c')]);}_0x36c5db[_0xe11d('0x3b')]=qs[_0xe11d('0x3c')](_0x4f3fae[_0xe11d('0x33')][_0xe11d('0x3c')]);_0x36c5db[_0xe11d('0x3d')]=qs[_0xe11d('0x3e')](_[_0xe11d('0x3f')](_0x4f3fae['query'],_0x3c8329['filters']),_0x131631);if(_0x4f3fae[_0xe11d('0x33')][_0xe11d('0x40')]){_0x36c5db[_0xe11d('0x3d')]=_[_0xe11d('0x41')](_0x36c5db[_0xe11d('0x3d')],{'$or':_[_0xe11d('0x2e')](_0x131631,function(_0x215910){if(_0x215910[_0xe11d('0x31')]!==_0xe11d('0x42')){var _0x326014={};_0x326014[_0x215910[_0xe11d('0x2b')]]={'$like':'%'+_0x4f3fae[_0xe11d('0x33')][_0xe11d('0x40')]+'%'};return _0x326014;}})});}_0x36c5db=_['merge']({},_0x36c5db,_0x4f3fae[_0xe11d('0x43')]);var _0xff8430={'where':_0x36c5db[_0xe11d('0x3d')]};return db[_0xe11d('0x2f')][_0xe11d('0x1f')](_0xff8430)[_0xe11d('0x24')](function(_0x1e65f6){_0x5163fd[_0xe11d('0x1f')]=_0x1e65f6;if(_0x4f3fae[_0xe11d('0x33')][_0xe11d('0x44')]){_0x36c5db[_0xe11d('0x45')]=[{'all':!![]}];}return db[_0xe11d('0x2f')][_0xe11d('0x46')](_0x36c5db);})['then'](function(_0x36782f){_0x5163fd[_0xe11d('0x47')]=_0x36782f;return _0x5163fd;})[_0xe11d('0x24')](respondWithFilteredResult(_0x2c9e27,_0x36c5db))[_0xe11d('0x48')](handleError(_0x2c9e27,null));};exports['show']=function(_0x89cf9e,_0x57affe){var _0x29508b={'raw':!![],'where':{'id':_0x89cf9e[_0xe11d('0x49')]['id']}},_0x5c3f74={};_0x5c3f74[_0xe11d('0x32')]=_[_0xe11d('0x34')](db[_0xe11d('0x2f')][_0xe11d('0x4a')]);_0x5c3f74[_0xe11d('0x33')]=_[_0xe11d('0x34')](_0x89cf9e[_0xe11d('0x33')]);_0x5c3f74[_0xe11d('0x3e')]=_['intersection'](_0x5c3f74[_0xe11d('0x32')],_0x5c3f74[_0xe11d('0x33')]);_0x29508b[_0xe11d('0x37')]=_[_0xe11d('0x35')](_0x5c3f74[_0xe11d('0x32')],qs[_0xe11d('0x36')](_0x89cf9e['query'][_0xe11d('0x36')]));_0x29508b['attributes']=_0x29508b[_0xe11d('0x37')]['length']?_0x29508b['attributes']:_0x5c3f74['model'];if(_0x89cf9e[_0xe11d('0x33')][_0xe11d('0x44')]){_0x29508b[_0xe11d('0x45')]=[{'all':!![]}];}_0x29508b=_['merge']({},_0x29508b,_0x89cf9e[_0xe11d('0x43')]);return db[_0xe11d('0x2f')][_0xe11d('0x4b')](_0x29508b)[_0xe11d('0x24')](handleEntityNotFound(_0x57affe,null))['then'](respondWithResult(_0x57affe,null))[_0xe11d('0x48')](handleError(_0x57affe,null));};exports['download']=function(_0x235a46,_0x5d0882,_0x4d5a71){return db[_0xe11d('0x2f')]['find']({'where':{'id':_0x235a46[_0xe11d('0x49')]['id']},'attributes':['name',_0xe11d('0x4c'),_0xe11d('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x5d0882,null))[_0xe11d('0x24')](function(_0x4502ff){if(_0x4502ff){if(!fs[_0xe11d('0x4e')](path[_0xe11d('0x4f')](config[_0xe11d('0x50')],'server/files/sounds/converted',_0x4502ff['save_name']+'.'+_0x4502ff['converted_format']))){throw new db[(_0xe11d('0x51'))]['ValidationError'](_0xe11d('0x52'));}return _0x5d0882[_0xe11d('0x53')](path[_0xe11d('0x4f')](config[_0xe11d('0x50')],_0xe11d('0x54'),util[_0xe11d('0x55')]('%s.%s',_0x4502ff['save_name'],_0x4502ff[_0xe11d('0x4d')])),util[_0xe11d('0x55')](_0xe11d('0x56'),_0x4502ff[_0xe11d('0x2b')],_0x4502ff[_0xe11d('0x4d')]));}return null;})[_0xe11d('0x48')](handleError(_0x5d0882,null));};exports[_0xe11d('0x57')]=function(_0x43b405,_0x66189b,_0x5b4ba0){var _0x3d1aeb={'name':path[_0xe11d('0x58')](_0x43b405[_0xe11d('0x59')][_0xe11d('0x5a')],path[_0xe11d('0x5b')](_0x43b405[_0xe11d('0x59')][_0xe11d('0x5a')])),'save_name':path[_0xe11d('0x58')](_0x43b405[_0xe11d('0x59')][_0xe11d('0x5c')],path[_0xe11d('0x5b')](_0x43b405['file']['filename'])),'original_format':path['extname'](_0x43b405['file'][_0xe11d('0x5a')])['substring'](0x1),'converted_format':_0xe11d('0x5d')};var _0x228bd8=path[_0xe11d('0x4f')](config['root'],'server/files/sounds/original',_0x43b405[_0xe11d('0x59')][_0xe11d('0x5c')]);var _0x13cbbc=path[_0xe11d('0x4f')](config['root'],_0xe11d('0x54'),util[_0xe11d('0x55')](_0xe11d('0x56'),path['basename'](_0x43b405[_0xe11d('0x59')][_0xe11d('0x5c')],path[_0xe11d('0x5b')](_0x43b405[_0xe11d('0x59')][_0xe11d('0x5c')])),_0x3d1aeb[_0xe11d('0x4d')]));logger[_0xe11d('0x5e')](_0xe11d('0x5f'),_0x228bd8);logger['info'](_0xe11d('0x60'),_0x13cbbc);try{fs[_0xe11d('0x61')](_0x228bd8,parseInt(_0xe11d('0x62'),0x8));var _0xf0c2b4=sox[_0xe11d('0x63')](_0x228bd8,_0x13cbbc,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xf0c2b4['on'](_0xe11d('0x29'),function(_0x215d48){fs[_0xe11d('0x64')](_0x228bd8);_0x66189b['status'](0x1f4)[_0xe11d('0x2c')](_0x215d48);});_0xf0c2b4['on']('src',function(_0x47b46b){_0x3d1aeb['original_duration']=isNaN(_0x47b46b[_0xe11d('0x65')])?null:_0x47b46b[_0xe11d('0x65')]*0x3e8;_0x3d1aeb[_0xe11d('0x66')]=isNaN(_0x47b46b[_0xe11d('0x67')])?null:_0x47b46b[_0xe11d('0x67')];_0x3d1aeb[_0xe11d('0x68')]=isNaN(_0x47b46b[_0xe11d('0x69')])?null:_0x47b46b[_0xe11d('0x69')];_0x3d1aeb[_0xe11d('0x6a')]=isNaN(_0x47b46b['bitRate'])?null:_0x47b46b[_0xe11d('0x6b')];_0x3d1aeb[_0xe11d('0x6c')]=isNaN(_0x47b46b[_0xe11d('0x6d')])?null:_0x47b46b['sampleRate'];});_0xf0c2b4['on'](_0xe11d('0x6e'),function(_0xc0dbc2){_0x3d1aeb['converted_duration']=isNaN(_0xc0dbc2[_0xe11d('0x65')])?null:_0xc0dbc2[_0xe11d('0x65')]*0x3e8;_0x3d1aeb['converted_sampleCount']=isNaN(_0xc0dbc2['sampleCount'])?null:_0xc0dbc2[_0xe11d('0x67')];_0x3d1aeb[_0xe11d('0x6f')]=isNaN(_0xc0dbc2[_0xe11d('0x69')])?null:_0xc0dbc2['channelCount'];_0x3d1aeb['converted_bitRate']=isNaN(_0xc0dbc2['bitRate'])?null:_0xc0dbc2[_0xe11d('0x6b')];_0x3d1aeb[_0xe11d('0x70')]=isNaN(_0xc0dbc2[_0xe11d('0x6d')])?null:_0xc0dbc2[_0xe11d('0x6d')];});_0xf0c2b4['on'](_0xe11d('0x1a'),function(){fs[_0xe11d('0x61')](_0x13cbbc,parseInt(_0xe11d('0x62'),0x8));return db['Sound'][_0xe11d('0x57')](_0x3d1aeb)[_0xe11d('0x24')](function(_0x3d0bf3){var _0x27e607={'role':_0x43b405[_0xe11d('0x71')][_0xe11d('0x72')],'userProfileId':_0x43b405[_0xe11d('0x71')][_0xe11d('0x73')]};if(!_0x27e607)throw new Error(_0xe11d('0x74'));if(_0x27e607[_0xe11d('0x72')]===_0xe11d('0x75')){var _0x1684a2=_0x3d0bf3[_0xe11d('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xe11d('0x4b')]({'where':{'name':_0xe11d('0x27'),'userProfileId':_0x27e607['userProfileId']},'raw':!![]})[_0xe11d('0x24')](function(_0xe1afc8){if(_0xe1afc8&&_0xe1afc8[_0xe11d('0x76')]===0x0){return db[_0xe11d('0x28')]['create']({'name':_0x1684a2[_0xe11d('0x2b')],'resourceId':_0x1684a2['id'],'type':_0xe1afc8[_0xe11d('0x2b')],'sectionId':_0xe1afc8['id']},{})['then'](function(){return _0x3d0bf3;});}else{return _0x3d0bf3;}})[_0xe11d('0x48')](function(_0x43f2a2){logger[_0xe11d('0x29')](_0xe11d('0x77'),_0x43f2a2);throw _0x43f2a2;});}return _0x3d0bf3;})[_0xe11d('0x24')](respondWithResult(_0x66189b,null))[_0xe11d('0x48')](handleError(_0x66189b,null));});_0xf0c2b4[_0xe11d('0x78')]();}catch(_0x410930){_0x66189b['status'](0x1f4)['send'](_0x410930);}};exports[_0xe11d('0x23')]=function(_0x50b41d,_0x2e2c81,_0x31ae24){return db[_0xe11d('0x2f')]['find']({'where':{'id':_0x50b41d[_0xe11d('0x49')]['id']}})[_0xe11d('0x24')](handleEntityNotFound(_0x2e2c81,null))[_0xe11d('0x24')](saveUpdates(_[_0xe11d('0x3f')](_0x50b41d[_0xe11d('0x71')],[_0xe11d('0x2b'),_0xe11d('0x79')]),null))[_0xe11d('0x24')](respondWithResult(_0x2e2c81,null))[_0xe11d('0x48')](handleError(_0x2e2c81,null));};exports[_0xe11d('0x7a')]=function(_0x40b2ca,_0x1d8548,_0x2724cc){return db[_0xe11d('0x2f')]['find']({'where':{'id':_0x40b2ca[_0xe11d('0x49')]['id']}})[_0xe11d('0x24')](function(_0x2796e5){if(_0x2796e5){return _0x2796e5[_0xe11d('0x25')]();}})['then'](function(_0x121dd0){var _0x35c90c=path['join'](config[_0xe11d('0x50')],'server/files/sounds/original',util[_0xe11d('0x55')]('%s.%s',_0x121dd0[_0xe11d('0x4c')],_0x121dd0[_0xe11d('0x7b')]));var _0x4f8040=path[_0xe11d('0x4f')](config[_0xe11d('0x50')],_0xe11d('0x54'),util[_0xe11d('0x55')](_0xe11d('0x56'),_0x121dd0['save_name'],_0x121dd0[_0xe11d('0x4d')]));fs[_0xe11d('0x64')](_0x35c90c);fs[_0xe11d('0x64')](_0x4f8040);return _0x121dd0;})['then'](function(_0x546150){if(_0x546150){return _0x1d8548[_0xe11d('0x1b')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x1d8548,null))[_0xe11d('0x48')](handleError(_0x1d8548,null));}; \ No newline at end of file +var _0xcc23=['converted_sampleCount','converted_channelCount','converted_sampleRate','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','include','Sound','rows','show','includeAll','find','catch','params','save_name','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','converted_format','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','converted_duration'];(function(_0x2d011d,_0x1e8212){var _0x4f2cc8=function(_0x54e4ef){while(--_0x54e4ef){_0x2d011d['push'](_0x2d011d['shift']());}};_0x4f2cc8(++_0x1e8212);}(_0xcc23,0x104));var _0x3cc2=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xcc23[_0x47e549];return _0x251374;};'use strict';var emlformat=require(_0x3cc2('0x0'));var rimraf=require(_0x3cc2('0x1'));var zipdir=require(_0x3cc2('0x2'));var jsonpatch=require(_0x3cc2('0x3'));var rp=require('request-promise');var moment=require(_0x3cc2('0x4'));var BPromise=require(_0x3cc2('0x5'));var Mustache=require(_0x3cc2('0x6'));var util=require('util');var path=require(_0x3cc2('0x7'));var sox=require(_0x3cc2('0x8'));var csv=require(_0x3cc2('0x9'));var ejs=require(_0x3cc2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3cc2('0xb'));var crypto=require(_0x3cc2('0xc'));var jsforce=require(_0x3cc2('0xd'));var deskjs=require(_0x3cc2('0xe'));var toCsv=require(_0x3cc2('0x9'));var querystring=require(_0x3cc2('0xf'));var Papa=require(_0x3cc2('0x10'));var Redis=require(_0x3cc2('0x11'));var authService=require(_0x3cc2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3cc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cc2('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3cc2('0x15'));var db=require(_0x3cc2('0x16'))['db'];function respondWithStatusCode(_0x3cd7c7,_0x4de6d0){_0x4de6d0=_0x4de6d0||0xcc;return function(_0x32e11e){if(_0x32e11e){return _0x3cd7c7[_0x3cc2('0x17')](_0x4de6d0);}return _0x3cd7c7['status'](_0x4de6d0)[_0x3cc2('0x18')]();};}function respondWithResult(_0x56e848,_0x123747){_0x123747=_0x123747||0xc8;return function(_0x43f48b){if(_0x43f48b){return _0x56e848[_0x3cc2('0x19')](_0x123747)[_0x3cc2('0x1a')](_0x43f48b);}};}function respondWithFilteredResult(_0xc4d38a,_0x4e2074){return function(_0x7bebc4){if(_0x7bebc4){var _0x501b11=typeof _0x4e2074['offset']===_0x3cc2('0x1b')&&typeof _0x4e2074[_0x3cc2('0x1c')]===_0x3cc2('0x1b');var _0x2bda2b=_0x7bebc4['count'];var _0x2b483a=_0x501b11?0x0:_0x4e2074[_0x3cc2('0x1d')];var _0xdf79eb=_0x501b11?_0x7bebc4[_0x3cc2('0x1e')]:_0x4e2074[_0x3cc2('0x1d')]+_0x4e2074[_0x3cc2('0x1c')];var _0x17c4f2;if(_0xdf79eb>=_0x2bda2b){_0xdf79eb=_0x2bda2b;_0x17c4f2=0xc8;}else{_0x17c4f2=0xce;}_0xc4d38a[_0x3cc2('0x19')](_0x17c4f2);return _0xc4d38a[_0x3cc2('0x1f')](_0x3cc2('0x20'),_0x2b483a+'-'+_0xdf79eb+'/'+_0x2bda2b)[_0x3cc2('0x1a')](_0x7bebc4);}return null;};}function patchUpdates(_0x78ba2e){return function(_0x40c6d6){try{jsonpatch[_0x3cc2('0x21')](_0x40c6d6,_0x78ba2e,!![]);}catch(_0x34d797){return BPromise[_0x3cc2('0x22')](_0x34d797);}return _0x40c6d6[_0x3cc2('0x23')]();};}function saveUpdates(_0x107c94,_0x3a4b32){return function(_0x4263ec){if(_0x4263ec){return _0x4263ec[_0x3cc2('0x24')](_0x107c94)['then'](function(_0x408cc8){return _0x408cc8;});}return null;};}function removeEntity(_0x4dad9e,_0x308c5e){return function(_0xd67dad){if(_0xd67dad){return _0xd67dad[_0x3cc2('0x25')]()[_0x3cc2('0x26')](function(){var _0x5e0043=_0xd67dad[_0x3cc2('0x27')]({'plain':!![]});var _0x2ff30a=_0x3cc2('0x28');return db['UserProfileResource'][_0x3cc2('0x25')]({'where':{'type':_0x2ff30a,'resourceId':_0x5e0043['id']}})[_0x3cc2('0x26')](function(){return _0xd67dad;});})[_0x3cc2('0x26')](function(){_0x4dad9e[_0x3cc2('0x19')](0xcc)[_0x3cc2('0x18')]();});}};}function handleEntityNotFound(_0x4921f3,_0x2fd9ce){return function(_0x377688){if(!_0x377688){_0x4921f3[_0x3cc2('0x17')](0x194);}return _0x377688;};}function handleError(_0x41c619,_0x574bf4){_0x574bf4=_0x574bf4||0x1f4;return function(_0x4c68c6){logger['error'](_0x4c68c6['stack']);if(_0x4c68c6[_0x3cc2('0x29')]){delete _0x4c68c6[_0x3cc2('0x29')];}_0x41c619[_0x3cc2('0x19')](_0x574bf4)[_0x3cc2('0x2a')](_0x4c68c6);};}exports[_0x3cc2('0x2b')]=function(_0xf608d1,_0x21b6aa){var _0x45af81={},_0xe31007={},_0x27e158={'count':0x0,'rows':[]};var _0x5df51e=_['map'](db['Sound'][_0x3cc2('0x2c')],function(_0x53abab){return{'name':_0x53abab[_0x3cc2('0x2d')],'type':_0x53abab[_0x3cc2('0x2e')]['key']};});_0xe31007[_0x3cc2('0x2f')]=_[_0x3cc2('0x30')](_0x5df51e,_0x3cc2('0x29'));_0xe31007[_0x3cc2('0x31')]=_[_0x3cc2('0x32')](_0xf608d1['query']);_0xe31007[_0x3cc2('0x33')]=_[_0x3cc2('0x34')](_0xe31007['model'],_0xe31007[_0x3cc2('0x31')]);_0x45af81[_0x3cc2('0x35')]=_[_0x3cc2('0x34')](_0xe31007[_0x3cc2('0x2f')],qs[_0x3cc2('0x36')](_0xf608d1[_0x3cc2('0x31')][_0x3cc2('0x36')]));_0x45af81[_0x3cc2('0x35')]=_0x45af81[_0x3cc2('0x35')][_0x3cc2('0x37')]?_0x45af81['attributes']:_0xe31007[_0x3cc2('0x2f')];if(!_0xf608d1[_0x3cc2('0x31')][_0x3cc2('0x38')](_0x3cc2('0x39'))){_0x45af81[_0x3cc2('0x1c')]=qs[_0x3cc2('0x1c')](_0xf608d1[_0x3cc2('0x31')][_0x3cc2('0x1c')]);_0x45af81[_0x3cc2('0x1d')]=qs[_0x3cc2('0x1d')](_0xf608d1[_0x3cc2('0x31')][_0x3cc2('0x1d')]);}_0x45af81[_0x3cc2('0x3a')]=qs[_0x3cc2('0x3b')](_0xf608d1[_0x3cc2('0x31')][_0x3cc2('0x3b')]);_0x45af81['where']=qs[_0x3cc2('0x33')](_[_0x3cc2('0x3c')](_0xf608d1['query'],_0xe31007[_0x3cc2('0x33')]),_0x5df51e);if(_0xf608d1[_0x3cc2('0x31')]['filter']){_0x45af81[_0x3cc2('0x3d')]=_['merge'](_0x45af81[_0x3cc2('0x3d')],{'$or':_['map'](_0x5df51e,function(_0x2dc582){if(_0x2dc582[_0x3cc2('0x2e')]!==_0x3cc2('0x3e')){var _0x3aa10e={};_0x3aa10e[_0x2dc582[_0x3cc2('0x29')]]={'$like':'%'+_0xf608d1[_0x3cc2('0x31')]['filter']+'%'};return _0x3aa10e;}})});}_0x45af81=_[_0x3cc2('0x3f')]({},_0x45af81,_0xf608d1[_0x3cc2('0x40')]);var _0x35894e={'where':_0x45af81[_0x3cc2('0x3d')]};return db['Sound']['count'](_0x35894e)['then'](function(_0xcc19a){_0x27e158[_0x3cc2('0x1e')]=_0xcc19a;if(_0xf608d1[_0x3cc2('0x31')]['includeAll']){_0x45af81[_0x3cc2('0x41')]=[{'all':!![]}];}return db[_0x3cc2('0x42')]['findAll'](_0x45af81);})[_0x3cc2('0x26')](function(_0xa57f79){_0x27e158[_0x3cc2('0x43')]=_0xa57f79;return _0x27e158;})[_0x3cc2('0x26')](respondWithFilteredResult(_0x21b6aa,_0x45af81))['catch'](handleError(_0x21b6aa,null));};exports[_0x3cc2('0x44')]=function(_0xde37d2,_0x315078){var _0xe249dd={'raw':!![],'where':{'id':_0xde37d2['params']['id']}},_0x5e200a={};_0x5e200a[_0x3cc2('0x2f')]=_[_0x3cc2('0x32')](db[_0x3cc2('0x42')]['rawAttributes']);_0x5e200a[_0x3cc2('0x31')]=_['keys'](_0xde37d2[_0x3cc2('0x31')]);_0x5e200a['filters']=_[_0x3cc2('0x34')](_0x5e200a['model'],_0x5e200a[_0x3cc2('0x31')]);_0xe249dd['attributes']=_['intersection'](_0x5e200a[_0x3cc2('0x2f')],qs[_0x3cc2('0x36')](_0xde37d2['query'][_0x3cc2('0x36')]));_0xe249dd['attributes']=_0xe249dd[_0x3cc2('0x35')][_0x3cc2('0x37')]?_0xe249dd[_0x3cc2('0x35')]:_0x5e200a['model'];if(_0xde37d2[_0x3cc2('0x31')][_0x3cc2('0x45')]){_0xe249dd[_0x3cc2('0x41')]=[{'all':!![]}];}_0xe249dd=_[_0x3cc2('0x3f')]({},_0xe249dd,_0xde37d2['options']);return db[_0x3cc2('0x42')][_0x3cc2('0x46')](_0xe249dd)[_0x3cc2('0x26')](handleEntityNotFound(_0x315078,null))[_0x3cc2('0x26')](respondWithResult(_0x315078,null))[_0x3cc2('0x47')](handleError(_0x315078,null));};exports['download']=function(_0x578c65,_0xee6065,_0x43ecc4){return db['Sound'][_0x3cc2('0x46')]({'where':{'id':_0x578c65[_0x3cc2('0x48')]['id']},'attributes':[_0x3cc2('0x29'),_0x3cc2('0x49'),'converted_format'],'raw':!![]})[_0x3cc2('0x26')](handleEntityNotFound(_0xee6065,null))[_0x3cc2('0x26')](function(_0x19b6be){if(_0x19b6be){if(!fs[_0x3cc2('0x4a')](path[_0x3cc2('0x4b')](config[_0x3cc2('0x4c')],_0x3cc2('0x4d'),_0x19b6be[_0x3cc2('0x49')]+'.'+_0x19b6be['converted_format']))){throw new db[(_0x3cc2('0x4e'))][(_0x3cc2('0x4f'))](_0x3cc2('0x50'));}return _0xee6065['download'](path[_0x3cc2('0x4b')](config['root'],'server/files/sounds/converted',util[_0x3cc2('0x51')]('%s.%s',_0x19b6be[_0x3cc2('0x49')],_0x19b6be[_0x3cc2('0x52')])),util[_0x3cc2('0x51')]('%s.%s',_0x19b6be[_0x3cc2('0x29')],_0x19b6be[_0x3cc2('0x52')]));}return null;})[_0x3cc2('0x47')](handleError(_0xee6065,null));};exports['create']=function(_0xb214c3,_0x26f993,_0x50630e){var _0x1ce357={'name':path['basename'](_0xb214c3[_0x3cc2('0x53')][_0x3cc2('0x54')],path[_0x3cc2('0x55')](_0xb214c3['file']['originalname'])),'save_name':path[_0x3cc2('0x56')](_0xb214c3[_0x3cc2('0x53')][_0x3cc2('0x57')],path[_0x3cc2('0x55')](_0xb214c3[_0x3cc2('0x53')]['filename'])),'original_format':path[_0x3cc2('0x55')](_0xb214c3['file'][_0x3cc2('0x54')])[_0x3cc2('0x58')](0x1),'converted_format':_0x3cc2('0x59')};var _0x6a81df=path['join'](config[_0x3cc2('0x4c')],_0x3cc2('0x5a'),_0xb214c3[_0x3cc2('0x53')][_0x3cc2('0x57')]);var _0x2e6508=path[_0x3cc2('0x4b')](config['root'],'server/files/sounds/converted',util[_0x3cc2('0x51')](_0x3cc2('0x5b'),path[_0x3cc2('0x56')](_0xb214c3[_0x3cc2('0x53')][_0x3cc2('0x57')],path['extname'](_0xb214c3[_0x3cc2('0x53')][_0x3cc2('0x57')])),_0x1ce357[_0x3cc2('0x52')]));logger[_0x3cc2('0x5c')](_0x3cc2('0x5d'),_0x6a81df);logger[_0x3cc2('0x5c')](_0x3cc2('0x5e'),_0x2e6508);try{fs[_0x3cc2('0x5f')](_0x6a81df,parseInt(_0x3cc2('0x60'),0x8));var _0x29ad0b=sox['transcode'](_0x6a81df,_0x2e6508,{'sampleRate':0x1f40,'format':_0x3cc2('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x29ad0b['on']('error',function(_0x57d8d3){fs['unlinkSync'](_0x6a81df);_0x26f993[_0x3cc2('0x19')](0x1f4)[_0x3cc2('0x2a')](_0x57d8d3);});_0x29ad0b['on']('src',function(_0x6f05b6){_0x1ce357[_0x3cc2('0x61')]=isNaN(_0x6f05b6['duration'])?null:_0x6f05b6[_0x3cc2('0x62')]*0x3e8;_0x1ce357[_0x3cc2('0x63')]=isNaN(_0x6f05b6[_0x3cc2('0x64')])?null:_0x6f05b6[_0x3cc2('0x64')];_0x1ce357['original_channelCount']=isNaN(_0x6f05b6[_0x3cc2('0x65')])?null:_0x6f05b6[_0x3cc2('0x65')];_0x1ce357[_0x3cc2('0x66')]=isNaN(_0x6f05b6[_0x3cc2('0x67')])?null:_0x6f05b6[_0x3cc2('0x67')];_0x1ce357['original_sampleRate']=isNaN(_0x6f05b6[_0x3cc2('0x68')])?null:_0x6f05b6[_0x3cc2('0x68')];});_0x29ad0b['on']('dest',function(_0x3e1dc4){_0x1ce357[_0x3cc2('0x69')]=isNaN(_0x3e1dc4['duration'])?null:_0x3e1dc4[_0x3cc2('0x62')]*0x3e8;_0x1ce357[_0x3cc2('0x6a')]=isNaN(_0x3e1dc4[_0x3cc2('0x64')])?null:_0x3e1dc4['sampleCount'];_0x1ce357[_0x3cc2('0x6b')]=isNaN(_0x3e1dc4[_0x3cc2('0x65')])?null:_0x3e1dc4[_0x3cc2('0x65')];_0x1ce357['converted_bitRate']=isNaN(_0x3e1dc4['bitRate'])?null:_0x3e1dc4[_0x3cc2('0x67')];_0x1ce357[_0x3cc2('0x6c')]=isNaN(_0x3e1dc4[_0x3cc2('0x68')])?null:_0x3e1dc4[_0x3cc2('0x68')];});_0x29ad0b['on'](_0x3cc2('0x18'),function(){fs['chmodSync'](_0x2e6508,parseInt('0777',0x8));return db[_0x3cc2('0x42')][_0x3cc2('0x6d')](_0x1ce357)[_0x3cc2('0x26')](function(_0x37f093){var _0x46cc54={'role':_0xb214c3['body'][_0x3cc2('0x6e')],'userProfileId':_0xb214c3[_0x3cc2('0x6f')][_0x3cc2('0x70')]};if(!_0x46cc54)throw new Error(_0x3cc2('0x71'));if(_0x46cc54[_0x3cc2('0x6e')]===_0x3cc2('0x72')){var _0x219e96=_0x37f093['get']({'plain':!![]});return db[_0x3cc2('0x73')][_0x3cc2('0x46')]({'where':{'name':_0x3cc2('0x28'),'userProfileId':_0x46cc54[_0x3cc2('0x70')]},'raw':!![]})[_0x3cc2('0x26')](function(_0x2ab559){if(_0x2ab559&&_0x2ab559[_0x3cc2('0x74')]===0x0){return db['UserProfileResource'][_0x3cc2('0x6d')]({'name':_0x219e96[_0x3cc2('0x29')],'resourceId':_0x219e96['id'],'type':_0x2ab559[_0x3cc2('0x29')],'sectionId':_0x2ab559['id']},{})[_0x3cc2('0x26')](function(){return _0x37f093;});}else{return _0x37f093;}})['catch'](function(_0x3d2d20){logger[_0x3cc2('0x75')](_0x3cc2('0x76'),_0x3d2d20);throw _0x3d2d20;});}return _0x37f093;})['then'](respondWithResult(_0x26f993,null))[_0x3cc2('0x47')](handleError(_0x26f993,null));});_0x29ad0b[_0x3cc2('0x77')]();}catch(_0x290d10){_0x26f993[_0x3cc2('0x19')](0x1f4)[_0x3cc2('0x2a')](_0x290d10);}};exports['update']=function(_0x49b277,_0x76ff18,_0x4e6cf1){return db['Sound'][_0x3cc2('0x46')]({'where':{'id':_0x49b277[_0x3cc2('0x48')]['id']}})[_0x3cc2('0x26')](handleEntityNotFound(_0x76ff18,null))[_0x3cc2('0x26')](saveUpdates(_[_0x3cc2('0x3c')](_0x49b277[_0x3cc2('0x6f')],[_0x3cc2('0x29'),'description']),null))[_0x3cc2('0x26')](respondWithResult(_0x76ff18,null))[_0x3cc2('0x47')](handleError(_0x76ff18,null));};exports[_0x3cc2('0x78')]=function(_0x190a0e,_0x3d4b8b,_0xacf93d){return db[_0x3cc2('0x42')][_0x3cc2('0x46')]({'where':{'id':_0x190a0e['params']['id']}})['then'](function(_0x36a535){if(_0x36a535){return _0x36a535['destroy']();}})[_0x3cc2('0x26')](function(_0x5dde40){var _0x23b5a3=path[_0x3cc2('0x4b')](config[_0x3cc2('0x4c')],'server/files/sounds/original',util[_0x3cc2('0x51')]('%s.%s',_0x5dde40['save_name'],_0x5dde40['original_format']));var _0x1d3b5e=path[_0x3cc2('0x4b')](config[_0x3cc2('0x4c')],_0x3cc2('0x4d'),util[_0x3cc2('0x51')](_0x3cc2('0x5b'),_0x5dde40[_0x3cc2('0x49')],_0x5dde40[_0x3cc2('0x52')]));fs[_0x3cc2('0x79')](_0x23b5a3);fs[_0x3cc2('0x79')](_0x1d3b5e);return _0x5dde40;})['then'](function(_0x4595ba){if(_0x4595ba){return _0x3d4b8b['status'](0xcc)[_0x3cc2('0x18')]();}})[_0x3cc2('0x26')](handleEntityNotFound(_0x3d4b8b,null))[_0x3cc2('0x47')](handleError(_0x3d4b8b,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 7e776c8..132f671 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 _0xe449=['api','bluebird','path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds','lodash','../../config/logger'];(function(_0xea127,_0x4d5954){var _0xcb8954=function(_0x44f1a0){while(--_0x44f1a0){_0xea127['push'](_0xea127['shift']());}};_0xcb8954(++_0x4d5954);}(_0xe449,0xbc));var _0x9e44=function(_0x1990e7,_0x179602){_0x1990e7=_0x1990e7-0x0;var _0x3a9c46=_0xe449[_0x1990e7];return _0x3a9c46;};'use strict';var _=require(_0x9e44('0x0'));var util=require('util');var logger=require(_0x9e44('0x1'))(_0x9e44('0x2'));var moment=require('moment');var BPromise=require(_0x9e44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e44('0x4'));var rimraf=require(_0x9e44('0x5'));var config=require(_0x9e44('0x6'));var attributes=require(_0x9e44('0x7'));module['exports']=function(_0x4c7b26,_0x1c142f){return _0x4c7b26['define'](_0x9e44('0x8'),attributes,{'tableName':_0x9e44('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd264=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xd264,0x1a4));var _0x4d26=function(_0x1195ff,_0x186e7e){_0x1195ff=_0x1195ff-0x0;var _0x513623=_0xd264[_0x1195ff];return _0x513623;};'use strict';var _=require('lodash');var util=require(_0x4d26('0x0'));var logger=require(_0x4d26('0x1'))(_0x4d26('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4d26('0x3'));var fs=require('fs');var path=require(_0x4d26('0x4'));var rimraf=require(_0x4d26('0x5'));var config=require(_0x4d26('0x6'));var attributes=require(_0x4d26('0x7'));module['exports']=function(_0x48ebc0,_0xd2d2ed){return _0x48ebc0[_0x4d26('0x8')](_0x4d26('0x9'),attributes,{'tableName':'tools_sounds','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 8fd5318..0debb50 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 _0x1610=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','options','raw','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x14175e,_0xc48ce2){var _0x3d57e7=function(_0x55cd19){while(--_0x55cd19){_0x14175e['push'](_0x14175e['shift']());}};_0x3d57e7(++_0xc48ce2);}(_0x1610,0x1bd));var _0x0161=function(_0x3d831f,_0x4db88f){_0x3d831f=_0x3d831f-0x0;var _0x13f4e7=_0x1610[_0x3d831f];return _0x13f4e7;};'use strict';var _=require(_0x0161('0x0'));var util=require('util');var moment=require(_0x0161('0x1'));var BPromise=require(_0x0161('0x2'));var rs=require(_0x0161('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0161('0x4'));var logger=require(_0x0161('0x5'))(_0x0161('0x6'));var config=require(_0x0161('0x7'));var jayson=require(_0x0161('0x8'));var client=jayson[_0x0161('0x9')][_0x0161('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446757,_0x134bae,_0x2e44bd){return new BPromise(function(_0x2e019d,_0xeda69c){return client['request'](_0x446757,_0x2e44bd)['then'](function(_0x454f60){logger[_0x0161('0xb')](_0x0161('0xc'),_0x134bae,'request\x20sent');logger[_0x0161('0xd')](_0x0161('0xe'),_0x134bae,_0x0161('0xf'),JSON[_0x0161('0x10')](_0x454f60));if(_0x454f60['error']){if(_0x454f60[_0x0161('0x11')][_0x0161('0x12')]===0x1f4){logger[_0x0161('0x11')](_0x0161('0xc'),_0x134bae,_0x454f60[_0x0161('0x11')][_0x0161('0x13')]);return _0xeda69c(_0x454f60[_0x0161('0x11')][_0x0161('0x13')]);}logger[_0x0161('0x11')]('Sound,\x20%s,\x20%s',_0x134bae,_0x454f60[_0x0161('0x11')][_0x0161('0x13')]);return _0x2e019d(_0x454f60['error'][_0x0161('0x13')]);}else{logger[_0x0161('0xb')](_0x0161('0xc'),_0x134bae,_0x0161('0xf'));_0x2e019d(_0x454f60[_0x0161('0x14')]['message']);}})[_0x0161('0x15')](function(_0x28104d){logger['error'](_0x0161('0xc'),_0x134bae,_0x28104d);_0xeda69c(_0x28104d);});});}exports[_0x0161('0x16')]=function(_0x4afb70){var _0x7f6629=this;return new Promise(function(_0x137d23,_0x32a8a7){return db['Sound']['find']({'raw':_0x4afb70[_0x0161('0x17')]?_0x4afb70['options'][_0x0161('0x18')]===undefined?!![]:![]:!![],'where':_0x4afb70[_0x0161('0x17')]?_0x4afb70[_0x0161('0x17')]['where']||null:null,'attributes':_0x4afb70[_0x0161('0x17')]?_0x4afb70[_0x0161('0x17')][_0x0161('0x19')]||null:null,'include':_0x4afb70['options']?_0x4afb70['options'][_0x0161('0x1a')]?_[_0x0161('0x1b')](_0x4afb70[_0x0161('0x17')][_0x0161('0x1a')],function(_0x4950a6){return{'model':db[_0x4950a6[_0x0161('0x1c')]],'as':_0x4950a6['as'],'attributes':_0x4950a6[_0x0161('0x19')],'include':_0x4950a6[_0x0161('0x1a')]?_[_0x0161('0x1b')](_0x4950a6['include'],function(_0x16b74c){return{'model':db[_0x16b74c['model']],'as':_0x16b74c['as'],'attributes':_0x16b74c[_0x0161('0x19')],'include':_0x16b74c['include']?_['map'](_0x16b74c[_0x0161('0x1a')],function(_0xff373a){return{'model':db[_0xff373a[_0x0161('0x1c')]],'as':_0xff373a['as'],'attributes':_0xff373a[_0x0161('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0161('0x1d')](function(_0x4eeb9c){logger['info'](_0x0161('0x16'),_0x4afb70);logger['debug']('ShowSound',_0x4afb70,JSON[_0x0161('0x10')](_0x4eeb9c));_0x137d23(_0x4eeb9c);})[_0x0161('0x15')](function(_0x90400f){logger[_0x0161('0x11')]('ShowSound',_0x90400f['message'],_0x4afb70);_0x32a8a7(_0x7f6629[_0x0161('0x11')](0x1f4,_0x90400f[_0x0161('0x13')]));});});}; \ No newline at end of file +var _0x9381=['request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Sound,\x20%s,\x20%s','result','catch','ShowSound','Sound','find','raw','options','where','attributes','include','map','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x9381,0x7a));var _0x1938=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x9381[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0x1938('0x0'));var util=require('util');var moment=require(_0x1938('0x1'));var BPromise=require(_0x1938('0x2'));var rs=require(_0x1938('0x3'));var fs=require('fs');var Redis=require(_0x1938('0x4'));var db=require(_0x1938('0x5'))['db'];var utils=require(_0x1938('0x6'));var logger=require(_0x1938('0x7'))('rpc');var config=require(_0x1938('0x8'));var jayson=require(_0x1938('0x9'));var client=jayson['client'][_0x1938('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xace7a1,_0xc6b603,_0x25e759){return new BPromise(function(_0x10eaaf,_0x1a7e20){return client[_0x1938('0xb')](_0xace7a1,_0x25e759)[_0x1938('0xc')](function(_0x513393){logger[_0x1938('0xd')]('Sound,\x20%s,\x20%s',_0xc6b603,_0x1938('0xe'));logger['debug'](_0x1938('0xf'),_0xc6b603,_0x1938('0xe'),JSON[_0x1938('0x10')](_0x513393));if(_0x513393[_0x1938('0x11')]){if(_0x513393[_0x1938('0x11')][_0x1938('0x12')]===0x1f4){logger[_0x1938('0x11')]('Sound,\x20%s,\x20%s',_0xc6b603,_0x513393[_0x1938('0x11')][_0x1938('0x13')]);return _0x1a7e20(_0x513393['error'][_0x1938('0x13')]);}logger['error'](_0x1938('0x14'),_0xc6b603,_0x513393['error'][_0x1938('0x13')]);return _0x10eaaf(_0x513393['error']['message']);}else{logger[_0x1938('0xd')](_0x1938('0x14'),_0xc6b603,_0x1938('0xe'));_0x10eaaf(_0x513393[_0x1938('0x15')][_0x1938('0x13')]);}})[_0x1938('0x16')](function(_0x4e1e5f){logger['error'](_0x1938('0x14'),_0xc6b603,_0x4e1e5f);_0x1a7e20(_0x4e1e5f);});});}exports[_0x1938('0x17')]=function(_0x188654){var _0x10fb30=this;return new Promise(function(_0x1d5172,_0x576f53){return db[_0x1938('0x18')][_0x1938('0x19')]({'raw':_0x188654['options']?_0x188654['options'][_0x1938('0x1a')]===undefined?!![]:![]:!![],'where':_0x188654[_0x1938('0x1b')]?_0x188654['options'][_0x1938('0x1c')]||null:null,'attributes':_0x188654[_0x1938('0x1b')]?_0x188654[_0x1938('0x1b')][_0x1938('0x1d')]||null:null,'include':_0x188654[_0x1938('0x1b')]?_0x188654[_0x1938('0x1b')][_0x1938('0x1e')]?_[_0x1938('0x1f')](_0x188654['options'][_0x1938('0x1e')],function(_0x4a9698){return{'model':db[_0x4a9698[_0x1938('0x20')]],'as':_0x4a9698['as'],'attributes':_0x4a9698['attributes'],'include':_0x4a9698[_0x1938('0x1e')]?_['map'](_0x4a9698[_0x1938('0x1e')],function(_0x9a0f99){return{'model':db[_0x9a0f99[_0x1938('0x20')]],'as':_0x9a0f99['as'],'attributes':_0x9a0f99[_0x1938('0x1d')],'include':_0x9a0f99[_0x1938('0x1e')]?_[_0x1938('0x1f')](_0x9a0f99[_0x1938('0x1e')],function(_0x446044){return{'model':db[_0x446044[_0x1938('0x20')]],'as':_0x446044['as'],'attributes':_0x446044[_0x1938('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf04595){logger[_0x1938('0xd')](_0x1938('0x17'),_0x188654);logger[_0x1938('0x21')](_0x1938('0x17'),_0x188654,JSON['stringify'](_0xf04595));_0x1d5172(_0xf04595);})[_0x1938('0x16')](function(_0x29c189){logger[_0x1938('0x11')](_0x1938('0x17'),_0x29c189[_0x1938('0x13')],_0x188654);_0x576f53(_0x10fb30[_0x1938('0x11')](0x1f4,_0x29c189['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 72b0080..b28db28 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(_0x2d6550,_0x404a2b){var _0x311573=function(_0x12de90){while(--_0x12de90){_0x2d6550['push'](_0x2d6550['shift']());}};_0x311573(++_0x404a2b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x13f0ee,_0x403066){_0x13f0ee=_0x13f0ee-0x0;var _0x2ef710=_0x9ffd[_0x13f0ee];return _0x2ef710;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 13afd65..88d156a 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 _0x680c=['TEXT','medium','out','exports','STRING'];(function(_0x5bbb96,_0x10071d){var _0x18d362=function(_0x41af9a){while(--_0x41af9a){_0x5bbb96['push'](_0x5bbb96['shift']());}};_0x18d362(++_0x10071d);}(_0x680c,0xd5));var _0xc680=function(_0x2fb2a9,_0x5badf7){_0x2fb2a9=_0x2fb2a9-0x0;var _0x106844=_0x680c[_0x2fb2a9];return _0x106844;};'use strict';var Sequelize=require('sequelize');module[_0xc680('0x0')]={'uniqueid':{'type':Sequelize[_0xc680('0x1')]},'body':{'type':Sequelize[_0xc680('0x2')](_0xc680('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc680('0x4')),'defaultValue':_0xc680('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc680('0x1')]},'providerResponse':{'type':Sequelize[_0xc680('0x2')]}}; \ No newline at end of file +var _0x9c42=['medium','ENUM','out','STRING','TEXT'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9c42,0xb2));var _0x29c4=function(_0x2302a1,_0x4bc33d){_0x2302a1=_0x2302a1-0x0;var _0x413cae=_0x9c42[_0x2302a1];return _0x413cae;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x29c4('0x0')]},'body':{'type':Sequelize[_0x29c4('0x1')](_0x29c4('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x29c4('0x3')]('in','out'),'defaultValue':_0x29c4('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x29c4('0x0')]},'providerResponse':{'type':Sequelize[_0x29c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 0aed46c..4ae11e6 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 _0x3946=['filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','sendStatus','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','sort','where','filters','pick'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3946,0x1d0));var _0x6394=function(_0x1741a1,_0x3ab2f5){_0x1741a1=_0x1741a1-0x0;var _0x20f178=_0x3946[_0x1741a1];return _0x20f178;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6394('0x0'));var zipdir=require(_0x6394('0x1'));var jsonpatch=require(_0x6394('0x2'));var rp=require(_0x6394('0x3'));var moment=require(_0x6394('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6394('0x5'));var util=require(_0x6394('0x6'));var path=require(_0x6394('0x7'));var sox=require(_0x6394('0x8'));var csv=require('to-csv');var ejs=require(_0x6394('0x9'));var fs=require('fs');var fs_extra=require(_0x6394('0xa'));var _=require(_0x6394('0xb'));var squel=require(_0x6394('0xc'));var crypto=require(_0x6394('0xd'));var jsforce=require(_0x6394('0xe'));var deskjs=require(_0x6394('0xf'));var toCsv=require(_0x6394('0x10'));var querystring=require('querystring');var Papa=require(_0x6394('0x11'));var Redis=require(_0x6394('0x12'));var authService=require(_0x6394('0x13'));var qs=require(_0x6394('0x14'));var as=require(_0x6394('0x15'));var hardwareService=require(_0x6394('0x16'));var logger=require(_0x6394('0x17'))(_0x6394('0x18'));var utils=require(_0x6394('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6394('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b8b51,_0x17bdda){_0x17bdda=_0x17bdda||0xcc;return function(_0x5a6fab){if(_0x5a6fab){return _0x2b8b51['sendStatus'](_0x17bdda);}return _0x2b8b51[_0x6394('0x1b')](_0x17bdda)[_0x6394('0x1c')]();};}function respondWithResult(_0x4f0cd0,_0x57b62c){_0x57b62c=_0x57b62c||0xc8;return function(_0x2777c3){if(_0x2777c3){return _0x4f0cd0[_0x6394('0x1b')](_0x57b62c)[_0x6394('0x1d')](_0x2777c3);}};}function respondWithFilteredResult(_0x582f76,_0x255f9e){return function(_0x2bf1f6){if(_0x2bf1f6){var _0x293800=typeof _0x255f9e['offset']===_0x6394('0x1e')&&typeof _0x255f9e[_0x6394('0x1f')]===_0x6394('0x1e');var _0x2d4836=_0x2bf1f6[_0x6394('0x20')];var _0x4a2d0b=_0x293800?0x0:_0x255f9e[_0x6394('0x21')];var _0x8c4c65=_0x293800?_0x2bf1f6['count']:_0x255f9e[_0x6394('0x21')]+_0x255f9e[_0x6394('0x1f')];var _0x1424b8;if(_0x8c4c65>=_0x2d4836){_0x8c4c65=_0x2d4836;_0x1424b8=0xc8;}else{_0x1424b8=0xce;}_0x582f76[_0x6394('0x1b')](_0x1424b8);return _0x582f76['set'](_0x6394('0x22'),_0x4a2d0b+'-'+_0x8c4c65+'/'+_0x2d4836)['json'](_0x2bf1f6);}return null;};}function patchUpdates(_0x27f172){return function(_0xbdd854){try{jsonpatch[_0x6394('0x23')](_0xbdd854,_0x27f172,!![]);}catch(_0x1de4f2){return BPromise['reject'](_0x1de4f2);}return _0xbdd854[_0x6394('0x24')]();};}function saveUpdates(_0x14bcc6,_0x4aee20){return function(_0x152c26){if(_0x152c26){return _0x152c26[_0x6394('0x25')](_0x14bcc6)[_0x6394('0x26')](function(_0x54e9f5){return _0x54e9f5;});}return null;};}function removeEntity(_0x273083,_0x207732){return function(_0x2a4251){if(_0x2a4251){return _0x2a4251['destroy']()[_0x6394('0x26')](function(){_0x273083['status'](0xcc)[_0x6394('0x1c')]();});}};}function handleEntityNotFound(_0x5bc5fa,_0x2b3033){return function(_0xbb37da){if(!_0xbb37da){_0x5bc5fa[_0x6394('0x27')](0x194);}return _0xbb37da;};}function handleError(_0x2cafe6,_0x321d0f){_0x321d0f=_0x321d0f||0x1f4;return function(_0x40608b){logger[_0x6394('0x28')](_0x40608b[_0x6394('0x29')]);if(_0x40608b['name']){delete _0x40608b[_0x6394('0x2a')];}_0x2cafe6[_0x6394('0x1b')](_0x321d0f)['send'](_0x40608b);};}exports[_0x6394('0x2b')]=function(_0x1cc266,_0xaf04b4){var _0x5b5fc3={},_0x4d8152={},_0x788938={'count':0x0,'rows':[]};var _0x32223e=_[_0x6394('0x2c')](db[_0x6394('0x2d')][_0x6394('0x2e')],function(_0x39c7e8){return{'name':_0x39c7e8[_0x6394('0x2f')],'type':_0x39c7e8[_0x6394('0x30')][_0x6394('0x31')]};});_0x4d8152['model']=_[_0x6394('0x2c')](_0x32223e,_0x6394('0x2a'));_0x4d8152['query']=_[_0x6394('0x32')](_0x1cc266[_0x6394('0x33')]);_0x4d8152['filters']=_[_0x6394('0x34')](_0x4d8152[_0x6394('0x35')],_0x4d8152[_0x6394('0x33')]);_0x5b5fc3['attributes']=_['intersection'](_0x4d8152[_0x6394('0x35')],qs['fields'](_0x1cc266[_0x6394('0x33')][_0x6394('0x36')]));_0x5b5fc3[_0x6394('0x37')]=_0x5b5fc3['attributes'][_0x6394('0x38')]?_0x5b5fc3['attributes']:_0x4d8152[_0x6394('0x35')];if(!_0x1cc266[_0x6394('0x33')]['hasOwnProperty']('nolimit')){_0x5b5fc3['limit']=qs[_0x6394('0x1f')](_0x1cc266[_0x6394('0x33')][_0x6394('0x1f')]);_0x5b5fc3[_0x6394('0x21')]=qs['offset'](_0x1cc266[_0x6394('0x33')]['offset']);}_0x5b5fc3['order']=qs[_0x6394('0x39')](_0x1cc266[_0x6394('0x33')][_0x6394('0x39')]);_0x5b5fc3[_0x6394('0x3a')]=qs[_0x6394('0x3b')](_[_0x6394('0x3c')](_0x1cc266[_0x6394('0x33')],_0x4d8152[_0x6394('0x3b')]),_0x32223e);if(_0x1cc266[_0x6394('0x33')][_0x6394('0x3d')]){_0x5b5fc3['where']=_[_0x6394('0x3e')](_0x5b5fc3[_0x6394('0x3a')],{'$or':_[_0x6394('0x2c')](_0x32223e,function(_0x3f7598){if(_0x3f7598['type']!==_0x6394('0x3f')){var _0x4ebfca={};_0x4ebfca[_0x3f7598[_0x6394('0x2a')]]={'$like':'%'+_0x1cc266[_0x6394('0x33')][_0x6394('0x3d')]+'%'};return _0x4ebfca;}})});}_0x5b5fc3=_[_0x6394('0x3e')]({},_0x5b5fc3,_0x1cc266['options']);var _0x496ee3={'where':_0x5b5fc3[_0x6394('0x3a')]};return db[_0x6394('0x2d')][_0x6394('0x20')](_0x496ee3)['then'](function(_0x2167ec){_0x788938[_0x6394('0x20')]=_0x2167ec;if(_0x1cc266[_0x6394('0x33')]['includeAll']){_0x5b5fc3[_0x6394('0x40')]=[{'all':!![]}];}return db[_0x6394('0x2d')]['findAll'](_0x5b5fc3);})[_0x6394('0x26')](function(_0x2d20a1){_0x788938[_0x6394('0x41')]=_0x2d20a1;return _0x788938;})['then'](respondWithFilteredResult(_0xaf04b4,_0x5b5fc3))[_0x6394('0x42')](handleError(_0xaf04b4,null));};exports[_0x6394('0x43')]=function(_0x5e40ed,_0x5ae5f8){var _0x534def={'raw':!![],'where':{'id':_0x5e40ed[_0x6394('0x44')]['id']}},_0x1a5784={};_0x1a5784[_0x6394('0x35')]=_[_0x6394('0x32')](db[_0x6394('0x2d')]['rawAttributes']);_0x1a5784['query']=_[_0x6394('0x32')](_0x5e40ed['query']);_0x1a5784['filters']=_[_0x6394('0x34')](_0x1a5784[_0x6394('0x35')],_0x1a5784[_0x6394('0x33')]);_0x534def['attributes']=_[_0x6394('0x34')](_0x1a5784['model'],qs[_0x6394('0x36')](_0x5e40ed[_0x6394('0x33')]['fields']));_0x534def['attributes']=_0x534def[_0x6394('0x37')]['length']?_0x534def['attributes']:_0x1a5784['model'];if(_0x5e40ed['query'][_0x6394('0x45')]){_0x534def['include']=[{'all':!![]}];}_0x534def=_[_0x6394('0x3e')]({},_0x534def,_0x5e40ed[_0x6394('0x46')]);return db[_0x6394('0x2d')][_0x6394('0x47')](_0x534def)[_0x6394('0x26')](handleEntityNotFound(_0x5ae5f8,null))['then'](respondWithResult(_0x5ae5f8,null))[_0x6394('0x42')](handleError(_0x5ae5f8,null));};exports[_0x6394('0x48')]=function(_0xcd6cf1,_0x8dc441){return db[_0x6394('0x2d')][_0x6394('0x48')](_0xcd6cf1[_0x6394('0x49')],{})[_0x6394('0x26')](respondWithResult(_0x8dc441,0xc9))[_0x6394('0x42')](handleError(_0x8dc441,null));};exports[_0x6394('0x25')]=function(_0x15d8f7,_0x11ae60){if(_0x15d8f7[_0x6394('0x49')]['id']){delete _0x15d8f7[_0x6394('0x49')]['id'];}return db[_0x6394('0x2d')]['find']({'where':{'id':_0x15d8f7[_0x6394('0x44')]['id']}})[_0x6394('0x26')](handleEntityNotFound(_0x11ae60,null))[_0x6394('0x26')](saveUpdates(_0x15d8f7[_0x6394('0x49')],null))[_0x6394('0x26')](respondWithResult(_0x11ae60,null))['catch'](handleError(_0x11ae60,null));};exports[_0x6394('0x4a')]=function(_0x984b46,_0x2a9764){return db[_0x6394('0x2d')][_0x6394('0x47')]({'where':{'id':_0x984b46[_0x6394('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a9764,null))['then'](removeEntity(_0x2a9764,null))['catch'](handleError(_0x2a9764,null));}; \ No newline at end of file +var _0x2a19=['merge','includeAll','include','SquareMessage','rows','catch','show','options','find','create','body','update','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x3a07d4,_0xa80b88){var _0x2c352=function(_0x27926b){while(--_0x27926b){_0x3a07d4['push'](_0x3a07d4['shift']());}};_0x2c352(++_0xa80b88);}(_0x2a19,0x199));var _0x92a1=function(_0x2682b9,_0x1bfbf4){_0x2682b9=_0x2682b9-0x0;var _0x1166b6=_0x2a19[_0x2682b9];return _0x1166b6;};'use strict';var emlformat=require(_0x92a1('0x0'));var rimraf=require(_0x92a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x92a1('0x2'));var moment=require(_0x92a1('0x3'));var BPromise=require(_0x92a1('0x4'));var Mustache=require(_0x92a1('0x5'));var util=require(_0x92a1('0x6'));var path=require(_0x92a1('0x7'));var sox=require('sox');var csv=require(_0x92a1('0x8'));var ejs=require(_0x92a1('0x9'));var fs=require('fs');var fs_extra=require(_0x92a1('0xa'));var _=require(_0x92a1('0xb'));var squel=require(_0x92a1('0xc'));var crypto=require(_0x92a1('0xd'));var jsforce=require(_0x92a1('0xe'));var deskjs=require(_0x92a1('0xf'));var toCsv=require(_0x92a1('0x8'));var querystring=require(_0x92a1('0x10'));var Papa=require(_0x92a1('0x11'));var Redis=require(_0x92a1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x92a1('0x13'));var as=require(_0x92a1('0x14'));var hardwareService=require(_0x92a1('0x15'));var logger=require(_0x92a1('0x16'))('api');var utils=require(_0x92a1('0x17'));var config=require(_0x92a1('0x18'));var licenseUtil=require(_0x92a1('0x19'));var db=require(_0x92a1('0x1a'))['db'];function respondWithStatusCode(_0x838615,_0x3454bd){_0x3454bd=_0x3454bd||0xcc;return function(_0x5cbf18){if(_0x5cbf18){return _0x838615[_0x92a1('0x1b')](_0x3454bd);}return _0x838615['status'](_0x3454bd)['end']();};}function respondWithResult(_0x517bb4,_0x316b6d){_0x316b6d=_0x316b6d||0xc8;return function(_0x38ed36){if(_0x38ed36){return _0x517bb4['status'](_0x316b6d)[_0x92a1('0x1c')](_0x38ed36);}};}function respondWithFilteredResult(_0x55161f,_0x4868d6){return function(_0x5567ac){if(_0x5567ac){var _0xf0957e=typeof _0x4868d6[_0x92a1('0x1d')]===_0x92a1('0x1e')&&typeof _0x4868d6[_0x92a1('0x1f')]===_0x92a1('0x1e');var _0x5b1b6a=_0x5567ac[_0x92a1('0x20')];var _0x3eca19=_0xf0957e?0x0:_0x4868d6[_0x92a1('0x1d')];var _0x570258=_0xf0957e?_0x5567ac[_0x92a1('0x20')]:_0x4868d6[_0x92a1('0x1d')]+_0x4868d6[_0x92a1('0x1f')];var _0x1e2025;if(_0x570258>=_0x5b1b6a){_0x570258=_0x5b1b6a;_0x1e2025=0xc8;}else{_0x1e2025=0xce;}_0x55161f[_0x92a1('0x21')](_0x1e2025);return _0x55161f['set'](_0x92a1('0x22'),_0x3eca19+'-'+_0x570258+'/'+_0x5b1b6a)[_0x92a1('0x1c')](_0x5567ac);}return null;};}function patchUpdates(_0x15df07){return function(_0x46be9f){try{jsonpatch[_0x92a1('0x23')](_0x46be9f,_0x15df07,!![]);}catch(_0x11531b){return BPromise[_0x92a1('0x24')](_0x11531b);}return _0x46be9f[_0x92a1('0x25')]();};}function saveUpdates(_0x33d55b,_0x412407){return function(_0x13790f){if(_0x13790f){return _0x13790f['update'](_0x33d55b)[_0x92a1('0x26')](function(_0x4f5b4e){return _0x4f5b4e;});}return null;};}function removeEntity(_0x48a0b6,_0x51de69){return function(_0x5392fc){if(_0x5392fc){return _0x5392fc['destroy']()['then'](function(){_0x48a0b6[_0x92a1('0x21')](0xcc)[_0x92a1('0x27')]();});}};}function handleEntityNotFound(_0x55f4d1,_0x18bf20){return function(_0x1e818a){if(!_0x1e818a){_0x55f4d1[_0x92a1('0x1b')](0x194);}return _0x1e818a;};}function handleError(_0x1c790b,_0x471f63){_0x471f63=_0x471f63||0x1f4;return function(_0x35fcf5){logger[_0x92a1('0x28')](_0x35fcf5[_0x92a1('0x29')]);if(_0x35fcf5[_0x92a1('0x2a')]){delete _0x35fcf5['name'];}_0x1c790b['status'](_0x471f63)[_0x92a1('0x2b')](_0x35fcf5);};}exports[_0x92a1('0x2c')]=function(_0x3d94ce,_0x59b02f){var _0x871d93={},_0xa54a22={},_0x4b6d45={'count':0x0,'rows':[]};var _0x2121d7=_['map'](db['SquareMessage'][_0x92a1('0x2d')],function(_0x2d7528){return{'name':_0x2d7528[_0x92a1('0x2e')],'type':_0x2d7528[_0x92a1('0x2f')][_0x92a1('0x30')]};});_0xa54a22[_0x92a1('0x31')]=_[_0x92a1('0x32')](_0x2121d7,_0x92a1('0x2a'));_0xa54a22['query']=_[_0x92a1('0x33')](_0x3d94ce[_0x92a1('0x34')]);_0xa54a22[_0x92a1('0x35')]=_[_0x92a1('0x36')](_0xa54a22[_0x92a1('0x31')],_0xa54a22[_0x92a1('0x34')]);_0x871d93[_0x92a1('0x37')]=_[_0x92a1('0x36')](_0xa54a22['model'],qs[_0x92a1('0x38')](_0x3d94ce[_0x92a1('0x34')][_0x92a1('0x38')]));_0x871d93[_0x92a1('0x37')]=_0x871d93['attributes'][_0x92a1('0x39')]?_0x871d93[_0x92a1('0x37')]:_0xa54a22[_0x92a1('0x31')];if(!_0x3d94ce['query'][_0x92a1('0x3a')](_0x92a1('0x3b'))){_0x871d93[_0x92a1('0x1f')]=qs[_0x92a1('0x1f')](_0x3d94ce['query'][_0x92a1('0x1f')]);_0x871d93['offset']=qs[_0x92a1('0x1d')](_0x3d94ce[_0x92a1('0x34')]['offset']);}_0x871d93[_0x92a1('0x3c')]=qs[_0x92a1('0x3d')](_0x3d94ce[_0x92a1('0x34')][_0x92a1('0x3d')]);_0x871d93[_0x92a1('0x3e')]=qs['filters'](_[_0x92a1('0x3f')](_0x3d94ce[_0x92a1('0x34')],_0xa54a22['filters']),_0x2121d7);if(_0x3d94ce[_0x92a1('0x34')][_0x92a1('0x40')]){_0x871d93[_0x92a1('0x3e')]=_[_0x92a1('0x41')](_0x871d93[_0x92a1('0x3e')],{'$or':_[_0x92a1('0x32')](_0x2121d7,function(_0x691357){if(_0x691357[_0x92a1('0x2f')]!=='VIRTUAL'){var _0x3b2025={};_0x3b2025[_0x691357['name']]={'$like':'%'+_0x3d94ce[_0x92a1('0x34')][_0x92a1('0x40')]+'%'};return _0x3b2025;}})});}_0x871d93=_[_0x92a1('0x41')]({},_0x871d93,_0x3d94ce['options']);var _0x348e77={'where':_0x871d93[_0x92a1('0x3e')]};return db['SquareMessage'][_0x92a1('0x20')](_0x348e77)[_0x92a1('0x26')](function(_0x274a30){_0x4b6d45['count']=_0x274a30;if(_0x3d94ce['query'][_0x92a1('0x42')]){_0x871d93[_0x92a1('0x43')]=[{'all':!![]}];}return db[_0x92a1('0x44')]['findAll'](_0x871d93);})[_0x92a1('0x26')](function(_0x1b5094){_0x4b6d45[_0x92a1('0x45')]=_0x1b5094;return _0x4b6d45;})[_0x92a1('0x26')](respondWithFilteredResult(_0x59b02f,_0x871d93))[_0x92a1('0x46')](handleError(_0x59b02f,null));};exports[_0x92a1('0x47')]=function(_0x18ed0e,_0x2359ca){var _0x3b8932={'raw':!![],'where':{'id':_0x18ed0e['params']['id']}},_0x3f1e48={};_0x3f1e48[_0x92a1('0x31')]=_[_0x92a1('0x33')](db[_0x92a1('0x44')]['rawAttributes']);_0x3f1e48[_0x92a1('0x34')]=_['keys'](_0x18ed0e[_0x92a1('0x34')]);_0x3f1e48[_0x92a1('0x35')]=_[_0x92a1('0x36')](_0x3f1e48[_0x92a1('0x31')],_0x3f1e48[_0x92a1('0x34')]);_0x3b8932['attributes']=_['intersection'](_0x3f1e48['model'],qs[_0x92a1('0x38')](_0x18ed0e[_0x92a1('0x34')][_0x92a1('0x38')]));_0x3b8932['attributes']=_0x3b8932['attributes'][_0x92a1('0x39')]?_0x3b8932[_0x92a1('0x37')]:_0x3f1e48[_0x92a1('0x31')];if(_0x18ed0e[_0x92a1('0x34')][_0x92a1('0x42')]){_0x3b8932[_0x92a1('0x43')]=[{'all':!![]}];}_0x3b8932=_[_0x92a1('0x41')]({},_0x3b8932,_0x18ed0e[_0x92a1('0x48')]);return db[_0x92a1('0x44')][_0x92a1('0x49')](_0x3b8932)[_0x92a1('0x26')](handleEntityNotFound(_0x2359ca,null))['then'](respondWithResult(_0x2359ca,null))['catch'](handleError(_0x2359ca,null));};exports[_0x92a1('0x4a')]=function(_0x154ca1,_0x3054fe){return db[_0x92a1('0x44')]['create'](_0x154ca1[_0x92a1('0x4b')],{})[_0x92a1('0x26')](respondWithResult(_0x3054fe,0xc9))[_0x92a1('0x46')](handleError(_0x3054fe,null));};exports[_0x92a1('0x4c')]=function(_0x2d9350,_0xd9d0ff){if(_0x2d9350[_0x92a1('0x4b')]['id']){delete _0x2d9350[_0x92a1('0x4b')]['id'];}return db[_0x92a1('0x44')][_0x92a1('0x49')]({'where':{'id':_0x2d9350[_0x92a1('0x4d')]['id']}})[_0x92a1('0x26')](handleEntityNotFound(_0xd9d0ff,null))[_0x92a1('0x26')](saveUpdates(_0x2d9350[_0x92a1('0x4b')],null))[_0x92a1('0x26')](respondWithResult(_0xd9d0ff,null))[_0x92a1('0x46')](handleError(_0xd9d0ff,null));};exports[_0x92a1('0x4e')]=function(_0x12c4c2,_0x63bba6){return db['SquareMessage'][_0x92a1('0x49')]({'where':{'id':_0x12c4c2[_0x92a1('0x4d')]['id']}})[_0x92a1('0x26')](handleEntityNotFound(_0x63bba6,null))[_0x92a1('0x26')](removeEntity(_0x63bba6,null))[_0x92a1('0x46')](handleError(_0x63bba6,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index e0b16c4..b25de09 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 _0x7811=['bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7811,0x140));var _0x1781=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x7811[_0x21af3a];return _0x268a49;};'use strict';var _=require(_0x1781('0x0'));var util=require(_0x1781('0x1'));var logger=require(_0x1781('0x2'))(_0x1781('0x3'));var moment=require(_0x1781('0x4'));var BPromise=require(_0x1781('0x5'));var rp=require(_0x1781('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1781('0x7'));var config=require(_0x1781('0x8'));var attributes=require('./squareMessage.attributes');module[_0x1781('0x9')]=function(_0x415f2b,_0x414042){return _0x415f2b[_0x1781('0xa')](_0x1781('0xb'),attributes,{'tableName':_0x1781('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareMessage','util','api'];(function(_0x117d63,_0x56a1cd){var _0x35ecbe=function(_0x510287){while(--_0x510287){_0x117d63['push'](_0x117d63['shift']());}};_0x35ecbe(++_0x56a1cd);}(_0x82c4,0xb9));var _0x482c=function(_0x2b00fa,_0x4551db){_0x2b00fa=_0x2b00fa-0x0;var _0x3c5297=_0x82c4[_0x2b00fa];return _0x3c5297;};'use strict';var _=require('lodash');var util=require(_0x482c('0x0'));var logger=require('../../config/logger')(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rp=require(_0x482c('0x4'));var fs=require('fs');var path=require(_0x482c('0x5'));var rimraf=require(_0x482c('0x6'));var config=require(_0x482c('0x7'));var attributes=require('./squareMessage.attributes');module[_0x482c('0x8')]=function(_0x293024,_0x1f017c){return _0x293024[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 5d10699..9bc1e32 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 _0x62cf=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareMessage','create','options','raw','CreateSquareMessage','bluebird','randomstring','../../config/utils'];(function(_0x44cda9,_0x38798b){var _0x4d754a=function(_0x1d7d29){while(--_0x1d7d29){_0x44cda9['push'](_0x44cda9['shift']());}};_0x4d754a(++_0x38798b);}(_0x62cf,0x9f));var _0xf62c=function(_0x864ee,_0x17c833){_0x864ee=_0x864ee-0x0;var _0x1c7d2a=_0x62cf[_0x864ee];return _0x1c7d2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf62c('0x0'));var rs=require(_0xf62c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf62c('0x2'));var logger=require(_0xf62c('0x3'))(_0xf62c('0x4'));var config=require(_0xf62c('0x5'));var jayson=require(_0xf62c('0x6'));var client=jayson[_0xf62c('0x7')][_0xf62c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1310e6,_0x3e2b34,_0x47619d){return new BPromise(function(_0x4a5701,_0x378a65){return client[_0xf62c('0x9')](_0x1310e6,_0x47619d)[_0xf62c('0xa')](function(_0x5776f6){logger[_0xf62c('0xb')](_0xf62c('0xc'),_0x3e2b34,_0xf62c('0xd'));logger[_0xf62c('0xe')](_0xf62c('0xf'),_0x3e2b34,_0xf62c('0xd'),JSON[_0xf62c('0x10')](_0x5776f6));if(_0x5776f6['error']){if(_0x5776f6[_0xf62c('0x11')][_0xf62c('0x12')]===0x1f4){logger[_0xf62c('0x11')](_0xf62c('0xc'),_0x3e2b34,_0x5776f6[_0xf62c('0x11')][_0xf62c('0x13')]);return _0x378a65(_0x5776f6['error'][_0xf62c('0x13')]);}logger[_0xf62c('0x11')](_0xf62c('0xc'),_0x3e2b34,_0x5776f6['error']['message']);return _0x4a5701(_0x5776f6['error'][_0xf62c('0x13')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x3e2b34,_0xf62c('0xd'));_0x4a5701(_0x5776f6[_0xf62c('0x14')][_0xf62c('0x13')]);}})[_0xf62c('0x15')](function(_0x2aa6a9){logger[_0xf62c('0x11')](_0xf62c('0xc'),_0x3e2b34,_0x2aa6a9);_0x378a65(_0x2aa6a9);});});}exports['CreateSquareMessage']=function(_0x214028){var _0xb2658c=this;return new Promise(function(_0x16596f,_0x13e82){return db[_0xf62c('0x16')][_0xf62c('0x17')](_0x214028['body'],{'raw':_0x214028[_0xf62c('0x18')]?_0x214028[_0xf62c('0x18')][_0xf62c('0x19')]===undefined?!![]:![]:!![]})[_0xf62c('0xa')](function(_0x2f6c9b){logger[_0xf62c('0xb')](_0xf62c('0x1a'),_0x214028);logger['debug'](_0xf62c('0x1a'),_0x214028,JSON['stringify'](_0x2f6c9b));_0x16596f(_0x2f6c9b);})[_0xf62c('0x15')](function(_0x5834bd){logger['error'](_0xf62c('0x1a'),_0x5834bd[_0xf62c('0x13')],_0x214028);_0x13e82(_0xb2658c[_0xf62c('0x11')](0x1f4,_0x5834bd['message']));});});}; \ No newline at end of file +var _0x4039=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','debug','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','body','options','raw'];(function(_0x2594e0,_0x1ee198){var _0x1eadb9=function(_0x52a325){while(--_0x52a325){_0x2594e0['push'](_0x2594e0['shift']());}};_0x1eadb9(++_0x1ee198);}(_0x4039,0x15e));var _0x9403=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4039[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9403('0x0'));var util=require(_0x9403('0x1'));var moment=require(_0x9403('0x2'));var BPromise=require('bluebird');var rs=require(_0x9403('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9403('0x4'))['db'];var utils=require(_0x9403('0x5'));var logger=require(_0x9403('0x6'))(_0x9403('0x7'));var config=require('../../config/environment');var jayson=require(_0x9403('0x8'));var client=jayson[_0x9403('0x9')][_0x9403('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x338c2a,_0x3c7c29,_0x57d695){return new BPromise(function(_0x46db73,_0x572356){return client['request'](_0x338c2a,_0x57d695)[_0x9403('0xb')](function(_0x23f918){logger['info']('SquareMessage,\x20%s,\x20%s',_0x3c7c29,'request\x20sent');logger[_0x9403('0xc')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3c7c29,'request\x20sent',JSON[_0x9403('0xd')](_0x23f918));if(_0x23f918[_0x9403('0xe')]){if(_0x23f918[_0x9403('0xe')][_0x9403('0xf')]===0x1f4){logger[_0x9403('0xe')](_0x9403('0x10'),_0x3c7c29,_0x23f918[_0x9403('0xe')][_0x9403('0x11')]);return _0x572356(_0x23f918['error'][_0x9403('0x11')]);}logger[_0x9403('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3c7c29,_0x23f918[_0x9403('0xe')][_0x9403('0x11')]);return _0x46db73(_0x23f918['error'][_0x9403('0x11')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x3c7c29,'request\x20sent');_0x46db73(_0x23f918[_0x9403('0x12')][_0x9403('0x11')]);}})[_0x9403('0x13')](function(_0x476ab1){logger[_0x9403('0xe')](_0x9403('0x10'),_0x3c7c29,_0x476ab1);_0x572356(_0x476ab1);});});}exports[_0x9403('0x14')]=function(_0xadb4ce){var _0x500148=this;return new Promise(function(_0x16eda2,_0x555a0d){return db[_0x9403('0x15')]['create'](_0xadb4ce[_0x9403('0x16')],{'raw':_0xadb4ce[_0x9403('0x17')]?_0xadb4ce['options'][_0x9403('0x18')]===undefined?!![]:![]:!![]})[_0x9403('0xb')](function(_0x698840){logger['info'](_0x9403('0x14'),_0xadb4ce);logger['debug'](_0x9403('0x14'),_0xadb4ce,JSON[_0x9403('0xd')](_0x698840));_0x16eda2(_0x698840);})[_0x9403('0x13')](function(_0x3df463){logger[_0x9403('0xe')](_0x9403('0x14'),_0x3df463[_0x9403('0x11')],_0xadb4ce);_0x555a0d(_0x500148[_0x9403('0xe')](0x1f4,_0x3df463['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index af27279..053198b 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 _0x8f20=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test'];(function(_0x4e9877,_0x1fabca){var _0x3dbdc6=function(_0x453f4b){while(--_0x453f4b){_0x4e9877['push'](_0x4e9877['shift']());}};_0x3dbdc6(++_0x1fabca);}(_0x8f20,0x1a8));var _0x08f2=function(_0x4f8434,_0x562ed5){_0x4f8434=_0x4f8434-0x0;var _0x5bd5e4=_0x8f20[_0x4f8434];return _0x5bd5e4;};'use strict';var multer=require(_0x08f2('0x0'));var util=require(_0x08f2('0x1'));var path=require(_0x08f2('0x2'));var timeout=require(_0x08f2('0x3'));var express=require(_0x08f2('0x4'));var router=express[_0x08f2('0x5')]();var fs_extra=require(_0x08f2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x08f2('0x7'));var config=require('../../config/environment');var controller=require(_0x08f2('0x8'));router[_0x08f2('0x9')]('/',auth[_0x08f2('0xa')](),controller[_0x08f2('0xb')]);router['get'](_0x08f2('0xc'),auth[_0x08f2('0xa')](),controller['show']);router['get'](_0x08f2('0xd'),auth['isAuthenticated'](),timeout(_0x08f2('0xe')),controller[_0x08f2('0xf')]);router['post']('/',auth[_0x08f2('0xa')](),controller[_0x08f2('0x10')]);router[_0x08f2('0x11')](_0x08f2('0xc'),auth[_0x08f2('0xa')](),controller[_0x08f2('0x12')]);router[_0x08f2('0x13')](_0x08f2('0xc'),auth[_0x08f2('0xa')](),controller[_0x08f2('0x14')]);module[_0x08f2('0x15')]=router; \ No newline at end of file +var _0x927f=['15s','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','/:id','show','/:id/test'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x927f,0xcc));var _0xf927=function(_0x35ea3c,_0x1c31ea){_0x35ea3c=_0x35ea3c-0x0;var _0x3c5cc3=_0x927f[_0x35ea3c];return _0x3c5cc3;};'use strict';var multer=require(_0xf927('0x0'));var util=require(_0xf927('0x1'));var path=require(_0xf927('0x2'));var timeout=require(_0xf927('0x3'));var express=require(_0xf927('0x4'));var router=express[_0xf927('0x5')]();var fs_extra=require(_0xf927('0x6'));var auth=require(_0xf927('0x7'));var interaction=require(_0xf927('0x8'));var config=require(_0xf927('0x9'));var controller=require(_0xf927('0xa'));router['get']('/',auth[_0xf927('0xb')](),controller[_0xf927('0xc')]);router['get'](_0xf927('0xd'),auth[_0xf927('0xb')](),controller[_0xf927('0xe')]);router['get'](_0xf927('0xf'),auth['isAuthenticated'](),timeout(_0xf927('0x10')),controller['test']);router[_0xf927('0x11')]('/',auth[_0xf927('0xb')](),controller[_0xf927('0x12')]);router['put'](_0xf927('0xd'),auth[_0xf927('0xb')](),controller[_0xf927('0x13')]);router[_0xf927('0x14')](_0xf927('0xd'),auth[_0xf927('0xb')](),controller['destroy']);module[_0xf927('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 6aceb7e..7bc1115 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 _0x6dd4=['sequelize','exports','STRING','name'];(function(_0x19d11c,_0x285b34){var _0x933487=function(_0x4adf58){while(--_0x4adf58){_0x19d11c['push'](_0x19d11c['shift']());}};_0x933487(++_0x285b34);}(_0x6dd4,0x168));var _0x46dd=function(_0x3cae79,_0x56281c){_0x3cae79=_0x3cae79-0x0;var _0x3465be=_0x6dd4[_0x3cae79];return _0x3465be;};'use strict';var Sequelize=require(_0x46dd('0x0'));module[_0x46dd('0x1')]={'name':{'type':Sequelize[_0x46dd('0x2')],'unique':_0x46dd('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x46dd('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd620=['sequelize','STRING','name'];(function(_0x5eedd4,_0xd1e738){var _0x8cc7e1=function(_0x4fdf4e){while(--_0x4fdf4e){_0x5eedd4['push'](_0x5eedd4['shift']());}};_0x8cc7e1(++_0xd1e738);}(_0xd620,0x168));var _0x0d62=function(_0x544c3f,_0x4046e3){_0x544c3f=_0x544c3f-0x0;var _0x412258=_0xd620[_0x544c3f];return _0x412258;};'use strict';var Sequelize=require(_0x0d62('0x0'));module['exports']={'name':{'type':Sequelize[_0x0d62('0x1')],'unique':_0x0d62('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0d62('0x1')]},'description':{'type':Sequelize[_0x0d62('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 3454054..50d2607 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 _0x2a7d=['limit','set','Content-Range','apply','reject','save','update','then','ODBC','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','catch','show','params','includeAll','include','find','create','body','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count'];(function(_0x3a91ac,_0x386ea6){var _0x3dcb07=function(_0x3cc056){while(--_0x3cc056){_0x3a91ac['push'](_0x3a91ac['shift']());}};_0x3dcb07(++_0x386ea6);}(_0x2a7d,0x13f));var _0xd2a7=function(_0x40042c,_0x40ef1e){_0x40042c=_0x40042c-0x0;var _0x5b2a5e=_0x2a7d[_0x40042c];return _0x5b2a5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd2a7('0x0'));var zipdir=require(_0xd2a7('0x1'));var jsonpatch=require(_0xd2a7('0x2'));var rp=require('request-promise');var moment=require(_0xd2a7('0x3'));var BPromise=require(_0xd2a7('0x4'));var Mustache=require('mustache');var util=require(_0xd2a7('0x5'));var path=require(_0xd2a7('0x6'));var sox=require(_0xd2a7('0x7'));var csv=require(_0xd2a7('0x8'));var ejs=require(_0xd2a7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd2a7('0xa'));var crypto=require(_0xd2a7('0xb'));var jsforce=require(_0xd2a7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd2a7('0x8'));var querystring=require(_0xd2a7('0xd'));var Papa=require('papaparse');var Redis=require(_0xd2a7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd2a7('0xf'));var as=require(_0xd2a7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2a7('0x11'))(_0xd2a7('0x12'));var utils=require(_0xd2a7('0x13'));var config=require(_0xd2a7('0x14'));var licenseUtil=require(_0xd2a7('0x15'));var db=require(_0xd2a7('0x16'))['db'];function respondWithStatusCode(_0x3a857c,_0x2f3693){_0x2f3693=_0x2f3693||0xcc;return function(_0x1c094c){if(_0x1c094c){return _0x3a857c['sendStatus'](_0x2f3693);}return _0x3a857c[_0xd2a7('0x17')](_0x2f3693)[_0xd2a7('0x18')]();};}function respondWithResult(_0x1eb197,_0xb6a692){_0xb6a692=_0xb6a692||0xc8;return function(_0x4712f0){if(_0x4712f0){return _0x1eb197[_0xd2a7('0x17')](_0xb6a692)[_0xd2a7('0x19')](_0x4712f0);}};}function respondWithFilteredResult(_0x58ef6a,_0x851e2){return function(_0x3d0f97){if(_0x3d0f97){var _0x50a3a7=typeof _0x851e2[_0xd2a7('0x1a')]===_0xd2a7('0x1b')&&typeof _0x851e2['limit']===_0xd2a7('0x1b');var _0x1265a3=_0x3d0f97[_0xd2a7('0x1c')];var _0x4ebbf7=_0x50a3a7?0x0:_0x851e2[_0xd2a7('0x1a')];var _0x5cb74e=_0x50a3a7?_0x3d0f97[_0xd2a7('0x1c')]:_0x851e2[_0xd2a7('0x1a')]+_0x851e2[_0xd2a7('0x1d')];var _0x2b8e68;if(_0x5cb74e>=_0x1265a3){_0x5cb74e=_0x1265a3;_0x2b8e68=0xc8;}else{_0x2b8e68=0xce;}_0x58ef6a['status'](_0x2b8e68);return _0x58ef6a[_0xd2a7('0x1e')](_0xd2a7('0x1f'),_0x4ebbf7+'-'+_0x5cb74e+'/'+_0x1265a3)[_0xd2a7('0x19')](_0x3d0f97);}return null;};}function patchUpdates(_0x16f87d){return function(_0x517a4a){try{jsonpatch[_0xd2a7('0x20')](_0x517a4a,_0x16f87d,!![]);}catch(_0x4e896f){return BPromise[_0xd2a7('0x21')](_0x4e896f);}return _0x517a4a[_0xd2a7('0x22')]();};}function saveUpdates(_0x200cb6,_0x2aa5a4){return function(_0xb01691){if(_0xb01691){return _0xb01691[_0xd2a7('0x23')](_0x200cb6)[_0xd2a7('0x24')](function(_0xc068b0){return _0xc068b0;});}return null;};}function removeEntity(_0xe8c835,_0x51fa9c){return function(_0x22973b){if(_0x22973b){return _0x22973b['destroy']()[_0xd2a7('0x24')](function(){var _0x2e3ff4=_0x22973b['get']({'plain':!![]});var _0x46b520=_0xd2a7('0x25');return db[_0xd2a7('0x26')][_0xd2a7('0x27')]({'where':{'type':_0x46b520,'resourceId':_0x2e3ff4['id']}})[_0xd2a7('0x24')](function(){return _0x22973b;});})[_0xd2a7('0x24')](function(){_0xe8c835['status'](0xcc)[_0xd2a7('0x18')]();});}};}function handleEntityNotFound(_0x3f9670,_0x2a359c){return function(_0x355be4){if(!_0x355be4){_0x3f9670['sendStatus'](0x194);}return _0x355be4;};}function handleError(_0x537a61,_0x3972e6){_0x3972e6=_0x3972e6||0x1f4;return function(_0x20e3be){logger[_0xd2a7('0x28')](_0x20e3be[_0xd2a7('0x29')]);if(_0x20e3be[_0xd2a7('0x2a')]){delete _0x20e3be[_0xd2a7('0x2a')];}_0x537a61[_0xd2a7('0x17')](_0x3972e6)[_0xd2a7('0x2b')](_0x20e3be);};}exports[_0xd2a7('0x2c')]=function(_0x3a3c5d,_0x3964cc){var _0x540ec2={},_0x4b86bf={},_0x16848e={'count':0x0,'rows':[]};var _0x4de1a4=_[_0xd2a7('0x2d')](db[_0xd2a7('0x2e')][_0xd2a7('0x2f')],function(_0x30c601){return{'name':_0x30c601[_0xd2a7('0x30')],'type':_0x30c601[_0xd2a7('0x31')][_0xd2a7('0x32')]};});_0x4b86bf['model']=_['map'](_0x4de1a4,'name');_0x4b86bf['query']=_[_0xd2a7('0x33')](_0x3a3c5d[_0xd2a7('0x34')]);_0x4b86bf[_0xd2a7('0x35')]=_[_0xd2a7('0x36')](_0x4b86bf[_0xd2a7('0x37')],_0x4b86bf['query']);_0x540ec2[_0xd2a7('0x38')]=_['intersection'](_0x4b86bf[_0xd2a7('0x37')],qs[_0xd2a7('0x39')](_0x3a3c5d[_0xd2a7('0x34')][_0xd2a7('0x39')]));_0x540ec2[_0xd2a7('0x38')]=_0x540ec2['attributes'][_0xd2a7('0x3a')]?_0x540ec2[_0xd2a7('0x38')]:_0x4b86bf[_0xd2a7('0x37')];if(!_0x3a3c5d['query'][_0xd2a7('0x3b')](_0xd2a7('0x3c'))){_0x540ec2[_0xd2a7('0x1d')]=qs[_0xd2a7('0x1d')](_0x3a3c5d[_0xd2a7('0x34')]['limit']);_0x540ec2['offset']=qs[_0xd2a7('0x1a')](_0x3a3c5d[_0xd2a7('0x34')][_0xd2a7('0x1a')]);}_0x540ec2[_0xd2a7('0x3d')]=qs[_0xd2a7('0x3e')](_0x3a3c5d['query'][_0xd2a7('0x3e')]);_0x540ec2[_0xd2a7('0x3f')]=qs['filters'](_['pick'](_0x3a3c5d['query'],_0x4b86bf[_0xd2a7('0x35')]),_0x4de1a4);if(_0x3a3c5d[_0xd2a7('0x34')][_0xd2a7('0x40')]){_0x540ec2['where']=_[_0xd2a7('0x41')](_0x540ec2[_0xd2a7('0x3f')],{'$or':_['map'](_0x4de1a4,function(_0x603259){if(_0x603259['type']!=='VIRTUAL'){var _0x453358={};_0x453358[_0x603259[_0xd2a7('0x2a')]]={'$like':'%'+_0x3a3c5d['query'][_0xd2a7('0x40')]+'%'};return _0x453358;}})});}_0x540ec2=_[_0xd2a7('0x41')]({},_0x540ec2,_0x3a3c5d[_0xd2a7('0x42')]);var _0x55d5b2={'where':_0x540ec2[_0xd2a7('0x3f')]};return db[_0xd2a7('0x2e')][_0xd2a7('0x1c')](_0x55d5b2)[_0xd2a7('0x24')](function(_0x3518f9){_0x16848e[_0xd2a7('0x1c')]=_0x3518f9;if(_0x3a3c5d['query']['includeAll']){_0x540ec2['include']=[{'all':!![]}];}return db[_0xd2a7('0x2e')][_0xd2a7('0x43')](_0x540ec2);})[_0xd2a7('0x24')](function(_0x38b5f5){_0x16848e['rows']=_0x38b5f5;return _0x16848e;})['then'](respondWithFilteredResult(_0x3964cc,_0x540ec2))[_0xd2a7('0x44')](handleError(_0x3964cc,null));};exports[_0xd2a7('0x45')]=function(_0x32b9ec,_0x38d114){var _0x565f3f={'raw':!![],'where':{'id':_0x32b9ec[_0xd2a7('0x46')]['id']}},_0x24517b={};_0x24517b[_0xd2a7('0x37')]=_['keys'](db[_0xd2a7('0x2e')]['rawAttributes']);_0x24517b[_0xd2a7('0x34')]=_[_0xd2a7('0x33')](_0x32b9ec[_0xd2a7('0x34')]);_0x24517b[_0xd2a7('0x35')]=_['intersection'](_0x24517b[_0xd2a7('0x37')],_0x24517b['query']);_0x565f3f[_0xd2a7('0x38')]=_['intersection'](_0x24517b[_0xd2a7('0x37')],qs[_0xd2a7('0x39')](_0x32b9ec['query'][_0xd2a7('0x39')]));_0x565f3f[_0xd2a7('0x38')]=_0x565f3f[_0xd2a7('0x38')][_0xd2a7('0x3a')]?_0x565f3f[_0xd2a7('0x38')]:_0x24517b[_0xd2a7('0x37')];if(_0x32b9ec[_0xd2a7('0x34')][_0xd2a7('0x47')]){_0x565f3f[_0xd2a7('0x48')]=[{'all':!![]}];}_0x565f3f=_[_0xd2a7('0x41')]({},_0x565f3f,_0x32b9ec[_0xd2a7('0x42')]);return db['SquareOdbc'][_0xd2a7('0x49')](_0x565f3f)['then'](handleEntityNotFound(_0x38d114,null))['then'](respondWithResult(_0x38d114,null))[_0xd2a7('0x44')](handleError(_0x38d114,null));};exports[_0xd2a7('0x4a')]=function(_0x3c6421,_0x3f3329){return db[_0xd2a7('0x2e')][_0xd2a7('0x4a')](_0x3c6421[_0xd2a7('0x4b')],{})[_0xd2a7('0x24')](function(_0x5f2ffa){var _0x5f0f40=_0x3c6421['user']['get']({'plain':!![]});if(!_0x5f0f40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f0f40[_0xd2a7('0x4c')]===_0xd2a7('0x4d')){var _0x42910b=_0x5f2ffa[_0xd2a7('0x4e')]({'plain':!![]});var _0x58c0da=_0xd2a7('0x25');return db[_0xd2a7('0x4f')]['find']({'where':{'name':_0x58c0da,'userProfileId':_0x5f0f40[_0xd2a7('0x50')]},'raw':!![]})[_0xd2a7('0x24')](function(_0x245560){if(_0x245560&&_0x245560[_0xd2a7('0x51')]===0x0){return db['UserProfileResource'][_0xd2a7('0x4a')]({'name':_0x42910b[_0xd2a7('0x2a')],'resourceId':_0x42910b['id'],'type':_0x245560[_0xd2a7('0x2a')],'sectionId':_0x245560['id']},{})[_0xd2a7('0x24')](function(){return _0x5f2ffa;});}else{return _0x5f2ffa;}})['catch'](function(_0x95bf85){logger['error'](_0xd2a7('0x52'),_0x95bf85);throw _0x95bf85;});}return _0x5f2ffa;})[_0xd2a7('0x24')](respondWithResult(_0x3f3329,0xc9))[_0xd2a7('0x44')](handleError(_0x3f3329,null));};exports[_0xd2a7('0x23')]=function(_0x5bafa8,_0xb4a1f6){if(_0x5bafa8[_0xd2a7('0x4b')]['id']){delete _0x5bafa8[_0xd2a7('0x4b')]['id'];}return db[_0xd2a7('0x2e')]['find']({'where':{'id':_0x5bafa8['params']['id']}})[_0xd2a7('0x24')](handleEntityNotFound(_0xb4a1f6,null))[_0xd2a7('0x24')](saveUpdates(_0x5bafa8[_0xd2a7('0x4b')],null))[_0xd2a7('0x24')](respondWithResult(_0xb4a1f6,null))['catch'](handleError(_0xb4a1f6,null));};exports['destroy']=function(_0x23a425,_0x1dd2df){return db[_0xd2a7('0x2e')][_0xd2a7('0x49')]({'where':{'id':_0x23a425[_0xd2a7('0x46')]['id']}})[_0xd2a7('0x24')](handleEntityNotFound(_0x1dd2df,null))[_0xd2a7('0x24')](removeEntity(_0x1dd2df,null))['catch'](handleError(_0x1dd2df,null));};exports[_0xd2a7('0x53')]=function(_0x3bcce0,_0x2f76ea,_0x4f21cf){var _0x3f4fbd;return db[_0xd2a7('0x2e')][_0xd2a7('0x49')]({'where':{'id':_0x3bcce0[_0xd2a7('0x46')]['id']},'attributes':['id',_0xd2a7('0x54')]})[_0xd2a7('0x24')](handleEntityNotFound(_0x2f76ea,null))['then'](function(_0x80418b){if(_0x80418b){var _0xd65b5b=require('odbc')();_0xd65b5b[_0xd2a7('0x55')](_0x80418b[_0xd2a7('0x54')]);_0xd65b5b[_0xd2a7('0x56')]();return _0x80418b;}})[_0xd2a7('0x24')](respondWithResult(_0x2f76ea,null))[_0xd2a7('0x44')](handleError(_0x2f76ea,null));}; \ No newline at end of file +var _0x1080=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ODBC','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','then','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','SquareOdbc','includeAll','include','findAll','rows','catch','length','find'];(function(_0x26f6ac,_0x4e0610){var _0x3386d3=function(_0x4370dd){while(--_0x4370dd){_0x26f6ac['push'](_0x26f6ac['shift']());}};_0x3386d3(++_0x4e0610);}(_0x1080,0x119));var _0x0108=function(_0x284d56,_0x5e983e){_0x284d56=_0x284d56-0x0;var _0x846868=_0x1080[_0x284d56];return _0x846868;};'use strict';var emlformat=require(_0x0108('0x0'));var rimraf=require(_0x0108('0x1'));var zipdir=require(_0x0108('0x2'));var jsonpatch=require(_0x0108('0x3'));var rp=require(_0x0108('0x4'));var moment=require('moment');var BPromise=require(_0x0108('0x5'));var Mustache=require(_0x0108('0x6'));var util=require(_0x0108('0x7'));var path=require(_0x0108('0x8'));var sox=require(_0x0108('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0108('0xa'));var _=require(_0x0108('0xb'));var squel=require(_0x0108('0xc'));var crypto=require('crypto');var jsforce=require(_0x0108('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0108('0xe'));var querystring=require(_0x0108('0xf'));var Papa=require('papaparse');var Redis=require(_0x0108('0x10'));var authService=require(_0x0108('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0108('0x12'));var logger=require(_0x0108('0x13'))(_0x0108('0x14'));var utils=require(_0x0108('0x15'));var config=require(_0x0108('0x16'));var licenseUtil=require(_0x0108('0x17'));var db=require(_0x0108('0x18'))['db'];function respondWithStatusCode(_0x378b66,_0x11fd76){_0x11fd76=_0x11fd76||0xcc;return function(_0x1c584c){if(_0x1c584c){return _0x378b66[_0x0108('0x19')](_0x11fd76);}return _0x378b66[_0x0108('0x1a')](_0x11fd76)[_0x0108('0x1b')]();};}function respondWithResult(_0x24a5bb,_0x4f2f35){_0x4f2f35=_0x4f2f35||0xc8;return function(_0x41e9b1){if(_0x41e9b1){return _0x24a5bb[_0x0108('0x1a')](_0x4f2f35)[_0x0108('0x1c')](_0x41e9b1);}};}function respondWithFilteredResult(_0x3ff74e,_0x5cdb4b){return function(_0xb970a5){if(_0xb970a5){var _0x283eaa=typeof _0x5cdb4b[_0x0108('0x1d')]===_0x0108('0x1e')&&typeof _0x5cdb4b['limit']===_0x0108('0x1e');var _0x4c49de=_0xb970a5[_0x0108('0x1f')];var _0x127213=_0x283eaa?0x0:_0x5cdb4b[_0x0108('0x1d')];var _0x17ee7f=_0x283eaa?_0xb970a5[_0x0108('0x1f')]:_0x5cdb4b[_0x0108('0x1d')]+_0x5cdb4b[_0x0108('0x20')];var _0x397831;if(_0x17ee7f>=_0x4c49de){_0x17ee7f=_0x4c49de;_0x397831=0xc8;}else{_0x397831=0xce;}_0x3ff74e[_0x0108('0x1a')](_0x397831);return _0x3ff74e['set'](_0x0108('0x21'),_0x127213+'-'+_0x17ee7f+'/'+_0x4c49de)[_0x0108('0x1c')](_0xb970a5);}return null;};}function patchUpdates(_0x54d1fb){return function(_0x4e7781){try{jsonpatch[_0x0108('0x22')](_0x4e7781,_0x54d1fb,!![]);}catch(_0x35c402){return BPromise[_0x0108('0x23')](_0x35c402);}return _0x4e7781[_0x0108('0x24')]();};}function saveUpdates(_0x211fbd,_0x1d0665){return function(_0x28bad4){if(_0x28bad4){return _0x28bad4['update'](_0x211fbd)['then'](function(_0x4c54b3){return _0x4c54b3;});}return null;};}function removeEntity(_0x3946a7,_0x46d748){return function(_0x141860){if(_0x141860){return _0x141860[_0x0108('0x25')]()[_0x0108('0x26')](function(){var _0x4587d6=_0x141860['get']({'plain':!![]});var _0x54140a='ODBC';return db[_0x0108('0x27')]['destroy']({'where':{'type':_0x54140a,'resourceId':_0x4587d6['id']}})[_0x0108('0x26')](function(){return _0x141860;});})[_0x0108('0x26')](function(){_0x3946a7[_0x0108('0x1a')](0xcc)[_0x0108('0x1b')]();});}};}function handleEntityNotFound(_0x3751d3,_0x4c897e){return function(_0x41f5c8){if(!_0x41f5c8){_0x3751d3[_0x0108('0x19')](0x194);}return _0x41f5c8;};}function handleError(_0x3576de,_0x5c2e48){_0x5c2e48=_0x5c2e48||0x1f4;return function(_0x56da57){logger['error'](_0x56da57[_0x0108('0x28')]);if(_0x56da57[_0x0108('0x29')]){delete _0x56da57[_0x0108('0x29')];}_0x3576de[_0x0108('0x1a')](_0x5c2e48)[_0x0108('0x2a')](_0x56da57);};}exports['index']=function(_0x35f264,_0x396cef){var _0x538503={},_0x112da0={},_0x2d5d3b={'count':0x0,'rows':[]};var _0x536df3=_[_0x0108('0x2b')](db['SquareOdbc'][_0x0108('0x2c')],function(_0x25c0fd){return{'name':_0x25c0fd[_0x0108('0x2d')],'type':_0x25c0fd['type'][_0x0108('0x2e')]};});_0x112da0['model']=_['map'](_0x536df3,_0x0108('0x29'));_0x112da0[_0x0108('0x2f')]=_[_0x0108('0x30')](_0x35f264[_0x0108('0x2f')]);_0x112da0[_0x0108('0x31')]=_[_0x0108('0x32')](_0x112da0[_0x0108('0x33')],_0x112da0[_0x0108('0x2f')]);_0x538503[_0x0108('0x34')]=_[_0x0108('0x32')](_0x112da0[_0x0108('0x33')],qs[_0x0108('0x35')](_0x35f264['query']['fields']));_0x538503[_0x0108('0x34')]=_0x538503['attributes']['length']?_0x538503['attributes']:_0x112da0['model'];if(!_0x35f264[_0x0108('0x2f')]['hasOwnProperty'](_0x0108('0x36'))){_0x538503['limit']=qs[_0x0108('0x20')](_0x35f264['query'][_0x0108('0x20')]);_0x538503[_0x0108('0x1d')]=qs[_0x0108('0x1d')](_0x35f264[_0x0108('0x2f')][_0x0108('0x1d')]);}_0x538503[_0x0108('0x37')]=qs[_0x0108('0x38')](_0x35f264['query']['sort']);_0x538503[_0x0108('0x39')]=qs[_0x0108('0x31')](_[_0x0108('0x3a')](_0x35f264['query'],_0x112da0[_0x0108('0x31')]),_0x536df3);if(_0x35f264[_0x0108('0x2f')][_0x0108('0x3b')]){_0x538503[_0x0108('0x39')]=_[_0x0108('0x3c')](_0x538503[_0x0108('0x39')],{'$or':_['map'](_0x536df3,function(_0x1ce713){if(_0x1ce713[_0x0108('0x3d')]!=='VIRTUAL'){var _0xbb64f9={};_0xbb64f9[_0x1ce713[_0x0108('0x29')]]={'$like':'%'+_0x35f264['query'][_0x0108('0x3b')]+'%'};return _0xbb64f9;}})});}_0x538503=_[_0x0108('0x3c')]({},_0x538503,_0x35f264[_0x0108('0x3e')]);var _0x5467bc={'where':_0x538503[_0x0108('0x39')]};return db[_0x0108('0x3f')]['count'](_0x5467bc)[_0x0108('0x26')](function(_0x1348f5){_0x2d5d3b[_0x0108('0x1f')]=_0x1348f5;if(_0x35f264[_0x0108('0x2f')][_0x0108('0x40')]){_0x538503[_0x0108('0x41')]=[{'all':!![]}];}return db[_0x0108('0x3f')][_0x0108('0x42')](_0x538503);})[_0x0108('0x26')](function(_0x4f9e4e){_0x2d5d3b[_0x0108('0x43')]=_0x4f9e4e;return _0x2d5d3b;})[_0x0108('0x26')](respondWithFilteredResult(_0x396cef,_0x538503))[_0x0108('0x44')](handleError(_0x396cef,null));};exports['show']=function(_0x30a0e6,_0x5df030){var _0x3ebdfd={'raw':!![],'where':{'id':_0x30a0e6['params']['id']}},_0xffc9cc={};_0xffc9cc[_0x0108('0x33')]=_[_0x0108('0x30')](db[_0x0108('0x3f')]['rawAttributes']);_0xffc9cc[_0x0108('0x2f')]=_[_0x0108('0x30')](_0x30a0e6[_0x0108('0x2f')]);_0xffc9cc['filters']=_['intersection'](_0xffc9cc['model'],_0xffc9cc[_0x0108('0x2f')]);_0x3ebdfd['attributes']=_[_0x0108('0x32')](_0xffc9cc[_0x0108('0x33')],qs[_0x0108('0x35')](_0x30a0e6[_0x0108('0x2f')][_0x0108('0x35')]));_0x3ebdfd[_0x0108('0x34')]=_0x3ebdfd[_0x0108('0x34')][_0x0108('0x45')]?_0x3ebdfd[_0x0108('0x34')]:_0xffc9cc[_0x0108('0x33')];if(_0x30a0e6[_0x0108('0x2f')]['includeAll']){_0x3ebdfd[_0x0108('0x41')]=[{'all':!![]}];}_0x3ebdfd=_[_0x0108('0x3c')]({},_0x3ebdfd,_0x30a0e6[_0x0108('0x3e')]);return db[_0x0108('0x3f')][_0x0108('0x46')](_0x3ebdfd)[_0x0108('0x26')](handleEntityNotFound(_0x5df030,null))[_0x0108('0x26')](respondWithResult(_0x5df030,null))[_0x0108('0x44')](handleError(_0x5df030,null));};exports['create']=function(_0x3cfecf,_0x4e0686){return db[_0x0108('0x3f')][_0x0108('0x47')](_0x3cfecf[_0x0108('0x48')],{})[_0x0108('0x26')](function(_0x1505fd){var _0xa9ced5=_0x3cfecf[_0x0108('0x49')]['get']({'plain':!![]});if(!_0xa9ced5)throw new Error(_0x0108('0x4a'));if(_0xa9ced5[_0x0108('0x4b')]===_0x0108('0x49')){var _0xc2bc13=_0x1505fd[_0x0108('0x4c')]({'plain':!![]});var _0x1e6dcd=_0x0108('0x4d');return db[_0x0108('0x4e')][_0x0108('0x46')]({'where':{'name':_0x1e6dcd,'userProfileId':_0xa9ced5[_0x0108('0x4f')]},'raw':!![]})[_0x0108('0x26')](function(_0x1e4e06){if(_0x1e4e06&&_0x1e4e06['autoAssociation']===0x0){return db[_0x0108('0x27')][_0x0108('0x47')]({'name':_0xc2bc13['name'],'resourceId':_0xc2bc13['id'],'type':_0x1e4e06[_0x0108('0x29')],'sectionId':_0x1e4e06['id']},{})[_0x0108('0x26')](function(){return _0x1505fd;});}else{return _0x1505fd;}})[_0x0108('0x44')](function(_0x2b4f90){logger[_0x0108('0x50')](_0x0108('0x51'),_0x2b4f90);throw _0x2b4f90;});}return _0x1505fd;})[_0x0108('0x26')](respondWithResult(_0x4e0686,0xc9))['catch'](handleError(_0x4e0686,null));};exports[_0x0108('0x52')]=function(_0x483848,_0x2579b6){if(_0x483848[_0x0108('0x48')]['id']){delete _0x483848[_0x0108('0x48')]['id'];}return db[_0x0108('0x3f')]['find']({'where':{'id':_0x483848[_0x0108('0x53')]['id']}})['then'](handleEntityNotFound(_0x2579b6,null))['then'](saveUpdates(_0x483848['body'],null))['then'](respondWithResult(_0x2579b6,null))[_0x0108('0x44')](handleError(_0x2579b6,null));};exports[_0x0108('0x25')]=function(_0x1365e4,_0x3245c3){return db[_0x0108('0x3f')]['find']({'where':{'id':_0x1365e4[_0x0108('0x53')]['id']}})[_0x0108('0x26')](handleEntityNotFound(_0x3245c3,null))[_0x0108('0x26')](removeEntity(_0x3245c3,null))[_0x0108('0x44')](handleError(_0x3245c3,null));};exports[_0x0108('0x54')]=function(_0x4b4233,_0x5eba31,_0x26b50a){var _0x102331;return db[_0x0108('0x3f')][_0x0108('0x46')]({'where':{'id':_0x4b4233[_0x0108('0x53')]['id']},'attributes':['id',_0x0108('0x55')]})[_0x0108('0x26')](handleEntityNotFound(_0x5eba31,null))['then'](function(_0x2aeb29){if(_0x2aeb29){var _0xa5a1c5=require(_0x0108('0x56'))();_0xa5a1c5[_0x0108('0x57')](_0x2aeb29[_0x0108('0x55')]);_0xa5a1c5['closeSync']();return _0x2aeb29;}})['then'](respondWithResult(_0x5eba31,null))['catch'](handleError(_0x5eba31,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index c89af29..7995955 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 _0xe1a7=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0xe34e7d,_0xb3df4c){var _0x1eec75=function(_0xda4097){while(--_0xda4097){_0xe34e7d['push'](_0xe34e7d['shift']());}};_0x1eec75(++_0xb3df4c);}(_0xe1a7,0x102));var _0x7e1a=function(_0x19ad73,_0x421221){_0x19ad73=_0x19ad73-0x0;var _0x5e77ee=_0xe1a7[_0x19ad73];return _0x5e77ee;};'use strict';var _=require('lodash');var util=require(_0x7e1a('0x0'));var logger=require(_0x7e1a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7e1a('0x2'));var rp=require(_0x7e1a('0x3'));var fs=require('fs');var path=require(_0x7e1a('0x4'));var rimraf=require(_0x7e1a('0x5'));var config=require(_0x7e1a('0x6'));var attributes=require(_0x7e1a('0x7'));module[_0x7e1a('0x8')]=function(_0x226b7b,_0x13a3f5){return _0x226b7b[_0x7e1a('0x9')](_0x7e1a('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9137=['./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3136e3,_0x25c2a7){var _0x1de961=function(_0x3ae9b4){while(--_0x3ae9b4){_0x3136e3['push'](_0x3136e3['shift']());}};_0x1de961(++_0x25c2a7);}(_0x9137,0x79));var _0x7913=function(_0x5a164c,_0x44d73a){_0x5a164c=_0x5a164c-0x0;var _0x17a713=_0x9137[_0x5a164c];return _0x17a713;};'use strict';var _=require(_0x7913('0x0'));var util=require(_0x7913('0x1'));var logger=require(_0x7913('0x2'))(_0x7913('0x3'));var moment=require(_0x7913('0x4'));var BPromise=require(_0x7913('0x5'));var rp=require(_0x7913('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7913('0x7'));var config=require(_0x7913('0x8'));var attributes=require(_0x7913('0x9'));module[_0x7913('0xa')]=function(_0x16c693,_0x5df1a8){return _0x16c693['define'](_0x7913('0xb'),attributes,{'tableName':_0x7913('0xc'),'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 96e94e4..bb84e2a 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 _0xdf07=['find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x463119,_0x4118c0){var _0x1b8b37=function(_0x43084e){while(--_0x43084e){_0x463119['push'](_0x463119['shift']());}};_0x1b8b37(++_0x4118c0);}(_0xdf07,0x9d));var _0x7df0=function(_0x21260f,_0x40af26){_0x21260f=_0x21260f-0x0;var _0x4153d2=_0xdf07[_0x21260f];return _0x4153d2;};'use strict';var _=require(_0x7df0('0x0'));var util=require(_0x7df0('0x1'));var moment=require(_0x7df0('0x2'));var BPromise=require(_0x7df0('0x3'));var rs=require(_0x7df0('0x4'));var fs=require('fs');var Redis=require(_0x7df0('0x5'));var db=require(_0x7df0('0x6'))['db'];var utils=require(_0x7df0('0x7'));var logger=require(_0x7df0('0x8'))(_0x7df0('0x9'));var config=require(_0x7df0('0xa'));var jayson=require(_0x7df0('0xb'));var client=jayson[_0x7df0('0xc')][_0x7df0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5056bf,_0x4335d8,_0x40066e){return new BPromise(function(_0x52c3f4,_0x33570f){return client[_0x7df0('0xe')](_0x5056bf,_0x40066e)[_0x7df0('0xf')](function(_0x9a20e9){logger[_0x7df0('0x10')](_0x7df0('0x11'),_0x4335d8,_0x7df0('0x12'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4335d8,_0x7df0('0x12'),JSON[_0x7df0('0x13')](_0x9a20e9));if(_0x9a20e9[_0x7df0('0x14')]){if(_0x9a20e9['error']['code']===0x1f4){logger[_0x7df0('0x14')](_0x7df0('0x11'),_0x4335d8,_0x9a20e9[_0x7df0('0x14')]['message']);return _0x33570f(_0x9a20e9[_0x7df0('0x14')]['message']);}logger[_0x7df0('0x14')](_0x7df0('0x11'),_0x4335d8,_0x9a20e9[_0x7df0('0x14')][_0x7df0('0x15')]);return _0x52c3f4(_0x9a20e9[_0x7df0('0x14')][_0x7df0('0x15')]);}else{logger['info'](_0x7df0('0x11'),_0x4335d8,_0x7df0('0x12'));_0x52c3f4(_0x9a20e9['result'][_0x7df0('0x15')]);}})[_0x7df0('0x16')](function(_0x548f5e){logger[_0x7df0('0x14')](_0x7df0('0x11'),_0x4335d8,_0x548f5e);_0x33570f(_0x548f5e);});});}exports['ShowSquareOdbc']=function(_0xe5faee){var _0x4a4bd0=this;return new Promise(function(_0x33003c,_0x435c37){return db['SquareOdbc'][_0x7df0('0x17')]({'raw':_0xe5faee[_0x7df0('0x18')]?_0xe5faee[_0x7df0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xe5faee[_0x7df0('0x18')]?_0xe5faee[_0x7df0('0x18')][_0x7df0('0x19')]||null:null,'attributes':_0xe5faee['options']?_0xe5faee[_0x7df0('0x18')][_0x7df0('0x1a')]||null:null,'include':_0xe5faee[_0x7df0('0x18')]?_0xe5faee[_0x7df0('0x18')][_0x7df0('0x1b')]?_[_0x7df0('0x1c')](_0xe5faee[_0x7df0('0x18')]['include'],function(_0x164677){return{'model':db[_0x164677[_0x7df0('0x1d')]],'as':_0x164677['as'],'attributes':_0x164677[_0x7df0('0x1a')],'include':_0x164677[_0x7df0('0x1b')]?_[_0x7df0('0x1c')](_0x164677[_0x7df0('0x1b')],function(_0x49c7e1){return{'model':db[_0x49c7e1[_0x7df0('0x1d')]],'as':_0x49c7e1['as'],'attributes':_0x49c7e1['attributes'],'include':_0x49c7e1[_0x7df0('0x1b')]?_[_0x7df0('0x1c')](_0x49c7e1[_0x7df0('0x1b')],function(_0x5ce901){return{'model':db[_0x5ce901[_0x7df0('0x1d')]],'as':_0x5ce901['as'],'attributes':_0x5ce901['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f8ded){logger['info']('ShowSquareOdbc',_0xe5faee);logger['debug']('ShowSquareOdbc',_0xe5faee,JSON[_0x7df0('0x13')](_0x2f8ded));_0x33003c(_0x2f8ded);})['catch'](function(_0x6d95da){logger[_0x7df0('0x14')]('ShowSquareOdbc',_0x6d95da['message'],_0xe5faee);_0x435c37(_0x4a4bd0[_0x7df0('0x14')](0x1f4,_0x6d95da[_0x7df0('0x15')]));});});}; \ No newline at end of file +var _0x38ae=['request\x20sent','error','code','message','result','options','raw','attributes','include','map','model','ShowSquareOdbc','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','SquareOdbc,\x20%s,\x20%s','debug'];(function(_0x22799d,_0x46b4bf){var _0x152e2c=function(_0x35dc76){while(--_0x35dc76){_0x22799d['push'](_0x22799d['shift']());}};_0x152e2c(++_0x46b4bf);}(_0x38ae,0x9a));var _0xe38a=function(_0x2c4b73,_0x3e6ce9){_0x2c4b73=_0x2c4b73-0x0;var _0x4aa12b=_0x38ae[_0x2c4b73];return _0x4aa12b;};'use strict';var _=require(_0xe38a('0x0'));var util=require(_0xe38a('0x1'));var moment=require(_0xe38a('0x2'));var BPromise=require(_0xe38a('0x3'));var rs=require(_0xe38a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe38a('0x5'))['db'];var utils=require(_0xe38a('0x6'));var logger=require(_0xe38a('0x7'))('rpc');var config=require(_0xe38a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe38a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3677d5,_0x3c97dd,_0x3ec642){return new BPromise(function(_0x5c746e,_0x4cd29c){return client['request'](_0x3677d5,_0x3ec642)[_0xe38a('0xa')](function(_0x5eb539){logger[_0xe38a('0xb')](_0xe38a('0xc'),_0x3c97dd,'request\x20sent');logger[_0xe38a('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3c97dd,_0xe38a('0xe'),JSON['stringify'](_0x5eb539));if(_0x5eb539[_0xe38a('0xf')]){if(_0x5eb539[_0xe38a('0xf')][_0xe38a('0x10')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x3c97dd,_0x5eb539[_0xe38a('0xf')]['message']);return _0x4cd29c(_0x5eb539[_0xe38a('0xf')][_0xe38a('0x11')]);}logger['error'](_0xe38a('0xc'),_0x3c97dd,_0x5eb539['error']['message']);return _0x5c746e(_0x5eb539[_0xe38a('0xf')][_0xe38a('0x11')]);}else{logger[_0xe38a('0xb')](_0xe38a('0xc'),_0x3c97dd,_0xe38a('0xe'));_0x5c746e(_0x5eb539[_0xe38a('0x12')]['message']);}})['catch'](function(_0x570744){logger['error'](_0xe38a('0xc'),_0x3c97dd,_0x570744);_0x4cd29c(_0x570744);});});}exports['ShowSquareOdbc']=function(_0x4eb297){var _0x4ecf73=this;return new Promise(function(_0x3ffc11,_0x265a4d){return db['SquareOdbc']['find']({'raw':_0x4eb297[_0xe38a('0x13')]?_0x4eb297['options'][_0xe38a('0x14')]===undefined?!![]:![]:!![],'where':_0x4eb297[_0xe38a('0x13')]?_0x4eb297[_0xe38a('0x13')]['where']||null:null,'attributes':_0x4eb297[_0xe38a('0x13')]?_0x4eb297[_0xe38a('0x13')][_0xe38a('0x15')]||null:null,'include':_0x4eb297[_0xe38a('0x13')]?_0x4eb297[_0xe38a('0x13')]['include']?_['map'](_0x4eb297[_0xe38a('0x13')][_0xe38a('0x16')],function(_0x27ff80){return{'model':db[_0x27ff80['model']],'as':_0x27ff80['as'],'attributes':_0x27ff80[_0xe38a('0x15')],'include':_0x27ff80[_0xe38a('0x16')]?_[_0xe38a('0x17')](_0x27ff80['include'],function(_0x1d7d65){return{'model':db[_0x1d7d65[_0xe38a('0x18')]],'as':_0x1d7d65['as'],'attributes':_0x1d7d65[_0xe38a('0x15')],'include':_0x1d7d65['include']?_['map'](_0x1d7d65['include'],function(_0x1fb4c0){return{'model':db[_0x1fb4c0[_0xe38a('0x18')]],'as':_0x1fb4c0['as'],'attributes':_0x1fb4c0[_0xe38a('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x285a41){logger[_0xe38a('0xb')]('ShowSquareOdbc',_0x4eb297);logger[_0xe38a('0xd')](_0xe38a('0x19'),_0x4eb297,JSON[_0xe38a('0x1a')](_0x285a41));_0x3ffc11(_0x285a41);})[_0xe38a('0x1b')](function(_0x3c701b){logger[_0xe38a('0xf')](_0xe38a('0x19'),_0x3c701b[_0xe38a('0x11')],_0x4eb297);_0x265a4d(_0x4ecf73[_0xe38a('0xf')](0x1f4,_0x3c701b[_0xe38a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 21bff3e..2c4f084 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 _0xdf10=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareProject.controller','isAuthenticated','index','/:id','show','create','update'];(function(_0x3d604c,_0x264b68){var _0x378a49=function(_0x5be492){while(--_0x5be492){_0x3d604c['push'](_0x3d604c['shift']());}};_0x378a49(++_0x264b68);}(_0xdf10,0xcf));var _0x0df1=function(_0x215376,_0x5290f6){_0x215376=_0x215376-0x0;var _0x260620=_0xdf10[_0x215376];return _0x260620;};'use strict';var multer=require('multer');var util=require(_0x0df1('0x0'));var path=require(_0x0df1('0x1'));var timeout=require(_0x0df1('0x2'));var express=require(_0x0df1('0x3'));var router=express[_0x0df1('0x4')]();var fs_extra=require(_0x0df1('0x5'));var auth=require(_0x0df1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0df1('0x7'));router['get']('/',auth[_0x0df1('0x8')](),controller[_0x0df1('0x9')]);router['get'](_0x0df1('0xa'),auth[_0x0df1('0x8')](),controller[_0x0df1('0xb')]);router['post']('/',auth[_0x0df1('0x8')](),controller[_0x0df1('0xc')]);router['put'](_0x0df1('0xa'),auth[_0x0df1('0x8')](),controller[_0x0df1('0xd')]);router[_0x0df1('0xe')](_0x0df1('0xa'),auth['isAuthenticated'](),controller[_0x0df1('0xf')]);module[_0x0df1('0x10')]=router; \ No newline at end of file +var _0x38bd=['isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util','connect-timeout','fs-extra','../../config/environment','./squareProject.controller','get'];(function(_0x76ae2f,_0x3cc477){var _0x587f5c=function(_0x3b36ca){while(--_0x3b36ca){_0x76ae2f['push'](_0x76ae2f['shift']());}};_0x587f5c(++_0x3cc477);}(_0x38bd,0x152));var _0xd38b=function(_0x5c8841,_0x1d58ea){_0x5c8841=_0x5c8841-0x0;var _0x2789df=_0x38bd[_0x5c8841];return _0x2789df;};'use strict';var multer=require(_0xd38b('0x0'));var util=require(_0xd38b('0x1'));var path=require('path');var timeout=require(_0xd38b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd38b('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd38b('0x4'));var controller=require(_0xd38b('0x5'));router[_0xd38b('0x6')]('/',auth[_0xd38b('0x7')](),controller[_0xd38b('0x8')]);router['get'](_0xd38b('0x9'),auth[_0xd38b('0x7')](),controller[_0xd38b('0xa')]);router['post']('/',auth[_0xd38b('0x7')](),controller[_0xd38b('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd38b('0xc')]);router[_0xd38b('0xd')](_0xd38b('0x9'),auth[_0xd38b('0x7')](),controller[_0xd38b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7d8d507..222e3ff 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 _0xc26e=['TEXT','BLOB','long','preproduction','toString','utf8','production','getDataValue','DATE','STRING'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xc26e,0x103));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xec26('0x0')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xec26('0x0')]},'notes':{'type':Sequelize[_0xec26('0x1')]},'preproduction':{'type':Sequelize[_0xec26('0x2')](_0xec26('0x3')),'get':function(){if(this['getDataValue'](_0xec26('0x4'))){return this['getDataValue']('preproduction')[_0xec26('0x5')](_0xec26('0x6'));}}},'production':{'type':Sequelize[_0xec26('0x2')]('long'),'get':function(){if(this['getDataValue'](_0xec26('0x7'))){return this[_0xec26('0x8')](_0xec26('0x7'))[_0xec26('0x5')](_0xec26('0x6'));}}},'savedAt':{'type':Sequelize[_0xec26('0x9')]},'publishedAt':{'type':Sequelize[_0xec26('0x9')]}}; \ No newline at end of file +var _0x7455=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','exports','STRING','name'];(function(_0xf949f1,_0x3662ec){var _0x2f9e80=function(_0x34e112){while(--_0x34e112){_0xf949f1['push'](_0xf949f1['shift']());}};_0x2f9e80(++_0x3662ec);}(_0x7455,0x17d));var _0x5745=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7455[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5745('0x0')]={'name':{'type':Sequelize[_0x5745('0x1')],'unique':_0x5745('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5745('0x1')]},'notes':{'type':Sequelize[_0x5745('0x3')]},'preproduction':{'type':Sequelize[_0x5745('0x4')](_0x5745('0x5')),'get':function(){if(this[_0x5745('0x6')]('preproduction')){return this[_0x5745('0x6')](_0x5745('0x7'))[_0x5745('0x8')](_0x5745('0x9'));}}},'production':{'type':Sequelize[_0x5745('0x4')]('long'),'get':function(){if(this[_0x5745('0x6')]('production')){return this['getDataValue'](_0x5745('0xa'))[_0x5745('0x8')](_0x5745('0x9'));}}},'savedAt':{'type':Sequelize[_0x5745('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 54503a3..fefce71 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 _0x9f99=['params','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','register','status','json','offset','limit','undefined','count','Content-Range','then','destroy','SquareProjects','UserProfileResource','publish','stringify','end','sendStatus','error','stack','send','index','map','SquareProject','rawAttributes','type','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','agi','pick','production'];(function(_0x399cb4,_0x30bd73){var _0x41c0e3=function(_0x5fcbd){while(--_0x5fcbd){_0x399cb4['push'](_0x399cb4['shift']());}};_0x41c0e3(++_0x30bd73);}(_0x9f99,0x109));var _0x99f9=function(_0x519fbd,_0x1b066d){_0x519fbd=_0x519fbd-0x0;var _0x543578=_0x9f99[_0x519fbd];return _0x543578;};'use strict';var _=require(_0x99f9('0x0'));var Redis=require('ioredis');var qs=require(_0x99f9('0x1'));var logger=require(_0x99f9('0x2'))('api');var config=require('../../config/environment');var db=require(_0x99f9('0x3'))['db'];config['redis']=_['defaults'](config[_0x99f9('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x99f9('0x5'))(new Redis(config['redis']));require('./squareProject.socket')[_0x99f9('0x6')](socket);function respondWithResult(_0x5949b3,_0x1cc854){_0x1cc854=_0x1cc854||0xc8;return function(_0x5549d8){if(_0x5549d8){return _0x5949b3[_0x99f9('0x7')](_0x1cc854)[_0x99f9('0x8')](_0x5549d8);}};}function respondWithFilteredResult(_0x565d7b,_0x1a0e56){return function(_0x267960){if(_0x267960){var _0x492b2e=typeof _0x1a0e56[_0x99f9('0x9')]==='undefined'&&typeof _0x1a0e56[_0x99f9('0xa')]===_0x99f9('0xb');var _0x1e4e75=_0x267960[_0x99f9('0xc')];var _0x133691=_0x492b2e?0x0:_0x1a0e56['offset'];var _0x4bb59f=_0x492b2e?_0x267960['count']:_0x1a0e56[_0x99f9('0x9')]+_0x1a0e56[_0x99f9('0xa')];var _0x5b608f;if(_0x4bb59f>=_0x1e4e75){_0x4bb59f=_0x1e4e75;_0x5b608f=0xc8;}else{_0x5b608f=0xce;}_0x565d7b[_0x99f9('0x7')](_0x5b608f);return _0x565d7b['set'](_0x99f9('0xd'),_0x133691+'-'+_0x4bb59f+'/'+_0x1e4e75)[_0x99f9('0x8')](_0x267960);}return null;};}function saveUpdates(_0x29ce30){return function(_0x38c75e){if(_0x38c75e){return _0x38c75e['update'](_0x29ce30)[_0x99f9('0xe')](function(_0x4b62f8){return _0x4b62f8;});}return null;};}function removeEntity(_0x3768fa){return function(_0x1bca04){if(_0x1bca04){return _0x1bca04[_0x99f9('0xf')]()['then'](function(){var _0x311a92=_0x1bca04['get']({'plain':!![]});var _0x57a9f5=_0x99f9('0x10');return db[_0x99f9('0x11')][_0x99f9('0xf')]({'where':{'type':_0x57a9f5,'resourceId':_0x311a92['id']}})['then'](function(){return _0x1bca04;});})['then'](function(){var _0x5a5301=new Redis(config[_0x99f9('0x4')]);_0x5a5301[_0x99f9('0x12')]('agi',JSON[_0x99f9('0x13')]({'id':_0x1bca04['id'],'deleted':!![]}));})[_0x99f9('0xe')](function(){_0x3768fa[_0x99f9('0x7')](0xcc)[_0x99f9('0x14')]();});}};}function handleEntityNotFound(_0x2b78da){return function(_0x4e40ac){if(!_0x4e40ac){_0x2b78da[_0x99f9('0x15')](0x194);}return _0x4e40ac;};}function handleError(_0x457574,_0x218ab0){_0x218ab0=_0x218ab0||0x1f4;return function(_0x1c31ef){logger[_0x99f9('0x16')](_0x1c31ef[_0x99f9('0x17')]);if(_0x1c31ef['name']){delete _0x1c31ef['name'];}_0x457574[_0x99f9('0x7')](_0x218ab0)[_0x99f9('0x18')](_0x1c31ef);};}exports[_0x99f9('0x19')]=function(_0x41979b,_0x29bad7){var _0x1a1ad9={},_0x153d3e={},_0x26676d={'count':0x0,'rows':[]};var _0x5b2267=_[_0x99f9('0x1a')](db[_0x99f9('0x1b')][_0x99f9('0x1c')],function(_0x2ad10d){return{'name':_0x2ad10d['fieldName'],'type':_0x2ad10d[_0x99f9('0x1d')]['key']};});_0x153d3e['model']=_[_0x99f9('0x1a')](_0x5b2267,_0x99f9('0x1e'));_0x153d3e[_0x99f9('0x1f')]=_[_0x99f9('0x20')](_0x41979b['query']);_0x153d3e[_0x99f9('0x21')]=_[_0x99f9('0x22')](_0x153d3e[_0x99f9('0x23')],_0x153d3e[_0x99f9('0x1f')]);_0x1a1ad9['attributes']=_[_0x99f9('0x22')](_0x153d3e['model'],qs[_0x99f9('0x24')](_0x41979b[_0x99f9('0x1f')][_0x99f9('0x24')]));_0x1a1ad9[_0x99f9('0x25')]=_0x1a1ad9[_0x99f9('0x25')][_0x99f9('0x26')]?_0x1a1ad9[_0x99f9('0x25')]:_0x153d3e[_0x99f9('0x23')];if(!_0x41979b[_0x99f9('0x1f')][_0x99f9('0x27')]('nolimit')){_0x1a1ad9[_0x99f9('0xa')]=qs['limit'](_0x41979b[_0x99f9('0x1f')][_0x99f9('0xa')]);_0x1a1ad9['offset']=qs['offset'](_0x41979b['query'][_0x99f9('0x9')]);}_0x1a1ad9[_0x99f9('0x28')]=qs[_0x99f9('0x29')](_0x41979b[_0x99f9('0x1f')][_0x99f9('0x29')]);_0x1a1ad9[_0x99f9('0x2a')]=qs[_0x99f9('0x21')](_['pick'](_0x41979b[_0x99f9('0x1f')],_0x153d3e['filters']),_0x5b2267);if(_0x41979b[_0x99f9('0x1f')][_0x99f9('0x2b')]){_0x1a1ad9[_0x99f9('0x2a')]=_[_0x99f9('0x2c')](_0x1a1ad9[_0x99f9('0x2a')],{'$or':_[_0x99f9('0x1a')](_0x5b2267,function(_0x210ffd){if(_0x210ffd['type']!==_0x99f9('0x2d')){var _0x3806fe={};_0x3806fe[_0x210ffd[_0x99f9('0x1e')]]={'$like':'%'+_0x41979b[_0x99f9('0x1f')][_0x99f9('0x2b')]+'%'};return _0x3806fe;}})});}_0x1a1ad9=_['merge']({},_0x1a1ad9,_0x41979b[_0x99f9('0x2e')]);var _0x1666ed={'where':_0x1a1ad9[_0x99f9('0x2a')]};return db[_0x99f9('0x1b')][_0x99f9('0xc')](_0x1666ed)['then'](function(_0x212c12){_0x26676d[_0x99f9('0xc')]=_0x212c12;if(_0x41979b[_0x99f9('0x1f')][_0x99f9('0x2f')]){_0x1a1ad9[_0x99f9('0x30')]=[{'all':!![]}];}return db[_0x99f9('0x1b')]['findAll'](_0x1a1ad9);})[_0x99f9('0xe')](function(_0x52829e){_0x26676d[_0x99f9('0x31')]=_0x52829e;return _0x26676d;})[_0x99f9('0xe')](respondWithFilteredResult(_0x29bad7,_0x1a1ad9))[_0x99f9('0x32')](handleError(_0x29bad7,null));};exports['show']=function(_0x1b49b,_0x5d68f8){var _0x401406={'raw':![],'where':{'id':_0x1b49b['params']['id']}},_0x411160={};_0x411160['model']=_[_0x99f9('0x20')](db[_0x99f9('0x1b')]['rawAttributes']);_0x411160[_0x99f9('0x1f')]=_['keys'](_0x1b49b[_0x99f9('0x1f')]);_0x411160['filters']=_['intersection'](_0x411160[_0x99f9('0x23')],_0x411160['query']);_0x401406[_0x99f9('0x25')]=_[_0x99f9('0x22')](_0x411160[_0x99f9('0x23')],qs[_0x99f9('0x24')](_0x1b49b[_0x99f9('0x1f')]['fields']));_0x401406[_0x99f9('0x25')]=_0x401406[_0x99f9('0x25')][_0x99f9('0x26')]?_0x401406[_0x99f9('0x25')]:_0x411160[_0x99f9('0x23')];if(_0x1b49b['query'][_0x99f9('0x2f')]){_0x401406[_0x99f9('0x30')]=[{'all':!![]}];}_0x401406=_[_0x99f9('0x2c')]({},_0x401406,_0x1b49b[_0x99f9('0x2e')]);return db[_0x99f9('0x1b')][_0x99f9('0x33')](_0x401406)['then'](handleEntityNotFound(_0x5d68f8,null))[_0x99f9('0xe')](respondWithResult(_0x5d68f8,null))['catch'](handleError(_0x5d68f8,null));};exports['create']=function(_0x4980ed,_0x58586c){return db['SquareProject'][_0x99f9('0x34')](_0x4980ed[_0x99f9('0x35')],{})[_0x99f9('0xe')](function(_0x8a7c42){var _0x2e5d2d=_0x4980ed[_0x99f9('0x36')][_0x99f9('0x37')]({'plain':!![]});if(!_0x2e5d2d)throw new Error(_0x99f9('0x38'));if(_0x2e5d2d[_0x99f9('0x39')]===_0x99f9('0x36')){var _0x32f86a=_0x8a7c42['get']({'plain':!![]});var _0x397fb8=_0x99f9('0x10');return db['UserProfileSection'][_0x99f9('0x33')]({'where':{'name':_0x397fb8,'userProfileId':_0x2e5d2d[_0x99f9('0x3a')]},'raw':!![]})[_0x99f9('0xe')](function(_0xb8e8a1){if(_0xb8e8a1&&_0xb8e8a1[_0x99f9('0x3b')]===0x0){return db[_0x99f9('0x11')]['create']({'name':_0x32f86a[_0x99f9('0x1e')],'resourceId':_0x32f86a['id'],'type':_0xb8e8a1['name'],'sectionId':_0xb8e8a1['id']},{})[_0x99f9('0xe')](function(){return _0x8a7c42;});}else{return _0x8a7c42;}})[_0x99f9('0x32')](function(_0x1825d1){logger[_0x99f9('0x16')](_0x99f9('0x3c'),_0x1825d1);throw _0x1825d1;});}return _0x8a7c42;})[_0x99f9('0xe')](respondWithResult(_0x58586c,0xc9))[_0x99f9('0x32')](handleError(_0x58586c,null));};exports[_0x99f9('0x3d')]=function(_0x3aa43c,_0x384e15){if(_0x3aa43c[_0x99f9('0x35')]['id']){delete _0x3aa43c['body']['id'];}return db['SquareProject']['find']({'where':{'id':_0x3aa43c['params']['id']}})[_0x99f9('0xe')](handleEntityNotFound(_0x384e15,null))['then'](saveUpdates(_0x3aa43c[_0x99f9('0x35')],null))[_0x99f9('0xe')](function(_0x37781f){if(!_0x37781f)return;var _0x515240=_0x37781f['get']({'plain':!![]});return _0x515240;})['then'](function(_0x3a6fa2){var _0x20da42=new Redis(config['redis']);_0x20da42[_0x99f9('0x12')](_0x99f9('0x3e'),JSON[_0x99f9('0x13')](_[_0x99f9('0x3f')](_0x3a6fa2,['id','name',_0x99f9('0x40')])));return _0x3a6fa2;})['then'](respondWithResult(_0x384e15,null))[_0x99f9('0x32')](handleError(_0x384e15,null));};exports[_0x99f9('0xf')]=function(_0x163785,_0x4021bd){return db['SquareProject'][_0x99f9('0x33')]({'where':{'id':_0x163785[_0x99f9('0x41')]['id']}})[_0x99f9('0xe')](handleEntityNotFound(_0x4021bd,null))[_0x99f9('0xe')](removeEntity(_0x4021bd,null))['catch'](handleError(_0x4021bd,null));}; \ No newline at end of file +var _0x16df=['find','UserProfileResource','stringify','production','destroy','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','get','SquareProjects','agi','end','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','catch','show','params','intersection','length','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x548b46,_0x18ed41){var _0x3b9d65=function(_0x26c020){while(--_0x26c020){_0x548b46['push'](_0x548b46['shift']());}};_0x3b9d65(++_0x18ed41);}(_0x16df,0x145));var _0xf16d=function(_0x2f48bb,_0x4d2f89){_0x2f48bb=_0x2f48bb-0x0;var _0x2a9a31=_0x16df[_0x2f48bb];return _0x2a9a31;};'use strict';var _=require(_0xf16d('0x0'));var Redis=require(_0xf16d('0x1'));var qs=require(_0xf16d('0x2'));var logger=require('../../config/logger')(_0xf16d('0x3'));var config=require(_0xf16d('0x4'));var db=require('../../mysqldb')['db'];config[_0xf16d('0x5')]=_[_0xf16d('0x6')](config['redis'],{'host':_0xf16d('0x7'),'port':0x18eb});var socket=require(_0xf16d('0x8'))(new Redis(config[_0xf16d('0x5')]));require(_0xf16d('0x9'))[_0xf16d('0xa')](socket);function respondWithResult(_0x3ec84f,_0xb9a68c){_0xb9a68c=_0xb9a68c||0xc8;return function(_0x4cb8ca){if(_0x4cb8ca){return _0x3ec84f[_0xf16d('0xb')](_0xb9a68c)[_0xf16d('0xc')](_0x4cb8ca);}};}function respondWithFilteredResult(_0x2b188c,_0x5a2fc0){return function(_0x33376f){if(_0x33376f){var _0x4d2073=typeof _0x5a2fc0[_0xf16d('0xd')]===_0xf16d('0xe')&&typeof _0x5a2fc0[_0xf16d('0xf')]===_0xf16d('0xe');var _0x1909eb=_0x33376f[_0xf16d('0x10')];var _0xf204e4=_0x4d2073?0x0:_0x5a2fc0[_0xf16d('0xd')];var _0xc33185=_0x4d2073?_0x33376f[_0xf16d('0x10')]:_0x5a2fc0[_0xf16d('0xd')]+_0x5a2fc0[_0xf16d('0xf')];var _0x14b6bf;if(_0xc33185>=_0x1909eb){_0xc33185=_0x1909eb;_0x14b6bf=0xc8;}else{_0x14b6bf=0xce;}_0x2b188c[_0xf16d('0xb')](_0x14b6bf);return _0x2b188c['set'](_0xf16d('0x11'),_0xf204e4+'-'+_0xc33185+'/'+_0x1909eb)[_0xf16d('0xc')](_0x33376f);}return null;};}function saveUpdates(_0x525178){return function(_0x43292e){if(_0x43292e){return _0x43292e[_0xf16d('0x12')](_0x525178)['then'](function(_0x573473){return _0x573473;});}return null;};}function removeEntity(_0x16e6a4){return function(_0x16ef43){if(_0x16ef43){return _0x16ef43['destroy']()[_0xf16d('0x13')](function(){var _0x1bc860=_0x16ef43[_0xf16d('0x14')]({'plain':!![]});var _0x4fb26e=_0xf16d('0x15');return db['UserProfileResource']['destroy']({'where':{'type':_0x4fb26e,'resourceId':_0x1bc860['id']}})['then'](function(){return _0x16ef43;});})[_0xf16d('0x13')](function(){var _0x3f7cbd=new Redis(config[_0xf16d('0x5')]);_0x3f7cbd['publish'](_0xf16d('0x16'),JSON['stringify']({'id':_0x16ef43['id'],'deleted':!![]}));})[_0xf16d('0x13')](function(){_0x16e6a4[_0xf16d('0xb')](0xcc)[_0xf16d('0x17')]();});}};}function handleEntityNotFound(_0x284ba7){return function(_0x1ab1ea){if(!_0x1ab1ea){_0x284ba7[_0xf16d('0x18')](0x194);}return _0x1ab1ea;};}function handleError(_0x3a827b,_0x1a4372){_0x1a4372=_0x1a4372||0x1f4;return function(_0x5e8c07){logger[_0xf16d('0x19')](_0x5e8c07[_0xf16d('0x1a')]);if(_0x5e8c07[_0xf16d('0x1b')]){delete _0x5e8c07[_0xf16d('0x1b')];}_0x3a827b[_0xf16d('0xb')](_0x1a4372)[_0xf16d('0x1c')](_0x5e8c07);};}exports['index']=function(_0x5abf2a,_0x54172a){var _0xe9fd58={},_0x3deee5={},_0xc43413={'count':0x0,'rows':[]};var _0x235769=_[_0xf16d('0x1d')](db['SquareProject'][_0xf16d('0x1e')],function(_0x27cee3){return{'name':_0x27cee3['fieldName'],'type':_0x27cee3[_0xf16d('0x1f')][_0xf16d('0x20')]};});_0x3deee5[_0xf16d('0x21')]=_[_0xf16d('0x1d')](_0x235769,'name');_0x3deee5[_0xf16d('0x22')]=_[_0xf16d('0x23')](_0x5abf2a['query']);_0x3deee5[_0xf16d('0x24')]=_['intersection'](_0x3deee5['model'],_0x3deee5[_0xf16d('0x22')]);_0xe9fd58[_0xf16d('0x25')]=_['intersection'](_0x3deee5[_0xf16d('0x21')],qs[_0xf16d('0x26')](_0x5abf2a['query'][_0xf16d('0x26')]));_0xe9fd58['attributes']=_0xe9fd58['attributes']['length']?_0xe9fd58[_0xf16d('0x25')]:_0x3deee5[_0xf16d('0x21')];if(!_0x5abf2a[_0xf16d('0x22')][_0xf16d('0x27')]('nolimit')){_0xe9fd58[_0xf16d('0xf')]=qs[_0xf16d('0xf')](_0x5abf2a[_0xf16d('0x22')][_0xf16d('0xf')]);_0xe9fd58[_0xf16d('0xd')]=qs['offset'](_0x5abf2a[_0xf16d('0x22')][_0xf16d('0xd')]);}_0xe9fd58['order']=qs[_0xf16d('0x28')](_0x5abf2a['query']['sort']);_0xe9fd58[_0xf16d('0x29')]=qs[_0xf16d('0x24')](_[_0xf16d('0x2a')](_0x5abf2a[_0xf16d('0x22')],_0x3deee5[_0xf16d('0x24')]),_0x235769);if(_0x5abf2a[_0xf16d('0x22')][_0xf16d('0x2b')]){_0xe9fd58[_0xf16d('0x29')]=_[_0xf16d('0x2c')](_0xe9fd58[_0xf16d('0x29')],{'$or':_['map'](_0x235769,function(_0x4946fc){if(_0x4946fc[_0xf16d('0x1f')]!==_0xf16d('0x2d')){var _0xfd9dc7={};_0xfd9dc7[_0x4946fc[_0xf16d('0x1b')]]={'$like':'%'+_0x5abf2a[_0xf16d('0x22')][_0xf16d('0x2b')]+'%'};return _0xfd9dc7;}})});}_0xe9fd58=_[_0xf16d('0x2c')]({},_0xe9fd58,_0x5abf2a[_0xf16d('0x2e')]);var _0xc1d13e={'where':_0xe9fd58[_0xf16d('0x29')]};return db[_0xf16d('0x2f')][_0xf16d('0x10')](_0xc1d13e)[_0xf16d('0x13')](function(_0xebe228){_0xc43413[_0xf16d('0x10')]=_0xebe228;if(_0x5abf2a[_0xf16d('0x22')][_0xf16d('0x30')]){_0xe9fd58[_0xf16d('0x31')]=[{'all':!![]}];}return db[_0xf16d('0x2f')]['findAll'](_0xe9fd58);})[_0xf16d('0x13')](function(_0x3d0d72){_0xc43413['rows']=_0x3d0d72;return _0xc43413;})[_0xf16d('0x13')](respondWithFilteredResult(_0x54172a,_0xe9fd58))[_0xf16d('0x32')](handleError(_0x54172a,null));};exports[_0xf16d('0x33')]=function(_0x3b148f,_0x538f78){var _0xad8b49={'raw':![],'where':{'id':_0x3b148f[_0xf16d('0x34')]['id']}},_0x2a0de8={};_0x2a0de8[_0xf16d('0x21')]=_[_0xf16d('0x23')](db['SquareProject'][_0xf16d('0x1e')]);_0x2a0de8['query']=_[_0xf16d('0x23')](_0x3b148f['query']);_0x2a0de8[_0xf16d('0x24')]=_[_0xf16d('0x35')](_0x2a0de8['model'],_0x2a0de8[_0xf16d('0x22')]);_0xad8b49[_0xf16d('0x25')]=_['intersection'](_0x2a0de8[_0xf16d('0x21')],qs[_0xf16d('0x26')](_0x3b148f[_0xf16d('0x22')][_0xf16d('0x26')]));_0xad8b49[_0xf16d('0x25')]=_0xad8b49['attributes'][_0xf16d('0x36')]?_0xad8b49[_0xf16d('0x25')]:_0x2a0de8[_0xf16d('0x21')];if(_0x3b148f[_0xf16d('0x22')][_0xf16d('0x30')]){_0xad8b49[_0xf16d('0x31')]=[{'all':!![]}];}_0xad8b49=_[_0xf16d('0x2c')]({},_0xad8b49,_0x3b148f[_0xf16d('0x2e')]);return db[_0xf16d('0x2f')]['find'](_0xad8b49)[_0xf16d('0x13')](handleEntityNotFound(_0x538f78,null))[_0xf16d('0x13')](respondWithResult(_0x538f78,null))[_0xf16d('0x32')](handleError(_0x538f78,null));};exports['create']=function(_0x1b08d3,_0x195521){return db[_0xf16d('0x2f')]['create'](_0x1b08d3[_0xf16d('0x37')],{})[_0xf16d('0x13')](function(_0x424c5a){var _0x577393=_0x1b08d3[_0xf16d('0x38')][_0xf16d('0x14')]({'plain':!![]});if(!_0x577393)throw new Error(_0xf16d('0x39'));if(_0x577393[_0xf16d('0x3a')]===_0xf16d('0x38')){var _0x127d01=_0x424c5a[_0xf16d('0x14')]({'plain':!![]});var _0x327dfd=_0xf16d('0x15');return db['UserProfileSection'][_0xf16d('0x3b')]({'where':{'name':_0x327dfd,'userProfileId':_0x577393['userProfileId']},'raw':!![]})[_0xf16d('0x13')](function(_0x436f7b){if(_0x436f7b&&_0x436f7b['autoAssociation']===0x0){return db[_0xf16d('0x3c')]['create']({'name':_0x127d01['name'],'resourceId':_0x127d01['id'],'type':_0x436f7b['name'],'sectionId':_0x436f7b['id']},{})['then'](function(){return _0x424c5a;});}else{return _0x424c5a;}})[_0xf16d('0x32')](function(_0x2999a8){logger[_0xf16d('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2999a8);throw _0x2999a8;});}return _0x424c5a;})[_0xf16d('0x13')](respondWithResult(_0x195521,0xc9))[_0xf16d('0x32')](handleError(_0x195521,null));};exports[_0xf16d('0x12')]=function(_0x380d6d,_0x5752b9){if(_0x380d6d[_0xf16d('0x37')]['id']){delete _0x380d6d[_0xf16d('0x37')]['id'];}return db[_0xf16d('0x2f')][_0xf16d('0x3b')]({'where':{'id':_0x380d6d['params']['id']}})['then'](handleEntityNotFound(_0x5752b9,null))[_0xf16d('0x13')](saveUpdates(_0x380d6d['body'],null))['then'](function(_0x4511a1){if(!_0x4511a1)return;var _0x476aee=_0x4511a1[_0xf16d('0x14')]({'plain':!![]});return _0x476aee;})[_0xf16d('0x13')](function(_0x10a2be){var _0x23bdf0=new Redis(config[_0xf16d('0x5')]);_0x23bdf0['publish'](_0xf16d('0x16'),JSON[_0xf16d('0x3d')](_[_0xf16d('0x2a')](_0x10a2be,['id',_0xf16d('0x1b'),_0xf16d('0x3e')])));return _0x10a2be;})[_0xf16d('0x13')](respondWithResult(_0x5752b9,null))[_0xf16d('0x32')](handleError(_0x5752b9,null));};exports[_0xf16d('0x3f')]=function(_0x32aa5b,_0x599e8c){return db[_0xf16d('0x2f')]['find']({'where':{'id':_0x32aa5b[_0xf16d('0x34')]['id']}})[_0xf16d('0x13')](handleEntityNotFound(_0x599e8c,null))['then'](removeEntity(_0x599e8c,null))[_0xf16d('0x32')](handleError(_0x599e8c,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index dbb4ad4..f85f542 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 _0xab6f=['../../mysqldb','SquareProject','setMaxListeners','update','emit','hasOwnProperty','exports','events'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0xab6f,0x167));var _0xfab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab6f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xfab6('0x0'));var SquareProject=require(_0xfab6('0x1'))['db'][_0xfab6('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xfab6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfab6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a144f){return function(_0x24c21b,_0xd60898,_0x2a5736){SquareProjectEvents['emit'](_0x5a144f+':'+_0x24c21b['id'],_0x24c21b);SquareProjectEvents[_0xfab6('0x5')](_0x5a144f,_0x24c21b);_0x2a5736(null);};}for(var e in events){if(events[_0xfab6('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xfab6('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x9c7b=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb','SquareProject'];(function(_0x5e07f6,_0x26f599){var _0x220f5c=function(_0xa8d5fd){while(--_0xa8d5fd){_0x5e07f6['push'](_0x5e07f6['shift']());}};_0x220f5c(++_0x26f599);}(_0x9c7b,0x114));var _0xb9c7=function(_0x18695a,_0x23222b){_0x18695a=_0x18695a-0x0;var _0x336fea=_0x9c7b[_0x18695a];return _0x336fea;};'use strict';var EventEmitter=require(_0xb9c7('0x0'));var SquareProject=require(_0xb9c7('0x1'))['db'][_0xb9c7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb9c7('0x3')](0x0);var events={'afterCreate':_0xb9c7('0x4'),'afterUpdate':_0xb9c7('0x5'),'afterDestroy':_0xb9c7('0x6')};function emitEvent(_0xdc46a8){return function(_0x48da22,_0x325b0e,_0x3ffc55){SquareProjectEvents['emit'](_0xdc46a8+':'+_0x48da22['id'],_0x48da22);SquareProjectEvents[_0xb9c7('0x7')](_0xdc46a8,_0x48da22);_0x3ffc55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xb9c7('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index cb89538..ee4be95 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 _0x440a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x440a,0xd6));var _0xa440=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x440a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa440('0x0'));var util=require(_0xa440('0x1'));var logger=require(_0xa440('0x2'))(_0xa440('0x3'));var moment=require(_0xa440('0x4'));var BPromise=require(_0xa440('0x5'));var rp=require(_0xa440('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa440('0x7'));var config=require(_0xa440('0x8'));var attributes=require(_0xa440('0x9'));module[_0xa440('0xa')]=function(_0x43bf6a,_0x3e99c8){return _0x43bf6a['define'](_0xa440('0xb'),attributes,{'tableName':_0xa440('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1783e3,_0x527f93,_0x50002c){if(_0x1783e3['changed']('preproduction')){_0x1783e3[_0xa440('0xd')]=moment()['format'](_0xa440('0xe'));}if(_0x1783e3[_0xa440('0xf')](_0xa440('0x10'))){_0x1783e3[_0xa440('0x11')]=moment()['format'](_0xa440('0xe'));}_0x50002c(null,_0x1783e3);}}});}; \ No newline at end of file +var _0x09c6=['../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x09c6,0x7f));var _0x609c=function(_0x3b4062,_0x56d905){_0x3b4062=_0x3b4062-0x0;var _0x122330=_0x09c6[_0x3b4062];return _0x122330;};'use strict';var _=require('lodash');var util=require(_0x609c('0x0'));var logger=require(_0x609c('0x1'))('api');var moment=require(_0x609c('0x2'));var BPromise=require(_0x609c('0x3'));var rp=require(_0x609c('0x4'));var fs=require('fs');var path=require(_0x609c('0x5'));var rimraf=require('rimraf');var config=require(_0x609c('0x6'));var attributes=require(_0x609c('0x7'));module[_0x609c('0x8')]=function(_0x4bd95d,_0x350064){return _0x4bd95d[_0x609c('0x9')](_0x609c('0xa'),attributes,{'tableName':_0x609c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x581640,_0x1699b7,_0x56f80d){if(_0x581640[_0x609c('0xc')](_0x609c('0xd'))){_0x581640[_0x609c('0xe')]=moment()[_0x609c('0xf')](_0x609c('0x10'));}if(_0x581640[_0x609c('0xc')](_0x609c('0x11'))){_0x581640[_0x609c('0x12')]=moment()['format'](_0x609c('0x10'));}_0x56f80d(null,_0x581640);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 57170e0..bb89940 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 _0xd20b=['defaults','redis','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','include','model','map','then','info','debug','stringify','error','find','ShowSquareProject','catch','message','lodash','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x4259cd,_0x32ffd6){var _0x4f5230=function(_0x24ca95){while(--_0x24ca95){_0x4259cd['push'](_0x4259cd['shift']());}};_0x4f5230(++_0x32ffd6);}(_0xd20b,0xbf));var _0xbd20=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xd20b[_0x1e6db3];return _0x1de886;};'use strict';var _=require(_0xbd20('0x0'));var Redis=require(_0xbd20('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xbd20('0x2'))(_0xbd20('0x3'));var config=require(_0xbd20('0x4'));config['redis']=_[_0xbd20('0x5')](config[_0xbd20('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xbd20('0x7'))(new Redis(config['redis']));require(_0xbd20('0x8'))['register'](socket);exports[_0xbd20('0x9')]=function(_0x5def5a){var _0x18545e=this;return new Promise(function(_0xdfe94f,_0x35913a){return db[_0xbd20('0xa')][_0xbd20('0xb')]({'raw':_0x5def5a[_0xbd20('0xc')]?_0x5def5a[_0xbd20('0xc')][_0xbd20('0xd')]===undefined?!![]:![]:!![],'where':_0x5def5a[_0xbd20('0xc')]?_0x5def5a[_0xbd20('0xc')][_0xbd20('0xe')]||null:null,'attributes':_0x5def5a[_0xbd20('0xc')]?_0x5def5a[_0xbd20('0xc')][_0xbd20('0xf')]||null:null,'limit':_0x5def5a[_0xbd20('0xc')]?_0x5def5a[_0xbd20('0xc')]['limit']||null:null,'include':_0x5def5a['options']?_0x5def5a['options'][_0xbd20('0x10')]?_['map'](_0x5def5a['options'][_0xbd20('0x10')],function(_0x428163){return{'model':db[_0x428163[_0xbd20('0x11')]],'as':_0x428163['as'],'attributes':_0x428163['attributes'],'include':_0x428163[_0xbd20('0x10')]?_[_0xbd20('0x12')](_0x428163[_0xbd20('0x10')],function(_0x4c9149){return{'model':db[_0x4c9149[_0xbd20('0x11')]],'as':_0x4c9149['as'],'attributes':_0x4c9149[_0xbd20('0xf')],'include':_0x4c9149[_0xbd20('0x10')]?_['map'](_0x4c9149[_0xbd20('0x10')],function(_0x136d76){return{'model':db[_0x136d76['model']],'as':_0x136d76['as'],'attributes':_0x136d76[_0xbd20('0xf')]};}):[]};}):[]};}):[]:[]})[_0xbd20('0x13')](function(_0xaac7){logger[_0xbd20('0x14')](_0xbd20('0x9'),_0x5def5a);logger[_0xbd20('0x15')]('GetSquareProjects',_0x5def5a,JSON[_0xbd20('0x16')](_0xaac7));_0xdfe94f(_0xaac7);})['catch'](function(_0x4438b5){logger[_0xbd20('0x17')](_0xbd20('0x9'),_0x4438b5['message'],_0x5def5a);_0x35913a(_0x18545e[_0xbd20('0x17')](0x1f4,_0x4438b5['message']));});});};exports['ShowSquareProject']=function(_0x170134){var _0x20c766=this;return new Promise(function(_0x300014,_0x4ffddb){return db[_0xbd20('0xa')][_0xbd20('0x18')]({'raw':_0x170134['options']?_0x170134[_0xbd20('0xc')][_0xbd20('0xd')]===undefined?!![]:![]:!![],'where':_0x170134[_0xbd20('0xc')]?_0x170134[_0xbd20('0xc')][_0xbd20('0xe')]||null:null,'attributes':_0x170134[_0xbd20('0xc')]?_0x170134['options'][_0xbd20('0xf')]||null:null,'include':_0x170134['options']?_0x170134[_0xbd20('0xc')][_0xbd20('0x10')]?_[_0xbd20('0x12')](_0x170134[_0xbd20('0xc')][_0xbd20('0x10')],function(_0x49f647){return{'model':db[_0x49f647[_0xbd20('0x11')]],'as':_0x49f647['as'],'attributes':_0x49f647[_0xbd20('0xf')],'include':_0x49f647['include']?_[_0xbd20('0x12')](_0x49f647[_0xbd20('0x10')],function(_0x2d9ba5){return{'model':db[_0x2d9ba5['model']],'as':_0x2d9ba5['as'],'attributes':_0x2d9ba5[_0xbd20('0xf')],'include':_0x2d9ba5[_0xbd20('0x10')]?_[_0xbd20('0x12')](_0x2d9ba5[_0xbd20('0x10')],function(_0x4ae313){return{'model':db[_0x4ae313[_0xbd20('0x11')]],'as':_0x4ae313['as'],'attributes':_0x4ae313['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd20('0x13')](function(_0x13297e){logger['info']('ShowSquareProject',_0x170134);logger['debug'](_0xbd20('0x19'),_0x170134,JSON['stringify'](_0x13297e));_0x300014(_0x13297e);})[_0xbd20('0x1a')](function(_0x543a50){logger[_0xbd20('0x17')](_0xbd20('0x19'),_0x543a50[_0xbd20('0x1b')],_0x170134);_0x4ffddb(_0x20c766[_0xbd20('0x17')](0x1f4,_0x543a50[_0xbd20('0x1b')]));});});}; \ No newline at end of file +var _0x2e50=['findAll','options','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','message','ShowSquareProject','find','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','socket.io-emitter','register','GetSquareProjects','SquareProject'];(function(_0xc11214,_0x2fec4f){var _0xe318e8=function(_0x4603ff){while(--_0x4603ff){_0xc11214['push'](_0xc11214['shift']());}};_0xe318e8(++_0x2fec4f);}(_0x2e50,0x170));var _0x02e5=function(_0x3b5e02,_0x535469){_0x3b5e02=_0x3b5e02-0x0;var _0x59464c=_0x2e50[_0x3b5e02];return _0x59464c;};'use strict';var _=require(_0x02e5('0x0'));var Redis=require('ioredis');var db=require(_0x02e5('0x1'))['db'];var logger=require(_0x02e5('0x2'))(_0x02e5('0x3'));var config=require(_0x02e5('0x4'));config[_0x02e5('0x5')]=_['defaults'](config[_0x02e5('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x02e5('0x6'))(new Redis(config[_0x02e5('0x5')]));require('./squareProject.socket')[_0x02e5('0x7')](socket);exports[_0x02e5('0x8')]=function(_0x10e7e4){var _0x4dcaba=this;return new Promise(function(_0x440e9f,_0x136910){return db[_0x02e5('0x9')][_0x02e5('0xa')]({'raw':_0x10e7e4[_0x02e5('0xb')]?_0x10e7e4['options']['raw']===undefined?!![]:![]:!![],'where':_0x10e7e4[_0x02e5('0xb')]?_0x10e7e4[_0x02e5('0xb')][_0x02e5('0xc')]||null:null,'attributes':_0x10e7e4[_0x02e5('0xb')]?_0x10e7e4[_0x02e5('0xb')][_0x02e5('0xd')]||null:null,'limit':_0x10e7e4[_0x02e5('0xb')]?_0x10e7e4[_0x02e5('0xb')][_0x02e5('0xe')]||null:null,'include':_0x10e7e4[_0x02e5('0xb')]?_0x10e7e4[_0x02e5('0xb')]['include']?_['map'](_0x10e7e4[_0x02e5('0xb')][_0x02e5('0xf')],function(_0xd421cc){return{'model':db[_0xd421cc[_0x02e5('0x10')]],'as':_0xd421cc['as'],'attributes':_0xd421cc['attributes'],'include':_0xd421cc[_0x02e5('0xf')]?_['map'](_0xd421cc[_0x02e5('0xf')],function(_0x277e3e){return{'model':db[_0x277e3e[_0x02e5('0x10')]],'as':_0x277e3e['as'],'attributes':_0x277e3e['attributes'],'include':_0x277e3e['include']?_[_0x02e5('0x11')](_0x277e3e[_0x02e5('0xf')],function(_0x502845){return{'model':db[_0x502845[_0x02e5('0x10')]],'as':_0x502845['as'],'attributes':_0x502845[_0x02e5('0xd')]};}):[]};}):[]};}):[]:[]})[_0x02e5('0x12')](function(_0x12e71d){logger[_0x02e5('0x13')](_0x02e5('0x8'),_0x10e7e4);logger[_0x02e5('0x14')]('GetSquareProjects',_0x10e7e4,JSON[_0x02e5('0x15')](_0x12e71d));_0x440e9f(_0x12e71d);})[_0x02e5('0x16')](function(_0x4c598f){logger[_0x02e5('0x17')](_0x02e5('0x8'),_0x4c598f['message'],_0x10e7e4);_0x136910(_0x4dcaba[_0x02e5('0x17')](0x1f4,_0x4c598f[_0x02e5('0x18')]));});});};exports[_0x02e5('0x19')]=function(_0x4aa0cf){var _0x5c659a=this;return new Promise(function(_0x52b9be,_0x3b2074){return db[_0x02e5('0x9')][_0x02e5('0x1a')]({'raw':_0x4aa0cf[_0x02e5('0xb')]?_0x4aa0cf[_0x02e5('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x4aa0cf[_0x02e5('0xb')]?_0x4aa0cf[_0x02e5('0xb')]['where']||null:null,'attributes':_0x4aa0cf[_0x02e5('0xb')]?_0x4aa0cf[_0x02e5('0xb')][_0x02e5('0xd')]||null:null,'include':_0x4aa0cf['options']?_0x4aa0cf[_0x02e5('0xb')]['include']?_[_0x02e5('0x11')](_0x4aa0cf[_0x02e5('0xb')][_0x02e5('0xf')],function(_0x534b58){return{'model':db[_0x534b58[_0x02e5('0x10')]],'as':_0x534b58['as'],'attributes':_0x534b58[_0x02e5('0xd')],'include':_0x534b58[_0x02e5('0xf')]?_[_0x02e5('0x11')](_0x534b58[_0x02e5('0xf')],function(_0x1bde99){return{'model':db[_0x1bde99[_0x02e5('0x10')]],'as':_0x1bde99['as'],'attributes':_0x1bde99[_0x02e5('0xd')],'include':_0x1bde99['include']?_[_0x02e5('0x11')](_0x1bde99[_0x02e5('0xf')],function(_0x45cc46){return{'model':db[_0x45cc46[_0x02e5('0x10')]],'as':_0x45cc46['as'],'attributes':_0x45cc46[_0x02e5('0xd')]};}):[]};}):[]};}):[]:[]})[_0x02e5('0x12')](function(_0x506b2e){logger[_0x02e5('0x13')](_0x02e5('0x19'),_0x4aa0cf);logger[_0x02e5('0x14')](_0x02e5('0x19'),_0x4aa0cf,JSON[_0x02e5('0x15')](_0x506b2e));_0x52b9be(_0x506b2e);})[_0x02e5('0x16')](function(_0x476082){logger[_0x02e5('0x17')](_0x02e5('0x19'),_0x476082[_0x02e5('0x18')],_0x4aa0cf);_0x3b2074(_0x5c659a[_0x02e5('0x17')](0x1f4,_0x476082['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d274efc..0dc646d 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 _0xa12a=['./squareProject.events','save','remove','emit','removeListener','register','length'];(function(_0x318e08,_0x67a1ec){var _0x48b689=function(_0x4389ed){while(--_0x4389ed){_0x318e08['push'](_0x318e08['shift']());}};_0x48b689(++_0x67a1ec);}(_0xa12a,0x181));var _0xaa12=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa12a[_0x5ddb1c];return _0x354adc;};'use strict';var SquareProjectEvents=require(_0xaa12('0x0'));var events=[_0xaa12('0x1'),_0xaa12('0x2'),'update'];function createListener(_0x588f15,_0x256e3c){return function(_0x30ff26){_0x256e3c[_0xaa12('0x3')](_0x588f15,_0x30ff26);};}function removeListener(_0x572e9c,_0x20980f){return function(){SquareProjectEvents[_0xaa12('0x4')](_0x572e9c,_0x20980f);};}exports[_0xaa12('0x5')]=function(_0x1a8581){for(var _0x2eeb56=0x0,_0x422472=events[_0xaa12('0x6')];_0x2eeb56<_0x422472;_0x2eeb56++){var _0x489683=events[_0x2eeb56];var _0x3ddfdc=createListener('squareProject:'+_0x489683,_0x1a8581);SquareProjectEvents['on'](_0x489683,_0x3ddfdc);}}; \ No newline at end of file +var _0x587a=['squareProject:','./squareProject.events','removeListener','register','length'];(function(_0x4131da,_0x124783){var _0x583242=function(_0x4c899f){while(--_0x4c899f){_0x4131da['push'](_0x4131da['shift']());}};_0x583242(++_0x124783);}(_0x587a,0x150));var _0xa587=function(_0x61b4c7,_0xf6eafa){_0x61b4c7=_0x61b4c7-0x0;var _0x5f57a1=_0x587a[_0x61b4c7];return _0x5f57a1;};'use strict';var SquareProjectEvents=require(_0xa587('0x0'));var events=['save','remove','update'];function createListener(_0x25405c,_0x596f95){return function(_0x1ed317){_0x596f95['emit'](_0x25405c,_0x1ed317);};}function removeListener(_0x299fcb,_0x49c822){return function(){SquareProjectEvents[_0xa587('0x1')](_0x299fcb,_0x49c822);};}exports[_0xa587('0x2')]=function(_0x19acff){for(var _0xbe92bc=0x0,_0xbf19b4=events[_0xa587('0x3')];_0xbe92bc<_0xbf19b4;_0xbe92bc++){var _0x33a3d8=events[_0xbe92bc];var _0x868871=createListener(_0xa587('0x4')+_0x33a3d8,_0x19acff);SquareProjectEvents['on'](_0x33a3d8,_0x868871);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c9f24f2..63d53ae 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x569998,_0x361b8d){var _0x2f8256=function(_0x3354f1){while(--_0x3354f1){_0x569998['push'](_0x569998['shift']());}};_0x2f8256(++_0x361b8d);}(_0x326f,0xd1));var _0xf326=function(_0x1c12d6,_0x59fb5e){_0x1c12d6=_0x1c12d6-0x0;var _0x374324=_0x326f[_0x1c12d6];return _0x374324;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x5d24a4,_0x396b5e){var _0x11cabe=function(_0x29cc0f){while(--_0x29cc0f){_0x5d24a4['push'](_0x5d24a4['shift']());}};_0x11cabe(++_0x396b5e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x448b7c,_0x422db8){_0x448b7c=_0x448b7c-0x0;var _0x5ec783=_0x1cb9[_0x448b7c];return _0x5ec783;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 650946c..122ce4a 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 _0x55ca=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x3c1d68,_0x44cce2){var _0x19c5aa=function(_0x154be0){while(--_0x154be0){_0x3c1d68['push'](_0x3c1d68['shift']());}};_0x19c5aa(++_0x44cce2);}(_0x55ca,0x126));var _0xa55c=function(_0x1f83ac,_0x8016fc){_0x1f83ac=_0x1f83ac-0x0;var _0x1985de=_0x55ca[_0x1f83ac];return _0x1985de;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa55c('0x2')]},'extension':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'dnid':{'type':Sequelize[_0xa55c('0x2')]},'projectName':{'type':Sequelize[_0xa55c('0x2')]},'saveName':{'type':Sequelize[_0xa55c('0x2')]},'filename':{'type':Sequelize[_0xa55c('0x2')]},'savePath':{'type':Sequelize[_0xa55c('0x2')]},'format':{'type':Sequelize[_0xa55c('0x3')],'get':function(){var _0x4d0624='';var _0x2121fd=this[_0xa55c('0x4')]('savePath');if(_0x2121fd){_0x4d0624=_0x2121fd[_0xa55c('0x5')](_0x2121fd[_0xa55c('0x6')]('.'));}return _0x4d0624;}}}; \ No newline at end of file +var _0x2eb2=['substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2eb2,0x19f));var _0x22eb=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2eb2[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'uniqueid':{'type':Sequelize[_0x22eb('0x1')]},'callerid':{'type':Sequelize[_0x22eb('0x1')]},'calleridname':{'type':Sequelize[_0x22eb('0x1')]},'context':{'type':Sequelize[_0x22eb('0x1')]},'extension':{'type':Sequelize[_0x22eb('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x22eb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x22eb('0x1')]},'filename':{'type':Sequelize[_0x22eb('0x1')]},'savePath':{'type':Sequelize[_0x22eb('0x1')]},'format':{'type':Sequelize[_0x22eb('0x2')],'get':function(){var _0x4539d0='';var _0x396806=this[_0x22eb('0x3')](_0x22eb('0x4'));if(_0x396806){_0x4539d0=_0x396806[_0x22eb('0x5')](_0x396806[_0x22eb('0x6')]('.'));}return _0x4539d0;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 6021619..18e7ec1 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 _0xd8e8=['isNil','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','error','index','map','SquareRecording','key','query','keys','filters','attributes','model','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','includeAll','include','rows','catch','show','rawAttributes','intersection','find','create','body','download','../../components/encryptor','uniqueid','params','filename','existsSync','decryptFile','recording','savePath','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','send'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xd8e8,0x114));var _0x8d8e=function(_0x27bb10,_0xc43ba2){_0x27bb10=_0x27bb10-0x0;var _0x56b750=_0xd8e8[_0x27bb10];return _0x56b750;};'use strict';var emlformat=require(_0x8d8e('0x0'));var rimraf=require(_0x8d8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d8e('0x2'));var rp=require(_0x8d8e('0x3'));var moment=require('moment');var BPromise=require(_0x8d8e('0x4'));var Mustache=require(_0x8d8e('0x5'));var util=require(_0x8d8e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8d8e('0x7'));var ejs=require(_0x8d8e('0x8'));var fs=require('fs');var fs_extra=require(_0x8d8e('0x9'));var _=require(_0x8d8e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8d8e('0xb'));var deskjs=require(_0x8d8e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8d8e('0xd'));var Papa=require(_0x8d8e('0xe'));var Redis=require('ioredis');var authService=require(_0x8d8e('0xf'));var qs=require(_0x8d8e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d8e('0x11'))(_0x8d8e('0x12'));var utils=require(_0x8d8e('0x13'));var config=require(_0x8d8e('0x14'));var licenseUtil=require(_0x8d8e('0x15'));var db=require(_0x8d8e('0x16'))['db'];function respondWithStatusCode(_0x45c29b,_0x364fd0){_0x364fd0=_0x364fd0||0xcc;return function(_0x433adf){if(_0x433adf){return _0x45c29b[_0x8d8e('0x17')](_0x364fd0);}return _0x45c29b[_0x8d8e('0x18')](_0x364fd0)[_0x8d8e('0x19')]();};}function respondWithResult(_0x54da72,_0x32644d){_0x32644d=_0x32644d||0xc8;return function(_0x114c94){if(_0x114c94){return _0x54da72[_0x8d8e('0x18')](_0x32644d)['json'](_0x114c94);}};}function respondWithFilteredResult(_0x5028c4,_0x33c12e){return function(_0x36feff){if(_0x36feff){var _0x23ef11=typeof _0x33c12e[_0x8d8e('0x1a')]===_0x8d8e('0x1b')&&typeof _0x33c12e['limit']==='undefined';var _0x36b2df=_0x36feff[_0x8d8e('0x1c')];var _0x574070=_0x23ef11?0x0:_0x33c12e[_0x8d8e('0x1a')];var _0x22fd18=_0x23ef11?_0x36feff[_0x8d8e('0x1c')]:_0x33c12e['offset']+_0x33c12e[_0x8d8e('0x1d')];var _0x4a5ed1;if(_0x22fd18>=_0x36b2df){_0x22fd18=_0x36b2df;_0x4a5ed1=0xc8;}else{_0x4a5ed1=0xce;}_0x5028c4[_0x8d8e('0x18')](_0x4a5ed1);return _0x5028c4[_0x8d8e('0x1e')]('Content-Range',_0x574070+'-'+_0x22fd18+'/'+_0x36b2df)[_0x8d8e('0x1f')](_0x36feff);}return null;};}function patchUpdates(_0x1725f3){return function(_0x315493){try{jsonpatch[_0x8d8e('0x20')](_0x315493,_0x1725f3,!![]);}catch(_0x419f86){return BPromise['reject'](_0x419f86);}return _0x315493[_0x8d8e('0x21')]();};}function saveUpdates(_0x31e0cd,_0x3ec910){return function(_0x1f5c71){if(_0x1f5c71){return _0x1f5c71[_0x8d8e('0x22')](_0x31e0cd)[_0x8d8e('0x23')](function(_0x591e73){return _0x591e73;});}return null;};}function removeEntity(_0x365d1c,_0x16dd11){return function(_0x3471b1){if(_0x3471b1){return _0x3471b1[_0x8d8e('0x24')]()[_0x8d8e('0x23')](function(){_0x365d1c[_0x8d8e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x522e09,_0x96bbf3){return function(_0x2d6e02){if(!_0x2d6e02){_0x522e09[_0x8d8e('0x17')](0x194);}return _0x2d6e02;};}function handleError(_0x5b703f,_0x5be84b){_0x5be84b=_0x5be84b||0x1f4;return function(_0xd8b85c){logger[_0x8d8e('0x25')](_0xd8b85c['stack']);if(_0xd8b85c['name']){delete _0xd8b85c['name'];}_0x5b703f[_0x8d8e('0x18')](_0x5be84b)['send'](_0xd8b85c);};}exports[_0x8d8e('0x26')]=function(_0x15d627,_0x23ef62){var _0x2877b1={},_0x3bb527={},_0x557fb9={'count':0x0,'rows':[]};var _0x4894d9=_[_0x8d8e('0x27')](db[_0x8d8e('0x28')]['rawAttributes'],function(_0x24872d){return{'name':_0x24872d['fieldName'],'type':_0x24872d['type'][_0x8d8e('0x29')]};});_0x3bb527['model']=_[_0x8d8e('0x27')](_0x4894d9,'name');_0x3bb527[_0x8d8e('0x2a')]=_[_0x8d8e('0x2b')](_0x15d627[_0x8d8e('0x2a')]);_0x3bb527[_0x8d8e('0x2c')]=_['intersection'](_0x3bb527['model'],_0x3bb527[_0x8d8e('0x2a')]);_0x2877b1[_0x8d8e('0x2d')]=_['intersection'](_0x3bb527[_0x8d8e('0x2e')],qs[_0x8d8e('0x2f')](_0x15d627[_0x8d8e('0x2a')][_0x8d8e('0x2f')]));_0x2877b1[_0x8d8e('0x2d')]=_0x2877b1[_0x8d8e('0x2d')][_0x8d8e('0x30')]?_0x2877b1['attributes']:_0x3bb527[_0x8d8e('0x2e')];if(!_0x15d627[_0x8d8e('0x2a')]['hasOwnProperty']('nolimit')){_0x2877b1[_0x8d8e('0x1d')]=qs[_0x8d8e('0x1d')](_0x15d627[_0x8d8e('0x2a')][_0x8d8e('0x1d')]);_0x2877b1[_0x8d8e('0x1a')]=qs[_0x8d8e('0x1a')](_0x15d627[_0x8d8e('0x2a')][_0x8d8e('0x1a')]);}_0x2877b1[_0x8d8e('0x31')]=qs[_0x8d8e('0x32')](_0x15d627[_0x8d8e('0x2a')][_0x8d8e('0x32')]);_0x2877b1[_0x8d8e('0x33')]=qs['filters'](_[_0x8d8e('0x34')](_0x15d627['query'],_0x3bb527[_0x8d8e('0x2c')]),_0x4894d9);if(_0x15d627['query'][_0x8d8e('0x35')]){_0x2877b1['where']=_[_0x8d8e('0x36')](_0x2877b1[_0x8d8e('0x33')],{'$or':_[_0x8d8e('0x27')](_0x4894d9,function(_0x193fd8){if(_0x193fd8[_0x8d8e('0x37')]!==_0x8d8e('0x38')){var _0x275285={};_0x275285[_0x193fd8[_0x8d8e('0x39')]]={'$like':'%'+_0x15d627['query']['filter']+'%'};return _0x275285;}})});}_0x2877b1=_[_0x8d8e('0x36')]({},_0x2877b1,_0x15d627[_0x8d8e('0x3a')]);var _0x17d97a={'where':_0x2877b1[_0x8d8e('0x33')]};return db[_0x8d8e('0x28')][_0x8d8e('0x1c')](_0x17d97a)[_0x8d8e('0x23')](function(_0x2faebb){_0x557fb9[_0x8d8e('0x1c')]=_0x2faebb;if(_0x15d627[_0x8d8e('0x2a')][_0x8d8e('0x3b')]){_0x2877b1[_0x8d8e('0x3c')]=[{'all':!![]}];}return db[_0x8d8e('0x28')]['findAll'](_0x2877b1);})[_0x8d8e('0x23')](function(_0x57ecb9){_0x557fb9[_0x8d8e('0x3d')]=_0x57ecb9;return _0x557fb9;})['then'](respondWithFilteredResult(_0x23ef62,_0x2877b1))[_0x8d8e('0x3e')](handleError(_0x23ef62,null));};exports[_0x8d8e('0x3f')]=function(_0x2fb8a8,_0x1db3fe){var _0xd1aa6a={'raw':!![],'where':{'id':_0x2fb8a8['params']['id']}},_0x20b71e={};_0x20b71e[_0x8d8e('0x2e')]=_[_0x8d8e('0x2b')](db[_0x8d8e('0x28')][_0x8d8e('0x40')]);_0x20b71e[_0x8d8e('0x2a')]=_[_0x8d8e('0x2b')](_0x2fb8a8[_0x8d8e('0x2a')]);_0x20b71e['filters']=_[_0x8d8e('0x41')](_0x20b71e[_0x8d8e('0x2e')],_0x20b71e[_0x8d8e('0x2a')]);_0xd1aa6a[_0x8d8e('0x2d')]=_['intersection'](_0x20b71e['model'],qs[_0x8d8e('0x2f')](_0x2fb8a8[_0x8d8e('0x2a')][_0x8d8e('0x2f')]));_0xd1aa6a['attributes']=_0xd1aa6a['attributes'][_0x8d8e('0x30')]?_0xd1aa6a[_0x8d8e('0x2d')]:_0x20b71e['model'];if(_0x2fb8a8[_0x8d8e('0x2a')][_0x8d8e('0x3b')]){_0xd1aa6a[_0x8d8e('0x3c')]=[{'all':!![]}];}_0xd1aa6a=_['merge']({},_0xd1aa6a,_0x2fb8a8['options']);return db[_0x8d8e('0x28')][_0x8d8e('0x42')](_0xd1aa6a)[_0x8d8e('0x23')](handleEntityNotFound(_0x1db3fe,null))[_0x8d8e('0x23')](respondWithResult(_0x1db3fe,null))['catch'](handleError(_0x1db3fe,null));};exports['create']=function(_0xdc8f2e,_0x18da7d){return db[_0x8d8e('0x28')][_0x8d8e('0x43')](_0xdc8f2e[_0x8d8e('0x44')],{})[_0x8d8e('0x23')](respondWithResult(_0x18da7d,0xc9))[_0x8d8e('0x3e')](handleError(_0x18da7d,null));};exports[_0x8d8e('0x22')]=function(_0x16ed4a,_0x4207c3){if(_0x16ed4a['body']['id']){delete _0x16ed4a[_0x8d8e('0x44')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x16ed4a['params']['id']}})[_0x8d8e('0x23')](handleEntityNotFound(_0x4207c3,null))[_0x8d8e('0x23')](saveUpdates(_0x16ed4a['body'],null))[_0x8d8e('0x23')](respondWithResult(_0x4207c3,null))[_0x8d8e('0x3e')](handleError(_0x4207c3,null));};exports[_0x8d8e('0x45')]=function(_0x525f41,_0x2c6ddd,_0xc15078){var _0x4f1c7c=require(_0x8d8e('0x46'));var _0x1806e3=![];var _0x2ce2af={};if(_0x525f41[_0x8d8e('0x2a')]['type']&&_0x525f41['query'][_0x8d8e('0x37')]===_0x8d8e('0x47')){_0x2ce2af[_0x8d8e('0x47')]=_0x525f41[_0x8d8e('0x48')]['id'];}else{_0x2ce2af['id']=_0x525f41[_0x8d8e('0x48')]['id'];}return db[_0x8d8e('0x28')][_0x8d8e('0x42')]({'where':_0x2ce2af,'attributes':['id','savePath',_0x8d8e('0x49')],'raw':!![]})[_0x8d8e('0x23')](handleEntityNotFound(_0x2c6ddd,null))[_0x8d8e('0x23')](function(_0xf59a7a){if(_0xf59a7a){var _0x17c51f=_0xf59a7a['savePath'];var _0x2386b3=util['format']('%s.cypher',_0x17c51f);if(fs[_0x8d8e('0x4a')](_0x2386b3)){_0x1806e3=!![];return _0x4f1c7c[_0x8d8e('0x4b')](_0x2386b3,_0x17c51f,config['secrets'][_0x8d8e('0x4c')])[_0x8d8e('0x23')](function(){return _0xf59a7a;});}return _0xf59a7a;}})[_0x8d8e('0x23')](function(_0x42d493){if(_0x42d493){var _0x3ae5e8=_0x42d493[_0x8d8e('0x4d')];if(!fs[_0x8d8e('0x4a')](_0x3ae5e8)){throw new db[(_0x8d8e('0x4e'))]['ValidationError'](_0x8d8e('0x4f'));}if(_0x42d493[_0x8d8e('0x49')]){return _0x2c6ddd['download'](_0x3ae5e8,_0x42d493[_0x8d8e('0x49')]+path[_0x8d8e('0x50')](_0x3ae5e8),function(){if(_0x1806e3){fs[_0x8d8e('0x51')](_0x3ae5e8);}});}else{return _0x2c6ddd['download'](_0x3ae5e8,function(_0x55cfad){if(_0x1806e3){fs[_0x8d8e('0x51')](_0x3ae5e8);}});}}})[_0x8d8e('0x3e')](function(_0x2eb3e5){if(_0x2eb3e5[_0x8d8e('0x52')]==='SquareRecording\x20not\x20found'){_0x2c6ddd[_0x8d8e('0x18')](0x194)[_0x8d8e('0x53')]('Not\x20found');}else{return handleError(_0x2c6ddd,null);}});};exports[_0x8d8e('0x24')]=function(_0x1d21ed,_0x79ffe7){return db[_0x8d8e('0x28')][_0x8d8e('0x42')]({'where':{'id':_0x1d21ed[_0x8d8e('0x48')]['id']}})[_0x8d8e('0x23')](function(_0x245d2b){if(_[_0x8d8e('0x54')](_0x245d2b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x245d2b;})[_0x8d8e('0x23')](function(_0x5862fe){var _0x2ec1f6=_0x5862fe[_0x8d8e('0x4d')];logger[_0x8d8e('0x55')](_0x8d8e('0x56'),_0x2ec1f6);if(!_[_0x8d8e('0x54')](_0x5862fe[_0x8d8e('0x4d')])&&fs[_0x8d8e('0x4a')](_0x2ec1f6)){logger['info']('File:\x20\x22'+_0x2ec1f6+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8d8e('0x57')](_0x2ec1f6);}_0x2ec1f6=_0x2ec1f6+'.cypher';if(!_[_0x8d8e('0x54')](_0x5862fe[_0x8d8e('0x4d')])&&fs['existsSync'](_0x2ec1f6)){logger['info'](_0x8d8e('0x58')+_0x2ec1f6+_0x8d8e('0x59'));fs[_0x8d8e('0x57')](_0x2ec1f6);}return _0x5862fe;})[_0x8d8e('0x23')](function(_0x42abb6){if(!_0x42abb6)throw new InternalError();return _0x42abb6[_0x8d8e('0x24')]();})['then'](function(){_0x79ffe7[_0x8d8e('0x18')](0xcc)['end']();})['catch'](handleError(_0x79ffe7,null));}; \ No newline at end of file +var _0x9858=['VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','length','catch','create','body','find','params','../../components/encryptor','filename','format','existsSync','decryptFile','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','download','unlink','message','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','request-promise','moment','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','SquareRecording','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge'];(function(_0x4af5d0,_0x15da48){var _0x260e8e=function(_0x5f3607){while(--_0x5f3607){_0x4af5d0['push'](_0x4af5d0['shift']());}};_0x260e8e(++_0x15da48);}(_0x9858,0x88));var _0x8985=function(_0x4a1786,_0x547f47){_0x4a1786=_0x4a1786-0x0;var _0x40136b=_0x9858[_0x4a1786];return _0x40136b;};'use strict';var emlformat=require(_0x8985('0x0'));var rimraf=require(_0x8985('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8985('0x2'));var moment=require(_0x8985('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8985('0x4'));var path=require(_0x8985('0x5'));var sox=require(_0x8985('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8985('0x7'));var _=require(_0x8985('0x8'));var squel=require('squel');var crypto=require(_0x8985('0x9'));var jsforce=require(_0x8985('0xa'));var deskjs=require(_0x8985('0xb'));var toCsv=require(_0x8985('0xc'));var querystring=require('querystring');var Papa=require(_0x8985('0xd'));var Redis=require('ioredis');var authService=require(_0x8985('0xe'));var qs=require(_0x8985('0xf'));var as=require(_0x8985('0x10'));var hardwareService=require(_0x8985('0x11'));var logger=require(_0x8985('0x12'))(_0x8985('0x13'));var utils=require(_0x8985('0x14'));var config=require(_0x8985('0x15'));var licenseUtil=require(_0x8985('0x16'));var db=require(_0x8985('0x17'))['db'];function respondWithStatusCode(_0x352bc0,_0x2dbd86){_0x2dbd86=_0x2dbd86||0xcc;return function(_0x3a6b46){if(_0x3a6b46){return _0x352bc0[_0x8985('0x18')](_0x2dbd86);}return _0x352bc0[_0x8985('0x19')](_0x2dbd86)[_0x8985('0x1a')]();};}function respondWithResult(_0x102f62,_0x2d589a){_0x2d589a=_0x2d589a||0xc8;return function(_0x244b90){if(_0x244b90){return _0x102f62[_0x8985('0x19')](_0x2d589a)[_0x8985('0x1b')](_0x244b90);}};}function respondWithFilteredResult(_0x513d8c,_0xab1a9c){return function(_0x4c9372){if(_0x4c9372){var _0x389a53=typeof _0xab1a9c[_0x8985('0x1c')]===_0x8985('0x1d')&&typeof _0xab1a9c[_0x8985('0x1e')]==='undefined';var _0x5614ee=_0x4c9372[_0x8985('0x1f')];var _0xb485a9=_0x389a53?0x0:_0xab1a9c[_0x8985('0x1c')];var _0x46a460=_0x389a53?_0x4c9372[_0x8985('0x1f')]:_0xab1a9c[_0x8985('0x1c')]+_0xab1a9c[_0x8985('0x1e')];var _0x44a5e4;if(_0x46a460>=_0x5614ee){_0x46a460=_0x5614ee;_0x44a5e4=0xc8;}else{_0x44a5e4=0xce;}_0x513d8c[_0x8985('0x19')](_0x44a5e4);return _0x513d8c[_0x8985('0x20')](_0x8985('0x21'),_0xb485a9+'-'+_0x46a460+'/'+_0x5614ee)[_0x8985('0x1b')](_0x4c9372);}return null;};}function patchUpdates(_0x31cfd1){return function(_0x44b8ea){try{jsonpatch[_0x8985('0x22')](_0x44b8ea,_0x31cfd1,!![]);}catch(_0xba1af1){return BPromise[_0x8985('0x23')](_0xba1af1);}return _0x44b8ea[_0x8985('0x24')]();};}function saveUpdates(_0x599132,_0x2e3b59){return function(_0x118de7){if(_0x118de7){return _0x118de7['update'](_0x599132)[_0x8985('0x25')](function(_0x27ae9e){return _0x27ae9e;});}return null;};}function removeEntity(_0x35f988,_0x2b10c2){return function(_0x10c8e6){if(_0x10c8e6){return _0x10c8e6['destroy']()['then'](function(){_0x35f988[_0x8985('0x19')](0xcc)[_0x8985('0x1a')]();});}};}function handleEntityNotFound(_0x5ee26d,_0x34260a){return function(_0x5c913f){if(!_0x5c913f){_0x5ee26d[_0x8985('0x18')](0x194);}return _0x5c913f;};}function handleError(_0x10d2fa,_0x4c2476){_0x4c2476=_0x4c2476||0x1f4;return function(_0x12d7ed){logger['error'](_0x12d7ed[_0x8985('0x26')]);if(_0x12d7ed[_0x8985('0x27')]){delete _0x12d7ed['name'];}_0x10d2fa['status'](_0x4c2476)[_0x8985('0x28')](_0x12d7ed);};}exports[_0x8985('0x29')]=function(_0x2377da,_0x160ace){var _0x2366bc={},_0x593763={},_0xb19403={'count':0x0,'rows':[]};var _0x442e4a=_[_0x8985('0x2a')](db[_0x8985('0x2b')]['rawAttributes'],function(_0x6347ee){return{'name':_0x6347ee[_0x8985('0x2c')],'type':_0x6347ee[_0x8985('0x2d')][_0x8985('0x2e')]};});_0x593763[_0x8985('0x2f')]=_[_0x8985('0x2a')](_0x442e4a,'name');_0x593763[_0x8985('0x30')]=_[_0x8985('0x31')](_0x2377da[_0x8985('0x30')]);_0x593763['filters']=_[_0x8985('0x32')](_0x593763[_0x8985('0x2f')],_0x593763[_0x8985('0x30')]);_0x2366bc[_0x8985('0x33')]=_['intersection'](_0x593763['model'],qs[_0x8985('0x34')](_0x2377da[_0x8985('0x30')][_0x8985('0x34')]));_0x2366bc['attributes']=_0x2366bc['attributes']['length']?_0x2366bc[_0x8985('0x33')]:_0x593763[_0x8985('0x2f')];if(!_0x2377da[_0x8985('0x30')][_0x8985('0x35')]('nolimit')){_0x2366bc['limit']=qs[_0x8985('0x1e')](_0x2377da[_0x8985('0x30')][_0x8985('0x1e')]);_0x2366bc[_0x8985('0x1c')]=qs['offset'](_0x2377da[_0x8985('0x30')][_0x8985('0x1c')]);}_0x2366bc[_0x8985('0x36')]=qs[_0x8985('0x37')](_0x2377da[_0x8985('0x30')][_0x8985('0x37')]);_0x2366bc['where']=qs[_0x8985('0x38')](_[_0x8985('0x39')](_0x2377da[_0x8985('0x30')],_0x593763[_0x8985('0x38')]),_0x442e4a);if(_0x2377da[_0x8985('0x30')]['filter']){_0x2366bc[_0x8985('0x3a')]=_[_0x8985('0x3b')](_0x2366bc[_0x8985('0x3a')],{'$or':_[_0x8985('0x2a')](_0x442e4a,function(_0x553927){if(_0x553927[_0x8985('0x2d')]!==_0x8985('0x3c')){var _0x5c7e37={};_0x5c7e37[_0x553927[_0x8985('0x27')]]={'$like':'%'+_0x2377da[_0x8985('0x30')][_0x8985('0x3d')]+'%'};return _0x5c7e37;}})});}_0x2366bc=_['merge']({},_0x2366bc,_0x2377da[_0x8985('0x3e')]);var _0x43e412={'where':_0x2366bc[_0x8985('0x3a')]};return db[_0x8985('0x2b')][_0x8985('0x1f')](_0x43e412)[_0x8985('0x25')](function(_0x5af66e){_0xb19403[_0x8985('0x1f')]=_0x5af66e;if(_0x2377da[_0x8985('0x30')][_0x8985('0x3f')]){_0x2366bc[_0x8985('0x40')]=[{'all':!![]}];}return db['SquareRecording'][_0x8985('0x41')](_0x2366bc);})[_0x8985('0x25')](function(_0x57dda7){_0xb19403[_0x8985('0x42')]=_0x57dda7;return _0xb19403;})[_0x8985('0x25')](respondWithFilteredResult(_0x160ace,_0x2366bc))['catch'](handleError(_0x160ace,null));};exports[_0x8985('0x43')]=function(_0x2c2ee5,_0x35dde6){var _0xba9c99={'raw':!![],'where':{'id':_0x2c2ee5['params']['id']}},_0x398bfd={};_0x398bfd['model']=_[_0x8985('0x31')](db[_0x8985('0x2b')][_0x8985('0x44')]);_0x398bfd[_0x8985('0x30')]=_['keys'](_0x2c2ee5[_0x8985('0x30')]);_0x398bfd[_0x8985('0x38')]=_[_0x8985('0x32')](_0x398bfd[_0x8985('0x2f')],_0x398bfd[_0x8985('0x30')]);_0xba9c99[_0x8985('0x33')]=_[_0x8985('0x32')](_0x398bfd[_0x8985('0x2f')],qs[_0x8985('0x34')](_0x2c2ee5[_0x8985('0x30')]['fields']));_0xba9c99['attributes']=_0xba9c99[_0x8985('0x33')][_0x8985('0x45')]?_0xba9c99['attributes']:_0x398bfd['model'];if(_0x2c2ee5[_0x8985('0x30')][_0x8985('0x3f')]){_0xba9c99[_0x8985('0x40')]=[{'all':!![]}];}_0xba9c99=_['merge']({},_0xba9c99,_0x2c2ee5[_0x8985('0x3e')]);return db[_0x8985('0x2b')]['find'](_0xba9c99)[_0x8985('0x25')](handleEntityNotFound(_0x35dde6,null))['then'](respondWithResult(_0x35dde6,null))[_0x8985('0x46')](handleError(_0x35dde6,null));};exports[_0x8985('0x47')]=function(_0xa8ee74,_0x106387){return db['SquareRecording'][_0x8985('0x47')](_0xa8ee74[_0x8985('0x48')],{})[_0x8985('0x25')](respondWithResult(_0x106387,0xc9))[_0x8985('0x46')](handleError(_0x106387,null));};exports['update']=function(_0x1cafc6,_0x47fee8){if(_0x1cafc6[_0x8985('0x48')]['id']){delete _0x1cafc6['body']['id'];}return db[_0x8985('0x2b')][_0x8985('0x49')]({'where':{'id':_0x1cafc6[_0x8985('0x4a')]['id']}})['then'](handleEntityNotFound(_0x47fee8,null))['then'](saveUpdates(_0x1cafc6[_0x8985('0x48')],null))[_0x8985('0x25')](respondWithResult(_0x47fee8,null))['catch'](handleError(_0x47fee8,null));};exports['download']=function(_0x51fe7e,_0x59e9e5,_0x161e46){var _0x32c29b=require(_0x8985('0x4b'));var _0x224959=![];var _0x34c13b={};if(_0x51fe7e[_0x8985('0x30')][_0x8985('0x2d')]&&_0x51fe7e[_0x8985('0x30')][_0x8985('0x2d')]==='uniqueid'){_0x34c13b['uniqueid']=_0x51fe7e[_0x8985('0x4a')]['id'];}else{_0x34c13b['id']=_0x51fe7e['params']['id'];}return db[_0x8985('0x2b')][_0x8985('0x49')]({'where':_0x34c13b,'attributes':['id','savePath',_0x8985('0x4c')],'raw':!![]})[_0x8985('0x25')](handleEntityNotFound(_0x59e9e5,null))[_0x8985('0x25')](function(_0x11063e){if(_0x11063e){var _0x3b5c7a=_0x11063e['savePath'];var _0x5e19f8=util[_0x8985('0x4d')]('%s.cypher',_0x3b5c7a);if(fs[_0x8985('0x4e')](_0x5e19f8)){_0x224959=!![];return _0x32c29b[_0x8985('0x4f')](_0x5e19f8,_0x3b5c7a,config['secrets'][_0x8985('0x50')])[_0x8985('0x25')](function(){return _0x11063e;});}return _0x11063e;}})[_0x8985('0x25')](function(_0x347867){if(_0x347867){var _0xf2a810=_0x347867[_0x8985('0x51')];if(!fs['existsSync'](_0xf2a810)){throw new db[(_0x8985('0x52'))][(_0x8985('0x53'))](_0x8985('0x54'));}if(_0x347867[_0x8985('0x4c')]){return _0x59e9e5['download'](_0xf2a810,_0x347867[_0x8985('0x4c')]+path[_0x8985('0x55')](_0xf2a810),function(){if(_0x224959){fs['unlink'](_0xf2a810);}});}else{return _0x59e9e5[_0x8985('0x56')](_0xf2a810,function(_0x1821eb){if(_0x224959){fs[_0x8985('0x57')](_0xf2a810);}});}}})['catch'](function(_0x9e5f19){if(_0x9e5f19[_0x8985('0x58')]===_0x8985('0x54')){_0x59e9e5[_0x8985('0x19')](0x194)[_0x8985('0x28')](_0x8985('0x59'));}else{return handleError(_0x59e9e5,null);}});};exports[_0x8985('0x5a')]=function(_0x20491d,_0x560842){return db[_0x8985('0x2b')][_0x8985('0x49')]({'where':{'id':_0x20491d[_0x8985('0x4a')]['id']}})['then'](function(_0x5d1791){if(_[_0x8985('0x5b')](_0x5d1791)){throw new ReferenceError(_0x8985('0x5c'));}return _0x5d1791;})[_0x8985('0x25')](function(_0x4e7ed7){var _0x1fa6e0=_0x4e7ed7[_0x8985('0x51')];logger[_0x8985('0x5d')](_0x8985('0x5e'),_0x1fa6e0);if(!_['isNil'](_0x4e7ed7[_0x8985('0x51')])&&fs[_0x8985('0x4e')](_0x1fa6e0)){logger['info'](_0x8985('0x5f')+_0x1fa6e0+_0x8985('0x60'));fs[_0x8985('0x61')](_0x1fa6e0);}_0x1fa6e0=_0x1fa6e0+'.cypher';if(!_['isNil'](_0x4e7ed7[_0x8985('0x51')])&&fs[_0x8985('0x4e')](_0x1fa6e0)){logger[_0x8985('0x5d')]('File:\x20\x22'+_0x1fa6e0+_0x8985('0x60'));fs[_0x8985('0x61')](_0x1fa6e0);}return _0x4e7ed7;})[_0x8985('0x25')](function(_0x2ae1bd){if(!_0x2ae1bd)throw new InternalError();return _0x2ae1bd[_0x8985('0x5a')]();})[_0x8985('0x25')](function(){_0x560842[_0x8985('0x19')](0xcc)[_0x8985('0x1a')]();})[_0x8985('0x46')](handleError(_0x560842,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7fe67c5..feb9fe9 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 _0x1bb4=['request-promise','rimraf','./squareRecording.attributes','define','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x2b271b,_0x2b7fc2){var _0x360643=function(_0x1e2850){while(--_0x1e2850){_0x2b271b['push'](_0x2b271b['shift']());}};_0x360643(++_0x2b7fc2);}(_0x1bb4,0x1c7));var _0x41bb=function(_0x1345e0,_0x3871dc){_0x1345e0=_0x1345e0-0x0;var _0x5a1d73=_0x1bb4[_0x1345e0];return _0x5a1d73;};'use strict';var _=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));var logger=require(_0x41bb('0x2'))(_0x41bb('0x3'));var moment=require(_0x41bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x41bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x41bb('0x7'));module['exports']=function(_0x232b17,_0x3ab646){return _0x232b17[_0x41bb('0x8')]('SquareRecording',attributes,{'tableName':_0x41bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9261=['api','moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util'];(function(_0x1945a3,_0x5b8502){var _0x48dce1=function(_0x2a3763){while(--_0x2a3763){_0x1945a3['push'](_0x1945a3['shift']());}};_0x48dce1(++_0x5b8502);}(_0x9261,0x1de));var _0x1926=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x9261[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x1926('0x0'));var util=require(_0x1926('0x1'));var logger=require('../../config/logger')(_0x1926('0x2'));var moment=require(_0x1926('0x3'));var BPromise=require(_0x1926('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1926('0x5'));var rimraf=require(_0x1926('0x6'));var config=require(_0x1926('0x7'));var attributes=require(_0x1926('0x8'));module[_0x1926('0x9')]=function(_0x549cec,_0x17f1c6){return _0x549cec['define'](_0x1926('0xa'),attributes,{'tableName':_0x1926('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index e8a18c1..7d855bd 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 _0x362b=['raw','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','body','options'];(function(_0x1da7bd,_0x4e8054){var _0x3eeb1a=function(_0x49362c){while(--_0x49362c){_0x1da7bd['push'](_0x1da7bd['shift']());}};_0x3eeb1a(++_0x4e8054);}(_0x362b,0x177));var _0xb362=function(_0x4f6475,_0x3e21a7){_0x4f6475=_0x4f6475-0x0;var _0x413786=_0x362b[_0x4f6475];return _0x413786;};'use strict';var _=require(_0xb362('0x0'));var util=require(_0xb362('0x1'));var moment=require(_0xb362('0x2'));var BPromise=require('bluebird');var rs=require(_0xb362('0x3'));var fs=require('fs');var Redis=require(_0xb362('0x4'));var db=require(_0xb362('0x5'))['db'];var utils=require(_0xb362('0x6'));var logger=require(_0xb362('0x7'))(_0xb362('0x8'));var config=require(_0xb362('0x9'));var jayson=require(_0xb362('0xa'));var client=jayson[_0xb362('0xb')][_0xb362('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34fc1c,_0x11b2d9,_0x538fb8){return new BPromise(function(_0x57239a,_0x51a753){return client[_0xb362('0xd')](_0x34fc1c,_0x538fb8)[_0xb362('0xe')](function(_0x29160f){logger[_0xb362('0xf')]('SquareRecording,\x20%s,\x20%s',_0x11b2d9,_0xb362('0x10'));logger[_0xb362('0x11')](_0xb362('0x12'),_0x11b2d9,_0xb362('0x10'),JSON['stringify'](_0x29160f));if(_0x29160f[_0xb362('0x13')]){if(_0x29160f[_0xb362('0x13')][_0xb362('0x14')]===0x1f4){logger[_0xb362('0x13')](_0xb362('0x15'),_0x11b2d9,_0x29160f['error'][_0xb362('0x16')]);return _0x51a753(_0x29160f[_0xb362('0x13')][_0xb362('0x16')]);}logger[_0xb362('0x13')]('SquareRecording,\x20%s,\x20%s',_0x11b2d9,_0x29160f[_0xb362('0x13')][_0xb362('0x16')]);return _0x57239a(_0x29160f[_0xb362('0x13')][_0xb362('0x16')]);}else{logger[_0xb362('0xf')](_0xb362('0x15'),_0x11b2d9,_0xb362('0x10'));_0x57239a(_0x29160f[_0xb362('0x17')]['message']);}})['catch'](function(_0x35dc4b){logger[_0xb362('0x13')]('SquareRecording,\x20%s,\x20%s',_0x11b2d9,_0x35dc4b);_0x51a753(_0x35dc4b);});});}exports[_0xb362('0x18')]=function(_0x4465d2){var _0x4e57ec=this;return new Promise(function(_0x78f370,_0xa60fef){return db[_0xb362('0x19')]['create'](_0x4465d2[_0xb362('0x1a')],{'raw':_0x4465d2['options']?_0x4465d2[_0xb362('0x1b')][_0xb362('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x233090){logger[_0xb362('0xf')]('CreateSquareRecording',_0x4465d2);logger['debug'](_0xb362('0x18'),_0x4465d2,JSON[_0xb362('0x1d')](_0x233090));_0x78f370(_0x233090);})[_0xb362('0x1e')](function(_0x41580b){logger[_0xb362('0x13')](_0xb362('0x18'),_0x41580b[_0xb362('0x16')],_0x4465d2);_0xa60fef(_0x4e57ec['error'](0x1f4,_0x41580b['message']));});});}; \ No newline at end of file +var _0x37e3=['request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareRecording,\x20%s,\x20%s','result','SquareRecording','body','options','raw','CreateSquareRecording','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x549539,_0x3f0255){var _0x4b488e=function(_0x2838ab){while(--_0x2838ab){_0x549539['push'](_0x549539['shift']());}};_0x4b488e(++_0x3f0255);}(_0x37e3,0x161));var _0x337e=function(_0x160c40,_0x1d80e2){_0x160c40=_0x160c40-0x0;var _0x40a7b4=_0x37e3[_0x160c40];return _0x40a7b4;};'use strict';var _=require(_0x337e('0x0'));var util=require(_0x337e('0x1'));var moment=require('moment');var BPromise=require(_0x337e('0x2'));var rs=require(_0x337e('0x3'));var fs=require('fs');var Redis=require(_0x337e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x337e('0x5'));var logger=require(_0x337e('0x6'))('rpc');var config=require(_0x337e('0x7'));var jayson=require(_0x337e('0x8'));var client=jayson[_0x337e('0x9')][_0x337e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33caa9,_0xac991f,_0x9efce9){return new BPromise(function(_0x13ee07,_0x263ab8){return client[_0x337e('0xb')](_0x33caa9,_0x9efce9)['then'](function(_0xd533d2){logger[_0x337e('0xc')]('SquareRecording,\x20%s,\x20%s',_0xac991f,_0x337e('0xd'));logger[_0x337e('0xe')](_0x337e('0xf'),_0xac991f,_0x337e('0xd'),JSON[_0x337e('0x10')](_0xd533d2));if(_0xd533d2[_0x337e('0x11')]){if(_0xd533d2[_0x337e('0x11')]['code']===0x1f4){logger[_0x337e('0x11')]('SquareRecording,\x20%s,\x20%s',_0xac991f,_0xd533d2[_0x337e('0x11')][_0x337e('0x12')]);return _0x263ab8(_0xd533d2[_0x337e('0x11')][_0x337e('0x12')]);}logger[_0x337e('0x11')](_0x337e('0x13'),_0xac991f,_0xd533d2[_0x337e('0x11')]['message']);return _0x13ee07(_0xd533d2[_0x337e('0x11')][_0x337e('0x12')]);}else{logger[_0x337e('0xc')](_0x337e('0x13'),_0xac991f,'request\x20sent');_0x13ee07(_0xd533d2[_0x337e('0x14')][_0x337e('0x12')]);}})['catch'](function(_0x3b71e8){logger[_0x337e('0x11')]('SquareRecording,\x20%s,\x20%s',_0xac991f,_0x3b71e8);_0x263ab8(_0x3b71e8);});});}exports['CreateSquareRecording']=function(_0x5bc341){var _0x552165=this;return new Promise(function(_0x91cfc6,_0x4073bf){return db[_0x337e('0x15')]['create'](_0x5bc341[_0x337e('0x16')],{'raw':_0x5bc341[_0x337e('0x17')]?_0x5bc341[_0x337e('0x17')][_0x337e('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x138ca6){logger[_0x337e('0xc')](_0x337e('0x19'),_0x5bc341);logger['debug'](_0x337e('0x19'),_0x5bc341,JSON[_0x337e('0x10')](_0x138ca6));_0x91cfc6(_0x138ca6);})['catch'](function(_0x29884a){logger[_0x337e('0x11')](_0x337e('0x19'),_0x29884a[_0x337e('0x12')],_0x5bc341);_0x4073bf(_0x552165[_0x337e('0x11')](0x1f4,_0x29884a[_0x337e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index dbf6d21..60060df 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(_0x59eec0,_0x175ae2){var _0x378da6=function(_0x117f23){while(--_0x117f23){_0x59eec0['push'](_0x59eec0['shift']());}};_0x378da6(++_0x175ae2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +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(_0x30953e,_0x5ecdb0){var _0x4c6516=function(_0x1a15f3){while(--_0x1a15f3){_0x30953e['push'](_0x30953e['shift']());}};_0x4c6516(++_0x5ecdb0);}(_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 diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 5e1df77..0b65769 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 _0x2934=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x17e087,_0x13c9b1){var _0x254766=function(_0x27d764){while(--_0x27d764){_0x17e087['push'](_0x17e087['shift']());}};_0x254766(++_0x13c9b1);}(_0x2934,0x1cd));var _0x4293=function(_0x4f28bf,_0x42702c){_0x4f28bf=_0x4f28bf-0x0;var _0x5edb5b=_0x2934[_0x4f28bf];return _0x5edb5b;};'use strict';var Sequelize=require(_0x4293('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x4293('0x1')]},'request':{'type':Sequelize[_0x4293('0x1')]},'channel':{'type':Sequelize[_0x4293('0x1')]},'language':{'type':Sequelize[_0x4293('0x1')]},'type':{'type':Sequelize[_0x4293('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x4293('0x1')]},'callerid':{'type':Sequelize[_0x4293('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x4293('0x1')]},'callingani2':{'type':Sequelize[_0x4293('0x1')]},'callington':{'type':Sequelize[_0x4293('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x4293('0x1')]},'rdnis':{'type':Sequelize[_0x4293('0x1')]},'context':{'type':Sequelize[_0x4293('0x1')]},'extension':{'type':Sequelize[_0x4293('0x1')]},'priority':{'type':Sequelize[_0x4293('0x1')]},'enhanced':{'type':Sequelize[_0x4293('0x1')]},'accountcode':{'type':Sequelize[_0x4293('0x1')]},'threadid':{'type':Sequelize[_0x4293('0x1')]},'project_name':{'type':Sequelize[_0x4293('0x1')]},'joinAt':{'type':Sequelize[_0x4293('0x2')]},'leaveAt':{'type':Sequelize[_0x4293('0x2')]},'bot':{'type':Sequelize[_0x4293('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8a95=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x3c42d1,_0x4c7876){var _0x5d2cbd=function(_0x210717){while(--_0x210717){_0x3c42d1['push'](_0x3c42d1['shift']());}};_0x5d2cbd(++_0x4c7876);}(_0x8a95,0x10e));var _0x58a9=function(_0x118311,_0x5f11b9){_0x118311=_0x118311-0x0;var _0x3fc58d=_0x8a95[_0x118311];return _0x3fc58d;};'use strict';var Sequelize=require(_0x58a9('0x0'));module['exports']={'network':{'type':Sequelize[_0x58a9('0x1')]},'network_script':{'type':Sequelize[_0x58a9('0x1')]},'request':{'type':Sequelize[_0x58a9('0x1')]},'channel':{'type':Sequelize[_0x58a9('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x58a9('0x1')]},'uniqueid':{'type':Sequelize[_0x58a9('0x1')]},'version':{'type':Sequelize[_0x58a9('0x1')]},'callerid':{'type':Sequelize[_0x58a9('0x1')]},'calleridname':{'type':Sequelize[_0x58a9('0x1')]},'callingpres':{'type':Sequelize[_0x58a9('0x1')]},'callingani2':{'type':Sequelize[_0x58a9('0x1')]},'callington':{'type':Sequelize[_0x58a9('0x1')]},'callingtns':{'type':Sequelize[_0x58a9('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x58a9('0x1')]},'context':{'type':Sequelize[_0x58a9('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x58a9('0x1')]},'enhanced':{'type':Sequelize[_0x58a9('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x58a9('0x1')]},'project_name':{'type':Sequelize[_0x58a9('0x1')]},'joinAt':{'type':Sequelize[_0x58a9('0x2')]},'leaveAt':{'type':Sequelize[_0x58a9('0x2')]},'bot':{'type':Sequelize[_0x58a9('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index faede1e..06bbec9 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 _0x3015=['catch','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','rows','show','params','length','include','find'];(function(_0x75c3f2,_0x245ea8){var _0x3f1182=function(_0x365154){while(--_0x365154){_0x75c3f2['push'](_0x75c3f2['shift']());}};_0x3f1182(++_0x245ea8);}(_0x3015,0xd6));var _0x5301=function(_0x36a1eb,_0x1269ad){_0x36a1eb=_0x36a1eb-0x0;var _0x28e8fc=_0x3015[_0x36a1eb];return _0x28e8fc;};'use strict';var emlformat=require(_0x5301('0x0'));var rimraf=require(_0x5301('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5301('0x2'));var moment=require(_0x5301('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5301('0x4'));var util=require('util');var path=require(_0x5301('0x5'));var sox=require(_0x5301('0x6'));var csv=require(_0x5301('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5301('0x8'));var squel=require(_0x5301('0x9'));var crypto=require(_0x5301('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5301('0xb'));var toCsv=require(_0x5301('0x7'));var querystring=require(_0x5301('0xc'));var Papa=require(_0x5301('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5301('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5301('0xf'))(_0x5301('0x10'));var utils=require('../../config/utils');var config=require(_0x5301('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x5301('0x12'))['db'];function respondWithStatusCode(_0x30ea05,_0x5a42a1){_0x5a42a1=_0x5a42a1||0xcc;return function(_0x11dcc1){if(_0x11dcc1){return _0x30ea05[_0x5301('0x13')](_0x5a42a1);}return _0x30ea05[_0x5301('0x14')](_0x5a42a1)[_0x5301('0x15')]();};}function respondWithResult(_0x4a30b2,_0x1ee848){_0x1ee848=_0x1ee848||0xc8;return function(_0x1f8dc6){if(_0x1f8dc6){return _0x4a30b2[_0x5301('0x14')](_0x1ee848)[_0x5301('0x16')](_0x1f8dc6);}};}function respondWithFilteredResult(_0x24f4ba,_0x5e90d3){return function(_0x1fbc1d){if(_0x1fbc1d){var _0x1cffdf=typeof _0x5e90d3[_0x5301('0x17')]==='undefined'&&typeof _0x5e90d3['limit']===_0x5301('0x18');var _0x59ff9f=_0x1fbc1d[_0x5301('0x19')];var _0x4eacb2=_0x1cffdf?0x0:_0x5e90d3['offset'];var _0x848b95=_0x1cffdf?_0x1fbc1d[_0x5301('0x19')]:_0x5e90d3[_0x5301('0x17')]+_0x5e90d3[_0x5301('0x1a')];var _0x2deab5;if(_0x848b95>=_0x59ff9f){_0x848b95=_0x59ff9f;_0x2deab5=0xc8;}else{_0x2deab5=0xce;}_0x24f4ba['status'](_0x2deab5);return _0x24f4ba[_0x5301('0x1b')](_0x5301('0x1c'),_0x4eacb2+'-'+_0x848b95+'/'+_0x59ff9f)[_0x5301('0x16')](_0x1fbc1d);}return null;};}function patchUpdates(_0x4dbf0a){return function(_0x1c6040){try{jsonpatch[_0x5301('0x1d')](_0x1c6040,_0x4dbf0a,!![]);}catch(_0x639822){return BPromise['reject'](_0x639822);}return _0x1c6040[_0x5301('0x1e')]();};}function saveUpdates(_0x42b8e8,_0x380711){return function(_0x33f88c){if(_0x33f88c){return _0x33f88c[_0x5301('0x1f')](_0x42b8e8)[_0x5301('0x20')](function(_0x44f629){return _0x44f629;});}return null;};}function removeEntity(_0x5ef537,_0x31581d){return function(_0x29f042){if(_0x29f042){return _0x29f042[_0x5301('0x21')]()[_0x5301('0x20')](function(){_0x5ef537[_0x5301('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x496af3,_0x53c076){return function(_0x15913a){if(!_0x15913a){_0x496af3[_0x5301('0x13')](0x194);}return _0x15913a;};}function handleError(_0x12b844,_0x126b66){_0x126b66=_0x126b66||0x1f4;return function(_0x43e785){logger['error'](_0x43e785[_0x5301('0x22')]);if(_0x43e785[_0x5301('0x23')]){delete _0x43e785[_0x5301('0x23')];}_0x12b844[_0x5301('0x14')](_0x126b66)[_0x5301('0x24')](_0x43e785);};}exports[_0x5301('0x25')]=function(_0x4f2d3c,_0x271ae2){var _0x1eea88={},_0x555111={},_0xce9360={'count':0x0,'rows':[]};var _0x1022c0=_[_0x5301('0x26')](db[_0x5301('0x27')][_0x5301('0x28')],function(_0x2297bc){return{'name':_0x2297bc[_0x5301('0x29')],'type':_0x2297bc[_0x5301('0x2a')][_0x5301('0x2b')]};});_0x555111[_0x5301('0x2c')]=_[_0x5301('0x26')](_0x1022c0,_0x5301('0x23'));_0x555111['query']=_[_0x5301('0x2d')](_0x4f2d3c[_0x5301('0x2e')]);_0x555111[_0x5301('0x2f')]=_['intersection'](_0x555111[_0x5301('0x2c')],_0x555111['query']);_0x1eea88['attributes']=_[_0x5301('0x30')](_0x555111[_0x5301('0x2c')],qs['fields'](_0x4f2d3c[_0x5301('0x2e')][_0x5301('0x31')]));_0x1eea88[_0x5301('0x32')]=_0x1eea88[_0x5301('0x32')]['length']?_0x1eea88[_0x5301('0x32')]:_0x555111[_0x5301('0x2c')];if(!_0x4f2d3c['query'][_0x5301('0x33')](_0x5301('0x34'))){_0x1eea88[_0x5301('0x1a')]=qs[_0x5301('0x1a')](_0x4f2d3c['query'][_0x5301('0x1a')]);_0x1eea88[_0x5301('0x17')]=qs['offset'](_0x4f2d3c[_0x5301('0x2e')][_0x5301('0x17')]);}_0x1eea88[_0x5301('0x35')]=qs['sort'](_0x4f2d3c[_0x5301('0x2e')][_0x5301('0x36')]);_0x1eea88[_0x5301('0x37')]=qs[_0x5301('0x2f')](_['pick'](_0x4f2d3c[_0x5301('0x2e')],_0x555111['filters']),_0x1022c0);if(_0x4f2d3c[_0x5301('0x2e')][_0x5301('0x38')]){_0x1eea88['where']=_[_0x5301('0x39')](_0x1eea88[_0x5301('0x37')],{'$or':_[_0x5301('0x26')](_0x1022c0,function(_0x46c7e4){if(_0x46c7e4[_0x5301('0x2a')]!=='VIRTUAL'){var _0x1c38b8={};_0x1c38b8[_0x46c7e4['name']]={'$like':'%'+_0x4f2d3c['query']['filter']+'%'};return _0x1c38b8;}})});}_0x1eea88=_[_0x5301('0x39')]({},_0x1eea88,_0x4f2d3c[_0x5301('0x3a')]);var _0x36dd35={'where':_0x1eea88['where']};return db[_0x5301('0x27')][_0x5301('0x19')](_0x36dd35)[_0x5301('0x20')](function(_0x2c838f){_0xce9360[_0x5301('0x19')]=_0x2c838f;if(_0x4f2d3c[_0x5301('0x2e')][_0x5301('0x3b')]){_0x1eea88['include']=[{'all':!![]}];}return db[_0x5301('0x27')]['findAll'](_0x1eea88);})[_0x5301('0x20')](function(_0x4413c6){_0xce9360[_0x5301('0x3c')]=_0x4413c6;return _0xce9360;})[_0x5301('0x20')](respondWithFilteredResult(_0x271ae2,_0x1eea88))['catch'](handleError(_0x271ae2,null));};exports[_0x5301('0x3d')]=function(_0x331505,_0x49db36){var _0x1602c6={'raw':!![],'where':{'id':_0x331505[_0x5301('0x3e')]['id']}},_0x6ffdc7={};_0x6ffdc7['model']=_['keys'](db[_0x5301('0x27')][_0x5301('0x28')]);_0x6ffdc7['query']=_[_0x5301('0x2d')](_0x331505[_0x5301('0x2e')]);_0x6ffdc7['filters']=_[_0x5301('0x30')](_0x6ffdc7['model'],_0x6ffdc7[_0x5301('0x2e')]);_0x1602c6[_0x5301('0x32')]=_[_0x5301('0x30')](_0x6ffdc7[_0x5301('0x2c')],qs[_0x5301('0x31')](_0x331505[_0x5301('0x2e')][_0x5301('0x31')]));_0x1602c6[_0x5301('0x32')]=_0x1602c6[_0x5301('0x32')][_0x5301('0x3f')]?_0x1602c6[_0x5301('0x32')]:_0x6ffdc7[_0x5301('0x2c')];if(_0x331505['query'][_0x5301('0x3b')]){_0x1602c6[_0x5301('0x40')]=[{'all':!![]}];}_0x1602c6=_[_0x5301('0x39')]({},_0x1602c6,_0x331505[_0x5301('0x3a')]);return db[_0x5301('0x27')][_0x5301('0x41')](_0x1602c6)[_0x5301('0x20')](handleEntityNotFound(_0x49db36,null))[_0x5301('0x20')](respondWithResult(_0x49db36,null))[_0x5301('0x42')](handleError(_0x49db36,null));};exports[_0x5301('0x43')]=function(_0x11dc1a,_0x54d047){return db[_0x5301('0x27')][_0x5301('0x43')](_0x11dc1a[_0x5301('0x44')],{})['then'](respondWithResult(_0x54d047,0xc9))[_0x5301('0x42')](handleError(_0x54d047,null));};exports[_0x5301('0x1f')]=function(_0x10a493,_0x18d1c3){if(_0x10a493[_0x5301('0x44')]['id']){delete _0x10a493[_0x5301('0x44')]['id'];}return db[_0x5301('0x27')]['find']({'where':{'id':_0x10a493['params']['id']}})[_0x5301('0x20')](handleEntityNotFound(_0x18d1c3,null))[_0x5301('0x20')](saveUpdates(_0x10a493[_0x5301('0x44')],null))[_0x5301('0x20')](respondWithResult(_0x18d1c3,null))['catch'](handleError(_0x18d1c3,null));};exports[_0x5301('0x21')]=function(_0x3abb6f,_0xbd2ade){return db['SquareReport']['find']({'where':{'id':_0x3abb6f[_0x5301('0x3e')]['id']}})[_0x5301('0x20')](handleEntityNotFound(_0xbd2ade,null))[_0x5301('0x20')](removeEntity(_0xbd2ade,null))[_0x5301('0x42')](handleError(_0xbd2ade,null));};exports[_0x5301('0x45')]=function(_0x42fe10,_0x352edd){return db[_0x5301('0x27')][_0x5301('0x45')]()[_0x5301('0x20')](respondWithResult(_0x352edd,null))[_0x5301('0x42')](handleError(_0x352edd,null));}; \ No newline at end of file +var _0x5f82=['ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','findAll','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x57ecd9,_0x2b86bb){var _0x4dbe8e=function(_0x33ac44){while(--_0x33ac44){_0x57ecd9['push'](_0x57ecd9['shift']());}};_0x4dbe8e(++_0x2b86bb);}(_0x5f82,0x8a));var _0x25f8=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5f82[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x25f8('0x0'));var rimraf=require(_0x25f8('0x1'));var zipdir=require(_0x25f8('0x2'));var jsonpatch=require(_0x25f8('0x3'));var rp=require('request-promise');var moment=require(_0x25f8('0x4'));var BPromise=require(_0x25f8('0x5'));var Mustache=require(_0x25f8('0x6'));var util=require(_0x25f8('0x7'));var path=require(_0x25f8('0x8'));var sox=require(_0x25f8('0x9'));var csv=require('to-csv');var ejs=require(_0x25f8('0xa'));var fs=require('fs');var fs_extra=require(_0x25f8('0xb'));var _=require('lodash');var squel=require(_0x25f8('0xc'));var crypto=require('crypto');var jsforce=require(_0x25f8('0xd'));var deskjs=require(_0x25f8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x25f8('0xf'));var Papa=require(_0x25f8('0x10'));var Redis=require(_0x25f8('0x11'));var authService=require(_0x25f8('0x12'));var qs=require(_0x25f8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25f8('0x14'));var logger=require('../../config/logger')(_0x25f8('0x15'));var utils=require(_0x25f8('0x16'));var config=require(_0x25f8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x25f8('0x18'))['db'];function respondWithStatusCode(_0x304696,_0x323e00){_0x323e00=_0x323e00||0xcc;return function(_0x77e2a9){if(_0x77e2a9){return _0x304696[_0x25f8('0x19')](_0x323e00);}return _0x304696[_0x25f8('0x1a')](_0x323e00)[_0x25f8('0x1b')]();};}function respondWithResult(_0x3a0420,_0x44ca1d){_0x44ca1d=_0x44ca1d||0xc8;return function(_0x214db4){if(_0x214db4){return _0x3a0420[_0x25f8('0x1a')](_0x44ca1d)[_0x25f8('0x1c')](_0x214db4);}};}function respondWithFilteredResult(_0x4f3161,_0x59a038){return function(_0x4f88dc){if(_0x4f88dc){var _0x44f117=typeof _0x59a038[_0x25f8('0x1d')]==='undefined'&&typeof _0x59a038[_0x25f8('0x1e')]===_0x25f8('0x1f');var _0x2e0bd1=_0x4f88dc[_0x25f8('0x20')];var _0x2633db=_0x44f117?0x0:_0x59a038['offset'];var _0x138854=_0x44f117?_0x4f88dc[_0x25f8('0x20')]:_0x59a038['offset']+_0x59a038[_0x25f8('0x1e')];var _0x44e6c0;if(_0x138854>=_0x2e0bd1){_0x138854=_0x2e0bd1;_0x44e6c0=0xc8;}else{_0x44e6c0=0xce;}_0x4f3161[_0x25f8('0x1a')](_0x44e6c0);return _0x4f3161['set'](_0x25f8('0x21'),_0x2633db+'-'+_0x138854+'/'+_0x2e0bd1)[_0x25f8('0x1c')](_0x4f88dc);}return null;};}function patchUpdates(_0x58b89e){return function(_0x4ceec0){try{jsonpatch[_0x25f8('0x22')](_0x4ceec0,_0x58b89e,!![]);}catch(_0x5060f6){return BPromise[_0x25f8('0x23')](_0x5060f6);}return _0x4ceec0[_0x25f8('0x24')]();};}function saveUpdates(_0x367e02,_0x35c3b1){return function(_0x503564){if(_0x503564){return _0x503564[_0x25f8('0x25')](_0x367e02)[_0x25f8('0x26')](function(_0x475e65){return _0x475e65;});}return null;};}function removeEntity(_0x3d83be,_0x191b0d){return function(_0x26a351){if(_0x26a351){return _0x26a351[_0x25f8('0x27')]()[_0x25f8('0x26')](function(){_0x3d83be[_0x25f8('0x1a')](0xcc)[_0x25f8('0x1b')]();});}};}function handleEntityNotFound(_0x10495e,_0x3672b1){return function(_0x43859f){if(!_0x43859f){_0x10495e['sendStatus'](0x194);}return _0x43859f;};}function handleError(_0x158faa,_0xa09b98){_0xa09b98=_0xa09b98||0x1f4;return function(_0x155b22){logger['error'](_0x155b22[_0x25f8('0x28')]);if(_0x155b22[_0x25f8('0x29')]){delete _0x155b22[_0x25f8('0x29')];}_0x158faa[_0x25f8('0x1a')](_0xa09b98)['send'](_0x155b22);};}exports[_0x25f8('0x2a')]=function(_0x21b16a,_0x2e8814){var _0x4c389c={},_0x4be0db={},_0x6d8acb={'count':0x0,'rows':[]};var _0x1e13ea=_[_0x25f8('0x2b')](db[_0x25f8('0x2c')][_0x25f8('0x2d')],function(_0x201807){return{'name':_0x201807[_0x25f8('0x2e')],'type':_0x201807[_0x25f8('0x2f')][_0x25f8('0x30')]};});_0x4be0db[_0x25f8('0x31')]=_[_0x25f8('0x2b')](_0x1e13ea,'name');_0x4be0db['query']=_[_0x25f8('0x32')](_0x21b16a[_0x25f8('0x33')]);_0x4be0db[_0x25f8('0x34')]=_[_0x25f8('0x35')](_0x4be0db['model'],_0x4be0db[_0x25f8('0x33')]);_0x4c389c[_0x25f8('0x36')]=_[_0x25f8('0x35')](_0x4be0db[_0x25f8('0x31')],qs['fields'](_0x21b16a[_0x25f8('0x33')][_0x25f8('0x37')]));_0x4c389c[_0x25f8('0x36')]=_0x4c389c['attributes'][_0x25f8('0x38')]?_0x4c389c[_0x25f8('0x36')]:_0x4be0db[_0x25f8('0x31')];if(!_0x21b16a['query'][_0x25f8('0x39')](_0x25f8('0x3a'))){_0x4c389c[_0x25f8('0x1e')]=qs[_0x25f8('0x1e')](_0x21b16a['query'][_0x25f8('0x1e')]);_0x4c389c['offset']=qs[_0x25f8('0x1d')](_0x21b16a[_0x25f8('0x33')][_0x25f8('0x1d')]);}_0x4c389c[_0x25f8('0x3b')]=qs[_0x25f8('0x3c')](_0x21b16a['query'][_0x25f8('0x3c')]);_0x4c389c[_0x25f8('0x3d')]=qs['filters'](_[_0x25f8('0x3e')](_0x21b16a['query'],_0x4be0db[_0x25f8('0x34')]),_0x1e13ea);if(_0x21b16a[_0x25f8('0x33')]['filter']){_0x4c389c[_0x25f8('0x3d')]=_[_0x25f8('0x3f')](_0x4c389c[_0x25f8('0x3d')],{'$or':_['map'](_0x1e13ea,function(_0x458f57){if(_0x458f57[_0x25f8('0x2f')]!==_0x25f8('0x40')){var _0x55629e={};_0x55629e[_0x458f57[_0x25f8('0x29')]]={'$like':'%'+_0x21b16a[_0x25f8('0x33')]['filter']+'%'};return _0x55629e;}})});}_0x4c389c=_[_0x25f8('0x3f')]({},_0x4c389c,_0x21b16a[_0x25f8('0x41')]);var _0x351ed1={'where':_0x4c389c[_0x25f8('0x3d')]};return db[_0x25f8('0x2c')][_0x25f8('0x20')](_0x351ed1)['then'](function(_0x4cedf2){_0x6d8acb['count']=_0x4cedf2;if(_0x21b16a[_0x25f8('0x33')]['includeAll']){_0x4c389c['include']=[{'all':!![]}];}return db[_0x25f8('0x2c')][_0x25f8('0x42')](_0x4c389c);})[_0x25f8('0x26')](function(_0x17e5d1){_0x6d8acb['rows']=_0x17e5d1;return _0x6d8acb;})[_0x25f8('0x26')](respondWithFilteredResult(_0x2e8814,_0x4c389c))[_0x25f8('0x43')](handleError(_0x2e8814,null));};exports[_0x25f8('0x44')]=function(_0x4eda9e,_0x23629c){var _0x11b467={'raw':!![],'where':{'id':_0x4eda9e['params']['id']}},_0x2581b1={};_0x2581b1[_0x25f8('0x31')]=_[_0x25f8('0x32')](db[_0x25f8('0x2c')][_0x25f8('0x2d')]);_0x2581b1[_0x25f8('0x33')]=_[_0x25f8('0x32')](_0x4eda9e['query']);_0x2581b1[_0x25f8('0x34')]=_[_0x25f8('0x35')](_0x2581b1['model'],_0x2581b1[_0x25f8('0x33')]);_0x11b467[_0x25f8('0x36')]=_[_0x25f8('0x35')](_0x2581b1[_0x25f8('0x31')],qs[_0x25f8('0x37')](_0x4eda9e[_0x25f8('0x33')][_0x25f8('0x37')]));_0x11b467[_0x25f8('0x36')]=_0x11b467[_0x25f8('0x36')]['length']?_0x11b467[_0x25f8('0x36')]:_0x2581b1[_0x25f8('0x31')];if(_0x4eda9e['query'][_0x25f8('0x45')]){_0x11b467['include']=[{'all':!![]}];}_0x11b467=_[_0x25f8('0x3f')]({},_0x11b467,_0x4eda9e[_0x25f8('0x41')]);return db[_0x25f8('0x2c')][_0x25f8('0x46')](_0x11b467)[_0x25f8('0x26')](handleEntityNotFound(_0x23629c,null))[_0x25f8('0x26')](respondWithResult(_0x23629c,null))['catch'](handleError(_0x23629c,null));};exports['create']=function(_0xb30525,_0x455cf6){return db[_0x25f8('0x2c')][_0x25f8('0x47')](_0xb30525['body'],{})[_0x25f8('0x26')](respondWithResult(_0x455cf6,0xc9))[_0x25f8('0x43')](handleError(_0x455cf6,null));};exports[_0x25f8('0x25')]=function(_0x1003cc,_0x1ebecb){if(_0x1003cc['body']['id']){delete _0x1003cc[_0x25f8('0x48')]['id'];}return db[_0x25f8('0x2c')][_0x25f8('0x46')]({'where':{'id':_0x1003cc[_0x25f8('0x49')]['id']}})[_0x25f8('0x26')](handleEntityNotFound(_0x1ebecb,null))[_0x25f8('0x26')](saveUpdates(_0x1003cc['body'],null))[_0x25f8('0x26')](respondWithResult(_0x1ebecb,null))[_0x25f8('0x43')](handleError(_0x1ebecb,null));};exports[_0x25f8('0x27')]=function(_0x90696f,_0x533b4a){return db['SquareReport'][_0x25f8('0x46')]({'where':{'id':_0x90696f[_0x25f8('0x49')]['id']}})['then'](handleEntityNotFound(_0x533b4a,null))[_0x25f8('0x26')](removeEntity(_0x533b4a,null))['catch'](handleError(_0x533b4a,null));};exports['describe']=function(_0x4a3a1b,_0x7e585f){return db['SquareReport']['describe']()[_0x25f8('0x26')](respondWithResult(_0x7e585f,null))['catch'](handleError(_0x7e585f,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a3fe708..15d8360 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 _0x16a8=['bluebird','request-promise','path','../../config/environment','define','SquareReport','report_square','project_name','leaveAt','util','../../config/logger','api','moment'];(function(_0x335532,_0x5e1fb0){var _0x576d2b=function(_0x5806e6){while(--_0x5806e6){_0x335532['push'](_0x335532['shift']());}};_0x576d2b(++_0x5e1fb0);}(_0x16a8,0xd9));var _0x816a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x16a8[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x816a('0x0'));var logger=require(_0x816a('0x1'))(_0x816a('0x2'));var moment=require(_0x816a('0x3'));var BPromise=require(_0x816a('0x4'));var rp=require(_0x816a('0x5'));var fs=require('fs');var path=require(_0x816a('0x6'));var rimraf=require('rimraf');var config=require(_0x816a('0x7'));var attributes=require('./squareReport.attributes');module['exports']=function(_0xfc02ac,_0x349cb3){return _0xfc02ac[_0x816a('0x8')](_0x816a('0x9'),attributes,{'tableName':_0x816a('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x816a('0xb')]},{'name':_0x816a('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe2c=['bluebird','rimraf','../../config/environment','./squareReport.attributes','SquareReport','uid_pname','uniqueid','project_name','lodash','api','moment'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0xfe2c,0x168));var _0xcfe2=function(_0x212a80,_0x45235a){_0x212a80=_0x212a80-0x0;var _0xcac84a=_0xfe2c[_0x212a80];return _0xcac84a;};'use strict';var _=require(_0xcfe2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfe2('0x1'));var moment=require(_0xcfe2('0x2'));var BPromise=require(_0xcfe2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcfe2('0x4'));var config=require(_0xcfe2('0x5'));var attributes=require(_0xcfe2('0x6'));module['exports']=function(_0x393d0b,_0x6aa05d){return _0x393d0b['define'](_0xcfe2('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xcfe2('0x8'),'fields':[_0xcfe2('0x9'),_0xcfe2('0xa')]},{'name':'leaveAt','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 f58cd22..090f302 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 _0x3109=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateSquareReport','create','body','options','info','debug','stringify','UpdateSquareReport','SquareReport','update','where','limit','moment','bluebird','randomstring','ioredis'];(function(_0x36213c,_0x32e283){var _0xebc53=function(_0xb32a8b){while(--_0xb32a8b){_0x36213c['push'](_0x36213c['shift']());}};_0xebc53(++_0x32e283);}(_0x3109,0xf4));var _0x9310=function(_0x3ee12f,_0x29918a){_0x3ee12f=_0x3ee12f-0x0;var _0x5463f7=_0x3109[_0x3ee12f];return _0x5463f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9310('0x0'));var BPromise=require(_0x9310('0x1'));var rs=require(_0x9310('0x2'));var fs=require('fs');var Redis=require(_0x9310('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9310('0x4'));var logger=require(_0x9310('0x5'))(_0x9310('0x6'));var config=require(_0x9310('0x7'));var jayson=require(_0x9310('0x8'));var client=jayson['client'][_0x9310('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ccc46,_0x37c90d,_0x382ffd){return new BPromise(function(_0xa7388b,_0xdaec11){return client['request'](_0x5ccc46,_0x382ffd)[_0x9310('0xa')](function(_0x57adf5){logger['info'](_0x9310('0xb'),_0x37c90d,_0x9310('0xc'));logger['debug'](_0x9310('0xd'),_0x37c90d,'request\x20sent',JSON['stringify'](_0x57adf5));if(_0x57adf5['error']){if(_0x57adf5['error'][_0x9310('0xe')]===0x1f4){logger[_0x9310('0xf')](_0x9310('0xb'),_0x37c90d,_0x57adf5['error'][_0x9310('0x10')]);return _0xdaec11(_0x57adf5[_0x9310('0xf')][_0x9310('0x10')]);}logger[_0x9310('0xf')](_0x9310('0xb'),_0x37c90d,_0x57adf5[_0x9310('0xf')]['message']);return _0xa7388b(_0x57adf5[_0x9310('0xf')][_0x9310('0x10')]);}else{logger['info'](_0x9310('0xb'),_0x37c90d,_0x9310('0xc'));_0xa7388b(_0x57adf5[_0x9310('0x11')][_0x9310('0x10')]);}})[_0x9310('0x12')](function(_0x5c0c8c){logger[_0x9310('0xf')](_0x9310('0xb'),_0x37c90d,_0x5c0c8c);_0xdaec11(_0x5c0c8c);});});}exports[_0x9310('0x13')]=function(_0x4cde4d){var _0x1f14ec=this;return new Promise(function(_0x5f9c7e,_0x591685){return db['SquareReport'][_0x9310('0x14')](_0x4cde4d[_0x9310('0x15')],{'raw':_0x4cde4d['options']?_0x4cde4d[_0x9310('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x9310('0xa')](function(_0x5eb071){logger[_0x9310('0x17')](_0x9310('0x13'),_0x4cde4d);logger[_0x9310('0x18')]('CreateSquareReport',_0x4cde4d,JSON[_0x9310('0x19')](_0x5eb071));_0x5f9c7e(_0x5eb071);})[_0x9310('0x12')](function(_0x668f2a){logger[_0x9310('0xf')](_0x9310('0x13'),_0x668f2a[_0x9310('0x10')],_0x4cde4d);_0x591685(_0x1f14ec['error'](0x1f4,_0x668f2a[_0x9310('0x10')]));});});};exports[_0x9310('0x1a')]=function(_0x219a51){var _0x39caf4=this;return new Promise(function(_0x49d71b,_0xb9a157){return db[_0x9310('0x1b')][_0x9310('0x1c')](_0x219a51[_0x9310('0x15')],{'raw':_0x219a51[_0x9310('0x16')]?_0x219a51[_0x9310('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x219a51[_0x9310('0x16')]?_0x219a51['options'][_0x9310('0x1d')]||null:null,'attributes':_0x219a51[_0x9310('0x16')]?_0x219a51[_0x9310('0x16')]['attributes']||null:null,'limit':_0x219a51[_0x9310('0x16')]?_0x219a51[_0x9310('0x16')][_0x9310('0x1e')]||null:null})[_0x9310('0xa')](function(_0x2a6c04){logger[_0x9310('0x17')](_0x9310('0x1a'),_0x219a51);logger[_0x9310('0x18')](_0x9310('0x1a'),_0x219a51,JSON['stringify'](_0x2a6c04));_0x49d71b(_0x2a6c04);})[_0x9310('0x12')](function(_0x2d86ee){logger[_0x9310('0xf')](_0x9310('0x1a'),_0x2d86ee[_0x9310('0x10')],_0x219a51);_0xb9a157(_0x39caf4[_0x9310('0xf')](0x1f4,_0x2d86ee[_0x9310('0x10')]));});});}; \ No newline at end of file +var _0x87a5=['stringify','error','code','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','create','body','options','info','debug','UpdateSquareReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87a5,0xb3));var _0x587a=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x87a5[_0x4ea69d];return _0x5318e0;};'use strict';var _=require('lodash');var util=require(_0x587a('0x0'));var moment=require(_0x587a('0x1'));var BPromise=require(_0x587a('0x2'));var rs=require(_0x587a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x587a('0x4'));var logger=require(_0x587a('0x5'))(_0x587a('0x6'));var config=require('../../config/environment');var jayson=require(_0x587a('0x7'));var client=jayson['client'][_0x587a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x506bce,_0x542580,_0x4778a8){return new BPromise(function(_0x4c4fe6,_0x308e8c){return client[_0x587a('0x9')](_0x506bce,_0x4778a8)[_0x587a('0xa')](function(_0x3b7ae4){logger['info']('SquareReport,\x20%s,\x20%s',_0x542580,_0x587a('0xb'));logger['debug'](_0x587a('0xc'),_0x542580,'request\x20sent',JSON[_0x587a('0xd')](_0x3b7ae4));if(_0x3b7ae4[_0x587a('0xe')]){if(_0x3b7ae4[_0x587a('0xe')][_0x587a('0xf')]===0x1f4){logger[_0x587a('0xe')](_0x587a('0x10'),_0x542580,_0x3b7ae4[_0x587a('0xe')]['message']);return _0x308e8c(_0x3b7ae4[_0x587a('0xe')]['message']);}logger[_0x587a('0xe')](_0x587a('0x10'),_0x542580,_0x3b7ae4[_0x587a('0xe')][_0x587a('0x11')]);return _0x4c4fe6(_0x3b7ae4['error'][_0x587a('0x11')]);}else{logger['info'](_0x587a('0x10'),_0x542580,'request\x20sent');_0x4c4fe6(_0x3b7ae4['result'][_0x587a('0x11')]);}})[_0x587a('0x12')](function(_0x1d320b){logger[_0x587a('0xe')](_0x587a('0x10'),_0x542580,_0x1d320b);_0x308e8c(_0x1d320b);});});}exports[_0x587a('0x13')]=function(_0x54c431){var _0x33ccee=this;return new Promise(function(_0x327dc9,_0x9e8251){return db[_0x587a('0x14')][_0x587a('0x15')](_0x54c431[_0x587a('0x16')],{'raw':_0x54c431[_0x587a('0x17')]?_0x54c431[_0x587a('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x587a('0xa')](function(_0x1389e0){logger[_0x587a('0x18')](_0x587a('0x13'),_0x54c431);logger[_0x587a('0x19')]('CreateSquareReport',_0x54c431,JSON[_0x587a('0xd')](_0x1389e0));_0x327dc9(_0x1389e0);})[_0x587a('0x12')](function(_0x517fd0){logger[_0x587a('0xe')](_0x587a('0x13'),_0x517fd0[_0x587a('0x11')],_0x54c431);_0x9e8251(_0x33ccee[_0x587a('0xe')](0x1f4,_0x517fd0[_0x587a('0x11')]));});});};exports[_0x587a('0x1a')]=function(_0x3e1c20){var _0x574828=this;return new Promise(function(_0x541157,_0x7bd867){return db['SquareReport'][_0x587a('0x1b')](_0x3e1c20[_0x587a('0x16')],{'raw':_0x3e1c20['options']?_0x3e1c20[_0x587a('0x17')][_0x587a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e1c20[_0x587a('0x17')]?_0x3e1c20['options'][_0x587a('0x1d')]||null:null,'attributes':_0x3e1c20[_0x587a('0x17')]?_0x3e1c20[_0x587a('0x17')][_0x587a('0x1e')]||null:null,'limit':_0x3e1c20[_0x587a('0x17')]?_0x3e1c20[_0x587a('0x17')][_0x587a('0x1f')]||null:null})[_0x587a('0xa')](function(_0xfacece){logger[_0x587a('0x18')](_0x587a('0x1a'),_0x3e1c20);logger['debug']('UpdateSquareReport',_0x3e1c20,JSON[_0x587a('0xd')](_0xfacece));_0x541157(_0xfacece);})[_0x587a('0x12')](function(_0x405be4){logger[_0x587a('0xe')](_0x587a('0x1a'),_0x405be4['message'],_0x3e1c20);_0x7bd867(_0x574828['error'](0x1f4,_0x405be4['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d88243a..6537bb3 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 _0xdfaa=['./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service'];(function(_0x209108,_0x5af6f5){var _0x4f4f80=function(_0x12b125){while(--_0x12b125){_0x209108['push'](_0x209108['shift']());}};_0x4f4f80(++_0x5af6f5);}(_0xdfaa,0x1bb));var _0xadfa=function(_0x127457,_0x31d585){_0x127457=_0x127457-0x0;var _0x1d31d4=_0xdfaa[_0x127457];return _0x1d31d4;};'use strict';var multer=require('multer');var util=require(_0xadfa('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xadfa('0x1'));var router=express[_0xadfa('0x2')]();var fs_extra=require(_0xadfa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xadfa('0x4'));var config=require('../../config/environment');var controller=require(_0xadfa('0x5'));router[_0xadfa('0x6')]('/',auth[_0xadfa('0x7')](),controller[_0xadfa('0x8')]);router[_0xadfa('0x6')](_0xadfa('0x9'),auth[_0xadfa('0x7')](),controller['describe']);router[_0xadfa('0x6')](_0xadfa('0xa'),auth[_0xadfa('0x7')](),controller['show']);router[_0xadfa('0xb')]('/',auth[_0xadfa('0x7')](),controller['create']);router['put'](_0xadfa('0xa'),auth[_0xadfa('0x7')](),controller[_0xadfa('0xc')]);router[_0xadfa('0xd')](_0xadfa('0xa'),auth[_0xadfa('0x7')](),controller[_0xadfa('0xe')]);module[_0xadfa('0xf')]=router; \ No newline at end of file +var _0x9ab7=['Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x367cad,_0x23edf3){var _0x540d05=function(_0x20b6fc){while(--_0x20b6fc){_0x367cad['push'](_0x367cad['shift']());}};_0x540d05(++_0x23edf3);}(_0x9ab7,0xf8));var _0x79ab=function(_0x100278,_0x186c47){_0x100278=_0x100278-0x0;var _0x3b0556=_0x9ab7[_0x100278];return _0x3b0556;};'use strict';var multer=require(_0x79ab('0x0'));var util=require('util');var path=require(_0x79ab('0x1'));var timeout=require(_0x79ab('0x2'));var express=require(_0x79ab('0x3'));var router=express[_0x79ab('0x4')]();var fs_extra=require(_0x79ab('0x5'));var auth=require(_0x79ab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x79ab('0x7'));var controller=require(_0x79ab('0x8'));router[_0x79ab('0x9')]('/',auth['isAuthenticated'](),controller[_0x79ab('0xa')]);router[_0x79ab('0x9')](_0x79ab('0xb'),auth['isAuthenticated'](),controller[_0x79ab('0xc')]);router['get'](_0x79ab('0xd'),auth[_0x79ab('0xe')](),controller[_0x79ab('0xf')]);router[_0x79ab('0x10')]('/',auth[_0x79ab('0xe')](),controller['create']);router[_0x79ab('0x11')](_0x79ab('0xd'),auth[_0x79ab('0xe')](),controller[_0x79ab('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x79ab('0x13')]);module[_0x79ab('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 014ae1e..99cec43 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 _0x7152=['sequelize','exports','STRING','TEXT'];(function(_0x2b47ad,_0x55c7cc){var _0x1a2426=function(_0x47285b){while(--_0x47285b){_0x2b47ad['push'](_0x2b47ad['shift']());}};_0x1a2426(++_0x55c7cc);}(_0x7152,0xb0));var _0x2715=function(_0x2a2766,_0x475265){_0x2a2766=_0x2a2766-0x0;var _0x30a56c=_0x7152[_0x2a2766];return _0x30a56c;};'use strict';var Sequelize=require(_0x2715('0x0'));module[_0x2715('0x1')]={'uniqueid':{'type':Sequelize[_0x2715('0x2')]},'node':{'type':Sequelize[_0x2715('0x2')]},'application':{'type':Sequelize[_0x2715('0x2')]},'data':{'type':Sequelize[_0x2715('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x2715('0x2')]}}; \ No newline at end of file +var _0x92b9=['STRING','TEXT','exports'];(function(_0x3d55bd,_0x561577){var _0x4c7ba9=function(_0x52a4f8){while(--_0x52a4f8){_0x3d55bd['push'](_0x3d55bd['shift']());}};_0x4c7ba9(++_0x561577);}(_0x92b9,0x170));var _0x992b=function(_0x125c55,_0x911db0){_0x125c55=_0x125c55-0x0;var _0x2dfd5a=_0x92b9[_0x125c55];return _0x2dfd5a;};'use strict';var Sequelize=require('sequelize');module[_0x992b('0x0')]={'uniqueid':{'type':Sequelize[_0x992b('0x1')]},'node':{'type':Sequelize[_0x992b('0x1')]},'application':{'type':Sequelize[_0x992b('0x1')]},'data':{'type':Sequelize[_0x992b('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x992b('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9e8fc95..faa1e32 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 _0xf948=['count','offset','limit','set','Content-Range','json','update','then','destroy','end','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','rows','catch','show','params','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','undefined'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf948,0x79));var _0x8f94=function(_0x1e6fe1,_0x2ba9d0){_0x1e6fe1=_0x1e6fe1-0x0;var _0x31b4c3=_0xf948[_0x1e6fe1];return _0x31b4c3;};'use strict';var emlformat=require(_0x8f94('0x0'));var rimraf=require(_0x8f94('0x1'));var zipdir=require(_0x8f94('0x2'));var jsonpatch=require(_0x8f94('0x3'));var rp=require('request-promise');var moment=require(_0x8f94('0x4'));var BPromise=require(_0x8f94('0x5'));var Mustache=require(_0x8f94('0x6'));var util=require(_0x8f94('0x7'));var path=require('path');var sox=require(_0x8f94('0x8'));var csv=require(_0x8f94('0x9'));var ejs=require(_0x8f94('0xa'));var fs=require('fs');var fs_extra=require(_0x8f94('0xb'));var _=require(_0x8f94('0xc'));var squel=require(_0x8f94('0xd'));var crypto=require(_0x8f94('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8f94('0xf'));var toCsv=require(_0x8f94('0x9'));var querystring=require(_0x8f94('0x10'));var Papa=require(_0x8f94('0x11'));var Redis=require(_0x8f94('0x12'));var authService=require(_0x8f94('0x13'));var qs=require(_0x8f94('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f94('0x15'));var logger=require(_0x8f94('0x16'))(_0x8f94('0x17'));var utils=require(_0x8f94('0x18'));var config=require(_0x8f94('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f94('0x1a'))['db'];function respondWithStatusCode(_0x438f51,_0x2a61a5){_0x2a61a5=_0x2a61a5||0xcc;return function(_0x351d76){if(_0x351d76){return _0x438f51['sendStatus'](_0x2a61a5);}return _0x438f51['status'](_0x2a61a5)['end']();};}function respondWithResult(_0x2b9ee0,_0x57c956){_0x57c956=_0x57c956||0xc8;return function(_0x50dbf5){if(_0x50dbf5){return _0x2b9ee0[_0x8f94('0x1b')](_0x57c956)['json'](_0x50dbf5);}};}function respondWithFilteredResult(_0xb6be16,_0xaaab92){return function(_0x1a81f9){if(_0x1a81f9){var _0x2f5e32=typeof _0xaaab92['offset']===_0x8f94('0x1c')&&typeof _0xaaab92['limit']===_0x8f94('0x1c');var _0x4d72dc=_0x1a81f9[_0x8f94('0x1d')];var _0x16d54d=_0x2f5e32?0x0:_0xaaab92[_0x8f94('0x1e')];var _0x46884e=_0x2f5e32?_0x1a81f9[_0x8f94('0x1d')]:_0xaaab92[_0x8f94('0x1e')]+_0xaaab92[_0x8f94('0x1f')];var _0x14c5ce;if(_0x46884e>=_0x4d72dc){_0x46884e=_0x4d72dc;_0x14c5ce=0xc8;}else{_0x14c5ce=0xce;}_0xb6be16[_0x8f94('0x1b')](_0x14c5ce);return _0xb6be16[_0x8f94('0x20')](_0x8f94('0x21'),_0x16d54d+'-'+_0x46884e+'/'+_0x4d72dc)[_0x8f94('0x22')](_0x1a81f9);}return null;};}function patchUpdates(_0x3b8ac6){return function(_0x134c04){try{jsonpatch['apply'](_0x134c04,_0x3b8ac6,!![]);}catch(_0x21d5f2){return BPromise['reject'](_0x21d5f2);}return _0x134c04['save']();};}function saveUpdates(_0x43ed65,_0x35b8cd){return function(_0x48cd25){if(_0x48cd25){return _0x48cd25[_0x8f94('0x23')](_0x43ed65)[_0x8f94('0x24')](function(_0x586a1b){return _0x586a1b;});}return null;};}function removeEntity(_0x5b9e32,_0xd4e5dd){return function(_0xec894f){if(_0xec894f){return _0xec894f[_0x8f94('0x25')]()[_0x8f94('0x24')](function(){_0x5b9e32[_0x8f94('0x1b')](0xcc)[_0x8f94('0x26')]();});}};}function handleEntityNotFound(_0x4c6825,_0x1a212b){return function(_0x39d707){if(!_0x39d707){_0x4c6825['sendStatus'](0x194);}return _0x39d707;};}function handleError(_0x597739,_0x201fe3){_0x201fe3=_0x201fe3||0x1f4;return function(_0x4daa3b){logger[_0x8f94('0x27')](_0x4daa3b[_0x8f94('0x28')]);if(_0x4daa3b[_0x8f94('0x29')]){delete _0x4daa3b['name'];}_0x597739[_0x8f94('0x1b')](_0x201fe3)[_0x8f94('0x2a')](_0x4daa3b);};}exports['index']=function(_0x54754d,_0xbe273e){var _0x1f5f99={},_0x4d0ffc={},_0x39e183={'count':0x0,'rows':[]};var _0x34a6c8=_[_0x8f94('0x2b')](db[_0x8f94('0x2c')][_0x8f94('0x2d')],function(_0x796bdb){return{'name':_0x796bdb[_0x8f94('0x2e')],'type':_0x796bdb['type'][_0x8f94('0x2f')]};});_0x4d0ffc[_0x8f94('0x30')]=_[_0x8f94('0x2b')](_0x34a6c8,'name');_0x4d0ffc['query']=_[_0x8f94('0x31')](_0x54754d['query']);_0x4d0ffc[_0x8f94('0x32')]=_[_0x8f94('0x33')](_0x4d0ffc[_0x8f94('0x30')],_0x4d0ffc[_0x8f94('0x34')]);_0x1f5f99[_0x8f94('0x35')]=_[_0x8f94('0x33')](_0x4d0ffc['model'],qs[_0x8f94('0x36')](_0x54754d[_0x8f94('0x34')][_0x8f94('0x36')]));_0x1f5f99[_0x8f94('0x35')]=_0x1f5f99[_0x8f94('0x35')][_0x8f94('0x37')]?_0x1f5f99[_0x8f94('0x35')]:_0x4d0ffc[_0x8f94('0x30')];if(!_0x54754d[_0x8f94('0x34')][_0x8f94('0x38')](_0x8f94('0x39'))){_0x1f5f99[_0x8f94('0x1f')]=qs[_0x8f94('0x1f')](_0x54754d[_0x8f94('0x34')]['limit']);_0x1f5f99[_0x8f94('0x1e')]=qs['offset'](_0x54754d[_0x8f94('0x34')]['offset']);}_0x1f5f99[_0x8f94('0x3a')]=qs['sort'](_0x54754d[_0x8f94('0x34')][_0x8f94('0x3b')]);_0x1f5f99[_0x8f94('0x3c')]=qs['filters'](_[_0x8f94('0x3d')](_0x54754d[_0x8f94('0x34')],_0x4d0ffc['filters']),_0x34a6c8);if(_0x54754d['query']['filter']){_0x1f5f99['where']=_[_0x8f94('0x3e')](_0x1f5f99[_0x8f94('0x3c')],{'$or':_[_0x8f94('0x2b')](_0x34a6c8,function(_0x44d5a8){if(_0x44d5a8[_0x8f94('0x3f')]!=='VIRTUAL'){var _0x3ccdc2={};_0x3ccdc2[_0x44d5a8[_0x8f94('0x29')]]={'$like':'%'+_0x54754d[_0x8f94('0x34')][_0x8f94('0x40')]+'%'};return _0x3ccdc2;}})});}_0x1f5f99=_['merge']({},_0x1f5f99,_0x54754d[_0x8f94('0x41')]);var _0x2873c2={'where':_0x1f5f99[_0x8f94('0x3c')]};return db['SquareDetailsReport'][_0x8f94('0x1d')](_0x2873c2)[_0x8f94('0x24')](function(_0x21c36e){_0x39e183[_0x8f94('0x1d')]=_0x21c36e;if(_0x54754d[_0x8f94('0x34')][_0x8f94('0x42')]){_0x1f5f99[_0x8f94('0x43')]=[{'all':!![]}];}return db[_0x8f94('0x2c')]['findAll'](_0x1f5f99);})[_0x8f94('0x24')](function(_0x21b505){_0x39e183[_0x8f94('0x44')]=_0x21b505;return _0x39e183;})['then'](respondWithFilteredResult(_0xbe273e,_0x1f5f99))[_0x8f94('0x45')](handleError(_0xbe273e,null));};exports[_0x8f94('0x46')]=function(_0x14de98,_0x2cc002){var _0x74751e={'raw':!![],'where':{'id':_0x14de98[_0x8f94('0x47')]['id']}},_0x36c82b={};_0x36c82b[_0x8f94('0x30')]=_[_0x8f94('0x31')](db[_0x8f94('0x2c')][_0x8f94('0x2d')]);_0x36c82b[_0x8f94('0x34')]=_['keys'](_0x14de98[_0x8f94('0x34')]);_0x36c82b[_0x8f94('0x32')]=_[_0x8f94('0x33')](_0x36c82b[_0x8f94('0x30')],_0x36c82b[_0x8f94('0x34')]);_0x74751e[_0x8f94('0x35')]=_[_0x8f94('0x33')](_0x36c82b[_0x8f94('0x30')],qs[_0x8f94('0x36')](_0x14de98[_0x8f94('0x34')][_0x8f94('0x36')]));_0x74751e[_0x8f94('0x35')]=_0x74751e['attributes']['length']?_0x74751e[_0x8f94('0x35')]:_0x36c82b[_0x8f94('0x30')];if(_0x14de98[_0x8f94('0x34')]['includeAll']){_0x74751e[_0x8f94('0x43')]=[{'all':!![]}];}_0x74751e=_[_0x8f94('0x3e')]({},_0x74751e,_0x14de98[_0x8f94('0x41')]);return db[_0x8f94('0x2c')]['find'](_0x74751e)[_0x8f94('0x24')](handleEntityNotFound(_0x2cc002,null))[_0x8f94('0x24')](respondWithResult(_0x2cc002,null))['catch'](handleError(_0x2cc002,null));};exports['create']=function(_0x4c9bf5,_0x5d70d0){return db[_0x8f94('0x2c')]['create'](_0x4c9bf5[_0x8f94('0x48')],{})[_0x8f94('0x24')](respondWithResult(_0x5d70d0,0xc9))[_0x8f94('0x45')](handleError(_0x5d70d0,null));};exports[_0x8f94('0x23')]=function(_0x5c8ebc,_0x304137){if(_0x5c8ebc[_0x8f94('0x48')]['id']){delete _0x5c8ebc[_0x8f94('0x48')]['id'];}return db[_0x8f94('0x2c')][_0x8f94('0x49')]({'where':{'id':_0x5c8ebc[_0x8f94('0x47')]['id']}})[_0x8f94('0x24')](handleEntityNotFound(_0x304137,null))[_0x8f94('0x24')](saveUpdates(_0x5c8ebc[_0x8f94('0x48')],null))['then'](respondWithResult(_0x304137,null))[_0x8f94('0x45')](handleError(_0x304137,null));};exports['destroy']=function(_0x5c456a,_0x28c091){return db[_0x8f94('0x2c')][_0x8f94('0x49')]({'where':{'id':_0x5c456a[_0x8f94('0x47')]['id']}})['then'](handleEntityNotFound(_0x28c091,null))[_0x8f94('0x24')](removeEntity(_0x28c091,null))[_0x8f94('0x45')](handleError(_0x28c091,null));};exports[_0x8f94('0x4a')]=function(_0x1d76e6,_0x3e52ed){return db[_0x8f94('0x2c')]['describe']()[_0x8f94('0x24')](respondWithResult(_0x3e52ed,null))[_0x8f94('0x45')](handleError(_0x3e52ed,null));}; \ No newline at end of file +var _0x8987=['order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','keys','catch','create','body','update','params','destroy','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','map','SquareDetailsReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit'];(function(_0xb11c19,_0x57e183){var _0x23be44=function(_0x543e64){while(--_0x543e64){_0xb11c19['push'](_0xb11c19['shift']());}};_0x23be44(++_0x57e183);}(_0x8987,0x192));var _0x7898=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x8987[_0x2a67fe];return _0x57e726;};'use strict';var emlformat=require(_0x7898('0x0'));var rimraf=require(_0x7898('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7898('0x2'));var rp=require(_0x7898('0x3'));var moment=require('moment');var BPromise=require(_0x7898('0x4'));var Mustache=require(_0x7898('0x5'));var util=require(_0x7898('0x6'));var path=require(_0x7898('0x7'));var sox=require(_0x7898('0x8'));var csv=require(_0x7898('0x9'));var ejs=require(_0x7898('0xa'));var fs=require('fs');var fs_extra=require(_0x7898('0xb'));var _=require(_0x7898('0xc'));var squel=require(_0x7898('0xd'));var crypto=require(_0x7898('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7898('0x9'));var querystring=require(_0x7898('0xf'));var Papa=require(_0x7898('0x10'));var Redis=require(_0x7898('0x11'));var authService=require(_0x7898('0x12'));var qs=require(_0x7898('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7898('0x14'));var logger=require(_0x7898('0x15'))(_0x7898('0x16'));var utils=require(_0x7898('0x17'));var config=require(_0x7898('0x18'));var licenseUtil=require(_0x7898('0x19'));var db=require(_0x7898('0x1a'))['db'];function respondWithStatusCode(_0x14ff99,_0x11a9f1){_0x11a9f1=_0x11a9f1||0xcc;return function(_0x3f6728){if(_0x3f6728){return _0x14ff99[_0x7898('0x1b')](_0x11a9f1);}return _0x14ff99[_0x7898('0x1c')](_0x11a9f1)[_0x7898('0x1d')]();};}function respondWithResult(_0x4b1dcf,_0x1fecb3){_0x1fecb3=_0x1fecb3||0xc8;return function(_0x4104c0){if(_0x4104c0){return _0x4b1dcf[_0x7898('0x1c')](_0x1fecb3)[_0x7898('0x1e')](_0x4104c0);}};}function respondWithFilteredResult(_0xb8f30e,_0x3e5db9){return function(_0x45b42b){if(_0x45b42b){var _0x211706=typeof _0x3e5db9[_0x7898('0x1f')]===_0x7898('0x20')&&typeof _0x3e5db9[_0x7898('0x21')]==='undefined';var _0x2b17c7=_0x45b42b[_0x7898('0x22')];var _0x20207=_0x211706?0x0:_0x3e5db9[_0x7898('0x1f')];var _0x57945d=_0x211706?_0x45b42b[_0x7898('0x22')]:_0x3e5db9['offset']+_0x3e5db9['limit'];var _0xb3da63;if(_0x57945d>=_0x2b17c7){_0x57945d=_0x2b17c7;_0xb3da63=0xc8;}else{_0xb3da63=0xce;}_0xb8f30e[_0x7898('0x1c')](_0xb3da63);return _0xb8f30e[_0x7898('0x23')]('Content-Range',_0x20207+'-'+_0x57945d+'/'+_0x2b17c7)[_0x7898('0x1e')](_0x45b42b);}return null;};}function patchUpdates(_0x3cca70){return function(_0xe6213c){try{jsonpatch[_0x7898('0x24')](_0xe6213c,_0x3cca70,!![]);}catch(_0x3bde1f){return BPromise[_0x7898('0x25')](_0x3bde1f);}return _0xe6213c['save']();};}function saveUpdates(_0xe5b3c0,_0xa7499a){return function(_0x51e344){if(_0x51e344){return _0x51e344['update'](_0xe5b3c0)[_0x7898('0x26')](function(_0x1b0d41){return _0x1b0d41;});}return null;};}function removeEntity(_0x421f3a,_0x2b6c34){return function(_0x4285cc){if(_0x4285cc){return _0x4285cc['destroy']()[_0x7898('0x26')](function(){_0x421f3a['status'](0xcc)[_0x7898('0x1d')]();});}};}function handleEntityNotFound(_0x225513,_0x3f4b86){return function(_0x575b87){if(!_0x575b87){_0x225513[_0x7898('0x1b')](0x194);}return _0x575b87;};}function handleError(_0xf972af,_0x8a0f76){_0x8a0f76=_0x8a0f76||0x1f4;return function(_0x3a8f30){logger[_0x7898('0x27')](_0x3a8f30[_0x7898('0x28')]);if(_0x3a8f30[_0x7898('0x29')]){delete _0x3a8f30[_0x7898('0x29')];}_0xf972af[_0x7898('0x1c')](_0x8a0f76)['send'](_0x3a8f30);};}exports['index']=function(_0x3a26fc,_0x31b027){var _0x46f6af={},_0x4ff7f1={},_0xb74a5c={'count':0x0,'rows':[]};var _0x5416b3=_[_0x7898('0x2a')](db[_0x7898('0x2b')]['rawAttributes'],function(_0x4df645){return{'name':_0x4df645[_0x7898('0x2c')],'type':_0x4df645[_0x7898('0x2d')][_0x7898('0x2e')]};});_0x4ff7f1[_0x7898('0x2f')]=_[_0x7898('0x2a')](_0x5416b3,_0x7898('0x29'));_0x4ff7f1[_0x7898('0x30')]=_['keys'](_0x3a26fc[_0x7898('0x30')]);_0x4ff7f1[_0x7898('0x31')]=_[_0x7898('0x32')](_0x4ff7f1[_0x7898('0x2f')],_0x4ff7f1[_0x7898('0x30')]);_0x46f6af['attributes']=_[_0x7898('0x32')](_0x4ff7f1[_0x7898('0x2f')],qs['fields'](_0x3a26fc[_0x7898('0x30')][_0x7898('0x33')]));_0x46f6af[_0x7898('0x34')]=_0x46f6af[_0x7898('0x34')]['length']?_0x46f6af['attributes']:_0x4ff7f1['model'];if(!_0x3a26fc[_0x7898('0x30')]['hasOwnProperty'](_0x7898('0x35'))){_0x46f6af[_0x7898('0x21')]=qs[_0x7898('0x21')](_0x3a26fc['query']['limit']);_0x46f6af[_0x7898('0x1f')]=qs[_0x7898('0x1f')](_0x3a26fc[_0x7898('0x30')][_0x7898('0x1f')]);}_0x46f6af[_0x7898('0x36')]=qs['sort'](_0x3a26fc[_0x7898('0x30')][_0x7898('0x37')]);_0x46f6af[_0x7898('0x38')]=qs['filters'](_[_0x7898('0x39')](_0x3a26fc['query'],_0x4ff7f1[_0x7898('0x31')]),_0x5416b3);if(_0x3a26fc['query'][_0x7898('0x3a')]){_0x46f6af[_0x7898('0x38')]=_[_0x7898('0x3b')](_0x46f6af[_0x7898('0x38')],{'$or':_[_0x7898('0x2a')](_0x5416b3,function(_0xd18d1e){if(_0xd18d1e['type']!==_0x7898('0x3c')){var _0x2a4d41={};_0x2a4d41[_0xd18d1e[_0x7898('0x29')]]={'$like':'%'+_0x3a26fc['query'][_0x7898('0x3a')]+'%'};return _0x2a4d41;}})});}_0x46f6af=_[_0x7898('0x3b')]({},_0x46f6af,_0x3a26fc['options']);var _0x2a172d={'where':_0x46f6af[_0x7898('0x38')]};return db[_0x7898('0x2b')][_0x7898('0x22')](_0x2a172d)[_0x7898('0x26')](function(_0x4db9f2){_0xb74a5c['count']=_0x4db9f2;if(_0x3a26fc[_0x7898('0x30')][_0x7898('0x3d')]){_0x46f6af[_0x7898('0x3e')]=[{'all':!![]}];}return db[_0x7898('0x2b')][_0x7898('0x3f')](_0x46f6af);})[_0x7898('0x26')](function(_0x43cb8a){_0xb74a5c[_0x7898('0x40')]=_0x43cb8a;return _0xb74a5c;})['then'](respondWithFilteredResult(_0x31b027,_0x46f6af))['catch'](handleError(_0x31b027,null));};exports[_0x7898('0x41')]=function(_0x249995,_0x14812f){var _0x8d1133={'raw':!![],'where':{'id':_0x249995['params']['id']}},_0x5534bd={};_0x5534bd[_0x7898('0x2f')]=_['keys'](db[_0x7898('0x2b')][_0x7898('0x42')]);_0x5534bd['query']=_[_0x7898('0x43')](_0x249995[_0x7898('0x30')]);_0x5534bd[_0x7898('0x31')]=_[_0x7898('0x32')](_0x5534bd['model'],_0x5534bd[_0x7898('0x30')]);_0x8d1133[_0x7898('0x34')]=_[_0x7898('0x32')](_0x5534bd[_0x7898('0x2f')],qs[_0x7898('0x33')](_0x249995['query'][_0x7898('0x33')]));_0x8d1133[_0x7898('0x34')]=_0x8d1133[_0x7898('0x34')]['length']?_0x8d1133['attributes']:_0x5534bd[_0x7898('0x2f')];if(_0x249995[_0x7898('0x30')][_0x7898('0x3d')]){_0x8d1133[_0x7898('0x3e')]=[{'all':!![]}];}_0x8d1133=_[_0x7898('0x3b')]({},_0x8d1133,_0x249995['options']);return db[_0x7898('0x2b')]['find'](_0x8d1133)['then'](handleEntityNotFound(_0x14812f,null))[_0x7898('0x26')](respondWithResult(_0x14812f,null))[_0x7898('0x44')](handleError(_0x14812f,null));};exports[_0x7898('0x45')]=function(_0x48ded0,_0x4c1ae9){return db[_0x7898('0x2b')][_0x7898('0x45')](_0x48ded0[_0x7898('0x46')],{})['then'](respondWithResult(_0x4c1ae9,0xc9))[_0x7898('0x44')](handleError(_0x4c1ae9,null));};exports[_0x7898('0x47')]=function(_0x108f23,_0xd3472a){if(_0x108f23[_0x7898('0x46')]['id']){delete _0x108f23[_0x7898('0x46')]['id'];}return db[_0x7898('0x2b')]['find']({'where':{'id':_0x108f23[_0x7898('0x48')]['id']}})[_0x7898('0x26')](handleEntityNotFound(_0xd3472a,null))[_0x7898('0x26')](saveUpdates(_0x108f23['body'],null))['then'](respondWithResult(_0xd3472a,null))[_0x7898('0x44')](handleError(_0xd3472a,null));};exports[_0x7898('0x49')]=function(_0x1aebbb,_0x356052){return db[_0x7898('0x2b')][_0x7898('0x4a')]({'where':{'id':_0x1aebbb[_0x7898('0x48')]['id']}})[_0x7898('0x26')](handleEntityNotFound(_0x356052,null))[_0x7898('0x26')](removeEntity(_0x356052,null))['catch'](handleError(_0x356052,null));};exports[_0x7898('0x4b')]=function(_0x9cba19,_0x42d564){return db[_0x7898('0x2b')][_0x7898('0x4b')]()[_0x7898('0x26')](respondWithResult(_0x42d564,null))[_0x7898('0x44')](handleError(_0x42d564,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f766f2b..1c5c8f2 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 _0x088e=['../../config/environment','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1b23e2,_0x114e29){var _0x1318c2=function(_0x2814ab){while(--_0x2814ab){_0x1b23e2['push'](_0x1b23e2['shift']());}};_0x1318c2(++_0x114e29);}(_0x088e,0x14d));var _0xe088=function(_0x206d47,_0x27527f){_0x206d47=_0x206d47-0x0;var _0x50200d=_0x088e[_0x206d47];return _0x50200d;};'use strict';var _=require(_0xe088('0x0'));var util=require(_0xe088('0x1'));var logger=require(_0xe088('0x2'))(_0xe088('0x3'));var moment=require(_0xe088('0x4'));var BPromise=require('bluebird');var rp=require(_0xe088('0x5'));var fs=require('fs');var path=require(_0xe088('0x6'));var rimraf=require(_0xe088('0x7'));var config=require(_0xe088('0x8'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x104982,_0x13b685){return _0x104982[_0xe088('0x9')](_0xe088('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0492=['lodash','util','../../config/logger','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details'];(function(_0x12f2b9,_0x39b1c3){var _0x19b550=function(_0x5a6dce){while(--_0x5a6dce){_0x12f2b9['push'](_0x12f2b9['shift']());}};_0x19b550(++_0x39b1c3);}(_0x0492,0xbe));var _0x2049=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x0492[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x2049('0x0'));var util=require(_0x2049('0x1'));var logger=require(_0x2049('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2049('0x3'));var fs=require('fs');var path=require(_0x2049('0x4'));var rimraf=require('rimraf');var config=require(_0x2049('0x5'));var attributes=require(_0x2049('0x6'));module[_0x2049('0x7')]=function(_0x42f59a,_0x26f84e){return _0x42f59a[_0x2049('0x8')]('SquareDetailsReport',attributes,{'tableName':_0x2049('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index b9e8884..314551f 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 _0x0490=['options','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x0490,0x147));var _0x0049=function(_0x5b2234,_0x3ad584){_0x5b2234=_0x5b2234-0x0;var _0x4db254=_0x0490[_0x5b2234];return _0x4db254;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0049('0x1'))['db'];var utils=require(_0x0049('0x2'));var logger=require(_0x0049('0x3'))(_0x0049('0x4'));var config=require(_0x0049('0x5'));var jayson=require(_0x0049('0x6'));var client=jayson[_0x0049('0x7')][_0x0049('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28c8d2,_0x57fca5,_0x18bff7){return new BPromise(function(_0xe091c4,_0x154219){return client['request'](_0x28c8d2,_0x18bff7)[_0x0049('0x9')](function(_0x3f2ca1){logger[_0x0049('0xa')](_0x0049('0xb'),_0x57fca5,_0x0049('0xc'));logger[_0x0049('0xd')](_0x0049('0xe'),_0x57fca5,_0x0049('0xc'),JSON[_0x0049('0xf')](_0x3f2ca1));if(_0x3f2ca1['error']){if(_0x3f2ca1[_0x0049('0x10')][_0x0049('0x11')]===0x1f4){logger[_0x0049('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x57fca5,_0x3f2ca1['error'][_0x0049('0x12')]);return _0x154219(_0x3f2ca1[_0x0049('0x10')][_0x0049('0x12')]);}logger[_0x0049('0x10')](_0x0049('0xb'),_0x57fca5,_0x3f2ca1['error'][_0x0049('0x12')]);return _0xe091c4(_0x3f2ca1[_0x0049('0x10')]['message']);}else{logger[_0x0049('0xa')](_0x0049('0xb'),_0x57fca5,_0x0049('0xc'));_0xe091c4(_0x3f2ca1[_0x0049('0x13')]['message']);}})['catch'](function(_0x4315b5){logger[_0x0049('0x10')](_0x0049('0xb'),_0x57fca5,_0x4315b5);_0x154219(_0x4315b5);});});}exports[_0x0049('0x14')]=function(_0x102b40){var _0x4592ad=this;return new Promise(function(_0x191a20,_0x21691){return db[_0x0049('0x15')][_0x0049('0x16')](_0x102b40['body'],{'raw':_0x102b40[_0x0049('0x17')]?_0x102b40[_0x0049('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0049('0x9')](function(_0x4624ff){logger[_0x0049('0xa')](_0x0049('0x14'),_0x102b40);logger[_0x0049('0xd')]('CreateSquareDetailsReport',_0x102b40,JSON[_0x0049('0xf')](_0x4624ff));_0x191a20(_0x4624ff);})[_0x0049('0x18')](function(_0x49c00b){logger[_0x0049('0x10')](_0x0049('0x14'),_0x49c00b[_0x0049('0x12')],_0x102b40);_0x21691(_0x4592ad[_0x0049('0x10')](0x1f4,_0x49c00b[_0x0049('0x12')]));});});}; \ No newline at end of file +var _0x0833=['bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','options','raw','then','CreateSquareDetailsReport','lodash','util','moment'];(function(_0x416f3c,_0x4ac0b4){var _0x558b7d=function(_0xbd54e9){while(--_0xbd54e9){_0x416f3c['push'](_0x416f3c['shift']());}};_0x558b7d(++_0x4ac0b4);}(_0x0833,0x1bd));var _0x3083=function(_0x42305c,_0x10c561){_0x42305c=_0x42305c-0x0;var _0x5a15d1=_0x0833[_0x42305c];return _0x5a15d1;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var moment=require(_0x3083('0x2'));var BPromise=require(_0x3083('0x3'));var rs=require(_0x3083('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3083('0x5'))('rpc');var config=require(_0x3083('0x6'));var jayson=require(_0x3083('0x7'));var client=jayson[_0x3083('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9c3a,_0x1378a5,_0x529df1){return new BPromise(function(_0x5591b0,_0x4f51da){return client[_0x3083('0x9')](_0x2f9c3a,_0x529df1)['then'](function(_0x5cce3c){logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));logger[_0x3083('0xd')](_0x3083('0xe'),_0x1378a5,_0x3083('0xc'),JSON[_0x3083('0xf')](_0x5cce3c));if(_0x5cce3c[_0x3083('0x10')]){if(_0x5cce3c[_0x3083('0x10')][_0x3083('0x11')]===0x1f4){logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c[_0x3083('0x10')][_0x3083('0x12')]);return _0x4f51da(_0x5cce3c[_0x3083('0x10')]['message']);}logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c['error'][_0x3083('0x12')]);return _0x5591b0(_0x5cce3c[_0x3083('0x10')]['message']);}else{logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));_0x5591b0(_0x5cce3c[_0x3083('0x13')][_0x3083('0x12')]);}})[_0x3083('0x14')](function(_0xecb368){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1378a5,_0xecb368);_0x4f51da(_0xecb368);});});}exports['CreateSquareDetailsReport']=function(_0x424c59){var _0x57fdf7=this;return new Promise(function(_0x3bbfe3,_0x2cdeca){return db[_0x3083('0x15')][_0x3083('0x16')](_0x424c59[_0x3083('0x17')],{'raw':_0x424c59[_0x3083('0x18')]?_0x424c59[_0x3083('0x18')][_0x3083('0x19')]===undefined?!![]:![]:!![]})[_0x3083('0x1a')](function(_0x164988){logger[_0x3083('0xa')](_0x3083('0x1b'),_0x424c59);logger[_0x3083('0xd')](_0x3083('0x1b'),_0x424c59,JSON['stringify'](_0x164988));_0x3bbfe3(_0x164988);})['catch'](function(_0x4dc9ad){logger['error'](_0x3083('0x1b'),_0x4dc9ad[_0x3083('0x12')],_0x424c59);_0x2cdeca(_0x57fdf7[_0x3083('0x10')](0x1f4,_0x4dc9ad[_0x3083('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index eec6db8..b3bebe3 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 _0x1d8f=['exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess'];(function(_0xbe048b,_0x2f8970){var _0x1d9099=function(_0x4920e){while(--_0x4920e){_0xbe048b['push'](_0xbe048b['shift']());}};_0x1d9099(++_0x2f8970);}(_0x1d8f,0x160));var _0xf1d8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1d8f[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0xf1d8('0x0'));var router=express[_0xf1d8('0x1')]();var auth=require(_0xf1d8('0x2'));var controller=require(_0xf1d8('0x3'));router[_0xf1d8('0x4')]('/',auth[_0xf1d8('0x5')](),controller[_0xf1d8('0x6')]);router[_0xf1d8('0x4')]('/process/:pid/kill',auth[_0xf1d8('0x5')](),controller[_0xf1d8('0x7')]);module[_0xf1d8('0x8')]=router; \ No newline at end of file +var _0xd027=['get','isAuthenticated','killProcess','exports','express','Router'];(function(_0x189aca,_0x258dd9){var _0x2194f1=function(_0x4f6429){while(--_0x4f6429){_0x189aca['push'](_0x189aca['shift']());}};_0x2194f1(++_0x258dd9);}(_0xd027,0x106));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x7d02('0x0'));var router=express[_0x7d02('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x7d02('0x2')]('/',auth[_0x7d02('0x3')](),controller['index']);router[_0x7d02('0x2')]('/process/:pid/kill',auth[_0x7d02('0x3')](),controller[_0x7d02('0x4')]);module[_0x7d02('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 284275b..0d5e1ef 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 _0x7474=['indexOf','params','kill','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','getAllData','then','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split'];(function(_0x5b9641,_0x1288fd){var _0x2c4654=function(_0x149eeb){while(--_0x149eeb){_0x5b9641['push'](_0x5b9641['shift']());}};_0x2c4654(++_0x1288fd);}(_0x7474,0xb2));var _0x4747=function(_0x2574a7,_0xdd6018){_0x2574a7=_0x2574a7-0x0;var _0x33f144=_0x7474[_0x2574a7];return _0x33f144;};'use strict';var info=require(_0x4747('0x0'));var exec=require(_0x4747('0x1'))['exec'];var logger=require(_0x4747('0x2'))(_0x4747('0x3'));var util=require(_0x4747('0x4'));var BPromise=require(_0x4747('0x5'));var _=require(_0x4747('0x6'));function handleError(_0x2e1fa9,_0x47b1fc,_0x5e66ec){_0x47b1fc=_0x47b1fc||0x1f4;return function(_0x72d278){logger[_0x4747('0x7')](_0x4747('0x8'),_0x5e66ec,_0x47b1fc,util['inspect'](_0x72d278,{'showHidden':![],'depth':null}));delete _0x72d278[_0x4747('0x9')];_0x2e1fa9[_0x4747('0xa')](_0x47b1fc)[_0x4747('0xb')](_0x72d278);};}exports['index']=function(_0x523877,_0x5c244b){return info[_0x4747('0xc')]()[_0x4747('0xd')](function(_0x3893f1){return _0x5c244b[_0x4747('0xa')](0xc8)['json'](_0x3893f1);})[_0x4747('0xe')](function(_0x5c4865){return _0x5c244b[_0x4747('0xa')](0x1f4)[_0x4747('0xf')](_0x5c4865);});};exports[_0x4747('0x10')]=function(_0x674ad2,_0x5e410f){var _0x2ac39f=[_0x4747('0x11')];return new BPromise(function(_0x42ebaa,_0x269782){return exec(util[_0x4747('0x12')](_0x4747('0x13'),_0x674ad2['params'][_0x4747('0x14')]),function(_0x2fed6f,_0x2cffc0,_0x2cc149){if(_0x2fed6f){return _0x269782(_0x2fed6f);}return _0x42ebaa(_0x2cffc0);});})[_0x4747('0xd')](function(_0x6d4791){var _0x46a1dd=![];var _0x1ccde5=_0x6d4791[_0x4747('0x15')](/\n/);for(var _0x18b30f=0x0,_0x230cc1=_0x2ac39f['length'];_0x18b30f<_0x230cc1,_0x46a1dd===![];_0x18b30f+=0x1){if(_0x6d4791[_0x4747('0x16')](_0x2ac39f[_0x18b30f])>=0x0){_0x46a1dd=!![];}}if(!_0x46a1dd){throw new Error(util[_0x4747('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x674ad2[_0x4747('0x17')]['pid']));}process[_0x4747('0x18')](_0x674ad2[_0x4747('0x17')][_0x4747('0x14')],'SIGINT');return _0x5e410f[_0x4747('0xa')](0xc8)[_0x4747('0xf')]({'message':util[_0x4747('0x12')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x674ad2[_0x4747('0x17')][_0x4747('0x14')])});})[_0x4747('0xe')](handleError(_0x5e410f,null,_0x4747('0x10')));}; \ No newline at end of file +var _0x29c2=['error','inspect','name','status','send','then','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','indexOf','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash'];(function(_0xd1bccd,_0x5621f2){var _0x34e22b=function(_0xf2fc66){while(--_0xf2fc66){_0xd1bccd['push'](_0xd1bccd['shift']());}};_0x34e22b(++_0x5621f2);}(_0x29c2,0x149));var _0x229c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x29c2[_0x5d6456];return _0x4d66c1;};'use strict';var info=require(_0x229c('0x0'));var exec=require(_0x229c('0x1'))['exec'];var logger=require(_0x229c('0x2'))(_0x229c('0x3'));var util=require(_0x229c('0x4'));var BPromise=require(_0x229c('0x5'));var _=require(_0x229c('0x6'));function handleError(_0x2a155f,_0x5dd9fb,_0x4ee7cc){_0x5dd9fb=_0x5dd9fb||0x1f4;return function(_0x25fd78){logger[_0x229c('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4ee7cc,_0x5dd9fb,util[_0x229c('0x8')](_0x25fd78,{'showHidden':![],'depth':null}));delete _0x25fd78[_0x229c('0x9')];_0x2a155f[_0x229c('0xa')](_0x5dd9fb)[_0x229c('0xb')](_0x25fd78);};}exports['index']=function(_0x3498b6,_0x51a372){return info['getAllData']()[_0x229c('0xc')](function(_0x1c71c5){return _0x51a372[_0x229c('0xa')](0xc8)[_0x229c('0xd')](_0x1c71c5);})['catch'](function(_0x17efe1){return _0x51a372[_0x229c('0xa')](0x1f4)[_0x229c('0xd')](_0x17efe1);});};exports[_0x229c('0xe')]=function(_0x1d4dd9,_0x946128){var _0x387ad8=['components/import/cm'];return new BPromise(function(_0x35b16e,_0xaf0fe6){return exec(util[_0x229c('0xf')](_0x229c('0x10'),_0x1d4dd9['params'][_0x229c('0x11')]),function(_0x1f0787,_0x3df7ae,_0x4a0edb){if(_0x1f0787){return _0xaf0fe6(_0x1f0787);}return _0x35b16e(_0x3df7ae);});})['then'](function(_0x3cf198){var _0x189113=![];var _0x219e6b=_0x3cf198[_0x229c('0x12')](/\n/);for(var _0x4656a5=0x0,_0x35299c=_0x387ad8['length'];_0x4656a5<_0x35299c,_0x189113===![];_0x4656a5+=0x1){if(_0x3cf198[_0x229c('0x13')](_0x387ad8[_0x4656a5])>=0x0){_0x189113=!![];}}if(!_0x189113){throw new Error(util[_0x229c('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1d4dd9[_0x229c('0x14')][_0x229c('0x11')]));}process['kill'](_0x1d4dd9[_0x229c('0x14')][_0x229c('0x11')],_0x229c('0x15'));return _0x946128[_0x229c('0xa')](0xc8)[_0x229c('0xd')]({'message':util['format'](_0x229c('0x16'),_0x1d4dd9[_0x229c('0x14')]['pid'])});})[_0x229c('0x17')](handleError(_0x946128,null,_0x229c('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c55f5e2..c39085a 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 _0x0a48=['Router','fs-extra','../../components/auth/service','./tag.controller','get','isAuthenticated','index','/:id','show','post','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x0a48,0x95));var _0x80a4=function(_0x41ae9,_0x4888cb){_0x41ae9=_0x41ae9-0x0;var _0x556d91=_0x0a48[_0x41ae9];return _0x556d91;};'use strict';var multer=require(_0x80a4('0x0'));var util=require(_0x80a4('0x1'));var path=require('path');var timeout=require(_0x80a4('0x2'));var express=require(_0x80a4('0x3'));var router=express[_0x80a4('0x4')]();var fs_extra=require(_0x80a4('0x5'));var auth=require(_0x80a4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x80a4('0x7'));router[_0x80a4('0x8')]('/',auth[_0x80a4('0x9')](),controller[_0x80a4('0xa')]);router['get'](_0x80a4('0xb'),auth['isAuthenticated'](),controller[_0x80a4('0xc')]);router[_0x80a4('0xd')]('/',auth[_0x80a4('0x9')](),controller['create']);router['put'](_0x80a4('0xb'),auth[_0x80a4('0x9')](),controller[_0x80a4('0xe')]);router[_0x80a4('0xf')]('/:id',auth[_0x80a4('0x9')](),controller['destroy']);module[_0x80a4('0x10')]=router; \ No newline at end of file +var _0xc1d3=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xc1d3,0x147));var _0x3c1d=function(_0x4a328d,_0x4c62d6){_0x4a328d=_0x4a328d-0x0;var _0x4410d9=_0xc1d3[_0x4a328d];return _0x4410d9;};'use strict';var multer=require(_0x3c1d('0x0'));var util=require(_0x3c1d('0x1'));var path=require(_0x3c1d('0x2'));var timeout=require(_0x3c1d('0x3'));var express=require(_0x3c1d('0x4'));var router=express[_0x3c1d('0x5')]();var fs_extra=require(_0x3c1d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c1d('0x7'));var controller=require(_0x3c1d('0x8'));router[_0x3c1d('0x9')]('/',auth['isAuthenticated'](),controller[_0x3c1d('0xa')]);router[_0x3c1d('0x9')](_0x3c1d('0xb'),auth[_0x3c1d('0xc')](),controller[_0x3c1d('0xd')]);router['post']('/',auth[_0x3c1d('0xc')](),controller[_0x3c1d('0xe')]);router[_0x3c1d('0xf')](_0x3c1d('0xb'),auth[_0x3c1d('0xc')](),controller[_0x3c1d('0x10')]);router[_0x3c1d('0x11')](_0x3c1d('0xb'),auth['isAuthenticated'](),controller[_0x3c1d('0x12')]);module[_0x3c1d('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index ae7a633..94a4f25 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 _0x2697=['exports','STRING','name','#0091EA'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2697,0x120));var _0x7269=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x2697[_0x9d639c];return _0x1671de;};'use strict';var Sequelize=require('sequelize');module[_0x7269('0x0')]={'name':{'type':Sequelize[_0x7269('0x1')],'unique':_0x7269('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7269('0x1')],'defaultValue':_0x7269('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7334=['sequelize','exports','STRING','#0091EA'];(function(_0x1895cb,_0x248c9f){var _0x4ff1a2=function(_0x3e6574){while(--_0x3e6574){_0x1895cb['push'](_0x1895cb['shift']());}};_0x4ff1a2(++_0x248c9f);}(_0x7334,0x184));var _0x4733=function(_0x28f267,_0x1fa75d){_0x28f267=_0x28f267-0x0;var _0x13f82b=_0x7334[_0x28f267];return _0x13f82b;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'name':{'type':Sequelize[_0x4733('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x4733('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 848c5a1..bca4fad 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 _0x0bb5=['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','Tags','error','stack','name','send','index','map','Tag','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','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x4c87e3,_0xfcf756){var _0x1e7014=function(_0x203c1e){while(--_0x203c1e){_0x4c87e3['push'](_0x4c87e3['shift']());}};_0x1e7014(++_0xfcf756);}(_0x0bb5,0x148));var _0x50bb=function(_0x3fdcb2,_0x437bca){_0x3fdcb2=_0x3fdcb2-0x0;var _0x56f7a6=_0x0bb5[_0x3fdcb2];return _0x56f7a6;};'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['Tag'][_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['Tag']['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['Tag'][_0x50bb('0x4c')]({'where':{'id':_0x1408fa[_0x50bb('0x4a')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x57d749,null))[_0x50bb('0x24')](removeEntity(_0x57d749,null))[_0x50bb('0x48')](handleError(_0x57d749,null));}; \ No newline at end of file +var _0xc874=['query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','include','catch','show','params','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Tags','UserProfileResource','sendStatus','stack','name','send','index','map','Tag','rawAttributes','type','model'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0xc874,0x154));var _0x4c87=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xc874[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0x4c87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c87('0x1'));var jsonpatch=require(_0x4c87('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4c87('0x3'));var Mustache=require(_0x4c87('0x4'));var util=require(_0x4c87('0x5'));var path=require('path');var sox=require(_0x4c87('0x6'));var csv=require(_0x4c87('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c87('0x8'));var _=require(_0x4c87('0x9'));var squel=require(_0x4c87('0xa'));var crypto=require(_0x4c87('0xb'));var jsforce=require(_0x4c87('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4c87('0x7'));var querystring=require('querystring');var Papa=require(_0x4c87('0xd'));var Redis=require(_0x4c87('0xe'));var authService=require(_0x4c87('0xf'));var qs=require(_0x4c87('0x10'));var as=require(_0x4c87('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c87('0x12'))(_0x4c87('0x13'));var utils=require('../../config/utils');var config=require(_0x4c87('0x14'));var licenseUtil=require(_0x4c87('0x15'));var db=require(_0x4c87('0x16'))['db'];function respondWithStatusCode(_0x3b01bb,_0x3a2aa2){_0x3a2aa2=_0x3a2aa2||0xcc;return function(_0x50590a){if(_0x50590a){return _0x3b01bb['sendStatus'](_0x3a2aa2);}return _0x3b01bb['status'](_0x3a2aa2)[_0x4c87('0x17')]();};}function respondWithResult(_0x355e94,_0x2c66bc){_0x2c66bc=_0x2c66bc||0xc8;return function(_0x3f1cc5){if(_0x3f1cc5){return _0x355e94[_0x4c87('0x18')](_0x2c66bc)[_0x4c87('0x19')](_0x3f1cc5);}};}function respondWithFilteredResult(_0x45e476,_0x21712e){return function(_0x532a63){if(_0x532a63){var _0x27abb9=typeof _0x21712e[_0x4c87('0x1a')]==='undefined'&&typeof _0x21712e['limit']===_0x4c87('0x1b');var _0x8cebb9=_0x532a63[_0x4c87('0x1c')];var _0x547d92=_0x27abb9?0x0:_0x21712e[_0x4c87('0x1a')];var _0x561441=_0x27abb9?_0x532a63[_0x4c87('0x1c')]:_0x21712e[_0x4c87('0x1a')]+_0x21712e[_0x4c87('0x1d')];var _0x22f775;if(_0x561441>=_0x8cebb9){_0x561441=_0x8cebb9;_0x22f775=0xc8;}else{_0x22f775=0xce;}_0x45e476['status'](_0x22f775);return _0x45e476[_0x4c87('0x1e')](_0x4c87('0x1f'),_0x547d92+'-'+_0x561441+'/'+_0x8cebb9)[_0x4c87('0x19')](_0x532a63);}return null;};}function patchUpdates(_0x3f27d4){return function(_0xa4baa7){try{jsonpatch[_0x4c87('0x20')](_0xa4baa7,_0x3f27d4,!![]);}catch(_0x14dabf){return BPromise[_0x4c87('0x21')](_0x14dabf);}return _0xa4baa7['save']();};}function saveUpdates(_0x353ac9,_0x33aafd){return function(_0x5cc15d){if(_0x5cc15d){return _0x5cc15d[_0x4c87('0x22')](_0x353ac9)[_0x4c87('0x23')](function(_0x5a9496){return _0x5a9496;});}return null;};}function removeEntity(_0x115253,_0x293754){return function(_0x40a413){if(_0x40a413){return _0x40a413[_0x4c87('0x24')]()['then'](function(){var _0x4735f2=_0x40a413[_0x4c87('0x25')]({'plain':!![]});var _0x4525df=_0x4c87('0x26');return db[_0x4c87('0x27')][_0x4c87('0x24')]({'where':{'type':_0x4525df,'resourceId':_0x4735f2['id']}})[_0x4c87('0x23')](function(){return _0x40a413;});})[_0x4c87('0x23')](function(){_0x115253['status'](0xcc)[_0x4c87('0x17')]();});}};}function handleEntityNotFound(_0x47ef54,_0x27f13d){return function(_0x381af7){if(!_0x381af7){_0x47ef54[_0x4c87('0x28')](0x194);}return _0x381af7;};}function handleError(_0x1f246e,_0x5fb5e){_0x5fb5e=_0x5fb5e||0x1f4;return function(_0x583371){logger['error'](_0x583371[_0x4c87('0x29')]);if(_0x583371[_0x4c87('0x2a')]){delete _0x583371[_0x4c87('0x2a')];}_0x1f246e[_0x4c87('0x18')](_0x5fb5e)[_0x4c87('0x2b')](_0x583371);};}exports[_0x4c87('0x2c')]=function(_0x32ae5e,_0x10aea2){var _0x2a6d03={},_0x2de21a={},_0x41468f={'count':0x0,'rows':[]};var _0x272392=_[_0x4c87('0x2d')](db[_0x4c87('0x2e')][_0x4c87('0x2f')],function(_0x185590){return{'name':_0x185590['fieldName'],'type':_0x185590[_0x4c87('0x30')]['key']};});_0x2de21a[_0x4c87('0x31')]=_['map'](_0x272392,_0x4c87('0x2a'));_0x2de21a[_0x4c87('0x32')]=_[_0x4c87('0x33')](_0x32ae5e[_0x4c87('0x32')]);_0x2de21a['filters']=_[_0x4c87('0x34')](_0x2de21a[_0x4c87('0x31')],_0x2de21a[_0x4c87('0x32')]);_0x2a6d03[_0x4c87('0x35')]=_['intersection'](_0x2de21a[_0x4c87('0x31')],qs[_0x4c87('0x36')](_0x32ae5e[_0x4c87('0x32')][_0x4c87('0x36')]));_0x2a6d03['attributes']=_0x2a6d03[_0x4c87('0x35')][_0x4c87('0x37')]?_0x2a6d03[_0x4c87('0x35')]:_0x2de21a[_0x4c87('0x31')];if(!_0x32ae5e['query']['hasOwnProperty'](_0x4c87('0x38'))){_0x2a6d03['limit']=qs[_0x4c87('0x1d')](_0x32ae5e[_0x4c87('0x32')][_0x4c87('0x1d')]);_0x2a6d03[_0x4c87('0x1a')]=qs[_0x4c87('0x1a')](_0x32ae5e['query'][_0x4c87('0x1a')]);}_0x2a6d03[_0x4c87('0x39')]=qs[_0x4c87('0x3a')](_0x32ae5e['query']['sort']);_0x2a6d03[_0x4c87('0x3b')]=qs[_0x4c87('0x3c')](_[_0x4c87('0x3d')](_0x32ae5e['query'],_0x2de21a[_0x4c87('0x3c')]),_0x272392);if(_0x32ae5e['query']['filter']){_0x2a6d03['where']=_[_0x4c87('0x3e')](_0x2a6d03[_0x4c87('0x3b')],{'$or':_[_0x4c87('0x2d')](_0x272392,function(_0x5c1831){if(_0x5c1831[_0x4c87('0x30')]!==_0x4c87('0x3f')){var _0x5de7b1={};_0x5de7b1[_0x5c1831[_0x4c87('0x2a')]]={'$like':'%'+_0x32ae5e['query']['filter']+'%'};return _0x5de7b1;}})});}_0x2a6d03=_[_0x4c87('0x3e')]({},_0x2a6d03,_0x32ae5e['options']);var _0x46c25f={'where':_0x2a6d03[_0x4c87('0x3b')]};return db['Tag'][_0x4c87('0x1c')](_0x46c25f)[_0x4c87('0x23')](function(_0x48cfe6){_0x41468f[_0x4c87('0x1c')]=_0x48cfe6;if(_0x32ae5e['query']['includeAll']){_0x2a6d03[_0x4c87('0x40')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2a6d03);})[_0x4c87('0x23')](function(_0x32e45b){_0x41468f['rows']=_0x32e45b;return _0x41468f;})[_0x4c87('0x23')](respondWithFilteredResult(_0x10aea2,_0x2a6d03))[_0x4c87('0x41')](handleError(_0x10aea2,null));};exports[_0x4c87('0x42')]=function(_0x45b950,_0x5a4fef){var _0x44e6c7={'raw':!![],'where':{'id':_0x45b950[_0x4c87('0x43')]['id']}},_0x448208={};_0x448208[_0x4c87('0x31')]=_['keys'](db[_0x4c87('0x2e')][_0x4c87('0x2f')]);_0x448208[_0x4c87('0x32')]=_['keys'](_0x45b950[_0x4c87('0x32')]);_0x448208[_0x4c87('0x3c')]=_[_0x4c87('0x34')](_0x448208[_0x4c87('0x31')],_0x448208['query']);_0x44e6c7[_0x4c87('0x35')]=_[_0x4c87('0x34')](_0x448208[_0x4c87('0x31')],qs['fields'](_0x45b950['query'][_0x4c87('0x36')]));_0x44e6c7[_0x4c87('0x35')]=_0x44e6c7[_0x4c87('0x35')][_0x4c87('0x37')]?_0x44e6c7['attributes']:_0x448208['model'];if(_0x45b950[_0x4c87('0x32')][_0x4c87('0x44')]){_0x44e6c7[_0x4c87('0x40')]=[{'all':!![]}];}_0x44e6c7=_[_0x4c87('0x3e')]({},_0x44e6c7,_0x45b950[_0x4c87('0x45')]);return db[_0x4c87('0x2e')][_0x4c87('0x46')](_0x44e6c7)[_0x4c87('0x23')](handleEntityNotFound(_0x5a4fef,null))[_0x4c87('0x23')](respondWithResult(_0x5a4fef,null))[_0x4c87('0x41')](handleError(_0x5a4fef,null));};exports['create']=function(_0x20f4f2,_0x212d87){return db[_0x4c87('0x2e')][_0x4c87('0x47')](_0x20f4f2['body'],{})[_0x4c87('0x23')](function(_0x152e70){var _0x27d82e=_0x20f4f2['user'][_0x4c87('0x25')]({'plain':!![]});if(!_0x27d82e)throw new Error(_0x4c87('0x48'));if(_0x27d82e[_0x4c87('0x49')]==='user'){var _0x31f23a=_0x152e70[_0x4c87('0x25')]({'plain':!![]});var _0x1f10be='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x1f10be,'userProfileId':_0x27d82e['userProfileId']},'raw':!![]})['then'](function(_0x263c8b){if(_0x263c8b&&_0x263c8b[_0x4c87('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x31f23a[_0x4c87('0x2a')],'resourceId':_0x31f23a['id'],'type':_0x263c8b[_0x4c87('0x2a')],'sectionId':_0x263c8b['id']},{})[_0x4c87('0x23')](function(){return _0x152e70;});}else{return _0x152e70;}})[_0x4c87('0x41')](function(_0x31c1e2){logger[_0x4c87('0x4b')](_0x4c87('0x4c'),_0x31c1e2);throw _0x31c1e2;});}return _0x152e70;})[_0x4c87('0x23')](respondWithResult(_0x212d87,0xc9))['catch'](handleError(_0x212d87,null));};exports['update']=function(_0x348754,_0x4debb0){if(_0x348754[_0x4c87('0x4d')]['id']){delete _0x348754[_0x4c87('0x4d')]['id'];}return db[_0x4c87('0x2e')][_0x4c87('0x46')]({'where':{'id':_0x348754[_0x4c87('0x43')]['id']}})[_0x4c87('0x23')](handleEntityNotFound(_0x4debb0,null))[_0x4c87('0x23')](saveUpdates(_0x348754[_0x4c87('0x4d')],null))['then'](respondWithResult(_0x4debb0,null))['catch'](handleError(_0x4debb0,null));};exports[_0x4c87('0x24')]=function(_0x505365,_0x3fae0d){return db[_0x4c87('0x2e')][_0x4c87('0x46')]({'where':{'id':_0x505365['params']['id']}})[_0x4c87('0x23')](handleEntityNotFound(_0x3fae0d,null))[_0x4c87('0x23')](removeEntity(_0x3fae0d,null))[_0x4c87('0x41')](handleError(_0x3fae0d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index dbd50b1..ee87b19 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 _0x313d=['bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash','util','../../config/logger','moment'];(function(_0x417e34,_0x4e94bd){var _0x31170c=function(_0x24f970){while(--_0x24f970){_0x417e34['push'](_0x417e34['shift']());}};_0x31170c(++_0x4e94bd);}(_0x313d,0x10d));var _0xd313=function(_0x40c4a5,_0x529651){_0x40c4a5=_0x40c4a5-0x0;var _0x3a1d1b=_0x313d[_0x40c4a5];return _0x3a1d1b;};'use strict';var _=require(_0xd313('0x0'));var util=require(_0xd313('0x1'));var logger=require(_0xd313('0x2'))('api');var moment=require(_0xd313('0x3'));var BPromise=require(_0xd313('0x4'));var rp=require(_0xd313('0x5'));var fs=require('fs');var path=require(_0xd313('0x6'));var rimraf=require(_0xd313('0x7'));var config=require(_0xd313('0x8'));var attributes=require(_0xd313('0x9'));module[_0xd313('0xa')]=function(_0x10e74c,_0x2c6820){return _0x10e74c['define'](_0xd313('0xb'),attributes,{'tableName':_0xd313('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0463=['../../config/environment','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x3504a1,_0x5448ee){var _0x132874=function(_0x51fe00){while(--_0x51fe00){_0x3504a1['push'](_0x3504a1['shift']());}};_0x132874(++_0x5448ee);}(_0x0463,0x7d));var _0x3046=function(_0x41556c,_0x2686b1){_0x41556c=_0x41556c-0x0;var _0x436102=_0x0463[_0x41556c];return _0x436102;};'use strict';var _=require(_0x3046('0x0'));var util=require(_0x3046('0x1'));var logger=require(_0x3046('0x2'))(_0x3046('0x3'));var moment=require('moment');var BPromise=require(_0x3046('0x4'));var rp=require(_0x3046('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3046('0x6'));var config=require(_0x3046('0x7'));var attributes=require('./tag.attributes');module[_0x3046('0x8')]=function(_0x58c8d2,_0x4a8649){return _0x58c8d2[_0x3046('0x9')](_0x3046('0xa'),attributes,{'tableName':_0x3046('0xb'),'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 b11fac3..da26845 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 _0x17ba=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c2431,_0x3dacef){var _0x38c2f7=function(_0x35b7cd){while(--_0x35b7cd){_0x3c2431['push'](_0x3c2431['shift']());}};_0x38c2f7(++_0x3dacef);}(_0x17ba,0xab));var _0xa17b=function(_0x2b6da0,_0x4889c1){_0x2b6da0=_0x2b6da0-0x0;var _0x40420f=_0x17ba[_0x2b6da0];return _0x40420f;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('Tag,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('Tag,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});} \ No newline at end of file +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(_0x5f1c91,_0x317972){var _0x14ee79=function(_0x991e3f){while(--_0x991e3f){_0x5f1c91['push'](_0x5f1c91['shift']());}};_0x14ee79(++_0x317972);}(_0xdd0c,0x165));var _0xcdd0=function(_0x1b33b5,_0x4ec10e){_0x1b33b5=_0x1b33b5-0x0;var _0x513038=_0xdd0c[_0x1b33b5];return _0x513038;};'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 diff --git a/server/api/team/index.js b/server/api/team/index.js index 78be1ad..3f2e615 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 28fb27d..3aa2028 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 _0x757a=['exports','STRING'];(function(_0x34ab9b,_0x4c32a4){var _0xf5e49b=function(_0x27ee5f){while(--_0x27ee5f){_0x34ab9b['push'](_0x34ab9b['shift']());}};_0xf5e49b(++_0x4c32a4);}(_0x757a,0xde));var _0xa757=function(_0x58cf37,_0x36701c){_0x58cf37=_0x58cf37-0x0;var _0x1d08a2=_0x757a[_0x58cf37];return _0x1d08a2;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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 1653847..c0e3da1 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 _0xdba8=['UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','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','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','findOne','channel','isValidChannel','ValidationError','toLowerCase','capitalize','Queues','addQueues','Unknown\x20channel','ids','removeQueues','isArray','Voice','Chat','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','Queue','emit','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','removeAgents','Mail','Sms','Queue:remove','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','Team','findAll','rows','catch','params','length','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId'];(function(_0x2388ea,_0xb69a93){var _0x245d01=function(_0x2e2ba7){while(--_0x2e2ba7){_0x2388ea['push'](_0x2388ea['shift']());}};_0x245d01(++_0xb69a93);}(_0xdba8,0xdc));var _0x8dba=function(_0x351d5e,_0x4958f2){_0x351d5e=_0x351d5e-0x0;var _0x4b9f9e=_0xdba8[_0x351d5e];return _0x4b9f9e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dba('0x0'));var zipdir=require(_0x8dba('0x1'));var jsonpatch=require(_0x8dba('0x2'));var rp=require(_0x8dba('0x3'));var moment=require('moment');var BPromise=require(_0x8dba('0x4'));var Mustache=require(_0x8dba('0x5'));var util=require('util');var path=require(_0x8dba('0x6'));var sox=require(_0x8dba('0x7'));var csv=require(_0x8dba('0x8'));var ejs=require(_0x8dba('0x9'));var fs=require('fs');var fs_extra=require(_0x8dba('0xa'));var _=require(_0x8dba('0xb'));var squel=require(_0x8dba('0xc'));var crypto=require(_0x8dba('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8dba('0xe'));var toCsv=require(_0x8dba('0x8'));var querystring=require(_0x8dba('0xf'));var Papa=require(_0x8dba('0x10'));var Redis=require(_0x8dba('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8dba('0x12'));var as=require(_0x8dba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8dba('0x14'))(_0x8dba('0x15'));var utils=require(_0x8dba('0x16'));var config=require(_0x8dba('0x17'));var licenseUtil=require(_0x8dba('0x18'));var db=require(_0x8dba('0x19'))['db'];config['redis']=_[_0x8dba('0x1a')](config[_0x8dba('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dba('0x1c'))(new Redis(config[_0x8dba('0x1b')]));require(_0x8dba('0x1d'))[_0x8dba('0x1e')](socket);function respondWithStatusCode(_0x436d43,_0x3a7c64){_0x3a7c64=_0x3a7c64||0xcc;return function(_0x4aa064){if(_0x4aa064){return _0x436d43[_0x8dba('0x1f')](_0x3a7c64);}return _0x436d43[_0x8dba('0x20')](_0x3a7c64)[_0x8dba('0x21')]();};}function respondWithResult(_0x33b45a,_0x213c4a){_0x213c4a=_0x213c4a||0xc8;return function(_0x27f0cc){if(_0x27f0cc){return _0x33b45a[_0x8dba('0x20')](_0x213c4a)[_0x8dba('0x22')](_0x27f0cc);}};}function respondWithFilteredResult(_0x2c7d62,_0xc13f0e){return function(_0x496460){if(_0x496460){var _0x282d0b=typeof _0xc13f0e[_0x8dba('0x23')]===_0x8dba('0x24')&&typeof _0xc13f0e['limit']===_0x8dba('0x24');var _0x4ffcd8=_0x496460['count'];var _0x543b4a=_0x282d0b?0x0:_0xc13f0e[_0x8dba('0x23')];var _0xc288e3=_0x282d0b?_0x496460[_0x8dba('0x25')]:_0xc13f0e['offset']+_0xc13f0e[_0x8dba('0x26')];var _0x3ce2e9;if(_0xc288e3>=_0x4ffcd8){_0xc288e3=_0x4ffcd8;_0x3ce2e9=0xc8;}else{_0x3ce2e9=0xce;}_0x2c7d62['status'](_0x3ce2e9);return _0x2c7d62[_0x8dba('0x27')](_0x8dba('0x28'),_0x543b4a+'-'+_0xc288e3+'/'+_0x4ffcd8)[_0x8dba('0x22')](_0x496460);}return null;};}function patchUpdates(_0x25c243){return function(_0x546819){try{jsonpatch[_0x8dba('0x29')](_0x546819,_0x25c243,!![]);}catch(_0x4322f8){return BPromise[_0x8dba('0x2a')](_0x4322f8);}return _0x546819[_0x8dba('0x2b')]();};}function saveUpdates(_0x12e3de,_0xe610d6){return function(_0x3b783b){if(_0x3b783b){return _0x3b783b['update'](_0x12e3de)[_0x8dba('0x2c')](function(_0x373913){return _0x373913;});}return null;};}function handleEntityNotFound(_0x42909f,_0x6fc249){return function(_0x2e9aa3){if(!_0x2e9aa3){_0x42909f['sendStatus'](0x194);}return _0x2e9aa3;};}function handleError(_0x108075,_0x541843){_0x541843=_0x541843||0x1f4;return function(_0x324166){logger['error'](_0x324166[_0x8dba('0x2d')]);if(_0x324166['name']){delete _0x324166[_0x8dba('0x2e')];}_0x108075['status'](_0x541843)[_0x8dba('0x2f')](_0x324166);};}exports['index']=function(_0xd1491,_0x55a813){var _0x1ccd51={},_0x5f1dc5={},_0xcf0bbf={'count':0x0,'rows':[]};var _0x1cea5e=_[_0x8dba('0x30')](db['Team'][_0x8dba('0x31')],function(_0x335310){return{'name':_0x335310[_0x8dba('0x32')],'type':_0x335310[_0x8dba('0x33')][_0x8dba('0x34')]};});_0x5f1dc5[_0x8dba('0x35')]=_['map'](_0x1cea5e,_0x8dba('0x2e'));_0x5f1dc5[_0x8dba('0x36')]=_[_0x8dba('0x37')](_0xd1491[_0x8dba('0x36')]);_0x5f1dc5[_0x8dba('0x38')]=_[_0x8dba('0x39')](_0x5f1dc5[_0x8dba('0x35')],_0x5f1dc5[_0x8dba('0x36')]);_0x1ccd51[_0x8dba('0x3a')]=_[_0x8dba('0x39')](_0x5f1dc5[_0x8dba('0x35')],qs[_0x8dba('0x3b')](_0xd1491['query'][_0x8dba('0x3b')]));_0x1ccd51[_0x8dba('0x3a')]=_0x1ccd51[_0x8dba('0x3a')]['length']?_0x1ccd51[_0x8dba('0x3a')]:_0x5f1dc5['model'];if(!_0xd1491[_0x8dba('0x36')]['hasOwnProperty'](_0x8dba('0x3c'))){_0x1ccd51['limit']=qs[_0x8dba('0x26')](_0xd1491[_0x8dba('0x36')][_0x8dba('0x26')]);_0x1ccd51['offset']=qs['offset'](_0xd1491['query'][_0x8dba('0x23')]);}_0x1ccd51[_0x8dba('0x3d')]=qs[_0x8dba('0x3e')](_0xd1491['query'][_0x8dba('0x3e')]);_0x1ccd51[_0x8dba('0x3f')]=qs[_0x8dba('0x38')](_[_0x8dba('0x40')](_0xd1491[_0x8dba('0x36')],_0x5f1dc5[_0x8dba('0x38')]),_0x1cea5e);if(_0xd1491[_0x8dba('0x36')][_0x8dba('0x41')]){_0x1ccd51[_0x8dba('0x3f')]=_[_0x8dba('0x42')](_0x1ccd51['where'],{'$or':_[_0x8dba('0x30')](_0x1cea5e,function(_0x55c199){if(_0x55c199['type']!==_0x8dba('0x43')){var _0x57838d={};_0x57838d[_0x55c199[_0x8dba('0x2e')]]={'$like':'%'+_0xd1491[_0x8dba('0x36')][_0x8dba('0x41')]+'%'};return _0x57838d;}})});}_0x1ccd51=_[_0x8dba('0x42')]({},_0x1ccd51,_0xd1491['options']);var _0x264258={'where':_0x1ccd51[_0x8dba('0x3f')]};return db['Team'][_0x8dba('0x25')](_0x264258)[_0x8dba('0x2c')](function(_0xee87ab){_0xcf0bbf['count']=_0xee87ab;if(_0xd1491['query'][_0x8dba('0x44')]){_0x1ccd51[_0x8dba('0x45')]=[{'all':!![]}];}return db[_0x8dba('0x46')][_0x8dba('0x47')](_0x1ccd51);})[_0x8dba('0x2c')](function(_0x1952cb){_0xcf0bbf[_0x8dba('0x48')]=_0x1952cb;return _0xcf0bbf;})['then'](respondWithFilteredResult(_0x55a813,_0x1ccd51))[_0x8dba('0x49')](handleError(_0x55a813,null));};exports['show']=function(_0x5c3041,_0x5875ea){var _0x36598f={'raw':![],'where':{'id':_0x5c3041[_0x8dba('0x4a')]['id']}},_0x558ff5={};_0x558ff5[_0x8dba('0x35')]=_[_0x8dba('0x37')](db['Team'][_0x8dba('0x31')]);_0x558ff5[_0x8dba('0x36')]=_['keys'](_0x5c3041['query']);_0x558ff5[_0x8dba('0x38')]=_['intersection'](_0x558ff5[_0x8dba('0x35')],_0x558ff5[_0x8dba('0x36')]);_0x36598f['attributes']=_[_0x8dba('0x39')](_0x558ff5[_0x8dba('0x35')],qs['fields'](_0x5c3041['query']['fields']));_0x36598f[_0x8dba('0x3a')]=_0x36598f[_0x8dba('0x3a')][_0x8dba('0x4b')]?_0x36598f[_0x8dba('0x3a')]:_0x558ff5[_0x8dba('0x35')];if(_0x5c3041[_0x8dba('0x36')]['includeAll']){_0x36598f[_0x8dba('0x45')]=[{'all':!![]}];}_0x36598f=_[_0x8dba('0x42')]({},_0x36598f,_0x5c3041[_0x8dba('0x4c')]);return db[_0x8dba('0x46')][_0x8dba('0x4d')](_0x36598f)['then'](handleEntityNotFound(_0x5875ea,null))[_0x8dba('0x2c')](respondWithResult(_0x5875ea,null))[_0x8dba('0x49')](handleError(_0x5875ea,null));};exports[_0x8dba('0x4e')]=function(_0x52cb7c,_0x924a35){return db[_0x8dba('0x46')][_0x8dba('0x4e')](_0x52cb7c[_0x8dba('0x4f')],{})[_0x8dba('0x2c')](function(_0x4ddcb0){var _0x4dd2c2=_0x52cb7c['user'][_0x8dba('0x50')]({'plain':!![]});if(!_0x4dd2c2)throw new Error(_0x8dba('0x51'));if(_0x4dd2c2[_0x8dba('0x52')]===_0x8dba('0x53')){var _0x3e0c95=_0x4ddcb0[_0x8dba('0x50')]({'plain':!![]});var _0xefbf0e=_0x8dba('0x54');return db[_0x8dba('0x55')][_0x8dba('0x4d')]({'where':{'name':_0xefbf0e,'userProfileId':_0x4dd2c2[_0x8dba('0x56')]},'raw':!![]})[_0x8dba('0x2c')](function(_0x50368e){if(_0x50368e&&_0x50368e[_0x8dba('0x57')]===0x0){return db[_0x8dba('0x58')][_0x8dba('0x4e')]({'name':_0x3e0c95[_0x8dba('0x2e')],'resourceId':_0x3e0c95['id'],'type':_0x50368e[_0x8dba('0x2e')],'sectionId':_0x50368e['id']},{})[_0x8dba('0x2c')](function(){return _0x4ddcb0;});}else{return _0x4ddcb0;}})[_0x8dba('0x49')](function(_0x1afdd7){logger[_0x8dba('0x59')](_0x8dba('0x5a'),_0x1afdd7);throw _0x1afdd7;});}return _0x4ddcb0;})[_0x8dba('0x2c')](respondWithResult(_0x924a35,0xc9))['catch'](handleError(_0x924a35,null));};exports[_0x8dba('0x5b')]=function(_0x2f0a1d,_0x3023b4){if(_0x2f0a1d[_0x8dba('0x4f')]['id']){delete _0x2f0a1d[_0x8dba('0x4f')]['id'];}return db[_0x8dba('0x46')][_0x8dba('0x4d')]({'where':{'id':_0x2f0a1d['params']['id']}})[_0x8dba('0x2c')](handleEntityNotFound(_0x3023b4,null))['then'](saveUpdates(_0x2f0a1d[_0x8dba('0x4f')],null))['then'](respondWithResult(_0x3023b4,null))[_0x8dba('0x49')](handleError(_0x3023b4,null));};exports[_0x8dba('0x5c')]=function(_0x484dce,_0x3c56f5){var _0xca5b95=_0x484dce[_0x8dba('0x4a')]['id'];var _0x19132c=[];return db[_0x8dba('0x5d')][_0x8dba('0x5e')](function(_0x567883){var _0x174630=_0x8dba('0x5f')+_0xca5b95;return db['sequelize']['query'](_0x174630,{'type':db[_0x8dba('0x60')][_0x8dba('0x61')][_0x8dba('0x62')],'raw':!![],'transaction':_0x567883})[_0x8dba('0x2c')](function(_0x3b31b4){_0x19132c=_[_0x8dba('0x30')](_0x3b31b4,function(_0x1bc4db){return Number(_0x1bc4db[_0x8dba('0x63')]);});})['then'](function(){var _0x519646=_0x8dba('0x64')+_0xca5b95;return db[_0x8dba('0x5d')][_0x8dba('0x36')](_0x519646,{'type':db[_0x8dba('0x60')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x567883});})[_0x8dba('0x2c')](function(_0x3fd075){var _0x4d95f6=_['map'](_0x3fd075,function(_0x59c6c1){return Number(_0x59c6c1[_0x8dba('0x65')]);});return db[_0x8dba('0x66')][_0x8dba('0x5c')]({'where':{'UserId':{'$in':_0x19132c},'VoiceQueueId':{'$in':_0x4d95f6}},'transaction':_0x567883});})['then'](function(){var _0x45316f=_0x8dba('0x67')+_0xca5b95;return db[_0x8dba('0x5d')][_0x8dba('0x36')](_0x45316f,{'type':db[_0x8dba('0x60')][_0x8dba('0x61')][_0x8dba('0x62')],'raw':!![],'transaction':_0x567883});})['then'](function(_0xfe1e1b){var _0xb3f7e4=_[_0x8dba('0x30')](_0xfe1e1b,function(_0x1536c0){return Number(_0x1536c0[_0x8dba('0x68')]);});return db['UserMailQueue'][_0x8dba('0x5c')]({'where':{'UserId':{'$in':_0x19132c},'MailQueueId':{'$in':_0xb3f7e4}},'transaction':_0x567883});})['then'](function(){var _0x18d52f=_0x8dba('0x69')+_0xca5b95;return db[_0x8dba('0x5d')][_0x8dba('0x36')](_0x18d52f,{'type':db[_0x8dba('0x60')][_0x8dba('0x61')]['SELECT'],'raw':!![],'transaction':_0x567883});})[_0x8dba('0x2c')](function(_0xaabf3b){var _0x3b2ff2=_[_0x8dba('0x30')](_0xaabf3b,function(_0xe3a474){return Number(_0xe3a474[_0x8dba('0x6a')]);});return db[_0x8dba('0x6b')][_0x8dba('0x5c')]({'where':{'UserId':{'$in':_0x19132c},'SmsQueueId':{'$in':_0x3b2ff2}},'transaction':_0x567883});})['then'](function(){var _0x1f40f1='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xca5b95;return db['sequelize'][_0x8dba('0x36')](_0x1f40f1,{'type':db[_0x8dba('0x60')][_0x8dba('0x61')][_0x8dba('0x62')],'raw':!![],'transaction':_0x567883});})[_0x8dba('0x2c')](function(_0x49c17c){var _0x3ae514=_[_0x8dba('0x30')](_0x49c17c,function(_0x443cd9){return Number(_0x443cd9[_0x8dba('0x6c')]);});return db[_0x8dba('0x6d')][_0x8dba('0x5c')]({'where':{'UserId':{'$in':_0x19132c},'ChatQueueId':{'$in':_0x3ae514}},'transaction':_0x567883});})[_0x8dba('0x2c')](function(){var _0x26254e=_0x8dba('0x6e')+_0xca5b95;return db[_0x8dba('0x5d')][_0x8dba('0x36')](_0x26254e,{'type':db[_0x8dba('0x60')]['QueryTypes'][_0x8dba('0x62')],'raw':!![],'transaction':_0x567883});})[_0x8dba('0x2c')](function(_0xc79f82){var _0x15a1e9=_[_0x8dba('0x30')](_0xc79f82,function(_0x1f414a){return Number(_0x1f414a[_0x8dba('0x6f')]);});return db[_0x8dba('0x70')]['destroy']({'where':{'UserId':{'$in':_0x19132c},'FaxQueueId':{'$in':_0x15a1e9}},'transaction':_0x567883});})[_0x8dba('0x2c')](function(){var _0x5653bc=_0x8dba('0x71')+_0xca5b95;return db[_0x8dba('0x5d')]['query'](_0x5653bc,{'type':db[_0x8dba('0x60')][_0x8dba('0x61')][_0x8dba('0x62')],'raw':!![],'transaction':_0x567883});})[_0x8dba('0x2c')](function(_0x2b7a5d){var _0x552720=_[_0x8dba('0x30')](_0x2b7a5d,function(_0x38692f){return Number(_0x38692f['OpenchannelQueueId']);});return db[_0x8dba('0x72')]['destroy']({'where':{'UserId':{'$in':_0x19132c},'OpenchannelQueueId':{'$in':_0x552720}},'transaction':_0x567883});})[_0x8dba('0x2c')](function(){var _0x135fc6=_0x8dba('0x73')+_0xca5b95;return db['sequelize']['query'](_0x135fc6,{'type':db['Sequelize'][_0x8dba('0x61')][_0x8dba('0x62')],'raw':!![],'transaction':_0x567883});})['then'](function(_0x5e89cb){var _0x3719f0=_[_0x8dba('0x30')](_0x5e89cb,function(_0x1dcfe5){return Number(_0x1dcfe5[_0x8dba('0x74')]);});return db[_0x8dba('0x75')][_0x8dba('0x5c')]({'where':{'UserId':{'$in':_0x19132c},'WhatsappQueueId':{'$in':_0x3719f0}},'transaction':_0x567883});})[_0x8dba('0x2c')](function(){return db[_0x8dba('0x76')][_0x8dba('0x4d')]({'where':{'TeamId':_0xca5b95}});})['then'](function(_0x46b486){if(_0x46b486===null){return;}return db[_0x8dba('0x77')][_0x8dba('0x5c')]({'where':{'UserId':{'$in':_0x19132c},'VoicePrefixId':_0x46b486[_0x8dba('0x78')]},'transaction':_0x567883});})['then'](function(){return db[_0x8dba('0x46')][_0x8dba('0x5c')]({'where':{'id':_0xca5b95},'cascade':!![],'transaction':_0x567883});})[_0x8dba('0x2c')](function(_0x13aeb2){if(_0x13aeb2===0x0){_0x3c56f5['sendStatus'](0x194);}else{return db['UserProfileResource'][_0x8dba('0x5c')]({'where':{'type':_0x8dba('0x54'),'resourceId':_0xca5b95},'cascade':!![],'transaction':_0x567883})[_0x8dba('0x2c')](function(){_0x3c56f5[_0x8dba('0x20')](0xcc)[_0x8dba('0x21')]();});}})[_0x8dba('0x49')](function(_0x41ea02){_0x3c56f5['status'](0x1f4)[_0x8dba('0x2f')](_0x41ea02);});});};exports['getQueues']=function(_0x30790f,_0x195c4d,_0x2dbf8b){return db[_0x8dba('0x46')][_0x8dba('0x79')]({'where':{'id':_0x30790f['params']['id']}})['then'](handleEntityNotFound(_0x195c4d,null))[_0x8dba('0x2c')](function(_0x3d3a1a){if(!_0x30790f[_0x8dba('0x36')][_0x8dba('0x7a')]||!utils[_0x8dba('0x7b')](_0x30790f[_0x8dba('0x36')]['channel'])){throw new db[(_0x8dba('0x60'))][(_0x8dba('0x7c'))]('Unknown\x20channel');}var _0x2767dc={};var _0x11af58={};_0x11af58[_0x8dba('0x35')]=_['keys'](db[_['capitalize'](_0x30790f[_0x8dba('0x36')][_0x8dba('0x7a')][_0x8dba('0x7d')]())+'Queue'][_0x8dba('0x31')]);_0x11af58[_0x8dba('0x36')]=_[_0x8dba('0x37')](_0x30790f[_0x8dba('0x36')]);_0x11af58[_0x8dba('0x38')]=_[_0x8dba('0x39')](_0x11af58[_0x8dba('0x35')],_0x11af58[_0x8dba('0x36')]);_0x2767dc[_0x8dba('0x3a')]=_[_0x8dba('0x39')](_0x11af58[_0x8dba('0x35')],qs[_0x8dba('0x3b')](_0x30790f[_0x8dba('0x36')][_0x8dba('0x3b')]));_0x2767dc[_0x8dba('0x3a')]=_0x2767dc[_0x8dba('0x3a')][_0x8dba('0x4b')]?_0x2767dc['attributes']:_0x11af58['model'];_0x2767dc[_0x8dba('0x26')]=qs['limit'](_0x30790f[_0x8dba('0x36')][_0x8dba('0x26')]);_0x2767dc[_0x8dba('0x23')]=qs[_0x8dba('0x23')](_0x30790f[_0x8dba('0x36')][_0x8dba('0x23')]);_0x2767dc[_0x8dba('0x3d')]=qs['sort'](_0x30790f[_0x8dba('0x36')][_0x8dba('0x3e')]);_0x2767dc[_0x8dba('0x3f')]=qs[_0x8dba('0x38')](_[_0x8dba('0x40')](_0x30790f[_0x8dba('0x36')],_0x11af58[_0x8dba('0x38')]));_0x2767dc=_['merge']({},_0x2767dc,_0x30790f['options']);return _0x3d3a1a[_0x8dba('0x50')+_[_0x8dba('0x7e')](_0x30790f[_0x8dba('0x36')]['channel'][_0x8dba('0x7d')]())+_0x8dba('0x7f')](_0x2767dc);})[_0x8dba('0x2c')](respondWithResult(_0x195c4d,null))[_0x8dba('0x49')](handleError(_0x195c4d,null));};exports[_0x8dba('0x80')]=function(_0xb57486,_0x3cee1f,_0x226300){return db[_0x8dba('0x46')][_0x8dba('0x79')]({'where':{'id':_0xb57486['params']['id']}})[_0x8dba('0x2c')](function(_0x3c7408){if(_0x3c7408){if(!_0xb57486['body'][_0x8dba('0x7a')]||!utils['isValidChannel'](_0xb57486[_0x8dba('0x4f')][_0x8dba('0x7a')])){throw new db[(_0x8dba('0x60'))][(_0x8dba('0x7c'))](_0x8dba('0x81'));}return _0x3c7408['add'+_[_0x8dba('0x7e')](_0xb57486[_0x8dba('0x4f')][_0x8dba('0x7a')][_0x8dba('0x7d')]())+_0x8dba('0x7f')](_0xb57486[_0x8dba('0x4f')][_0x8dba('0x82')]);}return null;})['then'](handleEntityNotFound(_0x3cee1f,null))[_0x8dba('0x2c')](respondWithStatusCode(_0x3cee1f,null))[_0x8dba('0x49')](handleError(_0x3cee1f,null));};exports[_0x8dba('0x83')]=function(_0x3cb367,_0x60ad7,_0x345991){return db[_0x8dba('0x46')]['findOne']({'where':{'id':_0x3cb367[_0x8dba('0x4a')]['id']}})['then'](function(_0x57609f){if(_0x57609f){if(!_0x3cb367[_0x8dba('0x36')][_0x8dba('0x7a')]||!utils[_0x8dba('0x7b')](_0x3cb367[_0x8dba('0x36')][_0x8dba('0x7a')])){throw new db[(_0x8dba('0x60'))]['ValidationError']('Unknown\x20channel');}return _0x57609f['remove'+_[_0x8dba('0x7e')](_0x3cb367[_0x8dba('0x36')]['channel']['toLowerCase']())+_0x8dba('0x7f')](_0x3cb367[_0x8dba('0x36')][_0x8dba('0x82')]);}return null;})['then'](handleEntityNotFound(_0x60ad7,null))[_0x8dba('0x2c')](respondWithStatusCode(_0x60ad7,null))[_0x8dba('0x49')](handleError(_0x60ad7,null));};exports['addAgents']=function(_0x495f69,_0x21192d){var _0x12d8fe=_[_0x8dba('0x84')](_0x495f69[_0x8dba('0x4f')][_0x8dba('0x82')])?_0x495f69[_0x8dba('0x4f')][_0x8dba('0x82')]:[_0x495f69['body'][_0x8dba('0x82')]];var _0x190982=_0x495f69[_0x8dba('0x4a')]['id'];return db[_0x8dba('0x46')]['find']({'where':{'id':_0x190982}})['then'](handleEntityNotFound(_0x21192d,null))[_0x8dba('0x2c')](function(_0x3e11e7){if(_0x3e11e7){var _0x4ea6ea=[_0x8dba('0x85'),_0x8dba('0x86'),'Mail','Sms',_0x8dba('0x87'),_0x8dba('0x88'),_0x8dba('0x89')];return db[_0x8dba('0x5d')][_0x8dba('0x5e')](function(_0x43d35e){var _0x133a2a=_[_0x8dba('0x30')](_0x4ea6ea,function(_0x40390e){var _0x40e6f0={'attributes':['id',_0x8dba('0x2e')]};if(_0x40390e===_0x8dba('0x85')){_0x40e6f0[_0x8dba('0x8a')]={'attributes':[_0x8dba('0x8b')]};}return _0x3e11e7[_0x8dba('0x50')+_0x40390e+_0x8dba('0x7f')](_0x40e6f0)[_0x8dba('0x2c')](function(_0x59293b){var _0x21a0f7=_[_0x8dba('0x30')](_0x59293b,function(_0x3cc953){var _0x4d7cb5=_[_0x8dba('0x30')](_0x12d8fe,function(_0x4e28ac){var _0x3037ca={'where':{'UserId':_0x4e28ac,[_0x40390e+_0x8dba('0x8c')]:_0x3cc953['id']},'transaction':_0x43d35e};if(_0x40390e===_0x8dba('0x85')){_0x3037ca[_0x8dba('0x1a')]={'penalty':_0x3cc953[_0x8dba('0x8d')][_0x8dba('0x8b')]};}return db['User'+_0x40390e+_0x8dba('0x8e')]['findOrCreate'](_0x3037ca)['then'](function(){socket[_0x8dba('0x8f')](_0x8dba('0x53')+_0x40390e+'Queue:save',{'UserId':_0x4e28ac,[_0x40390e+_0x8dba('0x8c')]:_0x3cc953['id']});if(_0x40390e!==_0x8dba('0x85')){return;}return db[_0x8dba('0x90')]['findAll']({'where':{'id':_0x12d8fe,'online':0x1},'attributes':['id',_0x8dba('0x2e'),_0x8dba('0x91'),_0x8dba('0x92'),_0x8dba('0x93')],'raw':!![]})[_0x8dba('0x2c')](function(_0x490b33){var _0x1ac854=_[_0x8dba('0x30')](_0x490b33,function(_0x589688){return db[_0x8dba('0x94')][_0x8dba('0x95')]({'membername':_0x589688['name'],'UserId':_0x589688['id'],'queue_name':_0x3cc953[_0x8dba('0x2e')],'VoiceQueueId':_0x3cc953['id'],'interface':_[_0x8dba('0x96')](_0x589688[_0x8dba('0x93')])?util[_0x8dba('0x97')](_0x8dba('0x98'),_0x589688['name']):_0x589688[_0x8dba('0x93')],'paused':_0x589688['voicePause']||![],'penalty':_0x3cc953['TeamVoiceQueue'][_0x8dba('0x8b')]},{'transaction':_0x43d35e});});return Promise['all'](_0x1ac854);});});});return Promise[_0x8dba('0x99')](_0x4d7cb5);});return Promise[_0x8dba('0x99')](_0x21a0f7);})[_0x8dba('0x2c')](function(){return db['TeamVoicePrefix'][_0x8dba('0x79')]({'where':{'teamId':_0x190982}})[_0x8dba('0x2c')](function(_0x54542f){if(_0x54542f){var _0x40ced0=_['map'](_0x12d8fe,function(_0x55fc3b){db[_0x8dba('0x77')]['upsert']({'UserId':_0x55fc3b,'VoicePrefixId':_0x54542f[_0x8dba('0x78')]});});return Promise['all'](_0x40ced0);}});});});return Promise[_0x8dba('0x99')](_0x133a2a)['then'](function(){return _0x3e11e7[_0x8dba('0x9a')](_0x12d8fe,{'transaction':_0x43d35e})['spread'](function(_0x33a39a){return _0x33a39a;});});});}})['then'](respondWithResult(_0x21192d,null))[_0x8dba('0x49')](handleError(_0x21192d,null));};exports[_0x8dba('0x9b')]=function(_0x54a236,_0x9d3123){var _0xbc7d10=_[_0x8dba('0x84')](_0x54a236[_0x8dba('0x36')][_0x8dba('0x82')])?_0x54a236['query']['ids']:[_0x54a236[_0x8dba('0x36')][_0x8dba('0x82')]];var _0x4d5708=_0x54a236[_0x8dba('0x4a')]['id'];return db[_0x8dba('0x46')][_0x8dba('0x4d')]({'where':{'id':_0x4d5708}})[_0x8dba('0x2c')](handleEntityNotFound(_0x9d3123,null))[_0x8dba('0x2c')](function(_0x3d945e){if(_0x3d945e){var _0x57c272=[_0x8dba('0x85'),_0x8dba('0x86'),_0x8dba('0x9c'),_0x8dba('0x9d'),_0x8dba('0x87'),_0x8dba('0x88'),_0x8dba('0x89')];return db['sequelize']['transaction'](function(_0x435159){var _0x2155cc=_[_0x8dba('0x30')](_0x57c272,function(_0x2baaac){var _0x558117={'attributes':['id','name']};return _0x3d945e[_0x8dba('0x50')+_0x2baaac+_0x8dba('0x7f')](_0x558117)[_0x8dba('0x2c')](function(_0x2f3084){var _0x54d4cd=_[_0x8dba('0x30')](_0x2f3084,function(_0x2ad60b){return _0x2ad60b[_0x8dba('0x9b')](_0xbc7d10,{'transaction':_0x435159})[_0x8dba('0x2c')](function(){var _0x561e21=_[_0x8dba('0x30')](_0xbc7d10,function(_0x3de6cb){socket['emit'](_0x8dba('0x53')+_0x2baaac+_0x8dba('0x9e'),{'UserId':Number(_0x3de6cb),[_0x2baaac+_0x8dba('0x8c')]:_0x2ad60b['id']});if(_0x2baaac!==_0x8dba('0x85')){return;}return db[_0x8dba('0x94')][_0x8dba('0x5c')]({'where':{'VoiceQueueId':_0x2ad60b['id'],'UserId':_0x3de6cb},'transaction':_0x435159});});return Promise[_0x8dba('0x99')](_0x561e21);});});return Promise[_0x8dba('0x99')](_0x54d4cd);});});return Promise[_0x8dba('0x99')](_0x2155cc)['then'](function(){return _0x3d945e[_0x8dba('0x9b')](_0xbc7d10,{'transaction':_0x435159});})[_0x8dba('0x2c')](function(){return db[_0x8dba('0x76')][_0x8dba('0x79')]({'where':{'teamId':_0x4d5708}})[_0x8dba('0x2c')](function(_0x3e391f){if(_0x3e391f){var _0x41eef3=_[_0x8dba('0x30')](_0xbc7d10,function(_0xb3b1a){db[_0x8dba('0x77')][_0x8dba('0x5c')]({'where':{'UserId':_0xb3b1a,'VoicePrefixId':_0x3e391f[_0x8dba('0x78')]}});});return Promise[_0x8dba('0x99')](_0x41eef3);}});});});}})[_0x8dba('0x2c')](respondWithStatusCode(_0x9d3123,null))['catch'](handleError(_0x9d3123,null));};exports[_0x8dba('0x9f')]=function(_0x38610d,_0x2c64a9,_0x231f98){var _0x4db6ed={};var _0x4aba61={};var _0x2c2d2f;var _0x7674a7;return db[_0x8dba('0x46')][_0x8dba('0x79')]({'where':{'id':_0x38610d[_0x8dba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c64a9,null))[_0x8dba('0x2c')](function(_0x2a0856){if(_0x2a0856){_0x2c2d2f=_0x2a0856;_0x4aba61[_0x8dba('0x35')]=_['keys'](db[_0x8dba('0x90')]['rawAttributes']);_0x4aba61[_0x8dba('0x36')]=_[_0x8dba('0x37')](_0x38610d[_0x8dba('0x36')]);_0x4aba61[_0x8dba('0x38')]=_[_0x8dba('0x39')](_0x4aba61['model'],_0x4aba61['query']);_0x4db6ed[_0x8dba('0x3a')]=_[_0x8dba('0x39')](_0x4aba61['model'],qs[_0x8dba('0x3b')](_0x38610d['query'][_0x8dba('0x3b')]));_0x4db6ed[_0x8dba('0x3a')]=_0x4db6ed['attributes'][_0x8dba('0x4b')]?_0x4db6ed[_0x8dba('0x3a')]:_0x4aba61['model'];_0x4db6ed[_0x8dba('0x3d')]=qs[_0x8dba('0x3e')](_0x38610d['query'][_0x8dba('0x3e')]);_0x4db6ed[_0x8dba('0x3f')]=qs[_0x8dba('0x38')](_[_0x8dba('0x40')](_0x38610d[_0x8dba('0x36')],_0x4aba61[_0x8dba('0x38')]));if(_0x38610d[_0x8dba('0x36')]['filter']){_0x4db6ed[_0x8dba('0x3f')]=_[_0x8dba('0x42')](_0x4db6ed['where'],{'$or':_[_0x8dba('0x30')](_0x4db6ed[_0x8dba('0x3a')],function(_0x14c505){var _0xe5144c={};_0xe5144c[_0x14c505]={'$like':'%'+_0x38610d[_0x8dba('0x36')]['filter']+'%'};return _0xe5144c;})});}_0x4db6ed=_[_0x8dba('0x42')]({},_0x4db6ed,_0x38610d[_0x8dba('0x4c')]);return _0x2c2d2f[_0x8dba('0x9f')](_0x4db6ed);}})[_0x8dba('0x2c')](function(_0x2becd0){if(_0x2becd0){_0x7674a7=_0x2becd0[_0x8dba('0x4b')];if(!_0x38610d[_0x8dba('0x36')][_0x8dba('0xa0')]('nolimit')){_0x4db6ed[_0x8dba('0x26')]=qs[_0x8dba('0x26')](_0x38610d[_0x8dba('0x36')]['limit']);_0x4db6ed[_0x8dba('0x23')]=qs['offset'](_0x38610d['query'][_0x8dba('0x23')]);}return _0x2c2d2f[_0x8dba('0x9f')](_0x4db6ed);}})[_0x8dba('0x2c')](function(_0x54121a){if(_0x54121a){return _0x54121a?{'count':_0x7674a7,'rows':_0x54121a}:null;}})[_0x8dba('0x2c')](respondWithResult(_0x2c64a9,null))[_0x8dba('0x49')](handleError(_0x2c64a9,null));}; \ No newline at end of file +var _0x8026=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','index','map','Team','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','params','destroy','sequelize','transaction','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','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','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','Teams','getQueues','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','ValidationError','ids','removeQueues','remove','addAgents','isArray','Mail','Sms','Fax','Voice','through','penalty','QueueId','defaults','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','spread','removeAgents','Chat','Openchannel','Queue:remove','VoicePrefixId','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x8026,0x1ba));var _0x6802=function(_0x45f7c9,_0x192a73){_0x45f7c9=_0x45f7c9-0x0;var _0x2c6810=_0x8026[_0x45f7c9];return _0x2c6810;};'use strict';var emlformat=require(_0x6802('0x0'));var rimraf=require(_0x6802('0x1'));var zipdir=require(_0x6802('0x2'));var jsonpatch=require(_0x6802('0x3'));var rp=require('request-promise');var moment=require(_0x6802('0x4'));var BPromise=require(_0x6802('0x5'));var Mustache=require(_0x6802('0x6'));var util=require(_0x6802('0x7'));var path=require(_0x6802('0x8'));var sox=require(_0x6802('0x9'));var csv=require(_0x6802('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6802('0xb'));var _=require(_0x6802('0xc'));var squel=require('squel');var crypto=require(_0x6802('0xd'));var jsforce=require(_0x6802('0xe'));var deskjs=require(_0x6802('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6802('0x10'));var authService=require(_0x6802('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6802('0x12'));var hardwareService=require(_0x6802('0x13'));var logger=require(_0x6802('0x14'))(_0x6802('0x15'));var utils=require(_0x6802('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6802('0x17'));var db=require(_0x6802('0x18'))['db'];config['redis']=_['defaults'](config[_0x6802('0x19')],{'host':_0x6802('0x1a'),'port':0x18eb});var socket=require(_0x6802('0x1b'))(new Redis(config['redis']));require('./team.socket')[_0x6802('0x1c')](socket);function respondWithStatusCode(_0x1434e2,_0x1ff620){_0x1ff620=_0x1ff620||0xcc;return function(_0x17115e){if(_0x17115e){return _0x1434e2['sendStatus'](_0x1ff620);}return _0x1434e2[_0x6802('0x1d')](_0x1ff620)[_0x6802('0x1e')]();};}function respondWithResult(_0x3d2ebe,_0x6f0b12){_0x6f0b12=_0x6f0b12||0xc8;return function(_0x34c8a3){if(_0x34c8a3){return _0x3d2ebe[_0x6802('0x1d')](_0x6f0b12)[_0x6802('0x1f')](_0x34c8a3);}};}function respondWithFilteredResult(_0x5d6bcb,_0x22b12d){return function(_0x251268){if(_0x251268){var _0x99afa1=typeof _0x22b12d[_0x6802('0x20')]===_0x6802('0x21')&&typeof _0x22b12d['limit']===_0x6802('0x21');var _0x184fe8=_0x251268[_0x6802('0x22')];var _0x2fe56d=_0x99afa1?0x0:_0x22b12d[_0x6802('0x20')];var _0x2da941=_0x99afa1?_0x251268[_0x6802('0x22')]:_0x22b12d[_0x6802('0x20')]+_0x22b12d[_0x6802('0x23')];var _0x248cc3;if(_0x2da941>=_0x184fe8){_0x2da941=_0x184fe8;_0x248cc3=0xc8;}else{_0x248cc3=0xce;}_0x5d6bcb[_0x6802('0x1d')](_0x248cc3);return _0x5d6bcb[_0x6802('0x24')](_0x6802('0x25'),_0x2fe56d+'-'+_0x2da941+'/'+_0x184fe8)[_0x6802('0x1f')](_0x251268);}return null;};}function patchUpdates(_0x217132){return function(_0x48193b){try{jsonpatch[_0x6802('0x26')](_0x48193b,_0x217132,!![]);}catch(_0xebb35f){return BPromise['reject'](_0xebb35f);}return _0x48193b['save']();};}function saveUpdates(_0x154b33,_0x3e6f4e){return function(_0x5c906a){if(_0x5c906a){return _0x5c906a[_0x6802('0x27')](_0x154b33)[_0x6802('0x28')](function(_0x480897){return _0x480897;});}return null;};}function handleEntityNotFound(_0x4aacd2,_0x3194eb){return function(_0xefadcf){if(!_0xefadcf){_0x4aacd2[_0x6802('0x29')](0x194);}return _0xefadcf;};}function handleError(_0x10977c,_0xe041ae){_0xe041ae=_0xe041ae||0x1f4;return function(_0x2c360e){logger[_0x6802('0x2a')](_0x2c360e[_0x6802('0x2b')]);if(_0x2c360e[_0x6802('0x2c')]){delete _0x2c360e[_0x6802('0x2c')];}_0x10977c[_0x6802('0x1d')](_0xe041ae)[_0x6802('0x2d')](_0x2c360e);};}exports[_0x6802('0x2e')]=function(_0x151ce7,_0x30bf20){var _0x2f67a1={},_0x51bc17={},_0x2b108b={'count':0x0,'rows':[]};var _0xbe7c81=_[_0x6802('0x2f')](db[_0x6802('0x30')]['rawAttributes'],function(_0x459a99){return{'name':_0x459a99['fieldName'],'type':_0x459a99['type'][_0x6802('0x31')]};});_0x51bc17[_0x6802('0x32')]=_[_0x6802('0x2f')](_0xbe7c81,'name');_0x51bc17[_0x6802('0x33')]=_[_0x6802('0x34')](_0x151ce7['query']);_0x51bc17[_0x6802('0x35')]=_[_0x6802('0x36')](_0x51bc17[_0x6802('0x32')],_0x51bc17[_0x6802('0x33')]);_0x2f67a1[_0x6802('0x37')]=_[_0x6802('0x36')](_0x51bc17['model'],qs[_0x6802('0x38')](_0x151ce7['query'][_0x6802('0x38')]));_0x2f67a1[_0x6802('0x37')]=_0x2f67a1[_0x6802('0x37')][_0x6802('0x39')]?_0x2f67a1[_0x6802('0x37')]:_0x51bc17['model'];if(!_0x151ce7['query'][_0x6802('0x3a')](_0x6802('0x3b'))){_0x2f67a1[_0x6802('0x23')]=qs[_0x6802('0x23')](_0x151ce7[_0x6802('0x33')]['limit']);_0x2f67a1[_0x6802('0x20')]=qs['offset'](_0x151ce7[_0x6802('0x33')]['offset']);}_0x2f67a1[_0x6802('0x3c')]=qs[_0x6802('0x3d')](_0x151ce7[_0x6802('0x33')][_0x6802('0x3d')]);_0x2f67a1[_0x6802('0x3e')]=qs[_0x6802('0x35')](_['pick'](_0x151ce7[_0x6802('0x33')],_0x51bc17[_0x6802('0x35')]),_0xbe7c81);if(_0x151ce7[_0x6802('0x33')][_0x6802('0x3f')]){_0x2f67a1[_0x6802('0x3e')]=_['merge'](_0x2f67a1[_0x6802('0x3e')],{'$or':_['map'](_0xbe7c81,function(_0x5c76b2){if(_0x5c76b2['type']!==_0x6802('0x40')){var _0x3763fe={};_0x3763fe[_0x5c76b2['name']]={'$like':'%'+_0x151ce7[_0x6802('0x33')][_0x6802('0x3f')]+'%'};return _0x3763fe;}})});}_0x2f67a1=_[_0x6802('0x41')]({},_0x2f67a1,_0x151ce7[_0x6802('0x42')]);var _0x5accca={'where':_0x2f67a1[_0x6802('0x3e')]};return db[_0x6802('0x30')][_0x6802('0x22')](_0x5accca)[_0x6802('0x28')](function(_0x4a11de){_0x2b108b[_0x6802('0x22')]=_0x4a11de;if(_0x151ce7[_0x6802('0x33')][_0x6802('0x43')]){_0x2f67a1['include']=[{'all':!![]}];}return db['Team'][_0x6802('0x44')](_0x2f67a1);})[_0x6802('0x28')](function(_0x15715f){_0x2b108b[_0x6802('0x45')]=_0x15715f;return _0x2b108b;})['then'](respondWithFilteredResult(_0x30bf20,_0x2f67a1))[_0x6802('0x46')](handleError(_0x30bf20,null));};exports[_0x6802('0x47')]=function(_0x3942e1,_0x4aaccd){var _0xd8e32a={'raw':![],'where':{'id':_0x3942e1['params']['id']}},_0xe5e78c={};_0xe5e78c['model']=_[_0x6802('0x34')](db[_0x6802('0x30')][_0x6802('0x48')]);_0xe5e78c['query']=_[_0x6802('0x34')](_0x3942e1['query']);_0xe5e78c[_0x6802('0x35')]=_[_0x6802('0x36')](_0xe5e78c[_0x6802('0x32')],_0xe5e78c[_0x6802('0x33')]);_0xd8e32a[_0x6802('0x37')]=_[_0x6802('0x36')](_0xe5e78c[_0x6802('0x32')],qs[_0x6802('0x38')](_0x3942e1[_0x6802('0x33')][_0x6802('0x38')]));_0xd8e32a['attributes']=_0xd8e32a[_0x6802('0x37')][_0x6802('0x39')]?_0xd8e32a[_0x6802('0x37')]:_0xe5e78c[_0x6802('0x32')];if(_0x3942e1[_0x6802('0x33')][_0x6802('0x43')]){_0xd8e32a['include']=[{'all':!![]}];}_0xd8e32a=_[_0x6802('0x41')]({},_0xd8e32a,_0x3942e1[_0x6802('0x42')]);return db[_0x6802('0x30')][_0x6802('0x49')](_0xd8e32a)['then'](handleEntityNotFound(_0x4aaccd,null))[_0x6802('0x28')](respondWithResult(_0x4aaccd,null))[_0x6802('0x46')](handleError(_0x4aaccd,null));};exports[_0x6802('0x4a')]=function(_0x4670d2,_0x576441){return db[_0x6802('0x30')]['create'](_0x4670d2[_0x6802('0x4b')],{})[_0x6802('0x28')](function(_0x19b7de){var _0x5a31ad=_0x4670d2['user'][_0x6802('0x4c')]({'plain':!![]});if(!_0x5a31ad)throw new Error(_0x6802('0x4d'));if(_0x5a31ad['role']===_0x6802('0x4e')){var _0x5ae588=_0x19b7de[_0x6802('0x4c')]({'plain':!![]});var _0x5324ff='Teams';return db[_0x6802('0x4f')]['find']({'where':{'name':_0x5324ff,'userProfileId':_0x5a31ad['userProfileId']},'raw':!![]})[_0x6802('0x28')](function(_0x4974f4){if(_0x4974f4&&_0x4974f4['autoAssociation']===0x0){return db['UserProfileResource'][_0x6802('0x4a')]({'name':_0x5ae588['name'],'resourceId':_0x5ae588['id'],'type':_0x4974f4[_0x6802('0x2c')],'sectionId':_0x4974f4['id']},{})[_0x6802('0x28')](function(){return _0x19b7de;});}else{return _0x19b7de;}})[_0x6802('0x46')](function(_0x112187){logger[_0x6802('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x112187);throw _0x112187;});}return _0x19b7de;})[_0x6802('0x28')](respondWithResult(_0x576441,0xc9))[_0x6802('0x46')](handleError(_0x576441,null));};exports[_0x6802('0x27')]=function(_0x5a445a,_0x28ada3){if(_0x5a445a[_0x6802('0x4b')]['id']){delete _0x5a445a[_0x6802('0x4b')]['id'];}return db[_0x6802('0x30')][_0x6802('0x49')]({'where':{'id':_0x5a445a[_0x6802('0x50')]['id']}})['then'](handleEntityNotFound(_0x28ada3,null))[_0x6802('0x28')](saveUpdates(_0x5a445a['body'],null))[_0x6802('0x28')](respondWithResult(_0x28ada3,null))[_0x6802('0x46')](handleError(_0x28ada3,null));};exports[_0x6802('0x51')]=function(_0x343e94,_0x3313e4){var _0x54568a=_0x343e94[_0x6802('0x50')]['id'];var _0x3eb4ee=[];return db[_0x6802('0x52')][_0x6802('0x53')](function(_0x3cbb23){var _0x40d21a='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x54568a;return db[_0x6802('0x52')][_0x6802('0x33')](_0x40d21a,{'type':db[_0x6802('0x54')]['QueryTypes'][_0x6802('0x55')],'raw':!![],'transaction':_0x3cbb23})[_0x6802('0x28')](function(_0x4f1bc8){_0x3eb4ee=_['map'](_0x4f1bc8,function(_0x31e86c){return Number(_0x31e86c[_0x6802('0x56')]);});})[_0x6802('0x28')](function(){var _0x48cc87=_0x6802('0x57')+_0x54568a;return db[_0x6802('0x52')][_0x6802('0x33')](_0x48cc87,{'type':db[_0x6802('0x54')][_0x6802('0x58')][_0x6802('0x55')],'raw':!![],'transaction':_0x3cbb23});})[_0x6802('0x28')](function(_0x406c68){var _0x4edecd=_[_0x6802('0x2f')](_0x406c68,function(_0x27d42b){return Number(_0x27d42b[_0x6802('0x59')]);});return db[_0x6802('0x5a')][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'VoiceQueueId':{'$in':_0x4edecd}},'transaction':_0x3cbb23});})[_0x6802('0x28')](function(){var _0x1890b9=_0x6802('0x5b')+_0x54568a;return db[_0x6802('0x52')][_0x6802('0x33')](_0x1890b9,{'type':db[_0x6802('0x54')][_0x6802('0x58')][_0x6802('0x55')],'raw':!![],'transaction':_0x3cbb23});})[_0x6802('0x28')](function(_0x4b4d81){var _0x4315a6=_[_0x6802('0x2f')](_0x4b4d81,function(_0x48bfa5){return Number(_0x48bfa5[_0x6802('0x5c')]);});return db[_0x6802('0x5d')][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'MailQueueId':{'$in':_0x4315a6}},'transaction':_0x3cbb23});})[_0x6802('0x28')](function(){var _0x23abdd=_0x6802('0x5e')+_0x54568a;return db['sequelize'][_0x6802('0x33')](_0x23abdd,{'type':db[_0x6802('0x54')][_0x6802('0x58')][_0x6802('0x55')],'raw':!![],'transaction':_0x3cbb23});})[_0x6802('0x28')](function(_0x46afdc){var _0x5a6a36=_[_0x6802('0x2f')](_0x46afdc,function(_0x178c90){return Number(_0x178c90[_0x6802('0x5f')]);});return db[_0x6802('0x60')][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'SmsQueueId':{'$in':_0x5a6a36}},'transaction':_0x3cbb23});})[_0x6802('0x28')](function(){var _0x282fe9='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x54568a;return db[_0x6802('0x52')][_0x6802('0x33')](_0x282fe9,{'type':db[_0x6802('0x54')][_0x6802('0x58')][_0x6802('0x55')],'raw':!![],'transaction':_0x3cbb23});})[_0x6802('0x28')](function(_0x49f006){var _0x4f2ff8=_[_0x6802('0x2f')](_0x49f006,function(_0x19cb14){return Number(_0x19cb14['ChatQueueId']);});return db[_0x6802('0x61')][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'ChatQueueId':{'$in':_0x4f2ff8}},'transaction':_0x3cbb23});})[_0x6802('0x28')](function(){var _0x1f2769=_0x6802('0x62')+_0x54568a;return db[_0x6802('0x52')]['query'](_0x1f2769,{'type':db[_0x6802('0x54')][_0x6802('0x58')]['SELECT'],'raw':!![],'transaction':_0x3cbb23});})[_0x6802('0x28')](function(_0x5290ec){var _0x279e6f=_[_0x6802('0x2f')](_0x5290ec,function(_0x195f4a){return Number(_0x195f4a[_0x6802('0x63')]);});return db['UserFaxQueue'][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'FaxQueueId':{'$in':_0x279e6f}},'transaction':_0x3cbb23});})['then'](function(){var _0x1a1c7f=_0x6802('0x64')+_0x54568a;return db[_0x6802('0x52')]['query'](_0x1a1c7f,{'type':db[_0x6802('0x54')]['QueryTypes'][_0x6802('0x55')],'raw':!![],'transaction':_0x3cbb23});})['then'](function(_0x58be22){var _0x1332a2=_[_0x6802('0x2f')](_0x58be22,function(_0x56d755){return Number(_0x56d755[_0x6802('0x65')]);});return db[_0x6802('0x66')][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'OpenchannelQueueId':{'$in':_0x1332a2}},'transaction':_0x3cbb23});})[_0x6802('0x28')](function(){var _0x3fa2b7=_0x6802('0x67')+_0x54568a;return db[_0x6802('0x52')]['query'](_0x3fa2b7,{'type':db['Sequelize']['QueryTypes'][_0x6802('0x55')],'raw':!![],'transaction':_0x3cbb23});})[_0x6802('0x28')](function(_0x5d2d6f){var _0x27ad26=_[_0x6802('0x2f')](_0x5d2d6f,function(_0x44cddf){return Number(_0x44cddf['WhatsappQueueId']);});return db[_0x6802('0x68')][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'WhatsappQueueId':{'$in':_0x27ad26}},'transaction':_0x3cbb23});})['then'](function(){return db[_0x6802('0x69')][_0x6802('0x49')]({'where':{'TeamId':_0x54568a}});})['then'](function(_0x1bbab0){if(_0x1bbab0===null){return;}return db[_0x6802('0x6a')][_0x6802('0x51')]({'where':{'UserId':{'$in':_0x3eb4ee},'VoicePrefixId':_0x1bbab0['VoicePrefixId']},'transaction':_0x3cbb23});})[_0x6802('0x28')](function(){return db['Team'][_0x6802('0x51')]({'where':{'id':_0x54568a},'cascade':!![],'transaction':_0x3cbb23});})[_0x6802('0x28')](function(_0x353807){if(_0x353807===0x0){_0x3313e4[_0x6802('0x29')](0x194);}else{return db['UserProfileResource'][_0x6802('0x51')]({'where':{'type':_0x6802('0x6b'),'resourceId':_0x54568a},'cascade':!![],'transaction':_0x3cbb23})[_0x6802('0x28')](function(){_0x3313e4[_0x6802('0x1d')](0xcc)['end']();});}})['catch'](function(_0x543a80){_0x3313e4[_0x6802('0x1d')](0x1f4)['send'](_0x543a80);});});};exports[_0x6802('0x6c')]=function(_0x2a204a,_0x1bddd9,_0x1ca3bc){return db[_0x6802('0x30')]['findOne']({'where':{'id':_0x2a204a[_0x6802('0x50')]['id']}})[_0x6802('0x28')](handleEntityNotFound(_0x1bddd9,null))['then'](function(_0xe85788){if(!_0x2a204a[_0x6802('0x33')][_0x6802('0x6d')]||!utils[_0x6802('0x6e')](_0x2a204a[_0x6802('0x33')][_0x6802('0x6d')])){throw new db[(_0x6802('0x54'))]['ValidationError'](_0x6802('0x6f'));}var _0x531620={};var _0x43324e={};_0x43324e['model']=_[_0x6802('0x34')](db[_[_0x6802('0x70')](_0x2a204a[_0x6802('0x33')][_0x6802('0x6d')][_0x6802('0x71')]())+_0x6802('0x72')][_0x6802('0x48')]);_0x43324e[_0x6802('0x33')]=_['keys'](_0x2a204a[_0x6802('0x33')]);_0x43324e[_0x6802('0x35')]=_[_0x6802('0x36')](_0x43324e['model'],_0x43324e[_0x6802('0x33')]);_0x531620[_0x6802('0x37')]=_[_0x6802('0x36')](_0x43324e[_0x6802('0x32')],qs[_0x6802('0x38')](_0x2a204a[_0x6802('0x33')][_0x6802('0x38')]));_0x531620[_0x6802('0x37')]=_0x531620['attributes'][_0x6802('0x39')]?_0x531620['attributes']:_0x43324e['model'];_0x531620[_0x6802('0x23')]=qs[_0x6802('0x23')](_0x2a204a[_0x6802('0x33')][_0x6802('0x23')]);_0x531620[_0x6802('0x20')]=qs['offset'](_0x2a204a['query']['offset']);_0x531620[_0x6802('0x3c')]=qs[_0x6802('0x3d')](_0x2a204a['query']['sort']);_0x531620[_0x6802('0x3e')]=qs[_0x6802('0x35')](_[_0x6802('0x73')](_0x2a204a['query'],_0x43324e[_0x6802('0x35')]));_0x531620=_[_0x6802('0x41')]({},_0x531620,_0x2a204a[_0x6802('0x42')]);return _0xe85788[_0x6802('0x4c')+_['capitalize'](_0x2a204a[_0x6802('0x33')][_0x6802('0x6d')][_0x6802('0x71')]())+_0x6802('0x74')](_0x531620);})[_0x6802('0x28')](respondWithResult(_0x1bddd9,null))[_0x6802('0x46')](handleError(_0x1bddd9,null));};exports[_0x6802('0x75')]=function(_0x2cff02,_0x1ae234,_0x5bef1f){return db[_0x6802('0x30')][_0x6802('0x76')]({'where':{'id':_0x2cff02[_0x6802('0x50')]['id']}})[_0x6802('0x28')](function(_0x2b2605){if(_0x2b2605){if(!_0x2cff02[_0x6802('0x4b')][_0x6802('0x6d')]||!utils[_0x6802('0x6e')](_0x2cff02[_0x6802('0x4b')][_0x6802('0x6d')])){throw new db[(_0x6802('0x54'))][(_0x6802('0x77'))](_0x6802('0x6f'));}return _0x2b2605['add'+_[_0x6802('0x70')](_0x2cff02[_0x6802('0x4b')][_0x6802('0x6d')][_0x6802('0x71')]())+_0x6802('0x74')](_0x2cff02['body'][_0x6802('0x78')]);}return null;})['then'](handleEntityNotFound(_0x1ae234,null))[_0x6802('0x28')](respondWithStatusCode(_0x1ae234,null))[_0x6802('0x46')](handleError(_0x1ae234,null));};exports[_0x6802('0x79')]=function(_0xa54920,_0x34cafc,_0x86f383){return db['Team']['findOne']({'where':{'id':_0xa54920[_0x6802('0x50')]['id']}})[_0x6802('0x28')](function(_0x175b6f){if(_0x175b6f){if(!_0xa54920[_0x6802('0x33')][_0x6802('0x6d')]||!utils['isValidChannel'](_0xa54920[_0x6802('0x33')][_0x6802('0x6d')])){throw new db[(_0x6802('0x54'))][(_0x6802('0x77'))](_0x6802('0x6f'));}return _0x175b6f[_0x6802('0x7a')+_[_0x6802('0x70')](_0xa54920['query']['channel'][_0x6802('0x71')]())+_0x6802('0x74')](_0xa54920[_0x6802('0x33')][_0x6802('0x78')]);}return null;})[_0x6802('0x28')](handleEntityNotFound(_0x34cafc,null))[_0x6802('0x28')](respondWithStatusCode(_0x34cafc,null))[_0x6802('0x46')](handleError(_0x34cafc,null));};exports[_0x6802('0x7b')]=function(_0x3c6087,_0x23ed38){var _0x3a9d60=_[_0x6802('0x7c')](_0x3c6087[_0x6802('0x4b')][_0x6802('0x78')])?_0x3c6087[_0x6802('0x4b')][_0x6802('0x78')]:[_0x3c6087[_0x6802('0x4b')]['ids']];var _0x2b4299=_0x3c6087[_0x6802('0x50')]['id'];return db['Team'][_0x6802('0x49')]({'where':{'id':_0x2b4299}})['then'](handleEntityNotFound(_0x23ed38,null))[_0x6802('0x28')](function(_0x1947c0){if(_0x1947c0){var _0x891dd7=['Voice','Chat',_0x6802('0x7d'),_0x6802('0x7e'),_0x6802('0x7f'),'Openchannel','Whatsapp'];return db[_0x6802('0x52')][_0x6802('0x53')](function(_0x5089e6){var _0x933afe=_[_0x6802('0x2f')](_0x891dd7,function(_0x2892fe){var _0x414111={'attributes':['id',_0x6802('0x2c')]};if(_0x2892fe===_0x6802('0x80')){_0x414111[_0x6802('0x81')]={'attributes':[_0x6802('0x82')]};}return _0x1947c0[_0x6802('0x4c')+_0x2892fe+_0x6802('0x74')](_0x414111)[_0x6802('0x28')](function(_0x53faa3){var _0x540a77=_[_0x6802('0x2f')](_0x53faa3,function(_0x547103){var _0x199460=_['map'](_0x3a9d60,function(_0x24d93c){var _0x48bf3b={'where':{'UserId':_0x24d93c,[_0x2892fe+_0x6802('0x83')]:_0x547103['id']},'transaction':_0x5089e6};if(_0x2892fe===_0x6802('0x80')){_0x48bf3b[_0x6802('0x84')]={'penalty':_0x547103[_0x6802('0x85')][_0x6802('0x82')]};}return db[_0x6802('0x86')+_0x2892fe+_0x6802('0x72')][_0x6802('0x87')](_0x48bf3b)[_0x6802('0x28')](function(){socket[_0x6802('0x88')](_0x6802('0x4e')+_0x2892fe+_0x6802('0x89'),{'UserId':_0x24d93c,[_0x2892fe+_0x6802('0x83')]:_0x547103['id']});if(_0x2892fe!==_0x6802('0x80')){return;}return db['User'][_0x6802('0x44')]({'where':{'id':_0x3a9d60,'online':0x1},'attributes':['id','name',_0x6802('0x8a'),_0x6802('0x8b'),_0x6802('0x8c')],'raw':!![]})[_0x6802('0x28')](function(_0x4b6b48){var _0x358deb=_[_0x6802('0x2f')](_0x4b6b48,function(_0x15e823){return db[_0x6802('0x8d')][_0x6802('0x8e')]({'membername':_0x15e823[_0x6802('0x2c')],'UserId':_0x15e823['id'],'queue_name':_0x547103[_0x6802('0x2c')],'VoiceQueueId':_0x547103['id'],'interface':_[_0x6802('0x8f')](_0x15e823[_0x6802('0x8c')])?util[_0x6802('0x90')]('SIP/%s',_0x15e823[_0x6802('0x2c')]):_0x15e823['interface'],'paused':_0x15e823[_0x6802('0x8b')]||![],'penalty':_0x547103[_0x6802('0x85')][_0x6802('0x82')]},{'transaction':_0x5089e6});});return Promise[_0x6802('0x91')](_0x358deb);});});});return Promise[_0x6802('0x91')](_0x199460);});return Promise[_0x6802('0x91')](_0x540a77);})[_0x6802('0x28')](function(){return db[_0x6802('0x69')][_0x6802('0x76')]({'where':{'teamId':_0x2b4299}})[_0x6802('0x28')](function(_0x122545){if(_0x122545){var _0x48f77a=_[_0x6802('0x2f')](_0x3a9d60,function(_0x502876){db[_0x6802('0x6a')][_0x6802('0x8e')]({'UserId':_0x502876,'VoicePrefixId':_0x122545['VoicePrefixId']});});return Promise[_0x6802('0x91')](_0x48f77a);}});});});return Promise['all'](_0x933afe)[_0x6802('0x28')](function(){return _0x1947c0[_0x6802('0x7b')](_0x3a9d60,{'transaction':_0x5089e6})[_0x6802('0x92')](function(_0x1b0ce0){return _0x1b0ce0;});});});}})['then'](respondWithResult(_0x23ed38,null))[_0x6802('0x46')](handleError(_0x23ed38,null));};exports[_0x6802('0x93')]=function(_0x99f15e,_0x1983ea){var _0x1f6493=_[_0x6802('0x7c')](_0x99f15e['query'][_0x6802('0x78')])?_0x99f15e['query'][_0x6802('0x78')]:[_0x99f15e['query']['ids']];var _0x32c72d=_0x99f15e[_0x6802('0x50')]['id'];return db[_0x6802('0x30')][_0x6802('0x49')]({'where':{'id':_0x32c72d}})[_0x6802('0x28')](handleEntityNotFound(_0x1983ea,null))[_0x6802('0x28')](function(_0x1d2144){if(_0x1d2144){var _0x4f778d=[_0x6802('0x80'),_0x6802('0x94'),_0x6802('0x7d'),'Sms',_0x6802('0x7f'),_0x6802('0x95'),'Whatsapp'];return db[_0x6802('0x52')]['transaction'](function(_0xee01db){var _0x34ba81=_[_0x6802('0x2f')](_0x4f778d,function(_0x69d3b){var _0x36737d={'attributes':['id',_0x6802('0x2c')]};return _0x1d2144[_0x6802('0x4c')+_0x69d3b+'Queues'](_0x36737d)['then'](function(_0x49ffba){var _0x2c8d29=_[_0x6802('0x2f')](_0x49ffba,function(_0x346577){return _0x346577[_0x6802('0x93')](_0x1f6493,{'transaction':_0xee01db})[_0x6802('0x28')](function(){var _0x1a394d=_['map'](_0x1f6493,function(_0x199eba){socket[_0x6802('0x88')](_0x6802('0x4e')+_0x69d3b+_0x6802('0x96'),{'UserId':Number(_0x199eba),[_0x69d3b+_0x6802('0x83')]:_0x346577['id']});if(_0x69d3b!=='Voice'){return;}return db[_0x6802('0x8d')][_0x6802('0x51')]({'where':{'VoiceQueueId':_0x346577['id'],'UserId':_0x199eba},'transaction':_0xee01db});});return Promise[_0x6802('0x91')](_0x1a394d);});});return Promise['all'](_0x2c8d29);});});return Promise[_0x6802('0x91')](_0x34ba81)[_0x6802('0x28')](function(){return _0x1d2144[_0x6802('0x93')](_0x1f6493,{'transaction':_0xee01db});})[_0x6802('0x28')](function(){return db[_0x6802('0x69')][_0x6802('0x76')]({'where':{'teamId':_0x32c72d}})[_0x6802('0x28')](function(_0x56298f){if(_0x56298f){var _0x10ed61=_[_0x6802('0x2f')](_0x1f6493,function(_0x44be15){db[_0x6802('0x6a')]['destroy']({'where':{'UserId':_0x44be15,'VoicePrefixId':_0x56298f[_0x6802('0x97')]}});});return Promise['all'](_0x10ed61);}});});});}})[_0x6802('0x28')](respondWithStatusCode(_0x1983ea,null))[_0x6802('0x46')](handleError(_0x1983ea,null));};exports[_0x6802('0x98')]=function(_0x8589c7,_0x1ee0cf,_0x21749e){var _0x3d0162={};var _0xcd57e4={};var _0x21b78c;var _0x592f3c;return db[_0x6802('0x30')]['findOne']({'where':{'id':_0x8589c7[_0x6802('0x50')]['id']}})[_0x6802('0x28')](handleEntityNotFound(_0x1ee0cf,null))[_0x6802('0x28')](function(_0x43a604){if(_0x43a604){_0x21b78c=_0x43a604;_0xcd57e4[_0x6802('0x32')]=_['keys'](db[_0x6802('0x86')][_0x6802('0x48')]);_0xcd57e4[_0x6802('0x33')]=_[_0x6802('0x34')](_0x8589c7['query']);_0xcd57e4['filters']=_[_0x6802('0x36')](_0xcd57e4[_0x6802('0x32')],_0xcd57e4['query']);_0x3d0162[_0x6802('0x37')]=_[_0x6802('0x36')](_0xcd57e4[_0x6802('0x32')],qs[_0x6802('0x38')](_0x8589c7[_0x6802('0x33')][_0x6802('0x38')]));_0x3d0162['attributes']=_0x3d0162[_0x6802('0x37')]['length']?_0x3d0162[_0x6802('0x37')]:_0xcd57e4[_0x6802('0x32')];_0x3d0162[_0x6802('0x3c')]=qs['sort'](_0x8589c7[_0x6802('0x33')][_0x6802('0x3d')]);_0x3d0162[_0x6802('0x3e')]=qs['filters'](_[_0x6802('0x73')](_0x8589c7[_0x6802('0x33')],_0xcd57e4[_0x6802('0x35')]));if(_0x8589c7[_0x6802('0x33')][_0x6802('0x3f')]){_0x3d0162['where']=_[_0x6802('0x41')](_0x3d0162[_0x6802('0x3e')],{'$or':_[_0x6802('0x2f')](_0x3d0162[_0x6802('0x37')],function(_0x2e412e){var _0x49c891={};_0x49c891[_0x2e412e]={'$like':'%'+_0x8589c7[_0x6802('0x33')]['filter']+'%'};return _0x49c891;})});}_0x3d0162=_[_0x6802('0x41')]({},_0x3d0162,_0x8589c7[_0x6802('0x42')]);return _0x21b78c[_0x6802('0x98')](_0x3d0162);}})['then'](function(_0xe1a30d){if(_0xe1a30d){_0x592f3c=_0xe1a30d[_0x6802('0x39')];if(!_0x8589c7['query'][_0x6802('0x3a')](_0x6802('0x3b'))){_0x3d0162['limit']=qs['limit'](_0x8589c7[_0x6802('0x33')][_0x6802('0x23')]);_0x3d0162['offset']=qs[_0x6802('0x20')](_0x8589c7['query'][_0x6802('0x20')]);}return _0x21b78c[_0x6802('0x98')](_0x3d0162);}})[_0x6802('0x28')](function(_0x3c31db){if(_0x3c31db){return _0x3c31db?{'count':_0x592f3c,'rows':_0x3c31db}:null;}})['then'](respondWithResult(_0x1ee0cf,null))[_0x6802('0x46')](handleError(_0x1ee0cf,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1014b04..af8fb36 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 _0x353e=['emit','hasOwnProperty','hook','events','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0x353e,0x125));var _0xe353=function(_0x4bcea6,_0x12c81f){_0x4bcea6=_0x4bcea6-0x0;var _0x107a8c=_0x353e[_0x4bcea6];return _0x107a8c;};'use strict';var EventEmitter=require(_0xe353('0x0'));var Team=require(_0xe353('0x1'))['db'][_0xe353('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe353('0x3')](0x0);var events={'afterCreate':_0xe353('0x4'),'afterUpdate':_0xe353('0x5'),'afterDestroy':_0xe353('0x6')};function emitEvent(_0x30f405){return function(_0x5b61e1,_0x130a6a,_0x2c7c36){TeamEvents[_0xe353('0x7')](_0x30f405+':'+_0x5b61e1['id'],_0x5b61e1);TeamEvents['emit'](_0x30f405,_0x5b61e1);_0x2c7c36(null);};}for(var e in events){if(events[_0xe353('0x8')](e)){var event=events[e];Team[_0xe353('0x9')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x71f9=['update','remove','emit','hook','exports','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x1787a5,_0x30149b){var _0x3c6ba9=function(_0x3a65ac){while(--_0x3a65ac){_0x1787a5['push'](_0x1787a5['shift']());}};_0x3c6ba9(++_0x30149b);}(_0x71f9,0x145));var _0x971f=function(_0x299fa6,_0x341e97){_0x299fa6=_0x299fa6-0x0;var _0x5d8fdf=_0x71f9[_0x299fa6];return _0x5d8fdf;};'use strict';var EventEmitter=require(_0x971f('0x0'));var Team=require(_0x971f('0x1'))['db'][_0x971f('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x971f('0x3')](0x0);var events={'afterCreate':_0x971f('0x4'),'afterUpdate':_0x971f('0x5'),'afterDestroy':_0x971f('0x6')};function emitEvent(_0x13fc9a){return function(_0x5ed541,_0x209629,_0x54e0cf){TeamEvents['emit'](_0x13fc9a+':'+_0x5ed541['id'],_0x5ed541);TeamEvents[_0x971f('0x7')](_0x13fc9a,_0x5ed541);_0x54e0cf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x971f('0x8')](e,emitEvent(event));}}module[_0x971f('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index d8b320b..1f47109 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 _0xd808=['all','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define','Team','Fax','Sms','Whatsapp'];(function(_0x2251c9,_0x2a2091){var _0x56d17b=function(_0x3fd083){while(--_0x3fd083){_0x2251c9['push'](_0x2251c9['shift']());}};_0x56d17b(++_0x2a2091);}(_0xd808,0xc1));var _0x8d80=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0xd808[_0x39cd3c];return _0x47a0ae;};'use strict';var _=require(_0x8d80('0x0'));var attributes=require(_0x8d80('0x1'));function getQueuesByChannel(_0xc256bb,_0x26fcb2){var _0x4eb875=_0x8d80('0x2')+_0x26fcb2+_0x8d80('0x3');return _0xc256bb[_0x4eb875]()[_0x8d80('0x4')](function(_0x11b96b){return _[_0x8d80('0x5')](_0x11b96b,function(_0x50672e){_0x50672e[_0x8d80('0x6')](_0x8d80('0x7'),_0x26fcb2);return _0x50672e;});})[_0x8d80('0x8')](function(_0xd53c7){throw _0xd53c7;});}module[_0x8d80('0x9')]=function(_0xdcbbc0){return _0xdcbbc0[_0x8d80('0xa')](_0x8d80('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2ea36c=this;var _0x1870f2=['Chat',_0x8d80('0xc'),'Mail','Openchannel',_0x8d80('0xd'),'Voice',_0x8d80('0xe')];return Promise['resolve']()[_0x8d80('0x4')](function(){var _0x9e1ce9=_['map'](_0x1870f2,function(_0x7bf3ef){return getQueuesByChannel(_0x2ea36c,_0x7bf3ef);});return Promise[_0x8d80('0xf')](_0x9e1ce9);})[_0x8d80('0x8')](function(_0xabbe5c){throw _0xabbe5c;});}}});}; \ No newline at end of file +var _0xaca4=['Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','catch','lodash','./team.attributes','get','Queues','then','channel','exports','define','Chat'];(function(_0x1213ff,_0x1e60fa){var _0x5b1850=function(_0x512509){while(--_0x512509){_0x1213ff['push'](_0x1213ff['shift']());}};_0x5b1850(++_0x1e60fa);}(_0xaca4,0xcf));var _0x4aca=function(_0xf6ac4d,_0x18979a){_0xf6ac4d=_0xf6ac4d-0x0;var _0x3cfeb3=_0xaca4[_0xf6ac4d];return _0x3cfeb3;};'use strict';var _=require(_0x4aca('0x0'));var attributes=require(_0x4aca('0x1'));function getQueuesByChannel(_0x45a7da,_0x1fcee5){var _0xf8ebcd=_0x4aca('0x2')+_0x1fcee5+_0x4aca('0x3');return _0x45a7da[_0xf8ebcd]()[_0x4aca('0x4')](function(_0x460958){return _['map'](_0x460958,function(_0x6addda){_0x6addda['setDataValue'](_0x4aca('0x5'),_0x1fcee5);return _0x6addda;});})['catch'](function(_0x1a49d6){throw _0x1a49d6;});}module[_0x4aca('0x6')]=function(_0xdba9a4){return _0xdba9a4[_0x4aca('0x7')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x7a00bc=this;var _0x154e3f=[_0x4aca('0x8'),_0x4aca('0x9'),_0x4aca('0xa'),_0x4aca('0xb'),_0x4aca('0xc'),_0x4aca('0xd'),_0x4aca('0xe')];return Promise[_0x4aca('0xf')]()[_0x4aca('0x4')](function(){var _0xe088c4=_['map'](_0x154e3f,function(_0x535218){return getQueuesByChannel(_0x7a00bc,_0x535218);});return Promise[_0x4aca('0x10')](_0xe088c4);})[_0x4aca('0x11')](function(_0x1c9e8e){throw _0x1c9e8e;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 2c55410..81a6f24 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 _0xee29=['defaults','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee29,0x196));var _0x9ee2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee29[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9ee2('0x0'));var moment=require(_0x9ee2('0x1'));var BPromise=require(_0x9ee2('0x2'));var rs=require(_0x9ee2('0x3'));var fs=require('fs');var Redis=require(_0x9ee2('0x4'));var db=require(_0x9ee2('0x5'))['db'];var utils=require(_0x9ee2('0x6'));var logger=require(_0x9ee2('0x7'))(_0x9ee2('0x8'));var config=require(_0x9ee2('0x9'));var jayson=require(_0x9ee2('0xa'));var client=jayson[_0x9ee2('0xb')][_0x9ee2('0xc')]({'port':0x232a});config[_0x9ee2('0xd')]=_[_0x9ee2('0xe')](config[_0x9ee2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ee2('0xf'))(new Redis(config[_0x9ee2('0xd')]));require(_0x9ee2('0x10'))[_0x9ee2('0x11')](socket);function respondWithRpcPromise(_0x3cfb4c,_0x2b16a6,_0x5036e8){return new BPromise(function(_0x117c46,_0x56a48e){return client[_0x9ee2('0x12')](_0x3cfb4c,_0x5036e8)[_0x9ee2('0x13')](function(_0x1e0ed6){logger[_0x9ee2('0x14')](_0x9ee2('0x15'),_0x2b16a6,_0x9ee2('0x16'));logger[_0x9ee2('0x17')](_0x9ee2('0x18'),_0x2b16a6,_0x9ee2('0x16'),JSON['stringify'](_0x1e0ed6));if(_0x1e0ed6[_0x9ee2('0x19')]){if(_0x1e0ed6[_0x9ee2('0x19')][_0x9ee2('0x1a')]===0x1f4){logger['error'](_0x9ee2('0x15'),_0x2b16a6,_0x1e0ed6[_0x9ee2('0x19')]['message']);return _0x56a48e(_0x1e0ed6[_0x9ee2('0x19')][_0x9ee2('0x1b')]);}logger[_0x9ee2('0x19')](_0x9ee2('0x15'),_0x2b16a6,_0x1e0ed6[_0x9ee2('0x19')][_0x9ee2('0x1b')]);return _0x117c46(_0x1e0ed6[_0x9ee2('0x19')][_0x9ee2('0x1b')]);}else{logger['info'](_0x9ee2('0x15'),_0x2b16a6,_0x9ee2('0x16'));_0x117c46(_0x1e0ed6[_0x9ee2('0x1c')]['message']);}})[_0x9ee2('0x1d')](function(_0x3383e9){logger[_0x9ee2('0x19')]('Team,\x20%s,\x20%s',_0x2b16a6,_0x3383e9);_0x56a48e(_0x3383e9);});});} \ No newline at end of file +var _0xec60=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','request\x20sent','debug','stringify','error','Team,\x20%s,\x20%s','message','info','result','catch','moment','ioredis'];(function(_0x500c0d,_0x22a500){var _0x38a9b8=function(_0x114e28){while(--_0x114e28){_0x500c0d['push'](_0x500c0d['shift']());}};_0x38a9b8(++_0x22a500);}(_0xec60,0x8e));var _0x0ec6=function(_0x44f076,_0x354ff5){_0x44f076=_0x44f076-0x0;var _0x5d01d7=_0xec60[_0x44f076];return _0x5d01d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ec6('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ec6('0x1'));var db=require(_0x0ec6('0x2'))['db'];var utils=require(_0x0ec6('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x0ec6('0x4'));var jayson=require(_0x0ec6('0x5'));var client=jayson[_0x0ec6('0x6')][_0x0ec6('0x7')]({'port':0x232a});config[_0x0ec6('0x8')]=_[_0x0ec6('0x9')](config[_0x0ec6('0x8')],{'host':_0x0ec6('0xa'),'port':0x18eb});var socket=require(_0x0ec6('0xb'))(new Redis(config[_0x0ec6('0x8')]));require(_0x0ec6('0xc'))[_0x0ec6('0xd')](socket);function respondWithRpcPromise(_0x24d8bd,_0x453618,_0x1f604c){return new BPromise(function(_0x3ef7e3,_0x14f951){return client['request'](_0x24d8bd,_0x1f604c)[_0x0ec6('0xe')](function(_0x389b12){logger['info']('Team,\x20%s,\x20%s',_0x453618,_0x0ec6('0xf'));logger[_0x0ec6('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x453618,_0x0ec6('0xf'),JSON[_0x0ec6('0x11')](_0x389b12));if(_0x389b12[_0x0ec6('0x12')]){if(_0x389b12[_0x0ec6('0x12')]['code']===0x1f4){logger[_0x0ec6('0x12')](_0x0ec6('0x13'),_0x453618,_0x389b12[_0x0ec6('0x12')][_0x0ec6('0x14')]);return _0x14f951(_0x389b12[_0x0ec6('0x12')][_0x0ec6('0x14')]);}logger[_0x0ec6('0x12')](_0x0ec6('0x13'),_0x453618,_0x389b12[_0x0ec6('0x12')][_0x0ec6('0x14')]);return _0x3ef7e3(_0x389b12[_0x0ec6('0x12')][_0x0ec6('0x14')]);}else{logger[_0x0ec6('0x15')]('Team,\x20%s,\x20%s',_0x453618,_0x0ec6('0xf'));_0x3ef7e3(_0x389b12[_0x0ec6('0x16')][_0x0ec6('0x14')]);}})[_0x0ec6('0x17')](function(_0x55f47b){logger[_0x0ec6('0x12')](_0x0ec6('0x13'),_0x453618,_0x55f47b);_0x14f951(_0x55f47b);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bebfd6d..2ef1c4f 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 _0xb5f8=['register','length','team:','remove','emit','removeListener'];(function(_0x3984e4,_0x412653){var _0x2eede7=function(_0x2f901c){while(--_0x2f901c){_0x3984e4['push'](_0x3984e4['shift']());}};_0x2eede7(++_0x412653);}(_0xb5f8,0xa5));var _0x8b5f=function(_0x2b4347,_0x13cefd){_0x2b4347=_0x2b4347-0x0;var _0xd30990=_0xb5f8[_0x2b4347];return _0xd30990;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x8b5f('0x0'),'update'];function createListener(_0x871a8b,_0x4d34e0){return function(_0x434180){_0x4d34e0[_0x8b5f('0x1')](_0x871a8b,_0x434180);};}function removeListener(_0x1c6d8b,_0x2ab990){return function(){TeamEvents[_0x8b5f('0x2')](_0x1c6d8b,_0x2ab990);};}exports[_0x8b5f('0x3')]=function(_0x5dbecd){for(var _0x95cb32=0x0,_0x1329aa=events[_0x8b5f('0x4')];_0x95cb32<_0x1329aa;_0x95cb32++){var _0x307073=events[_0x95cb32];var _0x1606df=createListener(_0x8b5f('0x5')+_0x307073,_0x5dbecd);TeamEvents['on'](_0x307073,_0x1606df);}}; \ No newline at end of file +var _0xe2c5=['team:','save','remove','emit','removeListener','register','length'];(function(_0x4212ec,_0x7a8b44){var _0x4a685b=function(_0x5f4693){while(--_0x5f4693){_0x4212ec['push'](_0x4212ec['shift']());}};_0x4a685b(++_0x7a8b44);}(_0xe2c5,0xd3));var _0x5e2c=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0xe2c5[_0x566168];return _0x4e1f7a;};'use strict';var TeamEvents=require('./team.events');var events=[_0x5e2c('0x0'),_0x5e2c('0x1'),'update'];function createListener(_0x4aeaa8,_0x5c26df){return function(_0x195c92){_0x5c26df[_0x5e2c('0x2')](_0x4aeaa8,_0x195c92);};}function removeListener(_0x68b424,_0xb1958e){return function(){TeamEvents[_0x5e2c('0x3')](_0x68b424,_0xb1958e);};}exports[_0x5e2c('0x4')]=function(_0x36eb1f){for(var _0x2ab378=0x0,_0xa49ccf=events[_0x5e2c('0x5')];_0x2ab378<_0xa49ccf;_0x2ab378++){var _0x35386e=events[_0x2ab378];var _0x55f66d=createListener(_0x5e2c('0x6')+_0x35386e,_0x36eb1f);TeamEvents['on'](_0x35386e,_0x55f66d);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 17aede5..83b6a0e 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 _0x16a3=['INTEGER'];(function(_0x4d751a,_0x2af3b1){var _0x58dacd=function(_0x36ac38){while(--_0x36ac38){_0x4d751a['push'](_0x4d751a['shift']());}};_0x58dacd(++_0x2af3b1);}(_0x16a3,0x1e0));var _0x316a=function(_0x679fc1,_0x56e40b){_0x679fc1=_0x679fc1-0x0;var _0x38e255=_0x16a3[_0x679fc1];return _0x38e255;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0x316a('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x316a('0x0')]}}; \ No newline at end of file +var _0xf972=['INTEGER','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf972,0x171));var _0x2f97=function(_0x4b8709,_0x9648bc){_0x4b8709=_0x4b8709-0x0;var _0x16a67d=_0xf972[_0x4b8709];return _0x16a67d;};'use strict';var Sequelize=require(_0x2f97('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x2f97('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2f97('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 99f1d71..de54c21 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 _0xb574=['./teamVoicePrefix.attributes','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4a2924,_0x373b4c){var _0x5a770d=function(_0x41b736){while(--_0x41b736){_0x4a2924['push'](_0x4a2924['shift']());}};_0x5a770d(++_0x373b4c);}(_0xb574,0x106));var _0x4b57=function(_0x1f371d,_0x33b0c6){_0x1f371d=_0x1f371d-0x0;var _0x38faef=_0xb574[_0x1f371d];return _0x38faef;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var logger=require('../../config/logger')(_0x4b57('0x2'));var moment=require(_0x4b57('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b57('0x4'));var fs=require('fs');var path=require(_0x4b57('0x5'));var rimraf=require(_0x4b57('0x6'));var config=require(_0x4b57('0x7'));var attributes=require(_0x4b57('0x8'));module['exports']=function(_0x4eb019,_0x1c97e5){return _0x4eb019['define']('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','../../config/logger','api'];(function(_0x170b82,_0x2fff28){var _0x40dbf7=function(_0x300fbe){while(--_0x300fbe){_0x170b82['push'](_0x170b82['shift']());}};_0x40dbf7(++_0x2fff28);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5c55f25..593a107 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xc8e050,_0x1e9bfc){var _0x226116=function(_0x4fa215){while(--_0x4fa215){_0xc8e050['push'](_0xc8e050['shift']());}};_0x226116(++_0x1e9bfc);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5e761b,_0x355e38){var _0x98502c=function(_0x4e52d5){while(--_0x4e52d5){_0x5e761b['push'](_0x5e761b['shift']());}};_0x98502c(++_0x355e38);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 9006021..dbebaa1 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 _0x99fc=['INTEGER','sequelize'];(function(_0x55d98b,_0x1ac5b4){var _0x104773=function(_0x2857e7){while(--_0x2857e7){_0x55d98b['push'](_0x55d98b['shift']());}};_0x104773(++_0x1ac5b4);}(_0x99fc,0x1df));var _0xc99f=function(_0x5a7541,_0xa781f9){_0x5a7541=_0x5a7541-0x0;var _0x1d081d=_0x99fc[_0x5a7541];return _0x1d081d;};'use strict';var Sequelize=require(_0xc99f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc99f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x07b5=['INTEGER','sequelize','exports'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x07b5,0x10f));var _0x507b=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x07b5[_0x528575];return _0x3063b7;};'use strict';var Sequelize=require(_0x507b('0x0'));module[_0x507b('0x1')]={'penalty':{'type':Sequelize[_0x507b('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 586fd1e..0f86555 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 _0x1ae3=['team_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0x1ae3,0x139));var _0x31ae=function(_0x3c3888,_0x14946e){_0x3c3888=_0x3c3888-0x0;var _0x549ca3=_0x1ae3[_0x3c3888];return _0x549ca3;};'use strict';var _=require(_0x31ae('0x0'));var util=require(_0x31ae('0x1'));var logger=require('../../config/logger')(_0x31ae('0x2'));var moment=require(_0x31ae('0x3'));var BPromise=require(_0x31ae('0x4'));var rp=require(_0x31ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31ae('0x6'));var config=require(_0x31ae('0x7'));var attributes=require(_0x31ae('0x8'));module[_0x31ae('0x9')]=function(_0xe1202b,_0x3f2e91){return _0xe1202b[_0x31ae('0xa')](_0x31ae('0xb'),attributes,{'tableName':_0x31ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89f7=['moment','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger'];(function(_0x25a6a7,_0x3337b9){var _0x4fff03=function(_0x35e13d){while(--_0x35e13d){_0x25a6a7['push'](_0x25a6a7['shift']());}};_0x4fff03(++_0x3337b9);}(_0x89f7,0x105));var _0x789f=function(_0x7e3bb8,_0x27c048){_0x7e3bb8=_0x7e3bb8-0x0;var _0x44c887=_0x89f7[_0x7e3bb8];return _0x44c887;};'use strict';var _=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var logger=require(_0x789f('0x2'))('api');var moment=require(_0x789f('0x3'));var BPromise=require('bluebird');var rp=require(_0x789f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x789f('0x5'));var config=require(_0x789f('0x6'));var attributes=require(_0x789f('0x7'));module[_0x789f('0x8')]=function(_0x5d7abe,_0x273a16){return _0x5d7abe[_0x789f('0x9')](_0x789f('0xa'),attributes,{'tableName':_0x789f('0xb'),'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 6b87d22..ffed5ab 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 _0x40b5=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x40b5,0x12b));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x540b('0x0'));var util=require('util');var moment=require(_0x540b('0x1'));var BPromise=require(_0x540b('0x2'));var rs=require(_0x540b('0x3'));var fs=require('fs');var Redis=require(_0x540b('0x4'));var db=require(_0x540b('0x5'))['db'];var utils=require(_0x540b('0x6'));var logger=require(_0x540b('0x7'))(_0x540b('0x8'));var config=require(_0x540b('0x9'));var jayson=require(_0x540b('0xa'));var client=jayson['client'][_0x540b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c235b,_0x466caa,_0x5da84b){return new BPromise(function(_0x3fa980,_0x58e2aa){return client[_0x540b('0xc')](_0x3c235b,_0x5da84b)['then'](function(_0x5b9d9a){logger[_0x540b('0xd')](_0x540b('0xe'),_0x466caa,'request\x20sent');logger[_0x540b('0xf')](_0x540b('0x10'),_0x466caa,_0x540b('0x11'),JSON['stringify'](_0x5b9d9a));if(_0x5b9d9a[_0x540b('0x12')]){if(_0x5b9d9a[_0x540b('0x12')][_0x540b('0x13')]===0x1f4){logger[_0x540b('0x12')](_0x540b('0xe'),_0x466caa,_0x5b9d9a[_0x540b('0x12')][_0x540b('0x14')]);return _0x58e2aa(_0x5b9d9a['error'][_0x540b('0x14')]);}logger[_0x540b('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x466caa,_0x5b9d9a[_0x540b('0x12')]['message']);return _0x3fa980(_0x5b9d9a[_0x540b('0x12')]['message']);}else{logger[_0x540b('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x466caa,'request\x20sent');_0x3fa980(_0x5b9d9a[_0x540b('0x15')][_0x540b('0x14')]);}})[_0x540b('0x16')](function(_0xa9fd14){logger[_0x540b('0x12')](_0x540b('0xe'),_0x466caa,_0xa9fd14);_0x58e2aa(_0xa9fd14);});});} \ No newline at end of file +var _0x6ec9=['http','then','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x38881b,_0x137d6c){var _0x31164e=function(_0x1c3fde){while(--_0x1c3fde){_0x38881b['push'](_0x38881b['shift']());}};_0x31164e(++_0x137d6c);}(_0x6ec9,0x174));var _0x96ec=function(_0x3cc519,_0x5d0427){_0x3cc519=_0x3cc519-0x0;var _0x5774f7=_0x6ec9[_0x3cc519];return _0x5774f7;};'use strict';var _=require(_0x96ec('0x0'));var util=require('util');var moment=require(_0x96ec('0x1'));var BPromise=require('bluebird');var rs=require(_0x96ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96ec('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x96ec('0x4'))(_0x96ec('0x5'));var config=require('../../config/environment');var jayson=require(_0x96ec('0x6'));var client=jayson[_0x96ec('0x7')][_0x96ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bc079,_0x5870ab,_0x5ee7a3){return new BPromise(function(_0x8214b2,_0x195366){return client['request'](_0x5bc079,_0x5ee7a3)[_0x96ec('0x9')](function(_0x95ef8){logger[_0x96ec('0xa')](_0x96ec('0xb'),_0x5870ab,'request\x20sent');logger['debug'](_0x96ec('0xc'),_0x5870ab,_0x96ec('0xd'),JSON[_0x96ec('0xe')](_0x95ef8));if(_0x95ef8[_0x96ec('0xf')]){if(_0x95ef8[_0x96ec('0xf')][_0x96ec('0x10')]===0x1f4){logger[_0x96ec('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5870ab,_0x95ef8[_0x96ec('0xf')][_0x96ec('0x11')]);return _0x195366(_0x95ef8[_0x96ec('0xf')][_0x96ec('0x11')]);}logger[_0x96ec('0xf')](_0x96ec('0xb'),_0x5870ab,_0x95ef8[_0x96ec('0xf')][_0x96ec('0x11')]);return _0x8214b2(_0x95ef8['error']['message']);}else{logger[_0x96ec('0xa')](_0x96ec('0xb'),_0x5870ab,_0x96ec('0xd'));_0x8214b2(_0x95ef8[_0x96ec('0x12')][_0x96ec('0x11')]);}})[_0x96ec('0x13')](function(_0x5e9f05){logger[_0x96ec('0xf')](_0x96ec('0xb'),_0x5870ab,_0x5e9f05);_0x195366(_0x5e9f05);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 87b8499..00806ac 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 _0x5f2f=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./template.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32006b,_0x296ea4){_0x32006b=_0x32006b-0x0;var _0x1ccf5a=_0x5f2f[_0x32006b];return _0x1ccf5a;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0xe')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller['update']);router[_0xf5f2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0xdfdd=['show','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0xa05271,_0x52e263){var _0x3f1a0c=function(_0x420cfc){while(--_0x420cfc){_0xa05271['push'](_0xa05271['shift']());}};_0x3f1a0c(++_0x52e263);}(_0xdfdd,0x104));var _0xddfd=function(_0x415e6b,_0x3868ce){_0x415e6b=_0x415e6b-0x0;var _0x44ba29=_0xdfdd[_0x415e6b];return _0x44ba29;};'use strict';var multer=require(_0xddfd('0x0'));var util=require(_0xddfd('0x1'));var path=require(_0xddfd('0x2'));var timeout=require(_0xddfd('0x3'));var express=require('express');var router=express[_0xddfd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xddfd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xddfd('0x6'));var controller=require(_0xddfd('0x7'));router[_0xddfd('0x8')]('/',auth[_0xddfd('0x9')](),controller['index']);router[_0xddfd('0x8')]('/:id',auth[_0xddfd('0x9')](),controller[_0xddfd('0xa')]);router[_0xddfd('0xb')]('/',auth[_0xddfd('0x9')](),controller[_0xddfd('0xc')]);router[_0xddfd('0xd')]('/:id',auth[_0xddfd('0x9')](),controller[_0xddfd('0xe')]);router['delete'](_0xddfd('0xf'),auth[_0xddfd('0x9')](),controller[_0xddfd('0x10')]);module[_0xddfd('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 35e92e5..0bbf248 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 _0x85c2=['exports','STRING','TEXT'];(function(_0x5bcc1b,_0xbaa03b){var _0x5e5025=function(_0x15c285){while(--_0x15c285){_0x5bcc1b['push'](_0x5bcc1b['shift']());}};_0x5e5025(++_0xbaa03b);}(_0x85c2,0x186));var _0x285c=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x85c2[_0xa8883];return _0x479426;};'use strict';var Sequelize=require('sequelize');module[_0x285c('0x0')]={'name':{'type':Sequelize[_0x285c('0x1')]},'description':{'type':Sequelize[_0x285c('0x1')]},'html':{'type':Sequelize[_0x285c('0x2')]}}; \ No newline at end of file +var _0x2910=['exports','STRING','TEXT','sequelize'];(function(_0x36e114,_0x3ff0e3){var _0x4e5ac3=function(_0x14cf07){while(--_0x14cf07){_0x36e114['push'](_0x36e114['shift']());}};_0x4e5ac3(++_0x3ff0e3);}(_0x2910,0xf7));var _0x0291=function(_0x19e1f6,_0x52d013){_0x19e1f6=_0x19e1f6-0x0;var _0x4b9242=_0x2910[_0x19e1f6];return _0x4b9242;};'use strict';var Sequelize=require(_0x0291('0x0'));module[_0x0291('0x1')]={'name':{'type':Sequelize[_0x0291('0x2')]},'description':{'type':Sequelize[_0x0291('0x2')]},'html':{'type':Sequelize[_0x0291('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 4bd3e17..5e8e937 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 _0x11fb=['offset','undefined','limit','count','json','apply','reject','then','destroy','Templates','UserProfileResource','error','send','index','Template','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x44f6e1,_0x140736){var _0x3033a3=function(_0x55b46c){while(--_0x55b46c){_0x44f6e1['push'](_0x44f6e1['shift']());}};_0x3033a3(++_0x140736);}(_0x11fb,0x1ea));var _0xb11f=function(_0x78a46a,_0x55f039){_0x78a46a=_0x78a46a-0x0;var _0x218cee=_0x11fb[_0x78a46a];return _0x218cee;};'use strict';var emlformat=require(_0xb11f('0x0'));var rimraf=require(_0xb11f('0x1'));var zipdir=require(_0xb11f('0x2'));var jsonpatch=require(_0xb11f('0x3'));var rp=require(_0xb11f('0x4'));var moment=require(_0xb11f('0x5'));var BPromise=require(_0xb11f('0x6'));var Mustache=require(_0xb11f('0x7'));var util=require(_0xb11f('0x8'));var path=require(_0xb11f('0x9'));var sox=require(_0xb11f('0xa'));var csv=require(_0xb11f('0xb'));var ejs=require(_0xb11f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb11f('0xd'));var squel=require(_0xb11f('0xe'));var crypto=require(_0xb11f('0xf'));var jsforce=require(_0xb11f('0x10'));var deskjs=require(_0xb11f('0x11'));var toCsv=require(_0xb11f('0xb'));var querystring=require(_0xb11f('0x12'));var Papa=require(_0xb11f('0x13'));var Redis=require(_0xb11f('0x14'));var authService=require(_0xb11f('0x15'));var qs=require(_0xb11f('0x16'));var as=require(_0xb11f('0x17'));var hardwareService=require(_0xb11f('0x18'));var logger=require(_0xb11f('0x19'))('api');var utils=require(_0xb11f('0x1a'));var config=require(_0xb11f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xb11f('0x1c'))['db'];function respondWithStatusCode(_0x2a30be,_0x4abc47){_0x4abc47=_0x4abc47||0xcc;return function(_0x2be53e){if(_0x2be53e){return _0x2a30be[_0xb11f('0x1d')](_0x4abc47);}return _0x2a30be[_0xb11f('0x1e')](_0x4abc47)[_0xb11f('0x1f')]();};}function respondWithResult(_0x2aeaae,_0x4a5efc){_0x4a5efc=_0x4a5efc||0xc8;return function(_0x2f3926){if(_0x2f3926){return _0x2aeaae[_0xb11f('0x1e')](_0x4a5efc)['json'](_0x2f3926);}};}function respondWithFilteredResult(_0x20bf54,_0x3d2ad4){return function(_0x598441){if(_0x598441){var _0x250265=typeof _0x3d2ad4[_0xb11f('0x20')]===_0xb11f('0x21')&&typeof _0x3d2ad4[_0xb11f('0x22')]==='undefined';var _0x2bfe78=_0x598441[_0xb11f('0x23')];var _0x53b640=_0x250265?0x0:_0x3d2ad4['offset'];var _0x128d40=_0x250265?_0x598441['count']:_0x3d2ad4[_0xb11f('0x20')]+_0x3d2ad4[_0xb11f('0x22')];var _0x2871e0;if(_0x128d40>=_0x2bfe78){_0x128d40=_0x2bfe78;_0x2871e0=0xc8;}else{_0x2871e0=0xce;}_0x20bf54[_0xb11f('0x1e')](_0x2871e0);return _0x20bf54['set']('Content-Range',_0x53b640+'-'+_0x128d40+'/'+_0x2bfe78)[_0xb11f('0x24')](_0x598441);}return null;};}function patchUpdates(_0x5b29e7){return function(_0x140e76){try{jsonpatch[_0xb11f('0x25')](_0x140e76,_0x5b29e7,!![]);}catch(_0x54d6bc){return BPromise[_0xb11f('0x26')](_0x54d6bc);}return _0x140e76['save']();};}function saveUpdates(_0x1c7059,_0x3edceb){return function(_0x417899){if(_0x417899){return _0x417899['update'](_0x1c7059)[_0xb11f('0x27')](function(_0x345646){return _0x345646;});}return null;};}function removeEntity(_0x35e2e4,_0x12e4ff){return function(_0x483d7e){if(_0x483d7e){return _0x483d7e[_0xb11f('0x28')]()[_0xb11f('0x27')](function(){var _0x299081=_0x483d7e['get']({'plain':!![]});var _0x40a0ef=_0xb11f('0x29');return db[_0xb11f('0x2a')][_0xb11f('0x28')]({'where':{'type':_0x40a0ef,'resourceId':_0x299081['id']}})[_0xb11f('0x27')](function(){return _0x483d7e;});})[_0xb11f('0x27')](function(){_0x35e2e4['status'](0xcc)[_0xb11f('0x1f')]();});}};}function handleEntityNotFound(_0x2038be,_0x3185bc){return function(_0x55ee30){if(!_0x55ee30){_0x2038be['sendStatus'](0x194);}return _0x55ee30;};}function handleError(_0x33c71c,_0x1b20c0){_0x1b20c0=_0x1b20c0||0x1f4;return function(_0x5c4063){logger[_0xb11f('0x2b')](_0x5c4063['stack']);if(_0x5c4063['name']){delete _0x5c4063['name'];}_0x33c71c[_0xb11f('0x1e')](_0x1b20c0)[_0xb11f('0x2c')](_0x5c4063);};}exports[_0xb11f('0x2d')]=function(_0x4c95ae,_0x10b552){var _0x2cc371={},_0x382a02={},_0x50fa2c={'count':0x0,'rows':[]};var _0xb44aba=_['map'](db[_0xb11f('0x2e')][_0xb11f('0x2f')],function(_0x5171a3){return{'name':_0x5171a3[_0xb11f('0x30')],'type':_0x5171a3[_0xb11f('0x31')][_0xb11f('0x32')]};});_0x382a02[_0xb11f('0x33')]=_[_0xb11f('0x34')](_0xb44aba,'name');_0x382a02['query']=_[_0xb11f('0x35')](_0x4c95ae[_0xb11f('0x36')]);_0x382a02[_0xb11f('0x37')]=_[_0xb11f('0x38')](_0x382a02[_0xb11f('0x33')],_0x382a02[_0xb11f('0x36')]);_0x2cc371[_0xb11f('0x39')]=_[_0xb11f('0x38')](_0x382a02[_0xb11f('0x33')],qs[_0xb11f('0x3a')](_0x4c95ae[_0xb11f('0x36')]['fields']));_0x2cc371[_0xb11f('0x39')]=_0x2cc371['attributes'][_0xb11f('0x3b')]?_0x2cc371[_0xb11f('0x39')]:_0x382a02[_0xb11f('0x33')];if(!_0x4c95ae[_0xb11f('0x36')][_0xb11f('0x3c')]('nolimit')){_0x2cc371[_0xb11f('0x22')]=qs['limit'](_0x4c95ae[_0xb11f('0x36')][_0xb11f('0x22')]);_0x2cc371['offset']=qs[_0xb11f('0x20')](_0x4c95ae[_0xb11f('0x36')][_0xb11f('0x20')]);}_0x2cc371[_0xb11f('0x3d')]=qs['sort'](_0x4c95ae[_0xb11f('0x36')]['sort']);_0x2cc371['where']=qs[_0xb11f('0x37')](_[_0xb11f('0x3e')](_0x4c95ae[_0xb11f('0x36')],_0x382a02[_0xb11f('0x37')]),_0xb44aba);if(_0x4c95ae[_0xb11f('0x36')][_0xb11f('0x3f')]){_0x2cc371['where']=_[_0xb11f('0x40')](_0x2cc371['where'],{'$or':_[_0xb11f('0x34')](_0xb44aba,function(_0x3f3aa4){if(_0x3f3aa4[_0xb11f('0x31')]!==_0xb11f('0x41')){var _0x134798={};_0x134798[_0x3f3aa4[_0xb11f('0x42')]]={'$like':'%'+_0x4c95ae[_0xb11f('0x36')][_0xb11f('0x3f')]+'%'};return _0x134798;}})});}_0x2cc371=_[_0xb11f('0x40')]({},_0x2cc371,_0x4c95ae[_0xb11f('0x43')]);var _0x546993={'where':_0x2cc371['where']};return db[_0xb11f('0x2e')][_0xb11f('0x23')](_0x546993)[_0xb11f('0x27')](function(_0x35dd26){_0x50fa2c[_0xb11f('0x23')]=_0x35dd26;if(_0x4c95ae[_0xb11f('0x36')][_0xb11f('0x44')]){_0x2cc371[_0xb11f('0x45')]=[{'all':!![]}];}return db[_0xb11f('0x2e')][_0xb11f('0x46')](_0x2cc371);})['then'](function(_0x4f3c7a){_0x50fa2c[_0xb11f('0x47')]=_0x4f3c7a;return _0x50fa2c;})['then'](respondWithFilteredResult(_0x10b552,_0x2cc371))['catch'](handleError(_0x10b552,null));};exports[_0xb11f('0x48')]=function(_0x1e7a82,_0xbcc968){var _0x66adf4={'raw':!![],'where':{'id':_0x1e7a82[_0xb11f('0x49')]['id']}},_0x5144cb={};_0x5144cb[_0xb11f('0x33')]=_[_0xb11f('0x35')](db['Template'][_0xb11f('0x2f')]);_0x5144cb['query']=_[_0xb11f('0x35')](_0x1e7a82[_0xb11f('0x36')]);_0x5144cb[_0xb11f('0x37')]=_['intersection'](_0x5144cb[_0xb11f('0x33')],_0x5144cb[_0xb11f('0x36')]);_0x66adf4['attributes']=_[_0xb11f('0x38')](_0x5144cb[_0xb11f('0x33')],qs[_0xb11f('0x3a')](_0x1e7a82[_0xb11f('0x36')][_0xb11f('0x3a')]));_0x66adf4[_0xb11f('0x39')]=_0x66adf4[_0xb11f('0x39')][_0xb11f('0x3b')]?_0x66adf4[_0xb11f('0x39')]:_0x5144cb[_0xb11f('0x33')];if(_0x1e7a82[_0xb11f('0x36')][_0xb11f('0x44')]){_0x66adf4[_0xb11f('0x45')]=[{'all':!![]}];}_0x66adf4=_[_0xb11f('0x40')]({},_0x66adf4,_0x1e7a82[_0xb11f('0x43')]);return db[_0xb11f('0x2e')][_0xb11f('0x4a')](_0x66adf4)[_0xb11f('0x27')](handleEntityNotFound(_0xbcc968,null))[_0xb11f('0x27')](respondWithResult(_0xbcc968,null))[_0xb11f('0x4b')](handleError(_0xbcc968,null));};exports[_0xb11f('0x4c')]=function(_0x477d77,_0xefb04d){return db['Template']['create'](_0x477d77['body'],{})['then'](function(_0xd84963){var _0xb19761=_0x477d77[_0xb11f('0x4d')][_0xb11f('0x4e')]({'plain':!![]});if(!_0xb19761)throw new Error(_0xb11f('0x4f'));if(_0xb19761[_0xb11f('0x50')]===_0xb11f('0x4d')){var _0x1a0ea9=_0xd84963[_0xb11f('0x4e')]({'plain':!![]});var _0x23c161='Templates';return db[_0xb11f('0x51')][_0xb11f('0x4a')]({'where':{'name':_0x23c161,'userProfileId':_0xb19761[_0xb11f('0x52')]},'raw':!![]})[_0xb11f('0x27')](function(_0x9346b7){if(_0x9346b7&&_0x9346b7[_0xb11f('0x53')]===0x0){return db[_0xb11f('0x2a')][_0xb11f('0x4c')]({'name':_0x1a0ea9[_0xb11f('0x42')],'resourceId':_0x1a0ea9['id'],'type':_0x9346b7[_0xb11f('0x42')],'sectionId':_0x9346b7['id']},{})['then'](function(){return _0xd84963;});}else{return _0xd84963;}})[_0xb11f('0x4b')](function(_0xcbfea){logger[_0xb11f('0x2b')](_0xb11f('0x54'),_0xcbfea);throw _0xcbfea;});}return _0xd84963;})['then'](respondWithResult(_0xefb04d,0xc9))[_0xb11f('0x4b')](handleError(_0xefb04d,null));};exports[_0xb11f('0x55')]=function(_0x4af365,_0x22b6cb){if(_0x4af365[_0xb11f('0x56')]['id']){delete _0x4af365[_0xb11f('0x56')]['id'];}return db[_0xb11f('0x2e')]['find']({'where':{'id':_0x4af365[_0xb11f('0x49')]['id']}})[_0xb11f('0x27')](handleEntityNotFound(_0x22b6cb,null))['then'](saveUpdates(_0x4af365[_0xb11f('0x56')],null))['then'](respondWithResult(_0x22b6cb,null))[_0xb11f('0x4b')](handleError(_0x22b6cb,null));};exports[_0xb11f('0x28')]=function(_0x5c0fed,_0x216452){return db[_0xb11f('0x2e')][_0xb11f('0x4a')]({'where':{'id':_0x5c0fed[_0xb11f('0x49')]['id']}})[_0xb11f('0x27')](handleEntityNotFound(_0x216452,null))[_0xb11f('0x27')](removeEntity(_0x216452,null))['catch'](handleError(_0x216452,null));}; \ No newline at end of file +var _0x23b6=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','intersection','attributes','fields'];(function(_0x3804ef,_0x2ff57d){var _0x4c7944=function(_0x290d77){while(--_0x290d77){_0x3804ef['push'](_0x3804ef['shift']());}};_0x4c7944(++_0x2ff57d);}(_0x23b6,0x6d));var _0x623b=function(_0x3f2ecf,_0x4ccad6){_0x3f2ecf=_0x3f2ecf-0x0;var _0xa6dd7e=_0x23b6[_0x3f2ecf];return _0xa6dd7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x623b('0x0'));var zipdir=require(_0x623b('0x1'));var jsonpatch=require(_0x623b('0x2'));var rp=require(_0x623b('0x3'));var moment=require(_0x623b('0x4'));var BPromise=require(_0x623b('0x5'));var Mustache=require('mustache');var util=require(_0x623b('0x6'));var path=require('path');var sox=require(_0x623b('0x7'));var csv=require('to-csv');var ejs=require(_0x623b('0x8'));var fs=require('fs');var fs_extra=require(_0x623b('0x9'));var _=require(_0x623b('0xa'));var squel=require(_0x623b('0xb'));var crypto=require(_0x623b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x623b('0xd'));var toCsv=require(_0x623b('0xe'));var querystring=require(_0x623b('0xf'));var Papa=require('papaparse');var Redis=require(_0x623b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x623b('0x11'));var hardwareService=require(_0x623b('0x12'));var logger=require('../../config/logger')(_0x623b('0x13'));var utils=require(_0x623b('0x14'));var config=require(_0x623b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x623b('0x16'))['db'];function respondWithStatusCode(_0x418ac9,_0x45bd1a){_0x45bd1a=_0x45bd1a||0xcc;return function(_0x276800){if(_0x276800){return _0x418ac9[_0x623b('0x17')](_0x45bd1a);}return _0x418ac9[_0x623b('0x18')](_0x45bd1a)[_0x623b('0x19')]();};}function respondWithResult(_0x4002f8,_0x1932c4){_0x1932c4=_0x1932c4||0xc8;return function(_0x2b9105){if(_0x2b9105){return _0x4002f8['status'](_0x1932c4)[_0x623b('0x1a')](_0x2b9105);}};}function respondWithFilteredResult(_0x282321,_0x40f0a6){return function(_0x34cbc3){if(_0x34cbc3){var _0x741e0d=typeof _0x40f0a6['offset']===_0x623b('0x1b')&&typeof _0x40f0a6[_0x623b('0x1c')]===_0x623b('0x1b');var _0x415559=_0x34cbc3[_0x623b('0x1d')];var _0x2acd87=_0x741e0d?0x0:_0x40f0a6[_0x623b('0x1e')];var _0x268097=_0x741e0d?_0x34cbc3[_0x623b('0x1d')]:_0x40f0a6[_0x623b('0x1e')]+_0x40f0a6[_0x623b('0x1c')];var _0x20bbba;if(_0x268097>=_0x415559){_0x268097=_0x415559;_0x20bbba=0xc8;}else{_0x20bbba=0xce;}_0x282321[_0x623b('0x18')](_0x20bbba);return _0x282321[_0x623b('0x1f')]('Content-Range',_0x2acd87+'-'+_0x268097+'/'+_0x415559)['json'](_0x34cbc3);}return null;};}function patchUpdates(_0x1bdd3f){return function(_0x50388b){try{jsonpatch['apply'](_0x50388b,_0x1bdd3f,!![]);}catch(_0x4503d7){return BPromise[_0x623b('0x20')](_0x4503d7);}return _0x50388b[_0x623b('0x21')]();};}function saveUpdates(_0x53f707,_0x45d347){return function(_0x16f048){if(_0x16f048){return _0x16f048[_0x623b('0x22')](_0x53f707)[_0x623b('0x23')](function(_0x477269){return _0x477269;});}return null;};}function removeEntity(_0x46f5ec,_0x17849d){return function(_0x5f3a8e){if(_0x5f3a8e){return _0x5f3a8e[_0x623b('0x24')]()[_0x623b('0x23')](function(){var _0x3ba780=_0x5f3a8e[_0x623b('0x25')]({'plain':!![]});var _0x25d391=_0x623b('0x26');return db[_0x623b('0x27')]['destroy']({'where':{'type':_0x25d391,'resourceId':_0x3ba780['id']}})[_0x623b('0x23')](function(){return _0x5f3a8e;});})[_0x623b('0x23')](function(){_0x46f5ec[_0x623b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7327c3,_0x1456da){return function(_0x230074){if(!_0x230074){_0x7327c3[_0x623b('0x17')](0x194);}return _0x230074;};}function handleError(_0x2c28ac,_0x35f9f7){_0x35f9f7=_0x35f9f7||0x1f4;return function(_0x1e92d6){logger[_0x623b('0x28')](_0x1e92d6[_0x623b('0x29')]);if(_0x1e92d6[_0x623b('0x2a')]){delete _0x1e92d6[_0x623b('0x2a')];}_0x2c28ac[_0x623b('0x18')](_0x35f9f7)[_0x623b('0x2b')](_0x1e92d6);};}exports[_0x623b('0x2c')]=function(_0x4115ea,_0x4de01f){var _0x5d98f1={},_0x16f384={},_0x3ccd4a={'count':0x0,'rows':[]};var _0x563a59=_[_0x623b('0x2d')](db[_0x623b('0x2e')][_0x623b('0x2f')],function(_0x3ba457){return{'name':_0x3ba457[_0x623b('0x30')],'type':_0x3ba457[_0x623b('0x31')]['key']};});_0x16f384[_0x623b('0x32')]=_[_0x623b('0x2d')](_0x563a59,'name');_0x16f384[_0x623b('0x33')]=_['keys'](_0x4115ea['query']);_0x16f384['filters']=_[_0x623b('0x34')](_0x16f384[_0x623b('0x32')],_0x16f384[_0x623b('0x33')]);_0x5d98f1[_0x623b('0x35')]=_[_0x623b('0x34')](_0x16f384[_0x623b('0x32')],qs['fields'](_0x4115ea['query'][_0x623b('0x36')]));_0x5d98f1['attributes']=_0x5d98f1['attributes'][_0x623b('0x37')]?_0x5d98f1['attributes']:_0x16f384[_0x623b('0x32')];if(!_0x4115ea[_0x623b('0x33')][_0x623b('0x38')](_0x623b('0x39'))){_0x5d98f1[_0x623b('0x1c')]=qs[_0x623b('0x1c')](_0x4115ea[_0x623b('0x33')][_0x623b('0x1c')]);_0x5d98f1['offset']=qs[_0x623b('0x1e')](_0x4115ea[_0x623b('0x33')][_0x623b('0x1e')]);}_0x5d98f1[_0x623b('0x3a')]=qs[_0x623b('0x3b')](_0x4115ea[_0x623b('0x33')]['sort']);_0x5d98f1[_0x623b('0x3c')]=qs[_0x623b('0x3d')](_['pick'](_0x4115ea[_0x623b('0x33')],_0x16f384['filters']),_0x563a59);if(_0x4115ea[_0x623b('0x33')][_0x623b('0x3e')]){_0x5d98f1[_0x623b('0x3c')]=_[_0x623b('0x3f')](_0x5d98f1[_0x623b('0x3c')],{'$or':_['map'](_0x563a59,function(_0x7bab06){if(_0x7bab06[_0x623b('0x31')]!==_0x623b('0x40')){var _0x4e3e82={};_0x4e3e82[_0x7bab06[_0x623b('0x2a')]]={'$like':'%'+_0x4115ea[_0x623b('0x33')][_0x623b('0x3e')]+'%'};return _0x4e3e82;}})});}_0x5d98f1=_[_0x623b('0x3f')]({},_0x5d98f1,_0x4115ea[_0x623b('0x41')]);var _0x168b53={'where':_0x5d98f1['where']};return db[_0x623b('0x2e')][_0x623b('0x1d')](_0x168b53)[_0x623b('0x23')](function(_0x33157c){_0x3ccd4a[_0x623b('0x1d')]=_0x33157c;if(_0x4115ea[_0x623b('0x33')]['includeAll']){_0x5d98f1['include']=[{'all':!![]}];}return db['Template'][_0x623b('0x42')](_0x5d98f1);})[_0x623b('0x23')](function(_0x1ae878){_0x3ccd4a[_0x623b('0x43')]=_0x1ae878;return _0x3ccd4a;})[_0x623b('0x23')](respondWithFilteredResult(_0x4de01f,_0x5d98f1))[_0x623b('0x44')](handleError(_0x4de01f,null));};exports[_0x623b('0x45')]=function(_0x378475,_0x4c9101){var _0x26e9f4={'raw':!![],'where':{'id':_0x378475[_0x623b('0x46')]['id']}},_0x2538ec={};_0x2538ec[_0x623b('0x32')]=_[_0x623b('0x47')](db['Template'][_0x623b('0x2f')]);_0x2538ec[_0x623b('0x33')]=_[_0x623b('0x47')](_0x378475[_0x623b('0x33')]);_0x2538ec['filters']=_[_0x623b('0x34')](_0x2538ec[_0x623b('0x32')],_0x2538ec[_0x623b('0x33')]);_0x26e9f4['attributes']=_[_0x623b('0x34')](_0x2538ec[_0x623b('0x32')],qs[_0x623b('0x36')](_0x378475[_0x623b('0x33')]['fields']));_0x26e9f4[_0x623b('0x35')]=_0x26e9f4[_0x623b('0x35')][_0x623b('0x37')]?_0x26e9f4[_0x623b('0x35')]:_0x2538ec['model'];if(_0x378475[_0x623b('0x33')][_0x623b('0x48')]){_0x26e9f4[_0x623b('0x49')]=[{'all':!![]}];}_0x26e9f4=_[_0x623b('0x3f')]({},_0x26e9f4,_0x378475[_0x623b('0x41')]);return db['Template'][_0x623b('0x4a')](_0x26e9f4)[_0x623b('0x23')](handleEntityNotFound(_0x4c9101,null))[_0x623b('0x23')](respondWithResult(_0x4c9101,null))[_0x623b('0x44')](handleError(_0x4c9101,null));};exports[_0x623b('0x4b')]=function(_0x308e88,_0x3c6961){return db[_0x623b('0x2e')][_0x623b('0x4b')](_0x308e88[_0x623b('0x4c')],{})['then'](function(_0x5cd67b){var _0x23c0a7=_0x308e88[_0x623b('0x4d')][_0x623b('0x25')]({'plain':!![]});if(!_0x23c0a7)throw new Error(_0x623b('0x4e'));if(_0x23c0a7['role']===_0x623b('0x4d')){var _0x2eaab0=_0x5cd67b['get']({'plain':!![]});var _0x95683f=_0x623b('0x26');return db['UserProfileSection'][_0x623b('0x4a')]({'where':{'name':_0x95683f,'userProfileId':_0x23c0a7[_0x623b('0x4f')]},'raw':!![]})[_0x623b('0x23')](function(_0x472bf8){if(_0x472bf8&&_0x472bf8[_0x623b('0x50')]===0x0){return db[_0x623b('0x27')][_0x623b('0x4b')]({'name':_0x2eaab0[_0x623b('0x2a')],'resourceId':_0x2eaab0['id'],'type':_0x472bf8[_0x623b('0x2a')],'sectionId':_0x472bf8['id']},{})[_0x623b('0x23')](function(){return _0x5cd67b;});}else{return _0x5cd67b;}})[_0x623b('0x44')](function(_0x370b34){logger[_0x623b('0x28')](_0x623b('0x51'),_0x370b34);throw _0x370b34;});}return _0x5cd67b;})['then'](respondWithResult(_0x3c6961,0xc9))[_0x623b('0x44')](handleError(_0x3c6961,null));};exports[_0x623b('0x22')]=function(_0x48ce48,_0x5dbc76){if(_0x48ce48[_0x623b('0x4c')]['id']){delete _0x48ce48[_0x623b('0x4c')]['id'];}return db[_0x623b('0x2e')]['find']({'where':{'id':_0x48ce48[_0x623b('0x46')]['id']}})[_0x623b('0x23')](handleEntityNotFound(_0x5dbc76,null))['then'](saveUpdates(_0x48ce48[_0x623b('0x4c')],null))[_0x623b('0x23')](respondWithResult(_0x5dbc76,null))[_0x623b('0x44')](handleError(_0x5dbc76,null));};exports[_0x623b('0x24')]=function(_0x5ae1de,_0x3e007a){return db[_0x623b('0x2e')][_0x623b('0x4a')]({'where':{'id':_0x5ae1de[_0x623b('0x46')]['id']}})[_0x623b('0x23')](handleEntityNotFound(_0x3e007a,null))[_0x623b('0x23')](removeEntity(_0x3e007a,null))['catch'](handleError(_0x3e007a,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index d3c4e38..2d62532 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 _0x916c=['path','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3e95c7,_0x558d02){var _0x406152=function(_0x13ca8b){while(--_0x13ca8b){_0x3e95c7['push'](_0x3e95c7['shift']());}};_0x406152(++_0x558d02);}(_0x916c,0x1b4));var _0xc916=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0x916c[_0x31295c];return _0x2c150e;};'use strict';var _=require(_0xc916('0x0'));var util=require(_0xc916('0x1'));var logger=require(_0xc916('0x2'))(_0xc916('0x3'));var moment=require(_0xc916('0x4'));var BPromise=require(_0xc916('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc916('0x6'));var rimraf=require(_0xc916('0x7'));var config=require(_0xc916('0x8'));var attributes=require(_0xc916('0x9'));module[_0xc916('0xa')]=function(_0x318fce,_0x4fb7d7){return _0x318fce[_0xc916('0xb')]('Template',attributes,{'tableName':_0xc916('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc47f=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./template.attributes','exports','define','Template'];(function(_0x1694ab,_0x3d3831){var _0x170f7d=function(_0x368d7c){while(--_0x368d7c){_0x1694ab['push'](_0x1694ab['shift']());}};_0x170f7d(++_0x3d3831);}(_0xc47f,0xb7));var _0xfc47=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc47f[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xfc47('0x0'));var util=require(_0xfc47('0x1'));var logger=require(_0xfc47('0x2'))(_0xfc47('0x3'));var moment=require(_0xfc47('0x4'));var BPromise=require(_0xfc47('0x5'));var rp=require(_0xfc47('0x6'));var fs=require('fs');var path=require(_0xfc47('0x7'));var rimraf=require(_0xfc47('0x8'));var config=require('../../config/environment');var attributes=require(_0xfc47('0x9'));module[_0xfc47('0xa')]=function(_0x4ca192,_0x202670){return _0x4ca192[_0xfc47('0xb')](_0xfc47('0xc'),attributes,{'tableName':_0xfc47('0xd'),'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 31695a6..8c16276 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 _0x93f0=['Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x6a4fe7,_0x40a337){var _0x5e467d=function(_0x24eb0b){while(--_0x24eb0b){_0x6a4fe7['push'](_0x6a4fe7['shift']());}};_0x5e467d(++_0x40a337);}(_0x93f0,0x14d));var _0x093f=function(_0x3f968f,_0x240d05){_0x3f968f=_0x3f968f-0x0;var _0x35fd98=_0x93f0[_0x3f968f];return _0x35fd98;};'use strict';var _=require(_0x093f('0x0'));var util=require(_0x093f('0x1'));var moment=require(_0x093f('0x2'));var BPromise=require(_0x093f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x093f('0x4'));var db=require(_0x093f('0x5'))['db'];var utils=require(_0x093f('0x6'));var logger=require('../../config/logger')(_0x093f('0x7'));var config=require(_0x093f('0x8'));var jayson=require(_0x093f('0x9'));var client=jayson[_0x093f('0xa')][_0x093f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ea553,_0x1d3f06,_0x3431c0){return new BPromise(function(_0x4f6e0f,_0x15723b){return client[_0x093f('0xc')](_0x4ea553,_0x3431c0)[_0x093f('0xd')](function(_0x2b51e9){logger['info'](_0x093f('0xe'),_0x1d3f06,_0x093f('0xf'));logger[_0x093f('0x10')](_0x093f('0x11'),_0x1d3f06,'request\x20sent',JSON[_0x093f('0x12')](_0x2b51e9));if(_0x2b51e9[_0x093f('0x13')]){if(_0x2b51e9[_0x093f('0x13')][_0x093f('0x14')]===0x1f4){logger[_0x093f('0x13')](_0x093f('0xe'),_0x1d3f06,_0x2b51e9[_0x093f('0x13')][_0x093f('0x15')]);return _0x15723b(_0x2b51e9[_0x093f('0x13')]['message']);}logger[_0x093f('0x13')](_0x093f('0xe'),_0x1d3f06,_0x2b51e9[_0x093f('0x13')]['message']);return _0x4f6e0f(_0x2b51e9['error'][_0x093f('0x15')]);}else{logger[_0x093f('0x16')](_0x093f('0xe'),_0x1d3f06,_0x093f('0xf'));_0x4f6e0f(_0x2b51e9[_0x093f('0x17')]['message']);}})[_0x093f('0x18')](function(_0x12302e){logger[_0x093f('0x13')]('Template,\x20%s,\x20%s',_0x1d3f06,_0x12302e);_0x15723b(_0x12302e);});});}exports[_0x093f('0x19')]=function(_0x1d3881){var _0x387962=this;return new Promise(function(_0x400f1f,_0x32b78c){return db['Template'][_0x093f('0x1a')]({'raw':_0x1d3881['options']?_0x1d3881[_0x093f('0x1b')][_0x093f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d3881['options']?_0x1d3881[_0x093f('0x1b')][_0x093f('0x1d')]||null:null,'attributes':_0x1d3881['options']?_0x1d3881[_0x093f('0x1b')][_0x093f('0x1e')]||null:null,'limit':_0x1d3881[_0x093f('0x1b')]?_0x1d3881[_0x093f('0x1b')][_0x093f('0x1f')]||null:null,'include':_0x1d3881[_0x093f('0x1b')]?_0x1d3881[_0x093f('0x1b')][_0x093f('0x20')]?_[_0x093f('0x21')](_0x1d3881[_0x093f('0x1b')][_0x093f('0x20')],function(_0x1026a8){return{'model':db[_0x1026a8[_0x093f('0x22')]],'as':_0x1026a8['as'],'attributes':_0x1026a8[_0x093f('0x1e')],'include':_0x1026a8[_0x093f('0x20')]?_[_0x093f('0x21')](_0x1026a8[_0x093f('0x20')],function(_0x117d3d){return{'model':db[_0x117d3d[_0x093f('0x22')]],'as':_0x117d3d['as'],'attributes':_0x117d3d[_0x093f('0x1e')],'include':_0x117d3d[_0x093f('0x20')]?_['map'](_0x117d3d[_0x093f('0x20')],function(_0x8052c8){return{'model':db[_0x8052c8[_0x093f('0x22')]],'as':_0x8052c8['as'],'attributes':_0x8052c8[_0x093f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x417f50){logger[_0x093f('0x16')]('GetTemplate',_0x1d3881);logger[_0x093f('0x10')](_0x093f('0x19'),_0x1d3881,JSON['stringify'](_0x417f50));_0x400f1f(_0x417f50);})[_0x093f('0x18')](function(_0x3f51b4){logger[_0x093f('0x13')](_0x093f('0x19'),_0x3f51b4[_0x093f('0x15')],_0x1d3881);_0x32b78c(_0x387962['error'](0x1f4,_0x3f51b4[_0x093f('0x15')]));});});}; \ No newline at end of file +var _0xbefc=['info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','result','GetTemplate','Template','findAll','raw','options','attributes','limit','include','map','model','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2df01f,_0x542398){var _0x5e487b=function(_0x490723){while(--_0x490723){_0x2df01f['push'](_0x2df01f['shift']());}};_0x5e487b(++_0x542398);}(_0xbefc,0x195));var _0xcbef=function(_0x4e4fcf,_0x355f77){_0x4e4fcf=_0x4e4fcf-0x0;var _0x540cb9=_0xbefc[_0x4e4fcf];return _0x540cb9;};'use strict';var _=require('lodash');var util=require(_0xcbef('0x0'));var moment=require(_0xcbef('0x1'));var BPromise=require(_0xcbef('0x2'));var rs=require(_0xcbef('0x3'));var fs=require('fs');var Redis=require(_0xcbef('0x4'));var db=require(_0xcbef('0x5'))['db'];var utils=require(_0xcbef('0x6'));var logger=require(_0xcbef('0x7'))(_0xcbef('0x8'));var config=require(_0xcbef('0x9'));var jayson=require(_0xcbef('0xa'));var client=jayson[_0xcbef('0xb')][_0xcbef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17bf41,_0x3137a4,_0x36eae6){return new BPromise(function(_0x3c76cd,_0x10e840){return client[_0xcbef('0xd')](_0x17bf41,_0x36eae6)[_0xcbef('0xe')](function(_0x2e10e4){logger[_0xcbef('0xf')]('Template,\x20%s,\x20%s',_0x3137a4,_0xcbef('0x10'));logger[_0xcbef('0x11')](_0xcbef('0x12'),_0x3137a4,'request\x20sent',JSON['stringify'](_0x2e10e4));if(_0x2e10e4[_0xcbef('0x13')]){if(_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x14')]===0x1f4){logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);return _0x10e840(_0x2e10e4['error'][_0xcbef('0x16')]);}logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);return _0x3c76cd(_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x3137a4,_0xcbef('0x10'));_0x3c76cd(_0x2e10e4[_0xcbef('0x17')][_0xcbef('0x16')]);}})['catch'](function(_0x48a6c9){logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x48a6c9);_0x10e840(_0x48a6c9);});});}exports[_0xcbef('0x18')]=function(_0x5b02be){var _0x2a3887=this;return new Promise(function(_0x17f198,_0x4d59b3){return db[_0xcbef('0x19')][_0xcbef('0x1a')]({'raw':_0x5b02be['options']?_0x5b02be['options'][_0xcbef('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b02be[_0xcbef('0x1c')]?_0x5b02be[_0xcbef('0x1c')]['where']||null:null,'attributes':_0x5b02be[_0xcbef('0x1c')]?_0x5b02be[_0xcbef('0x1c')][_0xcbef('0x1d')]||null:null,'limit':_0x5b02be['options']?_0x5b02be[_0xcbef('0x1c')][_0xcbef('0x1e')]||null:null,'include':_0x5b02be[_0xcbef('0x1c')]?_0x5b02be['options'][_0xcbef('0x1f')]?_[_0xcbef('0x20')](_0x5b02be[_0xcbef('0x1c')][_0xcbef('0x1f')],function(_0x1cf41e){return{'model':db[_0x1cf41e['model']],'as':_0x1cf41e['as'],'attributes':_0x1cf41e[_0xcbef('0x1d')],'include':_0x1cf41e[_0xcbef('0x1f')]?_[_0xcbef('0x20')](_0x1cf41e[_0xcbef('0x1f')],function(_0x119443){return{'model':db[_0x119443['model']],'as':_0x119443['as'],'attributes':_0x119443[_0xcbef('0x1d')],'include':_0x119443['include']?_[_0xcbef('0x20')](_0x119443[_0xcbef('0x1f')],function(_0xaaa05a){return{'model':db[_0xaaa05a[_0xcbef('0x21')]],'as':_0xaaa05a['as'],'attributes':_0xaaa05a['attributes']};}):[]};}):[]};}):[]:[]})[_0xcbef('0xe')](function(_0x4ee886){logger[_0xcbef('0xf')](_0xcbef('0x18'),_0x5b02be);logger[_0xcbef('0x11')](_0xcbef('0x18'),_0x5b02be,JSON['stringify'](_0x4ee886));_0x17f198(_0x4ee886);})[_0xcbef('0x22')](function(_0x2ca2a7){logger[_0xcbef('0x13')](_0xcbef('0x18'),_0x2ca2a7[_0xcbef('0x16')],_0x5b02be);_0x4d59b3(_0x2a3887[_0xcbef('0x13')](0x1f4,_0x2ca2a7['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 33eb7d0..3940807 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 _0x41ea=['show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id'];(function(_0x3f7608,_0x51adb3){var _0x983f01=function(_0x2310c2){while(--_0x2310c2){_0x3f7608['push'](_0x3f7608['shift']());}};_0x983f01(++_0x51adb3);}(_0x41ea,0x138));var _0xa41e=function(_0x50f06f,_0x3600ac){_0x50f06f=_0x50f06f-0x0;var _0x5b23fe=_0x41ea[_0x50f06f];return _0x5b23fe;};'use strict';var multer=require(_0xa41e('0x0'));var util=require(_0xa41e('0x1'));var path=require(_0xa41e('0x2'));var timeout=require(_0xa41e('0x3'));var express=require(_0xa41e('0x4'));var router=express['Router']();var fs_extra=require(_0xa41e('0x5'));var auth=require(_0xa41e('0x6'));var interaction=require(_0xa41e('0x7'));var config=require('../../config/environment');var controller=require('./trigger.controller');router['get']('/',auth[_0xa41e('0x8')](),controller[_0xa41e('0x9')]);router[_0xa41e('0xa')](_0xa41e('0xb'),auth[_0xa41e('0x8')](),controller[_0xa41e('0xc')]);router[_0xa41e('0xa')](_0xa41e('0xd'),auth['isAuthenticated'](),controller[_0xa41e('0xe')]);router[_0xa41e('0xa')](_0xa41e('0xf'),auth[_0xa41e('0x8')](),controller[_0xa41e('0x10')]);router[_0xa41e('0xa')](_0xa41e('0x11'),auth[_0xa41e('0x8')](),controller[_0xa41e('0x12')]);router[_0xa41e('0x13')]('/',auth[_0xa41e('0x8')](),controller[_0xa41e('0x14')]);router['post'](_0xa41e('0xd'),auth[_0xa41e('0x8')](),controller[_0xa41e('0x15')]);router[_0xa41e('0x13')]('/:id/any_conditions',auth[_0xa41e('0x8')](),controller[_0xa41e('0x16')]);router['post']('/:id/actions',auth[_0xa41e('0x8')](),controller[_0xa41e('0x17')]);router[_0xa41e('0x18')](_0xa41e('0xb'),auth[_0xa41e('0x8')](),controller[_0xa41e('0x19')]);router[_0xa41e('0x1a')]('/:id',auth[_0xa41e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9153=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','/:id','show','get','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAnyCondition','put','update','delete','destroy','exports'];(function(_0x47a1f2,_0x490e17){var _0x15b217=function(_0x166b74){while(--_0x166b74){_0x47a1f2['push'](_0x47a1f2['shift']());}};_0x15b217(++_0x490e17);}(_0x9153,0xd8));var _0x3915=function(_0x128367,_0x56807a){_0x128367=_0x128367-0x0;var _0x237084=_0x9153[_0x128367];return _0x237084;};'use strict';var multer=require(_0x3915('0x0'));var util=require(_0x3915('0x1'));var path=require(_0x3915('0x2'));var timeout=require(_0x3915('0x3'));var express=require(_0x3915('0x4'));var router=express[_0x3915('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3915('0x6'));var interaction=require(_0x3915('0x7'));var config=require(_0x3915('0x8'));var controller=require(_0x3915('0x9'));router['get']('/',auth[_0x3915('0xa')](),controller['index']);router['get'](_0x3915('0xb'),auth[_0x3915('0xa')](),controller[_0x3915('0xc')]);router[_0x3915('0xd')]('/:id/all_conditions',auth[_0x3915('0xa')](),controller['getAllConditions']);router['get'](_0x3915('0xe'),auth[_0x3915('0xa')](),controller[_0x3915('0xf')]);router[_0x3915('0xd')](_0x3915('0x10'),auth[_0x3915('0xa')](),controller[_0x3915('0x11')]);router[_0x3915('0x12')]('/',auth[_0x3915('0xa')](),controller[_0x3915('0x13')]);router['post'](_0x3915('0x14'),auth[_0x3915('0xa')](),controller['addAllCondition']);router[_0x3915('0x12')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x3915('0x15')]);router[_0x3915('0x12')](_0x3915('0x10'),auth[_0x3915('0xa')](),controller['addAction']);router[_0x3915('0x16')](_0x3915('0xb'),auth[_0x3915('0xa')](),controller[_0x3915('0x17')]);router[_0x3915('0x18')]('/:id',auth[_0x3915('0xa')](),controller[_0x3915('0x19')]);module[_0x3915('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 b8599c6..6e5197f 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 _0x95bc=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3489dc,_0x5c9f11){var _0x53b272=function(_0x465420){while(--_0x465420){_0x3489dc['push'](_0x3489dc['shift']());}};_0x53b272(++_0x5c9f11);}(_0x95bc,0x1d5));var _0xc95b=function(_0x1a6994,_0x26d593){_0x1a6994=_0x1a6994-0x0;var _0x43966c=_0x95bc[_0x1a6994];return _0x43966c;};'use strict';var Sequelize=require(_0xc95b('0x0'));module[_0xc95b('0x1')]={'name':{'type':Sequelize[_0xc95b('0x2')]},'channel':{'type':Sequelize[_0xc95b('0x2')]},'description':{'type':Sequelize[_0xc95b('0x2')]},'status':{'type':Sequelize[_0xc95b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb403=['sequelize','STRING','BOOLEAN'];(function(_0x5e7173,_0x37b118){var _0x491084=function(_0x4550c9){while(--_0x4550c9){_0x5e7173['push'](_0x5e7173['shift']());}};_0x491084(++_0x37b118);}(_0xb403,0x1e0));var _0x3b40=function(_0xde639e,_0x508b44){_0xde639e=_0xde639e-0x0;var _0x105a83=_0xb403[_0xde639e];return _0x105a83;};'use strict';var Sequelize=require(_0x3b40('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b40('0x1')]},'channel':{'type':Sequelize[_0x3b40('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x3b40('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index a176f45..0ed937d 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 _0x490b=['fields','query','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','keys','length','includeAll','find','catch','body','user','get','UserProfileSection','userProfileId','autoAssociation','create','TriggerAllId','TriggerAnyId','Condition','findOne','getAllConditions','getAnyConditions','hasOwnProperty','nolimit','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','status','sendStatus','error','name','send','index','map','Trigger','rawAttributes','model','filters','intersection','attributes'];(function(_0x5e7a5f,_0x434f1f){var _0x264521=function(_0x2ef5d4){while(--_0x2ef5d4){_0x5e7a5f['push'](_0x5e7a5f['shift']());}};_0x264521(++_0x434f1f);}(_0x490b,0x12e));var _0xb490=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x490b[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require(_0xb490('0x0'));var rimraf=require(_0xb490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb490('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb490('0x3'));var Mustache=require(_0xb490('0x4'));var util=require(_0xb490('0x5'));var path=require(_0xb490('0x6'));var sox=require(_0xb490('0x7'));var csv=require(_0xb490('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb490('0x9'));var _=require('lodash');var squel=require(_0xb490('0xa'));var crypto=require(_0xb490('0xb'));var jsforce=require(_0xb490('0xc'));var deskjs=require(_0xb490('0xd'));var toCsv=require(_0xb490('0x8'));var querystring=require(_0xb490('0xe'));var Papa=require('papaparse');var Redis=require(_0xb490('0xf'));var authService=require(_0xb490('0x10'));var qs=require(_0xb490('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb490('0x12'));var logger=require('../../config/logger')(_0xb490('0x13'));var utils=require(_0xb490('0x14'));var config=require(_0xb490('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f8737,_0x50e8b6){_0x50e8b6=_0x50e8b6||0xcc;return function(_0x23cae9){if(_0x23cae9){return _0x4f8737['sendStatus'](_0x50e8b6);}return _0x4f8737['status'](_0x50e8b6)[_0xb490('0x16')]();};}function respondWithResult(_0x4e8645,_0x13ba34){_0x13ba34=_0x13ba34||0xc8;return function(_0x5ad99d){if(_0x5ad99d){return _0x4e8645['status'](_0x13ba34)[_0xb490('0x17')](_0x5ad99d);}};}function respondWithFilteredResult(_0x59ba6a,_0x2d58c3){return function(_0x56bbba){if(_0x56bbba){var _0x3c898b=typeof _0x2d58c3['offset']===_0xb490('0x18')&&typeof _0x2d58c3[_0xb490('0x19')]===_0xb490('0x18');var _0x2c666f=_0x56bbba[_0xb490('0x1a')];var _0x4b966f=_0x3c898b?0x0:_0x2d58c3[_0xb490('0x1b')];var _0x41a046=_0x3c898b?_0x56bbba[_0xb490('0x1a')]:_0x2d58c3[_0xb490('0x1b')]+_0x2d58c3[_0xb490('0x19')];var _0x451ee5;if(_0x41a046>=_0x2c666f){_0x41a046=_0x2c666f;_0x451ee5=0xc8;}else{_0x451ee5=0xce;}_0x59ba6a['status'](_0x451ee5);return _0x59ba6a['set'](_0xb490('0x1c'),_0x4b966f+'-'+_0x41a046+'/'+_0x2c666f)[_0xb490('0x17')](_0x56bbba);}return null;};}function patchUpdates(_0x357bc6){return function(_0x2d6870){try{jsonpatch[_0xb490('0x1d')](_0x2d6870,_0x357bc6,!![]);}catch(_0x4a9246){return BPromise[_0xb490('0x1e')](_0x4a9246);}return _0x2d6870[_0xb490('0x1f')]();};}function saveUpdates(_0x1b21c6,_0x94bfac){return function(_0x843d16){if(_0x843d16){return _0x843d16[_0xb490('0x20')](_0x1b21c6)[_0xb490('0x21')](function(_0x4a01d5){return _0x4a01d5;});}return null;};}function removeEntity(_0x53ad1f,_0x5d4243){return function(_0xc920b4){if(_0xc920b4){return _0xc920b4[_0xb490('0x22')]()[_0xb490('0x21')](function(){var _0x47a631=_0xc920b4['get']({'plain':!![]});var _0x1eefbb=_0xb490('0x23');return db[_0xb490('0x24')][_0xb490('0x22')]({'where':{'type':_0x1eefbb,'resourceId':_0x47a631['id']}})[_0xb490('0x21')](function(){return _0xc920b4;});})[_0xb490('0x21')](function(){_0x53ad1f[_0xb490('0x25')](0xcc)[_0xb490('0x16')]();});}};}function handleEntityNotFound(_0x384666,_0x51c832){return function(_0x1af495){if(!_0x1af495){_0x384666[_0xb490('0x26')](0x194);}return _0x1af495;};}function handleError(_0x469254,_0x11e747){_0x11e747=_0x11e747||0x1f4;return function(_0x4d8c19){logger[_0xb490('0x27')](_0x4d8c19['stack']);if(_0x4d8c19['name']){delete _0x4d8c19[_0xb490('0x28')];}_0x469254[_0xb490('0x25')](_0x11e747)[_0xb490('0x29')](_0x4d8c19);};}exports[_0xb490('0x2a')]=function(_0x433146,_0x23ab42){var _0x4562b8={},_0x194a0c={},_0x18ebc7={'count':0x0,'rows':[]};var _0x5112b2=_[_0xb490('0x2b')](db[_0xb490('0x2c')][_0xb490('0x2d')],function(_0xea052c){return{'name':_0xea052c['fieldName'],'type':_0xea052c['type']['key']};});_0x194a0c[_0xb490('0x2e')]=_[_0xb490('0x2b')](_0x5112b2,_0xb490('0x28'));_0x194a0c['query']=_['keys'](_0x433146['query']);_0x194a0c[_0xb490('0x2f')]=_[_0xb490('0x30')](_0x194a0c['model'],_0x194a0c['query']);_0x4562b8[_0xb490('0x31')]=_[_0xb490('0x30')](_0x194a0c[_0xb490('0x2e')],qs[_0xb490('0x32')](_0x433146['query']['fields']));_0x4562b8[_0xb490('0x31')]=_0x4562b8['attributes']['length']?_0x4562b8[_0xb490('0x31')]:_0x194a0c[_0xb490('0x2e')];if(!_0x433146[_0xb490('0x33')]['hasOwnProperty']('nolimit')){_0x4562b8['limit']=qs['limit'](_0x433146['query'][_0xb490('0x19')]);_0x4562b8[_0xb490('0x1b')]=qs[_0xb490('0x1b')](_0x433146[_0xb490('0x33')][_0xb490('0x1b')]);}_0x4562b8[_0xb490('0x34')]=qs[_0xb490('0x35')](_0x433146[_0xb490('0x33')][_0xb490('0x35')]);_0x4562b8[_0xb490('0x36')]=qs[_0xb490('0x2f')](_[_0xb490('0x37')](_0x433146[_0xb490('0x33')],_0x194a0c['filters']),_0x5112b2);if(_0x433146[_0xb490('0x33')][_0xb490('0x38')]){_0x4562b8[_0xb490('0x36')]=_[_0xb490('0x39')](_0x4562b8[_0xb490('0x36')],{'$or':_[_0xb490('0x2b')](_0x5112b2,function(_0x168f82){if(_0x168f82[_0xb490('0x3a')]!==_0xb490('0x3b')){var _0x15becc={};_0x15becc[_0x168f82[_0xb490('0x28')]]={'$like':'%'+_0x433146['query'][_0xb490('0x38')]+'%'};return _0x15becc;}})});}_0x4562b8=_['merge']({},_0x4562b8,_0x433146[_0xb490('0x3c')]);var _0x1072d7={'where':_0x4562b8[_0xb490('0x36')]};return db[_0xb490('0x2c')][_0xb490('0x1a')](_0x1072d7)[_0xb490('0x21')](function(_0x1ddbac){_0x18ebc7[_0xb490('0x1a')]=_0x1ddbac;if(_0x433146[_0xb490('0x33')]['includeAll']){_0x4562b8[_0xb490('0x3d')]=[{'all':!![]}];}return db['Trigger'][_0xb490('0x3e')](_0x4562b8);})[_0xb490('0x21')](function(_0x490735){_0x18ebc7['rows']=_0x490735;return _0x18ebc7;})[_0xb490('0x21')](respondWithFilteredResult(_0x23ab42,_0x4562b8))['catch'](handleError(_0x23ab42,null));};exports[_0xb490('0x3f')]=function(_0x320b67,_0x274088){var _0x8977f4={'raw':![],'where':{'id':_0x320b67[_0xb490('0x40')]['id']}},_0x494e01={};_0x494e01[_0xb490('0x2e')]=_[_0xb490('0x41')](db[_0xb490('0x2c')]['rawAttributes']);_0x494e01[_0xb490('0x33')]=_[_0xb490('0x41')](_0x320b67[_0xb490('0x33')]);_0x494e01[_0xb490('0x2f')]=_[_0xb490('0x30')](_0x494e01[_0xb490('0x2e')],_0x494e01['query']);_0x8977f4[_0xb490('0x31')]=_[_0xb490('0x30')](_0x494e01[_0xb490('0x2e')],qs[_0xb490('0x32')](_0x320b67[_0xb490('0x33')][_0xb490('0x32')]));_0x8977f4['attributes']=_0x8977f4[_0xb490('0x31')][_0xb490('0x42')]?_0x8977f4['attributes']:_0x494e01[_0xb490('0x2e')];if(_0x320b67[_0xb490('0x33')][_0xb490('0x43')]){_0x8977f4[_0xb490('0x3d')]=[{'all':!![]}];}_0x8977f4=_['merge']({},_0x8977f4,_0x320b67[_0xb490('0x3c')]);return db[_0xb490('0x2c')][_0xb490('0x44')](_0x8977f4)[_0xb490('0x21')](handleEntityNotFound(_0x274088,null))[_0xb490('0x21')](respondWithResult(_0x274088,null))[_0xb490('0x45')](handleError(_0x274088,null));};exports['create']=function(_0x23c358,_0x4c2adb){return db[_0xb490('0x2c')]['create'](_0x23c358[_0xb490('0x46')],{})['then'](function(_0x34efb4){var _0x42e3a4=_0x23c358[_0xb490('0x47')][_0xb490('0x48')]({'plain':!![]});if(!_0x42e3a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42e3a4['role']==='user'){var _0x294a44=_0x34efb4['get']({'plain':!![]});var _0x596b1b=_0xb490('0x23');return db[_0xb490('0x49')][_0xb490('0x44')]({'where':{'name':_0x596b1b,'userProfileId':_0x42e3a4[_0xb490('0x4a')]},'raw':!![]})[_0xb490('0x21')](function(_0x5dd487){if(_0x5dd487&&_0x5dd487[_0xb490('0x4b')]===0x0){return db[_0xb490('0x24')][_0xb490('0x4c')]({'name':_0x294a44[_0xb490('0x28')],'resourceId':_0x294a44['id'],'type':_0x5dd487[_0xb490('0x28')],'sectionId':_0x5dd487['id']},{})[_0xb490('0x21')](function(){return _0x34efb4;});}else{return _0x34efb4;}})[_0xb490('0x45')](function(_0x586085){logger[_0xb490('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x586085);throw _0x586085;});}return _0x34efb4;})['then'](respondWithResult(_0x4c2adb,0xc9))[_0xb490('0x45')](handleError(_0x4c2adb,null));};exports['update']=function(_0x5e98e6,_0x45ad96){if(_0x5e98e6[_0xb490('0x46')]['id']){delete _0x5e98e6[_0xb490('0x46')]['id'];}return db[_0xb490('0x2c')][_0xb490('0x44')]({'where':{'id':_0x5e98e6[_0xb490('0x40')]['id']}})[_0xb490('0x21')](handleEntityNotFound(_0x45ad96,null))[_0xb490('0x21')](saveUpdates(_0x5e98e6[_0xb490('0x46')],null))[_0xb490('0x21')](respondWithResult(_0x45ad96,null))[_0xb490('0x45')](handleError(_0x45ad96,null));};exports[_0xb490('0x22')]=function(_0x204927,_0x4eafcb){return db[_0xb490('0x2c')][_0xb490('0x44')]({'where':{'id':_0x204927[_0xb490('0x40')]['id']}})[_0xb490('0x21')](handleEntityNotFound(_0x4eafcb,null))[_0xb490('0x21')](removeEntity(_0x4eafcb,null))[_0xb490('0x45')](handleError(_0x4eafcb,null));};exports['addAllCondition']=function(_0x11f61c,_0x3c9d2f,_0x4dab0a){if(_0x11f61c[_0xb490('0x46')]['id']){delete _0x11f61c[_0xb490('0x46')]['id'];}return db[_0xb490('0x2c')][_0xb490('0x44')]({'where':{'id':_0x11f61c[_0xb490('0x40')]['id']}})[_0xb490('0x21')](handleEntityNotFound(_0x3c9d2f,null))[_0xb490('0x21')](function(_0x55a71b){if(_0x55a71b){_0x11f61c[_0xb490('0x46')][_0xb490('0x4d')]=_0x55a71b['id'];return db['Condition']['create'](_0x11f61c[_0xb490('0x46')]);}})[_0xb490('0x21')](respondWithResult(_0x3c9d2f,null))['catch'](handleError(_0x3c9d2f,null));};exports['addAnyCondition']=function(_0x2e6c36,_0x3d94a5,_0x385f00){if(_0x2e6c36[_0xb490('0x46')]['id']){delete _0x2e6c36[_0xb490('0x46')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2e6c36[_0xb490('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d94a5,null))['then'](function(_0x2155d3){if(_0x2155d3){_0x2e6c36['body'][_0xb490('0x4e')]=_0x2155d3['id'];return db[_0xb490('0x4f')][_0xb490('0x4c')](_0x2e6c36[_0xb490('0x46')]);}})[_0xb490('0x21')](respondWithResult(_0x3d94a5,null))[_0xb490('0x45')](handleError(_0x3d94a5,null));};exports['getAllConditions']=function(_0x25ab42,_0x529251,_0x4eb13c){var _0x543cae={};var _0x16aa1e={};var _0x3e5f7d;var _0x3997fa;return db[_0xb490('0x2c')][_0xb490('0x50')]({'where':{'id':_0x25ab42['params']['id']}})[_0xb490('0x21')](handleEntityNotFound(_0x529251,null))[_0xb490('0x21')](function(_0x25d710){if(_0x25d710){_0x3e5f7d=_0x25d710;_0x16aa1e[_0xb490('0x2e')]=_[_0xb490('0x41')](db[_0xb490('0x4f')][_0xb490('0x2d')]);_0x16aa1e[_0xb490('0x33')]=_[_0xb490('0x41')](_0x25ab42[_0xb490('0x33')]);_0x16aa1e['filters']=_[_0xb490('0x30')](_0x16aa1e[_0xb490('0x2e')],_0x16aa1e[_0xb490('0x33')]);_0x543cae[_0xb490('0x31')]=_[_0xb490('0x30')](_0x16aa1e[_0xb490('0x2e')],qs['fields'](_0x25ab42[_0xb490('0x33')]['fields']));_0x543cae[_0xb490('0x31')]=_0x543cae[_0xb490('0x31')][_0xb490('0x42')]?_0x543cae[_0xb490('0x31')]:_0x16aa1e[_0xb490('0x2e')];_0x543cae[_0xb490('0x34')]=qs['sort'](_0x25ab42[_0xb490('0x33')][_0xb490('0x35')]);_0x543cae[_0xb490('0x36')]=qs[_0xb490('0x2f')](_[_0xb490('0x37')](_0x25ab42['query'],_0x16aa1e[_0xb490('0x2f')]));if(_0x25ab42['query']['filter']){_0x543cae[_0xb490('0x36')]=_[_0xb490('0x39')](_0x543cae[_0xb490('0x36')],{'$or':_[_0xb490('0x2b')](_0x543cae[_0xb490('0x31')],function(_0x2bad95){var _0x1252f4={};_0x1252f4[_0x2bad95]={'$like':'%'+_0x25ab42[_0xb490('0x33')][_0xb490('0x38')]+'%'};return _0x1252f4;})});}_0x543cae=_[_0xb490('0x39')]({},_0x543cae,_0x25ab42[_0xb490('0x3c')]);return _0x3e5f7d[_0xb490('0x51')](_0x543cae);}})[_0xb490('0x21')](function(_0x388357){if(_0x388357){_0x3997fa=_0x388357[_0xb490('0x42')];if(!_0x25ab42['query']['hasOwnProperty']('nolimit')){_0x543cae[_0xb490('0x19')]=qs[_0xb490('0x19')](_0x25ab42[_0xb490('0x33')][_0xb490('0x19')]);_0x543cae[_0xb490('0x1b')]=qs[_0xb490('0x1b')](_0x25ab42[_0xb490('0x33')][_0xb490('0x1b')]);}return _0x3e5f7d[_0xb490('0x51')](_0x543cae);}})[_0xb490('0x21')](function(_0x142221){if(_0x142221){return _0x142221?{'count':_0x3997fa,'rows':_0x142221}:null;}})[_0xb490('0x21')](respondWithResult(_0x529251,null))[_0xb490('0x45')](handleError(_0x529251,null));};exports[_0xb490('0x52')]=function(_0x142233,_0xb9b85,_0x5b58f3){var _0x8bc9b1={};var _0x5e11ed={};var _0x1fbea0;var _0x3b8e81;return db['Trigger'][_0xb490('0x50')]({'where':{'id':_0x142233[_0xb490('0x40')]['id']}})['then'](handleEntityNotFound(_0xb9b85,null))[_0xb490('0x21')](function(_0x2c0ac4){if(_0x2c0ac4){_0x1fbea0=_0x2c0ac4;_0x5e11ed[_0xb490('0x2e')]=_[_0xb490('0x41')](db['Condition'][_0xb490('0x2d')]);_0x5e11ed[_0xb490('0x33')]=_[_0xb490('0x41')](_0x142233[_0xb490('0x33')]);_0x5e11ed[_0xb490('0x2f')]=_['intersection'](_0x5e11ed[_0xb490('0x2e')],_0x5e11ed[_0xb490('0x33')]);_0x8bc9b1[_0xb490('0x31')]=_[_0xb490('0x30')](_0x5e11ed[_0xb490('0x2e')],qs['fields'](_0x142233['query']['fields']));_0x8bc9b1[_0xb490('0x31')]=_0x8bc9b1[_0xb490('0x31')][_0xb490('0x42')]?_0x8bc9b1[_0xb490('0x31')]:_0x5e11ed[_0xb490('0x2e')];_0x8bc9b1['order']=qs[_0xb490('0x35')](_0x142233[_0xb490('0x33')][_0xb490('0x35')]);_0x8bc9b1[_0xb490('0x36')]=qs[_0xb490('0x2f')](_['pick'](_0x142233['query'],_0x5e11ed[_0xb490('0x2f')]));if(_0x142233[_0xb490('0x33')]['filter']){_0x8bc9b1[_0xb490('0x36')]=_[_0xb490('0x39')](_0x8bc9b1[_0xb490('0x36')],{'$or':_[_0xb490('0x2b')](_0x8bc9b1['attributes'],function(_0x192b2c){var _0x4817cb={};_0x4817cb[_0x192b2c]={'$like':'%'+_0x142233[_0xb490('0x33')][_0xb490('0x38')]+'%'};return _0x4817cb;})});}_0x8bc9b1=_[_0xb490('0x39')]({},_0x8bc9b1,_0x142233[_0xb490('0x3c')]);return _0x1fbea0[_0xb490('0x52')](_0x8bc9b1);}})[_0xb490('0x21')](function(_0xf74c93){if(_0xf74c93){_0x3b8e81=_0xf74c93[_0xb490('0x42')];if(!_0x142233[_0xb490('0x33')][_0xb490('0x53')](_0xb490('0x54'))){_0x8bc9b1[_0xb490('0x19')]=qs[_0xb490('0x19')](_0x142233[_0xb490('0x33')][_0xb490('0x19')]);_0x8bc9b1['offset']=qs[_0xb490('0x1b')](_0x142233[_0xb490('0x33')][_0xb490('0x1b')]);}return _0x1fbea0[_0xb490('0x52')](_0x8bc9b1);}})[_0xb490('0x21')](function(_0x284c15){if(_0x284c15){return _0x284c15?{'count':_0x3b8e81,'rows':_0x284c15}:null;}})['then'](respondWithResult(_0xb9b85,null))['catch'](handleError(_0xb9b85,null));};exports['addAction']=function(_0x44fba5,_0x4d89e6,_0x3eabeb){if(_0x44fba5['body']['id']){delete _0x44fba5[_0xb490('0x46')]['id'];}return db[_0xb490('0x2c')][_0xb490('0x44')]({'where':{'id':_0x44fba5['params']['id']}})['then'](handleEntityNotFound(_0x4d89e6,null))[_0xb490('0x21')](function(_0x1fb6ec){if(_0x1fb6ec){_0x44fba5[_0xb490('0x46')][_0xb490('0x55')]=_0x1fb6ec['id'];return db[_0xb490('0x56')][_0xb490('0x4c')](_0x44fba5['body']);}})[_0xb490('0x21')](respondWithResult(_0x4d89e6,null))[_0xb490('0x45')](handleError(_0x4d89e6,null));};exports['getActions']=function(_0x9509cb,_0x1536df,_0x7b18da){var _0x1c7487={};var _0x446b91={};var _0x417ac4;var _0x52ec1e;return db[_0xb490('0x2c')]['findOne']({'where':{'id':_0x9509cb[_0xb490('0x40')]['id']}})[_0xb490('0x21')](handleEntityNotFound(_0x1536df,null))[_0xb490('0x21')](function(_0x42e60d){if(_0x42e60d){_0x417ac4=_0x42e60d;_0x446b91['model']=_[_0xb490('0x41')](db['Action'][_0xb490('0x2d')]);_0x446b91[_0xb490('0x33')]=_['keys'](_0x9509cb[_0xb490('0x33')]);_0x446b91[_0xb490('0x2f')]=_[_0xb490('0x30')](_0x446b91[_0xb490('0x2e')],_0x446b91[_0xb490('0x33')]);_0x1c7487[_0xb490('0x31')]=_[_0xb490('0x30')](_0x446b91[_0xb490('0x2e')],qs[_0xb490('0x32')](_0x9509cb[_0xb490('0x33')]['fields']));_0x1c7487[_0xb490('0x31')]=_0x1c7487[_0xb490('0x31')][_0xb490('0x42')]?_0x1c7487[_0xb490('0x31')]:_0x446b91[_0xb490('0x2e')];_0x1c7487['order']=qs[_0xb490('0x35')](_0x9509cb[_0xb490('0x33')][_0xb490('0x35')]);_0x1c7487['where']=qs[_0xb490('0x2f')](_[_0xb490('0x37')](_0x9509cb[_0xb490('0x33')],_0x446b91[_0xb490('0x2f')]));if(_0x9509cb[_0xb490('0x33')]['filter']){_0x1c7487[_0xb490('0x36')]=_[_0xb490('0x39')](_0x1c7487[_0xb490('0x36')],{'$or':_[_0xb490('0x2b')](_0x1c7487['attributes'],function(_0x341669){var _0x2d2e4d={};_0x2d2e4d[_0x341669]={'$like':'%'+_0x9509cb['query'][_0xb490('0x38')]+'%'};return _0x2d2e4d;})});}_0x1c7487=_[_0xb490('0x39')]({},_0x1c7487,_0x9509cb['options']);return _0x417ac4[_0xb490('0x57')](_0x1c7487);}})['then'](function(_0x4ad7f0){if(_0x4ad7f0){_0x52ec1e=_0x4ad7f0[_0xb490('0x42')];if(!_0x9509cb[_0xb490('0x33')][_0xb490('0x53')](_0xb490('0x54'))){_0x1c7487[_0xb490('0x19')]=qs[_0xb490('0x19')](_0x9509cb['query'][_0xb490('0x19')]);_0x1c7487[_0xb490('0x1b')]=qs[_0xb490('0x1b')](_0x9509cb[_0xb490('0x33')]['offset']);}return _0x417ac4[_0xb490('0x57')](_0x1c7487);}})[_0xb490('0x21')](function(_0xd89333){if(_0xd89333){return _0xd89333?{'count':_0x52ec1e,'rows':_0xd89333}:null;}})[_0xb490('0x21')](respondWithResult(_0x1536df,null))[_0xb490('0x45')](handleError(_0x1536df,null));}; \ No newline at end of file +var _0xa2f9=['then','destroy','get','sendStatus','error','name','send','map','Trigger','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','Condition','addAnyCondition','findOne','getAllConditions','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x42f3da,_0x231369){var _0x34e76c=function(_0x3d911a){while(--_0x3d911a){_0x42f3da['push'](_0x42f3da['shift']());}};_0x34e76c(++_0x231369);}(_0xa2f9,0x19a));var _0x9a2f=function(_0x113a7b,_0x3d8bae){_0x113a7b=_0x113a7b-0x0;var _0xa6fedf=_0xa2f9[_0x113a7b];return _0xa6fedf;};'use strict';var emlformat=require(_0x9a2f('0x0'));var rimraf=require(_0x9a2f('0x1'));var zipdir=require(_0x9a2f('0x2'));var jsonpatch=require(_0x9a2f('0x3'));var rp=require(_0x9a2f('0x4'));var moment=require('moment');var BPromise=require(_0x9a2f('0x5'));var Mustache=require(_0x9a2f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9a2f('0x7'));var csv=require(_0x9a2f('0x8'));var ejs=require(_0x9a2f('0x9'));var fs=require('fs');var fs_extra=require(_0x9a2f('0xa'));var _=require('lodash');var squel=require(_0x9a2f('0xb'));var crypto=require(_0x9a2f('0xc'));var jsforce=require(_0x9a2f('0xd'));var deskjs=require(_0x9a2f('0xe'));var toCsv=require(_0x9a2f('0x8'));var querystring=require(_0x9a2f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a2f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a2f('0x11'));var logger=require(_0x9a2f('0x12'))(_0x9a2f('0x13'));var utils=require(_0x9a2f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a2f('0x15'));var db=require(_0x9a2f('0x16'))['db'];function respondWithStatusCode(_0x575b7d,_0x47c775){_0x47c775=_0x47c775||0xcc;return function(_0x643233){if(_0x643233){return _0x575b7d['sendStatus'](_0x47c775);}return _0x575b7d[_0x9a2f('0x17')](_0x47c775)[_0x9a2f('0x18')]();};}function respondWithResult(_0x12a6f1,_0x25df8e){_0x25df8e=_0x25df8e||0xc8;return function(_0xac0a02){if(_0xac0a02){return _0x12a6f1[_0x9a2f('0x17')](_0x25df8e)[_0x9a2f('0x19')](_0xac0a02);}};}function respondWithFilteredResult(_0x16934b,_0x5ce846){return function(_0x46cae8){if(_0x46cae8){var _0x121eff=typeof _0x5ce846[_0x9a2f('0x1a')]===_0x9a2f('0x1b')&&typeof _0x5ce846[_0x9a2f('0x1c')]===_0x9a2f('0x1b');var _0x3ad8f5=_0x46cae8['count'];var _0x487881=_0x121eff?0x0:_0x5ce846[_0x9a2f('0x1a')];var _0x3e12ea=_0x121eff?_0x46cae8[_0x9a2f('0x1d')]:_0x5ce846[_0x9a2f('0x1a')]+_0x5ce846[_0x9a2f('0x1c')];var _0x1bad41;if(_0x3e12ea>=_0x3ad8f5){_0x3e12ea=_0x3ad8f5;_0x1bad41=0xc8;}else{_0x1bad41=0xce;}_0x16934b[_0x9a2f('0x17')](_0x1bad41);return _0x16934b[_0x9a2f('0x1e')](_0x9a2f('0x1f'),_0x487881+'-'+_0x3e12ea+'/'+_0x3ad8f5)[_0x9a2f('0x19')](_0x46cae8);}return null;};}function patchUpdates(_0x4b5a74){return function(_0x2939af){try{jsonpatch[_0x9a2f('0x20')](_0x2939af,_0x4b5a74,!![]);}catch(_0x2cf241){return BPromise['reject'](_0x2cf241);}return _0x2939af[_0x9a2f('0x21')]();};}function saveUpdates(_0x2e1c89,_0x586863){return function(_0xdd542d){if(_0xdd542d){return _0xdd542d[_0x9a2f('0x22')](_0x2e1c89)[_0x9a2f('0x23')](function(_0x2a60ca){return _0x2a60ca;});}return null;};}function removeEntity(_0x36f25a,_0x558873){return function(_0xa93297){if(_0xa93297){return _0xa93297[_0x9a2f('0x24')]()[_0x9a2f('0x23')](function(){var _0x390871=_0xa93297[_0x9a2f('0x25')]({'plain':!![]});var _0x218b96='Triggers';return db['UserProfileResource']['destroy']({'where':{'type':_0x218b96,'resourceId':_0x390871['id']}})[_0x9a2f('0x23')](function(){return _0xa93297;});})[_0x9a2f('0x23')](function(){_0x36f25a['status'](0xcc)[_0x9a2f('0x18')]();});}};}function handleEntityNotFound(_0x59f90c,_0x16cb14){return function(_0x1ced34){if(!_0x1ced34){_0x59f90c[_0x9a2f('0x26')](0x194);}return _0x1ced34;};}function handleError(_0x4a0447,_0x502c5a){_0x502c5a=_0x502c5a||0x1f4;return function(_0x446d69){logger[_0x9a2f('0x27')](_0x446d69['stack']);if(_0x446d69[_0x9a2f('0x28')]){delete _0x446d69[_0x9a2f('0x28')];}_0x4a0447['status'](_0x502c5a)[_0x9a2f('0x29')](_0x446d69);};}exports['index']=function(_0x2164d2,_0x4015b3){var _0x28f536={},_0x720a3={},_0x1415da={'count':0x0,'rows':[]};var _0x6d2255=_[_0x9a2f('0x2a')](db[_0x9a2f('0x2b')][_0x9a2f('0x2c')],function(_0x202fa9){return{'name':_0x202fa9['fieldName'],'type':_0x202fa9['type'][_0x9a2f('0x2d')]};});_0x720a3[_0x9a2f('0x2e')]=_['map'](_0x6d2255,_0x9a2f('0x28'));_0x720a3[_0x9a2f('0x2f')]=_[_0x9a2f('0x30')](_0x2164d2[_0x9a2f('0x2f')]);_0x720a3[_0x9a2f('0x31')]=_[_0x9a2f('0x32')](_0x720a3['model'],_0x720a3[_0x9a2f('0x2f')]);_0x28f536[_0x9a2f('0x33')]=_[_0x9a2f('0x32')](_0x720a3[_0x9a2f('0x2e')],qs['fields'](_0x2164d2[_0x9a2f('0x2f')]['fields']));_0x28f536['attributes']=_0x28f536[_0x9a2f('0x33')][_0x9a2f('0x34')]?_0x28f536[_0x9a2f('0x33')]:_0x720a3[_0x9a2f('0x2e')];if(!_0x2164d2[_0x9a2f('0x2f')][_0x9a2f('0x35')]('nolimit')){_0x28f536[_0x9a2f('0x1c')]=qs[_0x9a2f('0x1c')](_0x2164d2[_0x9a2f('0x2f')][_0x9a2f('0x1c')]);_0x28f536[_0x9a2f('0x1a')]=qs[_0x9a2f('0x1a')](_0x2164d2[_0x9a2f('0x2f')][_0x9a2f('0x1a')]);}_0x28f536[_0x9a2f('0x36')]=qs[_0x9a2f('0x37')](_0x2164d2[_0x9a2f('0x2f')][_0x9a2f('0x37')]);_0x28f536[_0x9a2f('0x38')]=qs[_0x9a2f('0x31')](_[_0x9a2f('0x39')](_0x2164d2['query'],_0x720a3[_0x9a2f('0x31')]),_0x6d2255);if(_0x2164d2['query']['filter']){_0x28f536[_0x9a2f('0x38')]=_['merge'](_0x28f536['where'],{'$or':_[_0x9a2f('0x2a')](_0x6d2255,function(_0x33b83c){if(_0x33b83c['type']!==_0x9a2f('0x3a')){var _0x31d47c={};_0x31d47c[_0x33b83c[_0x9a2f('0x28')]]={'$like':'%'+_0x2164d2[_0x9a2f('0x2f')][_0x9a2f('0x3b')]+'%'};return _0x31d47c;}})});}_0x28f536=_[_0x9a2f('0x3c')]({},_0x28f536,_0x2164d2['options']);var _0x25dd3f={'where':_0x28f536[_0x9a2f('0x38')]};return db[_0x9a2f('0x2b')]['count'](_0x25dd3f)[_0x9a2f('0x23')](function(_0x49cdab){_0x1415da[_0x9a2f('0x1d')]=_0x49cdab;if(_0x2164d2[_0x9a2f('0x2f')][_0x9a2f('0x3d')]){_0x28f536[_0x9a2f('0x3e')]=[{'all':!![]}];}return db[_0x9a2f('0x2b')][_0x9a2f('0x3f')](_0x28f536);})['then'](function(_0x40ce35){_0x1415da[_0x9a2f('0x40')]=_0x40ce35;return _0x1415da;})[_0x9a2f('0x23')](respondWithFilteredResult(_0x4015b3,_0x28f536))[_0x9a2f('0x41')](handleError(_0x4015b3,null));};exports[_0x9a2f('0x42')]=function(_0x312e7d,_0x1fe066){var _0x1337f9={'raw':![],'where':{'id':_0x312e7d[_0x9a2f('0x43')]['id']}},_0x4e1a81={};_0x4e1a81[_0x9a2f('0x2e')]=_[_0x9a2f('0x30')](db[_0x9a2f('0x2b')][_0x9a2f('0x2c')]);_0x4e1a81['query']=_[_0x9a2f('0x30')](_0x312e7d['query']);_0x4e1a81['filters']=_[_0x9a2f('0x32')](_0x4e1a81[_0x9a2f('0x2e')],_0x4e1a81[_0x9a2f('0x2f')]);_0x1337f9['attributes']=_['intersection'](_0x4e1a81[_0x9a2f('0x2e')],qs['fields'](_0x312e7d['query'][_0x9a2f('0x44')]));_0x1337f9[_0x9a2f('0x33')]=_0x1337f9[_0x9a2f('0x33')][_0x9a2f('0x34')]?_0x1337f9[_0x9a2f('0x33')]:_0x4e1a81[_0x9a2f('0x2e')];if(_0x312e7d['query'][_0x9a2f('0x3d')]){_0x1337f9[_0x9a2f('0x3e')]=[{'all':!![]}];}_0x1337f9=_[_0x9a2f('0x3c')]({},_0x1337f9,_0x312e7d[_0x9a2f('0x45')]);return db[_0x9a2f('0x2b')][_0x9a2f('0x46')](_0x1337f9)[_0x9a2f('0x23')](handleEntityNotFound(_0x1fe066,null))[_0x9a2f('0x23')](respondWithResult(_0x1fe066,null))[_0x9a2f('0x41')](handleError(_0x1fe066,null));};exports['create']=function(_0x2f3245,_0x49d7a8){return db[_0x9a2f('0x2b')][_0x9a2f('0x47')](_0x2f3245['body'],{})[_0x9a2f('0x23')](function(_0x573f72){var _0x3a2039=_0x2f3245[_0x9a2f('0x48')]['get']({'plain':!![]});if(!_0x3a2039)throw new Error(_0x9a2f('0x49'));if(_0x3a2039[_0x9a2f('0x4a')]==='user'){var _0x45af0c=_0x573f72['get']({'plain':!![]});var _0x268b4b='Triggers';return db['UserProfileSection'][_0x9a2f('0x46')]({'where':{'name':_0x268b4b,'userProfileId':_0x3a2039['userProfileId']},'raw':!![]})['then'](function(_0x43eec0){if(_0x43eec0&&_0x43eec0['autoAssociation']===0x0){return db[_0x9a2f('0x4b')][_0x9a2f('0x47')]({'name':_0x45af0c['name'],'resourceId':_0x45af0c['id'],'type':_0x43eec0[_0x9a2f('0x28')],'sectionId':_0x43eec0['id']},{})[_0x9a2f('0x23')](function(){return _0x573f72;});}else{return _0x573f72;}})[_0x9a2f('0x41')](function(_0x2b8bdd){logger[_0x9a2f('0x27')](_0x9a2f('0x4c'),_0x2b8bdd);throw _0x2b8bdd;});}return _0x573f72;})['then'](respondWithResult(_0x49d7a8,0xc9))['catch'](handleError(_0x49d7a8,null));};exports['update']=function(_0xf0b3ae,_0xba0be2){if(_0xf0b3ae[_0x9a2f('0x4d')]['id']){delete _0xf0b3ae['body']['id'];}return db[_0x9a2f('0x2b')][_0x9a2f('0x46')]({'where':{'id':_0xf0b3ae[_0x9a2f('0x43')]['id']}})[_0x9a2f('0x23')](handleEntityNotFound(_0xba0be2,null))[_0x9a2f('0x23')](saveUpdates(_0xf0b3ae['body'],null))[_0x9a2f('0x23')](respondWithResult(_0xba0be2,null))[_0x9a2f('0x41')](handleError(_0xba0be2,null));};exports[_0x9a2f('0x24')]=function(_0x3fe3c3,_0x978ba4){return db[_0x9a2f('0x2b')]['find']({'where':{'id':_0x3fe3c3['params']['id']}})[_0x9a2f('0x23')](handleEntityNotFound(_0x978ba4,null))[_0x9a2f('0x23')](removeEntity(_0x978ba4,null))[_0x9a2f('0x41')](handleError(_0x978ba4,null));};exports[_0x9a2f('0x4e')]=function(_0x2dacad,_0x4e6588,_0x5c7450){if(_0x2dacad['body']['id']){delete _0x2dacad[_0x9a2f('0x4d')]['id'];}return db[_0x9a2f('0x2b')]['find']({'where':{'id':_0x2dacad[_0x9a2f('0x43')]['id']}})[_0x9a2f('0x23')](handleEntityNotFound(_0x4e6588,null))[_0x9a2f('0x23')](function(_0x3f9a07){if(_0x3f9a07){_0x2dacad['body']['TriggerAllId']=_0x3f9a07['id'];return db[_0x9a2f('0x4f')][_0x9a2f('0x47')](_0x2dacad[_0x9a2f('0x4d')]);}})[_0x9a2f('0x23')](respondWithResult(_0x4e6588,null))[_0x9a2f('0x41')](handleError(_0x4e6588,null));};exports[_0x9a2f('0x50')]=function(_0x54c9b7,_0x19c9f8,_0x708dfc){if(_0x54c9b7[_0x9a2f('0x4d')]['id']){delete _0x54c9b7[_0x9a2f('0x4d')]['id'];}return db['Trigger'][_0x9a2f('0x46')]({'where':{'id':_0x54c9b7[_0x9a2f('0x43')]['id']}})[_0x9a2f('0x23')](handleEntityNotFound(_0x19c9f8,null))[_0x9a2f('0x23')](function(_0xe0dd4a){if(_0xe0dd4a){_0x54c9b7['body']['TriggerAnyId']=_0xe0dd4a['id'];return db[_0x9a2f('0x4f')][_0x9a2f('0x47')](_0x54c9b7[_0x9a2f('0x4d')]);}})[_0x9a2f('0x23')](respondWithResult(_0x19c9f8,null))[_0x9a2f('0x41')](handleError(_0x19c9f8,null));};exports['getAllConditions']=function(_0x5329fb,_0x5c8ce0,_0x50633d){var _0x1a33d7={};var _0x2dc837={};var _0x148561;var _0x523408;return db[_0x9a2f('0x2b')][_0x9a2f('0x51')]({'where':{'id':_0x5329fb[_0x9a2f('0x43')]['id']}})[_0x9a2f('0x23')](handleEntityNotFound(_0x5c8ce0,null))['then'](function(_0x8ed036){if(_0x8ed036){_0x148561=_0x8ed036;_0x2dc837[_0x9a2f('0x2e')]=_[_0x9a2f('0x30')](db[_0x9a2f('0x4f')]['rawAttributes']);_0x2dc837[_0x9a2f('0x2f')]=_['keys'](_0x5329fb['query']);_0x2dc837[_0x9a2f('0x31')]=_[_0x9a2f('0x32')](_0x2dc837['model'],_0x2dc837[_0x9a2f('0x2f')]);_0x1a33d7[_0x9a2f('0x33')]=_[_0x9a2f('0x32')](_0x2dc837[_0x9a2f('0x2e')],qs['fields'](_0x5329fb[_0x9a2f('0x2f')][_0x9a2f('0x44')]));_0x1a33d7[_0x9a2f('0x33')]=_0x1a33d7['attributes']['length']?_0x1a33d7[_0x9a2f('0x33')]:_0x2dc837[_0x9a2f('0x2e')];_0x1a33d7[_0x9a2f('0x36')]=qs[_0x9a2f('0x37')](_0x5329fb[_0x9a2f('0x2f')][_0x9a2f('0x37')]);_0x1a33d7['where']=qs['filters'](_['pick'](_0x5329fb[_0x9a2f('0x2f')],_0x2dc837[_0x9a2f('0x31')]));if(_0x5329fb['query']['filter']){_0x1a33d7[_0x9a2f('0x38')]=_['merge'](_0x1a33d7[_0x9a2f('0x38')],{'$or':_['map'](_0x1a33d7[_0x9a2f('0x33')],function(_0x14b335){var _0x51d0a1={};_0x51d0a1[_0x14b335]={'$like':'%'+_0x5329fb[_0x9a2f('0x2f')][_0x9a2f('0x3b')]+'%'};return _0x51d0a1;})});}_0x1a33d7=_[_0x9a2f('0x3c')]({},_0x1a33d7,_0x5329fb[_0x9a2f('0x45')]);return _0x148561['getAllConditions'](_0x1a33d7);}})[_0x9a2f('0x23')](function(_0x27a42e){if(_0x27a42e){_0x523408=_0x27a42e['length'];if(!_0x5329fb[_0x9a2f('0x2f')]['hasOwnProperty']('nolimit')){_0x1a33d7['limit']=qs[_0x9a2f('0x1c')](_0x5329fb[_0x9a2f('0x2f')][_0x9a2f('0x1c')]);_0x1a33d7[_0x9a2f('0x1a')]=qs[_0x9a2f('0x1a')](_0x5329fb[_0x9a2f('0x2f')]['offset']);}return _0x148561[_0x9a2f('0x52')](_0x1a33d7);}})['then'](function(_0x3e83a0){if(_0x3e83a0){return _0x3e83a0?{'count':_0x523408,'rows':_0x3e83a0}:null;}})[_0x9a2f('0x23')](respondWithResult(_0x5c8ce0,null))[_0x9a2f('0x41')](handleError(_0x5c8ce0,null));};exports['getAnyConditions']=function(_0x102635,_0x265c91,_0x505822){var _0x386327={};var _0x1790f3={};var _0x5dea66;var _0x1d7916;return db['Trigger'][_0x9a2f('0x51')]({'where':{'id':_0x102635[_0x9a2f('0x43')]['id']}})[_0x9a2f('0x23')](handleEntityNotFound(_0x265c91,null))[_0x9a2f('0x23')](function(_0x47906c){if(_0x47906c){_0x5dea66=_0x47906c;_0x1790f3['model']=_['keys'](db[_0x9a2f('0x4f')]['rawAttributes']);_0x1790f3[_0x9a2f('0x2f')]=_['keys'](_0x102635[_0x9a2f('0x2f')]);_0x1790f3['filters']=_[_0x9a2f('0x32')](_0x1790f3[_0x9a2f('0x2e')],_0x1790f3['query']);_0x386327[_0x9a2f('0x33')]=_['intersection'](_0x1790f3[_0x9a2f('0x2e')],qs['fields'](_0x102635['query']['fields']));_0x386327[_0x9a2f('0x33')]=_0x386327[_0x9a2f('0x33')]['length']?_0x386327[_0x9a2f('0x33')]:_0x1790f3[_0x9a2f('0x2e')];_0x386327[_0x9a2f('0x36')]=qs[_0x9a2f('0x37')](_0x102635[_0x9a2f('0x2f')][_0x9a2f('0x37')]);_0x386327[_0x9a2f('0x38')]=qs['filters'](_[_0x9a2f('0x39')](_0x102635[_0x9a2f('0x2f')],_0x1790f3[_0x9a2f('0x31')]));if(_0x102635[_0x9a2f('0x2f')][_0x9a2f('0x3b')]){_0x386327['where']=_[_0x9a2f('0x3c')](_0x386327[_0x9a2f('0x38')],{'$or':_['map'](_0x386327[_0x9a2f('0x33')],function(_0x4166b5){var _0x2f7ece={};_0x2f7ece[_0x4166b5]={'$like':'%'+_0x102635['query'][_0x9a2f('0x3b')]+'%'};return _0x2f7ece;})});}_0x386327=_[_0x9a2f('0x3c')]({},_0x386327,_0x102635[_0x9a2f('0x45')]);return _0x5dea66['getAnyConditions'](_0x386327);}})[_0x9a2f('0x23')](function(_0x459147){if(_0x459147){_0x1d7916=_0x459147[_0x9a2f('0x34')];if(!_0x102635[_0x9a2f('0x2f')][_0x9a2f('0x35')](_0x9a2f('0x53'))){_0x386327[_0x9a2f('0x1c')]=qs[_0x9a2f('0x1c')](_0x102635[_0x9a2f('0x2f')][_0x9a2f('0x1c')]);_0x386327[_0x9a2f('0x1a')]=qs[_0x9a2f('0x1a')](_0x102635[_0x9a2f('0x2f')][_0x9a2f('0x1a')]);}return _0x5dea66[_0x9a2f('0x54')](_0x386327);}})[_0x9a2f('0x23')](function(_0x43e33e){if(_0x43e33e){return _0x43e33e?{'count':_0x1d7916,'rows':_0x43e33e}:null;}})[_0x9a2f('0x23')](respondWithResult(_0x265c91,null))[_0x9a2f('0x41')](handleError(_0x265c91,null));};exports[_0x9a2f('0x55')]=function(_0x140efb,_0x4fa7a9,_0x2f0a3f){if(_0x140efb['body']['id']){delete _0x140efb[_0x9a2f('0x4d')]['id'];}return db[_0x9a2f('0x2b')]['find']({'where':{'id':_0x140efb[_0x9a2f('0x43')]['id']}})[_0x9a2f('0x23')](handleEntityNotFound(_0x4fa7a9,null))[_0x9a2f('0x23')](function(_0x686341){if(_0x686341){_0x140efb[_0x9a2f('0x4d')][_0x9a2f('0x56')]=_0x686341['id'];return db[_0x9a2f('0x57')]['create'](_0x140efb['body']);}})[_0x9a2f('0x23')](respondWithResult(_0x4fa7a9,null))['catch'](handleError(_0x4fa7a9,null));};exports[_0x9a2f('0x58')]=function(_0x2c5ad1,_0xb5c297,_0xcb47ae){var _0x4a5c45={};var _0x507310={};var _0xb34046;var _0x2c412e;return db[_0x9a2f('0x2b')][_0x9a2f('0x51')]({'where':{'id':_0x2c5ad1['params']['id']}})['then'](handleEntityNotFound(_0xb5c297,null))[_0x9a2f('0x23')](function(_0x33e301){if(_0x33e301){_0xb34046=_0x33e301;_0x507310['model']=_[_0x9a2f('0x30')](db['Action'][_0x9a2f('0x2c')]);_0x507310[_0x9a2f('0x2f')]=_['keys'](_0x2c5ad1[_0x9a2f('0x2f')]);_0x507310[_0x9a2f('0x31')]=_[_0x9a2f('0x32')](_0x507310[_0x9a2f('0x2e')],_0x507310['query']);_0x4a5c45[_0x9a2f('0x33')]=_[_0x9a2f('0x32')](_0x507310[_0x9a2f('0x2e')],qs[_0x9a2f('0x44')](_0x2c5ad1[_0x9a2f('0x2f')][_0x9a2f('0x44')]));_0x4a5c45[_0x9a2f('0x33')]=_0x4a5c45['attributes'][_0x9a2f('0x34')]?_0x4a5c45[_0x9a2f('0x33')]:_0x507310[_0x9a2f('0x2e')];_0x4a5c45[_0x9a2f('0x36')]=qs['sort'](_0x2c5ad1[_0x9a2f('0x2f')]['sort']);_0x4a5c45[_0x9a2f('0x38')]=qs['filters'](_[_0x9a2f('0x39')](_0x2c5ad1[_0x9a2f('0x2f')],_0x507310[_0x9a2f('0x31')]));if(_0x2c5ad1[_0x9a2f('0x2f')][_0x9a2f('0x3b')]){_0x4a5c45[_0x9a2f('0x38')]=_[_0x9a2f('0x3c')](_0x4a5c45['where'],{'$or':_[_0x9a2f('0x2a')](_0x4a5c45[_0x9a2f('0x33')],function(_0x1d764a){var _0x593a6b={};_0x593a6b[_0x1d764a]={'$like':'%'+_0x2c5ad1['query'][_0x9a2f('0x3b')]+'%'};return _0x593a6b;})});}_0x4a5c45=_[_0x9a2f('0x3c')]({},_0x4a5c45,_0x2c5ad1[_0x9a2f('0x45')]);return _0xb34046[_0x9a2f('0x58')](_0x4a5c45);}})[_0x9a2f('0x23')](function(_0x88b9ab){if(_0x88b9ab){_0x2c412e=_0x88b9ab[_0x9a2f('0x34')];if(!_0x2c5ad1['query'][_0x9a2f('0x35')](_0x9a2f('0x53'))){_0x4a5c45[_0x9a2f('0x1c')]=qs['limit'](_0x2c5ad1[_0x9a2f('0x2f')][_0x9a2f('0x1c')]);_0x4a5c45[_0x9a2f('0x1a')]=qs[_0x9a2f('0x1a')](_0x2c5ad1['query'][_0x9a2f('0x1a')]);}return _0xb34046[_0x9a2f('0x58')](_0x4a5c45);}})['then'](function(_0xdfc9a8){if(_0xdfc9a8){return _0xdfc9a8?{'count':_0x2c412e,'rows':_0xdfc9a8}:null;}})[_0x9a2f('0x23')](respondWithResult(_0xb5c297,null))[_0x9a2f('0x41')](handleError(_0xb5c297,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 84d6ad0..9ce0520 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 _0x13c0=['define','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x2c12f3,_0x505cbd){var _0x5735bd=function(_0x3ef447){while(--_0x3ef447){_0x2c12f3['push'](_0x2c12f3['shift']());}};_0x5735bd(++_0x505cbd);}(_0x13c0,0x79));var _0x013c=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x13c0[_0x5806c3];return _0x48ac77;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var logger=require(_0x013c('0x2'))(_0x013c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x013c('0x4'));var rimraf=require(_0x013c('0x5'));var config=require(_0x013c('0x6'));var attributes=require(_0x013c('0x7'));module[_0x013c('0x8')]=function(_0x12d78e,_0x1142f4){return _0x12d78e[_0x013c('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee2=['../../config/logger','api','moment','request-promise','path','./trigger.attributes','exports','Trigger','tools_triggers','lodash','util'];(function(_0x378f31,_0x5db48c){var _0x135bbc=function(_0x50dfe1){while(--_0x50dfe1){_0x378f31['push'](_0x378f31['shift']());}};_0x135bbc(++_0x5db48c);}(_0x1ee2,0x11c));var _0x21ee=function(_0x1660ca,_0x488a5e){_0x1660ca=_0x1660ca-0x0;var _0x1c5686=_0x1ee2[_0x1660ca];return _0x1c5686;};'use strict';var _=require(_0x21ee('0x0'));var util=require(_0x21ee('0x1'));var logger=require(_0x21ee('0x2'))(_0x21ee('0x3'));var moment=require(_0x21ee('0x4'));var BPromise=require('bluebird');var rp=require(_0x21ee('0x5'));var fs=require('fs');var path=require(_0x21ee('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x21ee('0x7'));module[_0x21ee('0x8')]=function(_0x221a30,_0x20a492){return _0x221a30['define'](_0x21ee('0x9'),attributes,{'tableName':_0x21ee('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 08ebf1f..8de05cc 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 _0xa3b3=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','code','error','Trigger,\x20%s,\x20%s','message','catch','GetTrigger','Trigger','options','where','attributes','limit','map','include','model','ShowTrigger','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x22bbfb,_0x15da21){var _0x47b2de=function(_0x56dc1f){while(--_0x56dc1f){_0x22bbfb['push'](_0x22bbfb['shift']());}};_0x47b2de(++_0x15da21);}(_0xa3b3,0x1e1));var _0x3a3b=function(_0x5cd864,_0x307eb2){_0x5cd864=_0x5cd864-0x0;var _0x514bfa=_0xa3b3[_0x5cd864];return _0x514bfa;};'use strict';var _=require(_0x3a3b('0x0'));var util=require(_0x3a3b('0x1'));var moment=require(_0x3a3b('0x2'));var BPromise=require(_0x3a3b('0x3'));var rs=require(_0x3a3b('0x4'));var fs=require('fs');var Redis=require(_0x3a3b('0x5'));var db=require(_0x3a3b('0x6'))['db'];var utils=require(_0x3a3b('0x7'));var logger=require('../../config/logger')(_0x3a3b('0x8'));var config=require(_0x3a3b('0x9'));var jayson=require(_0x3a3b('0xa'));var client=jayson[_0x3a3b('0xb')][_0x3a3b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56af3b,_0x5750ea,_0x5e1d67){return new BPromise(function(_0x4576c5,_0x513b28){return client[_0x3a3b('0xd')](_0x56af3b,_0x5e1d67)[_0x3a3b('0xe')](function(_0x273299){logger[_0x3a3b('0xf')]('Trigger,\x20%s,\x20%s',_0x5750ea,_0x3a3b('0x10'));logger[_0x3a3b('0x11')]('Trigger,\x20%s,\x20%s,\x20%s',_0x5750ea,'request\x20sent',JSON['stringify'](_0x273299));if(_0x273299['error']){if(_0x273299['error'][_0x3a3b('0x12')]===0x1f4){logger[_0x3a3b('0x13')](_0x3a3b('0x14'),_0x5750ea,_0x273299[_0x3a3b('0x13')][_0x3a3b('0x15')]);return _0x513b28(_0x273299[_0x3a3b('0x13')][_0x3a3b('0x15')]);}logger['error'](_0x3a3b('0x14'),_0x5750ea,_0x273299[_0x3a3b('0x13')][_0x3a3b('0x15')]);return _0x4576c5(_0x273299[_0x3a3b('0x13')]['message']);}else{logger[_0x3a3b('0xf')](_0x3a3b('0x14'),_0x5750ea,_0x3a3b('0x10'));_0x4576c5(_0x273299['result']['message']);}})[_0x3a3b('0x16')](function(_0x1e17e0){logger[_0x3a3b('0x13')](_0x3a3b('0x14'),_0x5750ea,_0x1e17e0);_0x513b28(_0x1e17e0);});});}exports[_0x3a3b('0x17')]=function(_0x1c697b){var _0x34479f=this;return new Promise(function(_0x1807c2,_0x235cd4){return db[_0x3a3b('0x18')]['findAll']({'raw':_0x1c697b[_0x3a3b('0x19')]?_0x1c697b[_0x3a3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1c697b[_0x3a3b('0x19')]?_0x1c697b[_0x3a3b('0x19')][_0x3a3b('0x1a')]||null:null,'attributes':_0x1c697b[_0x3a3b('0x19')]?_0x1c697b[_0x3a3b('0x19')][_0x3a3b('0x1b')]||null:null,'limit':_0x1c697b['options']?_0x1c697b[_0x3a3b('0x19')][_0x3a3b('0x1c')]||null:null,'include':_0x1c697b[_0x3a3b('0x19')]?_0x1c697b[_0x3a3b('0x19')]['include']?_[_0x3a3b('0x1d')](_0x1c697b['options'][_0x3a3b('0x1e')],function(_0x42ea6c){return{'model':db[_0x42ea6c[_0x3a3b('0x1f')]],'as':_0x42ea6c['as'],'attributes':_0x42ea6c[_0x3a3b('0x1b')],'include':_0x42ea6c['include']?_[_0x3a3b('0x1d')](_0x42ea6c[_0x3a3b('0x1e')],function(_0x40adcc){return{'model':db[_0x40adcc[_0x3a3b('0x1f')]],'as':_0x40adcc['as'],'attributes':_0x40adcc['attributes'],'include':_0x40adcc[_0x3a3b('0x1e')]?_[_0x3a3b('0x1d')](_0x40adcc[_0x3a3b('0x1e')],function(_0x58716e){return{'model':db[_0x58716e['model']],'as':_0x58716e['as'],'attributes':_0x58716e['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a3b('0xe')](function(_0x1cabab){logger[_0x3a3b('0xf')]('GetTrigger',_0x1c697b);logger[_0x3a3b('0x11')](_0x3a3b('0x17'),_0x1c697b,JSON['stringify'](_0x1cabab));_0x1807c2(_0x1cabab);})[_0x3a3b('0x16')](function(_0x230286){logger['error'](_0x3a3b('0x17'),_0x230286['message'],_0x1c697b);_0x235cd4(_0x34479f[_0x3a3b('0x13')](0x1f4,_0x230286[_0x3a3b('0x15')]));});});};exports[_0x3a3b('0x20')]=function(_0x5af207){var _0x2aa4e7=this;return new Promise(function(_0x3f70aa,_0x2a8b5b){return db[_0x3a3b('0x18')]['find']({'raw':_0x5af207[_0x3a3b('0x19')]?_0x5af207[_0x3a3b('0x19')][_0x3a3b('0x21')]===undefined?!![]:![]:!![],'where':_0x5af207[_0x3a3b('0x19')]?_0x5af207[_0x3a3b('0x19')][_0x3a3b('0x1a')]||null:null,'attributes':_0x5af207[_0x3a3b('0x19')]?_0x5af207[_0x3a3b('0x19')][_0x3a3b('0x1b')]||null:null,'include':_0x5af207[_0x3a3b('0x19')]?_0x5af207[_0x3a3b('0x19')][_0x3a3b('0x1e')]?_[_0x3a3b('0x1d')](_0x5af207[_0x3a3b('0x19')][_0x3a3b('0x1e')],function(_0x2e900b){return{'model':db[_0x2e900b['model']],'as':_0x2e900b['as'],'attributes':_0x2e900b[_0x3a3b('0x1b')],'include':_0x2e900b[_0x3a3b('0x1e')]?_['map'](_0x2e900b[_0x3a3b('0x1e')],function(_0x4739a){return{'model':db[_0x4739a['model']],'as':_0x4739a['as'],'attributes':_0x4739a['attributes'],'include':_0x4739a['include']?_[_0x3a3b('0x1d')](_0x4739a['include'],function(_0x528905){return{'model':db[_0x528905[_0x3a3b('0x1f')]],'as':_0x528905['as'],'attributes':_0x528905[_0x3a3b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3a3b('0xe')](function(_0x355b68){logger[_0x3a3b('0xf')](_0x3a3b('0x20'),_0x5af207);logger[_0x3a3b('0x11')](_0x3a3b('0x20'),_0x5af207,JSON[_0x3a3b('0x22')](_0x355b68));_0x3f70aa(_0x355b68);})[_0x3a3b('0x16')](function(_0x415457){logger['error'](_0x3a3b('0x20'),_0x415457[_0x3a3b('0x15')],_0x5af207);_0x2a8b5b(_0x2aa4e7[_0x3a3b('0x13')](0x1f4,_0x415457[_0x3a3b('0x15')]));});});}; \ No newline at end of file +var _0x1ccb=['find','raw','where','ShowTrigger','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrigger','findAll','options','attributes','limit','map','include','model','catch','Trigger'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1ccb,0x1d9));var _0xb1cc=function(_0x43ad2d,_0x2b03f7){_0x43ad2d=_0x43ad2d-0x0;var _0x3ade44=_0x1ccb[_0x43ad2d];return _0x3ade44;};'use strict';var _=require(_0xb1cc('0x0'));var util=require(_0xb1cc('0x1'));var moment=require(_0xb1cc('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1cc('0x3'));var fs=require('fs');var Redis=require(_0xb1cc('0x4'));var db=require(_0xb1cc('0x5'))['db'];var utils=require(_0xb1cc('0x6'));var logger=require(_0xb1cc('0x7'))(_0xb1cc('0x8'));var config=require(_0xb1cc('0x9'));var jayson=require(_0xb1cc('0xa'));var client=jayson[_0xb1cc('0xb')][_0xb1cc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac6dc,_0x347a94,_0xbe394c){return new BPromise(function(_0x3c2c43,_0x2b3083){return client[_0xb1cc('0xd')](_0x2ac6dc,_0xbe394c)[_0xb1cc('0xe')](function(_0x32fe8f){logger[_0xb1cc('0xf')](_0xb1cc('0x10'),_0x347a94,_0xb1cc('0x11'));logger[_0xb1cc('0x12')](_0xb1cc('0x13'),_0x347a94,_0xb1cc('0x11'),JSON['stringify'](_0x32fe8f));if(_0x32fe8f['error']){if(_0x32fe8f[_0xb1cc('0x14')][_0xb1cc('0x15')]===0x1f4){logger[_0xb1cc('0x14')](_0xb1cc('0x10'),_0x347a94,_0x32fe8f['error'][_0xb1cc('0x16')]);return _0x2b3083(_0x32fe8f['error'][_0xb1cc('0x16')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x347a94,_0x32fe8f[_0xb1cc('0x14')][_0xb1cc('0x16')]);return _0x3c2c43(_0x32fe8f[_0xb1cc('0x14')][_0xb1cc('0x16')]);}else{logger[_0xb1cc('0xf')](_0xb1cc('0x10'),_0x347a94,_0xb1cc('0x11'));_0x3c2c43(_0x32fe8f[_0xb1cc('0x17')][_0xb1cc('0x16')]);}})['catch'](function(_0x20f4bd){logger[_0xb1cc('0x14')](_0xb1cc('0x10'),_0x347a94,_0x20f4bd);_0x2b3083(_0x20f4bd);});});}exports[_0xb1cc('0x18')]=function(_0x75a8ed){var _0x39989c=this;return new Promise(function(_0x2a2882,_0x587e7b){return db['Trigger'][_0xb1cc('0x19')]({'raw':_0x75a8ed[_0xb1cc('0x1a')]?_0x75a8ed['options']['raw']===undefined?!![]:![]:!![],'where':_0x75a8ed[_0xb1cc('0x1a')]?_0x75a8ed[_0xb1cc('0x1a')]['where']||null:null,'attributes':_0x75a8ed[_0xb1cc('0x1a')]?_0x75a8ed[_0xb1cc('0x1a')][_0xb1cc('0x1b')]||null:null,'limit':_0x75a8ed[_0xb1cc('0x1a')]?_0x75a8ed[_0xb1cc('0x1a')][_0xb1cc('0x1c')]||null:null,'include':_0x75a8ed[_0xb1cc('0x1a')]?_0x75a8ed['options']['include']?_[_0xb1cc('0x1d')](_0x75a8ed[_0xb1cc('0x1a')]['include'],function(_0x1cb6d5){return{'model':db[_0x1cb6d5['model']],'as':_0x1cb6d5['as'],'attributes':_0x1cb6d5[_0xb1cc('0x1b')],'include':_0x1cb6d5[_0xb1cc('0x1e')]?_[_0xb1cc('0x1d')](_0x1cb6d5['include'],function(_0x1c201c){return{'model':db[_0x1c201c[_0xb1cc('0x1f')]],'as':_0x1c201c['as'],'attributes':_0x1c201c[_0xb1cc('0x1b')],'include':_0x1c201c[_0xb1cc('0x1e')]?_[_0xb1cc('0x1d')](_0x1c201c[_0xb1cc('0x1e')],function(_0x4075e8){return{'model':db[_0x4075e8[_0xb1cc('0x1f')]],'as':_0x4075e8['as'],'attributes':_0x4075e8[_0xb1cc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7fac4f){logger['info'](_0xb1cc('0x18'),_0x75a8ed);logger['debug']('GetTrigger',_0x75a8ed,JSON['stringify'](_0x7fac4f));_0x2a2882(_0x7fac4f);})[_0xb1cc('0x20')](function(_0xdbf754){logger[_0xb1cc('0x14')](_0xb1cc('0x18'),_0xdbf754[_0xb1cc('0x16')],_0x75a8ed);_0x587e7b(_0x39989c['error'](0x1f4,_0xdbf754[_0xb1cc('0x16')]));});});};exports['ShowTrigger']=function(_0x17002d){var _0x362633=this;return new Promise(function(_0x20b503,_0x5d5e1a){return db[_0xb1cc('0x21')][_0xb1cc('0x22')]({'raw':_0x17002d[_0xb1cc('0x1a')]?_0x17002d[_0xb1cc('0x1a')][_0xb1cc('0x23')]===undefined?!![]:![]:!![],'where':_0x17002d[_0xb1cc('0x1a')]?_0x17002d[_0xb1cc('0x1a')][_0xb1cc('0x24')]||null:null,'attributes':_0x17002d[_0xb1cc('0x1a')]?_0x17002d[_0xb1cc('0x1a')][_0xb1cc('0x1b')]||null:null,'include':_0x17002d[_0xb1cc('0x1a')]?_0x17002d['options'][_0xb1cc('0x1e')]?_[_0xb1cc('0x1d')](_0x17002d[_0xb1cc('0x1a')][_0xb1cc('0x1e')],function(_0x3b70e3){return{'model':db[_0x3b70e3[_0xb1cc('0x1f')]],'as':_0x3b70e3['as'],'attributes':_0x3b70e3[_0xb1cc('0x1b')],'include':_0x3b70e3[_0xb1cc('0x1e')]?_[_0xb1cc('0x1d')](_0x3b70e3['include'],function(_0x16f125){return{'model':db[_0x16f125[_0xb1cc('0x1f')]],'as':_0x16f125['as'],'attributes':_0x16f125[_0xb1cc('0x1b')],'include':_0x16f125['include']?_[_0xb1cc('0x1d')](_0x16f125['include'],function(_0xeb7fb2){return{'model':db[_0xeb7fb2[_0xb1cc('0x1f')]],'as':_0xeb7fb2['as'],'attributes':_0xeb7fb2[_0xb1cc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x298a20){logger[_0xb1cc('0xf')](_0xb1cc('0x25'),_0x17002d);logger[_0xb1cc('0x12')]('ShowTrigger',_0x17002d,JSON[_0xb1cc('0x26')](_0x298a20));_0x20b503(_0x298a20);})['catch'](function(_0x4cf652){logger[_0xb1cc('0x14')](_0xb1cc('0x25'),_0x4cf652[_0xb1cc('0x16')],_0x17002d);_0x5d5e1a(_0x362633['error'](0x1f4,_0x4cf652['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ab9c928..ce91829 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 _0x6f78=['/:id/clone','isAuthenticated','clone','create','put','delete','/:id','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','get','index','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f78,0x129));var _0x86f7=function(_0x4744e1,_0x3b0afd){_0x4744e1=_0x4744e1-0x0;var _0x3ab7cd=_0x6f78[_0x4744e1];return _0x3ab7cd;};'use strict';var multer=require(_0x86f7('0x0'));var util=require(_0x86f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x86f7('0x2'));var router=express[_0x86f7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86f7('0x4'));var config=require(_0x86f7('0x5'));var controller=require('./trunk.controller');router[_0x86f7('0x6')]('/',auth['isAuthenticated'](),controller[_0x86f7('0x7')]);router[_0x86f7('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x86f7('0x8')](_0x86f7('0x9'),auth[_0x86f7('0xa')](),controller[_0x86f7('0xb')]);router['post']('/',auth[_0x86f7('0xa')](),controller[_0x86f7('0xc')]);router[_0x86f7('0xd')]('/:id',auth[_0x86f7('0xa')](),controller['update']);router[_0x86f7('0xe')](_0x86f7('0xf'),auth[_0x86f7('0xa')](),controller['destroy']);module[_0x86f7('0x10')]=router; \ No newline at end of file +var _0x9361=['clone','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','/:id/clone'];(function(_0x4f75c8,_0x4ef999){var _0x3e75ff=function(_0x32a9fe){while(--_0x32a9fe){_0x4f75c8['push'](_0x4f75c8['shift']());}};_0x3e75ff(++_0x4ef999);}(_0x9361,0x146));var _0x1936=function(_0x3f2a7d,_0x56b51d){_0x3f2a7d=_0x3f2a7d-0x0;var _0xce213d=_0x9361[_0x3f2a7d];return _0xce213d;};'use strict';var multer=require(_0x1936('0x0'));var util=require(_0x1936('0x1'));var path=require('path');var timeout=require(_0x1936('0x2'));var express=require(_0x1936('0x3'));var router=express[_0x1936('0x4')]();var fs_extra=require(_0x1936('0x5'));var auth=require(_0x1936('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1936('0x7'));var controller=require(_0x1936('0x8'));router[_0x1936('0x9')]('/',auth[_0x1936('0xa')](),controller[_0x1936('0xb')]);router[_0x1936('0x9')](_0x1936('0xc'),auth['isAuthenticated'](),controller['show']);router['post'](_0x1936('0xd'),auth['isAuthenticated'](),controller[_0x1936('0xe')]);router[_0x1936('0xf')]('/',auth['isAuthenticated'](),controller[_0x1936('0x10')]);router['put'](_0x1936('0xc'),auth[_0x1936('0xa')](),controller[_0x1936('0x11')]);router[_0x1936('0x12')](_0x1936('0xc'),auth[_0x1936('0xa')](),controller[_0x1936('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4b366b3..12ffd72 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 _0xb65d=['refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','getDataValue','split','rfc2833','info','inband','auto','nonat','outgoing','force_rport,comedia','nat','join','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','never','INTEGER','\x22\x22\x20<>','always','accept'];(function(_0xab7a76,_0x270a8f){var _0x5bd357=function(_0x114fbd){while(--_0x114fbd){_0xab7a76['push'](_0xab7a76['shift']());}};_0x5bd357(++_0x270a8f);}(_0xb65d,0x1c6));var _0xdb65=function(_0x47f3ec,_0x5661a2){_0x47f3ec=_0x47f3ec-0x0;var _0x16d9a4=_0xb65d[_0x47f3ec];return _0x16d9a4;};'use strict';var Sequelize=require(_0xdb65('0x0'));module[_0xdb65('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdb65('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdb65('0x3')]('friend',_0xdb65('0x4'),_0xdb65('0x5')),'allowNull':![],'defaultValue':_0xdb65('0x6')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdb65('0x7')},'callingpres':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x8'),'ALLOWED_PASSED_SCREEN',_0xdb65('0x9'),_0xdb65('0xa'),'PROHIB_NOT_SCREENED',_0xdb65('0xb'),_0xdb65('0xc'),_0xdb65('0xd'))},'deny':{'type':Sequelize[_0xdb65('0xe')]},'permit':{'type':Sequelize[_0xdb65('0xe')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xdb65('0xe')]},'remotesecret':{'type':Sequelize[_0xdb65('0xe')]},'transport':{'type':Sequelize[_0xdb65('0xe')],'defaultValue':_0xdb65('0xf'),'set':function(_0x4678d0){this[_0xdb65('0x10')](_0xdb65('0x11'),_0x4678d0?_0x4678d0['join'](','):null);},'get':function(){return this[_0xdb65('0x12')](_0xdb65('0x11'))?this[_0xdb65('0x12')](_0xdb65('0x11'))[_0xdb65('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x14'),_0xdb65('0x15'),'shortinfo',_0xdb65('0x16'),_0xdb65('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xdb65('0x3')]('yes','no',_0xdb65('0x18'),'update',_0xdb65('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdb65('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdb65('0xe')]},'directmediadeny':{'type':Sequelize[_0xdb65('0xe')]},'nat':{'type':Sequelize[_0xdb65('0xe')],'defaultValue':_0xdb65('0x1a'),'set':function(_0x460dc6){this[_0xdb65('0x10')](_0xdb65('0x1b'),_0x460dc6?_0x460dc6[_0xdb65('0x1c')](','):null);},'get':function(){return this[_0xdb65('0x12')](_0xdb65('0x1b'))?this[_0xdb65('0x12')](_0xdb65('0x1b'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xdb65('0xe')]},'namedcallgroup':{'type':Sequelize[_0xdb65('0xe')]},'pickupgroup':{'type':Sequelize[_0xdb65('0xe')]},'namedpickupgroup':{'type':Sequelize[_0xdb65('0xe')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xdb65('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdb65('0x1e'),'set':function(_0x5ca349){this['setDataValue'](_0xdb65('0x1f'),_0x5ca349?_0x5ca349['join'](';'):_0xdb65('0x1e'));},'get':function(){return this['getDataValue'](_0xdb65('0x1f'))?this[_0xdb65('0x12')]('allow')['split'](';'):null;},'comment':_0xdb65('0x20')},'autoframing':{'type':Sequelize[_0xdb65('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0xdb65('0xe')],'defaultValue':'port,invite','set':function(_0x2588eb){this[_0xdb65('0x10')](_0xdb65('0x21'),_0x2588eb?_0x2588eb[_0xdb65('0x1c')](','):null);},'get':function(){return this[_0xdb65('0x12')](_0xdb65('0x21'))?this[_0xdb65('0x12')]('insecure')['split'](','):null;},'comment':_0xdb65('0x22')},'trustrpid':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdb65('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no',_0xdb65('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0xdb65('0x23'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xdb65('0x23'),'no')},'accountcode':{'type':Sequelize[_0xdb65('0x25')](0xb)},'setvar':{'type':Sequelize[_0xdb65('0xe')]},'callerid':{'type':Sequelize[_0xdb65('0xe')],'defaultValue':_0xdb65('0x26')},'amaflags':{'type':Sequelize[_0xdb65('0xe')]},'callcounter':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no'),'defaultValue':_0xdb65('0x23')},'busylevel':{'type':Sequelize[_0xdb65('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xdb65('0x23'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xdb65('0x23'),'no')},'allowtransfer':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no')},'ignoresdpversion':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no')},'subscribecontext':{'type':Sequelize[_0xdb65('0xe')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xdb65('0x3')]('yes','no',_0xdb65('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x28'),_0xdb65('0x29'),_0xdb65('0x2a'))},'session_expires':{'type':Sequelize[_0xdb65('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x2b'),_0xdb65('0x2c')),'defaultValue':_0xdb65('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xdb65('0xe')]},'regexten':{'type':Sequelize[_0xdb65('0xe')]},'fromdomain':{'type':Sequelize[_0xdb65('0xe')]},'fromuser':{'type':Sequelize[_0xdb65('0xe')]},'port':{'type':Sequelize[_0xdb65('0x25')](0x5)},'qualify':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no'),'defaultValue':_0xdb65('0x23')},'keepalive':{'type':Sequelize[_0xdb65('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xdb65('0xe')]},'defaultuser':{'type':Sequelize[_0xdb65('0xe')]},'rtptimeout':{'type':Sequelize[_0xdb65('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xdb65('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xdb65('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no',_0xdb65('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdb65('0xe')]},'callbackextension':{'type':Sequelize[_0xdb65('0xe')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xdb65('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xdb65('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xdb65('0xe')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xdb65('0xe')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xdb65('0x23'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no')},'force_avp':{'type':Sequelize[_0xdb65('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no')},'dtlsenable':{'type':Sequelize[_0xdb65('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no',_0xdb65('0x2e'),_0xdb65('0x2f'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xdb65('0xe')]},'dtlscipher':{'type':Sequelize[_0xdb65('0xe')]},'dtlscafile':{'type':Sequelize[_0xdb65('0xe')]},'dtlscapath':{'type':Sequelize[_0xdb65('0xe')]},'dtlssetup':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x30'),_0xdb65('0x31'),_0xdb65('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdb65('0xe')]},'recordofffeature':{'type':Sequelize[_0xdb65('0xe')]},'call_limit':{'type':Sequelize[_0xdb65('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no')},'subscribemwi':{'type':Sequelize[_0xdb65('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xdb65('0xe')]},'mohinterpret':{'type':Sequelize[_0xdb65('0xe')]},'mohsuggest':{'type':Sequelize[_0xdb65('0xe')]},'parkinglot':{'type':Sequelize[_0xdb65('0xe')]},'description':{'type':Sequelize[_0xdb65('0xe')]},'host':{'type':Sequelize[_0xdb65('0xe')],'defaultValue':_0xdb65('0x33')},'canreinvite':{'type':Sequelize[_0xdb65('0x3')](_0xdb65('0x23'),'no',_0xdb65('0x18'),_0xdb65('0x34'),_0xdb65('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xdb65('0xe')]},'otherFields':{'type':Sequelize[_0xdb65('0xe')]},'active':{'type':Sequelize[_0xdb65('0x36')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xdb65('0xe')],'defaultValue':'no'}}; \ No newline at end of file +var _0xcef6=['originate','uac','pai','fingerprint','certificate','active','passive','actpass','update,nonat','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','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'];(function(_0x201d3e,_0x28f61a){var _0x36d221=function(_0x5e68f4){while(--_0x5e68f4){_0x201d3e['push'](_0x201d3e['shift']());}};_0x36d221(++_0x28f61a);}(_0xcef6,0x71));var _0x6cef=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xcef6[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require('sequelize');module[_0x6cef('0x0')]={'name':{'type':Sequelize[_0x6cef('0x1')],'allowNull':![],'unique':_0x6cef('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x4'),_0x6cef('0x5'),_0x6cef('0x6')),'allowNull':![],'defaultValue':_0x6cef('0x4')},'context':{'type':Sequelize[_0x6cef('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x6cef('0x7'),_0x6cef('0x8'),_0x6cef('0x9'),_0x6cef('0xa'),_0x6cef('0xb'),_0x6cef('0xc'),_0x6cef('0xd'),_0x6cef('0xe'))},'deny':{'type':Sequelize[_0x6cef('0x1')]},'permit':{'type':Sequelize[_0x6cef('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x6cef('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x6cef('0xf'),'set':function(_0x51b074){this[_0x6cef('0x10')](_0x6cef('0x11'),_0x51b074?_0x51b074[_0x6cef('0x12')](','):null);},'get':function(){return this[_0x6cef('0x13')]('transport')?this['getDataValue']('transport')[_0x6cef('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x15'),_0x6cef('0x16'),_0x6cef('0x17'),_0x6cef('0x18'),'auto'),'defaultValue':_0x6cef('0x15')},'directmedia':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no','nonat',_0x6cef('0x1a'),_0x6cef('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x6cef('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6cef('0x1')]},'directmediadeny':{'type':Sequelize[_0x6cef('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x6cef('0x1c'),'set':function(_0x4bdda8){this[_0x6cef('0x10')](_0x6cef('0x1d'),_0x4bdda8?_0x4bdda8['join'](','):null);},'get':function(){return this[_0x6cef('0x13')](_0x6cef('0x1d'))?this[_0x6cef('0x13')]('nat')['split'](','):null;},'comment':_0x6cef('0x1e')},'callgroup':{'type':Sequelize[_0x6cef('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x6cef('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x6cef('0x1')]},'language':{'type':Sequelize[_0x6cef('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6cef('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6cef('0x1')],'defaultValue':_0x6cef('0x1f')},'allow':{'type':Sequelize[_0x6cef('0x1')],'allowNull':![],'defaultValue':_0x6cef('0x20'),'set':function(_0x226d5d){this[_0x6cef('0x10')]('allow',_0x226d5d?_0x226d5d[_0x6cef('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x6cef('0x13')](_0x6cef('0x21'))?this[_0x6cef('0x13')]('allow')[_0x6cef('0x14')](';'):null;},'comment':_0x6cef('0x22')},'autoframing':{'type':Sequelize[_0x6cef('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x6cef('0x1')],'defaultValue':_0x6cef('0x23'),'set':function(_0x5cdeb2){this['setDataValue'](_0x6cef('0x24'),_0x5cdeb2?_0x5cdeb2[_0x6cef('0x12')](','):null);},'get':function(){return this[_0x6cef('0x13')](_0x6cef('0x24'))?this[_0x6cef('0x13')](_0x6cef('0x24'))[_0x6cef('0x14')](','):null;},'comment':_0x6cef('0x25')},'trustrpid':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6cef('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x6cef('0x19'),'no',_0x6cef('0x26'))},'promiscredir':{'type':Sequelize[_0x6cef('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no')},'accountcode':{'type':Sequelize[_0x6cef('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x6cef('0x28')},'amaflags':{'type':Sequelize[_0x6cef('0x1')]},'callcounter':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x6cef('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x6cef('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x6cef('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x6cef('0x1')]},'template':{'type':Sequelize[_0x6cef('0x1')]},'videosupport':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no',_0x6cef('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6cef('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no')},'mailbox':{'type':Sequelize[_0x6cef('0x1')]},'session_timers':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x2a'),'refuse',_0x6cef('0x2b'))},'session_expires':{'type':Sequelize[_0x6cef('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x6cef('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x6cef('0x2c'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x6cef('0x1')]},'regexten':{'type':Sequelize[_0x6cef('0x1')]},'fromdomain':{'type':Sequelize[_0x6cef('0x1')]},'fromuser':{'type':Sequelize[_0x6cef('0x1')]},'port':{'type':Sequelize[_0x6cef('0x27')](0x5)},'qualify':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no'),'defaultValue':_0x6cef('0x19')},'keepalive':{'type':Sequelize[_0x6cef('0x27')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x6cef('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6cef('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6cef('0x27')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x6cef('0x19'),'no',_0x6cef('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6cef('0x1')]},'callbackextension':{'type':Sequelize[_0x6cef('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x6cef('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x6cef('0x1')]},'contactdeny':{'type':Sequelize[_0x6cef('0x1')]},'contactacl':{'type':Sequelize[_0x6cef('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x6cef('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x6cef('0x27')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x6cef('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x6cef('0x19'),'no')},'force_avp':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no')},'icesupport':{'type':Sequelize[_0x6cef('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x6cef('0x2e'),_0x6cef('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x6cef('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6cef('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x6cef('0x1')]},'dtlscipher':{'type':Sequelize[_0x6cef('0x1')]},'dtlscafile':{'type':Sequelize[_0x6cef('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x30'),_0x6cef('0x31'),_0x6cef('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6cef('0x1')]},'usereqphone':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x6cef('0x1')]},'call_limit':{'type':Sequelize[_0x6cef('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x6cef('0x19'),'no')},'vmexten':{'type':Sequelize[_0x6cef('0x1')]},'mohinterpret':{'type':Sequelize[_0x6cef('0x1')]},'mohsuggest':{'type':Sequelize[_0x6cef('0x1')]},'parkinglot':{'type':Sequelize[_0x6cef('0x1')]},'description':{'type':Sequelize[_0x6cef('0x1')]},'host':{'type':Sequelize[_0x6cef('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x6cef('0x3')](_0x6cef('0x19'),'no','nonat',_0x6cef('0x1a'),_0x6cef('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6cef('0x1')]},'otherFields':{'type':Sequelize[_0x6cef('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6cef('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 1fef688..49f9eba 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 _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x1837da,_0x5e3681){var _0x3b0ba2=function(_0x2ed3b6){while(--_0x2ed3b6){_0x1837da['push'](_0x1837da['shift']());}};_0x3b0ba2(++_0x5e3681);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1a996c,_0x28f153){_0x1a996c=_0x1a996c-0x0;var _0x484260=_0x8d0e[_0x1a996c];return _0x484260;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file +var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x4eab50,_0x475f3a){var _0x463f58=function(_0x3a8c63){while(--_0x3a8c63){_0x4eab50['push'](_0x4eab50['shift']());}};_0x463f58(++_0x475f3a);}(_0x3e74,0x175));var _0x43e7=function(_0x349bc6,_0x57d340){_0x349bc6=_0x349bc6-0x0;var _0x2424ec=_0x3e74[_0x349bc6];return _0x2424ec;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 47f96ea..6dbb1ab 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 _0x9dcb=['define','tools_trunks','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x33dd7c,_0xd1efe7){var _0x5a7453=function(_0x5b2f10){while(--_0x5b2f10){_0x33dd7c['push'](_0x33dd7c['shift']());}};_0x5a7453(++_0xd1efe7);}(_0x9dcb,0xe9));var _0xb9dc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9dcb[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xb9dc('0x0'));var util=require(_0xb9dc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb9dc('0x2'));var BPromise=require(_0xb9dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9dc('0x4'));var rimraf=require(_0xb9dc('0x5'));var config=require(_0xb9dc('0x6'));var attributes=require(_0xb9dc('0x7'));module[_0xb9dc('0x8')]=function(_0x43cc74,_0x2a1e0a){return _0x43cc74[_0xb9dc('0x9')]('Trunk',attributes,{'tableName':_0xb9dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7962=['Trunk','tools_trunks','util','../../config/logger','api','bluebird','../../config/environment','./trunk.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7962,0x11a));var _0x2796=function(_0x29f3d0,_0x37f91f){_0x29f3d0=_0x29f3d0-0x0;var _0x479afe=_0x7962[_0x29f3d0];return _0x479afe;};'use strict';var _=require('lodash');var util=require(_0x2796('0x0'));var logger=require(_0x2796('0x1'))(_0x2796('0x2'));var moment=require('moment');var BPromise=require(_0x2796('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2796('0x4'));var attributes=require(_0x2796('0x5'));module[_0x2796('0x6')]=function(_0x438447,_0x514377){return _0x438447[_0x2796('0x7')](_0x2796('0x8'),attributes,{'tableName':_0x2796('0x9'),'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 8b1aeda..b52ef11 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 _0x133a=['info','stringify','find','raw','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','options','where','attributes','limit','include','map','model'];(function(_0x20118b,_0xb7bebe){var _0x4f9f31=function(_0x3ea9e5){while(--_0x3ea9e5){_0x20118b['push'](_0x20118b['shift']());}};_0x4f9f31(++_0xb7bebe);}(_0x133a,0x65));var _0xa133=function(_0x3ccfaa,_0x5e7818){_0x3ccfaa=_0x3ccfaa-0x0;var _0x5cd116=_0x133a[_0x3ccfaa];return _0x5cd116;};'use strict';var _=require('lodash');var util=require(_0xa133('0x0'));var moment=require(_0xa133('0x1'));var BPromise=require(_0xa133('0x2'));var rs=require(_0xa133('0x3'));var fs=require('fs');var Redis=require(_0xa133('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa133('0x5'));var logger=require(_0xa133('0x6'))('rpc');var config=require(_0xa133('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa133('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x268519,_0x45ddb8,_0x447a76){return new BPromise(function(_0x4484fd,_0x1c6fdb){return client[_0xa133('0x9')](_0x268519,_0x447a76)['then'](function(_0x1c310a){logger['info']('Trunk,\x20%s,\x20%s',_0x45ddb8,_0xa133('0xa'));logger[_0xa133('0xb')](_0xa133('0xc'),_0x45ddb8,_0xa133('0xa'),JSON['stringify'](_0x1c310a));if(_0x1c310a[_0xa133('0xd')]){if(_0x1c310a[_0xa133('0xd')]['code']===0x1f4){logger[_0xa133('0xd')](_0xa133('0xe'),_0x45ddb8,_0x1c310a[_0xa133('0xd')][_0xa133('0xf')]);return _0x1c6fdb(_0x1c310a[_0xa133('0xd')][_0xa133('0xf')]);}logger['error'](_0xa133('0xe'),_0x45ddb8,_0x1c310a['error'][_0xa133('0xf')]);return _0x4484fd(_0x1c310a['error']['message']);}else{logger['info'](_0xa133('0xe'),_0x45ddb8,_0xa133('0xa'));_0x4484fd(_0x1c310a[_0xa133('0x10')][_0xa133('0xf')]);}})[_0xa133('0x11')](function(_0x598006){logger[_0xa133('0xd')](_0xa133('0xe'),_0x45ddb8,_0x598006);_0x1c6fdb(_0x598006);});});}exports[_0xa133('0x12')]=function(_0x336ae1){var _0x112057=this;return new Promise(function(_0x17fbe7,_0x4a2293){return db[_0xa133('0x13')]['findAll']({'raw':_0x336ae1[_0xa133('0x14')]?_0x336ae1[_0xa133('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x336ae1[_0xa133('0x14')]?_0x336ae1[_0xa133('0x14')][_0xa133('0x15')]||null:null,'attributes':_0x336ae1[_0xa133('0x14')]?_0x336ae1['options'][_0xa133('0x16')]||null:null,'limit':_0x336ae1[_0xa133('0x14')]?_0x336ae1[_0xa133('0x14')][_0xa133('0x17')]||null:null,'include':_0x336ae1[_0xa133('0x14')]?_0x336ae1[_0xa133('0x14')][_0xa133('0x18')]?_[_0xa133('0x19')](_0x336ae1[_0xa133('0x14')]['include'],function(_0x25cad0){return{'model':db[_0x25cad0['model']],'as':_0x25cad0['as'],'attributes':_0x25cad0['attributes'],'include':_0x25cad0[_0xa133('0x18')]?_[_0xa133('0x19')](_0x25cad0['include'],function(_0x5037f5){return{'model':db[_0x5037f5[_0xa133('0x1a')]],'as':_0x5037f5['as'],'attributes':_0x5037f5[_0xa133('0x16')],'include':_0x5037f5['include']?_[_0xa133('0x19')](_0x5037f5['include'],function(_0x2345e0){return{'model':db[_0x2345e0[_0xa133('0x1a')]],'as':_0x2345e0['as'],'attributes':_0x2345e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ada04){logger[_0xa133('0x1b')](_0xa133('0x12'),_0x336ae1);logger[_0xa133('0xb')](_0xa133('0x12'),_0x336ae1,JSON[_0xa133('0x1c')](_0x1ada04));_0x17fbe7(_0x1ada04);})[_0xa133('0x11')](function(_0x58981a){logger[_0xa133('0xd')](_0xa133('0x12'),_0x58981a['message'],_0x336ae1);_0x4a2293(_0x112057['error'](0x1f4,_0x58981a[_0xa133('0xf')]));});});};exports['ShowTrunk']=function(_0x2b31e7){var _0x4fc874=this;return new Promise(function(_0x5853a6,_0x2ff8f6){return db['Trunk'][_0xa133('0x1d')]({'raw':_0x2b31e7[_0xa133('0x14')]?_0x2b31e7[_0xa133('0x14')][_0xa133('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b31e7[_0xa133('0x14')]?_0x2b31e7[_0xa133('0x14')][_0xa133('0x15')]||null:null,'attributes':_0x2b31e7[_0xa133('0x14')]?_0x2b31e7[_0xa133('0x14')][_0xa133('0x16')]||null:null,'include':_0x2b31e7['options']?_0x2b31e7[_0xa133('0x14')][_0xa133('0x18')]?_['map'](_0x2b31e7[_0xa133('0x14')]['include'],function(_0x4298a8){return{'model':db[_0x4298a8[_0xa133('0x1a')]],'as':_0x4298a8['as'],'attributes':_0x4298a8[_0xa133('0x16')],'include':_0x4298a8[_0xa133('0x18')]?_['map'](_0x4298a8['include'],function(_0x44457a){return{'model':db[_0x44457a[_0xa133('0x1a')]],'as':_0x44457a['as'],'attributes':_0x44457a[_0xa133('0x16')],'include':_0x44457a['include']?_[_0xa133('0x19')](_0x44457a[_0xa133('0x18')],function(_0x154801){return{'model':db[_0x154801[_0xa133('0x1a')]],'as':_0x154801['as'],'attributes':_0x154801['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ecde9){logger['info'](_0xa133('0x1f'),_0x2b31e7);logger[_0xa133('0xb')](_0xa133('0x1f'),_0x2b31e7,JSON[_0xa133('0x1c')](_0x5ecde9));_0x5853a6(_0x5ecde9);})[_0xa133('0x11')](function(_0x4146d8){logger[_0xa133('0xd')](_0xa133('0x1f'),_0x4146d8['message'],_0x2b31e7);_0x2ff8f6(_0x4fc874[_0xa133('0xd')](0x1f4,_0x4146d8[_0xa133('0xf')]));});});}; \ No newline at end of file +var _0x2814=['Trunk','options','raw','where','attributes','include','map','model','debug','ShowTrunk','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x2814,0xb5));var _0x4281=function(_0x559ae3,_0x259e00){_0x559ae3=_0x559ae3-0x0;var _0x3edef1=_0x2814[_0x559ae3];return _0x3edef1;};'use strict';var _=require(_0x4281('0x0'));var util=require('util');var moment=require(_0x4281('0x1'));var BPromise=require(_0x4281('0x2'));var rs=require(_0x4281('0x3'));var fs=require('fs');var Redis=require(_0x4281('0x4'));var db=require(_0x4281('0x5'))['db'];var utils=require(_0x4281('0x6'));var logger=require(_0x4281('0x7'))('rpc');var config=require(_0x4281('0x8'));var jayson=require(_0x4281('0x9'));var client=jayson['client'][_0x4281('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25f65a,_0x2170b2,_0x16c8cf){return new BPromise(function(_0x212efb,_0x1270f0){return client[_0x4281('0xb')](_0x25f65a,_0x16c8cf)[_0x4281('0xc')](function(_0x5026e8){logger[_0x4281('0xd')](_0x4281('0xe'),_0x2170b2,_0x4281('0xf'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x2170b2,'request\x20sent',JSON[_0x4281('0x10')](_0x5026e8));if(_0x5026e8['error']){if(_0x5026e8[_0x4281('0x11')][_0x4281('0x12')]===0x1f4){logger['error'](_0x4281('0xe'),_0x2170b2,_0x5026e8[_0x4281('0x11')]['message']);return _0x1270f0(_0x5026e8['error'][_0x4281('0x13')]);}logger['error'](_0x4281('0xe'),_0x2170b2,_0x5026e8['error'][_0x4281('0x13')]);return _0x212efb(_0x5026e8[_0x4281('0x11')][_0x4281('0x13')]);}else{logger[_0x4281('0xd')](_0x4281('0xe'),_0x2170b2,_0x4281('0xf'));_0x212efb(_0x5026e8[_0x4281('0x14')][_0x4281('0x13')]);}})[_0x4281('0x15')](function(_0x1b8030){logger[_0x4281('0x11')](_0x4281('0xe'),_0x2170b2,_0x1b8030);_0x1270f0(_0x1b8030);});});}exports[_0x4281('0x16')]=function(_0x130e38){var _0x5887d0=this;return new Promise(function(_0x254998,_0x5e9858){return db[_0x4281('0x17')]['findAll']({'raw':_0x130e38['options']?_0x130e38[_0x4281('0x18')][_0x4281('0x19')]===undefined?!![]:![]:!![],'where':_0x130e38[_0x4281('0x18')]?_0x130e38[_0x4281('0x18')][_0x4281('0x1a')]||null:null,'attributes':_0x130e38[_0x4281('0x18')]?_0x130e38[_0x4281('0x18')][_0x4281('0x1b')]||null:null,'limit':_0x130e38['options']?_0x130e38[_0x4281('0x18')]['limit']||null:null,'include':_0x130e38['options']?_0x130e38[_0x4281('0x18')][_0x4281('0x1c')]?_[_0x4281('0x1d')](_0x130e38[_0x4281('0x18')]['include'],function(_0xb748fc){return{'model':db[_0xb748fc[_0x4281('0x1e')]],'as':_0xb748fc['as'],'attributes':_0xb748fc[_0x4281('0x1b')],'include':_0xb748fc[_0x4281('0x1c')]?_[_0x4281('0x1d')](_0xb748fc[_0x4281('0x1c')],function(_0x500e23){return{'model':db[_0x500e23[_0x4281('0x1e')]],'as':_0x500e23['as'],'attributes':_0x500e23[_0x4281('0x1b')],'include':_0x500e23['include']?_[_0x4281('0x1d')](_0x500e23[_0x4281('0x1c')],function(_0xb1d61e){return{'model':db[_0xb1d61e[_0x4281('0x1e')]],'as':_0xb1d61e['as'],'attributes':_0xb1d61e[_0x4281('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4281('0xc')](function(_0x4ee661){logger['info'](_0x4281('0x16'),_0x130e38);logger[_0x4281('0x1f')](_0x4281('0x16'),_0x130e38,JSON[_0x4281('0x10')](_0x4ee661));_0x254998(_0x4ee661);})[_0x4281('0x15')](function(_0x34d50a){logger[_0x4281('0x11')]('GetTrunk',_0x34d50a[_0x4281('0x13')],_0x130e38);_0x5e9858(_0x5887d0[_0x4281('0x11')](0x1f4,_0x34d50a[_0x4281('0x13')]));});});};exports[_0x4281('0x20')]=function(_0x28b40f){var _0x3cacf1=this;return new Promise(function(_0x18b6fe,_0x45e2e3){return db['Trunk'][_0x4281('0x21')]({'raw':_0x28b40f[_0x4281('0x18')]?_0x28b40f['options'][_0x4281('0x19')]===undefined?!![]:![]:!![],'where':_0x28b40f['options']?_0x28b40f[_0x4281('0x18')][_0x4281('0x1a')]||null:null,'attributes':_0x28b40f[_0x4281('0x18')]?_0x28b40f[_0x4281('0x18')][_0x4281('0x1b')]||null:null,'include':_0x28b40f[_0x4281('0x18')]?_0x28b40f['options']['include']?_[_0x4281('0x1d')](_0x28b40f['options'][_0x4281('0x1c')],function(_0x7d2fd1){return{'model':db[_0x7d2fd1[_0x4281('0x1e')]],'as':_0x7d2fd1['as'],'attributes':_0x7d2fd1[_0x4281('0x1b')],'include':_0x7d2fd1[_0x4281('0x1c')]?_[_0x4281('0x1d')](_0x7d2fd1['include'],function(_0x2e9867){return{'model':db[_0x2e9867[_0x4281('0x1e')]],'as':_0x2e9867['as'],'attributes':_0x2e9867[_0x4281('0x1b')],'include':_0x2e9867['include']?_[_0x4281('0x1d')](_0x2e9867[_0x4281('0x1c')],function(_0x414117){return{'model':db[_0x414117[_0x4281('0x1e')]],'as':_0x414117['as'],'attributes':_0x414117[_0x4281('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4281('0xc')](function(_0x2c2330){logger['info'](_0x4281('0x20'),_0x28b40f);logger[_0x4281('0x1f')]('ShowTrunk',_0x28b40f,JSON['stringify'](_0x2c2330));_0x18b6fe(_0x2c2330);})['catch'](function(_0x55218c){logger[_0x4281('0x11')]('ShowTrunk',_0x55218c[_0x4281('0x13')],_0x28b40f);_0x45e2e3(_0x3cacf1['error'](0x1f4,_0x55218c[_0x4281('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 0b0b0aa..05fef50 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 _0xf74e=['express','../../components/auth/service','./user-setting.controller','put','isAuthenticated','update'];(function(_0x11a3ec,_0x3219d2){var _0x388e3d=function(_0x3b1b79){while(--_0x3b1b79){_0x11a3ec['push'](_0x11a3ec['shift']());}};_0x388e3d(++_0x3219d2);}(_0xf74e,0x1ec));var _0xef74=function(_0x5be25a,_0x2b8353){_0x5be25a=_0x5be25a-0x0;var _0x5bc4e4=_0xf74e[_0x5be25a];return _0x5bc4e4;};'use strict';var express=require(_0xef74('0x0'));var router=express['Router']();var auth=require(_0xef74('0x1'));var controller=require(_0xef74('0x2'));router[_0xef74('0x3')]('/:id',auth[_0xef74('0x4')](),controller[_0xef74('0x5')]);module['exports']=router; \ No newline at end of file +var _0xdaba=['exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id'];(function(_0x2f12b7,_0x27f28d){var _0xe20bb6=function(_0x31ada0){while(--_0x31ada0){_0x2f12b7['push'](_0x2f12b7['shift']());}};_0xe20bb6(++_0x27f28d);}(_0xdaba,0x197));var _0xadab=function(_0x59eb84,_0x5f2faf){_0x59eb84=_0x59eb84-0x0;var _0x32ad0b=_0xdaba[_0x59eb84];return _0x32ad0b;};'use strict';var express=require(_0xadab('0x0'));var router=express[_0xadab('0x1')]();var auth=require(_0xadab('0x2'));var controller=require(_0xadab('0x3'));router[_0xadab('0x4')](_0xadab('0x5'),auth['isAuthenticated'](),controller['update']);module[_0xadab('0x6')]=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 179d372..ed24204 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 _0x683d=['TEXT','DATE','INTEGER','UserId','sequelize','error','warning','exports','ENUM','BOOLEAN'];(function(_0x2cd04b,_0xd130f9){var _0x213da5=function(_0x2e0e68){while(--_0x2e0e68){_0x2cd04b['push'](_0x2cd04b['shift']());}};_0x213da5(++_0xd130f9);}(_0x683d,0x112));var _0xd683=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x683d[_0x24061a];return _0x82054e;};'use strict';var Sequelize=require(_0xd683('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd683('0x1'),_0xd683('0x2'),'info','debug'];module[_0xd683('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd683('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd683('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd683('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd683('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd683('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd683('0x8')],'unique':_0xd683('0x9')}}; \ No newline at end of file +var _0x00fd=['exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error','warning','info','debug'];(function(_0x1b0478,_0x225e61){var _0x440583=function(_0x1f79f4){while(--_0x1f79f4){_0x1b0478['push'](_0x1b0478['shift']());}};_0x440583(++_0x225e61);}(_0x00fd,0x19f));var _0xd00f=function(_0x3e8da7,_0x18486c){_0x3e8da7=_0x3e8da7-0x0;var _0x3d45e2=_0x00fd[_0x3e8da7];return _0x3d45e2;};'use strict';var Sequelize=require(_0xd00f('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd00f('0x1'),_0xd00f('0x2'),_0xd00f('0x3'),_0xd00f('0x4')];module[_0xd00f('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd00f('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd00f('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd00f('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd00f('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd00f('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd00f('0xa')],'unique':_0xd00f('0xb')}}; \ 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 4be3050..18a166d 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 _0xe600=['redis','./user-setting.socket','register','defaults','status','update','then','sendStatus','error','stack','name','send','user','role','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter'];(function(_0x31a0bb,_0x20a7e0){var _0x3b3111=function(_0x3ee13c){while(--_0x3ee13c){_0x31a0bb['push'](_0x31a0bb['shift']());}};_0x3b3111(++_0x20a7e0);}(_0xe600,0x159));var _0x0e60=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe600[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var Redis=require(_0x0e60('0x0'));var logger=require('../../config/logger')(_0x0e60('0x1'));var config=require(_0x0e60('0x2'));var db=require(_0x0e60('0x3'))['db'];var socket=require(_0x0e60('0x4'))(new Redis(config[_0x0e60('0x5')]));require(_0x0e60('0x6'))[_0x0e60('0x7')](socket);config[_0x0e60('0x5')]=_[_0x0e60('0x8')](config[_0x0e60('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x1d7563,_0x497a61){_0x497a61=_0x497a61||0xc8;return function(_0x6727dd){if(_0x6727dd){return _0x1d7563[_0x0e60('0x9')](_0x497a61)['json'](_0x6727dd);}};}function saveUpdates(_0x3577c5){return function(_0x2e5db4){if(_0x2e5db4){return _0x2e5db4[_0x0e60('0xa')](_0x3577c5)[_0x0e60('0xb')](function(_0x300dfb){return _0x300dfb;});}return null;};}function handleEntityNotFound(_0x1659e4){return function(_0x5e3246){if(!_0x5e3246){_0x1659e4[_0x0e60('0xc')](0x194);}return _0x5e3246;};}function handleError(_0x353fb3,_0x32274f){_0x32274f=_0x32274f||0x1f4;return function(_0x402907){logger[_0x0e60('0xd')](_0x402907[_0x0e60('0xe')]);if(_0x402907[_0x0e60('0xf')]){delete _0x402907[_0x0e60('0xf')];}_0x353fb3['status'](_0x32274f)[_0x0e60('0x10')](_0x402907);};}exports[_0x0e60('0xa')]=function(_0x24c20f,_0x1202fc){if(_0x24c20f[_0x0e60('0x11')][_0x0e60('0x12')]!=='admin')throw new Error(_0x0e60('0x13'));if(isNaN(Number(_0x24c20f['params']['id'])))throw new Error(_0x0e60('0x14'));return db[_0x0e60('0x15')][_0x0e60('0x16')]({'where':{'id':_0x24c20f['params']['id']}})[_0x0e60('0xb')](handleEntityNotFound(_0x1202fc,null))[_0x0e60('0xb')](saveUpdates(_0x24c20f[_0x0e60('0x17')],null))[_0x0e60('0xb')](respondWithResult(_0x1202fc,null))[_0x0e60('0x18')](handleError(_0x1202fc,null));}; \ No newline at end of file +var _0xcea2=['register','redis','status','json','update','then','sendStatus','stack','name','send','user','params','UserSetting','find','body','catch','lodash','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket'];(function(_0x3444eb,_0xbd4562){var _0x286e50=function(_0x5cad9b){while(--_0x5cad9b){_0x3444eb['push'](_0x3444eb['shift']());}};_0x286e50(++_0xbd4562);}(_0xcea2,0x15a));var _0x2cea=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xcea2[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x2cea('0x0'));var Redis=require('ioredis');var logger=require(_0x2cea('0x1'))('api');var config=require(_0x2cea('0x2'));var db=require(_0x2cea('0x3'))['db'];var socket=require(_0x2cea('0x4'))(new Redis(config['redis']));require(_0x2cea('0x5'))[_0x2cea('0x6')](socket);config[_0x2cea('0x7')]=_['defaults'](config[_0x2cea('0x7')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x2d69ff,_0xc04963){_0xc04963=_0xc04963||0xc8;return function(_0x805a1b){if(_0x805a1b){return _0x2d69ff[_0x2cea('0x8')](_0xc04963)[_0x2cea('0x9')](_0x805a1b);}};}function saveUpdates(_0x1519f6){return function(_0x5e9060){if(_0x5e9060){return _0x5e9060[_0x2cea('0xa')](_0x1519f6)[_0x2cea('0xb')](function(_0x205a4e){return _0x205a4e;});}return null;};}function handleEntityNotFound(_0x2b437a){return function(_0x306cf7){if(!_0x306cf7){_0x2b437a[_0x2cea('0xc')](0x194);}return _0x306cf7;};}function handleError(_0x4298a4,_0x1c9142){_0x1c9142=_0x1c9142||0x1f4;return function(_0x58a102){logger['error'](_0x58a102[_0x2cea('0xd')]);if(_0x58a102[_0x2cea('0xe')]){delete _0x58a102['name'];}_0x4298a4['status'](_0x1c9142)[_0x2cea('0xf')](_0x58a102);};}exports['update']=function(_0xa4ce3d,_0xc5d08e){if(_0xa4ce3d[_0x2cea('0x10')]['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0xa4ce3d[_0x2cea('0x11')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x2cea('0x12')][_0x2cea('0x13')]({'where':{'id':_0xa4ce3d[_0x2cea('0x11')]['id']}})[_0x2cea('0xb')](handleEntityNotFound(_0xc5d08e,null))[_0x2cea('0xb')](saveUpdates(_0xa4ce3d[_0x2cea('0x14')],null))[_0x2cea('0xb')](respondWithResult(_0xc5d08e,null))[_0x2cea('0x15')](handleError(_0xc5d08e,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 44dfaa8..ff07101 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 _0xbe6f=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1c40d0,_0xbcb4a2){var _0x1d178a=function(_0x3979c6){while(--_0x3979c6){_0x1c40d0['push'](_0x1c40d0['shift']());}};_0x1d178a(++_0xbcb4a2);}(_0xbe6f,0x182));var _0xfbe6=function(_0x52feba,_0x3d3d89){_0x52feba=_0x52feba-0x0;var _0x3e4ed0=_0xbe6f[_0x52feba];return _0x3e4ed0;};'use strict';var EventEmitter=require(_0xfbe6('0x0'));var UserSetting=require(_0xfbe6('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xfbe6('0x2')](0x0);var events={'afterCreate':_0xfbe6('0x3'),'afterUpdate':_0xfbe6('0x4'),'afterDestroy':_0xfbe6('0x5')};function emitEvent(_0x2419f5){return function(_0x3091bc,_0x458e48,_0x463e50){UserSettingEvents[_0xfbe6('0x6')](_0x2419f5+':'+_0x3091bc['id'],_0x3091bc);UserSettingEvents[_0xfbe6('0x6')](_0x2419f5,_0x3091bc);_0x463e50(null);};}for(var e in events){if(events[_0xfbe6('0x7')](e)){var event=events[e];UserSetting[_0xfbe6('0x8')](e,emitEvent(event));}}module[_0xfbe6('0x9')]=UserSettingEvents; \ No newline at end of file +var _0x94bb=['exports','../../mysqldb','UserSetting','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2a3d2b,_0x7f960a){var _0x5c06b5=function(_0x4a1ebb){while(--_0x4a1ebb){_0x2a3d2b['push'](_0x2a3d2b['shift']());}};_0x5c06b5(++_0x7f960a);}(_0x94bb,0x7f));var _0xb94b=function(_0x1fd437,_0x2c0b47){_0x1fd437=_0x1fd437-0x0;var _0x40d9e6=_0x94bb[_0x1fd437];return _0x40d9e6;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xb94b('0x0'))['db'][_0xb94b('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb94b('0x2'),'afterUpdate':_0xb94b('0x3'),'afterDestroy':_0xb94b('0x4')};function emitEvent(_0x54bc54){return function(_0x475547,_0xb51c11,_0xdad747){UserSettingEvents[_0xb94b('0x5')](_0x54bc54+':'+_0x475547['id'],_0x475547);UserSettingEvents[_0xb94b('0x5')](_0x54bc54,_0x475547);_0xdad747(null);};}for(var e in events){if(events[_0xb94b('0x6')](e)){var event=events[e];UserSetting[_0xb94b('0x7')](e,emitEvent(event));}}module[_0xb94b('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 0a7b446..241e2ae 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 _0x4b0f=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports','define'];(function(_0xc78dfe,_0x45d371){var _0x5b22df=function(_0x4c6267){while(--_0x4c6267){_0xc78dfe['push'](_0xc78dfe['shift']());}};_0x5b22df(++_0x45d371);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x1c9cfb,_0x4efc3b){_0x1c9cfb=_0x1c9cfb-0x0;var _0x32436a=_0x4b0f[_0x1c9cfb];return _0x32436a;};'use strict';var attributes=require('./user-setting.attributes');module[_0xf4b0('0x0')]=function(_0x95169b){return _0x95169b[_0xf4b0('0x1')]('UserSetting',attributes,{'tableName':_0xf4b0('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ead58){if(!_0x2ead58[_0xf4b0('0x3')])_0x2ead58[_0xf4b0('0x4')]=null;else if(_0x2ead58[_0xf4b0('0x4')]===null)_0x2ead58[_0xf4b0('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xeef7=['./user-setting.attributes','exports','define','UserSetting','clientSideLoggingEnabledSince'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xeef7,0x7d));var _0x7eef=function(_0x507c66,_0x30d0ae){_0x507c66=_0x507c66-0x0;var _0x4735b2=_0xeef7[_0x507c66];return _0x4735b2;};'use strict';var attributes=require(_0x7eef('0x0'));module[_0x7eef('0x1')]=function(_0x524f04){return _0x524f04[_0x7eef('0x2')](_0x7eef('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b2894){if(!_0x5b2894['clientSideLoggingEnabled'])_0x5b2894[_0x7eef('0x4')]=null;else if(_0x5b2894[_0x7eef('0x4')]===null)_0x5b2894[_0x7eef('0x4')]=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 19df377..bf2020c 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 _0x6826=['./user-setting.events','remove','update','emit','user-setting:update:user-','UserId','register','length','user-setting:'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x6826,0x75));var _0x6682=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x6826[_0x4dab14];return _0xf41aa;};'use strict';var UserSettingEvents=require(_0x6682('0x0'));var events=['save',_0x6682('0x1'),_0x6682('0x2')];function createListener(_0x1cc116,_0x2158c2){return function(_0x21b39c){_0x2158c2[_0x6682('0x3')](_0x1cc116,_0x21b39c);if(_0x1cc116==='user-setting:update'){_0x2158c2['emit'](_0x6682('0x4')+_0x21b39c[_0x6682('0x5')],_0x21b39c);}};}exports[_0x6682('0x6')]=function(_0x4c20b5){for(var _0x47bbf=0x0,_0x3e4c8f=events[_0x6682('0x7')];_0x47bbf<_0x3e4c8f;_0x47bbf++){var _0x1498b5=events[_0x47bbf];var _0x4e28c6=createListener(_0x6682('0x8')+_0x1498b5,_0x4c20b5);UserSettingEvents['on'](_0x1498b5,_0x4e28c6);}}; \ No newline at end of file +var _0x6337=['user-setting:update','user-setting:update:user-','register','save','update','emit'];(function(_0x552f18,_0x403f49){var _0x3ecdc2=function(_0x4746a0){while(--_0x4746a0){_0x552f18['push'](_0x552f18['shift']());}};_0x3ecdc2(++_0x403f49);}(_0x6337,0xd5));var _0x7633=function(_0x4a3058,_0x1f434d){_0x4a3058=_0x4a3058-0x0;var _0x25627c=_0x6337[_0x4a3058];return _0x25627c;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x7633('0x0'),'remove',_0x7633('0x1')];function createListener(_0x41cb9f,_0x115517){return function(_0x2ca8f6){_0x115517[_0x7633('0x2')](_0x41cb9f,_0x2ca8f6);if(_0x41cb9f===_0x7633('0x3')){_0x115517['emit'](_0x7633('0x4')+_0x2ca8f6['UserId'],_0x2ca8f6);}};}exports[_0x7633('0x5')]=function(_0x48c924){for(var _0x5b6dac=0x0,_0x34052a=events['length'];_0x5b6dac<_0x34052a;_0x5b6dac++){var _0x271138=events[_0x5b6dac];var _0x45045f=createListener('user-setting:'+_0x271138,_0x48c924);UserSettingEvents['on'](_0x271138,_0x45045f);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 87ff68e..347a1f2 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 _0xea08=['addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getScheduledCalls','/:id/api_key','getApiKey','addContacts','create','post','/create_many','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/openchannel_accounts','addSmsAccounts'];(function(_0x46f299,_0x3d7439){var _0x5c019c=function(_0x5677ba){while(--_0x5677ba){_0x46f299['push'](_0x46f299['shift']());}};_0x5c019c(++_0x3d7439);}(_0xea08,0x7f));var _0x8ea0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xea08[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require(_0x8ea0('0x0'));var path=require(_0x8ea0('0x1'));var timeout=require(_0x8ea0('0x2'));var express=require(_0x8ea0('0x3'));var router=express[_0x8ea0('0x4')]();var fs_extra=require(_0x8ea0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8ea0('0x6'));var controller=require(_0x8ea0('0x7'));router[_0x8ea0('0x8')]('/',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0xa')]);router[_0x8ea0('0x8')](_0x8ea0('0xb'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0xc')]);router['get'](_0x8ea0('0xd'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0xe')]);router[_0x8ea0('0x8')](_0x8ea0('0xf'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x10')]);router['get'](_0x8ea0('0x11'),auth[_0x8ea0('0x9')](),controller['show']);router['get'](_0x8ea0('0x12'),controller['getAvatar']);router[_0x8ea0('0x8')](_0x8ea0('0x13'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x14')]);router['get'](_0x8ea0('0x15'),auth[_0x8ea0('0x9')](),controller['getContacts']);router['get'](_0x8ea0('0x16'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x17')]);router[_0x8ea0('0x8')](_0x8ea0('0x18'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x19')]);router[_0x8ea0('0x8')](_0x8ea0('0x1a'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x1b')]);router[_0x8ea0('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x8ea0('0x8')](_0x8ea0('0x1c'),auth[_0x8ea0('0x9')](),controller['getScreenRecordings']);router['get'](_0x8ea0('0x1d'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x1e')]);router[_0x8ea0('0x8')]('/:id/openchannel/interactions',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x1f')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x8ea0('0x20')]);router[_0x8ea0('0x8')]('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router['get'](_0x8ea0('0x21'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x22')]);router[_0x8ea0('0x8')](_0x8ea0('0x23'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x24')]);router['get'](_0x8ea0('0x25'),auth['isAuthenticated'](),controller['getTeams']);router[_0x8ea0('0x8')]('/:id/lists',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x26')]);router[_0x8ea0('0x8')](_0x8ea0('0x27'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x28')]);router[_0x8ea0('0x8')](_0x8ea0('0x29'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x2a')]);router[_0x8ea0('0x8')]('/:id/fax_accounts',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x2b')]);router[_0x8ea0('0x8')](_0x8ea0('0x2c'),auth['isAuthenticated'](),controller[_0x8ea0('0x2d')]);router[_0x8ea0('0x8')]('/:id/openchannel_accounts',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x2e')]);router['get'](_0x8ea0('0x2f'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x30')]);router[_0x8ea0('0x8')](_0x8ea0('0x31'),auth[_0x8ea0('0x9')](),controller['getChatWebsites']);router[_0x8ea0('0x8')](_0x8ea0('0x32'),auth[_0x8ea0('0x9')](),controller['getWhatsappAccounts']);router[_0x8ea0('0x8')]('/:id/scheduled_calls',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x33')]);router[_0x8ea0('0x8')](_0x8ea0('0x34'),auth['isAuthenticated'](),controller[_0x8ea0('0x35')]);router['post']('/:id/contacts',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x36')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8ea0('0x37')]);router[_0x8ea0('0x38')](_0x8ea0('0x39'),auth[_0x8ea0('0x9')](),controller['bulkCreate']);router[_0x8ea0('0x38')](_0x8ea0('0x16'),auth['isAuthenticated'](),controller[_0x8ea0('0x3a')]);var upload=multer({'storage':multer[_0x8ea0('0x3b')]({'destination':function(_0x3e39ce,_0x4f2c2f,_0x43c81d){_0x43c81d(null,path[_0x8ea0('0x3c')](config['root'],_0x8ea0('0x3d')));},'filename':function(_0x4b8d70,_0x9814c6,_0x3a2f04){_0x3a2f04(null,util[_0x8ea0('0x3e')](_0x8ea0('0x3f'),Date[_0x8ea0('0x40')](),_0x9814c6[_0x8ea0('0x41')]));}})});router[_0x8ea0('0x38')](_0x8ea0('0x12'),upload[_0x8ea0('0x42')](_0x8ea0('0x43')),controller[_0x8ea0('0x44')]);router[_0x8ea0('0x38')]('/:id/login',auth[_0x8ea0('0x9')](),controller['login']);router[_0x8ea0('0x38')](_0x8ea0('0x45'),auth['isAuthenticated'](),controller[_0x8ea0('0x46')]);router[_0x8ea0('0x38')](_0x8ea0('0x47'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x48')]);router[_0x8ea0('0x38')](_0x8ea0('0x49'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x4a')]);router[_0x8ea0('0x38')](_0x8ea0('0x25'),auth[_0x8ea0('0x9')](),controller['addTeams']);router['post'](_0x8ea0('0x4b'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x4c')]);router[_0x8ea0('0x38')](_0x8ea0('0x4d'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x4e')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x8ea0('0x4f')]);router[_0x8ea0('0x38')](_0x8ea0('0x50'),auth['isAuthenticated'](),controller[_0x8ea0('0x51')]);router[_0x8ea0('0x38')](_0x8ea0('0x52'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x53')]);router['post'](_0x8ea0('0x54'),auth[_0x8ea0('0x9')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0x8ea0('0x9')](),controller['addFaxAccounts']);router[_0x8ea0('0x38')](_0x8ea0('0x2c'),auth[_0x8ea0('0x9')](),controller['addMailAccounts']);router['post'](_0x8ea0('0x55'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x8ea0('0x38')]('/:id/sms_accounts',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x56')]);router[_0x8ea0('0x38')](_0x8ea0('0x31'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x57')]);router['post'](_0x8ea0('0x32'),auth[_0x8ea0('0x9')](),controller['addWhatsappAccounts']);router['post'](_0x8ea0('0x34'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x58')]);router[_0x8ea0('0x59')](_0x8ea0('0x11'),auth['isAuthenticated'](),controller[_0x8ea0('0x5a')]);router[_0x8ea0('0x59')](_0x8ea0('0x5b'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x5c')]);router[_0x8ea0('0x5d')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router[_0x8ea0('0x5d')](_0x8ea0('0x25'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x5e')]);router[_0x8ea0('0x5d')]('/:id',auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x5f')]);router[_0x8ea0('0x5d')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x8ea0('0x60')]);router[_0x8ea0('0x5d')](_0x8ea0('0x4d'),auth[_0x8ea0('0x9')](),controller['removeMailInteractions']);router[_0x8ea0('0x5d')](_0x8ea0('0x61'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x62')]);router[_0x8ea0('0x5d')](_0x8ea0('0x50'),auth[_0x8ea0('0x9')](),controller['removeSmsInteractions']);router[_0x8ea0('0x5d')](_0x8ea0('0x52'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x8ea0('0x5d')](_0x8ea0('0x54'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x63')]);router[_0x8ea0('0x5d')](_0x8ea0('0x64'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x65')]);router[_0x8ea0('0x5d')](_0x8ea0('0x2c'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x66')]);router[_0x8ea0('0x5d')](_0x8ea0('0x55'),auth[_0x8ea0('0x9')](),controller['removeOpenchannelAccounts']);router[_0x8ea0('0x5d')]('/:id/sms_accounts',auth[_0x8ea0('0x9')](),controller['removeSmsAccounts']);router[_0x8ea0('0x5d')](_0x8ea0('0x31'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x67')]);router[_0x8ea0('0x5d')](_0x8ea0('0x32'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x68')]);router['delete'](_0x8ea0('0x34'),auth[_0x8ea0('0x9')](),controller[_0x8ea0('0x69')]);router['post']('/:id/messengerSoundNotification',auth[_0x8ea0('0x9')](),controller['messengerSoundNotification']);module[_0x8ea0('0x6a')]=router; \ No newline at end of file +var _0x0375=['getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/api_key','messengerSoundNotification','exports','multer','util','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts'];(function(_0xd971b4,_0x445070){var _0x5ed2a2=function(_0xf4b51c){while(--_0xf4b51c){_0xd971b4['push'](_0xd971b4['shift']());}};_0x5ed2a2(++_0x445070);}(_0x0375,0x116));var _0x5037=function(_0xfab188,_0x18208f){_0xfab188=_0xfab188-0x0;var _0x4fda32=_0x0375[_0xfab188];return _0x4fda32;};'use strict';var multer=require(_0x5037('0x0'));var util=require(_0x5037('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5037('0x2'));var router=express[_0x5037('0x3')]();var fs_extra=require(_0x5037('0x4'));var auth=require(_0x5037('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./user.controller');router[_0x5037('0x6')]('/',auth[_0x5037('0x7')](),controller['index']);router[_0x5037('0x6')](_0x5037('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x5037('0x6')](_0x5037('0x9'),auth[_0x5037('0x7')](),controller[_0x5037('0xa')]);router['get'](_0x5037('0xb'),auth[_0x5037('0x7')](),controller[_0x5037('0xc')]);router['get'](_0x5037('0xd'),auth[_0x5037('0x7')](),controller[_0x5037('0xe')]);router['get'](_0x5037('0xf'),controller[_0x5037('0x10')]);router['get'](_0x5037('0x11'),auth['isAuthenticated'](),controller[_0x5037('0x12')]);router['get'](_0x5037('0x13'),auth[_0x5037('0x7')](),controller[_0x5037('0x14')]);router[_0x5037('0x6')](_0x5037('0x15'),auth[_0x5037('0x7')](),controller['getQueues']);router[_0x5037('0x6')](_0x5037('0x16'),auth[_0x5037('0x7')](),controller[_0x5037('0x17')]);router[_0x5037('0x6')](_0x5037('0x18'),auth['isAuthenticated'](),controller[_0x5037('0x19')]);router[_0x5037('0x6')](_0x5037('0x1a'),auth['isAuthenticated'](),controller[_0x5037('0x1b')]);router[_0x5037('0x6')](_0x5037('0x1c'),auth['isAuthenticated'](),controller[_0x5037('0x1d')]);router[_0x5037('0x6')](_0x5037('0x1e'),auth[_0x5037('0x7')](),controller[_0x5037('0x1f')]);router[_0x5037('0x6')](_0x5037('0x20'),auth[_0x5037('0x7')](),controller[_0x5037('0x21')]);router['get'](_0x5037('0x22'),auth[_0x5037('0x7')](),controller['getMailInteractions']);router['get'](_0x5037('0x23'),auth[_0x5037('0x7')](),controller[_0x5037('0x24')]);router[_0x5037('0x6')](_0x5037('0x25'),auth[_0x5037('0x7')](),controller['getFaxInteractions']);router[_0x5037('0x6')]('/:id/whatsapp/interactions',auth[_0x5037('0x7')](),controller[_0x5037('0x26')]);router['get']('/:id/teams',auth[_0x5037('0x7')](),controller['getTeams']);router['get'](_0x5037('0x27'),auth['isAuthenticated'](),controller['getLists']);router[_0x5037('0x6')](_0x5037('0x28'),auth[_0x5037('0x7')](),controller[_0x5037('0x29')]);router['get'](_0x5037('0x2a'),auth['isAuthenticated'](),controller[_0x5037('0x2b')]);router[_0x5037('0x6')]('/:id/fax_accounts',auth[_0x5037('0x7')](),controller[_0x5037('0x2c')]);router['get'](_0x5037('0x2d'),auth[_0x5037('0x7')](),controller[_0x5037('0x2e')]);router[_0x5037('0x6')](_0x5037('0x2f'),auth[_0x5037('0x7')](),controller[_0x5037('0x30')]);router[_0x5037('0x6')]('/:id/sms_accounts',auth[_0x5037('0x7')](),controller[_0x5037('0x31')]);router[_0x5037('0x6')](_0x5037('0x32'),auth[_0x5037('0x7')](),controller['getChatWebsites']);router[_0x5037('0x6')](_0x5037('0x33'),auth[_0x5037('0x7')](),controller[_0x5037('0x34')]);router[_0x5037('0x6')](_0x5037('0x35'),auth[_0x5037('0x7')](),controller[_0x5037('0x36')]);router['get']('/:id/api_key',auth['isAuthenticated'](),controller[_0x5037('0x37')]);router[_0x5037('0x38')](_0x5037('0x13'),auth[_0x5037('0x7')](),controller[_0x5037('0x39')]);router[_0x5037('0x38')]('/',auth[_0x5037('0x7')](),controller[_0x5037('0x3a')]);router[_0x5037('0x38')](_0x5037('0x3b'),auth[_0x5037('0x7')](),controller[_0x5037('0x3c')]);router[_0x5037('0x38')](_0x5037('0x15'),auth['isAuthenticated'](),controller[_0x5037('0x3d')]);var upload=multer({'storage':multer[_0x5037('0x3e')]({'destination':function(_0x4c0098,_0x3dc75a,_0x49bf8c){_0x49bf8c(null,path[_0x5037('0x3f')](config[_0x5037('0x40')],'server/files/images/'));},'filename':function(_0x46b2df,_0x2684f2,_0x299f98){_0x299f98(null,util[_0x5037('0x41')](_0x5037('0x42'),Date['now'](),_0x2684f2[_0x5037('0x43')]));}})});router['post'](_0x5037('0xf'),upload[_0x5037('0x44')](_0x5037('0x45')),controller[_0x5037('0x46')]);router[_0x5037('0x38')](_0x5037('0x47'),auth[_0x5037('0x7')](),controller['login']);router['post'](_0x5037('0x48'),auth['isAuthenticated'](),controller[_0x5037('0x49')]);router[_0x5037('0x38')]('/:id/pause',auth[_0x5037('0x7')](),controller[_0x5037('0x4a')]);router[_0x5037('0x38')]('/:id/unpause',auth[_0x5037('0x7')](),controller['unpause']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x5037('0x4b')]);router['post'](_0x5037('0x4c'),auth[_0x5037('0x7')](),controller[_0x5037('0x4d')]);router[_0x5037('0x38')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router['post']('/:id/fax_interactions',auth[_0x5037('0x7')](),controller['addFaxInteractions']);router[_0x5037('0x38')](_0x5037('0x4e'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x5037('0x38')](_0x5037('0x4f'),auth[_0x5037('0x7')](),controller[_0x5037('0x50')]);router[_0x5037('0x38')](_0x5037('0x51'),auth['isAuthenticated'](),controller[_0x5037('0x52')]);router['post']('/:id/fax_accounts',auth[_0x5037('0x7')](),controller[_0x5037('0x53')]);router[_0x5037('0x38')]('/:id/mail_accounts',auth[_0x5037('0x7')](),controller[_0x5037('0x54')]);router[_0x5037('0x38')](_0x5037('0x2f'),auth[_0x5037('0x7')](),controller[_0x5037('0x55')]);router[_0x5037('0x38')](_0x5037('0x56'),auth[_0x5037('0x7')](),controller['addSmsAccounts']);router['post'](_0x5037('0x32'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x5037('0x38')](_0x5037('0x33'),auth[_0x5037('0x7')](),controller[_0x5037('0x57')]);router[_0x5037('0x38')]('/:id/api_key',auth[_0x5037('0x7')](),controller[_0x5037('0x58')]);router[_0x5037('0x59')](_0x5037('0xd'),auth[_0x5037('0x7')](),controller[_0x5037('0x5a')]);router[_0x5037('0x59')]('/:id/password',auth[_0x5037('0x7')](),controller[_0x5037('0x5b')]);router[_0x5037('0x5c')]('/:id/queues',auth[_0x5037('0x7')](),controller[_0x5037('0x5d')]);router[_0x5037('0x5c')](_0x5037('0x5e'),auth['isAuthenticated'](),controller[_0x5037('0x5f')]);router[_0x5037('0x5c')](_0x5037('0xd'),auth[_0x5037('0x7')](),controller[_0x5037('0x60')]);router[_0x5037('0x5c')](_0x5037('0x4c'),auth[_0x5037('0x7')](),controller['removeChatInteractions']);router[_0x5037('0x5c')](_0x5037('0x61'),auth['isAuthenticated'](),controller[_0x5037('0x62')]);router[_0x5037('0x5c')]('/:id/fax_interactions',auth[_0x5037('0x7')](),controller['removeFaxInteractions']);router[_0x5037('0x5c')](_0x5037('0x4e'),auth[_0x5037('0x7')](),controller[_0x5037('0x63')]);router[_0x5037('0x5c')](_0x5037('0x4f'),auth[_0x5037('0x7')](),controller[_0x5037('0x64')]);router[_0x5037('0x5c')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x5037('0x65')]);router[_0x5037('0x5c')](_0x5037('0x66'),auth[_0x5037('0x7')](),controller['removeFaxAccounts']);router[_0x5037('0x5c')](_0x5037('0x2d'),auth[_0x5037('0x7')](),controller['removeMailAccounts']);router[_0x5037('0x5c')](_0x5037('0x2f'),auth[_0x5037('0x7')](),controller[_0x5037('0x67')]);router[_0x5037('0x5c')](_0x5037('0x56'),auth[_0x5037('0x7')](),controller[_0x5037('0x68')]);router[_0x5037('0x5c')](_0x5037('0x32'),auth[_0x5037('0x7')](),controller[_0x5037('0x69')]);router[_0x5037('0x5c')]('/:id/whatsapp_accounts',auth[_0x5037('0x7')](),controller[_0x5037('0x6a')]);router[_0x5037('0x5c')](_0x5037('0x6b'),auth['isAuthenticated'](),controller['removeApiKey']);router[_0x5037('0x38')]('/:id/messengerSoundNotification',auth[_0x5037('0x7')](),controller[_0x5037('0x6c')]);module[_0x5037('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ca90588..dbc9075 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 _0x4a01=['peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','update','update,nonat','TEXT','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlssetup','actpass','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend'];(function(_0xeb9460,_0x201cf8){var _0x3b1527=function(_0x517b7a){while(--_0x517b7a){_0xeb9460['push'](_0xeb9460['shift']());}};_0x3b1527(++_0x201cf8);}(_0x4a01,0x9c));var _0x14a0=function(_0x4c042b,_0x261cdd){_0x4c042b=_0x4c042b-0x0;var _0xe4d30=_0x4a01[_0x4c042b];return _0xe4d30;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require('util');var _=require(_0x14a0('0x0'));module[_0x14a0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x14a0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1883c9){this[_0x14a0('0x3')](_0x14a0('0x2'),_0x1883c9);this[_0x14a0('0x3')](_0x14a0('0x4'),_0x1883c9);},'comment':_0x14a0('0x5')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x46c70b){this[_0x14a0('0x3')]('fullname',_0x46c70b);this[_0x14a0('0x3')](_0x14a0('0x6'),util['format'](_0x14a0('0x7'),_0x46c70b,this[_0x14a0('0x8')](_0x14a0('0x9'))));}},'alias':{'type':Sequelize[_0x14a0('0xa')]},'email':{'type':Sequelize[_0x14a0('0xa')],'allowNull':![],'unique':_0x14a0('0xb'),'validate':{'isEmail':!![]},'set':function(_0x45a80e){if(_0x45a80e){this[_0x14a0('0x3')](_0x14a0('0xb'),_0x45a80e[_0x14a0('0xc')]());}}},'role':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0xe'),_0x14a0('0xf'),_0x14a0('0x10'),_0x14a0('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x14a0('0xa')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x14a0('0xa')],'defaultValue':_0x14a0('0x12')},'internal':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x3535a6){this[_0x14a0('0x3')](_0x14a0('0x9'),_0x3535a6);this['setDataValue'](_0x14a0('0x14'),_0x3535a6);this[_0x14a0('0x3')](_0x14a0('0x6'),util[_0x14a0('0x15')](_0x14a0('0x7'),this[_0x14a0('0x8')](_0x14a0('0x16')),_0x3535a6));}},'salt':{'type':Sequelize[_0x14a0('0xa')]},'phone':{'type':Sequelize[_0x14a0('0xa')]},'mobile':{'type':Sequelize[_0x14a0('0xa')]},'address':{'type':Sequelize[_0x14a0('0xa')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x14a0('0x18')]},'voicePause':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x14a0('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x14a0('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x14a0('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'host':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![],'defaultValue':_0x14a0('0x1a')},'ipaddr':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'port':{'type':Sequelize[_0x14a0('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x1b'),_0x14a0('0xf'),_0x14a0('0x1c')),'allowNull':!![],'defaultValue':_0x14a0('0x1b')},'context':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![],'defaultValue':_0x14a0('0x1d')},'callingpres':{'type':Sequelize[_0x14a0('0xd')]('ALLOWED_NOT_SCREENED',_0x14a0('0x1e'),_0x14a0('0x1f'),_0x14a0('0x20'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x14a0('0x21'),_0x14a0('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'permit':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'secret':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x14a0('0x23'),'set':function(_0x452154){this[_0x14a0('0x3')]('transport',_0x452154?_0x452154[_0x14a0('0x24')](','):null);},'get':function(){return this[_0x14a0('0x8')](_0x14a0('0x25'))?this[_0x14a0('0x8')](_0x14a0('0x25'))[_0x14a0('0x26')](','):null;},'comment':_0x14a0('0x27')},'dtmfmode':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x28'),_0x14a0('0x29'),_0x14a0('0x2a'),_0x14a0('0x2b'),_0x14a0('0x2c')),'allowNull':!![],'defaultValue':_0x14a0('0x28')},'directmedia':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no',_0x14a0('0x2e'),'update',_0x14a0('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x14a0('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'nat':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![],'defaultValue':_0x14a0('0x30'),'set':function(_0x5ece5a){this[_0x14a0('0x3')](_0x14a0('0x31'),_0x5ece5a?_0x5ece5a[_0x14a0('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x14a0('0x31'))?this[_0x14a0('0x8')](_0x14a0('0x31'))[_0x14a0('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x14a0('0xa')]},'namedcallgroup':{'type':Sequelize[_0x14a0('0xa')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x14a0('0xa')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x14a0('0xa')]},'disallow':{'type':Sequelize[_0x14a0('0xa')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x14a0('0xa')],'allowNull':![],'defaultValue':_0x14a0('0x32'),'set':function(_0x5abad8){this['setDataValue']('allow',_0x5abad8?_0x5abad8[_0x14a0('0x24')](';'):_0x14a0('0x32'));},'get':function(){return this[_0x14a0('0x8')](_0x14a0('0x33'))?this['getDataValue'](_0x14a0('0x33'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x86c9f8){this[_0x14a0('0x3')](_0x14a0('0x34'),_0x86c9f8?_0x86c9f8[_0x14a0('0x24')](','):null);},'get':function(){return this[_0x14a0('0x8')](_0x14a0('0x34'))?this['getDataValue']('insecure')[_0x14a0('0x26')](','):null;},'comment':_0x14a0('0x35')},'trustrpid':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no',_0x14a0('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x14a0('0xd')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x14a0('0x37')},'amaflags':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x14a0('0x2d')},'busylevel':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x14a0('0xd')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'template':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no',_0x14a0('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x39'),_0x14a0('0x3a'),_0x14a0('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x3c'),_0x14a0('0x3d')),'allowNull':!![],'defaultValue':_0x14a0('0x3d')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x14a0('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no',_0x14a0('0x3e'),_0x14a0('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x40'),_0x14a0('0x41'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x14a0('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x14a0('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no',_0x14a0('0x2e'),_0x14a0('0x42'),_0x14a0('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x14a0('0xa')]},'resetPasswordExpires':{'type':Sequelize[_0x14a0('0x18')]},'passwordResetAt':{'type':Sequelize[_0x14a0('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x14a0('0x44')]},'showWebBar':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0,'set':function(_0x400146){this[_0x14a0('0x3')]('showWebBar',_0x400146);var _0x4a2323=this['get']({'plain':!![]});switch(_0x400146){case 0x0:case 0x1:var _0x54685a=_0x4a2323[_0x14a0('0x25')]?_['isArray'](_0x4a2323['transport'])?_0x4a2323[_0x14a0('0x25')][_0x14a0('0x24')]():_0x4a2323[_0x14a0('0x25')]:_0x14a0('0x23');if(_0x54685a===_0x14a0('0x45')){_0x54685a=_0x14a0('0x23');}this[_0x14a0('0x3')]('transport',_0x54685a);this[_0x14a0('0x3')](_0x14a0('0x46'),'no');this['setDataValue'](_0x14a0('0x47'),null);this[_0x14a0('0x3')](_0x14a0('0x48'),null);this[_0x14a0('0x3')]('icesupport',null);this[_0x14a0('0x3')](_0x14a0('0x49'),null);this[_0x14a0('0x3')](_0x14a0('0x4a'),null);this[_0x14a0('0x3')]('dtlssetup',null);this['setDataValue'](_0x14a0('0x4b'),null);this[_0x14a0('0x3')](_0x14a0('0x4c'),null);this[_0x14a0('0x3')](_0x14a0('0x4d'),'no');break;case 0x2:this['setDataValue']('transport',_0x14a0('0x45'));this['setDataValue'](_0x14a0('0x46'),_0x14a0('0x2d'));this[_0x14a0('0x3')](_0x14a0('0x47'),_0x14a0('0x2d'));this[_0x14a0('0x3')](_0x14a0('0x48'),_0x14a0('0x2d'));this[_0x14a0('0x3')]('icesupport',_0x14a0('0x2d'));this[_0x14a0('0x3')](_0x14a0('0x49'),_0x14a0('0x2d'));this[_0x14a0('0x3')](_0x14a0('0x4a'),'no');this[_0x14a0('0x3')](_0x14a0('0x4e'),_0x14a0('0x4f'));this[_0x14a0('0x3')](_0x14a0('0x4b'),_0x4a2323['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x14a0('0x4c'),_0x4a2323['dtlsprivatekey']||_0x14a0('0x50'));this[_0x14a0('0x3')]('rtcp_mux',_0x14a0('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x14a0('0x44')],'set':function(_0x2c922b){this[_0x14a0('0x3')](_0x14a0('0x51'),_0x2c922b?_0x2c922b[_0x14a0('0x24')](','):[]);},'get':function(){return this['getDataValue'](_0x14a0('0x51'))?_[_0x14a0('0x52')](this['getDataValue'](_0x14a0('0x51'))[_0x14a0('0x26')](','),function(_0x2b6a3c){return parseInt(_0x2b6a3c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x14a0('0xa')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x14a0('0xa')]},'phoneBarBusyNumber':{'type':Sequelize[_0x14a0('0xa')]},'phoneBarUnconditional':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x14a0('0xd')](_0x14a0('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x14a0('0xa')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x14a0('0x53')],'get':function(){return this[_0x14a0('0x8')](_0x14a0('0x54'))?this[_0x14a0('0x8')](_0x14a0('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x14a0('0xa')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![],'set':function(_0x5452d9){if(typeof _0x5452d9===_0x14a0('0x55')){var _0x557430=_0x5452d9==='1'?!![]:_0x5452d9==='0'?![]:_0x5452d9===_0x14a0('0x56')?!![]:_0x5452d9===_0x14a0('0x57')?![]:![];this[_0x14a0('0x3')](_0x14a0('0x58'),_0x557430);}else{this[_0x14a0('0x3')](_0x14a0('0x58'),_0x5452d9);}}},'blocked':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![],'set':function(_0xcdffef){this[_0x14a0('0x3')](_0x14a0('0x59'),_0xcdffef);if(_0xcdffef===!![]){this[_0x14a0('0x3')](_0x14a0('0x5a'),moment());this[_0x14a0('0x3')](_0x14a0('0x5b'),0x0);}else{this[_0x14a0('0x3')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x14a0('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x14a0('0x13')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x14a0('0x13')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x14a0('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x491b=['user','telephone','local','INTEGER','accountcode','format','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','inband','auto','rfc2833','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','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','accept','refuse','originate','uas','fingerprint','certificate','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','force_avp','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','avpf','icesupport','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','callerid','getDataValue','internal','email','toLowerCase','ENUM'];(function(_0x4a5a89,_0x5caaa9){var _0x508585=function(_0x534704){while(--_0x534704){_0x4a5a89['push'](_0x4a5a89['shift']());}};_0x508585(++_0x5caaa9);}(_0x491b,0x154));var _0xb491=function(_0x194dbf,_0x5035b1){_0x194dbf=_0x194dbf-0x0;var _0xc46816=_0x491b[_0x194dbf];return _0xc46816;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb491('0x0'));var util=require(_0xb491('0x1'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xb491('0x2')],'allowNull':![],'unique':_0xb491('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x42c393){this['setDataValue'](_0xb491('0x3'),_0x42c393);this[_0xb491('0x4')]('defaultuser',_0x42c393);},'comment':_0xb491('0x5')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x31f32d){this[_0xb491('0x4')]('fullname',_0x31f32d);this[_0xb491('0x4')](_0xb491('0x6'),util['format']('\x22%s\x22\x20<%s>',_0x31f32d,this[_0xb491('0x7')](_0xb491('0x8'))));}},'alias':{'type':Sequelize[_0xb491('0x2')]},'email':{'type':Sequelize[_0xb491('0x2')],'allowNull':![],'unique':_0xb491('0x9'),'validate':{'isEmail':!![]},'set':function(_0x338e27){if(_0x338e27){this[_0xb491('0x4')]('email',_0x338e27[_0xb491('0xa')]());}}},'role':{'type':Sequelize[_0xb491('0xb')]('admin',_0xb491('0xc'),'agent',_0xb491('0xd')),'allowNull':![]},'password':{'type':Sequelize[_0xb491('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xb491('0x2')],'defaultValue':_0xb491('0xe')},'internal':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':![],'unique':_0xb491('0x8'),'set':function(_0x4001a2){this['setDataValue']('internal',_0x4001a2);this[_0xb491('0x4')](_0xb491('0x10'),_0x4001a2);this[_0xb491('0x4')](_0xb491('0x6'),util[_0xb491('0x11')](_0xb491('0x12'),this[_0xb491('0x7')](_0xb491('0x13')),_0x4001a2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb491('0x2')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xb491('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xb491('0x2')]},'city':{'type':Sequelize[_0xb491('0x2')]},'country':{'type':Sequelize[_0xb491('0x2')]},'online':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xb491('0x2')],'defaultValue':_0xb491('0x15')},'lastPauseAt':{'type':Sequelize[_0xb491('0x16')]},'chatCapacity':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xb491('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xb491('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0xb491('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x17'),'user',_0xb491('0x18')),'allowNull':!![],'defaultValue':_0xb491('0x17')},'context':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![],'defaultValue':_0xb491('0x19')},'callingpres':{'type':Sequelize[_0xb491('0xb')]('ALLOWED_NOT_SCREENED',_0xb491('0x1a'),_0xb491('0x1b'),'ALLOWED',_0xb491('0x1c'),_0xb491('0x1d'),'PROHIB_FAILED_SCREEN',_0xb491('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb491('0x1f'),'set':function(_0x5a1712){this[_0xb491('0x4')](_0xb491('0x20'),_0x5a1712?_0x5a1712[_0xb491('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xb491('0x20'))?this['getDataValue'](_0xb491('0x20'))[_0xb491('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xb491('0xb')]('rfc2833',_0xb491('0x23'),_0xb491('0x24'),_0xb491('0x25'),_0xb491('0x26')),'allowNull':!![],'defaultValue':_0xb491('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no',_0xb491('0x29'),_0xb491('0x2a'),_0xb491('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![],'defaultValue':_0xb491('0x2c'),'set':function(_0x3b6b5b){this[_0xb491('0x4')](_0xb491('0x2d'),_0x3b6b5b?_0x3b6b5b[_0xb491('0x21')](','):null);},'get':function(){return this[_0xb491('0x7')](_0xb491('0x2d'))?this[_0xb491('0x7')](_0xb491('0x2d'))[_0xb491('0x22')](','):null;},'comment':_0xb491('0x2e')},'callgroup':{'type':Sequelize[_0xb491('0x2')]},'namedcallgroup':{'type':Sequelize[_0xb491('0x2')]},'pickupgroup':{'type':Sequelize[_0xb491('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xb491('0x2')]},'language':{'type':Sequelize[_0xb491('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb491('0x2')]},'disallow':{'type':Sequelize[_0xb491('0x2')],'allowNull':![],'defaultValue':_0xb491('0x2f')},'allow':{'type':Sequelize[_0xb491('0x2')],'allowNull':![],'defaultValue':_0xb491('0x30'),'set':function(_0x1d79c8){this['setDataValue'](_0xb491('0x31'),_0x1d79c8?_0x1d79c8['join'](';'):_0xb491('0x30'));},'get':function(){return this[_0xb491('0x7')](_0xb491('0x31'))?this[_0xb491('0x7')](_0xb491('0x31'))[_0xb491('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![],'set':function(_0x1a28cc){this[_0xb491('0x4')](_0xb491('0x32'),_0x1a28cc?_0x1a28cc[_0xb491('0x21')](','):null);},'get':function(){return this[_0xb491('0x7')](_0xb491('0x32'))?this[_0xb491('0x7')]('insecure')['split'](','):null;},'comment':_0xb491('0x33')},'trustrpid':{'type':Sequelize[_0xb491('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb491('0xb')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xb491('0xb')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no'),'allowNull':!![],'defaultValue':_0xb491('0x28')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no',_0xb491('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xb491('0x35'),_0xb491('0x36'),_0xb491('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xb491('0xb')]('uac',_0xb491('0x38')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xb491('0xb')]('yes','no'),'allowNull':!![],'defaultValue':_0xb491('0x28')},'keepalive':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xb491('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xb491('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb491('0xb')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no',_0xb491('0x39'),_0xb491('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb491('0xb')]('active','passive',_0xb491('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xb491('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xb491('0xb')](_0xb491('0x28'),'no',_0xb491('0x29'),_0xb491('0x2a'),_0xb491('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xb491('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0xb491('0x16')]},'passwordResetAt':{'type':Sequelize[_0xb491('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xb491('0x3d')]},'showWebBar':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0,'set':function(_0x1ff1d4){this[_0xb491('0x4')](_0xb491('0x3e'),_0x1ff1d4);var _0x2cc8e4=this[_0xb491('0x3f')]({'plain':!![]});switch(_0x1ff1d4){case 0x0:case 0x1:var _0x743069=_0x2cc8e4[_0xb491('0x20')]?_[_0xb491('0x40')](_0x2cc8e4['transport'])?_0x2cc8e4[_0xb491('0x20')][_0xb491('0x21')]():_0x2cc8e4[_0xb491('0x20')]:'udp';if(_0x743069===_0xb491('0x41')){_0x743069='udp';}this[_0xb491('0x4')](_0xb491('0x20'),_0x743069);this[_0xb491('0x4')]('encryption','no');this[_0xb491('0x4')]('avpf',null);this['setDataValue'](_0xb491('0x42'),null);this[_0xb491('0x4')]('icesupport',null);this['setDataValue'](_0xb491('0x43'),null);this[_0xb491('0x4')]('dtlsverify',null);this[_0xb491('0x4')](_0xb491('0x44'),null);this['setDataValue'](_0xb491('0x45'),null);this['setDataValue'](_0xb491('0x46'),null);this[_0xb491('0x4')](_0xb491('0x47'),'no');break;case 0x2:this[_0xb491('0x4')](_0xb491('0x20'),'wss');this[_0xb491('0x4')](_0xb491('0x48'),_0xb491('0x28'));this[_0xb491('0x4')](_0xb491('0x49'),_0xb491('0x28'));this[_0xb491('0x4')]('force_avp',_0xb491('0x28'));this['setDataValue'](_0xb491('0x4a'),_0xb491('0x28'));this[_0xb491('0x4')](_0xb491('0x43'),_0xb491('0x28'));this['setDataValue'](_0xb491('0x4b'),'no');this[_0xb491('0x4')](_0xb491('0x44'),_0xb491('0x3b'));this[_0xb491('0x4')](_0xb491('0x45'),_0x2cc8e4[_0xb491('0x45')]||_0xb491('0x4c'));this[_0xb491('0x4')]('dtlsprivatekey',_0x2cc8e4[_0xb491('0x46')]||_0xb491('0x4d'));this[_0xb491('0x4')](_0xb491('0x47'),_0xb491('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0xb491('0x3d')],'set':function(_0x12e2b1){this[_0xb491('0x4')](_0xb491('0x4e'),_0x12e2b1?_0x12e2b1[_0xb491('0x21')](','):[]);},'get':function(){return this[_0xb491('0x7')]('permissions')?_[_0xb491('0x4f')](this[_0xb491('0x7')](_0xb491('0x4e'))['split'](','),function(_0x544763){return parseInt(_0x544763,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xb491('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xb491('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xb491('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xb491('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb491('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb491('0x2')]},'phoneBarEnableJaws':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xb491('0x50')],'get':function(){return this[_0xb491('0x7')]('phoneBarEnableScreenRecordingByAgent')?this[_0xb491('0x7')](_0xb491('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xb491('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xb491('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![],'set':function(_0x16a116){if(typeof _0x16a116===_0xb491('0x52')){var _0x4c990c=_0x16a116==='1'?!![]:_0x16a116==='0'?![]:_0x16a116===_0xb491('0x53')?!![]:_0x16a116===_0xb491('0x54')?![]:![];this[_0xb491('0x4')](_0xb491('0x55'),_0x4c990c);}else{this['setDataValue'](_0xb491('0x55'),_0x16a116);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3d7a04){this[_0xb491('0x4')]('blocked',_0x3d7a04);if(_0x3d7a04===!![]){this['setDataValue'](_0xb491('0x56'),moment());this[_0xb491('0x4')](_0xb491('0x57'),0x0);}else{this[_0xb491('0x4')](_0xb491('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xb491('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xb491('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb491('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb491('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xb491('0xf')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xb491('0x14')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a1dd7f3..671a1bf 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 _0x502b=['user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$or','$gt','$lt','$lte','$ne','$eq','$between','$in','$notIn','$notILike','$contains','$any','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','idle','unknown','teams','queues','inbound','toString','col','asc','substring','uniqBy','orderBy','pause','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','QueryTypes','select','ui.','field','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/realtime/agents','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','agent','emit','userNotification:recalc:','destroy','get','role','Users','user','Agents','Telephones','telephone','filter','map','value','find','name','error','User','rawAttributes','type','key','password','salt','resetPasswordToken','resetPasswordExpires','md5secret','includes','getOptions','where','include','query','userSetting','true','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','all','catch','show','UserSetting','merge','options','whatsapp','body','params','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','min_internal','isNil','sequelize','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','102','113','110','104','105','107','108','109','100','114','115','create','admin','settingsEnabled','userProfileId','UserProfileSection','UserProfileResource','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','Queues','penalty','spread','toLowerCase','QueueId','Queue:save','VoiceQueue','voice','format','UserVoiceQueueRt','removeQueues','remove','isArray','Queue:remove','addAvatar','userpic','filename','existsSync','join','root','server/files/images/','download','getOpenTabs','openchannel','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','CmList','List','Tag','Tags','color','tag','getQueues','model','keys','Queue','filters','intersection','fields','order','sort','pick','Unknown\x20role','hasOwnProperty','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','interface','intrf','SIP/%s','user:%s','headers','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','DEFAULT\x20PAUSE','bulkCreate','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','smsPause','whatsappPause','lastPauseAt','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','addAgent','Voice','upsert','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','removeAgent','getLists','getAgents','send','You\x20can\x27t\x20delete\x20yourself','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','user_has_openchannel_interactions:remove','addWhatsappInteractions'];(function(_0x316839,_0x159076){var _0x34d569=function(_0x3220f5){while(--_0x3220f5){_0x316839['push'](_0x316839['shift']());}};_0x34d569(++_0x159076);}(_0x502b,0x1d0));var _0xb502=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x502b[_0xc8db6b];return _0x12cb81;};'use strict';var moment=require(_0xb502('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xb502('0x1'));var squel=require(_0xb502('0x2'));var Redis=require(_0xb502('0x3'));var authService=require(_0xb502('0x4'));var contacts=require('../../components/contacts');var qs=require(_0xb502('0x5'));var rta=require(_0xb502('0x6'));var logger=require('../../config/logger')(_0xb502('0x7'));var utils=require(_0xb502('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0xb502('0x9'));var APIBadRequestError=require(_0xb502('0xa'))[_0xb502('0xb')];var APINotFoundError=require('../../errors/api')[_0xb502('0xc')];var APIHandleError=require(_0xb502('0xa'))['handleError'];var db=require(_0xb502('0xd'))['db'];var socket=require(_0xb502('0xe'))(new Redis(config[_0xb502('0xf')]));require(_0xb502('0x10'))[_0xb502('0x11')](socket);config['redis']=_[_0xb502('0x12')](config['redis'],{'host':_0xb502('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0xfd0deb,_0x44fa0f){_0x44fa0f=_0x44fa0f||0xcc;return function(_0xe11a2){if(_0xe11a2){return _0xfd0deb[_0xb502('0x14')](_0x44fa0f);}return _0xfd0deb[_0xb502('0x15')](_0x44fa0f)[_0xb502('0x16')]();};}function respondWithResult(_0x12f7c8,_0x2026b8){_0x2026b8=_0x2026b8||0xc8;return function(_0x2b0336){if(_0x2b0336){return _0x12f7c8['status'](_0x2026b8)['json'](_0x2b0336);}};}function respondWithFilteredResult(_0x6d87ea,_0x76fa96){return function(_0x421ca7){if(_0x421ca7){var _0x2dd3f5=typeof _0x76fa96[_0xb502('0x17')]===_0xb502('0x18')&&typeof _0x76fa96[_0xb502('0x19')]==='undefined';var _0x443e57=_0x421ca7[_0xb502('0x1a')];var _0x4cb950=_0x2dd3f5?0x0:_0x76fa96[_0xb502('0x17')];var _0x56bf5a=_0x2dd3f5?_0x421ca7['count']:_0x76fa96[_0xb502('0x17')]+_0x76fa96['limit'];var _0x416ece;if(_0x56bf5a>=_0x443e57){_0x56bf5a=_0x443e57;_0x416ece=0xc8;}else{_0x416ece=0xce;}_0x6d87ea[_0xb502('0x15')](_0x416ece);return _0x6d87ea[_0xb502('0x1b')](_0xb502('0x1c'),_0x4cb950+'-'+_0x56bf5a+'/'+_0x443e57)[_0xb502('0x1d')](_0x421ca7);}return null;};}function saveUpdates(_0x358cee){return function(_0xf8488b){if(_0xf8488b){return _0xf8488b[_0xb502('0x1e')](_0x358cee)[_0xb502('0x1f')](function(_0x2b7e4a){if(_0x2b7e4a['role']===_0xb502('0x20')){socket[_0xb502('0x21')](_0xb502('0x22')+_0x2b7e4a['id'],_0x2b7e4a);}return _0x2b7e4a;});}return null;};}function removeEntity(_0x35cd44){return function(_0x2ff669){if(_0x2ff669){return _0x2ff669[_0xb502('0x23')]()[_0xb502('0x1f')](function(){var _0x645ae2=_0x2ff669[_0xb502('0x24')]({'plain':!![]});if(_0x645ae2[_0xb502('0x25')]==='admin')return;var _0xefe12b=[{'name':_0xb502('0x26'),'value':_0xb502('0x27'),'ignore':!![]},{'name':_0xb502('0x28'),'value':_0xb502('0x20'),'ignore':![]},{'name':_0xb502('0x29'),'value':_0xb502('0x2a'),'ignore':![]}];var _0x36f5b8=_(_0xefe12b)[_0xb502('0x2b')]('ignore')[_0xb502('0x2c')](_0xb502('0x2d'))[_0xb502('0x2d')]();if(_['includes'](_0x36f5b8,_0x645ae2[_0xb502('0x25')])){return;}var _0x3cd250=_[_0xb502('0x2e')](_0xefe12b,[_0xb502('0x2d'),_0x645ae2[_0xb502('0x25')]])[_0xb502('0x2f')];return db['UserProfileResource'][_0xb502('0x23')]({'where':{'type':_0x3cd250,'resourceId':_0x645ae2['id']}})[_0xb502('0x1f')](function(){return _0x2ff669;});})[_0xb502('0x1f')](function(){_0x35cd44[_0xb502('0x15')](0xcc)[_0xb502('0x16')]();});}};}function handleEntityNotFound(_0x422240){return function(_0x58c39b){if(!_0x58c39b){_0x422240[_0xb502('0x14')](0x194);}return _0x58c39b;};}function handleError(_0x5b6b42,_0x102695){_0x102695=_0x102695||0x1f4;return function(_0x267c86){logger[_0xb502('0x30')](_0x267c86['stack']);if(_0x267c86[_0xb502('0x2f')]){delete _0x267c86[_0xb502('0x2f')];}_0x5b6b42[_0xb502('0x15')](_0x102695)['send'](_0x267c86);};}function getUserAttributes(){return _(db[_0xb502('0x31')][_0xb502('0x32')])[_0xb502('0x2c')](function(_0x44a9c0){return{'name':_0x44a9c0['fieldName'],'type':_0x44a9c0[_0xb502('0x33')][_0xb502('0x34')]};})['filter'](function(_0x4ed9ed){return![_0xb502('0x35'),_0xb502('0x36'),'previousPasswords',_0xb502('0x37'),_0xb502('0x38'),_0xb502('0x39')][_0xb502('0x3a')](_0x4ed9ed[_0xb502('0x2f')]);})[_0xb502('0x2d')]();}exports['index']=function(_0x951865,_0x2da685){var _0x38fb7b={},_0x3fb5f0={'count':0x0,'rows':[]};var _0x497c36=getUserAttributes();_0x38fb7b=qs[_0xb502('0x3b')](_0x497c36,_0x951865);var _0x599fce={'where':_0x38fb7b[_0xb502('0x3c')]};return db[_0xb502('0x31')][_0xb502('0x1a')](_0x599fce)['then'](function(_0x286aac){_0x3fb5f0[_0xb502('0x1a')]=_0x286aac;if(_0x951865['query']['includeAll']){_0x38fb7b[_0xb502('0x3d')]=[{'all':!![]}];}if(_0x951865[_0xb502('0x3e')][_0xb502('0x3f')]===_0xb502('0x40')){_0x38fb7b[_0xb502('0x3d')]=[{'model':db['UserSetting'],'as':_0xb502('0x3f')}];}if(!_[_0xb502('0x3a')](_0x38fb7b[_0xb502('0x41')],'id')){_0x38fb7b[_0xb502('0x41')][_0xb502('0x42')]('id');}return db['User'][_0xb502('0x43')](_0x38fb7b);})[_0xb502('0x1f')](function(_0x28acc5){_0x3fb5f0[_0xb502('0x44')]=_0x28acc5;if(_0x951865[_0xb502('0x3e')][_0xb502('0x45')]===_0xb502('0x40')){var _0x501bd9=[];for(var _0x17859f=0x0;_0x17859f<_0x3fb5f0[_0xb502('0x44')][_0xb502('0x46')];_0x17859f++){_0x501bd9[_0xb502('0x42')](get_open_tabs(_0xb502('0x47'),_0x3fb5f0[_0xb502('0x44')][_0x17859f][_0xb502('0x48')]));_0x501bd9[_0xb502('0x42')](get_open_tabs(_0xb502('0x49'),_0x3fb5f0[_0xb502('0x44')][_0x17859f][_0xb502('0x48')]));_0x501bd9[_0xb502('0x42')](get_open_tabs(_0xb502('0x4a'),_0x3fb5f0[_0xb502('0x44')][_0x17859f][_0xb502('0x48')]));_0x501bd9['push'](get_open_tabs(_0xb502('0x4b'),_0x3fb5f0[_0xb502('0x44')][_0x17859f][_0xb502('0x48')]));_0x501bd9[_0xb502('0x42')](get_open_tabs('openchannel',_0x3fb5f0[_0xb502('0x44')][_0x17859f][_0xb502('0x48')]));_0x501bd9[_0xb502('0x42')](get_open_tabs('whatsapp',_0x3fb5f0[_0xb502('0x44')][_0x17859f][_0xb502('0x48')]));}return Promise[_0xb502('0x4c')](_0x501bd9)[_0xb502('0x1f')](function(){return _0x3fb5f0;});}else{return _0x3fb5f0;}})[_0xb502('0x1f')](respondWithFilteredResult(_0x2da685,_0x38fb7b))[_0xb502('0x4d')](handleError(_0x2da685,null));};exports[_0xb502('0x4e')]=function(_0x357360,_0x482744){var _0x117c14=getUserAttributes();_0x357360[_0xb502('0x3e')]['id']=_0x357360['params']['id'];var _0x567990=qs[_0xb502('0x3b')](_0x117c14,_0x357360);if(_0x357360[_0xb502('0x3e')]['includeAll']){_0x567990[_0xb502('0x3d')]=[{'all':!![]}];}if(_0x357360[_0xb502('0x3e')][_0xb502('0x3f')]==='true'){_0x567990[_0xb502('0x3d')]=[{'model':db[_0xb502('0x4f')],'as':_0xb502('0x3f')}];}_0x567990=_[_0xb502('0x50')]({},_0x567990,_0x357360[_0xb502('0x51')]);if(!_[_0xb502('0x3a')](_0x567990['attributes'],'id')){_0x567990[_0xb502('0x41')]['push']('id');}return db[_0xb502('0x31')][_0xb502('0x2e')](_0x567990)[_0xb502('0x1f')](handleEntityNotFound(_0x482744,null))[_0xb502('0x1f')](function(_0x11826d){var _0x611de2=[];values=_0x11826d;if(_0x357360[_0xb502('0x3e')][_0xb502('0x45')]===_0xb502('0x40')){_0x611de2[_0xb502('0x42')](get_open_tabs(_0xb502('0x47'),_0x11826d['dataValues']));_0x611de2[_0xb502('0x42')](get_open_tabs(_0xb502('0x49'),_0x11826d[_0xb502('0x48')]));_0x611de2[_0xb502('0x42')](get_open_tabs('openchannel',_0x11826d[_0xb502('0x48')]));_0x611de2[_0xb502('0x42')](get_open_tabs(_0xb502('0x52'),_0x11826d[_0xb502('0x48')]));_0x611de2[_0xb502('0x42')](get_open_tabs('fax',_0x11826d[_0xb502('0x48')]));_0x611de2[_0xb502('0x42')](get_open_tabs('mail',_0x11826d['dataValues']));return Promise['all'](_0x611de2);}else{return values;}})[_0xb502('0x1f')](function(){return values;})[_0xb502('0x1f')](respondWithResult(_0x482744,null))[_0xb502('0x4d')](handleError(_0x482744,null));};exports['update']=function(_0x1de756,_0x54db9e){if(_0x1de756[_0xb502('0x53')]['id']){delete _0x1de756[_0xb502('0x53')]['id'];}delete _0x1de756[_0xb502('0x53')][_0xb502('0x25')];return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x1de756[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x54db9e,null))['then'](saveUpdates(_0x1de756[_0xb502('0x53')],null))[_0xb502('0x1f')](respondWithResult(_0x54db9e,null))['catch'](handleError(_0x54db9e,null));};exports['describe']=function(_0x1517d6,_0x179be3){return db['User'][_0xb502('0x55')]()[_0xb502('0x1f')](respondWithResult(_0x179be3,null))[_0xb502('0x4d')](handleError(_0x179be3,null));};exports[_0xb502('0x56')]=function(_0x5963f6,_0x168a13){return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x5963f6['params']['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x168a13,null))[_0xb502('0x1f')](function(_0x40b870){if(_0x40b870){return _0x40b870[_0xb502('0x56')](_0x5963f6[_0xb502('0x53')][_0xb502('0x57')],_[_0xb502('0x58')](_0x5963f6['body'],[_0xb502('0x57'),'id'])||{});}})['then'](respondWithResult(_0x168a13,null))[_0xb502('0x4d')](handleError(_0x168a13,null));};function validateUser(_0x220e6a){return new Promise(function(_0x4962af,_0x56540d){if(_0x220e6a[_0xb502('0x59')])return _0x4962af(_0x220e6a);return db['Setting'][_0xb502('0x5a')](0x1)['then'](function(_0x485d54){if(_0x485d54[_0xb502('0x5b')])authService[_0xb502('0x5c')](_0x220e6a[_0xb502('0x35')]);db[_0xb502('0x31')][_0xb502('0x5d')]('internal')[_0xb502('0x1f')](function(_0x6e65a4){if(_['isNil'](_0x6e65a4)){_0x220e6a[_0xb502('0x59')]=_0x485d54[_0xb502('0x5e')]||0x1;return;}if(_[_0xb502('0x5f')](_0x485d54[_0xb502('0x5e')])||_0x485d54[_0xb502('0x5e')]===_0x6e65a4){_0x220e6a['internal']=_0x6e65a4+0x1;return;}if(_0x485d54['min_internal']>_0x6e65a4){_0x220e6a[_0xb502('0x59')]=_0x485d54[_0xb502('0x5e')];return;}return db[_0xb502('0x60')][_0xb502('0x3e')]('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)',{'type':db[_0xb502('0x60')]['QueryTypes'][_0xb502('0x61')]})[_0xb502('0x1f')](function(_0x378038){if(_0x378038&&_0x378038[_0xb502('0x46')]){for(var _0x510003=0x0,_0x1b5404=_0x378038['length'];_0x510003<_0x1b5404&&_[_0xb502('0x5f')](_0x220e6a[_0xb502('0x59')]);_0x510003++){if(_0x485d54['min_internal']<=_0x378038[_0x510003][_0xb502('0x62')]){_0x220e6a['internal']=_0x378038[_0x510003][_0xb502('0x62')];}else if(_0x485d54[_0xb502('0x5e')]>_0x378038[_0x510003][_0xb502('0x62')]&&_0x485d54[_0xb502('0x5e')]<=_0x378038[_0x510003]['to']){_0x220e6a[_0xb502('0x59')]=_0x485d54['min_internal'];}}}if(_['isNil'](_0x220e6a[_0xb502('0x59')])){_0x220e6a[_0xb502('0x59')]=_0x6e65a4+0x1;}return _0x4962af(_0x220e6a);});});})[_0xb502('0x4d')](function(_0x4dc726){_0x56540d(_0x4dc726);});});}function updateUser(_0x28c3ea){return new Promise(function(_0x5cb399,_0xdb4a44){try{if(_0x28c3ea[_0xb502('0x63')]){_0x28c3ea[_0xb502('0x64')]=_0x28c3ea[_0xb502('0x59')];_0x28c3ea[_0xb502('0x65')]={'mailbox':_0x28c3ea[_0xb502('0x59')],'password':_0x28c3ea[_0xb502('0x35')],'fullname':_0x28c3ea[_0xb502('0x66')],'email':_0x28c3ea[_0xb502('0x67')]};}if(_0x28c3ea[_0xb502('0x25')]===_0xb502('0x20')){if(!_0x28c3ea[_0xb502('0x68')])_0x28c3ea[_0xb502('0x68')]=['101',_0xb502('0x69'),'103',_0xb502('0x6a'),_0xb502('0x6b'),_0xb502('0x6c'),_0xb502('0x6d'),'106',_0xb502('0x6e'),_0xb502('0x6f'),_0xb502('0x70'),_0xb502('0x71'),'111',_0xb502('0x72'),_0xb502('0x73')];}_0x5cb399(_0x28c3ea);}catch(_0x37ae2c){_0xdb4a44(_0x37ae2c);}});}exports[_0xb502('0x74')]=function(_0x4978a9,_0x32e813){if(_0x4978a9['user'][_0xb502('0x25')]===_0xb502('0x20'))throw new Error('Unauthorized');if(_0x4978a9[_0xb502('0x53')]['role']==='user'&&_0x4978a9['user'][_0xb502('0x25')]!==_0xb502('0x75')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x4978a9[_0xb502('0x53')][_0xb502('0x25')]===_0xb502('0x75')&&_0x4978a9[_0xb502('0x27')][_0xb502('0x25')]!==_0xb502('0x75')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x4978a9[_0xb502('0x53')]])[_0xb502('0x1f')](function(){return validateUser(_0x4978a9['body']);})[_0xb502('0x1f')](function(_0x12b08c){return updateUser(_0x12b08c)[_0xb502('0x1f')](function(_0x553c8c){if(_0x553c8c[_0xb502('0x25')]===_0xb502('0x75')){_0x553c8c[_0xb502('0x76')]=_0x4978a9[_0xb502('0x27')]['settingsEnabled'];delete _0x553c8c[_0xb502('0x77')];}return _0x553c8c;});})[_0xb502('0x1f')](function(_0x23ee70){return db['User']['create'](_0x23ee70,{'include':[{'model':db[_0xb502('0x65')],'as':_0xb502('0x65')}]});})[_0xb502('0x1f')](function(_0x369a5c){if(_0x4978a9[_0xb502('0x53')][_0xb502('0x25')]===_0xb502('0x27'))return _0x369a5c;if(_0x4978a9[_0xb502('0x27')][_0xb502('0x25')]!=='user')return _0x369a5c;return db[_0xb502('0x78')][_0xb502('0x2e')]({'where':{'name':_0x369a5c[_0xb502('0x25')]===_0xb502('0x20')?_0xb502('0x28'):'Telephones','userProfileId':_0x4978a9[_0xb502('0x27')]['userProfileId']},'raw':!![]})[_0xb502('0x1f')](function(_0x1393b1){if(!_0x1393b1||_0x1393b1['autoAssociation']!=0x0)return _0x369a5c;return db[_0xb502('0x79')][_0xb502('0x74')]({'name':_0x369a5c[_0xb502('0x2f')],'resourceId':_0x369a5c['id'],'type':_0x1393b1['name'],'sectionId':_0x1393b1['id']},{})[_0xb502('0x1f')](function(){return _0x369a5c;});})[_0xb502('0x4d')](function(_0x3e22b0){logger[_0xb502('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e22b0);throw _0x3e22b0;});})['then'](respondWithResult(_0x32e813,0xc9))['catch'](handleError(_0x32e813,null));};exports['bulkCreate']=function(_0x3bbaf8,_0x581c8f){var _0x1c774a=_0x3bbaf8[_0xb502('0x53')];var _0x43da7f=[];if(_0x3bbaf8[_0xb502('0x27')]['role']==='agent')throw new Error(_0xb502('0x7a'));if(_[_0xb502('0x7b')](_0x1c774a,[_0xb502('0x25'),_0xb502('0x27')])&&_0x3bbaf8[_0xb502('0x27')][_0xb502('0x25')]!==_0xb502('0x75')){throw new Error(_0xb502('0x7c'));}if(_[_0xb502('0x7b')](_0x1c774a,[_0xb502('0x25'),_0xb502('0x75')])&&_0x3bbaf8['user'][_0xb502('0x25')]!=='admin'){throw new Error(_0xb502('0x7d'));}return licenseUtil['checkUserLimits'](_0x1c774a)['then'](function(){return validateUser(_0x1c774a[0x0]);})['then'](function(){for(var _0x2c38bc=0x1;_0x2c38bc<_0x1c774a[_0xb502('0x46')];_0x2c38bc++){var _0x18d861=_0x1c774a[_0x2c38bc-0x1][_0xb502('0x59')];if(!_0x1c774a[_0x2c38bc]['internal'])_0x1c774a[_0x2c38bc][_0xb502('0x59')]=_0x18d861+0x1;_0x43da7f['push'](validateUser(_0x1c774a[_0x2c38bc]));}return Promise[_0xb502('0x4c')](_0x43da7f);})[_0xb502('0x1f')](function(){_0x43da7f=[];for(var _0x3dab63=0x0;_0x3dab63<_0x1c774a['length'];_0x3dab63++){_0x43da7f[_0xb502('0x42')](updateUser(_0x1c774a[_0x3dab63]));}return Promise['all'](_0x43da7f);})[_0xb502('0x1f')](function(){_0x43da7f=_0x1c774a[_0xb502('0x2c')](function(_0xa64e7b){return db[_0xb502('0x31')][_0xb502('0x74')](_0xa64e7b,{'include':[{'model':db[_0xb502('0x65')],'as':_0xb502('0x65')}]})[_0xb502('0x1f')](function(_0x5e0600){_0xa64e7b['id']=_0x5e0600['id'];return _0xa64e7b;});});return Promise[_0xb502('0x4c')](_0x43da7f);})[_0xb502('0x1f')](function(_0x5ad75d){if(_0x3bbaf8[_0xb502('0x53')][_0xb502('0x25')]===_0xb502('0x27'))return _0x5ad75d;if(_0x3bbaf8[_0xb502('0x27')][_0xb502('0x25')]!==_0xb502('0x27'))return _0x5ad75d;var _0x1564d5=_[_0xb502('0x7b')](_0x5ad75d,function(_0x1f7f4){return _0x1f7f4[_0xb502('0x25')]==='agent'||_0x1f7f4[_0xb502('0x25')]===_0xb502('0x2a');});if(!_0x1564d5)return _0x5ad75d;return db[_0xb502('0x78')][_0xb502('0x43')]({'where':{'name':{'$or':[_0xb502('0x28'),_0xb502('0x29')]},'userProfileId':_0x3bbaf8['user'][_0xb502('0x77')]},'raw':!![]})[_0xb502('0x1f')](function(_0x455f0c){if(_[_0xb502('0x7e')](_0x455f0c)||!_['some'](_0x455f0c,['autoAssociation',0x0]))return _0x5ad75d;_0x43da7f=[];var _0xf84812=_(_0x455f0c)['map'](function(_0x1e2593){if(_0x1e2593['autoAssociation']===0x1)return;return _0x1e2593[_0xb502('0x2f')]===_0xb502('0x28')?_0xb502('0x20'):'telephone';})['compact']()[_0xb502('0x2d')]();for(var _0x2b0de2=0x0;_0x2b0de2<_0x5ad75d[_0xb502('0x46')];_0x2b0de2++){if(!_['includes'](_0xf84812,_0x5ad75d[_0x2b0de2][_0xb502('0x25')]))return;var _0x50405b=_0x5ad75d[_0x2b0de2][_0xb502('0x25')]===_0xb502('0x20')?_0xb502('0x28'):_0xb502('0x29');_0x43da7f[_0xb502('0x42')](db[_0xb502('0x79')][_0xb502('0x74')]({'name':_0x5ad75d[_0x2b0de2]['name'],'resourceId':_0x5ad75d[_0x2b0de2]['id'],'type':_0x50405b,'sectionId':_[_0xb502('0x2e')](_0x455f0c,[_0xb502('0x2f'),_0x50405b])['id']},{}));}return Promise['all'](_0x43da7f);});})[_0xb502('0x1f')](respondWithResult(_0x581c8f,0xc9))[_0xb502('0x4d')](handleError(_0x581c8f,null));};exports[_0xb502('0x7f')]=function(_0x48a97d,_0x20ed88){if(_0x48a97d['body']['id']){delete _0x48a97d[_0xb502('0x53')]['id'];}return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x48a97d['params']['id']}})['then'](function(_0x1a73b9){if(!_0x1a73b9)return null;if(_0x1a73b9['id']===_0x48a97d[_0xb502('0x27')]['id']){if(!_0x48a97d[_0xb502('0x53')][_0xb502('0x80')]||!_0x48a97d[_0xb502('0x53')][_0xb502('0x81')]){throw new db['Sequelize'][(_0xb502('0x82'))](_0xb502('0x83'));}if(!_0x1a73b9['authenticate'](_0x48a97d[_0xb502('0x53')][_0xb502('0x80')])){throw new db[(_0xb502('0x84'))][(_0xb502('0x82'))](_0xb502('0x85'));}if(_0x48a97d[_0xb502('0x53')][_0xb502('0x80')]===_0x48a97d[_0xb502('0x53')][_0xb502('0x81')]){throw new db[(_0xb502('0x84'))][(_0xb502('0x82'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x48a97d[_0xb502('0x27')]['role']==='admin'){if(!_0x48a97d[_0xb502('0x53')]['newPassword']){throw new db[(_0xb502('0x84'))][(_0xb502('0x82'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x48a97d[_0xb502('0x27')][_0xb502('0x25')]===_0xb502('0x27')){if(!_0x48a97d[_0xb502('0x53')][_0xb502('0x81')]){throw new db[(_0xb502('0x84'))][(_0xb502('0x82'))](_0xb502('0x86'));}if(_0x1a73b9[_0xb502('0x25')]!=='agent'){throw new db[(_0xb502('0x84'))][(_0xb502('0x82'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0xb502('0x82'))](_0xb502('0x7a'));}return _0x1a73b9;})[_0xb502('0x1f')](handleEntityNotFound(_0x20ed88,null))[_0xb502('0x1f')](function(_0x3504f5){return db[_0xb502('0x87')][_0xb502('0x88')]({'attributes':['id','securePassword',_0xb502('0x89'),_0xb502('0x8a')]})[_0xb502('0x1f')](function(_0x59aefc){if(_0x59aefc['securePassword'])authService[_0xb502('0x5c')](_0x48a97d[_0xb502('0x53')][_0xb502('0x81')]);if(!_0x59aefc[_0xb502('0x89')]||!_0x3504f5[_0xb502('0x8b')])return _0x3504f5;authService[_0xb502('0x8c')](_0x48a97d[_0xb502('0x53')]['newPassword'],_0x3504f5[_0xb502('0x8b')],_0x59aefc['passwordHistoryLimit']);return _0x3504f5;})[_0xb502('0x1f')](saveUpdates({'password':_0x48a97d[_0xb502('0x53')][_0xb502('0x81')],'passwordResetAt':_0x48a97d[_0xb502('0x27')]['id']==_0x48a97d[_0xb502('0x54')]['id']?moment():null,'previousPasswords':authService[_0xb502('0x8d')](_0x48a97d[_0xb502('0x53')]['newPassword'],_0x3504f5['previousPasswords'])},null));})[_0xb502('0x1f')](respondWithResult(_0x20ed88,null))[_0xb502('0x4d')](handleError(_0x20ed88,null));};exports[_0xb502('0x8e')]=function(_0xc7c676,_0x576817){var _0x20146a=_0xc7c676[_0xb502('0x53')][_0xb502('0x8f')];return db['User'][_0xb502('0x2e')]({'where':{'id':_0xc7c676['params']['id']},'attributes':['id',_0xb502('0x2f'),_0xb502('0x25'),_0xb502('0x90'),_0xb502('0x91'),_0xb502('0x92'),'interface']})['then'](handleEntityNotFound(_0x576817,null))[_0xb502('0x1f')](function(_0x1bac05){if(_0x1bac05){if(!utils[_0xb502('0x93')](_0x20146a)){throw new db['Sequelize'][(_0xb502('0x82'))](_0xb502('0x94'));}return _0x1bac05[_0xb502('0x95')+_[_0xb502('0x96')](_0x20146a['toLowerCase']())+_0xb502('0x97')](_0xc7c676[_0xb502('0x53')]['ids'],{'penalty':_0xc7c676['body'][_0xb502('0x98')]||0x0})[_0xb502('0x99')](function(_0x448f96){for(var _0x291402=0x0;_0x291402<_0xc7c676['body']['ids']['length'];_0x291402+=0x1){var _0x2f4fe2={'UserId':Number(_0xc7c676[_0xb502('0x54')]['id'])};_0x2f4fe2[_[_0xb502('0x96')](_0x20146a[_0xb502('0x9a')]())+_0xb502('0x9b')]=Number(_0xc7c676['body'][_0xb502('0x57')][_0x291402]);socket[_0xb502('0x21')]('user'+_['capitalize'](_0x20146a[_0xb502('0x9a')]())+_0xb502('0x9c'),_0x2f4fe2);}return _0x448f96;})[_0xb502('0x1f')](function(){if(_0x20146a==='voice'){return db[_0xb502('0x9d')][_0xb502('0x43')]({'where':{'id':_0xc7c676['body']['ids']||[]},'raw':!![],'attributes':['id',_0xb502('0x2f')]});}})['then'](function(_0x38c4d4){var _0x4f13ae=_0x1bac05[_0xb502('0x24')]({'plain':!![]});var _0xd57c2=[];if(_0x20146a===_0xb502('0x9e')&&_0x4f13ae[_0xb502('0x25')]===_0xb502('0x20')&&_0x4f13ae[_0xb502('0x90')]){for(let _0x59ddf6=0x0;_0x59ddf6<_0x38c4d4[_0xb502('0x46')];_0x59ddf6+=0x1){_0xd57c2[_0xb502('0x42')]({'membername':_0x4f13ae['name'],'UserId':_0x4f13ae['id'],'queue_name':_0x38c4d4[_0x59ddf6]['name'],'VoiceQueueId':_0x38c4d4[_0x59ddf6]['id'],'interface':_[_0xb502('0x5f')](_0x4f13ae['interface'])?util[_0xb502('0x9f')]('SIP/%s',_0x4f13ae[_0xb502('0x2f')]):_0x4f13ae['interface'],'paused':_0x4f13ae[_0xb502('0x92')]||![],'penalty':_0xc7c676[_0xb502('0x53')][_0xb502('0x98')]||0x0});}return Promise['all'](_0xd57c2[_0xb502('0x2c')](function(_0x443188){return db[_0xb502('0xa0')]['upsert'](_0x443188);}));}return _0x1bac05;});}})[_0xb502('0x1f')](respondWithStatusCode(_0x576817,null))[_0xb502('0x4d')](handleError(_0x576817,null));};exports[_0xb502('0xa1')]=function(_0x3accee,_0x54c293){var _0x479711,_0x420cc5;return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x3accee['params']['id']},'attributes':['id',_0xb502('0x2f'),_0xb502('0x25')]})['then'](handleEntityNotFound(_0x54c293,null))[_0xb502('0x1f')](function(_0x24ec01){if(_0x24ec01){_0x479711=_0x24ec01;if(!_0x3accee[_0xb502('0x3e')][_0xb502('0x8f')]||!utils[_0xb502('0x93')](_0x3accee[_0xb502('0x3e')][_0xb502('0x8f')])){throw new db['Sequelize'][(_0xb502('0x82'))](_0xb502('0x94'));}return _0x24ec01[_0xb502('0xa2')+_['capitalize'](_0x3accee[_0xb502('0x3e')][_0xb502('0x8f')][_0xb502('0x9a')]())+_0xb502('0x97')](_0x3accee[_0xb502('0x3e')][_0xb502('0x57')]);}})[_0xb502('0x1f')](function(_0x340b0d){if(_[_0xb502('0xa3')](_0x3accee[_0xb502('0x3e')][_0xb502('0x57')])){for(var _0x4f3ae8=0x0;_0x4f3ae8<_0x3accee[_0xb502('0x3e')]['ids'][_0xb502('0x46')];_0x4f3ae8+=0x1){_0x420cc5={'UserId':Number(_0x3accee[_0xb502('0x54')]['id'])};_0x420cc5[_['capitalize'](_0x3accee[_0xb502('0x3e')][_0xb502('0x8f')][_0xb502('0x9a')]())+_0xb502('0x9b')]=Number(_0x3accee[_0xb502('0x3e')]['ids'][_0x4f3ae8]);socket[_0xb502('0x21')]('user'+_[_0xb502('0x96')](_0x3accee[_0xb502('0x3e')][_0xb502('0x8f')]['toLowerCase']())+_0xb502('0xa4'),_0x420cc5);}}else{_0x420cc5={'UserId':Number(_0x3accee['params']['id'])};_0x420cc5[_[_0xb502('0x96')](_0x3accee[_0xb502('0x3e')][_0xb502('0x8f')][_0xb502('0x9a')]())+'QueueId']=Number(_0x3accee['query'][_0xb502('0x57')]);socket[_0xb502('0x21')](_0xb502('0x27')+_[_0xb502('0x96')](_0x3accee[_0xb502('0x3e')]['channel']['toLowerCase']())+'Queue:remove',_0x420cc5);}return _0x340b0d;})[_0xb502('0x1f')](function(){if(_0x3accee[_0xb502('0x3e')][_0xb502('0x8f')]==='voice'){return db[_0xb502('0xa0')][_0xb502('0x23')]({'where':{'UserId':_0x3accee['params']['id'],'VoiceQueueId':_0x3accee[_0xb502('0x3e')][_0xb502('0x57')]},'individualHooks':!![]})[_0xb502('0x1f')](function(){return _0x479711;});}return _0x479711;})[_0xb502('0x1f')](respondWithStatusCode(_0x54c293,null))[_0xb502('0x4d')](handleError(_0x54c293,null));};exports[_0xb502('0xa5')]=function(_0x2399dd,_0x681404){_0x2399dd[_0xb502('0x53')][_0xb502('0xa6')]=_0x2399dd['file'][_0xb502('0xa7')];return db[_0xb502('0x31')]['find']({'where':{'id':_0x2399dd[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x681404,null))[_0xb502('0x1f')](saveUpdates(_0x2399dd[_0xb502('0x53')],null))[_0xb502('0x1f')](respondWithResult(_0x681404,null))[_0xb502('0x4d')](handleError(_0x681404,null));};exports['getAvatar']=function(_0x338928,_0xb0b324){var _0x50044f=path['join'](config['root'],'server/files/images/logos/default_profile.png');return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x338928[_0xb502('0x54')]['id']},'attributes':['id',_0xb502('0xa6')],'raw':!![]})['then'](handleEntityNotFound(_0xb0b324,null))[_0xb502('0x1f')](function(_0x34d5b6){if(_0x34d5b6){if(_[_0xb502('0x5f')](_0x34d5b6[_0xb502('0xa6')])){return _0xb0b324['download'](_0x50044f);}else{if(!fs[_0xb502('0xa8')](path[_0xb502('0xa9')](config[_0xb502('0xaa')],_0xb502('0xab'),_0x34d5b6[_0xb502('0xa6')]))){return _0xb0b324[_0xb502('0xac')](_0x50044f);}return _0xb0b324[_0xb502('0xac')](path[_0xb502('0xa9')](config[_0xb502('0xaa')],'server/files/images/',_0x34d5b6[_0xb502('0xa6')]));}}})['catch'](handleError(_0xb0b324,null));};exports[_0xb502('0xad')]=function(_0x23358a,_0x2f2318){return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x23358a[_0xb502('0x54')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x2f2318,null))[_0xb502('0x1f')](function(_0x793308){var _0x5873a1=[];values=_0x793308[_0xb502('0x48')];_0x5873a1[_0xb502('0x42')](get_open_tabs(_0xb502('0x47'),_0x793308[_0xb502('0x48')]));_0x5873a1[_0xb502('0x42')](get_open_tabs(_0xb502('0x49'),_0x793308[_0xb502('0x48')]));_0x5873a1[_0xb502('0x42')](get_open_tabs(_0xb502('0xae'),_0x793308[_0xb502('0x48')]));_0x5873a1[_0xb502('0x42')](get_open_tabs('whatsapp',_0x793308[_0xb502('0x48')]));_0x5873a1[_0xb502('0x42')](get_open_tabs(_0xb502('0x4a'),_0x793308['dataValues']));_0x5873a1[_0xb502('0x42')](get_open_tabs(_0xb502('0x4b'),_0x793308[_0xb502('0x48')]));return Promise[_0xb502('0x4c')](_0x5873a1);})['then'](function(_0x202e07){if(_0x202e07){var _0x51666f=_[_0xb502('0x2c')](values['ChatOpenTabs'],function(_0x28ab30){return{'channel':_0xb502('0xaf'),'id':_0x28ab30['id'],'createdAt':_0x28ab30[_0xb502('0xb0')]};});var _0x23f368=_[_0xb502('0x2c')](values[_0xb502('0xb1')],function(_0x477365){return{'channel':_0xb502('0xb2'),'id':_0x477365['id'],'createdAt':_0x477365[_0xb502('0xb0')]};});var _0x454441=_[_0xb502('0x2c')](values[_0xb502('0xb3')],function(_0x3730cf){return{'channel':_0xb502('0xb4'),'id':_0x3730cf['id'],'createdAt':_0x3730cf[_0xb502('0xb0')]};});var _0x458b2d=_[_0xb502('0x2c')](values[_0xb502('0xb5')],function(_0x4658f7){return{'channel':_0xb502('0xb6'),'id':_0x4658f7['id'],'createdAt':_0x4658f7[_0xb502('0xb0')]};});var _0x427d65=_[_0xb502('0x2c')](values[_0xb502('0xb7')],function(_0x2a12c4){return{'channel':'SMS','id':_0x2a12c4['id'],'createdAt':_0x2a12c4['createdAt']};});var _0x18898b=_[_0xb502('0x2c')](values['WhatsappOpenTabs'],function(_0xebf8d9){return{'channel':_0xb502('0xb8'),'id':_0xebf8d9['id'],'createdAt':_0xebf8d9[_0xb502('0xb0')]};});var _0x265481=_[_0xb502('0xb9')](_0x51666f,_0x23f368,_0x454441,_0x458b2d,_0x427d65,_0x18898b);var _0x4adef6={'count':_0x265481[_0xb502('0x46')],'rows':_0x265481};return _0x4adef6;}else return null;})['then'](respondWithResult(_0x2f2318,null))[_0xb502('0x4d')](handleError(_0x2f2318,null));};exports[_0xb502('0xba')]=function(_0x43b8c9,_0x402c41){var _0x32323a={};return db[_0xb502('0x31')]['findOne']({'where':{'id':_0x43b8c9[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](function(_0xd8cd22){if(!_0xd8cd22){throw new APINotFoundError(util[_0xb502('0x9f')](_0xb502('0xbb'),_0x43b8c9['params']['id']));}return contacts[_0xb502('0x55')]();})['then'](function(_0x2a9e4e){_0x43b8c9['query'][_0xb502('0x31')]=_0x43b8c9['params']['id'];_0x32323a=qs['getOptions'](_0x2a9e4e,_0x43b8c9);if(_0x43b8c9[_0xb502('0x3e')]['hasOwnProperty']('includeAll')){_0x32323a[_0xb502('0x3d')]=[{'model':db[_0xb502('0xbc')],'as':_0xb502('0xbd'),'required':![]},{'model':db[_0xb502('0xbe')],'as':_0xb502('0xbf'),'attributes':['id',_0xb502('0x2f'),_0xb502('0xc0')],'where':_0x43b8c9['query'][_0xb502('0xc1')]?{'id':_0x43b8c9[_0xb502('0x3e')][_0xb502('0xc1')]}:undefined,'required':_0x43b8c9[_0xb502('0x3e')][_0xb502('0xc1')]?!![]:![]}];}return contacts[_0xb502('0x43')](_0x43b8c9[_0xb502('0x3e')],_0x43b8c9['user'],_0x32323a,_0x2a9e4e);})[_0xb502('0x1f')](respondWithFilteredResult(_0x402c41,_0x32323a))[_0xb502('0x4d')](APIHandleError(_0x402c41));};exports[_0xb502('0xc2')]=function(_0x59d2ca,_0x57fe4b){var _0x66106f;var _0x2c7b7c={};var _0x295c06;return db['User'][_0xb502('0x88')]({'where':{'id':_0x59d2ca['params']['id']},'attributes':['id',_0xb502('0x2f'),_0xb502('0x25')]})[_0xb502('0x1f')](handleEntityNotFound(_0x57fe4b,null))[_0xb502('0x1f')](function(_0x14454d){if(!utils[_0xb502('0x93')](_0x59d2ca[_0xb502('0x3e')]['channel'])){throw new db['Sequelize'][(_0xb502('0x82'))](_0xb502('0x94'));}_0x66106f=_0x14454d;var _0x4749dc={};_0x4749dc[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_[_0xb502('0x96')](_0x59d2ca[_0xb502('0x3e')][_0xb502('0x8f')])+_0xb502('0xc5')][_0xb502('0x32')]);_0x4749dc[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x59d2ca['query']);_0x4749dc[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x4749dc[_0xb502('0xc3')],_0x4749dc[_0xb502('0x3e')]);_0x2c7b7c[_0xb502('0x41')]=_[_0xb502('0xc7')](_0x4749dc[_0xb502('0xc3')],qs[_0xb502('0xc8')](_0x59d2ca['query'][_0xb502('0xc8')]));_0x2c7b7c['attributes']=_0x2c7b7c['attributes'][_0xb502('0x46')]?_0x2c7b7c[_0xb502('0x41')]:_0x4749dc['model'];_0x2c7b7c[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0x59d2ca[_0xb502('0x3e')]['sort']);_0x2c7b7c['where']=qs['filters'](_[_0xb502('0xcb')](_0x59d2ca[_0xb502('0x3e')],_0x4749dc[_0xb502('0xc6')]));if(_0x59d2ca[_0xb502('0x3e')][_0xb502('0x2b')]){_0x2c7b7c['where']=_[_0xb502('0x50')](_0x2c7b7c['where'],{'$or':_[_0xb502('0x2c')](_0x2c7b7c[_0xb502('0x41')],function(_0x385014){var _0x439f4e={};_0x439f4e[_0x385014]={'$like':'%'+_0x59d2ca[_0xb502('0x3e')][_0xb502('0x2b')]+'%'};return _0x439f4e;})});}_0x2c7b7c=_[_0xb502('0x50')]({},_0x2c7b7c,_0x59d2ca[_0xb502('0x51')]);switch(_0x66106f[_0xb502('0x25')]){case _0xb502('0x75'):return db[_[_0xb502('0x96')](_0x59d2ca[_0xb502('0x3e')][_0xb502('0x8f')])+'Queue'][_0xb502('0x43')](_0x2c7b7c);case _0xb502('0x27'):case _0xb502('0x20'):return _0x66106f[_0xb502('0x24')+_[_0xb502('0x96')](_0x59d2ca['query'][_0xb502('0x8f')])+'Queues'](_0x2c7b7c);default:throw new db[(_0xb502('0x84'))][(_0xb502('0x82'))](_0xb502('0xcc'));}})['then'](function(_0x46a1a7){_0x295c06=_0x46a1a7[_0xb502('0x46')];if(!_0x59d2ca['query'][_0xb502('0xcd')](_0xb502('0xce'))){_0x2c7b7c[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x59d2ca[_0xb502('0x3e')][_0xb502('0x19')]);_0x2c7b7c['offset']=qs[_0xb502('0x17')](_0x59d2ca[_0xb502('0x3e')][_0xb502('0x17')]);}switch(_0x66106f[_0xb502('0x25')]){case _0xb502('0x75'):return db[_['capitalize'](_0x59d2ca[_0xb502('0x3e')][_0xb502('0x8f')])+_0xb502('0xc5')][_0xb502('0x43')](_0x2c7b7c);case _0xb502('0x27'):case _0xb502('0x20'):return _0x66106f['get'+_[_0xb502('0x96')](_0x59d2ca[_0xb502('0x3e')][_0xb502('0x8f')])+_0xb502('0x97')](_0x2c7b7c);}})[_0xb502('0x1f')](function(_0x6ba17e){return{'count':_0x295c06,'rows':_0x6ba17e};})[_0xb502('0x1f')](respondWithResult(_0x57fe4b,null))['catch'](handleError(_0x57fe4b,null));};exports[_0xb502('0xcf')]=function(_0x47888f,_0x5004f9){var _0x56013b={};var _0x1e7261={};var _0x3339b8;var _0x5ad1d2;return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x47888f[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x5004f9,null))[_0xb502('0x1f')](function(_0x14e0e4){if(_0x14e0e4){_0x3339b8=_0x14e0e4;_0x1e7261[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_0xb502('0xa0')][_0xb502('0x32')]);_0x1e7261[_0xb502('0x3e')]=_['keys'](_0x47888f[_0xb502('0x3e')]);_0x1e7261[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x1e7261[_0xb502('0xc3')],_0x1e7261[_0xb502('0x3e')]);_0x56013b['attributes']=_[_0xb502('0xc7')](_0x1e7261[_0xb502('0xc3')],qs[_0xb502('0xc8')](_0x47888f[_0xb502('0x3e')][_0xb502('0xc8')]));_0x56013b[_0xb502('0x41')]=_0x56013b[_0xb502('0x41')]['length']?_0x56013b[_0xb502('0x41')]:_0x1e7261[_0xb502('0xc3')];_0x56013b[_0xb502('0xc9')]=qs['sort'](_0x47888f[_0xb502('0x3e')]['sort']);_0x56013b[_0xb502('0x3c')]=qs['filters'](_[_0xb502('0xcb')](_0x47888f['query'],_0x1e7261[_0xb502('0xc6')]));if(_0x47888f[_0xb502('0x3e')][_0xb502('0x2b')]){_0x56013b[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x56013b['where'],{'$or':_[_0xb502('0x2c')](_0x56013b['attributes'],function(_0x1cfe97){var _0x2e379b={};_0x2e379b[_0x1cfe97]={'$like':'%'+_0x47888f['query'][_0xb502('0x2b')]+'%'};return _0x2e379b;})});}_0x56013b=_['merge']({},_0x56013b,_0x47888f['options']);return _0x3339b8[_0xb502('0xcf')](_0x56013b);}})[_0xb502('0x1f')](function(_0x31d9b3){if(_0x31d9b3){_0x5ad1d2=_0x31d9b3[_0xb502('0x46')];if(!_0x47888f[_0xb502('0x3e')][_0xb502('0xcd')](_0xb502('0xce'))){_0x56013b[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x47888f['query'][_0xb502('0x19')]);_0x56013b['offset']=qs[_0xb502('0x17')](_0x47888f['query'][_0xb502('0x17')]);}return _0x3339b8[_0xb502('0xcf')](_0x56013b);}})[_0xb502('0x1f')](function(_0x41c5cc){if(_0x41c5cc){return _0x41c5cc?{'count':_0x5ad1d2,'rows':_0x41c5cc}:null;}})[_0xb502('0x1f')](respondWithResult(_0x5004f9,null))['catch'](handleError(_0x5004f9,null));};exports[_0xb502('0xd0')]=function(_0x28c700,_0x59b902){var _0x387fae={};var _0x21d034={};var _0x11f8da;var _0x58dd35;return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x28c700[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x59b902,null))[_0xb502('0x1f')](function(_0x18131e){if(_0x18131e){_0x11f8da=_0x18131e;_0x21d034['model']=_[_0xb502('0xc4')](db[_0xb502('0xd1')][_0xb502('0x32')]);_0x21d034[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x28c700[_0xb502('0x3e')]);_0x21d034['filters']=_[_0xb502('0xc7')](_0x21d034[_0xb502('0xc3')],_0x21d034['query']);_0x387fae[_0xb502('0x41')]=_[_0xb502('0xc7')](_0x21d034[_0xb502('0xc3')],qs['fields'](_0x28c700['query'][_0xb502('0xc8')]));_0x387fae['attributes']=_0x387fae['attributes'][_0xb502('0x46')]?_0x387fae[_0xb502('0x41')]:_0x21d034['model'];_0x387fae[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0x28c700[_0xb502('0x3e')][_0xb502('0xca')]);_0x387fae[_0xb502('0x3c')]=qs['filters'](_['pick'](_0x28c700[_0xb502('0x3e')],_0x21d034[_0xb502('0xc6')]));if(_0x28c700['query'][_0xb502('0x2b')]){_0x387fae[_0xb502('0x3c')]=_['merge'](_0x387fae[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x387fae['attributes'],function(_0x74018c){var _0x189540={};_0x189540[_0x74018c]={'$like':'%'+_0x28c700[_0xb502('0x3e')][_0xb502('0x2b')]+'%'};return _0x189540;})});}_0x387fae=_[_0xb502('0x50')]({},_0x387fae,_0x28c700['options']);return _0x11f8da['getGroups'](_0x387fae);}})[_0xb502('0x1f')](function(_0x96f405){if(_0x96f405){_0x58dd35=_0x96f405[_0xb502('0x46')];if(!_0x28c700[_0xb502('0x3e')][_0xb502('0xcd')](_0xb502('0xce'))){_0x387fae[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x28c700['query']['limit']);_0x387fae[_0xb502('0x17')]=qs[_0xb502('0x17')](_0x28c700['query'][_0xb502('0x17')]);}return _0x11f8da[_0xb502('0xd0')](_0x387fae);}})['then'](function(_0x447301){if(_0x447301){return _0x447301?{'count':_0x58dd35,'rows':_0x447301}:null;}})['then'](respondWithResult(_0x59b902,null))[_0xb502('0x4d')](handleError(_0x59b902,null));};exports[_0xb502('0xd2')]=function(_0x1285d5,_0x66f598){var _0x1715ce={'raw':!![],'where':{}};var _0x4c265c={};var _0x194a95={'count':0x0,'rows':[]};return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x1285d5[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x66f598,null))[_0xb502('0x1f')](function(_0x31ef4a){if(_0x31ef4a){_0x4c265c[_0xb502('0xc3')]=_['keys'](db[_0xb502('0xd3')][_0xb502('0x32')]);_0x4c265c[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x1285d5[_0xb502('0x3e')]);_0x4c265c['filters']=_[_0xb502('0xc7')](_0x4c265c[_0xb502('0xc3')],_0x4c265c[_0xb502('0x3e')]);_0x1715ce[_0xb502('0x41')]=_[_0xb502('0xc7')](_0x4c265c[_0xb502('0xc3')],qs[_0xb502('0xc8')](_0x1285d5[_0xb502('0x3e')][_0xb502('0xc8')]));_0x1715ce['attributes']=_0x1715ce[_0xb502('0x41')][_0xb502('0x46')]?_0x1715ce[_0xb502('0x41')]:_0x4c265c[_0xb502('0xc3')];if(!_0x1285d5['query'][_0xb502('0xcd')](_0xb502('0xce'))){_0x1715ce['limit']=qs[_0xb502('0x19')](_0x1285d5['query'][_0xb502('0x19')]);_0x1715ce[_0xb502('0x17')]=qs[_0xb502('0x17')](_0x1285d5['query'][_0xb502('0x17')]);}_0x1715ce['order']=qs['sort'](_0x1285d5['query'][_0xb502('0xca')]);_0x1715ce[_0xb502('0x3c')]=qs[_0xb502('0xc6')](_[_0xb502('0xcb')](_0x1285d5[_0xb502('0x3e')],_0x4c265c[_0xb502('0xc6')]));_0x1715ce[_0xb502('0x3c')]['UserId']=_0x31ef4a['id'];if(_0x1285d5[_0xb502('0x3e')]['filter']){_0x1715ce[_0xb502('0x3c')]=_['merge'](_0x1715ce[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x1715ce[_0xb502('0x41')],function(_0x17bf2a){var _0x156cd7={};_0x156cd7[_0x17bf2a]={'$like':'%'+_0x1285d5[_0xb502('0x3e')]['filter']+'%'};return _0x156cd7;})});}_0x1715ce=_[_0xb502('0x50')]({},_0x1715ce,_0x1285d5[_0xb502('0x51')]);return db[_0xb502('0xd3')][_0xb502('0x1a')]({'where':_0x1715ce[_0xb502('0x3c')]})['then'](function(_0x958355){_0x194a95[_0xb502('0x1a')]=_0x958355;if(_0x1285d5[_0xb502('0x3e')]['includeAll']){_0x1715ce[_0xb502('0x3d')]=[{'all':!![]}];}return db[_0xb502('0xd3')]['findAll'](_0x1715ce);})[_0xb502('0x1f')](function(_0x1b6fac){_0x194a95[_0xb502('0x44')]=_0x1b6fac;return _0x194a95;});}})[_0xb502('0x1f')](respondWithFilteredResult(_0x66f598,_0x1715ce))[_0xb502('0x4d')](handleError(_0x66f598,null));};exports[_0xb502('0xd4')]=function(_0x44e556,_0x56acee){var _0x7addba={'raw':!![],'where':{}};var _0x4579c3={};var _0x2b1d31={'count':0x0,'rows':[]};return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x44e556[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x56acee,null))['then'](function(_0x39faa4){if(_0x39faa4){_0x4579c3[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_0xb502('0xd5')][_0xb502('0x32')]);_0x4579c3[_0xb502('0x3e')]=_['keys'](_0x44e556[_0xb502('0x3e')]);_0x4579c3[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x4579c3['model'],_0x4579c3[_0xb502('0x3e')]);_0x7addba[_0xb502('0x41')]=_[_0xb502('0xc7')](_0x4579c3[_0xb502('0xc3')],qs['fields'](_0x44e556['query'][_0xb502('0xc8')]));_0x7addba[_0xb502('0x41')]=_0x7addba['attributes'][_0xb502('0x46')]?_0x7addba['attributes']:_0x4579c3[_0xb502('0xc3')];if(!_0x44e556[_0xb502('0x3e')]['hasOwnProperty'](_0xb502('0xce'))){_0x7addba[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x44e556[_0xb502('0x3e')]['limit']);_0x7addba[_0xb502('0x17')]=qs['offset'](_0x44e556[_0xb502('0x3e')][_0xb502('0x17')]);}_0x7addba[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0x44e556[_0xb502('0x3e')][_0xb502('0xca')]);_0x7addba[_0xb502('0x3c')]=qs[_0xb502('0xc6')](_[_0xb502('0xcb')](_0x44e556[_0xb502('0x3e')],_0x4579c3[_0xb502('0xc6')]));_0x7addba[_0xb502('0x3c')][_0xb502('0xd6')]=_0x39faa4['id'];if(_0x44e556[_0xb502('0x3e')]['filter']){_0x7addba[_0xb502('0x3c')]=_['merge'](_0x7addba[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x7addba[_0xb502('0x41')],function(_0x1f049a){var _0x18116d={};_0x18116d[_0x1f049a]={'$like':'%'+_0x44e556[_0xb502('0x3e')][_0xb502('0x2b')]+'%'};return _0x18116d;})});}_0x7addba=_[_0xb502('0x50')]({},_0x7addba,_0x44e556[_0xb502('0x51')]);return db[_0xb502('0xd5')][_0xb502('0x1a')]({'where':_0x7addba['where']})[_0xb502('0x1f')](function(_0x387584){_0x2b1d31[_0xb502('0x1a')]=_0x387584;if(_0x44e556[_0xb502('0x3e')]['includeAll']){_0x7addba[_0xb502('0x3d')]=[{'all':!![]}];}return db[_0xb502('0xd5')]['findAll'](_0x7addba);})['then'](function(_0x5ba8b6){_0x2b1d31[_0xb502('0x44')]=_0x5ba8b6;return _0x2b1d31;});}})['then'](respondWithFilteredResult(_0x56acee,_0x7addba))['catch'](handleError(_0x56acee,null));};exports[_0xb502('0xd7')]=function(_0xbe1bd4,_0xd4bece){var _0x22f08b={};var _0x4627e6={};var _0x2ee0af;var _0x5f09ce;return db['User'][_0xb502('0x88')]({'where':{'id':_0xbe1bd4['params']['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0xd4bece,null))[_0xb502('0x1f')](function(_0x596c63){if(_0x596c63){_0x2ee0af=_0x596c63;_0x4627e6[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_0xb502('0xd8')][_0xb502('0x32')]);_0x4627e6[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0xbe1bd4[_0xb502('0x3e')]);_0x4627e6[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x4627e6[_0xb502('0xc3')],_0x4627e6['query']);_0x22f08b['attributes']=_['intersection'](_0x4627e6[_0xb502('0xc3')],qs['fields'](_0xbe1bd4[_0xb502('0x3e')][_0xb502('0xc8')]));_0x22f08b[_0xb502('0x41')]=_0x22f08b[_0xb502('0x41')][_0xb502('0x46')]?_0x22f08b[_0xb502('0x41')]:_0x4627e6[_0xb502('0xc3')];_0x22f08b[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0xbe1bd4[_0xb502('0x3e')][_0xb502('0xca')]);_0x22f08b['where']=qs[_0xb502('0xc6')](_['pick'](_0xbe1bd4[_0xb502('0x3e')],_0x4627e6[_0xb502('0xc6')]));if(_0xbe1bd4['query'][_0xb502('0x2b')]){_0x22f08b[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x22f08b[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x22f08b['attributes'],function(_0x404f62){var _0xb29241={};_0xb29241[_0x404f62]={'$like':'%'+_0xbe1bd4['query'][_0xb502('0x2b')]+'%'};return _0xb29241;})});}_0x22f08b=_[_0xb502('0x50')]({},_0x22f08b,_0xbe1bd4[_0xb502('0x51')]);return _0x2ee0af[_0xb502('0xd7')](_0x22f08b);}})[_0xb502('0x1f')](function(_0x58cae3){if(_0x58cae3){_0x5f09ce=_0x58cae3['length'];if(!_0xbe1bd4[_0xb502('0x3e')][_0xb502('0xcd')](_0xb502('0xce'))){_0x22f08b[_0xb502('0x19')]=qs[_0xb502('0x19')](_0xbe1bd4[_0xb502('0x3e')]['limit']);_0x22f08b[_0xb502('0x17')]=qs[_0xb502('0x17')](_0xbe1bd4['query'][_0xb502('0x17')]);}return _0x2ee0af[_0xb502('0xd7')](_0x22f08b);}})[_0xb502('0x1f')](function(_0x4d69c4){if(_0x4d69c4){return _0x4d69c4?{'count':_0x5f09ce,'rows':_0x4d69c4}:null;}})['then'](respondWithResult(_0xd4bece,null))[_0xb502('0x4d')](handleError(_0xd4bece,null));};exports['getOpenchannelInteractions']=function(_0xd133bf,_0x4c5de0){var _0x26a15a={};var _0x44e02c={};var _0x23c4dd;var _0x4e8d1b;return db['User'][_0xb502('0x88')]({'where':{'id':_0xd133bf[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x4c5de0,null))[_0xb502('0x1f')](function(_0x5cf7dc){if(_0x5cf7dc){_0x23c4dd=_0x5cf7dc;_0x44e02c[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_0xb502('0xd9')][_0xb502('0x32')]);_0x44e02c[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0xd133bf[_0xb502('0x3e')]);_0x44e02c[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x44e02c[_0xb502('0xc3')],_0x44e02c[_0xb502('0x3e')]);_0x26a15a['attributes']=_[_0xb502('0xc7')](_0x44e02c[_0xb502('0xc3')],qs[_0xb502('0xc8')](_0xd133bf[_0xb502('0x3e')][_0xb502('0xc8')]));_0x26a15a[_0xb502('0x41')]=_0x26a15a[_0xb502('0x41')][_0xb502('0x46')]?_0x26a15a[_0xb502('0x41')]:_0x44e02c[_0xb502('0xc3')];_0x26a15a[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0xd133bf[_0xb502('0x3e')][_0xb502('0xca')]);_0x26a15a[_0xb502('0x3c')]=qs['filters'](_['pick'](_0xd133bf['query'],_0x44e02c[_0xb502('0xc6')]));if(_0xd133bf[_0xb502('0x3e')][_0xb502('0x2b')]){_0x26a15a[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x26a15a[_0xb502('0x3c')],{'$or':_['map'](_0x26a15a[_0xb502('0x41')],function(_0x81e92b){var _0x4b0807={};_0x4b0807[_0x81e92b]={'$like':'%'+_0xd133bf[_0xb502('0x3e')][_0xb502('0x2b')]+'%'};return _0x4b0807;})});}_0x26a15a=_[_0xb502('0x50')]({},_0x26a15a,_0xd133bf[_0xb502('0x51')]);return _0x23c4dd[_0xb502('0xda')](_0x26a15a);}})['then'](function(_0x328cae){if(_0x328cae){_0x4e8d1b=_0x328cae[_0xb502('0x46')];if(!_0xd133bf[_0xb502('0x3e')][_0xb502('0xcd')](_0xb502('0xce'))){_0x26a15a[_0xb502('0x19')]=qs[_0xb502('0x19')](_0xd133bf[_0xb502('0x3e')][_0xb502('0x19')]);_0x26a15a[_0xb502('0x17')]=qs[_0xb502('0x17')](_0xd133bf[_0xb502('0x3e')][_0xb502('0x17')]);}return _0x23c4dd[_0xb502('0xda')](_0x26a15a);}})[_0xb502('0x1f')](function(_0x129aeb){if(_0x129aeb){return _0x129aeb?{'count':_0x4e8d1b,'rows':_0x129aeb}:null;}})[_0xb502('0x1f')](respondWithResult(_0x4c5de0,null))['catch'](handleError(_0x4c5de0,null));};exports['getMailInteractions']=function(_0x4dd356,_0x56de27){var _0x37fa82={'raw':!![],'where':{}};var _0x26babe={};var _0x3f99ac={'count':0x0,'rows':[]};return db[_0xb502('0x31')]['findOne']({'where':{'id':_0x4dd356[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x56de27,null))['then'](function(_0x5deaf2){if(_0x5deaf2){_0x26babe['model']=_[_0xb502('0xc4')](db[_0xb502('0xdb')]['rawAttributes']);_0x26babe[_0xb502('0x3e')]=_['keys'](_0x4dd356[_0xb502('0x3e')]);_0x26babe[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x26babe[_0xb502('0xc3')],_0x26babe[_0xb502('0x3e')]);_0x37fa82['attributes']=_[_0xb502('0xc7')](_0x26babe[_0xb502('0xc3')],qs['fields'](_0x4dd356[_0xb502('0x3e')][_0xb502('0xc8')]));_0x37fa82[_0xb502('0x41')]=_0x37fa82['attributes'][_0xb502('0x46')]?_0x37fa82['attributes']:_0x26babe[_0xb502('0xc3')];if(!_0x4dd356[_0xb502('0x3e')][_0xb502('0xcd')]('nolimit')){_0x37fa82[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x4dd356[_0xb502('0x3e')]['limit']);_0x37fa82[_0xb502('0x17')]=qs[_0xb502('0x17')](_0x4dd356[_0xb502('0x3e')]['offset']);}_0x37fa82['order']=qs[_0xb502('0xca')](_0x4dd356[_0xb502('0x3e')][_0xb502('0xca')]);_0x37fa82[_0xb502('0x3c')]=qs[_0xb502('0xc6')](_['pick'](_0x4dd356['query'],_0x26babe['filters']));_0x37fa82[_0xb502('0x3c')][_0xb502('0xd6')]=_0x5deaf2['id'];if(_0x4dd356[_0xb502('0x3e')][_0xb502('0x2b')]){_0x37fa82[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x37fa82[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x37fa82[_0xb502('0x41')],function(_0xdda3c2){var _0x47b3c8={};_0x47b3c8[_0xdda3c2]={'$like':'%'+_0x4dd356['query'][_0xb502('0x2b')]+'%'};return _0x47b3c8;})});}_0x37fa82=_[_0xb502('0x50')]({},_0x37fa82,_0x4dd356[_0xb502('0x51')]);return db[_0xb502('0xdb')][_0xb502('0x1a')]({'where':_0x37fa82[_0xb502('0x3c')]})[_0xb502('0x1f')](function(_0x4c3dc0){_0x3f99ac[_0xb502('0x1a')]=_0x4c3dc0;if(_0x4dd356[_0xb502('0x3e')]['includeAll']){_0x37fa82[_0xb502('0x3d')]=[{'all':!![]}];}return db[_0xb502('0xdb')][_0xb502('0x43')](_0x37fa82);})[_0xb502('0x1f')](function(_0x3deeae){_0x3f99ac['rows']=_0x3deeae;return _0x3f99ac;});}})['then'](respondWithFilteredResult(_0x56de27,_0x37fa82))[_0xb502('0x4d')](handleError(_0x56de27,null));};exports[_0xb502('0xdc')]=function(_0xf377a3,_0x5b4ea2){var _0x1d203b={};var _0x302b52={};var _0x10d90d;var _0x253b4c;return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0xf377a3[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x5b4ea2,null))[_0xb502('0x1f')](function(_0x20048d){if(_0x20048d){_0x10d90d=_0x20048d;_0x302b52[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_0xb502('0xdd')][_0xb502('0x32')]);_0x302b52[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0xf377a3[_0xb502('0x3e')]);_0x302b52[_0xb502('0xc6')]=_['intersection'](_0x302b52[_0xb502('0xc3')],_0x302b52[_0xb502('0x3e')]);_0x1d203b[_0xb502('0x41')]=_['intersection'](_0x302b52[_0xb502('0xc3')],qs[_0xb502('0xc8')](_0xf377a3[_0xb502('0x3e')][_0xb502('0xc8')]));_0x1d203b['attributes']=_0x1d203b[_0xb502('0x41')][_0xb502('0x46')]?_0x1d203b[_0xb502('0x41')]:_0x302b52[_0xb502('0xc3')];_0x1d203b[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0xf377a3[_0xb502('0x3e')][_0xb502('0xca')]);_0x1d203b['where']=qs[_0xb502('0xc6')](_[_0xb502('0xcb')](_0xf377a3[_0xb502('0x3e')],_0x302b52[_0xb502('0xc6')]));if(_0xf377a3[_0xb502('0x3e')][_0xb502('0x2b')]){_0x1d203b[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x1d203b[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x1d203b[_0xb502('0x41')],function(_0x24e54a){var _0x2c7abb={};_0x2c7abb[_0x24e54a]={'$like':'%'+_0xf377a3[_0xb502('0x3e')][_0xb502('0x2b')]+'%'};return _0x2c7abb;})});}_0x1d203b=_[_0xb502('0x50')]({},_0x1d203b,_0xf377a3[_0xb502('0x51')]);return _0x10d90d[_0xb502('0xdc')](_0x1d203b);}})[_0xb502('0x1f')](function(_0x37b3aa){if(_0x37b3aa){_0x253b4c=_0x37b3aa[_0xb502('0x46')];if(!_0xf377a3[_0xb502('0x3e')]['hasOwnProperty'](_0xb502('0xce'))){_0x1d203b['limit']=qs[_0xb502('0x19')](_0xf377a3[_0xb502('0x3e')][_0xb502('0x19')]);_0x1d203b[_0xb502('0x17')]=qs['offset'](_0xf377a3[_0xb502('0x3e')][_0xb502('0x17')]);}return _0x10d90d[_0xb502('0xdc')](_0x1d203b);}})[_0xb502('0x1f')](function(_0x2b13ca){if(_0x2b13ca){return _0x2b13ca?{'count':_0x253b4c,'rows':_0x2b13ca}:null;}})['then'](respondWithResult(_0x5b4ea2,null))[_0xb502('0x4d')](handleError(_0x5b4ea2,null));};exports[_0xb502('0xde')]=function(_0x45b54d,_0x4eed76){var _0x3a2377={};var _0x59d81b={};var _0x56d774;var _0x291cfc;return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x45b54d[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x4eed76,null))[_0xb502('0x1f')](function(_0x2bc452){if(_0x2bc452){_0x56d774=_0x2bc452;_0x59d81b[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_0xb502('0xdf')]['rawAttributes']);_0x59d81b[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x45b54d[_0xb502('0x3e')]);_0x59d81b[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x59d81b['model'],_0x59d81b[_0xb502('0x3e')]);_0x3a2377['attributes']=_[_0xb502('0xc7')](_0x59d81b[_0xb502('0xc3')],qs[_0xb502('0xc8')](_0x45b54d['query']['fields']));_0x3a2377[_0xb502('0x41')]=_0x3a2377[_0xb502('0x41')][_0xb502('0x46')]?_0x3a2377[_0xb502('0x41')]:_0x59d81b[_0xb502('0xc3')];_0x3a2377['order']=qs['sort'](_0x45b54d[_0xb502('0x3e')][_0xb502('0xca')]);_0x3a2377[_0xb502('0x3c')]=qs[_0xb502('0xc6')](_[_0xb502('0xcb')](_0x45b54d[_0xb502('0x3e')],_0x59d81b['filters']));if(_0x45b54d[_0xb502('0x3e')][_0xb502('0x2b')]){_0x3a2377[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x3a2377[_0xb502('0x3c')],{'$or':_['map'](_0x3a2377['attributes'],function(_0x1dd8af){var _0x26d3a0={};_0x26d3a0[_0x1dd8af]={'$like':'%'+_0x45b54d['query'][_0xb502('0x2b')]+'%'};return _0x26d3a0;})});}_0x3a2377=_[_0xb502('0x50')]({},_0x3a2377,_0x45b54d[_0xb502('0x51')]);return _0x56d774[_0xb502('0xde')](_0x3a2377);}})['then'](function(_0x2a1b05){if(_0x2a1b05){_0x291cfc=_0x2a1b05['length'];if(!_0x45b54d[_0xb502('0x3e')]['hasOwnProperty'](_0xb502('0xce'))){_0x3a2377[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x45b54d[_0xb502('0x3e')][_0xb502('0x19')]);_0x3a2377[_0xb502('0x17')]=qs[_0xb502('0x17')](_0x45b54d[_0xb502('0x3e')]['offset']);}return _0x56d774[_0xb502('0xde')](_0x3a2377);}})[_0xb502('0x1f')](function(_0x3946f7){if(_0x3946f7){return _0x3946f7?{'count':_0x291cfc,'rows':_0x3946f7}:null;}})[_0xb502('0x1f')](respondWithResult(_0x4eed76,null))['catch'](handleError(_0x4eed76,null));};exports[_0xb502('0xe0')]=function(_0x484052,_0x467ec2){var _0x23f83d={};var _0x4173cc={};var _0x25b321;var _0x280301;return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x484052[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x467ec2,null))[_0xb502('0x1f')](function(_0x14e99c){if(_0x14e99c){_0x25b321=_0x14e99c;_0x4173cc[_0xb502('0xc3')]=_['keys'](db[_0xb502('0xe1')]['rawAttributes']);_0x4173cc[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x484052['query']);_0x4173cc[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x4173cc[_0xb502('0xc3')],_0x4173cc[_0xb502('0x3e')]);_0x23f83d[_0xb502('0x41')]=_[_0xb502('0xc7')](_0x4173cc[_0xb502('0xc3')],qs['fields'](_0x484052['query'][_0xb502('0xc8')]));_0x23f83d[_0xb502('0x41')]=_0x23f83d[_0xb502('0x41')][_0xb502('0x46')]?_0x23f83d['attributes']:_0x4173cc['model'];_0x23f83d['order']=qs[_0xb502('0xca')](_0x484052[_0xb502('0x3e')][_0xb502('0xca')]);_0x23f83d[_0xb502('0x3c')]=qs[_0xb502('0xc6')](_[_0xb502('0xcb')](_0x484052[_0xb502('0x3e')],_0x4173cc[_0xb502('0xc6')]));if(_0x484052['query']['filter']){_0x23f83d['where']=_[_0xb502('0x50')](_0x23f83d[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x23f83d[_0xb502('0x41')],function(_0x3b35a8){var _0x2bfe84={};_0x2bfe84[_0x3b35a8]={'$like':'%'+_0x484052['query'][_0xb502('0x2b')]+'%'};return _0x2bfe84;})});}_0x23f83d=_[_0xb502('0x50')]({},_0x23f83d,_0x484052['options']);return _0x25b321['getWhatsappInteractions'](_0x23f83d);}})[_0xb502('0x1f')](function(_0x581acf){if(_0x581acf){_0x280301=_0x581acf[_0xb502('0x46')];if(!_0x484052[_0xb502('0x3e')][_0xb502('0xcd')](_0xb502('0xce'))){_0x23f83d[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x484052[_0xb502('0x3e')][_0xb502('0x19')]);_0x23f83d[_0xb502('0x17')]=qs[_0xb502('0x17')](_0x484052[_0xb502('0x3e')][_0xb502('0x17')]);}return _0x25b321[_0xb502('0xe0')](_0x23f83d);}})[_0xb502('0x1f')](function(_0x459dc8){if(_0x459dc8){return _0x459dc8?{'count':_0x280301,'rows':_0x459dc8}:null;}})[_0xb502('0x1f')](respondWithResult(_0x467ec2,null))['catch'](handleError(_0x467ec2,null));};exports[_0xb502('0xe2')]=function(_0x166326,_0x8fc588,_0x54d027){var _0x5c00d1;var _0x155d67;var _0x373718;var _0x1ccf00=!_[_0xb502('0x5f')](_0x166326[_0xb502('0x54')]['id'])?_0x166326[_0xb502('0x54')]['id']:!_['isNil'](_0x166326['user']['id'])?_0x166326['user']['id']:null;return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x1ccf00,'role':{'$or':[_0xb502('0x75'),_0xb502('0x27'),_0xb502('0x20')]}},'attributes':['id',_0xb502('0x2f'),'phone','mobile',_0xb502('0x25'),'internal',_0xb502('0x91')]})[_0xb502('0x1f')](function(_0x23302){if(_0x23302){if(_0x23302['role']===_0xb502('0x20')){_0x5c00d1=_0x23302;if(_0x166326['body'][_0xb502('0xe3')]){_0x373718=util['format']('LOCAL/%s@from-sip/n',_0x5c00d1[_0x166326['body'][_0xb502('0xe3')]]);}else if(_0x166326[_0xb502('0x53')][_0xb502('0xe4')]){_0x373718=util[_0xb502('0x9f')](_0xb502('0xe5'),_0x166326[_0xb502('0x53')][_0xb502('0xe4')]);}else{_0x373718=util[_0xb502('0x9f')](_0xb502('0xe5'),_0x5c00d1['name']);}socket['to'](util['format'](_0xb502('0xe6'),_0x5c00d1['name']))[_0xb502('0x21')]('user:forcelogout',{'user':{'id':_0x5c00d1['id'],'name':_0x5c00d1[_0xb502('0x2f')]},'ip':_0x166326[_0xb502('0xe7')]['x-forwarded-for']||_0x166326['connection'][_0xb502('0xe8')]||_0x166326[_0xb502('0xe9')][_0xb502('0xe8')]||_0x166326['connection'][_0xb502('0xe9')][_0xb502('0xe8')]});return db[_0xb502('0xa0')][_0xb502('0x23')]({'where':{'membername':_0x5c00d1['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xb502('0x82'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x5c00d1){return _0x5c00d1[_0xb502('0xea')]({'raw':!![]});}})[_0xb502('0x1f')](function(_0x2395cf){if(_0x5c00d1){if(_0x2395cf){_0x155d67=_0x2395cf;if(_0x155d67['length']){var _0x53875a=_0x155d67[_0xb502('0x2c')](function(_0x30a12b){var _0x3ebc7a={'membername':_0x5c00d1[_0xb502('0x2f')],'UserId':_0x5c00d1['id'],'queue_name':_0x30a12b['name'],'VoiceQueueId':_0x30a12b['id'],'interface':_0x373718,'paused':_0x5c00d1[_0xb502('0x91')]||![],'penalty':_0x30a12b[_0xb502('0xeb')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x3ebc7a);});return Promise[_0xb502('0x4c')](_0x53875a);}}}})[_0xb502('0x1f')](function(){if(_0x5c00d1){return db['MemberReport'][_0xb502('0x43')]({'where':{'membername':_0x5c00d1['name'],'exitAt':null}});}})[_0xb502('0x1f')](function(_0x247f2d){if(_0x5c00d1){var _0x41a86d=[];_0x247f2d[_0xb502('0xec')](function(_0x4e0a28){_0x41a86d[_0xb502('0x42')](_0x4e0a28[_0xb502('0x1e')]({'exitAt':moment()[_0xb502('0x9f')](_0xb502('0xed'))}));});return Promise[_0xb502('0x4c')](_0x41a86d);}})['then'](function(){if(_0x5c00d1){var _0x42507f=[];var _0x91fbe7=[];var _0x469ea1=utils[_0xb502('0xee')]();var _0x42a833={'membername':_0x5c00d1[_0xb502('0x2f')],'interface':_0x373718,'enterAt':moment()[_0xb502('0x9f')](_0xb502('0xed')),'role':_0x5c00d1[_0xb502('0x25')],'internal':_0x5c00d1[_0xb502('0x59')]};_0x469ea1[_0xb502('0xec')](function(_0x155533){_0x42507f[_0xb502('0x42')](_['merge']({'channel':_0x155533,'type':_0xb502('0xef'),'data1':_0x166326[_0xb502('0x53')]['device'],'data2':_0x373718},_0x42a833));if(_0x5c00d1['loginInPause']){_0x91fbe7[_0xb502('0x42')](_['merge']({'channel':_0x155533,'type':_0xb502('0xf0'),'data1':_0xb502('0xf1')},_0x42a833));}});return db[_0xb502('0xf2')]['bulkCreate'](_0x42507f['concat'](_0x91fbe7),{'individualHooks':!![]});}})[_0xb502('0x1f')](function(){if(_0x5c00d1){return _0x5c00d1['update']({'online':!![],'lastLoginAt':moment()[_0xb502('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5c00d1[_0xb502('0x91')]||![],'mailPause':_0x5c00d1['loginInPause']||![],'chatPause':_0x5c00d1[_0xb502('0x91')]||![],'faxPause':_0x5c00d1[_0xb502('0x91')]||![],'smsPause':_0x5c00d1[_0xb502('0x91')]||![],'openchannelPause':_0x5c00d1[_0xb502('0x91')]||![],'whatsappPause':_0x5c00d1[_0xb502('0x91')]||![],'pauseType':_0x5c00d1[_0xb502('0x91')]?_0xb502('0xf1'):null,'interface':_0x373718,'lastPauseAt':moment()[_0xb502('0x9f')](_0xb502('0xed'))});}})[_0xb502('0x1f')](function(_0x43582f){if(_0x166326[_0xb502('0xf3')]){return _0x54d027();}else{return Promise[_0xb502('0xf4')](_0x43582f)['then'](respondWithResult(_0x8fc588,null));}})['catch'](handleError(_0x8fc588,null));};exports[_0xb502('0xf5')]=function(_0x2de4a8,_0x4813e3){var _0x444016;return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x2de4a8[_0xb502('0x54')]['id'],'role':_0xb502('0x20')},'attributes':['id','name',_0xb502('0x25')]})[_0xb502('0x1f')](handleEntityNotFound(_0x4813e3,null))[_0xb502('0x1f')](function(_0x1ce3ed){if(_0x1ce3ed){_0x444016=_0x1ce3ed;return db['UserVoiceQueueRt'][_0xb502('0x23')]({'where':{'membername':_0x444016[_0xb502('0x2f')]},'individualHooks':!![]});}})[_0xb502('0x1f')](function(){return db['MemberReport'][_0xb502('0x43')]({'where':{'membername':_0x444016[_0xb502('0x2f')],'exitAt':null}});})[_0xb502('0x1f')](function(_0x50582f){var _0x190817=[];_0x50582f[_0xb502('0xec')](function(_0x1cb669){_0x190817[_0xb502('0x42')](_0x1cb669[_0xb502('0x1e')]({'exitAt':moment()[_0xb502('0x9f')](_0xb502('0xed'))}));});return Promise[_0xb502('0x4c')](_0x190817);})[_0xb502('0x1f')](function(){return _0x444016[_0xb502('0x1e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xb502('0x1f')](respondWithResult(_0x4813e3,null))[_0xb502('0x4d')](handleError(_0x4813e3,null));};exports['pause']=function(_0x502d99,_0x5cc1b8){var _0x495143;return db[_0xb502('0xa0')][_0xb502('0x1e')]({'paused':0x1},{'where':{'UserId':_0x502d99[_0xb502('0x54')]['id']},'individualHooks':!![]})[_0xb502('0x1f')](function(){return db[_0xb502('0x31')]['find']({'where':{'id':_0x502d99[_0xb502('0x54')]['id'],'role':_0xb502('0x20')},'attributes':['id',_0xb502('0x2f'),'role','internal',_0xb502('0xe3'),_0xb502('0x90')]});})[_0xb502('0x1f')](handleEntityNotFound(_0x5cc1b8,null))[_0xb502('0x1f')](function(_0x4be905){if(_0x4be905){_0x495143=_0x4be905;return db[_0xb502('0xf2')][_0xb502('0x43')]({'where':{'membername':_0x495143['name'],'type':_0xb502('0xf0'),'exitAt':null}});}})[_0xb502('0x1f')](function(_0x11a281){if(_0x11a281[_0xb502('0x46')]){var _0xe5d7ba=moment()[_0xb502('0x9f')](_0xb502('0xed'));for(var _0x148073=0x0,_0x561db5=_0x11a281[_0xb502('0x46')];_0x148073<_0x561db5;_0x148073++){_0x11a281[_0x148073]['updateAttributes']({'exitAt':_0xe5d7ba});}}})[_0xb502('0x1f')](function(){var _0x538091=[];var _0x17431e=utils[_0xb502('0xee')]();_0x17431e[_0xb502('0xec')](function(_0x114030){_0x538091[_0xb502('0x42')]({'channel':_0x114030,'membername':_0x495143['name'],'interface':_[_0xb502('0x5f')](_0x495143['interface'])?util[_0xb502('0x9f')](_0xb502('0xe5'),_0x495143['name']):_0x495143[_0xb502('0xe3')],'type':_0xb502('0xf0'),'enterAt':moment()[_0xb502('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x502d99[_0xb502('0x53')][_0xb502('0x33')]||_0xb502('0xf6'),'role':_0x495143[_0xb502('0x25')],'internal':_0x495143[_0xb502('0x59')]});});return db[_0xb502('0xf2')][_0xb502('0xf7')](_0x538091,{'individualHooks':!![]});})[_0xb502('0x1f')](function(){return _0x495143[_0xb502('0x1e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x502d99[_0xb502('0x53')][_0xb502('0x33')]||_0xb502('0xf6'),'lastPauseAt':moment()[_0xb502('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb502('0x1f')](respondWithResult(_0x5cc1b8,null))[_0xb502('0x4d')](handleError(_0x5cc1b8,null));};exports[_0xb502('0xf8')]=function(_0x69053e,_0x160c0a){if(_0x69053e[_0xb502('0x53')][_0xb502('0x8f')]&&!utils[_0xb502('0x93')](_0x69053e[_0xb502('0x53')][_0xb502('0x8f')])){throw new APIBadRequestError(util['format'](_0xb502('0xf9'),_0x69053e['body'][_0xb502('0x8f')]));}return db[_0xb502('0x31')][_0xb502('0x2e')]({'where':{'id':_0x69053e[_0xb502('0x54')]['id']},'attributes':['id',_0xb502('0x2f'),'role','internal','interface','online',_0xb502('0x92'),_0xb502('0xfa'),_0xb502('0xfb'),'faxPause','openchannelPause',_0xb502('0xfc'),_0xb502('0xfd'),'pauseType',_0xb502('0xfe')]})['then'](function(_0x5cbbff){if(!_0x5cbbff){throw new APINotFoundError(util[_0xb502('0x9f')]('User\x20with\x20id\x20%s\x20not\x20found',_0x69053e['params']['id']));}return _0x5cbbff['unpause'](_0x69053e[_0xb502('0x53')][_0xb502('0x8f')]);})[_0xb502('0x1f')](respondWithResult(_0x160c0a,null))[_0xb502('0x4d')](APIHandleError(_0x160c0a));};exports[_0xb502('0xff')]=function(_0x366a66,_0x285169){var _0x80ca7d={};var _0x11a830={};var _0x48bf76;var _0x1be4ae;return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x366a66[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x285169,null))[_0xb502('0x1f')](function(_0x31b9e3){if(_0x31b9e3){_0x48bf76=_0x31b9e3;_0x11a830[_0xb502('0xc3')]=_[_0xb502('0xc4')](db[_0xb502('0x100')][_0xb502('0x32')]);_0x11a830[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x366a66[_0xb502('0x3e')]);_0x11a830[_0xb502('0xc6')]=_['intersection'](_0x11a830[_0xb502('0xc3')],_0x11a830['query']);_0x80ca7d[_0xb502('0x41')]=_['intersection'](_0x11a830['model'],qs['fields'](_0x366a66[_0xb502('0x3e')][_0xb502('0xc8')]));_0x80ca7d['attributes']=_0x80ca7d[_0xb502('0x41')][_0xb502('0x46')]?_0x80ca7d[_0xb502('0x41')]:_0x11a830['model'];_0x80ca7d[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0x366a66[_0xb502('0x3e')][_0xb502('0xca')]);_0x80ca7d[_0xb502('0x3c')]=qs[_0xb502('0xc6')](_[_0xb502('0xcb')](_0x366a66['query'],_0x11a830[_0xb502('0xc6')]));if(_0x366a66[_0xb502('0x3e')][_0xb502('0x2b')]){_0x80ca7d['where']=_[_0xb502('0x50')](_0x80ca7d[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x80ca7d['attributes'],function(_0x57c8de){var _0x5cd58b={};_0x5cd58b[_0x57c8de]={'$like':'%'+_0x366a66['query'][_0xb502('0x2b')]+'%'};return _0x5cd58b;})});}_0x80ca7d=_[_0xb502('0x50')]({},_0x80ca7d,_0x366a66['options']);return _0x48bf76[_0xb502('0xff')](_0x80ca7d);}})[_0xb502('0x1f')](function(_0x5eb1e5){if(_0x5eb1e5){_0x1be4ae=_0x5eb1e5['length'];if(!_0x366a66[_0xb502('0x3e')]['hasOwnProperty']('nolimit')){_0x80ca7d['limit']=qs[_0xb502('0x19')](_0x366a66[_0xb502('0x3e')][_0xb502('0x19')]);_0x80ca7d[_0xb502('0x17')]=qs[_0xb502('0x17')](_0x366a66[_0xb502('0x3e')][_0xb502('0x17')]);}return _0x48bf76[_0xb502('0xff')](_0x80ca7d);}})['then'](function(_0x463a93){if(_0x463a93){return _0x463a93?{'count':_0x1be4ae,'rows':_0x463a93}:null;}})['then'](respondWithResult(_0x285169,null))[_0xb502('0x4d')](handleError(_0x285169,null));};exports[_0xb502('0x101')]=function(_0x2369c0,_0x10fe60){var _0x44398f=_0x2369c0[_0xb502('0x54')]['id'];var _0x46c16e=_0x2369c0[_0xb502('0x53')]?_0x2369c0[_0xb502('0x53')][_0xb502('0x57')]:null;var _0x1f4884=[];return Promise[_0xb502('0xf4')]()[_0xb502('0x1f')](function(){if(!_0x46c16e)throw new APIBadRequestError(_0xb502('0x102'));})[_0xb502('0x1f')](function(){return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x44398f}});})[_0xb502('0x1f')](function(_0x4f23f9){if(!_0x4f23f9)throw new APINotFoundError(util['format'](_0xb502('0xbb'),_0x2369c0['params']['id']));return db['sequelize'][_0xb502('0x103')](function(_0x1cb6f7){return _0x4f23f9[_0xb502('0x101')](_0x46c16e,{'transaction':_0x1cb6f7})[_0xb502('0x1f')](function(){return db[_0xb502('0x100')][_0xb502('0x43')]({'where':{'id':{'$in':_0x46c16e}}});})['then'](function(_0x43b2fa){var _0x4fb016=_[_0xb502('0x2c')](_0x43b2fa,function(_0x3c6053){return _0x3c6053[_0xb502('0x104')]();});return Promise['all'](_0x4fb016);})[_0xb502('0x1f')](function(_0x4a15b1){_0x1f4884=_['flattenDeep'](_0x4a15b1);var _0x4c5df9=_[_0xb502('0x2c')](_0x1f4884,function(_0x3c1f3f){return _0x3c1f3f[_0xb502('0x105')](_0x4f23f9['id'],{'transaction':_0x1cb6f7});});return Promise[_0xb502('0x4c')](_0x4c5df9);})[_0xb502('0x1f')](function(){if(!_0x4f23f9[_0xb502('0x90')])return;var _0x2f5d1e=_['filter'](_0x1f4884,function(_0x49c7ab){return _0x49c7ab['getDataValue']('channel')===_0xb502('0x106');});var _0x541b1f=_[_0xb502('0x2c')](_0x2f5d1e,function(_0x22fa28){return db[_0xb502('0xa0')][_0xb502('0x107')]({'membername':_0x4f23f9[_0xb502('0x2f')],'UserId':_0x4f23f9['id'],'queue_name':_0x22fa28[_0xb502('0x2f')],'VoiceQueueId':_0x22fa28['id'],'interface':_[_0xb502('0x5f')](_0x4f23f9[_0xb502('0xe3')])?util['format'](_0xb502('0xe5'),_0x4f23f9[_0xb502('0x2f')]):_0x4f23f9[_0xb502('0xe3')],'paused':_0x4f23f9['voicePause']||![],'penalty':_0x4f23f9[_0xb502('0x98')]},{'transaction':_0x1cb6f7});});return Promise[_0xb502('0x4c')](_0x541b1f);})[_0xb502('0x1f')](function(){return db[_0xb502('0x108')][_0xb502('0x43')]({'where':{'teamId':{'$in':_0x46c16e}}});})[_0xb502('0x1f')](function(_0x33b9d1){var _0x5d4a91=_['map'](_0x33b9d1,function(_0x3786aa){return db[_0xb502('0x109')]['create']({'UserId':_0x4f23f9['id'],'VoicePrefixId':_0x3786aa[_0xb502('0x10a')]},{'transaction':_0x1cb6f7});});return Promise[_0xb502('0x4c')](_0x5d4a91);});});})['then'](function(){for(var _0x44d0d3=0x0;_0x44d0d3<_0x1f4884[_0xb502('0x46')];_0x44d0d3++){var _0x111701=_0x1f4884[_0x44d0d3][_0xb502('0x10b')]('channel');var _0x534f2a=_0x111701+_0xb502('0x9b');socket[_0xb502('0x21')]('user'+_0x111701+_0xb502('0x9c'),{'UserId':_0x44398f,['queueField']:_0x1f4884[_0x44d0d3]['id']});}})[_0xb502('0x1f')](respondWithStatusCode(_0x10fe60,null))[_0xb502('0x4d')](APIHandleError(_0x10fe60));};exports[_0xb502('0x10c')]=function(_0x4d5f07,_0x57a4a1){var _0x31b225=_0x4d5f07[_0xb502('0x54')]['id'];var _0x13f017=null;if(_0x4d5f07[_0xb502('0x3e')]['ids']){_0x13f017=_[_0xb502('0xa3')](_0x4d5f07[_0xb502('0x3e')][_0xb502('0x57')])?_0x4d5f07[_0xb502('0x3e')][_0xb502('0x57')]:[_0x4d5f07['query'][_0xb502('0x57')]];}var _0x3202ea=[];return Promise['resolve']()['then'](function(){if(!_0x13f017)throw new APIBadRequestError(_0xb502('0x10d'));})[_0xb502('0x1f')](function(){return db[_0xb502('0x31')]['findOne']({'where':{'id':_0x31b225}});})['then'](function(_0x1e0187){if(!_0x1e0187)throw new APINotFoundError(util[_0xb502('0x9f')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4d5f07[_0xb502('0x54')]['id']));return db[_0xb502('0x60')]['transaction'](function(_0x2291ae){return _0x1e0187[_0xb502('0x10c')](_0x13f017,{'transaction':_0x2291ae})[_0xb502('0x1f')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x13f017}}});})[_0xb502('0x1f')](function(_0x45a3fb){var _0x3dc31b=_[_0xb502('0x2c')](_0x45a3fb,function(_0xe7957e){return _0xe7957e[_0xb502('0x104')]();});return Promise[_0xb502('0x4c')](_0x3dc31b);})[_0xb502('0x1f')](function(_0x19dea4){_0x3202ea=_[_0xb502('0x10e')](_0x19dea4);var _0x4b9281=_[_0xb502('0x2c')](_0x3202ea,function(_0x14135d){return _0x14135d[_0xb502('0x10f')](_0x1e0187['id'],{'transaction':_0x2291ae});});return Promise[_0xb502('0x4c')](_0x4b9281);})[_0xb502('0x1f')](function(){if(!_0x1e0187[_0xb502('0x90')])return;var _0x325e00=_[_0xb502('0x2b')](_0x3202ea,function(_0x510645){return _0x510645[_0xb502('0x10b')](_0xb502('0x8f'))===_0xb502('0x106');});var _0xc33526=_['map'](_0x325e00,function(_0xdbec9f){return db[_0xb502('0xa0')][_0xb502('0x23')]({'where':{'VoiceQueueId':_0xdbec9f['id'],'UserId':_0x1e0187['id']},'transaction':_0x2291ae});});return Promise[_0xb502('0x4c')](_0xc33526);})[_0xb502('0x1f')](function(){return db[_0xb502('0x108')][_0xb502('0x43')]({'where':{'teamId':{'$in':_0x13f017}}});})[_0xb502('0x1f')](function(_0x51cca3){var _0x2824fd=_[_0xb502('0x2c')](_0x51cca3,function(_0x493465){return db[_0xb502('0x109')][_0xb502('0x23')]({'where':{'UserId':_0x1e0187['id'],'VoicePrefixId':_0x493465['VoicePrefixId']}},{'transaction':_0x2291ae});});return Promise['all'](_0x2824fd);});});})['then'](function(){for(var _0x3d05d2=0x0;_0x3d05d2<_0x3202ea[_0xb502('0x46')];_0x3d05d2++){var _0x8cc18c=_0x3202ea[_0x3d05d2][_0xb502('0x10b')]('channel');var _0x29111d=_0x8cc18c+'QueueId';socket[_0xb502('0x21')](_0xb502('0x27')+_0x8cc18c+_0xb502('0xa4'),{'UserId':_0x31b225,['queueField']:_0x3202ea[_0x3d05d2]['id']});}})[_0xb502('0x1f')](respondWithStatusCode(_0x57a4a1,null))[_0xb502('0x4d')](APIHandleError(_0x57a4a1));};exports['getLists']=function(_0x59c579,_0xfdabbf){var _0x512eb0={};var _0x25d041={};var _0x153fcc;var _0x3f4a5e;return db[_0xb502('0x31')][_0xb502('0x88')]({'where':{'id':_0x59c579[_0xb502('0x54')]['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0xfdabbf,null))[_0xb502('0x1f')](function(_0x122af9){if(_0x122af9){_0x153fcc=_0x122af9;_0x25d041['model']=_[_0xb502('0xc4')](db[_0xb502('0xbc')][_0xb502('0x32')]);_0x25d041[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x59c579[_0xb502('0x3e')]);_0x25d041[_0xb502('0xc6')]=_[_0xb502('0xc7')](_0x25d041[_0xb502('0xc3')],_0x25d041[_0xb502('0x3e')]);_0x512eb0[_0xb502('0x41')]=_[_0xb502('0xc7')](_0x25d041[_0xb502('0xc3')],qs[_0xb502('0xc8')](_0x59c579[_0xb502('0x3e')][_0xb502('0xc8')]));_0x512eb0[_0xb502('0x41')]=_0x512eb0[_0xb502('0x41')][_0xb502('0x46')]?_0x512eb0[_0xb502('0x41')]:_0x25d041[_0xb502('0xc3')];_0x512eb0['order']=qs['sort'](_0x59c579[_0xb502('0x3e')][_0xb502('0xca')]);_0x512eb0['where']=qs[_0xb502('0xc6')](_['pick'](_0x59c579[_0xb502('0x3e')],_0x25d041[_0xb502('0xc6')]));if(_0x59c579[_0xb502('0x3e')][_0xb502('0x2b')]){_0x512eb0[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x512eb0[_0xb502('0x3c')],{'$or':_[_0xb502('0x2c')](_0x512eb0['attributes'],function(_0x5dafe5){var _0x4e4217={};_0x4e4217[_0x5dafe5]={'$like':'%'+_0x59c579[_0xb502('0x3e')][_0xb502('0x2b')]+'%'};return _0x4e4217;})});}_0x512eb0=_[_0xb502('0x50')]({},_0x512eb0,_0x59c579['options']);return _0x153fcc[_0xb502('0x110')](_0x512eb0);}})[_0xb502('0x1f')](function(_0x4c08e2){if(_0x4c08e2){_0x3f4a5e=_0x4c08e2[_0xb502('0x46')];if(!_0x59c579[_0xb502('0x3e')]['hasOwnProperty'](_0xb502('0xce'))){_0x512eb0[_0xb502('0x19')]=qs[_0xb502('0x19')](_0x59c579[_0xb502('0x3e')][_0xb502('0x19')]);_0x512eb0['offset']=qs[_0xb502('0x17')](_0x59c579[_0xb502('0x3e')][_0xb502('0x17')]);}return _0x153fcc['getLists'](_0x512eb0);}})[_0xb502('0x1f')](function(_0x58c684){if(_0x58c684){return _0x58c684?{'count':_0x3f4a5e,'rows':_0x58c684}:null;}})[_0xb502('0x1f')](respondWithResult(_0xfdabbf,null))[_0xb502('0x4d')](handleError(_0xfdabbf,null));};exports[_0xb502('0x111')]=function(_0x5b9189,_0x1bd708){var _0x57a95e={};var _0x3edcba={};var _0xe63c8a;return db['User'][_0xb502('0x88')]({'where':{'id':_0x5b9189['params']['id']}})[_0xb502('0x1f')](handleEntityNotFound(_0x1bd708,null))[_0xb502('0x1f')](function(_0x535262){if(_0x535262){_0xe63c8a=_0x535262;_0x3edcba['model']=_[_0xb502('0xc4')](db[_0xb502('0x31')]['rawAttributes']);_0x3edcba[_0xb502('0x3e')]=_[_0xb502('0xc4')](_0x5b9189['query']);_0x3edcba['filters']=_[_0xb502('0xc7')](_0x3edcba[_0xb502('0xc3')],_0x3edcba['query']);_0x57a95e[_0xb502('0x41')]=_[_0xb502('0xc7')](_0x3edcba['model'],qs[_0xb502('0xc8')](_0x5b9189[_0xb502('0x3e')]['fields']));_0x57a95e[_0xb502('0x41')]=_0x57a95e[_0xb502('0x41')][_0xb502('0x46')]?_0x57a95e[_0xb502('0x41')]:_0x3edcba[_0xb502('0xc3')];_0x57a95e[_0xb502('0xc9')]=qs[_0xb502('0xca')](_0x5b9189[_0xb502('0x3e')][_0xb502('0xca')]);_0x57a95e[_0xb502('0x3c')]=qs['filters'](_[_0xb502('0xcb')](_0x5b9189[_0xb502('0x3e')],_0x3edcba['filters']));if(_0x5b9189[_0xb502('0x3e')]['filter']){_0x57a95e[_0xb502('0x3c')]=_[_0xb502('0x50')](_0x57a95e[_0xb502('0x3c')],{'$or':_['map'](_0x57a95e[_0xb502('0x41')],function(_0x15407c){var _0x77db82={};_0x77db82[_0x15407c]={'$like':'%'+_0x5b9189[_0xb502('0x3e')]['filter']+'%'};return _0x77db82;})});}_0x57a95e['model']=db['User'];_0x57a95e['as']=_0xb502('0x28');_0x57a95e=_[_0xb502('0x50')]({},_0x57a95e,_0x5b9189['options']);return _0xe63c8a['getVoiceQueues']({'include':[_0x57a95e]});}})[_0xb502('0x1f')](function(_0x28c431){if(_0x28c431){var _0x3e323f={},_0x21bb9a=[];for(var _0x5cbf6d=0x0;_0x5cbf6d<_0x28c431['length'];_0x5cbf6d+=0x1){for(var _0x44aefe=0x0,_0x5971a1;_0x44aefe<_0x28c431[_0x5cbf6d][_0xb502('0x28')][_0xb502('0x46')];_0x44aefe+=0x1){_0x5971a1=_0x28c431[_0x5cbf6d][_0xb502('0x28')][_0x44aefe][_0xb502('0x24')]({'plain':!![]});_0x3e323f[_0x5971a1['id']]=_0x5971a1;}}_0x3e323f=_['values'](_0x3e323f);for(var _0x414df7=qs[_0xb502('0x17')](_0x5b9189[_0xb502('0x3e')][_0xb502('0x17')]);_0x414df7<_0x3e323f[_0xb502('0x46')]&&_0x21bb9a[_0xb502('0x46')]=_0x3aa095){_0x284a2c=_0x3aa095;_0x56e917=0xc8;}else{_0x56e917=0xce;}_0x52159e[_0xd518('0x18')](_0x56e917);return _0x52159e[_0xd518('0x19')]('Content-Range',_0xba363a+'-'+_0x284a2c+'/'+_0x3aa095)['json'](_0xb72e52);}return null;};}function saveUpdates(_0x28e041){return function(_0x28e14f){if(_0x28e14f){return _0x28e14f[_0xd518('0x1a')](_0x28e041)['then'](function(_0xd2826b){if(_0xd2826b[_0xd518('0x1b')]===_0xd518('0x1c')){socket['emit']('userNotification:recalc:'+_0xd2826b['id'],_0xd2826b);}return _0xd2826b;});}return null;};}function removeEntity(_0xd43413,_0x4e9b58){return function(_0x50ffdd){if(_0x50ffdd){return _0x50ffdd['destroy']({'transaction':_0x4e9b58})[_0xd518('0x1d')](function(){var _0x3d2cf5=_0x50ffdd[_0xd518('0x1e')]({'plain':!![]});if(_0x3d2cf5[_0xd518('0x1b')]===_0xd518('0x1f'))return;var _0x9b2e8f=[{'name':_0xd518('0x20'),'value':_0xd518('0x21'),'ignore':!![]},{'name':_0xd518('0x22'),'value':'agent','ignore':![]},{'name':_0xd518('0x23'),'value':_0xd518('0x24'),'ignore':![]}];var _0x2b5bf4=_(_0x9b2e8f)[_0xd518('0x25')](_0xd518('0x26'))[_0xd518('0x27')]('value')[_0xd518('0x28')]();if(_[_0xd518('0x29')](_0x2b5bf4,_0x3d2cf5[_0xd518('0x1b')])){return;}var _0xdc7535=_[_0xd518('0x2a')](_0x9b2e8f,['value',_0x3d2cf5[_0xd518('0x1b')]])['name'];return db[_0xd518('0x2b')][_0xd518('0x2c')]({'where':{'type':_0xdc7535,'resourceId':_0x3d2cf5['id']},'transaction':_0x4e9b58})[_0xd518('0x1d')](function(){return _0x50ffdd;});})[_0xd518('0x1d')](function(){_0xd43413['status'](0xcc)[_0xd518('0x13')]();});}};}function handleEntityNotFound(_0x5a7fa0){return function(_0x8bc4fd){if(!_0x8bc4fd){_0x5a7fa0[_0xd518('0x2d')](0x194);}return _0x8bc4fd;};}function handleError(_0xbcfc58,_0x22cf4b){_0x22cf4b=_0x22cf4b||0x1f4;return function(_0x2e195b){logger[_0xd518('0x2e')](_0x2e195b[_0xd518('0x2f')]);if(_0x2e195b[_0xd518('0x30')]){delete _0x2e195b[_0xd518('0x30')];}_0xbcfc58['status'](_0x22cf4b)[_0xd518('0x31')](_0x2e195b);};}function getUserAttributes(){return _(db[_0xd518('0x32')][_0xd518('0x33')])['map'](function(_0x590801){return{'name':_0x590801[_0xd518('0x34')],'type':_0x590801['type'][_0xd518('0x35')]};})[_0xd518('0x25')](function(_0x5a7de1){return![_0xd518('0x36'),_0xd518('0x37'),_0xd518('0x38'),_0xd518('0x39'),_0xd518('0x3a'),'md5secret'][_0xd518('0x29')](_0x5a7de1[_0xd518('0x30')]);})['value']();}exports[_0xd518('0x3b')]=function(_0x3662ed,_0x2d42d1){var _0x14939b={},_0x38c429={'count':0x0,'rows':[]};var _0x52b275=getUserAttributes();_0x14939b=qs['getOptions'](_0x52b275,_0x3662ed);var _0x4b4025={'where':_0x14939b[_0xd518('0x3c')]};return db[_0xd518('0x32')][_0xd518('0x17')](_0x4b4025)['then'](function(_0x26787f){_0x38c429['count']=_0x26787f;if(_0x3662ed[_0xd518('0x3d')]['includeAll']){_0x14939b['include']=[{'all':!![]}];}if(_0x3662ed[_0xd518('0x3d')]['userSetting']===_0xd518('0x3e')){_0x14939b['include']=[{'model':db['UserSetting'],'as':_0xd518('0x3f')}];}if(!_[_0xd518('0x29')](_0x14939b[_0xd518('0x40')],'id')){_0x14939b[_0xd518('0x40')][_0xd518('0x41')]('id');}return db['User'][_0xd518('0x42')](_0x14939b);})['then'](function(_0x5d25f4){_0x38c429[_0xd518('0x43')]=_0x5d25f4;if(_0x3662ed['query']['openTabs']===_0xd518('0x3e')){var _0x58ebe3=[];for(var _0x5ae782=0x0;_0x5ae782<_0x38c429[_0xd518('0x43')][_0xd518('0x44')];_0x5ae782++){_0x58ebe3['push'](get_open_tabs(_0xd518('0x45'),_0x38c429['rows'][_0x5ae782][_0xd518('0x46')]));_0x58ebe3[_0xd518('0x41')](get_open_tabs('sms',_0x38c429[_0xd518('0x43')][_0x5ae782][_0xd518('0x46')]));_0x58ebe3['push'](get_open_tabs(_0xd518('0x47'),_0x38c429[_0xd518('0x43')][_0x5ae782][_0xd518('0x46')]));_0x58ebe3[_0xd518('0x41')](get_open_tabs(_0xd518('0x48'),_0x38c429[_0xd518('0x43')][_0x5ae782][_0xd518('0x46')]));_0x58ebe3[_0xd518('0x41')](get_open_tabs(_0xd518('0x49'),_0x38c429['rows'][_0x5ae782][_0xd518('0x46')]));_0x58ebe3['push'](get_open_tabs('whatsapp',_0x38c429[_0xd518('0x43')][_0x5ae782][_0xd518('0x46')]));}return Promise[_0xd518('0x4a')](_0x58ebe3)[_0xd518('0x1d')](function(){return _0x38c429;});}else{return _0x38c429;}})[_0xd518('0x1d')](respondWithFilteredResult(_0x2d42d1,_0x14939b))[_0xd518('0x4b')](handleError(_0x2d42d1,null));};exports[_0xd518('0x4c')]=function(_0x75dc1d,_0x4054da){var _0x5b765e=getUserAttributes();_0x75dc1d[_0xd518('0x3d')]['id']=_0x75dc1d['params']['id'];var _0x5d9789=qs[_0xd518('0x4d')](_0x5b765e,_0x75dc1d);if(_0x75dc1d[_0xd518('0x3d')][_0xd518('0x4e')]){_0x5d9789['include']=[{'all':!![]}];}if(_0x75dc1d[_0xd518('0x3d')][_0xd518('0x3f')]===_0xd518('0x3e')){_0x5d9789['include']=[{'model':db[_0xd518('0x4f')],'as':_0xd518('0x3f')}];}_0x5d9789=_['merge']({},_0x5d9789,_0x75dc1d[_0xd518('0x50')]);if(!_[_0xd518('0x29')](_0x5d9789[_0xd518('0x40')],'id')){_0x5d9789[_0xd518('0x40')]['push']('id');}return db[_0xd518('0x32')][_0xd518('0x2a')](_0x5d9789)['then'](handleEntityNotFound(_0x4054da,null))['then'](function(_0x5184d4){var _0x4c00e3=[];values=_0x5184d4;if(_0x75dc1d[_0xd518('0x3d')][_0xd518('0x51')]===_0xd518('0x3e')){_0x4c00e3[_0xd518('0x41')](get_open_tabs(_0xd518('0x45'),_0x5184d4[_0xd518('0x46')]));_0x4c00e3['push'](get_open_tabs('sms',_0x5184d4['dataValues']));_0x4c00e3[_0xd518('0x41')](get_open_tabs(_0xd518('0x49'),_0x5184d4['dataValues']));_0x4c00e3[_0xd518('0x41')](get_open_tabs(_0xd518('0x52'),_0x5184d4[_0xd518('0x46')]));_0x4c00e3[_0xd518('0x41')](get_open_tabs(_0xd518('0x47'),_0x5184d4[_0xd518('0x46')]));_0x4c00e3[_0xd518('0x41')](get_open_tabs(_0xd518('0x48'),_0x5184d4[_0xd518('0x46')]));return Promise[_0xd518('0x4a')](_0x4c00e3);}else{return values;}})[_0xd518('0x1d')](function(){return values;})[_0xd518('0x1d')](respondWithResult(_0x4054da,null))[_0xd518('0x4b')](handleError(_0x4054da,null));};exports[_0xd518('0x1a')]=function(_0x56c052,_0x40be17){if(_0x56c052[_0xd518('0x53')]['id']){delete _0x56c052['body']['id'];}delete _0x56c052[_0xd518('0x53')][_0xd518('0x1b')];return db[_0xd518('0x32')][_0xd518('0x2a')]({'where':{'id':_0x56c052[_0xd518('0x54')]['id']}})['then'](handleEntityNotFound(_0x40be17,null))[_0xd518('0x1d')](saveUpdates(_0x56c052[_0xd518('0x53')],null))[_0xd518('0x1d')](respondWithResult(_0x40be17,null))[_0xd518('0x4b')](handleError(_0x40be17,null));};exports[_0xd518('0x55')]=function(_0x30f987,_0x19463f){return db[_0xd518('0x32')][_0xd518('0x55')]()['then'](respondWithResult(_0x19463f,null))[_0xd518('0x4b')](handleError(_0x19463f,null));};exports['addContacts']=function(_0x1e4bcf,_0x444951){return db[_0xd518('0x32')][_0xd518('0x2a')]({'where':{'id':_0x1e4bcf[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x444951,null))[_0xd518('0x1d')](function(_0x46749f){if(_0x46749f){return _0x46749f[_0xd518('0x56')](_0x1e4bcf[_0xd518('0x53')][_0xd518('0x57')],_[_0xd518('0x58')](_0x1e4bcf[_0xd518('0x53')],[_0xd518('0x57'),'id'])||{});}})['then'](respondWithResult(_0x444951,null))[_0xd518('0x4b')](handleError(_0x444951,null));};function validateUser(_0x1c286c){return new Promise(function(_0x6e7368,_0x5ba13f){if(_0x1c286c['internal'])return _0x6e7368(_0x1c286c);return db[_0xd518('0x59')]['findById'](0x1)[_0xd518('0x1d')](function(_0x1f532e){if(_0x1f532e[_0xd518('0x5a')])authService[_0xd518('0x5b')](_0x1c286c[_0xd518('0x36')]);db[_0xd518('0x32')][_0xd518('0x5c')](_0xd518('0x5d'))[_0xd518('0x1d')](function(_0x36d3e2){if(_[_0xd518('0x5e')](_0x36d3e2)){_0x1c286c['internal']=_0x1f532e[_0xd518('0x5f')]||0x1;return;}if(_['isNil'](_0x1f532e['min_internal'])||_0x1f532e['min_internal']===_0x36d3e2){_0x1c286c[_0xd518('0x5d')]=_0x36d3e2+0x1;return;}if(_0x1f532e[_0xd518('0x5f')]>_0x36d3e2){_0x1c286c['internal']=_0x1f532e[_0xd518('0x5f')];return;}return db[_0xd518('0x60')]['query'](_0xd518('0x61'),{'type':db[_0xd518('0x60')][_0xd518('0x62')][_0xd518('0x63')]})[_0xd518('0x1d')](function(_0x2c5388){if(_0x2c5388&&_0x2c5388[_0xd518('0x44')]){for(var _0x147b54=0x0,_0x24ad93=_0x2c5388[_0xd518('0x44')];_0x147b54<_0x24ad93&&_[_0xd518('0x5e')](_0x1c286c[_0xd518('0x5d')]);_0x147b54++){if(_0x1f532e[_0xd518('0x5f')]<=_0x2c5388[_0x147b54]['from']){_0x1c286c[_0xd518('0x5d')]=_0x2c5388[_0x147b54][_0xd518('0x64')];}else if(_0x1f532e[_0xd518('0x5f')]>_0x2c5388[_0x147b54][_0xd518('0x64')]&&_0x1f532e[_0xd518('0x5f')]<=_0x2c5388[_0x147b54]['to']){_0x1c286c['internal']=_0x1f532e['min_internal'];}}}if(_[_0xd518('0x5e')](_0x1c286c[_0xd518('0x5d')])){_0x1c286c[_0xd518('0x5d')]=_0x36d3e2+0x1;}return _0x6e7368(_0x1c286c);});});})[_0xd518('0x4b')](function(_0x4da101){_0x5ba13f(_0x4da101);});});}function updateUser(_0x531f60){return new Promise(function(_0x23bc3f,_0x45881c){try{if(_0x531f60[_0xd518('0x65')]){_0x531f60[_0xd518('0x66')]=_0x531f60[_0xd518('0x5d')];_0x531f60[_0xd518('0x67')]={'mailbox':_0x531f60['internal'],'password':_0x531f60[_0xd518('0x36')],'fullname':_0x531f60['fullname'],'email':_0x531f60[_0xd518('0x68')]};}if(_0x531f60[_0xd518('0x1b')]===_0xd518('0x1c')){if(!_0x531f60[_0xd518('0x69')])_0x531f60[_0xd518('0x69')]=[_0xd518('0x6a'),_0xd518('0x6b'),_0xd518('0x6c'),_0xd518('0x6d'),_0xd518('0x6e'),'104',_0xd518('0x6f'),'106',_0xd518('0x70'),_0xd518('0x71'),'109',_0xd518('0x72'),_0xd518('0x73'),_0xd518('0x74'),_0xd518('0x75')];}_0x23bc3f(_0x531f60);}catch(_0x417d45){_0x45881c(_0x417d45);}});}exports[_0xd518('0x76')]=function(_0x29b74d,_0x251276){if(_0x29b74d[_0xd518('0x21')]['role']===_0xd518('0x1c'))throw new Error(_0xd518('0x77'));if(_0x29b74d[_0xd518('0x53')][_0xd518('0x1b')]===_0xd518('0x21')&&_0x29b74d['user'][_0xd518('0x1b')]!==_0xd518('0x1f')){throw new Error(_0xd518('0x78'));}if(_0x29b74d[_0xd518('0x53')][_0xd518('0x1b')]==='admin'&&_0x29b74d['user']['role']!==_0xd518('0x1f')){throw new Error(_0xd518('0x79'));}return licenseUtil[_0xd518('0x7a')]([_0x29b74d[_0xd518('0x53')]])['then'](function(){return validateUser(_0x29b74d[_0xd518('0x53')]);})[_0xd518('0x1d')](function(_0x30a4c1){return updateUser(_0x30a4c1)[_0xd518('0x1d')](function(_0x1a294c){if(_0x1a294c['role']===_0xd518('0x1f')){_0x1a294c[_0xd518('0x7b')]=_0x29b74d[_0xd518('0x21')][_0xd518('0x7b')];delete _0x1a294c[_0xd518('0x7c')];}return _0x1a294c;});})[_0xd518('0x1d')](function(_0x54734d){return db['User'][_0xd518('0x76')](_0x54734d,{'include':[{'model':db[_0xd518('0x67')],'as':'VoiceMail'}]});})[_0xd518('0x1d')](function(_0x5bd4bb){if(_0x29b74d[_0xd518('0x53')][_0xd518('0x1b')]===_0xd518('0x21'))return _0x5bd4bb;if(_0x29b74d[_0xd518('0x21')]['role']!=='user')return _0x5bd4bb;return db[_0xd518('0x7d')][_0xd518('0x2a')]({'where':{'name':_0x5bd4bb[_0xd518('0x1b')]===_0xd518('0x1c')?_0xd518('0x22'):_0xd518('0x23'),'userProfileId':_0x29b74d['user']['userProfileId']},'raw':!![]})[_0xd518('0x1d')](function(_0x297419){if(!_0x297419||_0x297419[_0xd518('0x7e')]!=0x0)return _0x5bd4bb;return db['UserProfileResource'][_0xd518('0x76')]({'name':_0x5bd4bb[_0xd518('0x30')],'resourceId':_0x5bd4bb['id'],'type':_0x297419[_0xd518('0x30')],'sectionId':_0x297419['id']},{})['then'](function(){return _0x5bd4bb;});})[_0xd518('0x4b')](function(_0x2ed5ba){logger[_0xd518('0x2e')](_0xd518('0x7f'),_0x2ed5ba);throw _0x2ed5ba;});})['then'](respondWithResult(_0x251276,0xc9))[_0xd518('0x4b')](handleError(_0x251276,null));};exports[_0xd518('0x80')]=function(_0x466a79,_0x554e7a){var _0x3f8d6e=_0x466a79['body'];var _0x45cb72=[];if(_0x466a79[_0xd518('0x21')][_0xd518('0x1b')]===_0xd518('0x1c'))throw new Error(_0xd518('0x77'));if(_['some'](_0x3f8d6e,[_0xd518('0x1b'),_0xd518('0x21')])&&_0x466a79['user']['role']!=='admin'){throw new Error(_0xd518('0x78'));}if(_[_0xd518('0x81')](_0x3f8d6e,[_0xd518('0x1b'),'admin'])&&_0x466a79[_0xd518('0x21')][_0xd518('0x1b')]!==_0xd518('0x1f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x3f8d6e)['then'](function(){return validateUser(_0x3f8d6e[0x0]);})[_0xd518('0x1d')](function(){for(var _0x38e72d=0x1;_0x38e72d<_0x3f8d6e[_0xd518('0x44')];_0x38e72d++){var _0xdd8b93=_0x3f8d6e[_0x38e72d-0x1][_0xd518('0x5d')];if(!_0x3f8d6e[_0x38e72d][_0xd518('0x5d')])_0x3f8d6e[_0x38e72d]['internal']=_0xdd8b93+0x1;_0x45cb72[_0xd518('0x41')](validateUser(_0x3f8d6e[_0x38e72d]));}return Promise['all'](_0x45cb72);})[_0xd518('0x1d')](function(){_0x45cb72=[];for(var _0x2c27e8=0x0;_0x2c27e8<_0x3f8d6e[_0xd518('0x44')];_0x2c27e8++){_0x45cb72[_0xd518('0x41')](updateUser(_0x3f8d6e[_0x2c27e8]));}return Promise[_0xd518('0x4a')](_0x45cb72);})[_0xd518('0x1d')](function(){_0x45cb72=_0x3f8d6e['map'](function(_0x5574e3){return db[_0xd518('0x32')][_0xd518('0x76')](_0x5574e3,{'include':[{'model':db[_0xd518('0x67')],'as':'VoiceMail'}]})[_0xd518('0x1d')](function(_0x16e723){_0x5574e3['id']=_0x16e723['id'];return _0x5574e3;});});return Promise[_0xd518('0x4a')](_0x45cb72);})[_0xd518('0x1d')](function(_0x5e6e1f){if(_0x466a79['body'][_0xd518('0x1b')]===_0xd518('0x21'))return _0x5e6e1f;if(_0x466a79[_0xd518('0x21')][_0xd518('0x1b')]!=='user')return _0x5e6e1f;var _0x165a54=_[_0xd518('0x81')](_0x5e6e1f,function(_0x5d6061){return _0x5d6061[_0xd518('0x1b')]===_0xd518('0x1c')||_0x5d6061[_0xd518('0x1b')]===_0xd518('0x24');});if(!_0x165a54)return _0x5e6e1f;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xd518('0x22'),_0xd518('0x23')]},'userProfileId':_0x466a79[_0xd518('0x21')][_0xd518('0x7c')]},'raw':!![]})[_0xd518('0x1d')](function(_0x213d0d){if(_['isEmpty'](_0x213d0d)||!_[_0xd518('0x81')](_0x213d0d,[_0xd518('0x7e'),0x0]))return _0x5e6e1f;_0x45cb72=[];var _0x4f966c=_(_0x213d0d)['map'](function(_0x282575){if(_0x282575[_0xd518('0x7e')]===0x1)return;return _0x282575[_0xd518('0x30')]===_0xd518('0x22')?_0xd518('0x1c'):'telephone';})[_0xd518('0x82')]()[_0xd518('0x28')]();for(var _0x3ba12c=0x0;_0x3ba12c<_0x5e6e1f[_0xd518('0x44')];_0x3ba12c++){if(!_['includes'](_0x4f966c,_0x5e6e1f[_0x3ba12c][_0xd518('0x1b')]))return;var _0x46dbaf=_0x5e6e1f[_0x3ba12c][_0xd518('0x1b')]===_0xd518('0x1c')?_0xd518('0x22'):_0xd518('0x23');_0x45cb72['push'](db[_0xd518('0x2b')]['create']({'name':_0x5e6e1f[_0x3ba12c][_0xd518('0x30')],'resourceId':_0x5e6e1f[_0x3ba12c]['id'],'type':_0x46dbaf,'sectionId':_[_0xd518('0x2a')](_0x213d0d,[_0xd518('0x30'),_0x46dbaf])['id']},{}));}return Promise['all'](_0x45cb72);});})[_0xd518('0x1d')](respondWithResult(_0x554e7a,0xc9))[_0xd518('0x4b')](handleError(_0x554e7a,null));};exports[_0xd518('0x83')]=function(_0x9c31b4,_0x461051){if(_0x9c31b4['body']['id']){delete _0x9c31b4['body']['id'];}return db[_0xd518('0x32')][_0xd518('0x2a')]({'where':{'id':_0x9c31b4[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](function(_0x10e678){if(!_0x10e678)return null;if(_0x10e678['id']===_0x9c31b4[_0xd518('0x21')]['id']){if(!_0x9c31b4[_0xd518('0x53')][_0xd518('0x84')]||!_0x9c31b4[_0xd518('0x53')][_0xd518('0x85')]){throw new db[(_0xd518('0x86'))][(_0xd518('0x87'))](_0xd518('0x88'));}if(!_0x10e678[_0xd518('0x89')](_0x9c31b4[_0xd518('0x53')][_0xd518('0x84')])){throw new db['Sequelize']['ValidationError'](_0xd518('0x8a'));}if(_0x9c31b4['body'][_0xd518('0x84')]===_0x9c31b4['body']['newPassword']){throw new db['Sequelize']['ValidationError'](_0xd518('0x8b'));}}else if(_0x9c31b4[_0xd518('0x21')][_0xd518('0x1b')]===_0xd518('0x1f')){if(!_0x9c31b4[_0xd518('0x53')][_0xd518('0x85')]){throw new db[(_0xd518('0x86'))]['ValidationError'](_0xd518('0x8c'));}}else if(_0x9c31b4[_0xd518('0x21')]['role']===_0xd518('0x21')){if(!_0x9c31b4['body'][_0xd518('0x85')]){throw new db['Sequelize'][(_0xd518('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x10e678[_0xd518('0x1b')]!==_0xd518('0x1c')){throw new db[(_0xd518('0x86'))][(_0xd518('0x87'))](_0xd518('0x77'));}}else{throw new db[(_0xd518('0x86'))][(_0xd518('0x87'))](_0xd518('0x77'));}return _0x10e678;})[_0xd518('0x1d')](handleEntityNotFound(_0x461051,null))[_0xd518('0x1d')](function(_0x1119de){return db[_0xd518('0x59')]['findOne']({'attributes':['id',_0xd518('0x5a'),'enforcePasswordHistory',_0xd518('0x8d')]})[_0xd518('0x1d')](function(_0x298ef3){if(_0x298ef3[_0xd518('0x5a')])authService[_0xd518('0x5b')](_0x9c31b4[_0xd518('0x53')][_0xd518('0x85')]);if(!_0x298ef3[_0xd518('0x8e')]||!_0x1119de['previousPasswords'])return _0x1119de;authService['validatePasswordHistory'](_0x9c31b4[_0xd518('0x53')][_0xd518('0x85')],_0x1119de[_0xd518('0x38')],_0x298ef3[_0xd518('0x8d')]);return _0x1119de;})[_0xd518('0x1d')](saveUpdates({'password':_0x9c31b4[_0xd518('0x53')][_0xd518('0x85')],'passwordResetAt':_0x9c31b4[_0xd518('0x21')]['id']==_0x9c31b4[_0xd518('0x54')]['id']?moment():null,'previousPasswords':authService[_0xd518('0x8f')](_0x9c31b4[_0xd518('0x53')]['newPassword'],_0x1119de[_0xd518('0x38')])},null));})[_0xd518('0x1d')](respondWithResult(_0x461051,null))[_0xd518('0x4b')](handleError(_0x461051,null));};exports[_0xd518('0x90')]=function(_0x5484cf,_0xde1097){var _0x326c64=_0x5484cf[_0xd518('0x53')][_0xd518('0x91')];return db[_0xd518('0x32')]['find']({'where':{'id':_0x5484cf[_0xd518('0x54')]['id']},'attributes':['id',_0xd518('0x30'),'role','online',_0xd518('0x92'),_0xd518('0x93'),_0xd518('0x94')]})[_0xd518('0x1d')](handleEntityNotFound(_0xde1097,null))['then'](function(_0x2b8de8){if(_0x2b8de8){if(!utils[_0xd518('0x95')](_0x326c64)){throw new db[(_0xd518('0x86'))][(_0xd518('0x87'))](_0xd518('0x96'));}return _0x2b8de8[_0xd518('0x97')+_[_0xd518('0x98')](_0x326c64[_0xd518('0x99')]())+_0xd518('0x9a')](_0x5484cf['body'][_0xd518('0x57')],{'penalty':_0x5484cf[_0xd518('0x53')][_0xd518('0x9b')]||0x0})[_0xd518('0x9c')](function(_0x396369){for(var _0x48b51b=0x0;_0x48b51b<_0x5484cf[_0xd518('0x53')][_0xd518('0x57')][_0xd518('0x44')];_0x48b51b+=0x1){var _0x58c821={'UserId':Number(_0x5484cf[_0xd518('0x54')]['id'])};_0x58c821[_[_0xd518('0x98')](_0x326c64[_0xd518('0x99')]())+_0xd518('0x9d')]=Number(_0x5484cf[_0xd518('0x53')][_0xd518('0x57')][_0x48b51b]);socket[_0xd518('0x9e')](_0xd518('0x21')+_[_0xd518('0x98')](_0x326c64['toLowerCase']())+_0xd518('0x9f'),_0x58c821);}return _0x396369;})[_0xd518('0x1d')](function(){if(_0x326c64===_0xd518('0xa0')){return db[_0xd518('0xa1')][_0xd518('0x42')]({'where':{'id':_0x5484cf[_0xd518('0x53')][_0xd518('0x57')]||[]},'raw':!![],'attributes':['id',_0xd518('0x30')]});}})[_0xd518('0x1d')](function(_0x373279){var _0x3722dd=_0x2b8de8[_0xd518('0x1e')]({'plain':!![]});var _0x166948=[];if(_0x326c64===_0xd518('0xa0')&&_0x3722dd[_0xd518('0x1b')]===_0xd518('0x1c')&&_0x3722dd[_0xd518('0xa2')]){for(let _0x11fc01=0x0;_0x11fc01<_0x373279['length'];_0x11fc01+=0x1){_0x166948['push']({'membername':_0x3722dd[_0xd518('0x30')],'UserId':_0x3722dd['id'],'queue_name':_0x373279[_0x11fc01]['name'],'VoiceQueueId':_0x373279[_0x11fc01]['id'],'interface':_[_0xd518('0x5e')](_0x3722dd[_0xd518('0x94')])?util[_0xd518('0xa3')](_0xd518('0xa4'),_0x3722dd[_0xd518('0x30')]):_0x3722dd['interface'],'paused':_0x3722dd[_0xd518('0x93')]||![],'penalty':_0x5484cf['body'][_0xd518('0x9b')]||0x0});}return Promise[_0xd518('0x4a')](_0x166948[_0xd518('0x27')](function(_0x5338f4){return db[_0xd518('0xa5')][_0xd518('0xa6')](_0x5338f4);}));}return _0x2b8de8;});}})[_0xd518('0x1d')](respondWithStatusCode(_0xde1097,null))[_0xd518('0x4b')](handleError(_0xde1097,null));};exports['removeQueues']=function(_0xf1ad3d,_0x4df635){var _0x49fada,_0x13b298;return db[_0xd518('0x32')][_0xd518('0x2a')]({'where':{'id':_0xf1ad3d[_0xd518('0x54')]['id']},'attributes':['id',_0xd518('0x30'),_0xd518('0x1b')]})[_0xd518('0x1d')](handleEntityNotFound(_0x4df635,null))[_0xd518('0x1d')](function(_0x28596e){if(_0x28596e){_0x49fada=_0x28596e;if(!_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x91')]||!utils[_0xd518('0x95')](_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x91')])){throw new db[(_0xd518('0x86'))][(_0xd518('0x87'))]('Unknown\x20channel');}return _0x28596e[_0xd518('0xa7')+_['capitalize'](_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x91')][_0xd518('0x99')]())+_0xd518('0x9a')](_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x57')]);}})['then'](function(_0x2e587d){if(_[_0xd518('0xa8')](_0xf1ad3d['query'][_0xd518('0x57')])){for(var _0x2560e4=0x0;_0x2560e4<_0xf1ad3d['query'][_0xd518('0x57')][_0xd518('0x44')];_0x2560e4+=0x1){_0x13b298={'UserId':Number(_0xf1ad3d[_0xd518('0x54')]['id'])};_0x13b298[_['capitalize'](_0xf1ad3d['query']['channel'][_0xd518('0x99')]())+'QueueId']=Number(_0xf1ad3d['query'][_0xd518('0x57')][_0x2560e4]);socket[_0xd518('0x9e')](_0xd518('0x21')+_[_0xd518('0x98')](_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x91')]['toLowerCase']())+_0xd518('0xa9'),_0x13b298);}}else{_0x13b298={'UserId':Number(_0xf1ad3d[_0xd518('0x54')]['id'])};_0x13b298[_[_0xd518('0x98')](_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x91')][_0xd518('0x99')]())+'QueueId']=Number(_0xf1ad3d[_0xd518('0x3d')]['ids']);socket[_0xd518('0x9e')](_0xd518('0x21')+_[_0xd518('0x98')](_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x91')]['toLowerCase']())+_0xd518('0xa9'),_0x13b298);}return _0x2e587d;})[_0xd518('0x1d')](function(){if(_0xf1ad3d[_0xd518('0x3d')][_0xd518('0x91')]===_0xd518('0xa0')){return db[_0xd518('0xa5')][_0xd518('0x2c')]({'where':{'UserId':_0xf1ad3d[_0xd518('0x54')]['id'],'VoiceQueueId':_0xf1ad3d['query'][_0xd518('0x57')]},'individualHooks':!![]})[_0xd518('0x1d')](function(){return _0x49fada;});}return _0x49fada;})[_0xd518('0x1d')](respondWithStatusCode(_0x4df635,null))[_0xd518('0x4b')](handleError(_0x4df635,null));};exports[_0xd518('0xaa')]=function(_0x3cf643,_0x15885b){_0x3cf643['body']['userpic']=_0x3cf643[_0xd518('0xab')][_0xd518('0xac')];return db[_0xd518('0x32')]['find']({'where':{'id':_0x3cf643[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x15885b,null))[_0xd518('0x1d')](saveUpdates(_0x3cf643[_0xd518('0x53')],null))['then'](respondWithResult(_0x15885b,null))['catch'](handleError(_0x15885b,null));};exports['getAvatar']=function(_0x70200e,_0xde43c2){var _0x40aaf1=path[_0xd518('0xad')](config[_0xd518('0xae')],_0xd518('0xaf'));return db[_0xd518('0x32')][_0xd518('0x2a')]({'where':{'id':_0x70200e[_0xd518('0x54')]['id']},'attributes':['id',_0xd518('0xb0')],'raw':!![]})[_0xd518('0x1d')](handleEntityNotFound(_0xde43c2,null))[_0xd518('0x1d')](function(_0x4e7f9d){if(_0x4e7f9d){if(_[_0xd518('0x5e')](_0x4e7f9d[_0xd518('0xb0')])){return _0xde43c2[_0xd518('0xb1')](_0x40aaf1);}else{if(!fs[_0xd518('0xb2')](path[_0xd518('0xad')](config['root'],'server/files/images/',_0x4e7f9d[_0xd518('0xb0')]))){return _0xde43c2['download'](_0x40aaf1);}return _0xde43c2['download'](path[_0xd518('0xad')](config[_0xd518('0xae')],_0xd518('0xb3'),_0x4e7f9d[_0xd518('0xb0')]));}}})[_0xd518('0x4b')](handleError(_0xde43c2,null));};exports['getOpenTabs']=function(_0x2fd4b4,_0x1ff06f){return db[_0xd518('0x32')]['find']({'where':{'id':_0x2fd4b4['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x1ff06f,null))['then'](function(_0x52e68c){var _0x134ce3=[];values=_0x52e68c[_0xd518('0x46')];_0x134ce3['push'](get_open_tabs('chat',_0x52e68c[_0xd518('0x46')]));_0x134ce3[_0xd518('0x41')](get_open_tabs(_0xd518('0xb4'),_0x52e68c['dataValues']));_0x134ce3[_0xd518('0x41')](get_open_tabs('openchannel',_0x52e68c['dataValues']));_0x134ce3['push'](get_open_tabs(_0xd518('0x52'),_0x52e68c[_0xd518('0x46')]));_0x134ce3['push'](get_open_tabs(_0xd518('0x47'),_0x52e68c[_0xd518('0x46')]));_0x134ce3[_0xd518('0x41')](get_open_tabs(_0xd518('0x48'),_0x52e68c['dataValues']));return Promise[_0xd518('0x4a')](_0x134ce3);})[_0xd518('0x1d')](function(_0x389fc2){if(_0x389fc2){var _0x2d4229=_[_0xd518('0x27')](values['ChatOpenTabs'],function(_0x23f1c9){return{'channel':_0xd518('0xb5'),'id':_0x23f1c9['id'],'createdAt':_0x23f1c9[_0xd518('0xb6')]};});var _0x25395f=_['map'](values['FaxOpenTabs'],function(_0x503f41){return{'channel':'FAX','id':_0x503f41['id'],'createdAt':_0x503f41[_0xd518('0xb6')]};});var _0x179c45=_[_0xd518('0x27')](values[_0xd518('0xb7')],function(_0x42cce0){return{'channel':_0xd518('0xb8'),'id':_0x42cce0['id'],'createdAt':_0x42cce0['createdAt']};});var _0x209f58=_['map'](values['MailOpenTabs'],function(_0x5dff66){return{'channel':_0xd518('0xb9'),'id':_0x5dff66['id'],'createdAt':_0x5dff66['createdAt']};});var _0x1ce540=_['map'](values[_0xd518('0xba')],function(_0x5b8d4f){return{'channel':'SMS','id':_0x5b8d4f['id'],'createdAt':_0x5b8d4f['createdAt']};});var _0x3e8383=_['map'](values['WhatsappOpenTabs'],function(_0xc19870){return{'channel':_0xd518('0xbb'),'id':_0xc19870['id'],'createdAt':_0xc19870['createdAt']};});var _0xc341a=_[_0xd518('0xbc')](_0x2d4229,_0x25395f,_0x179c45,_0x209f58,_0x1ce540,_0x3e8383);var _0x2be6f9={'count':_0xc341a[_0xd518('0x44')],'rows':_0xc341a};return _0x2be6f9;}else return null;})[_0xd518('0x1d')](respondWithResult(_0x1ff06f,null))[_0xd518('0x4b')](handleError(_0x1ff06f,null));};exports[_0xd518('0xbd')]=function(_0x27d21d,_0x5637a5){var _0x1052bc={};return db['User'][_0xd518('0xbe')]({'where':{'id':_0x27d21d['params']['id']}})[_0xd518('0x1d')](function(_0x522378){if(!_0x522378){throw new APINotFoundError(util[_0xd518('0xa3')]('User\x20with\x20id\x20%s\x20not\x20found',_0x27d21d[_0xd518('0x54')]['id']));}return contacts[_0xd518('0x55')]();})[_0xd518('0x1d')](function(_0x432f51){_0x27d21d['query'][_0xd518('0x32')]=_0x27d21d['params']['id'];_0x1052bc=qs[_0xd518('0x4d')](_0x432f51,_0x27d21d);if(_0x27d21d['query'][_0xd518('0xbf')]('includeAll')){_0x1052bc[_0xd518('0xc0')]=[{'model':db[_0xd518('0xc1')],'as':_0xd518('0xc2'),'required':![]},{'model':db['Tag'],'as':_0xd518('0xc3'),'attributes':['id','name',_0xd518('0xc4')],'where':_0x27d21d['query'][_0xd518('0xc5')]?{'id':_0x27d21d[_0xd518('0x3d')]['tag']}:undefined,'required':_0x27d21d['query'][_0xd518('0xc5')]?!![]:![]}];}return contacts[_0xd518('0x42')](_0x27d21d['query'],_0x27d21d['user'],_0x1052bc,_0x432f51);})[_0xd518('0x1d')](respondWithFilteredResult(_0x5637a5,_0x1052bc))[_0xd518('0x4b')](APIHandleError(_0x5637a5));};exports[_0xd518('0xc6')]=function(_0x4c5a4d,_0x579d2a){var _0x898e30;var _0x97b9e0={};var _0x2d97f9;return db[_0xd518('0x32')]['findOne']({'where':{'id':_0x4c5a4d['params']['id']},'attributes':['id',_0xd518('0x30'),'role']})[_0xd518('0x1d')](handleEntityNotFound(_0x579d2a,null))['then'](function(_0x522a91){if(!utils[_0xd518('0x95')](_0x4c5a4d[_0xd518('0x3d')]['channel'])){throw new db[(_0xd518('0x86'))][(_0xd518('0x87'))]('Unknown\x20channel');}_0x898e30=_0x522a91;var _0x1fa17a={};_0x1fa17a[_0xd518('0xc7')]=_['keys'](db[_['capitalize'](_0x4c5a4d[_0xd518('0x3d')][_0xd518('0x91')])+_0xd518('0xc8')][_0xd518('0x33')]);_0x1fa17a[_0xd518('0x3d')]=_[_0xd518('0xc9')](_0x4c5a4d['query']);_0x1fa17a[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x1fa17a['model'],_0x1fa17a[_0xd518('0x3d')]);_0x97b9e0[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x1fa17a[_0xd518('0xc7')],qs['fields'](_0x4c5a4d[_0xd518('0x3d')][_0xd518('0xcc')]));_0x97b9e0[_0xd518('0x40')]=_0x97b9e0['attributes'][_0xd518('0x44')]?_0x97b9e0[_0xd518('0x40')]:_0x1fa17a[_0xd518('0xc7')];_0x97b9e0['order']=qs[_0xd518('0xcd')](_0x4c5a4d['query'][_0xd518('0xcd')]);_0x97b9e0[_0xd518('0x3c')]=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x4c5a4d[_0xd518('0x3d')],_0x1fa17a[_0xd518('0xca')]));if(_0x4c5a4d['query'][_0xd518('0x25')]){_0x97b9e0['where']=_[_0xd518('0xcf')](_0x97b9e0['where'],{'$or':_[_0xd518('0x27')](_0x97b9e0[_0xd518('0x40')],function(_0x52a5d5){var _0x5d167e={};_0x5d167e[_0x52a5d5]={'$like':'%'+_0x4c5a4d[_0xd518('0x3d')][_0xd518('0x25')]+'%'};return _0x5d167e;})});}_0x97b9e0=_['merge']({},_0x97b9e0,_0x4c5a4d[_0xd518('0x50')]);switch(_0x898e30[_0xd518('0x1b')]){case _0xd518('0x1f'):return db[_['capitalize'](_0x4c5a4d['query'][_0xd518('0x91')])+_0xd518('0xc8')][_0xd518('0x42')](_0x97b9e0);case _0xd518('0x21'):case _0xd518('0x1c'):return _0x898e30[_0xd518('0x1e')+_[_0xd518('0x98')](_0x4c5a4d[_0xd518('0x3d')][_0xd518('0x91')])+_0xd518('0x9a')](_0x97b9e0);default:throw new db[(_0xd518('0x86'))]['ValidationError'](_0xd518('0xd0'));}})[_0xd518('0x1d')](function(_0x345a57){_0x2d97f9=_0x345a57['length'];if(!_0x4c5a4d[_0xd518('0x3d')]['hasOwnProperty']('nolimit')){_0x97b9e0[_0xd518('0xd1')]=qs[_0xd518('0xd1')](_0x4c5a4d[_0xd518('0x3d')]['limit']);_0x97b9e0[_0xd518('0x15')]=qs['offset'](_0x4c5a4d[_0xd518('0x3d')]['offset']);}switch(_0x898e30[_0xd518('0x1b')]){case _0xd518('0x1f'):return db[_[_0xd518('0x98')](_0x4c5a4d[_0xd518('0x3d')][_0xd518('0x91')])+_0xd518('0xc8')][_0xd518('0x42')](_0x97b9e0);case'user':case _0xd518('0x1c'):return _0x898e30[_0xd518('0x1e')+_['capitalize'](_0x4c5a4d['query']['channel'])+_0xd518('0x9a')](_0x97b9e0);}})['then'](function(_0x321f3f){return{'count':_0x2d97f9,'rows':_0x321f3f};})[_0xd518('0x1d')](respondWithResult(_0x579d2a,null))[_0xd518('0x4b')](handleError(_0x579d2a,null));};exports[_0xd518('0xd2')]=function(_0x4fe871,_0x193f43){var _0x27f76e={};var _0x396931={};var _0xab30a4;var _0x1770a6;return db['User'][_0xd518('0xbe')]({'where':{'id':_0x4fe871[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x193f43,null))[_0xd518('0x1d')](function(_0xdb2e4f){if(_0xdb2e4f){_0xab30a4=_0xdb2e4f;_0x396931[_0xd518('0xc7')]=_[_0xd518('0xc9')](db[_0xd518('0xa5')]['rawAttributes']);_0x396931['query']=_['keys'](_0x4fe871[_0xd518('0x3d')]);_0x396931[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x396931[_0xd518('0xc7')],_0x396931['query']);_0x27f76e[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x396931[_0xd518('0xc7')],qs[_0xd518('0xcc')](_0x4fe871[_0xd518('0x3d')][_0xd518('0xcc')]));_0x27f76e[_0xd518('0x40')]=_0x27f76e[_0xd518('0x40')]['length']?_0x27f76e[_0xd518('0x40')]:_0x396931['model'];_0x27f76e[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x4fe871[_0xd518('0x3d')][_0xd518('0xcd')]);_0x27f76e[_0xd518('0x3c')]=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x4fe871[_0xd518('0x3d')],_0x396931[_0xd518('0xca')]));if(_0x4fe871[_0xd518('0x3d')][_0xd518('0x25')]){_0x27f76e['where']=_[_0xd518('0xcf')](_0x27f76e[_0xd518('0x3c')],{'$or':_['map'](_0x27f76e[_0xd518('0x40')],function(_0x36c3dc){var _0x516be9={};_0x516be9[_0x36c3dc]={'$like':'%'+_0x4fe871['query'][_0xd518('0x25')]+'%'};return _0x516be9;})});}_0x27f76e=_['merge']({},_0x27f76e,_0x4fe871[_0xd518('0x50')]);return _0xab30a4[_0xd518('0xd2')](_0x27f76e);}})[_0xd518('0x1d')](function(_0x5ab7fb){if(_0x5ab7fb){_0x1770a6=_0x5ab7fb[_0xd518('0x44')];if(!_0x4fe871[_0xd518('0x3d')]['hasOwnProperty']('nolimit')){_0x27f76e['limit']=qs['limit'](_0x4fe871[_0xd518('0x3d')][_0xd518('0xd1')]);_0x27f76e[_0xd518('0x15')]=qs['offset'](_0x4fe871[_0xd518('0x3d')]['offset']);}return _0xab30a4[_0xd518('0xd2')](_0x27f76e);}})[_0xd518('0x1d')](function(_0x1a21e4){if(_0x1a21e4){return _0x1a21e4?{'count':_0x1770a6,'rows':_0x1a21e4}:null;}})['then'](respondWithResult(_0x193f43,null))[_0xd518('0x4b')](handleError(_0x193f43,null));};exports['getGroups']=function(_0x902f3,_0x3a990a){var _0x505469={};var _0x8d6897={};var _0x3eb2de;var _0x45d1ad;return db['User'][_0xd518('0xbe')]({'where':{'id':_0x902f3[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x3a990a,null))['then'](function(_0x439fef){if(_0x439fef){_0x3eb2de=_0x439fef;_0x8d6897['model']=_['keys'](db[_0xd518('0xd4')][_0xd518('0x33')]);_0x8d6897[_0xd518('0x3d')]=_[_0xd518('0xc9')](_0x902f3[_0xd518('0x3d')]);_0x8d6897[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x8d6897['model'],_0x8d6897[_0xd518('0x3d')]);_0x505469['attributes']=_[_0xd518('0xcb')](_0x8d6897[_0xd518('0xc7')],qs[_0xd518('0xcc')](_0x902f3['query'][_0xd518('0xcc')]));_0x505469[_0xd518('0x40')]=_0x505469[_0xd518('0x40')][_0xd518('0x44')]?_0x505469['attributes']:_0x8d6897[_0xd518('0xc7')];_0x505469[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x902f3['query']['sort']);_0x505469[_0xd518('0x3c')]=qs[_0xd518('0xca')](_['pick'](_0x902f3[_0xd518('0x3d')],_0x8d6897[_0xd518('0xca')]));if(_0x902f3['query'][_0xd518('0x25')]){_0x505469[_0xd518('0x3c')]=_['merge'](_0x505469['where'],{'$or':_[_0xd518('0x27')](_0x505469['attributes'],function(_0x2763b6){var _0x2864d9={};_0x2864d9[_0x2763b6]={'$like':'%'+_0x902f3['query']['filter']+'%'};return _0x2864d9;})});}_0x505469=_[_0xd518('0xcf')]({},_0x505469,_0x902f3['options']);return _0x3eb2de[_0xd518('0xd5')](_0x505469);}})[_0xd518('0x1d')](function(_0x4707b7){if(_0x4707b7){_0x45d1ad=_0x4707b7[_0xd518('0x44')];if(!_0x902f3['query'][_0xd518('0xbf')](_0xd518('0xd6'))){_0x505469[_0xd518('0xd1')]=qs[_0xd518('0xd1')](_0x902f3[_0xd518('0x3d')][_0xd518('0xd1')]);_0x505469['offset']=qs[_0xd518('0x15')](_0x902f3[_0xd518('0x3d')][_0xd518('0x15')]);}return _0x3eb2de[_0xd518('0xd5')](_0x505469);}})[_0xd518('0x1d')](function(_0x54f4ff){if(_0x54f4ff){return _0x54f4ff?{'count':_0x45d1ad,'rows':_0x54f4ff}:null;}})[_0xd518('0x1d')](respondWithResult(_0x3a990a,null))[_0xd518('0x4b')](handleError(_0x3a990a,null));};exports[_0xd518('0xd7')]=function(_0x23289d,_0x54b15){var _0xddb110={'raw':!![],'where':{}};var _0x8315a={};var _0x5eb818={'count':0x0,'rows':[]};return db[_0xd518('0x32')][_0xd518('0xbe')]({'where':{'id':_0x23289d[_0xd518('0x54')]['id']}})['then'](handleEntityNotFound(_0x54b15,null))[_0xd518('0x1d')](function(_0x53c919){if(_0x53c919){_0x8315a[_0xd518('0xc7')]=_[_0xd518('0xc9')](db[_0xd518('0xd8')][_0xd518('0x33')]);_0x8315a['query']=_[_0xd518('0xc9')](_0x23289d[_0xd518('0x3d')]);_0x8315a['filters']=_[_0xd518('0xcb')](_0x8315a[_0xd518('0xc7')],_0x8315a[_0xd518('0x3d')]);_0xddb110[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x8315a[_0xd518('0xc7')],qs[_0xd518('0xcc')](_0x23289d[_0xd518('0x3d')][_0xd518('0xcc')]));_0xddb110[_0xd518('0x40')]=_0xddb110[_0xd518('0x40')][_0xd518('0x44')]?_0xddb110[_0xd518('0x40')]:_0x8315a[_0xd518('0xc7')];if(!_0x23289d[_0xd518('0x3d')][_0xd518('0xbf')]('nolimit')){_0xddb110[_0xd518('0xd1')]=qs[_0xd518('0xd1')](_0x23289d[_0xd518('0x3d')]['limit']);_0xddb110[_0xd518('0x15')]=qs[_0xd518('0x15')](_0x23289d[_0xd518('0x3d')][_0xd518('0x15')]);}_0xddb110[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x23289d[_0xd518('0x3d')][_0xd518('0xcd')]);_0xddb110[_0xd518('0x3c')]=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x23289d[_0xd518('0x3d')],_0x8315a['filters']));_0xddb110['where']['UserId']=_0x53c919['id'];if(_0x23289d[_0xd518('0x3d')][_0xd518('0x25')]){_0xddb110['where']=_['merge'](_0xddb110[_0xd518('0x3c')],{'$or':_[_0xd518('0x27')](_0xddb110[_0xd518('0x40')],function(_0x38bd35){var _0x113f4b={};_0x113f4b[_0x38bd35]={'$like':'%'+_0x23289d[_0xd518('0x3d')]['filter']+'%'};return _0x113f4b;})});}_0xddb110=_[_0xd518('0xcf')]({},_0xddb110,_0x23289d['options']);return db[_0xd518('0xd8')][_0xd518('0x17')]({'where':_0xddb110[_0xd518('0x3c')]})[_0xd518('0x1d')](function(_0x1ee009){_0x5eb818[_0xd518('0x17')]=_0x1ee009;if(_0x23289d[_0xd518('0x3d')][_0xd518('0x4e')]){_0xddb110[_0xd518('0xc0')]=[{'all':!![]}];}return db[_0xd518('0xd8')][_0xd518('0x42')](_0xddb110);})[_0xd518('0x1d')](function(_0x533570){_0x5eb818['rows']=_0x533570;return _0x5eb818;});}})[_0xd518('0x1d')](respondWithFilteredResult(_0x54b15,_0xddb110))['catch'](handleError(_0x54b15,null));};exports[_0xd518('0xd9')]=function(_0x5e70f9,_0x2bee8f){var _0x547a62={'raw':!![],'where':{}};var _0x4b7373={};var _0x4f27b4={'count':0x0,'rows':[]};return db[_0xd518('0x32')]['findOne']({'where':{'id':_0x5e70f9[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x2bee8f,null))[_0xd518('0x1d')](function(_0x40b994){if(_0x40b994){_0x4b7373[_0xd518('0xc7')]=_[_0xd518('0xc9')](db['ScreenRecording'][_0xd518('0x33')]);_0x4b7373[_0xd518('0x3d')]=_[_0xd518('0xc9')](_0x5e70f9[_0xd518('0x3d')]);_0x4b7373[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x4b7373[_0xd518('0xc7')],_0x4b7373[_0xd518('0x3d')]);_0x547a62[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x4b7373[_0xd518('0xc7')],qs[_0xd518('0xcc')](_0x5e70f9[_0xd518('0x3d')]['fields']));_0x547a62[_0xd518('0x40')]=_0x547a62['attributes']['length']?_0x547a62[_0xd518('0x40')]:_0x4b7373[_0xd518('0xc7')];if(!_0x5e70f9[_0xd518('0x3d')][_0xd518('0xbf')](_0xd518('0xd6'))){_0x547a62[_0xd518('0xd1')]=qs[_0xd518('0xd1')](_0x5e70f9['query'][_0xd518('0xd1')]);_0x547a62['offset']=qs[_0xd518('0x15')](_0x5e70f9[_0xd518('0x3d')]['offset']);}_0x547a62[_0xd518('0xd3')]=qs['sort'](_0x5e70f9['query'][_0xd518('0xcd')]);_0x547a62[_0xd518('0x3c')]=qs[_0xd518('0xca')](_['pick'](_0x5e70f9[_0xd518('0x3d')],_0x4b7373[_0xd518('0xca')]));_0x547a62[_0xd518('0x3c')][_0xd518('0xda')]=_0x40b994['id'];if(_0x5e70f9[_0xd518('0x3d')][_0xd518('0x25')]){_0x547a62[_0xd518('0x3c')]=_[_0xd518('0xcf')](_0x547a62['where'],{'$or':_[_0xd518('0x27')](_0x547a62[_0xd518('0x40')],function(_0x27162f){var _0xef2323={};_0xef2323[_0x27162f]={'$like':'%'+_0x5e70f9['query'][_0xd518('0x25')]+'%'};return _0xef2323;})});}_0x547a62=_[_0xd518('0xcf')]({},_0x547a62,_0x5e70f9[_0xd518('0x50')]);return db[_0xd518('0xdb')][_0xd518('0x17')]({'where':_0x547a62[_0xd518('0x3c')]})[_0xd518('0x1d')](function(_0x852966){_0x4f27b4[_0xd518('0x17')]=_0x852966;if(_0x5e70f9[_0xd518('0x3d')]['includeAll']){_0x547a62[_0xd518('0xc0')]=[{'all':!![]}];}return db[_0xd518('0xdb')]['findAll'](_0x547a62);})[_0xd518('0x1d')](function(_0x42b0db){_0x4f27b4[_0xd518('0x43')]=_0x42b0db;return _0x4f27b4;});}})[_0xd518('0x1d')](respondWithFilteredResult(_0x2bee8f,_0x547a62))[_0xd518('0x4b')](handleError(_0x2bee8f,null));};exports['getChatInteractions']=function(_0x757c,_0x461e8e){var _0x2a190b={};var _0x3b2ef7={};var _0x4bff51;var _0x19a58d;return db[_0xd518('0x32')][_0xd518('0xbe')]({'where':{'id':_0x757c[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x461e8e,null))[_0xd518('0x1d')](function(_0x429cd7){if(_0x429cd7){_0x4bff51=_0x429cd7;_0x3b2ef7['model']=_['keys'](db[_0xd518('0xdc')][_0xd518('0x33')]);_0x3b2ef7[_0xd518('0x3d')]=_[_0xd518('0xc9')](_0x757c['query']);_0x3b2ef7['filters']=_[_0xd518('0xcb')](_0x3b2ef7[_0xd518('0xc7')],_0x3b2ef7[_0xd518('0x3d')]);_0x2a190b['attributes']=_['intersection'](_0x3b2ef7[_0xd518('0xc7')],qs[_0xd518('0xcc')](_0x757c[_0xd518('0x3d')]['fields']));_0x2a190b[_0xd518('0x40')]=_0x2a190b[_0xd518('0x40')][_0xd518('0x44')]?_0x2a190b[_0xd518('0x40')]:_0x3b2ef7[_0xd518('0xc7')];_0x2a190b[_0xd518('0xd3')]=qs['sort'](_0x757c[_0xd518('0x3d')]['sort']);_0x2a190b['where']=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x757c[_0xd518('0x3d')],_0x3b2ef7[_0xd518('0xca')]));if(_0x757c[_0xd518('0x3d')][_0xd518('0x25')]){_0x2a190b[_0xd518('0x3c')]=_['merge'](_0x2a190b[_0xd518('0x3c')],{'$or':_[_0xd518('0x27')](_0x2a190b[_0xd518('0x40')],function(_0x54bcd9){var _0x4f2852={};_0x4f2852[_0x54bcd9]={'$like':'%'+_0x757c[_0xd518('0x3d')]['filter']+'%'};return _0x4f2852;})});}_0x2a190b=_[_0xd518('0xcf')]({},_0x2a190b,_0x757c['options']);return _0x4bff51[_0xd518('0xdd')](_0x2a190b);}})['then'](function(_0x23deda){if(_0x23deda){_0x19a58d=_0x23deda[_0xd518('0x44')];if(!_0x757c['query'][_0xd518('0xbf')](_0xd518('0xd6'))){_0x2a190b['limit']=qs[_0xd518('0xd1')](_0x757c[_0xd518('0x3d')][_0xd518('0xd1')]);_0x2a190b[_0xd518('0x15')]=qs['offset'](_0x757c['query'][_0xd518('0x15')]);}return _0x4bff51[_0xd518('0xdd')](_0x2a190b);}})[_0xd518('0x1d')](function(_0x393bbe){if(_0x393bbe){return _0x393bbe?{'count':_0x19a58d,'rows':_0x393bbe}:null;}})[_0xd518('0x1d')](respondWithResult(_0x461e8e,null))[_0xd518('0x4b')](handleError(_0x461e8e,null));};exports[_0xd518('0xde')]=function(_0x4c7594,_0x4a2c8d){var _0x14696f={};var _0x9db7fb={};var _0x2b491b;var _0xcff32b;return db['User']['findOne']({'where':{'id':_0x4c7594[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x4a2c8d,null))[_0xd518('0x1d')](function(_0x579c73){if(_0x579c73){_0x2b491b=_0x579c73;_0x9db7fb[_0xd518('0xc7')]=_['keys'](db['OpenchannelInteraction'][_0xd518('0x33')]);_0x9db7fb[_0xd518('0x3d')]=_[_0xd518('0xc9')](_0x4c7594['query']);_0x9db7fb[_0xd518('0xca')]=_['intersection'](_0x9db7fb['model'],_0x9db7fb[_0xd518('0x3d')]);_0x14696f['attributes']=_[_0xd518('0xcb')](_0x9db7fb['model'],qs[_0xd518('0xcc')](_0x4c7594[_0xd518('0x3d')][_0xd518('0xcc')]));_0x14696f['attributes']=_0x14696f[_0xd518('0x40')][_0xd518('0x44')]?_0x14696f[_0xd518('0x40')]:_0x9db7fb[_0xd518('0xc7')];_0x14696f['order']=qs[_0xd518('0xcd')](_0x4c7594[_0xd518('0x3d')]['sort']);_0x14696f[_0xd518('0x3c')]=qs['filters'](_[_0xd518('0xce')](_0x4c7594[_0xd518('0x3d')],_0x9db7fb[_0xd518('0xca')]));if(_0x4c7594[_0xd518('0x3d')][_0xd518('0x25')]){_0x14696f[_0xd518('0x3c')]=_[_0xd518('0xcf')](_0x14696f[_0xd518('0x3c')],{'$or':_[_0xd518('0x27')](_0x14696f[_0xd518('0x40')],function(_0x474602){var _0x6bc37d={};_0x6bc37d[_0x474602]={'$like':'%'+_0x4c7594[_0xd518('0x3d')][_0xd518('0x25')]+'%'};return _0x6bc37d;})});}_0x14696f=_[_0xd518('0xcf')]({},_0x14696f,_0x4c7594[_0xd518('0x50')]);return _0x2b491b[_0xd518('0xde')](_0x14696f);}})['then'](function(_0x38a3d1){if(_0x38a3d1){_0xcff32b=_0x38a3d1[_0xd518('0x44')];if(!_0x4c7594['query'][_0xd518('0xbf')](_0xd518('0xd6'))){_0x14696f['limit']=qs['limit'](_0x4c7594[_0xd518('0x3d')][_0xd518('0xd1')]);_0x14696f[_0xd518('0x15')]=qs[_0xd518('0x15')](_0x4c7594[_0xd518('0x3d')][_0xd518('0x15')]);}return _0x2b491b[_0xd518('0xde')](_0x14696f);}})[_0xd518('0x1d')](function(_0x35ebbf){if(_0x35ebbf){return _0x35ebbf?{'count':_0xcff32b,'rows':_0x35ebbf}:null;}})[_0xd518('0x1d')](respondWithResult(_0x4a2c8d,null))[_0xd518('0x4b')](handleError(_0x4a2c8d,null));};exports['getMailInteractions']=function(_0x5ad80c,_0x5311d5){var _0x2c2d72={'raw':!![],'where':{}};var _0x582972={};var _0x10bc30={'count':0x0,'rows':[]};return db[_0xd518('0x32')][_0xd518('0xbe')]({'where':{'id':_0x5ad80c['params']['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x5311d5,null))[_0xd518('0x1d')](function(_0x2e214b){if(_0x2e214b){_0x582972['model']=_['keys'](db['MailInteraction'][_0xd518('0x33')]);_0x582972['query']=_[_0xd518('0xc9')](_0x5ad80c['query']);_0x582972[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x582972[_0xd518('0xc7')],_0x582972[_0xd518('0x3d')]);_0x2c2d72['attributes']=_[_0xd518('0xcb')](_0x582972['model'],qs[_0xd518('0xcc')](_0x5ad80c[_0xd518('0x3d')][_0xd518('0xcc')]));_0x2c2d72[_0xd518('0x40')]=_0x2c2d72[_0xd518('0x40')][_0xd518('0x44')]?_0x2c2d72[_0xd518('0x40')]:_0x582972['model'];if(!_0x5ad80c[_0xd518('0x3d')]['hasOwnProperty'](_0xd518('0xd6'))){_0x2c2d72[_0xd518('0xd1')]=qs[_0xd518('0xd1')](_0x5ad80c[_0xd518('0x3d')][_0xd518('0xd1')]);_0x2c2d72[_0xd518('0x15')]=qs[_0xd518('0x15')](_0x5ad80c[_0xd518('0x3d')][_0xd518('0x15')]);}_0x2c2d72['order']=qs[_0xd518('0xcd')](_0x5ad80c[_0xd518('0x3d')][_0xd518('0xcd')]);_0x2c2d72['where']=qs['filters'](_['pick'](_0x5ad80c[_0xd518('0x3d')],_0x582972[_0xd518('0xca')]));_0x2c2d72[_0xd518('0x3c')]['UserId']=_0x2e214b['id'];if(_0x5ad80c['query'][_0xd518('0x25')]){_0x2c2d72[_0xd518('0x3c')]=_[_0xd518('0xcf')](_0x2c2d72[_0xd518('0x3c')],{'$or':_[_0xd518('0x27')](_0x2c2d72['attributes'],function(_0x41cd74){var _0x376fd5={};_0x376fd5[_0x41cd74]={'$like':'%'+_0x5ad80c[_0xd518('0x3d')][_0xd518('0x25')]+'%'};return _0x376fd5;})});}_0x2c2d72=_[_0xd518('0xcf')]({},_0x2c2d72,_0x5ad80c[_0xd518('0x50')]);return db[_0xd518('0xdf')][_0xd518('0x17')]({'where':_0x2c2d72[_0xd518('0x3c')]})[_0xd518('0x1d')](function(_0x445561){_0x10bc30[_0xd518('0x17')]=_0x445561;if(_0x5ad80c[_0xd518('0x3d')][_0xd518('0x4e')]){_0x2c2d72['include']=[{'all':!![]}];}return db[_0xd518('0xdf')]['findAll'](_0x2c2d72);})[_0xd518('0x1d')](function(_0x3646d6){_0x10bc30[_0xd518('0x43')]=_0x3646d6;return _0x10bc30;});}})[_0xd518('0x1d')](respondWithFilteredResult(_0x5311d5,_0x2c2d72))[_0xd518('0x4b')](handleError(_0x5311d5,null));};exports[_0xd518('0xe0')]=function(_0x3cb522,_0x461bb6){var _0x5ec703={};var _0x4ddf35={};var _0x41230e;var _0x589bf4;return db[_0xd518('0x32')]['findOne']({'where':{'id':_0x3cb522[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x461bb6,null))[_0xd518('0x1d')](function(_0x439186){if(_0x439186){_0x41230e=_0x439186;_0x4ddf35[_0xd518('0xc7')]=_[_0xd518('0xc9')](db[_0xd518('0xe1')][_0xd518('0x33')]);_0x4ddf35[_0xd518('0x3d')]=_[_0xd518('0xc9')](_0x3cb522[_0xd518('0x3d')]);_0x4ddf35[_0xd518('0xca')]=_['intersection'](_0x4ddf35[_0xd518('0xc7')],_0x4ddf35['query']);_0x5ec703[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x4ddf35[_0xd518('0xc7')],qs['fields'](_0x3cb522[_0xd518('0x3d')][_0xd518('0xcc')]));_0x5ec703['attributes']=_0x5ec703['attributes'][_0xd518('0x44')]?_0x5ec703['attributes']:_0x4ddf35['model'];_0x5ec703[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x3cb522[_0xd518('0x3d')][_0xd518('0xcd')]);_0x5ec703[_0xd518('0x3c')]=qs[_0xd518('0xca')](_['pick'](_0x3cb522[_0xd518('0x3d')],_0x4ddf35['filters']));if(_0x3cb522[_0xd518('0x3d')]['filter']){_0x5ec703[_0xd518('0x3c')]=_['merge'](_0x5ec703['where'],{'$or':_['map'](_0x5ec703[_0xd518('0x40')],function(_0x18faca){var _0x28f34a={};_0x28f34a[_0x18faca]={'$like':'%'+_0x3cb522[_0xd518('0x3d')][_0xd518('0x25')]+'%'};return _0x28f34a;})});}_0x5ec703=_[_0xd518('0xcf')]({},_0x5ec703,_0x3cb522['options']);return _0x41230e[_0xd518('0xe0')](_0x5ec703);}})['then'](function(_0x1a5ada){if(_0x1a5ada){_0x589bf4=_0x1a5ada[_0xd518('0x44')];if(!_0x3cb522[_0xd518('0x3d')][_0xd518('0xbf')](_0xd518('0xd6'))){_0x5ec703[_0xd518('0xd1')]=qs['limit'](_0x3cb522[_0xd518('0x3d')]['limit']);_0x5ec703[_0xd518('0x15')]=qs[_0xd518('0x15')](_0x3cb522[_0xd518('0x3d')][_0xd518('0x15')]);}return _0x41230e[_0xd518('0xe0')](_0x5ec703);}})[_0xd518('0x1d')](function(_0x1f8bdf){if(_0x1f8bdf){return _0x1f8bdf?{'count':_0x589bf4,'rows':_0x1f8bdf}:null;}})[_0xd518('0x1d')](respondWithResult(_0x461bb6,null))['catch'](handleError(_0x461bb6,null));};exports[_0xd518('0xe2')]=function(_0x2e7846,_0x3ee6a6){var _0x4cf2e2={};var _0x42d6d8={};var _0x1cfab6;var _0x5815e6;return db[_0xd518('0x32')][_0xd518('0xbe')]({'where':{'id':_0x2e7846[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x3ee6a6,null))[_0xd518('0x1d')](function(_0x2a1db9){if(_0x2a1db9){_0x1cfab6=_0x2a1db9;_0x42d6d8[_0xd518('0xc7')]=_['keys'](db[_0xd518('0xe3')][_0xd518('0x33')]);_0x42d6d8['query']=_[_0xd518('0xc9')](_0x2e7846[_0xd518('0x3d')]);_0x42d6d8[_0xd518('0xca')]=_['intersection'](_0x42d6d8[_0xd518('0xc7')],_0x42d6d8['query']);_0x4cf2e2[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x42d6d8[_0xd518('0xc7')],qs['fields'](_0x2e7846[_0xd518('0x3d')]['fields']));_0x4cf2e2[_0xd518('0x40')]=_0x4cf2e2[_0xd518('0x40')]['length']?_0x4cf2e2[_0xd518('0x40')]:_0x42d6d8[_0xd518('0xc7')];_0x4cf2e2[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x2e7846['query']['sort']);_0x4cf2e2['where']=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x2e7846['query'],_0x42d6d8[_0xd518('0xca')]));if(_0x2e7846[_0xd518('0x3d')]['filter']){_0x4cf2e2['where']=_[_0xd518('0xcf')](_0x4cf2e2[_0xd518('0x3c')],{'$or':_['map'](_0x4cf2e2[_0xd518('0x40')],function(_0x3b5b6c){var _0x3d9c8f={};_0x3d9c8f[_0x3b5b6c]={'$like':'%'+_0x2e7846[_0xd518('0x3d')][_0xd518('0x25')]+'%'};return _0x3d9c8f;})});}_0x4cf2e2=_['merge']({},_0x4cf2e2,_0x2e7846[_0xd518('0x50')]);return _0x1cfab6[_0xd518('0xe2')](_0x4cf2e2);}})[_0xd518('0x1d')](function(_0x25a3af){if(_0x25a3af){_0x5815e6=_0x25a3af[_0xd518('0x44')];if(!_0x2e7846['query'][_0xd518('0xbf')](_0xd518('0xd6'))){_0x4cf2e2[_0xd518('0xd1')]=qs['limit'](_0x2e7846['query'][_0xd518('0xd1')]);_0x4cf2e2['offset']=qs[_0xd518('0x15')](_0x2e7846['query'][_0xd518('0x15')]);}return _0x1cfab6[_0xd518('0xe2')](_0x4cf2e2);}})['then'](function(_0x1e561b){if(_0x1e561b){return _0x1e561b?{'count':_0x5815e6,'rows':_0x1e561b}:null;}})[_0xd518('0x1d')](respondWithResult(_0x3ee6a6,null))['catch'](handleError(_0x3ee6a6,null));};exports[_0xd518('0xe4')]=function(_0x4b37af,_0x59de94){var _0x3915a8={};var _0x7d15e0={};var _0x28355f;var _0x3fe4f5;return db[_0xd518('0x32')]['findOne']({'where':{'id':_0x4b37af[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x59de94,null))[_0xd518('0x1d')](function(_0x394ce6){if(_0x394ce6){_0x28355f=_0x394ce6;_0x7d15e0[_0xd518('0xc7')]=_[_0xd518('0xc9')](db['WhatsappInteraction']['rawAttributes']);_0x7d15e0[_0xd518('0x3d')]=_[_0xd518('0xc9')](_0x4b37af[_0xd518('0x3d')]);_0x7d15e0[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x7d15e0['model'],_0x7d15e0[_0xd518('0x3d')]);_0x3915a8['attributes']=_['intersection'](_0x7d15e0[_0xd518('0xc7')],qs[_0xd518('0xcc')](_0x4b37af['query']['fields']));_0x3915a8[_0xd518('0x40')]=_0x3915a8[_0xd518('0x40')][_0xd518('0x44')]?_0x3915a8[_0xd518('0x40')]:_0x7d15e0[_0xd518('0xc7')];_0x3915a8[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x4b37af[_0xd518('0x3d')]['sort']);_0x3915a8[_0xd518('0x3c')]=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x4b37af[_0xd518('0x3d')],_0x7d15e0[_0xd518('0xca')]));if(_0x4b37af[_0xd518('0x3d')]['filter']){_0x3915a8[_0xd518('0x3c')]=_['merge'](_0x3915a8[_0xd518('0x3c')],{'$or':_[_0xd518('0x27')](_0x3915a8[_0xd518('0x40')],function(_0x5e2336){var _0x3d2149={};_0x3d2149[_0x5e2336]={'$like':'%'+_0x4b37af[_0xd518('0x3d')][_0xd518('0x25')]+'%'};return _0x3d2149;})});}_0x3915a8=_['merge']({},_0x3915a8,_0x4b37af[_0xd518('0x50')]);return _0x28355f[_0xd518('0xe4')](_0x3915a8);}})[_0xd518('0x1d')](function(_0x1b5f48){if(_0x1b5f48){_0x3fe4f5=_0x1b5f48[_0xd518('0x44')];if(!_0x4b37af['query'][_0xd518('0xbf')](_0xd518('0xd6'))){_0x3915a8[_0xd518('0xd1')]=qs['limit'](_0x4b37af['query']['limit']);_0x3915a8['offset']=qs[_0xd518('0x15')](_0x4b37af[_0xd518('0x3d')]['offset']);}return _0x28355f[_0xd518('0xe4')](_0x3915a8);}})[_0xd518('0x1d')](function(_0x45f299){if(_0x45f299){return _0x45f299?{'count':_0x3fe4f5,'rows':_0x45f299}:null;}})[_0xd518('0x1d')](respondWithResult(_0x59de94,null))[_0xd518('0x4b')](handleError(_0x59de94,null));};exports[_0xd518('0xe5')]=function(_0x887ec,_0x379546,_0x4dcbfa){var _0x53b4c7;var _0x36779d;var _0x115466;var _0x114e9f=!_[_0xd518('0x5e')](_0x887ec[_0xd518('0x54')]['id'])?_0x887ec['params']['id']:!_[_0xd518('0x5e')](_0x887ec[_0xd518('0x21')]['id'])?_0x887ec[_0xd518('0x21')]['id']:null;return db[_0xd518('0x32')][_0xd518('0x2a')]({'where':{'id':_0x114e9f,'role':{'$or':['admin','user',_0xd518('0x1c')]}},'attributes':['id',_0xd518('0x30'),_0xd518('0xe6'),'mobile',_0xd518('0x1b'),_0xd518('0x5d'),'loginInPause']})['then'](function(_0x30820c){if(_0x30820c){if(_0x30820c['role']===_0xd518('0x1c')){_0x53b4c7=_0x30820c;if(_0x887ec[_0xd518('0x53')]['interface']){_0x115466=util['format'](_0xd518('0xe7'),_0x53b4c7[_0x887ec[_0xd518('0x53')][_0xd518('0x94')]]);}else if(_0x887ec['body'][_0xd518('0xe8')]){_0x115466=util[_0xd518('0xa3')](_0xd518('0xa4'),_0x887ec['body'][_0xd518('0xe8')]);}else{_0x115466=util[_0xd518('0xa3')](_0xd518('0xa4'),_0x53b4c7[_0xd518('0x30')]);}socket['to'](util[_0xd518('0xa3')](_0xd518('0xe9'),_0x53b4c7[_0xd518('0x30')]))['emit'](_0xd518('0xea'),{'user':{'id':_0x53b4c7['id'],'name':_0x53b4c7[_0xd518('0x30')]},'ip':_0x887ec[_0xd518('0xeb')][_0xd518('0xec')]||_0x887ec[_0xd518('0xed')]['remoteAddress']||_0x887ec['socket'][_0xd518('0xee')]||_0x887ec[_0xd518('0xed')]['socket'][_0xd518('0xee')]});return db[_0xd518('0xa5')][_0xd518('0x2c')]({'where':{'membername':_0x53b4c7['name']},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0xd518('0xef'));}})[_0xd518('0x1d')](function(){if(_0x53b4c7){return _0x53b4c7[_0xd518('0xf0')]({'raw':!![]});}})['then'](function(_0x42109e){if(_0x53b4c7){if(_0x42109e){_0x36779d=_0x42109e;if(_0x36779d[_0xd518('0x44')]){var _0x33bf99=_0x36779d[_0xd518('0x27')](function(_0x1b458e){var _0x1171a3={'membername':_0x53b4c7[_0xd518('0x30')],'UserId':_0x53b4c7['id'],'queue_name':_0x1b458e[_0xd518('0x30')],'VoiceQueueId':_0x1b458e['id'],'interface':_0x115466,'paused':_0x53b4c7[_0xd518('0x92')]||![],'penalty':_0x1b458e['UserVoiceQueue.penalty']||0x0};return db[_0xd518('0xa5')][_0xd518('0xa6')](_0x1171a3);});return Promise[_0xd518('0x4a')](_0x33bf99);}}}})[_0xd518('0x1d')](function(){if(_0x53b4c7){return db[_0xd518('0xf1')][_0xd518('0x42')]({'where':{'membername':_0x53b4c7['name'],'exitAt':null}});}})[_0xd518('0x1d')](function(_0x54908d){if(_0x53b4c7){var _0x46c421=[];_0x54908d[_0xd518('0xf2')](function(_0x43ed7a){_0x46c421['push'](_0x43ed7a['update']({'exitAt':moment()[_0xd518('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x46c421);}})[_0xd518('0x1d')](function(){if(_0x53b4c7){var _0x6b1333=[];var _0x3d7e31=[];var _0x27ce08=utils[_0xd518('0xf3')]();var _0x28b4aa={'membername':_0x53b4c7[_0xd518('0x30')],'interface':_0x115466,'enterAt':moment()['format'](_0xd518('0xf4')),'role':_0x53b4c7[_0xd518('0x1b')],'internal':_0x53b4c7[_0xd518('0x5d')]};_0x27ce08[_0xd518('0xf2')](function(_0x3b96f7){_0x6b1333[_0xd518('0x41')](_[_0xd518('0xcf')]({'channel':_0x3b96f7,'type':_0xd518('0xf5'),'data1':_0x887ec[_0xd518('0x53')][_0xd518('0xf6')],'data2':_0x115466},_0x28b4aa));if(_0x53b4c7[_0xd518('0x92')]){_0x3d7e31[_0xd518('0x41')](_[_0xd518('0xcf')]({'channel':_0x3b96f7,'type':_0xd518('0xf7'),'data1':_0xd518('0xf8')},_0x28b4aa));}});return db[_0xd518('0xf1')][_0xd518('0x80')](_0x6b1333['concat'](_0x3d7e31),{'individualHooks':!![]});}})[_0xd518('0x1d')](function(){if(_0x53b4c7){return _0x53b4c7[_0xd518('0x1a')]({'online':!![],'lastLoginAt':moment()['format'](_0xd518('0xf4')),'voicePause':_0x53b4c7['loginInPause']||![],'mailPause':_0x53b4c7[_0xd518('0x92')]||![],'chatPause':_0x53b4c7[_0xd518('0x92')]||![],'faxPause':_0x53b4c7[_0xd518('0x92')]||![],'smsPause':_0x53b4c7[_0xd518('0x92')]||![],'openchannelPause':_0x53b4c7[_0xd518('0x92')]||![],'whatsappPause':_0x53b4c7['loginInPause']||![],'pauseType':_0x53b4c7[_0xd518('0x92')]?'LOGININPAUSE':null,'interface':_0x115466,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xd518('0x1d')](function(_0x3ccd04){if(_0x887ec[_0xd518('0xf9')]){return _0x4dcbfa();}else{return Promise[_0xd518('0xfa')](_0x3ccd04)[_0xd518('0x1d')](respondWithResult(_0x379546,null));}})['catch'](handleError(_0x379546,null));};exports[_0xd518('0xfb')]=function(_0x2e3b4b,_0x1dba43){var _0x14e6cb;return db[_0xd518('0x32')][_0xd518('0x2a')]({'where':{'id':_0x2e3b4b[_0xd518('0x54')]['id'],'role':'agent'},'attributes':['id',_0xd518('0x30'),_0xd518('0x1b')]})[_0xd518('0x1d')](handleEntityNotFound(_0x1dba43,null))[_0xd518('0x1d')](function(_0x5c08c0){if(_0x5c08c0){_0x14e6cb=_0x5c08c0;return db['UserVoiceQueueRt'][_0xd518('0x2c')]({'where':{'membername':_0x14e6cb['name']},'individualHooks':!![]});}})[_0xd518('0x1d')](function(){return db[_0xd518('0xf1')][_0xd518('0x42')]({'where':{'membername':_0x14e6cb[_0xd518('0x30')],'exitAt':null}});})[_0xd518('0x1d')](function(_0x43e09b){var _0x46ec91=[];_0x43e09b[_0xd518('0xf2')](function(_0x4a0918){_0x46ec91[_0xd518('0x41')](_0x4a0918[_0xd518('0x1a')]({'exitAt':moment()[_0xd518('0xa3')](_0xd518('0xf4'))}));});return Promise[_0xd518('0x4a')](_0x46ec91);})[_0xd518('0x1d')](function(){return _0x14e6cb[_0xd518('0x1a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x1dba43,null))[_0xd518('0x4b')](handleError(_0x1dba43,null));};exports['pause']=function(_0x35048c,_0x6d8f02){var _0x182be7;return db[_0xd518('0xa5')][_0xd518('0x1a')]({'paused':0x1},{'where':{'UserId':_0x35048c[_0xd518('0x54')]['id']},'individualHooks':!![]})[_0xd518('0x1d')](function(){return db['User'][_0xd518('0x2a')]({'where':{'id':_0x35048c['params']['id'],'role':_0xd518('0x1c')},'attributes':['id',_0xd518('0x30'),_0xd518('0x1b'),_0xd518('0x5d'),'interface',_0xd518('0xa2')]});})[_0xd518('0x1d')](handleEntityNotFound(_0x6d8f02,null))[_0xd518('0x1d')](function(_0x1878fd){if(_0x1878fd){_0x182be7=_0x1878fd;return db[_0xd518('0xf1')][_0xd518('0x42')]({'where':{'membername':_0x182be7[_0xd518('0x30')],'type':_0xd518('0xf7'),'exitAt':null}});}})[_0xd518('0x1d')](function(_0x47cfe7){if(_0x47cfe7[_0xd518('0x44')]){var _0x246cc3=moment()[_0xd518('0xa3')](_0xd518('0xf4'));for(var _0x2728a5=0x0,_0x2191aa=_0x47cfe7[_0xd518('0x44')];_0x2728a5<_0x2191aa;_0x2728a5++){_0x47cfe7[_0x2728a5][_0xd518('0xfc')]({'exitAt':_0x246cc3});}}})['then'](function(){var _0x1acca7=[];var _0x53e691=utils[_0xd518('0xf3')]();_0x53e691[_0xd518('0xf2')](function(_0x59d7c4){_0x1acca7[_0xd518('0x41')]({'channel':_0x59d7c4,'membername':_0x182be7[_0xd518('0x30')],'interface':_[_0xd518('0x5e')](_0x182be7[_0xd518('0x94')])?util[_0xd518('0xa3')](_0xd518('0xa4'),_0x182be7[_0xd518('0x30')]):_0x182be7[_0xd518('0x94')],'type':'PAUSE','enterAt':moment()[_0xd518('0xa3')](_0xd518('0xf4')),'data1':_0x35048c[_0xd518('0x53')][_0xd518('0xfd')]||'DEFAULT\x20PAUSE','role':_0x182be7[_0xd518('0x1b')],'internal':_0x182be7['internal']});});return db[_0xd518('0xf1')][_0xd518('0x80')](_0x1acca7,{'individualHooks':!![]});})[_0xd518('0x1d')](function(){return _0x182be7[_0xd518('0x1a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x35048c[_0xd518('0x53')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xd518('0xa3')](_0xd518('0xf4'))});})[_0xd518('0x1d')](respondWithResult(_0x6d8f02,null))[_0xd518('0x4b')](handleError(_0x6d8f02,null));};exports[_0xd518('0xfe')]=function(_0x439cfe,_0x1f02f8){if(_0x439cfe[_0xd518('0x53')][_0xd518('0x91')]&&!utils['isValidChannel'](_0x439cfe[_0xd518('0x53')][_0xd518('0x91')])){throw new APIBadRequestError(util[_0xd518('0xa3')](_0xd518('0xff'),_0x439cfe[_0xd518('0x53')][_0xd518('0x91')]));}return db['User'][_0xd518('0x2a')]({'where':{'id':_0x439cfe[_0xd518('0x54')]['id']},'attributes':['id',_0xd518('0x30'),_0xd518('0x1b'),_0xd518('0x5d'),_0xd518('0x94'),'online','voicePause',_0xd518('0x100'),_0xd518('0x101'),'faxPause',_0xd518('0x102'),'smsPause',_0xd518('0x103'),_0xd518('0x104'),'lastPauseAt']})[_0xd518('0x1d')](function(_0x34444c){if(!_0x34444c){throw new APINotFoundError(util[_0xd518('0xa3')](_0xd518('0x105'),_0x439cfe[_0xd518('0x54')]['id']));}return _0x34444c['unpause'](_0x439cfe[_0xd518('0x53')]['channel']);})[_0xd518('0x1d')](respondWithResult(_0x1f02f8,null))[_0xd518('0x4b')](APIHandleError(_0x1f02f8));};exports['getTeams']=function(_0x393196,_0x57f8b5){var _0x9038ad={};var _0x425ba8={};var _0x1c4ad8;var _0x24ee31;return db[_0xd518('0x32')]['findOne']({'where':{'id':_0x393196[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x57f8b5,null))['then'](function(_0x673b17){if(_0x673b17){_0x1c4ad8=_0x673b17;_0x425ba8[_0xd518('0xc7')]=_[_0xd518('0xc9')](db[_0xd518('0x106')][_0xd518('0x33')]);_0x425ba8[_0xd518('0x3d')]=_['keys'](_0x393196[_0xd518('0x3d')]);_0x425ba8[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x425ba8[_0xd518('0xc7')],_0x425ba8[_0xd518('0x3d')]);_0x9038ad[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x425ba8['model'],qs[_0xd518('0xcc')](_0x393196['query'][_0xd518('0xcc')]));_0x9038ad[_0xd518('0x40')]=_0x9038ad[_0xd518('0x40')][_0xd518('0x44')]?_0x9038ad[_0xd518('0x40')]:_0x425ba8[_0xd518('0xc7')];_0x9038ad['order']=qs[_0xd518('0xcd')](_0x393196[_0xd518('0x3d')][_0xd518('0xcd')]);_0x9038ad['where']=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x393196['query'],_0x425ba8[_0xd518('0xca')]));if(_0x393196[_0xd518('0x3d')][_0xd518('0x25')]){_0x9038ad[_0xd518('0x3c')]=_[_0xd518('0xcf')](_0x9038ad[_0xd518('0x3c')],{'$or':_['map'](_0x9038ad[_0xd518('0x40')],function(_0x186bda){var _0x8b40b8={};_0x8b40b8[_0x186bda]={'$like':'%'+_0x393196[_0xd518('0x3d')][_0xd518('0x25')]+'%'};return _0x8b40b8;})});}_0x9038ad=_[_0xd518('0xcf')]({},_0x9038ad,_0x393196[_0xd518('0x50')]);return _0x1c4ad8[_0xd518('0x107')](_0x9038ad);}})['then'](function(_0x3589b6){if(_0x3589b6){_0x24ee31=_0x3589b6[_0xd518('0x44')];if(!_0x393196[_0xd518('0x3d')][_0xd518('0xbf')]('nolimit')){_0x9038ad[_0xd518('0xd1')]=qs[_0xd518('0xd1')](_0x393196[_0xd518('0x3d')][_0xd518('0xd1')]);_0x9038ad[_0xd518('0x15')]=qs[_0xd518('0x15')](_0x393196[_0xd518('0x3d')]['offset']);}return _0x1c4ad8[_0xd518('0x107')](_0x9038ad);}})[_0xd518('0x1d')](function(_0x5ccf79){if(_0x5ccf79){return _0x5ccf79?{'count':_0x24ee31,'rows':_0x5ccf79}:null;}})[_0xd518('0x1d')](respondWithResult(_0x57f8b5,null))[_0xd518('0x4b')](handleError(_0x57f8b5,null));};exports[_0xd518('0x108')]=function(_0x230df8,_0x1b0b4b){var _0xa60618=_0x230df8['params']['id'];var _0x42f672=_0x230df8[_0xd518('0x53')]?_0x230df8[_0xd518('0x53')][_0xd518('0x57')]:null;var _0x29c722=[];return Promise[_0xd518('0xfa')]()[_0xd518('0x1d')](function(){if(!_0x42f672)throw new APIBadRequestError(_0xd518('0x109'));})[_0xd518('0x1d')](function(){return db[_0xd518('0x32')]['findOne']({'where':{'id':_0xa60618}});})[_0xd518('0x1d')](function(_0xcbf9e4){if(!_0xcbf9e4)throw new APINotFoundError(util[_0xd518('0xa3')](_0xd518('0x105'),_0x230df8['params']['id']));return db[_0xd518('0x60')][_0xd518('0x10a')](function(_0x4f7974){return _0xcbf9e4[_0xd518('0x108')](_0x42f672,{'transaction':_0x4f7974})[_0xd518('0x1d')](function(){return db[_0xd518('0x106')]['findAll']({'where':{'id':{'$in':_0x42f672}}});})[_0xd518('0x1d')](function(_0x2d196c){var _0x3eee15=_[_0xd518('0x27')](_0x2d196c,function(_0x1e1de4){return _0x1e1de4[_0xd518('0x10b')]();});return Promise[_0xd518('0x4a')](_0x3eee15);})['then'](function(_0x395b33){_0x29c722=_['flattenDeep'](_0x395b33);var _0x21596b=_[_0xd518('0x27')](_0x29c722,function(_0x5e88b9){return _0x5e88b9[_0xd518('0x10c')](_0xcbf9e4['id'],{'transaction':_0x4f7974});});return Promise[_0xd518('0x4a')](_0x21596b);})[_0xd518('0x1d')](function(){if(!_0xcbf9e4[_0xd518('0xa2')])return;var _0x11d69b=_['filter'](_0x29c722,function(_0xf633b1){return _0xf633b1[_0xd518('0x10d')](_0xd518('0x91'))===_0xd518('0x10e');});var _0x3968a9=_[_0xd518('0x27')](_0x11d69b,function(_0x35843e){return db[_0xd518('0xa5')]['upsert']({'membername':_0xcbf9e4['name'],'UserId':_0xcbf9e4['id'],'queue_name':_0x35843e[_0xd518('0x30')],'VoiceQueueId':_0x35843e['id'],'interface':_[_0xd518('0x5e')](_0xcbf9e4['interface'])?util[_0xd518('0xa3')]('SIP/%s',_0xcbf9e4[_0xd518('0x30')]):_0xcbf9e4['interface'],'paused':_0xcbf9e4[_0xd518('0x93')]||![],'penalty':_0xcbf9e4[_0xd518('0x9b')]},{'transaction':_0x4f7974});});return Promise[_0xd518('0x4a')](_0x3968a9);})[_0xd518('0x1d')](function(){return db[_0xd518('0x10f')][_0xd518('0x42')]({'where':{'teamId':{'$in':_0x42f672}}});})[_0xd518('0x1d')](function(_0x3b5e5b){var _0x1e565a=_[_0xd518('0x27')](_0x3b5e5b,function(_0x516eda){return db['UserVoicePrefix']['create']({'UserId':_0xcbf9e4['id'],'VoicePrefixId':_0x516eda[_0xd518('0x110')]},{'transaction':_0x4f7974});});return Promise[_0xd518('0x4a')](_0x1e565a);});});})['then'](function(){for(var _0x443ec1=0x0;_0x443ec1<_0x29c722[_0xd518('0x44')];_0x443ec1++){var _0x501dec=_0x29c722[_0x443ec1][_0xd518('0x10d')]('channel');var _0x540723=_0x501dec+'QueueId';socket[_0xd518('0x9e')](_0xd518('0x21')+_0x501dec+'Queue:save',{'UserId':_0xa60618,['queueField']:_0x29c722[_0x443ec1]['id']});}})[_0xd518('0x1d')](respondWithStatusCode(_0x1b0b4b,null))['catch'](APIHandleError(_0x1b0b4b));};exports[_0xd518('0x111')]=function(_0x1e837f,_0x6e5028){var _0xa96b44=_0x1e837f['params']['id'];var _0x1b94d8=null;if(_0x1e837f[_0xd518('0x3d')][_0xd518('0x57')]){_0x1b94d8=_[_0xd518('0xa8')](_0x1e837f[_0xd518('0x3d')][_0xd518('0x57')])?_0x1e837f[_0xd518('0x3d')]['ids']:[_0x1e837f[_0xd518('0x3d')][_0xd518('0x57')]];}var _0x579975=[];return Promise['resolve']()[_0xd518('0x1d')](function(){if(!_0x1b94d8)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xd518('0x1d')](function(){return db[_0xd518('0x32')][_0xd518('0xbe')]({'where':{'id':_0xa96b44}});})[_0xd518('0x1d')](function(_0xb70656){if(!_0xb70656)throw new APINotFoundError(util[_0xd518('0xa3')](_0xd518('0x105'),_0x1e837f['params']['id']));return db[_0xd518('0x60')][_0xd518('0x10a')](function(_0x470cb8){return _0xb70656['removeTeams'](_0x1b94d8,{'transaction':_0x470cb8})[_0xd518('0x1d')](function(){return db[_0xd518('0x106')][_0xd518('0x42')]({'where':{'id':{'$in':_0x1b94d8}}});})[_0xd518('0x1d')](function(_0x34fee5){var _0x24a60d=_[_0xd518('0x27')](_0x34fee5,function(_0x424fff){return _0x424fff[_0xd518('0x10b')]();});return Promise[_0xd518('0x4a')](_0x24a60d);})['then'](function(_0x19fccb){_0x579975=_[_0xd518('0x112')](_0x19fccb);var _0xba3614=_[_0xd518('0x27')](_0x579975,function(_0x2009f9){return _0x2009f9[_0xd518('0x113')](_0xb70656['id'],{'transaction':_0x470cb8});});return Promise[_0xd518('0x4a')](_0xba3614);})[_0xd518('0x1d')](function(){if(!_0xb70656['online'])return;var _0x464687=_[_0xd518('0x25')](_0x579975,function(_0x1b524e){return _0x1b524e[_0xd518('0x10d')](_0xd518('0x91'))===_0xd518('0x10e');});var _0xc65a9d=_[_0xd518('0x27')](_0x464687,function(_0x459829){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x459829['id'],'UserId':_0xb70656['id']},'transaction':_0x470cb8});});return Promise['all'](_0xc65a9d);})['then'](function(){return db[_0xd518('0x10f')][_0xd518('0x42')]({'where':{'teamId':{'$in':_0x1b94d8}}});})[_0xd518('0x1d')](function(_0x12de1a){var _0x3b51a3=_['map'](_0x12de1a,function(_0xb6b7d6){return db[_0xd518('0x114')][_0xd518('0x2c')]({'where':{'UserId':_0xb70656['id'],'VoicePrefixId':_0xb6b7d6[_0xd518('0x110')]}},{'transaction':_0x470cb8});});return Promise[_0xd518('0x4a')](_0x3b51a3);});});})[_0xd518('0x1d')](function(){for(var _0x3fd5ea=0x0;_0x3fd5ea<_0x579975[_0xd518('0x44')];_0x3fd5ea++){var _0x3bbda1=_0x579975[_0x3fd5ea]['getDataValue'](_0xd518('0x91'));var _0xe3b26b=_0x3bbda1+_0xd518('0x9d');socket[_0xd518('0x9e')]('user'+_0x3bbda1+_0xd518('0xa9'),{'UserId':_0xa96b44,['queueField']:_0x579975[_0x3fd5ea]['id']});}})[_0xd518('0x1d')](respondWithStatusCode(_0x6e5028,null))['catch'](APIHandleError(_0x6e5028));};exports[_0xd518('0x115')]=function(_0x158ed1,_0x472b8f){var _0x6b00d7={};var _0x2b4717={};var _0x3b7007;var _0x3f623d;return db['User'][_0xd518('0xbe')]({'where':{'id':_0x158ed1[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0x472b8f,null))[_0xd518('0x1d')](function(_0x123527){if(_0x123527){_0x3b7007=_0x123527;_0x2b4717[_0xd518('0xc7')]=_['keys'](db['CmList'][_0xd518('0x33')]);_0x2b4717[_0xd518('0x3d')]=_['keys'](_0x158ed1[_0xd518('0x3d')]);_0x2b4717[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x2b4717[_0xd518('0xc7')],_0x2b4717[_0xd518('0x3d')]);_0x6b00d7[_0xd518('0x40')]=_[_0xd518('0xcb')](_0x2b4717[_0xd518('0xc7')],qs[_0xd518('0xcc')](_0x158ed1[_0xd518('0x3d')][_0xd518('0xcc')]));_0x6b00d7[_0xd518('0x40')]=_0x6b00d7[_0xd518('0x40')][_0xd518('0x44')]?_0x6b00d7[_0xd518('0x40')]:_0x2b4717[_0xd518('0xc7')];_0x6b00d7[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x158ed1['query'][_0xd518('0xcd')]);_0x6b00d7[_0xd518('0x3c')]=qs['filters'](_[_0xd518('0xce')](_0x158ed1[_0xd518('0x3d')],_0x2b4717[_0xd518('0xca')]));if(_0x158ed1[_0xd518('0x3d')][_0xd518('0x25')]){_0x6b00d7['where']=_[_0xd518('0xcf')](_0x6b00d7[_0xd518('0x3c')],{'$or':_[_0xd518('0x27')](_0x6b00d7[_0xd518('0x40')],function(_0x120557){var _0x193afd={};_0x193afd[_0x120557]={'$like':'%'+_0x158ed1['query']['filter']+'%'};return _0x193afd;})});}_0x6b00d7=_['merge']({},_0x6b00d7,_0x158ed1[_0xd518('0x50')]);return _0x3b7007[_0xd518('0x115')](_0x6b00d7);}})[_0xd518('0x1d')](function(_0x489214){if(_0x489214){_0x3f623d=_0x489214[_0xd518('0x44')];if(!_0x158ed1[_0xd518('0x3d')][_0xd518('0xbf')](_0xd518('0xd6'))){_0x6b00d7['limit']=qs[_0xd518('0xd1')](_0x158ed1[_0xd518('0x3d')]['limit']);_0x6b00d7[_0xd518('0x15')]=qs[_0xd518('0x15')](_0x158ed1[_0xd518('0x3d')][_0xd518('0x15')]);}return _0x3b7007[_0xd518('0x115')](_0x6b00d7);}})['then'](function(_0x5902d0){if(_0x5902d0){return _0x5902d0?{'count':_0x3f623d,'rows':_0x5902d0}:null;}})[_0xd518('0x1d')](respondWithResult(_0x472b8f,null))[_0xd518('0x4b')](handleError(_0x472b8f,null));};exports[_0xd518('0x116')]=function(_0x43d16c,_0xd35a89){var _0x2d9103={};var _0x4cf932={};var _0x32ae4a;return db['User'][_0xd518('0xbe')]({'where':{'id':_0x43d16c[_0xd518('0x54')]['id']}})[_0xd518('0x1d')](handleEntityNotFound(_0xd35a89,null))[_0xd518('0x1d')](function(_0x4a5e6f){if(_0x4a5e6f){_0x32ae4a=_0x4a5e6f;_0x4cf932[_0xd518('0xc7')]=_[_0xd518('0xc9')](db[_0xd518('0x32')][_0xd518('0x33')]);_0x4cf932['query']=_['keys'](_0x43d16c['query']);_0x4cf932[_0xd518('0xca')]=_[_0xd518('0xcb')](_0x4cf932['model'],_0x4cf932['query']);_0x2d9103['attributes']=_[_0xd518('0xcb')](_0x4cf932['model'],qs[_0xd518('0xcc')](_0x43d16c[_0xd518('0x3d')]['fields']));_0x2d9103['attributes']=_0x2d9103[_0xd518('0x40')][_0xd518('0x44')]?_0x2d9103[_0xd518('0x40')]:_0x4cf932[_0xd518('0xc7')];_0x2d9103[_0xd518('0xd3')]=qs[_0xd518('0xcd')](_0x43d16c[_0xd518('0x3d')][_0xd518('0xcd')]);_0x2d9103[_0xd518('0x3c')]=qs[_0xd518('0xca')](_[_0xd518('0xce')](_0x43d16c[_0xd518('0x3d')],_0x4cf932[_0xd518('0xca')]));if(_0x43d16c[_0xd518('0x3d')][_0xd518('0x25')]){_0x2d9103[_0xd518('0x3c')]=_['merge'](_0x2d9103[_0xd518('0x3c')],{'$or':_[_0xd518('0x27')](_0x2d9103['attributes'],function(_0x511dc5){var _0x2bdc7f={};_0x2bdc7f[_0x511dc5]={'$like':'%'+_0x43d16c['query'][_0xd518('0x25')]+'%'};return _0x2bdc7f;})});}_0x2d9103['model']=db[_0xd518('0x32')];_0x2d9103['as']='Agents';_0x2d9103=_['merge']({},_0x2d9103,_0x43d16c[_0xd518('0x50')]);return _0x32ae4a[_0xd518('0xf0')]({'include':[_0x2d9103]});}})[_0xd518('0x1d')](function(_0x570e6a){if(_0x570e6a){var _0x49cfc4={},_0x5e6eef=[];for(var _0x8a3b8e=0x0;_0x8a3b8e<_0x570e6a['length'];_0x8a3b8e+=0x1){for(var _0x528065=0x0,_0x438adc;_0x528065<_0x570e6a[_0x8a3b8e][_0xd518('0x22')][_0xd518('0x44')];_0x528065+=0x1){_0x438adc=_0x570e6a[_0x8a3b8e]['Agents'][_0x528065][_0xd518('0x1e')]({'plain':!![]});_0x49cfc4[_0x438adc['id']]=_0x438adc;}}_0x49cfc4=_[_0xd518('0x117')](_0x49cfc4);for(var _0x3142c2=qs['offset'](_0x43d16c['query'][_0xd518('0x15')]);_0x3142c2<_0x49cfc4[_0xd518('0x44')]&&_0x5e6eef[_0xd518('0x44')]=_0x35fcf6[_0x1b07('0x4f')]){throw new Error(_0x1b07('0x50'));}})[_0x1b07('0x1d')](function(){if(_0x303431){return db[_0x1b07('0x26')][_0x1b07('0x46')]({'where':{'membername':_0x303431[_0x1b07('0x20')]},'individualHooks':!![]});}})[_0x1b07('0x1d')](function(){if(_0x303431){return _0x303431[_0x1b07('0x51')]({'raw':!![]});}})[_0x1b07('0x1d')](function(_0x476b96){if(_0x303431){if(_0x476b96){var _0x3cf673=[];_0x5f05a1=_0x476b96;if(_0x5f05a1[_0x1b07('0x2a')]){for(var _0x180b09=0x0;_0x180b09<_0x5f05a1[_0x1b07('0x2a')];_0x180b09++){_0x3cf673[_0x1b07('0x2e')](db[_0x1b07('0x26')][_0x1b07('0x52')]({'membername':_0x303431['name'],'UserId':_0x303431['id'],'queue_name':_0x5f05a1[_0x180b09][_0x1b07('0x20')],'VoiceQueueId':_0x5f05a1[_0x180b09]['id'],'interface':_0x24747c,'paused':_0x303431[_0x1b07('0x4c')]||![],'penalty':_0x5f05a1[_0x180b09][_0x1b07('0x53')]||0x0}));}return BPromise[_0x1b07('0x48')](_0x3cf673);}}}})[_0x1b07('0x1d')](function(){if(_0x303431){return db['MemberReport'][_0x1b07('0xd')]({'where':{'membername':_0x303431['name'],'exitAt':null}});}})[_0x1b07('0x1d')](function(_0x5baea9){if(_0x303431){if(_0x5baea9&&_0x5baea9[_0x1b07('0x2a')]){var _0x3b379e=[];_0x5baea9[_0x1b07('0x47')](function(_0x422156){_0x3b379e[_0x1b07('0x2e')](_0x422156[_0x1b07('0x27')]({'exitAt':moment()['format'](_0x1b07('0x30'))}));});return BPromise[_0x1b07('0x48')](_0x3b379e);}}})[_0x1b07('0x1d')](function(){if(_0x303431){var _0x37b447=[];var _0x2a0c81=[];var _0x3adde3=utils[_0x1b07('0x2d')]();var _0x410b22={'membername':_0x303431[_0x1b07('0x20')],'interface':_0x24747c,'enterAt':moment()[_0x1b07('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x303431[_0x1b07('0x21')],'internal':_0x303431[_0x1b07('0x22')]};_0x3adde3[_0x1b07('0x47')](function(_0x1ed14f){_0x37b447[_0x1b07('0x2e')](_[_0x1b07('0x54')]({'channel':_0x1ed14f,'type':_0x1b07('0x55'),'data1':_0x1b07('0x56'),'data2':_0x24747c},_0x410b22));if(_0x303431[_0x1b07('0x4c')]){_0x2a0c81[_0x1b07('0x2e')](_[_0x1b07('0x54')]({'channel':_0x1ed14f,'type':'PAUSE','data1':_0x1b07('0x57')},_0x410b22));}});return db['MemberReport']['bulkCreate'](_0x37b447[_0x1b07('0x58')](_0x2a0c81),{'individualHooks':!![]});}})[_0x1b07('0x1d')](function(){if(_0x303431){return _0x303431[_0x1b07('0x27')]({'online':!![],'lastLoginAt':moment()[_0x1b07('0x2b')](_0x1b07('0x30')),'voicePause':_0x303431['loginInPause']||![],'mailPause':_0x303431['loginInPause']||![],'chatPause':_0x303431[_0x1b07('0x4c')]||![],'faxPause':_0x303431[_0x1b07('0x4c')]||![],'smsPause':_0x303431[_0x1b07('0x4c')]||![],'openchannelPause':_0x303431[_0x1b07('0x4c')]||![],'pauseType':_0x303431[_0x1b07('0x4c')]?_0x1b07('0x57'):null,'lastPauseAt':moment()[_0x1b07('0x2b')](_0x1b07('0x30')),'interface':_0x24747c});}})['then'](function(_0x116872){_0x58779e(_0x116872);})[_0x1b07('0x1e')](function(_0x4cb5fb){_0x5d8543(_0x5dab95[_0x1b07('0x18')](0x1f4,_0x4cb5fb[_0x1b07('0x19')]));});});}; \ No newline at end of file +var _0x145d=['chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','system','LogoutUser','forEach','push','all','LoginUser','loginInPause','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueueRt','destroy','getVoiceQueues','LOGIN','merge','LOGININPAUSE','bulkCreate','concat','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','User','options','raw','where','attributes','limit','include','model','map','then','info','GetUser','debug','stringify','catch','error','message','ShowUser','find','PauseUser','name','role','internal','format','User\x20with\x20id\x20%s\x20not\x20found','params','update','MemberReport','findAll','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','isNil','SIP/%s','interface','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','mailPause'];(function(_0x12e4ea,_0x5aaf55){var _0x5178f6=function(_0x591913){while(--_0x591913){_0x12e4ea['push'](_0x12e4ea['shift']());}};_0x5178f6(++_0x5aaf55);}(_0x145d,0x173));var _0xd145=function(_0x42415e,_0x1e66df){_0x42415e=_0x42415e-0x0;var _0x50991a=_0x145d[_0x42415e];return _0x50991a;};'use strict';var _=require('lodash');var util=require(_0xd145('0x0'));var moment=require(_0xd145('0x1'));var BPromise=require('bluebird');var Redis=require(_0xd145('0x2'));var db=require(_0xd145('0x3'))['db'];var utils=require(_0xd145('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd145('0x5'));config[_0xd145('0x6')]=_[_0xd145('0x7')](config[_0xd145('0x6')],{'host':_0xd145('0x8'),'port':0x18eb});var socket=require(_0xd145('0x9'))(new Redis(config[_0xd145('0x6')]));require(_0xd145('0xa'))[_0xd145('0xb')](socket);exports['GetUser']=function(_0x293a05){var _0x262146=this;return new Promise(function(_0x40702a,_0x494e11){return db[_0xd145('0xc')]['findAll']({'raw':_0x293a05['options']?_0x293a05[_0xd145('0xd')][_0xd145('0xe')]===undefined?!![]:![]:!![],'where':_0x293a05[_0xd145('0xd')]?_0x293a05['options'][_0xd145('0xf')]||null:null,'attributes':_0x293a05[_0xd145('0xd')]?_0x293a05[_0xd145('0xd')][_0xd145('0x10')]||null:null,'limit':_0x293a05[_0xd145('0xd')]?_0x293a05[_0xd145('0xd')][_0xd145('0x11')]||null:null,'include':_0x293a05[_0xd145('0xd')]?_0x293a05['options'][_0xd145('0x12')]?_['map'](_0x293a05[_0xd145('0xd')][_0xd145('0x12')],function(_0x2809d6){return{'model':db[_0x2809d6[_0xd145('0x13')]],'as':_0x2809d6['as'],'attributes':_0x2809d6[_0xd145('0x10')],'include':_0x2809d6['include']?_[_0xd145('0x14')](_0x2809d6[_0xd145('0x12')],function(_0x420e6a){return{'model':db[_0x420e6a[_0xd145('0x13')]],'as':_0x420e6a['as'],'attributes':_0x420e6a['attributes'],'include':_0x420e6a[_0xd145('0x12')]?_[_0xd145('0x14')](_0x420e6a['include'],function(_0x48ee75){return{'model':db[_0x48ee75[_0xd145('0x13')]],'as':_0x48ee75['as'],'attributes':_0x48ee75[_0xd145('0x10')]};}):[]};}):[]};}):[]:[]})[_0xd145('0x15')](function(_0x26c46f){logger[_0xd145('0x16')](_0xd145('0x17'),_0x293a05);logger[_0xd145('0x18')]('GetUser',_0x293a05,JSON[_0xd145('0x19')](_0x26c46f));_0x40702a(_0x26c46f);})[_0xd145('0x1a')](function(_0x2dca3c){logger[_0xd145('0x1b')](_0xd145('0x17'),_0x2dca3c[_0xd145('0x1c')],_0x293a05);_0x494e11(_0x262146['error'](0x1f4,_0x2dca3c[_0xd145('0x1c')]));});});};exports[_0xd145('0x1d')]=function(_0x17a535){var _0x7191c5=this;return new Promise(function(_0x86ac3b,_0x125ad8){return db[_0xd145('0xc')][_0xd145('0x1e')]({'raw':_0x17a535[_0xd145('0xd')]?_0x17a535[_0xd145('0xd')][_0xd145('0xe')]===undefined?!![]:![]:!![],'where':_0x17a535[_0xd145('0xd')]?_0x17a535[_0xd145('0xd')][_0xd145('0xf')]||null:null,'attributes':_0x17a535[_0xd145('0xd')]?_0x17a535[_0xd145('0xd')][_0xd145('0x10')]||null:null,'include':_0x17a535[_0xd145('0xd')]?_0x17a535[_0xd145('0xd')]['include']?_[_0xd145('0x14')](_0x17a535['options'][_0xd145('0x12')],function(_0x4a1ccf){return{'model':db[_0x4a1ccf[_0xd145('0x13')]],'as':_0x4a1ccf['as'],'attributes':_0x4a1ccf['attributes'],'include':_0x4a1ccf[_0xd145('0x12')]?_['map'](_0x4a1ccf[_0xd145('0x12')],function(_0x2b7ad5){return{'model':db[_0x2b7ad5['model']],'as':_0x2b7ad5['as'],'attributes':_0x2b7ad5[_0xd145('0x10')],'include':_0x2b7ad5[_0xd145('0x12')]?_['map'](_0x2b7ad5[_0xd145('0x12')],function(_0xa53c90){return{'model':db[_0xa53c90['model']],'as':_0xa53c90['as'],'attributes':_0xa53c90[_0xd145('0x10')]};}):[]};}):[]};}):[]:[]})[_0xd145('0x15')](function(_0x38b88c){logger[_0xd145('0x16')](_0xd145('0x1d'),_0x17a535);logger['debug'](_0xd145('0x1d'),_0x17a535,JSON[_0xd145('0x19')](_0x38b88c));_0x86ac3b(_0x38b88c);})[_0xd145('0x1a')](function(_0x22f3b6){logger[_0xd145('0x1b')](_0xd145('0x1d'),_0x22f3b6[_0xd145('0x1c')],_0x17a535);_0x125ad8(_0x7191c5[_0xd145('0x1b')](0x1f4,_0x22f3b6[_0xd145('0x1c')]));});});};exports[_0xd145('0x1f')]=function(_0x4ac546){var _0xb03c42;return db[_0xd145('0xc')]['find']({'where':_0x4ac546[_0xd145('0xd')][_0xd145('0xf')]||{},'attributes':['id',_0xd145('0x20'),_0xd145('0x21'),_0xd145('0x22'),'interface']})[_0xd145('0x15')](function(_0x2c21c1){if(!_0x2c21c1){throw new Error(util[_0xd145('0x23')](_0xd145('0x24'),_0x4ac546[_0xd145('0x25')]['id']));}_0xb03c42=_0x2c21c1;return db['UserVoiceQueueRt'][_0xd145('0x26')]({'paused':0x1},{'where':{'UserId':_0xb03c42['id']},'individualHooks':!![]});})[_0xd145('0x15')](function(){return db[_0xd145('0x27')][_0xd145('0x28')]({'where':{'membername':_0xb03c42['name'],'type':_0xd145('0x29'),'exitAt':null}});})['then'](function(_0x36c079){if(_0x36c079&&_0x36c079[_0xd145('0x2a')]){var _0x46a549=moment()[_0xd145('0x23')](_0xd145('0x2b'));for(var _0x1a0c0d=0x0,_0x596c61=_0x36c079[_0xd145('0x2a')];_0x1a0c0d<_0x596c61;_0x1a0c0d++){_0x36c079[_0x1a0c0d][_0xd145('0x2c')]({'exitAt':_0x46a549});}}})[_0xd145('0x15')](function(){var _0x4ccf79=[];var _0x3f8bc4=utils['getChannels']();_0x3f8bc4['forEach'](function(_0x169566){_0x4ccf79['push']({'channel':_0x169566,'membername':_0xb03c42[_0xd145('0x20')],'interface':_[_0xd145('0x2d')](_0xb03c42['interface'])?util[_0xd145('0x23')](_0xd145('0x2e'),_0xb03c42[_0xd145('0x20')]):_0xb03c42[_0xd145('0x2f')],'type':_0xd145('0x29'),'enterAt':moment()[_0xd145('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4ac546[_0xd145('0x30')][_0xd145('0x31')]||_0xd145('0x32'),'role':_0xb03c42[_0xd145('0x21')],'internal':_0xb03c42[_0xd145('0x22')],'uniqueid':_0x4ac546[_0xd145('0x30')][_0xd145('0x33')]||null});});return db['MemberReport']['bulkCreate'](_0x4ccf79,{'individualHooks':!![]});})[_0xd145('0x15')](function(){return _0xb03c42[_0xd145('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4ac546['body']['type']||_0xd145('0x32'),'lastPauseAt':moment()[_0xd145('0x23')](_0xd145('0x2b'))});})[_0xd145('0x1a')](function(_0x543ae9){throw _0x543ae9;});};exports[_0xd145('0x34')]=function(_0x1a8438){return Promise[_0xd145('0x35')]()[_0xd145('0x15')](function(){if(_0x1a8438[_0xd145('0x30')][_0xd145('0x36')]&&!utils['isValidChannel'](_0x1a8438['body']['channel'])){throw new Error(util[_0xd145('0x23')](_0xd145('0x37'),_0x1a8438[_0xd145('0x30')]['channel']));}return db[_0xd145('0xc')][_0xd145('0x38')]({'where':_0x1a8438['options']['where']||{},'attributes':['id',_0xd145('0x20'),_0xd145('0x21'),_0xd145('0x22'),_0xd145('0x2f'),_0xd145('0x39'),'voicePause',_0xd145('0x3a'),_0xd145('0x3b'),_0xd145('0x3c'),_0xd145('0x3d'),_0xd145('0x3e'),_0xd145('0x3f'),_0xd145('0x40'),_0xd145('0x41')]});})[_0xd145('0x15')](function(_0x218af9){if(!_0x218af9){throw new Error(util['format'](_0xd145('0x24'),_0x1a8438[_0xd145('0x25')]['id']));}return _0x218af9[_0xd145('0x42')](_0x1a8438['body'][_0xd145('0x36')],_0xd145('0x43'));})['catch'](function(_0x33b3f8){throw _0x33b3f8;});};exports[_0xd145('0x44')]=function(_0x959068){var _0x4ea380=this;return new Promise(function(_0x5cac7e,_0x495c5c){var _0x13ea07;return db[_0xd145('0xc')]['findOne']({'where':_0x959068[_0xd145('0xd')][_0xd145('0xf')]||{},'attributes':['id',_0xd145('0x20')]})[_0xd145('0x15')](function(_0x5b8577){if(_0x5b8577){_0x13ea07=_0x5b8577;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x13ea07[_0xd145('0x20')]},'individualHooks':!![]});}})[_0xd145('0x15')](function(){if(_0x13ea07){return db['MemberReport'][_0xd145('0x28')]({'where':{'membername':_0x13ea07[_0xd145('0x20')],'exitAt':null}});}})[_0xd145('0x15')](function(_0x49372c){if(_0x13ea07){if(_0x49372c&&_0x49372c[_0xd145('0x2a')]){var _0xa69fe6=[];_0x49372c[_0xd145('0x45')](function(_0x5a6b67){_0xa69fe6[_0xd145('0x46')](_0x5a6b67[_0xd145('0x26')]({'exitAt':moment()[_0xd145('0x23')](_0xd145('0x2b'))}));});return BPromise[_0xd145('0x47')](_0xa69fe6);}}})['then'](function(){if(_0x13ea07){return _0x13ea07[_0xd145('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd145('0x15')](function(_0x8906bb){_0x5cac7e(_0x8906bb);})[_0xd145('0x1a')](function(_0x277366){_0x495c5c(_0x4ea380[_0xd145('0x1b')](0x1f4,_0x277366[_0xd145('0x1c')]));});});};exports[_0xd145('0x48')]=function(_0x5a6d73){var _0x46f637=this;return new Promise(function(_0x47bf5e,_0x23f430){var _0xcd6a2d;var _0x2cd40a;var _0xc9c6f;var _0x42ee0f;return db[_0xd145('0xc')][_0xd145('0x38')]({'where':_0x5a6d73[_0xd145('0xd')]['where']||{},'attributes':['id',_0xd145('0x20'),'role','mobile','phone',_0xd145('0x22'),_0xd145('0x49'),'interface']})['then'](function(_0x512f75){if(_0x512f75){_0xcd6a2d=_0x512f75;_0x42ee0f=_0x5a6d73['body']['interface']?_0x5a6d73[_0xd145('0x30')][_0xd145('0x2f')]:util[_0xd145('0x23')](_0xd145('0x2e'),_0xcd6a2d[_0xd145('0x20')]);return db[_0xd145('0xc')]['count']({'where':{'role':_0xd145('0x4a'),'online':!![],'id':{'$ne':_0xcd6a2d['id']}}});}})['then'](function(_0x351d9e){if(_0x351d9e){_0xc9c6f=_0x351d9e;return require(_0xd145('0x4b'))['getLicense']();}})[_0xd145('0x15')](function(_0x122856){if(_0x122856&&_0x122856[_0xd145('0x4c')]&&_0xc9c6f>=_0x122856[_0xd145('0x4c')]){throw new Error(_0xd145('0x4d'));}})[_0xd145('0x15')](function(){if(_0xcd6a2d){return db[_0xd145('0x4e')][_0xd145('0x4f')]({'where':{'membername':_0xcd6a2d[_0xd145('0x20')]},'individualHooks':!![]});}})[_0xd145('0x15')](function(){if(_0xcd6a2d){return _0xcd6a2d[_0xd145('0x50')]({'raw':!![]});}})[_0xd145('0x15')](function(_0x76ce0d){if(_0xcd6a2d){if(_0x76ce0d){var _0x14d4ca=[];_0x2cd40a=_0x76ce0d;if(_0x2cd40a[_0xd145('0x2a')]){for(var _0xa3b7fd=0x0;_0xa3b7fd<_0x2cd40a[_0xd145('0x2a')];_0xa3b7fd++){_0x14d4ca[_0xd145('0x46')](db[_0xd145('0x4e')]['upsert']({'membername':_0xcd6a2d[_0xd145('0x20')],'UserId':_0xcd6a2d['id'],'queue_name':_0x2cd40a[_0xa3b7fd]['name'],'VoiceQueueId':_0x2cd40a[_0xa3b7fd]['id'],'interface':_0x42ee0f,'paused':_0xcd6a2d[_0xd145('0x49')]||![],'penalty':_0x2cd40a[_0xa3b7fd]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xd145('0x47')](_0x14d4ca);}}}})[_0xd145('0x15')](function(){if(_0xcd6a2d){return db[_0xd145('0x27')][_0xd145('0x28')]({'where':{'membername':_0xcd6a2d[_0xd145('0x20')],'exitAt':null}});}})[_0xd145('0x15')](function(_0x152b50){if(_0xcd6a2d){if(_0x152b50&&_0x152b50[_0xd145('0x2a')]){var _0x1a6fa5=[];_0x152b50[_0xd145('0x45')](function(_0x3ca717){_0x1a6fa5[_0xd145('0x46')](_0x3ca717[_0xd145('0x26')]({'exitAt':moment()[_0xd145('0x23')](_0xd145('0x2b'))}));});return BPromise['all'](_0x1a6fa5);}}})[_0xd145('0x15')](function(){if(_0xcd6a2d){var _0x4de72c=[];var _0x33eaaa=[];var _0x698faa=utils['getChannels']();var _0x560b0f={'membername':_0xcd6a2d[_0xd145('0x20')],'interface':_0x42ee0f,'enterAt':moment()['format'](_0xd145('0x2b')),'role':_0xcd6a2d['role'],'internal':_0xcd6a2d[_0xd145('0x22')]};_0x698faa[_0xd145('0x45')](function(_0x322795){_0x4de72c[_0xd145('0x46')](_['merge']({'channel':_0x322795,'type':_0xd145('0x51'),'data1':'callysquare','data2':_0x42ee0f},_0x560b0f));if(_0xcd6a2d['loginInPause']){_0x33eaaa[_0xd145('0x46')](_[_0xd145('0x52')]({'channel':_0x322795,'type':'PAUSE','data1':_0xd145('0x53')},_0x560b0f));}});return db[_0xd145('0x27')][_0xd145('0x54')](_0x4de72c[_0xd145('0x55')](_0x33eaaa),{'individualHooks':!![]});}})[_0xd145('0x15')](function(){if(_0xcd6a2d){return _0xcd6a2d[_0xd145('0x26')]({'online':!![],'lastLoginAt':moment()[_0xd145('0x23')](_0xd145('0x2b')),'voicePause':_0xcd6a2d[_0xd145('0x49')]||![],'mailPause':_0xcd6a2d[_0xd145('0x49')]||![],'chatPause':_0xcd6a2d[_0xd145('0x49')]||![],'faxPause':_0xcd6a2d[_0xd145('0x49')]||![],'smsPause':_0xcd6a2d[_0xd145('0x49')]||![],'openchannelPause':_0xcd6a2d[_0xd145('0x49')]||![],'pauseType':_0xcd6a2d['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xd145('0x23')](_0xd145('0x2b')),'interface':_0x42ee0f});}})[_0xd145('0x15')](function(_0x93be3b){_0x47bf5e(_0x93be3b);})[_0xd145('0x1a')](function(_0x567278){_0x23f430(_0x46f637['error'](0x1f4,_0x567278[_0xd145('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f598e5a..d757852 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 _0xe3cc=['register','./user.events','remove','emit','removeListener'];(function(_0x3106f2,_0x3b63f2){var _0x245f54=function(_0x4d3585){while(--_0x4d3585){_0x3106f2['push'](_0x3106f2['shift']());}};_0x245f54(++_0x3b63f2);}(_0xe3cc,0x1c3));var _0xce3c=function(_0x551349,_0x3eaa35){_0x551349=_0x551349-0x0;var _0x5107c2=_0xe3cc[_0x551349];return _0x5107c2;};'use strict';var UserEvents=require(_0xce3c('0x0'));var events=['save',_0xce3c('0x1'),'update'];function createListener(_0x3615a7,_0x28a115){return function(_0x573ae5){_0x28a115[_0xce3c('0x2')](_0x3615a7,_0x573ae5);};}function removeListener(_0xb40420,_0x1c9758){return function(){UserEvents[_0xce3c('0x3')](_0xb40420,_0x1c9758);};}exports[_0xce3c('0x4')]=function(_0x191cd3){for(var _0x5bb979=0x0,_0xf3138a=events['length'];_0x5bb979<_0xf3138a;_0x5bb979++){var _0x14aecd=events[_0x5bb979];var _0x12b1c8=createListener('user:'+_0x14aecd,_0x191cd3);UserEvents['on'](_0x14aecd,_0x12b1c8);}}; \ No newline at end of file +var _0x5e6d=['removeListener','register','length','save','remove','update','emit'];(function(_0x23e156,_0x38f15d){var _0x5e76eb=function(_0x18e160){while(--_0x18e160){_0x23e156['push'](_0x23e156['shift']());}};_0x5e76eb(++_0x38f15d);}(_0x5e6d,0xff));var _0xd5e6=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x5e6d[_0x725b8e];return _0x43ac45;};'use strict';var UserEvents=require('./user.events');var events=[_0xd5e6('0x0'),_0xd5e6('0x1'),_0xd5e6('0x2')];function createListener(_0x4f4eca,_0x182139){return function(_0x1eddf6){_0x182139[_0xd5e6('0x3')](_0x4f4eca,_0x1eddf6);};}function removeListener(_0x39b2fe,_0x2c57ad){return function(){UserEvents[_0xd5e6('0x4')](_0x39b2fe,_0x2c57ad);};}exports[_0xd5e6('0x5')]=function(_0x383d0d){for(var _0x1df49c=0x0,_0x3ed894=events[_0xd5e6('0x6')];_0x1df49c<_0x3ed894;_0x1df49c++){var _0x35d85e=events[_0x1df49c];var _0x5d9199=createListener('user:'+_0x35d85e,_0x383d0d);UserEvents['on'](_0x35d85e,_0x5d9199);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 1a0a453..c48491b 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(_0x3748f2,_0x369822){var _0x59052f=function(_0x43089e){while(--_0x43089e){_0x3748f2['push'](_0x3748f2['shift']());}};_0x59052f(++_0x369822);}(_0x70e0,0x17b));var _0x070e=function(_0x4f73d5,_0x18b10a){_0x4f73d5=_0x4f73d5-0x0;var _0x3b6fa8=_0x70e0[_0x4f73d5];return _0x3b6fa8;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1f687a,_0x47f54c){var _0x2d1e04=function(_0x4dc6e){while(--_0x4dc6e){_0x1f687a['push'](_0x1f687a['shift']());}};_0x2d1e04(++_0x47f54c);}(_0x70e0,0x17b));var _0x070e=function(_0x1a45db,_0x3290dc){_0x1a45db=_0x1a45db-0x0;var _0x29a7eb=_0x70e0[_0x1a45db];return _0x29a7eb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 503a196..fa44d39 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 _0x0ef0=['sequelize','exports'];(function(_0x3cb1ad,_0x5d5209){var _0x104fa6=function(_0x5b80d2){while(--_0x5b80d2){_0x3cb1ad['push'](_0x3cb1ad['shift']());}};_0x104fa6(++_0x5d5209);}(_0x0ef0,0x80));var _0x00ef=function(_0xef1e4c,_0x5cb9ae){_0xef1e4c=_0xef1e4c-0x0;var _0x203904=_0x0ef0[_0xef1e4c];return _0x203904;};'use strict';var Sequelize=require(_0x00ef('0x0'));module[_0x00ef('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa1a5=['sequelize','INTEGER'];(function(_0x54e428,_0x14b472){var _0x131cb3=function(_0x2a9834){while(--_0x2a9834){_0x54e428['push'](_0x54e428['shift']());}};_0x131cb3(++_0x14b472);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x55af63,_0x4afa97){_0x55af63=_0x55af63-0x0;var _0x749b32=_0xa1a5[_0x55af63];return _0x749b32;};'use strict';var Sequelize=require(_0x5a1a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 56973d0..038ecca 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 _0x9ccc=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5f3562,_0x212f41){var _0x1b39b4=function(_0x153e49){while(--_0x153e49){_0x5f3562['push'](_0x5f3562['shift']());}};_0x1b39b4(++_0x212f41);}(_0x9ccc,0x83));var _0xc9cc=function(_0x456582,_0x16ced0){_0x456582=_0x456582-0x0;var _0x4aad5e=_0x9ccc[_0x456582];return _0x4aad5e;};'use strict';var _=require(_0xc9cc('0x0'));var util=require(_0xc9cc('0x1'));var logger=require('../../config/logger')(_0xc9cc('0x2'));var moment=require(_0xc9cc('0x3'));var BPromise=require(_0xc9cc('0x4'));var rp=require(_0xc9cc('0x5'));var fs=require('fs');var path=require(_0xc9cc('0x6'));var rimraf=require(_0xc9cc('0x7'));var config=require(_0xc9cc('0x8'));var attributes=require(_0xc9cc('0x9'));module[_0xc9cc('0xa')]=function(_0xf69c6,_0x4b05f8){return _0xf69c6[_0xc9cc('0xb')](_0xc9cc('0xc'),attributes,{'tableName':_0xc9cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedee=['util','../../config/logger','bluebird','path','../../config/environment','exports','UserChatQueue','user_has_chat_queues','lodash'];(function(_0x19f66a,_0x59f143){var _0x127266=function(_0x4b3fbc){while(--_0x4b3fbc){_0x19f66a['push'](_0x19f66a['shift']());}};_0x127266(++_0x59f143);}(_0xedee,0x170));var _0xeede=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xedee[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xeede('0x0'));var util=require(_0xeede('0x1'));var logger=require(_0xeede('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeede('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeede('0x4'));var rimraf=require('rimraf');var config=require(_0xeede('0x5'));var attributes=require('./userChatQueue.attributes');module[_0xeede('0x6')]=function(_0x196d8e,_0xfbf4b3){return _0x196d8e['define'](_0xeede('0x7'),attributes,{'tableName':_0xeede('0x8'),'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 ac19a2d..2006342 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 _0x1d75=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1d75,0x1d5));var _0x51d7=function(_0x273505,_0x5a7f75){_0x273505=_0x273505-0x0;var _0x9d7ea0=_0x1d75[_0x273505];return _0x9d7ea0;};'use strict';var _=require(_0x51d7('0x0'));var util=require('util');var moment=require(_0x51d7('0x1'));var BPromise=require(_0x51d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x51d7('0x4'));var logger=require(_0x51d7('0x5'))(_0x51d7('0x6'));var config=require('../../config/environment');var jayson=require(_0x51d7('0x7'));var client=jayson[_0x51d7('0x8')][_0x51d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf3364d,_0x217978,_0x144c93){return new BPromise(function(_0x274bb3,_0x25063b){return client[_0x51d7('0xa')](_0xf3364d,_0x144c93)[_0x51d7('0xb')](function(_0x6686fa){logger[_0x51d7('0xc')](_0x51d7('0xd'),_0x217978,_0x51d7('0xe'));logger['debug'](_0x51d7('0xf'),_0x217978,'request\x20sent',JSON[_0x51d7('0x10')](_0x6686fa));if(_0x6686fa[_0x51d7('0x11')]){if(_0x6686fa[_0x51d7('0x11')][_0x51d7('0x12')]===0x1f4){logger[_0x51d7('0x11')](_0x51d7('0xd'),_0x217978,_0x6686fa['error'][_0x51d7('0x13')]);return _0x25063b(_0x6686fa[_0x51d7('0x11')][_0x51d7('0x13')]);}logger[_0x51d7('0x11')](_0x51d7('0xd'),_0x217978,_0x6686fa['error'][_0x51d7('0x13')]);return _0x274bb3(_0x6686fa['error'][_0x51d7('0x13')]);}else{logger[_0x51d7('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x217978,'request\x20sent');_0x274bb3(_0x6686fa[_0x51d7('0x14')][_0x51d7('0x13')]);}})[_0x51d7('0x15')](function(_0x1043fb){logger[_0x51d7('0x11')](_0x51d7('0xd'),_0x217978,_0x1043fb);_0x25063b(_0x1043fb);});});} \ No newline at end of file +var _0x6b01=['info','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x1fd06e,_0x29d505){var _0x5aec60=function(_0x4546be){while(--_0x4546be){_0x1fd06e['push'](_0x1fd06e['shift']());}};_0x5aec60(++_0x29d505);}(_0x6b01,0x17d));var _0x16b0=function(_0xd84c36,_0x5e14be){_0xd84c36=_0xd84c36-0x0;var _0x32c2bf=_0x6b01[_0xd84c36];return _0x32c2bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x16b0('0x0'));var fs=require('fs');var Redis=require(_0x16b0('0x1'));var db=require(_0x16b0('0x2'))['db'];var utils=require(_0x16b0('0x3'));var logger=require('../../config/logger')(_0x16b0('0x4'));var config=require(_0x16b0('0x5'));var jayson=require(_0x16b0('0x6'));var client=jayson[_0x16b0('0x7')][_0x16b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4387b1,_0x248219,_0x207ad6){return new BPromise(function(_0x29d9bc,_0x10f109){return client[_0x16b0('0x9')](_0x4387b1,_0x207ad6)[_0x16b0('0xa')](function(_0x45fbcc){logger['info'](_0x16b0('0xb'),_0x248219,'request\x20sent');logger[_0x16b0('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x248219,_0x16b0('0xd'),JSON[_0x16b0('0xe')](_0x45fbcc));if(_0x45fbcc[_0x16b0('0xf')]){if(_0x45fbcc[_0x16b0('0xf')][_0x16b0('0x10')]===0x1f4){logger[_0x16b0('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x248219,_0x45fbcc[_0x16b0('0xf')][_0x16b0('0x11')]);return _0x10f109(_0x45fbcc[_0x16b0('0xf')]['message']);}logger[_0x16b0('0xf')](_0x16b0('0xb'),_0x248219,_0x45fbcc['error'][_0x16b0('0x11')]);return _0x29d9bc(_0x45fbcc[_0x16b0('0xf')][_0x16b0('0x11')]);}else{logger[_0x16b0('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x248219,_0x16b0('0xd'));_0x29d9bc(_0x45fbcc[_0x16b0('0x13')][_0x16b0('0x11')]);}})[_0x16b0('0x14')](function(_0x33d4e9){logger[_0x16b0('0xf')](_0x16b0('0xb'),_0x248219,_0x33d4e9);_0x10f109(_0x33d4e9);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3c620de..d173f00 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x39e4a1,_0x4edcc5){var _0x55b30e=function(_0x5efd8e){while(--_0x5efd8e){_0x39e4a1['push'](_0x39e4a1['shift']());}};_0x55b30e(++_0x4edcc5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x320fe8,_0x336026){var _0x5051d6=function(_0x37a925){while(--_0x37a925){_0x320fe8['push'](_0x320fe8['shift']());}};_0x5051d6(++_0x336026);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xcb91[_0x4d8a8f];return _0xfc4adc;};'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 d09d33e..b2d748e 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 _0xd0b8=['sequelize','exports','STRING'];(function(_0x546b86,_0x409d0f){var _0x166f03=function(_0x18b12a){while(--_0x18b12a){_0x546b86['push'](_0x546b86['shift']());}};_0x166f03(++_0x409d0f);}(_0xd0b8,0xbd));var _0x8d0b=function(_0xa7d5f2,_0x1ea807){_0xa7d5f2=_0xa7d5f2-0x0;var _0x5ac324=_0xd0b8[_0xa7d5f2];return _0x5ac324;};'use strict';var Sequelize=require(_0x8d0b('0x0'));module[_0x8d0b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8d0b('0x2')]}}; \ No newline at end of file +var _0x62a4=['exports','INTEGER','sequelize'];(function(_0x2833ed,_0x338d53){var _0x2f603c=function(_0x397d10){while(--_0x397d10){_0x2833ed['push'](_0x2833ed['shift']());}};_0x2f603c(++_0x338d53);}(_0x62a4,0x7d));var _0x462a=function(_0x15653b,_0x3a8af9){_0x15653b=_0x15653b-0x0;var _0xb18aed=_0x62a4[_0x15653b];return _0xb18aed;};'use strict';var Sequelize=require(_0x462a('0x0'));module[_0x462a('0x1')]={'penalty':{'type':Sequelize[_0x462a('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x462a('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d33f6b4..0093c06 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 _0x09a1=['util','../../config/logger','api','bluebird','path','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x242619,_0x44c6e2){var _0x577883=function(_0x3e3403){while(--_0x3e3403){_0x242619['push'](_0x242619['shift']());}};_0x577883(++_0x44c6e2);}(_0x09a1,0x6d));var _0x109a=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x09a1[_0x383356];return _0x32ee5a;};'use strict';var _=require(_0x109a('0x0'));var util=require(_0x109a('0x1'));var logger=require(_0x109a('0x2'))(_0x109a('0x3'));var moment=require('moment');var BPromise=require(_0x109a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x109a('0x5'));var rimraf=require('rimraf');var config=require(_0x109a('0x6'));var attributes=require(_0x109a('0x7'));module['exports']=function(_0x49d1f1,_0x33035e){return _0x49d1f1['define'](_0x109a('0x8'),attributes,{'tableName':_0x109a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9f3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x3b9bef,_0x4c96eb){var _0x58f5ac=function(_0x4ae64e){while(--_0x4ae64e){_0x3b9bef['push'](_0x3b9bef['shift']());}};_0x58f5ac(++_0x4c96eb);}(_0xf9f3,0x194));var _0x3f9f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf9f3[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3f9f('0x0'));var util=require(_0x3f9f('0x1'));var logger=require(_0x3f9f('0x2'))(_0x3f9f('0x3'));var moment=require(_0x3f9f('0x4'));var BPromise=require(_0x3f9f('0x5'));var rp=require(_0x3f9f('0x6'));var fs=require('fs');var path=require(_0x3f9f('0x7'));var rimraf=require(_0x3f9f('0x8'));var config=require(_0x3f9f('0x9'));var attributes=require(_0x3f9f('0xa'));module[_0x3f9f('0xb')]=function(_0x5d8c78,_0x5e77f0){return _0x5d8c78[_0x3f9f('0xc')](_0x3f9f('0xd'),attributes,{'tableName':_0x3f9f('0xe'),'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 0e60aee..dbbe038 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 _0xf79f=['error','code','message','UserFaxQueue,\x20%s,\x20%s','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x545216,_0xbea8fb){var _0xf6188f=function(_0x366c9e){while(--_0x366c9e){_0x545216['push'](_0x545216['shift']());}};_0xf6188f(++_0xbea8fb);}(_0xf79f,0x131));var _0xff79=function(_0x1649fe,_0x5916da){_0x1649fe=_0x1649fe-0x0;var _0x473a67=_0xf79f[_0x1649fe];return _0x473a67;};'use strict';var _=require(_0xff79('0x0'));var util=require('util');var moment=require(_0xff79('0x1'));var BPromise=require(_0xff79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff79('0x3'))['db'];var utils=require(_0xff79('0x4'));var logger=require('../../config/logger')(_0xff79('0x5'));var config=require(_0xff79('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xff79('0x7')][_0xff79('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x192823,_0x18524a,_0x4112b8){return new BPromise(function(_0x526030,_0x2e09fc){return client['request'](_0x192823,_0x4112b8)[_0xff79('0x9')](function(_0x56ff6f){logger[_0xff79('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x18524a,_0xff79('0xb'));logger[_0xff79('0xc')](_0xff79('0xd'),_0x18524a,_0xff79('0xb'),JSON[_0xff79('0xe')](_0x56ff6f));if(_0x56ff6f['error']){if(_0x56ff6f[_0xff79('0xf')][_0xff79('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x18524a,_0x56ff6f[_0xff79('0xf')][_0xff79('0x11')]);return _0x2e09fc(_0x56ff6f['error'][_0xff79('0x11')]);}logger[_0xff79('0xf')](_0xff79('0x12'),_0x18524a,_0x56ff6f['error'][_0xff79('0x11')]);return _0x526030(_0x56ff6f[_0xff79('0xf')]['message']);}else{logger[_0xff79('0xa')](_0xff79('0x12'),_0x18524a,_0xff79('0xb'));_0x526030(_0x56ff6f['result'][_0xff79('0x11')]);}})[_0xff79('0x13')](function(_0x3e397c){logger[_0xff79('0xf')](_0xff79('0x12'),_0x18524a,_0x3e397c);_0x2e09fc(_0x3e397c);});});} \ No newline at end of file +var _0x9114=['stringify','error','code','message','result','catch','util','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x9114,0x1bf));var _0x4911=function(_0x70a059,_0x251f31){_0x70a059=_0x70a059-0x0;var _0x562132=_0x9114[_0x70a059];return _0x562132;};'use strict';var _=require('lodash');var util=require(_0x4911('0x0'));var moment=require(_0x4911('0x1'));var BPromise=require(_0x4911('0x2'));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(_0x4911('0x3'))('rpc');var config=require(_0x4911('0x4'));var jayson=require(_0x4911('0x5'));var client=jayson[_0x4911('0x6')][_0x4911('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2cd325,_0x233e9a,_0x7f4afc){return new BPromise(function(_0x102eeb,_0x22e600){return client[_0x4911('0x8')](_0x2cd325,_0x7f4afc)[_0x4911('0x9')](function(_0xddee9f){logger[_0x4911('0xa')](_0x4911('0xb'),_0x233e9a,'request\x20sent');logger[_0x4911('0xc')](_0x4911('0xd'),_0x233e9a,_0x4911('0xe'),JSON[_0x4911('0xf')](_0xddee9f));if(_0xddee9f['error']){if(_0xddee9f[_0x4911('0x10')][_0x4911('0x11')]===0x1f4){logger[_0x4911('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x233e9a,_0xddee9f['error']['message']);return _0x22e600(_0xddee9f['error'][_0x4911('0x12')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x233e9a,_0xddee9f[_0x4911('0x10')]['message']);return _0x102eeb(_0xddee9f['error'][_0x4911('0x12')]);}else{logger[_0x4911('0xa')](_0x4911('0xb'),_0x233e9a,_0x4911('0xe'));_0x102eeb(_0xddee9f[_0x4911('0x13')][_0x4911('0x12')]);}})[_0x4911('0x14')](function(_0x31f90f){logger['error'](_0x4911('0xb'),_0x233e9a,_0x31f90f);_0x22e600(_0x31f90f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 703f1cd..cb31813 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x300a26,_0x1ad864){var _0x43bccd=function(_0x112388){while(--_0x112388){_0x300a26['push'](_0x300a26['shift']());}};_0x43bccd(++_0x1ad864);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x544e8b,_0x10d5fa){var _0x237718=function(_0x199ed4){while(--_0x199ed4){_0x544e8b['push'](_0x544e8b['shift']());}};_0x237718(++_0x10d5fa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 8f9173f..637f64c 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 _0x0f44=['exports','sequelize'];(function(_0x302f85,_0x5bcca3){var _0x5ef7cb=function(_0x1f3afb){while(--_0x1f3afb){_0x302f85['push'](_0x302f85['shift']());}};_0x5ef7cb(++_0x5bcca3);}(_0x0f44,0x7d));var _0x40f4=function(_0x475c32,_0xb33058){_0x475c32=_0x475c32-0x0;var _0xc16abe=_0x0f44[_0x475c32];return _0xc16abe;};'use strict';var Sequelize=require(_0x40f4('0x0'));module[_0x40f4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a12=['sequelize','exports','INTEGER'];(function(_0x1fb522,_0x5a7a10){var _0x4ba059=function(_0xa5f5f7){while(--_0xa5f5f7){_0x1fb522['push'](_0x1fb522['shift']());}};_0x4ba059(++_0x5a7a10);}(_0x0a12,0x1bf));var _0x20a1=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x0a12[_0x174ef5];return _0x1cc379;};'use strict';var Sequelize=require(_0x20a1('0x0'));module[_0x20a1('0x1')]={'penalty':{'type':Sequelize[_0x20a1('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 7d75fce..8045efd 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 _0x8ae1=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x8ae1,0x84));var _0x18ae=function(_0x574e93,_0xb97d3e){_0x574e93=_0x574e93-0x0;var _0x343023=_0x8ae1[_0x574e93];return _0x343023;};'use strict';var _=require(_0x18ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x18ae('0x1'));var moment=require(_0x18ae('0x2'));var BPromise=require(_0x18ae('0x3'));var rp=require(_0x18ae('0x4'));var fs=require('fs');var path=require(_0x18ae('0x5'));var rimraf=require('rimraf');var config=require(_0x18ae('0x6'));var attributes=require(_0x18ae('0x7'));module['exports']=function(_0x268b45,_0x476953){return _0x268b45[_0x18ae('0x8')](_0x18ae('0x9'),attributes,{'tableName':_0x18ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe783=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','util','../../config/logger'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xe783,0xb4));var _0x3e78=function(_0x1375c6,_0xa0ac61){_0x1375c6=_0x1375c6-0x0;var _0x17b8c7=_0xe783[_0x1375c6];return _0x17b8c7;};'use strict';var _=require('lodash');var util=require(_0x3e78('0x0'));var logger=require(_0x3e78('0x1'))(_0x3e78('0x2'));var moment=require(_0x3e78('0x3'));var BPromise=require(_0x3e78('0x4'));var rp=require(_0x3e78('0x5'));var fs=require('fs');var path=require(_0x3e78('0x6'));var rimraf=require(_0x3e78('0x7'));var config=require(_0x3e78('0x8'));var attributes=require(_0x3e78('0x9'));module[_0x3e78('0xa')]=function(_0x2fe9c6,_0x1f57a4){return _0x2fe9c6['define'](_0x3e78('0xb'),attributes,{'tableName':_0x3e78('0xc'),'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 d92fc45..e9e3f5d 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 _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x50c912,_0x3cd000){var _0x28a6cb=function(_0x216377){while(--_0x216377){_0x50c912['push'](_0x50c912['shift']());}};_0x28a6cb(++_0x3cd000);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3b1582,_0x31a7ff){_0x3b1582=_0x3b1582-0x0;var _0x3f2d2f=_0x7fbe[_0x3b1582];return _0x3f2d2f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x312912,_0x5adf8b){var _0x4ed959=function(_0x5e9a48){while(--_0x5e9a48){_0x312912['push'](_0x312912['shift']());}};_0x4ed959(++_0x5adf8b);}(_0x55ca,0x126));var _0xa55c=function(_0x3871d7,_0x3cfcc5){_0x3871d7=_0x3871d7-0x0;var _0x28ec09=_0x55ca[_0x3871d7];return _0x28ec09;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index f513ff7..ee85d6a 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 _0x377b=['../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x32129a,_0x4587a1){var _0xc2617d=function(_0x3b7917){while(--_0x3b7917){_0x32129a['push'](_0x32129a['shift']());}};_0xc2617d(++_0x4587a1);}(_0x377b,0xc3));var _0xb377=function(_0xfa022c,_0x59a566){_0xfa022c=_0xfa022c-0x0;var _0x45ef9d=_0x377b[_0xfa022c];return _0x45ef9d;};'use strict';var multer=require(_0xb377('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb377('0x1'));var express=require('express');var router=express[_0xb377('0x2')]();var fs_extra=require(_0xb377('0x3'));var auth=require(_0xb377('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb377('0x5'));var controller=require(_0xb377('0x6'));router[_0xb377('0x7')]('/',auth[_0xb377('0x8')](),controller[_0xb377('0x9')]);module['exports']=router; \ No newline at end of file +var _0xac5f=['Router','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','path','connect-timeout','express'];(function(_0x52cf07,_0x168dfe){var _0x335bca=function(_0x31e9c6){while(--_0x31e9c6){_0x52cf07['push'](_0x52cf07['shift']());}};_0x335bca(++_0x168dfe);}(_0xac5f,0x1bf));var _0xfac5=function(_0x16d988,_0x47fd13){_0x16d988=_0x16d988-0x0;var _0x3b527d=_0xac5f[_0x16d988];return _0x3b527d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfac5('0x0'));var timeout=require(_0xfac5('0x1'));var express=require(_0xfac5('0x2'));var router=express[_0xfac5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfac5('0x4'));var controller=require(_0xfac5('0x5'));router[_0xfac5('0x6')]('/',auth[_0xfac5('0x7')](),controller[_0xfac5('0x8')]);module[_0xfac5('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index edcbe11..1256d3d 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 _0x0ba3=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0ba3,0x67));var _0x30ba=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0ba3[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x30ba('0x0'));module[_0x30ba('0x1')]={'body':{'type':Sequelize[_0x30ba('0x2')]},'senderName':{'type':Sequelize[_0x30ba('0x3')]},'recipientsId':{'type':Sequelize[_0x30ba('0x2')]},'recipientsDescription':{'type':Sequelize[_0x30ba('0x3')]},'beep':{'type':Sequelize[_0x30ba('0x4')]}}; \ No newline at end of file +var _0x0bef=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3404fd,_0x116396){var _0x5aa40c=function(_0x2124d1){while(--_0x2124d1){_0x3404fd['push'](_0x3404fd['shift']());}};_0x5aa40c(++_0x116396);}(_0x0bef,0x161));var _0xf0be=function(_0x50354b,_0x4e474e){_0x50354b=_0x50354b-0x0;var _0x5506e9=_0x0bef[_0x50354b];return _0x5506e9;};'use strict';var Sequelize=require(_0xf0be('0x0'));module[_0xf0be('0x1')]={'body':{'type':Sequelize[_0xf0be('0x2')]},'senderName':{'type':Sequelize[_0xf0be('0x3')]},'recipientsId':{'type':Sequelize[_0xf0be('0x2')]},'recipientsDescription':{'type':Sequelize[_0xf0be('0x3')]},'beep':{'type':Sequelize[_0xf0be('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 2e6adee..36db25e 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 _0xfd18=['UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','catch','startCase','toLowerCase','User','union','ids','replace','queue','Queue','push','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','join','sequelize','transaction'];(function(_0x3bf0f8,_0x591f1c){var _0x2a3088=function(_0x57e9f5){while(--_0x57e9f5){_0x3bf0f8['push'](_0x3bf0f8['shift']());}};_0x2a3088(++_0x591f1c);}(_0xfd18,0x77));var _0x8fd1=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xfd18[_0x5756c6];return _0x4b5806;};'use strict';var emlformat=require(_0x8fd1('0x0'));var rimraf=require(_0x8fd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fd1('0x2'));var rp=require(_0x8fd1('0x3'));var moment=require('moment');var BPromise=require(_0x8fd1('0x4'));var Mustache=require(_0x8fd1('0x5'));var util=require('util');var path=require(_0x8fd1('0x6'));var sox=require(_0x8fd1('0x7'));var csv=require(_0x8fd1('0x8'));var ejs=require(_0x8fd1('0x9'));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(_0x8fd1('0xa'));var toCsv=require(_0x8fd1('0x8'));var querystring=require(_0x8fd1('0xb'));var Papa=require(_0x8fd1('0xc'));var Redis=require('ioredis');var authService=require(_0x8fd1('0xd'));var qs=require(_0x8fd1('0xe'));var as=require(_0x8fd1('0xf'));var hardwareService=require(_0x8fd1('0x10'));var logger=require(_0x8fd1('0x11'))(_0x8fd1('0x12'));var utils=require(_0x8fd1('0x13'));var config=require(_0x8fd1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fd1('0x15'))['db'];config[_0x8fd1('0x16')]=_['defaults'](config[_0x8fd1('0x16')],{'host':_0x8fd1('0x17'),'port':0x18eb});var socket=require(_0x8fd1('0x18'))(new Redis(config[_0x8fd1('0x16')]));require('./userNotification.socket')[_0x8fd1('0x19')](socket);function respondWithStatusCode(_0x57a772,_0x40ea7b){_0x40ea7b=_0x40ea7b||0xcc;return function(_0x465e82){if(_0x465e82){return _0x57a772[_0x8fd1('0x1a')](_0x40ea7b);}return _0x57a772['status'](_0x40ea7b)[_0x8fd1('0x1b')]();};}function respondWithResult(_0x23caa2,_0x9feaec){_0x9feaec=_0x9feaec||0xc8;return function(_0x78895b){if(_0x78895b){return _0x23caa2[_0x8fd1('0x1c')](_0x9feaec)[_0x8fd1('0x1d')](_0x78895b);}};}function respondWithFilteredResult(_0x17eb08,_0x53bdc7){return function(_0x56743c){if(_0x56743c){var _0x5ea22a=typeof _0x53bdc7[_0x8fd1('0x1e')]===_0x8fd1('0x1f')&&typeof _0x53bdc7['limit']===_0x8fd1('0x1f');var _0x304c32=_0x56743c[_0x8fd1('0x20')];var _0x2e904b=_0x5ea22a?0x0:_0x53bdc7[_0x8fd1('0x1e')];var _0x512141=_0x5ea22a?_0x56743c['count']:_0x53bdc7[_0x8fd1('0x1e')]+_0x53bdc7[_0x8fd1('0x21')];var _0x978c6;if(_0x512141>=_0x304c32){_0x512141=_0x304c32;_0x978c6=0xc8;}else{_0x978c6=0xce;}_0x17eb08['status'](_0x978c6);return _0x17eb08['set'](_0x8fd1('0x22'),_0x2e904b+'-'+_0x512141+'/'+_0x304c32)[_0x8fd1('0x1d')](_0x56743c);}return null;};}function patchUpdates(_0x10133f){return function(_0x19cde4){try{jsonpatch['apply'](_0x19cde4,_0x10133f,!![]);}catch(_0x3c71f7){return BPromise[_0x8fd1('0x23')](_0x3c71f7);}return _0x19cde4['save']();};}function saveUpdates(_0x31f78f,_0x27d954){return function(_0x66872e){if(_0x66872e){return _0x66872e[_0x8fd1('0x24')](_0x31f78f)[_0x8fd1('0x25')](function(_0x589714){return _0x589714;});}return null;};}function removeEntity(_0x1ea9f9,_0x313738){return function(_0x5108e6){if(_0x5108e6){return _0x5108e6[_0x8fd1('0x26')]()[_0x8fd1('0x25')](function(){_0x1ea9f9[_0x8fd1('0x1c')](0xcc)[_0x8fd1('0x1b')]();});}};}function handleEntityNotFound(_0x348c67,_0x26a3d){return function(_0x190407){if(!_0x190407){_0x348c67[_0x8fd1('0x1a')](0x194);}return _0x190407;};}function handleError(_0x1a5ac0,_0x19ab59){_0x19ab59=_0x19ab59||0x1f4;return function(_0x9faa89){logger['error'](_0x9faa89[_0x8fd1('0x27')]);if(_0x9faa89[_0x8fd1('0x28')]){delete _0x9faa89['name'];}_0x1a5ac0['status'](_0x19ab59)[_0x8fd1('0x29')](_0x9faa89);};}exports[_0x8fd1('0x2a')]=function(_0x152cb4,_0x18ebcb,_0x346418){if(!_0x152cb4[_0x8fd1('0x2b')][_0x8fd1('0x2c')](_0x8fd1('0x2d'))&&!_0x152cb4['body']['hasOwnProperty'](_0x8fd1('0x2e'))){throw new db[(_0x8fd1('0x2f'))][(_0x8fd1('0x30'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x152cb4[_0x8fd1('0x2b')][_0x8fd1('0x2c')](_0x8fd1('0x2e'))&&!_0x152cb4['body'][_0x8fd1('0x2c')](_0x8fd1('0x31'))){throw new db[(_0x8fd1('0x2f'))]['ValidationError'](_0x8fd1('0x32'));}if(!_0x152cb4['body']['hasOwnProperty'](_0x8fd1('0x33'))){throw new db[(_0x8fd1('0x2f'))][(_0x8fd1('0x30'))](_0x8fd1('0x34'));}else{try{var _0x32c285=JSON[_0x8fd1('0x35')](_0x152cb4['body'][_0x8fd1('0x33')]);}catch(_0x2c44cd){logger[_0x8fd1('0x36')](_0x2c44cd);throw new db['Sequelize'][(_0x8fd1('0x30'))](_0x8fd1('0x37'));}var _0x40e003=[_0x8fd1('0x38'),'faxqueue',_0x8fd1('0x39'),_0x8fd1('0x3a'),_0x8fd1('0x3b'),'voicequeue',_0x8fd1('0x3c'),_0x8fd1('0x3d'),_0x8fd1('0x3e')];if(_[_0x8fd1('0x3f')](_0x32c285,function(_0x32c4eb){return!_[_0x8fd1('0x40')](_0x40e003,_0x32c4eb['model']['toLowerCase']());})){throw new db['Sequelize']['ValidationError'](_0x8fd1('0x41'));}}}var _0xfcd2b4={};_0xfcd2b4[_0x8fd1('0x42')]=_0x152cb4[_0x8fd1('0x2b')][_0x8fd1('0x2c')](_0x8fd1('0x42'))?_0x152cb4['body'][_0x8fd1('0x42')]:_0x152cb4[_0x8fd1('0x3e')][_0x8fd1('0x43')];_0xfcd2b4[_0x8fd1('0x44')]=_[_0x8fd1('0x45')](_0x152cb4[_0x8fd1('0x2b')][_0x8fd1('0x44')])?null:_0x152cb4['body'][_0x8fd1('0x44')];_0xfcd2b4[_0x8fd1('0x46')]=_0x152cb4[_0x8fd1('0x2b')][_0x8fd1('0x46')]||![];_0xfcd2b4['SenderId']=_0x152cb4['user']['id'];return getContent(_0x152cb4[_0x8fd1('0x2b')])[_0x8fd1('0x25')](function(_0x428d75){_0xfcd2b4['body']=_0x428d75;return getRecipients(_0x32c285);})[_0x8fd1('0x25')](function(_0xb47601){_0xfcd2b4[_0x8fd1('0x47')]=_['sortBy'](_0xb47601)[_0x8fd1('0x48')](',');return db[_0x8fd1('0x49')][_0x8fd1('0x4a')](function(_0x377ebb){return db[_0x8fd1('0x4b')][_0x8fd1('0x4c')](_0xfcd2b4,{'raw':!![],'transaction':_0x377ebb})[_0x8fd1('0x25')](function(_0x22b54d){var _0x27a407={'sender':_0xfcd2b4[_0x8fd1('0x42')],'description':_0xfcd2b4[_0x8fd1('0x44')],'content':_0xfcd2b4[_0x8fd1('0x2b')],'beep':_0xfcd2b4[_0x8fd1('0x46')]};_0xb47601[_0x8fd1('0x4d')](function(_0x5b460e){_0x27a407[_0x8fd1('0x4e')]=_0x5b460e;socket[_0x8fd1('0x4f')](_0x8fd1('0x50'),_0x27a407);});return _0x22b54d;});});})[_0x8fd1('0x25')](respondWithResult(_0x18ebcb,0xc9))['catch'](handleError(_0x18ebcb,null));};function getContent(_0x2f3d71){return new BPromise(function(_0x2adaa7,_0x21d77b){if(_0x2f3d71[_0x8fd1('0x2d')]){_0x2adaa7(_0x2f3d71[_0x8fd1('0x2d')]);return;}return db[_0x8fd1('0x51')][_0x8fd1('0x52')]({'attributes':[_0x8fd1('0x53')],'where':{'id':_0x2f3d71[_0x8fd1('0x2e')]},'raw':!![]})['then'](function(_0x30b9f1){if(!_0x30b9f1)throw new db[(_0x8fd1('0x2f'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x1fe9dc=Mustache['render'](_0x30b9f1[_0x8fd1('0x53')],_0x2f3d71[_0x8fd1('0x31')]);_0x2adaa7(_0x1fe9dc);})[_0x8fd1('0x54')](function(_0x2b4447){_0x21d77b(_0x2b4447);});});}function getRecipients(_0x26594a){return new BPromise(function(_0x1b5351,_0x2e57a7){var _0x17f272=[];var _0xc309d0=[];_0x26594a[_0x8fd1('0x4d')](function(_0x14bb4f){var _0x5ba048=_[_0x8fd1('0x55')](_0x14bb4f['model'][_0x8fd1('0x56')]());if(_0x5ba048===_0x8fd1('0x57')){_0x17f272=_[_0x8fd1('0x58')](_0x17f272,_0x14bb4f[_0x8fd1('0x59')]);}else{if(_['includes'](_0x5ba048,'queue'))_0x5ba048=_0x5ba048[_0x8fd1('0x5a')](_0x8fd1('0x5b'),_0x8fd1('0x5c'));_0x14bb4f[_0x8fd1('0x59')]['forEach'](function(_0x371307){_0xc309d0[_0x8fd1('0x5d')](getAgents(_0x5ba048,_0x371307));});}});return BPromise['all'](_0xc309d0)[_0x8fd1('0x25')](function(_0x56b59f){_0x17f272=_[_0x8fd1('0x58')](_0x17f272,_[_0x8fd1('0x5e')](_0x56b59f));_0x1b5351(_0x17f272);})[_0x8fd1('0x54')](function(_0x41181a){_0x2e57a7(_0x41181a);});});}function getAgents(_0x811dea,_0x4c592b){return new BPromise(function(_0xde04f7,_0x13eecc){return db[_0x811dea][_0x8fd1('0x52')]({'where':{'id':_0x4c592b}})[_0x8fd1('0x25')](function(_0x277b95){return _0x277b95[_0x8fd1('0x5f')]({'attributes':['id'],'raw':!![]})[_0x8fd1('0x25')](function(_0x4b970d){var _0x40dfab=_[_0x8fd1('0x60')](_0x4b970d,'id');_0xde04f7(_0x40dfab);});})[_0x8fd1('0x54')](function(_0x5da4c0){_0x13eecc(_0x5da4c0);});});} \ No newline at end of file +var _0x5f6c=['team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','create','forEach','recipient','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','union','queue','Queue','ids','push','all','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','register','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue'];(function(_0x196ed7,_0x2f9181){var _0x121d12=function(_0x134057){while(--_0x134057){_0x196ed7['push'](_0x196ed7['shift']());}};_0x121d12(++_0x2f9181);}(_0x5f6c,0x14a));var _0xc5f6=function(_0x8ee23f,_0x11b8ab){_0x8ee23f=_0x8ee23f-0x0;var _0x23cf0f=_0x5f6c[_0x8ee23f];return _0x23cf0f;};'use strict';var emlformat=require(_0xc5f6('0x0'));var rimraf=require(_0xc5f6('0x1'));var zipdir=require(_0xc5f6('0x2'));var jsonpatch=require(_0xc5f6('0x3'));var rp=require(_0xc5f6('0x4'));var moment=require(_0xc5f6('0x5'));var BPromise=require(_0xc5f6('0x6'));var Mustache=require(_0xc5f6('0x7'));var util=require(_0xc5f6('0x8'));var path=require(_0xc5f6('0x9'));var sox=require('sox');var csv=require(_0xc5f6('0xa'));var ejs=require(_0xc5f6('0xb'));var fs=require('fs');var fs_extra=require(_0xc5f6('0xc'));var _=require(_0xc5f6('0xd'));var squel=require(_0xc5f6('0xe'));var crypto=require(_0xc5f6('0xf'));var jsforce=require(_0xc5f6('0x10'));var deskjs=require(_0xc5f6('0x11'));var toCsv=require(_0xc5f6('0xa'));var querystring=require(_0xc5f6('0x12'));var Papa=require(_0xc5f6('0x13'));var Redis=require(_0xc5f6('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5f6('0x15'));var hardwareService=require(_0xc5f6('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xc5f6('0x17'));var config=require(_0xc5f6('0x18'));var licenseUtil=require(_0xc5f6('0x19'));var db=require('../../mysqldb')['db'];config[_0xc5f6('0x1a')]=_['defaults'](config[_0xc5f6('0x1a')],{'host':_0xc5f6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5f6('0x1a')]));require('./userNotification.socket')[_0xc5f6('0x1c')](socket);function respondWithStatusCode(_0x5c343d,_0x63044d){_0x63044d=_0x63044d||0xcc;return function(_0x27f68f){if(_0x27f68f){return _0x5c343d[_0xc5f6('0x1d')](_0x63044d);}return _0x5c343d[_0xc5f6('0x1e')](_0x63044d)[_0xc5f6('0x1f')]();};}function respondWithResult(_0xc4f747,_0x54e8d3){_0x54e8d3=_0x54e8d3||0xc8;return function(_0x3c8bde){if(_0x3c8bde){return _0xc4f747[_0xc5f6('0x1e')](_0x54e8d3)[_0xc5f6('0x20')](_0x3c8bde);}};}function respondWithFilteredResult(_0xe4d811,_0x5e6a69){return function(_0x1e902b){if(_0x1e902b){var _0x1fd5fc=typeof _0x5e6a69['offset']==='undefined'&&typeof _0x5e6a69[_0xc5f6('0x21')]===_0xc5f6('0x22');var _0x3ee2d2=_0x1e902b['count'];var _0x4e4960=_0x1fd5fc?0x0:_0x5e6a69[_0xc5f6('0x23')];var _0x3d310a=_0x1fd5fc?_0x1e902b[_0xc5f6('0x24')]:_0x5e6a69[_0xc5f6('0x23')]+_0x5e6a69[_0xc5f6('0x21')];var _0x558c43;if(_0x3d310a>=_0x3ee2d2){_0x3d310a=_0x3ee2d2;_0x558c43=0xc8;}else{_0x558c43=0xce;}_0xe4d811[_0xc5f6('0x1e')](_0x558c43);return _0xe4d811[_0xc5f6('0x25')](_0xc5f6('0x26'),_0x4e4960+'-'+_0x3d310a+'/'+_0x3ee2d2)[_0xc5f6('0x20')](_0x1e902b);}return null;};}function patchUpdates(_0x3b642d){return function(_0x320f66){try{jsonpatch['apply'](_0x320f66,_0x3b642d,!![]);}catch(_0x35b0de){return BPromise[_0xc5f6('0x27')](_0x35b0de);}return _0x320f66[_0xc5f6('0x28')]();};}function saveUpdates(_0x2e1f44,_0x1c2717){return function(_0x927a5e){if(_0x927a5e){return _0x927a5e[_0xc5f6('0x29')](_0x2e1f44)[_0xc5f6('0x2a')](function(_0x5059f5){return _0x5059f5;});}return null;};}function removeEntity(_0x5be305,_0xc39d9b){return function(_0x418b29){if(_0x418b29){return _0x418b29[_0xc5f6('0x2b')]()['then'](function(){_0x5be305[_0xc5f6('0x1e')](0xcc)[_0xc5f6('0x1f')]();});}};}function handleEntityNotFound(_0xb9105f,_0x58a64d){return function(_0x42d0fa){if(!_0x42d0fa){_0xb9105f[_0xc5f6('0x1d')](0x194);}return _0x42d0fa;};}function handleError(_0x50c0ca,_0x284f24){_0x284f24=_0x284f24||0x1f4;return function(_0x57e16d){logger['error'](_0x57e16d[_0xc5f6('0x2c')]);if(_0x57e16d[_0xc5f6('0x2d')]){delete _0x57e16d[_0xc5f6('0x2d')];}_0x50c0ca[_0xc5f6('0x1e')](_0x284f24)[_0xc5f6('0x2e')](_0x57e16d);};}exports[_0xc5f6('0x2f')]=function(_0x3c684f,_0x3fd7d0,_0x10d472){if(!_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x31')](_0xc5f6('0x32'))&&!_0x3c684f['body'][_0xc5f6('0x31')](_0xc5f6('0x33'))){throw new db[(_0xc5f6('0x34'))][(_0xc5f6('0x35'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x31')](_0xc5f6('0x33'))&&!_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x31')](_0xc5f6('0x36'))){throw new db[(_0xc5f6('0x34'))][(_0xc5f6('0x35'))](_0xc5f6('0x37'));}if(!_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x31')](_0xc5f6('0x38'))){throw new db['Sequelize']['ValidationError'](_0xc5f6('0x39'));}else{try{var _0x1edfbc=JSON[_0xc5f6('0x3a')](_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x38')]);}catch(_0x3d28c0){logger[_0xc5f6('0x3b')](_0x3d28c0);throw new db['Sequelize'][(_0xc5f6('0x35'))](_0xc5f6('0x3c'));}var _0x1fffac=[_0xc5f6('0x3d'),_0xc5f6('0x3e'),_0xc5f6('0x3f'),_0xc5f6('0x40'),_0xc5f6('0x41'),'voicequeue','whatsappqueue',_0xc5f6('0x42'),_0xc5f6('0x43')];if(_[_0xc5f6('0x44')](_0x1edfbc,function(_0x3d0166){return!_['includes'](_0x1fffac,_0x3d0166[_0xc5f6('0x45')][_0xc5f6('0x46')]());})){throw new db[(_0xc5f6('0x34'))][(_0xc5f6('0x35'))](_0xc5f6('0x47'));}}}var _0x2159e1={};_0x2159e1[_0xc5f6('0x48')]=_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x31')]('senderName')?_0x3c684f['body'][_0xc5f6('0x48')]:_0x3c684f[_0xc5f6('0x43')][_0xc5f6('0x49')];_0x2159e1['recipientsDescription']=_['isEmpty'](_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x4a')])?null:_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x4a')];_0x2159e1['beep']=_0x3c684f[_0xc5f6('0x30')][_0xc5f6('0x4b')]||![];_0x2159e1[_0xc5f6('0x4c')]=_0x3c684f[_0xc5f6('0x43')]['id'];return getContent(_0x3c684f[_0xc5f6('0x30')])[_0xc5f6('0x2a')](function(_0x3c405e){_0x2159e1[_0xc5f6('0x30')]=_0x3c405e;return getRecipients(_0x1edfbc);})[_0xc5f6('0x2a')](function(_0x23c2fd){_0x2159e1[_0xc5f6('0x4d')]=_[_0xc5f6('0x4e')](_0x23c2fd)[_0xc5f6('0x4f')](',');return db[_0xc5f6('0x50')]['transaction'](function(_0x2c864e){return db['UserNotification'][_0xc5f6('0x51')](_0x2159e1,{'raw':!![],'transaction':_0x2c864e})['then'](function(_0x3cccb8){var _0x5795f6={'sender':_0x2159e1[_0xc5f6('0x48')],'description':_0x2159e1[_0xc5f6('0x4a')],'content':_0x2159e1['body'],'beep':_0x2159e1[_0xc5f6('0x4b')]};_0x23c2fd[_0xc5f6('0x52')](function(_0x3fcb98){_0x5795f6[_0xc5f6('0x53')]=_0x3fcb98;socket[_0xc5f6('0x54')]('userNotification:send',_0x5795f6);});return _0x3cccb8;});});})[_0xc5f6('0x2a')](respondWithResult(_0x3fd7d0,0xc9))[_0xc5f6('0x55')](handleError(_0x3fd7d0,null));};function getContent(_0x4b176e){return new BPromise(function(_0x4d5bc3,_0x2c73d0){if(_0x4b176e['text']){_0x4d5bc3(_0x4b176e['text']);return;}return db[_0xc5f6('0x56')][_0xc5f6('0x57')]({'attributes':[_0xc5f6('0x58')],'where':{'id':_0x4b176e[_0xc5f6('0x33')]},'raw':!![]})['then'](function(_0x28d1a5){if(!_0x28d1a5)throw new db['Sequelize'][(_0xc5f6('0x35'))](_0xc5f6('0x59'));var _0x3c3a22=Mustache[_0xc5f6('0x5a')](_0x28d1a5[_0xc5f6('0x58')],_0x4b176e[_0xc5f6('0x36')]);_0x4d5bc3(_0x3c3a22);})['catch'](function(_0x4bb8c6){_0x2c73d0(_0x4bb8c6);});});}function getRecipients(_0x3d6f47){return new BPromise(function(_0x511fde,_0xece017){var _0x85262c=[];var _0x35c805=[];_0x3d6f47[_0xc5f6('0x52')](function(_0x32c8db){var _0xaeb19f=_['startCase'](_0x32c8db[_0xc5f6('0x45')][_0xc5f6('0x46')]());if(_0xaeb19f==='User'){_0x85262c=_[_0xc5f6('0x5b')](_0x85262c,_0x32c8db['ids']);}else{if(_['includes'](_0xaeb19f,_0xc5f6('0x5c')))_0xaeb19f=_0xaeb19f['replace'](_0xc5f6('0x5c'),_0xc5f6('0x5d'));_0x32c8db[_0xc5f6('0x5e')][_0xc5f6('0x52')](function(_0x30990f){_0x35c805[_0xc5f6('0x5f')](getAgents(_0xaeb19f,_0x30990f));});}});return BPromise[_0xc5f6('0x60')](_0x35c805)[_0xc5f6('0x2a')](function(_0x1788f8){_0x85262c=_[_0xc5f6('0x5b')](_0x85262c,_[_0xc5f6('0x61')](_0x1788f8));_0x511fde(_0x85262c);})['catch'](function(_0x100405){_0xece017(_0x100405);});});}function getAgents(_0x54f698,_0x4a5f3a){return new BPromise(function(_0x4a9599,_0x51febe){return db[_0x54f698]['findOne']({'where':{'id':_0x4a5f3a}})[_0xc5f6('0x2a')](function(_0x560676){return _0x560676['getAgents']({'attributes':['id'],'raw':!![]})[_0xc5f6('0x2a')](function(_0x1928de){var _0x43ae02=_[_0xc5f6('0x62')](_0x1928de,'id');_0x4a9599(_0x43ae02);});})['catch'](function(_0x4a21cd){_0x51febe(_0x4a21cd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index f3ee5fc..eb8cd81 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 _0x3d4e=['events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0x3d4e,0x12c));var _0xe3d4=function(_0x101634,_0x40c0b2){_0x101634=_0x101634-0x0;var _0x3ab53c=_0x3d4e[_0x101634];return _0x3ab53c;};'use strict';var EventEmitter=require(_0xe3d4('0x0'));var UserNotification=require(_0xe3d4('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe3d4('0x2')](0x0);var events={'afterCreate':_0xe3d4('0x3'),'afterUpdate':_0xe3d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6b1107){return function(_0x180895,_0x8d4c4c,_0x3f6ffb){UserNotificationEvents[_0xe3d4('0x5')](_0x6b1107+':'+_0x180895['id'],_0x180895);UserNotificationEvents['emit'](_0x6b1107,_0x180895);_0x3f6ffb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xda79=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x11c61e,_0x5bdd3c){var _0x2e52fc=function(_0x221aba){while(--_0x221aba){_0x11c61e['push'](_0x11c61e['shift']());}};_0x2e52fc(++_0x5bdd3c);}(_0xda79,0xde));var _0x9da7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xda79[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x9da7('0x0'))['db'][_0x9da7('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9da7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9da7('0x3'),'afterDestroy':_0x9da7('0x4')};function emitEvent(_0x52005b){return function(_0x3aa88f,_0x5b79e5,_0x40d694){UserNotificationEvents[_0x9da7('0x5')](_0x52005b+':'+_0x3aa88f['id'],_0x3aa88f);UserNotificationEvents[_0x9da7('0x5')](_0x52005b,_0x3aa88f);_0x40d694(null);};}for(var e in events){if(events[_0x9da7('0x6')](e)){var event=events[e];UserNotification[_0x9da7('0x7')](e,emitEvent(event));}}module[_0x9da7('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 9009afb..0f9a30a 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 _0xbced=['./userNotification.attributes','userNotifications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xbced,0xab));var _0xdbce=function(_0x23783c,_0xa6127d){_0x23783c=_0x23783c-0x0;var _0x2bf505=_0xbced[_0x23783c];return _0x2bf505;};'use strict';var _=require(_0xdbce('0x0'));var util=require(_0xdbce('0x1'));var logger=require('../../config/logger')(_0xdbce('0x2'));var moment=require(_0xdbce('0x3'));var BPromise=require(_0xdbce('0x4'));var rp=require(_0xdbce('0x5'));var fs=require('fs');var path=require(_0xdbce('0x6'));var rimraf=require(_0xdbce('0x7'));var config=require(_0xdbce('0x8'));var attributes=require(_0xdbce('0x9'));module['exports']=function(_0x57f422,_0x5cf0e1){return _0x57f422['define']('UserNotification',attributes,{'tableName':_0xdbce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdbce('0xb')});}; \ No newline at end of file +var _0xd2cd=['request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd2cd,0x159));var _0xdd2c=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xd2cd[_0xcd5a3d];return _0xd43207;};'use strict';var _=require(_0xdd2c('0x0'));var util=require(_0xdd2c('0x1'));var logger=require('../../config/logger')(_0xdd2c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd2c('0x3'));var fs=require('fs');var path=require(_0xdd2c('0x4'));var rimraf=require(_0xdd2c('0x5'));var config=require(_0xdd2c('0x6'));var attributes=require(_0xdd2c('0x7'));module[_0xdd2c('0x8')]=function(_0x10cc8b,_0x3e3034){return _0x10cc8b['define'](_0xdd2c('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd2c('0xa'),'collate':_0xdd2c('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 5097951..b11160b 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 _0x88ce=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x88ce,0x1a8));var _0xe88c=function(_0x20c3a7,_0x5096b9){_0x20c3a7=_0x20c3a7-0x0;var _0x230e3f=_0x88ce[_0x20c3a7];return _0x230e3f;};'use strict';var _=require(_0xe88c('0x0'));var util=require('util');var moment=require(_0xe88c('0x1'));var BPromise=require(_0xe88c('0x2'));var rs=require(_0xe88c('0x3'));var fs=require('fs');var Redis=require(_0xe88c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe88c('0x5'));var logger=require(_0xe88c('0x6'))(_0xe88c('0x7'));var config=require(_0xe88c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe88c('0x9')]['http']({'port':0x232a});config[_0xe88c('0xa')]=_[_0xe88c('0xb')](config['redis'],{'host':_0xe88c('0xc'),'port':0x18eb});var socket=require(_0xe88c('0xd'))(new Redis(config['redis']));require(_0xe88c('0xe'))[_0xe88c('0xf')](socket);function respondWithRpcPromise(_0x2b78bd,_0x3c2058,_0x59a1e7){return new BPromise(function(_0x140401,_0x3ce61f){return client[_0xe88c('0x10')](_0x2b78bd,_0x59a1e7)[_0xe88c('0x11')](function(_0x6127af){logger[_0xe88c('0x12')](_0xe88c('0x13'),_0x3c2058,_0xe88c('0x14'));logger[_0xe88c('0x15')](_0xe88c('0x16'),_0x3c2058,'request\x20sent',JSON[_0xe88c('0x17')](_0x6127af));if(_0x6127af['error']){if(_0x6127af[_0xe88c('0x18')]['code']===0x1f4){logger[_0xe88c('0x18')]('UserNotification,\x20%s,\x20%s',_0x3c2058,_0x6127af[_0xe88c('0x18')][_0xe88c('0x19')]);return _0x3ce61f(_0x6127af[_0xe88c('0x18')][_0xe88c('0x19')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x3c2058,_0x6127af[_0xe88c('0x18')]['message']);return _0x140401(_0x6127af['error'][_0xe88c('0x19')]);}else{logger[_0xe88c('0x12')]('UserNotification,\x20%s,\x20%s',_0x3c2058,'request\x20sent');_0x140401(_0x6127af[_0xe88c('0x1a')][_0xe88c('0x19')]);}})[_0xe88c('0x1b')](function(_0x2aa97c){logger['error'](_0xe88c('0x13'),_0x3c2058,_0x2aa97c);_0x3ce61f(_0x2aa97c);});});} \ No newline at end of file +var _0xa1bb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','UserNotification,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x1ce037,_0x18c6aa){var _0x4266b7=function(_0x4f552d){while(--_0x4f552d){_0x1ce037['push'](_0x1ce037['shift']());}};_0x4266b7(++_0x18c6aa);}(_0xa1bb,0x8a));var _0xba1b=function(_0x512f67,_0x1267d0){_0x512f67=_0x512f67-0x0;var _0xbd8e6b=_0xa1bb[_0x512f67];return _0xbd8e6b;};'use strict';var _=require(_0xba1b('0x0'));var util=require(_0xba1b('0x1'));var moment=require(_0xba1b('0x2'));var BPromise=require(_0xba1b('0x3'));var rs=require(_0xba1b('0x4'));var fs=require('fs');var Redis=require(_0xba1b('0x5'));var db=require(_0xba1b('0x6'))['db'];var utils=require(_0xba1b('0x7'));var logger=require(_0xba1b('0x8'))(_0xba1b('0x9'));var config=require(_0xba1b('0xa'));var jayson=require(_0xba1b('0xb'));var client=jayson[_0xba1b('0xc')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xba1b('0xd')],{'host':_0xba1b('0xe'),'port':0x18eb});var socket=require(_0xba1b('0xf'))(new Redis(config[_0xba1b('0xd')]));require(_0xba1b('0x10'))['register'](socket);function respondWithRpcPromise(_0x3739f9,_0x26b81d,_0x3810bd){return new BPromise(function(_0x48da9f,_0x39d600){return client[_0xba1b('0x11')](_0x3739f9,_0x3810bd)[_0xba1b('0x12')](function(_0x11eec0){logger['info']('UserNotification,\x20%s,\x20%s',_0x26b81d,_0xba1b('0x13'));logger['debug'](_0xba1b('0x14'),_0x26b81d,_0xba1b('0x13'),JSON[_0xba1b('0x15')](_0x11eec0));if(_0x11eec0[_0xba1b('0x16')]){if(_0x11eec0[_0xba1b('0x16')]['code']===0x1f4){logger[_0xba1b('0x16')](_0xba1b('0x17'),_0x26b81d,_0x11eec0['error']['message']);return _0x39d600(_0x11eec0[_0xba1b('0x16')][_0xba1b('0x18')]);}logger[_0xba1b('0x16')](_0xba1b('0x17'),_0x26b81d,_0x11eec0['error']['message']);return _0x48da9f(_0x11eec0[_0xba1b('0x16')][_0xba1b('0x18')]);}else{logger[_0xba1b('0x19')](_0xba1b('0x17'),_0x26b81d,_0xba1b('0x13'));_0x48da9f(_0x11eec0[_0xba1b('0x1a')]['message']);}})[_0xba1b('0x1b')](function(_0x4401ec){logger[_0xba1b('0x16')](_0xba1b('0x17'),_0x26b81d,_0x4401ec);_0x39d600(_0x4401ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index accc0cd..820e0e8 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 _0xf06e=['userNotification:','./userNotification.events','save','remove','emit','removeListener','register'];(function(_0x3e796a,_0x15c68c){var _0x312e03=function(_0x232da7){while(--_0x232da7){_0x3e796a['push'](_0x3e796a['shift']());}};_0x312e03(++_0x15c68c);}(_0xf06e,0x12e));var _0xef06=function(_0x4ffd8f,_0x556e73){_0x4ffd8f=_0x4ffd8f-0x0;var _0x169568=_0xf06e[_0x4ffd8f];return _0x169568;};'use strict';var UserNotificationEvents=require(_0xef06('0x0'));var events=[_0xef06('0x1'),_0xef06('0x2'),'update'];function createListener(_0x52d66c,_0x498e07){return function(_0x1e36b1){_0x498e07[_0xef06('0x3')](_0x52d66c,_0x1e36b1);};}function removeListener(_0x532c11,_0x25d1d6){return function(){UserNotificationEvents[_0xef06('0x4')](_0x532c11,_0x25d1d6);};}exports[_0xef06('0x5')]=function(_0x1af3aa){for(var _0xb32d7c=0x0,_0x3a4979=events['length'];_0xb32d7c<_0x3a4979;_0xb32d7c++){var _0x2857a4=events[_0xb32d7c];var _0x6765b6=createListener(_0xef06('0x6')+_0x2857a4,_0x1af3aa);UserNotificationEvents['on'](_0x2857a4,_0x6765b6);}}; \ No newline at end of file +var _0xc0ef=['./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x2f1242,_0x575561){var _0x4a542f=function(_0x1dfe83){while(--_0x1dfe83){_0x2f1242['push'](_0x2f1242['shift']());}};_0x4a542f(++_0x575561);}(_0xc0ef,0x134));var _0xfc0e=function(_0x5a03cd,_0x4ba653){_0x5a03cd=_0x5a03cd-0x0;var _0x2a0d8a=_0xc0ef[_0x5a03cd];return _0x2a0d8a;};'use strict';var UserNotificationEvents=require(_0xfc0e('0x0'));var events=[_0xfc0e('0x1'),_0xfc0e('0x2'),_0xfc0e('0x3')];function createListener(_0x4833b1,_0x5efea8){return function(_0x102613){_0x5efea8[_0xfc0e('0x4')](_0x4833b1,_0x102613);};}function removeListener(_0x301491,_0x23ab43){return function(){UserNotificationEvents[_0xfc0e('0x5')](_0x301491,_0x23ab43);};}exports[_0xfc0e('0x6')]=function(_0x259209){for(var _0x43793f=0x0,_0x426999=events['length'];_0x43793f<_0x426999;_0x43793f++){var _0x521cb1=events[_0x43793f];var _0x2a34c8=createListener('userNotification:'+_0x521cb1,_0x259209);UserNotificationEvents['on'](_0x521cb1,_0x2a34c8);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index caac613..e2bdc37 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1fe160,_0x5e1a11){var _0x45c0cf=function(_0xf7c7e){while(--_0xf7c7e){_0x1fe160['push'](_0x1fe160['shift']());}};_0x45c0cf(++_0x5e1a11);}(_0xedd9,0xfc));var _0x9edd=function(_0x4237d1,_0x19d0f5){_0x4237d1=_0x4237d1-0x0;var _0x49482a=_0xedd9[_0x4237d1];return _0x49482a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xd10f4d,_0x34fdbf){var _0x505625=function(_0x485e88){while(--_0x485e88){_0xd10f4d['push'](_0xd10f4d['shift']());}};_0x505625(++_0x34fdbf);}(_0xedd9,0xfc));var _0x9edd=function(_0xa824c3,_0xd4a860){_0xa824c3=_0xa824c3-0x0;var _0x8204da=_0xedd9[_0xa824c3];return _0x8204da;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 5f2602b..e53cbb1 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 _0xd9c6=['sequelize','exports','INTEGER'];(function(_0x436c80,_0xcd24dc){var _0x18b1f5=function(_0x2ef14d){while(--_0x2ef14d){_0x436c80['push'](_0x436c80['shift']());}};_0x18b1f5(++_0xcd24dc);}(_0xd9c6,0x99));var _0x6d9c=function(_0x24df11,_0x4fdadd){_0x24df11=_0x24df11-0x0;var _0x590803=_0xd9c6[_0x24df11];return _0x590803;};'use strict';var Sequelize=require(_0x6d9c('0x0'));module[_0x6d9c('0x1')]={'penalty':{'type':Sequelize[_0x6d9c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4215=['sequelize'];(function(_0x56923e,_0x48b080){var _0x38b368=function(_0x252711){while(--_0x252711){_0x56923e['push'](_0x56923e['shift']());}};_0x38b368(++_0x48b080);}(_0x4215,0x6e));var _0x5421=function(_0x58ff8e,_0x39fe0d){_0x58ff8e=_0x58ff8e-0x0;var _0x701683=_0x4215[_0x58ff8e];return _0x701683;};'use strict';var Sequelize=require(_0x5421('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index f0fdeca..fb507d4 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 _0xd06f=['UserOpenchannelQueue','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x2652d4,_0x54aa3c){var _0x1c4928=function(_0x2b9610){while(--_0x2b9610){_0x2652d4['push'](_0x2652d4['shift']());}};_0x1c4928(++_0x54aa3c);}(_0xd06f,0xe5));var _0xfd06=function(_0x51630f,_0x3d2e49){_0x51630f=_0x51630f-0x0;var _0x4ee621=_0xd06f[_0x51630f];return _0x4ee621;};'use strict';var _=require(_0xfd06('0x0'));var util=require(_0xfd06('0x1'));var logger=require(_0xfd06('0x2'))('api');var moment=require(_0xfd06('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd06('0x4'));var fs=require('fs');var path=require(_0xfd06('0x5'));var rimraf=require(_0xfd06('0x6'));var config=require(_0xfd06('0x7'));var attributes=require(_0xfd06('0x8'));module[_0xfd06('0x9')]=function(_0x2ae25e,_0x36fa08){return _0x2ae25e[_0xfd06('0xa')](_0xfd06('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe12c=['../../config/environment','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xe12c,0xc9));var _0xce12=function(_0x16b1a5,_0x318267){_0x16b1a5=_0x16b1a5-0x0;var _0x475e25=_0xe12c[_0x16b1a5];return _0x475e25;};'use strict';var _=require(_0xce12('0x0'));var util=require(_0xce12('0x1'));var logger=require(_0xce12('0x2'))(_0xce12('0x3'));var moment=require(_0xce12('0x4'));var BPromise=require(_0xce12('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce12('0x6'));var rimraf=require(_0xce12('0x7'));var config=require(_0xce12('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x31c85f,_0xe5ad46){return _0x31c85f[_0xce12('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xce12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index e0bfb2c..b576f9d 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 _0xd3b1=['rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1c109b,_0x1955ec){var _0x3aa652=function(_0x3eae10){while(--_0x3eae10){_0x1c109b['push'](_0x1c109b['shift']());}};_0x3aa652(++_0x1955ec);}(_0xd3b1,0xe2));var _0x1d3b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd3b1[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d3b('0x0'));var BPromise=require(_0x1d3b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d3b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d3b('0x3'));var logger=require(_0x1d3b('0x4'))(_0x1d3b('0x5'));var config=require(_0x1d3b('0x6'));var jayson=require(_0x1d3b('0x7'));var client=jayson[_0x1d3b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe1b421,_0x286a65,_0x39f234){return new BPromise(function(_0x51ae10,_0x2ae528){return client[_0x1d3b('0x9')](_0xe1b421,_0x39f234)[_0x1d3b('0xa')](function(_0x25900c){logger[_0x1d3b('0xb')](_0x1d3b('0xc'),_0x286a65,_0x1d3b('0xd'));logger['debug'](_0x1d3b('0xe'),_0x286a65,_0x1d3b('0xd'),JSON[_0x1d3b('0xf')](_0x25900c));if(_0x25900c['error']){if(_0x25900c[_0x1d3b('0x10')][_0x1d3b('0x11')]===0x1f4){logger[_0x1d3b('0x10')](_0x1d3b('0xc'),_0x286a65,_0x25900c[_0x1d3b('0x10')][_0x1d3b('0x12')]);return _0x2ae528(_0x25900c['error'][_0x1d3b('0x12')]);}logger[_0x1d3b('0x10')](_0x1d3b('0xc'),_0x286a65,_0x25900c['error'][_0x1d3b('0x12')]);return _0x51ae10(_0x25900c[_0x1d3b('0x10')][_0x1d3b('0x12')]);}else{logger[_0x1d3b('0xb')](_0x1d3b('0xc'),_0x286a65,_0x1d3b('0xd'));_0x51ae10(_0x25900c[_0x1d3b('0x13')][_0x1d3b('0x12')]);}})[_0x1d3b('0x14')](function(_0x3a20e2){logger[_0x1d3b('0x10')](_0x1d3b('0xc'),_0x286a65,_0x3a20e2);_0x2ae528(_0x3a20e2);});});} \ No newline at end of file +var _0xaa7e=['result','UserOpenchannelQueue,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x162efe,_0xf67199){var _0xa4359a=function(_0x542954){while(--_0x542954){_0x162efe['push'](_0x162efe['shift']());}};_0xa4359a(++_0xf67199);}(_0xaa7e,0x15b));var _0xeaa7=function(_0x539fb2,_0x5b6718){_0x539fb2=_0x539fb2-0x0;var _0x4d583d=_0xaa7e[_0x539fb2];return _0x4d583d;};'use strict';var _=require(_0xeaa7('0x0'));var util=require(_0xeaa7('0x1'));var moment=require(_0xeaa7('0x2'));var BPromise=require(_0xeaa7('0x3'));var rs=require(_0xeaa7('0x4'));var fs=require('fs');var Redis=require(_0xeaa7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeaa7('0x6'))(_0xeaa7('0x7'));var config=require(_0xeaa7('0x8'));var jayson=require(_0xeaa7('0x9'));var client=jayson[_0xeaa7('0xa')][_0xeaa7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41d692,_0x1a85c7,_0x10889c){return new BPromise(function(_0x69f935,_0x46fa74){return client[_0xeaa7('0xc')](_0x41d692,_0x10889c)[_0xeaa7('0xd')](function(_0x46d3fa){logger[_0xeaa7('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1a85c7,_0xeaa7('0xf'));logger[_0xeaa7('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1a85c7,'request\x20sent',JSON[_0xeaa7('0x11')](_0x46d3fa));if(_0x46d3fa[_0xeaa7('0x12')]){if(_0x46d3fa[_0xeaa7('0x12')][_0xeaa7('0x13')]===0x1f4){logger[_0xeaa7('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1a85c7,_0x46d3fa[_0xeaa7('0x12')][_0xeaa7('0x14')]);return _0x46fa74(_0x46d3fa['error'][_0xeaa7('0x14')]);}logger[_0xeaa7('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1a85c7,_0x46d3fa['error'][_0xeaa7('0x14')]);return _0x69f935(_0x46d3fa['error']['message']);}else{logger[_0xeaa7('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1a85c7,_0xeaa7('0xf'));_0x69f935(_0x46d3fa[_0xeaa7('0x15')][_0xeaa7('0x14')]);}})['catch'](function(_0x5475ff){logger[_0xeaa7('0x12')](_0xeaa7('0x16'),_0x1a85c7,_0x5475ff);_0x46fa74(_0x5475ff);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index e0c8b7b..21e9222 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 _0x5499=['addResources','put','delete','/:id','destroy','removeSections','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','/:id/sections'];(function(_0x4c30df,_0x57d5ce){var _0x18ca14=function(_0x495257){while(--_0x495257){_0x4c30df['push'](_0x4c30df['shift']());}};_0x18ca14(++_0x57d5ce);}(_0x5499,0x14b));var _0x9549=function(_0x3aa9c7,_0x629939){_0x3aa9c7=_0x3aa9c7-0x0;var _0x4ed413=_0x5499[_0x3aa9c7];return _0x4ed413;};'use strict';var multer=require(_0x9549('0x0'));var util=require('util');var path=require(_0x9549('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9549('0x2')]();var fs_extra=require(_0x9549('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9549('0x4'));var config=require(_0x9549('0x5'));var controller=require('./userProfile.controller');router[_0x9549('0x6')]('/',auth[_0x9549('0x7')](),controller[_0x9549('0x8')]);router['get'](_0x9549('0x9'),auth['isAuthenticated'](),controller[_0x9549('0xa')]);router[_0x9549('0x6')]('/:id',auth[_0x9549('0x7')](),controller[_0x9549('0xb')]);router[_0x9549('0x6')]('/:id/sections',auth['isAuthenticated'](),controller[_0x9549('0xc')]);router['get'](_0x9549('0xd'),auth['isAuthenticated'](),controller[_0x9549('0xe')]);router['post']('/',auth[_0x9549('0x7')](),controller[_0x9549('0xf')]);router[_0x9549('0x10')](_0x9549('0x11'),auth[_0x9549('0x7')](),controller[_0x9549('0x12')]);router[_0x9549('0x10')](_0x9549('0x13'),auth[_0x9549('0x7')](),controller['addSections']);router['post'](_0x9549('0xd'),auth[_0x9549('0x7')](),controller[_0x9549('0x14')]);router[_0x9549('0x15')]('/:id',auth[_0x9549('0x7')](),controller['update']);router[_0x9549('0x16')](_0x9549('0x17'),auth[_0x9549('0x7')](),controller[_0x9549('0x18')]);router[_0x9549('0x16')](_0x9549('0x13'),auth['isAuthenticated'](),controller[_0x9549('0x19')]);router[_0x9549('0x16')](_0x9549('0xd'),auth[_0x9549('0x7')](),controller['removeResources']);module[_0x9549('0x1a')]=router; \ No newline at end of file +var _0x6cf2=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections'];(function(_0x4ba102,_0x3dc213){var _0x1f35e7=function(_0xceae5a){while(--_0xceae5a){_0x4ba102['push'](_0x4ba102['shift']());}};_0x1f35e7(++_0x3dc213);}(_0x6cf2,0x7c));var _0x26cf=function(_0x593fd4,_0x132274){_0x593fd4=_0x593fd4-0x0;var _0x485b9c=_0x6cf2[_0x593fd4];return _0x485b9c;};'use strict';var multer=require('multer');var util=require(_0x26cf('0x0'));var path=require(_0x26cf('0x1'));var timeout=require(_0x26cf('0x2'));var express=require(_0x26cf('0x3'));var router=express[_0x26cf('0x4')]();var fs_extra=require(_0x26cf('0x5'));var auth=require(_0x26cf('0x6'));var interaction=require(_0x26cf('0x7'));var config=require(_0x26cf('0x8'));var controller=require(_0x26cf('0x9'));router[_0x26cf('0xa')]('/',auth[_0x26cf('0xb')](),controller[_0x26cf('0xc')]);router[_0x26cf('0xa')](_0x26cf('0xd'),auth['isAuthenticated'](),controller[_0x26cf('0xe')]);router['get'](_0x26cf('0xf'),auth[_0x26cf('0xb')](),controller['show']);router[_0x26cf('0xa')](_0x26cf('0x10'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x11')]);router[_0x26cf('0xa')](_0x26cf('0x12'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x13')]);router['post']('/',auth[_0x26cf('0xb')](),controller[_0x26cf('0x14')]);router[_0x26cf('0x15')](_0x26cf('0x16'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x17')]);router[_0x26cf('0x15')]('/:id/sections',auth[_0x26cf('0xb')](),controller[_0x26cf('0x18')]);router[_0x26cf('0x15')](_0x26cf('0x12'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x19')]);router[_0x26cf('0x1a')](_0x26cf('0xf'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x1b')]);router[_0x26cf('0x1c')](_0x26cf('0xf'),auth[_0x26cf('0xb')](),controller[_0x26cf('0x1d')]);router[_0x26cf('0x1c')]('/:id/sections',auth[_0x26cf('0xb')](),controller[_0x26cf('0x1e')]);router[_0x26cf('0x1c')](_0x26cf('0x12'),auth[_0x26cf('0xb')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 257aced..311cb95 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 _0x97d0=['sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN'];(function(_0x5c4f74,_0x1cd57a){var _0x1cf3c7=function(_0x57ad7d){while(--_0x57ad7d){_0x5c4f74['push'](_0x5c4f74['shift']());}};_0x1cf3c7(++_0x1cd57a);}(_0x97d0,0x1c2));var _0x097d=function(_0x138d39,_0x2ccbb0){_0x138d39=_0x138d39-0x0;var _0x5193bf=_0x97d0[_0x138d39];return _0x5193bf;};'use strict';var Sequelize=require(_0x097d('0x0'));module[_0x097d('0x1')]={'name':{'type':Sequelize[_0x097d('0x2')],'allowNull':![],'unique':_0x097d('0x3')},'crudPermissions':{'type':Sequelize[_0x097d('0x2')],'set':function(_0x33ff84){this[_0x097d('0x4')](_0x097d('0x5'),_0x33ff84?_0x33ff84[_0x097d('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x097d('0x5'))?this[_0x097d('0x7')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x097d('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x097d('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x097d('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x097d('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x097d('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8759=['STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','name'];(function(_0xcd637e,_0x18508d){var _0x507b8f=function(_0x4d3c94){while(--_0x4d3c94){_0xcd637e['push'](_0xcd637e['shift']());}};_0x507b8f(++_0x18508d);}(_0x8759,0xbb));var _0x9875=function(_0x5344a4,_0x25e521){_0x5344a4=_0x5344a4-0x0;var _0x367022=_0x8759[_0x5344a4];return _0x367022;};'use strict';var Sequelize=require(_0x9875('0x0'));module[_0x9875('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9875('0x2')},'crudPermissions':{'type':Sequelize[_0x9875('0x3')],'set':function(_0x45629f){this[_0x9875('0x4')](_0x9875('0x5'),_0x45629f?_0x45629f[_0x9875('0x6')](''):[]);},'get':function(){return this[_0x9875('0x7')](_0x9875('0x5'))?this[_0x9875('0x7')]('crudPermissions')[_0x9875('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9875('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9875('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9875('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9875('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x9875('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9875('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9875('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9875('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 109316f..1afaad7 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 _0xf1e7=['fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','rawAttributes','intersection','length','options','find','create','clone','params','get','omit','createdAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','updatedAt','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','destroy','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','name','send','index','map','UserProfile','fieldName','type','model','keys','query','filters','attributes'];(function(_0x4df4ea,_0x36043c){var _0x14b7c0=function(_0x2dc2a4){while(--_0x2dc2a4){_0x4df4ea['push'](_0x4df4ea['shift']());}};_0x14b7c0(++_0x36043c);}(_0xf1e7,0xac));var _0x7f1e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf1e7[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f1e('0x0'));var jsonpatch=require(_0x7f1e('0x1'));var rp=require(_0x7f1e('0x2'));var moment=require(_0x7f1e('0x3'));var BPromise=require(_0x7f1e('0x4'));var Mustache=require(_0x7f1e('0x5'));var util=require(_0x7f1e('0x6'));var path=require(_0x7f1e('0x7'));var sox=require(_0x7f1e('0x8'));var csv=require(_0x7f1e('0x9'));var ejs=require(_0x7f1e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f1e('0xb'));var squel=require('squel');var crypto=require(_0x7f1e('0xc'));var jsforce=require(_0x7f1e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7f1e('0x9'));var querystring=require('querystring');var Papa=require(_0x7f1e('0xe'));var Redis=require(_0x7f1e('0xf'));var authService=require(_0x7f1e('0x10'));var qs=require(_0x7f1e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f1e('0x12'));var logger=require('../../config/logger')(_0x7f1e('0x13'));var utils=require(_0x7f1e('0x14'));var config=require(_0x7f1e('0x15'));var licenseUtil=require(_0x7f1e('0x16'));var db=require(_0x7f1e('0x17'))['db'];config[_0x7f1e('0x18')]=_['defaults'](config[_0x7f1e('0x18')],{'host':_0x7f1e('0x19'),'port':0x18eb});var socket=require(_0x7f1e('0x1a'))(new Redis(config[_0x7f1e('0x18')]));require('./userProfile.socket')[_0x7f1e('0x1b')](socket);function respondWithStatusCode(_0x317306,_0x26f057){_0x26f057=_0x26f057||0xcc;return function(_0x519cfe){if(_0x519cfe){return _0x317306[_0x7f1e('0x1c')](_0x26f057);}return _0x317306[_0x7f1e('0x1d')](_0x26f057)['end']();};}function respondWithResult(_0xa2f139,_0x3a3232){_0x3a3232=_0x3a3232||0xc8;return function(_0xa13da8){if(_0xa13da8){return _0xa2f139[_0x7f1e('0x1d')](_0x3a3232)[_0x7f1e('0x1e')](_0xa13da8);}};}function respondWithFilteredResult(_0x5ca372,_0x5dd7e8){return function(_0x41abed){if(_0x41abed){var _0x40c71b=typeof _0x5dd7e8[_0x7f1e('0x1f')]===_0x7f1e('0x20')&&typeof _0x5dd7e8[_0x7f1e('0x21')]===_0x7f1e('0x20');var _0xea3dd9=_0x41abed['count'];var _0x16ed41=_0x40c71b?0x0:_0x5dd7e8[_0x7f1e('0x1f')];var _0x18044e=_0x40c71b?_0x41abed[_0x7f1e('0x22')]:_0x5dd7e8['offset']+_0x5dd7e8['limit'];var _0x19a2d7;if(_0x18044e>=_0xea3dd9){_0x18044e=_0xea3dd9;_0x19a2d7=0xc8;}else{_0x19a2d7=0xce;}_0x5ca372[_0x7f1e('0x1d')](_0x19a2d7);return _0x5ca372['set'](_0x7f1e('0x23'),_0x16ed41+'-'+_0x18044e+'/'+_0xea3dd9)[_0x7f1e('0x1e')](_0x41abed);}return null;};}function patchUpdates(_0x2b7bd1){return function(_0x286c2b){try{jsonpatch[_0x7f1e('0x24')](_0x286c2b,_0x2b7bd1,!![]);}catch(_0xee4f0d){return BPromise['reject'](_0xee4f0d);}return _0x286c2b[_0x7f1e('0x25')]();};}function saveUpdates(_0x191421,_0x18aa86){return function(_0x17d33a){if(_0x17d33a){return _0x17d33a[_0x7f1e('0x26')](_0x191421)[_0x7f1e('0x27')](function(_0x5b648f){return _0x5b648f;});}return null;};}function removeEntity(_0x14c71e,_0x4f2510){return function(_0x58b756){if(_0x58b756){return _0x58b756['destroy']()[_0x7f1e('0x27')](function(){_0x14c71e['status'](0xcc)[_0x7f1e('0x28')]();});}};}function handleEntityNotFound(_0x157877,_0x4975d1){return function(_0x4dbd90){if(!_0x4dbd90){_0x157877[_0x7f1e('0x1c')](0x194);}return _0x4dbd90;};}function handleError(_0x1f69ee,_0x4eb013){_0x4eb013=_0x4eb013||0x1f4;return function(_0x28bb74){logger[_0x7f1e('0x29')](_0x28bb74['stack']);if(_0x28bb74[_0x7f1e('0x2a')]){delete _0x28bb74[_0x7f1e('0x2a')];}_0x1f69ee['status'](_0x4eb013)[_0x7f1e('0x2b')](_0x28bb74);};}exports[_0x7f1e('0x2c')]=function(_0x353b81,_0x5ca66e){var _0x3600b6={},_0x416601={},_0x23c8d7={'count':0x0,'rows':[]};var _0xe8b50c=_[_0x7f1e('0x2d')](db[_0x7f1e('0x2e')]['rawAttributes'],function(_0x245dd1){return{'name':_0x245dd1[_0x7f1e('0x2f')],'type':_0x245dd1[_0x7f1e('0x30')]['key']};});_0x416601[_0x7f1e('0x31')]=_[_0x7f1e('0x2d')](_0xe8b50c,_0x7f1e('0x2a'));_0x416601['query']=_[_0x7f1e('0x32')](_0x353b81[_0x7f1e('0x33')]);_0x416601[_0x7f1e('0x34')]=_['intersection'](_0x416601[_0x7f1e('0x31')],_0x416601[_0x7f1e('0x33')]);_0x3600b6[_0x7f1e('0x35')]=_['intersection'](_0x416601[_0x7f1e('0x31')],qs[_0x7f1e('0x36')](_0x353b81[_0x7f1e('0x33')]['fields']));_0x3600b6[_0x7f1e('0x35')]=_0x3600b6[_0x7f1e('0x35')]['length']?_0x3600b6['attributes']:_0x416601[_0x7f1e('0x31')];if(!_0x353b81[_0x7f1e('0x33')][_0x7f1e('0x37')]('nolimit')){_0x3600b6[_0x7f1e('0x21')]=qs[_0x7f1e('0x21')](_0x353b81[_0x7f1e('0x33')][_0x7f1e('0x21')]);_0x3600b6['offset']=qs['offset'](_0x353b81['query'][_0x7f1e('0x1f')]);}_0x3600b6[_0x7f1e('0x38')]=qs[_0x7f1e('0x39')](_0x353b81[_0x7f1e('0x33')][_0x7f1e('0x39')]);_0x3600b6[_0x7f1e('0x3a')]=qs[_0x7f1e('0x34')](_['pick'](_0x353b81[_0x7f1e('0x33')],_0x416601[_0x7f1e('0x34')]),_0xe8b50c);if(_0x353b81[_0x7f1e('0x33')]['filter']){_0x3600b6['where']=_[_0x7f1e('0x3b')](_0x3600b6[_0x7f1e('0x3a')],{'$or':_[_0x7f1e('0x2d')](_0xe8b50c,function(_0x23c707){if(_0x23c707['type']!==_0x7f1e('0x3c')){var _0x28fafe={};_0x28fafe[_0x23c707[_0x7f1e('0x2a')]]={'$like':'%'+_0x353b81[_0x7f1e('0x33')][_0x7f1e('0x3d')]+'%'};return _0x28fafe;}})});}_0x3600b6=_[_0x7f1e('0x3b')]({},_0x3600b6,_0x353b81['options']);var _0x27bf2a={'where':_0x3600b6[_0x7f1e('0x3a')]};return db[_0x7f1e('0x2e')]['count'](_0x27bf2a)[_0x7f1e('0x27')](function(_0x409f0f){_0x23c8d7[_0x7f1e('0x22')]=_0x409f0f;if(_0x353b81[_0x7f1e('0x33')][_0x7f1e('0x3e')]){_0x3600b6[_0x7f1e('0x3f')]=[{'all':!![]}];}return db[_0x7f1e('0x2e')][_0x7f1e('0x40')](_0x3600b6);})[_0x7f1e('0x27')](function(_0x5c0889){_0x23c8d7['rows']=_0x5c0889;return _0x23c8d7;})['then'](respondWithFilteredResult(_0x5ca66e,_0x3600b6))[_0x7f1e('0x41')](handleError(_0x5ca66e,null));};exports[_0x7f1e('0x42')]=function(_0x57cc25,_0x22f371){var _0x56977c={'raw':![],'where':{'id':_0x57cc25['params']['id']}},_0x2b1c82={};_0x2b1c82['model']=_[_0x7f1e('0x32')](db['UserProfile'][_0x7f1e('0x43')]);_0x2b1c82[_0x7f1e('0x33')]=_[_0x7f1e('0x32')](_0x57cc25[_0x7f1e('0x33')]);_0x2b1c82[_0x7f1e('0x34')]=_[_0x7f1e('0x44')](_0x2b1c82[_0x7f1e('0x31')],_0x2b1c82['query']);_0x56977c[_0x7f1e('0x35')]=_['intersection'](_0x2b1c82[_0x7f1e('0x31')],qs[_0x7f1e('0x36')](_0x57cc25[_0x7f1e('0x33')][_0x7f1e('0x36')]));_0x56977c[_0x7f1e('0x35')]=_0x56977c[_0x7f1e('0x35')][_0x7f1e('0x45')]?_0x56977c[_0x7f1e('0x35')]:_0x2b1c82[_0x7f1e('0x31')];if(_0x57cc25[_0x7f1e('0x33')][_0x7f1e('0x3e')]){_0x56977c[_0x7f1e('0x3f')]=[{'all':!![]}];}_0x56977c=_['merge']({},_0x56977c,_0x57cc25[_0x7f1e('0x46')]);return db[_0x7f1e('0x2e')][_0x7f1e('0x47')](_0x56977c)[_0x7f1e('0x27')](handleEntityNotFound(_0x22f371,null))[_0x7f1e('0x27')](respondWithResult(_0x22f371,null))['catch'](handleError(_0x22f371,null));};exports[_0x7f1e('0x48')]=function(_0xf18184,_0x3e1f5d){return db[_0x7f1e('0x2e')][_0x7f1e('0x48')](_0xf18184['body'],{})[_0x7f1e('0x27')](respondWithResult(_0x3e1f5d,0xc9))[_0x7f1e('0x41')](handleError(_0x3e1f5d,null));};exports[_0x7f1e('0x49')]=function(_0x4f59f5,_0x24ea86){var _0x5a5c6b={'where':{'id':_0x4f59f5[_0x7f1e('0x4a')]['id']}},_0x3fee81={};_0x3fee81['model']=_[_0x7f1e('0x32')](db['UserProfile'][_0x7f1e('0x43')]);_0x5a5c6b[_0x7f1e('0x35')]=_['intersection'](_0x3fee81[_0x7f1e('0x31')],qs['fields'](_0x4f59f5[_0x7f1e('0x33')]['fields']));_0x5a5c6b['attributes']=_0x5a5c6b[_0x7f1e('0x35')][_0x7f1e('0x45')]?_0x5a5c6b[_0x7f1e('0x35')]:_0x3fee81[_0x7f1e('0x31')];if(_0x4f59f5[_0x7f1e('0x33')][_0x7f1e('0x3e')]){_0x5a5c6b[_0x7f1e('0x3f')]=[{'all':!![]}];}_0x5a5c6b=_[_0x7f1e('0x3b')]({},_0x5a5c6b,_0x4f59f5[_0x7f1e('0x46')]);return db['UserProfile'][_0x7f1e('0x47')](_0x5a5c6b)['then'](handleEntityNotFound(_0x24ea86,null))['then'](function(_0x1a87fb){if(_0x1a87fb){var _0x2ce397=_0x1a87fb[_0x7f1e('0x4b')]({'plain':!![]});_0x2ce397=qs[_0x7f1e('0x4c')](_0x2ce397,['id',_0x7f1e('0x4d'),'updatedAt',_0x7f1e('0x4e')]);_0x4f59f5[_0x7f1e('0x4f')]=_[_0x7f1e('0x4c')](_0x4f59f5[_0x7f1e('0x4f')],['id',_0x7f1e('0x4d'),'updatedAt']);return db[_0x7f1e('0x50')][_0x7f1e('0x51')](function(_0x15db0a){return db['UserProfile'][_0x7f1e('0x48')](_[_0x7f1e('0x3b')](_0x2ce397,_0x4f59f5[_0x7f1e('0x4f')]),{'include':_0x4f59f5[_0x7f1e('0x33')][_0x7f1e('0x3e')]?[{'all':!![]}]:undefined,'transaction':_0x15db0a})[_0x7f1e('0x27')](function(_0x17c087){var _0x1f6ce3=_0x17c087[_0x7f1e('0x4b')]({'plain':!![]});return db[_0x7f1e('0x52')][_0x7f1e('0x40')]({'where':{'userProfileId':_0x4f59f5[_0x7f1e('0x4a')]['id']},'raw':!![]})['then'](function(_0x32650d){if(_0x32650d){return BPromise[_0x7f1e('0x53')](_0x32650d,function(_0x5c48ae){return new BPromise(function(_0x85b659,_0x333c15){if(_0x5c48ae[_0x7f1e('0x54')]===null||_0x5c48ae['autoAssociation']===0x1)_0x85b659(null);return db[_0x7f1e('0x55')][_0x7f1e('0x40')]({'where':{'sectionId':_0x5c48ae['id']},'raw':!![]})[_0x7f1e('0x27')](function(_0x5f8e01){var _0x1db358=_[_0x7f1e('0x2d')](_0x5f8e01,function(_0x25d298){return qs[_0x7f1e('0x4c')](_0x25d298,['id',_0x7f1e('0x4d'),_0x7f1e('0x56'),_0x7f1e('0x57')]);});_0x85b659(_0x1db358);})[_0x7f1e('0x41')](function(_0x5df9f2){_0x333c15(_0x5df9f2);});})[_0x7f1e('0x27')](function(_0x23024d){var _0x5b57a8=qs[_0x7f1e('0x4c')](_0x5c48ae,['id',_0x7f1e('0x4d'),'updatedAt']);_0x5b57a8[_0x7f1e('0x58')]=_0x1f6ce3['id'];if(_0x23024d)_0x5b57a8['Resources']=_0x23024d;return _0x5b57a8;})[_0x7f1e('0x27')](function(_0x7b305e){return db['UserProfileSection'][_0x7f1e('0x48')](_0x7b305e,{'include':[{'model':db[_0x7f1e('0x55')],'as':_0x7f1e('0x59')}],'raw':!![],'transaction':_0x15db0a});});})[_0x7f1e('0x27')](function(){return _0x1f6ce3;});}});});});}})[_0x7f1e('0x27')](respondWithResult(_0x24ea86,0xc9))[_0x7f1e('0x41')](handleError(_0x24ea86,null));};exports[_0x7f1e('0x26')]=function(_0xb6d703,_0x2ebb98){if(_0xb6d703[_0x7f1e('0x4f')]['id']){delete _0xb6d703[_0x7f1e('0x4f')]['id'];}return db[_0x7f1e('0x2e')]['find']({'where':{'id':_0xb6d703['params']['id']}})[_0x7f1e('0x27')](handleEntityNotFound(_0x2ebb98,null))[_0x7f1e('0x27')](saveUpdates(_0xb6d703[_0x7f1e('0x4f')],null))[_0x7f1e('0x27')](respondWithResult(_0x2ebb98,null))[_0x7f1e('0x41')](handleError(_0x2ebb98,null));};exports['destroy']=function(_0x2d674b,_0x54ed45){return db['UserProfile'][_0x7f1e('0x47')]({'where':{'id':_0x2d674b[_0x7f1e('0x4a')]['id']}})[_0x7f1e('0x27')](handleEntityNotFound(_0x54ed45,null))[_0x7f1e('0x27')](removeEntity(_0x54ed45,null))[_0x7f1e('0x41')](handleError(_0x54ed45,null));};exports[_0x7f1e('0x5a')]=function(_0x1a4ce5,_0xc79ddd){return db[_0x7f1e('0x2e')][_0x7f1e('0x5a')]()[_0x7f1e('0x27')](respondWithResult(_0xc79ddd,null))[_0x7f1e('0x41')](handleError(_0xc79ddd,null));};exports[_0x7f1e('0x5b')]=function(_0x348087,_0x3fe17c){var _0x2b9b13=_0x348087[_0x7f1e('0x4f')];return db[_0x7f1e('0x2e')][_0x7f1e('0x47')]({'where':{'id':_0x348087['params']['id']}})[_0x7f1e('0x27')](handleEntityNotFound(_0x3fe17c,null))[_0x7f1e('0x27')](function(_0x14da9e){if(_0x14da9e){return db[_0x7f1e('0x50')][_0x7f1e('0x51')](function(_0x5a69b0){return db[_0x7f1e('0x52')]['destroy']({'where':{'userProfileId':_0x348087[_0x7f1e('0x4a')]['id'],'sectionId':_[_0x7f1e('0x2d')](_0x2b9b13,function(_0x39c81f){return _0x39c81f['sectionId'];})},'transaction':_0x5a69b0})[_0x7f1e('0x27')](function(){var _0x14358b=_[_0x7f1e('0x2d')](_0x2b9b13,function(_0x37a50d){_0x37a50d['userProfileId']=_0x348087[_0x7f1e('0x4a')]['id'];return _0x37a50d;});var _0x5287d2=[];return BPromise[_0x7f1e('0x53')](_0x14358b,function(_0x339c57){return db[_0x7f1e('0x52')]['create'](_0x339c57,{'include':[{'model':db['UserProfileResource'],'as':_0x7f1e('0x59')}],'raw':!![],'transaction':_0x5a69b0})[_0x7f1e('0x27')](function(_0x270c0a){_0x5287d2[_0x7f1e('0x5c')](_0x270c0a['get']({'plain':!![]}));});})['then'](function(){return _0x5287d2;});});});}})['then'](function(_0x3bebf8){return _0x3bebf8;})[_0x7f1e('0x27')](respondWithResult(_0x3fe17c,null))[_0x7f1e('0x41')](handleError(_0x3fe17c,null));};exports[_0x7f1e('0x5d')]=function(_0x1d8c6f,_0x14935f){var _0x117ccc;return db[_0x7f1e('0x2e')][_0x7f1e('0x47')]({'where':{'id':_0x1d8c6f[_0x7f1e('0x4a')]['id']},'attributes':['id',_0x7f1e('0x2a')]})[_0x7f1e('0x27')](handleEntityNotFound(_0x14935f,null))[_0x7f1e('0x27')](function(_0x3fe522){if(_0x3fe522){_0x117ccc=_0x3fe522;return db['UserProfileSection'][_0x7f1e('0x5e')]({'where':{'userProfileId':_0x1d8c6f[_0x7f1e('0x4a')]['id'],'sectionId':_0x1d8c6f[_0x7f1e('0x33')][_0x7f1e('0x5f')]}});}})['then'](function(){return _0x117ccc;})[_0x7f1e('0x27')](respondWithStatusCode(_0x14935f,null))[_0x7f1e('0x41')](handleError(_0x14935f,null));};exports[_0x7f1e('0x60')]=function(_0x1858b3,_0xf82596){var _0x5bff2b=[];var _0x9d3178=[];return db[_0x7f1e('0x52')][_0x7f1e('0x40')]({'where':{'userProfileId':_0x1858b3[_0x7f1e('0x4a')]['id']},'raw':!![]})['then'](function(_0xa9f0ad){_0x5bff2b=_[_0x7f1e('0x3d')](_0xa9f0ad,function(_0x1fefec){return _0x1fefec[_0x7f1e('0x61')]===0x1||_['includes']([0x3eb,0x709],_0x1fefec[_0x7f1e('0x57')]);});if(!_[_0x7f1e('0x62')](_0x5bff2b)){return _['map'](_0x5bff2b,function(_0x4bc8f1){return _0x4bc8f1[_0x7f1e('0x57')];});}else{return;}})[_0x7f1e('0x27')](function(_0x3d8781){if(_0x3d8781)_0x9d3178=_0x3d8781;if(_[_0x7f1e('0x63')](_0x9d3178,0x64)){var _0x9bfe37=_[_0x7f1e('0x47')](_0x5bff2b,{'sectionId':0x64});return hasDefaultDashboard(_0x9bfe37)[_0x7f1e('0x27')](function(_0x5ad5c9){return _['map'](_0x5bff2b,function(_0x16f30e){if(_0x16f30e[_0x7f1e('0x57')]===0x64){_0x16f30e['subsections']=_0x5ad5c9;}return _0x16f30e;});});}else{return;}})[_0x7f1e('0x27')](function(_0xcae5e3){if(_0xcae5e3)_0x5bff2b=_0xcae5e3;if(_[_0x7f1e('0x63')](_0x9d3178,0x3eb)){var _0x4a8198=_['find'](_0x5bff2b,{'sectionId':0x3eb});return getCustomDashboards(_0x4a8198)[_0x7f1e('0x27')](function(_0x7f0a46){return _[_0x7f1e('0x2d')](_0x5bff2b,function(_0x3603d3){if(_0x4a8198['enabled']){if(_0x3603d3[_0x7f1e('0x57')]===0x3eb){_0x3603d3['subsections']=_0x7f0a46;}}else{if(_0x3603d3['sectionId']===0x64){if(!_0x3603d3[_0x7f1e('0x64')]){_0x3603d3[_0x7f1e('0x64')]=[];}_0x3603d3[_0x7f1e('0x64')]=_0x3603d3[_0x7f1e('0x64')]['concat'](_0x7f0a46);}}return _0x3603d3;});});}else{return;}})[_0x7f1e('0x27')](function(_0x21046c){if(_0x21046c)_0x5bff2b=_0x21046c;if(_['includes'](_0x9d3178,0x709)){var _0x1c98ed=_[_0x7f1e('0x47')](_0x5bff2b,{'sectionId':0x709});return getPlugins(_0x1c98ed)[_0x7f1e('0x27')](function(_0x12de7a){if(_0x1c98ed[_0x7f1e('0x61')]){return _[_0x7f1e('0x2d')](_0x5bff2b,function(_0x267c56){if(_0x267c56['sectionId']===0x709){_0x267c56[_0x7f1e('0x64')]=_0x12de7a;}return _0x267c56;});}else{var _0xb2dd63={'sectionId':0x76c,'enabled':0x1,'subsections':_0x12de7a};var _0x2f4440=_['map'](_0x5bff2b);_0x2f4440[_0x7f1e('0x5c')](_0xb2dd63);return _0x2f4440;}});}else{return;}})[_0x7f1e('0x27')](function(_0x5bf21e){if(_0x5bf21e)_0x5bff2b=_0x5bf21e;return _[_0x7f1e('0x3d')](_0x5bff2b,[_0x7f1e('0x61'),0x1]);})[_0x7f1e('0x27')](respondWithResult(_0xf82596,null))[_0x7f1e('0x41')](handleError(_0xf82596,null));};function hasDefaultDashboard(_0x22c31e){var _0x3c9177=[0x65];return new BPromise(function(_0x2fa879,_0x32ef20){try{if(_0x22c31e[_0x7f1e('0x54')]){_0x2fa879(_0x3c9177);}else{return db[_0x7f1e('0x55')][_0x7f1e('0x65')]({'where':{'sectionId':_0x22c31e['id']},'raw':!![]})[_0x7f1e('0x27')](function(_0x28239b){_0x28239b?_0x2fa879(_0x3c9177):_0x2fa879();});}}catch(_0x3a66cd){_0x32ef20(_0x3a66cd);}});}function getCustomDashboards(_0x34cf6c){var _0x1c27a8=[];return new BPromise(function(_0x1515f4,_0x167a9e){try{if(_0x34cf6c['autoAssociation']){return db[_0x7f1e('0x66')][_0x7f1e('0x40')]({'raw':!![]})[_0x7f1e('0x27')](function(_0x223da5){_0x223da5[_0x7f1e('0x67')](function(_0x539fae){_0x1c27a8[_0x7f1e('0x5c')](_0x539fae['id']+0x1869f);});_0x1515f4(_0x1c27a8);});}else{return db[_0x7f1e('0x55')][_0x7f1e('0x40')]({'where':{'sectionId':_0x34cf6c['id']},'raw':!![]})['then'](function(_0x417acc){_0x417acc[_0x7f1e('0x67')](function(_0x13a746){_0x1c27a8['push'](_0x13a746[_0x7f1e('0x68')]+0x1869f);});_0x1515f4(_0x1c27a8);});}}catch(_0x4477c5){_0x167a9e(_0x4477c5);}});}function getPlugins(_0x22dd33){var _0x13bb92=[];return new BPromise(function(_0x5ebd67,_0x2f4e6e){try{if(_0x22dd33['autoAssociation']){return db[_0x7f1e('0x69')]['findAll']({'raw':!![]})['then'](function(_0x314456){_0x314456[_0x7f1e('0x67')](function(_0x31df8b){_0x13bb92[_0x7f1e('0x5c')](_0x31df8b['id']+0x15b38);});_0x5ebd67(_0x13bb92);});}else{return db[_0x7f1e('0x55')][_0x7f1e('0x40')]({'where':{'sectionId':_0x22dd33['id']},'raw':!![]})[_0x7f1e('0x27')](function(_0x533248){_0x533248['forEach'](function(_0x3caebe){_0x13bb92[_0x7f1e('0x5c')](_0x3caebe[_0x7f1e('0x68')]+0x15b38);});_0x5ebd67(_0x13bb92);});}}catch(_0x563f65){_0x2f4e6e(_0x563f65);}});}exports[_0x7f1e('0x6a')]=function(_0x5d694a,_0x32c750){return db['UserProfile']['find']({'where':{'id':_0x5d694a[_0x7f1e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32c750,null))[_0x7f1e('0x27')](function(_0x1e6f1b){if(_0x1e6f1b){return db[_0x7f1e('0x50')][_0x7f1e('0x51')](function(_0x929645){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5d694a[_0x7f1e('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x7f1e('0x27')](function(_0x5177d0){if(_0x5177d0){return db['UserProfileSection'][_0x7f1e('0x5e')]({'where':{'userProfileId':_0x5d694a[_0x7f1e('0x4a')]['id'],'id':_[_0x7f1e('0x2d')](_0x5177d0,function(_0x485058){return _0x485058['id'];})},'transaction':_0x929645});}})[_0x7f1e('0x27')](function(_0x5613fb){var _0x2da530=_['map'](_0x5d694a[_0x7f1e('0x4f')],function(_0x561e75){_0x561e75['userProfileId']=_0x5d694a[_0x7f1e('0x4a')]['id'];return _0x561e75;});return db[_0x7f1e('0x52')][_0x7f1e('0x6b')](_0x2da530,{'raw':!![],'transaction':_0x929645});})[_0x7f1e('0x27')](function(_0x1a0e16){var _0x292581=_[_0x7f1e('0x3d')](_[_0x7f1e('0x2d')](_0x1a0e16,function(_0x35297b){return _0x35297b[_0x7f1e('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x292581){return db[_0x7f1e('0x52')]['findAll']({'where':{'userProfileId':_0x5d694a[_0x7f1e('0x4a')]['id'],'sectionId':_[_0x7f1e('0x2d')](_0x292581,function(_0x41b5b0){return _0x41b5b0['sectionId'];})},'attributes':['id',_0x7f1e('0x57')],'raw':!![]})[_0x7f1e('0x27')](function(_0x547466){var _0x18558c=_['map'](_0x5d694a[_0x7f1e('0x4f')],function(_0x2d9784){_0x2d9784[_0x7f1e('0x58')]=_0x5d694a['params']['id'];return _0x2d9784;});return db[_0x7f1e('0x55')][_0x7f1e('0x6b')](_0x18558c,{'raw':!![],'transaction':_0x929645});});}})['catch'](handleError(_0x32c750,null));});}})[_0x7f1e('0x27')](function(_0x71c0e0){var _0x57c0ae=_[_0x7f1e('0x2d')](_0x71c0e0,function(_0x36ab35){return _0x36ab35[_0x7f1e('0x4b')]({'plain':!![]});});})[_0x7f1e('0x27')](respondWithResult(_0x32c750,null))[_0x7f1e('0x41')](handleError(_0x32c750,null));};exports[_0x7f1e('0x6c')]=function(_0x434c78,_0x1c26e5,_0x20a940){return db[_0x7f1e('0x2e')]['find']({'where':{'id':_0x434c78[_0x7f1e('0x4a')]['id']}})[_0x7f1e('0x27')](handleEntityNotFound(_0x1c26e5,null))['then'](function(_0x5771b0){if(_0x5771b0){return _0x5771b0[_0x7f1e('0x6c')](_0x434c78[_0x7f1e('0x33')]['ids']);}})[_0x7f1e('0x27')](respondWithStatusCode(_0x1c26e5,null))[_0x7f1e('0x41')](handleError(_0x1c26e5,null));};exports[_0x7f1e('0x6d')]=function(_0x7b74b4,_0x414671){var _0x41199f={};if(!_0x7b74b4['query'][_0x7f1e('0x6e')])throw new Error('Missing\x20section\x20parameter');if(!_0x7b74b4[_0x7f1e('0x33')][_0x7f1e('0x37')](_0x7f1e('0x6f'))){_0x41199f[_0x7f1e('0x21')]=qs[_0x7f1e('0x21')](_0x7b74b4[_0x7f1e('0x33')][_0x7f1e('0x21')]);_0x41199f['offset']=qs[_0x7f1e('0x1f')](_0x7b74b4['query'][_0x7f1e('0x1f')]);}return db[_0x7f1e('0x2e')]['find']({'where':{'id':_0x7b74b4[_0x7f1e('0x4a')]['id']}})[_0x7f1e('0x27')](function(_0x4e1141){if(!_0x4e1141)throw new Error(_0x7f1e('0x70')+_0x7b74b4[_0x7f1e('0x4a')]['id']);return db[_0x7f1e('0x2e')][_0x7f1e('0x6d')](_0x7b74b4);})[_0x7f1e('0x27')](respondWithFilteredResult(_0x414671,_0x41199f))['catch'](handleError(_0x414671,null));}; \ No newline at end of file +var _0x15ed=['findAll','show','find','catch','create','clone','get','omit','updatedAt','crudPermissions','body','createdAt','sequelize','transaction','UserProfileSection','params','each','UserProfileResource','userProfileId','Resources','update','describe','destroy','sectionId','push','ids','isEmpty','includes','subsections','enabled','concat','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','then','end','error','name','send','index','UserProfile','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include'];(function(_0x3ec5e8,_0x4fa7f9){var _0xd556f0=function(_0x57c04a){while(--_0x57c04a){_0x3ec5e8['push'](_0x3ec5e8['shift']());}};_0xd556f0(++_0x4fa7f9);}(_0x15ed,0x1e6));var _0xd15e=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0x15ed[_0x4704dc];return _0x254d81;};'use strict';var emlformat=require(_0xd15e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd15e('0x1'));var jsonpatch=require(_0xd15e('0x2'));var rp=require(_0xd15e('0x3'));var moment=require(_0xd15e('0x4'));var BPromise=require(_0xd15e('0x5'));var Mustache=require(_0xd15e('0x6'));var util=require(_0xd15e('0x7'));var path=require('path');var sox=require(_0xd15e('0x8'));var csv=require(_0xd15e('0x9'));var ejs=require(_0xd15e('0xa'));var fs=require('fs');var fs_extra=require(_0xd15e('0xb'));var _=require(_0xd15e('0xc'));var squel=require('squel');var crypto=require(_0xd15e('0xd'));var jsforce=require(_0xd15e('0xe'));var deskjs=require(_0xd15e('0xf'));var toCsv=require(_0xd15e('0x9'));var querystring=require(_0xd15e('0x10'));var Papa=require(_0xd15e('0x11'));var Redis=require('ioredis');var authService=require(_0xd15e('0x12'));var qs=require(_0xd15e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd15e('0x14'))(_0xd15e('0x15'));var utils=require(_0xd15e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd15e('0x17'));var db=require(_0xd15e('0x18'))['db'];config[_0xd15e('0x19')]=_['defaults'](config[_0xd15e('0x19')],{'host':_0xd15e('0x1a'),'port':0x18eb});var socket=require(_0xd15e('0x1b'))(new Redis(config[_0xd15e('0x19')]));require(_0xd15e('0x1c'))['register'](socket);function respondWithStatusCode(_0x2b7fda,_0x193d27){_0x193d27=_0x193d27||0xcc;return function(_0x364630){if(_0x364630){return _0x2b7fda[_0xd15e('0x1d')](_0x193d27);}return _0x2b7fda[_0xd15e('0x1e')](_0x193d27)['end']();};}function respondWithResult(_0x2aceb4,_0x55d978){_0x55d978=_0x55d978||0xc8;return function(_0x15f473){if(_0x15f473){return _0x2aceb4['status'](_0x55d978)['json'](_0x15f473);}};}function respondWithFilteredResult(_0x5027b4,_0x3bafec){return function(_0x13fbfa){if(_0x13fbfa){var _0x3a42b4=typeof _0x3bafec[_0xd15e('0x1f')]===_0xd15e('0x20')&&typeof _0x3bafec[_0xd15e('0x21')]===_0xd15e('0x20');var _0x4063f8=_0x13fbfa['count'];var _0x38305a=_0x3a42b4?0x0:_0x3bafec['offset'];var _0x271f41=_0x3a42b4?_0x13fbfa['count']:_0x3bafec[_0xd15e('0x1f')]+_0x3bafec[_0xd15e('0x21')];var _0x5f8d0c;if(_0x271f41>=_0x4063f8){_0x271f41=_0x4063f8;_0x5f8d0c=0xc8;}else{_0x5f8d0c=0xce;}_0x5027b4[_0xd15e('0x1e')](_0x5f8d0c);return _0x5027b4[_0xd15e('0x22')](_0xd15e('0x23'),_0x38305a+'-'+_0x271f41+'/'+_0x4063f8)[_0xd15e('0x24')](_0x13fbfa);}return null;};}function patchUpdates(_0x1bb382){return function(_0x2b6fcc){try{jsonpatch[_0xd15e('0x25')](_0x2b6fcc,_0x1bb382,!![]);}catch(_0x143d6e){return BPromise[_0xd15e('0x26')](_0x143d6e);}return _0x2b6fcc['save']();};}function saveUpdates(_0x1065c8,_0x2f551f){return function(_0x4f8c59){if(_0x4f8c59){return _0x4f8c59['update'](_0x1065c8)['then'](function(_0x16356a){return _0x16356a;});}return null;};}function removeEntity(_0x38792b,_0x3ac2f4){return function(_0x159d3c){if(_0x159d3c){return _0x159d3c['destroy']()[_0xd15e('0x27')](function(){_0x38792b[_0xd15e('0x1e')](0xcc)[_0xd15e('0x28')]();});}};}function handleEntityNotFound(_0x1940f1,_0x52f69a){return function(_0x5eb662){if(!_0x5eb662){_0x1940f1[_0xd15e('0x1d')](0x194);}return _0x5eb662;};}function handleError(_0x1b0147,_0x230b6e){_0x230b6e=_0x230b6e||0x1f4;return function(_0x34592a){logger[_0xd15e('0x29')](_0x34592a['stack']);if(_0x34592a['name']){delete _0x34592a[_0xd15e('0x2a')];}_0x1b0147[_0xd15e('0x1e')](_0x230b6e)[_0xd15e('0x2b')](_0x34592a);};}exports[_0xd15e('0x2c')]=function(_0x721166,_0x380785){var _0x5bff13={},_0xc36a81={},_0xaaf0f0={'count':0x0,'rows':[]};var _0x3434d8=_['map'](db[_0xd15e('0x2d')][_0xd15e('0x2e')],function(_0x21bcb2){return{'name':_0x21bcb2['fieldName'],'type':_0x21bcb2[_0xd15e('0x2f')][_0xd15e('0x30')]};});_0xc36a81[_0xd15e('0x31')]=_[_0xd15e('0x32')](_0x3434d8,_0xd15e('0x2a'));_0xc36a81[_0xd15e('0x33')]=_[_0xd15e('0x34')](_0x721166['query']);_0xc36a81[_0xd15e('0x35')]=_[_0xd15e('0x36')](_0xc36a81[_0xd15e('0x31')],_0xc36a81[_0xd15e('0x33')]);_0x5bff13['attributes']=_[_0xd15e('0x36')](_0xc36a81[_0xd15e('0x31')],qs[_0xd15e('0x37')](_0x721166[_0xd15e('0x33')][_0xd15e('0x37')]));_0x5bff13['attributes']=_0x5bff13[_0xd15e('0x38')][_0xd15e('0x39')]?_0x5bff13[_0xd15e('0x38')]:_0xc36a81['model'];if(!_0x721166['query'][_0xd15e('0x3a')](_0xd15e('0x3b'))){_0x5bff13['limit']=qs[_0xd15e('0x21')](_0x721166['query'][_0xd15e('0x21')]);_0x5bff13['offset']=qs['offset'](_0x721166['query'][_0xd15e('0x1f')]);}_0x5bff13['order']=qs['sort'](_0x721166[_0xd15e('0x33')][_0xd15e('0x3c')]);_0x5bff13[_0xd15e('0x3d')]=qs[_0xd15e('0x35')](_['pick'](_0x721166[_0xd15e('0x33')],_0xc36a81['filters']),_0x3434d8);if(_0x721166['query'][_0xd15e('0x3e')]){_0x5bff13[_0xd15e('0x3d')]=_['merge'](_0x5bff13[_0xd15e('0x3d')],{'$or':_['map'](_0x3434d8,function(_0x39e37e){if(_0x39e37e[_0xd15e('0x2f')]!==_0xd15e('0x3f')){var _0x4f39a1={};_0x4f39a1[_0x39e37e[_0xd15e('0x2a')]]={'$like':'%'+_0x721166['query'][_0xd15e('0x3e')]+'%'};return _0x4f39a1;}})});}_0x5bff13=_[_0xd15e('0x40')]({},_0x5bff13,_0x721166[_0xd15e('0x41')]);var _0x5450e7={'where':_0x5bff13['where']};return db[_0xd15e('0x2d')][_0xd15e('0x42')](_0x5450e7)[_0xd15e('0x27')](function(_0x54094d){_0xaaf0f0[_0xd15e('0x42')]=_0x54094d;if(_0x721166[_0xd15e('0x33')][_0xd15e('0x43')]){_0x5bff13[_0xd15e('0x44')]=[{'all':!![]}];}return db[_0xd15e('0x2d')][_0xd15e('0x45')](_0x5bff13);})[_0xd15e('0x27')](function(_0x466caa){_0xaaf0f0['rows']=_0x466caa;return _0xaaf0f0;})[_0xd15e('0x27')](respondWithFilteredResult(_0x380785,_0x5bff13))['catch'](handleError(_0x380785,null));};exports[_0xd15e('0x46')]=function(_0x441c16,_0x576925){var _0x5e3b33={'raw':![],'where':{'id':_0x441c16['params']['id']}},_0x10c706={};_0x10c706[_0xd15e('0x31')]=_[_0xd15e('0x34')](db[_0xd15e('0x2d')][_0xd15e('0x2e')]);_0x10c706[_0xd15e('0x33')]=_[_0xd15e('0x34')](_0x441c16[_0xd15e('0x33')]);_0x10c706['filters']=_[_0xd15e('0x36')](_0x10c706[_0xd15e('0x31')],_0x10c706[_0xd15e('0x33')]);_0x5e3b33[_0xd15e('0x38')]=_[_0xd15e('0x36')](_0x10c706[_0xd15e('0x31')],qs[_0xd15e('0x37')](_0x441c16[_0xd15e('0x33')]['fields']));_0x5e3b33['attributes']=_0x5e3b33[_0xd15e('0x38')][_0xd15e('0x39')]?_0x5e3b33[_0xd15e('0x38')]:_0x10c706[_0xd15e('0x31')];if(_0x441c16[_0xd15e('0x33')][_0xd15e('0x43')]){_0x5e3b33['include']=[{'all':!![]}];}_0x5e3b33=_[_0xd15e('0x40')]({},_0x5e3b33,_0x441c16[_0xd15e('0x41')]);return db[_0xd15e('0x2d')][_0xd15e('0x47')](_0x5e3b33)[_0xd15e('0x27')](handleEntityNotFound(_0x576925,null))[_0xd15e('0x27')](respondWithResult(_0x576925,null))[_0xd15e('0x48')](handleError(_0x576925,null));};exports['create']=function(_0x1ae99f,_0x19cdaf){return db[_0xd15e('0x2d')][_0xd15e('0x49')](_0x1ae99f['body'],{})['then'](respondWithResult(_0x19cdaf,0xc9))[_0xd15e('0x48')](handleError(_0x19cdaf,null));};exports[_0xd15e('0x4a')]=function(_0xbddf97,_0x51e6dc){var _0x571ba1={'where':{'id':_0xbddf97['params']['id']}},_0x2e9e2c={};_0x2e9e2c[_0xd15e('0x31')]=_['keys'](db[_0xd15e('0x2d')]['rawAttributes']);_0x571ba1[_0xd15e('0x38')]=_[_0xd15e('0x36')](_0x2e9e2c['model'],qs[_0xd15e('0x37')](_0xbddf97['query'][_0xd15e('0x37')]));_0x571ba1[_0xd15e('0x38')]=_0x571ba1[_0xd15e('0x38')][_0xd15e('0x39')]?_0x571ba1[_0xd15e('0x38')]:_0x2e9e2c[_0xd15e('0x31')];if(_0xbddf97[_0xd15e('0x33')][_0xd15e('0x43')]){_0x571ba1[_0xd15e('0x44')]=[{'all':!![]}];}_0x571ba1=_['merge']({},_0x571ba1,_0xbddf97[_0xd15e('0x41')]);return db[_0xd15e('0x2d')][_0xd15e('0x47')](_0x571ba1)[_0xd15e('0x27')](handleEntityNotFound(_0x51e6dc,null))[_0xd15e('0x27')](function(_0x22a04f){if(_0x22a04f){var _0x231538=_0x22a04f[_0xd15e('0x4b')]({'plain':!![]});_0x231538=qs[_0xd15e('0x4c')](_0x231538,['id','createdAt',_0xd15e('0x4d'),_0xd15e('0x4e')]);_0xbddf97['body']=_[_0xd15e('0x4c')](_0xbddf97[_0xd15e('0x4f')],['id',_0xd15e('0x50'),_0xd15e('0x4d')]);return db[_0xd15e('0x51')][_0xd15e('0x52')](function(_0x5bc3c0){return db[_0xd15e('0x2d')][_0xd15e('0x49')](_['merge'](_0x231538,_0xbddf97[_0xd15e('0x4f')]),{'include':_0xbddf97[_0xd15e('0x33')][_0xd15e('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x5bc3c0})['then'](function(_0x29c317){var _0x4686fa=_0x29c317['get']({'plain':!![]});return db[_0xd15e('0x53')][_0xd15e('0x45')]({'where':{'userProfileId':_0xbddf97[_0xd15e('0x54')]['id']},'raw':!![]})[_0xd15e('0x27')](function(_0x494d7f){if(_0x494d7f){return BPromise[_0xd15e('0x55')](_0x494d7f,function(_0x44e8c5){return new BPromise(function(_0x3f0f20,_0x315c0f){if(_0x44e8c5['autoAssociation']===null||_0x44e8c5['autoAssociation']===0x1)_0x3f0f20(null);return db[_0xd15e('0x56')][_0xd15e('0x45')]({'where':{'sectionId':_0x44e8c5['id']},'raw':!![]})[_0xd15e('0x27')](function(_0x3f21b5){var _0x4242e3=_[_0xd15e('0x32')](_0x3f21b5,function(_0x5b50c8){return qs['omit'](_0x5b50c8,['id',_0xd15e('0x50'),'updatedAt','sectionId']);});_0x3f0f20(_0x4242e3);})[_0xd15e('0x48')](function(_0x388f0f){_0x315c0f(_0x388f0f);});})[_0xd15e('0x27')](function(_0x1ddf60){var _0x2c51b9=qs[_0xd15e('0x4c')](_0x44e8c5,['id',_0xd15e('0x50'),_0xd15e('0x4d')]);_0x2c51b9[_0xd15e('0x57')]=_0x4686fa['id'];if(_0x1ddf60)_0x2c51b9[_0xd15e('0x58')]=_0x1ddf60;return _0x2c51b9;})['then'](function(_0x1d0e56){return db[_0xd15e('0x53')][_0xd15e('0x49')](_0x1d0e56,{'include':[{'model':db[_0xd15e('0x56')],'as':_0xd15e('0x58')}],'raw':!![],'transaction':_0x5bc3c0});});})[_0xd15e('0x27')](function(){return _0x4686fa;});}});});});}})[_0xd15e('0x27')](respondWithResult(_0x51e6dc,0xc9))['catch'](handleError(_0x51e6dc,null));};exports[_0xd15e('0x59')]=function(_0x1da3b0,_0x3c018a){if(_0x1da3b0[_0xd15e('0x4f')]['id']){delete _0x1da3b0[_0xd15e('0x4f')]['id'];}return db[_0xd15e('0x2d')][_0xd15e('0x47')]({'where':{'id':_0x1da3b0[_0xd15e('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c018a,null))[_0xd15e('0x27')](saveUpdates(_0x1da3b0[_0xd15e('0x4f')],null))[_0xd15e('0x27')](respondWithResult(_0x3c018a,null))[_0xd15e('0x48')](handleError(_0x3c018a,null));};exports['destroy']=function(_0x1451be,_0x1a4f84){return db[_0xd15e('0x2d')][_0xd15e('0x47')]({'where':{'id':_0x1451be[_0xd15e('0x54')]['id']}})[_0xd15e('0x27')](handleEntityNotFound(_0x1a4f84,null))[_0xd15e('0x27')](removeEntity(_0x1a4f84,null))[_0xd15e('0x48')](handleError(_0x1a4f84,null));};exports[_0xd15e('0x5a')]=function(_0x310f2e,_0x31131b){return db[_0xd15e('0x2d')]['describe']()[_0xd15e('0x27')](respondWithResult(_0x31131b,null))['catch'](handleError(_0x31131b,null));};exports['addSections']=function(_0x1f0da,_0x4ebd8d){var _0x42a9e3=_0x1f0da[_0xd15e('0x4f')];return db[_0xd15e('0x2d')]['find']({'where':{'id':_0x1f0da[_0xd15e('0x54')]['id']}})[_0xd15e('0x27')](handleEntityNotFound(_0x4ebd8d,null))[_0xd15e('0x27')](function(_0x625307){if(_0x625307){return db[_0xd15e('0x51')]['transaction'](function(_0x28397b){return db['UserProfileSection'][_0xd15e('0x5b')]({'where':{'userProfileId':_0x1f0da[_0xd15e('0x54')]['id'],'sectionId':_[_0xd15e('0x32')](_0x42a9e3,function(_0x8677c4){return _0x8677c4[_0xd15e('0x5c')];})},'transaction':_0x28397b})[_0xd15e('0x27')](function(){var _0x169949=_[_0xd15e('0x32')](_0x42a9e3,function(_0x2f1d96){_0x2f1d96[_0xd15e('0x57')]=_0x1f0da[_0xd15e('0x54')]['id'];return _0x2f1d96;});var _0x546ab5=[];return BPromise[_0xd15e('0x55')](_0x169949,function(_0x2f9328){return db[_0xd15e('0x53')]['create'](_0x2f9328,{'include':[{'model':db[_0xd15e('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x28397b})[_0xd15e('0x27')](function(_0x3d12a9){_0x546ab5[_0xd15e('0x5d')](_0x3d12a9[_0xd15e('0x4b')]({'plain':!![]}));});})[_0xd15e('0x27')](function(){return _0x546ab5;});});});}})[_0xd15e('0x27')](function(_0x107b06){return _0x107b06;})[_0xd15e('0x27')](respondWithResult(_0x4ebd8d,null))['catch'](handleError(_0x4ebd8d,null));};exports['removeSections']=function(_0x16dc33,_0x513783){var _0x1a2b33;return db[_0xd15e('0x2d')][_0xd15e('0x47')]({'where':{'id':_0x16dc33[_0xd15e('0x54')]['id']},'attributes':['id','name']})[_0xd15e('0x27')](handleEntityNotFound(_0x513783,null))['then'](function(_0x327127){if(_0x327127){_0x1a2b33=_0x327127;return db[_0xd15e('0x53')][_0xd15e('0x5b')]({'where':{'userProfileId':_0x16dc33[_0xd15e('0x54')]['id'],'sectionId':_0x16dc33[_0xd15e('0x33')][_0xd15e('0x5e')]}});}})['then'](function(){return _0x1a2b33;})[_0xd15e('0x27')](respondWithStatusCode(_0x513783,null))['catch'](handleError(_0x513783,null));};exports['getSections']=function(_0x16d248,_0x50ddc5){var _0x46d08a=[];var _0x26587c=[];return db[_0xd15e('0x53')][_0xd15e('0x45')]({'where':{'userProfileId':_0x16d248[_0xd15e('0x54')]['id']},'raw':!![]})[_0xd15e('0x27')](function(_0x38af23){_0x46d08a=_['filter'](_0x38af23,function(_0x2f9520){return _0x2f9520['enabled']===0x1||_['includes']([0x3eb,0x709],_0x2f9520['sectionId']);});if(!_[_0xd15e('0x5f')](_0x46d08a)){return _['map'](_0x46d08a,function(_0x296119){return _0x296119[_0xd15e('0x5c')];});}else{return;}})[_0xd15e('0x27')](function(_0x267582){if(_0x267582)_0x26587c=_0x267582;if(_[_0xd15e('0x60')](_0x26587c,0x64)){var _0x57d03d=_[_0xd15e('0x47')](_0x46d08a,{'sectionId':0x64});return hasDefaultDashboard(_0x57d03d)[_0xd15e('0x27')](function(_0x2ccc1b){return _[_0xd15e('0x32')](_0x46d08a,function(_0x44ec68){if(_0x44ec68[_0xd15e('0x5c')]===0x64){_0x44ec68[_0xd15e('0x61')]=_0x2ccc1b;}return _0x44ec68;});});}else{return;}})[_0xd15e('0x27')](function(_0x2842d5){if(_0x2842d5)_0x46d08a=_0x2842d5;if(_[_0xd15e('0x60')](_0x26587c,0x3eb)){var _0x819e29=_[_0xd15e('0x47')](_0x46d08a,{'sectionId':0x3eb});return getCustomDashboards(_0x819e29)['then'](function(_0x2cc888){return _['map'](_0x46d08a,function(_0x2fe91d){if(_0x819e29[_0xd15e('0x62')]){if(_0x2fe91d[_0xd15e('0x5c')]===0x3eb){_0x2fe91d[_0xd15e('0x61')]=_0x2cc888;}}else{if(_0x2fe91d[_0xd15e('0x5c')]===0x64){if(!_0x2fe91d['subsections']){_0x2fe91d['subsections']=[];}_0x2fe91d['subsections']=_0x2fe91d[_0xd15e('0x61')][_0xd15e('0x63')](_0x2cc888);}}return _0x2fe91d;});});}else{return;}})[_0xd15e('0x27')](function(_0xc32813){if(_0xc32813)_0x46d08a=_0xc32813;if(_[_0xd15e('0x60')](_0x26587c,0x709)){var _0x4f920a=_[_0xd15e('0x47')](_0x46d08a,{'sectionId':0x709});return getPlugins(_0x4f920a)[_0xd15e('0x27')](function(_0x2aa130){if(_0x4f920a[_0xd15e('0x62')]){return _[_0xd15e('0x32')](_0x46d08a,function(_0x326b4){if(_0x326b4[_0xd15e('0x5c')]===0x709){_0x326b4[_0xd15e('0x61')]=_0x2aa130;}return _0x326b4;});}else{var _0x405367={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2aa130};var _0x10874e=_[_0xd15e('0x32')](_0x46d08a);_0x10874e[_0xd15e('0x5d')](_0x405367);return _0x10874e;}});}else{return;}})[_0xd15e('0x27')](function(_0x3cd595){if(_0x3cd595)_0x46d08a=_0x3cd595;return _['filter'](_0x46d08a,[_0xd15e('0x62'),0x1]);})[_0xd15e('0x27')](respondWithResult(_0x50ddc5,null))[_0xd15e('0x48')](handleError(_0x50ddc5,null));};function hasDefaultDashboard(_0xe5b5da){var _0x3e817a=[0x65];return new BPromise(function(_0x5cd266,_0x3ec9f4){try{if(_0xe5b5da[_0xd15e('0x64')]){_0x5cd266(_0x3e817a);}else{return db[_0xd15e('0x56')][_0xd15e('0x65')]({'where':{'sectionId':_0xe5b5da['id']},'raw':!![]})[_0xd15e('0x27')](function(_0x596d4d){_0x596d4d?_0x5cd266(_0x3e817a):_0x5cd266();});}}catch(_0x4f725e){_0x3ec9f4(_0x4f725e);}});}function getCustomDashboards(_0x9d7452){var _0x3135be=[];return new BPromise(function(_0x29a457,_0x2083d4){try{if(_0x9d7452['autoAssociation']){return db[_0xd15e('0x66')][_0xd15e('0x45')]({'raw':!![]})[_0xd15e('0x27')](function(_0x4cbcb7){_0x4cbcb7['forEach'](function(_0x3e031a){_0x3135be['push'](_0x3e031a['id']+0x1869f);});_0x29a457(_0x3135be);});}else{return db[_0xd15e('0x56')]['findAll']({'where':{'sectionId':_0x9d7452['id']},'raw':!![]})['then'](function(_0x55b2f7){_0x55b2f7[_0xd15e('0x67')](function(_0x1b66dd){_0x3135be['push'](_0x1b66dd[_0xd15e('0x68')]+0x1869f);});_0x29a457(_0x3135be);});}}catch(_0x1ab963){_0x2083d4(_0x1ab963);}});}function getPlugins(_0x4557b2){var _0x593918=[];return new BPromise(function(_0xc78504,_0x16a3f6){try{if(_0x4557b2[_0xd15e('0x64')]){return db[_0xd15e('0x69')]['findAll']({'raw':!![]})[_0xd15e('0x27')](function(_0x1a7fbb){_0x1a7fbb['forEach'](function(_0x18faeb){_0x593918[_0xd15e('0x5d')](_0x18faeb['id']+0x15b38);});_0xc78504(_0x593918);});}else{return db[_0xd15e('0x56')][_0xd15e('0x45')]({'where':{'sectionId':_0x4557b2['id']},'raw':!![]})[_0xd15e('0x27')](function(_0x580675){_0x580675[_0xd15e('0x67')](function(_0x2bddb1){_0x593918[_0xd15e('0x5d')](_0x2bddb1['resourceId']+0x15b38);});_0xc78504(_0x593918);});}}catch(_0xee7adb){_0x16a3f6(_0xee7adb);}});}exports[_0xd15e('0x6a')]=function(_0x42bbdb,_0x3a34e1){return db[_0xd15e('0x2d')][_0xd15e('0x47')]({'where':{'id':_0x42bbdb['params']['id']}})[_0xd15e('0x27')](handleEntityNotFound(_0x3a34e1,null))[_0xd15e('0x27')](function(_0x549675){if(_0x549675){return db['sequelize'][_0xd15e('0x52')](function(_0x33043f){return db['UserProfileSection'][_0xd15e('0x45')]({'where':{'userProfileId':_0x42bbdb['params']['id']},'attributes':['id'],'raw':!![]})[_0xd15e('0x27')](function(_0x53b628){if(_0x53b628){return db[_0xd15e('0x53')][_0xd15e('0x5b')]({'where':{'userProfileId':_0x42bbdb[_0xd15e('0x54')]['id'],'id':_[_0xd15e('0x32')](_0x53b628,function(_0x17c77c){return _0x17c77c['id'];})},'transaction':_0x33043f});}})[_0xd15e('0x27')](function(_0x4d7d03){var _0x47304b=_[_0xd15e('0x32')](_0x42bbdb[_0xd15e('0x4f')],function(_0x43a1db){_0x43a1db['userProfileId']=_0x42bbdb['params']['id'];return _0x43a1db;});return db[_0xd15e('0x53')][_0xd15e('0x6b')](_0x47304b,{'raw':!![],'transaction':_0x33043f});})[_0xd15e('0x27')](function(_0x2fcf6f){var _0x2955fa=_[_0xd15e('0x3e')](_[_0xd15e('0x32')](_0x2fcf6f,function(_0x546e49){return _0x546e49['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2955fa){return db[_0xd15e('0x53')]['findAll']({'where':{'userProfileId':_0x42bbdb[_0xd15e('0x54')]['id'],'sectionId':_[_0xd15e('0x32')](_0x2955fa,function(_0x11b883){return _0x11b883[_0xd15e('0x5c')];})},'attributes':['id',_0xd15e('0x5c')],'raw':!![]})[_0xd15e('0x27')](function(_0x14f5c8){var _0x16c762=_[_0xd15e('0x32')](_0x42bbdb['body'],function(_0x5539a7){_0x5539a7[_0xd15e('0x57')]=_0x42bbdb[_0xd15e('0x54')]['id'];return _0x5539a7;});return db[_0xd15e('0x56')][_0xd15e('0x6b')](_0x16c762,{'raw':!![],'transaction':_0x33043f});});}})[_0xd15e('0x48')](handleError(_0x3a34e1,null));});}})['then'](function(_0x4c9899){var _0x5716c8=_[_0xd15e('0x32')](_0x4c9899,function(_0x1f15b8){return _0x1f15b8[_0xd15e('0x4b')]({'plain':!![]});});})[_0xd15e('0x27')](respondWithResult(_0x3a34e1,null))[_0xd15e('0x48')](handleError(_0x3a34e1,null));};exports['removeResources']=function(_0x26ccf3,_0x482f59,_0x4cc9a0){return db[_0xd15e('0x2d')][_0xd15e('0x47')]({'where':{'id':_0x26ccf3[_0xd15e('0x54')]['id']}})[_0xd15e('0x27')](handleEntityNotFound(_0x482f59,null))[_0xd15e('0x27')](function(_0x2879e3){if(_0x2879e3){return _0x2879e3[_0xd15e('0x6c')](_0x26ccf3[_0xd15e('0x33')]['ids']);}})[_0xd15e('0x27')](respondWithStatusCode(_0x482f59,null))[_0xd15e('0x48')](handleError(_0x482f59,null));};exports[_0xd15e('0x6d')]=function(_0x411197,_0x4a6a44){var _0x50f973={};if(!_0x411197[_0xd15e('0x33')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x411197[_0xd15e('0x33')][_0xd15e('0x3a')](_0xd15e('0x3b'))){_0x50f973[_0xd15e('0x21')]=qs[_0xd15e('0x21')](_0x411197[_0xd15e('0x33')][_0xd15e('0x21')]);_0x50f973[_0xd15e('0x1f')]=qs[_0xd15e('0x1f')](_0x411197['query'][_0xd15e('0x1f')]);}return db['UserProfile'][_0xd15e('0x47')]({'where':{'id':_0x411197[_0xd15e('0x54')]['id']}})[_0xd15e('0x27')](function(_0x3a54d2){if(!_0x3a54d2)throw new Error(_0xd15e('0x6e')+_0x411197['params']['id']);return db['UserProfile'][_0xd15e('0x6d')](_0x411197);})[_0xd15e('0x27')](respondWithFilteredResult(_0x4a6a44,_0x50f973))['catch'](handleError(_0x4a6a44,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9e88bce..e49ada0 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 _0x9af6=['hook','exports','events','../../mysqldb','UserProfile','update','emit'];(function(_0x575f36,_0x3e723a){var _0x491712=function(_0x5f1a5c){while(--_0x5f1a5c){_0x575f36['push'](_0x575f36['shift']());}};_0x491712(++_0x3e723a);}(_0x9af6,0x1d7));var _0x69af=function(_0x41444f,_0x12a5ae){_0x41444f=_0x41444f-0x0;var _0x40250c=_0x9af6[_0x41444f];return _0x40250c;};'use strict';var EventEmitter=require(_0x69af('0x0'));var UserProfile=require(_0x69af('0x1'))['db'][_0x69af('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x69af('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5e0e6b){return function(_0x185b85,_0x11f0e4,_0x2b73be){UserProfileEvents['emit'](_0x5e0e6b+':'+_0x185b85['id'],_0x185b85);UserProfileEvents[_0x69af('0x4')](_0x5e0e6b,_0x185b85);_0x2b73be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x69af('0x5')](e,emitEvent(event));}}module[_0x69af('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x002d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','update','remove'];(function(_0x1e1297,_0x5ecca8){var _0x5b8654=function(_0xfbc015){while(--_0xfbc015){_0x1e1297['push'](_0x1e1297['shift']());}};_0x5b8654(++_0x5ecca8);}(_0x002d,0xca));var _0xd002=function(_0x409846,_0xeb3235){_0x409846=_0x409846-0x0;var _0x357bdf=_0x002d[_0x409846];return _0x357bdf;};'use strict';var EventEmitter=require(_0xd002('0x0'));var UserProfile=require(_0xd002('0x1'))['db'][_0xd002('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd002('0x3'),'afterDestroy':_0xd002('0x4')};function emitEvent(_0x1c0d0a){return function(_0x24ff42,_0x1323f0,_0x179915){UserProfileEvents[_0xd002('0x5')](_0x1c0d0a+':'+_0x24ff42['id'],_0x24ff42);UserProfileEvents[_0xd002('0x5')](_0x1c0d0a,_0x24ff42);_0x179915(null);};}for(var e in events){if(events[_0xd002('0x6')](e)){var event=events[e];UserProfile[_0xd002('0x7')](e,emitEvent(event));}}module[_0xd002('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 95738c0..c57a91d 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 _0x9c5d=['section','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','ignore','union','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','sort','pick','merge','foreignKey','includeAll','include','forEach','default','DefaultReports','custom','count','ids','customSorting','order','extraQueryConditions','Tags','color','tag','Tag','ThroughTags','openTabs','chat','rows','sms','dataValues','mail','openchannel','lodash','./userProfile.attributes','exports','models','filter','value','associatedResources','map','catch','field','model','findAll','then','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','FaxAccount','inboundroutes','contexts','VoiceMail','voicerecordings','VoiceRecording','Agents','role','agent','Telephones','membername','User','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','VoiceQueues','QueueCampaigns','users','agents','telephones','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','Schedule','sounds','Sound','templates','Template','triggers','Trigger','trunks','variables','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','query'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0x9c5d,0x1a6));var _0xd9c5=function(_0x220d63,_0x2ac173){_0x220d63=_0x220d63-0x0;var _0xffccaa=_0x9c5d[_0x220d63];return _0xffccaa;};'use strict';var _=require(_0xd9c5('0x0'));var attributes=require(_0xd9c5('0x1'));var squel=require('squel');module[_0xd9c5('0x2')]=function(_0x266b78){var _0x30f9b8=_0x266b78[_0xd9c5('0x3')];function _0x166826(_0x3c9acf,_0x2b1525){return new Promise(function(_0x96b17,_0x3021be){if(!_0x2b1525)return _0x96b17(null);var _0x270b67=_0x2b1525[_0xd9c5('0x4')]?{[_0x2b1525['filter']['field']]:_0x2b1525[_0xd9c5('0x4')][_0xd9c5('0x5')]}:undefined;return _0x30f9b8[_0x3c9acf]['findAll']({'where':_0x270b67,'raw':!![]})['then'](function(_0x5b1657){_0x2b1525[_0xd9c5('0x6')]=_[_0xd9c5('0x7')](_0x5b1657,'id');_0x96b17(_0x2b1525);})[_0xd9c5('0x8')](function(_0x406ce3){_0x3021be(_0x406ce3);});});}function _0x41dcb5(_0x4f830b,_0x38bbde){return new Promise(function(_0x5af230,_0x51450f){var _0xa10526=_0x4f830b[_0xd9c5('0x4')]?{[_0x4f830b['filter'][_0xd9c5('0x9')]]:_0x4f830b[_0xd9c5('0x4')][_0xd9c5('0x5')]}:undefined;return _0x30f9b8[_0x4f830b[_0xd9c5('0xa')]][_0xd9c5('0xb')]({'where':_0xa10526,'raw':!![]})[_0xd9c5('0xc')](function(_0x12a8c2){_0x38bbde[_0xd9c5('0x6')]=_[_0xd9c5('0x7')](_0x12a8c2,function(_0x1ac70c){return _0x1ac70c[_0xd9c5('0xd')];});_0x5af230(_0x38bbde);})[_0xd9c5('0x8')](function(_0x2f9793){_0x51450f(_0x2f9793);});});}function _0x823516(_0x2b7da0,_0x122a66,_0x4e9855){if(!_0x122a66)return Promise[_0xd9c5('0xe')](null);return new Promise(function(_0x31f912,_0x40516f){return _0x30f9b8[_0xd9c5('0xf')]['findAll']({'where':{'sectionId':_0x122a66['id']},'raw':!![]})['then'](function(_0x15bdd2){if(_0x2b7da0[_0xd9c5('0x9')]&&_0x2b7da0[_0xd9c5('0x9')]!=='id'){_0x122a66['associatedResources']=_[_0xd9c5('0x7')](_0x15bdd2,function(_0x5233ef){return _0x5233ef[_0x2b7da0[_0xd9c5('0x9')]];});}else{if(_0x4e9855===_0xd9c5('0x10')){_0x122a66[_0xd9c5('0x6')]=_['map'](_0x15bdd2,function(_0x20dd88){return{'id':_0x20dd88[_0xd9c5('0x11')],'type':_0x20dd88[_0xd9c5('0x12')]};});}else{_0x122a66[_0xd9c5('0x6')]=_[_0xd9c5('0x7')](_0x15bdd2,function(_0x1cb662){return _0x1cb662[_0xd9c5('0x11')];});}}_0x31f912(_0x122a66);})[_0xd9c5('0x8')](function(_0x43ae41){_0x40516f(_0x43ae41);});});}function _0x2ab8cf(_0x20f30c,_0x27dd1e){var _0x16e6db={'parentSections':[]};switch(_0x20f30c[_0xd9c5('0x13')]()){case _0xd9c5('0x14'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x16');break;case _0xd9c5('0x17'):_0x16e6db[_0xd9c5('0x15')]='SquareOdbc';break;case _0xd9c5('0x18'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x19');_0x16e6db[_0xd9c5('0x1a')]=[{'name':_0xd9c5('0x1b'),'field':_0xd9c5('0xd'),'foreignKey':'projectName'}];break;case _0xd9c5('0x1c'):_0x16e6db['childModel']=_0xd9c5('0x1d');break;case'contacts':_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x1e');_0x16e6db[_0xd9c5('0x1a')]=[{'name':_0xd9c5('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0xd9c5('0x20'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x21');break;case _0xd9c5('0x22'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x23');break;case _0xd9c5('0x24'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x25');break;case _0xd9c5('0x26'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x27');break;case _0xd9c5('0x28'):_0x16e6db[_0xd9c5('0x15')]='ChatWebsite';break;case'faxqueues':_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x29');break;case'faxaccounts':_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x2a');break;case _0xd9c5('0x2b'):case'internalroutes':case'outboundroutes':_0x16e6db[_0xd9c5('0x15')]='VoiceExtension';break;case _0xd9c5('0x2c'):_0x16e6db['childModel']='VoiceContext';break;case'voicemails':_0x16e6db['childModel']=_0xd9c5('0x2d');break;case _0xd9c5('0x2e'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x2f');_0x16e6db[_0xd9c5('0x1a')]=[{'name':_0xd9c5('0x30'),'field':_0xd9c5('0xd'),'foreignKey':'membername','model':'User','filter':{'field':_0xd9c5('0x31'),'value':[_0xd9c5('0x32')]}},{'name':_0xd9c5('0x33'),'field':_0xd9c5('0xd'),'foreignKey':_0xd9c5('0x34'),'model':_0xd9c5('0x35'),'filter':{'field':_0xd9c5('0x31'),'value':['telephone']}},{'name':'VoiceQueues','field':'name','foreignKey':_0xd9c5('0x36'),'model':_0xd9c5('0x37'),'filter':{'field':'type','value':[_0xd9c5('0x38')]}},{'name':'QueueCampaigns','field':_0xd9c5('0xd'),'foreignKey':_0xd9c5('0x36'),'model':'VoiceQueue','filter':{'field':_0xd9c5('0x12'),'value':[_0xd9c5('0x39')]}}];break;case _0xd9c5('0x3a'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x3b');break;case _0xd9c5('0x3c'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x3d');break;case'voiceprefixes':_0x16e6db['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x16e6db['childModel']=_0xd9c5('0x3e');break;case _0xd9c5('0x3f'):_0x16e6db[_0xd9c5('0x15')]='MailQueue';break;case _0xd9c5('0x40'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x41');break;case _0xd9c5('0x42'):_0x16e6db['childModel']=_0xd9c5('0x43');break;case _0xd9c5('0x44'):_0x16e6db['childModel']=_0xd9c5('0x45');break;case _0xd9c5('0x46'):_0x16e6db[_0xd9c5('0x15')]='OpenchannelAccount';break;case _0xd9c5('0x47'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x48');break;case _0xd9c5('0x49'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x4a');break;case'whatsappqueues':_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x4b');break;case _0xd9c5('0x4c'):_0x16e6db[_0xd9c5('0x15')]='WhatsappAccount';break;case _0xd9c5('0x4d'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x4e');break;case _0xd9c5('0x4f'):case _0xd9c5('0x50'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x37');if(_0x27dd1e){_0x16e6db[_0xd9c5('0x1a')]=[{'name':_0xd9c5('0x51')},{'name':_0xd9c5('0x52')}];}break;case _0xd9c5('0x53'):case _0xd9c5('0x54'):case _0xd9c5('0x55'):_0x16e6db['childModel']='User';if(_0x27dd1e){_0x16e6db[_0xd9c5('0x1a')]=[{'name':'Users','filter':{'field':_0xd9c5('0x31'),'value':['admin',_0xd9c5('0x56')]},'ignore':!![]},{'name':_0xd9c5('0x30')},{'name':_0xd9c5('0x33')}];}break;case _0xd9c5('0x57'):_0x16e6db['childModel']=_0xd9c5('0x58');break;case _0xd9c5('0x59'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x5a');break;case _0xd9c5('0x5b'):_0x16e6db['childModel']=_0xd9c5('0x5c');break;case'sugarcrmaccounts':_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x5d');break;case _0xd9c5('0x5e'):_0x16e6db['childModel']=_0xd9c5('0x5f');break;case _0xd9c5('0x60'):_0x16e6db['childModel']=_0xd9c5('0x61');break;case'vtigeraccounts':_0x16e6db['childModel']='User';break;case _0xd9c5('0x62'):_0x16e6db['childModel']=_0xd9c5('0x63');break;case _0xd9c5('0x64'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x65');break;case _0xd9c5('0x66'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x67');break;case'intervals':_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x68');break;case _0xd9c5('0x69'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x6a');break;case'scheduler':_0x16e6db['childModel']=_0xd9c5('0x6b');break;case _0xd9c5('0x6c'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x6d');break;case'tags':_0x16e6db['childModel']='Tag';break;case _0xd9c5('0x6e'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x6f');break;case _0xd9c5('0x70'):_0x16e6db['childModel']=_0xd9c5('0x71');break;case _0xd9c5('0x72'):_0x16e6db['childModel']='Trunk';break;case _0xd9c5('0x73'):_0x16e6db[_0xd9c5('0x15')]='Variable';break;case _0xd9c5('0x74'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x75');break;case'extractedreports':_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x10');_0x16e6db['parentSections']=[{'name':_0xd9c5('0x76'),'field':'id','foreignKey':_0xd9c5('0x77')}];break;case _0xd9c5('0x78'):_0x16e6db[_0xd9c5('0x15')]=_0xd9c5('0x79');break;}return _0x16e6db;}function _0x177709(_0x18ddd2,_0x848b66){var _0x18f1fc=_0x18ddd2[_0xd9c5('0x7a')](0x0)['toUpperCase']()+_0x18ddd2[_0xd9c5('0x7b')](0x1);var _0xeabaf6={'type':_0x30f9b8[_0xd9c5('0x7c')]['QueryTypes'][_0xd9c5('0x7d')],'raw':!![]};return new Promise(function(_0x1f4574,_0x3865ef){var _0x2f7b62=squel[_0xd9c5('0x7e')]()[_0xd9c5('0x9')]('ui.'+_0x18f1fc+_0xd9c5('0x7f'),'id')[_0xd9c5('0x9')](_0xd9c5('0x80'))[_0xd9c5('0x81')](_0xd9c5('0x82')+_0x18ddd2+_0xd9c5('0x83'),'ui')[_0xd9c5('0x84')](_0xd9c5('0x85'),_0x848b66['id']);return _0x30f9b8[_0xd9c5('0x86')]['query'](_0x2f7b62[_0xd9c5('0x87')](),_0xeabaf6)[_0xd9c5('0xc')](function(_0xe30e29){_0x848b66[_0x18f1fc+_0xd9c5('0x88')]=_0xe30e29;_0x1f4574(_0xe30e29);})[_0xd9c5('0x8')](function(_0x35dff3){_0x3865ef(_0x35dff3);});});}return _0x266b78[_0xd9c5('0x89')](_0xd9c5('0x8a'),attributes,{'tableName':_0xd9c5('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2db852){var _0x5ee679=require(_0xd9c5('0x8c'));var _0x355b37={'raw':_0x2db852[_0xd9c5('0x8d')]['raw'],'where':{}};var _0x9af766={};var _0x6ed87e={'count':0x0,'rows':[]};var _0x367b60=_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0x8e')];var _0x549d4e=_0x2db852['query']['mergeResources']||![];var _0x44198e=_0x2ab8cf(_0x367b60,_0x549d4e);if(!_0x44198e[_0xd9c5('0x15')])throw new Error(_0xd9c5('0x8f')+_0x367b60+'\x27');var _0x4f2478=[{'name':_0x367b60}];if(!_[_0xd9c5('0x90')](_0x44198e[_0xd9c5('0x1a')]))_0x4f2478=_0x44198e[_0xd9c5('0x1a')];var _0x512c6b=[];for(var _0x500900=0x0;_0x500900<_0x4f2478[_0xd9c5('0x91')];_0x500900++){_0x512c6b[_0xd9c5('0x92')](_0x30f9b8['UserProfileSection'][_0xd9c5('0x93')]({'where':{'userProfileId':_0x2db852[_0xd9c5('0x94')]['id'],'name':_0x4f2478[_0x500900][_0xd9c5('0xd')]},'raw':!![]}));}return Promise['all'](_0x512c6b)[_0xd9c5('0xc')](function(_0x5a86a7){var _0x244622=_['filter'](_0x5a86a7,function(_0x177974){return _0x177974?_0x177974:undefined;});var _0x64aaa6=_['filter'](_0x4f2478,[_0xd9c5('0x95'),!![]]);var _0x580001=_[_0xd9c5('0x90')](_0x244622)&&_[_0xd9c5('0x90')](_0x64aaa6)?null:_[_0xd9c5('0x96')](_0x64aaa6,_0x244622);if(!_0x580001)return null;var _0x223a0a=[];for(var _0x35f9b8=0x0;_0x35f9b8<_0x580001['length'];_0x35f9b8++){var _0x2f1d9c=_[_0xd9c5('0x93')](_0x4f2478,function(_0x209d08){return _0x580001[_0x35f9b8]?_0x209d08[_0xd9c5('0xd')]===_0x580001[_0x35f9b8][_0xd9c5('0xd')]:null;});if(_0x2f1d9c){if(_0x580001[_0x35f9b8][_0xd9c5('0x95')]){_0x223a0a[_0xd9c5('0x92')](_0x166826(_0x44198e[_0xd9c5('0x15')],_0x580001[_0x35f9b8]));}else{if(!_0x580001[_0x35f9b8][_0xd9c5('0x97')]){_0x223a0a[_0xd9c5('0x92')](_0x823516(_0x2f1d9c,_0x580001[_0x35f9b8],_0x44198e[_0xd9c5('0x15')]));}else{if(_0x2f1d9c['model']){_0x223a0a['push'](_0x41dcb5(_0x2f1d9c,_0x580001[_0x35f9b8]));}}}}}return Promise[_0xd9c5('0x98')](_0x223a0a);})[_0xd9c5('0xc')](function(_0x264308){var _0x26c2c0=_0x264308;var _0x48f753=null;if(_0x26c2c0){_0x48f753=_0x26c2c0[_0xd9c5('0x91')]===0x1?_0x26c2c0[0x0]:null;}if(!_0x48f753&&!_0x26c2c0)return _0x6ed87e;var _0x4c0a4f=_0x30f9b8[_0x44198e[_0xd9c5('0x15')]][_0xd9c5('0x99')];_0x9af766['model']=_['keys'](_0x4c0a4f);_0x9af766[_0xd9c5('0x8d')]=_[_0xd9c5('0x9a')](_0x2db852[_0xd9c5('0x8d')]);_0x9af766[_0xd9c5('0x9b')]=_[_0xd9c5('0x9c')](_0x9af766['model'],_0x9af766[_0xd9c5('0x8d')]);_0x355b37[_0xd9c5('0x9d')]=_['intersection'](_0x9af766[_0xd9c5('0xa')],_0x5ee679['fields'](_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0x9e')]));_0x355b37[_0xd9c5('0x9d')]=_0x355b37['attributes'][_0xd9c5('0x91')]?_0x355b37['attributes']:_0x9af766[_0xd9c5('0xa')];if(!_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0x9f')]('nolimit')){_0x355b37['limit']=_0x5ee679['limit'](_0x2db852['query']['limit']);_0x355b37['offset']=_0x5ee679[_0xd9c5('0xa0')](_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xa0')]);}_0x355b37['order']=_0x5ee679[_0xd9c5('0xa1')](_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xa1')]);_0x355b37['where']=_0x5ee679[_0xd9c5('0x9b')](_[_0xd9c5('0xa2')](_0x2db852[_0xd9c5('0x8d')],_0x9af766['filters']));if(_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0x4')]){_0x355b37[_0xd9c5('0x84')]=_[_0xd9c5('0xa3')](_0x355b37[_0xd9c5('0x84')],{'$or':_['map'](_0x4c0a4f,function(_0x2b799c){if(_0x2b799c['type']['key']!=='VIRTUAL'){var _0x5abda9={};_0x5abda9[_0x2b799c['field']]={'$like':'%'+_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0x4')]+'%'};return _0x5abda9;}})});}var _0x4ab1cd=[];var _0x450f7b=null;var _0x233817={};if(_0x48f753){_0x450f7b=_[_0xd9c5('0x93')](_0x4f2478,[_0xd9c5('0xd'),_0x48f753[_0xd9c5('0xd')]]);if(_0x450f7b[_0xd9c5('0x9')]){_0x233817={};if(_0x44198e[_0xd9c5('0x15')]===_0xd9c5('0x10')){_0x233817[_0x450f7b[_0xd9c5('0xa4')]]=_['map'](_0x48f753['associatedResources'],'id');}else{_0x233817[_0x450f7b[_0xd9c5('0xa4')]]=_0x48f753[_0xd9c5('0x6')];}_0x4ab1cd[_0xd9c5('0x92')](_0x233817);}else{_0x355b37[_0xd9c5('0x84')]['id']=_0x48f753[_0xd9c5('0x6')];}}else{for(var _0xf514d8=0x0;_0xf514d8<_0x26c2c0['length'];_0xf514d8++){_0x450f7b=_[_0xd9c5('0x93')](_0x4f2478,[_0xd9c5('0xd'),_0x26c2c0[_0xf514d8][_0xd9c5('0xd')]]);if(_0x450f7b['field']){_0x233817={};_0x233817[_0x450f7b[_0xd9c5('0xa4')]]=_0x26c2c0[_0xf514d8][_0xd9c5('0x6')];_0x4ab1cd[_0xd9c5('0x92')](_0x233817);}else{if(!_0x355b37[_0xd9c5('0x84')]['id'])_0x355b37['where']['id']=[];_0x26c2c0[_0xf514d8][_0xd9c5('0x6')]['forEach'](function(_0x298185){_0x355b37[_0xd9c5('0x84')]['id'][_0xd9c5('0x92')](_0x298185);});}}}if(!_[_0xd9c5('0x90')](_0x4ab1cd)){_0x355b37[_0xd9c5('0x84')]=_[_0xd9c5('0xa3')](_0x355b37['where'],{'$and':{'$or':_0x4ab1cd}});}_0x355b37=_['merge']({},_0x355b37,_0x2db852['options']);if(_0x48f753&&!_0x48f753[_0xd9c5('0x97')]&&_0x44198e[_0xd9c5('0x15')]===_0xd9c5('0x10')){if(_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xa5')]){_0x355b37[_0xd9c5('0xa6')]=[{'all':!![]}];}return _0x30f9b8[_0x44198e[_0xd9c5('0x15')]][_0xd9c5('0xb')](_0x355b37)['then'](function(_0x4c37fd){var _0x5a5abf=[];_0x4c37fd[_0xd9c5('0xa7')](function(_0x32b0d9){var _0x154e84;switch(_0x32b0d9['reportType']){case _0xd9c5('0xa8'):_0x154e84=_['find'](_0x48f753[_0xd9c5('0x6')],function(_0xb68695){return _0xb68695['id']===_0x32b0d9[_0xd9c5('0x77')]&&_0xb68695['type']===_0xd9c5('0xa9');});break;case _0xd9c5('0xaa'):_0x154e84=_[_0xd9c5('0x93')](_0x48f753[_0xd9c5('0x6')],function(_0x204fe3){return _0x204fe3['id']===_0x32b0d9[_0xd9c5('0x77')]&&_0x204fe3[_0xd9c5('0x12')]==='CustomReports';});break;}if(_0x154e84)_0x5a5abf['push'](_0x32b0d9);});_0x6ed87e[_0xd9c5('0xab')]=_0x5a5abf[_0xd9c5('0x91')];_0x6ed87e['rows']=_0x5a5abf;return _0x6ed87e;});}else{if(!_['isEmpty'](_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xac')])){_0x355b37['where']['id']=_0x355b37['where']['id']?_[_0xd9c5('0x9c')](_0x355b37['where']['id'],_0x2db852[_0xd9c5('0x8d')]['ids']):_0x2db852[_0xd9c5('0x8d')]['ids'];if(_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xad')]){_0x355b37[_0xd9c5('0xae')]=_0x2db852['query'][_0xd9c5('0xad')];}}if(_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xaf')]){_0x355b37[_0xd9c5('0x84')]=_[_0xd9c5('0xa3')](_0x355b37[_0xd9c5('0x84')],{'$and':_0x2db852['query']['extraQueryConditions']});}return _0x30f9b8[_0x44198e[_0xd9c5('0x15')]][_0xd9c5('0xab')]({'where':_0x355b37['where']})['then'](function(_0x542445){_0x6ed87e[_0xd9c5('0xab')]=_0x542445;if(_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xa5')]){if(_0x44198e['childModel']==='CmContact'){_0x355b37[_0xd9c5('0xa6')]=[{'model':_0x30f9b8['Tag'],'as':_0xd9c5('0xb0'),'attributes':['id',_0xd9c5('0xd'),_0xd9c5('0xb1')],'required':_0x2db852['query'][_0xd9c5('0xb2')]?!![]:![]},{'model':_0x30f9b8[_0xd9c5('0xb3')],'as':_0xd9c5('0xb4'),'attributes':['id',_0xd9c5('0xd'),_0xd9c5('0xb1')],'through':_0x2db852[_0xd9c5('0x8d')]['tag']?{'attributes':[],'where':{'TagId':_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xb2')]||undefined}}:{},'required':_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xb2')]?!![]:![]}];}else{_0x355b37[_0xd9c5('0xa6')]=[{'all':!![]}];}}return _0x30f9b8[_0x44198e['childModel']][_0xd9c5('0xb')](_0x355b37);})[_0xd9c5('0xc')](function(_0x343843){_0x6ed87e['rows']=_0x343843;if(_0x367b60===_0xd9c5('0x30')&&_0x2db852[_0xd9c5('0x8d')][_0xd9c5('0xb5')]==='true'){var _0x204f69=[];for(var _0x453925=0x0;_0x453925<_0x6ed87e['rows']['length'];_0x453925++){_0x204f69['push'](_0x177709(_0xd9c5('0xb6'),_0x6ed87e[_0xd9c5('0xb7')][_0x453925]['dataValues']));_0x204f69[_0xd9c5('0x92')](_0x177709(_0xd9c5('0xb8'),_0x6ed87e[_0xd9c5('0xb7')][_0x453925]['dataValues']));_0x204f69[_0xd9c5('0x92')](_0x177709('fax',_0x6ed87e[_0xd9c5('0xb7')][_0x453925][_0xd9c5('0xb9')]));_0x204f69[_0xd9c5('0x92')](_0x177709(_0xd9c5('0xba'),_0x6ed87e[_0xd9c5('0xb7')][_0x453925][_0xd9c5('0xb9')]));_0x204f69['push'](_0x177709(_0xd9c5('0xbb'),_0x6ed87e[_0xd9c5('0xb7')][_0x453925][_0xd9c5('0xb9')]));_0x204f69[_0xd9c5('0x92')](_0x177709('whatsapp',_0x6ed87e[_0xd9c5('0xb7')][_0x453925][_0xd9c5('0xb9')]));}return Promise[_0xd9c5('0x98')](_0x204f69)['then'](function(){return _0x6ed87e;});}return _0x6ed87e;});}});}}});}; \ No newline at end of file +var _0x03cc=['WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','telephones','Users','admin','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','sounds','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','ignore','isEmpty','union','autoAssociation','all','rawAttributes','model','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','merge','key','foreignKey','forEach','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','include','tag','ThroughTags','true','chat','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','exports','models','filter','field','findAll','then','map','catch','value','associatedResources','name','UserProfileResource','type','resourceId','squareprojects','childModel','SquareProject','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','Agents','membername','User','role','agent','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues'];(function(_0x466f51,_0x1393ed){var _0x2db305=function(_0x126ae3){while(--_0x126ae3){_0x466f51['push'](_0x466f51['shift']());}};_0x2db305(++_0x1393ed);}(_0x03cc,0x74));var _0xc03c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x03cc[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var attributes=require(_0xc03c('0x0'));var squel=require('squel');module[_0xc03c('0x1')]=function(_0x54eafb){var _0x354f10=_0x54eafb[_0xc03c('0x2')];function _0x293358(_0x90131,_0x304b66){return new Promise(function(_0x172e99,_0x46728f){if(!_0x304b66)return _0x172e99(null);var _0x54468f=_0x304b66[_0xc03c('0x3')]?{[_0x304b66[_0xc03c('0x3')][_0xc03c('0x4')]]:_0x304b66[_0xc03c('0x3')]['value']}:undefined;return _0x354f10[_0x90131][_0xc03c('0x5')]({'where':_0x54468f,'raw':!![]})[_0xc03c('0x6')](function(_0x47712f){_0x304b66['associatedResources']=_[_0xc03c('0x7')](_0x47712f,'id');_0x172e99(_0x304b66);})[_0xc03c('0x8')](function(_0x8564e7){_0x46728f(_0x8564e7);});});}function _0x4f5044(_0x48f4d3,_0x4d5499){return new Promise(function(_0x5cf963,_0xaf56f5){var _0x5ac575=_0x48f4d3[_0xc03c('0x3')]?{[_0x48f4d3[_0xc03c('0x3')][_0xc03c('0x4')]]:_0x48f4d3[_0xc03c('0x3')][_0xc03c('0x9')]}:undefined;return _0x354f10[_0x48f4d3['model']][_0xc03c('0x5')]({'where':_0x5ac575,'raw':!![]})['then'](function(_0x3c4442){_0x4d5499[_0xc03c('0xa')]=_['map'](_0x3c4442,function(_0x1b8a84){return _0x1b8a84[_0xc03c('0xb')];});_0x5cf963(_0x4d5499);})['catch'](function(_0x30d025){_0xaf56f5(_0x30d025);});});}function _0x5eb650(_0x1f9f86,_0x250a14,_0xb7fb6e){if(!_0x250a14)return Promise['resolve'](null);return new Promise(function(_0x538534,_0x32bf12){return _0x354f10[_0xc03c('0xc')][_0xc03c('0x5')]({'where':{'sectionId':_0x250a14['id']},'raw':!![]})[_0xc03c('0x6')](function(_0x5c4eb1){if(_0x1f9f86[_0xc03c('0x4')]&&_0x1f9f86[_0xc03c('0x4')]!=='id'){_0x250a14[_0xc03c('0xa')]=_[_0xc03c('0x7')](_0x5c4eb1,function(_0x27ec19){return _0x27ec19[_0x1f9f86[_0xc03c('0x4')]];});}else{if(_0xb7fb6e==='AnalyticExtractedReport'){_0x250a14['associatedResources']=_[_0xc03c('0x7')](_0x5c4eb1,function(_0x14ef3f){return{'id':_0x14ef3f['resourceId'],'type':_0x14ef3f[_0xc03c('0xd')]};});}else{_0x250a14[_0xc03c('0xa')]=_[_0xc03c('0x7')](_0x5c4eb1,function(_0x54feb6){return _0x54feb6[_0xc03c('0xe')];});}}_0x538534(_0x250a14);})['catch'](function(_0x2e5a19){_0x32bf12(_0x2e5a19);});});}function _0x190a75(_0x48ecd4,_0xe98de9){var _0x5e858b={'parentSections':[]};switch(_0x48ecd4['toLowerCase']()){case _0xc03c('0xf'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x11');break;case'odbc':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x12');break;case'squarerecordings':_0x5e858b['childModel']=_0xc03c('0x13');_0x5e858b[_0xc03c('0x14')]=[{'name':_0xc03c('0x15'),'field':_0xc03c('0xb'),'foreignKey':_0xc03c('0x16')}];break;case _0xc03c('0x17'):_0x5e858b['childModel']=_0xc03c('0x18');break;case _0xc03c('0x19'):_0x5e858b['childModel']=_0xc03c('0x1a');_0x5e858b[_0xc03c('0x14')]=[{'name':_0xc03c('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0xc03c('0x1c'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x1d');break;case _0xc03c('0x1e'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x1f');break;case _0xc03c('0x20'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x21');break;case _0xc03c('0x22'):_0x5e858b[_0xc03c('0x10')]='ChatQueue';break;case _0xc03c('0x23'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x24');break;case'faxqueues':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x25');break;case _0xc03c('0x26'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x27');break;case _0xc03c('0x28'):case _0xc03c('0x29'):case _0xc03c('0x2a'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x2b');break;case _0xc03c('0x2c'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x2d');break;case'voicemails':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x2e');break;case _0xc03c('0x2f'):_0x5e858b[_0xc03c('0x10')]='VoiceRecording';_0x5e858b['parentSections']=[{'name':_0xc03c('0x30'),'field':'name','foreignKey':_0xc03c('0x31'),'model':_0xc03c('0x32'),'filter':{'field':_0xc03c('0x33'),'value':[_0xc03c('0x34')]}},{'name':'Telephones','field':_0xc03c('0xb'),'foreignKey':_0xc03c('0x31'),'model':_0xc03c('0x32'),'filter':{'field':_0xc03c('0x33'),'value':['telephone']}},{'name':'VoiceQueues','field':_0xc03c('0xb'),'foreignKey':_0xc03c('0x35'),'model':_0xc03c('0x36'),'filter':{'field':_0xc03c('0xd'),'value':[_0xc03c('0x37')]}},{'name':_0xc03c('0x38'),'field':_0xc03c('0xb'),'foreignKey':_0xc03c('0x35'),'model':_0xc03c('0x36'),'filter':{'field':_0xc03c('0xd'),'value':[_0xc03c('0x39')]}}];break;case'musiconholds':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x3a');break;case _0xc03c('0x3b'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x3c');break;case'voiceprefixes':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x3d');break;case'ivrcampaigns':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x3e');break;case'mailqueues':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x3f');break;case _0xc03c('0x40'):_0x5e858b['childModel']=_0xc03c('0x41');break;case _0xc03c('0x42'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x43');break;case _0xc03c('0x44'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x45');break;case _0xc03c('0x46'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x47');break;case _0xc03c('0x48'):_0x5e858b['childModel']='SmsQueue';break;case'smsaccounts':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x49');break;case _0xc03c('0x4a'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x4b');break;case _0xc03c('0x4c'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x4d');break;case _0xc03c('0x4e'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x4f');break;case _0xc03c('0x50'):case'queuecampaigns':_0x5e858b[_0xc03c('0x10')]='VoiceQueue';if(_0xe98de9){_0x5e858b[_0xc03c('0x14')]=[{'name':'VoiceQueues'},{'name':_0xc03c('0x38')}];}break;case'users':case'agents':case _0xc03c('0x51'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x32');if(_0xe98de9){_0x5e858b['parentSections']=[{'name':_0xc03c('0x52'),'filter':{'field':'role','value':[_0xc03c('0x53'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0xc03c('0x54')}];}break;case _0xc03c('0x55'):_0x5e858b['childModel']=_0xc03c('0x56');break;case _0xc03c('0x57'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x58');break;case _0xc03c('0x59'):_0x5e858b['childModel']='FreshdeskAccount';break;case _0xc03c('0x5a'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x5b');break;case _0xc03c('0x5c'):_0x5e858b['childModel']=_0xc03c('0x5d');break;case _0xc03c('0x5e'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x5f');break;case _0xc03c('0x60'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x32');break;case'cannedanswers':_0x5e858b['childModel']=_0xc03c('0x61');break;case'dispositions':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x62');break;case _0xc03c('0x63'):_0x5e858b[_0xc03c('0x10')]='Dashboard';break;case _0xc03c('0x64'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x65');break;case _0xc03c('0x66'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x67');break;case _0xc03c('0x68'):_0x5e858b[_0xc03c('0x10')]='Schedule';break;case _0xc03c('0x69'):_0x5e858b[_0xc03c('0x10')]='Sound';break;case'tags':_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x6a');break;case _0xc03c('0x6b'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x6c');break;case _0xc03c('0x6d'):_0x5e858b['childModel']=_0xc03c('0x6e');break;case _0xc03c('0x6f'):_0x5e858b['childModel']=_0xc03c('0x70');break;case _0xc03c('0x71'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x72');break;case _0xc03c('0x73'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x74');break;case _0xc03c('0x75'):_0x5e858b['childModel']=_0xc03c('0x76');_0x5e858b[_0xc03c('0x14')]=[{'name':_0xc03c('0x77'),'field':'id','foreignKey':_0xc03c('0x78')}];break;case _0xc03c('0x79'):_0x5e858b[_0xc03c('0x10')]=_0xc03c('0x7a');break;}return _0x5e858b;}function _0x20d6e8(_0xebb32a,_0x2103e8){var _0x4e8d55=_0xebb32a['charAt'](0x0)[_0xc03c('0x7b')]()+_0xebb32a[_0xc03c('0x7c')](0x1);var _0x172584={'type':_0x354f10['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x1714fa,_0x3870a6){var _0x18fa2c=squel[_0xc03c('0x7d')]()[_0xc03c('0x4')](_0xc03c('0x7e')+_0x4e8d55+_0xc03c('0x7f'),'id')['field'](_0xc03c('0x80'))[_0xc03c('0x81')](_0xc03c('0x82')+_0xebb32a+_0xc03c('0x83'),'ui')['where']('ui.UserId\x20=\x20?',_0x2103e8['id']);return _0x354f10[_0xc03c('0x84')][_0xc03c('0x85')](_0x18fa2c[_0xc03c('0x86')](),_0x172584)[_0xc03c('0x6')](function(_0x1293a0){_0x2103e8[_0x4e8d55+_0xc03c('0x87')]=_0x1293a0;_0x1714fa(_0x1293a0);})[_0xc03c('0x8')](function(_0x285156){_0x3870a6(_0x285156);});});}return _0x54eafb[_0xc03c('0x88')](_0xc03c('0x89'),attributes,{'tableName':_0xc03c('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1d8cff){var _0x31edb0=require('../../components/parsers/qs');var _0x381a21={'raw':_0x1d8cff[_0xc03c('0x85')][_0xc03c('0x8b')],'where':{}};var _0x3e2ef7={};var _0x5a4fa6={'count':0x0,'rows':[]};var _0x24eeb0=_0x1d8cff['query'][_0xc03c('0x8c')];var _0x132eb9=_0x1d8cff['query'][_0xc03c('0x8d')]||![];var _0x166518=_0x190a75(_0x24eeb0,_0x132eb9);if(!_0x166518[_0xc03c('0x10')])throw new Error(_0xc03c('0x8e')+_0x24eeb0+'\x27');var _0x1c8e51=[{'name':_0x24eeb0}];if(!_['isEmpty'](_0x166518['parentSections']))_0x1c8e51=_0x166518[_0xc03c('0x14')];var _0x1e4be9=[];for(var _0x199ed2=0x0;_0x199ed2<_0x1c8e51[_0xc03c('0x8f')];_0x199ed2++){_0x1e4be9[_0xc03c('0x90')](_0x354f10[_0xc03c('0x91')][_0xc03c('0x92')]({'where':{'userProfileId':_0x1d8cff[_0xc03c('0x93')]['id'],'name':_0x1c8e51[_0x199ed2]['name']},'raw':!![]}));}return Promise['all'](_0x1e4be9)[_0xc03c('0x6')](function(_0x1bda4a){var _0x328a24=_[_0xc03c('0x3')](_0x1bda4a,function(_0x44bc3f){return _0x44bc3f?_0x44bc3f:undefined;});var _0x2f6324=_[_0xc03c('0x3')](_0x1c8e51,[_0xc03c('0x94'),!![]]);var _0x1df4bb=_[_0xc03c('0x95')](_0x328a24)&&_['isEmpty'](_0x2f6324)?null:_[_0xc03c('0x96')](_0x2f6324,_0x328a24);if(!_0x1df4bb)return null;var _0xb0253f=[];for(var _0x44517d=0x0;_0x44517d<_0x1df4bb['length'];_0x44517d++){var _0x52bf83=_[_0xc03c('0x92')](_0x1c8e51,function(_0x1fdf25){return _0x1df4bb[_0x44517d]?_0x1fdf25[_0xc03c('0xb')]===_0x1df4bb[_0x44517d][_0xc03c('0xb')]:null;});if(_0x52bf83){if(_0x1df4bb[_0x44517d][_0xc03c('0x94')]){_0xb0253f['push'](_0x293358(_0x166518[_0xc03c('0x10')],_0x1df4bb[_0x44517d]));}else{if(!_0x1df4bb[_0x44517d][_0xc03c('0x97')]){_0xb0253f[_0xc03c('0x90')](_0x5eb650(_0x52bf83,_0x1df4bb[_0x44517d],_0x166518[_0xc03c('0x10')]));}else{if(_0x52bf83['model']){_0xb0253f[_0xc03c('0x90')](_0x4f5044(_0x52bf83,_0x1df4bb[_0x44517d]));}}}}}return Promise[_0xc03c('0x98')](_0xb0253f);})[_0xc03c('0x6')](function(_0x36f564){var _0x2606dd=_0x36f564;var _0x4787b2=null;if(_0x2606dd){_0x4787b2=_0x2606dd[_0xc03c('0x8f')]===0x1?_0x2606dd[0x0]:null;}if(!_0x4787b2&&!_0x2606dd)return _0x5a4fa6;var _0x7c1a69=_0x354f10[_0x166518[_0xc03c('0x10')]][_0xc03c('0x99')];_0x3e2ef7[_0xc03c('0x9a')]=_['keys'](_0x7c1a69);_0x3e2ef7[_0xc03c('0x85')]=_[_0xc03c('0x9b')](_0x1d8cff['query']);_0x3e2ef7[_0xc03c('0x9c')]=_['intersection'](_0x3e2ef7[_0xc03c('0x9a')],_0x3e2ef7['query']);_0x381a21[_0xc03c('0x9d')]=_[_0xc03c('0x9e')](_0x3e2ef7[_0xc03c('0x9a')],_0x31edb0[_0xc03c('0x9f')](_0x1d8cff['query'][_0xc03c('0x9f')]));_0x381a21[_0xc03c('0x9d')]=_0x381a21[_0xc03c('0x9d')][_0xc03c('0x8f')]?_0x381a21[_0xc03c('0x9d')]:_0x3e2ef7[_0xc03c('0x9a')];if(!_0x1d8cff['query'][_0xc03c('0xa0')](_0xc03c('0xa1'))){_0x381a21[_0xc03c('0xa2')]=_0x31edb0[_0xc03c('0xa2')](_0x1d8cff[_0xc03c('0x85')]['limit']);_0x381a21['offset']=_0x31edb0[_0xc03c('0xa3')](_0x1d8cff['query']['offset']);}_0x381a21[_0xc03c('0xa4')]=_0x31edb0[_0xc03c('0xa5')](_0x1d8cff[_0xc03c('0x85')][_0xc03c('0xa5')]);_0x381a21['where']=_0x31edb0[_0xc03c('0x9c')](_[_0xc03c('0xa6')](_0x1d8cff[_0xc03c('0x85')],_0x3e2ef7[_0xc03c('0x9c')]));if(_0x1d8cff[_0xc03c('0x85')][_0xc03c('0x3')]){_0x381a21[_0xc03c('0xa7')]=_[_0xc03c('0xa8')](_0x381a21[_0xc03c('0xa7')],{'$or':_[_0xc03c('0x7')](_0x7c1a69,function(_0x37ae1a){if(_0x37ae1a[_0xc03c('0xd')][_0xc03c('0xa9')]!=='VIRTUAL'){var _0x73d4a2={};_0x73d4a2[_0x37ae1a[_0xc03c('0x4')]]={'$like':'%'+_0x1d8cff['query'][_0xc03c('0x3')]+'%'};return _0x73d4a2;}})});}var _0x528f42=[];var _0x5c77b6=null;var _0x1595cb={};if(_0x4787b2){_0x5c77b6=_['find'](_0x1c8e51,[_0xc03c('0xb'),_0x4787b2[_0xc03c('0xb')]]);if(_0x5c77b6[_0xc03c('0x4')]){_0x1595cb={};if(_0x166518[_0xc03c('0x10')]==='AnalyticExtractedReport'){_0x1595cb[_0x5c77b6['foreignKey']]=_[_0xc03c('0x7')](_0x4787b2[_0xc03c('0xa')],'id');}else{_0x1595cb[_0x5c77b6[_0xc03c('0xaa')]]=_0x4787b2[_0xc03c('0xa')];}_0x528f42[_0xc03c('0x90')](_0x1595cb);}else{_0x381a21[_0xc03c('0xa7')]['id']=_0x4787b2['associatedResources'];}}else{for(var _0x5dce1f=0x0;_0x5dce1f<_0x2606dd[_0xc03c('0x8f')];_0x5dce1f++){_0x5c77b6=_['find'](_0x1c8e51,[_0xc03c('0xb'),_0x2606dd[_0x5dce1f][_0xc03c('0xb')]]);if(_0x5c77b6[_0xc03c('0x4')]){_0x1595cb={};_0x1595cb[_0x5c77b6[_0xc03c('0xaa')]]=_0x2606dd[_0x5dce1f]['associatedResources'];_0x528f42[_0xc03c('0x90')](_0x1595cb);}else{if(!_0x381a21[_0xc03c('0xa7')]['id'])_0x381a21[_0xc03c('0xa7')]['id']=[];_0x2606dd[_0x5dce1f]['associatedResources'][_0xc03c('0xab')](function(_0x1541b6){_0x381a21[_0xc03c('0xa7')]['id'][_0xc03c('0x90')](_0x1541b6);});}}}if(!_[_0xc03c('0x95')](_0x528f42)){_0x381a21[_0xc03c('0xa7')]=_[_0xc03c('0xa8')](_0x381a21['where'],{'$and':{'$or':_0x528f42}});}_0x381a21=_[_0xc03c('0xa8')]({},_0x381a21,_0x1d8cff['options']);if(_0x4787b2&&!_0x4787b2[_0xc03c('0x97')]&&_0x166518[_0xc03c('0x10')]===_0xc03c('0x76')){if(_0x1d8cff[_0xc03c('0x85')]['includeAll']){_0x381a21['include']=[{'all':!![]}];}return _0x354f10[_0x166518['childModel']][_0xc03c('0x5')](_0x381a21)[_0xc03c('0x6')](function(_0x2f3f31){var _0x10f38f=[];_0x2f3f31[_0xc03c('0xab')](function(_0x2f116e){var _0x673193;switch(_0x2f116e['reportType']){case _0xc03c('0xac'):_0x673193=_[_0xc03c('0x92')](_0x4787b2[_0xc03c('0xa')],function(_0x1c2a03){return _0x1c2a03['id']===_0x2f116e['reportId']&&_0x1c2a03[_0xc03c('0xd')]===_0xc03c('0xad');});break;case _0xc03c('0xae'):_0x673193=_[_0xc03c('0x92')](_0x4787b2[_0xc03c('0xa')],function(_0x28d6ec){return _0x28d6ec['id']===_0x2f116e[_0xc03c('0x78')]&&_0x28d6ec[_0xc03c('0xd')]===_0xc03c('0xaf');});break;}if(_0x673193)_0x10f38f[_0xc03c('0x90')](_0x2f116e);});_0x5a4fa6['count']=_0x10f38f[_0xc03c('0x8f')];_0x5a4fa6[_0xc03c('0xb0')]=_0x10f38f;return _0x5a4fa6;});}else{if(!_[_0xc03c('0x95')](_0x1d8cff[_0xc03c('0x85')][_0xc03c('0xb1')])){_0x381a21[_0xc03c('0xa7')]['id']=_0x381a21['where']['id']?_[_0xc03c('0x9e')](_0x381a21['where']['id'],_0x1d8cff[_0xc03c('0x85')]['ids']):_0x1d8cff['query'][_0xc03c('0xb1')];if(_0x1d8cff['query'][_0xc03c('0xb2')]){_0x381a21[_0xc03c('0xa4')]=_0x1d8cff[_0xc03c('0x85')][_0xc03c('0xb2')];}}if(_0x1d8cff[_0xc03c('0x85')][_0xc03c('0xb3')]){_0x381a21[_0xc03c('0xa7')]=_[_0xc03c('0xa8')](_0x381a21[_0xc03c('0xa7')],{'$and':_0x1d8cff['query'][_0xc03c('0xb3')]});}return _0x354f10[_0x166518['childModel']]['count']({'where':_0x381a21[_0xc03c('0xa7')]})['then'](function(_0x51267){_0x5a4fa6[_0xc03c('0xb4')]=_0x51267;if(_0x1d8cff['query']['includeAll']){if(_0x166518[_0xc03c('0x10')]===_0xc03c('0x1a')){_0x381a21[_0xc03c('0xb5')]=[{'model':_0x354f10['Tag'],'as':'Tags','attributes':['id',_0xc03c('0xb'),'color'],'required':_0x1d8cff[_0xc03c('0x85')][_0xc03c('0xb6')]?!![]:![]},{'model':_0x354f10[_0xc03c('0x6a')],'as':_0xc03c('0xb7'),'attributes':['id',_0xc03c('0xb'),'color'],'through':_0x1d8cff[_0xc03c('0x85')][_0xc03c('0xb6')]?{'attributes':[],'where':{'TagId':_0x1d8cff[_0xc03c('0x85')]['tag']||undefined}}:{},'required':_0x1d8cff[_0xc03c('0x85')][_0xc03c('0xb6')]?!![]:![]}];}else{_0x381a21['include']=[{'all':!![]}];}}return _0x354f10[_0x166518[_0xc03c('0x10')]][_0xc03c('0x5')](_0x381a21);})[_0xc03c('0x6')](function(_0x233dad){_0x5a4fa6[_0xc03c('0xb0')]=_0x233dad;if(_0x24eeb0===_0xc03c('0x30')&&_0x1d8cff['query']['openTabs']===_0xc03c('0xb8')){var _0x3e217e=[];for(var _0x33ed1c=0x0;_0x33ed1c<_0x5a4fa6[_0xc03c('0xb0')][_0xc03c('0x8f')];_0x33ed1c++){_0x3e217e[_0xc03c('0x90')](_0x20d6e8(_0xc03c('0xb9'),_0x5a4fa6[_0xc03c('0xb0')][_0x33ed1c]['dataValues']));_0x3e217e['push'](_0x20d6e8('sms',_0x5a4fa6[_0xc03c('0xb0')][_0x33ed1c][_0xc03c('0xba')]));_0x3e217e[_0xc03c('0x90')](_0x20d6e8(_0xc03c('0xbb'),_0x5a4fa6['rows'][_0x33ed1c][_0xc03c('0xba')]));_0x3e217e['push'](_0x20d6e8(_0xc03c('0xbc'),_0x5a4fa6[_0xc03c('0xb0')][_0x33ed1c][_0xc03c('0xba')]));_0x3e217e['push'](_0x20d6e8(_0xc03c('0xbd'),_0x5a4fa6[_0xc03c('0xb0')][_0x33ed1c]['dataValues']));_0x3e217e['push'](_0x20d6e8(_0xc03c('0xbe'),_0x5a4fa6['rows'][_0x33ed1c][_0xc03c('0xba')]));}return Promise['all'](_0x3e217e)[_0xc03c('0x6')](function(){return _0x5a4fa6;});}return _0x5a4fa6;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f77c29f..11d1241 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 _0x853e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x853e,0x1ea));var _0xe853=function(_0x347d4c,_0x2ca4b2){_0x347d4c=_0x347d4c-0x0;var _0x2e13c9=_0x853e[_0x347d4c];return _0x2e13c9;};'use strict';var _=require('lodash');var util=require(_0xe853('0x0'));var moment=require('moment');var BPromise=require(_0xe853('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe853('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe853('0x3'));var logger=require(_0xe853('0x4'))(_0xe853('0x5'));var config=require(_0xe853('0x6'));var jayson=require(_0xe853('0x7'));var client=jayson['client'][_0xe853('0x8')]({'port':0x232a});config[_0xe853('0x9')]=_[_0xe853('0xa')](config[_0xe853('0x9')],{'host':_0xe853('0xb'),'port':0x18eb});var socket=require(_0xe853('0xc'))(new Redis(config[_0xe853('0x9')]));require(_0xe853('0xd'))[_0xe853('0xe')](socket);function respondWithRpcPromise(_0x15bfe2,_0x478b19,_0x581135){return new BPromise(function(_0x54da09,_0xd985c6){return client['request'](_0x15bfe2,_0x581135)['then'](function(_0x1c6224){logger[_0xe853('0xf')](_0xe853('0x10'),_0x478b19,'request\x20sent');logger[_0xe853('0x11')](_0xe853('0x12'),_0x478b19,_0xe853('0x13'),JSON[_0xe853('0x14')](_0x1c6224));if(_0x1c6224[_0xe853('0x15')]){if(_0x1c6224[_0xe853('0x15')][_0xe853('0x16')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x478b19,_0x1c6224['error']['message']);return _0xd985c6(_0x1c6224[_0xe853('0x15')][_0xe853('0x17')]);}logger[_0xe853('0x15')](_0xe853('0x10'),_0x478b19,_0x1c6224[_0xe853('0x15')][_0xe853('0x17')]);return _0x54da09(_0x1c6224[_0xe853('0x15')][_0xe853('0x17')]);}else{logger[_0xe853('0xf')](_0xe853('0x10'),_0x478b19,_0xe853('0x13'));_0x54da09(_0x1c6224[_0xe853('0x18')][_0xe853('0x17')]);}})[_0xe853('0x19')](function(_0x25a5e2){logger[_0xe853('0x15')]('UserProfile,\x20%s,\x20%s',_0x478b19,_0x25a5e2);_0xd985c6(_0x25a5e2);});});} \ No newline at end of file +var _0x9aac=['then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x4ecaea,_0x478cfa){var _0x219af4=function(_0x29a33e){while(--_0x29a33e){_0x4ecaea['push'](_0x4ecaea['shift']());}};_0x219af4(++_0x478cfa);}(_0x9aac,0x135));var _0xc9aa=function(_0x29221d,_0x56f145){_0x29221d=_0x29221d-0x0;var _0x49b3f7=_0x9aac[_0x29221d];return _0x49b3f7;};'use strict';var _=require(_0xc9aa('0x0'));var util=require('util');var moment=require(_0xc9aa('0x1'));var BPromise=require(_0xc9aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9aa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9aa('0x4'));var logger=require('../../config/logger')(_0xc9aa('0x5'));var config=require(_0xc9aa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc9aa('0x7')][_0xc9aa('0x8')]({'port':0x232a});config[_0xc9aa('0x9')]=_['defaults'](config[_0xc9aa('0x9')],{'host':_0xc9aa('0xa'),'port':0x18eb});var socket=require(_0xc9aa('0xb'))(new Redis(config['redis']));require(_0xc9aa('0xc'))[_0xc9aa('0xd')](socket);function respondWithRpcPromise(_0x39c4e3,_0x54efbc,_0x55d434){return new BPromise(function(_0x32f449,_0x5346e3){return client[_0xc9aa('0xe')](_0x39c4e3,_0x55d434)[_0xc9aa('0xf')](function(_0x248d4e){logger[_0xc9aa('0x10')](_0xc9aa('0x11'),_0x54efbc,_0xc9aa('0x12'));logger[_0xc9aa('0x13')](_0xc9aa('0x14'),_0x54efbc,_0xc9aa('0x12'),JSON[_0xc9aa('0x15')](_0x248d4e));if(_0x248d4e[_0xc9aa('0x16')]){if(_0x248d4e[_0xc9aa('0x16')][_0xc9aa('0x17')]===0x1f4){logger[_0xc9aa('0x16')](_0xc9aa('0x11'),_0x54efbc,_0x248d4e[_0xc9aa('0x16')][_0xc9aa('0x18')]);return _0x5346e3(_0x248d4e['error'][_0xc9aa('0x18')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x54efbc,_0x248d4e[_0xc9aa('0x16')][_0xc9aa('0x18')]);return _0x32f449(_0x248d4e[_0xc9aa('0x16')][_0xc9aa('0x18')]);}else{logger['info'](_0xc9aa('0x11'),_0x54efbc,_0xc9aa('0x12'));_0x32f449(_0x248d4e[_0xc9aa('0x19')]['message']);}})[_0xc9aa('0x1a')](function(_0x13d32d){logger[_0xc9aa('0x16')](_0xc9aa('0x11'),_0x54efbc,_0x13d32d);_0x5346e3(_0x13d32d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 230630d..c0035a6 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 _0x8181=['./userProfile.events','save','update','emit','removeListener','register','length','userProfile:'];(function(_0x3b5ebe,_0x59340a){var _0x53319e=function(_0x4fc201){while(--_0x4fc201){_0x3b5ebe['push'](_0x3b5ebe['shift']());}};_0x53319e(++_0x59340a);}(_0x8181,0x170));var _0x1818=function(_0x1af5b3,_0x30a92c){_0x1af5b3=_0x1af5b3-0x0;var _0x11dc13=_0x8181[_0x1af5b3];return _0x11dc13;};'use strict';var UserProfileEvents=require(_0x1818('0x0'));var events=[_0x1818('0x1'),'remove',_0x1818('0x2')];function createListener(_0x5b2a19,_0x55352a){return function(_0x203dd0){_0x55352a[_0x1818('0x3')](_0x5b2a19,_0x203dd0);};}function removeListener(_0x6fa21b,_0x5562c8){return function(){UserProfileEvents[_0x1818('0x4')](_0x6fa21b,_0x5562c8);};}exports[_0x1818('0x5')]=function(_0x1fe93a){for(var _0x2de735=0x0,_0x1b7f35=events[_0x1818('0x6')];_0x2de735<_0x1b7f35;_0x2de735++){var _0x5822d7=events[_0x2de735];var _0x54de61=createListener(_0x1818('0x7')+_0x5822d7,_0x1fe93a);UserProfileEvents['on'](_0x5822d7,_0x54de61);}}; \ No newline at end of file +var _0x1f00=['./userProfile.events','save','remove','register','length','userProfile:'];(function(_0x2af12e,_0x21203c){var _0x17fae7=function(_0x51de82){while(--_0x51de82){_0x2af12e['push'](_0x2af12e['shift']());}};_0x17fae7(++_0x21203c);}(_0x1f00,0xb4));var _0x01f0=function(_0x11cdfb,_0x571760){_0x11cdfb=_0x11cdfb-0x0;var _0x327566=_0x1f00[_0x11cdfb];return _0x327566;};'use strict';var UserProfileEvents=require(_0x01f0('0x0'));var events=[_0x01f0('0x1'),_0x01f0('0x2'),'update'];function createListener(_0x17d215,_0x24f521){return function(_0x2d1f03){_0x24f521['emit'](_0x17d215,_0x2d1f03);};}function removeListener(_0x46f37d,_0x386661){return function(){UserProfileEvents['removeListener'](_0x46f37d,_0x386661);};}exports[_0x01f0('0x3')]=function(_0x563ad1){for(var _0x3a5853=0x0,_0x1a724c=events[_0x01f0('0x4')];_0x3a5853<_0x1a724c;_0x3a5853++){var _0x5a9444=events[_0x3a5853];var _0x23c4fe=createListener(_0x01f0('0x5')+_0x5a9444,_0x563ad1);UserProfileEvents['on'](_0x5a9444,_0x23c4fe);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 937183c..2e1bc36 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 _0xf832=['describe','get','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','isAuthenticated','/describe'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xf832,0x1f0));var _0x2f83=function(_0x521316,_0x45d823){_0x521316=_0x521316-0x0;var _0x15d8ce=_0xf832[_0x521316];return _0x15d8ce;};'use strict';var multer=require('multer');var util=require(_0x2f83('0x0'));var path=require(_0x2f83('0x1'));var timeout=require(_0x2f83('0x2'));var express=require(_0x2f83('0x3'));var router=express['Router']();var fs_extra=require(_0x2f83('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2f83('0x5'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x2f83('0x6')](),controller['index']);router['get'](_0x2f83('0x7'),auth[_0x2f83('0x6')](),controller[_0x2f83('0x8')]);router[_0x2f83('0x9')](_0x2f83('0xa'),auth[_0x2f83('0x6')](),controller[_0x2f83('0xb')]);router['post']('/',auth[_0x2f83('0x6')](),controller[_0x2f83('0xc')]);router[_0x2f83('0xd')](_0x2f83('0xa'),auth[_0x2f83('0x6')](),controller[_0x2f83('0xe')]);router[_0x2f83('0xf')](_0x2f83('0xa'),auth[_0x2f83('0x6')](),controller[_0x2f83('0x10')]);module[_0x2f83('0x11')]=router; \ No newline at end of file +var _0x4bad=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','update'];(function(_0x5692ad,_0x27f1e6){var _0x26c6c0=function(_0x225450){while(--_0x225450){_0x5692ad['push'](_0x5692ad['shift']());}};_0x26c6c0(++_0x27f1e6);}(_0x4bad,0x179));var _0xd4ba=function(_0x1cfe79,_0x320b03){_0x1cfe79=_0x1cfe79-0x0;var _0x3f6e87=_0x4bad[_0x1cfe79];return _0x3f6e87;};'use strict';var multer=require(_0xd4ba('0x0'));var util=require('util');var path=require(_0xd4ba('0x1'));var timeout=require(_0xd4ba('0x2'));var express=require(_0xd4ba('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd4ba('0x4'));var interaction=require(_0xd4ba('0x5'));var config=require(_0xd4ba('0x6'));var controller=require('./userProfileResource.controller');router[_0xd4ba('0x7')]('/',auth[_0xd4ba('0x8')](),controller['index']);router[_0xd4ba('0x7')](_0xd4ba('0x9'),auth[_0xd4ba('0x8')](),controller[_0xd4ba('0xa')]);router['get'](_0xd4ba('0xb'),auth[_0xd4ba('0x8')](),controller['show']);router['post']('/',auth[_0xd4ba('0x8')](),controller[_0xd4ba('0xc')]);router['put']('/:id',auth[_0xd4ba('0x8')](),controller[_0xd4ba('0xd')]);router[_0xd4ba('0xe')](_0xd4ba('0xb'),auth[_0xd4ba('0x8')](),controller[_0xd4ba('0xf')]);module[_0xd4ba('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 8576a51..8a59a3a 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 _0x4696=['sequelize','exports','STRING'];(function(_0x3fe0fe,_0x3bdc49){var _0x5c11f4=function(_0x127973){while(--_0x127973){_0x3fe0fe['push'](_0x3fe0fe['shift']());}};_0x5c11f4(++_0x3bdc49);}(_0x4696,0x66));var _0x6469=function(_0x2cdfa0,_0x130f65){_0x2cdfa0=_0x2cdfa0-0x0;var _0x4a0974=_0x4696[_0x2cdfa0];return _0x4a0974;};'use strict';var Sequelize=require(_0x6469('0x0'));module[_0x6469('0x1')]={'name':{'type':Sequelize[_0x6469('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x6469('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x9da0=['sequelize','STRING'];(function(_0x3dd317,_0x395ac2){var _0x1aa7d9=function(_0x26ac3f){while(--_0x26ac3f){_0x3dd317['push'](_0x3dd317['shift']());}};_0x1aa7d9(++_0x395ac2);}(_0x9da0,0xde));var _0x09da=function(_0x449e92,_0x3896d8){_0x449e92=_0x449e92-0x0;var _0x3fc2c9=_0x9da0[_0x449e92];return _0x3fc2c9;};'use strict';var Sequelize=require(_0x09da('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x09da('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index f8cace3..7272aa1 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 _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','UserProfileResource','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack'];(function(_0x9febea,_0xa5758a){var _0x3e3ad6=function(_0xf06ea7){while(--_0xf06ea7){_0x9febea['push'](_0x9febea['shift']());}};_0x3e3ad6(++_0xa5758a);}(_0x2ef3,0xba));var _0x32ef=function(_0x51b5e5,_0x2c707c){_0x51b5e5=_0x51b5e5-0x0;var _0x50333b=_0x2ef3[_0x51b5e5];return _0x50333b;};'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['UserProfileResource'][_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['UserProfileResource'][_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['UserProfileResource']['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));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));}; \ No newline at end of file +var _0xe2fe=['find','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','UserProfileResource','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x508c0a,_0x1bcd5e){var _0x1c19b7=function(_0x21300d){while(--_0x21300d){_0x508c0a['push'](_0x508c0a['shift']());}};_0x1c19b7(++_0x1bcd5e);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['UserProfileResource']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['UserProfileResource']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));};exports[_0xee2f('0x40')]=function(_0x3acae6,_0x2a450f){return db[_0xee2f('0x23')][_0xee2f('0x40')]()[_0xee2f('0x1c')](respondWithResult(_0x2a450f,null))[_0xee2f('0x3b')](handleError(_0x2a450f,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 2f12c0c..35f4ef0 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 _0x94d6=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId'];(function(_0x290cc2,_0x508de3){var _0x22c308=function(_0x4c81b0){while(--_0x4c81b0){_0x290cc2['push'](_0x290cc2['shift']());}};_0x22c308(++_0x508de3);}(_0x94d6,0x12b));var _0x694d=function(_0x3d04f3,_0x386dbe){_0x3d04f3=_0x3d04f3-0x0;var _0x9c7754=_0x94d6[_0x3d04f3];return _0x9c7754;};'use strict';var _=require(_0x694d('0x0'));var util=require(_0x694d('0x1'));var logger=require('../../config/logger')(_0x694d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x694d('0x3'));var fs=require('fs');var path=require(_0x694d('0x4'));var rimraf=require(_0x694d('0x5'));var config=require(_0x694d('0x6'));var attributes=require(_0x694d('0x7'));module['exports']=function(_0x404306,_0x3a0036){return _0x404306[_0x694d('0x8')](_0x694d('0x9'),attributes,{'tableName':_0x694d('0xa'),'paranoid':![],'indexes':[{'name':_0x694d('0xb'),'fields':['resourceId',_0x694d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f8b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','sectionId'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0x4f8b,0xb6));var _0xb4f8=function(_0x514816,_0x57c091){_0x514816=_0x514816-0x0;var _0x5c3a43=_0x4f8b[_0x514816];return _0x5c3a43;};'use strict';var _=require(_0xb4f8('0x0'));var util=require(_0xb4f8('0x1'));var logger=require(_0xb4f8('0x2'))(_0xb4f8('0x3'));var moment=require(_0xb4f8('0x4'));var BPromise=require(_0xb4f8('0x5'));var rp=require(_0xb4f8('0x6'));var fs=require('fs');var path=require(_0xb4f8('0x7'));var rimraf=require(_0xb4f8('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4f8('0x9'));module['exports']=function(_0x49e8a6,_0x120e96){return _0x49e8a6[_0xb4f8('0xa')]('UserProfileResource',attributes,{'tableName':_0xb4f8('0xb'),'paranoid':![],'indexes':[{'name':_0xb4f8('0xc'),'fields':['resourceId',_0xb4f8('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 c786d31..d3cd2f1 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 _0x6be7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x3d39b6,_0x4d14c6){var _0x5744aa=function(_0x25602d){while(--_0x25602d){_0x3d39b6['push'](_0x3d39b6['shift']());}};_0x5744aa(++_0x4d14c6);}(_0x6be7,0x1b5));var _0x76be=function(_0x3909c0,_0x5e5994){_0x3909c0=_0x3909c0-0x0;var _0x25f2c4=_0x6be7[_0x3909c0];return _0x25f2c4;};'use strict';var _=require(_0x76be('0x0'));var util=require(_0x76be('0x1'));var moment=require(_0x76be('0x2'));var BPromise=require(_0x76be('0x3'));var rs=require(_0x76be('0x4'));var fs=require('fs');var Redis=require(_0x76be('0x5'));var db=require(_0x76be('0x6'))['db'];var utils=require(_0x76be('0x7'));var logger=require(_0x76be('0x8'))(_0x76be('0x9'));var config=require(_0x76be('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x76be('0xb')][_0x76be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a1f2e,_0x24c4d4,_0x17b4d7){return new BPromise(function(_0x525480,_0x681c9f){return client['request'](_0x2a1f2e,_0x17b4d7)['then'](function(_0x4c2199){logger[_0x76be('0xd')](_0x76be('0xe'),_0x24c4d4,_0x76be('0xf'));logger[_0x76be('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x24c4d4,_0x76be('0xf'),JSON[_0x76be('0x11')](_0x4c2199));if(_0x4c2199[_0x76be('0x12')]){if(_0x4c2199[_0x76be('0x12')][_0x76be('0x13')]===0x1f4){logger[_0x76be('0x12')](_0x76be('0xe'),_0x24c4d4,_0x4c2199[_0x76be('0x12')][_0x76be('0x14')]);return _0x681c9f(_0x4c2199['error']['message']);}logger['error'](_0x76be('0xe'),_0x24c4d4,_0x4c2199['error'][_0x76be('0x14')]);return _0x525480(_0x4c2199[_0x76be('0x12')][_0x76be('0x14')]);}else{logger[_0x76be('0xd')](_0x76be('0xe'),_0x24c4d4,'request\x20sent');_0x525480(_0x4c2199[_0x76be('0x15')][_0x76be('0x14')]);}})[_0x76be('0x16')](function(_0x26e710){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x24c4d4,_0x26e710);_0x681c9f(_0x26e710);});});} \ No newline at end of file +var _0xe39d=['request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x4df5d3,_0x522c48){var _0x34a8d=function(_0x52f363){while(--_0x52f363){_0x4df5d3['push'](_0x4df5d3['shift']());}};_0x34a8d(++_0x522c48);}(_0xe39d,0x9a));var _0xde39=function(_0x118142,_0x44f0d6){_0x118142=_0x118142-0x0;var _0x512dfc=_0xe39d[_0x118142];return _0x512dfc;};'use strict';var _=require(_0xde39('0x0'));var util=require('util');var moment=require(_0xde39('0x1'));var BPromise=require(_0xde39('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde39('0x3'));var db=require(_0xde39('0x4'))['db'];var utils=require(_0xde39('0x5'));var logger=require(_0xde39('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xde39('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f4c93,_0x1d0f28,_0x986df4){return new BPromise(function(_0x43a2a7,_0x4369c6){return client[_0xde39('0x8')](_0x5f4c93,_0x986df4)['then'](function(_0xf49ce0){logger[_0xde39('0x9')](_0xde39('0xa'),_0x1d0f28,_0xde39('0xb'));logger[_0xde39('0xc')](_0xde39('0xd'),_0x1d0f28,_0xde39('0xb'),JSON['stringify'](_0xf49ce0));if(_0xf49ce0[_0xde39('0xe')]){if(_0xf49ce0['error'][_0xde39('0xf')]===0x1f4){logger[_0xde39('0xe')](_0xde39('0xa'),_0x1d0f28,_0xf49ce0[_0xde39('0xe')][_0xde39('0x10')]);return _0x4369c6(_0xf49ce0[_0xde39('0xe')][_0xde39('0x10')]);}logger[_0xde39('0xe')](_0xde39('0xa'),_0x1d0f28,_0xf49ce0['error'][_0xde39('0x10')]);return _0x43a2a7(_0xf49ce0[_0xde39('0xe')][_0xde39('0x10')]);}else{logger[_0xde39('0x9')](_0xde39('0xa'),_0x1d0f28,'request\x20sent');_0x43a2a7(_0xf49ce0[_0xde39('0x11')]['message']);}})['catch'](function(_0x162a60){logger[_0xde39('0xe')](_0xde39('0xa'),_0x1d0f28,_0x162a60);_0x4369c6(_0x162a60);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 3bb781a..3f9284e 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 _0x9caf=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports'];(function(_0x2f7109,_0x44f210){var _0x34b004=function(_0x36f0dc){while(--_0x36f0dc){_0x2f7109['push'](_0x2f7109['shift']());}};_0x34b004(++_0x44f210);}(_0x9caf,0x12c));var _0xf9ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9caf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf9ca('0x0'));var path=require('path');var timeout=require(_0xf9ca('0x1'));var express=require(_0xf9ca('0x2'));var router=express[_0xf9ca('0x3')]();var fs_extra=require(_0xf9ca('0x4'));var auth=require(_0xf9ca('0x5'));var interaction=require(_0xf9ca('0x6'));var config=require(_0xf9ca('0x7'));var controller=require(_0xf9ca('0x8'));router[_0xf9ca('0x9')]('/',auth[_0xf9ca('0xa')](),controller[_0xf9ca('0xb')]);router[_0xf9ca('0x9')]('/describe',auth[_0xf9ca('0xa')](),controller[_0xf9ca('0xc')]);router[_0xf9ca('0x9')](_0xf9ca('0xd'),auth['isAuthenticated'](),controller[_0xf9ca('0xe')]);router['post']('/',auth[_0xf9ca('0xa')](),controller[_0xf9ca('0xf')]);router[_0xf9ca('0x10')](_0xf9ca('0xd'),auth[_0xf9ca('0xa')](),controller[_0xf9ca('0x11')]);router[_0xf9ca('0x12')](_0xf9ca('0xd'),auth[_0xf9ca('0xa')](),controller['destroy']);module[_0xf9ca('0x13')]=router; \ No newline at end of file +var _0x90bd=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','show','put'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x90bd,0x16b));var _0xd90b=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x90bd[_0xf0ec6e];return _0x8bbc27;};'use strict';var multer=require(_0xd90b('0x0'));var util=require(_0xd90b('0x1'));var path=require(_0xd90b('0x2'));var timeout=require(_0xd90b('0x3'));var express=require(_0xd90b('0x4'));var router=express[_0xd90b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd90b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd90b('0x7'));var controller=require(_0xd90b('0x8'));router[_0xd90b('0x9')]('/',auth[_0xd90b('0xa')](),controller['index']);router['get'](_0xd90b('0xb'),auth[_0xd90b('0xa')](),controller[_0xd90b('0xc')]);router[_0xd90b('0x9')]('/:id',auth[_0xd90b('0xa')](),controller[_0xd90b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd90b('0xe')](_0xd90b('0xf'),auth[_0xd90b('0xa')](),controller['update']);router['delete']('/:id',auth[_0xd90b('0xa')](),controller[_0xd90b('0x10')]);module[_0xd90b('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index a794189..8e9c401 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 _0x056b=['getDataValue','split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x12d93b,_0x165dc8){var _0x230bd2=function(_0x2073d0){while(--_0x2073d0){_0x12d93b['push'](_0x12d93b['shift']());}};_0x230bd2(++_0x165dc8);}(_0x056b,0xb6));var _0xb056=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0x056b[_0xc8a11];return _0x55a500;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb056('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb056('0x1')],'set':function(_0x4157e0){this[_0xb056('0x4')](_0xb056('0x5'),_0x4157e0?_0x4157e0[_0xb056('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xb056('0x5'))?this[_0xb056('0x7')](_0xb056('0x5'))[_0xb056('0x8')](''):[];}}}; \ No newline at end of file +var _0x57f8=['join','getDataValue','split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x57f8,0x198));var _0x857f=function(_0x5cb71a,_0x263bdf){_0x5cb71a=_0x5cb71a-0x0;var _0x3f380f=_0x57f8[_0x5cb71a];return _0x3f380f;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'name':{'type':Sequelize[_0x857f('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x857f('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x857f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x857f('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x857f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x857f('0x1')],'set':function(_0x6f054b){this[_0x857f('0x4')](_0x857f('0x5'),_0x6f054b?_0x6f054b[_0x857f('0x6')](''):[]);},'get':function(){return this[_0x857f('0x7')]('crudPermissions')?this[_0x857f('0x7')](_0x857f('0x5'))[_0x857f('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 05fe37b..969884d 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 _0x8b54=['save','update','then','error','stack','name','send','index','map','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','length','create','body','destroy','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0x8b54,0xc3));var _0x48b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b54[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x48b5('0x0'));var rimraf=require(_0x48b5('0x1'));var zipdir=require(_0x48b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48b5('0x3'));var moment=require(_0x48b5('0x4'));var BPromise=require(_0x48b5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x48b5('0x6'));var sox=require(_0x48b5('0x7'));var csv=require(_0x48b5('0x8'));var ejs=require(_0x48b5('0x9'));var fs=require('fs');var fs_extra=require(_0x48b5('0xa'));var _=require('lodash');var squel=require(_0x48b5('0xb'));var crypto=require(_0x48b5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x48b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x48b5('0xe'));var Papa=require(_0x48b5('0xf'));var Redis=require(_0x48b5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x48b5('0x11'));var as=require(_0x48b5('0x12'));var hardwareService=require(_0x48b5('0x13'));var logger=require(_0x48b5('0x14'))(_0x48b5('0x15'));var utils=require(_0x48b5('0x16'));var config=require(_0x48b5('0x17'));var licenseUtil=require(_0x48b5('0x18'));var db=require(_0x48b5('0x19'))['db'];function respondWithStatusCode(_0x3a659d,_0x1e711c){_0x1e711c=_0x1e711c||0xcc;return function(_0x1b61a5){if(_0x1b61a5){return _0x3a659d[_0x48b5('0x1a')](_0x1e711c);}return _0x3a659d[_0x48b5('0x1b')](_0x1e711c)[_0x48b5('0x1c')]();};}function respondWithResult(_0x38ab11,_0x2a7711){_0x2a7711=_0x2a7711||0xc8;return function(_0x4d5b89){if(_0x4d5b89){return _0x38ab11[_0x48b5('0x1b')](_0x2a7711)[_0x48b5('0x1d')](_0x4d5b89);}};}function respondWithFilteredResult(_0xafeba0,_0x2da2bd){return function(_0x3cafdf){if(_0x3cafdf){var _0x408565=typeof _0x2da2bd[_0x48b5('0x1e')]===_0x48b5('0x1f')&&typeof _0x2da2bd[_0x48b5('0x20')]===_0x48b5('0x1f');var _0x4d07d7=_0x3cafdf[_0x48b5('0x21')];var _0x2a857e=_0x408565?0x0:_0x2da2bd['offset'];var _0x108aa3=_0x408565?_0x3cafdf[_0x48b5('0x21')]:_0x2da2bd['offset']+_0x2da2bd[_0x48b5('0x20')];var _0x1666b1;if(_0x108aa3>=_0x4d07d7){_0x108aa3=_0x4d07d7;_0x1666b1=0xc8;}else{_0x1666b1=0xce;}_0xafeba0[_0x48b5('0x1b')](_0x1666b1);return _0xafeba0[_0x48b5('0x22')]('Content-Range',_0x2a857e+'-'+_0x108aa3+'/'+_0x4d07d7)[_0x48b5('0x1d')](_0x3cafdf);}return null;};}function patchUpdates(_0xe8588b){return function(_0x333bcd){try{jsonpatch['apply'](_0x333bcd,_0xe8588b,!![]);}catch(_0x4d4925){return BPromise[_0x48b5('0x23')](_0x4d4925);}return _0x333bcd[_0x48b5('0x24')]();};}function saveUpdates(_0x31dfd4,_0x48e551){return function(_0x5883d8){if(_0x5883d8){return _0x5883d8[_0x48b5('0x25')](_0x31dfd4)[_0x48b5('0x26')](function(_0x4f1a3e){return _0x4f1a3e;});}return null;};}function removeEntity(_0x5e9da4,_0x3cc438){return function(_0xb396ff){if(_0xb396ff){return _0xb396ff['destroy']()['then'](function(){_0x5e9da4[_0x48b5('0x1b')](0xcc)[_0x48b5('0x1c')]();});}};}function handleEntityNotFound(_0x22df50,_0x578617){return function(_0xf4eb1d){if(!_0xf4eb1d){_0x22df50[_0x48b5('0x1a')](0x194);}return _0xf4eb1d;};}function handleError(_0x229bbc,_0x31842c){_0x31842c=_0x31842c||0x1f4;return function(_0x417d2b){logger[_0x48b5('0x27')](_0x417d2b[_0x48b5('0x28')]);if(_0x417d2b[_0x48b5('0x29')]){delete _0x417d2b[_0x48b5('0x29')];}_0x229bbc[_0x48b5('0x1b')](_0x31842c)[_0x48b5('0x2a')](_0x417d2b);};}exports[_0x48b5('0x2b')]=function(_0x6b8e91,_0x4a3d25){var _0x167344={},_0x4f5825={},_0x30e489={'count':0x0,'rows':[]};var _0x8d7d59=_[_0x48b5('0x2c')](db['UserProfileSection'][_0x48b5('0x2d')],function(_0x4956f9){return{'name':_0x4956f9['fieldName'],'type':_0x4956f9['type'][_0x48b5('0x2e')]};});_0x4f5825['model']=_[_0x48b5('0x2c')](_0x8d7d59,'name');_0x4f5825[_0x48b5('0x2f')]=_[_0x48b5('0x30')](_0x6b8e91[_0x48b5('0x2f')]);_0x4f5825[_0x48b5('0x31')]=_[_0x48b5('0x32')](_0x4f5825[_0x48b5('0x33')],_0x4f5825[_0x48b5('0x2f')]);_0x167344[_0x48b5('0x34')]=_['intersection'](_0x4f5825[_0x48b5('0x33')],qs[_0x48b5('0x35')](_0x6b8e91['query'][_0x48b5('0x35')]));_0x167344[_0x48b5('0x34')]=_0x167344['attributes']['length']?_0x167344[_0x48b5('0x34')]:_0x4f5825[_0x48b5('0x33')];if(!_0x6b8e91[_0x48b5('0x2f')][_0x48b5('0x36')](_0x48b5('0x37'))){_0x167344[_0x48b5('0x20')]=qs[_0x48b5('0x20')](_0x6b8e91['query'][_0x48b5('0x20')]);_0x167344[_0x48b5('0x1e')]=qs[_0x48b5('0x1e')](_0x6b8e91[_0x48b5('0x2f')][_0x48b5('0x1e')]);}_0x167344['order']=qs[_0x48b5('0x38')](_0x6b8e91[_0x48b5('0x2f')][_0x48b5('0x38')]);_0x167344[_0x48b5('0x39')]=qs[_0x48b5('0x31')](_[_0x48b5('0x3a')](_0x6b8e91['query'],_0x4f5825[_0x48b5('0x31')]),_0x8d7d59);if(_0x6b8e91[_0x48b5('0x2f')][_0x48b5('0x3b')]){_0x167344[_0x48b5('0x39')]=_[_0x48b5('0x3c')](_0x167344[_0x48b5('0x39')],{'$or':_[_0x48b5('0x2c')](_0x8d7d59,function(_0x4cc52b){if(_0x4cc52b[_0x48b5('0x3d')]!==_0x48b5('0x3e')){var _0x1f14f4={};_0x1f14f4[_0x4cc52b[_0x48b5('0x29')]]={'$like':'%'+_0x6b8e91['query']['filter']+'%'};return _0x1f14f4;}})});}_0x167344=_[_0x48b5('0x3c')]({},_0x167344,_0x6b8e91[_0x48b5('0x3f')]);var _0x1798a1={'where':_0x167344['where']};return db[_0x48b5('0x40')][_0x48b5('0x21')](_0x1798a1)[_0x48b5('0x26')](function(_0x16c98a){_0x30e489[_0x48b5('0x21')]=_0x16c98a;if(_0x6b8e91['query'][_0x48b5('0x41')]){_0x167344[_0x48b5('0x42')]=[{'all':!![]}];}return db[_0x48b5('0x40')][_0x48b5('0x43')](_0x167344);})[_0x48b5('0x26')](function(_0x18787d){_0x30e489[_0x48b5('0x44')]=_0x18787d;return _0x30e489;})['then'](respondWithFilteredResult(_0x4a3d25,_0x167344))[_0x48b5('0x45')](handleError(_0x4a3d25,null));};exports[_0x48b5('0x46')]=function(_0x17b401,_0x3f1b47){var _0x5011aa={'raw':![],'where':{'id':_0x17b401[_0x48b5('0x47')]['id']}},_0x50988d={};_0x50988d[_0x48b5('0x33')]=_[_0x48b5('0x30')](db[_0x48b5('0x40')][_0x48b5('0x2d')]);_0x50988d['query']=_[_0x48b5('0x30')](_0x17b401[_0x48b5('0x2f')]);_0x50988d[_0x48b5('0x31')]=_[_0x48b5('0x32')](_0x50988d[_0x48b5('0x33')],_0x50988d[_0x48b5('0x2f')]);_0x5011aa[_0x48b5('0x34')]=_[_0x48b5('0x32')](_0x50988d['model'],qs['fields'](_0x17b401[_0x48b5('0x2f')][_0x48b5('0x35')]));_0x5011aa[_0x48b5('0x34')]=_0x5011aa[_0x48b5('0x34')][_0x48b5('0x48')]?_0x5011aa[_0x48b5('0x34')]:_0x50988d[_0x48b5('0x33')];if(_0x17b401[_0x48b5('0x2f')]['includeAll']){_0x5011aa[_0x48b5('0x42')]=[{'all':!![]}];}_0x5011aa=_['merge']({},_0x5011aa,_0x17b401[_0x48b5('0x3f')]);return db[_0x48b5('0x40')]['find'](_0x5011aa)[_0x48b5('0x26')](handleEntityNotFound(_0x3f1b47,null))[_0x48b5('0x26')](respondWithResult(_0x3f1b47,null))[_0x48b5('0x45')](handleError(_0x3f1b47,null));};exports[_0x48b5('0x49')]=function(_0x4da1f2,_0x31d0d0){return db[_0x48b5('0x40')][_0x48b5('0x49')](_0x4da1f2['body'],{})[_0x48b5('0x26')](respondWithResult(_0x31d0d0,0xc9))[_0x48b5('0x45')](handleError(_0x31d0d0,null));};exports[_0x48b5('0x25')]=function(_0x1565ec,_0x15bd5d){if(_0x1565ec['body']['id']){delete _0x1565ec[_0x48b5('0x4a')]['id'];}return db[_0x48b5('0x40')]['find']({'where':{'id':_0x1565ec[_0x48b5('0x47')]['id']}})[_0x48b5('0x26')](handleEntityNotFound(_0x15bd5d,null))['then'](saveUpdates(_0x1565ec[_0x48b5('0x4a')],null))[_0x48b5('0x26')](respondWithResult(_0x15bd5d,null))[_0x48b5('0x45')](handleError(_0x15bd5d,null));};exports[_0x48b5('0x4b')]=function(_0x598d88,_0x1b7b1b){return db['UserProfileSection'][_0x48b5('0x4c')]({'where':{'id':_0x598d88[_0x48b5('0x47')]['id']}})[_0x48b5('0x26')](handleEntityNotFound(_0x1b7b1b,null))['then'](removeEntity(_0x1b7b1b,null))[_0x48b5('0x45')](handleError(_0x1b7b1b,null));};exports['describe']=function(_0x431886,_0x16b7de){return db[_0x48b5('0x40')]['describe']()['then'](respondWithResult(_0x16b7de,null))[_0x48b5('0x45')](handleError(_0x16b7de,null));}; \ No newline at end of file +var _0x570d=['index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','UserProfileSection','then','include','rows','catch','show','params','intersection','includeAll','find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','error','stack','name'];(function(_0x546b58,_0x305fef){var _0x341476=function(_0x2a1d8e){while(--_0x2a1d8e){_0x546b58['push'](_0x546b58['shift']());}};_0x341476(++_0x305fef);}(_0x570d,0x174));var _0xd570=function(_0x549bd8,_0xcfd76b){_0x549bd8=_0x549bd8-0x0;var _0x42267e=_0x570d[_0x549bd8];return _0x42267e;};'use strict';var emlformat=require(_0xd570('0x0'));var rimraf=require(_0xd570('0x1'));var zipdir=require(_0xd570('0x2'));var jsonpatch=require(_0xd570('0x3'));var rp=require('request-promise');var moment=require(_0xd570('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd570('0x5'));var path=require(_0xd570('0x6'));var sox=require(_0xd570('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd570('0x8'));var squel=require(_0xd570('0x9'));var crypto=require('crypto');var jsforce=require(_0xd570('0xa'));var deskjs=require(_0xd570('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd570('0xc'));var Redis=require('ioredis');var authService=require(_0xd570('0xd'));var qs=require(_0xd570('0xe'));var as=require(_0xd570('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd570('0x10'))(_0xd570('0x11'));var utils=require(_0xd570('0x12'));var config=require(_0xd570('0x13'));var licenseUtil=require(_0xd570('0x14'));var db=require(_0xd570('0x15'))['db'];function respondWithStatusCode(_0x303223,_0x31a7ba){_0x31a7ba=_0x31a7ba||0xcc;return function(_0x2f6586){if(_0x2f6586){return _0x303223[_0xd570('0x16')](_0x31a7ba);}return _0x303223[_0xd570('0x17')](_0x31a7ba)['end']();};}function respondWithResult(_0x2a5ea3,_0x30c1b){_0x30c1b=_0x30c1b||0xc8;return function(_0x6b67d6){if(_0x6b67d6){return _0x2a5ea3[_0xd570('0x17')](_0x30c1b)[_0xd570('0x18')](_0x6b67d6);}};}function respondWithFilteredResult(_0x3ff08e,_0x33a76c){return function(_0x10078d){if(_0x10078d){var _0x5117dc=typeof _0x33a76c[_0xd570('0x19')]===_0xd570('0x1a')&&typeof _0x33a76c[_0xd570('0x1b')]===_0xd570('0x1a');var _0x51be45=_0x10078d[_0xd570('0x1c')];var _0x269eb6=_0x5117dc?0x0:_0x33a76c[_0xd570('0x19')];var _0x2cf645=_0x5117dc?_0x10078d[_0xd570('0x1c')]:_0x33a76c[_0xd570('0x19')]+_0x33a76c[_0xd570('0x1b')];var _0x52b141;if(_0x2cf645>=_0x51be45){_0x2cf645=_0x51be45;_0x52b141=0xc8;}else{_0x52b141=0xce;}_0x3ff08e[_0xd570('0x17')](_0x52b141);return _0x3ff08e['set']('Content-Range',_0x269eb6+'-'+_0x2cf645+'/'+_0x51be45)[_0xd570('0x18')](_0x10078d);}return null;};}function patchUpdates(_0x2230b7){return function(_0x344ef3){try{jsonpatch[_0xd570('0x1d')](_0x344ef3,_0x2230b7,!![]);}catch(_0x51ecd9){return BPromise[_0xd570('0x1e')](_0x51ecd9);}return _0x344ef3[_0xd570('0x1f')]();};}function saveUpdates(_0x2b0b44,_0x4111c0){return function(_0x35a8e2){if(_0x35a8e2){return _0x35a8e2[_0xd570('0x20')](_0x2b0b44)['then'](function(_0x2fcd4f){return _0x2fcd4f;});}return null;};}function removeEntity(_0x140a24,_0x432840){return function(_0x2de3c2){if(_0x2de3c2){return _0x2de3c2['destroy']()['then'](function(){_0x140a24[_0xd570('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1af6,_0x255d2f){return function(_0x1eb550){if(!_0x1eb550){_0x4a1af6[_0xd570('0x16')](0x194);}return _0x1eb550;};}function handleError(_0x16ede8,_0x55385b){_0x55385b=_0x55385b||0x1f4;return function(_0x5b0c66){logger[_0xd570('0x21')](_0x5b0c66[_0xd570('0x22')]);if(_0x5b0c66[_0xd570('0x23')]){delete _0x5b0c66[_0xd570('0x23')];}_0x16ede8[_0xd570('0x17')](_0x55385b)['send'](_0x5b0c66);};}exports[_0xd570('0x24')]=function(_0x5dd3c8,_0x12cc98){var _0x5a5d4c={},_0x3085e6={},_0x5bb0aa={'count':0x0,'rows':[]};var _0xd4d0f8=_[_0xd570('0x25')](db['UserProfileSection'][_0xd570('0x26')],function(_0x52e6ad){return{'name':_0x52e6ad[_0xd570('0x27')],'type':_0x52e6ad[_0xd570('0x28')][_0xd570('0x29')]};});_0x3085e6[_0xd570('0x2a')]=_[_0xd570('0x25')](_0xd4d0f8,_0xd570('0x23'));_0x3085e6['query']=_[_0xd570('0x2b')](_0x5dd3c8[_0xd570('0x2c')]);_0x3085e6[_0xd570('0x2d')]=_['intersection'](_0x3085e6[_0xd570('0x2a')],_0x3085e6[_0xd570('0x2c')]);_0x5a5d4c[_0xd570('0x2e')]=_['intersection'](_0x3085e6['model'],qs[_0xd570('0x2f')](_0x5dd3c8[_0xd570('0x2c')][_0xd570('0x2f')]));_0x5a5d4c[_0xd570('0x2e')]=_0x5a5d4c['attributes'][_0xd570('0x30')]?_0x5a5d4c[_0xd570('0x2e')]:_0x3085e6[_0xd570('0x2a')];if(!_0x5dd3c8['query'][_0xd570('0x31')]('nolimit')){_0x5a5d4c[_0xd570('0x1b')]=qs['limit'](_0x5dd3c8[_0xd570('0x2c')]['limit']);_0x5a5d4c[_0xd570('0x19')]=qs[_0xd570('0x19')](_0x5dd3c8[_0xd570('0x2c')][_0xd570('0x19')]);}_0x5a5d4c['order']=qs[_0xd570('0x32')](_0x5dd3c8[_0xd570('0x2c')][_0xd570('0x32')]);_0x5a5d4c['where']=qs['filters'](_['pick'](_0x5dd3c8['query'],_0x3085e6[_0xd570('0x2d')]),_0xd4d0f8);if(_0x5dd3c8['query'][_0xd570('0x33')]){_0x5a5d4c[_0xd570('0x34')]=_[_0xd570('0x35')](_0x5a5d4c[_0xd570('0x34')],{'$or':_['map'](_0xd4d0f8,function(_0x32f411){if(_0x32f411['type']!==_0xd570('0x36')){var _0x3d59ea={};_0x3d59ea[_0x32f411[_0xd570('0x23')]]={'$like':'%'+_0x5dd3c8[_0xd570('0x2c')]['filter']+'%'};return _0x3d59ea;}})});}_0x5a5d4c=_[_0xd570('0x35')]({},_0x5a5d4c,_0x5dd3c8['options']);var _0x1b06e3={'where':_0x5a5d4c[_0xd570('0x34')]};return db[_0xd570('0x37')][_0xd570('0x1c')](_0x1b06e3)[_0xd570('0x38')](function(_0xdf368e){_0x5bb0aa[_0xd570('0x1c')]=_0xdf368e;if(_0x5dd3c8['query']['includeAll']){_0x5a5d4c[_0xd570('0x39')]=[{'all':!![]}];}return db[_0xd570('0x37')]['findAll'](_0x5a5d4c);})[_0xd570('0x38')](function(_0x155891){_0x5bb0aa[_0xd570('0x3a')]=_0x155891;return _0x5bb0aa;})[_0xd570('0x38')](respondWithFilteredResult(_0x12cc98,_0x5a5d4c))[_0xd570('0x3b')](handleError(_0x12cc98,null));};exports[_0xd570('0x3c')]=function(_0x549e14,_0x3f1fe4){var _0xb36537={'raw':![],'where':{'id':_0x549e14[_0xd570('0x3d')]['id']}},_0xab4f0b={};_0xab4f0b[_0xd570('0x2a')]=_[_0xd570('0x2b')](db[_0xd570('0x37')][_0xd570('0x26')]);_0xab4f0b[_0xd570('0x2c')]=_['keys'](_0x549e14[_0xd570('0x2c')]);_0xab4f0b[_0xd570('0x2d')]=_[_0xd570('0x3e')](_0xab4f0b[_0xd570('0x2a')],_0xab4f0b[_0xd570('0x2c')]);_0xb36537['attributes']=_['intersection'](_0xab4f0b['model'],qs[_0xd570('0x2f')](_0x549e14[_0xd570('0x2c')]['fields']));_0xb36537[_0xd570('0x2e')]=_0xb36537[_0xd570('0x2e')][_0xd570('0x30')]?_0xb36537[_0xd570('0x2e')]:_0xab4f0b[_0xd570('0x2a')];if(_0x549e14[_0xd570('0x2c')][_0xd570('0x3f')]){_0xb36537['include']=[{'all':!![]}];}_0xb36537=_[_0xd570('0x35')]({},_0xb36537,_0x549e14['options']);return db['UserProfileSection'][_0xd570('0x40')](_0xb36537)[_0xd570('0x38')](handleEntityNotFound(_0x3f1fe4,null))[_0xd570('0x38')](respondWithResult(_0x3f1fe4,null))['catch'](handleError(_0x3f1fe4,null));};exports['create']=function(_0x1bc353,_0x5096f6){return db['UserProfileSection']['create'](_0x1bc353[_0xd570('0x41')],{})[_0xd570('0x38')](respondWithResult(_0x5096f6,0xc9))[_0xd570('0x3b')](handleError(_0x5096f6,null));};exports[_0xd570('0x20')]=function(_0x2a3a26,_0x32abcc){if(_0x2a3a26['body']['id']){delete _0x2a3a26[_0xd570('0x41')]['id'];}return db[_0xd570('0x37')][_0xd570('0x40')]({'where':{'id':_0x2a3a26[_0xd570('0x3d')]['id']}})[_0xd570('0x38')](handleEntityNotFound(_0x32abcc,null))['then'](saveUpdates(_0x2a3a26['body'],null))[_0xd570('0x38')](respondWithResult(_0x32abcc,null))[_0xd570('0x3b')](handleError(_0x32abcc,null));};exports[_0xd570('0x42')]=function(_0x5ebd0e,_0x17d23a){return db[_0xd570('0x37')][_0xd570('0x40')]({'where':{'id':_0x5ebd0e[_0xd570('0x3d')]['id']}})[_0xd570('0x38')](handleEntityNotFound(_0x17d23a,null))['then'](removeEntity(_0x17d23a,null))['catch'](handleError(_0x17d23a,null));};exports['describe']=function(_0x39d802,_0x4d767){return db[_0xd570('0x37')][_0xd570('0x43')]()[_0xd570('0x38')](respondWithResult(_0x4d767,null))[_0xd570('0x3b')](handleError(_0x4d767,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ad25491..8f024c5 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 _0x8e06=['define','compositeIndex','sectionId','userProfileId','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes'];(function(_0x4a7ae1,_0x15e055){var _0x37acbd=function(_0xd95fb2){while(--_0xd95fb2){_0x4a7ae1['push'](_0x4a7ae1['shift']());}};_0x37acbd(++_0x15e055);}(_0x8e06,0x1e4));var _0x68e0=function(_0x2c0054,_0x5d5436){_0x2c0054=_0x2c0054-0x0;var _0x2b5da6=_0x8e06[_0x2c0054];return _0x2b5da6;};'use strict';var _=require(_0x68e0('0x0'));var util=require(_0x68e0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x68e0('0x2'));var BPromise=require(_0x68e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x68e0('0x4'));var rimraf=require(_0x68e0('0x5'));var config=require(_0x68e0('0x6'));var attributes=require(_0x68e0('0x7'));module['exports']=function(_0xf99204,_0x1034c3){return _0xf99204[_0x68e0('0x8')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x68e0('0x9'),'fields':[_0x68e0('0xa'),_0x68e0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbf7=['./userProfileSection.attributes','exports','define','user_profile_has_sections','sectionId','userProfileId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a9734,_0x5baebc){var _0xab0682=function(_0x40d75d){while(--_0x40d75d){_0x5a9734['push'](_0x5a9734['shift']());}};_0xab0682(++_0x5baebc);}(_0xfbf7,0x14b));var _0x7fbf=function(_0x69005c,_0x3185ae){_0x69005c=_0x69005c-0x0;var _0x5f5978=_0xfbf7[_0x69005c];return _0x5f5978;};'use strict';var _=require('lodash');var util=require(_0x7fbf('0x0'));var logger=require(_0x7fbf('0x1'))('api');var moment=require(_0x7fbf('0x2'));var BPromise=require(_0x7fbf('0x3'));var rp=require(_0x7fbf('0x4'));var fs=require('fs');var path=require(_0x7fbf('0x5'));var rimraf=require(_0x7fbf('0x6'));var config=require('../../config/environment');var attributes=require(_0x7fbf('0x7'));module[_0x7fbf('0x8')]=function(_0x12d9cb,_0x44c8fc){return _0x12d9cb[_0x7fbf('0x9')]('UserProfileSection',attributes,{'tableName':_0x7fbf('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7fbf('0xb'),_0x7fbf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 3f3510e..09a2207 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 _0xf832=['then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5b60a0,_0x136e77){var _0x3eb88f=function(_0x4b9cb1){while(--_0x4b9cb1){_0x5b60a0['push'](_0x5b60a0['shift']());}};_0x3eb88f(++_0x136e77);}(_0xf832,0xa6));var _0x2f83=function(_0x195577,_0x5de53a){_0x195577=_0x195577-0x0;var _0x13c367=_0xf832[_0x195577];return _0x13c367;};'use strict';var _=require(_0x2f83('0x0'));var util=require(_0x2f83('0x1'));var moment=require(_0x2f83('0x2'));var BPromise=require(_0x2f83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f83('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f83('0x5'))('rpc');var config=require(_0x2f83('0x6'));var jayson=require(_0x2f83('0x7'));var client=jayson[_0x2f83('0x8')][_0x2f83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30eb77,_0xba25d3,_0x58a56e){return new BPromise(function(_0x483dec,_0x77871){return client['request'](_0x30eb77,_0x58a56e)[_0x2f83('0xa')](function(_0x369d39){logger['info'](_0x2f83('0xb'),_0xba25d3,_0x2f83('0xc'));logger[_0x2f83('0xd')](_0x2f83('0xe'),_0xba25d3,'request\x20sent',JSON[_0x2f83('0xf')](_0x369d39));if(_0x369d39['error']){if(_0x369d39[_0x2f83('0x10')][_0x2f83('0x11')]===0x1f4){logger[_0x2f83('0x10')](_0x2f83('0xb'),_0xba25d3,_0x369d39[_0x2f83('0x10')][_0x2f83('0x12')]);return _0x77871(_0x369d39[_0x2f83('0x10')]['message']);}logger[_0x2f83('0x10')](_0x2f83('0xb'),_0xba25d3,_0x369d39['error'][_0x2f83('0x12')]);return _0x483dec(_0x369d39[_0x2f83('0x10')][_0x2f83('0x12')]);}else{logger[_0x2f83('0x13')](_0x2f83('0xb'),_0xba25d3,_0x2f83('0xc'));_0x483dec(_0x369d39[_0x2f83('0x14')][_0x2f83('0x12')]);}})[_0x2f83('0x15')](function(_0x3fff18){logger[_0x2f83('0x10')](_0x2f83('0xb'),_0xba25d3,_0x3fff18);_0x77871(_0x3fff18);});});} \ No newline at end of file +var _0x8a1a=['info','result','lodash','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x8a1a,0x110));var _0xa8a1=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x8a1a[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xa8a1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa8a1('0x1'));var fs=require('fs');var Redis=require(_0xa8a1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8a1('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8a1('0x4'));var jayson=require(_0xa8a1('0x5'));var client=jayson[_0xa8a1('0x6')][_0xa8a1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f946e,_0x458c08,_0x1c2989){return new BPromise(function(_0x396154,_0xfdc516){return client[_0xa8a1('0x8')](_0x1f946e,_0x1c2989)['then'](function(_0x256311){logger['info'](_0xa8a1('0x9'),_0x458c08,_0xa8a1('0xa'));logger[_0xa8a1('0xb')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x458c08,_0xa8a1('0xa'),JSON[_0xa8a1('0xc')](_0x256311));if(_0x256311[_0xa8a1('0xd')]){if(_0x256311['error'][_0xa8a1('0xe')]===0x1f4){logger[_0xa8a1('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x458c08,_0x256311['error'][_0xa8a1('0xf')]);return _0xfdc516(_0x256311[_0xa8a1('0xd')][_0xa8a1('0xf')]);}logger[_0xa8a1('0xd')](_0xa8a1('0x9'),_0x458c08,_0x256311[_0xa8a1('0xd')][_0xa8a1('0xf')]);return _0x396154(_0x256311['error'][_0xa8a1('0xf')]);}else{logger[_0xa8a1('0x10')](_0xa8a1('0x9'),_0x458c08,_0xa8a1('0xa'));_0x396154(_0x256311[_0xa8a1('0x11')]['message']);}})['catch'](function(_0x10583b){logger[_0xa8a1('0xd')](_0xa8a1('0x9'),_0x458c08,_0x10583b);_0xfdc516(_0x10583b);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 3dd9293..9848154 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4de490,_0x1ad277){var _0x31b8b7=function(_0x4a0d36){while(--_0x4a0d36){_0x4de490['push'](_0x4de490['shift']());}};_0x31b8b7(++_0x1ad277);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0xcb91[_0x54ea7a];return _0x65a10d;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index cd5e46c..98aa143 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 _0xb23d=['INTEGER'];(function(_0x429fb5,_0x2f12b5){var _0x3ecc9f=function(_0x157e51){while(--_0x157e51){_0x429fb5['push'](_0x429fb5['shift']());}};_0x3ecc9f(++_0x2f12b5);}(_0xb23d,0x10c));var _0xdb23=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xb23d[_0x61b3ab];return _0x57097f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xdb23('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc42f=['exports','INTEGER','sequelize'];(function(_0xb88f77,_0x58677e){var _0x52c1c1=function(_0x2bc12d){while(--_0x2bc12d){_0xb88f77['push'](_0xb88f77['shift']());}};_0x52c1c1(++_0x58677e);}(_0xc42f,0x1d0));var _0xfc42=function(_0x120b87,_0x2c8cb7){_0x120b87=_0x120b87-0x0;var _0x1f8927=_0xc42f[_0x120b87];return _0x1f8927;};'use strict';var Sequelize=require(_0xfc42('0x0'));module[_0xfc42('0x1')]={'penalty':{'type':Sequelize[_0xfc42('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 f5811af..54cdd60 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 _0x2b29=['path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','request-promise'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x2b29,0x163));var _0x92b2=function(_0x1d55b3,_0x2cf8a3){_0x1d55b3=_0x1d55b3-0x0;var _0x2424ba=_0x2b29[_0x1d55b3];return _0x2424ba;};'use strict';var _=require('lodash');var util=require(_0x92b2('0x0'));var logger=require(_0x92b2('0x1'))(_0x92b2('0x2'));var moment=require(_0x92b2('0x3'));var BPromise=require('bluebird');var rp=require(_0x92b2('0x4'));var fs=require('fs');var path=require(_0x92b2('0x5'));var rimraf=require(_0x92b2('0x6'));var config=require(_0x92b2('0x7'));var attributes=require(_0x92b2('0x8'));module[_0x92b2('0x9')]=function(_0x47c522,_0xb1d856){return _0x47c522['define'](_0x92b2('0xa'),attributes,{'tableName':_0x92b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),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 5427e8b..46bc7b7 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 _0x45d9=['../../config/environment','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3858e1,_0x33e591){var _0x4563d8=function(_0x581395){while(--_0x581395){_0x3858e1['push'](_0x3858e1['shift']());}};_0x4563d8(++_0x33e591);}(_0x45d9,0x8b));var _0x945d=function(_0x2a1010,_0x5bf152){_0x2a1010=_0x2a1010-0x0;var _0x3124da=_0x45d9[_0x2a1010];return _0x3124da;};'use strict';var _=require(_0x945d('0x0'));var util=require(_0x945d('0x1'));var moment=require(_0x945d('0x2'));var BPromise=require('bluebird');var rs=require(_0x945d('0x3'));var fs=require('fs');var Redis=require(_0x945d('0x4'));var db=require(_0x945d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x945d('0x6'))(_0x945d('0x7'));var config=require(_0x945d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x945d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32871b,_0x3027f9,_0x2bce44){return new BPromise(function(_0x49bdf9,_0x1c9dad){return client[_0x945d('0xa')](_0x32871b,_0x2bce44)[_0x945d('0xb')](function(_0x2df32a){logger[_0x945d('0xc')](_0x945d('0xd'),_0x3027f9,_0x945d('0xe'));logger[_0x945d('0xf')](_0x945d('0x10'),_0x3027f9,_0x945d('0xe'),JSON['stringify'](_0x2df32a));if(_0x2df32a[_0x945d('0x11')]){if(_0x2df32a[_0x945d('0x11')][_0x945d('0x12')]===0x1f4){logger[_0x945d('0x11')](_0x945d('0xd'),_0x3027f9,_0x2df32a[_0x945d('0x11')]['message']);return _0x1c9dad(_0x2df32a[_0x945d('0x11')][_0x945d('0x13')]);}logger['error'](_0x945d('0xd'),_0x3027f9,_0x2df32a[_0x945d('0x11')][_0x945d('0x13')]);return _0x49bdf9(_0x2df32a[_0x945d('0x11')][_0x945d('0x13')]);}else{logger[_0x945d('0xc')](_0x945d('0xd'),_0x3027f9,'request\x20sent');_0x49bdf9(_0x2df32a[_0x945d('0x14')][_0x945d('0x13')]);}})['catch'](function(_0x6364ef){logger[_0x945d('0x11')](_0x945d('0xd'),_0x3027f9,_0x6364ef);_0x1c9dad(_0x6364ef);});});} \ No newline at end of file +var _0x17da=['then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x4bb1f8,_0xe4b469){var _0xadfcc3=function(_0x4465fa){while(--_0x4465fa){_0x4bb1f8['push'](_0x4bb1f8['shift']());}};_0xadfcc3(++_0xe4b469);}(_0x17da,0x15e));var _0xa17d=function(_0x313e2e,_0x5735ac){_0x313e2e=_0x313e2e-0x0;var _0x31000d=_0x17da[_0x313e2e];return _0x31000d;};'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('ioredis');var db=require(_0xa17d('0x4'))['db'];var utils=require(_0xa17d('0x5'));var logger=require(_0xa17d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa17d('0x7'));var client=jayson[_0xa17d('0x8')][_0xa17d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c5b5,_0x89e34c,_0x4afde7){return new BPromise(function(_0x29a65a,_0x5cc7f7){return client[_0xa17d('0xa')](_0x48c5b5,_0x4afde7)[_0xa17d('0xb')](function(_0x5ead9e){logger['info'](_0xa17d('0xc'),_0x89e34c,_0xa17d('0xd'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x89e34c,_0xa17d('0xd'),JSON[_0xa17d('0xe')](_0x5ead9e));if(_0x5ead9e[_0xa17d('0xf')]){if(_0x5ead9e[_0xa17d('0xf')]['code']===0x1f4){logger[_0xa17d('0xf')](_0xa17d('0xc'),_0x89e34c,_0x5ead9e[_0xa17d('0xf')][_0xa17d('0x10')]);return _0x5cc7f7(_0x5ead9e[_0xa17d('0xf')][_0xa17d('0x10')]);}logger[_0xa17d('0xf')](_0xa17d('0xc'),_0x89e34c,_0x5ead9e[_0xa17d('0xf')]['message']);return _0x29a65a(_0x5ead9e['error'][_0xa17d('0x10')]);}else{logger[_0xa17d('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x89e34c,_0xa17d('0xd'));_0x29a65a(_0x5ead9e[_0xa17d('0x12')][_0xa17d('0x10')]);}})['catch'](function(_0x362539){logger[_0xa17d('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x89e34c,_0x362539);_0x5cc7f7(_0x362539);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 1019a6f..992dcd1 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 _0x70c5=['INTEGER','sequelize','exports'];(function(_0x3335ba,_0xcd603c){var _0x28c46f=function(_0x42da17){while(--_0x42da17){_0x3335ba['push'](_0x3335ba['shift']());}};_0x28c46f(++_0xcd603c);}(_0x70c5,0x8b));var _0x570c=function(_0x227473,_0x58771d){_0x227473=_0x227473-0x0;var _0x3b9dbe=_0x70c5[_0x227473];return _0x3b9dbe;};'use strict';var Sequelize=require(_0x570c('0x0'));module[_0x570c('0x1')]={'UserId':{'type':Sequelize[_0x570c('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x570c('0x2')]}}; \ No newline at end of file +var _0x443e=['exports','INTEGER','sequelize'];(function(_0x1d0809,_0x591d85){var _0x3fca58=function(_0xcd0f01){while(--_0xcd0f01){_0x1d0809['push'](_0x1d0809['shift']());}};_0x3fca58(++_0x591d85);}(_0x443e,0xdd));var _0xe443=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0x443e[_0x442f02];return _0xab6ef1;};'use strict';var Sequelize=require(_0xe443('0x0'));module[_0xe443('0x1')]={'UserId':{'type':Sequelize[_0xe443('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xe443('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index b71a48c..3bba187 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(_0x54335b,_0x1c742a){var _0x5707f4=function(_0x348f78){while(--_0x348f78){_0x54335b['push'](_0x54335b['shift']());}};_0x5707f4(++_0x1c742a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x8382f6,_0x5e3944){var _0xe599a1=function(_0x351072){while(--_0x351072){_0x8382f6['push'](_0x8382f6['shift']());}};_0xe599a1(++_0x5e3944);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 4284e44..bb6d4ed 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1e41cc,_0x12cd53){var _0x3d2d67=function(_0x1d9487){while(--_0x1d9487){_0x1e41cc['push'](_0x1e41cc['shift']());}};_0x3d2d67(++_0x12cd53);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index b2dbd08..1d28d78 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 _0xa527=['exports','INTEGER'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xa527,0x182));var _0x7a52=function(_0x65397d,_0xf997ae){_0x65397d=_0x65397d-0x0;var _0x357509=_0xa527[_0x65397d];return _0x357509;};'use strict';var Sequelize=require('sequelize');module[_0x7a52('0x0')]={'penalty':{'type':Sequelize[_0x7a52('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb8f0=['sequelize','INTEGER'];(function(_0x1b3368,_0x714dac){var _0x454fb6=function(_0x98d4f){while(--_0x98d4f){_0x1b3368['push'](_0x1b3368['shift']());}};_0x454fb6(++_0x714dac);}(_0xb8f0,0xf2));var _0x0b8f=function(_0x3485ba,_0x3b5fa6){_0x3485ba=_0x3485ba-0x0;var _0x53b26d=_0xb8f0[_0x3485ba];return _0x53b26d;};'use strict';var Sequelize=require(_0x0b8f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0b8f('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 5c97ed5..79dac4c 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 _0xa55c=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','./userVoiceQueue.attributes','define'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa55c,0x183));var _0xca55=function(_0x399b89,_0x5f26e7){_0x399b89=_0x399b89-0x0;var _0x1d8ecb=_0xa55c[_0x399b89];return _0x1d8ecb;};'use strict';var _=require(_0xca55('0x0'));var util=require(_0xca55('0x1'));var logger=require(_0xca55('0x2'))(_0xca55('0x3'));var moment=require(_0xca55('0x4'));var BPromise=require('bluebird');var rp=require(_0xca55('0x5'));var fs=require('fs');var path=require(_0xca55('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca55('0x7'));module['exports']=function(_0x1091ca,_0x4a1deb){return _0x1091ca[_0xca55('0x8')](_0xca55('0x9'),attributes,{'tableName':_0xca55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf376=['UserVoiceQueue','user_has_voice_queues','util','api','moment','bluebird','../../config/environment','./userVoiceQueue.attributes','define'];(function(_0x221d6c,_0x438a53){var _0xebcf1b=function(_0x2073d0){while(--_0x2073d0){_0x221d6c['push'](_0x221d6c['shift']());}};_0xebcf1b(++_0x438a53);}(_0xf376,0xf5));var _0x6f37=function(_0x1a9a73,_0x1b4f7a){_0x1a9a73=_0x1a9a73-0x0;var _0x5098a3=_0xf376[_0x1a9a73];return _0x5098a3;};'use strict';var _=require('lodash');var util=require(_0x6f37('0x0'));var logger=require('../../config/logger')(_0x6f37('0x1'));var moment=require(_0x6f37('0x2'));var BPromise=require(_0x6f37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f37('0x4'));var attributes=require(_0x6f37('0x5'));module['exports']=function(_0x3d135c,_0x5983f9){return _0x3d135c[_0x6f37('0x6')](_0x6f37('0x7'),attributes,{'tableName':_0x6f37('0x8'),'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 cf9d534..c70323c 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 _0x283f=['request\x20sent','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x283f,0x1e8));var _0xf283=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x283f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf283('0x0'));var moment=require(_0xf283('0x1'));var BPromise=require(_0xf283('0x2'));var rs=require(_0xf283('0x3'));var fs=require('fs');var Redis=require(_0xf283('0x4'));var db=require(_0xf283('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf283('0x6'))('rpc');var config=require(_0xf283('0x7'));var jayson=require(_0xf283('0x8'));var client=jayson[_0xf283('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c8e89,_0x1506bf,_0x198bdd){return new BPromise(function(_0x5eefcb,_0x1a3a15){return client[_0xf283('0xa')](_0x5c8e89,_0x198bdd)[_0xf283('0xb')](function(_0x10b02a){logger[_0xf283('0xc')](_0xf283('0xd'),_0x1506bf,'request\x20sent');logger[_0xf283('0xe')](_0xf283('0xf'),_0x1506bf,_0xf283('0x10'),JSON['stringify'](_0x10b02a));if(_0x10b02a['error']){if(_0x10b02a[_0xf283('0x11')][_0xf283('0x12')]===0x1f4){logger[_0xf283('0x11')](_0xf283('0xd'),_0x1506bf,_0x10b02a[_0xf283('0x11')][_0xf283('0x13')]);return _0x1a3a15(_0x10b02a[_0xf283('0x11')]['message']);}logger['error'](_0xf283('0xd'),_0x1506bf,_0x10b02a[_0xf283('0x11')]['message']);return _0x5eefcb(_0x10b02a[_0xf283('0x11')][_0xf283('0x13')]);}else{logger[_0xf283('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x1506bf,'request\x20sent');_0x5eefcb(_0x10b02a[_0xf283('0x14')][_0xf283('0x13')]);}})['catch'](function(_0x4ffaf8){logger[_0xf283('0x11')](_0xf283('0xd'),_0x1506bf,_0x4ffaf8);_0x1a3a15(_0x4ffaf8);});});} \ No newline at end of file +var _0xa784=['message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0xa784,0x74));var _0x4a78=function(_0x5877c4,_0x3e988d){_0x5877c4=_0x5877c4-0x0;var _0x5f2236=_0xa784[_0x5877c4];return _0x5f2236;};'use strict';var _=require('lodash');var util=require(_0x4a78('0x0'));var moment=require(_0x4a78('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a78('0x2'));var fs=require('fs');var Redis=require(_0x4a78('0x3'));var db=require(_0x4a78('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a78('0x5'))(_0x4a78('0x6'));var config=require(_0x4a78('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a78('0x8')][_0x4a78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1db545,_0x388094,_0x2311cb){return new BPromise(function(_0x4086da,_0x4f23a1){return client['request'](_0x1db545,_0x2311cb)[_0x4a78('0xa')](function(_0x2f8eb8){logger[_0x4a78('0xb')](_0x4a78('0xc'),_0x388094,'request\x20sent');logger[_0x4a78('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x388094,_0x4a78('0xe'),JSON[_0x4a78('0xf')](_0x2f8eb8));if(_0x2f8eb8[_0x4a78('0x10')]){if(_0x2f8eb8[_0x4a78('0x10')]['code']===0x1f4){logger['error'](_0x4a78('0xc'),_0x388094,_0x2f8eb8[_0x4a78('0x10')][_0x4a78('0x11')]);return _0x4f23a1(_0x2f8eb8[_0x4a78('0x10')][_0x4a78('0x11')]);}logger[_0x4a78('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x388094,_0x2f8eb8['error'][_0x4a78('0x11')]);return _0x4086da(_0x2f8eb8[_0x4a78('0x10')][_0x4a78('0x11')]);}else{logger[_0x4a78('0xb')](_0x4a78('0xc'),_0x388094,_0x4a78('0xe'));_0x4086da(_0x2f8eb8[_0x4a78('0x12')][_0x4a78('0x11')]);}})['catch'](function(_0x5a68ae){logger[_0x4a78('0x10')](_0x4a78('0xc'),_0x388094,_0x5a68ae);_0x4f23a1(_0x5a68ae);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 997f528..45b8899 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1a69ad,_0x4a06cb){var _0x12c829=function(_0x1a2fdd){while(--_0x1a2fdd){_0x1a69ad['push'](_0x1a69ad['shift']());}};_0x12c829(++_0x4a06cb);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x48ccc4,_0x4045e4){var _0x49d8bd=function(_0x25fc2b){while(--_0x25fc2b){_0x48ccc4['push'](_0x48ccc4['shift']());}};_0x49d8bd(++_0x4045e4);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 8da818a..fe4cea8 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 _0x5e11=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x5f4411,_0x4c2c72){var _0x20c1ae=function(_0x13382b){while(--_0x13382b){_0x5f4411['push'](_0x5f4411['shift']());}};_0x20c1ae(++_0x4c2c72);}(_0x5e11,0x1c3));var _0x15e1=function(_0x127783,_0x258715){_0x127783=_0x127783-0x0;var _0x14f298=_0x5e11[_0x127783];return _0x14f298;};'use strict';var Sequelize=require(_0x15e1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x15e1('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x15e1('0x2')},'membername':{'type':Sequelize[_0x15e1('0x3')],'allowNull':![],'comment':_0x15e1('0x2')},'UserId':{'type':Sequelize[_0x15e1('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x15e1('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x15e1('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x15e1('0x3')],'allowNull':![],'unique':_0x15e1('0x4'),'comment':_0x15e1('0x2')},'penalty':{'type':Sequelize[_0x15e1('0x1')](0xb),'defaultValue':0x0,'comment':_0x15e1('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x15e1('0x2')}}; \ No newline at end of file +var _0xae3d=['Required\x20by\x20Asterisk','STRING','queue_interface','exports','INTEGER'];(function(_0x5c2c72,_0x22cf09){var _0x11c44c=function(_0x37bcca){while(--_0x37bcca){_0x5c2c72['push'](_0x5c2c72['shift']());}};_0x11c44c(++_0x22cf09);}(_0xae3d,0x148));var _0xdae3=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xae3d[_0x79b649];return _0x1af9b1;};'use strict';var Sequelize=require('sequelize');module[_0xdae3('0x0')]={'uniqueid':{'type':Sequelize[_0xdae3('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xdae3('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xdae3('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdae3('0x3')],'allowNull':![],'unique':_0xdae3('0x4'),'comment':_0xdae3('0x2')},'VoiceQueueId':{'type':Sequelize[_0xdae3('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdae3('0x4'),'comment':_0xdae3('0x2')},'penalty':{'type':Sequelize[_0xdae3('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xdae3('0x1')](0xb),'defaultValue':0x0,'comment':_0xdae3('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 90ecf69..f3a50b1 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 _0xcd41=['../../mysqldb','save','update','emit','hook','exports','events'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcd41,0x8b));var _0x1cd4=function(_0x55c434,_0x4c1bcb){_0x55c434=_0x55c434-0x0;var _0x57071c=_0xcd41[_0x55c434];return _0x57071c;};'use strict';var EventEmitter=require(_0x1cd4('0x0'));var UserVoiceQueueRt=require(_0x1cd4('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1cd4('0x2'),'afterUpdate':_0x1cd4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d4351){return function(_0x4f6af1,_0x5e1260,_0x44b17e){UserVoiceQueueRtEvents[_0x1cd4('0x4')](_0x4d4351+':'+_0x4f6af1['id'],_0x4f6af1);UserVoiceQueueRtEvents[_0x1cd4('0x4')](_0x4d4351,_0x4f6af1);_0x44b17e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x1cd4('0x5')](e,emitEvent(event));}}module[_0x1cd4('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xceea=['update','remove','emit','hook','exports','events','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0xceea,0x164));var _0xacee=function(_0xb1e99e,_0x5a20ef){_0xb1e99e=_0xb1e99e-0x0;var _0x11ba35=_0xceea[_0xb1e99e];return _0x11ba35;};'use strict';var EventEmitter=require(_0xacee('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xacee('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xacee('0x2')](0x0);var events={'afterCreate':_0xacee('0x3'),'afterUpdate':_0xacee('0x4'),'afterDestroy':_0xacee('0x5')};function emitEvent(_0xd74cf1){return function(_0x561d25,_0x592364,_0x4cd5e9){UserVoiceQueueRtEvents[_0xacee('0x6')](_0xd74cf1+':'+_0x561d25['id'],_0x561d25);UserVoiceQueueRtEvents[_0xacee('0x6')](_0xd74cf1,_0x561d25);_0x4cd5e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xacee('0x7')](e,emitEvent(event));}}module[_0xacee('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 30b08c0..4c5ac03 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 _0x0290=['lodash','../../config/logger','moment','request-promise','path','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt'];(function(_0xec09f3,_0x193948){var _0x6e4f36=function(_0x3d1d2a){while(--_0x3d1d2a){_0xec09f3['push'](_0xec09f3['shift']());}};_0x6e4f36(++_0x193948);}(_0x0290,0x13b));var _0x0029=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0290[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x0029('0x0'));var util=require('util');var logger=require(_0x0029('0x1'))('api');var moment=require(_0x0029('0x2'));var BPromise=require('bluebird');var rp=require(_0x0029('0x3'));var fs=require('fs');var path=require(_0x0029('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0029('0x5'));module[_0x0029('0x6')]=function(_0x544c24,_0x30512f){return _0x544c24[_0x0029('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0x0029('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8365=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8365,0x176));var _0x5836=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x8365[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x5836('0x0'));var util=require(_0x5836('0x1'));var logger=require(_0x5836('0x2'))(_0x5836('0x3'));var moment=require(_0x5836('0x4'));var BPromise=require(_0x5836('0x5'));var rp=require(_0x5836('0x6'));var fs=require('fs');var path=require(_0x5836('0x7'));var rimraf=require('rimraf');var config=require(_0x5836('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x5836('0x9')]=function(_0x340ada,_0xbba5c8){return _0x340ada[_0x5836('0xa')](_0x5836('0xb'),attributes,{'tableName':_0x5836('0xc'),'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 2c00e35..511f30a 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 _0x9cc3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','ioredis'];(function(_0x51de2f,_0x352460){var _0x388fce=function(_0x2beca7){while(--_0x2beca7){_0x51de2f['push'](_0x51de2f['shift']());}};_0x388fce(++_0x352460);}(_0x9cc3,0x148));var _0x39cc=function(_0xff6753,_0x3c1c5c){_0xff6753=_0xff6753-0x0;var _0x5ae564=_0x9cc3[_0xff6753];return _0x5ae564;};'use strict';var _=require('lodash');var util=require(_0x39cc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39cc('0x1'));var db=require(_0x39cc('0x2'))['db'];var utils=require(_0x39cc('0x3'));var logger=require(_0x39cc('0x4'))(_0x39cc('0x5'));var config=require(_0x39cc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x39cc('0x7')]['http']({'port':0x232a});config[_0x39cc('0x8')]=_[_0x39cc('0x9')](config[_0x39cc('0x8')],{'host':_0x39cc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39cc('0x8')]));require('./userVoiceQueueRt.socket')[_0x39cc('0xb')](socket);function respondWithRpcPromise(_0x361b58,_0xc0225f,_0x4f9960){return new BPromise(function(_0x3aaac8,_0x3a5000){return client['request'](_0x361b58,_0x4f9960)[_0x39cc('0xc')](function(_0xc59d70){logger[_0x39cc('0xd')](_0x39cc('0xe'),_0xc0225f,_0x39cc('0xf'));logger[_0x39cc('0x10')](_0x39cc('0x11'),_0xc0225f,'request\x20sent',JSON['stringify'](_0xc59d70));if(_0xc59d70[_0x39cc('0x12')]){if(_0xc59d70[_0x39cc('0x12')][_0x39cc('0x13')]===0x1f4){logger[_0x39cc('0x12')](_0x39cc('0xe'),_0xc0225f,_0xc59d70[_0x39cc('0x12')]['message']);return _0x3a5000(_0xc59d70['error'][_0x39cc('0x14')]);}logger[_0x39cc('0x12')](_0x39cc('0xe'),_0xc0225f,_0xc59d70[_0x39cc('0x12')][_0x39cc('0x14')]);return _0x3aaac8(_0xc59d70['error'][_0x39cc('0x14')]);}else{logger[_0x39cc('0xd')](_0x39cc('0xe'),_0xc0225f,_0x39cc('0xf'));_0x3aaac8(_0xc59d70[_0x39cc('0x15')]['message']);}})[_0x39cc('0x16')](function(_0x1dd0bf){logger[_0x39cc('0x12')](_0x39cc('0xe'),_0xc0225f,_0x1dd0bf);_0x3a5000(_0x1dd0bf);});});}exports[_0x39cc('0x17')]=function(_0x5d8c23){var _0x120c89=this;return new Promise(function(_0x42f421,_0x36b0bf){return db[_0x39cc('0x18')][_0x39cc('0x19')]({'raw':_0x5d8c23[_0x39cc('0x1a')]?_0x5d8c23[_0x39cc('0x1a')][_0x39cc('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d8c23['options']?_0x5d8c23[_0x39cc('0x1a')][_0x39cc('0x1c')]||null:null,'attributes':[[db[_0x39cc('0x1d')]['fn'](_0x39cc('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x39cc('0x1f')))),_0x39cc('0x20')]]})[_0x39cc('0xc')](function(_0x2218ff){logger[_0x39cc('0xd')](_0x39cc('0x17'),_0x5d8c23);logger['debug'](_0x39cc('0x17'),_0x5d8c23,JSON['stringify'](_0x2218ff));_0x42f421(_0x2218ff);})[_0x39cc('0x16')](function(_0x4542cb){logger[_0x39cc('0x12')](_0x39cc('0x17'),_0x4542cb[_0x39cc('0x14')],_0x5d8c23);_0x36b0bf(_0x120c89[_0x39cc('0x12')](0x1f4,_0x4542cb[_0x39cc('0x14')]));});});}; \ No newline at end of file +var _0x955c=['stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x49c6cc,_0x308bdb){var _0x22e239=function(_0x48507d){while(--_0x48507d){_0x49c6cc['push'](_0x49c6cc['shift']());}};_0x22e239(++_0x308bdb);}(_0x955c,0x12a));var _0xc955=function(_0x1f3b04,_0x1f5b64){_0x1f3b04=_0x1f3b04-0x0;var _0x203225=_0x955c[_0x1f3b04];return _0x203225;};'use strict';var _=require(_0xc955('0x0'));var util=require(_0xc955('0x1'));var moment=require('moment');var BPromise=require(_0xc955('0x2'));var rs=require(_0xc955('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc955('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc955('0x5'))(_0xc955('0x6'));var config=require('../../config/environment');var jayson=require(_0xc955('0x7'));var client=jayson['client'][_0xc955('0x8')]({'port':0x232a});config['redis']=_[_0xc955('0x9')](config[_0xc955('0xa')],{'host':_0xc955('0xb'),'port':0x18eb});var socket=require(_0xc955('0xc'))(new Redis(config[_0xc955('0xa')]));require(_0xc955('0xd'))['register'](socket);function respondWithRpcPromise(_0x1c547f,_0x4af784,_0x30216c){return new BPromise(function(_0x47e8e7,_0x439931){return client[_0xc955('0xe')](_0x1c547f,_0x30216c)[_0xc955('0xf')](function(_0x2c0078){logger['info'](_0xc955('0x10'),_0x4af784,_0xc955('0x11'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x4af784,_0xc955('0x11'),JSON['stringify'](_0x2c0078));if(_0x2c0078[_0xc955('0x12')]){if(_0x2c0078[_0xc955('0x12')]['code']===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4af784,_0x2c0078[_0xc955('0x12')][_0xc955('0x13')]);return _0x439931(_0x2c0078[_0xc955('0x12')][_0xc955('0x13')]);}logger[_0xc955('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4af784,_0x2c0078['error'][_0xc955('0x13')]);return _0x47e8e7(_0x2c0078['error'][_0xc955('0x13')]);}else{logger[_0xc955('0x14')](_0xc955('0x10'),_0x4af784,_0xc955('0x11'));_0x47e8e7(_0x2c0078[_0xc955('0x15')]['message']);}})[_0xc955('0x16')](function(_0x1f397c){logger[_0xc955('0x12')](_0xc955('0x10'),_0x4af784,_0x1f397c);_0x439931(_0x1f397c);});});}exports[_0xc955('0x17')]=function(_0x18cf3a){var _0xab9a2=this;return new Promise(function(_0x1b1372,_0xf2011a){return db[_0xc955('0x18')][_0xc955('0x19')]({'raw':_0x18cf3a[_0xc955('0x1a')]?_0x18cf3a[_0xc955('0x1a')][_0xc955('0x1b')]===undefined?!![]:![]:!![],'where':_0x18cf3a[_0xc955('0x1a')]?_0x18cf3a[_0xc955('0x1a')]['where']||null:null,'attributes':[[db[_0xc955('0x1c')]['fn'](_0xc955('0x1d'),db['sequelize']['fn']('IF',db[_0xc955('0x1c')]['literal'](_0xc955('0x1e')))),_0xc955('0x1f')]]})[_0xc955('0xf')](function(_0x27d799){logger['info'](_0xc955('0x17'),_0x18cf3a);logger['debug']('GetVoiceQueueRtPauses',_0x18cf3a,JSON[_0xc955('0x20')](_0x27d799));_0x1b1372(_0x27d799);})[_0xc955('0x16')](function(_0x5022b7){logger[_0xc955('0x12')]('GetVoiceQueueRtPauses',_0x5022b7[_0xc955('0x13')],_0x18cf3a);_0xf2011a(_0xab9a2[_0xc955('0x12')](0x1f4,_0x5022b7[_0xc955('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 68ba0ec..391177c 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 _0x2af8=['./userVoiceQueueRt.events','remove','update','removeListener','register','userVoiceQueueRt:'];(function(_0x461cfb,_0x2d461e){var _0x245b4b=function(_0x4b60de){while(--_0x4b60de){_0x461cfb['push'](_0x461cfb['shift']());}};_0x245b4b(++_0x2d461e);}(_0x2af8,0xf6));var _0x82af=function(_0x1c2a31,_0x5ab97a){_0x1c2a31=_0x1c2a31-0x0;var _0xaabd37=_0x2af8[_0x1c2a31];return _0xaabd37;};'use strict';var UserVoiceQueueRtEvents=require(_0x82af('0x0'));var events=['save',_0x82af('0x1'),_0x82af('0x2')];function createListener(_0x4fb4ff,_0x267196){return function(_0x196664){_0x267196['emit'](_0x4fb4ff,_0x196664);};}function removeListener(_0x29c672,_0x4a8c15){return function(){UserVoiceQueueRtEvents[_0x82af('0x3')](_0x29c672,_0x4a8c15);};}exports[_0x82af('0x4')]=function(_0x4dd422){for(var _0x3d29ef=0x0,_0x25675f=events['length'];_0x3d29ef<_0x25675f;_0x3d29ef++){var _0x3937fc=events[_0x3d29ef];var _0x238eca=createListener(_0x82af('0x5')+_0x3937fc,_0x4dd422);UserVoiceQueueRtEvents['on'](_0x3937fc,_0x238eca);}}; \ No newline at end of file +var _0x6657=['update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x736618,_0x2907cf){var _0x31ada6=function(_0x4ab05c){while(--_0x4ab05c){_0x736618['push'](_0x736618['shift']());}};_0x31ada6(++_0x2907cf);}(_0x6657,0x17f));var _0x7665=function(_0x3da7ab,_0x2e00dc){_0x3da7ab=_0x3da7ab-0x0;var _0x4819ed=_0x6657[_0x3da7ab];return _0x4819ed;};'use strict';var UserVoiceQueueRtEvents=require(_0x7665('0x0'));var events=['save',_0x7665('0x1'),_0x7665('0x2')];function createListener(_0x40f0aa,_0x3b7cc4){return function(_0x5c6cda){_0x3b7cc4[_0x7665('0x3')](_0x40f0aa,_0x5c6cda);};}function removeListener(_0x2ed8cb,_0x26acc4){return function(){UserVoiceQueueRtEvents[_0x7665('0x4')](_0x2ed8cb,_0x26acc4);};}exports[_0x7665('0x5')]=function(_0x28b410){for(var _0x1a6f2f=0x0,_0x3387d8=events['length'];_0x1a6f2f<_0x3387d8;_0x1a6f2f++){var _0x31da89=events[_0x1a6f2f];var _0x464ec1=createListener(_0x7665('0x6')+_0x31da89,_0x28b410);UserVoiceQueueRtEvents['on'](_0x31da89,_0x464ec1);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 5b4e163..1daf55e 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3b4b39,_0x30200a){var _0x113bf7=function(_0x590412){while(--_0x590412){_0x3b4b39['push'](_0x3b4b39['shift']());}};_0x113bf7(++_0x30200a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xcb91[_0x4409e7];return _0x24c751;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x25e214,_0x42a13e){var _0x48ca06=function(_0x34c6ca){while(--_0x34c6ca){_0x25e214['push'](_0x25e214['shift']());}};_0x48ca06(++_0x42a13e);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index fc92f9a..0bc939b 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 _0x38f6=['INTEGER'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x38f6,0x1b6));var _0x638f=function(_0x19185d,_0x3a37fc){_0x19185d=_0x19185d-0x0;var _0x373522=_0x38f6[_0x19185d];return _0x373522;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x638f('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x93b4=['sequelize','exports'];(function(_0x322bd1,_0x82d137){var _0x28cad7=function(_0x17185f){while(--_0x17185f){_0x322bd1['push'](_0x322bd1['shift']());}};_0x28cad7(++_0x82d137);}(_0x93b4,0x1c4));var _0x493b=function(_0x5bc647,_0x37db43){_0x5bc647=_0x5bc647-0x0;var _0x48fc98=_0x93b4[_0x5bc647];return _0x48fc98;};'use strict';var Sequelize=require(_0x493b('0x0'));module[_0x493b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 c4dc850..a4e881b 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 _0xbf52=['../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xe0aa29,_0x5b390d){var _0x5a267b=function(_0x3d21e3){while(--_0x3d21e3){_0xe0aa29['push'](_0xe0aa29['shift']());}};_0x5a267b(++_0x5b390d);}(_0xbf52,0x89));var _0x2bf5=function(_0x57c5e2,_0x10f331){_0x57c5e2=_0x57c5e2-0x0;var _0x19e57=_0xbf52[_0x57c5e2];return _0x19e57;};'use strict';var _=require(_0x2bf5('0x0'));var util=require(_0x2bf5('0x1'));var logger=require('../../config/logger')(_0x2bf5('0x2'));var moment=require(_0x2bf5('0x3'));var BPromise=require(_0x2bf5('0x4'));var rp=require(_0x2bf5('0x5'));var fs=require('fs');var path=require(_0x2bf5('0x6'));var rimraf=require('rimraf');var config=require(_0x2bf5('0x7'));var attributes=require(_0x2bf5('0x8'));module[_0x2bf5('0x9')]=function(_0x257ff7,_0x3b3946){return _0x257ff7[_0x2bf5('0xa')](_0x2bf5('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4d4=['request-promise','path','rimraf','exports','define','user_has_whatsapp_queues','../../config/logger','api','moment','bluebird'];(function(_0x3c11e5,_0x72618c){var _0x163e43=function(_0x246ecc){while(--_0x246ecc){_0x3c11e5['push'](_0x3c11e5['shift']());}};_0x163e43(++_0x72618c);}(_0xf4d4,0x9c));var _0x4f4d=function(_0xfdd296,_0x53e76b){_0xfdd296=_0xfdd296-0x0;var _0x9d76ba=_0xf4d4[_0xfdd296];return _0x9d76ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4f4d('0x0'))(_0x4f4d('0x1'));var moment=require(_0x4f4d('0x2'));var BPromise=require(_0x4f4d('0x3'));var rp=require(_0x4f4d('0x4'));var fs=require('fs');var path=require(_0x4f4d('0x5'));var rimraf=require(_0x4f4d('0x6'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x4f4d('0x7')]=function(_0x3cdce7,_0x13c3f8){return _0x3cdce7[_0x4f4d('0x8')]('UserWhatsappQueue',attributes,{'tableName':_0x4f4d('0x9'),'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 dd4f3c6..d2aa228 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 _0x53c3=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x2cb412,_0x51405e){var _0x4f7c9c=function(_0x19d1bb){while(--_0x19d1bb){_0x2cb412['push'](_0x2cb412['shift']());}};_0x4f7c9c(++_0x51405e);}(_0x53c3,0x6c));var _0x353c=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x53c3[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x353c('0x0'));var util=require(_0x353c('0x1'));var moment=require(_0x353c('0x2'));var BPromise=require(_0x353c('0x3'));var rs=require(_0x353c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x353c('0x5'));var logger=require(_0x353c('0x6'))(_0x353c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x353c('0x8')][_0x353c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42a662,_0x3ca609,_0x2f7f28){return new BPromise(function(_0x4955fb,_0x207ad8){return client[_0x353c('0xa')](_0x42a662,_0x2f7f28)[_0x353c('0xb')](function(_0x41a5fa){logger[_0x353c('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3ca609,_0x353c('0xd'));logger['debug'](_0x353c('0xe'),_0x3ca609,_0x353c('0xd'),JSON[_0x353c('0xf')](_0x41a5fa));if(_0x41a5fa[_0x353c('0x10')]){if(_0x41a5fa[_0x353c('0x10')][_0x353c('0x11')]===0x1f4){logger[_0x353c('0x10')](_0x353c('0x12'),_0x3ca609,_0x41a5fa[_0x353c('0x10')][_0x353c('0x13')]);return _0x207ad8(_0x41a5fa[_0x353c('0x10')][_0x353c('0x13')]);}logger['error'](_0x353c('0x12'),_0x3ca609,_0x41a5fa[_0x353c('0x10')][_0x353c('0x13')]);return _0x4955fb(_0x41a5fa['error'][_0x353c('0x13')]);}else{logger[_0x353c('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3ca609,_0x353c('0xd'));_0x4955fb(_0x41a5fa[_0x353c('0x14')][_0x353c('0x13')]);}})[_0x353c('0x15')](function(_0x3f84a1){logger[_0x353c('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3ca609,_0x3f84a1);_0x207ad8(_0x3f84a1);});});} \ No newline at end of file +var _0x8d59=['code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x8d59,0x1d2));var _0x98d5=function(_0x1eccd6,_0x4f1284){_0x1eccd6=_0x1eccd6-0x0;var _0x10f7dc=_0x8d59[_0x1eccd6];return _0x10f7dc;};'use strict';var _=require(_0x98d5('0x0'));var util=require(_0x98d5('0x1'));var moment=require(_0x98d5('0x2'));var BPromise=require('bluebird');var rs=require(_0x98d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x98d5('0x4'));var logger=require('../../config/logger')(_0x98d5('0x5'));var config=require(_0x98d5('0x6'));var jayson=require(_0x98d5('0x7'));var client=jayson[_0x98d5('0x8')][_0x98d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a8ca0,_0x349189,_0x2d520e){return new BPromise(function(_0xa0557a,_0xed0f06){return client[_0x98d5('0xa')](_0x4a8ca0,_0x2d520e)[_0x98d5('0xb')](function(_0x247044){logger[_0x98d5('0xc')](_0x98d5('0xd'),_0x349189,_0x98d5('0xe'));logger[_0x98d5('0xf')](_0x98d5('0x10'),_0x349189,_0x98d5('0xe'),JSON['stringify'](_0x247044));if(_0x247044[_0x98d5('0x11')]){if(_0x247044[_0x98d5('0x11')][_0x98d5('0x12')]===0x1f4){logger[_0x98d5('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x349189,_0x247044[_0x98d5('0x11')][_0x98d5('0x13')]);return _0xed0f06(_0x247044['error'][_0x98d5('0x13')]);}logger['error'](_0x98d5('0xd'),_0x349189,_0x247044[_0x98d5('0x11')][_0x98d5('0x13')]);return _0xa0557a(_0x247044['error']['message']);}else{logger[_0x98d5('0xc')](_0x98d5('0xd'),_0x349189,_0x98d5('0xe'));_0xa0557a(_0x247044[_0x98d5('0x14')]['message']);}})[_0x98d5('0x15')](function(_0x360f6a){logger[_0x98d5('0x11')](_0x98d5('0xd'),_0x349189,_0x360f6a);_0xed0f06(_0x360f6a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 1a754ae..6a3f849 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 _0x4abf=['show','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3238bd,_0x4ea3ef){var _0xdc7a7e=function(_0x275fbc){while(--_0x275fbc){_0x3238bd['push'](_0x3238bd['shift']());}};_0xdc7a7e(++_0x4ea3ef);}(_0x4abf,0xac));var _0xf4ab=function(_0xe88157,_0x965589){_0xe88157=_0xe88157-0x0;var _0xa9cf33=_0x4abf[_0xe88157];return _0xa9cf33;};'use strict';var multer=require(_0xf4ab('0x0'));var util=require(_0xf4ab('0x1'));var path=require('path');var timeout=require(_0xf4ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf4ab('0x3'));var interaction=require(_0xf4ab('0x4'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xf4ab('0x5')]('/',auth[_0xf4ab('0x6')](),controller[_0xf4ab('0x7')]);router[_0xf4ab('0x5')]('/:id',auth[_0xf4ab('0x6')](),controller[_0xf4ab('0x8')]);router['post']('/',auth[_0xf4ab('0x6')](),controller['create']);router[_0xf4ab('0x9')](_0xf4ab('0xa'),auth[_0xf4ab('0x6')](),controller[_0xf4ab('0xb')]);router[_0xf4ab('0xc')](_0xf4ab('0xa'),auth[_0xf4ab('0x6')](),controller[_0xf4ab('0xd')]);module[_0xf4ab('0xe')]=router; \ No newline at end of file +var _0xc1c4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','index','isAuthenticated','show','create','put','/:id','destroy','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x5cbc07,_0x378287){_0x5cbc07=_0x5cbc07-0x0;var _0x3be1e0=_0xc1c4[_0x5cbc07];return _0x3be1e0;};'use strict';var multer=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var path=require(_0x4c1c('0x2'));var timeout=require(_0x4c1c('0x3'));var express=require(_0x4c1c('0x4'));var router=express[_0x4c1c('0x5')]();var fs_extra=require(_0x4c1c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4c1c('0x7'));var config=require(_0x4c1c('0x8'));var controller=require(_0x4c1c('0x9'));router[_0x4c1c('0xa')]('/',auth['isAuthenticated'](),controller[_0x4c1c('0xb')]);router['get']('/:id',auth[_0x4c1c('0xc')](),controller[_0x4c1c('0xd')]);router['post']('/',auth[_0x4c1c('0xc')](),controller[_0x4c1c('0xe')]);router[_0x4c1c('0xf')](_0x4c1c('0x10'),auth[_0x4c1c('0xc')](),controller['update']);router['delete'](_0x4c1c('0x10'),auth[_0x4c1c('0xc')](),controller[_0x4c1c('0x11')]);module[_0x4c1c('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index d5e7869..08fb23d 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 _0x6700=['exports','STRING','name','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6700,0xb3));var _0x0670=function(_0x3bc176,_0x33471d){_0x3bc176=_0x3bc176-0x0;var _0x113254=_0x6700[_0x3bc176];return _0x113254;};'use strict';var Sequelize=require(_0x0670('0x0'));module[_0x0670('0x1')]={'name':{'type':Sequelize[_0x0670('0x2')],'unique':_0x0670('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7f2b=['name','sequelize','exports','STRING'];(function(_0x1f2fbf,_0xfe8bcc){var _0xef8cfa=function(_0x4de263){while(--_0x4de263){_0x1f2fbf['push'](_0x1f2fbf['shift']());}};_0xef8cfa(++_0xfe8bcc);}(_0x7f2b,0x11d));var _0xb7f2=function(_0x17d061,_0x2703b1){_0x17d061=_0x17d061-0x0;var _0x500844=_0x7f2b[_0x17d061];return _0x500844;};'use strict';var Sequelize=require(_0xb7f2('0x0'));module[_0xb7f2('0x1')]={'name':{'type':Sequelize[_0xb7f2('0x2')],'unique':_0xb7f2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb7f2('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index f0a30a9..6e1bdee 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 _0xb053=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','then','destroy','get','Variables','UserProfileResource','error','name','send','index','map','Variable','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xb053,0x9a));var _0x3b05=function(_0x48a3ed,_0x60e64a){_0x48a3ed=_0x48a3ed-0x0;var _0x53565c=_0xb053[_0x48a3ed];return _0x53565c;};'use strict';var emlformat=require(_0x3b05('0x0'));var rimraf=require(_0x3b05('0x1'));var zipdir=require(_0x3b05('0x2'));var jsonpatch=require(_0x3b05('0x3'));var rp=require('request-promise');var moment=require(_0x3b05('0x4'));var BPromise=require(_0x3b05('0x5'));var Mustache=require(_0x3b05('0x6'));var util=require(_0x3b05('0x7'));var path=require(_0x3b05('0x8'));var sox=require(_0x3b05('0x9'));var csv=require(_0x3b05('0xa'));var ejs=require(_0x3b05('0xb'));var fs=require('fs');var fs_extra=require(_0x3b05('0xc'));var _=require(_0x3b05('0xd'));var squel=require(_0x3b05('0xe'));var crypto=require(_0x3b05('0xf'));var jsforce=require(_0x3b05('0x10'));var deskjs=require(_0x3b05('0x11'));var toCsv=require(_0x3b05('0xa'));var querystring=require(_0x3b05('0x12'));var Papa=require(_0x3b05('0x13'));var Redis=require(_0x3b05('0x14'));var authService=require(_0x3b05('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x3b05('0x16'));var hardwareService=require(_0x3b05('0x17'));var logger=require(_0x3b05('0x18'))(_0x3b05('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b05('0x1a'));var db=require(_0x3b05('0x1b'))['db'];function respondWithStatusCode(_0x35d16c,_0x177821){_0x177821=_0x177821||0xcc;return function(_0x4fdae1){if(_0x4fdae1){return _0x35d16c[_0x3b05('0x1c')](_0x177821);}return _0x35d16c[_0x3b05('0x1d')](_0x177821)[_0x3b05('0x1e')]();};}function respondWithResult(_0x3535da,_0x55e0e7){_0x55e0e7=_0x55e0e7||0xc8;return function(_0x57af21){if(_0x57af21){return _0x3535da[_0x3b05('0x1d')](_0x55e0e7)[_0x3b05('0x1f')](_0x57af21);}};}function respondWithFilteredResult(_0x2c3925,_0x270290){return function(_0x3bfc23){if(_0x3bfc23){var _0x359815=typeof _0x270290['offset']==='undefined'&&typeof _0x270290[_0x3b05('0x20')]==='undefined';var _0x4a3e63=_0x3bfc23[_0x3b05('0x21')];var _0x715c7c=_0x359815?0x0:_0x270290[_0x3b05('0x22')];var _0x6dc554=_0x359815?_0x3bfc23['count']:_0x270290[_0x3b05('0x22')]+_0x270290['limit'];var _0x239bc3;if(_0x6dc554>=_0x4a3e63){_0x6dc554=_0x4a3e63;_0x239bc3=0xc8;}else{_0x239bc3=0xce;}_0x2c3925[_0x3b05('0x1d')](_0x239bc3);return _0x2c3925[_0x3b05('0x23')](_0x3b05('0x24'),_0x715c7c+'-'+_0x6dc554+'/'+_0x4a3e63)[_0x3b05('0x1f')](_0x3bfc23);}return null;};}function patchUpdates(_0x4b7cb0){return function(_0x522404){try{jsonpatch['apply'](_0x522404,_0x4b7cb0,!![]);}catch(_0x732ad){return BPromise['reject'](_0x732ad);}return _0x522404['save']();};}function saveUpdates(_0x2d130a,_0x2227f2){return function(_0x361f2b){if(_0x361f2b){return _0x361f2b['update'](_0x2d130a)[_0x3b05('0x25')](function(_0x1ac253){return _0x1ac253;});}return null;};}function removeEntity(_0x1b5862,_0x4e9f39){return function(_0x44df9c){if(_0x44df9c){return _0x44df9c[_0x3b05('0x26')]()[_0x3b05('0x25')](function(){var _0x59c554=_0x44df9c[_0x3b05('0x27')]({'plain':!![]});var _0x5b27a3=_0x3b05('0x28');return db[_0x3b05('0x29')][_0x3b05('0x26')]({'where':{'type':_0x5b27a3,'resourceId':_0x59c554['id']}})[_0x3b05('0x25')](function(){return _0x44df9c;});})[_0x3b05('0x25')](function(){_0x1b5862[_0x3b05('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25356d,_0x4f527e){return function(_0x25d726){if(!_0x25d726){_0x25356d[_0x3b05('0x1c')](0x194);}return _0x25d726;};}function handleError(_0x217459,_0x336575){_0x336575=_0x336575||0x1f4;return function(_0x2f896a){logger[_0x3b05('0x2a')](_0x2f896a['stack']);if(_0x2f896a[_0x3b05('0x2b')]){delete _0x2f896a[_0x3b05('0x2b')];}_0x217459[_0x3b05('0x1d')](_0x336575)[_0x3b05('0x2c')](_0x2f896a);};}exports[_0x3b05('0x2d')]=function(_0x1a8cb5,_0x518737){var _0x1d43de={},_0x241d4a={},_0xe8c0a2={'count':0x0,'rows':[]};var _0x9d9b31=_[_0x3b05('0x2e')](db[_0x3b05('0x2f')][_0x3b05('0x30')],function(_0x5e7e44){return{'name':_0x5e7e44[_0x3b05('0x31')],'type':_0x5e7e44[_0x3b05('0x32')][_0x3b05('0x33')]};});_0x241d4a['model']=_[_0x3b05('0x2e')](_0x9d9b31,_0x3b05('0x2b'));_0x241d4a[_0x3b05('0x34')]=_[_0x3b05('0x35')](_0x1a8cb5[_0x3b05('0x34')]);_0x241d4a['filters']=_['intersection'](_0x241d4a[_0x3b05('0x36')],_0x241d4a[_0x3b05('0x34')]);_0x1d43de[_0x3b05('0x37')]=_[_0x3b05('0x38')](_0x241d4a['model'],qs[_0x3b05('0x39')](_0x1a8cb5[_0x3b05('0x34')]['fields']));_0x1d43de[_0x3b05('0x37')]=_0x1d43de[_0x3b05('0x37')][_0x3b05('0x3a')]?_0x1d43de['attributes']:_0x241d4a[_0x3b05('0x36')];if(!_0x1a8cb5[_0x3b05('0x34')][_0x3b05('0x3b')]('nolimit')){_0x1d43de['limit']=qs[_0x3b05('0x20')](_0x1a8cb5[_0x3b05('0x34')]['limit']);_0x1d43de[_0x3b05('0x22')]=qs['offset'](_0x1a8cb5[_0x3b05('0x34')][_0x3b05('0x22')]);}_0x1d43de[_0x3b05('0x3c')]=qs[_0x3b05('0x3d')](_0x1a8cb5[_0x3b05('0x34')]['sort']);_0x1d43de[_0x3b05('0x3e')]=qs[_0x3b05('0x3f')](_[_0x3b05('0x40')](_0x1a8cb5['query'],_0x241d4a[_0x3b05('0x3f')]),_0x9d9b31);if(_0x1a8cb5['query'][_0x3b05('0x41')]){_0x1d43de[_0x3b05('0x3e')]=_[_0x3b05('0x42')](_0x1d43de[_0x3b05('0x3e')],{'$or':_[_0x3b05('0x2e')](_0x9d9b31,function(_0x7f8485){if(_0x7f8485[_0x3b05('0x32')]!==_0x3b05('0x43')){var _0x2add4f={};_0x2add4f[_0x7f8485[_0x3b05('0x2b')]]={'$like':'%'+_0x1a8cb5['query'][_0x3b05('0x41')]+'%'};return _0x2add4f;}})});}_0x1d43de=_[_0x3b05('0x42')]({},_0x1d43de,_0x1a8cb5[_0x3b05('0x44')]);var _0x256ea7={'where':_0x1d43de[_0x3b05('0x3e')]};return db[_0x3b05('0x2f')][_0x3b05('0x21')](_0x256ea7)[_0x3b05('0x25')](function(_0x59860d){_0xe8c0a2[_0x3b05('0x21')]=_0x59860d;if(_0x1a8cb5[_0x3b05('0x34')]['includeAll']){_0x1d43de['include']=[{'all':!![]}];}return db[_0x3b05('0x2f')][_0x3b05('0x45')](_0x1d43de);})[_0x3b05('0x25')](function(_0x5dd08b){_0xe8c0a2[_0x3b05('0x46')]=_0x5dd08b;return _0xe8c0a2;})[_0x3b05('0x25')](respondWithFilteredResult(_0x518737,_0x1d43de))[_0x3b05('0x47')](handleError(_0x518737,null));};exports[_0x3b05('0x48')]=function(_0x313d82,_0x5036c5){var _0x17da33={'raw':!![],'where':{'id':_0x313d82[_0x3b05('0x49')]['id']}},_0x4b638b={};_0x4b638b[_0x3b05('0x36')]=_[_0x3b05('0x35')](db[_0x3b05('0x2f')][_0x3b05('0x30')]);_0x4b638b[_0x3b05('0x34')]=_[_0x3b05('0x35')](_0x313d82[_0x3b05('0x34')]);_0x4b638b[_0x3b05('0x3f')]=_[_0x3b05('0x38')](_0x4b638b[_0x3b05('0x36')],_0x4b638b[_0x3b05('0x34')]);_0x17da33[_0x3b05('0x37')]=_['intersection'](_0x4b638b['model'],qs[_0x3b05('0x39')](_0x313d82[_0x3b05('0x34')][_0x3b05('0x39')]));_0x17da33[_0x3b05('0x37')]=_0x17da33['attributes'][_0x3b05('0x3a')]?_0x17da33[_0x3b05('0x37')]:_0x4b638b[_0x3b05('0x36')];if(_0x313d82[_0x3b05('0x34')]['includeAll']){_0x17da33['include']=[{'all':!![]}];}_0x17da33=_[_0x3b05('0x42')]({},_0x17da33,_0x313d82['options']);return db[_0x3b05('0x2f')][_0x3b05('0x4a')](_0x17da33)[_0x3b05('0x25')](handleEntityNotFound(_0x5036c5,null))['then'](respondWithResult(_0x5036c5,null))['catch'](handleError(_0x5036c5,null));};exports[_0x3b05('0x4b')]=function(_0x4b9444,_0x17cb87){return db['Variable']['create'](_0x4b9444[_0x3b05('0x4c')],{})[_0x3b05('0x25')](function(_0x7a0f5b){var _0x3d52b3=_0x4b9444[_0x3b05('0x4d')][_0x3b05('0x27')]({'plain':!![]});if(!_0x3d52b3)throw new Error(_0x3b05('0x4e'));if(_0x3d52b3[_0x3b05('0x4f')]===_0x3b05('0x4d')){var _0x2b3971=_0x7a0f5b[_0x3b05('0x27')]({'plain':!![]});var _0x150ac3=_0x3b05('0x28');return db[_0x3b05('0x50')][_0x3b05('0x4a')]({'where':{'name':_0x150ac3,'userProfileId':_0x3d52b3[_0x3b05('0x51')]},'raw':!![]})['then'](function(_0xe26dd8){if(_0xe26dd8&&_0xe26dd8[_0x3b05('0x52')]===0x0){return db[_0x3b05('0x29')][_0x3b05('0x4b')]({'name':_0x2b3971['name'],'resourceId':_0x2b3971['id'],'type':_0xe26dd8['name'],'sectionId':_0xe26dd8['id']},{})[_0x3b05('0x25')](function(){return _0x7a0f5b;});}else{return _0x7a0f5b;}})[_0x3b05('0x47')](function(_0x24b305){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24b305);throw _0x24b305;});}return _0x7a0f5b;})['then'](respondWithResult(_0x17cb87,0xc9))[_0x3b05('0x47')](handleError(_0x17cb87,null));};exports[_0x3b05('0x53')]=function(_0x3991d4,_0x29897b){if(_0x3991d4[_0x3b05('0x4c')]['id']){delete _0x3991d4[_0x3b05('0x4c')]['id'];}return db[_0x3b05('0x2f')][_0x3b05('0x4a')]({'where':{'id':_0x3991d4['params']['id']}})[_0x3b05('0x25')](handleEntityNotFound(_0x29897b,null))[_0x3b05('0x25')](saveUpdates(_0x3991d4[_0x3b05('0x4c')],null))[_0x3b05('0x25')](respondWithResult(_0x29897b,null))[_0x3b05('0x47')](handleError(_0x29897b,null));};exports[_0x3b05('0x26')]=function(_0xfa37e1,_0x48efd5){return db[_0x3b05('0x2f')][_0x3b05('0x4a')]({'where':{'id':_0xfa37e1[_0x3b05('0x49')]['id']}})[_0x3b05('0x25')](handleEntityNotFound(_0x48efd5,null))[_0x3b05('0x25')](removeEntity(_0x48efd5,null))['catch'](handleError(_0x48efd5,null));}; \ No newline at end of file +var _0x8953=['mustache','sox','ejs','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Variables','UserProfileResource','end','error','name','send','map','Variable','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xd80264,_0x4ddf21){var _0x55da7c=function(_0x124fae){while(--_0x124fae){_0xd80264['push'](_0xd80264['shift']());}};_0x55da7c(++_0x4ddf21);}(_0x8953,0x180));var _0x3895=function(_0x11fdb4,_0x126ff0){_0x11fdb4=_0x11fdb4-0x0;var _0x7a2344=_0x8953[_0x11fdb4];return _0x7a2344;};'use strict';var emlformat=require(_0x3895('0x0'));var rimraf=require(_0x3895('0x1'));var zipdir=require(_0x3895('0x2'));var jsonpatch=require(_0x3895('0x3'));var rp=require(_0x3895('0x4'));var moment=require(_0x3895('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3895('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3895('0x7'));var csv=require('to-csv');var ejs=require(_0x3895('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3895('0x9'));var crypto=require(_0x3895('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3895('0xb'));var querystring=require(_0x3895('0xc'));var Papa=require('papaparse');var Redis=require(_0x3895('0xd'));var authService=require(_0x3895('0xe'));var qs=require(_0x3895('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3895('0x10'));var logger=require('../../config/logger')(_0x3895('0x11'));var utils=require(_0x3895('0x12'));var config=require(_0x3895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3895('0x14'))['db'];function respondWithStatusCode(_0x39bc53,_0x79c641){_0x79c641=_0x79c641||0xcc;return function(_0x5b4eae){if(_0x5b4eae){return _0x39bc53[_0x3895('0x15')](_0x79c641);}return _0x39bc53[_0x3895('0x16')](_0x79c641)['end']();};}function respondWithResult(_0x1d8404,_0x2da76b){_0x2da76b=_0x2da76b||0xc8;return function(_0x478c3b){if(_0x478c3b){return _0x1d8404[_0x3895('0x16')](_0x2da76b)[_0x3895('0x17')](_0x478c3b);}};}function respondWithFilteredResult(_0x247f80,_0x1c3928){return function(_0x16ab3c){if(_0x16ab3c){var _0x15e351=typeof _0x1c3928[_0x3895('0x18')]===_0x3895('0x19')&&typeof _0x1c3928[_0x3895('0x1a')]===_0x3895('0x19');var _0x440724=_0x16ab3c['count'];var _0x4b449f=_0x15e351?0x0:_0x1c3928[_0x3895('0x18')];var _0x558ee5=_0x15e351?_0x16ab3c[_0x3895('0x1b')]:_0x1c3928[_0x3895('0x18')]+_0x1c3928[_0x3895('0x1a')];var _0x504433;if(_0x558ee5>=_0x440724){_0x558ee5=_0x440724;_0x504433=0xc8;}else{_0x504433=0xce;}_0x247f80[_0x3895('0x16')](_0x504433);return _0x247f80[_0x3895('0x1c')](_0x3895('0x1d'),_0x4b449f+'-'+_0x558ee5+'/'+_0x440724)[_0x3895('0x17')](_0x16ab3c);}return null;};}function patchUpdates(_0x57b3ed){return function(_0x42041e){try{jsonpatch['apply'](_0x42041e,_0x57b3ed,!![]);}catch(_0x43541d){return BPromise['reject'](_0x43541d);}return _0x42041e[_0x3895('0x1e')]();};}function saveUpdates(_0x12414b,_0x4d5858){return function(_0x2c4e05){if(_0x2c4e05){return _0x2c4e05[_0x3895('0x1f')](_0x12414b)[_0x3895('0x20')](function(_0x1ca863){return _0x1ca863;});}return null;};}function removeEntity(_0x101f74,_0x3a06ff){return function(_0x2ca055){if(_0x2ca055){return _0x2ca055[_0x3895('0x21')]()[_0x3895('0x20')](function(){var _0x548369=_0x2ca055[_0x3895('0x22')]({'plain':!![]});var _0x587ba7=_0x3895('0x23');return db[_0x3895('0x24')][_0x3895('0x21')]({'where':{'type':_0x587ba7,'resourceId':_0x548369['id']}})[_0x3895('0x20')](function(){return _0x2ca055;});})[_0x3895('0x20')](function(){_0x101f74[_0x3895('0x16')](0xcc)[_0x3895('0x25')]();});}};}function handleEntityNotFound(_0x8330da,_0x8ac50d){return function(_0x5cd866){if(!_0x5cd866){_0x8330da[_0x3895('0x15')](0x194);}return _0x5cd866;};}function handleError(_0x2c0ea6,_0xea3a55){_0xea3a55=_0xea3a55||0x1f4;return function(_0x320367){logger[_0x3895('0x26')](_0x320367['stack']);if(_0x320367[_0x3895('0x27')]){delete _0x320367[_0x3895('0x27')];}_0x2c0ea6[_0x3895('0x16')](_0xea3a55)[_0x3895('0x28')](_0x320367);};}exports['index']=function(_0x23cf6f,_0x24eb00){var _0x380b6d={},_0x418e87={},_0x2b548f={'count':0x0,'rows':[]};var _0x260a81=_[_0x3895('0x29')](db[_0x3895('0x2a')][_0x3895('0x2b')],function(_0x1fab66){return{'name':_0x1fab66[_0x3895('0x2c')],'type':_0x1fab66[_0x3895('0x2d')]['key']};});_0x418e87[_0x3895('0x2e')]=_['map'](_0x260a81,'name');_0x418e87['query']=_[_0x3895('0x2f')](_0x23cf6f[_0x3895('0x30')]);_0x418e87[_0x3895('0x31')]=_[_0x3895('0x32')](_0x418e87[_0x3895('0x2e')],_0x418e87['query']);_0x380b6d[_0x3895('0x33')]=_[_0x3895('0x32')](_0x418e87[_0x3895('0x2e')],qs[_0x3895('0x34')](_0x23cf6f['query'][_0x3895('0x34')]));_0x380b6d[_0x3895('0x33')]=_0x380b6d[_0x3895('0x33')][_0x3895('0x35')]?_0x380b6d['attributes']:_0x418e87[_0x3895('0x2e')];if(!_0x23cf6f[_0x3895('0x30')][_0x3895('0x36')](_0x3895('0x37'))){_0x380b6d['limit']=qs['limit'](_0x23cf6f['query'][_0x3895('0x1a')]);_0x380b6d[_0x3895('0x18')]=qs[_0x3895('0x18')](_0x23cf6f['query'][_0x3895('0x18')]);}_0x380b6d['order']=qs[_0x3895('0x38')](_0x23cf6f[_0x3895('0x30')][_0x3895('0x38')]);_0x380b6d[_0x3895('0x39')]=qs[_0x3895('0x31')](_[_0x3895('0x3a')](_0x23cf6f['query'],_0x418e87['filters']),_0x260a81);if(_0x23cf6f[_0x3895('0x30')][_0x3895('0x3b')]){_0x380b6d[_0x3895('0x39')]=_['merge'](_0x380b6d['where'],{'$or':_[_0x3895('0x29')](_0x260a81,function(_0x41cb3e){if(_0x41cb3e[_0x3895('0x2d')]!==_0x3895('0x3c')){var _0x1c4b87={};_0x1c4b87[_0x41cb3e[_0x3895('0x27')]]={'$like':'%'+_0x23cf6f[_0x3895('0x30')][_0x3895('0x3b')]+'%'};return _0x1c4b87;}})});}_0x380b6d=_['merge']({},_0x380b6d,_0x23cf6f[_0x3895('0x3d')]);var _0x27d124={'where':_0x380b6d[_0x3895('0x39')]};return db['Variable'][_0x3895('0x1b')](_0x27d124)[_0x3895('0x20')](function(_0x50f07b){_0x2b548f['count']=_0x50f07b;if(_0x23cf6f[_0x3895('0x30')]['includeAll']){_0x380b6d[_0x3895('0x3e')]=[{'all':!![]}];}return db[_0x3895('0x2a')][_0x3895('0x3f')](_0x380b6d);})[_0x3895('0x20')](function(_0x283ac1){_0x2b548f[_0x3895('0x40')]=_0x283ac1;return _0x2b548f;})[_0x3895('0x20')](respondWithFilteredResult(_0x24eb00,_0x380b6d))[_0x3895('0x41')](handleError(_0x24eb00,null));};exports['show']=function(_0x228221,_0x205f2c){var _0x20860a={'raw':!![],'where':{'id':_0x228221['params']['id']}},_0x3e219b={};_0x3e219b[_0x3895('0x2e')]=_[_0x3895('0x2f')](db[_0x3895('0x2a')][_0x3895('0x2b')]);_0x3e219b[_0x3895('0x30')]=_[_0x3895('0x2f')](_0x228221[_0x3895('0x30')]);_0x3e219b[_0x3895('0x31')]=_[_0x3895('0x32')](_0x3e219b[_0x3895('0x2e')],_0x3e219b[_0x3895('0x30')]);_0x20860a[_0x3895('0x33')]=_['intersection'](_0x3e219b[_0x3895('0x2e')],qs[_0x3895('0x34')](_0x228221['query']['fields']));_0x20860a[_0x3895('0x33')]=_0x20860a[_0x3895('0x33')][_0x3895('0x35')]?_0x20860a[_0x3895('0x33')]:_0x3e219b[_0x3895('0x2e')];if(_0x228221[_0x3895('0x30')][_0x3895('0x42')]){_0x20860a[_0x3895('0x3e')]=[{'all':!![]}];}_0x20860a=_[_0x3895('0x43')]({},_0x20860a,_0x228221['options']);return db['Variable']['find'](_0x20860a)[_0x3895('0x20')](handleEntityNotFound(_0x205f2c,null))[_0x3895('0x20')](respondWithResult(_0x205f2c,null))[_0x3895('0x41')](handleError(_0x205f2c,null));};exports[_0x3895('0x44')]=function(_0x37fa1c,_0x56c373){return db[_0x3895('0x2a')][_0x3895('0x44')](_0x37fa1c[_0x3895('0x45')],{})[_0x3895('0x20')](function(_0xeea083){var _0x5ca404=_0x37fa1c[_0x3895('0x46')]['get']({'plain':!![]});if(!_0x5ca404)throw new Error(_0x3895('0x47'));if(_0x5ca404[_0x3895('0x48')]===_0x3895('0x46')){var _0x40b979=_0xeea083['get']({'plain':!![]});var _0x2a3dc1='Variables';return db[_0x3895('0x49')][_0x3895('0x4a')]({'where':{'name':_0x2a3dc1,'userProfileId':_0x5ca404[_0x3895('0x4b')]},'raw':!![]})['then'](function(_0x2c72d3){if(_0x2c72d3&&_0x2c72d3['autoAssociation']===0x0){return db[_0x3895('0x24')]['create']({'name':_0x40b979[_0x3895('0x27')],'resourceId':_0x40b979['id'],'type':_0x2c72d3[_0x3895('0x27')],'sectionId':_0x2c72d3['id']},{})[_0x3895('0x20')](function(){return _0xeea083;});}else{return _0xeea083;}})[_0x3895('0x41')](function(_0x14d7f8){logger[_0x3895('0x26')](_0x3895('0x4c'),_0x14d7f8);throw _0x14d7f8;});}return _0xeea083;})[_0x3895('0x20')](respondWithResult(_0x56c373,0xc9))['catch'](handleError(_0x56c373,null));};exports[_0x3895('0x1f')]=function(_0x2f1f86,_0xe75e4c){if(_0x2f1f86[_0x3895('0x45')]['id']){delete _0x2f1f86[_0x3895('0x45')]['id'];}return db['Variable'][_0x3895('0x4a')]({'where':{'id':_0x2f1f86[_0x3895('0x4d')]['id']}})[_0x3895('0x20')](handleEntityNotFound(_0xe75e4c,null))['then'](saveUpdates(_0x2f1f86[_0x3895('0x45')],null))[_0x3895('0x20')](respondWithResult(_0xe75e4c,null))[_0x3895('0x41')](handleError(_0xe75e4c,null));};exports[_0x3895('0x21')]=function(_0x35df2f,_0x4caea9){return db[_0x3895('0x2a')][_0x3895('0x4a')]({'where':{'id':_0x35df2f['params']['id']}})['then'](handleEntityNotFound(_0x4caea9,null))['then'](removeEntity(_0x4caea9,null))[_0x3895('0x41')](handleError(_0x4caea9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 7592e07..a7391b6 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 _0x8a0b=['exports','define','Variable','tools_variables','lodash','util','api','path','rimraf','../../config/environment'];(function(_0x4b6656,_0x45afa6){var _0x3b7d94=function(_0x2c6a19){while(--_0x2c6a19){_0x4b6656['push'](_0x4b6656['shift']());}};_0x3b7d94(++_0x45afa6);}(_0x8a0b,0x158));var _0xb8a0=function(_0x36f3ec,_0xe7c820){_0x36f3ec=_0x36f3ec-0x0;var _0x731e5a=_0x8a0b[_0x36f3ec];return _0x731e5a;};'use strict';var _=require(_0xb8a0('0x0'));var util=require(_0xb8a0('0x1'));var logger=require('../../config/logger')(_0xb8a0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8a0('0x3'));var rimraf=require(_0xb8a0('0x4'));var config=require(_0xb8a0('0x5'));var attributes=require('./variable.attributes');module[_0xb8a0('0x6')]=function(_0x88f74a,_0x331cbc){return _0x88f74a[_0xb8a0('0x7')](_0xb8a0('0x8'),attributes,{'tableName':_0xb8a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2e0=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','define','tools_variables','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb2e0,0x185));var _0x0b2e=function(_0x3b5a97,_0x228e2d){_0x3b5a97=_0x3b5a97-0x0;var _0x4270c7=_0xb2e0[_0x3b5a97];return _0x4270c7;};'use strict';var _=require('lodash');var util=require(_0x0b2e('0x0'));var logger=require(_0x0b2e('0x1'))('api');var moment=require(_0x0b2e('0x2'));var BPromise=require(_0x0b2e('0x3'));var rp=require(_0x0b2e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b2e('0x5'));var config=require(_0x0b2e('0x6'));var attributes=require(_0x0b2e('0x7'));module['exports']=function(_0xf69185,_0x16a7a6){return _0xf69185[_0x0b2e('0x8')]('Variable',attributes,{'tableName':_0x0b2e('0x9'),'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 2e2eaaa..40b5722 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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x15c206,_0x21de98){var _0x4b610e=function(_0x557dcc){while(--_0x557dcc){_0x15c206['push'](_0x15c206['shift']());}};_0x4b610e(++_0x21de98);}(_0xabce,0x103));var _0xeabc=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xabce[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x2a6119,_0x4c5639){var _0x1577a7=function(_0x25c309){while(--_0x25c309){_0x2a6119['push'](_0x2a6119['shift']());}};_0x1577a7(++_0x4c5639);}(_0x814b,0x1a2));var _0xb814=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x814b[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index dd10855..e491145 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 _0xb965=['canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xb965,0x1d9));var _0x5b96=function(_0x35009a,_0x4c647b){_0x35009a=_0x35009a-0x0;var _0x41ae8a=_0xb965[_0x35009a];return _0x41ae8a;};'use strict';var express=require(_0x5b96('0x0'));var router=express['Router']();var auth=require(_0x5b96('0x1'));var controller=require(_0x5b96('0x2'));router['get']('/',controller[_0x5b96('0x3')]);router[_0x5b96('0x4')](_0x5b96('0x5'),auth[_0x5b96('0x6')](),auth[_0x5b96('0x7')](),controller['fetch']);router['get']('/reset',auth[_0x5b96('0x6')](),auth[_0x5b96('0x7')](),controller[_0x5b96('0x8')]);router[_0x5b96('0x4')](_0x5b96('0x9'),auth[_0x5b96('0x6')](),auth[_0x5b96('0x7')](),controller[_0x5b96('0xa')]);router[_0x5b96('0x4')](_0x5b96('0xb'),auth['isAuthenticated'](),controller[_0x5b96('0xc')]);router[_0x5b96('0x4')](_0x5b96('0xd'),controller[_0x5b96('0xe')]);module[_0x5b96('0xf')]=router; \ No newline at end of file +var _0x218a=['pull','/restart','restart','/migrations','exports','express','Router','index','get','/fetch','canUpdate','fetch','/reset','isAuthenticated','reset'];(function(_0x102e00,_0x36bdef){var _0x5c28c8=function(_0x186e96){while(--_0x186e96){_0x102e00['push'](_0x102e00['shift']());}};_0x5c28c8(++_0x36bdef);}(_0x218a,0x1f4));var _0xa218=function(_0x372aae,_0x3f56ef){_0x372aae=_0x372aae-0x0;var _0x1ef48e=_0x218a[_0x372aae];return _0x1ef48e;};'use strict';var express=require(_0xa218('0x0'));var router=express[_0xa218('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router['get']('/',controller[_0xa218('0x2')]);router[_0xa218('0x3')](_0xa218('0x4'),auth['isAuthenticated'](),auth[_0xa218('0x5')](),controller[_0xa218('0x6')]);router[_0xa218('0x3')](_0xa218('0x7'),auth[_0xa218('0x8')](),auth[_0xa218('0x5')](),controller[_0xa218('0x9')]);router[_0xa218('0x3')]('/pull',auth[_0xa218('0x8')](),auth['canUpdate'](),controller[_0xa218('0xa')]);router[_0xa218('0x3')](_0xa218('0xb'),auth[_0xa218('0x8')](),controller[_0xa218('0xc')]);router[_0xa218('0x3')](_0xa218('0xd'),controller['migrations']);module[_0xa218('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e46cd01..43f636c 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 _0x7119=['tags','exports','2.0.0','status','json','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','server','length','replace','.js','push','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','query','latest','fetch'];(function(_0x28c0bc,_0x22976c){var _0x5df548=function(_0x22cf7e){while(--_0x22cf7e){_0x28c0bc['push'](_0x28c0bc['shift']());}};_0x5df548(++_0x22976c);}(_0x7119,0xcc));var _0x9711=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x7119[_0xe2c95e];return _0x42ce6f;};'use strict';var Umzug=require(_0x9711('0x0'));var path=require(_0x9711('0x1'));var fs=require('fs');var _=require(_0x9711('0x2'));var pkginfo=require(_0x9711('0x3'))(module,_0x9711('0x4'));var compareVersions=require(_0x9711('0x5'));var exec=require(_0x9711('0x6'))[_0x9711('0x7')];var db=require(_0x9711('0x8'))['db'];var config=require(_0x9711('0x9'));var pm2=require(_0x9711('0xa'));var logger=require('../../config/logger')('update');var git=require(_0x9711('0xb'))(config[_0x9711('0xc')]);exports['index']=function(_0x4a3431,_0x33bc9c){var _0x151d03={'current':module['exports'][_0x9711('0x4')],'phonebar':0x2};if(_0x4a3431[_0x9711('0xd')]&&_0x4a3431['query'][_0x9711('0xe')]){return git[_0x9711('0xf')]()[_0x9711('0x10')](function(_0x277675,_0x39a4ac){_0x151d03[_0x9711('0xe')]=(_0x277675?module[_0x9711('0x11')][_0x9711('0x4')]:_0x39a4ac['latest'])||_0x9711('0x12');return _0x33bc9c[_0x9711('0x13')](0xc8)['json'](_0x151d03);});}else{return _0x33bc9c[_0x9711('0x13')](0xc8)[_0x9711('0x14')](_0x151d03);}};exports[_0x9711('0xf')]=function(_0x2ac293,_0x294d8c){return git['fetch'](['origin',_0x9711('0x15')],function(_0x171136){if(_0x171136){logger[_0x9711('0x16')](_0x171136);return _0x294d8c['status'](0x1f4)[_0x9711('0x14')](_0x171136);}logger['info'](_0x9711('0x17'));return _0x294d8c[_0x9711('0x13')](0xc8)[_0x9711('0x14')]({'output':_0x9711('0x18')});});};exports['reset']=function(_0x39478b,_0x4110da){return git[_0x9711('0x19')]([_0x9711('0x1a'),_0x9711('0x1b')],function(_0xd1e29f){if(_0xd1e29f){logger[_0x9711('0x16')](_0xd1e29f);return _0x4110da['status'](0x1f4)[_0x9711('0x14')](_0xd1e29f);}logger[_0x9711('0x1c')](_0x9711('0x1d'));return _0x4110da[_0x9711('0x13')](0xc8)[_0x9711('0x14')]({'output':_0x9711('0x1e')});});};exports['pull']=function(_0x5ab749,_0x57aa60){exec(_0x9711('0x1f'),function(_0x4b6412,_0x39cea8,_0x68b3af){logger['info'](_0x39cea8);logger[_0x9711('0x1c')](_0x68b3af);if(_0x4b6412){logger[_0x9711('0x16')](_0x4b6412);return _0x57aa60[_0x9711('0x13')](0x1f4)['json'](_0x4b6412);}return _0x57aa60[_0x9711('0x13')](0xc8)[_0x9711('0x14')]({'output':_0x39cea8});});};exports['restart']=function(_0x33b28d,_0x151dcf){return pm2[_0x9711('0x20')]('motion2')[_0x9711('0x21')](function(_0x3fbb15){logger[_0x9711('0x1c')](_0x9711('0x22'),_0x3fbb15);return _0x151dcf['status'](0xc8)[_0x9711('0x14')]({'output':_0x9711('0x23')});})[_0x9711('0x24')](function(_0xf626de){logger[_0x9711('0x16')](_0xf626de);return _0x151dcf[_0x9711('0x13')](0x1f4)[_0x9711('0x14')](_0xf626de);});};exports[_0x9711('0x25')]=function(_0x3b5231,_0x448536){var _0x5b44d2=fs['readdirSync'](path['join'](config[_0x9711('0xc')],_0x9711('0x26'),_0x9711('0x25')));var _0x17c10d=[];for(var _0x4e0a01=0x0;_0x4e0a01<_0x5b44d2[_0x9711('0x27')];_0x4e0a01++){var _0x3de582=_0x5b44d2[_0x4e0a01][_0x9711('0x28')](_0x9711('0x29'),'');if(compareVersions(module[_0x9711('0x11')][_0x9711('0x4')],_0x3de582)===-0x1){_0x17c10d[_0x9711('0x2a')](_0x3de582);}}if(_0x17c10d[_0x9711('0x27')]){var _0xf82438=_0x17c10d['sort'](compareVersions);var _0x5910d1=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x9711('0x2b')],'modelName':_0x9711('0x2b'),'columnName':_0x9711('0x4')},'migrations':{'params':[db[_0x9711('0x2c')][_0x9711('0x2d')](),db[_0x9711('0x2c')][_0x9711('0x2e')],function(){throw new Error(_0x9711('0x2f'));}],'path':path[_0x9711('0x30')](config[_0x9711('0xc')],'server',_0x9711('0x25')),'pattern':/\.js$/}});_0x5910d1['up']({'migrations':_[_0x9711('0x31')](_0xf82438,function(_0x1c0905){return _0x1c0905+_0x9711('0x29');})})[_0x9711('0x21')](function(){return _0x448536[_0x9711('0x13')](0xc8)[_0x9711('0x14')]({'output':_0x9711('0x32')+module[_0x9711('0x11')][_0x9711('0x4')]+_0x9711('0x33')+_[_0x9711('0x34')](_0xf82438),'migrations':_[_0x9711('0x30')](_0xf82438)});})['catch'](function(_0x118276){if(_0x118276 instanceof db[_0x9711('0x2c')][_0x9711('0x35')]){return _0x448536[_0x9711('0x13')](0xc8)[_0x9711('0x14')]({'output':_0x9711('0x36')});}else{return _0x448536[_0x9711('0x13')](0x1f4)[_0x9711('0x14')](_0x118276);}});}else{return _0x448536[_0x9711('0x13')](0xc8)['json']({'output':_0x9711('0x36')});}}; \ No newline at end of file +var _0xb011=['\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','version','query','fetch','latest','2.0.0','json','status','origin','error','git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','length','replace','exports','push','sequelize','Migration','getQueryInterface','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20'];(function(_0x395e83,_0x3663a4){var _0x2a25d8=function(_0x1e8b2c){while(--_0x1e8b2c){_0x395e83['push'](_0x395e83['shift']());}};_0x2a25d8(++_0x3663a4);}(_0xb011,0xc8));var _0x1b01=function(_0x6396ed,_0x64de38){_0x6396ed=_0x6396ed-0x0;var _0x3e86ef=_0xb011[_0x6396ed];return _0x3e86ef;};'use strict';var Umzug=require(_0x1b01('0x0'));var path=require(_0x1b01('0x1'));var fs=require('fs');var _=require(_0x1b01('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x1b01('0x3'))[_0x1b01('0x4')];var db=require(_0x1b01('0x5'))['db'];var config=require(_0x1b01('0x6'));var pm2=require(_0x1b01('0x7'));var logger=require(_0x1b01('0x8'))('update');var git=require(_0x1b01('0x9'))(config[_0x1b01('0xa')]);exports['index']=function(_0x3c9a84,_0x5249f6){var _0xd4e07d={'current':module['exports'][_0x1b01('0xb')],'phonebar':0x2};if(_0x3c9a84[_0x1b01('0xc')]&&_0x3c9a84['query']['latest']){return git[_0x1b01('0xd')]()['tags'](function(_0x3b57e0,_0x75e629){_0xd4e07d[_0x1b01('0xe')]=(_0x3b57e0?module['exports'][_0x1b01('0xb')]:_0x75e629['latest'])||_0x1b01('0xf');return _0x5249f6['status'](0xc8)[_0x1b01('0x10')](_0xd4e07d);});}else{return _0x5249f6[_0x1b01('0x11')](0xc8)[_0x1b01('0x10')](_0xd4e07d);}};exports['fetch']=function(_0xcbd818,_0x4450bc){return git[_0x1b01('0xd')]([_0x1b01('0x12'),'master'],function(_0x304e43){if(_0x304e43){logger[_0x1b01('0x13')](_0x304e43);return _0x4450bc[_0x1b01('0x11')](0x1f4)['json'](_0x304e43);}logger['info'](_0x1b01('0x14'));return _0x4450bc[_0x1b01('0x11')](0xc8)[_0x1b01('0x10')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x1b01('0x15')]=function(_0x4d8837,_0x22fa30){return git['reset']([_0x1b01('0x16'),_0x1b01('0x17')],function(_0x33d387){if(_0x33d387){logger[_0x1b01('0x13')](_0x33d387);return _0x22fa30[_0x1b01('0x11')](0x1f4)[_0x1b01('0x10')](_0x33d387);}logger[_0x1b01('0x18')](_0x1b01('0x19'));return _0x22fa30['status'](0xc8)[_0x1b01('0x10')]({'output':_0x1b01('0x1a')});});};exports['pull']=function(_0xc584b5,_0x4d9e6b){exec(_0x1b01('0x1b'),function(_0x53e28d,_0x350e96,_0x324d3f){logger['info'](_0x350e96);logger[_0x1b01('0x18')](_0x324d3f);if(_0x53e28d){logger['error'](_0x53e28d);return _0x4d9e6b[_0x1b01('0x11')](0x1f4)[_0x1b01('0x10')](_0x53e28d);}return _0x4d9e6b[_0x1b01('0x11')](0xc8)[_0x1b01('0x10')]({'output':_0x350e96});});};exports[_0x1b01('0x1c')]=function(_0x22e6d1,_0x46b701){return pm2[_0x1b01('0x1c')]('motion2')[_0x1b01('0x1d')](function(_0x225073){logger[_0x1b01('0x18')](_0x1b01('0x1e'),_0x225073);return _0x46b701[_0x1b01('0x11')](0xc8)[_0x1b01('0x10')]({'output':_0x1b01('0x1f')});})['catch'](function(_0x4493cc){logger[_0x1b01('0x13')](_0x4493cc);return _0x46b701[_0x1b01('0x11')](0x1f4)[_0x1b01('0x10')](_0x4493cc);});};exports[_0x1b01('0x20')]=function(_0x272c51,_0x13579c){var _0x5e1750=fs[_0x1b01('0x21')](path['join'](config[_0x1b01('0xa')],_0x1b01('0x22'),_0x1b01('0x20')));var _0x10aade=[];for(var _0x471b61=0x0;_0x471b61<_0x5e1750[_0x1b01('0x23')];_0x471b61++){var _0x454719=_0x5e1750[_0x471b61][_0x1b01('0x24')]('.js','');if(compareVersions(module[_0x1b01('0x25')]['version'],_0x454719)===-0x1){_0x10aade[_0x1b01('0x26')](_0x454719);}}if(_0x10aade[_0x1b01('0x23')]){var _0x40ff69=_0x10aade['sort'](compareVersions);var _0x501656=new Umzug({'storage':_0x1b01('0x27'),'storageOptions':{'model':db[_0x1b01('0x28')],'modelName':_0x1b01('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x1b01('0x27')][_0x1b01('0x29')](),db[_0x1b01('0x27')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config[_0x1b01('0xa')],_0x1b01('0x22'),_0x1b01('0x20')),'pattern':/\.js$/}});_0x501656['up']({'migrations':_[_0x1b01('0x2a')](_0x40ff69,function(_0x568d2a){return _0x568d2a+_0x1b01('0x2b');})})[_0x1b01('0x1d')](function(){return _0x13579c[_0x1b01('0x11')](0xc8)[_0x1b01('0x10')]({'output':_0x1b01('0x2c')+module[_0x1b01('0x25')][_0x1b01('0xb')]+_0x1b01('0x2d')+_['last'](_0x40ff69),'migrations':_['join'](_0x40ff69)});})[_0x1b01('0x2e')](function(_0x4a80f7){if(_0x4a80f7 instanceof db[_0x1b01('0x27')][_0x1b01('0x2f')]){return _0x13579c['status'](0xc8)['json']({'output':_0x1b01('0x30')});}else{return _0x13579c[_0x1b01('0x11')](0x1f4)[_0x1b01('0x10')](_0x4a80f7);}});}else{return _0x13579c[_0x1b01('0x11')](0xc8)[_0x1b01('0x10')]({'output':_0x1b01('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4a55816..e5cd439 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 _0xe474=['../../config/environment','get','index','/describe','isAuthenticated','/:id','show','create','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe474,0x1f2));var _0x4e47=function(_0x183782,_0x132ae0){_0x183782=_0x183782-0x0;var _0x5d2864=_0xe474[_0x183782];return _0x5d2864;};'use strict';var multer=require(_0x4e47('0x0'));var util=require(_0x4e47('0x1'));var path=require(_0x4e47('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e47('0x3')]();var fs_extra=require(_0x4e47('0x4'));var auth=require(_0x4e47('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e47('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x4e47('0x7')]('/',auth['isAuthenticated'](),controller[_0x4e47('0x8')]);router[_0x4e47('0x7')](_0x4e47('0x9'),auth[_0x4e47('0xa')](),controller['describe']);router[_0x4e47('0x7')](_0x4e47('0xb'),auth[_0x4e47('0xa')](),controller[_0x4e47('0xc')]);router['post']('/',auth[_0x4e47('0xa')](),controller[_0x4e47('0xd')]);router['put']('/:id',auth[_0x4e47('0xa')](),controller[_0x4e47('0xe')]);router[_0x4e47('0xf')](_0x4e47('0xb'),auth[_0x4e47('0xa')](),controller[_0x4e47('0x10')]);module[_0x4e47('0x11')]=router; \ No newline at end of file +var _0x45e2=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','post','create','put','/:id','update','destroy','exports','util','path'];(function(_0x2bd612,_0x5ebad4){var _0x882eec=function(_0x2b0cdb){while(--_0x2b0cdb){_0x2bd612['push'](_0x2bd612['shift']());}};_0x882eec(++_0x5ebad4);}(_0x45e2,0x1a0));var _0x245e=function(_0x25f13f,_0x325ab1){_0x25f13f=_0x25f13f-0x0;var _0x38332f=_0x45e2[_0x25f13f];return _0x38332f;};'use strict';var multer=require('multer');var util=require(_0x245e('0x0'));var path=require(_0x245e('0x1'));var timeout=require('connect-timeout');var express=require(_0x245e('0x2'));var router=express[_0x245e('0x3')]();var fs_extra=require(_0x245e('0x4'));var auth=require(_0x245e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x245e('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x245e('0x7')]('/',auth['isAuthenticated'](),controller[_0x245e('0x8')]);router[_0x245e('0x7')](_0x245e('0x9'),auth[_0x245e('0xa')](),controller[_0x245e('0xb')]);router[_0x245e('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x245e('0xc')]('/',auth[_0x245e('0xa')](),controller[_0x245e('0xd')]);router[_0x245e('0xe')](_0x245e('0xf'),auth['isAuthenticated'](),controller[_0x245e('0x10')]);router['delete'](_0x245e('0xf'),auth[_0x245e('0xa')](),controller[_0x245e('0x11')]);module[_0x245e('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 7316bdc..17b3680 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 _0x4fc2=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fc2,0x111));var _0x24fc=function(_0x3c6125,_0x3b2a9c){_0x3c6125=_0x3c6125-0x0;var _0x2f47b8=_0x4fc2[_0x3c6125];return _0x2f47b8;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'type':{'type':Sequelize[_0x24fc('0x2')]},'uniqueid':{'type':Sequelize[_0x24fc('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x24fc('0x2')]},'queue':{'type':Sequelize[_0x24fc('0x2')]},'interface':{'type':Sequelize[_0x24fc('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x24fc('0x3')]},'agentconnectAt':{'type':Sequelize[_0x24fc('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x24fc('0x3')]},'agentdumpAt':{'type':Sequelize[_0x24fc('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x24fc('0x5')]},'agentacw':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x24fc('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x24fc('0x2')]},'channel':{'type':Sequelize[_0x24fc('0x2')]},'channelstate':{'type':Sequelize[_0x24fc('0x5')]},'channelstatedesc':{'type':Sequelize[_0x24fc('0x2')]},'connectedlinenum':{'type':Sequelize[_0x24fc('0x2')]},'connectedlinename':{'type':Sequelize[_0x24fc('0x2')]},'language':{'type':Sequelize[_0x24fc('0x2')]},'accountcode':{'type':Sequelize[_0x24fc('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x24fc('0x2')]},'priority':{'type':Sequelize[_0x24fc('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x24fc('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x24fc('0x2')]},'destcalleridnum':{'type':Sequelize[_0x24fc('0x2')]},'destcalleridname':{'type':Sequelize[_0x24fc('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x24fc('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x24fc('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x24fc('0x2')]},'destcontext':{'type':Sequelize[_0x24fc('0x2')]},'destexten':{'type':Sequelize[_0x24fc('0x2')]},'destpriority':{'type':Sequelize[_0x24fc('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x24fc('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x24fc('0x2')],'comment':_0x24fc('0x6')},'transferexten':{'type':Sequelize[_0x24fc('0x2')]},'transferuniqueid':{'type':Sequelize[_0x24fc('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5454=['DATE','INTEGER','BOOLEAN','STRING'];(function(_0x462407,_0x27e8d4){var _0x243c3f=function(_0x16b705){while(--_0x16b705){_0x462407['push'](_0x462407['shift']());}};_0x243c3f(++_0x27e8d4);}(_0x5454,0x15b));var _0x4545=function(_0x4ffd35,_0x572e06){_0x4ffd35=_0x4ffd35-0x0;var _0xb1308a=_0x5454[_0x4ffd35];return _0xb1308a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4545('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4545('0x0')]},'membername':{'type':Sequelize[_0x4545('0x0')]},'agentcalledAt':{'type':Sequelize[_0x4545('0x1')]},'agentconnectAt':{'type':Sequelize[_0x4545('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x4545('0x1')]},'agentdumpAt':{'type':Sequelize[_0x4545('0x1')]},'holdtime':{'type':Sequelize[_0x4545('0x2')]},'agentcomplete':{'type':Sequelize[_0x4545('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4545('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4545('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4545('0x2')]},'agentacw':{'type':Sequelize[_0x4545('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4545('0x2')]},'reason':{'type':Sequelize[_0x4545('0x0')]},'lastevent':{'type':Sequelize[_0x4545('0x0')]},'channel':{'type':Sequelize[_0x4545('0x0')]},'channelstate':{'type':Sequelize[_0x4545('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4545('0x0')]},'connectedlinename':{'type':Sequelize[_0x4545('0x0')]},'language':{'type':Sequelize[_0x4545('0x0')]},'accountcode':{'type':Sequelize[_0x4545('0x0')]},'context':{'type':Sequelize[_0x4545('0x0')]},'exten':{'type':Sequelize[_0x4545('0x0')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x4545('0x0')]},'destchannelstate':{'type':Sequelize[_0x4545('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x4545('0x0')]},'destcalleridnum':{'type':Sequelize[_0x4545('0x0')]},'destcalleridname':{'type':Sequelize[_0x4545('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x4545('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x4545('0x0')]},'destlanguage':{'type':Sequelize[_0x4545('0x0')]},'destaccountcode':{'type':Sequelize[_0x4545('0x0')]},'destcontext':{'type':Sequelize[_0x4545('0x0')]},'destexten':{'type':Sequelize[_0x4545('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4545('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4545('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x4545('0x0')]},'transfer':{'type':Sequelize[_0x4545('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x4545('0x0')]},'transferuniqueid':{'type':Sequelize[_0x4545('0x0')]},'agententerreason':{'type':Sequelize[_0x4545('0x2')],'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 6c3988d..522af19 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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 6f5d3a6..93cfc69 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 _0x615a=['path','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x48c783,_0x30c848){var _0x1a2da2=function(_0x4c5b89){while(--_0x4c5b89){_0x48c783['push'](_0x48c783['shift']());}};_0x1a2da2(++_0x30c848);}(_0x615a,0x119));var _0xa615=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x615a[_0x2f54b6];return _0x169f21;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var logger=require(_0xa615('0x1'))('api');var moment=require(_0xa615('0x2'));var BPromise=require(_0xa615('0x3'));var rp=require(_0xa615('0x4'));var fs=require('fs');var path=require(_0xa615('0x5'));var rimraf=require('rimraf');var config=require(_0xa615('0x6'));var attributes=require(_0xa615('0x7'));module['exports']=function(_0x320680,_0x5d04bd){return _0x320680[_0xa615('0x8')](_0xa615('0x9'),attributes,{'tableName':_0xa615('0xa'),'paranoid':![],'indexes':[{'fields':[_0xa615('0xb'),_0xa615('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcea5=['api','moment','request-promise','path','rimraf','../../config/environment','exports','uniqueid','destuniqueid','lodash','util','../../config/logger'];(function(_0x4b1b8f,_0x375dd8){var _0xf4541a=function(_0x484d45){while(--_0x484d45){_0x4b1b8f['push'](_0x4b1b8f['shift']());}};_0xf4541a(++_0x375dd8);}(_0xcea5,0xed));var _0x5cea=function(_0x2f6515,_0x3f9118){_0x2f6515=_0x2f6515-0x0;var _0x392f77=_0xcea5[_0x2f6515];return _0x392f77;};'use strict';var _=require(_0x5cea('0x0'));var util=require(_0x5cea('0x1'));var logger=require(_0x5cea('0x2'))(_0x5cea('0x3'));var moment=require(_0x5cea('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cea('0x5'));var fs=require('fs');var path=require(_0x5cea('0x6'));var rimraf=require(_0x5cea('0x7'));var config=require(_0x5cea('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0x5cea('0x9')]=function(_0x31e6f3,_0x599bc5){return _0x31e6f3['define']('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5cea('0xa'),_0x5cea('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 78d689e..543d900 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 _0x5616=['info','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','limit','lodash','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceAgentReport,\x20%s,\x20%s','message'];(function(_0xa984b7,_0xbd57c4){var _0x3c2b49=function(_0xeb82fa){while(--_0xeb82fa){_0xa984b7['push'](_0xa984b7['shift']());}};_0x3c2b49(++_0xbd57c4);}(_0x5616,0x1b0));var _0x6561=function(_0xafa93c,_0x3e7f38){_0xafa93c=_0xafa93c-0x0;var _0x51b7b7=_0x5616[_0xafa93c];return _0x51b7b7;};'use strict';var _=require(_0x6561('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6561('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x6561('0x2'));var logger=require(_0x6561('0x3'))(_0x6561('0x4'));var config=require('../../config/environment');var jayson=require(_0x6561('0x5'));var client=jayson['client'][_0x6561('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x59a4bf,_0x37db11,_0x572654){return new BPromise(function(_0x32f0b8,_0x440363){return client[_0x6561('0x7')](_0x59a4bf,_0x572654)[_0x6561('0x8')](function(_0x593a65){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x37db11,'request\x20sent');logger[_0x6561('0x9')](_0x6561('0xa'),_0x37db11,_0x6561('0xb'),JSON[_0x6561('0xc')](_0x593a65));if(_0x593a65[_0x6561('0xd')]){if(_0x593a65[_0x6561('0xd')]['code']===0x1f4){logger[_0x6561('0xd')](_0x6561('0xe'),_0x37db11,_0x593a65[_0x6561('0xd')][_0x6561('0xf')]);return _0x440363(_0x593a65['error'][_0x6561('0xf')]);}logger[_0x6561('0xd')](_0x6561('0xe'),_0x37db11,_0x593a65[_0x6561('0xd')]['message']);return _0x32f0b8(_0x593a65['error']['message']);}else{logger[_0x6561('0x10')](_0x6561('0xe'),_0x37db11,_0x6561('0xb'));_0x32f0b8(_0x593a65['result'][_0x6561('0xf')]);}})[_0x6561('0x11')](function(_0x53ec47){logger[_0x6561('0xd')](_0x6561('0xe'),_0x37db11,_0x53ec47);_0x440363(_0x53ec47);});});}exports[_0x6561('0x12')]=function(_0x245c3a){var _0x34fe66=this;return new Promise(function(_0x483fef,_0x302858){return db[_0x6561('0x13')][_0x6561('0x14')](_0x245c3a[_0x6561('0x15')],{'raw':_0x245c3a[_0x6561('0x16')]?_0x245c3a[_0x6561('0x16')][_0x6561('0x17')]===undefined?!![]:![]:!![]})[_0x6561('0x8')](function(_0x34f4e8){logger['info']('CreateVoiceAgentReport',_0x245c3a);logger[_0x6561('0x9')]('CreateVoiceAgentReport',_0x245c3a,JSON[_0x6561('0xc')](_0x34f4e8));_0x483fef(_0x34f4e8);})[_0x6561('0x11')](function(_0x5c1a6b){logger['error'](_0x6561('0x12'),_0x5c1a6b['message'],_0x245c3a);_0x302858(_0x34fe66[_0x6561('0xd')](0x1f4,_0x5c1a6b[_0x6561('0xf')]));});});};exports[_0x6561('0x18')]=function(_0x2c98d9){var _0x340de1=this;return new Promise(function(_0x2751f2,_0x5406b8){return db[_0x6561('0x13')][_0x6561('0x19')](_0x2c98d9['body'],{'raw':_0x2c98d9[_0x6561('0x16')]?_0x2c98d9[_0x6561('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c98d9[_0x6561('0x16')]?_0x2c98d9[_0x6561('0x16')][_0x6561('0x1a')]||null:null,'attributes':_0x2c98d9['options']?_0x2c98d9[_0x6561('0x16')]['attributes']||null:null,'limit':_0x2c98d9[_0x6561('0x16')]?_0x2c98d9[_0x6561('0x16')][_0x6561('0x1b')]||null:null})[_0x6561('0x8')](function(_0x15a4e3){logger[_0x6561('0x10')](_0x6561('0x18'),_0x2c98d9);logger[_0x6561('0x9')](_0x6561('0x18'),_0x2c98d9,JSON[_0x6561('0xc')](_0x15a4e3));_0x2751f2(_0x15a4e3);})[_0x6561('0x11')](function(_0x2794b8){logger['error'](_0x6561('0x18'),_0x2794b8[_0x6561('0xf')],_0x2c98d9);_0x5406b8(_0x340de1[_0x6561('0xd')](0x1f4,_0x2794b8[_0x6561('0xf')]));});});}; \ No newline at end of file +var _0x5857=['CreateVoiceAgentReport','create','options','raw','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','body','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','code','error','message','info','catch'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x5857,0x1e8));var _0x7585=function(_0x2c906f,_0x3389e9){_0x2c906f=_0x2c906f-0x0;var _0x1c0088=_0x5857[_0x2c906f];return _0x1c0088;};'use strict';var _=require(_0x7585('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7585('0x1'));var rs=require(_0x7585('0x2'));var fs=require('fs');var Redis=require(_0x7585('0x3'));var db=require(_0x7585('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7585('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e0b67,_0x280296,_0x3b3bf5){return new BPromise(function(_0x5669b8,_0x1a4c43){return client['request'](_0x2e0b67,_0x3b3bf5)[_0x7585('0x6')](function(_0x400095){logger['info'](_0x7585('0x7'),_0x280296,_0x7585('0x8'));logger[_0x7585('0x9')](_0x7585('0xa'),_0x280296,_0x7585('0x8'),JSON['stringify'](_0x400095));if(_0x400095['error']){if(_0x400095['error'][_0x7585('0xb')]===0x1f4){logger[_0x7585('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x280296,_0x400095[_0x7585('0xc')][_0x7585('0xd')]);return _0x1a4c43(_0x400095['error'][_0x7585('0xd')]);}logger[_0x7585('0xc')](_0x7585('0x7'),_0x280296,_0x400095['error'][_0x7585('0xd')]);return _0x5669b8(_0x400095[_0x7585('0xc')]['message']);}else{logger[_0x7585('0xe')](_0x7585('0x7'),_0x280296,_0x7585('0x8'));_0x5669b8(_0x400095['result'][_0x7585('0xd')]);}})[_0x7585('0xf')](function(_0x2ea346){logger['error'](_0x7585('0x7'),_0x280296,_0x2ea346);_0x1a4c43(_0x2ea346);});});}exports[_0x7585('0x10')]=function(_0x366890){var _0x3d841b=this;return new Promise(function(_0x1f847b,_0x15188e){return db['VoiceAgentReport'][_0x7585('0x11')](_0x366890['body'],{'raw':_0x366890[_0x7585('0x12')]?_0x366890[_0x7585('0x12')][_0x7585('0x13')]===undefined?!![]:![]:!![]})[_0x7585('0x6')](function(_0x3013cb){logger[_0x7585('0xe')](_0x7585('0x10'),_0x366890);logger[_0x7585('0x9')](_0x7585('0x10'),_0x366890,JSON[_0x7585('0x14')](_0x3013cb));_0x1f847b(_0x3013cb);})[_0x7585('0xf')](function(_0x2c80ed){logger[_0x7585('0xc')](_0x7585('0x10'),_0x2c80ed[_0x7585('0xd')],_0x366890);_0x15188e(_0x3d841b['error'](0x1f4,_0x2c80ed[_0x7585('0xd')]));});});};exports[_0x7585('0x15')]=function(_0x448848){var _0x31d6ab=this;return new Promise(function(_0xbaf9dd,_0x3ccce2){return db[_0x7585('0x16')][_0x7585('0x17')](_0x448848[_0x7585('0x18')],{'raw':_0x448848['options']?_0x448848['options'][_0x7585('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x448848['options']?_0x448848[_0x7585('0x12')][_0x7585('0x19')]||null:null,'attributes':_0x448848[_0x7585('0x12')]?_0x448848['options'][_0x7585('0x1a')]||null:null,'limit':_0x448848['options']?_0x448848['options'][_0x7585('0x1b')]||null:null})[_0x7585('0x6')](function(_0x5899dd){logger[_0x7585('0xe')]('UpdateVoiceAgentReport',_0x448848);logger['debug'](_0x7585('0x15'),_0x448848,JSON[_0x7585('0x14')](_0x5899dd));_0xbaf9dd(_0x5899dd);})[_0x7585('0xf')](function(_0x8d3851){logger[_0x7585('0xc')](_0x7585('0x15'),_0x8d3851[_0x7585('0xd')],_0x448848);_0x3ccce2(_0x31d6ab['error'](0x1f4,_0x8d3851[_0x7585('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a42cd69..f5ca910 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 _0x3eea=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x406f7d,_0x23bebf){var _0x304bee=function(_0x382cdb){while(--_0x382cdb){_0x406f7d['push'](_0x406f7d['shift']());}};_0x304bee(++_0x23bebf);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x27e454,_0xf2fd32){_0x27e454=_0x27e454-0x0;var _0x4e32d1=_0x3eea[_0x27e454];return _0x4e32d1;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['get'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router['post']('/',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x10')]);router[_0xa3ee('0x11')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x12')]);router['delete']('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x13')]);module[_0xa3ee('0x14')]=router; \ No newline at end of file +var _0x3baf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2bebaa,_0x3482c9){var _0x35705d=function(_0x381a74){while(--_0x381a74){_0x2bebaa['push'](_0x2bebaa['shift']());}};_0x35705d(++_0x3482c9);}(_0x3baf,0xf7));var _0xf3ba=function(_0x45b1ad,_0x215b03){_0x45b1ad=_0x45b1ad-0x0;var _0x3d5696=_0x3baf[_0x45b1ad];return _0x3d5696;};'use strict';var multer=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var path=require(_0xf3ba('0x2'));var timeout=require(_0xf3ba('0x3'));var express=require(_0xf3ba('0x4'));var router=express[_0xf3ba('0x5')]();var fs_extra=require(_0xf3ba('0x6'));var auth=require(_0xf3ba('0x7'));var interaction=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var controller=require(_0xf3ba('0xa'));router[_0xf3ba('0xb')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xd')]);router[_0xf3ba('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf3ba('0xb')]('/:id',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xe')]);router[_0xf3ba('0xf')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x10')]);router[_0xf3ba('0x11')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x13')]);router[_0xf3ba('0x14')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x15')]);module[_0xf3ba('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index eb0dd9c..34065d6 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 _0xa3c3=['outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','inbound'];(function(_0x1fb6e2,_0x3a22ce){var _0x354690=function(_0x51f968){while(--_0x51f968){_0x1fb6e2['push'](_0x1fb6e2['shift']());}};_0x354690(++_0x3a22ce);}(_0xa3c3,0xcc));var _0x3a3c=function(_0x1462c1,_0x1f7eaa){_0x1462c1=_0x1462c1-0x0;var _0x2f5342=_0xa3c3[_0x1462c1];return _0x2f5342;};'use strict';var Sequelize=require(_0x3a3c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3a3c('0x1')]},'type':{'type':Sequelize['ENUM'](_0x3a3c('0x2'),'internal',_0x3a3c('0x3'),_0x3a3c('0x4'),'outbound-fax',_0x3a3c('0x5'))},'tag':{'type':Sequelize[_0x3a3c('0x1')]},'accountcode':{'type':Sequelize[_0x3a3c('0x1')]},'source':{'type':Sequelize[_0x3a3c('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3a3c('0x1')]},'channel':{'type':Sequelize[_0x3a3c('0x1')]},'destinationchannel':{'type':Sequelize[_0x3a3c('0x1')]},'lastapplication':{'type':Sequelize[_0x3a3c('0x1')]},'lastdata':{'type':Sequelize[_0x3a3c('0x6')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x3a3c('0x7')]},'answertime':{'type':Sequelize[_0x3a3c('0x7')]},'endtime':{'type':Sequelize[_0x3a3c('0x7')]},'duration':{'type':Sequelize[_0x3a3c('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x3a3c('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3a3c('0x1')]},'amaflags':{'type':Sequelize[_0x3a3c('0x1')]},'userfield':{'type':Sequelize[_0x3a3c('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x3a3c('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x3a3c('0x1')]},'note':{'type':Sequelize[_0x3a3c('0x1')]},'prefix':{'type':Sequelize[_0x3a3c('0x1')]},'routeid':{'type':Sequelize[_0x3a3c('0x8')]},'sipcallid':{'type':Sequelize[_0x3a3c('0x1')]}}; \ No newline at end of file +var _0x306e=['TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','STRING'];(function(_0x2ace70,_0x19c69c){var _0x35475f=function(_0x15d9b8){while(--_0x15d9b8){_0x2ace70['push'](_0x2ace70['shift']());}};_0x35475f(++_0x19c69c);}(_0x306e,0x13b));var _0xe306=function(_0x26d0c6,_0x1d685a){_0x26d0c6=_0x26d0c6-0x0;var _0x1d943b=_0x306e[_0x26d0c6];return _0x1d943b;};'use strict';var Sequelize=require(_0xe306('0x0'));module[_0xe306('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe306('0x2')](_0xe306('0x3'),_0xe306('0x4'),_0xe306('0x5'),_0xe306('0x6'),_0xe306('0x7'),_0xe306('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe306('0x9')]},'source':{'type':Sequelize[_0xe306('0x9')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xe306('0x9')]},'callerid':{'type':Sequelize[_0xe306('0x9')]},'channel':{'type':Sequelize[_0xe306('0x9')]},'destinationchannel':{'type':Sequelize[_0xe306('0x9')]},'lastapplication':{'type':Sequelize[_0xe306('0x9')]},'lastdata':{'type':Sequelize[_0xe306('0xa')]},'starttime':{'type':Sequelize[_0xe306('0xb')]},'systemanswertime':{'type':Sequelize[_0xe306('0xb')]},'answertime':{'type':Sequelize[_0xe306('0xb')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xe306('0xc')]},'billableseconds':{'type':Sequelize[_0xe306('0xc')]},'mohtime':{'type':Sequelize[_0xe306('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe306('0x9')]},'amaflags':{'type':Sequelize[_0xe306('0x9')]},'userfield':{'type':Sequelize[_0xe306('0x9')]},'userDisposition':{'type':Sequelize[_0xe306('0x9')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xe306('0x9')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xe306('0x9')]},'routeid':{'type':Sequelize[_0xe306('0xc')]},'sipcallid':{'type':Sequelize[_0xe306('0x9')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index d3a3e29..ebcea5b 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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x25fa0c,_0x5e28aa){_0x25fa0c=_0x25fa0c-0x0;var _0x5e73aa=_0x2032[_0x25fa0c];return _0x5e73aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x2ef3,0xba));var _0x32ef=function(_0x46e3d5,_0x24bdbd){_0x46e3d5=_0x46e3d5-0x0;var _0x159f37=_0x2ef3[_0x46e3d5];return _0x159f37;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index f6c526c..476cb68 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 _0x5fbd=['request-promise','path','rimraf','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','api'];(function(_0x5ae0cf,_0x40cc64){var _0x135d3b=function(_0x51169a){while(--_0x51169a){_0x5ae0cf['push'](_0x5ae0cf['shift']());}};_0x135d3b(++_0x40cc64);}(_0x5fbd,0x1af));var _0xd5fb=function(_0x30503d,_0x5bb58d){_0x30503d=_0x30503d-0x0;var _0x3a570c=_0x5fbd[_0x30503d];return _0x3a570c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd5fb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd5fb('0x1'));var fs=require('fs');var path=require(_0xd5fb('0x2'));var rimraf=require(_0xd5fb('0x3'));var config=require('../../config/environment');var attributes=require(_0xd5fb('0x4'));module[_0xd5fb('0x5')]=function(_0x5215d7,_0x5f34b8){return _0x5215d7['define'](_0xd5fb('0x6'),attributes,{'tableName':_0xd5fb('0x7'),'paranoid':![],'indexes':[{'fields':[_0xd5fb('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0953=['./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4ecbd4,_0x57edd7){var _0x41e196=function(_0x1c4dc6){while(--_0x1c4dc6){_0x4ecbd4['push'](_0x4ecbd4['shift']());}};_0x41e196(++_0x57edd7);}(_0x0953,0x12b));var _0x3095=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x0953[_0x5c2e5e];return _0x46a5da;};'use strict';var _=require(_0x3095('0x0'));var util=require(_0x3095('0x1'));var logger=require(_0x3095('0x2'))(_0x3095('0x3'));var moment=require(_0x3095('0x4'));var BPromise=require(_0x3095('0x5'));var rp=require(_0x3095('0x6'));var fs=require('fs');var path=require(_0x3095('0x7'));var rimraf=require(_0x3095('0x8'));var config=require('../../config/environment');var attributes=require(_0x3095('0x9'));module[_0x3095('0xa')]=function(_0xd61a81,_0x28ce18){return _0xd61a81[_0x3095('0xb')](_0x3095('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x3095('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index ce7676e..b9f4ea9 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 _0x9b70=['message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45d6ce,_0x4d8fdb){var _0xbe276b=function(_0x49b707){while(--_0x49b707){_0x45d6ce['push'](_0x45d6ce['shift']());}};_0xbe276b(++_0x4d8fdb);}(_0x9b70,0x8b));var _0x09b7=function(_0x1cac87,_0x369e25){_0x1cac87=_0x1cac87-0x0;var _0xf6ed36=_0x9b70[_0x1cac87];return _0xf6ed36;};'use strict';var _=require(_0x09b7('0x0'));var util=require(_0x09b7('0x1'));var moment=require(_0x09b7('0x2'));var BPromise=require(_0x09b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09b7('0x4'));var db=require(_0x09b7('0x5'))['db'];var utils=require(_0x09b7('0x6'));var logger=require('../../config/logger')(_0x09b7('0x7'));var config=require(_0x09b7('0x8'));var jayson=require(_0x09b7('0x9'));var client=jayson[_0x09b7('0xa')][_0x09b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52ceeb,_0x53b182,_0x213ed8){return new BPromise(function(_0x17b2ec,_0x10922d){return client[_0x09b7('0xc')](_0x52ceeb,_0x213ed8)[_0x09b7('0xd')](function(_0x2e8ee5){logger[_0x09b7('0xe')](_0x09b7('0xf'),_0x53b182,_0x09b7('0x10'));logger['debug'](_0x09b7('0x11'),_0x53b182,_0x09b7('0x10'),JSON[_0x09b7('0x12')](_0x2e8ee5));if(_0x2e8ee5[_0x09b7('0x13')]){if(_0x2e8ee5[_0x09b7('0x13')][_0x09b7('0x14')]===0x1f4){logger[_0x09b7('0x13')](_0x09b7('0xf'),_0x53b182,_0x2e8ee5[_0x09b7('0x13')][_0x09b7('0x15')]);return _0x10922d(_0x2e8ee5[_0x09b7('0x13')]['message']);}logger[_0x09b7('0x13')](_0x09b7('0xf'),_0x53b182,_0x2e8ee5[_0x09b7('0x13')]['message']);return _0x17b2ec(_0x2e8ee5[_0x09b7('0x13')][_0x09b7('0x15')]);}else{logger['info'](_0x09b7('0xf'),_0x53b182,_0x09b7('0x10'));_0x17b2ec(_0x2e8ee5[_0x09b7('0x16')][_0x09b7('0x15')]);}})[_0x09b7('0x17')](function(_0x1482ce){logger[_0x09b7('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x53b182,_0x1482ce);_0x10922d(_0x1482ce);});});}exports[_0x09b7('0x18')]=function(_0x5bcf39){var _0x4097b1=this;return new Promise(function(_0xe6b7ef,_0x8e65d0){return db[_0x09b7('0x19')][_0x09b7('0x1a')]({'raw':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39[_0x09b7('0x1b')][_0x09b7('0x1c')]===undefined?!![]:![]:!![],'where':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39['options'][_0x09b7('0x1d')]||null:null,'attributes':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39['options'][_0x09b7('0x1e')]||null:null,'limit':_0x5bcf39['options']?_0x5bcf39['options'][_0x09b7('0x1f')]||null:null,'include':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39['options'][_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x5bcf39[_0x09b7('0x1b')]['include'],function(_0x15d063){return{'model':db[_0x15d063[_0x09b7('0x22')]],'as':_0x15d063['as'],'attributes':_0x15d063[_0x09b7('0x1e')],'include':_0x15d063[_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x15d063[_0x09b7('0x20')],function(_0x57283d){return{'model':db[_0x57283d[_0x09b7('0x22')]],'as':_0x57283d['as'],'attributes':_0x57283d['attributes'],'include':_0x57283d[_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x57283d[_0x09b7('0x20')],function(_0x3a06c8){return{'model':db[_0x3a06c8[_0x09b7('0x22')]],'as':_0x3a06c8['as'],'attributes':_0x3a06c8[_0x09b7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22731d){logger[_0x09b7('0xe')]('GetVoiceCallReport',_0x5bcf39);logger[_0x09b7('0x23')](_0x09b7('0x18'),_0x5bcf39,JSON['stringify'](_0x22731d));_0xe6b7ef(_0x22731d);})[_0x09b7('0x17')](function(_0x329422){logger[_0x09b7('0x13')](_0x09b7('0x18'),_0x329422[_0x09b7('0x15')],_0x5bcf39);_0x8e65d0(_0x4097b1[_0x09b7('0x13')](0x1f4,_0x329422[_0x09b7('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x37f1ca){var _0xd294ea=this;return new Promise(function(_0x26dcc4,_0x14f3b0){return db[_0x09b7('0x19')][_0x09b7('0x24')](_0x37f1ca[_0x09b7('0x25')],{'raw':_0x37f1ca[_0x09b7('0x1b')]?_0x37f1ca[_0x09b7('0x1b')][_0x09b7('0x1c')]===undefined?!![]:![]:!![]})[_0x09b7('0xd')](function(_0x47b49d){logger['info'](_0x09b7('0x26'),_0x37f1ca);logger[_0x09b7('0x23')](_0x09b7('0x26'),_0x37f1ca,JSON[_0x09b7('0x12')](_0x47b49d));_0x26dcc4(_0x47b49d);})[_0x09b7('0x17')](function(_0x26a653){logger[_0x09b7('0x13')](_0x09b7('0x26'),_0x26a653[_0x09b7('0x15')],_0x37f1ca);_0x14f3b0(_0xd294ea[_0x09b7('0x13')](0x1f4,_0x26a653[_0x09b7('0x15')]));});});};exports[_0x09b7('0x27')]=function(_0x34330d){var _0x17fccb=this;return new Promise(function(_0x55f24e,_0x450c0e){return db[_0x09b7('0x19')]['update'](_0x34330d['body'],{'raw':_0x34330d[_0x09b7('0x1b')]?_0x34330d[_0x09b7('0x1b')][_0x09b7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34330d[_0x09b7('0x1b')]?_0x34330d[_0x09b7('0x1b')]['where']||null:null,'attributes':_0x34330d['options']?_0x34330d['options'][_0x09b7('0x1e')]||null:null,'limit':_0x34330d[_0x09b7('0x1b')]?_0x34330d['options'][_0x09b7('0x1f')]||null:null})[_0x09b7('0xd')](function(_0x32ecc4){logger['info'](_0x09b7('0x27'),_0x34330d);logger[_0x09b7('0x23')](_0x09b7('0x27'),_0x34330d,JSON['stringify'](_0x32ecc4));_0x55f24e(_0x32ecc4);})[_0x09b7('0x17')](function(_0xcddaa){logger['error']('UpdateVoiceCallReport',_0xcddaa[_0x09b7('0x15')],_0x34330d);_0x450c0e(_0x17fccb[_0x09b7('0x13')](0x1f4,_0xcddaa['message']));});});}; \ No newline at end of file +var _0xa5ae=['GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2ca2fa,_0x13b02e){var _0xbce4e5=function(_0x54cf43){while(--_0x54cf43){_0x2ca2fa['push'](_0x2ca2fa['shift']());}};_0xbce4e5(++_0x13b02e);}(_0xa5ae,0x1f2));var _0xea5a=function(_0x2bdcfd,_0x32697d){_0x2bdcfd=_0x2bdcfd-0x0;var _0x53a635=_0xa5ae[_0x2bdcfd];return _0x53a635;};'use strict';var _=require(_0xea5a('0x0'));var util=require('util');var moment=require(_0xea5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xea5a('0x2'));var fs=require('fs');var Redis=require(_0xea5a('0x3'));var db=require(_0xea5a('0x4'))['db'];var utils=require(_0xea5a('0x5'));var logger=require(_0xea5a('0x6'))(_0xea5a('0x7'));var config=require('../../config/environment');var jayson=require(_0xea5a('0x8'));var client=jayson[_0xea5a('0x9')][_0xea5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46ee75,_0x55f127,_0x11e6ee){return new BPromise(function(_0x566bbf,_0x5f56cf){return client[_0xea5a('0xb')](_0x46ee75,_0x11e6ee)[_0xea5a('0xc')](function(_0x4e7d8a){logger[_0xea5a('0xd')](_0xea5a('0xe'),_0x55f127,'request\x20sent');logger['debug'](_0xea5a('0xf'),_0x55f127,_0xea5a('0x10'),JSON[_0xea5a('0x11')](_0x4e7d8a));if(_0x4e7d8a[_0xea5a('0x12')]){if(_0x4e7d8a[_0xea5a('0x12')][_0xea5a('0x13')]===0x1f4){logger[_0xea5a('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x55f127,_0x4e7d8a[_0xea5a('0x12')][_0xea5a('0x14')]);return _0x5f56cf(_0x4e7d8a['error'][_0xea5a('0x14')]);}logger['error'](_0xea5a('0xe'),_0x55f127,_0x4e7d8a[_0xea5a('0x12')][_0xea5a('0x14')]);return _0x566bbf(_0x4e7d8a['error'][_0xea5a('0x14')]);}else{logger[_0xea5a('0xd')](_0xea5a('0xe'),_0x55f127,_0xea5a('0x10'));_0x566bbf(_0x4e7d8a[_0xea5a('0x15')][_0xea5a('0x14')]);}})['catch'](function(_0x4ecb93){logger[_0xea5a('0x12')](_0xea5a('0xe'),_0x55f127,_0x4ecb93);_0x5f56cf(_0x4ecb93);});});}exports[_0xea5a('0x16')]=function(_0x29ced7){var _0x2798c2=this;return new Promise(function(_0x1b04da,_0x2631d4){return db[_0xea5a('0x17')][_0xea5a('0x18')]({'raw':_0x29ced7['options']?_0x29ced7[_0xea5a('0x19')][_0xea5a('0x1a')]===undefined?!![]:![]:!![],'where':_0x29ced7[_0xea5a('0x19')]?_0x29ced7[_0xea5a('0x19')][_0xea5a('0x1b')]||null:null,'attributes':_0x29ced7[_0xea5a('0x19')]?_0x29ced7[_0xea5a('0x19')][_0xea5a('0x1c')]||null:null,'limit':_0x29ced7[_0xea5a('0x19')]?_0x29ced7['options']['limit']||null:null,'include':_0x29ced7[_0xea5a('0x19')]?_0x29ced7[_0xea5a('0x19')]['include']?_['map'](_0x29ced7[_0xea5a('0x19')][_0xea5a('0x1d')],function(_0x32afed){return{'model':db[_0x32afed[_0xea5a('0x1e')]],'as':_0x32afed['as'],'attributes':_0x32afed[_0xea5a('0x1c')],'include':_0x32afed['include']?_[_0xea5a('0x1f')](_0x32afed[_0xea5a('0x1d')],function(_0x5cdb7f){return{'model':db[_0x5cdb7f[_0xea5a('0x1e')]],'as':_0x5cdb7f['as'],'attributes':_0x5cdb7f[_0xea5a('0x1c')],'include':_0x5cdb7f[_0xea5a('0x1d')]?_['map'](_0x5cdb7f[_0xea5a('0x1d')],function(_0x446a3e){return{'model':db[_0x446a3e[_0xea5a('0x1e')]],'as':_0x446a3e['as'],'attributes':_0x446a3e['attributes']};}):[]};}):[]};}):[]:[]})[_0xea5a('0xc')](function(_0x5b9d23){logger['info'](_0xea5a('0x16'),_0x29ced7);logger[_0xea5a('0x20')]('GetVoiceCallReport',_0x29ced7,JSON[_0xea5a('0x11')](_0x5b9d23));_0x1b04da(_0x5b9d23);})['catch'](function(_0x1e2034){logger[_0xea5a('0x12')]('GetVoiceCallReport',_0x1e2034['message'],_0x29ced7);_0x2631d4(_0x2798c2['error'](0x1f4,_0x1e2034[_0xea5a('0x14')]));});});};exports[_0xea5a('0x21')]=function(_0x1c9f82){var _0x58e2e9=this;return new Promise(function(_0x8f4bfe,_0x3203ad){return db['VoiceCallReport'][_0xea5a('0x22')](_0x1c9f82[_0xea5a('0x23')],{'raw':_0x1c9f82[_0xea5a('0x19')]?_0x1c9f82[_0xea5a('0x19')][_0xea5a('0x1a')]===undefined?!![]:![]:!![]})[_0xea5a('0xc')](function(_0x4837ac){logger[_0xea5a('0xd')]('CreateVoiceCallReport',_0x1c9f82);logger['debug'](_0xea5a('0x21'),_0x1c9f82,JSON[_0xea5a('0x11')](_0x4837ac));_0x8f4bfe(_0x4837ac);})['catch'](function(_0x173ca8){logger['error']('CreateVoiceCallReport',_0x173ca8[_0xea5a('0x14')],_0x1c9f82);_0x3203ad(_0x58e2e9[_0xea5a('0x12')](0x1f4,_0x173ca8[_0xea5a('0x14')]));});});};exports[_0xea5a('0x24')]=function(_0x548409){var _0x57d6a7=this;return new Promise(function(_0x3bd43c,_0x1a5d52){return db['VoiceCallReport'][_0xea5a('0x25')](_0x548409[_0xea5a('0x23')],{'raw':_0x548409[_0xea5a('0x19')]?_0x548409[_0xea5a('0x19')][_0xea5a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548409[_0xea5a('0x19')]?_0x548409[_0xea5a('0x19')][_0xea5a('0x1b')]||null:null,'attributes':_0x548409[_0xea5a('0x19')]?_0x548409[_0xea5a('0x19')][_0xea5a('0x1c')]||null:null,'limit':_0x548409[_0xea5a('0x19')]?_0x548409[_0xea5a('0x19')][_0xea5a('0x26')]||null:null})[_0xea5a('0xc')](function(_0x4f32af){logger[_0xea5a('0xd')]('UpdateVoiceCallReport',_0x548409);logger[_0xea5a('0x20')](_0xea5a('0x24'),_0x548409,JSON[_0xea5a('0x11')](_0x4f32af));_0x3bd43c(_0x4f32af);})[_0xea5a('0x27')](function(_0xe91d1){logger[_0xea5a('0x12')](_0xea5a('0x24'),_0xe91d1[_0xea5a('0x14')],_0x548409);_0x1a5d52(_0x57d6a7['error'](0x1f4,_0xe91d1[_0xea5a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1f87362..9689d6f 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 _0x995d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','fs-extra'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x995d,0x9f));var _0xd995=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x995d[_0x1992f1];return _0x413dfe;};'use strict';var multer=require(_0xd995('0x0'));var util=require(_0xd995('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd995('0x2'));var auth=require(_0xd995('0x3'));var interaction=require(_0xd995('0x4'));var config=require(_0xd995('0x5'));var controller=require(_0xd995('0x6'));router[_0xd995('0x7')]('/',auth[_0xd995('0x8')](),controller[_0xd995('0x9')]);router[_0xd995('0x7')](_0xd995('0xa'),auth[_0xd995('0x8')](),controller[_0xd995('0xb')]);router[_0xd995('0xc')]('/',auth[_0xd995('0x8')](),controller[_0xd995('0xd')]);router[_0xd995('0xe')](_0xd995('0xa'),auth['isAuthenticated'](),controller[_0xd995('0xf')]);router[_0xd995('0x10')](_0xd995('0xa'),auth[_0xd995('0x8')](),controller[_0xd995('0x11')]);module['exports']=router; \ No newline at end of file +var _0xab33=['show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5558b0,_0x3a0345){var _0x243294=function(_0x295169){while(--_0x295169){_0x5558b0['push'](_0x5558b0['shift']());}};_0x243294(++_0x3a0345);}(_0xab33,0x1e8));var _0x3ab3=function(_0x2850ab,_0x3d6a5d){_0x2850ab=_0x2850ab-0x0;var _0xfed0e1=_0xab33[_0x2850ab];return _0xfed0e1;};'use strict';var multer=require(_0x3ab3('0x0'));var util=require(_0x3ab3('0x1'));var path=require(_0x3ab3('0x2'));var timeout=require(_0x3ab3('0x3'));var express=require(_0x3ab3('0x4'));var router=express[_0x3ab3('0x5')]();var fs_extra=require(_0x3ab3('0x6'));var auth=require(_0x3ab3('0x7'));var interaction=require(_0x3ab3('0x8'));var config=require(_0x3ab3('0x9'));var controller=require('./voiceChanSpy.controller');router[_0x3ab3('0xa')]('/',auth[_0x3ab3('0xb')](),controller['index']);router[_0x3ab3('0xa')]('/:id',auth[_0x3ab3('0xb')](),controller[_0x3ab3('0xc')]);router[_0x3ab3('0xd')]('/',auth[_0x3ab3('0xb')](),controller[_0x3ab3('0xe')]);router[_0x3ab3('0xf')](_0x3ab3('0x10'),auth[_0x3ab3('0xb')](),controller[_0x3ab3('0x11')]);router[_0x3ab3('0x12')](_0x3ab3('0x10'),auth[_0x3ab3('0xb')](),controller[_0x3ab3('0x13')]);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 db93d47..b90b023 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 _0xbcbb=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x42ca78,_0x364897){var _0x2119d9=function(_0xd1df56){while(--_0xd1df56){_0x42ca78['push'](_0x42ca78['shift']());}};_0x2119d9(++_0x364897);}(_0xbcbb,0x15d));var _0xbbcb=function(_0x13ed6f,_0x515c3c){_0x13ed6f=_0x13ed6f-0x0;var _0x3b42dd=_0xbcbb[_0x13ed6f];return _0x3b42dd;};'use strict';var Sequelize=require(_0xbbcb('0x0'));module[_0xbbcb('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xbbcb('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xbbcb('0x2')],'set':function(_0x2ea3b3){this['setDataValue'](_0xbbcb('0x3'),_0x2ea3b3?_0x2ea3b3[_0xbbcb('0x4')](''):[]);},'get':function(){return this[_0xbbcb('0x5')](_0xbbcb('0x3'))?this[_0xbbcb('0x5')](_0xbbcb('0x3'))[_0xbbcb('0x6')](''):[];}},'auth':{'type':Sequelize[_0xbbcb('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xbbcb('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x69e3=['STRING','join','getDataValue','options','split','BOOLEAN','sequelize'];(function(_0x2ef6dc,_0x5ad3fa){var _0x1e3426=function(_0x4d399f){while(--_0x4d399f){_0x2ef6dc['push'](_0x2ef6dc['shift']());}};_0x1e3426(++_0x5ad3fa);}(_0x69e3,0x109));var _0x369e=function(_0x5cfe33,_0x42be32){_0x5cfe33=_0x5cfe33-0x0;var _0x3b1223=_0x69e3[_0x5cfe33];return _0x3b1223;};'use strict';var Sequelize=require(_0x369e('0x0'));module['exports']={'name':{'type':Sequelize[_0x369e('0x1')]},'prefix':{'type':Sequelize[_0x369e('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x369e('0x1')],'set':function(_0x1100fd){this['setDataValue']('options',_0x1100fd?_0x1100fd[_0x369e('0x2')](''):[]);},'get':function(){return this[_0x369e('0x3')](_0x369e('0x4'))?this[_0x369e('0x3')](_0x369e('0x4'))[_0x369e('0x5')](''):[];}},'auth':{'type':Sequelize[_0x369e('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x369e('0x1')]},'record':{'type':Sequelize[_0x369e('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x369e('0x1')]},'description':{'type':Sequelize[_0x369e('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index ed1bcb0..34089ba 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 _0xac65=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','where','pick','merge','filter','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','error','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','stack','name','send','map','rawAttributes'];(function(_0x33ab1d,_0x2e9fee){var _0x587862=function(_0xdb8cae){while(--_0xdb8cae){_0x33ab1d['push'](_0x33ab1d['shift']());}};_0x587862(++_0x2e9fee);}(_0xac65,0x11d));var _0x5ac6=function(_0x45b270,_0x40b19f){_0x45b270=_0x45b270-0x0;var _0x3c30f3=_0xac65[_0x45b270];return _0x3c30f3;};'use strict';var emlformat=require(_0x5ac6('0x0'));var rimraf=require(_0x5ac6('0x1'));var zipdir=require(_0x5ac6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ac6('0x3'));var moment=require(_0x5ac6('0x4'));var BPromise=require(_0x5ac6('0x5'));var Mustache=require('mustache');var util=require(_0x5ac6('0x6'));var path=require(_0x5ac6('0x7'));var sox=require(_0x5ac6('0x8'));var csv=require('to-csv');var ejs=require(_0x5ac6('0x9'));var fs=require('fs');var fs_extra=require(_0x5ac6('0xa'));var _=require(_0x5ac6('0xb'));var squel=require(_0x5ac6('0xc'));var crypto=require(_0x5ac6('0xd'));var jsforce=require(_0x5ac6('0xe'));var deskjs=require(_0x5ac6('0xf'));var toCsv=require(_0x5ac6('0x10'));var querystring=require(_0x5ac6('0x11'));var Papa=require(_0x5ac6('0x12'));var Redis=require(_0x5ac6('0x13'));var authService=require(_0x5ac6('0x14'));var qs=require(_0x5ac6('0x15'));var as=require(_0x5ac6('0x16'));var hardwareService=require(_0x5ac6('0x17'));var logger=require(_0x5ac6('0x18'))(_0x5ac6('0x19'));var utils=require(_0x5ac6('0x1a'));var config=require(_0x5ac6('0x1b'));var licenseUtil=require(_0x5ac6('0x1c'));var db=require(_0x5ac6('0x1d'))['db'];function respondWithStatusCode(_0x2d6f0a,_0x505ae7){_0x505ae7=_0x505ae7||0xcc;return function(_0x1e1ed0){if(_0x1e1ed0){return _0x2d6f0a[_0x5ac6('0x1e')](_0x505ae7);}return _0x2d6f0a[_0x5ac6('0x1f')](_0x505ae7)['end']();};}function respondWithResult(_0x23cfa7,_0x355f2a){_0x355f2a=_0x355f2a||0xc8;return function(_0x2af869){if(_0x2af869){return _0x23cfa7['status'](_0x355f2a)[_0x5ac6('0x20')](_0x2af869);}};}function respondWithFilteredResult(_0x23ad24,_0x2db3af){return function(_0x158e9a){if(_0x158e9a){var _0xefc444=typeof _0x2db3af['offset']===_0x5ac6('0x21')&&typeof _0x2db3af['limit']==='undefined';var _0x27924d=_0x158e9a[_0x5ac6('0x22')];var _0x2e62d9=_0xefc444?0x0:_0x2db3af[_0x5ac6('0x23')];var _0x24ccd2=_0xefc444?_0x158e9a[_0x5ac6('0x22')]:_0x2db3af[_0x5ac6('0x23')]+_0x2db3af[_0x5ac6('0x24')];var _0x446733;if(_0x24ccd2>=_0x27924d){_0x24ccd2=_0x27924d;_0x446733=0xc8;}else{_0x446733=0xce;}_0x23ad24['status'](_0x446733);return _0x23ad24[_0x5ac6('0x25')](_0x5ac6('0x26'),_0x2e62d9+'-'+_0x24ccd2+'/'+_0x27924d)[_0x5ac6('0x20')](_0x158e9a);}return null;};}function patchUpdates(_0x9ed30){return function(_0x593329){try{jsonpatch[_0x5ac6('0x27')](_0x593329,_0x9ed30,!![]);}catch(_0x4fa376){return BPromise[_0x5ac6('0x28')](_0x4fa376);}return _0x593329['save']();};}function saveUpdates(_0x2c55c5,_0x3c1db4){return function(_0x4e582f){if(_0x4e582f){return _0x4e582f[_0x5ac6('0x29')](_0x2c55c5)[_0x5ac6('0x2a')](function(_0x52ba3f){return _0x52ba3f;});}return null;};}function removeEntity(_0x1c81e7,_0x4c07d6){return function(_0x2f63f1){if(_0x2f63f1){return _0x2f63f1[_0x5ac6('0x2b')]()[_0x5ac6('0x2a')](function(){var _0x8aa926=_0x2f63f1[_0x5ac6('0x2c')]({'plain':!![]});var _0x3da323=_0x5ac6('0x2d');return db['UserProfileResource'][_0x5ac6('0x2b')]({'where':{'type':_0x3da323,'resourceId':_0x8aa926['id']}})[_0x5ac6('0x2a')](function(){return _0x2f63f1;});})['then'](function(){_0x1c81e7[_0x5ac6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xebe18b,_0x44ed4b){return function(_0x51fdf4){if(!_0x51fdf4){_0xebe18b[_0x5ac6('0x1e')](0x194);}return _0x51fdf4;};}function handleError(_0x51ac02,_0x4cb2d5){_0x4cb2d5=_0x4cb2d5||0x1f4;return function(_0x2b9e40){logger['error'](_0x2b9e40[_0x5ac6('0x2e')]);if(_0x2b9e40[_0x5ac6('0x2f')]){delete _0x2b9e40['name'];}_0x51ac02['status'](_0x4cb2d5)[_0x5ac6('0x30')](_0x2b9e40);};}exports['index']=function(_0x263627,_0x4a718d){var _0x880889={},_0x5035a8={},_0x41e97b={'count':0x0,'rows':[]};var _0x185f66=_[_0x5ac6('0x31')](db['VoiceChanSpy'][_0x5ac6('0x32')],function(_0x3ced34){return{'name':_0x3ced34[_0x5ac6('0x33')],'type':_0x3ced34[_0x5ac6('0x34')][_0x5ac6('0x35')]};});_0x5035a8[_0x5ac6('0x36')]=_['map'](_0x185f66,'name');_0x5035a8[_0x5ac6('0x37')]=_[_0x5ac6('0x38')](_0x263627[_0x5ac6('0x37')]);_0x5035a8[_0x5ac6('0x39')]=_[_0x5ac6('0x3a')](_0x5035a8[_0x5ac6('0x36')],_0x5035a8[_0x5ac6('0x37')]);_0x880889['attributes']=_[_0x5ac6('0x3a')](_0x5035a8[_0x5ac6('0x36')],qs[_0x5ac6('0x3b')](_0x263627[_0x5ac6('0x37')][_0x5ac6('0x3b')]));_0x880889[_0x5ac6('0x3c')]=_0x880889[_0x5ac6('0x3c')][_0x5ac6('0x3d')]?_0x880889['attributes']:_0x5035a8[_0x5ac6('0x36')];if(!_0x263627[_0x5ac6('0x37')]['hasOwnProperty']('nolimit')){_0x880889[_0x5ac6('0x24')]=qs[_0x5ac6('0x24')](_0x263627[_0x5ac6('0x37')]['limit']);_0x880889[_0x5ac6('0x23')]=qs[_0x5ac6('0x23')](_0x263627[_0x5ac6('0x37')]['offset']);}_0x880889[_0x5ac6('0x3e')]=qs['sort'](_0x263627['query']['sort']);_0x880889[_0x5ac6('0x3f')]=qs[_0x5ac6('0x39')](_[_0x5ac6('0x40')](_0x263627[_0x5ac6('0x37')],_0x5035a8[_0x5ac6('0x39')]),_0x185f66);if(_0x263627['query']['filter']){_0x880889[_0x5ac6('0x3f')]=_[_0x5ac6('0x41')](_0x880889[_0x5ac6('0x3f')],{'$or':_[_0x5ac6('0x31')](_0x185f66,function(_0x493c67){if(_0x493c67[_0x5ac6('0x34')]!=='VIRTUAL'){var _0x17abc9={};_0x17abc9[_0x493c67['name']]={'$like':'%'+_0x263627['query'][_0x5ac6('0x42')]+'%'};return _0x17abc9;}})});}_0x880889=_[_0x5ac6('0x41')]({},_0x880889,_0x263627[_0x5ac6('0x43')]);var _0x14d7c5={'where':_0x880889[_0x5ac6('0x3f')]};return db[_0x5ac6('0x44')][_0x5ac6('0x22')](_0x14d7c5)[_0x5ac6('0x2a')](function(_0x6ec798){_0x41e97b['count']=_0x6ec798;if(_0x263627[_0x5ac6('0x37')][_0x5ac6('0x45')]){_0x880889[_0x5ac6('0x46')]=[{'all':!![]}];}return db[_0x5ac6('0x44')][_0x5ac6('0x47')](_0x880889);})['then'](function(_0x365396){_0x41e97b[_0x5ac6('0x48')]=_0x365396;return _0x41e97b;})[_0x5ac6('0x2a')](respondWithFilteredResult(_0x4a718d,_0x880889))[_0x5ac6('0x49')](handleError(_0x4a718d,null));};exports['show']=function(_0x488d66,_0x217c1a){var _0xd20258={'raw':![],'where':{'id':_0x488d66['params']['id']}},_0x1a3051={};_0x1a3051[_0x5ac6('0x36')]=_['keys'](db[_0x5ac6('0x44')]['rawAttributes']);_0x1a3051[_0x5ac6('0x37')]=_[_0x5ac6('0x38')](_0x488d66[_0x5ac6('0x37')]);_0x1a3051['filters']=_['intersection'](_0x1a3051[_0x5ac6('0x36')],_0x1a3051[_0x5ac6('0x37')]);_0xd20258['attributes']=_[_0x5ac6('0x3a')](_0x1a3051['model'],qs['fields'](_0x488d66[_0x5ac6('0x37')][_0x5ac6('0x3b')]));_0xd20258[_0x5ac6('0x3c')]=_0xd20258['attributes'][_0x5ac6('0x3d')]?_0xd20258[_0x5ac6('0x3c')]:_0x1a3051[_0x5ac6('0x36')];if(_0x488d66[_0x5ac6('0x37')]['includeAll']){_0xd20258[_0x5ac6('0x46')]=[{'all':!![]}];}_0xd20258=_[_0x5ac6('0x41')]({},_0xd20258,_0x488d66['options']);return db[_0x5ac6('0x44')][_0x5ac6('0x4a')](_0xd20258)[_0x5ac6('0x2a')](handleEntityNotFound(_0x217c1a,null))[_0x5ac6('0x2a')](respondWithResult(_0x217c1a,null))['catch'](handleError(_0x217c1a,null));};exports[_0x5ac6('0x4b')]=function(_0x4133ed,_0x409d8c){return db[_0x5ac6('0x44')]['create'](_0x4133ed[_0x5ac6('0x4c')],{})[_0x5ac6('0x2a')](function(_0x23313b){var _0x1f9e4b=_0x4133ed[_0x5ac6('0x4d')][_0x5ac6('0x2c')]({'plain':!![]});if(!_0x1f9e4b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f9e4b[_0x5ac6('0x4e')]==='user'){var _0x5d4e9d=_0x23313b[_0x5ac6('0x2c')]({'plain':!![]});var _0x288410=_0x5ac6('0x2d');return db['UserProfileSection'][_0x5ac6('0x4a')]({'where':{'name':_0x288410,'userProfileId':_0x1f9e4b[_0x5ac6('0x4f')]},'raw':!![]})[_0x5ac6('0x2a')](function(_0x73ba29){if(_0x73ba29&&_0x73ba29[_0x5ac6('0x50')]===0x0){return db[_0x5ac6('0x51')][_0x5ac6('0x4b')]({'name':_0x5d4e9d[_0x5ac6('0x2f')],'resourceId':_0x5d4e9d['id'],'type':_0x73ba29[_0x5ac6('0x2f')],'sectionId':_0x73ba29['id']},{})[_0x5ac6('0x2a')](function(){return _0x23313b;});}else{return _0x23313b;}})[_0x5ac6('0x49')](function(_0x146976){logger[_0x5ac6('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x146976);throw _0x146976;});}return _0x23313b;})[_0x5ac6('0x2a')](respondWithResult(_0x409d8c,0xc9))[_0x5ac6('0x49')](handleError(_0x409d8c,null));};exports[_0x5ac6('0x29')]=function(_0x19386d,_0x1537b6){if(_0x19386d[_0x5ac6('0x4c')]['id']){delete _0x19386d[_0x5ac6('0x4c')]['id'];}return db[_0x5ac6('0x44')][_0x5ac6('0x4a')]({'where':{'id':_0x19386d[_0x5ac6('0x53')]['id']}})[_0x5ac6('0x2a')](handleEntityNotFound(_0x1537b6,null))[_0x5ac6('0x2a')](saveUpdates(_0x19386d[_0x5ac6('0x4c')],null))[_0x5ac6('0x2a')](respondWithResult(_0x1537b6,null))[_0x5ac6('0x49')](handleError(_0x1537b6,null));};exports[_0x5ac6('0x2b')]=function(_0x30dc6f,_0x4039ac){return db[_0x5ac6('0x44')]['find']({'where':{'id':_0x30dc6f['params']['id']}})[_0x5ac6('0x2a')](handleEntityNotFound(_0x4039ac,null))[_0x5ac6('0x2a')](removeEntity(_0x4039ac,null))['catch'](handleError(_0x4039ac,null));}; \ No newline at end of file +var _0xf874=['ejs','fs-extra','lodash','crypto','jsforce','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','Content-Range','reject','save','destroy','then','ChanSpies','UserProfileResource','error','stack','name','index','VoiceChanSpy','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','findAll','show','length','include','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x2442dd,_0x269ded){var _0x9d4594=function(_0x4964ff){while(--_0x4964ff){_0x2442dd['push'](_0x2442dd['shift']());}};_0x9d4594(++_0x269ded);}(_0xf874,0xed));var _0x4f87=function(_0x3e1acf,_0x47f207){_0x3e1acf=_0x3e1acf-0x0;var _0x34bb08=_0xf874[_0x3e1acf];return _0x34bb08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f87('0x0'));var jsonpatch=require(_0x4f87('0x1'));var rp=require(_0x4f87('0x2'));var moment=require(_0x4f87('0x3'));var BPromise=require(_0x4f87('0x4'));var Mustache=require(_0x4f87('0x5'));var util=require('util');var path=require(_0x4f87('0x6'));var sox=require(_0x4f87('0x7'));var csv=require(_0x4f87('0x8'));var ejs=require(_0x4f87('0x9'));var fs=require('fs');var fs_extra=require(_0x4f87('0xa'));var _=require(_0x4f87('0xb'));var squel=require('squel');var crypto=require(_0x4f87('0xc'));var jsforce=require(_0x4f87('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4f87('0x8'));var querystring=require(_0x4f87('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f87('0xf'));var authService=require(_0x4f87('0x10'));var qs=require(_0x4f87('0x11'));var as=require(_0x4f87('0x12'));var hardwareService=require(_0x4f87('0x13'));var logger=require(_0x4f87('0x14'))(_0x4f87('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4f87('0x16'));var db=require(_0x4f87('0x17'))['db'];function respondWithStatusCode(_0x107d98,_0x5e6d04){_0x5e6d04=_0x5e6d04||0xcc;return function(_0x4ebb6a){if(_0x4ebb6a){return _0x107d98[_0x4f87('0x18')](_0x5e6d04);}return _0x107d98[_0x4f87('0x19')](_0x5e6d04)[_0x4f87('0x1a')]();};}function respondWithResult(_0x482c6e,_0x2f11d2){_0x2f11d2=_0x2f11d2||0xc8;return function(_0x4a0e2f){if(_0x4a0e2f){return _0x482c6e[_0x4f87('0x19')](_0x2f11d2)[_0x4f87('0x1b')](_0x4a0e2f);}};}function respondWithFilteredResult(_0x4ea72f,_0x2907f6){return function(_0x325edc){if(_0x325edc){var _0xa47360=typeof _0x2907f6[_0x4f87('0x1c')]===_0x4f87('0x1d')&&typeof _0x2907f6[_0x4f87('0x1e')]==='undefined';var _0x3571be=_0x325edc['count'];var _0x10551e=_0xa47360?0x0:_0x2907f6[_0x4f87('0x1c')];var _0x46492d=_0xa47360?_0x325edc[_0x4f87('0x1f')]:_0x2907f6[_0x4f87('0x1c')]+_0x2907f6[_0x4f87('0x1e')];var _0x36cd37;if(_0x46492d>=_0x3571be){_0x46492d=_0x3571be;_0x36cd37=0xc8;}else{_0x36cd37=0xce;}_0x4ea72f[_0x4f87('0x19')](_0x36cd37);return _0x4ea72f[_0x4f87('0x20')](_0x4f87('0x21'),_0x10551e+'-'+_0x46492d+'/'+_0x3571be)[_0x4f87('0x1b')](_0x325edc);}return null;};}function patchUpdates(_0x2c13a0){return function(_0x17d5f8){try{jsonpatch['apply'](_0x17d5f8,_0x2c13a0,!![]);}catch(_0x47ed1e){return BPromise[_0x4f87('0x22')](_0x47ed1e);}return _0x17d5f8[_0x4f87('0x23')]();};}function saveUpdates(_0x5bc73b,_0x592edd){return function(_0x30636d){if(_0x30636d){return _0x30636d['update'](_0x5bc73b)['then'](function(_0x401cd6){return _0x401cd6;});}return null;};}function removeEntity(_0x3c4450,_0x2a382c){return function(_0x3cf180){if(_0x3cf180){return _0x3cf180[_0x4f87('0x24')]()[_0x4f87('0x25')](function(){var _0x197f44=_0x3cf180['get']({'plain':!![]});var _0x234106=_0x4f87('0x26');return db[_0x4f87('0x27')]['destroy']({'where':{'type':_0x234106,'resourceId':_0x197f44['id']}})[_0x4f87('0x25')](function(){return _0x3cf180;});})[_0x4f87('0x25')](function(){_0x3c4450['status'](0xcc)[_0x4f87('0x1a')]();});}};}function handleEntityNotFound(_0xe299f1,_0x3eab48){return function(_0x41e940){if(!_0x41e940){_0xe299f1['sendStatus'](0x194);}return _0x41e940;};}function handleError(_0x4f60dc,_0x2ed28d){_0x2ed28d=_0x2ed28d||0x1f4;return function(_0x208f0a){logger[_0x4f87('0x28')](_0x208f0a[_0x4f87('0x29')]);if(_0x208f0a[_0x4f87('0x2a')]){delete _0x208f0a['name'];}_0x4f60dc[_0x4f87('0x19')](_0x2ed28d)['send'](_0x208f0a);};}exports[_0x4f87('0x2b')]=function(_0x8f847e,_0x149a5b){var _0x430cf9={},_0x3e04ce={},_0x23e54a={'count':0x0,'rows':[]};var _0xaa4ba4=_['map'](db[_0x4f87('0x2c')]['rawAttributes'],function(_0x1d3bec){return{'name':_0x1d3bec[_0x4f87('0x2d')],'type':_0x1d3bec[_0x4f87('0x2e')][_0x4f87('0x2f')]};});_0x3e04ce[_0x4f87('0x30')]=_[_0x4f87('0x31')](_0xaa4ba4,_0x4f87('0x2a'));_0x3e04ce[_0x4f87('0x32')]=_[_0x4f87('0x33')](_0x8f847e[_0x4f87('0x32')]);_0x3e04ce[_0x4f87('0x34')]=_[_0x4f87('0x35')](_0x3e04ce['model'],_0x3e04ce[_0x4f87('0x32')]);_0x430cf9[_0x4f87('0x36')]=_['intersection'](_0x3e04ce[_0x4f87('0x30')],qs[_0x4f87('0x37')](_0x8f847e[_0x4f87('0x32')]['fields']));_0x430cf9[_0x4f87('0x36')]=_0x430cf9[_0x4f87('0x36')]['length']?_0x430cf9[_0x4f87('0x36')]:_0x3e04ce['model'];if(!_0x8f847e[_0x4f87('0x32')][_0x4f87('0x38')](_0x4f87('0x39'))){_0x430cf9['limit']=qs[_0x4f87('0x1e')](_0x8f847e['query']['limit']);_0x430cf9[_0x4f87('0x1c')]=qs[_0x4f87('0x1c')](_0x8f847e['query'][_0x4f87('0x1c')]);}_0x430cf9[_0x4f87('0x3a')]=qs[_0x4f87('0x3b')](_0x8f847e[_0x4f87('0x32')]['sort']);_0x430cf9['where']=qs['filters'](_['pick'](_0x8f847e[_0x4f87('0x32')],_0x3e04ce[_0x4f87('0x34')]),_0xaa4ba4);if(_0x8f847e['query'][_0x4f87('0x3c')]){_0x430cf9[_0x4f87('0x3d')]=_[_0x4f87('0x3e')](_0x430cf9[_0x4f87('0x3d')],{'$or':_[_0x4f87('0x31')](_0xaa4ba4,function(_0x42bf41){if(_0x42bf41['type']!==_0x4f87('0x3f')){var _0x4bae2d={};_0x4bae2d[_0x42bf41['name']]={'$like':'%'+_0x8f847e[_0x4f87('0x32')][_0x4f87('0x3c')]+'%'};return _0x4bae2d;}})});}_0x430cf9=_[_0x4f87('0x3e')]({},_0x430cf9,_0x8f847e['options']);var _0x1d6415={'where':_0x430cf9[_0x4f87('0x3d')]};return db['VoiceChanSpy'][_0x4f87('0x1f')](_0x1d6415)[_0x4f87('0x25')](function(_0x3ae242){_0x23e54a[_0x4f87('0x1f')]=_0x3ae242;if(_0x8f847e[_0x4f87('0x32')][_0x4f87('0x40')]){_0x430cf9['include']=[{'all':!![]}];}return db[_0x4f87('0x2c')][_0x4f87('0x41')](_0x430cf9);})[_0x4f87('0x25')](function(_0x29c7c5){_0x23e54a['rows']=_0x29c7c5;return _0x23e54a;})[_0x4f87('0x25')](respondWithFilteredResult(_0x149a5b,_0x430cf9))['catch'](handleError(_0x149a5b,null));};exports[_0x4f87('0x42')]=function(_0x28f049,_0x3afdcb){var _0x1610f1={'raw':![],'where':{'id':_0x28f049['params']['id']}},_0x58f2db={};_0x58f2db['model']=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x58f2db[_0x4f87('0x32')]=_[_0x4f87('0x33')](_0x28f049[_0x4f87('0x32')]);_0x58f2db[_0x4f87('0x34')]=_[_0x4f87('0x35')](_0x58f2db[_0x4f87('0x30')],_0x58f2db[_0x4f87('0x32')]);_0x1610f1[_0x4f87('0x36')]=_['intersection'](_0x58f2db[_0x4f87('0x30')],qs[_0x4f87('0x37')](_0x28f049[_0x4f87('0x32')][_0x4f87('0x37')]));_0x1610f1[_0x4f87('0x36')]=_0x1610f1[_0x4f87('0x36')][_0x4f87('0x43')]?_0x1610f1[_0x4f87('0x36')]:_0x58f2db[_0x4f87('0x30')];if(_0x28f049[_0x4f87('0x32')][_0x4f87('0x40')]){_0x1610f1[_0x4f87('0x44')]=[{'all':!![]}];}_0x1610f1=_[_0x4f87('0x3e')]({},_0x1610f1,_0x28f049[_0x4f87('0x45')]);return db[_0x4f87('0x2c')][_0x4f87('0x46')](_0x1610f1)[_0x4f87('0x25')](handleEntityNotFound(_0x3afdcb,null))['then'](respondWithResult(_0x3afdcb,null))[_0x4f87('0x47')](handleError(_0x3afdcb,null));};exports['create']=function(_0x59a7ce,_0x3e7383){return db[_0x4f87('0x2c')][_0x4f87('0x48')](_0x59a7ce[_0x4f87('0x49')],{})[_0x4f87('0x25')](function(_0x1e29dc){var _0x221c14=_0x59a7ce[_0x4f87('0x4a')][_0x4f87('0x4b')]({'plain':!![]});if(!_0x221c14)throw new Error(_0x4f87('0x4c'));if(_0x221c14['role']==='user'){var _0x2b9af9=_0x1e29dc[_0x4f87('0x4b')]({'plain':!![]});var _0xb34275='ChanSpies';return db['UserProfileSection'][_0x4f87('0x46')]({'where':{'name':_0xb34275,'userProfileId':_0x221c14[_0x4f87('0x4d')]},'raw':!![]})[_0x4f87('0x25')](function(_0xc81d81){if(_0xc81d81&&_0xc81d81[_0x4f87('0x4e')]===0x0){return db[_0x4f87('0x27')]['create']({'name':_0x2b9af9[_0x4f87('0x2a')],'resourceId':_0x2b9af9['id'],'type':_0xc81d81['name'],'sectionId':_0xc81d81['id']},{})[_0x4f87('0x25')](function(){return _0x1e29dc;});}else{return _0x1e29dc;}})['catch'](function(_0x225c5c){logger[_0x4f87('0x28')](_0x4f87('0x4f'),_0x225c5c);throw _0x225c5c;});}return _0x1e29dc;})[_0x4f87('0x25')](respondWithResult(_0x3e7383,0xc9))[_0x4f87('0x47')](handleError(_0x3e7383,null));};exports[_0x4f87('0x50')]=function(_0x22c389,_0x526c78){if(_0x22c389[_0x4f87('0x49')]['id']){delete _0x22c389[_0x4f87('0x49')]['id'];}return db[_0x4f87('0x2c')]['find']({'where':{'id':_0x22c389[_0x4f87('0x51')]['id']}})['then'](handleEntityNotFound(_0x526c78,null))[_0x4f87('0x25')](saveUpdates(_0x22c389[_0x4f87('0x49')],null))[_0x4f87('0x25')](respondWithResult(_0x526c78,null))[_0x4f87('0x47')](handleError(_0x526c78,null));};exports[_0x4f87('0x24')]=function(_0x51ee0e,_0x16e323){return db[_0x4f87('0x2c')]['find']({'where':{'id':_0x51ee0e[_0x4f87('0x51')]['id']}})[_0x4f87('0x25')](handleEntityNotFound(_0x16e323,null))[_0x4f87('0x25')](removeEntity(_0x16e323,null))[_0x4f87('0x47')](handleError(_0x16e323,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 260ffd4..134e1ca 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 _0x54d7=['chanspy','record','auth','Authenticate','password','name','options','join','StopMixMonitor','concat','internal','findAll','catch','exports','models','define','VoiceChanSpy','then','length','VoiceExtension','bulkCreate','destroy','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','push','merge','CDR(type)=%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54d7,0xd6));var _0x754d=function(_0x328e80,_0x4959e6){_0x328e80=_0x328e80-0x0;var _0x4169ea=_0x54d7[_0x328e80];return _0x4169ea;};'use strict';var _=require('lodash');var util=require(_0x754d('0x0'));var BPromise=require('bluebird');var attributes=require(_0x754d('0x1'));var getUserApplications=function(_0x286a67,_0x27eca8,_0x2ca05d){var _0x3cdf2c=0x1;var _0x4e1395=[];var _0x561b04={'context':_0x27eca8[_0x754d('0x2')]||_0x754d('0x3'),'exten':util[_0x754d('0x4')](_0x754d('0x5'),_0x286a67[_0x754d('0x6')],_0x2ca05d),'type':'system','isApp':![],'ChanSpyId':_0x286a67['id'],'UserId':_0x27eca8['id']};_0x4e1395[_0x754d('0x7')](_[_0x754d('0x8')]({'app':'Set','appdata':util['format'](_0x754d('0x9'),_0x754d('0xa')),'priority':_0x3cdf2c++},_0x561b04));if(_0x286a67[_0x754d('0xb')]){_0x4e1395[_0x754d('0x7')](_['merge']({'app':'MixMonitor','appdata':util[_0x754d('0x4')]('${UNIQUEID}.%s,a',_0x286a67['recordingFormat']),'priority':_0x3cdf2c++},_0x561b04));}if(_0x286a67[_0x754d('0xc')]){_0x4e1395[_0x754d('0x7')](_[_0x754d('0x8')]({'app':_0x754d('0xd'),'appdata':_0x286a67[_0x754d('0xe')],'priority':_0x3cdf2c++},_0x561b04));}_0x4e1395['push'](_[_0x754d('0x8')]({'app':'ChanSpy','appdata':util[_0x754d('0x4')]('SIP/%s,%s',_0x27eca8[_0x754d('0xf')],_0x286a67[_0x754d('0x10')]?_0x286a67[_0x754d('0x10')][_0x754d('0x11')](''):''),'priority':_0x3cdf2c++},_0x561b04));if(_0x286a67[_0x754d('0xb')]){_0x4e1395[_0x754d('0x7')](_[_0x754d('0x8')]({'app':_0x754d('0x12'),'priority':_0x3cdf2c++},_0x561b04));}return _0x4e1395;};var getChanSpyApplications=function(_0x5ebc2e,_0x59535c){var _0x392274=[];for(var _0x199018=0x0,_0x3ac040=0x1;_0x199018<_0x59535c['length'];_0x199018++,_0x3ac040=0x1){_0x392274=_0x392274[_0x754d('0x13')](getUserApplications(_0x5ebc2e,_0x59535c[_0x199018],_0x59535c[_0x199018][_0x754d('0x14')]));if(_0x59535c[_0x199018][_0x754d('0x14')]!=_0x59535c[_0x199018][_0x754d('0xf')]){_0x392274=_0x392274['concat'](getUserApplications(_0x5ebc2e,_0x59535c[_0x199018],_0x59535c[_0x199018][_0x754d('0xf')]));}}return _0x392274;};var getChanSpyPromise=function(_0x57bc33,_0x58bf78){return new BPromise(function(_0x26b752,_0x23f17d){return _0x57bc33['User'][_0x754d('0x15')]({'attributes':['id',_0x754d('0xf'),_0x754d('0x14')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x371db1){if(_0x371db1){return _0x26b752(getChanSpyApplications(_0x58bf78,_0x371db1));}return _0x26b752([]);})[_0x754d('0x16')](function(_0x1f9baf){_0x23f17d(_0x1f9baf);});});};module[_0x754d('0x17')]=function(_0x12de81,_0x1b1748){var _0x5ac49e=_0x12de81[_0x754d('0x18')];return _0x12de81[_0x754d('0x19')](_0x754d('0x1a'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xff77a8,_0x128772,_0x394827){return getChanSpyPromise(_0x5ac49e,_0xff77a8)[_0x754d('0x1b')](function(_0x825891){if(_0x825891&&_0x825891[_0x754d('0x1c')]){return _0x5ac49e[_0x754d('0x1d')]['bulkCreate'](_0x825891);}})[_0x754d('0x1b')](function(){_0x394827();})[_0x754d('0x16')](function(_0x27c490){_0x394827(_0x27c490);});},'afterUpdate':function(_0x196c55,_0x46d30e,_0x334436){return _0x5ac49e[_0x754d('0x1d')]['destroy']({'where':{'ChanSpyId':_0x196c55['id']}})[_0x754d('0x1b')](function(){return getChanSpyPromise(_0x5ac49e,_0x196c55);})['then'](function(_0x673038){if(_0x673038&&_0x673038[_0x754d('0x1c')]){return _0x5ac49e[_0x754d('0x1d')][_0x754d('0x1e')](_0x673038);}})[_0x754d('0x1b')](function(){_0x334436();})['catch'](function(_0x1abf30){_0x334436(_0x1abf30);});},'afterDestroy':function(_0x1d0d58,_0x30c5b4,_0x3773b1){return _0x5ac49e[_0x754d('0x1d')][_0x754d('0x1f')]({'where':{'ChanSpyId':_0x1d0d58['id']}})[_0x754d('0x1b')](function(){_0x3773b1();})[_0x754d('0x16')](function(_0x358eba){_0x3773b1(_0x358eba);});}}});}; \ No newline at end of file +var _0xbf30=['name','options','join','record','StopMixMonitor','concat','User','agent','then','catch','exports','models','define','VoiceChanSpy','length','bulkCreate','destroy','VoiceExtension','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy'];(function(_0xf00800,_0x1f50ba){var _0x381043=function(_0x4850fc){while(--_0x4850fc){_0xf00800['push'](_0xf00800['shift']());}};_0x381043(++_0x1f50ba);}(_0xbf30,0xd0));var _0x0bf3=function(_0x4add04,_0x47f426){_0x4add04=_0x4add04-0x0;var _0x55475f=_0xbf30[_0x4add04];return _0x55475f;};'use strict';var _=require(_0x0bf3('0x0'));var util=require(_0x0bf3('0x1'));var BPromise=require(_0x0bf3('0x2'));var attributes=require(_0x0bf3('0x3'));var getUserApplications=function(_0x232411,_0xa4d0a0,_0x529265){var _0x336d11=0x1;var _0x47b508=[];var _0x173c81={'context':_0xa4d0a0[_0x0bf3('0x4')]||_0x0bf3('0x5'),'exten':util[_0x0bf3('0x6')](_0x0bf3('0x7'),_0x232411[_0x0bf3('0x8')],_0x529265),'type':_0x0bf3('0x9'),'isApp':![],'ChanSpyId':_0x232411['id'],'UserId':_0xa4d0a0['id']};_0x47b508[_0x0bf3('0xa')](_[_0x0bf3('0xb')]({'app':_0x0bf3('0xc'),'appdata':util[_0x0bf3('0x6')]('CDR(type)=%s','chanspy'),'priority':_0x336d11++},_0x173c81));if(_0x232411['record']){_0x47b508['push'](_[_0x0bf3('0xb')]({'app':_0x0bf3('0xd'),'appdata':util['format'](_0x0bf3('0xe'),_0x232411[_0x0bf3('0xf')]),'priority':_0x336d11++},_0x173c81));}if(_0x232411[_0x0bf3('0x10')]){_0x47b508[_0x0bf3('0xa')](_[_0x0bf3('0xb')]({'app':_0x0bf3('0x11'),'appdata':_0x232411[_0x0bf3('0x12')],'priority':_0x336d11++},_0x173c81));}_0x47b508[_0x0bf3('0xa')](_[_0x0bf3('0xb')]({'app':_0x0bf3('0x13'),'appdata':util['format']('SIP/%s,%s',_0xa4d0a0[_0x0bf3('0x14')],_0x232411[_0x0bf3('0x15')]?_0x232411[_0x0bf3('0x15')][_0x0bf3('0x16')](''):''),'priority':_0x336d11++},_0x173c81));if(_0x232411[_0x0bf3('0x17')]){_0x47b508[_0x0bf3('0xa')](_['merge']({'app':_0x0bf3('0x18'),'priority':_0x336d11++},_0x173c81));}return _0x47b508;};var getChanSpyApplications=function(_0x1a3d2c,_0x1a30cc){var _0x53b072=[];for(var _0x165d20=0x0,_0x6dba9f=0x1;_0x165d20<_0x1a30cc['length'];_0x165d20++,_0x6dba9f=0x1){_0x53b072=_0x53b072[_0x0bf3('0x19')](getUserApplications(_0x1a3d2c,_0x1a30cc[_0x165d20],_0x1a30cc[_0x165d20]['internal']));if(_0x1a30cc[_0x165d20]['internal']!=_0x1a30cc[_0x165d20][_0x0bf3('0x14')]){_0x53b072=_0x53b072['concat'](getUserApplications(_0x1a3d2c,_0x1a30cc[_0x165d20],_0x1a30cc[_0x165d20]['name']));}}return _0x53b072;};var getChanSpyPromise=function(_0x5cf743,_0xa2a54c){return new BPromise(function(_0x428f63,_0x13038e){return _0x5cf743[_0x0bf3('0x1a')]['findAll']({'attributes':['id',_0x0bf3('0x14'),'internal'],'where':{'role':_0x0bf3('0x1b'),'chanspy':!![]},'raw':!![]})[_0x0bf3('0x1c')](function(_0x355db1){if(_0x355db1){return _0x428f63(getChanSpyApplications(_0xa2a54c,_0x355db1));}return _0x428f63([]);})[_0x0bf3('0x1d')](function(_0x42d1ad){_0x13038e(_0x42d1ad);});});};module[_0x0bf3('0x1e')]=function(_0x3af54c,_0xf163d0){var _0x20447d=_0x3af54c[_0x0bf3('0x1f')];return _0x3af54c[_0x0bf3('0x20')](_0x0bf3('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f5497,_0x45734f,_0x5db201){return getChanSpyPromise(_0x20447d,_0x2f5497)['then'](function(_0x7a7024){if(_0x7a7024&&_0x7a7024[_0x0bf3('0x22')]){return _0x20447d['VoiceExtension'][_0x0bf3('0x23')](_0x7a7024);}})[_0x0bf3('0x1c')](function(){_0x5db201();})[_0x0bf3('0x1d')](function(_0x4c8e70){_0x5db201(_0x4c8e70);});},'afterUpdate':function(_0x2115c8,_0x2dbc74,_0x6d664e){return _0x20447d['VoiceExtension'][_0x0bf3('0x24')]({'where':{'ChanSpyId':_0x2115c8['id']}})[_0x0bf3('0x1c')](function(){return getChanSpyPromise(_0x20447d,_0x2115c8);})[_0x0bf3('0x1c')](function(_0xc00611){if(_0xc00611&&_0xc00611['length']){return _0x20447d[_0x0bf3('0x25')][_0x0bf3('0x23')](_0xc00611);}})[_0x0bf3('0x1c')](function(){_0x6d664e();})[_0x0bf3('0x1d')](function(_0x5a50b0){_0x6d664e(_0x5a50b0);});},'afterDestroy':function(_0xe7474b,_0x11588d,_0x5b1ef8){return _0x20447d['VoiceExtension'][_0x0bf3('0x24')]({'where':{'ChanSpyId':_0xe7474b['id']}})['then'](function(){_0x5b1ef8();})['catch'](function(_0x42b986){_0x5b1ef8(_0x42b986);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ede503b..ac7ea12 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 _0x76dc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x3bbdab,_0x4a1e84){var _0x5bd16b=function(_0x570613){while(--_0x570613){_0x3bbdab['push'](_0x3bbdab['shift']());}};_0x5bd16b(++_0x4a1e84);}(_0x76dc,0x1f2));var _0xc76d=function(_0x419d13,_0x38fe24){_0x419d13=_0x419d13-0x0;var _0x3fd4a8=_0x76dc[_0x419d13];return _0x3fd4a8;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});} \ No newline at end of file +var _0x4483=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x47052b,_0x1853fa){var _0x829812=function(_0x65ac50){while(--_0x65ac50){_0x47052b['push'](_0x47052b['shift']());}};_0x829812(++_0x1853fa);}(_0x4483,0x1a3));var _0x3448=function(_0xb206e4,_0x54e76c){_0xb206e4=_0xb206e4-0x0;var _0x51ab28=_0x4483[_0xb206e4];return _0x51ab28;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 7aa86fe..603184d 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 _0x2dd2=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x57bdab,_0x2edaf8){var _0x1e6c0f=function(_0xf52bf2){while(--_0xf52bf2){_0x57bdab['push'](_0x57bdab['shift']());}};_0x1e6c0f(++_0x2edaf8);}(_0x2dd2,0xb0));var _0x22dd=function(_0x2edaeb,_0x2f3df2){_0x2edaeb=_0x2edaeb-0x0;var _0x18c347=_0x2dd2[_0x2edaeb];return _0x18c347;};'use strict';var multer=require(_0x22dd('0x0'));var util=require(_0x22dd('0x1'));var path=require(_0x22dd('0x2'));var timeout=require(_0x22dd('0x3'));var express=require('express');var router=express[_0x22dd('0x4')]();var fs_extra=require(_0x22dd('0x5'));var auth=require(_0x22dd('0x6'));var interaction=require(_0x22dd('0x7'));var config=require(_0x22dd('0x8'));var controller=require('./voiceContext.controller');router[_0x22dd('0x9')]('/',auth[_0x22dd('0xa')](),controller[_0x22dd('0xb')]);router[_0x22dd('0x9')](_0x22dd('0xc'),auth['isAuthenticated'](),controller[_0x22dd('0xd')]);router[_0x22dd('0xe')]('/',auth['isAuthenticated'](),controller[_0x22dd('0xf')]);router[_0x22dd('0x10')](_0x22dd('0xc'),auth['isAuthenticated'](),controller[_0x22dd('0x11')]);router[_0x22dd('0x12')]('/:id',auth[_0x22dd('0xa')](),controller[_0x22dd('0x13')]);module[_0x22dd('0x14')]=router; \ No newline at end of file +var _0x9114=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x1fb4ff,_0x172d25){var _0x3f2d20=function(_0x358d44){while(--_0x358d44){_0x1fb4ff['push'](_0x1fb4ff['shift']());}};_0x3f2d20(++_0x172d25);}(_0x9114,0x14e));var _0x4911=function(_0x39dd96,_0x59cbe9){_0x39dd96=_0x39dd96-0x0;var _0x999bde=_0x9114[_0x39dd96];return _0x999bde;};'use strict';var multer=require(_0x4911('0x0'));var util=require(_0x4911('0x1'));var path=require(_0x4911('0x2'));var timeout=require(_0x4911('0x3'));var express=require(_0x4911('0x4'));var router=express[_0x4911('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4911('0x6'));var interaction=require(_0x4911('0x7'));var config=require(_0x4911('0x8'));var controller=require(_0x4911('0x9'));router[_0x4911('0xa')]('/',auth[_0x4911('0xb')](),controller[_0x4911('0xc')]);router[_0x4911('0xa')]('/:id',auth[_0x4911('0xb')](),controller[_0x4911('0xd')]);router[_0x4911('0xe')]('/',auth[_0x4911('0xb')](),controller[_0x4911('0xf')]);router[_0x4911('0x10')](_0x4911('0x11'),auth[_0x4911('0xb')](),controller[_0x4911('0x12')]);router['delete'](_0x4911('0x11'),auth[_0x4911('0xb')](),controller[_0x4911('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 155895c..a18226a 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 _0x5308=['exports','STRING','name','BOOLEAN'];(function(_0x33c1e7,_0x1d66ff){var _0x180158=function(_0x3ea430){while(--_0x3ea430){_0x33c1e7['push'](_0x33c1e7['shift']());}};_0x180158(++_0x1d66ff);}(_0x5308,0x11c));var _0x8530=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x5308[_0x52c4e9];return _0x252a03;};'use strict';var Sequelize=require('sequelize');module[_0x8530('0x0')]={'name':{'type':Sequelize[_0x8530('0x1')],'unique':_0x8530('0x2')},'description':{'type':Sequelize[_0x8530('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8530('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf92d=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x1ebe9e,_0x58b245){var _0x2386d8=function(_0x38d4ac){while(--_0x38d4ac){_0x1ebe9e['push'](_0x1ebe9e['shift']());}};_0x2386d8(++_0x58b245);}(_0xf92d,0xdb));var _0xdf92=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xf92d[_0x2b5513];return _0x578fd2;};'use strict';var Sequelize=require(_0xdf92('0x0'));module[_0xdf92('0x1')]={'name':{'type':Sequelize[_0xdf92('0x2')],'unique':_0xdf92('0x3')},'description':{'type':Sequelize[_0xdf92('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xdf92('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index c55bd2f..b0bf1d2 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 _0x3a64=['VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','get','Contexts','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','includeAll','include','findAll','rows','show','params','keys','create','body','join','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','readFileSync','root','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info'];(function(_0x3448aa,_0x58060b){var _0x45420d=function(_0x51ac57){while(--_0x51ac57){_0x3448aa['push'](_0x3448aa['shift']());}};_0x45420d(++_0x58060b);}(_0x3a64,0x11d));var _0x43a6=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3a64[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0x43a6('0x0'));var rimraf=require(_0x43a6('0x1'));var zipdir=require(_0x43a6('0x2'));var jsonpatch=require(_0x43a6('0x3'));var rp=require(_0x43a6('0x4'));var moment=require(_0x43a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x43a6('0x6'));var util=require(_0x43a6('0x7'));var path=require(_0x43a6('0x8'));var sox=require(_0x43a6('0x9'));var csv=require(_0x43a6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43a6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x43a6('0xc'));var jsforce=require(_0x43a6('0xd'));var deskjs=require(_0x43a6('0xe'));var toCsv=require(_0x43a6('0xa'));var querystring=require(_0x43a6('0xf'));var Papa=require(_0x43a6('0x10'));var Redis=require(_0x43a6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x43a6('0x12'));var hardwareService=require(_0x43a6('0x13'));var logger=require(_0x43a6('0x14'))(_0x43a6('0x15'));var utils=require(_0x43a6('0x16'));var config=require(_0x43a6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x43a6('0x18'))['db'];var jayson=require(_0x43a6('0x19'));var client=jayson['client'][_0x43a6('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5024f8,_0x3f2b9c,_0x1b7718,_0x1eec1a){return new BPromise(function(_0xc77f77,_0x44983b){var _0x59816f=_0x1eec1a||client;return _0x59816f[_0x43a6('0x1b')](_0x5024f8,_0x1b7718)[_0x43a6('0x1c')](function(_0x4ed0ea){logger[_0x43a6('0x1d')](_0x43a6('0x1e'),_0x3f2b9c,_0x43a6('0x1f'));logger['debug'](_0x43a6('0x20'),_0x3f2b9c,_0x43a6('0x1f'),JSON[_0x43a6('0x21')](_0x4ed0ea));if(_0x4ed0ea['error']){if(_0x4ed0ea['error'][_0x43a6('0x22')]===0x1f4){logger[_0x43a6('0x23')](_0x43a6('0x1e'),_0x3f2b9c,_0x4ed0ea[_0x43a6('0x23')]['message']);return _0x44983b(_0x4ed0ea[_0x43a6('0x23')][_0x43a6('0x24')]);}logger[_0x43a6('0x23')](_0x43a6('0x1e'),_0x3f2b9c,_0x4ed0ea['error'][_0x43a6('0x24')]);return _0xc77f77(_0x4ed0ea['error']['message']);}else{logger[_0x43a6('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x3f2b9c,_0x43a6('0x1f'));_0xc77f77(_0x4ed0ea[_0x43a6('0x25')][_0x43a6('0x24')]);}})['catch'](function(_0x4e0742){logger[_0x43a6('0x23')](_0x43a6('0x1e'),_0x3f2b9c,_0x4e0742);_0x44983b(_0x4e0742);});});}function respondWithStatusCode(_0x3fa250,_0x3744cd){_0x3744cd=_0x3744cd||0xcc;return function(_0xd8901c){if(_0xd8901c){return _0x3fa250[_0x43a6('0x26')](_0x3744cd);}return _0x3fa250[_0x43a6('0x27')](_0x3744cd)['end']();};}function respondWithResult(_0x355ff3,_0x135390){_0x135390=_0x135390||0xc8;return function(_0x344a74){if(_0x344a74){return _0x355ff3[_0x43a6('0x27')](_0x135390)[_0x43a6('0x28')](_0x344a74);}};}function respondWithFilteredResult(_0x43ac44,_0x3b6f33){return function(_0x2ac8b4){if(_0x2ac8b4){var _0x7b168c=typeof _0x3b6f33['offset']===_0x43a6('0x29')&&typeof _0x3b6f33[_0x43a6('0x2a')]===_0x43a6('0x29');var _0x1191f7=_0x2ac8b4[_0x43a6('0x2b')];var _0x152510=_0x7b168c?0x0:_0x3b6f33['offset'];var _0x4b1fd6=_0x7b168c?_0x2ac8b4[_0x43a6('0x2b')]:_0x3b6f33[_0x43a6('0x2c')]+_0x3b6f33[_0x43a6('0x2a')];var _0x286b6b;if(_0x4b1fd6>=_0x1191f7){_0x4b1fd6=_0x1191f7;_0x286b6b=0xc8;}else{_0x286b6b=0xce;}_0x43ac44['status'](_0x286b6b);return _0x43ac44[_0x43a6('0x2d')](_0x43a6('0x2e'),_0x152510+'-'+_0x4b1fd6+'/'+_0x1191f7)['json'](_0x2ac8b4);}return null;};}function patchUpdates(_0xb59dd0){return function(_0x96ace6){try{jsonpatch[_0x43a6('0x2f')](_0x96ace6,_0xb59dd0,!![]);}catch(_0x3f89ed){return BPromise[_0x43a6('0x30')](_0x3f89ed);}return _0x96ace6[_0x43a6('0x31')]();};}function saveUpdates(_0xbd22a0,_0xef52ed){return function(_0x1342a6){if(_0x1342a6){return _0x1342a6['update'](_0xbd22a0)[_0x43a6('0x1c')](function(_0x14d81f){return _0x14d81f;});}return null;};}function removeEntity(_0x132ad4,_0x14a79d){return function(_0x15c6b6){if(_0x15c6b6){return _0x15c6b6[_0x43a6('0x32')]()[_0x43a6('0x1c')](function(){var _0x5e4db6=_0x15c6b6[_0x43a6('0x33')]({'plain':!![]});var _0x310279=_0x43a6('0x34');return db['UserProfileResource'][_0x43a6('0x32')]({'where':{'type':_0x310279,'resourceId':_0x5e4db6['id']}})[_0x43a6('0x1c')](function(){return _0x15c6b6;});})['then'](function(){_0x132ad4[_0x43a6('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59fb24,_0x464962){return function(_0x6cd245){if(!_0x6cd245){_0x59fb24['sendStatus'](0x194);}return _0x6cd245;};}function handleError(_0x40ba89,_0x33beb3){_0x33beb3=_0x33beb3||0x1f4;return function(_0x451a5c){logger['error'](_0x451a5c[_0x43a6('0x35')]);if(_0x451a5c[_0x43a6('0x36')]){delete _0x451a5c[_0x43a6('0x36')];}_0x40ba89[_0x43a6('0x27')](_0x33beb3)[_0x43a6('0x37')](_0x451a5c);};}exports[_0x43a6('0x38')]=function(_0x2cb853,_0x4d6fd6){var _0x1795cf={},_0x3c11fb={},_0x1a3585={'count':0x0,'rows':[]};var _0x48708d=_['map'](db[_0x43a6('0x39')][_0x43a6('0x3a')],function(_0x325e47){return{'name':_0x325e47[_0x43a6('0x3b')],'type':_0x325e47[_0x43a6('0x3c')][_0x43a6('0x3d')]};});_0x3c11fb[_0x43a6('0x3e')]=_['map'](_0x48708d,_0x43a6('0x36'));_0x3c11fb['query']=_['keys'](_0x2cb853['query']);_0x3c11fb[_0x43a6('0x3f')]=_[_0x43a6('0x40')](_0x3c11fb[_0x43a6('0x3e')],_0x3c11fb[_0x43a6('0x41')]);_0x1795cf['attributes']=_[_0x43a6('0x40')](_0x3c11fb['model'],qs['fields'](_0x2cb853[_0x43a6('0x41')][_0x43a6('0x42')]));_0x1795cf[_0x43a6('0x43')]=_0x1795cf[_0x43a6('0x43')][_0x43a6('0x44')]?_0x1795cf['attributes']:_0x3c11fb['model'];if(!_0x2cb853[_0x43a6('0x41')][_0x43a6('0x45')](_0x43a6('0x46'))){_0x1795cf['limit']=qs[_0x43a6('0x2a')](_0x2cb853['query'][_0x43a6('0x2a')]);_0x1795cf[_0x43a6('0x2c')]=qs['offset'](_0x2cb853['query'][_0x43a6('0x2c')]);}_0x1795cf[_0x43a6('0x47')]=qs[_0x43a6('0x48')](_0x2cb853['query'][_0x43a6('0x48')]);_0x1795cf[_0x43a6('0x49')]=qs[_0x43a6('0x3f')](_[_0x43a6('0x4a')](_0x2cb853[_0x43a6('0x41')],_0x3c11fb[_0x43a6('0x3f')]),_0x48708d);if(_0x2cb853['query']['filter']){_0x1795cf[_0x43a6('0x49')]=_[_0x43a6('0x4b')](_0x1795cf['where'],{'$or':_[_0x43a6('0x4c')](_0x48708d,function(_0x381110){if(_0x381110[_0x43a6('0x3c')]!=='VIRTUAL'){var _0x1fc6e5={};_0x1fc6e5[_0x381110[_0x43a6('0x36')]]={'$like':'%'+_0x2cb853[_0x43a6('0x41')][_0x43a6('0x4d')]+'%'};return _0x1fc6e5;}})});}_0x1795cf=_['merge']({},_0x1795cf,_0x2cb853['options']);var _0x740d6b={'where':_0x1795cf[_0x43a6('0x49')]};return db[_0x43a6('0x39')]['count'](_0x740d6b)[_0x43a6('0x1c')](function(_0x42bbdc){_0x1a3585['count']=_0x42bbdc;if(_0x2cb853[_0x43a6('0x41')][_0x43a6('0x4e')]){_0x1795cf[_0x43a6('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0x43a6('0x50')](_0x1795cf);})['then'](function(_0x3af3e2){_0x1a3585[_0x43a6('0x51')]=_0x3af3e2;return _0x1a3585;})[_0x43a6('0x1c')](respondWithFilteredResult(_0x4d6fd6,_0x1795cf))['catch'](handleError(_0x4d6fd6,null));};exports[_0x43a6('0x52')]=function(_0x3b59c3,_0x3b7e5d){var _0x350c13={'raw':![],'where':{'id':_0x3b59c3[_0x43a6('0x53')]['id']}},_0x31015b={};_0x31015b['model']=_[_0x43a6('0x54')](db[_0x43a6('0x39')][_0x43a6('0x3a')]);_0x31015b['query']=_[_0x43a6('0x54')](_0x3b59c3['query']);_0x31015b['filters']=_[_0x43a6('0x40')](_0x31015b[_0x43a6('0x3e')],_0x31015b[_0x43a6('0x41')]);_0x350c13[_0x43a6('0x43')]=_['intersection'](_0x31015b[_0x43a6('0x3e')],qs['fields'](_0x3b59c3[_0x43a6('0x41')][_0x43a6('0x42')]));_0x350c13[_0x43a6('0x43')]=_0x350c13[_0x43a6('0x43')][_0x43a6('0x44')]?_0x350c13['attributes']:_0x31015b[_0x43a6('0x3e')];if(_0x3b59c3[_0x43a6('0x41')][_0x43a6('0x4e')]){_0x350c13['include']=[{'all':!![]}];}_0x350c13=_['merge']({},_0x350c13,_0x3b59c3['options']);return db[_0x43a6('0x39')]['find'](_0x350c13)[_0x43a6('0x1c')](handleEntityNotFound(_0x3b7e5d,null))[_0x43a6('0x1c')](respondWithResult(_0x3b7e5d,null))['catch'](handleError(_0x3b7e5d,null));};exports[_0x43a6('0x55')]=function(_0x1f1016,_0x1e9f61,_0x53fc88){var _0x90d568;return db[_0x43a6('0x39')][_0x43a6('0x55')](_0x1f1016[_0x43a6('0x56')],{'raw':!![]})[_0x43a6('0x1c')](function(_0x36c50d){_0x90d568=_0x36c50d;return db['VoiceContext'][_0x43a6('0x50')]({'raw':!![]});})[_0x43a6('0x1c')](function(_0x64893b){var _0x209911=fs['readFileSync'](path[_0x43a6('0x57')](config['root'],_0x43a6('0x58')),_0x43a6('0x59'));var _0x730aa3=ejs[_0x43a6('0x5a')](_0x209911,{'contexts':_0x64893b||[]});fs[_0x43a6('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x730aa3);})[_0x43a6('0x1c')](function(){return respondWithRpcPromise(_0x43a6('0x5c'),_0x43a6('0x55'),{'module':'chan_sip.so'});})[_0x43a6('0x1c')](function(){var _0x2eb755=_0x1f1016['user']['get']({'plain':!![]});if(!_0x2eb755)throw new Error(_0x43a6('0x5d'));if(_0x2eb755[_0x43a6('0x5e')]==='user'){var _0x4170e0=_0x90d568[_0x43a6('0x33')]({'plain':!![]});return db[_0x43a6('0x5f')][_0x43a6('0x60')]({'where':{'name':_0x43a6('0x34'),'userProfileId':_0x2eb755['userProfileId']},'raw':!![]})[_0x43a6('0x1c')](function(_0x3f09dc){if(_0x3f09dc&&_0x3f09dc['autoAssociation']===0x0){return db[_0x43a6('0x61')][_0x43a6('0x55')]({'name':_0x4170e0[_0x43a6('0x36')],'resourceId':_0x4170e0['id'],'type':_0x3f09dc['name'],'sectionId':_0x3f09dc['id']},{})[_0x43a6('0x1c')](function(){return _0x90d568;});}else{return _0x90d568;}})[_0x43a6('0x62')](function(_0x42a401){logger[_0x43a6('0x23')](_0x43a6('0x63'),_0x42a401);throw _0x42a401;});}return _0x90d568;})[_0x43a6('0x1c')](respondWithResult(_0x1e9f61,0xc9))[_0x43a6('0x62')](handleError(_0x1e9f61,null));};exports[_0x43a6('0x64')]=function(_0x5b2015,_0x487378,_0xcf037){var _0x415025;return db['VoiceContext']['find']({'where':{'id':_0x5b2015[_0x43a6('0x53')]['id']}})[_0x43a6('0x1c')](handleEntityNotFound(_0x487378,null))[_0x43a6('0x1c')](saveUpdates(_0x5b2015[_0x43a6('0x56')],null))[_0x43a6('0x1c')](function(_0x612190){if(_0x612190){_0x415025=_0x612190;return db['VoiceContext'][_0x43a6('0x50')]({'raw':!![]});}})[_0x43a6('0x1c')](function(_0x27b063){var _0x1cecca=fs[_0x43a6('0x65')](path[_0x43a6('0x57')](config[_0x43a6('0x66')],_0x43a6('0x58')),_0x43a6('0x59'));var _0x27389d=ejs['render'](_0x1cecca,{'contexts':_0x27b063||[]});fs[_0x43a6('0x5b')](_0x43a6('0x67'),_0x27389d);})[_0x43a6('0x1c')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x43a6('0x68')});})[_0x43a6('0x1c')](function(){return _0x415025;})[_0x43a6('0x1c')](respondWithResult(_0x487378,null))[_0x43a6('0x62')](handleError(_0x487378,null));};exports['destroy']=function(_0x5d57a6,_0x340445,_0x25ed9b){var _0x262234;return db[_0x43a6('0x39')][_0x43a6('0x60')]({'where':{'id':_0x5d57a6['params']['id']}})[_0x43a6('0x1c')](handleEntityNotFound(_0x340445,null))[_0x43a6('0x1c')](removeEntity(_0x340445,null))[_0x43a6('0x1c')](function(){return db['VoiceContext'][_0x43a6('0x50')]({'raw':!![]});})[_0x43a6('0x1c')](function(_0x2d54be){var _0x4d882a=fs['readFileSync'](path[_0x43a6('0x57')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x44fa4f=ejs[_0x43a6('0x5a')](_0x4d882a,{'contexts':_0x2d54be});fs['writeFileSync'](_0x43a6('0x67'),_0x44fa4f);return respondWithRpcPromise(_0x43a6('0x5c'),'destroy',{'module':_0x43a6('0x68')});})[_0x43a6('0x62')](handleError(_0x340445,null));}; \ No newline at end of file +var _0xc485=['fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','get','Contexts','UserProfileResource','destroy','name','send','index','VoiceContext','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','options','includeAll','include','findAll','rawAttributes','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','params','eml-format','zip-dir','fast-json-patch','moment','sox','to-csv','ejs'];(function(_0x2d5ea1,_0x15b690){var _0x143a4f=function(_0x2eaa36){while(--_0x2eaa36){_0x2d5ea1['push'](_0x2d5ea1['shift']());}};_0x143a4f(++_0x15b690);}(_0xc485,0x16d));var _0x5c48=function(_0x2865c9,_0x575948){_0x2865c9=_0x2865c9-0x0;var _0x585985=_0xc485[_0x2865c9];return _0x585985;};'use strict';var emlformat=require(_0x5c48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c48('0x1'));var jsonpatch=require(_0x5c48('0x2'));var rp=require('request-promise');var moment=require(_0x5c48('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5c48('0x4'));var csv=require(_0x5c48('0x5'));var ejs=require(_0x5c48('0x6'));var fs=require('fs');var fs_extra=require(_0x5c48('0x7'));var _=require('lodash');var squel=require(_0x5c48('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5c48('0x9'));var toCsv=require('to-csv');var querystring=require(_0x5c48('0xa'));var Papa=require(_0x5c48('0xb'));var Redis=require('ioredis');var authService=require(_0x5c48('0xc'));var qs=require(_0x5c48('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c48('0xe'));var logger=require(_0x5c48('0xf'))(_0x5c48('0x10'));var utils=require(_0x5c48('0x11'));var config=require(_0x5c48('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c48('0x13'))['db'];var jayson=require(_0x5c48('0x14'));var client=jayson[_0x5c48('0x15')][_0x5c48('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2d45e6,_0xaca92a,_0x1a7c56,_0x2795a9){return new BPromise(function(_0x4e5996,_0x50f312){var _0x5961e4=_0x2795a9||client;return _0x5961e4['request'](_0x2d45e6,_0x1a7c56)[_0x5c48('0x17')](function(_0x36837b){logger[_0x5c48('0x18')](_0x5c48('0x19'),_0xaca92a,_0x5c48('0x1a'));logger[_0x5c48('0x1b')](_0x5c48('0x1c'),_0xaca92a,'request\x20sent',JSON[_0x5c48('0x1d')](_0x36837b));if(_0x36837b[_0x5c48('0x1e')]){if(_0x36837b[_0x5c48('0x1e')]['code']===0x1f4){logger[_0x5c48('0x1e')](_0x5c48('0x19'),_0xaca92a,_0x36837b[_0x5c48('0x1e')][_0x5c48('0x1f')]);return _0x50f312(_0x36837b[_0x5c48('0x1e')][_0x5c48('0x1f')]);}logger[_0x5c48('0x1e')](_0x5c48('0x19'),_0xaca92a,_0x36837b['error']['message']);return _0x4e5996(_0x36837b['error'][_0x5c48('0x1f')]);}else{logger[_0x5c48('0x18')](_0x5c48('0x19'),_0xaca92a,'request\x20sent');_0x4e5996(_0x36837b[_0x5c48('0x20')][_0x5c48('0x1f')]);}})[_0x5c48('0x21')](function(_0x3f6be9){logger[_0x5c48('0x1e')]('VoiceContext,\x20%s,\x20%s',_0xaca92a,_0x3f6be9);_0x50f312(_0x3f6be9);});});}function respondWithStatusCode(_0x25d97a,_0x14bf61){_0x14bf61=_0x14bf61||0xcc;return function(_0x58008b){if(_0x58008b){return _0x25d97a['sendStatus'](_0x14bf61);}return _0x25d97a[_0x5c48('0x22')](_0x14bf61)[_0x5c48('0x23')]();};}function respondWithResult(_0xf38283,_0x436a6f){_0x436a6f=_0x436a6f||0xc8;return function(_0x3a27ed){if(_0x3a27ed){return _0xf38283['status'](_0x436a6f)[_0x5c48('0x24')](_0x3a27ed);}};}function respondWithFilteredResult(_0x2ffbb3,_0x429ff3){return function(_0x8210d2){if(_0x8210d2){var _0x3d1c62=typeof _0x429ff3[_0x5c48('0x25')]==='undefined'&&typeof _0x429ff3[_0x5c48('0x26')]===_0x5c48('0x27');var _0x1591a7=_0x8210d2[_0x5c48('0x28')];var _0x21dbdd=_0x3d1c62?0x0:_0x429ff3[_0x5c48('0x25')];var _0x1c47c7=_0x3d1c62?_0x8210d2['count']:_0x429ff3[_0x5c48('0x25')]+_0x429ff3['limit'];var _0xe73e33;if(_0x1c47c7>=_0x1591a7){_0x1c47c7=_0x1591a7;_0xe73e33=0xc8;}else{_0xe73e33=0xce;}_0x2ffbb3[_0x5c48('0x22')](_0xe73e33);return _0x2ffbb3[_0x5c48('0x29')](_0x5c48('0x2a'),_0x21dbdd+'-'+_0x1c47c7+'/'+_0x1591a7)[_0x5c48('0x24')](_0x8210d2);}return null;};}function patchUpdates(_0x17548d){return function(_0x10832f){try{jsonpatch[_0x5c48('0x2b')](_0x10832f,_0x17548d,!![]);}catch(_0x36f27b){return BPromise[_0x5c48('0x2c')](_0x36f27b);}return _0x10832f[_0x5c48('0x2d')]();};}function saveUpdates(_0x9fec3c,_0x565b2a){return function(_0x28badf){if(_0x28badf){return _0x28badf['update'](_0x9fec3c)[_0x5c48('0x17')](function(_0x5277f2){return _0x5277f2;});}return null;};}function removeEntity(_0x235480,_0x52b95e){return function(_0x59003b){if(_0x59003b){return _0x59003b['destroy']()['then'](function(){var _0x5ca3a3=_0x59003b[_0x5c48('0x2e')]({'plain':!![]});var _0x211fca=_0x5c48('0x2f');return db[_0x5c48('0x30')][_0x5c48('0x31')]({'where':{'type':_0x211fca,'resourceId':_0x5ca3a3['id']}})[_0x5c48('0x17')](function(){return _0x59003b;});})[_0x5c48('0x17')](function(){_0x235480[_0x5c48('0x22')](0xcc)[_0x5c48('0x23')]();});}};}function handleEntityNotFound(_0x10950c,_0x211e36){return function(_0x290b1f){if(!_0x290b1f){_0x10950c['sendStatus'](0x194);}return _0x290b1f;};}function handleError(_0x440065,_0x1610a0){_0x1610a0=_0x1610a0||0x1f4;return function(_0x178b28){logger['error'](_0x178b28['stack']);if(_0x178b28['name']){delete _0x178b28[_0x5c48('0x32')];}_0x440065[_0x5c48('0x22')](_0x1610a0)[_0x5c48('0x33')](_0x178b28);};}exports[_0x5c48('0x34')]=function(_0xd7c88e,_0xe50fa5){var _0x541fad={},_0x526020={},_0xc5ef9d={'count':0x0,'rows':[]};var _0xab0c06=_['map'](db[_0x5c48('0x35')]['rawAttributes'],function(_0x47daca){return{'name':_0x47daca['fieldName'],'type':_0x47daca['type']['key']};});_0x526020[_0x5c48('0x36')]=_[_0x5c48('0x37')](_0xab0c06,'name');_0x526020[_0x5c48('0x38')]=_[_0x5c48('0x39')](_0xd7c88e[_0x5c48('0x38')]);_0x526020['filters']=_[_0x5c48('0x3a')](_0x526020[_0x5c48('0x36')],_0x526020[_0x5c48('0x38')]);_0x541fad[_0x5c48('0x3b')]=_['intersection'](_0x526020[_0x5c48('0x36')],qs[_0x5c48('0x3c')](_0xd7c88e[_0x5c48('0x38')][_0x5c48('0x3c')]));_0x541fad['attributes']=_0x541fad[_0x5c48('0x3b')][_0x5c48('0x3d')]?_0x541fad[_0x5c48('0x3b')]:_0x526020['model'];if(!_0xd7c88e[_0x5c48('0x38')][_0x5c48('0x3e')](_0x5c48('0x3f'))){_0x541fad[_0x5c48('0x26')]=qs[_0x5c48('0x26')](_0xd7c88e['query'][_0x5c48('0x26')]);_0x541fad[_0x5c48('0x25')]=qs[_0x5c48('0x25')](_0xd7c88e['query']['offset']);}_0x541fad[_0x5c48('0x40')]=qs['sort'](_0xd7c88e['query']['sort']);_0x541fad[_0x5c48('0x41')]=qs[_0x5c48('0x42')](_['pick'](_0xd7c88e['query'],_0x526020['filters']),_0xab0c06);if(_0xd7c88e[_0x5c48('0x38')][_0x5c48('0x43')]){_0x541fad['where']=_[_0x5c48('0x44')](_0x541fad[_0x5c48('0x41')],{'$or':_[_0x5c48('0x37')](_0xab0c06,function(_0x161914){if(_0x161914['type']!=='VIRTUAL'){var _0x1b5d49={};_0x1b5d49[_0x161914[_0x5c48('0x32')]]={'$like':'%'+_0xd7c88e['query'][_0x5c48('0x43')]+'%'};return _0x1b5d49;}})});}_0x541fad=_[_0x5c48('0x44')]({},_0x541fad,_0xd7c88e[_0x5c48('0x45')]);var _0x2a6059={'where':_0x541fad['where']};return db[_0x5c48('0x35')][_0x5c48('0x28')](_0x2a6059)[_0x5c48('0x17')](function(_0x59ef32){_0xc5ef9d[_0x5c48('0x28')]=_0x59ef32;if(_0xd7c88e['query'][_0x5c48('0x46')]){_0x541fad[_0x5c48('0x47')]=[{'all':!![]}];}return db['VoiceContext'][_0x5c48('0x48')](_0x541fad);})[_0x5c48('0x17')](function(_0x34b1aa){_0xc5ef9d['rows']=_0x34b1aa;return _0xc5ef9d;})[_0x5c48('0x17')](respondWithFilteredResult(_0xe50fa5,_0x541fad))[_0x5c48('0x21')](handleError(_0xe50fa5,null));};exports['show']=function(_0x46da36,_0x49749a){var _0x18fc54={'raw':![],'where':{'id':_0x46da36['params']['id']}},_0x368c26={};_0x368c26[_0x5c48('0x36')]=_['keys'](db['VoiceContext'][_0x5c48('0x49')]);_0x368c26[_0x5c48('0x38')]=_[_0x5c48('0x39')](_0x46da36[_0x5c48('0x38')]);_0x368c26[_0x5c48('0x42')]=_[_0x5c48('0x3a')](_0x368c26[_0x5c48('0x36')],_0x368c26[_0x5c48('0x38')]);_0x18fc54['attributes']=_['intersection'](_0x368c26[_0x5c48('0x36')],qs[_0x5c48('0x3c')](_0x46da36[_0x5c48('0x38')][_0x5c48('0x3c')]));_0x18fc54['attributes']=_0x18fc54['attributes'][_0x5c48('0x3d')]?_0x18fc54['attributes']:_0x368c26[_0x5c48('0x36')];if(_0x46da36[_0x5c48('0x38')][_0x5c48('0x46')]){_0x18fc54[_0x5c48('0x47')]=[{'all':!![]}];}_0x18fc54=_[_0x5c48('0x44')]({},_0x18fc54,_0x46da36[_0x5c48('0x45')]);return db['VoiceContext'][_0x5c48('0x4a')](_0x18fc54)[_0x5c48('0x17')](handleEntityNotFound(_0x49749a,null))[_0x5c48('0x17')](respondWithResult(_0x49749a,null))['catch'](handleError(_0x49749a,null));};exports[_0x5c48('0x4b')]=function(_0x55ca00,_0x26f15d,_0x28182f){var _0xc5452b;return db['VoiceContext'][_0x5c48('0x4b')](_0x55ca00[_0x5c48('0x4c')],{'raw':!![]})[_0x5c48('0x17')](function(_0x116d4b){_0xc5452b=_0x116d4b;return db[_0x5c48('0x35')][_0x5c48('0x48')]({'raw':!![]});})['then'](function(_0x5d780b){var _0x4edf6c=fs[_0x5c48('0x4d')](path['join'](config[_0x5c48('0x4e')],_0x5c48('0x4f')),_0x5c48('0x50'));var _0x370c8a=ejs[_0x5c48('0x51')](_0x4edf6c,{'contexts':_0x5d780b||[]});fs[_0x5c48('0x52')](_0x5c48('0x53'),_0x370c8a);})[_0x5c48('0x17')](function(){return respondWithRpcPromise(_0x5c48('0x54'),_0x5c48('0x4b'),{'module':_0x5c48('0x55')});})[_0x5c48('0x17')](function(){var _0x17b4f1=_0x55ca00[_0x5c48('0x56')]['get']({'plain':!![]});if(!_0x17b4f1)throw new Error(_0x5c48('0x57'));if(_0x17b4f1[_0x5c48('0x58')]==='user'){var _0x55231b=_0xc5452b[_0x5c48('0x2e')]({'plain':!![]});return db['UserProfileSection'][_0x5c48('0x4a')]({'where':{'name':_0x5c48('0x2f'),'userProfileId':_0x17b4f1[_0x5c48('0x59')]},'raw':!![]})['then'](function(_0x5f1663){if(_0x5f1663&&_0x5f1663[_0x5c48('0x5a')]===0x0){return db[_0x5c48('0x30')][_0x5c48('0x4b')]({'name':_0x55231b[_0x5c48('0x32')],'resourceId':_0x55231b['id'],'type':_0x5f1663['name'],'sectionId':_0x5f1663['id']},{})[_0x5c48('0x17')](function(){return _0xc5452b;});}else{return _0xc5452b;}})[_0x5c48('0x21')](function(_0x2121d5){logger[_0x5c48('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2121d5);throw _0x2121d5;});}return _0xc5452b;})[_0x5c48('0x17')](respondWithResult(_0x26f15d,0xc9))[_0x5c48('0x21')](handleError(_0x26f15d,null));};exports[_0x5c48('0x5b')]=function(_0x620a51,_0xcbdfcf,_0x1f8271){var _0x4d3fbc;return db[_0x5c48('0x35')]['find']({'where':{'id':_0x620a51[_0x5c48('0x5c')]['id']}})['then'](handleEntityNotFound(_0xcbdfcf,null))[_0x5c48('0x17')](saveUpdates(_0x620a51[_0x5c48('0x4c')],null))[_0x5c48('0x17')](function(_0x4dad3e){if(_0x4dad3e){_0x4d3fbc=_0x4dad3e;return db[_0x5c48('0x35')]['findAll']({'raw':!![]});}})[_0x5c48('0x17')](function(_0x180de6){var _0x2d5035=fs[_0x5c48('0x4d')](path['join'](config[_0x5c48('0x4e')],_0x5c48('0x4f')),_0x5c48('0x50'));var _0x48ee9c=ejs[_0x5c48('0x51')](_0x2d5035,{'contexts':_0x180de6||[]});fs[_0x5c48('0x52')](_0x5c48('0x53'),_0x48ee9c);})[_0x5c48('0x17')](function(){return respondWithRpcPromise(_0x5c48('0x54'),_0x5c48('0x5b'),{'module':'chan_sip.so'});})['then'](function(){return _0x4d3fbc;})[_0x5c48('0x17')](respondWithResult(_0xcbdfcf,null))['catch'](handleError(_0xcbdfcf,null));};exports[_0x5c48('0x31')]=function(_0x3a9fd6,_0xc4128d,_0x21fd19){var _0x1a2cb6;return db[_0x5c48('0x35')][_0x5c48('0x4a')]({'where':{'id':_0x3a9fd6['params']['id']}})[_0x5c48('0x17')](handleEntityNotFound(_0xc4128d,null))[_0x5c48('0x17')](removeEntity(_0xc4128d,null))[_0x5c48('0x17')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x5c48('0x17')](function(_0x30c5c9){var _0x9c122f=fs[_0x5c48('0x4d')](path['join'](config[_0x5c48('0x4e')],_0x5c48('0x4f')),_0x5c48('0x50'));var _0x8b3a0c=ejs[_0x5c48('0x51')](_0x9c122f,{'contexts':_0x30c5c9});fs['writeFileSync'](_0x5c48('0x53'),_0x8b3a0c);return respondWithRpcPromise(_0x5c48('0x54'),_0x5c48('0x31'),{'module':'chan_sip.so'});})[_0x5c48('0x21')](handleError(_0xc4128d,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index aaeaa0d..b2ef0a5 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 _0x4293=['../../config/environment','exports','define','voice_contexts','lodash','util','api','bluebird','rimraf'];(function(_0x3a370d,_0x580c3a){var _0xa3277e=function(_0x310ae0){while(--_0x310ae0){_0x3a370d['push'](_0x3a370d['shift']());}};_0xa3277e(++_0x580c3a);}(_0x4293,0x163));var _0x3429=function(_0x566927,_0x37342a){_0x566927=_0x566927-0x0;var _0x40942f=_0x4293[_0x566927];return _0x40942f;};'use strict';var _=require(_0x3429('0x0'));var util=require(_0x3429('0x1'));var logger=require('../../config/logger')(_0x3429('0x2'));var moment=require('moment');var BPromise=require(_0x3429('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3429('0x4'));var config=require(_0x3429('0x5'));var attributes=require('./voiceContext.attributes');module[_0x3429('0x6')]=function(_0x439e14,_0x432c4f){return _0x439e14[_0x3429('0x7')]('VoiceContext',attributes,{'tableName':_0x3429('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ba3=['request-promise','path','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','bluebird'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x5ba3,0x140));var _0x35ba=function(_0x26292b,_0x3e5aa1){_0x26292b=_0x26292b-0x0;var _0x26d1b3=_0x5ba3[_0x26292b];return _0x26d1b3;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var logger=require(_0x35ba('0x1'))(_0x35ba('0x2'));var moment=require('moment');var BPromise=require(_0x35ba('0x3'));var rp=require(_0x35ba('0x4'));var fs=require('fs');var path=require(_0x35ba('0x5'));var rimraf=require('rimraf');var config=require(_0x35ba('0x6'));var attributes=require(_0x35ba('0x7'));module[_0x35ba('0x8')]=function(_0x596785,_0x54c722){return _0x596785[_0x35ba('0x9')](_0x35ba('0xa'),attributes,{'tableName':_0x35ba('0xb'),'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 849ade1..2ce036c 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 _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd05a,0x143));var _0xad05=function(_0x3fc4e2,_0x1f9339){_0x3fc4e2=_0x3fc4e2-0x0;var _0x245ffb=_0xd05a[_0x3fc4e2];return _0x245ffb;};'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')]('VoiceContext,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('VoiceContext,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('VoiceContext,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});} \ No newline at end of file +var _0x4f7b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x8ec332,_0x49e459){var _0x4b2bb1=function(_0x81a267){while(--_0x81a267){_0x8ec332['push'](_0x8ec332['shift']());}};_0x4b2bb1(++_0x49e459);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x4f032e,_0x15b76b){_0x4f032e=_0x4f032e-0x0;var _0x4fdb31=_0x4f7b[_0x4f032e];return _0x4fdb31;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6c7f763..ad3c7a2 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 _0x51ba=['delete','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x5979b5,_0x1878ed){var _0x5ce70a=function(_0x377e72){while(--_0x377e72){_0x5979b5['push'](_0x5979b5['shift']());}};_0x5ce70a(++_0x1878ed);}(_0x51ba,0x169));var _0xa51b=function(_0x14f3b5,_0x3ec624){_0x14f3b5=_0x14f3b5-0x0;var _0x3edcf2=_0x51ba[_0x14f3b5];return _0x3edcf2;};'use strict';var multer=require('multer');var util=require(_0xa51b('0x0'));var path=require(_0xa51b('0x1'));var timeout=require(_0xa51b('0x2'));var express=require(_0xa51b('0x3'));var router=express[_0xa51b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa51b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0xa51b('0x6')]('/',auth[_0xa51b('0x7')](),controller[_0xa51b('0x8')]);router[_0xa51b('0x6')]('/describe',auth[_0xa51b('0x7')](),controller['describe']);router['get'](_0xa51b('0x9'),auth[_0xa51b('0x7')](),controller[_0xa51b('0xa')]);router[_0xa51b('0xb')]('/',auth[_0xa51b('0x7')](),controller['create']);router[_0xa51b('0xc')](_0xa51b('0x9'),auth['isAuthenticated'](),controller[_0xa51b('0xd')]);router[_0xa51b('0xe')](_0xa51b('0x9'),auth[_0xa51b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe6b9=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe6b9,0x1cd));var _0x9e6b=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0xe6b9[_0x837dad];return _0x1d62d3;};'use strict';var multer=require(_0x9e6b('0x0'));var util=require(_0x9e6b('0x1'));var path=require(_0x9e6b('0x2'));var timeout=require(_0x9e6b('0x3'));var express=require('express');var router=express[_0x9e6b('0x4')]();var fs_extra=require(_0x9e6b('0x5'));var auth=require(_0x9e6b('0x6'));var interaction=require(_0x9e6b('0x7'));var config=require(_0x9e6b('0x8'));var controller=require(_0x9e6b('0x9'));router[_0x9e6b('0xa')]('/',auth[_0x9e6b('0xb')](),controller[_0x9e6b('0xc')]);router[_0x9e6b('0xa')](_0x9e6b('0xd'),auth[_0x9e6b('0xb')](),controller['describe']);router[_0x9e6b('0xa')]('/:id',auth[_0x9e6b('0xb')](),controller[_0x9e6b('0xe')]);router[_0x9e6b('0xf')]('/',auth[_0x9e6b('0xb')](),controller[_0x9e6b('0x10')]);router[_0x9e6b('0x11')](_0x9e6b('0x12'),auth[_0x9e6b('0xb')](),controller[_0x9e6b('0x13')]);router[_0x9e6b('0x14')](_0x9e6b('0x12'),auth[_0x9e6b('0xb')](),controller[_0x9e6b('0x15')]);module[_0x9e6b('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 3ccd9d8..4331a5f 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 _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x36bdad,_0x4240e4){var _0x434f2b=function(_0x989a50){while(--_0x989a50){_0x36bdad['push'](_0x36bdad['shift']());}};_0x434f2b(++_0x4240e4);}(_0x9bde,0xe1));var _0xe9bd=function(_0x93f145,_0x2ad475){_0x93f145=_0x93f145-0x0;var _0x5e68ad=_0x9bde[_0x93f145];return _0x5e68ad;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1d91ae,_0xd48858){var _0x534016=function(_0x249c1e){while(--_0x249c1e){_0x1d91ae['push'](_0x1d91ae['shift']());}};_0x534016(++_0xd48858);}(_0x98a8,0x12c));var _0x898a=function(_0x273904,_0x40a8c7){_0x273904=_0x273904-0x0;var _0x5f2d68=_0x98a8[_0x273904];return _0x5f2d68;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 9e11cf5..514efc3 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 _0x7fa3=['../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show','params','VoiceDialReport','rawAttributes','intersection','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3668b6,_0x1c256f){var _0x393060=function(_0x30d39e){while(--_0x30d39e){_0x3668b6['push'](_0x3668b6['shift']());}};_0x393060(++_0x1c256f);}(_0x7fa3,0x165));var _0x37fa=function(_0x2dadad,_0x174057){_0x2dadad=_0x2dadad-0x0;var _0x5c67a0=_0x7fa3[_0x2dadad];return _0x5c67a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37fa('0x0'));var zipdir=require(_0x37fa('0x1'));var jsonpatch=require(_0x37fa('0x2'));var rp=require(_0x37fa('0x3'));var moment=require(_0x37fa('0x4'));var BPromise=require(_0x37fa('0x5'));var Mustache=require(_0x37fa('0x6'));var util=require('util');var path=require(_0x37fa('0x7'));var sox=require('sox');var csv=require(_0x37fa('0x8'));var ejs=require(_0x37fa('0x9'));var fs=require('fs');var fs_extra=require(_0x37fa('0xa'));var _=require(_0x37fa('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x37fa('0xc'));var deskjs=require(_0x37fa('0xd'));var toCsv=require(_0x37fa('0x8'));var querystring=require(_0x37fa('0xe'));var Papa=require(_0x37fa('0xf'));var Redis=require('ioredis');var authService=require(_0x37fa('0x10'));var qs=require(_0x37fa('0x11'));var as=require(_0x37fa('0x12'));var hardwareService=require(_0x37fa('0x13'));var logger=require(_0x37fa('0x14'))('api');var utils=require(_0x37fa('0x15'));var config=require(_0x37fa('0x16'));var licenseUtil=require(_0x37fa('0x17'));var db=require(_0x37fa('0x18'))['db'];function respondWithStatusCode(_0x5dd034,_0x3d76f4){_0x3d76f4=_0x3d76f4||0xcc;return function(_0x4c34c8){if(_0x4c34c8){return _0x5dd034['sendStatus'](_0x3d76f4);}return _0x5dd034[_0x37fa('0x19')](_0x3d76f4)['end']();};}function respondWithResult(_0x30c4de,_0x408228){_0x408228=_0x408228||0xc8;return function(_0x5b0de6){if(_0x5b0de6){return _0x30c4de[_0x37fa('0x19')](_0x408228)[_0x37fa('0x1a')](_0x5b0de6);}};}function respondWithFilteredResult(_0x161af8,_0x4e991f){return function(_0x2ff94d){if(_0x2ff94d){var _0x999843=typeof _0x4e991f[_0x37fa('0x1b')]===_0x37fa('0x1c')&&typeof _0x4e991f['limit']===_0x37fa('0x1c');var _0x202e15=_0x2ff94d[_0x37fa('0x1d')];var _0xd4da7f=_0x999843?0x0:_0x4e991f[_0x37fa('0x1b')];var _0x52e1cc=_0x999843?_0x2ff94d['count']:_0x4e991f[_0x37fa('0x1b')]+_0x4e991f[_0x37fa('0x1e')];var _0x2c1362;if(_0x52e1cc>=_0x202e15){_0x52e1cc=_0x202e15;_0x2c1362=0xc8;}else{_0x2c1362=0xce;}_0x161af8[_0x37fa('0x19')](_0x2c1362);return _0x161af8[_0x37fa('0x1f')](_0x37fa('0x20'),_0xd4da7f+'-'+_0x52e1cc+'/'+_0x202e15)[_0x37fa('0x1a')](_0x2ff94d);}return null;};}function patchUpdates(_0x62644f){return function(_0xfc5555){try{jsonpatch[_0x37fa('0x21')](_0xfc5555,_0x62644f,!![]);}catch(_0x3d04c6){return BPromise[_0x37fa('0x22')](_0x3d04c6);}return _0xfc5555[_0x37fa('0x23')]();};}function saveUpdates(_0x1d6c30,_0x5b2f83){return function(_0x41e6c4){if(_0x41e6c4){return _0x41e6c4[_0x37fa('0x24')](_0x1d6c30)[_0x37fa('0x25')](function(_0x3a59d2){return _0x3a59d2;});}return null;};}function removeEntity(_0x5cbcf7,_0x6ee43c){return function(_0x40825d){if(_0x40825d){return _0x40825d[_0x37fa('0x26')]()[_0x37fa('0x25')](function(){_0x5cbcf7[_0x37fa('0x19')](0xcc)[_0x37fa('0x27')]();});}};}function handleEntityNotFound(_0x4fc3b0,_0x1b0ebe){return function(_0x72db8d){if(!_0x72db8d){_0x4fc3b0[_0x37fa('0x28')](0x194);}return _0x72db8d;};}function handleError(_0x55a9c8,_0x3223fe){_0x3223fe=_0x3223fe||0x1f4;return function(_0x2eef86){logger[_0x37fa('0x29')](_0x2eef86[_0x37fa('0x2a')]);if(_0x2eef86[_0x37fa('0x2b')]){delete _0x2eef86[_0x37fa('0x2b')];}_0x55a9c8[_0x37fa('0x19')](_0x3223fe)['send'](_0x2eef86);};}exports[_0x37fa('0x2c')]=function(_0x4b3543,_0x500b34){var _0x4bc36f={},_0x4bb0c1={},_0x3592f5={'count':0x0,'rows':[]};var _0x5b6d05=_[_0x37fa('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0xffcedf){return{'name':_0xffcedf[_0x37fa('0x2e')],'type':_0xffcedf[_0x37fa('0x2f')]['key']};});_0x4bb0c1[_0x37fa('0x30')]=_[_0x37fa('0x2d')](_0x5b6d05,_0x37fa('0x2b'));_0x4bb0c1[_0x37fa('0x31')]=_[_0x37fa('0x32')](_0x4b3543[_0x37fa('0x31')]);_0x4bb0c1[_0x37fa('0x33')]=_['intersection'](_0x4bb0c1[_0x37fa('0x30')],_0x4bb0c1[_0x37fa('0x31')]);_0x4bc36f[_0x37fa('0x34')]=_['intersection'](_0x4bb0c1[_0x37fa('0x30')],qs[_0x37fa('0x35')](_0x4b3543[_0x37fa('0x31')]['fields']));_0x4bc36f[_0x37fa('0x34')]=_0x4bc36f[_0x37fa('0x34')][_0x37fa('0x36')]?_0x4bc36f['attributes']:_0x4bb0c1[_0x37fa('0x30')];if(!_0x4b3543[_0x37fa('0x31')][_0x37fa('0x37')](_0x37fa('0x38'))){_0x4bc36f['limit']=qs[_0x37fa('0x1e')](_0x4b3543[_0x37fa('0x31')][_0x37fa('0x1e')]);_0x4bc36f[_0x37fa('0x1b')]=qs[_0x37fa('0x1b')](_0x4b3543['query']['offset']);}_0x4bc36f[_0x37fa('0x39')]=qs[_0x37fa('0x3a')](_0x4b3543[_0x37fa('0x31')][_0x37fa('0x3a')]);_0x4bc36f[_0x37fa('0x3b')]=qs['filters'](_[_0x37fa('0x3c')](_0x4b3543[_0x37fa('0x31')],_0x4bb0c1[_0x37fa('0x33')]),_0x5b6d05);if(_0x4b3543[_0x37fa('0x31')][_0x37fa('0x3d')]){_0x4bc36f['where']=_['merge'](_0x4bc36f[_0x37fa('0x3b')],{'$or':_['map'](_0x5b6d05,function(_0x2fea29){if(_0x2fea29['type']!=='VIRTUAL'){var _0x39b558={};_0x39b558[_0x2fea29[_0x37fa('0x2b')]]={'$like':'%'+_0x4b3543['query'][_0x37fa('0x3d')]+'%'};return _0x39b558;}})});}_0x4bc36f=_[_0x37fa('0x3e')]({},_0x4bc36f,_0x4b3543[_0x37fa('0x3f')]);var _0x1aae65={'where':_0x4bc36f[_0x37fa('0x3b')]};return db['VoiceDialReport'][_0x37fa('0x1d')](_0x1aae65)['then'](function(_0x508076){_0x3592f5[_0x37fa('0x1d')]=_0x508076;if(_0x4b3543[_0x37fa('0x31')]['includeAll']){_0x4bc36f[_0x37fa('0x40')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x37fa('0x41')](_0x4bc36f);})[_0x37fa('0x25')](function(_0x1cc5ba){_0x3592f5['rows']=_0x1cc5ba;return _0x3592f5;})[_0x37fa('0x25')](respondWithFilteredResult(_0x500b34,_0x4bc36f))['catch'](handleError(_0x500b34,null));};exports[_0x37fa('0x42')]=function(_0x323ae7,_0xbd1bfa){var _0x279611={'raw':!![],'where':{'id':_0x323ae7[_0x37fa('0x43')]['id']}},_0x2ffc69={};_0x2ffc69[_0x37fa('0x30')]=_[_0x37fa('0x32')](db[_0x37fa('0x44')][_0x37fa('0x45')]);_0x2ffc69[_0x37fa('0x31')]=_[_0x37fa('0x32')](_0x323ae7[_0x37fa('0x31')]);_0x2ffc69[_0x37fa('0x33')]=_[_0x37fa('0x46')](_0x2ffc69[_0x37fa('0x30')],_0x2ffc69[_0x37fa('0x31')]);_0x279611[_0x37fa('0x34')]=_['intersection'](_0x2ffc69['model'],qs[_0x37fa('0x35')](_0x323ae7[_0x37fa('0x31')][_0x37fa('0x35')]));_0x279611[_0x37fa('0x34')]=_0x279611[_0x37fa('0x34')][_0x37fa('0x36')]?_0x279611['attributes']:_0x2ffc69[_0x37fa('0x30')];if(_0x323ae7['query']['includeAll']){_0x279611[_0x37fa('0x40')]=[{'all':!![]}];}_0x279611=_[_0x37fa('0x3e')]({},_0x279611,_0x323ae7[_0x37fa('0x3f')]);return db[_0x37fa('0x44')][_0x37fa('0x47')](_0x279611)[_0x37fa('0x25')](handleEntityNotFound(_0xbd1bfa,null))[_0x37fa('0x25')](respondWithResult(_0xbd1bfa,null))[_0x37fa('0x48')](handleError(_0xbd1bfa,null));};exports[_0x37fa('0x49')]=function(_0x3b9127,_0x185423){return db[_0x37fa('0x44')]['create'](_0x3b9127[_0x37fa('0x4a')],{})['then'](respondWithResult(_0x185423,0xc9))[_0x37fa('0x48')](handleError(_0x185423,null));};exports[_0x37fa('0x24')]=function(_0x5ac1d4,_0x5454c8){if(_0x5ac1d4[_0x37fa('0x4a')]['id']){delete _0x5ac1d4['body']['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x5ac1d4['params']['id']}})[_0x37fa('0x25')](handleEntityNotFound(_0x5454c8,null))[_0x37fa('0x25')](saveUpdates(_0x5ac1d4[_0x37fa('0x4a')],null))[_0x37fa('0x25')](respondWithResult(_0x5454c8,null))['catch'](handleError(_0x5454c8,null));};exports[_0x37fa('0x26')]=function(_0x8cb34b,_0x5c616e){return db[_0x37fa('0x44')][_0x37fa('0x47')]({'where':{'id':_0x8cb34b[_0x37fa('0x43')]['id']}})[_0x37fa('0x25')](handleEntityNotFound(_0x5c616e,null))[_0x37fa('0x25')](removeEntity(_0x5c616e,null))[_0x37fa('0x48')](handleError(_0x5c616e,null));};exports[_0x37fa('0x4b')]=function(_0x558803,_0x45f4d8){return db[_0x37fa('0x44')][_0x37fa('0x4b')]()[_0x37fa('0x25')](respondWithResult(_0x45f4d8,null))[_0x37fa('0x48')](handleError(_0x45f4d8,null));}; \ No newline at end of file +var _0x1889=['rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','then','error','stack','send','index','map','VoiceDialReport','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','name','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','create','update','body','find','destroy','describe','eml-format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1889,0x176));var _0x9188=function(_0xbaab91,_0x5bad90){_0xbaab91=_0xbaab91-0x0;var _0x509352=_0x1889[_0xbaab91];return _0x509352;};'use strict';var emlformat=require(_0x9188('0x0'));var rimraf=require(_0x9188('0x1'));var zipdir=require(_0x9188('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9188('0x3'));var Mustache=require(_0x9188('0x4'));var util=require(_0x9188('0x5'));var path=require(_0x9188('0x6'));var sox=require('sox');var csv=require(_0x9188('0x7'));var ejs=require(_0x9188('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9188('0x9'));var squel=require(_0x9188('0xa'));var crypto=require(_0x9188('0xb'));var jsforce=require(_0x9188('0xc'));var deskjs=require(_0x9188('0xd'));var toCsv=require(_0x9188('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9188('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9188('0xf'));var as=require(_0x9188('0x10'));var hardwareService=require(_0x9188('0x11'));var logger=require(_0x9188('0x12'))('api');var utils=require(_0x9188('0x13'));var config=require(_0x9188('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9188('0x15'))['db'];function respondWithStatusCode(_0x4d266b,_0x415999){_0x415999=_0x415999||0xcc;return function(_0xfc5ed2){if(_0xfc5ed2){return _0x4d266b[_0x9188('0x16')](_0x415999);}return _0x4d266b['status'](_0x415999)[_0x9188('0x17')]();};}function respondWithResult(_0x2bd0b6,_0x36ee43){_0x36ee43=_0x36ee43||0xc8;return function(_0x513f84){if(_0x513f84){return _0x2bd0b6['status'](_0x36ee43)[_0x9188('0x18')](_0x513f84);}};}function respondWithFilteredResult(_0x5d1ce8,_0x727706){return function(_0x418bf9){if(_0x418bf9){var _0x56193e=typeof _0x727706[_0x9188('0x19')]===_0x9188('0x1a')&&typeof _0x727706['limit']==='undefined';var _0x4ba2b5=_0x418bf9[_0x9188('0x1b')];var _0x3066ae=_0x56193e?0x0:_0x727706['offset'];var _0x24fb3d=_0x56193e?_0x418bf9[_0x9188('0x1b')]:_0x727706[_0x9188('0x19')]+_0x727706['limit'];var _0x113389;if(_0x24fb3d>=_0x4ba2b5){_0x24fb3d=_0x4ba2b5;_0x113389=0xc8;}else{_0x113389=0xce;}_0x5d1ce8[_0x9188('0x1c')](_0x113389);return _0x5d1ce8[_0x9188('0x1d')](_0x9188('0x1e'),_0x3066ae+'-'+_0x24fb3d+'/'+_0x4ba2b5)['json'](_0x418bf9);}return null;};}function patchUpdates(_0xfb1b28){return function(_0x286e7a){try{jsonpatch[_0x9188('0x1f')](_0x286e7a,_0xfb1b28,!![]);}catch(_0x3607c7){return BPromise[_0x9188('0x20')](_0x3607c7);}return _0x286e7a[_0x9188('0x21')]();};}function saveUpdates(_0x25c2f9,_0x1d7d10){return function(_0x57e4c1){if(_0x57e4c1){return _0x57e4c1['update'](_0x25c2f9)['then'](function(_0x171da4){return _0x171da4;});}return null;};}function removeEntity(_0xd35a14,_0x29908f){return function(_0x3611f7){if(_0x3611f7){return _0x3611f7['destroy']()[_0x9188('0x22')](function(){_0xd35a14[_0x9188('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc7a0,_0x31ab1d){return function(_0x120526){if(!_0x120526){_0x2dc7a0['sendStatus'](0x194);}return _0x120526;};}function handleError(_0x1c68b7,_0x4ca2b1){_0x4ca2b1=_0x4ca2b1||0x1f4;return function(_0x51e461){logger[_0x9188('0x23')](_0x51e461[_0x9188('0x24')]);if(_0x51e461['name']){delete _0x51e461['name'];}_0x1c68b7['status'](_0x4ca2b1)[_0x9188('0x25')](_0x51e461);};}exports[_0x9188('0x26')]=function(_0x3df803,_0x591a7b){var _0x175a0d={},_0x242a76={},_0x254ebc={'count':0x0,'rows':[]};var _0x3fc43c=_[_0x9188('0x27')](db[_0x9188('0x28')]['rawAttributes'],function(_0x5d830e){return{'name':_0x5d830e[_0x9188('0x29')],'type':_0x5d830e[_0x9188('0x2a')][_0x9188('0x2b')]};});_0x242a76['model']=_[_0x9188('0x27')](_0x3fc43c,'name');_0x242a76[_0x9188('0x2c')]=_['keys'](_0x3df803['query']);_0x242a76[_0x9188('0x2d')]=_[_0x9188('0x2e')](_0x242a76['model'],_0x242a76['query']);_0x175a0d[_0x9188('0x2f')]=_[_0x9188('0x2e')](_0x242a76[_0x9188('0x30')],qs[_0x9188('0x31')](_0x3df803[_0x9188('0x2c')][_0x9188('0x31')]));_0x175a0d[_0x9188('0x2f')]=_0x175a0d[_0x9188('0x2f')][_0x9188('0x32')]?_0x175a0d[_0x9188('0x2f')]:_0x242a76[_0x9188('0x30')];if(!_0x3df803[_0x9188('0x2c')]['hasOwnProperty'](_0x9188('0x33'))){_0x175a0d[_0x9188('0x34')]=qs[_0x9188('0x34')](_0x3df803[_0x9188('0x2c')]['limit']);_0x175a0d['offset']=qs[_0x9188('0x19')](_0x3df803[_0x9188('0x2c')][_0x9188('0x19')]);}_0x175a0d[_0x9188('0x35')]=qs[_0x9188('0x36')](_0x3df803[_0x9188('0x2c')][_0x9188('0x36')]);_0x175a0d[_0x9188('0x37')]=qs[_0x9188('0x2d')](_[_0x9188('0x38')](_0x3df803[_0x9188('0x2c')],_0x242a76['filters']),_0x3fc43c);if(_0x3df803[_0x9188('0x2c')][_0x9188('0x39')]){_0x175a0d[_0x9188('0x37')]=_[_0x9188('0x3a')](_0x175a0d[_0x9188('0x37')],{'$or':_[_0x9188('0x27')](_0x3fc43c,function(_0x12626e){if(_0x12626e[_0x9188('0x2a')]!=='VIRTUAL'){var _0x5ad3dd={};_0x5ad3dd[_0x12626e[_0x9188('0x3b')]]={'$like':'%'+_0x3df803[_0x9188('0x2c')][_0x9188('0x39')]+'%'};return _0x5ad3dd;}})});}_0x175a0d=_[_0x9188('0x3a')]({},_0x175a0d,_0x3df803[_0x9188('0x3c')]);var _0xf5f16d={'where':_0x175a0d[_0x9188('0x37')]};return db['VoiceDialReport'][_0x9188('0x1b')](_0xf5f16d)[_0x9188('0x22')](function(_0x1f9932){_0x254ebc['count']=_0x1f9932;if(_0x3df803['query']['includeAll']){_0x175a0d[_0x9188('0x3d')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x175a0d);})[_0x9188('0x22')](function(_0x2f5287){_0x254ebc[_0x9188('0x3e')]=_0x2f5287;return _0x254ebc;})[_0x9188('0x22')](respondWithFilteredResult(_0x591a7b,_0x175a0d))[_0x9188('0x3f')](handleError(_0x591a7b,null));};exports[_0x9188('0x40')]=function(_0x4a1629,_0x4e2a3c){var _0x5e91d4={'raw':!![],'where':{'id':_0x4a1629[_0x9188('0x41')]['id']}},_0x53841f={};_0x53841f['model']=_[_0x9188('0x42')](db[_0x9188('0x28')][_0x9188('0x43')]);_0x53841f[_0x9188('0x2c')]=_[_0x9188('0x42')](_0x4a1629['query']);_0x53841f['filters']=_[_0x9188('0x2e')](_0x53841f['model'],_0x53841f[_0x9188('0x2c')]);_0x5e91d4[_0x9188('0x2f')]=_['intersection'](_0x53841f['model'],qs[_0x9188('0x31')](_0x4a1629['query']['fields']));_0x5e91d4[_0x9188('0x2f')]=_0x5e91d4[_0x9188('0x2f')]['length']?_0x5e91d4[_0x9188('0x2f')]:_0x53841f[_0x9188('0x30')];if(_0x4a1629[_0x9188('0x2c')][_0x9188('0x44')]){_0x5e91d4[_0x9188('0x3d')]=[{'all':!![]}];}_0x5e91d4=_[_0x9188('0x3a')]({},_0x5e91d4,_0x4a1629['options']);return db['VoiceDialReport']['find'](_0x5e91d4)[_0x9188('0x22')](handleEntityNotFound(_0x4e2a3c,null))[_0x9188('0x22')](respondWithResult(_0x4e2a3c,null))[_0x9188('0x3f')](handleError(_0x4e2a3c,null));};exports[_0x9188('0x45')]=function(_0xd71701,_0x332438){return db[_0x9188('0x28')]['create'](_0xd71701['body'],{})[_0x9188('0x22')](respondWithResult(_0x332438,0xc9))[_0x9188('0x3f')](handleError(_0x332438,null));};exports[_0x9188('0x46')]=function(_0x48227f,_0x19b9ee){if(_0x48227f['body']['id']){delete _0x48227f[_0x9188('0x47')]['id'];}return db[_0x9188('0x28')][_0x9188('0x48')]({'where':{'id':_0x48227f[_0x9188('0x41')]['id']}})['then'](handleEntityNotFound(_0x19b9ee,null))['then'](saveUpdates(_0x48227f['body'],null))['then'](respondWithResult(_0x19b9ee,null))['catch'](handleError(_0x19b9ee,null));};exports[_0x9188('0x49')]=function(_0x133435,_0x5ef54c){return db[_0x9188('0x28')][_0x9188('0x48')]({'where':{'id':_0x133435[_0x9188('0x41')]['id']}})[_0x9188('0x22')](handleEntityNotFound(_0x5ef54c,null))[_0x9188('0x22')](removeEntity(_0x5ef54c,null))[_0x9188('0x3f')](handleError(_0x5ef54c,null));};exports['describe']=function(_0x3718e4,_0x1a2cde){return db[_0x9188('0x28')][_0x9188('0x4a')]()[_0x9188('0x22')](respondWithResult(_0x1a2cde,null))['catch'](handleError(_0x1a2cde,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index b235477..9fa5936 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 _0x7429=['uniqueid','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7429,0x6f));var _0x9742=function(_0x214303,_0x19ffa4){_0x214303=_0x214303-0x0;var _0x459890=_0x7429[_0x214303];return _0x459890;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9742('0x0'))('api');var moment=require(_0x9742('0x1'));var BPromise=require(_0x9742('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9742('0x3'));var rimraf=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var attributes=require(_0x9742('0x6'));module[_0x9742('0x7')]=function(_0x5a1528,_0x5a7ef9){return _0x5a1528[_0x9742('0x8')](_0x9742('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x9742('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8832=['./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8832,0x1f4));var _0x2883=function(_0x15ade3,_0x56f5d3){_0x15ade3=_0x15ade3-0x0;var _0x2999aa=_0x8832[_0x15ade3];return _0x2999aa;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rp=require(_0x2883('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2883('0x5'));var config=require('../../config/environment');var attributes=require(_0x2883('0x6'));module[_0x2883('0x7')]=function(_0x278026,_0x556903){return _0x278026[_0x2883('0x8')]('VoiceDialReport',attributes,{'tableName':_0x2883('0x9'),'paranoid':![],'indexes':[{'fields':[_0x2883('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index aa8ea8b..6e5b179 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 _0xde29=['then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request'];(function(_0x542182,_0x3fe28a){var _0x474122=function(_0x2442ef){while(--_0x2442ef){_0x542182['push'](_0x542182['shift']());}};_0x474122(++_0x3fe28a);}(_0xde29,0x155));var _0x9de2=function(_0x110182,_0x399dac){_0x110182=_0x110182-0x0;var _0x12704c=_0xde29[_0x110182];return _0x12704c;};'use strict';var _=require(_0x9de2('0x0'));var util=require(_0x9de2('0x1'));var moment=require(_0x9de2('0x2'));var BPromise=require(_0x9de2('0x3'));var rs=require(_0x9de2('0x4'));var fs=require('fs');var Redis=require(_0x9de2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9de2('0x6'));var logger=require(_0x9de2('0x7'))('rpc');var config=require(_0x9de2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9de2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x343692,_0x29fdb7,_0xa6afc1){return new BPromise(function(_0x4cc5ac,_0x3dc5ea){return client[_0x9de2('0xa')](_0x343692,_0xa6afc1)[_0x9de2('0xb')](function(_0x5de4b4){logger[_0x9de2('0xc')](_0x9de2('0xd'),_0x29fdb7,_0x9de2('0xe'));logger[_0x9de2('0xf')](_0x9de2('0x10'),_0x29fdb7,_0x9de2('0xe'),JSON['stringify'](_0x5de4b4));if(_0x5de4b4[_0x9de2('0x11')]){if(_0x5de4b4['error'][_0x9de2('0x12')]===0x1f4){logger[_0x9de2('0x11')](_0x9de2('0xd'),_0x29fdb7,_0x5de4b4[_0x9de2('0x11')]['message']);return _0x3dc5ea(_0x5de4b4[_0x9de2('0x11')][_0x9de2('0x13')]);}logger['error'](_0x9de2('0xd'),_0x29fdb7,_0x5de4b4[_0x9de2('0x11')]['message']);return _0x4cc5ac(_0x5de4b4['error'][_0x9de2('0x13')]);}else{logger[_0x9de2('0xc')](_0x9de2('0xd'),_0x29fdb7,_0x9de2('0xe'));_0x4cc5ac(_0x5de4b4['result'][_0x9de2('0x13')]);}})[_0x9de2('0x14')](function(_0x59b215){logger[_0x9de2('0x11')](_0x9de2('0xd'),_0x29fdb7,_0x59b215);_0x3dc5ea(_0x59b215);});});}exports[_0x9de2('0x15')]=function(_0x5ca2e4){var _0x4e8821=this;return new Promise(function(_0x4fbadd,_0x4f7efb){return db[_0x9de2('0x16')][_0x9de2('0x17')](_0x5ca2e4[_0x9de2('0x18')],{'raw':_0x5ca2e4[_0x9de2('0x19')]?_0x5ca2e4['options'][_0x9de2('0x1a')]===undefined?!![]:![]:!![]})[_0x9de2('0xb')](function(_0xf0e396){logger[_0x9de2('0xc')](_0x9de2('0x15'),_0x5ca2e4);logger[_0x9de2('0xf')](_0x9de2('0x15'),_0x5ca2e4,JSON['stringify'](_0xf0e396));_0x4fbadd(_0xf0e396);})[_0x9de2('0x14')](function(_0x506329){logger[_0x9de2('0x11')](_0x9de2('0x15'),_0x506329['message'],_0x5ca2e4);_0x4f7efb(_0x4e8821[_0x9de2('0x11')](0x1f4,_0x506329[_0x9de2('0x13')]));});});};exports[_0x9de2('0x1b')]=function(_0x2235f2){var _0x47a27=this;return new Promise(function(_0x316639,_0xef90bb){return db['VoiceDialReport'][_0x9de2('0x1c')](_0x2235f2[_0x9de2('0x18')],{'raw':_0x2235f2[_0x9de2('0x19')]?_0x2235f2['options'][_0x9de2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2235f2['options']?_0x2235f2['options']['where']||null:null,'attributes':_0x2235f2[_0x9de2('0x19')]?_0x2235f2['options'][_0x9de2('0x1d')]||null:null,'limit':_0x2235f2[_0x9de2('0x19')]?_0x2235f2[_0x9de2('0x19')][_0x9de2('0x1e')]||null:null})[_0x9de2('0xb')](function(_0x511deb){logger['info'](_0x9de2('0x1b'),_0x2235f2);logger['debug'](_0x9de2('0x1b'),_0x2235f2,JSON[_0x9de2('0x1f')](_0x511deb));_0x316639(_0x511deb);})[_0x9de2('0x14')](function(_0x44e14f){logger[_0x9de2('0x11')](_0x9de2('0x1b'),_0x44e14f[_0x9de2('0x13')],_0x2235f2);_0xef90bb(_0x47a27[_0x9de2('0x11')](0x1f4,_0x44e14f['message']));});});}; \ No newline at end of file +var _0x9a52=['limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','stringify','UpdateVoiceDialReport','update','where','attributes'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x9a52,0x97));var _0x29a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x29a5('0x0'));var util=require('util');var moment=require(_0x29a5('0x1'));var BPromise=require('bluebird');var rs=require(_0x29a5('0x2'));var fs=require('fs');var Redis=require(_0x29a5('0x3'));var db=require(_0x29a5('0x4'))['db'];var utils=require(_0x29a5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x29a5('0x6')][_0x29a5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b181f,_0xd5dd47,_0x398ebe){return new BPromise(function(_0x333099,_0x14226e){return client[_0x29a5('0x8')](_0x2b181f,_0x398ebe)[_0x29a5('0x9')](function(_0x44a41b){logger[_0x29a5('0xa')](_0x29a5('0xb'),_0xd5dd47,_0x29a5('0xc'));logger['debug'](_0x29a5('0xd'),_0xd5dd47,_0x29a5('0xc'),JSON['stringify'](_0x44a41b));if(_0x44a41b[_0x29a5('0xe')]){if(_0x44a41b['error'][_0x29a5('0xf')]===0x1f4){logger[_0x29a5('0xe')](_0x29a5('0xb'),_0xd5dd47,_0x44a41b[_0x29a5('0xe')]['message']);return _0x14226e(_0x44a41b[_0x29a5('0xe')]['message']);}logger['error'](_0x29a5('0xb'),_0xd5dd47,_0x44a41b[_0x29a5('0xe')]['message']);return _0x333099(_0x44a41b['error'][_0x29a5('0x10')]);}else{logger['info'](_0x29a5('0xb'),_0xd5dd47,_0x29a5('0xc'));_0x333099(_0x44a41b[_0x29a5('0x11')][_0x29a5('0x10')]);}})[_0x29a5('0x12')](function(_0x409fff){logger[_0x29a5('0xe')](_0x29a5('0xb'),_0xd5dd47,_0x409fff);_0x14226e(_0x409fff);});});}exports[_0x29a5('0x13')]=function(_0x4edd93){var _0x4f5ae2=this;return new Promise(function(_0x4148af,_0x363ef1){return db[_0x29a5('0x14')][_0x29a5('0x15')](_0x4edd93['body'],{'raw':_0x4edd93[_0x29a5('0x16')]?_0x4edd93[_0x29a5('0x16')][_0x29a5('0x17')]===undefined?!![]:![]:!![]})[_0x29a5('0x9')](function(_0x1a6232){logger['info'](_0x29a5('0x13'),_0x4edd93);logger['debug'](_0x29a5('0x13'),_0x4edd93,JSON[_0x29a5('0x18')](_0x1a6232));_0x4148af(_0x1a6232);})[_0x29a5('0x12')](function(_0x469066){logger['error'](_0x29a5('0x13'),_0x469066[_0x29a5('0x10')],_0x4edd93);_0x363ef1(_0x4f5ae2[_0x29a5('0xe')](0x1f4,_0x469066[_0x29a5('0x10')]));});});};exports[_0x29a5('0x19')]=function(_0x8a875){var _0x3b113c=this;return new Promise(function(_0x8e9ff1,_0x2a7a85){return db[_0x29a5('0x14')][_0x29a5('0x1a')](_0x8a875['body'],{'raw':_0x8a875[_0x29a5('0x16')]?_0x8a875[_0x29a5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a875['options']?_0x8a875[_0x29a5('0x16')][_0x29a5('0x1b')]||null:null,'attributes':_0x8a875[_0x29a5('0x16')]?_0x8a875[_0x29a5('0x16')][_0x29a5('0x1c')]||null:null,'limit':_0x8a875[_0x29a5('0x16')]?_0x8a875['options'][_0x29a5('0x1d')]||null:null})[_0x29a5('0x9')](function(_0xbaa1e2){logger[_0x29a5('0xa')]('UpdateVoiceDialReport',_0x8a875);logger['debug'](_0x29a5('0x19'),_0x8a875,JSON[_0x29a5('0x18')](_0xbaa1e2));_0x8e9ff1(_0xbaa1e2);})['catch'](function(_0x1ef8ff){logger[_0x29a5('0xe')](_0x29a5('0x19'),_0x1ef8ff[_0x29a5('0x10')],_0x8a875);_0x2a7a85(_0x3b113c[_0x29a5('0xe')](0x1f4,_0x1ef8ff['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 37b0ec1..259b202 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 _0xd617=['create','/:id/applications','put','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post'];(function(_0xc831c6,_0x542b00){var _0x5063a7=function(_0x4600ee){while(--_0x4600ee){_0xc831c6['push'](_0xc831c6['shift']());}};_0x5063a7(++_0x542b00);}(_0xd617,0x124));var _0x7d61=function(_0x311e3c,_0x455c6a){_0x311e3c=_0x311e3c-0x0;var _0x22b9e5=_0xd617[_0x311e3c];return _0x22b9e5;};'use strict';var multer=require('multer');var util=require(_0x7d61('0x0'));var path=require(_0x7d61('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7d61('0x2'));var auth=require(_0x7d61('0x3'));var interaction=require(_0x7d61('0x4'));var config=require(_0x7d61('0x5'));var controller=require(_0x7d61('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7d61('0x7')](_0x7d61('0x8'),auth[_0x7d61('0x9')](),controller[_0x7d61('0xa')]);router[_0x7d61('0xb')]('/',auth[_0x7d61('0x9')](),controller[_0x7d61('0xc')]);router[_0x7d61('0xb')](_0x7d61('0xd'),auth[_0x7d61('0x9')](),controller['addApplications']);router[_0x7d61('0xe')](_0x7d61('0x8'),auth[_0x7d61('0x9')](),controller['update']);router['delete'](_0x7d61('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x7d61('0xf')]=router; \ No newline at end of file +var _0xd04d=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3b0418,_0x32447b){var _0x5c8459=function(_0x1f297b){while(--_0x1f297b){_0x3b0418['push'](_0x3b0418['shift']());}};_0x5c8459(++_0x32447b);}(_0xd04d,0x11f));var _0xdd04=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd04d[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xdd04('0x0'));var util=require(_0xdd04('0x1'));var path=require('path');var timeout=require(_0xdd04('0x2'));var express=require(_0xdd04('0x3'));var router=express[_0xdd04('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdd04('0x5'));var interaction=require(_0xdd04('0x6'));var config=require(_0xdd04('0x7'));var controller=require(_0xdd04('0x8'));router[_0xdd04('0x9')]('/',auth[_0xdd04('0xa')](),controller['index']);router[_0xdd04('0x9')](_0xdd04('0xb'),auth['isAuthenticated'](),controller[_0xdd04('0xc')]);router[_0xdd04('0xd')]('/',auth[_0xdd04('0xa')](),controller[_0xdd04('0xe')]);router[_0xdd04('0xd')](_0xdd04('0xf'),auth['isAuthenticated'](),controller[_0xdd04('0x10')]);router[_0xdd04('0x11')](_0xdd04('0xb'),auth[_0xdd04('0xa')](),controller[_0xdd04('0x12')]);router[_0xdd04('0x13')](_0xdd04('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xdd04('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index fbafc3e..830fd15 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 _0xd6b2=['getDataValue','exten','exports','STRING','compositeIndex','NoOp','outbound','outbound-fax','any','INTEGER','BOOLEAN','wav'];(function(_0x78f46c,_0x597c49){var _0xd4394f=function(_0x4b17d0){while(--_0x4b17d0){_0x78f46c['push'](_0x78f46c['shift']());}};_0xd4394f(++_0x597c49);}(_0xd6b2,0x1be));var _0x2d6b=function(_0x3fbc7c,_0x23a270){_0x3fbc7c=_0x3fbc7c-0x0;var _0x4f2707=_0xd6b2[_0x3fbc7c];return _0x4f2707;};'use strict';var Sequelize=require('sequelize');module[_0x2d6b('0x0')]={'context':{'type':Sequelize[_0x2d6b('0x1')],'allowNull':![],'unique':_0x2d6b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2d6b('0x1')],'allowNull':![],'unique':_0x2d6b('0x2')},'priority':{'type':Sequelize[_0x2d6b('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x2d6b('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2d6b('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x2d6b('0x4'),'internal','inbound-fax',_0x2d6b('0x5'),'system',_0x2d6b('0x6')),'allowNull':![]},'description':{'type':Sequelize[_0x2d6b('0x1')]},'interval':{'type':Sequelize[_0x2d6b('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x2d6b('0x7')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2d6b('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2d6b('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x2d6b('0x8')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x2d6b('0x7')]},'recordingFormat':{'type':Sequelize[_0x2d6b('0x1')],'defaultValue':_0x2d6b('0x9')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2eec85){return this[_0x2d6b('0xa')](_0x2d6b('0xb'));}},'alias':{'type':Sequelize[_0x2d6b('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xa054=['exports','STRING','compositeIndex','ENUM','inbound-fax','outbound-fax','system','any','BOOLEAN','INTEGER','VIRTUAL','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa054,0x167));var _0x4a05=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0xa054[_0x187d80];return _0x498a77;};'use strict';var Sequelize=require(_0x4a05('0x0'));module[_0x4a05('0x1')]={'context':{'type':Sequelize[_0x4a05('0x2')],'allowNull':![],'unique':_0x4a05('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4a05('0x2')],'allowNull':![],'unique':_0x4a05('0x3')},'priority':{'type':Sequelize[_0x4a05('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4a05('0x3')},'tag':{'type':Sequelize[_0x4a05('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4a05('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x4a05('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4a05('0x4')]('inbound','outbound','internal',_0x4a05('0x5'),_0x4a05('0x6'),_0x4a05('0x7'),_0x4a05('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x4a05('0x2')]},'interval':{'type':Sequelize[_0x4a05('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4a05('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x4a05('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4a05('0xa')]},'recordingFormat':{'type':Sequelize[_0x4a05('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x4a05('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4a05('0xb')],'get':function(_0x48dbe2){return this['getDataValue']('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 0e0f5c0..9661521 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 _0x4fe0=['get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','find','value','name','UserProfileResource','destroy','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','order','where','filters','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','./voiceExtension.socket','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','then'];(function(_0x4e9fb4,_0x66b89){var _0x160386=function(_0x33cdf5){while(--_0x33cdf5){_0x4e9fb4['push'](_0x4e9fb4['shift']());}};_0x160386(++_0x66b89);}(_0x4fe0,0x16b));var _0x04fe=function(_0xb61ad1,_0x183afc){_0xb61ad1=_0xb61ad1-0x0;var _0x31308c=_0x4fe0[_0xb61ad1];return _0x31308c;};'use strict';var _=require(_0x04fe('0x0'));var Redis=require(_0x04fe('0x1'));var qs=require(_0x04fe('0x2'));var logger=require(_0x04fe('0x3'))('api');var config=require(_0x04fe('0x4'));var db=require(_0x04fe('0x5'))['db'];config['redis']=_[_0x04fe('0x6')](config[_0x04fe('0x7')],{'host':_0x04fe('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x04fe('0x9'))['register'](socket);function respondWithStatusCode(_0xc98a71,_0x1f8291){_0x1f8291=_0x1f8291||0xcc;return function(_0x57462a){if(_0x57462a){return _0xc98a71[_0x04fe('0xa')](_0x1f8291);}return _0xc98a71['status'](_0x1f8291)[_0x04fe('0xb')]();};}function respondWithResult(_0x27beb8,_0x44a540){_0x44a540=_0x44a540||0xc8;return function(_0x328ee0){if(_0x328ee0){return _0x27beb8[_0x04fe('0xc')](_0x44a540)[_0x04fe('0xd')](_0x328ee0);}};}function respondWithFilteredResult(_0x4ba8a4,_0x11e55e){return function(_0x2508b0){if(_0x2508b0){var _0x29f86b=typeof _0x11e55e['offset']===_0x04fe('0xe')&&typeof _0x11e55e[_0x04fe('0xf')]===_0x04fe('0xe');var _0x1c7cf2=_0x2508b0['count'];var _0x3f9e59=_0x29f86b?0x0:_0x11e55e[_0x04fe('0x10')];var _0x54487d=_0x29f86b?_0x2508b0[_0x04fe('0x11')]:_0x11e55e[_0x04fe('0x10')]+_0x11e55e[_0x04fe('0xf')];var _0x56b9b0;if(_0x54487d>=_0x1c7cf2){_0x54487d=_0x1c7cf2;_0x56b9b0=0xc8;}else{_0x56b9b0=0xce;}_0x4ba8a4[_0x04fe('0xc')](_0x56b9b0);return _0x4ba8a4[_0x04fe('0x12')](_0x04fe('0x13'),_0x3f9e59+'-'+_0x54487d+'/'+_0x1c7cf2)[_0x04fe('0xd')](_0x2508b0);}return null;};}function removeEntity(_0x570777){return function(_0x136442){if(_0x136442){return _0x136442['destroy']()[_0x04fe('0x14')](function(){var _0x55fdf2=_0x136442[_0x04fe('0x15')]({'plain':!![]});var _0x26da81=[{'name':_0x04fe('0x16'),'value':_0x04fe('0x17'),'ignore':![]},{'name':_0x04fe('0x18'),'value':_0x04fe('0x19'),'ignore':![]},{'name':_0x04fe('0x1a'),'value':_0x04fe('0x1b'),'ignore':![]}];var _0x90127a=_(_0x26da81)[_0x04fe('0x1c')](_0x04fe('0x1d'))[_0x04fe('0x1e')]('value')['value']();if(_['includes'](_0x90127a,_0x55fdf2['type'])){return;}var _0x53cba4=_[_0x04fe('0x1f')](_0x26da81,[_0x04fe('0x20'),_0x55fdf2['type']])[_0x04fe('0x21')];return db[_0x04fe('0x22')][_0x04fe('0x23')]({'where':{'type':_0x53cba4,'resourceId':_0x55fdf2['id']}})[_0x04fe('0x14')](function(){return _0x136442;});})[_0x04fe('0x14')](function(){_0x570777[_0x04fe('0xc')](0xcc)[_0x04fe('0xb')]();});}};}function handleEntityNotFound(_0x4613dc){return function(_0x167a19){if(!_0x167a19){_0x4613dc[_0x04fe('0xa')](0x194);}return _0x167a19;};}function handleError(_0x4e78d2,_0x5b2ab0){_0x5b2ab0=_0x5b2ab0||0x1f4;return function(_0x26b7e4){logger[_0x04fe('0x24')](_0x26b7e4[_0x04fe('0x25')]);if(_0x26b7e4[_0x04fe('0x21')]){delete _0x26b7e4[_0x04fe('0x21')];}_0x4e78d2['status'](_0x5b2ab0)[_0x04fe('0x26')](_0x26b7e4);};}exports[_0x04fe('0x27')]=function(_0x3dbc0a,_0x9fa058){var _0xb68c11={},_0x3abfdb={},_0x3cbf12={'count':0x0,'rows':[]};var _0x583d0d=_[_0x04fe('0x1e')](db[_0x04fe('0x28')][_0x04fe('0x29')],function(_0x105939){return{'name':_0x105939[_0x04fe('0x2a')],'type':_0x105939['type'][_0x04fe('0x2b')]};});_0x3abfdb[_0x04fe('0x2c')]=_[_0x04fe('0x1e')](_0x583d0d,'name');_0x3abfdb[_0x04fe('0x2d')]=_[_0x04fe('0x2e')](_0x3dbc0a['query']);_0x3abfdb['filters']=_['intersection'](_0x3abfdb[_0x04fe('0x2c')],_0x3abfdb[_0x04fe('0x2d')]);_0xb68c11[_0x04fe('0x2f')]=_[_0x04fe('0x30')](_0x3abfdb[_0x04fe('0x2c')],qs['fields'](_0x3dbc0a[_0x04fe('0x2d')][_0x04fe('0x31')]));_0xb68c11[_0x04fe('0x2f')]=_0xb68c11[_0x04fe('0x2f')][_0x04fe('0x32')]?_0xb68c11[_0x04fe('0x2f')]:_0x3abfdb['model'];if(!_0x3dbc0a[_0x04fe('0x2d')]['hasOwnProperty']('nolimit')){_0xb68c11[_0x04fe('0xf')]=qs['limit'](_0x3dbc0a[_0x04fe('0x2d')][_0x04fe('0xf')]);_0xb68c11['offset']=qs[_0x04fe('0x10')](_0x3dbc0a[_0x04fe('0x2d')]['offset']);}_0xb68c11[_0x04fe('0x33')]=qs['sort'](_0x3dbc0a[_0x04fe('0x2d')]['sort']);_0xb68c11[_0x04fe('0x34')]=qs[_0x04fe('0x35')](_[_0x04fe('0x36')](_0x3dbc0a['query'],_0x3abfdb['filters']),_0x583d0d);if(_0x3dbc0a['query'][_0x04fe('0x1c')]){_0xb68c11[_0x04fe('0x34')]=_['merge'](_0xb68c11['where'],{'$or':_[_0x04fe('0x1e')](_0x583d0d,function(_0x3d2d85){if(_0x3d2d85[_0x04fe('0x37')]!==_0x04fe('0x38')){var _0x503235={};_0x503235[_0x3d2d85['name']]={'$like':'%'+_0x3dbc0a['query'][_0x04fe('0x1c')]+'%'};return _0x503235;}})});}_0xb68c11=_[_0x04fe('0x39')]({},_0xb68c11,_0x3dbc0a[_0x04fe('0x3a')]);var _0x32a9fd={'where':_0xb68c11['where']};return db['VoiceExtension'][_0x04fe('0x11')](_0x32a9fd)[_0x04fe('0x14')](function(_0x1d1a0e){_0x3cbf12['count']=_0x1d1a0e;if(_0x3dbc0a['query'][_0x04fe('0x3b')]){_0xb68c11[_0x04fe('0x3c')]=[{'all':!![]}];}return db[_0x04fe('0x28')][_0x04fe('0x3d')](_0xb68c11);})[_0x04fe('0x14')](function(_0x2de804){_0x3cbf12[_0x04fe('0x3e')]=_0x2de804;return _0x3cbf12;})[_0x04fe('0x14')](respondWithFilteredResult(_0x9fa058,_0xb68c11))['catch'](handleError(_0x9fa058,null));};exports[_0x04fe('0x3f')]=function(_0x3448ec,_0x39537d){var _0xce16a3={'raw':![],'where':{'id':_0x3448ec[_0x04fe('0x40')]['id']}},_0x53c29b={};_0x53c29b[_0x04fe('0x2c')]=_['keys'](db[_0x04fe('0x28')][_0x04fe('0x29')]);_0x53c29b[_0x04fe('0x2d')]=_[_0x04fe('0x2e')](_0x3448ec['query']);_0x53c29b['filters']=_[_0x04fe('0x30')](_0x53c29b[_0x04fe('0x2c')],_0x53c29b[_0x04fe('0x2d')]);_0xce16a3[_0x04fe('0x2f')]=_[_0x04fe('0x30')](_0x53c29b['model'],qs[_0x04fe('0x31')](_0x3448ec[_0x04fe('0x2d')][_0x04fe('0x31')]));_0xce16a3[_0x04fe('0x2f')]=_0xce16a3[_0x04fe('0x2f')][_0x04fe('0x32')]?_0xce16a3[_0x04fe('0x2f')]:_0x53c29b['model'];if(_0x3448ec[_0x04fe('0x2d')]['includeAll']){_0xce16a3[_0x04fe('0x3c')]=[{'all':!![]}];}_0xce16a3=_[_0x04fe('0x39')]({},_0xce16a3,_0x3448ec[_0x04fe('0x3a')]);return db[_0x04fe('0x28')]['find'](_0xce16a3)['then'](handleEntityNotFound(_0x39537d,null))['then'](respondWithResult(_0x39537d,null))[_0x04fe('0x41')](handleError(_0x39537d,null));};exports[_0x04fe('0x23')]=function(_0x30c82f,_0x51914a){return db['VoiceExtension']['find']({'where':{'id':_0x30c82f['params']['id']}})[_0x04fe('0x14')](handleEntityNotFound(_0x51914a,null))[_0x04fe('0x14')](removeEntity(_0x51914a,null))[_0x04fe('0x41')](handleError(_0x51914a,null));};exports[_0x04fe('0x42')]=function(_0x4c6fdf,_0x4542b2){if(_0x4c6fdf[_0x04fe('0x43')][_0x04fe('0x37')]===_0x04fe('0x19')&&!_[_0x04fe('0x44')](_0x4c6fdf[_0x04fe('0x43')][_0x04fe('0x45')],'_')){_0x4c6fdf[_0x04fe('0x43')]['exten']='_'[_0x04fe('0x46')](_0x4c6fdf[_0x04fe('0x43')]['exten']);}return db[_0x04fe('0x28')][_0x04fe('0x42')](_0x4c6fdf['body'],{'raw':![]})[_0x04fe('0x14')](function(_0x4494e4){var _0x22fa54=_0x4c6fdf[_0x04fe('0x47')][_0x04fe('0x15')]({'plain':!![]});if(!_0x22fa54)throw new Error(_0x04fe('0x48'));if(_0x22fa54[_0x04fe('0x49')]===_0x04fe('0x47')){var _0xe93098=_0x4494e4[_0x04fe('0x15')]({'plain':!![]});var _0x13b896=[{'name':_0x04fe('0x16'),'value':'inbound'},{'name':_0x04fe('0x18'),'value':_0x04fe('0x19')},{'name':'InternalRoutes','value':_0x04fe('0x1b')}];var _0xb1f7ee=_[_0x04fe('0x1f')](_0x13b896,[_0x04fe('0x20'),_0xe93098[_0x04fe('0x37')]])[_0x04fe('0x21')];return db[_0x04fe('0x4a')]['find']({'where':{'name':_0xb1f7ee,'userProfileId':_0x22fa54[_0x04fe('0x4b')]},'raw':!![]})[_0x04fe('0x14')](function(_0x4a63c8){if(_0x4a63c8&&_0x4a63c8[_0x04fe('0x4c')]===0x0){return db[_0x04fe('0x22')][_0x04fe('0x42')]({'name':_0xe93098[_0x04fe('0x21')],'resourceId':_0xe93098['id'],'type':_0x4a63c8[_0x04fe('0x21')],'sectionId':_0x4a63c8['id']},{})[_0x04fe('0x14')](function(){return _0x4494e4;});}else{return _0x4494e4;}})[_0x04fe('0x41')](function(_0x182f92){logger['error'](_0x04fe('0x4d'),_0x182f92);throw _0x182f92;});}return _0x4494e4;})[_0x04fe('0x14')](respondWithResult(_0x4542b2,0xc9))['catch'](handleError(_0x4542b2,null));};exports[_0x04fe('0x4e')]=function(_0x3ba06b,_0x43c8d3){if(_0x3ba06b[_0x04fe('0x43')]['id']){delete _0x3ba06b[_0x04fe('0x43')]['id'];}return db[_0x04fe('0x28')][_0x04fe('0x1f')]({'where':{'id':_0x3ba06b[_0x04fe('0x40')]['id']}})[_0x04fe('0x14')](handleEntityNotFound(_0x43c8d3,null))['then'](function(_0xcd8b0){if(_0xcd8b0){return db[_0x04fe('0x28')][_0x04fe('0x4e')](_['pick'](_0x3ba06b[_0x04fe('0x43')],[_0x04fe('0x45'),_0x04fe('0x4f'),_0x04fe('0x50'),_0x04fe('0x51'),_0x04fe('0x52'),_0x04fe('0x53'),_0x04fe('0x54')]),{'where':{'context':_0xcd8b0[_0x04fe('0x4f')],'exten':_0xcd8b0[_0x04fe('0x45')]},'individualHooks':!![]})[_0x04fe('0x14')](function(_0x5c601c){return _0x5c601c;});}return null;})[_0x04fe('0x14')](respondWithStatusCode(_0x43c8d3,null))['catch'](handleError(_0x43c8d3,null));};exports[_0x04fe('0x55')]=function(_0x1cff5d,_0x5d4d97){var _0x1deb58=_0x1cff5d['params']['id'];var _0xb7076a=_0x1cff5d[_0x04fe('0x43')];var _0x1e657c=0xc8;var _0x2ff411=null;return db['sequelize'][_0x04fe('0x56')]({'isolationLevel':db[_0x04fe('0x57')]['Transaction'][_0x04fe('0x58')][_0x04fe('0x59')]},function(_0x5019f3){return db[_0x04fe('0x28')][_0x04fe('0x5a')]({'where':{'id':_0x1deb58},'transaction':_0x5019f3})[_0x04fe('0x14')](function(_0x5d3c07){if(_0x5d3c07){return db[_0x04fe('0x28')][_0x04fe('0x23')]({'where':{'VoiceExtensionId':_0x1deb58},'transaction':_0x5019f3})['then'](function(){var _0x12ebae=_[_0x04fe('0x1e')](_0xb7076a,function(_0x12211f){_0x12211f[_0x04fe('0x5b')]=_0x1deb58;_0x12211f[_0x04fe('0x5c')]=!![];return _0x12211f;});return _0x5d3c07[_0x04fe('0x5d')](_0x12ebae);})[_0x04fe('0x14')](function(_0x2eb803){return db[_0x04fe('0x28')]['bulkCreate'](_0x2eb803,{'transaction':_0x5019f3});});}else{_0x1e657c=0x194;_0x2ff411=[];}});})[_0x04fe('0x14')](function(){if(_0x1e657c!==0x194){return db[_0x04fe('0x28')][_0x04fe('0x5e')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1deb58},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x95b5a2){_0x2ff411=_0x95b5a2;});}})[_0x04fe('0x41')](function(_0x40a58f){_0x1e657c=0x1f4;logger['error'](_0x40a58f[_0x04fe('0x25')]);if(_0x40a58f['name']){delete _0x40a58f[_0x04fe('0x21')];}_0x2ff411=_0x40a58f;})[_0x04fe('0x5f')](function(){if(_0x2ff411===null){_0x5d4d97['sendStatus'](_0x1e657c);}else{if(_0x1e657c===0x1f4){_0x5d4d97[_0x04fe('0xc')](_0x1e657c)['send'](_0x2ff411);}else{_0x5d4d97['status'](_0x1e657c)[_0x04fe('0xd')](_0x2ff411);}}});}; \ No newline at end of file +var _0xd310=['recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','InboundRoutes','OutboundRoutes','InternalRoutes','internal','ignore','value','includes','type','find','name','UserProfileResource','then','end','error','stack','send','index','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','sort','pick','filter','where','merge','options','VoiceExtension','includeAll','include','rows','catch','params','fields','length','create','body','startsWith','exten','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description'];(function(_0x21a913,_0x54bc66){var _0x4b5ae4=function(_0x51c6f1){while(--_0x51c6f1){_0x21a913['push'](_0x21a913['shift']());}};_0x4b5ae4(++_0x54bc66);}(_0xd310,0xbf));var _0x0d31=function(_0x4160f3,_0x511990){_0x4160f3=_0x4160f3-0x0;var _0x5f4f44=_0xd310[_0x4160f3];return _0x5f4f44;};'use strict';var _=require('lodash');var Redis=require(_0x0d31('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0d31('0x1'));var config=require('../../config/environment');var db=require(_0x0d31('0x2'))['db'];config[_0x0d31('0x3')]=_[_0x0d31('0x4')](config[_0x0d31('0x3')],{'host':_0x0d31('0x5'),'port':0x18eb});var socket=require(_0x0d31('0x6'))(new Redis(config['redis']));require(_0x0d31('0x7'))[_0x0d31('0x8')](socket);function respondWithStatusCode(_0x394602,_0xd3e17){_0xd3e17=_0xd3e17||0xcc;return function(_0x5a1152){if(_0x5a1152){return _0x394602[_0x0d31('0x9')](_0xd3e17);}return _0x394602['status'](_0xd3e17)['end']();};}function respondWithResult(_0x168f11,_0x2f51ee){_0x2f51ee=_0x2f51ee||0xc8;return function(_0xd41130){if(_0xd41130){return _0x168f11[_0x0d31('0xa')](_0x2f51ee)[_0x0d31('0xb')](_0xd41130);}};}function respondWithFilteredResult(_0xd79c3b,_0x3acf7e){return function(_0x4a375){if(_0x4a375){var _0x2c975a=typeof _0x3acf7e[_0x0d31('0xc')]===_0x0d31('0xd')&&typeof _0x3acf7e[_0x0d31('0xe')]===_0x0d31('0xd');var _0x5473b9=_0x4a375[_0x0d31('0xf')];var _0x13cdaf=_0x2c975a?0x0:_0x3acf7e[_0x0d31('0xc')];var _0x2e078d=_0x2c975a?_0x4a375['count']:_0x3acf7e['offset']+_0x3acf7e[_0x0d31('0xe')];var _0x1270ac;if(_0x2e078d>=_0x5473b9){_0x2e078d=_0x5473b9;_0x1270ac=0xc8;}else{_0x1270ac=0xce;}_0xd79c3b[_0x0d31('0xa')](_0x1270ac);return _0xd79c3b[_0x0d31('0x10')](_0x0d31('0x11'),_0x13cdaf+'-'+_0x2e078d+'/'+_0x5473b9)[_0x0d31('0xb')](_0x4a375);}return null;};}function removeEntity(_0x338a91){return function(_0x1f1184){if(_0x1f1184){return _0x1f1184[_0x0d31('0x12')]()['then'](function(){var _0x4b08b0=_0x1f1184[_0x0d31('0x13')]({'plain':!![]});var _0xa6a70c=[{'name':_0x0d31('0x14'),'value':'inbound','ignore':![]},{'name':_0x0d31('0x15'),'value':'outbound','ignore':![]},{'name':_0x0d31('0x16'),'value':_0x0d31('0x17'),'ignore':![]}];var _0x1f08f7=_(_0xa6a70c)['filter'](_0x0d31('0x18'))['map'](_0x0d31('0x19'))['value']();if(_[_0x0d31('0x1a')](_0x1f08f7,_0x4b08b0[_0x0d31('0x1b')])){return;}var _0x69a32b=_[_0x0d31('0x1c')](_0xa6a70c,[_0x0d31('0x19'),_0x4b08b0[_0x0d31('0x1b')]])[_0x0d31('0x1d')];return db[_0x0d31('0x1e')]['destroy']({'where':{'type':_0x69a32b,'resourceId':_0x4b08b0['id']}})[_0x0d31('0x1f')](function(){return _0x1f1184;});})[_0x0d31('0x1f')](function(){_0x338a91[_0x0d31('0xa')](0xcc)[_0x0d31('0x20')]();});}};}function handleEntityNotFound(_0xf3f22d){return function(_0x44b81e){if(!_0x44b81e){_0xf3f22d[_0x0d31('0x9')](0x194);}return _0x44b81e;};}function handleError(_0x51c56a,_0x85200b){_0x85200b=_0x85200b||0x1f4;return function(_0x2bb46d){logger[_0x0d31('0x21')](_0x2bb46d[_0x0d31('0x22')]);if(_0x2bb46d[_0x0d31('0x1d')]){delete _0x2bb46d[_0x0d31('0x1d')];}_0x51c56a[_0x0d31('0xa')](_0x85200b)[_0x0d31('0x23')](_0x2bb46d);};}exports[_0x0d31('0x24')]=function(_0x17929c,_0xcc5b5){var _0x26c48d={},_0x510f2b={},_0x1dd958={'count':0x0,'rows':[]};var _0x4a3e19=_['map'](db['VoiceExtension'][_0x0d31('0x25')],function(_0x3e88d8){return{'name':_0x3e88d8[_0x0d31('0x26')],'type':_0x3e88d8[_0x0d31('0x1b')]['key']};});_0x510f2b[_0x0d31('0x27')]=_[_0x0d31('0x28')](_0x4a3e19,_0x0d31('0x1d'));_0x510f2b[_0x0d31('0x29')]=_[_0x0d31('0x2a')](_0x17929c[_0x0d31('0x29')]);_0x510f2b[_0x0d31('0x2b')]=_[_0x0d31('0x2c')](_0x510f2b[_0x0d31('0x27')],_0x510f2b['query']);_0x26c48d['attributes']=_['intersection'](_0x510f2b[_0x0d31('0x27')],qs['fields'](_0x17929c[_0x0d31('0x29')]['fields']));_0x26c48d[_0x0d31('0x2d')]=_0x26c48d['attributes']['length']?_0x26c48d[_0x0d31('0x2d')]:_0x510f2b[_0x0d31('0x27')];if(!_0x17929c[_0x0d31('0x29')][_0x0d31('0x2e')]('nolimit')){_0x26c48d['limit']=qs[_0x0d31('0xe')](_0x17929c[_0x0d31('0x29')][_0x0d31('0xe')]);_0x26c48d[_0x0d31('0xc')]=qs[_0x0d31('0xc')](_0x17929c['query'][_0x0d31('0xc')]);}_0x26c48d['order']=qs['sort'](_0x17929c[_0x0d31('0x29')][_0x0d31('0x2f')]);_0x26c48d['where']=qs[_0x0d31('0x2b')](_[_0x0d31('0x30')](_0x17929c[_0x0d31('0x29')],_0x510f2b[_0x0d31('0x2b')]),_0x4a3e19);if(_0x17929c[_0x0d31('0x29')][_0x0d31('0x31')]){_0x26c48d[_0x0d31('0x32')]=_[_0x0d31('0x33')](_0x26c48d[_0x0d31('0x32')],{'$or':_[_0x0d31('0x28')](_0x4a3e19,function(_0x58f3dc){if(_0x58f3dc[_0x0d31('0x1b')]!=='VIRTUAL'){var _0x2dee4a={};_0x2dee4a[_0x58f3dc['name']]={'$like':'%'+_0x17929c['query'][_0x0d31('0x31')]+'%'};return _0x2dee4a;}})});}_0x26c48d=_['merge']({},_0x26c48d,_0x17929c[_0x0d31('0x34')]);var _0x1d9c03={'where':_0x26c48d[_0x0d31('0x32')]};return db[_0x0d31('0x35')][_0x0d31('0xf')](_0x1d9c03)['then'](function(_0x3817f5){_0x1dd958[_0x0d31('0xf')]=_0x3817f5;if(_0x17929c['query'][_0x0d31('0x36')]){_0x26c48d[_0x0d31('0x37')]=[{'all':!![]}];}return db[_0x0d31('0x35')]['findAll'](_0x26c48d);})[_0x0d31('0x1f')](function(_0x4d2ab4){_0x1dd958[_0x0d31('0x38')]=_0x4d2ab4;return _0x1dd958;})[_0x0d31('0x1f')](respondWithFilteredResult(_0xcc5b5,_0x26c48d))[_0x0d31('0x39')](handleError(_0xcc5b5,null));};exports['show']=function(_0x2334f5,_0x6773d){var _0x100b5d={'raw':![],'where':{'id':_0x2334f5[_0x0d31('0x3a')]['id']}},_0x3dfa85={};_0x3dfa85[_0x0d31('0x27')]=_[_0x0d31('0x2a')](db[_0x0d31('0x35')][_0x0d31('0x25')]);_0x3dfa85[_0x0d31('0x29')]=_[_0x0d31('0x2a')](_0x2334f5[_0x0d31('0x29')]);_0x3dfa85[_0x0d31('0x2b')]=_[_0x0d31('0x2c')](_0x3dfa85[_0x0d31('0x27')],_0x3dfa85[_0x0d31('0x29')]);_0x100b5d[_0x0d31('0x2d')]=_[_0x0d31('0x2c')](_0x3dfa85[_0x0d31('0x27')],qs[_0x0d31('0x3b')](_0x2334f5[_0x0d31('0x29')][_0x0d31('0x3b')]));_0x100b5d['attributes']=_0x100b5d[_0x0d31('0x2d')][_0x0d31('0x3c')]?_0x100b5d['attributes']:_0x3dfa85['model'];if(_0x2334f5[_0x0d31('0x29')][_0x0d31('0x36')]){_0x100b5d[_0x0d31('0x37')]=[{'all':!![]}];}_0x100b5d=_[_0x0d31('0x33')]({},_0x100b5d,_0x2334f5['options']);return db[_0x0d31('0x35')][_0x0d31('0x1c')](_0x100b5d)[_0x0d31('0x1f')](handleEntityNotFound(_0x6773d,null))[_0x0d31('0x1f')](respondWithResult(_0x6773d,null))[_0x0d31('0x39')](handleError(_0x6773d,null));};exports[_0x0d31('0x12')]=function(_0x38d806,_0x140628){return db[_0x0d31('0x35')][_0x0d31('0x1c')]({'where':{'id':_0x38d806[_0x0d31('0x3a')]['id']}})[_0x0d31('0x1f')](handleEntityNotFound(_0x140628,null))[_0x0d31('0x1f')](removeEntity(_0x140628,null))[_0x0d31('0x39')](handleError(_0x140628,null));};exports[_0x0d31('0x3d')]=function(_0x1cdcf1,_0x20d33b){if(_0x1cdcf1[_0x0d31('0x3e')]['type']==='outbound'&&!_[_0x0d31('0x3f')](_0x1cdcf1[_0x0d31('0x3e')][_0x0d31('0x40')],'_')){_0x1cdcf1[_0x0d31('0x3e')][_0x0d31('0x40')]='_'['concat'](_0x1cdcf1['body'][_0x0d31('0x40')]);}return db[_0x0d31('0x35')][_0x0d31('0x3d')](_0x1cdcf1[_0x0d31('0x3e')],{'raw':![]})['then'](function(_0x49ac49){var _0x3909a9=_0x1cdcf1['user'][_0x0d31('0x13')]({'plain':!![]});if(!_0x3909a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3909a9[_0x0d31('0x41')]===_0x0d31('0x42')){var _0x214a89=_0x49ac49[_0x0d31('0x13')]({'plain':!![]});var _0x4b26f0=[{'name':'InboundRoutes','value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x0d31('0x16'),'value':_0x0d31('0x17')}];var _0x47633b=_[_0x0d31('0x1c')](_0x4b26f0,['value',_0x214a89[_0x0d31('0x1b')]])[_0x0d31('0x1d')];return db['UserProfileSection'][_0x0d31('0x1c')]({'where':{'name':_0x47633b,'userProfileId':_0x3909a9[_0x0d31('0x43')]},'raw':!![]})['then'](function(_0x55732e){if(_0x55732e&&_0x55732e[_0x0d31('0x44')]===0x0){return db[_0x0d31('0x1e')]['create']({'name':_0x214a89[_0x0d31('0x1d')],'resourceId':_0x214a89['id'],'type':_0x55732e[_0x0d31('0x1d')],'sectionId':_0x55732e['id']},{})['then'](function(){return _0x49ac49;});}else{return _0x49ac49;}})[_0x0d31('0x39')](function(_0x436cf6){logger[_0x0d31('0x21')](_0x0d31('0x45'),_0x436cf6);throw _0x436cf6;});}return _0x49ac49;})['then'](respondWithResult(_0x20d33b,0xc9))[_0x0d31('0x39')](handleError(_0x20d33b,null));};exports[_0x0d31('0x46')]=function(_0x420c27,_0x24150c){if(_0x420c27[_0x0d31('0x3e')]['id']){delete _0x420c27[_0x0d31('0x3e')]['id'];}return db[_0x0d31('0x35')][_0x0d31('0x1c')]({'where':{'id':_0x420c27[_0x0d31('0x3a')]['id']}})[_0x0d31('0x1f')](handleEntityNotFound(_0x24150c,null))[_0x0d31('0x1f')](function(_0x19f546){if(_0x19f546){return db[_0x0d31('0x35')][_0x0d31('0x46')](_[_0x0d31('0x30')](_0x420c27[_0x0d31('0x3e')],[_0x0d31('0x40'),_0x0d31('0x47'),_0x0d31('0x48'),_0x0d31('0x49'),_0x0d31('0x4a'),_0x0d31('0x4b'),_0x0d31('0x4c')]),{'where':{'context':_0x19f546[_0x0d31('0x47')],'exten':_0x19f546[_0x0d31('0x40')]},'individualHooks':!![]})[_0x0d31('0x1f')](function(_0x37168e){return _0x37168e;});}return null;})[_0x0d31('0x1f')](respondWithStatusCode(_0x24150c,null))[_0x0d31('0x39')](handleError(_0x24150c,null));};exports['addApplications']=function(_0x27df4a,_0x51f605){var _0x368fa6=_0x27df4a[_0x0d31('0x3a')]['id'];var _0x2f8718=_0x27df4a['body'];var _0x1f6850=0xc8;var _0x2f2eb5=null;return db[_0x0d31('0x4d')][_0x0d31('0x4e')]({'isolationLevel':db[_0x0d31('0x4d')]['Transaction'][_0x0d31('0x4f')][_0x0d31('0x50')]},function(_0x10c4b2){return db[_0x0d31('0x35')]['findOne']({'where':{'id':_0x368fa6},'transaction':_0x10c4b2})['then'](function(_0x4b094f){if(_0x4b094f){return db[_0x0d31('0x35')]['destroy']({'where':{'VoiceExtensionId':_0x368fa6},'transaction':_0x10c4b2})['then'](function(){var _0x4306a8=_['map'](_0x2f8718,function(_0xa3da0c){_0xa3da0c[_0x0d31('0x51')]=_0x368fa6;_0xa3da0c[_0x0d31('0x52')]=!![];return _0xa3da0c;});return _0x4b094f[_0x0d31('0x53')](_0x4306a8);})[_0x0d31('0x1f')](function(_0x2701af){return db[_0x0d31('0x35')][_0x0d31('0x54')](_0x2701af,{'transaction':_0x10c4b2});});}else{_0x1f6850=0x194;_0x2f2eb5=[];}});})['then'](function(){if(_0x1f6850!==0x194){return db['VoiceExtension'][_0x0d31('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x368fa6},'order':_0x0d31('0x56')})[_0x0d31('0x1f')](function(_0x473619){_0x2f2eb5=_0x473619;});}})[_0x0d31('0x39')](function(_0x49c63b){_0x1f6850=0x1f4;logger[_0x0d31('0x21')](_0x49c63b[_0x0d31('0x22')]);if(_0x49c63b[_0x0d31('0x1d')]){delete _0x49c63b[_0x0d31('0x1d')];}_0x2f2eb5=_0x49c63b;})[_0x0d31('0x57')](function(){if(_0x2f2eb5===null){_0x51f605[_0x0d31('0x9')](_0x1f6850);}else{if(_0x1f6850===0x1f4){_0x51f605['status'](_0x1f6850)[_0x0d31('0x23')](_0x2f2eb5);}else{_0x51f605['status'](_0x1f6850)[_0x0d31('0xb')](_0x2f2eb5);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 3d26aab..e8025b9 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 _0xda7a=['exports','events','VoiceExtension','setMaxListeners','update','remove','emit','hook'];(function(_0x1b658,_0x344b6a){var _0x1d17e5=function(_0x1fae07){while(--_0x1fae07){_0x1b658['push'](_0x1b658['shift']());}};_0x1d17e5(++_0x344b6a);}(_0xda7a,0xa9));var _0xada7=function(_0xb53d5c,_0x37fbda){_0xb53d5c=_0xb53d5c-0x0;var _0x353932=_0xda7a[_0xb53d5c];return _0x353932;};'use strict';var EventEmitter=require(_0xada7('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xada7('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xada7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xada7('0x3'),'afterDestroy':_0xada7('0x4')};function emitEvent(_0x325eff){return function(_0x47186b,_0x358f41,_0xc3c493){VoiceExtensionEvents[_0xada7('0x5')](_0x325eff+':'+_0x47186b['id'],_0x47186b);VoiceExtensionEvents[_0xada7('0x5')](_0x325eff,_0x47186b);_0xc3c493(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xada7('0x6')](e,emitEvent(event));}}module[_0xada7('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xbff0=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3e4624,_0x26a97f){var _0x1b56a9=function(_0x164808){while(--_0x164808){_0x3e4624['push'](_0x3e4624['shift']());}};_0x1b56a9(++_0x26a97f);}(_0xbff0,0xd9));var _0x0bff=function(_0x570c6c,_0x36de74){_0x570c6c=_0x570c6c-0x0;var _0x2d13e8=_0xbff0[_0x570c6c];return _0x2d13e8;};'use strict';var EventEmitter=require(_0x0bff('0x0'));var VoiceExtension=require(_0x0bff('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0bff('0x2')](0x0);var events={'afterCreate':_0x0bff('0x3'),'afterUpdate':_0x0bff('0x4'),'afterDestroy':_0x0bff('0x5')};function emitEvent(_0x5c2589){return function(_0xddee87,_0x399fb3,_0x3207f7){VoiceExtensionEvents['emit'](_0x5c2589+':'+_0xddee87['id'],_0xddee87);VoiceExtensionEvents[_0x0bff('0x6')](_0x5c2589,_0xddee87);_0x3207f7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x0bff('0x7')](e,emitEvent(event));}}module[_0x0bff('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 1c16ee0..d9dba2f 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 _0xef81=['priority','last','concat','catch','define','VoiceExtension','get','Hangup','type','Set','context','exten','NoOp','alias','No\x20alias\x20set','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','name','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','push','length','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}'];(function(_0x2249ba,_0x48dff0){var _0x1f7c5e=function(_0x464dd2){while(--_0x464dd2){_0x2249ba['push'](_0x2249ba['shift']());}};_0x1f7c5e(++_0x48dff0);}(_0xef81,0x1a7));var _0x1ef8=function(_0x43f407,_0x4ad0b3){_0x43f407=_0x43f407-0x0;var _0x5eec27=_0xef81[_0x43f407];return _0x5eec27;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x40f4f8){var _0x51a96f=_0x40f4f8['models'];function _0x1c42b0(_0x39452b){var _0x45deb1=0x2;var _0x54494=[{'type':_0x39452b[_0x1ef8('0x0')],'app':_0x1ef8('0x1'),'appdata':'CDR(type)='+_0x39452b[_0x1ef8('0x0')],'context':_0x39452b[_0x1ef8('0x2')],'exten':_0x39452b[_0x1ef8('0x3')],'priority':_0x45deb1++,'VoiceExtensionId':_0x39452b['id']},{'type':_0x39452b[_0x1ef8('0x0')],'app':_0x39452b['alias']?_0x1ef8('0x1'):_0x1ef8('0x4'),'appdata':_0x39452b[_0x1ef8('0x5')]?'CDR(routeAlias)='+_0x39452b[_0x1ef8('0x5')]:_0x1ef8('0x6'),'context':_0x39452b[_0x1ef8('0x2')],'exten':_0x39452b[_0x1ef8('0x3')],'priority':_0x45deb1++,'VoiceExtensionId':_0x39452b['id']}];if(_0x39452b[_0x1ef8('0x0')]===_0x1ef8('0x7')){_0x54494['push']({'type':_0x1ef8('0x7'),'app':'Set','appdata':_0x1ef8('0x8')+_0x39452b['id'],'context':_0x39452b['context'],'exten':_0x39452b['exten'],'priority':_0x45deb1++,'VoiceExtensionId':_0x39452b['id']});}_0x54494['push']({'type':_0x39452b[_0x1ef8('0x0')],'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0x9'),'context':_0x39452b[_0x1ef8('0x2')],'exten':_0x39452b[_0x1ef8('0x3')],'priority':_0x45deb1++,'VoiceExtensionId':_0x39452b['id']},{'type':_0x39452b[_0x1ef8('0x0')],'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0xa'),'context':_0x39452b[_0x1ef8('0x2')],'exten':_0x39452b['exten'],'priority':_0x45deb1++,'VoiceExtensionId':_0x39452b['id']},{'type':_0x39452b[_0x1ef8('0x0')],'app':'Set','appdata':_0x1ef8('0xb'),'context':_0x39452b[_0x1ef8('0x2')],'exten':_0x39452b[_0x1ef8('0x3')],'priority':_0x45deb1++,'VoiceExtensionId':_0x39452b['id']});return _0x54494;}function _0xafb7fd(_0x1f49c1){var _0x548e9a=0x2;var _0x2af9b4=[{'type':_0x1ef8('0xc'),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0xd'),'context':_0x1f49c1[_0x1ef8('0x2')],'exten':_0x1f49c1[_0x1ef8('0x3')],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':_0x1f49c1['alias']?_0x1ef8('0x1'):_0x1ef8('0x4'),'appdata':_0x1f49c1['alias']?_0x1ef8('0xe')+_0x1f49c1[_0x1ef8('0x5')]:_0x1ef8('0x6'),'context':_0x1f49c1['context'],'exten':_0x1f49c1[_0x1ef8('0x3')],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0xf')+(_0x1f49c1['cutdigits']?_0x1ef8('0x10')+_0x1f49c1['cutdigits']+'}':_0x1ef8('0x11')),'context':_0x1f49c1[_0x1ef8('0x2')],'exten':_0x1f49c1[_0x1ef8('0x3')],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0x8')+_0x1f49c1['id'],'context':_0x1f49c1['context'],'exten':_0x1f49c1['exten'],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':'ExecIf','appdata':_0x1ef8('0x12')+(_0x548e9a+0x2)+_0x1ef8('0x13')+(_0x548e9a+0x1)+')','context':_0x1f49c1[_0x1ef8('0x2')],'exten':_0x1f49c1[_0x1ef8('0x3')],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':'outbound','app':_0x1ef8('0x1'),'appdata':_0x1f49c1[_0x1ef8('0x14')]?_0x1ef8('0x15')+_0x1f49c1[_0x1ef8('0x14')]+'}':_0x1ef8('0x16'),'context':_0x1f49c1[_0x1ef8('0x2')],'exten':_0x1f49c1['exten'],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0x9'),'context':_0x1f49c1[_0x1ef8('0x2')],'exten':_0x1f49c1[_0x1ef8('0x3')],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0xa'),'context':_0x1f49c1['context'],'exten':_0x1f49c1['exten'],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':'Set','appdata':_0x1ef8('0xb'),'context':_0x1f49c1[_0x1ef8('0x2')],'exten':_0x1f49c1[_0x1ef8('0x3')],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0x17')+_0x1f49c1['id'],'context':_0x1f49c1[_0x1ef8('0x2')],'exten':_0x1f49c1['exten'],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']}];if(_0x1f49c1['hasOwnProperty'](_0x1ef8('0x18'))&&_0x1f49c1['recordingFormat']!==_0x1ef8('0x19')){_0x2af9b4['push']({'type':_0x1ef8('0xc'),'app':_0x1ef8('0x1'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1f49c1['context'],'exten':_0x1f49c1[_0x1ef8('0x3')],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']},{'type':_0x1ef8('0xc'),'app':'Set','appdata':_0x1ef8('0x1a')+_0x1f49c1[_0x1ef8('0x18')]||_0x1ef8('0x1b'),'context':_0x1f49c1['context'],'exten':_0x1f49c1['exten'],'priority':_0x548e9a++,'VoiceExtensionId':_0x1f49c1['id']});}return _0x2af9b4;}function _0x57ae5c(_0x305047,_0x13a9a5){var _0x5743a5=[{'name':_0x1ef8('0x1c'),'param':0x0},{'name':_0x1ef8('0x1d'),'param':0x1},{'name':_0x1ef8('0x1e'),'param':0x2},{'name':_0x1ef8('0x1f'),'param':0x3}];var _0x1c0327={};var _0x452f50=_0x13a9a5[_0x1ef8('0x20')](',');var _0x34de9a=[];for(var _0x1caed7=0x0;_0x1caed7<_0x5743a5['length'];_0x1caed7++){switch(_0x5743a5[_0x1caed7][_0x1ef8('0x21')]){case _0x1ef8('0x1c'):_0x1c0327[_0x1ef8('0x1c')]=_0x452f50[_0x5743a5[_0x1caed7]['param']][_0x1ef8('0x20')]('/')[0x1];_0x1c0327['phone']=_0x452f50[_0x5743a5[_0x1caed7][_0x1ef8('0x22')]][_0x1ef8('0x20')]('/')[0x2];_0x1c0327['prefix']=_0x1c0327[_0x1ef8('0x23')]?_0x1c0327['phone'][_0x1ef8('0x20')]('$')[0x0]:undefined;_0x1c0327[_0x1ef8('0x23')]=_0x305047['cutdigits']?(_0x1c0327['prefix']||'')+'${EXTEN:'+_0x305047['cutdigits']+'}':(_0x1c0327[_0x1ef8('0x24')]||'')+'${EXTEN}';_0x34de9a[_0x5743a5[_0x1caed7][_0x1ef8('0x22')]]=['SIP',_0x1c0327[_0x1ef8('0x1c')],_0x1c0327[_0x1ef8('0x23')]][_0x1ef8('0x25')]('/');break;case'options':_0x1c0327[_0x1ef8('0x1e')]=_0x452f50[_0x5743a5[_0x1caed7][_0x1ef8('0x22')]];if(_0x305047['recordingFormat']!==_0x1ef8('0x19')){if(_0x1c0327[_0x1ef8('0x1e')][_0x1ef8('0x26')](_0x1ef8('0x27'))<0x0){_0x1c0327[_0x1ef8('0x1e')]+=_0x1ef8('0x27');}}else{_0x1c0327[_0x1ef8('0x1e')]=_0x1c0327[_0x1ef8('0x1e')][_0x1ef8('0x28')](_0x1ef8('0x27'),'');}_0x34de9a[_0x5743a5[_0x1caed7][_0x1ef8('0x22')]]=_0x1c0327[_0x1ef8('0x1e')];break;default:_0x34de9a[_0x5743a5[_0x1caed7][_0x1ef8('0x22')]]=_0x452f50[_0x5743a5[_0x1caed7][_0x1ef8('0x22')]];}}return _0x34de9a['join'](',');}function _0x4996d6(_0x3d2e0b,_0x36b4ab,_0x292064){return new Promise(function(_0x135110,_0x3af16f){var _0x40634b=[];if(_[_0x1ef8('0x29')](_0x36b4ab))return _0x135110(_0x40634b);_0x51a96f[_0x1ef8('0x2a')][_0x1ef8('0x2b')]({'attributes':['id',_0x1ef8('0x2c'),_0x1ef8('0x2d')],'raw':!![]})['then'](function(_0x339dc5){for(var _0xba16c1=0x0,_0x137645=0x0;_0xba16c1<_0x36b4ab['length'];_0xba16c1++,_0x137645=0x0){var _0x927b31=_0x36b4ab[_0xba16c1];var _0x470557=[];var _0x44f9eb=[];delete _0x927b31['id'];if(_0x927b31[_0x1ef8('0x2c')]!==_0x1ef8('0x2e')){_0x927b31['intervals']=[_0x927b31[_0x1ef8('0x2c')]];}else{_0x927b31[_0x1ef8('0x2f')]=_0x927b31[_0x1ef8('0x2d')]?_[_0x1ef8('0x30')](_[_0x1ef8('0x31')](_0x339dc5,{'IntervalId':_0x927b31[_0x1ef8('0x2d')]}),_0x1ef8('0x2c')):[];}_0x927b31[_0x1ef8('0x2')]=_0x3d2e0b[_0x1ef8('0x2')];_0x927b31[_0x1ef8('0x3')]=_0x3d2e0b['exten'];if(_0x927b31[_0x1ef8('0x0')])_0x927b31[_0x1ef8('0x0')]=_0x927b31[_0x1ef8('0x0')][_0x1ef8('0x32')]();if(_0x3d2e0b[_0x1ef8('0x0')]===_0x1ef8('0xc')){if(_0x927b31[_0x1ef8('0x33')](_0x1ef8('0x34'))&&_0x927b31['tag']&&_0x927b31[_0x1ef8('0x34')]!=='--'){_0x470557[_0x1ef8('0x35')]({'type':_0x927b31['type'][_0x1ef8('0x32')](),'app':'Set','appdata':'CDR(tag)='+_0x927b31[_0x1ef8('0x34')],'context':_0x3d2e0b[_0x1ef8('0x2')],'exten':_0x3d2e0b[_0x1ef8('0x3')],'priority':_0x927b31[_0x1ef8('0x2f')][_0x1ef8('0x36')]+_0x292064+_0x137645++,'VoiceExtensionId':_0x3d2e0b['id']});}_0x470557['push']({'type':_0x927b31['type']['toLowerCase'](),'app':_0x1ef8('0x37'),'appdata':_0x1ef8('0x38')+(_0x927b31['callerID']?_0x1ef8('0x39')+_0x927b31[_0x1ef8('0x3a')]+')':_0x1ef8('0x3b')),'context':_0x3d2e0b[_0x1ef8('0x2')],'exten':_0x3d2e0b[_0x1ef8('0x3')],'priority':_0x927b31[_0x1ef8('0x2f')][_0x1ef8('0x36')]+_0x292064+_0x137645++,'VoiceExtensionId':_0x3d2e0b['id']});}else{if(_0x927b31[_0x1ef8('0x33')](_0x1ef8('0x3c'))){if([_0x1ef8('0x3d'),_0x1ef8('0x3e')][_0x1ef8('0x3f')](_0x927b31[_0x1ef8('0x40')][_0x1ef8('0x32')]())&&_0x927b31[_0x1ef8('0x41')]!==_0x1ef8('0x42')){if(_0x927b31['answer']){_0x470557[_0x1ef8('0x35')]({'type':_0x927b31['type'][_0x1ef8('0x32')](),'app':_0x1ef8('0x37'),'appdata':_0x1ef8('0x43'),'context':_0x3d2e0b[_0x1ef8('0x2')],'exten':_0x3d2e0b[_0x1ef8('0x3')],'priority':_0x927b31['intervals'][_0x1ef8('0x36')]+_0x292064+_0x137645++,'VoiceExtensionId':_0x3d2e0b['id']});_0x470557[_0x1ef8('0x35')]({'type':_0x927b31['type'][_0x1ef8('0x32')](),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0x44'),'context':_0x3d2e0b['context'],'exten':_0x3d2e0b[_0x1ef8('0x3')],'priority':_0x927b31[_0x1ef8('0x2f')][_0x1ef8('0x36')]+_0x292064+_0x137645++,'VoiceExtensionId':_0x3d2e0b['id']});}else{_0x470557[_0x1ef8('0x35')]({'type':_0x927b31['type'][_0x1ef8('0x32')](),'app':_0x1ef8('0x37'),'appdata':_0x1ef8('0x45'),'context':_0x3d2e0b[_0x1ef8('0x2')],'exten':_0x3d2e0b[_0x1ef8('0x3')],'priority':_0x927b31[_0x1ef8('0x2f')][_0x1ef8('0x36')]+_0x292064+_0x137645++,'VoiceExtensionId':_0x3d2e0b['id']});_0x470557[_0x1ef8('0x35')]({'type':_0x927b31['type'][_0x1ef8('0x32')](),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0x46'),'context':_0x3d2e0b[_0x1ef8('0x2')],'exten':_0x3d2e0b[_0x1ef8('0x3')],'priority':_0x927b31[_0x1ef8('0x2f')][_0x1ef8('0x36')]+_0x292064+_0x137645++,'VoiceExtensionId':_0x3d2e0b['id']});}}}}for(var _0xb8c1e8=0x0;_0xb8c1e8<_0x927b31[_0x1ef8('0x2f')][_0x1ef8('0x36')];_0xb8c1e8++){var _0x77bbad=_0x292064+_0x927b31['intervals'][_0x1ef8('0x36')];var _0x5edabf=_0xb8c1e8===_0x927b31[_0x1ef8('0x2f')]['length']-0x1?_0x292064+_0x470557['length']+_0x44f9eb[_0x1ef8('0x36')]+0x2:_0x292064+_0xb8c1e8+0x1;_0x470557['splice'](_0xb8c1e8,0x0,{'type':_0x3d2e0b[_0x1ef8('0x0')],'app':'GotoIfTime','appdata':_0x927b31[_0x1ef8('0x2f')][_0xb8c1e8]+'?'+_0x3d2e0b[_0x1ef8('0x2')]+_0x1ef8('0x47')+_0x77bbad+':'+_0x3d2e0b['context']+_0x1ef8('0x47')+_0x5edabf,'exten':_0x3d2e0b[_0x1ef8('0x3')],'context':_0x3d2e0b[_0x1ef8('0x2')],'priority':_0x292064+_0xb8c1e8,'VoiceExtensionId':_0x3d2e0b['id']});}if(_0x927b31[_0x1ef8('0x41')]==='outboundDial'){_0x927b31['appdata']=_0x57ae5c(_0x3d2e0b,_0x927b31[_0x1ef8('0x48')]);}if(_0x927b31[_0x1ef8('0x41')]===_0x1ef8('0x49')){_0x470557[_0x1ef8('0x35')]({'type':_0x927b31[_0x1ef8('0x0')][_0x1ef8('0x32')](),'app':_0x1ef8('0x1'),'appdata':_0x1ef8('0x4a'),'context':_0x3d2e0b[_0x1ef8('0x2')],'exten':_0x3d2e0b[_0x1ef8('0x3')],'priority':_0x927b31[_0x1ef8('0x2f')]['length']+_0x292064+_0x137645++,'VoiceExtensionId':_0x3d2e0b['id']});}_0x927b31[_0x1ef8('0x4b')]=_0x470557['length']?_[_0x1ef8('0x4c')](_0x470557)[_0x1ef8('0x4b')]+0x1:_0x292064;_0x40634b=_[_0x1ef8('0x4d')](_0x40634b,_0x470557,[_0x927b31],_0x44f9eb);_0x292064=_[_0x1ef8('0x4c')](_0x40634b)[_0x1ef8('0x4b')]+0x1;}return _0x135110(_0x40634b);})[_0x1ef8('0x4e')](function(_0x19783d){_0x3af16f(_0x19783d);});});}return _0x40f4f8[_0x1ef8('0x4f')](_0x1ef8('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x486db0){var _0x4b4d8d=this[_0x1ef8('0x51')]({'plain':!![]});var _0x55d1ef=_0x4b4d8d['type']===_0x1ef8('0xc')?_0xafb7fd(_0x4b4d8d):_0x1c42b0(_0x4b4d8d);return _0x4996d6(_0x4b4d8d,_0x486db0,_['last'](_0x55d1ef)[_0x1ef8('0x4b')]+0x1)['then'](function(_0x4eca9f){var _0x14933c=_[_0x1ef8('0x4d')](_0x55d1ef,_0x4eca9f);_0x14933c['push']({'type':_0x4b4d8d[_0x1ef8('0x0')],'app':_0x1ef8('0x52'),'exten':_0x4b4d8d[_0x1ef8('0x3')],'context':_0x4b4d8d['context'],'priority':_[_0x1ef8('0x4c')](_0x14933c)['priority']+0x1,'VoiceExtensionId':_0x4b4d8d['id']});return _0x14933c;});}}});}; \ No newline at end of file +var _0x6753=['models','type','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','${EXTEN:','cutdigits','${EXTEN}','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','split','length','name','trunk','param','prefix','phone','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','playback','app','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','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6753,0xa1));var _0x3675=function(_0x59e039,_0xc0dcb9){_0x59e039=_0x59e039-0x0;var _0x3b37fe=_0x6753[_0x59e039];return _0x3b37fe;};'use strict';var _=require(_0x3675('0x0'));var attributes=require(_0x3675('0x1'));module[_0x3675('0x2')]=function(_0x2835a4){var _0x485956=_0x2835a4[_0x3675('0x3')];function _0x461046(_0x5966cb){var _0x2c892a=0x2;var _0x2b2c83=[{'type':_0x5966cb['type'],'app':'Set','appdata':'CDR(type)='+_0x5966cb[_0x3675('0x4')],'context':_0x5966cb[_0x3675('0x5')],'exten':_0x5966cb[_0x3675('0x6')],'priority':_0x2c892a++,'VoiceExtensionId':_0x5966cb['id']},{'type':_0x5966cb[_0x3675('0x4')],'app':_0x5966cb[_0x3675('0x7')]?_0x3675('0x8'):_0x3675('0x9'),'appdata':_0x5966cb[_0x3675('0x7')]?_0x3675('0xa')+_0x5966cb[_0x3675('0x7')]:_0x3675('0xb'),'context':_0x5966cb[_0x3675('0x5')],'exten':_0x5966cb[_0x3675('0x6')],'priority':_0x2c892a++,'VoiceExtensionId':_0x5966cb['id']}];if(_0x5966cb[_0x3675('0x4')]==='inbound'){_0x2b2c83[_0x3675('0xc')]({'type':_0x3675('0xd'),'app':'Set','appdata':_0x3675('0xe')+_0x5966cb['id'],'context':_0x5966cb[_0x3675('0x5')],'exten':_0x5966cb[_0x3675('0x6')],'priority':_0x2c892a++,'VoiceExtensionId':_0x5966cb['id']});}_0x2b2c83[_0x3675('0xc')]({'type':_0x5966cb[_0x3675('0x4')],'app':_0x3675('0x8'),'appdata':_0x3675('0xf'),'context':_0x5966cb['context'],'exten':_0x5966cb[_0x3675('0x6')],'priority':_0x2c892a++,'VoiceExtensionId':_0x5966cb['id']},{'type':_0x5966cb[_0x3675('0x4')],'app':_0x3675('0x8'),'appdata':_0x3675('0x10'),'context':_0x5966cb['context'],'exten':_0x5966cb[_0x3675('0x6')],'priority':_0x2c892a++,'VoiceExtensionId':_0x5966cb['id']},{'type':_0x5966cb[_0x3675('0x4')],'app':_0x3675('0x8'),'appdata':_0x3675('0x11'),'context':_0x5966cb['context'],'exten':_0x5966cb[_0x3675('0x6')],'priority':_0x2c892a++,'VoiceExtensionId':_0x5966cb['id']});return _0x2b2c83;}function _0x4c4017(_0x3cf655){var _0x22e7ce=0x2;var _0x2adb30=[{'type':'outbound','app':_0x3675('0x8'),'appdata':_0x3675('0x12'),'context':_0x3cf655['context'],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':'outbound','app':_0x3cf655[_0x3675('0x7')]?_0x3675('0x8'):'NoOp','appdata':_0x3cf655['alias']?_0x3675('0xa')+_0x3cf655[_0x3675('0x7')]:_0x3675('0xb'),'context':_0x3cf655['context'],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':_0x3675('0x13'),'app':'Set','appdata':'CDR(destination)='+(_0x3cf655['cutdigits']?_0x3675('0x14')+_0x3cf655[_0x3675('0x15')]+'}':_0x3675('0x16')),'context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':_0x3675('0x13'),'app':_0x3675('0x8'),'appdata':_0x3675('0xe')+_0x3cf655['id'],'context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':_0x3675('0x13'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x22e7ce+0x2)+_0x3675('0x17')+(_0x22e7ce+0x1)+')','context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':_0x3675('0x13'),'app':_0x3675('0x8'),'appdata':_0x3cf655['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x3cf655['cutdigits']+'}':_0x3675('0x18'),'context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655['exten'],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':_0x3675('0x13'),'app':_0x3675('0x8'),'appdata':_0x3675('0xf'),'context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655['exten'],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':'outbound','app':_0x3675('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':'outbound','app':_0x3675('0x8'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':_0x3675('0x13'),'app':_0x3675('0x8'),'appdata':'outboundrouteid='+_0x3cf655['id'],'context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']}];if(_0x3cf655['hasOwnProperty'](_0x3675('0x19'))&&_0x3cf655[_0x3675('0x19')]!==_0x3675('0x1a')){_0x2adb30['push']({'type':_0x3675('0x13'),'app':_0x3675('0x8'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']},{'type':_0x3675('0x13'),'app':_0x3675('0x8'),'appdata':_0x3675('0x1b')+_0x3cf655[_0x3675('0x19')]||'wav','context':_0x3cf655[_0x3675('0x5')],'exten':_0x3cf655[_0x3675('0x6')],'priority':_0x22e7ce++,'VoiceExtensionId':_0x3cf655['id']});}return _0x2adb30;}function _0x178355(_0x2fe420,_0x1da58d){var _0x237eb4=[{'name':'trunk','param':0x0},{'name':_0x3675('0x1c'),'param':0x1},{'name':_0x3675('0x1d'),'param':0x2},{'name':_0x3675('0x1e'),'param':0x3}];var _0x522896={};var _0xf5441a=_0x1da58d[_0x3675('0x1f')](',');var _0x4c88c2=[];for(var _0x5164af=0x0;_0x5164af<_0x237eb4[_0x3675('0x20')];_0x5164af++){switch(_0x237eb4[_0x5164af][_0x3675('0x21')]){case'trunk':_0x522896[_0x3675('0x22')]=_0xf5441a[_0x237eb4[_0x5164af][_0x3675('0x23')]][_0x3675('0x1f')]('/')[0x1];_0x522896['phone']=_0xf5441a[_0x237eb4[_0x5164af][_0x3675('0x23')]][_0x3675('0x1f')]('/')[0x2];_0x522896[_0x3675('0x24')]=_0x522896[_0x3675('0x25')]?_0x522896[_0x3675('0x25')]['split']('$')[0x0]:undefined;_0x522896[_0x3675('0x25')]=_0x2fe420['cutdigits']?(_0x522896['prefix']||'')+_0x3675('0x14')+_0x2fe420[_0x3675('0x15')]+'}':(_0x522896[_0x3675('0x24')]||'')+_0x3675('0x16');_0x4c88c2[_0x237eb4[_0x5164af]['param']]=[_0x3675('0x26'),_0x522896[_0x3675('0x22')],_0x522896[_0x3675('0x25')]][_0x3675('0x27')]('/');break;case _0x3675('0x1d'):_0x522896[_0x3675('0x1d')]=_0xf5441a[_0x237eb4[_0x5164af][_0x3675('0x23')]];if(_0x2fe420[_0x3675('0x19')]!==_0x3675('0x1a')){if(_0x522896[_0x3675('0x1d')]['indexOf'](_0x3675('0x28'))<0x0){_0x522896['options']+='U(xcally-mixmonitor-context)';}}else{_0x522896[_0x3675('0x1d')]=_0x522896['options'][_0x3675('0x29')](_0x3675('0x28'),'');}_0x4c88c2[_0x237eb4[_0x5164af]['param']]=_0x522896[_0x3675('0x1d')];break;default:_0x4c88c2[_0x237eb4[_0x5164af]['param']]=_0xf5441a[_0x237eb4[_0x5164af][_0x3675('0x23')]];}}return _0x4c88c2[_0x3675('0x27')](',');}function _0x507ca2(_0x379ea0,_0x157df8,_0x299643){return new Promise(function(_0x44c194,_0x428c08){var _0x50d7fc=[];if(_[_0x3675('0x2a')](_0x157df8))return _0x44c194(_0x50d7fc);_0x485956[_0x3675('0x2b')][_0x3675('0x2c')]({'attributes':['id',_0x3675('0x2d'),'IntervalId'],'raw':!![]})[_0x3675('0x2e')](function(_0x192cb1){for(var _0x19a4d0=0x0,_0x370950=0x0;_0x19a4d0<_0x157df8['length'];_0x19a4d0++,_0x370950=0x0){var _0x4b7f0b=_0x157df8[_0x19a4d0];var _0x362ac7=[];var _0x3e6996=[];delete _0x4b7f0b['id'];if(_0x4b7f0b[_0x3675('0x2d')]!==_0x3675('0x2f')){_0x4b7f0b[_0x3675('0x30')]=[_0x4b7f0b['interval']];}else{_0x4b7f0b[_0x3675('0x30')]=_0x4b7f0b[_0x3675('0x31')]?_[_0x3675('0x32')](_['filter'](_0x192cb1,{'IntervalId':_0x4b7f0b[_0x3675('0x31')]}),_0x3675('0x2d')):[];}_0x4b7f0b[_0x3675('0x5')]=_0x379ea0['context'];_0x4b7f0b[_0x3675('0x6')]=_0x379ea0['exten'];if(_0x4b7f0b[_0x3675('0x4')])_0x4b7f0b[_0x3675('0x4')]=_0x4b7f0b[_0x3675('0x4')][_0x3675('0x33')]();if(_0x379ea0[_0x3675('0x4')]===_0x3675('0x13')){if(_0x4b7f0b[_0x3675('0x34')]('tag')&&_0x4b7f0b[_0x3675('0x35')]&&_0x4b7f0b[_0x3675('0x35')]!=='--'){_0x362ac7['push']({'type':_0x4b7f0b[_0x3675('0x4')]['toLowerCase'](),'app':_0x3675('0x8'),'appdata':_0x3675('0x36')+_0x4b7f0b[_0x3675('0x35')],'context':_0x379ea0[_0x3675('0x5')],'exten':_0x379ea0['exten'],'priority':_0x4b7f0b['intervals'][_0x3675('0x20')]+_0x299643+_0x370950++,'VoiceExtensionId':_0x379ea0['id']});}_0x362ac7[_0x3675('0xc')]({'type':_0x4b7f0b['type']['toLowerCase'](),'app':_0x3675('0x37'),'appdata':_0x3675('0x38')+(_0x4b7f0b[_0x3675('0x39')]?_0x3675('0x3a')+_0x4b7f0b['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x379ea0[_0x3675('0x5')],'exten':_0x379ea0[_0x3675('0x6')],'priority':_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')]+_0x299643+_0x370950++,'VoiceExtensionId':_0x379ea0['id']});}else{if(_0x4b7f0b[_0x3675('0x34')](_0x3675('0x3b'))){if(['queue',_0x3675('0x3c')]['includes'](_0x4b7f0b[_0x3675('0x3d')][_0x3675('0x33')]())&&_0x4b7f0b[_0x3675('0x3e')]!==_0x3675('0x3f')){if(_0x4b7f0b[_0x3675('0x3b')]){_0x362ac7[_0x3675('0xc')]({'type':_0x4b7f0b[_0x3675('0x4')][_0x3675('0x33')](),'app':_0x3675('0x37'),'appdata':_0x3675('0x40'),'context':_0x379ea0[_0x3675('0x5')],'exten':_0x379ea0[_0x3675('0x6')],'priority':_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')]+_0x299643+_0x370950++,'VoiceExtensionId':_0x379ea0['id']});_0x362ac7['push']({'type':_0x4b7f0b[_0x3675('0x4')]['toLowerCase'](),'app':'Set','appdata':_0x3675('0x41'),'context':_0x379ea0[_0x3675('0x5')],'exten':_0x379ea0[_0x3675('0x6')],'priority':_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')]+_0x299643+_0x370950++,'VoiceExtensionId':_0x379ea0['id']});}else{_0x362ac7[_0x3675('0xc')]({'type':_0x4b7f0b[_0x3675('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0x3675('0x42'),'context':_0x379ea0['context'],'exten':_0x379ea0[_0x3675('0x6')],'priority':_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')]+_0x299643+_0x370950++,'VoiceExtensionId':_0x379ea0['id']});_0x362ac7['push']({'type':_0x4b7f0b['type']['toLowerCase'](),'app':_0x3675('0x8'),'appdata':_0x3675('0x43'),'context':_0x379ea0[_0x3675('0x5')],'exten':_0x379ea0[_0x3675('0x6')],'priority':_0x4b7f0b[_0x3675('0x30')]['length']+_0x299643+_0x370950++,'VoiceExtensionId':_0x379ea0['id']});}}}}for(var _0x52cac1=0x0;_0x52cac1<_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')];_0x52cac1++){var _0x23e80e=_0x299643+_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')];var _0x56fa45=_0x52cac1===_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')]-0x1?_0x299643+_0x362ac7[_0x3675('0x20')]+_0x3e6996[_0x3675('0x20')]+0x2:_0x299643+_0x52cac1+0x1;_0x362ac7[_0x3675('0x44')](_0x52cac1,0x0,{'type':_0x379ea0[_0x3675('0x4')],'app':_0x3675('0x45'),'appdata':_0x4b7f0b['intervals'][_0x52cac1]+'?'+_0x379ea0[_0x3675('0x5')]+',${EXTEN},'+_0x23e80e+':'+_0x379ea0[_0x3675('0x5')]+_0x3675('0x46')+_0x56fa45,'exten':_0x379ea0['exten'],'context':_0x379ea0[_0x3675('0x5')],'priority':_0x299643+_0x52cac1,'VoiceExtensionId':_0x379ea0['id']});}if(_0x4b7f0b[_0x3675('0x3e')]===_0x3675('0x47')){_0x4b7f0b['appdata']=_0x178355(_0x379ea0,_0x4b7f0b[_0x3675('0x48')]);}if(_0x4b7f0b['appType']===_0x3675('0x49')){_0x362ac7[_0x3675('0xc')]({'type':_0x4b7f0b[_0x3675('0x4')][_0x3675('0x33')](),'app':_0x3675('0x8'),'appdata':_0x3675('0x4a'),'context':_0x379ea0['context'],'exten':_0x379ea0['exten'],'priority':_0x4b7f0b[_0x3675('0x30')][_0x3675('0x20')]+_0x299643+_0x370950++,'VoiceExtensionId':_0x379ea0['id']});}_0x4b7f0b[_0x3675('0x4b')]=_0x362ac7[_0x3675('0x20')]?_[_0x3675('0x4c')](_0x362ac7)[_0x3675('0x4b')]+0x1:_0x299643;_0x50d7fc=_[_0x3675('0x4d')](_0x50d7fc,_0x362ac7,[_0x4b7f0b],_0x3e6996);_0x299643=_['last'](_0x50d7fc)[_0x3675('0x4b')]+0x1;}return _0x44c194(_0x50d7fc);})['catch'](function(_0x3c679d){_0x428c08(_0x3c679d);});});}return _0x2835a4[_0x3675('0x4e')](_0x3675('0x4f'),attributes,{'tableName':_0x3675('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1db2ab){var _0x45b623=this['get']({'plain':!![]});var _0x50ef1b=_0x45b623[_0x3675('0x4')]==='outbound'?_0x4c4017(_0x45b623):_0x461046(_0x45b623);return _0x507ca2(_0x45b623,_0x1db2ab,_[_0x3675('0x4c')](_0x50ef1b)['priority']+0x1)[_0x3675('0x2e')](function(_0x59902e){var _0x73e3da=_['concat'](_0x50ef1b,_0x59902e);_0x73e3da['push']({'type':_0x45b623[_0x3675('0x4')],'app':_0x3675('0x51'),'exten':_0x45b623[_0x3675('0x6')],'context':_0x45b623[_0x3675('0x5')],'priority':_[_0x3675('0x4c')](_0x73e3da)[_0x3675('0x4b')]+0x1,'VoiceExtensionId':_0x45b623['id']});return _0x73e3da;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index e949572..419f396 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 _0x5398=['include','model','map','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','catch','GetVoiceExtension','VoiceExtension','options','raw','attributes','limit'];(function(_0x506394,_0x481898){var _0x328f68=function(_0x2e9c89){while(--_0x2e9c89){_0x506394['push'](_0x506394['shift']());}};_0x328f68(++_0x481898);}(_0x5398,0xe2));var _0x8539=function(_0x365624,_0xaa19b4){_0x365624=_0x365624-0x0;var _0x396b16=_0x5398[_0x365624];return _0x396b16;};'use strict';var _=require('lodash');var util=require(_0x8539('0x0'));var moment=require(_0x8539('0x1'));var BPromise=require(_0x8539('0x2'));var rs=require(_0x8539('0x3'));var fs=require('fs');var Redis=require(_0x8539('0x4'));var db=require(_0x8539('0x5'))['db'];var utils=require(_0x8539('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8539('0x7'));var jayson=require(_0x8539('0x8'));var client=jayson[_0x8539('0x9')][_0x8539('0xa')]({'port':0x232a});config[_0x8539('0xb')]=_[_0x8539('0xc')](config['redis'],{'host':_0x8539('0xd'),'port':0x18eb});var socket=require(_0x8539('0xe'))(new Redis(config[_0x8539('0xb')]));require(_0x8539('0xf'))[_0x8539('0x10')](socket);function respondWithRpcPromise(_0x219c30,_0x33a30b,_0x7884e2){return new BPromise(function(_0x421b98,_0x3727b3){return client['request'](_0x219c30,_0x7884e2)[_0x8539('0x11')](function(_0x1a5acf){logger[_0x8539('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x33a30b,_0x8539('0x13'));logger[_0x8539('0x14')](_0x8539('0x15'),_0x33a30b,_0x8539('0x13'),JSON['stringify'](_0x1a5acf));if(_0x1a5acf['error']){if(_0x1a5acf[_0x8539('0x16')][_0x8539('0x17')]===0x1f4){logger[_0x8539('0x16')](_0x8539('0x18'),_0x33a30b,_0x1a5acf[_0x8539('0x16')]['message']);return _0x3727b3(_0x1a5acf['error'][_0x8539('0x19')]);}logger[_0x8539('0x16')](_0x8539('0x18'),_0x33a30b,_0x1a5acf[_0x8539('0x16')][_0x8539('0x19')]);return _0x421b98(_0x1a5acf[_0x8539('0x16')][_0x8539('0x19')]);}else{logger['info'](_0x8539('0x18'),_0x33a30b,'request\x20sent');_0x421b98(_0x1a5acf['result']['message']);}})[_0x8539('0x1a')](function(_0x226110){logger[_0x8539('0x16')](_0x8539('0x18'),_0x33a30b,_0x226110);_0x3727b3(_0x226110);});});}exports[_0x8539('0x1b')]=function(_0x324850){var _0x22eead=this;return new Promise(function(_0x1e2a8e,_0x1cce5a){return db[_0x8539('0x1c')]['findAll']({'raw':_0x324850[_0x8539('0x1d')]?_0x324850['options'][_0x8539('0x1e')]===undefined?!![]:![]:!![],'where':_0x324850['options']?_0x324850[_0x8539('0x1d')]['where']||null:null,'attributes':_0x324850[_0x8539('0x1d')]?_0x324850[_0x8539('0x1d')][_0x8539('0x1f')]||null:null,'limit':_0x324850[_0x8539('0x1d')]?_0x324850[_0x8539('0x1d')][_0x8539('0x20')]||null:null,'include':_0x324850[_0x8539('0x1d')]?_0x324850['options'][_0x8539('0x21')]?_['map'](_0x324850['options'][_0x8539('0x21')],function(_0x28792d){return{'model':db[_0x28792d[_0x8539('0x22')]],'as':_0x28792d['as'],'attributes':_0x28792d[_0x8539('0x1f')],'include':_0x28792d['include']?_['map'](_0x28792d[_0x8539('0x21')],function(_0x327fc9){return{'model':db[_0x327fc9['model']],'as':_0x327fc9['as'],'attributes':_0x327fc9[_0x8539('0x1f')],'include':_0x327fc9[_0x8539('0x21')]?_[_0x8539('0x23')](_0x327fc9[_0x8539('0x21')],function(_0x4585ff){return{'model':db[_0x4585ff[_0x8539('0x22')]],'as':_0x4585ff['as'],'attributes':_0x4585ff[_0x8539('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8539('0x11')](function(_0x2a6fba){logger[_0x8539('0x12')](_0x8539('0x1b'),_0x324850);logger[_0x8539('0x14')](_0x8539('0x1b'),_0x324850,JSON[_0x8539('0x24')](_0x2a6fba));_0x1e2a8e(_0x2a6fba);})['catch'](function(_0x7aae36){logger[_0x8539('0x16')](_0x8539('0x1b'),_0x7aae36['message'],_0x324850);_0x1cce5a(_0x22eead[_0x8539('0x16')](0x1f4,_0x7aae36[_0x8539('0x19')]));});});}; \ No newline at end of file +var _0x5a63=['GetVoiceExtension','findAll','options','raw','attributes','limit','include','map','model','then','stringify','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','redis','./voiceExtension.socket','register','request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0xfed474,_0x238d1e){var _0x3b3aab=function(_0xeaa3a3){while(--_0xeaa3a3){_0xfed474['push'](_0xfed474['shift']());}};_0x3b3aab(++_0x238d1e);}(_0x5a63,0xe3));var _0x35a6=function(_0x285786,_0x4715f5){_0x285786=_0x285786-0x0;var _0x2986fa=_0x5a63[_0x285786];return _0x2986fa;};'use strict';var _=require(_0x35a6('0x0'));var util=require(_0x35a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x35a6('0x3'));var logger=require(_0x35a6('0x4'))(_0x35a6('0x5'));var config=require(_0x35a6('0x6'));var jayson=require(_0x35a6('0x7'));var client=jayson['client'][_0x35a6('0x8')]({'port':0x232a});config['redis']=_[_0x35a6('0x9')](config['redis'],{'host':_0x35a6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35a6('0xb')]));require(_0x35a6('0xc'))[_0x35a6('0xd')](socket);function respondWithRpcPromise(_0x44d0d5,_0x1df564,_0x4e4c93){return new BPromise(function(_0x2899a8,_0xf55896){return client[_0x35a6('0xe')](_0x44d0d5,_0x4e4c93)['then'](function(_0x24afc4){logger['info'](_0x35a6('0xf'),_0x1df564,_0x35a6('0x10'));logger[_0x35a6('0x11')](_0x35a6('0x12'),_0x1df564,_0x35a6('0x10'),JSON['stringify'](_0x24afc4));if(_0x24afc4[_0x35a6('0x13')]){if(_0x24afc4[_0x35a6('0x13')][_0x35a6('0x14')]===0x1f4){logger[_0x35a6('0x13')](_0x35a6('0xf'),_0x1df564,_0x24afc4[_0x35a6('0x13')]['message']);return _0xf55896(_0x24afc4[_0x35a6('0x13')][_0x35a6('0x15')]);}logger[_0x35a6('0x13')](_0x35a6('0xf'),_0x1df564,_0x24afc4[_0x35a6('0x13')][_0x35a6('0x15')]);return _0x2899a8(_0x24afc4['error'][_0x35a6('0x15')]);}else{logger[_0x35a6('0x16')](_0x35a6('0xf'),_0x1df564,_0x35a6('0x10'));_0x2899a8(_0x24afc4[_0x35a6('0x17')][_0x35a6('0x15')]);}})[_0x35a6('0x18')](function(_0x5818e0){logger[_0x35a6('0x13')](_0x35a6('0xf'),_0x1df564,_0x5818e0);_0xf55896(_0x5818e0);});});}exports[_0x35a6('0x19')]=function(_0x5d82c0){var _0x3dbf65=this;return new Promise(function(_0x32a260,_0x3183eb){return db['VoiceExtension'][_0x35a6('0x1a')]({'raw':_0x5d82c0[_0x35a6('0x1b')]?_0x5d82c0['options'][_0x35a6('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d82c0[_0x35a6('0x1b')]?_0x5d82c0['options']['where']||null:null,'attributes':_0x5d82c0[_0x35a6('0x1b')]?_0x5d82c0[_0x35a6('0x1b')][_0x35a6('0x1d')]||null:null,'limit':_0x5d82c0[_0x35a6('0x1b')]?_0x5d82c0[_0x35a6('0x1b')][_0x35a6('0x1e')]||null:null,'include':_0x5d82c0[_0x35a6('0x1b')]?_0x5d82c0[_0x35a6('0x1b')][_0x35a6('0x1f')]?_[_0x35a6('0x20')](_0x5d82c0[_0x35a6('0x1b')][_0x35a6('0x1f')],function(_0x5e9a69){return{'model':db[_0x5e9a69[_0x35a6('0x21')]],'as':_0x5e9a69['as'],'attributes':_0x5e9a69[_0x35a6('0x1d')],'include':_0x5e9a69['include']?_['map'](_0x5e9a69[_0x35a6('0x1f')],function(_0x287c0b){return{'model':db[_0x287c0b[_0x35a6('0x21')]],'as':_0x287c0b['as'],'attributes':_0x287c0b['attributes'],'include':_0x287c0b[_0x35a6('0x1f')]?_[_0x35a6('0x20')](_0x287c0b[_0x35a6('0x1f')],function(_0x422ca0){return{'model':db[_0x422ca0['model']],'as':_0x422ca0['as'],'attributes':_0x422ca0[_0x35a6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x35a6('0x22')](function(_0x1bdbe2){logger[_0x35a6('0x16')]('GetVoiceExtension',_0x5d82c0);logger['debug'](_0x35a6('0x19'),_0x5d82c0,JSON[_0x35a6('0x23')](_0x1bdbe2));_0x32a260(_0x1bdbe2);})[_0x35a6('0x18')](function(_0x2a0719){logger[_0x35a6('0x13')](_0x35a6('0x19'),_0x2a0719[_0x35a6('0x15')],_0x5d82c0);_0x3183eb(_0x3dbf65[_0x35a6('0x13')](0x1f4,_0x2a0719[_0x35a6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 0634d0b..ed2cca7 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(_0x387e9e,_0x58c782){var _0x997d37=function(_0x38aeee){while(--_0x38aeee){_0x387e9e['push'](_0x387e9e['shift']());}};_0x997d37(++_0x58c782);}(_0xabce,0x103));var _0xeabc=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xabce[_0xbe200f];return _0x192597;};'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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x1cb9,0x14e));var _0x91cb=function(_0xe3c99a,_0x55c655){_0xe3c99a=_0xe3c99a-0x0;var _0xe66670=_0x1cb9[_0xe3c99a];return _0xe66670;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 63f9ca9..62ae756 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 _0x0adf=['put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','get','/:id','show','/:id/messages','post','create'];(function(_0x57fa8f,_0x128a4e){var _0x16eece=function(_0x4bf30e){while(--_0x4bf30e){_0x57fa8f['push'](_0x57fa8f['shift']());}};_0x16eece(++_0x128a4e);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x5744ed,_0x4693f2){_0x5744ed=_0x5744ed-0x0;var _0x4538d5=_0x0adf[_0x5744ed];return _0x4538d5;};'use strict';var multer=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var path=require(_0xf0ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0ad('0x3'));var router=express[_0xf0ad('0x4')]();var fs_extra=require(_0xf0ad('0x5'));var auth=require(_0xf0ad('0x6'));var interaction=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var controller=require(_0xf0ad('0x9'));router['get']('/',auth[_0xf0ad('0xa')](),controller['index']);router[_0xf0ad('0xb')](_0xf0ad('0xc'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0xd')]);router[_0xf0ad('0xb')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['getMessages']);router[_0xf0ad('0xf')]('/',auth['isAuthenticated'](),controller[_0xf0ad('0x10')]);router[_0xf0ad('0x11')](_0xf0ad('0xc'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x12')]);router['delete']('/:id',auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x13')]);module[_0xf0ad('0x14')]=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','show','/:id/messages','isAuthenticated','getMessages','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x6d0b7d,_0x43a26d){var _0x11ce2e=function(_0x2adf6a){while(--_0x2adf6a){_0x6d0b7d['push'](_0x6d0b7d['shift']());}};_0x11ce2e(++_0x43a26d);}(_0x524e,0x15e));var _0xe524=function(_0x275518,_0x1e1408){_0x275518=_0x275518-0x0;var _0x25bef1=_0x524e[_0x275518];return _0x25bef1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xb'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xb'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index f5d68f3..39b1390 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 _0xb639=['central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim'];(function(_0x39e362,_0x20ed8e){var _0x1d2b0f=function(_0x54b54){while(--_0x54b54){_0x39e362['push'](_0x39e362['shift']());}};_0x1d2b0f(++_0x20ed8e);}(_0xb639,0x14f));var _0x9b63=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0xb639[_0x1e48d3];return _0x2852b1;};'use strict';var Sequelize=require('sequelize');module[_0x9b63('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9b63('0x1')],'defaultValue':'from-voicemail','unique':_0x9b63('0x2')},'mailbox':{'type':Sequelize[_0x9b63('0x1')],'defaultValue':'','allowNull':![],'unique':_0x9b63('0x2')},'password':{'type':Sequelize[_0x9b63('0x1')]},'fullname':{'type':Sequelize[_0x9b63('0x1')]},'email':{'type':Sequelize[_0x9b63('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3f67e6){this[_0x9b63('0x3')](_0x9b63('0x4'),typeof _0x3f67e6===_0x9b63('0x5')&&_0x3f67e6[_0x9b63('0x6')]()?_0x3f67e6['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x9b63('0x1')],'defaultValue':_0x9b63('0x7')},'attach':{'type':Sequelize[_0x9b63('0x8')]('yes','no'),'defaultValue':_0x9b63('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9b63('0x8')](_0x9b63('0x9'),'no'),'defaultValue':_0x9b63('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x9b63('0x1')]},'review':{'type':Sequelize[_0x9b63('0x8')](_0x9b63('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x9b63('0x8')](_0x9b63('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9b63('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x9b63('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x9b63('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9b63('0x8')](_0x9b63('0x9'),'no'),'defaultValue':_0x9b63('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9b63('0x8')](_0x9b63('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9b63('0x8')](_0x9b63('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9b63('0x8')](_0x9b63('0x9'),'no'),'defaultValue':_0x9b63('0x9'),'allowNull':![]},'stamp':{'type':_0x9b63('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x9b63('0x1')]},'maxsecs':{'type':Sequelize[_0x9b63('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9b63('0xd')],'get':function(){return this['getDataValue'](_0x9b63('0xe'))+_0x9b63('0xf')+this[_0x9b63('0x10')](_0x9b63('0x11'));}}}; \ No newline at end of file +var _0xe8cd=['TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes'];(function(_0x366500,_0xcadc8a){var _0x10fc82=function(_0x4bf4f5){while(--_0x4bf4f5){_0x366500['push'](_0x366500['shift']());}};_0x10fc82(++_0xcadc8a);}(_0xe8cd,0x96));var _0xde8c=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xe8cd[_0x4ba380];return _0x4b111b;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xde8c('0x0')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xde8c('0x1'),'unique':_0xde8c('0x2')},'mailbox':{'type':Sequelize[_0xde8c('0x0')],'defaultValue':'','allowNull':![],'unique':_0xde8c('0x2')},'password':{'type':Sequelize[_0xde8c('0x0')]},'fullname':{'type':Sequelize[_0xde8c('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x489f70){this[_0xde8c('0x3')](_0xde8c('0x4'),typeof _0x489f70===_0xde8c('0x5')&&_0x489f70[_0xde8c('0x6')]()?_0x489f70[_0xde8c('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xde8c('0x0')],'defaultValue':_0xde8c('0x7')},'attach':{'type':Sequelize[_0xde8c('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xde8c('0x8')](_0xde8c('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xde8c('0x0')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xde8c('0x8')](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xde8c('0x8')](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xde8c('0x8')](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xde8c('0x8')](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xde8c('0x8')](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xde8c('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xde8c('0x8')](_0xde8c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xde8c('0x8')]('yes','no'),'defaultValue':_0xde8c('0x9'),'allowNull':![]},'stamp':{'type':_0xde8c('0xa')},'emailsubject':{'type':Sequelize[_0xde8c('0x0')]},'emailbody':{'type':Sequelize[_0xde8c('0x0')]},'maxsecs':{'type':Sequelize[_0xde8c('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xde8c('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xde8c('0xc')],'get':function(){return this['getDataValue'](_0xde8c('0xd'))+_0xde8c('0xe')+this['getDataValue'](_0xde8c('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index d540ae6..07f4ea8 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 _0x76dc=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','VoiceMail','fieldName','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','rawAttributes','sort','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x34c085,_0x47624b){var _0x9f7dc2=function(_0x3fcbed){while(--_0x3fcbed){_0x34c085['push'](_0x34c085['shift']());}};_0x9f7dc2(++_0x47624b);}(_0x76dc,0x1f2));var _0xc76d=function(_0x5b98be,_0x3a1e8d){_0x5b98be=_0x5b98be-0x0;var _0x426324=_0x76dc[_0x5b98be];return _0x426324;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){var _0x637d68=_0x11b42f[_0xc76d('0x26')]({'plain':!![]});var _0x55ca79=_0xc76d('0x27');return db[_0xc76d('0x28')][_0xc76d('0x25')]({'where':{'type':_0x55ca79,'resourceId':_0x637d68['id']}})[_0xc76d('0x24')](function(){return _0x11b42f;});})[_0xc76d('0x24')](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x59ebd1,_0x59dabf){return function(_0x285430){if(!_0x285430){_0x59ebd1[_0xc76d('0x17')](0x194);}return _0x285430;};}function handleError(_0x5069ea,_0x31501a){_0x31501a=_0x31501a||0x1f4;return function(_0x52a79a){logger[_0xc76d('0x29')](_0x52a79a['stack']);if(_0x52a79a[_0xc76d('0x2a')]){delete _0x52a79a['name'];}_0x5069ea[_0xc76d('0x18')](_0x31501a)[_0xc76d('0x2b')](_0x52a79a);};}exports['index']=function(_0x3d4076,_0x1c68f3){var _0x9ab96c={},_0x2cf501={},_0x4feeda={'count':0x0,'rows':[]};var _0x283e16=_['map'](db[_0xc76d('0x2c')]['rawAttributes'],function(_0x30769f){return{'name':_0x30769f[_0xc76d('0x2d')],'type':_0x30769f['type']['key']};});_0x2cf501['model']=_['map'](_0x283e16,_0xc76d('0x2a'));_0x2cf501[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x3d4076[_0xc76d('0x2e')]);_0x2cf501[_0xc76d('0x30')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],_0x2cf501['query']);_0x9ab96c[_0xc76d('0x32')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x9ab96c[_0xc76d('0x32')]=_0x9ab96c['attributes'][_0xc76d('0x34')]?_0x9ab96c[_0xc76d('0x32')]:_0x2cf501[_0xc76d('0x31')];if(!_0x3d4076['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x9ab96c[_0xc76d('0x1d')]=qs['limit'](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1d')]);_0x9ab96c[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x9ab96c['order']=qs['sort'](_0x3d4076[_0xc76d('0x2e')]['sort']);_0x9ab96c[_0xc76d('0x37')]=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x3d4076[_0xc76d('0x2e')],_0x2cf501['filters']),_0x283e16);if(_0x3d4076['query'][_0xc76d('0x39')]){_0x9ab96c[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x9ab96c[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x283e16,function(_0x58c724){if(_0x58c724[_0xc76d('0x3c')]!==_0xc76d('0x3d')){var _0x321989={};_0x321989[_0x58c724[_0xc76d('0x2a')]]={'$like':'%'+_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x321989;}})});}_0x9ab96c=_[_0xc76d('0x3a')]({},_0x9ab96c,_0x3d4076[_0xc76d('0x3e')]);var _0x305f7d={'where':_0x9ab96c[_0xc76d('0x37')]};return db['VoiceMail']['count'](_0x305f7d)[_0xc76d('0x24')](function(_0x2a0759){_0x4feeda[_0xc76d('0x1b')]=_0x2a0759;if(_0x3d4076[_0xc76d('0x2e')]['includeAll']){_0x9ab96c['include']=[{'all':!![]}];}return db[_0xc76d('0x2c')][_0xc76d('0x3f')](_0x9ab96c);})[_0xc76d('0x24')](function(_0x15eb42){_0x4feeda[_0xc76d('0x40')]=_0x15eb42;return _0x4feeda;})[_0xc76d('0x24')](respondWithFilteredResult(_0x1c68f3,_0x9ab96c))[_0xc76d('0x41')](handleError(_0x1c68f3,null));};exports[_0xc76d('0x42')]=function(_0x50e922,_0x7bf0){var _0x95193f={'raw':!![],'where':{'id':_0x50e922[_0xc76d('0x43')]['id']}},_0x1bf8a0={};_0x1bf8a0['model']=_['keys'](db['VoiceMail']['rawAttributes']);_0x1bf8a0['query']=_['keys'](_0x50e922['query']);_0x1bf8a0[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],_0x1bf8a0[_0xc76d('0x2e')]);_0x95193f[_0xc76d('0x32')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x50e922['query'][_0xc76d('0x33')]));_0x95193f[_0xc76d('0x32')]=_0x95193f[_0xc76d('0x32')][_0xc76d('0x34')]?_0x95193f[_0xc76d('0x32')]:_0x1bf8a0[_0xc76d('0x31')];if(_0x50e922[_0xc76d('0x2e')][_0xc76d('0x45')]){_0x95193f[_0xc76d('0x46')]=[{'all':!![]}];}_0x95193f=_['merge']({},_0x95193f,_0x50e922['options']);return db[_0xc76d('0x2c')][_0xc76d('0x47')](_0x95193f)[_0xc76d('0x24')](handleEntityNotFound(_0x7bf0,null))[_0xc76d('0x24')](respondWithResult(_0x7bf0,null))[_0xc76d('0x41')](handleError(_0x7bf0,null));};exports['create']=function(_0x25fc9d,_0x1ede13){return db['VoiceMail']['create'](_0x25fc9d[_0xc76d('0x48')],{})[_0xc76d('0x24')](function(_0x48cad0){var _0xe44a25=_0x25fc9d[_0xc76d('0x49')][_0xc76d('0x26')]({'plain':!![]});if(!_0xe44a25)throw new Error(_0xc76d('0x4a'));if(_0xe44a25[_0xc76d('0x4b')]===_0xc76d('0x49')){var _0x25a549=_0x48cad0[_0xc76d('0x26')]({'plain':!![]});var _0x4452a8=_0xc76d('0x27');return db['UserProfileSection'][_0xc76d('0x47')]({'where':{'name':_0x4452a8,'userProfileId':_0xe44a25[_0xc76d('0x4c')]},'raw':!![]})[_0xc76d('0x24')](function(_0x55e3af){if(_0x55e3af&&_0x55e3af[_0xc76d('0x4d')]===0x0){return db[_0xc76d('0x28')]['create']({'name':_0x25a549[_0xc76d('0x2a')],'resourceId':_0x25a549['id'],'type':_0x55e3af['name'],'sectionId':_0x55e3af['id']},{})[_0xc76d('0x24')](function(){return _0x48cad0;});}else{return _0x48cad0;}})[_0xc76d('0x41')](function(_0x316978){logger[_0xc76d('0x29')](_0xc76d('0x4e'),_0x316978);throw _0x316978;});}return _0x48cad0;})['then'](respondWithResult(_0x1ede13,0xc9))['catch'](handleError(_0x1ede13,null));};exports['update']=function(_0x320483,_0x746759){if(_0x320483[_0xc76d('0x48')]['id']){delete _0x320483[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x320483['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x746759,null))[_0xc76d('0x24')](saveUpdates(_0x320483[_0xc76d('0x48')],null))[_0xc76d('0x24')](respondWithResult(_0x746759,null))[_0xc76d('0x41')](handleError(_0x746759,null));};exports['destroy']=function(_0x275dfd,_0x463cbe){return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x275dfd[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x463cbe,null))['then'](removeEntity(_0x463cbe,null))[_0xc76d('0x41')](handleError(_0x463cbe,null));};exports[_0xc76d('0x4f')]=function(_0x49105d,_0x5f3973,_0x1e9461){return db['VoiceMail'][_0xc76d('0x50')]({'where':{'id':_0x49105d[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x5f3973,null))[_0xc76d('0x24')](function(_0x254128){var _0x4746a5;var _0x106c85={},_0x1db7bc={};_0x1db7bc[_0xc76d('0x31')]=_[_0xc76d('0x2f')](db[_0xc76d('0x51')][_0xc76d('0x52')]);_0x1db7bc[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x49105d['query']);_0x1db7bc[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1db7bc[_0xc76d('0x31')],_0x1db7bc[_0xc76d('0x2e')]);_0x106c85[_0xc76d('0x32')]=_['intersection'](_0x1db7bc[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x49105d['query']['fields']));_0x106c85['attributes']=_0x106c85[_0xc76d('0x32')][_0xc76d('0x34')]?_0x106c85[_0xc76d('0x32')]:_0x1db7bc[_0xc76d('0x31')];if(!_0x49105d[_0xc76d('0x2e')][_0xc76d('0x35')](_0xc76d('0x36'))){_0x106c85[_0xc76d('0x1d')]=qs['limit'](_0x49105d[_0xc76d('0x2e')]['limit']);_0x106c85['offset']=qs[_0xc76d('0x1c')](_0x49105d[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x106c85['order']=qs[_0xc76d('0x53')](_0x49105d['query']['sort']);_0x106c85['where']=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x49105d['query'],_0x1db7bc[_0xc76d('0x30')]));if(_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]){_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x106c85['attributes'],function(_0x5035fd){var _0x4c523f={};_0x4c523f[_0x5035fd]={'$like':'%'+_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x4c523f;})});}_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'mailboxuser':_0x254128['mailbox']});_0x106c85=_[_0xc76d('0x3a')]({},_0x106c85,_0x49105d[_0xc76d('0x3e')]);return db[_0xc76d('0x51')][_0xc76d('0x54')](_0x106c85)[_0xc76d('0x24')](respondWithFilteredResult(_0x5f3973,_0x106c85));})[_0xc76d('0x41')](handleError(_0x5f3973,null));}; \ No newline at end of file +var _0xda3f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Voicemails','UserProfileResource','destroy','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','length','mailbox','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x588a16,_0x484c4f){var _0x46fdf9=function(_0x2bf80e){while(--_0x2bf80e){_0x588a16['push'](_0x588a16['shift']());}};_0x46fdf9(++_0x484c4f);}(_0xda3f,0xec));var _0xfda3=function(_0x38bdf8,_0x5842ee){_0x38bdf8=_0x38bdf8-0x0;var _0x5bb8e2=_0xda3f[_0x38bdf8];return _0x5bb8e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){var _0x2d5b44=_0x16eaa6[_0xfda3('0x24')]({'plain':!![]});var _0x4ae9b9=_0xfda3('0x25');return db[_0xfda3('0x26')][_0xfda3('0x27')]({'where':{'type':_0x4ae9b9,'resourceId':_0x2d5b44['id']}})[_0xfda3('0x23')](function(){return _0x16eaa6;});})[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6d7d,_0x1e87fe){return function(_0x2bef2b){if(!_0x2bef2b){_0x3c6d7d[_0xfda3('0x17')](0x194);}return _0x2bef2b;};}function handleError(_0x33ffd4,_0x5704c7){_0x5704c7=_0x5704c7||0x1f4;return function(_0x3c1549){logger[_0xfda3('0x28')](_0x3c1549[_0xfda3('0x29')]);if(_0x3c1549[_0xfda3('0x2a')]){delete _0x3c1549[_0xfda3('0x2a')];}_0x33ffd4[_0xfda3('0x18')](_0x5704c7)[_0xfda3('0x2b')](_0x3c1549);};}exports['index']=function(_0x56ca3a,_0x3aef3c){var _0x4fd277={},_0x4b9d90={},_0x16b4a2={'count':0x0,'rows':[]};var _0x2a5971=_[_0xfda3('0x2c')](db[_0xfda3('0x2d')][_0xfda3('0x2e')],function(_0x35ec7a){return{'name':_0x35ec7a[_0xfda3('0x2f')],'type':_0x35ec7a[_0xfda3('0x30')][_0xfda3('0x31')]};});_0x4b9d90['model']=_[_0xfda3('0x2c')](_0x2a5971,_0xfda3('0x2a'));_0x4b9d90[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x56ca3a[_0xfda3('0x32')]);_0x4b9d90[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x4b9d90[_0xfda3('0x36')],_0x4b9d90[_0xfda3('0x32')]);_0x4fd277['attributes']=_['intersection'](_0x4b9d90[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x56ca3a['query'][_0xfda3('0x37')]));_0x4fd277[_0xfda3('0x38')]=_0x4fd277[_0xfda3('0x38')]['length']?_0x4fd277[_0xfda3('0x38')]:_0x4b9d90[_0xfda3('0x36')];if(!_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4fd277['limit']=qs[_0xfda3('0x1b')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x1b')]);_0x4fd277['offset']=qs[_0xfda3('0x19')](_0x56ca3a['query'][_0xfda3('0x19')]);}_0x4fd277[_0xfda3('0x3b')]=qs[_0xfda3('0x3c')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3c')]);_0x4fd277[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x56ca3a['query'],_0x4b9d90[_0xfda3('0x34')]),_0x2a5971);if(_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4fd277[_0xfda3('0x3d')]=_['merge'](_0x4fd277[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x2a5971,function(_0x590ba5){if(_0x590ba5['type']!=='VIRTUAL'){var _0x31b173={};_0x31b173[_0x590ba5[_0xfda3('0x2a')]]={'$like':'%'+_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]+'%'};return _0x31b173;}})});}_0x4fd277=_[_0xfda3('0x40')]({},_0x4fd277,_0x56ca3a[_0xfda3('0x41')]);var _0x40b814={'where':_0x4fd277[_0xfda3('0x3d')]};return db[_0xfda3('0x2d')][_0xfda3('0x1c')](_0x40b814)['then'](function(_0x27200f){_0x16b4a2[_0xfda3('0x1c')]=_0x27200f;if(_0x56ca3a['query'][_0xfda3('0x42')]){_0x4fd277['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x4fd277);})[_0xfda3('0x23')](function(_0x107fb1){_0x16b4a2[_0xfda3('0x43')]=_0x107fb1;return _0x16b4a2;})[_0xfda3('0x23')](respondWithFilteredResult(_0x3aef3c,_0x4fd277))['catch'](handleError(_0x3aef3c,null));};exports[_0xfda3('0x44')]=function(_0x25b9a6,_0x154ae7){var _0x2ce504={'raw':!![],'where':{'id':_0x25b9a6[_0xfda3('0x45')]['id']}},_0x564ccd={};_0x564ccd[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMail']['rawAttributes']);_0x564ccd[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x25b9a6[_0xfda3('0x32')]);_0x564ccd[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],_0x564ccd[_0xfda3('0x32')]);_0x2ce504[_0xfda3('0x38')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x37')]));_0x2ce504[_0xfda3('0x38')]=_0x2ce504['attributes']['length']?_0x2ce504[_0xfda3('0x38')]:_0x564ccd[_0xfda3('0x36')];if(_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x42')]){_0x2ce504[_0xfda3('0x46')]=[{'all':!![]}];}_0x2ce504=_[_0xfda3('0x40')]({},_0x2ce504,_0x25b9a6[_0xfda3('0x41')]);return db[_0xfda3('0x2d')][_0xfda3('0x47')](_0x2ce504)[_0xfda3('0x23')](handleEntityNotFound(_0x154ae7,null))['then'](respondWithResult(_0x154ae7,null))[_0xfda3('0x48')](handleError(_0x154ae7,null));};exports[_0xfda3('0x49')]=function(_0x481356,_0x36aa3a){return db[_0xfda3('0x2d')]['create'](_0x481356[_0xfda3('0x4a')],{})[_0xfda3('0x23')](function(_0x15eb87){var _0x4bcd2b=_0x481356[_0xfda3('0x4b')][_0xfda3('0x24')]({'plain':!![]});if(!_0x4bcd2b)throw new Error(_0xfda3('0x4c'));if(_0x4bcd2b['role']===_0xfda3('0x4b')){var _0x33565d=_0x15eb87[_0xfda3('0x24')]({'plain':!![]});var _0x2f6e62=_0xfda3('0x25');return db['UserProfileSection'][_0xfda3('0x47')]({'where':{'name':_0x2f6e62,'userProfileId':_0x4bcd2b['userProfileId']},'raw':!![]})[_0xfda3('0x23')](function(_0x587eef){if(_0x587eef&&_0x587eef[_0xfda3('0x4d')]===0x0){return db[_0xfda3('0x26')][_0xfda3('0x49')]({'name':_0x33565d[_0xfda3('0x2a')],'resourceId':_0x33565d['id'],'type':_0x587eef['name'],'sectionId':_0x587eef['id']},{})[_0xfda3('0x23')](function(){return _0x15eb87;});}else{return _0x15eb87;}})[_0xfda3('0x48')](function(_0x2f2c32){logger[_0xfda3('0x28')](_0xfda3('0x4e'),_0x2f2c32);throw _0x2f2c32;});}return _0x15eb87;})[_0xfda3('0x23')](respondWithResult(_0x36aa3a,0xc9))[_0xfda3('0x48')](handleError(_0x36aa3a,null));};exports['update']=function(_0x4b1410,_0x4fb214){if(_0x4b1410[_0xfda3('0x4a')]['id']){delete _0x4b1410[_0xfda3('0x4a')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x4b1410[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x4fb214,null))[_0xfda3('0x23')](saveUpdates(_0x4b1410[_0xfda3('0x4a')],null))[_0xfda3('0x23')](respondWithResult(_0x4fb214,null))['catch'](handleError(_0x4fb214,null));};exports[_0xfda3('0x27')]=function(_0x2a30e8,_0x167424){return db[_0xfda3('0x2d')][_0xfda3('0x47')]({'where':{'id':_0x2a30e8[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x167424,null))[_0xfda3('0x23')](removeEntity(_0x167424,null))[_0xfda3('0x48')](handleError(_0x167424,null));};exports[_0xfda3('0x4f')]=function(_0x3ed7c1,_0x1fa27a,_0x5b426b){return db[_0xfda3('0x2d')][_0xfda3('0x50')]({'where':{'id':_0x3ed7c1[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x1fa27a,null))[_0xfda3('0x23')](function(_0x405d7e){var _0x42c7a1;var _0x4ce31c={},_0x5a3a6f={};_0x5a3a6f[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMailMessage'][_0xfda3('0x2e')]);_0x5a3a6f[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x3ed7c1[_0xfda3('0x32')]);_0x5a3a6f['filters']=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],_0x5a3a6f[_0xfda3('0x32')]);_0x4ce31c[_0xfda3('0x38')]=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],qs['fields'](_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x37')]));_0x4ce31c[_0xfda3('0x38')]=_0x4ce31c[_0xfda3('0x38')][_0xfda3('0x51')]?_0x4ce31c[_0xfda3('0x38')]:_0x5a3a6f['model'];if(!_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4ce31c[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3ed7c1['query']['limit']);_0x4ce31c[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3ed7c1['query']['offset']);}_0x4ce31c['order']=qs[_0xfda3('0x3c')](_0x3ed7c1[_0xfda3('0x32')]['sort']);_0x4ce31c[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x3ed7c1[_0xfda3('0x32')],_0x5a3a6f['filters']));if(_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x4ce31c['attributes'],function(_0x4e312d){var _0x31d657={};_0x31d657[_0x4e312d]={'$like':'%'+_0x3ed7c1['query'][_0xfda3('0x3f')]+'%'};return _0x31d657;})});}_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'mailboxuser':_0x405d7e[_0xfda3('0x52')]});_0x4ce31c=_[_0xfda3('0x40')]({},_0x4ce31c,_0x3ed7c1[_0xfda3('0x41')]);return db[_0xfda3('0x53')][_0xfda3('0x54')](_0x4ce31c)[_0xfda3('0x23')](respondWithFilteredResult(_0x1fa27a,_0x4ce31c));})['catch'](handleError(_0x1fa27a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 305c17a..ae842e7 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 _0xabc6=['voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail'];(function(_0x16fe4c,_0x1aff08){var _0x33bfa6=function(_0x5a79e6){while(--_0x5a79e6){_0x16fe4c['push'](_0x16fe4c['shift']());}};_0x33bfa6(++_0x1aff08);}(_0xabc6,0xb9));var _0x6abc=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0xabc6[_0x1663ae];return _0x30ffb8;};'use strict';var _=require(_0x6abc('0x0'));var util=require(_0x6abc('0x1'));var logger=require(_0x6abc('0x2'))('api');var moment=require(_0x6abc('0x3'));var BPromise=require('bluebird');var rp=require(_0x6abc('0x4'));var fs=require('fs');var path=require(_0x6abc('0x5'));var rimraf=require('rimraf');var config=require(_0x6abc('0x6'));var attributes=require(_0x6abc('0x7'));module[_0x6abc('0x8')]=function(_0x4521a5,_0x443b4b){return _0x4521a5[_0x6abc('0x9')](_0x6abc('0xa'),attributes,{'tableName':_0x6abc('0xb'),'paranoid':![],'indexes':[{'name':_0x6abc('0xc'),'fields':['mailbox',_0x6abc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x311d=['mailbox_context','mailbox','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','VoiceMail','voice_voicemail'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0x311d,0x120));var _0xd311=function(_0x347129,_0x573de1){_0x347129=_0x347129-0x0;var _0x105435=_0x311d[_0x347129];return _0x105435;};'use strict';var _=require(_0xd311('0x0'));var util=require(_0xd311('0x1'));var logger=require(_0xd311('0x2'))('api');var moment=require(_0xd311('0x3'));var BPromise=require('bluebird');var rp=require(_0xd311('0x4'));var fs=require('fs');var path=require(_0xd311('0x5'));var rimraf=require(_0xd311('0x6'));var config=require(_0xd311('0x7'));var attributes=require(_0xd311('0x8'));module['exports']=function(_0x1e7c2e,_0x456cac){return _0x1e7c2e['define'](_0xd311('0x9'),attributes,{'tableName':_0xd311('0xa'),'paranoid':![],'indexes':[{'name':_0xd311('0xb'),'fields':[_0xd311('0xc'),'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 8f19865..c192a5c 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 _0x2c8d=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x2c8d,0x7f));var _0xd2c8=function(_0x1d6e68,_0x47f9fc){_0x1d6e68=_0x1d6e68-0x0;var _0x1d1885=_0x2c8d[_0x1d6e68];return _0x1d1885;};'use strict';var _=require(_0xd2c8('0x0'));var util=require(_0xd2c8('0x1'));var moment=require('moment');var BPromise=require(_0xd2c8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2c8('0x4'));var logger=require('../../config/logger')(_0xd2c8('0x5'));var config=require(_0xd2c8('0x6'));var jayson=require(_0xd2c8('0x7'));var client=jayson['client'][_0xd2c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc0a8,_0x173eae,_0xdd13d9){return new BPromise(function(_0x348034,_0x1330af){return client[_0xd2c8('0x9')](_0x3dc0a8,_0xdd13d9)[_0xd2c8('0xa')](function(_0x55af2b){logger[_0xd2c8('0xb')](_0xd2c8('0xc'),_0x173eae,_0xd2c8('0xd'));logger[_0xd2c8('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x173eae,_0xd2c8('0xd'),JSON[_0xd2c8('0xf')](_0x55af2b));if(_0x55af2b[_0xd2c8('0x10')]){if(_0x55af2b['error']['code']===0x1f4){logger[_0xd2c8('0x10')](_0xd2c8('0xc'),_0x173eae,_0x55af2b[_0xd2c8('0x10')]['message']);return _0x1330af(_0x55af2b[_0xd2c8('0x10')][_0xd2c8('0x11')]);}logger[_0xd2c8('0x10')](_0xd2c8('0xc'),_0x173eae,_0x55af2b[_0xd2c8('0x10')][_0xd2c8('0x11')]);return _0x348034(_0x55af2b[_0xd2c8('0x10')]['message']);}else{logger['info'](_0xd2c8('0xc'),_0x173eae,_0xd2c8('0xd'));_0x348034(_0x55af2b[_0xd2c8('0x12')][_0xd2c8('0x11')]);}})[_0xd2c8('0x13')](function(_0x55dc3b){logger[_0xd2c8('0x10')](_0xd2c8('0xc'),_0x173eae,_0x55dc3b);_0x1330af(_0x55dc3b);});});} \ No newline at end of file +var _0xe508=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0xe508,0x108));var _0x8e50=function(_0x14f017,_0x5a01d4){_0x14f017=_0x14f017-0x0;var _0x215004=_0xe508[_0x14f017];return _0x215004;};'use strict';var _=require(_0x8e50('0x0'));var util=require(_0x8e50('0x1'));var moment=require(_0x8e50('0x2'));var BPromise=require(_0x8e50('0x3'));var rs=require(_0x8e50('0x4'));var fs=require('fs');var Redis=require(_0x8e50('0x5'));var db=require(_0x8e50('0x6'))['db'];var utils=require(_0x8e50('0x7'));var logger=require(_0x8e50('0x8'))(_0x8e50('0x9'));var config=require(_0x8e50('0xa'));var jayson=require(_0x8e50('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59f98a,_0x14ad44,_0x18ff7f){return new BPromise(function(_0x54db8c,_0x397607){return client[_0x8e50('0xc')](_0x59f98a,_0x18ff7f)[_0x8e50('0xd')](function(_0x52969f){logger[_0x8e50('0xe')](_0x8e50('0xf'),_0x14ad44,'request\x20sent');logger['debug'](_0x8e50('0x10'),_0x14ad44,_0x8e50('0x11'),JSON['stringify'](_0x52969f));if(_0x52969f['error']){if(_0x52969f[_0x8e50('0x12')]['code']===0x1f4){logger[_0x8e50('0x12')](_0x8e50('0xf'),_0x14ad44,_0x52969f[_0x8e50('0x12')][_0x8e50('0x13')]);return _0x397607(_0x52969f[_0x8e50('0x12')][_0x8e50('0x13')]);}logger[_0x8e50('0x12')](_0x8e50('0xf'),_0x14ad44,_0x52969f['error'][_0x8e50('0x13')]);return _0x54db8c(_0x52969f[_0x8e50('0x12')][_0x8e50('0x13')]);}else{logger[_0x8e50('0xe')](_0x8e50('0xf'),_0x14ad44,'request\x20sent');_0x54db8c(_0x52969f[_0x8e50('0x14')]['message']);}})[_0x8e50('0x15')](function(_0x5abbbd){logger[_0x8e50('0x12')](_0x8e50('0xf'),_0x14ad44,_0x5abbbd);_0x397607(_0x5abbbd);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d82c548..7ea2636 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 _0xd883=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','get','/:id/download','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra'];(function(_0xfabf98,_0x5c04bf){var _0x4a0bc6=function(_0x2fa9de){while(--_0x2fa9de){_0xfabf98['push'](_0xfabf98['shift']());}};_0x4a0bc6(++_0x5c04bf);}(_0xd883,0xcd));var _0x3d88=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xd883[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0x3d88('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3d88('0x1'));var express=require(_0x3d88('0x2'));var router=express['Router']();var fs_extra=require(_0x3d88('0x3'));var auth=require(_0x3d88('0x4'));var interaction=require(_0x3d88('0x5'));var config=require(_0x3d88('0x6'));var controller=require(_0x3d88('0x7'));router['get']('/',auth[_0x3d88('0x8')](),controller['index']);router[_0x3d88('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x3d88('0xa'),auth[_0x3d88('0x8')](),controller['download']);router[_0x3d88('0xb')]('/',auth[_0x3d88('0x8')](),controller[_0x3d88('0xc')]);router[_0x3d88('0xd')](_0x3d88('0xe'),auth[_0x3d88('0x8')](),controller[_0x3d88('0xf')]);router[_0x3d88('0x10')]('/:id',auth[_0x3d88('0x8')](),controller[_0x3d88('0x11')]);module[_0x3d88('0x12')]=router; \ No newline at end of file +var _0x37d3=['/:id/download','download','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2c1073,_0x1b4938){var _0x3f794e=function(_0x45b24f){while(--_0x45b24f){_0x2c1073['push'](_0x2c1073['shift']());}};_0x3f794e(++_0x1b4938);}(_0x37d3,0x1bc));var _0x337d=function(_0xbd5a3f,_0x502afe){_0xbd5a3f=_0xbd5a3f-0x0;var _0x23db9c=_0x37d3[_0xbd5a3f];return _0x23db9c;};'use strict';var multer=require(_0x337d('0x0'));var util=require(_0x337d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x337d('0x2'));var router=express[_0x337d('0x3')]();var fs_extra=require(_0x337d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x337d('0x5'));var config=require('../../config/environment');var controller=require(_0x337d('0x6'));router['get']('/',auth[_0x337d('0x7')](),controller[_0x337d('0x8')]);router[_0x337d('0x9')](_0x337d('0xa'),auth[_0x337d('0x7')](),controller[_0x337d('0xb')]);router[_0x337d('0x9')](_0x337d('0xc'),auth['isAuthenticated'](),controller[_0x337d('0xd')]);router['post']('/',auth[_0x337d('0x7')](),controller['create']);router[_0x337d('0xe')](_0x337d('0xa'),auth[_0x337d('0x7')](),controller[_0x337d('0xf')]);router[_0x337d('0x10')]('/:id',auth[_0x337d('0x7')](),controller[_0x337d('0x11')]);module[_0x337d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 40402de..7715c30 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 _0x5ddc=['getDataValue','STRING','BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x2acd24,_0xf315ac){var _0x546099=function(_0x479e66){while(--_0x479e66){_0x2acd24['push'](_0x2acd24['shift']());}};_0x546099(++_0xf315ac);}(_0x5ddc,0x69));var _0xc5dd=function(_0x136ce8,_0x522851){_0x136ce8=_0x136ce8-0x0;var _0x3eb958=_0x5ddc[_0x136ce8];return _0x3eb958;};'use strict';var Sequelize=require(_0xc5dd('0x0'));module[_0xc5dd('0x1')]={'name':{'type':Sequelize[_0xc5dd('0x2')],'get':function(_0x577974){return this[_0xc5dd('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xc5dd('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc5dd('0x4')],'defaultValue':''},'stamp':{'type':_0xc5dd('0x6'),'defaultValue':Sequelize[_0xc5dd('0x7')](_0xc5dd('0x8'))}}; \ No newline at end of file +var _0x027d=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','STRING','BLOB'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x027d,0x1cf));var _0xd027=function(_0x2c561e,_0x483e18){_0x2c561e=_0x2c561e-0x0;var _0x2aa4e0=_0x027d[_0x2c561e];return _0x2aa4e0;};'use strict';var Sequelize=require(_0xd027('0x0'));module['exports']={'name':{'type':Sequelize[_0xd027('0x1')],'get':function(_0x4b3f31){return this[_0xd027('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd027('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd027('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd027('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xd027('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd027('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xd027('0x4')](_0xd027('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xd027('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd027('0x3')],'defaultValue':''},'stamp':{'type':_0xd027('0x6'),'defaultValue':Sequelize[_0xd027('0x7')](_0xd027('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 02c6a15..03d708d 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 _0x67d4=['merge','type','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','map','VoiceMailMessage','fieldName','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x47159c,_0x1c8216){var _0x454dbe=function(_0x2b54f7){while(--_0x2b54f7){_0x47159c['push'](_0x47159c['shift']());}};_0x454dbe(++_0x1c8216);}(_0x67d4,0xbb));var _0x467d=function(_0x2ea312,_0x2c254e){_0x2ea312=_0x2ea312-0x0;var _0x49c3a2=_0x67d4[_0x2ea312];return _0x49c3a2;};'use strict';var emlformat=require(_0x467d('0x0'));var rimraf=require(_0x467d('0x1'));var zipdir=require(_0x467d('0x2'));var jsonpatch=require(_0x467d('0x3'));var rp=require(_0x467d('0x4'));var moment=require(_0x467d('0x5'));var BPromise=require(_0x467d('0x6'));var Mustache=require(_0x467d('0x7'));var util=require(_0x467d('0x8'));var path=require(_0x467d('0x9'));var sox=require(_0x467d('0xa'));var csv=require(_0x467d('0xb'));var ejs=require(_0x467d('0xc'));var fs=require('fs');var fs_extra=require(_0x467d('0xd'));var _=require(_0x467d('0xe'));var squel=require(_0x467d('0xf'));var crypto=require(_0x467d('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x467d('0x11'));var Redis=require(_0x467d('0x12'));var authService=require(_0x467d('0x13'));var qs=require(_0x467d('0x14'));var as=require(_0x467d('0x15'));var hardwareService=require(_0x467d('0x16'));var logger=require(_0x467d('0x17'))('api');var utils=require(_0x467d('0x18'));var config=require(_0x467d('0x19'));var licenseUtil=require(_0x467d('0x1a'));var db=require(_0x467d('0x1b'))['db'];function respondWithStatusCode(_0x23c0a8,_0x43718a){_0x43718a=_0x43718a||0xcc;return function(_0x54556d){if(_0x54556d){return _0x23c0a8['sendStatus'](_0x43718a);}return _0x23c0a8[_0x467d('0x1c')](_0x43718a)['end']();};}function respondWithResult(_0x1ba90e,_0x4e38bc){_0x4e38bc=_0x4e38bc||0xc8;return function(_0x580e21){if(_0x580e21){return _0x1ba90e[_0x467d('0x1c')](_0x4e38bc)[_0x467d('0x1d')](_0x580e21);}};}function respondWithFilteredResult(_0x47aedf,_0x10e2b9){return function(_0x439720){if(_0x439720){var _0x55272c=typeof _0x10e2b9['offset']===_0x467d('0x1e')&&typeof _0x10e2b9[_0x467d('0x1f')]===_0x467d('0x1e');var _0x3cd0ae=_0x439720[_0x467d('0x20')];var _0x2bc460=_0x55272c?0x0:_0x10e2b9['offset'];var _0x3a6785=_0x55272c?_0x439720['count']:_0x10e2b9[_0x467d('0x21')]+_0x10e2b9['limit'];var _0x142e4e;if(_0x3a6785>=_0x3cd0ae){_0x3a6785=_0x3cd0ae;_0x142e4e=0xc8;}else{_0x142e4e=0xce;}_0x47aedf[_0x467d('0x1c')](_0x142e4e);return _0x47aedf[_0x467d('0x22')](_0x467d('0x23'),_0x2bc460+'-'+_0x3a6785+'/'+_0x3cd0ae)['json'](_0x439720);}return null;};}function patchUpdates(_0x561524){return function(_0x13118f){try{jsonpatch[_0x467d('0x24')](_0x13118f,_0x561524,!![]);}catch(_0x1b6eee){return BPromise['reject'](_0x1b6eee);}return _0x13118f[_0x467d('0x25')]();};}function saveUpdates(_0x130a22,_0x53192b){return function(_0x3af4c0){if(_0x3af4c0){return _0x3af4c0[_0x467d('0x26')](_0x130a22)[_0x467d('0x27')](function(_0x214669){return _0x214669;});}return null;};}function removeEntity(_0xb01810,_0x4d0a02){return function(_0x4a366e){if(_0x4a366e){return _0x4a366e[_0x467d('0x28')]()[_0x467d('0x27')](function(){_0xb01810[_0x467d('0x1c')](0xcc)[_0x467d('0x29')]();});}};}function handleEntityNotFound(_0x3af2cb,_0x5ac647){return function(_0x1207ef){if(!_0x1207ef){_0x3af2cb['sendStatus'](0x194);}return _0x1207ef;};}function handleError(_0x3bc341,_0x244cc6){_0x244cc6=_0x244cc6||0x1f4;return function(_0x33f8a0){logger['error'](_0x33f8a0[_0x467d('0x2a')]);if(_0x33f8a0['name']){delete _0x33f8a0[_0x467d('0x2b')];}_0x3bc341[_0x467d('0x1c')](_0x244cc6)['send'](_0x33f8a0);};}exports[_0x467d('0x2c')]=function(_0x128908,_0xabeaa1){var _0x1874b7={},_0x53bc3d={},_0x52eaba={'count':0x0,'rows':[]};var _0x45af74=_[_0x467d('0x2d')](db[_0x467d('0x2e')]['rawAttributes'],function(_0x12b575){return{'name':_0x12b575[_0x467d('0x2f')],'type':_0x12b575['type'][_0x467d('0x30')]};});_0x53bc3d[_0x467d('0x31')]=_[_0x467d('0x32')](_['map'](_0x45af74,_0x467d('0x2b')),[_0x467d('0x2b')]);_0x53bc3d[_0x467d('0x33')]=_[_0x467d('0x34')](_0x128908[_0x467d('0x33')]);_0x53bc3d[_0x467d('0x35')]=_['intersection'](_0x53bc3d[_0x467d('0x31')],_0x53bc3d[_0x467d('0x33')]);_0x1874b7[_0x467d('0x36')]=_[_0x467d('0x37')](_0x53bc3d[_0x467d('0x31')],qs[_0x467d('0x38')](_0x128908[_0x467d('0x33')][_0x467d('0x38')]));_0x1874b7[_0x467d('0x36')]=_0x1874b7[_0x467d('0x36')][_0x467d('0x39')]?_0x1874b7[_0x467d('0x36')]:_0x53bc3d[_0x467d('0x31')];if(!_0x128908[_0x467d('0x33')][_0x467d('0x3a')](_0x467d('0x3b'))){_0x1874b7[_0x467d('0x1f')]=qs['limit'](_0x128908[_0x467d('0x33')][_0x467d('0x1f')]);_0x1874b7[_0x467d('0x21')]=qs[_0x467d('0x21')](_0x128908['query'][_0x467d('0x21')]);}_0x1874b7[_0x467d('0x3c')]=qs[_0x467d('0x3d')](_0x128908['query'][_0x467d('0x3d')]);_0x1874b7[_0x467d('0x3e')]=qs[_0x467d('0x35')](_[_0x467d('0x3f')](_0x128908[_0x467d('0x33')],_0x53bc3d[_0x467d('0x35')]),_0x45af74);if(_0x128908[_0x467d('0x33')][_0x467d('0x40')]){_0x1874b7[_0x467d('0x3e')]=_[_0x467d('0x41')](_0x1874b7[_0x467d('0x3e')],{'$or':_[_0x467d('0x2d')](_0x45af74,function(_0x28c6d7){if(_0x28c6d7[_0x467d('0x42')]!==_0x467d('0x43')){var _0x4fed34={};_0x4fed34[_0x28c6d7['name']]={'$like':'%'+_0x128908[_0x467d('0x33')]['filter']+'%'};return _0x4fed34;}})});}_0x1874b7=_[_0x467d('0x41')]({},_0x1874b7,_0x128908['options']);var _0x46fec8={'where':_0x1874b7[_0x467d('0x3e')]};return db[_0x467d('0x2e')][_0x467d('0x20')](_0x46fec8)[_0x467d('0x27')](function(_0x40bb7c){_0x52eaba['count']=_0x40bb7c;if(_0x128908['query'][_0x467d('0x44')]){_0x1874b7[_0x467d('0x45')]=[{'all':!![]}];}return db[_0x467d('0x2e')][_0x467d('0x46')](_0x1874b7);})[_0x467d('0x27')](function(_0x11cf44){_0x52eaba['rows']=_0x11cf44;return _0x52eaba;})[_0x467d('0x27')](respondWithFilteredResult(_0xabeaa1,_0x1874b7))[_0x467d('0x47')](handleError(_0xabeaa1,null));};exports['show']=function(_0x1ad12a,_0xc044cf){var _0x6cfe2a={'raw':!![],'where':{'id':_0x1ad12a[_0x467d('0x48')]['id']}},_0x65c81e={};_0x65c81e['model']=_[_0x467d('0x34')](db['VoiceMailMessage'][_0x467d('0x49')]);_0x65c81e[_0x467d('0x33')]=_[_0x467d('0x34')](_0x1ad12a[_0x467d('0x33')]);_0x65c81e[_0x467d('0x35')]=_[_0x467d('0x37')](_0x65c81e[_0x467d('0x31')],_0x65c81e[_0x467d('0x33')]);_0x6cfe2a[_0x467d('0x36')]=_['intersection'](_0x65c81e['model'],qs[_0x467d('0x38')](_0x1ad12a[_0x467d('0x33')][_0x467d('0x38')]));_0x6cfe2a[_0x467d('0x36')]=_0x6cfe2a['attributes'][_0x467d('0x39')]?_0x6cfe2a['attributes']:_0x65c81e[_0x467d('0x31')];if(_0x1ad12a[_0x467d('0x33')][_0x467d('0x44')]){_0x6cfe2a[_0x467d('0x45')]=[{'all':!![]}];}_0x6cfe2a=_[_0x467d('0x41')]({},_0x6cfe2a,_0x1ad12a['options']);return db['VoiceMailMessage'][_0x467d('0x4a')](_0x6cfe2a)[_0x467d('0x27')](handleEntityNotFound(_0xc044cf,null))[_0x467d('0x27')](respondWithResult(_0xc044cf,null))[_0x467d('0x47')](handleError(_0xc044cf,null));};exports[_0x467d('0x4b')]=function(_0x2e85b6,_0x56b59c){return db[_0x467d('0x2e')][_0x467d('0x4b')](_0x2e85b6[_0x467d('0x4c')],{})[_0x467d('0x27')](respondWithResult(_0x56b59c,0xc9))[_0x467d('0x47')](handleError(_0x56b59c,null));};exports[_0x467d('0x26')]=function(_0x5e2fb9,_0x22c31d){if(_0x5e2fb9['body']['id']){delete _0x5e2fb9['body']['id'];}return db['VoiceMailMessage'][_0x467d('0x4a')]({'where':{'id':_0x5e2fb9[_0x467d('0x48')]['id']}})[_0x467d('0x27')](handleEntityNotFound(_0x22c31d,null))[_0x467d('0x27')](saveUpdates(_0x5e2fb9[_0x467d('0x4c')],null))[_0x467d('0x27')](respondWithResult(_0x22c31d,null))[_0x467d('0x47')](handleError(_0x22c31d,null));};exports[_0x467d('0x28')]=function(_0x22f310,_0x3c8680){return db[_0x467d('0x2e')]['find']({'where':{'id':_0x22f310[_0x467d('0x48')]['id']}})[_0x467d('0x27')](handleEntityNotFound(_0x3c8680,null))[_0x467d('0x27')](removeEntity(_0x3c8680,null))['catch'](handleError(_0x3c8680,null));};exports['download']=function(_0x21f52e,_0x2eca7b,_0x212436){return db[_0x467d('0x2e')][_0x467d('0x4a')]({'where':{'id':_0x21f52e[_0x467d('0x48')]['id']},'attributes':['id','recording',_0x467d('0x4d')]})[_0x467d('0x27')](handleEntityNotFound(_0x2eca7b,null))[_0x467d('0x27')](function(_0x5004ea){if(_0x5004ea){if(!_0x5004ea[_0x467d('0x4e')]){throw new db[(_0x467d('0x4f'))]['ValidationError'](_0x467d('0x50'));}var _0xc76953={'Content-Type':_0x467d('0x51'),'Content-Disposition':_0x467d('0x52')};if(_0x5004ea['msg_id']){_0xc76953[_0x467d('0x53')]='attachment;\x20filename=\x22'+_0x5004ea['msg_id']+'.wav\x22';}_0x2eca7b['set'](_0xc76953);return _0x2eca7b['send'](new Buffer(_0x5004ea[_0x467d('0x4e')]));}})[_0x467d('0x47')](handleError(_0x2eca7b,null));}; \ No newline at end of file +var _0x1c47=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','body','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','recording','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0x4f16a3,_0x45e69d){var _0x3947f1=function(_0x32eea8){while(--_0x32eea8){_0x4f16a3['push'](_0x4f16a3['shift']());}};_0x3947f1(++_0x45e69d);}(_0x1c47,0x71));var _0x71c4=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x1c47[_0x421196];return _0x2738af;};'use strict';var emlformat=require(_0x71c4('0x0'));var rimraf=require(_0x71c4('0x1'));var zipdir=require(_0x71c4('0x2'));var jsonpatch=require(_0x71c4('0x3'));var rp=require('request-promise');var moment=require(_0x71c4('0x4'));var BPromise=require(_0x71c4('0x5'));var Mustache=require('mustache');var util=require(_0x71c4('0x6'));var path=require(_0x71c4('0x7'));var sox=require(_0x71c4('0x8'));var csv=require(_0x71c4('0x9'));var ejs=require(_0x71c4('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(_0x71c4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x71c4('0x9'));var querystring=require(_0x71c4('0xc'));var Papa=require(_0x71c4('0xd'));var Redis=require(_0x71c4('0xe'));var authService=require(_0x71c4('0xf'));var qs=require(_0x71c4('0x10'));var as=require(_0x71c4('0x11'));var hardwareService=require(_0x71c4('0x12'));var logger=require(_0x71c4('0x13'))(_0x71c4('0x14'));var utils=require(_0x71c4('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71c4('0x16'))['db'];function respondWithStatusCode(_0x5e2fad,_0x45d193){_0x45d193=_0x45d193||0xcc;return function(_0x3201ed){if(_0x3201ed){return _0x5e2fad[_0x71c4('0x17')](_0x45d193);}return _0x5e2fad[_0x71c4('0x18')](_0x45d193)['end']();};}function respondWithResult(_0x518a7c,_0x647293){_0x647293=_0x647293||0xc8;return function(_0x42010c){if(_0x42010c){return _0x518a7c[_0x71c4('0x18')](_0x647293)['json'](_0x42010c);}};}function respondWithFilteredResult(_0x3db90a,_0x2505b9){return function(_0xe5fd1e){if(_0xe5fd1e){var _0x42d0f7=typeof _0x2505b9[_0x71c4('0x19')]===_0x71c4('0x1a')&&typeof _0x2505b9[_0x71c4('0x1b')]==='undefined';var _0x507293=_0xe5fd1e[_0x71c4('0x1c')];var _0x41dfa4=_0x42d0f7?0x0:_0x2505b9[_0x71c4('0x19')];var _0x3b3f52=_0x42d0f7?_0xe5fd1e['count']:_0x2505b9[_0x71c4('0x19')]+_0x2505b9[_0x71c4('0x1b')];var _0x527000;if(_0x3b3f52>=_0x507293){_0x3b3f52=_0x507293;_0x527000=0xc8;}else{_0x527000=0xce;}_0x3db90a[_0x71c4('0x18')](_0x527000);return _0x3db90a[_0x71c4('0x1d')](_0x71c4('0x1e'),_0x41dfa4+'-'+_0x3b3f52+'/'+_0x507293)[_0x71c4('0x1f')](_0xe5fd1e);}return null;};}function patchUpdates(_0x8cbbe5){return function(_0x5ef804){try{jsonpatch[_0x71c4('0x20')](_0x5ef804,_0x8cbbe5,!![]);}catch(_0x3d043a){return BPromise[_0x71c4('0x21')](_0x3d043a);}return _0x5ef804['save']();};}function saveUpdates(_0xa9a5f2,_0x59366c){return function(_0x2bedb7){if(_0x2bedb7){return _0x2bedb7[_0x71c4('0x22')](_0xa9a5f2)['then'](function(_0x151ab5){return _0x151ab5;});}return null;};}function removeEntity(_0x521151,_0x1dff38){return function(_0x53dd90){if(_0x53dd90){return _0x53dd90[_0x71c4('0x23')]()[_0x71c4('0x24')](function(){_0x521151[_0x71c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x574834,_0x3b03ca){return function(_0x1442c3){if(!_0x1442c3){_0x574834[_0x71c4('0x17')](0x194);}return _0x1442c3;};}function handleError(_0x4a1d4a,_0x4eaa1b){_0x4eaa1b=_0x4eaa1b||0x1f4;return function(_0x562fa1){logger[_0x71c4('0x25')](_0x562fa1[_0x71c4('0x26')]);if(_0x562fa1[_0x71c4('0x27')]){delete _0x562fa1[_0x71c4('0x27')];}_0x4a1d4a[_0x71c4('0x18')](_0x4eaa1b)['send'](_0x562fa1);};}exports[_0x71c4('0x28')]=function(_0x3dcd70,_0x1f8303){var _0x423ea9={},_0x4e11d7={},_0x2889fb={'count':0x0,'rows':[]};var _0x65d79a=_[_0x71c4('0x29')](db[_0x71c4('0x2a')][_0x71c4('0x2b')],function(_0x63eeea){return{'name':_0x63eeea[_0x71c4('0x2c')],'type':_0x63eeea[_0x71c4('0x2d')][_0x71c4('0x2e')]};});_0x4e11d7['model']=_['differenceBy'](_[_0x71c4('0x29')](_0x65d79a,_0x71c4('0x27')),['name']);_0x4e11d7[_0x71c4('0x2f')]=_[_0x71c4('0x30')](_0x3dcd70['query']);_0x4e11d7[_0x71c4('0x31')]=_[_0x71c4('0x32')](_0x4e11d7[_0x71c4('0x33')],_0x4e11d7[_0x71c4('0x2f')]);_0x423ea9[_0x71c4('0x34')]=_[_0x71c4('0x32')](_0x4e11d7[_0x71c4('0x33')],qs[_0x71c4('0x35')](_0x3dcd70[_0x71c4('0x2f')][_0x71c4('0x35')]));_0x423ea9[_0x71c4('0x34')]=_0x423ea9[_0x71c4('0x34')][_0x71c4('0x36')]?_0x423ea9[_0x71c4('0x34')]:_0x4e11d7[_0x71c4('0x33')];if(!_0x3dcd70[_0x71c4('0x2f')][_0x71c4('0x37')](_0x71c4('0x38'))){_0x423ea9[_0x71c4('0x1b')]=qs[_0x71c4('0x1b')](_0x3dcd70[_0x71c4('0x2f')]['limit']);_0x423ea9[_0x71c4('0x19')]=qs[_0x71c4('0x19')](_0x3dcd70['query'][_0x71c4('0x19')]);}_0x423ea9[_0x71c4('0x39')]=qs[_0x71c4('0x3a')](_0x3dcd70[_0x71c4('0x2f')][_0x71c4('0x3a')]);_0x423ea9['where']=qs[_0x71c4('0x31')](_[_0x71c4('0x3b')](_0x3dcd70[_0x71c4('0x2f')],_0x4e11d7[_0x71c4('0x31')]),_0x65d79a);if(_0x3dcd70[_0x71c4('0x2f')][_0x71c4('0x3c')]){_0x423ea9[_0x71c4('0x3d')]=_[_0x71c4('0x3e')](_0x423ea9['where'],{'$or':_['map'](_0x65d79a,function(_0x305f07){if(_0x305f07[_0x71c4('0x2d')]!==_0x71c4('0x3f')){var _0x42250b={};_0x42250b[_0x305f07[_0x71c4('0x27')]]={'$like':'%'+_0x3dcd70[_0x71c4('0x2f')][_0x71c4('0x3c')]+'%'};return _0x42250b;}})});}_0x423ea9=_[_0x71c4('0x3e')]({},_0x423ea9,_0x3dcd70[_0x71c4('0x40')]);var _0x3a2975={'where':_0x423ea9[_0x71c4('0x3d')]};return db[_0x71c4('0x2a')][_0x71c4('0x1c')](_0x3a2975)[_0x71c4('0x24')](function(_0x12dfc5){_0x2889fb[_0x71c4('0x1c')]=_0x12dfc5;if(_0x3dcd70['query']['includeAll']){_0x423ea9[_0x71c4('0x41')]=[{'all':!![]}];}return db[_0x71c4('0x2a')][_0x71c4('0x42')](_0x423ea9);})[_0x71c4('0x24')](function(_0xb52538){_0x2889fb['rows']=_0xb52538;return _0x2889fb;})['then'](respondWithFilteredResult(_0x1f8303,_0x423ea9))[_0x71c4('0x43')](handleError(_0x1f8303,null));};exports['show']=function(_0xf43117,_0x3095d5){var _0x314718={'raw':!![],'where':{'id':_0xf43117[_0x71c4('0x44')]['id']}},_0x44ae0b={};_0x44ae0b[_0x71c4('0x33')]=_[_0x71c4('0x30')](db[_0x71c4('0x2a')]['rawAttributes']);_0x44ae0b['query']=_['keys'](_0xf43117[_0x71c4('0x2f')]);_0x44ae0b['filters']=_[_0x71c4('0x32')](_0x44ae0b[_0x71c4('0x33')],_0x44ae0b[_0x71c4('0x2f')]);_0x314718[_0x71c4('0x34')]=_[_0x71c4('0x32')](_0x44ae0b[_0x71c4('0x33')],qs[_0x71c4('0x35')](_0xf43117[_0x71c4('0x2f')]['fields']));_0x314718[_0x71c4('0x34')]=_0x314718['attributes'][_0x71c4('0x36')]?_0x314718[_0x71c4('0x34')]:_0x44ae0b[_0x71c4('0x33')];if(_0xf43117['query'][_0x71c4('0x45')]){_0x314718[_0x71c4('0x41')]=[{'all':!![]}];}_0x314718=_[_0x71c4('0x3e')]({},_0x314718,_0xf43117['options']);return db[_0x71c4('0x2a')][_0x71c4('0x46')](_0x314718)[_0x71c4('0x24')](handleEntityNotFound(_0x3095d5,null))[_0x71c4('0x24')](respondWithResult(_0x3095d5,null))['catch'](handleError(_0x3095d5,null));};exports['create']=function(_0x4c7589,_0x4e8f7e){return db[_0x71c4('0x2a')]['create'](_0x4c7589[_0x71c4('0x47')],{})[_0x71c4('0x24')](respondWithResult(_0x4e8f7e,0xc9))[_0x71c4('0x43')](handleError(_0x4e8f7e,null));};exports['update']=function(_0x2c7bb5,_0x4cabe6){if(_0x2c7bb5[_0x71c4('0x47')]['id']){delete _0x2c7bb5[_0x71c4('0x47')]['id'];}return db[_0x71c4('0x2a')]['find']({'where':{'id':_0x2c7bb5['params']['id']}})['then'](handleEntityNotFound(_0x4cabe6,null))[_0x71c4('0x24')](saveUpdates(_0x2c7bb5['body'],null))[_0x71c4('0x24')](respondWithResult(_0x4cabe6,null))[_0x71c4('0x43')](handleError(_0x4cabe6,null));};exports['destroy']=function(_0x7b14f9,_0x83e89c){return db['VoiceMailMessage'][_0x71c4('0x46')]({'where':{'id':_0x7b14f9[_0x71c4('0x44')]['id']}})[_0x71c4('0x24')](handleEntityNotFound(_0x83e89c,null))[_0x71c4('0x24')](removeEntity(_0x83e89c,null))[_0x71c4('0x43')](handleError(_0x83e89c,null));};exports['download']=function(_0x32e0dc,_0x51315d,_0x264e00){return db[_0x71c4('0x2a')][_0x71c4('0x46')]({'where':{'id':_0x32e0dc[_0x71c4('0x44')]['id']},'attributes':['id','recording',_0x71c4('0x48')]})[_0x71c4('0x24')](handleEntityNotFound(_0x51315d,null))[_0x71c4('0x24')](function(_0x5ae874){if(_0x5ae874){if(!_0x5ae874['recording']){throw new db[(_0x71c4('0x49'))][(_0x71c4('0x4a'))](_0x71c4('0x4b'));}var _0x271259={'Content-Type':_0x71c4('0x4c'),'Content-Disposition':_0x71c4('0x4d')};if(_0x5ae874['msg_id']){_0x271259[_0x71c4('0x4e')]=_0x71c4('0x4f')+_0x5ae874[_0x71c4('0x48')]+_0x71c4('0x50');}_0x51315d[_0x71c4('0x1d')](_0x271259);return _0x51315d['send'](new Buffer(_0x5ae874[_0x71c4('0x51')]));}})[_0x71c4('0x43')](handleError(_0x51315d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index bd11245..4a73908 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 _0xcea5=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xcea5,0x15a));var _0x5cea=function(_0x7b8ac2,_0x226989){_0x7b8ac2=_0x7b8ac2-0x0;var _0x361da3=_0xcea5[_0x7b8ac2];return _0x361da3;};'use strict';var _=require(_0x5cea('0x0'));var util=require(_0x5cea('0x1'));var logger=require(_0x5cea('0x2'))(_0x5cea('0x3'));var moment=require(_0x5cea('0x4'));var BPromise=require(_0x5cea('0x5'));var rp=require(_0x5cea('0x6'));var fs=require('fs');var path=require(_0x5cea('0x7'));var rimraf=require(_0x5cea('0x8'));var config=require(_0x5cea('0x9'));var attributes=require(_0x5cea('0xa'));module['exports']=function(_0x16062a,_0x341fef){return _0x16062a[_0x5cea('0xb')](_0x5cea('0xc'),attributes,{'tableName':_0x5cea('0xd'),'paranoid':![],'indexes':[{'name':_0x5cea('0xe'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x31c0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceMailMessage','voice_voicemail_messages','dir','util'];(function(_0x1ed693,_0x562da9){var _0xc07fff=function(_0x334062){while(--_0x334062){_0x1ed693['push'](_0x1ed693['shift']());}};_0xc07fff(++_0x562da9);}(_0x31c0,0xc2));var _0x031c=function(_0x511d50,_0x527d32){_0x511d50=_0x511d50-0x0;var _0x473500=_0x31c0[_0x511d50];return _0x473500;};'use strict';var _=require('lodash');var util=require(_0x031c('0x0'));var logger=require(_0x031c('0x1'))(_0x031c('0x2'));var moment=require(_0x031c('0x3'));var BPromise=require(_0x031c('0x4'));var rp=require(_0x031c('0x5'));var fs=require('fs');var path=require(_0x031c('0x6'));var rimraf=require(_0x031c('0x7'));var config=require(_0x031c('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x031c('0x9')]=function(_0x428313,_0x5999b4){return _0x428313['define'](_0x031c('0xa'),attributes,{'tableName':_0x031c('0xb'),'paranoid':![],'indexes':[{'name':_0x031c('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 3cd0810..14aa2c9 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 _0xd977=['result','catch','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4957e6,_0x432278){var _0x502e13=function(_0x3ae9c5){while(--_0x3ae9c5){_0x4957e6['push'](_0x4957e6['shift']());}};_0x502e13(++_0x432278);}(_0xd977,0x1dd));var _0x7d97=function(_0x3bb348,_0x144786){_0x3bb348=_0x3bb348-0x0;var _0x4c206d=_0xd977[_0x3bb348];return _0x4c206d;};'use strict';var _=require('lodash');var util=require(_0x7d97('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d97('0x1'))['db'];var utils=require(_0x7d97('0x2'));var logger=require(_0x7d97('0x3'))('rpc');var config=require(_0x7d97('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x7d97('0x5')][_0x7d97('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x50b59e,_0x4cde60,_0x48ec55){return new BPromise(function(_0x57b086,_0x4ef37a){return client[_0x7d97('0x7')](_0x50b59e,_0x48ec55)[_0x7d97('0x8')](function(_0x5943ed){logger[_0x7d97('0x9')](_0x7d97('0xa'),_0x4cde60,_0x7d97('0xb'));logger[_0x7d97('0xc')](_0x7d97('0xd'),_0x4cde60,_0x7d97('0xb'),JSON[_0x7d97('0xe')](_0x5943ed));if(_0x5943ed[_0x7d97('0xf')]){if(_0x5943ed['error']['code']===0x1f4){logger[_0x7d97('0xf')](_0x7d97('0xa'),_0x4cde60,_0x5943ed[_0x7d97('0xf')][_0x7d97('0x10')]);return _0x4ef37a(_0x5943ed[_0x7d97('0xf')]['message']);}logger[_0x7d97('0xf')](_0x7d97('0xa'),_0x4cde60,_0x5943ed[_0x7d97('0xf')]['message']);return _0x57b086(_0x5943ed[_0x7d97('0xf')][_0x7d97('0x10')]);}else{logger[_0x7d97('0x9')](_0x7d97('0xa'),_0x4cde60,_0x7d97('0xb'));_0x57b086(_0x5943ed[_0x7d97('0x11')]['message']);}})[_0x7d97('0x12')](function(_0x53924a){logger[_0x7d97('0xf')](_0x7d97('0xa'),_0x4cde60,_0x53924a);_0x4ef37a(_0x53924a);});});} \ No newline at end of file +var _0x97ad=['debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x97ad,0x127));var _0xd97a=function(_0x442095,_0x21d807){_0x442095=_0x442095-0x0;var _0x5233d3=_0x97ad[_0x442095];return _0x5233d3;};'use strict';var _=require('lodash');var util=require(_0xd97a('0x0'));var moment=require(_0xd97a('0x1'));var BPromise=require(_0xd97a('0x2'));var rs=require(_0xd97a('0x3'));var fs=require('fs');var Redis=require(_0xd97a('0x4'));var db=require(_0xd97a('0x5'))['db'];var utils=require(_0xd97a('0x6'));var logger=require(_0xd97a('0x7'))(_0xd97a('0x8'));var config=require('../../config/environment');var jayson=require(_0xd97a('0x9'));var client=jayson['client'][_0xd97a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e940e,_0xf2344b,_0x4fcb75){return new BPromise(function(_0x14277d,_0x2597fb){return client['request'](_0x4e940e,_0x4fcb75)['then'](function(_0x3d5590){logger['info'](_0xd97a('0xb'),_0xf2344b,_0xd97a('0xc'));logger[_0xd97a('0xd')](_0xd97a('0xe'),_0xf2344b,_0xd97a('0xc'),JSON[_0xd97a('0xf')](_0x3d5590));if(_0x3d5590[_0xd97a('0x10')]){if(_0x3d5590['error'][_0xd97a('0x11')]===0x1f4){logger[_0xd97a('0x10')](_0xd97a('0xb'),_0xf2344b,_0x3d5590[_0xd97a('0x10')][_0xd97a('0x12')]);return _0x2597fb(_0x3d5590[_0xd97a('0x10')]['message']);}logger['error'](_0xd97a('0xb'),_0xf2344b,_0x3d5590['error']['message']);return _0x14277d(_0x3d5590[_0xd97a('0x10')][_0xd97a('0x12')]);}else{logger[_0xd97a('0x13')](_0xd97a('0xb'),_0xf2344b,_0xd97a('0xc'));_0x14277d(_0x3d5590[_0xd97a('0x14')][_0xd97a('0x12')]);}})[_0xd97a('0x15')](function(_0xc71201){logger['error'](_0xd97a('0xb'),_0xf2344b,_0xc71201);_0x2597fb(_0xc71201);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 0f8e8b1..ac36762 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 _0xc093=['getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','show','/:id/sounds'];(function(_0x2ecbf7,_0x3cb321){var _0x1230e4=function(_0x34b2ce){while(--_0x34b2ce){_0x2ecbf7['push'](_0x2ecbf7['shift']());}};_0x1230e4(++_0x3cb321);}(_0xc093,0x1ba));var _0x3c09=function(_0x3ff235,_0x428b4d){_0x3ff235=_0x3ff235-0x0;var _0x409302=_0xc093[_0x3ff235];return _0x409302;};'use strict';var multer=require(_0x3c09('0x0'));var util=require(_0x3c09('0x1'));var path=require(_0x3c09('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c09('0x3'));var router=express['Router']();var fs_extra=require(_0x3c09('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3c09('0x5'));var config=require(_0x3c09('0x6'));var controller=require(_0x3c09('0x7'));router[_0x3c09('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c09('0x9')]);router[_0x3c09('0x8')](_0x3c09('0xa'),auth[_0x3c09('0xb')](),controller[_0x3c09('0xc')]);router[_0x3c09('0x8')](_0x3c09('0xd'),auth[_0x3c09('0xb')](),controller[_0x3c09('0xe')]);router[_0x3c09('0xf')]('/',auth[_0x3c09('0xb')](),controller[_0x3c09('0x10')]);router[_0x3c09('0xf')](_0x3c09('0xd'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x11')]);router[_0x3c09('0x12')](_0x3c09('0xa'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x13')]);router[_0x3c09('0x14')](_0x3c09('0xa'),auth['isAuthenticated'](),controller[_0x3c09('0x15')]);router[_0x3c09('0x14')](_0x3c09('0x16'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x17')]);module['exports']=router; \ No newline at end of file +var _0x84de=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds','post','/:id/sounds','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util'];(function(_0x26a4ea,_0xa72fb8){var _0x1b669e=function(_0x4e8bba){while(--_0x4e8bba){_0x26a4ea['push'](_0x26a4ea['shift']());}};_0x1b669e(++_0xa72fb8);}(_0x84de,0x1b7));var _0xe84d=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x84de[_0xf04c6d];return _0x4a804e;};'use strict';var multer=require(_0xe84d('0x0'));var util=require(_0xe84d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe84d('0x2')]();var fs_extra=require(_0xe84d('0x3'));var auth=require(_0xe84d('0x4'));var interaction=require(_0xe84d('0x5'));var config=require(_0xe84d('0x6'));var controller=require(_0xe84d('0x7'));router[_0xe84d('0x8')]('/',auth[_0xe84d('0x9')](),controller['index']);router[_0xe84d('0x8')](_0xe84d('0xa'),auth['isAuthenticated'](),controller[_0xe84d('0xb')]);router[_0xe84d('0x8')]('/:id/sounds',auth[_0xe84d('0x9')](),controller[_0xe84d('0xc')]);router[_0xe84d('0xd')]('/',auth[_0xe84d('0x9')](),controller['create']);router['post'](_0xe84d('0xe'),auth[_0xe84d('0x9')](),controller['addSound']);router[_0xe84d('0xf')]('/:id',auth[_0xe84d('0x9')](),controller['update']);router[_0xe84d('0x10')](_0xe84d('0xa'),auth[_0xe84d('0x9')](),controller[_0xe84d('0x11')]);router[_0xe84d('0x10')](_0xe84d('0x12'),auth[_0xe84d('0x9')](),controller[_0xe84d('0x13')]);module[_0xe84d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c2eb6a9..69007d6 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 _0x2d2e=['files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','sequelize','STRING','name','ENUM','custom'];(function(_0x452035,_0x30bc5b){var _0x4b4b0e=function(_0x41dd63){while(--_0x41dd63){_0x452035['push'](_0x452035['shift']());}};_0x4b4b0e(++_0x30bc5b);}(_0x2d2e,0x119));var _0xe2d2=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x2d2e[_0x3e7e96];return _0x13f6f0;};'use strict';var Sequelize=require(_0xe2d2('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2d2('0x1')],'allowNull':![],'unique':_0xe2d2('0x2')},'mode':{'type':Sequelize[_0xe2d2('0x3')](_0xe2d2('0x4'),_0xe2d2('0x5'),_0xe2d2('0x6'),_0xe2d2('0x7'),_0xe2d2('0x8'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xe2d2('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe2d2('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe2d2('0x1')],'allowNull':!![],'defaultValue':_0xe2d2('0x9')},'format':{'type':Sequelize[_0xe2d2('0x1')],'allowNull':!![]},'stamp':{'type':_0xe2d2('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb2c8=['custom','files','quietmp3nb','mp3','alpha','BOOLEAN','exports','STRING','name'];(function(_0x45a5a4,_0x4649dd){var _0x14c450=function(_0x4f05c8){while(--_0x4f05c8){_0x45a5a4['push'](_0x45a5a4['shift']());}};_0x14c450(++_0x4649dd);}(_0xb2c8,0xba));var _0x8b2c=function(_0x38ead5,_0x5b4fa2){_0x38ead5=_0x38ead5-0x0;var _0x4e40bc=_0xb2c8[_0x38ead5];return _0x4e40bc;};'use strict';var Sequelize=require('sequelize');module[_0x8b2c('0x0')]={'name':{'type':Sequelize[_0x8b2c('0x1')],'allowNull':![],'unique':_0x8b2c('0x2')},'mode':{'type':Sequelize['ENUM'](_0x8b2c('0x3'),_0x8b2c('0x4'),'mp3nb',_0x8b2c('0x5'),'quietmp3',_0x8b2c('0x6')),'allowNull':!![],'defaultValue':_0x8b2c('0x4')},'directory':{'type':Sequelize[_0x8b2c('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x8b2c('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8b2c('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8b2c('0x1')],'allowNull':!![],'defaultValue':_0x8b2c('0x7')},'format':{'type':Sequelize[_0x8b2c('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x8b2c('0x8')],'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 68587fe..28ce707 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 _0xa5eb=['VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','body','create','sequelize','transaction','mode','directory','root','server/files/moh','files','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','join','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','findOne','removeSound','id2','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','status','end','stack','name','send','index'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0xa5eb,0x1a6));var _0xba5e=function(_0x427d4d,_0x3bf17f){_0x427d4d=_0x427d4d-0x0;var _0x10c070=_0xa5eb[_0x427d4d];return _0x10c070;};'use strict';var emlformat=require(_0xba5e('0x0'));var rimraf=require(_0xba5e('0x1'));var zipdir=require(_0xba5e('0x2'));var jsonpatch=require(_0xba5e('0x3'));var rp=require(_0xba5e('0x4'));var moment=require('moment');var BPromise=require(_0xba5e('0x5'));var Mustache=require(_0xba5e('0x6'));var util=require(_0xba5e('0x7'));var path=require(_0xba5e('0x8'));var sox=require(_0xba5e('0x9'));var csv=require(_0xba5e('0xa'));var ejs=require(_0xba5e('0xb'));var fs=require('fs');var fs_extra=require(_0xba5e('0xc'));var _=require(_0xba5e('0xd'));var squel=require('squel');var crypto=require(_0xba5e('0xe'));var jsforce=require(_0xba5e('0xf'));var deskjs=require(_0xba5e('0x10'));var toCsv=require(_0xba5e('0xa'));var querystring=require(_0xba5e('0x11'));var Papa=require(_0xba5e('0x12'));var Redis=require(_0xba5e('0x13'));var authService=require(_0xba5e('0x14'));var qs=require(_0xba5e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba5e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xba5e('0x17'));var config=require(_0xba5e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d561b,_0x255473){_0x255473=_0x255473||0xcc;return function(_0x55bb5e){if(_0x55bb5e){return _0x5d561b[_0xba5e('0x19')](_0x255473);}return _0x5d561b['status'](_0x255473)['end']();};}function respondWithResult(_0x25b7b8,_0x5b358a){_0x5b358a=_0x5b358a||0xc8;return function(_0x114d65){if(_0x114d65){return _0x25b7b8['status'](_0x5b358a)[_0xba5e('0x1a')](_0x114d65);}};}function respondWithFilteredResult(_0x2c3870,_0x563ca3){return function(_0x347bd3){if(_0x347bd3){var _0x34292f=typeof _0x563ca3[_0xba5e('0x1b')]===_0xba5e('0x1c')&&typeof _0x563ca3[_0xba5e('0x1d')]===_0xba5e('0x1c');var _0x26d937=_0x347bd3[_0xba5e('0x1e')];var _0x270269=_0x34292f?0x0:_0x563ca3[_0xba5e('0x1b')];var _0x53f50a=_0x34292f?_0x347bd3[_0xba5e('0x1e')]:_0x563ca3[_0xba5e('0x1b')]+_0x563ca3[_0xba5e('0x1d')];var _0x47fbb7;if(_0x53f50a>=_0x26d937){_0x53f50a=_0x26d937;_0x47fbb7=0xc8;}else{_0x47fbb7=0xce;}_0x2c3870['status'](_0x47fbb7);return _0x2c3870[_0xba5e('0x1f')](_0xba5e('0x20'),_0x270269+'-'+_0x53f50a+'/'+_0x26d937)[_0xba5e('0x1a')](_0x347bd3);}return null;};}function patchUpdates(_0x1f4c0e){return function(_0x13bb49){try{jsonpatch['apply'](_0x13bb49,_0x1f4c0e,!![]);}catch(_0x4c00b7){return BPromise[_0xba5e('0x21')](_0x4c00b7);}return _0x13bb49['save']();};}function saveUpdates(_0x17e5fe,_0x12fb7f){return function(_0x468708){if(_0x468708){return _0x468708[_0xba5e('0x22')](_0x17e5fe)[_0xba5e('0x23')](function(_0x5a16ac){return _0x5a16ac;});}return null;};}function removeEntity(_0x5b169a,_0x111d22){return function(_0x724fc9){if(_0x724fc9){return _0x724fc9[_0xba5e('0x24')]()['then'](function(){var _0x14d84d=_0x724fc9[_0xba5e('0x25')]({'plain':!![]});var _0x17ce5b=_0xba5e('0x26');return db[_0xba5e('0x27')][_0xba5e('0x24')]({'where':{'type':_0x17ce5b,'resourceId':_0x14d84d['id']}})[_0xba5e('0x23')](function(){return _0x724fc9;});})[_0xba5e('0x23')](function(){_0x5b169a[_0xba5e('0x28')](0xcc)[_0xba5e('0x29')]();});}};}function handleEntityNotFound(_0x1556da,_0x128984){return function(_0x2916f8){if(!_0x2916f8){_0x1556da[_0xba5e('0x19')](0x194);}return _0x2916f8;};}function handleError(_0x46448e,_0x3e17c3){_0x3e17c3=_0x3e17c3||0x1f4;return function(_0x2cf55b){logger['error'](_0x2cf55b[_0xba5e('0x2a')]);if(_0x2cf55b['name']){delete _0x2cf55b[_0xba5e('0x2b')];}_0x46448e[_0xba5e('0x28')](_0x3e17c3)[_0xba5e('0x2c')](_0x2cf55b);};}exports[_0xba5e('0x2d')]=function(_0x26f814,_0x18e71c){var _0x3ce041={},_0x23e4bc={},_0x3351de={'count':0x0,'rows':[]};var _0x5503e4=_['map'](db[_0xba5e('0x2e')][_0xba5e('0x2f')],function(_0x1d702b){return{'name':_0x1d702b[_0xba5e('0x30')],'type':_0x1d702b[_0xba5e('0x31')][_0xba5e('0x32')]};});_0x23e4bc[_0xba5e('0x33')]=_[_0xba5e('0x34')](_0x5503e4,'name');_0x23e4bc[_0xba5e('0x35')]=_[_0xba5e('0x36')](_0x26f814[_0xba5e('0x35')]);_0x23e4bc[_0xba5e('0x37')]=_[_0xba5e('0x38')](_0x23e4bc[_0xba5e('0x33')],_0x23e4bc[_0xba5e('0x35')]);_0x3ce041['attributes']=_[_0xba5e('0x38')](_0x23e4bc[_0xba5e('0x33')],qs[_0xba5e('0x39')](_0x26f814[_0xba5e('0x35')][_0xba5e('0x39')]));_0x3ce041[_0xba5e('0x3a')]=_0x3ce041['attributes'][_0xba5e('0x3b')]?_0x3ce041[_0xba5e('0x3a')]:_0x23e4bc[_0xba5e('0x33')];if(!_0x26f814[_0xba5e('0x35')][_0xba5e('0x3c')](_0xba5e('0x3d'))){_0x3ce041[_0xba5e('0x1d')]=qs[_0xba5e('0x1d')](_0x26f814[_0xba5e('0x35')]['limit']);_0x3ce041[_0xba5e('0x1b')]=qs[_0xba5e('0x1b')](_0x26f814[_0xba5e('0x35')][_0xba5e('0x1b')]);}_0x3ce041['order']=qs[_0xba5e('0x3e')](_0x26f814[_0xba5e('0x35')][_0xba5e('0x3e')]);delete _0x26f814[_0xba5e('0x35')][_0xba5e('0x3e')];_0x3ce041[_0xba5e('0x3f')]=qs[_0xba5e('0x37')](_['pick'](_0x26f814[_0xba5e('0x35')],_0x23e4bc[_0xba5e('0x37')]),_0x5503e4);if(_0x26f814[_0xba5e('0x35')][_0xba5e('0x40')]){_0x3ce041[_0xba5e('0x3f')]=_[_0xba5e('0x41')](_0x3ce041[_0xba5e('0x3f')],{'$or':_['map'](_0x5503e4,function(_0x274389){if(_0x274389[_0xba5e('0x31')]!==_0xba5e('0x42')){var _0x49270d={};_0x49270d[_0x274389[_0xba5e('0x2b')]]={'$like':'%'+_0x26f814['query'][_0xba5e('0x40')]+'%'};return _0x49270d;}})});}_0x3ce041=_[_0xba5e('0x41')]({},_0x3ce041,_0x26f814['options']);var _0x36f311={'where':_0x3ce041[_0xba5e('0x3f')]};return db[_0xba5e('0x2e')][_0xba5e('0x1e')](_0x36f311)[_0xba5e('0x23')](function(_0x181cef){_0x3351de[_0xba5e('0x1e')]=_0x181cef;if(_0x26f814['query'][_0xba5e('0x43')]){_0x3ce041[_0xba5e('0x44')]=[{'all':!![]}];}return db[_0xba5e('0x2e')][_0xba5e('0x45')](_0x3ce041);})[_0xba5e('0x23')](function(_0x5ad073){_0x3351de[_0xba5e('0x46')]=_0x5ad073;return _0x3351de;})[_0xba5e('0x23')](respondWithFilteredResult(_0x18e71c,_0x3ce041))[_0xba5e('0x47')](handleError(_0x18e71c,null));};exports[_0xba5e('0x48')]=function(_0xb72649,_0x28844b){var _0x5cc95b={'raw':![],'where':{'id':_0xb72649[_0xba5e('0x49')]['id']}},_0x387e61={};_0x387e61[_0xba5e('0x33')]=_[_0xba5e('0x36')](db['VoiceMusicOnHold'][_0xba5e('0x2f')]);_0x387e61[_0xba5e('0x35')]=_['keys'](_0xb72649['query']);_0x387e61['filters']=_[_0xba5e('0x38')](_0x387e61[_0xba5e('0x33')],_0x387e61['query']);_0x5cc95b['attributes']=_[_0xba5e('0x38')](_0x387e61['model'],qs[_0xba5e('0x39')](_0xb72649[_0xba5e('0x35')][_0xba5e('0x39')]));_0x5cc95b[_0xba5e('0x3a')]=_0x5cc95b[_0xba5e('0x3a')][_0xba5e('0x3b')]?_0x5cc95b['attributes']:_0x387e61[_0xba5e('0x33')];if(_0xb72649[_0xba5e('0x35')][_0xba5e('0x43')]){_0x5cc95b[_0xba5e('0x44')]=[{'all':!![]}];}_0x5cc95b=_[_0xba5e('0x41')]({},_0x5cc95b,_0xb72649[_0xba5e('0x4a')]);return db[_0xba5e('0x2e')][_0xba5e('0x4b')](_0x5cc95b)[_0xba5e('0x23')](handleEntityNotFound(_0x28844b,null))['then'](respondWithResult(_0x28844b,null))[_0xba5e('0x47')](handleError(_0x28844b,null));};exports[_0xba5e('0x22')]=function(_0x52fe47,_0x726dc6){if(_0x52fe47[_0xba5e('0x4c')]['id']){delete _0x52fe47[_0xba5e('0x4c')]['id'];}return db[_0xba5e('0x2e')][_0xba5e('0x4b')]({'where':{'id':_0x52fe47[_0xba5e('0x49')]['id']}})['then'](handleEntityNotFound(_0x726dc6,null))[_0xba5e('0x23')](saveUpdates(_0x52fe47[_0xba5e('0x4c')],null))[_0xba5e('0x23')](respondWithResult(_0x726dc6,null))[_0xba5e('0x47')](handleError(_0x726dc6,null));};exports[_0xba5e('0x4d')]=function(_0x16e6a4,_0x523ad3,_0x3d2be5){return db[_0xba5e('0x4e')][_0xba5e('0x4f')](function(_0xb5b838){if(_0x16e6a4[_0xba5e('0x4c')][_0xba5e('0x50')]==='files'){_0x16e6a4[_0xba5e('0x4c')][_0xba5e('0x51')]=path['join'](config[_0xba5e('0x52')],_0xba5e('0x53'),_0x16e6a4[_0xba5e('0x4c')][_0xba5e('0x2b')]);}return db[_0xba5e('0x2e')][_0xba5e('0x4d')](_0x16e6a4[_0xba5e('0x4c')],{'transaction':_0xb5b838})['then'](function(_0x6c3b3b){if(_0x16e6a4[_0xba5e('0x4c')][_0xba5e('0x50')]===_0xba5e('0x54')){fs[_0xba5e('0x55')](_0x6c3b3b[_0xba5e('0x51')],parseInt(_0xba5e('0x56'),0x8));}var _0x4627ea=_0x16e6a4['user'][_0xba5e('0x25')]({'plain':!![]});if(!_0x4627ea)throw new Error(_0xba5e('0x57'));if(_0x4627ea[_0xba5e('0x58')]===_0xba5e('0x59')){var _0x1a3355=_0x6c3b3b[_0xba5e('0x25')]({'plain':!![]});return db[_0xba5e('0x5a')][_0xba5e('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x4627ea[_0xba5e('0x5b')]},'raw':!![]})[_0xba5e('0x23')](function(_0xbf5842){if(_0xbf5842&&_0xbf5842['autoAssociation']===0x0){return db[_0xba5e('0x27')][_0xba5e('0x4d')]({'name':_0x1a3355[_0xba5e('0x2b')],'resourceId':_0x1a3355['id'],'type':_0xbf5842['name'],'sectionId':_0xbf5842['id']},{})[_0xba5e('0x23')](function(){return _0x6c3b3b;});}else{return _0x6c3b3b;}})['catch'](function(_0x4e8515){logger[_0xba5e('0x5c')](_0xba5e('0x5d'),_0x4e8515);});}return _0x6c3b3b;});})[_0xba5e('0x23')](respondWithResult(_0x523ad3,0xc9))[_0xba5e('0x47')](handleError(_0x523ad3,null));};exports[_0xba5e('0x24')]=function(_0x1dd5a5,_0x559409,_0x4cbbff){var _0x43a222;return db[_0xba5e('0x2e')][_0xba5e('0x4b')]({'where':{'id':_0x1dd5a5[_0xba5e('0x49')]['id']}})[_0xba5e('0x23')](function(_0x5b4565){if(_0x5b4565){return db['sequelize']['transaction'](function(_0x2371ac){return _0x5b4565[_0xba5e('0x24')]({'transaction':_0x2371ac,'raw':!![]})[_0xba5e('0x23')](function(_0x1978b){if(_0x1978b[_0xba5e('0x51')]){fs[_0xba5e('0x5e')](_0x1978b[_0xba5e('0x51')])[_0xba5e('0x5f')](function(_0x39d0c){fs[_0xba5e('0x60')](path['join'](_0x1978b[_0xba5e('0x51')],_0x39d0c));});fs['rmdirSync'](_0x1978b['directory']);}return _0x1978b;});})['catch'](function(_0x81250){throw new db[(_0xba5e('0x61'))][(_0xba5e('0x62'))](_0x81250[_0xba5e('0x63')]);});}})[_0xba5e('0x23')](handleEntityNotFound(_0x559409,null))[_0xba5e('0x23')](removeEntity(_0x559409,null))['catch'](handleError(_0x559409,null));};exports[_0xba5e('0x64')]=function(_0x2c8e8d,_0x1eb5b9,_0x493d48){return db[_0xba5e('0x4e')][_0xba5e('0x4f')](function(_0x5cac2d){var _0xe4fb4a;return db['VoiceMusicOnHold'][_0xba5e('0x4b')]({'where':{'id':_0x2c8e8d[_0xba5e('0x49')]['id']}})[_0xba5e('0x23')](function(_0x1bed20){if(_0x1bed20){_0xe4fb4a=_0x1bed20;return _0x1bed20[_0xba5e('0x64')](_0x2c8e8d['body']['id'],{'transaction':_0x5cac2d});}})['then'](function(_0x1f0fcd){if(_0x1f0fcd){return db[_0xba5e('0x65')]['findOne']({'where':{'id':_0x2c8e8d[_0xba5e('0x4c')]['id']},'attributes':['id',_0xba5e('0x2b'),_0xba5e('0x66'),_0xba5e('0x67'),_0xba5e('0x68')],'raw':!![]});}})[_0xba5e('0x23')](function(_0x51b6fd){if(_0x51b6fd){var _0x1b4114=path[_0xba5e('0x69')](config[_0xba5e('0x52')],_0xba5e('0x6a'),util[_0xba5e('0x6b')]('%s.%s',path[_0xba5e('0x6c')](_0x51b6fd[_0xba5e('0x66')],path[_0xba5e('0x6d')](_0x51b6fd[_0xba5e('0x66')])),_0x51b6fd['converted_format']));var _0x580daa=path[_0xba5e('0x69')](config[_0xba5e('0x52')],_0xba5e('0x53'),_0xe4fb4a[_0xba5e('0x2b')],util[_0xba5e('0x6b')](_0xba5e('0x6e'),_0x51b6fd[_0xba5e('0x2b')],_0x51b6fd[_0xba5e('0x67')]));fs[_0xba5e('0x6f')](_0x1b4114,_0x580daa);return _0x51b6fd;}})['catch'](function(_0x2f0ad7){throw new db['Sequelize'][(_0xba5e('0x62'))](_0x2f0ad7[_0xba5e('0x63')]);});})['then'](handleEntityNotFound(_0x1eb5b9,null))['then'](respondWithResult(_0x1eb5b9,0xc9))[_0xba5e('0x47')](handleError(_0x1eb5b9,null));};exports['removeSound']=function(_0x153fc5,_0x12f2a1,_0x4f83d1){return db['sequelize']['transaction'](function(_0x446d4d){var _0x502c30;return db[_0xba5e('0x2e')][_0xba5e('0x70')]({'where':{'id':_0x153fc5['params']['id']}})['then'](handleEntityNotFound(_0x12f2a1,null))['then'](function(_0x10fc2a){if(_0x10fc2a){_0x502c30=_0x10fc2a;return _0x10fc2a[_0xba5e('0x71')](_0x153fc5['params'][_0xba5e('0x72')]);}})[_0xba5e('0x23')](function(_0x28e525){if(_0x28e525){return db[_0xba5e('0x65')][_0xba5e('0x70')]({'where':{'id':_0x153fc5['params'][_0xba5e('0x72')]},'attributes':['id','name',_0xba5e('0x66'),_0xba5e('0x67'),'createdAt'],'raw':!![]});}})[_0xba5e('0x23')](function(_0x41d03f){if(_0x41d03f){fs[_0xba5e('0x60')](path[_0xba5e('0x69')](_0x502c30[_0xba5e('0x51')],util[_0xba5e('0x6b')]('%s.%s',_0x41d03f[_0xba5e('0x2b')],_0x41d03f['converted_format'])));return _0x41d03f;}})[_0xba5e('0x47')](function(_0x13b236){throw new db[(_0xba5e('0x61'))]['ValidationError'](_0x13b236[_0xba5e('0x63')]);});})[_0xba5e('0x23')](handleEntityNotFound(_0x12f2a1,null))[_0xba5e('0x23')](respondWithStatusCode(_0x12f2a1,0xcc))['catch'](handleError(_0x12f2a1,null));};exports[_0xba5e('0x73')]=function(_0x4c5b1c,_0x564427,_0x587795){var _0x22a105={};var _0x1117bf={};var _0x59a062;var _0x5cac20;return db[_0xba5e('0x2e')][_0xba5e('0x70')]({'where':{'id':_0x4c5b1c[_0xba5e('0x49')]['id']}})['then'](handleEntityNotFound(_0x564427,null))[_0xba5e('0x23')](function(_0x14f3c9){if(_0x14f3c9){_0x59a062=_0x14f3c9;_0x1117bf[_0xba5e('0x33')]=_[_0xba5e('0x36')](db[_0xba5e('0x65')][_0xba5e('0x2f')]);_0x1117bf['query']=_[_0xba5e('0x36')](_0x4c5b1c[_0xba5e('0x35')]);_0x1117bf['filters']=_[_0xba5e('0x38')](_0x1117bf[_0xba5e('0x33')],_0x1117bf[_0xba5e('0x35')]);_0x22a105[_0xba5e('0x3a')]=_[_0xba5e('0x38')](_0x1117bf['model'],qs[_0xba5e('0x39')](_0x4c5b1c['query'][_0xba5e('0x39')]));_0x22a105[_0xba5e('0x3a')]=_0x22a105[_0xba5e('0x3a')][_0xba5e('0x3b')]?_0x22a105[_0xba5e('0x3a')]:_0x1117bf[_0xba5e('0x33')];_0x22a105[_0xba5e('0x74')]=qs[_0xba5e('0x3e')](_0x4c5b1c[_0xba5e('0x35')][_0xba5e('0x3e')]);_0x22a105[_0xba5e('0x3f')]=qs[_0xba5e('0x37')](_['pick'](_0x4c5b1c[_0xba5e('0x35')],_0x1117bf[_0xba5e('0x37')]));if(_0x4c5b1c['query'][_0xba5e('0x40')]){_0x22a105[_0xba5e('0x3f')]=_[_0xba5e('0x41')](_0x22a105[_0xba5e('0x3f')],{'$or':_[_0xba5e('0x34')](_0x22a105[_0xba5e('0x3a')],function(_0x2b26be){var _0x1264bc={};_0x1264bc[_0x2b26be]={'$like':'%'+_0x4c5b1c[_0xba5e('0x35')][_0xba5e('0x40')]+'%'};return _0x1264bc;})});}_0x22a105=_[_0xba5e('0x41')]({},_0x22a105,_0x4c5b1c[_0xba5e('0x4a')]);return _0x59a062[_0xba5e('0x73')](_0x22a105);}})['then'](function(_0x44fcd2){if(_0x44fcd2){_0x5cac20=_0x44fcd2[_0xba5e('0x3b')];if(!_0x4c5b1c[_0xba5e('0x35')][_0xba5e('0x3c')](_0xba5e('0x3d'))){_0x22a105[_0xba5e('0x1d')]=qs[_0xba5e('0x1d')](_0x4c5b1c[_0xba5e('0x35')][_0xba5e('0x1d')]);_0x22a105[_0xba5e('0x1b')]=qs[_0xba5e('0x1b')](_0x4c5b1c['query'][_0xba5e('0x1b')]);}return _0x59a062['getSounds'](_0x22a105);}})[_0xba5e('0x23')](function(_0x405f4c){if(_0x405f4c){return _0x405f4c?{'count':_0x5cac20,'rows':_0x405f4c}:null;}})[_0xba5e('0x23')](respondWithResult(_0x564427,null))[_0xba5e('0x47')](handleError(_0x564427,null));}; \ No newline at end of file +var _0x890d=['merge','find','body','catch','create','sequelize','transaction','mode','files','directory','server/files/moh','mkdirSync','0777','role','user','userProfileId','autoAssociation','error','readdirSync','forEach','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','id2','unlinkSync','getSounds','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','includeAll','include','rows','params','keys','length'];(function(_0x5de6a6,_0x29effa){var _0x87a12c=function(_0x30d049){while(--_0x30d049){_0x5de6a6['push'](_0x5de6a6['shift']());}};_0x87a12c(++_0x29effa);}(_0x890d,0x17d));var _0xd890=function(_0x54516d,_0x8f282f){_0x54516d=_0x54516d-0x0;var _0x2d70b5=_0x890d[_0x54516d];return _0x2d70b5;};'use strict';var emlformat=require(_0xd890('0x0'));var rimraf=require(_0xd890('0x1'));var zipdir=require(_0xd890('0x2'));var jsonpatch=require(_0xd890('0x3'));var rp=require(_0xd890('0x4'));var moment=require(_0xd890('0x5'));var BPromise=require(_0xd890('0x6'));var Mustache=require(_0xd890('0x7'));var util=require('util');var path=require(_0xd890('0x8'));var sox=require(_0xd890('0x9'));var csv=require(_0xd890('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd890('0xb'));var squel=require(_0xd890('0xc'));var crypto=require(_0xd890('0xd'));var jsforce=require(_0xd890('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd890('0xf'));var Papa=require(_0xd890('0x10'));var Redis=require('ioredis');var authService=require(_0xd890('0x11'));var qs=require(_0xd890('0x12'));var as=require(_0xd890('0x13'));var hardwareService=require(_0xd890('0x14'));var logger=require(_0xd890('0x15'))(_0xd890('0x16'));var utils=require('../../config/utils');var config=require(_0xd890('0x17'));var licenseUtil=require(_0xd890('0x18'));var db=require(_0xd890('0x19'))['db'];function respondWithStatusCode(_0x25e9d2,_0x36a79e){_0x36a79e=_0x36a79e||0xcc;return function(_0x12d7d4){if(_0x12d7d4){return _0x25e9d2['sendStatus'](_0x36a79e);}return _0x25e9d2[_0xd890('0x1a')](_0x36a79e)[_0xd890('0x1b')]();};}function respondWithResult(_0x39badf,_0x37d0bf){_0x37d0bf=_0x37d0bf||0xc8;return function(_0x353bae){if(_0x353bae){return _0x39badf[_0xd890('0x1a')](_0x37d0bf)[_0xd890('0x1c')](_0x353bae);}};}function respondWithFilteredResult(_0x3d182c,_0x471d40){return function(_0x153396){if(_0x153396){var _0x54a1d8=typeof _0x471d40[_0xd890('0x1d')]===_0xd890('0x1e')&&typeof _0x471d40[_0xd890('0x1f')]===_0xd890('0x1e');var _0x272593=_0x153396[_0xd890('0x20')];var _0x458a34=_0x54a1d8?0x0:_0x471d40[_0xd890('0x1d')];var _0x52a220=_0x54a1d8?_0x153396[_0xd890('0x20')]:_0x471d40[_0xd890('0x1d')]+_0x471d40[_0xd890('0x1f')];var _0x521cc1;if(_0x52a220>=_0x272593){_0x52a220=_0x272593;_0x521cc1=0xc8;}else{_0x521cc1=0xce;}_0x3d182c['status'](_0x521cc1);return _0x3d182c[_0xd890('0x21')]('Content-Range',_0x458a34+'-'+_0x52a220+'/'+_0x272593)[_0xd890('0x1c')](_0x153396);}return null;};}function patchUpdates(_0x2e91e5){return function(_0xe14714){try{jsonpatch[_0xd890('0x22')](_0xe14714,_0x2e91e5,!![]);}catch(_0x322fbb){return BPromise[_0xd890('0x23')](_0x322fbb);}return _0xe14714[_0xd890('0x24')]();};}function saveUpdates(_0x3ca659,_0x2150b8){return function(_0x392189){if(_0x392189){return _0x392189[_0xd890('0x25')](_0x3ca659)['then'](function(_0x4617d9){return _0x4617d9;});}return null;};}function removeEntity(_0x2aad28,_0x1b0ccb){return function(_0x552e79){if(_0x552e79){return _0x552e79[_0xd890('0x26')]()['then'](function(){var _0x341786=_0x552e79[_0xd890('0x27')]({'plain':!![]});var _0x4e5b7a='MusicOnHolds';return db[_0xd890('0x28')]['destroy']({'where':{'type':_0x4e5b7a,'resourceId':_0x341786['id']}})[_0xd890('0x29')](function(){return _0x552e79;});})['then'](function(){_0x2aad28[_0xd890('0x1a')](0xcc)[_0xd890('0x1b')]();});}};}function handleEntityNotFound(_0x374a96,_0x55061b){return function(_0x1ba70){if(!_0x1ba70){_0x374a96['sendStatus'](0x194);}return _0x1ba70;};}function handleError(_0x9dd661,_0x53df8e){_0x53df8e=_0x53df8e||0x1f4;return function(_0x34563a){logger['error'](_0x34563a[_0xd890('0x2a')]);if(_0x34563a[_0xd890('0x2b')]){delete _0x34563a[_0xd890('0x2b')];}_0x9dd661[_0xd890('0x1a')](_0x53df8e)['send'](_0x34563a);};}exports[_0xd890('0x2c')]=function(_0x383bd0,_0x50b287){var _0x3a2542={},_0x586641={},_0x47ed21={'count':0x0,'rows':[]};var _0x27cbf1=_['map'](db[_0xd890('0x2d')][_0xd890('0x2e')],function(_0x24022c){return{'name':_0x24022c[_0xd890('0x2f')],'type':_0x24022c[_0xd890('0x30')][_0xd890('0x31')]};});_0x586641[_0xd890('0x32')]=_['map'](_0x27cbf1,_0xd890('0x2b'));_0x586641[_0xd890('0x33')]=_['keys'](_0x383bd0[_0xd890('0x33')]);_0x586641[_0xd890('0x34')]=_[_0xd890('0x35')](_0x586641[_0xd890('0x32')],_0x586641[_0xd890('0x33')]);_0x3a2542[_0xd890('0x36')]=_[_0xd890('0x35')](_0x586641[_0xd890('0x32')],qs[_0xd890('0x37')](_0x383bd0[_0xd890('0x33')]['fields']));_0x3a2542[_0xd890('0x36')]=_0x3a2542[_0xd890('0x36')]['length']?_0x3a2542[_0xd890('0x36')]:_0x586641['model'];if(!_0x383bd0[_0xd890('0x33')][_0xd890('0x38')](_0xd890('0x39'))){_0x3a2542[_0xd890('0x1f')]=qs[_0xd890('0x1f')](_0x383bd0['query'][_0xd890('0x1f')]);_0x3a2542['offset']=qs[_0xd890('0x1d')](_0x383bd0[_0xd890('0x33')][_0xd890('0x1d')]);}_0x3a2542[_0xd890('0x3a')]=qs[_0xd890('0x3b')](_0x383bd0[_0xd890('0x33')][_0xd890('0x3b')]);delete _0x383bd0[_0xd890('0x33')][_0xd890('0x3b')];_0x3a2542[_0xd890('0x3c')]=qs[_0xd890('0x34')](_[_0xd890('0x3d')](_0x383bd0[_0xd890('0x33')],_0x586641['filters']),_0x27cbf1);if(_0x383bd0[_0xd890('0x33')]['filter']){_0x3a2542[_0xd890('0x3c')]=_['merge'](_0x3a2542[_0xd890('0x3c')],{'$or':_[_0xd890('0x3e')](_0x27cbf1,function(_0x37adc9){if(_0x37adc9[_0xd890('0x30')]!==_0xd890('0x3f')){var _0x4f5e39={};_0x4f5e39[_0x37adc9[_0xd890('0x2b')]]={'$like':'%'+_0x383bd0['query'][_0xd890('0x40')]+'%'};return _0x4f5e39;}})});}_0x3a2542=_['merge']({},_0x3a2542,_0x383bd0['options']);var _0xf06b15={'where':_0x3a2542[_0xd890('0x3c')]};return db['VoiceMusicOnHold'][_0xd890('0x20')](_0xf06b15)[_0xd890('0x29')](function(_0x45579d){_0x47ed21[_0xd890('0x20')]=_0x45579d;if(_0x383bd0[_0xd890('0x33')][_0xd890('0x41')]){_0x3a2542[_0xd890('0x42')]=[{'all':!![]}];}return db[_0xd890('0x2d')]['findAll'](_0x3a2542);})[_0xd890('0x29')](function(_0xd14386){_0x47ed21[_0xd890('0x43')]=_0xd14386;return _0x47ed21;})[_0xd890('0x29')](respondWithFilteredResult(_0x50b287,_0x3a2542))['catch'](handleError(_0x50b287,null));};exports['show']=function(_0x5606e8,_0x2d676a){var _0x644a5d={'raw':![],'where':{'id':_0x5606e8[_0xd890('0x44')]['id']}},_0x4e2a8d={};_0x4e2a8d[_0xd890('0x32')]=_[_0xd890('0x45')](db[_0xd890('0x2d')][_0xd890('0x2e')]);_0x4e2a8d['query']=_[_0xd890('0x45')](_0x5606e8[_0xd890('0x33')]);_0x4e2a8d['filters']=_[_0xd890('0x35')](_0x4e2a8d[_0xd890('0x32')],_0x4e2a8d[_0xd890('0x33')]);_0x644a5d[_0xd890('0x36')]=_[_0xd890('0x35')](_0x4e2a8d[_0xd890('0x32')],qs[_0xd890('0x37')](_0x5606e8[_0xd890('0x33')]['fields']));_0x644a5d[_0xd890('0x36')]=_0x644a5d[_0xd890('0x36')][_0xd890('0x46')]?_0x644a5d[_0xd890('0x36')]:_0x4e2a8d[_0xd890('0x32')];if(_0x5606e8['query'][_0xd890('0x41')]){_0x644a5d[_0xd890('0x42')]=[{'all':!![]}];}_0x644a5d=_[_0xd890('0x47')]({},_0x644a5d,_0x5606e8['options']);return db['VoiceMusicOnHold'][_0xd890('0x48')](_0x644a5d)[_0xd890('0x29')](handleEntityNotFound(_0x2d676a,null))[_0xd890('0x29')](respondWithResult(_0x2d676a,null))['catch'](handleError(_0x2d676a,null));};exports[_0xd890('0x25')]=function(_0x348379,_0x48857a){if(_0x348379['body']['id']){delete _0x348379[_0xd890('0x49')]['id'];}return db[_0xd890('0x2d')][_0xd890('0x48')]({'where':{'id':_0x348379[_0xd890('0x44')]['id']}})[_0xd890('0x29')](handleEntityNotFound(_0x48857a,null))[_0xd890('0x29')](saveUpdates(_0x348379['body'],null))['then'](respondWithResult(_0x48857a,null))[_0xd890('0x4a')](handleError(_0x48857a,null));};exports[_0xd890('0x4b')]=function(_0x33caee,_0x2fad37,_0x298044){return db[_0xd890('0x4c')][_0xd890('0x4d')](function(_0x1b13c4){if(_0x33caee[_0xd890('0x49')][_0xd890('0x4e')]===_0xd890('0x4f')){_0x33caee[_0xd890('0x49')][_0xd890('0x50')]=path['join'](config['root'],_0xd890('0x51'),_0x33caee[_0xd890('0x49')]['name']);}return db['VoiceMusicOnHold'][_0xd890('0x4b')](_0x33caee[_0xd890('0x49')],{'transaction':_0x1b13c4})[_0xd890('0x29')](function(_0x2b207a){if(_0x33caee[_0xd890('0x49')][_0xd890('0x4e')]===_0xd890('0x4f')){fs[_0xd890('0x52')](_0x2b207a['directory'],parseInt(_0xd890('0x53'),0x8));}var _0xa087c5=_0x33caee['user'][_0xd890('0x27')]({'plain':!![]});if(!_0xa087c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa087c5[_0xd890('0x54')]===_0xd890('0x55')){var _0x1c2390=_0x2b207a['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0xa087c5[_0xd890('0x56')]},'raw':!![]})['then'](function(_0x1e9e7a){if(_0x1e9e7a&&_0x1e9e7a[_0xd890('0x57')]===0x0){return db['UserProfileResource'][_0xd890('0x4b')]({'name':_0x1c2390[_0xd890('0x2b')],'resourceId':_0x1c2390['id'],'type':_0x1e9e7a[_0xd890('0x2b')],'sectionId':_0x1e9e7a['id']},{})[_0xd890('0x29')](function(){return _0x2b207a;});}else{return _0x2b207a;}})[_0xd890('0x4a')](function(_0x12fd8a){logger[_0xd890('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12fd8a);});}return _0x2b207a;});})['then'](respondWithResult(_0x2fad37,0xc9))[_0xd890('0x4a')](handleError(_0x2fad37,null));};exports[_0xd890('0x26')]=function(_0x465a75,_0x2227f7,_0x442104){var _0x775ff0;return db[_0xd890('0x2d')]['find']({'where':{'id':_0x465a75[_0xd890('0x44')]['id']}})[_0xd890('0x29')](function(_0x5acc2d){if(_0x5acc2d){return db[_0xd890('0x4c')][_0xd890('0x4d')](function(_0x368ce7){return _0x5acc2d[_0xd890('0x26')]({'transaction':_0x368ce7,'raw':!![]})[_0xd890('0x29')](function(_0x1177cb){if(_0x1177cb[_0xd890('0x50')]){fs[_0xd890('0x59')](_0x1177cb[_0xd890('0x50')])[_0xd890('0x5a')](function(_0x161d0d){fs['unlinkSync'](path[_0xd890('0x5b')](_0x1177cb[_0xd890('0x50')],_0x161d0d));});fs[_0xd890('0x5c')](_0x1177cb[_0xd890('0x50')]);}return _0x1177cb;});})['catch'](function(_0x6302e2){throw new db[(_0xd890('0x5d'))][(_0xd890('0x5e'))](_0x6302e2[_0xd890('0x5f')]);});}})[_0xd890('0x29')](handleEntityNotFound(_0x2227f7,null))[_0xd890('0x29')](removeEntity(_0x2227f7,null))[_0xd890('0x4a')](handleError(_0x2227f7,null));};exports['addSound']=function(_0x46df51,_0x2433d2,_0x40c994){return db['sequelize'][_0xd890('0x4d')](function(_0x3c2d69){var _0x492ad5;return db[_0xd890('0x2d')][_0xd890('0x48')]({'where':{'id':_0x46df51[_0xd890('0x44')]['id']}})[_0xd890('0x29')](function(_0x12b32a){if(_0x12b32a){_0x492ad5=_0x12b32a;return _0x12b32a[_0xd890('0x60')](_0x46df51[_0xd890('0x49')]['id'],{'transaction':_0x3c2d69});}})[_0xd890('0x29')](function(_0x59f153){if(_0x59f153){return db[_0xd890('0x61')][_0xd890('0x62')]({'where':{'id':_0x46df51[_0xd890('0x49')]['id']},'attributes':['id',_0xd890('0x2b'),_0xd890('0x63'),_0xd890('0x64'),_0xd890('0x65')],'raw':!![]});}})[_0xd890('0x29')](function(_0x322528){if(_0x322528){var _0x58b375=path[_0xd890('0x5b')](config[_0xd890('0x66')],_0xd890('0x67'),util[_0xd890('0x68')](_0xd890('0x69'),path[_0xd890('0x6a')](_0x322528[_0xd890('0x63')],path[_0xd890('0x6b')](_0x322528[_0xd890('0x63')])),_0x322528['converted_format']));var _0x3180a7=path[_0xd890('0x5b')](config['root'],_0xd890('0x51'),_0x492ad5[_0xd890('0x2b')],util[_0xd890('0x68')](_0xd890('0x69'),_0x322528[_0xd890('0x2b')],_0x322528[_0xd890('0x64')]));fs[_0xd890('0x6c')](_0x58b375,_0x3180a7);return _0x322528;}})[_0xd890('0x4a')](function(_0x34331e){throw new db[(_0xd890('0x5d'))][(_0xd890('0x5e'))](_0x34331e[_0xd890('0x5f')]);});})['then'](handleEntityNotFound(_0x2433d2,null))[_0xd890('0x29')](respondWithResult(_0x2433d2,0xc9))[_0xd890('0x4a')](handleError(_0x2433d2,null));};exports['removeSound']=function(_0x52c5e6,_0xa269f1,_0x4e0905){return db[_0xd890('0x4c')][_0xd890('0x4d')](function(_0x4a0f56){var _0x43c2f5;return db[_0xd890('0x2d')][_0xd890('0x62')]({'where':{'id':_0x52c5e6['params']['id']}})['then'](handleEntityNotFound(_0xa269f1,null))[_0xd890('0x29')](function(_0x45a171){if(_0x45a171){_0x43c2f5=_0x45a171;return _0x45a171['removeSound'](_0x52c5e6[_0xd890('0x44')][_0xd890('0x6d')]);}})[_0xd890('0x29')](function(_0x1fdb77){if(_0x1fdb77){return db[_0xd890('0x61')][_0xd890('0x62')]({'where':{'id':_0x52c5e6[_0xd890('0x44')][_0xd890('0x6d')]},'attributes':['id',_0xd890('0x2b'),_0xd890('0x63'),_0xd890('0x64'),'createdAt'],'raw':!![]});}})[_0xd890('0x29')](function(_0x393984){if(_0x393984){fs[_0xd890('0x6e')](path[_0xd890('0x5b')](_0x43c2f5[_0xd890('0x50')],util[_0xd890('0x68')](_0xd890('0x69'),_0x393984[_0xd890('0x2b')],_0x393984[_0xd890('0x64')])));return _0x393984;}})['catch'](function(_0x225324){throw new db[(_0xd890('0x5d'))][(_0xd890('0x5e'))](_0x225324[_0xd890('0x5f')]);});})[_0xd890('0x29')](handleEntityNotFound(_0xa269f1,null))[_0xd890('0x29')](respondWithStatusCode(_0xa269f1,0xcc))['catch'](handleError(_0xa269f1,null));};exports[_0xd890('0x6f')]=function(_0x4c7261,_0x46eec6,_0x32577d){var _0x1ff57f={};var _0x1a9e8a={};var _0x5151d1;var _0x28dad5;return db['VoiceMusicOnHold'][_0xd890('0x62')]({'where':{'id':_0x4c7261[_0xd890('0x44')]['id']}})[_0xd890('0x29')](handleEntityNotFound(_0x46eec6,null))[_0xd890('0x29')](function(_0x279616){if(_0x279616){_0x5151d1=_0x279616;_0x1a9e8a['model']=_[_0xd890('0x45')](db[_0xd890('0x61')][_0xd890('0x2e')]);_0x1a9e8a[_0xd890('0x33')]=_[_0xd890('0x45')](_0x4c7261[_0xd890('0x33')]);_0x1a9e8a[_0xd890('0x34')]=_[_0xd890('0x35')](_0x1a9e8a[_0xd890('0x32')],_0x1a9e8a[_0xd890('0x33')]);_0x1ff57f[_0xd890('0x36')]=_[_0xd890('0x35')](_0x1a9e8a['model'],qs[_0xd890('0x37')](_0x4c7261[_0xd890('0x33')][_0xd890('0x37')]));_0x1ff57f[_0xd890('0x36')]=_0x1ff57f['attributes'][_0xd890('0x46')]?_0x1ff57f[_0xd890('0x36')]:_0x1a9e8a[_0xd890('0x32')];_0x1ff57f[_0xd890('0x3a')]=qs[_0xd890('0x3b')](_0x4c7261[_0xd890('0x33')][_0xd890('0x3b')]);_0x1ff57f[_0xd890('0x3c')]=qs[_0xd890('0x34')](_[_0xd890('0x3d')](_0x4c7261[_0xd890('0x33')],_0x1a9e8a[_0xd890('0x34')]));if(_0x4c7261[_0xd890('0x33')][_0xd890('0x40')]){_0x1ff57f['where']=_[_0xd890('0x47')](_0x1ff57f[_0xd890('0x3c')],{'$or':_['map'](_0x1ff57f[_0xd890('0x36')],function(_0x533d8f){var _0x2d5227={};_0x2d5227[_0x533d8f]={'$like':'%'+_0x4c7261[_0xd890('0x33')][_0xd890('0x40')]+'%'};return _0x2d5227;})});}_0x1ff57f=_[_0xd890('0x47')]({},_0x1ff57f,_0x4c7261[_0xd890('0x70')]);return _0x5151d1[_0xd890('0x6f')](_0x1ff57f);}})['then'](function(_0x301905){if(_0x301905){_0x28dad5=_0x301905[_0xd890('0x46')];if(!_0x4c7261[_0xd890('0x33')]['hasOwnProperty']('nolimit')){_0x1ff57f['limit']=qs[_0xd890('0x1f')](_0x4c7261[_0xd890('0x33')]['limit']);_0x1ff57f[_0xd890('0x1d')]=qs[_0xd890('0x1d')](_0x4c7261[_0xd890('0x33')][_0xd890('0x1d')]);}return _0x5151d1[_0xd890('0x6f')](_0x1ff57f);}})[_0xd890('0x29')](function(_0xf8fb10){if(_0xf8fb10){return _0xf8fb10?{'count':_0x28dad5,'rows':_0xf8fb10}:null;}})[_0xd890('0x29')](respondWithResult(_0x46eec6,null))['catch'](handleError(_0x46eec6,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 39a399e..53fb760 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 _0xc9bc=['rimraf','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc9bc,0xc8));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcc9b('0x0'));var util=require(_0xcc9b('0x1'));var logger=require(_0xcc9b('0x2'))(_0xcc9b('0x3'));var moment=require(_0xcc9b('0x4'));var BPromise=require(_0xcc9b('0x5'));var rp=require(_0xcc9b('0x6'));var fs=require('fs');var path=require(_0xcc9b('0x7'));var rimraf=require(_0xcc9b('0x8'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0xcc9b('0x9')]=function(_0x29a40a,_0x7f4f5b){return _0x29a40a[_0xcc9b('0xa')](_0xcc9b('0xb'),attributes,{'tableName':_0xcc9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06dc=['../../config/logger','moment','request-promise','path','rimraf','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','util'];(function(_0x169602,_0x5c530d){var _0x1f5249=function(_0x37e4fa){while(--_0x37e4fa){_0x169602['push'](_0x169602['shift']());}};_0x1f5249(++_0x5c530d);}(_0x06dc,0x1de));var _0xc06d=function(_0x207061,_0xe38cda){_0x207061=_0x207061-0x0;var _0x4a2833=_0x06dc[_0x207061];return _0x4a2833;};'use strict';var _=require(_0xc06d('0x0'));var util=require(_0xc06d('0x1'));var logger=require(_0xc06d('0x2'))('api');var moment=require(_0xc06d('0x3'));var BPromise=require('bluebird');var rp=require(_0xc06d('0x4'));var fs=require('fs');var path=require(_0xc06d('0x5'));var rimraf=require(_0xc06d('0x6'));var config=require('../../config/environment');var attributes=require(_0xc06d('0x7'));module['exports']=function(_0x4980e6,_0x249324){return _0x4980e6[_0xc06d('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0xc06d('0x9'),'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 059594c..a5d255e 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5aa6ed,_0x16c016){var _0x2d82b5=function(_0x54bf30){while(--_0x54bf30){_0x5aa6ed['push'](_0x5aa6ed['shift']());}};_0x2d82b5(++_0x16c016);}(_0x70e0,0x17b));var _0x070e=function(_0x430caf,_0x53a367){_0x430caf=_0x430caf-0x0;var _0x2543d3=_0x70e0[_0x430caf];return _0x2543d3;};'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')]('VoiceMusicOnHold,\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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4bb8e3,_0x1d7b5b){var _0x548684=function(_0x437b97){while(--_0x437b97){_0x4bb8e3['push'](_0x4bb8e3['shift']());}};_0x548684(++_0x1d7b5b);}(_0x34e8,0x12c));var _0x834e=function(_0x2d9228,_0x322db0){_0x2d9228=_0x2d9228-0x0;var _0x49a20a=_0x34e8[_0x2d9228];return _0x49a20a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index ba34925..bd27fbc 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 _0x1c55=['/:id/users','/:id/teams','post','create','addAgents','delete','removeAgents','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5f1cfd,_0x5d209a){var _0x56cd4f=function(_0x339cca){while(--_0x339cca){_0x5f1cfd['push'](_0x5f1cfd['shift']());}};_0x56cd4f(++_0x5d209a);}(_0x1c55,0x1e3));var _0x51c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c55[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x51c5('0x0'));var util=require(_0x51c5('0x1'));var path=require(_0x51c5('0x2'));var timeout=require(_0x51c5('0x3'));var express=require(_0x51c5('0x4'));var router=express[_0x51c5('0x5')]();var fs_extra=require(_0x51c5('0x6'));var auth=require(_0x51c5('0x7'));var interaction=require(_0x51c5('0x8'));var config=require(_0x51c5('0x9'));var controller=require('./voicePrefix.controller');router[_0x51c5('0xa')]('/',auth[_0x51c5('0xb')](),controller[_0x51c5('0xc')]);router[_0x51c5('0xa')](_0x51c5('0xd'),auth[_0x51c5('0xb')](),controller[_0x51c5('0xe')]);router[_0x51c5('0xa')](_0x51c5('0xf'),auth[_0x51c5('0xb')](),controller[_0x51c5('0x10')]);router[_0x51c5('0xa')](_0x51c5('0x11'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x51c5('0x12'),auth[_0x51c5('0xb')](),controller['getTeams']);router[_0x51c5('0x13')]('/',auth[_0x51c5('0xb')](),controller[_0x51c5('0x14')]);router['post'](_0x51c5('0x11'),auth['isAuthenticated'](),controller[_0x51c5('0x15')]);router[_0x51c5('0x13')](_0x51c5('0x12'),auth[_0x51c5('0xb')](),controller['addTeams']);router['put'](_0x51c5('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x51c5('0xb')](),controller['destroy']);router[_0x51c5('0x16')](_0x51c5('0x11'),auth[_0x51c5('0xb')](),controller[_0x51c5('0x17')]);router[_0x51c5('0x16')](_0x51c5('0x12'),auth[_0x51c5('0xb')](),controller[_0x51c5('0x18')]);module['exports']=router; \ No newline at end of file +var _0xef89=['show','/:id/teams','post','create','/:id/users','addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','describe','get','/:id'];(function(_0x5dd834,_0x315495){var _0x3cd210=function(_0x150af0){while(--_0x150af0){_0x5dd834['push'](_0x5dd834['shift']());}};_0x3cd210(++_0x315495);}(_0xef89,0xf6));var _0x9ef8=function(_0x1db993,_0x317ce1){_0x1db993=_0x1db993-0x0;var _0x398821=_0xef89[_0x1db993];return _0x398821;};'use strict';var multer=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var path=require(_0x9ef8('0x2'));var timeout=require(_0x9ef8('0x3'));var express=require(_0x9ef8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ef8('0x5'));var auth=require(_0x9ef8('0x6'));var interaction=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var controller=require(_0x9ef8('0x9'));router['get']('/',auth[_0x9ef8('0xa')](),controller['index']);router['get']('/describe',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xb')]);router[_0x9ef8('0xc')](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xe')]);router[_0x9ef8('0xc')]('/:id/users',auth[_0x9ef8('0xa')](),controller['getAgents']);router['get'](_0x9ef8('0xf'),auth[_0x9ef8('0xa')](),controller['getTeams']);router[_0x9ef8('0x10')]('/',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x11')]);router[_0x9ef8('0x10')](_0x9ef8('0x12'),auth[_0x9ef8('0xa')](),controller['addAgents']);router['post'](_0x9ef8('0xf'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x13')]);router[_0x9ef8('0x14')](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x15')]);router[_0x9ef8('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x9ef8('0x17')]);router[_0x9ef8('0x16')](_0x9ef8('0x12'),auth['isAuthenticated'](),controller[_0x9ef8('0x18')]);router[_0x9ef8('0x16')](_0x9ef8('0xf'),auth['isAuthenticated'](),controller['removeTeams']);module[_0x9ef8('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d80dd13..b0fa4ac 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 _0x94e5=['STRING','name','VIRTUAL','INTEGER','exports'];(function(_0x171d07,_0x59c974){var _0x135563=function(_0x2aea19){while(--_0x2aea19){_0x171d07['push'](_0x171d07['shift']());}};_0x135563(++_0x59c974);}(_0x94e5,0x1ad));var _0x594e=function(_0x48c6c6,_0xc9941){_0x48c6c6=_0x48c6c6-0x0;var _0x246c6f=_0x94e5[_0x48c6c6];return _0x246c6f;};'use strict';var Sequelize=require('sequelize');module[_0x594e('0x0')]={'name':{'type':Sequelize[_0x594e('0x1')],'allowNull':![],'unique':_0x594e('0x2')},'prefix':{'type':Sequelize[_0x594e('0x3')],'get':function(_0x5cc216){return'system-'+this['getDataValue'](_0x594e('0x2'))+'-';}},'description':{'type':Sequelize[_0x594e('0x1')]},'callerIdAll':{'type':Sequelize[_0x594e('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x594e('0x4')]}}; \ No newline at end of file +var _0x527a=['system-','getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x25e812,_0x1342a2){var _0x727c56=function(_0x243b79){while(--_0x243b79){_0x25e812['push'](_0x25e812['shift']());}};_0x727c56(++_0x1342a2);}(_0x527a,0x10b));var _0xa527=function(_0x568ebb,_0x5b8e54){_0x568ebb=_0x568ebb-0x0;var _0x10bb98=_0x527a[_0x568ebb];return _0x10bb98;};'use strict';var Sequelize=require(_0xa527('0x0'));module[_0xa527('0x1')]={'name':{'type':Sequelize[_0xa527('0x2')],'allowNull':![],'unique':_0xa527('0x3')},'prefix':{'type':Sequelize[_0xa527('0x4')],'get':function(_0x83f69){return _0xa527('0x5')+this[_0xa527('0x6')](_0xa527('0x3'))+'-';}},'description':{'type':Sequelize[_0xa527('0x2')]},'callerIdAll':{'type':Sequelize[_0xa527('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xa527('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index f76916c..5e7b22e 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 _0xb03e=['from','team_has_voice_prefixes','join','user_has_teams','clone','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','keys','fields','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','online','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId'];(function(_0xb2b2b6,_0x54dace){var _0x7d9d=function(_0x122352){while(--_0x122352){_0xb2b2b6['push'](_0xb2b2b6['shift']());}};_0x7d9d(++_0x54dace);}(_0xb03e,0x1eb));var _0xeb03=function(_0x3ab477,_0x16418e){_0x3ab477=_0x3ab477-0x0;var _0x3f589b=_0xb03e[_0x3ab477];return _0x3f589b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];config[_0xeb03('0x1b')]=_[_0xeb03('0x1c')](config[_0xeb03('0x1b')],{'host':_0xeb03('0x1d'),'port':0x18eb});var socket=require(_0xeb03('0x1e'))(new Redis(config[_0xeb03('0x1b')]));require('./voicePrefix.socket')[_0xeb03('0x1f')](socket);function respondWithStatusCode(_0x100bef,_0x372c71){_0x372c71=_0x372c71||0xcc;return function(_0x33f9ba){if(_0x33f9ba){return _0x100bef['sendStatus'](_0x372c71);}return _0x100bef[_0xeb03('0x20')](_0x372c71)[_0xeb03('0x21')]();};}function respondWithResult(_0x3f26ef,_0x478989){_0x478989=_0x478989||0xc8;return function(_0x7ce874){if(_0x7ce874){return _0x3f26ef[_0xeb03('0x20')](_0x478989)[_0xeb03('0x22')](_0x7ce874);}};}function respondWithFilteredResult(_0x44716c,_0x42fa4e){return function(_0x1b4cbd){if(_0x1b4cbd){var _0x167a33=typeof _0x42fa4e[_0xeb03('0x23')]===_0xeb03('0x24')&&typeof _0x42fa4e[_0xeb03('0x25')]===_0xeb03('0x24');var _0x2c238d=_0x1b4cbd[_0xeb03('0x26')];var _0x19bddf=_0x167a33?0x0:_0x42fa4e['offset'];var _0x1bea3f=_0x167a33?_0x1b4cbd[_0xeb03('0x26')]:_0x42fa4e[_0xeb03('0x23')]+_0x42fa4e[_0xeb03('0x25')];var _0xe5a1c2;if(_0x1bea3f>=_0x2c238d){_0x1bea3f=_0x2c238d;_0xe5a1c2=0xc8;}else{_0xe5a1c2=0xce;}_0x44716c[_0xeb03('0x20')](_0xe5a1c2);return _0x44716c[_0xeb03('0x27')](_0xeb03('0x28'),_0x19bddf+'-'+_0x1bea3f+'/'+_0x2c238d)[_0xeb03('0x22')](_0x1b4cbd);}return null;};}function patchUpdates(_0x5a704b){return function(_0x712ac2){try{jsonpatch[_0xeb03('0x29')](_0x712ac2,_0x5a704b,!![]);}catch(_0x11ea85){return BPromise[_0xeb03('0x2a')](_0x11ea85);}return _0x712ac2[_0xeb03('0x2b')]();};}function saveUpdates(_0x5dcda3,_0x638353){return function(_0x406864){if(_0x406864){return _0x406864[_0xeb03('0x2c')](_0x5dcda3)[_0xeb03('0x2d')](function(_0x3f276a){return _0x3f276a;});}return null;};}function removeEntity(_0x119697,_0xb04f34){return function(_0x3f68f3){if(_0x3f68f3){return _0x3f68f3[_0xeb03('0x2e')]()['then'](function(){var _0x832372=_0x3f68f3[_0xeb03('0x2f')]({'plain':!![]});var _0x2683f9=_0xeb03('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x2683f9,'resourceId':_0x832372['id']}})[_0xeb03('0x2d')](function(){return _0x3f68f3;});})['then'](function(){_0x119697[_0xeb03('0x20')](0xcc)[_0xeb03('0x21')]();});}};}function handleEntityNotFound(_0x160a37,_0x5db8bb){return function(_0xd4c8ec){if(!_0xd4c8ec){_0x160a37['sendStatus'](0x194);}return _0xd4c8ec;};}function handleError(_0x5cb729,_0x49e316){_0x49e316=_0x49e316||0x1f4;return function(_0x538d19){logger[_0xeb03('0x31')](_0x538d19[_0xeb03('0x32')]);if(_0x538d19['name']){delete _0x538d19['name'];}_0x5cb729['status'](_0x49e316)['send'](_0x538d19);};}exports[_0xeb03('0x33')]=function(_0x3655c3,_0x32aff7){var _0x2d2ddd={},_0x19fa35={},_0x5234dc={'count':0x0,'rows':[]};var _0x13efc6=_['map'](db[_0xeb03('0x34')][_0xeb03('0x35')],function(_0x19ceae){return{'name':_0x19ceae[_0xeb03('0x36')],'type':_0x19ceae[_0xeb03('0x37')][_0xeb03('0x38')]};});_0x19fa35[_0xeb03('0x39')]=_[_0xeb03('0x3a')](_0x13efc6,'name');_0x19fa35[_0xeb03('0x3b')]=_['keys'](_0x3655c3[_0xeb03('0x3b')]);_0x19fa35[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x19fa35[_0xeb03('0x39')],_0x19fa35[_0xeb03('0x3b')]);_0x2d2ddd[_0xeb03('0x3e')]=_['intersection'](_0x19fa35[_0xeb03('0x39')],qs['fields'](_0x3655c3['query']['fields']));_0x2d2ddd[_0xeb03('0x3e')]=_0x2d2ddd[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x2d2ddd[_0xeb03('0x3e')]:_0x19fa35[_0xeb03('0x39')];if(!_0x3655c3['query'][_0xeb03('0x40')](_0xeb03('0x41'))){_0x2d2ddd[_0xeb03('0x25')]=qs['limit'](_0x3655c3['query'][_0xeb03('0x25')]);_0x2d2ddd[_0xeb03('0x23')]=qs[_0xeb03('0x23')](_0x3655c3['query'][_0xeb03('0x23')]);}_0x2d2ddd[_0xeb03('0x42')]=qs['sort'](_0x3655c3['query'][_0xeb03('0x43')]);_0x2d2ddd[_0xeb03('0x44')]=qs['filters'](_[_0xeb03('0x45')](_0x3655c3[_0xeb03('0x3b')],_0x19fa35[_0xeb03('0x3c')]),_0x13efc6);if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x2d2ddd[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x2d2ddd[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x13efc6,function(_0x286f48){if(_0x286f48[_0xeb03('0x37')]!==_0xeb03('0x48')){var _0x2a9348={};_0x2a9348[_0x286f48[_0xeb03('0x49')]]={'$like':'%'+_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x2a9348;}})});}_0x2d2ddd=_[_0xeb03('0x47')]({},_0x2d2ddd,_0x3655c3[_0xeb03('0x4a')]);var _0x35e53d={'where':_0x2d2ddd[_0xeb03('0x44')]};return db[_0xeb03('0x34')][_0xeb03('0x26')](_0x35e53d)[_0xeb03('0x2d')](function(_0x5bb7d9){_0x5234dc['count']=_0x5bb7d9;if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x4b')]){_0x2d2ddd[_0xeb03('0x4c')]=[{'all':!![]}];}return db[_0xeb03('0x34')][_0xeb03('0x4d')](_0x2d2ddd);})[_0xeb03('0x2d')](function(_0x103c78){_0x5234dc[_0xeb03('0x4e')]=_0x103c78;return _0x5234dc;})['then'](respondWithFilteredResult(_0x32aff7,_0x2d2ddd))[_0xeb03('0x4f')](handleError(_0x32aff7,null));};exports[_0xeb03('0x50')]=function(_0x275d4d,_0xe9dcb0){var _0x528c0f={'raw':![],'where':{'id':_0x275d4d['params']['id']}},_0x57f59e={};_0x57f59e[_0xeb03('0x39')]=_['keys'](db['VoicePrefix']['rawAttributes']);_0x57f59e[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x275d4d[_0xeb03('0x3b')]);_0x57f59e[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x57f59e[_0xeb03('0x39')],_0x57f59e['query']);_0x528c0f[_0xeb03('0x3e')]=_['intersection'](_0x57f59e['model'],qs[_0xeb03('0x52')](_0x275d4d[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x528c0f['attributes']=_0x528c0f[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x528c0f[_0xeb03('0x3e')]:_0x57f59e[_0xeb03('0x39')];if(_0x275d4d[_0xeb03('0x3b')]['includeAll']){_0x528c0f[_0xeb03('0x4c')]=[{'all':!![]}];}_0x528c0f=_['merge']({},_0x528c0f,_0x275d4d[_0xeb03('0x4a')]);return db[_0xeb03('0x34')][_0xeb03('0x53')](_0x528c0f)[_0xeb03('0x2d')](handleEntityNotFound(_0xe9dcb0,null))[_0xeb03('0x2d')](respondWithResult(_0xe9dcb0,null))[_0xeb03('0x4f')](handleError(_0xe9dcb0,null));};exports[_0xeb03('0x2e')]=function(_0x292319,_0x38c993){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x292319[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x38c993,null))[_0xeb03('0x2d')](removeEntity(_0x38c993,null))[_0xeb03('0x4f')](handleError(_0x38c993,null));};exports[_0xeb03('0x55')]=function(_0xf5c1ab,_0x79b7c6){return db[_0xeb03('0x34')][_0xeb03('0x55')]()[_0xeb03('0x2d')](respondWithResult(_0x79b7c6,null))[_0xeb03('0x4f')](handleError(_0x79b7c6,null));};exports[_0xeb03('0x56')]=function(_0x365520,_0x509d79){var _0x17112e;return db[_0xeb03('0x57')][_0xeb03('0x58')](function(_0x5405b4){return db[_0xeb03('0x34')][_0xeb03('0x56')](_0x365520[_0xeb03('0x59')],{'transaction':_0x5405b4})[_0xeb03('0x2d')](function(_0x103da5){_0x17112e=_0x103da5[_0xeb03('0x2f')]({'plain':!![]});return db[_0xeb03('0x5a')][_0xeb03('0x53')]({'where':{'id':_0x17112e[_0xeb03('0x5b')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x46f52e){return createVoicePrefixExtensions(_0x17112e,_0x46f52e,_0x5405b4);});});})[_0xeb03('0x2d')](function(){var _0xf9beaf=_0x365520[_0xeb03('0x5c')]['get']({'plain':!![]});if(!_0xf9beaf)throw new Error(_0xeb03('0x5d'));if(_0xf9beaf[_0xeb03('0x5e')]===_0xeb03('0x5c')){var _0x259db7=_0x17112e;return db[_0xeb03('0x5f')][_0xeb03('0x53')]({'where':{'name':_0xeb03('0x30'),'userProfileId':_0xf9beaf[_0xeb03('0x60')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x23406a){if(_0x23406a&&_0x23406a['autoAssociation']===0x0){return db[_0xeb03('0x61')][_0xeb03('0x56')]({'name':_0x259db7[_0xeb03('0x49')],'resourceId':_0x259db7['id'],'type':_0x23406a[_0xeb03('0x49')],'sectionId':_0x23406a['id']},{})['then'](function(){return _0x17112e;});}else{return _0x17112e;}})[_0xeb03('0x4f')](function(_0x68e1b7){logger[_0xeb03('0x31')](_0xeb03('0x62'),_0x68e1b7);throw _0x68e1b7;});}return _0x17112e;})[_0xeb03('0x2d')](respondWithResult(_0x509d79,null))['catch'](handleError(_0x509d79,null));};function Extension(_0x43efc3,_0x10beeb,_0x28e488,_0x5e1361){this[_0xeb03('0x63')]=_0xeb03('0x64');this['exten']=_0x43efc3;this[_0xeb03('0x65')]=_0x28e488;this[_0xeb03('0x37')]=_0xeb03('0x66');this['description']=_0xeb03('0x67');this[_0xeb03('0x68')]=_0x10beeb;this['appdata']=_0x5e1361;}function createVoicePrefixExtensions(_0x3eb482,_0xfeb8e2,_0x1972fb){return new BPromise(function(_0x3ac2de,_0x3963a7){var _0x38618e=new Extension(formatPrefixName(_0x3eb482[_0xeb03('0x69')]),0x1,_0xeb03('0x6a'),'Voice\x20Prefix');_0x38618e[_0xeb03('0x6b')]=_0x3eb482['id'];return db['VoiceExtension'][_0xeb03('0x56')](_0x38618e,{'transaction':_0x1972fb})[_0xeb03('0x2d')](function(_0x3a9518){var _0x59d0c7=_0x3a9518[_0xeb03('0x2f')]({'plain':!![]});var _0x1508f6=_[_0xeb03('0x3a')](addVoicePrefixExtensions(_0x3eb482,_0xfeb8e2),function(_0x467a9d){_0x467a9d['VoiceExtensionId']=_0x59d0c7['id'];_0x467a9d[_0xeb03('0x6b')]=_0x3eb482['id'];return _0x467a9d;});return db[_0xeb03('0x5a')]['bulkCreate'](_0x1508f6,{'transaction':_0x1972fb})['then'](function(_0x583518){if(!_0x583518){return _0x3963a7(_0xeb03('0x6c'));}else{return _0x3ac2de(_0x583518);}})[_0xeb03('0x4f')](function(_0x9148a6){return _0x3963a7(_0x9148a6);});});;});};function addVoicePrefixExtensions(_0x16ad3a,_0x3da5f4){var _0x461777=[];var _0x443fc9=formatPrefixName(_0x16ad3a[_0xeb03('0x69')]);_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x2,'Set','CDR(prefix)='+_0x16ad3a[_0xeb03('0x49')]));if(_0x16ad3a[_0xeb03('0x6e')]){_0x461777['push'](new Extension(_0x443fc9,0x3,_0xeb03('0x6f'),_0xeb03('0x70')+_0x16ad3a[_0xeb03('0x6e')]));}else{_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x3,'NoOp','No\x20callerid\x20available'));}_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x4,_0xeb03('0x71'),_0x3da5f4[_0xeb03('0x63')]+','+_0xeb03('0x72')+(0x8+_0x16ad3a[_0xeb03('0x49')][_0xeb03('0x3f')])+'}'+','+0x1));return _0x461777;}function formatPrefixName(_0x1a8057){var _0x2ee5c1='_';for(var _0x2e67a4=0x0;_0x2e67a4<_0x1a8057[_0xeb03('0x3f')];_0x2e67a4++){if(_0x1a8057[_0xeb03('0x73')](_0x2e67a4)=='-'){_0x2ee5c1+=_0x1a8057['charAt'](_0x2e67a4);}else{_0x2ee5c1+='['+_0x1a8057['charAt'](_0x2e67a4)+']';}}_0x2ee5c1+='.';return _0x2ee5c1;}exports[_0xeb03('0x2c')]=function(_0x4e52a4,_0x1099ff,_0x4cf4f1){var _0x30623a=_0x4e52a4['body'];_0x30623a[_0xeb03('0x69')]=_0xeb03('0x74')+_0x30623a['name']+'-';return db[_0xeb03('0x57')]['transaction'](function(_0x45f0aa){return db['VoicePrefix'][_0xeb03('0x2c')](_0x30623a,{'where':{'id':_0x30623a['id']},'transaction':_0x45f0aa})['then'](function(){return db['VoiceExtension'][_0xeb03('0x2e')]({'where':{'VoicePrefixId':_0x30623a['id']},'transaction':_0x45f0aa})[_0xeb03('0x2d')](function(){return db[_0xeb03('0x5a')][_0xeb03('0x53')]({'where':{'id':_0x30623a[_0xeb03('0x5b')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x39c15d){return createVoicePrefixExtensions(_0x30623a,_0x39c15d,_0x45f0aa);});});});})['then'](function(){return db[_0xeb03('0x34')][_0xeb03('0x75')](_0x30623a['id']);})[_0xeb03('0x2d')](respondWithResult(_0x1099ff,null))[_0xeb03('0x4f')](handleError(_0x1099ff,null));};exports[_0xeb03('0x76')]=function(_0x126a7f,_0x137a98,_0x4fff6e){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x126a7f[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x137a98,null))[_0xeb03('0x2d')](function(_0xcd7ab1){if(_0xcd7ab1){return _0xcd7ab1[_0xeb03('0x76')](_0x126a7f[_0xeb03('0x59')]['ids'],_[_0xeb03('0x77')](_0x126a7f[_0xeb03('0x59')],[_0xeb03('0x78'),'id'])||{})[_0xeb03('0x79')](function(_0x17c010){for(var _0x5ace77=0x0;_0x5ace77<_0x126a7f[_0xeb03('0x59')][_0xeb03('0x78')][_0xeb03('0x3f')];_0x5ace77+=0x1){socket[_0xeb03('0x7a')](_0xeb03('0x7b'),{'UserId':Number(_0x126a7f[_0xeb03('0x59')][_0xeb03('0x78')][_0x5ace77]),'VoicePrefixId':Number(_0x126a7f['params']['id'])});}return _0x17c010;});}})[_0xeb03('0x2d')](respondWithResult(_0x137a98,null))[_0xeb03('0x4f')](handleError(_0x137a98,null));};exports[_0xeb03('0x7c')]=function(_0x21dfab,_0x396329,_0x48dc21){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x21dfab[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x396329,null))[_0xeb03('0x2d')](function(_0x215759){if(_0x215759){return _0x215759[_0xeb03('0x7c')](_0x21dfab['query'][_0xeb03('0x78')])[_0xeb03('0x2d')](function(){if(_[_0xeb03('0x7d')](_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')])){for(var _0x388fbd=0x0;_0x388fbd<_0x21dfab['query'][_0xeb03('0x78')][_0xeb03('0x3f')];_0x388fbd+=0x1){socket[_0xeb03('0x7a')]('userVoicePrefix:remove',{'UserId':Number(_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')][_0x388fbd]),'VoicePrefixId':Number(_0x21dfab[_0xeb03('0x54')]['id'])});}}else{socket[_0xeb03('0x7a')](_0xeb03('0x7e'),{'UserId':Number(_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')]),'VoicePrefixId':Number(_0x21dfab['params']['id'])});}});}})['then'](respondWithStatusCode(_0x396329,null))[_0xeb03('0x4f')](handleError(_0x396329,null));};exports[_0xeb03('0x7f')]=function(_0x3630a7,_0xe55200,_0x511e5a){var _0x8ba377={};var _0x42c477={};var _0x5b60a4;var _0x45fd83;return db[_0xeb03('0x34')][_0xeb03('0x80')]({'where':{'id':_0x3630a7[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0xe55200,null))[_0xeb03('0x2d')](function(_0x5ea593){if(_0x5ea593){_0x5b60a4=_0x5ea593;_0x42c477[_0xeb03('0x39')]=_[_0xeb03('0x51')](db[_0xeb03('0x81')][_0xeb03('0x35')]);_0x42c477[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x3630a7[_0xeb03('0x3b')]);_0x42c477[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x42c477[_0xeb03('0x39')],_0x42c477['query']);_0x8ba377[_0xeb03('0x3e')]=_[_0xeb03('0x3d')](_0x42c477['model'],qs[_0xeb03('0x52')](_0x3630a7[_0xeb03('0x3b')]['fields']));_0x8ba377[_0xeb03('0x3e')]=_0x8ba377[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x8ba377[_0xeb03('0x3e')]:_0x42c477[_0xeb03('0x39')];_0x8ba377['order']=qs['sort'](_0x3630a7['query'][_0xeb03('0x43')]);_0x8ba377['where']=qs[_0xeb03('0x3c')](_[_0xeb03('0x45')](_0x3630a7[_0xeb03('0x3b')],_0x42c477[_0xeb03('0x3c')]));if(_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x8ba377[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x8ba377[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x8ba377[_0xeb03('0x3e')],function(_0x27a388){var _0x4ec45c={};_0x4ec45c[_0x27a388]={'$like':'%'+_0x3630a7['query'][_0xeb03('0x46')]+'%'};return _0x4ec45c;})});}_0x8ba377=_['merge']({},_0x8ba377,_0x3630a7['options']);return _0x5b60a4[_0xeb03('0x7f')](_0x8ba377);}})[_0xeb03('0x2d')](function(_0x502b25){if(_0x502b25){_0x45fd83=_0x502b25['length'];if(!_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x40')]('nolimit')){_0x8ba377[_0xeb03('0x25')]=qs[_0xeb03('0x25')](_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x8ba377[_0xeb03('0x23')]=qs['offset'](_0x3630a7[_0xeb03('0x3b')]['offset']);}return _0x5b60a4['getAgents'](_0x8ba377);}})[_0xeb03('0x2d')](function(_0x2d12eb){if(_0x2d12eb){return _0x2d12eb?{'count':_0x45fd83,'rows':_0x2d12eb}:null;}})[_0xeb03('0x2d')](respondWithResult(_0xe55200,null))[_0xeb03('0x4f')](handleError(_0xe55200,null));};exports['getTeams']=function(_0x4b59f4,_0xf9f2d3,_0x847253){var _0x70343f={};var _0x2d6225={};var _0x388642;var _0x3dc483;return db[_0xeb03('0x34')][_0xeb03('0x80')]({'where':{'id':_0x4b59f4['params']['id']}})['then'](handleEntityNotFound(_0xf9f2d3,null))[_0xeb03('0x2d')](function(_0x5741d4){if(_0x5741d4){_0x388642=_0x5741d4;_0x2d6225[_0xeb03('0x39')]=_['keys'](db[_0xeb03('0x82')][_0xeb03('0x35')]);_0x2d6225[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x4b59f4[_0xeb03('0x3b')]);_0x2d6225[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x2d6225[_0xeb03('0x39')],_0x2d6225['query']);_0x70343f['attributes']=_[_0xeb03('0x3d')](_0x2d6225[_0xeb03('0x39')],qs[_0xeb03('0x52')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x70343f['attributes']=_0x70343f[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x70343f['attributes']:_0x2d6225[_0xeb03('0x39')];_0x70343f[_0xeb03('0x42')]=qs[_0xeb03('0x43')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x43')]);_0x70343f[_0xeb03('0x44')]=qs[_0xeb03('0x3c')](_[_0xeb03('0x45')](_0x4b59f4[_0xeb03('0x3b')],_0x2d6225[_0xeb03('0x3c')]));if(_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x70343f[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x70343f['where'],{'$or':_[_0xeb03('0x3a')](_0x70343f[_0xeb03('0x3e')],function(_0x4c6b85){var _0x1f3ee1={};_0x1f3ee1[_0x4c6b85]={'$like':'%'+_0x4b59f4['query'][_0xeb03('0x46')]+'%'};return _0x1f3ee1;})});}_0x70343f=_['merge']({},_0x70343f,_0x4b59f4[_0xeb03('0x4a')]);return _0x388642[_0xeb03('0x83')](_0x70343f);}})[_0xeb03('0x2d')](function(_0x1df994){if(_0x1df994){_0x3dc483=_0x1df994[_0xeb03('0x3f')];if(!_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x40')](_0xeb03('0x41'))){_0x70343f['limit']=qs[_0xeb03('0x25')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x70343f[_0xeb03('0x23')]=qs['offset'](_0x4b59f4[_0xeb03('0x3b')]['offset']);}return _0x388642[_0xeb03('0x83')](_0x70343f);}})[_0xeb03('0x2d')](function(_0x423ddd){if(_0x423ddd){return _0x423ddd?{'count':_0x3dc483,'rows':_0x423ddd}:null;}})[_0xeb03('0x2d')](respondWithResult(_0xf9f2d3,null))['catch'](handleError(_0xf9f2d3,null));};exports[_0xeb03('0x84')]=function(_0x473d63,_0x1fc15a,_0x45f4d3){var _0x5095a6=_0x473d63[_0xeb03('0x59')]['ids'];var _0x4e0fd8;return db['Team'][_0xeb03('0x4d')]({'where':{'id':_0x5095a6},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb03('0x85'),'attributes':['id',_0xeb03('0x49'),_0xeb03('0x86'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x50b2c5){if(_0x50b2c5){_0x4e0fd8=_0x50b2c5;var _0x5c7f6e=_[_0xeb03('0x87')](_0x50b2c5,function(_0x392aaa){var _0x117c5e=_0x392aaa[_0xeb03('0x2f')]({'plain':!![]});return _0x117c5e[_0xeb03('0x85')];});return db[_0xeb03('0x34')]['find']({'where':{'id':_0x473d63[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](function(_0x2d8bca){return db[_0xeb03('0x57')]['transaction'](function(_0x5c49c9){return _0x2d8bca[_0xeb03('0x84')](_0x5095a6,{'transaction':_0x5c49c9})[_0xeb03('0x2d')](function(){return BPromise['each'](_0x4e0fd8,function(_0xc7a504){return db[_0xeb03('0x88')][_0xeb03('0x89')]({'TeamId':_0xc7a504['id'],'VoicePrefixId':_0x473d63[_0xeb03('0x54')]['id']},{'transaction':_0x5c49c9});});})[_0xeb03('0x2d')](function(){return BPromise[_0xeb03('0x8a')](_0x5c7f6e,function(_0x11cc99){return db['UserVoicePrefix'][_0xeb03('0x8b')]({'where':{'UserId':_0x11cc99['id'],'VoicePrefixId':_0x473d63[_0xeb03('0x54')]['id']},'transaction':_0x5c49c9});});})[_0xeb03('0x2d')](function(){_0x5c7f6e[_0xeb03('0x8c')](function(_0x1f2ebe){socket[_0xeb03('0x7a')](_0xeb03('0x7b'),{'UserId':_0x1f2ebe['id'],'VoicePrefixId':_0x2d8bca['id']});});});});});}})[_0xeb03('0x2d')](respondWithStatusCode(_0x1fc15a,null))['catch'](handleError(_0x1fc15a,null));};exports[_0xeb03('0x8d')]=function(_0x5e0e2b,_0x497a5b,_0x188d39){return db[_0xeb03('0x82')]['findAll']({'where':{'id':_0x5e0e2b[_0xeb03('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xeb03('0x81')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeb03('0x2d')](handleEntityNotFound(_0x497a5b,null))[_0xeb03('0x2d')](function(_0xd6f37b){var _0x1522d4=_[_0xeb03('0x3a')](_0xd6f37b,'id');var _0x47b648=[];var _0x15a726=[];var _0x226569=squel[_0xeb03('0x8e')]();_0x226569[_0xeb03('0x8f')](_0xeb03('0x90'))[_0xeb03('0x91')](_0xeb03('0x92'),'tq')[_0xeb03('0x93')](_0xeb03('0x94'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x5e0e2b[_0xeb03('0x54')]['id']);for(var _0x40a6ce=0x0;_0x40a6ce<_0xd6f37b[_0xeb03('0x3f')];_0x40a6ce+=0x1){let _0x2f640d=_0xd6f37b[_0x40a6ce];for(var _0x546ebe=0x0;_0x546ebe<_0x2f640d['Agents']['length'];_0x546ebe+=0x1){let _0x3d861f=_0x2f640d[_0xeb03('0x85')][_0x546ebe];var _0x2c89c4=_0x226569[_0xeb03('0x95')]();_0x2c89c4[_0xeb03('0x44')]('ut.UserId\x20=\x20?',_0x3d861f['id']);_0x15a726[_0xeb03('0x6d')](db[_0xeb03('0x57')]['query'](_0x2c89c4[_0xeb03('0x96')](),{'type':db['sequelize']['QueryTypes'][_0xeb03('0x97')]})[_0xeb03('0x2d')](function(_0x123742){if(_0x123742['length']===0x1){return _0x3d861f['id'];}else{var _0x243689=_[_0xeb03('0x98')](_['map'](_0x123742,_0xeb03('0x99')),function(_0x5eb15a){return _['includes'](_0x1522d4,_0x5eb15a);});if(_0x243689){return _0x3d861f['id'];}}}));}}return BPromise[_0xeb03('0x9a')](_0x15a726)[_0xeb03('0x2d')](function(_0x366054){_0x47b648=_(_0x47b648)[_0xeb03('0x9b')](_0x366054)[_0xeb03('0x9c')]()[_0xeb03('0x9d')]();return db['VoicePrefix'][_0xeb03('0x53')]({'where':{'id':_0x5e0e2b[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](function(_0x1f0387){return db[_0xeb03('0x57')][_0xeb03('0x58')](function(_0xf0d912){return _0x1f0387[_0xeb03('0x8d')](_0x5e0e2b[_0xeb03('0x3b')][_0xeb03('0x78')],{'transaction':_0xf0d912})[_0xeb03('0x2d')](function(){if(!_[_0xeb03('0x9e')](_0x47b648)){return _0x1f0387[_0xeb03('0x7c')](_0x47b648,{'transaction':_0xf0d912});}})[_0xeb03('0x2d')](function(){_0x47b648[_0xeb03('0x8c')](function(_0x1a0bb5){socket[_0xeb03('0x7a')](_0xeb03('0x7e'),{'UserId':_0x1a0bb5,'VoicePrefixId':_0x1f0387['id']});});});});});});})[_0xeb03('0x2d')](respondWithStatusCode(_0x497a5b,null))[_0xeb03('0x4f')](handleError(_0x497a5b,null));}; \ No newline at end of file +var _0xf7b4=['filter','nolimit','User','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','options','find','describe','sequelize','transaction','create','body','get','VoiceExtension','VoiceExtensionId','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','update','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','filters','getTeams','Team'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0xf7b4,0x152));var _0x4f7b=function(_0x4b1fc2,_0x2b0e9d){_0x4b1fc2=_0x4b1fc2-0x0;var _0x2be5d9=_0xf7b4[_0x4b1fc2];return _0x2be5d9;};'use strict';var emlformat=require(_0x4f7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7b('0x1'));var rp=require(_0x4f7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f7b('0x3'));var util=require(_0x4f7b('0x4'));var path=require(_0x4f7b('0x5'));var sox=require(_0x4f7b('0x6'));var csv=require(_0x4f7b('0x7'));var ejs=require(_0x4f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7b('0x9'));var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x7'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4f7b('0x17')]=_[_0x4f7b('0x18')](config[_0x4f7b('0x17')],{'host':_0x4f7b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f7b('0x17')]));require(_0x4f7b('0x1a'))[_0x4f7b('0x1b')](socket);function respondWithStatusCode(_0x43a51a,_0x339486){_0x339486=_0x339486||0xcc;return function(_0x330de9){if(_0x330de9){return _0x43a51a[_0x4f7b('0x1c')](_0x339486);}return _0x43a51a[_0x4f7b('0x1d')](_0x339486)[_0x4f7b('0x1e')]();};}function respondWithResult(_0x29fdd5,_0x1a28b8){_0x1a28b8=_0x1a28b8||0xc8;return function(_0x1e7afc){if(_0x1e7afc){return _0x29fdd5['status'](_0x1a28b8)[_0x4f7b('0x1f')](_0x1e7afc);}};}function respondWithFilteredResult(_0x496322,_0x5b5ee3){return function(_0x24e5cf){if(_0x24e5cf){var _0x3813da=typeof _0x5b5ee3['offset']===_0x4f7b('0x20')&&typeof _0x5b5ee3[_0x4f7b('0x21')]===_0x4f7b('0x20');var _0xf2311f=_0x24e5cf['count'];var _0x1daa79=_0x3813da?0x0:_0x5b5ee3['offset'];var _0x41cf36=_0x3813da?_0x24e5cf[_0x4f7b('0x22')]:_0x5b5ee3[_0x4f7b('0x23')]+_0x5b5ee3[_0x4f7b('0x21')];var _0x27127b;if(_0x41cf36>=_0xf2311f){_0x41cf36=_0xf2311f;_0x27127b=0xc8;}else{_0x27127b=0xce;}_0x496322[_0x4f7b('0x1d')](_0x27127b);return _0x496322[_0x4f7b('0x24')](_0x4f7b('0x25'),_0x1daa79+'-'+_0x41cf36+'/'+_0xf2311f)[_0x4f7b('0x1f')](_0x24e5cf);}return null;};}function patchUpdates(_0x5508bd){return function(_0x410176){try{jsonpatch[_0x4f7b('0x26')](_0x410176,_0x5508bd,!![]);}catch(_0x2c9ea6){return BPromise['reject'](_0x2c9ea6);}return _0x410176[_0x4f7b('0x27')]();};}function saveUpdates(_0x4610a4,_0x5d22f4){return function(_0x15dbec){if(_0x15dbec){return _0x15dbec['update'](_0x4610a4)[_0x4f7b('0x28')](function(_0x2429be){return _0x2429be;});}return null;};}function removeEntity(_0x23c820,_0x278c41){return function(_0x17aa9d){if(_0x17aa9d){return _0x17aa9d[_0x4f7b('0x29')]()[_0x4f7b('0x28')](function(){var _0x3ad769=_0x17aa9d['get']({'plain':!![]});var _0x6c9626=_0x4f7b('0x2a');return db[_0x4f7b('0x2b')]['destroy']({'where':{'type':_0x6c9626,'resourceId':_0x3ad769['id']}})[_0x4f7b('0x28')](function(){return _0x17aa9d;});})[_0x4f7b('0x28')](function(){_0x23c820[_0x4f7b('0x1d')](0xcc)[_0x4f7b('0x1e')]();});}};}function handleEntityNotFound(_0x1ccce0,_0x4ebffa){return function(_0xac1f93){if(!_0xac1f93){_0x1ccce0[_0x4f7b('0x1c')](0x194);}return _0xac1f93;};}function handleError(_0x9a675c,_0x59d3ad){_0x59d3ad=_0x59d3ad||0x1f4;return function(_0x7de561){logger['error'](_0x7de561['stack']);if(_0x7de561[_0x4f7b('0x2c')]){delete _0x7de561['name'];}_0x9a675c[_0x4f7b('0x1d')](_0x59d3ad)[_0x4f7b('0x2d')](_0x7de561);};}exports[_0x4f7b('0x2e')]=function(_0x1cf980,_0x105ffb){var _0x4e5862={},_0x13a113={},_0x179372={'count':0x0,'rows':[]};var _0xba46b8=_[_0x4f7b('0x2f')](db[_0x4f7b('0x30')][_0x4f7b('0x31')],function(_0x3e7fb4){return{'name':_0x3e7fb4[_0x4f7b('0x32')],'type':_0x3e7fb4[_0x4f7b('0x33')][_0x4f7b('0x34')]};});_0x13a113[_0x4f7b('0x35')]=_[_0x4f7b('0x2f')](_0xba46b8,_0x4f7b('0x2c'));_0x13a113[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x1cf980[_0x4f7b('0x36')]);_0x13a113['filters']=_[_0x4f7b('0x38')](_0x13a113['model'],_0x13a113[_0x4f7b('0x36')]);_0x4e5862[_0x4f7b('0x39')]=_['intersection'](_0x13a113[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1cf980[_0x4f7b('0x36')]['fields']));_0x4e5862[_0x4f7b('0x39')]=_0x4e5862[_0x4f7b('0x39')][_0x4f7b('0x3b')]?_0x4e5862[_0x4f7b('0x39')]:_0x13a113[_0x4f7b('0x35')];if(!_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x3c')]('nolimit')){_0x4e5862[_0x4f7b('0x21')]=qs['limit'](_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x21')]);_0x4e5862[_0x4f7b('0x23')]=qs['offset'](_0x1cf980[_0x4f7b('0x36')]['offset']);}_0x4e5862[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1cf980['query']['sort']);_0x4e5862[_0x4f7b('0x3f')]=qs['filters'](_[_0x4f7b('0x40')](_0x1cf980[_0x4f7b('0x36')],_0x13a113['filters']),_0xba46b8);if(_0x1cf980[_0x4f7b('0x36')]['filter']){_0x4e5862['where']=_['merge'](_0x4e5862[_0x4f7b('0x3f')],{'$or':_[_0x4f7b('0x2f')](_0xba46b8,function(_0xa5532b){if(_0xa5532b[_0x4f7b('0x33')]!=='VIRTUAL'){var _0x3da93f={};_0x3da93f[_0xa5532b['name']]={'$like':'%'+_0x1cf980[_0x4f7b('0x36')]['filter']+'%'};return _0x3da93f;}})});}_0x4e5862=_[_0x4f7b('0x41')]({},_0x4e5862,_0x1cf980['options']);var _0x2c2b10={'where':_0x4e5862[_0x4f7b('0x3f')]};return db[_0x4f7b('0x30')][_0x4f7b('0x22')](_0x2c2b10)[_0x4f7b('0x28')](function(_0x325cd6){_0x179372[_0x4f7b('0x22')]=_0x325cd6;if(_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x42')]){_0x4e5862[_0x4f7b('0x43')]=[{'all':!![]}];}return db[_0x4f7b('0x30')][_0x4f7b('0x44')](_0x4e5862);})[_0x4f7b('0x28')](function(_0x508eaa){_0x179372[_0x4f7b('0x45')]=_0x508eaa;return _0x179372;})[_0x4f7b('0x28')](respondWithFilteredResult(_0x105ffb,_0x4e5862))[_0x4f7b('0x46')](handleError(_0x105ffb,null));};exports[_0x4f7b('0x47')]=function(_0x5cfca1,_0x581356){var _0x10d0ac={'raw':![],'where':{'id':_0x5cfca1[_0x4f7b('0x48')]['id']}},_0x1d1e10={};_0x1d1e10[_0x4f7b('0x35')]=_['keys'](db['VoicePrefix'][_0x4f7b('0x31')]);_0x1d1e10[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x5cfca1[_0x4f7b('0x36')]);_0x1d1e10['filters']=_['intersection'](_0x1d1e10[_0x4f7b('0x35')],_0x1d1e10[_0x4f7b('0x36')]);_0x10d0ac[_0x4f7b('0x39')]=_[_0x4f7b('0x38')](_0x1d1e10[_0x4f7b('0x35')],qs['fields'](_0x5cfca1[_0x4f7b('0x36')][_0x4f7b('0x3a')]));_0x10d0ac[_0x4f7b('0x39')]=_0x10d0ac['attributes'][_0x4f7b('0x3b')]?_0x10d0ac[_0x4f7b('0x39')]:_0x1d1e10[_0x4f7b('0x35')];if(_0x5cfca1[_0x4f7b('0x36')][_0x4f7b('0x42')]){_0x10d0ac[_0x4f7b('0x43')]=[{'all':!![]}];}_0x10d0ac=_[_0x4f7b('0x41')]({},_0x10d0ac,_0x5cfca1[_0x4f7b('0x49')]);return db[_0x4f7b('0x30')][_0x4f7b('0x4a')](_0x10d0ac)['then'](handleEntityNotFound(_0x581356,null))[_0x4f7b('0x28')](respondWithResult(_0x581356,null))[_0x4f7b('0x46')](handleError(_0x581356,null));};exports[_0x4f7b('0x29')]=function(_0x5003f1,_0x16eaef){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x5003f1[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x16eaef,null))[_0x4f7b('0x28')](removeEntity(_0x16eaef,null))[_0x4f7b('0x46')](handleError(_0x16eaef,null));};exports[_0x4f7b('0x4b')]=function(_0x776ce7,_0x23d5f3){return db['VoicePrefix'][_0x4f7b('0x4b')]()[_0x4f7b('0x28')](respondWithResult(_0x23d5f3,null))[_0x4f7b('0x46')](handleError(_0x23d5f3,null));};exports['create']=function(_0x2c9cee,_0x40c183){var _0xeeb227;return db[_0x4f7b('0x4c')][_0x4f7b('0x4d')](function(_0x819fb3){return db['VoicePrefix'][_0x4f7b('0x4e')](_0x2c9cee[_0x4f7b('0x4f')],{'transaction':_0x819fb3})[_0x4f7b('0x28')](function(_0x4c9496){_0xeeb227=_0x4c9496[_0x4f7b('0x50')]({'plain':!![]});return db[_0x4f7b('0x51')][_0x4f7b('0x4a')]({'where':{'id':_0xeeb227[_0x4f7b('0x52')]},'raw':!![]})[_0x4f7b('0x28')](function(_0x6e448f){return createVoicePrefixExtensions(_0xeeb227,_0x6e448f,_0x819fb3);});});})['then'](function(){var _0x13bb98=_0x2c9cee['user']['get']({'plain':!![]});if(!_0x13bb98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13bb98[_0x4f7b('0x53')]===_0x4f7b('0x54')){var _0x27b2e1=_0xeeb227;return db['UserProfileSection']['find']({'where':{'name':_0x4f7b('0x2a'),'userProfileId':_0x13bb98[_0x4f7b('0x55')]},'raw':!![]})['then'](function(_0xf957ca){if(_0xf957ca&&_0xf957ca[_0x4f7b('0x56')]===0x0){return db[_0x4f7b('0x2b')][_0x4f7b('0x4e')]({'name':_0x27b2e1['name'],'resourceId':_0x27b2e1['id'],'type':_0xf957ca[_0x4f7b('0x2c')],'sectionId':_0xf957ca['id']},{})[_0x4f7b('0x28')](function(){return _0xeeb227;});}else{return _0xeeb227;}})[_0x4f7b('0x46')](function(_0x42b378){logger[_0x4f7b('0x57')](_0x4f7b('0x58'),_0x42b378);throw _0x42b378;});}return _0xeeb227;})[_0x4f7b('0x28')](respondWithResult(_0x40c183,null))['catch'](handleError(_0x40c183,null));};function Extension(_0x529821,_0x507199,_0x133074,_0x5530cb){this['context']='from-sip';this['exten']=_0x529821;this[_0x4f7b('0x59')]=_0x133074;this[_0x4f7b('0x33')]=_0x4f7b('0x5a');this[_0x4f7b('0x5b')]=_0x4f7b('0x5c');this[_0x4f7b('0x5d')]=_0x507199;this[_0x4f7b('0x5e')]=_0x5530cb;}function createVoicePrefixExtensions(_0x80efcb,_0x1d500c,_0x2a80fe){return new BPromise(function(_0x31bed4,_0x12456e){var _0x1ba432=new Extension(formatPrefixName(_0x80efcb[_0x4f7b('0x5f')]),0x1,_0x4f7b('0x60'),_0x4f7b('0x61'));_0x1ba432[_0x4f7b('0x62')]=_0x80efcb['id'];return db[_0x4f7b('0x51')]['create'](_0x1ba432,{'transaction':_0x2a80fe})[_0x4f7b('0x28')](function(_0x46d15c){var _0x3c5b28=_0x46d15c[_0x4f7b('0x50')]({'plain':!![]});var _0x321f36=_['map'](addVoicePrefixExtensions(_0x80efcb,_0x1d500c),function(_0x4b9f3a){_0x4b9f3a[_0x4f7b('0x52')]=_0x3c5b28['id'];_0x4b9f3a['VoicePrefixId']=_0x80efcb['id'];return _0x4b9f3a;});return db[_0x4f7b('0x51')][_0x4f7b('0x63')](_0x321f36,{'transaction':_0x2a80fe})[_0x4f7b('0x28')](function(_0x7509ab){if(!_0x7509ab){return _0x12456e('Extensions\x20creation\x20failed');}else{return _0x31bed4(_0x7509ab);}})[_0x4f7b('0x46')](function(_0x35b569){return _0x12456e(_0x35b569);});});;});};function addVoicePrefixExtensions(_0x5a6db0,_0x58baa5){var _0x4b2089=[];var _0x5b16cb=formatPrefixName(_0x5a6db0[_0x4f7b('0x5f')]);_0x4b2089['push'](new Extension(_0x5b16cb,0x2,'Set','CDR(prefix)='+_0x5a6db0[_0x4f7b('0x2c')]));if(_0x5a6db0[_0x4f7b('0x64')]){_0x4b2089[_0x4f7b('0x65')](new Extension(_0x5b16cb,0x3,'Set',_0x4f7b('0x66')+_0x5a6db0[_0x4f7b('0x64')]));}else{_0x4b2089['push'](new Extension(_0x5b16cb,0x3,'NoOp',_0x4f7b('0x67')));}_0x4b2089[_0x4f7b('0x65')](new Extension(_0x5b16cb,0x4,_0x4f7b('0x68'),_0x58baa5[_0x4f7b('0x69')]+','+'${EXTEN:'+(0x8+_0x5a6db0[_0x4f7b('0x2c')][_0x4f7b('0x3b')])+'}'+','+0x1));return _0x4b2089;}function formatPrefixName(_0xc6b94e){var _0x2cb5f1='_';for(var _0x2ac8db=0x0;_0x2ac8db<_0xc6b94e[_0x4f7b('0x3b')];_0x2ac8db++){if(_0xc6b94e['charAt'](_0x2ac8db)=='-'){_0x2cb5f1+=_0xc6b94e[_0x4f7b('0x6a')](_0x2ac8db);}else{_0x2cb5f1+='['+_0xc6b94e[_0x4f7b('0x6a')](_0x2ac8db)+']';}}_0x2cb5f1+='.';return _0x2cb5f1;}exports[_0x4f7b('0x6b')]=function(_0x220f21,_0x1ca442,_0x509763){var _0x579363=_0x220f21['body'];_0x579363[_0x4f7b('0x5f')]=_0x4f7b('0x6c')+_0x579363[_0x4f7b('0x2c')]+'-';return db[_0x4f7b('0x4c')][_0x4f7b('0x4d')](function(_0x53034b){return db[_0x4f7b('0x30')][_0x4f7b('0x6b')](_0x579363,{'where':{'id':_0x579363['id']},'transaction':_0x53034b})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x51')][_0x4f7b('0x29')]({'where':{'VoicePrefixId':_0x579363['id']},'transaction':_0x53034b})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x51')][_0x4f7b('0x4a')]({'where':{'id':_0x579363[_0x4f7b('0x52')]},'raw':!![]})[_0x4f7b('0x28')](function(_0x36b46d){return createVoicePrefixExtensions(_0x579363,_0x36b46d,_0x53034b);});});});})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x30')][_0x4f7b('0x6d')](_0x579363['id']);})[_0x4f7b('0x28')](respondWithResult(_0x1ca442,null))[_0x4f7b('0x46')](handleError(_0x1ca442,null));};exports[_0x4f7b('0x6e')]=function(_0xf0691e,_0x531da6,_0x5bce88){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0xf0691e[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x531da6,null))['then'](function(_0x1102fe){if(_0x1102fe){return _0x1102fe[_0x4f7b('0x6e')](_0xf0691e[_0x4f7b('0x4f')][_0x4f7b('0x6f')],_[_0x4f7b('0x70')](_0xf0691e[_0x4f7b('0x4f')],[_0x4f7b('0x6f'),'id'])||{})[_0x4f7b('0x71')](function(_0x3ddd33){for(var _0x13f190=0x0;_0x13f190<_0xf0691e[_0x4f7b('0x4f')][_0x4f7b('0x6f')][_0x4f7b('0x3b')];_0x13f190+=0x1){socket[_0x4f7b('0x72')](_0x4f7b('0x73'),{'UserId':Number(_0xf0691e['body'][_0x4f7b('0x6f')][_0x13f190]),'VoicePrefixId':Number(_0xf0691e[_0x4f7b('0x48')]['id'])});}return _0x3ddd33;});}})['then'](respondWithResult(_0x531da6,null))['catch'](handleError(_0x531da6,null));};exports[_0x4f7b('0x74')]=function(_0x4beb8e,_0x3d25a6,_0x12125d){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x4beb8e[_0x4f7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d25a6,null))['then'](function(_0x42bd6b){if(_0x42bd6b){return _0x42bd6b[_0x4f7b('0x74')](_0x4beb8e[_0x4f7b('0x36')][_0x4f7b('0x6f')])['then'](function(){if(_[_0x4f7b('0x75')](_0x4beb8e[_0x4f7b('0x36')]['ids'])){for(var _0x6aef20=0x0;_0x6aef20<_0x4beb8e[_0x4f7b('0x36')]['ids']['length'];_0x6aef20+=0x1){socket[_0x4f7b('0x72')]('userVoicePrefix:remove',{'UserId':Number(_0x4beb8e['query']['ids'][_0x6aef20]),'VoicePrefixId':Number(_0x4beb8e[_0x4f7b('0x48')]['id'])});}}else{socket['emit'](_0x4f7b('0x76'),{'UserId':Number(_0x4beb8e[_0x4f7b('0x36')][_0x4f7b('0x6f')]),'VoicePrefixId':Number(_0x4beb8e[_0x4f7b('0x48')]['id'])});}});}})[_0x4f7b('0x28')](respondWithStatusCode(_0x3d25a6,null))[_0x4f7b('0x46')](handleError(_0x3d25a6,null));};exports[_0x4f7b('0x77')]=function(_0x1f6650,_0x39799b,_0x4da13f){var _0x476637={};var _0x35c3cb={};var _0x37d151;var _0x40120d;return db[_0x4f7b('0x30')][_0x4f7b('0x78')]({'where':{'id':_0x1f6650[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x39799b,null))['then'](function(_0x24289e){if(_0x24289e){_0x37d151=_0x24289e;_0x35c3cb[_0x4f7b('0x35')]=_[_0x4f7b('0x37')](db['User'][_0x4f7b('0x31')]);_0x35c3cb['query']=_[_0x4f7b('0x37')](_0x1f6650[_0x4f7b('0x36')]);_0x35c3cb['filters']=_['intersection'](_0x35c3cb[_0x4f7b('0x35')],_0x35c3cb['query']);_0x476637[_0x4f7b('0x39')]=_['intersection'](_0x35c3cb[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1f6650[_0x4f7b('0x36')]['fields']));_0x476637[_0x4f7b('0x39')]=_0x476637['attributes'][_0x4f7b('0x3b')]?_0x476637[_0x4f7b('0x39')]:_0x35c3cb[_0x4f7b('0x35')];_0x476637[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1f6650[_0x4f7b('0x36')][_0x4f7b('0x3e')]);_0x476637['where']=qs[_0x4f7b('0x79')](_['pick'](_0x1f6650['query'],_0x35c3cb['filters']));if(_0x1f6650[_0x4f7b('0x36')]['filter']){_0x476637[_0x4f7b('0x3f')]=_[_0x4f7b('0x41')](_0x476637[_0x4f7b('0x3f')],{'$or':_[_0x4f7b('0x2f')](_0x476637[_0x4f7b('0x39')],function(_0x3f5f81){var _0x30a003={};_0x30a003[_0x3f5f81]={'$like':'%'+_0x1f6650[_0x4f7b('0x36')]['filter']+'%'};return _0x30a003;})});}_0x476637=_['merge']({},_0x476637,_0x1f6650['options']);return _0x37d151['getAgents'](_0x476637);}})[_0x4f7b('0x28')](function(_0x34bca4){if(_0x34bca4){_0x40120d=_0x34bca4[_0x4f7b('0x3b')];if(!_0x1f6650['query'][_0x4f7b('0x3c')]('nolimit')){_0x476637[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x1f6650['query'][_0x4f7b('0x21')]);_0x476637[_0x4f7b('0x23')]=qs[_0x4f7b('0x23')](_0x1f6650['query'][_0x4f7b('0x23')]);}return _0x37d151[_0x4f7b('0x77')](_0x476637);}})[_0x4f7b('0x28')](function(_0x3927b5){if(_0x3927b5){return _0x3927b5?{'count':_0x40120d,'rows':_0x3927b5}:null;}})[_0x4f7b('0x28')](respondWithResult(_0x39799b,null))[_0x4f7b('0x46')](handleError(_0x39799b,null));};exports[_0x4f7b('0x7a')]=function(_0x1a91ce,_0xd249a,_0x4f2c6e){var _0x147e14={};var _0x55922a={};var _0x5afd27;var _0x471caa;return db[_0x4f7b('0x30')]['findOne']({'where':{'id':_0x1a91ce['params']['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0xd249a,null))['then'](function(_0x13c2e4){if(_0x13c2e4){_0x5afd27=_0x13c2e4;_0x55922a[_0x4f7b('0x35')]=_[_0x4f7b('0x37')](db[_0x4f7b('0x7b')][_0x4f7b('0x31')]);_0x55922a[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x1a91ce[_0x4f7b('0x36')]);_0x55922a['filters']=_[_0x4f7b('0x38')](_0x55922a[_0x4f7b('0x35')],_0x55922a[_0x4f7b('0x36')]);_0x147e14[_0x4f7b('0x39')]=_[_0x4f7b('0x38')](_0x55922a[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1a91ce['query'][_0x4f7b('0x3a')]));_0x147e14[_0x4f7b('0x39')]=_0x147e14[_0x4f7b('0x39')][_0x4f7b('0x3b')]?_0x147e14[_0x4f7b('0x39')]:_0x55922a[_0x4f7b('0x35')];_0x147e14[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1a91ce[_0x4f7b('0x36')]['sort']);_0x147e14['where']=qs['filters'](_['pick'](_0x1a91ce[_0x4f7b('0x36')],_0x55922a[_0x4f7b('0x79')]));if(_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x7c')]){_0x147e14[_0x4f7b('0x3f')]=_[_0x4f7b('0x41')](_0x147e14[_0x4f7b('0x3f')],{'$or':_['map'](_0x147e14[_0x4f7b('0x39')],function(_0x265a8f){var _0x39ec96={};_0x39ec96[_0x265a8f]={'$like':'%'+_0x1a91ce[_0x4f7b('0x36')]['filter']+'%'};return _0x39ec96;})});}_0x147e14=_[_0x4f7b('0x41')]({},_0x147e14,_0x1a91ce[_0x4f7b('0x49')]);return _0x5afd27[_0x4f7b('0x7a')](_0x147e14);}})['then'](function(_0x3f844f){if(_0x3f844f){_0x471caa=_0x3f844f[_0x4f7b('0x3b')];if(!_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x3c')](_0x4f7b('0x7d'))){_0x147e14[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x21')]);_0x147e14[_0x4f7b('0x23')]=qs[_0x4f7b('0x23')](_0x1a91ce[_0x4f7b('0x36')]['offset']);}return _0x5afd27['getTeams'](_0x147e14);}})[_0x4f7b('0x28')](function(_0x4cd4d6){if(_0x4cd4d6){return _0x4cd4d6?{'count':_0x471caa,'rows':_0x4cd4d6}:null;}})[_0x4f7b('0x28')](respondWithResult(_0xd249a,null))[_0x4f7b('0x46')](handleError(_0xd249a,null));};exports['addTeams']=function(_0x411a94,_0x1e934e,_0x5ec78b){var _0x4e07ce=_0x411a94['body'][_0x4f7b('0x6f')];var _0x5a8bda;return db['Team'][_0x4f7b('0x44')]({'where':{'id':_0x4e07ce},'attributes':['id'],'include':[{'model':db[_0x4f7b('0x7e')],'as':_0x4f7b('0x7f'),'attributes':['id',_0x4f7b('0x2c'),_0x4f7b('0x80'),_0x4f7b('0x81'),'interface'],'raw':!![]}]})[_0x4f7b('0x28')](function(_0x1ebf36){if(_0x1ebf36){_0x5a8bda=_0x1ebf36;var _0x4daeb1=_[_0x4f7b('0x82')](_0x1ebf36,function(_0x5556b4){var _0x4d5eb3=_0x5556b4['get']({'plain':!![]});return _0x4d5eb3[_0x4f7b('0x7f')];});return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x411a94[_0x4f7b('0x48')]['id']}})['then'](function(_0x3e0d84){return db['sequelize']['transaction'](function(_0x5c2027){return _0x3e0d84['addTeams'](_0x4e07ce,{'transaction':_0x5c2027})[_0x4f7b('0x28')](function(){return BPromise[_0x4f7b('0x83')](_0x5a8bda,function(_0xb3a12b){return db[_0x4f7b('0x84')][_0x4f7b('0x85')]({'TeamId':_0xb3a12b['id'],'VoicePrefixId':_0x411a94['params']['id']},{'transaction':_0x5c2027});});})[_0x4f7b('0x28')](function(){return BPromise[_0x4f7b('0x83')](_0x4daeb1,function(_0x20daa0){return db[_0x4f7b('0x86')][_0x4f7b('0x87')]({'where':{'UserId':_0x20daa0['id'],'VoicePrefixId':_0x411a94[_0x4f7b('0x48')]['id']},'transaction':_0x5c2027});});})['then'](function(){_0x4daeb1[_0x4f7b('0x88')](function(_0x5f4ea9){socket[_0x4f7b('0x72')](_0x4f7b('0x73'),{'UserId':_0x5f4ea9['id'],'VoicePrefixId':_0x3e0d84['id']});});});});});}})[_0x4f7b('0x28')](respondWithStatusCode(_0x1e934e,null))[_0x4f7b('0x46')](handleError(_0x1e934e,null));};exports[_0x4f7b('0x89')]=function(_0x3aaa25,_0x344257,_0x36209e){return db[_0x4f7b('0x7b')][_0x4f7b('0x44')]({'where':{'id':_0x3aaa25[_0x4f7b('0x36')][_0x4f7b('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4f7b('0x28')](handleEntityNotFound(_0x344257,null))[_0x4f7b('0x28')](function(_0x136804){var _0x13d7cd=_[_0x4f7b('0x2f')](_0x136804,'id');var _0x1cf812=[];var _0x3434a1=[];var _0x3acd39=squel[_0x4f7b('0x8a')]();_0x3acd39['field']('tq.TeamId')[_0x4f7b('0x8b')]('team_has_voice_prefixes','tq')[_0x4f7b('0x8c')](_0x4f7b('0x8d'),'ut',_0x4f7b('0x8e'))[_0x4f7b('0x3f')](_0x4f7b('0x8f'),_0x3aaa25['params']['id']);for(var _0x324ee3=0x0;_0x324ee3<_0x136804[_0x4f7b('0x3b')];_0x324ee3+=0x1){let _0x14c427=_0x136804[_0x324ee3];for(var _0x5dd4cd=0x0;_0x5dd4cd<_0x14c427[_0x4f7b('0x7f')][_0x4f7b('0x3b')];_0x5dd4cd+=0x1){let _0x43276a=_0x14c427[_0x4f7b('0x7f')][_0x5dd4cd];var _0x58cf43=_0x3acd39[_0x4f7b('0x90')]();_0x58cf43['where'](_0x4f7b('0x91'),_0x43276a['id']);_0x3434a1[_0x4f7b('0x65')](db[_0x4f7b('0x4c')][_0x4f7b('0x36')](_0x58cf43[_0x4f7b('0x92')](),{'type':db[_0x4f7b('0x4c')][_0x4f7b('0x93')][_0x4f7b('0x94')]})[_0x4f7b('0x28')](function(_0xe6b4de){if(_0xe6b4de[_0x4f7b('0x3b')]===0x1){return _0x43276a['id'];}else{var _0x4088d7=_[_0x4f7b('0x95')](_[_0x4f7b('0x2f')](_0xe6b4de,_0x4f7b('0x96')),function(_0x8fa122){return _[_0x4f7b('0x97')](_0x13d7cd,_0x8fa122);});if(_0x4088d7){return _0x43276a['id'];}}}));}}return BPromise['all'](_0x3434a1)['then'](function(_0x50a1e5){_0x1cf812=_(_0x1cf812)[_0x4f7b('0x98')](_0x50a1e5)['compact']()[_0x4f7b('0x99')]();return db['VoicePrefix'][_0x4f7b('0x4a')]({'where':{'id':_0x3aaa25[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](function(_0x196911){return db['sequelize']['transaction'](function(_0x228e98){return _0x196911[_0x4f7b('0x89')](_0x3aaa25['query']['ids'],{'transaction':_0x228e98})[_0x4f7b('0x28')](function(){if(!_['isEmpty'](_0x1cf812)){return _0x196911[_0x4f7b('0x74')](_0x1cf812,{'transaction':_0x228e98});}})['then'](function(){_0x1cf812[_0x4f7b('0x88')](function(_0x3dd10a){socket[_0x4f7b('0x72')](_0x4f7b('0x76'),{'UserId':_0x3dd10a,'VoicePrefixId':_0x196911['id']});});});});});});})[_0x4f7b('0x28')](respondWithStatusCode(_0x344257,null))[_0x4f7b('0x46')](handleError(_0x344257,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index d171d6a..2752866 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 _0xe1ac=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4dcc75,_0x82e80d){var _0xe3cb6=function(_0x3bd63c){while(--_0x3bd63c){_0x4dcc75['push'](_0x4dcc75['shift']());}};_0xe3cb6(++_0x82e80d);}(_0xe1ac,0x1e0));var _0xce1a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe1ac[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xce1a('0x0'));var VoicePrefix=require(_0xce1a('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xce1a('0x2')](0x0);var events={'afterCreate':_0xce1a('0x3'),'afterUpdate':_0xce1a('0x4'),'afterDestroy':_0xce1a('0x5')};function emitEvent(_0x3df53e){return function(_0x1a5841,_0x4bdacc,_0x2f54c2){VoicePrefixEvents[_0xce1a('0x6')](_0x3df53e+':'+_0x1a5841['id'],_0x1a5841);VoicePrefixEvents[_0xce1a('0x6')](_0x3df53e,_0x1a5841);_0x2f54c2(null);};}for(var e in events){if(events[_0xce1a('0x7')](e)){var event=events[e];VoicePrefix[_0xce1a('0x8')](e,emitEvent(event));}}module[_0xce1a('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x6825=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0x2a5325,_0x33d41d){var _0x3c22e5=function(_0x521aab){while(--_0x521aab){_0x2a5325['push'](_0x2a5325['shift']());}};_0x3c22e5(++_0x33d41d);}(_0x6825,0x1e2));var _0x5682=function(_0x489bdc,_0x1e9863){_0x489bdc=_0x489bdc-0x0;var _0x91207b=_0x6825[_0x489bdc];return _0x91207b;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x5682('0x0'))['db'][_0x5682('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5682('0x2')](0x0);var events={'afterCreate':_0x5682('0x3'),'afterUpdate':_0x5682('0x4'),'afterDestroy':_0x5682('0x5')};function emitEvent(_0x46e64d){return function(_0x24330b,_0x5c66a6,_0xa3fd4e){VoicePrefixEvents['emit'](_0x46e64d+':'+_0x24330b['id'],_0x24330b);VoicePrefixEvents[_0x5682('0x6')](_0x46e64d,_0x24330b);_0xa3fd4e(null);};}for(var e in events){if(events[_0x5682('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x5682('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 67ee533..ca55c62 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 _0x8d34=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x8d34,0xf0));var _0x48d3=function(_0x4bcd69,_0x11721f){_0x4bcd69=_0x4bcd69-0x0;var _0x5f46c2=_0x8d34[_0x4bcd69];return _0x5f46c2;};'use strict';var _=require(_0x48d3('0x0'));var util=require(_0x48d3('0x1'));var logger=require(_0x48d3('0x2'))(_0x48d3('0x3'));var moment=require(_0x48d3('0x4'));var BPromise=require(_0x48d3('0x5'));var rp=require(_0x48d3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48d3('0x7'));var config=require(_0x48d3('0x8'));var attributes=require(_0x48d3('0x9'));module['exports']=function(_0xc18fdf,_0xd75970){return _0xc18fdf[_0x48d3('0xa')](_0x48d3('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7704=['moment','bluebird','request-promise','path','./voicePrefix.attributes','define','util','../../config/logger','api'];(function(_0x20b100,_0x2e7dbf){var _0x35be82=function(_0xbaeea2){while(--_0xbaeea2){_0x20b100['push'](_0x20b100['shift']());}};_0x35be82(++_0x2e7dbf);}(_0x7704,0xde));var _0x4770=function(_0x5c6c33,_0x5b25e6){_0x5c6c33=_0x5c6c33-0x0;var _0x2b25eb=_0x7704[_0x5c6c33];return _0x2b25eb;};'use strict';var _=require('lodash');var util=require(_0x4770('0x0'));var logger=require(_0x4770('0x1'))(_0x4770('0x2'));var moment=require(_0x4770('0x3'));var BPromise=require(_0x4770('0x4'));var rp=require(_0x4770('0x5'));var fs=require('fs');var path=require(_0x4770('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4770('0x7'));module['exports']=function(_0x37a0e8,_0x29b004){return _0x37a0e8[_0x4770('0x8')]('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 836e3db..2f43ac5 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 _0xc21c=['request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','info'];(function(_0x303a05,_0x57f0b5){var _0xc223f3=function(_0x54ebb8){while(--_0x54ebb8){_0x303a05['push'](_0x303a05['shift']());}};_0xc223f3(++_0x57f0b5);}(_0xc21c,0x166));var _0xcc21=function(_0x2555ec,_0x18ed86){_0x2555ec=_0x2555ec-0x0;var _0x247c0c=_0xc21c[_0x2555ec];return _0x247c0c;};'use strict';var _=require(_0xcc21('0x0'));var util=require(_0xcc21('0x1'));var moment=require('moment');var BPromise=require(_0xcc21('0x2'));var rs=require(_0xcc21('0x3'));var fs=require('fs');var Redis=require(_0xcc21('0x4'));var db=require(_0xcc21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc21('0x6'))(_0xcc21('0x7'));var config=require(_0xcc21('0x8'));var jayson=require(_0xcc21('0x9'));var client=jayson[_0xcc21('0xa')][_0xcc21('0xb')]({'port':0x232a});config[_0xcc21('0xc')]=_['defaults'](config[_0xcc21('0xc')],{'host':_0xcc21('0xd'),'port':0x18eb});var socket=require(_0xcc21('0xe'))(new Redis(config[_0xcc21('0xc')]));require('./voicePrefix.socket')[_0xcc21('0xf')](socket);function respondWithRpcPromise(_0x5cade6,_0x412a15,_0x4ecf6a){return new BPromise(function(_0x446165,_0x21c42f){return client['request'](_0x5cade6,_0x4ecf6a)['then'](function(_0x32cd27){logger[_0xcc21('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x412a15,_0xcc21('0x11'));logger['debug'](_0xcc21('0x12'),_0x412a15,_0xcc21('0x11'),JSON[_0xcc21('0x13')](_0x32cd27));if(_0x32cd27['error']){if(_0x32cd27[_0xcc21('0x14')]['code']===0x1f4){logger[_0xcc21('0x14')](_0xcc21('0x15'),_0x412a15,_0x32cd27[_0xcc21('0x14')][_0xcc21('0x16')]);return _0x21c42f(_0x32cd27[_0xcc21('0x14')][_0xcc21('0x16')]);}logger[_0xcc21('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x412a15,_0x32cd27['error'][_0xcc21('0x16')]);return _0x446165(_0x32cd27['error'][_0xcc21('0x16')]);}else{logger[_0xcc21('0x10')](_0xcc21('0x15'),_0x412a15,_0xcc21('0x11'));_0x446165(_0x32cd27[_0xcc21('0x17')]['message']);}})[_0xcc21('0x18')](function(_0x2a3056){logger[_0xcc21('0x14')](_0xcc21('0x15'),_0x412a15,_0x2a3056);_0x21c42f(_0x2a3056);});});} \ No newline at end of file +var _0x073d=['message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x073d,0xd2));var _0xd073=function(_0xf022be,_0x14e78e){_0xf022be=_0xf022be-0x0;var _0x18d7d5=_0x073d[_0xf022be];return _0x18d7d5;};'use strict';var _=require('lodash');var util=require(_0xd073('0x0'));var moment=require(_0xd073('0x1'));var BPromise=require(_0xd073('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd073('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd073('0x4'));var logger=require(_0xd073('0x5'))('rpc');var config=require(_0xd073('0x6'));var jayson=require(_0xd073('0x7'));var client=jayson[_0xd073('0x8')][_0xd073('0x9')]({'port':0x232a});config[_0xd073('0xa')]=_[_0xd073('0xb')](config[_0xd073('0xa')],{'host':_0xd073('0xc'),'port':0x18eb});var socket=require(_0xd073('0xd'))(new Redis(config[_0xd073('0xa')]));require(_0xd073('0xe'))[_0xd073('0xf')](socket);function respondWithRpcPromise(_0x238d31,_0x3f1fc6,_0x5c916e){return new BPromise(function(_0x53abea,_0xf39d94){return client['request'](_0x238d31,_0x5c916e)[_0xd073('0x10')](function(_0xf3f0f0){logger[_0xd073('0x11')](_0xd073('0x12'),_0x3f1fc6,_0xd073('0x13'));logger['debug'](_0xd073('0x14'),_0x3f1fc6,_0xd073('0x13'),JSON[_0xd073('0x15')](_0xf3f0f0));if(_0xf3f0f0[_0xd073('0x16')]){if(_0xf3f0f0['error'][_0xd073('0x17')]===0x1f4){logger[_0xd073('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x3f1fc6,_0xf3f0f0[_0xd073('0x16')][_0xd073('0x18')]);return _0xf39d94(_0xf3f0f0[_0xd073('0x16')][_0xd073('0x18')]);}logger['error'](_0xd073('0x12'),_0x3f1fc6,_0xf3f0f0['error']['message']);return _0x53abea(_0xf3f0f0[_0xd073('0x16')][_0xd073('0x18')]);}else{logger[_0xd073('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x3f1fc6,_0xd073('0x13'));_0x53abea(_0xf3f0f0[_0xd073('0x19')][_0xd073('0x18')]);}})['catch'](function(_0x194db8){logger[_0xd073('0x16')](_0xd073('0x12'),_0x3f1fc6,_0x194db8);_0xf39d94(_0x194db8);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index eed2598..7c4ca82 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 _0x8b2b=['remove','emit','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x20582f,_0x2d4bba){var _0x2f351c=function(_0x69c7b9){while(--_0x69c7b9){_0x20582f['push'](_0x20582f['shift']());}};_0x2f351c(++_0x2d4bba);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x441572,_0x193b8c){_0x441572=_0x441572-0x0;var _0x23f49f=_0x8b2b[_0x441572];return _0x23f49f;};'use strict';var VoicePrefixEvents=require(_0xb8b2('0x0'));var events=[_0xb8b2('0x1'),_0xb8b2('0x2'),'update'];function createListener(_0x199e25,_0x415a60){return function(_0x3beb9e){_0x415a60[_0xb8b2('0x3')](_0x199e25,_0x3beb9e);};}function removeListener(_0x1199f8,_0x2928a7){return function(){VoicePrefixEvents['removeListener'](_0x1199f8,_0x2928a7);};}exports['register']=function(_0xba7734){for(var _0x31b3f9=0x0,_0x2f0032=events[_0xb8b2('0x4')];_0x31b3f9<_0x2f0032;_0x31b3f9++){var _0x4a4c69=events[_0x31b3f9];var _0x541b1b=createListener(_0xb8b2('0x5')+_0x4a4c69,_0xba7734);VoicePrefixEvents['on'](_0x4a4c69,_0x541b1b);}}; \ No newline at end of file +var _0x9090=['remove','update','emit','register','length','./voicePrefix.events','save'];(function(_0x2e8390,_0x7ff493){var _0xefdfd5=function(_0x5136bf){while(--_0x5136bf){_0x2e8390['push'](_0x2e8390['shift']());}};_0xefdfd5(++_0x7ff493);}(_0x9090,0x17f));var _0x0909=function(_0x558df9,_0x1ab271){_0x558df9=_0x558df9-0x0;var _0x182a88=_0x9090[_0x558df9];return _0x182a88;};'use strict';var VoicePrefixEvents=require(_0x0909('0x0'));var events=[_0x0909('0x1'),_0x0909('0x2'),_0x0909('0x3')];function createListener(_0x27eba2,_0x5466c8){return function(_0x51923f){_0x5466c8[_0x0909('0x4')](_0x27eba2,_0x51923f);};}function removeListener(_0x289665,_0x29bc19){return function(){VoicePrefixEvents['removeListener'](_0x289665,_0x29bc19);};}exports[_0x0909('0x5')]=function(_0x42af40){for(var _0x5317db=0x0,_0x41d8fc=events[_0x0909('0x6')];_0x5317db<_0x41d8fc;_0x5317db++){var _0x32bf48=events[_0x5317db];var _0x1755ee=createListener('voicePrefix:'+_0x32bf48,_0x42af40);VoicePrefixEvents['on'](_0x32bf48,_0x1755ee);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0b6b6b2..7ad1765 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(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xb10b,0x12a));var _0xbb10=function(_0x26ce0f,_0x5c2378){_0x26ce0f=_0x26ce0f-0x0;var _0x268931=_0xb10b[_0x26ce0f];return _0x268931;};'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(_0x350e20,_0x11d843){var _0x4d25c7=function(_0x35e7a7){while(--_0x35e7a7){_0x350e20['push'](_0x350e20['shift']());}};_0x4d25c7(++_0x11d843);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 0ad47aa..0824b14 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 _0xd6e5=['getDataValue','type','dialMethod','preview','booked','roundrobin','includes','setDataValue','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','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\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#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)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING','name','ENUM','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','strategy'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0xd6e5,0x190));var _0x5d6e=function(_0x503459,_0x45ba52){_0x503459=_0x503459-0x0;var _0xeb228c=_0xd6e5[_0x503459];return _0xeb228c;};'use strict';var Sequelize=require(_0x5d6e('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d6e('0x1')],'allowNull':![],'unique':_0x5d6e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5d6e('0x3')]('inbound',_0x5d6e('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':_0x5d6e('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x5d6e('0x3')]('rr',_0x5d6e('0x6'),_0x5d6e('0x7'),_0x5d6e('0x8'),_0x5d6e('0x9'),_0x5d6e('0xa'),_0x5d6e('0xb'),_0x5d6e('0xc'),_0x5d6e('0xd')),'allowNull':![],'defaultValue':_0x5d6e('0x6'),'set':function(_0x20c3f2){this['setDataValue'](_0x5d6e('0xe'),_0x20c3f2?_0x20c3f2:_0x5d6e('0xa'));},'get':function(){var _0x37fda9=this[_0x5d6e('0xf')](_0x5d6e('0x10'));var _0x30b336=this[_0x5d6e('0xf')](_0x5d6e('0x11'));var _0x41b5c3=this['getDataValue'](_0x5d6e('0xe'));if(_0x37fda9==='outbound'){if(_0x30b336===_0x5d6e('0x12')){return null;}if(_0x30b336===_0x5d6e('0x13')&&![_0x5d6e('0xa'),_0x5d6e('0x14')][_0x5d6e('0x15')](_0x41b5c3)){this[_0x5d6e('0x16')](_0x5d6e('0xe'),_0x5d6e('0xa'));}}return _0x41b5c3;}},'servicelevel':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5d6e('0x17')](0xb)},'timeout':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x5d6e('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x5d6e('0x18'),'no'),'defaultValue':_0x5d6e('0x18')},'autopause':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no',_0x5d6e('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5d6e('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x5d6e('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x5d6e('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5d6e('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5d6e('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5d6e('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no'),'defaultValue':_0x5d6e('0x18')},'announce_holdtime':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no',_0x5d6e('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5d6e('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x5d6e('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5d6e('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x5d6e('0x1')]},'queue_quantity2':{'type':Sequelize[_0x5d6e('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x5d6e('0x1')]},'queue_less_than':{'type':Sequelize[_0x5d6e('0x1')]},'periodic_announce':{'type':Sequelize[_0x5d6e('0x1b')],'set':function(_0x187324){this[_0x5d6e('0x16')](_0x5d6e('0x1c'),_0x187324?_0x187324[_0x5d6e('0x1d')](','):[]);},'get':function(){return this[_0x5d6e('0xf')](_0x5d6e('0x1c'))?this['getDataValue']('periodic_announce')[_0x5d6e('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x5d6e('0x18'),'set':function(_0xf073ef){this[_0x5d6e('0x16')](_0x5d6e('0x1f'),_0xf073ef?_0xf073ef[_0x5d6e('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0x5d6e('0x1f'))?this[_0x5d6e('0xf')](_0x5d6e('0x1f'))[_0x5d6e('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':'no','set':function(_0x59c9e7){this[_0x5d6e('0x16')](_0x5d6e('0x20'),_0x59c9e7?_0x59c9e7[_0x5d6e('0x1d')](','):undefined);},'get':function(){return this[_0x5d6e('0xf')](_0x5d6e('0x20'))?this[_0x5d6e('0xf')](_0x5d6e('0x20'))[_0x5d6e('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5d6e('0x1')]},'acw':{'type':Sequelize[_0x5d6e('0x21')],'defaultValue':0x0,'set':function(_0x550180){this[_0x5d6e('0x16')](_0x5d6e('0x22'),_0x550180);if(_0x550180){if(this['getDataValue'](_0x5d6e('0x23'))<0x2){this[_0x5d6e('0x16')](_0x5d6e('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5d6e('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5d6e('0x21')],'defaultValue':0x0,'comment':_0x5d6e('0x24')},'dialMethod':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x12'),_0x5d6e('0x25'),_0x5d6e('0x26'),'predictive','booked'),'defaultValue':_0x5d6e('0x25'),'comment':_0x5d6e('0x27')},'dialLimitChannel':{'type':Sequelize[_0x5d6e('0x17')](0x4)[_0x5d6e('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5d6e('0x29')},'dialLimitQueue':{'type':Sequelize[_0x5d6e('0x17')](0x4)[_0x5d6e('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x5d6e('0x2a')](0x2)[_0x5d6e('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x2b'),_0x5d6e('0x2c')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x5d6e('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5d6e('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5d6e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5d6e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':_0x5d6e('0x2f'),'comment':_0x5d6e('0x30')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x31')},'dialQueueProject':{'type':Sequelize[_0x5d6e('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5d6e('0x17')](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6e('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6e('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'comment':_0x5d6e('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5d6e('0x17')](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6e('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5d6e('0x38')},'dialTimezone':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x5d6e('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5d6e('0x39'),'never',_0x5d6e('0x3a')),'defaultValue':_0x5d6e('0x39')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5d6e('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x5d6e('0x17')](0x9)[_0x5d6e('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5d6e('0x3c')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5d6e('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5d6e('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5d6e('0x17')](0x9)[_0x5d6e('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5d6e('0x17')](0x9)[_0x5d6e('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d6e('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x5d6e('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5d6e('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5d6e('0x17')](0x9)[_0x5d6e('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5d6e('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5d6e('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5d6e('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5d6e('0x17')](0x5)[_0x5d6e('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5d6e('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5d6e('0x17')](0x9)[_0x5d6e('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x5d6e('0x17')](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5d6e('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x5d6e('0x21')],'defaultValue':0x0,'comment':_0x5d6e('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5d6e('0x3')](_0x5d6e('0x45'),_0x5d6e('0x46')),'defaultValue':_0x5d6e('0x45')},'dialQueueProject2':{'type':Sequelize[_0x5d6e('0x1')],'comment':_0x5d6e('0x47')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5d6e('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5d6e('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x5d6e('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d6e('0x48')},'dialCutDigit':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d6e('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5d6e('0x17')](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x5d6e('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x4b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6e('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5d6e('0x17')](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6e('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x4e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5d6e('0x17')](0x5)[_0x5d6e('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d6e('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d6e('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5d6e('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d6e('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5d6e('0x21')],'defaultValue':![],'comment':_0x5d6e('0x51'),'set':function(_0x2bcf8f){if(!_0x2bcf8f)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5d6e('0x52'),_0x2bcf8f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5d6e('0x17')](0x3)[_0x5d6e('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5d6e('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5d6e('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x5d6e('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbfe8=['Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#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,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\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','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod','outbound','preview','roundrobin','includes','INTEGER','yes','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','predictive','booked','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT'];(function(_0x161eba,_0x23688b){var _0xe56027=function(_0x1198f2){while(--_0x1198f2){_0x161eba['push'](_0x161eba['shift']());}};_0xe56027(++_0x23688b);}(_0xbfe8,0x105));var _0x8bfe=function(_0xd4346f,_0x143bbd){_0xd4346f=_0xd4346f-0x0;var _0x5dd725=_0xbfe8[_0xd4346f];return _0x5dd725;};'use strict';var Sequelize=require(_0x8bfe('0x0'));module[_0x8bfe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8bfe('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x8bfe('0x4')},'musiconhold':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':_0x8bfe('0x6')},'announce':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8bfe('0x3')]('rr',_0x8bfe('0x7'),_0x8bfe('0x8'),_0x8bfe('0x9'),'random',_0x8bfe('0xa'),'linear',_0x8bfe('0xb'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x396977){this[_0x8bfe('0xc')](_0x8bfe('0xd'),_0x396977?_0x396977:_0x8bfe('0xa'));},'get':function(){var _0x454dc5=this[_0x8bfe('0xe')]('type');var _0x5d7cfc=this['getDataValue'](_0x8bfe('0xf'));var _0x4bf33d=this['getDataValue']('strategy');if(_0x454dc5===_0x8bfe('0x10')){if(_0x5d7cfc===_0x8bfe('0x11')){return null;}if(_0x5d7cfc==='booked'&&![_0x8bfe('0xa'),_0x8bfe('0x12')][_0x8bfe('0x13')](_0x4bf33d)){this[_0x8bfe('0xc')]('strategy',_0x8bfe('0xa'));}}return _0x4bf33d;}},'servicelevel':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8bfe('0x5')]},'weight':{'type':Sequelize[_0x8bfe('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':_0x8bfe('0x15')},'autopause':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8bfe('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8bfe('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8bfe('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8bfe('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8bfe('0x3')]('yes','no'),'defaultValue':_0x8bfe('0x15')},'announce_holdtime':{'type':Sequelize[_0x8bfe('0x3')]('yes','no',_0x8bfe('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x8bfe('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8bfe('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8bfe('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8bfe('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8bfe('0x5')]},'queue_quantity1':{'type':Sequelize[_0x8bfe('0x5')]},'queue_quantity2':{'type':Sequelize[_0x8bfe('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x8bfe('0x5')]},'queue_less_than':{'type':Sequelize[_0x8bfe('0x5')]},'periodic_announce':{'type':Sequelize[_0x8bfe('0x17')],'set':function(_0x8fccac){this[_0x8bfe('0xc')]('periodic_announce',_0x8fccac?_0x8fccac[_0x8bfe('0x18')](','):[]);},'get':function(){return this['getDataValue'](_0x8bfe('0x19'))?this[_0x8bfe('0xe')](_0x8bfe('0x19'))[_0x8bfe('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':_0x8bfe('0x15'),'set':function(_0x189259){this[_0x8bfe('0xc')](_0x8bfe('0x1b'),_0x189259?_0x189259[_0x8bfe('0x18')](','):undefined);},'get':function(){return this[_0x8bfe('0xe')](_0x8bfe('0x1b'))?this[_0x8bfe('0xe')](_0x8bfe('0x1b'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':'no','set':function(_0x29205d){this['setDataValue'](_0x8bfe('0x1c'),_0x29205d?_0x29205d['join'](','):undefined);},'get':function(){return this[_0x8bfe('0xe')]('leavewhenempty')?this[_0x8bfe('0xe')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8bfe('0x5')]},'description':{'type':Sequelize[_0x8bfe('0x5')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3c87d6){this['setDataValue'](_0x8bfe('0x1d'),_0x3c87d6);if(_0x3c87d6){if(this[_0x8bfe('0xe')]('wrapuptime')<0x2){this['setDataValue'](_0x8bfe('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8bfe('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8bfe('0x1f')],'defaultValue':0x0,'comment':_0x8bfe('0x20')},'dialMethod':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x11'),_0x8bfe('0x21'),'power',_0x8bfe('0x22'),_0x8bfe('0x23')),'defaultValue':_0x8bfe('0x21'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x8bfe('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x8bfe('0x14')](0x4)[_0x8bfe('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8bfe('0x25')},'dialPowerLevel':{'type':Sequelize[_0x8bfe('0x26')](0x2)[_0x8bfe('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8bfe('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x28'),_0x8bfe('0x29')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x8bfe('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8bfe('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8bfe('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8bfe('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bfe('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x8bfe('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bfe('0x2d')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x8bfe('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8bfe('0x14')](0x5)[_0x8bfe('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bfe('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bfe('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8bfe('0x14')](0x5)[_0x8bfe('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8bfe('0x24')],'defaultValue':0x3,'comment':_0x8bfe('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bfe('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8bfe('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8bfe('0x33')},'dialTimezone':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8bfe('0x5')],'defaultValue':_0x8bfe('0x34')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8bfe('0x35'),'never',_0x8bfe('0x36')),'defaultValue':_0x8bfe('0x35')},'dialAMDActive':{'type':Sequelize[_0x8bfe('0x1f')],'defaultValue':0x0,'comment':_0x8bfe('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x8bfe('0x14')](0x9)[_0x8bfe('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8bfe('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x8bfe('0x14')](0x9)[_0x8bfe('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8bfe('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x8bfe('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bfe('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x8bfe('0x14')](0x9)[_0x8bfe('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8bfe('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8bfe('0x14')](0x9)[_0x8bfe('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8bfe('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8bfe('0x14')](0x9)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8bfe('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8bfe('0x14')](0x5)[_0x8bfe('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8bfe('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bfe('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x8bfe('0x14')](0x5)[_0x8bfe('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8bfe('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x8bfe('0x1f')],'defaultValue':0x0,'comment':_0x8bfe('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8bfe('0x3')](_0x8bfe('0x40'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x8bfe('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8bfe('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8bfe('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8bfe('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bfe('0x41')},'dialCutDigit':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bfe('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8bfe('0x14')](0x5)[_0x8bfe('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bfe('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bfe('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0x8bfe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8bfe('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bfe('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8bfe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8bfe('0x14')](0x5)[_0x8bfe('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bfe('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bfe('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bfe('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bfe('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8bfe('0x14')],'allowNull':!![],'comment':_0x8bfe('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x8bfe('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x560712){if(!_0x560712)this[_0x8bfe('0xc')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8bfe('0x4a'),_0x560712);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8bfe('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8bfe('0x14')](0x3)[_0x8bfe('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8bfe('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 8431838..bb85a70 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 _0x008c=['deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','into','fromQuery','COALESCE(phone,\x27\x27)','all','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','offset','undefined','count','set','Content-Range','then','inbound','map','value','includes','type','UserProfileResource','destroy','status','send','index','VoiceQueue','rawAttributes','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','filters','model','intersection','fields','attributes','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','VoiceQueues','QueueCampaigns','outbound','name','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','length','hasOwnProperty','nolimit','limit','sort','pick','VoiceQueueId','filter','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','isNil','interface','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','union','compact','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','isEmpty','UserVoiceQueueRt','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','cm_contacts'];(function(_0x5f1ed4,_0x222fff){var _0x251d91=function(_0x130860){while(--_0x130860){_0x5f1ed4['push'](_0x5f1ed4['shift']());}};_0x251d91(++_0x222fff);}(_0x008c,0x188));var _0xc008=function(_0x4734d8,_0x479950){_0x4734d8=_0x4734d8-0x0;var _0x3b1120=_0x008c[_0x4734d8];return _0x3b1120;};'use strict';var moment=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));var squel=require(_0xc008('0x4'));var Redis=require('ioredis');var qs=require(_0xc008('0x5'));var logger=require(_0xc008('0x6'))(_0xc008('0x7'));var config=require(_0xc008('0x8'));var db=require(_0xc008('0x9'))['db'];config[_0xc008('0xa')]=_[_0xc008('0xb')](config[_0xc008('0xa')],{'host':_0xc008('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc008('0xa')]));require('./voiceQueue.socket')[_0xc008('0xd')](socket);function respondWithStatusCode(_0x5b64f8,_0x52041f){_0x52041f=_0x52041f||0xcc;return function(_0x27830d){if(_0x27830d){return _0x5b64f8[_0xc008('0xe')](_0x52041f);}return _0x5b64f8['status'](_0x52041f)['end']();};}function respondWithResult(_0x543eb8,_0x1eacfa){_0x1eacfa=_0x1eacfa||0xc8;return function(_0xc881aa){if(_0xc881aa){return _0x543eb8['status'](_0x1eacfa)[_0xc008('0xf')](_0xc881aa);}};}function respondWithFilteredResult(_0x332fd4,_0x2ea200){return function(_0x2a5b4e){if(_0x2a5b4e){var _0x9ffa93=typeof _0x2ea200[_0xc008('0x10')]===_0xc008('0x11')&&typeof _0x2ea200['limit']==='undefined';var _0x33f44c=_0x2a5b4e['count'];var _0x25e13f=_0x9ffa93?0x0:_0x2ea200[_0xc008('0x10')];var _0x2073ef=_0x9ffa93?_0x2a5b4e[_0xc008('0x12')]:_0x2ea200[_0xc008('0x10')]+_0x2ea200['limit'];var _0x5e894e;if(_0x2073ef>=_0x33f44c){_0x2073ef=_0x33f44c;_0x5e894e=0xc8;}else{_0x5e894e=0xce;}_0x332fd4['status'](_0x5e894e);return _0x332fd4[_0xc008('0x13')](_0xc008('0x14'),_0x25e13f+'-'+_0x2073ef+'/'+_0x33f44c)[_0xc008('0xf')](_0x2a5b4e);}return null;};}function saveUpdates(_0x3eb12a){return function(_0x4fe771){if(_0x4fe771){return _0x4fe771['update'](_0x3eb12a)['then'](function(_0x5c2668){return _0x5c2668;});}return null;};}function removeEntity(_0x46042b){return function(_0x462af5){if(_0x462af5){return _0x462af5['destroy']()[_0xc008('0x15')](function(){var _0x5906e6=_0x462af5['get']({'plain':!![]});var _0x543e5d=[{'name':'VoiceQueues','value':_0xc008('0x16'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x590a71=_(_0x543e5d)['filter']('ignore')[_0xc008('0x17')](_0xc008('0x18'))[_0xc008('0x18')]();if(_[_0xc008('0x19')](_0x590a71,_0x5906e6[_0xc008('0x1a')])){return;}var _0x110128=_['find'](_0x543e5d,[_0xc008('0x18'),_0x5906e6['type']])['name'];return db[_0xc008('0x1b')][_0xc008('0x1c')]({'where':{'type':_0x110128,'resourceId':_0x5906e6['id']}})[_0xc008('0x15')](function(){return _0x462af5;});})[_0xc008('0x15')](function(){_0x46042b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9){return function(_0x3f7b07){if(!_0x3f7b07){_0x5de1e9[_0xc008('0xe')](0x194);}return _0x3f7b07;};}function handleError(_0x92c582,_0x2e31c2){_0x2e31c2=_0x2e31c2||0x1f4;return function(_0x5bebd9){logger['error'](_0x5bebd9['stack']);if(_0x5bebd9['name']){delete _0x5bebd9['name'];}_0x92c582[_0xc008('0x1d')](_0x2e31c2)[_0xc008('0x1e')](_0x5bebd9);};}exports[_0xc008('0x1f')]=function(_0x529961,_0x24c14c){var _0x32390d={};var _0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x20')][_0xc008('0x21')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x22')]};});_0x32390d=qs[_0xc008('0x23')](_0x2a7d4f,_0x529961);var _0xf831f2={'where':_0x32390d[_0xc008('0x24')]};return db[_0xc008('0x20')][_0xc008('0x12')](_0xf831f2)[_0xc008('0x15')](function(_0x22d8e8){_0x209591[_0xc008('0x12')]=_0x22d8e8;_0x32390d[_0xc008('0x25')]=qs[_0xc008('0x25')](_0x529961[_0xc008('0x26')]);return db['VoiceQueue'][_0xc008('0x27')](_0x32390d);})[_0xc008('0x15')](function(_0x499754){_0x209591[_0xc008('0x28')]=_0x499754;return _0x209591;})[_0xc008('0x15')](respondWithFilteredResult(_0x24c14c,_0x32390d))[_0xc008('0x29')](handleError(_0x24c14c,null));};exports[_0xc008('0x2a')]=function(_0xd0e05a,_0x3cd878){var _0x7cfbc5={'raw':![],'where':{'id':_0xd0e05a[_0xc008('0x2b')]['id']}},_0x470e79={};_0x470e79['model']=_[_0xc008('0x2c')](db[_0xc008('0x20')][_0xc008('0x21')]);_0x470e79[_0xc008('0x26')]=_[_0xc008('0x2c')](_0xd0e05a[_0xc008('0x26')]);_0x470e79[_0xc008('0x2d')]=_['intersection'](_0x470e79[_0xc008('0x2e')],_0x470e79[_0xc008('0x26')]);_0x7cfbc5['attributes']=_[_0xc008('0x2f')](_0x470e79[_0xc008('0x2e')],qs['fields'](_0xd0e05a[_0xc008('0x26')][_0xc008('0x30')]));_0x7cfbc5[_0xc008('0x31')]=_0x7cfbc5['attributes']['length']?_0x7cfbc5['attributes']:_0x470e79[_0xc008('0x2e')];if(_0xd0e05a['query'][_0xc008('0x32')]){_0x7cfbc5[_0xc008('0x25')]=[{'all':!![]}];}_0x7cfbc5=_[_0xc008('0x33')]({},_0x7cfbc5,_0xd0e05a[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x7cfbc5)[_0xc008('0x15')](handleEntityNotFound(_0x3cd878,null))[_0xc008('0x15')](respondWithResult(_0x3cd878,null))[_0xc008('0x29')](handleError(_0x3cd878,null));};exports[_0xc008('0x36')]=function(_0x3ebb83,_0xdfca2e){return db[_0xc008('0x20')][_0xc008('0x36')](_0x3ebb83['body'],{})[_0xc008('0x15')](function(_0x23c4db){var _0x30b7df=_0x3ebb83[_0xc008('0x37')]['get']({'plain':!![]});if(!_0x30b7df)throw new Error(_0xc008('0x38'));if(_0x30b7df[_0xc008('0x39')]===_0xc008('0x37')){var _0x36e7ae=_0x23c4db[_0xc008('0x3a')]({'plain':!![]});var _0x5706bb=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':_0xc008('0x3c'),'value':_0xc008('0x3d')}];var _0x7279e8=_['find'](_0x5706bb,[_0xc008('0x18'),_0x36e7ae[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')]['find']({'where':{'name':_0x7279e8,'userProfileId':_0x30b7df[_0xc008('0x40')]},'raw':!![]})[_0xc008('0x15')](function(_0x351d5c){if(_0x351d5c&&_0x351d5c['autoAssociation']===0x0){return db[_0xc008('0x1b')]['create']({'name':_0x36e7ae[_0xc008('0x3e')],'resourceId':_0x36e7ae['id'],'type':_0x351d5c['name'],'sectionId':_0x351d5c['id']},{})[_0xc008('0x15')](function(){return _0x23c4db;});}else{return _0x23c4db;}})[_0xc008('0x29')](function(_0x5a5d85){logger[_0xc008('0x41')](_0xc008('0x42'),_0x5a5d85);throw _0x5a5d85;});}return _0x23c4db;})[_0xc008('0x15')](respondWithResult(_0xdfca2e,0xc9))['catch'](handleError(_0xdfca2e,null));};exports[_0xc008('0x43')]=function(_0x2a9b5c,_0x200469){var _0x44fc5d={'where':{'id':_0x2a9b5c[_0xc008('0x2b')]['id']}},_0x347629={};_0x347629['model']=_['keys'](db['VoiceQueue'][_0xc008('0x21')]);_0x44fc5d[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x347629[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x2a9b5c[_0xc008('0x26')][_0xc008('0x30')]));_0x44fc5d[_0xc008('0x31')]=_0x44fc5d['attributes']['length']?_0x44fc5d['attributes']:_0x347629[_0xc008('0x2e')];if(_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]){_0x44fc5d['include']=[{'all':!![]}];}_0x44fc5d=_[_0xc008('0x33')]({},_0x44fc5d,_0x2a9b5c[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x44fc5d)[_0xc008('0x15')](handleEntityNotFound(_0x200469,null))[_0xc008('0x15')](function(_0x17ec90){if(_0x17ec90){var _0x405e87=_0x17ec90[_0xc008('0x3a')]({'plain':!![]});_0x405e87=qs[_0xc008('0x44')](_0x405e87,['id','createdAt','updatedAt']);_0x2a9b5c[_0xc008('0x45')]=_['omit'](_0x2a9b5c[_0xc008('0x45')],['id',_0xc008('0x46'),_0xc008('0x47')]);return db['VoiceQueue'][_0xc008('0x36')](_[_0xc008('0x33')](_0x405e87,_0x2a9b5c[_0xc008('0x45')]),{'include':_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]?[{'all':!![]}]:undefined})['then'](function(_0x3a7b3b){var _0x27b022=_0x2a9b5c['user'][_0xc008('0x3a')]({'plain':!![]});if(!_0x27b022)throw new Error(_0xc008('0x38'));if(_0x27b022['role']==='user'){var _0x2df905=_0x3a7b3b[_0xc008('0x3a')]({'plain':!![]});var _0x20947b=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':'QueueCampaigns','value':'outbound'}];var _0x34b72a=_['find'](_0x20947b,[_0xc008('0x18'),_0x2df905[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')][_0xc008('0x35')]({'where':{'name':_0x34b72a,'userProfileId':_0x27b022[_0xc008('0x40')]},'raw':!![]})['then'](function(_0x2ea742){if(_0x2ea742&&_0x2ea742[_0xc008('0x48')]===0x0){return db[_0xc008('0x1b')][_0xc008('0x36')]({'name':_0x2df905[_0xc008('0x3e')],'resourceId':_0x2df905['id'],'type':_0x2ea742['name'],'sectionId':_0x2ea742['id']},{})[_0xc008('0x15')](function(){return _0x3a7b3b;});}else{return _0x3a7b3b;}})['catch'](function(_0x535e6e){logger['error'](_0xc008('0x42'),_0x535e6e);throw _0x535e6e;});}return _0x3a7b3b;});}})[_0xc008('0x15')](respondWithResult(_0x200469,0xc9))[_0xc008('0x29')](handleError(_0x200469,null));};exports['update']=function(_0x3aeeab,_0x2d8361){if(_0x3aeeab[_0xc008('0x45')]['id']){delete _0x3aeeab['body']['id'];}return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x3aeeab[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2d8361,null))['then'](saveUpdates(_0x3aeeab[_0xc008('0x45')],null))['then'](respondWithResult(_0x2d8361,null))[_0xc008('0x29')](handleError(_0x2d8361,null));};exports[_0xc008('0x1c')]=function(_0x2ae14e,_0x943c91){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2ae14e['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x943c91,null))['then'](removeEntity(_0x943c91,null))['catch'](handleError(_0x943c91,null));};exports[_0xc008('0x49')]=function(_0x30aa1e,_0x56e755){var _0xb1befa={'raw':![],'where':{}};var _0xb8ba7={};var _0x3e373e={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x30aa1e[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x56e755,null))['then'](function(_0x16e052){if(_0x16e052){_0xb8ba7[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x4b')][_0xc008('0x21')]);_0xb8ba7[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x30aa1e[_0xc008('0x26')]);_0xb8ba7[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0xb8ba7[_0xc008('0x2e')],_0xb8ba7[_0xc008('0x26')]);_0xb1befa[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xb8ba7['model'],qs[_0xc008('0x30')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x30')]));_0xb1befa['attributes']=_0xb1befa[_0xc008('0x31')][_0xc008('0x4c')]?_0xb1befa['attributes']:_0xb8ba7['model'];if(!_0x30aa1e[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0xb1befa[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x4f')]);_0xb1befa[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x10')]);}_0xb1befa['order']=qs[_0xc008('0x50')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x50')]);_0xb1befa[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x30aa1e['query'],_0xb8ba7[_0xc008('0x2d')]));_0xb1befa[_0xc008('0x24')][_0xc008('0x52')]=_0x16e052['id'];if(_0x30aa1e['query'][_0xc008('0x53')]){_0xb1befa[_0xc008('0x24')]=_[_0xc008('0x33')](_0xb1befa['where'],{'$or':_[_0xc008('0x17')](_0xb1befa['attributes'],function(_0x50ee03){var _0xee7a85={};_0xee7a85[_0x50ee03]={'$like':'%'+_0x30aa1e[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0xee7a85;})});}_0xb1befa=_[_0xc008('0x33')]({},_0xb1befa,_0x30aa1e['options']);return db[_0xc008('0x4b')][_0xc008('0x12')]({'where':_0xb1befa['where']})[_0xc008('0x15')](function(_0x5233bb){_0x3e373e[_0xc008('0x12')]=_0x5233bb;if(_0x30aa1e['query'][_0xc008('0x32')]){_0xb1befa['include']=[{'all':!![]}];}return db[_0xc008('0x4b')][_0xc008('0x27')](_0xb1befa);})[_0xc008('0x15')](function(_0x47337b){_0x3e373e['rows']=_0x47337b;return _0x3e373e;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x56e755,_0xb1befa))[_0xc008('0x29')](handleError(_0x56e755,null));};exports[_0xc008('0x54')]=function(_0x1d49db,_0x321500){var _0x13ef78={'raw':!![],'where':{}};var _0xd9e3fd={};var _0x3b46e4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc008('0x4a')]({'where':{'id':_0x1d49db['params']['id']}})['then'](handleEntityNotFound(_0x321500,null))['then'](function(_0x406ead){if(_0x406ead){_0xd9e3fd[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x55')][_0xc008('0x21')]);_0xd9e3fd[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x1d49db[_0xc008('0x26')]);_0xd9e3fd[_0xc008('0x2d')]=_['intersection'](_0xd9e3fd[_0xc008('0x2e')],_0xd9e3fd[_0xc008('0x26')]);_0x13ef78[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xd9e3fd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1d49db[_0xc008('0x26')][_0xc008('0x30')]));_0x13ef78[_0xc008('0x31')]=_0x13ef78[_0xc008('0x31')][_0xc008('0x4c')]?_0x13ef78[_0xc008('0x31')]:_0xd9e3fd['model'];if(!_0x1d49db['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x13ef78[_0xc008('0x4f')]=qs['limit'](_0x1d49db[_0xc008('0x26')][_0xc008('0x4f')]);_0x13ef78['offset']=qs['offset'](_0x1d49db['query'][_0xc008('0x10')]);}_0x13ef78[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1d49db[_0xc008('0x26')][_0xc008('0x50')]);_0x13ef78[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x1d49db[_0xc008('0x26')],_0xd9e3fd[_0xc008('0x2d')]));_0x13ef78['where']['VoiceQueueId']=_0x406ead['id'];if(_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]){_0x13ef78[_0xc008('0x24')]=_[_0xc008('0x33')](_0x13ef78[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x13ef78['attributes'],function(_0x5794fe){var _0x68372f={};_0x68372f[_0x5794fe]={'$like':'%'+_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x68372f;})});}_0x13ef78=_['merge']({},_0x13ef78,_0x1d49db['options']);return db['CmHopperHistory']['count']({'where':_0x13ef78['where']})['then'](function(_0x276de2){_0x3b46e4['count']=_0x276de2;if(_0x1d49db[_0xc008('0x26')]['includeAll']){_0x13ef78[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x55')][_0xc008('0x27')](_0x13ef78);})['then'](function(_0x58f348){_0x3b46e4[_0xc008('0x28')]=_0x58f348;return _0x3b46e4;});}})['then'](respondWithFilteredResult(_0x321500,_0x13ef78))[_0xc008('0x29')](handleError(_0x321500,null));};exports[_0xc008('0x57')]=function(_0x544519,_0x7b7246){var _0x4db90b={'raw':!![],'where':{}};var _0x554cf4={};var _0x23bece={'count':0x0,'rows':[]};return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x544519[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x7b7246,null))[_0xc008('0x15')](function(_0x4bd290){if(_0x4bd290){_0x554cf4[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x58')][_0xc008('0x21')]);_0x554cf4[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x544519['query']);_0x554cf4[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],_0x554cf4['query']);_0x4db90b[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],qs['fields'](_0x544519['query']['fields']));_0x4db90b[_0xc008('0x31')]=_0x4db90b[_0xc008('0x31')][_0xc008('0x4c')]?_0x4db90b[_0xc008('0x31')]:_0x554cf4[_0xc008('0x2e')];if(!_0x544519[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x4db90b['limit']=qs[_0xc008('0x4f')](_0x544519[_0xc008('0x26')]['limit']);_0x4db90b['offset']=qs[_0xc008('0x10')](_0x544519[_0xc008('0x26')][_0xc008('0x10')]);}_0x4db90b[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x544519['query'][_0xc008('0x50')]);_0x4db90b[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x544519[_0xc008('0x26')],_0x554cf4[_0xc008('0x2d')]));_0x4db90b[_0xc008('0x24')]['VoiceQueueId']=_0x4bd290['id'];if(_0x544519[_0xc008('0x26')][_0xc008('0x53')]){_0x4db90b[_0xc008('0x24')]=_[_0xc008('0x33')](_0x4db90b['where'],{'$or':_[_0xc008('0x17')](_0x4db90b[_0xc008('0x31')],function(_0x57cf19){var _0x555e8a={};_0x555e8a[_0x57cf19]={'$like':'%'+_0x544519[_0xc008('0x26')]['filter']+'%'};return _0x555e8a;})});}_0x4db90b=_[_0xc008('0x33')]({},_0x4db90b,_0x544519[_0xc008('0x34')]);return db['CmHopperFinal'][_0xc008('0x12')]({'where':_0x4db90b[_0xc008('0x24')]})[_0xc008('0x15')](function(_0xbe42a2){_0x23bece[_0xc008('0x12')]=_0xbe42a2;if(_0x544519[_0xc008('0x26')][_0xc008('0x32')]){_0x4db90b[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x58')][_0xc008('0x27')](_0x4db90b);})['then'](function(_0x49e6d5){_0x23bece[_0xc008('0x28')]=_0x49e6d5;return _0x23bece;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x7b7246,_0x4db90b))['catch'](handleError(_0x7b7246,null));};exports[_0xc008('0x59')]=function(_0x1bdaa9,_0x698d5c){var _0x5f1e48={'raw':!![],'where':{}};var _0x303cdd={};var _0x38239a={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x1bdaa9[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x698d5c,null))[_0xc008('0x15')](function(_0x5bd010){if(_0x5bd010){_0x303cdd[_0xc008('0x2e')]=_['keys'](db[_0xc008('0x5a')][_0xc008('0x21')]);_0x303cdd[_0xc008('0x26')]=_['keys'](_0x1bdaa9[_0xc008('0x26')]);_0x303cdd[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],_0x303cdd[_0xc008('0x26')]);_0x5f1e48[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1bdaa9[_0xc008('0x26')]['fields']));_0x5f1e48[_0xc008('0x31')]=_0x5f1e48[_0xc008('0x31')][_0xc008('0x4c')]?_0x5f1e48[_0xc008('0x31')]:_0x303cdd[_0xc008('0x2e')];if(!_0x1bdaa9['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x5f1e48[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x4f')]);_0x5f1e48[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x10')]);}_0x5f1e48[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x50')]);_0x5f1e48[_0xc008('0x24')]=qs['filters'](_['pick'](_0x1bdaa9[_0xc008('0x26')],_0x303cdd[_0xc008('0x2d')]));_0x5f1e48[_0xc008('0x24')][_0xc008('0x52')]=_0x5bd010['id'];if(_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]){_0x5f1e48[_0xc008('0x24')]=_[_0xc008('0x33')](_0x5f1e48[_0xc008('0x24')],{'$or':_['map'](_0x5f1e48[_0xc008('0x31')],function(_0x2bbadf){var _0x54fd75={};_0x54fd75[_0x2bbadf]={'$like':'%'+_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x54fd75;})});}_0x5f1e48=_[_0xc008('0x33')]({},_0x5f1e48,_0x1bdaa9[_0xc008('0x34')]);return db[_0xc008('0x5a')][_0xc008('0x12')]({'where':_0x5f1e48['where']})[_0xc008('0x15')](function(_0x321532){_0x38239a[_0xc008('0x12')]=_0x321532;if(_0x1bdaa9[_0xc008('0x26')]['includeAll']){_0x5f1e48[_0xc008('0x25')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc008('0x27')](_0x5f1e48);})[_0xc008('0x15')](function(_0x5b47c3){_0x38239a[_0xc008('0x28')]=_0x5b47c3;return _0x38239a;});}})['then'](respondWithFilteredResult(_0x698d5c,_0x5f1e48))[_0xc008('0x29')](handleError(_0x698d5c,null));};exports['getTeams']=function(_0x5b387d,_0x5351f7){var _0x79dfea={};var _0x402b67={};var _0x48f40f;var _0x4fda8;return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x5b387d[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5351f7,null))[_0xc008('0x15')](function(_0x5843ee){if(_0x5843ee){_0x48f40f=_0x5843ee;_0x402b67[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x5b')][_0xc008('0x21')]);_0x402b67[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x5b387d[_0xc008('0x26')]);_0x402b67[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],_0x402b67[_0xc008('0x26')]);_0x79dfea['attributes']=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5b387d['query'][_0xc008('0x30')]));_0x79dfea[_0xc008('0x31')]=_0x79dfea[_0xc008('0x31')]['length']?_0x79dfea[_0xc008('0x31')]:_0x402b67['model'];_0x79dfea[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5b387d[_0xc008('0x26')]['sort']);_0x79dfea[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x5b387d[_0xc008('0x26')],_0x402b67[_0xc008('0x2d')]));if(_0x5b387d[_0xc008('0x26')][_0xc008('0x53')]){_0x79dfea['where']=_[_0xc008('0x33')](_0x79dfea[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x79dfea[_0xc008('0x31')],function(_0x5a61d6){var _0x46fba5={};_0x46fba5[_0x5a61d6]={'$like':'%'+_0x5b387d['query'][_0xc008('0x53')]+'%'};return _0x46fba5;})});}_0x79dfea=_[_0xc008('0x33')]({},_0x79dfea,_0x5b387d[_0xc008('0x34')]);return _0x48f40f[_0xc008('0x5c')](_0x79dfea);}})[_0xc008('0x15')](function(_0x9f266e){if(_0x9f266e){_0x4fda8=_0x9f266e[_0xc008('0x4c')];if(!_0x5b387d['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x79dfea[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5b387d['query'][_0xc008('0x4f')]);_0x79dfea['offset']=qs[_0xc008('0x10')](_0x5b387d[_0xc008('0x26')][_0xc008('0x10')]);}return _0x48f40f['getTeams'](_0x79dfea);}})['then'](function(_0x39bfc0){if(_0x39bfc0){return _0x39bfc0?{'count':_0x4fda8,'rows':_0x39bfc0}:null;}})['then'](respondWithResult(_0x5351f7,null))[_0xc008('0x29')](handleError(_0x5351f7,null));};exports[_0xc008('0x5d')]=function(_0x1c2e63,_0xaf3bed){var _0x58ae7b=_0x1c2e63[_0xc008('0x45')][_0xc008('0x5e')];var _0x537e5e=_['map'](_0x58ae7b,'id');return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x537e5e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc008('0x5f'),'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),_0xc008('0x61'),'interface'],'raw':!![]}]})[_0xc008('0x15')](function(_0x3721e8){if(_0x3721e8){var _0xc344a7=_[_0xc008('0x62')](_0x3721e8,function(_0x78b833){var _0x177733=_0x78b833[_0xc008('0x3a')]({'plain':!![]});_0x177733[_0xc008('0x5f')][_0xc008('0x63')](function(_0xa332b1){_0xa332b1[_0xc008('0x64')]=_[_0xc008('0x35')](_0x58ae7b,{'id':_0x177733['id']})[_0xc008('0x64')];});return _0x177733['Agents'];});return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1c2e63[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](function(_0x4447ba){return db[_0xc008('0x65')][_0xc008('0x66')](function(_0xe5d226){return _0x4447ba['addTeams'](_0x537e5e,{'transaction':_0xe5d226})['then'](function(){return BPromise[_0xc008('0x67')](_0x58ae7b,function(_0x3d33ed){return db[_0xc008('0x68')]['upsert']({'TeamId':_0x3d33ed['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id'],'penalty':_0x3d33ed[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_0xc344a7,function(_0x156ec3){return db[_0xc008('0x69')][_0xc008('0x6a')]({'where':{'UserId':_0x156ec3['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id']},'defaults':{'penalty':_0x156ec3[_0xc008('0x64')]},'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_[_0xc008('0x53')](_0xc344a7,{'online':!![]}),function(_0x4ffaa3){return db['UserVoiceQueueRt'][_0xc008('0x6b')]({'membername':_0x4ffaa3[_0xc008('0x3e')],'UserId':_0x4ffaa3['id'],'queue_name':_0x4447ba['name'],'VoiceQueueId':_0x4447ba['id'],'interface':_[_0xc008('0x6c')](_0x4ffaa3[_0xc008('0x6d')])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0x4ffaa3[_0xc008('0x3e')]):_0x4ffaa3[_0xc008('0x6d')],'paused':_0x4ffaa3[_0xc008('0x61')]||![],'penalty':_0x4ffaa3[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){_0xc344a7['forEach'](function(_0x51b305){socket['emit'](_0xc008('0x70'),{'UserId':_0x51b305['id'],'VoiceQueueId':_0x4447ba['id']});});});});});}})['then'](respondWithStatusCode(_0xaf3bed,null))[_0xc008('0x29')](handleError(_0xaf3bed,null));};exports[_0xc008('0x71')]=function(_0x2c6a48,_0x177e8e){return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')]},'attributes':['id'],'include':[{'model':db[_0xc008('0x73')],'as':_0xc008('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xc008('0x15')](handleEntityNotFound(_0x177e8e,null))[_0xc008('0x15')](function(_0x1fea74){var _0x304083=_[_0xc008('0x17')](_0x1fea74,'id');var _0x473f44=[];var _0x41d1ea=[];var _0x5c2ca1=squel[_0xc008('0x74')]();_0x5c2ca1['field'](_0xc008('0x75'))[_0xc008('0x76')](_0xc008('0x77'),'tq')['join'](_0xc008('0x78'),'ut',_0xc008('0x79'))[_0xc008('0x24')](_0xc008('0x7a'),_0x2c6a48[_0xc008('0x2b')]['id']);for(var _0x377754=0x0;_0x377754<_0x1fea74[_0xc008('0x4c')];_0x377754+=0x1){let _0x57b8da=_0x1fea74[_0x377754];for(var _0x1cad4b=0x0;_0x1cad4b<_0x57b8da[_0xc008('0x5f')][_0xc008('0x4c')];_0x1cad4b+=0x1){let _0xdb4cef=_0x57b8da['Agents'][_0x1cad4b];var _0x555e8c=_0x5c2ca1['clone']();_0x555e8c['where'](_0xc008('0x7b'),_0xdb4cef['id']);_0x41d1ea[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x555e8c['toString'](),{'type':db[_0xc008('0x65')][_0xc008('0x7d')][_0xc008('0x7e')]})['then'](function(_0x438195){if(_0x438195['length']===0x1){return _0xdb4cef['id'];}else{var _0x3d76b7=_['every'](_[_0xc008('0x17')](_0x438195,_0xc008('0x7f')),function(_0x1aaf89){return _[_0xc008('0x19')](_0x304083,_0x1aaf89);});if(_0x3d76b7){return _0xdb4cef['id'];}}}));}}return BPromise['all'](_0x41d1ea)[_0xc008('0x15')](function(_0x19dcb7){_0x473f44=_(_0x473f44)[_0xc008('0x80')](_0x19dcb7)[_0xc008('0x81')]()[_0xc008('0x18')]();return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2c6a48['params']['id']}})[_0xc008('0x15')](function(_0x30b6af){return db[_0xc008('0x65')]['transaction'](function(_0x5ba04f){return _0x30b6af[_0xc008('0x71')](_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')],{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){if(!_['isEmpty'](_0x473f44)){return _0x30b6af[_0xc008('0x82')](_0x473f44,{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2c6a48['params']['id'],'UserId':_0x473f44},'transaction':_0x5ba04f});});}})[_0xc008('0x15')](function(){_0x473f44['forEach'](function(_0x3744e1){socket['emit'](_0xc008('0x83'),{'UserId':_0x3744e1,'VoiceQueueId':_0x30b6af['id']});});});});});});})[_0xc008('0x15')](respondWithStatusCode(_0x177e8e,null))[_0xc008('0x29')](handleError(_0x177e8e,null));};exports[_0xc008('0x84')]=function(_0x5c24cd,_0x5effd6){var _0x23ba7e,_0x274739;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5c24cd[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5effd6,null))[_0xc008('0x15')](function(_0x272d98){if(_0x272d98){_0x274739=_0x272d98;return _0x272d98[_0xc008('0x84')](_0x5c24cd[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5c24cd[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{})[_0xc008('0x85')](function(_0x57687f){for(var _0x5ea13a=0x0;_0x5ea13a<_0x5c24cd[_0xc008('0x45')]['ids'][_0xc008('0x4c')];_0x5ea13a+=0x1){socket[_0xc008('0x86')]('userVoiceQueue:save',{'UserId':Number(_0x5c24cd['body'][_0xc008('0x72')][_0x5ea13a]),'VoiceQueueId':Number(_0x5c24cd[_0xc008('0x2b')]['id'])});}return _0x57687f;});}})[_0xc008('0x15')](function(_0x129cbf){_0x23ba7e=_0x129cbf||[];if(_0x274739){return db[_0xc008('0x73')][_0xc008('0x27')]({'where':{'id':_0x5c24cd['body'][_0xc008('0x72')]},'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),'voicePause',_0xc008('0x6d')],'raw':!![]});}})[_0xc008('0x15')](function(_0xcef0e4){if(!_[_0xc008('0x87')](_0xcef0e4)){var _0x49f92e=[];for(var _0x4ae026=0x0;_0x4ae026<_0xcef0e4[_0xc008('0x4c')];_0x4ae026++){if(_0xcef0e4[_0x4ae026]['online']){_0x49f92e[_0xc008('0x7c')](db[_0xc008('0x88')][_0xc008('0x6b')]({'membername':_0xcef0e4[_0x4ae026][_0xc008('0x3e')],'UserId':_0xcef0e4[_0x4ae026]['id'],'queue_name':_0x274739[_0xc008('0x3e')],'VoiceQueueId':_0x274739['id'],'interface':_['isNil'](_0xcef0e4[_0x4ae026]['interface'])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0xcef0e4[_0x4ae026][_0xc008('0x3e')]):_0xcef0e4[_0x4ae026][_0xc008('0x6d')],'paused':_0xcef0e4[_0x4ae026][_0xc008('0x61')]||![],'penalty':_0x5c24cd[_0xc008('0x45')][_0xc008('0x64')]||0x0}));}}return BPromise['all'](_0x49f92e);}})[_0xc008('0x15')](function(){return _0x23ba7e;})[_0xc008('0x15')](respondWithResult(_0x5effd6,null))[_0xc008('0x29')](handleError(_0x5effd6,null));};exports[_0xc008('0x82')]=function(_0x1afb32,_0x1c2263){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x1afb32[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x1c2263,null))[_0xc008('0x15')](function(_0x328284){if(_0x328284){return _0x328284['removeAgents'](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])['then'](function(){if(_[_0xc008('0x89')](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])){for(var _0x2598be=0x0;_0x2598be<_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0xc008('0x4c')];_0x2598be+=0x1){socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0x2598be]),'VoiceQueueId':Number(_0x1afb32['params']['id'])});}}else{socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]),'VoiceQueueId':Number(_0x1afb32[_0xc008('0x2b')]['id'])});}});}})[_0xc008('0x15')](function(_0x12f5d1){return db[_0xc008('0x88')][_0xc008('0x1c')]({'where':{'VoiceQueueId':_0x1afb32[_0xc008('0x2b')]['id'],'UserId':_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]}})[_0xc008('0x15')](function(){return _0x12f5d1;});})[_0xc008('0x15')](respondWithStatusCode(_0x1c2263,null))[_0xc008('0x29')](handleError(_0x1c2263,null));};exports[_0xc008('0x8a')]=function(_0x5c358b,_0x49688b){var _0x51fd86={};var _0x10778f={};var _0x237ffb;var _0x3f80f4;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x5c358b[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x49688b,null))['then'](function(_0x3e7099){if(_0x3e7099){_0x237ffb=_0x3e7099;_0x10778f['model']=_['keys'](db[_0xc008('0x73')][_0xc008('0x21')]);_0x10778f['query']=_[_0xc008('0x2c')](_0x5c358b[_0xc008('0x26')]);_0x10778f[_0xc008('0x2d')]=_['intersection'](_0x10778f[_0xc008('0x2e')],_0x10778f[_0xc008('0x26')]);_0x51fd86[_0xc008('0x31')]=_['intersection'](_0x10778f[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5c358b[_0xc008('0x26')][_0xc008('0x30')]));_0x51fd86[_0xc008('0x31')]=_0x51fd86[_0xc008('0x31')][_0xc008('0x4c')]?_0x51fd86[_0xc008('0x31')]:_0x10778f['model'];_0x51fd86[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5c358b[_0xc008('0x26')][_0xc008('0x50')]);_0x51fd86[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x5c358b[_0xc008('0x26')],_0x10778f[_0xc008('0x2d')]));if(_0x5c358b[_0xc008('0x26')][_0xc008('0x53')]){_0x51fd86[_0xc008('0x24')]=_[_0xc008('0x33')](_0x51fd86[_0xc008('0x24')],{'$or':_['map'](_0x51fd86[_0xc008('0x31')],function(_0x231318){var _0x3df369={};_0x3df369[_0x231318]={'$like':'%'+_0x5c358b[_0xc008('0x26')]['filter']+'%'};return _0x3df369;})});}_0x51fd86=_['merge']({},_0x51fd86,_0x5c358b[_0xc008('0x34')]);return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})['then'](function(_0x30e433){if(_0x30e433){_0x3f80f4=_0x30e433[_0xc008('0x4c')];if(!_0x5c358b[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x51fd86[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5c358b['query']['limit']);_0x51fd86[_0xc008('0x10')]=qs['offset'](_0x5c358b[_0xc008('0x26')][_0xc008('0x10')]);}return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})[_0xc008('0x15')](function(_0x2ea1db){if(_0x2ea1db){return _0x2ea1db?{'count':_0x3f80f4,'rows':_0x2ea1db}:null;}})[_0xc008('0x15')](respondWithResult(_0x49688b,null))[_0xc008('0x29')](handleError(_0x49688b,null));};exports[_0xc008('0x8b')]=function(_0x367873,_0x356a82){var _0x368c1f={};var _0x4fd0ff={};var _0x22772e;var _0x39fd43;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x367873[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x356a82,null))[_0xc008('0x15')](function(_0x506dc0){if(_0x506dc0){_0x22772e=_0x506dc0;_0x4fd0ff[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x88')]['rawAttributes']);_0x4fd0ff[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x367873[_0xc008('0x26')]);_0x4fd0ff[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],_0x4fd0ff['query']);_0x368c1f['attributes']=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x367873[_0xc008('0x26')][_0xc008('0x30')]));_0x368c1f['attributes']=_0x368c1f[_0xc008('0x31')]['length']?_0x368c1f[_0xc008('0x31')]:_0x4fd0ff[_0xc008('0x2e')];_0x368c1f['order']=qs[_0xc008('0x50')](_0x367873[_0xc008('0x26')][_0xc008('0x50')]);_0x368c1f[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x367873[_0xc008('0x26')],_0x4fd0ff[_0xc008('0x2d')]));if(_0x367873[_0xc008('0x26')][_0xc008('0x53')]){_0x368c1f['where']=_[_0xc008('0x33')](_0x368c1f[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x368c1f['attributes'],function(_0x43f96e){var _0x353cd5={};_0x353cd5[_0x43f96e]={'$like':'%'+_0x367873[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x353cd5;})});}_0x368c1f=_['merge']({},_0x368c1f,_0x367873[_0xc008('0x34')]);return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x9afcd6){if(_0x9afcd6){_0x39fd43=_0x9afcd6[_0xc008('0x4c')];if(!_0x367873['query'][_0xc008('0x4d')]('nolimit')){_0x368c1f['limit']=qs[_0xc008('0x4f')](_0x367873['query'][_0xc008('0x4f')]);_0x368c1f[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x367873[_0xc008('0x26')][_0xc008('0x10')]);}return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x5e9e9c){return _0x5e9e9c?{'count':_0x39fd43,'rows':_0x5e9e9c}:null;})[_0xc008('0x15')](respondWithResult(_0x356a82,null))[_0xc008('0x29')](handleError(_0x356a82,null));};exports[_0xc008('0x8c')]=function(_0x45fe90,_0xc046ce){var _0x46fc75={};var _0x59b5b9={};var _0x3c3ead;var _0x3c8a79;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x45fe90[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0xc046ce,null))[_0xc008('0x15')](function(_0x3aa9b4){if(_0x3aa9b4){_0x3c3ead=_0x3aa9b4;_0x59b5b9['model']=_['keys'](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x59b5b9['query']=_[_0xc008('0x2c')](_0x45fe90['query']);_0x59b5b9[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],_0x59b5b9[_0xc008('0x26')]);_0x46fc75[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],qs['fields'](_0x45fe90[_0xc008('0x26')]['fields']));_0x46fc75[_0xc008('0x31')]=_0x46fc75[_0xc008('0x31')][_0xc008('0x4c')]?_0x46fc75[_0xc008('0x31')]:_0x59b5b9[_0xc008('0x2e')];_0x46fc75[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x45fe90['query'][_0xc008('0x50')]);_0x46fc75[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x45fe90[_0xc008('0x26')],_0x59b5b9[_0xc008('0x2d')]));if(_0x45fe90[_0xc008('0x26')][_0xc008('0x53')]){_0x46fc75[_0xc008('0x24')]=_['merge'](_0x46fc75[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x46fc75[_0xc008('0x31')],function(_0x3e7c19){var _0x47d263={};_0x47d263[_0x3e7c19]={'$like':'%'+_0x45fe90['query']['filter']+'%'};return _0x47d263;})});}_0x46fc75=_[_0xc008('0x33')]({},_0x46fc75,_0x45fe90[_0xc008('0x34')]);return _0x3c3ead['getLists'](_0x46fc75);}})['then'](function(_0x5035ca){if(_0x5035ca){_0x3c8a79=_0x5035ca['length'];if(!_0x45fe90[_0xc008('0x26')][_0xc008('0x4d')]('nolimit')){_0x46fc75[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x45fe90[_0xc008('0x26')][_0xc008('0x4f')]);_0x46fc75[_0xc008('0x10')]=qs['offset'](_0x45fe90['query'][_0xc008('0x10')]);}return _0x3c3ead[_0xc008('0x8c')](_0x46fc75);}})[_0xc008('0x15')](function(_0x46f9ab){if(_0x46f9ab){return _0x46f9ab?{'count':_0x3c8a79,'rows':_0x46f9ab}:null;}})[_0xc008('0x15')](respondWithResult(_0xc046ce,null))[_0xc008('0x29')](handleError(_0xc046ce,null));};exports[_0xc008('0x8e')]=function(_0x5645bb,_0x2ebe07){var _0x3d6f0d=moment()[_0xc008('0x6e')](_0xc008('0x8f'));var _0x3be328,_0x3bcf94;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5645bb['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2ebe07,null))[_0xc008('0x15')](function(_0x11bcba){if(_0x11bcba){_0x3bcf94=_0x11bcba;return _0x11bcba[_0xc008('0x8e')](_0x5645bb[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5645bb[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0xefba5){var _0x202826;_0x3be328=_0xefba5||[];var _0x37e1f2=[];if(_0xefba5){for(var _0x5161f3=0x0;_0x5161f3<_0xefba5['length'];_0x5161f3+=0x1){var _0x43ec81=_0xefba5[_0x5161f3][_0xc008('0x3a')]({'plain':!![]});_0x3bcf94[_0xc008('0x90')]=_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]?_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]:_0x3bcf94['dialCheckDuplicateType'];switch(_0x3bcf94['dialCheckDuplicateType']){case'always':_0x202826=squel[_0xc008('0x91')]()['into']('cm_hopper')['fromQuery']([_0xc008('0x92'),_0xc008('0x93'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','scheduledAt')['field']('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),'VoiceQueueId')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')['field']('\x27'+_0x3d6f0d+'\x27','updatedAt')['from'](_0xc008('0x99'))['where'](_0xc008('0x9a'))[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81['CmListId']['toString']())[_0xc008('0x24')](_0xc008('0x9c'))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x9e'))[_0xc008('0x76')](_0xc008('0x9f'))[_0xc008('0x24')](_0xc008('0x7a'),_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')]()))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0xc008('0x76')](_0xc008('0xa0'))[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id']['toString']())))['toString']();break;case _0xc008('0xa1'):_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x93'),'ContactId',_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0x92'),_0xc008('0x92'))['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))[_0xc008('0x96')]('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81['CmListId'][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),_0xc008('0x52'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where'](_0xc008('0x9a'))['where']('ListId\x20=\x20?',_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL')[_0xc008('0x24')](_0xc008('0x9d'),squel['select']()[_0xc008('0x96')](_0xc008('0xa4'))['from']('cm_hopper')[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id'][_0xc008('0x98')]())))['toString']();break;default:_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),'scheduledAt','ContactId',_0xc008('0x95'),'VoiceQueueId',_0xc008('0x46'),'updatedAt'],squel['select']()['field'](_0xc008('0x92'),'phone')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))['field']('id','ContactId')[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))['field'](_0x5645bb['params']['id'][_0xc008('0x98')](),'VoiceQueueId')['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')['from']('cm_contacts')[_0xc008('0x24')]('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x37e1f2[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x202826));}return BPromise[_0xc008('0xa5')](_0x37e1f2);}})[_0xc008('0x15')](function(){var _0x262b79=[];var _0x15c5a2=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa6'))[_0xc008('0xa3')]([_0xc008('0xa7'),'phone',_0xc008('0xa8'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0xa9'))[_0xc008('0x96')](_0xc008('0xaa'))[_0xc008('0x96')](_0xc008('0xab'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')[_0xc008('0x76')](_0xc008('0xac'),'ci')[_0xc008('0xad')](_0xc008('0xa0'),'h',_0xc008('0xae'))[_0xc008('0x24')](_0xc008('0xaf'),_0x3d6f0d)['where'](_0xc008('0xb0'),'PHONE'))[_0xc008('0x98')]();_0x262b79[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x15c5a2));return BPromise[_0xc008('0xa5')](_0x262b79);})[_0xc008('0x15')](function(){return _0x3be328;})[_0xc008('0x15')](respondWithResult(_0x2ebe07,null))[_0xc008('0x29')](handleError(_0x2ebe07,null));};exports[_0xc008('0xb1')]=function(_0x471780,_0x4fae34){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x471780[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x4fae34,null))[_0xc008('0x15')](function(_0x1cc6a6){if(_0x1cc6a6){return _0x1cc6a6[_0xc008('0xb1')](_0x471780[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x471618){if(_0x471618){return db[_0xc008('0x4b')][_0xc008('0x1c')]({'where':{'ListId':_0x471780['query'][_0xc008('0x72')],'VoiceQueueId':_0x471780['params']['id']}})[_0xc008('0x15')](function(){return _0x471618;});}})[_0xc008('0x15')](respondWithStatusCode(_0x4fae34,null))[_0xc008('0x29')](handleError(_0x4fae34,null));};exports[_0xc008('0xb2')]=function(_0x370234,_0x3ff7d2){var _0x478794={};var _0x406de6={};var _0x34cbce;var _0x337acd;return db['VoiceQueue']['findOne']({'where':{'id':_0x370234['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3ff7d2,null))[_0xc008('0x15')](function(_0x2ccfcf){if(_0x2ccfcf){_0x34cbce=_0x2ccfcf;_0x406de6[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x406de6['query']=_[_0xc008('0x2c')](_0x370234[_0xc008('0x26')]);_0x406de6[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],_0x406de6['query']);_0x478794[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x370234[_0xc008('0x26')][_0xc008('0x30')]));_0x478794[_0xc008('0x31')]=_0x478794[_0xc008('0x31')][_0xc008('0x4c')]?_0x478794[_0xc008('0x31')]:_0x406de6[_0xc008('0x2e')];_0x478794['order']=qs[_0xc008('0x50')](_0x370234['query'][_0xc008('0x50')]);_0x478794[_0xc008('0x24')]=qs[_0xc008('0x2d')](_['pick'](_0x370234[_0xc008('0x26')],_0x406de6['filters']));if(_0x370234[_0xc008('0x26')][_0xc008('0x53')]){_0x478794[_0xc008('0x24')]=_[_0xc008('0x33')](_0x478794[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x478794[_0xc008('0x31')],function(_0x89601c){var _0x22bb2a={};_0x22bb2a[_0x89601c]={'$like':'%'+_0x370234[_0xc008('0x26')]['filter']+'%'};return _0x22bb2a;})});}_0x478794=_[_0xc008('0x33')]({},_0x478794,_0x370234['options']);return _0x34cbce['getBlackLists'](_0x478794);}})[_0xc008('0x15')](function(_0x55ad1f){if(_0x55ad1f){_0x337acd=_0x55ad1f[_0xc008('0x4c')];if(!_0x370234[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x478794['limit']=qs[_0xc008('0x4f')](_0x370234[_0xc008('0x26')][_0xc008('0x4f')]);_0x478794[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x370234['query'][_0xc008('0x10')]);}return _0x34cbce[_0xc008('0xb2')](_0x478794);}})['then'](function(_0x247e3a){if(_0x247e3a){return _0x247e3a?{'count':_0x337acd,'rows':_0x247e3a}:null;}})[_0xc008('0x15')](respondWithResult(_0x3ff7d2,null))[_0xc008('0x29')](handleError(_0x3ff7d2,null));};exports[_0xc008('0xb3')]=function(_0x252c44,_0x3b46db){var _0x482efd;return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x252c44[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3b46db,null))[_0xc008('0x15')](function(_0x2f217e){if(_0x2f217e){return _0x2f217e[_0xc008('0xb3')](_0x252c44[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x252c44['body'],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0x298783){var _0xe349bd;_0x482efd=_0x298783||[];var _0x50db48=[];if(_0x298783){for(var _0x384f2f=0x0;_0x384f2f<_0x298783[_0xc008('0x4c')];_0x384f2f+=0x1){var _0x367581=_0x298783[_0x384f2f][_0xc008('0x3a')]({'plain':!![]});_0xe349bd=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xb4'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel['select']()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('id',_0xc008('0x94'))['field'](_0x367581[_0xc008('0x97')][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x252c44[_0xc008('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xc008('0x46'))['field']('NOW()',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where']('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x367581[_0xc008('0x97')][_0xc008('0x98')]())['where'](_0xc008('0x9c')))[_0xc008('0x98')]();_0x50db48['push'](db[_0xc008('0x65')]['query'](_0xe349bd));}return BPromise['all'](_0x50db48);}})[_0xc008('0x15')](function(){return _0x482efd;})[_0xc008('0x15')](respondWithResult(_0x3b46db,null))['catch'](handleError(_0x3b46db,null));};exports['removeBlackLists']=function(_0x1e3098,_0x9b997d){return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1e3098['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x9b997d,null))[_0xc008('0x15')](function(_0x1422ab){if(_0x1422ab){return _0x1422ab[_0xc008('0xb5')](_0x1e3098[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x41a8a6){if(_0x41a8a6){return db['CmHopperBlack'][_0xc008('0x1c')]({'where':{'ListId':_0x1e3098['query'][_0xc008('0x72')],'VoiceQueueId':_0x1e3098['params']['id']}})['then'](function(){return _0x41a8a6;});}})[_0xc008('0x15')](respondWithStatusCode(_0x9b997d,null))[_0xc008('0x29')](handleError(_0x9b997d,null));}; \ No newline at end of file +var _0x55ca=['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','merge','omit','createdAt','updatedAt','VoiceQueues','UserProfileResource','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','where','rows','getHopperHistories','CmHopperHistory','pick','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','ids','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','push','cm_hopper_additional_phones','CmHopperId','h.id','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','status','end','json','undefined','count','offset','set','Content-Range','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','sendStatus','error','stack','name','send','index','map','VoiceQueue','key','getOptions','include','query','findAll','catch','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x5d655d,_0x43741c){var _0x346c23=function(_0x2684ca){while(--_0x2684ca){_0x5d655d['push'](_0x5d655d['shift']());}};_0x346c23(++_0x43741c);}(_0x55ca,0x126));var _0xa55c=function(_0x23e4b4,_0x132419){_0x23e4b4=_0x23e4b4-0x0;var _0x3bc471=_0x55ca[_0x23e4b4];return _0x3bc471;};'use strict';var moment=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0xa55c('0x2'));var qs=require(_0xa55c('0x3'));var logger=require('../../config/logger')(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var db=require(_0xa55c('0x6'))['db'];config[_0xa55c('0x7')]=_[_0xa55c('0x8')](config[_0xa55c('0x7')],{'host':_0xa55c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0x7')]));require(_0xa55c('0xa'))['register'](socket);function respondWithStatusCode(_0x291996,_0x290d28){_0x290d28=_0x290d28||0xcc;return function(_0x52a3bc){if(_0x52a3bc){return _0x291996['sendStatus'](_0x290d28);}return _0x291996[_0xa55c('0xb')](_0x290d28)[_0xa55c('0xc')]();};}function respondWithResult(_0x381d07,_0x5d8e5a){_0x5d8e5a=_0x5d8e5a||0xc8;return function(_0x31646d){if(_0x31646d){return _0x381d07[_0xa55c('0xb')](_0x5d8e5a)[_0xa55c('0xd')](_0x31646d);}};}function respondWithFilteredResult(_0x70c2de,_0x3998f7){return function(_0x15eec8){if(_0x15eec8){var _0x5d47ff=typeof _0x3998f7['offset']===_0xa55c('0xe')&&typeof _0x3998f7['limit']==='undefined';var _0x59ea8d=_0x15eec8[_0xa55c('0xf')];var _0x3930e4=_0x5d47ff?0x0:_0x3998f7[_0xa55c('0x10')];var _0x938bd6=_0x5d47ff?_0x15eec8[_0xa55c('0xf')]:_0x3998f7[_0xa55c('0x10')]+_0x3998f7['limit'];var _0x3ccf65;if(_0x938bd6>=_0x59ea8d){_0x938bd6=_0x59ea8d;_0x3ccf65=0xc8;}else{_0x3ccf65=0xce;}_0x70c2de[_0xa55c('0xb')](_0x3ccf65);return _0x70c2de[_0xa55c('0x11')](_0xa55c('0x12'),_0x3930e4+'-'+_0x938bd6+'/'+_0x59ea8d)[_0xa55c('0xd')](_0x15eec8);}return null;};}function saveUpdates(_0x3ae86b){return function(_0x51590e){if(_0x51590e){return _0x51590e[_0xa55c('0x13')](_0x3ae86b)[_0xa55c('0x14')](function(_0x4cee3c){return _0x4cee3c;});}return null;};}function removeEntity(_0x3d4c9e){return function(_0x104a99){if(_0x104a99){return _0x104a99[_0xa55c('0x15')]()[_0xa55c('0x14')](function(){var _0x23a1ae=_0x104a99[_0xa55c('0x16')]({'plain':!![]});var _0x4c0daf=[{'name':'VoiceQueues','value':_0xa55c('0x17'),'ignore':![]},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19'),'ignore':![]}];var _0x4cfe10=_(_0x4c0daf)[_0xa55c('0x1a')](_0xa55c('0x1b'))['map'](_0xa55c('0x1c'))[_0xa55c('0x1c')]();if(_[_0xa55c('0x1d')](_0x4cfe10,_0x23a1ae[_0xa55c('0x1e')])){return;}var _0x234372=_['find'](_0x4c0daf,[_0xa55c('0x1c'),_0x23a1ae['type']])['name'];return db['UserProfileResource'][_0xa55c('0x15')]({'where':{'type':_0x234372,'resourceId':_0x23a1ae['id']}})['then'](function(){return _0x104a99;});})[_0xa55c('0x14')](function(){_0x3d4c9e[_0xa55c('0xb')](0xcc)[_0xa55c('0xc')]();});}};}function handleEntityNotFound(_0xf0e574){return function(_0x2313a9){if(!_0x2313a9){_0xf0e574[_0xa55c('0x1f')](0x194);}return _0x2313a9;};}function handleError(_0x1da633,_0x11e7f7){_0x11e7f7=_0x11e7f7||0x1f4;return function(_0x192df2){logger[_0xa55c('0x20')](_0x192df2[_0xa55c('0x21')]);if(_0x192df2['name']){delete _0x192df2[_0xa55c('0x22')];}_0x1da633[_0xa55c('0xb')](_0x11e7f7)[_0xa55c('0x23')](_0x192df2);};}exports[_0xa55c('0x24')]=function(_0x5d940d,_0x1377b0){var _0x22f6b6={};var _0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x25')](db[_0xa55c('0x26')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x1e')][_0xa55c('0x27')]};});_0x22f6b6=qs[_0xa55c('0x28')](_0x201941,_0x5d940d);var _0x223813={'where':_0x22f6b6['where']};return db[_0xa55c('0x26')][_0xa55c('0xf')](_0x223813)[_0xa55c('0x14')](function(_0x20da31){_0x1b8388[_0xa55c('0xf')]=_0x20da31;_0x22f6b6[_0xa55c('0x29')]=qs[_0xa55c('0x29')](_0x5d940d[_0xa55c('0x2a')]);return db[_0xa55c('0x26')][_0xa55c('0x2b')](_0x22f6b6);})[_0xa55c('0x14')](function(_0x4eb7c4){_0x1b8388['rows']=_0x4eb7c4;return _0x1b8388;})[_0xa55c('0x14')](respondWithFilteredResult(_0x1377b0,_0x22f6b6))[_0xa55c('0x2c')](handleError(_0x1377b0,null));};exports['show']=function(_0x30fadd,_0x2f0110){var _0x2e9623={'raw':![],'where':{'id':_0x30fadd[_0xa55c('0x2d')]['id']}},_0x1839ac={};_0x1839ac[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x26')][_0xa55c('0x30')]);_0x1839ac['query']=_['keys'](_0x30fadd['query']);_0x1839ac[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x1839ac[_0xa55c('0x2e')],_0x1839ac['query']);_0x2e9623[_0xa55c('0x33')]=_['intersection'](_0x1839ac[_0xa55c('0x2e')],qs['fields'](_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2e9623[_0xa55c('0x33')]=_0x2e9623['attributes'][_0xa55c('0x35')]?_0x2e9623[_0xa55c('0x33')]:_0x1839ac['model'];if(_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x2e9623['include']=[{'all':!![]}];}_0x2e9623=_['merge']({},_0x2e9623,_0x30fadd[_0xa55c('0x37')]);return db['VoiceQueue'][_0xa55c('0x38')](_0x2e9623)[_0xa55c('0x14')](handleEntityNotFound(_0x2f0110,null))['then'](respondWithResult(_0x2f0110,null))['catch'](handleError(_0x2f0110,null));};exports['create']=function(_0x4de781,_0x3b3308){return db[_0xa55c('0x26')][_0xa55c('0x39')](_0x4de781[_0xa55c('0x3a')],{})[_0xa55c('0x14')](function(_0x56d17c){var _0x3d52d8=_0x4de781[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x3d52d8)throw new Error(_0xa55c('0x3c'));if(_0x3d52d8[_0xa55c('0x3d')]===_0xa55c('0x3b')){var _0x554620=_0x56d17c[_0xa55c('0x16')]({'plain':!![]});var _0x5ee63d=[{'name':'VoiceQueues','value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':'outbound'}];var _0x2bd98b=_['find'](_0x5ee63d,['value',_0x554620[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x2bd98b,'userProfileId':_0x3d52d8[_0xa55c('0x3f')]},'raw':!![]})[_0xa55c('0x14')](function(_0x5d9d5d){if(_0x5d9d5d&&_0x5d9d5d[_0xa55c('0x40')]===0x0){return db['UserProfileResource'][_0xa55c('0x39')]({'name':_0x554620[_0xa55c('0x22')],'resourceId':_0x554620['id'],'type':_0x5d9d5d['name'],'sectionId':_0x5d9d5d['id']},{})[_0xa55c('0x14')](function(){return _0x56d17c;});}else{return _0x56d17c;}})[_0xa55c('0x2c')](function(_0x5d834d){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x5d834d);throw _0x5d834d;});}return _0x56d17c;})[_0xa55c('0x14')](respondWithResult(_0x3b3308,0xc9))['catch'](handleError(_0x3b3308,null));};exports[_0xa55c('0x42')]=function(_0x582901,_0x2f9717){var _0x3a8af4={'where':{'id':_0x582901['params']['id']}},_0x451269={};_0x451269[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['VoiceQueue'][_0xa55c('0x30')]);_0x3a8af4[_0xa55c('0x33')]=_['intersection'](_0x451269[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x582901['query'][_0xa55c('0x34')]));_0x3a8af4[_0xa55c('0x33')]=_0x3a8af4[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3a8af4['attributes']:_0x451269[_0xa55c('0x2e')];if(_0x582901['query'][_0xa55c('0x36')]){_0x3a8af4[_0xa55c('0x29')]=[{'all':!![]}];}_0x3a8af4=_[_0xa55c('0x43')]({},_0x3a8af4,_0x582901['options']);return db[_0xa55c('0x26')][_0xa55c('0x38')](_0x3a8af4)['then'](handleEntityNotFound(_0x2f9717,null))[_0xa55c('0x14')](function(_0x34de95){if(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x16')]({'plain':!![]});_0x3822b7=qs[_0xa55c('0x44')](_0x3822b7,['id',_0xa55c('0x45'),_0xa55c('0x46')]);_0x582901[_0xa55c('0x3a')]=_[_0xa55c('0x44')](_0x582901[_0xa55c('0x3a')],['id','createdAt',_0xa55c('0x46')]);return db[_0xa55c('0x26')][_0xa55c('0x39')](_['merge'](_0x3822b7,_0x582901[_0xa55c('0x3a')]),{'include':_0x582901[_0xa55c('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x14')](function(_0x4fa412){var _0x2b6a0e=_0x582901[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x2b6a0e)throw new Error(_0xa55c('0x3c'));if(_0x2b6a0e[_0xa55c('0x3d')]==='user'){var _0x44b7c1=_0x4fa412[_0xa55c('0x16')]({'plain':!![]});var _0x4b85cc=[{'name':_0xa55c('0x47'),'value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19')}];var _0x50176b=_['find'](_0x4b85cc,[_0xa55c('0x1c'),_0x44b7c1[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x50176b,'userProfileId':_0x2b6a0e[_0xa55c('0x3f')]},'raw':!![]})['then'](function(_0x2742e4){if(_0x2742e4&&_0x2742e4[_0xa55c('0x40')]===0x0){return db[_0xa55c('0x48')][_0xa55c('0x39')]({'name':_0x44b7c1[_0xa55c('0x22')],'resourceId':_0x44b7c1['id'],'type':_0x2742e4['name'],'sectionId':_0x2742e4['id']},{})[_0xa55c('0x14')](function(){return _0x4fa412;});}else{return _0x4fa412;}})['catch'](function(_0x23f67f){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x23f67f);throw _0x23f67f;});}return _0x4fa412;});}})[_0xa55c('0x14')](respondWithResult(_0x2f9717,0xc9))[_0xa55c('0x2c')](handleError(_0x2f9717,null));};exports[_0xa55c('0x13')]=function(_0x5d14e0,_0x53e2be){if(_0x5d14e0[_0xa55c('0x3a')]['id']){delete _0x5d14e0[_0xa55c('0x3a')]['id'];}return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x5d14e0[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x53e2be,null))[_0xa55c('0x14')](saveUpdates(_0x5d14e0[_0xa55c('0x3a')],null))[_0xa55c('0x14')](respondWithResult(_0x53e2be,null))[_0xa55c('0x2c')](handleError(_0x53e2be,null));};exports[_0xa55c('0x15')]=function(_0x493f51,_0xdd92c1){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x493f51[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0xdd92c1,null))['then'](removeEntity(_0xdd92c1,null))[_0xa55c('0x2c')](handleError(_0xdd92c1,null));};exports['getHoppers']=function(_0x2e482a,_0x5e3a28){var _0x3495a7={'raw':![],'where':{}};var _0x5a8897={};var _0x34edc5={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x2e482a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x5e3a28,null))[_0xa55c('0x14')](function(_0xafaf8c){if(_0xafaf8c){_0x5a8897[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x4a')]['rawAttributes']);_0x5a8897[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x2e482a['query']);_0x5a8897[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],_0x5a8897[_0xa55c('0x2a')]);_0x3495a7[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x2e482a['query'][_0xa55c('0x34')]));_0x3495a7[_0xa55c('0x33')]=_0x3495a7[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3495a7[_0xa55c('0x33')]:_0x5a8897[_0xa55c('0x2e')];if(!_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x3495a7['limit']=qs[_0xa55c('0x4d')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x3495a7[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x3495a7[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x3495a7['where']=qs[_0xa55c('0x31')](_['pick'](_0x2e482a[_0xa55c('0x2a')],_0x5a8897[_0xa55c('0x31')]));_0x3495a7[_0xa55c('0x50')]['VoiceQueueId']=_0xafaf8c['id'];if(_0x2e482a['query'][_0xa55c('0x1a')]){_0x3495a7[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x50')],{'$or':_['map'](_0x3495a7[_0xa55c('0x33')],function(_0xd02251){var _0x8ea1c6={};_0x8ea1c6[_0xd02251]={'$like':'%'+_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x8ea1c6;})});}_0x3495a7=_['merge']({},_0x3495a7,_0x2e482a['options']);return db[_0xa55c('0x4a')][_0xa55c('0xf')]({'where':_0x3495a7[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x1af9d5){_0x34edc5['count']=_0x1af9d5;if(_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x3495a7['include']=[{'all':!![]}];}return db[_0xa55c('0x4a')][_0xa55c('0x2b')](_0x3495a7);})[_0xa55c('0x14')](function(_0x4dcb93){_0x34edc5[_0xa55c('0x51')]=_0x4dcb93;return _0x34edc5;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x5e3a28,_0x3495a7))[_0xa55c('0x2c')](handleError(_0x5e3a28,null));};exports[_0xa55c('0x52')]=function(_0x232143,_0x506f74){var _0x25bd5b={'raw':!![],'where':{}};var _0x2e2cf6={};var _0x4bf233={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x232143['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x506f74,null))[_0xa55c('0x14')](function(_0x2f13db){if(_0x2f13db){_0x2e2cf6[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x53')][_0xa55c('0x30')]);_0x2e2cf6[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x232143['query']);_0x2e2cf6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],_0x2e2cf6[_0xa55c('0x2a')]);_0x25bd5b['attributes']=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x232143[_0xa55c('0x2a')]['fields']));_0x25bd5b['attributes']=_0x25bd5b[_0xa55c('0x33')][_0xa55c('0x35')]?_0x25bd5b[_0xa55c('0x33')]:_0x2e2cf6[_0xa55c('0x2e')];if(!_0x232143['query']['hasOwnProperty'](_0xa55c('0x4c'))){_0x25bd5b[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x232143[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x25bd5b[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x232143['query'][_0xa55c('0x10')]);}_0x25bd5b['order']=qs[_0xa55c('0x4f')](_0x232143['query'][_0xa55c('0x4f')]);_0x25bd5b[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x232143[_0xa55c('0x2a')],_0x2e2cf6[_0xa55c('0x31')]));_0x25bd5b[_0xa55c('0x50')][_0xa55c('0x55')]=_0x2f13db['id'];if(_0x232143['query']['filter']){_0x25bd5b[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x25bd5b[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x25bd5b[_0xa55c('0x33')],function(_0x137728){var _0x47e8e2={};_0x47e8e2[_0x137728]={'$like':'%'+_0x232143[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x47e8e2;})});}_0x25bd5b=_[_0xa55c('0x43')]({},_0x25bd5b,_0x232143[_0xa55c('0x37')]);return db[_0xa55c('0x53')][_0xa55c('0xf')]({'where':_0x25bd5b[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x58b670){_0x4bf233[_0xa55c('0xf')]=_0x58b670;if(_0x232143[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x25bd5b[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x53')]['findAll'](_0x25bd5b);})[_0xa55c('0x14')](function(_0x2ab1f2){_0x4bf233['rows']=_0x2ab1f2;return _0x4bf233;});}})['then'](respondWithFilteredResult(_0x506f74,_0x25bd5b))[_0xa55c('0x2c')](handleError(_0x506f74,null));};exports[_0xa55c('0x56')]=function(_0x5c2229,_0x559e71){var _0x579726={'raw':!![],'where':{}};var _0x5ab79e={};var _0xf8e295={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x5c2229[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x559e71,null))[_0xa55c('0x14')](function(_0x568a5b){if(_0x568a5b){_0x5ab79e[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x57')][_0xa55c('0x30')]);_0x5ab79e['query']=_[_0xa55c('0x2f')](_0x5c2229[_0xa55c('0x2a')]);_0x5ab79e[_0xa55c('0x31')]=_['intersection'](_0x5ab79e[_0xa55c('0x2e')],_0x5ab79e['query']);_0x579726['attributes']=_[_0xa55c('0x32')](_0x5ab79e[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x579726[_0xa55c('0x33')]=_0x579726[_0xa55c('0x33')]['length']?_0x579726['attributes']:_0x5ab79e[_0xa55c('0x2e')];if(!_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x579726[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x579726[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x5c2229['query'][_0xa55c('0x10')]);}_0x579726[_0xa55c('0x4e')]=qs['sort'](_0x5c2229[_0xa55c('0x2a')]['sort']);_0x579726[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x5c2229[_0xa55c('0x2a')],_0x5ab79e[_0xa55c('0x31')]));_0x579726['where'][_0xa55c('0x55')]=_0x568a5b['id'];if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x579726[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x579726[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x579726['attributes'],function(_0x49a307){var _0x5c08e5={};_0x5c08e5[_0x49a307]={'$like':'%'+_0x5c2229[_0xa55c('0x2a')]['filter']+'%'};return _0x5c08e5;})});}_0x579726=_[_0xa55c('0x43')]({},_0x579726,_0x5c2229[_0xa55c('0x37')]);return db[_0xa55c('0x57')][_0xa55c('0xf')]({'where':_0x579726[_0xa55c('0x50')]})['then'](function(_0x253d7a){_0xf8e295['count']=_0x253d7a;if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x579726[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x57')]['findAll'](_0x579726);})[_0xa55c('0x14')](function(_0x46f8ab){_0xf8e295[_0xa55c('0x51')]=_0x46f8ab;return _0xf8e295;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x559e71,_0x579726))[_0xa55c('0x2c')](handleError(_0x559e71,null));};exports[_0xa55c('0x58')]=function(_0x270bd0,_0x472c73){var _0x5bae40={'raw':!![],'where':{}};var _0x147962={};var _0x1538dc={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x270bd0[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x472c73,null))['then'](function(_0x46124b){if(_0x46124b){_0x147962['model']=_[_0xa55c('0x2f')](db['CmHopperBlack'][_0xa55c('0x30')]);_0x147962[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x270bd0['query']);_0x147962[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x147962[_0xa55c('0x2e')],_0x147962['query']);_0x5bae40[_0xa55c('0x33')]=_['intersection'](_0x147962[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x270bd0['query'][_0xa55c('0x34')]));_0x5bae40['attributes']=_0x5bae40[_0xa55c('0x33')][_0xa55c('0x35')]?_0x5bae40['attributes']:_0x147962[_0xa55c('0x2e')];if(!_0x270bd0[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x5bae40[_0xa55c('0x4d')]=qs['limit'](_0x270bd0[_0xa55c('0x2a')]['limit']);_0x5bae40['offset']=qs[_0xa55c('0x10')](_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x5bae40[_0xa55c('0x4e')]=qs['sort'](_0x270bd0[_0xa55c('0x2a')]['sort']);_0x5bae40[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x270bd0['query'],_0x147962[_0xa55c('0x31')]));_0x5bae40['where']['VoiceQueueId']=_0x46124b['id'];if(_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x5bae40[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x5bae40[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x5bae40[_0xa55c('0x33')],function(_0x9225d9){var _0x465801={};_0x465801[_0x9225d9]={'$like':'%'+_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x465801;})});}_0x5bae40=_[_0xa55c('0x43')]({},_0x5bae40,_0x270bd0[_0xa55c('0x37')]);return db['CmHopperBlack'][_0xa55c('0xf')]({'where':_0x5bae40['where']})['then'](function(_0x5c8003){_0x1538dc[_0xa55c('0xf')]=_0x5c8003;if(_0x270bd0['query'][_0xa55c('0x36')]){_0x5bae40['include']=[{'all':!![]}];}return db[_0xa55c('0x59')]['findAll'](_0x5bae40);})['then'](function(_0xfb1954){_0x1538dc['rows']=_0xfb1954;return _0x1538dc;});}})['then'](respondWithFilteredResult(_0x472c73,_0x5bae40))[_0xa55c('0x2c')](handleError(_0x472c73,null));};exports[_0xa55c('0x5a')]=function(_0x4ba496,_0x11349d){var _0x55caeb={};var _0x294e54={};var _0x403dff;var _0x1dcd8a;return db['VoiceQueue']['findOne']({'where':{'id':_0x4ba496[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x11349d,null))[_0xa55c('0x14')](function(_0xfda07f){if(_0xfda07f){_0x403dff=_0xfda07f;_0x294e54[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x5b')][_0xa55c('0x30')]);_0x294e54['query']=_[_0xa55c('0x2f')](_0x4ba496[_0xa55c('0x2a')]);_0x294e54[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],_0x294e54[_0xa55c('0x2a')]);_0x55caeb[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],qs['fields'](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x55caeb[_0xa55c('0x33')]=_0x55caeb['attributes']['length']?_0x55caeb['attributes']:_0x294e54[_0xa55c('0x2e')];_0x55caeb['order']=qs[_0xa55c('0x4f')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x55caeb[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x4ba496[_0xa55c('0x2a')],_0x294e54[_0xa55c('0x31')]));if(_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x55caeb[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x55caeb[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x55caeb[_0xa55c('0x33')],function(_0x1c7aec){var _0xf0bcac={};_0xf0bcac[_0x1c7aec]={'$like':'%'+_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0xf0bcac;})});}_0x55caeb=_[_0xa55c('0x43')]({},_0x55caeb,_0x4ba496[_0xa55c('0x37')]);return _0x403dff[_0xa55c('0x5a')](_0x55caeb);}})[_0xa55c('0x14')](function(_0x168b3f){if(_0x168b3f){_0x1dcd8a=_0x168b3f['length'];if(!_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4b')]('nolimit')){_0x55caeb[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x55caeb[_0xa55c('0x10')]=qs['offset'](_0x4ba496[_0xa55c('0x2a')]['offset']);}return _0x403dff['getTeams'](_0x55caeb);}})[_0xa55c('0x14')](function(_0x1c9903){if(_0x1c9903){return _0x1c9903?{'count':_0x1dcd8a,'rows':_0x1c9903}:null;}})[_0xa55c('0x14')](respondWithResult(_0x11349d,null))[_0xa55c('0x2c')](handleError(_0x11349d,null));};exports[_0xa55c('0x5c')]=function(_0x23b513,_0x1e4464){var _0xd9f634=_0x23b513[_0xa55c('0x3a')][_0xa55c('0x5d')];var _0x1036b3=_[_0xa55c('0x25')](_0xd9f634,'id');return db[_0xa55c('0x5b')][_0xa55c('0x2b')]({'where':{'id':_0x1036b3},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':_0xa55c('0x5f'),'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x55a98d){if(_0x55a98d){var _0x200c28=_[_0xa55c('0x62')](_0x55a98d,function(_0x5e41b3){var _0x45b329=_0x5e41b3['get']({'plain':!![]});_0x45b329[_0xa55c('0x5f')]['forEach'](function(_0x3060f2){_0x3060f2[_0xa55c('0x63')]=_[_0xa55c('0x38')](_0xd9f634,{'id':_0x45b329['id']})[_0xa55c('0x63')];});return _0x45b329[_0xa55c('0x5f')];});return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x23b513[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x665054){return db[_0xa55c('0x64')]['transaction'](function(_0x59f3a4){return _0x665054[_0xa55c('0x5c')](_0x1036b3,{'transaction':_0x59f3a4})['then'](function(){return BPromise[_0xa55c('0x65')](_0xd9f634,function(_0x5447a4){return db[_0xa55c('0x66')][_0xa55c('0x67')]({'TeamId':_0x5447a4['id'],'VoiceQueueId':_0x23b513[_0xa55c('0x2d')]['id'],'penalty':_0x5447a4['penalty']},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){return BPromise[_0xa55c('0x65')](_0x200c28,function(_0x130c5f){return db['UserVoiceQueue'][_0xa55c('0x68')]({'where':{'UserId':_0x130c5f['id'],'VoiceQueueId':_0x23b513['params']['id']},'defaults':{'penalty':_0x130c5f[_0xa55c('0x63')]},'transaction':_0x59f3a4});});})['then'](function(){return BPromise['each'](_[_0xa55c('0x1a')](_0x200c28,{'online':!![]}),function(_0x40e121){return db[_0xa55c('0x69')]['upsert']({'membername':_0x40e121[_0xa55c('0x22')],'UserId':_0x40e121['id'],'queue_name':_0x665054[_0xa55c('0x22')],'VoiceQueueId':_0x665054['id'],'interface':_[_0xa55c('0x6a')](_0x40e121[_0xa55c('0x6b')])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0x40e121[_0xa55c('0x22')]):_0x40e121[_0xa55c('0x6b')],'paused':_0x40e121['voicePause']||![],'penalty':_0x40e121[_0xa55c('0x63')]},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){_0x200c28[_0xa55c('0x6e')](function(_0x151533){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':_0x151533['id'],'VoiceQueueId':_0x665054['id']});});});});});}})[_0xa55c('0x14')](respondWithStatusCode(_0x1e4464,null))[_0xa55c('0x2c')](handleError(_0x1e4464,null));};exports[_0xa55c('0x71')]=function(_0x261087,_0x2ef9dd){return db['Team'][_0xa55c('0x2b')]({'where':{'id':_0x261087['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa55c('0x14')](handleEntityNotFound(_0x2ef9dd,null))['then'](function(_0x302284){var _0x231499=_[_0xa55c('0x25')](_0x302284,'id');var _0x2d3e42=[];var _0x97275b=[];var _0x5c7c60=squel[_0xa55c('0x72')]();_0x5c7c60['field'](_0xa55c('0x73'))['from']('team_has_voice_queues','tq')[_0xa55c('0x74')](_0xa55c('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa55c('0x50')](_0xa55c('0x76'),_0x261087[_0xa55c('0x2d')]['id']);for(var _0x485652=0x0;_0x485652<_0x302284['length'];_0x485652+=0x1){let _0x57a1fc=_0x302284[_0x485652];for(var _0x50018c=0x0;_0x50018c<_0x57a1fc[_0xa55c('0x5f')][_0xa55c('0x35')];_0x50018c+=0x1){let _0x4c77c4=_0x57a1fc[_0xa55c('0x5f')][_0x50018c];var _0x1322a0=_0x5c7c60[_0xa55c('0x42')]();_0x1322a0['where'](_0xa55c('0x77'),_0x4c77c4['id']);_0x97275b['push'](db['sequelize']['query'](_0x1322a0[_0xa55c('0x78')](),{'type':db['sequelize'][_0xa55c('0x79')]['SELECT']})[_0xa55c('0x14')](function(_0x21e529){if(_0x21e529[_0xa55c('0x35')]===0x1){return _0x4c77c4['id'];}else{var _0x5063e7=_[_0xa55c('0x7a')](_[_0xa55c('0x25')](_0x21e529,_0xa55c('0x7b')),function(_0x16401f){return _[_0xa55c('0x1d')](_0x231499,_0x16401f);});if(_0x5063e7){return _0x4c77c4['id'];}}}));}}return BPromise[_0xa55c('0x7c')](_0x97275b)[_0xa55c('0x14')](function(_0x34d755){_0x2d3e42=_(_0x2d3e42)[_0xa55c('0x7d')](_0x34d755)['compact']()[_0xa55c('0x1c')]();return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x261087[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x2c0b71){return db['sequelize'][_0xa55c('0x7e')](function(_0x5bae58){return _0x2c0b71[_0xa55c('0x71')](_0x261087[_0xa55c('0x2a')]['ids'],{'transaction':_0x5bae58})[_0xa55c('0x14')](function(){if(!_[_0xa55c('0x7f')](_0x2d3e42)){return _0x2c0b71['removeAgents'](_0x2d3e42,{'transaction':_0x5bae58})['then'](function(){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0x261087[_0xa55c('0x2d')]['id'],'UserId':_0x2d3e42},'transaction':_0x5bae58});});}})[_0xa55c('0x14')](function(){_0x2d3e42[_0xa55c('0x6e')](function(_0x1a335b){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':_0x1a335b,'VoiceQueueId':_0x2c0b71['id']});});});});});});})['then'](respondWithStatusCode(_0x2ef9dd,null))[_0xa55c('0x2c')](handleError(_0x2ef9dd,null));};exports[_0xa55c('0x81')]=function(_0xc8cd97,_0x21a206){var _0x29469d,_0x59a69d;return db[_0xa55c('0x26')]['find']({'where':{'id':_0xc8cd97['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x21a206,null))[_0xa55c('0x14')](function(_0x6fcc){if(_0x6fcc){_0x59a69d=_0x6fcc;return _0x6fcc[_0xa55c('0x81')](_0xc8cd97['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0xc8cd97[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{})[_0xa55c('0x83')](function(_0x4295c1){for(var _0x37f242=0x0;_0x37f242<_0xc8cd97[_0xa55c('0x3a')]['ids'][_0xa55c('0x35')];_0x37f242+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':Number(_0xc8cd97[_0xa55c('0x3a')]['ids'][_0x37f242]),'VoiceQueueId':Number(_0xc8cd97[_0xa55c('0x2d')]['id'])});}return _0x4295c1;});}})[_0xa55c('0x14')](function(_0x65c752){_0x29469d=_0x65c752||[];if(_0x59a69d){return db['User'][_0xa55c('0x2b')]({'where':{'id':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x82')]},'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),_0xa55c('0x6b')],'raw':!![]});}})['then'](function(_0xcd4f3a){if(!_[_0xa55c('0x7f')](_0xcd4f3a)){var _0x496e8c=[];for(var _0x1c930b=0x0;_0x1c930b<_0xcd4f3a[_0xa55c('0x35')];_0x1c930b++){if(_0xcd4f3a[_0x1c930b][_0xa55c('0x60')]){_0x496e8c['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0xcd4f3a[_0x1c930b][_0xa55c('0x22')],'UserId':_0xcd4f3a[_0x1c930b]['id'],'queue_name':_0x59a69d[_0xa55c('0x22')],'VoiceQueueId':_0x59a69d['id'],'interface':_['isNil'](_0xcd4f3a[_0x1c930b]['interface'])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0xcd4f3a[_0x1c930b]['name']):_0xcd4f3a[_0x1c930b]['interface'],'paused':_0xcd4f3a[_0x1c930b][_0xa55c('0x61')]||![],'penalty':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x63')]||0x0}));}}return BPromise['all'](_0x496e8c);}})['then'](function(){return _0x29469d;})[_0xa55c('0x14')](respondWithResult(_0x21a206,null))['catch'](handleError(_0x21a206,null));};exports[_0xa55c('0x84')]=function(_0xe0a356,_0x5a4e69){return db[_0xa55c('0x26')]['find']({'where':{'id':_0xe0a356['params']['id']}})['then'](handleEntityNotFound(_0x5a4e69,null))['then'](function(_0x527669){if(_0x527669){return _0x527669[_0xa55c('0x84')](_0xe0a356['query'][_0xa55c('0x82')])[_0xa55c('0x14')](function(){if(_[_0xa55c('0x85')](_0xe0a356['query'][_0xa55c('0x82')])){for(var _0x111ff8=0x0;_0x111ff8<_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0xa55c('0x35')];_0x111ff8+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0x111ff8]),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}}else{socket['emit'](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')]['ids']),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}});}})[_0xa55c('0x14')](function(_0x940871){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0xe0a356[_0xa55c('0x2d')]['id'],'UserId':_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')]}})[_0xa55c('0x14')](function(){return _0x940871;});})[_0xa55c('0x14')](respondWithStatusCode(_0x5a4e69,null))[_0xa55c('0x2c')](handleError(_0x5a4e69,null));};exports[_0xa55c('0x86')]=function(_0x262d72,_0x228d12){var _0x16e229={};var _0x5c8713={};var _0x2d03b2;var _0x4b2e75;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x262d72[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x228d12,null))['then'](function(_0x537011){if(_0x537011){_0x2d03b2=_0x537011;_0x5c8713[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['User'][_0xa55c('0x30')]);_0x5c8713[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x262d72['query']);_0x5c8713[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5c8713[_0xa55c('0x2e')],_0x5c8713['query']);_0x16e229[_0xa55c('0x33')]=_['intersection'](_0x5c8713[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x16e229[_0xa55c('0x33')]=_0x16e229['attributes'][_0xa55c('0x35')]?_0x16e229[_0xa55c('0x33')]:_0x5c8713[_0xa55c('0x2e')];_0x16e229['order']=qs[_0xa55c('0x4f')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x16e229['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x262d72[_0xa55c('0x2a')],_0x5c8713[_0xa55c('0x31')]));if(_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x16e229[_0xa55c('0x50')]=_['merge'](_0x16e229[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x16e229[_0xa55c('0x33')],function(_0x100ccb){var _0x531e60={};_0x531e60[_0x100ccb]={'$like':'%'+_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x531e60;})});}_0x16e229=_[_0xa55c('0x43')]({},_0x16e229,_0x262d72[_0xa55c('0x37')]);return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0x243cf3){if(_0x243cf3){_0x4b2e75=_0x243cf3['length'];if(!_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x16e229[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x262d72['query']['limit']);_0x16e229['offset']=qs[_0xa55c('0x10')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0xb22076){if(_0xb22076){return _0xb22076?{'count':_0x4b2e75,'rows':_0xb22076}:null;}})[_0xa55c('0x14')](respondWithResult(_0x228d12,null))[_0xa55c('0x2c')](handleError(_0x228d12,null));};exports['getMembers']=function(_0x35c42c,_0x3b2174){var _0x35375e={};var _0x19a5f1={};var _0x3e7cfa;var _0xd511c0;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x35c42c['params']['id']}})['then'](handleEntityNotFound(_0x3b2174,null))['then'](function(_0x58831d){if(_0x58831d){_0x3e7cfa=_0x58831d;_0x19a5f1[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x69')][_0xa55c('0x30')]);_0x19a5f1[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x35c42c[_0xa55c('0x2a')]);_0x19a5f1[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x19a5f1[_0xa55c('0x2e')],_0x19a5f1[_0xa55c('0x2a')]);_0x35375e['attributes']=_['intersection'](_0x19a5f1[_0xa55c('0x2e')],qs['fields'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x35375e[_0xa55c('0x33')]=_0x35375e[_0xa55c('0x33')][_0xa55c('0x35')]?_0x35375e[_0xa55c('0x33')]:_0x19a5f1[_0xa55c('0x2e')];_0x35375e[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x35c42c['query'][_0xa55c('0x4f')]);_0x35375e[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x35c42c[_0xa55c('0x2a')],_0x19a5f1[_0xa55c('0x31')]));if(_0x35c42c[_0xa55c('0x2a')]['filter']){_0x35375e[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x35375e[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x35375e['attributes'],function(_0x55459c){var _0x33d58c={};_0x33d58c[_0x55459c]={'$like':'%'+_0x35c42c['query']['filter']+'%'};return _0x33d58c;})});}_0x35375e=_[_0xa55c('0x43')]({},_0x35375e,_0x35c42c[_0xa55c('0x37')]);return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})[_0xa55c('0x14')](function(_0x5184ea){if(_0x5184ea){_0xd511c0=_0x5184ea[_0xa55c('0x35')];if(!_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x35375e[_0xa55c('0x4d')]=qs['limit'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x35375e[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})['then'](function(_0x2d5e0e){return _0x2d5e0e?{'count':_0xd511c0,'rows':_0x2d5e0e}:null;})['then'](respondWithResult(_0x3b2174,null))[_0xa55c('0x2c')](handleError(_0x3b2174,null));};exports[_0xa55c('0x88')]=function(_0x3755a7,_0x50663f){var _0x50b42f={};var _0x307b39={};var _0x1319c6;var _0x536e1d;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x3755a7[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x50663f,null))[_0xa55c('0x14')](function(_0x568a42){if(_0x568a42){_0x1319c6=_0x568a42;_0x307b39[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x89')][_0xa55c('0x30')]);_0x307b39['query']=_[_0xa55c('0x2f')](_0x3755a7[_0xa55c('0x2a')]);_0x307b39[_0xa55c('0x31')]=_['intersection'](_0x307b39['model'],_0x307b39[_0xa55c('0x2a')]);_0x50b42f['attributes']=_['intersection'](_0x307b39[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x50b42f[_0xa55c('0x33')]=_0x50b42f[_0xa55c('0x33')][_0xa55c('0x35')]?_0x50b42f[_0xa55c('0x33')]:_0x307b39[_0xa55c('0x2e')];_0x50b42f[_0xa55c('0x4e')]=qs['sort'](_0x3755a7['query'][_0xa55c('0x4f')]);_0x50b42f[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x3755a7['query'],_0x307b39[_0xa55c('0x31')]));if(_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x50b42f[_0xa55c('0x50')]=_['merge'](_0x50b42f[_0xa55c('0x50')],{'$or':_['map'](_0x50b42f['attributes'],function(_0x545806){var _0x4fbb59={};_0x4fbb59[_0x545806]={'$like':'%'+_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x4fbb59;})});}_0x50b42f=_['merge']({},_0x50b42f,_0x3755a7[_0xa55c('0x37')]);return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x3899bd){if(_0x3899bd){_0x536e1d=_0x3899bd[_0xa55c('0x35')];if(!_0x3755a7[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x50b42f[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x3755a7[_0xa55c('0x2a')]['limit']);_0x50b42f['offset']=qs['offset'](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x1205cb){if(_0x1205cb){return _0x1205cb?{'count':_0x536e1d,'rows':_0x1205cb}:null;}})[_0xa55c('0x14')](respondWithResult(_0x50663f,null))[_0xa55c('0x2c')](handleError(_0x50663f,null));};exports[_0xa55c('0x8a')]=function(_0x499008,_0x4ef239){var _0x3e3208=moment()[_0xa55c('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e19d6,_0x286b33;return db['VoiceQueue']['find']({'where':{'id':_0x499008[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x4ef239,null))[_0xa55c('0x14')](function(_0x236015){if(_0x236015){_0x286b33=_0x236015;return _0x236015['addLists'](_0x499008['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0x499008[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x18e4fd){var _0x185c5b;_0x1e19d6=_0x18e4fd||[];var _0x2511fe=[];if(_0x18e4fd){for(var _0x3ba948=0x0;_0x3ba948<_0x18e4fd[_0xa55c('0x35')];_0x3ba948+=0x1){var _0x5e83e9=_0x18e4fd[_0x3ba948][_0xa55c('0x16')]({'plain':!![]});_0x286b33['dialCheckDuplicateType']=_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]?_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]:_0x286b33[_0xa55c('0x8b')];switch(_0x286b33[_0xa55c('0x8b')]){case _0xa55c('0x8c'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('phone',_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','scheduledAt')[_0xa55c('0x94')]('id',_0xa55c('0x95'))['field'](_0x5e83e9[_0xa55c('0x96')]['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')]['toString']())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()['field'](_0xa55c('0x9c'))[_0xa55c('0x97')](_0xa55c('0x9d'))[_0xa55c('0x50')]('VoiceQueueId\x20=\x20?',_0x499008['params']['id'][_0xa55c('0x78')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008['params']['id'][_0xa55c('0x78')]())))[_0xa55c('0x78')]();break;case _0xa55c('0x9e'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))['field']('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))['field']('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))['where'](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x9f'))[_0xa55c('0x97')](_0xa55c('0x8f'))[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008[_0xa55c('0x2d')]['id']['toString']())))[_0xa55c('0x78')]();break;default:_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),'VoiceQueueId',_0xa55c('0x45'),'updatedAt'],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))['field'](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL'))[_0xa55c('0x78')]();}_0x2511fe[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x185c5b));}return BPromise[_0xa55c('0x7c')](_0x2511fe);}})[_0xa55c('0x14')](function(){var _0x4457e9=[];var _0x456cb9=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xa1'))[_0xa55c('0x90')]([_0xa55c('0xa2'),_0xa55c('0x91'),'OrderBy',_0xa55c('0x45'),_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0xa3'))['field']('ci.item')['field']('ci.OrderBy+1')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0xa4'),'ci')[_0xa55c('0x74')](_0xa55c('0x8f'),'h',_0xa55c('0xa5'))[_0xa55c('0x50')](_0xa55c('0xa6'),_0x3e3208)[_0xa55c('0x50')](_0xa55c('0xa7'),'PHONE'))[_0xa55c('0x78')]();_0x4457e9[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x456cb9));return BPromise['all'](_0x4457e9);})['then'](function(){return _0x1e19d6;})[_0xa55c('0x14')](respondWithResult(_0x4ef239,null))[_0xa55c('0x2c')](handleError(_0x4ef239,null));};exports[_0xa55c('0xa8')]=function(_0x27cd1b,_0x3ed3a5){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x27cd1b[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x3ed3a5,null))[_0xa55c('0x14')](function(_0x3def57){if(_0x3def57){return _0x3def57[_0xa55c('0xa8')](_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x4f5f1a){if(_0x4f5f1a){return db[_0xa55c('0x4a')]['destroy']({'where':{'ListId':_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x27cd1b[_0xa55c('0x2d')]['id']}})['then'](function(){return _0x4f5f1a;});}})['then'](respondWithStatusCode(_0x3ed3a5,null))[_0xa55c('0x2c')](handleError(_0x3ed3a5,null));};exports[_0xa55c('0xa9')]=function(_0x30af02,_0x5ebd8a){var _0x2420da={};var _0x2a4b78={};var _0x1e4c2d;var _0x2bf777;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x30af02[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5ebd8a,null))[_0xa55c('0x14')](function(_0x266b12){if(_0x266b12){_0x1e4c2d=_0x266b12;_0x2a4b78[_0xa55c('0x2e')]=_['keys'](db[_0xa55c('0x89')]['rawAttributes']);_0x2a4b78[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x30af02['query']);_0x2a4b78[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2a4b78[_0xa55c('0x2e')],_0x2a4b78['query']);_0x2420da[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x2a4b78['model'],qs['fields'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2420da[_0xa55c('0x33')]=_0x2420da[_0xa55c('0x33')][_0xa55c('0x35')]?_0x2420da['attributes']:_0x2a4b78[_0xa55c('0x2e')];_0x2420da['order']=qs['sort'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x2420da['where']=qs[_0xa55c('0x31')](_['pick'](_0x30af02[_0xa55c('0x2a')],_0x2a4b78[_0xa55c('0x31')]));if(_0x30af02['query'][_0xa55c('0x1a')]){_0x2420da[_0xa55c('0x50')]=_['merge'](_0x2420da[_0xa55c('0x50')],{'$or':_['map'](_0x2420da['attributes'],function(_0x37273b){var _0x1cd529={};_0x1cd529[_0x37273b]={'$like':'%'+_0x30af02[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x1cd529;})});}_0x2420da=_[_0xa55c('0x43')]({},_0x2420da,_0x30af02[_0xa55c('0x37')]);return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})['then'](function(_0x27e791){if(_0x27e791){_0x2bf777=_0x27e791[_0xa55c('0x35')];if(!_0x30af02['query'][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x2420da['limit']=qs[_0xa55c('0x4d')](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x2420da[_0xa55c('0x10')]=qs['offset'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})[_0xa55c('0x14')](function(_0x365331){if(_0x365331){return _0x365331?{'count':_0x2bf777,'rows':_0x365331}:null;}})[_0xa55c('0x14')](respondWithResult(_0x5ebd8a,null))['catch'](handleError(_0x5ebd8a,null));};exports[_0xa55c('0xaa')]=function(_0x4d7cd6,_0x1ca9bd){var _0x2bf932;return db['VoiceQueue']['find']({'where':{'id':_0x4d7cd6[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x1ca9bd,null))[_0xa55c('0x14')](function(_0x3c9d2b){if(_0x3c9d2b){return _0x3c9d2b[_0xa55c('0xaa')](_0x4d7cd6[_0xa55c('0x3a')][_0xa55c('0x82')],_['omit'](_0x4d7cd6[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x158b01){var _0x19f576;_0x2bf932=_0x158b01||[];var _0x10da4b=[];if(_0x158b01){for(var _0x3320ab=0x0;_0x3320ab<_0x158b01[_0xa55c('0x35')];_0x3320ab+=0x1){var _0x298cf5=_0x158b01[_0x3320ab][_0xa55c('0x16')]({'plain':!![]});_0x19f576=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xab'))['fromQuery']([_0xa55c('0x91'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))['field']('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x298cf5[_0xa55c('0x96')]['toString'](),'ListId')['field'](_0x4d7cd6[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),'VoiceQueueId')[_0xa55c('0x94')](_0xa55c('0xac'),_0xa55c('0x45'))[_0xa55c('0x94')](_0xa55c('0xac'),'updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')]('ListId\x20=\x20?',_0x298cf5['CmListId'][_0xa55c('0x78')]())[_0xa55c('0x50')](_0xa55c('0xad')))['toString']();_0x10da4b[_0xa55c('0xa0')](db[_0xa55c('0x64')][_0xa55c('0x2a')](_0x19f576));}return BPromise[_0xa55c('0x7c')](_0x10da4b);}})[_0xa55c('0x14')](function(){return _0x2bf932;})[_0xa55c('0x14')](respondWithResult(_0x1ca9bd,null))[_0xa55c('0x2c')](handleError(_0x1ca9bd,null));};exports[_0xa55c('0xae')]=function(_0x23862a,_0xb432d1){return db['VoiceQueue'][_0xa55c('0x38')]({'where':{'id':_0x23862a[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb432d1,null))[_0xa55c('0x14')](function(_0x5bc270){if(_0x5bc270){return _0x5bc270[_0xa55c('0xae')](_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x543b4a){if(_0x543b4a){return db[_0xa55c('0x59')]['destroy']({'where':{'ListId':_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x23862a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(){return _0x543b4a;});}})[_0xa55c('0x14')](respondWithStatusCode(_0xb432d1,null))['catch'](handleError(_0xb432d1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b69a287..314dd73 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 _0x9e2b=['events','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x558b06,_0x571689){var _0x40154f=function(_0x5baa6d){while(--_0x5baa6d){_0x558b06['push'](_0x558b06['shift']());}};_0x40154f(++_0x571689);}(_0x9e2b,0x1e0));var _0xb9e2=function(_0x2e17b9,_0x321269){_0x2e17b9=_0x2e17b9-0x0;var _0x21efb9=_0x9e2b[_0x2e17b9];return _0x21efb9;};'use strict';var EventEmitter=require(_0xb9e2('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb9e2('0x1')](0x0);var events={'afterCreate':_0xb9e2('0x2'),'afterUpdate':'update','afterDestroy':_0xb9e2('0x3')};function emitEvent(_0x2e610c){return function(_0x5a59a2,_0x1cc720,_0x381396){VoiceQueueEvents['emit'](_0x2e610c+':'+_0x5a59a2['id'],_0x5a59a2);VoiceQueueEvents[_0xb9e2('0x4')](_0x2e610c,_0x5a59a2);_0x381396(null);};}for(var e in events){if(events[_0xb9e2('0x5')](e)){var event=events[e];VoiceQueue[_0xb9e2('0x6')](e,emitEvent(event));}}module[_0xb9e2('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x11d8=['VoiceQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2416b2,_0x134439){var _0x159c30=function(_0x2e335c){while(--_0x2e335c){_0x2416b2['push'](_0x2416b2['shift']());}};_0x159c30(++_0x134439);}(_0x11d8,0xce));var _0x811d=function(_0x7d095,_0x1b5d9a){_0x7d095=_0x7d095-0x0;var _0x44baa8=_0x11d8[_0x7d095];return _0x44baa8;};'use strict';var EventEmitter=require(_0x811d('0x0'));var VoiceQueue=require(_0x811d('0x1'))['db'][_0x811d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x811d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x811d('0x4')};function emitEvent(_0x191273){return function(_0x5a2fa7,_0x5d4289,_0x1287cb){VoiceQueueEvents[_0x811d('0x5')](_0x191273+':'+_0x5a2fa7['id'],_0x5a2fa7);VoiceQueueEvents[_0x811d('0x5')](_0x191273,_0x5a2fa7);_0x1287cb(null);};}for(var e in events){if(events[_0x811d('0x6')](e)){var event=events[e];VoiceQueue[_0x811d('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 3bf716d..3e1b905 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(_0x5965b4,_0x2f79e9){var _0x5307eb=function(_0x2b41b2){while(--_0x2b41b2){_0x5965b4['push'](_0x5965b4['shift']());}};_0x5307eb(++_0x2f79e9);}(_0x34e8,0x12c));var _0x834e=function(_0x5075fd,_0x2ce5e4){_0x5075fd=_0x5075fd-0x0;var _0x140c1c=_0x34e8[_0x5075fd];return _0x140c1c;};'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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x40b91e,_0x3d0dc9){var _0x5b61e8=function(_0x3d3b8f){while(--_0x3d3b8f){_0x40b91e['push'](_0x40b91e['shift']());}};_0x5b61e8(++_0x3d0dc9);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 83e8f3c..5a581f8 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 _0x9fdc=['VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9fdc,0xe4));var _0xc9fd=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x9fdc[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require('lodash');var util=require(_0xc9fd('0x0'));var moment=require(_0xc9fd('0x1'));var BPromise=require(_0xc9fd('0x2'));var rs=require(_0xc9fd('0x3'));var fs=require('fs');var Redis=require(_0xc9fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9fd('0x5'));var logger=require(_0xc9fd('0x6'))(_0xc9fd('0x7'));var config=require(_0xc9fd('0x8'));var jayson=require(_0xc9fd('0x9'));var client=jayson[_0xc9fd('0xa')][_0xc9fd('0xb')]({'port':0x232a});config[_0xc9fd('0xc')]=_[_0xc9fd('0xd')](config[_0xc9fd('0xc')],{'host':_0xc9fd('0xe'),'port':0x18eb});var socket=require(_0xc9fd('0xf'))(new Redis(config[_0xc9fd('0xc')]));require(_0xc9fd('0x10'))[_0xc9fd('0x11')](socket);function respondWithRpcPromise(_0x38bf59,_0x8707e6,_0x77030b){return new BPromise(function(_0x4f6d97,_0x2da27e){return client[_0xc9fd('0x12')](_0x38bf59,_0x77030b)[_0xc9fd('0x13')](function(_0x354a4a){logger[_0xc9fd('0x14')](_0xc9fd('0x15'),_0x8707e6,_0xc9fd('0x16'));logger[_0xc9fd('0x17')](_0xc9fd('0x18'),_0x8707e6,'request\x20sent',JSON[_0xc9fd('0x19')](_0x354a4a));if(_0x354a4a['error']){if(_0x354a4a[_0xc9fd('0x1a')]['code']===0x1f4){logger['error'](_0xc9fd('0x15'),_0x8707e6,_0x354a4a[_0xc9fd('0x1a')][_0xc9fd('0x1b')]);return _0x2da27e(_0x354a4a[_0xc9fd('0x1a')][_0xc9fd('0x1b')]);}logger[_0xc9fd('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x8707e6,_0x354a4a[_0xc9fd('0x1a')][_0xc9fd('0x1b')]);return _0x4f6d97(_0x354a4a['error']['message']);}else{logger[_0xc9fd('0x14')](_0xc9fd('0x15'),_0x8707e6,_0xc9fd('0x16'));_0x4f6d97(_0x354a4a['result'][_0xc9fd('0x1b')]);}})[_0xc9fd('0x1c')](function(_0x4c8998){logger[_0xc9fd('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x8707e6,_0x4c8998);_0x2da27e(_0x4c8998);});});}exports[_0xc9fd('0x1d')]=function(_0x514112){var _0x2c92af=this;return new Promise(function(_0x7ba553,_0x3a6786){return db[_0xc9fd('0x1e')][_0xc9fd('0x1f')]({'raw':_0x514112['options']?_0x514112[_0xc9fd('0x20')][_0xc9fd('0x21')]===undefined?!![]:![]:!![],'where':_0x514112['options']?_0x514112[_0xc9fd('0x20')][_0xc9fd('0x22')]||null:null,'attributes':_0x514112['options']?_0x514112['options'][_0xc9fd('0x23')]||null:null,'limit':_0x514112['options']?_0x514112[_0xc9fd('0x20')][_0xc9fd('0x24')]||null:null,'include':_0x514112[_0xc9fd('0x20')]?_0x514112[_0xc9fd('0x20')][_0xc9fd('0x25')]?_[_0xc9fd('0x26')](_0x514112[_0xc9fd('0x20')]['include'],function(_0x3914ba){return{'model':db[_0x3914ba[_0xc9fd('0x27')]],'as':_0x3914ba['as'],'attributes':_0x3914ba[_0xc9fd('0x23')],'include':_0x3914ba['include']?_[_0xc9fd('0x26')](_0x3914ba[_0xc9fd('0x25')],function(_0x165177){return{'model':db[_0x165177[_0xc9fd('0x27')]],'as':_0x165177['as'],'attributes':_0x165177[_0xc9fd('0x23')],'include':_0x165177['include']?_[_0xc9fd('0x26')](_0x165177[_0xc9fd('0x25')],function(_0x3d851a){return{'model':db[_0x3d851a[_0xc9fd('0x27')]],'as':_0x3d851a['as'],'attributes':_0x3d851a[_0xc9fd('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc9fd('0x13')](function(_0x16e5d1){logger[_0xc9fd('0x14')](_0xc9fd('0x1d'),_0x514112);logger[_0xc9fd('0x17')](_0xc9fd('0x1d'),_0x514112,JSON[_0xc9fd('0x19')](_0x16e5d1));_0x7ba553(_0x16e5d1);})['catch'](function(_0x2278cb){logger[_0xc9fd('0x1a')]('GetVoiceQueue',_0x2278cb[_0xc9fd('0x1b')],_0x514112);_0x3a6786(_0x2c92af['error'](0x1f4,_0x2278cb['message']));});});};exports[_0xc9fd('0x28')]=function(_0x32ff20){var _0x567131=this;return new Promise(function(_0xb7dd1c,_0x327421){return db[_0xc9fd('0x1e')][_0xc9fd('0x29')]({'raw':_0x32ff20['options']?_0x32ff20[_0xc9fd('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x32ff20[_0xc9fd('0x20')]?_0x32ff20[_0xc9fd('0x20')][_0xc9fd('0x22')]||null:null,'attributes':_0x32ff20[_0xc9fd('0x20')]?_0x32ff20[_0xc9fd('0x20')][_0xc9fd('0x23')]||null:null,'include':_0x32ff20[_0xc9fd('0x20')]?_0x32ff20[_0xc9fd('0x20')][_0xc9fd('0x25')]?_['map'](_0x32ff20['options'][_0xc9fd('0x25')],function(_0x1116a2){return{'model':db[_0x1116a2[_0xc9fd('0x27')]],'as':_0x1116a2['as'],'attributes':_0x1116a2['attributes'],'include':_0x1116a2[_0xc9fd('0x25')]?_[_0xc9fd('0x26')](_0x1116a2['include'],function(_0x1b6c3b){return{'model':db[_0x1b6c3b[_0xc9fd('0x27')]],'as':_0x1b6c3b['as'],'attributes':_0x1b6c3b[_0xc9fd('0x23')],'include':_0x1b6c3b[_0xc9fd('0x25')]?_[_0xc9fd('0x26')](_0x1b6c3b[_0xc9fd('0x25')],function(_0x4b7ece){return{'model':db[_0x4b7ece[_0xc9fd('0x27')]],'as':_0x4b7ece['as'],'attributes':_0x4b7ece['attributes']};}):[]};}):[]};}):[]:[]})[_0xc9fd('0x13')](function(_0x36e953){logger[_0xc9fd('0x14')]('ShowVoiceQueue',_0x32ff20);logger['debug'](_0xc9fd('0x28'),_0x32ff20,JSON['stringify'](_0x36e953));_0xb7dd1c(_0x36e953);})[_0xc9fd('0x1c')](function(_0x522943){logger[_0xc9fd('0x1a')](_0xc9fd('0x28'),_0x522943[_0xc9fd('0x1b')],_0x32ff20);_0x327421(_0x567131['error'](0x1f4,_0x522943[_0xc9fd('0x1b')]));});});}; \ No newline at end of file +var _0x7514=['attributes','include','map','model','then','debug','catch','ShowVoiceQueue','find','raw','where','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueue','VoiceQueue','findAll','options'];(function(_0x27889f,_0x4809b9){var _0x201713=function(_0x5e5c1e){while(--_0x5e5c1e){_0x27889f['push'](_0x27889f['shift']());}};_0x201713(++_0x4809b9);}(_0x7514,0xab));var _0x4751=function(_0x4b3600,_0x3c4086){_0x4b3600=_0x4b3600-0x0;var _0x445d99=_0x7514[_0x4b3600];return _0x445d99;};'use strict';var _=require(_0x4751('0x0'));var util=require(_0x4751('0x1'));var moment=require(_0x4751('0x2'));var BPromise=require(_0x4751('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4751('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4751('0x5'))(_0x4751('0x6'));var config=require(_0x4751('0x7'));var jayson=require(_0x4751('0x8'));var client=jayson[_0x4751('0x9')]['http']({'port':0x232a});config['redis']=_[_0x4751('0xa')](config[_0x4751('0xb')],{'host':_0x4751('0xc'),'port':0x18eb});var socket=require(_0x4751('0xd'))(new Redis(config[_0x4751('0xb')]));require(_0x4751('0xe'))['register'](socket);function respondWithRpcPromise(_0x9275e7,_0x309771,_0x166585){return new BPromise(function(_0x8a34ae,_0x18c18a){return client[_0x4751('0xf')](_0x9275e7,_0x166585)['then'](function(_0x2007f9){logger['info'](_0x4751('0x10'),_0x309771,_0x4751('0x11'));logger['debug'](_0x4751('0x12'),_0x309771,_0x4751('0x11'),JSON[_0x4751('0x13')](_0x2007f9));if(_0x2007f9[_0x4751('0x14')]){if(_0x2007f9[_0x4751('0x14')][_0x4751('0x15')]===0x1f4){logger[_0x4751('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x309771,_0x2007f9[_0x4751('0x14')][_0x4751('0x16')]);return _0x18c18a(_0x2007f9[_0x4751('0x14')][_0x4751('0x16')]);}logger['error'](_0x4751('0x10'),_0x309771,_0x2007f9[_0x4751('0x14')][_0x4751('0x16')]);return _0x8a34ae(_0x2007f9[_0x4751('0x14')][_0x4751('0x16')]);}else{logger[_0x4751('0x17')](_0x4751('0x10'),_0x309771,'request\x20sent');_0x8a34ae(_0x2007f9[_0x4751('0x18')][_0x4751('0x16')]);}})['catch'](function(_0x5f3e40){logger[_0x4751('0x14')](_0x4751('0x10'),_0x309771,_0x5f3e40);_0x18c18a(_0x5f3e40);});});}exports[_0x4751('0x19')]=function(_0x475955){var _0x162a19=this;return new Promise(function(_0x3d7ba9,_0x194851){return db[_0x4751('0x1a')][_0x4751('0x1b')]({'raw':_0x475955[_0x4751('0x1c')]?_0x475955[_0x4751('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x475955[_0x4751('0x1c')]?_0x475955[_0x4751('0x1c')]['where']||null:null,'attributes':_0x475955[_0x4751('0x1c')]?_0x475955[_0x4751('0x1c')][_0x4751('0x1d')]||null:null,'limit':_0x475955[_0x4751('0x1c')]?_0x475955[_0x4751('0x1c')]['limit']||null:null,'include':_0x475955[_0x4751('0x1c')]?_0x475955['options'][_0x4751('0x1e')]?_[_0x4751('0x1f')](_0x475955[_0x4751('0x1c')][_0x4751('0x1e')],function(_0x511016){return{'model':db[_0x511016[_0x4751('0x20')]],'as':_0x511016['as'],'attributes':_0x511016[_0x4751('0x1d')],'include':_0x511016[_0x4751('0x1e')]?_['map'](_0x511016[_0x4751('0x1e')],function(_0x5adeef){return{'model':db[_0x5adeef[_0x4751('0x20')]],'as':_0x5adeef['as'],'attributes':_0x5adeef[_0x4751('0x1d')],'include':_0x5adeef[_0x4751('0x1e')]?_['map'](_0x5adeef[_0x4751('0x1e')],function(_0xc12129){return{'model':db[_0xc12129['model']],'as':_0xc12129['as'],'attributes':_0xc12129[_0x4751('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4751('0x21')](function(_0x25bfe7){logger[_0x4751('0x17')]('GetVoiceQueue',_0x475955);logger[_0x4751('0x22')](_0x4751('0x19'),_0x475955,JSON[_0x4751('0x13')](_0x25bfe7));_0x3d7ba9(_0x25bfe7);})[_0x4751('0x23')](function(_0x2c943b){logger[_0x4751('0x14')](_0x4751('0x19'),_0x2c943b[_0x4751('0x16')],_0x475955);_0x194851(_0x162a19['error'](0x1f4,_0x2c943b[_0x4751('0x16')]));});});};exports[_0x4751('0x24')]=function(_0x52f0b7){var _0x991177=this;return new Promise(function(_0x3a7c03,_0x6c4b80){return db[_0x4751('0x1a')][_0x4751('0x25')]({'raw':_0x52f0b7[_0x4751('0x1c')]?_0x52f0b7['options'][_0x4751('0x26')]===undefined?!![]:![]:!![],'where':_0x52f0b7['options']?_0x52f0b7[_0x4751('0x1c')][_0x4751('0x27')]||null:null,'attributes':_0x52f0b7[_0x4751('0x1c')]?_0x52f0b7[_0x4751('0x1c')][_0x4751('0x1d')]||null:null,'include':_0x52f0b7[_0x4751('0x1c')]?_0x52f0b7[_0x4751('0x1c')][_0x4751('0x1e')]?_['map'](_0x52f0b7[_0x4751('0x1c')][_0x4751('0x1e')],function(_0x584ebf){return{'model':db[_0x584ebf[_0x4751('0x20')]],'as':_0x584ebf['as'],'attributes':_0x584ebf[_0x4751('0x1d')],'include':_0x584ebf[_0x4751('0x1e')]?_[_0x4751('0x1f')](_0x584ebf[_0x4751('0x1e')],function(_0x5db10e){return{'model':db[_0x5db10e[_0x4751('0x20')]],'as':_0x5db10e['as'],'attributes':_0x5db10e[_0x4751('0x1d')],'include':_0x5db10e[_0x4751('0x1e')]?_[_0x4751('0x1f')](_0x5db10e[_0x4751('0x1e')],function(_0x2e0383){return{'model':db[_0x2e0383[_0x4751('0x20')]],'as':_0x2e0383['as'],'attributes':_0x2e0383['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11ed70){logger['info'](_0x4751('0x24'),_0x52f0b7);logger[_0x4751('0x22')](_0x4751('0x24'),_0x52f0b7,JSON[_0x4751('0x13')](_0x11ed70));_0x3a7c03(_0x11ed70);})['catch'](function(_0x59d674){logger['error']('ShowVoiceQueue',_0x59d674['message'],_0x52f0b7);_0x6c4b80(_0x991177['error'](0x1f4,_0x59d674['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 8eedad1..a67e72e 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 _0xd14b=['remove','emit','removeListener','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x228326,_0x499048){var _0x371124=function(_0x5536cd){while(--_0x5536cd){_0x228326['push'](_0x228326['shift']());}};_0x371124(++_0x499048);}(_0xd14b,0x18d));var _0xbd14=function(_0x2b3c36,_0x2692e1){_0x2b3c36=_0x2b3c36-0x0;var _0x1c1840=_0xd14b[_0x2b3c36];return _0x1c1840;};'use strict';var VoiceQueueEvents=require(_0xbd14('0x0'));var events=[_0xbd14('0x1'),_0xbd14('0x2'),'update'];function createListener(_0x313387,_0x3dc953){return function(_0x21a5af){_0x3dc953[_0xbd14('0x3')](_0x313387,_0x21a5af);};}function removeListener(_0x641423,_0x27a322){return function(){VoiceQueueEvents[_0xbd14('0x4')](_0x641423,_0x27a322);};}exports['register']=function(_0xebcdc7){for(var _0x16082f=0x0,_0xfa23af=events[_0xbd14('0x5')];_0x16082f<_0xfa23af;_0x16082f++){var _0x4cd44b=events[_0x16082f];var _0x4c990e=createListener(_0xbd14('0x6')+_0x4cd44b,_0xebcdc7);VoiceQueueEvents['on'](_0x4cd44b,_0x4c990e);}}; \ No newline at end of file +var _0xd36c=['length','voiceQueue:','remove','update','emit','register'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0xd36c,0x13a));var _0xcd36=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xd36c[_0x373dee];return _0x46798f;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0xcd36('0x0'),_0xcd36('0x1')];function createListener(_0x3b41d4,_0x49859d){return function(_0x2ff0c4){_0x49859d[_0xcd36('0x2')](_0x3b41d4,_0x2ff0c4);};}function removeListener(_0x7c4160,_0x3b140f){return function(){VoiceQueueEvents['removeListener'](_0x7c4160,_0x3b140f);};}exports[_0xcd36('0x3')]=function(_0x6bdbd5){for(var _0x136868=0x0,_0x110c46=events[_0xcd36('0x4')];_0x136868<_0x110c46;_0x136868++){var _0xbe5c9e=events[_0x136868];var _0x48b438=createListener(_0xcd36('0x5')+_0xbe5c9e,_0x6bdbd5);VoiceQueueEvents['on'](_0xbe5c9e,_0x48b438);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index cf83b3c..0459d36 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 _0x62c9=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','/:id','show','post','put','update','delete'];(function(_0x274501,_0x3f54f3){var _0x24a13f=function(_0x21a689){while(--_0x21a689){_0x274501['push'](_0x274501['shift']());}};_0x24a13f(++_0x3f54f3);}(_0x62c9,0x92));var _0x962c=function(_0x34e5bb,_0x12dadd){_0x34e5bb=_0x34e5bb-0x0;var _0x367d5b=_0x62c9[_0x34e5bb];return _0x367d5b;};'use strict';var multer=require(_0x962c('0x0'));var util=require(_0x962c('0x1'));var path=require(_0x962c('0x2'));var timeout=require(_0x962c('0x3'));var express=require(_0x962c('0x4'));var router=express[_0x962c('0x5')]();var fs_extra=require(_0x962c('0x6'));var auth=require(_0x962c('0x7'));var interaction=require(_0x962c('0x8'));var config=require(_0x962c('0x9'));var controller=require(_0x962c('0xa'));router[_0x962c('0xb')]('/',auth[_0x962c('0xc')](),controller['index']);router['get'](_0x962c('0xd'),auth[_0x962c('0xc')](),controller[_0x962c('0xe')]);router[_0x962c('0xb')](_0x962c('0xf'),auth[_0x962c('0xc')](),controller['getVoiceQueuesReport']);router['get'](_0x962c('0x10'),auth[_0x962c('0xc')](),controller[_0x962c('0x11')]);router[_0x962c('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x962c('0x13')](_0x962c('0x10'),auth[_0x962c('0xc')](),controller[_0x962c('0x14')]);router[_0x962c('0x15')](_0x962c('0x10'),auth[_0x962c('0xc')](),controller[_0x962c('0x16')]);module[_0x962c('0x17')]=router; \ No newline at end of file +var _0x211e=['isAuthenticated','index','describe','get','/index','getVoiceQueuesReport','/:id','show','create','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller'];(function(_0x417440,_0x1c145f){var _0x589481=function(_0x4504a7){while(--_0x4504a7){_0x417440['push'](_0x417440['shift']());}};_0x589481(++_0x1c145f);}(_0x211e,0x1e6));var _0xe211=function(_0x5aa77b,_0x62a0a1){_0x5aa77b=_0x5aa77b-0x0;var _0x1ffd28=_0x211e[_0x5aa77b];return _0x1ffd28;};'use strict';var multer=require(_0xe211('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe211('0x1'));var express=require(_0xe211('0x2'));var router=express[_0xe211('0x3')]();var fs_extra=require(_0xe211('0x4'));var auth=require(_0xe211('0x5'));var interaction=require(_0xe211('0x6'));var config=require('../../config/environment');var controller=require(_0xe211('0x7'));router['get']('/',auth[_0xe211('0x8')](),controller[_0xe211('0x9')]);router['get']('/describe',auth[_0xe211('0x8')](),controller[_0xe211('0xa')]);router[_0xe211('0xb')](_0xe211('0xc'),auth[_0xe211('0x8')](),controller[_0xe211('0xd')]);router[_0xe211('0xb')](_0xe211('0xe'),auth[_0xe211('0x8')](),controller[_0xe211('0xf')]);router['post']('/',auth[_0xe211('0x8')](),controller[_0xe211('0x10')]);router['put'](_0xe211('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe211('0x11')]);module[_0xe211('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 5fe979f..d8a057a 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 _0xbb38=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xbb38,0x1d3));var _0x8bb3=function(_0x2382b5,_0x447dcf){_0x2382b5=_0x2382b5-0x0;var _0x4d5019=_0xbb38[_0x2382b5];return _0x4d5019;};'use strict';var Sequelize=require(_0x8bb3('0x0'));var moment=require(_0x8bb3('0x1'));module[_0x8bb3('0x2')]={'type':{'type':Sequelize[_0x8bb3('0x3')]},'uniqueid':{'type':Sequelize[_0x8bb3('0x3')]},'calleridnum':{'type':Sequelize[_0x8bb3('0x3')]},'calleridname':{'type':Sequelize[_0x8bb3('0x3')]},'queue':{'type':Sequelize[_0x8bb3('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x8bb3('0x4')],'set':function(_0x555ca4){var _0x402963=moment(_0x555ca4);var _0x4cc5d1=moment(this['getDataValue']('queuecallerjoinAt'))[_0x8bb3('0x5')](_0x8bb3('0x6'));var _0x3f16e3=_0x402963['diff'](_0x4cc5d1,'seconds');this[_0x8bb3('0x7')](_0x8bb3('0x8'),_0x555ca4);this[_0x8bb3('0x7')](_0x8bb3('0x9'),_0x3f16e3||null);}},'position':{'type':Sequelize[_0x8bb3('0xa')]},'count':{'type':Sequelize[_0x8bb3('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x8bb3('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8bb3('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x8bb3('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8bb3('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8bb3('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8bb3('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x8bb3('0x3')],'comment':_0x8bb3('0xc')},'originalposition':{'type':Sequelize[_0x8bb3('0xa')]},'channel':{'type':Sequelize[_0x8bb3('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8bb3('0x3')]},'connectedlinename':{'type':Sequelize[_0x8bb3('0x3')]},'accountcode':{'type':Sequelize[_0x8bb3('0x3')]},'context':{'type':Sequelize[_0x8bb3('0x3')]},'exten':{'type':Sequelize[_0x8bb3('0x3')]},'priority':{'type':Sequelize[_0x8bb3('0x3')]},'holdtime':{'type':Sequelize[_0x8bb3('0xa')]},'mohtime':{'type':Sequelize[_0x8bb3('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8bb3('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8bb3('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8bb3('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x8bb3('0x3')]},'transferuniqueid':{'type':Sequelize[_0x8bb3('0x3')]},'disposition':{'type':Sequelize[_0x8bb3('0x3')]},'secondDisposition':{'type':Sequelize[_0x8bb3('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8bb3('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x8bb3('0xa')],'defaultValue':0x0},'note':{'type':Sequelize[_0x8bb3('0x3')]}}; \ No newline at end of file +var _0x77ed=['sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN'];(function(_0x6e3749,_0xf71e2a){var _0x5059f8=function(_0x15222e){while(--_0x15222e){_0x6e3749['push'](_0x6e3749['shift']());}};_0x5059f8(++_0xf71e2a);}(_0x77ed,0x82));var _0xd77e=function(_0x13bff9,_0x2d8f43){_0x13bff9=_0x13bff9-0x0;var _0x479730=_0x77ed[_0x13bff9];return _0x479730;};'use strict';var Sequelize=require(_0xd77e('0x0'));var moment=require('moment');module[_0xd77e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd77e('0x2')]},'calleridnum':{'type':Sequelize[_0xd77e('0x2')]},'calleridname':{'type':Sequelize[_0xd77e('0x2')]},'queue':{'type':Sequelize[_0xd77e('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xd77e('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0xe23a06){var _0x30f24e=moment(_0xe23a06);var _0x14bfea=moment(this[_0xd77e('0x4')](_0xd77e('0x5')))[_0xd77e('0x6')](_0xd77e('0x7'));var _0x400a2d=_0x30f24e[_0xd77e('0x8')](_0x14bfea,'seconds');this[_0xd77e('0x9')](_0xd77e('0xa'),_0xe23a06);this[_0xd77e('0x9')]('holdtime',_0x400a2d||null);}},'position':{'type':Sequelize[_0xd77e('0xb')]},'count':{'type':Sequelize[_0xd77e('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xd77e('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xd77e('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xd77e('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xd77e('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xd77e('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xd77e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd77e('0x2')]},'connectedlinename':{'type':Sequelize[_0xd77e('0x2')]},'accountcode':{'type':Sequelize[_0xd77e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xd77e('0x2')]},'priority':{'type':Sequelize[_0xd77e('0x2')]},'holdtime':{'type':Sequelize[_0xd77e('0xb')]},'mohtime':{'type':Sequelize[_0xd77e('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd77e('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd77e('0x2')]},'transfer':{'type':Sequelize[_0xd77e('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd77e('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd77e('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd77e('0x2')]},'disposition':{'type':Sequelize[_0xd77e('0x2')]},'secondDisposition':{'type':Sequelize[_0xd77e('0x2')]},'thirdDisposition':{'type':Sequelize[_0xd77e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xd77e('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0xd77e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 2109635..4e5fceb 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 _0x8746=['fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','getVoiceQueuesReport','sort','pick','filter','findAll','rimraf','zip-dir'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8746,0x142));var _0x6874=function(_0x44f88c,_0x2d8439){_0x44f88c=_0x44f88c-0x0;var _0x43998a=_0x8746[_0x44f88c];return _0x43998a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6874('0x0'));var zipdir=require(_0x6874('0x1'));var jsonpatch=require(_0x6874('0x2'));var rp=require(_0x6874('0x3'));var moment=require('moment');var BPromise=require(_0x6874('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6874('0x5'));var sox=require(_0x6874('0x6'));var csv=require(_0x6874('0x7'));var ejs=require(_0x6874('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6874('0x9'));var crypto=require(_0x6874('0xa'));var jsforce=require(_0x6874('0xb'));var deskjs=require(_0x6874('0xc'));var toCsv=require(_0x6874('0x7'));var querystring=require(_0x6874('0xd'));var Papa=require(_0x6874('0xe'));var Redis=require(_0x6874('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6874('0x10'));var as=require(_0x6874('0x11'));var hardwareService=require(_0x6874('0x12'));var logger=require('../../config/logger')(_0x6874('0x13'));var utils=require(_0x6874('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6874('0x15'));var db=require('../../mysqldb')['db'];config[_0x6874('0x16')]=_[_0x6874('0x17')](config[_0x6874('0x16')],{'host':_0x6874('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6874('0x16')]));require('./voiceQueueReport.socket')[_0x6874('0x19')](socket);function respondWithStatusCode(_0x5dd786,_0x5e4636){_0x5e4636=_0x5e4636||0xcc;return function(_0x3ab888){if(_0x3ab888){return _0x5dd786[_0x6874('0x1a')](_0x5e4636);}return _0x5dd786[_0x6874('0x1b')](_0x5e4636)[_0x6874('0x1c')]();};}function respondWithResult(_0x254f3e,_0x5f0c52){_0x5f0c52=_0x5f0c52||0xc8;return function(_0x14f1ce){if(_0x14f1ce){return _0x254f3e[_0x6874('0x1b')](_0x5f0c52)[_0x6874('0x1d')](_0x14f1ce);}};}function respondWithFilteredResult(_0x2c0b13,_0x16b8d3){return function(_0x35d6a7){if(_0x35d6a7){var _0x675569=typeof _0x16b8d3[_0x6874('0x1e')]===_0x6874('0x1f')&&typeof _0x16b8d3[_0x6874('0x20')]===_0x6874('0x1f');var _0x1edffb=_0x35d6a7[_0x6874('0x21')];var _0x5cce6e=_0x675569?0x0:_0x16b8d3[_0x6874('0x1e')];var _0x4e8e0c=_0x675569?_0x35d6a7[_0x6874('0x21')]:_0x16b8d3[_0x6874('0x1e')]+_0x16b8d3[_0x6874('0x20')];var _0x3d5fca;if(_0x4e8e0c>=_0x1edffb){_0x4e8e0c=_0x1edffb;_0x3d5fca=0xc8;}else{_0x3d5fca=0xce;}_0x2c0b13[_0x6874('0x1b')](_0x3d5fca);return _0x2c0b13[_0x6874('0x22')](_0x6874('0x23'),_0x5cce6e+'-'+_0x4e8e0c+'/'+_0x1edffb)[_0x6874('0x1d')](_0x35d6a7);}return null;};}function patchUpdates(_0x360072){return function(_0x24fcf2){try{jsonpatch['apply'](_0x24fcf2,_0x360072,!![]);}catch(_0x39689c){return BPromise[_0x6874('0x24')](_0x39689c);}return _0x24fcf2[_0x6874('0x25')]();};}function saveUpdates(_0x4e3fd3,_0x36ea6e){return function(_0x488ee6){if(_0x488ee6){return _0x488ee6[_0x6874('0x26')](_0x4e3fd3)[_0x6874('0x27')](function(_0x5ebb6d){return _0x5ebb6d;});}return null;};}function removeEntity(_0x3c6d1d,_0x16dd7a){return function(_0xc98d00){if(_0xc98d00){return _0xc98d00[_0x6874('0x28')]()[_0x6874('0x27')](function(){_0x3c6d1d[_0x6874('0x1b')](0xcc)[_0x6874('0x1c')]();});}};}function handleEntityNotFound(_0x5e3104,_0x666ad3){return function(_0x2d1e93){if(!_0x2d1e93){_0x5e3104[_0x6874('0x1a')](0x194);}return _0x2d1e93;};}function handleError(_0x2736bd,_0xe226f6){_0xe226f6=_0xe226f6||0x1f4;return function(_0x19f8da){logger['error'](_0x19f8da[_0x6874('0x29')]);if(_0x19f8da[_0x6874('0x2a')]){delete _0x19f8da['name'];}_0x2736bd[_0x6874('0x1b')](_0xe226f6)[_0x6874('0x2b')](_0x19f8da);};}exports[_0x6874('0x2c')]=function(_0xf6cd14,_0x216fba){var _0xe47af3={},_0x170de2={},_0xf46351={'count':0x0,'rows':[]};var _0x353a33=_[_0x6874('0x2d')](db[_0x6874('0x2e')][_0x6874('0x2f')],function(_0x42be16){return{'name':_0x42be16[_0x6874('0x30')],'type':_0x42be16[_0x6874('0x31')][_0x6874('0x32')]};});_0x170de2[_0x6874('0x33')]=_[_0x6874('0x2d')](_0x353a33,_0x6874('0x2a'));_0x170de2[_0x6874('0x34')]=_[_0x6874('0x35')](_0xf6cd14[_0x6874('0x34')]);_0x170de2[_0x6874('0x36')]=_['intersection'](_0x170de2[_0x6874('0x33')],_0x170de2[_0x6874('0x34')]);_0xe47af3[_0x6874('0x37')]=_[_0x6874('0x38')](_0x170de2[_0x6874('0x33')],qs['fields'](_0xf6cd14['query'][_0x6874('0x39')]));_0xe47af3[_0x6874('0x37')]=_0xe47af3[_0x6874('0x37')][_0x6874('0x3a')]?_0xe47af3['attributes']:_0x170de2[_0x6874('0x33')];if(!_0xf6cd14['query'][_0x6874('0x3b')](_0x6874('0x3c'))){_0xe47af3[_0x6874('0x20')]=qs[_0x6874('0x20')](_0xf6cd14[_0x6874('0x34')][_0x6874('0x20')]);_0xe47af3[_0x6874('0x1e')]=qs[_0x6874('0x1e')](_0xf6cd14[_0x6874('0x34')]['offset']);}_0xe47af3[_0x6874('0x3d')]=qs['sort'](_0xf6cd14['query']['sort']);_0xe47af3[_0x6874('0x3e')]=qs[_0x6874('0x36')](_['pick'](_0xf6cd14[_0x6874('0x34')],_0x170de2[_0x6874('0x36')]),_0x353a33);if(_0xf6cd14['query']['filter']){_0xe47af3[_0x6874('0x3e')]=_['merge'](_0xe47af3[_0x6874('0x3e')],{'$or':_[_0x6874('0x2d')](_0x353a33,function(_0x53085a){if(_0x53085a[_0x6874('0x31')]!==_0x6874('0x3f')){var _0x372400={};_0x372400[_0x53085a[_0x6874('0x2a')]]={'$like':'%'+_0xf6cd14[_0x6874('0x34')]['filter']+'%'};return _0x372400;}})});}_0xe47af3=_[_0x6874('0x40')]({},_0xe47af3,_0xf6cd14['options']);var _0x28ab43={'where':_0xe47af3['where']};return db[_0x6874('0x2e')][_0x6874('0x21')](_0x28ab43)[_0x6874('0x27')](function(_0x8df0f0){_0xf46351[_0x6874('0x21')]=_0x8df0f0;if(_0xf6cd14[_0x6874('0x34')][_0x6874('0x41')]){_0xe47af3[_0x6874('0x42')]=[{'all':!![]}];}return db[_0x6874('0x2e')]['findAll'](_0xe47af3);})['then'](function(_0x4408ea){_0xf46351[_0x6874('0x43')]=_0x4408ea;return _0xf46351;})[_0x6874('0x27')](respondWithFilteredResult(_0x216fba,_0xe47af3))[_0x6874('0x44')](handleError(_0x216fba,null));};exports[_0x6874('0x45')]=function(_0x11e4a2,_0x41444f){var _0x4819d0={'raw':![],'where':{'id':_0x11e4a2[_0x6874('0x46')]['id']}},_0x3e0c6f={};_0x3e0c6f[_0x6874('0x33')]=_['keys'](db[_0x6874('0x2e')][_0x6874('0x2f')]);_0x3e0c6f[_0x6874('0x34')]=_[_0x6874('0x35')](_0x11e4a2[_0x6874('0x34')]);_0x3e0c6f['filters']=_[_0x6874('0x38')](_0x3e0c6f[_0x6874('0x33')],_0x3e0c6f[_0x6874('0x34')]);_0x4819d0[_0x6874('0x37')]=_[_0x6874('0x38')](_0x3e0c6f[_0x6874('0x33')],qs['fields'](_0x11e4a2[_0x6874('0x34')][_0x6874('0x39')]));_0x4819d0[_0x6874('0x37')]=_0x4819d0[_0x6874('0x37')][_0x6874('0x3a')]?_0x4819d0[_0x6874('0x37')]:_0x3e0c6f[_0x6874('0x33')];if(_0x11e4a2[_0x6874('0x34')]['includeAll']){_0x4819d0[_0x6874('0x42')]=[{'all':!![]}];}_0x4819d0=_['merge']({},_0x4819d0,_0x11e4a2[_0x6874('0x47')]);return db[_0x6874('0x2e')][_0x6874('0x48')](_0x4819d0)[_0x6874('0x27')](handleEntityNotFound(_0x41444f,null))[_0x6874('0x27')](respondWithResult(_0x41444f,null))['catch'](handleError(_0x41444f,null));};exports[_0x6874('0x49')]=function(_0x3d6f20,_0x1ca9b2){return db[_0x6874('0x2e')]['create'](_0x3d6f20[_0x6874('0x4a')],{})[_0x6874('0x27')](respondWithResult(_0x1ca9b2,0xc9))[_0x6874('0x44')](handleError(_0x1ca9b2,null));};exports[_0x6874('0x26')]=function(_0x3c861a,_0x19edb4){if(_0x3c861a[_0x6874('0x4a')]['id']){delete _0x3c861a[_0x6874('0x4a')]['id'];}return db['VoiceQueueReport'][_0x6874('0x48')]({'where':{'id':_0x3c861a['params']['id']}})[_0x6874('0x27')](handleEntityNotFound(_0x19edb4,null))['then'](saveUpdates(_0x3c861a[_0x6874('0x4a')],null))['then'](respondWithResult(_0x19edb4,null))[_0x6874('0x44')](handleError(_0x19edb4,null));};exports['destroy']=function(_0x568f4b,_0x4c08bd){return db[_0x6874('0x2e')][_0x6874('0x48')]({'where':{'id':_0x568f4b[_0x6874('0x46')]['id']}})[_0x6874('0x27')](handleEntityNotFound(_0x4c08bd,null))[_0x6874('0x27')](removeEntity(_0x4c08bd,null))[_0x6874('0x44')](handleError(_0x4c08bd,null));};exports[_0x6874('0x4b')]=function(_0x14ef6d,_0x28f5cc){return db['VoiceQueueReport'][_0x6874('0x4b')]()[_0x6874('0x27')](respondWithResult(_0x28f5cc,null))[_0x6874('0x44')](handleError(_0x28f5cc,null));};exports[_0x6874('0x4c')]=function(_0xaf8af,_0x3be0ab){var _0x242ae1={},_0x1d33eb={},_0x27e5b7={'count':0x0,'rows':[]};_0x1d33eb[_0x6874('0x33')]=_[_0x6874('0x35')](db[_0x6874('0x2e')][_0x6874('0x2f')]);_0x1d33eb[_0x6874('0x34')]=_[_0x6874('0x35')](_0xaf8af[_0x6874('0x34')]);_0x1d33eb[_0x6874('0x36')]=_['intersection'](_0x1d33eb[_0x6874('0x33')],_0x1d33eb[_0x6874('0x34')]);_0x242ae1[_0x6874('0x37')]=_[_0x6874('0x38')](_0x1d33eb['model'],qs[_0x6874('0x39')](_0xaf8af['query']['fields']));_0x242ae1[_0x6874('0x37')]=_0x242ae1[_0x6874('0x37')][_0x6874('0x3a')]?_0x242ae1[_0x6874('0x37')]:_0x1d33eb[_0x6874('0x33')];if(!_0xaf8af['query'][_0x6874('0x3b')]('nolimit')){_0x242ae1[_0x6874('0x20')]=qs[_0x6874('0x20')](_0xaf8af[_0x6874('0x34')][_0x6874('0x20')]);_0x242ae1[_0x6874('0x1e')]=qs[_0x6874('0x1e')](_0xaf8af[_0x6874('0x34')][_0x6874('0x1e')]);}_0x242ae1[_0x6874('0x3d')]=qs[_0x6874('0x4d')](_0xaf8af[_0x6874('0x34')][_0x6874('0x4d')]);_0x242ae1[_0x6874('0x3e')]=qs[_0x6874('0x36')](_[_0x6874('0x4e')](_0xaf8af[_0x6874('0x34')],_0x1d33eb[_0x6874('0x36')]));if(_0xaf8af[_0x6874('0x34')][_0x6874('0x4f')]){_0x242ae1['where']=_[_0x6874('0x40')](_0x242ae1[_0x6874('0x3e')],{'$or':_[_0x6874('0x2d')](_0x242ae1['attributes'],function(_0x2901ca){var _0x140767={};_0x140767[_0x2901ca]={'$like':'%'+_0xaf8af[_0x6874('0x34')][_0x6874('0x4f')]+'%'};return _0x140767;})});}_0x242ae1=_['merge']({},_0x242ae1,_0xaf8af[_0x6874('0x47')]);var _0x1f475b={'where':_0x242ae1[_0x6874('0x3e')]};return db[_0x6874('0x2e')]['count'](_0x1f475b)['then'](function(_0x50d0f7){_0x27e5b7[_0x6874('0x21')]=_0x50d0f7;if(_0xaf8af[_0x6874('0x34')][_0x6874('0x41')]){_0x242ae1[_0x6874('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x6874('0x50')](_0x242ae1);})['then'](function(_0x16e031){_0x27e5b7[_0x6874('0x43')]=_0x16e031;return _0x27e5b7;})[_0x6874('0x27')](respondWithFilteredResult(_0x3be0ab,_0x242ae1,_0x6874('0x4c')))[_0x6874('0x44')](handleError(_0x3be0ab,null,_0x6874('0x4c')));}; \ No newline at end of file +var _0xccc4=['rows','show','params','includeAll','find','catch','create','update','body','describe','fields','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xccc4,0x144));var _0x4ccc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xccc4[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ccc('0x0'));var zipdir=require(_0x4ccc('0x1'));var jsonpatch=require(_0x4ccc('0x2'));var rp=require(_0x4ccc('0x3'));var moment=require('moment');var BPromise=require(_0x4ccc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4ccc('0x5'));var sox=require(_0x4ccc('0x6'));var csv=require(_0x4ccc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ccc('0x8'));var _=require(_0x4ccc('0x9'));var squel=require(_0x4ccc('0xa'));var crypto=require(_0x4ccc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4ccc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4ccc('0xd'));var Papa=require('papaparse');var Redis=require(_0x4ccc('0xe'));var authService=require(_0x4ccc('0xf'));var qs=require(_0x4ccc('0x10'));var as=require(_0x4ccc('0x11'));var hardwareService=require(_0x4ccc('0x12'));var logger=require(_0x4ccc('0x13'))(_0x4ccc('0x14'));var utils=require(_0x4ccc('0x15'));var config=require(_0x4ccc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ccc('0x17'))['db'];config[_0x4ccc('0x18')]=_['defaults'](config['redis'],{'host':_0x4ccc('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ccc('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x21db63,_0x58cd9b){_0x58cd9b=_0x58cd9b||0xcc;return function(_0x5aec4c){if(_0x5aec4c){return _0x21db63[_0x4ccc('0x1a')](_0x58cd9b);}return _0x21db63[_0x4ccc('0x1b')](_0x58cd9b)[_0x4ccc('0x1c')]();};}function respondWithResult(_0x47fe8c,_0x4fc867){_0x4fc867=_0x4fc867||0xc8;return function(_0x1a92e0){if(_0x1a92e0){return _0x47fe8c[_0x4ccc('0x1b')](_0x4fc867)[_0x4ccc('0x1d')](_0x1a92e0);}};}function respondWithFilteredResult(_0xa2c2bd,_0x34ed07){return function(_0x5a1b33){if(_0x5a1b33){var _0x5296a4=typeof _0x34ed07['offset']==='undefined'&&typeof _0x34ed07[_0x4ccc('0x1e')]===_0x4ccc('0x1f');var _0x178220=_0x5a1b33[_0x4ccc('0x20')];var _0x2584bd=_0x5296a4?0x0:_0x34ed07[_0x4ccc('0x21')];var _0x34f36e=_0x5296a4?_0x5a1b33[_0x4ccc('0x20')]:_0x34ed07[_0x4ccc('0x21')]+_0x34ed07[_0x4ccc('0x1e')];var _0x770b8d;if(_0x34f36e>=_0x178220){_0x34f36e=_0x178220;_0x770b8d=0xc8;}else{_0x770b8d=0xce;}_0xa2c2bd[_0x4ccc('0x1b')](_0x770b8d);return _0xa2c2bd[_0x4ccc('0x22')](_0x4ccc('0x23'),_0x2584bd+'-'+_0x34f36e+'/'+_0x178220)[_0x4ccc('0x1d')](_0x5a1b33);}return null;};}function patchUpdates(_0x5d23b5){return function(_0x304426){try{jsonpatch['apply'](_0x304426,_0x5d23b5,!![]);}catch(_0x57657d){return BPromise[_0x4ccc('0x24')](_0x57657d);}return _0x304426[_0x4ccc('0x25')]();};}function saveUpdates(_0x1e82c8,_0x5e57dc){return function(_0x4f1c79){if(_0x4f1c79){return _0x4f1c79['update'](_0x1e82c8)[_0x4ccc('0x26')](function(_0x32f2dd){return _0x32f2dd;});}return null;};}function removeEntity(_0x48acb5,_0x580757){return function(_0x2ae201){if(_0x2ae201){return _0x2ae201[_0x4ccc('0x27')]()[_0x4ccc('0x26')](function(){_0x48acb5[_0x4ccc('0x1b')](0xcc)[_0x4ccc('0x1c')]();});}};}function handleEntityNotFound(_0x2088b7,_0x3ad67f){return function(_0x289c81){if(!_0x289c81){_0x2088b7[_0x4ccc('0x1a')](0x194);}return _0x289c81;};}function handleError(_0x41f458,_0x3dd210){_0x3dd210=_0x3dd210||0x1f4;return function(_0x3a05c2){logger['error'](_0x3a05c2[_0x4ccc('0x28')]);if(_0x3a05c2[_0x4ccc('0x29')]){delete _0x3a05c2[_0x4ccc('0x29')];}_0x41f458['status'](_0x3dd210)[_0x4ccc('0x2a')](_0x3a05c2);};}exports[_0x4ccc('0x2b')]=function(_0x444b98,_0xf04749){var _0x31e024={},_0x4d34af={},_0x3ff4a0={'count':0x0,'rows':[]};var _0x2460fe=_[_0x4ccc('0x2c')](db[_0x4ccc('0x2d')][_0x4ccc('0x2e')],function(_0x2a04e2){return{'name':_0x2a04e2['fieldName'],'type':_0x2a04e2[_0x4ccc('0x2f')]['key']};});_0x4d34af[_0x4ccc('0x30')]=_[_0x4ccc('0x2c')](_0x2460fe,_0x4ccc('0x29'));_0x4d34af[_0x4ccc('0x31')]=_[_0x4ccc('0x32')](_0x444b98[_0x4ccc('0x31')]);_0x4d34af[_0x4ccc('0x33')]=_['intersection'](_0x4d34af[_0x4ccc('0x30')],_0x4d34af[_0x4ccc('0x31')]);_0x31e024['attributes']=_[_0x4ccc('0x34')](_0x4d34af[_0x4ccc('0x30')],qs['fields'](_0x444b98[_0x4ccc('0x31')]['fields']));_0x31e024['attributes']=_0x31e024[_0x4ccc('0x35')][_0x4ccc('0x36')]?_0x31e024[_0x4ccc('0x35')]:_0x4d34af['model'];if(!_0x444b98[_0x4ccc('0x31')][_0x4ccc('0x37')](_0x4ccc('0x38'))){_0x31e024['limit']=qs['limit'](_0x444b98[_0x4ccc('0x31')][_0x4ccc('0x1e')]);_0x31e024['offset']=qs[_0x4ccc('0x21')](_0x444b98['query'][_0x4ccc('0x21')]);}_0x31e024[_0x4ccc('0x39')]=qs['sort'](_0x444b98['query'][_0x4ccc('0x3a')]);_0x31e024[_0x4ccc('0x3b')]=qs[_0x4ccc('0x33')](_[_0x4ccc('0x3c')](_0x444b98[_0x4ccc('0x31')],_0x4d34af[_0x4ccc('0x33')]),_0x2460fe);if(_0x444b98[_0x4ccc('0x31')][_0x4ccc('0x3d')]){_0x31e024[_0x4ccc('0x3b')]=_['merge'](_0x31e024[_0x4ccc('0x3b')],{'$or':_[_0x4ccc('0x2c')](_0x2460fe,function(_0x5c96ef){if(_0x5c96ef[_0x4ccc('0x2f')]!=='VIRTUAL'){var _0x326812={};_0x326812[_0x5c96ef['name']]={'$like':'%'+_0x444b98[_0x4ccc('0x31')]['filter']+'%'};return _0x326812;}})});}_0x31e024=_[_0x4ccc('0x3e')]({},_0x31e024,_0x444b98[_0x4ccc('0x3f')]);var _0x6ec698={'where':_0x31e024[_0x4ccc('0x3b')]};return db['VoiceQueueReport'][_0x4ccc('0x20')](_0x6ec698)[_0x4ccc('0x26')](function(_0x7cc773){_0x3ff4a0['count']=_0x7cc773;if(_0x444b98[_0x4ccc('0x31')]['includeAll']){_0x31e024[_0x4ccc('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x4ccc('0x41')](_0x31e024);})['then'](function(_0x541003){_0x3ff4a0[_0x4ccc('0x42')]=_0x541003;return _0x3ff4a0;})[_0x4ccc('0x26')](respondWithFilteredResult(_0xf04749,_0x31e024))['catch'](handleError(_0xf04749,null));};exports[_0x4ccc('0x43')]=function(_0x439522,_0x1a41e3){var _0x12118d={'raw':![],'where':{'id':_0x439522[_0x4ccc('0x44')]['id']}},_0x4736ea={};_0x4736ea[_0x4ccc('0x30')]=_[_0x4ccc('0x32')](db['VoiceQueueReport'][_0x4ccc('0x2e')]);_0x4736ea[_0x4ccc('0x31')]=_[_0x4ccc('0x32')](_0x439522[_0x4ccc('0x31')]);_0x4736ea[_0x4ccc('0x33')]=_[_0x4ccc('0x34')](_0x4736ea[_0x4ccc('0x30')],_0x4736ea['query']);_0x12118d['attributes']=_['intersection'](_0x4736ea[_0x4ccc('0x30')],qs['fields'](_0x439522['query']['fields']));_0x12118d[_0x4ccc('0x35')]=_0x12118d[_0x4ccc('0x35')]['length']?_0x12118d[_0x4ccc('0x35')]:_0x4736ea[_0x4ccc('0x30')];if(_0x439522[_0x4ccc('0x31')][_0x4ccc('0x45')]){_0x12118d[_0x4ccc('0x40')]=[{'all':!![]}];}_0x12118d=_[_0x4ccc('0x3e')]({},_0x12118d,_0x439522['options']);return db[_0x4ccc('0x2d')][_0x4ccc('0x46')](_0x12118d)[_0x4ccc('0x26')](handleEntityNotFound(_0x1a41e3,null))[_0x4ccc('0x26')](respondWithResult(_0x1a41e3,null))[_0x4ccc('0x47')](handleError(_0x1a41e3,null));};exports[_0x4ccc('0x48')]=function(_0x564dc6,_0x2c7452){return db[_0x4ccc('0x2d')][_0x4ccc('0x48')](_0x564dc6['body'],{})[_0x4ccc('0x26')](respondWithResult(_0x2c7452,0xc9))[_0x4ccc('0x47')](handleError(_0x2c7452,null));};exports[_0x4ccc('0x49')]=function(_0x13fd79,_0x3273ca){if(_0x13fd79[_0x4ccc('0x4a')]['id']){delete _0x13fd79[_0x4ccc('0x4a')]['id'];}return db[_0x4ccc('0x2d')][_0x4ccc('0x46')]({'where':{'id':_0x13fd79[_0x4ccc('0x44')]['id']}})['then'](handleEntityNotFound(_0x3273ca,null))['then'](saveUpdates(_0x13fd79[_0x4ccc('0x4a')],null))[_0x4ccc('0x26')](respondWithResult(_0x3273ca,null))[_0x4ccc('0x47')](handleError(_0x3273ca,null));};exports['destroy']=function(_0x1596fb,_0x295399){return db[_0x4ccc('0x2d')][_0x4ccc('0x46')]({'where':{'id':_0x1596fb[_0x4ccc('0x44')]['id']}})[_0x4ccc('0x26')](handleEntityNotFound(_0x295399,null))[_0x4ccc('0x26')](removeEntity(_0x295399,null))[_0x4ccc('0x47')](handleError(_0x295399,null));};exports['describe']=function(_0x3f9af2,_0x5dc26f){return db[_0x4ccc('0x2d')][_0x4ccc('0x4b')]()['then'](respondWithResult(_0x5dc26f,null))[_0x4ccc('0x47')](handleError(_0x5dc26f,null));};exports['getVoiceQueuesReport']=function(_0x1006f4,_0x5a91c8){var _0x4d3ffc={},_0x2fc243={},_0x1c7d88={'count':0x0,'rows':[]};_0x2fc243[_0x4ccc('0x30')]=_[_0x4ccc('0x32')](db['VoiceQueueReport']['rawAttributes']);_0x2fc243[_0x4ccc('0x31')]=_[_0x4ccc('0x32')](_0x1006f4['query']);_0x2fc243[_0x4ccc('0x33')]=_['intersection'](_0x2fc243['model'],_0x2fc243['query']);_0x4d3ffc[_0x4ccc('0x35')]=_[_0x4ccc('0x34')](_0x2fc243[_0x4ccc('0x30')],qs['fields'](_0x1006f4[_0x4ccc('0x31')][_0x4ccc('0x4c')]));_0x4d3ffc[_0x4ccc('0x35')]=_0x4d3ffc[_0x4ccc('0x35')][_0x4ccc('0x36')]?_0x4d3ffc[_0x4ccc('0x35')]:_0x2fc243[_0x4ccc('0x30')];if(!_0x1006f4[_0x4ccc('0x31')][_0x4ccc('0x37')](_0x4ccc('0x38'))){_0x4d3ffc[_0x4ccc('0x1e')]=qs[_0x4ccc('0x1e')](_0x1006f4[_0x4ccc('0x31')][_0x4ccc('0x1e')]);_0x4d3ffc[_0x4ccc('0x21')]=qs['offset'](_0x1006f4[_0x4ccc('0x31')][_0x4ccc('0x21')]);}_0x4d3ffc[_0x4ccc('0x39')]=qs['sort'](_0x1006f4['query'][_0x4ccc('0x3a')]);_0x4d3ffc['where']=qs[_0x4ccc('0x33')](_[_0x4ccc('0x3c')](_0x1006f4[_0x4ccc('0x31')],_0x2fc243['filters']));if(_0x1006f4[_0x4ccc('0x31')][_0x4ccc('0x3d')]){_0x4d3ffc[_0x4ccc('0x3b')]=_[_0x4ccc('0x3e')](_0x4d3ffc[_0x4ccc('0x3b')],{'$or':_[_0x4ccc('0x2c')](_0x4d3ffc[_0x4ccc('0x35')],function(_0x6ccecb){var _0xf01197={};_0xf01197[_0x6ccecb]={'$like':'%'+_0x1006f4['query']['filter']+'%'};return _0xf01197;})});}_0x4d3ffc=_['merge']({},_0x4d3ffc,_0x1006f4['options']);var _0x24903a={'where':_0x4d3ffc['where']};return db['VoiceQueueReport'][_0x4ccc('0x20')](_0x24903a)[_0x4ccc('0x26')](function(_0x3332bc){_0x1c7d88['count']=_0x3332bc;if(_0x1006f4[_0x4ccc('0x31')]['includeAll']){_0x4d3ffc[_0x4ccc('0x40')]=[{'all':!![]}];}return db[_0x4ccc('0x2d')][_0x4ccc('0x41')](_0x4d3ffc);})[_0x4ccc('0x26')](function(_0x2c1199){_0x1c7d88['rows']=_0x2c1199;return _0x1c7d88;})[_0x4ccc('0x26')](respondWithFilteredResult(_0x5a91c8,_0x4d3ffc,_0x4ccc('0x4d')))[_0x4ccc('0x47')](handleError(_0x5a91c8,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1a7e9b8..4a1a69c 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 _0x3f56=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','save','update','emit'];(function(_0x1dbdac,_0x5f03ab){var _0x1da18e=function(_0x536639){while(--_0x536639){_0x1dbdac['push'](_0x1dbdac['shift']());}};_0x1da18e(++_0x5f03ab);}(_0x3f56,0x122));var _0x63f5=function(_0x5c3ae7,_0x3a52c6){_0x5c3ae7=_0x5c3ae7-0x0;var _0x2cae35=_0x3f56[_0x5c3ae7];return _0x2cae35;};'use strict';var EventEmitter=require(_0x63f5('0x0'));var VoiceQueueReport=require(_0x63f5('0x1'))['db'][_0x63f5('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63f5('0x3'),'afterUpdate':_0x63f5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1e5625){return function(_0x2b09ab,_0x176b59,_0x11c7c8){VoiceQueueReportEvents[_0x63f5('0x5')](_0x1e5625+':'+_0x2b09ab['id'],_0x2b09ab);VoiceQueueReportEvents[_0x63f5('0x5')](_0x1e5625,_0x2b09ab);_0x11c7c8(null);};}for(var e in events){if(events[_0x63f5('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x63f5('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x0e57=['remove','emit','hasOwnProperty','hook','exports','VoiceQueueReport','save'];(function(_0x361ee1,_0x37fed8){var _0x1fcaad=function(_0xd426bf){while(--_0xd426bf){_0x361ee1['push'](_0x361ee1['shift']());}};_0x1fcaad(++_0x37fed8);}(_0x0e57,0xde));var _0x70e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e57[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x70e5('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x70e5('0x1'),'afterUpdate':'update','afterDestroy':_0x70e5('0x2')};function emitEvent(_0x27ffc0){return function(_0x37423b,_0x4898f5,_0x346106){VoiceQueueReportEvents[_0x70e5('0x3')](_0x27ffc0+':'+_0x37423b['id'],_0x37423b);VoiceQueueReportEvents[_0x70e5('0x3')](_0x27ffc0,_0x37423b);_0x346106(null);};}for(var e in events){if(events[_0x70e5('0x4')](e)){var event=events[e];VoiceQueueReport[_0x70e5('0x5')](e,emitEvent(event));}}module[_0x70e5('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 9719f5e..e546d80 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 _0x955d=['request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','api','moment','bluebird'];(function(_0x5b5b6e,_0x2d4238){var _0x36ced6=function(_0x49e5d5){while(--_0x49e5d5){_0x5b5b6e['push'](_0x5b5b6e['shift']());}};_0x36ced6(++_0x2d4238);}(_0x955d,0x1d8));var _0xd955=function(_0x43c61f,_0x53675b){_0x43c61f=_0x43c61f-0x0;var _0x3f0e1b=_0x955d[_0x43c61f];return _0x3f0e1b;};'use strict';var _=require(_0xd955('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd955('0x1'));var moment=require(_0xd955('0x2'));var BPromise=require(_0xd955('0x3'));var rp=require(_0xd955('0x4'));var fs=require('fs');var path=require(_0xd955('0x5'));var rimraf=require('rimraf');var config=require(_0xd955('0x6'));var attributes=require(_0xd955('0x7'));module[_0xd955('0x8')]=function(_0x21b820,_0x17f240){return _0x21b820[_0xd955('0x9')](_0xd955('0xa'),attributes,{'tableName':_0xd955('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd955('0xc')]},{'fields':[_0xd955('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7613=['uniqueid','calleridnum','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x11bf1b,_0x50581b){var _0x387d1c=function(_0x54e22f){while(--_0x54e22f){_0x11bf1b['push'](_0x11bf1b['shift']());}};_0x387d1c(++_0x50581b);}(_0x7613,0x84));var _0x3761=function(_0x145435,_0x326220){_0x145435=_0x145435-0x0;var _0x55a234=_0x7613[_0x145435];return _0x55a234;};'use strict';var _=require('lodash');var util=require(_0x3761('0x0'));var logger=require(_0x3761('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3761('0x2'));var rp=require(_0x3761('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3761('0x4'));var config=require(_0x3761('0x5'));var attributes=require(_0x3761('0x6'));module[_0x3761('0x7')]=function(_0x2105bb,_0x35f370){return _0x2105bb[_0x3761('0x8')](_0x3761('0x9'),attributes,{'tableName':_0x3761('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3761('0xb')]},{'fields':[_0x3761('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 63b72b7..7604ce7 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 _0xb4b2=['UpdateVoiceQueueReport','update','limit','util','moment','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','map','include','model','attributes','stringify','CreateVoiceQueueReport','create','body','raw'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xb4b2,0x1d7));var _0x2b4b=function(_0x37a0ac,_0x4fbc80){_0x37a0ac=_0x37a0ac-0x0;var _0x15cd98=_0xb4b2[_0x37a0ac];return _0x15cd98;};'use strict';var _=require('lodash');var util=require(_0x2b4b('0x0'));var moment=require(_0x2b4b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b4b('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2b4b('0x3'));var jayson=require(_0x2b4b('0x4'));var client=jayson['client'][_0x2b4b('0x5')]({'port':0x232a});config[_0x2b4b('0x6')]=_[_0x2b4b('0x7')](config[_0x2b4b('0x6')],{'host':_0x2b4b('0x8'),'port':0x18eb});var socket=require(_0x2b4b('0x9'))(new Redis(config[_0x2b4b('0x6')]));require(_0x2b4b('0xa'))[_0x2b4b('0xb')](socket);function respondWithRpcPromise(_0x263ed6,_0x1a913c,_0x2d2f20){return new BPromise(function(_0x1b7e2c,_0x5686d6){return client[_0x2b4b('0xc')](_0x263ed6,_0x2d2f20)['then'](function(_0x4888a5){logger[_0x2b4b('0xd')](_0x2b4b('0xe'),_0x1a913c,_0x2b4b('0xf'));logger[_0x2b4b('0x10')](_0x2b4b('0x11'),_0x1a913c,'request\x20sent',JSON['stringify'](_0x4888a5));if(_0x4888a5['error']){if(_0x4888a5[_0x2b4b('0x12')][_0x2b4b('0x13')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1a913c,_0x4888a5['error']['message']);return _0x5686d6(_0x4888a5[_0x2b4b('0x12')][_0x2b4b('0x14')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1a913c,_0x4888a5[_0x2b4b('0x12')]['message']);return _0x1b7e2c(_0x4888a5['error'][_0x2b4b('0x14')]);}else{logger[_0x2b4b('0xd')](_0x2b4b('0xe'),_0x1a913c,_0x2b4b('0xf'));_0x1b7e2c(_0x4888a5['result'][_0x2b4b('0x14')]);}})[_0x2b4b('0x15')](function(_0x10de6b){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1a913c,_0x10de6b);_0x5686d6(_0x10de6b);});});}exports[_0x2b4b('0x16')]=function(_0x30089a){var _0x28466a=this;return new Promise(function(_0x4fd8ef,_0x1a7af8){return db[_0x2b4b('0x17')][_0x2b4b('0x18')]({'raw':_0x30089a[_0x2b4b('0x19')]?_0x30089a[_0x2b4b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x30089a['options']?_0x30089a[_0x2b4b('0x19')][_0x2b4b('0x1a')]||null:null,'attributes':_0x30089a[_0x2b4b('0x19')]?_0x30089a[_0x2b4b('0x19')]['attributes']||null:null,'limit':_0x30089a[_0x2b4b('0x19')]?_0x30089a[_0x2b4b('0x19')]['limit']||null:null,'include':_0x30089a[_0x2b4b('0x19')]?_0x30089a[_0x2b4b('0x19')]['include']?_[_0x2b4b('0x1b')](_0x30089a[_0x2b4b('0x19')][_0x2b4b('0x1c')],function(_0x2e0c6c){return{'model':db[_0x2e0c6c[_0x2b4b('0x1d')]],'as':_0x2e0c6c['as'],'attributes':_0x2e0c6c['attributes'],'include':_0x2e0c6c[_0x2b4b('0x1c')]?_['map'](_0x2e0c6c[_0x2b4b('0x1c')],function(_0x1351af){return{'model':db[_0x1351af['model']],'as':_0x1351af['as'],'attributes':_0x1351af[_0x2b4b('0x1e')],'include':_0x1351af[_0x2b4b('0x1c')]?_[_0x2b4b('0x1b')](_0x1351af[_0x2b4b('0x1c')],function(_0x4cfe7e){return{'model':db[_0x4cfe7e[_0x2b4b('0x1d')]],'as':_0x4cfe7e['as'],'attributes':_0x4cfe7e[_0x2b4b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e19ca){logger[_0x2b4b('0xd')]('GetVoiceQueueReport',_0x30089a);logger['debug'](_0x2b4b('0x16'),_0x30089a,JSON[_0x2b4b('0x1f')](_0x1e19ca));_0x4fd8ef(_0x1e19ca);})[_0x2b4b('0x15')](function(_0x5384ce){logger[_0x2b4b('0x12')]('GetVoiceQueueReport',_0x5384ce[_0x2b4b('0x14')],_0x30089a);_0x1a7af8(_0x28466a[_0x2b4b('0x12')](0x1f4,_0x5384ce[_0x2b4b('0x14')]));});});};exports[_0x2b4b('0x20')]=function(_0x19ea4c){var _0x31c26a=this;return new Promise(function(_0x303cff,_0x177ad){return db[_0x2b4b('0x17')][_0x2b4b('0x21')](_0x19ea4c[_0x2b4b('0x22')],{'raw':_0x19ea4c['options']?_0x19ea4c['options'][_0x2b4b('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x495066){logger['info'](_0x2b4b('0x20'),_0x19ea4c);logger['debug'](_0x2b4b('0x20'),_0x19ea4c,JSON['stringify'](_0x495066));_0x303cff(_0x495066);})[_0x2b4b('0x15')](function(_0xd9f4e3){logger[_0x2b4b('0x12')](_0x2b4b('0x20'),_0xd9f4e3[_0x2b4b('0x14')],_0x19ea4c);_0x177ad(_0x31c26a[_0x2b4b('0x12')](0x1f4,_0xd9f4e3['message']));});});};exports[_0x2b4b('0x24')]=function(_0x56d5b3){var _0x459502=this;return new Promise(function(_0xe090f,_0x1e3211){return db['VoiceQueueReport'][_0x2b4b('0x25')](_0x56d5b3[_0x2b4b('0x22')],{'raw':_0x56d5b3[_0x2b4b('0x19')]?_0x56d5b3[_0x2b4b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56d5b3[_0x2b4b('0x19')]?_0x56d5b3[_0x2b4b('0x19')][_0x2b4b('0x1a')]||null:null,'attributes':_0x56d5b3['options']?_0x56d5b3['options']['attributes']||null:null,'limit':_0x56d5b3[_0x2b4b('0x19')]?_0x56d5b3['options'][_0x2b4b('0x26')]||null:null})['then'](function(_0x4b33f5){logger[_0x2b4b('0xd')](_0x2b4b('0x24'),_0x56d5b3);logger[_0x2b4b('0x10')](_0x2b4b('0x24'),_0x56d5b3,JSON[_0x2b4b('0x1f')](_0x4b33f5));_0xe090f(_0x4b33f5);})[_0x2b4b('0x15')](function(_0x537814){logger[_0x2b4b('0x12')](_0x2b4b('0x24'),_0x537814['message'],_0x56d5b3);_0x1e3211(_0x459502[_0x2b4b('0x12')](0x1f4,_0x537814[_0x2b4b('0x14')]));});});}; \ No newline at end of file +var _0x1374=['redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','include','map','model','attributes','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x27ce04,_0x404ea4){var _0x19d4ce=function(_0x266854){while(--_0x266854){_0x27ce04['push'](_0x27ce04['shift']());}};_0x19d4ce(++_0x404ea4);}(_0x1374,0x18a));var _0x4137=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x1374[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require(_0x4137('0x0'));var moment=require(_0x4137('0x1'));var BPromise=require(_0x4137('0x2'));var rs=require(_0x4137('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4137('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4137('0x5'))(_0x4137('0x6'));var config=require(_0x4137('0x7'));var jayson=require(_0x4137('0x8'));var client=jayson[_0x4137('0x9')][_0x4137('0xa')]({'port':0x232a});config[_0x4137('0xb')]=_[_0x4137('0xc')](config[_0x4137('0xb')],{'host':_0x4137('0xd'),'port':0x18eb});var socket=require(_0x4137('0xe'))(new Redis(config[_0x4137('0xb')]));require(_0x4137('0xf'))[_0x4137('0x10')](socket);function respondWithRpcPromise(_0x3023c6,_0x4bc696,_0xfff420){return new BPromise(function(_0x4a4fea,_0x193fd8){return client[_0x4137('0x11')](_0x3023c6,_0xfff420)[_0x4137('0x12')](function(_0x3b9e5e){logger[_0x4137('0x13')](_0x4137('0x14'),_0x4bc696,_0x4137('0x15'));logger[_0x4137('0x16')](_0x4137('0x17'),_0x4bc696,_0x4137('0x15'),JSON[_0x4137('0x18')](_0x3b9e5e));if(_0x3b9e5e[_0x4137('0x19')]){if(_0x3b9e5e[_0x4137('0x19')][_0x4137('0x1a')]===0x1f4){logger[_0x4137('0x19')](_0x4137('0x14'),_0x4bc696,_0x3b9e5e['error'][_0x4137('0x1b')]);return _0x193fd8(_0x3b9e5e[_0x4137('0x19')][_0x4137('0x1b')]);}logger[_0x4137('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x4bc696,_0x3b9e5e[_0x4137('0x19')][_0x4137('0x1b')]);return _0x4a4fea(_0x3b9e5e['error'][_0x4137('0x1b')]);}else{logger[_0x4137('0x13')](_0x4137('0x14'),_0x4bc696,_0x4137('0x15'));_0x4a4fea(_0x3b9e5e[_0x4137('0x1c')][_0x4137('0x1b')]);}})[_0x4137('0x1d')](function(_0x19460a){logger['error'](_0x4137('0x14'),_0x4bc696,_0x19460a);_0x193fd8(_0x19460a);});});}exports['GetVoiceQueueReport']=function(_0x4b2060){var _0x5eb7c4=this;return new Promise(function(_0x4f3866,_0x122955){return db[_0x4137('0x1e')][_0x4137('0x1f')]({'raw':_0x4b2060[_0x4137('0x20')]?_0x4b2060[_0x4137('0x20')][_0x4137('0x21')]===undefined?!![]:![]:!![],'where':_0x4b2060[_0x4137('0x20')]?_0x4b2060['options']['where']||null:null,'attributes':_0x4b2060[_0x4137('0x20')]?_0x4b2060[_0x4137('0x20')]['attributes']||null:null,'limit':_0x4b2060[_0x4137('0x20')]?_0x4b2060['options']['limit']||null:null,'include':_0x4b2060['options']?_0x4b2060[_0x4137('0x20')][_0x4137('0x22')]?_[_0x4137('0x23')](_0x4b2060[_0x4137('0x20')][_0x4137('0x22')],function(_0x3c091d){return{'model':db[_0x3c091d[_0x4137('0x24')]],'as':_0x3c091d['as'],'attributes':_0x3c091d[_0x4137('0x25')],'include':_0x3c091d[_0x4137('0x22')]?_['map'](_0x3c091d['include'],function(_0x4f3fbf){return{'model':db[_0x4f3fbf['model']],'as':_0x4f3fbf['as'],'attributes':_0x4f3fbf[_0x4137('0x25')],'include':_0x4f3fbf['include']?_[_0x4137('0x23')](_0x4f3fbf['include'],function(_0x1735d0){return{'model':db[_0x1735d0['model']],'as':_0x1735d0['as'],'attributes':_0x1735d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x4137('0x12')](function(_0xbf1563){logger[_0x4137('0x13')](_0x4137('0x26'),_0x4b2060);logger[_0x4137('0x16')](_0x4137('0x26'),_0x4b2060,JSON[_0x4137('0x18')](_0xbf1563));_0x4f3866(_0xbf1563);})[_0x4137('0x1d')](function(_0x2d395b){logger[_0x4137('0x19')](_0x4137('0x26'),_0x2d395b['message'],_0x4b2060);_0x122955(_0x5eb7c4[_0x4137('0x19')](0x1f4,_0x2d395b[_0x4137('0x1b')]));});});};exports[_0x4137('0x27')]=function(_0x16dff1){var _0x14822d=this;return new Promise(function(_0x5db209,_0x459bc4){return db[_0x4137('0x1e')][_0x4137('0x28')](_0x16dff1[_0x4137('0x29')],{'raw':_0x16dff1['options']?_0x16dff1[_0x4137('0x20')][_0x4137('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x454acc){logger[_0x4137('0x13')](_0x4137('0x27'),_0x16dff1);logger[_0x4137('0x16')](_0x4137('0x27'),_0x16dff1,JSON[_0x4137('0x18')](_0x454acc));_0x5db209(_0x454acc);})[_0x4137('0x1d')](function(_0x17a3ba){logger[_0x4137('0x19')](_0x4137('0x27'),_0x17a3ba[_0x4137('0x1b')],_0x16dff1);_0x459bc4(_0x14822d['error'](0x1f4,_0x17a3ba['message']));});});};exports[_0x4137('0x2a')]=function(_0x24e953){var _0x2b4cbd=this;return new Promise(function(_0x2d5167,_0x24708b){return db[_0x4137('0x1e')][_0x4137('0x2b')](_0x24e953['body'],{'raw':_0x24e953['options']?_0x24e953[_0x4137('0x20')][_0x4137('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e953[_0x4137('0x20')]?_0x24e953[_0x4137('0x20')][_0x4137('0x2c')]||null:null,'attributes':_0x24e953[_0x4137('0x20')]?_0x24e953[_0x4137('0x20')]['attributes']||null:null,'limit':_0x24e953[_0x4137('0x20')]?_0x24e953[_0x4137('0x20')]['limit']||null:null})[_0x4137('0x12')](function(_0x116514){logger[_0x4137('0x13')](_0x4137('0x2a'),_0x24e953);logger[_0x4137('0x16')](_0x4137('0x2a'),_0x24e953,JSON['stringify'](_0x116514));_0x2d5167(_0x116514);})[_0x4137('0x1d')](function(_0x4f6cb7){logger[_0x4137('0x19')](_0x4137('0x2a'),_0x4f6cb7['message'],_0x24e953);_0x24708b(_0x2b4cbd[_0x4137('0x19')](0x1f4,_0x4f6cb7['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 21843f7..0d57ccf 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 _0xaa19=['length','./voiceQueueReport.events','save','remove','update','emit','removeListener','register'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0xaa19,0x79));var _0x9aa1=function(_0x4f3314,_0x45ee05){_0x4f3314=_0x4f3314-0x0;var _0x29636a=_0xaa19[_0x4f3314];return _0x29636a;};'use strict';var VoiceQueueReportEvents=require(_0x9aa1('0x0'));var events=[_0x9aa1('0x1'),_0x9aa1('0x2'),_0x9aa1('0x3')];function createListener(_0x4af2e4,_0x343b95){return function(_0x5371a9){_0x343b95[_0x9aa1('0x4')](_0x4af2e4,_0x5371a9);};}function removeListener(_0x58fb46,_0x11fd1b){return function(){VoiceQueueReportEvents[_0x9aa1('0x5')](_0x58fb46,_0x11fd1b);};}exports[_0x9aa1('0x6')]=function(_0x52124b){for(var _0x1e59f8=0x0,_0x473aa0=events[_0x9aa1('0x7')];_0x1e59f8<_0x473aa0;_0x1e59f8++){var _0x5363e3=events[_0x1e59f8];var _0x302408=createListener('voiceQueueReport:'+_0x5363e3,_0x52124b);VoiceQueueReportEvents['on'](_0x5363e3,_0x302408);}}; \ No newline at end of file +var _0x4c4e=['length','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit','removeListener'];(function(_0xe03522,_0x1fa658){var _0x186a45=function(_0x51c5d6){while(--_0x51c5d6){_0xe03522['push'](_0xe03522['shift']());}};_0x186a45(++_0x1fa658);}(_0x4c4e,0x152));var _0xe4c4=function(_0x7b88e7,_0x4505c8){_0x7b88e7=_0x7b88e7-0x0;var _0x5d8fad=_0x4c4e[_0x7b88e7];return _0x5d8fad;};'use strict';var VoiceQueueReportEvents=require(_0xe4c4('0x0'));var events=['save',_0xe4c4('0x1'),_0xe4c4('0x2')];function createListener(_0xe3f2f,_0x58c8f6){return function(_0x1b6c91){_0x58c8f6[_0xe4c4('0x3')](_0xe3f2f,_0x1b6c91);};}function removeListener(_0x1a4483,_0x4cd652){return function(){VoiceQueueReportEvents[_0xe4c4('0x4')](_0x1a4483,_0x4cd652);};}exports['register']=function(_0x177732){for(var _0x1a12a6=0x0,_0x262b64=events[_0xe4c4('0x5')];_0x1a12a6<_0x262b64;_0x1a12a6++){var _0x22085a=events[_0x1a12a6];var _0x329d29=createListener(_0xe4c4('0x6')+_0x22085a,_0x177732);VoiceQueueReportEvents['on'](_0x22085a,_0x329d29);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 80ac95b..b391c24 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 _0xe7be=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0xda4ea5,_0x1f4266){var _0x282f9e=function(_0x1c4e5e){while(--_0x1c4e5e){_0xda4ea5['push'](_0xda4ea5['shift']());}};_0x282f9e(++_0x1f4266);}(_0xe7be,0x16a));var _0xee7b=function(_0x1fabb6,_0x56ced1){_0x1fabb6=_0x1fabb6-0x0;var _0x11dc00=_0xe7be[_0x1fabb6];return _0x11dc00;};'use strict';var multer=require(_0xee7b('0x0'));var util=require(_0xee7b('0x1'));var path=require(_0xee7b('0x2'));var timeout=require(_0xee7b('0x3'));var express=require('express');var router=express[_0xee7b('0x4')]();var fs_extra=require(_0xee7b('0x5'));var auth=require(_0xee7b('0x6'));var interaction=require(_0xee7b('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0xee7b('0x8')]('/',auth['isAuthenticated'](),controller[_0xee7b('0x9')]);router[_0xee7b('0x8')](_0xee7b('0xa'),auth['isAuthenticated'](),controller[_0xee7b('0xb')]);router[_0xee7b('0xc')]('/',auth[_0xee7b('0xd')](),controller[_0xee7b('0xe')]);router[_0xee7b('0xf')]('/:id',auth[_0xee7b('0xd')](),controller[_0xee7b('0x10')]);router[_0xee7b('0x11')]('/:id',auth[_0xee7b('0xd')](),controller[_0xee7b('0x12')]);module[_0xee7b('0x13')]=router; \ No newline at end of file +var _0xaa0b=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','put','/:id','destroy'];(function(_0x14068f,_0x3551c3){var _0xe2ba9c=function(_0x334f83){while(--_0x334f83){_0x14068f['push'](_0x14068f['shift']());}};_0xe2ba9c(++_0x3551c3);}(_0xaa0b,0x1b1));var _0xbaa0=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xaa0b[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0xbaa0('0x0'));var util=require(_0xbaa0('0x1'));var path=require('path');var timeout=require(_0xbaa0('0x2'));var express=require(_0xbaa0('0x3'));var router=express[_0xbaa0('0x4')]();var fs_extra=require(_0xbaa0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbaa0('0x6'));var config=require(_0xbaa0('0x7'));var controller=require(_0xbaa0('0x8'));router[_0xbaa0('0x9')]('/',auth[_0xbaa0('0xa')](),controller['index']);router[_0xbaa0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbaa0('0xb')]);router['post']('/',auth[_0xbaa0('0xa')](),controller['create']);router[_0xbaa0('0xc')](_0xbaa0('0xd'),auth[_0xbaa0('0xa')](),controller['update']);router['delete']('/:id',auth[_0xbaa0('0xa')](),controller[_0xbaa0('0xe')]);module[_0xbaa0('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 4234b2b..961a016 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 _0x985e=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x985e,0xe4));var _0xe985=function(_0x1d49c6,_0x36c18e){_0x1d49c6=_0x1d49c6-0x0;var _0x55bceb=_0x985e[_0x1d49c6];return _0x55bceb;};'use strict';var Sequelize=require(_0xe985('0x0'));var moment=require(_0xe985('0x1'));module[_0xe985('0x2')]={'time':{'type':Sequelize[_0xe985('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe985('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe985('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe985('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe985('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe985('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe985('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe985('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xe985('0x5')](_0xe985('0x6'))}}; \ No newline at end of file +var _0x1083=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','DATE','literal'];(function(_0x54cc03,_0x51b67a){var _0x46edd7=function(_0x5383ff){while(--_0x5383ff){_0x54cc03['push'](_0x54cc03['shift']());}};_0x46edd7(++_0x51b67a);}(_0x1083,0x151));var _0x3108=function(_0x1cf72b,_0x2e6a67){_0x1cf72b=_0x1cf72b-0x0;var _0x5d906a=_0x1083[_0x1cf72b];return _0x5d906a;};'use strict';var Sequelize=require(_0x3108('0x0'));var moment=require(_0x3108('0x1'));module[_0x3108('0x2')]={'time':{'type':Sequelize[_0x3108('0x3')]},'callid':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x3108('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3108('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x3108('0x5')](_0x3108('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c74b899..76a3476 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 _0x2a11=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x31f7b6,_0x4b23ef){var _0x55a6ec=function(_0x488a2b){while(--_0x488a2b){_0x31f7b6['push'](_0x31f7b6['shift']());}};_0x55a6ec(++_0x4b23ef);}(_0x2a11,0x18d));var _0x12a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a11[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x12a1('0x0'));var rimraf=require(_0x12a1('0x1'));var zipdir=require(_0x12a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12a1('0x4'));var path=require(_0x12a1('0x5'));var sox=require(_0x12a1('0x6'));var csv=require('to-csv');var ejs=require(_0x12a1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12a1('0x8'));var squel=require(_0x12a1('0x9'));var crypto=require(_0x12a1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x12a1('0xb'));var toCsv=require(_0x12a1('0xc'));var querystring=require(_0x12a1('0xd'));var Papa=require('papaparse');var Redis=require(_0x12a1('0xe'));var authService=require(_0x12a1('0xf'));var qs=require(_0x12a1('0x10'));var as=require(_0x12a1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x12a1('0x12'));var utils=require(_0x12a1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x12a1('0x14'));var db=require(_0x12a1('0x15'))['db'];function respondWithStatusCode(_0x2d79f2,_0x189785){_0x189785=_0x189785||0xcc;return function(_0x4585b2){if(_0x4585b2){return _0x2d79f2['sendStatus'](_0x189785);}return _0x2d79f2[_0x12a1('0x16')](_0x189785)[_0x12a1('0x17')]();};}function respondWithResult(_0x2abf57,_0x487065){_0x487065=_0x487065||0xc8;return function(_0x300974){if(_0x300974){return _0x2abf57[_0x12a1('0x16')](_0x487065)[_0x12a1('0x18')](_0x300974);}};}function respondWithFilteredResult(_0x2c1c47,_0x2c55e0){return function(_0x26301f){if(_0x26301f){var _0x3bb555=typeof _0x2c55e0[_0x12a1('0x19')]===_0x12a1('0x1a')&&typeof _0x2c55e0['limit']===_0x12a1('0x1a');var _0x7b6a15=_0x26301f[_0x12a1('0x1b')];var _0x13e6cd=_0x3bb555?0x0:_0x2c55e0[_0x12a1('0x19')];var _0x1b9903=_0x3bb555?_0x26301f['count']:_0x2c55e0[_0x12a1('0x19')]+_0x2c55e0[_0x12a1('0x1c')];var _0x461b8a;if(_0x1b9903>=_0x7b6a15){_0x1b9903=_0x7b6a15;_0x461b8a=0xc8;}else{_0x461b8a=0xce;}_0x2c1c47[_0x12a1('0x16')](_0x461b8a);return _0x2c1c47[_0x12a1('0x1d')](_0x12a1('0x1e'),_0x13e6cd+'-'+_0x1b9903+'/'+_0x7b6a15)['json'](_0x26301f);}return null;};}function patchUpdates(_0x2998b0){return function(_0x34e170){try{jsonpatch[_0x12a1('0x1f')](_0x34e170,_0x2998b0,!![]);}catch(_0xaa995d){return BPromise[_0x12a1('0x20')](_0xaa995d);}return _0x34e170['save']();};}function saveUpdates(_0x2f9e4a,_0x5d1577){return function(_0x235ff9){if(_0x235ff9){return _0x235ff9[_0x12a1('0x21')](_0x2f9e4a)[_0x12a1('0x22')](function(_0x1b632d){return _0x1b632d;});}return null;};}function removeEntity(_0x10c2ec,_0xd70480){return function(_0x3ae46f){if(_0x3ae46f){return _0x3ae46f[_0x12a1('0x23')]()[_0x12a1('0x22')](function(){_0x10c2ec[_0x12a1('0x16')](0xcc)[_0x12a1('0x17')]();});}};}function handleEntityNotFound(_0xd1198d,_0x487447){return function(_0x140f54){if(!_0x140f54){_0xd1198d[_0x12a1('0x24')](0x194);}return _0x140f54;};}function handleError(_0xac8ae,_0x18e634){_0x18e634=_0x18e634||0x1f4;return function(_0x157ba5){logger['error'](_0x157ba5[_0x12a1('0x25')]);if(_0x157ba5['name']){delete _0x157ba5[_0x12a1('0x26')];}_0xac8ae[_0x12a1('0x16')](_0x18e634)[_0x12a1('0x27')](_0x157ba5);};}exports[_0x12a1('0x28')]=function(_0x227629,_0x70095b){var _0x1df0f0={},_0x11eb3c={},_0x59de97={'count':0x0,'rows':[]};var _0x431069=_[_0x12a1('0x29')](db[_0x12a1('0x2a')][_0x12a1('0x2b')],function(_0x1b7602){return{'name':_0x1b7602[_0x12a1('0x2c')],'type':_0x1b7602[_0x12a1('0x2d')]['key']};});_0x11eb3c[_0x12a1('0x2e')]=_['map'](_0x431069,_0x12a1('0x26'));_0x11eb3c[_0x12a1('0x2f')]=_[_0x12a1('0x30')](_0x227629[_0x12a1('0x2f')]);_0x11eb3c[_0x12a1('0x31')]=_[_0x12a1('0x32')](_0x11eb3c[_0x12a1('0x2e')],_0x11eb3c[_0x12a1('0x2f')]);_0x1df0f0[_0x12a1('0x33')]=_[_0x12a1('0x32')](_0x11eb3c['model'],qs['fields'](_0x227629['query'][_0x12a1('0x34')]));_0x1df0f0[_0x12a1('0x33')]=_0x1df0f0[_0x12a1('0x33')][_0x12a1('0x35')]?_0x1df0f0[_0x12a1('0x33')]:_0x11eb3c[_0x12a1('0x2e')];if(!_0x227629[_0x12a1('0x2f')]['hasOwnProperty']('nolimit')){_0x1df0f0['limit']=qs['limit'](_0x227629[_0x12a1('0x2f')][_0x12a1('0x1c')]);_0x1df0f0[_0x12a1('0x19')]=qs[_0x12a1('0x19')](_0x227629[_0x12a1('0x2f')][_0x12a1('0x19')]);}_0x1df0f0['order']=qs['sort'](_0x227629[_0x12a1('0x2f')][_0x12a1('0x36')]);_0x1df0f0[_0x12a1('0x37')]=qs['filters'](_[_0x12a1('0x38')](_0x227629[_0x12a1('0x2f')],_0x11eb3c[_0x12a1('0x31')]),_0x431069);if(_0x227629[_0x12a1('0x2f')][_0x12a1('0x39')]){_0x1df0f0[_0x12a1('0x37')]=_[_0x12a1('0x3a')](_0x1df0f0[_0x12a1('0x37')],{'$or':_['map'](_0x431069,function(_0x49b1bd){if(_0x49b1bd['type']!==_0x12a1('0x3b')){var _0x47e72c={};_0x47e72c[_0x49b1bd[_0x12a1('0x26')]]={'$like':'%'+_0x227629[_0x12a1('0x2f')][_0x12a1('0x39')]+'%'};return _0x47e72c;}})});}_0x1df0f0=_[_0x12a1('0x3a')]({},_0x1df0f0,_0x227629[_0x12a1('0x3c')]);var _0xfbed66={'where':_0x1df0f0[_0x12a1('0x37')]};return db[_0x12a1('0x2a')][_0x12a1('0x1b')](_0xfbed66)[_0x12a1('0x22')](function(_0x248a18){_0x59de97[_0x12a1('0x1b')]=_0x248a18;if(_0x227629['query'][_0x12a1('0x3d')]){_0x1df0f0[_0x12a1('0x3e')]=[{'all':!![]}];}return db[_0x12a1('0x2a')][_0x12a1('0x3f')](_0x1df0f0);})[_0x12a1('0x22')](function(_0x9f426e){_0x59de97['rows']=_0x9f426e;return _0x59de97;})[_0x12a1('0x22')](respondWithFilteredResult(_0x70095b,_0x1df0f0))[_0x12a1('0x40')](handleError(_0x70095b,null));};exports['show']=function(_0x2b0b37,_0x8ed4e9){var _0x57e668={'raw':!![],'where':{'id':_0x2b0b37[_0x12a1('0x41')]['id']}},_0x19c51c={};_0x19c51c[_0x12a1('0x2e')]=_[_0x12a1('0x30')](db[_0x12a1('0x2a')][_0x12a1('0x2b')]);_0x19c51c[_0x12a1('0x2f')]=_[_0x12a1('0x30')](_0x2b0b37[_0x12a1('0x2f')]);_0x19c51c[_0x12a1('0x31')]=_[_0x12a1('0x32')](_0x19c51c[_0x12a1('0x2e')],_0x19c51c['query']);_0x57e668[_0x12a1('0x33')]=_[_0x12a1('0x32')](_0x19c51c[_0x12a1('0x2e')],qs['fields'](_0x2b0b37['query'][_0x12a1('0x34')]));_0x57e668['attributes']=_0x57e668[_0x12a1('0x33')][_0x12a1('0x35')]?_0x57e668[_0x12a1('0x33')]:_0x19c51c[_0x12a1('0x2e')];if(_0x2b0b37[_0x12a1('0x2f')][_0x12a1('0x3d')]){_0x57e668[_0x12a1('0x3e')]=[{'all':!![]}];}_0x57e668=_[_0x12a1('0x3a')]({},_0x57e668,_0x2b0b37[_0x12a1('0x3c')]);return db[_0x12a1('0x2a')][_0x12a1('0x42')](_0x57e668)[_0x12a1('0x22')](handleEntityNotFound(_0x8ed4e9,null))[_0x12a1('0x22')](respondWithResult(_0x8ed4e9,null))[_0x12a1('0x40')](handleError(_0x8ed4e9,null));};exports[_0x12a1('0x43')]=function(_0x3603d4,_0x4324d5){return db[_0x12a1('0x2a')][_0x12a1('0x43')](_0x3603d4[_0x12a1('0x44')],{})[_0x12a1('0x22')](respondWithResult(_0x4324d5,0xc9))['catch'](handleError(_0x4324d5,null));};exports['update']=function(_0x5e5d5e,_0x51ff92){if(_0x5e5d5e['body']['id']){delete _0x5e5d5e['body']['id'];}return db[_0x12a1('0x2a')][_0x12a1('0x42')]({'where':{'id':_0x5e5d5e[_0x12a1('0x41')]['id']}})['then'](handleEntityNotFound(_0x51ff92,null))['then'](saveUpdates(_0x5e5d5e[_0x12a1('0x44')],null))['then'](respondWithResult(_0x51ff92,null))[_0x12a1('0x40')](handleError(_0x51ff92,null));};exports[_0x12a1('0x23')]=function(_0xcc7f19,_0x1a9e4f){return db[_0x12a1('0x2a')][_0x12a1('0x42')]({'where':{'id':_0xcc7f19[_0x12a1('0x41')]['id']}})[_0x12a1('0x22')](handleEntityNotFound(_0x1a9e4f,null))['then'](removeEntity(_0x1a9e4f,null))['catch'](handleError(_0x1a9e4f,null));}; \ No newline at end of file +var _0x9a44=['sendStatus','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','then'];(function(_0x193c48,_0x37c5c9){var _0x4da99a=function(_0x115344){while(--_0x115344){_0x193c48['push'](_0x193c48['shift']());}};_0x4da99a(++_0x37c5c9);}(_0x9a44,0x156));var _0x49a4=function(_0x4a7491,_0x3d1408){_0x4a7491=_0x4a7491-0x0;var _0x15880f=_0x9a44[_0x4a7491];return _0x15880f;};'use strict';var emlformat=require(_0x49a4('0x0'));var rimraf=require(_0x49a4('0x1'));var zipdir=require(_0x49a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49a4('0x3'));var moment=require(_0x49a4('0x4'));var BPromise=require(_0x49a4('0x5'));var Mustache=require(_0x49a4('0x6'));var util=require(_0x49a4('0x7'));var path=require(_0x49a4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49a4('0x9'));var _=require(_0x49a4('0xa'));var squel=require(_0x49a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x49a4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x49a4('0xd'));var querystring=require(_0x49a4('0xe'));var Papa=require(_0x49a4('0xf'));var Redis=require('ioredis');var authService=require(_0x49a4('0x10'));var qs=require(_0x49a4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49a4('0x12'));var logger=require(_0x49a4('0x13'))('api');var utils=require(_0x49a4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x49a4('0x15'))['db'];function respondWithStatusCode(_0x3a4f45,_0x4ca87b){_0x4ca87b=_0x4ca87b||0xcc;return function(_0x3ea85e){if(_0x3ea85e){return _0x3a4f45['sendStatus'](_0x4ca87b);}return _0x3a4f45[_0x49a4('0x16')](_0x4ca87b)[_0x49a4('0x17')]();};}function respondWithResult(_0x5d534e,_0x3459b2){_0x3459b2=_0x3459b2||0xc8;return function(_0x2e7360){if(_0x2e7360){return _0x5d534e[_0x49a4('0x16')](_0x3459b2)[_0x49a4('0x18')](_0x2e7360);}};}function respondWithFilteredResult(_0x30dfab,_0x13e84b){return function(_0x4d8c96){if(_0x4d8c96){var _0x387257=typeof _0x13e84b['offset']===_0x49a4('0x19')&&typeof _0x13e84b[_0x49a4('0x1a')]===_0x49a4('0x19');var _0x3aeca4=_0x4d8c96['count'];var _0x3adf43=_0x387257?0x0:_0x13e84b['offset'];var _0x98c2fa=_0x387257?_0x4d8c96['count']:_0x13e84b[_0x49a4('0x1b')]+_0x13e84b['limit'];var _0x32aa72;if(_0x98c2fa>=_0x3aeca4){_0x98c2fa=_0x3aeca4;_0x32aa72=0xc8;}else{_0x32aa72=0xce;}_0x30dfab['status'](_0x32aa72);return _0x30dfab[_0x49a4('0x1c')](_0x49a4('0x1d'),_0x3adf43+'-'+_0x98c2fa+'/'+_0x3aeca4)[_0x49a4('0x18')](_0x4d8c96);}return null;};}function patchUpdates(_0x449c73){return function(_0x2f9bc4){try{jsonpatch[_0x49a4('0x1e')](_0x2f9bc4,_0x449c73,!![]);}catch(_0x2dace1){return BPromise['reject'](_0x2dace1);}return _0x2f9bc4[_0x49a4('0x1f')]();};}function saveUpdates(_0x171b5e,_0x6083f2){return function(_0x4134f7){if(_0x4134f7){return _0x4134f7['update'](_0x171b5e)[_0x49a4('0x20')](function(_0x2a823c){return _0x2a823c;});}return null;};}function removeEntity(_0x3e7c41,_0x34b38d){return function(_0x18ff71){if(_0x18ff71){return _0x18ff71['destroy']()['then'](function(){_0x3e7c41[_0x49a4('0x16')](0xcc)[_0x49a4('0x17')]();});}};}function handleEntityNotFound(_0x18d91c,_0x2c8b17){return function(_0x5b96e0){if(!_0x5b96e0){_0x18d91c[_0x49a4('0x21')](0x194);}return _0x5b96e0;};}function handleError(_0x1bf488,_0xeb989b){_0xeb989b=_0xeb989b||0x1f4;return function(_0x4a2020){logger[_0x49a4('0x22')](_0x4a2020['stack']);if(_0x4a2020[_0x49a4('0x23')]){delete _0x4a2020[_0x49a4('0x23')];}_0x1bf488[_0x49a4('0x16')](_0xeb989b)[_0x49a4('0x24')](_0x4a2020);};}exports[_0x49a4('0x25')]=function(_0x5f9cfb,_0x20cd74){var _0x45756b={},_0x5f7cb9={},_0x39d8b0={'count':0x0,'rows':[]};var _0x244556=_[_0x49a4('0x26')](db[_0x49a4('0x27')][_0x49a4('0x28')],function(_0x1717bd){return{'name':_0x1717bd[_0x49a4('0x29')],'type':_0x1717bd[_0x49a4('0x2a')][_0x49a4('0x2b')]};});_0x5f7cb9['model']=_['map'](_0x244556,_0x49a4('0x23'));_0x5f7cb9[_0x49a4('0x2c')]=_[_0x49a4('0x2d')](_0x5f9cfb[_0x49a4('0x2c')]);_0x5f7cb9['filters']=_[_0x49a4('0x2e')](_0x5f7cb9['model'],_0x5f7cb9[_0x49a4('0x2c')]);_0x45756b[_0x49a4('0x2f')]=_[_0x49a4('0x2e')](_0x5f7cb9[_0x49a4('0x30')],qs[_0x49a4('0x31')](_0x5f9cfb[_0x49a4('0x2c')][_0x49a4('0x31')]));_0x45756b[_0x49a4('0x2f')]=_0x45756b[_0x49a4('0x2f')][_0x49a4('0x32')]?_0x45756b[_0x49a4('0x2f')]:_0x5f7cb9[_0x49a4('0x30')];if(!_0x5f9cfb[_0x49a4('0x2c')][_0x49a4('0x33')](_0x49a4('0x34'))){_0x45756b[_0x49a4('0x1a')]=qs[_0x49a4('0x1a')](_0x5f9cfb[_0x49a4('0x2c')][_0x49a4('0x1a')]);_0x45756b['offset']=qs[_0x49a4('0x1b')](_0x5f9cfb['query'][_0x49a4('0x1b')]);}_0x45756b[_0x49a4('0x35')]=qs[_0x49a4('0x36')](_0x5f9cfb[_0x49a4('0x2c')][_0x49a4('0x36')]);_0x45756b[_0x49a4('0x37')]=qs['filters'](_[_0x49a4('0x38')](_0x5f9cfb[_0x49a4('0x2c')],_0x5f7cb9[_0x49a4('0x39')]),_0x244556);if(_0x5f9cfb[_0x49a4('0x2c')][_0x49a4('0x3a')]){_0x45756b[_0x49a4('0x37')]=_[_0x49a4('0x3b')](_0x45756b[_0x49a4('0x37')],{'$or':_[_0x49a4('0x26')](_0x244556,function(_0x3f5a20){if(_0x3f5a20[_0x49a4('0x2a')]!==_0x49a4('0x3c')){var _0x1e8a5e={};_0x1e8a5e[_0x3f5a20[_0x49a4('0x23')]]={'$like':'%'+_0x5f9cfb[_0x49a4('0x2c')][_0x49a4('0x3a')]+'%'};return _0x1e8a5e;}})});}_0x45756b=_[_0x49a4('0x3b')]({},_0x45756b,_0x5f9cfb[_0x49a4('0x3d')]);var _0x1bbcce={'where':_0x45756b['where']};return db[_0x49a4('0x27')]['count'](_0x1bbcce)[_0x49a4('0x20')](function(_0x3098fe){_0x39d8b0[_0x49a4('0x3e')]=_0x3098fe;if(_0x5f9cfb[_0x49a4('0x2c')][_0x49a4('0x3f')]){_0x45756b['include']=[{'all':!![]}];}return db[_0x49a4('0x27')][_0x49a4('0x40')](_0x45756b);})[_0x49a4('0x20')](function(_0x226b96){_0x39d8b0[_0x49a4('0x41')]=_0x226b96;return _0x39d8b0;})[_0x49a4('0x20')](respondWithFilteredResult(_0x20cd74,_0x45756b))[_0x49a4('0x42')](handleError(_0x20cd74,null));};exports[_0x49a4('0x43')]=function(_0xa89340,_0xdff82){var _0x44cec0={'raw':!![],'where':{'id':_0xa89340[_0x49a4('0x44')]['id']}},_0xd9113={};_0xd9113[_0x49a4('0x30')]=_[_0x49a4('0x2d')](db[_0x49a4('0x27')]['rawAttributes']);_0xd9113[_0x49a4('0x2c')]=_[_0x49a4('0x2d')](_0xa89340[_0x49a4('0x2c')]);_0xd9113['filters']=_[_0x49a4('0x2e')](_0xd9113[_0x49a4('0x30')],_0xd9113[_0x49a4('0x2c')]);_0x44cec0[_0x49a4('0x2f')]=_[_0x49a4('0x2e')](_0xd9113['model'],qs['fields'](_0xa89340[_0x49a4('0x2c')][_0x49a4('0x31')]));_0x44cec0[_0x49a4('0x2f')]=_0x44cec0[_0x49a4('0x2f')][_0x49a4('0x32')]?_0x44cec0[_0x49a4('0x2f')]:_0xd9113['model'];if(_0xa89340[_0x49a4('0x2c')][_0x49a4('0x3f')]){_0x44cec0[_0x49a4('0x45')]=[{'all':!![]}];}_0x44cec0=_[_0x49a4('0x3b')]({},_0x44cec0,_0xa89340[_0x49a4('0x3d')]);return db[_0x49a4('0x27')][_0x49a4('0x46')](_0x44cec0)['then'](handleEntityNotFound(_0xdff82,null))['then'](respondWithResult(_0xdff82,null))[_0x49a4('0x42')](handleError(_0xdff82,null));};exports[_0x49a4('0x47')]=function(_0x26e58b,_0x1a205c){return db[_0x49a4('0x27')][_0x49a4('0x47')](_0x26e58b[_0x49a4('0x48')],{})[_0x49a4('0x20')](respondWithResult(_0x1a205c,0xc9))[_0x49a4('0x42')](handleError(_0x1a205c,null));};exports[_0x49a4('0x49')]=function(_0x59feb1,_0x3ae04c){if(_0x59feb1[_0x49a4('0x48')]['id']){delete _0x59feb1[_0x49a4('0x48')]['id'];}return db[_0x49a4('0x27')]['find']({'where':{'id':_0x59feb1[_0x49a4('0x44')]['id']}})[_0x49a4('0x20')](handleEntityNotFound(_0x3ae04c,null))[_0x49a4('0x20')](saveUpdates(_0x59feb1[_0x49a4('0x48')],null))[_0x49a4('0x20')](respondWithResult(_0x3ae04c,null))[_0x49a4('0x42')](handleError(_0x3ae04c,null));};exports[_0x49a4('0x4a')]=function(_0x1a5180,_0x5d47f7){return db['VoiceQueuesLog']['find']({'where':{'id':_0x1a5180[_0x49a4('0x44')]['id']}})[_0x49a4('0x20')](handleEntityNotFound(_0x5d47f7,null))[_0x49a4('0x20')](removeEntity(_0x5d47f7,null))[_0x49a4('0x42')](handleError(_0x5d47f7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 71d2118..7025d4a 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 _0x87f8=['api','moment','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x7214db,_0x12e8d9){var _0x355c19=function(_0x2dc4a5){while(--_0x2dc4a5){_0x7214db['push'](_0x7214db['shift']());}};_0x355c19(++_0x12e8d9);}(_0x87f8,0x152));var _0x887f=function(_0x19e9ef,_0x1c68db){_0x19e9ef=_0x19e9ef-0x0;var _0x3aaf64=_0x87f8[_0x19e9ef];return _0x3aaf64;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x887f('0x0'));var moment=require(_0x887f('0x1'));var BPromise=require('bluebird');var rp=require(_0x887f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x887f('0x3'));var config=require(_0x887f('0x4'));var attributes=require(_0x887f('0x5'));module[_0x887f('0x6')]=function(_0x4f735d,_0x3847b1){return _0x4f735d[_0x887f('0x7')](_0x887f('0x8'),attributes,{'tableName':_0x887f('0x9'),'paranoid':![],'indexes':[{'name':_0x887f('0xa'),'fields':[_0x887f('0xb'),_0x887f('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2297=['define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a3d50,_0x516d5f){var _0x41861b=function(_0x1c3cfe){while(--_0x1c3cfe){_0x2a3d50['push'](_0x2a3d50['shift']());}};_0x41861b(++_0x516d5f);}(_0x2297,0x101));var _0x7229=function(_0x25337a,_0x389454){_0x25337a=_0x25337a-0x0;var _0xe3fbd6=_0x2297[_0x25337a];return _0xe3fbd6;};'use strict';var _=require(_0x7229('0x0'));var util=require('util');var logger=require(_0x7229('0x1'))(_0x7229('0x2'));var moment=require(_0x7229('0x3'));var BPromise=require(_0x7229('0x4'));var rp=require(_0x7229('0x5'));var fs=require('fs');var path=require(_0x7229('0x6'));var rimraf=require(_0x7229('0x7'));var config=require(_0x7229('0x8'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x40d99c,_0x2c0cc5){return _0x40d99c[_0x7229('0x9')](_0x7229('0xa'),attributes,{'tableName':_0x7229('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x7229('0xc'),_0x7229('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index b7665fd..83c20aa 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 _0x02c5=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','catch','lodash','util','bluebird','../../mysqldb','../../config/environment','request','then','info'];(function(_0x1a635e,_0x241651){var _0x5b3345=function(_0x5d94d8){while(--_0x5d94d8){_0x1a635e['push'](_0x1a635e['shift']());}};_0x5b3345(++_0x241651);}(_0x02c5,0x178));var _0x502c=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0x02c5[_0x469ac7];return _0x22f3b0;};'use strict';var _=require(_0x502c('0x0'));var util=require(_0x502c('0x1'));var moment=require('moment');var BPromise=require(_0x502c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x502c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x502c('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b1c5c,_0x42da3a,_0x205346){return new BPromise(function(_0x53818a,_0x969ae0){return client[_0x502c('0x5')](_0x5b1c5c,_0x205346)[_0x502c('0x6')](function(_0x1b942c){logger[_0x502c('0x7')]('VoiceQueuesLog,\x20%s,\x20%s',_0x42da3a,_0x502c('0x8'));logger[_0x502c('0x9')](_0x502c('0xa'),_0x42da3a,_0x502c('0x8'),JSON[_0x502c('0xb')](_0x1b942c));if(_0x1b942c['error']){if(_0x1b942c['error']['code']===0x1f4){logger[_0x502c('0xc')](_0x502c('0xd'),_0x42da3a,_0x1b942c[_0x502c('0xc')][_0x502c('0xe')]);return _0x969ae0(_0x1b942c[_0x502c('0xc')][_0x502c('0xe')]);}logger[_0x502c('0xc')](_0x502c('0xd'),_0x42da3a,_0x1b942c['error']['message']);return _0x53818a(_0x1b942c['error'][_0x502c('0xe')]);}else{logger[_0x502c('0x7')](_0x502c('0xd'),_0x42da3a,'request\x20sent');_0x53818a(_0x1b942c['result'][_0x502c('0xe')]);}})[_0x502c('0xf')](function(_0x461ede){logger[_0x502c('0xc')](_0x502c('0xd'),_0x42da3a,_0x461ede);_0x969ae0(_0x461ede);});});} \ No newline at end of file +var _0x5ce6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x5ce6,0xee));var _0x65ce=function(_0x5224d9,_0x3431c6){_0x5224d9=_0x5224d9-0x0;var _0x421ea3=_0x5ce6[_0x5224d9];return _0x421ea3;};'use strict';var _=require('lodash');var util=require(_0x65ce('0x0'));var moment=require(_0x65ce('0x1'));var BPromise=require(_0x65ce('0x2'));var rs=require(_0x65ce('0x3'));var fs=require('fs');var Redis=require(_0x65ce('0x4'));var db=require(_0x65ce('0x5'))['db'];var utils=require(_0x65ce('0x6'));var logger=require('../../config/logger')(_0x65ce('0x7'));var config=require(_0x65ce('0x8'));var jayson=require(_0x65ce('0x9'));var client=jayson[_0x65ce('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6018,_0x1a3021,_0x4b6ab2){return new BPromise(function(_0x49a56b,_0xc99619){return client['request'](_0x1a6018,_0x4b6ab2)[_0x65ce('0xb')](function(_0x40518d){logger['info'](_0x65ce('0xc'),_0x1a3021,'request\x20sent');logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1a3021,_0x65ce('0xd'),JSON[_0x65ce('0xe')](_0x40518d));if(_0x40518d[_0x65ce('0xf')]){if(_0x40518d[_0x65ce('0xf')]['code']===0x1f4){logger[_0x65ce('0xf')](_0x65ce('0xc'),_0x1a3021,_0x40518d[_0x65ce('0xf')][_0x65ce('0x10')]);return _0xc99619(_0x40518d['error'][_0x65ce('0x10')]);}logger[_0x65ce('0xf')](_0x65ce('0xc'),_0x1a3021,_0x40518d['error'][_0x65ce('0x10')]);return _0x49a56b(_0x40518d[_0x65ce('0xf')]['message']);}else{logger[_0x65ce('0x11')](_0x65ce('0xc'),_0x1a3021,_0x65ce('0xd'));_0x49a56b(_0x40518d[_0x65ce('0x12')]['message']);}})[_0x65ce('0x13')](function(_0xd5205b){logger[_0x65ce('0xf')](_0x65ce('0xc'),_0x1a3021,_0xd5205b);_0xc99619(_0xd5205b);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 18fffea..7906b14 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 _0x6626=['express','Router','../../components/auth/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x21fac,_0x10c3b1){var _0x415527=function(_0x4317df){while(--_0x4317df){_0x21fac['push'](_0x21fac['shift']());}};_0x415527(++_0x10c3b1);}(_0x6626,0x19d));var _0x6662=function(_0x3d2b7a,_0x5a56bf){_0x3d2b7a=_0x3d2b7a-0x0;var _0x45c407=_0x6626[_0x3d2b7a];return _0x45c407;};'use strict';var multer=require(_0x6662('0x0'));var util=require('util');var path=require(_0x6662('0x1'));var timeout=require(_0x6662('0x2'));var express=require(_0x6662('0x3'));var router=express[_0x6662('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6662('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6662('0x6'));router[_0x6662('0x7')]('/',auth[_0x6662('0x8')](),controller[_0x6662('0x9')]);router['get'](_0x6662('0xa'),auth[_0x6662('0x8')](),controller[_0x6662('0xb')]);router[_0x6662('0x7')](_0x6662('0xc'),auth[_0x6662('0x8')](),controller[_0x6662('0xd')]);router[_0x6662('0x7')]('/:id/download',auth[_0x6662('0x8')](),controller[_0x6662('0xe')]);router[_0x6662('0x7')](_0x6662('0xf'),controller[_0x6662('0x10')]);router['get'](_0x6662('0x11'),auth[_0x6662('0x8')](),controller[_0x6662('0x12')]);router[_0x6662('0x13')]('/',auth[_0x6662('0x8')](),controller[_0x6662('0x14')]);router[_0x6662('0x13')](_0x6662('0x11'),auth['isAuthenticated'](),controller[_0x6662('0x15')]);router['put'](_0x6662('0xc'),auth[_0x6662('0x8')](),controller[_0x6662('0x16')]);router[_0x6662('0x17')]('/:id',auth[_0x6662('0x8')](),controller[_0x6662('0x18')]);module[_0x6662('0x19')]=router; \ No newline at end of file +var _0x072f=['../../config/environment','./voiceRecording.controller','get','isAuthenticated','describe','show','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xda9295,_0x4850b4){var _0xd73c7f=function(_0xf192dd){while(--_0xf192dd){_0xda9295['push'](_0xda9295['shift']());}};_0xd73c7f(++_0x4850b4);}(_0x072f,0x164));var _0xf072=function(_0x59d135,_0x261a80){_0x59d135=_0x59d135-0x0;var _0x59d946=_0x072f[_0x59d135];return _0x59d946;};'use strict';var multer=require(_0xf072('0x0'));var util=require(_0xf072('0x1'));var path=require(_0xf072('0x2'));var timeout=require(_0xf072('0x3'));var express=require(_0xf072('0x4'));var router=express[_0xf072('0x5')]();var fs_extra=require(_0xf072('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf072('0x7'));var config=require(_0xf072('0x8'));var controller=require(_0xf072('0x9'));router[_0xf072('0xa')]('/',auth[_0xf072('0xb')](),controller['index']);router[_0xf072('0xa')]('/describe',auth[_0xf072('0xb')](),controller[_0xf072('0xc')]);router[_0xf072('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf072('0xd')]);router[_0xf072('0xa')]('/:id/download',auth[_0xf072('0xb')](),controller[_0xf072('0xe')]);router[_0xf072('0xa')](_0xf072('0xf'),controller[_0xf072('0x10')]);router[_0xf072('0xa')]('/:id/transcribe',auth[_0xf072('0xb')](),controller[_0xf072('0x11')]);router[_0xf072('0x12')]('/',auth['isAuthenticated'](),controller[_0xf072('0x13')]);router[_0xf072('0x12')](_0xf072('0x14'),auth[_0xf072('0xb')](),controller[_0xf072('0x15')]);router[_0xf072('0x16')](_0xf072('0x17'),auth[_0xf072('0xb')](),controller[_0xf072('0x18')]);router['delete'](_0xf072('0x17'),auth['isAuthenticated'](),controller['destroy']);module[_0xf072('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 146e042..03f6092 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(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 6d807d6..ec5f4e2 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 _0x49e6=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','VoiceRecording','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','describe','../../components/encryptor','uniqueid','%s.cypher','existsSync','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','format','secrets','isNil','Entity\x20not\x20found','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','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','aws-sdk','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49e6,0x10d));var _0x649e=function(_0x206e46,_0x12e48d){_0x206e46=_0x206e46-0x0;var _0x4d5be7=_0x49e6[_0x206e46];return _0x4d5be7;};'use strict';var emlformat=require(_0x649e('0x0'));var rimraf=require(_0x649e('0x1'));var zipdir=require(_0x649e('0x2'));var jsonpatch=require(_0x649e('0x3'));var rp=require(_0x649e('0x4'));var moment=require(_0x649e('0x5'));var BPromise=require(_0x649e('0x6'));var Mustache=require(_0x649e('0x7'));var util=require(_0x649e('0x8'));var path=require(_0x649e('0x9'));var sox=require(_0x649e('0xa'));var csv=require(_0x649e('0xb'));var ejs=require(_0x649e('0xc'));var fs=require('fs');var fs_extra=require(_0x649e('0xd'));var _=require(_0x649e('0xe'));var squel=require('squel');var crypto=require(_0x649e('0xf'));var jsforce=require(_0x649e('0x10'));var deskjs=require(_0x649e('0x11'));var toCsv=require('to-csv');var querystring=require(_0x649e('0x12'));var Papa=require(_0x649e('0x13'));var AWS=require(_0x649e('0x14'));var uuidv4=require(_0x649e('0x15'));var Redis=require(_0x649e('0x16'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x649e('0x17'));var hardwareService=require(_0x649e('0x18'));var logger=require(_0x649e('0x19'))(_0x649e('0x1a'));var utils=require(_0x649e('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x649e('0x1c'));var db=require(_0x649e('0x1d'))['db'];function respondWithStatusCode(_0x361d3b,_0x2a8ec0){_0x2a8ec0=_0x2a8ec0||0xcc;return function(_0x49ae44){if(_0x49ae44){return _0x361d3b[_0x649e('0x1e')](_0x2a8ec0);}return _0x361d3b[_0x649e('0x1f')](_0x2a8ec0)[_0x649e('0x20')]();};}function respondWithResult(_0x3fbe96,_0x312fe2){_0x312fe2=_0x312fe2||0xc8;return function(_0x560443){if(_0x560443){return _0x3fbe96[_0x649e('0x1f')](_0x312fe2)[_0x649e('0x21')](_0x560443);}};}function respondWithFilteredResult(_0x4e78d1,_0x6dbd71){return function(_0x326647){if(_0x326647){var _0x223864=typeof _0x6dbd71[_0x649e('0x22')]==='undefined'&&typeof _0x6dbd71[_0x649e('0x23')]===_0x649e('0x24');var _0x8e2187=_0x326647[_0x649e('0x25')];var _0x44fee9=_0x223864?0x0:_0x6dbd71[_0x649e('0x22')];var _0x589bdc=_0x223864?_0x326647[_0x649e('0x25')]:_0x6dbd71['offset']+_0x6dbd71[_0x649e('0x23')];var _0x215f53;if(_0x589bdc>=_0x8e2187){_0x589bdc=_0x8e2187;_0x215f53=0xc8;}else{_0x215f53=0xce;}_0x4e78d1[_0x649e('0x1f')](_0x215f53);return _0x4e78d1[_0x649e('0x26')]('Content-Range',_0x44fee9+'-'+_0x589bdc+'/'+_0x8e2187)[_0x649e('0x21')](_0x326647);}return null;};}function patchUpdates(_0x4516e3){return function(_0x4c1564){try{jsonpatch[_0x649e('0x27')](_0x4c1564,_0x4516e3,!![]);}catch(_0x6dff22){return BPromise[_0x649e('0x28')](_0x6dff22);}return _0x4c1564['save']();};}function saveUpdates(_0x2d9763,_0x172d28){return function(_0x1e462f){if(_0x1e462f){return _0x1e462f[_0x649e('0x29')](_0x2d9763)[_0x649e('0x2a')](function(_0x570be4){return _0x570be4;});}return null;};}function removeEntity(_0x4f304a,_0x3ccdbf){return function(_0x51c593){if(_0x51c593){return _0x51c593[_0x649e('0x2b')]()['then'](function(){_0x4f304a[_0x649e('0x1f')](0xcc)[_0x649e('0x20')]();});}};}function handleEntityNotFound(_0x2fc585,_0x291eff){return function(_0x4a1a77){if(!_0x4a1a77){_0x2fc585['sendStatus'](0x194);}return _0x4a1a77;};}function handleError(_0x376b30,_0x39daa9){_0x39daa9=_0x39daa9||0x1f4;return function(_0x49dffc){logger[_0x649e('0x2c')](_0x49dffc[_0x649e('0x2d')]);if(_0x49dffc[_0x649e('0x2e')]){delete _0x49dffc[_0x649e('0x2e')];}_0x376b30[_0x649e('0x1f')](_0x39daa9)['send'](_0x49dffc);};}exports[_0x649e('0x2f')]=function(_0x5257dc,_0x5946a1){var _0x53fc9a={},_0x19c42d={},_0x2426dc={'count':0x0,'rows':[]};var _0x24cdff=_[_0x649e('0x30')](db[_0x649e('0x31')]['rawAttributes'],function(_0x5c2faf){return{'name':_0x5c2faf[_0x649e('0x32')],'type':_0x5c2faf[_0x649e('0x33')][_0x649e('0x34')]};});_0x19c42d[_0x649e('0x35')]=_['differenceBy'](_['map'](_0x24cdff,_0x649e('0x2e')),['format']);_0x19c42d['query']=_['keys'](_0x5257dc[_0x649e('0x36')]);_0x19c42d[_0x649e('0x37')]=_[_0x649e('0x38')](_0x19c42d[_0x649e('0x35')],_0x19c42d[_0x649e('0x36')]);_0x53fc9a[_0x649e('0x39')]=_[_0x649e('0x38')](_0x19c42d[_0x649e('0x35')],qs[_0x649e('0x3a')](_0x5257dc[_0x649e('0x36')][_0x649e('0x3a')]));_0x53fc9a[_0x649e('0x39')]=_0x53fc9a[_0x649e('0x39')]['length']?_0x53fc9a[_0x649e('0x39')]:_0x19c42d[_0x649e('0x35')];if(!_0x5257dc[_0x649e('0x36')]['hasOwnProperty'](_0x649e('0x3b'))){_0x53fc9a[_0x649e('0x23')]=qs['limit'](_0x5257dc['query']['limit']);_0x53fc9a[_0x649e('0x22')]=qs['offset'](_0x5257dc[_0x649e('0x36')][_0x649e('0x22')]);}_0x53fc9a[_0x649e('0x3c')]=qs[_0x649e('0x3d')](_0x5257dc['query']['sort']);_0x53fc9a[_0x649e('0x3e')]=qs[_0x649e('0x37')](_[_0x649e('0x3f')](_0x5257dc[_0x649e('0x36')],_0x19c42d[_0x649e('0x37')]),_0x24cdff);if(_0x5257dc[_0x649e('0x36')][_0x649e('0x40')]){_0x53fc9a[_0x649e('0x3e')]=_[_0x649e('0x41')](_0x53fc9a[_0x649e('0x3e')],{'$or':_[_0x649e('0x30')](_0x24cdff,function(_0x369771){if(_0x369771[_0x649e('0x33')]!==_0x649e('0x42')){var _0x54e5c5={};_0x54e5c5[_0x369771[_0x649e('0x2e')]]={'$like':'%'+_0x5257dc[_0x649e('0x36')][_0x649e('0x40')]+'%'};return _0x54e5c5;}})});}_0x53fc9a=_['merge']({},_0x53fc9a,_0x5257dc['options']);var _0x33c36a={'where':_0x53fc9a[_0x649e('0x3e')]};return db[_0x649e('0x31')][_0x649e('0x25')](_0x33c36a)['then'](function(_0x3f4074){_0x2426dc['count']=_0x3f4074;if(_0x5257dc['query'][_0x649e('0x43')]){_0x53fc9a[_0x649e('0x44')]=[{'all':!![]}];}return db[_0x649e('0x31')][_0x649e('0x45')](_0x53fc9a);})['then'](function(_0xfb7ff7){_0x2426dc['rows']=_0xfb7ff7;return _0x2426dc;})[_0x649e('0x2a')](respondWithFilteredResult(_0x5946a1,_0x53fc9a))[_0x649e('0x46')](handleError(_0x5946a1,null));};exports['show']=function(_0x5dfc6c,_0x39baf2){var _0x123c7a={'raw':![],'where':{'id':_0x5dfc6c[_0x649e('0x47')]['id']}},_0x1a37da={};_0x1a37da[_0x649e('0x35')]=_[_0x649e('0x48')](db[_0x649e('0x31')][_0x649e('0x49')]);_0x1a37da[_0x649e('0x36')]=_[_0x649e('0x48')](_0x5dfc6c[_0x649e('0x36')]);_0x1a37da[_0x649e('0x37')]=_[_0x649e('0x38')](_0x1a37da[_0x649e('0x35')],_0x1a37da[_0x649e('0x36')]);_0x123c7a[_0x649e('0x39')]=_[_0x649e('0x38')](_0x1a37da['model'],qs['fields'](_0x5dfc6c['query'][_0x649e('0x3a')]));_0x123c7a[_0x649e('0x39')]=_0x123c7a[_0x649e('0x39')]['length']?_0x123c7a[_0x649e('0x39')]:_0x1a37da[_0x649e('0x35')];if(_0x5dfc6c['query'][_0x649e('0x43')]){_0x123c7a['include']=[{'all':!![]}];}_0x123c7a=_[_0x649e('0x41')]({},_0x123c7a,_0x5dfc6c['options']);return db[_0x649e('0x31')][_0x649e('0x4a')](_0x123c7a)[_0x649e('0x2a')](handleEntityNotFound(_0x39baf2,null))[_0x649e('0x2a')](respondWithResult(_0x39baf2,null))['catch'](handleError(_0x39baf2,null));};exports[_0x649e('0x4b')]=function(_0xca8e19,_0x435b2d){return db['VoiceRecording'][_0x649e('0x4b')](_0xca8e19[_0x649e('0x4c')],{})[_0x649e('0x2a')](respondWithResult(_0x435b2d,0xc9))[_0x649e('0x46')](handleError(_0x435b2d,null));};exports[_0x649e('0x29')]=function(_0x1dfaae,_0x53ef0c){if(_0x1dfaae[_0x649e('0x4c')]['id']){delete _0x1dfaae['body']['id'];}return db[_0x649e('0x31')][_0x649e('0x4a')]({'where':{'id':_0x1dfaae[_0x649e('0x47')]['id']}})[_0x649e('0x2a')](handleEntityNotFound(_0x53ef0c,null))[_0x649e('0x2a')](saveUpdates(_0x1dfaae['body'],null))[_0x649e('0x2a')](respondWithResult(_0x53ef0c,null))[_0x649e('0x46')](handleError(_0x53ef0c,null));};exports[_0x649e('0x4d')]=function(_0x598ec4,_0x358e82){return db[_0x649e('0x31')]['describe']()[_0x649e('0x2a')](respondWithResult(_0x358e82,null))[_0x649e('0x46')](handleError(_0x358e82,null));};exports['download']=function(_0x4e99b3,_0x33cb56,_0x5e7009){var _0x52b2b5=require(_0x649e('0x4e'));var _0x1fb51c=![];var _0x238f3d={};if(_0x4e99b3['query'][_0x649e('0x33')]&&_0x4e99b3['query'][_0x649e('0x33')]===_0x649e('0x4f')){_0x238f3d['uniqueid']=_0x4e99b3[_0x649e('0x47')]['id'];}else{_0x238f3d['id']=_0x4e99b3[_0x649e('0x47')]['id'];}return db['VoiceRecording'][_0x649e('0x4a')]({'where':_0x238f3d,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x33cb56,null))[_0x649e('0x2a')](function(_0x2cfd51){if(_0x2cfd51){var _0x467a43=_0x2cfd51['value'];var _0x192405=util['format'](_0x649e('0x50'),_0x467a43);if(fs[_0x649e('0x51')](_0x192405)){_0x1fb51c=!![];return _0x52b2b5['decryptFile'](_0x192405,_0x467a43,config['secrets'][_0x649e('0x52')])[_0x649e('0x2a')](function(){return _0x2cfd51;});}return _0x2cfd51;}})[_0x649e('0x2a')](function(_0x28d27f){if(_0x28d27f){var _0xb018ea=_0x28d27f[_0x649e('0x53')];if(!fs[_0x649e('0x51')](_0xb018ea)){throw new db[(_0x649e('0x54'))][(_0x649e('0x55'))](_0x649e('0x56'));}if(_0x28d27f[_0x649e('0x57')]){return _0x33cb56['download'](_0xb018ea,_0x28d27f['filename']+path[_0x649e('0x58')](_0xb018ea),function(){if(_0x1fb51c){fs[_0x649e('0x59')](_0xb018ea);}});}else{return _0x33cb56[_0x649e('0x5a')](_0xb018ea,function(_0x3f109a){if(_0x1fb51c){fs[_0x649e('0x59')](_0xb018ea);}});}}})[_0x649e('0x46')](function(_0x4ab561){if(_0x4ab561[_0x649e('0x5b')]===_0x649e('0x56')){_0x33cb56[_0x649e('0x1f')](0x194)['send'](_0x649e('0x5c'));}else{return handleError(_0x33cb56,null);}});};exports[_0x649e('0x5d')]=function(_0x5a3d12,_0x53f310,_0x31e065){var _0xca7326=require('../../components/encryptor');var _0x19f6e4=![];var _0x427d64={'$and':[db[_0x649e('0x5e')]['where'](db[_0x649e('0x5e')]['fn'](_0x649e('0x5f'),db[_0x649e('0x5e')][_0x649e('0x60')](_0x649e('0x4f'))),_0x5a3d12[_0x649e('0x36')]['token'])]};if(_0x5a3d12[_0x649e('0x36')][_0x649e('0x33')]&&_0x5a3d12[_0x649e('0x36')][_0x649e('0x33')]===_0x649e('0x4f')){_0x427d64[_0x649e('0x61')]['push']({'uniqueid':_0x5a3d12[_0x649e('0x47')]['id']});}else{_0x427d64[_0x649e('0x61')][_0x649e('0x62')]({'id':_0x5a3d12[_0x649e('0x47')]['id']});}return db[_0x649e('0x31')]['find']({'where':_0x427d64,'attributes':['id',_0x649e('0x53')],'raw':!![]})[_0x649e('0x2a')](handleEntityNotFound(_0x53f310,null))['then'](function(_0xe0ce4c){if(_0xe0ce4c){var _0x403fc7=util[_0x649e('0x63')](_0x649e('0x50'),_0xe0ce4c[_0x649e('0x53')]);if(fs[_0x649e('0x51')](_0x403fc7)){_0x19f6e4=!![];return _0xca7326['decryptFile'](_0x403fc7,_0xe0ce4c['value'],config[_0x649e('0x64')]['recording'])[_0x649e('0x2a')](function(){return _0xe0ce4c;});}return _0xe0ce4c;}})[_0x649e('0x2a')](function(_0x1903b){if(_0x1903b){if(!fs['existsSync'](_0x1903b[_0x649e('0x53')])){throw new db['Sequelize'][(_0x649e('0x55'))](_0x649e('0x56'));}if(_0x1903b[_0x649e('0x57')]){return _0x53f310[_0x649e('0x5a')](_0x1903b[_0x649e('0x53')],_0x1903b[_0x649e('0x57')]+path[_0x649e('0x58')](_0x1903b['value']),function(){if(_0x19f6e4){fs[_0x649e('0x59')](_0x1903b['value']);}});}else{return _0x53f310['download'](_0x1903b[_0x649e('0x53')],function(_0x223285){if(_0x19f6e4){fs[_0x649e('0x59')](_0x1903b[_0x649e('0x53')]);}});}}})[_0x649e('0x46')](handleError(_0x53f310,null));};exports[_0x649e('0x2b')]=function(_0x1151fa,_0x47ebcb){return db[_0x649e('0x31')][_0x649e('0x4a')]({'where':{'id':_0x1151fa['params']['id']}})[_0x649e('0x2a')](function(_0x536d03){if(_[_0x649e('0x65')](_0x536d03)){throw new ReferenceError(_0x649e('0x66'));}return _0x536d03;})[_0x649e('0x2a')](function(_0x42fac4){var _0x5109dd=_0x42fac4[_0x649e('0x53')];logger[_0x649e('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x5109dd);if(!_[_0x649e('0x65')](_0x42fac4[_0x649e('0x53')])&&fs[_0x649e('0x51')](_0x5109dd)){logger[_0x649e('0x67')]('File:\x20\x22'+_0x5109dd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x649e('0x68')](_0x5109dd);}_0x5109dd=_0x5109dd+_0x649e('0x69');if(!_['isNil'](_0x42fac4['value'])&&fs[_0x649e('0x51')](_0x5109dd)){logger[_0x649e('0x67')](_0x649e('0x6a')+_0x5109dd+_0x649e('0x6b'));fs['unlinkSync'](_0x5109dd);}return _0x42fac4;})[_0x649e('0x2a')](function(_0x320088){if(!_0x320088)throw new InternalError();return _0x320088[_0x649e('0x2b')]();})['then'](function(){_0x47ebcb[_0x649e('0x1f')](0xcc)[_0x649e('0x20')]();})[_0x649e('0x46')](handleError(_0x47ebcb,null));};function getBucketslist(_0xcb119e,_0x4cccee,_0x715db2){return new Promise(function(_0x2accc3,_0x3139aa){var _0x56ee71=new AWS['S3']({'accessKeyId':_0x4cccee,'secretAccessKey':_0xcb119e,'region':_0x715db2});_0x56ee71[_0x649e('0x6c')]({},function(_0x27b4d7,_0x3306f0){if(_0x27b4d7){return _0x3139aa(_0x27b4d7);}else{return _0x2accc3(_0x3306f0);}});});}function createBucket(_0x5cc2f1,_0x5cd9b7,_0x5d026b,_0x22e87f){return new Promise(function(_0x3d1990,_0x28c55b){var _0x5c4f1f=new AWS['S3']({'accessKeyId':_0x5cd9b7,'secretAccessKey':_0x5cc2f1,'region':_0x5d026b});_0x5c4f1f['createBucket']({'Bucket':_0x22e87f},function(_0x2e47db,_0x21a8df){if(_0x2e47db){return _0x28c55b(_0x2e47db);}else{return _0x3d1990(_0x21a8df);}});});}function uploadFile(_0x2c85ea,_0x22184c,_0x43ac37,_0x14e1bb,_0x319fcf,_0x185c74){return new Promise(function(_0x22290b,_0x3b1886){var _0x1ebb13=new AWS['S3']({'accessKeyId':_0x22184c,'secretAccessKey':_0x2c85ea,'region':_0x43ac37});_0x1ebb13[_0x649e('0x6d')]({'Bucket':_0x14e1bb,'Key':_0x319fcf,'Body':_0x185c74},function(_0x4cb6b1,_0x220159){if(_0x4cb6b1){return _0x3b1886(_0x4cb6b1);}else{return _0x22290b(_0x220159);}});});}function startTranscribe(_0x521a00,_0x5de308,_0x531113,_0x2210ab,_0x141f09,_0x4f9632){return new Promise(function(_0xd97435,_0x542980){var _0xdef84c=new AWS[(_0x649e('0x6e'))]({'accessKeyId':_0x5de308,'secretAccessKey':_0x521a00,'region':_0x531113});_0xdef84c['startTranscriptionJob']({'TranscriptionJobName':_0x2210ab,'LanguageCode':_0x141f09,'Media':{'MediaFileUri':_0x4f9632}},function(_0x11aea1,_0x390a4f){if(_0x11aea1){return _0x542980(_0x11aea1);}else{return _0xd97435(_0x390a4f);}});});}function transcribe(_0x474b46,_0x462d54,_0x1650ad,_0x1b2ee8,_0x3d835d,_0x1f2ae1,_0x5a119b){return new Promise(function(_0x2509a9,_0x5cbd14){var _0x15ee0f={};logger[_0x649e('0x67')](util[_0x649e('0x63')](_0x649e('0x6f'),_0x474b46,_0x3d835d));return uploadFile(_0x462d54,_0x1650ad,_0x1b2ee8,_0x3d835d,path[_0x649e('0x70')](_0x1f2ae1),fs['readFileSync'](_0x1f2ae1))[_0x649e('0x2a')](function(_0x5864dc){logger[_0x649e('0x67')](util[_0x649e('0x63')](_0x649e('0x71'),_0x474b46,_0x3d835d,_0x5864dc[_0x649e('0x72')]));_0x15ee0f[_0x649e('0x73')]=_0x5864dc[_0x649e('0x74')];_0x15ee0f[_0x649e('0x75')]=_0x5864dc[_0x649e('0x72')];logger['info'](util[_0x649e('0x63')](_0x649e('0x76'),_0x474b46));return startTranscribe(_0x462d54,_0x1650ad,_0x1b2ee8,uuidv4(),_0x5a119b,_0x5864dc[_0x649e('0x72')]);})[_0x649e('0x2a')](function(_0x5c18a1){logger[_0x649e('0x67')](util[_0x649e('0x63')](_0x649e('0x77'),_0x474b46,_0x5c18a1[_0x649e('0x78')][_0x649e('0x79')]));_0x15ee0f[_0x649e('0x7a')]=_0x5c18a1[_0x649e('0x78')][_0x649e('0x79')];_0x15ee0f[_0x649e('0x7b')]=_0x5c18a1[_0x649e('0x78')][_0x649e('0x7c')];return _0x2509a9(_0x15ee0f);})[_0x649e('0x46')](function(_0x1d3b35){return _0x5cbd14(_0x1d3b35);});});}exports[_0x649e('0x7d')]=function(_0x536a46,_0x415f47,_0x6fb510){var _0x31af33;var _0x357632;var _0x47faaf;var _0x434a8f=require(_0x649e('0x4e'));return db['VoiceRecording'][_0x649e('0x7e')]({'where':{'id':_0x536a46['params']['id']}})[_0x649e('0x2a')](function(_0x3ed9cf){if(_0x3ed9cf){var _0x56fabf=util[_0x649e('0x63')](_0x649e('0x50'),_0x3ed9cf[_0x649e('0x53')]);if(fs['existsSync'](_0x56fabf)){cypher=!![];return _0x434a8f['decryptFile'](_0x56fabf,_0x3ed9cf[_0x649e('0x53')],config[_0x649e('0x64')][_0x649e('0x52')])['then'](function(){return _0x3ed9cf;});}return _0x3ed9cf;}})[_0x649e('0x2a')](function(_0x1b2b54){if(!_0x1b2b54){throw new db['Sequelize'][(_0x649e('0x55'))](_0x649e('0x7f'));}_0x357632=_0x1b2b54;return db['Setting'][_0x649e('0x7e')]({'where':{'id':0x1}});})[_0x649e('0x2a')](handleEntityNotFound(_0x415f47,null))[_0x649e('0x2a')](function(_0x389852){if(_0x389852){_0x31af33=_0x389852;if(!_0x31af33['transcribe']||!_0x31af33[_0x649e('0x80')]||!_0x31af33[_0x649e('0x81')]||!_0x31af33[_0x649e('0x82')]||!_0x31af33[_0x649e('0x73')]){throw new db[(_0x649e('0x54'))][(_0x649e('0x55'))](_0x649e('0x83'));}if(_0x536a46[_0x649e('0x4c')]['runSentiment']&&(!_0x31af33[_0x649e('0x84')]||!_0x31af33[_0x649e('0x85')]||!_0x31af33['sentimentRegion']||!_0x31af33[_0x649e('0x82')]||!_0x31af33['bucket'])){throw new db[(_0x649e('0x54'))][(_0x649e('0x55'))](_0x649e('0x86'));}return db['CloudProvider'][_0x649e('0x7e')]({'where':{'id':_0x31af33[_0x649e('0x80')]}});}})[_0x649e('0x2a')](function(_0x349a43){if(!_0x349a43){throw new db[(_0x649e('0x54'))][(_0x649e('0x55'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x349a43[_0x649e('0x87')]||!_0x349a43[_0x649e('0x88')]){throw new db[(_0x649e('0x54'))]['ValidationError'](_0x649e('0x89'));}_0x47faaf=_0x349a43;return getBucketslist(_0x47faaf[_0x649e('0x87')],_0x47faaf[_0x649e('0x88')],_0x31af33[_0x649e('0x81')]);})[_0x649e('0x2a')](function(_0x5ad564){if(_0x5ad564&&_0x5ad564[_0x649e('0x8a')]){var _0x40d3e9=_[_0x649e('0x4a')](_0x5ad564[_0x649e('0x8a')],function(_0xaa02ae){return _0xaa02ae[_0x649e('0x8b')]===_0x31af33['bucket'];});if(!_0x40d3e9){logger[_0x649e('0x67')](util[_0x649e('0x63')](_0x649e('0x8c'),_0x536a46[_0x649e('0x47')]['id'],_0x31af33['bucket']));return createBucket(_0x47faaf[_0x649e('0x87')],_0x47faaf[_0x649e('0x88')],_0x31af33[_0x649e('0x81')],_0x31af33[_0x649e('0x73')]);}logger[_0x649e('0x67')](util[_0x649e('0x63')](_0x649e('0x8d'),_0x536a46[_0x649e('0x47')]['id'],_0x31af33[_0x649e('0x73')]));return;}})['then'](function(_0x2018fe){if(_0x357632[_0x649e('0x7b')]==='NEW'){return transcribe(_0x536a46['params']['id'],_0x47faaf[_0x649e('0x87')],_0x47faaf[_0x649e('0x88')],_0x31af33[_0x649e('0x81')],_0x31af33[_0x649e('0x73')],_0x357632['value'],_0x31af33[_0x649e('0x82')]);}else{logger[_0x649e('0x67')](util[_0x649e('0x63')](_0x649e('0x8e'),_0x536a46[_0x649e('0x47')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x649e('0x2a')](function(_0x7cbbc){if(_0x7cbbc){_0x7cbbc[_0x649e('0x8f')]=_0x536a46[_0x649e('0x4c')]['runSentiment'];return _0x357632[_0x649e('0x90')](_0x7cbbc);}})['then'](respondWithResult(_0x415f47,null))[_0x649e('0x46')](handleError(_0x415f47,null));};function writeFile(_0x5345b5,_0x54910f){return new Promise(function(_0x12717f,_0x2952f7){fs[_0x649e('0x91')](_0x54910f,_0x5345b5,function(_0x59e88f,_0xa50c73){if(_0x59e88f){return _0x2952f7(_0x59e88f);}else{return _0x12717f(_0xa50c73);}});});}exports['downloadTranscribe']=function(_0x36ab53,_0x23c977,_0x434e61){return db[_0x649e('0x31')][_0x649e('0x7e')]({'where':{'id':_0x36ab53[_0x649e('0x47')]['id']}})[_0x649e('0x2a')](handleEntityNotFound(_0x23c977))[_0x649e('0x2a')](function(_0x47ba50){if(_0x47ba50&&_0x47ba50[_0x649e('0x92')]){var _0x3999d8=_0x47ba50[_0x649e('0x92')];var _0x19cffa=config[_0x649e('0x93')]+_0x649e('0x94')+_0x47ba50['id']+'.txt';if(fs[_0x649e('0x51')](_0x19cffa)){return _0x19cffa;}return writeFile(_0x3999d8,_0x19cffa)[_0x649e('0x2a')](function(){return _0x19cffa;});}else{throw new db[(_0x649e('0x54'))][(_0x649e('0x55'))]('Transcript\x20not\x20available');}})[_0x649e('0x2a')](function(_0x5aa3bd){return _0x23c977[_0x649e('0x5a')](_0x5aa3bd);})[_0x649e('0x46')](handleError(_0x23c977));}; \ No newline at end of file +var _0x6545=['transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','reject','save','then','sendStatus','error','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','create','body','update','find','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token','push','$and','existsSync','recording','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','Bucket','Location','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0x6545,0x1dc));var _0x5654=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6545[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x5654('0x0'));var rimraf=require(_0x5654('0x1'));var zipdir=require(_0x5654('0x2'));var jsonpatch=require(_0x5654('0x3'));var rp=require(_0x5654('0x4'));var moment=require('moment');var BPromise=require(_0x5654('0x5'));var Mustache=require(_0x5654('0x6'));var util=require(_0x5654('0x7'));var path=require('path');var sox=require(_0x5654('0x8'));var csv=require(_0x5654('0x9'));var ejs=require(_0x5654('0xa'));var fs=require('fs');var fs_extra=require(_0x5654('0xb'));var _=require('lodash');var squel=require(_0x5654('0xc'));var crypto=require(_0x5654('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5654('0xe'));var toCsv=require(_0x5654('0x9'));var querystring=require(_0x5654('0xf'));var Papa=require(_0x5654('0x10'));var AWS=require(_0x5654('0x11'));var uuidv4=require(_0x5654('0x12'));var Redis=require(_0x5654('0x13'));var authService=require(_0x5654('0x14'));var qs=require(_0x5654('0x15'));var as=require(_0x5654('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5654('0x17'));var utils=require(_0x5654('0x18'));var config=require(_0x5654('0x19'));var licenseUtil=require(_0x5654('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x293dda,_0x26df5e){_0x26df5e=_0x26df5e||0xcc;return function(_0x17a0c2){if(_0x17a0c2){return _0x293dda['sendStatus'](_0x26df5e);}return _0x293dda[_0x5654('0x1b')](_0x26df5e)[_0x5654('0x1c')]();};}function respondWithResult(_0x1bca6d,_0x5ef6bc){_0x5ef6bc=_0x5ef6bc||0xc8;return function(_0x486067){if(_0x486067){return _0x1bca6d['status'](_0x5ef6bc)[_0x5654('0x1d')](_0x486067);}};}function respondWithFilteredResult(_0xf3b741,_0x2ec36b){return function(_0x1a7a35){if(_0x1a7a35){var _0x11aa37=typeof _0x2ec36b[_0x5654('0x1e')]===_0x5654('0x1f')&&typeof _0x2ec36b['limit']==='undefined';var _0x5d536b=_0x1a7a35['count'];var _0x48e213=_0x11aa37?0x0:_0x2ec36b[_0x5654('0x1e')];var _0x299b71=_0x11aa37?_0x1a7a35[_0x5654('0x20')]:_0x2ec36b[_0x5654('0x1e')]+_0x2ec36b[_0x5654('0x21')];var _0x4b5133;if(_0x299b71>=_0x5d536b){_0x299b71=_0x5d536b;_0x4b5133=0xc8;}else{_0x4b5133=0xce;}_0xf3b741[_0x5654('0x1b')](_0x4b5133);return _0xf3b741[_0x5654('0x22')]('Content-Range',_0x48e213+'-'+_0x299b71+'/'+_0x5d536b)['json'](_0x1a7a35);}return null;};}function patchUpdates(_0x535054){return function(_0xd3b93d){try{jsonpatch['apply'](_0xd3b93d,_0x535054,!![]);}catch(_0x8c673a){return BPromise[_0x5654('0x23')](_0x8c673a);}return _0xd3b93d[_0x5654('0x24')]();};}function saveUpdates(_0x1f9d92,_0x59fc9d){return function(_0x22de86){if(_0x22de86){return _0x22de86['update'](_0x1f9d92)[_0x5654('0x25')](function(_0x16b2b9){return _0x16b2b9;});}return null;};}function removeEntity(_0x88957f,_0x5cc5a6){return function(_0x1eb7a6){if(_0x1eb7a6){return _0x1eb7a6['destroy']()[_0x5654('0x25')](function(){_0x88957f['status'](0xcc)[_0x5654('0x1c')]();});}};}function handleEntityNotFound(_0x20281b,_0x3c5631){return function(_0x1fa342){if(!_0x1fa342){_0x20281b[_0x5654('0x26')](0x194);}return _0x1fa342;};}function handleError(_0x553e24,_0x1eada9){_0x1eada9=_0x1eada9||0x1f4;return function(_0x44c159){logger[_0x5654('0x27')](_0x44c159[_0x5654('0x28')]);if(_0x44c159[_0x5654('0x29')]){delete _0x44c159[_0x5654('0x29')];}_0x553e24[_0x5654('0x1b')](_0x1eada9)[_0x5654('0x2a')](_0x44c159);};}exports[_0x5654('0x2b')]=function(_0x45fb30,_0x2e3813){var _0x1c0be3={},_0x359494={},_0x1a6d6a={'count':0x0,'rows':[]};var _0x470bb0=_['map'](db[_0x5654('0x2c')][_0x5654('0x2d')],function(_0x5592cc){return{'name':_0x5592cc[_0x5654('0x2e')],'type':_0x5592cc[_0x5654('0x2f')][_0x5654('0x30')]};});_0x359494[_0x5654('0x31')]=_[_0x5654('0x32')](_[_0x5654('0x33')](_0x470bb0,_0x5654('0x29')),['format']);_0x359494[_0x5654('0x34')]=_[_0x5654('0x35')](_0x45fb30['query']);_0x359494[_0x5654('0x36')]=_[_0x5654('0x37')](_0x359494['model'],_0x359494[_0x5654('0x34')]);_0x1c0be3[_0x5654('0x38')]=_[_0x5654('0x37')](_0x359494[_0x5654('0x31')],qs[_0x5654('0x39')](_0x45fb30['query']['fields']));_0x1c0be3['attributes']=_0x1c0be3[_0x5654('0x38')][_0x5654('0x3a')]?_0x1c0be3[_0x5654('0x38')]:_0x359494[_0x5654('0x31')];if(!_0x45fb30[_0x5654('0x34')][_0x5654('0x3b')](_0x5654('0x3c'))){_0x1c0be3[_0x5654('0x21')]=qs[_0x5654('0x21')](_0x45fb30[_0x5654('0x34')]['limit']);_0x1c0be3[_0x5654('0x1e')]=qs[_0x5654('0x1e')](_0x45fb30[_0x5654('0x34')]['offset']);}_0x1c0be3['order']=qs[_0x5654('0x3d')](_0x45fb30[_0x5654('0x34')][_0x5654('0x3d')]);_0x1c0be3['where']=qs[_0x5654('0x36')](_[_0x5654('0x3e')](_0x45fb30[_0x5654('0x34')],_0x359494[_0x5654('0x36')]),_0x470bb0);if(_0x45fb30[_0x5654('0x34')][_0x5654('0x3f')]){_0x1c0be3[_0x5654('0x40')]=_[_0x5654('0x41')](_0x1c0be3[_0x5654('0x40')],{'$or':_[_0x5654('0x33')](_0x470bb0,function(_0x228233){if(_0x228233[_0x5654('0x2f')]!==_0x5654('0x42')){var _0x4e61eb={};_0x4e61eb[_0x228233['name']]={'$like':'%'+_0x45fb30['query']['filter']+'%'};return _0x4e61eb;}})});}_0x1c0be3=_[_0x5654('0x41')]({},_0x1c0be3,_0x45fb30[_0x5654('0x43')]);var _0x1784b8={'where':_0x1c0be3['where']};return db[_0x5654('0x2c')][_0x5654('0x20')](_0x1784b8)['then'](function(_0x3d1595){_0x1a6d6a[_0x5654('0x20')]=_0x3d1595;if(_0x45fb30[_0x5654('0x34')]['includeAll']){_0x1c0be3['include']=[{'all':!![]}];}return db[_0x5654('0x2c')][_0x5654('0x44')](_0x1c0be3);})[_0x5654('0x25')](function(_0x58c6c2){_0x1a6d6a[_0x5654('0x45')]=_0x58c6c2;return _0x1a6d6a;})[_0x5654('0x25')](respondWithFilteredResult(_0x2e3813,_0x1c0be3))[_0x5654('0x46')](handleError(_0x2e3813,null));};exports[_0x5654('0x47')]=function(_0xc1dd69,_0x664cc9){var _0x17381f={'raw':![],'where':{'id':_0xc1dd69[_0x5654('0x48')]['id']}},_0x49005c={};_0x49005c[_0x5654('0x31')]=_[_0x5654('0x35')](db[_0x5654('0x2c')][_0x5654('0x2d')]);_0x49005c[_0x5654('0x34')]=_[_0x5654('0x35')](_0xc1dd69[_0x5654('0x34')]);_0x49005c[_0x5654('0x36')]=_[_0x5654('0x37')](_0x49005c[_0x5654('0x31')],_0x49005c[_0x5654('0x34')]);_0x17381f['attributes']=_[_0x5654('0x37')](_0x49005c['model'],qs[_0x5654('0x39')](_0xc1dd69['query']['fields']));_0x17381f[_0x5654('0x38')]=_0x17381f[_0x5654('0x38')][_0x5654('0x3a')]?_0x17381f[_0x5654('0x38')]:_0x49005c[_0x5654('0x31')];if(_0xc1dd69['query'][_0x5654('0x49')]){_0x17381f[_0x5654('0x4a')]=[{'all':!![]}];}_0x17381f=_[_0x5654('0x41')]({},_0x17381f,_0xc1dd69[_0x5654('0x43')]);return db[_0x5654('0x2c')]['find'](_0x17381f)[_0x5654('0x25')](handleEntityNotFound(_0x664cc9,null))[_0x5654('0x25')](respondWithResult(_0x664cc9,null))['catch'](handleError(_0x664cc9,null));};exports[_0x5654('0x4b')]=function(_0x534945,_0x7bdc25){return db['VoiceRecording'][_0x5654('0x4b')](_0x534945[_0x5654('0x4c')],{})[_0x5654('0x25')](respondWithResult(_0x7bdc25,0xc9))['catch'](handleError(_0x7bdc25,null));};exports[_0x5654('0x4d')]=function(_0x55ad4e,_0x418093){if(_0x55ad4e[_0x5654('0x4c')]['id']){delete _0x55ad4e[_0x5654('0x4c')]['id'];}return db['VoiceRecording'][_0x5654('0x4e')]({'where':{'id':_0x55ad4e[_0x5654('0x48')]['id']}})[_0x5654('0x25')](handleEntityNotFound(_0x418093,null))['then'](saveUpdates(_0x55ad4e[_0x5654('0x4c')],null))['then'](respondWithResult(_0x418093,null))[_0x5654('0x46')](handleError(_0x418093,null));};exports[_0x5654('0x4f')]=function(_0x111b41,_0x5ddd2f){return db[_0x5654('0x2c')][_0x5654('0x4f')]()['then'](respondWithResult(_0x5ddd2f,null))[_0x5654('0x46')](handleError(_0x5ddd2f,null));};exports[_0x5654('0x50')]=function(_0x361f5e,_0x3b6249,_0x114869){var _0x463ada=require(_0x5654('0x51'));var _0x3ca730=![];var _0x445794={};if(_0x361f5e[_0x5654('0x34')][_0x5654('0x2f')]&&_0x361f5e[_0x5654('0x34')][_0x5654('0x2f')]===_0x5654('0x52')){_0x445794[_0x5654('0x52')]=_0x361f5e[_0x5654('0x48')]['id'];}else{_0x445794['id']=_0x361f5e[_0x5654('0x48')]['id'];}return db[_0x5654('0x2c')][_0x5654('0x4e')]({'where':_0x445794,'attributes':['id',_0x5654('0x53')],'raw':!![]})[_0x5654('0x25')](handleEntityNotFound(_0x3b6249,null))[_0x5654('0x25')](function(_0x1f9677){if(_0x1f9677){var _0x56a0f4=_0x1f9677[_0x5654('0x53')];var _0x570ff3=util[_0x5654('0x54')](_0x5654('0x55'),_0x56a0f4);if(fs['existsSync'](_0x570ff3)){_0x3ca730=!![];return _0x463ada[_0x5654('0x56')](_0x570ff3,_0x56a0f4,config[_0x5654('0x57')]['recording'])[_0x5654('0x25')](function(){return _0x1f9677;});}return _0x1f9677;}})[_0x5654('0x25')](function(_0x17155d){if(_0x17155d){var _0x30213f=_0x17155d[_0x5654('0x53')];if(!fs['existsSync'](_0x30213f)){throw new db[(_0x5654('0x58'))][(_0x5654('0x59'))](_0x5654('0x5a'));}if(_0x17155d[_0x5654('0x5b')]){return _0x3b6249[_0x5654('0x50')](_0x30213f,_0x17155d[_0x5654('0x5b')]+path[_0x5654('0x5c')](_0x30213f),function(){if(_0x3ca730){fs[_0x5654('0x5d')](_0x30213f);}});}else{return _0x3b6249[_0x5654('0x50')](_0x30213f,function(_0x52e82d){if(_0x3ca730){fs[_0x5654('0x5d')](_0x30213f);}});}}})[_0x5654('0x46')](function(_0x29095d){if(_0x29095d[_0x5654('0x5e')]===_0x5654('0x5a')){_0x3b6249[_0x5654('0x1b')](0x194)[_0x5654('0x2a')]('Not\x20found');}else{return handleError(_0x3b6249,null);}});};exports[_0x5654('0x5f')]=function(_0x4f2bc3,_0x3033c6,_0xb268d1){var _0x24dd57=require(_0x5654('0x51'));var _0x3641fa=![];var _0x383634={'$and':[db['sequelize']['where'](db[_0x5654('0x60')]['fn'](_0x5654('0x61'),db[_0x5654('0x60')][_0x5654('0x62')](_0x5654('0x52'))),_0x4f2bc3[_0x5654('0x34')][_0x5654('0x63')])]};if(_0x4f2bc3[_0x5654('0x34')]['type']&&_0x4f2bc3[_0x5654('0x34')][_0x5654('0x2f')]===_0x5654('0x52')){_0x383634['$and'][_0x5654('0x64')]({'uniqueid':_0x4f2bc3[_0x5654('0x48')]['id']});}else{_0x383634[_0x5654('0x65')]['push']({'id':_0x4f2bc3[_0x5654('0x48')]['id']});}return db[_0x5654('0x2c')][_0x5654('0x4e')]({'where':_0x383634,'attributes':['id',_0x5654('0x53')],'raw':!![]})[_0x5654('0x25')](handleEntityNotFound(_0x3033c6,null))[_0x5654('0x25')](function(_0x10c733){if(_0x10c733){var _0x21c427=util[_0x5654('0x54')](_0x5654('0x55'),_0x10c733[_0x5654('0x53')]);if(fs[_0x5654('0x66')](_0x21c427)){_0x3641fa=!![];return _0x24dd57[_0x5654('0x56')](_0x21c427,_0x10c733[_0x5654('0x53')],config[_0x5654('0x57')][_0x5654('0x67')])[_0x5654('0x25')](function(){return _0x10c733;});}return _0x10c733;}})[_0x5654('0x25')](function(_0x30e1c3){if(_0x30e1c3){if(!fs[_0x5654('0x66')](_0x30e1c3[_0x5654('0x53')])){throw new db[(_0x5654('0x58'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x30e1c3['filename']){return _0x3033c6[_0x5654('0x50')](_0x30e1c3['value'],_0x30e1c3[_0x5654('0x5b')]+path[_0x5654('0x5c')](_0x30e1c3[_0x5654('0x53')]),function(){if(_0x3641fa){fs[_0x5654('0x5d')](_0x30e1c3[_0x5654('0x53')]);}});}else{return _0x3033c6[_0x5654('0x50')](_0x30e1c3['value'],function(_0x1fb2ae){if(_0x3641fa){fs[_0x5654('0x5d')](_0x30e1c3['value']);}});}}})['catch'](handleError(_0x3033c6,null));};exports[_0x5654('0x68')]=function(_0x2f9961,_0x516a9f){return db[_0x5654('0x2c')]['find']({'where':{'id':_0x2f9961[_0x5654('0x48')]['id']}})['then'](function(_0xa67918){if(_['isNil'](_0xa67918)){throw new ReferenceError(_0x5654('0x69'));}return _0xa67918;})[_0x5654('0x25')](function(_0x4c2160){var _0x99e6d0=_0x4c2160['value'];logger[_0x5654('0x6a')](_0x5654('0x6b'),_0x99e6d0);if(!_['isNil'](_0x4c2160[_0x5654('0x53')])&&fs[_0x5654('0x66')](_0x99e6d0)){logger[_0x5654('0x6a')](_0x5654('0x6c')+_0x99e6d0+_0x5654('0x6d'));fs[_0x5654('0x6e')](_0x99e6d0);}_0x99e6d0=_0x99e6d0+_0x5654('0x6f');if(!_[_0x5654('0x70')](_0x4c2160['value'])&&fs[_0x5654('0x66')](_0x99e6d0)){logger[_0x5654('0x6a')](_0x5654('0x6c')+_0x99e6d0+_0x5654('0x6d'));fs[_0x5654('0x6e')](_0x99e6d0);}return _0x4c2160;})[_0x5654('0x25')](function(_0x544bd2){if(!_0x544bd2)throw new InternalError();return _0x544bd2[_0x5654('0x68')]();})[_0x5654('0x25')](function(){_0x516a9f[_0x5654('0x1b')](0xcc)[_0x5654('0x1c')]();})[_0x5654('0x46')](handleError(_0x516a9f,null));};function getBucketslist(_0x550d20,_0x36cc1f,_0x3b1ef2){return new Promise(function(_0x29591e,_0x5142ff){var _0x2bbc85=new AWS['S3']({'accessKeyId':_0x36cc1f,'secretAccessKey':_0x550d20,'region':_0x3b1ef2});_0x2bbc85[_0x5654('0x71')]({},function(_0x491a6e,_0x3b770d){if(_0x491a6e){return _0x5142ff(_0x491a6e);}else{return _0x29591e(_0x3b770d);}});});}function createBucket(_0x4b41e3,_0xcd2ef5,_0x1aa029,_0x1a146b){return new Promise(function(_0x41e7ed,_0xbc530e){var _0x26292d=new AWS['S3']({'accessKeyId':_0xcd2ef5,'secretAccessKey':_0x4b41e3,'region':_0x1aa029});_0x26292d[_0x5654('0x72')]({'Bucket':_0x1a146b},function(_0xd8c7,_0x1d04eb){if(_0xd8c7){return _0xbc530e(_0xd8c7);}else{return _0x41e7ed(_0x1d04eb);}});});}function uploadFile(_0x216724,_0x40f755,_0x4ceb15,_0x3b82ed,_0x43a496,_0x43546e){return new Promise(function(_0x7b883f,_0x1b2518){var _0x55286b=new AWS['S3']({'accessKeyId':_0x40f755,'secretAccessKey':_0x216724,'region':_0x4ceb15});_0x55286b[_0x5654('0x73')]({'Bucket':_0x3b82ed,'Key':_0x43a496,'Body':_0x43546e},function(_0x10dfa1,_0x37158f){if(_0x10dfa1){return _0x1b2518(_0x10dfa1);}else{return _0x7b883f(_0x37158f);}});});}function startTranscribe(_0x1f5726,_0x279c58,_0x33bef7,_0xf05be0,_0x244a0f,_0x1f6fa6){return new Promise(function(_0x16061e,_0xfd3455){var _0x12fd83=new AWS[(_0x5654('0x74'))]({'accessKeyId':_0x279c58,'secretAccessKey':_0x1f5726,'region':_0x33bef7});_0x12fd83['startTranscriptionJob']({'TranscriptionJobName':_0xf05be0,'LanguageCode':_0x244a0f,'Media':{'MediaFileUri':_0x1f6fa6}},function(_0x44f95e,_0x325c6f){if(_0x44f95e){return _0xfd3455(_0x44f95e);}else{return _0x16061e(_0x325c6f);}});});}function transcribe(_0x56e81e,_0x4f9c24,_0x33775a,_0x6a4839,_0x3d32af,_0x742cb0,_0x23982f){return new Promise(function(_0x58dc77,_0xa8a13e){var _0x539a69={};logger[_0x5654('0x6a')](util[_0x5654('0x54')](_0x5654('0x75'),_0x56e81e,_0x3d32af));return uploadFile(_0x4f9c24,_0x33775a,_0x6a4839,_0x3d32af,path[_0x5654('0x76')](_0x742cb0),fs[_0x5654('0x77')](_0x742cb0))['then'](function(_0x5be878){logger[_0x5654('0x6a')](util[_0x5654('0x54')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x56e81e,_0x3d32af,_0x5be878['Location']));_0x539a69[_0x5654('0x78')]=_0x5be878[_0x5654('0x79')];_0x539a69['location']=_0x5be878[_0x5654('0x7a')];logger[_0x5654('0x6a')](util[_0x5654('0x54')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x56e81e));return startTranscribe(_0x4f9c24,_0x33775a,_0x6a4839,uuidv4(),_0x23982f,_0x5be878[_0x5654('0x7a')]);})[_0x5654('0x25')](function(_0x5d57d7){logger[_0x5654('0x6a')](util[_0x5654('0x54')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x56e81e,_0x5d57d7['TranscriptionJob'][_0x5654('0x7b')]));_0x539a69['transcribeName']=_0x5d57d7[_0x5654('0x7c')][_0x5654('0x7b')];_0x539a69[_0x5654('0x7d')]=_0x5d57d7['TranscriptionJob'][_0x5654('0x7e')];return _0x58dc77(_0x539a69);})['catch'](function(_0x4276ca){return _0xa8a13e(_0x4276ca);});});}exports[_0x5654('0x7f')]=function(_0x192f5,_0x1be61e,_0x3edd94){var _0x31ac4f;var _0x5b9926;var _0x326e29;var _0x110948=require(_0x5654('0x51'));return db['VoiceRecording'][_0x5654('0x80')]({'where':{'id':_0x192f5[_0x5654('0x48')]['id']}})[_0x5654('0x25')](function(_0xe34c6c){if(_0xe34c6c){var _0xb85c7f=util['format'](_0x5654('0x55'),_0xe34c6c[_0x5654('0x53')]);if(fs[_0x5654('0x66')](_0xb85c7f)){cypher=!![];return _0x110948[_0x5654('0x56')](_0xb85c7f,_0xe34c6c['value'],config[_0x5654('0x57')]['recording'])[_0x5654('0x25')](function(){return _0xe34c6c;});}return _0xe34c6c;}})[_0x5654('0x25')](function(_0x4c279d){if(!_0x4c279d){throw new db[(_0x5654('0x58'))]['ValidationError'](_0x5654('0x81'));}_0x5b9926=_0x4c279d;return db[_0x5654('0x82')]['findOne']({'where':{'id':0x1}});})[_0x5654('0x25')](handleEntityNotFound(_0x1be61e,null))[_0x5654('0x25')](function(_0x24e47d){if(_0x24e47d){_0x31ac4f=_0x24e47d;if(!_0x31ac4f['transcribe']||!_0x31ac4f[_0x5654('0x83')]||!_0x31ac4f[_0x5654('0x84')]||!_0x31ac4f[_0x5654('0x85')]||!_0x31ac4f[_0x5654('0x78')]){throw new db[(_0x5654('0x58'))][(_0x5654('0x59'))]('Transcribe\x20not\x20configured');}if(_0x192f5[_0x5654('0x4c')][_0x5654('0x86')]&&(!_0x31ac4f[_0x5654('0x87')]||!_0x31ac4f[_0x5654('0x88')]||!_0x31ac4f[_0x5654('0x89')]||!_0x31ac4f[_0x5654('0x85')]||!_0x31ac4f[_0x5654('0x78')])){throw new db[(_0x5654('0x58'))][(_0x5654('0x59'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x31ac4f[_0x5654('0x83')]}});}})['then'](function(_0x26912){if(!_0x26912){throw new db[(_0x5654('0x58'))][(_0x5654('0x59'))](_0x5654('0x8a'));}if(!_0x26912[_0x5654('0x8b')]||!_0x26912[_0x5654('0x8c')]){throw new db['Sequelize'][(_0x5654('0x59'))](_0x5654('0x8d'));}_0x326e29=_0x26912;return getBucketslist(_0x326e29[_0x5654('0x8b')],_0x326e29[_0x5654('0x8c')],_0x31ac4f[_0x5654('0x84')]);})[_0x5654('0x25')](function(_0x3d58cb){if(_0x3d58cb&&_0x3d58cb['Buckets']){var _0x2486b8=_[_0x5654('0x4e')](_0x3d58cb['Buckets'],function(_0x4f0428){return _0x4f0428[_0x5654('0x8e')]===_0x31ac4f[_0x5654('0x78')];});if(!_0x2486b8){logger[_0x5654('0x6a')](util[_0x5654('0x54')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x192f5[_0x5654('0x48')]['id'],_0x31ac4f['bucket']));return createBucket(_0x326e29[_0x5654('0x8b')],_0x326e29['data2'],_0x31ac4f[_0x5654('0x84')],_0x31ac4f[_0x5654('0x78')]);}logger[_0x5654('0x6a')](util[_0x5654('0x54')](_0x5654('0x8f'),_0x192f5[_0x5654('0x48')]['id'],_0x31ac4f[_0x5654('0x78')]));return;}})['then'](function(_0xae5d09){if(_0x5b9926['transcribeStatus']==='NEW'){return transcribe(_0x192f5['params']['id'],_0x326e29['data1'],_0x326e29['data2'],_0x31ac4f[_0x5654('0x84')],_0x31ac4f[_0x5654('0x78')],_0x5b9926[_0x5654('0x53')],_0x31ac4f[_0x5654('0x85')]);}else{logger[_0x5654('0x6a')](util[_0x5654('0x54')](_0x5654('0x90'),_0x192f5[_0x5654('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x5654('0x25')](function(_0x5e0547){if(_0x5e0547){_0x5e0547[_0x5654('0x91')]=_0x192f5[_0x5654('0x4c')][_0x5654('0x86')];return _0x5b9926[_0x5654('0x92')](_0x5e0547);}})['then'](respondWithResult(_0x1be61e,null))[_0x5654('0x46')](handleError(_0x1be61e,null));};function writeFile(_0xd8cfbf,_0x4c7e32){return new Promise(function(_0x2c398b,_0x3e76c7){fs['writeFile'](_0x4c7e32,_0xd8cfbf,function(_0x7a8c9d,_0x5d8f14){if(_0x7a8c9d){return _0x3e76c7(_0x7a8c9d);}else{return _0x2c398b(_0x5d8f14);}});});}exports[_0x5654('0x93')]=function(_0x315fa1,_0x50407d,_0x279745){return db[_0x5654('0x2c')][_0x5654('0x80')]({'where':{'id':_0x315fa1[_0x5654('0x48')]['id']}})[_0x5654('0x25')](handleEntityNotFound(_0x50407d))[_0x5654('0x25')](function(_0xc69244){if(_0xc69244&&_0xc69244[_0x5654('0x94')]){var _0x52e861=_0xc69244[_0x5654('0x94')];var _0x98c23a=config[_0x5654('0x95')]+_0x5654('0x96')+_0xc69244['id']+'.txt';if(fs[_0x5654('0x66')](_0x98c23a)){return _0x98c23a;}return writeFile(_0x52e861,_0x98c23a)[_0x5654('0x25')](function(){return _0x98c23a;});}else{throw new db[(_0x5654('0x58'))]['ValidationError'](_0x5654('0x97'));}})[_0x5654('0x25')](function(_0x30fdcb){return _0x50407d[_0x5654('0x50')](_0x30fdcb);})[_0x5654('0x46')](handleError(_0x50407d));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 332a9ce..a6215c7 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 _0x44d4=['transcribeStatus','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x4fab93,_0x2933af){var _0x59460a=function(_0x283389){while(--_0x283389){_0x4fab93['push'](_0x4fab93['shift']());}};_0x59460a(++_0x2933af);}(_0x44d4,0x161));var _0x444d=function(_0x441e64,_0x4d04d1){_0x441e64=_0x441e64-0x0;var _0x937a8b=_0x44d4[_0x441e64];return _0x937a8b;};'use strict';var attributes=require(_0x444d('0x0'));module['exports']=function(_0x530741,_0x5c12f3){return _0x530741[_0x444d('0x1')](_0x444d('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']},{'name':_0x444d('0x3'),'fields':[_0x444d('0x3')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeb0d=['transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','uniqueid'];(function(_0x1a4ec0,_0x53fe85){var _0x450490=function(_0xdfcf0a){while(--_0xdfcf0a){_0x1a4ec0['push'](_0x1a4ec0['shift']());}};_0x450490(++_0x53fe85);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x455279,_0xa2a66a){_0x455279=_0x455279-0x0;var _0x103cdf=_0xeb0d[_0x455279];return _0x103cdf;};'use strict';var attributes=require(_0xdeb0('0x0'));module['exports']=function(_0x501863,_0x515f56){return _0x501863[_0xdeb0('0x1')](_0xdeb0('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xdeb0('0x3'),'fields':[_0xdeb0('0x3')]},{'name':_0xdeb0('0x4'),'fields':[_0xdeb0('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 91cdc63..df34f0a 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 _0xa30a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','UpdateVoiceRecording','update','body','options','where','limit','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x5bc784,_0x5657b9){var _0x5a6817=function(_0x294ddf){while(--_0x294ddf){_0x5bc784['push'](_0x5bc784['shift']());}};_0x5a6817(++_0x5657b9);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['VoiceRecording'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')][_0xaa30('0x19')]||null:null,'attributes':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')]['attributes']||null:null,'limit':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')][_0xaa30('0x1a')]||null:null})[_0xaa30('0xc')](function(_0x1ff442){logger['info'](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x1b')](_0xaa30('0x15'),_0x540e36,JSON[_0xaa30('0x10')](_0x1ff442));_0x53f9fd(_0x1ff442);})['catch'](function(_0x14d7fa){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x14d7fa[_0xaa30('0x13')],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x14d7fa[_0xaa30('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x467850){var _0x465701=this;return new Promise(function(_0x5d4da8,_0xb043e4){var _0x5b3efb=require(_0xaa30('0x1c'));var _0x33a0c9;return db[_0xaa30('0x1d')][_0xaa30('0x1e')]({'attributes':['id',_0xaa30('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xaa30('0xc')](function(_0x6ff09a){_0x33a0c9=_0x6ff09a;return db[_0xaa30('0x20')][_0xaa30('0x21')](_0x467850[_0xaa30('0x17')]);})[_0xaa30('0xc')](function(_0x43003f){if(_0x33a0c9[_0xaa30('0x1f')]&&fs[_0xaa30('0x22')](_0x43003f[_0xaa30('0x23')])){var _0x1a3f64=util[_0xaa30('0x24')](_0xaa30('0x25'),_0x43003f['value']);return _0x5b3efb[_0xaa30('0x26')](_0x43003f[_0xaa30('0x23')],_0x1a3f64,config[_0xaa30('0x27')][_0xaa30('0x28')])[_0xaa30('0xc')](function(){fs[_0xaa30('0x29')](_0x43003f['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x43003f;});}return _0x43003f;})[_0xaa30('0xc')](function(_0x407090){logger[_0xaa30('0xd')](_0xaa30('0x2a'),_0x467850);logger[_0xaa30('0x1b')]('CreateVoiceRecording',_0x467850,JSON['stringify'](_0x407090));_0x5d4da8(_0x407090);})[_0xaa30('0x2b')](function(_0x2d26fb){logger['error'](_0xaa30('0x2a'),_0x2d26fb['message'],_0x467850);_0xb043e4(_0x465701[_0xaa30('0x11')](0x1f4,_0x2d26fb['message']));});});}; \ No newline at end of file +var _0x7bd0=['callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceRecording','update','body','options','raw','attributes','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x7bd0,0x111));var _0x07bd=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x7bd0[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('VoiceRecording,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['UpdateVoiceRecording']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')](_0x3f9f0b[_0x07bd('0x1b')],{'raw':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['where']||null:null,'attributes':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['limit']||null:null})['then'](function(_0xbb7117){logger['info'](_0x07bd('0x1f'),_0x3f9f0b);logger['debug']('UpdateVoiceRecording',_0x3f9f0b,JSON[_0x07bd('0x13')](_0xbb7117));_0x4948f4(_0xbb7117);})[_0x07bd('0x18')](function(_0xf3b23c){logger[_0x07bd('0x14')](_0x07bd('0x1f'),_0xf3b23c[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0xf3b23c[_0x07bd('0x16')]));});});};exports[_0x07bd('0x20')]=function(_0x3db9d0){var _0x2a7202=this;return new Promise(function(_0x12ce26,_0x1c1fda){var _0x571dab=require('../../components/encryptor');var _0x5184dc;return db[_0x07bd('0x21')][_0x07bd('0x22')]({'attributes':['id',_0x07bd('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1a3aa9){_0x5184dc=_0x1a3aa9;return db[_0x07bd('0x19')][_0x07bd('0x24')](_0x3db9d0[_0x07bd('0x1b')]);})[_0x07bd('0xe')](function(_0x13bf6b){if(_0x5184dc['callRecordingEncryption']&&fs[_0x07bd('0x25')](_0x13bf6b[_0x07bd('0x26')])){var _0x4182b9=util[_0x07bd('0x27')](_0x07bd('0x28'),_0x13bf6b[_0x07bd('0x26')]);return _0x571dab[_0x07bd('0x29')](_0x13bf6b[_0x07bd('0x26')],_0x4182b9,config['secrets']['recording'])[_0x07bd('0xe')](function(){fs[_0x07bd('0x2a')](_0x13bf6b[_0x07bd('0x26')]);logger['info'](_0x07bd('0x2b'));return _0x13bf6b;});}return _0x13bf6b;})[_0x07bd('0xe')](function(_0x208aca){logger['info']('CreateVoiceRecording',_0x3db9d0);logger[_0x07bd('0x11')](_0x07bd('0x20'),_0x3db9d0,JSON[_0x07bd('0x13')](_0x208aca));_0x12ce26(_0x208aca);})[_0x07bd('0x18')](function(_0x5f29c5){logger[_0x07bd('0x14')](_0x07bd('0x20'),_0x5f29c5[_0x07bd('0x16')],_0x3db9d0);_0x1c1fda(_0x2a7202['error'](0x1f4,_0x5f29c5[_0x07bd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 7747e71..3bfa936 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 _0x7be1=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7be1,0x17e));var _0x17be=function(_0x299028,_0x4d7e9f){_0x299028=_0x299028-0x0;var _0x12154e=_0x7be1[_0x299028];return _0x12154e;};'use strict';var multer=require(_0x17be('0x0'));var util=require('util');var path=require(_0x17be('0x1'));var timeout=require(_0x17be('0x2'));var express=require(_0x17be('0x3'));var router=express[_0x17be('0x4')]();var fs_extra=require(_0x17be('0x5'));var auth=require(_0x17be('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x17be('0x7'));var controller=require(_0x17be('0x8'));router[_0x17be('0x9')]('/',auth[_0x17be('0xa')](),controller[_0x17be('0xb')]);router[_0x17be('0x9')](_0x17be('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x17be('0xd'),auth[_0x17be('0xa')](),controller[_0x17be('0xe')]);router[_0x17be('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x17be('0xd'),auth['isAuthenticated'](),controller[_0x17be('0x10')]);router[_0x17be('0x11')](_0x17be('0xd'),auth[_0x17be('0xa')](),controller[_0x17be('0x12')]);module[_0x17be('0x13')]=router; \ No newline at end of file +var _0xad9f=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x171520,_0x1cee8c){var _0x3cc729=function(_0x201c4a){while(--_0x201c4a){_0x171520['push'](_0x171520['shift']());}};_0x3cc729(++_0x1cee8c);}(_0xad9f,0xb0));var _0xfad9=function(_0x34f942,_0x1deb70){_0x34f942=_0x34f942-0x0;var _0x49f8f4=_0xad9f[_0x34f942];return _0x49f8f4;};'use strict';var multer=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var path=require(_0xfad9('0x2'));var timeout=require(_0xfad9('0x3'));var express=require(_0xfad9('0x4'));var router=express[_0xfad9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfad9('0x6'));var interaction=require(_0xfad9('0x7'));var config=require(_0xfad9('0x8'));var controller=require('./voiceTransferReport.controller');router[_0xfad9('0x9')]('/',auth[_0xfad9('0xa')](),controller['index']);router[_0xfad9('0x9')](_0xfad9('0xb'),auth['isAuthenticated'](),controller[_0xfad9('0xc')]);router[_0xfad9('0x9')](_0xfad9('0xd'),auth[_0xfad9('0xa')](),controller[_0xfad9('0xe')]);router[_0xfad9('0xf')]('/',auth[_0xfad9('0xa')](),controller[_0xfad9('0x10')]);router[_0xfad9('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xfad9('0x12')]);router[_0xfad9('0x13')](_0xfad9('0xd'),auth[_0xfad9('0xa')](),controller[_0xfad9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d200a5f..e071ef9 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 _0x11ef=['STRING','ENUM','sequelize','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x11ef,0xda));var _0xf11e=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x11ef[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xf11e('0x0'));var moment=require('moment');module[_0xf11e('0x1')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xf11e('0x2')]},'transferercalleridnum':{'type':Sequelize[_0xf11e('0x2')]},'transferercalleridname':{'type':Sequelize[_0xf11e('0x2')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf11e('0x2')]},'transfererconnectedlinename':{'type':Sequelize[_0xf11e('0x2')]},'transfereraccountcode':{'type':Sequelize[_0xf11e('0x2')]},'transferercontext':{'type':Sequelize[_0xf11e('0x2')]},'transfererexten':{'type':Sequelize[_0xf11e('0x2')]},'transfererlinkedid':{'type':Sequelize[_0xf11e('0x2')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf11e('0x2')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xf11e('0x2')]},'transfereeconnectedlinename':{'type':Sequelize[_0xf11e('0x2')]},'transfereeaccountcode':{'type':Sequelize[_0xf11e('0x2')]},'transfereecontext':{'type':Sequelize[_0xf11e('0x2')]},'transfereeexten':{'type':Sequelize[_0xf11e('0x2')]},'transfereelinkedid':{'type':Sequelize[_0xf11e('0x2')]},'isexternal':{'type':Sequelize[_0xf11e('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xf11e('0x2')]},'extension':{'type':Sequelize[_0xf11e('0x2')]}}; \ No newline at end of file +var _0x5802=['attended','STRING','sequelize','moment','exports','ENUM'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5802,0x116));var _0x2580=function(_0x4a1835,_0xe4a237){_0x4a1835=_0x4a1835-0x0;var _0x203f1b=_0x5802[_0x4a1835];return _0x203f1b;};'use strict';var Sequelize=require(_0x2580('0x0'));var moment=require(_0x2580('0x1'));module[_0x2580('0x2')]={'type':{'type':Sequelize[_0x2580('0x3')]('blind',_0x2580('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x2580('0x5')]},'transferercalleridname':{'type':Sequelize[_0x2580('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2580('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x2580('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x2580('0x5')]},'transferercontext':{'type':Sequelize[_0x2580('0x5')]},'transfererexten':{'type':Sequelize[_0x2580('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x2580('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2580('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2580('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2580('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2580('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x2580('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x2580('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2580('0x5')]},'isexternal':{'type':Sequelize[_0x2580('0x3')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x2580('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 187d179..3da9b70 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 _0xca48=['name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','catch','create','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','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/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','destroy','then'];(function(_0x1188f7,_0x16c6ce){var _0x3fe94c=function(_0x1f4ea9){while(--_0x1f4ea9){_0x1188f7['push'](_0x1188f7['shift']());}};_0x3fe94c(++_0x16c6ce);}(_0xca48,0x6e));var _0x8ca4=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xca48[_0x4dc7b9];return _0x3ab114;};'use strict';var emlformat=require(_0x8ca4('0x0'));var rimraf=require(_0x8ca4('0x1'));var zipdir=require(_0x8ca4('0x2'));var jsonpatch=require(_0x8ca4('0x3'));var rp=require('request-promise');var moment=require(_0x8ca4('0x4'));var BPromise=require(_0x8ca4('0x5'));var Mustache=require(_0x8ca4('0x6'));var util=require(_0x8ca4('0x7'));var path=require('path');var sox=require(_0x8ca4('0x8'));var csv=require(_0x8ca4('0x9'));var ejs=require(_0x8ca4('0xa'));var fs=require('fs');var fs_extra=require(_0x8ca4('0xb'));var _=require('lodash');var squel=require(_0x8ca4('0xc'));var crypto=require(_0x8ca4('0xd'));var jsforce=require(_0x8ca4('0xe'));var deskjs=require(_0x8ca4('0xf'));var toCsv=require(_0x8ca4('0x9'));var querystring=require(_0x8ca4('0x10'));var Papa=require(_0x8ca4('0x11'));var Redis=require(_0x8ca4('0x12'));var authService=require(_0x8ca4('0x13'));var qs=require(_0x8ca4('0x14'));var as=require(_0x8ca4('0x15'));var hardwareService=require(_0x8ca4('0x16'));var logger=require(_0x8ca4('0x17'))(_0x8ca4('0x18'));var utils=require(_0x8ca4('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ca4('0x1a'))['db'];function respondWithStatusCode(_0x3b9241,_0x1cc8f2){_0x1cc8f2=_0x1cc8f2||0xcc;return function(_0x40ab15){if(_0x40ab15){return _0x3b9241[_0x8ca4('0x1b')](_0x1cc8f2);}return _0x3b9241[_0x8ca4('0x1c')](_0x1cc8f2)[_0x8ca4('0x1d')]();};}function respondWithResult(_0x2d277f,_0xdd7a){_0xdd7a=_0xdd7a||0xc8;return function(_0x33d1cd){if(_0x33d1cd){return _0x2d277f[_0x8ca4('0x1c')](_0xdd7a)[_0x8ca4('0x1e')](_0x33d1cd);}};}function respondWithFilteredResult(_0x11ff76,_0x3625d3){return function(_0x550824){if(_0x550824){var _0x360d1d=typeof _0x3625d3['offset']===_0x8ca4('0x1f')&&typeof _0x3625d3[_0x8ca4('0x20')]===_0x8ca4('0x1f');var _0x4e38e6=_0x550824[_0x8ca4('0x21')];var _0x52952e=_0x360d1d?0x0:_0x3625d3[_0x8ca4('0x22')];var _0x25dc1f=_0x360d1d?_0x550824[_0x8ca4('0x21')]:_0x3625d3['offset']+_0x3625d3[_0x8ca4('0x20')];var _0x2add9b;if(_0x25dc1f>=_0x4e38e6){_0x25dc1f=_0x4e38e6;_0x2add9b=0xc8;}else{_0x2add9b=0xce;}_0x11ff76[_0x8ca4('0x1c')](_0x2add9b);return _0x11ff76[_0x8ca4('0x23')](_0x8ca4('0x24'),_0x52952e+'-'+_0x25dc1f+'/'+_0x4e38e6)['json'](_0x550824);}return null;};}function patchUpdates(_0x5cf7ca){return function(_0x5be61c){try{jsonpatch['apply'](_0x5be61c,_0x5cf7ca,!![]);}catch(_0x28bd50){return BPromise[_0x8ca4('0x25')](_0x28bd50);}return _0x5be61c['save']();};}function saveUpdates(_0x416b78,_0x1443c1){return function(_0x5fb9ef){if(_0x5fb9ef){return _0x5fb9ef['update'](_0x416b78)['then'](function(_0x5575b){return _0x5575b;});}return null;};}function removeEntity(_0x46967e,_0x187616){return function(_0x2bf2bf){if(_0x2bf2bf){return _0x2bf2bf[_0x8ca4('0x26')]()[_0x8ca4('0x27')](function(){_0x46967e[_0x8ca4('0x1c')](0xcc)[_0x8ca4('0x1d')]();});}};}function handleEntityNotFound(_0x1be2d7,_0x465ef9){return function(_0x1a62f3){if(!_0x1a62f3){_0x1be2d7['sendStatus'](0x194);}return _0x1a62f3;};}function handleError(_0x3b10d6,_0x36162a){_0x36162a=_0x36162a||0x1f4;return function(_0x1b6722){logger['error'](_0x1b6722['stack']);if(_0x1b6722[_0x8ca4('0x28')]){delete _0x1b6722['name'];}_0x3b10d6[_0x8ca4('0x1c')](_0x36162a)[_0x8ca4('0x29')](_0x1b6722);};}exports['index']=function(_0x206327,_0x4b3356){var _0x475891={},_0x3f9128={},_0xdb911e={'count':0x0,'rows':[]};var _0x147ec3=_[_0x8ca4('0x2a')](db[_0x8ca4('0x2b')][_0x8ca4('0x2c')],function(_0x9894ee){return{'name':_0x9894ee[_0x8ca4('0x2d')],'type':_0x9894ee[_0x8ca4('0x2e')][_0x8ca4('0x2f')]};});_0x3f9128[_0x8ca4('0x30')]=_['map'](_0x147ec3,_0x8ca4('0x28'));_0x3f9128[_0x8ca4('0x31')]=_[_0x8ca4('0x32')](_0x206327[_0x8ca4('0x31')]);_0x3f9128[_0x8ca4('0x33')]=_[_0x8ca4('0x34')](_0x3f9128['model'],_0x3f9128[_0x8ca4('0x31')]);_0x475891[_0x8ca4('0x35')]=_[_0x8ca4('0x34')](_0x3f9128[_0x8ca4('0x30')],qs[_0x8ca4('0x36')](_0x206327[_0x8ca4('0x31')][_0x8ca4('0x36')]));_0x475891[_0x8ca4('0x35')]=_0x475891['attributes'][_0x8ca4('0x37')]?_0x475891[_0x8ca4('0x35')]:_0x3f9128[_0x8ca4('0x30')];if(!_0x206327[_0x8ca4('0x31')][_0x8ca4('0x38')](_0x8ca4('0x39'))){_0x475891[_0x8ca4('0x20')]=qs[_0x8ca4('0x20')](_0x206327['query'][_0x8ca4('0x20')]);_0x475891['offset']=qs[_0x8ca4('0x22')](_0x206327[_0x8ca4('0x31')][_0x8ca4('0x22')]);}_0x475891[_0x8ca4('0x3a')]=qs[_0x8ca4('0x3b')](_0x206327[_0x8ca4('0x31')][_0x8ca4('0x3b')]);_0x475891['where']=qs[_0x8ca4('0x33')](_['pick'](_0x206327[_0x8ca4('0x31')],_0x3f9128[_0x8ca4('0x33')]),_0x147ec3);if(_0x206327['query']['filter']){_0x475891[_0x8ca4('0x3c')]=_[_0x8ca4('0x3d')](_0x475891[_0x8ca4('0x3c')],{'$or':_[_0x8ca4('0x2a')](_0x147ec3,function(_0xa5686b){if(_0xa5686b[_0x8ca4('0x2e')]!==_0x8ca4('0x3e')){var _0x2aebe4={};_0x2aebe4[_0xa5686b[_0x8ca4('0x28')]]={'$like':'%'+_0x206327[_0x8ca4('0x31')][_0x8ca4('0x3f')]+'%'};return _0x2aebe4;}})});}_0x475891=_[_0x8ca4('0x3d')]({},_0x475891,_0x206327[_0x8ca4('0x40')]);var _0x1a57d4={'where':_0x475891[_0x8ca4('0x3c')]};return db[_0x8ca4('0x2b')][_0x8ca4('0x21')](_0x1a57d4)[_0x8ca4('0x27')](function(_0x353168){_0xdb911e[_0x8ca4('0x21')]=_0x353168;if(_0x206327[_0x8ca4('0x31')][_0x8ca4('0x41')]){_0x475891[_0x8ca4('0x42')]=[{'all':!![]}];}return db[_0x8ca4('0x2b')][_0x8ca4('0x43')](_0x475891);})[_0x8ca4('0x27')](function(_0x4d8626){_0xdb911e[_0x8ca4('0x44')]=_0x4d8626;return _0xdb911e;})[_0x8ca4('0x27')](respondWithFilteredResult(_0x4b3356,_0x475891))['catch'](handleError(_0x4b3356,null));};exports[_0x8ca4('0x45')]=function(_0x3f6966,_0x385709){var _0x441db9={'raw':!![],'where':{'id':_0x3f6966['params']['id']}},_0x12d7c1={};_0x12d7c1[_0x8ca4('0x30')]=_[_0x8ca4('0x32')](db['VoiceTransferReport'][_0x8ca4('0x2c')]);_0x12d7c1[_0x8ca4('0x31')]=_[_0x8ca4('0x32')](_0x3f6966[_0x8ca4('0x31')]);_0x12d7c1[_0x8ca4('0x33')]=_[_0x8ca4('0x34')](_0x12d7c1[_0x8ca4('0x30')],_0x12d7c1['query']);_0x441db9[_0x8ca4('0x35')]=_[_0x8ca4('0x34')](_0x12d7c1['model'],qs[_0x8ca4('0x36')](_0x3f6966[_0x8ca4('0x31')][_0x8ca4('0x36')]));_0x441db9[_0x8ca4('0x35')]=_0x441db9[_0x8ca4('0x35')][_0x8ca4('0x37')]?_0x441db9[_0x8ca4('0x35')]:_0x12d7c1[_0x8ca4('0x30')];if(_0x3f6966[_0x8ca4('0x31')][_0x8ca4('0x41')]){_0x441db9[_0x8ca4('0x42')]=[{'all':!![]}];}_0x441db9=_[_0x8ca4('0x3d')]({},_0x441db9,_0x3f6966[_0x8ca4('0x40')]);return db[_0x8ca4('0x2b')][_0x8ca4('0x46')](_0x441db9)['then'](handleEntityNotFound(_0x385709,null))[_0x8ca4('0x27')](respondWithResult(_0x385709,null))[_0x8ca4('0x47')](handleError(_0x385709,null));};exports['create']=function(_0xafb73f,_0xecf73){return db[_0x8ca4('0x2b')][_0x8ca4('0x48')](_0xafb73f['body'],{})['then'](respondWithResult(_0xecf73,0xc9))[_0x8ca4('0x47')](handleError(_0xecf73,null));};exports['update']=function(_0x2cf58a,_0x2b8e71){if(_0x2cf58a['body']['id']){delete _0x2cf58a['body']['id'];}return db[_0x8ca4('0x2b')]['find']({'where':{'id':_0x2cf58a[_0x8ca4('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b8e71,null))['then'](saveUpdates(_0x2cf58a['body'],null))['then'](respondWithResult(_0x2b8e71,null))[_0x8ca4('0x47')](handleError(_0x2b8e71,null));};exports[_0x8ca4('0x26')]=function(_0x3fc1cb,_0x5b6e0d){return db['VoiceTransferReport'][_0x8ca4('0x46')]({'where':{'id':_0x3fc1cb['params']['id']}})['then'](handleEntityNotFound(_0x5b6e0d,null))[_0x8ca4('0x27')](removeEntity(_0x5b6e0d,null))[_0x8ca4('0x47')](handleError(_0x5b6e0d,null));};exports[_0x8ca4('0x4a')]=function(_0x29b173,_0x205af8){return db[_0x8ca4('0x2b')]['describe']()[_0x8ca4('0x27')](respondWithResult(_0x205af8,null))['catch'](handleError(_0x205af8,null));}; \ No newline at end of file +var _0x6143=['Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','update','find','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set'];(function(_0x1c5ab4,_0xbc9007){var _0x1f1e56=function(_0x14c306){while(--_0x14c306){_0x1c5ab4['push'](_0x1c5ab4['shift']());}};_0x1f1e56(++_0xbc9007);}(_0x6143,0xc3));var _0x3614=function(_0x59546d,_0x486f1f){_0x59546d=_0x59546d-0x0;var _0x14b001=_0x6143[_0x59546d];return _0x14b001;};'use strict';var emlformat=require(_0x3614('0x0'));var rimraf=require(_0x3614('0x1'));var zipdir=require(_0x3614('0x2'));var jsonpatch=require(_0x3614('0x3'));var rp=require('request-promise');var moment=require(_0x3614('0x4'));var BPromise=require(_0x3614('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3614('0x6'));var sox=require('sox');var csv=require(_0x3614('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3614('0x8'));var _=require(_0x3614('0x9'));var squel=require(_0x3614('0xa'));var crypto=require(_0x3614('0xb'));var jsforce=require(_0x3614('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3614('0x7'));var querystring=require(_0x3614('0xd'));var Papa=require(_0x3614('0xe'));var Redis=require(_0x3614('0xf'));var authService=require(_0x3614('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3614('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3614('0x12'))('api');var utils=require(_0x3614('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3614('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x139559,_0x30357c){_0x30357c=_0x30357c||0xcc;return function(_0x19b0b5){if(_0x19b0b5){return _0x139559[_0x3614('0x15')](_0x30357c);}return _0x139559['status'](_0x30357c)[_0x3614('0x16')]();};}function respondWithResult(_0x34c637,_0xd8295e){_0xd8295e=_0xd8295e||0xc8;return function(_0x800ec6){if(_0x800ec6){return _0x34c637[_0x3614('0x17')](_0xd8295e)[_0x3614('0x18')](_0x800ec6);}};}function respondWithFilteredResult(_0x232d76,_0x412a3a){return function(_0x16abab){if(_0x16abab){var _0x309cfd=typeof _0x412a3a['offset']===_0x3614('0x19')&&typeof _0x412a3a['limit']===_0x3614('0x19');var _0x5f5835=_0x16abab[_0x3614('0x1a')];var _0x1f0fa4=_0x309cfd?0x0:_0x412a3a['offset'];var _0x33f63c=_0x309cfd?_0x16abab[_0x3614('0x1a')]:_0x412a3a[_0x3614('0x1b')]+_0x412a3a[_0x3614('0x1c')];var _0x10453c;if(_0x33f63c>=_0x5f5835){_0x33f63c=_0x5f5835;_0x10453c=0xc8;}else{_0x10453c=0xce;}_0x232d76[_0x3614('0x17')](_0x10453c);return _0x232d76[_0x3614('0x1d')](_0x3614('0x1e'),_0x1f0fa4+'-'+_0x33f63c+'/'+_0x5f5835)[_0x3614('0x18')](_0x16abab);}return null;};}function patchUpdates(_0x4aefc5){return function(_0x544e7c){try{jsonpatch[_0x3614('0x1f')](_0x544e7c,_0x4aefc5,!![]);}catch(_0x185cc1){return BPromise[_0x3614('0x20')](_0x185cc1);}return _0x544e7c[_0x3614('0x21')]();};}function saveUpdates(_0x571647,_0x3b62b9){return function(_0xe2552d){if(_0xe2552d){return _0xe2552d['update'](_0x571647)[_0x3614('0x22')](function(_0x424ea8){return _0x424ea8;});}return null;};}function removeEntity(_0x4d690f,_0x1b2f95){return function(_0x23eab0){if(_0x23eab0){return _0x23eab0[_0x3614('0x23')]()[_0x3614('0x22')](function(){_0x4d690f['status'](0xcc)[_0x3614('0x16')]();});}};}function handleEntityNotFound(_0x2d1b9e,_0x3e7b4e){return function(_0x5a1875){if(!_0x5a1875){_0x2d1b9e[_0x3614('0x15')](0x194);}return _0x5a1875;};}function handleError(_0x22da7a,_0x54a59b){_0x54a59b=_0x54a59b||0x1f4;return function(_0x3b4930){logger[_0x3614('0x24')](_0x3b4930[_0x3614('0x25')]);if(_0x3b4930['name']){delete _0x3b4930[_0x3614('0x26')];}_0x22da7a[_0x3614('0x17')](_0x54a59b)[_0x3614('0x27')](_0x3b4930);};}exports[_0x3614('0x28')]=function(_0x1f5d0f,_0x778ba){var _0xe08258={},_0x5ab7bd={},_0x99f91={'count':0x0,'rows':[]};var _0x1871cc=_['map'](db[_0x3614('0x29')][_0x3614('0x2a')],function(_0x13e85b){return{'name':_0x13e85b['fieldName'],'type':_0x13e85b[_0x3614('0x2b')][_0x3614('0x2c')]};});_0x5ab7bd[_0x3614('0x2d')]=_[_0x3614('0x2e')](_0x1871cc,_0x3614('0x26'));_0x5ab7bd[_0x3614('0x2f')]=_[_0x3614('0x30')](_0x1f5d0f['query']);_0x5ab7bd[_0x3614('0x31')]=_[_0x3614('0x32')](_0x5ab7bd[_0x3614('0x2d')],_0x5ab7bd[_0x3614('0x2f')]);_0xe08258[_0x3614('0x33')]=_[_0x3614('0x32')](_0x5ab7bd[_0x3614('0x2d')],qs[_0x3614('0x34')](_0x1f5d0f[_0x3614('0x2f')][_0x3614('0x34')]));_0xe08258[_0x3614('0x33')]=_0xe08258[_0x3614('0x33')][_0x3614('0x35')]?_0xe08258[_0x3614('0x33')]:_0x5ab7bd[_0x3614('0x2d')];if(!_0x1f5d0f[_0x3614('0x2f')][_0x3614('0x36')](_0x3614('0x37'))){_0xe08258[_0x3614('0x1c')]=qs[_0x3614('0x1c')](_0x1f5d0f[_0x3614('0x2f')][_0x3614('0x1c')]);_0xe08258[_0x3614('0x1b')]=qs['offset'](_0x1f5d0f[_0x3614('0x2f')][_0x3614('0x1b')]);}_0xe08258[_0x3614('0x38')]=qs[_0x3614('0x39')](_0x1f5d0f[_0x3614('0x2f')][_0x3614('0x39')]);_0xe08258[_0x3614('0x3a')]=qs[_0x3614('0x31')](_['pick'](_0x1f5d0f[_0x3614('0x2f')],_0x5ab7bd['filters']),_0x1871cc);if(_0x1f5d0f[_0x3614('0x2f')]['filter']){_0xe08258[_0x3614('0x3a')]=_[_0x3614('0x3b')](_0xe08258[_0x3614('0x3a')],{'$or':_[_0x3614('0x2e')](_0x1871cc,function(_0x2e0de){if(_0x2e0de[_0x3614('0x2b')]!==_0x3614('0x3c')){var _0x16b5cd={};_0x16b5cd[_0x2e0de[_0x3614('0x26')]]={'$like':'%'+_0x1f5d0f['query'][_0x3614('0x3d')]+'%'};return _0x16b5cd;}})});}_0xe08258=_[_0x3614('0x3b')]({},_0xe08258,_0x1f5d0f[_0x3614('0x3e')]);var _0x4b6099={'where':_0xe08258['where']};return db[_0x3614('0x29')][_0x3614('0x1a')](_0x4b6099)[_0x3614('0x22')](function(_0x4040f6){_0x99f91[_0x3614('0x1a')]=_0x4040f6;if(_0x1f5d0f[_0x3614('0x2f')][_0x3614('0x3f')]){_0xe08258[_0x3614('0x40')]=[{'all':!![]}];}return db[_0x3614('0x29')][_0x3614('0x41')](_0xe08258);})[_0x3614('0x22')](function(_0x5907c3){_0x99f91[_0x3614('0x42')]=_0x5907c3;return _0x99f91;})[_0x3614('0x22')](respondWithFilteredResult(_0x778ba,_0xe08258))['catch'](handleError(_0x778ba,null));};exports[_0x3614('0x43')]=function(_0x3049cb,_0x86befa){var _0x443685={'raw':!![],'where':{'id':_0x3049cb[_0x3614('0x44')]['id']}},_0x226964={};_0x226964[_0x3614('0x2d')]=_['keys'](db[_0x3614('0x29')]['rawAttributes']);_0x226964[_0x3614('0x2f')]=_[_0x3614('0x30')](_0x3049cb[_0x3614('0x2f')]);_0x226964['filters']=_['intersection'](_0x226964['model'],_0x226964['query']);_0x443685['attributes']=_[_0x3614('0x32')](_0x226964[_0x3614('0x2d')],qs['fields'](_0x3049cb[_0x3614('0x2f')][_0x3614('0x34')]));_0x443685[_0x3614('0x33')]=_0x443685['attributes'][_0x3614('0x35')]?_0x443685[_0x3614('0x33')]:_0x226964[_0x3614('0x2d')];if(_0x3049cb[_0x3614('0x2f')][_0x3614('0x3f')]){_0x443685[_0x3614('0x40')]=[{'all':!![]}];}_0x443685=_['merge']({},_0x443685,_0x3049cb[_0x3614('0x3e')]);return db[_0x3614('0x29')]['find'](_0x443685)[_0x3614('0x22')](handleEntityNotFound(_0x86befa,null))['then'](respondWithResult(_0x86befa,null))['catch'](handleError(_0x86befa,null));};exports['create']=function(_0xb2aafe,_0x2ab025){return db[_0x3614('0x29')][_0x3614('0x45')](_0xb2aafe[_0x3614('0x46')],{})[_0x3614('0x22')](respondWithResult(_0x2ab025,0xc9))['catch'](handleError(_0x2ab025,null));};exports[_0x3614('0x47')]=function(_0x174361,_0x459e91){if(_0x174361['body']['id']){delete _0x174361[_0x3614('0x46')]['id'];}return db[_0x3614('0x29')][_0x3614('0x48')]({'where':{'id':_0x174361[_0x3614('0x44')]['id']}})[_0x3614('0x22')](handleEntityNotFound(_0x459e91,null))['then'](saveUpdates(_0x174361[_0x3614('0x46')],null))[_0x3614('0x22')](respondWithResult(_0x459e91,null))[_0x3614('0x49')](handleError(_0x459e91,null));};exports['destroy']=function(_0x4ecfa6,_0x989403){return db[_0x3614('0x29')]['find']({'where':{'id':_0x4ecfa6[_0x3614('0x44')]['id']}})[_0x3614('0x22')](handleEntityNotFound(_0x989403,null))['then'](removeEntity(_0x989403,null))[_0x3614('0x49')](handleError(_0x989403,null));};exports[_0x3614('0x4a')]=function(_0x5cda3d,_0x1dd82b){return db[_0x3614('0x29')]['describe']()[_0x3614('0x22')](respondWithResult(_0x1dd82b,null))[_0x3614('0x49')](handleError(_0x1dd82b,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 80bbb01..1f86647 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 _0x1738=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_call_transfer','../../config/logger','api'];(function(_0x4f839a,_0xbe16ea){var _0x2e02a4=function(_0xb48683){while(--_0xb48683){_0x4f839a['push'](_0x4f839a['shift']());}};_0x2e02a4(++_0xbe16ea);}(_0x1738,0xa3));var _0x8173=function(_0x455078,_0x2e09b4){_0x455078=_0x455078-0x0;var _0x41904a=_0x1738[_0x455078];return _0x41904a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8173('0x0'))(_0x8173('0x1'));var moment=require(_0x8173('0x2'));var BPromise=require(_0x8173('0x3'));var rp=require(_0x8173('0x4'));var fs=require('fs');var path=require(_0x8173('0x5'));var rimraf=require(_0x8173('0x6'));var config=require(_0x8173('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x8173('0x8')]=function(_0x359e42,_0x209bc8){return _0x359e42[_0x8173('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x8173('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea4b=['define','VoiceTransferReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x5a9bbb,_0x2c6cda){var _0x4fb028=function(_0x82745f){while(--_0x82745f){_0x5a9bbb['push'](_0x5a9bbb['shift']());}};_0x4fb028(++_0x2c6cda);}(_0xea4b,0xda));var _0xbea4=function(_0x304655,_0x15b109){_0x304655=_0x304655-0x0;var _0x2fa58a=_0xea4b[_0x304655];return _0x2fa58a;};'use strict';var _=require(_0xbea4('0x0'));var util=require(_0xbea4('0x1'));var logger=require(_0xbea4('0x2'))(_0xbea4('0x3'));var moment=require(_0xbea4('0x4'));var BPromise=require('bluebird');var rp=require(_0xbea4('0x5'));var fs=require('fs');var path=require(_0xbea4('0x6'));var rimraf=require(_0xbea4('0x7'));var config=require(_0xbea4('0x8'));var attributes=require(_0xbea4('0x9'));module['exports']=function(_0x2063b7,_0x288a80){return _0x2063b7[_0xbea4('0xa')](_0xbea4('0xb'),attributes,{'tableName':'report_call_transfer','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 dd152a1..4ce6ebf 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 _0x27c7=['result','catch','CreateVoiceTransferReport','create','body','options','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','debug','request\x20sent','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','info'];(function(_0x357f03,_0x40b654){var _0x49f019=function(_0x5b21c5){while(--_0x5b21c5){_0x357f03['push'](_0x357f03['shift']());}};_0x49f019(++_0x40b654);}(_0x27c7,0x173));var _0x727c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x27c7[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x727c('0x0'));var util=require(_0x727c('0x1'));var moment=require(_0x727c('0x2'));var BPromise=require(_0x727c('0x3'));var rs=require(_0x727c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x727c('0x5'))['db'];var utils=require(_0x727c('0x6'));var logger=require(_0x727c('0x7'))(_0x727c('0x8'));var config=require('../../config/environment');var jayson=require(_0x727c('0x9'));var client=jayson[_0x727c('0xa')][_0x727c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25699f,_0x261b5a,_0x17efac){return new BPromise(function(_0x39d9ae,_0x1d7a46){return client['request'](_0x25699f,_0x17efac)['then'](function(_0x59c38d){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x261b5a,'request\x20sent');logger[_0x727c('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x261b5a,_0x727c('0xd'),JSON[_0x727c('0xe')](_0x59c38d));if(_0x59c38d['error']){if(_0x59c38d['error']['code']===0x1f4){logger[_0x727c('0xf')](_0x727c('0x10'),_0x261b5a,_0x59c38d[_0x727c('0xf')]['message']);return _0x1d7a46(_0x59c38d[_0x727c('0xf')][_0x727c('0x11')]);}logger[_0x727c('0xf')](_0x727c('0x10'),_0x261b5a,_0x59c38d['error']['message']);return _0x39d9ae(_0x59c38d[_0x727c('0xf')]['message']);}else{logger[_0x727c('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x261b5a,'request\x20sent');_0x39d9ae(_0x59c38d[_0x727c('0x13')][_0x727c('0x11')]);}})[_0x727c('0x14')](function(_0x82f2d6){logger[_0x727c('0xf')](_0x727c('0x10'),_0x261b5a,_0x82f2d6);_0x1d7a46(_0x82f2d6);});});}exports[_0x727c('0x15')]=function(_0x254e55){var _0x54038b=this;return new Promise(function(_0x2987d9,_0x5d0706){return db['VoiceTransferReport'][_0x727c('0x16')](_0x254e55[_0x727c('0x17')],{'raw':_0x254e55['options']?_0x254e55[_0x727c('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x727c('0x19')](function(_0x22c763){logger['info'](_0x727c('0x15'),_0x254e55);logger[_0x727c('0xc')](_0x727c('0x15'),_0x254e55,JSON[_0x727c('0xe')](_0x22c763));_0x2987d9(_0x22c763);})['catch'](function(_0x330e84){logger['error'](_0x727c('0x15'),_0x330e84[_0x727c('0x11')],_0x254e55);_0x5d0706(_0x54038b[_0x727c('0xf')](0x1f4,_0x330e84['message']));});});}; \ No newline at end of file +var _0x7a55=['client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','code','message','error','catch','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x10283d,_0x3a4257){var _0x496087=function(_0x40c498){while(--_0x40c498){_0x10283d['push'](_0x10283d['shift']());}};_0x496087(++_0x3a4257);}(_0x7a55,0x156));var _0x57a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7a55[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57a5('0x0'));var util=require('util');var moment=require(_0x57a5('0x1'));var BPromise=require('bluebird');var rs=require(_0x57a5('0x2'));var fs=require('fs');var Redis=require(_0x57a5('0x3'));var db=require(_0x57a5('0x4'))['db'];var utils=require(_0x57a5('0x5'));var logger=require(_0x57a5('0x6'))(_0x57a5('0x7'));var config=require(_0x57a5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x57a5('0x9')][_0x57a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x488244,_0xa89eb9,_0x41fa0e){return new BPromise(function(_0x5a0879,_0x48b32a){return client[_0x57a5('0xb')](_0x488244,_0x41fa0e)[_0x57a5('0xc')](function(_0x162fcb){logger[_0x57a5('0xd')](_0x57a5('0xe'),_0xa89eb9,_0x57a5('0xf'));logger[_0x57a5('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xa89eb9,_0x57a5('0xf'),JSON['stringify'](_0x162fcb));if(_0x162fcb['error']){if(_0x162fcb['error'][_0x57a5('0x11')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0xa89eb9,_0x162fcb['error'][_0x57a5('0x12')]);return _0x48b32a(_0x162fcb['error'][_0x57a5('0x12')]);}logger['error'](_0x57a5('0xe'),_0xa89eb9,_0x162fcb[_0x57a5('0x13')][_0x57a5('0x12')]);return _0x5a0879(_0x162fcb[_0x57a5('0x13')][_0x57a5('0x12')]);}else{logger[_0x57a5('0xd')](_0x57a5('0xe'),_0xa89eb9,'request\x20sent');_0x5a0879(_0x162fcb['result'][_0x57a5('0x12')]);}})[_0x57a5('0x14')](function(_0x5bd5f5){logger['error'](_0x57a5('0xe'),_0xa89eb9,_0x5bd5f5);_0x48b32a(_0x5bd5f5);});});}exports['CreateVoiceTransferReport']=function(_0x2f5cc8){var _0x3feb99=this;return new Promise(function(_0x498c93,_0x5a4036){return db[_0x57a5('0x15')][_0x57a5('0x16')](_0x2f5cc8['body'],{'raw':_0x2f5cc8[_0x57a5('0x17')]?_0x2f5cc8[_0x57a5('0x17')][_0x57a5('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x53efd){logger['info'](_0x57a5('0x19'),_0x2f5cc8);logger['debug'](_0x57a5('0x19'),_0x2f5cc8,JSON[_0x57a5('0x1a')](_0x53efd));_0x498c93(_0x53efd);})[_0x57a5('0x14')](function(_0x1ac63e){logger[_0x57a5('0x13')](_0x57a5('0x19'),_0x1ac63e[_0x57a5('0x12')],_0x2f5cc8);_0x5a4036(_0x3feb99[_0x57a5('0x13')](0x1f4,_0x1ac63e['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 24042d2..8907531 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 _0x153f=['hold','/unhold','unhold','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','isWebrtcLicence','hangup','answer','/hold'];(function(_0x4d44e7,_0x474f27){var _0x330d51=function(_0x3bb475){while(--_0x3bb475){_0x4d44e7['push'](_0x4d44e7['shift']());}};_0x330d51(++_0x474f27);}(_0x153f,0x15b));var _0xf153=function(_0x6fddc1,_0x100780){_0x6fddc1=_0x6fddc1-0x0;var _0x381ca8=_0x153f[_0x6fddc1];return _0x381ca8;};'use strict';var express=require(_0xf153('0x0'));var router=express[_0xf153('0x1')]();var auth=require(_0xf153('0x2'));var controller=require(_0xf153('0x3'));router[_0xf153('0x4')](_0xf153('0x5'),auth[_0xf153('0x6')](),auth['isWebrtcLicence'](),controller[_0xf153('0x7')]);router['post'](_0xf153('0x8'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xa')]);router[_0xf153('0x4')]('/answer',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xb')]);router[_0xf153('0x4')](_0xf153('0xc'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0xd')]);router[_0xf153('0x4')](_0xf153('0xe'),auth['isAuthenticated'](),auth[_0xf153('0x9')](),controller[_0xf153('0xf')]);router[_0xf153('0x4')]('/calls',auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x10')]);router[_0xf153('0x4')](_0xf153('0x11'),auth[_0xf153('0x6')](),auth[_0xf153('0x9')](),controller[_0xf153('0x12')]);module[_0xf153('0x13')]=router; \ No newline at end of file +var _0x750a=['Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/unhold','unhold','/calls','calls','/transfer','transfer','exports'];(function(_0x25c92b,_0x41b368){var _0xc59d85=function(_0x10b32d){while(--_0x10b32d){_0x25c92b['push'](_0x25c92b['shift']());}};_0xc59d85(++_0x41b368);}(_0x750a,0x140));var _0xa750=function(_0x451d3e,_0x2408c0){_0x451d3e=_0x451d3e-0x0;var _0x19ba69=_0x750a[_0x451d3e];return _0x19ba69;};'use strict';var express=require('express');var router=express[_0xa750('0x0')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0xa750('0x1')](_0xa750('0x2'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x5')]);router[_0xa750('0x1')](_0xa750('0x6'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x7')]);router[_0xa750('0x1')](_0xa750('0x8'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xa750('0x1')]('/hold',auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller['hold']);router[_0xa750('0x1')](_0xa750('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xa750('0xa')]);router['post'](_0xa750('0xb'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller[_0xa750('0xc')]);router[_0xa750('0x1')](_0xa750('0xd'),auth['isAuthenticated'](),auth[_0xa750('0x4')](),controller[_0xa750('0xe')]);module[_0xa750('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index fa03f30..1c27e7d 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 _0x4d9e=['length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','then','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup\x20fired:','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer','transferNumber','path','../../config/environment','bluebird','client','http','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','catch','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x658141,_0xba678d){_0x658141=_0x658141-0x0;var _0x539113=_0x4d9e[_0x658141];return _0x539113;};'use strict';var path=require(_0xe4d9('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xe4d9('0x1'));var util=require('util');var BPromise=require(_0xe4d9('0x2'));var jayson=require('jayson/promise');var amiClient=jayson[_0xe4d9('0x3')][_0xe4d9('0x4')]({'port':0x232a});var logger=require('../../config/logger')(_0xe4d9('0x5'));var Redis=require(_0xe4d9('0x6'));config[_0xe4d9('0x7')]=_[_0xe4d9('0x8')](config[_0xe4d9('0x7')],{'host':_0xe4d9('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe4d9('0x7')]));var Schema=require(_0xe4d9('0xa'));var originateValidation=new Schema({'userId':{'type':_0xe4d9('0xb'),'required':[!![],_0xe4d9('0xc')]},'callNumber':{'type':_0xe4d9('0xd'),'required':[!![],_0xe4d9('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe4d9('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xe4d9('0xb'),'required':[!![],_0xe4d9('0xc')]},'sessionId':{'type':_0xe4d9('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe4d9('0xb'),'required':[!![],_0xe4d9('0xc')]},'sessionId':{'type':_0xe4d9('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe4d9('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe4d9('0xb'),'required':[!![],_0xe4d9('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe4d9('0xb'),'required':[!![],_0xe4d9('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe4d9('0xb'),'required':[!![],_0xe4d9('0xc')]}});function emit(_0x58d0cf,_0x331ef3,_0x35cbc2){logger[_0xe4d9('0xf')](_0x58d0cf,_0x331ef3,JSON['stringify'](_0x35cbc2));io['to'](_0x58d0cf)['emit'](_0x331ef3,_0x35cbc2);}function handleError(_0x7abb80){return function(_0x112315){console['log'](_0xe4d9('0x10'),_0x112315,_0x112315 instanceof RangeError);logger['error'](_0x112315[_0xe4d9('0x11')]);if(_0x112315 instanceof RangeError){if(_0x112315[_0xe4d9('0x12')]){delete _0x112315[_0xe4d9('0x12')];}_0x7abb80[_0xe4d9('0x13')](0x194)['send'](_0x112315);}else{if(_0x112315[_0xe4d9('0x12')]){delete _0x112315[_0xe4d9('0x12')];}_0x7abb80[_0xe4d9('0x13')](0x1f4)[_0xe4d9('0x14')](_0x112315);}};}function checkError(){return function(_0x2c6b89){if(!_0x2c6b89){throw new RangeError(_0xe4d9('0x15'));}return _0x2c6b89;};}function respondWithRpcPromise(_0x30d923,_0x29e0c9){return new BPromise(function(_0x562bab,_0x4fed7f){var _0x44f1aa=amiClient;return _0x44f1aa[_0xe4d9('0x16')](_0x30d923,_0x29e0c9)['then'](function(_0x189dad){if(_0x189dad['error']){if(_0x189dad[_0xe4d9('0x17')][_0xe4d9('0x18')]===0x1f4){return _0x4fed7f(_0x189dad['error'][_0xe4d9('0x19')]);}return _0x562bab(_0x189dad[_0xe4d9('0x17')]['message']);}else{_0x562bab(_0x189dad[_0xe4d9('0x1a')]);}})[_0xe4d9('0x1b')](function(_0x36444c){_0x4fed7f(_0x36444c);});});}function getAgent(_0x5bb43b){return db['User'][_0xe4d9('0x1c')]({'where':{'id':_0x5bb43b,'role':_0xe4d9('0x1d')}})['then'](checkError());}function getAgentCheckSession(_0x5dddd2,_0x4954b5){return new BPromise(function(_0x529e2b,_0x221a61){var _0x48d481=respondWithRpcPromise(_0xe4d9('0x1e'));var _0x1f3d90=getAgent(_0x5dddd2);Promise[_0xe4d9('0x1f')]([_0x48d481,_0x1f3d90])['then'](function(_0xec8d64){var _0x2a0d1f=_0xec8d64[0x0];var _0x250de5=_0xec8d64[0x1];var _0x45e8a3=_[_0xe4d9('0x20')](_0x2a0d1f[_0xe4d9('0x21')],function(_0x21b7a9){return _0x21b7a9[_0xe4d9('0x22')]==_0x250de5['id']&&_0x21b7a9[_0xe4d9('0x23')]==_0x4954b5;});if(_0x45e8a3[_0xe4d9('0x24')]==0x1){_0x529e2b(_0x250de5);}else{_0x221a61(new RangeError(_0xe4d9('0x25')+_0x4954b5+_0xe4d9('0x26')));}});});}exports['originate']=function(_0x22efd2,_0x349be3){logger[_0xe4d9('0xf')](_0xe4d9('0x27'),_0x22efd2[_0xe4d9('0x28')]);var _0x12e0ae=originateValidation['validate'](_0x22efd2['body']);if(_0x12e0ae['length']>0x0){return _0x349be3[_0xe4d9('0x13')](0x190)[_0xe4d9('0x29')](_0x12e0ae);}var _0x9f1acf=_0x22efd2['body']['userId'];var _0x5ad794=_0x22efd2['body'][_0xe4d9('0x2a')];var _0x16aaff=_0x22efd2['body'][_0xe4d9('0x2b')];var _0x24c084=_0x22efd2['body'][_0xe4d9('0x2c')];return getAgent(_0x9f1acf)[_0xe4d9('0x2d')](function(_0x945a80){logger[_0xe4d9('0xf')](_0xe4d9('0x2e'),_0x945a80[_0xe4d9('0x12')]);emit(util[_0xe4d9('0x2f')](_0xe4d9('0x30'),_0x945a80[_0xe4d9('0x12')]),_0xe4d9('0x31'),{'callNumber':_0x5ad794,'callerId':_0x16aaff,'callbackUrl':_0x24c084});return _0x349be3[_0xe4d9('0x13')](0xc8)[_0xe4d9('0x29')]({'error':![],'message':_0xe4d9('0x32')});})[_0xe4d9('0x1b')](handleError(_0x349be3));};exports['hangup']=function(_0x35b5f5,_0x20aef6){logger[_0xe4d9('0xf')](_0xe4d9('0x33'),_0x35b5f5[_0xe4d9('0x28')]);var _0x331161=hangupValidation[_0xe4d9('0xa')](_0x35b5f5[_0xe4d9('0x28')]);if(_0x331161[_0xe4d9('0x24')]>0x0){return _0x20aef6['status'](0x190)['json'](_0x331161);}var _0x5f5bc5=_0x35b5f5[_0xe4d9('0x28')][_0xe4d9('0x34')];var _0x32179b=_0x35b5f5[_0xe4d9('0x28')][_0xe4d9('0x23')];return getAgent(_0x5f5bc5)[_0xe4d9('0x2d')](function(_0x392cdd){logger['info']('entityFound:',_0x392cdd['name']);emit(util[_0xe4d9('0x2f')](_0xe4d9('0x30'),_0x392cdd['name']),_0xe4d9('0x35'),{'sessionId':_0x32179b});return _0x20aef6[_0xe4d9('0x13')](0xc8)[_0xe4d9('0x29')]({'error':![],'message':_0xe4d9('0x36')});})['catch'](handleError(_0x20aef6));};exports[_0xe4d9('0x37')]=function(_0x348667,_0x2afa91){logger[_0xe4d9('0xf')](_0xe4d9('0x38'),_0x348667[_0xe4d9('0x28')]);var _0x25b1f0=answerValidation[_0xe4d9('0xa')](_0x348667[_0xe4d9('0x28')]);if(_0x25b1f0[_0xe4d9('0x24')]>0x0){return _0x2afa91[_0xe4d9('0x13')](0x190)['json'](_0x25b1f0);}var _0x429be=_0x348667[_0xe4d9('0x28')][_0xe4d9('0x34')];var _0x2b7e25=_0x348667[_0xe4d9('0x28')]['sessionId'];return getAgent(_0x429be)[_0xe4d9('0x2d')](function(_0x31db47){logger[_0xe4d9('0xf')](_0xe4d9('0x2e'),_0x31db47[_0xe4d9('0x12')]);emit(util[_0xe4d9('0x2f')](_0xe4d9('0x30'),_0x31db47[_0xe4d9('0x12')]),_0xe4d9('0x39'),{'sessionId':_0x2b7e25});return _0x2afa91[_0xe4d9('0x13')](0xc8)['json']({'error':![],'message':_0xe4d9('0x3a')});})[_0xe4d9('0x1b')](handleError(_0x2afa91));};exports[_0xe4d9('0x3b')]=function(_0x54bf07,_0x131e11){logger[_0xe4d9('0xf')](_0xe4d9('0x3c'),_0x54bf07[_0xe4d9('0x28')]);var _0x1e0b7b=holdValidation[_0xe4d9('0xa')](_0x54bf07[_0xe4d9('0x28')]);if(_0x1e0b7b['length']>0x0){return _0x131e11[_0xe4d9('0x13')](0x190)[_0xe4d9('0x29')](_0x1e0b7b);}var _0x38bc8f=_0x54bf07[_0xe4d9('0x28')][_0xe4d9('0x34')];var _0x423881=_0x54bf07['body'][_0xe4d9('0x23')];return getAgent(_0x38bc8f)[_0xe4d9('0x2d')](function(_0x87f230){logger[_0xe4d9('0xf')](_0xe4d9('0x2e'),_0x87f230[_0xe4d9('0x12')]);emit(util['format'](_0xe4d9('0x30'),_0x87f230[_0xe4d9('0x12')]),'webbar:hold',{'sessionId':_0x423881});return _0x131e11[_0xe4d9('0x13')](0xc8)['json']({'error':![],'message':_0xe4d9('0x3d')});})[_0xe4d9('0x1b')](handleError(_0x131e11));};exports['unhold']=function(_0x657961,_0x5e5267){logger[_0xe4d9('0xf')](_0xe4d9('0x3e'),_0x657961[_0xe4d9('0x28')]);var _0x48b9fa=unholdValidation[_0xe4d9('0xa')](_0x657961[_0xe4d9('0x28')]);if(_0x48b9fa['length']>0x0){return _0x5e5267[_0xe4d9('0x13')](0x190)[_0xe4d9('0x29')](_0x48b9fa);}var _0x37af58=_0x657961[_0xe4d9('0x28')]['userId'];var _0x50f513=_0x657961[_0xe4d9('0x28')][_0xe4d9('0x23')];return getAgent(_0x37af58)[_0xe4d9('0x2d')](function(_0x19ebdc){logger[_0xe4d9('0xf')](_0xe4d9('0x2e'),_0x19ebdc['name']);emit(util['format'](_0xe4d9('0x30'),_0x19ebdc[_0xe4d9('0x12')]),_0xe4d9('0x3f'),{'sessionId':_0x50f513});return _0x5e5267[_0xe4d9('0x13')](0xc8)[_0xe4d9('0x29')]({'error':![],'message':_0xe4d9('0x40')});})['catch'](handleError(_0x5e5267));};exports[_0xe4d9('0x41')]=function(_0x291d0c,_0x47596a){logger['info'](_0xe4d9('0x42'),_0x47596a[_0xe4d9('0x28')]);var _0x281fda=callsValidation['validate'](_0x291d0c[_0xe4d9('0x28')]);if(_0x281fda['length']>0x0){return _0x47596a[_0xe4d9('0x13')](0x190)[_0xe4d9('0x29')](_0x281fda);}var _0x175346=_0x291d0c['body']['userId'];var _0x5bd06b=respondWithRpcPromise(_0xe4d9('0x1e'));var _0x588bcb=getAgent(_0x175346);return Promise[_0xe4d9('0x1f')]([_0x5bd06b,_0x588bcb])['then'](function(_0x4d7e81){var _0x3c2196=_0x4d7e81[0x0];var _0x2a4428=_0x4d7e81[0x1];var _0x467c29=_[_0xe4d9('0x20')](_0x3c2196[_0xe4d9('0x21')],function(_0x580bb4){return _0x580bb4['UserId']==_0x2a4428['id'];});return _0x47596a['status'](0xc8)['json']({'count':_0x467c29[_0xe4d9('0x24')],'rows':_0x467c29});})[_0xe4d9('0x1b')](handleError(_0x47596a));};exports[_0xe4d9('0x43')]=function(_0x39e74a,_0x1d522e){logger[_0xe4d9('0xf')](_0xe4d9('0x44'),_0x39e74a['body']);var _0x524e8c=conferenceValidation[_0xe4d9('0xa')](_0x39e74a[_0xe4d9('0x28')]);if(_0x524e8c[_0xe4d9('0x24')]>0x0){return _0x1d522e[_0xe4d9('0x13')](0x190)[_0xe4d9('0x29')](_0x524e8c);}var _0xa7cbad=_0x39e74a[_0xe4d9('0x28')][_0xe4d9('0x34')];return getAgent(_0xa7cbad)[_0xe4d9('0x2d')](function(_0x394635){logger[_0xe4d9('0xf')](_0xe4d9('0x2e'),_0x394635['name']);emit(util[_0xe4d9('0x2f')](_0xe4d9('0x30'),_0x394635[_0xe4d9('0x12')]),_0xe4d9('0x45'));return _0x1d522e['status'](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0xe4d9('0x1b')](handleError(_0x1d522e));};exports[_0xe4d9('0x46')]=function(_0x3ffe34,_0x43b750){logger['info']('transfer\x20fired:',_0x3ffe34[_0xe4d9('0x28')]);var _0xf41d89=transferValidation[_0xe4d9('0xa')](_0x3ffe34[_0xe4d9('0x28')]);if(_0xf41d89[_0xe4d9('0x24')]>0x0){return _0x43b750[_0xe4d9('0x13')](0x190)['json'](_0xf41d89);}var _0x348c8d=_0x3ffe34['body'][_0xe4d9('0x34')];var _0x3be5a4=_0x3ffe34['body'][_0xe4d9('0x23')];var _0xc31086=_0x3ffe34['body'][_0xe4d9('0x47')];return getAgent(_0x348c8d)[_0xe4d9('0x2d')](function(_0x46d795){logger[_0xe4d9('0xf')](_0xe4d9('0x2e'),_0x46d795[_0xe4d9('0x12')]);emit(util['format']('user:%s',_0x46d795[_0xe4d9('0x12')]),'webbar:transfer',{'sessionId':_0x3be5a4,'transferNumber':_0xc31086});return _0x43b750[_0xe4d9('0x13')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})[_0xe4d9('0x1b')](handleError(_0x43b750));}; \ No newline at end of file +var _0xcffe=['transfer','transfer\x20fired:','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','result','catch','User','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','all'];(function(_0x50d1e9,_0x4d7f70){var _0x3d410b=function(_0x297f3a){while(--_0x297f3a){_0x50d1e9['push'](_0x50d1e9['shift']());}};_0x3d410b(++_0x4d7f70);}(_0xcffe,0x1a1));var _0xecff=function(_0x239b5a,_0x56199a){_0x239b5a=_0x239b5a-0x0;var _0x5a701c=_0xcffe[_0x239b5a];return _0x5a701c;};'use strict';var path=require(_0xecff('0x0'));var fs=require('fs');var _=require(_0xecff('0x1'));var db=require(_0xecff('0x2'))['db'];var config=require(_0xecff('0x3'));var util=require(_0xecff('0x4'));var BPromise=require(_0xecff('0x5'));var jayson=require(_0xecff('0x6'));var amiClient=jayson[_0xecff('0x7')][_0xecff('0x8')]({'port':0x232a});var logger=require(_0xecff('0x9'))('webbarapi');var Redis=require('ioredis');config[_0xecff('0xa')]=_[_0xecff('0xb')](config[_0xecff('0xa')],{'host':_0xecff('0xc'),'port':0x18eb});var io=require(_0xecff('0xd'))(new Redis(config[_0xecff('0xa')]));var Schema=require(_0xecff('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xecff('0xf')]},'callNumber':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x11')]},'callerId':{'type':_0xecff('0x10')},'callbackUrl':{'type':_0xecff('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x13')]},'transferNumber':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]}});function emit(_0x3a7623,_0x596b09,_0x52b62f){logger[_0xecff('0x15')](_0x3a7623,_0x596b09,JSON[_0xecff('0x16')](_0x52b62f));io['to'](_0x3a7623)['emit'](_0x596b09,_0x52b62f);}function handleError(_0x42d6c1){return function(_0x3adc81){console[_0xecff('0x17')](_0xecff('0x18'),_0x3adc81,_0x3adc81 instanceof RangeError);logger[_0xecff('0x19')](_0x3adc81[_0xecff('0x1a')]);if(_0x3adc81 instanceof RangeError){if(_0x3adc81['name']){delete _0x3adc81[_0xecff('0x1b')];}_0x42d6c1[_0xecff('0x1c')](0x194)[_0xecff('0x1d')](_0x3adc81);}else{if(_0x3adc81[_0xecff('0x1b')]){delete _0x3adc81['name'];}_0x42d6c1[_0xecff('0x1c')](0x1f4)[_0xecff('0x1d')](_0x3adc81);}};}function checkError(){return function(_0x393acf){if(!_0x393acf){throw new RangeError(_0xecff('0x1e'));}return _0x393acf;};}function respondWithRpcPromise(_0x284458,_0x2402e0){return new BPromise(function(_0x494754,_0x14378d){var _0x520d6d=amiClient;return _0x520d6d['request'](_0x284458,_0x2402e0)[_0xecff('0x1f')](function(_0x4fdc8e){if(_0x4fdc8e[_0xecff('0x19')]){if(_0x4fdc8e['error'][_0xecff('0x20')]===0x1f4){return _0x14378d(_0x4fdc8e['error'][_0xecff('0x21')]);}return _0x494754(_0x4fdc8e[_0xecff('0x19')]['message']);}else{_0x494754(_0x4fdc8e[_0xecff('0x22')]);}})[_0xecff('0x23')](function(_0x393312){_0x14378d(_0x393312);});});}function getAgent(_0x3cadb9){return db[_0xecff('0x24')]['findOne']({'where':{'id':_0x3cadb9,'role':'agent'}})[_0xecff('0x1f')](checkError());}function getAgentCheckSession(_0x484415,_0x1281d8){return new BPromise(function(_0x3ef198,_0x49a224){var _0x1dfeb6=respondWithRpcPromise('VoiceChannels');var _0x4e7afa=getAgent(_0x484415);Promise['all']([_0x1dfeb6,_0x4e7afa])[_0xecff('0x1f')](function(_0xabe5da){var _0x230d04=_0xabe5da[0x0];var _0x1e3175=_0xabe5da[0x1];var _0x5e70f3=_[_0xecff('0x25')](_0x230d04[_0xecff('0x26')],function(_0x1926a5){return _0x1926a5['UserId']==_0x1e3175['id']&&_0x1926a5[_0xecff('0x27')]==_0x1281d8;});if(_0x5e70f3[_0xecff('0x28')]==0x1){_0x3ef198(_0x1e3175);}else{_0x49a224(new RangeError(_0xecff('0x29')+_0x1281d8+_0xecff('0x2a')));}});});}exports['originate']=function(_0x7e7a6c,_0x350297){logger['info'](_0xecff('0x2b'),_0x7e7a6c[_0xecff('0x2c')]);var _0xaa3c9a=originateValidation[_0xecff('0xe')](_0x7e7a6c['body']);if(_0xaa3c9a[_0xecff('0x28')]>0x0){return _0x350297[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0xaa3c9a);}var _0x55c232=_0x7e7a6c[_0xecff('0x2c')][_0xecff('0x2e')];var _0x16ef80=_0x7e7a6c[_0xecff('0x2c')][_0xecff('0x2f')];var _0x20db12=_0x7e7a6c['body']['callerId'];var _0x4dd43c=_0x7e7a6c[_0xecff('0x2c')]['callbackUrl'];return getAgent(_0x55c232)[_0xecff('0x1f')](function(_0x21411b){logger['info'](_0xecff('0x30'),_0x21411b[_0xecff('0x1b')]);emit(util[_0xecff('0x31')]('user:%s',_0x21411b[_0xecff('0x1b')]),_0xecff('0x32'),{'callNumber':_0x16ef80,'callerId':_0x20db12,'callbackUrl':_0x4dd43c});return _0x350297[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x33')});})[_0xecff('0x23')](handleError(_0x350297));};exports[_0xecff('0x34')]=function(_0x13a525,_0x317037){logger[_0xecff('0x15')](_0xecff('0x35'),_0x13a525[_0xecff('0x2c')]);var _0x6d3916=hangupValidation[_0xecff('0xe')](_0x13a525[_0xecff('0x2c')]);if(_0x6d3916['length']>0x0){return _0x317037[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x6d3916);}var _0x199019=_0x13a525[_0xecff('0x2c')][_0xecff('0x2e')];var _0x19626e=_0x13a525[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x199019)['then'](function(_0x28141f){logger['info'](_0xecff('0x30'),_0x28141f[_0xecff('0x1b')]);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x28141f[_0xecff('0x1b')]),_0xecff('0x37'),{'sessionId':_0x19626e});return _0x317037[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x38')});})[_0xecff('0x23')](handleError(_0x317037));};exports['answer']=function(_0x4d4c7b,_0x3a7ebc){logger[_0xecff('0x15')](_0xecff('0x39'),_0x4d4c7b[_0xecff('0x2c')]);var _0x47084b=answerValidation[_0xecff('0xe')](_0x4d4c7b['body']);if(_0x47084b[_0xecff('0x28')]>0x0){return _0x3a7ebc[_0xecff('0x1c')](0x190)['json'](_0x47084b);}var _0x8b0f59=_0x4d4c7b[_0xecff('0x2c')][_0xecff('0x2e')];var _0x4402a0=_0x4d4c7b[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x8b0f59)['then'](function(_0x310593){logger[_0xecff('0x15')](_0xecff('0x30'),_0x310593['name']);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x310593[_0xecff('0x1b')]),_0xecff('0x3a'),{'sessionId':_0x4402a0});return _0x3a7ebc['status'](0xc8)[_0xecff('0x2d')]({'error':![],'message':_0xecff('0x3b')});})['catch'](handleError(_0x3a7ebc));};exports[_0xecff('0x3c')]=function(_0x1d2ac3,_0x4ba9e3){logger[_0xecff('0x15')]('hold\x20fired:',_0x1d2ac3[_0xecff('0x2c')]);var _0x3692c9=holdValidation[_0xecff('0xe')](_0x1d2ac3[_0xecff('0x2c')]);if(_0x3692c9[_0xecff('0x28')]>0x0){return _0x4ba9e3[_0xecff('0x1c')](0x190)['json'](_0x3692c9);}var _0x596eb8=_0x1d2ac3[_0xecff('0x2c')][_0xecff('0x2e')];var _0x1aae95=_0x1d2ac3[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x596eb8)[_0xecff('0x1f')](function(_0x36c50f){logger[_0xecff('0x15')]('entityFound:',_0x36c50f[_0xecff('0x1b')]);emit(util[_0xecff('0x31')]('user:%s',_0x36c50f[_0xecff('0x1b')]),'webbar:hold',{'sessionId':_0x1aae95});return _0x4ba9e3[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0xecff('0x23')](handleError(_0x4ba9e3));};exports[_0xecff('0x3d')]=function(_0x3e79f9,_0x188d08){logger[_0xecff('0x15')]('unhold\x20fired:',_0x3e79f9['body']);var _0x198ad6=unholdValidation[_0xecff('0xe')](_0x3e79f9[_0xecff('0x2c')]);if(_0x198ad6[_0xecff('0x28')]>0x0){return _0x188d08[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x198ad6);}var _0x339d3d=_0x3e79f9[_0xecff('0x2c')][_0xecff('0x2e')];var _0x4f9060=_0x3e79f9[_0xecff('0x2c')]['sessionId'];return getAgent(_0x339d3d)[_0xecff('0x1f')](function(_0x1ae9e3){logger[_0xecff('0x15')]('entityFound:',_0x1ae9e3[_0xecff('0x1b')]);emit(util['format'](_0xecff('0x36'),_0x1ae9e3['name']),'webbar:unhold',{'sessionId':_0x4f9060});return _0x188d08[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x3e')});})[_0xecff('0x23')](handleError(_0x188d08));};exports['calls']=function(_0x2d0ed7,_0x3bdf47){logger[_0xecff('0x15')](_0xecff('0x3f'),_0x3bdf47[_0xecff('0x2c')]);var _0x162938=callsValidation[_0xecff('0xe')](_0x2d0ed7[_0xecff('0x2c')]);if(_0x162938['length']>0x0){return _0x3bdf47[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x162938);}var _0x18ead4=_0x2d0ed7[_0xecff('0x2c')][_0xecff('0x2e')];var _0x12d549=respondWithRpcPromise(_0xecff('0x40'));var _0x33bcb1=getAgent(_0x18ead4);return Promise[_0xecff('0x41')]([_0x12d549,_0x33bcb1])[_0xecff('0x1f')](function(_0xa48ffb){var _0x10939a=_0xa48ffb[0x0];var _0x3f8e22=_0xa48ffb[0x1];var _0x88882b=_['filter'](_0x10939a['rows'],function(_0x13ec0f){return _0x13ec0f['UserId']==_0x3f8e22['id'];});return _0x3bdf47['status'](0xc8)[_0xecff('0x2d')]({'count':_0x88882b[_0xecff('0x28')],'rows':_0x88882b});})[_0xecff('0x23')](handleError(_0x3bdf47));};exports['conference']=function(_0x161190,_0x1eabd0){logger[_0xecff('0x15')]('conference\x20fired:',_0x161190[_0xecff('0x2c')]);var _0x56eefb=conferenceValidation['validate'](_0x161190[_0xecff('0x2c')]);if(_0x56eefb[_0xecff('0x28')]>0x0){return _0x1eabd0[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x56eefb);}var _0x303a=_0x161190[_0xecff('0x2c')][_0xecff('0x2e')];return getAgent(_0x303a)[_0xecff('0x1f')](function(_0x345ceb){logger[_0xecff('0x15')](_0xecff('0x30'),_0x345ceb[_0xecff('0x1b')]);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x345ceb['name']),'webbar:conference');return _0x1eabd0[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0xecff('0x23')](handleError(_0x1eabd0));};exports[_0xecff('0x42')]=function(_0x59857d,_0x148c69){logger[_0xecff('0x15')](_0xecff('0x43'),_0x59857d[_0xecff('0x2c')]);var _0x20e8ab=transferValidation[_0xecff('0xe')](_0x59857d['body']);if(_0x20e8ab[_0xecff('0x28')]>0x0){return _0x148c69[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x20e8ab);}var _0x3c333c=_0x59857d[_0xecff('0x2c')]['userId'];var _0x31cd2d=_0x59857d[_0xecff('0x2c')][_0xecff('0x27')];var _0x3e54b8=_0x59857d['body']['transferNumber'];return getAgent(_0x3c333c)['then'](function(_0x3882cf){logger[_0xecff('0x15')](_0xecff('0x30'),_0x3882cf['name']);emit(util[_0xecff('0x31')]('user:%s',_0x3882cf[_0xecff('0x1b')]),_0xecff('0x44'),{'sessionId':_0x31cd2d,'transferNumber':_0x3e54b8});return _0x148c69[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'transfer\x20executed!'});})[_0xecff('0x23')](handleError(_0x148c69));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 00cf539..ef64444 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 _0x0366=['getApplications','create','post','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/users','getAgents','/:id/applications'];(function(_0x52a740,_0x570e6f){var _0x25c236=function(_0xd8d609){while(--_0xd8d609){_0x52a740['push'](_0x52a740['shift']());}};_0x25c236(++_0x570e6f);}(_0x0366,0x97));var _0x6036=function(_0x2153d2,_0x4ef081){_0x2153d2=_0x2153d2-0x0;var _0x5affac=_0x0366[_0x2153d2];return _0x5affac;};'use strict';var multer=require(_0x6036('0x0'));var util=require(_0x6036('0x1'));var path=require('path');var timeout=require(_0x6036('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6036('0x3'));var auth=require(_0x6036('0x4'));var interaction=require(_0x6036('0x5'));var config=require(_0x6036('0x6'));var controller=require(_0x6036('0x7'));router[_0x6036('0x8')]('/',auth[_0x6036('0x9')](),controller[_0x6036('0xa')]);router[_0x6036('0x8')](_0x6036('0xb'),auth[_0x6036('0x9')](),controller['describe']);router[_0x6036('0x8')](_0x6036('0xc'),auth[_0x6036('0x9')](),controller[_0x6036('0xd')]);router['get'](_0x6036('0xe'),auth['isAuthenticated'](),controller[_0x6036('0xf')]);router[_0x6036('0x8')]('/:id/canned_answers',auth[_0x6036('0x9')](),controller['getAnswers']);router[_0x6036('0x8')](_0x6036('0x10'),auth[_0x6036('0x9')](),controller[_0x6036('0x11')]);router[_0x6036('0x8')](_0x6036('0x12'),auth['isAuthenticated'](),controller[_0x6036('0x13')]);router['post']('/',auth[_0x6036('0x9')](),controller[_0x6036('0x14')]);router[_0x6036('0x15')](_0x6036('0xe'),auth[_0x6036('0x9')](),controller['addDisposition']);router[_0x6036('0x15')](_0x6036('0x16'),auth[_0x6036('0x9')](),controller[_0x6036('0x17')]);router[_0x6036('0x15')](_0x6036('0x10'),auth[_0x6036('0x9')](),controller[_0x6036('0x18')]);router[_0x6036('0x15')](_0x6036('0x12'),auth[_0x6036('0x9')](),controller[_0x6036('0x19')]);router[_0x6036('0x15')](_0x6036('0x1a'),controller['notify']);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x6036('0x1b')]);router[_0x6036('0x1c')](_0x6036('0xc'),auth['isAuthenticated'](),controller[_0x6036('0x1d')]);router[_0x6036('0x1e')](_0x6036('0xc'),auth[_0x6036('0x9')](),controller[_0x6036('0x1f')]);router[_0x6036('0x1e')](_0x6036('0xe'),auth[_0x6036('0x9')](),controller['removeDispositions']);router['delete'](_0x6036('0x16'),auth[_0x6036('0x9')](),controller[_0x6036('0x20')]);router[_0x6036('0x1e')](_0x6036('0x10'),auth[_0x6036('0x9')](),controller[_0x6036('0x21')]);module['exports']=router; \ No newline at end of file +var _0xf70a=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','/:id/send','send','update','destroy','removeDispositions'];(function(_0x3d6e1e,_0x57e708){var _0x3082cf=function(_0x55afde){while(--_0x55afde){_0x3d6e1e['push'](_0x3d6e1e['shift']());}};_0x3082cf(++_0x57e708);}(_0xf70a,0xa6));var _0xaf70=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0xf70a[_0x301dab];return _0x2500a2;};'use strict';var multer=require('multer');var util=require(_0xaf70('0x0'));var path=require('path');var timeout=require(_0xaf70('0x1'));var express=require(_0xaf70('0x2'));var router=express[_0xaf70('0x3')]();var fs_extra=require(_0xaf70('0x4'));var auth=require(_0xaf70('0x5'));var interaction=require(_0xaf70('0x6'));var config=require(_0xaf70('0x7'));var controller=require(_0xaf70('0x8'));router[_0xaf70('0x9')]('/',auth['isAuthenticated'](),controller[_0xaf70('0xa')]);router[_0xaf70('0x9')](_0xaf70('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xaf70('0x9')]('/:id',auth[_0xaf70('0xc')](),controller['show']);router[_0xaf70('0x9')](_0xaf70('0xd'),auth[_0xaf70('0xc')](),controller['getDispositions']);router[_0xaf70('0x9')](_0xaf70('0xe'),auth[_0xaf70('0xc')](),controller[_0xaf70('0xf')]);router[_0xaf70('0x9')](_0xaf70('0x10'),auth[_0xaf70('0xc')](),controller[_0xaf70('0x11')]);router['get'](_0xaf70('0x12'),auth[_0xaf70('0xc')](),controller[_0xaf70('0x13')]);router[_0xaf70('0x14')]('/',auth['isAuthenticated'](),controller[_0xaf70('0x15')]);router[_0xaf70('0x14')](_0xaf70('0xd'),auth[_0xaf70('0xc')](),controller[_0xaf70('0x16')]);router[_0xaf70('0x14')]('/:id/canned_answers',auth[_0xaf70('0xc')](),controller[_0xaf70('0x17')]);router['post'](_0xaf70('0x10'),auth[_0xaf70('0xc')](),controller[_0xaf70('0x18')]);router[_0xaf70('0x14')](_0xaf70('0x12'),auth['isAuthenticated'](),controller[_0xaf70('0x19')]);router['post'](_0xaf70('0x1a'),controller['notify']);router[_0xaf70('0x14')](_0xaf70('0x1b'),auth[_0xaf70('0xc')](),controller[_0xaf70('0x1c')]);router['put']('/:id',auth[_0xaf70('0xc')](),controller[_0xaf70('0x1d')]);router['delete']('/:id',auth[_0xaf70('0xc')](),controller[_0xaf70('0x1e')]);router['delete'](_0xaf70('0xd'),auth[_0xaf70('0xc')](),controller[_0xaf70('0x1f')]);router['delete'](_0xaf70('0xe'),auth[_0xaf70('0xc')](),controller['removeAnswers']);router['delete'](_0xaf70('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xaf70('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index ee9f71c..f456327 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 _0x30a9=['ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate'];(function(_0x4271c1,_0xe18fca){var _0x551b23=function(_0x233ad5){while(--_0x233ad5){_0x4271c1['push'](_0x4271c1['shift']());}};_0x551b23(++_0xe18fca);}(_0x30a9,0x82));var _0x930a=function(_0x475950,_0x55d3ea){_0x475950=_0x475950-0x0;var _0xf2fca8=_0x30a9[_0x475950];return _0xf2fca8;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x930a('0x0'));module[_0x930a('0x1')]={'name':{'type':Sequelize[_0x930a('0x2')],'unique':_0x930a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x930a('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x930a('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x930a('0x4')]();}},'phone':{'type':Sequelize[_0x930a('0x2')]},'type':{'type':Sequelize[_0x930a('0x5')](_0x930a('0x6'),_0x930a('0x7'))},'accountSid':{'type':Sequelize[_0x930a('0x2')]},'baseUrl':{'type':Sequelize[_0x930a('0x2')]},'authToken':{'type':Sequelize[_0x930a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x930a('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x930a('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x930a('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x930a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x930a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x930a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x930a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x930a('0xa')],'comment':_0x930a('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x930a('0x9')],'defaultValue':![],'comment':_0x930a('0xc'),'set':function(_0x19e2fe){if(!_0x19e2fe){this[_0x930a('0xd')]('mandatoryDispositionPauseId',null);}this[_0x930a('0xd')](_0x930a('0xe'),_0x19e2fe);}},'description':{'type':Sequelize[_0x930a('0x2')]}}; \ No newline at end of file +var _0xdd14=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','sinch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdd14,0x16f));var _0x4dd1=function(_0x3a6e0f,_0x3671d0){_0x3a6e0f=_0x3a6e0f-0x0;var _0x9efcd5=_0xdd14[_0x3a6e0f];return _0x9efcd5;};'use strict';var Sequelize=require(_0x4dd1('0x0'));var rs=require(_0x4dd1('0x1'));module[_0x4dd1('0x2')]={'name':{'type':Sequelize[_0x4dd1('0x3')],'unique':_0x4dd1('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x4dd1('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4dd1('0x3')],'defaultValue':function(){return rs[_0x4dd1('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4dd1('0x6')]('twilio',_0x4dd1('0x7'))},'accountSid':{'type':Sequelize[_0x4dd1('0x3')]},'baseUrl':{'type':Sequelize[_0x4dd1('0x3')]},'authToken':{'type':Sequelize[_0x4dd1('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4dd1('0x8');}},'notificationSound':{'type':Sequelize[_0x4dd1('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4dd1('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4dd1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4dd1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4dd1('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4dd1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4dd1('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4dd1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4dd1('0xa')],'comment':_0x4dd1('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x4dd1('0x9')],'defaultValue':![],'comment':_0x4dd1('0xc'),'set':function(_0x342e06){if(!_0x342e06){this[_0x4dd1('0xd')]('mandatoryDispositionPauseId',null);}this[_0x4dd1('0xd')](_0x4dd1('0xe'),_0x342e06);}},'description':{'type':Sequelize[_0x4dd1('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index b9648c8..b4c4e18 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 _0x2d03=['sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','From','whatsapp:','Body','messageId','MessageSid','from','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','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','WhatsappQueue','queueId','queue','startRouting','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','get','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','WhatsappAccount','includeAll','include','rows','show','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','WhatsappAccountId','getDispositions','findOne','Disposition','nolimit','order','removeDispositions','addAnswer','getAnswers','CannedAnswer','findAll','ids','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications'];(function(_0x38f5d3,_0x17bd95){var _0x43491f=function(_0x2a0312){while(--_0x2a0312){_0x38f5d3['push'](_0x38f5d3['shift']());}};_0x43491f(++_0x17bd95);}(_0x2d03,0x1e7));var _0x32d0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2d03[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32d0('0x0'));var zipdir=require(_0x32d0('0x1'));var jsonpatch=require(_0x32d0('0x2'));var rp=require('request-promise');var moment=require(_0x32d0('0x3'));var BPromise=require(_0x32d0('0x4'));var Mustache=require(_0x32d0('0x5'));var util=require(_0x32d0('0x6'));var path=require('path');var sox=require(_0x32d0('0x7'));var csv=require(_0x32d0('0x8'));var ejs=require(_0x32d0('0x9'));var fs=require('fs');var fs_extra=require(_0x32d0('0xa'));var _=require(_0x32d0('0xb'));var squel=require(_0x32d0('0xc'));var crypto=require(_0x32d0('0xd'));var jsforce=require(_0x32d0('0xe'));var deskjs=require(_0x32d0('0xf'));var toCsv=require(_0x32d0('0x8'));var querystring=require(_0x32d0('0x10'));var Papa=require('papaparse');var Redis=require(_0x32d0('0x11'));var authService=require(_0x32d0('0x12'));var qs=require(_0x32d0('0x13'));var as=require(_0x32d0('0x14'));var hardwareService=require(_0x32d0('0x15'));var logger=require(_0x32d0('0x16'))(_0x32d0('0x17'));var utils=require(_0x32d0('0x18'));var config=require(_0x32d0('0x19'));var licenseUtil=require(_0x32d0('0x1a'));var db=require('../../mysqldb')['db'];config[_0x32d0('0x1b')]=_[_0x32d0('0x1c')](config[_0x32d0('0x1b')],{'host':_0x32d0('0x1d'),'port':0x18eb});var socket=require(_0x32d0('0x1e'))(new Redis(config[_0x32d0('0x1b')]));require(_0x32d0('0x1f'))[_0x32d0('0x20')](socket);var jayson=require(_0x32d0('0x21'));var client=jayson[_0x32d0('0x22')][_0x32d0('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x10f7b2,_0x160617,_0x5c1a3a,_0x67ae36){return new BPromise(function(_0xc1243d,_0x58211e){var _0x42cf49=_0x67ae36||client;return _0x42cf49[_0x32d0('0x24')](_0x10f7b2,_0x5c1a3a)[_0x32d0('0x25')](function(_0x1691e6){logger[_0x32d0('0x26')](_0x32d0('0x27'),_0x160617,'request\x20sent');logger['debug'](_0x32d0('0x28'),_0x160617,_0x32d0('0x29'),JSON[_0x32d0('0x2a')](_0x1691e6));if(_0x1691e6['error']){if(_0x1691e6['error'][_0x32d0('0x2b')]===0x1f4){logger[_0x32d0('0x2c')]('WhatsappAccount,\x20%s,\x20%s',_0x160617,_0x1691e6[_0x32d0('0x2c')]['message']);return _0x58211e(_0x1691e6[_0x32d0('0x2c')][_0x32d0('0x2d')]);}logger[_0x32d0('0x2c')](_0x32d0('0x27'),_0x160617,_0x1691e6[_0x32d0('0x2c')]['message']);return _0xc1243d(_0x1691e6['error']['message']);}else{logger[_0x32d0('0x26')](_0x32d0('0x27'),_0x160617,_0x32d0('0x29'));_0xc1243d(_0x1691e6[_0x32d0('0x2e')][_0x32d0('0x2d')]);}})['catch'](function(_0x5566e2){logger[_0x32d0('0x2c')](_0x32d0('0x27'),_0x160617,_0x5566e2);_0x58211e(_0x5566e2);});});}function respondWithStatusCode(_0x5a504a,_0x161ad1){_0x161ad1=_0x161ad1||0xcc;return function(_0x1ee2b4){if(_0x1ee2b4){return _0x5a504a[_0x32d0('0x2f')](_0x161ad1);}return _0x5a504a['status'](_0x161ad1)['end']();};}function respondWithResult(_0x5ebffb,_0x132492){_0x132492=_0x132492||0xc8;return function(_0x540165){if(_0x540165){return _0x5ebffb['status'](_0x132492)[_0x32d0('0x30')](_0x540165);}};}function respondWithFilteredResult(_0x35cee0,_0x51e6d6){return function(_0x1a9aab){if(_0x1a9aab){var _0x5024cb=typeof _0x51e6d6[_0x32d0('0x31')]===_0x32d0('0x32')&&typeof _0x51e6d6[_0x32d0('0x33')]===_0x32d0('0x32');var _0xd0c4de=_0x1a9aab[_0x32d0('0x34')];var _0x947eae=_0x5024cb?0x0:_0x51e6d6[_0x32d0('0x31')];var _0x5217ae=_0x5024cb?_0x1a9aab[_0x32d0('0x34')]:_0x51e6d6[_0x32d0('0x31')]+_0x51e6d6['limit'];var _0x52a1c0;if(_0x5217ae>=_0xd0c4de){_0x5217ae=_0xd0c4de;_0x52a1c0=0xc8;}else{_0x52a1c0=0xce;}_0x35cee0[_0x32d0('0x35')](_0x52a1c0);return _0x35cee0[_0x32d0('0x36')]('Content-Range',_0x947eae+'-'+_0x5217ae+'/'+_0xd0c4de)[_0x32d0('0x30')](_0x1a9aab);}return null;};}function patchUpdates(_0x44fcd1){return function(_0x53dbb9){try{jsonpatch[_0x32d0('0x37')](_0x53dbb9,_0x44fcd1,!![]);}catch(_0x2ad13d){return BPromise[_0x32d0('0x38')](_0x2ad13d);}return _0x53dbb9[_0x32d0('0x39')]();};}function saveUpdates(_0x36784c,_0xcccd56){return function(_0x541797){if(_0x541797){return _0x541797[_0x32d0('0x3a')](_0x36784c)[_0x32d0('0x25')](function(_0x266085){return _0x266085;});}return null;};}function removeEntity(_0x44abe3,_0x127bb4){return function(_0x4bcbeb){if(_0x4bcbeb){return _0x4bcbeb[_0x32d0('0x3b')]()['then'](function(){var _0x3d7f7b=_0x4bcbeb[_0x32d0('0x3c')]({'plain':!![]});var _0x230e2f='WhatsappAccounts';return db[_0x32d0('0x3d')]['destroy']({'where':{'type':_0x230e2f,'resourceId':_0x3d7f7b['id']}})[_0x32d0('0x25')](function(){return _0x4bcbeb;});})[_0x32d0('0x25')](function(){_0x44abe3[_0x32d0('0x35')](0xcc)[_0x32d0('0x3e')]();});}};}function handleEntityNotFound(_0x206408,_0x2ce85a){return function(_0x4b631a){if(!_0x4b631a){_0x206408[_0x32d0('0x2f')](0x194);}return _0x4b631a;};}function handleError(_0x4371e7,_0x52a49d){_0x52a49d=_0x52a49d||0x1f4;return function(_0x3db02a){logger[_0x32d0('0x2c')](_0x3db02a['stack']);if(_0x3db02a['name']){delete _0x3db02a[_0x32d0('0x3f')];}_0x4371e7[_0x32d0('0x35')](_0x52a49d)[_0x32d0('0x40')](_0x3db02a);};}exports[_0x32d0('0x41')]=function(_0x1c2c86,_0x1f0f1b){var _0x126000={'include':[{'model':db[_0x32d0('0x42')],'as':_0x32d0('0x43')}]},_0x354952={},_0x3f421b={'count':0x0,'rows':[]};var _0x4bbf47=_[_0x32d0('0x44')](db['WhatsappAccount'][_0x32d0('0x45')],function(_0x3e6394){return{'name':_0x3e6394['fieldName'],'type':_0x3e6394[_0x32d0('0x46')][_0x32d0('0x47')]};});_0x354952[_0x32d0('0x48')]=_[_0x32d0('0x44')](_0x4bbf47,_0x32d0('0x3f'));_0x354952[_0x32d0('0x49')]=_[_0x32d0('0x4a')](_0x1c2c86[_0x32d0('0x49')]);_0x354952[_0x32d0('0x4b')]=_[_0x32d0('0x4c')](_0x354952['model'],_0x354952['query']);_0x126000['attributes']=_[_0x32d0('0x4c')](_0x354952['model'],qs[_0x32d0('0x4d')](_0x1c2c86[_0x32d0('0x49')][_0x32d0('0x4d')]));_0x126000['attributes']=_0x126000[_0x32d0('0x4e')]['length']?_0x126000['attributes']:_0x354952['model'];if(!_0x1c2c86[_0x32d0('0x49')][_0x32d0('0x4f')]('nolimit')){_0x126000[_0x32d0('0x33')]=qs['limit'](_0x1c2c86[_0x32d0('0x49')][_0x32d0('0x33')]);_0x126000['offset']=qs[_0x32d0('0x31')](_0x1c2c86[_0x32d0('0x49')]['offset']);}_0x126000['order']=qs['sort'](_0x1c2c86[_0x32d0('0x49')][_0x32d0('0x50')]);_0x126000[_0x32d0('0x51')]=qs[_0x32d0('0x4b')](_[_0x32d0('0x52')](_0x1c2c86[_0x32d0('0x49')],_0x354952[_0x32d0('0x4b')]),_0x4bbf47);if(_0x1c2c86[_0x32d0('0x49')][_0x32d0('0x53')]){_0x126000[_0x32d0('0x51')]=_['merge'](_0x126000[_0x32d0('0x51')],{'$or':_['map'](_0x4bbf47,function(_0x50f1b9){if(_0x50f1b9['type']!==_0x32d0('0x54')){var _0x8fd8d7={};_0x8fd8d7[_0x50f1b9[_0x32d0('0x3f')]]={'$like':'%'+_0x1c2c86[_0x32d0('0x49')][_0x32d0('0x53')]+'%'};return _0x8fd8d7;}})});}_0x126000=_[_0x32d0('0x55')]({},_0x126000,_0x1c2c86[_0x32d0('0x56')]);var _0x4617ba={'where':_0x126000['where']};return db[_0x32d0('0x57')]['count'](_0x4617ba)['then'](function(_0x5b77de){_0x3f421b[_0x32d0('0x34')]=_0x5b77de;if(_0x1c2c86['query'][_0x32d0('0x58')]){_0x126000[_0x32d0('0x59')]=[{'all':!![]}];}return db[_0x32d0('0x57')]['findAll'](_0x126000);})[_0x32d0('0x25')](function(_0x4c93ca){_0x3f421b[_0x32d0('0x5a')]=_0x4c93ca;return _0x3f421b;})[_0x32d0('0x25')](respondWithFilteredResult(_0x1f0f1b,_0x126000))['catch'](handleError(_0x1f0f1b,null));};exports[_0x32d0('0x5b')]=function(_0x3ff339,_0x57cdeb){var _0x20686c={'raw':![],'where':{'id':_0x3ff339[_0x32d0('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x32d0('0x43')}]},_0xe0d0ff={};_0xe0d0ff['model']=_['keys'](db['WhatsappAccount'][_0x32d0('0x45')]);_0xe0d0ff['query']=_[_0x32d0('0x4a')](_0x3ff339[_0x32d0('0x49')]);_0xe0d0ff[_0x32d0('0x4b')]=_[_0x32d0('0x4c')](_0xe0d0ff[_0x32d0('0x48')],_0xe0d0ff[_0x32d0('0x49')]);_0x20686c[_0x32d0('0x4e')]=_['intersection'](_0xe0d0ff['model'],qs[_0x32d0('0x4d')](_0x3ff339[_0x32d0('0x49')][_0x32d0('0x4d')]));_0x20686c[_0x32d0('0x4e')]=_0x20686c[_0x32d0('0x4e')][_0x32d0('0x5d')]?_0x20686c[_0x32d0('0x4e')]:_0xe0d0ff[_0x32d0('0x48')];if(_0x3ff339[_0x32d0('0x49')][_0x32d0('0x58')]){_0x20686c['include']=[{'all':!![]}];}_0x20686c=_[_0x32d0('0x55')]({},_0x20686c,_0x3ff339[_0x32d0('0x56')]);return db[_0x32d0('0x57')][_0x32d0('0x5e')](_0x20686c)[_0x32d0('0x25')](handleEntityNotFound(_0x57cdeb,null))[_0x32d0('0x25')](respondWithResult(_0x57cdeb,null))[_0x32d0('0x5f')](handleError(_0x57cdeb,null));};exports[_0x32d0('0x60')]=function(_0x3a6b24,_0xa090b7){return db[_0x32d0('0x57')][_0x32d0('0x60')](_0x3a6b24['body'],{})[_0x32d0('0x25')](function(_0x2e5b93){var _0x1ce4ad=_0x3a6b24[_0x32d0('0x61')][_0x32d0('0x3c')]({'plain':!![]});if(!_0x1ce4ad)throw new Error(_0x32d0('0x62'));if(_0x1ce4ad[_0x32d0('0x63')]===_0x32d0('0x61')){var _0xa8a754=_0x2e5b93[_0x32d0('0x3c')]({'plain':!![]});var _0x36547a='WhatsappAccounts';return db[_0x32d0('0x64')]['find']({'where':{'name':_0x36547a,'userProfileId':_0x1ce4ad[_0x32d0('0x65')]},'raw':!![]})[_0x32d0('0x25')](function(_0x5e8d0c){if(_0x5e8d0c&&_0x5e8d0c[_0x32d0('0x66')]===0x0){return db[_0x32d0('0x3d')][_0x32d0('0x60')]({'name':_0xa8a754['name'],'resourceId':_0xa8a754['id'],'type':_0x5e8d0c['name'],'sectionId':_0x5e8d0c['id']},{})[_0x32d0('0x25')](function(){return _0x2e5b93;});}else{return _0x2e5b93;}})['catch'](function(_0x318c42){logger[_0x32d0('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x318c42);throw _0x318c42;});}return _0x2e5b93;})['then'](respondWithResult(_0xa090b7,0xc9))['catch'](handleError(_0xa090b7,null));};exports['update']=function(_0x12d2ce,_0x3d9d68){if(_0x12d2ce[_0x32d0('0x67')]['id']){delete _0x12d2ce[_0x32d0('0x67')]['id'];}return db[_0x32d0('0x57')][_0x32d0('0x5e')]({'where':{'id':_0x12d2ce[_0x32d0('0x5c')]['id']},'include':[{'model':db[_0x32d0('0x42')],'as':_0x32d0('0x43')}]})[_0x32d0('0x25')](handleEntityNotFound(_0x3d9d68,null))[_0x32d0('0x25')](saveUpdates(_0x12d2ce[_0x32d0('0x67')],null))[_0x32d0('0x25')](respondWithResult(_0x3d9d68,null))[_0x32d0('0x5f')](handleError(_0x3d9d68,null));};exports['destroy']=function(_0x6c6a37,_0x4ef80a){return db[_0x32d0('0x57')][_0x32d0('0x5e')]({'where':{'id':_0x6c6a37['params']['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x4ef80a,null))[_0x32d0('0x25')](removeEntity(_0x4ef80a,null))[_0x32d0('0x5f')](handleError(_0x4ef80a,null));};exports[_0x32d0('0x68')]=function(_0x5c134e,_0x4b070e){return db[_0x32d0('0x57')][_0x32d0('0x68')]()[_0x32d0('0x25')](respondWithResult(_0x4b070e,null))[_0x32d0('0x5f')](handleError(_0x4b070e,null));};exports['addDisposition']=function(_0x2157f2,_0x346491,_0x1fd92a){if(_0x2157f2[_0x32d0('0x67')]['id']){delete _0x2157f2[_0x32d0('0x67')]['id'];}return db['WhatsappAccount'][_0x32d0('0x5e')]({'where':{'id':_0x2157f2['params']['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x346491,null))[_0x32d0('0x25')](function(_0x3c48c8){if(_0x3c48c8){_0x2157f2['body'][_0x32d0('0x69')]=_0x3c48c8['id'];return db['Disposition']['create'](_0x2157f2['body']);}})[_0x32d0('0x25')](respondWithResult(_0x346491,null))[_0x32d0('0x5f')](handleError(_0x346491,null));};exports[_0x32d0('0x6a')]=function(_0x16d24c,_0x465272,_0xc133d7){var _0x5a4d51={'raw':![],'where':{}};var _0x2a3f26={};var _0x52bff7={'count':0x0,'rows':[]};return db[_0x32d0('0x57')][_0x32d0('0x6b')]({'where':{'id':_0x16d24c[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x465272,null))[_0x32d0('0x25')](function(_0x115cb8){if(_0x115cb8){_0x2a3f26[_0x32d0('0x48')]=_[_0x32d0('0x4a')](db[_0x32d0('0x6c')][_0x32d0('0x45')]);_0x2a3f26['query']=_[_0x32d0('0x4a')](_0x16d24c[_0x32d0('0x49')]);_0x2a3f26[_0x32d0('0x4b')]=_[_0x32d0('0x4c')](_0x2a3f26[_0x32d0('0x48')],_0x2a3f26['query']);_0x5a4d51[_0x32d0('0x4e')]=_['intersection'](_0x2a3f26[_0x32d0('0x48')],qs[_0x32d0('0x4d')](_0x16d24c['query'][_0x32d0('0x4d')]));_0x5a4d51['attributes']=_0x5a4d51[_0x32d0('0x4e')][_0x32d0('0x5d')]?_0x5a4d51[_0x32d0('0x4e')]:_0x2a3f26['model'];if(!_0x16d24c[_0x32d0('0x49')][_0x32d0('0x4f')](_0x32d0('0x6d'))){_0x5a4d51[_0x32d0('0x33')]=qs[_0x32d0('0x33')](_0x16d24c[_0x32d0('0x49')][_0x32d0('0x33')]);_0x5a4d51[_0x32d0('0x31')]=qs[_0x32d0('0x31')](_0x16d24c[_0x32d0('0x49')]['offset']);}_0x5a4d51[_0x32d0('0x6e')]=qs[_0x32d0('0x50')](_0x16d24c[_0x32d0('0x49')][_0x32d0('0x50')]);_0x5a4d51[_0x32d0('0x51')]=qs['filters'](_['pick'](_0x16d24c[_0x32d0('0x49')],_0x2a3f26[_0x32d0('0x4b')]));_0x5a4d51[_0x32d0('0x51')][_0x32d0('0x69')]=_0x115cb8['id'];if(_0x16d24c['query'][_0x32d0('0x53')]){_0x5a4d51[_0x32d0('0x51')]=_[_0x32d0('0x55')](_0x5a4d51[_0x32d0('0x51')],{'$or':_['map'](_0x5a4d51['attributes'],function(_0x3aafe2){var _0x35c8ab={};_0x35c8ab[_0x3aafe2]={'$like':'%'+_0x16d24c[_0x32d0('0x49')][_0x32d0('0x53')]+'%'};return _0x35c8ab;})});}_0x5a4d51=_[_0x32d0('0x55')]({},_0x5a4d51,_0x16d24c[_0x32d0('0x56')]);return db['Disposition'][_0x32d0('0x34')]({'where':_0x5a4d51['where']})['then'](function(_0x4a50c6){_0x52bff7['count']=_0x4a50c6;if(_0x16d24c['query'][_0x32d0('0x58')]){_0x5a4d51[_0x32d0('0x59')]=[{'all':!![]}];}return db[_0x32d0('0x6c')]['findAll'](_0x5a4d51);})[_0x32d0('0x25')](function(_0x447ad5){_0x52bff7[_0x32d0('0x5a')]=_0x447ad5;return _0x52bff7;});}})[_0x32d0('0x25')](respondWithFilteredResult(_0x465272,_0x5a4d51))['catch'](handleError(_0x465272,null));};exports[_0x32d0('0x6f')]=function(_0x33ed14,_0x1be790,_0x394a49){return db[_0x32d0('0x57')]['find']({'where':{'id':_0x33ed14[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x1be790,null))[_0x32d0('0x25')](function(_0x150a42){if(_0x150a42){return _0x150a42[_0x32d0('0x6f')](_0x33ed14['query']['ids']);}})['then'](respondWithStatusCode(_0x1be790,null))['catch'](handleError(_0x1be790,null));};exports[_0x32d0('0x70')]=function(_0x3024e2,_0x726aa0,_0x565cc5){if(_0x3024e2['body']['id']){delete _0x3024e2[_0x32d0('0x67')]['id'];}return db[_0x32d0('0x57')][_0x32d0('0x5e')]({'where':{'id':_0x3024e2[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x726aa0,null))[_0x32d0('0x25')](function(_0x5d5d6d){if(_0x5d5d6d){_0x3024e2['body'][_0x32d0('0x69')]=_0x5d5d6d['id'];return db['CannedAnswer']['create'](_0x3024e2[_0x32d0('0x67')]);}})[_0x32d0('0x25')](respondWithResult(_0x726aa0,null))[_0x32d0('0x5f')](handleError(_0x726aa0,null));};exports[_0x32d0('0x71')]=function(_0x10c5ba,_0x515d4e,_0x7eb925){var _0x2871e4={'raw':![],'where':{}};var _0x3b00c7={};var _0x7e3ec9={'count':0x0,'rows':[]};return db[_0x32d0('0x57')][_0x32d0('0x6b')]({'where':{'id':_0x10c5ba[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x515d4e,null))['then'](function(_0x5b2e3a){if(_0x5b2e3a){_0x3b00c7[_0x32d0('0x48')]=_[_0x32d0('0x4a')](db[_0x32d0('0x72')][_0x32d0('0x45')]);_0x3b00c7['query']=_[_0x32d0('0x4a')](_0x10c5ba[_0x32d0('0x49')]);_0x3b00c7[_0x32d0('0x4b')]=_[_0x32d0('0x4c')](_0x3b00c7[_0x32d0('0x48')],_0x3b00c7[_0x32d0('0x49')]);_0x2871e4['attributes']=_[_0x32d0('0x4c')](_0x3b00c7['model'],qs['fields'](_0x10c5ba[_0x32d0('0x49')][_0x32d0('0x4d')]));_0x2871e4['attributes']=_0x2871e4[_0x32d0('0x4e')][_0x32d0('0x5d')]?_0x2871e4['attributes']:_0x3b00c7[_0x32d0('0x48')];if(!_0x10c5ba['query']['hasOwnProperty']('nolimit')){_0x2871e4[_0x32d0('0x33')]=qs[_0x32d0('0x33')](_0x10c5ba[_0x32d0('0x49')][_0x32d0('0x33')]);_0x2871e4[_0x32d0('0x31')]=qs['offset'](_0x10c5ba[_0x32d0('0x49')]['offset']);}_0x2871e4[_0x32d0('0x6e')]=qs[_0x32d0('0x50')](_0x10c5ba['query'][_0x32d0('0x50')]);_0x2871e4[_0x32d0('0x51')]=qs[_0x32d0('0x4b')](_['pick'](_0x10c5ba['query'],_0x3b00c7[_0x32d0('0x4b')]));_0x2871e4['where'][_0x32d0('0x69')]=_0x5b2e3a['id'];if(_0x10c5ba[_0x32d0('0x49')][_0x32d0('0x53')]){_0x2871e4[_0x32d0('0x51')]=_[_0x32d0('0x55')](_0x2871e4[_0x32d0('0x51')],{'$or':_[_0x32d0('0x44')](_0x2871e4[_0x32d0('0x4e')],function(_0x54de0a){var _0x88c7e={};_0x88c7e[_0x54de0a]={'$like':'%'+_0x10c5ba[_0x32d0('0x49')][_0x32d0('0x53')]+'%'};return _0x88c7e;})});}_0x2871e4=_[_0x32d0('0x55')]({},_0x2871e4,_0x10c5ba[_0x32d0('0x56')]);return db[_0x32d0('0x72')][_0x32d0('0x34')]({'where':_0x2871e4[_0x32d0('0x51')]})['then'](function(_0x17d5e6){_0x7e3ec9[_0x32d0('0x34')]=_0x17d5e6;if(_0x10c5ba[_0x32d0('0x49')]['includeAll']){_0x2871e4[_0x32d0('0x59')]=[{'all':!![]}];}return db[_0x32d0('0x72')][_0x32d0('0x73')](_0x2871e4);})['then'](function(_0x3f0a3c){_0x7e3ec9[_0x32d0('0x5a')]=_0x3f0a3c;return _0x7e3ec9;});}})['then'](respondWithFilteredResult(_0x515d4e,_0x2871e4))[_0x32d0('0x5f')](handleError(_0x515d4e,null));};exports['removeAnswers']=function(_0x3ea16e,_0x1b0955,_0x301b7d){return db[_0x32d0('0x57')]['find']({'where':{'id':_0x3ea16e[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x1b0955,null))[_0x32d0('0x25')](function(_0x288f65){if(_0x288f65){return _0x288f65['removeAnswers'](_0x3ea16e['query'][_0x32d0('0x74')]);}})['then'](respondWithStatusCode(_0x1b0955,null))[_0x32d0('0x5f')](handleError(_0x1b0955,null));};exports[_0x32d0('0x75')]=function(_0x4a728d,_0x21b35c,_0x1e741f){return db[_0x32d0('0x57')][_0x32d0('0x5e')]({'where':{'id':_0x4a728d[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x21b35c,null))['then'](function(_0x58abdc){if(_0x58abdc){return _0x58abdc['addAgents'](_0x4a728d[_0x32d0('0x67')][_0x32d0('0x74')],_[_0x32d0('0x76')](_0x4a728d[_0x32d0('0x67')],[_0x32d0('0x74'),'id'])||{})[_0x32d0('0x77')](function(_0x28ee03){for(var _0x1d5c41=0x0;_0x1d5c41<_0x4a728d[_0x32d0('0x67')]['ids']['length'];_0x1d5c41+=0x1){socket['emit'](_0x32d0('0x78'),{'UserId':Number(_0x4a728d[_0x32d0('0x67')][_0x32d0('0x74')][_0x1d5c41]),'WhatsappAccountId':Number(_0x4a728d[_0x32d0('0x5c')]['id'])});}return _0x28ee03;});}})[_0x32d0('0x25')](respondWithResult(_0x21b35c,null))[_0x32d0('0x5f')](handleError(_0x21b35c,null));};exports['removeAgents']=function(_0x237b31,_0xb3115a,_0x1c25dc){return db[_0x32d0('0x57')][_0x32d0('0x5e')]({'where':{'id':_0x237b31[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0xb3115a,null))['then'](function(_0xf6d91e){if(_0xf6d91e){return _0xf6d91e[_0x32d0('0x79')](_0x237b31['query'][_0x32d0('0x74')])['then'](function(){if(_[_0x32d0('0x7a')](_0x237b31[_0x32d0('0x49')][_0x32d0('0x74')])){for(var _0x577f89=0x0;_0x577f89<_0x237b31[_0x32d0('0x49')][_0x32d0('0x74')][_0x32d0('0x5d')];_0x577f89+=0x1){socket[_0x32d0('0x7b')]('userWhatsappAccount:remove',{'UserId':Number(_0x237b31[_0x32d0('0x49')][_0x32d0('0x74')][_0x577f89]),'WhatsappAccountId':Number(_0x237b31[_0x32d0('0x5c')]['id'])});}}else{socket['emit'](_0x32d0('0x7c'),{'UserId':Number(_0x237b31[_0x32d0('0x49')]['ids']),'WhatsappAccountId':Number(_0x237b31[_0x32d0('0x5c')]['id'])});}});}})[_0x32d0('0x25')](respondWithStatusCode(_0xb3115a,null))[_0x32d0('0x5f')](handleError(_0xb3115a,null));};exports[_0x32d0('0x7d')]=function(_0x24f00f,_0x5153f1,_0xc03d75){var _0x12903b={};var _0x2492c2={};var _0xca50a6;var _0x22644f;return db[_0x32d0('0x57')][_0x32d0('0x6b')]({'where':{'id':_0x24f00f['params']['id']}})['then'](handleEntityNotFound(_0x5153f1,null))['then'](function(_0x13fc07){if(_0x13fc07){_0xca50a6=_0x13fc07;_0x2492c2[_0x32d0('0x48')]=_[_0x32d0('0x4a')](db[_0x32d0('0x7e')]['rawAttributes']);_0x2492c2[_0x32d0('0x49')]=_[_0x32d0('0x4a')](_0x24f00f[_0x32d0('0x49')]);_0x2492c2['filters']=_[_0x32d0('0x4c')](_0x2492c2[_0x32d0('0x48')],_0x2492c2[_0x32d0('0x49')]);_0x12903b['attributes']=_[_0x32d0('0x4c')](_0x2492c2[_0x32d0('0x48')],qs['fields'](_0x24f00f[_0x32d0('0x49')]['fields']));_0x12903b['attributes']=_0x12903b[_0x32d0('0x4e')]['length']?_0x12903b[_0x32d0('0x4e')]:_0x2492c2[_0x32d0('0x48')];_0x12903b[_0x32d0('0x6e')]=qs[_0x32d0('0x50')](_0x24f00f['query'][_0x32d0('0x50')]);_0x12903b[_0x32d0('0x51')]=qs[_0x32d0('0x4b')](_[_0x32d0('0x52')](_0x24f00f[_0x32d0('0x49')],_0x2492c2['filters']));if(_0x24f00f[_0x32d0('0x49')][_0x32d0('0x53')]){_0x12903b['where']=_[_0x32d0('0x55')](_0x12903b['where'],{'$or':_['map'](_0x12903b['attributes'],function(_0x2385f9){var _0x59d590={};_0x59d590[_0x2385f9]={'$like':'%'+_0x24f00f[_0x32d0('0x49')][_0x32d0('0x53')]+'%'};return _0x59d590;})});}_0x12903b=_[_0x32d0('0x55')]({},_0x12903b,_0x24f00f[_0x32d0('0x56')]);return _0xca50a6[_0x32d0('0x7d')](_0x12903b);}})[_0x32d0('0x25')](function(_0x13aeb4){if(_0x13aeb4){_0x22644f=_0x13aeb4[_0x32d0('0x5d')];if(!_0x24f00f[_0x32d0('0x49')][_0x32d0('0x4f')](_0x32d0('0x6d'))){_0x12903b[_0x32d0('0x33')]=qs['limit'](_0x24f00f[_0x32d0('0x49')][_0x32d0('0x33')]);_0x12903b['offset']=qs[_0x32d0('0x31')](_0x24f00f[_0x32d0('0x49')][_0x32d0('0x31')]);}return _0xca50a6['getAgents'](_0x12903b);}})[_0x32d0('0x25')](function(_0x11af4e){if(_0x11af4e){return _0x11af4e?{'count':_0x22644f,'rows':_0x11af4e}:null;}})[_0x32d0('0x25')](respondWithResult(_0x5153f1,null))[_0x32d0('0x5f')](handleError(_0x5153f1,null));};exports[_0x32d0('0x7f')]=function(_0x3753c6,_0x3baccb){var _0x258ba8=_0x3753c6['params']['id'];var _0x321ba2=_0x3753c6[_0x32d0('0x67')];var _0x436a56=0xc8;var _0x2d5b01=null;return db[_0x32d0('0x80')][_0x32d0('0x81')]({'isolationLevel':db[_0x32d0('0x80')]['Transaction'][_0x32d0('0x82')][_0x32d0('0x83')]},function(_0x3d2edf){return db[_0x32d0('0x57')][_0x32d0('0x6b')]({'where':{'id':_0x258ba8},'transaction':_0x3d2edf})[_0x32d0('0x25')](function(_0x1f8a28){if(_0x1f8a28){return db[_0x32d0('0x84')][_0x32d0('0x3b')]({'where':{'WhatsappAccountId':_0x258ba8},'transaction':_0x3d2edf})[_0x32d0('0x25')](function(){var _0x1271af=_[_0x32d0('0x44')](_0x321ba2,function(_0x13d399){_0x13d399[_0x32d0('0x69')]=_0x258ba8;return _0x13d399;});return db[_0x32d0('0x84')][_0x32d0('0x85')](_0x1271af,{'transaction':_0x3d2edf});});}else{_0x436a56=0x194;_0x2d5b01=[];}});})['then'](function(){if(_0x436a56!==0x194){return db[_0x32d0('0x84')][_0x32d0('0x86')]({'where':{'WhatsappAccountId':_0x258ba8},'order':_0x32d0('0x87')})[_0x32d0('0x25')](function(_0x48e512){_0x2d5b01=_0x48e512;});}})[_0x32d0('0x5f')](function(_0x24f167){_0x436a56=0x1f4;logger[_0x32d0('0x2c')](_0x24f167[_0x32d0('0x88')]);if(_0x24f167[_0x32d0('0x3f')]){delete _0x24f167['name'];}_0x2d5b01=_0x24f167;})[_0x32d0('0x89')](function(){if(_0x2d5b01===null){_0x3baccb[_0x32d0('0x2f')](_0x436a56);}else{if(_0x436a56===0x1f4){_0x3baccb[_0x32d0('0x35')](_0x436a56)[_0x32d0('0x40')](_0x2d5b01);}else{_0x3baccb[_0x32d0('0x35')](_0x436a56)[_0x32d0('0x30')](_0x2d5b01);}}});};exports[_0x32d0('0x8a')]=function(_0x3dd12b,_0x3de47e,_0x71bb16){var _0x5d26a8={};var _0x51e0b9={};var _0x4518c0;var _0x3e2130;return db[_0x32d0('0x57')][_0x32d0('0x6b')]({'where':{'id':_0x3dd12b[_0x32d0('0x5c')]['id']}})[_0x32d0('0x25')](handleEntityNotFound(_0x3de47e,null))[_0x32d0('0x25')](function(_0x5e0ed1){if(_0x5e0ed1){_0x4518c0=_0x5e0ed1;_0x51e0b9[_0x32d0('0x48')]=_[_0x32d0('0x4a')](db[_0x32d0('0x84')]['rawAttributes']);_0x51e0b9[_0x32d0('0x49')]=_[_0x32d0('0x4a')](_0x3dd12b[_0x32d0('0x49')]);_0x51e0b9['filters']=_['intersection'](_0x51e0b9[_0x32d0('0x48')],_0x51e0b9['query']);_0x5d26a8['attributes']=_[_0x32d0('0x4c')](_0x51e0b9[_0x32d0('0x48')],qs[_0x32d0('0x4d')](_0x3dd12b[_0x32d0('0x49')][_0x32d0('0x4d')]));_0x5d26a8[_0x32d0('0x4e')]=_0x5d26a8[_0x32d0('0x4e')]['length']?_0x5d26a8[_0x32d0('0x4e')]:_0x51e0b9['model'];_0x5d26a8[_0x32d0('0x6e')]=qs['sort'](_0x3dd12b[_0x32d0('0x49')]['sort']);_0x5d26a8['where']=qs[_0x32d0('0x4b')](_[_0x32d0('0x52')](_0x3dd12b[_0x32d0('0x49')],_0x51e0b9[_0x32d0('0x4b')]));if(_0x3dd12b[_0x32d0('0x49')][_0x32d0('0x53')]){_0x5d26a8[_0x32d0('0x51')]=_[_0x32d0('0x55')](_0x5d26a8[_0x32d0('0x51')],{'$or':_[_0x32d0('0x44')](_0x5d26a8[_0x32d0('0x4e')],function(_0x21cbdf){var _0x472e32={};_0x472e32[_0x21cbdf]={'$like':'%'+_0x3dd12b['query'][_0x32d0('0x53')]+'%'};return _0x472e32;})});}_0x5d26a8=_['merge']({},_0x5d26a8,_0x3dd12b['options']);return _0x4518c0['getApplications'](_0x5d26a8);}})[_0x32d0('0x25')](function(_0x34cbda){if(_0x34cbda){_0x3e2130=_0x34cbda['length'];if(!_0x3dd12b[_0x32d0('0x49')][_0x32d0('0x4f')](_0x32d0('0x6d'))){_0x5d26a8[_0x32d0('0x33')]=qs[_0x32d0('0x33')](_0x3dd12b[_0x32d0('0x49')][_0x32d0('0x33')]);_0x5d26a8[_0x32d0('0x31')]=qs[_0x32d0('0x31')](_0x3dd12b[_0x32d0('0x49')][_0x32d0('0x31')]);}return _0x4518c0[_0x32d0('0x8a')](_0x5d26a8);}})[_0x32d0('0x25')](function(_0xba7a8d){if(_0xba7a8d){return _0xba7a8d?{'count':_0x3e2130,'rows':_0xba7a8d}:null;}})[_0x32d0('0x25')](respondWithResult(_0x3de47e,null))['catch'](handleError(_0x3de47e,null));};exports[_0x32d0('0x8b')]=function(_0x495a23,_0x3ed0fb,_0x10489c){var _0x29df4e={'channel':'whatsapp'};var _0x33ddaf=[];var _0x39e616=[];var _0x3531be={};return db[_0x32d0('0x57')][_0x32d0('0x5e')]({'where':{'id':_0x495a23[_0x32d0('0x5c')]['id']},'include':[{'model':db[_0x32d0('0x84')],'as':_0x32d0('0x8c')}]})[_0x32d0('0x25')](handleEntityNotFound(_0x3ed0fb,null))[_0x32d0('0x25')](function(_0x501d33){_0x29df4e['account']=_0x501d33;if(_0x29df4e[_0x32d0('0x8d')]&&_0x29df4e[_0x32d0('0x8d')][_0x32d0('0x46')]===_0x32d0('0x8e')&&_0x495a23[_0x32d0('0x67')]['statuses']){if(_0x495a23['body'][_0x32d0('0x8f')][_0x32d0('0x5d')]===0x0)return;if(_0x495a23[_0x32d0('0x67')]['statuses'][0x0][_0x32d0('0x90')]!==_0x32d0('0x91'))return;return db[_0x32d0('0x92')][_0x32d0('0x3a')]({'read':!![],'readAt':_0x495a23[_0x32d0('0x67')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x495a23['body'][_0x32d0('0x8f')][0x0][_0x32d0('0x93')]},'individualHooks':!![]})['then'](function(_0x345cb7){return _0x3ed0fb['status'](0xc8)[_0x32d0('0x30')](_0x345cb7);});}_0x29df4e[_0x32d0('0x94')]=_['orderBy'](_0x501d33[_0x32d0('0x8c')],['priority'],[_0x32d0('0x95')]);if(_0x29df4e[_0x32d0('0x8d')][_0x32d0('0x8c')]){delete _0x29df4e['account'][_0x32d0('0x8c')];}return db[_0x32d0('0x96')]['describe']()['then'](function(_0x1deda8){if(!_0x1deda8){throw new db[(_0x32d0('0x97'))][(_0x32d0('0x98'))]('no\x20available\x20attributes');}_0x33ddaf=_[_0x32d0('0x99')](_[_0x32d0('0x4a')](_0x1deda8),[_0x32d0('0x9a'),_0x32d0('0x9b')]);_0x39e616=_[_0x32d0('0x99')](_[_0x32d0('0x4a')](_0x1deda8),[_0x32d0('0x9a'),_0x32d0('0x9b'),_0x32d0('0x9c'),_0x32d0('0x9d')]);_0x29df4e[_0x32d0('0x67')]={'mapKey':'mobile'};if(_0x29df4e[_0x32d0('0x8d')]&&_0x29df4e[_0x32d0('0x8d')][_0x32d0('0x46')]==='twilio'){_0x29df4e['body']['from']=_0x495a23['body'][_0x32d0('0x9e')]['replace'](_0x32d0('0x9f'),'');_0x29df4e['body'][_0x32d0('0x67')]=_0x495a23[_0x32d0('0x67')][_0x32d0('0xa0')];_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa1')]=_0x495a23[_0x32d0('0x67')][_0x32d0('0xa2')];}if(_0x29df4e['account']&&_0x29df4e['account'][_0x32d0('0x46')]===_0x32d0('0x8e')){_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa3')]=_0x495a23[_0x32d0('0x67')][_0x32d0('0xa4')][0x0][_0x32d0('0xa3')];_0x29df4e['body']['body']=_0x495a23[_0x32d0('0x67')][_0x32d0('0xa4')][0x0]['message'][_0x32d0('0x67')];_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa1')]=_0x495a23[_0x32d0('0x67')][_0x32d0('0xa4')][0x0][_0x32d0('0x93')];}if(_0x29df4e[_0x32d0('0x67')]['id']){delete _0x29df4e['body']['id'];}if(_[_0x32d0('0xa5')](_0x29df4e['body']['from'])){throw new db[(_0x32d0('0x97'))]['ValidationError'](_0x32d0('0xa6'));}if(_[_0x32d0('0xa5')](_0x29df4e[_0x32d0('0x67')][_0x32d0('0x67')])||_0x29df4e[_0x32d0('0x67')][_0x32d0('0x67')]===''){throw new db['Sequelize']['ValidationError'](_0x32d0('0xa7'));}if(_['isNil'](_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa8')])){throw new db[(_0x32d0('0x97'))][(_0x32d0('0x98'))](_0x32d0('0xa9')+_0x39e616);}if(!_[_0x32d0('0xaa')](_0x39e616,_0x29df4e['body'][_0x32d0('0xa8')])){throw new db[(_0x32d0('0x97'))][(_0x32d0('0x98'))](_0x32d0('0xab')+_0x39e616);}_0x3531be[_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa8')]]=_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa3')];return db['CmList'][_0x32d0('0x5e')]({'where':{'id':_0x29df4e[_0x32d0('0x8d')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x32d0('0xac'),'where':_0x3531be,'limit':0x1,'order':[[_0x32d0('0x9b'),_0x32d0('0xad')]]}]});})[_0x32d0('0x25')](handleEntityNotFound(_0x3ed0fb,null))[_0x32d0('0x25')](function(_0x44d80f){if(_0x44d80f){_0x29df4e[_0x32d0('0xae')]=_[_0x32d0('0x76')](_0x44d80f,['Contacts']);if(_0x44d80f['Contacts'][_0x32d0('0x5d')]){return _0x44d80f[_0x32d0('0xac')][0x0];}var _0x55b495=_[_0x32d0('0x1c')](_0x29df4e['body'],{'firstName':_0x29df4e['body']['from'],'ListId':_0x44d80f['id']});_0x55b495[_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa8')]]=_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa3')];return db[_0x32d0('0x96')]['create'](_0x55b495,{'fields':_0x33ddaf,'raw':!![]});}})[_0x32d0('0x25')](handleEntityNotFound(_0x3ed0fb,null))[_0x32d0('0x25')](function(_0x272391){if(_0x272391){_0x29df4e[_0x32d0('0xaf')]=_0x272391;var _0x14e6ee={'ContactId':_0x272391['id'],'phone':_0x29df4e[_0x32d0('0x67')]['from'],'WhatsappAccountId':_0x495a23[_0x32d0('0x5c')]['id']};var _0x43233f={'ContactId':_0x272391['id'],'WhatsappAccountId':_0x495a23['params']['id'],'closed':![]};return db[_0x32d0('0xb0')]['find']({'where':_0x43233f})['then'](function(_0x1e5b11){if(_0x1e5b11){return[_0x1e5b11,![]];}return db[_0x32d0('0xb0')][_0x32d0('0x60')](_0x14e6ee)[_0x32d0('0x25')](function(_0x1ce184){return[_0x1ce184,!![]];});});}})[_0x32d0('0x77')](function(_0x49910b,_0x2a8318){_0x29df4e[_0x32d0('0xb1')]=_0x49910b['get']({'plain':!![]});_0x29df4e[_0x32d0('0xb1')][_0x32d0('0xb2')]=![];if(_0x2a8318){if(_0x29df4e['account']['autoclose']){_0x29df4e[_0x32d0('0x94')]['push']({'id':0x0,'priority':_0x29df4e['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x32d0('0xb3')});}_0x29df4e['interaction'][_0x32d0('0xb2')]=!![];}return db[_0x32d0('0x92')]['create']({'phone':_0x29df4e[_0x32d0('0x67')]['from'],'messageId':_0x29df4e[_0x32d0('0x67')][_0x32d0('0xa1')],'body':_0x29df4e[_0x32d0('0x67')][_0x32d0('0x67')],'WhatsappAccountId':_0x495a23[_0x32d0('0x5c')]['id'],'WhatsappInteractionId':_0x49910b['id'],'direction':'in','ContactId':_0x49910b[_0x32d0('0xb4')],'AttachmentId':_0x29df4e['body'][_0x32d0('0xb5')]});})[_0x32d0('0x25')](function(_0x3eb0e8){_0x29df4e[_0x32d0('0x2d')]=_0x3eb0e8;if(!_0x29df4e['interaction'][_0x32d0('0xb6')])return;return db[_0x32d0('0x7e')][_0x32d0('0x5e')]({'attributes':['id',_0x32d0('0x3f')],'where':{'id':_0x29df4e[_0x32d0('0xb1')]['UserId']}});})[_0x32d0('0x25')](function(_0x4ab199){if(_0x4ab199){_0x29df4e[_0x32d0('0x94')][_0x32d0('0xb7')]({'id':0x0,'priority':0x0,'app':_0x32d0('0xb8'),'appdata':_0x4ab199['name']+','+(_0x29df4e[_0x32d0('0x8d')][_0x32d0('0xb9')]||0xa),'interval':_0x32d0('0xb3')});}if(!_0x29df4e[_0x32d0('0xb1')]['queueId'])return;return db[_0x32d0('0xba')]['find']({'attributes':['id',_0x32d0('0x3f')],'where':{'id':_0x29df4e['interaction'][_0x32d0('0xbb')]}});})[_0x32d0('0x25')](function(_0x481f01){if(_0x481f01){_0x29df4e[_0x32d0('0x94')][_0x32d0('0xb7')]({'id':0x0,'priority':0x1,'app':_0x32d0('0xbc'),'appdata':_0x481f01[_0x32d0('0x3f')]+','+(_0x29df4e[_0x32d0('0x8d')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x32d0('0xbd'),_0x29df4e);})[_0x32d0('0x25')](function(_0x4ac6ff){if(_0x4ac6ff){var _0x5c3ca6=0xc8;var _0x2cef18=_0x32d0('0xbe');logger['info'](_0x32d0('0x28'),_0x2cef18,_0x5c3ca6,'entity\x20found');logger[_0x32d0('0xbf')](_0x32d0('0xc0'),_0x2cef18,_0x5c3ca6,_0x32d0('0xc1'),JSON[_0x32d0('0x2a')](_0x4ac6ff));if(_0x29df4e[_0x32d0('0x8d')][_0x32d0('0x46')]===_0x32d0('0xc2')){return _0x3ed0fb['status'](_0x5c3ca6)[_0x32d0('0x36')](_0x32d0('0xc3'),_0x32d0('0xc4'))[_0x32d0('0x40')](_0x32d0('0xc5'));}else{return _0x3ed0fb[_0x32d0('0x35')](_0x5c3ca6)[_0x32d0('0x30')](_0x4ac6ff);}}});})[_0x32d0('0x5f')](handleError(_0x3ed0fb,null));};exports[_0x32d0('0x40')]=function(_0x34e8cd,_0x2eebcc,_0x243606){var _0x48b717,_0x261864,_0x16a56c;if(_[_0x32d0('0xa5')](_0x34e8cd[_0x32d0('0x67')][_0x32d0('0x67')])||_0x34e8cd['body'][_0x32d0('0x67')]===''){throw new db[(_0x32d0('0x97'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x32d0('0xa5')](_0x34e8cd[_0x32d0('0x67')]['to'])){throw new db['Sequelize'][(_0x32d0('0x98'))](_0x32d0('0xc6'));}_0x48b717=_0x34e8cd[_0x32d0('0x67')]['to'];return db[_0x32d0('0x57')][_0x32d0('0x5e')]({'where':{'id':_0x34e8cd['params']['id']},'include':[{'model':db[_0x32d0('0xc7')],'as':_0x32d0('0xc8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x48b717},'limit':0x1,'order':[[_0x32d0('0x9b'),'DESC']]}]}]})[_0x32d0('0x25')](handleEntityNotFound(_0x2eebcc,null))['then'](function(_0x1202f3){if(_0x1202f3&&_0x1202f3[_0x32d0('0xc8')]){_0x261864=_0x1202f3['get']({'plain':!![]});if(_0x261864[_0x32d0('0xc8')]&&_0x261864[_0x32d0('0xc8')][_0x32d0('0xac')][_0x32d0('0x5d')]){return _0x261864[_0x32d0('0xc8')][_0x32d0('0xac')][0x0];}return db[_0x32d0('0x96')]['create'](_[_0x32d0('0x1c')](_0x34e8cd[_0x32d0('0x67')],{'firstName':_0x48b717,'mobile':_0x48b717,'phone':_0x48b717,'ListId':_0x261864[_0x32d0('0x9d')]}));}})[_0x32d0('0x25')](handleEntityNotFound(_0x2eebcc,null))['then'](function(_0x4fb91e){if(_0x4fb91e){_0x16a56c=_0x4fb91e;return db[_0x32d0('0xb0')]['find']({'where':{'ContactId':_0x16a56c['id'],'closed':![],'WhatsappAccountId':_0x261864['id']}})[_0x32d0('0x25')](function(_0xe636fc){if(_0xe636fc){return[_0xe636fc,![]];}return db[_0x32d0('0xb0')][_0x32d0('0x60')]({'UserId':_0x34e8cd[_0x32d0('0x61')]['id'],'ContactId':_0x16a56c['id'],'WhatsappAccountId':_0x261864['id'],'phone':_0x48b717,'firstMsgDirection':_0x32d0('0xc9'),'Messages':[_[_0x32d0('0x55')](_0x34e8cd[_0x32d0('0x67')],{'read':![],'body':_0x34e8cd[_0x32d0('0x67')]['body'],'phone':_0x48b717,'WhatsappAccountId':_0x261864['id'],'UserId':_0x34e8cd[_0x32d0('0x61')]['id'],'ContactId':_0x16a56c['id']})]},{'include':[{'model':db[_0x32d0('0x92')],'as':_0x32d0('0xca')}]})['then'](function(_0x4c660e){return[_0x4c660e,!![]];});});}})[_0x32d0('0x77')](function(_0x96765b,_0x39fda2){if(_0x39fda2){return _0x96765b;}return db['WhatsappMessage'][_0x32d0('0x60')](_[_0x32d0('0x55')](_0x34e8cd['body'],{'read':![],'body':_0x34e8cd[_0x32d0('0x67')]['body'],'phone':_0x48b717,'WhatsappAccountId':_0x261864['id'],'WhatsappInteractionId':_0x96765b['id'],'UserId':_0x34e8cd[_0x32d0('0x61')]['id'],'ContactId':_0x16a56c['id']}))[_0x32d0('0x25')](function(_0x59129c){_0x96765b[_0x32d0('0xcb')][_0x32d0('0xca')]=[];_0x96765b[_0x32d0('0xcb')][_0x32d0('0xca')][_0x32d0('0xcc')](_0x59129c[_0x32d0('0xcb')]);return _0x96765b;});})[_0x32d0('0x25')](respondWithResult(_0x2eebcc,null))[_0x32d0('0x5f')](handleError(_0x2eebcc,null));}; \ No newline at end of file +var _0x048e=['list','defaults','contact','WhatsappInteraction','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','WhatsappQueue','queue','waitForTheAssignedQueue','Start','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','WhatsappAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','VIRTUAL','options','where','includeAll','include','findAll','then','catch','show','params','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','order','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','ids','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','getAgents','User','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC'];(function(_0x3f8611,_0x2eafe9){var _0x57d20e=function(_0x22654b){while(--_0x22654b){_0x3f8611['push'](_0x3f8611['shift']());}};_0x57d20e(++_0x2eafe9);}(_0x048e,0x1aa));var _0xe048=function(_0x79654c,_0x1fdcc2){_0x79654c=_0x79654c-0x0;var _0x4d5811=_0x048e[_0x79654c];return _0x4d5811;};'use strict';var emlformat=require(_0xe048('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe048('0x1'));var jsonpatch=require(_0xe048('0x2'));var rp=require(_0xe048('0x3'));var moment=require(_0xe048('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe048('0x5'));var util=require(_0xe048('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe048('0x7'));var ejs=require(_0xe048('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe048('0x9'));var squel=require('squel');var crypto=require(_0xe048('0xa'));var jsforce=require(_0xe048('0xb'));var deskjs=require(_0xe048('0xc'));var toCsv=require(_0xe048('0x7'));var querystring=require(_0xe048('0xd'));var Papa=require(_0xe048('0xe'));var Redis=require(_0xe048('0xf'));var authService=require(_0xe048('0x10'));var qs=require(_0xe048('0x11'));var as=require(_0xe048('0x12'));var hardwareService=require(_0xe048('0x13'));var logger=require(_0xe048('0x14'))(_0xe048('0x15'));var utils=require('../../config/utils');var config=require(_0xe048('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe048('0x17'))['db'];config[_0xe048('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe048('0x19'))(new Redis(config[_0xe048('0x18')]));require(_0xe048('0x1a'))[_0xe048('0x1b')](socket);var jayson=require(_0xe048('0x1c'));var client=jayson['client'][_0xe048('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x574ddd,_0x38079d,_0x35020c,_0x51a172){return new BPromise(function(_0x1ec5a9,_0x44b51c){var _0x2c3356=_0x51a172||client;return _0x2c3356[_0xe048('0x1e')](_0x574ddd,_0x35020c)['then'](function(_0x2f9eaf){logger[_0xe048('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x38079d,_0xe048('0x20'));logger[_0xe048('0x21')](_0xe048('0x22'),_0x38079d,'request\x20sent',JSON[_0xe048('0x23')](_0x2f9eaf));if(_0x2f9eaf[_0xe048('0x24')]){if(_0x2f9eaf[_0xe048('0x24')][_0xe048('0x25')]===0x1f4){logger['error'](_0xe048('0x26'),_0x38079d,_0x2f9eaf[_0xe048('0x24')][_0xe048('0x27')]);return _0x44b51c(_0x2f9eaf[_0xe048('0x24')][_0xe048('0x27')]);}logger[_0xe048('0x24')](_0xe048('0x26'),_0x38079d,_0x2f9eaf[_0xe048('0x24')][_0xe048('0x27')]);return _0x1ec5a9(_0x2f9eaf['error'][_0xe048('0x27')]);}else{logger[_0xe048('0x1f')](_0xe048('0x26'),_0x38079d,_0xe048('0x20'));_0x1ec5a9(_0x2f9eaf['result'][_0xe048('0x27')]);}})['catch'](function(_0x1b3e5a){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x38079d,_0x1b3e5a);_0x44b51c(_0x1b3e5a);});});}function respondWithStatusCode(_0x253478,_0x4accbc){_0x4accbc=_0x4accbc||0xcc;return function(_0x134e74){if(_0x134e74){return _0x253478[_0xe048('0x28')](_0x4accbc);}return _0x253478[_0xe048('0x29')](_0x4accbc)['end']();};}function respondWithResult(_0x27ec16,_0x5bdd4e){_0x5bdd4e=_0x5bdd4e||0xc8;return function(_0xc95dba){if(_0xc95dba){return _0x27ec16[_0xe048('0x29')](_0x5bdd4e)[_0xe048('0x2a')](_0xc95dba);}};}function respondWithFilteredResult(_0x2ca9d3,_0x45c6eb){return function(_0x115366){if(_0x115366){var _0x105e08=typeof _0x45c6eb[_0xe048('0x2b')]===_0xe048('0x2c')&&typeof _0x45c6eb[_0xe048('0x2d')]===_0xe048('0x2c');var _0x59d18c=_0x115366[_0xe048('0x2e')];var _0x5eb5e2=_0x105e08?0x0:_0x45c6eb['offset'];var _0x2b75a0=_0x105e08?_0x115366[_0xe048('0x2e')]:_0x45c6eb[_0xe048('0x2b')]+_0x45c6eb[_0xe048('0x2d')];var _0x135800;if(_0x2b75a0>=_0x59d18c){_0x2b75a0=_0x59d18c;_0x135800=0xc8;}else{_0x135800=0xce;}_0x2ca9d3[_0xe048('0x29')](_0x135800);return _0x2ca9d3[_0xe048('0x2f')](_0xe048('0x30'),_0x5eb5e2+'-'+_0x2b75a0+'/'+_0x59d18c)[_0xe048('0x2a')](_0x115366);}return null;};}function patchUpdates(_0x4594f9){return function(_0x3ca49a){try{jsonpatch[_0xe048('0x31')](_0x3ca49a,_0x4594f9,!![]);}catch(_0x559dfb){return BPromise[_0xe048('0x32')](_0x559dfb);}return _0x3ca49a['save']();};}function saveUpdates(_0x851b1c,_0x285f74){return function(_0x32791a){if(_0x32791a){return _0x32791a[_0xe048('0x33')](_0x851b1c)['then'](function(_0x20385d){return _0x20385d;});}return null;};}function removeEntity(_0xa6388c,_0x5db3b4){return function(_0x405304){if(_0x405304){return _0x405304[_0xe048('0x34')]()['then'](function(){var _0xd16f54=_0x405304['get']({'plain':!![]});var _0x18c152=_0xe048('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x18c152,'resourceId':_0xd16f54['id']}})['then'](function(){return _0x405304;});})['then'](function(){_0xa6388c['status'](0xcc)[_0xe048('0x36')]();});}};}function handleEntityNotFound(_0x5b4b6d,_0x1091a9){return function(_0x509456){if(!_0x509456){_0x5b4b6d[_0xe048('0x28')](0x194);}return _0x509456;};}function handleError(_0x593379,_0x109345){_0x109345=_0x109345||0x1f4;return function(_0x35df2d){logger[_0xe048('0x24')](_0x35df2d[_0xe048('0x37')]);if(_0x35df2d[_0xe048('0x38')]){delete _0x35df2d[_0xe048('0x38')];}_0x593379[_0xe048('0x29')](_0x109345)[_0xe048('0x39')](_0x35df2d);};}exports[_0xe048('0x3a')]=function(_0x5c81fb,_0x1427c0){var _0x1ea823={'include':[{'model':db[_0xe048('0x3b')],'as':_0xe048('0x3c')}]},_0xb612a8={},_0x38e7ae={'count':0x0,'rows':[]};var _0x39948e=_['map'](db[_0xe048('0x3d')][_0xe048('0x3e')],function(_0x2a70fc){return{'name':_0x2a70fc[_0xe048('0x3f')],'type':_0x2a70fc[_0xe048('0x40')][_0xe048('0x41')]};});_0xb612a8[_0xe048('0x42')]=_[_0xe048('0x43')](_0x39948e,'name');_0xb612a8[_0xe048('0x44')]=_[_0xe048('0x45')](_0x5c81fb[_0xe048('0x44')]);_0xb612a8[_0xe048('0x46')]=_['intersection'](_0xb612a8[_0xe048('0x42')],_0xb612a8[_0xe048('0x44')]);_0x1ea823[_0xe048('0x47')]=_[_0xe048('0x48')](_0xb612a8[_0xe048('0x42')],qs['fields'](_0x5c81fb[_0xe048('0x44')][_0xe048('0x49')]));_0x1ea823[_0xe048('0x47')]=_0x1ea823[_0xe048('0x47')][_0xe048('0x4a')]?_0x1ea823[_0xe048('0x47')]:_0xb612a8[_0xe048('0x42')];if(!_0x5c81fb[_0xe048('0x44')][_0xe048('0x4b')](_0xe048('0x4c'))){_0x1ea823[_0xe048('0x2d')]=qs[_0xe048('0x2d')](_0x5c81fb[_0xe048('0x44')][_0xe048('0x2d')]);_0x1ea823[_0xe048('0x2b')]=qs[_0xe048('0x2b')](_0x5c81fb[_0xe048('0x44')][_0xe048('0x2b')]);}_0x1ea823['order']=qs[_0xe048('0x4d')](_0x5c81fb[_0xe048('0x44')][_0xe048('0x4d')]);_0x1ea823['where']=qs[_0xe048('0x46')](_[_0xe048('0x4e')](_0x5c81fb['query'],_0xb612a8[_0xe048('0x46')]),_0x39948e);if(_0x5c81fb[_0xe048('0x44')][_0xe048('0x4f')]){_0x1ea823['where']=_['merge'](_0x1ea823['where'],{'$or':_[_0xe048('0x43')](_0x39948e,function(_0x206a60){if(_0x206a60[_0xe048('0x40')]!==_0xe048('0x50')){var _0x2bb5fe={};_0x2bb5fe[_0x206a60[_0xe048('0x38')]]={'$like':'%'+_0x5c81fb['query'][_0xe048('0x4f')]+'%'};return _0x2bb5fe;}})});}_0x1ea823=_['merge']({},_0x1ea823,_0x5c81fb[_0xe048('0x51')]);var _0x44a016={'where':_0x1ea823[_0xe048('0x52')]};return db[_0xe048('0x3d')][_0xe048('0x2e')](_0x44a016)['then'](function(_0x4e2801){_0x38e7ae['count']=_0x4e2801;if(_0x5c81fb[_0xe048('0x44')][_0xe048('0x53')]){_0x1ea823[_0xe048('0x54')]=[{'all':!![]}];}return db[_0xe048('0x3d')][_0xe048('0x55')](_0x1ea823);})[_0xe048('0x56')](function(_0x4ddae6){_0x38e7ae['rows']=_0x4ddae6;return _0x38e7ae;})[_0xe048('0x56')](respondWithFilteredResult(_0x1427c0,_0x1ea823))[_0xe048('0x57')](handleError(_0x1427c0,null));};exports[_0xe048('0x58')]=function(_0x13cf64,_0x41feae){var _0x127ce8={'raw':![],'where':{'id':_0x13cf64[_0xe048('0x59')]['id']},'include':[{'model':db[_0xe048('0x3b')],'as':_0xe048('0x3c')}]},_0x1610a3={};_0x1610a3[_0xe048('0x42')]=_[_0xe048('0x45')](db['WhatsappAccount'][_0xe048('0x3e')]);_0x1610a3[_0xe048('0x44')]=_[_0xe048('0x45')](_0x13cf64['query']);_0x1610a3['filters']=_[_0xe048('0x48')](_0x1610a3[_0xe048('0x42')],_0x1610a3['query']);_0x127ce8[_0xe048('0x47')]=_['intersection'](_0x1610a3[_0xe048('0x42')],qs['fields'](_0x13cf64['query']['fields']));_0x127ce8[_0xe048('0x47')]=_0x127ce8['attributes']['length']?_0x127ce8['attributes']:_0x1610a3[_0xe048('0x42')];if(_0x13cf64['query'][_0xe048('0x53')]){_0x127ce8[_0xe048('0x54')]=[{'all':!![]}];}_0x127ce8=_[_0xe048('0x5a')]({},_0x127ce8,_0x13cf64[_0xe048('0x51')]);return db['WhatsappAccount'][_0xe048('0x5b')](_0x127ce8)[_0xe048('0x56')](handleEntityNotFound(_0x41feae,null))[_0xe048('0x56')](respondWithResult(_0x41feae,null))[_0xe048('0x57')](handleError(_0x41feae,null));};exports[_0xe048('0x5c')]=function(_0x94a643,_0x11ffea){return db[_0xe048('0x3d')][_0xe048('0x5c')](_0x94a643[_0xe048('0x5d')],{})['then'](function(_0x5a2d97){var _0x533346=_0x94a643[_0xe048('0x5e')][_0xe048('0x5f')]({'plain':!![]});if(!_0x533346)throw new Error(_0xe048('0x60'));if(_0x533346[_0xe048('0x61')]===_0xe048('0x5e')){var _0x1cd40c=_0x5a2d97[_0xe048('0x5f')]({'plain':!![]});var _0x2cd32f=_0xe048('0x35');return db['UserProfileSection'][_0xe048('0x5b')]({'where':{'name':_0x2cd32f,'userProfileId':_0x533346['userProfileId']},'raw':!![]})[_0xe048('0x56')](function(_0x410884){if(_0x410884&&_0x410884[_0xe048('0x62')]===0x0){return db[_0xe048('0x63')]['create']({'name':_0x1cd40c[_0xe048('0x38')],'resourceId':_0x1cd40c['id'],'type':_0x410884[_0xe048('0x38')],'sectionId':_0x410884['id']},{})[_0xe048('0x56')](function(){return _0x5a2d97;});}else{return _0x5a2d97;}})[_0xe048('0x57')](function(_0x36a9c5){logger[_0xe048('0x24')](_0xe048('0x64'),_0x36a9c5);throw _0x36a9c5;});}return _0x5a2d97;})[_0xe048('0x56')](respondWithResult(_0x11ffea,0xc9))['catch'](handleError(_0x11ffea,null));};exports[_0xe048('0x33')]=function(_0x44ece1,_0x3af404){if(_0x44ece1['body']['id']){delete _0x44ece1[_0xe048('0x5d')]['id'];}return db[_0xe048('0x3d')][_0xe048('0x5b')]({'where':{'id':_0x44ece1[_0xe048('0x59')]['id']},'include':[{'model':db[_0xe048('0x3b')],'as':_0xe048('0x3c')}]})[_0xe048('0x56')](handleEntityNotFound(_0x3af404,null))[_0xe048('0x56')](saveUpdates(_0x44ece1[_0xe048('0x5d')],null))[_0xe048('0x56')](respondWithResult(_0x3af404,null))[_0xe048('0x57')](handleError(_0x3af404,null));};exports[_0xe048('0x34')]=function(_0xe9e540,_0x296348){return db[_0xe048('0x3d')][_0xe048('0x5b')]({'where':{'id':_0xe9e540[_0xe048('0x59')]['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x296348,null))[_0xe048('0x56')](removeEntity(_0x296348,null))[_0xe048('0x57')](handleError(_0x296348,null));};exports[_0xe048('0x65')]=function(_0xc2b8d3,_0x3903cd){return db['WhatsappAccount'][_0xe048('0x65')]()[_0xe048('0x56')](respondWithResult(_0x3903cd,null))[_0xe048('0x57')](handleError(_0x3903cd,null));};exports[_0xe048('0x66')]=function(_0x9147dc,_0x1236ec,_0x22944f){if(_0x9147dc[_0xe048('0x5d')]['id']){delete _0x9147dc['body']['id'];}return db[_0xe048('0x3d')][_0xe048('0x5b')]({'where':{'id':_0x9147dc[_0xe048('0x59')]['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x1236ec,null))['then'](function(_0x1115e6){if(_0x1115e6){_0x9147dc[_0xe048('0x5d')][_0xe048('0x67')]=_0x1115e6['id'];return db['Disposition'][_0xe048('0x5c')](_0x9147dc[_0xe048('0x5d')]);}})[_0xe048('0x56')](respondWithResult(_0x1236ec,null))[_0xe048('0x57')](handleError(_0x1236ec,null));};exports[_0xe048('0x68')]=function(_0x1f88b1,_0x5cd7fa,_0x3de372){var _0xb5cef2={'raw':![],'where':{}};var _0x29421a={};var _0x24bdf0={'count':0x0,'rows':[]};return db[_0xe048('0x3d')][_0xe048('0x69')]({'where':{'id':_0x1f88b1[_0xe048('0x59')]['id']}})['then'](handleEntityNotFound(_0x5cd7fa,null))[_0xe048('0x56')](function(_0x48a610){if(_0x48a610){_0x29421a[_0xe048('0x42')]=_[_0xe048('0x45')](db['Disposition'][_0xe048('0x3e')]);_0x29421a[_0xe048('0x44')]=_[_0xe048('0x45')](_0x1f88b1[_0xe048('0x44')]);_0x29421a['filters']=_[_0xe048('0x48')](_0x29421a[_0xe048('0x42')],_0x29421a['query']);_0xb5cef2[_0xe048('0x47')]=_[_0xe048('0x48')](_0x29421a[_0xe048('0x42')],qs[_0xe048('0x49')](_0x1f88b1[_0xe048('0x44')][_0xe048('0x49')]));_0xb5cef2['attributes']=_0xb5cef2[_0xe048('0x47')][_0xe048('0x4a')]?_0xb5cef2[_0xe048('0x47')]:_0x29421a['model'];if(!_0x1f88b1[_0xe048('0x44')][_0xe048('0x4b')]('nolimit')){_0xb5cef2[_0xe048('0x2d')]=qs[_0xe048('0x2d')](_0x1f88b1[_0xe048('0x44')][_0xe048('0x2d')]);_0xb5cef2[_0xe048('0x2b')]=qs[_0xe048('0x2b')](_0x1f88b1[_0xe048('0x44')][_0xe048('0x2b')]);}_0xb5cef2[_0xe048('0x6a')]=qs['sort'](_0x1f88b1[_0xe048('0x44')]['sort']);_0xb5cef2[_0xe048('0x52')]=qs[_0xe048('0x46')](_['pick'](_0x1f88b1[_0xe048('0x44')],_0x29421a[_0xe048('0x46')]));_0xb5cef2[_0xe048('0x52')][_0xe048('0x67')]=_0x48a610['id'];if(_0x1f88b1[_0xe048('0x44')][_0xe048('0x4f')]){_0xb5cef2[_0xe048('0x52')]=_['merge'](_0xb5cef2[_0xe048('0x52')],{'$or':_[_0xe048('0x43')](_0xb5cef2[_0xe048('0x47')],function(_0x2a96ba){var _0x53cce3={};_0x53cce3[_0x2a96ba]={'$like':'%'+_0x1f88b1[_0xe048('0x44')][_0xe048('0x4f')]+'%'};return _0x53cce3;})});}_0xb5cef2=_[_0xe048('0x5a')]({},_0xb5cef2,_0x1f88b1[_0xe048('0x51')]);return db[_0xe048('0x6b')]['count']({'where':_0xb5cef2[_0xe048('0x52')]})[_0xe048('0x56')](function(_0x27d128){_0x24bdf0[_0xe048('0x2e')]=_0x27d128;if(_0x1f88b1[_0xe048('0x44')]['includeAll']){_0xb5cef2['include']=[{'all':!![]}];}return db[_0xe048('0x6b')][_0xe048('0x55')](_0xb5cef2);})[_0xe048('0x56')](function(_0x4c94df){_0x24bdf0[_0xe048('0x6c')]=_0x4c94df;return _0x24bdf0;});}})[_0xe048('0x56')](respondWithFilteredResult(_0x5cd7fa,_0xb5cef2))[_0xe048('0x57')](handleError(_0x5cd7fa,null));};exports[_0xe048('0x6d')]=function(_0x444ccb,_0x5b8111,_0x4c3bc6){return db[_0xe048('0x3d')][_0xe048('0x5b')]({'where':{'id':_0x444ccb['params']['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x5b8111,null))[_0xe048('0x56')](function(_0x362610){if(_0x362610){return _0x362610[_0xe048('0x6d')](_0x444ccb[_0xe048('0x44')]['ids']);}})[_0xe048('0x56')](respondWithStatusCode(_0x5b8111,null))[_0xe048('0x57')](handleError(_0x5b8111,null));};exports[_0xe048('0x6e')]=function(_0x22b8a3,_0x20a288,_0x5856f6){if(_0x22b8a3['body']['id']){delete _0x22b8a3[_0xe048('0x5d')]['id'];}return db[_0xe048('0x3d')]['find']({'where':{'id':_0x22b8a3['params']['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x20a288,null))[_0xe048('0x56')](function(_0x16bd26){if(_0x16bd26){_0x22b8a3[_0xe048('0x5d')]['WhatsappAccountId']=_0x16bd26['id'];return db[_0xe048('0x6f')][_0xe048('0x5c')](_0x22b8a3[_0xe048('0x5d')]);}})[_0xe048('0x56')](respondWithResult(_0x20a288,null))[_0xe048('0x57')](handleError(_0x20a288,null));};exports[_0xe048('0x70')]=function(_0x53df9a,_0x5af1e9,_0x24a45a){var _0x56e039={'raw':![],'where':{}};var _0x2182ef={};var _0x2532ce={'count':0x0,'rows':[]};return db[_0xe048('0x3d')][_0xe048('0x69')]({'where':{'id':_0x53df9a[_0xe048('0x59')]['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x5af1e9,null))['then'](function(_0xf4f5ce){if(_0xf4f5ce){_0x2182ef[_0xe048('0x42')]=_['keys'](db[_0xe048('0x6f')][_0xe048('0x3e')]);_0x2182ef[_0xe048('0x44')]=_[_0xe048('0x45')](_0x53df9a[_0xe048('0x44')]);_0x2182ef[_0xe048('0x46')]=_[_0xe048('0x48')](_0x2182ef[_0xe048('0x42')],_0x2182ef['query']);_0x56e039[_0xe048('0x47')]=_['intersection'](_0x2182ef[_0xe048('0x42')],qs[_0xe048('0x49')](_0x53df9a[_0xe048('0x44')][_0xe048('0x49')]));_0x56e039[_0xe048('0x47')]=_0x56e039[_0xe048('0x47')][_0xe048('0x4a')]?_0x56e039[_0xe048('0x47')]:_0x2182ef[_0xe048('0x42')];if(!_0x53df9a[_0xe048('0x44')]['hasOwnProperty'](_0xe048('0x4c'))){_0x56e039[_0xe048('0x2d')]=qs[_0xe048('0x2d')](_0x53df9a[_0xe048('0x44')][_0xe048('0x2d')]);_0x56e039[_0xe048('0x2b')]=qs['offset'](_0x53df9a[_0xe048('0x44')]['offset']);}_0x56e039[_0xe048('0x6a')]=qs['sort'](_0x53df9a[_0xe048('0x44')][_0xe048('0x4d')]);_0x56e039[_0xe048('0x52')]=qs['filters'](_[_0xe048('0x4e')](_0x53df9a[_0xe048('0x44')],_0x2182ef[_0xe048('0x46')]));_0x56e039[_0xe048('0x52')][_0xe048('0x67')]=_0xf4f5ce['id'];if(_0x53df9a[_0xe048('0x44')][_0xe048('0x4f')]){_0x56e039[_0xe048('0x52')]=_['merge'](_0x56e039[_0xe048('0x52')],{'$or':_['map'](_0x56e039['attributes'],function(_0x4996ef){var _0x373f3c={};_0x373f3c[_0x4996ef]={'$like':'%'+_0x53df9a[_0xe048('0x44')][_0xe048('0x4f')]+'%'};return _0x373f3c;})});}_0x56e039=_[_0xe048('0x5a')]({},_0x56e039,_0x53df9a[_0xe048('0x51')]);return db[_0xe048('0x6f')][_0xe048('0x2e')]({'where':_0x56e039[_0xe048('0x52')]})[_0xe048('0x56')](function(_0x24804a){_0x2532ce['count']=_0x24804a;if(_0x53df9a[_0xe048('0x44')][_0xe048('0x53')]){_0x56e039[_0xe048('0x54')]=[{'all':!![]}];}return db[_0xe048('0x6f')][_0xe048('0x55')](_0x56e039);})[_0xe048('0x56')](function(_0x71bd26){_0x2532ce[_0xe048('0x6c')]=_0x71bd26;return _0x2532ce;});}})[_0xe048('0x56')](respondWithFilteredResult(_0x5af1e9,_0x56e039))['catch'](handleError(_0x5af1e9,null));};exports[_0xe048('0x71')]=function(_0x328f2a,_0x4a55f0,_0x26086d){return db[_0xe048('0x3d')][_0xe048('0x5b')]({'where':{'id':_0x328f2a[_0xe048('0x59')]['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x4a55f0,null))[_0xe048('0x56')](function(_0x484c67){if(_0x484c67){return _0x484c67[_0xe048('0x71')](_0x328f2a[_0xe048('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x4a55f0,null))['catch'](handleError(_0x4a55f0,null));};exports[_0xe048('0x72')]=function(_0x57269f,_0x2fe3a8,_0x268c95){return db['WhatsappAccount']['find']({'where':{'id':_0x57269f[_0xe048('0x59')]['id']}})['then'](handleEntityNotFound(_0x2fe3a8,null))[_0xe048('0x56')](function(_0x4bedff){if(_0x4bedff){return _0x4bedff['addAgents'](_0x57269f[_0xe048('0x5d')][_0xe048('0x73')],_[_0xe048('0x74')](_0x57269f[_0xe048('0x5d')],['ids','id'])||{})[_0xe048('0x75')](function(_0x350359){for(var _0x35a59e=0x0;_0x35a59e<_0x57269f[_0xe048('0x5d')]['ids'][_0xe048('0x4a')];_0x35a59e+=0x1){socket['emit'](_0xe048('0x76'),{'UserId':Number(_0x57269f[_0xe048('0x5d')][_0xe048('0x73')][_0x35a59e]),'WhatsappAccountId':Number(_0x57269f['params']['id'])});}return _0x350359;});}})['then'](respondWithResult(_0x2fe3a8,null))[_0xe048('0x57')](handleError(_0x2fe3a8,null));};exports[_0xe048('0x77')]=function(_0x4155b2,_0x9d97bd,_0x232e86){return db[_0xe048('0x3d')][_0xe048('0x5b')]({'where':{'id':_0x4155b2['params']['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x9d97bd,null))['then'](function(_0x314184){if(_0x314184){return _0x314184[_0xe048('0x77')](_0x4155b2[_0xe048('0x44')][_0xe048('0x73')])[_0xe048('0x56')](function(){if(_[_0xe048('0x78')](_0x4155b2['query'][_0xe048('0x73')])){for(var _0x41a4ae=0x0;_0x41a4ae<_0x4155b2['query'][_0xe048('0x73')][_0xe048('0x4a')];_0x41a4ae+=0x1){socket[_0xe048('0x79')]('userWhatsappAccount:remove',{'UserId':Number(_0x4155b2[_0xe048('0x44')][_0xe048('0x73')][_0x41a4ae]),'WhatsappAccountId':Number(_0x4155b2['params']['id'])});}}else{socket[_0xe048('0x79')]('userWhatsappAccount:remove',{'UserId':Number(_0x4155b2[_0xe048('0x44')][_0xe048('0x73')]),'WhatsappAccountId':Number(_0x4155b2[_0xe048('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x9d97bd,null))[_0xe048('0x57')](handleError(_0x9d97bd,null));};exports[_0xe048('0x7a')]=function(_0x4a7b44,_0x24279b,_0x497dd9){var _0x248cf8={};var _0x41a01d={};var _0x3854b2;var _0x501680;return db[_0xe048('0x3d')]['findOne']({'where':{'id':_0x4a7b44[_0xe048('0x59')]['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x24279b,null))[_0xe048('0x56')](function(_0x390394){if(_0x390394){_0x3854b2=_0x390394;_0x41a01d[_0xe048('0x42')]=_[_0xe048('0x45')](db[_0xe048('0x7b')][_0xe048('0x3e')]);_0x41a01d[_0xe048('0x44')]=_[_0xe048('0x45')](_0x4a7b44[_0xe048('0x44')]);_0x41a01d[_0xe048('0x46')]=_['intersection'](_0x41a01d[_0xe048('0x42')],_0x41a01d[_0xe048('0x44')]);_0x248cf8[_0xe048('0x47')]=_[_0xe048('0x48')](_0x41a01d[_0xe048('0x42')],qs['fields'](_0x4a7b44['query']['fields']));_0x248cf8['attributes']=_0x248cf8[_0xe048('0x47')][_0xe048('0x4a')]?_0x248cf8[_0xe048('0x47')]:_0x41a01d[_0xe048('0x42')];_0x248cf8[_0xe048('0x6a')]=qs[_0xe048('0x4d')](_0x4a7b44[_0xe048('0x44')][_0xe048('0x4d')]);_0x248cf8['where']=qs[_0xe048('0x46')](_[_0xe048('0x4e')](_0x4a7b44['query'],_0x41a01d[_0xe048('0x46')]));if(_0x4a7b44[_0xe048('0x44')][_0xe048('0x4f')]){_0x248cf8[_0xe048('0x52')]=_[_0xe048('0x5a')](_0x248cf8[_0xe048('0x52')],{'$or':_[_0xe048('0x43')](_0x248cf8[_0xe048('0x47')],function(_0x312b60){var _0x36e4ad={};_0x36e4ad[_0x312b60]={'$like':'%'+_0x4a7b44[_0xe048('0x44')]['filter']+'%'};return _0x36e4ad;})});}_0x248cf8=_[_0xe048('0x5a')]({},_0x248cf8,_0x4a7b44['options']);return _0x3854b2[_0xe048('0x7a')](_0x248cf8);}})[_0xe048('0x56')](function(_0x559662){if(_0x559662){_0x501680=_0x559662[_0xe048('0x4a')];if(!_0x4a7b44[_0xe048('0x44')][_0xe048('0x4b')]('nolimit')){_0x248cf8['limit']=qs['limit'](_0x4a7b44['query'][_0xe048('0x2d')]);_0x248cf8['offset']=qs['offset'](_0x4a7b44['query'][_0xe048('0x2b')]);}return _0x3854b2[_0xe048('0x7a')](_0x248cf8);}})['then'](function(_0x4fe67b){if(_0x4fe67b){return _0x4fe67b?{'count':_0x501680,'rows':_0x4fe67b}:null;}})[_0xe048('0x56')](respondWithResult(_0x24279b,null))[_0xe048('0x57')](handleError(_0x24279b,null));};exports['addApplications']=function(_0x44fa9c,_0x40eaff){var _0x35cd8c=_0x44fa9c['params']['id'];var _0x25b02c=_0x44fa9c['body'];var _0x276b91=0xc8;var _0x43ef80=null;return db[_0xe048('0x7c')][_0xe048('0x7d')]({'isolationLevel':db['sequelize'][_0xe048('0x7e')]['ISOLATION_LEVELS'][_0xe048('0x7f')]},function(_0x264a37){return db[_0xe048('0x3d')]['findOne']({'where':{'id':_0x35cd8c},'transaction':_0x264a37})[_0xe048('0x56')](function(_0x2ae8fd){if(_0x2ae8fd){return db[_0xe048('0x80')][_0xe048('0x34')]({'where':{'WhatsappAccountId':_0x35cd8c},'transaction':_0x264a37})[_0xe048('0x56')](function(){var _0x38b070=_[_0xe048('0x43')](_0x25b02c,function(_0x4cd584){_0x4cd584[_0xe048('0x67')]=_0x35cd8c;return _0x4cd584;});return db['WhatsappApplication'][_0xe048('0x81')](_0x38b070,{'transaction':_0x264a37});});}else{_0x276b91=0x194;_0x43ef80=[];}});})[_0xe048('0x56')](function(){if(_0x276b91!==0x194){return db[_0xe048('0x80')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x35cd8c},'order':_0xe048('0x82')})[_0xe048('0x56')](function(_0x5dd8e5){_0x43ef80=_0x5dd8e5;});}})[_0xe048('0x57')](function(_0x5ea8ae){_0x276b91=0x1f4;logger[_0xe048('0x24')](_0x5ea8ae['stack']);if(_0x5ea8ae[_0xe048('0x38')]){delete _0x5ea8ae[_0xe048('0x38')];}_0x43ef80=_0x5ea8ae;})['finally'](function(){if(_0x43ef80===null){_0x40eaff[_0xe048('0x28')](_0x276b91);}else{if(_0x276b91===0x1f4){_0x40eaff['status'](_0x276b91)[_0xe048('0x39')](_0x43ef80);}else{_0x40eaff[_0xe048('0x29')](_0x276b91)[_0xe048('0x2a')](_0x43ef80);}}});};exports[_0xe048('0x83')]=function(_0x19df34,_0x323c07,_0x13b7d8){var _0x145de6={};var _0x47808b={};var _0x1a1a94;var _0x43ebd2;return db['WhatsappAccount'][_0xe048('0x69')]({'where':{'id':_0x19df34[_0xe048('0x59')]['id']}})[_0xe048('0x56')](handleEntityNotFound(_0x323c07,null))[_0xe048('0x56')](function(_0x5eda5f){if(_0x5eda5f){_0x1a1a94=_0x5eda5f;_0x47808b[_0xe048('0x42')]=_[_0xe048('0x45')](db[_0xe048('0x80')]['rawAttributes']);_0x47808b[_0xe048('0x44')]=_[_0xe048('0x45')](_0x19df34[_0xe048('0x44')]);_0x47808b[_0xe048('0x46')]=_[_0xe048('0x48')](_0x47808b[_0xe048('0x42')],_0x47808b[_0xe048('0x44')]);_0x145de6['attributes']=_[_0xe048('0x48')](_0x47808b['model'],qs[_0xe048('0x49')](_0x19df34[_0xe048('0x44')][_0xe048('0x49')]));_0x145de6[_0xe048('0x47')]=_0x145de6[_0xe048('0x47')][_0xe048('0x4a')]?_0x145de6['attributes']:_0x47808b[_0xe048('0x42')];_0x145de6[_0xe048('0x6a')]=qs[_0xe048('0x4d')](_0x19df34[_0xe048('0x44')]['sort']);_0x145de6[_0xe048('0x52')]=qs[_0xe048('0x46')](_['pick'](_0x19df34['query'],_0x47808b[_0xe048('0x46')]));if(_0x19df34[_0xe048('0x44')][_0xe048('0x4f')]){_0x145de6[_0xe048('0x52')]=_[_0xe048('0x5a')](_0x145de6[_0xe048('0x52')],{'$or':_['map'](_0x145de6[_0xe048('0x47')],function(_0x434093){var _0x52441c={};_0x52441c[_0x434093]={'$like':'%'+_0x19df34[_0xe048('0x44')][_0xe048('0x4f')]+'%'};return _0x52441c;})});}_0x145de6=_[_0xe048('0x5a')]({},_0x145de6,_0x19df34[_0xe048('0x51')]);return _0x1a1a94[_0xe048('0x83')](_0x145de6);}})[_0xe048('0x56')](function(_0x3f5e2e){if(_0x3f5e2e){_0x43ebd2=_0x3f5e2e[_0xe048('0x4a')];if(!_0x19df34[_0xe048('0x44')]['hasOwnProperty'](_0xe048('0x4c'))){_0x145de6[_0xe048('0x2d')]=qs['limit'](_0x19df34[_0xe048('0x44')]['limit']);_0x145de6[_0xe048('0x2b')]=qs[_0xe048('0x2b')](_0x19df34[_0xe048('0x44')]['offset']);}return _0x1a1a94[_0xe048('0x83')](_0x145de6);}})[_0xe048('0x56')](function(_0x437d8a){if(_0x437d8a){return _0x437d8a?{'count':_0x43ebd2,'rows':_0x437d8a}:null;}})[_0xe048('0x56')](respondWithResult(_0x323c07,null))[_0xe048('0x57')](handleError(_0x323c07,null));};exports[_0xe048('0x84')]=function(_0x473d61,_0x555cd7,_0x44b1d7){var _0x3a2472={'channel':_0xe048('0x85')};var _0x4032c8=[];var _0x51b44a=[];var _0x28c383={};return db['WhatsappAccount'][_0xe048('0x5b')]({'where':{'id':_0x473d61[_0xe048('0x59')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xe048('0x86')}]})[_0xe048('0x56')](handleEntityNotFound(_0x555cd7,null))[_0xe048('0x56')](function(_0x30a756){_0x3a2472[_0xe048('0x87')]=_0x30a756;if(_0x3a2472[_0xe048('0x87')]&&_0x3a2472[_0xe048('0x87')][_0xe048('0x40')]==='sinch'&&_0x473d61[_0xe048('0x5d')][_0xe048('0x88')]){if(_0x473d61['body'][_0xe048('0x88')][_0xe048('0x4a')]===0x0)return;if(_0x473d61['body'][_0xe048('0x88')][0x0][_0xe048('0x89')]!==_0xe048('0x8a'))return;return db[_0xe048('0x8b')]['update']({'read':!![],'readAt':_0x473d61[_0xe048('0x5d')][_0xe048('0x88')][0x0][_0xe048('0x8c')]},{'where':{'messageId':_0x473d61[_0xe048('0x5d')][_0xe048('0x88')][0x0][_0xe048('0x8d')]},'individualHooks':!![]})[_0xe048('0x56')](function(_0x190ac9){return _0x555cd7[_0xe048('0x29')](0xc8)[_0xe048('0x2a')](_0x190ac9);});}_0x3a2472['applications']=_[_0xe048('0x8e')](_0x30a756['Applications'],[_0xe048('0x82')],[_0xe048('0x8f')]);if(_0x3a2472[_0xe048('0x87')][_0xe048('0x86')]){delete _0x3a2472[_0xe048('0x87')]['Applications'];}return db['CmContact']['describe']()[_0xe048('0x56')](function(_0x311474){if(!_0x311474){throw new db[(_0xe048('0x90'))]['ValidationError'](_0xe048('0x91'));}_0x4032c8=_[_0xe048('0x92')](_['keys'](_0x311474),[_0xe048('0x93'),_0xe048('0x94')]);_0x51b44a=_[_0xe048('0x92')](_['keys'](_0x311474),[_0xe048('0x93'),_0xe048('0x94'),_0xe048('0x95'),_0xe048('0x96')]);_0x3a2472['body']={'mapKey':'mobile'};if(_0x3a2472[_0xe048('0x87')]&&_0x3a2472[_0xe048('0x87')][_0xe048('0x40')]===_0xe048('0x97')){_0x3a2472['body'][_0xe048('0x98')]=_0x473d61[_0xe048('0x5d')][_0xe048('0x99')][_0xe048('0x9a')](_0xe048('0x9b'),'');_0x3a2472[_0xe048('0x5d')]['body']=_0x473d61[_0xe048('0x5d')][_0xe048('0x9c')];_0x3a2472[_0xe048('0x5d')][_0xe048('0x9d')]=_0x473d61[_0xe048('0x5d')][_0xe048('0x9e')];}if(_0x3a2472[_0xe048('0x87')]&&_0x3a2472[_0xe048('0x87')]['type']===_0xe048('0x9f')){_0x3a2472['body'][_0xe048('0x98')]=_0x473d61[_0xe048('0x5d')][_0xe048('0xa0')][0x0][_0xe048('0x98')];_0x3a2472['body'][_0xe048('0x5d')]=_0x473d61[_0xe048('0x5d')][_0xe048('0xa0')][0x0][_0xe048('0x27')]['body'];_0x3a2472[_0xe048('0x5d')][_0xe048('0x9d')]=_0x473d61['body'][_0xe048('0xa0')][0x0][_0xe048('0x8d')];}if(_0x3a2472['body']['id']){delete _0x3a2472[_0xe048('0x5d')]['id'];}if(_[_0xe048('0xa1')](_0x3a2472[_0xe048('0x5d')][_0xe048('0x98')])){throw new db['Sequelize'][(_0xe048('0xa2'))](_0xe048('0xa3'));}if(_[_0xe048('0xa1')](_0x3a2472[_0xe048('0x5d')][_0xe048('0x5d')])||_0x3a2472[_0xe048('0x5d')][_0xe048('0x5d')]===''){throw new db[(_0xe048('0x90'))][(_0xe048('0xa2'))](_0xe048('0xa4'));}if(_[_0xe048('0xa1')](_0x3a2472[_0xe048('0x5d')][_0xe048('0xa5')])){throw new db[(_0xe048('0x90'))][(_0xe048('0xa2'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x51b44a);}if(!_[_0xe048('0xa6')](_0x51b44a,_0x3a2472[_0xe048('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0xe048('0xa2'))](_0xe048('0xa7')+_0x51b44a);}_0x28c383[_0x3a2472[_0xe048('0x5d')][_0xe048('0xa5')]]=_0x3a2472[_0xe048('0x5d')]['from'];return db['CmList']['find']({'where':{'id':_0x3a2472[_0xe048('0x87')][_0xe048('0x96')]},'include':[{'model':db[_0xe048('0xa8')],'as':_0xe048('0xa9'),'where':_0x28c383,'limit':0x1,'order':[[_0xe048('0x94'),_0xe048('0xaa')]]}]});})['then'](handleEntityNotFound(_0x555cd7,null))[_0xe048('0x56')](function(_0x208063){if(_0x208063){_0x3a2472[_0xe048('0xab')]=_['omit'](_0x208063,['Contacts']);if(_0x208063['Contacts'][_0xe048('0x4a')]){return _0x208063[_0xe048('0xa9')][0x0];}var _0x48df34=_[_0xe048('0xac')](_0x3a2472[_0xe048('0x5d')],{'firstName':_0x3a2472[_0xe048('0x5d')]['from'],'ListId':_0x208063['id']});_0x48df34[_0x3a2472[_0xe048('0x5d')][_0xe048('0xa5')]]=_0x3a2472[_0xe048('0x5d')][_0xe048('0x98')];return db[_0xe048('0xa8')][_0xe048('0x5c')](_0x48df34,{'fields':_0x4032c8,'raw':!![]});}})[_0xe048('0x56')](handleEntityNotFound(_0x555cd7,null))[_0xe048('0x56')](function(_0x2c7203){if(_0x2c7203){_0x3a2472[_0xe048('0xad')]=_0x2c7203;var _0x4ac4c8={'ContactId':_0x2c7203['id'],'phone':_0x3a2472[_0xe048('0x5d')][_0xe048('0x98')],'WhatsappAccountId':_0x473d61['params']['id']};var _0x28cd34={'ContactId':_0x2c7203['id'],'WhatsappAccountId':_0x473d61[_0xe048('0x59')]['id'],'closed':![]};return db[_0xe048('0xae')][_0xe048('0x5b')]({'where':_0x28cd34})[_0xe048('0x56')](function(_0x29d109){if(_0x29d109){return[_0x29d109,![]];}return db['WhatsappInteraction'][_0xe048('0x5c')](_0x4ac4c8)[_0xe048('0x56')](function(_0x23eceb){return[_0x23eceb,!![]];});});}})[_0xe048('0x75')](function(_0x3dcc72,_0x5ab0d2){_0x3a2472[_0xe048('0xaf')]=_0x3dcc72['get']({'plain':!![]});_0x3a2472['interaction'][_0xe048('0xb0')]=![];if(_0x5ab0d2){if(_0x3a2472[_0xe048('0x87')][_0xe048('0xb1')]){_0x3a2472['applications'][_0xe048('0xb2')]({'id':0x0,'priority':_0x3a2472[_0xe048('0xb3')][_0xe048('0x4a')]+0x1,'app':_0xe048('0xb4'),'appdata':_0xe048('0xb5'),'interval':_0xe048('0xb6')});}_0x3a2472[_0xe048('0xaf')]['created']=!![];}return db[_0xe048('0x8b')][_0xe048('0x5c')]({'phone':_0x3a2472[_0xe048('0x5d')]['from'],'messageId':_0x3a2472[_0xe048('0x5d')][_0xe048('0x9d')],'body':_0x3a2472['body']['body'],'WhatsappAccountId':_0x473d61[_0xe048('0x59')]['id'],'WhatsappInteractionId':_0x3dcc72['id'],'direction':'in','ContactId':_0x3dcc72['ContactId'],'AttachmentId':_0x3a2472['body'][_0xe048('0xb7')]});})[_0xe048('0x56')](function(_0x165c59){_0x3a2472[_0xe048('0x27')]=_0x165c59;if(!_0x3a2472[_0xe048('0xaf')]['UserId'])return;return db[_0xe048('0x7b')][_0xe048('0x5b')]({'attributes':['id',_0xe048('0x38')],'where':{'id':_0x3a2472[_0xe048('0xaf')][_0xe048('0xb8')]}});})['then'](function(_0x48bb1d){if(_0x48bb1d){_0x3a2472[_0xe048('0xb3')][_0xe048('0xb9')]({'id':0x0,'priority':0x0,'app':_0xe048('0xba'),'appdata':_0x48bb1d[_0xe048('0x38')]+','+(_0x3a2472[_0xe048('0x87')][_0xe048('0xbb')]||0xa),'interval':_0xe048('0xb6')});}if(!_0x3a2472['interaction']['queueId'])return;return db[_0xe048('0xbc')][_0xe048('0x5b')]({'attributes':['id',_0xe048('0x38')],'where':{'id':_0x3a2472['interaction']['queueId']}});})[_0xe048('0x56')](function(_0x2d5665){if(_0x2d5665){_0x3a2472['applications'][_0xe048('0xb9')]({'id':0x0,'priority':0x1,'app':_0xe048('0xbd'),'appdata':_0x2d5665[_0xe048('0x38')]+','+(_0x3a2472[_0xe048('0x87')][_0xe048('0xbe')]||0x12c),'interval':_0xe048('0xb6')});}return respondWithRpcPromise(_0xe048('0xbf'),'startRouting',_0x3a2472);})[_0xe048('0x56')](function(_0x5a29d3){if(_0x5a29d3){var _0x45b0f8=0xc8;var _0x11f63f='receiveMessage';logger[_0xe048('0x1f')](_0xe048('0x22'),_0x11f63f,_0x45b0f8,'entity\x20found');logger[_0xe048('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x11f63f,_0x45b0f8,'entity\x20found',JSON[_0xe048('0x23')](_0x5a29d3));if(_0x3a2472[_0xe048('0x87')][_0xe048('0x40')]===_0xe048('0x97')){return _0x555cd7[_0xe048('0x29')](_0x45b0f8)[_0xe048('0x2f')]('Content-Type',_0xe048('0xc0'))[_0xe048('0x39')](_0xe048('0xc1'));}else{return _0x555cd7[_0xe048('0x29')](_0x45b0f8)[_0xe048('0x2a')](_0x5a29d3);}}});})[_0xe048('0x57')](handleError(_0x555cd7,null));};exports[_0xe048('0x39')]=function(_0x568504,_0x20edf2,_0x3f4fa2){var _0x1decb8,_0x1d7996,_0x445d79;if(_['isNil'](_0x568504[_0xe048('0x5d')]['body'])||_0x568504['body'][_0xe048('0x5d')]===''){throw new db[(_0xe048('0x90'))][(_0xe048('0xa2'))](_0xe048('0xa4'));}if(_[_0xe048('0xa1')](_0x568504[_0xe048('0x5d')]['to'])){throw new db[(_0xe048('0x90'))][(_0xe048('0xa2'))](_0xe048('0xc2'));}_0x1decb8=_0x568504[_0xe048('0x5d')]['to'];return db[_0xe048('0x3d')]['find']({'where':{'id':_0x568504[_0xe048('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xe048('0xc3'),'include':[{'model':db['CmContact'],'as':_0xe048('0xa9'),'where':{'mobile':_0x1decb8},'limit':0x1,'order':[[_0xe048('0x94'),_0xe048('0xaa')]]}]}]})[_0xe048('0x56')](handleEntityNotFound(_0x20edf2,null))[_0xe048('0x56')](function(_0x4889b4){if(_0x4889b4&&_0x4889b4[_0xe048('0xc3')]){_0x1d7996=_0x4889b4[_0xe048('0x5f')]({'plain':!![]});if(_0x1d7996[_0xe048('0xc3')]&&_0x1d7996[_0xe048('0xc3')][_0xe048('0xa9')][_0xe048('0x4a')]){return _0x1d7996[_0xe048('0xc3')][_0xe048('0xa9')][0x0];}return db['CmContact']['create'](_['defaults'](_0x568504[_0xe048('0x5d')],{'firstName':_0x1decb8,'mobile':_0x1decb8,'phone':_0x1decb8,'ListId':_0x1d7996[_0xe048('0x96')]}));}})['then'](handleEntityNotFound(_0x20edf2,null))[_0xe048('0x56')](function(_0x312111){if(_0x312111){_0x445d79=_0x312111;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x445d79['id'],'closed':![],'WhatsappAccountId':_0x1d7996['id']}})[_0xe048('0x56')](function(_0x51a1d5){if(_0x51a1d5){return[_0x51a1d5,![]];}return db[_0xe048('0xae')][_0xe048('0x5c')]({'UserId':_0x568504[_0xe048('0x5e')]['id'],'ContactId':_0x445d79['id'],'WhatsappAccountId':_0x1d7996['id'],'phone':_0x1decb8,'firstMsgDirection':_0xe048('0xc4'),'Messages':[_[_0xe048('0x5a')](_0x568504[_0xe048('0x5d')],{'read':![],'body':_0x568504['body'][_0xe048('0x5d')],'phone':_0x1decb8,'WhatsappAccountId':_0x1d7996['id'],'UserId':_0x568504[_0xe048('0x5e')]['id'],'ContactId':_0x445d79['id']})]},{'include':[{'model':db[_0xe048('0x8b')],'as':_0xe048('0xc5')}]})[_0xe048('0x56')](function(_0x3e254a){return[_0x3e254a,!![]];});});}})[_0xe048('0x75')](function(_0xa08b12,_0x151e0b){if(_0x151e0b){return _0xa08b12;}return db[_0xe048('0x8b')]['create'](_[_0xe048('0x5a')](_0x568504[_0xe048('0x5d')],{'read':![],'body':_0x568504[_0xe048('0x5d')][_0xe048('0x5d')],'phone':_0x1decb8,'WhatsappAccountId':_0x1d7996['id'],'WhatsappInteractionId':_0xa08b12['id'],'UserId':_0x568504[_0xe048('0x5e')]['id'],'ContactId':_0x445d79['id']}))[_0xe048('0x56')](function(_0x2d8960){_0xa08b12[_0xe048('0xc6')]['Messages']=[];_0xa08b12[_0xe048('0xc6')]['Messages'][_0xe048('0xb2')](_0x2d8960['dataValues']);return _0xa08b12;});})[_0xe048('0x56')](respondWithResult(_0x20edf2,null))[_0xe048('0x57')](handleError(_0x20edf2,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b4b59d0..d691708 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 _0xf5db=['save','update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners'];(function(_0x1ace6a,_0x1a9b85){var _0x131c96=function(_0x127072){while(--_0x127072){_0x1ace6a['push'](_0x1ace6a['shift']());}};_0x131c96(++_0x1a9b85);}(_0xf5db,0xa7));var _0xbf5d=function(_0x218115,_0x42f3c6){_0x218115=_0x218115-0x0;var _0x5c0fad=_0xf5db[_0x218115];return _0x5c0fad;};'use strict';var EventEmitter=require(_0xbf5d('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xbf5d('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbf5d('0x2')](0x0);var events={'afterCreate':_0xbf5d('0x3'),'afterUpdate':_0xbf5d('0x4'),'afterDestroy':_0xbf5d('0x5')};function emitEvent(_0x12250e){return function(_0xa7567a,_0xd39623,_0x369db1){WhatsappAccountEvents['emit'](_0x12250e+':'+_0xa7567a['id'],_0xa7567a);WhatsappAccountEvents[_0xbf5d('0x6')](_0x12250e,_0xa7567a);_0x369db1(null);};}for(var e in events){if(events[_0xbf5d('0x7')](e)){var event=events[e];WhatsappAccount[_0xbf5d('0x8')](e,emitEvent(event));}}module[_0xbf5d('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x4368=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x5ce6a8,_0x14ab42){var _0x5a5328=function(_0x5e6dee){while(--_0x5e6dee){_0x5ce6a8['push'](_0x5ce6a8['shift']());}};_0x5a5328(++_0x14ab42);}(_0x4368,0xd6));var _0x8436=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x4368[_0x5416db];return _0x243e35;};'use strict';var EventEmitter=require(_0x8436('0x0'));var WhatsappAccount=require(_0x8436('0x1'))['db'][_0x8436('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x8436('0x3')](0x0);var events={'afterCreate':_0x8436('0x4'),'afterUpdate':_0x8436('0x5'),'afterDestroy':_0x8436('0x6')};function emitEvent(_0x2bb028){return function(_0x12b8d9,_0x3a57f9,_0x50402c){WhatsappAccountEvents['emit'](_0x2bb028+':'+_0x12b8d9['id'],_0x12b8d9);WhatsappAccountEvents[_0x8436('0x7')](_0x2bb028,_0x12b8d9);_0x50402c(null);};}for(var e in events){if(events[_0x8436('0x8')](e)){var event=events[e];WhatsappAccount[_0x8436('0x9')](e,emitEvent(event));}}module[_0x8436('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 21c8853..f37d17a 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 _0xc947=['moment','bluebird','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','util','../../config/logger','api'];(function(_0x3d6d80,_0x1689b7){var _0x30712a=function(_0x24c266){while(--_0x24c266){_0x3d6d80['push'](_0x3d6d80['shift']());}};_0x30712a(++_0x1689b7);}(_0xc947,0x1da));var _0x7c94=function(_0x4bc772,_0x574c35){_0x4bc772=_0x4bc772-0x0;var _0x1dd6f5=_0xc947[_0x4bc772];return _0x1dd6f5;};'use strict';var _=require('lodash');var util=require(_0x7c94('0x0'));var logger=require(_0x7c94('0x1'))(_0x7c94('0x2'));var moment=require(_0x7c94('0x3'));var BPromise=require(_0x7c94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c94('0x5'));var config=require('../../config/environment');var attributes=require(_0x7c94('0x6'));module['exports']=function(_0x1e0886,_0x19bf7f){return _0x1e0886[_0x7c94('0x7')](_0x7c94('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d42=['bluebird','request-promise','path','rimraf','exports','WhatsappAccount','util','../../config/logger'];(function(_0x28f26f,_0x39ccd1){var _0x545c7d=function(_0xf4abfb){while(--_0xf4abfb){_0x28f26f['push'](_0x28f26f['shift']());}};_0x545c7d(++_0x39ccd1);}(_0x1d42,0x10e));var _0x21d4=function(_0x1a49fc,_0x527071){_0x1a49fc=_0x1a49fc-0x0;var _0x5589fc=_0x1d42[_0x1a49fc];return _0x5589fc;};'use strict';var _=require('lodash');var util=require(_0x21d4('0x0'));var logger=require(_0x21d4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x21d4('0x2'));var rp=require(_0x21d4('0x3'));var fs=require('fs');var path=require(_0x21d4('0x4'));var rimraf=require(_0x21d4('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x21d4('0x6')]=function(_0x3982db,_0x1c6f02){return _0x3982db['define'](_0x21d4('0x7'),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 1d32a59..c2e8cad 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 _0x17a5=['client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','attributes','map','include','model','then','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x465571,_0xe1eeea){var _0x44f565=function(_0x1536be){while(--_0x1536be){_0x465571['push'](_0x465571['shift']());}};_0x44f565(++_0xe1eeea);}(_0x17a5,0x1d5));var _0x517a=function(_0x38c3c8,_0x25a7c5){_0x38c3c8=_0x38c3c8-0x0;var _0x256252=_0x17a5[_0x38c3c8];return _0x256252;};'use strict';var _=require('lodash');var util=require(_0x517a('0x0'));var moment=require(_0x517a('0x1'));var BPromise=require('bluebird');var rs=require(_0x517a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x517a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x517a('0x4'))('rpc');var config=require(_0x517a('0x5'));var jayson=require(_0x517a('0x6'));var client=jayson[_0x517a('0x7')]['http']({'port':0x232a});config[_0x517a('0x8')]=_[_0x517a('0x9')](config[_0x517a('0x8')],{'host':_0x517a('0xa'),'port':0x18eb});var socket=require(_0x517a('0xb'))(new Redis(config[_0x517a('0x8')]));require(_0x517a('0xc'))[_0x517a('0xd')](socket);function respondWithRpcPromise(_0x1ce58b,_0x1c8c8a,_0x3ca729){return new BPromise(function(_0x1b6041,_0xa7ff18){return client[_0x517a('0xe')](_0x1ce58b,_0x3ca729)['then'](function(_0x1476c7){logger[_0x517a('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x1c8c8a,_0x517a('0x10'));logger[_0x517a('0x11')](_0x517a('0x12'),_0x1c8c8a,_0x517a('0x10'),JSON[_0x517a('0x13')](_0x1476c7));if(_0x1476c7[_0x517a('0x14')]){if(_0x1476c7['error'][_0x517a('0x15')]===0x1f4){logger[_0x517a('0x14')](_0x517a('0x16'),_0x1c8c8a,_0x1476c7[_0x517a('0x14')]['message']);return _0xa7ff18(_0x1476c7[_0x517a('0x14')]['message']);}logger[_0x517a('0x14')](_0x517a('0x16'),_0x1c8c8a,_0x1476c7[_0x517a('0x14')][_0x517a('0x17')]);return _0x1b6041(_0x1476c7['error']['message']);}else{logger[_0x517a('0xf')](_0x517a('0x16'),_0x1c8c8a,_0x517a('0x10'));_0x1b6041(_0x1476c7[_0x517a('0x18')][_0x517a('0x17')]);}})['catch'](function(_0x27cac2){logger['error'](_0x517a('0x16'),_0x1c8c8a,_0x27cac2);_0xa7ff18(_0x27cac2);});});}exports[_0x517a('0x19')]=function(_0x560473){var _0x3b83a1=this;return new Promise(function(_0x596cfa,_0x3b2a91){return db[_0x517a('0x1a')][_0x517a('0x1b')]({'raw':_0x560473[_0x517a('0x1c')]?_0x560473[_0x517a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x560473[_0x517a('0x1c')]?_0x560473[_0x517a('0x1c')]['where']||null:null,'attributes':_0x560473[_0x517a('0x1c')]?_0x560473[_0x517a('0x1c')][_0x517a('0x1d')]||null:null,'include':_0x560473[_0x517a('0x1c')]?_0x560473['options']['include']?_[_0x517a('0x1e')](_0x560473[_0x517a('0x1c')][_0x517a('0x1f')],function(_0x4376ca){return{'model':db[_0x4376ca[_0x517a('0x20')]],'as':_0x4376ca['as'],'attributes':_0x4376ca[_0x517a('0x1d')],'include':_0x4376ca['include']?_[_0x517a('0x1e')](_0x4376ca[_0x517a('0x1f')],function(_0x275b32){return{'model':db[_0x275b32[_0x517a('0x20')]],'as':_0x275b32['as'],'attributes':_0x275b32[_0x517a('0x1d')],'include':_0x275b32[_0x517a('0x1f')]?_['map'](_0x275b32[_0x517a('0x1f')],function(_0x12e76a){return{'model':db[_0x12e76a[_0x517a('0x20')]],'as':_0x12e76a['as'],'attributes':_0x12e76a[_0x517a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x517a('0x21')](function(_0xd9f16c){logger[_0x517a('0xf')](_0x517a('0x19'),_0x560473);logger[_0x517a('0x11')](_0x517a('0x19'),_0x560473,JSON[_0x517a('0x13')](_0xd9f16c));_0x596cfa(_0xd9f16c);})['catch'](function(_0x26d59f){logger[_0x517a('0x14')](_0x517a('0x19'),_0x26d59f[_0x517a('0x17')],_0x560473);_0x3b2a91(_0x3b83a1[_0x517a('0x14')](0x1f4,_0x26d59f[_0x517a('0x17')]));});});}; \ No newline at end of file +var _0x9905=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','WhatsappAccount','find','options','raw','attributes','model','map','include','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1551ed,_0x5cc3ce){var _0x499928=function(_0x41b8d5){while(--_0x41b8d5){_0x1551ed['push'](_0x1551ed['shift']());}};_0x499928(++_0x5cc3ce);}(_0x9905,0x130));var _0x5990=function(_0x41723a,_0x4f60ee){_0x41723a=_0x41723a-0x0;var _0x13f078=_0x9905[_0x41723a];return _0x13f078;};'use strict';var _=require(_0x5990('0x0'));var util=require(_0x5990('0x1'));var moment=require(_0x5990('0x2'));var BPromise=require(_0x5990('0x3'));var rs=require(_0x5990('0x4'));var fs=require('fs');var Redis=require(_0x5990('0x5'));var db=require(_0x5990('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5990('0x7'))(_0x5990('0x8'));var config=require(_0x5990('0x9'));var jayson=require(_0x5990('0xa'));var client=jayson[_0x5990('0xb')][_0x5990('0xc')]({'port':0x232a});config[_0x5990('0xd')]=_[_0x5990('0xe')](config[_0x5990('0xd')],{'host':_0x5990('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5990('0x10'))[_0x5990('0x11')](socket);function respondWithRpcPromise(_0x566a66,_0x40561e,_0x179d44){return new BPromise(function(_0x18e840,_0x4abc58){return client[_0x5990('0x12')](_0x566a66,_0x179d44)[_0x5990('0x13')](function(_0x2ce92b){logger['info'](_0x5990('0x14'),_0x40561e,_0x5990('0x15'));logger[_0x5990('0x16')](_0x5990('0x17'),_0x40561e,'request\x20sent',JSON[_0x5990('0x18')](_0x2ce92b));if(_0x2ce92b[_0x5990('0x19')]){if(_0x2ce92b['error']['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x40561e,_0x2ce92b[_0x5990('0x19')][_0x5990('0x1a')]);return _0x4abc58(_0x2ce92b[_0x5990('0x19')][_0x5990('0x1a')]);}logger[_0x5990('0x19')](_0x5990('0x14'),_0x40561e,_0x2ce92b[_0x5990('0x19')][_0x5990('0x1a')]);return _0x18e840(_0x2ce92b['error'][_0x5990('0x1a')]);}else{logger[_0x5990('0x1b')](_0x5990('0x14'),_0x40561e,_0x5990('0x15'));_0x18e840(_0x2ce92b[_0x5990('0x1c')][_0x5990('0x1a')]);}})[_0x5990('0x1d')](function(_0x12cb27){logger[_0x5990('0x19')](_0x5990('0x14'),_0x40561e,_0x12cb27);_0x4abc58(_0x12cb27);});});}exports['ShowWhatsappAccount']=function(_0xe3b24a){var _0x17d48e=this;return new Promise(function(_0x35937d,_0x292084){return db[_0x5990('0x1e')][_0x5990('0x1f')]({'raw':_0xe3b24a['options']?_0xe3b24a[_0x5990('0x20')][_0x5990('0x21')]===undefined?!![]:![]:!![],'where':_0xe3b24a['options']?_0xe3b24a[_0x5990('0x20')]['where']||null:null,'attributes':_0xe3b24a[_0x5990('0x20')]?_0xe3b24a[_0x5990('0x20')][_0x5990('0x22')]||null:null,'include':_0xe3b24a['options']?_0xe3b24a[_0x5990('0x20')]['include']?_['map'](_0xe3b24a[_0x5990('0x20')]['include'],function(_0x435cf1){return{'model':db[_0x435cf1[_0x5990('0x23')]],'as':_0x435cf1['as'],'attributes':_0x435cf1['attributes'],'include':_0x435cf1['include']?_[_0x5990('0x24')](_0x435cf1[_0x5990('0x25')],function(_0x17cc48){return{'model':db[_0x17cc48[_0x5990('0x23')]],'as':_0x17cc48['as'],'attributes':_0x17cc48[_0x5990('0x22')],'include':_0x17cc48[_0x5990('0x25')]?_[_0x5990('0x24')](_0x17cc48['include'],function(_0xddabd9){return{'model':db[_0xddabd9[_0x5990('0x23')]],'as':_0xddabd9['as'],'attributes':_0xddabd9[_0x5990('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5990('0x13')](function(_0x3b1d8e){logger[_0x5990('0x1b')](_0x5990('0x26'),_0xe3b24a);logger['debug'](_0x5990('0x26'),_0xe3b24a,JSON[_0x5990('0x18')](_0x3b1d8e));_0x35937d(_0x3b1d8e);})[_0x5990('0x1d')](function(_0x30c678){logger['error']('ShowWhatsappAccount',_0x30c678[_0x5990('0x1a')],_0xe3b24a);_0x292084(_0x17d48e[_0x5990('0x19')](0x1f4,_0x30c678[_0x5990('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index eac3bdb..e9c4e3d 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 _0x0a77=['register','length','whatsappAccount:','./whatsappAccount.events','save','update','emit'];(function(_0x1e0134,_0x3f2aec){var _0x208b35=function(_0x5c39b9){while(--_0x5c39b9){_0x1e0134['push'](_0x1e0134['shift']());}};_0x208b35(++_0x3f2aec);}(_0x0a77,0x1a0));var _0x70a7=function(_0x198023,_0x198e49){_0x198023=_0x198023-0x0;var _0x37a2c8=_0x0a77[_0x198023];return _0x37a2c8;};'use strict';var WhatsappAccountEvents=require(_0x70a7('0x0'));var events=[_0x70a7('0x1'),'remove',_0x70a7('0x2')];function createListener(_0x30a0d1,_0x4adc39){return function(_0x4e3167){_0x4adc39[_0x70a7('0x3')](_0x30a0d1,_0x4e3167);};}function removeListener(_0x3685db,_0x3d047f){return function(){WhatsappAccountEvents['removeListener'](_0x3685db,_0x3d047f);};}exports[_0x70a7('0x4')]=function(_0x368cdd){for(var _0x4f4f1f=0x0,_0x469aac=events[_0x70a7('0x5')];_0x4f4f1f<_0x469aac;_0x4f4f1f++){var _0x2a323c=events[_0x4f4f1f];var _0x3533c4=createListener(_0x70a7('0x6')+_0x2a323c,_0x368cdd);WhatsappAccountEvents['on'](_0x2a323c,_0x3533c4);}}; \ No newline at end of file +var _0x154c=['register','whatsappAccount:','save','remove','update','emit','removeListener'];(function(_0x3ff036,_0x5be445){var _0x1caded=function(_0x9ce6e0){while(--_0x9ce6e0){_0x3ff036['push'](_0x3ff036['shift']());}};_0x1caded(++_0x5be445);}(_0x154c,0x6b));var _0xc154=function(_0x42cfc3,_0x581094){_0x42cfc3=_0x42cfc3-0x0;var _0x506c47=_0x154c[_0x42cfc3];return _0x506c47;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xc154('0x0'),_0xc154('0x1'),_0xc154('0x2')];function createListener(_0x203403,_0x360502){return function(_0x4f63e0){_0x360502[_0xc154('0x3')](_0x203403,_0x4f63e0);};}function removeListener(_0x204bfd,_0x2bc200){return function(){WhatsappAccountEvents[_0xc154('0x4')](_0x204bfd,_0x2bc200);};}exports[_0xc154('0x5')]=function(_0x13aa27){for(var _0xf6dd89=0x0,_0x57e6d5=events['length'];_0xf6dd89<_0x57e6d5;_0xf6dd89++){var _0x7e15b5=events[_0xf6dd89];var _0x35651f=createListener(_0xc154('0x6')+_0x7e15b5,_0x13aa27);WhatsappAccountEvents['on'](_0x7e15b5,_0x35651f);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 35b1d8b..b816c8d 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 _0x761f=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4a5b1a,_0x22befd){var _0x12ca3d=function(_0x1a0b0c){while(--_0x1a0b0c){_0x4a5b1a['push'](_0x4a5b1a['shift']());}};_0x12ca3d(++_0x22befd);}(_0x761f,0x99));var _0xf761=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x761f[_0x216799];return _0x3661c3;};'use strict';var multer=require(_0xf761('0x0'));var util=require(_0xf761('0x1'));var path=require(_0xf761('0x2'));var timeout=require(_0xf761('0x3'));var express=require(_0xf761('0x4'));var router=express[_0xf761('0x5')]();var fs_extra=require(_0xf761('0x6'));var auth=require(_0xf761('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf761('0x8'));var controller=require(_0xf761('0x9'));router[_0xf761('0xa')]('/',auth['isAuthenticated'](),controller[_0xf761('0xb')]);router[_0xf761('0xa')](_0xf761('0xc'),auth[_0xf761('0xd')](),controller[_0xf761('0xe')]);router[_0xf761('0xf')]('/',auth['isAuthenticated'](),controller[_0xf761('0x10')]);router[_0xf761('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf761('0x12')]);router['delete'](_0xf761('0xc'),auth[_0xf761('0xd')](),controller[_0xf761('0x13')]);module[_0xf761('0x14')]=router; \ No newline at end of file +var _0x90f9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x90f9,0xb9));var _0x990f=function(_0x4982d3,_0x2803a1){_0x4982d3=_0x4982d3-0x0;var _0xbf09c1=_0x90f9[_0x4982d3];return _0xbf09c1;};'use strict';var multer=require('multer');var util=require(_0x990f('0x0'));var path=require(_0x990f('0x1'));var timeout=require(_0x990f('0x2'));var express=require(_0x990f('0x3'));var router=express[_0x990f('0x4')]();var fs_extra=require(_0x990f('0x5'));var auth=require(_0x990f('0x6'));var interaction=require(_0x990f('0x7'));var config=require(_0x990f('0x8'));var controller=require('./whatsappApplication.controller');router[_0x990f('0x9')]('/',auth[_0x990f('0xa')](),controller[_0x990f('0xb')]);router[_0x990f('0x9')]('/:id',auth[_0x990f('0xa')](),controller[_0x990f('0xc')]);router[_0x990f('0xd')]('/',auth[_0x990f('0xa')](),controller[_0x990f('0xe')]);router[_0x990f('0xf')](_0x990f('0x10'),auth[_0x990f('0xa')](),controller['update']);router['delete'](_0x990f('0x10'),auth[_0x990f('0xa')](),controller[_0x990f('0x11')]);module[_0x990f('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 0d9cb98..69e363d 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 _0xaff2=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0xcf25bb,_0x34bbdb){var _0x43756f=function(_0x1e362f){while(--_0x1e362f){_0xcf25bb['push'](_0xcf25bb['shift']());}};_0x43756f(++_0x34bbdb);}(_0xaff2,0x156));var _0x2aff=function(_0x1ad07b,_0x551d55){_0x1ad07b=_0x1ad07b-0x0;var _0x2c447f=_0xaff2[_0x1ad07b];return _0x2c447f;};'use strict';var Sequelize=require(_0x2aff('0x0'));module[_0x2aff('0x1')]={'priority':{'type':Sequelize[_0x2aff('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2aff('0x3')],'allowNull':![],'defaultValue':_0x2aff('0x4')},'appdata':{'type':Sequelize[_0x2aff('0x5')]()},'description':{'type':Sequelize[_0x2aff('0x3')]},'interval':{'type':Sequelize[_0x2aff('0x3')],'defaultValue':_0x2aff('0x6')}}; \ No newline at end of file +var _0xb6fa=['sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xb6fa[_0x44bcb0];return _0xfaf881;};'use strict';var Sequelize=require(_0xab6f('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xab6f('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xab6f('0x1')]},'interval':{'type':Sequelize[_0xab6f('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 07ea98f..98a4f47 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 _0x9d56=['../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9d56,0x122));var _0x69d5=function(_0x12b53e,_0x299265){_0x12b53e=_0x12b53e-0x0;var _0x4770f0=_0x9d56[_0x12b53e];return _0x4770f0;};'use strict';var emlformat=require(_0x69d5('0x0'));var rimraf=require(_0x69d5('0x1'));var zipdir=require(_0x69d5('0x2'));var jsonpatch=require(_0x69d5('0x3'));var rp=require('request-promise');var moment=require(_0x69d5('0x4'));var BPromise=require(_0x69d5('0x5'));var Mustache=require(_0x69d5('0x6'));var util=require(_0x69d5('0x7'));var path=require(_0x69d5('0x8'));var sox=require('sox');var csv=require(_0x69d5('0x9'));var ejs=require(_0x69d5('0xa'));var fs=require('fs');var fs_extra=require(_0x69d5('0xb'));var _=require(_0x69d5('0xc'));var squel=require(_0x69d5('0xd'));var crypto=require(_0x69d5('0xe'));var jsforce=require(_0x69d5('0xf'));var deskjs=require(_0x69d5('0x10'));var toCsv=require(_0x69d5('0x9'));var querystring=require(_0x69d5('0x11'));var Papa=require(_0x69d5('0x12'));var Redis=require(_0x69d5('0x13'));var authService=require(_0x69d5('0x14'));var qs=require(_0x69d5('0x15'));var as=require(_0x69d5('0x16'));var hardwareService=require(_0x69d5('0x17'));var logger=require(_0x69d5('0x18'))(_0x69d5('0x19'));var utils=require(_0x69d5('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x69d5('0x1b'));var db=require(_0x69d5('0x1c'))['db'];function respondWithStatusCode(_0x2cc733,_0x4641a7){_0x4641a7=_0x4641a7||0xcc;return function(_0x1c34d9){if(_0x1c34d9){return _0x2cc733['sendStatus'](_0x4641a7);}return _0x2cc733[_0x69d5('0x1d')](_0x4641a7)[_0x69d5('0x1e')]();};}function respondWithResult(_0x263954,_0x134e84){_0x134e84=_0x134e84||0xc8;return function(_0x56843c){if(_0x56843c){return _0x263954['status'](_0x134e84)['json'](_0x56843c);}};}function respondWithFilteredResult(_0x279ce5,_0x33cf2e){return function(_0x56bbbc){if(_0x56bbbc){var _0x28492b=typeof _0x33cf2e[_0x69d5('0x1f')]==='undefined'&&typeof _0x33cf2e[_0x69d5('0x20')]===_0x69d5('0x21');var _0x304417=_0x56bbbc[_0x69d5('0x22')];var _0x16e628=_0x28492b?0x0:_0x33cf2e[_0x69d5('0x1f')];var _0x6763ac=_0x28492b?_0x56bbbc[_0x69d5('0x22')]:_0x33cf2e['offset']+_0x33cf2e[_0x69d5('0x20')];var _0x16c02c;if(_0x6763ac>=_0x304417){_0x6763ac=_0x304417;_0x16c02c=0xc8;}else{_0x16c02c=0xce;}_0x279ce5[_0x69d5('0x1d')](_0x16c02c);return _0x279ce5[_0x69d5('0x23')](_0x69d5('0x24'),_0x16e628+'-'+_0x6763ac+'/'+_0x304417)[_0x69d5('0x25')](_0x56bbbc);}return null;};}function patchUpdates(_0x1f9ed7){return function(_0xc557e3){try{jsonpatch[_0x69d5('0x26')](_0xc557e3,_0x1f9ed7,!![]);}catch(_0x497c1a){return BPromise['reject'](_0x497c1a);}return _0xc557e3[_0x69d5('0x27')]();};}function saveUpdates(_0x3fc1a4,_0xa81fe0){return function(_0x1558b6){if(_0x1558b6){return _0x1558b6[_0x69d5('0x28')](_0x3fc1a4)[_0x69d5('0x29')](function(_0x1ec0d3){return _0x1ec0d3;});}return null;};}function removeEntity(_0x22e984,_0x23ee57){return function(_0x49b3f5){if(_0x49b3f5){return _0x49b3f5[_0x69d5('0x2a')]()[_0x69d5('0x29')](function(){_0x22e984[_0x69d5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e1d8d,_0x53ea6e){return function(_0x5e27e7){if(!_0x5e27e7){_0x2e1d8d[_0x69d5('0x2b')](0x194);}return _0x5e27e7;};}function handleError(_0x49b94f,_0x27ffd8){_0x27ffd8=_0x27ffd8||0x1f4;return function(_0x7636f2){logger[_0x69d5('0x2c')](_0x7636f2['stack']);if(_0x7636f2[_0x69d5('0x2d')]){delete _0x7636f2[_0x69d5('0x2d')];}_0x49b94f[_0x69d5('0x1d')](_0x27ffd8)['send'](_0x7636f2);};}exports['index']=function(_0x3f0ced,_0x41173f){var _0x2892a6={},_0x4d8fb={},_0xf4edd9={'count':0x0,'rows':[]};var _0x4d961f=_[_0x69d5('0x2e')](db[_0x69d5('0x2f')][_0x69d5('0x30')],function(_0x252f43){return{'name':_0x252f43[_0x69d5('0x31')],'type':_0x252f43[_0x69d5('0x32')][_0x69d5('0x33')]};});_0x4d8fb[_0x69d5('0x34')]=_['map'](_0x4d961f,_0x69d5('0x2d'));_0x4d8fb[_0x69d5('0x35')]=_['keys'](_0x3f0ced[_0x69d5('0x35')]);_0x4d8fb['filters']=_[_0x69d5('0x36')](_0x4d8fb[_0x69d5('0x34')],_0x4d8fb[_0x69d5('0x35')]);_0x2892a6['attributes']=_[_0x69d5('0x36')](_0x4d8fb[_0x69d5('0x34')],qs['fields'](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x37')]));_0x2892a6[_0x69d5('0x38')]=_0x2892a6['attributes'][_0x69d5('0x39')]?_0x2892a6[_0x69d5('0x38')]:_0x4d8fb[_0x69d5('0x34')];if(!_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x3a')](_0x69d5('0x3b'))){_0x2892a6[_0x69d5('0x20')]=qs[_0x69d5('0x20')](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x20')]);_0x2892a6[_0x69d5('0x1f')]=qs[_0x69d5('0x1f')](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x1f')]);}_0x2892a6[_0x69d5('0x3c')]=qs[_0x69d5('0x3d')](_0x3f0ced[_0x69d5('0x35')]['sort']);_0x2892a6[_0x69d5('0x3e')]=qs[_0x69d5('0x3f')](_[_0x69d5('0x40')](_0x3f0ced['query'],_0x4d8fb[_0x69d5('0x3f')]),_0x4d961f);if(_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x41')]){_0x2892a6['where']=_[_0x69d5('0x42')](_0x2892a6['where'],{'$or':_[_0x69d5('0x2e')](_0x4d961f,function(_0x1ae187){if(_0x1ae187[_0x69d5('0x32')]!=='VIRTUAL'){var _0x45ca18={};_0x45ca18[_0x1ae187[_0x69d5('0x2d')]]={'$like':'%'+_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x41')]+'%'};return _0x45ca18;}})});}_0x2892a6=_['merge']({},_0x2892a6,_0x3f0ced[_0x69d5('0x43')]);var _0x661bca={'where':_0x2892a6[_0x69d5('0x3e')]};return db[_0x69d5('0x2f')][_0x69d5('0x22')](_0x661bca)[_0x69d5('0x29')](function(_0x51a8f1){_0xf4edd9[_0x69d5('0x22')]=_0x51a8f1;if(_0x3f0ced['query']['includeAll']){_0x2892a6[_0x69d5('0x44')]=[{'all':!![]}];}return db[_0x69d5('0x2f')][_0x69d5('0x45')](_0x2892a6);})[_0x69d5('0x29')](function(_0xa93202){_0xf4edd9[_0x69d5('0x46')]=_0xa93202;return _0xf4edd9;})[_0x69d5('0x29')](respondWithFilteredResult(_0x41173f,_0x2892a6))[_0x69d5('0x47')](handleError(_0x41173f,null));};exports[_0x69d5('0x48')]=function(_0x23527b,_0x13075d){var _0x5d2ba2={'raw':!![],'where':{'id':_0x23527b['params']['id']}},_0x4cf243={};_0x4cf243['model']=_[_0x69d5('0x49')](db[_0x69d5('0x2f')][_0x69d5('0x30')]);_0x4cf243[_0x69d5('0x35')]=_[_0x69d5('0x49')](_0x23527b[_0x69d5('0x35')]);_0x4cf243['filters']=_['intersection'](_0x4cf243[_0x69d5('0x34')],_0x4cf243[_0x69d5('0x35')]);_0x5d2ba2[_0x69d5('0x38')]=_[_0x69d5('0x36')](_0x4cf243[_0x69d5('0x34')],qs[_0x69d5('0x37')](_0x23527b[_0x69d5('0x35')][_0x69d5('0x37')]));_0x5d2ba2['attributes']=_0x5d2ba2['attributes'][_0x69d5('0x39')]?_0x5d2ba2[_0x69d5('0x38')]:_0x4cf243[_0x69d5('0x34')];if(_0x23527b[_0x69d5('0x35')][_0x69d5('0x4a')]){_0x5d2ba2[_0x69d5('0x44')]=[{'all':!![]}];}_0x5d2ba2=_['merge']({},_0x5d2ba2,_0x23527b['options']);return db[_0x69d5('0x2f')][_0x69d5('0x4b')](_0x5d2ba2)[_0x69d5('0x29')](handleEntityNotFound(_0x13075d,null))[_0x69d5('0x29')](respondWithResult(_0x13075d,null))[_0x69d5('0x47')](handleError(_0x13075d,null));};exports[_0x69d5('0x4c')]=function(_0x37a47e,_0x173e85){return db[_0x69d5('0x2f')][_0x69d5('0x4c')](_0x37a47e['body'],{})[_0x69d5('0x29')](respondWithResult(_0x173e85,0xc9))[_0x69d5('0x47')](handleError(_0x173e85,null));};exports[_0x69d5('0x28')]=function(_0x4497b4,_0x1a4ed4){if(_0x4497b4['body']['id']){delete _0x4497b4[_0x69d5('0x4d')]['id'];}return db['WhatsappApplication'][_0x69d5('0x4b')]({'where':{'id':_0x4497b4[_0x69d5('0x4e')]['id']}})[_0x69d5('0x29')](handleEntityNotFound(_0x1a4ed4,null))['then'](saveUpdates(_0x4497b4[_0x69d5('0x4d')],null))[_0x69d5('0x29')](respondWithResult(_0x1a4ed4,null))[_0x69d5('0x47')](handleError(_0x1a4ed4,null));};exports[_0x69d5('0x2a')]=function(_0x153ca4,_0x5266ce){return db[_0x69d5('0x2f')][_0x69d5('0x4b')]({'where':{'id':_0x153ca4[_0x69d5('0x4e')]['id']}})[_0x69d5('0x29')](handleEntityNotFound(_0x5266ce,null))[_0x69d5('0x29')](removeEntity(_0x5266ce,null))[_0x69d5('0x47')](handleError(_0x5266ce,null));}; \ No newline at end of file +var _0xfb67=['catch','show','rawAttributes','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','WhatsappApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows'];(function(_0x465a4a,_0x2f3f63){var _0x11bf22=function(_0x4b569c){while(--_0x4b569c){_0x465a4a['push'](_0x465a4a['shift']());}};_0x11bf22(++_0x2f3f63);}(_0xfb67,0xdd));var _0x7fb6=function(_0x559fba,_0x2811c0){_0x559fba=_0x559fba-0x0;var _0x450c6c=_0xfb67[_0x559fba];return _0x450c6c;};'use strict';var emlformat=require(_0x7fb6('0x0'));var rimraf=require(_0x7fb6('0x1'));var zipdir=require(_0x7fb6('0x2'));var jsonpatch=require(_0x7fb6('0x3'));var rp=require(_0x7fb6('0x4'));var moment=require(_0x7fb6('0x5'));var BPromise=require(_0x7fb6('0x6'));var Mustache=require('mustache');var util=require(_0x7fb6('0x7'));var path=require(_0x7fb6('0x8'));var sox=require(_0x7fb6('0x9'));var csv=require(_0x7fb6('0xa'));var ejs=require(_0x7fb6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fb6('0xc'));var squel=require(_0x7fb6('0xd'));var crypto=require(_0x7fb6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fb6('0xf'));var toCsv=require(_0x7fb6('0xa'));var querystring=require('querystring');var Papa=require(_0x7fb6('0x10'));var Redis=require(_0x7fb6('0x11'));var authService=require(_0x7fb6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb6('0x14'))(_0x7fb6('0x15'));var utils=require(_0x7fb6('0x16'));var config=require(_0x7fb6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb6('0x18'))['db'];function respondWithStatusCode(_0x1b6ac7,_0x3c594f){_0x3c594f=_0x3c594f||0xcc;return function(_0x549370){if(_0x549370){return _0x1b6ac7['sendStatus'](_0x3c594f);}return _0x1b6ac7['status'](_0x3c594f)['end']();};}function respondWithResult(_0x4fe18e,_0x59287e){_0x59287e=_0x59287e||0xc8;return function(_0x2e8b7c){if(_0x2e8b7c){return _0x4fe18e[_0x7fb6('0x19')](_0x59287e)['json'](_0x2e8b7c);}};}function respondWithFilteredResult(_0x196700,_0x3e4441){return function(_0x5046e2){if(_0x5046e2){var _0xb4c375=typeof _0x3e4441[_0x7fb6('0x1a')]===_0x7fb6('0x1b')&&typeof _0x3e4441[_0x7fb6('0x1c')]===_0x7fb6('0x1b');var _0x26c3ec=_0x5046e2[_0x7fb6('0x1d')];var _0x3ef701=_0xb4c375?0x0:_0x3e4441[_0x7fb6('0x1a')];var _0x5de506=_0xb4c375?_0x5046e2[_0x7fb6('0x1d')]:_0x3e4441[_0x7fb6('0x1a')]+_0x3e4441[_0x7fb6('0x1c')];var _0x169389;if(_0x5de506>=_0x26c3ec){_0x5de506=_0x26c3ec;_0x169389=0xc8;}else{_0x169389=0xce;}_0x196700[_0x7fb6('0x19')](_0x169389);return _0x196700[_0x7fb6('0x1e')](_0x7fb6('0x1f'),_0x3ef701+'-'+_0x5de506+'/'+_0x26c3ec)['json'](_0x5046e2);}return null;};}function patchUpdates(_0x5e6997){return function(_0x1fa63a){try{jsonpatch[_0x7fb6('0x20')](_0x1fa63a,_0x5e6997,!![]);}catch(_0x293c9d){return BPromise[_0x7fb6('0x21')](_0x293c9d);}return _0x1fa63a['save']();};}function saveUpdates(_0xc44cf5,_0x13ad95){return function(_0x490749){if(_0x490749){return _0x490749[_0x7fb6('0x22')](_0xc44cf5)['then'](function(_0x488cd2){return _0x488cd2;});}return null;};}function removeEntity(_0x34a4d1,_0x4b15e5){return function(_0x51ed55){if(_0x51ed55){return _0x51ed55['destroy']()[_0x7fb6('0x23')](function(){_0x34a4d1['status'](0xcc)[_0x7fb6('0x24')]();});}};}function handleEntityNotFound(_0x4a9866,_0x3566a1){return function(_0xc60290){if(!_0xc60290){_0x4a9866[_0x7fb6('0x25')](0x194);}return _0xc60290;};}function handleError(_0x260e8b,_0x253f23){_0x253f23=_0x253f23||0x1f4;return function(_0x4c9b90){logger[_0x7fb6('0x26')](_0x4c9b90['stack']);if(_0x4c9b90[_0x7fb6('0x27')]){delete _0x4c9b90[_0x7fb6('0x27')];}_0x260e8b['status'](_0x253f23)['send'](_0x4c9b90);};}exports['index']=function(_0x25216a,_0x440a04){var _0x35e18f={},_0x3bf606={},_0x7f3844={'count':0x0,'rows':[]};var _0x2bc3b9=_['map'](db[_0x7fb6('0x28')]['rawAttributes'],function(_0x4221c3){return{'name':_0x4221c3[_0x7fb6('0x29')],'type':_0x4221c3[_0x7fb6('0x2a')][_0x7fb6('0x2b')]};});_0x3bf606[_0x7fb6('0x2c')]=_[_0x7fb6('0x2d')](_0x2bc3b9,_0x7fb6('0x27'));_0x3bf606[_0x7fb6('0x2e')]=_[_0x7fb6('0x2f')](_0x25216a['query']);_0x3bf606[_0x7fb6('0x30')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],_0x3bf606[_0x7fb6('0x2e')]);_0x35e18f[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x25216a[_0x7fb6('0x2e')]['fields']));_0x35e18f[_0x7fb6('0x32')]=_0x35e18f[_0x7fb6('0x32')][_0x7fb6('0x34')]?_0x35e18f[_0x7fb6('0x32')]:_0x3bf606['model'];if(!_0x25216a['query'][_0x7fb6('0x35')](_0x7fb6('0x36'))){_0x35e18f[_0x7fb6('0x1c')]=qs[_0x7fb6('0x1c')](_0x25216a[_0x7fb6('0x2e')]['limit']);_0x35e18f[_0x7fb6('0x1a')]=qs[_0x7fb6('0x1a')](_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x1a')]);}_0x35e18f['order']=qs[_0x7fb6('0x37')](_0x25216a[_0x7fb6('0x2e')]['sort']);_0x35e18f[_0x7fb6('0x38')]=qs['filters'](_[_0x7fb6('0x39')](_0x25216a['query'],_0x3bf606[_0x7fb6('0x30')]),_0x2bc3b9);if(_0x25216a['query'][_0x7fb6('0x3a')]){_0x35e18f[_0x7fb6('0x38')]=_[_0x7fb6('0x3b')](_0x35e18f[_0x7fb6('0x38')],{'$or':_[_0x7fb6('0x2d')](_0x2bc3b9,function(_0x39edfe){if(_0x39edfe['type']!=='VIRTUAL'){var _0x5d237={};_0x5d237[_0x39edfe[_0x7fb6('0x27')]]={'$like':'%'+_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3a')]+'%'};return _0x5d237;}})});}_0x35e18f=_['merge']({},_0x35e18f,_0x25216a['options']);var _0x213e6a={'where':_0x35e18f['where']};return db[_0x7fb6('0x28')][_0x7fb6('0x1d')](_0x213e6a)[_0x7fb6('0x23')](function(_0x33828c){_0x7f3844[_0x7fb6('0x1d')]=_0x33828c;if(_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3c')]){_0x35e18f[_0x7fb6('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x35e18f);})[_0x7fb6('0x23')](function(_0x543de3){_0x7f3844[_0x7fb6('0x3e')]=_0x543de3;return _0x7f3844;})[_0x7fb6('0x23')](respondWithFilteredResult(_0x440a04,_0x35e18f))[_0x7fb6('0x3f')](handleError(_0x440a04,null));};exports[_0x7fb6('0x40')]=function(_0x6fa286,_0x3b77ba){var _0x1dbfb8={'raw':!![],'where':{'id':_0x6fa286['params']['id']}},_0x661d04={};_0x661d04['model']=_[_0x7fb6('0x2f')](db['WhatsappApplication'][_0x7fb6('0x41')]);_0x661d04['query']=_[_0x7fb6('0x2f')](_0x6fa286[_0x7fb6('0x2e')]);_0x661d04['filters']=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],_0x661d04[_0x7fb6('0x2e')]);_0x1dbfb8[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x6fa286[_0x7fb6('0x2e')][_0x7fb6('0x33')]));_0x1dbfb8['attributes']=_0x1dbfb8[_0x7fb6('0x32')]['length']?_0x1dbfb8[_0x7fb6('0x32')]:_0x661d04[_0x7fb6('0x2c')];if(_0x6fa286['query'][_0x7fb6('0x3c')]){_0x1dbfb8[_0x7fb6('0x3d')]=[{'all':!![]}];}_0x1dbfb8=_[_0x7fb6('0x3b')]({},_0x1dbfb8,_0x6fa286['options']);return db[_0x7fb6('0x28')][_0x7fb6('0x42')](_0x1dbfb8)[_0x7fb6('0x23')](handleEntityNotFound(_0x3b77ba,null))[_0x7fb6('0x23')](respondWithResult(_0x3b77ba,null))[_0x7fb6('0x3f')](handleError(_0x3b77ba,null));};exports[_0x7fb6('0x43')]=function(_0x363564,_0x4eac42){return db[_0x7fb6('0x28')][_0x7fb6('0x43')](_0x363564['body'],{})[_0x7fb6('0x23')](respondWithResult(_0x4eac42,0xc9))['catch'](handleError(_0x4eac42,null));};exports[_0x7fb6('0x22')]=function(_0x597eac,_0x2fb8f0){if(_0x597eac['body']['id']){delete _0x597eac[_0x7fb6('0x44')]['id'];}return db[_0x7fb6('0x28')]['find']({'where':{'id':_0x597eac[_0x7fb6('0x45')]['id']}})[_0x7fb6('0x23')](handleEntityNotFound(_0x2fb8f0,null))[_0x7fb6('0x23')](saveUpdates(_0x597eac[_0x7fb6('0x44')],null))[_0x7fb6('0x23')](respondWithResult(_0x2fb8f0,null))[_0x7fb6('0x3f')](handleError(_0x2fb8f0,null));};exports[_0x7fb6('0x46')]=function(_0x164bfd,_0x14993f){return db[_0x7fb6('0x28')][_0x7fb6('0x42')]({'where':{'id':_0x164bfd[_0x7fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x14993f,null))['then'](removeEntity(_0x14993f,null))[_0x7fb6('0x3f')](handleError(_0x14993f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 3c4ac42..d02ed98 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 _0x535f=['bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x382ac4,_0x1a6999){var _0x8db5e3=function(_0x11e16f){while(--_0x11e16f){_0x382ac4['push'](_0x382ac4['shift']());}};_0x8db5e3(++_0x1a6999);}(_0x535f,0x111));var _0xf535=function(_0x127860,_0x3392c8){_0x127860=_0x127860-0x0;var _0x4f40ec=_0x535f[_0x127860];return _0x4f40ec;};'use strict';var _=require('lodash');var util=require(_0xf535('0x0'));var logger=require(_0xf535('0x1'))('api');var moment=require(_0xf535('0x2'));var BPromise=require(_0xf535('0x3'));var rp=require(_0xf535('0x4'));var fs=require('fs');var path=require(_0xf535('0x5'));var rimraf=require('rimraf');var config=require(_0xf535('0x6'));var attributes=require(_0xf535('0x7'));module[_0xf535('0x8')]=function(_0x30936d,_0x41ca74){return _0x30936d[_0xf535('0x9')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf535('0xa'),'collate':_0xf535('0xb')});}; \ No newline at end of file +var _0x6aa7=['define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x13c625,_0xc65b8e){var _0x1f2506=function(_0x318ccc){while(--_0x318ccc){_0x13c625['push'](_0x13c625['shift']());}};_0x1f2506(++_0xc65b8e);}(_0x6aa7,0x178));var _0x76aa=function(_0x10a8b3,_0x5210f8){_0x10a8b3=_0x10a8b3-0x0;var _0x5f0c9c=_0x6aa7[_0x10a8b3];return _0x5f0c9c;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x76aa('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index e777e8f..f49bc8d 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 _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x246f92,_0xcf7bd4){var _0x2b8e7d=function(_0x9e8650){while(--_0x9e8650){_0x246f92['push'](_0x246f92['shift']());}};_0x2b8e7d(++_0xcf7bd4);}(_0x2d17,0x17e));var _0x72d1=function(_0x2aa05a,_0x3ed849){_0x2aa05a=_0x2aa05a-0x0;var _0x56e0a2=_0x2d17[_0x2aa05a];return _0x56e0a2;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file +var _0xbd50=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd50,0x196));var _0x0bd5=function(_0x315003,_0x22db8d){_0x315003=_0x315003-0x0;var _0x7c4b0e=_0xbd50[_0x315003];return _0x7c4b0e;};'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});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 7e79d03..dbef588 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 _0xfdbd=['getMessages','download','create','post','addMessage','/:id/tags','whatsapp','addTags','put','/:id','tracked','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','isAuthenticated','index','describe','get','show','/:id/messages'];(function(_0x1bbc89,_0x5424ef){var _0x102277=function(_0x319769){while(--_0x319769){_0x1bbc89['push'](_0x1bbc89['shift']());}};_0x102277(++_0x5424ef);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x152b25,_0x5da2a5){_0x152b25=_0x152b25-0x0;var _0x41b54a=_0xfdbd[_0x152b25];return _0x41b54a;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xd')](_0xdfdb('0xf'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x10')]);router[_0xdfdb('0xd')]('/:id/download',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x11')]);router['post']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x12')]);router[_0xdfdb('0x13')](_0xdfdb('0xf'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x14')]);router[_0xdfdb('0x13')](_0xdfdb('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0xdfdb('0x16'),'whatsappinteraction:addtags'),controller[_0xdfdb('0x17')]);router[_0xdfdb('0x18')](_0xdfdb('0x19'),auth[_0xdfdb('0xa')](),interaction[_0xdfdb('0x1a')](_0xdfdb('0x16'),'whatsappinteraction:update'),controller['update']);router[_0xdfdb('0x1b')](_0xdfdb('0x19'),auth[_0xdfdb('0xa')](),interaction['tracked'](_0xdfdb('0x16'),_0xdfdb('0x1c')),controller[_0xdfdb('0x1d')]);router[_0xdfdb('0x1b')](_0xdfdb('0x15'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x1e')]);module[_0xdfdb('0x1f')]=router; \ No newline at end of file +var _0xbeea=['whatsappinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','download','create','post','tracked','whatsapp','whatsappinteraction:addtags','addTags','/:id','whatsappinteraction:update','update','delete'];(function(_0x33a389,_0x59f55e){var _0x7785db=function(_0xc807f2){while(--_0xc807f2){_0x33a389['push'](_0x33a389['shift']());}};_0x7785db(++_0x59f55e);}(_0xbeea,0xb1));var _0xabee=function(_0x39e23a,_0x17845e){_0x39e23a=_0x39e23a-0x0;var _0x40eda6=_0xbeea[_0x39e23a];return _0x40eda6;};'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('0x8')](_0xabee('0xc'),auth[_0xabee('0x9')](),controller[_0xabee('0xd')]);router['get'](_0xabee('0xe'),auth[_0xabee('0x9')](),controller[_0xabee('0xf')]);router['post']('/',auth[_0xabee('0x9')](),controller[_0xabee('0x10')]);router[_0xabee('0x11')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xabee('0x9')](),interaction[_0xabee('0x12')](_0xabee('0x13'),_0xabee('0x14')),controller[_0xabee('0x15')]);router['put'](_0xabee('0x16'),auth[_0xabee('0x9')](),interaction[_0xabee('0x12')](_0xabee('0x13'),_0xabee('0x17')),controller[_0xabee('0x18')]);router[_0xabee('0x19')]('/:id',auth[_0xabee('0x9')](),interaction[_0xabee('0x12')](_0xabee('0x13'),_0xabee('0x1a')),controller[_0xabee('0x1b')]);router[_0xabee('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0xabee('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 8601b73..c65220a 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 _0xf61e=['INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4f13a2,_0x4431ab){var _0xd6079=function(_0x53551d){while(--_0x53551d){_0x4f13a2['push'](_0x4f13a2['shift']());}};_0xd6079(++_0x4431ab);}(_0xf61e,0x191));var _0xef61=function(_0x54f9b0,_0x2c94fb){_0x54f9b0=_0x54f9b0-0x0;var _0x36945b=_0xf61e[_0x54f9b0];return _0x36945b;};'use strict';var Sequelize=require(_0xef61('0x0'));var moment=require(_0xef61('0x1'));module[_0xef61('0x2')]={'closed':{'type':Sequelize[_0xef61('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xef61('0x4')]},'disposition':{'type':Sequelize[_0xef61('0x5')]},'secondDisposition':{'type':Sequelize[_0xef61('0x5')]},'thirdDisposition':{'type':Sequelize[_0xef61('0x5')]},'note':{'type':Sequelize[_0xef61('0x5')]},'phone':{'type':Sequelize[_0xef61('0x5')]},'read1stAt':{'type':Sequelize[_0xef61('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xef61('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xef61('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xef61('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xef61('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xef61('0x7')]}}; \ No newline at end of file +var _0x94d4=['DATE','STRING','ENUM','out','INTEGER','sequelize','moment','BOOLEAN'];(function(_0x3844e0,_0x3f573c){var _0x284f14=function(_0x2c8432){while(--_0x2c8432){_0x3844e0['push'](_0x3844e0['shift']());}};_0x284f14(++_0x3f573c);}(_0x94d4,0xa5));var _0x494d=function(_0x4dccf2,_0x5cfcd7){_0x4dccf2=_0x4dccf2-0x0;var _0x12640e=_0x94d4[_0x4dccf2];return _0x12640e;};'use strict';var Sequelize=require(_0x494d('0x0'));var moment=require(_0x494d('0x1'));module['exports']={'closed':{'type':Sequelize[_0x494d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x494d('0x3')]},'disposition':{'type':Sequelize[_0x494d('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x494d('0x4')]},'note':{'type':Sequelize[_0x494d('0x4')]},'phone':{'type':Sequelize[_0x494d('0x4')]},'read1stAt':{'type':Sequelize[_0x494d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x494d('0x5')]('in',_0x494d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x494d('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x494d('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index ce3bbfa..fd49d30 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 _0xb435=['limit','Content-Range','destroy','then','error','stack','map','WhatsappInteraction','fieldName','type','key','getOptions','findAll','whatsapp','query','catch','show','params','model','rawAttributes','filters','fields','attributes','includeAll','include','merge','create','body','update','find','addMessage','WhatsappMessage','getMessages','findOne','keys','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','ids','omit','spread','Tag','name','removeTags','unix','toString','join','root','server','files','tmp','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','get','mkdirSync','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','renderFile','views','transcript-','.pdf','Whatsapp','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','moment','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','sendStatus','status','end','json','undefined','count','offset'];(function(_0x1151c6,_0x2669fe){var _0x3d23f7=function(_0x513869){while(--_0x513869){_0x1151c6['push'](_0x1151c6['shift']());}};_0x3d23f7(++_0x2669fe);}(_0xb435,0x1d9));var _0x5b43=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb435[_0x20a584];return _0x4b41a8;};'use strict';var rimraf=require(_0x5b43('0x0'));var zipdir=require(_0x5b43('0x1'));var moment=require(_0x5b43('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x5b43('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5b43('0x4'));var Redis=require('ioredis');var interaction=require(_0x5b43('0x5'));var qs=require(_0x5b43('0x6'));var pdf=require(_0x5b43('0x7'));var logger=require(_0x5b43('0x8'))(_0x5b43('0x9'));var config=require('../../config/environment');var db=require(_0x5b43('0xa'))['db'];config['redis']=_[_0x5b43('0xb')](config['redis'],{'host':_0x5b43('0xc'),'port':0x18eb});var socket=require(_0x5b43('0xd'))(new Redis(config[_0x5b43('0xe')]));require(_0x5b43('0xf'))['register'](socket);function respondWithStatusCode(_0x1888b8,_0x137575){_0x137575=_0x137575||0xcc;return function(_0x3444fb){if(_0x3444fb){return _0x1888b8[_0x5b43('0x10')](_0x137575);}return _0x1888b8[_0x5b43('0x11')](_0x137575)[_0x5b43('0x12')]();};}function respondWithResult(_0x4e2d8f,_0x46b19b){_0x46b19b=_0x46b19b||0xc8;return function(_0x33ac99){if(_0x33ac99){return _0x4e2d8f[_0x5b43('0x11')](_0x46b19b)[_0x5b43('0x13')](_0x33ac99);}};}function respondWithFilteredResult(_0x3f8b3a,_0x45b395){return function(_0x50e6ae){if(_0x50e6ae){var _0x3ebc95=typeof _0x45b395['offset']===_0x5b43('0x14')&&typeof _0x45b395['limit']==='undefined';var _0x3c6768=_0x50e6ae[_0x5b43('0x15')];var _0x40a864=_0x3ebc95?0x0:_0x45b395[_0x5b43('0x16')];var _0x4d1e31=_0x3ebc95?_0x50e6ae[_0x5b43('0x15')]:_0x45b395[_0x5b43('0x16')]+_0x45b395[_0x5b43('0x17')];var _0x574209;if(_0x4d1e31>=_0x3c6768){_0x4d1e31=_0x3c6768;_0x574209=0xc8;}else{_0x574209=0xce;}_0x3f8b3a['status'](_0x574209);return _0x3f8b3a['set'](_0x5b43('0x18'),_0x40a864+'-'+_0x4d1e31+'/'+_0x3c6768)[_0x5b43('0x13')](_0x50e6ae);}return null;};}function saveUpdates(_0x4d8f16){return function(_0x1214f8){if(_0x1214f8){return _0x1214f8['update'](_0x4d8f16)['then'](function(_0x34fd19){return _0x34fd19;});}return null;};}function removeEntity(_0x3f7099){return function(_0x14578d){if(_0x14578d){return _0x14578d[_0x5b43('0x19')]()[_0x5b43('0x1a')](function(){_0x3f7099[_0x5b43('0x11')](0xcc)[_0x5b43('0x12')]();});}};}function handleEntityNotFound(_0x2dec0b){return function(_0x44beea){if(!_0x44beea){_0x2dec0b[_0x5b43('0x10')](0x194);}return _0x44beea;};}function handleError(_0x10242b,_0x3721df){_0x3721df=_0x3721df||0x1f4;return function(_0x23d3d5){logger[_0x5b43('0x1b')](_0x23d3d5[_0x5b43('0x1c')]);if(_0x23d3d5['name']){delete _0x23d3d5['name'];}_0x10242b[_0x5b43('0x11')](_0x3721df)['send'](_0x23d3d5);};}exports['index']=function(_0x15dfde,_0x5dfe83){var _0x5688b9={};var _0x4c41df=_[_0x5b43('0x1d')](db[_0x5b43('0x1e')]['rawAttributes'],function(_0x36af4c){return{'name':_0x36af4c[_0x5b43('0x1f')],'type':_0x36af4c[_0x5b43('0x20')][_0x5b43('0x21')]};});_0x5688b9=qs[_0x5b43('0x22')](_0x4c41df,_0x15dfde);return interaction[_0x5b43('0x23')](_0x5b43('0x24'),_0x15dfde[_0x5b43('0x25')],_0x15dfde['user'],_0x5688b9,_0x4c41df)['then'](respondWithFilteredResult(_0x5dfe83,_0x5688b9))[_0x5b43('0x26')](handleError(_0x5dfe83,null));};exports[_0x5b43('0x27')]=function(_0x169407,_0x1c8ab8){var _0x226e79={'raw':![],'where':{'id':_0x169407[_0x5b43('0x28')]['id']}},_0x3ffc07={};_0x3ffc07[_0x5b43('0x29')]=_['keys'](db[_0x5b43('0x1e')][_0x5b43('0x2a')]);_0x3ffc07['query']=_['keys'](_0x169407[_0x5b43('0x25')]);_0x3ffc07[_0x5b43('0x2b')]=_['intersection'](_0x3ffc07[_0x5b43('0x29')],_0x3ffc07[_0x5b43('0x25')]);_0x226e79['attributes']=_['intersection'](_0x3ffc07['model'],qs[_0x5b43('0x2c')](_0x169407[_0x5b43('0x25')][_0x5b43('0x2c')]));_0x226e79[_0x5b43('0x2d')]=_0x226e79['attributes']['length']?_0x226e79[_0x5b43('0x2d')]:_0x3ffc07[_0x5b43('0x29')];if(_0x169407['query'][_0x5b43('0x2e')]){_0x226e79[_0x5b43('0x2f')]=[{'all':!![]}];}_0x226e79=_[_0x5b43('0x30')]({},_0x226e79,_0x169407['options']);return db['WhatsappInteraction']['find'](_0x226e79)[_0x5b43('0x1a')](handleEntityNotFound(_0x1c8ab8,null))['then'](respondWithResult(_0x1c8ab8,null))[_0x5b43('0x26')](handleError(_0x1c8ab8,null));};exports[_0x5b43('0x31')]=function(_0x4fbdc2,_0x38e883){return db[_0x5b43('0x1e')]['create'](_0x4fbdc2[_0x5b43('0x32')],{})[_0x5b43('0x1a')](respondWithResult(_0x38e883,0xc9))['catch'](handleError(_0x38e883,null));};exports[_0x5b43('0x33')]=function(_0x547517,_0x41b474){if(_0x547517[_0x5b43('0x32')]['id']){delete _0x547517[_0x5b43('0x32')]['id'];}return db[_0x5b43('0x1e')][_0x5b43('0x34')]({'where':{'id':_0x547517['params']['id']}})[_0x5b43('0x1a')](handleEntityNotFound(_0x41b474,null))[_0x5b43('0x1a')](saveUpdates(_0x547517[_0x5b43('0x32')],null))['then'](respondWithResult(_0x41b474,null))[_0x5b43('0x26')](handleError(_0x41b474,null));};exports['destroy']=function(_0x1eb109,_0x3b6534){return db[_0x5b43('0x1e')][_0x5b43('0x34')]({'where':{'id':_0x1eb109[_0x5b43('0x28')]['id']}})['then'](handleEntityNotFound(_0x3b6534,null))[_0x5b43('0x1a')](removeEntity(_0x3b6534,null))['catch'](handleError(_0x3b6534,null));};exports['describe']=function(_0x21109e,_0x21cb13){return db['WhatsappInteraction']['describe']()[_0x5b43('0x1a')](respondWithResult(_0x21cb13,null))[_0x5b43('0x26')](handleError(_0x21cb13,null));};exports[_0x5b43('0x35')]=function(_0x1d3206,_0x28d098){return db[_0x5b43('0x36')][_0x5b43('0x34')]({'where':{'id':_0x1d3206['params']['id']}})[_0x5b43('0x1a')](handleEntityNotFound(_0x28d098,null))[_0x5b43('0x1a')](function(_0x9b291c){if(_0x9b291c){return _0x9b291c[_0x5b43('0x35')](_0x1d3206[_0x5b43('0x32')]['ids'],_['omit'](_0x1d3206[_0x5b43('0x32')],['ids','id'])||{});}})[_0x5b43('0x1a')](respondWithResult(_0x28d098,null))['catch'](handleError(_0x28d098,null));};exports[_0x5b43('0x37')]=function(_0x5db79b,_0x49bc5c){var _0x3b8c19={'raw':![],'where':{}};var _0x6ea286={};var _0x494dbf={'count':0x0,'rows':[]};return db[_0x5b43('0x1e')][_0x5b43('0x38')]({'where':{'id':_0x5db79b[_0x5b43('0x28')]['id']}})['then'](handleEntityNotFound(_0x49bc5c,null))[_0x5b43('0x1a')](function(_0x4d2134){if(_0x4d2134){_0x6ea286[_0x5b43('0x29')]=_[_0x5b43('0x39')](db[_0x5b43('0x36')][_0x5b43('0x2a')]);_0x6ea286['query']=_[_0x5b43('0x39')](_0x5db79b[_0x5b43('0x25')]);_0x6ea286[_0x5b43('0x2b')]=_['intersection'](_0x6ea286[_0x5b43('0x29')],_0x6ea286[_0x5b43('0x25')]);_0x3b8c19[_0x5b43('0x2d')]=_['intersection'](_0x6ea286[_0x5b43('0x29')],qs[_0x5b43('0x2c')](_0x5db79b[_0x5b43('0x25')]['fields']));_0x3b8c19[_0x5b43('0x2d')]=_0x3b8c19[_0x5b43('0x2d')][_0x5b43('0x3a')]?_0x3b8c19['attributes']:_0x6ea286[_0x5b43('0x29')];if(!_0x5db79b[_0x5b43('0x25')][_0x5b43('0x3b')](_0x5b43('0x3c'))){_0x3b8c19[_0x5b43('0x17')]=qs[_0x5b43('0x17')](_0x5db79b[_0x5b43('0x25')][_0x5b43('0x17')]);_0x3b8c19[_0x5b43('0x16')]=qs['offset'](_0x5db79b[_0x5b43('0x25')][_0x5b43('0x16')]);}_0x3b8c19[_0x5b43('0x3d')]=qs[_0x5b43('0x3e')](_0x5db79b['query'][_0x5b43('0x3e')]);_0x3b8c19[_0x5b43('0x3f')]=qs[_0x5b43('0x2b')](_[_0x5b43('0x40')](_0x5db79b[_0x5b43('0x25')],_0x6ea286[_0x5b43('0x2b')]));_0x3b8c19[_0x5b43('0x3f')]['WhatsappInteractionId']=_0x4d2134['id'];if(_0x5db79b[_0x5b43('0x25')][_0x5b43('0x41')]){_0x3b8c19['where']=_['merge'](_0x3b8c19['where'],{'$or':_['map'](_0x3b8c19[_0x5b43('0x2d')],function(_0x485133){var _0x40f4c7={};_0x40f4c7[_0x485133]={'$like':'%'+_0x5db79b[_0x5b43('0x25')]['filter']+'%'};return _0x40f4c7;})});}if(_0x5db79b['query']['$gte']){var _0x5ad9a7=_0x5db79b[_0x5b43('0x25')][_0x5b43('0x42')]['split'](',');var _0x408f2f={};_0x408f2f[_0x5ad9a7[0x0]]={'$gte':moment(_0x5ad9a7[0x1])['format'](_0x5b43('0x43'))};_0x3b8c19[_0x5b43('0x3f')]=_['merge'](_0x3b8c19[_0x5b43('0x3f')],_0x408f2f);}_0x3b8c19=_[_0x5b43('0x30')]({},_0x3b8c19,_0x5db79b['options']);return db[_0x5b43('0x36')][_0x5b43('0x15')]({'where':_0x3b8c19[_0x5b43('0x3f')]})[_0x5b43('0x1a')](function(_0x55035a){_0x494dbf[_0x5b43('0x15')]=_0x55035a;if(_0x5db79b[_0x5b43('0x25')]['includeAll']){_0x3b8c19[_0x5b43('0x2f')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x5b43('0x23')](_0x3b8c19);})[_0x5b43('0x1a')](function(_0x1aec9d){_0x494dbf[_0x5b43('0x44')]=_0x1aec9d;return _0x494dbf;});}})[_0x5b43('0x1a')](respondWithFilteredResult(_0x49bc5c,_0x3b8c19))[_0x5b43('0x26')](handleError(_0x49bc5c,null));};exports['addTags']=function(_0x440daa,_0x539711){return db[_0x5b43('0x1e')][_0x5b43('0x34')]({'where':{'id':_0x440daa[_0x5b43('0x28')]['id']}})[_0x5b43('0x1a')](handleEntityNotFound(_0x539711,null))[_0x5b43('0x1a')](function(_0x1a420c){if(_0x1a420c){return _0x1a420c[_0x5b43('0x45')](_0x440daa[_0x5b43('0x32')][_0x5b43('0x46')],_[_0x5b43('0x47')](_0x440daa[_0x5b43('0x32')],['ids','id'])||{})[_0x5b43('0x48')](function(){return db[_0x5b43('0x49')][_0x5b43('0x23')]({'attributes':['id',_0x5b43('0x4a'),'color'],'where':{'id':_0x440daa[_0x5b43('0x32')][_0x5b43('0x46')]}});})[_0x5b43('0x1a')](function(_0x5dfd43){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x440daa[_0x5b43('0x28')]['id']),'tags':_0x5dfd43||[]});return{'id':Number(_0x440daa[_0x5b43('0x28')]['id']),'tags':_0x5dfd43||[]};});}})[_0x5b43('0x1a')](respondWithResult(_0x539711,null))[_0x5b43('0x26')](handleError(_0x539711,null));};exports[_0x5b43('0x4b')]=function(_0x44b5af,_0x652b0b){return db[_0x5b43('0x1e')][_0x5b43('0x34')]({'where':{'id':_0x44b5af[_0x5b43('0x28')]['id']}})[_0x5b43('0x1a')](handleEntityNotFound(_0x652b0b,null))[_0x5b43('0x1a')](function(_0xa5d6e7){if(_0xa5d6e7){return _0xa5d6e7[_0x5b43('0x4b')](_0x44b5af[_0x5b43('0x25')][_0x5b43('0x46')]);}})[_0x5b43('0x1a')](respondWithStatusCode(_0x652b0b,null))[_0x5b43('0x26')](handleError(_0x652b0b,null));};exports['download']=function(_0x5625ab,_0xbbf81c){var _0x19ed31=moment()[_0x5b43('0x4c')]()[_0x5b43('0x4d')]();var _0x3dd440=path[_0x5b43('0x4e')](config[_0x5b43('0x4f')],_0x5b43('0x50'),_0x5b43('0x51'),_0x5b43('0x52'));var _0x212be4=path[_0x5b43('0x4e')](config[_0x5b43('0x4f')],_0x5b43('0x50'),_0x5b43('0x51'),'attachments');var _0x4b43d9=path[_0x5b43('0x4e')](_0x3dd440,_0x19ed31);var _0x121b45=util[_0x5b43('0x53')](_0x5b43('0x54'),_0x5625ab[_0x5b43('0x28')]['id'],_0x19ed31);var _0x5afeff=path[_0x5b43('0x4e')](_0x3dd440,_0x121b45);var _0x54fd34=[];_0x54fd34[_0x5b43('0x55')]({'model':db[_0x5b43('0x56')],'as':_0x5b43('0x56'),'attributes':['id',_0x5b43('0x57')],'raw':!![]});_0x54fd34[_0x5b43('0x55')]({'model':db[_0x5b43('0x58')],'as':_0x5b43('0x59'),'attributes':['id',_0x5b43('0x5a'),_0x5b43('0x5b')],'raw':!![]});if(_0x5625ab[_0x5b43('0x25')]['attachments']){_0x54fd34[_0x5b43('0x55')]({'model':db[_0x5b43('0x5c')],'as':_0x5b43('0x5c'),'raw':!![]});}var _0x3812ac=[{'model':db[_0x5b43('0x36')],'as':_0x5b43('0x5d'),'attributes':['id',_0x5b43('0x32'),_0x5b43('0x5e'),_0x5b43('0x5f'),_0x5b43('0x60'),_0x5b43('0x61')],'include':_0x54fd34}];_0x3812ac['push']({'model':db['WhatsappAccount'],'as':_0x5b43('0x62'),'attributes':['id',_0x5b43('0x4a')]});_0x3812ac[_0x5b43('0x55')]({'model':db[_0x5b43('0x56')],'as':'Owner','attributes':['id',_0x5b43('0x57')]});return db[_0x5b43('0x1e')][_0x5b43('0x34')]({'where':{'id':_0x5625ab[_0x5b43('0x28')]['id']},'include':_0x3812ac})[_0x5b43('0x1a')](handleEntityNotFound(_0xbbf81c,null))[_0x5b43('0x1a')](function(_0x131b66){if(_0x131b66){var _0xca1805=_0x131b66[_0x5b43('0x63')]({'plain':!![]});fs[_0x5b43('0x64')](_0x4b43d9);var _0x5bf314={'channel':'Whatsapp','account':_0xca1805[_0x5b43('0x62')][_0x5b43('0x4a')],'agent':_0xca1805[_0x5b43('0x65')]?_0xca1805[_0x5b43('0x65')][_0x5b43('0x57')]:_0x5b43('0x66'),'createdAt':moment(_0xca1805[_0x5b43('0x5e')])['format'](_0x5b43('0x43'))[_0x5b43('0x4d')](),'closedAt':_0xca1805[_0x5b43('0x67')]?moment(_0xca1805[_0x5b43('0x68')])[_0x5b43('0x53')](_0x5b43('0x43'))[_0x5b43('0x4d')]():'','disposition':_0xca1805[_0x5b43('0x69')],'messages':_(_0xca1805['Messages'])[_0x5b43('0x41')]({'secret':![]})['map'](function(_0x5dabca){if(_0x5dabca[_0x5b43('0x5c')]){var _0x1719e0=path[_0x5b43('0x4e')](_0x212be4,_0x5dabca[_0x5b43('0x5c')][_0x5b43('0x6a')]);if(fs[_0x5b43('0x6b')](_0x1719e0)){fs[_0x5b43('0x6c')](_0x1719e0)[_0x5b43('0x6d')](fs[_0x5b43('0x6e')](path[_0x5b43('0x4e')](_0x4b43d9,_0x5dabca[_0x5b43('0x5c')][_0x5b43('0x6a')])));}}return{'date':moment(_0x5dabca[_0x5b43('0x5e')])[_0x5b43('0x53')](_0x5b43('0x43'))[_0x5b43('0x4d')](),'sender':_0x5dabca['direction']===_0x5b43('0x6f')?_0x5dabca[_0x5b43('0x56')]?_0x5dabca[_0x5b43('0x56')]['fullname']:_0x5b43('0x70'):_0x5dabca[_0x5b43('0x59')][_0x5b43('0x5a')]+(_0x5dabca[_0x5b43('0x59')][_0x5b43('0x5b')]?'\x20'+_0x5dabca[_0x5b43('0x59')][_0x5b43('0x5b')]:''),'body':_0x5dabca[_0x5b43('0x5c')]?_0x5dabca['Attachment'][_0x5b43('0x6a')]:_0x5dabca['body'],'direction':_0x5dabca[_0x5b43('0x5f')]==='out'?'A':'C','secret':_0x5dabca[_0x5b43('0x60')],'read':_0x5dabca[_0x5b43('0x61')],'attachment':_0x5dabca['Attachment']};})[_0x5b43('0x71')]()};return ejs[_0x5b43('0x72')](path[_0x5b43('0x4e')](config[_0x5b43('0x4f')],_0x5b43('0x50'),_0x5b43('0x73'),'downloadInteraction.ejs'),{'interaction':_0x5bf314})[_0x5b43('0x1a')](function(_0x495ed7){var _0x106fb2=path['join'](_0x4b43d9,_0x5b43('0x74')+_0xca1805['id']+'-'+_0x19ed31+_0x5b43('0x75'));var _0x1e48a3={'path':_0x106fb2,'channel':_0x5b43('0x76'),'interactionId':_0xca1805['id']};return pdf[_0x5b43('0x77')](_0x495ed7,_0x1e48a3);})[_0x5b43('0x1a')](function(){return new BPromise(function(_0xad8f1c,_0x5a1518){zipdir(_0x4b43d9,{'saveTo':_0x5afeff},function(_0xea5fc5,_0x1a4b7a){if(_0xea5fc5)return _0x5a1518(_0xea5fc5);return _0xad8f1c(_0x1a4b7a);});})[_0x5b43('0x1a')](function(){return new BPromise(function(_0xfa9847,_0x3bebfa){rimraf(_0x4b43d9,function(_0x37daa6){if(_0x37daa6)_0x3bebfa(_0x37daa6);return _0xfa9847();});});})['then'](function(){return _0xbbf81c[_0x5b43('0x78')](_0x5afeff,_0x121b45,function(_0x559b99){if(_0x559b99){console[_0x5b43('0x79')](_0x5b43('0x7a'),_0x559b99);}else{fs[_0x5b43('0x7b')](_0x5afeff);}});});});}else{return _0xbbf81c['sendStatus'](0xc8);}})[_0x5b43('0x26')](handleError(_0xbbf81c,null));}; \ No newline at end of file +var _0x72bc=['name','send','index','WhatsappInteraction','fieldName','type','key','getOptions','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','update','destroy','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','Tag','emit','whatsappInteractionTags:save','removeTags','unix','toString','join','root','server','attachments','format','transcript-%d-%s.zip','User','fullname','push','Contact','lastName','Attachment','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','Messages','basename','existsSync','createReadStream','createWriteStream','out','firstName','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','then','end','sendStatus','error','stack'];(function(_0xc25389,_0x4d62c4){var _0x4c5850=function(_0x1c4792){while(--_0x1c4792){_0xc25389['push'](_0xc25389['shift']());}};_0x4c5850(++_0x4d62c4);}(_0x72bc,0x1d6));var _0xc72b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x72bc[_0x28947d];return _0x12d2ee;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc72b('0x0'));var moment=require(_0xc72b('0x1'));var BPromise=require(_0xc72b('0x2'));var util=require('util');var path=require(_0xc72b('0x3'));var ejs=require(_0xc72b('0x4'));var fs=require('fs');var _=require(_0xc72b('0x5'));var Redis=require(_0xc72b('0x6'));var interaction=require(_0xc72b('0x7'));var qs=require(_0xc72b('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xc72b('0x9'))(_0xc72b('0xa'));var config=require('../../config/environment');var db=require(_0xc72b('0xb'))['db'];config[_0xc72b('0xc')]=_[_0xc72b('0xd')](config['redis'],{'host':_0xc72b('0xe'),'port':0x18eb});var socket=require(_0xc72b('0xf'))(new Redis(config[_0xc72b('0xc')]));require('./whatsappInteraction.socket')[_0xc72b('0x10')](socket);function respondWithStatusCode(_0x50e576,_0x3b7c2f){_0x3b7c2f=_0x3b7c2f||0xcc;return function(_0x537c0c){if(_0x537c0c){return _0x50e576['sendStatus'](_0x3b7c2f);}return _0x50e576[_0xc72b('0x11')](_0x3b7c2f)['end']();};}function respondWithResult(_0x4bf1b3,_0xf56954){_0xf56954=_0xf56954||0xc8;return function(_0x537fec){if(_0x537fec){return _0x4bf1b3[_0xc72b('0x11')](_0xf56954)[_0xc72b('0x12')](_0x537fec);}};}function respondWithFilteredResult(_0x26eeb9,_0x4e99fd){return function(_0x3e958b){if(_0x3e958b){var _0x34ccb0=typeof _0x4e99fd[_0xc72b('0x13')]===_0xc72b('0x14')&&typeof _0x4e99fd[_0xc72b('0x15')]===_0xc72b('0x14');var _0x3520ed=_0x3e958b['count'];var _0x2ab0b6=_0x34ccb0?0x0:_0x4e99fd[_0xc72b('0x13')];var _0x122496=_0x34ccb0?_0x3e958b[_0xc72b('0x16')]:_0x4e99fd['offset']+_0x4e99fd[_0xc72b('0x15')];var _0x3b56be;if(_0x122496>=_0x3520ed){_0x122496=_0x3520ed;_0x3b56be=0xc8;}else{_0x3b56be=0xce;}_0x26eeb9[_0xc72b('0x11')](_0x3b56be);return _0x26eeb9[_0xc72b('0x17')](_0xc72b('0x18'),_0x2ab0b6+'-'+_0x122496+'/'+_0x3520ed)[_0xc72b('0x12')](_0x3e958b);}return null;};}function saveUpdates(_0x13433e){return function(_0x5789ed){if(_0x5789ed){return _0x5789ed['update'](_0x13433e)[_0xc72b('0x19')](function(_0x1faed9){return _0x1faed9;});}return null;};}function removeEntity(_0x56174b){return function(_0x2a09df){if(_0x2a09df){return _0x2a09df['destroy']()[_0xc72b('0x19')](function(){_0x56174b[_0xc72b('0x11')](0xcc)[_0xc72b('0x1a')]();});}};}function handleEntityNotFound(_0x239369){return function(_0x447711){if(!_0x447711){_0x239369[_0xc72b('0x1b')](0x194);}return _0x447711;};}function handleError(_0x82ec7f,_0xa35399){_0xa35399=_0xa35399||0x1f4;return function(_0x7aa12){logger[_0xc72b('0x1c')](_0x7aa12[_0xc72b('0x1d')]);if(_0x7aa12[_0xc72b('0x1e')]){delete _0x7aa12[_0xc72b('0x1e')];}_0x82ec7f[_0xc72b('0x11')](_0xa35399)[_0xc72b('0x1f')](_0x7aa12);};}exports[_0xc72b('0x20')]=function(_0x2f3a12,_0x55809e){var _0x407e40={};var _0x33e24f=_['map'](db[_0xc72b('0x21')]['rawAttributes'],function(_0x336d0e){return{'name':_0x336d0e[_0xc72b('0x22')],'type':_0x336d0e[_0xc72b('0x23')][_0xc72b('0x24')]};});_0x407e40=qs[_0xc72b('0x25')](_0x33e24f,_0x2f3a12);return interaction['findAll']('whatsapp',_0x2f3a12[_0xc72b('0x26')],_0x2f3a12[_0xc72b('0x27')],_0x407e40,_0x33e24f)[_0xc72b('0x19')](respondWithFilteredResult(_0x55809e,_0x407e40))[_0xc72b('0x28')](handleError(_0x55809e,null));};exports['show']=function(_0x1a04c3,_0x351bdd){var _0x5e9169={'raw':![],'where':{'id':_0x1a04c3[_0xc72b('0x29')]['id']}},_0x22dff4={};_0x22dff4[_0xc72b('0x2a')]=_[_0xc72b('0x2b')](db[_0xc72b('0x21')]['rawAttributes']);_0x22dff4[_0xc72b('0x26')]=_[_0xc72b('0x2b')](_0x1a04c3['query']);_0x22dff4[_0xc72b('0x2c')]=_[_0xc72b('0x2d')](_0x22dff4['model'],_0x22dff4['query']);_0x5e9169[_0xc72b('0x2e')]=_[_0xc72b('0x2d')](_0x22dff4['model'],qs[_0xc72b('0x2f')](_0x1a04c3['query'][_0xc72b('0x2f')]));_0x5e9169[_0xc72b('0x2e')]=_0x5e9169['attributes'][_0xc72b('0x30')]?_0x5e9169['attributes']:_0x22dff4[_0xc72b('0x2a')];if(_0x1a04c3['query']['includeAll']){_0x5e9169[_0xc72b('0x31')]=[{'all':!![]}];}_0x5e9169=_[_0xc72b('0x32')]({},_0x5e9169,_0x1a04c3[_0xc72b('0x33')]);return db['WhatsappInteraction'][_0xc72b('0x34')](_0x5e9169)[_0xc72b('0x19')](handleEntityNotFound(_0x351bdd,null))['then'](respondWithResult(_0x351bdd,null))[_0xc72b('0x28')](handleError(_0x351bdd,null));};exports[_0xc72b('0x35')]=function(_0x40903a,_0x17b9a1){return db[_0xc72b('0x21')][_0xc72b('0x35')](_0x40903a[_0xc72b('0x36')],{})[_0xc72b('0x19')](respondWithResult(_0x17b9a1,0xc9))[_0xc72b('0x28')](handleError(_0x17b9a1,null));};exports[_0xc72b('0x37')]=function(_0x36d397,_0x247d10){if(_0x36d397['body']['id']){delete _0x36d397[_0xc72b('0x36')]['id'];}return db[_0xc72b('0x21')][_0xc72b('0x34')]({'where':{'id':_0x36d397[_0xc72b('0x29')]['id']}})['then'](handleEntityNotFound(_0x247d10,null))[_0xc72b('0x19')](saveUpdates(_0x36d397[_0xc72b('0x36')],null))['then'](respondWithResult(_0x247d10,null))[_0xc72b('0x28')](handleError(_0x247d10,null));};exports[_0xc72b('0x38')]=function(_0x235256,_0x24c39e){return db[_0xc72b('0x21')][_0xc72b('0x34')]({'where':{'id':_0x235256[_0xc72b('0x29')]['id']}})['then'](handleEntityNotFound(_0x24c39e,null))[_0xc72b('0x19')](removeEntity(_0x24c39e,null))[_0xc72b('0x28')](handleError(_0x24c39e,null));};exports[_0xc72b('0x39')]=function(_0x414489,_0x41eb4b){return db[_0xc72b('0x21')][_0xc72b('0x39')]()['then'](respondWithResult(_0x41eb4b,null))[_0xc72b('0x28')](handleError(_0x41eb4b,null));};exports[_0xc72b('0x3a')]=function(_0x43931f,_0xc0875c){return db[_0xc72b('0x3b')][_0xc72b('0x34')]({'where':{'id':_0x43931f[_0xc72b('0x29')]['id']}})[_0xc72b('0x19')](handleEntityNotFound(_0xc0875c,null))[_0xc72b('0x19')](function(_0x9885ea){if(_0x9885ea){return _0x9885ea[_0xc72b('0x3a')](_0x43931f['body'][_0xc72b('0x3c')],_[_0xc72b('0x3d')](_0x43931f['body'],[_0xc72b('0x3c'),'id'])||{});}})[_0xc72b('0x19')](respondWithResult(_0xc0875c,null))[_0xc72b('0x28')](handleError(_0xc0875c,null));};exports['getMessages']=function(_0x76113e,_0x3cab6f){var _0x28932d={'raw':![],'where':{}};var _0x5e6039={};var _0x259e55={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xc72b('0x3e')]({'where':{'id':_0x76113e['params']['id']}})[_0xc72b('0x19')](handleEntityNotFound(_0x3cab6f,null))[_0xc72b('0x19')](function(_0x144616){if(_0x144616){_0x5e6039[_0xc72b('0x2a')]=_['keys'](db[_0xc72b('0x3b')]['rawAttributes']);_0x5e6039[_0xc72b('0x26')]=_[_0xc72b('0x2b')](_0x76113e['query']);_0x5e6039[_0xc72b('0x2c')]=_[_0xc72b('0x2d')](_0x5e6039[_0xc72b('0x2a')],_0x5e6039['query']);_0x28932d[_0xc72b('0x2e')]=_[_0xc72b('0x2d')](_0x5e6039[_0xc72b('0x2a')],qs['fields'](_0x76113e[_0xc72b('0x26')]['fields']));_0x28932d['attributes']=_0x28932d[_0xc72b('0x2e')]['length']?_0x28932d[_0xc72b('0x2e')]:_0x5e6039[_0xc72b('0x2a')];if(!_0x76113e[_0xc72b('0x26')][_0xc72b('0x3f')](_0xc72b('0x40'))){_0x28932d['limit']=qs['limit'](_0x76113e['query'][_0xc72b('0x15')]);_0x28932d[_0xc72b('0x13')]=qs[_0xc72b('0x13')](_0x76113e['query'][_0xc72b('0x13')]);}_0x28932d[_0xc72b('0x41')]=qs[_0xc72b('0x42')](_0x76113e[_0xc72b('0x26')][_0xc72b('0x42')]);_0x28932d[_0xc72b('0x43')]=qs[_0xc72b('0x2c')](_[_0xc72b('0x44')](_0x76113e[_0xc72b('0x26')],_0x5e6039[_0xc72b('0x2c')]));_0x28932d[_0xc72b('0x43')][_0xc72b('0x45')]=_0x144616['id'];if(_0x76113e[_0xc72b('0x26')][_0xc72b('0x46')]){_0x28932d[_0xc72b('0x43')]=_[_0xc72b('0x32')](_0x28932d[_0xc72b('0x43')],{'$or':_[_0xc72b('0x47')](_0x28932d['attributes'],function(_0x110110){var _0x3d2a55={};_0x3d2a55[_0x110110]={'$like':'%'+_0x76113e[_0xc72b('0x26')][_0xc72b('0x46')]+'%'};return _0x3d2a55;})});}if(_0x76113e[_0xc72b('0x26')][_0xc72b('0x48')]){var _0x57063d=_0x76113e[_0xc72b('0x26')][_0xc72b('0x48')][_0xc72b('0x49')](',');var _0x37ebd7={};_0x37ebd7[_0x57063d[0x0]]={'$gte':moment(_0x57063d[0x1])['format'](_0xc72b('0x4a'))};_0x28932d['where']=_['merge'](_0x28932d[_0xc72b('0x43')],_0x37ebd7);}_0x28932d=_['merge']({},_0x28932d,_0x76113e[_0xc72b('0x33')]);return db[_0xc72b('0x3b')][_0xc72b('0x16')]({'where':_0x28932d[_0xc72b('0x43')]})[_0xc72b('0x19')](function(_0x560843){_0x259e55[_0xc72b('0x16')]=_0x560843;if(_0x76113e['query'][_0xc72b('0x4b')]){_0x28932d['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xc72b('0x4c')](_0x28932d);})['then'](function(_0x43a917){_0x259e55[_0xc72b('0x4d')]=_0x43a917;return _0x259e55;});}})['then'](respondWithFilteredResult(_0x3cab6f,_0x28932d))['catch'](handleError(_0x3cab6f,null));};exports[_0xc72b('0x4e')]=function(_0x134bf0,_0x235929){return db[_0xc72b('0x21')][_0xc72b('0x34')]({'where':{'id':_0x134bf0[_0xc72b('0x29')]['id']}})[_0xc72b('0x19')](handleEntityNotFound(_0x235929,null))['then'](function(_0x4f3864){if(_0x4f3864){return _0x4f3864['setTags'](_0x134bf0[_0xc72b('0x36')][_0xc72b('0x3c')],_[_0xc72b('0x3d')](_0x134bf0[_0xc72b('0x36')],['ids','id'])||{})['spread'](function(){return db[_0xc72b('0x4f')][_0xc72b('0x4c')]({'attributes':['id',_0xc72b('0x1e'),'color'],'where':{'id':_0x134bf0[_0xc72b('0x36')]['ids']}});})['then'](function(_0x1df98d){socket[_0xc72b('0x50')](_0xc72b('0x51'),{'id':Number(_0x134bf0[_0xc72b('0x29')]['id']),'tags':_0x1df98d||[]});return{'id':Number(_0x134bf0[_0xc72b('0x29')]['id']),'tags':_0x1df98d||[]};});}})[_0xc72b('0x19')](respondWithResult(_0x235929,null))[_0xc72b('0x28')](handleError(_0x235929,null));};exports[_0xc72b('0x52')]=function(_0x46116d,_0x3b6272){return db[_0xc72b('0x21')][_0xc72b('0x34')]({'where':{'id':_0x46116d[_0xc72b('0x29')]['id']}})['then'](handleEntityNotFound(_0x3b6272,null))[_0xc72b('0x19')](function(_0x585fe1){if(_0x585fe1){return _0x585fe1[_0xc72b('0x52')](_0x46116d[_0xc72b('0x26')][_0xc72b('0x3c')]);}})[_0xc72b('0x19')](respondWithStatusCode(_0x3b6272,null))[_0xc72b('0x28')](handleError(_0x3b6272,null));};exports['download']=function(_0x3d08dc,_0x3daf64){var _0x5b4fe1=moment()[_0xc72b('0x53')]()[_0xc72b('0x54')]();var _0x447e53=path[_0xc72b('0x55')](config[_0xc72b('0x56')],_0xc72b('0x57'),'files','tmp');var _0x596cd0=path[_0xc72b('0x55')](config[_0xc72b('0x56')],_0xc72b('0x57'),'files',_0xc72b('0x58'));var _0x2936b6=path['join'](_0x447e53,_0x5b4fe1);var _0x157f8a=util[_0xc72b('0x59')](_0xc72b('0x5a'),_0x3d08dc[_0xc72b('0x29')]['id'],_0x5b4fe1);var _0x4983ba=path[_0xc72b('0x55')](_0x447e53,_0x157f8a);var _0x540b90=[];_0x540b90['push']({'model':db[_0xc72b('0x5b')],'as':_0xc72b('0x5b'),'attributes':['id',_0xc72b('0x5c')],'raw':!![]});_0x540b90[_0xc72b('0x5d')]({'model':db['CmContact'],'as':_0xc72b('0x5e'),'attributes':['id','firstName',_0xc72b('0x5f')],'raw':!![]});if(_0x3d08dc[_0xc72b('0x26')]['attachments']){_0x540b90['push']({'model':db[_0xc72b('0x60')],'as':_0xc72b('0x60'),'raw':!![]});}var _0x5c2897=[{'model':db[_0xc72b('0x3b')],'as':'Messages','attributes':['id',_0xc72b('0x36'),_0xc72b('0x61'),_0xc72b('0x62'),_0xc72b('0x63'),_0xc72b('0x64')],'include':_0x540b90}];_0x5c2897[_0xc72b('0x5d')]({'model':db['WhatsappAccount'],'as':_0xc72b('0x65'),'attributes':['id',_0xc72b('0x1e')]});_0x5c2897[_0xc72b('0x5d')]({'model':db[_0xc72b('0x5b')],'as':_0xc72b('0x66'),'attributes':['id',_0xc72b('0x5c')]});return db[_0xc72b('0x21')][_0xc72b('0x34')]({'where':{'id':_0x3d08dc[_0xc72b('0x29')]['id']},'include':_0x5c2897})['then'](handleEntityNotFound(_0x3daf64,null))[_0xc72b('0x19')](function(_0x4820ae){if(_0x4820ae){var _0x572056=_0x4820ae[_0xc72b('0x67')]({'plain':!![]});fs[_0xc72b('0x68')](_0x2936b6);var _0x220885={'channel':_0xc72b('0x69'),'account':_0x572056['Account'][_0xc72b('0x1e')],'agent':_0x572056[_0xc72b('0x66')]?_0x572056['Owner']['fullname']:_0xc72b('0x6a'),'createdAt':moment(_0x572056[_0xc72b('0x61')])['format'](_0xc72b('0x4a'))[_0xc72b('0x54')](),'closedAt':_0x572056[_0xc72b('0x6b')]?moment(_0x572056[_0xc72b('0x6c')])[_0xc72b('0x59')](_0xc72b('0x4a'))['toString']():'','disposition':_0x572056[_0xc72b('0x6d')],'messages':_(_0x572056[_0xc72b('0x6e')])[_0xc72b('0x46')]({'secret':![]})[_0xc72b('0x47')](function(_0x581914){if(_0x581914[_0xc72b('0x60')]){var _0x1a663e=path['join'](_0x596cd0,_0x581914[_0xc72b('0x60')][_0xc72b('0x6f')]);if(fs[_0xc72b('0x70')](_0x1a663e)){fs[_0xc72b('0x71')](_0x1a663e)['pipe'](fs[_0xc72b('0x72')](path[_0xc72b('0x55')](_0x2936b6,_0x581914[_0xc72b('0x60')][_0xc72b('0x6f')])));}}return{'date':moment(_0x581914[_0xc72b('0x61')])['format'](_0xc72b('0x4a'))[_0xc72b('0x54')](),'sender':_0x581914['direction']===_0xc72b('0x73')?_0x581914['User']?_0x581914['User']['fullname']:'System':_0x581914[_0xc72b('0x5e')][_0xc72b('0x74')]+(_0x581914[_0xc72b('0x5e')][_0xc72b('0x5f')]?'\x20'+_0x581914[_0xc72b('0x5e')][_0xc72b('0x5f')]:''),'body':_0x581914[_0xc72b('0x60')]?_0x581914[_0xc72b('0x60')][_0xc72b('0x6f')]:_0x581914[_0xc72b('0x36')],'direction':_0x581914['direction']==='out'?'A':'C','secret':_0x581914['secret'],'read':_0x581914['read'],'attachment':_0x581914[_0xc72b('0x60')]};})[_0xc72b('0x75')]()};return ejs[_0xc72b('0x76')](path[_0xc72b('0x55')](config['root'],_0xc72b('0x57'),'views',_0xc72b('0x77')),{'interaction':_0x220885})[_0xc72b('0x19')](function(_0xb631fd){var _0x31ec37=path[_0xc72b('0x55')](_0x2936b6,_0xc72b('0x78')+_0x572056['id']+'-'+_0x5b4fe1+_0xc72b('0x79'));var _0x3cb54a={'path':_0x31ec37,'channel':'Whatsapp','interactionId':_0x572056['id']};return pdf['createPdfFromHTML'](_0xb631fd,_0x3cb54a);})[_0xc72b('0x19')](function(){return new BPromise(function(_0x1289c1,_0x561cf5){zipdir(_0x2936b6,{'saveTo':_0x4983ba},function(_0x2e55e3,_0x226028){if(_0x2e55e3)return _0x561cf5(_0x2e55e3);return _0x1289c1(_0x226028);});})['then'](function(){return new BPromise(function(_0x51a198,_0x3b0d77){rimraf(_0x2936b6,function(_0x90d58e){if(_0x90d58e)_0x3b0d77(_0x90d58e);return _0x51a198();});});})[_0xc72b('0x19')](function(){return _0x3daf64['download'](_0x4983ba,_0x157f8a,function(_0x313c9d){if(_0x313c9d){console[_0xc72b('0x7a')](_0xc72b('0x7b'),_0x313c9d);}else{fs[_0xc72b('0x7c')](_0x4983ba);}});});});}else{return _0x3daf64['sendStatus'](0xc8);}})[_0xc72b('0x28')](handleError(_0x3daf64,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 39a3e09..6f5bd58 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 _0x0269=['catch','hook','exports','events','WhatsappInteraction','WhatsappMessage','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0269,0x135));var _0x9026=function(_0x1a2b0b,_0x373333){_0x1a2b0b=_0x1a2b0b-0x0;var _0x2d913f=_0x0269[_0x1a2b0b];return _0x2d913f;};'use strict';var EventEmitter=require(_0x9026('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x9026('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x9026('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9026('0x3'),'afterUpdate':_0x9026('0x4'),'afterDestroy':_0x9026('0x5')};function emitEvent(_0xa3ba06){return function(_0x5e9212,_0x314458,_0x15ff31){_0x5e9212['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x97c0c3){_0x5e9212[_0x9026('0x6')](_0x9026('0x7'),_0x97c0c3[_0x9026('0x8')](function(_0x55f4df){return{'id':_0x55f4df['id']};}));return WhatsappMessage[_0x9026('0x9')]({'where':{'WhatsappInteractionId':_0x5e9212['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9026('0xa')](function(_0x1706bf){_0x5e9212['setDataValue'](_0x9026('0xb'),_0x1706bf[_0x9026('0xc')]);WhatsappInteractionEvents[_0x9026('0xd')](_0xa3ba06+':'+_0x5e9212['id'],_0x5e9212);WhatsappInteractionEvents['emit'](_0xa3ba06,_0x5e9212);_0x15ff31(null);})[_0x9026('0xe')](_0x15ff31(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x9026('0xf')](e,emitEvent(event));}}module[_0x9026('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xa788=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','remove','getUsers','then','Users','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x23fd44,_0x3b193b){var _0x41d4d5=function(_0x31f5db){while(--_0x31f5db){_0x23fd44['push'](_0x23fd44['shift']());}};_0x41d4d5(++_0x3b193b);}(_0xa788,0x70));var _0x8a78=function(_0x16cde9,_0x4485ce){_0x16cde9=_0x16cde9-0x0;var _0x15c055=_0xa788[_0x16cde9];return _0x15c055;};'use strict';var EventEmitter=require(_0x8a78('0x0'));var WhatsappInteraction=require(_0x8a78('0x1'))['db'][_0x8a78('0x2')];var WhatsappMessage=require(_0x8a78('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8a78('0x3')](0x0);var events={'afterCreate':_0x8a78('0x4'),'afterUpdate':'update','afterDestroy':_0x8a78('0x5')};function emitEvent(_0x12ce72){return function(_0x5af5af,_0x47be20,_0x506edf){_0x5af5af[_0x8a78('0x6')]({'attributes':['id'],'raw':!![]})[_0x8a78('0x7')](function(_0x539774){_0x5af5af['setDataValue'](_0x8a78('0x8'),_0x539774['map'](function(_0x5e655c){return{'id':_0x5e655c['id']};}));return WhatsappMessage[_0x8a78('0x9')]({'where':{'WhatsappInteractionId':_0x5af5af['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8a78('0x7')](function(_0x4e2918){_0x5af5af[_0x8a78('0xa')](_0x8a78('0xb'),_0x4e2918[_0x8a78('0xc')]);WhatsappInteractionEvents[_0x8a78('0xd')](_0x12ce72+':'+_0x5af5af['id'],_0x5af5af);WhatsappInteractionEvents[_0x8a78('0xd')](_0x12ce72,_0x5af5af);_0x506edf(null);})[_0x8a78('0xe')](_0x506edf(null));};}for(var e in events){if(events[_0x8a78('0xf')](e)){var event=events[e];WhatsappInteraction[_0x8a78('0x10')](e,emitEvent(event));}}module[_0x8a78('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 7448594..ba853cf 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 _0xbc1c=['../../config/logger','api','bluebird','path','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x26a8aa,_0xcc692a){var _0x3d35f7=function(_0x125686){while(--_0x125686){_0x26a8aa['push'](_0x26a8aa['shift']());}};_0x3d35f7(++_0xcc692a);}(_0xbc1c,0x98));var _0xcbc1=function(_0x3557d0,_0x39f204){_0x3557d0=_0x3557d0-0x0;var _0x38d56c=_0xbc1c[_0x3557d0];return _0x38d56c;};'use strict';var _=require(_0xcbc1('0x0'));var util=require(_0xcbc1('0x1'));var logger=require(_0xcbc1('0x2'))(_0xcbc1('0x3'));var moment=require('moment');var BPromise=require(_0xcbc1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbc1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbc1('0x6'));module['exports']=function(_0x533988,_0x2e4f2b){return _0x533988[_0xcbc1('0x7')](_0xcbc1('0x8'),attributes,{'tableName':_0xcbc1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd7ff68,_0x4c23d8,_0x25670e){if(_0xd7ff68[_0xcbc1('0xa')](_0xcbc1('0xb'))){_0xd7ff68['closedAt']=moment()[_0xcbc1('0xc')](_0xcbc1('0xd'));}_0x25670e(null,_0xd7ff68);}}});}; \ No newline at end of file +var _0x5527=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closed','format'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5527,0x111));var _0x7552=function(_0x8d34d4,_0xc6e1cf){_0x8d34d4=_0x8d34d4-0x0;var _0x5ada4a=_0x5527[_0x8d34d4];return _0x5ada4a;};'use strict';var _=require(_0x7552('0x0'));var util=require(_0x7552('0x1'));var logger=require(_0x7552('0x2'))(_0x7552('0x3'));var moment=require(_0x7552('0x4'));var BPromise=require(_0x7552('0x5'));var rp=require(_0x7552('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7552('0x7'));var config=require(_0x7552('0x8'));var attributes=require(_0x7552('0x9'));module[_0x7552('0xa')]=function(_0x1b88ac,_0x5a2349){return _0x1b88ac[_0x7552('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x7552('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42f59f,_0x512ae9,_0x589506){if(_0x42f59f[_0x7552('0xd')](_0x7552('0xe'))){_0x42f59f['closedAt']=moment()[_0x7552('0xf')](_0x7552('0x10'));}_0x589506(null,_0x42f59f);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 747859b..d971a58 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 _0xe75c=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','ids','spread','AddTags'];(function(_0x32e1b0,_0x54f9db){var _0x3198fb=function(_0x48c7a1){while(--_0x48c7a1){_0x32e1b0['push'](_0x32e1b0['shift']());}};_0x3198fb(++_0x54f9db);}(_0xe75c,0x168));var _0xce75=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe75c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xce75('0x0'));var util=require(_0xce75('0x1'));var moment=require(_0xce75('0x2'));var BPromise=require(_0xce75('0x3'));var rs=require(_0xce75('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce75('0x5'))['db'];var utils=require(_0xce75('0x6'));var logger=require(_0xce75('0x7'))('rpc');var config=require(_0xce75('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce75('0x9')][_0xce75('0xa')]({'port':0x232a});config[_0xce75('0xb')]=_['defaults'](config[_0xce75('0xb')],{'host':_0xce75('0xc'),'port':0x18eb});var socket=require(_0xce75('0xd'))(new Redis(config[_0xce75('0xb')]));require(_0xce75('0xe'))[_0xce75('0xf')](socket);function respondWithRpcPromise(_0x2d3b41,_0x46563c,_0x227e5e){return new BPromise(function(_0x1173f0,_0x4bafb8){return client[_0xce75('0x10')](_0x2d3b41,_0x227e5e)[_0xce75('0x11')](function(_0x191586){logger[_0xce75('0x12')](_0xce75('0x13'),_0x46563c,_0xce75('0x14'));logger[_0xce75('0x15')](_0xce75('0x16'),_0x46563c,'request\x20sent',JSON['stringify'](_0x191586));if(_0x191586['error']){if(_0x191586[_0xce75('0x17')][_0xce75('0x18')]===0x1f4){logger[_0xce75('0x17')](_0xce75('0x13'),_0x46563c,_0x191586[_0xce75('0x17')][_0xce75('0x19')]);return _0x4bafb8(_0x191586[_0xce75('0x17')][_0xce75('0x19')]);}logger[_0xce75('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x46563c,_0x191586[_0xce75('0x17')][_0xce75('0x19')]);return _0x1173f0(_0x191586[_0xce75('0x17')]['message']);}else{logger['info'](_0xce75('0x13'),_0x46563c,_0xce75('0x14'));_0x1173f0(_0x191586[_0xce75('0x1a')][_0xce75('0x19')]);}})[_0xce75('0x1b')](function(_0x311e09){logger['error'](_0xce75('0x13'),_0x46563c,_0x311e09);_0x4bafb8(_0x311e09);});});}exports[_0xce75('0x1c')]=function(_0x4fcec2){var _0xb1307e=this;return new Promise(function(_0x4d3fb8,_0x57ee4a){return db['WhatsappInteraction'][_0xce75('0x1d')](_0x4fcec2[_0xce75('0x1e')],{'raw':_0x4fcec2['options']?_0x4fcec2[_0xce75('0x1f')][_0xce75('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fcec2[_0xce75('0x1f')]?_0x4fcec2[_0xce75('0x1f')][_0xce75('0x21')]||null:null,'attributes':_0x4fcec2[_0xce75('0x1f')]?_0x4fcec2[_0xce75('0x1f')][_0xce75('0x22')]||null:null,'limit':_0x4fcec2['options']?_0x4fcec2[_0xce75('0x1f')][_0xce75('0x23')]||null:null})['then'](function(_0x30a432){logger[_0xce75('0x12')]('UpdateWhatsappInteraction',_0x4fcec2);logger['debug'](_0xce75('0x1c'),_0x4fcec2,JSON[_0xce75('0x24')](_0x30a432));_0x4d3fb8(_0x30a432);})['catch'](function(_0x2c2e9a){logger[_0xce75('0x17')](_0xce75('0x1c'),_0x2c2e9a[_0xce75('0x19')],_0x4fcec2);_0x57ee4a(_0xb1307e[_0xce75('0x17')](0x1f4,_0x2c2e9a[_0xce75('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x361fc2){return new Promise(function(_0x3580c0,_0x4d1a7b){return db['WhatsappInteraction']['find']({'where':_0x361fc2[_0xce75('0x1f')]?_0x361fc2['options']['where']||null:null})['then'](function(_0x3dfa05){if(_0x3dfa05){return _0x3dfa05['addTags'](_0x361fc2[_0xce75('0x1e')][_0xce75('0x25')],_['omit'](_0x361fc2['body'],[_0xce75('0x25'),'id'])||{});}})[_0xce75('0x26')](function(_0x2c3393){logger['info'](_0xce75('0x27'),_0x361fc2);logger[_0xce75('0x15')](_0xce75('0x27'),_0x361fc2,JSON[_0xce75('0x24')](_0x2c3393));_0x3580c0(_0x2c3393);})['catch'](function(_0x4c1ddf){logger[_0xce75('0x17')](_0xce75('0x27'),_0x4c1ddf['message'],_0x361fc2);_0x4d1a7b(_this[_0xce75('0x17')](0x1f4,_0x4c1ddf[_0xce75('0x19')]));});});}; \ No newline at end of file +var _0xde96=['AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToWhatsappInteraction','find','body','ids','omit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xde96,0x7f));var _0x6de9=function(_0x11c8a7,_0x3d09f2){_0x11c8a7=_0x11c8a7-0x0;var _0x47573d=_0xde96[_0x11c8a7];return _0x47573d;};'use strict';var _=require(_0x6de9('0x0'));var util=require(_0x6de9('0x1'));var moment=require(_0x6de9('0x2'));var BPromise=require(_0x6de9('0x3'));var rs=require(_0x6de9('0x4'));var fs=require('fs');var Redis=require(_0x6de9('0x5'));var db=require(_0x6de9('0x6'))['db'];var utils=require(_0x6de9('0x7'));var logger=require(_0x6de9('0x8'))(_0x6de9('0x9'));var config=require('../../config/environment');var jayson=require(_0x6de9('0xa'));var client=jayson[_0x6de9('0xb')]['http']({'port':0x232a});config['redis']=_[_0x6de9('0xc')](config[_0x6de9('0xd')],{'host':_0x6de9('0xe'),'port':0x18eb});var socket=require(_0x6de9('0xf'))(new Redis(config['redis']));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3d6bbc,_0xd7aaee,_0x53434b){return new BPromise(function(_0x3fc19e,_0x2f0874){return client[_0x6de9('0x10')](_0x3d6bbc,_0x53434b)[_0x6de9('0x11')](function(_0x19af70){logger[_0x6de9('0x12')](_0x6de9('0x13'),_0xd7aaee,_0x6de9('0x14'));logger['debug'](_0x6de9('0x15'),_0xd7aaee,_0x6de9('0x14'),JSON['stringify'](_0x19af70));if(_0x19af70[_0x6de9('0x16')]){if(_0x19af70['error'][_0x6de9('0x17')]===0x1f4){logger[_0x6de9('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0xd7aaee,_0x19af70[_0x6de9('0x16')][_0x6de9('0x18')]);return _0x2f0874(_0x19af70[_0x6de9('0x16')][_0x6de9('0x18')]);}logger[_0x6de9('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0xd7aaee,_0x19af70['error'][_0x6de9('0x18')]);return _0x3fc19e(_0x19af70['error'][_0x6de9('0x18')]);}else{logger[_0x6de9('0x12')](_0x6de9('0x13'),_0xd7aaee,_0x6de9('0x14'));_0x3fc19e(_0x19af70[_0x6de9('0x19')][_0x6de9('0x18')]);}})[_0x6de9('0x1a')](function(_0xe5383d){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0xd7aaee,_0xe5383d);_0x2f0874(_0xe5383d);});});}exports[_0x6de9('0x1b')]=function(_0x3ca6e9){var _0x4388d5=this;return new Promise(function(_0x584af6,_0x49987c){return db[_0x6de9('0x1c')][_0x6de9('0x1d')](_0x3ca6e9['body'],{'raw':_0x3ca6e9[_0x6de9('0x1e')]?_0x3ca6e9['options'][_0x6de9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ca6e9[_0x6de9('0x1e')]?_0x3ca6e9['options'][_0x6de9('0x20')]||null:null,'attributes':_0x3ca6e9[_0x6de9('0x1e')]?_0x3ca6e9[_0x6de9('0x1e')][_0x6de9('0x21')]||null:null,'limit':_0x3ca6e9[_0x6de9('0x1e')]?_0x3ca6e9[_0x6de9('0x1e')][_0x6de9('0x22')]||null:null})[_0x6de9('0x11')](function(_0x432b02){logger[_0x6de9('0x12')](_0x6de9('0x1b'),_0x3ca6e9);logger['debug'](_0x6de9('0x1b'),_0x3ca6e9,JSON[_0x6de9('0x23')](_0x432b02));_0x584af6(_0x432b02);})['catch'](function(_0x2900fa){logger[_0x6de9('0x16')]('UpdateWhatsappInteraction',_0x2900fa[_0x6de9('0x18')],_0x3ca6e9);_0x49987c(_0x4388d5[_0x6de9('0x16')](0x1f4,_0x2900fa[_0x6de9('0x18')]));});});};exports[_0x6de9('0x24')]=function(_0x41bdb6){return new Promise(function(_0x23e9a5,_0x4e66ee){return db['WhatsappInteraction'][_0x6de9('0x25')]({'where':_0x41bdb6[_0x6de9('0x1e')]?_0x41bdb6[_0x6de9('0x1e')][_0x6de9('0x20')]||null:null})[_0x6de9('0x11')](function(_0x1628a7){if(_0x1628a7){return _0x1628a7['addTags'](_0x41bdb6[_0x6de9('0x26')][_0x6de9('0x27')],_[_0x6de9('0x28')](_0x41bdb6[_0x6de9('0x26')],[_0x6de9('0x27'),'id'])||{});}})['spread'](function(_0x3d1004){logger[_0x6de9('0x12')](_0x6de9('0x29'),_0x41bdb6);logger['debug']('AddTags',_0x41bdb6,JSON[_0x6de9('0x23')](_0x3d1004));_0x23e9a5(_0x3d1004);})[_0x6de9('0x1a')](function(_0x18acb6){logger[_0x6de9('0x16')]('AddTags',_0x18acb6[_0x6de9('0x18')],_0x41bdb6);_0x4e66ee(_this[_0x6de9('0x16')](0x1f4,_0x18acb6[_0x6de9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7cf76eb..7a28f1e 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 _0x86e1=['save','remove','update','emit','removeListener','length','./whatsappInteraction.events'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x86e1,0x1a3));var _0x186e=function(_0x382ab2,_0x44ed9c){_0x382ab2=_0x382ab2-0x0;var _0x2acb7a=_0x86e1[_0x382ab2];return _0x2acb7a;};'use strict';var WhatsappInteractionEvents=require(_0x186e('0x0'));var events=[_0x186e('0x1'),_0x186e('0x2'),_0x186e('0x3')];function createListener(_0x4afc3f,_0x16ec3d){return function(_0x1b857e){_0x16ec3d[_0x186e('0x4')](_0x4afc3f,_0x1b857e);};}function removeListener(_0x4290e7,_0x697e60){return function(){WhatsappInteractionEvents[_0x186e('0x5')](_0x4290e7,_0x697e60);};}exports['register']=function(_0x3b4792){for(var _0x405299=0x0,_0x5032fa=events[_0x186e('0x6')];_0x405299<_0x5032fa;_0x405299++){var _0x3ecb3a=events[_0x405299];var _0x11f591=createListener('whatsappInteraction:'+_0x3ecb3a,_0x3b4792);WhatsappInteractionEvents['on'](_0x3ecb3a,_0x11f591);}}; \ No newline at end of file +var _0x3bc7=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','update','emit'];(function(_0x1534ae,_0x30979e){var _0x5d43ed=function(_0x2758de){while(--_0x2758de){_0x1534ae['push'](_0x1534ae['shift']());}};_0x5d43ed(++_0x30979e);}(_0x3bc7,0xb3));var _0x73bc=function(_0x22b62,_0x10b762){_0x22b62=_0x22b62-0x0;var _0xfe42e2=_0x3bc7[_0x22b62];return _0xfe42e2;};'use strict';var WhatsappInteractionEvents=require(_0x73bc('0x0'));var events=['save','remove',_0x73bc('0x1')];function createListener(_0x523289,_0x5d0806){return function(_0x497b62){_0x5d0806[_0x73bc('0x2')](_0x523289,_0x497b62);};}function removeListener(_0x2d7f10,_0x5c21d2){return function(){WhatsappInteractionEvents[_0x73bc('0x3')](_0x2d7f10,_0x5c21d2);};}exports[_0x73bc('0x4')]=function(_0x543519){for(var _0x56f85e=0x0,_0xf55875=events[_0x73bc('0x5')];_0x56f85e<_0xf55875;_0x56f85e++){var _0xe2f280=events[_0x56f85e];var _0x2ba167=createListener(_0x73bc('0x6')+_0xe2f280,_0x543519);WhatsappInteractionEvents['on'](_0xe2f280,_0x2ba167);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 989682b..e4e4de4 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 _0xce70=['create','status','update','put','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create'];(function(_0x2b4850,_0x1bd7bc){var _0x39ce38=function(_0x32b8e9){while(--_0x32b8e9){_0x2b4850['push'](_0x2b4850['shift']());}};_0x39ce38(++_0x1bd7bc);}(_0xce70,0x10c));var _0x0ce7=function(_0x297fc5,_0x3ffdb2){_0x297fc5=_0x297fc5-0x0;var _0x2aee71=_0xce70[_0x297fc5];return _0x2aee71;};'use strict';var multer=require(_0x0ce7('0x0'));var util=require(_0x0ce7('0x1'));var path=require('path');var timeout=require(_0x0ce7('0x2'));var express=require(_0x0ce7('0x3'));var router=express[_0x0ce7('0x4')]();var fs_extra=require(_0x0ce7('0x5'));var auth=require(_0x0ce7('0x6'));var interaction=require(_0x0ce7('0x7'));var config=require('../../config/environment');var controller=require(_0x0ce7('0x8'));router[_0x0ce7('0x9')]('/',auth[_0x0ce7('0xa')](),controller['index']);router['get']('/describe',auth[_0x0ce7('0xa')](),controller[_0x0ce7('0xb')]);router['get'](_0x0ce7('0xc'),auth['isAuthenticated'](),controller[_0x0ce7('0xd')]);router[_0x0ce7('0xe')]('/',auth[_0x0ce7('0xa')](),interaction[_0x0ce7('0xf')](_0x0ce7('0x10'),_0x0ce7('0x11')),controller[_0x0ce7('0x12')]);router[_0x0ce7('0xe')]('/:id/status',controller[_0x0ce7('0x13')]);router['put'](_0x0ce7('0xc'),auth[_0x0ce7('0xa')](),controller[_0x0ce7('0x14')]);router[_0x0ce7('0x15')]('/:id/accept',auth[_0x0ce7('0xa')](),controller['accept']);router['put'](_0x0ce7('0x16'),auth[_0x0ce7('0xa')](),controller[_0x0ce7('0x17')]);router[_0x0ce7('0x18')]('/:id',auth[_0x0ce7('0xa')](),controller['destroy']);module[_0x0ce7('0x19')]=router; \ No newline at end of file +var _0xf157=['accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put'];(function(_0x5b1d9c,_0x4acf8c){var _0x2c109f=function(_0x52dd0b){while(--_0x52dd0b){_0x5b1d9c['push'](_0x5b1d9c['shift']());}};_0x2c109f(++_0x4acf8c);}(_0xf157,0x1ec));var _0x7f15=function(_0x5ed01b,_0x4e8cd6){_0x5ed01b=_0x5ed01b-0x0;var _0x1e0b70=_0xf157[_0x5ed01b];return _0x1e0b70;};'use strict';var multer=require(_0x7f15('0x0'));var util=require(_0x7f15('0x1'));var path=require(_0x7f15('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f15('0x3'));var router=express[_0x7f15('0x4')]();var fs_extra=require(_0x7f15('0x5'));var auth=require(_0x7f15('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7f15('0x7'));var controller=require('./whatsappMessage.controller');router[_0x7f15('0x8')]('/',auth[_0x7f15('0x9')](),controller[_0x7f15('0xa')]);router['get'](_0x7f15('0xb'),auth[_0x7f15('0x9')](),controller['describe']);router['get'](_0x7f15('0xc'),auth[_0x7f15('0x9')](),controller['show']);router[_0x7f15('0xd')]('/',auth['isAuthenticated'](),interaction[_0x7f15('0xe')](_0x7f15('0xf'),_0x7f15('0x10')),controller[_0x7f15('0x11')]);router[_0x7f15('0xd')](_0x7f15('0x12'),controller[_0x7f15('0x13')]);router[_0x7f15('0x14')]('/:id',auth[_0x7f15('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x7f15('0x9')](),controller[_0x7f15('0x15')]);router[_0x7f15('0x14')](_0x7f15('0x16'),auth['isAuthenticated'](),controller[_0x7f15('0x17')]);router[_0x7f15('0x18')]('/:id',auth[_0x7f15('0x9')](),controller[_0x7f15('0x19')]);module[_0x7f15('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 7c16807..2d12449 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 _0x8d6f=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4f85f2,_0x24a1c3){var _0x3581b2=function(_0x30014d){while(--_0x30014d){_0x4f85f2['push'](_0x4f85f2['shift']());}};_0x3581b2(++_0x24a1c3);}(_0x8d6f,0x1bb));var _0xf8d6=function(_0x4abe61,_0x1ba203){_0x4abe61=_0x4abe61-0x0;var _0x8ac2cf=_0x8d6f[_0x4abe61];return _0x8ac2cf;};'use strict';var Sequelize=require(_0xf8d6('0x0'));module[_0xf8d6('0x1')]={'body':{'type':Sequelize[_0xf8d6('0x2')](_0xf8d6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf8d6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf8d6('0x5')]('in',_0xf8d6('0x6')),'defaultValue':_0xf8d6('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf8d6('0x7')](0xbe)},'phone':{'type':Sequelize[_0xf8d6('0x7')]},'readAt':{'type':Sequelize[_0xf8d6('0x8')]},'secret':{'type':Sequelize[_0xf8d6('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6f0d=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT','medium'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0xd85e0d,_0x3de3de){_0xd85e0d=_0xd85e0d-0x0;var _0x3cd371=_0x6f0d[_0xd85e0d];return _0x3cd371;};'use strict';var Sequelize=require(_0xd6f0('0x0'));module['exports']={'body':{'type':Sequelize[_0xd6f0('0x1')](_0xd6f0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd6f0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6f0('0x4')]('in',_0xd6f0('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd6f0('0x6')](0xbe)},'phone':{'type':Sequelize[_0xd6f0('0x6')]},'readAt':{'type':Sequelize[_0xd6f0('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd6f0('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index b5ace98..72f1a7e 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 _0xaab9=['request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','options','WhatsappMessage','includeAll','include','findAll','show','params','find','create','body','describe','../../config/logger','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','RejectMessage','sequelize','User','email','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','http','then','info','WhatsappMessage,\x20%s,\x20%s'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xaab9,0xf2));var _0x9aab=function(_0x367527,_0x5d15c6){_0x367527=_0x367527-0x0;var _0xf7e3d4=_0xaab9[_0x367527];return _0xf7e3d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9aab('0x0'));var zipdir=require(_0x9aab('0x1'));var jsonpatch=require(_0x9aab('0x2'));var rp=require(_0x9aab('0x3'));var moment=require(_0x9aab('0x4'));var BPromise=require(_0x9aab('0x5'));var Mustache=require('mustache');var util=require(_0x9aab('0x6'));var path=require(_0x9aab('0x7'));var sox=require(_0x9aab('0x8'));var csv=require(_0x9aab('0x9'));var ejs=require(_0x9aab('0xa'));var fs=require('fs');var fs_extra=require(_0x9aab('0xb'));var _=require(_0x9aab('0xc'));var squel=require('squel');var crypto=require(_0x9aab('0xd'));var jsforce=require(_0x9aab('0xe'));var deskjs=require(_0x9aab('0xf'));var toCsv=require(_0x9aab('0x9'));var querystring=require(_0x9aab('0x10'));var Papa=require('papaparse');var Redis=require(_0x9aab('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9aab('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9aab('0x13'));var utils=require(_0x9aab('0x14'));var config=require(_0x9aab('0x15'));var licenseUtil=require(_0x9aab('0x16'));var db=require(_0x9aab('0x17'))['db'];config[_0x9aab('0x18')]=_[_0x9aab('0x19')](config['redis'],{'host':_0x9aab('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9aab('0x18')]));require(_0x9aab('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9aab('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56dc1a,_0x1dbf7f,_0x5b1d56,_0x2227f5){return new BPromise(function(_0x3d9023,_0x410703){var _0xe41259=_0x2227f5||client;return _0xe41259['request'](_0x56dc1a,_0x5b1d56)[_0x9aab('0x1d')](function(_0x32f2b5){logger[_0x9aab('0x1e')](_0x9aab('0x1f'),_0x1dbf7f,_0x9aab('0x20'));logger[_0x9aab('0x21')](_0x9aab('0x22'),_0x1dbf7f,_0x9aab('0x20'),JSON[_0x9aab('0x23')](_0x32f2b5));if(_0x32f2b5[_0x9aab('0x24')]){if(_0x32f2b5[_0x9aab('0x24')][_0x9aab('0x25')]===0x1f4){logger[_0x9aab('0x24')](_0x9aab('0x1f'),_0x1dbf7f,_0x32f2b5[_0x9aab('0x24')][_0x9aab('0x26')]);return _0x410703(_0x32f2b5['error']['message']);}logger[_0x9aab('0x24')](_0x9aab('0x1f'),_0x1dbf7f,_0x32f2b5[_0x9aab('0x24')][_0x9aab('0x26')]);return _0x3d9023(_0x32f2b5[_0x9aab('0x24')][_0x9aab('0x26')]);}else{logger[_0x9aab('0x1e')](_0x9aab('0x1f'),_0x1dbf7f,_0x9aab('0x20'));_0x3d9023(_0x32f2b5['result'][_0x9aab('0x26')]);}})[_0x9aab('0x27')](function(_0x473bee){logger[_0x9aab('0x24')](_0x9aab('0x1f'),_0x1dbf7f,_0x473bee);_0x410703(_0x473bee);});});}function respondWithStatusCode(_0x281f2d,_0x70fb6){_0x70fb6=_0x70fb6||0xcc;return function(_0x3687a5){if(_0x3687a5){return _0x281f2d[_0x9aab('0x28')](_0x70fb6);}return _0x281f2d['status'](_0x70fb6)[_0x9aab('0x29')]();};}function respondWithResult(_0x3d7eb8,_0x5293ad){_0x5293ad=_0x5293ad||0xc8;return function(_0x510826){if(_0x510826){return _0x3d7eb8[_0x9aab('0x2a')](_0x5293ad)[_0x9aab('0x2b')](_0x510826);}};}function respondWithFilteredResult(_0x2db011,_0x2f28c7){return function(_0x174384){if(_0x174384){var _0x1ba050=typeof _0x2f28c7[_0x9aab('0x2c')]===_0x9aab('0x2d')&&typeof _0x2f28c7[_0x9aab('0x2e')]===_0x9aab('0x2d');var _0x2b3119=_0x174384[_0x9aab('0x2f')];var _0x40b7d1=_0x1ba050?0x0:_0x2f28c7[_0x9aab('0x2c')];var _0x21cea8=_0x1ba050?_0x174384[_0x9aab('0x2f')]:_0x2f28c7['offset']+_0x2f28c7[_0x9aab('0x2e')];var _0x6479da;if(_0x21cea8>=_0x2b3119){_0x21cea8=_0x2b3119;_0x6479da=0xc8;}else{_0x6479da=0xce;}_0x2db011[_0x9aab('0x2a')](_0x6479da);return _0x2db011[_0x9aab('0x30')](_0x9aab('0x31'),_0x40b7d1+'-'+_0x21cea8+'/'+_0x2b3119)['json'](_0x174384);}return null;};}function patchUpdates(_0x4b7dc3){return function(_0x3f9340){try{jsonpatch[_0x9aab('0x32')](_0x3f9340,_0x4b7dc3,!![]);}catch(_0x27a534){return BPromise[_0x9aab('0x33')](_0x27a534);}return _0x3f9340[_0x9aab('0x34')]();};}function saveUpdates(_0x276da3,_0x5e81dd){return function(_0x2f39fd){if(_0x2f39fd){return _0x2f39fd[_0x9aab('0x35')](_0x276da3)['then'](function(_0x3a1eef){return _0x3a1eef;});}return null;};}function removeEntity(_0x141b1b,_0x157345){return function(_0x12d623){if(_0x12d623){return _0x12d623[_0x9aab('0x36')]()[_0x9aab('0x1d')](function(){_0x141b1b[_0x9aab('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54e12e,_0x2eecac){return function(_0xe9d897){if(!_0xe9d897){_0x54e12e[_0x9aab('0x28')](0x194);}return _0xe9d897;};}function handleError(_0x495cc3,_0x3d512c){_0x3d512c=_0x3d512c||0x1f4;return function(_0x7a4f8f){logger[_0x9aab('0x24')](_0x7a4f8f[_0x9aab('0x37')]);if(_0x7a4f8f[_0x9aab('0x38')]){delete _0x7a4f8f['name'];}_0x495cc3[_0x9aab('0x2a')](_0x3d512c)[_0x9aab('0x39')](_0x7a4f8f);};}exports[_0x9aab('0x3a')]=function(_0x1b90c5,_0x518199){var _0x5f1b6f={},_0x159952={},_0x33b76a={'count':0x0,'rows':[]};var _0x475392=_['map'](db['WhatsappMessage'][_0x9aab('0x3b')],function(_0x1c0399){return{'name':_0x1c0399[_0x9aab('0x3c')],'type':_0x1c0399[_0x9aab('0x3d')]['key']};});_0x159952[_0x9aab('0x3e')]=_[_0x9aab('0x3f')](_0x475392,'name');_0x159952['query']=_[_0x9aab('0x40')](_0x1b90c5[_0x9aab('0x41')]);_0x159952[_0x9aab('0x42')]=_[_0x9aab('0x43')](_0x159952[_0x9aab('0x3e')],_0x159952[_0x9aab('0x41')]);_0x5f1b6f['attributes']=_['intersection'](_0x159952[_0x9aab('0x3e')],qs['fields'](_0x1b90c5[_0x9aab('0x41')][_0x9aab('0x44')]));_0x5f1b6f['attributes']=_0x5f1b6f['attributes'][_0x9aab('0x45')]?_0x5f1b6f[_0x9aab('0x46')]:_0x159952[_0x9aab('0x3e')];if(!_0x1b90c5[_0x9aab('0x41')]['hasOwnProperty'](_0x9aab('0x47'))){_0x5f1b6f[_0x9aab('0x2e')]=qs[_0x9aab('0x2e')](_0x1b90c5['query'][_0x9aab('0x2e')]);_0x5f1b6f['offset']=qs[_0x9aab('0x2c')](_0x1b90c5[_0x9aab('0x41')][_0x9aab('0x2c')]);}_0x5f1b6f[_0x9aab('0x48')]=qs[_0x9aab('0x49')](_0x1b90c5['query'][_0x9aab('0x49')]);_0x5f1b6f[_0x9aab('0x4a')]=qs[_0x9aab('0x42')](_[_0x9aab('0x4b')](_0x1b90c5['query'],_0x159952[_0x9aab('0x42')]),_0x475392);if(_0x1b90c5[_0x9aab('0x41')][_0x9aab('0x4c')]){_0x5f1b6f[_0x9aab('0x4a')]=_['merge'](_0x5f1b6f[_0x9aab('0x4a')],{'$or':_['map'](_0x475392,function(_0x35fded){if(_0x35fded[_0x9aab('0x3d')]!=='VIRTUAL'){var _0x1ca900={};_0x1ca900[_0x35fded['name']]={'$like':'%'+_0x1b90c5[_0x9aab('0x41')]['filter']+'%'};return _0x1ca900;}})});}_0x5f1b6f=_[_0x9aab('0x4d')]({},_0x5f1b6f,_0x1b90c5[_0x9aab('0x4e')]);var _0x28eb72={'where':_0x5f1b6f['where']};return db[_0x9aab('0x4f')][_0x9aab('0x2f')](_0x28eb72)[_0x9aab('0x1d')](function(_0xcbe8c0){_0x33b76a['count']=_0xcbe8c0;if(_0x1b90c5[_0x9aab('0x41')][_0x9aab('0x50')]){_0x5f1b6f[_0x9aab('0x51')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x9aab('0x52')](_0x5f1b6f);})[_0x9aab('0x1d')](function(_0x151450){_0x33b76a['rows']=_0x151450;return _0x33b76a;})[_0x9aab('0x1d')](respondWithFilteredResult(_0x518199,_0x5f1b6f))[_0x9aab('0x27')](handleError(_0x518199,null));};exports[_0x9aab('0x53')]=function(_0x3ee755,_0x15894e){var _0x1e4fd7={'raw':!![],'where':{'id':_0x3ee755[_0x9aab('0x54')]['id']}},_0x4c1dbc={};_0x4c1dbc[_0x9aab('0x3e')]=_[_0x9aab('0x40')](db['WhatsappMessage']['rawAttributes']);_0x4c1dbc[_0x9aab('0x41')]=_[_0x9aab('0x40')](_0x3ee755[_0x9aab('0x41')]);_0x4c1dbc[_0x9aab('0x42')]=_[_0x9aab('0x43')](_0x4c1dbc[_0x9aab('0x3e')],_0x4c1dbc[_0x9aab('0x41')]);_0x1e4fd7[_0x9aab('0x46')]=_[_0x9aab('0x43')](_0x4c1dbc[_0x9aab('0x3e')],qs['fields'](_0x3ee755[_0x9aab('0x41')][_0x9aab('0x44')]));_0x1e4fd7['attributes']=_0x1e4fd7['attributes'][_0x9aab('0x45')]?_0x1e4fd7['attributes']:_0x4c1dbc[_0x9aab('0x3e')];if(_0x3ee755[_0x9aab('0x41')][_0x9aab('0x50')]){_0x1e4fd7['include']=[{'all':!![]}];}_0x1e4fd7=_[_0x9aab('0x4d')]({},_0x1e4fd7,_0x3ee755['options']);return db[_0x9aab('0x4f')][_0x9aab('0x55')](_0x1e4fd7)['then'](handleEntityNotFound(_0x15894e,null))['then'](respondWithResult(_0x15894e,null))[_0x9aab('0x27')](handleError(_0x15894e,null));};exports[_0x9aab('0x56')]=function(_0x499b1b,_0x43b710){return db[_0x9aab('0x4f')][_0x9aab('0x56')](_0x499b1b['body'],{})[_0x9aab('0x1d')](respondWithResult(_0x43b710,0xc9))[_0x9aab('0x27')](handleError(_0x43b710,null));};exports[_0x9aab('0x35')]=function(_0x4d66de,_0x292295){if(_0x4d66de[_0x9aab('0x57')]['id']){delete _0x4d66de[_0x9aab('0x57')]['id'];}return db[_0x9aab('0x4f')][_0x9aab('0x55')]({'where':{'id':_0x4d66de[_0x9aab('0x54')]['id']}})[_0x9aab('0x1d')](handleEntityNotFound(_0x292295,null))[_0x9aab('0x1d')](saveUpdates(_0x4d66de[_0x9aab('0x57')],null))[_0x9aab('0x1d')](respondWithResult(_0x292295,null))['catch'](handleError(_0x292295,null));};exports[_0x9aab('0x36')]=function(_0x3984d1,_0x293703){return db[_0x9aab('0x4f')][_0x9aab('0x55')]({'where':{'id':_0x3984d1[_0x9aab('0x54')]['id']}})[_0x9aab('0x1d')](handleEntityNotFound(_0x293703,null))[_0x9aab('0x1d')](removeEntity(_0x293703,null))['catch'](handleError(_0x293703,null));};exports[_0x9aab('0x58')]=function(_0x4c929d,_0xdd6d06){return db[_0x9aab('0x4f')][_0x9aab('0x58')]()[_0x9aab('0x1d')](respondWithResult(_0xdd6d06,null))[_0x9aab('0x27')](handleError(_0xdd6d06,null));};var interaction_log=require(_0x9aab('0x59'))('whatsapp-interactions');exports[_0x9aab('0x5a')]=function(_0x393a38,_0x2b7fb2,_0x5efcba){var _0xeb3f12={'agent':{},'channel':_0x9aab('0x5b')};if(_0x393a38[_0x9aab('0x57')]['id']){delete _0x393a38[_0x9aab('0x57')]['id'];}_0x393a38[_0x9aab('0x57')][_0x9aab('0x5c')]=!![];_0x393a38[_0x9aab('0x57')][_0x9aab('0x5d')]=moment()[_0x9aab('0x5e')](_0x9aab('0x5f'));_0x393a38['body'][_0x9aab('0x60')]=_0x393a38[_0x9aab('0x57')]['UserId']||_0x393a38[_0x9aab('0x61')]['id'];_0xeb3f12[_0x9aab('0x62')]['id']=_0x393a38[_0x9aab('0x57')][_0x9aab('0x60')];return db[_0x9aab('0x4f')][_0x9aab('0x55')]({'where':{'id':_0x393a38['params']['id'],'UserId':null}})[_0x9aab('0x1d')](handleEntityNotFound(_0x2b7fb2,null))[_0x9aab('0x1d')](saveUpdates(_0x393a38[_0x9aab('0x57')],null))[_0x9aab('0x1d')](function(_0x163799){if(_0x163799){_0xeb3f12[_0x9aab('0x26')]=_0x163799[_0x9aab('0x63')]({'plain':!![]});return db[_0x9aab('0x64')][_0x9aab('0x55')]({'where':{'id':_0x163799[_0x9aab('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x2b7fb2,null))[_0x9aab('0x1d')](function(_0x559052){if(_0x559052){return _0x559052['update']({'UserId':_0x393a38['body'][_0x9aab('0x60')],'read1stAt':_[_0x9aab('0x66')](_0x559052['read1stAt'])?moment()['format'](_0x9aab('0x5f')):undefined});}return null;})['then'](function(_0x2db12b){if(_0x2db12b){_0xeb3f12[_0x9aab('0x67')]=_0x2db12b[_0x9aab('0x63')]({'plain':!![]});interaction_log[_0x9aab('0x1e')](_0x9aab('0x68'),_0x393a38['user']['id'],_0x393a38[_0x9aab('0x61')]['name'],_0x393a38[_0x9aab('0x61')][_0x9aab('0x69')],_0xeb3f12[_0x9aab('0x67')]['id'],_0x393a38['body']?JSON[_0x9aab('0x23')](_0x393a38[_0x9aab('0x57')]):_0x9aab('0x6a'));return respondWithRpcPromise(_0x9aab('0x6b'),_0x9aab('0x6c'),_0xeb3f12);}return null;})['then'](function(_0x5a1cb3){var _0x421cbf=_0x9aab('0x6d')+_0x5a1cb3[_0x9aab('0x26')][_0x9aab('0x6e')];return db['sequelize'][_0x9aab('0x41')](_0x421cbf,{'type':db[_0x9aab('0x6f')][_0x9aab('0x70')][_0x9aab('0x71')],'raw':!![]})[_0x9aab('0x1d')](function(_0x29509e){return _0x29509e;});})['then'](function(_0x3426ff){if(_0x3426ff){_0xeb3f12[_0x9aab('0x26')][_0x9aab('0x72')]=_0x3426ff[0x0];if(!_0x393a38[_0x9aab('0x57')][_0x9aab('0x60')])return;return db['User'][_0x9aab('0x55')]({'where':{'id':_0x393a38[_0x9aab('0x57')][_0x9aab('0x60')],'role':_0x9aab('0x62')},'attributes':['id',_0x9aab('0x38'),'fullname','email',_0x9aab('0x73')],'raw':!![]});}return null;})['then'](function(_0x6a0ca6){if(!_0x6a0ca6)return null;_0xeb3f12[_0x9aab('0x26')]['agent']=_0x6a0ca6;return _0xeb3f12;})[_0x9aab('0x1d')](function(_0xc11643){if(_0xc11643){if(_0x393a38[_0x9aab('0x57')]['manual']){_0xeb3f12[_0x9aab('0x26')][_0x9aab('0x74')]=util['format'](_0x9aab('0x75'),_0x393a38[_0x9aab('0x61')][_0x9aab('0x38')]);_0xeb3f12['message'][_0x9aab('0x76')]=_0xeb3f12[_0x9aab('0x76')];_0xeb3f12[_0x9aab('0x26')][_0x9aab('0x77')]=_0xeb3f12[_0x9aab('0x76')];_0xeb3f12['message'][_0x9aab('0x78')]=_0x9aab('0x5a');return respondWithRpcPromise('EventManager',_0x9aab('0x79'),{'event':_0x9aab('0x7a'),'message':_0xeb3f12[_0x9aab('0x26')]},client9002)[_0x9aab('0x1d')](function(){return _0xeb3f12;});}return _0xeb3f12;}return null;})['then'](respondWithResult(_0x2b7fb2,null))['catch'](handleError(_0x2b7fb2,null));};var interaction_log=require('../../config/logger')(_0x9aab('0x7b'));exports['reject']=function(_0x38036d,_0x5c701f,_0x5ded62){var _0x594825={'agent':{},'channel':_0x9aab('0x5b')};if(_0x38036d[_0x9aab('0x57')]['id']){delete _0x38036d[_0x9aab('0x57')]['id'];}_0x38036d[_0x9aab('0x57')][_0x9aab('0x60')]=_0x38036d[_0x9aab('0x57')][_0x9aab('0x60')]||_0x38036d[_0x9aab('0x61')]['id'];_0x594825[_0x9aab('0x62')]['id']=_0x38036d[_0x9aab('0x57')][_0x9aab('0x60')];return db[_0x9aab('0x4f')][_0x9aab('0x55')]({'where':{'id':_0x38036d[_0x9aab('0x54')]['id'],'UserId':null}})[_0x9aab('0x1d')](handleEntityNotFound(_0x5c701f,null))[_0x9aab('0x1d')](function(_0x350d2f){if(_0x350d2f){_0x594825[_0x9aab('0x26')]=_0x350d2f[_0x9aab('0x63')]({'plain':!![]});return db[_0x9aab('0x64')][_0x9aab('0x55')]({'where':{'id':_0x350d2f[_0x9aab('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5c701f,null))[_0x9aab('0x1d')](function(_0x4b69f6){if(_0x4b69f6){_0x594825[_0x9aab('0x67')]=_0x4b69f6['get']({'plain':!![]});interaction_log[_0x9aab('0x1e')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x38036d[_0x9aab('0x61')]['id'],_0x38036d[_0x9aab('0x61')][_0x9aab('0x38')],_0x38036d[_0x9aab('0x61')][_0x9aab('0x69')],_0x594825[_0x9aab('0x67')]['id'],_0x38036d[_0x9aab('0x57')]?JSON[_0x9aab('0x23')](_0x38036d[_0x9aab('0x57')]):_0x9aab('0x6a'));return respondWithRpcPromise(_0x9aab('0x7c'),'rejectMessage',_0x594825);}return null;})[_0x9aab('0x1d')](function(_0x2b3464){var _0x4af372=_0x9aab('0x6d')+_0x2b3464[_0x9aab('0x26')][_0x9aab('0x6e')];return db[_0x9aab('0x7d')][_0x9aab('0x41')](_0x4af372,{'type':db[_0x9aab('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x9aab('0x1d')](function(_0x358f10){return _0x358f10;});})['then'](function(_0x529700){if(_0x529700){_0x594825[_0x9aab('0x26')][_0x9aab('0x72')]=_0x529700[0x0];if(!_0x38036d[_0x9aab('0x57')]['UserId'])return;return db[_0x9aab('0x7e')][_0x9aab('0x55')]({'where':{'id':_0x38036d[_0x9aab('0x57')][_0x9aab('0x60')],'role':_0x9aab('0x62')},'attributes':['id',_0x9aab('0x38'),'fullname',_0x9aab('0x7f'),_0x9aab('0x73')],'raw':!![]});}return null;})['then'](function(_0xcc77d3){if(!_0xcc77d3)return null;_0x594825[_0x9aab('0x26')][_0x9aab('0x62')]=_0xcc77d3;return _0x594825;})[_0x9aab('0x1d')](function(_0x67bbd5){if(_0x67bbd5){_0x67bbd5[_0x9aab('0x26')]['interface']=util[_0x9aab('0x5e')](_0x9aab('0x75'),_0x38036d[_0x9aab('0x61')][_0x9aab('0x38')]);_0x67bbd5[_0x9aab('0x26')][_0x9aab('0x76')]=_0x594825[_0x9aab('0x76')];_0x67bbd5[_0x9aab('0x26')][_0x9aab('0x77')]=_0x594825[_0x9aab('0x76')];_0x67bbd5[_0x9aab('0x26')][_0x9aab('0x78')]=_0x9aab('0x33');respondWithRpcPromise(_0x9aab('0x79'),'EventManager',{'event':_0x9aab('0x80'),'message':_0x67bbd5[_0x9aab('0x26')]},client9002);return _0x594825;}return null;})[_0x9aab('0x1d')](respondWithResult(_0x5c701f,null))[_0x9aab('0x27')](handleError(_0x5c701f,null));};exports[_0x9aab('0x2a')]=function(_0x3a0155,_0x554771,_0x3df9fc){if(_0x3a0155[_0x9aab('0x57')]['id']){delete _0x3a0155['body']['id'];}var _0x50014f;return db[_0x9aab('0x4f')][_0x9aab('0x55')]({'where':{'id':_0x3a0155[_0x9aab('0x54')]['id']}})[_0x9aab('0x1d')](handleEntityNotFound(_0x554771,null))[_0x9aab('0x1d')](function(_0x22009f){if(_0x22009f){_0x50014f=_0x22009f;return db[_0x9aab('0x81')][_0x9aab('0x55')]({'where':{'id':_0x22009f[_0x9aab('0x82')]}});}})[_0x9aab('0x1d')](handleEntityNotFound(_0x554771,null))[_0x9aab('0x1d')](function(_0x5d3c32){if(_0x5d3c32){logger[_0x9aab('0x21')](_0x9aab('0x83'),_0x9aab('0x2a'),_0x9aab('0x84'),_0x5d3c32[_0x9aab('0x3d')],util['inspect'](_0x3a0155[_0x9aab('0x57')],{'showHidden':![],'depth':null}));switch(_0x5d3c32['type']){case _0x9aab('0x85'):if(_0x3a0155[_0x9aab('0x57')][_0x9aab('0x86')]&&_0x3a0155[_0x9aab('0x57')][_0x9aab('0x86')]===_0x50014f[_0x9aab('0x87')]&&_0x3a0155['body']['MessageStatus']&&_0x3a0155[_0x9aab('0x57')]['MessageStatus']===_0x9aab('0x5c')){return _0x50014f[_0x9aab('0x35')]({'read':!![]});}else{logger[_0x9aab('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x9aab('0x2a'),_0x9aab('0x85'),util[_0x9aab('0x88')](_0x3a0155['body'],{'showHidden':![],'depth':null}));}break;}return _0x50014f;}})[_0x9aab('0x1d')](respondWithResult(_0x554771,null))['catch'](handleError(_0x554771,null));}; \ No newline at end of file +var _0xadd6=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','end','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','type','filter','merge','options','includeAll','include','findAll','rows','params','keys','create','body','find','describe','whatsapp-interactions','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','agent','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','null','rejectMessage','sequelize','QueryTypes','contact','internal','interface','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2b2d9c,_0x53ec41){var _0x18cb78=function(_0x309e44){while(--_0x309e44){_0x2b2d9c['push'](_0x2b2d9c['shift']());}};_0x18cb78(++_0x53ec41);}(_0xadd6,0x77));var _0x6add=function(_0x307df8,_0x5c687c){_0x307df8=_0x307df8-0x0;var _0x2c5855=_0xadd6[_0x307df8];return _0x2c5855;};'use strict';var emlformat=require(_0x6add('0x0'));var rimraf=require(_0x6add('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6add('0x2'));var rp=require(_0x6add('0x3'));var moment=require(_0x6add('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6add('0x5'));var util=require('util');var path=require(_0x6add('0x6'));var sox=require(_0x6add('0x7'));var csv=require(_0x6add('0x8'));var ejs=require(_0x6add('0x9'));var fs=require('fs');var fs_extra=require(_0x6add('0xa'));var _=require(_0x6add('0xb'));var squel=require(_0x6add('0xc'));var crypto=require(_0x6add('0xd'));var jsforce=require(_0x6add('0xe'));var deskjs=require(_0x6add('0xf'));var toCsv=require(_0x6add('0x8'));var querystring=require('querystring');var Papa=require(_0x6add('0x10'));var Redis=require(_0x6add('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6add('0x12'));var as=require(_0x6add('0x13'));var hardwareService=require(_0x6add('0x14'));var logger=require(_0x6add('0x15'))('api');var utils=require(_0x6add('0x16'));var config=require(_0x6add('0x17'));var licenseUtil=require(_0x6add('0x18'));var db=require(_0x6add('0x19'))['db'];config[_0x6add('0x1a')]=_[_0x6add('0x1b')](config[_0x6add('0x1a')],{'host':_0x6add('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6add('0x1a')]));require('./whatsappMessage.socket')[_0x6add('0x1d')](socket);var jayson=require(_0x6add('0x1e'));var client=jayson[_0x6add('0x1f')][_0x6add('0x20')]({'port':0x232c});var client9002=jayson[_0x6add('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd32746,_0x476598,_0x10b18e,_0x297e63){return new BPromise(function(_0x460b7b,_0x5b3d66){var _0x7d77f7=_0x297e63||client;return _0x7d77f7[_0x6add('0x21')](_0xd32746,_0x10b18e)[_0x6add('0x22')](function(_0x26674f){logger['info'](_0x6add('0x23'),_0x476598,_0x6add('0x24'));logger[_0x6add('0x25')](_0x6add('0x26'),_0x476598,_0x6add('0x24'),JSON['stringify'](_0x26674f));if(_0x26674f[_0x6add('0x27')]){if(_0x26674f['error'][_0x6add('0x28')]===0x1f4){logger[_0x6add('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x476598,_0x26674f[_0x6add('0x27')][_0x6add('0x29')]);return _0x5b3d66(_0x26674f['error'][_0x6add('0x29')]);}logger[_0x6add('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x476598,_0x26674f[_0x6add('0x27')]['message']);return _0x460b7b(_0x26674f[_0x6add('0x27')][_0x6add('0x29')]);}else{logger[_0x6add('0x2a')](_0x6add('0x23'),_0x476598,'request\x20sent');_0x460b7b(_0x26674f[_0x6add('0x2b')]['message']);}})[_0x6add('0x2c')](function(_0x36a821){logger[_0x6add('0x27')](_0x6add('0x23'),_0x476598,_0x36a821);_0x5b3d66(_0x36a821);});});}function respondWithStatusCode(_0xcffd3d,_0x47fb5d){_0x47fb5d=_0x47fb5d||0xcc;return function(_0x236ca2){if(_0x236ca2){return _0xcffd3d[_0x6add('0x2d')](_0x47fb5d);}return _0xcffd3d[_0x6add('0x2e')](_0x47fb5d)['end']();};}function respondWithResult(_0x448147,_0x425102){_0x425102=_0x425102||0xc8;return function(_0x228252){if(_0x228252){return _0x448147['status'](_0x425102)[_0x6add('0x2f')](_0x228252);}};}function respondWithFilteredResult(_0x1f1aab,_0x3fbd68){return function(_0x204b29){if(_0x204b29){var _0x5bc735=typeof _0x3fbd68['offset']===_0x6add('0x30')&&typeof _0x3fbd68[_0x6add('0x31')]===_0x6add('0x30');var _0x5870dd=_0x204b29[_0x6add('0x32')];var _0x4b1958=_0x5bc735?0x0:_0x3fbd68[_0x6add('0x33')];var _0x4e4d86=_0x5bc735?_0x204b29[_0x6add('0x32')]:_0x3fbd68['offset']+_0x3fbd68['limit'];var _0x34ad04;if(_0x4e4d86>=_0x5870dd){_0x4e4d86=_0x5870dd;_0x34ad04=0xc8;}else{_0x34ad04=0xce;}_0x1f1aab[_0x6add('0x2e')](_0x34ad04);return _0x1f1aab[_0x6add('0x34')](_0x6add('0x35'),_0x4b1958+'-'+_0x4e4d86+'/'+_0x5870dd)[_0x6add('0x2f')](_0x204b29);}return null;};}function patchUpdates(_0x17614c){return function(_0x199dda){try{jsonpatch['apply'](_0x199dda,_0x17614c,!![]);}catch(_0x3f5921){return BPromise[_0x6add('0x36')](_0x3f5921);}return _0x199dda[_0x6add('0x37')]();};}function saveUpdates(_0x4a0686,_0x174adb){return function(_0x16fc67){if(_0x16fc67){return _0x16fc67[_0x6add('0x38')](_0x4a0686)[_0x6add('0x22')](function(_0x3700d2){return _0x3700d2;});}return null;};}function removeEntity(_0x2a36a9,_0x252cbf){return function(_0x417b3a){if(_0x417b3a){return _0x417b3a[_0x6add('0x39')]()['then'](function(){_0x2a36a9[_0x6add('0x2e')](0xcc)[_0x6add('0x3a')]();});}};}function handleEntityNotFound(_0x2b2231,_0x49fb2c){return function(_0x49bd02){if(!_0x49bd02){_0x2b2231[_0x6add('0x2d')](0x194);}return _0x49bd02;};}function handleError(_0x251934,_0x3b0e60){_0x3b0e60=_0x3b0e60||0x1f4;return function(_0x13ec17){logger[_0x6add('0x27')](_0x13ec17[_0x6add('0x3b')]);if(_0x13ec17[_0x6add('0x3c')]){delete _0x13ec17[_0x6add('0x3c')];}_0x251934[_0x6add('0x2e')](_0x3b0e60)['send'](_0x13ec17);};}exports[_0x6add('0x3d')]=function(_0x5b9e4e,_0x12bc23){var _0x29e146={},_0x13c504={},_0x2768aa={'count':0x0,'rows':[]};var _0x40b636=_[_0x6add('0x3e')](db[_0x6add('0x3f')][_0x6add('0x40')],function(_0x24823c){return{'name':_0x24823c[_0x6add('0x41')],'type':_0x24823c['type'][_0x6add('0x42')]};});_0x13c504['model']=_[_0x6add('0x3e')](_0x40b636,_0x6add('0x3c'));_0x13c504[_0x6add('0x43')]=_['keys'](_0x5b9e4e[_0x6add('0x43')]);_0x13c504[_0x6add('0x44')]=_[_0x6add('0x45')](_0x13c504[_0x6add('0x46')],_0x13c504['query']);_0x29e146[_0x6add('0x47')]=_[_0x6add('0x45')](_0x13c504[_0x6add('0x46')],qs[_0x6add('0x48')](_0x5b9e4e[_0x6add('0x43')][_0x6add('0x48')]));_0x29e146[_0x6add('0x47')]=_0x29e146[_0x6add('0x47')][_0x6add('0x49')]?_0x29e146['attributes']:_0x13c504[_0x6add('0x46')];if(!_0x5b9e4e['query'][_0x6add('0x4a')](_0x6add('0x4b'))){_0x29e146[_0x6add('0x31')]=qs['limit'](_0x5b9e4e[_0x6add('0x43')]['limit']);_0x29e146['offset']=qs[_0x6add('0x33')](_0x5b9e4e['query'][_0x6add('0x33')]);}_0x29e146[_0x6add('0x4c')]=qs['sort'](_0x5b9e4e[_0x6add('0x43')]['sort']);_0x29e146[_0x6add('0x4d')]=qs[_0x6add('0x44')](_[_0x6add('0x4e')](_0x5b9e4e[_0x6add('0x43')],_0x13c504['filters']),_0x40b636);if(_0x5b9e4e[_0x6add('0x43')]['filter']){_0x29e146[_0x6add('0x4d')]=_['merge'](_0x29e146[_0x6add('0x4d')],{'$or':_[_0x6add('0x3e')](_0x40b636,function(_0x3d04ce){if(_0x3d04ce[_0x6add('0x4f')]!=='VIRTUAL'){var _0x23daa6={};_0x23daa6[_0x3d04ce['name']]={'$like':'%'+_0x5b9e4e[_0x6add('0x43')][_0x6add('0x50')]+'%'};return _0x23daa6;}})});}_0x29e146=_[_0x6add('0x51')]({},_0x29e146,_0x5b9e4e[_0x6add('0x52')]);var _0x5a2747={'where':_0x29e146[_0x6add('0x4d')]};return db['WhatsappMessage'][_0x6add('0x32')](_0x5a2747)[_0x6add('0x22')](function(_0x1f8abc){_0x2768aa['count']=_0x1f8abc;if(_0x5b9e4e[_0x6add('0x43')][_0x6add('0x53')]){_0x29e146[_0x6add('0x54')]=[{'all':!![]}];}return db[_0x6add('0x3f')][_0x6add('0x55')](_0x29e146);})[_0x6add('0x22')](function(_0x27e005){_0x2768aa[_0x6add('0x56')]=_0x27e005;return _0x2768aa;})[_0x6add('0x22')](respondWithFilteredResult(_0x12bc23,_0x29e146))['catch'](handleError(_0x12bc23,null));};exports['show']=function(_0x2d12c8,_0x5d61bd){var _0x2b5b74={'raw':!![],'where':{'id':_0x2d12c8[_0x6add('0x57')]['id']}},_0x4a5e7b={};_0x4a5e7b['model']=_[_0x6add('0x58')](db[_0x6add('0x3f')][_0x6add('0x40')]);_0x4a5e7b['query']=_[_0x6add('0x58')](_0x2d12c8[_0x6add('0x43')]);_0x4a5e7b[_0x6add('0x44')]=_[_0x6add('0x45')](_0x4a5e7b[_0x6add('0x46')],_0x4a5e7b['query']);_0x2b5b74[_0x6add('0x47')]=_['intersection'](_0x4a5e7b[_0x6add('0x46')],qs[_0x6add('0x48')](_0x2d12c8[_0x6add('0x43')][_0x6add('0x48')]));_0x2b5b74[_0x6add('0x47')]=_0x2b5b74[_0x6add('0x47')][_0x6add('0x49')]?_0x2b5b74['attributes']:_0x4a5e7b[_0x6add('0x46')];if(_0x2d12c8['query'][_0x6add('0x53')]){_0x2b5b74[_0x6add('0x54')]=[{'all':!![]}];}_0x2b5b74=_[_0x6add('0x51')]({},_0x2b5b74,_0x2d12c8['options']);return db[_0x6add('0x3f')]['find'](_0x2b5b74)['then'](handleEntityNotFound(_0x5d61bd,null))[_0x6add('0x22')](respondWithResult(_0x5d61bd,null))[_0x6add('0x2c')](handleError(_0x5d61bd,null));};exports[_0x6add('0x59')]=function(_0x5da60a,_0x41e941){return db[_0x6add('0x3f')][_0x6add('0x59')](_0x5da60a[_0x6add('0x5a')],{})[_0x6add('0x22')](respondWithResult(_0x41e941,0xc9))[_0x6add('0x2c')](handleError(_0x41e941,null));};exports['update']=function(_0x406879,_0x2d3de1){if(_0x406879[_0x6add('0x5a')]['id']){delete _0x406879[_0x6add('0x5a')]['id'];}return db[_0x6add('0x3f')][_0x6add('0x5b')]({'where':{'id':_0x406879[_0x6add('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d3de1,null))['then'](saveUpdates(_0x406879[_0x6add('0x5a')],null))[_0x6add('0x22')](respondWithResult(_0x2d3de1,null))['catch'](handleError(_0x2d3de1,null));};exports[_0x6add('0x39')]=function(_0x111137,_0x4a8988){return db[_0x6add('0x3f')][_0x6add('0x5b')]({'where':{'id':_0x111137['params']['id']}})[_0x6add('0x22')](handleEntityNotFound(_0x4a8988,null))[_0x6add('0x22')](removeEntity(_0x4a8988,null))[_0x6add('0x2c')](handleError(_0x4a8988,null));};exports['describe']=function(_0x263384,_0x120acf){return db['WhatsappMessage'][_0x6add('0x5c')]()[_0x6add('0x22')](respondWithResult(_0x120acf,null))[_0x6add('0x2c')](handleError(_0x120acf,null));};var interaction_log=require('../../config/logger')(_0x6add('0x5d'));exports['accept']=function(_0x330a84,_0x161563,_0x9bd511){var _0xc3ba7b={'agent':{},'channel':_0x6add('0x5e')};if(_0x330a84['body']['id']){delete _0x330a84[_0x6add('0x5a')]['id'];}_0x330a84[_0x6add('0x5a')]['read']=!![];_0x330a84[_0x6add('0x5a')][_0x6add('0x5f')]=moment()[_0x6add('0x60')](_0x6add('0x61'));_0x330a84['body'][_0x6add('0x62')]=_0x330a84[_0x6add('0x5a')][_0x6add('0x62')]||_0x330a84[_0x6add('0x63')]['id'];_0xc3ba7b['agent']['id']=_0x330a84[_0x6add('0x5a')]['UserId'];return db[_0x6add('0x3f')][_0x6add('0x5b')]({'where':{'id':_0x330a84[_0x6add('0x57')]['id'],'UserId':null}})[_0x6add('0x22')](handleEntityNotFound(_0x161563,null))[_0x6add('0x22')](saveUpdates(_0x330a84[_0x6add('0x5a')],null))['then'](function(_0x5ad182){if(_0x5ad182){_0xc3ba7b[_0x6add('0x29')]=_0x5ad182[_0x6add('0x64')]({'plain':!![]});return db[_0x6add('0x65')][_0x6add('0x5b')]({'where':{'id':_0x5ad182[_0x6add('0x66')]}});}return null;})[_0x6add('0x22')](handleEntityNotFound(_0x161563,null))[_0x6add('0x22')](function(_0x2fc77c){if(_0x2fc77c){return _0x2fc77c[_0x6add('0x38')]({'UserId':_0x330a84[_0x6add('0x5a')]['UserId'],'read1stAt':_[_0x6add('0x67')](_0x2fc77c[_0x6add('0x68')])?moment()[_0x6add('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6add('0x22')](function(_0x42c22a){if(_0x42c22a){_0xc3ba7b[_0x6add('0x69')]=_0x42c22a['get']({'plain':!![]});interaction_log[_0x6add('0x2a')](_0x6add('0x6a'),_0x330a84[_0x6add('0x63')]['id'],_0x330a84[_0x6add('0x63')][_0x6add('0x3c')],_0x330a84[_0x6add('0x63')][_0x6add('0x6b')],_0xc3ba7b[_0x6add('0x69')]['id'],_0x330a84[_0x6add('0x5a')]?JSON[_0x6add('0x6c')](_0x330a84[_0x6add('0x5a')]):'null');return respondWithRpcPromise(_0x6add('0x6d'),_0x6add('0x6e'),_0xc3ba7b);}return null;})[_0x6add('0x22')](function(_0x3b8c7c){var _0x515afc=_0x6add('0x6f')+_0x3b8c7c[_0x6add('0x29')][_0x6add('0x70')];return db['sequelize'][_0x6add('0x43')](_0x515afc,{'type':db[_0x6add('0x71')]['QueryTypes'][_0x6add('0x72')],'raw':!![]})['then'](function(_0xfe4eac){return _0xfe4eac;});})[_0x6add('0x22')](function(_0x2d8a9e){if(_0x2d8a9e){_0xc3ba7b['message']['contact']=_0x2d8a9e[0x0];if(!_0x330a84[_0x6add('0x5a')][_0x6add('0x62')])return;return db['User'][_0x6add('0x5b')]({'where':{'id':_0x330a84['body'][_0x6add('0x62')],'role':_0x6add('0x73')},'attributes':['id',_0x6add('0x3c'),'fullname',_0x6add('0x74'),'internal'],'raw':!![]});}return null;})[_0x6add('0x22')](function(_0x2863a6){if(!_0x2863a6)return null;_0xc3ba7b[_0x6add('0x29')]['agent']=_0x2863a6;return _0xc3ba7b;})[_0x6add('0x22')](function(_0x2b9e7c){if(_0x2b9e7c){if(_0x330a84['body'][_0x6add('0x75')]){_0xc3ba7b[_0x6add('0x29')]['interface']=util['format'](_0x6add('0x76'),_0x330a84[_0x6add('0x63')][_0x6add('0x3c')]);_0xc3ba7b[_0x6add('0x29')]['channel']=_0xc3ba7b[_0x6add('0x77')];_0xc3ba7b[_0x6add('0x29')][_0x6add('0x78')]=_0xc3ba7b[_0x6add('0x77')];_0xc3ba7b['message'][_0x6add('0x79')]='accept';return respondWithRpcPromise('EventManager',_0x6add('0x7a'),{'event':_0x6add('0x7b'),'message':_0xc3ba7b[_0x6add('0x29')]},client9002)['then'](function(){return _0xc3ba7b;});}return _0xc3ba7b;}return null;})[_0x6add('0x22')](respondWithResult(_0x161563,null))[_0x6add('0x2c')](handleError(_0x161563,null));};var interaction_log=require(_0x6add('0x15'))('whatsapp-interactions');exports[_0x6add('0x36')]=function(_0xa09884,_0xaca7a1,_0x31eeeb){var _0x3627c5={'agent':{},'channel':_0x6add('0x5e')};if(_0xa09884['body']['id']){delete _0xa09884['body']['id'];}_0xa09884[_0x6add('0x5a')]['UserId']=_0xa09884[_0x6add('0x5a')][_0x6add('0x62')]||_0xa09884[_0x6add('0x63')]['id'];_0x3627c5['agent']['id']=_0xa09884[_0x6add('0x5a')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0xa09884[_0x6add('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xaca7a1,null))[_0x6add('0x22')](function(_0x2c9022){if(_0x2c9022){_0x3627c5['message']=_0x2c9022['get']({'plain':!![]});return db[_0x6add('0x65')]['find']({'where':{'id':_0x2c9022[_0x6add('0x66')]}});}return null;})[_0x6add('0x22')](handleEntityNotFound(_0xaca7a1,null))['then'](function(_0x23b55a){if(_0x23b55a){_0x3627c5['interaction']=_0x23b55a['get']({'plain':!![]});interaction_log[_0x6add('0x2a')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa09884[_0x6add('0x63')]['id'],_0xa09884[_0x6add('0x63')][_0x6add('0x3c')],_0xa09884[_0x6add('0x63')][_0x6add('0x6b')],_0x3627c5['interaction']['id'],_0xa09884[_0x6add('0x5a')]?JSON[_0x6add('0x6c')](_0xa09884[_0x6add('0x5a')]):_0x6add('0x7c'));return respondWithRpcPromise('RejectMessage',_0x6add('0x7d'),_0x3627c5);}return null;})[_0x6add('0x22')](function(_0xd73b98){var _0x26f1ae=_0x6add('0x6f')+_0xd73b98[_0x6add('0x29')][_0x6add('0x70')];return db[_0x6add('0x7e')][_0x6add('0x43')](_0x26f1ae,{'type':db[_0x6add('0x71')][_0x6add('0x7f')]['SELECT'],'raw':!![]})[_0x6add('0x22')](function(_0x28b8cd){return _0x28b8cd;});})[_0x6add('0x22')](function(_0x296811){if(_0x296811){_0x3627c5[_0x6add('0x29')][_0x6add('0x80')]=_0x296811[0x0];if(!_0xa09884[_0x6add('0x5a')][_0x6add('0x62')])return;return db['User'][_0x6add('0x5b')]({'where':{'id':_0xa09884['body']['UserId'],'role':'agent'},'attributes':['id',_0x6add('0x3c'),'fullname',_0x6add('0x74'),_0x6add('0x81')],'raw':!![]});}return null;})[_0x6add('0x22')](function(_0x234072){if(!_0x234072)return null;_0x3627c5[_0x6add('0x29')][_0x6add('0x73')]=_0x234072;return _0x3627c5;})[_0x6add('0x22')](function(_0xd8f2e8){if(_0xd8f2e8){_0xd8f2e8['message'][_0x6add('0x82')]=util[_0x6add('0x60')]('SIP/%s',_0xa09884[_0x6add('0x63')][_0x6add('0x3c')]);_0xd8f2e8[_0x6add('0x29')][_0x6add('0x77')]=_0x3627c5[_0x6add('0x77')];_0xd8f2e8[_0x6add('0x29')][_0x6add('0x78')]=_0x3627c5[_0x6add('0x77')];_0xd8f2e8[_0x6add('0x29')][_0x6add('0x79')]='reject';respondWithRpcPromise(_0x6add('0x7a'),_0x6add('0x7a'),{'event':_0x6add('0x83'),'message':_0xd8f2e8[_0x6add('0x29')]},client9002);return _0x3627c5;}return null;})[_0x6add('0x22')](respondWithResult(_0xaca7a1,null))[_0x6add('0x2c')](handleError(_0xaca7a1,null));};exports[_0x6add('0x2e')]=function(_0x1bcf76,_0x4d74db,_0x6e48bc){if(_0x1bcf76[_0x6add('0x5a')]['id']){delete _0x1bcf76[_0x6add('0x5a')]['id'];}var _0x1b085e;return db['WhatsappMessage'][_0x6add('0x5b')]({'where':{'id':_0x1bcf76['params']['id']}})[_0x6add('0x22')](handleEntityNotFound(_0x4d74db,null))[_0x6add('0x22')](function(_0x2a8b47){if(_0x2a8b47){_0x1b085e=_0x2a8b47;return db['WhatsappAccount'][_0x6add('0x5b')]({'where':{'id':_0x2a8b47[_0x6add('0x84')]}});}})['then'](handleEntityNotFound(_0x4d74db,null))['then'](function(_0x28cc35){if(_0x28cc35){logger[_0x6add('0x25')](_0x6add('0x85'),_0x6add('0x2e'),'received\x20delivery\x20report\x20from',_0x28cc35[_0x6add('0x4f')],util[_0x6add('0x86')](_0x1bcf76[_0x6add('0x5a')],{'showHidden':![],'depth':null}));switch(_0x28cc35['type']){case _0x6add('0x87'):if(_0x1bcf76['body'][_0x6add('0x88')]&&_0x1bcf76['body'][_0x6add('0x88')]===_0x1b085e[_0x6add('0x89')]&&_0x1bcf76[_0x6add('0x5a')][_0x6add('0x8a')]&&_0x1bcf76[_0x6add('0x5a')][_0x6add('0x8a')]==='read'){return _0x1b085e[_0x6add('0x38')]({'read':!![]});}else{logger[_0x6add('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x6add('0x2e'),_0x6add('0x87'),util[_0x6add('0x86')](_0x1bcf76[_0x6add('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x1b085e;}})[_0x6add('0x22')](respondWithResult(_0x4d74db,null))[_0x6add('0x2c')](handleError(_0x4d74db,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 4710eb6..12abde8 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 _0x7794=['save','remove','hasOwnProperty','hook','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x7794,0x7b));var _0x4779=function(_0xc0cfb4,_0x1418b5){_0xc0cfb4=_0xc0cfb4-0x0;var _0x5b08b8=_0x7794[_0xc0cfb4];return _0x5b08b8;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x4779('0x0'))['db'][_0x4779('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4779('0x2')](0x0);var events={'afterCreate':_0x4779('0x3'),'afterUpdate':'update','afterDestroy':_0x4779('0x4')};function emitEvent(_0x1e9fdc){return function(_0x4d3b05,_0x40e5f9,_0x54dc7f){WhatsappMessageEvents['emit'](_0x1e9fdc+':'+_0x4d3b05['id'],_0x4d3b05);WhatsappMessageEvents['emit'](_0x1e9fdc,_0x4d3b05);_0x54dc7f(null);};}for(var e in events){if(events[_0x4779('0x5')](e)){var event=events[e];WhatsappMessage[_0x4779('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x282b=['save','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x4d4f84,_0x447972){var _0x486c2f=function(_0x17ca34){while(--_0x17ca34){_0x4d4f84['push'](_0x4d4f84['shift']());}};_0x486c2f(++_0x447972);}(_0x282b,0xec));var _0xb282=function(_0x446460,_0x159747){_0x446460=_0x446460-0x0;var _0x259a42=_0x282b[_0x446460];return _0x259a42;};'use strict';var EventEmitter=require(_0xb282('0x0'));var WhatsappMessage=require(_0xb282('0x1'))['db'][_0xb282('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb282('0x3')](0x0);var events={'afterCreate':_0xb282('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x25d77d){return function(_0x5cadd7,_0x3fbbaf,_0x175c83){WhatsappMessageEvents[_0xb282('0x5')](_0x25d77d+':'+_0x5cadd7['id'],_0x5cadd7);WhatsappMessageEvents[_0xb282('0x5')](_0x25d77d,_0x5cadd7);_0x175c83(null);};}for(var e in events){if(events[_0xb282('0x6')](e)){var event=events[e];WhatsappMessage[_0xb282('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index ac70bbe..c6b2603 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 _0x35a6=['catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','update','message_id','err','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','findOne','WhatsappInteractionId','then','createdAt'];(function(_0x4f2ef4,_0x16a4c2){var _0x43352e=function(_0x1ac809){while(--_0x1ac809){_0x4f2ef4['push'](_0x4f2ef4['shift']());}};_0x43352e(++_0x16a4c2);}(_0x35a6,0x1dd));var _0x635a=function(_0x2b1d72,_0x151ac9){_0x2b1d72=_0x2b1d72-0x0;var _0x47d2b3=_0x35a6[_0x2b1d72];return _0x47d2b3;};'use strict';var _=require(_0x635a('0x0'));var util=require(_0x635a('0x1'));var logger=require('../../config/logger')(_0x635a('0x2'));var moment=require(_0x635a('0x3'));var BPromise=require(_0x635a('0x4'));var rp=require(_0x635a('0x5'));var fetch=require(_0x635a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x635a('0x7'));var config=require(_0x635a('0x8'));var attributes=require(_0x635a('0x9'));module[_0x635a('0xa')]=function(_0x346b07,_0x3cc347){return _0x346b07['define'](_0x635a('0xb'),attributes,{'tableName':_0x635a('0xc'),'paranoid':![],'indexes':[{'name':_0x635a('0xd'),'fields':['messageId']},{'name':_0x635a('0xe'),'fields':[_0x635a('0xf')],'type':_0x635a('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x287ce3,_0x192c4b,_0x317ce7){var _0x27c51c=_0x346b07['models'];var _0x3e28f0=_0x287ce3[_0x635a('0x11')]({'plain':!![]});if(_0x3e28f0[_0x635a('0x12')]['toLowerCase']()==='in'||_0x3e28f0[_0x635a('0x12')][_0x635a('0x13')]()===_0x635a('0x14')&&!_0x3e28f0[_0x635a('0x15')]&&!_['isNil'](_0x3e28f0[_0x635a('0x16')])){_0x27c51c['WhatsappInteraction'][_0x635a('0x17')]({'where':{'id':_0x3e28f0[_0x635a('0x18')]}})[_0x635a('0x19')](function(_0xae8064){if(_0xae8064){_0xae8064['update']({'lastMsgAt':_0x3e28f0[_0x635a('0x1a')],'lastMsgDirection':_0x3e28f0[_0x635a('0x12')][_0x635a('0x13')]()});}})[_0x635a('0x1b')](function(_0x2df0d5){console[_0x635a('0x1c')](_0x2df0d5);});}if(_0x3e28f0[_0x635a('0x12')]===_0x635a('0x14')&&!_0x3e28f0[_0x635a('0x15')]){var _0x1f06dd;_0x27c51c[_0x635a('0x1d')]['find']({'where':{'id':_0x3e28f0[_0x635a('0x1e')]},'raw':!![]})['then'](function(_0x450708){_0x1f06dd=_0x450708;if(_0x1f06dd&&_0x1f06dd[_0x635a('0x1f')]){switch(_0x1f06dd['type']){case _0x635a('0x20'):var _0x52b26e=require(_0x635a('0x20'));if(_0x1f06dd[_0x635a('0x21')]&&_0x1f06dd[_0x635a('0x22')]&&_0x1f06dd[_0x635a('0x23')]){var _0x481063=new _0x52b26e(_0x1f06dd['accountSid'],_0x1f06dd[_0x635a('0x22')]);_0x481063['messages'][_0x635a('0x24')]({'body':_0x3e28f0['body'],'to':_0x635a('0x25')+_0x3e28f0[_0x635a('0x23')],'from':_0x635a('0x25')+_0x1f06dd[_0x635a('0x23')],'statusCallback':_0x1f06dd['remote']+_0x635a('0x26')+_0x3e28f0['id']+'/status?token='+_0x1f06dd[_0x635a('0x27')]})[_0x635a('0x19')](function(_0x220c95){if(_0x220c95[_0x635a('0x28')]){return _0x287ce3['update']({'messageId':_0x220c95['sid']});}})[_0x635a('0x1b')](function(_0x10c686){logger[_0x635a('0x1c')](_0x635a('0x29'),'afterCreate','twilio',util['inspect'](_0x10c686,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x635a('0x2a'),_0x635a('0x20'),_0x635a('0x2b'));}break;case'sinch':var _0x536d0c=_0x1f06dd['accountSid'];var _0x25366f=_0x1f06dd[_0x635a('0x22')];var _0x3027ab=_0x1f06dd[_0x635a('0x2c')]+_0x635a('0x2d')+_0x536d0c+_0x635a('0x2e');var _0x11f0b3={'to':[_0x3e28f0['phone']],'message':{'type':'text','text':_0x3e28f0[_0x635a('0xf')]}};var _0x3ad11f={'method':_0x635a('0x2f'),'uri':_0x3027ab,'headers':{'Authorization':_0x635a('0x30')+_0x25366f,'Content-Type':_0x635a('0x31')},'body':_0x11f0b3,'json':!![]};rp(_0x3ad11f)[_0x635a('0x19')](function(_0xedeac0){if(_0xedeac0[_0x635a('0x32')][0x0]['message_id']){return _0x287ce3[_0x635a('0x33')]({'messageId':_0xedeac0[_0x635a('0x32')][0x0][_0x635a('0x34')]});}})[_0x635a('0x1b')](function(_0x31a0d8){logger[_0x635a('0x35')]('WhatsappMessage,\x20%s',_0x31a0d8);});break;}}})['finally'](function(){_0x317ce7();});}else{_0x317ce7();}}},'charset':_0x635a('0x36'),'collate':_0x635a('0x37')});}; \ No newline at end of file +var _0x6ff5=['whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/status?token=','update','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','message_id','statuses','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise','node-fetch','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage'];(function(_0x2987a8,_0x4081f0){var _0x3b9095=function(_0xe5a1fb){while(--_0xe5a1fb){_0x2987a8['push'](_0x2987a8['shift']());}};_0x3b9095(++_0x4081f0);}(_0x6ff5,0xab));var _0x56ff=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6ff5[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x56ff('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x56ff('0x1'));var BPromise=require('bluebird');var rp=require(_0x56ff('0x2'));var fetch=require(_0x56ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56ff('0x4'));var attributes=require(_0x56ff('0x5'));module[_0x56ff('0x6')]=function(_0x3f06be,_0x1f7c30){return _0x3f06be[_0x56ff('0x7')](_0x56ff('0x8'),attributes,{'tableName':_0x56ff('0x9'),'paranoid':![],'indexes':[{'name':_0x56ff('0xa'),'fields':[_0x56ff('0xa')]},{'name':_0x56ff('0xb'),'fields':[_0x56ff('0xc')],'type':_0x56ff('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x291c5c,_0x12a622,_0x2ea094){var _0x7d3fd0=_0x3f06be[_0x56ff('0xe')];var _0x243a54=_0x291c5c[_0x56ff('0xf')]({'plain':!![]});if(_0x243a54[_0x56ff('0x10')][_0x56ff('0x11')]()==='in'||_0x243a54[_0x56ff('0x10')][_0x56ff('0x11')]()===_0x56ff('0x12')&&!_0x243a54[_0x56ff('0x13')]&&!_[_0x56ff('0x14')](_0x243a54[_0x56ff('0x15')])){_0x7d3fd0[_0x56ff('0x16')][_0x56ff('0x17')]({'where':{'id':_0x243a54[_0x56ff('0x18')]}})[_0x56ff('0x19')](function(_0x135b3b){if(_0x135b3b){_0x135b3b['update']({'lastMsgAt':_0x243a54[_0x56ff('0x1a')],'lastMsgDirection':_0x243a54[_0x56ff('0x10')][_0x56ff('0x11')]()});}})[_0x56ff('0x1b')](function(_0x227d5f){console['error'](_0x227d5f);});}if(_0x243a54['direction']===_0x56ff('0x12')&&!_0x243a54[_0x56ff('0x13')]){var _0x5d5c08;_0x7d3fd0[_0x56ff('0x1c')][_0x56ff('0x1d')]({'where':{'id':_0x243a54[_0x56ff('0x1e')]},'raw':!![]})[_0x56ff('0x19')](function(_0x5c4378){_0x5d5c08=_0x5c4378;if(_0x5d5c08&&_0x5d5c08[_0x56ff('0x1f')]){switch(_0x5d5c08['type']){case _0x56ff('0x20'):var _0x474d8d=require(_0x56ff('0x20'));if(_0x5d5c08['accountSid']&&_0x5d5c08[_0x56ff('0x21')]&&_0x5d5c08[_0x56ff('0x22')]){var _0x133d85=new _0x474d8d(_0x5d5c08[_0x56ff('0x23')],_0x5d5c08[_0x56ff('0x21')]);_0x133d85[_0x56ff('0x24')][_0x56ff('0x25')]({'body':_0x243a54[_0x56ff('0xc')],'to':_0x56ff('0x26')+_0x243a54[_0x56ff('0x22')],'from':_0x56ff('0x26')+_0x5d5c08[_0x56ff('0x22')],'statusCallback':_0x5d5c08[_0x56ff('0x27')]+'/api/whatsapp/messages/'+_0x243a54['id']+_0x56ff('0x28')+_0x5d5c08['token']})['then'](function(_0x494055){if(_0x494055['sid']){return _0x291c5c[_0x56ff('0x29')]({'messageId':_0x494055[_0x56ff('0x2a')]});}})[_0x56ff('0x1b')](function(_0x11f3df){logger[_0x56ff('0x2b')](_0x56ff('0x2c'),'afterCreate',_0x56ff('0x20'),util[_0x56ff('0x2d')](_0x11f3df,{'showHidden':![],'depth':null}));});}else{logger[_0x56ff('0x2b')](_0x56ff('0x2c'),_0x56ff('0x2e'),_0x56ff('0x20'),_0x56ff('0x2f'));}break;case _0x56ff('0x30'):var _0x36429f=_0x5d5c08['accountSid'];var _0x347ea4=_0x5d5c08[_0x56ff('0x21')];var _0x24937e=_0x5d5c08[_0x56ff('0x31')]+_0x56ff('0x32')+_0x36429f+_0x56ff('0x33');var _0x2eb700={'to':[_0x243a54['phone']],'message':{'type':'text','text':_0x243a54['body']}};var _0x5b6bdc={'method':_0x56ff('0x34'),'uri':_0x24937e,'headers':{'Authorization':'Bearer\x20'+_0x347ea4,'Content-Type':_0x56ff('0x35')},'body':_0x2eb700,'json':!![]};rp(_0x5b6bdc)[_0x56ff('0x19')](function(_0x11fbf1){if(_0x11fbf1['statuses'][0x0][_0x56ff('0x36')]){return _0x291c5c[_0x56ff('0x29')]({'messageId':_0x11fbf1[_0x56ff('0x37')][0x0]['message_id']});}})[_0x56ff('0x1b')](function(_0x3144ff){logger['err'](_0x56ff('0x38'),_0x3144ff);});break;}}})[_0x56ff('0x39')](function(){_0x2ea094();});}else{_0x2ea094();}}},'charset':_0x56ff('0x3a'),'collate':_0x56ff('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index fc0e785..73fe018 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 _0xcd93=['stringify','code','error','message','result','catch','create','raw','then','CreateWhatsappMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x7320ec,_0x3a3a7f){var _0x3c3b1b=function(_0x5f2536){while(--_0x5f2536){_0x7320ec['push'](_0x7320ec['shift']());}};_0x3c3b1b(++_0x3a3a7f);}(_0xcd93,0x118));var _0x3cd9=function(_0x19beba,_0x1007b6){_0x19beba=_0x19beba-0x0;var _0x19d729=_0xcd93[_0x19beba];return _0x19d729;};'use strict';var _=require('lodash');var util=require(_0x3cd9('0x0'));var moment=require(_0x3cd9('0x1'));var BPromise=require(_0x3cd9('0x2'));var rs=require(_0x3cd9('0x3'));var fs=require('fs');var Redis=require(_0x3cd9('0x4'));var db=require(_0x3cd9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cd9('0x6'))('rpc');var config=require(_0x3cd9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3cd9('0x8')]({'port':0x232a});config[_0x3cd9('0x9')]=_[_0x3cd9('0xa')](config[_0x3cd9('0x9')],{'host':_0x3cd9('0xb'),'port':0x18eb});var socket=require(_0x3cd9('0xc'))(new Redis(config[_0x3cd9('0x9')]));require(_0x3cd9('0xd'))['register'](socket);function respondWithRpcPromise(_0x174a9d,_0x40b862,_0x1ae9de){return new BPromise(function(_0x4abc26,_0x1fc199){return client[_0x3cd9('0xe')](_0x174a9d,_0x1ae9de)['then'](function(_0x19c40a){logger[_0x3cd9('0xf')](_0x3cd9('0x10'),_0x40b862,_0x3cd9('0x11'));logger[_0x3cd9('0x12')](_0x3cd9('0x13'),_0x40b862,_0x3cd9('0x11'),JSON[_0x3cd9('0x14')](_0x19c40a));if(_0x19c40a['error']){if(_0x19c40a['error'][_0x3cd9('0x15')]===0x1f4){logger['error'](_0x3cd9('0x10'),_0x40b862,_0x19c40a[_0x3cd9('0x16')][_0x3cd9('0x17')]);return _0x1fc199(_0x19c40a[_0x3cd9('0x16')]['message']);}logger[_0x3cd9('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x40b862,_0x19c40a[_0x3cd9('0x16')][_0x3cd9('0x17')]);return _0x4abc26(_0x19c40a[_0x3cd9('0x16')][_0x3cd9('0x17')]);}else{logger['info'](_0x3cd9('0x10'),_0x40b862,_0x3cd9('0x11'));_0x4abc26(_0x19c40a[_0x3cd9('0x18')][_0x3cd9('0x17')]);}})[_0x3cd9('0x19')](function(_0x4e54be){logger[_0x3cd9('0x16')](_0x3cd9('0x10'),_0x40b862,_0x4e54be);_0x1fc199(_0x4e54be);});});}exports['CreateWhatsappMessage']=function(_0x281e1e){var _0x361384=this;return new Promise(function(_0x32759c,_0x422b6e){return db['WhatsappMessage'][_0x3cd9('0x1a')](_0x281e1e['body'],{'raw':_0x281e1e['options']?_0x281e1e['options'][_0x3cd9('0x1b')]===undefined?!![]:![]:!![]})[_0x3cd9('0x1c')](function(_0x4a5bc4){logger[_0x3cd9('0xf')](_0x3cd9('0x1d'),_0x281e1e);logger[_0x3cd9('0x12')](_0x3cd9('0x1d'),_0x281e1e,JSON[_0x3cd9('0x14')](_0x4a5bc4));_0x32759c(_0x4a5bc4);})[_0x3cd9('0x19')](function(_0x2868bd){logger[_0x3cd9('0x16')]('CreateWhatsappMessage',_0x2868bd[_0x3cd9('0x17')],_0x281e1e);_0x422b6e(_0x361384[_0x3cd9('0x16')](0x1f4,_0x2868bd[_0x3cd9('0x17')]));});});}; \ No newline at end of file +var _0x3231=['./whatsappMessage.socket','then','info','WhatsappMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','redis','defaults','socket.io-emitter'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x3231,0x1a8));var _0x1323=function(_0x2d4e9a,_0x3634c7){_0x2d4e9a=_0x2d4e9a-0x0;var _0x43f80a=_0x3231[_0x2d4e9a];return _0x43f80a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1323('0x0'));var BPromise=require(_0x1323('0x1'));var rs=require(_0x1323('0x2'));var fs=require('fs');var Redis=require(_0x1323('0x3'));var db=require(_0x1323('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1323('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1323('0x6')][_0x1323('0x7')]({'port':0x232a});config[_0x1323('0x8')]=_[_0x1323('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1323('0xa'))(new Redis(config[_0x1323('0x8')]));require(_0x1323('0xb'))['register'](socket);function respondWithRpcPromise(_0x5de004,_0x4969bb,_0x587883){return new BPromise(function(_0x517697,_0x11ed49){return client['request'](_0x5de004,_0x587883)[_0x1323('0xc')](function(_0x46bd89){logger[_0x1323('0xd')](_0x1323('0xe'),_0x4969bb,'request\x20sent');logger[_0x1323('0xf')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4969bb,'request\x20sent',JSON[_0x1323('0x10')](_0x46bd89));if(_0x46bd89[_0x1323('0x11')]){if(_0x46bd89['error'][_0x1323('0x12')]===0x1f4){logger[_0x1323('0x11')](_0x1323('0xe'),_0x4969bb,_0x46bd89[_0x1323('0x11')][_0x1323('0x13')]);return _0x11ed49(_0x46bd89[_0x1323('0x11')][_0x1323('0x13')]);}logger[_0x1323('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x4969bb,_0x46bd89[_0x1323('0x11')]['message']);return _0x517697(_0x46bd89[_0x1323('0x11')]['message']);}else{logger[_0x1323('0xd')](_0x1323('0xe'),_0x4969bb,_0x1323('0x14'));_0x517697(_0x46bd89[_0x1323('0x15')][_0x1323('0x13')]);}})[_0x1323('0x16')](function(_0x384da3){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4969bb,_0x384da3);_0x11ed49(_0x384da3);});});}exports[_0x1323('0x17')]=function(_0x5eecf4){var _0x2a200e=this;return new Promise(function(_0x394ddf,_0x51b0de){return db[_0x1323('0x18')][_0x1323('0x19')](_0x5eecf4[_0x1323('0x1a')],{'raw':_0x5eecf4['options']?_0x5eecf4[_0x1323('0x1b')][_0x1323('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x50a6f1){logger[_0x1323('0xd')]('CreateWhatsappMessage',_0x5eecf4);logger[_0x1323('0xf')](_0x1323('0x17'),_0x5eecf4,JSON[_0x1323('0x10')](_0x50a6f1));_0x394ddf(_0x50a6f1);})[_0x1323('0x16')](function(_0x48197c){logger[_0x1323('0x11')]('CreateWhatsappMessage',_0x48197c[_0x1323('0x13')],_0x5eecf4);_0x51b0de(_0x2a200e[_0x1323('0x11')](0x1f4,_0x48197c[_0x1323('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 2b44191..5ab9af9 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 _0xc8f4=['length','whatsappMessage:','./whatsappMessage.events','remove','update','emit','register'];(function(_0x5bf992,_0x533b26){var _0x288176=function(_0x55cb59){while(--_0x55cb59){_0x5bf992['push'](_0x5bf992['shift']());}};_0x288176(++_0x533b26);}(_0xc8f4,0x1f3));var _0x4c8f=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0xc8f4[_0x81f000];return _0x337aa2;};'use strict';var WhatsappMessageEvents=require(_0x4c8f('0x0'));var events=['save',_0x4c8f('0x1'),_0x4c8f('0x2')];function createListener(_0x588d64,_0x12a342){return function(_0x2da6bd){_0x12a342[_0x4c8f('0x3')](_0x588d64,_0x2da6bd);};}function removeListener(_0x2144d2,_0xb86e25){return function(){WhatsappMessageEvents['removeListener'](_0x2144d2,_0xb86e25);};}exports[_0x4c8f('0x4')]=function(_0x14b17b){for(var _0x38cdda=0x0,_0x20fb1e=events[_0x4c8f('0x5')];_0x38cdda<_0x20fb1e;_0x38cdda++){var _0x3202cd=events[_0x38cdda];var _0x23860d=createListener(_0x4c8f('0x6')+_0x3202cd,_0x14b17b);WhatsappMessageEvents['on'](_0x3202cd,_0x23860d);}}; \ No newline at end of file +var _0x5005=['remove','update','emit','removeListener','register','length','./whatsappMessage.events','save'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x5005,0x6e));var _0x5500=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x5005[_0xe73080];return _0x12cbc4;};'use strict';var WhatsappMessageEvents=require(_0x5500('0x0'));var events=[_0x5500('0x1'),_0x5500('0x2'),_0x5500('0x3')];function createListener(_0x19602d,_0x2deb43){return function(_0x2a454f){_0x2deb43[_0x5500('0x4')](_0x19602d,_0x2a454f);};}function removeListener(_0x1525f9,_0x32a1e3){return function(){WhatsappMessageEvents[_0x5500('0x5')](_0x1525f9,_0x32a1e3);};}exports[_0x5500('0x6')]=function(_0x2c9175){for(var _0x4c3e84=0x0,_0x215b02=events[_0x5500('0x7')];_0x4c3e84<_0x215b02;_0x4c3e84++){var _0x56e614=events[_0x4c3e84];var _0x5e8bf7=createListener('whatsappMessage:'+_0x56e614,_0x2c9175);WhatsappMessageEvents['on'](_0x56e614,_0x5e8bf7);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 9cbb306..ca9a202 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 _0x8677=['removeTeams','removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','describe','get','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy'];(function(_0x2381a0,_0x59d7ab){var _0x167d20=function(_0x1c8803){while(--_0x1c8803){_0x2381a0['push'](_0x2381a0['shift']());}};_0x167d20(++_0x59d7ab);}(_0x8677,0x1c3));var _0x7867=function(_0x4961d0,_0x4ac68f){_0x4961d0=_0x4961d0-0x0;var _0x4bd2a9=_0x8677[_0x4961d0];return _0x4bd2a9;};'use strict';var multer=require(_0x7867('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7867('0x1'));var express=require('express');var router=express[_0x7867('0x2')]();var fs_extra=require(_0x7867('0x3'));var auth=require(_0x7867('0x4'));var interaction=require(_0x7867('0x5'));var config=require(_0x7867('0x6'));var controller=require(_0x7867('0x7'));router['get']('/',auth[_0x7867('0x8')](),controller[_0x7867('0x9')]);router['get']('/describe',auth[_0x7867('0x8')](),controller[_0x7867('0xa')]);router[_0x7867('0xb')](_0x7867('0xc'),auth[_0x7867('0x8')](),controller[_0x7867('0xd')]);router[_0x7867('0xb')]('/:id/members',auth[_0x7867('0x8')](),controller[_0x7867('0xe')]);router[_0x7867('0xb')](_0x7867('0xf'),auth[_0x7867('0x8')](),controller['getTeams']);router[_0x7867('0xb')](_0x7867('0x10'),auth[_0x7867('0x8')](),controller[_0x7867('0x11')]);router['post']('/',auth[_0x7867('0x8')](),controller[_0x7867('0x12')]);router[_0x7867('0x13')](_0x7867('0xf'),auth[_0x7867('0x8')](),controller[_0x7867('0x14')]);router[_0x7867('0x13')]('/:id/users',auth[_0x7867('0x8')](),controller['addAgents']);router[_0x7867('0x15')](_0x7867('0xc'),auth[_0x7867('0x8')](),controller[_0x7867('0x16')]);router[_0x7867('0x17')](_0x7867('0xc'),auth[_0x7867('0x8')](),controller[_0x7867('0x18')]);router[_0x7867('0x17')](_0x7867('0xf'),auth[_0x7867('0x8')](),controller[_0x7867('0x19')]);router[_0x7867('0x17')](_0x7867('0x10'),auth[_0x7867('0x8')](),controller[_0x7867('0x1a')]);module[_0x7867('0x1b')]=router; \ No newline at end of file +var _0xd065=['index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x4371a7,_0x4809b5){var _0x3cc574=function(_0x5e168d){while(--_0x5e168d){_0x4371a7['push'](_0x4371a7['shift']());}};_0x3cc574(++_0x4809b5);}(_0xd065,0xe2));var _0x5d06=function(_0x2be691,_0x52eb65){_0x2be691=_0x2be691-0x0;var _0x3dcdae=_0xd065[_0x2be691];return _0x3dcdae;};'use strict';var multer=require(_0x5d06('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5d06('0x1')]();var fs_extra=require(_0x5d06('0x2'));var auth=require(_0x5d06('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5d06('0x4'));var controller=require(_0x5d06('0x5'));router[_0x5d06('0x6')]('/',auth[_0x5d06('0x7')](),controller[_0x5d06('0x8')]);router[_0x5d06('0x6')](_0x5d06('0x9'),auth[_0x5d06('0x7')](),controller['describe']);router[_0x5d06('0x6')](_0x5d06('0xa'),auth[_0x5d06('0x7')](),controller['show']);router['get'](_0x5d06('0xb'),auth[_0x5d06('0x7')](),controller[_0x5d06('0xc')]);router[_0x5d06('0x6')](_0x5d06('0xd'),auth['isAuthenticated'](),controller[_0x5d06('0xe')]);router[_0x5d06('0x6')]('/:id/users',auth[_0x5d06('0x7')](),controller[_0x5d06('0xf')]);router[_0x5d06('0x10')]('/',auth[_0x5d06('0x7')](),controller['create']);router['post'](_0x5d06('0xd'),auth['isAuthenticated'](),controller[_0x5d06('0x11')]);router['post'](_0x5d06('0x12'),auth[_0x5d06('0x7')](),controller[_0x5d06('0x13')]);router[_0x5d06('0x14')](_0x5d06('0xa'),auth[_0x5d06('0x7')](),controller['update']);router[_0x5d06('0x15')](_0x5d06('0xa'),auth[_0x5d06('0x7')](),controller[_0x5d06('0x16')]);router[_0x5d06('0x15')](_0x5d06('0xd'),auth[_0x5d06('0x7')](),controller[_0x5d06('0x17')]);router[_0x5d06('0x15')](_0x5d06('0x12'),auth['isAuthenticated'](),controller[_0x5d06('0x18')]);module[_0x5d06('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 10d6472..bc37245 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 _0x6ddd=['name','INTEGER','ENUM','beepall','STRING'];(function(_0x6152e3,_0x4cc665){var _0x329c19=function(_0x2a1784){while(--_0x2a1784){_0x6152e3['push'](_0x6152e3['shift']());}};_0x329c19(++_0x4cc665);}(_0x6ddd,0xae));var _0xd6dd=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6ddd[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd6dd('0x0')],'unique':_0xd6dd('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xd6dd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd6dd('0x3')]('rrmemory',_0xd6dd('0x4'),'roundrobin')},'description':{'type':Sequelize[_0xd6dd('0x0')]}}; \ No newline at end of file +var _0x9bde=['STRING','exports','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x427887,_0x4a37af){var _0x1b4a8b=function(_0x3ccb6d){while(--_0x3ccb6d){_0x427887['push'](_0x427887['shift']());}};_0x1b4a8b(++_0x4a37af);}(_0x9bde,0xe1));var _0xe9bd=function(_0x208a25,_0x37fc04){_0x208a25=_0x208a25-0x0;var _0x1bf66c=_0x9bde[_0x208a25];return _0x1bf66c;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe9bd('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe9bd('0x2')](_0xe9bd('0x3'),_0xe9bd('0x4'),_0xe9bd('0x5'))},'description':{'type':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index a0284ac..9f1cc1d 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 _0x3abf=['from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','hasOwnProperty','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','WhatsappQueues','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','getOptions','WhatsappQueue','include','query','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','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserWhatsappQueue','nolimit','order','sort','where','pick','filter','map','agent','whatsappPause','updatedAt','format','%s/%s','createdAt','getTeams','addTeams','ids','Team','findAll','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId'];(function(_0x47f33a,_0x57c8bd){var _0x1c193b=function(_0x4c04d6){while(--_0x4c04d6){_0x47f33a['push'](_0x47f33a['shift']());}};_0x1c193b(++_0x57c8bd);}(_0x3abf,0x19b));var _0xf3ab=function(_0x23aa74,_0x435c4f){_0x23aa74=_0x23aa74-0x0;var _0x3968a8=_0x3abf[_0x23aa74];return _0x3968a8;};'use strict';var BPromise=require(_0xf3ab('0x0'));var util=require('util');var _=require(_0xf3ab('0x1'));var squel=require(_0xf3ab('0x2'));var Redis=require(_0xf3ab('0x3'));var qs=require(_0xf3ab('0x4'));var logger=require(_0xf3ab('0x5'))(_0xf3ab('0x6'));var config=require(_0xf3ab('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf3ab('0x8')](config[_0xf3ab('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf3ab('0xa'))(new Redis(config[_0xf3ab('0x9')]));require('./whatsappQueue.socket')[_0xf3ab('0xb')](socket);function respondWithStatusCode(_0x8a1d,_0x35fc04){_0x35fc04=_0x35fc04||0xcc;return function(_0x19643e){if(_0x19643e){return _0x8a1d[_0xf3ab('0xc')](_0x35fc04);}return _0x8a1d[_0xf3ab('0xd')](_0x35fc04)[_0xf3ab('0xe')]();};}function respondWithResult(_0xebfb35,_0x4e7db9){_0x4e7db9=_0x4e7db9||0xc8;return function(_0x151953){if(_0x151953){return _0xebfb35[_0xf3ab('0xd')](_0x4e7db9)['json'](_0x151953);}};}function respondWithFilteredResult(_0x1eb4de,_0x5a10d3){return function(_0x50dd5a){if(_0x50dd5a){var _0x483408=typeof _0x5a10d3[_0xf3ab('0xf')]===_0xf3ab('0x10')&&typeof _0x5a10d3[_0xf3ab('0x11')]==='undefined';var _0x4ce079=_0x50dd5a[_0xf3ab('0x12')];var _0x4f3822=_0x483408?0x0:_0x5a10d3[_0xf3ab('0xf')];var _0x151f49=_0x483408?_0x50dd5a[_0xf3ab('0x12')]:_0x5a10d3['offset']+_0x5a10d3['limit'];var _0x35ce72;if(_0x151f49>=_0x4ce079){_0x151f49=_0x4ce079;_0x35ce72=0xc8;}else{_0x35ce72=0xce;}_0x1eb4de['status'](_0x35ce72);return _0x1eb4de[_0xf3ab('0x13')](_0xf3ab('0x14'),_0x4f3822+'-'+_0x151f49+'/'+_0x4ce079)[_0xf3ab('0x15')](_0x50dd5a);}return null;};}function saveUpdates(_0x683e51){return function(_0x21ef55){if(_0x21ef55){return _0x21ef55['update'](_0x683e51)['then'](function(_0x4ee3ce){return _0x4ee3ce;});}return null;};}function removeEntity(_0x3b32d9){return function(_0x5e1943){if(_0x5e1943){return _0x5e1943[_0xf3ab('0x16')]()[_0xf3ab('0x17')](function(){var _0x579f79=_0x5e1943[_0xf3ab('0x18')]({'plain':!![]});var _0x4822fa=_0xf3ab('0x19');return db[_0xf3ab('0x1a')][_0xf3ab('0x16')]({'where':{'type':_0x4822fa,'resourceId':_0x579f79['id']}})[_0xf3ab('0x17')](function(){return _0x5e1943;});})[_0xf3ab('0x17')](function(){_0x3b32d9[_0xf3ab('0xd')](0xcc)[_0xf3ab('0xe')]();});}};}function handleEntityNotFound(_0x456f21){return function(_0xb5f7cc){if(!_0xb5f7cc){_0x456f21['sendStatus'](0x194);}return _0xb5f7cc;};}function handleError(_0x301acf,_0x392c55){_0x392c55=_0x392c55||0x1f4;return function(_0x22407a){logger[_0xf3ab('0x1b')](_0x22407a['stack']);if(_0x22407a['name']){delete _0x22407a[_0xf3ab('0x1c')];}_0x301acf[_0xf3ab('0xd')](_0x392c55)[_0xf3ab('0x1d')](_0x22407a);};}exports[_0xf3ab('0x1e')]=function(_0x2fcc90,_0x3e62cc){var _0x4ce2ad={};var _0x1c207f={'count':0x0,'rows':[]};var _0x26bc50=_['map'](db['WhatsappQueue'][_0xf3ab('0x1f')],function(_0x4ad56f){return{'name':_0x4ad56f[_0xf3ab('0x20')],'type':_0x4ad56f[_0xf3ab('0x21')][_0xf3ab('0x22')]};});_0x4ce2ad=qs[_0xf3ab('0x23')](_0x26bc50,_0x2fcc90);var _0x2b9ed9={'where':_0x4ce2ad['where']};return db[_0xf3ab('0x24')]['count'](_0x2b9ed9)[_0xf3ab('0x17')](function(_0x35c55b){_0x1c207f[_0xf3ab('0x12')]=_0x35c55b;_0x4ce2ad[_0xf3ab('0x25')]=qs[_0xf3ab('0x25')](_0x2fcc90[_0xf3ab('0x26')]);return db['WhatsappQueue']['findAll'](_0x4ce2ad);})['then'](function(_0xf64ff3){_0x1c207f[_0xf3ab('0x27')]=_0xf64ff3;return _0x1c207f;})['then'](respondWithFilteredResult(_0x3e62cc,_0x4ce2ad))[_0xf3ab('0x28')](handleError(_0x3e62cc,null));};exports[_0xf3ab('0x29')]=function(_0x101640,_0x3a294f){var _0x3c57f2={'raw':!![],'where':{'id':_0x101640[_0xf3ab('0x2a')]['id']}},_0x14ca73={};_0x14ca73[_0xf3ab('0x2b')]=_[_0xf3ab('0x2c')](db['WhatsappQueue']['rawAttributes']);_0x14ca73['query']=_[_0xf3ab('0x2c')](_0x101640[_0xf3ab('0x26')]);_0x14ca73[_0xf3ab('0x2d')]=_[_0xf3ab('0x2e')](_0x14ca73[_0xf3ab('0x2b')],_0x14ca73[_0xf3ab('0x26')]);_0x3c57f2[_0xf3ab('0x2f')]=_['intersection'](_0x14ca73['model'],qs[_0xf3ab('0x30')](_0x101640[_0xf3ab('0x26')][_0xf3ab('0x30')]));_0x3c57f2['attributes']=_0x3c57f2[_0xf3ab('0x2f')][_0xf3ab('0x31')]?_0x3c57f2['attributes']:_0x14ca73[_0xf3ab('0x2b')];if(_0x101640[_0xf3ab('0x26')][_0xf3ab('0x32')]){_0x3c57f2['include']=[{'all':!![]}];}_0x3c57f2=_[_0xf3ab('0x33')]({},_0x3c57f2,_0x101640[_0xf3ab('0x34')]);return db[_0xf3ab('0x24')][_0xf3ab('0x35')](_0x3c57f2)[_0xf3ab('0x17')](handleEntityNotFound(_0x3a294f,null))[_0xf3ab('0x17')](respondWithResult(_0x3a294f,null))['catch'](handleError(_0x3a294f,null));};exports['create']=function(_0x499300,_0x11e4e4){return db[_0xf3ab('0x24')][_0xf3ab('0x36')](_0x499300[_0xf3ab('0x37')],{})[_0xf3ab('0x17')](function(_0x56e96c){var _0x297d5e=_0x499300[_0xf3ab('0x38')]['get']({'plain':!![]});if(!_0x297d5e)throw new Error(_0xf3ab('0x39'));if(_0x297d5e[_0xf3ab('0x3a')]==='user'){var _0x5b2065=_0x56e96c[_0xf3ab('0x18')]({'plain':!![]});var _0x59b1d1=_0xf3ab('0x19');return db['UserProfileSection'][_0xf3ab('0x35')]({'where':{'name':_0x59b1d1,'userProfileId':_0x297d5e[_0xf3ab('0x3b')]},'raw':!![]})[_0xf3ab('0x17')](function(_0x1d9575){if(_0x1d9575&&_0x1d9575[_0xf3ab('0x3c')]===0x0){return db[_0xf3ab('0x1a')][_0xf3ab('0x36')]({'name':_0x5b2065[_0xf3ab('0x1c')],'resourceId':_0x5b2065['id'],'type':_0x1d9575[_0xf3ab('0x1c')],'sectionId':_0x1d9575['id']},{})[_0xf3ab('0x17')](function(){return _0x56e96c;});}else{return _0x56e96c;}})[_0xf3ab('0x28')](function(_0x4a5447){logger[_0xf3ab('0x1b')](_0xf3ab('0x3d'),_0x4a5447);throw _0x4a5447;});}return _0x56e96c;})[_0xf3ab('0x17')](respondWithResult(_0x11e4e4,0xc9))[_0xf3ab('0x28')](handleError(_0x11e4e4,null));};exports[_0xf3ab('0x3e')]=function(_0xbafbdd,_0x126290){if(_0xbafbdd['body']['id']){delete _0xbafbdd[_0xf3ab('0x37')]['id'];}return db[_0xf3ab('0x24')][_0xf3ab('0x35')]({'where':{'id':_0xbafbdd[_0xf3ab('0x2a')]['id']}})['then'](handleEntityNotFound(_0x126290,null))[_0xf3ab('0x17')](saveUpdates(_0xbafbdd[_0xf3ab('0x37')],null))['then'](respondWithResult(_0x126290,null))[_0xf3ab('0x28')](handleError(_0x126290,null));};exports[_0xf3ab('0x16')]=function(_0x3138bb,_0x8fce4a){return db[_0xf3ab('0x24')][_0xf3ab('0x35')]({'where':{'id':_0x3138bb[_0xf3ab('0x2a')]['id']}})['then'](handleEntityNotFound(_0x8fce4a,null))[_0xf3ab('0x17')](removeEntity(_0x8fce4a,null))[_0xf3ab('0x28')](handleError(_0x8fce4a,null));};exports['describe']=function(_0x441d6b,_0x10b018){return db['WhatsappQueue'][_0xf3ab('0x3f')]()[_0xf3ab('0x17')](respondWithResult(_0x10b018,null))[_0xf3ab('0x28')](handleError(_0x10b018,null));};exports[_0xf3ab('0x40')]=function(_0x4b19e9,_0x51056b){var _0x574559={'raw':!![],'where':{}},_0x5c6a98={},_0x528de2;return db['WhatsappQueue'][_0xf3ab('0x41')]({'where':{'id':_0x4b19e9[_0xf3ab('0x2a')]['id']}})[_0xf3ab('0x17')](handleEntityNotFound(_0x51056b,null))['then'](function(_0x59cddf){if(_0x59cddf){_0x528de2=_0x59cddf[_0xf3ab('0x18')]({'plain':!![]});_0x5c6a98[_0xf3ab('0x2b')]=_[_0xf3ab('0x2c')](db[_0xf3ab('0x42')][_0xf3ab('0x1f')]);_0x5c6a98['query']=_[_0xf3ab('0x2c')](_0x4b19e9[_0xf3ab('0x26')]);_0x5c6a98[_0xf3ab('0x2d')]=_[_0xf3ab('0x2e')](_0x5c6a98[_0xf3ab('0x2b')],_0x5c6a98['query']);_0x574559['attributes']=_['intersection'](_0x5c6a98[_0xf3ab('0x2b')],qs[_0xf3ab('0x30')](_0x4b19e9['query']['fields']));_0x574559['attributes']=_0x574559[_0xf3ab('0x2f')][_0xf3ab('0x31')]?_0x574559[_0xf3ab('0x2f')]:_0x5c6a98[_0xf3ab('0x2b')];if(!_0x4b19e9[_0xf3ab('0x26')]['hasOwnProperty'](_0xf3ab('0x43'))){_0x574559['limit']=qs[_0xf3ab('0x11')](_0x4b19e9[_0xf3ab('0x26')][_0xf3ab('0x11')]);_0x574559['offset']=qs['offset'](_0x4b19e9['query'][_0xf3ab('0xf')]);}_0x574559[_0xf3ab('0x44')]=qs['sort'](_0x4b19e9['query'][_0xf3ab('0x45')]);_0x574559[_0xf3ab('0x46')]=qs[_0xf3ab('0x2d')](_[_0xf3ab('0x47')](_0x4b19e9[_0xf3ab('0x26')],_0x5c6a98['filters']));_0x574559[_0xf3ab('0x46')]['WhatsappQueueId']=_0x59cddf['id'];if(_0x4b19e9[_0xf3ab('0x26')][_0xf3ab('0x48')]){_0x574559['where']=_[_0xf3ab('0x33')](_0x574559['where'],{'$or':_['map'](_0x574559['attributes'],function(_0x555317){var _0x1419f3={};_0x1419f3[_0x555317]={'$like':'%'+_0x4b19e9[_0xf3ab('0x26')][_0xf3ab('0x48')]+'%'};return _0x1419f3;})});}_0x574559=_['merge']({},_0x574559,_0x4b19e9[_0xf3ab('0x34')]);return db['UserWhatsappQueue']['findAll'](_0x574559);}})[_0xf3ab('0x17')](function(_0x1b0252){if(_0x1b0252){return db['User']['findAndCountAll']({'where':{'id':_[_0xf3ab('0x49')](_0x1b0252,'UserId'),'role':_0xf3ab('0x4a')},'attributes':['id','name',_0xf3ab('0x4b'),_0xf3ab('0x4c'),'createdAt']});}})['then'](function(_0x5e8f23){if(_0x5e8f23){return{'count':_0x5e8f23[_0xf3ab('0x12')],'rows':_[_0xf3ab('0x49')](_0x5e8f23[_0xf3ab('0x27')],function(_0x98d9a6){return{'membername':_0x98d9a6['name'],'UserId':_0x98d9a6['id'],'queue_name':_0x528de2[_0xf3ab('0x1c')],'WhatsappQueueId':_0x528de2['id'],'interface':util[_0xf3ab('0x4d')](_0xf3ab('0x4e'),'SIP',_0x98d9a6[_0xf3ab('0x1c')]),'penalty':0x0,'paused':_0x98d9a6['whatsappPause'],'createdAt':_0x98d9a6[_0xf3ab('0x4f')],'updatedAt':_0x98d9a6[_0xf3ab('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf3ab('0x17')](respondWithFilteredResult(_0x51056b,_0x574559))[_0xf3ab('0x28')](handleError(_0x51056b,null));};exports[_0xf3ab('0x50')]=function(_0x577eb5,_0x580937){var _0x58b1ec={};var _0xea0720={};var _0x43de5b;var _0x37736c;return db[_0xf3ab('0x24')][_0xf3ab('0x41')]({'where':{'id':_0x577eb5['params']['id']}})[_0xf3ab('0x17')](handleEntityNotFound(_0x580937,null))[_0xf3ab('0x17')](function(_0x2e936f){if(_0x2e936f){_0x43de5b=_0x2e936f;_0xea0720[_0xf3ab('0x2b')]=_[_0xf3ab('0x2c')](db['Team'][_0xf3ab('0x1f')]);_0xea0720[_0xf3ab('0x26')]=_[_0xf3ab('0x2c')](_0x577eb5[_0xf3ab('0x26')]);_0xea0720[_0xf3ab('0x2d')]=_[_0xf3ab('0x2e')](_0xea0720['model'],_0xea0720[_0xf3ab('0x26')]);_0x58b1ec[_0xf3ab('0x2f')]=_[_0xf3ab('0x2e')](_0xea0720[_0xf3ab('0x2b')],qs[_0xf3ab('0x30')](_0x577eb5[_0xf3ab('0x26')]['fields']));_0x58b1ec[_0xf3ab('0x2f')]=_0x58b1ec[_0xf3ab('0x2f')][_0xf3ab('0x31')]?_0x58b1ec[_0xf3ab('0x2f')]:_0xea0720[_0xf3ab('0x2b')];_0x58b1ec[_0xf3ab('0x44')]=qs[_0xf3ab('0x45')](_0x577eb5[_0xf3ab('0x26')][_0xf3ab('0x45')]);_0x58b1ec[_0xf3ab('0x46')]=qs[_0xf3ab('0x2d')](_[_0xf3ab('0x47')](_0x577eb5['query'],_0xea0720[_0xf3ab('0x2d')]));if(_0x577eb5[_0xf3ab('0x26')][_0xf3ab('0x48')]){_0x58b1ec['where']=_[_0xf3ab('0x33')](_0x58b1ec[_0xf3ab('0x46')],{'$or':_['map'](_0x58b1ec[_0xf3ab('0x2f')],function(_0x51809e){var _0x3b6b4b={};_0x3b6b4b[_0x51809e]={'$like':'%'+_0x577eb5[_0xf3ab('0x26')][_0xf3ab('0x48')]+'%'};return _0x3b6b4b;})});}_0x58b1ec=_[_0xf3ab('0x33')]({},_0x58b1ec,_0x577eb5['options']);return _0x43de5b[_0xf3ab('0x50')](_0x58b1ec);}})[_0xf3ab('0x17')](function(_0xe7c68f){if(_0xe7c68f){_0x37736c=_0xe7c68f['length'];if(!_0x577eb5['query']['hasOwnProperty'](_0xf3ab('0x43'))){_0x58b1ec[_0xf3ab('0x11')]=qs[_0xf3ab('0x11')](_0x577eb5[_0xf3ab('0x26')][_0xf3ab('0x11')]);_0x58b1ec[_0xf3ab('0xf')]=qs[_0xf3ab('0xf')](_0x577eb5[_0xf3ab('0x26')][_0xf3ab('0xf')]);}return _0x43de5b['getTeams'](_0x58b1ec);}})['then'](function(_0x4afbff){if(_0x4afbff){return _0x4afbff?{'count':_0x37736c,'rows':_0x4afbff}:null;}})[_0xf3ab('0x17')](respondWithResult(_0x580937,null))['catch'](handleError(_0x580937,null));};exports[_0xf3ab('0x51')]=function(_0x55040f,_0x2d7f58){var _0x1efcb8=_0x55040f['body'][_0xf3ab('0x52')];return db[_0xf3ab('0x53')][_0xf3ab('0x54')]({'where':{'id':_0x1efcb8},'attributes':['id'],'include':[{'model':db[_0xf3ab('0x55')],'as':_0xf3ab('0x56'),'attributes':['id','name',_0xf3ab('0x57'),_0xf3ab('0x58'),_0xf3ab('0x59')],'raw':!![]}]})[_0xf3ab('0x17')](function(_0x423173){if(_0x423173){var _0x526fd4=_[_0xf3ab('0x5a')](_0x423173,function(_0x2b90d7){var _0x4c7bf6=_0x2b90d7['get']({'plain':!![]});return _0x4c7bf6[_0xf3ab('0x56')];});return db[_0xf3ab('0x24')][_0xf3ab('0x35')]({'where':{'id':_0x55040f[_0xf3ab('0x2a')]['id']}})[_0xf3ab('0x17')](function(_0x4c2ca8){return db[_0xf3ab('0x5b')][_0xf3ab('0x5c')](function(_0x47e291){return _0x4c2ca8['addTeams'](_0x1efcb8,{'transaction':_0x47e291})[_0xf3ab('0x17')](function(){return BPromise[_0xf3ab('0x5d')](_0x526fd4,function(_0x311320){return db[_0xf3ab('0x42')][_0xf3ab('0x5e')]({'where':{'UserId':_0x311320['id'],'WhatsappQueueId':_0x55040f[_0xf3ab('0x2a')]['id']},'transaction':_0x47e291});});})[_0xf3ab('0x17')](function(){_0x526fd4[_0xf3ab('0x5f')](function(_0x5d578b){socket[_0xf3ab('0x60')](_0xf3ab('0x61'),{'UserId':_0x5d578b['id'],'WhatsappQueueId':_0x4c2ca8['id']});});});});});}})['then'](respondWithStatusCode(_0x2d7f58,null))[_0xf3ab('0x28')](handleError(_0x2d7f58,null));};exports['removeTeams']=function(_0x261ff0,_0x30fd0b){return db[_0xf3ab('0x53')][_0xf3ab('0x54')]({'where':{'id':_0x261ff0[_0xf3ab('0x26')][_0xf3ab('0x52')]},'attributes':['id'],'include':[{'model':db[_0xf3ab('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf3ab('0x17')](handleEntityNotFound(_0x30fd0b,null))[_0xf3ab('0x17')](function(_0x252082){var _0x19927=_['map'](_0x252082,'id');var _0x1fb579=[];var _0x4dbb36=[];var _0x30237e=squel[_0xf3ab('0x62')]();_0x30237e[_0xf3ab('0x63')](_0xf3ab('0x64'))[_0xf3ab('0x65')](_0xf3ab('0x66'),'tq')['join'](_0xf3ab('0x67'),'ut',_0xf3ab('0x68'))[_0xf3ab('0x46')](_0xf3ab('0x69'),_0x261ff0[_0xf3ab('0x2a')]['id']);for(var _0x46bcbc=0x0;_0x46bcbc<_0x252082[_0xf3ab('0x31')];_0x46bcbc+=0x1){let _0x218515=_0x252082[_0x46bcbc];for(var _0x330952=0x0;_0x330952<_0x218515[_0xf3ab('0x56')][_0xf3ab('0x31')];_0x330952+=0x1){let _0x97c926=_0x218515['Agents'][_0x330952];var _0x48ccf3=_0x30237e[_0xf3ab('0x6a')]();_0x48ccf3[_0xf3ab('0x46')](_0xf3ab('0x6b'),_0x97c926['id']);_0x4dbb36[_0xf3ab('0x6c')](db[_0xf3ab('0x5b')][_0xf3ab('0x26')](_0x48ccf3[_0xf3ab('0x6d')](),{'type':db['sequelize'][_0xf3ab('0x6e')][_0xf3ab('0x6f')]})[_0xf3ab('0x17')](function(_0x4da314){if(_0x4da314[_0xf3ab('0x31')]===0x1){return _0x97c926['id'];}else{var _0x2ada76=_[_0xf3ab('0x70')](_[_0xf3ab('0x49')](_0x4da314,_0xf3ab('0x71')),function(_0x11209a){return _[_0xf3ab('0x72')](_0x19927,_0x11209a);});if(_0x2ada76){return _0x97c926['id'];}}}));}}return BPromise[_0xf3ab('0x73')](_0x4dbb36)[_0xf3ab('0x17')](function(_0x31262f){_0x1fb579=_(_0x1fb579)[_0xf3ab('0x74')](_0x31262f)[_0xf3ab('0x75')]()[_0xf3ab('0x76')]();return db[_0xf3ab('0x24')][_0xf3ab('0x35')]({'where':{'id':_0x261ff0[_0xf3ab('0x2a')]['id']}})['then'](function(_0x30e676){return db['sequelize'][_0xf3ab('0x5c')](function(_0x3b921d){return _0x30e676[_0xf3ab('0x77')](_0x261ff0['query'][_0xf3ab('0x52')],{'transaction':_0x3b921d})['then'](function(){if(!_[_0xf3ab('0x78')](_0x1fb579)){return _0x30e676[_0xf3ab('0x79')](_0x1fb579,{'transaction':_0x3b921d});}})[_0xf3ab('0x17')](function(){_0x1fb579[_0xf3ab('0x5f')](function(_0x13b29a){socket['emit'](_0xf3ab('0x7a'),{'UserId':_0x13b29a,'WhatsappQueueId':_0x30e676['id']});});});});});});})[_0xf3ab('0x17')](respondWithStatusCode(_0x30fd0b,null))[_0xf3ab('0x28')](handleError(_0x30fd0b,null));};exports[_0xf3ab('0x7b')]=function(_0x581db6,_0x2be345){return db[_0xf3ab('0x24')][_0xf3ab('0x35')]({'where':{'id':_0x581db6[_0xf3ab('0x2a')]['id']}})[_0xf3ab('0x17')](handleEntityNotFound(_0x2be345,null))[_0xf3ab('0x17')](function(_0x3d0134){if(_0x3d0134){return _0x3d0134['addAgents'](_0x581db6[_0xf3ab('0x37')]['ids'],_[_0xf3ab('0x7c')](_0x581db6[_0xf3ab('0x37')],['ids','id'])||{})[_0xf3ab('0x7d')](function(_0x464dc8){for(var _0x5f2e39=0x0;_0x5f2e39<_0x581db6[_0xf3ab('0x37')]['ids']['length'];_0x5f2e39+=0x1){socket[_0xf3ab('0x60')](_0xf3ab('0x61'),{'UserId':Number(_0x581db6['body']['ids'][_0x5f2e39]),'WhatsappQueueId':Number(_0x581db6[_0xf3ab('0x2a')]['id'])});}return _0x464dc8;});}})[_0xf3ab('0x17')](respondWithResult(_0x2be345,null))[_0xf3ab('0x28')](handleError(_0x2be345,null));};exports[_0xf3ab('0x79')]=function(_0x16f9d9,_0x1f6086){return db[_0xf3ab('0x24')][_0xf3ab('0x35')]({'where':{'id':_0x16f9d9[_0xf3ab('0x2a')]['id']}})[_0xf3ab('0x17')](handleEntityNotFound(_0x1f6086,null))[_0xf3ab('0x17')](function(_0x1db724){if(_0x1db724){return _0x1db724['removeAgents'](_0x16f9d9[_0xf3ab('0x26')][_0xf3ab('0x52')])[_0xf3ab('0x17')](function(){if(_['isArray'](_0x16f9d9[_0xf3ab('0x26')][_0xf3ab('0x52')])){for(var _0x258c78=0x0;_0x258c78<_0x16f9d9['query'][_0xf3ab('0x52')][_0xf3ab('0x31')];_0x258c78+=0x1){socket[_0xf3ab('0x60')](_0xf3ab('0x7a'),{'UserId':Number(_0x16f9d9['query'][_0xf3ab('0x52')][_0x258c78]),'WhatsappQueueId':Number(_0x16f9d9[_0xf3ab('0x2a')]['id'])});}}else{socket[_0xf3ab('0x60')](_0xf3ab('0x7a'),{'UserId':Number(_0x16f9d9['query'][_0xf3ab('0x52')]),'WhatsappQueueId':Number(_0x16f9d9[_0xf3ab('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f6086,null))['catch'](handleError(_0x1f6086,null));};exports[_0xf3ab('0x7e')]=function(_0x5add57,_0x11262a){var _0x1deb40={};var _0x333291={};var _0x54313d;var _0x3fd38e;return db[_0xf3ab('0x24')][_0xf3ab('0x41')]({'where':{'id':_0x5add57[_0xf3ab('0x2a')]['id']}})['then'](handleEntityNotFound(_0x11262a,null))[_0xf3ab('0x17')](function(_0xe45899){if(_0xe45899){_0x54313d=_0xe45899;_0x333291[_0xf3ab('0x2b')]=_[_0xf3ab('0x2c')](db[_0xf3ab('0x55')][_0xf3ab('0x1f')]);_0x333291['query']=_[_0xf3ab('0x2c')](_0x5add57[_0xf3ab('0x26')]);_0x333291[_0xf3ab('0x2d')]=_['intersection'](_0x333291[_0xf3ab('0x2b')],_0x333291['query']);_0x1deb40[_0xf3ab('0x2f')]=_['intersection'](_0x333291[_0xf3ab('0x2b')],qs['fields'](_0x5add57['query'][_0xf3ab('0x30')]));_0x1deb40['attributes']=_0x1deb40['attributes'][_0xf3ab('0x31')]?_0x1deb40[_0xf3ab('0x2f')]:_0x333291['model'];_0x1deb40['order']=qs[_0xf3ab('0x45')](_0x5add57[_0xf3ab('0x26')][_0xf3ab('0x45')]);_0x1deb40[_0xf3ab('0x46')]=qs['filters'](_[_0xf3ab('0x47')](_0x5add57[_0xf3ab('0x26')],_0x333291[_0xf3ab('0x2d')]));if(_0x5add57[_0xf3ab('0x26')][_0xf3ab('0x48')]){_0x1deb40[_0xf3ab('0x46')]=_[_0xf3ab('0x33')](_0x1deb40[_0xf3ab('0x46')],{'$or':_[_0xf3ab('0x49')](_0x1deb40[_0xf3ab('0x2f')],function(_0x132e00){var _0x21068f={};_0x21068f[_0x132e00]={'$like':'%'+_0x5add57['query']['filter']+'%'};return _0x21068f;})});}_0x1deb40=_[_0xf3ab('0x33')]({},_0x1deb40,_0x5add57[_0xf3ab('0x34')]);return _0x54313d[_0xf3ab('0x7e')](_0x1deb40);}})[_0xf3ab('0x17')](function(_0x1a8952){if(_0x1a8952){_0x3fd38e=_0x1a8952['length'];if(!_0x5add57['query'][_0xf3ab('0x7f')](_0xf3ab('0x43'))){_0x1deb40['limit']=qs[_0xf3ab('0x11')](_0x5add57[_0xf3ab('0x26')][_0xf3ab('0x11')]);_0x1deb40[_0xf3ab('0xf')]=qs['offset'](_0x5add57[_0xf3ab('0x26')][_0xf3ab('0xf')]);}return _0x54313d[_0xf3ab('0x7e')](_0x1deb40);}})[_0xf3ab('0x17')](function(_0x407de7){if(_0x407de7){return _0x407de7?{'count':_0x3fd38e,'rows':_0x407de7}:null;}})[_0xf3ab('0x17')](respondWithResult(_0x11262a,null))[_0xf3ab('0x28')](handleError(_0x11262a,null));}; \ No newline at end of file +var _0xc8ea=['ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','limit','undefined','count','Content-Range','json','then','destroy','get','UserProfileResource','end','error','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','includeAll','merge','options','find','create','body','user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','hasOwnProperty','order','sort','filter','UserWhatsappQueue','User','map','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','length','pick','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','compact','transaction','emit','userWhatsappQueue:remove','addAgents','omit','removeAgents','getAgents','nolimit','bluebird','util','lodash','squel'];(function(_0x4df59d,_0x5dad3f){var _0x54a175=function(_0x13eb25){while(--_0x13eb25){_0x4df59d['push'](_0x4df59d['shift']());}};_0x54a175(++_0x5dad3f);}(_0xc8ea,0x15b));var _0xac8e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xc8ea[_0x373dee];return _0x46798f;};'use strict';var BPromise=require(_0xac8e('0x0'));var util=require(_0xac8e('0x1'));var _=require(_0xac8e('0x2'));var squel=require(_0xac8e('0x3'));var Redis=require(_0xac8e('0x4'));var qs=require(_0xac8e('0x5'));var logger=require(_0xac8e('0x6'))('api');var config=require(_0xac8e('0x7'));var db=require('../../mysqldb')['db'];config[_0xac8e('0x8')]=_[_0xac8e('0x9')](config[_0xac8e('0x8')],{'host':_0xac8e('0xa'),'port':0x18eb});var socket=require(_0xac8e('0xb'))(new Redis(config[_0xac8e('0x8')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x5dee8e,_0x2d057d){_0x2d057d=_0x2d057d||0xcc;return function(_0x241526){if(_0x241526){return _0x5dee8e[_0xac8e('0xc')](_0x2d057d);}return _0x5dee8e[_0xac8e('0xd')](_0x2d057d)['end']();};}function respondWithResult(_0x15c7c6,_0x37de79){_0x37de79=_0x37de79||0xc8;return function(_0x50c302){if(_0x50c302){return _0x15c7c6['status'](_0x37de79)['json'](_0x50c302);}};}function respondWithFilteredResult(_0xadbb2c,_0x3c6a24){return function(_0x22e120){if(_0x22e120){var _0x5b7ca2=typeof _0x3c6a24[_0xac8e('0xe')]==='undefined'&&typeof _0x3c6a24[_0xac8e('0xf')]===_0xac8e('0x10');var _0x4fcdd6=_0x22e120['count'];var _0x3bc8aa=_0x5b7ca2?0x0:_0x3c6a24['offset'];var _0xd2e637=_0x5b7ca2?_0x22e120[_0xac8e('0x11')]:_0x3c6a24[_0xac8e('0xe')]+_0x3c6a24[_0xac8e('0xf')];var _0x241529;if(_0xd2e637>=_0x4fcdd6){_0xd2e637=_0x4fcdd6;_0x241529=0xc8;}else{_0x241529=0xce;}_0xadbb2c[_0xac8e('0xd')](_0x241529);return _0xadbb2c['set'](_0xac8e('0x12'),_0x3bc8aa+'-'+_0xd2e637+'/'+_0x4fcdd6)[_0xac8e('0x13')](_0x22e120);}return null;};}function saveUpdates(_0x1e753f){return function(_0x458dcc){if(_0x458dcc){return _0x458dcc['update'](_0x1e753f)[_0xac8e('0x14')](function(_0x3c3412){return _0x3c3412;});}return null;};}function removeEntity(_0x3a479c){return function(_0x2a33c3){if(_0x2a33c3){return _0x2a33c3[_0xac8e('0x15')]()[_0xac8e('0x14')](function(){var _0x33b173=_0x2a33c3[_0xac8e('0x16')]({'plain':!![]});var _0x3b8d1f='WhatsappQueues';return db[_0xac8e('0x17')][_0xac8e('0x15')]({'where':{'type':_0x3b8d1f,'resourceId':_0x33b173['id']}})[_0xac8e('0x14')](function(){return _0x2a33c3;});})[_0xac8e('0x14')](function(){_0x3a479c[_0xac8e('0xd')](0xcc)[_0xac8e('0x18')]();});}};}function handleEntityNotFound(_0x6e91ee){return function(_0x587324){if(!_0x587324){_0x6e91ee[_0xac8e('0xc')](0x194);}return _0x587324;};}function handleError(_0x110073,_0x26ffd8){_0x26ffd8=_0x26ffd8||0x1f4;return function(_0x1c2d3f){logger[_0xac8e('0x19')](_0x1c2d3f['stack']);if(_0x1c2d3f[_0xac8e('0x1a')]){delete _0x1c2d3f[_0xac8e('0x1a')];}_0x110073[_0xac8e('0xd')](_0x26ffd8)[_0xac8e('0x1b')](_0x1c2d3f);};}exports[_0xac8e('0x1c')]=function(_0x15f633,_0x98cd5){var _0x4d0f7c={};var _0x33a5c7={'count':0x0,'rows':[]};var _0x31a054=_['map'](db[_0xac8e('0x1d')][_0xac8e('0x1e')],function(_0x250aa7){return{'name':_0x250aa7[_0xac8e('0x1f')],'type':_0x250aa7[_0xac8e('0x20')][_0xac8e('0x21')]};});_0x4d0f7c=qs[_0xac8e('0x22')](_0x31a054,_0x15f633);var _0x480bc1={'where':_0x4d0f7c[_0xac8e('0x23')]};return db[_0xac8e('0x1d')]['count'](_0x480bc1)['then'](function(_0x1fc606){_0x33a5c7[_0xac8e('0x11')]=_0x1fc606;_0x4d0f7c['include']=qs[_0xac8e('0x24')](_0x15f633[_0xac8e('0x25')]);return db[_0xac8e('0x1d')][_0xac8e('0x26')](_0x4d0f7c);})[_0xac8e('0x14')](function(_0x232bb4){_0x33a5c7[_0xac8e('0x27')]=_0x232bb4;return _0x33a5c7;})[_0xac8e('0x14')](respondWithFilteredResult(_0x98cd5,_0x4d0f7c))[_0xac8e('0x28')](handleError(_0x98cd5,null));};exports[_0xac8e('0x29')]=function(_0x1084dd,_0x216a6f){var _0x2bf640={'raw':!![],'where':{'id':_0x1084dd[_0xac8e('0x2a')]['id']}},_0x266094={};_0x266094['model']=_[_0xac8e('0x2b')](db[_0xac8e('0x1d')][_0xac8e('0x1e')]);_0x266094['query']=_['keys'](_0x1084dd[_0xac8e('0x25')]);_0x266094[_0xac8e('0x2c')]=_[_0xac8e('0x2d')](_0x266094[_0xac8e('0x2e')],_0x266094[_0xac8e('0x25')]);_0x2bf640[_0xac8e('0x2f')]=_[_0xac8e('0x2d')](_0x266094['model'],qs[_0xac8e('0x30')](_0x1084dd[_0xac8e('0x25')][_0xac8e('0x30')]));_0x2bf640['attributes']=_0x2bf640[_0xac8e('0x2f')]['length']?_0x2bf640[_0xac8e('0x2f')]:_0x266094[_0xac8e('0x2e')];if(_0x1084dd[_0xac8e('0x25')][_0xac8e('0x31')]){_0x2bf640[_0xac8e('0x24')]=[{'all':!![]}];}_0x2bf640=_[_0xac8e('0x32')]({},_0x2bf640,_0x1084dd[_0xac8e('0x33')]);return db[_0xac8e('0x1d')][_0xac8e('0x34')](_0x2bf640)[_0xac8e('0x14')](handleEntityNotFound(_0x216a6f,null))[_0xac8e('0x14')](respondWithResult(_0x216a6f,null))[_0xac8e('0x28')](handleError(_0x216a6f,null));};exports['create']=function(_0x290ccb,_0x49e120){return db[_0xac8e('0x1d')][_0xac8e('0x35')](_0x290ccb[_0xac8e('0x36')],{})[_0xac8e('0x14')](function(_0x2e1364){var _0x16a067=_0x290ccb[_0xac8e('0x37')]['get']({'plain':!![]});if(!_0x16a067)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16a067['role']===_0xac8e('0x37')){var _0x46d503=_0x2e1364[_0xac8e('0x16')]({'plain':!![]});var _0x500313=_0xac8e('0x38');return db[_0xac8e('0x39')][_0xac8e('0x34')]({'where':{'name':_0x500313,'userProfileId':_0x16a067[_0xac8e('0x3a')]},'raw':!![]})[_0xac8e('0x14')](function(_0x51f275){if(_0x51f275&&_0x51f275[_0xac8e('0x3b')]===0x0){return db[_0xac8e('0x17')][_0xac8e('0x35')]({'name':_0x46d503[_0xac8e('0x1a')],'resourceId':_0x46d503['id'],'type':_0x51f275[_0xac8e('0x1a')],'sectionId':_0x51f275['id']},{})[_0xac8e('0x14')](function(){return _0x2e1364;});}else{return _0x2e1364;}})[_0xac8e('0x28')](function(_0x178680){logger[_0xac8e('0x19')](_0xac8e('0x3c'),_0x178680);throw _0x178680;});}return _0x2e1364;})[_0xac8e('0x14')](respondWithResult(_0x49e120,0xc9))[_0xac8e('0x28')](handleError(_0x49e120,null));};exports[_0xac8e('0x3d')]=function(_0x23bbf2,_0x3257f7){if(_0x23bbf2['body']['id']){delete _0x23bbf2[_0xac8e('0x36')]['id'];}return db[_0xac8e('0x1d')]['find']({'where':{'id':_0x23bbf2[_0xac8e('0x2a')]['id']}})[_0xac8e('0x14')](handleEntityNotFound(_0x3257f7,null))[_0xac8e('0x14')](saveUpdates(_0x23bbf2[_0xac8e('0x36')],null))[_0xac8e('0x14')](respondWithResult(_0x3257f7,null))[_0xac8e('0x28')](handleError(_0x3257f7,null));};exports[_0xac8e('0x15')]=function(_0x1c6c35,_0x1b8961){return db['WhatsappQueue'][_0xac8e('0x34')]({'where':{'id':_0x1c6c35[_0xac8e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1b8961,null))[_0xac8e('0x14')](removeEntity(_0x1b8961,null))['catch'](handleError(_0x1b8961,null));};exports['describe']=function(_0x398c84,_0x152727){return db[_0xac8e('0x1d')][_0xac8e('0x3e')]()[_0xac8e('0x14')](respondWithResult(_0x152727,null))['catch'](handleError(_0x152727,null));};exports[_0xac8e('0x3f')]=function(_0x5641d1,_0x456130){var _0x59ea3d={'raw':!![],'where':{}},_0x552f5d={},_0x4832e8;return db[_0xac8e('0x1d')][_0xac8e('0x40')]({'where':{'id':_0x5641d1[_0xac8e('0x2a')]['id']}})[_0xac8e('0x14')](handleEntityNotFound(_0x456130,null))[_0xac8e('0x14')](function(_0x2fb7b3){if(_0x2fb7b3){_0x4832e8=_0x2fb7b3[_0xac8e('0x16')]({'plain':!![]});_0x552f5d['model']=_[_0xac8e('0x2b')](db['UserWhatsappQueue'][_0xac8e('0x1e')]);_0x552f5d[_0xac8e('0x25')]=_[_0xac8e('0x2b')](_0x5641d1['query']);_0x552f5d[_0xac8e('0x2c')]=_[_0xac8e('0x2d')](_0x552f5d[_0xac8e('0x2e')],_0x552f5d[_0xac8e('0x25')]);_0x59ea3d[_0xac8e('0x2f')]=_['intersection'](_0x552f5d[_0xac8e('0x2e')],qs[_0xac8e('0x30')](_0x5641d1[_0xac8e('0x25')][_0xac8e('0x30')]));_0x59ea3d['attributes']=_0x59ea3d[_0xac8e('0x2f')]['length']?_0x59ea3d[_0xac8e('0x2f')]:_0x552f5d['model'];if(!_0x5641d1[_0xac8e('0x25')][_0xac8e('0x41')]('nolimit')){_0x59ea3d['limit']=qs[_0xac8e('0xf')](_0x5641d1[_0xac8e('0x25')]['limit']);_0x59ea3d[_0xac8e('0xe')]=qs[_0xac8e('0xe')](_0x5641d1[_0xac8e('0x25')]['offset']);}_0x59ea3d[_0xac8e('0x42')]=qs['sort'](_0x5641d1[_0xac8e('0x25')][_0xac8e('0x43')]);_0x59ea3d['where']=qs['filters'](_['pick'](_0x5641d1[_0xac8e('0x25')],_0x552f5d[_0xac8e('0x2c')]));_0x59ea3d['where']['WhatsappQueueId']=_0x2fb7b3['id'];if(_0x5641d1[_0xac8e('0x25')][_0xac8e('0x44')]){_0x59ea3d[_0xac8e('0x23')]=_['merge'](_0x59ea3d[_0xac8e('0x23')],{'$or':_['map'](_0x59ea3d[_0xac8e('0x2f')],function(_0x1dea14){var _0x17822b={};_0x17822b[_0x1dea14]={'$like':'%'+_0x5641d1[_0xac8e('0x25')][_0xac8e('0x44')]+'%'};return _0x17822b;})});}_0x59ea3d=_[_0xac8e('0x32')]({},_0x59ea3d,_0x5641d1[_0xac8e('0x33')]);return db[_0xac8e('0x45')][_0xac8e('0x26')](_0x59ea3d);}})[_0xac8e('0x14')](function(_0x12f25e){if(_0x12f25e){return db[_0xac8e('0x46')]['findAndCountAll']({'where':{'id':_[_0xac8e('0x47')](_0x12f25e,_0xac8e('0x48')),'role':_0xac8e('0x49')},'attributes':['id',_0xac8e('0x1a'),_0xac8e('0x4a'),_0xac8e('0x4b'),_0xac8e('0x4c')]});}})[_0xac8e('0x14')](function(_0x2b81ee){if(_0x2b81ee){return{'count':_0x2b81ee[_0xac8e('0x11')],'rows':_['map'](_0x2b81ee[_0xac8e('0x27')],function(_0x22a4ba){return{'membername':_0x22a4ba['name'],'UserId':_0x22a4ba['id'],'queue_name':_0x4832e8['name'],'WhatsappQueueId':_0x4832e8['id'],'interface':util[_0xac8e('0x4d')](_0xac8e('0x4e'),'SIP',_0x22a4ba[_0xac8e('0x1a')]),'penalty':0x0,'paused':_0x22a4ba[_0xac8e('0x4a')],'createdAt':_0x22a4ba['createdAt'],'updatedAt':_0x22a4ba[_0xac8e('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xac8e('0x14')](respondWithFilteredResult(_0x456130,_0x59ea3d))[_0xac8e('0x28')](handleError(_0x456130,null));};exports[_0xac8e('0x4f')]=function(_0x1ad507,_0x182fa3){var _0x1d1d4c={};var _0x4fc546={};var _0x4d5e0c;var _0x1cbfb7;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1ad507[_0xac8e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x182fa3,null))[_0xac8e('0x14')](function(_0x45ad27){if(_0x45ad27){_0x4d5e0c=_0x45ad27;_0x4fc546[_0xac8e('0x2e')]=_[_0xac8e('0x2b')](db[_0xac8e('0x50')][_0xac8e('0x1e')]);_0x4fc546[_0xac8e('0x25')]=_[_0xac8e('0x2b')](_0x1ad507[_0xac8e('0x25')]);_0x4fc546[_0xac8e('0x2c')]=_[_0xac8e('0x2d')](_0x4fc546[_0xac8e('0x2e')],_0x4fc546[_0xac8e('0x25')]);_0x1d1d4c[_0xac8e('0x2f')]=_[_0xac8e('0x2d')](_0x4fc546['model'],qs[_0xac8e('0x30')](_0x1ad507['query']['fields']));_0x1d1d4c[_0xac8e('0x2f')]=_0x1d1d4c[_0xac8e('0x2f')][_0xac8e('0x51')]?_0x1d1d4c['attributes']:_0x4fc546[_0xac8e('0x2e')];_0x1d1d4c[_0xac8e('0x42')]=qs[_0xac8e('0x43')](_0x1ad507['query'][_0xac8e('0x43')]);_0x1d1d4c['where']=qs[_0xac8e('0x2c')](_[_0xac8e('0x52')](_0x1ad507[_0xac8e('0x25')],_0x4fc546[_0xac8e('0x2c')]));if(_0x1ad507[_0xac8e('0x25')]['filter']){_0x1d1d4c[_0xac8e('0x23')]=_[_0xac8e('0x32')](_0x1d1d4c[_0xac8e('0x23')],{'$or':_[_0xac8e('0x47')](_0x1d1d4c[_0xac8e('0x2f')],function(_0x33e186){var _0x404a82={};_0x404a82[_0x33e186]={'$like':'%'+_0x1ad507[_0xac8e('0x25')][_0xac8e('0x44')]+'%'};return _0x404a82;})});}_0x1d1d4c=_[_0xac8e('0x32')]({},_0x1d1d4c,_0x1ad507[_0xac8e('0x33')]);return _0x4d5e0c[_0xac8e('0x4f')](_0x1d1d4c);}})[_0xac8e('0x14')](function(_0x58ed7d){if(_0x58ed7d){_0x1cbfb7=_0x58ed7d['length'];if(!_0x1ad507[_0xac8e('0x25')]['hasOwnProperty']('nolimit')){_0x1d1d4c['limit']=qs['limit'](_0x1ad507[_0xac8e('0x25')][_0xac8e('0xf')]);_0x1d1d4c[_0xac8e('0xe')]=qs['offset'](_0x1ad507[_0xac8e('0x25')][_0xac8e('0xe')]);}return _0x4d5e0c[_0xac8e('0x4f')](_0x1d1d4c);}})['then'](function(_0x49e14e){if(_0x49e14e){return _0x49e14e?{'count':_0x1cbfb7,'rows':_0x49e14e}:null;}})[_0xac8e('0x14')](respondWithResult(_0x182fa3,null))['catch'](handleError(_0x182fa3,null));};exports[_0xac8e('0x53')]=function(_0x6a3ddd,_0xe38621){var _0x31e84a=_0x6a3ddd[_0xac8e('0x36')][_0xac8e('0x54')];return db['Team'][_0xac8e('0x26')]({'where':{'id':_0x31e84a},'attributes':['id'],'include':[{'model':db[_0xac8e('0x46')],'as':_0xac8e('0x55'),'attributes':['id',_0xac8e('0x1a'),'online',_0xac8e('0x56'),_0xac8e('0x57')],'raw':!![]}]})[_0xac8e('0x14')](function(_0x131529){if(_0x131529){var _0x3ed16d=_[_0xac8e('0x58')](_0x131529,function(_0x20a706){var _0x702c9f=_0x20a706[_0xac8e('0x16')]({'plain':!![]});return _0x702c9f[_0xac8e('0x55')];});return db[_0xac8e('0x1d')]['find']({'where':{'id':_0x6a3ddd[_0xac8e('0x2a')]['id']}})['then'](function(_0x369430){return db[_0xac8e('0x59')]['transaction'](function(_0x40be45){return _0x369430[_0xac8e('0x53')](_0x31e84a,{'transaction':_0x40be45})[_0xac8e('0x14')](function(){return BPromise['each'](_0x3ed16d,function(_0x5c791e){return db[_0xac8e('0x45')][_0xac8e('0x5a')]({'where':{'UserId':_0x5c791e['id'],'WhatsappQueueId':_0x6a3ddd[_0xac8e('0x2a')]['id']},'transaction':_0x40be45});});})[_0xac8e('0x14')](function(){_0x3ed16d[_0xac8e('0x5b')](function(_0x1afc11){socket['emit'](_0xac8e('0x5c'),{'UserId':_0x1afc11['id'],'WhatsappQueueId':_0x369430['id']});});});});});}})[_0xac8e('0x14')](respondWithStatusCode(_0xe38621,null))[_0xac8e('0x28')](handleError(_0xe38621,null));};exports[_0xac8e('0x5d')]=function(_0x13b1f1,_0x3bc835){return db[_0xac8e('0x50')][_0xac8e('0x26')]({'where':{'id':_0x13b1f1[_0xac8e('0x25')]['ids']},'attributes':['id'],'include':[{'model':db[_0xac8e('0x46')],'as':_0xac8e('0x55'),'attributes':['id'],'raw':!![]}]})[_0xac8e('0x14')](handleEntityNotFound(_0x3bc835,null))[_0xac8e('0x14')](function(_0x3196f1){var _0x944193=_[_0xac8e('0x47')](_0x3196f1,'id');var _0x28a60e=[];var _0x533332=[];var _0x250103=squel[_0xac8e('0x5e')]();_0x250103['field'](_0xac8e('0x5f'))[_0xac8e('0x60')]('team_has_whatsapp_queues','tq')[_0xac8e('0x61')]('user_has_teams','ut',_0xac8e('0x62'))[_0xac8e('0x23')](_0xac8e('0x63'),_0x13b1f1[_0xac8e('0x2a')]['id']);for(var _0x40f4c6=0x0;_0x40f4c6<_0x3196f1[_0xac8e('0x51')];_0x40f4c6+=0x1){let _0x262004=_0x3196f1[_0x40f4c6];for(var _0xd63fa8=0x0;_0xd63fa8<_0x262004[_0xac8e('0x55')][_0xac8e('0x51')];_0xd63fa8+=0x1){let _0x54effd=_0x262004[_0xac8e('0x55')][_0xd63fa8];var _0x7839f3=_0x250103[_0xac8e('0x64')]();_0x7839f3[_0xac8e('0x23')](_0xac8e('0x65'),_0x54effd['id']);_0x533332[_0xac8e('0x66')](db[_0xac8e('0x59')][_0xac8e('0x25')](_0x7839f3[_0xac8e('0x67')](),{'type':db['sequelize'][_0xac8e('0x68')][_0xac8e('0x69')]})[_0xac8e('0x14')](function(_0x48695c){if(_0x48695c[_0xac8e('0x51')]===0x1){return _0x54effd['id'];}else{var _0x3b7717=_['every'](_[_0xac8e('0x47')](_0x48695c,_0xac8e('0x6a')),function(_0x1e90e9){return _['includes'](_0x944193,_0x1e90e9);});if(_0x3b7717){return _0x54effd['id'];}}}));}}return BPromise[_0xac8e('0x6b')](_0x533332)['then'](function(_0x279322){_0x28a60e=_(_0x28a60e)['union'](_0x279322)[_0xac8e('0x6c')]()['value']();return db['WhatsappQueue']['find']({'where':{'id':_0x13b1f1['params']['id']}})[_0xac8e('0x14')](function(_0x207972){return db['sequelize'][_0xac8e('0x6d')](function(_0x15943c){return _0x207972['removeTeams'](_0x13b1f1[_0xac8e('0x25')][_0xac8e('0x54')],{'transaction':_0x15943c})[_0xac8e('0x14')](function(){if(!_['isEmpty'](_0x28a60e)){return _0x207972['removeAgents'](_0x28a60e,{'transaction':_0x15943c});}})[_0xac8e('0x14')](function(){_0x28a60e[_0xac8e('0x5b')](function(_0x161781){socket[_0xac8e('0x6e')](_0xac8e('0x6f'),{'UserId':_0x161781,'WhatsappQueueId':_0x207972['id']});});});});});});})[_0xac8e('0x14')](respondWithStatusCode(_0x3bc835,null))[_0xac8e('0x28')](handleError(_0x3bc835,null));};exports[_0xac8e('0x70')]=function(_0x3790ca,_0x467a17){return db[_0xac8e('0x1d')][_0xac8e('0x34')]({'where':{'id':_0x3790ca[_0xac8e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x467a17,null))['then'](function(_0x1a999c){if(_0x1a999c){return _0x1a999c[_0xac8e('0x70')](_0x3790ca[_0xac8e('0x36')][_0xac8e('0x54')],_[_0xac8e('0x71')](_0x3790ca['body'],[_0xac8e('0x54'),'id'])||{})['spread'](function(_0x57ca19){for(var _0x4851a8=0x0;_0x4851a8<_0x3790ca[_0xac8e('0x36')]['ids'][_0xac8e('0x51')];_0x4851a8+=0x1){socket[_0xac8e('0x6e')](_0xac8e('0x5c'),{'UserId':Number(_0x3790ca[_0xac8e('0x36')][_0xac8e('0x54')][_0x4851a8]),'WhatsappQueueId':Number(_0x3790ca[_0xac8e('0x2a')]['id'])});}return _0x57ca19;});}})[_0xac8e('0x14')](respondWithResult(_0x467a17,null))[_0xac8e('0x28')](handleError(_0x467a17,null));};exports[_0xac8e('0x72')]=function(_0x44834f,_0x5a0940){return db[_0xac8e('0x1d')][_0xac8e('0x34')]({'where':{'id':_0x44834f[_0xac8e('0x2a')]['id']}})[_0xac8e('0x14')](handleEntityNotFound(_0x5a0940,null))[_0xac8e('0x14')](function(_0x1369ac){if(_0x1369ac){return _0x1369ac[_0xac8e('0x72')](_0x44834f[_0xac8e('0x25')][_0xac8e('0x54')])['then'](function(){if(_['isArray'](_0x44834f[_0xac8e('0x25')][_0xac8e('0x54')])){for(var _0x33577d=0x0;_0x33577d<_0x44834f[_0xac8e('0x25')]['ids']['length'];_0x33577d+=0x1){socket[_0xac8e('0x6e')](_0xac8e('0x6f'),{'UserId':Number(_0x44834f['query'][_0xac8e('0x54')][_0x33577d]),'WhatsappQueueId':Number(_0x44834f[_0xac8e('0x2a')]['id'])});}}else{socket['emit'](_0xac8e('0x6f'),{'UserId':Number(_0x44834f[_0xac8e('0x25')][_0xac8e('0x54')]),'WhatsappQueueId':Number(_0x44834f[_0xac8e('0x2a')]['id'])});}});}})[_0xac8e('0x14')](respondWithStatusCode(_0x5a0940,null))[_0xac8e('0x28')](handleError(_0x5a0940,null));};exports[_0xac8e('0x73')]=function(_0x4deb86,_0x2f7f07){var _0xe01da7={};var _0x2f68b6={};var _0x17993e;var _0xbd9e44;return db[_0xac8e('0x1d')]['findOne']({'where':{'id':_0x4deb86[_0xac8e('0x2a')]['id']}})[_0xac8e('0x14')](handleEntityNotFound(_0x2f7f07,null))[_0xac8e('0x14')](function(_0x172caa){if(_0x172caa){_0x17993e=_0x172caa;_0x2f68b6[_0xac8e('0x2e')]=_[_0xac8e('0x2b')](db[_0xac8e('0x46')][_0xac8e('0x1e')]);_0x2f68b6['query']=_[_0xac8e('0x2b')](_0x4deb86[_0xac8e('0x25')]);_0x2f68b6[_0xac8e('0x2c')]=_[_0xac8e('0x2d')](_0x2f68b6[_0xac8e('0x2e')],_0x2f68b6[_0xac8e('0x25')]);_0xe01da7[_0xac8e('0x2f')]=_[_0xac8e('0x2d')](_0x2f68b6[_0xac8e('0x2e')],qs[_0xac8e('0x30')](_0x4deb86['query'][_0xac8e('0x30')]));_0xe01da7[_0xac8e('0x2f')]=_0xe01da7[_0xac8e('0x2f')][_0xac8e('0x51')]?_0xe01da7[_0xac8e('0x2f')]:_0x2f68b6[_0xac8e('0x2e')];_0xe01da7['order']=qs[_0xac8e('0x43')](_0x4deb86[_0xac8e('0x25')][_0xac8e('0x43')]);_0xe01da7['where']=qs[_0xac8e('0x2c')](_[_0xac8e('0x52')](_0x4deb86['query'],_0x2f68b6[_0xac8e('0x2c')]));if(_0x4deb86[_0xac8e('0x25')][_0xac8e('0x44')]){_0xe01da7[_0xac8e('0x23')]=_[_0xac8e('0x32')](_0xe01da7['where'],{'$or':_[_0xac8e('0x47')](_0xe01da7[_0xac8e('0x2f')],function(_0x2bba53){var _0x10ad2c={};_0x10ad2c[_0x2bba53]={'$like':'%'+_0x4deb86[_0xac8e('0x25')]['filter']+'%'};return _0x10ad2c;})});}_0xe01da7=_['merge']({},_0xe01da7,_0x4deb86[_0xac8e('0x33')]);return _0x17993e[_0xac8e('0x73')](_0xe01da7);}})[_0xac8e('0x14')](function(_0x16a4f7){if(_0x16a4f7){_0xbd9e44=_0x16a4f7[_0xac8e('0x51')];if(!_0x4deb86['query'][_0xac8e('0x41')](_0xac8e('0x74'))){_0xe01da7[_0xac8e('0xf')]=qs[_0xac8e('0xf')](_0x4deb86[_0xac8e('0x25')][_0xac8e('0xf')]);_0xe01da7[_0xac8e('0xe')]=qs[_0xac8e('0xe')](_0x4deb86['query'][_0xac8e('0xe')]);}return _0x17993e[_0xac8e('0x73')](_0xe01da7);}})['then'](function(_0x431ab6){if(_0x431ab6){return _0x431ab6?{'count':_0xbd9e44,'rows':_0x431ab6}:null;}})[_0xac8e('0x14')](respondWithResult(_0x2f7f07,null))['catch'](handleError(_0x2f7f07,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 85dea6a..111d6b6 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 _0xbf46=['hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit'];(function(_0x893142,_0x5234c5){var _0x1b2327=function(_0x53a38e){while(--_0x53a38e){_0x893142['push'](_0x893142['shift']());}};_0x1b2327(++_0x5234c5);}(_0xbf46,0x122));var _0x6bf4=function(_0x5b3b31,_0x4b3395){_0x5b3b31=_0x5b3b31-0x0;var _0x474fdd=_0xbf46[_0x5b3b31];return _0x474fdd;};'use strict';var EventEmitter=require(_0x6bf4('0x0'));var WhatsappQueue=require(_0x6bf4('0x1'))['db'][_0x6bf4('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6bf4('0x3')](0x0);var events={'afterCreate':_0x6bf4('0x4'),'afterUpdate':'update','afterDestroy':_0x6bf4('0x5')};function emitEvent(_0x189e94){return function(_0x32beb7,_0x47fb9e,_0x51fee9){WhatsappQueueEvents[_0x6bf4('0x6')](_0x189e94+':'+_0x32beb7['id'],_0x32beb7);WhatsappQueueEvents[_0x6bf4('0x6')](_0x189e94,_0x32beb7);_0x51fee9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x6bf4('0x7')](e,emitEvent(event));}}module[_0x6bf4('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x9ad1=['hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1da778,_0x39d34c){var _0x87ed15=function(_0xbb966f){while(--_0xbb966f){_0x1da778['push'](_0x1da778['shift']());}};_0x87ed15(++_0x39d34c);}(_0x9ad1,0x133));var _0x19ad=function(_0x1249df,_0x24ce6d){_0x1249df=_0x1249df-0x0;var _0x556680=_0x9ad1[_0x1249df];return _0x556680;};'use strict';var EventEmitter=require(_0x19ad('0x0'));var WhatsappQueue=require(_0x19ad('0x1'))['db'][_0x19ad('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x19ad('0x3')](0x0);var events={'afterCreate':_0x19ad('0x4'),'afterUpdate':_0x19ad('0x5'),'afterDestroy':'remove'};function emitEvent(_0x325578){return function(_0x1536bc,_0x47a705,_0x28d47e){WhatsappQueueEvents[_0x19ad('0x6')](_0x325578+':'+_0x1536bc['id'],_0x1536bc);WhatsappQueueEvents[_0x19ad('0x6')](_0x325578,_0x1536bc);_0x28d47e(null);};}for(var e in events){if(events[_0x19ad('0x7')](e)){var event=events[e];WhatsappQueue[_0x19ad('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index b6df36b..ad7331b 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 _0x5ea1=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x32e9e9,_0x3df5aa){var _0x400b63=function(_0x5d0454){while(--_0x5d0454){_0x32e9e9['push'](_0x32e9e9['shift']());}};_0x400b63(++_0x3df5aa);}(_0x5ea1,0x19f));var _0x15ea=function(_0x526f58,_0x204c8f){_0x526f58=_0x526f58-0x0;var _0x4053bb=_0x5ea1[_0x526f58];return _0x4053bb;};'use strict';var _=require(_0x15ea('0x0'));var util=require(_0x15ea('0x1'));var logger=require(_0x15ea('0x2'))('api');var moment=require(_0x15ea('0x3'));var BPromise=require(_0x15ea('0x4'));var rp=require(_0x15ea('0x5'));var fs=require('fs');var path=require(_0x15ea('0x6'));var rimraf=require(_0x15ea('0x7'));var config=require(_0x15ea('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0x15ea('0x9')]=function(_0x4d9227,_0x44be2b){return _0x4d9227[_0x15ea('0xa')](_0x15ea('0xb'),attributes,{'tableName':_0x15ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x003a=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x559f28,_0x3d0990){var _0x1618c8=function(_0x46cb34){while(--_0x46cb34){_0x559f28['push'](_0x559f28['shift']());}};_0x1618c8(++_0x3d0990);}(_0x003a,0xc5));var _0xa003=function(_0x330c49,_0x18ea31){_0x330c49=_0x330c49-0x0;var _0x3444d5=_0x003a[_0x330c49];return _0x3444d5;};'use strict';var _=require(_0xa003('0x0'));var util=require(_0xa003('0x1'));var logger=require(_0xa003('0x2'))(_0xa003('0x3'));var moment=require(_0xa003('0x4'));var BPromise=require(_0xa003('0x5'));var rp=require(_0xa003('0x6'));var fs=require('fs');var path=require(_0xa003('0x7'));var rimraf=require('rimraf');var config=require(_0xa003('0x8'));var attributes=require(_0xa003('0x9'));module[_0xa003('0xa')]=function(_0x44c48f,_0x3a9c06){return _0x44c48f['define'](_0xa003('0xb'),attributes,{'tableName':_0xa003('0xc'),'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 26809f9..af36a57 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 _0xc068=['raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','WhatsappQueue,\x20%s,\x20%s','message','catch','GetWhatsappQueue','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowWhatsappQueue','WhatsappQueue'];(function(_0x46e911,_0x5ea08d){var _0x3bc4bc=function(_0xa6534e){while(--_0xa6534e){_0x46e911['push'](_0x46e911['shift']());}};_0x3bc4bc(++_0x5ea08d);}(_0xc068,0xeb));var _0x8c06=function(_0x3b0697,_0x2e17bb){_0x3b0697=_0x3b0697-0x0;var _0xabb05=_0xc068[_0x3b0697];return _0xabb05;};'use strict';var _=require(_0x8c06('0x0'));var util=require('util');var moment=require(_0x8c06('0x1'));var BPromise=require(_0x8c06('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c06('0x3'));var db=require(_0x8c06('0x4'))['db'];var utils=require(_0x8c06('0x5'));var logger=require(_0x8c06('0x6'))('rpc');var config=require(_0x8c06('0x7'));var jayson=require(_0x8c06('0x8'));var client=jayson[_0x8c06('0x9')][_0x8c06('0xa')]({'port':0x232a});config[_0x8c06('0xb')]=_['defaults'](config[_0x8c06('0xb')],{'host':_0x8c06('0xc'),'port':0x18eb});var socket=require(_0x8c06('0xd'))(new Redis(config[_0x8c06('0xb')]));require(_0x8c06('0xe'))[_0x8c06('0xf')](socket);function respondWithRpcPromise(_0x1a6995,_0x4ebe45,_0x71503c){return new BPromise(function(_0x1f7422,_0x30cdef){return client[_0x8c06('0x10')](_0x1a6995,_0x71503c)['then'](function(_0xa34bdd){logger[_0x8c06('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x4ebe45,_0x8c06('0x12'));logger[_0x8c06('0x13')](_0x8c06('0x14'),_0x4ebe45,_0x8c06('0x12'),JSON['stringify'](_0xa34bdd));if(_0xa34bdd[_0x8c06('0x15')]){if(_0xa34bdd[_0x8c06('0x15')]['code']===0x1f4){logger[_0x8c06('0x15')](_0x8c06('0x16'),_0x4ebe45,_0xa34bdd[_0x8c06('0x15')][_0x8c06('0x17')]);return _0x30cdef(_0xa34bdd[_0x8c06('0x15')][_0x8c06('0x17')]);}logger[_0x8c06('0x15')](_0x8c06('0x16'),_0x4ebe45,_0xa34bdd['error'][_0x8c06('0x17')]);return _0x1f7422(_0xa34bdd[_0x8c06('0x15')][_0x8c06('0x17')]);}else{logger['info'](_0x8c06('0x16'),_0x4ebe45,'request\x20sent');_0x1f7422(_0xa34bdd['result'][_0x8c06('0x17')]);}})[_0x8c06('0x18')](function(_0x1039b9){logger[_0x8c06('0x15')](_0x8c06('0x16'),_0x4ebe45,_0x1039b9);_0x30cdef(_0x1039b9);});});}exports[_0x8c06('0x19')]=function(_0x44e9ac){var _0x161754=this;return new Promise(function(_0x6b399e,_0x2e4189){return db['WhatsappQueue'][_0x8c06('0x1a')]({'raw':_0x44e9ac[_0x8c06('0x1b')]?_0x44e9ac[_0x8c06('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x44e9ac[_0x8c06('0x1b')]?_0x44e9ac[_0x8c06('0x1b')][_0x8c06('0x1c')]||null:null,'attributes':_0x44e9ac[_0x8c06('0x1b')]?_0x44e9ac[_0x8c06('0x1b')][_0x8c06('0x1d')]||null:null,'limit':_0x44e9ac['options']?_0x44e9ac[_0x8c06('0x1b')][_0x8c06('0x1e')]||null:null,'include':_0x44e9ac[_0x8c06('0x1b')]?_0x44e9ac[_0x8c06('0x1b')][_0x8c06('0x1f')]?_[_0x8c06('0x20')](_0x44e9ac[_0x8c06('0x1b')][_0x8c06('0x1f')],function(_0x5e5068){return{'model':db[_0x5e5068['model']],'as':_0x5e5068['as'],'attributes':_0x5e5068['attributes'],'include':_0x5e5068[_0x8c06('0x1f')]?_['map'](_0x5e5068['include'],function(_0x11ffd7){return{'model':db[_0x11ffd7[_0x8c06('0x21')]],'as':_0x11ffd7['as'],'attributes':_0x11ffd7[_0x8c06('0x1d')],'include':_0x11ffd7['include']?_[_0x8c06('0x20')](_0x11ffd7[_0x8c06('0x1f')],function(_0x50869b){return{'model':db[_0x50869b[_0x8c06('0x21')]],'as':_0x50869b['as'],'attributes':_0x50869b[_0x8c06('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8c06('0x22')](function(_0x18c127){logger[_0x8c06('0x11')](_0x8c06('0x19'),_0x44e9ac);logger[_0x8c06('0x13')](_0x8c06('0x19'),_0x44e9ac,JSON[_0x8c06('0x23')](_0x18c127));_0x6b399e(_0x18c127);})['catch'](function(_0x5551f6){logger[_0x8c06('0x15')](_0x8c06('0x19'),_0x5551f6[_0x8c06('0x17')],_0x44e9ac);_0x2e4189(_0x161754[_0x8c06('0x15')](0x1f4,_0x5551f6[_0x8c06('0x17')]));});});};exports[_0x8c06('0x24')]=function(_0x10c208){var _0x4bd852=this;return new Promise(function(_0x36cd73,_0x4dd6c2){return db[_0x8c06('0x25')]['find']({'raw':_0x10c208[_0x8c06('0x1b')]?_0x10c208['options'][_0x8c06('0x26')]===undefined?!![]:![]:!![],'where':_0x10c208[_0x8c06('0x1b')]?_0x10c208[_0x8c06('0x1b')][_0x8c06('0x1c')]||null:null,'attributes':_0x10c208[_0x8c06('0x1b')]?_0x10c208[_0x8c06('0x1b')][_0x8c06('0x1d')]||null:null,'include':_0x10c208[_0x8c06('0x1b')]?_0x10c208[_0x8c06('0x1b')]['include']?_['map'](_0x10c208['options'][_0x8c06('0x1f')],function(_0x40a317){return{'model':db[_0x40a317[_0x8c06('0x21')]],'as':_0x40a317['as'],'attributes':_0x40a317[_0x8c06('0x1d')],'include':_0x40a317[_0x8c06('0x1f')]?_[_0x8c06('0x20')](_0x40a317[_0x8c06('0x1f')],function(_0x2fd045){return{'model':db[_0x2fd045[_0x8c06('0x21')]],'as':_0x2fd045['as'],'attributes':_0x2fd045[_0x8c06('0x1d')],'include':_0x2fd045[_0x8c06('0x1f')]?_[_0x8c06('0x20')](_0x2fd045[_0x8c06('0x1f')],function(_0x20da23){return{'model':db[_0x20da23['model']],'as':_0x20da23['as'],'attributes':_0x20da23[_0x8c06('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8c06('0x22')](function(_0x44c866){logger[_0x8c06('0x11')]('ShowWhatsappQueue',_0x10c208);logger[_0x8c06('0x13')](_0x8c06('0x24'),_0x10c208,JSON[_0x8c06('0x23')](_0x44c866));_0x36cd73(_0x44c866);})[_0x8c06('0x18')](function(_0x432e44){logger[_0x8c06('0x15')](_0x8c06('0x24'),_0x432e44[_0x8c06('0x17')],_0x10c208);_0x4dd6c2(_0x4bd852[_0x8c06('0x15')](0x1f4,_0x432e44[_0x8c06('0x17')]));});});}; \ No newline at end of file +var _0x18d8=['WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowWhatsappQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','then','info'];(function(_0x2dda4d,_0x46d702){var _0x4580f4=function(_0x2c1989){while(--_0x2c1989){_0x2dda4d['push'](_0x2dda4d['shift']());}};_0x4580f4(++_0x46d702);}(_0x18d8,0x64));var _0x818d=function(_0x35a26d,_0x2134f5){_0x35a26d=_0x35a26d-0x0;var _0x1f97ba=_0x18d8[_0x35a26d];return _0x1f97ba;};'use strict';var _=require(_0x818d('0x0'));var util=require(_0x818d('0x1'));var moment=require('moment');var BPromise=require(_0x818d('0x2'));var rs=require(_0x818d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x818d('0x4'))['db'];var utils=require(_0x818d('0x5'));var logger=require('../../config/logger')(_0x818d('0x6'));var config=require(_0x818d('0x7'));var jayson=require(_0x818d('0x8'));var client=jayson[_0x818d('0x9')][_0x818d('0xa')]({'port':0x232a});config[_0x818d('0xb')]=_[_0x818d('0xc')](config['redis'],{'host':_0x818d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x818d('0xb')]));require(_0x818d('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c1e7b,_0x4eb068,_0x5bbb8c){return new BPromise(function(_0x3fd72b,_0x154d90){return client['request'](_0x3c1e7b,_0x5bbb8c)[_0x818d('0xf')](function(_0x288a3c){logger[_0x818d('0x10')](_0x818d('0x11'),_0x4eb068,_0x818d('0x12'));logger[_0x818d('0x13')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4eb068,'request\x20sent',JSON[_0x818d('0x14')](_0x288a3c));if(_0x288a3c[_0x818d('0x15')]){if(_0x288a3c[_0x818d('0x15')][_0x818d('0x16')]===0x1f4){logger[_0x818d('0x15')](_0x818d('0x11'),_0x4eb068,_0x288a3c['error'][_0x818d('0x17')]);return _0x154d90(_0x288a3c['error'][_0x818d('0x17')]);}logger['error'](_0x818d('0x11'),_0x4eb068,_0x288a3c['error'][_0x818d('0x17')]);return _0x3fd72b(_0x288a3c[_0x818d('0x15')][_0x818d('0x17')]);}else{logger[_0x818d('0x10')](_0x818d('0x11'),_0x4eb068,_0x818d('0x12'));_0x3fd72b(_0x288a3c[_0x818d('0x18')][_0x818d('0x17')]);}})[_0x818d('0x19')](function(_0x4faad0){logger[_0x818d('0x15')](_0x818d('0x11'),_0x4eb068,_0x4faad0);_0x154d90(_0x4faad0);});});}exports[_0x818d('0x1a')]=function(_0x420dfb){var _0x26676f=this;return new Promise(function(_0x35f8ab,_0x426049){return db[_0x818d('0x1b')][_0x818d('0x1c')]({'raw':_0x420dfb['options']?_0x420dfb[_0x818d('0x1d')][_0x818d('0x1e')]===undefined?!![]:![]:!![],'where':_0x420dfb[_0x818d('0x1d')]?_0x420dfb[_0x818d('0x1d')][_0x818d('0x1f')]||null:null,'attributes':_0x420dfb['options']?_0x420dfb[_0x818d('0x1d')]['attributes']||null:null,'limit':_0x420dfb[_0x818d('0x1d')]?_0x420dfb[_0x818d('0x1d')][_0x818d('0x20')]||null:null,'include':_0x420dfb['options']?_0x420dfb[_0x818d('0x1d')][_0x818d('0x21')]?_[_0x818d('0x22')](_0x420dfb[_0x818d('0x1d')][_0x818d('0x21')],function(_0xad189b){return{'model':db[_0xad189b['model']],'as':_0xad189b['as'],'attributes':_0xad189b['attributes'],'include':_0xad189b[_0x818d('0x21')]?_[_0x818d('0x22')](_0xad189b[_0x818d('0x21')],function(_0x2995a3){return{'model':db[_0x2995a3[_0x818d('0x23')]],'as':_0x2995a3['as'],'attributes':_0x2995a3[_0x818d('0x24')],'include':_0x2995a3[_0x818d('0x21')]?_[_0x818d('0x22')](_0x2995a3[_0x818d('0x21')],function(_0x3c3e59){return{'model':db[_0x3c3e59[_0x818d('0x23')]],'as':_0x3c3e59['as'],'attributes':_0x3c3e59[_0x818d('0x24')]};}):[]};}):[]};}):[]:[]})[_0x818d('0xf')](function(_0x32c8d7){logger['info']('GetWhatsappQueue',_0x420dfb);logger[_0x818d('0x13')](_0x818d('0x1a'),_0x420dfb,JSON['stringify'](_0x32c8d7));_0x35f8ab(_0x32c8d7);})[_0x818d('0x19')](function(_0x2b232b){logger[_0x818d('0x15')](_0x818d('0x1a'),_0x2b232b[_0x818d('0x17')],_0x420dfb);_0x426049(_0x26676f[_0x818d('0x15')](0x1f4,_0x2b232b[_0x818d('0x17')]));});});};exports[_0x818d('0x25')]=function(_0x4fc32d){var _0x2217b3=this;return new Promise(function(_0x36c81c,_0x1a121a){return db['WhatsappQueue'][_0x818d('0x26')]({'raw':_0x4fc32d['options']?_0x4fc32d[_0x818d('0x1d')][_0x818d('0x1e')]===undefined?!![]:![]:!![],'where':_0x4fc32d[_0x818d('0x1d')]?_0x4fc32d[_0x818d('0x1d')][_0x818d('0x1f')]||null:null,'attributes':_0x4fc32d[_0x818d('0x1d')]?_0x4fc32d[_0x818d('0x1d')]['attributes']||null:null,'include':_0x4fc32d['options']?_0x4fc32d[_0x818d('0x1d')][_0x818d('0x21')]?_[_0x818d('0x22')](_0x4fc32d['options'][_0x818d('0x21')],function(_0x10dc97){return{'model':db[_0x10dc97[_0x818d('0x23')]],'as':_0x10dc97['as'],'attributes':_0x10dc97[_0x818d('0x24')],'include':_0x10dc97['include']?_['map'](_0x10dc97['include'],function(_0x23bf09){return{'model':db[_0x23bf09['model']],'as':_0x23bf09['as'],'attributes':_0x23bf09['attributes'],'include':_0x23bf09[_0x818d('0x21')]?_['map'](_0x23bf09[_0x818d('0x21')],function(_0x5ac79a){return{'model':db[_0x5ac79a[_0x818d('0x23')]],'as':_0x5ac79a['as'],'attributes':_0x5ac79a[_0x818d('0x24')]};}):[]};}):[]};}):[]:[]})[_0x818d('0xf')](function(_0x511b1c){logger[_0x818d('0x10')](_0x818d('0x25'),_0x4fc32d);logger['debug'](_0x818d('0x25'),_0x4fc32d,JSON[_0x818d('0x14')](_0x511b1c));_0x36c81c(_0x511b1c);})[_0x818d('0x19')](function(_0x3cdfc1){logger[_0x818d('0x15')]('ShowWhatsappQueue',_0x3cdfc1['message'],_0x4fc32d);_0x1a121a(_0x2217b3[_0x818d('0x15')](0x1f4,_0x3cdfc1[_0x818d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 89ce9fb..05f5b65 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 _0x5f5c=['length','./whatsappQueue.events','remove','emit'];(function(_0x46eb0a,_0x44f44a){var _0x443ba0=function(_0x11e99c){while(--_0x11e99c){_0x46eb0a['push'](_0x46eb0a['shift']());}};_0x443ba0(++_0x44f44a);}(_0x5f5c,0x19d));var _0xc5f5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5f5c[_0x14add3];return _0x4a174f;};'use strict';var WhatsappQueueEvents=require(_0xc5f5('0x0'));var events=['save',_0xc5f5('0x1'),'update'];function createListener(_0x5bc87c,_0x531948){return function(_0xd7f901){_0x531948[_0xc5f5('0x2')](_0x5bc87c,_0xd7f901);};}function removeListener(_0x3495a2,_0xf30bd4){return function(){WhatsappQueueEvents['removeListener'](_0x3495a2,_0xf30bd4);};}exports['register']=function(_0x15fb24){for(var _0x167506=0x0,_0xf7c90f=events[_0xc5f5('0x3')];_0x167506<_0xf7c90f;_0x167506++){var _0x4c3523=events[_0x167506];var _0x590635=createListener('whatsappQueue:'+_0x4c3523,_0x15fb24);WhatsappQueueEvents['on'](_0x4c3523,_0x590635);}}; \ No newline at end of file +var _0x9b0d=['register','save','remove','update','emit','removeListener'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0x9b0d,0x67));var _0xd9b0=function(_0x27aa8b,_0x53cc86){_0x27aa8b=_0x27aa8b-0x0;var _0x24346b=_0x9b0d[_0x27aa8b];return _0x24346b;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xd9b0('0x0'),_0xd9b0('0x1'),_0xd9b0('0x2')];function createListener(_0x20aefb,_0x350200){return function(_0xc1c506){_0x350200[_0xd9b0('0x3')](_0x20aefb,_0xc1c506);};}function removeListener(_0x58aaba,_0x478e7d){return function(){WhatsappQueueEvents[_0xd9b0('0x4')](_0x58aaba,_0x478e7d);};}exports[_0xd9b0('0x5')]=function(_0xef994c){for(var _0x19b45e=0x0,_0x195730=events['length'];_0x19b45e<_0x195730;_0x19b45e++){var _0xcc92d3=events[_0x19b45e];var _0x322d66=createListener('whatsappQueue:'+_0xcc92d3,_0xef994c);WhatsappQueueEvents['on'](_0xcc92d3,_0x322d66);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index f6f8af6..b5903fd 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 _0xdd68=['../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','delete','exports','path','express','Router','fs-extra'];(function(_0x45a91e,_0x2a6eb8){var _0x515fdb=function(_0x1fa292){while(--_0x1fa292){_0x45a91e['push'](_0x45a91e['shift']());}};_0x515fdb(++_0x2a6eb8);}(_0xdd68,0x1d8));var _0x8dd6=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0xdd68[_0x9e0cb3];return _0x5926b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8dd6('0x0'));var timeout=require('connect-timeout');var express=require(_0x8dd6('0x1'));var router=express[_0x8dd6('0x2')]();var fs_extra=require(_0x8dd6('0x3'));var auth=require(_0x8dd6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8dd6('0x5'));var controller=require(_0x8dd6('0x6'));router[_0x8dd6('0x7')]('/',auth[_0x8dd6('0x8')](),controller['index']);router[_0x8dd6('0x7')](_0x8dd6('0x9'),auth[_0x8dd6('0x8')](),controller[_0x8dd6('0xa')]);router[_0x8dd6('0x7')](_0x8dd6('0xb'),auth['isAuthenticated'](),controller[_0x8dd6('0xc')]);router[_0x8dd6('0xd')]('/',auth[_0x8dd6('0x8')](),controller[_0x8dd6('0xe')]);router['put'](_0x8dd6('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8dd6('0xf')](_0x8dd6('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8dd6('0x10')]=router; \ No newline at end of file +var _0xc742=['exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy'];(function(_0x56f7e4,_0x197d40){var _0x10ba7a=function(_0x3b1bb4){while(--_0x3b1bb4){_0x56f7e4['push'](_0x56f7e4['shift']());}};_0x10ba7a(++_0x197d40);}(_0xc742,0x86));var _0x2c74=function(_0x3d8b49,_0x34cbcb){_0x3d8b49=_0x3d8b49-0x0;var _0xf418d8=_0xc742[_0x3d8b49];return _0xf418d8;};'use strict';var multer=require(_0x2c74('0x0'));var util=require(_0x2c74('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2c74('0x2'));var router=express[_0x2c74('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2c74('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2c74('0x5'));var controller=require(_0x2c74('0x6'));router[_0x2c74('0x7')]('/',auth[_0x2c74('0x8')](),controller[_0x2c74('0x9')]);router[_0x2c74('0x7')](_0x2c74('0xa'),auth[_0x2c74('0x8')](),controller[_0x2c74('0xb')]);router['get'](_0x2c74('0xc'),auth[_0x2c74('0x8')](),controller[_0x2c74('0xd')]);router[_0x2c74('0xe')]('/',auth[_0x2c74('0x8')](),controller['create']);router[_0x2c74('0xf')](_0x2c74('0xc'),auth[_0x2c74('0x8')](),controller['update']);router[_0x2c74('0x10')](_0x2c74('0xc'),auth[_0x2c74('0x8')](),controller[_0x2c74('0x11')]);module[_0x2c74('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a0cd9b5..15d07f9 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(_0x20f7cd,_0x55ab7f){var _0x3d9fe7=function(_0xd8cd29){while(--_0xd8cd29){_0x20f7cd['push'](_0x20f7cd['shift']());}};_0x3d9fe7(++_0x55ab7f);}(_0x7a54,0x106));var _0x47a5=function(_0x67ab53,_0x2799aa){_0x67ab53=_0x67ab53-0x0;var _0x43b4c4=_0x7a54[_0x67ab53];return _0x43b4c4;};'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(_0x306d13,_0x20e3ab){var _0x4700c3=function(_0x2a3cf8){while(--_0x2a3cf8){_0x306d13['push'](_0x306d13['shift']());}};_0x4700c3(++_0x20e3ab);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 f4e3421..9c2e351 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 _0x9ffd=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','key'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xa3f678,_0x50a1db){_0xa3f678=_0xa3f678-0x0;var _0x443475=_0x9ffd[_0xa3f678];return _0x443475;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca906,_0x4d86fe){return function(_0x285002){if(!_0x285002){_0x3ca906['sendStatus'](0x194);}return _0x285002;};}function handleError(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0x1f4;return function(_0x2138b4){logger[_0xd9ff('0x26')](_0x2138b4['stack']);if(_0x2138b4[_0xd9ff('0x27')]){delete _0x2138b4[_0xd9ff('0x27')];}_0x10cbdd[_0xd9ff('0x1b')](_0x159e56)[_0xd9ff('0x28')](_0x2138b4);};}exports['index']=function(_0x1d3684,_0x3792d9){var _0x44b5a7={},_0x45fb63={},_0x263d3a={'count':0x0,'rows':[]};var _0xe516e2=_[_0xd9ff('0x29')](db[_0xd9ff('0x2a')][_0xd9ff('0x2b')],function(_0x5706cf){return{'name':_0x5706cf[_0xd9ff('0x2c')],'type':_0x5706cf['type'][_0xd9ff('0x2d')]};});_0x45fb63[_0xd9ff('0x2e')]=_[_0xd9ff('0x29')](_0xe516e2,'name');_0x45fb63[_0xd9ff('0x2f')]=_[_0xd9ff('0x30')](_0x1d3684[_0xd9ff('0x2f')]);_0x45fb63[_0xd9ff('0x31')]=_['intersection'](_0x45fb63[_0xd9ff('0x2e')],_0x45fb63['query']);_0x44b5a7[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x45fb63[_0xd9ff('0x2e')],qs[_0xd9ff('0x34')](_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x34')]));_0x44b5a7[_0xd9ff('0x32')]=_0x44b5a7[_0xd9ff('0x32')][_0xd9ff('0x35')]?_0x44b5a7[_0xd9ff('0x32')]:_0x45fb63[_0xd9ff('0x2e')];if(!_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x36')](_0xd9ff('0x37'))){_0x44b5a7['limit']=qs[_0xd9ff('0x20')](_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x20')]);_0x44b5a7['offset']=qs[_0xd9ff('0x1f')](_0x1d3684['query'][_0xd9ff('0x1f')]);}_0x44b5a7['order']=qs[_0xd9ff('0x38')](_0x1d3684['query'][_0xd9ff('0x38')]);_0x44b5a7[_0xd9ff('0x39')]=qs[_0xd9ff('0x31')](_['pick'](_0x1d3684['query'],_0x45fb63['filters']),_0xe516e2);if(_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x3a')]){_0x44b5a7[_0xd9ff('0x39')]=_[_0xd9ff('0x3b')](_0x44b5a7[_0xd9ff('0x39')],{'$or':_[_0xd9ff('0x29')](_0xe516e2,function(_0x596d29){if(_0x596d29['type']!=='VIRTUAL'){var _0x316d93={};_0x316d93[_0x596d29[_0xd9ff('0x27')]]={'$like':'%'+_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x3a')]+'%'};return _0x316d93;}})});}_0x44b5a7=_['merge']({},_0x44b5a7,_0x1d3684[_0xd9ff('0x3c')]);var _0x5b8e17={'where':_0x44b5a7[_0xd9ff('0x39')]};return db[_0xd9ff('0x2a')][_0xd9ff('0x1e')](_0x5b8e17)[_0xd9ff('0x25')](function(_0x59fc07){_0x263d3a[_0xd9ff('0x1e')]=_0x59fc07;if(_0x1d3684[_0xd9ff('0x2f')]['includeAll']){_0x44b5a7[_0xd9ff('0x3d')]=[{'all':!![]}];}return db[_0xd9ff('0x2a')][_0xd9ff('0x3e')](_0x44b5a7);})[_0xd9ff('0x25')](function(_0x1fe44d){_0x263d3a[_0xd9ff('0x3f')]=_0x1fe44d;return _0x263d3a;})['then'](respondWithFilteredResult(_0x3792d9,_0x44b5a7))[_0xd9ff('0x40')](handleError(_0x3792d9,null));};exports[_0xd9ff('0x41')]=function(_0x10533a,_0x39fbbb){var _0x472724={'raw':!![],'where':{'id':_0x10533a[_0xd9ff('0x42')]['id']}},_0x52aab8={};_0x52aab8[_0xd9ff('0x2e')]=_[_0xd9ff('0x30')](db['WhatsappQueueReport']['rawAttributes']);_0x52aab8[_0xd9ff('0x2f')]=_[_0xd9ff('0x30')](_0x10533a[_0xd9ff('0x2f')]);_0x52aab8[_0xd9ff('0x31')]=_[_0xd9ff('0x33')](_0x52aab8[_0xd9ff('0x2e')],_0x52aab8['query']);_0x472724[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x52aab8['model'],qs[_0xd9ff('0x34')](_0x10533a[_0xd9ff('0x2f')][_0xd9ff('0x34')]));_0x472724[_0xd9ff('0x32')]=_0x472724[_0xd9ff('0x32')]['length']?_0x472724['attributes']:_0x52aab8['model'];if(_0x10533a[_0xd9ff('0x2f')]['includeAll']){_0x472724[_0xd9ff('0x3d')]=[{'all':!![]}];}_0x472724=_[_0xd9ff('0x3b')]({},_0x472724,_0x10533a[_0xd9ff('0x3c')]);return db['WhatsappQueueReport'][_0xd9ff('0x43')](_0x472724)[_0xd9ff('0x25')](handleEntityNotFound(_0x39fbbb,null))['then'](respondWithResult(_0x39fbbb,null))[_0xd9ff('0x40')](handleError(_0x39fbbb,null));};exports[_0xd9ff('0x44')]=function(_0x23b224,_0x316854){return db['WhatsappQueueReport'][_0xd9ff('0x44')](_0x23b224['body'],{})[_0xd9ff('0x25')](respondWithResult(_0x316854,0xc9))['catch'](handleError(_0x316854,null));};exports[_0xd9ff('0x24')]=function(_0x3d91e6,_0x2bf37a){if(_0x3d91e6[_0xd9ff('0x45')]['id']){delete _0x3d91e6[_0xd9ff('0x45')]['id'];}return db['WhatsappQueueReport'][_0xd9ff('0x43')]({'where':{'id':_0x3d91e6[_0xd9ff('0x42')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x2bf37a,null))[_0xd9ff('0x25')](saveUpdates(_0x3d91e6['body'],null))['then'](respondWithResult(_0x2bf37a,null))['catch'](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x46')]=function(_0x40be56,_0x29c6bd){return db['WhatsappQueueReport'][_0xd9ff('0x43')]({'where':{'id':_0x40be56[_0xd9ff('0x42')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x29c6bd,null))[_0xd9ff('0x25')](removeEntity(_0x29c6bd,null))[_0xd9ff('0x40')](handleError(_0x29c6bd,null));};exports[_0xd9ff('0x47')]=function(_0x43a8ae,_0x1e1364){return db[_0xd9ff('0x2a')][_0xd9ff('0x47')]()[_0xd9ff('0x25')](respondWithResult(_0x1e1364,null))[_0xd9ff('0x40')](handleError(_0x1e1364,null));}; \ No newline at end of file +var _0x34b7=['WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','show','params','includeAll','include','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x34b7,0x196));var _0x734b=function(_0x49f509,_0x5c7395){_0x49f509=_0x49f509-0x0;var _0x1250d2=_0x34b7[_0x49f509];return _0x1250d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];function respondWithStatusCode(_0x1e0fca,_0x189a82){_0x189a82=_0x189a82||0xcc;return function(_0xff9ddf){if(_0xff9ddf){return _0x1e0fca[_0x734b('0x18')](_0x189a82);}return _0x1e0fca[_0x734b('0x19')](_0x189a82)['end']();};}function respondWithResult(_0x18fc18,_0x252510){_0x252510=_0x252510||0xc8;return function(_0x47791c){if(_0x47791c){return _0x18fc18[_0x734b('0x19')](_0x252510)[_0x734b('0x1a')](_0x47791c);}};}function respondWithFilteredResult(_0x2e00ad,_0x2372bd){return function(_0x2c03bd){if(_0x2c03bd){var _0xa6d111=typeof _0x2372bd[_0x734b('0x1b')]===_0x734b('0x1c')&&typeof _0x2372bd['limit']===_0x734b('0x1c');var _0x2ee290=_0x2c03bd[_0x734b('0x1d')];var _0x5edbe9=_0xa6d111?0x0:_0x2372bd['offset'];var _0x56a95c=_0xa6d111?_0x2c03bd[_0x734b('0x1d')]:_0x2372bd[_0x734b('0x1b')]+_0x2372bd[_0x734b('0x1e')];var _0x41ba87;if(_0x56a95c>=_0x2ee290){_0x56a95c=_0x2ee290;_0x41ba87=0xc8;}else{_0x41ba87=0xce;}_0x2e00ad[_0x734b('0x19')](_0x41ba87);return _0x2e00ad[_0x734b('0x1f')](_0x734b('0x20'),_0x5edbe9+'-'+_0x56a95c+'/'+_0x2ee290)[_0x734b('0x1a')](_0x2c03bd);}return null;};}function patchUpdates(_0x67eed){return function(_0x1d2b27){try{jsonpatch[_0x734b('0x21')](_0x1d2b27,_0x67eed,!![]);}catch(_0x3d0ffd){return BPromise[_0x734b('0x22')](_0x3d0ffd);}return _0x1d2b27[_0x734b('0x23')]();};}function saveUpdates(_0x56f807,_0x1e4dcc){return function(_0x7856d7){if(_0x7856d7){return _0x7856d7['update'](_0x56f807)[_0x734b('0x24')](function(_0x1f81de){return _0x1f81de;});}return null;};}function removeEntity(_0x1a7908,_0x11fb8e){return function(_0x46d432){if(_0x46d432){return _0x46d432[_0x734b('0x25')]()[_0x734b('0x24')](function(){_0x1a7908[_0x734b('0x19')](0xcc)[_0x734b('0x26')]();});}};}function handleEntityNotFound(_0x3abbe6,_0x44ffa9){return function(_0x148abe){if(!_0x148abe){_0x3abbe6[_0x734b('0x18')](0x194);}return _0x148abe;};}function handleError(_0x566d55,_0x49732b){_0x49732b=_0x49732b||0x1f4;return function(_0x13cc5a){logger[_0x734b('0x27')](_0x13cc5a['stack']);if(_0x13cc5a[_0x734b('0x28')]){delete _0x13cc5a[_0x734b('0x28')];}_0x566d55[_0x734b('0x19')](_0x49732b)[_0x734b('0x29')](_0x13cc5a);};}exports[_0x734b('0x2a')]=function(_0x1b8295,_0x3ba39c){var _0x5c6c5d={},_0x1f3652={},_0x436efe={'count':0x0,'rows':[]};var _0x42e9ae=_[_0x734b('0x2b')](db[_0x734b('0x2c')][_0x734b('0x2d')],function(_0x1fed72){return{'name':_0x1fed72[_0x734b('0x2e')],'type':_0x1fed72[_0x734b('0x2f')][_0x734b('0x30')]};});_0x1f3652['model']=_[_0x734b('0x2b')](_0x42e9ae,_0x734b('0x28'));_0x1f3652['query']=_[_0x734b('0x31')](_0x1b8295[_0x734b('0x32')]);_0x1f3652[_0x734b('0x33')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],_0x1f3652[_0x734b('0x32')]);_0x5c6c5d[_0x734b('0x36')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],qs[_0x734b('0x37')](_0x1b8295[_0x734b('0x32')][_0x734b('0x37')]));_0x5c6c5d[_0x734b('0x36')]=_0x5c6c5d[_0x734b('0x36')][_0x734b('0x38')]?_0x5c6c5d['attributes']:_0x1f3652[_0x734b('0x35')];if(!_0x1b8295['query'][_0x734b('0x39')](_0x734b('0x3a'))){_0x5c6c5d[_0x734b('0x1e')]=qs[_0x734b('0x1e')](_0x1b8295[_0x734b('0x32')][_0x734b('0x1e')]);_0x5c6c5d['offset']=qs['offset'](_0x1b8295[_0x734b('0x32')]['offset']);}_0x5c6c5d[_0x734b('0x3b')]=qs['sort'](_0x1b8295[_0x734b('0x32')]['sort']);_0x5c6c5d[_0x734b('0x3c')]=qs['filters'](_[_0x734b('0x3d')](_0x1b8295[_0x734b('0x32')],_0x1f3652[_0x734b('0x33')]),_0x42e9ae);if(_0x1b8295[_0x734b('0x32')][_0x734b('0x3e')]){_0x5c6c5d[_0x734b('0x3c')]=_[_0x734b('0x3f')](_0x5c6c5d['where'],{'$or':_[_0x734b('0x2b')](_0x42e9ae,function(_0x317d32){if(_0x317d32['type']!==_0x734b('0x40')){var _0x309b31={};_0x309b31[_0x317d32[_0x734b('0x28')]]={'$like':'%'+_0x1b8295[_0x734b('0x32')]['filter']+'%'};return _0x309b31;}})});}_0x5c6c5d=_[_0x734b('0x3f')]({},_0x5c6c5d,_0x1b8295[_0x734b('0x41')]);var _0x4efb1f={'where':_0x5c6c5d[_0x734b('0x3c')]};return db[_0x734b('0x2c')]['count'](_0x4efb1f)[_0x734b('0x24')](function(_0x2d8f31){_0x436efe[_0x734b('0x1d')]=_0x2d8f31;if(_0x1b8295[_0x734b('0x32')]['includeAll']){_0x5c6c5d['include']=[{'all':!![]}];}return db[_0x734b('0x2c')]['findAll'](_0x5c6c5d);})['then'](function(_0x121a00){_0x436efe['rows']=_0x121a00;return _0x436efe;})[_0x734b('0x24')](respondWithFilteredResult(_0x3ba39c,_0x5c6c5d))['catch'](handleError(_0x3ba39c,null));};exports[_0x734b('0x42')]=function(_0x337106,_0xe4fe38){var _0x4c3fdc={'raw':!![],'where':{'id':_0x337106[_0x734b('0x43')]['id']}},_0x5cf3a0={};_0x5cf3a0['model']=_['keys'](db[_0x734b('0x2c')][_0x734b('0x2d')]);_0x5cf3a0['query']=_[_0x734b('0x31')](_0x337106['query']);_0x5cf3a0[_0x734b('0x33')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],_0x5cf3a0['query']);_0x4c3fdc[_0x734b('0x36')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],qs[_0x734b('0x37')](_0x337106['query']['fields']));_0x4c3fdc['attributes']=_0x4c3fdc[_0x734b('0x36')]['length']?_0x4c3fdc['attributes']:_0x5cf3a0[_0x734b('0x35')];if(_0x337106['query'][_0x734b('0x44')]){_0x4c3fdc[_0x734b('0x45')]=[{'all':!![]}];}_0x4c3fdc=_[_0x734b('0x3f')]({},_0x4c3fdc,_0x337106[_0x734b('0x41')]);return db['WhatsappQueueReport'][_0x734b('0x46')](_0x4c3fdc)['then'](handleEntityNotFound(_0xe4fe38,null))[_0x734b('0x24')](respondWithResult(_0xe4fe38,null))[_0x734b('0x47')](handleError(_0xe4fe38,null));};exports[_0x734b('0x48')]=function(_0x5cdacb,_0x370326){return db['WhatsappQueueReport'][_0x734b('0x48')](_0x5cdacb[_0x734b('0x49')],{})['then'](respondWithResult(_0x370326,0xc9))[_0x734b('0x47')](handleError(_0x370326,null));};exports[_0x734b('0x4a')]=function(_0x145ced,_0x38125a){if(_0x145ced[_0x734b('0x49')]['id']){delete _0x145ced['body']['id'];}return db[_0x734b('0x2c')]['find']({'where':{'id':_0x145ced[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x38125a,null))[_0x734b('0x24')](saveUpdates(_0x145ced[_0x734b('0x49')],null))[_0x734b('0x24')](respondWithResult(_0x38125a,null))[_0x734b('0x47')](handleError(_0x38125a,null));};exports[_0x734b('0x25')]=function(_0x4b70f2,_0x4c0378){return db['WhatsappQueueReport'][_0x734b('0x46')]({'where':{'id':_0x4b70f2[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c0378,null))[_0x734b('0x24')](removeEntity(_0x4c0378,null))[_0x734b('0x47')](handleError(_0x4c0378,null));};exports['describe']=function(_0x167173,_0x3a9749){return db[_0x734b('0x2c')]['describe']()[_0x734b('0x24')](respondWithResult(_0x3a9749,null))[_0x734b('0x47')](handleError(_0x3a9749,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d165284..5a04b9d 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 _0x3ea4=['moment','bluebird','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x42e2a0,_0xd2a7e1){var _0x3dbf06=function(_0x1a8ed6){while(--_0x1a8ed6){_0x42e2a0['push'](_0x42e2a0['shift']());}};_0x3dbf06(++_0xd2a7e1);}(_0x3ea4,0xc0));var _0x43ea=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0x3ea4[_0x13e724];return _0x334a44;};'use strict';var _=require(_0x43ea('0x0'));var util=require(_0x43ea('0x1'));var logger=require(_0x43ea('0x2'))(_0x43ea('0x3'));var moment=require(_0x43ea('0x4'));var BPromise=require(_0x43ea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43ea('0x6'));var rimraf=require(_0x43ea('0x7'));var config=require(_0x43ea('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x43ea('0x9')]=function(_0x73c2cc,_0x1ca489){return _0x73c2cc[_0x43ea('0xa')](_0x43ea('0xb'),attributes,{'tableName':_0x43ea('0xc'),'paranoid':![],'indexes':[{'name':_0x43ea('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x450d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger'];(function(_0x3f0b1f,_0x5554cb){var _0x123659=function(_0x2ee993){while(--_0x2ee993){_0x3f0b1f['push'](_0x3f0b1f['shift']());}};_0x123659(++_0x5554cb);}(_0x450d,0x6b));var _0xd450=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x450d[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd450('0x0'))(_0xd450('0x1'));var moment=require(_0xd450('0x2'));var BPromise=require(_0xd450('0x3'));var rp=require(_0xd450('0x4'));var fs=require('fs');var path=require(_0xd450('0x5'));var rimraf=require(_0xd450('0x6'));var config=require(_0xd450('0x7'));var attributes=require(_0xd450('0x8'));module['exports']=function(_0x2f353f,_0x5df419){return _0x2f353f['define'](_0xd450('0x9'),attributes,{'tableName':_0xd450('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd450('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 a6f5673..51fe827 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 _0x86c6=['client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','update','raw','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x4c8990,_0x33454d){var _0x516e82=function(_0x2a7bb1){while(--_0x2a7bb1){_0x4c8990['push'](_0x4c8990['shift']());}};_0x516e82(++_0x33454d);}(_0x86c6,0x197));var _0x686c=function(_0x1f3907,_0x9844e0){_0x1f3907=_0x1f3907-0x0;var _0x16f8ea=_0x86c6[_0x1f3907];return _0x16f8ea;};'use strict';var _=require('lodash');var util=require(_0x686c('0x0'));var moment=require(_0x686c('0x1'));var BPromise=require(_0x686c('0x2'));var rs=require(_0x686c('0x3'));var fs=require('fs');var Redis=require(_0x686c('0x4'));var db=require(_0x686c('0x5'))['db'];var utils=require(_0x686c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x686c('0x7'));var jayson=require(_0x686c('0x8'));var client=jayson[_0x686c('0x9')][_0x686c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2491b7,_0x5f2f2f,_0x211804){return new BPromise(function(_0x319dcd,_0x48435a){return client['request'](_0x2491b7,_0x211804)[_0x686c('0xb')](function(_0x26bb44){logger[_0x686c('0xc')](_0x686c('0xd'),_0x5f2f2f,_0x686c('0xe'));logger[_0x686c('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5f2f2f,_0x686c('0xe'),JSON[_0x686c('0x10')](_0x26bb44));if(_0x26bb44[_0x686c('0x11')]){if(_0x26bb44[_0x686c('0x11')][_0x686c('0x12')]===0x1f4){logger['error'](_0x686c('0xd'),_0x5f2f2f,_0x26bb44[_0x686c('0x11')]['message']);return _0x48435a(_0x26bb44['error'][_0x686c('0x13')]);}logger[_0x686c('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5f2f2f,_0x26bb44[_0x686c('0x11')][_0x686c('0x13')]);return _0x319dcd(_0x26bb44[_0x686c('0x11')][_0x686c('0x13')]);}else{logger[_0x686c('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5f2f2f,_0x686c('0xe'));_0x319dcd(_0x26bb44[_0x686c('0x14')][_0x686c('0x13')]);}})[_0x686c('0x15')](function(_0x435aff){logger[_0x686c('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5f2f2f,_0x435aff);_0x48435a(_0x435aff);});});}exports[_0x686c('0x16')]=function(_0x4fbf1a){var _0x5679c9=this;return new Promise(function(_0x330cd2,_0x16357d){return db[_0x686c('0x17')][_0x686c('0x18')](_0x4fbf1a[_0x686c('0x19')],{'raw':_0x4fbf1a[_0x686c('0x1a')]?_0x4fbf1a[_0x686c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x686c('0xb')](function(_0x1b30bd){logger['info']('CreateWhatsappQueueReport',_0x4fbf1a);logger[_0x686c('0xf')](_0x686c('0x16'),_0x4fbf1a,JSON[_0x686c('0x10')](_0x1b30bd));_0x330cd2(_0x1b30bd);})[_0x686c('0x15')](function(_0x381820){logger[_0x686c('0x11')](_0x686c('0x16'),_0x381820[_0x686c('0x13')],_0x4fbf1a);_0x16357d(_0x5679c9['error'](0x1f4,_0x381820['message']));});});};exports[_0x686c('0x1b')]=function(_0x458c4f){var _0x4ebd72=this;return new Promise(function(_0x360938,_0x26e5dc){return db[_0x686c('0x17')][_0x686c('0x1c')](_0x458c4f[_0x686c('0x19')],{'raw':_0x458c4f[_0x686c('0x1a')]?_0x458c4f[_0x686c('0x1a')][_0x686c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x458c4f[_0x686c('0x1a')]?_0x458c4f[_0x686c('0x1a')]['where']||null:null,'attributes':_0x458c4f[_0x686c('0x1a')]?_0x458c4f[_0x686c('0x1a')][_0x686c('0x1e')]||null:null,'limit':_0x458c4f[_0x686c('0x1a')]?_0x458c4f['options'][_0x686c('0x1f')]||null:null})[_0x686c('0xb')](function(_0xee942b){logger['info'](_0x686c('0x1b'),_0x458c4f);logger[_0x686c('0xf')](_0x686c('0x1b'),_0x458c4f,JSON[_0x686c('0x10')](_0xee942b));_0x360938(_0xee942b);})['catch'](function(_0x3e3d01){logger[_0x686c('0x11')]('UpdateWhatsappQueueReport',_0x3e3d01[_0x686c('0x13')],_0x458c4f);_0x26e5dc(_0x4ebd72['error'](0x1f4,_0x3e3d01['message']));});});}; \ No newline at end of file +var _0xba36=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','body','options','CreateWhatsappQueueReport','stringify','catch','WhatsappQueueReport','update','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment'];(function(_0x101c18,_0x608208){var _0x16de76=function(_0xb01c58){while(--_0xb01c58){_0x101c18['push'](_0x101c18['shift']());}};_0x16de76(++_0x608208);}(_0xba36,0x17d));var _0x6ba3=function(_0x274151,_0x374a3d){_0x274151=_0x274151-0x0;var _0x570223=_0xba36[_0x274151];return _0x570223;};'use strict';var _=require(_0x6ba3('0x0'));var util=require(_0x6ba3('0x1'));var moment=require(_0x6ba3('0x2'));var BPromise=require(_0x6ba3('0x3'));var rs=require(_0x6ba3('0x4'));var fs=require('fs');var Redis=require(_0x6ba3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ba3('0x6'))(_0x6ba3('0x7'));var config=require(_0x6ba3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ba3('0x9')][_0x6ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x101be7,_0x2a8d20,_0x369794){return new BPromise(function(_0x1a29ef,_0x112bf2){return client[_0x6ba3('0xb')](_0x101be7,_0x369794)[_0x6ba3('0xc')](function(_0x329875){logger[_0x6ba3('0xd')](_0x6ba3('0xe'),_0x2a8d20,_0x6ba3('0xf'));logger[_0x6ba3('0x10')](_0x6ba3('0x11'),_0x2a8d20,_0x6ba3('0xf'),JSON['stringify'](_0x329875));if(_0x329875[_0x6ba3('0x12')]){if(_0x329875[_0x6ba3('0x12')][_0x6ba3('0x13')]===0x1f4){logger[_0x6ba3('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2a8d20,_0x329875[_0x6ba3('0x12')][_0x6ba3('0x14')]);return _0x112bf2(_0x329875[_0x6ba3('0x12')][_0x6ba3('0x14')]);}logger[_0x6ba3('0x12')](_0x6ba3('0xe'),_0x2a8d20,_0x329875[_0x6ba3('0x12')][_0x6ba3('0x14')]);return _0x1a29ef(_0x329875['error'][_0x6ba3('0x14')]);}else{logger[_0x6ba3('0xd')](_0x6ba3('0xe'),_0x2a8d20,'request\x20sent');_0x1a29ef(_0x329875[_0x6ba3('0x15')][_0x6ba3('0x14')]);}})['catch'](function(_0x49251e){logger[_0x6ba3('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2a8d20,_0x49251e);_0x112bf2(_0x49251e);});});}exports['CreateWhatsappQueueReport']=function(_0x592a6f){var _0x298f47=this;return new Promise(function(_0x171349,_0x553e5a){return db['WhatsappQueueReport']['create'](_0x592a6f[_0x6ba3('0x16')],{'raw':_0x592a6f[_0x6ba3('0x17')]?_0x592a6f['options']['raw']===undefined?!![]:![]:!![]})[_0x6ba3('0xc')](function(_0x507891){logger[_0x6ba3('0xd')](_0x6ba3('0x18'),_0x592a6f);logger[_0x6ba3('0x10')](_0x6ba3('0x18'),_0x592a6f,JSON[_0x6ba3('0x19')](_0x507891));_0x171349(_0x507891);})[_0x6ba3('0x1a')](function(_0x4a7bdc){logger[_0x6ba3('0x12')](_0x6ba3('0x18'),_0x4a7bdc[_0x6ba3('0x14')],_0x592a6f);_0x553e5a(_0x298f47[_0x6ba3('0x12')](0x1f4,_0x4a7bdc[_0x6ba3('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x103997){var _0x52203b=this;return new Promise(function(_0x45437a,_0x5db805){return db[_0x6ba3('0x1b')][_0x6ba3('0x1c')](_0x103997['body'],{'raw':_0x103997[_0x6ba3('0x17')]?_0x103997['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x103997[_0x6ba3('0x17')]?_0x103997[_0x6ba3('0x17')][_0x6ba3('0x1d')]||null:null,'attributes':_0x103997[_0x6ba3('0x17')]?_0x103997[_0x6ba3('0x17')][_0x6ba3('0x1e')]||null:null,'limit':_0x103997['options']?_0x103997['options']['limit']||null:null})[_0x6ba3('0xc')](function(_0x519d74){logger[_0x6ba3('0xd')](_0x6ba3('0x1f'),_0x103997);logger[_0x6ba3('0x10')](_0x6ba3('0x1f'),_0x103997,JSON[_0x6ba3('0x19')](_0x519d74));_0x45437a(_0x519d74);})[_0x6ba3('0x1a')](function(_0x332477){logger['error'](_0x6ba3('0x1f'),_0x332477['message'],_0x103997);_0x5db805(_0x52203b[_0x6ba3('0x12')](0x1f4,_0x332477[_0x6ba3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 94041a2..346a8d3 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 _0x095f=['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','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x095f,0x17f));var _0xf095=function(_0x387527,_0x49565a){_0x387527=_0x387527-0x0;var _0x5050d9=_0x095f[_0x387527];return _0x5050d9;};'use strict';var multer=require(_0xf095('0x0'));var util=require(_0xf095('0x1'));var path=require(_0xf095('0x2'));var timeout=require(_0xf095('0x3'));var express=require(_0xf095('0x4'));var router=express[_0xf095('0x5')]();var fs_extra=require(_0xf095('0x6'));var auth=require(_0xf095('0x7'));var interaction=require(_0xf095('0x8'));var config=require(_0xf095('0x9'));var controller=require(_0xf095('0xa'));router[_0xf095('0xb')]('/',auth[_0xf095('0xc')](),controller[_0xf095('0xd')]);router[_0xf095('0xb')](_0xf095('0xe'),auth[_0xf095('0xc')](),controller[_0xf095('0xf')]);router[_0xf095('0xb')](_0xf095('0x10'),auth['isAuthenticated'](),controller[_0xf095('0x11')]);router[_0xf095('0x12')]('/',auth[_0xf095('0xc')](),controller[_0xf095('0x13')]);router[_0xf095('0x14')](_0xf095('0x10'),auth[_0xf095('0xc')](),controller[_0xf095('0x15')]);router[_0xf095('0x16')](_0xf095('0x10'),auth['isAuthenticated'](),controller[_0xf095('0x17')]);module[_0xf095('0x18')]=router; \ No newline at end of file +var _0x032d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x4ad16a,_0x689fb4){var _0x276304=function(_0x29530f){while(--_0x29530f){_0x4ad16a['push'](_0x4ad16a['shift']());}};_0x276304(++_0x689fb4);}(_0x032d,0xcc));var _0xd032=function(_0x4c5e9f,_0x195e7d){_0x4c5e9f=_0x4c5e9f-0x0;var _0x38857a=_0x032d[_0x4c5e9f];return _0x38857a;};'use strict';var multer=require(_0xd032('0x0'));var util=require(_0xd032('0x1'));var path=require('path');var timeout=require(_0xd032('0x2'));var express=require(_0xd032('0x3'));var router=express['Router']();var fs_extra=require(_0xd032('0x4'));var auth=require(_0xd032('0x5'));var interaction=require(_0xd032('0x6'));var config=require(_0xd032('0x7'));var controller=require(_0xd032('0x8'));router['get']('/',auth[_0xd032('0x9')](),controller[_0xd032('0xa')]);router[_0xd032('0xb')](_0xd032('0xc'),auth[_0xd032('0x9')](),controller['describe']);router[_0xd032('0xb')](_0xd032('0xd'),auth['isAuthenticated'](),controller[_0xd032('0xe')]);router['post']('/',auth[_0xd032('0x9')](),controller[_0xd032('0xf')]);router[_0xd032('0x10')](_0xd032('0xd'),auth[_0xd032('0x9')](),controller['update']);router[_0xd032('0x11')](_0xd032('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd032('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 5accdb4..33b46cb 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 _0x1c77=['account','agent','DATE','exports','STRING','ENUM'];(function(_0x4367a9,_0x32de43){var _0x236d01=function(_0x4b7995){while(--_0x4b7995){_0x4367a9['push'](_0x4367a9['shift']());}};_0x236d01(++_0x32de43);}(_0x1c77,0xed));var _0x71c7=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x1c77[_0x1f7201];return _0x289fd2;};'use strict';var Sequelize=require('sequelize');module[_0x71c7('0x0')]={'uniqueid':{'type':Sequelize[_0x71c7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x71c7('0x2')](_0x71c7('0x3'),_0x71c7('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x71c7('0x5')]}}; \ No newline at end of file +var _0xdc15=['queue','sequelize','STRING','ENUM','account','agent'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0xdc15[_0x5aef17];return _0x43f9d0;};'use strict';var Sequelize=require(_0x5dc1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5dc1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5dc1('0x2')](_0x5dc1('0x3'),_0x5dc1('0x4'),_0x5dc1('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c78e9a5..f4f3e56 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 _0x8357=['index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send'];(function(_0x3c2ed9,_0x107611){var _0x31e9a2=function(_0x10df55){while(--_0x10df55){_0x3c2ed9['push'](_0x3c2ed9['shift']());}};_0x31e9a2(++_0x107611);}(_0x8357,0x1e4));var _0x7835=function(_0x2a648c,_0x3f1f68){_0x2a648c=_0x2a648c-0x0;var _0xa13d5d=_0x8357[_0x2a648c];return _0xa13d5d;};'use strict';var emlformat=require(_0x7835('0x0'));var rimraf=require(_0x7835('0x1'));var zipdir=require(_0x7835('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7835('0x3'));var moment=require(_0x7835('0x4'));var BPromise=require(_0x7835('0x5'));var Mustache=require(_0x7835('0x6'));var util=require(_0x7835('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7835('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7835('0x9'));var _=require(_0x7835('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7835('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7835('0x8'));var querystring=require(_0x7835('0xc'));var Papa=require(_0x7835('0xd'));var Redis=require(_0x7835('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7835('0xf'));var as=require(_0x7835('0x10'));var hardwareService=require(_0x7835('0x11'));var logger=require(_0x7835('0x12'))(_0x7835('0x13'));var utils=require(_0x7835('0x14'));var config=require(_0x7835('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7835('0x16'))['db'];function respondWithStatusCode(_0x7a9441,_0x1c4ae5){_0x1c4ae5=_0x1c4ae5||0xcc;return function(_0xb088e7){if(_0xb088e7){return _0x7a9441[_0x7835('0x17')](_0x1c4ae5);}return _0x7a9441[_0x7835('0x18')](_0x1c4ae5)[_0x7835('0x19')]();};}function respondWithResult(_0x448c30,_0x2cb1da){_0x2cb1da=_0x2cb1da||0xc8;return function(_0x4692f6){if(_0x4692f6){return _0x448c30[_0x7835('0x18')](_0x2cb1da)[_0x7835('0x1a')](_0x4692f6);}};}function respondWithFilteredResult(_0x6da24a,_0x5a26c8){return function(_0x5b95d5){if(_0x5b95d5){var _0x27c40f=typeof _0x5a26c8[_0x7835('0x1b')]===_0x7835('0x1c')&&typeof _0x5a26c8[_0x7835('0x1d')]===_0x7835('0x1c');var _0x48cd33=_0x5b95d5[_0x7835('0x1e')];var _0xf0081e=_0x27c40f?0x0:_0x5a26c8[_0x7835('0x1b')];var _0x4377da=_0x27c40f?_0x5b95d5['count']:_0x5a26c8[_0x7835('0x1b')]+_0x5a26c8[_0x7835('0x1d')];var _0x1d1847;if(_0x4377da>=_0x48cd33){_0x4377da=_0x48cd33;_0x1d1847=0xc8;}else{_0x1d1847=0xce;}_0x6da24a[_0x7835('0x18')](_0x1d1847);return _0x6da24a[_0x7835('0x1f')](_0x7835('0x20'),_0xf0081e+'-'+_0x4377da+'/'+_0x48cd33)['json'](_0x5b95d5);}return null;};}function patchUpdates(_0x262988){return function(_0x1b1955){try{jsonpatch[_0x7835('0x21')](_0x1b1955,_0x262988,!![]);}catch(_0x32cd63){return BPromise[_0x7835('0x22')](_0x32cd63);}return _0x1b1955['save']();};}function saveUpdates(_0x41c60d,_0x4a9f6d){return function(_0x41e4f1){if(_0x41e4f1){return _0x41e4f1['update'](_0x41c60d)[_0x7835('0x23')](function(_0x580656){return _0x580656;});}return null;};}function removeEntity(_0x562868,_0x23c7af){return function(_0x254c7){if(_0x254c7){return _0x254c7[_0x7835('0x24')]()['then'](function(){_0x562868[_0x7835('0x18')](0xcc)[_0x7835('0x19')]();});}};}function handleEntityNotFound(_0x4a0512,_0x46c805){return function(_0x431843){if(!_0x431843){_0x4a0512['sendStatus'](0x194);}return _0x431843;};}function handleError(_0x130b0b,_0x35c26c){_0x35c26c=_0x35c26c||0x1f4;return function(_0x296a79){logger[_0x7835('0x25')](_0x296a79[_0x7835('0x26')]);if(_0x296a79[_0x7835('0x27')]){delete _0x296a79[_0x7835('0x27')];}_0x130b0b[_0x7835('0x18')](_0x35c26c)[_0x7835('0x28')](_0x296a79);};}exports[_0x7835('0x29')]=function(_0x196f3e,_0x59e4b8){var _0x29c15c={},_0x12aceb={},_0x1954fe={'count':0x0,'rows':[]};var _0x2c7cbb=_[_0x7835('0x2a')](db[_0x7835('0x2b')][_0x7835('0x2c')],function(_0x17cc29){return{'name':_0x17cc29[_0x7835('0x2d')],'type':_0x17cc29[_0x7835('0x2e')][_0x7835('0x2f')]};});_0x12aceb['model']=_[_0x7835('0x2a')](_0x2c7cbb,_0x7835('0x27'));_0x12aceb[_0x7835('0x30')]=_[_0x7835('0x31')](_0x196f3e[_0x7835('0x30')]);_0x12aceb[_0x7835('0x32')]=_[_0x7835('0x33')](_0x12aceb[_0x7835('0x34')],_0x12aceb[_0x7835('0x30')]);_0x29c15c[_0x7835('0x35')]=_[_0x7835('0x33')](_0x12aceb[_0x7835('0x34')],qs[_0x7835('0x36')](_0x196f3e[_0x7835('0x30')][_0x7835('0x36')]));_0x29c15c[_0x7835('0x35')]=_0x29c15c['attributes']['length']?_0x29c15c[_0x7835('0x35')]:_0x12aceb[_0x7835('0x34')];if(!_0x196f3e[_0x7835('0x30')]['hasOwnProperty']('nolimit')){_0x29c15c[_0x7835('0x1d')]=qs[_0x7835('0x1d')](_0x196f3e[_0x7835('0x30')][_0x7835('0x1d')]);_0x29c15c[_0x7835('0x1b')]=qs['offset'](_0x196f3e['query'][_0x7835('0x1b')]);}_0x29c15c['order']=qs[_0x7835('0x37')](_0x196f3e[_0x7835('0x30')][_0x7835('0x37')]);_0x29c15c[_0x7835('0x38')]=qs['filters'](_[_0x7835('0x39')](_0x196f3e[_0x7835('0x30')],_0x12aceb[_0x7835('0x32')]),_0x2c7cbb);if(_0x196f3e[_0x7835('0x30')][_0x7835('0x3a')]){_0x29c15c[_0x7835('0x38')]=_[_0x7835('0x3b')](_0x29c15c['where'],{'$or':_['map'](_0x2c7cbb,function(_0x317267){if(_0x317267[_0x7835('0x2e')]!==_0x7835('0x3c')){var _0x32860a={};_0x32860a[_0x317267[_0x7835('0x27')]]={'$like':'%'+_0x196f3e[_0x7835('0x30')]['filter']+'%'};return _0x32860a;}})});}_0x29c15c=_['merge']({},_0x29c15c,_0x196f3e[_0x7835('0x3d')]);var _0x4f0813={'where':_0x29c15c['where']};return db[_0x7835('0x2b')]['count'](_0x4f0813)[_0x7835('0x23')](function(_0x276a65){_0x1954fe[_0x7835('0x1e')]=_0x276a65;if(_0x196f3e[_0x7835('0x30')][_0x7835('0x3e')]){_0x29c15c[_0x7835('0x3f')]=[{'all':!![]}];}return db[_0x7835('0x2b')][_0x7835('0x40')](_0x29c15c);})[_0x7835('0x23')](function(_0x6956e6){_0x1954fe[_0x7835('0x41')]=_0x6956e6;return _0x1954fe;})[_0x7835('0x23')](respondWithFilteredResult(_0x59e4b8,_0x29c15c))['catch'](handleError(_0x59e4b8,null));};exports[_0x7835('0x42')]=function(_0x462907,_0x3617ea){var _0x541a23={'raw':!![],'where':{'id':_0x462907[_0x7835('0x43')]['id']}},_0x2ccd4f={};_0x2ccd4f['model']=_[_0x7835('0x31')](db[_0x7835('0x2b')][_0x7835('0x2c')]);_0x2ccd4f[_0x7835('0x30')]=_[_0x7835('0x31')](_0x462907['query']);_0x2ccd4f[_0x7835('0x32')]=_['intersection'](_0x2ccd4f[_0x7835('0x34')],_0x2ccd4f['query']);_0x541a23[_0x7835('0x35')]=_[_0x7835('0x33')](_0x2ccd4f['model'],qs['fields'](_0x462907[_0x7835('0x30')][_0x7835('0x36')]));_0x541a23['attributes']=_0x541a23[_0x7835('0x35')][_0x7835('0x44')]?_0x541a23[_0x7835('0x35')]:_0x2ccd4f[_0x7835('0x34')];if(_0x462907[_0x7835('0x30')]['includeAll']){_0x541a23[_0x7835('0x3f')]=[{'all':!![]}];}_0x541a23=_[_0x7835('0x3b')]({},_0x541a23,_0x462907[_0x7835('0x3d')]);return db[_0x7835('0x2b')][_0x7835('0x45')](_0x541a23)[_0x7835('0x23')](handleEntityNotFound(_0x3617ea,null))[_0x7835('0x23')](respondWithResult(_0x3617ea,null))[_0x7835('0x46')](handleError(_0x3617ea,null));};exports[_0x7835('0x47')]=function(_0x30795d,_0x17dac6){return db['WhatsappTransferReport'][_0x7835('0x47')](_0x30795d[_0x7835('0x48')],{})['then'](respondWithResult(_0x17dac6,0xc9))[_0x7835('0x46')](handleError(_0x17dac6,null));};exports[_0x7835('0x49')]=function(_0x10dc16,_0x125d28){if(_0x10dc16[_0x7835('0x48')]['id']){delete _0x10dc16[_0x7835('0x48')]['id'];}return db['WhatsappTransferReport'][_0x7835('0x45')]({'where':{'id':_0x10dc16[_0x7835('0x43')]['id']}})[_0x7835('0x23')](handleEntityNotFound(_0x125d28,null))[_0x7835('0x23')](saveUpdates(_0x10dc16['body'],null))[_0x7835('0x23')](respondWithResult(_0x125d28,null))['catch'](handleError(_0x125d28,null));};exports[_0x7835('0x24')]=function(_0x46ab53,_0x4f249d){return db[_0x7835('0x2b')][_0x7835('0x45')]({'where':{'id':_0x46ab53[_0x7835('0x43')]['id']}})[_0x7835('0x23')](handleEntityNotFound(_0x4f249d,null))['then'](removeEntity(_0x4f249d,null))[_0x7835('0x46')](handleError(_0x4f249d,null));};exports[_0x7835('0x4a')]=function(_0x1b20be,_0x417c52){return db[_0x7835('0x2b')][_0x7835('0x4a')]()['then'](respondWithResult(_0x417c52,null))[_0x7835('0x46')](handleError(_0x417c52,null));}; \ No newline at end of file +var _0x1198=['json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','end','error','stack','name','send','WhatsappTransferReport','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x5c0578,_0xef465a){var _0x56d793=function(_0x5acf0e){while(--_0x5acf0e){_0x5c0578['push'](_0x5c0578['shift']());}};_0x56d793(++_0xef465a);}(_0x1198,0x1b4));var _0x8119=function(_0x4755db,_0x37366e){_0x4755db=_0x4755db-0x0;var _0xb0e72b=_0x1198[_0x4755db];return _0xb0e72b;};'use strict';var emlformat=require(_0x8119('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8119('0x1'));var jsonpatch=require(_0x8119('0x2'));var rp=require('request-promise');var moment=require(_0x8119('0x3'));var BPromise=require(_0x8119('0x4'));var Mustache=require(_0x8119('0x5'));var util=require(_0x8119('0x6'));var path=require('path');var sox=require(_0x8119('0x7'));var csv=require(_0x8119('0x8'));var ejs=require(_0x8119('0x9'));var fs=require('fs');var fs_extra=require(_0x8119('0xa'));var _=require(_0x8119('0xb'));var squel=require(_0x8119('0xc'));var crypto=require(_0x8119('0xd'));var jsforce=require(_0x8119('0xe'));var deskjs=require(_0x8119('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8119('0x10'));var Redis=require(_0x8119('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8119('0x12'));var hardwareService=require(_0x8119('0x13'));var logger=require(_0x8119('0x14'))('api');var utils=require(_0x8119('0x15'));var config=require(_0x8119('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8119('0x17'))['db'];function respondWithStatusCode(_0x4d2101,_0x451efc){_0x451efc=_0x451efc||0xcc;return function(_0x37b974){if(_0x37b974){return _0x4d2101[_0x8119('0x18')](_0x451efc);}return _0x4d2101[_0x8119('0x19')](_0x451efc)['end']();};}function respondWithResult(_0x58555d,_0x5de0c5){_0x5de0c5=_0x5de0c5||0xc8;return function(_0x4d9cfd){if(_0x4d9cfd){return _0x58555d[_0x8119('0x19')](_0x5de0c5)[_0x8119('0x1a')](_0x4d9cfd);}};}function respondWithFilteredResult(_0x625a1c,_0x26a140){return function(_0x58af62){if(_0x58af62){var _0x2243e2=typeof _0x26a140['offset']===_0x8119('0x1b')&&typeof _0x26a140[_0x8119('0x1c')]===_0x8119('0x1b');var _0x528d52=_0x58af62[_0x8119('0x1d')];var _0x8d78f0=_0x2243e2?0x0:_0x26a140[_0x8119('0x1e')];var _0x5b9c81=_0x2243e2?_0x58af62['count']:_0x26a140[_0x8119('0x1e')]+_0x26a140[_0x8119('0x1c')];var _0x37ffca;if(_0x5b9c81>=_0x528d52){_0x5b9c81=_0x528d52;_0x37ffca=0xc8;}else{_0x37ffca=0xce;}_0x625a1c[_0x8119('0x19')](_0x37ffca);return _0x625a1c[_0x8119('0x1f')](_0x8119('0x20'),_0x8d78f0+'-'+_0x5b9c81+'/'+_0x528d52)[_0x8119('0x1a')](_0x58af62);}return null;};}function patchUpdates(_0x350b5d){return function(_0x5b6bf4){try{jsonpatch[_0x8119('0x21')](_0x5b6bf4,_0x350b5d,!![]);}catch(_0x446c2e){return BPromise['reject'](_0x446c2e);}return _0x5b6bf4[_0x8119('0x22')]();};}function saveUpdates(_0x4bda7f,_0x2781a1){return function(_0x4bc885){if(_0x4bc885){return _0x4bc885[_0x8119('0x23')](_0x4bda7f)[_0x8119('0x24')](function(_0x2919a6){return _0x2919a6;});}return null;};}function removeEntity(_0x5323e7,_0x1cd8c5){return function(_0x19ec0e){if(_0x19ec0e){return _0x19ec0e['destroy']()[_0x8119('0x24')](function(){_0x5323e7[_0x8119('0x19')](0xcc)[_0x8119('0x25')]();});}};}function handleEntityNotFound(_0x43898c,_0x408c3c){return function(_0x2a1776){if(!_0x2a1776){_0x43898c[_0x8119('0x18')](0x194);}return _0x2a1776;};}function handleError(_0x1cafe5,_0x44baa8){_0x44baa8=_0x44baa8||0x1f4;return function(_0x1b14ae){logger[_0x8119('0x26')](_0x1b14ae[_0x8119('0x27')]);if(_0x1b14ae[_0x8119('0x28')]){delete _0x1b14ae[_0x8119('0x28')];}_0x1cafe5['status'](_0x44baa8)[_0x8119('0x29')](_0x1b14ae);};}exports['index']=function(_0x5aabc8,_0x5186b4){var _0x582998={},_0x4c9532={},_0x789a77={'count':0x0,'rows':[]};var _0x543882=_['map'](db[_0x8119('0x2a')]['rawAttributes'],function(_0x3c5d07){return{'name':_0x3c5d07[_0x8119('0x2b')],'type':_0x3c5d07[_0x8119('0x2c')][_0x8119('0x2d')]};});_0x4c9532[_0x8119('0x2e')]=_[_0x8119('0x2f')](_0x543882,_0x8119('0x28'));_0x4c9532[_0x8119('0x30')]=_[_0x8119('0x31')](_0x5aabc8[_0x8119('0x30')]);_0x4c9532['filters']=_[_0x8119('0x32')](_0x4c9532[_0x8119('0x2e')],_0x4c9532['query']);_0x582998[_0x8119('0x33')]=_['intersection'](_0x4c9532['model'],qs['fields'](_0x5aabc8[_0x8119('0x30')][_0x8119('0x34')]));_0x582998[_0x8119('0x33')]=_0x582998[_0x8119('0x33')]['length']?_0x582998[_0x8119('0x33')]:_0x4c9532['model'];if(!_0x5aabc8[_0x8119('0x30')][_0x8119('0x35')](_0x8119('0x36'))){_0x582998['limit']=qs['limit'](_0x5aabc8['query'][_0x8119('0x1c')]);_0x582998[_0x8119('0x1e')]=qs['offset'](_0x5aabc8[_0x8119('0x30')][_0x8119('0x1e')]);}_0x582998['order']=qs[_0x8119('0x37')](_0x5aabc8[_0x8119('0x30')]['sort']);_0x582998['where']=qs[_0x8119('0x38')](_[_0x8119('0x39')](_0x5aabc8[_0x8119('0x30')],_0x4c9532[_0x8119('0x38')]),_0x543882);if(_0x5aabc8['query'][_0x8119('0x3a')]){_0x582998[_0x8119('0x3b')]=_[_0x8119('0x3c')](_0x582998['where'],{'$or':_[_0x8119('0x2f')](_0x543882,function(_0x343224){if(_0x343224[_0x8119('0x2c')]!==_0x8119('0x3d')){var _0x15de89={};_0x15de89[_0x343224['name']]={'$like':'%'+_0x5aabc8[_0x8119('0x30')][_0x8119('0x3a')]+'%'};return _0x15de89;}})});}_0x582998=_['merge']({},_0x582998,_0x5aabc8['options']);var _0x5e6f1e={'where':_0x582998['where']};return db[_0x8119('0x2a')][_0x8119('0x1d')](_0x5e6f1e)['then'](function(_0x22c283){_0x789a77[_0x8119('0x1d')]=_0x22c283;if(_0x5aabc8['query'][_0x8119('0x3e')]){_0x582998[_0x8119('0x3f')]=[{'all':!![]}];}return db[_0x8119('0x2a')][_0x8119('0x40')](_0x582998);})[_0x8119('0x24')](function(_0x23a0f4){_0x789a77[_0x8119('0x41')]=_0x23a0f4;return _0x789a77;})['then'](respondWithFilteredResult(_0x5186b4,_0x582998))[_0x8119('0x42')](handleError(_0x5186b4,null));};exports[_0x8119('0x43')]=function(_0x55eb9b,_0x1aea63){var _0x9ea270={'raw':!![],'where':{'id':_0x55eb9b[_0x8119('0x44')]['id']}},_0x46c99a={};_0x46c99a[_0x8119('0x2e')]=_[_0x8119('0x31')](db[_0x8119('0x2a')][_0x8119('0x45')]);_0x46c99a[_0x8119('0x30')]=_[_0x8119('0x31')](_0x55eb9b['query']);_0x46c99a['filters']=_[_0x8119('0x32')](_0x46c99a['model'],_0x46c99a['query']);_0x9ea270[_0x8119('0x33')]=_[_0x8119('0x32')](_0x46c99a[_0x8119('0x2e')],qs[_0x8119('0x34')](_0x55eb9b[_0x8119('0x30')][_0x8119('0x34')]));_0x9ea270['attributes']=_0x9ea270[_0x8119('0x33')][_0x8119('0x46')]?_0x9ea270[_0x8119('0x33')]:_0x46c99a[_0x8119('0x2e')];if(_0x55eb9b[_0x8119('0x30')][_0x8119('0x3e')]){_0x9ea270['include']=[{'all':!![]}];}_0x9ea270=_[_0x8119('0x3c')]({},_0x9ea270,_0x55eb9b[_0x8119('0x47')]);return db['WhatsappTransferReport'][_0x8119('0x48')](_0x9ea270)[_0x8119('0x24')](handleEntityNotFound(_0x1aea63,null))['then'](respondWithResult(_0x1aea63,null))['catch'](handleError(_0x1aea63,null));};exports[_0x8119('0x49')]=function(_0x40f025,_0x4191ff){return db[_0x8119('0x2a')][_0x8119('0x49')](_0x40f025[_0x8119('0x4a')],{})[_0x8119('0x24')](respondWithResult(_0x4191ff,0xc9))[_0x8119('0x42')](handleError(_0x4191ff,null));};exports[_0x8119('0x23')]=function(_0x5eccf2,_0x5df646){if(_0x5eccf2[_0x8119('0x4a')]['id']){delete _0x5eccf2[_0x8119('0x4a')]['id'];}return db[_0x8119('0x2a')][_0x8119('0x48')]({'where':{'id':_0x5eccf2[_0x8119('0x44')]['id']}})[_0x8119('0x24')](handleEntityNotFound(_0x5df646,null))[_0x8119('0x24')](saveUpdates(_0x5eccf2[_0x8119('0x4a')],null))[_0x8119('0x24')](respondWithResult(_0x5df646,null))[_0x8119('0x42')](handleError(_0x5df646,null));};exports[_0x8119('0x4b')]=function(_0x1cf740,_0x1401c7){return db[_0x8119('0x2a')][_0x8119('0x48')]({'where':{'id':_0x1cf740[_0x8119('0x44')]['id']}})[_0x8119('0x24')](handleEntityNotFound(_0x1401c7,null))[_0x8119('0x24')](removeEntity(_0x1401c7,null))[_0x8119('0x42')](handleError(_0x1401c7,null));};exports[_0x8119('0x4c')]=function(_0x4110b5,_0x38b681){return db[_0x8119('0x2a')][_0x8119('0x4c')]()[_0x8119('0x24')](respondWithResult(_0x38b681,null))['catch'](handleError(_0x38b681,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a2f3035..9271207 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 _0xfb17=['path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','api','moment','bluebird','request-promise'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xfb17,0x119));var _0x7fb1=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xfb17[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x7fb1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7fb1('0x1'));var moment=require(_0x7fb1('0x2'));var BPromise=require(_0x7fb1('0x3'));var rp=require(_0x7fb1('0x4'));var fs=require('fs');var path=require(_0x7fb1('0x5'));var rimraf=require('rimraf');var config=require(_0x7fb1('0x6'));var attributes=require(_0x7fb1('0x7'));module[_0x7fb1('0x8')]=function(_0x5b3d34,_0x2bb1b7){return _0x5b3d34[_0x7fb1('0x9')](_0x7fb1('0xa'),attributes,{'tableName':_0x7fb1('0xb'),'paranoid':![],'indexes':[{'name':_0x7fb1('0xc'),'fields':[_0x7fb1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bf7=['util','api','moment','path','rimraf','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x5ec439,_0x4f2761){var _0x212ba2=function(_0x414305){while(--_0x414305){_0x5ec439['push'](_0x5ec439['shift']());}};_0x212ba2(++_0x4f2761);}(_0x5bf7,0x78));var _0x75bf=function(_0x35659c,_0x48a62e){_0x35659c=_0x35659c-0x0;var _0x3837b8=_0x5bf7[_0x35659c];return _0x3837b8;};'use strict';var _=require(_0x75bf('0x0'));var util=require(_0x75bf('0x1'));var logger=require('../../config/logger')(_0x75bf('0x2'));var moment=require(_0x75bf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75bf('0x4'));var rimraf=require(_0x75bf('0x5'));var config=require('../../config/environment');var attributes=require(_0x75bf('0x6'));module[_0x75bf('0x7')]=function(_0xdae5c4,_0x4402a6){return _0xdae5c4[_0x75bf('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0x75bf('0x9'),'paranoid':![],'indexes':[{'name':_0x75bf('0xa'),'fields':[_0x75bf('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 223f570..29c7fd5 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 _0x69f4=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4fd5bc,_0x56f503){var _0x6b69d7=function(_0x1222f4){while(--_0x1222f4){_0x4fd5bc['push'](_0x4fd5bc['shift']());}};_0x6b69d7(++_0x56f503);}(_0x69f4,0x1b5));var _0x469f=function(_0x48a578,_0x3c410d){_0x48a578=_0x48a578-0x0;var _0x2061a2=_0x69f4[_0x48a578];return _0x2061a2;};'use strict';var _=require(_0x469f('0x0'));var util=require(_0x469f('0x1'));var moment=require(_0x469f('0x2'));var BPromise=require(_0x469f('0x3'));var rs=require(_0x469f('0x4'));var fs=require('fs');var Redis=require(_0x469f('0x5'));var db=require(_0x469f('0x6'))['db'];var utils=require(_0x469f('0x7'));var logger=require(_0x469f('0x8'))(_0x469f('0x9'));var config=require(_0x469f('0xa'));var jayson=require(_0x469f('0xb'));var client=jayson['client'][_0x469f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7af7e,_0x5b92d5,_0x3aa6fe){return new BPromise(function(_0x592c82,_0x346fbe){return client[_0x469f('0xd')](_0x7af7e,_0x3aa6fe)['then'](function(_0x3f5177){logger[_0x469f('0xe')](_0x469f('0xf'),_0x5b92d5,_0x469f('0x10'));logger[_0x469f('0x11')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5b92d5,_0x469f('0x10'),JSON[_0x469f('0x12')](_0x3f5177));if(_0x3f5177[_0x469f('0x13')]){if(_0x3f5177['error'][_0x469f('0x14')]===0x1f4){logger[_0x469f('0x13')](_0x469f('0xf'),_0x5b92d5,_0x3f5177['error'][_0x469f('0x15')]);return _0x346fbe(_0x3f5177['error'][_0x469f('0x15')]);}logger[_0x469f('0x13')](_0x469f('0xf'),_0x5b92d5,_0x3f5177[_0x469f('0x13')][_0x469f('0x15')]);return _0x592c82(_0x3f5177[_0x469f('0x13')][_0x469f('0x15')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x5b92d5,'request\x20sent');_0x592c82(_0x3f5177[_0x469f('0x16')][_0x469f('0x15')]);}})[_0x469f('0x17')](function(_0x186fd2){logger['error'](_0x469f('0xf'),_0x5b92d5,_0x186fd2);_0x346fbe(_0x186fd2);});});} \ No newline at end of file +var _0xb45e=['client','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x2f3db3,_0x4176cc){var _0x531014=function(_0xb09258){while(--_0xb09258){_0x2f3db3['push'](_0x2f3db3['shift']());}};_0x531014(++_0x4176cc);}(_0xb45e,0x90));var _0xeb45=function(_0xcfcb85,_0x3e81b2){_0xcfcb85=_0xcfcb85-0x0;var _0x3acac1=_0xb45e[_0xcfcb85];return _0x3acac1;};'use strict';var _=require(_0xeb45('0x0'));var util=require('util');var moment=require(_0xeb45('0x1'));var BPromise=require(_0xeb45('0x2'));var rs=require(_0xeb45('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb45('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb45('0x5'))(_0xeb45('0x6'));var config=require('../../config/environment');var jayson=require(_0xeb45('0x7'));var client=jayson[_0xeb45('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b73df,_0x1159e9,_0x48ef43){return new BPromise(function(_0x3a7ced,_0x1aec90){return client['request'](_0x3b73df,_0x48ef43)['then'](function(_0x5bb7e5){logger[_0xeb45('0x9')](_0xeb45('0xa'),_0x1159e9,'request\x20sent');logger['debug'](_0xeb45('0xb'),_0x1159e9,_0xeb45('0xc'),JSON[_0xeb45('0xd')](_0x5bb7e5));if(_0x5bb7e5[_0xeb45('0xe')]){if(_0x5bb7e5[_0xeb45('0xe')][_0xeb45('0xf')]===0x1f4){logger['error'](_0xeb45('0xa'),_0x1159e9,_0x5bb7e5['error']['message']);return _0x1aec90(_0x5bb7e5[_0xeb45('0xe')][_0xeb45('0x10')]);}logger['error'](_0xeb45('0xa'),_0x1159e9,_0x5bb7e5[_0xeb45('0xe')][_0xeb45('0x10')]);return _0x3a7ced(_0x5bb7e5[_0xeb45('0xe')][_0xeb45('0x10')]);}else{logger[_0xeb45('0x9')](_0xeb45('0xa'),_0x1159e9,_0xeb45('0xc'));_0x3a7ced(_0x5bb7e5[_0xeb45('0x11')][_0xeb45('0x10')]);}})[_0xeb45('0x12')](function(_0x36bddc){logger[_0xeb45('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1159e9,_0x36bddc);_0x1aec90(_0x36bddc);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 97200d1..de46f32 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5075=['./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc'];(function(_0x469e2e,_0x4d1f69){var _0x5b6ba5=function(_0x5cab97){while(--_0x5cab97){_0x469e2e['push'](_0x469e2e['shift']());}};_0x5b6ba5(++_0x4d1f69);}(_0x5075,0x73));var _0x5507=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x5075[_0x258b93];return _0x35484b;};'use strict';var _=require(_0x5507('0x0'));var db=require(_0x5507('0x1'))['db'];var seedDb=require(_0x5507('0x2'));var checkLicense=require(_0x5507('0x3'));var rpc=require(_0x5507('0x4'));var config=require(_0x5507('0x5'));var logger=require(_0x5507('0x6'))('app');var pm2=require(_0x5507('0x7'));var pm2Config=require(_0x5507('0x8'));var schedule=require(_0x5507('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x5507('0xa'));var provider=require(_0x5507('0xb'));function main(){return db['sequelize'][_0x5507('0xc')]()[_0x5507('0xd')](function(){if(config[_0x5507('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x5507('0xf')]();})[_0x5507('0xd')](function(){return rpc[_0x5507('0x10')]();})[_0x5507('0xd')](function(_0x50d6f5){logger[_0x5507('0x11')](_0x50d6f5);return chat[_0x5507('0x12')]();})['then'](function(){return whatsapp[_0x5507('0x12')]();})[_0x5507('0xd')](function(){return schedule['start']();})[_0x5507('0xd')](function(){return transcribe[_0x5507('0x12')]();})[_0x5507('0xd')](function(){return provider[_0x5507('0x12')]();})[_0x5507('0xd')](function(_0x1f3886){logger['info'](_0x1f3886);return pm2[_0x5507('0x12')](pm2Config);})[_0x5507('0xd')](function(_0xc828e5){var _0x46545d=_0xc828e5['filter'](function(_0x49e400){return typeof _0x49e400[_0x5507('0x13')]===_0x5507('0x14')&&_0x49e400[_0x5507('0x13')]>=0x0;});if(_0x46545d[_0x5507('0x15')]>0x0){throw new Error(_0x46545d[_0x5507('0x15')]+_0x5507('0x16')+_[_0x5507('0x17')](_0x46545d,function(_0x3d1619){return'\x22'+_0x3d1619[_0x5507('0x18')][_0x5507('0x19')]+'\x22';}));}logger[_0x5507('0x11')](_0x5507('0x1a'),_['map'](_[_0x5507('0x1b')](_0xc828e5,{'status':_0x5507('0x1c')}),_0x5507('0x19'))[_0x5507('0x1d')]());logger['info'](_0x5507('0x1e'),_[_0x5507('0x17')](_[_0x5507('0x1b')](_0xc828e5,function(_0x3ca1f7){return _0x3ca1f7[_0x5507('0x1f')]!==_0x5507('0x1c');}),'name')[_0x5507('0x1d')]()||_0x5507('0x20'));console[_0x5507('0x21')](_0x5507('0x22'));})[_0x5507('0x23')](function(_0x2de482){console[_0x5507('0x21')](_0x5507('0x24'),_0x2de482);logger[_0x5507('0x25')](_0x5507('0x26'),_0x2de482);process[_0x5507('0x27')](0x1);});}main(); \ No newline at end of file +var _0x9c48=['seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','name','map','join','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then'];(function(_0x5ca0b9,_0x410bd6){var _0x42fe7f=function(_0x450865){while(--_0x450865){_0x5ca0b9['push'](_0x5ca0b9['shift']());}};_0x42fe7f(++_0x410bd6);}(_0x9c48,0xa1));var _0x89c4=function(_0x2c24b8,_0x168e0b){_0x2c24b8=_0x2c24b8-0x0;var _0x563ed6=_0x9c48[_0x2c24b8];return _0x563ed6;};'use strict';var _=require(_0x89c4('0x0'));var db=require(_0x89c4('0x1'))['db'];var seedDb=require(_0x89c4('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x89c4('0x3'));var config=require(_0x89c4('0x4'));var logger=require(_0x89c4('0x5'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x89c4('0x6'));var schedule=require(_0x89c4('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x89c4('0x8'));var transcribe=require(_0x89c4('0x9'));var provider=require(_0x89c4('0xa'));function main(){return db[_0x89c4('0xb')][_0x89c4('0xc')]()[_0x89c4('0xd')](function(){if(config[_0x89c4('0xe')]){return seedDb[_0x89c4('0xf')]();}})[_0x89c4('0xd')](function(){return checkLicense[_0x89c4('0xf')]();})[_0x89c4('0xd')](function(){return rpc[_0x89c4('0x10')]();})[_0x89c4('0xd')](function(_0xd445){logger[_0x89c4('0x11')](_0xd445);return chat[_0x89c4('0x12')]();})[_0x89c4('0xd')](function(){return whatsapp[_0x89c4('0x12')]();})[_0x89c4('0xd')](function(){return schedule[_0x89c4('0x12')]();})['then'](function(){return transcribe['start']();})['then'](function(){return provider[_0x89c4('0x12')]();})[_0x89c4('0xd')](function(_0x256a60){logger[_0x89c4('0x11')](_0x256a60);return pm2[_0x89c4('0x12')](pm2Config);})[_0x89c4('0xd')](function(_0x84b446){var _0x5aca22=_0x84b446[_0x89c4('0x13')](function(_0x2bd1d8){return typeof _0x2bd1d8[_0x89c4('0x14')]===_0x89c4('0x15')&&_0x2bd1d8['exitCode']>=0x0;});if(_0x5aca22[_0x89c4('0x16')]>0x0){throw new Error(_0x5aca22[_0x89c4('0x16')]+_0x89c4('0x17')+_['map'](_0x5aca22,function(_0x41cb06){return'\x22'+_0x41cb06['pm2_env'][_0x89c4('0x18')]+'\x22';}));}logger[_0x89c4('0x11')]('Online\x20apps:',_[_0x89c4('0x19')](_['filter'](_0x84b446,{'status':'online'}),_0x89c4('0x18'))[_0x89c4('0x1a')]());logger[_0x89c4('0x11')]('Offline\x20apps:',_[_0x89c4('0x19')](_['filter'](_0x84b446,function(_0x38e347){return _0x38e347[_0x89c4('0x1b')]!=='online';}),_0x89c4('0x18'))[_0x89c4('0x1a')]()||_0x89c4('0x1c'));console[_0x89c4('0x1d')](_0x89c4('0x1e'));})[_0x89c4('0x1f')](function(_0x5395fc){console[_0x89c4('0x1d')](_0x89c4('0x20'),_0x5395fc);logger['error'](_0x89c4('0x21'),_0x5395fc);process[_0x89c4('0x22')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c1222e2..e5627ed 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 _0xa571=['verify','randomBytes','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','basic-auth','bluebird','util','moment','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','catch','headers','authorization','Basic','find','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','cookie','motion.token','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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','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','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','promisify','secret','payload','options'];(function(_0xd60031,_0x5efb93){var _0x43d00a=function(_0x21ac92){while(--_0x21ac92){_0xd60031['push'](_0xd60031['shift']());}};_0x43d00a(++_0x5efb93);}(_0xa571,0x107));var _0x1a57=function(_0xaa7e97,_0x58f5e1){_0xaa7e97=_0xaa7e97-0x0;var _0x5b7a56=_0xa571[_0xaa7e97];return _0x5b7a56;};'use strict';var db=require(_0x1a57('0x0'))['db'];var config=require(_0x1a57('0x1'));var hardwareConf=require(_0x1a57('0x2'));var licenseUtil=require(_0x1a57('0x3'));var encryptor=require('../encryptor');var _=require(_0x1a57('0x4'));var jwt=require(_0x1a57('0x5'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x1a57('0x6'));var crypto=require('crypto');var BPromise=require(_0x1a57('0x7'));var util=require(_0x1a57('0x8'));var moment=require(_0x1a57('0x9'));var validateJwt=expressJwt({'secret':config[_0x1a57('0xa')][_0x1a57('0xb')]});var userAttributes=['id',_0x1a57('0xc'),'fullname',_0x1a57('0xd'),_0x1a57('0xe'),_0x1a57('0xf'),'userpic',_0x1a57('0x10'),_0x1a57('0x11'),_0x1a57('0x12'),_0x1a57('0x13'),_0x1a57('0x14'),_0x1a57('0x15'),_0x1a57('0x16'),_0x1a57('0x17'),'pauseType','showWebBar',_0x1a57('0x18'),_0x1a57('0x19'),_0x1a57('0x1a'),'allowmessenger',_0x1a57('0x1b'),_0x1a57('0x1c'),'phoneBarAutoAnswer',_0x1a57('0x1d'),'phoneBarDnd',_0x1a57('0x1e'),_0x1a57('0x1f'),_0x1a57('0x20'),_0x1a57('0x21'),'phoneBarPrefixRequired',_0x1a57('0x22'),'phoneBarRemoteControlPort','hotdesk',_0x1a57('0x23'),_0x1a57('0x24'),_0x1a57('0x25'),'settingsEnabled',_0x1a57('0x26'),_0x1a57('0x27'),_0x1a57('0x28'),'downloadAttachments',_0x1a57('0x29'),_0x1a57('0x2a'),_0x1a57('0x2b'),_0x1a57('0x2c'),_0x1a57('0x2d'),'emailAutoanswerDelay','smsAutoanswer',_0x1a57('0x2e'),_0x1a57('0x2f'),_0x1a57('0x30'),'faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0x1a57('0x31'),_0x1a57('0x32')];exports[_0x1a57('0x33')]=function(){return this[_0x1a57('0x34')](!![])[_0x1a57('0x35')](function(_0x39d3ce,_0x2efa49,_0x2f8b00){if(_0x39d3ce[_0x1a57('0x36')]){_0x2f8b00();}else{return db[_0x1a57('0x37')][_0x1a57('0x38')]({'where':{'id':_0x39d3ce[_0x1a57('0x39')]['id']},'attributes':['id',_0x1a57('0x3a'),_0x1a57('0x3b')],'raw':!![]})[_0x1a57('0x3c')](function(_0x182649){if(_0x182649&&_0x182649[_0x1a57('0x3a')]){return _0x2efa49[_0x1a57('0x3d')](_0x182649[_0x1a57('0x3b')]===_0x1a57('0x3e')?0x195:0x193)[_0x1a57('0x3f')]({'message':_0x182649[_0x1a57('0x3b')]==='unmanaged'?'Unmanaged.':_0x1a57('0x40')});}else{_0x2f8b00();}})[_0x1a57('0x41')](function(_0x545041){_0x2f8b00(_0x545041);});}});};exports[_0x1a57('0x34')]=function isAuthenticated(_0x54f6a5){return compose()[_0x1a57('0x35')](function(_0x4a2901,_0x53bf6e,_0x8179a4){var _0x274fe6;if(_0x4a2901[_0x1a57('0x42')][_0x1a57('0x43')]){if(_['startsWith'](_0x4a2901[_0x1a57('0x42')][_0x1a57('0x43')],_0x1a57('0x44'))){var _0x160536=basicAuth(_0x4a2901);db['User'][_0x1a57('0x45')]({'where':{'name':_0x160536[_0x1a57('0xd')]}})[_0x1a57('0x3c')](function(_0x32f79f){if(!_0x32f79f||!_0x32f79f[_0x1a57('0x46')](_0x160536[_0x1a57('0x47')])){return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':_0x1a57('0x48')});}_0x4a2901['user']={'id':_0x32f79f['id']};_0x8179a4();})[_0x1a57('0x41')](function(_0x1e27b4){_0x8179a4(_0x1e27b4);});}else if(_['startsWith'](_0x4a2901['headers'][_0x1a57('0x43')],_0x1a57('0x49'))){validateJwt(_0x4a2901,_0x53bf6e,_0x8179a4);}else{if(_0x54f6a5){_0x8179a4();}else{return _0x53bf6e[_0x1a57('0x3d')](0x193)[_0x1a57('0x3f')]({'message':_0x1a57('0x4a')});}}}else if(_0x4a2901[_0x1a57('0x4b')][_0x1a57('0x4c')]){try{var _0x41e466={'audience':hardwareConf[_0x1a57('0x4d')](),'issuer':hardwareConf[_0x1a57('0x4d')]()};verifyJwt(_0x4a2901[_0x1a57('0x4b')][_0x1a57('0x4c')],_0x41e466)[_0x1a57('0x3c')](function(_0x1a6231){return db[_0x1a57('0x4e')][_0x1a57('0x45')]({'where':{'id':_0x1a6231[_0x1a57('0x4f')]}})[_0x1a57('0x3c')](function(_0x53432f){_0x274fe6=_0x53432f;return db[_0x1a57('0x50')][_0x1a57('0x38')]({'where':{'id':0x1},'attributes':[_0x1a57('0x51'),_0x1a57('0x52')],'raw':!![]});})[_0x1a57('0x3c')](function(_0xf64cb5){if(!_0x274fe6||!_[_0x1a57('0x53')](_0x274fe6[_0x1a57('0x54')],_0x1a6231[_0x1a57('0x55')])){return _0x53bf6e['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x274fe6['disabled']){return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':_0x1a57('0x56')});}if(_0x274fe6['blocked']){if(_0xf64cb5[_0x1a57('0x52')]>0x0){if(moment(_0x274fe6[_0x1a57('0x57')])[_0x1a57('0x58')](_0xf64cb5[_0x1a57('0x52')],'minutes')>moment()){return _0x53bf6e[_0x1a57('0x3d')](0x191)['json']({'message':_0x1a57('0x56')});}}else{return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x4a2901[_0x1a57('0x36')]={'id':_0x274fe6['id']};_0x8179a4();});})[_0x1a57('0x41')](function(){return _0x53bf6e[_0x1a57('0x3d')](0x191)[_0x1a57('0x3f')]({'message':_0x1a57('0x56')});});}catch(_0x528ed3){_0x8179a4(_0x528ed3);}}else if(_0x54f6a5){_0x8179a4();}else{return _0x53bf6e[_0x1a57('0x3d')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x1a57('0x35')](function(_0x5b42bd,_0x433878,_0x398c59){if(_0x5b42bd[_0x1a57('0x36')]){db['User'][_0x1a57('0x45')]({'where':{'id':_0x5b42bd[_0x1a57('0x36')]['id']},'attributes':userAttributes})[_0x1a57('0x3c')](function(_0x392217){if(!_0x392217){return _0x433878['status'](0x194)[_0x1a57('0x3f')]({'message':_0x1a57('0x59')});}_0x5b42bd['user']=_0x392217;_0x398c59();})[_0x1a57('0x41')](function(_0x4c0759){_0x398c59(_0x4c0759);});}else if(_0x54f6a5){_0x398c59();}else{return _0x433878['status'](0x194)[_0x1a57('0x3f')]({'message':_0x1a57('0x5a')});}});};exports[_0x1a57('0x5b')]=function canUpdate(){return compose()[_0x1a57('0x35')](function(_0x5c0f5d,_0x44167e,_0xec234d){return licenseUtil[_0x1a57('0x5c')]()[_0x1a57('0x3c')](function(_0x473524){if(_0x473524['update']){_0xec234d();}else{return _0x44167e[_0x1a57('0x3d')](0x193)[_0x1a57('0x3f')]({'message':_0x1a57('0x5d')});}})[_0x1a57('0x41')](function(_0x4e540d){_0xec234d(_0x4e540d);});});};exports[_0x1a57('0x5e')]=function isWebrtcLicence(){return compose()['use'](function(_0x4bbfc3,_0x36f8dc,_0x167b40){return licenseUtil[_0x1a57('0x5c')]()[_0x1a57('0x3c')](function(_0x445df1){if(_0x445df1[_0x1a57('0x5f')]){_0x167b40();}else{return _0x36f8dc[_0x1a57('0x3d')](0x193)[_0x1a57('0x3f')]({'message':_0x1a57('0x5d')});}})[_0x1a57('0x41')](function(_0x136335){_0x167b40(_0x136335);});});};exports[_0x1a57('0x60')]=function(_0x47f9da,_0xf4d056,_0x480aff){_0x47f9da[_0x1a57('0x60')]=!![];return _0x480aff();};exports[_0x1a57('0x61')]=function signToken(_0x38b334){return signJwt(_0x38b334);};exports[_0x1a57('0x62')]=function(_0x323af1,_0x3cbb9e){if(!_0x323af1[_0x1a57('0x36')]){return _0x3cbb9e[_0x1a57('0x3d')](0x194)[_0x1a57('0x3f')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x193b77={'payload':{'id':_0x323af1[_0x1a57('0x36')]['id'],'role':_0x323af1['user'][_0x1a57('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x193b77)[_0x1a57('0x3c')](function(_0x594f94){_0x3cbb9e[_0x1a57('0x63')](_0x1a57('0x64'),_0x594f94);_0x3cbb9e['redirect']('/dashboards/general');})['catch'](function(_0x2c1bac){return _0x3cbb9e[_0x1a57('0x3d')](0x1f4)['send'](_0x2c1bac);});};exports[_0x1a57('0x65')]=function(_0x18267c){if(_['isNil'](_0x18267c['apiKeyNonce'])||_['isNil'](_0x18267c[_0x1a57('0x66')])){return null;}else{return createJwt(_0x18267c);}};exports[_0x1a57('0x67')]=function(_0x431cf5){_0x431cf5[_0x1a57('0x54')]=generateNonce();_0x431cf5[_0x1a57('0x66')]=generateIssuedAt();return createJwt(_0x431cf5);};exports[_0x1a57('0x68')]=function(_0xd64b3a,_0x1f705b){var _0x516aff=_0xd64b3a['query']['apikey'];if(_0x516aff){var _0x5ef58d={'nonce':_0x1f705b['apiKeyNonce'],'iat':_0x1f705b[_0x1a57('0x66')],'audience':hardwareConf[_0x1a57('0x4d')](),'issuer':hardwareConf[_0x1a57('0x4d')]()};return verifyJwt(_0x516aff,_0x5ef58d)[_0x1a57('0x3c')](function(){return generateApiKey(_0x1f705b);});}else{throw{'message':_0x1a57('0x69')};}};exports[_0x1a57('0x6a')]=function(_0xe710e){var _0x3bf7f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3bf7f0['test'](_0xe710e))throw new db['Sequelize']['ValidationError'](_0x1a57('0x6b'));return;};exports['validatePasswordHistory']=function(_0x301db9,_0x10c058,_0x408e67){var _0x352aca=encryptor[_0x1a57('0x6c')](_0x10c058)[_0x1a57('0x6d')](',');for(var _0x5a80be=0x0;_0x5a80be<_0x408e67;_0x5a80be++){if(!_0x352aca[_0x5a80be])break;if(_0x301db9['toLowerCase']()===_0x352aca[_0x5a80be]['toLowerCase']()){var _0x4d5b1d=util[_0x1a57('0x6e')](_0x1a57('0x6f'),_0x408e67);if(_0x408e67===0x1){_0x4d5b1d=_0x1a57('0x70');}throw new db[(_0x1a57('0x71'))][(_0x1a57('0x72'))](_0x4d5b1d);}}return;};exports[_0x1a57('0x73')]=function(_0x2ca029,_0x4ab246){var _0x5b691c=_0x4ab246?encryptor[_0x1a57('0x6c')](_0x4ab246)[_0x1a57('0x6d')](','):[];if(_0x5b691c[_0x1a57('0x74')]===0x5){_0x5b691c[_0x1a57('0x75')](-0x1,0x1);}_0x5b691c[_0x1a57('0x76')](_0x2ca029);return encryptor[_0x1a57('0x77')](_0x5b691c['join'](','));};function signJwt(_0x47db75){var _0x3bf6dd=BPromise[_0x1a57('0x78')](jwt['sign'],{'context':jwt});var _0x55c89e=_0x47db75[_0x1a57('0x79')]||config[_0x1a57('0xa')][_0x1a57('0xb')];return new BPromise(function(_0x10ceb8,_0x3ddc7e){_0x3bf6dd(_0x47db75[_0x1a57('0x7a')],_0x55c89e,_0x47db75[_0x1a57('0x7b')])['then'](function(_0x5913cf){_0x10ceb8(_0x5913cf);})[_0x1a57('0x41')](function(_0x69da3c){_0x3ddc7e(_0x69da3c);});});}function verifyJwt(_0x299fb7,_0x2e0ba6,_0x5d92dc){var _0x33092d=BPromise[_0x1a57('0x78')](jwt[_0x1a57('0x7c')],{'context':jwt});var _0x33c8d4=_0x5d92dc||config[_0x1a57('0xa')]['session'];return new BPromise(function(_0x4aa36d,_0x59d0b0){_0x33092d(_0x299fb7,_0x33c8d4,_0x2e0ba6)[_0x1a57('0x3c')](function(_0x223ba5){_0x4aa36d(_0x223ba5);})[_0x1a57('0x41')](function(_0x33ffe5){_0x59d0b0(_0x33ffe5);});});}function generateNonce(){return crypto[_0x1a57('0x7d')](0x10)[_0x1a57('0x7e')](_0x1a57('0x7f'));}function generateIssuedAt(){return Math[_0x1a57('0x80')](Date['now']()/0x3e8)[_0x1a57('0x7e')]();}function createJwt(_0x39399b){var _0x50ff89={'payload':{'iat':_0x39399b['apiKeyIat'],'nonce':_0x39399b[_0x1a57('0x54')]},'options':{'algorithm':'HS512','subject':_0x39399b['id'][_0x1a57('0x7e')](),'issuer':hardwareConf[_0x1a57('0x4d')](),'audience':hardwareConf[_0x1a57('0x4d')]()}};return signJwt(_0x50ff89)[_0x1a57('0x3c')](function(_0x3e7603){return{'iat':_0x39399b[_0x1a57('0x66')],'nonce':_0x39399b[_0x1a57('0x54')],'token':_0x3e7603};});} \ No newline at end of file +var _0xef0f=['settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','use','user','ChatInteraction','findOne','params','then','closed','status','disposition','unmanaged','json','Forbidden.','catch','isAuthenticated','headers','authorization','User','pass','Bearer','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','isWebrtcLicence','Forbidden','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','decryptString','length','unshift','encryptString','promisify','sign','secret','payload','options','verify','toString','hex','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','util','moment','secrets','session','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled'];(function(_0x34da9a,_0xac0dc){var _0x43521e=function(_0x382858){while(--_0x382858){_0x34da9a['push'](_0x34da9a['shift']());}};_0x43521e(++_0xac0dc);}(_0xef0f,0x168));var _0xfef0=function(_0x29098f,_0x395ae2){_0x29098f=_0x29098f-0x0;var _0x1f84ce=_0xef0f[_0x29098f];return _0x1f84ce;};'use strict';var db=require(_0xfef0('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xfef0('0x1'));var licenseUtil=require(_0xfef0('0x2'));var encryptor=require(_0xfef0('0x3'));var _=require('lodash');var jwt=require(_0xfef0('0x4'));var expressJwt=require(_0xfef0('0x5'));var compose=require(_0xfef0('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0xfef0('0x7'));var BPromise=require(_0xfef0('0x8'));var util=require(_0xfef0('0x9'));var moment=require(_0xfef0('0xa'));var validateJwt=expressJwt({'secret':config[_0xfef0('0xb')][_0xfef0('0xc')]});var userAttributes=['id','role',_0xfef0('0xd'),'name',_0xfef0('0xe'),_0xfef0('0xf'),_0xfef0('0x10'),_0xfef0('0x11'),_0xfef0('0x12'),_0xfef0('0x13'),_0xfef0('0x14'),_0xfef0('0x15'),_0xfef0('0x16'),_0xfef0('0x17'),_0xfef0('0x18'),_0xfef0('0x19'),_0xfef0('0x1a'),_0xfef0('0x1b'),'lastPauseAt',_0xfef0('0x1c'),_0xfef0('0x1d'),_0xfef0('0x1e'),_0xfef0('0x1f'),_0xfef0('0x20'),_0xfef0('0x21'),_0xfef0('0x22'),'phoneBarEnableRecording',_0xfef0('0x23'),'phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired',_0xfef0('0x24'),_0xfef0('0x25'),_0xfef0('0x26'),_0xfef0('0x27'),_0xfef0('0x28'),_0xfef0('0x29'),_0xfef0('0x2a'),_0xfef0('0x2b'),'downloadVoiceRecordings',_0xfef0('0x2c'),_0xfef0('0x2d'),_0xfef0('0x2e'),_0xfef0('0x2f'),_0xfef0('0x30'),'chatAutoanswerDelay',_0xfef0('0x31'),'emailAutoanswerDelay',_0xfef0('0x32'),_0xfef0('0x33'),_0xfef0('0x34'),'openchannelAutoanswerDelay',_0xfef0('0x35'),'faxAutoanswerDelay',_0xfef0('0x36'),_0xfef0('0x37'),'messengerSoundNotification'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0xfef0('0x38')](function(_0x4faea8,_0x1f9970,_0x46b34a){if(_0x4faea8[_0xfef0('0x39')]){_0x46b34a();}else{return db[_0xfef0('0x3a')][_0xfef0('0x3b')]({'where':{'id':_0x4faea8[_0xfef0('0x3c')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xfef0('0x3d')](function(_0x1ffaa4){if(_0x1ffaa4&&_0x1ffaa4[_0xfef0('0x3e')]){return _0x1f9970[_0xfef0('0x3f')](_0x1ffaa4[_0xfef0('0x40')]===_0xfef0('0x41')?0x195:0x193)[_0xfef0('0x42')]({'message':_0x1ffaa4[_0xfef0('0x40')]===_0xfef0('0x41')?'Unmanaged.':_0xfef0('0x43')});}else{_0x46b34a();}})[_0xfef0('0x44')](function(_0xca0cce){_0x46b34a(_0xca0cce);});}});};exports[_0xfef0('0x45')]=function isAuthenticated(_0x37921f){return compose()[_0xfef0('0x38')](function(_0x3e3c4c,_0x3e026a,_0x26cb9a){var _0x213a91;if(_0x3e3c4c[_0xfef0('0x46')][_0xfef0('0x47')]){if(_['startsWith'](_0x3e3c4c[_0xfef0('0x46')]['authorization'],'Basic')){var _0x7d1692=basicAuth(_0x3e3c4c);db[_0xfef0('0x48')]['find']({'where':{'name':_0x7d1692['name']}})['then'](function(_0x4f65cd){if(!_0x4f65cd||!_0x4f65cd['authenticate'](_0x7d1692[_0xfef0('0x49')])){return _0x3e026a[_0xfef0('0x3f')](0x191)[_0xfef0('0x42')]({'message':'Wrong\x20credentials.'});}_0x3e3c4c['user']={'id':_0x4f65cd['id']};_0x26cb9a();})['catch'](function(_0x1f8110){_0x26cb9a(_0x1f8110);});}else if(_['startsWith'](_0x3e3c4c[_0xfef0('0x46')][_0xfef0('0x47')],_0xfef0('0x4a'))){validateJwt(_0x3e3c4c,_0x3e026a,_0x26cb9a);}else{if(_0x37921f){_0x26cb9a();}else{return _0x3e026a['status'](0x193)[_0xfef0('0x42')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x3e3c4c[_0xfef0('0x4b')][_0xfef0('0x4c')]){try{var _0x234d49={'audience':hardwareConf[_0xfef0('0x4d')](),'issuer':hardwareConf[_0xfef0('0x4d')]()};verifyJwt(_0x3e3c4c[_0xfef0('0x4b')][_0xfef0('0x4c')],_0x234d49)[_0xfef0('0x3d')](function(_0x590e37){return db[_0xfef0('0x48')][_0xfef0('0x4e')]({'where':{'id':_0x590e37[_0xfef0('0x4f')]}})[_0xfef0('0x3d')](function(_0xae697){_0x213a91=_0xae697;return db[_0xfef0('0x50')][_0xfef0('0x3b')]({'where':{'id':0x1},'attributes':[_0xfef0('0x51'),_0xfef0('0x52')],'raw':!![]});})[_0xfef0('0x3d')](function(_0x3b668b){if(!_0x213a91||!_[_0xfef0('0x53')](_0x213a91[_0xfef0('0x54')],_0x590e37['nonce'])){return _0x3e026a[_0xfef0('0x3f')](0x191)['json']({'message':_0xfef0('0x55')});}if(_0x213a91[_0xfef0('0x56')]){return _0x3e026a[_0xfef0('0x3f')](0x191)['json']({'message':_0xfef0('0x57')});}if(_0x213a91[_0xfef0('0x58')]){if(_0x3b668b[_0xfef0('0x52')]>0x0){if(moment(_0x213a91['blockedAt'])[_0xfef0('0x59')](_0x3b668b[_0xfef0('0x52')],_0xfef0('0x5a'))>moment()){return _0x3e026a['status'](0x191)[_0xfef0('0x42')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3e026a['status'](0x191)[_0xfef0('0x42')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x3e3c4c['user']={'id':_0x213a91['id']};_0x26cb9a();});})[_0xfef0('0x44')](function(){return _0x3e026a[_0xfef0('0x3f')](0x191)[_0xfef0('0x42')]({'message':_0xfef0('0x57')});});}catch(_0x3a3844){_0x26cb9a(_0x3a3844);}}else if(_0x37921f){_0x26cb9a();}else{return _0x3e026a[_0xfef0('0x3f')](0x193)['json']({'message':_0xfef0('0x5b')});}})[_0xfef0('0x38')](function(_0x5a9ed3,_0x54d5cb,_0x1d554e){if(_0x5a9ed3['user']){db[_0xfef0('0x48')][_0xfef0('0x4e')]({'where':{'id':_0x5a9ed3[_0xfef0('0x39')]['id']},'attributes':userAttributes})[_0xfef0('0x3d')](function(_0x199c57){if(!_0x199c57){return _0x54d5cb[_0xfef0('0x3f')](0x194)[_0xfef0('0x42')]({'message':_0xfef0('0x5c')});}_0x5a9ed3['user']=_0x199c57;_0x1d554e();})[_0xfef0('0x44')](function(_0x50e372){_0x1d554e(_0x50e372);});}else if(_0x37921f){_0x1d554e();}else{return _0x54d5cb['status'](0x194)[_0xfef0('0x42')]({'message':_0xfef0('0x5d')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xfef0('0x38')](function(_0x5587a9,_0x39df7c,_0x30ef5d){return licenseUtil[_0xfef0('0x5e')]()[_0xfef0('0x3d')](function(_0x544876){if(_0x544876[_0xfef0('0x5f')]){_0x30ef5d();}else{return _0x39df7c[_0xfef0('0x3f')](0x193)['json']({'message':'Forbidden'});}})[_0xfef0('0x44')](function(_0x4f3231){_0x30ef5d(_0x4f3231);});});};exports[_0xfef0('0x60')]=function isWebrtcLicence(){return compose()[_0xfef0('0x38')](function(_0x390247,_0x19acde,_0x1c3e04){return licenseUtil[_0xfef0('0x5e')]()['then'](function(_0xda901e){if(_0xda901e['webrtc']){_0x1c3e04();}else{return _0x19acde['status'](0x193)[_0xfef0('0x42')]({'message':_0xfef0('0x61')});}})[_0xfef0('0x44')](function(_0x5a9750){_0x1c3e04(_0x5a9750);});});};exports[_0xfef0('0x62')]=function(_0x4e1271,_0x5dd26b,_0x51f207){_0x4e1271[_0xfef0('0x62')]=!![];return _0x51f207();};exports[_0xfef0('0x63')]=function signToken(_0x249934){return signJwt(_0x249934);};exports[_0xfef0('0x64')]=function(_0x2712e9,_0xa23cc8){if(!_0x2712e9[_0xfef0('0x39')]){return _0xa23cc8[_0xfef0('0x3f')](0x194)[_0xfef0('0x42')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x512f7a={'payload':{'id':_0x2712e9[_0xfef0('0x39')]['id'],'role':_0x2712e9[_0xfef0('0x39')][_0xfef0('0x65')]},'options':{'expiresIn':0x15180}};return signJwt(_0x512f7a)[_0xfef0('0x3d')](function(_0x393fee){_0xa23cc8[_0xfef0('0x66')](_0xfef0('0x67'),_0x393fee);_0xa23cc8[_0xfef0('0x68')]('/dashboards/general');})[_0xfef0('0x44')](function(_0x19e449){return _0xa23cc8[_0xfef0('0x3f')](0x1f4)[_0xfef0('0x69')](_0x19e449);});};exports[_0xfef0('0x6a')]=function(_0x5a00db){if(_['isNil'](_0x5a00db['apiKeyNonce'])||_[_0xfef0('0x6b')](_0x5a00db[_0xfef0('0x6c')])){return null;}else{return createJwt(_0x5a00db);}};exports[_0xfef0('0x6d')]=function(_0x22adf3){_0x22adf3['apiKeyNonce']=generateNonce();_0x22adf3[_0xfef0('0x6c')]=generateIssuedAt();return createJwt(_0x22adf3);};exports[_0xfef0('0x6e')]=function(_0x302908,_0x28b90c){var _0x19dcd3=_0x302908[_0xfef0('0x4b')][_0xfef0('0x4c')];if(_0x19dcd3){var _0x4cd0fd={'nonce':_0x28b90c[_0xfef0('0x54')],'iat':_0x28b90c[_0xfef0('0x6c')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfef0('0x4d')]()};return verifyJwt(_0x19dcd3,_0x4cd0fd)['then'](function(){return generateApiKey(_0x28b90c);});}else{throw{'message':_0xfef0('0x6f')};}};exports[_0xfef0('0x70')]=function(_0x5cf1fa){var _0x1e1c02=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1e1c02['test'](_0x5cf1fa))throw new db['Sequelize']['ValidationError'](_0xfef0('0x71'));return;};exports[_0xfef0('0x72')]=function(_0x455923,_0x34fda3,_0x16a498){var _0x2d63e8=encryptor['decryptString'](_0x34fda3)[_0xfef0('0x73')](',');for(var _0x4156d5=0x0;_0x4156d5<_0x16a498;_0x4156d5++){if(!_0x2d63e8[_0x4156d5])break;if(_0x455923[_0xfef0('0x74')]()===_0x2d63e8[_0x4156d5][_0xfef0('0x74')]()){var _0x21fd2b=util['format'](_0xfef0('0x75'),_0x16a498);if(_0x16a498===0x1){_0x21fd2b='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xfef0('0x76'))]['ValidationError'](_0x21fd2b);}}return;};exports[_0xfef0('0x77')]=function(_0x851e97,_0xdd1121){var _0x281259=_0xdd1121?encryptor[_0xfef0('0x78')](_0xdd1121)['split'](','):[];if(_0x281259[_0xfef0('0x79')]===0x5){_0x281259['splice'](-0x1,0x1);}_0x281259[_0xfef0('0x7a')](_0x851e97);return encryptor[_0xfef0('0x7b')](_0x281259['join'](','));};function signJwt(_0x3a12c5){var _0x3c5640=BPromise[_0xfef0('0x7c')](jwt[_0xfef0('0x7d')],{'context':jwt});var _0x423ec0=_0x3a12c5[_0xfef0('0x7e')]||config[_0xfef0('0xb')][_0xfef0('0xc')];return new BPromise(function(_0x17a595,_0x7eed0){_0x3c5640(_0x3a12c5[_0xfef0('0x7f')],_0x423ec0,_0x3a12c5[_0xfef0('0x80')])['then'](function(_0xeb5f8d){_0x17a595(_0xeb5f8d);})[_0xfef0('0x44')](function(_0x28cab7){_0x7eed0(_0x28cab7);});});}function verifyJwt(_0x312dcf,_0x16f0a2,_0x49ed54){var _0x12e383=BPromise[_0xfef0('0x7c')](jwt[_0xfef0('0x81')],{'context':jwt});var _0x3c6bb8=_0x49ed54||config[_0xfef0('0xb')][_0xfef0('0xc')];return new BPromise(function(_0xb9693b,_0x103ca3){_0x12e383(_0x312dcf,_0x3c6bb8,_0x16f0a2)[_0xfef0('0x3d')](function(_0x3f26d9){_0xb9693b(_0x3f26d9);})['catch'](function(_0x100c6a){_0x103ca3(_0x100c6a);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xfef0('0x82')](_0xfef0('0x83'));}function generateIssuedAt(){return Math['floor'](Date[_0xfef0('0x84')]()/0x3e8)[_0xfef0('0x82')]();}function createJwt(_0x3de7b1){var _0x6a4d10={'payload':{'iat':_0x3de7b1[_0xfef0('0x6c')],'nonce':_0x3de7b1['apiKeyNonce']},'options':{'algorithm':_0xfef0('0x85'),'subject':_0x3de7b1['id'][_0xfef0('0x82')](),'issuer':hardwareConf[_0xfef0('0x4d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x6a4d10)[_0xfef0('0x3d')](function(_0x2ab666){return{'iat':_0x3de7b1[_0xfef0('0x6c')],'nonce':_0x3de7b1[_0xfef0('0x54')],'token':_0x2ab666};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 89ddd73..649210d 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 _0xf389=['all','length','fieldType','type','map','keys','lodash','./sql-utils','../../mysqldb','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','count','User','buildContactsQuery','rows','catch','describe','CmContact','startsWith','cf_','findOne','slice'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0xf389,0x96));var _0x9f38=function(_0x145036,_0x397ca4){_0x145036=_0x145036-0x0;var _0x4e0c46=_0xf389[_0x145036];return _0x4e0c46;};'use strict';var _=require(_0x9f38('0x0'));var sqlUtils=require(_0x9f38('0x1'));var db=require(_0x9f38('0x2'))['db'];exports['findAll']=function(_0x3ecab9,_0x47a4e1,_0x1f9bb2,_0x4f5703){var _0x46d227={'count':0x0,'rows':[]};var _0x26c0ee=sqlUtils['skipContactsQuery'](_0x47a4e1,_0x3ecab9);if(_0x26c0ee){return Promise[_0x9f38('0x3')](_0x46d227);}var _0x464fcf=sqlUtils[_0x9f38('0x4')]();var _0x535346={};var _0x12af27=![];var _0x30ff3f=![];return Promise[_0x9f38('0x3')]()[_0x9f38('0x5')](function(){if(_0x3ecab9[_0x9f38('0x6')]){return sqlUtils[_0x9f38('0x7')](_0x3ecab9[_0x9f38('0x6')],_0x4f5703);}else{return sqlUtils[_0x9f38('0x8')](_0x3ecab9,_0x4f5703);}})['then'](function(_0x2f0006){_0x464fcf['where'](_0x2f0006[_0x9f38('0x9')]);_0x464fcf[_0x9f38('0xa')](_0x2f0006[_0x9f38('0xb')]);_0x464fcf[_0x9f38('0xa')](_0x2f0006[_0x9f38('0xc')]);_0x464fcf[_0x9f38('0xa')](_0x2f0006[_0x9f38('0xd')][_0x9f38('0xe')]);_0x535346=_0x2f0006[_0x9f38('0xf')];_0x30ff3f=_0x2f0006[_0x9f38('0xd')][_0x9f38('0x10')];return sqlUtils[_0x9f38('0x11')](_0x47a4e1,_0x3ecab9,_0x30ff3f);})['then'](function(_0x4405df){_0x464fcf['where'](_0x4405df);var _0x2713a2=_0x3ecab9[_0x9f38('0x6')]?_0x535346[_0x9f38('0x12')]:_0x3ecab9['tag'];_0x12af27=_0x2713a2?!![]:![];return sqlUtils['countFilteredContacts'](_0x464fcf,_0x2713a2);})[_0x9f38('0x5')](function(_0x2b1f26){_0x46d227[_0x9f38('0x13')]=_0x2b1f26;if(_0x46d227[_0x9f38('0x13')]===0x0){return;}if(_0x3ecab9[_0x9f38('0x14')]){_0x30ff3f=!![];}return sqlUtils[_0x9f38('0x15')](_0x464fcf,_0x3ecab9[_0x9f38('0xb')],_0x1f9bb2,_0x12af27,_0x535346[_0x9f38('0xe')],_0x30ff3f);})[_0x9f38('0x5')](function(_0x1cf493){if(!_0x1cf493){return[];}return sqlUtils['getFilteredContacts'](_0x1cf493,_0x3ecab9,_0x1f9bb2);})[_0x9f38('0x5')](function(_0x3f9df6){_0x46d227[_0x9f38('0x16')]=_0x3f9df6;return _0x46d227;})[_0x9f38('0x17')](function(_0x36f7d7){throw _0x36f7d7;});};exports[_0x9f38('0x18')]=function(){var _0x22d010={};var _0x1f076c=[];return db[_0x9f38('0x19')]['describe']()['then'](function(_0x944f56){_0x22d010=_0x944f56;var _0x5b7ccc=Object['keys'](_0x22d010)[_0x9f38('0xc')](function(_0x117a10){return _[_0x9f38('0x1a')](_0x117a10,_0x9f38('0x1b'))?_0x117a10:undefined;});var _0x53a477=_0x5b7ccc['map'](function(_0x1c98e1){return db['CmCustomField'][_0x9f38('0x1c')]({'where':{'id':_0x1c98e1[_0x9f38('0x1d')](0x3)},'raw':!![]});});return Promise[_0x9f38('0x1e')](_0x53a477);})['then'](function(_0x34bf78){for(var _0x4e91bf=0x0;_0x4e91bf<_0x34bf78[_0x9f38('0x1f')];_0x4e91bf++){if(_0x34bf78[_0x4e91bf]){var _0x59fef0='cf_'+_0x34bf78[_0x4e91bf]['id'];_0x22d010[_0x59fef0][_0x9f38('0x20')]=_0x34bf78[_0x4e91bf][_0x9f38('0x21')];}}_0x1f076c=_[_0x9f38('0x22')](Object[_0x9f38('0x23')](_0x22d010),function(_0x2c66b8){return{'name':_0x2c66b8,'type':_0x22d010[_0x2c66b8][_0x9f38('0x21')]};});return _0x1f076c;})[_0x9f38('0x17')](function(_0x224574){throw _0x224574;});}; \ No newline at end of file +var _0x64f2=['where','default','fields','filter','user','clause','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','catch','CmContact','describe','keys','startsWith','map','CmCustomField','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','getContactsSubquery','resolve','search','parseQueryParameters','then'];(function(_0x47abbc,_0x5a8c7a){var _0x55a157=function(_0x1e3f32){while(--_0x1e3f32){_0x47abbc['push'](_0x47abbc['shift']());}};_0x55a157(++_0x5a8c7a);}(_0x64f2,0x1a7));var _0x264f=function(_0x1e4642,_0x15a71e){_0x1e4642=_0x1e4642-0x0;var _0x3acc79=_0x64f2[_0x1e4642];return _0x3acc79;};'use strict';var _=require('lodash');var sqlUtils=require(_0x264f('0x0'));var db=require(_0x264f('0x1'))['db'];exports[_0x264f('0x2')]=function(_0x500767,_0x378c45,_0x27caf7,_0x2dd19e){var _0x45870e={'count':0x0,'rows':[]};var _0x5d1ef3=sqlUtils[_0x264f('0x3')](_0x378c45,_0x500767);if(_0x5d1ef3){return Promise['resolve'](_0x45870e);}var _0x3430cc=sqlUtils[_0x264f('0x4')]();var _0x571e78={};var _0x558f40=![];var _0x33b0a8=![];return Promise[_0x264f('0x5')]()['then'](function(){if(_0x500767[_0x264f('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x500767['search'],_0x2dd19e);}else{return sqlUtils[_0x264f('0x7')](_0x500767,_0x2dd19e);}})[_0x264f('0x8')](function(_0xa29db5){_0x3430cc[_0x264f('0x9')](_0xa29db5[_0x264f('0xa')]);_0x3430cc['where'](_0xa29db5[_0x264f('0xb')]);_0x3430cc[_0x264f('0x9')](_0xa29db5[_0x264f('0xc')]);_0x3430cc[_0x264f('0x9')](_0xa29db5[_0x264f('0xd')][_0x264f('0xe')]);_0x571e78=_0xa29db5[_0x264f('0xf')];_0x33b0a8=_0xa29db5[_0x264f('0xd')]['skip'];return sqlUtils[_0x264f('0x10')](_0x378c45,_0x500767,_0x33b0a8);})[_0x264f('0x8')](function(_0x49dde7){_0x3430cc[_0x264f('0x9')](_0x49dde7);var _0x405f22=_0x500767[_0x264f('0x6')]?_0x571e78[_0x264f('0x11')]:_0x500767[_0x264f('0x12')];_0x558f40=_0x405f22?!![]:![];return sqlUtils[_0x264f('0x13')](_0x3430cc,_0x405f22);})[_0x264f('0x8')](function(_0xefe8d8){_0x45870e['count']=_0xefe8d8;if(_0x45870e[_0x264f('0x14')]===0x0){return;}if(_0x500767['User']){_0x33b0a8=!![];}return sqlUtils[_0x264f('0x15')](_0x3430cc,_0x500767[_0x264f('0xb')],_0x27caf7,_0x558f40,_0x571e78[_0x264f('0xe')],_0x33b0a8);})['then'](function(_0x3218a9){if(!_0x3218a9){return[];}return sqlUtils[_0x264f('0x16')](_0x3218a9,_0x500767,_0x27caf7);})[_0x264f('0x8')](function(_0x10f671){_0x45870e['rows']=_0x10f671;return _0x45870e;})[_0x264f('0x17')](function(_0x4ce0e3){throw _0x4ce0e3;});};exports['describe']=function(){var _0x3db9a9={};var _0x30ba52=[];return db[_0x264f('0x18')][_0x264f('0x19')]()[_0x264f('0x8')](function(_0x42ef0b){_0x3db9a9=_0x42ef0b;var _0x570ad9=Object[_0x264f('0x1a')](_0x3db9a9)['filter'](function(_0x3d7d3a){return _[_0x264f('0x1b')](_0x3d7d3a,'cf_')?_0x3d7d3a:undefined;});var _0x4307c9=_0x570ad9[_0x264f('0x1c')](function(_0xc5e1bb){return db[_0x264f('0x1d')][_0x264f('0x1e')]({'where':{'id':_0xc5e1bb[_0x264f('0x1f')](0x3)},'raw':!![]});});return Promise[_0x264f('0x20')](_0x4307c9);})[_0x264f('0x8')](function(_0x4bb371){for(var _0x15739b=0x0;_0x15739b<_0x4bb371[_0x264f('0x21')];_0x15739b++){if(_0x4bb371[_0x15739b]){var _0x28e7ed='cf_'+_0x4bb371[_0x15739b]['id'];_0x3db9a9[_0x28e7ed][_0x264f('0x22')]=_0x4bb371[_0x15739b][_0x264f('0x23')];}}_0x30ba52=_[_0x264f('0x1c')](Object[_0x264f('0x1a')](_0x3db9a9),function(_0x4de6bc){return{'name':_0x4de6bc,'type':_0x3db9a9[_0x4de6bc][_0x264f('0x23')]};});return _0x30ba52;})[_0x264f('0x17')](function(_0x2e3888){throw _0x2e3888;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 195ebfa..0fb03fa 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 _0x93f1=['concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','search','getLists','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','keyBy','Sequelize','QueryTypes','SELECT','sequelize','toString','Tags','COUNT(*)','getSelectedTags','t.id\x20IN\x20?','query','exports','squel','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','ListId','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','replace','split','length','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','fieldType','datetime','DATE','buildExpression','type','default','text','value','start','end','Tag','map','tags','clause','and','ids','user','uc.UserId\x20=\x20?','some','name','compact','Contact','User','c.ListId\x20IN\x20?'];(function(_0x1e09d9,_0x105333){var _0x56fa2f=function(_0x378243){while(--_0x378243){_0x1e09d9['push'](_0x1e09d9['shift']());}};_0x56fa2f(++_0x105333);}(_0x93f1,0xf7));var _0x193f=function(_0x46d483,_0x586a6c){_0x46d483=_0x46d483-0x0;var _0x241d4f=_0x93f1[_0x46d483];return _0x241d4f;};'use strict';var _=require('lodash');var squel=require(_0x193f('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x193f('0x1'));var utils=require(_0x193f('0x2'));var db=require(_0x193f('0x3'))['db'];function skipContactsQuery(_0x226d94,_0xe0f027){var _0x164f0c=![];if(_0x226d94[_0x193f('0x4')]===_0x193f('0x5')&&!_0xe0f027['search']&&!_0xe0f027[_0x193f('0x6')]&&_0xe0f027['autocomplete']!=='true'){_0x164f0c=!![];}return _0x164f0c;}function getContactsSubquery(){return squel['select']()[_0x193f('0x7')](_0x193f('0x8'),'c')[_0x193f('0x9')](_0x193f('0xa'));}function applyJoinClauses(_0x2ee048,_0x110da5){var _0xc7a4af=_0x110da5?'c':_0x193f('0xb');_0x2ee048['left_join'](_0x193f('0xc'),'uc',_0x193f('0xd')+_0xc7a4af+_0x193f('0xe'))[_0x193f('0xf')](_0x193f('0x10'),'ct',_0x193f('0x11')+_0xc7a4af+_0x193f('0xe'))['left_join'](_0x193f('0x12'),'t',_0x193f('0x13'));return _0x2ee048;}function addFieldsToQuery(_0x1d952b,_0x350cc4,_0x34c53f,_0x341cc1,_0x1f6865){var _0x19dd85=_0x1f6865?'c':'subqry';if(!_0x350cc4){_0x350cc4=['id',_0x193f('0x14'),_0x193f('0x15'),_0x193f('0x16'),_0x193f('0x17'),_0x193f('0x18'),_0x193f('0x19'),'ListId','CompanyId',_0x193f('0x1a'),_0x193f('0x1b'),_0x193f('0x1c'),_0x193f('0x1d')];}else if(!_0x350cc4[_0x193f('0x1e')]('id')){_0x350cc4[_0x193f('0x1f')]('id');}var _0x536c9d=_0x34c53f&&_0x1f6865||!_0x34c53f&&!_0x1f6865;if(_0x341cc1){_0x536c9d=_0x341cc1&&_0x1f6865||!_0x341cc1&&!_0x1f6865;}_0x350cc4[_0x193f('0x20')](function(_0xb8f360){if(_0xb8f360===_0x193f('0x1d')){if(_0x536c9d){_0x1d952b[_0x193f('0x21')](_0x193f('0x22'),_0xb8f360);}else if(_0x34c53f||_0x341cc1){_0x1d952b[_0x193f('0x21')](_0x19dd85+'.'+_0xb8f360);}}else{_0x1d952b[_0x193f('0x21')](_0x19dd85+'.'+_0xb8f360);}});return _0x1d952b;}function getSqlClauses(){var _0x2f698c={'default':squel[_0x193f('0x23')](),'fields':squel[_0x193f('0x23')](),'filter':squel[_0x193f('0x23')](),'tags':{'clause':squel[_0x193f('0x23')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x2f698c;}function parseTagParameter(_0xcdd185){var _0x4dec8f=squel[_0x193f('0x23')]();if(_0xcdd185){var _0x592846=utils['getSelectedTags'](_0xcdd185);_0x592846[_0x193f('0x20')](function(_0x6f7dc4){_0x4dec8f['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x6f7dc4+',%');});}return _0x4dec8f;}function parseSearchFilter(_0x483e16){var _0xec6774=squel[_0x193f('0x23')]();if(_0x483e16){var _0x3dd6d3=_0x483e16[_0x193f('0x24')]('\x5c','\x5c\x5c')[_0x193f('0x24')](/'/g,'\x27\x27');if(_0x3dd6d3[_0x193f('0x25')]('\x20')[_0x193f('0x26')]>0x1){_0xec6774['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3dd6d3,!![]),null);}else{if(qs[_0x193f('0x27')](_0x3dd6d3)){_0xec6774['or'](_0x193f('0x28'),_0x3dd6d3+'%');_0xec6774['or']('c.phone\x20LIKE\x20?',_0x3dd6d3+'%');_0xec6774['or'](_0x193f('0x29'),_0x3dd6d3+'%');_0xec6774['or'](_0x193f('0x2a'),_0x3dd6d3+'%');}else if(qs[_0x193f('0x2b')](_0x3dd6d3)){_0xec6774['or'](_0x193f('0x2c'),_0x3dd6d3+'%');}else{_0xec6774['or']('c.firstName\x20LIKE\x20?','%'+_0x3dd6d3+'%');_0xec6774['or'](_0x193f('0x2d'),'%'+_0x3dd6d3+'%');_0xec6774['or'](_0x193f('0x2c'),'%'+_0x3dd6d3+'%');}}}return _0xec6774;}function parseAdvancedSearchFilter(_0x548e42,_0x2c98ab){var _0x4f7997=getSqlClauses();var _0x17d91c=as[_0x193f('0x2e')](_0x548e42);var _0x2d24e4=_0x17d91c[_0x193f('0x2f')];for(var _0x44e2e4=0x0;_0x44e2e4<_0x17d91c[_0x193f('0x30')][_0x193f('0x26')];_0x44e2e4++){var _0x256177=_0x17d91c[_0x193f('0x30')][_0x44e2e4];var _0x1c4df7='c';var _0x38449f=_[_0x193f('0x31')](_0x2c98ab,['name',_0x256177[_0x193f('0x21')]]);if(_0x38449f){if(_0x256177[_0x193f('0x21')]==='dateOfBirth'||_0x38449f[_0x193f('0x32')]===_0x193f('0x33')){_0x256177['castTo']=_0x193f('0x34');}var _0x57d2b5=as[_0x193f('0x35')](_0x1c4df7,_0x38449f[_0x193f('0x36')],_0x256177);_0x4f7997[_0x193f('0x37')][_0x2d24e4](_0x57d2b5[_0x193f('0x38')],_0x57d2b5[_0x193f('0x39')][_0x193f('0x3a')],_0x57d2b5[_0x193f('0x39')][_0x193f('0x3b')]);}else{if(_0x256177[_0x193f('0x21')]===_0x193f('0x3c')){var _0x5c6c77=_0x256177[_0x193f('0x39')][_0x193f('0x25')](',')[_0x193f('0x3d')](function(_0x4d3678){return Number(_0x4d3678);});var _0xeaff08=parseTagParameter(_0x5c6c77);_0x4f7997[_0x193f('0x3e')][_0x193f('0x3f')][_0x193f('0x40')](_0xeaff08);_0x4f7997[_0x193f('0x3e')][_0x193f('0x41')]=_0x5c6c77;}else if(_0x256177[_0x193f('0x21')]==='User'){_0x4f7997[_0x193f('0x42')][_0x193f('0x3f')][_0x193f('0x40')](_0x193f('0x43'),_0x256177[_0x193f('0x39')]);_0x4f7997[_0x193f('0x42')]['skip']=!![];}}}return _0x4f7997;}function parseModelFields(_0x4fe820,_0x5b779c){var _0xcb9ede=squel[_0x193f('0x23')]();var _0x42a3c6=_(_0x4fe820)['keys']()[_0x193f('0x3d')](function(_0x6268b7){return _[_0x193f('0x44')](_0x5b779c,[_0x193f('0x45'),_0x6268b7])?_0x6268b7:undefined;})[_0x193f('0x46')]()[_0x193f('0x39')]();if(_0x4fe820['Contact']){_0x42a3c6[_0x193f('0x1f')](_0x193f('0x47'));}if(_0x4fe820[_0x193f('0x48')]){_0x42a3c6[_0x193f('0x1f')](_0x193f('0x48'));}if(_0x42a3c6['length']>0x0){_0x42a3c6['forEach'](function(_0x247a32){if(_0x247a32==='ListId'){_0xcb9ede[_0x193f('0x40')](_0x193f('0x49'),[][_0x193f('0x4a')](_0x4fe820[_0x247a32]));}else if(_0x247a32===_0x193f('0x47')){var _0x1c1d08='%'+_0x4fe820[_0x247a32]+'%';_0xcb9ede[_0x193f('0x40')](_0x193f('0x4b'),_0x1c1d08);}else if(_0x247a32===_0x193f('0x48')){_0xcb9ede[_0x193f('0x40')](_0x193f('0x43'),_0x4fe820[_0x247a32]);}else{_0xcb9ede[_0x193f('0x40')]('c.'+_0x247a32+_0x193f('0x4c'),_0x4fe820[_0x247a32]);}});}return _0xcb9ede;}function parseQueryParameters(_0x305477,_0xfc90ff){var _0x3bbf9e=getSqlClauses();return Promise[_0x193f('0x4d')]()['then'](function(){return parseModelFields(_0x305477,_0xfc90ff);})[_0x193f('0x4e')](function(_0x22e15d){_0x3bbf9e['fields']['and'](_0x22e15d);return parseTagParameter(_0x305477[_0x193f('0x4f')]);})[_0x193f('0x4e')](function(_0x49b8eb){_0x3bbf9e[_0x193f('0x3e')]['clause'][_0x193f('0x40')](_0x49b8eb);return parseSearchFilter(_0x305477['filter']);})[_0x193f('0x4e')](function(_0x4a67ea){_0x3bbf9e[_0x193f('0x50')]=_0x4a67ea;return _0x3bbf9e;});}function checkListsRestrictions(_0x2ef32f,_0x4a90c2,_0x3425e7){var _0x8f5265=squel[_0x193f('0x23')]();return Promise[_0x193f('0x4d')]()[_0x193f('0x4e')](function(){if(_0x4a90c2[_0x193f('0x51')]&&_0x2ef32f[_0x193f('0x4')]===_0x193f('0x5')&&!_0x3425e7){return _0x2ef32f[_0x193f('0x52')]({'attributes':['id'],'raw':!![]});}})[_0x193f('0x4e')](function(_0x402c69){if(_0x402c69){if(_0x402c69['length']===0x0){_0x8f5265['and'](_0x193f('0x53'));}else{_0x8f5265[_0x193f('0x40')](_0x193f('0x49'),_[_0x193f('0x3d')](_0x402c69,'id'));}}})[_0x193f('0x4e')](function(){return _0x8f5265;});}function buildContactsQuery(_0x3d5da2,_0x373933,_0x5b06d5,_0x545718,_0x337c67,_0x53bec4){if(_0x373933){_0x373933=_0x5b06d5[_0x193f('0x54')];}_0x3d5da2=addFieldsToQuery(_0x3d5da2,_0x373933,_0x545718,_0x53bec4,!![]);var _0x4ea897=squel[_0x193f('0x55')]();_0x4ea897=addFieldsToQuery(_0x4ea897,_0x373933,_0x545718,_0x53bec4,![]);if(_0x545718||_0x53bec4){_0x3d5da2=applyJoinClauses(_0x3d5da2,!![]);_0x3d5da2[_0x193f('0x56')](_0x193f('0x57'));if(_0x5b06d5[_0x193f('0x58')]){_0x4ea897[_0x193f('0x58')](_0x5b06d5[_0x193f('0x58')]);}if(_0x5b06d5['offset']){_0x4ea897[_0x193f('0x59')](_0x5b06d5['offset']);}}else{_0x4ea897=applyJoinClauses(_0x4ea897,![]);_0x4ea897[_0x193f('0x56')](_0x193f('0x5a'));if(_0x5b06d5[_0x193f('0x58')]){_0x3d5da2[_0x193f('0x58')](_0x5b06d5[_0x193f('0x58')]);}if(_0x5b06d5[_0x193f('0x59')]){_0x3d5da2['offset'](_0x5b06d5[_0x193f('0x59')]);}}_0x4ea897[_0x193f('0x5b')](_0x337c67);if(_0x5b06d5[_0x193f('0x5c')]){_0x5b06d5['order'][_0x193f('0x20')](function(_0x225133){_0x3d5da2[_0x193f('0x5c')]('c.'+_0x225133[0x0],_0x225133[0x1]===_0x193f('0x5d')?![]:!![]);_0x4ea897[_0x193f('0x5c')](_0x193f('0x5e')+_0x225133[0x0],_0x225133[0x1]===_0x193f('0x5d')?![]:!![]);});}_0x4ea897['from'](_0x3d5da2,'subqry');return _0x4ea897;}function getFilteredContacts(_0x30ce5f){var _0x1f5911=[];return db[_0x193f('0x3c')]['findAll']({'attributes':['id',_0x193f('0x45'),'color'],'raw':!![]})[_0x193f('0x4e')](function(_0x472398){_0x1f5911=_[_0x193f('0x5f')](_0x472398,'id');var _0x525fde={'type':db[_0x193f('0x60')][_0x193f('0x61')][_0x193f('0x62')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x193f('0x63')]['query'](_0x30ce5f[_0x193f('0x64')](),_0x525fde);})['then'](function(_0x3967d0){_0x3967d0[_0x193f('0x20')](function(_0xb32601){if(_0xb32601[_0x193f('0x1d')]){_0xb32601[_0x193f('0x65')]=[];_0xb32601[_0x193f('0x1d')]['split'](',')[_0x193f('0x20')](function(_0x7efbec){_0xb32601[_0x193f('0x65')][_0x193f('0x1f')](_0x1f5911[_0x7efbec]);});}delete _0xb32601['TagIds'];});return _0x3967d0;});}function countFilteredContacts(_0x3f345e,_0x42183d){var _0x4c653a=_0x3f345e['clone']();_0x4c653a[_0x193f('0x21')](_0x193f('0x66'));_0x4c653a=applyJoinClauses(_0x4c653a,!![]);_0x3f345e['group'](_0x193f('0x57'));var _0x4c32e8=utils[_0x193f('0x67')](_0x42183d);if(!_['isEmpty'](_0x4c32e8)){_0x4c653a[_0x193f('0x9')](_0x193f('0x68'),_0x4c32e8);}var _0x5d592b={'type':db['Sequelize'][_0x193f('0x61')]['SELECT'],'raw':!![]};return db[_0x193f('0x63')][_0x193f('0x69')](_0x4c653a[_0x193f('0x64')](),_0x5d592b)[_0x193f('0x4e')](function(_0x3adf69){return _0x3adf69[0x0][_0x193f('0x66')];});}module[_0x193f('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xa666=['ct.CmContactId\x20=\x20','subqry','firstName','phone','mobile','email','ListId','CompanyId','updatedAt','deletedAt','TagIds','includes','push','field','expr','getSelectedTags','forEach','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','conditions','find','name','dateOfBirth','fieldType','datetime','buildExpression','type','default','text','value','start','Tag','map','tags','clause','and','ids','User','user','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','having','order','subqry.','DESC','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','../parsers/qs','../interaction/utils','role','agent','search','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id'];(function(_0xb2a14f,_0x5b7d9d){var _0x2a7f66=function(_0xabede0){while(--_0xabede0){_0xb2a14f['push'](_0xb2a14f['shift']());}};_0x2a7f66(++_0x5b7d9d);}(_0xa666,0x188));var _0x6a66=function(_0x49df15,_0x5abb73){_0x49df15=_0x49df15-0x0;var _0x42808a=_0xa666[_0x49df15];return _0x42808a;};'use strict';var _=require(_0x6a66('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0x6a66('0x1'));var utils=require(_0x6a66('0x2'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x272edd,_0x2c490d){var _0x47b5b5=![];if(_0x272edd[_0x6a66('0x3')]===_0x6a66('0x4')&&!_0x2c490d[_0x6a66('0x5')]&&!_0x2c490d['ListId']&&_0x2c490d[_0x6a66('0x6')]!==_0x6a66('0x7')){_0x47b5b5=!![];}return _0x47b5b5;}function getContactsSubquery(){return squel['select']()[_0x6a66('0x8')](_0x6a66('0x9'),'c')[_0x6a66('0xa')](_0x6a66('0xb'));}function applyJoinClauses(_0x46df38,_0x176645){var _0x55c4b4=_0x176645?'c':'subqry';_0x46df38[_0x6a66('0xc')](_0x6a66('0xd'),'uc',_0x6a66('0xe')+_0x55c4b4+_0x6a66('0xf'))['left_join']('cm_contact_has_tags','ct',_0x6a66('0x10')+_0x55c4b4+_0x6a66('0xf'))['left_join']('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x46df38;}function addFieldsToQuery(_0x5a7b79,_0x2f838e,_0x4e1401,_0x4aa7ed,_0x760da1){var _0x4c5f15=_0x760da1?'c':_0x6a66('0x11');if(!_0x2f838e){_0x2f838e=['id',_0x6a66('0x12'),'lastName',_0x6a66('0x13'),_0x6a66('0x14'),'fax',_0x6a66('0x15'),_0x6a66('0x16'),_0x6a66('0x17'),'createdAt',_0x6a66('0x18'),_0x6a66('0x19'),_0x6a66('0x1a')];}else if(!_0x2f838e[_0x6a66('0x1b')]('id')){_0x2f838e[_0x6a66('0x1c')]('id');}var _0x2e506a=_0x4e1401&&_0x760da1||!_0x4e1401&&!_0x760da1;if(_0x4aa7ed){_0x2e506a=_0x4aa7ed&&_0x760da1||!_0x4aa7ed&&!_0x760da1;}_0x2f838e['forEach'](function(_0x5c2cf4){if(_0x5c2cf4==='TagIds'){if(_0x2e506a){_0x5a7b79[_0x6a66('0x1d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5c2cf4);}else if(_0x4e1401||_0x4aa7ed){_0x5a7b79[_0x6a66('0x1d')](_0x4c5f15+'.'+_0x5c2cf4);}}else{_0x5a7b79[_0x6a66('0x1d')](_0x4c5f15+'.'+_0x5c2cf4);}});return _0x5a7b79;}function getSqlClauses(){var _0xe1dbe2={'default':squel[_0x6a66('0x1e')](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0x6a66('0x1e')](),'ids':null},'user':{'clause':squel[_0x6a66('0x1e')](),'skip':![]}};return _0xe1dbe2;}function parseTagParameter(_0x299d6c){var _0x93e1c4=squel['expr']();if(_0x299d6c){var _0x12ef76=utils[_0x6a66('0x1f')](_0x299d6c);_0x12ef76[_0x6a66('0x20')](function(_0x5beb85){_0x93e1c4['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5beb85+',%');});}return _0x93e1c4;}function parseSearchFilter(_0x126864){var _0x21a6c4=squel[_0x6a66('0x1e')]();if(_0x126864){var _0x1eff6d=_0x126864[_0x6a66('0x21')]('\x5c','\x5c\x5c')[_0x6a66('0x21')](/'/g,'\x27\x27');if(_0x1eff6d[_0x6a66('0x22')]('\x20')[_0x6a66('0x23')]>0x1){_0x21a6c4['or'](_0x6a66('0x24'),qs['getFullTextValue'](_0x1eff6d,!![]),null);}else{if(qs[_0x6a66('0x25')](_0x1eff6d)){_0x21a6c4['or']('c.id\x20LIKE\x20?',_0x1eff6d+'%');_0x21a6c4['or']('c.phone\x20LIKE\x20?',_0x1eff6d+'%');_0x21a6c4['or'](_0x6a66('0x26'),_0x1eff6d+'%');_0x21a6c4['or'](_0x6a66('0x27'),_0x1eff6d+'%');}else if(qs[_0x6a66('0x28')](_0x1eff6d)){_0x21a6c4['or']('c.email\x20LIKE\x20?',_0x1eff6d+'%');}else{_0x21a6c4['or'](_0x6a66('0x29'),'%'+_0x1eff6d+'%');_0x21a6c4['or']('c.lastName\x20LIKE\x20?','%'+_0x1eff6d+'%');_0x21a6c4['or']('c.email\x20LIKE\x20?','%'+_0x1eff6d+'%');}}}return _0x21a6c4;}function parseAdvancedSearchFilter(_0x4915f8,_0x4b1f81){var _0x59a9dd=getSqlClauses();var _0x12ed64=as['parseSearch'](_0x4915f8);var _0x3a73cf=_0x12ed64['sqlOperator'];for(var _0x176203=0x0;_0x176203<_0x12ed64[_0x6a66('0x2a')][_0x6a66('0x23')];_0x176203++){var _0x407cdc=_0x12ed64[_0x6a66('0x2a')][_0x176203];var _0x2aaf38='c';var _0x2f46e4=_[_0x6a66('0x2b')](_0x4b1f81,[_0x6a66('0x2c'),_0x407cdc[_0x6a66('0x1d')]]);if(_0x2f46e4){if(_0x407cdc[_0x6a66('0x1d')]===_0x6a66('0x2d')||_0x2f46e4[_0x6a66('0x2e')]===_0x6a66('0x2f')){_0x407cdc['castTo']='DATE';}var _0x101fc9=as[_0x6a66('0x30')](_0x2aaf38,_0x2f46e4[_0x6a66('0x31')],_0x407cdc);_0x59a9dd[_0x6a66('0x32')][_0x3a73cf](_0x101fc9[_0x6a66('0x33')],_0x101fc9[_0x6a66('0x34')][_0x6a66('0x35')],_0x101fc9[_0x6a66('0x34')]['end']);}else{if(_0x407cdc['field']===_0x6a66('0x36')){var _0x3e3cf3=_0x407cdc[_0x6a66('0x34')][_0x6a66('0x22')](',')[_0x6a66('0x37')](function(_0x27f120){return Number(_0x27f120);});var _0x3148b9=parseTagParameter(_0x3e3cf3);_0x59a9dd[_0x6a66('0x38')][_0x6a66('0x39')][_0x6a66('0x3a')](_0x3148b9);_0x59a9dd[_0x6a66('0x38')][_0x6a66('0x3b')]=_0x3e3cf3;}else if(_0x407cdc[_0x6a66('0x1d')]===_0x6a66('0x3c')){_0x59a9dd[_0x6a66('0x3d')][_0x6a66('0x39')][_0x6a66('0x3a')]('uc.UserId\x20=\x20?',_0x407cdc[_0x6a66('0x34')]);_0x59a9dd[_0x6a66('0x3d')]['skip']=!![];}}}return _0x59a9dd;}function parseModelFields(_0x32250d,_0x475ac2){var _0xce1163=squel[_0x6a66('0x1e')]();var _0x17d217=_(_0x32250d)[_0x6a66('0x3e')]()['map'](function(_0x4143ea){return _[_0x6a66('0x3f')](_0x475ac2,[_0x6a66('0x2c'),_0x4143ea])?_0x4143ea:undefined;})[_0x6a66('0x40')]()[_0x6a66('0x34')]();if(_0x32250d[_0x6a66('0x41')]){_0x17d217['push'](_0x6a66('0x41'));}if(_0x32250d['User']){_0x17d217[_0x6a66('0x1c')](_0x6a66('0x3c'));}if(_0x17d217[_0x6a66('0x23')]>0x0){_0x17d217['forEach'](function(_0x412060){if(_0x412060===_0x6a66('0x16')){_0xce1163['and'](_0x6a66('0x42'),[][_0x6a66('0x43')](_0x32250d[_0x412060]));}else if(_0x412060===_0x6a66('0x41')){var _0x42c688='%'+_0x32250d[_0x412060]+'%';_0xce1163[_0x6a66('0x3a')](_0x6a66('0x44'),_0x42c688);}else if(_0x412060==='User'){_0xce1163[_0x6a66('0x3a')]('uc.UserId\x20=\x20?',_0x32250d[_0x412060]);}else{_0xce1163['and']('c.'+_0x412060+_0x6a66('0x45'),_0x32250d[_0x412060]);}});}return _0xce1163;}function parseQueryParameters(_0x2cdc0e,_0x4ed444){var _0x12c164=getSqlClauses();return Promise[_0x6a66('0x46')]()['then'](function(){return parseModelFields(_0x2cdc0e,_0x4ed444);})[_0x6a66('0x47')](function(_0x20d9f7){_0x12c164[_0x6a66('0x48')][_0x6a66('0x3a')](_0x20d9f7);return parseTagParameter(_0x2cdc0e[_0x6a66('0x49')]);})[_0x6a66('0x47')](function(_0x226c0a){_0x12c164[_0x6a66('0x38')]['clause']['and'](_0x226c0a);return parseSearchFilter(_0x2cdc0e[_0x6a66('0x4a')]);})[_0x6a66('0x47')](function(_0x26e314){_0x12c164[_0x6a66('0x4a')]=_0x26e314;return _0x12c164;});}function checkListsRestrictions(_0x4119f5,_0x17599e,_0x2a3eba){var _0x4ec11b=squel[_0x6a66('0x1e')]();return Promise['resolve']()[_0x6a66('0x47')](function(){if(_0x17599e[_0x6a66('0x5')]&&_0x4119f5[_0x6a66('0x3')]===_0x6a66('0x4')&&!_0x2a3eba){return _0x4119f5[_0x6a66('0x4b')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x83e257){if(_0x83e257){if(_0x83e257['length']===0x0){_0x4ec11b['and'](_0x6a66('0x4c'));}else{_0x4ec11b[_0x6a66('0x3a')](_0x6a66('0x42'),_[_0x6a66('0x37')](_0x83e257,'id'));}}})[_0x6a66('0x47')](function(){return _0x4ec11b;});}function buildContactsQuery(_0x2f9277,_0x56bc1f,_0x5817e6,_0x3ea132,_0x251d69,_0x38c251){if(_0x56bc1f){_0x56bc1f=_0x5817e6[_0x6a66('0x4d')];}_0x2f9277=addFieldsToQuery(_0x2f9277,_0x56bc1f,_0x3ea132,_0x38c251,!![]);var _0x5574f5=squel['select']();_0x5574f5=addFieldsToQuery(_0x5574f5,_0x56bc1f,_0x3ea132,_0x38c251,![]);if(_0x3ea132||_0x38c251){_0x2f9277=applyJoinClauses(_0x2f9277,!![]);_0x2f9277[_0x6a66('0x4e')](_0x6a66('0x4f'));if(_0x5817e6[_0x6a66('0x50')]){_0x5574f5[_0x6a66('0x50')](_0x5817e6['limit']);}if(_0x5817e6['offset']){_0x5574f5[_0x6a66('0x51')](_0x5817e6['offset']);}}else{_0x5574f5=applyJoinClauses(_0x5574f5,![]);_0x5574f5['group']('subqry.id');if(_0x5817e6[_0x6a66('0x50')]){_0x2f9277['limit'](_0x5817e6[_0x6a66('0x50')]);}if(_0x5817e6[_0x6a66('0x51')]){_0x2f9277[_0x6a66('0x51')](_0x5817e6['offset']);}}_0x5574f5[_0x6a66('0x52')](_0x251d69);if(_0x5817e6[_0x6a66('0x53')]){_0x5817e6[_0x6a66('0x53')][_0x6a66('0x20')](function(_0x19b961){_0x2f9277['order']('c.'+_0x19b961[0x0],_0x19b961[0x1]==='DESC'?![]:!![]);_0x5574f5[_0x6a66('0x53')](_0x6a66('0x54')+_0x19b961[0x0],_0x19b961[0x1]===_0x6a66('0x55')?![]:!![]);});}_0x5574f5[_0x6a66('0x8')](_0x2f9277,_0x6a66('0x11'));return _0x5574f5;}function getFilteredContacts(_0x17a67b){var _0x1a87fb=[];return db[_0x6a66('0x36')][_0x6a66('0x56')]({'attributes':['id',_0x6a66('0x2c'),_0x6a66('0x57')],'raw':!![]})[_0x6a66('0x47')](function(_0x213732){_0x1a87fb=_[_0x6a66('0x58')](_0x213732,'id');var _0x3acbec={'type':db[_0x6a66('0x59')][_0x6a66('0x5a')][_0x6a66('0x5b')],'model':db[_0x6a66('0x5c')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x6a66('0x5d')][_0x6a66('0x5e')](_0x17a67b[_0x6a66('0x5f')](),_0x3acbec);})['then'](function(_0x567501){_0x567501[_0x6a66('0x20')](function(_0x21a31e){if(_0x21a31e[_0x6a66('0x1a')]){_0x21a31e[_0x6a66('0x60')]=[];_0x21a31e[_0x6a66('0x1a')][_0x6a66('0x22')](',')[_0x6a66('0x20')](function(_0x1f955b){_0x21a31e[_0x6a66('0x60')]['push'](_0x1a87fb[_0x1f955b]);});}delete _0x21a31e[_0x6a66('0x1a')];});return _0x567501;});}function countFilteredContacts(_0x7be050,_0x54bd61){var _0x45047e=_0x7be050[_0x6a66('0x61')]();_0x45047e[_0x6a66('0x1d')](_0x6a66('0x62'));_0x45047e=applyJoinClauses(_0x45047e,!![]);_0x7be050['group'](_0x6a66('0x4f'));var _0x29928b=utils['getSelectedTags'](_0x54bd61);if(!_[_0x6a66('0x63')](_0x29928b)){_0x45047e[_0x6a66('0xa')](_0x6a66('0x64'),_0x29928b);}var _0x52590d={'type':db[_0x6a66('0x59')][_0x6a66('0x5a')][_0x6a66('0x5b')],'raw':!![]};return db['sequelize'][_0x6a66('0x5e')](_0x45047e[_0x6a66('0x5f')](),_0x52590d)[_0x6a66('0x47')](function(_0x1c971c){return _0x1c971c[0x0]['COUNT(*)'];});}module[_0x6a66('0x65')]={'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 6e74d3d..3c149ad 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 _0xd90d=['encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','data','encryptString','secret','base64','decryptString','utf8','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192'];(function(_0x375d69,_0x9ab275){var _0x171e1b=function(_0x3a93da){while(--_0x3a93da){_0x375d69['push'](_0x375d69['shift']());}};_0x171e1b(++_0x9ab275);}(_0xd90d,0x8b));var _0xdd90=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xd90d[_0x599e60];return _0x468e19;};'use strict';var crypto=require(_0xdd90('0x0'));var fs=require('fs');var BPromise=require(_0xdd90('0x1'));var _=require('lodash');var config=require(_0xdd90('0x2'));var logger=require(_0xdd90('0x3'))(_0xdd90('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xdd90('0x5')][_0xdd90('0x6')],'algorithm':_0xdd90('0x7')};const fileOptions={'algorithm':_0xdd90('0x8')};if(config[_0xdd90('0x9')]&&config[_0xdd90('0x9')][_0xdd90('0xa')]){var isSupported=isAlgorithmSupported(config[_0xdd90('0x9')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0xdd90('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xdd90('0xb')](',\x20');logger[_0xdd90('0xc')](config[_0xdd90('0x9')][_0xdd90('0xa')],_0xdd90('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x58b0f7){return AES_SUPPORTED_RX[_0xdd90('0xe')](_0x58b0f7);}function getSupportedCiphers(){return crypto[_0xdd90('0xf')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x5a9d68){return getSupportedCiphers()[_0xdd90('0x10')](_0x5a9d68)>-0x1;}function combineOptions(_0x11950d){var _0x599650={};for(var _0x2dc4e2 in fileOptions){if(fileOptions[_0xdd90('0x11')](_0x2dc4e2)){_0x599650[_0x2dc4e2]=fileOptions[_0x2dc4e2];}}if(_0x11950d){for(var _0x292f06 in _0x11950d){if(_0x11950d[_0xdd90('0x11')](_0x292f06)){_0x599650[_0x292f06]=_0x11950d[_0x292f06];}}}return _0x599650;}exports[_0xdd90('0x12')]=function(_0x413ac2,_0x333e4e,_0x2f831e,_0x458165){return new BPromise(function(_0x436bc1,_0x2b581d){_0x458165=combineOptions(_0x458165);var _0x425601=new Buffer(_0x2f831e);var _0x2c3948=fs['createReadStream'](_0x413ac2);var _0x9250a9=fs[_0xdd90('0x13')](_0x333e4e);var _0x538d25=crypto[_0xdd90('0x14')](_0x458165['algorithm'],_0x425601);_0x2c3948['on']('data',function(_0x2f565f){var _0x508d39=new Buffer(_0x538d25[_0xdd90('0x15')](_0x2f565f),_0xdd90('0x16'));_0x9250a9[_0xdd90('0x17')](_0x508d39);});_0x2c3948['on'](_0xdd90('0x18'),function(){try{var _0x340cd2=new Buffer(_0x538d25[_0xdd90('0x19')](_0xdd90('0x16')),_0xdd90('0x16'));_0x9250a9[_0xdd90('0x17')](_0x340cd2);_0x9250a9['end']();_0x9250a9['on'](_0xdd90('0x1a'),function(){return _0x436bc1(_0x333e4e);});}catch(_0x517ab2){fs[_0xdd90('0x1b')](_0x333e4e);return _0x2b581d(_0x517ab2);}});});};exports[_0xdd90('0x1c')]=function(_0x25dbed,_0x4c3128,_0x28f6c5,_0x40fe71){return new BPromise(function(_0x5659b4,_0x1ee12e){_0x40fe71=combineOptions(_0x40fe71);var _0x3d8f92=new Buffer(_0x28f6c5);var _0x440907=fs[_0xdd90('0x1d')](_0x25dbed);var _0x4b3f15=fs[_0xdd90('0x13')](_0x4c3128);var _0x58e2a8=crypto[_0xdd90('0x1e')](_0x40fe71[_0xdd90('0xa')],_0x3d8f92);_0x440907['on'](_0xdd90('0x1f'),function(_0x55209f){var _0x3769ad=new Buffer(_0x58e2a8[_0xdd90('0x15')](_0x55209f),'binary');_0x4b3f15[_0xdd90('0x17')](_0x3769ad);});_0x440907['on']('end',function(){try{var _0xa9f15b=new Buffer(_0x58e2a8['final']('binary'),_0xdd90('0x16'));_0x4b3f15[_0xdd90('0x17')](_0xa9f15b);_0x4b3f15[_0xdd90('0x18')]();_0x4b3f15['on'](_0xdd90('0x1a'),function(){return _0x5659b4(_0x4c3128);});}catch(_0x161b40){fs['unlink'](_0x4c3128);return _0x1ee12e(_0x161b40);}});});};exports[_0xdd90('0x20')]=function(_0x31c64b,_0x3822e7,_0x2f522c){var _0x2b813c=_0x2f522c||stringOptions[_0xdd90('0xa')];var _0x5a5bd3=_0x3822e7||stringOptions[_0xdd90('0x21')];var _0x42818b=crypto[_0xdd90('0x14')](_0x2b813c,_0x5a5bd3);var _0x101209=_0x42818b['update'](_0x31c64b,'utf8',_0xdd90('0x22'));_0x101209+=_0x42818b[_0xdd90('0x19')](_0xdd90('0x22'));return _0x101209;};exports[_0xdd90('0x23')]=function(_0x5ad868,_0x34d3e8,_0x5a2cf0){var _0x5628f8=_0x5a2cf0||stringOptions[_0xdd90('0xa')];var _0x251347=_0x34d3e8||stringOptions[_0xdd90('0x21')];var _0x3aa2a6=crypto[_0xdd90('0x1e')](_0x5628f8,_0x251347);var _0xa8ff58=_0x3aa2a6[_0xdd90('0x15')](_0x5ad868,_0xdd90('0x22'),_0xdd90('0x24'));_0xa8ff58+=_0x3aa2a6[_0xdd90('0x19')](_0xdd90('0x24'));return _0xa8ff58;}; \ No newline at end of file +var _0xf836=['encryptFile','createReadStream','createWriteStream','createCipher','data','write','end','final','binary','decryptFile','update','close','unlink','secret','utf8','base64','decryptString','createDecipher','crypto','../../config/logger','app','secrets','session','aes-256-ctr','aes192','algorithm','encrypt','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty'];(function(_0x598ab7,_0x99be98){var _0xdc9b35=function(_0x4fd9f1){while(--_0x4fd9f1){_0x598ab7['push'](_0x598ab7['shift']());}};_0xdc9b35(++_0x99be98);}(_0xf836,0xe4));var _0x6f83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf836[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x6f83('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require('../../config/environment');var logger=require(_0x6f83('0x1'))(_0x6f83('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6f83('0x3')][_0x6f83('0x4')],'algorithm':_0x6f83('0x5')};const fileOptions={'algorithm':_0x6f83('0x6')};if(config['encrypt']&&config['encrypt'][_0x6f83('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x6f83('0x7')]);if(isSupported){fileOptions[_0x6f83('0x7')]=config[_0x6f83('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6f83('0x9')](',\x20');logger[_0x6f83('0xa')](config[_0x6f83('0x8')][_0x6f83('0x7')],_0x6f83('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x5cacfc){return AES_SUPPORTED_RX[_0x6f83('0xc')](_0x5cacfc);}function getSupportedCiphers(){return crypto[_0x6f83('0xd')]()[_0x6f83('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x50070e){return getSupportedCiphers()[_0x6f83('0xf')](_0x50070e)>-0x1;}function combineOptions(_0x42420f){var _0x3e1888={};for(var _0x22c639 in fileOptions){if(fileOptions[_0x6f83('0x10')](_0x22c639)){_0x3e1888[_0x22c639]=fileOptions[_0x22c639];}}if(_0x42420f){for(var _0x3c5f66 in _0x42420f){if(_0x42420f[_0x6f83('0x10')](_0x3c5f66)){_0x3e1888[_0x3c5f66]=_0x42420f[_0x3c5f66];}}}return _0x3e1888;}exports[_0x6f83('0x11')]=function(_0x54993d,_0x203a48,_0x1b961a,_0x48f5d5){return new BPromise(function(_0x235fbd,_0x7f3787){_0x48f5d5=combineOptions(_0x48f5d5);var _0x50d2ea=new Buffer(_0x1b961a);var _0x463c1e=fs[_0x6f83('0x12')](_0x54993d);var _0x49548c=fs[_0x6f83('0x13')](_0x203a48);var _0xd5e3df=crypto[_0x6f83('0x14')](_0x48f5d5[_0x6f83('0x7')],_0x50d2ea);_0x463c1e['on'](_0x6f83('0x15'),function(_0x2f637c){var _0x3c0b62=new Buffer(_0xd5e3df['update'](_0x2f637c),'binary');_0x49548c[_0x6f83('0x16')](_0x3c0b62);});_0x463c1e['on'](_0x6f83('0x17'),function(){try{var _0x38f6f9=new Buffer(_0xd5e3df[_0x6f83('0x18')](_0x6f83('0x19')),_0x6f83('0x19'));_0x49548c[_0x6f83('0x16')](_0x38f6f9);_0x49548c[_0x6f83('0x17')]();_0x49548c['on']('close',function(){return _0x235fbd(_0x203a48);});}catch(_0x2d29b4){fs['unlink'](_0x203a48);return _0x7f3787(_0x2d29b4);}});});};exports[_0x6f83('0x1a')]=function(_0x1ebc5f,_0xc6c7ca,_0x573b20,_0x21bde3){return new BPromise(function(_0x369904,_0x3e9a2d){_0x21bde3=combineOptions(_0x21bde3);var _0x16c5f=new Buffer(_0x573b20);var _0x4797ad=fs[_0x6f83('0x12')](_0x1ebc5f);var _0x4de763=fs[_0x6f83('0x13')](_0xc6c7ca);var _0x2846bf=crypto['createDecipher'](_0x21bde3[_0x6f83('0x7')],_0x16c5f);_0x4797ad['on'](_0x6f83('0x15'),function(_0x6adc33){var _0x5deb88=new Buffer(_0x2846bf[_0x6f83('0x1b')](_0x6adc33),_0x6f83('0x19'));_0x4de763[_0x6f83('0x16')](_0x5deb88);});_0x4797ad['on'](_0x6f83('0x17'),function(){try{var _0x3a63db=new Buffer(_0x2846bf['final']('binary'),_0x6f83('0x19'));_0x4de763[_0x6f83('0x16')](_0x3a63db);_0x4de763['end']();_0x4de763['on'](_0x6f83('0x1c'),function(){return _0x369904(_0xc6c7ca);});}catch(_0x12977d){fs[_0x6f83('0x1d')](_0xc6c7ca);return _0x3e9a2d(_0x12977d);}});});};exports['encryptString']=function(_0x5f400a,_0x527a2b,_0x22347b){var _0x2c9168=_0x22347b||stringOptions[_0x6f83('0x7')];var _0x5925b6=_0x527a2b||stringOptions[_0x6f83('0x1e')];var _0x2f942b=crypto[_0x6f83('0x14')](_0x2c9168,_0x5925b6);var _0x4e28a1=_0x2f942b[_0x6f83('0x1b')](_0x5f400a,_0x6f83('0x1f'),_0x6f83('0x20'));_0x4e28a1+=_0x2f942b['final'](_0x6f83('0x20'));return _0x4e28a1;};exports[_0x6f83('0x21')]=function(_0x541b46,_0x3abe8f,_0x183f30){var _0xa2ca7e=_0x183f30||stringOptions['algorithm'];var _0x507b5d=_0x3abe8f||stringOptions[_0x6f83('0x1e')];var _0x50d6c5=crypto[_0x6f83('0x22')](_0xa2ca7e,_0x507b5d);var _0x1504ca=_0x50d6c5[_0x6f83('0x1b')](_0x541b46,_0x6f83('0x20'),'utf8');_0x1504ca+=_0x50d6c5[_0x6f83('0x18')]('utf8');return _0x1504ca;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index e0655bc..fe2c3c7 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 _0xc8ba=['splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split'];(function(_0x621f8f,_0x38aa7d){var _0x44e9cd=function(_0x38ade1){while(--_0x38ade1){_0x621f8f['push'](_0x621f8f['shift']());}};_0x44e9cd(++_0x38aa7d);}(_0xc8ba,0x167));var _0xac8b=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0xc8ba[_0xce93c];return _0x230720;};'use strict';var util=require(_0xac8b('0x0'));var path=require(_0xac8b('0x1'));var _=require(_0xac8b('0x2'));var csv=require(_0xac8b('0x3'));var fs=require('fs');var BPromise=require(_0xac8b('0x4'));var zipdir=require(_0xac8b('0x5'));var rimraf=require(_0xac8b('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xac8b('0x7')];var logger=require(_0xac8b('0x8'))(_0xac8b('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xac8b('0xa')][0x2]);var QUERY=process[_0xac8b('0xa')][0x3];var PATH=process[_0xac8b('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x12f05e,_0x3e8018){var _0x159dbe={'status':_0x12f05e};var _0x1cef58={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e8018){_0x159dbe[_0xac8b('0xb')]=_0x3e8018;}return db[_0xac8b('0xc')][_0xac8b('0xd')](_0x159dbe,_0x1cef58);}function main(){var _0x510203=0x1388;var _0x200a2e;logger['info'](util[_0xac8b('0xe')](_0xac8b('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xac8b('0x10')][_0xac8b('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xac8b('0x12'),_0xac8b('0x13')]})[_0xac8b('0x14')](function(_0x3c05cc){if(_0x3c05cc){_0x200a2e=_0x3c05cc;_0x510203=_0x200a2e[_0xac8b('0x13')]||0x1388;}})[_0xac8b('0x14')](function(){return dbH[_0xac8b('0x15')][_0xac8b('0x16')](util[_0xac8b('0xe')](_0xac8b('0x17'),QUERY),{'type':dbH[_0xac8b('0x15')]['QueryTypes']['SELECT']});})[_0xac8b('0x14')](function(_0x39473a){if(!_0x39473a[0x0][_0xac8b('0x18')]){return analyticExtractedReport(_0xac8b('0x19'));}var _0x597af7=[];var _0x3cb736=0x0;if(_0x200a2e[_0xac8b('0x12')]){if(_0x39473a&&_0x39473a[_0xac8b('0x1a')]){var _0x3436b4=_[_0xac8b('0x1b')](_0x39473a[0x0][_0xac8b('0x18')]/_0x510203);var _0x4ac31a=Number[_0xac8b('0x1c')](_0x39473a[0x0][_0xac8b('0x18')]/_0x510203)?_0x39473a[0x0][_0xac8b('0x18')]%_0x510203:0x0;_0x3436b4[_0xac8b('0x1d')](function(_0x401af7){if(_0x401af7>0x0){_0x3cb736+=_0x510203;}_0x597af7['push'](dbH[_0xac8b('0x15')][_0xac8b('0x16')](util['format'](_0xac8b('0x1e'),QUERY,_0x510203,_0x3cb736),{'type':dbH[_0xac8b('0x15')][_0xac8b('0x1f')][_0xac8b('0x20')]}));});if(_0x4ac31a>0x0){_0x3cb736+=_0x510203;_0x597af7['push'](dbH[_0xac8b('0x15')][_0xac8b('0x16')](util[_0xac8b('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4ac31a,_0x3cb736),{'type':dbH[_0xac8b('0x15')][_0xac8b('0x1f')][_0xac8b('0x20')]}));}}}else{_0x597af7['push'](dbH[_0xac8b('0x15')]['query'](QUERY,{'type':dbH[_0xac8b('0x15')]['QueryTypes'][_0xac8b('0x20')]}));}var _0x5acd41=path[_0xac8b('0x21')](PATH);var _0x437c19=path[_0xac8b('0x22')](PATH,_0xac8b('0x23'));var _0x151a25=_0x200a2e[_0xac8b('0x12')]&&_0x597af7[_0xac8b('0x1a')]>0x1;var _0x42d93c=[];if(!fs[_0xac8b('0x24')](path[_0xac8b('0x25')](_0x5acd41,_0x437c19))&&_0x151a25){fs[_0xac8b('0x26')](path[_0xac8b('0x25')](_0x5acd41,_0x437c19));}return BPromise[_0xac8b('0x27')](_0x597af7,function(_0x22331e){_0x42d93c['push'](_0x22331e);})[_0xac8b('0x14')](function(){for(var _0x46922b=0x0;_0x46922b<_0x42d93c[_0xac8b('0x1a')];_0x46922b+=0x1){var _0x4eae54;var _0x1562ec=_0x42d93c[_0x46922b];if(_0x151a25){_0x4eae54=path[_0xac8b('0x25')](_0x5acd41,_0x437c19,util['format'](_0xac8b('0x28'),_0x437c19,_0x46922b,_0xac8b('0x29')));}else{_0x4eae54=path[_0xac8b('0x25')](_0x5acd41,util[_0xac8b('0xe')](_0xac8b('0x2a'),_0x437c19,'csv'));}fs['writeFileSync'](_0x4eae54,csv(_0x1562ec));}})[_0xac8b('0x14')](function(){if(_0x151a25){return new Promise(function(_0x37be39){zipdir(path[_0xac8b('0x25')](_0x5acd41,_0x437c19),{'saveTo':path[_0xac8b('0x25')](_0x5acd41,util[_0xac8b('0xe')](_0xac8b('0x2a'),_0x437c19,_0xac8b('0x2b')))},function(_0x4a0dc2,_0x3c812e){rimraf(path[_0xac8b('0x25')](_0x5acd41,_0x437c19),function(){});_0x37be39(_0xac8b('0x2c'));});});}})[_0xac8b('0x14')](function(){logger[_0xac8b('0x2d')](util[_0xac8b('0xe')](_0xac8b('0x2e'),EXTRACTED_REPORT_ID,_0xac8b('0x2f')));return analyticExtractedReport(_0xac8b('0x30'),_0x151a25?util['format'](_0xac8b('0x2a'),_0x437c19,_0x151a25?_0xac8b('0x2b'):_0xac8b('0x29')):null);});})[_0xac8b('0x31')](function(_0x5302f2){logger[_0xac8b('0x2d')](util[_0xac8b('0xe')](_0xac8b('0x32'),EXTRACTED_REPORT_ID,_0xac8b('0x2f')),util['inspect'](_0x5302f2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xac8b('0x33'));})[_0xac8b('0x34')](function(){process[_0xac8b('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xacea=['existsSync','join','each','%s%d.%s','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','csv','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','range','num','isInteger','forEach','query','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xacea,0x1a7));var _0xaace=function(_0x16e7ec,_0x305a28){_0x16e7ec=_0x16e7ec-0x0;var _0x17c25e=_0xacea[_0x16e7ec];return _0x17c25e;};'use strict';var util=require(_0xaace('0x0'));var path=require(_0xaace('0x1'));var _=require(_0xaace('0x2'));var csv=require(_0xaace('0x3'));var fs=require('fs');var BPromise=require(_0xaace('0x4'));var zipdir=require(_0xaace('0x5'));var rimraf=require(_0xaace('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xaace('0x7')];var logger=require(_0xaace('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xaace('0x9')][0x2]);var QUERY=process[_0xaace('0x9')][0x3];var PATH=process[_0xaace('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x440535,_0x4bfcee){var _0x30973f={'status':_0x440535};var _0x555d71={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bfcee){_0x30973f[_0xaace('0xa')]=_0x4bfcee;}return db[_0xaace('0xb')]['update'](_0x30973f,_0x555d71);}function main(){var _0x8b3833=0x1388;var _0x537ad3;logger[_0xaace('0xc')](util[_0xaace('0xd')](_0xaace('0xe'),EXTRACTED_REPORT_ID,_0xaace('0xf')));return db[_0xaace('0x10')][_0xaace('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xaace('0x12'),_0xaace('0x13')]})['then'](function(_0x266d96){if(_0x266d96){_0x537ad3=_0x266d96;_0x8b3833=_0x537ad3['splitSizeCsv']||0x1388;}})[_0xaace('0x14')](function(){return dbH[_0xaace('0x15')]['query'](util[_0xaace('0xd')](_0xaace('0x16'),QUERY),{'type':dbH[_0xaace('0x15')]['QueryTypes'][_0xaace('0x17')]});})[_0xaace('0x14')](function(_0x6b7291){if(!_0x6b7291[0x0]['num']){return analyticExtractedReport(_0xaace('0x18'));}var _0x2f9bd3=[];var _0x69eaba=0x0;if(_0x537ad3[_0xaace('0x12')]){if(_0x6b7291&&_0x6b7291[_0xaace('0x19')]){var _0x1f6aab=_[_0xaace('0x1a')](_0x6b7291[0x0][_0xaace('0x1b')]/_0x8b3833);var _0x5aba2d=Number[_0xaace('0x1c')](_0x6b7291[0x0][_0xaace('0x1b')]/_0x8b3833)?_0x6b7291[0x0][_0xaace('0x1b')]%_0x8b3833:0x0;_0x1f6aab[_0xaace('0x1d')](function(_0x311d22){if(_0x311d22>0x0){_0x69eaba+=_0x8b3833;}_0x2f9bd3['push'](dbH[_0xaace('0x15')][_0xaace('0x1e')](util[_0xaace('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x8b3833,_0x69eaba),{'type':dbH[_0xaace('0x15')]['QueryTypes'][_0xaace('0x17')]}));});if(_0x5aba2d>0x0){_0x69eaba+=_0x8b3833;_0x2f9bd3[_0xaace('0x1f')](dbH[_0xaace('0x15')][_0xaace('0x1e')](util[_0xaace('0xd')](_0xaace('0x20'),QUERY,_0x5aba2d,_0x69eaba),{'type':dbH[_0xaace('0x15')][_0xaace('0x21')][_0xaace('0x17')]}));}}}else{_0x2f9bd3[_0xaace('0x1f')](dbH['sequelize'][_0xaace('0x1e')](QUERY,{'type':dbH[_0xaace('0x15')]['QueryTypes'][_0xaace('0x17')]}));}var _0x5c7d53=path[_0xaace('0x22')](PATH);var _0x914375=path[_0xaace('0x23')](PATH,'.csv');var _0x264e78=_0x537ad3[_0xaace('0x12')]&&_0x2f9bd3[_0xaace('0x19')]>0x1;var _0x3a4430=[];if(!fs[_0xaace('0x24')](path['join'](_0x5c7d53,_0x914375))&&_0x264e78){fs['mkdirSync'](path[_0xaace('0x25')](_0x5c7d53,_0x914375));}return BPromise[_0xaace('0x26')](_0x2f9bd3,function(_0x4903c5){_0x3a4430[_0xaace('0x1f')](_0x4903c5);})[_0xaace('0x14')](function(){for(var _0x41d451=0x0;_0x41d451<_0x3a4430[_0xaace('0x19')];_0x41d451+=0x1){var _0x2aed7a;var _0x493408=_0x3a4430[_0x41d451];if(_0x264e78){_0x2aed7a=path[_0xaace('0x25')](_0x5c7d53,_0x914375,util[_0xaace('0xd')](_0xaace('0x27'),_0x914375,_0x41d451,'csv'));}else{_0x2aed7a=path[_0xaace('0x25')](_0x5c7d53,util['format'](_0xaace('0x28'),_0x914375,'csv'));}fs[_0xaace('0x29')](_0x2aed7a,csv(_0x493408));}})[_0xaace('0x14')](function(){if(_0x264e78){return new Promise(function(_0x47981b){zipdir(path[_0xaace('0x25')](_0x5c7d53,_0x914375),{'saveTo':path[_0xaace('0x25')](_0x5c7d53,util[_0xaace('0xd')](_0xaace('0x28'),_0x914375,_0xaace('0x2a')))},function(_0x4cf0af,_0x56e80d){rimraf(path['join'](_0x5c7d53,_0x914375),function(){});_0x47981b(_0xaace('0x2b'));});});}})[_0xaace('0x14')](function(){logger[_0xaace('0xc')](util[_0xaace('0xd')](_0xaace('0x2c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xaace('0x2d'),_0x264e78?util[_0xaace('0xd')](_0xaace('0x28'),_0x914375,_0x264e78?_0xaace('0x2a'):_0xaace('0x2e')):null);});})[_0xaace('0x2f')](function(_0x2a0e94){logger[_0xaace('0xc')](util['format'](_0xaace('0x30'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x2a0e94,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xaace('0x31'));})[_0xaace('0x32')](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 a81cd36..30a4393 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 _0xb781=['pageBreak','margin','landscape','\x20/\x20','Arial','right','num','Empty','find','split','splitSizePdf','then','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','SELECT','dirname','.pdf','existsSync','each','flatten','createPdfKitDocument','join','%s%d.%s','%s.%s','pdf','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','error','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','map','tableHeader','pick','toString','length','body','push','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header'];(function(_0x180dda,_0x577ad9){var _0x5d003c=function(_0x2cdfd6){while(--_0x2cdfd6){_0x180dda['push'](_0x180dda['shift']());}};_0x5d003c(++_0x577ad9);}(_0xb781,0x128));var _0x1b78=function(_0xb389ea,_0x389f9a){_0xb389ea=_0xb389ea-0x0;var _0xf08fa=_0xb781[_0xb389ea];return _0xf08fa;};'use strict';var _=require(_0x1b78('0x0'));var fs=require('fs');var util=require(_0x1b78('0x1'));var path=require(_0x1b78('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x1b78('0x3'));var PdfPrinter=require(_0x1b78('0x4'));var zipdir=require(_0x1b78('0x5'));var rimraf=require(_0x1b78('0x6'));var JSDOM=require(_0x1b78('0x7'))[_0x1b78('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0x1b78('0x9'));var db=require(_0x1b78('0xa'))['db'];var dbH=require(_0x1b78('0xa'))[_0x1b78('0xb')];var logger=require(_0x1b78('0xc'))(_0x1b78('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x1b78('0xe')][0x2]);var QUERY=process[_0x1b78('0xe')][0x3];var PATH=process[_0x1b78('0xe')][0x4];var NAME=process[_0x1b78('0xe')][0x5];var FORMAT=_0x1b78('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5ff14b,_0x351900){var _0x54e739={'status':_0x5ff14b};var _0x35e150={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x351900){_0x54e739['savename']=_0x351900;}return db['AnalyticExtractedReport'][_0x1b78('0x10')](_0x54e739,_0x35e150);}function getHeaders(_0x14d5a1){return _[_0x1b78('0x11')](_0x14d5a1,function(_0x13c97e){return{'text':_0x13c97e,'style':_0x1b78('0x12')};});}function getRows(_0x1ade20,_0x32bde6){return _[_0x1b78('0x11')](_0x32bde6,function(_0x206d38){return _(_0x206d38)[_0x1b78('0x13')](_0x1ade20)[_0x1b78('0x11')](function(_0x2a5729){return _0x2a5729?_[_0x1b78('0x14')](_0x2a5729):'';})['value']();});}function createTable(_0x705c0c,_0x20a56d){var _0x39463b={'widths':_['fill'](Array(_0x705c0c[_0x1b78('0x15')]),0x91),'heights':function(_0xb65477){return _0xb65477===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x564eb5=getHeaders(_0x705c0c);_0x39463b[_0x1b78('0x16')][_0x1b78('0x17')](_0x564eb5);var _0x3cae7c=getRows(_0x705c0c,_0x20a56d);_0x39463b[_0x1b78('0x16')]=_0x39463b['body'][_0x1b78('0x18')](_0x3cae7c);return _0x39463b;}function createTables(_0x563d52){var _0x403a77=[];var _0x16d160=_['chunk'](Object['keys'](_0x563d52[0x0]),0x5);_0x16d160[_0x1b78('0x19')](function(_0x402499){_0x403a77[_0x1b78('0x17')](createTable(_0x402499,_0x563d52));});return _0x403a77;}function getPDFDocDefinition(_0x3b164c){var _0x2cd6fa=util[_0x1b78('0x1a')](_0x1b78('0x1b'),NAME,EXTRACTED_REPORT[_0x1b78('0x1c')],moment(EXTRACTED_REPORT[_0x1b78('0x1d')])[_0x1b78('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x1b78('0x1e')])[_0x1b78('0x1a')](FORMAT));var _0xfe9214=[];for(var _0x52f901=0x0;_0x52f901<_0x3b164c[_0x1b78('0x15')];_0x52f901++){var _0x3ef684=[];if(_0x52f901===0x0){_0x3ef684[_0x1b78('0x17')]({'text':_0x2cd6fa,'style':_0x1b78('0x1f')});}var _0x13e035={'table':_0x3b164c[_0x52f901]};if(_0x52f901>0x0){_0x13e035[_0x1b78('0x20')]='before';_0x13e035[_0x1b78('0x21')]=[0x0,0x46,0x0,0x0];}_0x3ef684['push'](_0x13e035);_0xfe9214[_0x1b78('0x17')](_0x3ef684);}return{'pageSize':'A4','pageOrientation':_0x1b78('0x22'),'content':_0xfe9214,'footer':function(_0x320220,_0x59a437){return{'text':_0x320220[_0x1b78('0x14')]()+_0x1b78('0x23')+_0x59a437,'style':'footer'};},'defaultStyle':{'font':_0x1b78('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x1b78('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x53f429){var _0x1990fd=0x1388;var _0x24bba5;if(!_0x53f429[0x0][_0x1b78('0x26')]){return analyticExtractedReport(_0x1b78('0x27'));}return db['Setting'][_0x1b78('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1b78('0x29'),_0x1b78('0x2a')]})[_0x1b78('0x2b')](function(_0x298750){if(_0x298750){_0x24bba5=_0x298750;_0x1990fd=_0x24bba5['splitSizePdf']||0x3e8;}})[_0x1b78('0x2b')](function(){var _0x2f5643=[];var _0x3c5e4f=0x0;if(_0x24bba5[_0x1b78('0x29')]){if(_0x53f429&&_0x53f429[_0x1b78('0x15')]){var _0x1bb4e1=_['range'](_0x53f429[0x0][_0x1b78('0x26')]/_0x1990fd);var _0x1e015a=Number['isInteger'](_0x53f429[0x0][_0x1b78('0x26')]/_0x1990fd)?_0x53f429[0x0][_0x1b78('0x26')]%_0x1990fd:0x0;_0x1bb4e1['forEach'](function(_0xc30258){if(_0xc30258>0x0){_0x3c5e4f+=_0x1990fd;}_0x2f5643['push'](dbH[_0x1b78('0x2c')]['query'](util[_0x1b78('0x1a')](_0x1b78('0x2d'),QUERY,_0x1990fd,_0x3c5e4f),{'type':dbH[_0x1b78('0x2c')][_0x1b78('0x2e')]['SELECT']}));});if(_0x1e015a>0x0){_0x3c5e4f+=_0x1990fd;_0x2f5643[_0x1b78('0x17')](dbH[_0x1b78('0x2c')][_0x1b78('0x2f')](util['format'](_0x1b78('0x2d'),QUERY,_0x1e015a,_0x3c5e4f),{'type':dbH[_0x1b78('0x2c')][_0x1b78('0x2e')][_0x1b78('0x30')]}));}}}else{_0x2f5643['push'](dbH['sequelize'][_0x1b78('0x2f')](QUERY,{'type':dbH[_0x1b78('0x2c')][_0x1b78('0x2e')]['SELECT']}));}var _0x15e986=path[_0x1b78('0x31')](PATH);var _0x39efd0=path['basename'](PATH,_0x1b78('0x32'));var _0x17474e=_0x24bba5[_0x1b78('0x29')]&&_0x2f5643[_0x1b78('0x15')]>0x1;var _0x5ae8ac=[];if(!fs[_0x1b78('0x33')](path['join'](_0x15e986,_0x39efd0))&&_0x17474e){fs['mkdirSync'](path['join'](_0x15e986,_0x39efd0));}return BPromise[_0x1b78('0x34')](_0x2f5643,function(_0x155b93){_0x5ae8ac[_0x1b78('0x17')](_0x155b93);})[_0x1b78('0x2b')](function(){var _0x12cf8a=[];for(var _0xfcb64f=0x0;_0xfcb64f<_0x5ae8ac['length'];_0xfcb64f+=0x1){var _0x28d9b3=_0x5ae8ac[_0xfcb64f];var _0x2a7854=createTables(_[_0x1b78('0x35')](_0x28d9b3));var _0x4fa51f;var _0x54f288=getPDFDocDefinition(_0x2a7854);var _0x4801c7=getPDFPrinter();var _0x4bd93c=_0x4801c7[_0x1b78('0x36')](_0x54f288);if(_0x17474e){_0x4fa51f=path[_0x1b78('0x37')](_0x15e986,_0x39efd0,util[_0x1b78('0x1a')](_0x1b78('0x38'),_0x39efd0,_0xfcb64f,'pdf'));}else{_0x4fa51f=path['join'](_0x15e986,util[_0x1b78('0x1a')](_0x1b78('0x39'),_0x39efd0,_0x1b78('0x3a')));}_0x12cf8a[_0x1b78('0x17')](writePDFDocument(_0x4bd93c,_0x4fa51f));}return Promise['all'](_0x12cf8a);})[_0x1b78('0x2b')](function(){if(_0x17474e){return new Promise(function(_0x544b1c){zipdir(path[_0x1b78('0x37')](_0x15e986,_0x39efd0),{'saveTo':path[_0x1b78('0x37')](_0x15e986,util[_0x1b78('0x1a')](_0x1b78('0x39'),_0x39efd0,_0x1b78('0x3b')))},function(){rimraf(path[_0x1b78('0x37')](_0x15e986,_0x39efd0),function(){});_0x544b1c(_0x1b78('0x3c'));});});}})[_0x1b78('0x2b')](function(){if(!_0x17474e)return;rimraf(path[_0x1b78('0x37')](_0x15e986,_0x39efd0),function(){});})['then'](function(){logger['info'](util['format'](_0x1b78('0x3d'),EXTRACTED_REPORT_ID,_0x1b78('0x3e')));return analyticExtractedReport(_0x1b78('0x3f'),_0x17474e?util[_0x1b78('0x1a')]('%s.%s',_0x39efd0,_0x17474e?_0x1b78('0x3b'):_0x1b78('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1b78('0x40')](util[_0x1b78('0x1a')](_0x1b78('0x41'),EXTRACTED_REPORT_ID,_0x1b78('0x3e')));return db[_0x1b78('0x42')][_0x1b78('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x7501fc){EXTRACTED_REPORT=_0x7501fc;return dbH['sequelize'][_0x1b78('0x2f')](util[_0x1b78('0x1a')](_0x1b78('0x44'),QUERY),{'type':dbH[_0x1b78('0x2c')][_0x1b78('0x2e')]['SELECT']});})['then'](extractReport)[_0x1b78('0x45')](function(_0x5d5809){logger[_0x1b78('0x40')](util[_0x1b78('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1b78('0x3e')),util['inspect'](_0x5d5809,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1b78('0x46'));})['finally'](function(){process[_0x1b78('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x23c2b5=new PdfPrinter({'Arial':{'normal':__dirname+_0x1b78('0x48'),'bold':__dirname+_0x1b78('0x49'),'italics':__dirname+_0x1b78('0x4a'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x23c2b5;}function getPDFDocDefinitionFromHTML(_0x321b77,_0x585706){var _0x1fb5f7=util['format']('%s\x20#%d',_0x585706[_0x1b78('0x4b')],_0x585706['interactionId']);var _0x5f0ae9=moment()[_0x1b78('0x1a')](_0x1b78('0x4c'))['toString']();var _0x337b72=htmlToPdfmake(_0x321b77,{'window':window,'tableAutoSize':!![]});return{'content':[_0x337b72],'defaultStyle':{'font':_0x1b78('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x1b78('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1b78('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x1b78('0x4d')}},'header':function(){return[{'text':_0x1b78('0x4e'),'style':_0x1b78('0x1f')}];},'footer':function(_0x20f2b3,_0x1859d7){return[{'text':util[_0x1b78('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1fb5f7,_0x20f2b3,_0x1859d7,_0x5f0ae9),'style':_0x1b78('0x4f')}];}};}function writePDFDocument(_0x26a9b6,_0x28021c){return new Promise(function(_0x17c60d,_0x45ab7a){var _0xff4420=_0x26a9b6[_0x1b78('0x50')](fs['createWriteStream'](_0x28021c));_0xff4420['on']('finish',function(){_0x17c60d('finish');});_0xff4420['on'](_0x1b78('0x51'),function(_0xcf40f0){_0x45ab7a(_0xcf40f0);});_0x26a9b6['end']();});}exports['createPdfFromHTML']=function(_0x102ba9,_0x178028){var _0x35d35c=getPDFPrinter();var _0x5c599c=getPDFDocDefinitionFromHTML(_0x102ba9,_0x178028);var _0x24c66f=_0x35d35c['createPdfKitDocument'](_0x5c599c);return writePDFDocument(_0x24c66f,_0x178028['path'])[_0x1b78('0x45')](function(_0x2d6b29){throw _0x2d6b29;});}; \ No newline at end of file +var _0xb57e=['keys','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','header','pageBreak','before','margin','landscape','Arial','black','right','Empty','split','splitSizePdf','then','range','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','zip-dir','rimraf','JSDOM','bluebird','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','toString','value','fill','length','body'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xb57e,0x19e));var _0xeb57=function(_0x44f554,_0x4345d7){_0x44f554=_0x44f554-0x0;var _0x3148a9=_0xb57e[_0x44f554];return _0x3148a9;};'use strict';var _=require(_0xeb57('0x0'));var fs=require('fs');var util=require(_0xeb57('0x1'));var path=require(_0xeb57('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xeb57('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xeb57('0x4'));var rimraf=require(_0xeb57('0x5'));var JSDOM=require('jsdom')[_0xeb57('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xeb57('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xeb57('0x8')];var logger=require(_0xeb57('0x9'))(_0xeb57('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xeb57('0xb')][0x4];var NAME=process[_0xeb57('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1ddc69,_0x4dd276){var _0x5cb64c={'status':_0x1ddc69};var _0x32d732={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4dd276){_0x5cb64c[_0xeb57('0xc')]=_0x4dd276;}return db[_0xeb57('0xd')][_0xeb57('0xe')](_0x5cb64c,_0x32d732);}function getHeaders(_0x26fc74){return _['map'](_0x26fc74,function(_0x3aad03){return{'text':_0x3aad03,'style':'tableHeader'};});}function getRows(_0x3f477f,_0x2037a3){return _['map'](_0x2037a3,function(_0x288374){return _(_0x288374)['pick'](_0x3f477f)[_0xeb57('0xf')](function(_0x2135d8){return _0x2135d8?_[_0xeb57('0x10')](_0x2135d8):'';})[_0xeb57('0x11')]();});}function createTable(_0xc008c1,_0x279e17){var _0x3d8de1={'widths':_[_0xeb57('0x12')](Array(_0xc008c1[_0xeb57('0x13')]),0x91),'heights':function(_0xe8f234){return _0xe8f234===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x54d8de=getHeaders(_0xc008c1);_0x3d8de1[_0xeb57('0x14')]['push'](_0x54d8de);var _0x5bccb5=getRows(_0xc008c1,_0x279e17);_0x3d8de1[_0xeb57('0x14')]=_0x3d8de1['body']['concat'](_0x5bccb5);return _0x3d8de1;}function createTables(_0x568bdf){var _0x3fd2c4=[];var _0x3c570b=_['chunk'](Object[_0xeb57('0x15')](_0x568bdf[0x0]),0x5);_0x3c570b[_0xeb57('0x16')](function(_0x1ebd55){_0x3fd2c4[_0xeb57('0x17')](createTable(_0x1ebd55,_0x568bdf));});return _0x3fd2c4;}function getPDFDocDefinition(_0x8259f9){var _0x407775=util['format'](_0xeb57('0x18'),NAME,EXTRACTED_REPORT[_0xeb57('0x19')],moment(EXTRACTED_REPORT[_0xeb57('0x1a')])[_0xeb57('0x1b')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xeb57('0x1b')](FORMAT));var _0x7504d0=[];for(var _0x54ec4d=0x0;_0x54ec4d<_0x8259f9[_0xeb57('0x13')];_0x54ec4d++){var _0xcf4f25=[];if(_0x54ec4d===0x0){_0xcf4f25['push']({'text':_0x407775,'style':_0xeb57('0x1c')});}var _0x42acc5={'table':_0x8259f9[_0x54ec4d]};if(_0x54ec4d>0x0){_0x42acc5[_0xeb57('0x1d')]=_0xeb57('0x1e');_0x42acc5[_0xeb57('0x1f')]=[0x0,0x46,0x0,0x0];}_0xcf4f25[_0xeb57('0x17')](_0x42acc5);_0x7504d0[_0xeb57('0x17')](_0xcf4f25);}return{'pageSize':'A4','pageOrientation':_0xeb57('0x20'),'content':_0x7504d0,'footer':function(_0x29ed22,_0x11e4af){return{'text':_0x29ed22[_0xeb57('0x10')]()+'\x20/\x20'+_0x11e4af,'style':'footer'};},'defaultStyle':{'font':_0xeb57('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xeb57('0x22')},'footer':{'alignment':_0xeb57('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xd6be48){var _0x57c947=0x1388;var _0x16850d;if(!_0xd6be48[0x0]['num']){return analyticExtractedReport(_0xeb57('0x24'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeb57('0x25'),_0xeb57('0x26')]})[_0xeb57('0x27')](function(_0x37eb37){if(_0x37eb37){_0x16850d=_0x37eb37;_0x57c947=_0x16850d[_0xeb57('0x26')]||0x3e8;}})[_0xeb57('0x27')](function(){var _0x290d6f=[];var _0x5bc9e1=0x0;if(_0x16850d[_0xeb57('0x25')]){if(_0xd6be48&&_0xd6be48[_0xeb57('0x13')]){var _0x5eb314=_[_0xeb57('0x28')](_0xd6be48[0x0][_0xeb57('0x29')]/_0x57c947);var _0x2816d1=Number[_0xeb57('0x2a')](_0xd6be48[0x0][_0xeb57('0x29')]/_0x57c947)?_0xd6be48[0x0][_0xeb57('0x29')]%_0x57c947:0x0;_0x5eb314[_0xeb57('0x16')](function(_0x4e7359){if(_0x4e7359>0x0){_0x5bc9e1+=_0x57c947;}_0x290d6f[_0xeb57('0x17')](dbH[_0xeb57('0x2b')][_0xeb57('0x2c')](util[_0xeb57('0x1b')](_0xeb57('0x2d'),QUERY,_0x57c947,_0x5bc9e1),{'type':dbH[_0xeb57('0x2b')][_0xeb57('0x2e')][_0xeb57('0x2f')]}));});if(_0x2816d1>0x0){_0x5bc9e1+=_0x57c947;_0x290d6f['push'](dbH['sequelize'][_0xeb57('0x2c')](util[_0xeb57('0x1b')](_0xeb57('0x2d'),QUERY,_0x2816d1,_0x5bc9e1),{'type':dbH[_0xeb57('0x2b')][_0xeb57('0x2e')][_0xeb57('0x2f')]}));}}}else{_0x290d6f[_0xeb57('0x17')](dbH[_0xeb57('0x2b')][_0xeb57('0x2c')](QUERY,{'type':dbH[_0xeb57('0x2b')]['QueryTypes'][_0xeb57('0x2f')]}));}var _0x25cc54=path[_0xeb57('0x30')](PATH);var _0x3bdfce=path[_0xeb57('0x31')](PATH,_0xeb57('0x32'));var _0x28a339=_0x16850d[_0xeb57('0x25')]&&_0x290d6f[_0xeb57('0x13')]>0x1;var _0x30da9b=[];if(!fs['existsSync'](path[_0xeb57('0x33')](_0x25cc54,_0x3bdfce))&&_0x28a339){fs['mkdirSync'](path[_0xeb57('0x33')](_0x25cc54,_0x3bdfce));}return BPromise[_0xeb57('0x34')](_0x290d6f,function(_0x4bfa73){_0x30da9b['push'](_0x4bfa73);})[_0xeb57('0x27')](function(){var _0x399f93=[];for(var _0x1f6ed8=0x0;_0x1f6ed8<_0x30da9b[_0xeb57('0x13')];_0x1f6ed8+=0x1){var _0x16a7a5=_0x30da9b[_0x1f6ed8];var _0x3ea97e=createTables(_[_0xeb57('0x35')](_0x16a7a5));var _0x3be812;var _0x3d8305=getPDFDocDefinition(_0x3ea97e);var _0x232aea=getPDFPrinter();var _0x871fb2=_0x232aea[_0xeb57('0x36')](_0x3d8305);if(_0x28a339){_0x3be812=path[_0xeb57('0x33')](_0x25cc54,_0x3bdfce,util[_0xeb57('0x1b')](_0xeb57('0x37'),_0x3bdfce,_0x1f6ed8,_0xeb57('0x38')));}else{_0x3be812=path['join'](_0x25cc54,util[_0xeb57('0x1b')]('%s.%s',_0x3bdfce,_0xeb57('0x38')));}_0x399f93[_0xeb57('0x17')](writePDFDocument(_0x871fb2,_0x3be812));}return Promise[_0xeb57('0x39')](_0x399f93);})[_0xeb57('0x27')](function(){if(_0x28a339){return new Promise(function(_0x4d8997){zipdir(path['join'](_0x25cc54,_0x3bdfce),{'saveTo':path[_0xeb57('0x33')](_0x25cc54,util[_0xeb57('0x1b')](_0xeb57('0x3a'),_0x3bdfce,_0xeb57('0x3b')))},function(){rimraf(path['join'](_0x25cc54,_0x3bdfce),function(){});_0x4d8997(_0xeb57('0x3c'));});});}})[_0xeb57('0x27')](function(){if(!_0x28a339)return;rimraf(path['join'](_0x25cc54,_0x3bdfce),function(){});})[_0xeb57('0x27')](function(){logger[_0xeb57('0x3d')](util[_0xeb57('0x1b')](_0xeb57('0x3e'),EXTRACTED_REPORT_ID,_0xeb57('0x3f')));return analyticExtractedReport(_0xeb57('0x40'),_0x28a339?util[_0xeb57('0x1b')]('%s.%s',_0x3bdfce,_0x28a339?_0xeb57('0x3b'):_0xeb57('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xeb57('0x3d')](util['format'](_0xeb57('0x41'),EXTRACTED_REPORT_ID,_0xeb57('0x3f')));return db['AnalyticExtractedReport'][_0xeb57('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xeb57('0x27')](function(_0x1f2f08){EXTRACTED_REPORT=_0x1f2f08;return dbH[_0xeb57('0x2b')][_0xeb57('0x2c')](util[_0xeb57('0x1b')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xeb57('0x2b')]['QueryTypes'][_0xeb57('0x2f')]});})[_0xeb57('0x27')](extractReport)[_0xeb57('0x43')](function(_0x111afc){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xeb57('0x3f')),util[_0xeb57('0x44')](_0x111afc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xeb57('0x45')](function(){process[_0xeb57('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5678c3=new PdfPrinter({'Arial':{'normal':__dirname+_0xeb57('0x47'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xeb57('0x48'),'bolditalics':__dirname+_0xeb57('0x49')}});return _0x5678c3;}function getPDFDocDefinitionFromHTML(_0x23f6dd,_0x57e400){var _0x20f909=util[_0xeb57('0x1b')](_0xeb57('0x4a'),_0x57e400[_0xeb57('0x4b')],_0x57e400[_0xeb57('0x4c')]);var _0x49373c=moment()[_0xeb57('0x1b')](_0xeb57('0x4d'))['toString']();var _0x4108ba=htmlToPdfmake(_0x23f6dd,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4108ba],'defaultStyle':{'font':_0xeb57('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xeb57('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xeb57('0x4f'),'style':'header'}];},'footer':function(_0x4e3c1d,_0x3debba){return[{'text':util['format'](_0xeb57('0x50'),_0x20f909,_0x4e3c1d,_0x3debba,_0x49373c),'style':_0xeb57('0x51')}];}};}function writePDFDocument(_0x22e93c,_0x444509){return new Promise(function(_0x18602a,_0x36f137){var _0xfb0fab=_0x22e93c[_0xeb57('0x52')](fs[_0xeb57('0x53')](_0x444509));_0xfb0fab['on'](_0xeb57('0x54'),function(){_0x18602a('finish');});_0xfb0fab['on']('error',function(_0x20bd43){_0x36f137(_0x20bd43);});_0x22e93c[_0xeb57('0x55')]();});}exports[_0xeb57('0x56')]=function(_0x598e76,_0x3231fa){var _0x33299d=getPDFPrinter();var _0x2966c2=getPDFDocDefinitionFromHTML(_0x598e76,_0x3231fa);var _0xf5c52e=_0x33299d[_0xeb57('0x36')](_0x2966c2);return writePDFDocument(_0xf5c52e,_0x3231fa[_0xeb57('0x2')])[_0xeb57('0x43')](function(_0x42eb81){throw _0x42eb81;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 388f749..61f9b98 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 _0xcbf4=['mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join'];(function(_0x51557b,_0x521c80){var _0x83171=function(_0x17bd85){while(--_0x17bd85){_0x51557b['push'](_0x51557b['shift']());}};_0x83171(++_0x521c80);}(_0xcbf4,0x7c));var _0x4cbf=function(_0x1a7e65,_0x57bc50){_0x1a7e65=_0x1a7e65-0x0;var _0x2f11db=_0xcbf4[_0x1a7e65];return _0x2f11db;};'use strict';var util=require(_0x4cbf('0x0'));var path=require('path');var _=require(_0x4cbf('0x1'));var fs=require('fs');var json2xls=require(_0x4cbf('0x2'));var BPromise=require(_0x4cbf('0x3'));var zipdir=require(_0x4cbf('0x4'));var rimraf=require(_0x4cbf('0x5'));var db=require(_0x4cbf('0x6'))['db'];var dbH=require(_0x4cbf('0x6'))['dbH'];var logger=require(_0x4cbf('0x7'))(_0x4cbf('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x4cbf('0x9')][0x2]);var QUERY=process[_0x4cbf('0x9')][0x3];var PATH=process[_0x4cbf('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa497,_0x45427f){var _0x3d98ce={'status':_0xa497};var _0x55d3f0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45427f){_0x3d98ce[_0x4cbf('0xa')]=_0x45427f;}return db[_0x4cbf('0xb')]['update'](_0x3d98ce,_0x55d3f0);}function main(){var _0x3d1345=0x1388;var _0x5380e1;logger[_0x4cbf('0xc')](util[_0x4cbf('0xd')](_0x4cbf('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4cbf('0xf')]})[_0x4cbf('0x10')](function(_0x45af09){if(_0x45af09){_0x5380e1=_0x45af09;_0x3d1345=_0x5380e1[_0x4cbf('0xf')]||0x1388;}})[_0x4cbf('0x10')](function(){return dbH[_0x4cbf('0x11')]['query'](util[_0x4cbf('0xd')](_0x4cbf('0x12'),QUERY),{'type':dbH['sequelize'][_0x4cbf('0x13')][_0x4cbf('0x14')]});})[_0x4cbf('0x10')](function(_0x90e9b4){if(!_0x90e9b4[0x0][_0x4cbf('0x15')]){return analyticExtractedReport(_0x4cbf('0x16'));}var _0x3733f7=[];var _0x96cb5a=0x0;if(_0x5380e1[_0x4cbf('0x17')]){if(_0x90e9b4&&_0x90e9b4[_0x4cbf('0x18')]){var _0x57738b=_[_0x4cbf('0x19')](_0x90e9b4[0x0][_0x4cbf('0x15')]/_0x3d1345);var _0x2c22ba=Number[_0x4cbf('0x1a')](_0x90e9b4[0x0][_0x4cbf('0x15')]/_0x3d1345)?_0x90e9b4[0x0][_0x4cbf('0x15')]%_0x3d1345:0x0;_0x57738b[_0x4cbf('0x1b')](function(_0x811be1){if(_0x811be1>0x0){_0x96cb5a+=_0x3d1345;}_0x3733f7[_0x4cbf('0x1c')](dbH[_0x4cbf('0x11')]['query'](util[_0x4cbf('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3d1345,_0x96cb5a),{'type':dbH[_0x4cbf('0x11')][_0x4cbf('0x13')][_0x4cbf('0x14')]}));});if(_0x2c22ba>0x0){_0x96cb5a+=_0x3d1345;_0x3733f7[_0x4cbf('0x1c')](dbH['sequelize'][_0x4cbf('0x1d')](util[_0x4cbf('0xd')](_0x4cbf('0x1e'),QUERY,_0x2c22ba,_0x96cb5a),{'type':dbH[_0x4cbf('0x11')]['QueryTypes'][_0x4cbf('0x14')]}));}}}else{_0x3733f7[_0x4cbf('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x4cbf('0x13')][_0x4cbf('0x14')]}));}var _0x4e5c16=path['dirname'](PATH);var _0x2017d8=path[_0x4cbf('0x1f')](PATH,_0x4cbf('0x20'));var _0x1f41b2=_0x5380e1[_0x4cbf('0x17')]&&_0x3733f7[_0x4cbf('0x18')]>0x1;var _0x1eafc1=[];if(!fs[_0x4cbf('0x21')](path[_0x4cbf('0x22')](_0x4e5c16,_0x2017d8))&&_0x1f41b2){fs[_0x4cbf('0x23')](path[_0x4cbf('0x22')](_0x4e5c16,_0x2017d8));}return BPromise[_0x4cbf('0x24')](_0x3733f7,function(_0x4c1576){_0x1eafc1['push'](_0x4c1576);})[_0x4cbf('0x10')](function(){for(var _0x483a29=0x0;_0x483a29<_0x1eafc1[_0x4cbf('0x18')];_0x483a29+=0x1){var _0x1efd25;var _0x186fea=_0x1eafc1[_0x483a29];if(_0x1f41b2){_0x1efd25=path[_0x4cbf('0x22')](_0x4e5c16,_0x2017d8,util[_0x4cbf('0xd')](_0x4cbf('0x25'),_0x2017d8,_0x483a29,_0x4cbf('0x26')));}else{_0x1efd25=path['join'](_0x4e5c16,util[_0x4cbf('0xd')](_0x4cbf('0x27'),_0x2017d8,'xlsx'));}fs[_0x4cbf('0x28')](_0x1efd25,json2xls(_0x186fea),_0x4cbf('0x29'));}})['then'](function(){if(_0x1f41b2){return new Promise(function(_0x4f1e89){zipdir(path[_0x4cbf('0x22')](_0x4e5c16,_0x2017d8),{'saveTo':path[_0x4cbf('0x22')](_0x4e5c16,util[_0x4cbf('0xd')]('%s.%s',_0x2017d8,_0x4cbf('0x2a')))},function(_0x5c0545,_0x4776cd){rimraf(path[_0x4cbf('0x22')](_0x4e5c16,_0x2017d8),function(){});_0x4f1e89(_0x4cbf('0x2b'));});});}})[_0x4cbf('0x10')](function(){logger['info'](util[_0x4cbf('0xd')](_0x4cbf('0x2c'),EXTRACTED_REPORT_ID,_0x4cbf('0x2d')));return analyticExtractedReport(_0x4cbf('0x2e'),_0x1f41b2?util[_0x4cbf('0xd')]('%s.%s',_0x2017d8,_0x1f41b2?_0x4cbf('0x2a'):_0x4cbf('0x26')):null);});})[_0x4cbf('0x2f')](function(_0x534eed){logger['info'](util['format'](_0x4cbf('0x30'),EXTRACTED_REPORT_ID,_0x4cbf('0x2d')),util[_0x4cbf('0x31')](_0x534eed,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4cbf('0x32'));})[_0x4cbf('0x33')](function(){process[_0x4cbf('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x235d=['split','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','num','length','isInteger','forEach','QueryTypes','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename'];(function(_0x12404d,_0x1f3b85){var _0xc78ffe=function(_0x3117fe){while(--_0x3117fe){_0x12404d['push'](_0x12404d['shift']());}};_0xc78ffe(++_0x1f3b85);}(_0x235d,0x9d));var _0xd235=function(_0x565fca,_0x5eb049){_0x565fca=_0x565fca-0x0;var _0x53d20d=_0x235d[_0x565fca];return _0x53d20d;};'use strict';var util=require(_0xd235('0x0'));var path=require('path');var _=require(_0xd235('0x1'));var fs=require('fs');var json2xls=require(_0xd235('0x2'));var BPromise=require(_0xd235('0x3'));var zipdir=require(_0xd235('0x4'));var rimraf=require('rimraf');var db=require(_0xd235('0x5'))['db'];var dbH=require(_0xd235('0x5'))[_0xd235('0x6')];var logger=require('../../config/logger')(_0xd235('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xd235('0x8')][0x2]);var QUERY=process[_0xd235('0x8')][0x3];var PATH=process[_0xd235('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a56e1,_0x13a67f){var _0x279142={'status':_0x4a56e1};var _0x1af298={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x13a67f){_0x279142[_0xd235('0x9')]=_0x13a67f;}return db[_0xd235('0xa')]['update'](_0x279142,_0x1af298);}function main(){var _0x18114b=0x1388;var _0x16bce8;logger[_0xd235('0xb')](util[_0xd235('0xc')](_0xd235('0xd'),EXTRACTED_REPORT_ID,_0xd235('0xe')));return db[_0xd235('0xf')][_0xd235('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd235('0x11')]})[_0xd235('0x12')](function(_0x5c6abc){if(_0x5c6abc){_0x16bce8=_0x5c6abc;_0x18114b=_0x16bce8['splitSizeXlsx']||0x1388;}})[_0xd235('0x12')](function(){return dbH[_0xd235('0x13')][_0xd235('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd235('0x13')]['QueryTypes']['SELECT']});})[_0xd235('0x12')](function(_0x27930a){if(!_0x27930a[0x0][_0xd235('0x15')]){return analyticExtractedReport('Empty');}var _0xaf33df=[];var _0x22e481=0x0;if(_0x16bce8['split']){if(_0x27930a&&_0x27930a[_0xd235('0x16')]){var _0xe570de=_['range'](_0x27930a[0x0][_0xd235('0x15')]/_0x18114b);var _0x1a45a7=Number[_0xd235('0x17')](_0x27930a[0x0][_0xd235('0x15')]/_0x18114b)?_0x27930a[0x0][_0xd235('0x15')]%_0x18114b:0x0;_0xe570de[_0xd235('0x18')](function(_0x481926){if(_0x481926>0x0){_0x22e481+=_0x18114b;}_0xaf33df['push'](dbH[_0xd235('0x13')][_0xd235('0x14')](util[_0xd235('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x18114b,_0x22e481),{'type':dbH[_0xd235('0x13')][_0xd235('0x19')]['SELECT']}));});if(_0x1a45a7>0x0){_0x22e481+=_0x18114b;_0xaf33df[_0xd235('0x1a')](dbH[_0xd235('0x13')]['query'](util[_0xd235('0xc')](_0xd235('0x1b'),QUERY,_0x1a45a7,_0x22e481),{'type':dbH['sequelize'][_0xd235('0x19')]['SELECT']}));}}}else{_0xaf33df['push'](dbH[_0xd235('0x13')][_0xd235('0x14')](QUERY,{'type':dbH[_0xd235('0x13')][_0xd235('0x19')][_0xd235('0x1c')]}));}var _0x4f37b3=path[_0xd235('0x1d')](PATH);var _0x3578f6=path[_0xd235('0x1e')](PATH,'.xlsx');var _0x3baebd=_0x16bce8[_0xd235('0x1f')]&&_0xaf33df[_0xd235('0x16')]>0x1;var _0x5a3193=[];if(!fs[_0xd235('0x20')](path[_0xd235('0x21')](_0x4f37b3,_0x3578f6))&&_0x3baebd){fs[_0xd235('0x22')](path[_0xd235('0x21')](_0x4f37b3,_0x3578f6));}return BPromise[_0xd235('0x23')](_0xaf33df,function(_0x1e2a77){_0x5a3193[_0xd235('0x1a')](_0x1e2a77);})[_0xd235('0x12')](function(){for(var _0x41f24a=0x0;_0x41f24a<_0x5a3193[_0xd235('0x16')];_0x41f24a+=0x1){var _0x50c336;var _0x31754a=_0x5a3193[_0x41f24a];if(_0x3baebd){_0x50c336=path[_0xd235('0x21')](_0x4f37b3,_0x3578f6,util['format'](_0xd235('0x24'),_0x3578f6,_0x41f24a,_0xd235('0x25')));}else{_0x50c336=path[_0xd235('0x21')](_0x4f37b3,util[_0xd235('0xc')](_0xd235('0x26'),_0x3578f6,_0xd235('0x25')));}fs['writeFileSync'](_0x50c336,json2xls(_0x31754a),_0xd235('0x27'));}})[_0xd235('0x12')](function(){if(_0x3baebd){return new Promise(function(_0x3647fd){zipdir(path['join'](_0x4f37b3,_0x3578f6),{'saveTo':path[_0xd235('0x21')](_0x4f37b3,util[_0xd235('0xc')]('%s.%s',_0x3578f6,_0xd235('0x28')))},function(_0x2b82e8,_0xa13851){rimraf(path['join'](_0x4f37b3,_0x3578f6),function(){});_0x3647fd(_0xd235('0x29'));});});}})[_0xd235('0x12')](function(){logger['info'](util['format'](_0xd235('0x2a'),EXTRACTED_REPORT_ID,_0xd235('0xe')));return analyticExtractedReport(_0xd235('0x2b'),_0x3baebd?util['format'](_0xd235('0x26'),_0x3578f6,_0x3baebd?_0xd235('0x28'):_0xd235('0x25')):null);});})[_0xd235('0x2c')](function(_0xefc0e3){logger['info'](util['format'](_0xd235('0x2d'),EXTRACTED_REPORT_ID,_0xd235('0xe')),util['inspect'](_0xefc0e3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xd235('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index fc55d5a..80ee515 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 _0xcf45=['${EXTEN:','${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=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','intervals','tag','CDR(tag)=','callerID','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','catch','error','rewrite','util','models','Interval','then','VoiceExtension','findAll','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extension','extensions','push','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits'];(function(_0x2e514e,_0x3ad2fb){var _0x44f708=function(_0x440095){while(--_0x440095){_0x2e514e['push'](_0x2e514e['shift']());}};_0x44f708(++_0x3ad2fb);}(_0xcf45,0x19d));var _0x5cf4=function(_0x51a9e9,_0x312535){_0x51a9e9=_0x51a9e9-0x0;var _0x46a3bb=_0xcf45[_0x51a9e9];return _0x46a3bb;};'use strict';var _=require('lodash');var util=require(_0x5cf4('0x0'));function rewrite(_0x980c99,_0x4669b2){var _0x5ddbb8=this;return _0x980c99[_0x5cf4('0x1')][_0x5cf4('0x2')]['findAll']({'raw':!![]})[_0x5cf4('0x3')](function(_0xccc05b){_0x5ddbb8['intervals']=_0xccc05b;return _0x980c99[_0x5cf4('0x1')][_0x5cf4('0x4')][_0x5cf4('0x5')]({'where':{'IntervalId':_0x4669b2[_0x5cf4('0x6')]},'raw':!![]});})[_0x5cf4('0x3')](function(_0xe5c3a7){return _0x980c99[_0x5cf4('0x1')][_0x5cf4('0x4')][_0x5cf4('0x5')]({'where':{'exten':{'$in':_[_0x5cf4('0x7')](_[_0x5cf4('0x8')](_0xe5c3a7,'exten'))}},'order':[{'raw':_0x5cf4('0x9')}],'raw':!![]});})[_0x5cf4('0x3')](function(_0x40d2ec){var _0x3ef439=_[_0x5cf4('0xa')](_0x40d2ec,{'priority':'1'});var _0xdef749=_[_0x5cf4('0xa')](_0x40d2ec,{'isApp':0x1});var _0x51a734=_[_0x5cf4('0xb')](_0xdef749,_0x5cf4('0xc'));var _0x32340a=[_0x5cf4('0xd'),_0x5cf4('0xe')];var _0x14b4d5=[];var _0x440764=[];for(var _0x54d7d6 in _0x51a734){if(_0x51a734[_0x5cf4('0xf')](_0x54d7d6)){_0x5ddbb8[_0x5cf4('0x10')]=0x2;_0x5ddbb8['extensions']=[];_0x5ddbb8[_0x5cf4('0x11')]=_['find'](_0x3ef439,{'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')]});_0x5ddbb8[_0x5cf4('0x12')][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':'Set','appdata':util[_0x5cf4('0x15')](_0x5cf4('0x16'),_0x51a734[_0x54d7d6][0x0]['type']),'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});if(_0x51a734[_0x54d7d6][0x0]['type']===_0x5cf4('0x19')){_0x5ddbb8[_0x5cf4('0x12')]['push']({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':_0x5cf4('0x1a'),'appdata':_0x5cf4('0x1b')+_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')],'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0]['exten'],'priority':_0x5ddbb8['priority']++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});}else if(_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')]===_0x5cf4('0x1c')){if(_0x5ddbb8['extension']){_0x5ddbb8['extensions'][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':_0x5cf4('0x1a'),'appdata':_0x5cf4('0x1d')+(_0x5ddbb8[_0x5cf4('0x11')][_0x5cf4('0x1e')]?_0x5cf4('0x1f')+_0x5ddbb8[_0x5cf4('0x11')]['cutdigits']+'}':_0x5cf4('0x20')),'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});}_0x5ddbb8[_0x5cf4('0x12')][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':_0x5cf4('0x1a'),'appdata':_0x5cf4('0x1b')+_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')],'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});var _0x24047b=_0x5ddbb8[_0x5cf4('0x10')]++;_0x5ddbb8['extensions'][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':_0x5cf4('0x21'),'appdata':_0x5cf4('0x22')+(_0x24047b+0x2)+_0x5cf4('0x23')+(_0x24047b+0x1)+')','context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0]['exten'],'priority':_0x24047b,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});if(_0x5ddbb8[_0x5cf4('0x11')]){_0x5ddbb8['extensions'][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':_0x5cf4('0x1a'),'appdata':_0x5ddbb8[_0x5cf4('0x11')][_0x5cf4('0x1e')]?_0x5cf4('0x24')+_0x5ddbb8[_0x5cf4('0x11')][_0x5cf4('0x1e')]+'}':_0x5cf4('0x25'),'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0]['VoiceExtensionId']});}_0x5ddbb8[_0x5cf4('0x12')]['push']({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':'Set','appdata':_0x5cf4('0x26')+_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')],'context':_0x51a734[_0x54d7d6][0x0]['context'],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0]['VoiceExtensionId']});if(_0x5ddbb8[_0x5cf4('0x11')]&&_0x5ddbb8[_0x5cf4('0x11')]['hasOwnProperty'](_0x5cf4('0x27'))&&_0x5ddbb8[_0x5cf4('0x11')][_0x5cf4('0x27')]!==_0x5cf4('0x28')){_0x5ddbb8['extensions'][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0]['type'],'app':_0x5cf4('0x1a'),'appdata':_0x5cf4('0x29'),'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8['priority']++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});_0x5ddbb8[_0x5cf4('0x12')][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':'Set','appdata':_0x5cf4('0x2a')+_0x5ddbb8[_0x5cf4('0x11')][_0x5cf4('0x27')]||'wav','context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0]['exten'],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});}}_0x5ddbb8[_0x5cf4('0x12')][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':'Set','appdata':_0x5cf4('0x2b'),'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0]['exten'],'priority':_0x5ddbb8['priority']++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});_0x5ddbb8['extensions'][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x14')],'app':'Set','appdata':_0x5cf4('0x2c'),'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});_0x5ddbb8[_0x5cf4('0x12')][_0x5cf4('0x13')]({'type':_0x51a734[_0x54d7d6][0x0]['type'],'app':_0x5cf4('0x1a'),'appdata':_0x5cf4('0x2d'),'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'exten':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0xc')],'priority':_0x5ddbb8[_0x5cf4('0x10')]++,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0]['VoiceExtensionId']});for(var _0x5f24b2=0x0,_0x1503d7=0x0;_0x5f24b2<_0x51a734[_0x54d7d6]['length'];_0x5f24b2+=0x1,_0x1503d7=0x0){var _0x293859=_0x51a734[_0x54d7d6][_0x5f24b2];if(_0x293859['type']){_0x293859[_0x5cf4('0x14')]=_0x293859[_0x5cf4('0x14')][_0x5cf4('0x2e')]();}var _0x5d6d64=[];var _0x4155e3=[];delete _0x293859['id'];delete _0x293859[_0x5cf4('0x2f')];delete _0x293859['updatedAt'];var _0xe2b450=_0x293859['interval']!=='*,*,*,*'?[_0x293859[_0x5cf4('0x30')]]:_0x293859['IntervalId']?_[_0x5cf4('0x8')](_[_0x5cf4('0xa')](_0x5ddbb8[_0x5cf4('0x31')],{'IntervalId':_0x293859[_0x5cf4('0x6')]}),'interval'):[];if(_0x293859[_0x5cf4('0xf')](_0x5cf4('0x32'))){if(_0x293859[_0x5cf4('0x32')]&&_0x293859[_0x5cf4('0x32')]!=='--'){_0x5d6d64[_0x5cf4('0x13')]({'type':_0x293859['type'],'app':_0x5cf4('0x1a'),'appdata':_0x5cf4('0x33')+_0x293859[_0x5cf4('0x32')],'context':_0x293859[_0x5cf4('0x17')],'exten':_0x293859[_0x5cf4('0xc')],'priority':_0xe2b450['length']+_0x5ddbb8[_0x5cf4('0x10')]+_0x1503d7++,'VoiceExtensionId':_0x293859[_0x5cf4('0x18')]});}}if(_0x293859[_0x5cf4('0x14')]===_0x5cf4('0x1c')&&_0x293859[_0x5cf4('0xf')](_0x5cf4('0x34'))){if(_0x293859[_0x5cf4('0x34')]){_0x5d6d64[_0x5cf4('0x13')]({'type':_0x293859[_0x5cf4('0x14')],'app':_0x5cf4('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x293859[_0x5cf4('0x34')]+')','context':_0x293859['context'],'exten':_0x293859[_0x5cf4('0xc')],'priority':_0xe2b450[_0x5cf4('0x35')]+_0x5ddbb8[_0x5cf4('0x10')]+_0x1503d7++,'VoiceExtensionId':_0x293859[_0x5cf4('0x18')]});}else{_0x5d6d64['push']({'type':_0x293859[_0x5cf4('0x14')],'app':_0x5cf4('0x21'),'appdata':_0x5cf4('0x36'),'context':_0x293859[_0x5cf4('0x17')],'exten':_0x293859[_0x5cf4('0xc')],'priority':_0xe2b450['length']+_0x5ddbb8['priority']+_0x1503d7++,'VoiceExtensionId':_0x293859[_0x5cf4('0x18')]});}}if(_0x293859['hasOwnProperty'](_0x5cf4('0x37'))){if(_0x32340a[_0x5cf4('0x38')](_0x293859[_0x5cf4('0x39')][_0x5cf4('0x2e')]())>=0x0&&_0x293859[_0x5cf4('0x3a')]!==_0x5cf4('0x3b')){if(_0x293859['answer']){_0x5d6d64[_0x5cf4('0x13')]({'type':_0x293859[_0x5cf4('0x14')],'app':_0x5cf4('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x293859[_0x5cf4('0x17')],'exten':_0x293859[_0x5cf4('0xc')],'priority':_0xe2b450[_0x5cf4('0x35')]+_0x5ddbb8['priority']+_0x1503d7++,'VoiceExtensionId':_0x293859['VoiceExtensionId']});_0x5d6d64[_0x5cf4('0x13')]({'type':_0x293859[_0x5cf4('0x14')],'app':'Set','appdata':_0x5cf4('0x3c'),'context':_0x293859[_0x5cf4('0x17')],'exten':_0x293859[_0x5cf4('0xc')],'priority':_0xe2b450[_0x5cf4('0x35')]+_0x5ddbb8[_0x5cf4('0x10')]+_0x1503d7++,'VoiceExtensionId':_0x293859['VoiceExtensionId']});}else{_0x5d6d64[_0x5cf4('0x13')]({'type':_0x293859[_0x5cf4('0x14')],'app':'ExecIf','appdata':_0x5cf4('0x3d'),'context':_0x293859[_0x5cf4('0x17')],'exten':_0x293859[_0x5cf4('0xc')],'priority':_0xe2b450[_0x5cf4('0x35')]+_0x5ddbb8[_0x5cf4('0x10')]+_0x1503d7++,'VoiceExtensionId':_0x293859[_0x5cf4('0x18')]});_0x5d6d64[_0x5cf4('0x13')]({'type':_0x293859[_0x5cf4('0x14')],'app':_0x5cf4('0x1a'),'appdata':_0x5cf4('0x3e'),'context':_0x293859['context'],'exten':_0x293859[_0x5cf4('0xc')],'priority':_0xe2b450[_0x5cf4('0x35')]+_0x5ddbb8[_0x5cf4('0x10')]+_0x1503d7++,'VoiceExtensionId':_0x293859[_0x5cf4('0x18')]});}}}for(var _0x1f8b46=0x0;_0x1f8b46<_0xe2b450[_0x5cf4('0x35')];_0x1f8b46+=0x1){var _0x1addb1=_0x5ddbb8['priority']+_0xe2b450[_0x5cf4('0x35')];var _0x18e363=_0x1f8b46===_0xe2b450['length']-0x1?_0x5ddbb8['priority']+_0x5d6d64['length']+_0x4155e3[_0x5cf4('0x35')]+0x2:_0x5ddbb8['priority']+_0x1f8b46+0x1;_0x5d6d64[_0x5cf4('0x3f')](_0x1f8b46,0x0,{'type':_0x293859[_0x5cf4('0x14')],'app':_0x5cf4('0x40'),'appdata':_0xe2b450[_0x1f8b46]+'?'+_0x293859[_0x5cf4('0x17')]+_0x5cf4('0x41')+_0x1addb1+':'+_0x293859[_0x5cf4('0x17')]+',${EXTEN},'+_0x18e363,'exten':_0x293859[_0x5cf4('0xc')],'context':_0x293859[_0x5cf4('0x17')],'priority':_0x5ddbb8['priority']+_0x1f8b46,'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x18')]});}_0x293859[_0x5cf4('0x10')]=_0x5d6d64['length']?_[_0x5cf4('0x42')](_0x5d6d64)[_0x5cf4('0x10')]+0x1:_0x5ddbb8[_0x5cf4('0x10')];_0x5ddbb8['priority']=(_0x4155e3[_0x5cf4('0x35')]?_['last'](_0x4155e3)[_0x5cf4('0x10')]:_0x293859[_0x5cf4('0x10')])+0x1;_0x5ddbb8[_0x5cf4('0x12')]=_['concat'](_0x5ddbb8[_0x5cf4('0x12')],_0x5d6d64,[_0x293859],_0x4155e3);}_0x5ddbb8[_0x5cf4('0x12')]['push']({'type':_0x51a734[_0x54d7d6][0x0]['type'],'app':_0x5cf4('0x43'),'exten':_0x51a734[_0x54d7d6][0x0]['exten'],'context':_0x51a734[_0x54d7d6][0x0][_0x5cf4('0x17')],'priority':_0x5ddbb8[_0x5cf4('0x10')],'VoiceExtensionId':_0x51a734[_0x54d7d6][0x0]['VoiceExtensionId']});_0x14b4d5['push'](_0x51a734[_0x54d7d6][0x0]['VoiceExtensionId']);_0x440764=_[_0x5cf4('0x44')](_0x440764,_0x5ddbb8['extensions']);}}return _0x980c99[_0x5cf4('0x45')](function(_0x118310){return _0x980c99[_0x5cf4('0x1')]['VoiceExtension'][_0x5cf4('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x14b4d5}},'transaction':_0x118310})[_0x5cf4('0x3')](function(_0x2bfb70){return _0x980c99['models'][_0x5cf4('0x4')]['bulkCreate'](_['sortBy'](_0x440764,_0x5cf4('0x10')),{'transaction':_0x118310});});});})[_0x5cf4('0x47')](function(_0x10784f){console[_0x5cf4('0x48')](_0x10784f);});}exports[_0x5cf4('0x49')]=rewrite; \ No newline at end of file +var _0xfe27=['transaction','VoiceExtension','bulkCreate','sortBy','catch','rewrite','models','then','intervals','findAll','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','hasOwnProperty','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','context','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup'];(function(_0x38e47a,_0xc032eb){var _0x1b0649=function(_0x392ba2){while(--_0x392ba2){_0x38e47a['push'](_0x38e47a['shift']());}};_0x1b0649(++_0xc032eb);}(_0xfe27,0x8c));var _0x7fe2=function(_0x1f9ceb,_0x352b4e){_0x1f9ceb=_0x1f9ceb-0x0;var _0x537603=_0xfe27[_0x1f9ceb];return _0x537603;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x3aa50d,_0x9acbf8){var _0x380907=this;return _0x3aa50d[_0x7fe2('0x0')]['Interval']['findAll']({'raw':!![]})[_0x7fe2('0x1')](function(_0x35473f){_0x380907[_0x7fe2('0x2')]=_0x35473f;return _0x3aa50d[_0x7fe2('0x0')]['VoiceExtension'][_0x7fe2('0x3')]({'where':{'IntervalId':_0x9acbf8['IntervalId']},'raw':!![]});})[_0x7fe2('0x1')](function(_0x5c361a){return _0x3aa50d['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x7fe2('0x4')](_['map'](_0x5c361a,'exten'))}},'order':[{'raw':_0x7fe2('0x5')}],'raw':!![]});})[_0x7fe2('0x1')](function(_0x8dbf8d){var _0x126ec6=_[_0x7fe2('0x6')](_0x8dbf8d,{'priority':'1'});var _0x2eebb5=_[_0x7fe2('0x6')](_0x8dbf8d,{'isApp':0x1});var _0x3b450a=_[_0x7fe2('0x7')](_0x2eebb5,_0x7fe2('0x8'));var _0x122400=[_0x7fe2('0x9'),'playback'];var _0xe34661=[];var _0x32a8d4=[];for(var _0x47967c in _0x3b450a){if(_0x3b450a[_0x7fe2('0xa')](_0x47967c)){_0x380907[_0x7fe2('0xb')]=0x2;_0x380907[_0x7fe2('0xc')]=[];_0x380907[_0x7fe2('0xd')]=_[_0x7fe2('0xe')](_0x126ec6,{'exten':_0x3b450a[_0x47967c][0x0]['exten']});_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':util['format'](_0x7fe2('0x12'),_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')]),'context':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x13')],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0]['VoiceExtensionId']});if(_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')]==='inbound'){_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':_0x7fe2('0x14')+_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')],'context':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x13')],'exten':_0x3b450a[_0x47967c][0x0]['exten'],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});}else if(_0x3b450a[_0x47967c][0x0]['type']===_0x7fe2('0x16')){if(_0x380907['extension']){_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':_0x7fe2('0x17')+(_0x380907[_0x7fe2('0xd')][_0x7fe2('0x18')]?_0x7fe2('0x19')+_0x380907[_0x7fe2('0xd')]['cutdigits']+'}':_0x7fe2('0x1a')),'context':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x13')],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});}_0x380907['extensions']['push']({'type':_0x3b450a[_0x47967c][0x0]['type'],'app':_0x7fe2('0x11'),'appdata':_0x7fe2('0x14')+_0x3b450a[_0x47967c][0x0]['VoiceExtensionId'],'context':_0x3b450a[_0x47967c][0x0]['context'],'exten':_0x3b450a[_0x47967c][0x0]['exten'],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});var _0x49f33e=_0x380907[_0x7fe2('0xb')]++;_0x380907['extensions'][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x1b'),'appdata':_0x7fe2('0x1c')+(_0x49f33e+0x2)+'):Goto('+(_0x49f33e+0x1)+')','context':_0x3b450a[_0x47967c][0x0]['context'],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x49f33e,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});if(_0x380907[_0x7fe2('0xd')]){_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0]['type'],'app':_0x7fe2('0x11'),'appdata':_0x380907[_0x7fe2('0xd')][_0x7fe2('0x18')]?_0x7fe2('0x1d')+_0x380907[_0x7fe2('0xd')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x3b450a[_0x47967c][0x0]['context'],'exten':_0x3b450a[_0x47967c][0x0]['exten'],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});}_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':_0x7fe2('0x1e')+_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')],'context':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x13')],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});if(_0x380907[_0x7fe2('0xd')]&&_0x380907['extension'][_0x7fe2('0xa')](_0x7fe2('0x1f'))&&_0x380907[_0x7fe2('0xd')][_0x7fe2('0x1f')]!==_0x7fe2('0x20')){_0x380907['extensions'][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':_0x7fe2('0x21'),'context':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x13')],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0]['VoiceExtensionId']});_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x380907[_0x7fe2('0xd')]['recordingFormat']||_0x7fe2('0x22'),'context':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x13')],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x380907['priority']++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});}}_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x13')],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x380907['priority']++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});_0x380907[_0x7fe2('0xc')][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3b450a[_0x47967c][0x0]['context'],'exten':_0x3b450a[_0x47967c][0x0]['exten'],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});_0x380907['extensions'][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0]['type'],'app':_0x7fe2('0x11'),'appdata':_0x7fe2('0x23'),'context':_0x3b450a[_0x47967c][0x0]['context'],'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'priority':_0x380907[_0x7fe2('0xb')]++,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});for(var _0x562ca6=0x0,_0x11089a=0x0;_0x562ca6<_0x3b450a[_0x47967c][_0x7fe2('0x24')];_0x562ca6+=0x1,_0x11089a=0x0){var _0x291b8e=_0x3b450a[_0x47967c][_0x562ca6];if(_0x291b8e['type']){_0x291b8e[_0x7fe2('0x10')]=_0x291b8e[_0x7fe2('0x10')]['toLowerCase']();}var _0x700b38=[];var _0x15e5b1=[];delete _0x291b8e['id'];delete _0x291b8e[_0x7fe2('0x25')];delete _0x291b8e[_0x7fe2('0x26')];var _0x28e984=_0x291b8e[_0x7fe2('0x27')]!==_0x7fe2('0x28')?[_0x291b8e[_0x7fe2('0x27')]]:_0x291b8e[_0x7fe2('0x29')]?_[_0x7fe2('0x2a')](_['filter'](_0x380907[_0x7fe2('0x2')],{'IntervalId':_0x291b8e[_0x7fe2('0x29')]}),_0x7fe2('0x27')):[];if(_0x291b8e['hasOwnProperty'](_0x7fe2('0x2b'))){if(_0x291b8e[_0x7fe2('0x2b')]&&_0x291b8e[_0x7fe2('0x2b')]!=='--'){_0x700b38['push']({'type':_0x291b8e[_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':_0x7fe2('0x2c')+_0x291b8e['tag'],'context':_0x291b8e[_0x7fe2('0x13')],'exten':_0x291b8e[_0x7fe2('0x8')],'priority':_0x28e984['length']+_0x380907[_0x7fe2('0xb')]+_0x11089a++,'VoiceExtensionId':_0x291b8e[_0x7fe2('0x15')]});}}if(_0x291b8e[_0x7fe2('0x10')]===_0x7fe2('0x16')&&_0x291b8e[_0x7fe2('0xa')](_0x7fe2('0x2d'))){if(_0x291b8e[_0x7fe2('0x2d')]){_0x700b38['push']({'type':_0x291b8e[_0x7fe2('0x10')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x291b8e['callerID']+')','context':_0x291b8e[_0x7fe2('0x13')],'exten':_0x291b8e[_0x7fe2('0x8')],'priority':_0x28e984[_0x7fe2('0x24')]+_0x380907[_0x7fe2('0xb')]+_0x11089a++,'VoiceExtensionId':_0x291b8e[_0x7fe2('0x15')]});}else{_0x700b38[_0x7fe2('0xf')]({'type':_0x291b8e['type'],'app':_0x7fe2('0x1b'),'appdata':_0x7fe2('0x2e'),'context':_0x291b8e[_0x7fe2('0x13')],'exten':_0x291b8e[_0x7fe2('0x8')],'priority':_0x28e984[_0x7fe2('0x24')]+_0x380907[_0x7fe2('0xb')]+_0x11089a++,'VoiceExtensionId':_0x291b8e['VoiceExtensionId']});}}if(_0x291b8e[_0x7fe2('0xa')](_0x7fe2('0x2f'))){if(_0x122400[_0x7fe2('0x30')](_0x291b8e[_0x7fe2('0x31')][_0x7fe2('0x32')]())>=0x0&&_0x291b8e[_0x7fe2('0x33')]!==_0x7fe2('0x34')){if(_0x291b8e[_0x7fe2('0x2f')]){_0x700b38[_0x7fe2('0xf')]({'type':_0x291b8e['type'],'app':_0x7fe2('0x1b'),'appdata':_0x7fe2('0x35'),'context':_0x291b8e[_0x7fe2('0x13')],'exten':_0x291b8e[_0x7fe2('0x8')],'priority':_0x28e984[_0x7fe2('0x24')]+_0x380907[_0x7fe2('0xb')]+_0x11089a++,'VoiceExtensionId':_0x291b8e[_0x7fe2('0x15')]});_0x700b38['push']({'type':_0x291b8e[_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x291b8e[_0x7fe2('0x13')],'exten':_0x291b8e[_0x7fe2('0x8')],'priority':_0x28e984[_0x7fe2('0x24')]+_0x380907['priority']+_0x11089a++,'VoiceExtensionId':_0x291b8e[_0x7fe2('0x15')]});}else{_0x700b38[_0x7fe2('0xf')]({'type':_0x291b8e[_0x7fe2('0x10')],'app':'ExecIf','appdata':_0x7fe2('0x36'),'context':_0x291b8e[_0x7fe2('0x13')],'exten':_0x291b8e[_0x7fe2('0x8')],'priority':_0x28e984['length']+_0x380907['priority']+_0x11089a++,'VoiceExtensionId':_0x291b8e['VoiceExtensionId']});_0x700b38[_0x7fe2('0xf')]({'type':_0x291b8e[_0x7fe2('0x10')],'app':_0x7fe2('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x291b8e[_0x7fe2('0x13')],'exten':_0x291b8e[_0x7fe2('0x8')],'priority':_0x28e984[_0x7fe2('0x24')]+_0x380907['priority']+_0x11089a++,'VoiceExtensionId':_0x291b8e[_0x7fe2('0x15')]});}}}for(var _0xfd4585=0x0;_0xfd4585<_0x28e984[_0x7fe2('0x24')];_0xfd4585+=0x1){var _0x253994=_0x380907[_0x7fe2('0xb')]+_0x28e984[_0x7fe2('0x24')];var _0x45a2fd=_0xfd4585===_0x28e984[_0x7fe2('0x24')]-0x1?_0x380907[_0x7fe2('0xb')]+_0x700b38['length']+_0x15e5b1[_0x7fe2('0x24')]+0x2:_0x380907[_0x7fe2('0xb')]+_0xfd4585+0x1;_0x700b38[_0x7fe2('0x37')](_0xfd4585,0x0,{'type':_0x291b8e[_0x7fe2('0x10')],'app':_0x7fe2('0x38'),'appdata':_0x28e984[_0xfd4585]+'?'+_0x291b8e[_0x7fe2('0x13')]+_0x7fe2('0x39')+_0x253994+':'+_0x291b8e[_0x7fe2('0x13')]+_0x7fe2('0x39')+_0x45a2fd,'exten':_0x291b8e[_0x7fe2('0x8')],'context':_0x291b8e[_0x7fe2('0x13')],'priority':_0x380907[_0x7fe2('0xb')]+_0xfd4585,'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});}_0x291b8e['priority']=_0x700b38[_0x7fe2('0x24')]?_[_0x7fe2('0x3a')](_0x700b38)[_0x7fe2('0xb')]+0x1:_0x380907[_0x7fe2('0xb')];_0x380907[_0x7fe2('0xb')]=(_0x15e5b1['length']?_[_0x7fe2('0x3a')](_0x15e5b1)[_0x7fe2('0xb')]:_0x291b8e[_0x7fe2('0xb')])+0x1;_0x380907[_0x7fe2('0xc')]=_[_0x7fe2('0x3b')](_0x380907[_0x7fe2('0xc')],_0x700b38,[_0x291b8e],_0x15e5b1);}_0x380907['extensions'][_0x7fe2('0xf')]({'type':_0x3b450a[_0x47967c][0x0]['type'],'app':_0x7fe2('0x3c'),'exten':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x8')],'context':_0x3b450a[_0x47967c][0x0]['context'],'priority':_0x380907[_0x7fe2('0xb')],'VoiceExtensionId':_0x3b450a[_0x47967c][0x0][_0x7fe2('0x15')]});_0xe34661[_0x7fe2('0xf')](_0x3b450a[_0x47967c][0x0]['VoiceExtensionId']);_0x32a8d4=_[_0x7fe2('0x3b')](_0x32a8d4,_0x380907[_0x7fe2('0xc')]);}}return _0x3aa50d[_0x7fe2('0x3d')](function(_0x43c197){return _0x3aa50d[_0x7fe2('0x0')][_0x7fe2('0x3e')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0xe34661}},'transaction':_0x43c197})[_0x7fe2('0x1')](function(_0x4f6039){return _0x3aa50d['models']['VoiceExtension'][_0x7fe2('0x3f')](_[_0x7fe2('0x40')](_0x32a8d4,_0x7fe2('0xb')),{'transaction':_0x43c197});});});})[_0x7fe2('0x41')](function(_0x13b06e){console['error'](_0x13b06e);});}exports[_0x7fe2('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c2d4737..3e49369 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 _0xd6af=['select','\x20=\x20?','insert','into','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','Campaign','dialCheckDuplicateType','Lists','always','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','field','toString','createdAt','NOW()','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0x292b9d,_0x123322){var _0x33621e=function(_0x49cd9e){while(--_0x49cd9e){_0x292b9d['push'](_0x292b9d['shift']());}};_0x33621e(++_0x123322);}(_0xd6af,0x17e));var _0xfd6a=function(_0x428f80,_0x307620){_0x428f80=_0x428f80-0x0;var _0x2f4273=_0xd6af[_0x428f80];return _0x2f4273;};'use strict';var BPromise=require(_0xfd6a('0x0'));var util=require(_0xfd6a('0x1'));var _=require(_0xfd6a('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xfd6a('0x3'));var Redis=require(_0xfd6a('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xfd6a('0x5'));var logger=require(_0xfd6a('0x6'))(_0xfd6a('0x7'));config[_0xfd6a('0x8')]=_[_0xfd6a('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfd6a('0xa'))(new Redis(config['redis']));require(_0xfd6a('0xb'))[_0xfd6a('0xc')](socket);try{if(!process[_0xfd6a('0xd')][0x2]||process[_0xfd6a('0xd')][0x2]==='undefined'||process['argv'][0x2]===_0xfd6a('0xe')){throw new Error(_0xfd6a('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0xfd6a('0xd')][0x3]||process[_0xfd6a('0xd')][0x3]===_0xfd6a('0x10')||process[_0xfd6a('0xd')][0x3]===_0xfd6a('0xe')||!process[_0xfd6a('0xd')][0x4]||process[_0xfd6a('0xd')][0x4]===_0xfd6a('0x10')||process[_0xfd6a('0xd')][0x4]===_0xfd6a('0xe')){throw new Error(_0xfd6a('0x11'));}var FIELDS=_[_0xfd6a('0x12')](process[_0xfd6a('0xd')][0x3][_0xfd6a('0x13')](','),process[_0xfd6a('0xd')][0x4][_0xfd6a('0x13')](','));if(!process[_0xfd6a('0xd')][0x5]||process[_0xfd6a('0xd')][0x5]===_0xfd6a('0x10')||process[_0xfd6a('0xd')][0x5]===_0xfd6a('0xe')){throw new Error(_0xfd6a('0x14'));}var LISTID=process[_0xfd6a('0xd')][0x5];var COMPANYID=process[_0xfd6a('0xd')][0x6]&&process[_0xfd6a('0xd')][0x6]!=='undefined'&&process[_0xfd6a('0xd')][0x6]!==_0xfd6a('0xe')?process[_0xfd6a('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xfd6a('0xd')][0x7]!==_0xfd6a('0x10')&&process['argv'][0x7]!==_0xfd6a('0xe')?process[_0xfd6a('0xd')][0x7]:null;if(!process[_0xfd6a('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0xfd6a('0xd')][0x8]===_0xfd6a('0xe')){throw new Error(_0xfd6a('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x52a020){logger[_0xfd6a('0x16')](_0x52a020);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(_0x5020b6,_0x56a59a,_0x4e2dcd,_0x4b9055){var _0x2cd8d0={'message':_0x56a59a};_0x2cd8d0[_0x5020b6]=!![];if(_0x4e2dcd){_0x2cd8d0[_0xfd6a('0x17')]=_0x4e2dcd;}if(_0x4b9055){_0x2cd8d0[_0xfd6a('0x18')]=_0x4b9055;}return _0x2cd8d0;}function isEmail(_0x551a8f){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))*$/[_0xfd6a('0x19')](_0x551a8f);}function checkRow(_0x1d2539,_0x37f612,_0x107b40){return new BPromise(function(_0x293325,_0x558a39){if(_[_0xfd6a('0x1a')](_0x1d2539)){return _0x558a39(handleCheckRowError(_0xfd6a('0x16'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x107b40));}if(_0x1d2539[_0xfd6a('0x1b')]&&_0x1d2539[_0xfd6a('0x1b')][_0xfd6a('0x1c')]){var _0x926e8f=_['map'](_0x1d2539['errors'],'message')[_0xfd6a('0x1d')](';');return _0x558a39(handleCheckRowError('error',_0x926e8f,null,_0x107b40));}var _0x4878ec={};for(var _0xa2cf35 in FIELDS){if(FIELDS[_0xfd6a('0x1e')](_0xa2cf35)&&FIELDS[_0xa2cf35]){_0x4878ec[_0xa2cf35]=_0x1d2539[_0xfd6a('0x1f')][0x0][FIELDS[_0xa2cf35]]||_0x1d2539[_0xfd6a('0x1f')][0x0]['\ufeff'+FIELDS[_0xa2cf35]];}}if(!_0x4878ec[_0xfd6a('0x20')]){return _0x558a39(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x107b40));}if(!_0x4878ec[_0xfd6a('0x21')]){return _0x558a39(handleCheckRowError(_0xfd6a('0x16'),_0xfd6a('0x22'),null,_0x107b40));}if(_0x4878ec[_0xfd6a('0x23')]){var _0x5bf8aa=moment(_0x4878ec[_0xfd6a('0x23')],_0xfd6a('0x24'));if(!_0x5bf8aa['isValid']()){return _0x558a39(handleCheckRowError(_0xfd6a('0x16'),_0xfd6a('0x25'),null,_0x107b40));}}if(_0x4878ec['email']){if(!isEmail(_0x4878ec[_0xfd6a('0x26')])){return _0x558a39(handleCheckRowError(_0xfd6a('0x16'),_0xfd6a('0x27'),null,_0x107b40));}}_0x4878ec[_0xfd6a('0x28')]=LISTID;_0x4878ec[_0xfd6a('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfd6a('0x1c')]&&_0x37f612){var _0x38806b={};for(var _0x34faf7=0x0,_0x4b2a0c=DUPLICATES['length'];_0x34faf7<_0x4b2a0c;_0x34faf7+=0x1){_0x38806b[DUPLICATES[_0x34faf7]]=_0x4878ec[DUPLICATES[_0x34faf7]];}var _0xdad147=_['find'](_0x37f612,_0x38806b);if(_0xdad147){return _0x558a39(handleCheckRowError('duplicate',_0xfd6a('0x2a'),_0xdad147,_0x107b40));}}return db[_0xfd6a('0x2b')][_0xfd6a('0x2c')](_0x4878ec,{'raw':!![],'hooks':![],'fields':_[_0xfd6a('0x2d')](_0x4878ec)})[_0xfd6a('0x2e')](function(_0x5c04ef){if(DUPLICATES&&DUPLICATES[_0xfd6a('0x1c')]&&_0x37f612){_0x37f612['push'](_[_0xfd6a('0x2f')](_0x4878ec,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5c04ef['id'];return _0x293325();})[_0xfd6a('0x30')](function(_0x45507d){return _0x558a39(handleCheckRowError(_0xfd6a('0x16'),_0xfd6a('0x31')+(_0x45507d[_0xfd6a('0x32')]||JSON[_0xfd6a('0x33')](_0x45507d)),null,_0x107b40));});});}function checkHopper(){function _0x40f475(){return function(_0x5cbe12){logger[_0xfd6a('0x16')](_0xfd6a('0x34'),_0xfd6a('0x35'),util[_0xfd6a('0x36')](_0x5cbe12,{'showHidden':![],'depth':null}));};}var _0x5d0438=function(_0x36fce7,_0x3f6437){var _0x33f8f1=squel['insert']()['into'](_0xfd6a('0x37'))[_0xfd6a('0x38')]([_0xfd6a('0x21'),_0xfd6a('0x39'),_0xfd6a('0x3a'),_0xfd6a('0x28'),_0x3f6437,'createdAt',_0xfd6a('0x3b')],squel['select']()[_0xfd6a('0x3c')](_0xfd6a('0x21'),_0xfd6a('0x21'))[_0xfd6a('0x3c')]('NOW()',_0xfd6a('0x39'))[_0xfd6a('0x3c')]('id',_0xfd6a('0x3a'))[_0xfd6a('0x3c')](LISTID['toString'](),_0xfd6a('0x28'))['field'](_0x36fce7['id'][_0xfd6a('0x3d')](),_0x3f6437)[_0xfd6a('0x3c')]('NOW()',_0xfd6a('0x3e'))[_0xfd6a('0x3c')](_0xfd6a('0x3f'),_0xfd6a('0x3b'))[_0xfd6a('0x40')]('cm_contacts')[_0xfd6a('0x41')](_0xfd6a('0x42'))[_0xfd6a('0x41')](_0xfd6a('0x43'),LISTID['toString']())['where'](_0xfd6a('0x44'))[_0xfd6a('0x41')](_0xfd6a('0x45'),squel[_0xfd6a('0x46')]()[_0xfd6a('0x3c')](_0xfd6a('0x21'))[_0xfd6a('0x40')](_0xfd6a('0x37'))[_0xfd6a('0x41')](_0x3f6437+_0xfd6a('0x47'),_0x36fce7['id'][_0xfd6a('0x3d')]())))['toString']();return _0x33f8f1;};var _0x23261f=function(_0x28bae2,_0x407ac8){var _0x38d98d=squel[_0xfd6a('0x48')]()[_0xfd6a('0x49')]('cm_hopper')[_0xfd6a('0x38')](['phone',_0xfd6a('0x39'),_0xfd6a('0x3a'),_0xfd6a('0x28'),_0x407ac8,_0xfd6a('0x3e'),_0xfd6a('0x3b')],squel[_0xfd6a('0x46')]()[_0xfd6a('0x3c')](_0xfd6a('0x21'),'phone')[_0xfd6a('0x3c')]('NOW()',_0xfd6a('0x39'))[_0xfd6a('0x3c')]('id','ContactId')[_0xfd6a('0x3c')](LISTID[_0xfd6a('0x3d')](),'ListId')[_0xfd6a('0x3c')](_0x28bae2['id'][_0xfd6a('0x3d')](),_0x407ac8)[_0xfd6a('0x3c')]('NOW()',_0xfd6a('0x3e'))[_0xfd6a('0x3c')](_0xfd6a('0x3f'),_0xfd6a('0x3b'))['from'](_0xfd6a('0x4a'))[_0xfd6a('0x41')](_0xfd6a('0x42'))[_0xfd6a('0x41')]('ListId\x20=\x20?',LISTID[_0xfd6a('0x3d')]())[_0xfd6a('0x41')](_0xfd6a('0x4b'),squel[_0xfd6a('0x4c')](hopperContacts))['where'](_0xfd6a('0x44'))[_0xfd6a('0x41')](_0xfd6a('0x45'),squel[_0xfd6a('0x46')]()[_0xfd6a('0x3c')](_0xfd6a('0x4d'))[_0xfd6a('0x40')]('cm_hopper_final')[_0xfd6a('0x41')](_0x407ac8+_0xfd6a('0x47'),_0x28bae2['id'][_0xfd6a('0x3d')]()))[_0xfd6a('0x41')](_0xfd6a('0x45'),squel[_0xfd6a('0x46')]()['field'](_0xfd6a('0x21'))[_0xfd6a('0x40')](_0xfd6a('0x37'))[_0xfd6a('0x41')](_0x407ac8+_0xfd6a('0x47'),_0x28bae2['id']['toString']())))['toString']();return _0x38d98d;};function _0x51ab54(_0x5c2f7c,_0x1955a4){var _0x44a9c5=squel['insert']()[_0xfd6a('0x49')]('cm_hopper')[_0xfd6a('0x38')]([_0xfd6a('0x21'),_0xfd6a('0x39'),'ContactId','ListId',_0x1955a4,_0xfd6a('0x3e'),_0xfd6a('0x3b')],squel[_0xfd6a('0x46')]()[_0xfd6a('0x3c')]('phone',_0xfd6a('0x21'))[_0xfd6a('0x3c')](_0xfd6a('0x3f'),_0xfd6a('0x39'))['field']('id',_0xfd6a('0x3a'))[_0xfd6a('0x3c')](LISTID[_0xfd6a('0x3d')](),'ListId')[_0xfd6a('0x3c')](_0x5c2f7c['id']['toString'](),_0x1955a4)[_0xfd6a('0x3c')]('NOW()',_0xfd6a('0x3e'))[_0xfd6a('0x3c')](_0xfd6a('0x3f'),_0xfd6a('0x3b'))[_0xfd6a('0x40')](_0xfd6a('0x4a'))[_0xfd6a('0x41')](_0xfd6a('0x42'))[_0xfd6a('0x41')](_0xfd6a('0x43'),LISTID[_0xfd6a('0x3d')]())[_0xfd6a('0x41')](_0xfd6a('0x4b'),squel[_0xfd6a('0x4c')](hopperContacts))[_0xfd6a('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xfd6a('0x3d')]();return _0x44a9c5;}function _0x264dfe(_0x49bc2e,_0xe1afc3){var _0x3333fd=squel[_0xfd6a('0x48')]()[_0xfd6a('0x49')](_0xfd6a('0x4e'))[_0xfd6a('0x38')]([_0xfd6a('0x21'),_0xfd6a('0x3a'),_0xfd6a('0x28'),_0xe1afc3,_0xfd6a('0x3e'),_0xfd6a('0x3b')],squel['select']()['field']('phone',_0xfd6a('0x21'))[_0xfd6a('0x3c')]('id','ContactId')[_0xfd6a('0x3c')](LISTID[_0xfd6a('0x3d')](),_0xfd6a('0x28'))['field'](_0x49bc2e['id'][_0xfd6a('0x3d')](),_0xe1afc3)[_0xfd6a('0x3c')](_0xfd6a('0x3f'),_0xfd6a('0x3e'))['field'](_0xfd6a('0x3f'),_0xfd6a('0x3b'))['from'](_0xfd6a('0x4a'))[_0xfd6a('0x41')](_0xfd6a('0x42'))[_0xfd6a('0x41')](_0xfd6a('0x43'),LISTID[_0xfd6a('0x3d')]())[_0xfd6a('0x41')](_0xfd6a('0x4b'),squel[_0xfd6a('0x4c')](hopperContacts))[_0xfd6a('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xfd6a('0x3d')]();return _0x3333fd;}return db[_0xfd6a('0x4f')][_0xfd6a('0x50')]({'where':{'type':_0xfd6a('0x51')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xfd6a('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0xfd6a('0x2e')](function(_0x578a21){var _0x2d136a=[];if(_0x578a21){var _0x5dd69e;for(var _0xbeaa0=0x0,_0x9d0ebc;_0xbeaa0<_0x578a21[_0xfd6a('0x1c')];_0xbeaa0+=0x1){_0x9d0ebc=_0x578a21[_0xbeaa0][_0xfd6a('0x53')]({'plain':!![]});switch(_0x9d0ebc['dialCheckDuplicateType']){case'always':_0x2d136a[_0xfd6a('0x54')](db[_0xfd6a('0x55')][_0xfd6a('0x56')](_0x23261f(_0x9d0ebc,_0xfd6a('0x57')))[_0xfd6a('0x2e')](function(){})['catch'](_0x40f475()));break;case _0xfd6a('0x58'):_0x2d136a[_0xfd6a('0x54')](db[_0xfd6a('0x55')][_0xfd6a('0x56')](_0x5d0438(_0x9d0ebc,_0xfd6a('0x57')))[_0xfd6a('0x2e')](function(){})['catch'](_0x40f475()));break;default:_0x2d136a[_0xfd6a('0x54')](db['sequelize'][_0xfd6a('0x56')](_0x51ab54(_0x9d0ebc,'VoiceQueueId'))[_0xfd6a('0x2e')](function(){})[_0xfd6a('0x30')](_0x40f475()));}}}return _0x2d136a;})['all']()[_0xfd6a('0x2e')](function(){return db[_0xfd6a('0x4f')][_0xfd6a('0x50')]({'where':{'type':_0xfd6a('0x51')},'attributes':['id'],'include':[{'model':db[_0xfd6a('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xfd6a('0x2e')](function(_0x161ba8){var _0x4dc041=[];if(_0x161ba8){var _0x47711c;for(var _0x2e1e38=0x0,_0x2116d1;_0x2e1e38<_0x161ba8[_0xfd6a('0x1c')];_0x2e1e38+=0x1){_0x2116d1=_0x161ba8[_0x2e1e38]['get']({'plain':!![]});_0x4dc041[_0xfd6a('0x54')](db['sequelize'][_0xfd6a('0x56')](_0x264dfe(_0x2116d1,_0xfd6a('0x57')))[_0xfd6a('0x2e')](function(){})[_0xfd6a('0x30')](_0x40f475()));}}return _0x4dc041;})[_0xfd6a('0x59')]();})[_0xfd6a('0x2e')](function(){return db[_0xfd6a('0x5a')]['findAll']({'attributes':['id',_0xfd6a('0x5b')],'include':[{'model':db[_0xfd6a('0x52')],'as':_0xfd6a('0x5c'),'where':{'id':LISTID}}]})[_0xfd6a('0x2e')](function(_0x461e4d){var _0x37e9a5=[];if(_0x461e4d){for(var _0x56db6b=0x0,_0x1f8dd7;_0x56db6b<_0x461e4d['length'];_0x56db6b+=0x1){_0x1f8dd7=_0x461e4d[_0x56db6b][_0xfd6a('0x53')]({'plain':!![]});switch(_0x1f8dd7[_0xfd6a('0x5b')]){case _0xfd6a('0x5d'):_0x37e9a5[_0xfd6a('0x54')](db[_0xfd6a('0x55')][_0xfd6a('0x56')](_0x23261f(_0x1f8dd7,_0xfd6a('0x5e')))[_0xfd6a('0x2e')](function(){})[_0xfd6a('0x30')](_0x40f475()));break;case _0xfd6a('0x58'):_0x37e9a5[_0xfd6a('0x54')](db['sequelize'][_0xfd6a('0x56')](_0x5d0438(_0x1f8dd7,'CampaignId'))['then'](function(){})[_0xfd6a('0x30')](_0x40f475()));break;default:_0x37e9a5[_0xfd6a('0x54')](db['sequelize'][_0xfd6a('0x56')](_0x51ab54(_0x1f8dd7,'CampaignId'))[_0xfd6a('0x2e')](function(){})[_0xfd6a('0x30')](_0x40f475()));}}}return _0x37e9a5;})[_0xfd6a('0x59')]();})[_0xfd6a('0x2e')](function(){return db[_0xfd6a('0x5a')][_0xfd6a('0x50')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xfd6a('0x5f'),'where':{'id':LISTID}}]})[_0xfd6a('0x2e')](function(_0x9413f5){var _0x4f565b=[];if(_0x9413f5){for(var _0x21e0f5=0x0,_0x114e7d;_0x21e0f5<_0x9413f5['length'];_0x21e0f5+=0x1){_0x114e7d=_0x9413f5[_0x21e0f5][_0xfd6a('0x53')]({'plain':!![]});_0x4f565b[_0xfd6a('0x54')](db[_0xfd6a('0x55')][_0xfd6a('0x56')](_0x264dfe(_0x114e7d,_0xfd6a('0x5e')))[_0xfd6a('0x2e')](function(){})[_0xfd6a('0x30')](_0x40f475()));}}return _0x4f565b;})[_0xfd6a('0x59')]();})[_0xfd6a('0x30')](function(_0x36ef9b){logger[_0xfd6a('0x16')](_0xfd6a('0x60'),'generalCheckHopper',_0x36ef9b['message']);});}var processPromises=function(_0x238a4d){return BPromise['all'](promises)[_0xfd6a('0x2e')](function(_0x511db3){})[_0xfd6a('0x30')](function(_0x550d83){logger[_0xfd6a('0x16')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x550d83));})[_0xfd6a('0x61')](function(){socket[_0xfd6a('0x62')](_0xfd6a('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x238a4d){return _0x238a4d[_0xfd6a('0x64')]();}});};var endCsv=function(){return BPromise[_0xfd6a('0x65')]()[_0xfd6a('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xfd6a('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xfd6a('0x66')](FILEPATH);}catch(_0x244bd2){logger[_0xfd6a('0x16')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xfd6a('0x33')](_0x244bd2));}finally{process[_0xfd6a('0x67')](0x0);}});};process['on'](_0xfd6a('0x68'),function(){logger[_0xfd6a('0x69')](_0xfd6a('0x6a'));endCsv();});function main(){return BPromise[_0xfd6a('0x65')]()[_0xfd6a('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xfd6a('0x13')](',');return db[_0xfd6a('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xfd6a('0x2e')](function(_0x48e662){var _0x108131=fs[_0xfd6a('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfd6a('0x6c')](_0x108131,{'header':!![],'skipEmptyLines':!![],'step':function(_0x534b60,_0xeb9f46){total+=0x1;var _0x4aa1a9=total;promises[_0xfd6a('0x54')](checkRow(_0x534b60,_0x48e662,_0x4aa1a9)[_0xfd6a('0x2e')](function(){success+=0x1;})[_0xfd6a('0x30')](function(_0x173fc9){if(_0x173fc9['error']){errors+=0x1;delete _0x173fc9[_0xfd6a('0x16')];}else if(_0x173fc9[_0xfd6a('0x6d')]){duplicates+=0x1;delete _0x173fc9[_0xfd6a('0x6d')];}rows[_0xfd6a('0x54')](_0x173fc9);}));if(total%0xc8===0x0){_0xeb9f46['pause']();return processPromises(_0xeb9f46);}},'complete':function(){return processPromises()['then'](function(){logger[_0xfd6a('0x69')](_0xfd6a('0x6e'));endCsv();});},'error':function(_0x51fed3,_0x48e63c){logger[_0xfd6a('0x69')](_0xfd6a('0x6f'),JSON[_0xfd6a('0x33')](_0x51fed3));endCsv();}});})['catch'](function(_0x112523){logger['error'](_0xfd6a('0x70'),JSON[_0xfd6a('0x33')](_0x112523));});}main(); \ No newline at end of file +var _0x3e74=['field','NOW()','toString','createdAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','from','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','duplicate','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName\x20not\x20specified!','phone','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select'];(function(_0x3731a1,_0x392827){var _0x58e70f=function(_0x42969b){while(--_0x42969b){_0x3731a1['push'](_0x3731a1['shift']());}};_0x58e70f(++_0x392827);}(_0x3e74,0x1ec));var _0x43e7=function(_0x31c29d,_0x253d34){_0x31c29d=_0x31c29d-0x0;var _0x2ed140=_0x3e74[_0x31c29d];return _0x2ed140;};'use strict';var BPromise=require(_0x43e7('0x0'));var util=require(_0x43e7('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x43e7('0x2'));var Papa=require(_0x43e7('0x3'));var Redis=require(_0x43e7('0x4'));var db=require(_0x43e7('0x5'))['db'];var config=require(_0x43e7('0x6'));var logger=require(_0x43e7('0x7'))('api');config[_0x43e7('0x8')]=_[_0x43e7('0x9')](config[_0x43e7('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43e7('0x8')]));require(_0x43e7('0xa'))[_0x43e7('0xb')](socket);try{if(!process[_0x43e7('0xc')][0x2]||process['argv'][0x2]===_0x43e7('0xd')||process['argv'][0x2]==='null'){throw new Error(_0x43e7('0xe'));}var FILEPATH=process['argv'][0x2];if(!process[_0x43e7('0xc')][0x3]||process[_0x43e7('0xc')][0x3]===_0x43e7('0xd')||process[_0x43e7('0xc')][0x3]===_0x43e7('0xf')||!process['argv'][0x4]||process[_0x43e7('0xc')][0x4]===_0x43e7('0xd')||process[_0x43e7('0xc')][0x4]==='null'){throw new Error(_0x43e7('0x10'));}var FIELDS=_['zipObject'](process[_0x43e7('0xc')][0x3][_0x43e7('0x11')](','),process['argv'][0x4][_0x43e7('0x11')](','));if(!process['argv'][0x5]||process[_0x43e7('0xc')][0x5]===_0x43e7('0xd')||process[_0x43e7('0xc')][0x5]===_0x43e7('0xf')){throw new Error(_0x43e7('0x12'));}var LISTID=process[_0x43e7('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x43e7('0xc')][0x6]!=='undefined'&&process[_0x43e7('0xc')][0x6]!==_0x43e7('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0x43e7('0xc')][0x7]&&process[_0x43e7('0xc')][0x7]!=='undefined'&&process[_0x43e7('0xc')][0x7]!==_0x43e7('0xf')?process[_0x43e7('0xc')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x43e7('0xd')||process[_0x43e7('0xc')][0x8]===_0x43e7('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x43e7('0xc')][0x8];}catch(_0x2486ec){logger[_0x43e7('0x13')](_0x2486ec);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(_0x4a3ce3,_0x586784,_0x411cd1,_0x3845fe){var _0x23ee7b={'message':_0x586784};_0x23ee7b[_0x4a3ce3]=!![];if(_0x411cd1){_0x23ee7b['contact']=_0x411cd1;}if(_0x3845fe){_0x23ee7b[_0x43e7('0x14')]=_0x3845fe;}return _0x23ee7b;}function isEmail(_0x56efeb){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))*$/[_0x43e7('0x15')](_0x56efeb);}function checkRow(_0x4ceb0d,_0x32017e,_0x561c00){return new BPromise(function(_0x515254,_0x4058a0){if(_[_0x43e7('0x16')](_0x4ceb0d)){return _0x4058a0(handleCheckRowError(_0x43e7('0x13'),_0x43e7('0x17'),null,_0x561c00));}if(_0x4ceb0d[_0x43e7('0x18')]&&_0x4ceb0d[_0x43e7('0x18')][_0x43e7('0x19')]){var _0x919377=_[_0x43e7('0x1a')](_0x4ceb0d[_0x43e7('0x18')],_0x43e7('0x1b'))[_0x43e7('0x1c')](';');return _0x4058a0(handleCheckRowError(_0x43e7('0x13'),_0x919377,null,_0x561c00));}var _0x41472a={};for(var _0x434ad2 in FIELDS){if(FIELDS['hasOwnProperty'](_0x434ad2)&&FIELDS[_0x434ad2]){_0x41472a[_0x434ad2]=_0x4ceb0d['data'][0x0][FIELDS[_0x434ad2]]||_0x4ceb0d[_0x43e7('0x1d')][0x0]['\ufeff'+FIELDS[_0x434ad2]];}}if(!_0x41472a['firstName']){return _0x4058a0(handleCheckRowError(_0x43e7('0x13'),_0x43e7('0x1e'),null,_0x561c00));}if(!_0x41472a[_0x43e7('0x1f')]){return _0x4058a0(handleCheckRowError(_0x43e7('0x13'),'phone\x20not\x20specified!',null,_0x561c00));}if(_0x41472a[_0x43e7('0x20')]){var _0xf63802=moment(_0x41472a[_0x43e7('0x20')],'YYYY-MM-DD');if(!_0xf63802[_0x43e7('0x21')]()){return _0x4058a0(handleCheckRowError(_0x43e7('0x13'),_0x43e7('0x22'),null,_0x561c00));}}if(_0x41472a[_0x43e7('0x23')]){if(!isEmail(_0x41472a[_0x43e7('0x23')])){return _0x4058a0(handleCheckRowError('error',_0x43e7('0x24'),null,_0x561c00));}}_0x41472a[_0x43e7('0x25')]=LISTID;_0x41472a[_0x43e7('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x43e7('0x19')]&&_0x32017e){var _0x5c2e97={};for(var _0x155f47=0x0,_0x5312f4=DUPLICATES[_0x43e7('0x19')];_0x155f47<_0x5312f4;_0x155f47+=0x1){_0x5c2e97[DUPLICATES[_0x155f47]]=_0x41472a[DUPLICATES[_0x155f47]];}var _0x4f69a5=_[_0x43e7('0x27')](_0x32017e,_0x5c2e97);if(_0x4f69a5){return _0x4058a0(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x4f69a5,_0x561c00));}}return db['CmContact'][_0x43e7('0x28')](_0x41472a,{'raw':!![],'hooks':![],'fields':_[_0x43e7('0x29')](_0x41472a)})[_0x43e7('0x2a')](function(_0x15c1dc){if(DUPLICATES&&DUPLICATES[_0x43e7('0x19')]&&_0x32017e){_0x32017e[_0x43e7('0x2b')](_[_0x43e7('0x2c')](_0x41472a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x15c1dc['id'];return _0x515254();})[_0x43e7('0x2d')](function(_0x4ca285){return _0x4058a0(handleCheckRowError(_0x43e7('0x13'),_0x43e7('0x2e')+(_0x4ca285[_0x43e7('0x1b')]||JSON[_0x43e7('0x2f')](_0x4ca285)),null,_0x561c00));});});}function checkHopper(){function _0x1e979f(){return function(_0x538055){logger[_0x43e7('0x13')](_0x43e7('0x30'),'checkHopper',util[_0x43e7('0x31')](_0x538055,{'showHidden':![],'depth':null}));};}var _0x84a9db=function(_0x3b6756,_0xb480f6){var _0x4f1d7c=squel[_0x43e7('0x32')]()[_0x43e7('0x33')](_0x43e7('0x34'))[_0x43e7('0x35')]([_0x43e7('0x1f'),_0x43e7('0x36'),_0x43e7('0x37'),_0x43e7('0x25'),_0xb480f6,'createdAt',_0x43e7('0x38')],squel[_0x43e7('0x39')]()[_0x43e7('0x3a')]('phone',_0x43e7('0x1f'))[_0x43e7('0x3a')](_0x43e7('0x3b'),_0x43e7('0x36'))['field']('id',_0x43e7('0x37'))['field'](LISTID[_0x43e7('0x3c')](),_0x43e7('0x25'))[_0x43e7('0x3a')](_0x3b6756['id']['toString'](),_0xb480f6)[_0x43e7('0x3a')](_0x43e7('0x3b'),_0x43e7('0x3d'))[_0x43e7('0x3a')](_0x43e7('0x3b'),_0x43e7('0x38'))['from'](_0x43e7('0x3e'))[_0x43e7('0x3f')](_0x43e7('0x40'))[_0x43e7('0x3f')](_0x43e7('0x41'),LISTID['toString']())[_0x43e7('0x3f')](_0x43e7('0x42'))['where'](_0x43e7('0x43'),squel['select']()[_0x43e7('0x3a')](_0x43e7('0x1f'))['from'](_0x43e7('0x34'))['where'](_0xb480f6+_0x43e7('0x44'),_0x3b6756['id'][_0x43e7('0x3c')]())))[_0x43e7('0x3c')]();return _0x4f1d7c;};var _0x2b6ae1=function(_0x19f269,_0x339850){var _0x99619e=squel[_0x43e7('0x32')]()[_0x43e7('0x33')](_0x43e7('0x34'))[_0x43e7('0x35')]([_0x43e7('0x1f'),'scheduledAt','ContactId',_0x43e7('0x25'),_0x339850,_0x43e7('0x3d'),'updatedAt'],squel[_0x43e7('0x39')]()[_0x43e7('0x3a')](_0x43e7('0x1f'),'phone')[_0x43e7('0x3a')](_0x43e7('0x3b'),'scheduledAt')[_0x43e7('0x3a')]('id',_0x43e7('0x37'))[_0x43e7('0x3a')](LISTID[_0x43e7('0x3c')](),_0x43e7('0x25'))[_0x43e7('0x3a')](_0x19f269['id']['toString'](),_0x339850)['field'](_0x43e7('0x3b'),_0x43e7('0x3d'))['field'](_0x43e7('0x3b'),'updatedAt')[_0x43e7('0x45')](_0x43e7('0x3e'))['where'](_0x43e7('0x40'))['where'](_0x43e7('0x41'),LISTID[_0x43e7('0x3c')]())[_0x43e7('0x3f')](_0x43e7('0x46'),squel[_0x43e7('0x47')](hopperContacts))[_0x43e7('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x43e7('0x43'),squel[_0x43e7('0x39')]()[_0x43e7('0x3a')](_0x43e7('0x48'))[_0x43e7('0x45')](_0x43e7('0x49'))[_0x43e7('0x3f')](_0x339850+'\x20=\x20?',_0x19f269['id']['toString']()))['where'](_0x43e7('0x43'),squel[_0x43e7('0x39')]()[_0x43e7('0x3a')](_0x43e7('0x1f'))[_0x43e7('0x45')](_0x43e7('0x34'))[_0x43e7('0x3f')](_0x339850+_0x43e7('0x44'),_0x19f269['id'][_0x43e7('0x3c')]())))['toString']();return _0x99619e;};function _0x2345fe(_0x5a4f14,_0x3478f7){var _0x23f64f=squel['insert']()[_0x43e7('0x33')]('cm_hopper')['fromQuery']([_0x43e7('0x1f'),_0x43e7('0x36'),_0x43e7('0x37'),'ListId',_0x3478f7,_0x43e7('0x3d'),_0x43e7('0x38')],squel[_0x43e7('0x39')]()[_0x43e7('0x3a')](_0x43e7('0x1f'),_0x43e7('0x1f'))[_0x43e7('0x3a')](_0x43e7('0x3b'),_0x43e7('0x36'))[_0x43e7('0x3a')]('id',_0x43e7('0x37'))[_0x43e7('0x3a')](LISTID[_0x43e7('0x3c')](),'ListId')['field'](_0x5a4f14['id'][_0x43e7('0x3c')](),_0x3478f7)[_0x43e7('0x3a')](_0x43e7('0x3b'),_0x43e7('0x3d'))[_0x43e7('0x3a')](_0x43e7('0x3b'),_0x43e7('0x38'))[_0x43e7('0x45')](_0x43e7('0x3e'))['where'](_0x43e7('0x40'))[_0x43e7('0x3f')](_0x43e7('0x41'),LISTID[_0x43e7('0x3c')]())[_0x43e7('0x3f')](_0x43e7('0x46'),squel[_0x43e7('0x47')](hopperContacts))[_0x43e7('0x3f')](_0x43e7('0x42')))['toString']();return _0x23f64f;}function _0x5a0bb6(_0x13a55b,_0x304f15){var _0x468680=squel[_0x43e7('0x32')]()[_0x43e7('0x33')](_0x43e7('0x4a'))[_0x43e7('0x35')](['phone','ContactId',_0x43e7('0x25'),_0x304f15,_0x43e7('0x3d'),_0x43e7('0x38')],squel[_0x43e7('0x39')]()[_0x43e7('0x3a')]('phone',_0x43e7('0x1f'))['field']('id',_0x43e7('0x37'))[_0x43e7('0x3a')](LISTID[_0x43e7('0x3c')](),_0x43e7('0x25'))['field'](_0x13a55b['id'][_0x43e7('0x3c')](),_0x304f15)['field'](_0x43e7('0x3b'),_0x43e7('0x3d'))[_0x43e7('0x3a')]('NOW()',_0x43e7('0x38'))[_0x43e7('0x45')](_0x43e7('0x3e'))[_0x43e7('0x3f')](_0x43e7('0x40'))[_0x43e7('0x3f')]('ListId\x20=\x20?',LISTID[_0x43e7('0x3c')]())[_0x43e7('0x3f')]('id\x20IN\x20?',squel[_0x43e7('0x47')](hopperContacts))['where'](_0x43e7('0x42')))[_0x43e7('0x3c')]();return _0x468680;}return db['VoiceQueue'][_0x43e7('0x4b')]({'where':{'type':_0x43e7('0x4c')},'attributes':['id',_0x43e7('0x4d')],'include':[{'model':db[_0x43e7('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x43e7('0x2a')](function(_0x5936b1){var _0x4afed4=[];if(_0x5936b1){var _0x4427d9;for(var _0x23d2be=0x0,_0x15cbb6;_0x23d2be<_0x5936b1['length'];_0x23d2be+=0x1){_0x15cbb6=_0x5936b1[_0x23d2be][_0x43e7('0x4f')]({'plain':!![]});switch(_0x15cbb6['dialCheckDuplicateType']){case _0x43e7('0x50'):_0x4afed4[_0x43e7('0x2b')](db['sequelize'][_0x43e7('0x51')](_0x2b6ae1(_0x15cbb6,_0x43e7('0x52')))[_0x43e7('0x2a')](function(){})[_0x43e7('0x2d')](_0x1e979f()));break;case _0x43e7('0x53'):_0x4afed4[_0x43e7('0x2b')](db[_0x43e7('0x54')][_0x43e7('0x51')](_0x84a9db(_0x15cbb6,_0x43e7('0x52')))[_0x43e7('0x2a')](function(){})[_0x43e7('0x2d')](_0x1e979f()));break;default:_0x4afed4[_0x43e7('0x2b')](db[_0x43e7('0x54')][_0x43e7('0x51')](_0x2345fe(_0x15cbb6,_0x43e7('0x52')))[_0x43e7('0x2a')](function(){})[_0x43e7('0x2d')](_0x1e979f()));}}}return _0x4afed4;})[_0x43e7('0x55')]()[_0x43e7('0x2a')](function(){return db['VoiceQueue'][_0x43e7('0x4b')]({'where':{'type':_0x43e7('0x4c')},'attributes':['id'],'include':[{'model':db[_0x43e7('0x4e')],'as':_0x43e7('0x56'),'where':{'id':LISTID}}]})[_0x43e7('0x2a')](function(_0x22f92d){var _0x554eff=[];if(_0x22f92d){var _0x532905;for(var _0x3a1928=0x0,_0x35b2fd;_0x3a1928<_0x22f92d[_0x43e7('0x19')];_0x3a1928+=0x1){_0x35b2fd=_0x22f92d[_0x3a1928][_0x43e7('0x4f')]({'plain':!![]});_0x554eff[_0x43e7('0x2b')](db['sequelize'][_0x43e7('0x51')](_0x5a0bb6(_0x35b2fd,'VoiceQueueId'))['then'](function(){})[_0x43e7('0x2d')](_0x1e979f()));}}return _0x554eff;})['all']();})[_0x43e7('0x2a')](function(){return db[_0x43e7('0x57')]['findAll']({'attributes':['id',_0x43e7('0x4d')],'include':[{'model':db[_0x43e7('0x4e')],'as':_0x43e7('0x58'),'where':{'id':LISTID}}]})[_0x43e7('0x2a')](function(_0x21ae18){var _0x21e69c=[];if(_0x21ae18){for(var _0x40c01c=0x0,_0x32a901;_0x40c01c<_0x21ae18[_0x43e7('0x19')];_0x40c01c+=0x1){_0x32a901=_0x21ae18[_0x40c01c][_0x43e7('0x4f')]({'plain':!![]});switch(_0x32a901['dialCheckDuplicateType']){case _0x43e7('0x50'):_0x21e69c['push'](db['sequelize'][_0x43e7('0x51')](_0x2b6ae1(_0x32a901,_0x43e7('0x59')))['then'](function(){})[_0x43e7('0x2d')](_0x1e979f()));break;case _0x43e7('0x53'):_0x21e69c[_0x43e7('0x2b')](db[_0x43e7('0x54')][_0x43e7('0x51')](_0x84a9db(_0x32a901,_0x43e7('0x59')))[_0x43e7('0x2a')](function(){})[_0x43e7('0x2d')](_0x1e979f()));break;default:_0x21e69c[_0x43e7('0x2b')](db[_0x43e7('0x54')][_0x43e7('0x51')](_0x2345fe(_0x32a901,'CampaignId'))['then'](function(){})[_0x43e7('0x2d')](_0x1e979f()));}}}return _0x21e69c;})[_0x43e7('0x55')]();})['then'](function(){return db[_0x43e7('0x57')][_0x43e7('0x4b')]({'attributes':['id'],'include':[{'model':db[_0x43e7('0x4e')],'as':_0x43e7('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x49163d){var _0x11351a=[];if(_0x49163d){for(var _0x3090b4=0x0,_0x2a31d9;_0x3090b4<_0x49163d[_0x43e7('0x19')];_0x3090b4+=0x1){_0x2a31d9=_0x49163d[_0x3090b4][_0x43e7('0x4f')]({'plain':!![]});_0x11351a['push'](db[_0x43e7('0x54')][_0x43e7('0x51')](_0x5a0bb6(_0x2a31d9,_0x43e7('0x59')))[_0x43e7('0x2a')](function(){})['catch'](_0x1e979f()));}}return _0x11351a;})[_0x43e7('0x55')]();})[_0x43e7('0x2d')](function(_0x102d1c){logger['error'](_0x43e7('0x5a'),_0x43e7('0x5b'),_0x102d1c[_0x43e7('0x1b')]);});}var processPromises=function(_0x484432){return BPromise[_0x43e7('0x55')](promises)[_0x43e7('0x2a')](function(_0x35c30d){})['catch'](function(_0x433773){logger['error'](_0x43e7('0x5c'),JSON[_0x43e7('0x2f')](_0x433773));})[_0x43e7('0x5d')](function(){socket[_0x43e7('0x5e')](_0x43e7('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x484432){return _0x484432[_0x43e7('0x60')]();}});};var endCsv=function(){return BPromise[_0x43e7('0x61')]()[_0x43e7('0x2a')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x43e7('0x5e')](_0x43e7('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x43e7('0x62')](FILEPATH);}catch(_0x1fbc17){logger['error'](_0x43e7('0x63'),JSON[_0x43e7('0x2f')](_0x1fbc17));}finally{process[_0x43e7('0x64')](0x0);}});};process['on'](_0x43e7('0x65'),function(){logger[_0x43e7('0x66')](_0x43e7('0x67'));endCsv();});function main(){return BPromise[_0x43e7('0x61')]()[_0x43e7('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x43e7('0x11')](',');return db[_0x43e7('0x68')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x43e7('0x2a')](function(_0x66e2e2){var _0xe4d40d=fs[_0x43e7('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x43e7('0x6a')](_0xe4d40d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5c4d31,_0x7ab789){total+=0x1;var _0x3655d8=total;promises[_0x43e7('0x2b')](checkRow(_0x5c4d31,_0x66e2e2,_0x3655d8)[_0x43e7('0x2a')](function(){success+=0x1;})[_0x43e7('0x2d')](function(_0x394105){if(_0x394105['error']){errors+=0x1;delete _0x394105[_0x43e7('0x13')];}else if(_0x394105[_0x43e7('0x6b')]){duplicates+=0x1;delete _0x394105[_0x43e7('0x6b')];}rows[_0x43e7('0x2b')](_0x394105);}));if(total%0xc8===0x0){_0x7ab789['pause']();return processPromises(_0x7ab789);}},'complete':function(){return processPromises()[_0x43e7('0x2a')](function(){logger['info'](_0x43e7('0x6c'));endCsv();});},'error':function(_0x23397e,_0xdd720){logger['info']('CSV\x20parse\x20error',JSON[_0x43e7('0x2f')](_0x23397e));endCsv();}});})[_0x43e7('0x2d')](function(_0x2b60c1){logger['error'](_0x43e7('0x6d'),JSON['stringify'](_0x2b60c1));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 823b57f..e3ce59e 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 _0x76da=['socket_timestamp','root','server/files/tmp','ContactItemType','name','_description','header','parse','createReadStream','data','rows','errors','find','hasOwnProperty','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','replace','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','CREATE\x20TABLE\x20','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','orderBy','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','all','then','split','isNil','filter','push','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','into','cm_hopper_black','cm_contacts.ListId\x20=\x20','.CmListId','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','recallme','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','insert','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','code','query','spread','catch','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','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=','sequelize','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','clone'];(function(_0x2c27bf,_0x5973f2){var _0x232f02=function(_0x2aeef7){while(--_0x2aeef7){_0x2c27bf['push'](_0x2c27bf['shift']());}};_0x232f02(++_0x5973f2);}(_0x76da,0xfc));var _0xa76d=function(_0x49be23,_0xd0ca93){_0x49be23=_0x49be23-0x0;var _0x260861=_0x76da[_0x49be23];return _0x260861;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xa76d('0x0'));var Papa=require(_0xa76d('0x1'));var util=require(_0xa76d('0x2'));var BPromise=require('bluebird');var moment=require(_0xa76d('0x3'));var squel=require(_0xa76d('0x4'));var Redis=require('ioredis');var db=require(_0xa76d('0x5'))['db'];var config=require(_0xa76d('0x6'));var shared=require(_0xa76d('0x7'));var logger=require(_0xa76d('0x8'))(_0xa76d('0x9'));config[_0xa76d('0xa')]=_[_0xa76d('0xb')](config[_0xa76d('0xa')],{'host':_0xa76d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xa76d('0xd')](_0xa76d('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xa76d('0xd')](_0xa76d('0xe'));function isEmail(_0x4b38cd){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))*$/[_0xa76d('0xf')](_0x4b38cd);}function selectNotIn(_0x1d4eb7,_0x5c13c1,_0x1e6f24,_0x1634db,_0x26e42f){return squel[_0xa76d('0x10')]()[_0xa76d('0x11')](_0xa76d('0x12'))[_0xa76d('0x13')](_0x1634db)[_0xa76d('0x14')](_0x5c13c1,null,_0x5c13c1+_0xa76d('0x15')+_0x1634db+'.'+_0x1e6f24)[_0xa76d('0x16')](_0x1634db+'.'+_0x1e6f24+_0xa76d('0x17')+_0x1d4eb7+'.'+_0x1e6f24)[_0xa76d('0x16')](_0x5c13c1+_0xa76d('0x18')+_0x26e42f[_0xa76d('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5a4dc1,_0x272b3f){promisesAdditionalPhones=[];return db[_0xa76d('0x19')][_0xa76d('0x1a')]({'raw':!![],'attributes':['id',_0xa76d('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x3d5a00){if(_0x3d5a00!==null){var _0xe48b41=[];for(var _0x1d168b=0x0;_0x1d168b<_0x3d5a00[_0xa76d('0x1c')];_0x1d168b++){var _0x3ecf60=_0x3d5a00[_0x1d168b];_0xe48b41['push'](insertAdditionalPhones(_0x3ecf60));}}Promise[_0xa76d('0x1d')](_0xe48b41)[_0xa76d('0x1e')](function(){_0x5a4dc1({'val':0x1});});});});}function insertAdditionalPhones(_0x582bbc){return new Promise(function(_0x30a270,_0x2ac3b2){var _0x410fa0=_0x582bbc[_0xa76d('0x1b')];var _0x20e1ee=_0x410fa0[_0xa76d('0x1f')](';');var _0x20d86c=[];orderBy=0x0;for(var _0x2cc336=0x0;_0x2cc336<_0x20e1ee['length'];_0x2cc336++){_0x20d86c['push'](splitAdditionalPhone(_0x582bbc['id'],_0x20e1ee[_0x2cc336]));}Promise[_0xa76d('0x1d')](_0x20d86c)[_0xa76d('0x1e')](function(){_0x30a270({'val':_0x20e1ee[_0xa76d('0x1c')]});});});}function splitAdditionalPhone(_0x5db725,_0x1b1ddb){return new Promise(function(_0xda270b,_0xc6f49){var _0x372cd6=_0x1b1ddb[_0xa76d('0x1f')](':');var _0x505bb5=_0x372cd6[0x0];var _0x2da0ff=_0x372cd6[0x1];if(!_[_0xa76d('0x20')](_0x2da0ff)){var _0x1c81ad=_0x2da0ff[_0xa76d('0x1f')]('|');var _0x2922bb=[];for(var _0x4e2d36=0x0;_0x4e2d36<_0x1c81ad[_0xa76d('0x1c')];_0x4e2d36++){if(_0x1c81ad[_0x4e2d36]!==''){var _0x5bb7aa=_[_0xa76d('0x21')](promisesAdditionalPhones,{'contactId':_0x5db725,'phone':_0x1c81ad[_0x4e2d36]});if(_0x5bb7aa[_0xa76d('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0xa76d('0x22')]({'contactId':_0x5db725,'contactTypeId':_0x505bb5,'phone':_0x1c81ad[_0x4e2d36],'orderBy':orderBy});}}}_0xda270b({'ok':0x1});}else _0xda270b({'res':0x0});});}function createAdditionalPhone(_0x68093c,_0x137a79,_0x335613,_0x2483af){var _0x59a4bb='';var _0x49d367='';var _0x27464c=_0x335613[_0xa76d('0x1f')]('§');_0x59a4bb=_0x27464c[0x0];if(_0x27464c[_0xa76d('0x1c')]==0x2)_0x49d367=_0x27464c[0x1];return new Promise(function(_0x21f1b8,_0xe14f7a){return db[_0xa76d('0x23')][_0xa76d('0x24')]({'where':{'CmContactId':_0x68093c,'item':_0x59a4bb}})[_0xa76d('0x1e')](function(_0x1d1b27){if(_0x1d1b27){return db[_0xa76d('0x23')][_0xa76d('0x25')]({'ItemTypeId':_0x137a79,'description':_0x49d367,'OrderBy':_0x2483af},{'where':{'CmContactId':_0x68093c,'item':_0x59a4bb}})['then'](function(_0x255e93){_0x21f1b8({'res':'updated'});});}else{return db['CmContactHasItem'][_0xa76d('0x26')]({'CmContactId':_0x68093c,'item':_0x59a4bb,'description':_0x49d367,'ItemTypeId':_0x137a79,'OrderBy':_0x2483af,'ItemClass':_0xa76d('0x27')})[_0xa76d('0x1e')](function(_0x1f2488){_0x21f1b8({'res':_0xa76d('0x28')});});}});});}function insertCmHopper(_0x28c252,_0x16697d,_0x2c8e85,_0x2e064a,_0x4ec4cc){var _0x2689a3=[_0xa76d('0x29'),_0xa76d('0x2a'),_0xa76d('0x2b'),'cm_contacts.ListId',_0x16697d+'.'+_0x2e064a,_0xa76d('0x2c'),_0xa76d('0x2d'),'cm_contacts.priority',_0xa76d('0x2e'),'\x22'+_0x4ec4cc+'\x22'];return squel['insert']()['into'](_0xa76d('0x2f'))[_0xa76d('0x30')]([_0xa76d('0x12'),_0xa76d('0x31'),_0xa76d('0x32'),_0xa76d('0x33'),_0x2e064a,_0xa76d('0x34'),_0xa76d('0x35'),_0xa76d('0x36'),_0xa76d('0x37'),'recallme'],squel[_0xa76d('0x10')]()[_0xa76d('0x38')](_0x2689a3)['from'](_0x16697d)[_0xa76d('0x14')](_0xa76d('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x16697d+'.CmListId')[_0xa76d('0x14')](_0x2c8e85,null,_0x2c8e85+_0xa76d('0x15')+_0x16697d+'.'+_0x2e064a)['where'](_0x16697d+_0xa76d('0x3a'),_0x28c252)[_0xa76d('0x16')](_0xa76d('0x3b'),NOW)['where'](_0xa76d('0x3c'),selectNotIn(_0x16697d,_0x2c8e85,_0x2e064a,'cm_hopper',[_0xa76d('0x3d'),_0xa76d('0x3e')]))['where'](_0xa76d('0x3c'),selectNotIn(_0x16697d,_0x2c8e85,_0x2e064a,_0xa76d('0x2f'),[_0xa76d('0x3d')])))['toString']();}function insertCmHopperBlack(_0x1fd8ac,_0x12eed2,_0x3c77e5,_0x31fd1a){var _0x5e0c6f=[_0xa76d('0x29'),_0xa76d('0x2b'),_0xa76d('0x3f'),_0x12eed2+'.'+_0x31fd1a,_0xa76d('0x2c'),_0xa76d('0x2d')];return squel['insert']()[_0xa76d('0x40')](_0xa76d('0x41'))[_0xa76d('0x30')](['phone',_0xa76d('0x32'),_0xa76d('0x33'),_0x31fd1a,_0xa76d('0x34'),'updatedAt'],squel['select']()[_0xa76d('0x38')](_0x5e0c6f)[_0xa76d('0x13')](_0x12eed2)[_0xa76d('0x14')](_0xa76d('0x39'),null,_0xa76d('0x42')+_0x12eed2+_0xa76d('0x43'))['join'](_0x3c77e5,null,_0x3c77e5+'.id\x20=\x20'+_0x12eed2+'.'+_0x31fd1a)['where'](_0x12eed2+'.CmListId\x20=\x20?',_0x1fd8ac)[_0xa76d('0x16')](_0xa76d('0x3b'),NOW)[_0xa76d('0x16')](_0xa76d('0x3c'),squel['select']()[_0xa76d('0x11')]('phone')[_0xa76d('0x13')]('cm_hopper_black')[_0xa76d('0x16')]('ListId\x20=\x20?',_0x1fd8ac)['where'](_0x31fd1a+'\x20=\x20'+_0x12eed2+'.'+_0x31fd1a)))[_0xa76d('0x44')]();}function insertTzCmHopper(_0x5da528,_0xc173aa,_0x1d17da,_0xcecfa3,_0x35b951,_0x41d59b){var _0x25bdd1=[_0xa76d('0x29'),_0xa76d('0x45')+_0x41d59b+_0xa76d('0x46'),_0xa76d('0x2b'),_0xa76d('0x3f'),_0xc173aa+'.'+_0xcecfa3,_0xa76d('0x2c'),_0xa76d('0x2d'),_0xa76d('0x47'),_0xa76d('0x2e'),'\x22'+_0x35b951+'\x22'];var _0x25f871=squel['insert']()[_0xa76d('0x40')](_0xa76d('0x2f'))[_0xa76d('0x30')](['phone',_0xa76d('0x31'),_0xa76d('0x32'),_0xa76d('0x33'),_0xcecfa3,_0xa76d('0x34'),_0xa76d('0x35'),_0xa76d('0x36'),_0xa76d('0x37'),_0xa76d('0x48')],squel['select']()['fields'](_0x25bdd1)[_0xa76d('0x13')](_0xc173aa)[_0xa76d('0x14')](_0xa76d('0x39'),null,_0xa76d('0x42')+_0xc173aa+'.CmListId')[_0xa76d('0x14')](_0x1d17da,null,_0x1d17da+_0xa76d('0x15')+_0xc173aa+'.'+_0xcecfa3)[_0xa76d('0x14')](_0x41d59b,null,_0x41d59b+_0xa76d('0x15')+_0xc173aa+'.'+_0xcecfa3)['where'](_0xc173aa+'.CmListId\x20=\x20?',_0x5da528)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa76d('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xc173aa,_0x1d17da,_0xcecfa3,_0xa76d('0x2f'),[_0xa76d('0x3d'),_0xa76d('0x3e')]))[_0xa76d('0x16')](_0xa76d('0x3c'),selectNotIn(_0xc173aa,_0x1d17da,_0xcecfa3,_0xa76d('0x2f'),[_0xa76d('0x3d')])))[_0xa76d('0x44')]();return _0x25f871;}function insertTzCmHopperBlack(_0x5949a7,_0x35522b,_0x180d20,_0x2e5eab){var _0x456243=[_0xa76d('0x29'),_0xa76d('0x2b'),_0xa76d('0x3f'),_0x35522b+'.'+_0x2e5eab,_0xa76d('0x2c'),_0xa76d('0x2d')];return squel['insert']()[_0xa76d('0x40')](_0xa76d('0x41'))[_0xa76d('0x30')]([_0xa76d('0x12'),_0xa76d('0x32'),_0xa76d('0x33'),_0x2e5eab,'createdAt',_0xa76d('0x35')],squel[_0xa76d('0x10')]()[_0xa76d('0x38')](_0x456243)[_0xa76d('0x13')](_0x35522b)['join'](_0xa76d('0x39'),null,_0xa76d('0x42')+_0x35522b+_0xa76d('0x43'))['join'](_0x180d20,null,_0x180d20+_0xa76d('0x15')+_0x35522b+'.'+_0x2e5eab)['where'](_0x35522b+_0xa76d('0x3a'),_0x5949a7)[_0xa76d('0x16')](_0xa76d('0x3b'),NOW)[_0xa76d('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xa76d('0x11')](_0xa76d('0x12'))[_0xa76d('0x13')](_0xa76d('0x41'))[_0xa76d('0x16')](_0xa76d('0x49'),_0x5949a7)[_0xa76d('0x16')](_0x2e5eab+_0xa76d('0x17')+_0x35522b+'.'+_0x2e5eab)))[_0xa76d('0x44')]();}function insertCmHopperAdditionalPhones(_0x1dbba0){var _0x5bec94=[_0xa76d('0x4a'),_0xa76d('0x4b'),_0xa76d('0x4c'),_0xa76d('0x4d'),_0xa76d('0x4e')];return squel[_0xa76d('0x4f')]()[_0xa76d('0x40')]('cm_hopper_additional_phones')[_0xa76d('0x30')]([_0xa76d('0x50'),_0xa76d('0x12'),_0xa76d('0x51'),_0xa76d('0x34'),_0xa76d('0x35')],squel[_0xa76d('0x10')]()['fields'](_0x5bec94)[_0xa76d('0x13')](_0xa76d('0x2f'))[_0xa76d('0x14')](_0xa76d('0x39'),null,_0xa76d('0x52'))[_0xa76d('0x14')](_0xa76d('0x53'),null,_0xa76d('0x54'))['where'](_0xa76d('0x55'),_0x1dbba0)[_0xa76d('0x16')](_0xa76d('0x3b'),NOW))[_0xa76d('0x44')]();}function insertCmContact(_0xe8bf0d,_0x44f456,_0x126d45,_0x342e63){var _0x3b2db4=_['concat'](_[_0xa76d('0x56')](_0x342e63),['ListId',_0xa76d('0x57'),_0xa76d('0x34'),_0xa76d('0x35'),'scheduledAt']);return squel[_0xa76d('0x4f')]()[_0xa76d('0x40')](_0xa76d('0x39'))[_0xa76d('0x30')](_0x3b2db4,squel[_0xa76d('0x10')]()[_0xa76d('0x38')](_0x3b2db4)[_0xa76d('0x13')](_0x44f456)[_0xa76d('0x16')]('('+_0x126d45[_0xa76d('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0xa76d('0x10')]()[_0xa76d('0x38')](_0x126d45)[_0xa76d('0x13')]('cm_contacts')[_0xa76d('0x16')](_0xa76d('0x49'),_0xe8bf0d)[_0xa76d('0x16')]('deletedAt\x20IS\x20NULL'))[_0xa76d('0x16')](_0xa76d('0x58'),squel[_0xa76d('0x10')]()['field'](_0xa76d('0x59'),_0xa76d('0x5a'))[_0xa76d('0x13')](_0x44f456)[_0xa76d('0x5b')](_0x126d45[_0xa76d('0x14')](','))))['toString']();}function handleStop(){logger[_0xa76d('0x5c')](_0xa76d('0x5d'));stopped=!![];}function handleUncaughtException(_0x11cba0){logger[_0xa76d('0x5e')](_0x11cba0[_0xa76d('0x5f')]);process[_0xa76d('0x60')](0x1);}function handleError(_0x40a082,_0x390133){stats['errors'][_0xa76d('0x22')]({'name':_0x390133[_0xa76d('0x61')],'message':_0x390133[_0xa76d('0x5f')],'row':_0x40a082});}function handleQuery(_0x3b726d){logger[_0xa76d('0x5c')](_0x3b726d);return db['sequelize'][_0xa76d('0x62')](_0x3b726d)[_0xa76d('0x63')](function(_0x1c51c1){results[_0xa76d('0x22')](_0x1c51c1);})[_0xa76d('0x64')](function(_0x379b4c){logger[_0xa76d('0x5e')](_0x379b4c[_0xa76d('0x5f')]);});}function updateTzCampaigns(_0xfdbfa8){return new Promise(function(_0x39e6f7,_0x36e226){var _0x589df8=squel['select']()[_0xa76d('0x38')](['campaigns.id',_0xa76d('0x65')])['from']('campaigns')['join'](_0xa76d('0x66'),null,_0xa76d('0x67'))['where']('campaigns_has_cm_lists.CmListId='+_0xfdbfa8);db['sequelize'][_0xa76d('0x62')](_0x589df8['toString']())[_0xa76d('0x63')](function(_0x17c51c){var _0x797caa=[];for(var _0x56dc9b=0x0;_0x56dc9b<_0x17c51c['length'];_0x56dc9b++){_0x797caa[_0xa76d('0x22')](getTimezoneData(_0x17c51c[_0x56dc9b],tmp_campaigns));}BPromise['all'](_0x797caa)['then'](function(){_0x39e6f7({'val':0x1});});})[_0xa76d('0x64')](function(_0xce23fa){logger[_0xa76d('0x5e')](_0xce23fa[_0xa76d('0x5f')]);_0x39e6f7({'val':0x0});});});}function updateTzVoiceQueues(_0xbf3883){return new Promise(function(_0x120935,_0x516a35){var _0x38fc96=squel[_0xa76d('0x10')]()[_0xa76d('0x38')]([_0xa76d('0x68'),_0xa76d('0x69')])[_0xa76d('0x13')](_0xa76d('0x6a'))[_0xa76d('0x14')](_0xa76d('0x6b'),null,_0xa76d('0x6c'))[_0xa76d('0x16')](_0xa76d('0x6d')+_0xbf3883);db[_0xa76d('0x6e')][_0xa76d('0x62')](_0x38fc96['toString']())['spread'](function(_0x3e06b4){var _0x14c142=[];for(var _0xb04e6b=0x0;_0xb04e6b<_0x3e06b4[_0xa76d('0x1c')];_0xb04e6b++){_0x14c142[_0xa76d('0x22')](getTimezoneData(_0x3e06b4[_0xb04e6b],tmp_voice_queues));}BPromise[_0xa76d('0x1d')](_0x14c142)[_0xa76d('0x1e')](function(){_0x120935({'val':0x1});});})[_0xa76d('0x64')](function(_0xa7d740){logger[_0xa76d('0x5e')](_0xa7d740[_0xa76d('0x5f')]);_0x120935({'val':0x0});});});}function getTimezoneData(_0x181029,_0x2b6cc8){return new Promise(function(_0x2dd528,_0x47f77c){var _0x3b194f=shared[_0xa76d('0x6f')];var _0x3880c4=_0x3b194f[_0x181029[_0xa76d('0x70')]];if(_['isNil'](_0x3880c4)){_0x2dd528({'ret':0x1});}else{var _0x4ed365=_0x3880c4[_0xa76d('0x71')];var _0x2166dd=squel[_0xa76d('0x4f')]()['into'](_0x2b6cc8)[_0xa76d('0x72')]('id',_0x181029['id'])['set'](_0xa76d('0x73'),_0x4ed365)['set']('dialTimezone',_0x181029[_0xa76d('0x70')])[_0xa76d('0x44')]();return db[_0xa76d('0x6e')][_0xa76d('0x62')](_0x2166dd)[_0xa76d('0x63')](function(_0xbe276f){_0x2dd528({'ret':0x1});})[_0xa76d('0x64')](function(_0x3283ed){logger[_0xa76d('0x5e')](_0x3283ed[_0xa76d('0x5f')]);_0x47f77c({'ret':0x1});});}});}function handleTZQuery(_0x1ca6c0){logger[_0xa76d('0x5c')](_0x1ca6c0);return db[_0xa76d('0x6e')][_0xa76d('0x62')](_0x1ca6c0)['spread'](function(_0x14c8a6){})['catch'](function(_0x391442){logger[_0xa76d('0x5e')](_0x391442[_0xa76d('0x5f')]);});}function main(_0x1e61e9,_0x3b37c6,_0x4c243b,_0x2fe663){logger[_0xa76d('0x5c')](_0xa76d('0x74'),_0x1e61e9,JSON[_0xa76d('0x75')](_0x3b37c6));process[_0xa76d('0x76')](_0xa76d('0x77'));var _0x1c6a68=_0x3b37c6[_0xa76d('0x78')];var _0x312e1f=_[_0xa76d('0x79')](_0x1c6a68);var _0x103d22=_0x3b37c6[_0xa76d('0x7a')];var _0x241dbb=path[_0xa76d('0x14')](config[_0xa76d('0x7b')],_0xa76d('0x7c'),_0x103d22+'.csv');hasTZ=_[_0xa76d('0x56')](_0x1c6a68)['includes'](_0xa76d('0x70'));var _0x4bb778=_['keys'](_0x1c6a68)[_0xa76d('0x14')]();logger[_0xa76d('0x5c')]('header',_0x4bb778);db[_0xa76d('0x7d')][_0xa76d('0x1a')]({'raw':!![],'attributes':['id',_0xa76d('0x7e')]})['then'](function(_0x394a28){for(var _0x4f1f63=0x0;_0x4f1f63<_0x394a28[_0xa76d('0x1c')];_0x4f1f63++){if(_0x394a28[_0x4f1f63]['name']in _0x1c6a68){contactItemTypes[_0xa76d('0x22')](_0x394a28[_0x4f1f63]);delete _0x312e1f[_0x394a28[_0x4f1f63]['name']];hasAdditionalPhones=!![];}for(var _0x38158e in _0x1c6a68){if(_0x394a28[_0x4f1f63][_0xa76d('0x7e')]+_0xa76d('0x7f')===_0x38158e){phoneDescriptions[_0xa76d('0x22')]({'itemTypeId':_0x394a28[_0x4f1f63]['id'],'description':_0x38158e});delete _0x312e1f[_0x38158e];}}}if(hasAdditionalPhones)_0x312e1f[_0xa76d('0x1b')]='';var _0x46bb48=_['keys'](_0x312e1f)[_0xa76d('0x14')]();logger[_0xa76d('0x5c')](_0xa76d('0x80'),_0x46bb48);fs['writeFileSync'](_0x241dbb,_0x46bb48+'\x0a');Papa[_0xa76d('0x81')](fs[_0xa76d('0x82')](_0x1e61e9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2129fe,_0x5a8790){try{for(var _0x1a407a=0x0,_0x483277=[];_0x1a407a<_0x2129fe[_0xa76d('0x83')][_0xa76d('0x1c')];_0x1a407a++){stats[_0xa76d('0x84')]+=0x1;if(_0x2129fe[_0xa76d('0x85')][_0x1a407a]){handleError(_0x2129fe[_0xa76d('0x83')][_0x1a407a],_0x2129fe[_0xa76d('0x85')][_0x1a407a]);}else{var _0x2350ab=[];var _0xcd0cc3=[];var _0x452879={};for(var _0x360048 in _0x1c6a68){let _0x5c3687=contactItemTypes[_0xa76d('0x86')](_0x2684d9=>_0x2684d9[_0xa76d('0x7e')]===_0x360048);let _0x47617b=contactItemTypes[_0xa76d('0x86')](_0x996b77=>_0x996b77[_0xa76d('0x7e')]+_0xa76d('0x7f')===_0x360048);if(_[_0xa76d('0x20')](_0x5c3687)&&_[_0xa76d('0x20')](_0x47617b)){if(_0x1c6a68[_0xa76d('0x87')](_0x360048)){if(_0x2129fe[_0xa76d('0x83')][_0x1a407a][_0x1c6a68[_0x360048]]){var _0x14a04d=_['trim'](_0x2129fe[_0xa76d('0x83')][_0x1a407a][_0x1c6a68[_0x360048]]['replace'](/"/g,'\x27'));switch(_0x360048){case _0xa76d('0x31'):var _0x194ed6=moment(_0x14a04d,_0xa76d('0xe'),!![]);if(_0x194ed6[_0xa76d('0x88')]()){_0x483277[_0xa76d('0x22')]('\x22'+_0x14a04d+'\x22');}else{_0x2350ab[_0xa76d('0x22')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa76d('0x36'):var _0x3d814a=parseInt(_0x14a04d);_0x14a04d=_[_0xa76d('0x89')](_0x3d814a)||_0x3d814a<0x0||_0x3d814a>0x4?_0x2fe663?0x3:0x2:_0x3d814a;_0x483277[_0xa76d('0x22')]('\x22'+_0x14a04d+'\x22');break;case _0xa76d('0x37'):var _0x547439=parseInt(_0x14a04d);if(_[_0xa76d('0x8a')](_0x547439)&&_[_0xa76d('0x8b')](_0x4c243b,_0x547439)){_0x483277[_0xa76d('0x22')]('\x22'+_0x547439+'\x22');}else{_0x2350ab[_0xa76d('0x22')](_0xa76d('0x8c'));}break;case _0xa76d('0x8d'):if(isEmail(_0x14a04d)){_0x483277[_0xa76d('0x22')]('\x22'+_0x14a04d+'\x22');}else{_0x2350ab[_0xa76d('0x22')](_0xa76d('0x8e'));}break;case _0xa76d('0x8f'):var _0x43278f=moment(_0x14a04d,'YYYY-MM-DD',!![]);if(_0x43278f[_0xa76d('0x88')]()){_0x483277[_0xa76d('0x22')]('\x22'+_0x14a04d+'\x22');}else{_0x2350ab[_0xa76d('0x22')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xa76d('0x70'):var _0x464427=shared[_0xa76d('0x6f')];var _0x535702=_0x464427[_0x14a04d];if(!_['isNil'](_0x535702)){var _0x122744=_0x535702[_0xa76d('0x71')];_0x483277[_0xa76d('0x22')]('\x22'+_0x14a04d+'\x22');_0x483277['push']('\x22'+_0x122744+'\x22');}break;default:_0x483277[_0xa76d('0x22')]('\x22'+_0x14a04d+'\x22');}}else{switch(_0x360048){case _0xa76d('0x90'):case _0xa76d('0x12'):_0x2350ab['push'](_0x360048+_0xa76d('0x91'));break;default:_0x483277[_0xa76d('0x22')]('\x22\x22');}}}}else{var _0x2d5015='';if(!_[_0xa76d('0x20')](_0x5c3687)){if(!_0x452879[_0xa76d('0x87')](_0x5c3687['id'])){if(!_['isNil'](_0x2129fe['data'][_0x1a407a][_0x1c6a68[_0x360048]])){var _0x14a04d=_['trim'](_0x2129fe[_0xa76d('0x83')][_0x1a407a][_0x1c6a68[_0x360048]][_0xa76d('0x92')](/"/g,'\x27'));var _0x29fda9=phoneDescriptions['find'](_0x5f4e99=>_0x5f4e99['itemTypeId']===_0x5c3687['id']);if(!_['isNil'](_0x29fda9)){var _0x39e4cc=_['trim'](_0x2129fe[_0xa76d('0x83')][_0x1a407a][_0x1c6a68[_0x29fda9[_0xa76d('0x93')]]][_0xa76d('0x92')](/"/g,'\x27'));if(!_[_0xa76d('0x20')](_0x39e4cc))_0x14a04d=_0x14a04d+'§'+_0x39e4cc;}if(_0x2d5015=='')_0x2d5015=_0x14a04d;else _0x2d5015+='|'+_0x14a04d;}_0xcd0cc3['push'](_0x5c3687['id']+':'+_0x2d5015);_0x452879[_0x5c3687['id']]=0x1;}}}}if(hasAdditionalPhones){_0x483277[_0xa76d('0x22')]('\x22'+_0xcd0cc3[_0xa76d('0x14')](';')+'\x22');}if(_0x2350ab[_0xa76d('0x1c')]){handleError(_0x2129fe[_0xa76d('0x83')][_0x1a407a],{'code':_0xa76d('0x94'),'message':_0x2350ab[_0xa76d('0x14')]()});}else{fs[_0xa76d('0x95')](_0x241dbb,_0x483277[_0xa76d('0x14')]()+'\x0a');}_0x483277=[];}if(!(stats[_0xa76d('0x84')]%0xc8)){socket[_0xa76d('0x96')](_0xa76d('0x97')+_0x103d22,stats);stats[_0xa76d('0x85')]=[];}}if(stopped){logger[_0xa76d('0x5c')]('Abort\x20parser');_0x5a8790[_0xa76d('0x98')]();}}catch(_0x4a34f4){handleError(_0x2129fe[_0xa76d('0x83')][_0x1a407a],{'code':_0xa76d('0x99'),'message':_0x4a34f4[_0xa76d('0x5f')]});logger[_0xa76d('0x5e')](_0xa76d('0x9a'),_0x4a34f4[_0xa76d('0x5f')]);}},'complete':function(){try{var _0x43f09c=[];var _0x2f66d9=[];var _0x402844=_0xa76d('0x39');if(_0x3b37c6[_0xa76d('0x9b')]&&_0x3b37c6[_0xa76d('0x9b')][_0xa76d('0x1c')]){_0x402844=_0xa76d('0x9c')+_0x103d22;_0x43f09c[_0xa76d('0x22')]('CREATE\x20TABLE\x20'+_0x402844+_0xa76d('0x9d'));}tmp_campaigns=_0xa76d('0x9e')+_0x103d22;tmp_voice_queues=_0xa76d('0x9f')+_0x103d22;_0x2f66d9['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0xa76d('0xa0'));_0x2f66d9[_0xa76d('0x22')](_0xa76d('0xa1')+tmp_voice_queues+_0xa76d('0xa0'));BPromise['each'](_0x2f66d9,handleTZQuery)[_0xa76d('0x1e')](function(_0x55bcb0){updateTzCampaigns(_0x3b37c6[_0xa76d('0x33')])[_0xa76d('0x1e')](function(_0x5dc76a){updateTzVoiceQueues(_0x3b37c6[_0xa76d('0x33')])['then'](function(_0xfe7433){if(hasTZ)_0x46bb48=_0x46bb48['replace']('dialTimezone',_0xa76d('0xa2'));var _0x203427=util[_0xa76d('0xd')](_0xa76d('0xa3'),_0x241dbb,_0x402844,_0x46bb48,_0x3b37c6[_0xa76d('0x33')],_0x3b37c6['CompanyId']||null,NOW,NOW);if(_[_0xa76d('0x20')](_0x1c6a68['scheduledat'])){_0x203427+=_0xa76d('0xa4');}_0x43f09c[_0xa76d('0x22')](_0x203427);if(_0x3b37c6['duplicates']&&_0x3b37c6[_0xa76d('0x9b')][_0xa76d('0x1c')]){_0x43f09c[_0xa76d('0x22')](insertCmContact(_0x3b37c6[_0xa76d('0x33')],_0x402844,_0x3b37c6['duplicates'],_0x1c6a68));_0x43f09c[_0xa76d('0x22')]('DROP\x20TABLE\x20'+_0x402844+';');}BPromise[_0xa76d('0xa5')](_0x43f09c,handleQuery)[_0xa76d('0x1e')](function(_0x58ef9e){BPromise[_0xa76d('0x1d')]([handleAdditionalPhones()])[_0xa76d('0x1e')](function(){_0x43f09c=[];for(var _0x3c37d4=0x0;_0x3c37d4\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment/shared','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','where','\x20=\x20','CmContact','AdditionalPhones','then','length','push','split','all','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','createdAt','updatedAt','UserId','recallme','select','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ContactId','ListId','fields','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.ListId','priority','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_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','query','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone'];(function(_0xe411c,_0xe6621c){var _0x39e413=function(_0x3fa658){while(--_0x3fa658){_0xe411c['push'](_0xe411c['shift']());}};_0x39e413(++_0xe6621c);}(_0xacb6,0x1c8));var _0x6acb=function(_0x219d24,_0x46c8db){_0x219d24=_0x219d24-0x0;var _0x47eda1=_0xacb6[_0x219d24];return _0x47eda1;};'use strict';var fs=require('fs');var path=require(_0x6acb('0x0'));var _=require(_0x6acb('0x1'));var Papa=require(_0x6acb('0x2'));var util=require(_0x6acb('0x3'));var BPromise=require(_0x6acb('0x4'));var moment=require(_0x6acb('0x5'));var squel=require(_0x6acb('0x6'));var Redis=require('ioredis');var db=require(_0x6acb('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x6acb('0x8'));var logger=require('../../../config/logger')('import');config[_0x6acb('0x9')]=_['defaults'](config[_0x6acb('0x9')],{'host':_0x6acb('0xa'),'port':0x18eb});var socket=require(_0x6acb('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x6acb('0xc')](_0x6acb('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x6acb('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x47dc68){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'](_0x47dc68);}function selectNotIn(_0x59ff3c,_0x271ff5,_0x5c372c,_0x39cd2b,_0x522a77){return squel['select']()[_0x6acb('0xe')](_0x6acb('0xf'))[_0x6acb('0x10')](_0x39cd2b)[_0x6acb('0x11')](_0x271ff5,null,_0x271ff5+'.id\x20=\x20'+_0x39cd2b+'.'+_0x5c372c)[_0x6acb('0x12')](_0x39cd2b+'.'+_0x5c372c+_0x6acb('0x13')+_0x59ff3c+'.'+_0x5c372c)[_0x6acb('0x12')](_0x271ff5+'.dialCheckDuplicateType\x20IN\x20('+_0x522a77[_0x6acb('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4877f2,_0x36cdb9){promisesAdditionalPhones=[];return db[_0x6acb('0x14')]['findAll']({'raw':!![],'attributes':['id',_0x6acb('0x15')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x6acb('0x16')](function(_0x4dc37a){if(_0x4dc37a!==null){var _0x4178f4=[];for(var _0x57d9b5=0x0;_0x57d9b5<_0x4dc37a[_0x6acb('0x17')];_0x57d9b5++){var _0x44f617=_0x4dc37a[_0x57d9b5];_0x4178f4[_0x6acb('0x18')](insertAdditionalPhones(_0x44f617));}}Promise['all'](_0x4178f4)[_0x6acb('0x16')](function(){_0x4877f2({'val':0x1});});});});}function insertAdditionalPhones(_0x407b11){return new Promise(function(_0x305100,_0x482602){var _0x2ca660=_0x407b11[_0x6acb('0x15')];var _0x2b14b3=_0x2ca660[_0x6acb('0x19')](';');var _0xe3b8bc=[];orderBy=0x0;for(var _0x317526=0x0;_0x317526<_0x2b14b3[_0x6acb('0x17')];_0x317526++){_0xe3b8bc['push'](splitAdditionalPhone(_0x407b11['id'],_0x2b14b3[_0x317526]));}Promise[_0x6acb('0x1a')](_0xe3b8bc)[_0x6acb('0x16')](function(){_0x305100({'val':_0x2b14b3[_0x6acb('0x17')]});});});}function splitAdditionalPhone(_0x542ba0,_0x3ca240){return new Promise(function(_0xc975c7,_0x16caae){var _0x4a7d60=_0x3ca240[_0x6acb('0x19')](':');var _0x234c29=_0x4a7d60[0x0];var _0x3db319=_0x4a7d60[0x1];if(!_['isNil'](_0x3db319)){var _0x128e88=_0x3db319[_0x6acb('0x19')]('|');var _0x3f3baf=[];for(var _0x12f7f7=0x0;_0x12f7f7<_0x128e88['length'];_0x12f7f7++){if(_0x128e88[_0x12f7f7]!==''){var _0x34dea1=_['filter'](promisesAdditionalPhones,{'contactId':_0x542ba0,'phone':_0x128e88[_0x12f7f7]});if(_0x34dea1[_0x6acb('0x17')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x542ba0,'contactTypeId':_0x234c29,'phone':_0x128e88[_0x12f7f7],'orderBy':orderBy});}}}_0xc975c7({'ok':0x1});}else _0xc975c7({'res':0x0});});}function createAdditionalPhone(_0x410072,_0x40d17b,_0x1dae83,_0x4c02fa){var _0x29b301='';var _0x5d93c0='';var _0x9e777c=_0x1dae83[_0x6acb('0x19')]('§');_0x29b301=_0x9e777c[0x0];if(_0x9e777c[_0x6acb('0x17')]==0x2)_0x5d93c0=_0x9e777c[0x1];return new Promise(function(_0x5702e8,_0x31148d){return db[_0x6acb('0x1b')][_0x6acb('0x1c')]({'where':{'CmContactId':_0x410072,'item':_0x29b301}})[_0x6acb('0x16')](function(_0x13a044){if(_0x13a044){return db['CmContactHasItem'][_0x6acb('0x1d')]({'ItemTypeId':_0x40d17b,'description':_0x5d93c0,'OrderBy':_0x4c02fa},{'where':{'CmContactId':_0x410072,'item':_0x29b301}})[_0x6acb('0x16')](function(_0x431547){_0x5702e8({'res':'updated'});});}else{return db[_0x6acb('0x1b')][_0x6acb('0x1e')]({'CmContactId':_0x410072,'item':_0x29b301,'description':_0x5d93c0,'ItemTypeId':_0x40d17b,'OrderBy':_0x4c02fa,'ItemClass':_0x6acb('0x1f')})[_0x6acb('0x16')](function(_0x4d7f2c){_0x5702e8({'res':_0x6acb('0x20')});});}});});}function insertCmHopper(_0x2035bd,_0x5f47fc,_0x541cd4,_0xd3fb5b,_0xd6aa74){var _0x70ccc1=[_0x6acb('0x21'),_0x6acb('0x22'),_0x6acb('0x23'),'cm_contacts.ListId',_0x5f47fc+'.'+_0xd3fb5b,_0x6acb('0x24'),_0x6acb('0x25'),'cm_contacts.priority',_0x6acb('0x26'),'\x22'+_0xd6aa74+'\x22'];return squel[_0x6acb('0x27')]()[_0x6acb('0x28')](_0x6acb('0x29'))[_0x6acb('0x2a')]([_0x6acb('0xf'),'scheduledat','ContactId','ListId',_0xd3fb5b,_0x6acb('0x2b'),_0x6acb('0x2c'),'priority',_0x6acb('0x2d'),_0x6acb('0x2e')],squel[_0x6acb('0x2f')]()['fields'](_0x70ccc1)['from'](_0x5f47fc)[_0x6acb('0x11')](_0x6acb('0x30'),null,_0x6acb('0x31')+_0x5f47fc+_0x6acb('0x32'))[_0x6acb('0x11')](_0x541cd4,null,_0x541cd4+'.id\x20=\x20'+_0x5f47fc+'.'+_0xd3fb5b)[_0x6acb('0x12')](_0x5f47fc+_0x6acb('0x33'),_0x2035bd)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6acb('0x12')](_0x6acb('0x34'),selectNotIn(_0x5f47fc,_0x541cd4,_0xd3fb5b,'cm_hopper',[_0x6acb('0x35'),_0x6acb('0x36')]))[_0x6acb('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5f47fc,_0x541cd4,_0xd3fb5b,_0x6acb('0x29'),[_0x6acb('0x35')])))[_0x6acb('0x37')]();}function insertCmHopperBlack(_0x104665,_0x2dfd26,_0xe4e2d,_0x1dfb5e){var _0x24a4b6=[_0x6acb('0x21'),_0x6acb('0x23'),'cm_contacts.ListId',_0x2dfd26+'.'+_0x1dfb5e,'cm_contacts.createdAt',_0x6acb('0x25')];return squel[_0x6acb('0x27')]()['into'](_0x6acb('0x38'))[_0x6acb('0x2a')]([_0x6acb('0xf'),_0x6acb('0x39'),_0x6acb('0x3a'),_0x1dfb5e,_0x6acb('0x2b'),'updatedAt'],squel[_0x6acb('0x2f')]()[_0x6acb('0x3b')](_0x24a4b6)[_0x6acb('0x10')](_0x2dfd26)[_0x6acb('0x11')](_0x6acb('0x30'),null,_0x6acb('0x31')+_0x2dfd26+_0x6acb('0x32'))[_0x6acb('0x11')](_0xe4e2d,null,_0xe4e2d+_0x6acb('0x3c')+_0x2dfd26+'.'+_0x1dfb5e)['where'](_0x2dfd26+_0x6acb('0x33'),_0x104665)[_0x6acb('0x12')](_0x6acb('0x3d'),NOW)[_0x6acb('0x12')](_0x6acb('0x34'),squel[_0x6acb('0x2f')]()[_0x6acb('0xe')](_0x6acb('0xf'))['from'](_0x6acb('0x38'))[_0x6acb('0x12')](_0x6acb('0x3e'),_0x104665)[_0x6acb('0x12')](_0x1dfb5e+'\x20=\x20'+_0x2dfd26+'.'+_0x1dfb5e)))[_0x6acb('0x37')]();}function insertTzCmHopper(_0x158bfa,_0x2bb665,_0x58f96d,_0x10849e,_0x5a9b39,_0x164d64){var _0x472ced=[_0x6acb('0x21'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x164d64+_0x6acb('0x3f'),'cm_contacts.id',_0x6acb('0x40'),_0x2bb665+'.'+_0x10849e,_0x6acb('0x24'),_0x6acb('0x25'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x5a9b39+'\x22'];var _0x4e5eaa=squel[_0x6acb('0x27')]()[_0x6acb('0x28')](_0x6acb('0x29'))[_0x6acb('0x2a')](['phone','scheduledat',_0x6acb('0x39'),'ListId',_0x10849e,'createdAt',_0x6acb('0x2c'),_0x6acb('0x41'),_0x6acb('0x2d'),'recallme'],squel[_0x6acb('0x2f')]()['fields'](_0x472ced)[_0x6acb('0x10')](_0x2bb665)[_0x6acb('0x11')](_0x6acb('0x30'),null,'cm_contacts.ListId\x20=\x20'+_0x2bb665+'.CmListId')[_0x6acb('0x11')](_0x58f96d,null,_0x58f96d+_0x6acb('0x3c')+_0x2bb665+'.'+_0x10849e)[_0x6acb('0x11')](_0x164d64,null,_0x164d64+_0x6acb('0x3c')+_0x2bb665+'.'+_0x10849e)[_0x6acb('0x12')](_0x2bb665+_0x6acb('0x33'),_0x158bfa)[_0x6acb('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6acb('0x12')](_0x6acb('0x34'),selectNotIn(_0x2bb665,_0x58f96d,_0x10849e,_0x6acb('0x29'),[_0x6acb('0x35'),_0x6acb('0x36')]))['where'](_0x6acb('0x34'),selectNotIn(_0x2bb665,_0x58f96d,_0x10849e,_0x6acb('0x29'),[_0x6acb('0x35')])))[_0x6acb('0x37')]();return _0x4e5eaa;}function insertTzCmHopperBlack(_0x38419a,_0x3c93d9,_0x1bfbfe,_0xa7eeaa){var _0x3b4549=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x3c93d9+'.'+_0xa7eeaa,_0x6acb('0x24'),'cm_contacts.updatedAt'];return squel['insert']()[_0x6acb('0x28')](_0x6acb('0x38'))['fromQuery'](['phone',_0x6acb('0x39'),_0x6acb('0x3a'),_0xa7eeaa,_0x6acb('0x2b'),'updatedAt'],squel[_0x6acb('0x2f')]()[_0x6acb('0x3b')](_0x3b4549)[_0x6acb('0x10')](_0x3c93d9)['join'](_0x6acb('0x30'),null,_0x6acb('0x31')+_0x3c93d9+_0x6acb('0x32'))[_0x6acb('0x11')](_0x1bfbfe,null,_0x1bfbfe+_0x6acb('0x3c')+_0x3c93d9+'.'+_0xa7eeaa)['where'](_0x3c93d9+'.CmListId\x20=\x20?',_0x38419a)[_0x6acb('0x12')](_0x6acb('0x3d'),NOW)['where'](_0x6acb('0x34'),squel['select']()[_0x6acb('0xe')](_0x6acb('0xf'))['from'](_0x6acb('0x38'))[_0x6acb('0x12')](_0x6acb('0x3e'),_0x38419a)[_0x6acb('0x12')](_0xa7eeaa+_0x6acb('0x13')+_0x3c93d9+'.'+_0xa7eeaa)))[_0x6acb('0x37')]();}function insertCmHopperAdditionalPhones(_0xb28adb){var _0x50b861=['cm_hopper.id',_0x6acb('0x42'),_0x6acb('0x43'),_0x6acb('0x44'),_0x6acb('0x45')];return squel[_0x6acb('0x27')]()[_0x6acb('0x28')](_0x6acb('0x46'))['fromQuery']([_0x6acb('0x47'),'phone',_0x6acb('0x48'),_0x6acb('0x2b'),_0x6acb('0x2c')],squel['select']()[_0x6acb('0x3b')](_0x50b861)[_0x6acb('0x10')](_0x6acb('0x29'))['join']('cm_contacts',null,_0x6acb('0x49'))['join'](_0x6acb('0x4a'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x6acb('0x12')](_0x6acb('0x4b'),_0xb28adb)['where'](_0x6acb('0x3d'),NOW))['toString']();}function insertCmContact(_0x5d7a2c,_0x2ef6f7,_0x587afb,_0x1f5997){var _0x379e78=_[_0x6acb('0x4c')](_[_0x6acb('0x4d')](_0x1f5997),['ListId',_0x6acb('0x4e'),_0x6acb('0x2b'),'updatedAt',_0x6acb('0x4f')]);return squel[_0x6acb('0x27')]()[_0x6acb('0x28')](_0x6acb('0x30'))['fromQuery'](_0x379e78,squel[_0x6acb('0x2f')]()[_0x6acb('0x3b')](_0x379e78)[_0x6acb('0x10')](_0x2ef6f7)[_0x6acb('0x12')]('('+_0x587afb['join'](',')+_0x6acb('0x50'),squel[_0x6acb('0x2f')]()[_0x6acb('0x3b')](_0x587afb)[_0x6acb('0x10')](_0x6acb('0x30'))[_0x6acb('0x12')](_0x6acb('0x3e'),_0x5d7a2c)[_0x6acb('0x12')](_0x6acb('0x51')))[_0x6acb('0x12')](_0x6acb('0x52'),squel[_0x6acb('0x2f')]()[_0x6acb('0xe')](_0x6acb('0x53'),_0x6acb('0x54'))[_0x6acb('0x10')](_0x2ef6f7)[_0x6acb('0x55')](_0x587afb['join'](','))))['toString']();}function handleStop(){logger[_0x6acb('0x56')](_0x6acb('0x57'));stopped=!![];}function handleUncaughtException(_0x3b58d6){logger[_0x6acb('0x58')](_0x3b58d6['message']);process[_0x6acb('0x59')](0x1);}function handleError(_0x36a8ca,_0x4b2469){stats[_0x6acb('0x5a')][_0x6acb('0x18')]({'name':_0x4b2469[_0x6acb('0x5b')],'message':_0x4b2469[_0x6acb('0x5c')],'row':_0x36a8ca});}function handleQuery(_0x32c225){logger[_0x6acb('0x56')](_0x32c225);return db[_0x6acb('0x5d')]['query'](_0x32c225)[_0x6acb('0x5e')](function(_0x2d3bbc){results[_0x6acb('0x18')](_0x2d3bbc);})[_0x6acb('0x5f')](function(_0x37ce61){logger[_0x6acb('0x58')](_0x37ce61[_0x6acb('0x5c')]);});}function updateTzCampaigns(_0x2eaca6){return new Promise(function(_0x7be535,_0x9a2d53){var _0x40c013=squel[_0x6acb('0x2f')]()[_0x6acb('0x3b')]([_0x6acb('0x60'),_0x6acb('0x61')])[_0x6acb('0x10')]('campaigns')[_0x6acb('0x11')](_0x6acb('0x62'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x6acb('0x12')](_0x6acb('0x63')+_0x2eaca6);db[_0x6acb('0x5d')][_0x6acb('0x64')](_0x40c013[_0x6acb('0x37')]())[_0x6acb('0x5e')](function(_0x428c92){var _0x1a87bf=[];for(var _0x43d97f=0x0;_0x43d97f<_0x428c92[_0x6acb('0x17')];_0x43d97f++){_0x1a87bf[_0x6acb('0x18')](getTimezoneData(_0x428c92[_0x43d97f],tmp_campaigns));}BPromise[_0x6acb('0x1a')](_0x1a87bf)[_0x6acb('0x16')](function(){_0x7be535({'val':0x1});});})[_0x6acb('0x5f')](function(_0x1d73a7){logger[_0x6acb('0x58')](_0x1d73a7[_0x6acb('0x5c')]);_0x7be535({'val':0x0});});});}function updateTzVoiceQueues(_0x5ea153){return new Promise(function(_0x5c4d02,_0x2ad5bd){var _0x10f54f=squel[_0x6acb('0x2f')]()[_0x6acb('0x3b')]([_0x6acb('0x65'),_0x6acb('0x66')])[_0x6acb('0x10')](_0x6acb('0x67'))['join']('voice_queues_has_cm_lists',null,_0x6acb('0x68'))[_0x6acb('0x12')](_0x6acb('0x69')+_0x5ea153);db[_0x6acb('0x5d')][_0x6acb('0x64')](_0x10f54f[_0x6acb('0x37')]())['spread'](function(_0x5e99c7){var _0x2dd20f=[];for(var _0x2bff82=0x0;_0x2bff82<_0x5e99c7[_0x6acb('0x17')];_0x2bff82++){_0x2dd20f['push'](getTimezoneData(_0x5e99c7[_0x2bff82],tmp_voice_queues));}BPromise['all'](_0x2dd20f)[_0x6acb('0x16')](function(){_0x5c4d02({'val':0x1});});})[_0x6acb('0x5f')](function(_0x26d40){logger[_0x6acb('0x58')](_0x26d40[_0x6acb('0x5c')]);_0x5c4d02({'val':0x0});});});}function getTimezoneData(_0x567952,_0x567ce5){return new Promise(function(_0x578c3e,_0xdac5f4){var _0x341262=shared[_0x6acb('0x6a')];var _0x2b89be=_0x341262[_0x567952['dialTimezone']];if(_['isNil'](_0x2b89be)){_0x578c3e({'ret':0x1});}else{var _0x29d55c=_0x2b89be[_0x6acb('0x6b')];var _0x5ca004=squel[_0x6acb('0x27')]()[_0x6acb('0x28')](_0x567ce5)[_0x6acb('0x6c')]('id',_0x567952['id'])['set'](_0x6acb('0x6d'),_0x29d55c)[_0x6acb('0x6c')](_0x6acb('0x6e'),_0x567952[_0x6acb('0x6e')])['toString']();return db[_0x6acb('0x5d')]['query'](_0x5ca004)[_0x6acb('0x5e')](function(_0x568ca2){_0x578c3e({'ret':0x1});})[_0x6acb('0x5f')](function(_0x4000a2){logger['error'](_0x4000a2[_0x6acb('0x5c')]);_0xdac5f4({'ret':0x1});});}});}function handleTZQuery(_0x3a35a8){logger['info'](_0x3a35a8);return db[_0x6acb('0x5d')][_0x6acb('0x64')](_0x3a35a8)['spread'](function(_0x244432){})['catch'](function(_0xf52332){logger['error'](_0xf52332[_0x6acb('0x5c')]);});}function main(_0x274c3e,_0xc04dc0,_0x3182db,_0x46bd31){logger[_0x6acb('0x56')](_0x6acb('0x6f'),_0x274c3e,JSON[_0x6acb('0x70')](_0xc04dc0));process[_0x6acb('0x71')](_0x6acb('0x72'));var _0x52a8d9=_0xc04dc0[_0x6acb('0x73')];var _0x26d099=_[_0x6acb('0x74')](_0x52a8d9);var _0x1ab382=_0xc04dc0[_0x6acb('0x75')];var _0x1f48ef=path['join'](config[_0x6acb('0x76')],_0x6acb('0x77'),_0x1ab382+_0x6acb('0x78'));hasTZ=_[_0x6acb('0x4d')](_0x52a8d9)[_0x6acb('0x79')](_0x6acb('0x6e'));var _0x475dd4=_['keys'](_0x52a8d9)[_0x6acb('0x11')]();logger[_0x6acb('0x56')](_0x6acb('0x7a'),_0x475dd4);db[_0x6acb('0x7b')]['findAll']({'raw':!![],'attributes':['id',_0x6acb('0x7c')]})[_0x6acb('0x16')](function(_0x97a1a8){for(var _0x21fc3b=0x0;_0x21fc3b<_0x97a1a8['length'];_0x21fc3b++){if(_0x97a1a8[_0x21fc3b]['name']in _0x52a8d9){contactItemTypes['push'](_0x97a1a8[_0x21fc3b]);delete _0x26d099[_0x97a1a8[_0x21fc3b][_0x6acb('0x7c')]];hasAdditionalPhones=!![];}for(var _0x4ee1fd in _0x52a8d9){if(_0x97a1a8[_0x21fc3b]['name']+_0x6acb('0x7d')===_0x4ee1fd){phoneDescriptions[_0x6acb('0x18')]({'itemTypeId':_0x97a1a8[_0x21fc3b]['id'],'description':_0x4ee1fd});delete _0x26d099[_0x4ee1fd];}}}if(hasAdditionalPhones)_0x26d099[_0x6acb('0x15')]='';var _0x26a52a=_[_0x6acb('0x4d')](_0x26d099)[_0x6acb('0x11')]();logger['info']('header',_0x26a52a);fs[_0x6acb('0x7e')](_0x1f48ef,_0x26a52a+'\x0a');Papa[_0x6acb('0x7f')](fs['createReadStream'](_0x274c3e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5be292,_0x238779){try{for(var _0xc8b971=0x0,_0x16b73e=[];_0xc8b971<_0x5be292[_0x6acb('0x80')][_0x6acb('0x17')];_0xc8b971++){stats[_0x6acb('0x81')]+=0x1;if(_0x5be292[_0x6acb('0x5a')][_0xc8b971]){handleError(_0x5be292[_0x6acb('0x80')][_0xc8b971],_0x5be292[_0x6acb('0x5a')][_0xc8b971]);}else{var _0x3f4918=[];var _0x47e09d=[];var _0x46a440={};for(var _0x1301ed in _0x52a8d9){let _0xa6d3c8=contactItemTypes[_0x6acb('0x82')](_0x485d09=>_0x485d09[_0x6acb('0x7c')]===_0x1301ed);let _0x5ebda9=contactItemTypes[_0x6acb('0x82')](_0x305a37=>_0x305a37[_0x6acb('0x7c')]+'_description'===_0x1301ed);if(_[_0x6acb('0x83')](_0xa6d3c8)&&_[_0x6acb('0x83')](_0x5ebda9)){if(_0x52a8d9[_0x6acb('0x84')](_0x1301ed)){if(_0x5be292[_0x6acb('0x80')][_0xc8b971][_0x52a8d9[_0x1301ed]]){var _0x397d31=_[_0x6acb('0x85')](_0x5be292[_0x6acb('0x80')][_0xc8b971][_0x52a8d9[_0x1301ed]][_0x6acb('0x86')](/"/g,'\x27'));switch(_0x1301ed){case _0x6acb('0x87'):var _0x33dfb0=moment(_0x397d31,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x33dfb0['isValid']()){_0x16b73e['push']('\x22'+_0x397d31+'\x22');}else{_0x3f4918['push'](_0x6acb('0x88'));}break;case _0x6acb('0x41'):var _0x4ebdba=parseInt(_0x397d31);_0x397d31=_[_0x6acb('0x89')](_0x4ebdba)||_0x4ebdba<0x0||_0x4ebdba>0x4?_0x46bd31?0x3:0x2:_0x4ebdba;_0x16b73e[_0x6acb('0x18')]('\x22'+_0x397d31+'\x22');break;case'UserId':var _0x559ec3=parseInt(_0x397d31);if(_[_0x6acb('0x8a')](_0x559ec3)&&_[_0x6acb('0x79')](_0x3182db,_0x559ec3)){_0x16b73e[_0x6acb('0x18')]('\x22'+_0x559ec3+'\x22');}else{_0x3f4918[_0x6acb('0x18')](_0x6acb('0x8b'));}break;case _0x6acb('0x8c'):if(isEmail(_0x397d31)){_0x16b73e[_0x6acb('0x18')]('\x22'+_0x397d31+'\x22');}else{_0x3f4918[_0x6acb('0x18')](_0x6acb('0x8d'));}break;case _0x6acb('0x8e'):var _0x4380aa=moment(_0x397d31,_0x6acb('0x8f'),!![]);if(_0x4380aa[_0x6acb('0x90')]()){_0x16b73e[_0x6acb('0x18')]('\x22'+_0x397d31+'\x22');}else{_0x3f4918[_0x6acb('0x18')](_0x6acb('0x91'));}break;case _0x6acb('0x6e'):var _0x375b71=shared[_0x6acb('0x6a')];var _0x32c7e8=_0x375b71[_0x397d31];if(!_[_0x6acb('0x83')](_0x32c7e8)){var _0x2d67ce=_0x32c7e8['utcOffset'];_0x16b73e[_0x6acb('0x18')]('\x22'+_0x397d31+'\x22');_0x16b73e[_0x6acb('0x18')]('\x22'+_0x2d67ce+'\x22');}break;default:_0x16b73e[_0x6acb('0x18')]('\x22'+_0x397d31+'\x22');}}else{switch(_0x1301ed){case _0x6acb('0x92'):case _0x6acb('0xf'):_0x3f4918[_0x6acb('0x18')](_0x1301ed+'\x20not\x20specified');break;default:_0x16b73e['push']('\x22\x22');}}}}else{var _0xa6609b='';if(!_[_0x6acb('0x83')](_0xa6d3c8)){if(!_0x46a440[_0x6acb('0x84')](_0xa6d3c8['id'])){if(!_[_0x6acb('0x83')](_0x5be292[_0x6acb('0x80')][_0xc8b971][_0x52a8d9[_0x1301ed]])){var _0x397d31=_[_0x6acb('0x85')](_0x5be292[_0x6acb('0x80')][_0xc8b971][_0x52a8d9[_0x1301ed]][_0x6acb('0x86')](/"/g,'\x27'));var _0x414744=phoneDescriptions[_0x6acb('0x82')](_0x26f0dc=>_0x26f0dc[_0x6acb('0x93')]===_0xa6d3c8['id']);if(!_[_0x6acb('0x83')](_0x414744)){var _0x160879=_[_0x6acb('0x85')](_0x5be292[_0x6acb('0x80')][_0xc8b971][_0x52a8d9[_0x414744['description']]][_0x6acb('0x86')](/"/g,'\x27'));if(!_['isNil'](_0x160879))_0x397d31=_0x397d31+'§'+_0x160879;}if(_0xa6609b=='')_0xa6609b=_0x397d31;else _0xa6609b+='|'+_0x397d31;}_0x47e09d[_0x6acb('0x18')](_0xa6d3c8['id']+':'+_0xa6609b);_0x46a440[_0xa6d3c8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x16b73e[_0x6acb('0x18')]('\x22'+_0x47e09d[_0x6acb('0x11')](';')+'\x22');}if(_0x3f4918[_0x6acb('0x17')]){handleError(_0x5be292[_0x6acb('0x80')][_0xc8b971],{'code':_0x6acb('0x94'),'message':_0x3f4918[_0x6acb('0x11')]()});}else{fs['appendFileSync'](_0x1f48ef,_0x16b73e[_0x6acb('0x11')]()+'\x0a');}_0x16b73e=[];}if(!(stats[_0x6acb('0x81')]%0xc8)){socket[_0x6acb('0x95')](_0x6acb('0x96')+_0x1ab382,stats);stats[_0x6acb('0x5a')]=[];}}if(stopped){logger['info'](_0x6acb('0x97'));_0x238779[_0x6acb('0x98')]();}}catch(_0x4cdef9){handleError(_0x5be292[_0x6acb('0x80')][_0xc8b971],{'code':_0x6acb('0x99'),'message':_0x4cdef9['message']});logger['error']('step',_0x4cdef9[_0x6acb('0x5c')]);}},'complete':function(){try{var _0x27bb28=[];var _0x3f8b7f=[];var _0x1b21df='cm_contacts';if(_0xc04dc0[_0x6acb('0x9a')]&&_0xc04dc0[_0x6acb('0x9a')][_0x6acb('0x17')]){_0x1b21df=_0x6acb('0x9b')+_0x1ab382;_0x27bb28['push'](_0x6acb('0x9c')+_0x1b21df+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x6acb('0x9d')+_0x1ab382;tmp_voice_queues=_0x6acb('0x9e')+_0x1ab382;_0x3f8b7f[_0x6acb('0x18')](_0x6acb('0x9c')+tmp_campaigns+_0x6acb('0x9f'));_0x3f8b7f[_0x6acb('0x18')](_0x6acb('0x9c')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x3f8b7f,handleTZQuery)[_0x6acb('0x16')](function(_0x11cdab){updateTzCampaigns(_0xc04dc0[_0x6acb('0x3a')])[_0x6acb('0x16')](function(_0x4ced01){updateTzVoiceQueues(_0xc04dc0['ListId'])[_0x6acb('0x16')](function(_0x510ab5){if(hasTZ)_0x26a52a=_0x26a52a['replace'](_0x6acb('0x6e'),'dialTimezone,utcOffset');var _0x416351=util[_0x6acb('0xc')](_0x6acb('0xa0'),_0x1f48ef,_0x1b21df,_0x26a52a,_0xc04dc0['ListId'],_0xc04dc0['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x52a8d9[_0x6acb('0x87')])){_0x416351+=_0x6acb('0xa1');}_0x27bb28[_0x6acb('0x18')](_0x416351);if(_0xc04dc0[_0x6acb('0x9a')]&&_0xc04dc0[_0x6acb('0x9a')][_0x6acb('0x17')]){_0x27bb28['push'](insertCmContact(_0xc04dc0[_0x6acb('0x3a')],_0x1b21df,_0xc04dc0['duplicates'],_0x52a8d9));_0x27bb28[_0x6acb('0x18')](_0x6acb('0xa2')+_0x1b21df+';');}BPromise[_0x6acb('0xa3')](_0x27bb28,handleQuery)[_0x6acb('0x16')](function(_0x3bf7cd){BPromise[_0x6acb('0x1a')]([handleAdditionalPhones()])['then'](function(){_0x27bb28=[];for(var _0x5a4672=0x0;_0x5a4672_0x177cc0[_0x357c('0x6f')]===_0x1b6b4f);let _0x2673da=contactItemTypes[_0x357c('0x74')](_0x4f3260=>_0x4f3260[_0x357c('0x6f')]+_0x357c('0x70')===_0x1b6b4f);if(_['isNil'](_0x55a8c9)&&_['isNil'](_0x2673da)){if(_0x284341['hasOwnProperty'](_0x1b6b4f)){if(_0x2979bb[_0x357c('0x72')][_0x2e2490][_0x284341[_0x1b6b4f]]){var _0x370be2=_['trim'](_0x2979bb[_0x357c('0x72')][_0x2e2490][_0x284341[_0x1b6b4f]]['replace'](/"/g,'\x27'));switch(_0x1b6b4f){case _0x357c('0x35'):var _0x2dfa72=moment(_0x370be2,_0x357c('0xd'),!![]);if(_0x2dfa72[_0x357c('0x75')]()){_0x3b9e3f[_0x357c('0x1d')]('\x22'+_0x370be2+'\x22');}else{_0x5e66a3[_0x357c('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x357c('0x39'):var _0x60c790=parseInt(_0x370be2);_0x370be2=_['isNaN'](_0x60c790)||_0x60c790<0x0||_0x60c790>0x4?_0x166e50?0x3:0x2:_0x60c790;_0x3b9e3f[_0x357c('0x1d')]('\x22'+_0x370be2+'\x22');break;case _0x357c('0x3a'):var _0xdf8b3a=parseInt(_0x370be2);if(_['isNumber'](_0xdf8b3a)&&_[_0x357c('0x76')](_0x346deb,_0xdf8b3a)){_0x3b9e3f[_0x357c('0x1d')]('\x22'+_0xdf8b3a+'\x22');}else{_0x5e66a3['push']('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x370be2)){_0x3b9e3f[_0x357c('0x1d')]('\x22'+_0x370be2+'\x22');}else{_0x5e66a3[_0x357c('0x1d')](_0x357c('0x77'));}break;case _0x357c('0x78'):var _0x1f78fa=moment(_0x370be2,_0x357c('0x79'),!![]);if(_0x1f78fa[_0x357c('0x75')]()){_0x3b9e3f[_0x357c('0x1d')]('\x22'+_0x370be2+'\x22');}else{_0x5e66a3[_0x357c('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x3b9e3f[_0x357c('0x1d')]('\x22'+_0x370be2+'\x22');}}else{switch(_0x1b6b4f){case _0x357c('0x7a'):case'phone':_0x5e66a3['push'](_0x1b6b4f+_0x357c('0x7b'));break;default:_0x3b9e3f[_0x357c('0x1d')]('\x22\x22');}}}}else{var _0x522eb4='';if(!_[_0x357c('0x1b')](_0x55a8c9)){if(!_0x2c8cf8[_0x357c('0x7c')](_0x55a8c9['id'])){for(var _0x3f1748=0x0;_0x3f1748<_0x284341[_0x1b6b4f][_0x357c('0x1a')];_0x3f1748++){var _0x370be2=_[_0x357c('0x7d')](_0x2979bb[_0x357c('0x72')][_0x2e2490][_0x284341[_0x1b6b4f][_0x3f1748]][_0x357c('0x7e')](/"/g,'\x27'));var _0x1451ba=phoneDescriptions['find'](_0x8b1d6a=>_0x8b1d6a['itemTypeId']===_0x55a8c9['id']);if(!_[_0x357c('0x1b')](_0x1451ba)){var _0x148b4f=_[_0x357c('0x7d')](_0x2979bb['data'][_0x2e2490][_0x284341[_0x1451ba['description']][0x0]][_0x357c('0x7e')](/"/g,'\x27'));if(!_[_0x357c('0x1b')](_0x148b4f))_0x370be2=_0x370be2+'§'+_0x148b4f;}if(_0x522eb4=='')_0x522eb4=_0x370be2;else _0x522eb4+='|'+_0x370be2;}_0x219a7e[_0x357c('0x1d')](_0x55a8c9['id']+':'+_0x522eb4);_0x2c8cf8[_0x55a8c9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3b9e3f[_0x357c('0x1d')]('\x22'+_0x219a7e[_0x357c('0x13')](';')+'\x22');}if(_0x5e66a3[_0x357c('0x1a')]){handleError(_0x2979bb['data'][_0x2e2490],{'code':_0x357c('0x7f'),'message':_0x5e66a3[_0x357c('0x13')]()});}else{fs[_0x357c('0x80')](_0x1abb73,_0x3b9e3f['join']()+'\x0a');}_0x3b9e3f=[];}if(!(stats[_0x357c('0x73')]%0xc8)){socket[_0x357c('0x81')]('contact:import:'+_0x460729,stats);stats[_0x357c('0x62')]=[];}}if(stopped){logger[_0x357c('0x5e')](_0x357c('0x82'));_0xed9b40[_0x357c('0x83')]();}}catch(_0x8506dc){handleError(_0x2979bb[_0x357c('0x72')][_0x2e2490],{'code':_0x357c('0x84'),'message':_0x8506dc[_0x357c('0x60')]});logger['error'](_0x357c('0x85'),_0x8506dc[_0x357c('0x60')]);}},'complete':function(){try{var _0x260893=[];var _0x479eb5=tempTableName;_0x260893[_0x357c('0x1d')](_0x357c('0x86')+_0x479eb5+'\x20LIKE\x20cm_contacts;');logger[_0x357c('0x5e')]('CIS\x20len',contactItemTypes[_0x357c('0x1a')]);var _0x502ebd=util[_0x357c('0xc')](_0x357c('0x87'),_0x1abb73,_0x479eb5,_0x347ff9,_0x40e0d0[_0x357c('0x36')],_0x40e0d0[_0x357c('0x59')]||null,NOW,NOW);if(_['isNil'](_0x284341[_0x357c('0x35')])){_0x502ebd+=_0x357c('0x88');}_0x260893[_0x357c('0x1d')](_0x502ebd);BPromise[_0x357c('0x89')](_0x260893,handleQuery)[_0x357c('0x1f')](function(_0x367b0d){BPromise[_0x357c('0x1e')]([handleAdditionalPhones()])[_0x357c('0x1f')](function(){_0x260893=[];for(var _0x33c64c=0x0;_0x33c64c\x20\x20');}var _0x29f798=path[_0x357c('0x13')](config['root'],'server/files/tmp',process[_0x357c('0x92')][0x2]);if(!fs[_0x357c('0x93')](_0x29f798)){throw new Error(_0x357c('0x94'));}var _0x11e12d={};try{_0x11e12d=JSON['parse'](process[_0x357c('0x92')][0x3]);if(!_0x11e12d[_0x357c('0x67')]){throw new Error(_0x357c('0x95'));}var _0x1dfd40=0x0;if(_0x11e12d[_0x357c('0x67')][_0x357c('0x3a')]){_0x1dfd40=0x1;}if(!_0x11e12d[_0x357c('0x36')]){throw new Error(_0x357c('0x96'));}}catch(_0xf58812){throw new Error('body\x20id\x20mandatory');}var _0x5a7a75=[];try{_0x5a7a75=_[_0x357c('0x97')](JSON[_0x357c('0x71')](process[_0x357c('0x92')][0x4]),'id');}catch(_0xca20a0){logger['info'](_0x357c('0x98'));}main(_0x29f798,_0x11e12d,_0x5a7a75,_0x1dfd40);}validate();process['on'](_0x357c('0x99'),handleStop);process['on'](_0x357c('0x9a'),handleUncaughtException); \ No newline at end of file +var _0x2200=['stringify','send','start','binding','clone','socket_timestamp','body','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','errors','find','hasOwnProperty','trim','isValid','isNaN','UserId','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','replace','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','contactId','contactTypeId','each','affectedRows','unlink','exit','complete','argv','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','catch','error','message','then','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','CmContact','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','cm_contacts','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','fields','from','cm_contacts.ListId\x20=\x20','cm_hopper_black','ListId\x20=\x20?','\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','updatedAt','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','group','Received\x20SIGINT','code','info','main'];(function(_0x12c289,_0x3376b8){var _0x9e28d5=function(_0x33cb58){while(--_0x33cb58){_0x12c289['push'](_0x12c289['shift']());}};_0x9e28d5(++_0x3376b8);}(_0x2200,0x17b));var _0x0220=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x2200[_0x587fb5];return _0x551105;};'use strict';var fs=require('fs');var path=require(_0x0220('0x0'));var _=require(_0x0220('0x1'));var Papa=require('papaparse');var util=require(_0x0220('0x2'));var BPromise=require(_0x0220('0x3'));var moment=require(_0x0220('0x4'));var squel=require('squel');var Redis=require(_0x0220('0x5'));var db=require(_0x0220('0x6'))['db'];var config=require(_0x0220('0x7'));var logger=require(_0x0220('0x8'))(_0x0220('0x9'));config['redis']=_['defaults'](config[_0x0220('0xa')],{'host':_0x0220('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0220('0xa')]));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()[_0x0220('0xc')](_0x0220('0xd'));var tempTableName='cm_contacts_temp_'+moment()[_0x0220('0xc')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xc9dcdf){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))*$/[_0x0220('0xe')](_0xc9dcdf);}function selectNotIn(_0x55f2b3,_0x7d357,_0x178821,_0x2cdf8f,_0x5c6fbe){return squel[_0x0220('0xf')]()[_0x0220('0x10')](_0x0220('0x11'))['from'](_0x2cdf8f)['join'](_0x7d357,null,_0x7d357+'.id\x20=\x20'+_0x2cdf8f+'.'+_0x178821)[_0x0220('0x12')](_0x2cdf8f+'.'+_0x178821+_0x0220('0x13')+_0x55f2b3+'.'+_0x178821)[_0x0220('0x12')](_0x7d357+_0x0220('0x14')+_0x5c6fbe[_0x0220('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x589e75,_0x45ec69){promisesAdditionalPhones=[];promisesContact=[];return db[_0x0220('0x16')][_0x0220('0x17')](_0x0220('0x18')+tempTableName)[_0x0220('0x19')](function(_0x56e7ee){if(_0x56e7ee!==null){var _0x2bc4a2=[];for(var _0x522cbe=0x0;_0x522cbe<_0x56e7ee[_0x0220('0x1a')];_0x522cbe++){var _0x5b3fcd=_0x56e7ee[_0x522cbe];if(!_[_0x0220('0x1b')](_0x5b3fcd[_0x0220('0x11')])){if(!_[_0x0220('0x1b')](_0x5b3fcd[_0x0220('0x1c')]))_0x2bc4a2[_0x0220('0x1d')](insertAdditionalPhones(_0x5b3fcd));promisesContact[_0x0220('0x1d')]({'contact':_0x5b3fcd});}}}Promise[_0x0220('0x1e')](_0x2bc4a2)['then'](function(){_0x589e75({'val':0x1});});})[_0x0220('0x1f')](function(_0x457d22){logger[_0x0220('0x20')](_0x457d22[_0x0220('0x21')]);});});}function insertAdditionalPhones(_0x324976){return new Promise(function(_0x58f82e,_0x4b9ef3){var _0x5d0b4d=_0x324976[_0x0220('0x1c')];if(_[_0x0220('0x1b')](_0x5d0b4d))_0x4b9ef3({'val':0x0});else{var _0x3da5f8=_0x5d0b4d['split'](';');var _0x58fbf5=[];orderBy=0x0;for(var _0x53145c=0x0;_0x53145c<_0x3da5f8[_0x0220('0x1a')];_0x53145c++){_0x58fbf5[_0x0220('0x1d')](splitAdditionalPhone(_0x324976['id'],_0x3da5f8[_0x53145c]));}Promise[_0x0220('0x1e')](_0x58fbf5)[_0x0220('0x22')](function(){_0x58f82e({'val':_0x3da5f8['length']});});}});}function splitAdditionalPhone(_0x2e4b3c,_0x40a0f9){return new Promise(function(_0x1e2829,_0x46443a){var _0x2097f8=_0x40a0f9[_0x0220('0x23')](':');var _0x4030dc=_0x2097f8[0x0];var _0x40ef1d=_0x2097f8[0x1];if(_0x40ef1d!==''){var _0x140645=_0x40ef1d['split']('|');var _0x419689=[];for(var _0x220fdf=0x0;_0x220fdf<_0x140645['length'];_0x220fdf++){if(_0x140645[_0x220fdf]!==''){var _0x45c394=_[_0x0220('0x24')](promisesAdditionalPhones,{'contactId':_0x2e4b3c,'phone':_0x140645[_0x220fdf]});if(_0x45c394['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2e4b3c,'contactTypeId':_0x4030dc,'phone':_0x140645[_0x220fdf],'orderBy':orderBy});}}}_0x1e2829({'ok':0x1});}else _0x1e2829({'res':0x0});});}function createAdditionalPhone(_0x660e26,_0x2def48,_0x2ef452,_0x41c64a){var _0x16ed46='';var _0x53bb82='';var _0x276a63=_0x2ef452['split']('§');_0x16ed46=_0x276a63[0x0];if(_0x276a63[_0x0220('0x1a')]==0x2)_0x53bb82=_0x276a63[0x1];return new Promise(function(_0x1f6e52,_0x28f8d2){return db[_0x0220('0x25')][_0x0220('0x26')]({'where':{'CmContactId':_0x660e26,'item':_0x16ed46}})[_0x0220('0x22')](function(_0x13a6e3){if(_0x13a6e3){return db['CmContactHasItem'][_0x0220('0x27')]({'ItemTypeId':_0x2def48,'description':_0x53bb82,'OrderBy':_0x41c64a},{'where':{'CmContactId':_0x660e26,'item':_0x16ed46}})[_0x0220('0x22')](function(_0xdc6f49){_0x1f6e52({'res':_0x0220('0x28')});});}else{return db['CmContactHasItem'][_0x0220('0x29')]({'CmContactId':_0x660e26,'item':_0x16ed46,'ItemTypeId':_0x2def48,'description':_0x53bb82,'OrderBy':_0x41c64a,'ItemClass':_0x0220('0x2a')})['then'](function(_0xa2b7d7){_0x1f6e52({'res':'inserted'});});}});});}function updateContact(_0xd18a93){return new Promise(function(_0x1cb9a5,_0x388f4f){var _0x4645b9=_0xd18a93['id'];delete _0xd18a93['id'];return db[_0x0220('0x2b')]['update'](_0xd18a93,{'where':{'id':_0x4645b9}})[_0x0220('0x22')](function(_0x443e5c){updatedRows+=0x1;return db['CmHopper'][_0x0220('0x27')]({'phone':_0xd18a93['phone']},{'where':{'ContactId':_0x4645b9}})[_0x0220('0x22')](function(_0x48d795){_0x1cb9a5({'ret':'OK'});});});});}function insertCmHopper(_0x2727bb,_0xb3ab5f,_0x2da816,_0x2ac8d3,_0x94cf81){var _0x50f452=['cm_contacts.phone',_0x0220('0x2c'),_0x0220('0x2d'),_0x0220('0x2e'),_0xb3ab5f+'.'+_0x2ac8d3,_0x0220('0x2f'),_0x0220('0x30'),_0x0220('0x31'),_0x0220('0x32'),'\x22'+_0x94cf81+'\x22'];return squel[_0x0220('0x33')]()[_0x0220('0x34')](_0x0220('0x35'))[_0x0220('0x36')]([_0x0220('0x11'),_0x0220('0x37'),_0x0220('0x38'),_0x0220('0x39'),_0x2ac8d3,_0x0220('0x3a'),'updatedAt',_0x0220('0x3b'),'UserId','recallme'],squel['select']()['fields'](_0x50f452)['from'](_0xb3ab5f)[_0x0220('0x15')](_0x0220('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0xb3ab5f+_0x0220('0x3d'))[_0x0220('0x15')](_0x2da816,null,_0x2da816+_0x0220('0x3e')+_0xb3ab5f+'.'+_0x2ac8d3)[_0x0220('0x12')](_0xb3ab5f+'.CmListId\x20=\x20?',_0x2727bb)[_0x0220('0x12')](_0x0220('0x3f'),NOW)[_0x0220('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xb3ab5f,_0x2da816,_0x2ac8d3,_0x0220('0x35'),[_0x0220('0x40'),_0x0220('0x41')]))['where'](_0x0220('0x42'),selectNotIn(_0xb3ab5f,_0x2da816,_0x2ac8d3,_0x0220('0x35'),[_0x0220('0x40')])))[_0x0220('0x43')]();}function insertCmHopperBlack(_0x4fc4fd,_0x4a18f0,_0x19e2e5,_0x344b6e){var _0x2a5548=[_0x0220('0x44'),_0x0220('0x2d'),_0x0220('0x2e'),_0x4a18f0+'.'+_0x344b6e,_0x0220('0x2f'),_0x0220('0x30')];return squel['insert']()[_0x0220('0x34')]('cm_hopper_black')[_0x0220('0x36')]([_0x0220('0x11'),_0x0220('0x38'),_0x0220('0x39'),_0x344b6e,_0x0220('0x3a'),'updatedAt'],squel[_0x0220('0xf')]()[_0x0220('0x45')](_0x2a5548)[_0x0220('0x46')](_0x4a18f0)[_0x0220('0x15')](_0x0220('0x3c'),null,_0x0220('0x47')+_0x4a18f0+_0x0220('0x3d'))[_0x0220('0x15')](_0x19e2e5,null,_0x19e2e5+_0x0220('0x3e')+_0x4a18f0+'.'+_0x344b6e)[_0x0220('0x12')](_0x4a18f0+'.CmListId\x20=\x20?',_0x4fc4fd)[_0x0220('0x12')](_0x0220('0x3f'),NOW)[_0x0220('0x12')](_0x0220('0x42'),squel[_0x0220('0xf')]()[_0x0220('0x10')](_0x0220('0x11'))['from'](_0x0220('0x48'))[_0x0220('0x12')](_0x0220('0x49'),_0x4fc4fd)[_0x0220('0x12')](_0x344b6e+_0x0220('0x4a'),_0x4a18f0+'.'+_0x344b6e)))[_0x0220('0x43')]();}function insertCmHopperAdditionalPhones(_0xe40685){var _0xe5efb3=['cm_hopper.id',_0x0220('0x4b'),_0x0220('0x4c'),_0x0220('0x4d'),_0x0220('0x4e')];return squel['insert']()[_0x0220('0x34')](_0x0220('0x4f'))['fromQuery']([_0x0220('0x50'),_0x0220('0x11'),_0x0220('0x51'),_0x0220('0x3a'),_0x0220('0x52')],squel[_0x0220('0xf')]()[_0x0220('0x45')](_0xe5efb3)['from'](_0x0220('0x35'))[_0x0220('0x15')](_0x0220('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x0220('0x15')](_0x0220('0x53'),null,_0x0220('0x54'))[_0x0220('0x12')](_0x0220('0x55'),_0xe40685)['where'](_0x0220('0x3f'),NOW))[_0x0220('0x43')]();}function insertCmContact(_0x157e7a,_0x4a4b3b,_0x29e97e,_0x583541){var _0x354cb7=_[_0x0220('0x56')](_['keys'](_0x583541),[_0x0220('0x39'),_0x0220('0x57'),_0x0220('0x3a'),_0x0220('0x52')]);return squel[_0x0220('0x33')]()['into'](_0x0220('0x3c'))[_0x0220('0x36')](_0x354cb7,squel['select']()[_0x0220('0x45')](_0x354cb7)['from'](_0x4a4b3b)[_0x0220('0x12')]('('+_0x29e97e[_0x0220('0x15')](',')+_0x0220('0x58'),squel['select']()['fields'](_0x29e97e)['from'](_0x0220('0x3c'))[_0x0220('0x12')]('ListId\x20=\x20?',_0x157e7a))[_0x0220('0x12')](_0x0220('0x59'),squel['select']()[_0x0220('0x10')]('MIN(id)','min_id')[_0x0220('0x46')](_0x4a4b3b)[_0x0220('0x5a')](_0x29e97e[_0x0220('0x15')](','))))[_0x0220('0x43')]();}function handleStop(){logger['info'](_0x0220('0x5b'));stopped=!![];}function handleUncaughtException(_0x52f607){logger[_0x0220('0x20')](_0x52f607['message']);process['exit'](0x1);}function handleError(_0x84a698,_0x220e3b){stats['errors'][_0x0220('0x1d')]({'name':_0x220e3b[_0x0220('0x5c')],'message':_0x220e3b[_0x0220('0x21')],'row':_0x84a698});}function handleQuery(_0xa4859){logger[_0x0220('0x5d')](_0xa4859);return db[_0x0220('0x16')][_0x0220('0x17')](_0xa4859)[_0x0220('0x19')](function(_0x51a4e5){results[_0x0220('0x1d')](_0x51a4e5);})[_0x0220('0x1f')](function(_0x2cc298){logger['error'](_0x2cc298[_0x0220('0x21')]);});}function main(_0x599acc,_0x5db462,_0x174df6,_0x33cc3f){logger[_0x0220('0x5d')](_0x0220('0x5e'),_0x599acc,JSON[_0x0220('0x5f')](_0x5db462));process[_0x0220('0x60')](_0x0220('0x61'));var _0x401a67=_0x5db462[_0x0220('0x62')];var _0x3c771c=_[_0x0220('0x63')](_0x401a67);var _0x10f766=_0x5db462[_0x0220('0x64')];var _0x4d8e3a=path['join'](config['root'],'server/files/tmp',_0x10f766+'.csv');logger['info'](_0x0220('0x65'),_0x5db462);db['ContactItemType'][_0x0220('0x66')]({'raw':!![],'attributes':['id',_0x0220('0x67')]})[_0x0220('0x22')](function(_0xe03fdf){for(var _0x2c39ba=0x0;_0x2c39ba<_0xe03fdf['length'];_0x2c39ba++){if(_0xe03fdf[_0x2c39ba][_0x0220('0x67')]in _0x401a67){contactItemTypes[_0x0220('0x1d')](_0xe03fdf[_0x2c39ba]);delete _0x3c771c[_0xe03fdf[_0x2c39ba][_0x0220('0x67')]];hasAdditionalPhones=!![];}for(var _0x56f160 in _0x401a67){if(_0xe03fdf[_0x2c39ba][_0x0220('0x67')]+_0x0220('0x68')===_0x56f160){phoneDescriptions[_0x0220('0x1d')]({'itemTypeId':_0xe03fdf[_0x2c39ba]['id'],'description':_0x56f160});delete _0x3c771c[_0x56f160];}}}if(hasAdditionalPhones)_0x3c771c[_0x0220('0x1c')]='';var _0x105cf8=_['keys'](_0x3c771c)[_0x0220('0x15')]();logger[_0x0220('0x5d')](_0x0220('0x69'),_0x105cf8);fs[_0x0220('0x6a')](_0x4d8e3a,_0x105cf8+'\x0a');Papa[_0x0220('0x6b')](fs[_0x0220('0x6c')](_0x599acc),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf17db0,_0x5209f8){try{for(var _0x34db87=0x0,_0x146259=[];_0x34db87<_0xf17db0[_0x0220('0x6d')][_0x0220('0x1a')];_0x34db87++){stats['rows']+=0x1;if(_0xf17db0[_0x0220('0x6e')][_0x34db87]){handleError(_0xf17db0[_0x0220('0x6d')][_0x34db87],_0xf17db0[_0x0220('0x6e')][_0x34db87]);}else{var _0x5bc606=[];var _0x59ce48=[];var _0x5746bb={};for(var _0x530943 in _0x401a67){let _0xb10347=contactItemTypes[_0x0220('0x6f')](_0x5ee237=>_0x5ee237[_0x0220('0x67')]===_0x530943);let _0x3cd650=contactItemTypes['find'](_0x1dece1=>_0x1dece1['name']+_0x0220('0x68')===_0x530943);if(_[_0x0220('0x1b')](_0xb10347)&&_[_0x0220('0x1b')](_0x3cd650)){if(_0x401a67[_0x0220('0x70')](_0x530943)){if(_0xf17db0['data'][_0x34db87][_0x401a67[_0x530943]]){var _0x2f15cd=_[_0x0220('0x71')](_0xf17db0[_0x0220('0x6d')][_0x34db87][_0x401a67[_0x530943]]['replace'](/"/g,'\x27'));switch(_0x530943){case _0x0220('0x37'):var _0x5d8799=moment(_0x2f15cd,_0x0220('0xd'),!![]);if(_0x5d8799[_0x0220('0x72')]()){_0x146259['push']('\x22'+_0x2f15cd+'\x22');}else{_0x5bc606['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x0220('0x3b'):var _0x3d26e6=parseInt(_0x2f15cd);_0x2f15cd=_[_0x0220('0x73')](_0x3d26e6)||_0x3d26e6<0x0||_0x3d26e6>0x4?_0x33cc3f?0x3:0x2:_0x3d26e6;_0x146259['push']('\x22'+_0x2f15cd+'\x22');break;case _0x0220('0x74'):var _0x461397=parseInt(_0x2f15cd);if(_['isNumber'](_0x461397)&&_[_0x0220('0x75')](_0x174df6,_0x461397)){_0x146259[_0x0220('0x1d')]('\x22'+_0x461397+'\x22');}else{_0x5bc606[_0x0220('0x1d')](_0x0220('0x76'));}break;case _0x0220('0x77'):if(isEmail(_0x2f15cd)){_0x146259[_0x0220('0x1d')]('\x22'+_0x2f15cd+'\x22');}else{_0x5bc606[_0x0220('0x1d')](_0x0220('0x78'));}break;case _0x0220('0x79'):var _0x32ddc6=moment(_0x2f15cd,_0x0220('0x7a'),!![]);if(_0x32ddc6['isValid']()){_0x146259['push']('\x22'+_0x2f15cd+'\x22');}else{_0x5bc606[_0x0220('0x1d')](_0x0220('0x7b'));}break;default:_0x146259[_0x0220('0x1d')]('\x22'+_0x2f15cd+'\x22');}}else{switch(_0x530943){case _0x0220('0x7c'):case _0x0220('0x11'):_0x5bc606['push'](_0x530943+_0x0220('0x7d'));break;default:_0x146259[_0x0220('0x1d')]('\x22\x22');}}}}else{var _0x46272e='';if(!_[_0x0220('0x1b')](_0xb10347)){if(!_0x5746bb[_0x0220('0x70')](_0xb10347['id'])){for(var _0x506086=0x0;_0x506086<_0x401a67[_0x530943][_0x0220('0x1a')];_0x506086++){var _0x2f15cd=_[_0x0220('0x71')](_0xf17db0[_0x0220('0x6d')][_0x34db87][_0x401a67[_0x530943][_0x506086]]['replace'](/"/g,'\x27'));var _0xbaf34a=phoneDescriptions[_0x0220('0x6f')](_0x5ed691=>_0x5ed691[_0x0220('0x7e')]===_0xb10347['id']);if(!_[_0x0220('0x1b')](_0xbaf34a)){var _0x27bdb5=_[_0x0220('0x71')](_0xf17db0[_0x0220('0x6d')][_0x34db87][_0x401a67[_0xbaf34a['description']][0x0]][_0x0220('0x7f')](/"/g,'\x27'));if(!_[_0x0220('0x1b')](_0x27bdb5))_0x2f15cd=_0x2f15cd+'§'+_0x27bdb5;}if(_0x46272e=='')_0x46272e=_0x2f15cd;else _0x46272e+='|'+_0x2f15cd;}_0x59ce48[_0x0220('0x1d')](_0xb10347['id']+':'+_0x46272e);_0x5746bb[_0xb10347['id']]=0x1;}}}}if(hasAdditionalPhones){_0x146259[_0x0220('0x1d')]('\x22'+_0x59ce48['join'](';')+'\x22');}if(_0x5bc606['length']){handleError(_0xf17db0[_0x0220('0x6d')][_0x34db87],{'code':_0x0220('0x80'),'message':_0x5bc606[_0x0220('0x15')]()});}else{fs[_0x0220('0x81')](_0x4d8e3a,_0x146259['join']()+'\x0a');}_0x146259=[];}if(!(stats[_0x0220('0x82')]%0xc8)){socket[_0x0220('0x83')](_0x0220('0x84')+_0x10f766,stats);stats[_0x0220('0x6e')]=[];}}if(stopped){logger[_0x0220('0x5d')](_0x0220('0x85'));_0x5209f8[_0x0220('0x86')]();}}catch(_0x4d921a){handleError(_0xf17db0[_0x0220('0x6d')][_0x34db87],{'code':_0x0220('0x87'),'message':_0x4d921a[_0x0220('0x21')]});logger[_0x0220('0x20')](_0x0220('0x88'),_0x4d921a[_0x0220('0x21')]);}},'complete':function(){try{var _0xcf3a6f=[];var _0x380098=tempTableName;_0xcf3a6f[_0x0220('0x1d')](_0x0220('0x89')+_0x380098+_0x0220('0x8a'));logger['info'](_0x0220('0x8b'),contactItemTypes[_0x0220('0x1a')]);var _0x25bc0e=util[_0x0220('0xc')](_0x0220('0x8c'),_0x4d8e3a,_0x380098,_0x105cf8,_0x5db462['ListId'],_0x5db462['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x401a67['scheduledat'])){_0x25bc0e+=',\x20scheduledAt\x20=\x20NOW()';}_0xcf3a6f[_0x0220('0x1d')](_0x25bc0e);BPromise['each'](_0xcf3a6f,handleQuery)[_0x0220('0x22')](function(_0x232503){BPromise[_0x0220('0x1e')]([handleAdditionalPhones()])['then'](function(){_0xcf3a6f=[];for(var _0xe93d7=0x0;_0xe93d7\x20\x20');}var _0xcec24f=path[_0x0220('0x15')](config[_0x0220('0x95')],_0x0220('0x96'),process[_0x0220('0x94')][0x2]);if(!fs[_0x0220('0x97')](_0xcec24f)){throw new Error(_0x0220('0x98'));}var _0x3477f2={};try{_0x3477f2=JSON['parse'](process[_0x0220('0x94')][0x3]);if(!_0x3477f2[_0x0220('0x62')]){throw new Error(_0x0220('0x99'));}var _0x6f88a5=0x0;if(_0x3477f2[_0x0220('0x62')][_0x0220('0x74')]){_0x6f88a5=0x1;}if(!_0x3477f2[_0x0220('0x39')]){throw new Error(_0x0220('0x9a'));}}catch(_0x454705){throw new Error('body\x20id\x20mandatory');}var _0x235eb9=[];try{_0x235eb9=_[_0x0220('0x9b')](JSON[_0x0220('0x6b')](process[_0x0220('0x94')][0x4]),'id');}catch(_0x17da87){logger[_0x0220('0x5d')](_0x0220('0x9c'));}main(_0xcec24f,_0x3477f2,_0x235eb9,_0x6f88a5);}validate();process['on']('SIGINT',handleStop);process['on'](_0x0220('0x9d'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index f704b8e..55fc5d2 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42ad=['Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','Answer\x20Time','answertime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***'];(function(_0x497ed5,_0x1cb0fa){var _0x57c5b9=function(_0x4b80d8){while(--_0x4b80d8){_0x497ed5['push'](_0x497ed5['shift']());}};_0x57c5b9(++_0x1cb0fa);}(_0x42ad,0xf3));var _0xd42a=function(_0x236778,_0x2d0a72){_0x236778=_0x236778-0x0;var _0xc880d7=_0x42ad[_0x236778];return _0xc880d7;};'use strict';exports['getSubjects']=function(_0x439b38,_0x388f14){var _0x5b6f7c=[{'type':_0xd42a('0x0'),'content':_0xd42a('0x1'),'variableName':null}];switch(_0x439b38[_0xd42a('0x2')]()){case'voice':switch(_0x388f14[_0xd42a('0x2')]()){case _0xd42a('0x3'):_0x5b6f7c[_0xd42a('0x4')]({'type':_0xd42a('0x5'),'content':'','variableName':_0xd42a('0x6')});_0x5b6f7c[_0xd42a('0x4')]({'type':_0xd42a('0x5'),'content':'','variableName':_0xd42a('0x7')});break;case _0xd42a('0x8'):_0x5b6f7c[_0xd42a('0x4')]({'type':'string','content':_0xd42a('0x9'),'variableName':null});_0x5b6f7c[_0xd42a('0x4')]({'type':_0xd42a('0x5'),'content':'','variableName':_0xd42a('0xa')});break;}}return _0x5b6f7c;};exports[_0xd42a('0xb')]=function(_0x428801,_0x435259){var _0x58e4ab=[];switch(_0x428801[_0xd42a('0x2')]()){case'voice':switch(_0x435259['toLowerCase']()){case _0xd42a('0x3'):_0x58e4ab=[{'type':_0xd42a('0x0'),'content':_0xd42a('0xc'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xd42a('0xd'),'keyType':'variable','variableName':'calleridnum'},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0xf'),'keyType':_0xd42a('0x5'),'variableName':_0xd42a('0x10')},{'type':'keyValue','content':'','key':_0xd42a('0x11'),'keyType':'variable','variableName':_0xd42a('0x12')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x13'),'keyType':_0xd42a('0x5'),'variableName':_0xd42a('0x6')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x14'),'keyType':_0xd42a('0x5'),'variableName':'uniqueid'},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x15'),'keyType':_0xd42a('0x5'),'variableName':_0xd42a('0x16')},{'type':_0xd42a('0x0'),'content':_0xd42a('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xd42a('0xe'),'content':'','key':'Agent\x20Name','keyType':_0xd42a('0x5'),'variableName':_0xd42a('0x18')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x19'),'keyType':_0xd42a('0x5'),'variableName':_0xd42a('0xa')},{'type':'string','content':_0xd42a('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x1b'),'keyType':_0xd42a('0x5'),'variableName':_0xd42a('0x16')},{'type':_0xd42a('0xe'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0xd42a('0x1c')},{'type':'keyValue','content':'','key':_0xd42a('0x1d'),'keyType':_0xd42a('0x5'),'variableName':_0xd42a('0x1e')},{'type':_0xd42a('0xe'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0xd42a('0x1f')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x20'),'keyType':'variable','variableName':_0xd42a('0x21')}];break;case _0xd42a('0x8'):_0x58e4ab=[{'type':'string','content':_0xd42a('0xc'),'variableName':null},{'type':'keyValue','content':'','key':_0xd42a('0x22'),'keyType':_0xd42a('0x5'),'keyContent':'','variableName':_0xd42a('0xa')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x23'),'keyType':_0xd42a('0x5'),'keyContent':'','variableName':_0xd42a('0x24')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x14'),'keyType':_0xd42a('0x5'),'keyContent':'','variableName':_0xd42a('0x25')},{'type':'keyValue','content':'','key':_0xd42a('0x15'),'keyType':_0xd42a('0x5'),'keyContent':'','variableName':_0xd42a('0x26')},{'type':_0xd42a('0x0'),'content':_0xd42a('0x1a')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x27'),'keyType':'variable','keyContent':'','variableName':_0xd42a('0x28')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0xd42a('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x29'),'keyType':_0xd42a('0x5'),'keyContent':'','variableName':_0xd42a('0x2a')},{'type':_0xd42a('0xe'),'content':'','key':_0xd42a('0x2b'),'keyType':_0xd42a('0x5'),'keyContent':'','variableName':_0xd42a('0x2c')}];break;}}return _0x58e4ab;}; \ No newline at end of file +var _0xb11c=['keyValue','Caller\x20Name','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','destcalleridnum','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Member\x20Name','starttime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','getDescriptions'];(function(_0x2746e3,_0x517fa5){var _0x546584=function(_0x13e645){while(--_0x13e645){_0x2746e3['push'](_0x2746e3['shift']());}};_0x546584(++_0x517fa5);}(_0xb11c,0x1ec));var _0xcb11=function(_0x1a03ee,_0x373752){_0x1a03ee=_0x1a03ee-0x0;var _0x171dc7=_0xb11c[_0x1a03ee];return _0x171dc7;};'use strict';exports[_0xcb11('0x0')]=function(_0x3071c5,_0x5ba017){var _0x4baeb3=[{'type':_0xcb11('0x1'),'content':_0xcb11('0x2'),'variableName':null}];switch(_0x3071c5[_0xcb11('0x3')]()){case _0xcb11('0x4'):switch(_0x5ba017['toLowerCase']()){case _0xcb11('0x5'):_0x4baeb3[_0xcb11('0x6')]({'type':_0xcb11('0x7'),'content':'','variableName':'queue'});_0x4baeb3[_0xcb11('0x6')]({'type':_0xcb11('0x7'),'content':'','variableName':_0xcb11('0x8')});break;case _0xcb11('0x9'):_0x4baeb3[_0xcb11('0x6')]({'type':_0xcb11('0x1'),'content':_0xcb11('0xa'),'variableName':null});_0x4baeb3[_0xcb11('0x6')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x4baeb3;};exports[_0xcb11('0xb')]=function(_0x4fc910,_0x4b91c6){var _0x469bf0=[];switch(_0x4fc910[_0xcb11('0x3')]()){case _0xcb11('0x4'):switch(_0x4b91c6['toLowerCase']()){case'inbound':_0x469bf0=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0xcb11('0x8')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0xd'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xcb11('0xe'),'keyType':'variable','variableName':_0xcb11('0xf')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x10'),'keyType':_0xcb11('0x7'),'variableName':_0xcb11('0x11')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x12'),'keyType':_0xcb11('0x7'),'variableName':_0xcb11('0x13')},{'type':'keyValue','content':'','key':_0xcb11('0x14'),'keyType':_0xcb11('0x7'),'variableName':_0xcb11('0x15')},{'type':_0xcb11('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xcb11('0x16'),'keyType':'variable','variableName':_0xcb11('0x17')},{'type':_0xcb11('0xc'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xcb11('0x18')},{'type':_0xcb11('0x1'),'content':_0xcb11('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0xcb11('0x7'),'variableName':'agentcalledAt'},{'type':_0xcb11('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0xcb11('0x7'),'variableName':_0xcb11('0x1a')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x1b'),'keyType':_0xcb11('0x7'),'variableName':_0xcb11('0x1c')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x1d'),'keyType':'variable','variableName':_0xcb11('0x1e')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x1f'),'keyType':_0xcb11('0x7'),'variableName':_0xcb11('0x20')}];break;case _0xcb11('0x9'):_0x469bf0=[{'type':'string','content':_0xcb11('0x21'),'variableName':null},{'type':_0xcb11('0xc'),'content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0xcb11('0x18')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x22'),'keyType':_0xcb11('0x7'),'keyContent':'','variableName':'membername'},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x12'),'keyType':_0xcb11('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x14'),'keyType':_0xcb11('0x7'),'keyContent':'','variableName':_0xcb11('0x23')},{'type':_0xcb11('0x1'),'content':_0xcb11('0x19')},{'type':_0xcb11('0xc'),'content':'','key':'Answer\x20Time','keyType':_0xcb11('0x7'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xcb11('0x24'),'keyType':_0xcb11('0x7'),'keyContent':'','variableName':_0xcb11('0x25')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x26'),'keyType':_0xcb11('0x7'),'keyContent':'','variableName':_0xcb11('0x27')},{'type':_0xcb11('0xc'),'content':'','key':_0xcb11('0x28'),'keyType':'variable','keyContent':'','variableName':_0xcb11('0x29')}];break;}}return _0x469bf0;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 9353f09..8937c2c 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8167=['default','fields','filter','having','read','tags','i.id','ids','tag','countFilteredInteractions','count','length','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','rows','catch','tracked','query','clone','omit','html','mobile','updateUser','./utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','body','contact'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8167,0x165));var _0x7816=function(_0x356d60,_0x3b7b45){_0x356d60=_0x356d60-0x0;var _0x369a16=_0x8167[_0x356d60];return _0x369a16;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var utils=require(_0x7816('0x0'));exports[_0x7816('0x1')]=function(_0x3b19d9,_0x57f6fd,_0x4299fb,_0x4e4a6e,_0x57f8f5){var _0x301db7={'count':0x0,'rows':[]};var _0x52673b=sqlUtils[_0x7816('0x2')](_0x3b19d9,_0x4299fb,_0x57f6fd);if(_0x52673b){return Promise[_0x7816('0x3')](_0x301db7);}var _0x1fe319=sqlUtils[_0x7816('0x4')](_0x3b19d9);var _0x10805d={};return Promise[_0x7816('0x3')]()[_0x7816('0x5')](function(){if(_0x57f6fd[_0x7816('0x6')]){return sqlUtils[_0x7816('0x7')](_0x57f6fd['search'],_0x57f8f5);}else{return sqlUtils[_0x7816('0x8')](_0x3b19d9,_0x57f6fd,_0x57f8f5);}})[_0x7816('0x5')](function(_0x4024d3){_0x1fe319[_0x7816('0x9')](_0x4024d3[_0x7816('0xa')]);_0x1fe319[_0x7816('0x9')](_0x4024d3[_0x7816('0xb')]);_0x1fe319[_0x7816('0x9')](_0x4024d3[_0x7816('0xc')]);_0x1fe319[_0x7816('0x9')](_0x4024d3[_0x7816('0xd')]);_0x1fe319[_0x7816('0x9')](_0x4024d3[_0x7816('0xe')]);_0x1fe319['where'](_0x4024d3['user']);_0x1fe319[_0x7816('0xf')](_0x4024d3[_0x7816('0x10')]);_0x10805d=_0x4024d3[_0x7816('0x11')];return sqlUtils['checkAccountsRestrictions'](_0x3b19d9,_0x4299fb,_0x57f6fd);})[_0x7816('0x5')](function(_0x4a3ae5){_0x1fe319['where'](_0x4a3ae5);_0x1fe319['group'](_0x7816('0x12'));var _0x635f59=_0x57f6fd[_0x7816('0x6')]?_0x10805d[_0x7816('0x13')]:_0x57f6fd[_0x7816('0x14')];return sqlUtils[_0x7816('0x15')](_0x1fe319,_0x635f59);})[_0x7816('0x5')](function(_0x522432){_0x301db7[_0x7816('0x16')]=_0x522432[_0x7816('0x17')];if(_0x301db7[_0x7816('0x16')]===0x0){return[];}_0x1fe319[_0x7816('0xf')](_0x10805d[_0x7816('0x18')]);if(_0x4e4a6e['order']){_0x4e4a6e[_0x7816('0x19')][_0x7816('0x1a')](function(_0x1814ed){var _0x15fd3c=_0x1814ed[0x0]===_0x7816('0x1b')?_0x1814ed[0x0]:'i.'+_0x1814ed[0x0];_0x1fe319[_0x7816('0x19')](_0x15fd3c,_0x1814ed[0x1]===_0x7816('0x1c')?![]:!![]);if(_0x1814ed[0x0]===_0x7816('0x1d')){var _0x36c59e=sqlUtils[_0x7816('0x1e')](_0x3b19d9,_0x57f6fd);_0x1fe319[_0x7816('0x19')](_0x36c59e,_0x1814ed[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0x7816('0x1f')](_0x3b19d9,_0x1fe319,_0x57f6fd,_0x4e4a6e);})[_0x7816('0x5')](function(_0x9d8643){_0x301db7[_0x7816('0x20')]=_0x9d8643;return _0x301db7;})[_0x7816('0x21')](function(_0x1c00be){throw _0x1c00be;});};exports[_0x7816('0x22')]=function(_0xcf244,_0x315188){return function(_0x166a27,_0x2b5f32,_0x4e9869){var _0x222662=_0x166a27['user'];var _0x5245aa={};var _0x2b092d=_0x166a27[_0x7816('0x23')];if(_0x5245aa){_0x5245aa=_[_0x7816('0x24')](_0x166a27['body']);_0x5245aa=_[_0x7816('0x25')](_0x5245aa,[_0x7816('0xa'),_0x7816('0x26'),'phone','fax',_0x7816('0x27')]);}utils[_0x7816('0x28')](_0x222662,_0x5245aa,_0x2b092d,_0xcf244,_0x315188);_0x4e9869(null);};}; \ No newline at end of file +var _0xdbdb=['then','search','parseAdvancedSearchFilter','parseQueryParameters','where','contact','default','user','having','read','checkAccountsRestrictions','group','i.id','ids','tag','countFilteredInteractions','count','length','clause','forEach','contactName','DESC','closed','getClosedOrderClause','rows','query','clone','body','omit','html','phone','mobile','updateUser','lodash','findAll','skipInteractionsQuery','resolve'];(function(_0x383433,_0x209219){var _0x4cc33f=function(_0x5a981b){while(--_0x5a981b){_0x383433['push'](_0x383433['shift']());}};_0x4cc33f(++_0x209219);}(_0xdbdb,0x1dd));var _0xbdbd=function(_0x45b771,_0x2caece){_0x45b771=_0x45b771-0x0;var _0x7ef73d=_0xdbdb[_0x45b771];return _0x7ef73d;};'use strict';var _=require(_0xbdbd('0x0'));var sqlUtils=require('./sql-utils');var utils=require('./utils');exports[_0xbdbd('0x1')]=function(_0x45b85c,_0x414891,_0x3151d8,_0x32865a,_0xf1cacf){var _0x4d1199={'count':0x0,'rows':[]};var _0x495bdc=sqlUtils[_0xbdbd('0x2')](_0x45b85c,_0x3151d8,_0x414891);if(_0x495bdc){return Promise['resolve'](_0x4d1199);}var _0x259ae8=sqlUtils['getInteractionsQuery'](_0x45b85c);var _0x2957b1={};return Promise[_0xbdbd('0x3')]()[_0xbdbd('0x4')](function(){if(_0x414891[_0xbdbd('0x5')]){return sqlUtils[_0xbdbd('0x6')](_0x414891[_0xbdbd('0x5')],_0xf1cacf);}else{return sqlUtils[_0xbdbd('0x7')](_0x45b85c,_0x414891,_0xf1cacf);}})[_0xbdbd('0x4')](function(_0x54cc61){_0x259ae8[_0xbdbd('0x8')](_0x54cc61['body']);_0x259ae8['where'](_0x54cc61[_0xbdbd('0x9')]);_0x259ae8['where'](_0x54cc61[_0xbdbd('0xa')]);_0x259ae8[_0xbdbd('0x8')](_0x54cc61['fields']);_0x259ae8['where'](_0x54cc61['filter']);_0x259ae8[_0xbdbd('0x8')](_0x54cc61[_0xbdbd('0xb')]);_0x259ae8[_0xbdbd('0xc')](_0x54cc61[_0xbdbd('0xd')]);_0x2957b1=_0x54cc61['tags'];return sqlUtils[_0xbdbd('0xe')](_0x45b85c,_0x3151d8,_0x414891);})[_0xbdbd('0x4')](function(_0x55e92b){_0x259ae8[_0xbdbd('0x8')](_0x55e92b);_0x259ae8[_0xbdbd('0xf')](_0xbdbd('0x10'));var _0x59c026=_0x414891['search']?_0x2957b1[_0xbdbd('0x11')]:_0x414891[_0xbdbd('0x12')];return sqlUtils[_0xbdbd('0x13')](_0x259ae8,_0x59c026);})[_0xbdbd('0x4')](function(_0x2c5af3){_0x4d1199[_0xbdbd('0x14')]=_0x2c5af3[_0xbdbd('0x15')];if(_0x4d1199[_0xbdbd('0x14')]===0x0){return[];}_0x259ae8[_0xbdbd('0xc')](_0x2957b1[_0xbdbd('0x16')]);if(_0x32865a['order']){_0x32865a['order'][_0xbdbd('0x17')](function(_0x469017){var _0x1d4d65=_0x469017[0x0]===_0xbdbd('0x18')?_0x469017[0x0]:'i.'+_0x469017[0x0];_0x259ae8['order'](_0x1d4d65,_0x469017[0x1]===_0xbdbd('0x19')?![]:!![]);if(_0x469017[0x0]===_0xbdbd('0x1a')){var _0x558658=sqlUtils[_0xbdbd('0x1b')](_0x45b85c,_0x414891);_0x259ae8['order'](_0x558658,_0x469017[0x1]===_0xbdbd('0x19')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x45b85c,_0x259ae8,_0x414891,_0x32865a);})[_0xbdbd('0x4')](function(_0x34d971){_0x4d1199[_0xbdbd('0x1c')]=_0x34d971;return _0x4d1199;})['catch'](function(_0x5016fa){throw _0x5016fa;});};exports['tracked']=function(_0x216620,_0x2a9add){return function(_0x4106aa,_0x2b32ac,_0x3c9fc6){var _0x463cbd=_0x4106aa['user'];var _0x13fb6a={};var _0x21bcb6=_0x4106aa[_0xbdbd('0x1d')];if(_0x13fb6a){_0x13fb6a=_[_0xbdbd('0x1e')](_0x4106aa[_0xbdbd('0x1f')]);_0x13fb6a=_[_0xbdbd('0x20')](_0x13fb6a,[_0xbdbd('0x1f'),_0xbdbd('0x21'),_0xbdbd('0x22'),'fax',_0xbdbd('0x23')]);}utils[_0xbdbd('0x24')](_0x463cbd,_0x13fb6a,_0x21bcb6,_0x216620,_0x2a9add);_0x3c9fc6(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 5c983f3..7a696b2 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b96=['CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','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)','conditions','find','buildExpression','type','default','text','value','unreadMessages','read','and','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','end','Tag','map','tags','clause','ids','User','user','UserId','body','plainBody','some','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','mail','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','attributes','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','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','c.lastName','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','findOne','enableEmailPreview','clone','COUNT(*)','getSelectedTags','isEmpty','where','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','field','name','color','from','getInteractionFK','user_has_','_interactions','select','u.id','u.fullname','ui.','left_join','users','length','\x20IN\x20?','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','\x20=\x20i.id','tools_tags','expr','forEach'];(function(_0x107840,_0x6c6fd6){var _0x3fd293=function(_0x32ce0a){while(--_0x32ce0a){_0x107840['push'](_0x107840['shift']());}};_0x3fd293(++_0x6c6fd6);}(_0x3b96,0x80));var _0x63b9=function(_0x1cc3aa,_0x15ba27){_0x1cc3aa=_0x1cc3aa-0x0;var _0xf99eea=_0x3b96[_0x1cc3aa];return _0xf99eea;};'use strict';var _=require(_0x63b9('0x0'));var squel=require('squel');var as=require(_0x63b9('0x1'));var qs=require(_0x63b9('0x2'));var updateInteraction=require(_0x63b9('0x3'))['updateInteraction'];var utils=require(_0x63b9('0x4'));var db=require(_0x63b9('0x5'))['db'];function skipInteractionsQuery(_0x34b130,_0x43f692,_0x2827c8){var _0x3156ba=![];var _0x1e19a7=utils[_0x63b9('0x6')](_0x34b130);if(_0x43f692[_0x63b9('0x7')]===_0x63b9('0x8')&&!_0x2827c8['search']&&!_0x2827c8[_0x1e19a7]){_0x3156ba=!![];}return _0x3156ba;}function getTagsQuery(){return squel['select']()[_0x63b9('0x9')]('id')[_0x63b9('0x9')](_0x63b9('0xa'))['field'](_0x63b9('0xb'))[_0x63b9('0xc')]('tools_tags');}function getUsersQuery(_0x35eadb,_0xc244cc){var _0x397ff2=utils[_0x63b9('0xd')](_0x35eadb);var _0x3bac1e=_0x63b9('0xe')+_0x35eadb+_0x63b9('0xf');var _0x2a55a9=squel[_0x63b9('0x10')]()[_0x63b9('0x9')](_0x63b9('0x11'))['field'](_0x63b9('0x12'))[_0x63b9('0x9')](_0x63b9('0x13')+_0x397ff2)[_0x63b9('0xc')](_0x3bac1e,'ui')[_0x63b9('0x14')](_0x63b9('0x15'),'u','u.id\x20=\x20ui.UserId');if(_0xc244cc[_0x63b9('0x16')]>0x0){_0x2a55a9['where'](_0x63b9('0x13')+_0x397ff2+_0x63b9('0x17'),_['map'](_0xc244cc,'id'));}return _0x2a55a9;}function getInteractionsQuery(_0x1ae910){var _0x2914d6=utils[_0x63b9('0x18')](_0x1ae910);var _0x592968=utils[_0x63b9('0x6')](_0x1ae910);var _0x1152c7=utils[_0x63b9('0xd')](_0x1ae910);return squel[_0x63b9('0x10')]()['from'](_0x2914d6[_0x63b9('0x19')],'i')[_0x63b9('0x14')]('cm_contacts','c',_0x63b9('0x1a'))[_0x63b9('0x14')](_0x63b9('0x15'),'o',_0x63b9('0x1b'))[_0x63b9('0x14')](_0x2914d6[_0x63b9('0x1c')],'a',_0x63b9('0x1d')+_0x592968)[_0x63b9('0x14')](_0x2914d6[_0x63b9('0x1e')],'me',_0x63b9('0x1f')+_0x1152c7+'\x20=\x20i.id')[_0x63b9('0x14')](_0x2914d6[_0x63b9('0x20')],'it',_0x63b9('0x21')+_0x1152c7+_0x63b9('0x22'))[_0x63b9('0x14')](_0x63b9('0x23'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x48b504={'body':squel['expr'](),'contact':squel[_0x63b9('0x24')](),'default':squel[_0x63b9('0x24')](),'fields':squel['expr'](),'filter':squel[_0x63b9('0x24')](),'read':squel[_0x63b9('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x48b504;}function parseTagParameter(_0x2833e5){var _0x438b47=squel[_0x63b9('0x24')]();if(_0x2833e5){var _0x20d2bf=utils['getSelectedTags'](_0x2833e5);_0x20d2bf[_0x63b9('0x25')](function(_0x20db8b){_0x438b47['or'](_0x63b9('0x26'),'%,'+_0x20db8b+',%');});}return _0x438b47;}function parseReadParameter(_0x5d8cba){var _0x452a64='';if(_0x5d8cba){_0x452a64=_0x63b9('0x27');if(_0x5d8cba==='1'){_0x452a64=_0x452a64[_0x63b9('0x28')](_0x63b9('0x29'),'=');}else{_0x452a64=_0x452a64[_0x63b9('0x28')](_0x63b9('0x29'),'>');}}return _0x452a64;}function parseSearchFilter(_0x4165c0,_0x108d32){var _0x38049b=squel[_0x63b9('0x24')]();if(_0x108d32){var _0x2f689a=_0x108d32[_0x63b9('0x28')]('\x5c','\x5c\x5c')[_0x63b9('0x28')](/'/g,'\x27\x27');if(qs[_0x63b9('0x2a')](_0x2f689a)){_0x38049b['or'](_0x63b9('0x2b'),_0x2f689a+'%');if([_0x63b9('0x2c'),_0x63b9('0x2d')][_0x63b9('0x2e')](_0x4165c0)){_0x38049b['or'](_0x63b9('0x2f'),_0x2f689a+'%');}else if(_0x4165c0===_0x63b9('0x30')){_0x38049b['or'](_0x63b9('0x31'),_0x2f689a+'%');}else if(_0x4165c0===_0x63b9('0x32')){_0x38049b['or'](_0x63b9('0x33'),_0x2f689a+'%');}}else if(_0x4165c0==='mail'&&qs[_0x63b9('0x34')](_0x2f689a)){_0x38049b['or'](_0x63b9('0x35'),_0x2f689a+'%');}else{if(_0x4165c0==='mail'){_0x38049b['or'](_0x63b9('0x36'),qs[_0x63b9('0x37')](_0x2f689a,!![]))['or'](_0x63b9('0x38'),qs[_0x63b9('0x37')](_0x2f689a));}else if(_0x4165c0!==_0x63b9('0x30')){_0x38049b['or'](_0x63b9('0x39'),qs[_0x63b9('0x37')](_0x2f689a));}_0x38049b['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2f689a,!![]),null);}}return _0x38049b;}function parseAdvancedSearchFilter(_0xdcb955,_0x248e91){var _0x293cc1=getSqlClauses();var _0x4cfb1f=as['parseSearch'](_0xdcb955);var _0x5d4949=_0x4cfb1f['sqlOperator'];for(var _0x4f0160=0x0;_0x4f0160<_0x4cfb1f[_0x63b9('0x3a')][_0x63b9('0x16')];_0x4f0160++){var _0x53f679=_0x4cfb1f[_0x63b9('0x3a')][_0x4f0160];var _0x1c806f='i';var _0x589091=_[_0x63b9('0x3b')](_0x248e91,[_0x63b9('0xa'),_0x53f679['field']]);if(_0x589091){var _0x1f3147=as[_0x63b9('0x3c')](_0x1c806f,_0x589091[_0x63b9('0x3d')],_0x53f679);_0x293cc1[_0x63b9('0x3e')][_0x5d4949](_0x1f3147[_0x63b9('0x3f')],_0x1f3147[_0x63b9('0x40')]['start'],_0x1f3147[_0x63b9('0x40')]['end']);}else{switch(_0x53f679[_0x63b9('0x9')]){case _0x63b9('0x41'):var _0x59eb12=parseReadParameter(_0x53f679[_0x63b9('0x40')]);_0x293cc1[_0x63b9('0x42')][_0x63b9('0x43')](_0x59eb12);break;case _0x63b9('0x44'):if(_0x53f679['operator']===_0x63b9('0x45')){if(_0x53f679['value'][_0x63b9('0x46')]('\x20')[_0x63b9('0x16')]>0x1){_0x293cc1['contact'][_0x5d4949](_0x63b9('0x47'),qs['getFullTextValue'](_0x53f679[_0x63b9('0x40')],!![]),null);}else{var _0x3ef5fa='%'+_0x53f679['value']+'%';_0x293cc1[_0x63b9('0x48')][_0x5d4949](_0x63b9('0x49'),_0x3ef5fa,_0x3ef5fa,_0x3ef5fa);}}else{_0x589091=_['find'](_0x248e91,['name','ContactId']);_0x53f679['field']=_0x63b9('0x4a');_0x1f3147=as['buildExpression'](_0x1c806f,_0x589091[_0x63b9('0x3d')],_0x53f679);_0x293cc1['contact'][_0x5d4949](_0x1f3147[_0x63b9('0x3f')],_0x1f3147['value'][_0x63b9('0x4b')],_0x1f3147[_0x63b9('0x40')][_0x63b9('0x4c')]);}break;case _0x63b9('0x4d'):var _0x518599=_0x53f679['value'][_0x63b9('0x46')](',')[_0x63b9('0x4e')](function(_0x16053e){return Number(_0x16053e);});var _0x10be6f=parseTagParameter(_0x518599);_0x293cc1[_0x63b9('0x4f')][_0x63b9('0x50')][_0x63b9('0x43')](_0x10be6f);_0x293cc1[_0x63b9('0x4f')][_0x63b9('0x51')]=_0x518599;break;case _0x63b9('0x52'):if(_0x53f679['operator']===_0x63b9('0x45')){_0x293cc1[_0x63b9('0x53')][_0x5d4949]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x53f679[_0x63b9('0x40')]+'%',null);}else{_0x589091=_[_0x63b9('0x3b')](_0x248e91,['name',_0x63b9('0x54')]);_0x53f679['field']=_0x63b9('0x54');_0x1f3147=as[_0x63b9('0x3c')](_0x1c806f,_0x589091[_0x63b9('0x3d')],_0x53f679);_0x293cc1['user'][_0x5d4949](_0x1f3147[_0x63b9('0x3f')],_0x1f3147[_0x63b9('0x40')][_0x63b9('0x4b')],_0x1f3147[_0x63b9('0x40')]['end']);}break;case _0x63b9('0x55'):case _0x63b9('0x56'):_0x1f3147=as['buildExpression']('me',null,_0x53f679);_0x293cc1[_0x63b9('0x55')][_0x5d4949](_0x1f3147[_0x63b9('0x3f')],_0x1f3147['value'][_0x63b9('0x4b')],_0x1f3147['value']['end']);break;}}}return _0x293cc1;}function parseModelFields(_0x23a73f,_0x1bf796,_0x328f88){var _0x37eb5a=utils[_0x63b9('0x6')](_0x23a73f);var _0x4a8db8=squel[_0x63b9('0x24')]();var _0x3364f5=_(_0x1bf796)['keys']()[_0x63b9('0x4e')](function(_0x13047f){return _[_0x63b9('0x57')](_0x328f88,['name',_0x13047f])?_0x13047f:undefined;})[_0x63b9('0x58')]()[_0x63b9('0x40')]();if(_0x3364f5[_0x63b9('0x16')]>0x0){_0x3364f5[_0x63b9('0x25')](function(_0x1769ef){if(_0x1769ef===_0x37eb5a){_0x4a8db8[_0x63b9('0x43')]('i.'+_0x37eb5a+_0x63b9('0x17'),[][_0x63b9('0x59')](_0x1bf796[_0x1769ef]));}else if(_0x1769ef===_0x63b9('0x5a')){var _0x8135ab=JSON[_0x63b9('0x5b')](_0x1bf796[_0x1769ef])[_0x63b9('0x5c')];var _0x5f1307=JSON[_0x63b9('0x5b')](_0x1bf796[_0x1769ef])[_0x63b9('0x5d')];_0x4a8db8[_0x63b9('0x43')](_0x63b9('0x5e'),_0x8135ab,_0x5f1307);}else{if(_0x1bf796[_0x1769ef]===_0x63b9('0x5f')){_0x4a8db8[_0x63b9('0x43')]('i.'+_0x1769ef+_0x63b9('0x60'));}else{_0x4a8db8[_0x63b9('0x43')]('i.'+_0x1769ef+_0x63b9('0x61'),_0x1bf796[_0x1769ef]);}}});}return _0x4a8db8;}function parseQueryParameters(_0x10af1b,_0x4481ca,_0x2af351){var _0x460c41=getSqlClauses();return Promise['resolve']()[_0x63b9('0x62')](function(){return parseModelFields(_0x10af1b,_0x4481ca,_0x2af351);})['then'](function(_0x1e863f){_0x460c41[_0x63b9('0x63')][_0x63b9('0x43')](_0x1e863f);return parseReadParameter(_0x4481ca['read']);})['then'](function(_0xa5c6cb){_0x460c41[_0x63b9('0x42')][_0x63b9('0x43')](_0xa5c6cb);return parseTagParameter(_0x4481ca[_0x63b9('0x64')]);})[_0x63b9('0x62')](function(_0x19a383){_0x460c41[_0x63b9('0x4f')][_0x63b9('0x50')]['and'](_0x19a383);return parseSearchFilter(_0x10af1b,_0x4481ca['filter']);})['then'](function(_0x4aeff6){_0x460c41[_0x63b9('0x65')]=_0x4aeff6;return _0x460c41;});}function checkAccountsRestrictions(_0x393fb5,_0x4a6600,_0x3dab85){var _0x439f25=utils[_0x63b9('0x6')](_0x393fb5);var _0x5689a9=_0x63b9('0x66')+_[_0x63b9('0x67')](_0x393fb5)+(_0x393fb5===_0x63b9('0x68')?_0x63b9('0x69'):_0x63b9('0x6a'));var _0x1e7e2e=squel[_0x63b9('0x24')]();return Promise[_0x63b9('0x6b')]()[_0x63b9('0x62')](function(){if(_0x3dab85['search']&&_0x4a6600[_0x63b9('0x7')]==='agent'){return _0x4a6600[_0x5689a9]({'attributes':['id'],'raw':!![]});}})[_0x63b9('0x62')](function(_0x3780b6){if(_0x3780b6){if(_0x3780b6[_0x63b9('0x16')]===0x0){_0x1e7e2e[_0x63b9('0x43')]('i.'+_0x439f25+'\x20IS\x20NULL');}else{_0x1e7e2e[_0x63b9('0x43')]('i.'+_0x439f25+'\x20IN\x20?',_[_0x63b9('0x4e')](_0x3780b6,'id'));}}else if(!_0x3dab85[_0x439f25]){_0x1e7e2e['and']('i.'+_0x439f25+_0x63b9('0x6c'));}})[_0x63b9('0x62')](function(){return _0x1e7e2e;});}function getClosedOrderClause(_0x413cab,_0x432107){var _0x5dd91e='';var _0x4b7854=[_0x63b9('0x6d'),_0x63b9('0x6e'),_0x63b9('0x6f')];if(_0x413cab===_0x63b9('0x70')){_0x4b7854[_0x63b9('0x71')](_0x63b9('0x72'));}if(_0x432107[_0x63b9('0x73')]==='0'&&_0x413cab==='mail'){_0x5dd91e=_0x63b9('0x72');}else{if(_0x432107[_0x63b9('0x73')]==='1'){_0x4b7854[_0x63b9('0x74')]();}_0x5dd91e=_0x63b9('0x75')+_0x4b7854[_0x63b9('0x76')](',\x20')+')';}return _0x5dd91e;}function getFilteredInteractions(_0x42fa41,_0x4090c7,_0x526198,_0x56d65b){var _0x3ea7cb=utils[_0x63b9('0xd')](_0x42fa41);var _0x2268d6=_[_0x63b9('0x67')](_0x42fa41)+_0x63b9('0x77');var _0x33d480=[];var _0x41f8ad=getTagsQuery();var _0x1f62f4={'type':db[_0x63b9('0x78')][_0x63b9('0x79')][_0x63b9('0x7a')],'raw':!![]};var _0x134071=[];var _0xce5a03=[];return db[_0x63b9('0x7b')][_0x63b9('0x7c')](_0x41f8ad[_0x63b9('0x7d')](),_0x1f62f4)[_0x63b9('0x62')](function(_0x456a3a){_0x33d480=_[_0x63b9('0x7e')](_0x456a3a,'id');_0x1f62f4=_[_0x63b9('0x7f')](_0x1f62f4,{'model':db[_0x2268d6],'mapToModel':!![],'nest':!![]});if(_0x526198[_0x63b9('0x63')]){_0x56d65b[_0x63b9('0x80')][_0x63b9('0x25')](function(_0x591373){_0x4090c7[_0x63b9('0x9')]('i.'+_0x591373);});}else{_0x4090c7[_0x63b9('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x63b9('0x41'));_0x4090c7[_0x63b9('0x9')]('a.key','Account.key');_0x4090c7[_0x63b9('0x9')](_0x63b9('0x81'),_0x63b9('0x82'));if(_0x42fa41==='mail'){_0x4090c7[_0x63b9('0x9')](_0x63b9('0x83'),_0x63b9('0x84'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x85'),_0x63b9('0x86'));_0x4090c7['field']('i.id');_0x4090c7[_0x63b9('0x9')]('i.createdAt');_0x4090c7['field'](_0x63b9('0x87'));_0x4090c7[_0x63b9('0x9')]('i.closed');_0x4090c7['field']('i.closedAt');_0x4090c7[_0x63b9('0x9')](_0x63b9('0x88'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x89'));_0x4090c7['field'](_0x63b9('0x8a'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x8b'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x6f'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x6e'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x6d'));_0x4090c7[_0x63b9('0x9')]('i.substatus');_0x4090c7[_0x63b9('0x9')]('i.to');_0x4090c7['field']('i.ContactId');_0x4090c7[_0x63b9('0x9')](_0x63b9('0x8c'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x8d'));}else if(_0x42fa41==='openchannel'){_0x4090c7[_0x63b9('0x9')](_0x63b9('0x8e'),_0x63b9('0x86'));}else{_0x4090c7[_0x63b9('0x9')]('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',_0x63b9('0x86'));}if(_0x42fa41!==_0x63b9('0x70')){_0x4090c7['field'](_0x63b9('0x8f'));}_0x4090c7[_0x63b9('0x9')](_0x63b9('0x90'),'Contact.firstName');_0x4090c7[_0x63b9('0x9')](_0x63b9('0x91'),'Contact.lastName');_0x4090c7[_0x63b9('0x9')]('c.email','Contact.email');_0x4090c7[_0x63b9('0x9')]('c.phone','Contact.phone');_0x4090c7['field'](_0x63b9('0x92'),_0x63b9('0x93'));_0x4090c7['field'](_0x63b9('0x94'),'Contact.fax');_0x4090c7['field'](_0x63b9('0x95'),_0x63b9('0x96'));_0x4090c7[_0x63b9('0x9')]('o.internal',_0x63b9('0x97'));_0x4090c7[_0x63b9('0x9')](_0x63b9('0x98'),_0x63b9('0x99'));}if(_0x56d65b[_0x63b9('0x9a')]){_0x4090c7[_0x63b9('0x9a')](_0x56d65b[_0x63b9('0x9a')]);}if(_0x56d65b['offset']){_0x4090c7[_0x63b9('0x9b')](_0x56d65b[_0x63b9('0x9b')]);}return db[_0x63b9('0x7b')][_0x63b9('0x7c')](_0x4090c7['toString'](),_0x1f62f4);})['then'](function(_0x57fb82){_0x134071=_0x57fb82;var _0xc4e9f5=getUsersQuery(_0x42fa41,_0x134071);return db['sequelize'][_0x63b9('0x7c')](_0xc4e9f5['toString'](),_0x1f62f4);})['then'](function(_0xfd7f02){_0xce5a03=_['groupBy'](_0xfd7f02,_0x3ea7cb);if(_0x42fa41==='mail'){return db[_0x63b9('0x9c')][_0x63b9('0x9d')]({'attributes':[_0x63b9('0x9e')],'raw':!![]});}})['then'](function(_0x50314d){var _0x110c0b=_0x50314d?_0x50314d[_0x63b9('0x9e')]:undefined;var _0x320d3a=_0x134071['map'](function(_0x45cf93){return updateInteraction(_0x45cf93,_0x33d480,_0xce5a03,_0x110c0b);});return Promise['all'](_0x320d3a);});}function countFilteredInteractions(_0x4908e3,_0x1c8935){var _0x3a84b0=_0x4908e3[_0x63b9('0x9f')]();_0x3a84b0[_0x63b9('0x9')](_0x63b9('0xa0'));_0x3a84b0[_0x63b9('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x63b9('0x41'));var _0x267c1d=utils[_0x63b9('0xa1')](_0x1c8935);if(!_[_0x63b9('0xa2')](_0x267c1d)){_0x3a84b0[_0x63b9('0xa3')](_0x63b9('0xa4'),_0x267c1d);}var _0x42ba47={'type':db[_0x63b9('0x78')][_0x63b9('0x79')][_0x63b9('0x7a')],'raw':!![]};return db['sequelize']['query'](_0x3a84b0['toString'](),_0x42ba47);}module[_0x63b9('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xc6f0=['openchannel','mail','c.email\x20LIKE\x20?','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(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','conditions','buildExpression','type','value','start','end','unreadMessages','read','operator','$substring','split','contact','ContactId','text','Tag','tags','clause','and','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','plainBody','keys','map','some','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','tag','filter','get','resolve','search','agent','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','SELECT','sequelize','query','toString','keyBy','merge','attributes','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','i.id','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','groupBy','Setting','findOne','enableEmailPreview','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','select','field','name','color','tools_tags','user_has_','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionsTables','getInteractionFK','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','replace','{OPERATOR}','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?'];(function(_0x4d10b0,_0x2bb650){var _0x422317=function(_0xefd250){while(--_0xefd250){_0x4d10b0['push'](_0x4d10b0['shift']());}};_0x422317(++_0x2bb650);}(_0xc6f0,0x6f));var _0x0c6f=function(_0x9ec581,_0x217234){_0x9ec581=_0x9ec581-0x0;var _0x2ffdcf=_0xc6f0[_0x9ec581];return _0x2ffdcf;};'use strict';var _=require(_0x0c6f('0x0'));var squel=require(_0x0c6f('0x1'));var as=require(_0x0c6f('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0x0c6f('0x3'))[_0x0c6f('0x4')];var utils=require(_0x0c6f('0x5'));var db=require(_0x0c6f('0x6'))['db'];function skipInteractionsQuery(_0x152dbb,_0x390117,_0x3066a5){var _0x366ed1=![];var _0x5b2b7c=utils[_0x0c6f('0x7')](_0x152dbb);if(_0x390117[_0x0c6f('0x8')]==='agent'&&!_0x3066a5['search']&&!_0x3066a5[_0x5b2b7c]){_0x366ed1=!![];}return _0x366ed1;}function getTagsQuery(){return squel[_0x0c6f('0x9')]()[_0x0c6f('0xa')]('id')[_0x0c6f('0xa')](_0x0c6f('0xb'))[_0x0c6f('0xa')](_0x0c6f('0xc'))['from'](_0x0c6f('0xd'));}function getUsersQuery(_0x187a93,_0x4f7bf3){var _0x4dddcb=utils['getInteractionFK'](_0x187a93);var _0x5d7258=_0x0c6f('0xe')+_0x187a93+_0x0c6f('0xf');var _0x52c761=squel[_0x0c6f('0x9')]()[_0x0c6f('0xa')]('u.id')[_0x0c6f('0xa')](_0x0c6f('0x10'))['field'](_0x0c6f('0x11')+_0x4dddcb)['from'](_0x5d7258,'ui')[_0x0c6f('0x12')](_0x0c6f('0x13'),'u',_0x0c6f('0x14'));if(_0x4f7bf3[_0x0c6f('0x15')]>0x0){_0x52c761[_0x0c6f('0x16')](_0x0c6f('0x11')+_0x4dddcb+_0x0c6f('0x17'),_['map'](_0x4f7bf3,'id'));}return _0x52c761;}function getInteractionsQuery(_0x57995d){var _0x4ed620=utils[_0x0c6f('0x18')](_0x57995d);var _0x250286=utils[_0x0c6f('0x7')](_0x57995d);var _0x41657f=utils[_0x0c6f('0x19')](_0x57995d);return squel[_0x0c6f('0x9')]()[_0x0c6f('0x1a')](_0x4ed620['interactions'],'i')[_0x0c6f('0x12')](_0x0c6f('0x1b'),'c',_0x0c6f('0x1c'))[_0x0c6f('0x12')]('users','o','o.id\x20=\x20i.UserId')[_0x0c6f('0x12')](_0x4ed620['accounts'],'a','a.id\x20=\x20i.'+_0x250286)[_0x0c6f('0x12')](_0x4ed620[_0x0c6f('0x1d')],'me',_0x0c6f('0x1e')+_0x41657f+_0x0c6f('0x1f'))[_0x0c6f('0x12')](_0x4ed620[_0x0c6f('0x20')],'it','it.'+_0x41657f+_0x0c6f('0x1f'))[_0x0c6f('0x12')]('tools_tags','t',_0x0c6f('0x21'));}function getSqlClauses(){var _0x470832={'body':squel[_0x0c6f('0x22')](),'contact':squel['expr'](),'default':squel[_0x0c6f('0x22')](),'fields':squel['expr'](),'filter':squel[_0x0c6f('0x22')](),'read':squel[_0x0c6f('0x22')](),'tags':{'clause':squel[_0x0c6f('0x22')](),'ids':null},'user':squel['expr']()};return _0x470832;}function parseTagParameter(_0x4c9f27){var _0xde9757=squel[_0x0c6f('0x22')]();if(_0x4c9f27){var _0x3a264a=utils[_0x0c6f('0x23')](_0x4c9f27);_0x3a264a[_0x0c6f('0x24')](function(_0x1f4116){_0xde9757['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1f4116+',%');});}return _0xde9757;}function parseReadParameter(_0x16d511){var _0xcca3c3='';if(_0x16d511){_0xcca3c3='unreadMessages\x20{OPERATOR}\x200';if(_0x16d511==='1'){_0xcca3c3=_0xcca3c3[_0x0c6f('0x25')](_0x0c6f('0x26'),'=');}else{_0xcca3c3=_0xcca3c3[_0x0c6f('0x25')](_0x0c6f('0x26'),'>');}}return _0xcca3c3;}function parseSearchFilter(_0x48af4e,_0x2f0146){var _0x2c48ef=squel[_0x0c6f('0x22')]();if(_0x2f0146){var _0x36312f=_0x2f0146[_0x0c6f('0x25')]('\x5c','\x5c\x5c')[_0x0c6f('0x25')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x36312f)){_0x2c48ef['or']('i.id\x20LIKE\x20?',_0x36312f+'%');if(['sms',_0x0c6f('0x27')][_0x0c6f('0x28')](_0x48af4e)){_0x2c48ef['or'](_0x0c6f('0x29'),_0x36312f+'%');}else if(_0x48af4e===_0x0c6f('0x2a')){_0x2c48ef['or'](_0x0c6f('0x2b'),_0x36312f+'%');}else if(_0x48af4e===_0x0c6f('0x2c')){_0x2c48ef['or']('i.from\x20LIKE\x20?',_0x36312f+'%');}}else if(_0x48af4e===_0x0c6f('0x2d')&&qs['isEmail'](_0x36312f)){_0x2c48ef['or'](_0x0c6f('0x2e'),_0x36312f+'%');}else{if(_0x48af4e===_0x0c6f('0x2d')){_0x2c48ef['or'](_0x0c6f('0x2f'),qs[_0x0c6f('0x30')](_0x36312f,!![]))['or'](_0x0c6f('0x31'),qs[_0x0c6f('0x30')](_0x36312f));}else if(_0x48af4e!==_0x0c6f('0x2a')){_0x2c48ef['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x36312f));}_0x2c48ef['or'](_0x0c6f('0x32'),qs[_0x0c6f('0x30')](_0x36312f,!![]),null);}}return _0x2c48ef;}function parseAdvancedSearchFilter(_0x295352,_0x4e9325){var _0x1cea71=getSqlClauses();var _0x5b3f7d=as['parseSearch'](_0x295352);var _0x109c90=_0x5b3f7d['sqlOperator'];for(var _0x14812e=0x0;_0x14812e<_0x5b3f7d['conditions']['length'];_0x14812e++){var _0x53e0a=_0x5b3f7d[_0x0c6f('0x33')][_0x14812e];var _0x979607='i';var _0x562935=_['find'](_0x4e9325,[_0x0c6f('0xb'),_0x53e0a[_0x0c6f('0xa')]]);if(_0x562935){var _0x485e80=as[_0x0c6f('0x34')](_0x979607,_0x562935[_0x0c6f('0x35')],_0x53e0a);_0x1cea71['default'][_0x109c90](_0x485e80['text'],_0x485e80[_0x0c6f('0x36')][_0x0c6f('0x37')],_0x485e80[_0x0c6f('0x36')][_0x0c6f('0x38')]);}else{switch(_0x53e0a[_0x0c6f('0xa')]){case _0x0c6f('0x39'):var _0x223b15=parseReadParameter(_0x53e0a[_0x0c6f('0x36')]);_0x1cea71[_0x0c6f('0x3a')]['and'](_0x223b15);break;case'Contact':if(_0x53e0a[_0x0c6f('0x3b')]===_0x0c6f('0x3c')){if(_0x53e0a[_0x0c6f('0x36')][_0x0c6f('0x3d')]('\x20')[_0x0c6f('0x15')]>0x1){_0x1cea71[_0x0c6f('0x3e')][_0x109c90]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0c6f('0x30')](_0x53e0a[_0x0c6f('0x36')],!![]),null);}else{var _0x1a9be6='%'+_0x53e0a[_0x0c6f('0x36')]+'%';_0x1cea71[_0x0c6f('0x3e')][_0x109c90]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1a9be6,_0x1a9be6,_0x1a9be6);}}else{_0x562935=_['find'](_0x4e9325,[_0x0c6f('0xb'),_0x0c6f('0x3f')]);_0x53e0a[_0x0c6f('0xa')]=_0x0c6f('0x3f');_0x485e80=as[_0x0c6f('0x34')](_0x979607,_0x562935[_0x0c6f('0x35')],_0x53e0a);_0x1cea71[_0x0c6f('0x3e')][_0x109c90](_0x485e80[_0x0c6f('0x40')],_0x485e80['value'][_0x0c6f('0x37')],_0x485e80[_0x0c6f('0x36')][_0x0c6f('0x38')]);}break;case _0x0c6f('0x41'):var _0x329caf=_0x53e0a['value']['split'](',')['map'](function(_0x248fb4){return Number(_0x248fb4);});var _0x25a58f=parseTagParameter(_0x329caf);_0x1cea71[_0x0c6f('0x42')][_0x0c6f('0x43')][_0x0c6f('0x44')](_0x25a58f);_0x1cea71[_0x0c6f('0x42')][_0x0c6f('0x45')]=_0x329caf;break;case _0x0c6f('0x46'):if(_0x53e0a[_0x0c6f('0x3b')]===_0x0c6f('0x3c')){_0x1cea71[_0x0c6f('0x47')][_0x109c90](_0x0c6f('0x48'),'%'+_0x53e0a[_0x0c6f('0x36')]+'%',null);}else{_0x562935=_[_0x0c6f('0x49')](_0x4e9325,['name',_0x0c6f('0x4a')]);_0x53e0a['field']=_0x0c6f('0x4a');_0x485e80=as['buildExpression'](_0x979607,_0x562935[_0x0c6f('0x35')],_0x53e0a);_0x1cea71['user'][_0x109c90](_0x485e80[_0x0c6f('0x40')],_0x485e80['value'][_0x0c6f('0x37')],_0x485e80[_0x0c6f('0x36')][_0x0c6f('0x38')]);}break;case _0x0c6f('0x4b'):case _0x0c6f('0x4c'):_0x485e80=as[_0x0c6f('0x34')]('me',null,_0x53e0a);_0x1cea71['body'][_0x109c90](_0x485e80['text'],_0x485e80[_0x0c6f('0x36')][_0x0c6f('0x37')],_0x485e80[_0x0c6f('0x36')][_0x0c6f('0x38')]);break;}}}return _0x1cea71;}function parseModelFields(_0x49fb62,_0x5f0e44,_0x4a140c){var _0x5819ba=utils['getAccountFK'](_0x49fb62);var _0x36c77b=squel[_0x0c6f('0x22')]();var _0x3045ee=_(_0x5f0e44)[_0x0c6f('0x4d')]()[_0x0c6f('0x4e')](function(_0x83f867){return _[_0x0c6f('0x4f')](_0x4a140c,[_0x0c6f('0xb'),_0x83f867])?_0x83f867:undefined;})[_0x0c6f('0x50')]()['value']();if(_0x3045ee[_0x0c6f('0x15')]>0x0){_0x3045ee[_0x0c6f('0x24')](function(_0x58aa97){if(_0x58aa97===_0x5819ba){_0x36c77b[_0x0c6f('0x44')]('i.'+_0x5819ba+_0x0c6f('0x17'),[][_0x0c6f('0x51')](_0x5f0e44[_0x58aa97]));}else if(_0x58aa97===_0x0c6f('0x52')){var _0x1898c4=JSON[_0x0c6f('0x53')](_0x5f0e44[_0x58aa97])[_0x0c6f('0x54')];var _0x531615=JSON[_0x0c6f('0x53')](_0x5f0e44[_0x58aa97])[_0x0c6f('0x55')];_0x36c77b['and'](_0x0c6f('0x56'),_0x1898c4,_0x531615);}else{if(_0x5f0e44[_0x58aa97]===_0x0c6f('0x57')){_0x36c77b[_0x0c6f('0x44')]('i.'+_0x58aa97+_0x0c6f('0x58'));}else{_0x36c77b[_0x0c6f('0x44')]('i.'+_0x58aa97+_0x0c6f('0x59'),_0x5f0e44[_0x58aa97]);}}});}return _0x36c77b;}function parseQueryParameters(_0x3236cb,_0x34a1ed,_0x4b888f){var _0x9c5a81=getSqlClauses();return Promise['resolve']()[_0x0c6f('0x5a')](function(){return parseModelFields(_0x3236cb,_0x34a1ed,_0x4b888f);})['then'](function(_0x28fb77){_0x9c5a81['fields']['and'](_0x28fb77);return parseReadParameter(_0x34a1ed['read']);})[_0x0c6f('0x5a')](function(_0x4c476e){_0x9c5a81[_0x0c6f('0x3a')][_0x0c6f('0x44')](_0x4c476e);return parseTagParameter(_0x34a1ed[_0x0c6f('0x5b')]);})['then'](function(_0x47ff5b){_0x9c5a81[_0x0c6f('0x42')][_0x0c6f('0x43')][_0x0c6f('0x44')](_0x47ff5b);return parseSearchFilter(_0x3236cb,_0x34a1ed[_0x0c6f('0x5c')]);})['then'](function(_0x2c78a4){_0x9c5a81['filter']=_0x2c78a4;return _0x9c5a81;});}function checkAccountsRestrictions(_0x402736,_0x2c7dd4,_0x24ec18){var _0x1f1bfb=utils[_0x0c6f('0x7')](_0x402736);var _0x25fdda=_0x0c6f('0x5d')+_['capitalize'](_0x402736)+(_0x402736==='chat'?'Websites':'Accounts');var _0x1c47de=squel[_0x0c6f('0x22')]();return Promise[_0x0c6f('0x5e')]()[_0x0c6f('0x5a')](function(){if(_0x24ec18[_0x0c6f('0x5f')]&&_0x2c7dd4[_0x0c6f('0x8')]===_0x0c6f('0x60')){return _0x2c7dd4[_0x25fdda]({'attributes':['id'],'raw':!![]});}})[_0x0c6f('0x5a')](function(_0x6b892){if(_0x6b892){if(_0x6b892[_0x0c6f('0x15')]===0x0){_0x1c47de[_0x0c6f('0x44')]('i.'+_0x1f1bfb+_0x0c6f('0x58'));}else{_0x1c47de[_0x0c6f('0x44')]('i.'+_0x1f1bfb+_0x0c6f('0x17'),_['map'](_0x6b892,'id'));}}else if(!_0x24ec18[_0x1f1bfb]){_0x1c47de['and']('i.'+_0x1f1bfb+_0x0c6f('0x61'));}})['then'](function(){return _0x1c47de;});}function getClosedOrderClause(_0x102734,_0x110721){var _0x78d0c='';var _0x8930fc=[_0x0c6f('0x62'),'i.secondDisposition',_0x0c6f('0x63')];if(_0x102734===_0x0c6f('0x2d')){_0x8930fc[_0x0c6f('0x64')]('i.substatus');}if(_0x110721[_0x0c6f('0x65')]==='0'&&_0x102734===_0x0c6f('0x2d')){_0x78d0c='i.substatus';}else{if(_0x110721[_0x0c6f('0x65')]==='1'){_0x8930fc[_0x0c6f('0x66')]();}_0x78d0c=_0x0c6f('0x67')+_0x8930fc[_0x0c6f('0x68')](',\x20')+')';}return _0x78d0c;}function getFilteredInteractions(_0x35b1ea,_0x5a4a44,_0x302a1b,_0x1770bf){var _0x1361d7=utils[_0x0c6f('0x19')](_0x35b1ea);var _0x1012f4=_['capitalize'](_0x35b1ea)+_0x0c6f('0x69');var _0x2c0445=[];var _0x51fb41=getTagsQuery();var _0x5a1201={'type':db[_0x0c6f('0x6a')]['QueryTypes'][_0x0c6f('0x6b')],'raw':!![]};var _0x588742=[];var _0x2b9a08=[];return db[_0x0c6f('0x6c')][_0x0c6f('0x6d')](_0x51fb41[_0x0c6f('0x6e')](),_0x5a1201)['then'](function(_0x15a4c0){_0x2c0445=_[_0x0c6f('0x6f')](_0x15a4c0,'id');_0x5a1201=_[_0x0c6f('0x70')](_0x5a1201,{'model':db[_0x1012f4],'mapToModel':!![],'nest':!![]});if(_0x302a1b['fields']){_0x1770bf[_0x0c6f('0x71')][_0x0c6f('0x24')](function(_0x1fc327){_0x5a4a44[_0x0c6f('0xa')]('i.'+_0x1fc327);});}else{_0x5a4a44[_0x0c6f('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x5a4a44[_0x0c6f('0xa')]('a.key','Account.key');_0x5a4a44[_0x0c6f('0xa')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x35b1ea===_0x0c6f('0x2d')){_0x5a4a44['field'](_0x0c6f('0x72'),_0x0c6f('0x73'));_0x5a4a44['field'](_0x0c6f('0x74'),'contactName');_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x75'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x76'));_0x5a4a44[_0x0c6f('0xa')]('i.updatedAt');_0x5a4a44['field'](_0x0c6f('0x77'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x78'));_0x5a4a44['field'](_0x0c6f('0x79'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x7a'));_0x5a4a44['field'](_0x0c6f('0x7b'));_0x5a4a44['field'](_0x0c6f('0x7c'));_0x5a4a44['field'](_0x0c6f('0x63'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x7d'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x62'));_0x5a4a44[_0x0c6f('0xa')]('i.substatus');_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x7e'));_0x5a4a44['field'](_0x0c6f('0x7f'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x80'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x81'));}else if(_0x35b1ea===_0x0c6f('0x2c')){_0x5a4a44['field']('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',_0x0c6f('0x82'));}else{_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x83'),_0x0c6f('0x82'));}if(_0x35b1ea!==_0x0c6f('0x2d')){_0x5a4a44[_0x0c6f('0xa')]('i.*');}_0x5a4a44[_0x0c6f('0xa')]('c.firstName','Contact.firstName');_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x84'),'Contact.lastName');_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x85'),_0x0c6f('0x86'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x87'),_0x0c6f('0x88'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x89'),_0x0c6f('0x8a'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x8b'),'Contact.fax');_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x8c'),_0x0c6f('0x8d'));_0x5a4a44[_0x0c6f('0xa')]('o.internal',_0x0c6f('0x8e'));_0x5a4a44[_0x0c6f('0xa')](_0x0c6f('0x8f'),'TagIds');}if(_0x1770bf[_0x0c6f('0x90')]){_0x5a4a44[_0x0c6f('0x90')](_0x1770bf[_0x0c6f('0x90')]);}if(_0x1770bf[_0x0c6f('0x91')]){_0x5a4a44[_0x0c6f('0x91')](_0x1770bf[_0x0c6f('0x91')]);}return db[_0x0c6f('0x6c')][_0x0c6f('0x6d')](_0x5a4a44['toString'](),_0x5a1201);})[_0x0c6f('0x5a')](function(_0x173787){_0x588742=_0x173787;var _0x440430=getUsersQuery(_0x35b1ea,_0x588742);return db[_0x0c6f('0x6c')][_0x0c6f('0x6d')](_0x440430['toString'](),_0x5a1201);})['then'](function(_0x157ec8){_0x2b9a08=_[_0x0c6f('0x92')](_0x157ec8,_0x1361d7);if(_0x35b1ea==='mail'){return db[_0x0c6f('0x93')][_0x0c6f('0x94')]({'attributes':[_0x0c6f('0x95')],'raw':!![]});}})['then'](function(_0x4974a1){var _0x40ff90=_0x4974a1?_0x4974a1[_0x0c6f('0x95')]:undefined;var _0x4d2d79=_0x588742[_0x0c6f('0x4e')](function(_0x6e5b2f){return updateInteraction(_0x6e5b2f,_0x2c0445,_0x2b9a08,_0x40ff90);});return Promise['all'](_0x4d2d79);});}function countFilteredInteractions(_0x3f4f27,_0x452244){var _0x4f4fb8=_0x3f4f27['clone']();_0x4f4fb8[_0x0c6f('0xa')](_0x0c6f('0x96'));_0x4f4fb8[_0x0c6f('0xa')](_0x0c6f('0x97'),_0x0c6f('0x39'));var _0x3cf2af=utils[_0x0c6f('0x23')](_0x452244);if(!_['isEmpty'](_0x3cf2af)){_0x4f4fb8['where'](_0x0c6f('0x98'),_0x3cf2af);}var _0x4e11b3={'type':db[_0x0c6f('0x6a')][_0x0c6f('0x99')][_0x0c6f('0x6b')],'raw':!![]};return db[_0x0c6f('0x6c')][_0x0c6f('0x6d')](_0x4f4fb8[_0x0c6f('0x6e')](),_0x4e11b3);}module[_0x0c6f('0x9a')]={'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 a3bacaf..c7f2f29 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 _0x7044=['updateInteraction','TagIds','Tags','lodash','../../mysqldb','map','fullname','forEach','push','waiting','talking','answered','unmanaged','total','closed','disposition','abandoned','UserId','MailMessage','findOne','out','then','plainBody','lastMsgText','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7044,0x80));var _0x4704=function(_0x69fb6a,_0x46ec8d){_0x69fb6a=_0x69fb6a-0x0;var _0x2faee2=_0x7044[_0x69fb6a];return _0x2faee2;};'use strict';var _=require(_0x4704('0x0'));var db=require(_0x4704('0x1'))['db'];function getInteractionUsers(_0xfafbc5,_0x2aa634){return new Promise(function(_0x80c67c,_0x4474b5){try{var _0x446247=[];if(_0x2aa634[_0xfafbc5]){_0x446247=_0x2aa634[_0xfafbc5][_0x4704('0x2')](function(_0x1b8437){return{'id':_0x1b8437['id'],'fullname':_0x1b8437[_0x4704('0x3')]};});}return _0x80c67c(_0x446247);}catch(_0x4c8c24){_0x4474b5(_0x4c8c24);}});}function getInteractionTags(_0x4507a7,_0x298603){var _0x164547=[];if(_0x4507a7){_0x4507a7['split'](',')[_0x4704('0x4')](function(_0x244b52){_0x164547[_0x4704('0x5')](_0x298603[_0x244b52]);});}return _0x164547;}function updateWaitingCounter(_0x13ecb8){if(_0x13ecb8['waiting']){_0x13ecb8[_0x4704('0x6')]-=0x1;}}function updateInteractionCounters(_0x78d2f4){_0x78d2f4[_0x4704('0x6')]=0x0;_0x78d2f4[_0x4704('0x7')]=0x0;_0x78d2f4[_0x4704('0x8')]=0x0;_0x78d2f4[_0x4704('0x9')]=0x0;_0x78d2f4['abandoned']=0x0;_0x78d2f4[_0x4704('0xa')]=0x0;if(_0x78d2f4[_0x4704('0xb')]){if(_0x78d2f4[_0x4704('0xc')]===_0x4704('0xd')){_0x78d2f4[_0x4704('0xd')]+=0x1;updateWaitingCounter(_0x78d2f4);}if(_0x78d2f4[_0x4704('0xe')]){_0x78d2f4[_0x4704('0x8')]+=0x1;if(_0x78d2f4['talking']){_0x78d2f4[_0x4704('0x7')]-=0x1;}}else{if(_0x78d2f4[_0x4704('0xc')]){_0x78d2f4[_0x4704('0x9')]+=0x1;updateWaitingCounter(_0x78d2f4);}}}else{if(!_0x78d2f4['UserId']){_0x78d2f4[_0x4704('0x6')]+=0x1;}if(_0x78d2f4[_0x4704('0xe')]){_0x78d2f4[_0x4704('0x7')]+=0x1;updateWaitingCounter(_0x78d2f4);}}_0x78d2f4['total']+=0x1;return _0x78d2f4;}function getLastMessageText(_0x1a0b5b){return db[_0x4704('0xf')][_0x4704('0x10')]({'where':{'$and':[{'MailInteractionId':_0x1a0b5b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4704('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x4704('0x12')](function(_0x31d970){if(_0x31d970&&_0x31d970[_0x4704('0x13')]){_0x1a0b5b[_0x4704('0x14')]=_['trimStart'](_0x31d970[_0x4704('0x13')]);}return _0x1a0b5b;})[_0x4704('0x15')](function(_0x3fa2b5){throw _0x3fa2b5;});}exports[_0x4704('0x16')]=function(_0x3a03c7,_0x537a71,_0x432344,_0x218801){return new Promise(function(_0x5e42fc,_0x36ec2e){return getInteractionUsers(_0x3a03c7['id'],_0x432344)['then'](function(_0x15e782){_0x3a03c7['Users']=_0x15e782;return getInteractionTags(_0x3a03c7[_0x4704('0x17')],_0x537a71);})['then'](function(_0x288ad4){_0x3a03c7[_0x4704('0x18')]=_0x288ad4;delete _0x3a03c7['TagIds'];return updateInteractionCounters(_0x3a03c7);})['then'](function(_0x3eca35){if(_0x218801){return getLastMessageText(_0x3eca35);}else{return _0x3eca35;}})['then'](function(_0x27ef8a){_0x5e42fc(_0x27ef8a);})[_0x4704('0x15')](function(_0x4413c4){_0x36ec2e(_0x4413c4);});});}; \ No newline at end of file +var _0x1271=['trimStart','catch','TagIds','lodash','../../mysqldb','map','split','forEach','push','waiting','answered','total','disposition','abandoned','talking','UserId','MailMessage','findOne','out','plainBody','then','lastMsgText'];(function(_0x2c15b3,_0x1c29fc){var _0x5808fb=function(_0x3c126c){while(--_0x3c126c){_0x2c15b3['push'](_0x2c15b3['shift']());}};_0x5808fb(++_0x1c29fc);}(_0x1271,0x163));var _0x1127=function(_0x1eb930,_0x18b2cd){_0x1eb930=_0x1eb930-0x0;var _0x27afe9=_0x1271[_0x1eb930];return _0x27afe9;};'use strict';var _=require(_0x1127('0x0'));var db=require(_0x1127('0x1'))['db'];function getInteractionUsers(_0x1a8289,_0x55fc31){return new Promise(function(_0x394255,_0x4375d0){try{var _0x49c7d7=[];if(_0x55fc31[_0x1a8289]){_0x49c7d7=_0x55fc31[_0x1a8289][_0x1127('0x2')](function(_0x51e93d){return{'id':_0x51e93d['id'],'fullname':_0x51e93d['fullname']};});}return _0x394255(_0x49c7d7);}catch(_0x5d1996){_0x4375d0(_0x5d1996);}});}function getInteractionTags(_0x514c47,_0x37ec60){var _0x5bb44e=[];if(_0x514c47){_0x514c47[_0x1127('0x3')](',')[_0x1127('0x4')](function(_0x53577a){_0x5bb44e[_0x1127('0x5')](_0x37ec60[_0x53577a]);});}return _0x5bb44e;}function updateWaitingCounter(_0x6417ad){if(_0x6417ad[_0x1127('0x6')]){_0x6417ad[_0x1127('0x6')]-=0x1;}}function updateInteractionCounters(_0x471be4){_0x471be4[_0x1127('0x6')]=0x0;_0x471be4['talking']=0x0;_0x471be4[_0x1127('0x7')]=0x0;_0x471be4['unmanaged']=0x0;_0x471be4['abandoned']=0x0;_0x471be4[_0x1127('0x8')]=0x0;if(_0x471be4['closed']){if(_0x471be4[_0x1127('0x9')]===_0x1127('0xa')){_0x471be4['abandoned']+=0x1;updateWaitingCounter(_0x471be4);}if(_0x471be4['UserId']){_0x471be4[_0x1127('0x7')]+=0x1;if(_0x471be4['talking']){_0x471be4[_0x1127('0xb')]-=0x1;}}else{if(_0x471be4[_0x1127('0x9')]){_0x471be4['unmanaged']+=0x1;updateWaitingCounter(_0x471be4);}}}else{if(!_0x471be4[_0x1127('0xc')]){_0x471be4[_0x1127('0x6')]+=0x1;}if(_0x471be4[_0x1127('0xc')]){_0x471be4[_0x1127('0xb')]+=0x1;updateWaitingCounter(_0x471be4);}}_0x471be4[_0x1127('0x8')]+=0x1;return _0x471be4;}function getLastMessageText(_0x40daf9){return db[_0x1127('0xd')][_0x1127('0xe')]({'where':{'$and':[{'MailInteractionId':_0x40daf9['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1127('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x1127('0x10')],'order':'-id','raw':!![]})[_0x1127('0x11')](function(_0xf2a5c1){if(_0xf2a5c1&&_0xf2a5c1[_0x1127('0x10')]){_0x40daf9[_0x1127('0x12')]=_[_0x1127('0x13')](_0xf2a5c1['plainBody']);}return _0x40daf9;})[_0x1127('0x14')](function(_0xcc0560){throw _0xcc0560;});}exports['updateInteraction']=function(_0x357913,_0x205b10,_0x4a890a,_0x39e408){return new Promise(function(_0x13ae4e,_0x569671){return getInteractionUsers(_0x357913['id'],_0x4a890a)[_0x1127('0x11')](function(_0x4e98ea){_0x357913['Users']=_0x4e98ea;return getInteractionTags(_0x357913[_0x1127('0x15')],_0x205b10);})[_0x1127('0x11')](function(_0xa75b89){_0x357913['Tags']=_0xa75b89;delete _0x357913[_0x1127('0x15')];return updateInteractionCounters(_0x357913);})[_0x1127('0x11')](function(_0xa323b5){if(_0x39e408){return getLastMessageText(_0xa323b5);}else{return _0xa323b5;}})[_0x1127('0x11')](function(_0x106a0c){_0x13ae4e(_0x106a0c);})['catch'](function(_0x5d0ae5){_0x569671(_0x5d0ae5);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 89d38b6..028d69a 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 _0xbb60=['../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','chat','Website','Account','capitalize','upperFirst','InteractionId','unknown','_interaction_has_tags','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','stringify','findOne','info','catch','error','lodash'];(function(_0x54aea8,_0x371aa6){var _0x21991c=function(_0x83e180){while(--_0x83e180){_0x54aea8['push'](_0x54aea8['shift']());}};_0x21991c(++_0x371aa6);}(_0xbb60,0xd7));var _0x0bb6=function(_0x75191b,_0x4b80a6){_0x75191b=_0x75191b-0x0;var _0x393c5e=_0xbb60[_0x75191b];return _0x393c5e;};'use strict';var _=require(_0x0bb6('0x0'));var db=require(_0x0bb6('0x1'))['db'];var loggers={'openchannel':require(_0x0bb6('0x2'))(_0x0bb6('0x3')),'mail':require(_0x0bb6('0x2'))(_0x0bb6('0x4')),'fax':require(_0x0bb6('0x2'))(_0x0bb6('0x5')),'sms':require(_0x0bb6('0x2'))(_0x0bb6('0x6')),'chat':require(_0x0bb6('0x2'))(_0x0bb6('0x7')),'whatsapp':require(_0x0bb6('0x2'))(_0x0bb6('0x8'))};function getAccountFK(_0x4c30e3){return _['capitalize'](_0x4c30e3)+(_0x4c30e3===_0x0bb6('0x9')?_0x0bb6('0xa'):_0x0bb6('0xb'))+'Id';}function getInteractionFK(_0x36e06b){return _[_0x0bb6('0xc')](_0x36e06b)+'InteractionId';}function getInteractionId(_0x3c15a3,_0x4c80e3,_0xa8fa4f){if(_0x3c15a3&&_0x3c15a3[_[_0x0bb6('0xd')](_0xa8fa4f)+_0x0bb6('0xe')]){return _0x3c15a3[_['upperFirst'](_0xa8fa4f)+_0x0bb6('0xe')];}else if(_0x3c15a3&&_0x3c15a3['id']){return _0x3c15a3['id'];}else if(_0x4c80e3&&_0x4c80e3['id']){return _0x4c80e3['id'];}else{return _0x0bb6('0xf');}}function getInteractionsTables(_0x257637){return{'accounts':_0x257637+'_'+(_0x257637===_0x0bb6('0x9')?'websites':'accounts'),'interactions':_0x257637+'_interactions','interactionsTags':_0x257637+_0x0bb6('0x10'),'messages':_0x257637+_0x0bb6('0x11'),'userInteractions':'user_has_'+_0x257637+'_interactions'};}function getSelectedTags(_0x4d3a8c){var _0x248a68=[];if(_0x4d3a8c){_0x248a68=Array[_0x0bb6('0x12')](_0x4d3a8c)?_0x4d3a8c:[_0x4d3a8c];}return _0x248a68;}function log(_0x59280a,_0xfa99b5,_0x34b8c1,_0x1d29f1,_0x468ae4,_0x2a13f4){loggers[_0x468ae4[_0x0bb6('0x13')]()][_0x59280a](_0x0bb6('0x14'),_0x2a13f4['toUpperCase'](),_0xfa99b5?_0xfa99b5['id']:null,_0xfa99b5?_0xfa99b5[_0x0bb6('0x15')]:null,_0xfa99b5?_0xfa99b5['role']:null,getInteractionId(_0x34b8c1,_0x1d29f1,_0x468ae4),_0x34b8c1?JSON[_0x0bb6('0x16')](_0x34b8c1):'null');}function updateUser(_0x496653,_0xd7af44,_0x5f0e1e,_0x2fc4eb,_0x3d179f){db[_[_0x0bb6('0xd')](_0x2fc4eb)+'Interaction'][_0x0bb6('0x17')]({'where':{'id':getInteractionId(_0xd7af44,_0x5f0e1e,_0x2fc4eb)}})['then'](function(_0x158b16){if(_0x158b16){return _0x158b16['update']({'UserId':_0x496653?_0x496653['id']:null});}})['then'](function(_0x25d206){if(_0x25d206){log(_0x0bb6('0x18'),_0x496653,_0xd7af44,_0x5f0e1e,_0x2fc4eb,_0x3d179f);}})[_0x0bb6('0x19')](function(){log(_0x0bb6('0x1a'),_0x496653,_0xd7af44,_0x5f0e1e,_0x2fc4eb,_0x3d179f);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x6698=['upperFirst','unknown','websites','accounts','_interactions','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction','findOne','then','info','catch','exports','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId'];(function(_0xfdde5f,_0x3d173b){var _0x3c8e77=function(_0x3fc9dd){while(--_0x3fc9dd){_0xfdde5f['push'](_0xfdde5f['shift']());}};_0x3c8e77(++_0x3d173b);}(_0x6698,0x116));var _0x8669=function(_0x23c2f8,_0x1b1a34){_0x23c2f8=_0x23c2f8-0x0;var _0x5045e3=_0x6698[_0x23c2f8];return _0x5045e3;};'use strict';var _=require('lodash');var db=require(_0x8669('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x8669('0x1'))(_0x8669('0x2')),'fax':require('../../config/logger')(_0x8669('0x3')),'sms':require(_0x8669('0x1'))(_0x8669('0x4')),'chat':require('../../config/logger')(_0x8669('0x5')),'whatsapp':require('../../config/logger')(_0x8669('0x6'))};function getAccountFK(_0x340946){return _[_0x8669('0x7')](_0x340946)+(_0x340946===_0x8669('0x8')?_0x8669('0x9'):_0x8669('0xa'))+'Id';}function getInteractionFK(_0x133a62){return _['capitalize'](_0x133a62)+_0x8669('0xb');}function getInteractionId(_0x1d040c,_0x28648c,_0x25c722){if(_0x1d040c&&_0x1d040c[_['upperFirst'](_0x25c722)+'InteractionId']){return _0x1d040c[_[_0x8669('0xc')](_0x25c722)+'InteractionId'];}else if(_0x1d040c&&_0x1d040c['id']){return _0x1d040c['id'];}else if(_0x28648c&&_0x28648c['id']){return _0x28648c['id'];}else{return _0x8669('0xd');}}function getInteractionsTables(_0xd689d0){return{'accounts':_0xd689d0+'_'+(_0xd689d0==='chat'?_0x8669('0xe'):_0x8669('0xf')),'interactions':_0xd689d0+_0x8669('0x10'),'interactionsTags':_0xd689d0+'_interaction_has_tags','messages':_0xd689d0+_0x8669('0x11'),'userInteractions':'user_has_'+_0xd689d0+_0x8669('0x10')};}function getSelectedTags(_0x3a71a3){var _0x522a39=[];if(_0x3a71a3){_0x522a39=Array['isArray'](_0x3a71a3)?_0x3a71a3:[_0x3a71a3];}return _0x522a39;}function log(_0x1a510e,_0x20b620,_0x4b3657,_0x1c6287,_0x459bef,_0x4887a8){loggers[_0x459bef[_0x8669('0x12')]()][_0x1a510e](_0x8669('0x13'),_0x4887a8[_0x8669('0x14')](),_0x20b620?_0x20b620['id']:null,_0x20b620?_0x20b620['name']:null,_0x20b620?_0x20b620['role']:null,getInteractionId(_0x4b3657,_0x1c6287,_0x459bef),_0x4b3657?JSON[_0x8669('0x15')](_0x4b3657):_0x8669('0x16'));}function updateUser(_0x4f9514,_0x18cb14,_0x139c42,_0x3f0881,_0x4957e9){db[_[_0x8669('0xc')](_0x3f0881)+_0x8669('0x17')][_0x8669('0x18')]({'where':{'id':getInteractionId(_0x18cb14,_0x139c42,_0x3f0881)}})['then'](function(_0x14ebab){if(_0x14ebab){return _0x14ebab['update']({'UserId':_0x4f9514?_0x4f9514['id']:null});}})[_0x8669('0x19')](function(_0x485678){if(_0x485678){log(_0x8669('0x1a'),_0x4f9514,_0x18cb14,_0x139c42,_0x3f0881,_0x4957e9);}})[_0x8669('0x1b')](function(){log('error',_0x4f9514,_0x18cb14,_0x139c42,_0x3f0881,_0x4957e9);});}module[_0x8669('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 fd860c6..a3d640a 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 _0x285f=['split','createDecipher','aes-256-ctr','update','utf8','final','hasOwnProperty','use','findOne','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license'];(function(_0x3ba27f,_0x308ae4){var _0x3511d9=function(_0xa1f427){while(--_0xa1f427){_0x3ba27f['push'](_0x3ba27f['shift']());}};_0x3511d9(++_0x308ae4);}(_0x285f,0xc2));var _0xf285=function(_0x32d87e,_0x34ea68){_0x32d87e=_0x32d87e-0x0;var _0x32efd2=_0x285f[_0x32d87e];return _0x32efd2;};'use strict';var crypto=require(_0xf285('0x0'));var util=require(_0xf285('0x1'));var compose=require(_0xf285('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xf285('0x3'));function getValueFromLicense(_0x5cdc59,_0x43e37a){if(_0x5cdc59&&_0x43e37a){if(_0x43e37a[_0xf285('0x4')]&&_0x43e37a[_0xf285('0x5')]){var _0x5b0612=_0x43e37a['data1'];var _0x433993=_0x43e37a[_0xf285('0x5')];var _0x43f4d9=_0x5b0612[_0xf285('0x6')]('-')[0x4];var _0x5367b1=_0x5b0612['split']('-')[0x0];var _0x52b17e=crypto[_0xf285('0x7')](_0xf285('0x8'),util['format']('%s:%s:%s',_0x43f4d9,_0x5b0612,_0x5367b1));var _0x57bf0a=_0x52b17e[_0xf285('0x9')](_0x433993,'base64',_0xf285('0xa'));_0x57bf0a+=_0x52b17e[_0xf285('0xb')](_0xf285('0xa'));var _0x25b438=JSON['parse'](_0x57bf0a);return _0x25b438[_0xf285('0xc')](_0x5cdc59)?_0x25b438[_0x5cdc59]:null;}}return null;}function isLimit(_0x2c351d,_0x133f99,_0x6163a7,_0x9c5113){var _0x53c46e=_0x133f99;return compose()[_0xf285('0xd')](function(_0x1e21e3,_0x3469f8,_0x59f41d){return db['License'][_0xf285('0xe')]({'where':{'id':0x1},'raw':!![]})[_0xf285('0xf')](function(_0xf0c1e7){var _0x385e8c=getValueFromLicense(_0x2c351d,_0xf0c1e7);return _0x385e8c?_0x385e8c:_0x53c46e;})[_0xf285('0xf')](function(_0x188113){_0x53c46e=_0x188113;return _0x6163a7[_0xf285('0x10')](_0x9c5113);})[_0xf285('0xf')](function(_0x444fab){if(_0x444fab>=_0x53c46e){return _0x3469f8['status'](0x193)[_0xf285('0x11')]({'message':util[_0xf285('0x12')](_0xf285('0x13'),_0x2c351d)});}_0x59f41d();})[_0xf285('0x14')](function(_0x424b5c){_0x59f41d(_0x424b5c);});});}function isUserLimit(){return isLimit(_0xf285('0x15'),0x1,db[_0xf285('0x16')],{'where':{'$or':[{'role':_0xf285('0x17')},{'role':'user'}]}});}exports[_0xf285('0x18')]=isUserLimit; \ No newline at end of file +var _0xd2bc=['hasOwnProperty','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse'];(function(_0x4e2d12,_0x3d4649){var _0x2c2095=function(_0x21bb5e){while(--_0x21bb5e){_0x4e2d12['push'](_0x4e2d12['shift']());}};_0x2c2095(++_0x3d4649);}(_0xd2bc,0x186));var _0xcd2b=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0xd2bc[_0x39d39d];return _0x577ac3;};'use strict';var crypto=require(_0xcd2b('0x0'));var util=require(_0xcd2b('0x1'));var compose=require(_0xcd2b('0x2'));var db=require(_0xcd2b('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1563be,_0x24d931){if(_0x1563be&&_0x24d931){if(_0x24d931['data1']&&_0x24d931[_0xcd2b('0x4')]){var _0x1f017f=_0x24d931['data1'];var _0x1a4f8c=_0x24d931['license'];var _0x4355c5=_0x1f017f[_0xcd2b('0x5')]('-')[0x4];var _0x1f5971=_0x1f017f[_0xcd2b('0x5')]('-')[0x0];var _0x3ce054=crypto[_0xcd2b('0x6')](_0xcd2b('0x7'),util[_0xcd2b('0x8')](_0xcd2b('0x9'),_0x4355c5,_0x1f017f,_0x1f5971));var _0x38619a=_0x3ce054[_0xcd2b('0xa')](_0x1a4f8c,_0xcd2b('0xb'),_0xcd2b('0xc'));_0x38619a+=_0x3ce054[_0xcd2b('0xd')](_0xcd2b('0xc'));var _0x4347ba=JSON[_0xcd2b('0xe')](_0x38619a);return _0x4347ba[_0xcd2b('0xf')](_0x1563be)?_0x4347ba[_0x1563be]:null;}}return null;}function isLimit(_0x28644d,_0x4989f7,_0x281860,_0x4421dd){var _0x10aa79=_0x4989f7;return compose()[_0xcd2b('0x10')](function(_0x211fd1,_0x52fb2b,_0x496883){return db[_0xcd2b('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xcd2b('0x12')](function(_0x3d78bb){var _0x9e0b26=getValueFromLicense(_0x28644d,_0x3d78bb);return _0x9e0b26?_0x9e0b26:_0x10aa79;})[_0xcd2b('0x12')](function(_0x416bb5){_0x10aa79=_0x416bb5;return _0x281860[_0xcd2b('0x13')](_0x4421dd);})[_0xcd2b('0x12')](function(_0xec5270){if(_0xec5270>=_0x10aa79){return _0x52fb2b[_0xcd2b('0x14')](0x193)[_0xcd2b('0x15')]({'message':util[_0xcd2b('0x8')](_0xcd2b('0x16'),_0x28644d)});}_0x496883();})[_0xcd2b('0x17')](function(_0x14b912){_0x496883(_0x14b912);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xcd2b('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0xcd2b('0x19')}]}});}exports[_0xcd2b('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 475b05d..a2c8516 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 _0x412a=['push','buildExpression','operator','$between','value','$gt','add','days','YYYY-MM-DD','castTo','CAST(','\x20AS\x20','text','includes','$ne','\x20IS\x20NULL)','$in','$notIn','$eq','=\x20?','<>\x20?','$startsWith','$endsWith','<\x20?','>\x20?','$lte','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','shift','pop','DATE','format','utcOffset','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','forEach','filter','indexOf','map','conditions'];(function(_0x3a3675,_0xf8c0f4){var _0x2586ea=function(_0x12fcc7){while(--_0x12fcc7){_0x3a3675['push'](_0x3a3675['shift']());}};_0x2586ea(++_0xf8c0f4);}(_0x412a,0xba));var _0xa412=function(_0x52a882,_0x32652f){_0x52a882=_0x52a882-0x0;var _0x416d7d=_0x412a[_0x52a882];return _0x416d7d;};'use strict';var _=require(_0xa412('0x0'));var moment=require(_0xa412('0x1'));exports[_0xa412('0x2')]=function(_0x610dea){var _0x48dc58={'conditions':[]};_0x48dc58[_0xa412('0x3')]=_[_0xa412('0x4')](_0x610dea,_0xa412('0x5'))?'or':_0xa412('0x6');var _0x2e2a46=_0x610dea['replace']('[$and]','')[_0xa412('0x7')]('[$or]','')[_0xa412('0x8')]('||');for(var _0x8aaa6e=0x0;_0x8aaa6e<_0x2e2a46['length'];_0x8aaa6e++){var _0x4ebd61=_0x2e2a46[_0x8aaa6e]['split'](':=');var _0x44e017=_0x4ebd61[0x0];var _0x13f741=_0x4ebd61['slice'](0x1);_0x13f741[_0xa412('0x9')](function(_0x22d949){var _0x4a24d4=_0x22d949['split']('[')['shift']();var _0x1042d7=_0x22d949['match'](/\[(.*?)\]/g);_0x1042d7[_0xa412('0x9')](function(_0x4f2060){var _0x5b2018=_0x4f2060[_0xa412('0x8')]('[')[_0xa412('0xa')](function(_0x3ad2aa){return _0x3ad2aa[_0xa412('0xb')](']')>-0x1;})[_0xa412('0xc')](function(_0x4c42c9){return _0x4c42c9[_0xa412('0x8')](']')[0x0];})[0x0];_0x48dc58[_0xa412('0xd')][_0xa412('0xe')]({'field':_0x44e017,'operator':_0x4a24d4,'value':_0x5b2018});});});}return _0x48dc58;};exports[_0xa412('0xf')]=function(_0x1009cd,_0x2fefee,_0x4d8223){var _0x3f7d23={};if(_0x2fefee==='DATE'){if(_0x4d8223[_0xa412('0x10')]==='$eq'){_0x4d8223[_0xa412('0x10')]=_0xa412('0x11');_0x4d8223[_0xa412('0x12')]+=','+_0x4d8223[_0xa412('0x12')];}else if(_['includes']([_0xa412('0x13'),'$lte'],_0x4d8223[_0xa412('0x10')])){_0x4d8223['value']=moment(_0x4d8223[_0xa412('0x12')])[_0xa412('0x14')](0x1,_0xa412('0x15'))['format'](_0xa412('0x16'));}}if(_0x4d8223[_0xa412('0x17')]){_0x2fefee=_0x4d8223[_0xa412('0x17')];_0x3f7d23['text']=_0xa412('0x18')+_0x1009cd+'.'+_0x4d8223['field']+_0xa412('0x19')+_0x4d8223[_0xa412('0x17')]+')\x20'+parseOperator(_0x4d8223[_0xa412('0x10')]);}else{_0x3f7d23[_0xa412('0x1a')]=_0x1009cd+'.'+_0x4d8223['field']+'\x20'+parseOperator(_0x4d8223[_0xa412('0x10')]);}if(_[_0xa412('0x1b')]([_0xa412('0x1c'),'$notIn'],_0x4d8223[_0xa412('0x10')]))_0x3f7d23[_0xa412('0x1a')]='('+_0x3f7d23[_0xa412('0x1a')]+'\x20OR\x20'+_0x1009cd+'.'+_0x4d8223['field']+_0xa412('0x1d');_0x3f7d23[_0xa412('0x12')]=parseValue(_0x2fefee,_0x4d8223[_0xa412('0x10')],_0x4d8223['value']);return _0x3f7d23;};function parseOperator(_0x276701){var _0x2bde42;switch(_0x276701){case _0xa412('0x1e'):_0x2bde42='IN\x20?';break;case _0xa412('0x1f'):_0x2bde42='NOT\x20IN\x20?';break;case _0xa412('0x20'):_0x2bde42=_0xa412('0x21');break;case _0xa412('0x1c'):_0x2bde42=_0xa412('0x22');break;case'$substring':case _0xa412('0x23'):case _0xa412('0x24'):_0x2bde42='LIKE\x20?';break;case'$lt':_0x2bde42=_0xa412('0x25');break;case _0xa412('0x13'):_0x2bde42=_0xa412('0x26');break;case _0xa412('0x27'):_0x2bde42=_0xa412('0x28');break;case'$gte':_0x2bde42=_0xa412('0x29');break;case _0xa412('0x11'):_0x2bde42=_0xa412('0x2a');break;}return _0x2bde42;}function parseValue(_0x309128,_0x22de42,_0x6e5a4e){var _0xd64ea5={'start':undefined,'end':undefined};switch(_0x22de42){case _0xa412('0x1e'):case _0xa412('0x1f'):_0xd64ea5[_0xa412('0x2b')]=_0x6e5a4e[_0xa412('0x8')](',');break;case _0xa412('0x2c'):_0xd64ea5[_0xa412('0x2b')]='%'+_0x6e5a4e+'%';break;case _0xa412('0x23'):_0xd64ea5['start']=_0x6e5a4e+'%';break;case _0xa412('0x24'):_0xd64ea5['start']='%'+_0x6e5a4e;break;case _0xa412('0x11'):var _0x2da42b=_0x6e5a4e['split'](',');var _0x6e5a4e=_0x2da42b[_0xa412('0x2d')]();var _0x23d43c=_0x2da42b[_0xa412('0x2e')]();if(_0x309128===_0xa412('0x2f')){_0x6e5a4e=moment(_0x6e5a4e)['utcOffset'](0x0,!![])[_0xa412('0x30')]();_0x23d43c=moment(_0x23d43c)[_0xa412('0x31')](0x0,!![])[_0xa412('0x14')](0x17,'hours')['add'](0x3b,'minutes')[_0xa412('0x14')](0x3b,'seconds')[_0xa412('0x30')]();}_0xd64ea5={'start':_0x6e5a4e,'end':_0x23d43c};break;default:_0xd64ea5['start']=_0x6e5a4e;break;}return _0xd64ea5;} \ No newline at end of file +var _0x037b=['lodash','moment','parseSearch','sqlOperator','startsWith','replace','[$and]','split','length','forEach','shift','match','push','buildExpression','DATE','operator','$eq','$between','includes','$gt','value','add','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','minutes','seconds'];(function(_0x2c18cd,_0x337bc9){var _0x44f917=function(_0x55beda){while(--_0x55beda){_0x2c18cd['push'](_0x2c18cd['shift']());}};_0x44f917(++_0x337bc9);}(_0x037b,0x198));var _0xb037=function(_0x413310,_0x50883b){_0x413310=_0x413310-0x0;var _0x48c11b=_0x037b[_0x413310];return _0x48c11b;};'use strict';var _=require(_0xb037('0x0'));var moment=require(_0xb037('0x1'));exports[_0xb037('0x2')]=function(_0xa14b34){var _0xbf4caf={'conditions':[]};_0xbf4caf[_0xb037('0x3')]=_[_0xb037('0x4')](_0xa14b34,'[$or]')?'or':'and';var _0x4835a9=_0xa14b34[_0xb037('0x5')](_0xb037('0x6'),'')[_0xb037('0x5')]('[$or]','')[_0xb037('0x7')]('||');for(var _0x215951=0x0;_0x215951<_0x4835a9[_0xb037('0x8')];_0x215951++){var _0x14e6a8=_0x4835a9[_0x215951][_0xb037('0x7')](':=');var _0x55298d=_0x14e6a8[0x0];var _0x36bc64=_0x14e6a8['slice'](0x1);_0x36bc64[_0xb037('0x9')](function(_0x51bd88){var _0x3a87db=_0x51bd88[_0xb037('0x7')]('[')[_0xb037('0xa')]();var _0x236f6b=_0x51bd88[_0xb037('0xb')](/\[(.*?)\]/g);_0x236f6b[_0xb037('0x9')](function(_0xb575eb){var _0x5b37d2=_0xb575eb['split']('[')['filter'](function(_0x1b6cea){return _0x1b6cea['indexOf'](']')>-0x1;})['map'](function(_0x5cf6d3){return _0x5cf6d3[_0xb037('0x7')](']')[0x0];})[0x0];_0xbf4caf['conditions'][_0xb037('0xc')]({'field':_0x55298d,'operator':_0x3a87db,'value':_0x5b37d2});});});}return _0xbf4caf;};exports[_0xb037('0xd')]=function(_0x44d4fb,_0x5399ec,_0x32f9e4){var _0x414ae0={};if(_0x5399ec===_0xb037('0xe')){if(_0x32f9e4[_0xb037('0xf')]===_0xb037('0x10')){_0x32f9e4[_0xb037('0xf')]=_0xb037('0x11');_0x32f9e4['value']+=','+_0x32f9e4['value'];}else if(_[_0xb037('0x12')]([_0xb037('0x13'),'$lte'],_0x32f9e4[_0xb037('0xf')])){_0x32f9e4[_0xb037('0x14')]=moment(_0x32f9e4[_0xb037('0x14')])[_0xb037('0x15')](0x1,_0xb037('0x16'))[_0xb037('0x17')](_0xb037('0x18'));}}if(_0x32f9e4[_0xb037('0x19')]){_0x5399ec=_0x32f9e4[_0xb037('0x19')];_0x414ae0['text']=_0xb037('0x1a')+_0x44d4fb+'.'+_0x32f9e4[_0xb037('0x1b')]+_0xb037('0x1c')+_0x32f9e4[_0xb037('0x19')]+')\x20'+parseOperator(_0x32f9e4['operator']);}else{_0x414ae0[_0xb037('0x1d')]=_0x44d4fb+'.'+_0x32f9e4['field']+'\x20'+parseOperator(_0x32f9e4[_0xb037('0xf')]);}if(_['includes']([_0xb037('0x1e'),_0xb037('0x1f')],_0x32f9e4[_0xb037('0xf')]))_0x414ae0[_0xb037('0x1d')]='('+_0x414ae0[_0xb037('0x1d')]+'\x20OR\x20'+_0x44d4fb+'.'+_0x32f9e4['field']+_0xb037('0x20');_0x414ae0['value']=parseValue(_0x5399ec,_0x32f9e4[_0xb037('0xf')],_0x32f9e4['value']);return _0x414ae0;};function parseOperator(_0x48324b){var _0x559183;switch(_0x48324b){case _0xb037('0x21'):_0x559183='IN\x20?';break;case _0xb037('0x1f'):_0x559183=_0xb037('0x22');break;case _0xb037('0x10'):_0x559183=_0xb037('0x23');break;case _0xb037('0x1e'):_0x559183='<>\x20?';break;case _0xb037('0x24'):case _0xb037('0x25'):case _0xb037('0x26'):_0x559183=_0xb037('0x27');break;case _0xb037('0x28'):_0x559183='<\x20?';break;case _0xb037('0x13'):_0x559183=_0xb037('0x29');break;case _0xb037('0x2a'):_0x559183=_0xb037('0x2b');break;case _0xb037('0x2c'):_0x559183='>=\x20?';break;case _0xb037('0x11'):_0x559183=_0xb037('0x2d');break;}return _0x559183;}function parseValue(_0x4287cf,_0x799dd4,_0x2e5e68){var _0x540e14={'start':undefined,'end':undefined};switch(_0x799dd4){case _0xb037('0x21'):case _0xb037('0x1f'):_0x540e14[_0xb037('0x2e')]=_0x2e5e68[_0xb037('0x7')](',');break;case _0xb037('0x24'):_0x540e14['start']='%'+_0x2e5e68+'%';break;case _0xb037('0x25'):_0x540e14['start']=_0x2e5e68+'%';break;case'$endsWith':_0x540e14['start']='%'+_0x2e5e68;break;case _0xb037('0x11'):var _0x4197d0=_0x2e5e68[_0xb037('0x7')](',');var _0x2e5e68=_0x4197d0[_0xb037('0xa')]();var _0x107ae4=_0x4197d0['pop']();if(_0x4287cf===_0xb037('0xe')){_0x2e5e68=moment(_0x2e5e68)[_0xb037('0x2f')](0x0,!![])[_0xb037('0x17')]();_0x107ae4=moment(_0x107ae4)[_0xb037('0x2f')](0x0,!![])[_0xb037('0x15')](0x17,_0xb037('0x30'))['add'](0x3b,_0xb037('0x31'))['add'](0x3b,_0xb037('0x32'))[_0xb037('0x17')]();}_0x540e14={'start':_0x2e5e68,'end':_0x107ae4};break;default:_0x540e14[_0xb037('0x2e')]=_0x2e5e68;break;}return _0x540e14;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bbe2176..53021e4 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 _0x8169=['intersection','attributes','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','include','includeAll','lodash','moment','parse','includes','keys','model','fields','raw','split','filters','forOwn','type','DATE','isPlainObject','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map','priority','cast','col','DESC','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id'];(function(_0x5e9f47,_0x5bbe9a){var _0x20a142=function(_0x3cbd56){while(--_0x3cbd56){_0x5e9f47['push'](_0x5e9f47['shift']());}};_0x20a142(++_0x5bbe9a);}(_0x8169,0xd4));var _0x9816=function(_0x1c6be2,_0x4a44da){_0x1c6be2=_0x1c6be2-0x0;var _0x383a7e=_0x8169[_0x1c6be2];return _0x383a7e;};'use strict';var _=require(_0x9816('0x0'));var sequelize=require('sequelize');var moment=require(_0x9816('0x1'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x48413a){var _0x33c146=['ne'];try{var _0x2c4285=JSON[_0x9816('0x2')](_0x48413a);var _0x531722=Object['keys'](_0x2c4285)[0x0];return _0x33c146[_0x9816('0x3')](_0x531722);}catch(_0x2f113e){return![];}}function getOperatorValue(_0x4d35a7){var _0x1f16b8=JSON[_0x9816('0x2')](_0x4d35a7);var _0x4e2bcc=Object[_0x9816('0x4')](_0x1f16b8)[0x0];var _0x559e81=_0x1f16b8[_0x4e2bcc];return{['$'+_0x4e2bcc]:_0x559e81};}function parseIncludeModel(_0x54de8a){var _0x28df6c=JSON['parse'](_0x54de8a);return{'model':db[_0x28df6c[_0x9816('0x5')]],'as':_0x28df6c['alias'],'attributes':_0x28df6c[_0x9816('0x6')],'raw':_0x28df6c[_0x9816('0x7')]};}exports[_0x9816('0x6')]=function(_0x1d1182){var _0x292b2c=null;if(_0x1d1182){_0x292b2c=_0x1d1182[_0x9816('0x8')](',');}return _0x292b2c;};exports[_0x9816('0x9')]=function(_0xd81052,_0x35b87f){var _0x89d08c={};if(!_['isEmpty'](_0xd81052)){_[_0x9816('0xa')](_0xd81052,function(_0xa1d569,_0x15ecee){try{if(_0x35b87f){var _0x476e3a=_['find'](_0x35b87f,{'name':_0x15ecee})||{};if(hasSequelizeOperator(_0xa1d569)){_0x89d08c[_0x15ecee]=getOperatorValue(_0xa1d569);}else if(_0x476e3a[_0x9816('0xb')]===_0x9816('0xc')&&_[_0x9816('0xd')](_0xa1d569)){var _0x5f1bc9=JSON[_0x9816('0x2')](_0xa1d569);var _0x309b67={'$gte':moment(moment(_0x5f1bc9['$gte'])[_0x9816('0xe')]('YYYY-MM-DD'))[_0x9816('0xf')]()['format'](),'$lte':moment(moment(_0x5f1bc9[_0x9816('0x10')])[_0x9816('0xe')](_0x9816('0x11')))[_0x9816('0xf')]()[_0x9816('0x12')](0x1,'s')[_0x9816('0xe')]()};_0x89d08c[_0x15ecee]=_0x309b67;}else if(_0x476e3a[_0x9816('0x13')]===_0x9816('0x14')){_0x89d08c[_0x15ecee]=_0xa1d569;}else{_0x89d08c[_0x15ecee]=_[_0x9816('0x15')](_0xa1d569)?_0xa1d569:JSON[_0x9816('0x2')](_0xa1d569);}}else{_0x89d08c[_0x15ecee]=_[_0x9816('0x15')](_0xa1d569)?_0xa1d569:JSON[_0x9816('0x2')](_0xa1d569);}}catch(_0x30cc65){_0x89d08c[_0x15ecee]=_0xa1d569['split'](',');}});}return _0x89d08c;};exports[_0x9816('0x16')]=function(_0x3eae7f){_0x3eae7f=parseInt(_0x3eae7f,0xa);if(!_0x3eae7f||_0x3eae7f<0x0){_0x3eae7f=LIMIT_VALUE;}return _0x3eae7f;};exports[_0x9816('0x17')]=function(_0x52cb66){_0x52cb66=parseInt(_0x52cb66,0xa);if(!_0x52cb66||_0x52cb66<0x0){_0x52cb66=0x0;}return _0x52cb66;};exports[_0x9816('0x18')]=function(_0x199b98){var _0x36ff89,_0x3501ef=null;if(_0x199b98){_0x36ff89=_0x199b98[_0x9816('0x8')](',');_0x3501ef=_[_0x9816('0x19')](_0x36ff89,function(_0x472e38){if(_0x472e38['indexOf']('-')===0x0){return[_0x472e38===_0x9816('0x1a')?sequelize[_0x9816('0x1b')](sequelize[_0x9816('0x1c')](_0x9816('0x1a')),'unsigned'):_0x472e38['substr'](0x1),_0x9816('0x1d')];}else{return[_0x472e38===_0x9816('0x1a')?sequelize[_0x9816('0x1b')](sequelize[_0x9816('0x1c')](_0x9816('0x1a')),'unsigned'):_0x472e38,_0x9816('0x1e')];}});}return _0x3501ef;};exports[_0x9816('0x1f')]=function(_0x2604f6,_0x4a4a0f){if(_[_0x9816('0x20')](_0x2604f6)){return _0x2604f6;}if(_[_0x9816('0x15')](_0x2604f6)){for(var _0x3cb2ca=0x0;_0x3cb2ca<_0x2604f6[_0x9816('0x21')];_0x3cb2ca+=0x1){_0x2604f6[_0x3cb2ca]=this[_0x9816('0x1f')](_0x2604f6[_0x3cb2ca],_0x4a4a0f);}return _0x2604f6;}if(!_[_0x9816('0x22')](_0x2604f6)){return _0x2604f6;}if(_[_0x9816('0x23')](_0x4a4a0f)){_0x4a4a0f=[_0x4a4a0f];}if(!_[_0x9816('0x15')](_0x4a4a0f)){return _0x2604f6;}for(var _0x59a402=0x0;_0x59a402<_0x4a4a0f[_0x9816('0x21')];_0x59a402+=0x1){_[_0x9816('0x24')](_0x2604f6,_0x4a4a0f[_0x59a402]);}for(var _0x46ce66 in _0x2604f6){if(_0x2604f6[_0x9816('0x25')](_0x46ce66)){_0x2604f6[_0x46ce66]=this[_0x9816('0x1f')](_0x2604f6[_0x46ce66],_0x4a4a0f);}}return _0x2604f6;};exports[_0x9816('0x26')]=function(_0x4bd5d3){return _0x4bd5d3['match'](RegExp(_0x9816('0x27')))?!![]:![];};exports[_0x9816('0x28')]=function(_0x2d19e0){return _0x2d19e0[_0x9816('0x29')](/^\S+@\S+$/)?!![]:![];};exports[_0x9816('0x2a')]=function(_0x42253d,_0x2a899a){var _0x24db83=[];var _0x1db1c0=/[ `!@#$%^&*()_\-?~]/;var _0x305335=_0x2a899a?_0x9816('0x2b'):_0x9816('0x2c');_0x42253d[_0x9816('0x8')](/[ ,]+/)[_0x9816('0x2d')](function(_0x4e9ec3){_0x4e9ec3=_0x4e9ec3[_0x9816('0x2e')](/([^:]")"+/g,'$1');_0x4e9ec3='+'+_0x4e9ec3+'*';var _0x295c73=_0x4e9ec3[_0x9816('0x29')](_0x1db1c0);if(_0x295c73){_0x4e9ec3='\x22'+_0x4e9ec3+'\x22';}_0x24db83[_0x9816('0x2f')](_0x4e9ec3);});_0x305335=_0x305335['replace'](_0x9816('0x2c'),_0x24db83[_0x9816('0x30')]('\x20'));return _0x305335;};exports[_0x9816('0x31')]=function(_0x40eace,_0x5a0d0c,_0x58678e){var _0x8846c9={},_0x48f9d3={};if(_0x5a0d0c[_0x9816('0x32')]['$id']){_0x5a0d0c[_0x9816('0x32')]['id']=_0x5a0d0c[_0x9816('0x32')][_0x9816('0x33')];delete _0x5a0d0c[_0x9816('0x32')][_0x9816('0x33')];}_0x8846c9[_0x9816('0x5')]=_[_0x9816('0x19')](_0x40eace,_0x9816('0x13'));_0x8846c9['query']=_[_0x9816('0x4')](_0x5a0d0c[_0x9816('0x32')]);_0x8846c9['filters']=_['intersection'](_0x8846c9[_0x9816('0x5')],_0x8846c9[_0x9816('0x32')]);_0x48f9d3['attributes']=_[_0x9816('0x34')](_0x8846c9['model'],this[_0x9816('0x6')](_0x5a0d0c['query']['fields']));_0x48f9d3[_0x9816('0x35')]=_0x48f9d3[_0x9816('0x35')][_0x9816('0x21')]?_0x48f9d3[_0x9816('0x35')]:_0x8846c9[_0x9816('0x5')];if(!_0x5a0d0c[_0x9816('0x32')][_0x9816('0x25')]('nolimit')){_0x48f9d3[_0x9816('0x16')]=this[_0x9816('0x16')](_0x5a0d0c[_0x9816('0x32')][_0x9816('0x16')]);_0x48f9d3[_0x9816('0x17')]=this['offset'](_0x5a0d0c['query']['offset']);}_0x48f9d3['order']=this[_0x9816('0x18')](_0x5a0d0c['query']['sort']);_0x48f9d3[_0x9816('0x36')]=this[_0x9816('0x9')](_[_0x9816('0x37')](_0x5a0d0c[_0x9816('0x32')],_0x8846c9['filters']),_0x40eace);if(_0x5a0d0c[_0x9816('0x32')][_0x9816('0x38')]){var _0x164f1d=_0x40eace;var _0xb5b933=_0x5a0d0c[_0x9816('0x32')][_0x9816('0x38')];if(typeof _0xb5b933===_0x9816('0x39')){_0x164f1d=_[_0x9816('0x38')](_0x40eace,function(_0x50fd0c){return _[_0x9816('0x3')](_0xb5b933[_0x9816('0x3a')],_0x50fd0c[_0x9816('0x13')]);});_0xb5b933=_0xb5b933[_0x9816('0x3b')];}_0x48f9d3[_0x9816('0x36')]=_[_0x9816('0x3c')](_0x48f9d3['where'],{'$or':_[_0x9816('0x19')](_0x164f1d,function(_0x131e1e){if(_0x131e1e['type']!==_0x9816('0x3d')){if(_0x58678e){return sequelize[_0x9816('0x36')](sequelize['fn'](_0x9816('0x3e'),sequelize[_0x9816('0x1c')](_0x131e1e['name'])),{'$like':sequelize['fn']('lower','%'+_0x5a0d0c[_0x9816('0x32')][_0x9816('0x38')]+'%')});}else{var _0x191bb6={};_0x191bb6[_0x131e1e['name']]={'$like':'%'+_0x5a0d0c[_0x9816('0x32')][_0x9816('0x38')]+'%'};return _0x191bb6;}}})});}_0x48f9d3=_[_0x9816('0x3c')]({},_0x48f9d3,_0x5a0d0c[_0x9816('0x3f')]);return _0x48f9d3;};exports[_0x9816('0x40')]=function(_0xb813fe){var _0x2b979d=[];if(_0xb813fe[_0x9816('0x41')]){_0x2b979d[_0x9816('0x2f')]({'all':!![]});}else if(_0xb813fe[_0x9816('0x40')]){if(Array[_0x9816('0x15')](_0xb813fe[_0x9816('0x40')])){_0x2b979d=Object[_0x9816('0x4')](_0xb813fe[_0x9816('0x40')])['map'](function(_0x4839bf){return parseIncludeModel(_0xb813fe[_0x9816('0x40')][_0x4839bf]);});}else{var _0x51969a=parseIncludeModel(_0xb813fe[_0x9816('0x40')]);_0x2b979d[_0x9816('0x2f')](_0x51969a);}}return _0x2b979d;}; \ No newline at end of file +var _0x4d74=['$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','priority','col','unsigned','DESC','cast','ASC','omit','length','isObject','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','push','join','getOptions','query','$id','map','filters','attributes','intersection','nolimit','order','sort','where','pick','filter','object','value','merge','VIRTUAL','lower','include','includeAll','lodash','sequelize','moment','../../mysqldb','parse','keys','includes','model','alias','fields','raw','split','isEmpty','forOwn','find','type','DATE','isPlainObject'];(function(_0x3a0348,_0x4d7c55){var _0x2f83d4=function(_0x3fadfd){while(--_0x3fadfd){_0x3a0348['push'](_0x3a0348['shift']());}};_0x2f83d4(++_0x4d7c55);}(_0x4d74,0xc0));var _0x44d7=function(_0x5427c6,_0x1240a1){_0x5427c6=_0x5427c6-0x0;var _0x5144ff=_0x4d74[_0x5427c6];return _0x5144ff;};'use strict';var _=require(_0x44d7('0x0'));var sequelize=require(_0x44d7('0x1'));var moment=require(_0x44d7('0x2'));var db=require(_0x44d7('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4b792c){var _0x15eb19=['ne'];try{var _0xb53e35=JSON[_0x44d7('0x4')](_0x4b792c);var _0x31b974=Object[_0x44d7('0x5')](_0xb53e35)[0x0];return _0x15eb19[_0x44d7('0x6')](_0x31b974);}catch(_0x129634){return![];}}function getOperatorValue(_0xba5ca2){var _0x389e27=JSON[_0x44d7('0x4')](_0xba5ca2);var _0x1c6911=Object[_0x44d7('0x5')](_0x389e27)[0x0];var _0x2ad289=_0x389e27[_0x1c6911];return{['$'+_0x1c6911]:_0x2ad289};}function parseIncludeModel(_0xfe40bf){var _0x105632=JSON[_0x44d7('0x4')](_0xfe40bf);return{'model':db[_0x105632[_0x44d7('0x7')]],'as':_0x105632[_0x44d7('0x8')],'attributes':_0x105632[_0x44d7('0x9')],'raw':_0x105632[_0x44d7('0xa')]};}exports[_0x44d7('0x9')]=function(_0xc2310d){var _0x2ce199=null;if(_0xc2310d){_0x2ce199=_0xc2310d[_0x44d7('0xb')](',');}return _0x2ce199;};exports['filters']=function(_0x1b632a,_0x1af200){var _0x2c42c8={};if(!_[_0x44d7('0xc')](_0x1b632a)){_[_0x44d7('0xd')](_0x1b632a,function(_0x301401,_0x52442f){try{if(_0x1af200){var _0x44a949=_[_0x44d7('0xe')](_0x1af200,{'name':_0x52442f})||{};if(hasSequelizeOperator(_0x301401)){_0x2c42c8[_0x52442f]=getOperatorValue(_0x301401);}else if(_0x44a949[_0x44d7('0xf')]===_0x44d7('0x10')&&_[_0x44d7('0x11')](_0x301401)){var _0x5d3ec2=JSON['parse'](_0x301401);var _0x2e9577={'$gte':moment(moment(_0x5d3ec2[_0x44d7('0x12')])[_0x44d7('0x13')]('YYYY-MM-DD'))[_0x44d7('0x14')]()['format'](),'$lte':moment(moment(_0x5d3ec2[_0x44d7('0x15')])[_0x44d7('0x13')](_0x44d7('0x16')))[_0x44d7('0x14')]()[_0x44d7('0x17')](0x1,'s')[_0x44d7('0x13')]()};_0x2c42c8[_0x52442f]=_0x2e9577;}else if(_0x44a949[_0x44d7('0x18')]===_0x44d7('0x19')){_0x2c42c8[_0x52442f]=_0x301401;}else{_0x2c42c8[_0x52442f]=_[_0x44d7('0x1a')](_0x301401)?_0x301401:JSON[_0x44d7('0x4')](_0x301401);}}else{_0x2c42c8[_0x52442f]=_[_0x44d7('0x1a')](_0x301401)?_0x301401:JSON['parse'](_0x301401);}}catch(_0x5cbdb5){_0x2c42c8[_0x52442f]=_0x301401['split'](',');}});}return _0x2c42c8;};exports[_0x44d7('0x1b')]=function(_0xa4f389){_0xa4f389=parseInt(_0xa4f389,0xa);if(!_0xa4f389||_0xa4f389<0x0){_0xa4f389=LIMIT_VALUE;}return _0xa4f389;};exports[_0x44d7('0x1c')]=function(_0x188a0a){_0x188a0a=parseInt(_0x188a0a,0xa);if(!_0x188a0a||_0x188a0a<0x0){_0x188a0a=0x0;}return _0x188a0a;};exports['sort']=function(_0x29eee6){var _0x54c6dd,_0x41649f=null;if(_0x29eee6){_0x54c6dd=_0x29eee6[_0x44d7('0xb')](',');_0x41649f=_['map'](_0x54c6dd,function(_0x3f2c85){if(_0x3f2c85['indexOf']('-')===0x0){return[_0x3f2c85===_0x44d7('0x1d')?sequelize['cast'](sequelize[_0x44d7('0x1e')](_0x44d7('0x1d')),_0x44d7('0x1f')):_0x3f2c85['substr'](0x1),_0x44d7('0x20')];}else{return[_0x3f2c85===_0x44d7('0x1d')?sequelize[_0x44d7('0x21')](sequelize['col'](_0x44d7('0x1d')),_0x44d7('0x1f')):_0x3f2c85,_0x44d7('0x22')];}});}return _0x41649f;};exports[_0x44d7('0x23')]=function(_0x237a28,_0x294545){if(_['isEmpty'](_0x237a28)){return _0x237a28;}if(_[_0x44d7('0x1a')](_0x237a28)){for(var _0x1ced44=0x0;_0x1ced44<_0x237a28[_0x44d7('0x24')];_0x1ced44+=0x1){_0x237a28[_0x1ced44]=this[_0x44d7('0x23')](_0x237a28[_0x1ced44],_0x294545);}return _0x237a28;}if(!_[_0x44d7('0x25')](_0x237a28)){return _0x237a28;}if(_[_0x44d7('0x26')](_0x294545)){_0x294545=[_0x294545];}if(!_['isArray'](_0x294545)){return _0x237a28;}for(var _0x25aea8=0x0;_0x25aea8<_0x294545['length'];_0x25aea8+=0x1){_[_0x44d7('0x27')](_0x237a28,_0x294545[_0x25aea8]);}for(var _0x4ec895 in _0x237a28){if(_0x237a28[_0x44d7('0x28')](_0x4ec895)){_0x237a28[_0x4ec895]=this['omit'](_0x237a28[_0x4ec895],_0x294545);}}return _0x237a28;};exports['isNumeric']=function(_0x51a768){return _0x51a768[_0x44d7('0x29')](RegExp(_0x44d7('0x2a')))?!![]:![];};exports[_0x44d7('0x2b')]=function(_0x1ad960){return _0x1ad960[_0x44d7('0x29')](/^\S+@\S+$/)?!![]:![];};exports[_0x44d7('0x2c')]=function(_0x2fa5eb,_0x416f72){var _0x5adb04=[];var _0x184a27=/[ `!@#$%^&*()_\-?~]/;var _0x2c67ad=_0x416f72?_0x44d7('0x2d'):_0x44d7('0x2e');_0x2fa5eb[_0x44d7('0xb')](/[ ,]+/)['forEach'](function(_0x5f0032){_0x5f0032=_0x5f0032[_0x44d7('0x2f')](/([^:]")"+/g,'$1');_0x5f0032='+'+_0x5f0032+'*';var _0x2ddbe4=_0x5f0032[_0x44d7('0x29')](_0x184a27);if(_0x2ddbe4){_0x5f0032='\x22'+_0x5f0032+'\x22';}_0x5adb04[_0x44d7('0x30')](_0x5f0032);});_0x2c67ad=_0x2c67ad[_0x44d7('0x2f')]('{EXPR}',_0x5adb04[_0x44d7('0x31')]('\x20'));return _0x2c67ad;};exports[_0x44d7('0x32')]=function(_0x1c2635,_0x24c89a,_0x378383){var _0x23b346={},_0x23ada2={};if(_0x24c89a[_0x44d7('0x33')][_0x44d7('0x34')]){_0x24c89a[_0x44d7('0x33')]['id']=_0x24c89a['query'][_0x44d7('0x34')];delete _0x24c89a[_0x44d7('0x33')][_0x44d7('0x34')];}_0x23b346[_0x44d7('0x7')]=_[_0x44d7('0x35')](_0x1c2635,_0x44d7('0x18'));_0x23b346[_0x44d7('0x33')]=_['keys'](_0x24c89a[_0x44d7('0x33')]);_0x23b346[_0x44d7('0x36')]=_['intersection'](_0x23b346['model'],_0x23b346['query']);_0x23ada2[_0x44d7('0x37')]=_[_0x44d7('0x38')](_0x23b346[_0x44d7('0x7')],this[_0x44d7('0x9')](_0x24c89a[_0x44d7('0x33')][_0x44d7('0x9')]));_0x23ada2[_0x44d7('0x37')]=_0x23ada2[_0x44d7('0x37')][_0x44d7('0x24')]?_0x23ada2[_0x44d7('0x37')]:_0x23b346[_0x44d7('0x7')];if(!_0x24c89a[_0x44d7('0x33')][_0x44d7('0x28')](_0x44d7('0x39'))){_0x23ada2[_0x44d7('0x1b')]=this[_0x44d7('0x1b')](_0x24c89a[_0x44d7('0x33')]['limit']);_0x23ada2[_0x44d7('0x1c')]=this[_0x44d7('0x1c')](_0x24c89a[_0x44d7('0x33')][_0x44d7('0x1c')]);}_0x23ada2[_0x44d7('0x3a')]=this[_0x44d7('0x3b')](_0x24c89a[_0x44d7('0x33')]['sort']);_0x23ada2[_0x44d7('0x3c')]=this['filters'](_[_0x44d7('0x3d')](_0x24c89a[_0x44d7('0x33')],_0x23b346[_0x44d7('0x36')]),_0x1c2635);if(_0x24c89a[_0x44d7('0x33')][_0x44d7('0x3e')]){var _0x1556e6=_0x1c2635;var _0xd4816e=_0x24c89a['query']['filter'];if(typeof _0xd4816e===_0x44d7('0x3f')){_0x1556e6=_[_0x44d7('0x3e')](_0x1c2635,function(_0x296a5f){return _[_0x44d7('0x6')](_0xd4816e['columns'],_0x296a5f['name']);});_0xd4816e=_0xd4816e[_0x44d7('0x40')];}_0x23ada2[_0x44d7('0x3c')]=_[_0x44d7('0x41')](_0x23ada2[_0x44d7('0x3c')],{'$or':_[_0x44d7('0x35')](_0x1556e6,function(_0xeb644){if(_0xeb644[_0x44d7('0xf')]!==_0x44d7('0x42')){if(_0x378383){return sequelize[_0x44d7('0x3c')](sequelize['fn']('lower',sequelize[_0x44d7('0x1e')](_0xeb644[_0x44d7('0x18')])),{'$like':sequelize['fn'](_0x44d7('0x43'),'%'+_0x24c89a['query'][_0x44d7('0x3e')]+'%')});}else{var _0x290099={};_0x290099[_0xeb644[_0x44d7('0x18')]]={'$like':'%'+_0x24c89a[_0x44d7('0x33')][_0x44d7('0x3e')]+'%'};return _0x290099;}}})});}_0x23ada2=_['merge']({},_0x23ada2,_0x24c89a['options']);return _0x23ada2;};exports[_0x44d7('0x44')]=function(_0x403044){var _0x9f375a=[];if(_0x403044[_0x44d7('0x45')]){_0x9f375a[_0x44d7('0x30')]({'all':!![]});}else if(_0x403044[_0x44d7('0x44')]){if(Array['isArray'](_0x403044[_0x44d7('0x44')])){_0x9f375a=Object[_0x44d7('0x5')](_0x403044[_0x44d7('0x44')])['map'](function(_0x1d29c4){return parseIncludeModel(_0x403044['include'][_0x1d29c4]);});}else{var _0x22058c=parseIncludeModel(_0x403044['include']);_0x9f375a[_0x44d7('0x30')](_0x22058c);}}return _0x9f375a;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index a16e352..011741c 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 _0x814b=['mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','filterAgentAttributes','openchannelStatusTime','voiceStatusTime','faxCapacity','chatCurrentCapacity','phoneBarEnableScreenRecordingByAgent','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','findAll','name','fullname','openchannelPause','whatsappPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','fields','order','fullname,internal','indexOf','internal','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity'];(function(_0x380f18,_0x454a01){var _0x37ab6d=function(_0x4c2364){while(--_0x4c2364){_0x380f18['push'](_0x380f18['shift']());}};_0x37ab6d(++_0x454a01);}(_0x814b,0x1a2));var _0xb814=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0x814b[_0x30f87a];return _0x3a8efc;};'use strict';var _=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var db=require(_0xb814('0x2'))['db'];var amiClient=jayson[_0xb814('0x3')][_0xb814('0x4')]({'port':0x232a});var routingClient=jayson[_0xb814('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x38c21a,_0x3e1e9){var _0x258866=[_0x38c21a[_0xb814('0x5')],_0x38c21a[_0xb814('0x6')],_0x38c21a[_0xb814('0x7')],_0x38c21a['openchannelPause'],_0x38c21a[_0xb814('0x8')],_0x38c21a[_0xb814('0x9')],_0x38c21a['whatsappPause']];if(!_0x3e1e9)return _[_0xb814('0xa')](_0x258866);var _0x2913a6=_[_0xb814('0xb')](_0x258866);return _0x2913a6[_0xb814('0xc')]>0x0&&_0x2913a6[_0xb814('0xc')]<_0x258866[_0xb814('0xc')]?!![]:![];}function isIdle(_0x1086f8){return _0x1086f8===_0xb814('0xd')||_0x1086f8===_0xb814('0xe')||_0x1086f8===_0xb814('0xf')||_0x1086f8===_0xb814('0x10')||_['isNil'](_0x1086f8);}function isAgentIdle(_0x43dfe6){if(_0x43dfe6['voiceStatus']!==_0xb814('0xd')&&_0x43dfe6[_0xb814('0x9')]){_0x43dfe6[_0xb814('0x11')]=_0xb814('0x12');return![];}return _[_0xb814('0xa')]([_0x43dfe6[_0xb814('0x13')],_0x43dfe6[_0xb814('0x14')],_0x43dfe6[_0xb814('0x15')],_0x43dfe6[_0xb814('0x16')],_0x43dfe6[_0xb814('0x17')],_0x43dfe6[_0xb814('0x11')],_0x43dfe6[_0xb814('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb814('0x19')](_0xb814('0x1a'),{})[_0xb814('0x1b')](function(_0x3a71d6){if(_0x3a71d6[_0xb814('0x1c')]){throw new Error(_0xb814('0x1d'));}var _0x125ce2=_0x3a71d6[_0xb814('0x1e')];return routingClient[_0xb814('0x19')]('Agents',{})[_0xb814('0x1b')](function(_0x55ba16){if(_0x55ba16[_0xb814('0x1c')]){throw new Error(_0xb814('0x1f'));}var _0x4c3007=_0x55ba16['result'];return _['merge']({},_0x125ce2,_0x4c3007);});})[_0xb814('0x20')](function(_0x4d5276){throw _0x4d5276;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0xb684ea){var _0x24211d=_0xb814('0xe');if(isAgentPaused(_0xb684ea))_0x24211d='pause';else if(isAgentPaused(_0xb684ea,!![]))_0x24211d=_0xb814('0x21');else if(isAgentIdle(_0xb684ea))_0x24211d='idle';else _0x24211d=_0xb814('0x22');return _0x24211d;}exports[_0xb814('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x3b267e,_0x470e81){var _0x27352e=_[_0xb814('0x24')](_0x3b267e)?_0x3b267e:[_0x3b267e];var _0x1f5d40=_['startCase'](_0x470e81)+_0xb814('0x25');var _0x52b7a3=_[_0xb814('0x26')](_0x27352e,function(_0x457dac){return db[_0x1f5d40][_0xb814('0x27')]({'where':{'id':_0x457dac}})[_0xb814('0x1b')](function(_0x1c8a2e){if(!_0x1c8a2e)return[];return _0x1c8a2e[_0xb814('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb814('0x29')](_0x52b7a3)['then'](function(_0x392222){var _0xc0ef66=_(_0x392222)[_0xb814('0x2a')]()[_0xb814('0x26')]('id')[_0xb814('0x2b')]()[_0xb814('0x2c')]();return _0xc0ef66;});}exports[_0xb814('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1e4e89,_0x5a6291,_0x271aa8){try{if(_0x5a6291[_0xb814('0xc')]>0x0){_0x1e4e89=_0x1e4e89['filter'](function(_0x9008b2){return _0x5a6291[_0xb814('0x2e')](_0x9008b2['id']);});}var _0x530744=_0x1e4e89['filter'](function(_0x20577b){var _0x2051d0='busy';if(isAgentIdle(_0x20577b)){_0x2051d0=_0xb814('0xd');}return _0x2051d0===_0x271aa8;});return _['map'](_0x530744,'id');}catch(_0x6efe9a){throw _0x6efe9a;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4cfc58,_0x419cd9,_0x4a4f27){return Promise[_0xb814('0x2f')]()[_0xb814('0x1b')](function(){if(_0x419cd9[_0xb814('0xc')]>0x0){_0x4cfc58=_0x4cfc58['filter'](function(_0x51d5ae){return _0x419cd9[_0xb814('0x2e')](_0x51d5ae['id']);});}return _0x4cfc58;})[_0xb814('0x1b')](function(){return db['User'][_0xb814('0x30')]({'attributes':['id',_0xb814('0x31'),_0xb814('0x32'),_0xb814('0x5'),_0xb814('0x6'),_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),_0xb814('0x35')],'where':{'id':{'$in':_[_0xb814('0x26')](_0x4cfc58,'id')}},'raw':!![]});})[_0xb814('0x1b')](function(_0x4ff31a){return _0x4ff31a[_0xb814('0x26')](function(_0x57e6e6){var _0x43db67=_[_0xb814('0x36')](_0x4cfc58,['id',_0x57e6e6['id']]);var _0xe0f509=filterAgentAttributes(_0x43db67);_['merge'](_0x57e6e6,_0xe0f509);_0x57e6e6[_0xb814('0x37')]=getAgentStatus(_0x57e6e6);return _0x57e6e6;});})[_0xb814('0x1b')](function(_0x4ea6f8){var _0x2fcd92=sortAgentsByStatus(_0x4ea6f8,_0x4a4f27);return _[_0xb814('0x26')](_0x2fcd92,'id');})[_0xb814('0x20')](function(_0x1f7cd8){throw _0x1f7cd8;});}exports[_0xb814('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x467cf9){var _0x4d81eb={'fields':[],'order':null};var _0xa6ce87=_0x467cf9['split'](',');_0x4d81eb[_0xb814('0x39')]=_['filter'](_0xa6ce87,function(_0x4492ef){if(!_0x4492ef['includes'](_0xb814('0x37'))){return!![];}_0x4d81eb[_0xb814('0x3a')]=_['startsWith'](_0x4492ef,'-')?'DESC':'ASC';return![];});return _0x4d81eb;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x17549e){if(!_0x17549e){_0x17549e=_0xb814('0x3b');}if(_0x17549e[_0xb814('0x2e')](_0xb814('0x32'))&&!_0x17549e['includes']('internal')){var _0x6f15d3=_0x17549e['substring'](0x0,_0x17549e[_0xb814('0x3c')](_0xb814('0x32')));_0x17549e+=','+_0x6f15d3+_0xb814('0x3d');}return _0x17549e;}exports[_0xb814('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x42653f,_0x37369f){var _0x3b7f5a=_0x42653f[_0xb814('0x3f')](function(_0x31989d,_0x4b6ff8){if(_0x31989d['globalStatus']===_0x4b6ff8['globalStatus']){if(_0x31989d[_0xb814('0x37')]==='pause'){if(_0x37369f===_0xb814('0x40')){return(_0x31989d['pauseType']||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x31989d[_0xb814('0x35')]||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?-0x1:0x1;}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?0x1:-0x1;}else{return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?0x1:-0x1;}else{return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?-0x1:0x1;}}});return _0x3b7f5a;}exports[_0xb814('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x40e627){var _0x24b697=[_0xb814('0x43'),_0xb814('0x44'),_0xb814('0x45'),_0xb814('0x46'),'pauseType',_0xb814('0x46'),_0xb814('0x3d'),'address',_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),_0xb814('0x8'),_0xb814('0x34'),_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x47'),_0xb814('0x48'),_0xb814('0x49'),_0xb814('0x4a'),_0xb814('0x4b'),'faxCapacity','chatCurrentCapacity',_0xb814('0x4c'),_0xb814('0x4d'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x50'),_0xb814('0x13'),_0xb814('0x16'),'mailStatus',_0xb814('0x17'),_0xb814('0x18'),_0xb814('0x14'),'voiceStatus',_0xb814('0x51'),'openchannelStatusTime',_0xb814('0x52'),'smsStatusTime',_0xb814('0x53'),_0xb814('0x54'),'voiceStatusTime',_0xb814('0x55'),_0xb814('0x56'),_0xb814('0x57'),'phoneBarEnableScreenRecordingByAgent',_0xb814('0x58'),'routealias'];var _0x13bdcf=[_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),'smsPause','whatsappPause',_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x44')];var _0x47a814=_(_0x40e627)[_0xb814('0x59')](_0x13bdcf)['pick'](_0x24b697)[_0xb814('0x2c')]();return _0x47a814;}exports[_0xb814('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0xb814('0x32'),'role',_0xb814('0x3d'),_0xb814('0x44'),_0xb814('0x37'),_0xb814('0x43'),_0xb814('0x45'),_0xb814('0x35'),_0xb814('0x46'),_0xb814('0x6'),'chatPause',_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),'chatStatus',_0xb814('0x14'),'mailStatus','openchannelStatus',_0xb814('0x17'),'voiceStatus',_0xb814('0x18'),_0xb814('0x51'),_0xb814('0x54'),'mailStatusTime',_0xb814('0x5b'),'smsStatusTime',_0xb814('0x5c'),_0xb814('0x53'),_0xb814('0x47'),_0xb814('0x5d'),_0xb814('0x49'),_0xb814('0x48'),_0xb814('0x4a'),_0xb814('0x4b'),_0xb814('0x5e'),'faxCurrentCapacity',_0xb814('0x4d'),_0xb814('0x4c'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x5f'),_0xb814('0x58'),'destconnectedlinenum',_0xb814('0x60'),'queue',_0xb814('0x61'),_0xb814('0x57')];}exports[_0xb814('0x62')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0xdc97=['openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','mailCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','chatPause','faxPause','mailPause','smsPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','isArray','Queue','map','findOne','uniq','getAgentIdsByQueues','includes','resolve','name','openchannelPause','voicePause','whatsappPause','pauseType','find','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','substring','indexOf','toLowerCase','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xdc97,0x13b));var _0x7dc9=function(_0x497210,_0x59a982){_0x497210=_0x497210-0x0;var _0x89da4a=_0xdc97[_0x497210];return _0x89da4a;};'use strict';var _=require(_0x7dc9('0x0'));var jayson=require(_0x7dc9('0x1'));var db=require(_0x7dc9('0x2'))['db'];var amiClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232c});function isAgentPaused(_0x2b86da,_0x478a95){var _0x2a77c1=[_0x2b86da[_0x7dc9('0x4')],_0x2b86da[_0x7dc9('0x5')],_0x2b86da[_0x7dc9('0x6')],_0x2b86da['openchannelPause'],_0x2b86da[_0x7dc9('0x7')],_0x2b86da['voicePause'],_0x2b86da['whatsappPause']];if(!_0x478a95)return _[_0x7dc9('0x8')](_0x2a77c1);var _0x23737d=_[_0x7dc9('0x9')](_0x2a77c1);return _0x23737d[_0x7dc9('0xa')]>0x0&&_0x23737d[_0x7dc9('0xa')]<_0x2a77c1['length']?!![]:![];}function isIdle(_0xb2fa2a){return _0xb2fa2a===_0x7dc9('0xb')||_0xb2fa2a===_0x7dc9('0xc')||_0xb2fa2a===_0x7dc9('0xd')||_0xb2fa2a===_0x7dc9('0xe')||_[_0x7dc9('0xf')](_0xb2fa2a);}function isAgentIdle(_0x1e336a){if(_0x1e336a['voiceStatus']!=='idle'&&_0x1e336a['voicePause']){_0x1e336a['voiceStatus']=_0x7dc9('0x10');return![];}return _[_0x7dc9('0x8')]([_0x1e336a['chatStatus'],_0x1e336a[_0x7dc9('0x11')],_0x1e336a[_0x7dc9('0x12')],_0x1e336a[_0x7dc9('0x13')],_0x1e336a[_0x7dc9('0x14')],_0x1e336a[_0x7dc9('0x15')],_0x1e336a[_0x7dc9('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x7dc9('0x17'),{})[_0x7dc9('0x18')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0x19')]){throw new Error(_0x7dc9('0x1a'));}var _0xbe0437=_0x1b0aa1[_0x7dc9('0x1b')];return routingClient[_0x7dc9('0x1c')](_0x7dc9('0x17'),{})['then'](function(_0x22577e){if(_0x22577e['error']){throw new Error(_0x7dc9('0x1d'));}var _0x1cc237=_0x22577e['result'];return _[_0x7dc9('0x1e')]({},_0xbe0437,_0x1cc237);});})[_0x7dc9('0x1f')](function(_0x12f08d){throw _0x12f08d;});}exports[_0x7dc9('0x20')]=getRealtimeAgents;function getAgentStatus(_0x43ec33){var _0x184bfd=_0x7dc9('0xc');if(isAgentPaused(_0x43ec33))_0x184bfd=_0x7dc9('0x10');else if(isAgentPaused(_0x43ec33,!![]))_0x184bfd=_0x7dc9('0x21');else if(isAgentIdle(_0x43ec33))_0x184bfd=_0x7dc9('0xb');else _0x184bfd='busy';return _0x184bfd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x12954f,_0x5981e2){var _0x596e0f=_[_0x7dc9('0x22')](_0x12954f)?_0x12954f:[_0x12954f];var _0x27f7fa=_['startCase'](_0x5981e2)+_0x7dc9('0x23');var _0x43d31f=_[_0x7dc9('0x24')](_0x596e0f,function(_0x4906b1){return db[_0x27f7fa][_0x7dc9('0x25')]({'where':{'id':_0x4906b1}})[_0x7dc9('0x18')](function(_0xf95336){if(!_0xf95336)return[];return _0xf95336['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x43d31f)['then'](function(_0x25b383){var _0x32d032=_(_0x25b383)['flatten']()['map']('id')[_0x7dc9('0x26')]()['value']();return _0x32d032;});}exports[_0x7dc9('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1c690b,_0x3a74a0,_0x3e4102){try{if(_0x3a74a0[_0x7dc9('0xa')]>0x0){_0x1c690b=_0x1c690b[_0x7dc9('0x9')](function(_0x236d42){return _0x3a74a0[_0x7dc9('0x28')](_0x236d42['id']);});}var _0x1fcf0e=_0x1c690b[_0x7dc9('0x9')](function(_0x14083d){var _0x2a456c='busy';if(isAgentIdle(_0x14083d)){_0x2a456c='idle';}return _0x2a456c===_0x3e4102;});return _['map'](_0x1fcf0e,'id');}catch(_0x49a4a5){throw _0x49a4a5;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x553a03,_0x58c4e8,_0x59f5d8){return Promise[_0x7dc9('0x29')]()[_0x7dc9('0x18')](function(){if(_0x58c4e8[_0x7dc9('0xa')]>0x0){_0x553a03=_0x553a03[_0x7dc9('0x9')](function(_0x3300ff){return _0x58c4e8[_0x7dc9('0x28')](_0x3300ff['id']);});}return _0x553a03;})['then'](function(){return db['User']['findAll']({'attributes':['id',_0x7dc9('0x2a'),'fullname',_0x7dc9('0x4'),_0x7dc9('0x5'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),_0x7dc9('0x2d'),_0x7dc9('0x2e')],'where':{'id':{'$in':_['map'](_0x553a03,'id')}},'raw':!![]});})[_0x7dc9('0x18')](function(_0x4cdec4){return _0x4cdec4[_0x7dc9('0x24')](function(_0x16431a){var _0x3dc8e0=_[_0x7dc9('0x2f')](_0x553a03,['id',_0x16431a['id']]);var _0x48d9b2=filterAgentAttributes(_0x3dc8e0);_[_0x7dc9('0x1e')](_0x16431a,_0x48d9b2);_0x16431a['globalStatus']=getAgentStatus(_0x16431a);return _0x16431a;});})[_0x7dc9('0x18')](function(_0x4f47af){var _0x590bed=sortAgentsByStatus(_0x4f47af,_0x59f5d8);return _[_0x7dc9('0x24')](_0x590bed,'id');})[_0x7dc9('0x1f')](function(_0x21e036){throw _0x21e036;});}exports[_0x7dc9('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5dac5b){var _0x9376a5={'fields':[],'order':null};var _0x183d87=_0x5dac5b[_0x7dc9('0x31')](',');_0x9376a5[_0x7dc9('0x32')]=_[_0x7dc9('0x9')](_0x183d87,function(_0x21faa6){if(!_0x21faa6[_0x7dc9('0x28')](_0x7dc9('0x33'))){return!![];}_0x9376a5[_0x7dc9('0x34')]=_[_0x7dc9('0x35')](_0x21faa6,'-')?_0x7dc9('0x36'):_0x7dc9('0x37');return![];});return _0x9376a5;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x34b5c9){if(!_0x34b5c9){_0x34b5c9=_0x7dc9('0x38');}if(_0x34b5c9[_0x7dc9('0x28')](_0x7dc9('0x39'))&&!_0x34b5c9['includes'](_0x7dc9('0x3a'))){var _0x89db0e=_0x34b5c9[_0x7dc9('0x3b')](0x0,_0x34b5c9[_0x7dc9('0x3c')](_0x7dc9('0x39')));_0x34b5c9+=','+_0x89db0e+_0x7dc9('0x3a');}return _0x34b5c9;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x553230,_0x3ef9fd){var _0x36a965=_0x553230['sort'](function(_0x3a705c,_0x4a37ec){if(_0x3a705c[_0x7dc9('0x33')]===_0x4a37ec[_0x7dc9('0x33')]){if(_0x3a705c[_0x7dc9('0x33')]==='pause'){if(_0x3ef9fd===_0x7dc9('0x36')){return(_0x3a705c[_0x7dc9('0x2e')]||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return(_0x3a705c['pauseType']||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c['fullname']['toLowerCase']()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?-0x1:0x1;}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec['fullname'][_0x7dc9('0x3d')]()?-0x1:0x1;}}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?-0x1:0x1;}}});return _0x36a965;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3774cb){var _0x42e110=['userpic',_0x7dc9('0x3e'),_0x7dc9('0x3f'),_0x7dc9('0x40'),'pauseType',_0x7dc9('0x40'),'internal','address',_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause','whatsappPause',_0x7dc9('0x5'),'voicePause',_0x7dc9('0x41'),_0x7dc9('0x42'),'mailCapacity',_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x45'),_0x7dc9('0x46'),_0x7dc9('0x47'),_0x7dc9('0x48'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x4b'),_0x7dc9('0x4c'),_0x7dc9('0x13'),_0x7dc9('0x12'),_0x7dc9('0x14'),'whatsappStatus',_0x7dc9('0x11'),'voiceStatus','chatStatusTime',_0x7dc9('0x4d'),_0x7dc9('0x4e'),_0x7dc9('0x4f'),_0x7dc9('0x50'),_0x7dc9('0x51'),'voiceStatusTime',_0x7dc9('0x52'),_0x7dc9('0x53'),_0x7dc9('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x7dc9('0x55'),_0x7dc9('0x56')];var _0x2cf133=[_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause',_0x7dc9('0x2d'),_0x7dc9('0x5'),_0x7dc9('0x2c'),_0x7dc9('0x3e')];var _0x877a67=_(_0x3774cb)[_0x7dc9('0x57')](_0x2cf133)[_0x7dc9('0x58')](_0x42e110)[_0x7dc9('0x59')]();return _0x877a67;}exports[_0x7dc9('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x7dc9('0x2a'),_0x7dc9('0x39'),_0x7dc9('0x5b'),'internal',_0x7dc9('0x3e'),_0x7dc9('0x33'),_0x7dc9('0x5c'),_0x7dc9('0x3f'),_0x7dc9('0x2e'),'lastPauseAt',_0x7dc9('0x5'),_0x7dc9('0x4'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),'whatsappPause','chatStatus','faxStatus',_0x7dc9('0x12'),_0x7dc9('0x13'),_0x7dc9('0x14'),_0x7dc9('0x15'),'whatsappStatus','chatStatusTime',_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x4d'),_0x7dc9('0x4f'),_0x7dc9('0x5d'),_0x7dc9('0x50'),_0x7dc9('0x41'),'faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x42'),_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x46'),'faxCurrentCapacity',_0x7dc9('0x48'),_0x7dc9('0x47'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x5f'),_0x7dc9('0x55'),_0x7dc9('0x53'),_0x7dc9('0x60'),_0x7dc9('0x52'),_0x7dc9('0x56'),_0x7dc9('0x54')];}exports[_0x7dc9('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index cc061ca..805823f 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 _0xb13c=['find','merge','initializeQueues','lodash','util','client','http','available','loggedIn','paused','waiting','busy','inUse','loggedInDb','notInUse','ringing','ringInUse','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','inbound','concat','outbound','map','get','talking'];(function(_0x502564,_0xa1821d){var _0x119ef6=function(_0x5ed485){while(--_0x5ed485){_0x502564['push'](_0x502564['shift']());}};_0x119ef6(++_0xa1821d);}(_0xb13c,0x18b));var _0xcb13=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xb13c[_0x507ac5];return _0x12c1bc;};'use strict';var _=require(_0xcb13('0x0'));var jayson=require('jayson/promise');var util=require(_0xcb13('0x1'));var amiClient=jayson[_0xcb13('0x2')][_0xcb13('0x3')]({'port':0x232a});var routingClient=jayson[_0xcb13('0x2')][_0xcb13('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xcb13('0x4'),_0xcb13('0x5'),_0xcb13('0x6'),_0xcb13('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xcb13('0x8'),_0xcb13('0x9'),'invalid',_0xcb13('0xa'),_0xcb13('0xb'),'onHold',_0xcb13('0xc'),_0xcb13('0xd'),'talking','unavailable','unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xcb13('0xe'),_0xcb13('0xf'),_0xcb13('0x10'),_0xcb13('0x11'),_0xcb13('0x12'),_0xcb13('0x13'),_0xcb13('0x14'),_0xcb13('0x15'),_0xcb13('0x16'),_0xcb13('0x17'),'erlangCallToSecond',_0xcb13('0x18'),_0xcb13('0x19'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0xcb13('0x1a'),_0xcb13('0x1b'),_0xcb13('0x1c'),'predictiveIntervalAnsweredCalls',_0xcb13('0x1d'),_0xcb13('0x1e'),_0xcb13('0x1f'),_0xcb13('0x20')];function getRealtimeQueues(_0x37b2e7,_0x3c33f5){var _0x5c6ae7=_0x3c33f5===_0xcb13('0x21')?amiClient:routingClient;return _0x5c6ae7[_0xcb13('0x22')](_['startCase'](_0x3c33f5)+'Queues',_0x37b2e7)[_0xcb13('0x23')](function(_0x19049e){if(_0x19049e[_0xcb13('0x24')])throw new Error(util['format'](_0xcb13('0x25'),_0x3c33f5));return _0x19049e[_0xcb13('0x26')];})[_0xcb13('0x27')](function(_0x4c8293){throw _0x4c8293;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x55742a,_0x5138d3,_0x1ff3be,_0x162bc8){var _0x50b1fb=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1ff3be===_0xcb13('0x21')){if(_0x162bc8===_0xcb13('0x28')){_0x50b1fb=_0x50b1fb[_0xcb13('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x162bc8===_0xcb13('0x2a')){_0x50b1fb=_0x50b1fb[_0xcb13('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x55742a[_0xcb13('0x2b')](function(_0x47d931){var _0xb0fc9e=_0x47d931[_0xcb13('0x2c')]({'plain':!![]});_0xb0fc9e[_0xcb13('0x6')]=0x0;_0xb0fc9e[_0xcb13('0xa')]=0x0;_0xb0fc9e['loggedIn']=0x0;_0xb0fc9e[_0xcb13('0x4')]=0x0;_0xb0fc9e[_0xcb13('0x7')]=0x0;if(_0x1ff3be===_0xcb13('0x21')){_0xb0fc9e[_0xcb13('0x2d')]=0x0;_0xb0fc9e[_0xcb13('0x8')]=0x0;if(_0x162bc8===_0xcb13('0x2a')){_0xb0fc9e['pTalking']=0x0;_0xb0fc9e[_0xcb13('0xf')]=0x0;}}var _0xeec178=_[_0xcb13('0x2e')](_0x5138d3,['id',_0xb0fc9e['id']]);if(_0xeec178){_[_0xcb13('0x2f')](_0xb0fc9e,_['pick'](_0xeec178,_0x50b1fb));}return _0xb0fc9e;});}exports[_0xcb13('0x30')]=initializeQueues; \ No newline at end of file +var _0xe3a9=['Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','loggedIn','find','pick','initializeQueues','jayson/promise','util','http','client','available','paused','busy','inUse','invalid','loggedInDb','onHold','ringing','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase'];(function(_0x581e9b,_0xba21e6){var _0x22190c=function(_0x5b90a6){while(--_0x5b90a6){_0x581e9b['push'](_0x581e9b['shift']());}};_0x22190c(++_0xba21e6);}(_0xe3a9,0x1c9));var _0x9e3a=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0xe3a9[_0xd8a8af];return _0x5b7278;};'use strict';var _=require('lodash');var jayson=require(_0x9e3a('0x0'));var util=require(_0x9e3a('0x1'));var amiClient=jayson['client'][_0x9e3a('0x2')]({'port':0x232a});var routingClient=jayson[_0x9e3a('0x3')][_0x9e3a('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x9e3a('0x4'),'loggedIn',_0x9e3a('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x9e3a('0x6'),_0x9e3a('0x7'),_0x9e3a('0x8'),_0x9e3a('0x9'),'notInUse',_0x9e3a('0xa'),_0x9e3a('0xb'),'ringInUse',_0x9e3a('0xc'),_0x9e3a('0xd'),_0x9e3a('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x9e3a('0xf'),_0x9e3a('0x10'),_0x9e3a('0x11'),_0x9e3a('0x12'),_0x9e3a('0x13'),_0x9e3a('0x14'),_0x9e3a('0x15'),_0x9e3a('0x16'),_0x9e3a('0x17'),'erlangCalls',_0x9e3a('0x18'),_0x9e3a('0x19'),_0x9e3a('0x1a'),_0x9e3a('0x1b'),_0x9e3a('0x1c'),'dialPredictiveIntervalMinThreshold',_0x9e3a('0x1d'),_0x9e3a('0x1e'),_0x9e3a('0x1f'),_0x9e3a('0x20'),_0x9e3a('0x21'),'predictiveIntervalAvgHoldtime',_0x9e3a('0x22')];function getRealtimeQueues(_0x354fa3,_0x19e985){var _0x14cebf=_0x19e985===_0x9e3a('0x23')?amiClient:routingClient;return _0x14cebf[_0x9e3a('0x24')](_[_0x9e3a('0x25')](_0x19e985)+_0x9e3a('0x26'),_0x354fa3)[_0x9e3a('0x27')](function(_0x32d6cc){if(_0x32d6cc[_0x9e3a('0x28')])throw new Error(util[_0x9e3a('0x29')](_0x9e3a('0x2a'),_0x19e985));return _0x32d6cc[_0x9e3a('0x2b')];})[_0x9e3a('0x2c')](function(_0x419202){throw _0x419202;});}exports[_0x9e3a('0x2d')]=getRealtimeQueues;function initializeQueues(_0xbf28b2,_0xf97dbc,_0x3f758b,_0x5e3bfe){var _0x559fba=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3f758b===_0x9e3a('0x23')){if(_0x5e3bfe===_0x9e3a('0x2e')){_0x559fba=_0x559fba[_0x9e3a('0x2f')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5e3bfe===_0x9e3a('0x30')){_0x559fba=_0x559fba[_0x9e3a('0x2f')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xbf28b2[_0x9e3a('0x31')](function(_0x4d7af3){var _0x376b82=_0x4d7af3[_0x9e3a('0x32')]({'plain':!![]});_0x376b82[_0x9e3a('0x5')]=0x0;_0x376b82[_0x9e3a('0x9')]=0x0;_0x376b82[_0x9e3a('0x33')]=0x0;_0x376b82['available']=0x0;_0x376b82['waiting']=0x0;if(_0x3f758b==='voice'){_0x376b82[_0x9e3a('0xc')]=0x0;_0x376b82[_0x9e3a('0x6')]=0x0;if(_0x5e3bfe===_0x9e3a('0x30')){_0x376b82[_0x9e3a('0xf')]=0x0;_0x376b82[_0x9e3a('0x10')]=0x0;}}var _0x2bad4e=_[_0x9e3a('0x34')](_0xf97dbc,['id',_0x376b82['id']]);if(_0x2bad4e){_['merge'](_0x376b82,_[_0x9e3a('0x35')](_0x2bad4e,_0x559fba));}return _0x376b82;});}exports[_0x9e3a('0x36')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index b9bad8e..884d1c9 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x13a10e,_0x215f40){var _0x29ca7d=function(_0x49bfa4){while(--_0x49bfa4){_0x13a10e['push'](_0x13a10e['shift']());}};_0x29ca7d(++_0x215f40);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +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(_0x2bf1d6,_0x410efd){var _0x1be08a=function(_0x39c3a2){while(--_0x39c3a2){_0x2bf1d6['push'](_0x2bf1d6['shift']());}};_0x1be08a(++_0x410efd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 a03627a..0e755b6 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 _0xa2dc=['IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','test','win32','utf8','replace','macAddress','ipAddress','digest','substring','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xa2dc,0x87));var _0xca2d=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xa2dc[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0xca2d('0x0'))[_0xca2d('0x1')];var config=require(_0xca2d('0x2'));function getInterfaces(){var _0x3d8740=[];var _0x5ecca9=os[_0xca2d('0x3')]();var _0x66de76=_[_0xca2d('0x4')](_[_0xca2d('0x5')](_0x5ecca9));for(var _0x34efa9=0x0;_0x34efa9<_0x66de76[_0xca2d('0x6')];_0x34efa9++){var _0x359b6f=_0x5ecca9[_0x66de76[_0x34efa9]][_0xca2d('0x7')](function(_0x43c8ea){return _0x43c8ea[_0xca2d('0x8')]===_0xca2d('0x9')&&_0x43c8ea[_0xca2d('0xa')]===![];});_0x3d8740=_0x3d8740[_0xca2d('0xb')](_0x359b6f);}return _0x3d8740;}function getFirstInterface(){var _0x134a1a=_[_0xca2d('0xc')](getInterfaces());return{'macAddress':_0x134a1a&&_0x134a1a[_0xca2d('0xd')]?_0x134a1a[_0xca2d('0xd')]:_0xca2d('0xe'),'ipAddress':_0x134a1a&&_0x134a1a['address']?_0x134a1a[_0xca2d('0xf')]:_0xca2d('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x47b161=_['orderBy'](os[_0xca2d('0x11')]()[_0xca2d('0x12')](function(_0x42859f){return _0x42859f[_0xca2d('0x13')];}))[_0xca2d('0x14')](':');return crypto[_0xca2d('0x15')](_0xca2d('0x16'))[_0xca2d('0x17')](_0x47b161)['digest'](_0xca2d('0x18'));}exports[_0xca2d('0x19')]=function(){var _0x2f1ef6=os[_0xca2d('0x1a')]();var _0x58415b=/[0-9a-f-]{36}/;if(config[_0xca2d('0x1b')]&&_0x58415b[_0xca2d('0x1c')](config['licenseToken'])){return config[_0xca2d('0x1b')];}else if(_0x2f1ef6===_0xca2d('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xca2d('0x1e')})[_0xca2d('0x1f')]('\x0d\x0a','');}else{var _0x5b7bdf=getFirstInterface();var _0x3dff6b=getCPUhash();var _0x6190c2=_0x3dff6b+'|'+os['hostname']()+'|'+_0x5b7bdf[_0xca2d('0x20')]+'|'+_0x5b7bdf[_0xca2d('0x21')];var _0x2fb00a=crypto[_0xca2d('0x15')](_0xca2d('0x16'))['update'](_0x6190c2)[_0xca2d('0x22')](_0xca2d('0x18'));return _0x2fb00a[_0xca2d('0x23')](0x0,0x8)+'-'+_0x2fb00a[_0xca2d('0x23')](0x8,0xc)+'-'+_0x2fb00a[_0xca2d('0x23')](0xc,0x10)+'-'+_0x2fb00a[_0xca2d('0x23')](0x10,0x14)+'-'+_0x2fb00a[_0xca2d('0x23')](0x14);}}; \ No newline at end of file +var _0xf3ba=['md5','update','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','digest','substring','lodash','crypto','child_process','orderBy','keys','length','filter','IPv4','internal','concat','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash'];(function(_0x450bd1,_0x440954){var _0x36bbf3=function(_0x43c277){while(--_0x43c277){_0x450bd1['push'](_0x450bd1['shift']());}};_0x36bbf3(++_0x440954);}(_0xf3ba,0x76));var _0xaf3b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf3ba[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xaf3b('0x0'));var os=require('os');var crypto=require(_0xaf3b('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xaf3b('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x4916e7=[];var _0x236a72=os['networkInterfaces']();var _0x51cf8b=_[_0xaf3b('0x3')](_[_0xaf3b('0x4')](_0x236a72));for(var _0x264b9d=0x0;_0x264b9d<_0x51cf8b[_0xaf3b('0x5')];_0x264b9d++){var _0x558ad4=_0x236a72[_0x51cf8b[_0x264b9d]][_0xaf3b('0x6')](function(_0x5deba7){return _0x5deba7['family']===_0xaf3b('0x7')&&_0x5deba7[_0xaf3b('0x8')]===![];});_0x4916e7=_0x4916e7[_0xaf3b('0x9')](_0x558ad4);}return _0x4916e7;}function getFirstInterface(){var _0x3f0750=_['head'](getInterfaces());return{'macAddress':_0x3f0750&&_0x3f0750['mac']?_0x3f0750['mac']:_0xaf3b('0xa'),'ipAddress':_0x3f0750&&_0x3f0750[_0xaf3b('0xb')]?_0x3f0750[_0xaf3b('0xb')]:_0xaf3b('0xc')};}exports[_0xaf3b('0xd')]=getFirstInterface;function getCPUhash(){var _0x3cc146=_[_0xaf3b('0x3')](os[_0xaf3b('0xe')]()['map'](function(_0x5b7538){return _0x5b7538[_0xaf3b('0xf')];}))[_0xaf3b('0x10')](':');return crypto[_0xaf3b('0x11')](_0xaf3b('0x12'))[_0xaf3b('0x13')](_0x3cc146)['digest'](_0xaf3b('0x14'));}exports[_0xaf3b('0x15')]=function(){var _0x2731c3=os[_0xaf3b('0x16')]();var _0x343482=/[0-9a-f-]{36}/;if(config[_0xaf3b('0x17')]&&_0x343482[_0xaf3b('0x18')](config[_0xaf3b('0x17')])){return config[_0xaf3b('0x17')];}else if(_0x2731c3===_0xaf3b('0x19')){return exec(_0xaf3b('0x1a'),{'encoding':_0xaf3b('0x1b')})[_0xaf3b('0x1c')]('\x0d\x0a','');}else{var _0x528eb0=getFirstInterface();var _0x3b9438=getCPUhash();var _0x1be40b=_0x3b9438+'|'+os[_0xaf3b('0x1d')]()+'|'+_0x528eb0[_0xaf3b('0x1e')]+'|'+_0x528eb0[_0xaf3b('0x1f')];var _0x2ba811=crypto[_0xaf3b('0x11')]('md5')['update'](_0x1be40b)[_0xaf3b('0x20')](_0xaf3b('0x14'));return _0x2ba811[_0xaf3b('0x21')](0x0,0x8)+'-'+_0x2ba811[_0xaf3b('0x21')](0x8,0xc)+'-'+_0x2ba811['substring'](0xc,0x10)+'-'+_0x2ba811[_0xaf3b('0x21')](0x10,0x14)+'-'+_0x2ba811[_0xaf3b('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0fdae45..1b160ef 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 _0x11d2=['THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s','message','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','request-promise','bluebird','version','../../mysqldb','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x11d2,0xe6));var _0x211d=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x11d2[_0x36884e];return _0x1cc367;};'use strict';var util=require(_0x211d('0x0'));var moment=require(_0x211d('0x1'));var rp=require(_0x211d('0x2'));var BPromise=require(_0x211d('0x3'));var pkginfo=require('pkginfo')(module,_0x211d('0x4'));var db=require(_0x211d('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require('../logger')(_0x211d('0x6'));var HOST=_0x211d('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xf589c6){return new BPromise(function(_0x66a526,_0x18f1c9){var _0x56c41e=util[_0x211d('0x8')](_0x211d('0x9'),HOST,_0xf589c6,module['exports']['version']);if(oldToken){_0x56c41e=util[_0x211d('0x8')](_0x211d('0xa'),HOST,_0xf589c6,module[_0x211d('0xb')][_0x211d('0x4')],oldToken);}var _0x4eb06a={'uri':_0x56c41e,'method':_0x211d('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x4eb06a)[_0x211d('0xd')](function(_0x17a653){_0x66a526(_0x17a653);})[_0x211d('0xe')](function(_0x262724){_0x18f1c9(_0x262724);});});}function manageLicense(_0x22087a,_0x3ade07){var _0x321444=_0x3ade07[_0x211d('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x321444[_0x211d('0x10')]!==_0x22087a&&!_0x321444[_0x211d('0x11')]){oldToken=_0x321444['data1'];}httpRequest(_0x22087a)[_0x211d('0xd')](function(_0x80ce29){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x80ce29['active']){isOldTokenSent=![];if(!_0x321444[_0x211d('0x6')]&&_0x321444[_0x211d('0x6')]!=_0x80ce29[_0x211d('0x6')]||_0x321444[_0x211d('0x6')]&&_0x321444[_0x211d('0x11')]){logger[_0x211d('0x12')](_0x211d('0x13'));}if(_0x321444[_0x211d('0x6')]&&!_0x321444[_0x211d('0x11')]&&_0x321444[_0x211d('0x6')]!=_0x80ce29[_0x211d('0x6')]){logger[_0x211d('0x12')](_0x211d('0x14'));}if(_0x321444['license']&&!_0x321444[_0x211d('0x11')]&&_0x321444['license']==_0x80ce29[_0x211d('0x6')]){return _0x3ade07;}return _0x3ade07[_0x211d('0x15')]({'data1':_0x22087a,'data2':null,'license':_0x80ce29[_0x211d('0x6')]});}else{if(_0x80ce29[_0x211d('0x6')]||_0x321444[_0x211d('0x6')]){if(!_0x321444[_0x211d('0x11')]){if(_0x321444['data1']==_0x22087a){GRAY_PERIOD_REASON='Disabled';logger[_0x211d('0x12')](_0x211d('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x211d('0x12')](_0x211d('0x17'),_0x321444['data1'],_0x22087a);}logger[_0x211d('0x12')](_0x211d('0x18'),GRAY_PERIOD_REASON[_0x211d('0x19')](),moment()[_0x211d('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x3ade07[_0x211d('0x15')]({'data2':encryptor[_0x211d('0x1a')](moment()[_0x211d('0x8')](_0x211d('0x1b')))});}else{if(moment()['diff'](encryptor[_0x211d('0x1c')](_0x321444['data2']),_0x211d('0x1d'))>DAYS){logger[_0x211d('0x12')](_0x211d('0x1e'),moment()[_0x211d('0x8')](_0x211d('0x1b')));isOldTokenSent=![];return _0x3ade07['update']({'data1':_0x22087a,'data2':null,'license':null});}}}else{if(_0x321444[_0x211d('0x10')]!=_0x22087a){logger['info'](_0x211d('0x17'),_0x321444[_0x211d('0x10')],_0x22087a);return _0x3ade07['update']({'data1':_0x22087a,'data2':null,'license':null});}}}return _0x3ade07;})['then'](function(_0x1b8a8a){_0x3ade07=_0x1b8a8a;})[_0x211d('0xe')](function(_0x1794ad){logger['error'](_0x1794ad[_0x211d('0x1f')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3ade07);},TIME);});}function defaultLicense(){var _0xde29bb=hardware[_0x211d('0x20')]();if(_0xde29bb){return db[_0x211d('0x21')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xde29bb}})['spread'](function(_0x2a3907,_0x4d79e3){logger['info'](_0x211d('0x22'),_0xde29bb);manageLicense(_0xde29bb,_0x2a3907);})[_0x211d('0xe')](function(_0x102ac4){logger[_0x211d('0x23')](_0x102ac4['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x1f44=['GET','then','get','data2','data1','active','license','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1f44,0x183));var _0x41f4=function(_0x284ed0,_0x4f3cda){_0x284ed0=_0x284ed0-0x0;var _0x3a8497=_0x1f44[_0x284ed0];return _0x3a8497;};'use strict';var util=require(_0x41f4('0x0'));var moment=require(_0x41f4('0x1'));var rp=require(_0x41f4('0x2'));var BPromise=require(_0x41f4('0x3'));var pkginfo=require('pkginfo')(module,_0x41f4('0x4'));var db=require(_0x41f4('0x5'))['db'];var encryptor=require(_0x41f4('0x6'));var hardware=require(_0x41f4('0x7'));var logger=require(_0x41f4('0x8'))('license');var HOST=_0x41f4('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x509126){return new BPromise(function(_0x3b8cd3,_0x11edac){var _0x724e2c=util[_0x41f4('0xa')](_0x41f4('0xb'),HOST,_0x509126,module['exports']['version']);if(oldToken){_0x724e2c=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x509126,module[_0x41f4('0xc')][_0x41f4('0x4')],oldToken);}var _0x3305f6={'uri':_0x724e2c,'method':_0x41f4('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x3305f6)[_0x41f4('0xe')](function(_0x2b5141){_0x3b8cd3(_0x2b5141);})['catch'](function(_0x14c65e){_0x11edac(_0x14c65e);});});}function manageLicense(_0x2b6ccc,_0xcdefcf){var _0x258af2=_0xcdefcf[_0x41f4('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x258af2['data1']!==_0x2b6ccc&&!_0x258af2[_0x41f4('0x10')]){oldToken=_0x258af2[_0x41f4('0x11')];}httpRequest(_0x2b6ccc)[_0x41f4('0xe')](function(_0x4f2a8e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4f2a8e[_0x41f4('0x12')]){isOldTokenSent=![];if(!_0x258af2[_0x41f4('0x13')]&&_0x258af2[_0x41f4('0x13')]!=_0x4f2a8e[_0x41f4('0x13')]||_0x258af2[_0x41f4('0x13')]&&_0x258af2[_0x41f4('0x10')]){logger[_0x41f4('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x258af2['license']&&!_0x258af2[_0x41f4('0x10')]&&_0x258af2[_0x41f4('0x13')]!=_0x4f2a8e[_0x41f4('0x13')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x258af2[_0x41f4('0x13')]&&!_0x258af2[_0x41f4('0x10')]&&_0x258af2[_0x41f4('0x13')]==_0x4f2a8e[_0x41f4('0x13')]){return _0xcdefcf;}return _0xcdefcf[_0x41f4('0x15')]({'data1':_0x2b6ccc,'data2':null,'license':_0x4f2a8e['license']});}else{if(_0x4f2a8e['license']||_0x258af2[_0x41f4('0x13')]){if(!_0x258af2[_0x41f4('0x10')]){if(_0x258af2[_0x41f4('0x11')]==_0x2b6ccc){GRAY_PERIOD_REASON=_0x41f4('0x16');logger[_0x41f4('0x14')](_0x41f4('0x17'));}else{GRAY_PERIOD_REASON=_0x41f4('0x18');logger[_0x41f4('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x258af2[_0x41f4('0x11')],_0x2b6ccc);}logger[_0x41f4('0x14')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x41f4('0xa')](_0x41f4('0x19')));return _0xcdefcf[_0x41f4('0x15')]({'data2':encryptor[_0x41f4('0x1a')](moment()['format'](_0x41f4('0x19')))});}else{if(moment()[_0x41f4('0x1b')](encryptor[_0x41f4('0x1c')](_0x258af2['data2']),_0x41f4('0x1d'))>DAYS){logger[_0x41f4('0x14')](_0x41f4('0x1e'),moment()[_0x41f4('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0xcdefcf[_0x41f4('0x15')]({'data1':_0x2b6ccc,'data2':null,'license':null});}}}else{if(_0x258af2[_0x41f4('0x11')]!=_0x2b6ccc){logger[_0x41f4('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x258af2[_0x41f4('0x11')],_0x2b6ccc);return _0xcdefcf[_0x41f4('0x15')]({'data1':_0x2b6ccc,'data2':null,'license':null});}}}return _0xcdefcf;})['then'](function(_0x531c89){_0xcdefcf=_0x531c89;})['catch'](function(_0x3be771){logger[_0x41f4('0x1f')](_0x3be771[_0x41f4('0x20')]);})[_0x41f4('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x41f4('0x22')](),_0xcdefcf);},TIME);});}function defaultLicense(){var _0x3f21de=hardware[_0x41f4('0x22')]();if(_0x3f21de){return db['License'][_0x41f4('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x3f21de}})[_0x41f4('0x24')](function(_0x3dd248,_0x1dd842){logger[_0x41f4('0x14')](_0x41f4('0x25'),_0x3f21de);manageLicense(_0x3f21de,_0x3dd248);})[_0x41f4('0x26')](function(_0x392fab){logger[_0x41f4('0x1f')](_0x392fab[_0x41f4('0x20')]);});}}exports[_0x41f4('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index af65ced..92fb785 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 _0x0a8d=['count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','parse','demo','uuid','machineUuid','deadline','add','format','grayReason','changed','disabled','message','User','findAll','COUNT','col','role','user','telephone','users','telephones','forEach','admin'];(function(_0x30b000,_0x3aa6c9){var _0x5382a1=function(_0x1337d4){while(--_0x1337d4){_0x30b000['push'](_0x30b000['shift']());}};_0x5382a1(++_0x3aa6c9);}(_0x0a8d,0xeb));var _0xd0a8=function(_0x1334e4,_0x1985dc){_0x1334e4=_0x1334e4-0x0;var _0x2e660c=_0x0a8d[_0x1334e4];return _0x2e660c;};'use strict';var util=require(_0xd0a8('0x0'));var _=require('lodash');var moment=require(_0xd0a8('0x1'));var BPromise=require(_0xd0a8('0x2'));var hardware=require(_0xd0a8('0x3'));var encryptor=require(_0xd0a8('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd0a8('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd0a8('0x6'),'machineUuid':hardware[_0xd0a8('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd0a8('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd0a8('0x8'),'machineUuid':hardware[_0xd0a8('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x15d899){return new BPromise(function(_0x54e885,_0x46b1c0){return db['License'][_0xd0a8('0x9')](_['defaults'](_0x15d899,{'raw':!![],'where':{'id':0x1}}))[_0xd0a8('0xa')](function(_0x3128fe){return checkLicense(_0x3128fe,null);})[_0xd0a8('0xa')](function(_0x21c64e){_0x54e885(_0x21c64e);return;})[_0xd0a8('0xb')](function(_0x142fc6){_0x46b1c0(_0x142fc6);});});}function checkLicense(_0x2d7e89,_0x4d859c){if(!_0x2d7e89){demoLicense['uuid']=_0x2d7e89[_0xd0a8('0xc')];return demoLicense;}try{var _0x12eb53=_0x4d859c||_0x2d7e89[_0xd0a8('0xd')];if(_[_0xd0a8('0xe')](_0x12eb53)){throw new Error(_0xd0a8('0xf'));}var _0x31f9de=_0x2d7e89[_0xd0a8('0xc')];var _0x3cfc90=_0x2d7e89[_0xd0a8('0x10')];var _0x1d0b4c=_0x31f9de[_0xd0a8('0x11')]('-')[0x4];var _0x594522=_0x31f9de[_0xd0a8('0x11')]('-')[0x0];var _0x844bb6=encryptor[_0xd0a8('0x12')](_0x12eb53,util['format']('%s:%s:%s',_0x1d0b4c,_0x31f9de,_0x594522));var _0x2f4d61=JSON[_0xd0a8('0x13')](_0x844bb6);_0x2f4d61[_0xd0a8('0x14')]=![];_0x2f4d61[_0xd0a8('0x15')]=_0x31f9de;_0x2f4d61[_0xd0a8('0x16')]=hardware[_0xd0a8('0x7')]();if(_0x3cfc90){var _0x12ec72=encryptor['decryptString'](_0x3cfc90);_0x2f4d61['gray']=_0x12ec72;_0x2f4d61[_0xd0a8('0x17')]=moment(_0x12ec72)[_0xd0a8('0x18')](0x7,'days')[_0xd0a8('0x19')]();_0x2f4d61[_0xd0a8('0x1a')]=_0x2f4d61[_0xd0a8('0x15')]!=_0x2f4d61[_0xd0a8('0x16')]?_0xd0a8('0x1b'):_0xd0a8('0x1c');}return _0x2f4d61;}catch(_0x4b3b7a){breakingLicense[_0xd0a8('0x15')]=_0x2d7e89[_0xd0a8('0xc')];breakingLicense[_0xd0a8('0x1d')]=_0x4b3b7a[_0xd0a8('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3086a6,_0x1fbcf4){getLicense()[_0xd0a8('0xa')](function(_0x5f5c6d){return db[_0xd0a8('0x1e')][_0xd0a8('0x1f')]({'attributes':['role',[db['sequelize']['fn'](_0xd0a8('0x20'),db['sequelize'][_0xd0a8('0x21')]('role')),'count']],'group':_0xd0a8('0x22'),'where':{'role':{'$or':['admin',_0xd0a8('0x23'),_0xd0a8('0x24')]}},'raw':!![]})[_0xd0a8('0xa')](function(_0x2927a5){var _0x46c1b6={'user':_0x5f5c6d[_0xd0a8('0x25')]||0x0,'telephone':_0x5f5c6d[_0xd0a8('0x26')]||0x0};_0x2927a5[_0xd0a8('0x27')](function(_0x53374e){var _0xb97140=_0x53374e['role']===_0xd0a8('0x28')?_0xd0a8('0x23'):_0x53374e[_0xd0a8('0x22')];_0x46c1b6[_0xb97140]-=_0x53374e[_0xd0a8('0x29')];if(_0x46c1b6[_0xb97140]<0x0)_0x46c1b6[_0xb97140]=0x0;});_0x3086a6(_0x46c1b6);return;});})[_0xd0a8('0xb')](function(_0x12c2bf){_0x1fbcf4(_0x12c2bf);});});}function checkUserLimits(_0x4ca331){return new BPromise(function(_0x12d61e,_0x251ffa){getLimits()['then'](function(_0xd9dadb){var _0x1cd280=_[_0xd0a8('0x2a')](_[_0xd0a8('0x2b')](_0x4ca331,_0xd0a8('0x22')),[_0xd0a8('0x28'),'user',_0xd0a8('0x24')]);var _0x1e3fc8=(_0x1cd280['admin']||0x0)+(_0x1cd280['user']||0x0);var _0xc1439c=_0x1cd280[_0xd0a8('0x24')]||0x0;if(_0x1e3fc8>_0xd9dadb['user'])return _0x251ffa(_0xd0a8('0x2c'));if(_0xc1439c>_0xd9dadb[_0xd0a8('0x24')])return _0x251ffa(_0xd0a8('0x2d'));return _0x12d61e();})['catch'](function(_0x2f21a0){_0x251ffa(_0x2f21a0);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xc971=['gray','format','grayReason','changed','message','User','role','sequelize','COUNT','col','count','admin','user','telephone','users','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','demo','machineUuid'];(function(_0x4bf565,_0x420d33){var _0x30e15f=function(_0x91a47f){while(--_0x91a47f){_0x4bf565['push'](_0x4bf565['shift']());}};_0x30e15f(++_0x420d33);}(_0xc971,0x1b7));var _0x1c97=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xc971[_0x164eca];return _0x2ce562;};'use strict';var util=require(_0x1c97('0x0'));var _=require('lodash');var moment=require(_0x1c97('0x1'));var BPromise=require(_0x1c97('0x2'));var hardware=require(_0x1c97('0x3'));var encryptor=require(_0x1c97('0x4'));var db=require(_0x1c97('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1c97('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1c97('0x7'),'machineUuid':hardware[_0x1c97('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1c97('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1f42aa){return new BPromise(function(_0x3d711a,_0x3886ce){return db['License']['find'](_['defaults'](_0x1f42aa,{'raw':!![],'where':{'id':0x1}}))[_0x1c97('0x9')](function(_0x55f04c){return checkLicense(_0x55f04c,null);})[_0x1c97('0x9')](function(_0x371521){_0x3d711a(_0x371521);return;})[_0x1c97('0xa')](function(_0x41dcdf){_0x3886ce(_0x41dcdf);});});}function checkLicense(_0x5804b1,_0x3efbc8){if(!_0x5804b1){demoLicense[_0x1c97('0xb')]=_0x5804b1[_0x1c97('0xc')];return demoLicense;}try{var _0x7fc97b=_0x3efbc8||_0x5804b1[_0x1c97('0xd')];if(_[_0x1c97('0xe')](_0x7fc97b)){throw new Error(_0x1c97('0xf'));}var _0x1a05e3=_0x5804b1['data1'];var _0x16ead5=_0x5804b1[_0x1c97('0x10')];var _0x13b089=_0x1a05e3['split']('-')[0x4];var _0x369f89=_0x1a05e3[_0x1c97('0x11')]('-')[0x0];var _0x4a2d6c=encryptor[_0x1c97('0x12')](_0x7fc97b,util['format'](_0x1c97('0x13'),_0x13b089,_0x1a05e3,_0x369f89));var _0x4a34d8=JSON[_0x1c97('0x14')](_0x4a2d6c);_0x4a34d8[_0x1c97('0x15')]=![];_0x4a34d8[_0x1c97('0xb')]=_0x1a05e3;_0x4a34d8[_0x1c97('0x16')]=hardware[_0x1c97('0x8')]();if(_0x16ead5){var _0xe46338=encryptor['decryptString'](_0x16ead5);_0x4a34d8[_0x1c97('0x17')]=_0xe46338;_0x4a34d8['deadline']=moment(_0xe46338)['add'](0x7,'days')[_0x1c97('0x18')]();_0x4a34d8[_0x1c97('0x19')]=_0x4a34d8[_0x1c97('0xb')]!=_0x4a34d8[_0x1c97('0x16')]?_0x1c97('0x1a'):'disabled';}return _0x4a34d8;}catch(_0x8a68cb){breakingLicense[_0x1c97('0xb')]=_0x5804b1[_0x1c97('0xc')];breakingLicense[_0x1c97('0x1b')]=_0x8a68cb['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x49f4d5,_0x37bd8e){getLicense()[_0x1c97('0x9')](function(_0x2a97e7){return db[_0x1c97('0x1c')]['findAll']({'attributes':[_0x1c97('0x1d'),[db[_0x1c97('0x1e')]['fn'](_0x1c97('0x1f'),db[_0x1c97('0x1e')][_0x1c97('0x20')]('role')),_0x1c97('0x21')]],'group':_0x1c97('0x1d'),'where':{'role':{'$or':[_0x1c97('0x22'),_0x1c97('0x23'),_0x1c97('0x24')]}},'raw':!![]})['then'](function(_0x28d34f){var _0x317aaf={'user':_0x2a97e7[_0x1c97('0x25')]||0x0,'telephone':_0x2a97e7['telephones']||0x0};_0x28d34f[_0x1c97('0x26')](function(_0x482944){var _0x57c4e7=_0x482944[_0x1c97('0x1d')]===_0x1c97('0x22')?_0x1c97('0x23'):_0x482944[_0x1c97('0x1d')];_0x317aaf[_0x57c4e7]-=_0x482944[_0x1c97('0x21')];if(_0x317aaf[_0x57c4e7]<0x0)_0x317aaf[_0x57c4e7]=0x0;});_0x49f4d5(_0x317aaf);return;});})[_0x1c97('0xa')](function(_0x5327d5){_0x37bd8e(_0x5327d5);});});}function checkUserLimits(_0x413542){return new BPromise(function(_0x14e45b,_0x568786){getLimits()['then'](function(_0x30837a){var _0x37d0d3=_['pick'](_[_0x1c97('0x27')](_0x413542,_0x1c97('0x1d')),[_0x1c97('0x22'),_0x1c97('0x23'),_0x1c97('0x24')]);var _0x50b1de=(_0x37d0d3[_0x1c97('0x22')]||0x0)+(_0x37d0d3[_0x1c97('0x23')]||0x0);var _0x1b1b3a=_0x37d0d3['telephone']||0x0;if(_0x50b1de>_0x30837a[_0x1c97('0x23')])return _0x568786(_0x1c97('0x28'));if(_0x1b1b3a>_0x30837a['telephone'])return _0x568786(_0x1c97('0x29'));return _0x14e45b();})[_0x1c97('0xa')](function(_0x28c101){_0x568786(_0x28c101);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 87d3a96..f4699a4 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 _0x4fc2=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x4d49b5,_0x1cee28){var _0x24d6b6=function(_0x487d97){while(--_0x487d97){_0x4d49b5['push'](_0x4d49b5['shift']());}};_0x24d6b6(++_0x1cee28);}(_0x4fc2,0x111));var _0x24fc=function(_0xae1364,_0x44863f){_0xae1364=_0xae1364-0x0;var _0x55104f=_0x4fc2[_0xae1364];return _0x55104f;};'use strict';module[_0x24fc('0x0')]={'DOMAIN':_0x24fc('0x1'),'SESSION_SECRET':_0x24fc('0x2'),'GOOGLE_ID':_0x24fc('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x5fdc=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x29e6fb,_0x45cac0){var _0x322c48=function(_0x456ed6){while(--_0x456ed6){_0x29e6fb['push'](_0x29e6fb['shift']());}};_0x322c48(++_0x45cac0);}(_0x5fdc,0x127));var _0xc5fd=function(_0x5e068c,_0x4b9102){_0x5e068c=_0x5e068c-0x0;var _0x2fe82d=_0x5fdc[_0x5e068c];return _0x2fe82d;};'use strict';module[_0xc5fd('0x0')]={'DOMAIN':_0xc5fd('0x1'),'SESSION_SECRET':_0xc5fd('0x2'),'GOOGLE_ID':_0xc5fd('0x3'),'GOOGLE_SECRET':_0xc5fd('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 5fc647f..bd331ae 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f14=['exports'];(function(_0x10bd3d,_0x478dfb){var _0x48d6fd=function(_0xdf597f){while(--_0xdf597f){_0x10bd3d['push'](_0x10bd3d['shift']());}};_0x48d6fd(++_0x478dfb);}(_0x3f14,0x1b5));var _0x43f1=function(_0xab2afb,_0x546bfb){_0xab2afb=_0xab2afb-0x0;var _0x25262b=_0x3f14[_0xab2afb];return _0x25262b;};'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module[_0x43f1('0x0')]=fileLogger; \ No newline at end of file +var _0xf4bb=['../utils/loggers','exports'];(function(_0x1d7d07,_0x6447fe){var _0x38c15c=function(_0x12200a){while(--_0x12200a){_0x1d7d07['push'](_0x1d7d07['shift']());}};_0x38c15c(++_0x6447fe);}(_0xf4bb,0x178));var _0xbf4b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xf4bb[_0x4fc9e6];return _0x551d28;};'use strict';var fileLogger=require(_0xbf4b('0x0'))['fileLogger'];module[_0xbf4b('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 3b0e397..d9658c6 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 _0xd574=['../../config/environment','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x1a2b48,_0x179630){var _0x5edd06=function(_0x80513d){while(--_0x80513d){_0x1a2b48['push'](_0x1a2b48['shift']());}};_0x5edd06(++_0x179630);}(_0xd574,0xb0));var _0x4d57=function(_0x1f9588,_0x349d4f){_0x1f9588=_0x1f9588-0x0;var _0x2f9216=_0xd574[_0x1f9588];return _0x2f9216;};'use strict';var path=require('path');var cfg=require(_0x4d57('0x0'));var env={'NODE_PATH':path[_0x4d57('0x1')](path[_0x4d57('0x2')](cfg[_0x4d57('0x3')],_0x4d57('0x4')))};var pm2config={'apps':[{'name':_0x4d57('0x5'),'script':path[_0x4d57('0x2')](__dirname,_0x4d57('0x6')),'env':env},{'name':_0x4d57('0x7'),'script':path[_0x4d57('0x2')](__dirname,_0x4d57('0x8')),'env':env},{'name':_0x4d57('0x9'),'script':path['join'](__dirname,_0x4d57('0xa')),'env':env},{'name':_0x4d57('0xb'),'script':path['join'](__dirname,_0x4d57('0xc')),'env':env},{'name':'routing','script':path['join'](__dirname,_0x4d57('0xd')),'env':env},{'name':_0x4d57('0xe'),'script':path['join'](__dirname,_0x4d57('0xf')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0xccb5=['resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','xdr','exports','path','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xccb5,0xce));var _0x5ccb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xccb5[_0x2641f9];return _0x585741;};'use strict';var path=require(_0x5ccb('0x0'));var cfg=require(_0x5ccb('0x1'));var env={'NODE_PATH':path[_0x5ccb('0x2')](path[_0x5ccb('0x3')](cfg[_0x5ccb('0x4')],_0x5ccb('0x5')))};var pm2config={'apps':[{'name':_0x5ccb('0x6'),'script':path[_0x5ccb('0x3')](__dirname,_0x5ccb('0x7')),'env':env},{'name':_0x5ccb('0x8'),'script':path[_0x5ccb('0x3')](__dirname,_0x5ccb('0x9')),'env':env},{'name':_0x5ccb('0xa'),'script':path['join'](__dirname,_0x5ccb('0xb')),'env':env},{'name':'email','script':path[_0x5ccb('0x3')](__dirname,_0x5ccb('0xc')),'env':env},{'name':_0x5ccb('0xd'),'script':path[_0x5ccb('0x3')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x5ccb('0xe'),'script':path[_0x5ccb('0x3')](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x5ccb('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 98f80c4..5c2d158 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 _0x8261=['stop','restart','list','describe','delete','dump','saved','bluebird','./config','connect','start','then','disconnect'];(function(_0x5cd395,_0x507285){var _0x141227=function(_0x5893fe){while(--_0x5893fe){_0x5cd395['push'](_0x5cd395['shift']());}};_0x141227(++_0x507285);}(_0x8261,0x10b));var _0x1826=function(_0xc31ceb,_0x70f595){_0xc31ceb=_0xc31ceb-0x0;var _0x7eb038=_0x8261[_0xc31ceb];return _0x7eb038;};'use strict';var pm2=require('pm2');var BPromise=require(_0x1826('0x0'));var config=require(_0x1826('0x1'));function connect(){return new BPromise(function(_0x102bdc,_0x131b47){return pm2[_0x1826('0x2')](function(_0x552440){if(_0x552440){return _0x131b47(_0x552440);}return _0x102bdc('connected');});});};exports[_0x1826('0x3')]=function(_0x260449){return connect()[_0x1826('0x4')](function(){return new BPromise(function(_0x59c017,_0x5430eb){return pm2['start'](_0x260449,function(_0x3910af,_0x23eca8){if(_0x3910af){return _0x5430eb(_0x3910af);}pm2[_0x1826('0x5')]();return _0x59c017(_0x23eca8);});});});};exports[_0x1826('0x6')]=function(_0x213315){return connect()[_0x1826('0x4')](function(){return new BPromise(function(_0x257efc,_0x442de7){return pm2['stop'](_0x213315,function(_0x29ae60,_0x4ccce9){if(_0x29ae60){return _0x442de7(_0x29ae60);}pm2[_0x1826('0x5')]();return _0x257efc(_0x4ccce9);});});});};exports['restart']=function(_0x41d10e){return connect()[_0x1826('0x4')](function(){return new BPromise(function(_0x5ca626,_0x277291){return pm2[_0x1826('0x7')](_0x41d10e,function(_0x4fdd6a,_0x23e626){if(_0x4fdd6a){return _0x277291(_0x4fdd6a);}pm2['disconnect']();return _0x5ca626(_0x23e626);});});});};exports[_0x1826('0x8')]=function(){return connect()[_0x1826('0x4')](function(){return new BPromise(function(_0x434025,_0x2c41b1){return pm2['list'](function(_0x5187c8,_0x47e9a7){if(_0x5187c8){return _0x2c41b1(_0x5187c8);}pm2[_0x1826('0x5')]();return _0x434025(_0x47e9a7);});});});};exports[_0x1826('0x9')]=function(_0x1e9477){return connect()[_0x1826('0x4')](function(){return new BPromise(function(_0x43d982,_0x4dc792){return pm2[_0x1826('0x9')](_0x1e9477,function(_0x215f5e,_0x4a85e2){if(_0x215f5e){return _0x4dc792(_0x215f5e);}pm2['disconnect']();return _0x43d982(_0x4a85e2);});});});};exports[_0x1826('0xa')]=function(_0x35b210){return connect()[_0x1826('0x4')](function(){return new BPromise(function(_0xbff175,_0x53f5e8){return pm2[_0x1826('0xa')](_0x35b210,function(_0xb10729,_0xeb8dd6){if(_0xb10729){return _0x53f5e8(_0xb10729);}pm2['disconnect']();return _0xbff175(_0xeb8dd6);});});});};exports[_0x1826('0xb')]=function(){return connect()[_0x1826('0x4')](function(){return new BPromise(function(_0x1b4dca,_0x1a797f){return pm2[_0x1826('0xb')](function(_0x43843c){if(_0x43843c){return _0x1a797f(_0x43843c);}return _0x1b4dca(_0x1826('0xc'));});});});}; \ No newline at end of file +var _0x4a11=['disconnect','restart','list','delete','dump','saved','pm2','bluebird','connect','connected','start','then'];(function(_0x392f9c,_0x25d116){var _0x57805a=function(_0x4b0892){while(--_0x4b0892){_0x392f9c['push'](_0x392f9c['shift']());}};_0x57805a(++_0x25d116);}(_0x4a11,0x17a));var _0x14a1=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0x4a11[_0x21b36c];return _0x236627;};'use strict';var pm2=require(_0x14a1('0x0'));var BPromise=require(_0x14a1('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x55a5b6,_0x6cb42a){return pm2[_0x14a1('0x2')](function(_0x82601c){if(_0x82601c){return _0x6cb42a(_0x82601c);}return _0x55a5b6(_0x14a1('0x3'));});});};exports[_0x14a1('0x4')]=function(_0x1f9b0d){return connect()[_0x14a1('0x5')](function(){return new BPromise(function(_0x4f0b91,_0xa98fe5){return pm2[_0x14a1('0x4')](_0x1f9b0d,function(_0x4d71a0,_0x3dae18){if(_0x4d71a0){return _0xa98fe5(_0x4d71a0);}pm2[_0x14a1('0x6')]();return _0x4f0b91(_0x3dae18);});});});};exports['stop']=function(_0x4e3de1){return connect()[_0x14a1('0x5')](function(){return new BPromise(function(_0x446c3f,_0x27a5a4){return pm2['stop'](_0x4e3de1,function(_0x4fa841,_0x5a6abd){if(_0x4fa841){return _0x27a5a4(_0x4fa841);}pm2[_0x14a1('0x6')]();return _0x446c3f(_0x5a6abd);});});});};exports[_0x14a1('0x7')]=function(_0x2b4cd4){return connect()[_0x14a1('0x5')](function(){return new BPromise(function(_0xee3b9a,_0x2b75cd){return pm2[_0x14a1('0x7')](_0x2b4cd4,function(_0x35d2e0,_0x2f6e93){if(_0x35d2e0){return _0x2b75cd(_0x35d2e0);}pm2[_0x14a1('0x6')]();return _0xee3b9a(_0x2f6e93);});});});};exports[_0x14a1('0x8')]=function(){return connect()[_0x14a1('0x5')](function(){return new BPromise(function(_0xc163cd,_0x3a7294){return pm2['list'](function(_0x482415,_0x17a6cf){if(_0x482415){return _0x3a7294(_0x482415);}pm2[_0x14a1('0x6')]();return _0xc163cd(_0x17a6cf);});});});};exports['describe']=function(_0x260331){return connect()['then'](function(){return new BPromise(function(_0x2c0673,_0x5e9dad){return pm2['describe'](_0x260331,function(_0x5439af,_0xf18335){if(_0x5439af){return _0x5e9dad(_0x5439af);}pm2['disconnect']();return _0x2c0673(_0xf18335);});});});};exports[_0x14a1('0x9')]=function(_0x389bd6){return connect()[_0x14a1('0x5')](function(){return new BPromise(function(_0x2db64c,_0x1ddcf9){return pm2['delete'](_0x389bd6,function(_0x427cd7,_0xa5f7a6){if(_0x427cd7){return _0x1ddcf9(_0x427cd7);}pm2[_0x14a1('0x6')]();return _0x2db64c(_0xa5f7a6);});});});};exports[_0x14a1('0xa')]=function(){return connect()[_0x14a1('0x5')](function(){return new BPromise(function(_0x5e8aa4,_0x581186){return pm2[_0x14a1('0xa')](function(_0x3a9338){if(_0x3a9338){return _0x581186(_0x3a9338);}return _0x5e8aa4(_0x14a1('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index dd9252f..d44639d 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 _0x32de=['localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','subtract','map','info','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults'];(function(_0x1c9e7b,_0x5ea7c3){var _0x54fc19=function(_0x1cd7f6){while(--_0x1cd7f6){_0x1c9e7b['push'](_0x1c9e7b['shift']());}};_0x54fc19(++_0x5ea7c3);}(_0x32de,0x119));var _0xe32d=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0x32de[_0x165c96];return _0x5c2420;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xe32d('0x0'));var util=require('util');var config=require(_0xe32d('0x1'));var db=require(_0xe32d('0x2'))['db'];var logger=require(_0xe32d('0x3'))(_0xe32d('0x4'));config[_0xe32d('0x5')]=_[_0xe32d('0x6')](config[_0xe32d('0x5')],{'host':_0xe32d('0x7'),'port':0x18eb});var io=require(_0xe32d('0x8'))(new Redis(config[_0xe32d('0x5')]));function closeInteractions(){var _0x513a6e=0x0;var _0x323a0b=[];return db[_0xe32d('0x9')][_0xe32d('0xa')]({'raw':!![],'attributes':['id',_0xe32d('0xb')],'where':{'id':0x1}})[_0xe32d('0xc')](function(_0x414297){_0x513a6e=_0x414297[_0xe32d('0xb')];if(_0x513a6e){return db['ChatInteraction'][_0xe32d('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe32d('0xe')](_0x414297[_0xe32d('0xb')],'minutes')}}});}else{return[];}})[_0xe32d('0xc')](function(_0x57acda){if(_0x57acda&&_0x57acda['length']){_0x323a0b=_[_0xe32d('0xf')](_0x57acda||[],'id');logger[_0xe32d('0x10')](_0xe32d('0x11'),_0x323a0b['join']());return db[_0xe32d('0x12')][_0xe32d('0x13')]({'closeReason':_0xe32d('0x14'),'disposition':_0xe32d('0x15'),'closed':!![],'closedAt':moment()[_0xe32d('0x16')](_0xe32d('0x17'))},{'where':{'id':_0x323a0b}});}})[_0xe32d('0xc')](function(){if(_0x323a0b&&_0x323a0b[_0xe32d('0x18')]){logger[_0xe32d('0x10')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x323a0b[_0xe32d('0x19')]());for(var _0x176da4=0x0;_0x176da4<_0x323a0b[_0xe32d('0x18')];_0x176da4++){io[_0xe32d('0x1a')](_0xe32d('0x1b'),{'id':_0x323a0b[_0x176da4],'closed':!![]});}}})[_0xe32d('0x1c')](function(_0x278073){logger['error'](_0xe32d('0x1d'),_0x278073?util[_0xe32d('0x1e')](_0x278073,{'showHidden':![],'depth':null}):'');});}exports[_0xe32d('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa726=['join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','then','chatTimeout','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x4e0359,_0x205155){var _0x450f0a=function(_0x2056c6){while(--_0x2056c6){_0x4e0359['push'](_0x4e0359['shift']());}};_0x450f0a(++_0x205155);}(_0xa726,0x161));var _0x6a72=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xa726[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x6a72('0x0'));var moment=require(_0x6a72('0x1'));var Redis=require(_0x6a72('0x2'));var util=require('util');var config=require(_0x6a72('0x3'));var db=require(_0x6a72('0x4'))['db'];var logger=require(_0x6a72('0x5'))(_0x6a72('0x6'));config[_0x6a72('0x7')]=_['defaults'](config[_0x6a72('0x7')],{'host':_0x6a72('0x8'),'port':0x18eb});var io=require(_0x6a72('0x9'))(new Redis(config[_0x6a72('0x7')]));function closeInteractions(){var _0x5d5de6=0x0;var _0x128877=[];return db[_0x6a72('0xa')][_0x6a72('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6a72('0xc')](function(_0x39cff1){_0x5d5de6=_0x39cff1[_0x6a72('0xd')];if(_0x5d5de6){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6a72('0xe')](_0x39cff1['chatTimeout'],'minutes')}}});}else{return[];}})[_0x6a72('0xc')](function(_0x5db295){if(_0x5db295&&_0x5db295[_0x6a72('0xf')]){_0x128877=_[_0x6a72('0x10')](_0x5db295||[],'id');logger[_0x6a72('0x11')](_0x6a72('0x12'),_0x128877[_0x6a72('0x13')]());return db['ChatInteraction'][_0x6a72('0x14')]({'closeReason':'system','disposition':_0x6a72('0x15'),'closed':!![],'closedAt':moment()[_0x6a72('0x16')](_0x6a72('0x17'))},{'where':{'id':_0x128877}});}})[_0x6a72('0xc')](function(){if(_0x128877&&_0x128877['length']){logger[_0x6a72('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x128877[_0x6a72('0x13')]());for(var _0x2c1e53=0x0;_0x2c1e53<_0x128877[_0x6a72('0xf')];_0x2c1e53++){io[_0x6a72('0x18')](_0x6a72('0x19'),{'id':_0x128877[_0x2c1e53],'closed':!![]});}}})[_0x6a72('0x1a')](function(_0x2a6994){logger[_0x6a72('0x1b')](_0x6a72('0x1c'),_0x2a6994?util[_0x6a72('0x1d')](_0x2a6994,{'showHidden':![],'depth':null}):'');});}exports[_0x6a72('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 d51d4c9..f422d1a 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 _0x4b2d=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x690c06,_0x14a580){var _0x2c1976=function(_0x547052){while(--_0x547052){_0x690c06['push'](_0x690c06['shift']());}};_0x2c1976(++_0x14a580);}(_0x4b2d,0x6f));var _0xd4b2=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0x4b2d[_0x364a36];return _0x5cd6fa;};'use strict';function start(){var _0x5534b5=require(_0xd4b2('0x0'));return _0x5534b5[_0xd4b2('0x1')]();}module[_0xd4b2('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xdee7=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x315eea,_0x1b0d52){var _0x20a0a5=function(_0x207f3e){while(--_0x207f3e){_0x315eea['push'](_0x315eea['shift']());}};_0x20a0a5(++_0x1b0d52);}(_0xdee7,0xc5));var _0x7dee=function(_0x1c4641,_0x317d67){_0x1c4641=_0x1c4641-0x0;var _0x2fc9ee=_0xdee7[_0x1c4641];return _0x2fc9ee;};'use strict';function start(){var _0x2641a0=require(_0x7dee('0x0'));return _0x2641a0[_0x7dee('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 2cca1a6..9a75da1 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 _0x6a92=['endAt','add\x20cron','exists','stop','startAt','update','update\x20cron','stop\x20cron','run','start','util','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','catch','data','Smtp','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','toString','keyBy','intersection','difference','length','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','isBetween'];(function(_0x3fd9b0,_0x1f3a0e){var _0x3c68d6=function(_0x370aeb){while(--_0x370aeb){_0x3fd9b0['push'](_0x3fd9b0['shift']());}};_0x3c68d6(++_0x1f3a0e);}(_0x6a92,0xaa));var _0x26a9=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x6a92[_0x3e44fa];return _0x2a0aba;};'use strict';var fs=require('fs');var util=require(_0x26a9('0x0'));var path=require('path');var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x26a9('0x1'));var BPromise=require(_0x26a9('0x2'));var logger=require(_0x26a9('0x3'))(_0x26a9('0x4'));var db=require(_0x26a9('0x5'))['db'];var analyticCustomReportController=require(_0x26a9('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x26a9('0x7')][_0x26a9('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xbc0a9f,_0xbfdd8){return function(){logger[_0x26a9('0x9')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xbc0a9f[_0x26a9('0xa')]);var _0x2633d0=!![];var _0x409692=_0xbc0a9f[_0x26a9('0xb')][_0x26a9('0xc')]();var _0x3da0b3={'account':_0x409692,'message':{'from':util[_0x26a9('0xd')](_0x26a9('0xe'),_0xbc0a9f['MailAccount'][_0x26a9('0xf')],_0xbc0a9f['MailAccount'][_0x26a9('0xa')]||_0xbc0a9f[_0x26a9('0xb')]['Smtp']['user']),'to':_0xbc0a9f[_0x26a9('0xa')],'cc':_0xbc0a9f['cc'],'bcc':_0xbc0a9f[_0x26a9('0x10')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0xbfdd8[_0x26a9('0xf')],_0xbc0a9f[_0x26a9('0x11')],_0xbc0a9f[_0x26a9('0x12')])}};var _0x242a6d=path[_0x26a9('0x13')](__dirname,_0x26a9('0x14'));var _0x123702=_0xbfdd8['savename'];var _0x4a5e15=util[_0x26a9('0xd')](_0x26a9('0x15'),path[_0x26a9('0x16')](_0xbfdd8[_0x26a9('0x17')],path[_0x26a9('0x18')](_0xbfdd8[_0x26a9('0x17')])),'zip');var _0x1d0356=path[_0x26a9('0x13')](_0x242a6d,_0x123702);var _0x440c89=path['join'](_0x242a6d,_0x4a5e15);if(fs[_0x26a9('0x19')](_0x1d0356)){_0xbfdd8[_0x26a9('0x1a')]='Sent';_0x3da0b3[_0x26a9('0x1b')][_0x26a9('0x1c')]=[{'filename':_0x123702,'path':_0x1d0356}];_0x3da0b3['message'][_0x26a9('0x1d')]=util['format'](_0x26a9('0x1e'),JSON[_0x26a9('0x1f')](_0xbfdd8,null,0x2));}else if(fs[_0x26a9('0x19')](_0x440c89)){_0xbfdd8['status']='Sent';_0x3da0b3['message'][_0x26a9('0x1c')]=[{'filename':_0x4a5e15,'path':_0x440c89}];}else{_0x3da0b3[_0x26a9('0x1b')][_0x26a9('0x1d')]=_0x26a9('0x20');if(!_0xbc0a9f[_0x26a9('0x21')]){_0x2633d0=![];logger[_0x26a9('0x9')](_0x26a9('0x22'));}}if(_0x2633d0){return client[_0x26a9('0x23')](_0x26a9('0x24'),_0x3da0b3)['then'](function(_0x2c5791){if(_0x2c5791[_0x26a9('0x25')]){return logger['error'](_0x26a9('0x26'),JSON['stringify'](_0x2c5791));}return logger['info']('email\x20sent');})[_0x26a9('0x27')](function(_0x2835ba){return logger[_0x26a9('0x25')](_0x26a9('0x26'),JSON['stringify'](_0x2835ba));});}};}function handleError(){return function(_0x2967e5){return logger[_0x26a9('0x25')](JSON[_0x26a9('0x1f')](_0x2967e5));};}function handleResult(_0x3b3bc6){return function(_0x18e609){logger[_0x26a9('0x9')](_0x26a9('0x28'),JSON[_0x26a9('0x1f')](_0x18e609));if(_0x3b3bc6[_0x26a9('0xb')]&&_0x3b3bc6[_0x26a9('0xb')][_0x26a9('0x29')]&&!_[_0x26a9('0x2a')](_0x3b3bc6['email'])){setTimeout(handleSendEmail(_0x3b3bc6,_0x18e609),0x3c*0x3e8);}};}function handleJob(_0xb561d4){return function(){try{if(_[_0x26a9('0x2a')](_0xb561d4[_0x26a9('0x11')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x26a9('0x2a')](_0xb561d4[_0x26a9('0x12')])){return logger[_0x26a9('0x9')]('subtractUnit\x20null\x20or\x20undefined');}var _0x5c5001={'startDate':moment()[_0x26a9('0x2b')](_0xb561d4[_0x26a9('0x11')],_0xb561d4[_0x26a9('0x12')])[_0x26a9('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x26a9('0x2c')),'type':'scheduled','output':_0xb561d4['output'],'name':_0xb561d4[_0x26a9('0xf')]};if(!_[_0x26a9('0x2a')](_0xb561d4[_0x26a9('0x2d')])){logger['info'](_0x26a9('0x2e'),_0xb561d4[_0x26a9('0x2d')]);return analyticDefaultReportController[_0x26a9('0x2f')]({'id':_0xb561d4['DefaultReportId']},_0x5c5001)[_0x26a9('0x30')](handleResult(_0xb561d4))[_0x26a9('0x27')](handleError());}if(!_['isNil'](_0xb561d4['CustomReportId'])){logger[_0x26a9('0x9')](_0x26a9('0x31'),_0xb561d4[_0x26a9('0x32')]);return analyticCustomReportController[_0x26a9('0x2f')]({'id':_0xb561d4[_0x26a9('0x32')]},_0x5c5001)[_0x26a9('0x30')](handleResult(_0xb561d4))[_0x26a9('0x27')](handleError());}}catch(_0x4c1605){logger[_0x26a9('0x25')](JSON[_0x26a9('0x1f')](_0x4c1605));}return logger[_0x26a9('0x9')](_0x26a9('0x33'));};}function getJobs(_0x974af3){var _0xada9c={};if(_0x974af3){_0xada9c['id']=_0x974af3;}return db[_0x26a9('0x34')]['findAll']({'where':_0xada9c,'include':[{'model':db['MailAccount'],'attributes':['id',_0x26a9('0xf'),_0x26a9('0xa')],'include':[{'model':db[_0x26a9('0x35')],'as':_0x26a9('0x29'),'include':[{'model':db[_0x26a9('0x36')],'as':'CloudProvider'}]}]}]})[_0x26a9('0x30')](function(_0x38c83a){var _0x57dd7a=_[_0x26a9('0x37')](manager['jobs']);var _0x16fc29=_['map'](_0x38c83a,function(_0x1aaa81){return _0x1aaa81['id'][_0x26a9('0x38')]();});var _0x245934=_[_0x26a9('0x39')](_0x38c83a,function(_0x5a98ca){return _0x5a98ca['id'][_0x26a9('0x38')]();});var _0x55df6c=_0x974af3?_0x16fc29:_['difference'](_0x16fc29,_0x57dd7a);var _0x36c20f=_[_0x26a9('0x3a')](_0x16fc29,_0x57dd7a);var _0x44f7b7=_[_0x26a9('0x3b')](_0x57dd7a,_0x16fc29);var _0x31e641;var _0x54e016;for(_0x31e641=0x0;_0x31e641<_0x44f7b7[_0x26a9('0x3c')]&&!_0x974af3;_0x31e641+=0x1){_0x54e016=_0x44f7b7[_0x31e641][_0x26a9('0x38')]();if(manager['exists'](_0x54e016)){manager['stop'](_0x54e016);manager[_0x26a9('0x3d')](_0x54e016);logger['info'](_0x26a9('0x3e'),_0x54e016);}}logger[_0x26a9('0x9')](_0x26a9('0x3f'),JSON[_0x26a9('0x1f')](_0x55df6c));for(_0x31e641=0x0;_0x31e641<_0x55df6c[_0x26a9('0x3c')];_0x31e641+=0x1){_0x54e016=_0x55df6c[_0x31e641][_0x26a9('0x38')]();logger[_0x26a9('0x9')](_0x26a9('0x40'),_0x54e016);if(_0x974af3){logger[_0x26a9('0x9')]('my\x20id',_0x974af3);logger['info'](JSON['stringify'](_0x245934[_0x54e016]));BPromise[_0x26a9('0x41')]()['then'](handleJob(_0x245934[_0x54e016]));logger['info'](_0x26a9('0x42'),_0x245934[_0x54e016][_0x26a9('0xf')],_0x245934[_0x54e016]['cron']);}else if(_0x245934[_0x54e016][_0x26a9('0x43')]&&_0x245934[_0x54e016][_0x26a9('0x44')]&&moment()[_0x26a9('0x45')](_0x245934[_0x54e016]['startAt'],_0x245934[_0x54e016][_0x26a9('0x46')])){manager['add'](_0x54e016,_0x245934[_0x54e016][_0x26a9('0x43')],handleJob(_0x245934[_0x54e016]));manager['start'](_0x54e016);logger['info'](_0x26a9('0x47'),_0x245934[_0x54e016]['name'],_0x245934[_0x54e016][_0x26a9('0x43')]);}else if(manager[_0x26a9('0x48')](_0x54e016)){manager[_0x26a9('0x49')](_0x54e016);manager['deleteJob'](_0x54e016);logger[_0x26a9('0x9')]('stop\x20cron',_0x245934[_0x54e016]['name'],_0x245934[_0x54e016][_0x26a9('0x43')]);}}for(_0x31e641=0x0,_0x54e016;_0x31e641<_0x36c20f[_0x26a9('0x3c')]&&!_0x974af3;_0x31e641+=0x1){_0x54e016=_0x36c20f[_0x31e641]['toString']();if(manager[_0x26a9('0x48')](_0x54e016)){if(_0x245934[_0x54e016][_0x26a9('0x43')]&&_0x245934[_0x54e016][_0x26a9('0x44')]&&moment()[_0x26a9('0x45')](_0x245934[_0x54e016][_0x26a9('0x4a')],_0x245934[_0x54e016][_0x26a9('0x46')])){manager[_0x26a9('0x4b')](_0x54e016,_0x245934[_0x54e016][_0x26a9('0x43')],handleJob(_0x245934[_0x54e016]));logger[_0x26a9('0x9')](_0x26a9('0x4c'),_0x245934[_0x54e016][_0x26a9('0xf')],_0x245934[_0x54e016][_0x26a9('0x43')]);}else{manager[_0x26a9('0x49')](_0x54e016);manager['deleteJob'](_0x54e016);logger['info'](_0x26a9('0x4d'),_0x245934[_0x54e016]['name'],_0x245934[_0x54e016]['cron']);}}}})[_0x26a9('0x27')](function(_0x1f413b){logger[_0x26a9('0x25')](JSON[_0x26a9('0x1f')](_0x1f413b));});}exports[_0x26a9('0x4e')]=function(_0x1f4ccb){return getJobs(_0x1f4ccb);};exports[_0x26a9('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2fc7=['exists','deleteJob','delete\x20cron','toRun','index','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop','stop\x20cron','startAt','update\x20cron','run','lodash','moment','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','MailAccount','name','user','bcc','format','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','Sent','text','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length'];(function(_0x1489f8,_0x25b766){var _0x3c7f99=function(_0x1809b9){while(--_0x1809b9){_0x1489f8['push'](_0x1489f8['shift']());}};_0x3c7f99(++_0x25b766);}(_0x2fc7,0x1a2));var _0x72fc=function(_0x1b8729,_0x13dcd0){_0x1b8729=_0x1b8729-0x0;var _0x581199=_0x2fc7[_0x1b8729];return _0x581199;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x72fc('0x0'));var moment=require(_0x72fc('0x1'));var CronJobManager=require(_0x72fc('0x2'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x72fc('0x3'))(_0x72fc('0x4'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x72fc('0x5'));var analyticDefaultReportController=require(_0x72fc('0x6'));var client=jayson[_0x72fc('0x7')][_0x72fc('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x24ccce,_0x5b7cb6){return function(){logger['info'](_0x72fc('0x9'),_0x24ccce[_0x72fc('0xa')]);var _0x38b6dd=!![];var _0x4d9c61=_0x24ccce['MailAccount'][_0x72fc('0xb')]();var _0x550290={'account':_0x4d9c61,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x24ccce[_0x72fc('0xc')][_0x72fc('0xd')],_0x24ccce['MailAccount'][_0x72fc('0xa')]||_0x24ccce[_0x72fc('0xc')]['Smtp'][_0x72fc('0xe')]),'to':_0x24ccce[_0x72fc('0xa')],'cc':_0x24ccce['cc'],'bcc':_0x24ccce[_0x72fc('0xf')],'subject':util[_0x72fc('0x10')]('Report\x20%s\x20last\x20%s\x20%s',_0x5b7cb6[_0x72fc('0xd')],_0x24ccce[_0x72fc('0x11')],_0x24ccce[_0x72fc('0x12')])}};var _0x1494af=path[_0x72fc('0x13')](__dirname,'../../files/reports');var _0x3a8114=_0x5b7cb6[_0x72fc('0x14')];var _0x4b2f90=util['format'](_0x72fc('0x15'),path[_0x72fc('0x16')](_0x5b7cb6['savename'],path[_0x72fc('0x17')](_0x5b7cb6[_0x72fc('0x14')])),_0x72fc('0x18'));var _0xe9ff41=path[_0x72fc('0x13')](_0x1494af,_0x3a8114);var _0x1a2ccb=path[_0x72fc('0x13')](_0x1494af,_0x4b2f90);if(fs[_0x72fc('0x19')](_0xe9ff41)){_0x5b7cb6[_0x72fc('0x1a')]='Sent';_0x550290[_0x72fc('0x1b')][_0x72fc('0x1c')]=[{'filename':_0x3a8114,'path':_0xe9ff41}];_0x550290['message']['text']=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x5b7cb6,null,0x2));}else if(fs['existsSync'](_0x1a2ccb)){_0x5b7cb6[_0x72fc('0x1a')]=_0x72fc('0x1d');_0x550290[_0x72fc('0x1b')][_0x72fc('0x1c')]=[{'filename':_0x4b2f90,'path':_0x1a2ccb}];}else{_0x550290[_0x72fc('0x1b')][_0x72fc('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x24ccce[_0x72fc('0x1f')]){_0x38b6dd=![];logger[_0x72fc('0x20')](_0x72fc('0x21'));}}if(_0x38b6dd){return client['request'](_0x72fc('0x22'),_0x550290)[_0x72fc('0x23')](function(_0x13f6ff){if(_0x13f6ff[_0x72fc('0x24')]){return logger[_0x72fc('0x24')](_0x72fc('0x25'),JSON[_0x72fc('0x26')](_0x13f6ff));}return logger[_0x72fc('0x20')](_0x72fc('0x27'));})[_0x72fc('0x28')](function(_0x389c62){return logger[_0x72fc('0x24')]('error\x20mail',JSON['stringify'](_0x389c62));});}};}function handleError(){return function(_0x56ace1){return logger[_0x72fc('0x24')](JSON[_0x72fc('0x26')](_0x56ace1));};}function handleResult(_0x356419){return function(_0x155d29){logger['info']('data',JSON[_0x72fc('0x26')](_0x155d29));if(_0x356419[_0x72fc('0xc')]&&_0x356419[_0x72fc('0xc')][_0x72fc('0x29')]&&!_[_0x72fc('0x2a')](_0x356419[_0x72fc('0xa')])){setTimeout(handleSendEmail(_0x356419,_0x155d29),0x3c*0x3e8);}};}function handleJob(_0x43abec){return function(){try{if(_[_0x72fc('0x2a')](_0x43abec[_0x72fc('0x11')])){return logger[_0x72fc('0x20')](_0x72fc('0x2b'));}if(_[_0x72fc('0x2a')](_0x43abec[_0x72fc('0x12')])){return logger[_0x72fc('0x20')]('subtractUnit\x20null\x20or\x20undefined');}var _0x3d8ff9={'startDate':moment()['subtract'](_0x43abec['subtractNumber'],_0x43abec[_0x72fc('0x12')])['format'](_0x72fc('0x2c')),'endDate':moment()['format'](_0x72fc('0x2c')),'type':'scheduled','output':_0x43abec[_0x72fc('0x2d')],'name':_0x43abec[_0x72fc('0xd')]};if(!_['isNil'](_0x43abec[_0x72fc('0x2e')])){logger[_0x72fc('0x20')](_0x72fc('0x2f'),_0x43abec[_0x72fc('0x2e')]);return analyticDefaultReportController[_0x72fc('0x30')]({'id':_0x43abec[_0x72fc('0x2e')]},_0x3d8ff9)[_0x72fc('0x23')](handleResult(_0x43abec))['catch'](handleError());}if(!_[_0x72fc('0x2a')](_0x43abec[_0x72fc('0x31')])){logger['info'](_0x72fc('0x32'),_0x43abec[_0x72fc('0x31')]);return analyticCustomReportController['runReport']({'id':_0x43abec[_0x72fc('0x31')]},_0x3d8ff9)[_0x72fc('0x23')](handleResult(_0x43abec))['catch'](handleError());}}catch(_0x3ca949){logger[_0x72fc('0x24')](JSON[_0x72fc('0x26')](_0x3ca949));}return logger[_0x72fc('0x20')](_0x72fc('0x33'));};}function getJobs(_0xde1a75){var _0x65dddc={};if(_0xde1a75){_0x65dddc['id']=_0xde1a75;}return db['Schedule'][_0x72fc('0x34')]({'where':_0x65dddc,'include':[{'model':db[_0x72fc('0xc')],'attributes':['id',_0x72fc('0xd'),_0x72fc('0xa')],'include':[{'model':db['MailServerOut'],'as':_0x72fc('0x29'),'include':[{'model':db[_0x72fc('0x35')],'as':'CloudProvider'}]}]}]})[_0x72fc('0x23')](function(_0x31feaa){var _0x4f7559=_[_0x72fc('0x36')](manager[_0x72fc('0x37')]);var _0x4dac99=_[_0x72fc('0x38')](_0x31feaa,function(_0x435238){return _0x435238['id'][_0x72fc('0x39')]();});var _0x3ffd5c=_[_0x72fc('0x3a')](_0x31feaa,function(_0x5c6bdf){return _0x5c6bdf['id'][_0x72fc('0x39')]();});var _0x3c151f=_0xde1a75?_0x4dac99:_[_0x72fc('0x3b')](_0x4dac99,_0x4f7559);var _0x209819=_[_0x72fc('0x3c')](_0x4dac99,_0x4f7559);var _0x1516c5=_['difference'](_0x4f7559,_0x4dac99);var _0x5b8d82;var _0x1e2c84;for(_0x5b8d82=0x0;_0x5b8d82<_0x1516c5[_0x72fc('0x3d')]&&!_0xde1a75;_0x5b8d82+=0x1){_0x1e2c84=_0x1516c5[_0x5b8d82][_0x72fc('0x39')]();if(manager[_0x72fc('0x3e')](_0x1e2c84)){manager['stop'](_0x1e2c84);manager[_0x72fc('0x3f')](_0x1e2c84);logger[_0x72fc('0x20')](_0x72fc('0x40'),_0x1e2c84);}}logger['info'](_0x72fc('0x41'),JSON[_0x72fc('0x26')](_0x3c151f));for(_0x5b8d82=0x0;_0x5b8d82<_0x3c151f[_0x72fc('0x3d')];_0x5b8d82+=0x1){_0x1e2c84=_0x3c151f[_0x5b8d82]['toString']();logger[_0x72fc('0x20')](_0x72fc('0x42'),_0x1e2c84);if(_0xde1a75){logger['info']('my\x20id',_0xde1a75);logger[_0x72fc('0x20')](JSON[_0x72fc('0x26')](_0x3ffd5c[_0x1e2c84]));BPromise['resolve']()[_0x72fc('0x23')](handleJob(_0x3ffd5c[_0x1e2c84]));logger[_0x72fc('0x20')](_0x72fc('0x43'),_0x3ffd5c[_0x1e2c84][_0x72fc('0xd')],_0x3ffd5c[_0x1e2c84]['cron']);}else if(_0x3ffd5c[_0x1e2c84][_0x72fc('0x44')]&&_0x3ffd5c[_0x1e2c84][_0x72fc('0x45')]&&moment()[_0x72fc('0x46')](_0x3ffd5c[_0x1e2c84]['startAt'],_0x3ffd5c[_0x1e2c84][_0x72fc('0x47')])){manager[_0x72fc('0x48')](_0x1e2c84,_0x3ffd5c[_0x1e2c84]['cron'],handleJob(_0x3ffd5c[_0x1e2c84]));manager[_0x72fc('0x49')](_0x1e2c84);logger[_0x72fc('0x20')](_0x72fc('0x4a'),_0x3ffd5c[_0x1e2c84][_0x72fc('0xd')],_0x3ffd5c[_0x1e2c84][_0x72fc('0x44')]);}else if(manager[_0x72fc('0x3e')](_0x1e2c84)){manager[_0x72fc('0x4b')](_0x1e2c84);manager['deleteJob'](_0x1e2c84);logger[_0x72fc('0x20')](_0x72fc('0x4c'),_0x3ffd5c[_0x1e2c84][_0x72fc('0xd')],_0x3ffd5c[_0x1e2c84]['cron']);}}for(_0x5b8d82=0x0,_0x1e2c84;_0x5b8d82<_0x209819['length']&&!_0xde1a75;_0x5b8d82+=0x1){_0x1e2c84=_0x209819[_0x5b8d82][_0x72fc('0x39')]();if(manager['exists'](_0x1e2c84)){if(_0x3ffd5c[_0x1e2c84]['cron']&&_0x3ffd5c[_0x1e2c84][_0x72fc('0x45')]&&moment()[_0x72fc('0x46')](_0x3ffd5c[_0x1e2c84][_0x72fc('0x4d')],_0x3ffd5c[_0x1e2c84][_0x72fc('0x47')])){manager['update'](_0x1e2c84,_0x3ffd5c[_0x1e2c84][_0x72fc('0x44')],handleJob(_0x3ffd5c[_0x1e2c84]));logger[_0x72fc('0x20')](_0x72fc('0x4e'),_0x3ffd5c[_0x1e2c84][_0x72fc('0xd')],_0x3ffd5c[_0x1e2c84]['cron']);}else{manager[_0x72fc('0x4b')](_0x1e2c84);manager['deleteJob'](_0x1e2c84);logger['info'](_0x72fc('0x4c'),_0x3ffd5c[_0x1e2c84][_0x72fc('0xd')],_0x3ffd5c[_0x1e2c84]['cron']);}}}})[_0x72fc('0x28')](function(_0x1b7842){logger[_0x72fc('0x24')](JSON[_0x72fc('0x26')](_0x1b7842));});}exports[_0x72fc('0x4f')]=function(_0x1fa542){return getJobs(_0x1fa542);};exports[_0x72fc('0x49')]=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 7573877..d65cc80 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefda=['push','catch','inspect','start','lodash','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','update','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Transcript\x20not\x20available','ValidationError','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Sentiment\x20Analysis\x20not\x20configured','findOne','Sentiment','Negative','name','SequelizeValidationError','error','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','CloudProvider','forEach'];(function(_0x543349,_0x8f9924){var _0x2f87da=function(_0x25be61){while(--_0x25be61){_0x543349['push'](_0x543349['shift']());}};_0x2f87da(++_0x8f9924);}(_0xefda,0x96));var _0xaefd=function(_0x1d578d,_0x2c4180){_0x1d578d=_0x1d578d-0x0;var _0x466d69=_0xefda[_0x1d578d];return _0x466d69;};var _=require(_0xaefd('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xaefd('0x1'));var BPromise=require(_0xaefd('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xaefd('0x3'))(_0xaefd('0x4'));function getTranscriptionJob(_0x2ade44,_0x22df24,_0x1ef6b4,_0x3288f9){return new Promise(function(_0x497258,_0x3677ea){var _0x3b9736=new AWS[(_0xaefd('0x5'))]({'accessKeyId':_0x22df24,'secretAccessKey':_0x2ade44,'region':_0x1ef6b4});_0x3b9736[_0xaefd('0x6')]({'TranscriptionJobName':_0x3288f9},function(_0x4ce248,_0x15193c){if(_0x4ce248){return _0x3677ea(_0x4ce248);}else{return _0x497258(_0x15193c);}});});}function sentiment(_0xbb04fb,_0x463ce7,_0x4d44ed,_0x48a255,_0x54a3b1){return new Promise(function(_0xa6239d,_0x16b36e){var _0x20135c=new AWS[(_0xaefd('0x7'))]({'accessKeyId':_0x463ce7,'secretAccessKey':_0xbb04fb,'region':_0x4d44ed});_0x20135c[_0xaefd('0x8')]({'Text':_0x48a255,'LanguageCode':_0x54a3b1[_0xaefd('0x9')](0x0,0x2)},function(_0x2ad4d9,_0x3dfddf){if(_0x2ad4d9){return _0x16b36e(_0x2ad4d9);}else{return _0xa6239d(_0x3dfddf);}});});}function checkTranscribeJob(_0x27be0f,_0x382983,_0x2a310c){var _0x4b2b5c;return new BPromise(function(_0x3172d3,_0x4ac467){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0xc'),_0x27be0f['id'],_0x27be0f[_0xaefd('0xd')]));return getTranscriptionJob(_0x2a310c['data1'],_0x2a310c[_0xaefd('0xe')],_0x382983[_0xaefd('0xf')],_0x27be0f[_0xaefd('0xd')])[_0xaefd('0x10')](function(_0x10ee28){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x11'),_0x27be0f['id'],_0x27be0f['transcribeName'],_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')]));if(!_0x27be0f[_0xaefd('0x14')]){switch(_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')]){case _0xaefd('0x15'):var _0x516e84={'transcribeStatus':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')],'fileUri':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x16')][_0xaefd('0x17')]};logger[_0xaefd('0xa')](util['format'](_0xaefd('0x18'),_0x27be0f['id']));return rp({'uri':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x16')][_0xaefd('0x17')],'json':!![]})[_0xaefd('0x10')](function(_0x577fb7){logger['info'](util['format'](_0xaefd('0x19'),_0x27be0f['id']));if(_0x577fb7&&_0x577fb7[_0xaefd('0x1a')]&&_0x577fb7[_0xaefd('0x1a')]['transcripts']&&_0x577fb7[_0xaefd('0x1a')]['transcripts'][_0xaefd('0x1b')]){_0x516e84[_0xaefd('0x14')]='';for(var _0x1a05eb=0x0;_0x1a05eb<_0x577fb7['results'][_0xaefd('0x1c')][_0xaefd('0x1b')];_0x1a05eb++){_0x516e84[_0xaefd('0x14')]+=_0x577fb7[_0xaefd('0x1a')][_0xaefd('0x1c')][_0x1a05eb]['transcript']+'';}}return _0x27be0f[_0xaefd('0x1d')](_0x516e84);})['then'](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27be0f['id']));if(!_0x27be0f[_0xaefd('0x1e')]){throw new db[(_0xaefd('0x1f'))]['ValidationError'](_0xaefd('0x20'));}if(!_0x382983[_0xaefd('0x21')]||!_0x382983[_0xaefd('0x22')]||!_0x382983['sentimentRegion']||!_0x382983[_0xaefd('0x23')]||!_0x382983['bucket']){throw new db[(_0xaefd('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x516e84[_0xaefd('0x14')]){throw new Error(_0xaefd('0x24'));}if(_0x382983['sentimentAccountId']===_0x2a310c['id']){return _0x2a310c;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xaefd('0x22')]}});}})[_0xaefd('0x10')](function(_0x4b6910){if(!_0x4b6910){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x4b6910[_0xaefd('0x27')]||!_0x4b6910[_0xaefd('0xe')]){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x28'));}_0x4b2b5c=_0x4b6910;logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x29'),_0x27be0f['id']));return sentiment(_0x4b2b5c[_0xaefd('0x27')],_0x4b2b5c[_0xaefd('0xe')],_0x382983[_0xaefd('0x2a')],_0x516e84[_0xaefd('0x14')],_0x382983[_0xaefd('0x23')]);})[_0xaefd('0x10')](function(_0x195571){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2b'),_0x27be0f['id']));return _0x27be0f[_0xaefd('0x1d')]({'sentiment':_0x195571['Sentiment'],'sPositive':_0x195571[_0xaefd('0x2c')][_0xaefd('0x2d')],'sNegative':_0x195571[_0xaefd('0x2c')]['Negative'],'sMixed':_0x195571[_0xaefd('0x2c')]['Mixed'],'sNeutral':_0x195571[_0xaefd('0x2c')][_0xaefd('0x2e')]});})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2f'),_0x27be0f['id']));_0x3172d3();});case _0xaefd('0x30'):return _0x27be0f[_0xaefd('0x1d')]({'transcribeStatus':_0xaefd('0x30'),'failureReason':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x31')]})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27be0f['id']));_0x3172d3();});default:logger[_0xaefd('0xa')](util['format'](_0xaefd('0x32'),_0x27be0f['id']));break;}}else{return BPromise[_0xaefd('0x33')]()[_0xaefd('0x10')](function(){if(!_0x27be0f[_0xaefd('0x1e')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x20'));}if(!_0x382983[_0xaefd('0x21')]||!_0x382983[_0xaefd('0x22')]||!_0x382983[_0xaefd('0x2a')]||!_0x382983['language']||!_0x382983[_0xaefd('0x34')]){throw new db[(_0xaefd('0x1f'))]['ValidationError'](_0xaefd('0x35'));}if(!_0x27be0f[_0xaefd('0x14')]){throw new Error(_0xaefd('0x24'));}if(_0x382983['sentimentAccountId']===_0x2a310c['id']){return _0x2a310c;}else{return db['CloudProvider'][_0xaefd('0x36')]({'where':{'id':_settings[_0xaefd('0x22')]}});}})[_0xaefd('0x10')](function(_0x179648){if(!_0x179648){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x179648[_0xaefd('0x27')]||!_0x179648['data2']){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x28'));}_0x4b2b5c=_0x179648;logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x29'),_0x27be0f['id']));return sentiment(_0x4b2b5c[_0xaefd('0x27')],_0x4b2b5c[_0xaefd('0xe')],_0x382983['sentimentRegion'],_0x27be0f['fileText'],_0x382983[_0xaefd('0x23')]);})[_0xaefd('0x10')](function(_0x532328){logger['info'](util[_0xaefd('0xb')](_0xaefd('0x2b'),_0x27be0f['id']));return _0x27be0f[_0xaefd('0x1d')]({'sentiment':_0x532328[_0xaefd('0x37')],'sPositive':_0x532328[_0xaefd('0x2c')][_0xaefd('0x2d')],'sNegative':_0x532328[_0xaefd('0x2c')][_0xaefd('0x38')],'sMixed':_0x532328[_0xaefd('0x2c')]['Mixed'],'sNeutral':_0x532328[_0xaefd('0x2c')][_0xaefd('0x2e')],'transcribeStatus':_0xaefd('0x15')});})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2f'),_0x27be0f['id']));_0x3172d3();});}})['catch'](function(_0x20716c){if(_0x20716c){if(!_0x20716c['name']||_0x20716c[_0xaefd('0x39')]!==_0xaefd('0x3a')){logger[_0xaefd('0x3b')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x27be0f['id']),util['inspect'](_0x20716c,{'showHidden':![],'depth':null}));}}_0x3172d3();});});}function checkTranscribe(){var _0x1a73c5;var _0x34839e;var _0x179b8b;return db['VoiceRecording'][_0xaefd('0x3c')]({'where':{'transcribeStatus':_0xaefd('0x3d')}})['then'](function(_0x3deacd){if(!_0x3deacd||!_0x3deacd[_0xaefd('0x1b')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x3e'));}_0x1a73c5=_0x3deacd;return db[_0xaefd('0x3f')][_0xaefd('0x36')]({'where':{'id':0x1}});})[_0xaefd('0x10')](function(_0x4dc674){if(!_0x4dc674){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x40'));}_0x34839e=_0x4dc674;if(!_0x34839e['transcribe']||!_0x34839e[_0xaefd('0x41')]||!_0x34839e['transcribeRegion']||!_0x34839e[_0xaefd('0x23')]||!_0x34839e[_0xaefd('0x34')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x42'));}return db[_0xaefd('0x43')]['findOne']({'where':{'id':_0x34839e['transcribeAccountId']}});})[_0xaefd('0x10')](function(_0x338823){if(!_0x338823){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x338823[_0xaefd('0x27')]||!_0x338823[_0xaefd('0xe')]){throw new db['Sequelize']['ValidationError'](_0xaefd('0x28'));}_0x179b8b=_0x338823;var _0x41ef40=[];_0x1a73c5[_0xaefd('0x44')](function(_0x1fe44a){_0x41ef40[_0xaefd('0x45')](checkTranscribeJob(_0x1fe44a,_0x34839e,_0x179b8b));});return BPromise['all'](_0x41ef40);})[_0xaefd('0x46')](function(_0x3b6290){if(_0x3b6290){if(!_0x3b6290['name']||_0x3b6290[_0xaefd('0x39')]!==_0xaefd('0x3a')){logger['error'](util[_0xaefd('0x47')](_0x3b6290,{'showHidden':![],'depth':null}));}}});}exports[_0xaefd('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xf089=['update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0xf089,0xba));var _0x9f08=function(_0x98312c,_0x57bf24){_0x98312c=_0x98312c-0x0;var _0x2bc5ef=_0xf089[_0x98312c];return _0x2bc5ef;};var _=require('lodash');var AWS=require(_0x9f08('0x0'));var rp=require(_0x9f08('0x1'));var util=require('util');var BPromise=require(_0x9f08('0x2'));var db=require(_0x9f08('0x3'))['db'];var logger=require(_0x9f08('0x4'))(_0x9f08('0x5'));function getTranscriptionJob(_0x48bf89,_0x11d64c,_0x1dced2,_0x352879){return new Promise(function(_0x13768c,_0x38c9ea){var _0x39abe2=new AWS['TranscribeService']({'accessKeyId':_0x11d64c,'secretAccessKey':_0x48bf89,'region':_0x1dced2});_0x39abe2[_0x9f08('0x6')]({'TranscriptionJobName':_0x352879},function(_0x4b37fc,_0x39e238){if(_0x4b37fc){return _0x38c9ea(_0x4b37fc);}else{return _0x13768c(_0x39e238);}});});}function sentiment(_0x4ce5b6,_0x4358e7,_0x286809,_0x3868b6,_0x4dc012){return new Promise(function(_0x2ae155,_0x3e5d2b){var _0x447a85=new AWS['Comprehend']({'accessKeyId':_0x4358e7,'secretAccessKey':_0x4ce5b6,'region':_0x286809});_0x447a85['detectSentiment']({'Text':_0x3868b6,'LanguageCode':_0x4dc012[_0x9f08('0x7')](0x0,0x2)},function(_0x1e6f42,_0x52ab70){if(_0x1e6f42){return _0x3e5d2b(_0x1e6f42);}else{return _0x2ae155(_0x52ab70);}});});}function checkTranscribeJob(_0x2b7e6f,_0x2b32c7,_0x251b84){var _0x597ae8;return new BPromise(function(_0x582be0,_0x9cd154){logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0xa'),_0x2b7e6f['id'],_0x2b7e6f['transcribeName']));return getTranscriptionJob(_0x251b84[_0x9f08('0xb')],_0x251b84[_0x9f08('0xc')],_0x2b32c7[_0x9f08('0xd')],_0x2b7e6f[_0x9f08('0xe')])[_0x9f08('0xf')](function(_0x4cec58){logger[_0x9f08('0x8')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x2b7e6f['id'],_0x2b7e6f[_0x9f08('0xe')],_0x4cec58[_0x9f08('0x10')][_0x9f08('0x11')]));if(!_0x2b7e6f[_0x9f08('0x12')]){switch(_0x4cec58[_0x9f08('0x10')][_0x9f08('0x11')]){case _0x9f08('0x13'):var _0x20163c={'transcribeStatus':_0x4cec58[_0x9f08('0x10')][_0x9f08('0x11')],'fileUri':_0x4cec58[_0x9f08('0x10')][_0x9f08('0x14')][_0x9f08('0x15')]};logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x16'),_0x2b7e6f['id']));return rp({'uri':_0x4cec58['TranscriptionJob'][_0x9f08('0x14')][_0x9f08('0x15')],'json':!![]})[_0x9f08('0xf')](function(_0x3d4574){logger[_0x9f08('0x8')](util[_0x9f08('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x2b7e6f['id']));if(_0x3d4574&&_0x3d4574[_0x9f08('0x17')]&&_0x3d4574[_0x9f08('0x17')][_0x9f08('0x18')]&&_0x3d4574[_0x9f08('0x17')][_0x9f08('0x18')][_0x9f08('0x19')]){_0x20163c[_0x9f08('0x12')]='';for(var _0x4a2f0b=0x0;_0x4a2f0b<_0x3d4574['results'][_0x9f08('0x18')][_0x9f08('0x19')];_0x4a2f0b++){_0x20163c[_0x9f08('0x12')]+=_0x3d4574[_0x9f08('0x17')][_0x9f08('0x18')][_0x4a2f0b][_0x9f08('0x1a')]+'';}}return _0x2b7e6f[_0x9f08('0x1b')](_0x20163c);})[_0x9f08('0xf')](function(){logger['info'](util[_0x9f08('0x9')](_0x9f08('0x1c'),_0x2b7e6f['id']));if(!_0x2b7e6f[_0x9f08('0x1d')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x20'));}if(!_0x2b32c7[_0x9f08('0x21')]||!_0x2b32c7[_0x9f08('0x22')]||!_0x2b32c7['sentimentRegion']||!_0x2b32c7[_0x9f08('0x23')]||!_0x2b32c7['bucket']){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x24'));}if(!_0x20163c[_0x9f08('0x12')]){throw new Error(_0x9f08('0x25'));}if(_0x2b32c7['sentimentAccountId']===_0x251b84['id']){return _0x251b84;}else{return db[_0x9f08('0x26')][_0x9f08('0x27')]({'where':{'id':_settings[_0x9f08('0x22')]}});}})[_0x9f08('0xf')](function(_0x55417){if(!_0x55417){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x28'));}if(!_0x55417[_0x9f08('0xb')]||!_0x55417['data2']){throw new db[(_0x9f08('0x1e'))]['ValidationError'](_0x9f08('0x29'));}_0x597ae8=_0x55417;logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x2a'),_0x2b7e6f['id']));return sentiment(_0x597ae8[_0x9f08('0xb')],_0x597ae8[_0x9f08('0xc')],_0x2b32c7['sentimentRegion'],_0x20163c[_0x9f08('0x12')],_0x2b32c7[_0x9f08('0x23')]);})[_0x9f08('0xf')](function(_0x46cb57){logger[_0x9f08('0x8')](util[_0x9f08('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2b7e6f['id']));return _0x2b7e6f[_0x9f08('0x1b')]({'sentiment':_0x46cb57['Sentiment'],'sPositive':_0x46cb57[_0x9f08('0x2b')][_0x9f08('0x2c')],'sNegative':_0x46cb57[_0x9f08('0x2b')][_0x9f08('0x2d')],'sMixed':_0x46cb57[_0x9f08('0x2b')]['Mixed'],'sNeutral':_0x46cb57[_0x9f08('0x2b')][_0x9f08('0x2e')]});})[_0x9f08('0xf')](function(){logger['info'](util[_0x9f08('0x9')](_0x9f08('0x1c'),_0x2b7e6f['id']));_0x582be0();});case _0x9f08('0x2f'):return _0x2b7e6f[_0x9f08('0x1b')]({'transcribeStatus':_0x9f08('0x2f'),'failureReason':_0x4cec58['TranscriptionJob'][_0x9f08('0x30')]})[_0x9f08('0xf')](function(){logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x1c'),_0x2b7e6f['id']));_0x582be0();});default:logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x31'),_0x2b7e6f['id']));break;}}else{return BPromise[_0x9f08('0x32')]()[_0x9f08('0xf')](function(){if(!_0x2b7e6f[_0x9f08('0x1d')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2b32c7[_0x9f08('0x21')]||!_0x2b32c7[_0x9f08('0x22')]||!_0x2b32c7['sentimentRegion']||!_0x2b32c7[_0x9f08('0x23')]||!_0x2b32c7[_0x9f08('0x33')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2b7e6f[_0x9f08('0x12')]){throw new Error(_0x9f08('0x25'));}if(_0x2b32c7[_0x9f08('0x22')]===_0x251b84['id']){return _0x251b84;}else{return db[_0x9f08('0x26')][_0x9f08('0x27')]({'where':{'id':_settings[_0x9f08('0x22')]}});}})['then'](function(_0x23c43f){if(!_0x23c43f){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x23c43f[_0x9f08('0xb')]||!_0x23c43f['data2']){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x29'));}_0x597ae8=_0x23c43f;logger['info'](util[_0x9f08('0x9')](_0x9f08('0x2a'),_0x2b7e6f['id']));return sentiment(_0x597ae8[_0x9f08('0xb')],_0x597ae8[_0x9f08('0xc')],_0x2b32c7[_0x9f08('0x34')],_0x2b7e6f[_0x9f08('0x12')],_0x2b32c7['language']);})[_0x9f08('0xf')](function(_0x5ef1fa){logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x35'),_0x2b7e6f['id']));return _0x2b7e6f[_0x9f08('0x1b')]({'sentiment':_0x5ef1fa[_0x9f08('0x36')],'sPositive':_0x5ef1fa[_0x9f08('0x2b')][_0x9f08('0x2c')],'sNegative':_0x5ef1fa['SentimentScore']['Negative'],'sMixed':_0x5ef1fa['SentimentScore']['Mixed'],'sNeutral':_0x5ef1fa['SentimentScore'][_0x9f08('0x2e')],'transcribeStatus':_0x9f08('0x13')});})['then'](function(){logger[_0x9f08('0x8')](util['format'](_0x9f08('0x1c'),_0x2b7e6f['id']));_0x582be0();});}})[_0x9f08('0x37')](function(_0x16756b){if(_0x16756b){if(!_0x16756b[_0x9f08('0x38')]||_0x16756b['name']!==_0x9f08('0x39')){logger[_0x9f08('0x3a')](util[_0x9f08('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2b7e6f['id']),util[_0x9f08('0x3b')](_0x16756b,{'showHidden':![],'depth':null}));}}_0x582be0();});});}function checkTranscribe(){var _0x585c14;var _0x55d98d;var _0x4b7c5f;return db[_0x9f08('0x3c')][_0x9f08('0x3d')]({'where':{'transcribeStatus':_0x9f08('0x3e')}})[_0x9f08('0xf')](function(_0x14a6b6){if(!_0x14a6b6||!_0x14a6b6['length']){throw new db['Sequelize'][(_0x9f08('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x585c14=_0x14a6b6;return db[_0x9f08('0x3f')][_0x9f08('0x27')]({'where':{'id':0x1}});})['then'](function(_0x3fb332){if(!_0x3fb332){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x40'));}_0x55d98d=_0x3fb332;if(!_0x55d98d['transcribe']||!_0x55d98d[_0x9f08('0x41')]||!_0x55d98d[_0x9f08('0xd')]||!_0x55d98d['language']||!_0x55d98d['bucket']){throw new db[(_0x9f08('0x1e'))]['ValidationError'](_0x9f08('0x42'));}return db[_0x9f08('0x26')][_0x9f08('0x27')]({'where':{'id':_0x55d98d['transcribeAccountId']}});})[_0x9f08('0xf')](function(_0x22e513){if(!_0x22e513){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x28'));}if(!_0x22e513[_0x9f08('0xb')]||!_0x22e513[_0x9f08('0xc')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x29'));}_0x4b7c5f=_0x22e513;var _0x2c9231=[];_0x585c14[_0x9f08('0x43')](function(_0x21ddd9){_0x2c9231[_0x9f08('0x44')](checkTranscribeJob(_0x21ddd9,_0x55d98d,_0x4b7c5f));});return BPromise[_0x9f08('0x45')](_0x2c9231);})[_0x9f08('0x37')](function(_0x5ebc5e){if(_0x5ebc5e){if(!_0x5ebc5e[_0x9f08('0x38')]||_0x5ebc5e[_0x9f08('0x38')]!=='SequelizeValidationError'){logger[_0x9f08('0x3a')](util[_0x9f08('0x3b')](_0x5ebc5e,{'showHidden':![],'depth':null}));}}});}exports[_0x9f08('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 2c79efb..1ecfa01 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 _0x1332=['redis','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','system','YYYY-MM-DD\x20HH:mm:ss','join','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger'];(function(_0x511325,_0x15788f){var _0x377ebd=function(_0x401f85){while(--_0x401f85){_0x511325['push'](_0x511325['shift']());}};_0x377ebd(++_0x15788f);}(_0x1332,0x1d4));var _0x2133=function(_0x5830ac,_0x341907){_0x5830ac=_0x5830ac-0x0;var _0x37557e=_0x1332[_0x5830ac];return _0x37557e;};'use strict';var _=require(_0x2133('0x0'));var moment=require(_0x2133('0x1'));var Redis=require(_0x2133('0x2'));var util=require(_0x2133('0x3'));var config=require(_0x2133('0x4'));var db=require(_0x2133('0x5'))['db'];var logger=require(_0x2133('0x6'))('schedule');config[_0x2133('0x7')]=_['defaults'](config['redis'],{'host':_0x2133('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2133('0x7')]));function closeInteractions(){var _0x42c2cc=[];return db[_0x2133('0x9')][_0x2133('0xa')]({'raw':!![],'attributes':['id',_0x2133('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2133('0xc')](0x18,'hours')}}})[_0x2133('0xd')](function(_0x1b93a1){if(_0x1b93a1&&_0x1b93a1[_0x2133('0xe')]){_0x42c2cc=_[_0x2133('0xf')](_0x1b93a1||[],'id');logger['info'](_0x2133('0x10'),_0x42c2cc['join']());return db['WhatsappInteraction']['update']({'closeReason':_0x2133('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x2133('0x12'))},{'where':{'id':_0x42c2cc}});}})['then'](function(){if(_0x42c2cc&&_0x42c2cc[_0x2133('0xe')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x42c2cc[_0x2133('0x13')]());for(var _0x24057c=0x0;_0x24057c<_0x42c2cc[_0x2133('0xe')];_0x24057c++){io['emit'](_0x2133('0x14'),{'id':_0x42c2cc[_0x24057c],'closed':!![]});}}})['catch'](function(_0x29ef80){logger[_0x2133('0x15')](_0x2133('0x16'),_0x29ef80?util[_0x2133('0x17')](_0x29ef80,{'showHidden':![],'depth':null}):'');});}exports[_0x2133('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe40b=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe40b,0x189));var _0xbe40=function(_0x560c7d,_0x3bbeb8){_0x560c7d=_0x560c7d-0x0;var _0x27503f=_0xe40b[_0x560c7d];return _0x27503f;};'use strict';var _=require('lodash');var moment=require(_0xbe40('0x0'));var Redis=require(_0xbe40('0x1'));var util=require(_0xbe40('0x2'));var config=require(_0xbe40('0x3'));var db=require(_0xbe40('0x4'))['db'];var logger=require(_0xbe40('0x5'))('schedule');config[_0xbe40('0x6')]=_[_0xbe40('0x7')](config[_0xbe40('0x6')],{'host':_0xbe40('0x8'),'port':0x18eb});var io=require(_0xbe40('0x9'))(new Redis(config[_0xbe40('0x6')]));function closeInteractions(){var _0x1622ab=[];return db[_0xbe40('0xa')][_0xbe40('0xb')]({'raw':!![],'attributes':['id',_0xbe40('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xbe40('0xd')](0x18,_0xbe40('0xe'))}}})[_0xbe40('0xf')](function(_0x2c48c2){if(_0x2c48c2&&_0x2c48c2[_0xbe40('0x10')]){_0x1622ab=_[_0xbe40('0x11')](_0x2c48c2||[],'id');logger[_0xbe40('0x12')](_0xbe40('0x13'),_0x1622ab[_0xbe40('0x14')]());return db[_0xbe40('0xa')][_0xbe40('0x15')]({'closeReason':_0xbe40('0x16'),'disposition':_0xbe40('0x17'),'closed':!![],'closedAt':moment()[_0xbe40('0x18')](_0xbe40('0x19'))},{'where':{'id':_0x1622ab}});}})[_0xbe40('0xf')](function(){if(_0x1622ab&&_0x1622ab[_0xbe40('0x10')]){logger[_0xbe40('0x12')](_0xbe40('0x1a'),_0x1622ab[_0xbe40('0x14')]());for(var _0x3637d7=0x0;_0x3637d7<_0x1622ab[_0xbe40('0x10')];_0x3637d7++){io[_0xbe40('0x1b')]('whatsappInteraction:update',{'id':_0x1622ab[_0x3637d7],'closed':!![]});}}})[_0xbe40('0x1c')](function(_0x4ec935){logger[_0xbe40('0x1d')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4ec935?util[_0xbe40('0x1e')](_0x4ec935,{'showHidden':![],'depth':null}):'');});}exports[_0xbe40('0x1f')]=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 e31b3d5..e612a83 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9ba=['push','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','log','contacts1','CmHopper','bulkCreate','finished\x20populating','CmContact','contacts2','util','../mysqldb'];(function(_0x3cfe4e,_0x3e2fed){var _0x22e983=function(_0x75f797){while(--_0x75f797){_0x3cfe4e['push'](_0x3cfe4e['shift']());}};_0x22e983(++_0x3e2fed);}(_0xf9ba,0x1ce));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xaf9b('0x0'));var db=require(_0xaf9b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xaf9b('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xaf9b('0x3')+i,'phone':0xf879fb460+i,'email':_0xaf9b('0x4')+i+_0xaf9b('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xaf9b('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf9b('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xaf9b('0x3')+i,'phone':0xf879fb460+i,'email':_0xaf9b('0x4')+i+_0xaf9b('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xaf9b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xaf9b('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf9b('0x6')](),'updatedAt':Date[_0xaf9b('0x6')]()});}db['CmContact'][_0xaf9b('0x7')]({'where':{}})[_0xaf9b('0x8')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0xaf9b('0x8')](function(){console[_0xaf9b('0x9')]('finished\x20populating',_0xaf9b('0xa'));return db[_0xaf9b('0xb')][_0xaf9b('0x7')]({'where':{}});})[_0xaf9b('0x8')](function(){return db['CmHopper'][_0xaf9b('0xc')](hopper);})[_0xaf9b('0x8')](function(){console['log'](_0xaf9b('0xd'),'hopper1');return db[_0xaf9b('0xe')][_0xaf9b('0xc')](contacts2);})[_0xaf9b('0x8')](function(){console[_0xaf9b('0x9')](_0xaf9b('0xd'),_0xaf9b('0xf'));return db[_0xaf9b('0xb')][_0xaf9b('0xc')](hopper2);})[_0xaf9b('0x8')](function(){console['log'](_0xaf9b('0xd'),'hopper2');})['catch'](function(_0xdb8bda){console[_0xaf9b('0x9')](_0xdb8bda);}); \ No newline at end of file +var _0xe09f=['util','push','Innocenzo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','bulkCreate','then','finished\x20populating','contacts1','CmHopper','log','hopper1','contacts2','hopper2'];(function(_0x33cf98,_0x58616e){var _0x425b08=function(_0x1bc032){while(--_0x1bc032){_0x33cf98['push'](_0x33cf98['shift']());}};_0x425b08(++_0x58616e);}(_0xe09f,0x66));var _0xfe09=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe09f[_0x4cf98e];return _0x1623ac;};'use strict';var util=require(_0xfe09('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xfe09('0x1')]({'id':i,'firstName':_0xfe09('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xfe09('0x3')+i+_0xfe09('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xfe09('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xfe09('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xfe09('0x1')]({'id':i,'firstName':_0xfe09('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xfe09('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xfe09('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xfe09('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xfe09('0x6')][_0xfe09('0x7')]({'where':{}})['then'](function(){return db[_0xfe09('0x6')][_0xfe09('0x8')](contacts);})[_0xfe09('0x9')](function(){console['log'](_0xfe09('0xa'),_0xfe09('0xb'));return db[_0xfe09('0xc')][_0xfe09('0x7')]({'where':{}});})['then'](function(){return db[_0xfe09('0xc')][_0xfe09('0x8')](hopper);})['then'](function(){console[_0xfe09('0xd')](_0xfe09('0xa'),_0xfe09('0xe'));return db[_0xfe09('0x6')]['bulkCreate'](contacts2);})[_0xfe09('0x9')](function(){console['log'](_0xfe09('0xa'),_0xfe09('0xf'));return db[_0xfe09('0xc')][_0xfe09('0x8')](hopper2);})['then'](function(){console[_0xfe09('0xd')](_0xfe09('0xa'),_0xfe09('0x10'));})['catch'](function(_0x195eda){console[_0xfe09('0xd')](_0x195eda);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index cc6332d..3f33809 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x186f=['friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','add\x20user','log','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com'];(function(_0x583cd5,_0xfbb91){var _0x3535de=function(_0x43f7f5){while(--_0x43f7f5){_0x583cd5['push'](_0x583cd5['shift']());}};_0x3535de(++_0xfbb91);}(_0x186f,0x188));var _0xf186=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x186f[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xf186('0x0'));var db=require(_0xf186('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf186('0x2')]({'name':util[_0xf186('0x3')]('%s%s',_0xf186('0x4'),i),'fullname':util[_0xf186('0x3')](_0xf186('0x5'),_0xf186('0x4'),i),'email':util[_0xf186('0x3')](_0xf186('0x6'),_0xf186('0x4'),i),'role':_0xf186('0x4'),'password':'password','internal':0xfa0+i,'type':_0xf186('0x7'),'transport':[_0xf186('0x8'),'ws','wss'],'disallow':[_0xf186('0x9')],'allow':['ulaw'],'defaultuser':util[_0xf186('0x3')](_0xf186('0x5'),_0xf186('0x4'),i),'encryption':_0xf186('0xa'),'avpf':'yes','force_avp':_0xf186('0xa'),'icesupport':'yes','dtlsenable':_0xf186('0xa'),'dtlsverify':'no','dtlscertfile':_0xf186('0xb'),'dtlsprivatekey':_0xf186('0xc'),'dtlssetup':_0xf186('0xd'),'callerid':util[_0xf186('0x3')](_0xf186('0xe'),util[_0xf186('0x3')](_0xf186('0x5'),_0xf186('0x4'),i),0xfa0+i)});}db['User'][_0xf186('0xf')](users)[_0xf186('0x10')](function(){console['log'](_0xf186('0x11'));})['catch'](function(_0x439298){console[_0xf186('0x12')](_0x439298);}); \ No newline at end of file +var _0xe76c=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','log','add\x20user','catch','util','../mysqldb','%s%s','format','%s%s@xcally.com','agent','password','friend','udp','wss','all','ulaw'];(function(_0x48f827,_0x269e8d){var _0xc763f7=function(_0x19769a){while(--_0x19769a){_0x48f827['push'](_0x48f827['shift']());}};_0xc763f7(++_0x269e8d);}(_0xe76c,0x183));var _0xce76=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xe76c[_0x164eca];return _0x2ce562;};'use strict';var util=require(_0xce76('0x0'));var db=require(_0xce76('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xce76('0x2'),'agent',i),'fullname':util[_0xce76('0x3')](_0xce76('0x2'),'agent',i),'email':util['format'](_0xce76('0x4'),_0xce76('0x5'),i),'role':_0xce76('0x5'),'password':_0xce76('0x6'),'internal':0xfa0+i,'type':_0xce76('0x7'),'transport':[_0xce76('0x8'),'ws',_0xce76('0x9')],'disallow':[_0xce76('0xa')],'allow':[_0xce76('0xb')],'defaultuser':util[_0xce76('0x3')](_0xce76('0x2'),_0xce76('0x5'),i),'encryption':_0xce76('0xc'),'avpf':'yes','force_avp':_0xce76('0xc'),'icesupport':_0xce76('0xc'),'dtlsenable':_0xce76('0xc'),'dtlsverify':'no','dtlscertfile':_0xce76('0xd'),'dtlsprivatekey':_0xce76('0xe'),'dtlssetup':_0xce76('0xf'),'callerid':util[_0xce76('0x3')](_0xce76('0x10'),util[_0xce76('0x3')](_0xce76('0x2'),_0xce76('0x5'),i),0xfa0+i)});}db[_0xce76('0x11')]['bulkCreate'](users)['then'](function(){console[_0xce76('0x12')](_0xce76('0x13'));})[_0xce76('0x14')](function(_0x3f29d5){console[_0xce76('0x12')](_0x3f29d5);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index edc0439..0230f50 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x26c2=['util','bluebird','../mysqldb','./environment','Agents','name','role','agent','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','resourceId','map','User','where','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','user','ChatQueues','WhatsappQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','openchannel','whatsapp','telephone:%s','trunk:%s','leave','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED'];(function(_0x3c2666,_0x15fd23){var _0x10c814=function(_0x4660c0){while(--_0x4660c0){_0x3c2666['push'](_0x3c2666['shift']());}};_0x10c814(++_0x15fd23);}(_0x26c2,0x1d6));var _0x226c=function(_0x2fa4d1,_0x1ea9bc){_0x2fa4d1=_0x2fa4d1-0x0;var _0x33d74a=_0x26c2[_0x2fa4d1];return _0x33d74a;};'use strict';var _=require('lodash');var util=require(_0x226c('0x0'));var BPromise=require(_0x226c('0x1'));var db=require(_0x226c('0x2'))['db'];var config=require(_0x226c('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x226c('0x4'),'model':db['User'],'attributes':['id',_0x226c('0x5'),_0x226c('0x6')],'raw':!![],'where':{'role':_0x226c('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x226c('0x5')],'where':{'role':_0x226c('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x226c('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x226c('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x226c('0x9')}};function getAssociatedResources(_0x1677ee,_0x5a8a66,_0x475e09){return db[_0x226c('0xa')][_0x226c('0xb')]({'where':{'name':_0x1677ee,'userProfileId':_0x5a8a66},'raw':!![]})[_0x226c('0xc')](function(_0x1ae421){if(_0x1ae421){if(_0x1ae421[_0x226c('0xd')]){switch(_0x1677ee){case _0x226c('0xe'):case'ChatQueues':case'FaxQueues':case _0x226c('0xf'):case _0x226c('0x10'):case _0x226c('0x11'):case _0x226c('0x12'):return db[_0x475e09]['findAll'](queryQueues);case'Telephones':return db[_0x475e09][_0x226c('0x13')](queryTelephones);case _0x226c('0x14'):return db[_0x475e09][_0x226c('0x13')](queryTrunks);case _0x226c('0x15'):return db[_0x475e09][_0x226c('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x226c('0x13')]({'attributes':[_0x226c('0x16')],'where':{'sectionId':_0x1ae421['id']},'raw':!![]})[_0x226c('0xc')](function(_0x4b542b){if(_0x4b542b){var _0x19d62d={'where':{'id':_[_0x226c('0x17')](_0x4b542b,_0x226c('0x16'))},'raw':!![]};switch(_0x475e09){case _0x226c('0x18'):_0x19d62d[_0x226c('0x19')][_0x226c('0x6')]=_0x226c('0x8');break;case _0x226c('0x1a'):_0x19d62d[_0x226c('0x19')][_0x226c('0x1b')]=_0x226c('0x9');break;}return db[_0x475e09][_0x226c('0x13')](_0x19d62d);}else{return[];}});}}else{return[];}})[_0x226c('0xc')](function(_0x53c323){return _0x53c323;});}function joinOrLeaveQueues(_0x34242a,_0x1d3ee8,_0x1abe31,_0x49f43d){_0x34242a[_0x1d3ee8](util[_0x226c('0x1c')](_0x226c('0x1d'),_0x1abe31,_0x49f43d['name']));if(_0x49f43d[_0x226c('0x4')]){for(var _0x29c441=0x0;_0x29c441<_0x49f43d[_0x226c('0x4')][_0x226c('0x1e')];_0x29c441+=0x1){_0x34242a[_0x1d3ee8](util[_0x226c('0x1c')](_0x226c('0x1f'),_0x49f43d['Agents'][_0x29c441][_0x226c('0x5')]));}}}function joinOrLeave(_0x3df28f,_0x17ab5f,_0x3f2643){var _0x392717;if(_0x3df28f[_0x226c('0x20')]['query']['id']){db[_0x226c('0x18')][_0x226c('0x21')]({'attributes':['id',_0x226c('0x5'),'role',_0x226c('0x22')],'where':{'id':_0x3df28f['handshake'][_0x226c('0x23')]['id']},'include':[{'model':db[_0x226c('0x24')],'as':_0x226c('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x226c('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x226c('0x27')],'as':_0x226c('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x226c('0x29'),'attributes':['id'],'raw':!![]}]})[_0x226c('0xc')](function(_0x1bec1a){if(_0x1bec1a){_0x392717=_0x1bec1a;_0x3df28f[_0x17ab5f](util[_0x226c('0x1c')](_0x226c('0x1f'),_0x1bec1a['name']));var _0x2c861c=[];switch(_0x1bec1a[_0x226c('0x6')]){case'admin':_0x3df28f[_0x17ab5f](_0x226c('0x2a'));_0x3df28f[_0x17ab5f](_0x226c('0x2b'));if(queryQueues[_0x226c('0x2c')]('include')){delete queryQueues[_0x226c('0x2d')];}_0x2c861c[_0x226c('0x2e')](db[_0x226c('0x2f')][_0x226c('0x13')](queryQueues));_0x2c861c[_0x226c('0x2e')](db[_0x226c('0x30')][_0x226c('0x13')](queryQueues));_0x2c861c['push'](db[_0x226c('0x31')][_0x226c('0x13')](queryQueues));_0x2c861c[_0x226c('0x2e')](db['SmsQueue'][_0x226c('0x13')](queryQueues));_0x2c861c[_0x226c('0x2e')](db[_0x226c('0x32')][_0x226c('0x13')](queryQueues));_0x2c861c[_0x226c('0x2e')](db[_0x226c('0x33')][_0x226c('0x13')](queryQueues));_0x2c861c[_0x226c('0x2e')](db['WhatsappQueue'][_0x226c('0x13')](queryQueues));_0x2c861c[_0x226c('0x2e')](db[_0x226c('0x18')][_0x226c('0x13')](queryTelephones));_0x2c861c[_0x226c('0x2e')](db['Trunk']['findAll'](queryTrunks));_0x2c861c[_0x226c('0x2e')](db[_0x226c('0x1a')][_0x226c('0x13')](queryCampaigns));_0x2c861c['push'](db['User'][_0x226c('0x13')](queryAgents));break;case _0x226c('0x34'):_0x3df28f[_0x17ab5f](_0x226c('0x2a'));_0x3df28f[_0x17ab5f]('voice:outbound');_0x2c861c[_0x226c('0x2e')](getAssociatedResources('VoiceQueues',_0x1bec1a[_0x226c('0x22')],'VoiceQueue'));_0x2c861c[_0x226c('0x2e')](getAssociatedResources(_0x226c('0x35'),_0x1bec1a[_0x226c('0x22')],'ChatQueue'));_0x2c861c[_0x226c('0x2e')](getAssociatedResources('FaxQueues',_0x1bec1a[_0x226c('0x22')],_0x226c('0x31')));_0x2c861c[_0x226c('0x2e')](getAssociatedResources('SmsQueues',_0x1bec1a[_0x226c('0x22')],'SmsQueue'));_0x2c861c[_0x226c('0x2e')](getAssociatedResources(_0x226c('0x10'),_0x1bec1a[_0x226c('0x22')],_0x226c('0x32')));_0x2c861c[_0x226c('0x2e')](getAssociatedResources('OpenchannelQueues',_0x1bec1a[_0x226c('0x22')],'OpenchannelQueue'));_0x2c861c[_0x226c('0x2e')](getAssociatedResources(_0x226c('0x12'),_0x1bec1a[_0x226c('0x22')],_0x226c('0x36')));_0x2c861c['push'](getAssociatedResources('Telephones',_0x1bec1a['userProfileId'],_0x226c('0x18')));_0x2c861c['push'](getAssociatedResources('Trunks',_0x1bec1a[_0x226c('0x22')],_0x226c('0x37')));_0x2c861c[_0x226c('0x2e')](getAssociatedResources(_0x226c('0x15'),_0x1bec1a[_0x226c('0x22')],_0x226c('0x1a')));_0x2c861c[_0x226c('0x2e')](db['User'][_0x226c('0x13')](queryAgents));break;case _0x226c('0x7'):_0x3df28f[_0x17ab5f](_0x226c('0x2a'));_0x3df28f[_0x17ab5f]('voice:outbound');_0x2c861c[_0x226c('0x2e')](_0x1bec1a[_0x226c('0x38')]({'attributes':['id',_0x226c('0x5')]}));_0x2c861c[_0x226c('0x2e')](_0x1bec1a[_0x226c('0x39')]({'attributes':['id',_0x226c('0x5')]}));_0x2c861c['push'](_0x1bec1a[_0x226c('0x3a')]({'attributes':['id',_0x226c('0x5')]}));_0x2c861c[_0x226c('0x2e')](_0x1bec1a[_0x226c('0x3b')]({'attributes':['id',_0x226c('0x5')]}));_0x2c861c[_0x226c('0x2e')](_0x1bec1a[_0x226c('0x3c')]({'attributes':['id','name']}));_0x2c861c['push'](_0x1bec1a[_0x226c('0x3d')]({'attributes':['id',_0x226c('0x5')]}));_0x2c861c[_0x226c('0x2e')](_0x1bec1a['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x226c('0x3e')](_0x2c861c);}})[_0x226c('0xc')](function(_0x452ce8){if(_0x452ce8&&_0x452ce8[_0x226c('0x1e')]){for(var _0x343637=0x0;_0x343637<_0x452ce8[_0x226c('0x1e')];_0x343637+=0x1){for(var _0x25736e=0x0;_0x25736e<_0x452ce8[_0x343637][_0x226c('0x1e')];_0x25736e+=0x1){switch(_0x343637){case 0x0:joinOrLeaveQueues(_0x3df28f,_0x17ab5f,_0x226c('0x3f'),_0x452ce8[_0x343637][_0x25736e]);break;case 0x1:joinOrLeaveQueues(_0x3df28f,_0x17ab5f,_0x226c('0x40'),_0x452ce8[_0x343637][_0x25736e]);break;case 0x2:joinOrLeaveQueues(_0x3df28f,_0x17ab5f,_0x226c('0x41'),_0x452ce8[_0x343637][_0x25736e]);break;case 0x3:joinOrLeaveQueues(_0x3df28f,_0x17ab5f,'sms',_0x452ce8[_0x343637][_0x25736e]);break;case 0x4:joinOrLeaveQueues(_0x3df28f,_0x17ab5f,'mail',_0x452ce8[_0x343637][_0x25736e]);break;case 0x5:joinOrLeaveQueues(_0x3df28f,_0x17ab5f,_0x226c('0x42'),_0x452ce8[_0x343637][_0x25736e]);break;case 0x6:joinOrLeaveQueues(_0x3df28f,_0x17ab5f,_0x226c('0x43'),_0x452ce8[_0x343637][_0x25736e]);break;case 0x7:if(_0x392717[_0x226c('0x6')]!==_0x226c('0x7'))_0x3df28f[_0x17ab5f](util[_0x226c('0x1c')](_0x226c('0x44'),_0x452ce8[_0x343637][_0x25736e][_0x226c('0x5')]));break;case 0x8:if(_0x392717[_0x226c('0x6')]!==_0x226c('0x7'))_0x3df28f[_0x17ab5f](util[_0x226c('0x1c')](_0x226c('0x45'),_0x452ce8[_0x343637][_0x25736e][_0x226c('0x5')]));break;case 0x9:if(_0x392717[_0x226c('0x6')]!==_0x226c('0x7'))_0x3df28f[_0x17ab5f](util[_0x226c('0x1c')]('campaign:%s:%s',_0x452ce8[_0x343637][_0x25736e]['type'],_0x452ce8[_0x343637][_0x25736e][_0x226c('0x5')]));break;case 0xa:_0x3df28f[_0x17ab5f](util[_0x226c('0x1c')]('user:%s',_0x452ce8[_0x343637][_0x25736e][_0x226c('0x5')]));break;}}}}})[_0x226c('0xc')](function(){if(_0x17ab5f===_0x226c('0x46')){var _0x5ac059=_['map'](_0x392717[_0x226c('0x25')],'id');return _0x392717['removeChatInteractions'](_0x5ac059)[_0x226c('0xc')](function(){for(var _0x3adfba=0x0;_0x3adfba<_0x5ac059['length'];_0x3adfba+=0x1){_0x3f2643[_0x226c('0x47')](_0x226c('0x48'),{'ChatInteractionId':Number(_0x5ac059[_0x3adfba]),'UserId':Number(_0x392717['id'])});}});}})['then'](function(){if(_0x17ab5f===_0x226c('0x46')){var _0x416f8f=_[_0x226c('0x17')](_0x392717['MailInteractions'],'id');return _0x392717['removeMailInteractions'](_0x416f8f)[_0x226c('0xc')](function(){for(var _0x3feeff=0x0;_0x3feeff<_0x416f8f['length'];_0x3feeff+=0x1){_0x3f2643['emit'](_0x226c('0x49'),{'MailInteractionId':Number(_0x416f8f[_0x3feeff]),'UserId':Number(_0x392717['id'])});}});}})[_0x226c('0xc')](function(){if(_0x17ab5f==='leave'){var _0x1f8603=_[_0x226c('0x17')](_0x392717['FaxInteractions'],'id');return _0x392717[_0x226c('0x4a')](_0x1f8603)[_0x226c('0xc')](function(){for(var _0x4d93e3=0x0;_0x4d93e3<_0x1f8603[_0x226c('0x1e')];_0x4d93e3+=0x1){_0x3f2643[_0x226c('0x47')](_0x226c('0x4b'),{'FaxInteractionId':Number(_0x1f8603[_0x4d93e3]),'UserId':Number(_0x392717['id'])});}});}})[_0x226c('0xc')](function(){if(_0x17ab5f===_0x226c('0x46')){var _0x471b46=_[_0x226c('0x17')](_0x392717[_0x226c('0x4c')],'id');return _0x392717[_0x226c('0x4d')](_0x471b46)[_0x226c('0xc')](function(){for(var _0x462883=0x0;_0x462883<_0x471b46[_0x226c('0x1e')];_0x462883+=0x1){_0x3f2643[_0x226c('0x47')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x471b46[_0x462883]),'UserId':Number(_0x392717['id'])});}});}})[_0x226c('0xc')](function(){if(_0x17ab5f===_0x226c('0x46')){var _0x338b64=_['map'](_0x392717[_0x226c('0x28')],'id');return _0x392717[_0x226c('0x4e')](_0x338b64)['then'](function(){for(var _0x177128=0x0;_0x177128<_0x338b64[_0x226c('0x1e')];_0x177128+=0x1){_0x3f2643[_0x226c('0x47')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x338b64[_0x177128]),'UserId':Number(_0x392717['id'])});}});}})[_0x226c('0xc')](function(){if(_0x17ab5f==='leave'){var _0x52c46d=_['map'](_0x392717[_0x226c('0x29')],'id');return _0x392717[_0x226c('0x4f')](_0x52c46d)['then'](function(){for(var _0x27ec6=0x0;_0x27ec6<_0x52c46d[_0x226c('0x1e')];_0x27ec6+=0x1){_0x3f2643[_0x226c('0x47')](_0x226c('0x50'),{'WhatsappInteractionId':Number(_0x52c46d[_0x27ec6]),'UserId':Number(_0x392717['id'])});}});}})[_0x226c('0x51')](function(_0x9c1231){_0x3df28f['log'](_0x9c1231);});}}function onDisconnect(_0x335860,_0x41a803){joinOrLeave(_0x335860,_0x226c('0x46'),_0x41a803);}function onConnect(_0x332d0c){joinOrLeave(_0x332d0c,'join');}exports[_0x226c('0x52')]=function(_0xe75fee){_0xe75fee['on'](_0x226c('0x53'),function(_0x553f60){_0x553f60[_0x226c('0x54')](0x0);_0x553f60[_0x226c('0x55')]=_0x553f60[_0x226c('0x56')][_0x226c('0x53')][_0x226c('0x57')]+':'+_0x553f60[_0x226c('0x56')]['connection'][_0x226c('0x58')];_0x553f60['connectedAt']=new Date();_0x553f60[_0x226c('0x59')]=function(_0x326174){console['log'](_0x226c('0x5a')+_0x553f60[_0x226c('0x5b')]['name']+'['+_0x553f60['address']+']',_0x326174);};_0x553f60['on'](_0x226c('0x5c'),function(){onDisconnect(_0x553f60,_0xe75fee);_0x553f60[_0x226c('0x59')](_0x226c('0x5d'));});onConnect(_0x553f60);_0x553f60[_0x226c('0x59')]('CONNECTED');});}; \ No newline at end of file +var _0xf7f7=['catch','log','join','connection','address','request','remoteAddress','remotePort','SocketIO\x20','DISCONNECTED','lodash','util','bluebird','../mysqldb','Agents','User','name','role','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','type','format','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','user','userProfileId','SmsQueues','MailQueues','WhatsappQueue','Trunks','agent','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xf7f7,0x192));var _0x7f7f=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xf7f7[_0x1d558c];return _0x15767d;};'use strict';var _=require(_0x7f7f('0x0'));var util=require(_0x7f7f('0x1'));var BPromise=require(_0x7f7f('0x2'));var db=require(_0x7f7f('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7f7f('0x4'),'model':db[_0x7f7f('0x5')],'attributes':['id',_0x7f7f('0x6'),_0x7f7f('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7f7f('0x6')],'where':{'role':_0x7f7f('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7f7f('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x7f7f('0x6')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7f7f('0x6'),'type'],'where':{'type':_0x7f7f('0x9')}};function getAssociatedResources(_0x4d5f64,_0x4c4be0,_0x4e5cc7){return db[_0x7f7f('0xa')][_0x7f7f('0xb')]({'where':{'name':_0x4d5f64,'userProfileId':_0x4c4be0},'raw':!![]})[_0x7f7f('0xc')](function(_0x478b9e){if(_0x478b9e){if(_0x478b9e[_0x7f7f('0xd')]){switch(_0x4d5f64){case _0x7f7f('0xe'):case _0x7f7f('0xf'):case'FaxQueues':case'SmsQueues':case'MailQueues':case _0x7f7f('0x10'):case _0x7f7f('0x11'):return db[_0x4e5cc7][_0x7f7f('0x12')](queryQueues);case _0x7f7f('0x13'):return db[_0x4e5cc7]['findAll'](queryTelephones);case'Trunks':return db[_0x4e5cc7][_0x7f7f('0x12')](queryTrunks);case _0x7f7f('0x14'):return db[_0x4e5cc7][_0x7f7f('0x12')](queryCampaigns);}}else{return db[_0x7f7f('0x15')][_0x7f7f('0x12')]({'attributes':[_0x7f7f('0x16')],'where':{'sectionId':_0x478b9e['id']},'raw':!![]})[_0x7f7f('0xc')](function(_0x15d3a6){if(_0x15d3a6){var _0x329e81={'where':{'id':_[_0x7f7f('0x17')](_0x15d3a6,_0x7f7f('0x16'))},'raw':!![]};switch(_0x4e5cc7){case _0x7f7f('0x5'):_0x329e81[_0x7f7f('0x18')][_0x7f7f('0x7')]=_0x7f7f('0x8');break;case _0x7f7f('0x19'):_0x329e81[_0x7f7f('0x18')][_0x7f7f('0x1a')]=_0x7f7f('0x9');break;}return db[_0x4e5cc7][_0x7f7f('0x12')](_0x329e81);}else{return[];}});}}else{return[];}})[_0x7f7f('0xc')](function(_0x525a0e){return _0x525a0e;});}function joinOrLeaveQueues(_0x3ccec6,_0x1d419d,_0x2ce161,_0x5a8f11){_0x3ccec6[_0x1d419d](util[_0x7f7f('0x1b')]('%s:queue:%s',_0x2ce161,_0x5a8f11[_0x7f7f('0x6')]));if(_0x5a8f11[_0x7f7f('0x4')]){for(var _0x45c12b=0x0;_0x45c12b<_0x5a8f11[_0x7f7f('0x4')]['length'];_0x45c12b+=0x1){_0x3ccec6[_0x1d419d](util[_0x7f7f('0x1b')](_0x7f7f('0x1c'),_0x5a8f11[_0x7f7f('0x4')][_0x45c12b]['name']));}}}function joinOrLeave(_0x2db644,_0x4b879d,_0x47a262){var _0x597be6;if(_0x2db644[_0x7f7f('0x1d')]['query']['id']){db[_0x7f7f('0x5')]['find']({'attributes':['id',_0x7f7f('0x6'),_0x7f7f('0x7'),'userProfileId'],'where':{'id':_0x2db644[_0x7f7f('0x1d')][_0x7f7f('0x1e')]['id']},'include':[{'model':db[_0x7f7f('0x1f')],'as':_0x7f7f('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f7f('0x21')],'as':_0x7f7f('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f7f('0x23')],'as':_0x7f7f('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f7f('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x7f7f('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f7f('0x27')],'as':_0x7f7f('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x702b2){if(_0x702b2){_0x597be6=_0x702b2;_0x2db644[_0x4b879d](util[_0x7f7f('0x1b')](_0x7f7f('0x1c'),_0x702b2['name']));var _0x508650=[];switch(_0x702b2['role']){case _0x7f7f('0x29'):_0x2db644[_0x4b879d](_0x7f7f('0x2a'));_0x2db644[_0x4b879d](_0x7f7f('0x2b'));if(queryQueues[_0x7f7f('0x2c')](_0x7f7f('0x2d'))){delete queryQueues[_0x7f7f('0x2d')];}_0x508650[_0x7f7f('0x2e')](db[_0x7f7f('0x2f')][_0x7f7f('0x12')](queryQueues));_0x508650[_0x7f7f('0x2e')](db[_0x7f7f('0x30')][_0x7f7f('0x12')](queryQueues));_0x508650[_0x7f7f('0x2e')](db[_0x7f7f('0x31')][_0x7f7f('0x12')](queryQueues));_0x508650['push'](db[_0x7f7f('0x32')]['findAll'](queryQueues));_0x508650[_0x7f7f('0x2e')](db[_0x7f7f('0x33')][_0x7f7f('0x12')](queryQueues));_0x508650[_0x7f7f('0x2e')](db[_0x7f7f('0x34')]['findAll'](queryQueues));_0x508650[_0x7f7f('0x2e')](db['WhatsappQueue'][_0x7f7f('0x12')](queryQueues));_0x508650['push'](db[_0x7f7f('0x5')]['findAll'](queryTelephones));_0x508650[_0x7f7f('0x2e')](db['Trunk'][_0x7f7f('0x12')](queryTrunks));_0x508650['push'](db['Campaign'][_0x7f7f('0x12')](queryCampaigns));_0x508650['push'](db['User'][_0x7f7f('0x12')](queryAgents));break;case _0x7f7f('0x35'):_0x2db644[_0x4b879d](_0x7f7f('0x2a'));_0x2db644[_0x4b879d]('voice:outbound');_0x508650[_0x7f7f('0x2e')](getAssociatedResources(_0x7f7f('0xe'),_0x702b2[_0x7f7f('0x36')],_0x7f7f('0x2f')));_0x508650[_0x7f7f('0x2e')](getAssociatedResources('ChatQueues',_0x702b2['userProfileId'],_0x7f7f('0x30')));_0x508650['push'](getAssociatedResources('FaxQueues',_0x702b2[_0x7f7f('0x36')],_0x7f7f('0x31')));_0x508650[_0x7f7f('0x2e')](getAssociatedResources(_0x7f7f('0x37'),_0x702b2['userProfileId'],_0x7f7f('0x32')));_0x508650[_0x7f7f('0x2e')](getAssociatedResources(_0x7f7f('0x38'),_0x702b2[_0x7f7f('0x36')],'MailQueue'));_0x508650[_0x7f7f('0x2e')](getAssociatedResources('OpenchannelQueues',_0x702b2['userProfileId'],'OpenchannelQueue'));_0x508650[_0x7f7f('0x2e')](getAssociatedResources(_0x7f7f('0x11'),_0x702b2[_0x7f7f('0x36')],_0x7f7f('0x39')));_0x508650['push'](getAssociatedResources('Telephones',_0x702b2[_0x7f7f('0x36')],'User'));_0x508650[_0x7f7f('0x2e')](getAssociatedResources(_0x7f7f('0x3a'),_0x702b2[_0x7f7f('0x36')],'Trunk'));_0x508650[_0x7f7f('0x2e')](getAssociatedResources('IvrCampaigns',_0x702b2['userProfileId'],_0x7f7f('0x19')));_0x508650['push'](db['User'][_0x7f7f('0x12')](queryAgents));break;case _0x7f7f('0x3b'):_0x2db644[_0x4b879d](_0x7f7f('0x2a'));_0x2db644[_0x4b879d](_0x7f7f('0x2b'));_0x508650['push'](_0x702b2[_0x7f7f('0x3c')]({'attributes':['id','name']}));_0x508650[_0x7f7f('0x2e')](_0x702b2[_0x7f7f('0x3d')]({'attributes':['id',_0x7f7f('0x6')]}));_0x508650[_0x7f7f('0x2e')](_0x702b2[_0x7f7f('0x3e')]({'attributes':['id',_0x7f7f('0x6')]}));_0x508650[_0x7f7f('0x2e')](_0x702b2[_0x7f7f('0x3f')]({'attributes':['id',_0x7f7f('0x6')]}));_0x508650['push'](_0x702b2[_0x7f7f('0x40')]({'attributes':['id',_0x7f7f('0x6')]}));_0x508650['push'](_0x702b2['getOpenchannelQueues']({'attributes':['id','name']}));_0x508650[_0x7f7f('0x2e')](_0x702b2[_0x7f7f('0x41')]({'attributes':['id',_0x7f7f('0x6')]}));break;}return BPromise[_0x7f7f('0x42')](_0x508650);}})['then'](function(_0x3cc955){if(_0x3cc955&&_0x3cc955[_0x7f7f('0x43')]){for(var _0x5b5276=0x0;_0x5b5276<_0x3cc955[_0x7f7f('0x43')];_0x5b5276+=0x1){for(var _0x3d41ea=0x0;_0x3d41ea<_0x3cc955[_0x5b5276]['length'];_0x3d41ea+=0x1){switch(_0x5b5276){case 0x0:joinOrLeaveQueues(_0x2db644,_0x4b879d,_0x7f7f('0x44'),_0x3cc955[_0x5b5276][_0x3d41ea]);break;case 0x1:joinOrLeaveQueues(_0x2db644,_0x4b879d,_0x7f7f('0x45'),_0x3cc955[_0x5b5276][_0x3d41ea]);break;case 0x2:joinOrLeaveQueues(_0x2db644,_0x4b879d,_0x7f7f('0x46'),_0x3cc955[_0x5b5276][_0x3d41ea]);break;case 0x3:joinOrLeaveQueues(_0x2db644,_0x4b879d,_0x7f7f('0x47'),_0x3cc955[_0x5b5276][_0x3d41ea]);break;case 0x4:joinOrLeaveQueues(_0x2db644,_0x4b879d,_0x7f7f('0x48'),_0x3cc955[_0x5b5276][_0x3d41ea]);break;case 0x5:joinOrLeaveQueues(_0x2db644,_0x4b879d,_0x7f7f('0x49'),_0x3cc955[_0x5b5276][_0x3d41ea]);break;case 0x6:joinOrLeaveQueues(_0x2db644,_0x4b879d,_0x7f7f('0x4a'),_0x3cc955[_0x5b5276][_0x3d41ea]);break;case 0x7:if(_0x597be6[_0x7f7f('0x7')]!==_0x7f7f('0x3b'))_0x2db644[_0x4b879d](util[_0x7f7f('0x1b')]('telephone:%s',_0x3cc955[_0x5b5276][_0x3d41ea]['name']));break;case 0x8:if(_0x597be6['role']!==_0x7f7f('0x3b'))_0x2db644[_0x4b879d](util[_0x7f7f('0x1b')](_0x7f7f('0x4b'),_0x3cc955[_0x5b5276][_0x3d41ea][_0x7f7f('0x6')]));break;case 0x9:if(_0x597be6[_0x7f7f('0x7')]!=='agent')_0x2db644[_0x4b879d](util[_0x7f7f('0x1b')](_0x7f7f('0x4c'),_0x3cc955[_0x5b5276][_0x3d41ea][_0x7f7f('0x1a')],_0x3cc955[_0x5b5276][_0x3d41ea][_0x7f7f('0x6')]));break;case 0xa:_0x2db644[_0x4b879d](util['format'](_0x7f7f('0x1c'),_0x3cc955[_0x5b5276][_0x3d41ea][_0x7f7f('0x6')]));break;}}}}})[_0x7f7f('0xc')](function(){if(_0x4b879d===_0x7f7f('0x4d')){var _0x3a352f=_['map'](_0x597be6[_0x7f7f('0x20')],'id');return _0x597be6['removeChatInteractions'](_0x3a352f)[_0x7f7f('0xc')](function(){for(var _0x4ea214=0x0;_0x4ea214<_0x3a352f[_0x7f7f('0x43')];_0x4ea214+=0x1){_0x47a262['emit'](_0x7f7f('0x4e'),{'ChatInteractionId':Number(_0x3a352f[_0x4ea214]),'UserId':Number(_0x597be6['id'])});}});}})[_0x7f7f('0xc')](function(){if(_0x4b879d==='leave'){var _0x4e4b25=_[_0x7f7f('0x17')](_0x597be6['MailInteractions'],'id');return _0x597be6[_0x7f7f('0x4f')](_0x4e4b25)[_0x7f7f('0xc')](function(){for(var _0x4aee62=0x0;_0x4aee62<_0x4e4b25[_0x7f7f('0x43')];_0x4aee62+=0x1){_0x47a262[_0x7f7f('0x50')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4e4b25[_0x4aee62]),'UserId':Number(_0x597be6['id'])});}});}})[_0x7f7f('0xc')](function(){if(_0x4b879d===_0x7f7f('0x4d')){var _0x22fc6b=_[_0x7f7f('0x17')](_0x597be6['FaxInteractions'],'id');return _0x597be6['removeFaxInteractions'](_0x22fc6b)[_0x7f7f('0xc')](function(){for(var _0x11a4b2=0x0;_0x11a4b2<_0x22fc6b['length'];_0x11a4b2+=0x1){_0x47a262[_0x7f7f('0x50')](_0x7f7f('0x51'),{'FaxInteractionId':Number(_0x22fc6b[_0x11a4b2]),'UserId':Number(_0x597be6['id'])});}});}})['then'](function(){if(_0x4b879d===_0x7f7f('0x4d')){var _0x6cd0ae=_[_0x7f7f('0x17')](_0x597be6[_0x7f7f('0x52')],'id');return _0x597be6[_0x7f7f('0x53')](_0x6cd0ae)[_0x7f7f('0xc')](function(){for(var _0x22da98=0x0;_0x22da98<_0x6cd0ae[_0x7f7f('0x43')];_0x22da98+=0x1){_0x47a262[_0x7f7f('0x50')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x6cd0ae[_0x22da98]),'UserId':Number(_0x597be6['id'])});}});}})[_0x7f7f('0xc')](function(){if(_0x4b879d===_0x7f7f('0x4d')){var _0xd2b9c6=_[_0x7f7f('0x17')](_0x597be6[_0x7f7f('0x26')],'id');return _0x597be6[_0x7f7f('0x54')](_0xd2b9c6)['then'](function(){for(var _0x2ad47d=0x0;_0x2ad47d<_0xd2b9c6[_0x7f7f('0x43')];_0x2ad47d+=0x1){_0x47a262[_0x7f7f('0x50')](_0x7f7f('0x55'),{'OpenchannelInteractionId':Number(_0xd2b9c6[_0x2ad47d]),'UserId':Number(_0x597be6['id'])});}});}})[_0x7f7f('0xc')](function(){if(_0x4b879d==='leave'){var _0x26373e=_[_0x7f7f('0x17')](_0x597be6[_0x7f7f('0x28')],'id');return _0x597be6[_0x7f7f('0x56')](_0x26373e)[_0x7f7f('0xc')](function(){for(var _0x14faf6=0x0;_0x14faf6<_0x26373e[_0x7f7f('0x43')];_0x14faf6+=0x1){_0x47a262[_0x7f7f('0x50')](_0x7f7f('0x57'),{'WhatsappInteractionId':Number(_0x26373e[_0x14faf6]),'UserId':Number(_0x597be6['id'])});}});}})[_0x7f7f('0x58')](function(_0x217936){_0x2db644[_0x7f7f('0x59')](_0x217936);});}}function onDisconnect(_0x370ad5,_0x216883){joinOrLeave(_0x370ad5,_0x7f7f('0x4d'),_0x216883);}function onConnect(_0xd576d0){joinOrLeave(_0xd576d0,_0x7f7f('0x5a'));}exports['default']=function(_0x515ee2){_0x515ee2['on'](_0x7f7f('0x5b'),function(_0x13b54f){_0x13b54f['setMaxListeners'](0x0);_0x13b54f[_0x7f7f('0x5c')]=_0x13b54f[_0x7f7f('0x5d')][_0x7f7f('0x5b')][_0x7f7f('0x5e')]+':'+_0x13b54f[_0x7f7f('0x5d')][_0x7f7f('0x5b')][_0x7f7f('0x5f')];_0x13b54f['connectedAt']=new Date();_0x13b54f[_0x7f7f('0x59')]=function(_0x524e70){console[_0x7f7f('0x59')](_0x7f7f('0x60')+_0x13b54f['nsp'][_0x7f7f('0x6')]+'['+_0x13b54f['address']+']',_0x524e70);};_0x13b54f['on']('disconnect',function(){onDisconnect(_0x13b54f,_0x515ee2);_0x13b54f[_0x7f7f('0x59')](_0x7f7f('0x61'));});onConnect(_0x13b54f);_0x13b54f[_0x7f7f('0x59')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index d3839d4..b8014ac 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 _0xbbc6=['Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','info','Trigger,\x20%s','error','code','catch','get','motionChannel','event','resolve','then','undefined','sequelize','query','Sequelize','QueryTypes','contact','UserId','interface','format','SIP/%s','name','channel','outgoingmessage','AfterCreateMessage','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','agent','AfterCreate','changed','closed','substatus','ContactId','AfterUpdate','User','fullname','internal','default','model','callback','toLowerCase','condition','jayson/promise','triggers','client','http'];(function(_0xdabd59,_0x55e984){var _0x4af920=function(_0x7e5f46){while(--_0x7e5f46){_0xdabd59['push'](_0xdabd59['shift']());}};_0x4af920(++_0x55e984);}(_0xbbc6,0x1df));var _0x6bbc=function(_0x47a6b0,_0x52fe4f){_0x47a6b0=_0x47a6b0-0x0;var _0x1db86e=_0xbbc6[_0x47a6b0];return _0x1db86e;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0x6bbc('0x0'));var logger=require('../logger')(_0x6bbc('0x1'));var client=jayson[_0x6bbc('0x2')][_0x6bbc('0x3')]({'port':0x232a});var triggers=[{'channel':_0x6bbc('0x4'),'model':_0x6bbc('0x5'),'event':_0x6bbc('0x6'),'condition':_0x6bbc('0x7'),'callback':afterCreate},{'channel':_0x6bbc('0x4'),'model':'ChatInteraction','event':_0x6bbc('0x8'),'condition':_0x6bbc('0x9'),'callback':afterUpdate},{'channel':_0x6bbc('0x4'),'model':_0x6bbc('0xa'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0x6bbc('0xb'),'event':_0x6bbc('0x6'),'condition':_0x6bbc('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x6bbc('0xd'),'model':'SmsInteraction','event':_0x6bbc('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x6bbc('0x8'),'condition':_0x6bbc('0x9'),'callback':afterUpdate},{'channel':'Sms','model':_0x6bbc('0xe'),'event':_0x6bbc('0x6'),'condition':_0x6bbc('0xc'),'callback':afterCreateMessage},{'channel':_0x6bbc('0xf'),'model':_0x6bbc('0x10'),'event':_0x6bbc('0x6'),'condition':_0x6bbc('0x7'),'callback':afterCreate},{'channel':_0x6bbc('0xf'),'model':'WhatsappInteraction','event':_0x6bbc('0x8'),'condition':_0x6bbc('0x9'),'callback':afterUpdate},{'channel':_0x6bbc('0xf'),'model':_0x6bbc('0x11'),'event':'afterCreate','condition':_0x6bbc('0xc'),'callback':afterCreateMessage},{'channel':_0x6bbc('0x12'),'model':_0x6bbc('0x13'),'event':_0x6bbc('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x6bbc('0x12'),'model':_0x6bbc('0x13'),'event':_0x6bbc('0x8'),'condition':_0x6bbc('0x9'),'callback':afterUpdate},{'channel':_0x6bbc('0x12'),'model':'FaxMessage','event':_0x6bbc('0x6'),'condition':_0x6bbc('0xc'),'callback':afterCreateMessage},{'channel':_0x6bbc('0x14'),'model':_0x6bbc('0x15'),'event':_0x6bbc('0x6'),'condition':_0x6bbc('0x7'),'callback':afterCreate},{'channel':_0x6bbc('0x14'),'model':'MailInteraction','event':_0x6bbc('0x8'),'condition':_0x6bbc('0x9'),'callback':afterUpdate},{'channel':_0x6bbc('0x14'),'model':'MailMessage','event':_0x6bbc('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x6bbc('0x16'),'model':_0x6bbc('0x17'),'event':'afterCreate','condition':_0x6bbc('0x7'),'callback':afterCreate},{'channel':_0x6bbc('0x16'),'model':_0x6bbc('0x17'),'event':_0x6bbc('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x6bbc('0x16'),'model':_0x6bbc('0x18'),'event':_0x6bbc('0x6'),'condition':_0x6bbc('0xc'),'callback':afterCreateMessage}];function request(_0x2982c0){return client['request'](_0x6bbc('0x19'),_0x2982c0)['then'](function(_0x253032){logger[_0x6bbc('0x1a')](_0x6bbc('0x1b'),_0x6bbc('0x19'),_0x253032);if(_0x253032[_0x6bbc('0x1c')]){if(_0x253032[_0x6bbc('0x1c')][_0x6bbc('0x1d')]===0x1f4){logger[_0x6bbc('0x1c')](_0x6bbc('0x1b'),'EventManager',_0x253032['error']);}}})[_0x6bbc('0x1e')](function(_0x408349){logger['error'](_0x6bbc('0x1b'),'EventManager',_0x408349);});}function afterCreateMessage(_0xdf0eae){return function(_0x39a94b){_0x39a94b=_0x39a94b[_0x6bbc('0x1f')]({'plain':!![]});_0x39a94b['channel']=_0xdf0eae;_0x39a94b[_0x6bbc('0x20')]=_0xdf0eae;_0x39a94b[_0x6bbc('0x21')]=_0x39a94b['direction'];Promise[_0x6bbc('0x22')]()[_0x6bbc('0x23')](function(){if(typeof _0x39a94b['ContactId']===_0x6bbc('0x24'))return null;var _0x288044='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x39a94b['ContactId'];return db[_0x6bbc('0x25')][_0x6bbc('0x26')](_0x288044,{'type':db[_0x6bbc('0x27')][_0x6bbc('0x28')]['SELECT'],'raw':!![]});})[_0x6bbc('0x23')](function(_0x2a198b){if(_0x2a198b){_0x39a94b[_0x6bbc('0x29')]=_0x2a198b[0x0];}if(typeof _0x39a94b[_0x6bbc('0x2a')]==='undefined')return;return getAgent(_0x39a94b[_0x6bbc('0x2a')]);})[_0x6bbc('0x23')](function(_0x4c2299){if(_0x4c2299){_0x39a94b[_0x6bbc('0x2b')]=util[_0x6bbc('0x2c')](_0x6bbc('0x2d'),_0x4c2299[_0x6bbc('0x2e')]);_0x39a94b['agent']=_0x4c2299;_0x39a94b[_0x6bbc('0x2f')]=_0xdf0eae;return request({'event':'incomingmessage','message':_0x39a94b});}else{return request({'event':_0x6bbc('0x30'),'message':_0x39a94b});}})[_0x6bbc('0x1e')](function(_0x36b88f){logger[_0x6bbc('0x1c')](_0x6bbc('0x1b'),_0x6bbc('0x31'),_0x36b88f);});};}function afterCreateOfflineMessage(_0x34dcc9){return function(_0x2c5d71){_0x2c5d71=_0x2c5d71[_0x6bbc('0x1f')]({'plain':!![]});_0x2c5d71['channel']=_0x34dcc9;_0x2c5d71[_0x6bbc('0x20')]=_0x34dcc9;_0x2c5d71[_0x6bbc('0x21')]=_0x6bbc('0x32');return request({'event':_0x2c5d71['event'],'message':_0x2c5d71});};}function afterCreate(_0x41ea7a,_0x4f98ed){return function(_0x32e7f8){_0x32e7f8=_0x32e7f8[_0x6bbc('0x1f')]({'plain':!![]});_0x32e7f8[_0x6bbc('0x2f')]=_0x41ea7a;_0x32e7f8[_0x6bbc('0x20')]=_0x41ea7a;_0x32e7f8[_0x6bbc('0x21')]=_0x6bbc('0x33');Promise['resolve']()[_0x6bbc('0x23')](function(){var _0x803ae6=_0x6bbc('0x34')+_0x32e7f8['ContactId'];return db[_0x6bbc('0x25')][_0x6bbc('0x26')](_0x803ae6,{'type':db[_0x6bbc('0x27')]['QueryTypes'][_0x6bbc('0x35')],'raw':!![]});})[_0x6bbc('0x23')](function(_0x25923d){if(_0x25923d){_0x32e7f8['contact']=_0x25923d[0x0];}if(typeof _0x32e7f8[_0x6bbc('0x2a')]===_0x6bbc('0x24'))return;return getAgent(_0x32e7f8[_0x6bbc('0x2a')]);})[_0x6bbc('0x23')](function(_0x1d8a0d){if(_0x1d8a0d){_0x32e7f8['interface']=util[_0x6bbc('0x2c')](_0x6bbc('0x2d'),_0x1d8a0d[_0x6bbc('0x2e')]);_0x32e7f8[_0x6bbc('0x36')]=_0x1d8a0d;}return request({'event':_0x4f98ed,'message':_0x32e7f8});})['catch'](function(_0x41bd43){logger[_0x6bbc('0x1c')](_0x6bbc('0x1b'),_0x6bbc('0x37'),_0x41bd43);});};}function afterUpdate(_0x14a190){return function(_0x16db80){var _0x3850a5=_0x16db80[_0x6bbc('0x38')]('closed')&&_0x16db80[_0x6bbc('0x39')];var _0x23c8a9=_0x16db80['changed'](_0x6bbc('0x3a'));if(_0x3850a5||_0x23c8a9){var _0xde5715=_0x3850a5?'closedinteraction':_0x6bbc('0x3a');var _0xe55df3=_0x16db80[_0x6bbc('0x1f')]({'plain':!![]});_0xe55df3[_0x6bbc('0x2f')]=_0x14a190;_0xe55df3[_0x6bbc('0x20')]=_0x14a190;_0xe55df3[_0x6bbc('0x21')]=_0x3850a5?_0x6bbc('0x39'):_0x6bbc('0x3a');var _0x38778e=_0x6bbc('0x34')+_0xe55df3[_0x6bbc('0x3b')];return db['sequelize']['query'](_0x38778e,{'type':db[_0x6bbc('0x27')]['QueryTypes']['SELECT'],'raw':!![]})[_0x6bbc('0x23')](function(_0x5b4c98){if(_0x5b4c98){_0xe55df3['contact']=_0x5b4c98[0x0];}if(typeof _0xe55df3[_0x6bbc('0x2a')]===_0x6bbc('0x24'))return;return getAgent(_0xe55df3[_0x6bbc('0x2a')]);})[_0x6bbc('0x23')](function(_0x5257f4){if(_0x5257f4){_0xe55df3['interface']=util[_0x6bbc('0x2c')](_0x6bbc('0x2d'),_0x5257f4[_0x6bbc('0x2e')]);_0xe55df3[_0x6bbc('0x36')]=_0x5257f4;}return request({'event':_0xde5715,'message':_0xe55df3});})[_0x6bbc('0x1e')](function(_0x5c6eea){logger[_0x6bbc('0x1c')](_0x6bbc('0x1b'),_0x6bbc('0x3c'),_0x5c6eea);});}};}function getAgent(_0x2bbc76){return db[_0x6bbc('0x3d')]['find']({'where':{'id':_0x2bbc76},'attributes':['id','name',_0x6bbc('0x3e'),'email',_0x6bbc('0x3f')],'raw':!![]})[_0x6bbc('0x23')](function(_0x34febb){return _0x34febb;});}exports[_0x6bbc('0x40')]=function(){for(var _0x5dfb66=0x0;_0x5dfb66=_0x5c2eec[_0xe849('0x13')]){throw Error(_0xe849('0x14'));}_0x1bc7b3(_0x11eae8);})[_0xe849('0x15')](function(_0x409cad){_0x21f87a(_0x409cad);});});}; \ No newline at end of file +var _0x9897=['count','agent','then','agents','lodash','../mysqldb','./license/util','mail','chat','fax','sms','whatsapp','openchannel','getChannels','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','User'];(function(_0x1feca0,_0x523b2e){var _0x48911c=function(_0x47c566){while(--_0x47c566){_0x1feca0['push'](_0x1feca0['shift']());}};_0x48911c(++_0x523b2e);}(_0x9897,0xc1));var _0x7989=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x9897[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x7989('0x0'));var BPromise=require('bluebird');var db=require(_0x7989('0x1'))['db'];var util=require(_0x7989('0x2'));var channels=['voice',_0x7989('0x3'),_0x7989('0x4'),_0x7989('0x5'),_0x7989('0x6'),_0x7989('0x7'),_0x7989('0x8')];exports[_0x7989('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x3e67a3){_0x3e67a3=_0x3e67a3['toLowerCase']();return _[_0x7989('0xa')](channels,_0x3e67a3);};exports[_0x7989('0xb')]=function(_0x803c47,_0x47da3f,_0x599927,_0x15db02){var _0x540f5d={'loginAttempts':_0x47da3f,'blocked':_0x599927};if(!_['isUndefined'](_0x15db02)){_0x540f5d[_0x7989('0xc')]=_0x15db02;}return _0x803c47[_0x7989('0xd')](_0x540f5d);};exports[_0x7989('0xe')]=function(_0x4d186b){return new BPromise(function(_0x1792de,_0x4ba060){var _0x2b1f6b=0x0;if(_0x4d186b[_0x7989('0xf')]!=='agent'){_0x1792de(_0x4d186b);}db[_0x7989('0x10')][_0x7989('0x11')]({'where':{'role':_0x7989('0x12'),'online':!![],'id':{'$ne':_0x4d186b['id']}}})[_0x7989('0x13')](function(_0x182d77){_0x2b1f6b=_0x182d77;return util[_0x7989('0xe')]();})[_0x7989('0x13')](function(_0x17a89d){if(_0x17a89d&&_0x17a89d[_0x7989('0x14')]&&_0x2b1f6b>=_0x17a89d[_0x7989('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1792de(_0x4d186b);})['catch'](function(_0x57f347){_0x4ba060(_0x57f347);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index c7a09c7..e2e4e6c 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['stack','statusMessage','status','exports','util','../config/logger','api','message','inherits','Bad\x20Request','name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error'];(function(_0x36e8ef,_0xcb2731){var _0x2b2057=function(_0x9a813c){while(--_0x9a813c){_0x36e8ef['push'](_0x36e8ef['shift']());}};_0x2b2057(++_0xcb2731);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var util=require(_0xac4a('0x0'));var logger=require(_0xac4a('0x1'))(_0xac4a('0x2'));var APIError=function(_0x351dd5,_0x275161){this[_0xac4a('0x3')]=_0x351dd5||'Internal\x20Server\x20Error';this['name']=_0x275161||'Error';util[_0xac4a('0x4')](APIError,Error);};var APIBadRequestError=function(_0x15b967){this[_0xac4a('0x3')]=_0x15b967||_0xac4a('0x5');this[_0xac4a('0x6')]=_0xac4a('0x5');util[_0xac4a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x10525b){this['message']=_0x10525b||'Entity\x20not\x20found';this[_0xac4a('0x6')]=_0xac4a('0x7');util[_0xac4a('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4f4146){this[_0xac4a('0x3')]=_0x4f4146||_0xac4a('0x8');this[_0xac4a('0x6')]='Out\x20Of\x20Interval';util[_0xac4a('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x488e3c){switch(_0x488e3c){case _0xac4a('0x5'):return 0x190;case'Forbidden',_0xac4a('0x9'):return 0x193;case _0xac4a('0x7'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x24291d){if(_0x24291d==='Out\x20Of\x20Interval')return _0x24291d;return null;}function handleError(_0x21a79){return function(_0x68424a){logger[_0xac4a('0xa')](_0x68424a[_0xac4a('0xb')]);var _0x1b4313=getStatusCode(_0x68424a[_0xac4a('0x6')]);var _0x34bc01=getCustomStatusMessage(_0x68424a[_0xac4a('0x6')]);if(_0x68424a[_0xac4a('0x6')])delete _0x68424a[_0xac4a('0x6')];if(_0x34bc01)_0x21a79[_0xac4a('0xc')]=_0x34bc01;return _0x21a79[_0xac4a('0xd')](_0x1b4313)['send'](_0x68424a);};}module[_0xac4a('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x6287=['status','send','exports','util','../config/logger','api','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','stack','statusMessage'];(function(_0x19bd12,_0x3953d5){var _0x58baa4=function(_0x52761f){while(--_0x52761f){_0x19bd12['push'](_0x19bd12['shift']());}};_0x58baa4(++_0x3953d5);}(_0x6287,0x7b));var _0x7628=function(_0x5d8afd,_0xd7f769){_0x5d8afd=_0x5d8afd-0x0;var _0x336c61=_0x6287[_0x5d8afd];return _0x336c61;};'use strict';var util=require(_0x7628('0x0'));var logger=require(_0x7628('0x1'))(_0x7628('0x2'));var APIError=function(_0x495c55,_0x109f89){this['message']=_0x495c55||_0x7628('0x3');this[_0x7628('0x4')]=_0x109f89||_0x7628('0x5');util[_0x7628('0x6')](APIError,Error);};var APIBadRequestError=function(_0x1a3ca6){this[_0x7628('0x7')]=_0x1a3ca6||_0x7628('0x8');this['name']=_0x7628('0x8');util[_0x7628('0x6')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x33e6be){this['message']=_0x33e6be||_0x7628('0x9');this[_0x7628('0x4')]=_0x7628('0x9');util[_0x7628('0x6')](APIForbiddenError,APIError);};var APINotFoundError=function(_0xd22783){this[_0x7628('0x7')]=_0xd22783||_0x7628('0xa');this['name']=_0x7628('0xb');util[_0x7628('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0xe46782){this[_0x7628('0x7')]=_0xe46782||_0x7628('0xc');this[_0x7628('0x4')]=_0x7628('0xd');util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x253602){switch(_0x253602){case _0x7628('0x8'):return 0x190;case'Forbidden',_0x7628('0xd'):return 0x193;case _0x7628('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xdfcb89){if(_0xdfcb89===_0x7628('0xd'))return _0xdfcb89;return null;}function handleError(_0x13ea91){return function(_0xe670a6){logger[_0x7628('0xe')](_0xe670a6[_0x7628('0xf')]);var _0x582743=getStatusCode(_0xe670a6['name']);var _0xceb1db=getCustomStatusMessage(_0xe670a6[_0x7628('0x4')]);if(_0xe670a6['name'])delete _0xe670a6[_0x7628('0x4')];if(_0xceb1db)_0x13ea91[_0x7628('0x10')]=_0xceb1db;return _0x13ea91[_0x7628('0x11')](_0x582743)[_0x7628('0x12')](_0xe670a6);};}module[_0x7628('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'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 d638da0..8afe4d1 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7aa=['exports','render','status','json','send'];(function(_0x260a86,_0x5b6f4b){var _0x5758e1=function(_0x246ced){while(--_0x246ced){_0x260a86['push'](_0x260a86['shift']());}};_0x5758e1(++_0x5b6f4b);}(_0xb7aa,0x13b));var _0xab7a=function(_0x509a8b,_0x3c5bdb){_0x509a8b=_0x509a8b-0x0;var _0x4a753b=_0xb7aa[_0x509a8b];return _0x4a753b;};'use strict';module[_0xab7a('0x0')][0x194]=function pageNotFound(_0x4eaa67,_0xb51184){var _0x112392='404';var _0x38a64a=0x194;var _0x2b0810={'status':_0x38a64a};_0xb51184['status'](_0x2b0810['status']);_0xb51184[_0xab7a('0x1')](_0x112392,{},function(_0x43b1fc,_0x2cb554){if(_0x43b1fc){return _0xb51184['status'](_0x2b0810[_0xab7a('0x2')])[_0xab7a('0x3')](_0x2b0810);}_0xb51184[_0xab7a('0x4')](_0x2cb554);});}; \ No newline at end of file +var _0xfd1b=['json','exports','status'];(function(_0x585e82,_0x467223){var _0x47d517=function(_0x3c4377){while(--_0x3c4377){_0x585e82['push'](_0x585e82['shift']());}};_0x47d517(++_0x467223);}(_0xfd1b,0x157));var _0xbfd1=function(_0x1462c1,_0x264d76){_0x1462c1=_0x1462c1-0x0;var _0x2778eb=_0xfd1b[_0x1462c1];return _0x2778eb;};'use strict';module[_0xbfd1('0x0')][0x194]=function pageNotFound(_0x5e491d,_0x15f588){var _0x54612e='404';var _0x259b11=0x194;var _0x547ce5={'status':_0x259b11};_0x15f588[_0xbfd1('0x1')](_0x547ce5[_0xbfd1('0x1')]);_0x15f588['render'](_0x54612e,{},function(_0x122016,_0x2ea148){if(_0x122016){return _0x15f588[_0xbfd1('0x1')](_0x547ce5[_0xbfd1('0x1')])[_0xbfd1('0x2')](_0x547ce5);}_0x15f588['send'](_0x2ea148);});}; \ No newline at end of file diff --git a/server/migrations/2.6.22.js b/server/migrations/2.6.22.js index a59425a..c3f0d98 100644 --- a/server/migrations/2.6.22.js +++ b/server/migrations/2.6.22.js @@ -152,11 +152,16 @@ Migration.prototype.final = function(resolve) { }; module.exports = { - up: function(queryInterface /*, Sequelize */) { + up: function(queryInterface /*, Sequelize */ ) { return new BPromise(function(resolve) { var migration = new Migration(queryInterface); // Add your migration code here + //START cm_hopper + migration.query('ALTER TABLE `cm_hopper` DROP FOREIGN KEY `cm_hopper_ibfk_3`;'); + migration.query('ALTER TABLE `cm_hopper` ADD CONSTRAINT `cm_hopper_ibfk_3` FOREIGN KEY (`UserId`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;'); + //END cm_hopper + // START FINAL migration.final(resolve); // END FINAL diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c3bf495..6ac2758 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(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 _0xb2d4=['CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','hasOne','cascade','UserId','userSetting','hasMany','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','Hoppers','SET\x20NULL','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','CmHopperFinal','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','restrict','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','List','ListId','TemplateId','Agents','team_has_mail_queues','Account','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','Dashboard','Items','FaxAccountId','Exntensions','Owner','fax_interaction_has_tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatGroupId','CmCompany','CompanyId','CmContactHasItem','Phones','HopperHistories','cm_user_has_contacts','AdditionalPhones','CmHopperId','CampaignId','OwnerId','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','FieldId','Subject','Description','DescriptionId','Field','Variable','SugarcrmField','Descriptions','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','ServicenowConfiguration','ToId','SessionId','ProjectId','team_has_chat_queues','team_has_sms_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','FaxTransferReport','ToFaxQueueId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','exports','../config/environment','lodash','determine','sequelize','defaultsDeep','motion2','xcall','127.0.0.1','name','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','utf8mb4','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','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','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model'];(function(_0x10987f,_0x4fb163){var _0x5bafbe=function(_0x3ee5b6){while(--_0x3ee5b6){_0x10987f['push'](_0x10987f['shift']());}};_0x5bafbe(++_0x4fb163);}(_0xb2d4,0x10a));var _0x4b2d=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xb2d4[_0x56482c];return _0x5aae7a;};'use strict';var config=require(_0x4b2d('0x0'));var Sequelize=require('sequelize');var _=require(_0x4b2d('0x1'));var jstz=require('jstz');var timezone=jstz[_0x4b2d('0x2')]();config[_0x4b2d('0x3')]=_[_0x4b2d('0x4')](config[_0x4b2d('0x3')],{'database':_0x4b2d('0x5'),'username':_0x4b2d('0x6'),'password':'xC@LL1234','options':{'host':_0x4b2d('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4b2d('0x8')](),'define':{'charset':_0x4b2d('0x9'),'collate':_0x4b2d('0xa')}}});config['sequelizeHistory']=_[_0x4b2d('0x4')](config[_0x4b2d('0xb')],{'database':_0x4b2d('0x5'),'username':'xcall','password':_0x4b2d('0xc'),'options':{'host':_0x4b2d('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x4b2d('0xd')},'logging':![],'timezone':timezone[_0x4b2d('0x8')](),'define':{'charset':_0x4b2d('0x9'),'collate':_0x4b2d('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4b2d('0x3')][_0x4b2d('0xe')],config[_0x4b2d('0x3')][_0x4b2d('0xf')],config[_0x4b2d('0x3')][_0x4b2d('0x10')],config[_0x4b2d('0x3')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4b2d('0xb')][_0x4b2d('0xe')],config[_0x4b2d('0xb')][_0x4b2d('0xf')],config[_0x4b2d('0xb')][_0x4b2d('0x10')],config[_0x4b2d('0xb')][_0x4b2d('0x11')])};db[_0x4b2d('0x12')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x14'));db['VoiceChanSpy']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x15'));db['VoiceContext']=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x16'));db[_0x4b2d('0x17')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0x4b2d('0x18')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x19'));db[_0x4b2d('0x1a')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x1b'));db[_0x4b2d('0x1c')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x1d'));db[_0x4b2d('0x1e')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x1f'));db[_0x4b2d('0x20')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x21'));db['VoiceMailMessage']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x22'));db[_0x4b2d('0x23')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x24'));db[_0x4b2d('0x25')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4b2d('0x26')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x27'));db[_0x4b2d('0x28')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x29'));db[_0x4b2d('0x2a')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x2b'));db[_0x4b2d('0x2c')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x2d'));db['VoiceTransferReport']=db['sequelize'][_0x4b2d('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x2e'));db['UserVoiceQueue']=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x2f'));db[_0x4b2d('0x30')]=db[_0x4b2d('0x3')]['import']('../api/userChatQueue/userChatQueue.model');db[_0x4b2d('0x31')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x32'));db[_0x4b2d('0x33')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x34'));db[_0x4b2d('0x35')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x36'));db[_0x4b2d('0x37')]=db[_0x4b2d('0x3')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize']['import'](_0x4b2d('0x38'));db[_0x4b2d('0x39')]=db[_0x4b2d('0x3')]['import']('../api/mailServerIn/mailServerIn.model');db[_0x4b2d('0x3a')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x3b'));db[_0x4b2d('0x3c')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x3d'));db[_0x4b2d('0x3e')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x3f'));db[_0x4b2d('0x40')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x41'));db[_0x4b2d('0x42')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x43'));db[_0x4b2d('0x44')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x45'));db[_0x4b2d('0x46')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x47'));db[_0x4b2d('0x48')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x49'));db['Dashboard']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x4a'));db[_0x4b2d('0x4b')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x4c'));db[_0x4b2d('0x4d')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x4e'));db[_0x4b2d('0x4f')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x50'));db[_0x4b2d('0x51')]=db['sequelize'][_0x4b2d('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x4b2d('0x52')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x53'));db[_0x4b2d('0x54')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x55'));db[_0x4b2d('0x56')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x4b2d('0x57')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x58'));db[_0x4b2d('0x59')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/smsApplication/smsApplication.model');db[_0x4b2d('0x5a')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x5b'));db[_0x4b2d('0x5c')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x5d'));db[_0x4b2d('0x5e')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x5f'));db[_0x4b2d('0x60')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x61'));db['OpenchannelApplication']=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x62'));db['OpenchannelInteraction']=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x63'));db[_0x4b2d('0x64')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x65'));db[_0x4b2d('0x66')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x67'));db['ChatWebsite']=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x68'));db[_0x4b2d('0x69')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x6a'));db[_0x4b2d('0x6b')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x6c'));db[_0x4b2d('0x6d')]=db['sequelize'][_0x4b2d('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x4b2d('0x6e')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x6f'));db[_0x4b2d('0x70')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x4b2d('0x71')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x72'));db[_0x4b2d('0x73')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x74'));db[_0x4b2d('0x75')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x76'));db['CmCompany']=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x77'));db[_0x4b2d('0x78')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x79'));db[_0x4b2d('0x7a')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x7b'));db[_0x4b2d('0x7c')]=db['sequelize'][_0x4b2d('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x7d'));db['CmHopperHistory']=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x7e'));db[_0x4b2d('0x7f')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x4b2d('0x80')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x81'));db[_0x4b2d('0x82')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x83'));db[_0x4b2d('0x84')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x85'));db['CannedAnswer']=db['sequelize']['import'](_0x4b2d('0x86'));db[_0x4b2d('0x87')]=db['sequelize'][_0x4b2d('0x13')]('../api/disposition/disposition.model');db[_0x4b2d('0x88')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x89'));db[_0x4b2d('0x8a')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x8b'));db[_0x4b2d('0x8c')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x8d'));db[_0x4b2d('0x8e')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x8f'));db[_0x4b2d('0x90')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x91'));db['Sound']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x92'));db[_0x4b2d('0x93')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x94'));db[_0x4b2d('0x95')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x96'));db['CmContactHasItem']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x97'));db[_0x4b2d('0x98')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x99'));db[_0x4b2d('0x9a')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x9b'));db[_0x4b2d('0x9c')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x9d'));db['Variable']=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x9e'));db[_0x4b2d('0x9f')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xa0'));db[_0x4b2d('0xa1')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xa2'));db[_0x4b2d('0xa3')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xa4'));db[_0x4b2d('0xa5')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xa6'));db[_0x4b2d('0xa7')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xa8'));db['AnalyticFieldReport']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xa9'));db[_0x4b2d('0xaa')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x4b2d('0xab')]=db['sequelize'][_0x4b2d('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x4b2d('0x3')]['import'](_0x4b2d('0xac'));db[_0x4b2d('0xad')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xae'));db[_0x4b2d('0xaf')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0xb0'));db[_0x4b2d('0xb1')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xb2'));db['SugarcrmField']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xb3'));db[_0x4b2d('0xb4')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0xb5'));db[_0x4b2d('0xb6')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x4b2d('0xb7')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xb8'));db['ZohoAccount']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xb9'));db[_0x4b2d('0xba')]=db['sequelize'][_0x4b2d('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x4b2d('0xbb')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0xbc'));db[_0x4b2d('0xbd')]=db['sequelize']['import'](_0x4b2d('0xbe'));db['ZendeskConfiguration']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xbf'));db['ZendeskField']=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0x4b2d('0xc0')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xc1'));db[_0x4b2d('0xc2')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xc3'));db[_0x4b2d('0xc4')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xc5'));db['VtigerAccount']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xc6'));db['VtigerConfiguration']=db[_0x4b2d('0x3')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x4b2d('0xc7')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xc8'));db[_0x4b2d('0xc9')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db['sequelize'][_0x4b2d('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4b2d('0xca')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0xcb'));db[_0x4b2d('0xcc')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xcd'));db[_0x4b2d('0xce')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xcf'));db[_0x4b2d('0xd0')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xd1'));db[_0x4b2d('0xd2')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xd3'));db[_0x4b2d('0xd4')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xd5'));db[_0x4b2d('0xd6')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db['sequelize']['import'](_0x4b2d('0xa0'));db['Network']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xd7'));db[_0x4b2d('0xd8')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xd9'));db[_0x4b2d('0xda')]=db['sequelize'][_0x4b2d('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xdb'));db[_0x4b2d('0xdc')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xdd'));db[_0x4b2d('0xde')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xdf'));db[_0x4b2d('0xe0')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0xe1'));db[_0x4b2d('0xe2')]=db['sequelize']['import'](_0x4b2d('0xe3'));db['SquareDetailsReport']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xe4'));db[_0x4b2d('0xe5')]=db['sequelize']['import'](_0x4b2d('0xe6'));db[_0x4b2d('0xe7')]=db[_0x4b2d('0x3')]['import']('../api/setting/setting.model');db['SquareOdbc']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xe8'));db[_0x4b2d('0xe9')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xea'));db[_0x4b2d('0xeb')]=db['sequelize']['import'](_0x4b2d('0xec'));db[_0x4b2d('0xed')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xee'));db[_0x4b2d('0xef')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xf0'));db[_0x4b2d('0xf1')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xf2'));db[_0x4b2d('0xf3')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0xf4'));db[_0x4b2d('0xf5')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/migration/migration.model');db['Attachment']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xf6'));db[_0x4b2d('0xf7')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xf8'));db[_0x4b2d('0xf9')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xfa'));db[_0x4b2d('0xfb')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0xfc'));db['FaxTransferReport']=db[_0x4b2d('0x3')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x4b2d('0xfd')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0xfe'));db[_0x4b2d('0xff')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x100'));db[_0x4b2d('0x101')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x102'));db[_0x4b2d('0x103')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x104'));db[_0x4b2d('0x105')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x106'));db[_0x4b2d('0x107')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x108'));db[_0x4b2d('0x109')]=db['sequelize'][_0x4b2d('0x13')](_0x4b2d('0x10a'));db[_0x4b2d('0x10b')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x10c'));db[_0x4b2d('0x10d')]=db['sequelize']['import'](_0x4b2d('0x10e'));db[_0x4b2d('0x10f')]=db['sequelize']['import'](_0x4b2d('0x110'));db['WhatsappInteraction']=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x4b2d('0x111')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x112'));db[_0x4b2d('0x113')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x114'));db['WhatsappQueue']=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x4b2d('0x115')]=db['sequelize']['import'](_0x4b2d('0x116'));db[_0x4b2d('0x117')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')](_0x4b2d('0x118'));db[_0x4b2d('0x119')]=db[_0x4b2d('0x3')]['import'](_0x4b2d('0x11a'));db[_0x4b2d('0x11b')]=db[_0x4b2d('0x3')][_0x4b2d('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x4b2d('0x11c')]=db[_0x4b2d('0x3')]['import']('../api/user-setting/user-setting.model');db[_0x4b2d('0x12')][_0x4b2d('0x11d')](db['VoiceMail'],{'as':_0x4b2d('0x20'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x12')]['hasOne'](db['UserSetting'],{'as':_0x4b2d('0x120'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'UserId'});db[_0x4b2d('0x12')]['hasMany'](db['VoiceRecording'],{'as':'Recordings','foreignKey':'UserId'});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db['UserVoiceQueueRt'],{'as':_0x4b2d('0x122'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db[_0x4b2d('0x17')],{'as':_0x4b2d('0x123'),'onDelete':_0x4b2d('0x11e'),'hooks':!![]});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db['CmHopperFinal'],{'as':_0x4b2d('0x124'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x12')]['hasMany'](db[_0x4b2d('0x125')],{'as':_0x4b2d('0x126'),'foreignKey':'UserId'});db['User'][_0x4b2d('0x121')](db[_0x4b2d('0x7f')],{'as':_0x4b2d('0x7f'),'foreignKey':'UserId'});db[_0x4b2d('0x12')]['hasMany'](db[_0x4b2d('0x127')],{'as':_0x4b2d('0x128'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db[_0x4b2d('0x6d')],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db[_0x4b2d('0x5a')],{'as':_0x4b2d('0x129'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db[_0x4b2d('0x51')],{'as':'FaxInteractions','foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db[_0x4b2d('0x42')],{'as':_0x4b2d('0x12a'),'foreignKey':_0x4b2d('0x11f')});db['User'][_0x4b2d('0x121')](db[_0x4b2d('0x12b')],{'as':_0x4b2d('0x12c'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db[_0x4b2d('0x10b')],{'as':'UserNotifications','foreignKey':_0x4b2d('0x12d')});db[_0x4b2d('0x12')][_0x4b2d('0x121')](db['CmHopper'],{'as':_0x4b2d('0x12e'),'foreignKey':_0x4b2d('0x11f'),'onDelete':_0x4b2d('0x12f')});db[_0x4b2d('0x12')]['belongsTo'](db[_0x4b2d('0x105')],{'as':'UserProfile','foreignKey':_0x4b2d('0x130')});db['User']['belongsToMany'](db[_0x4b2d('0x73')],{'as':_0x4b2d('0x131'),'through':_0x4b2d('0x132')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x134'),'through':'cm_user_has_contacts'});db[_0x4b2d('0x12')]['belongsToMany'](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x135'),'through':_0x4b2d('0x136')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0xef')],{'through':_0x4b2d('0x137')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x42')],{'as':_0x4b2d('0x12a'),'through':_0x4b2d('0x138')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x6d')],{'as':_0x4b2d('0x139'),'through':_0x4b2d('0x13a')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x51')],{'as':_0x4b2d('0x13b'),'through':'user_has_fax_interactions'});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x5a')],{'as':_0x4b2d('0x129'),'through':_0x4b2d('0x13c')});db[_0x4b2d('0x12')]['belongsToMany'](db[_0x4b2d('0x127')],{'as':_0x4b2d('0x128'),'through':_0x4b2d('0x13d')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db['WhatsappInteraction'],{'as':_0x4b2d('0x12c'),'through':_0x4b2d('0x13e')});db[_0x4b2d('0x12')]['belongsToMany'](db['VoiceQueue'],{'as':_0x4b2d('0x13f'),'through':_0x4b2d('0x140'),'required':![]});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x103')],{'as':_0x4b2d('0x141'),'through':_0x4b2d('0x11b'),'required':![]});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x3e')],{'as':_0x4b2d('0x142'),'through':_0x4b2d('0x31'),'required':![]});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x71')],{'as':'ChatQueues','through':_0x4b2d('0x30'),'required':![],'hooks':!![]});db[_0x4b2d('0x12')]['belongsToMany'](db[_0x4b2d('0x54')],{'as':'FaxQueues','through':_0x4b2d('0x33'),'required':![]});db[_0x4b2d('0x12')]['belongsToMany'](db[_0x4b2d('0x5e')],{'as':_0x4b2d('0x143'),'through':_0x4b2d('0x35'),'required':![]});db['User']['belongsToMany'](db[_0x4b2d('0x66')],{'as':_0x4b2d('0x144'),'through':_0x4b2d('0x37'),'required':![]});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x145')],{'as':_0x4b2d('0x146'),'through':_0x4b2d('0x147'),'required':![]});db['User'][_0x4b2d('0x133')](db['CmList'],{'through':_0x4b2d('0x136')});db['User'][_0x4b2d('0x133')](db[_0x4b2d('0x148')],{'as':_0x4b2d('0x149'),'through':_0x4b2d('0x14a')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x4d')],{'as':_0x4b2d('0x14b'),'through':_0x4b2d('0x14c')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x3c')],{'as':_0x4b2d('0x14d'),'through':_0x4b2d('0x14e')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x60')],{'as':'OpenchannelAccounts','through':_0x4b2d('0x14f')});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x57')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x4b2d('0x12')][_0x4b2d('0x133')](db[_0x4b2d('0x10d')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x4b2d('0x150')][_0x4b2d('0x121')](db[_0x4b2d('0x17')],{'as':_0x4b2d('0x151'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x152')});db[_0x4b2d('0x153')][_0x4b2d('0x121')](db[_0x4b2d('0x17')],{'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x17')][_0x4b2d('0x121')](db[_0x4b2d('0x17')],{'as':_0x4b2d('0x154'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x18')][_0x4b2d('0x133')](db[_0x4b2d('0x155')],{'as':_0x4b2d('0x156'),'through':_0x4b2d('0x157')});db[_0x4b2d('0x1a')][_0x4b2d('0x121')](db['UserVoiceQueueRt'],{'as':_0x4b2d('0x158'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db['CmHopper'],{'as':_0x4b2d('0x12e'),'foreignKey':'VoiceQueueId'});db[_0x4b2d('0x1a')][_0x4b2d('0x121')](db[_0x4b2d('0x159')],{'as':_0x4b2d('0x124'),'foreignKey':_0x4b2d('0x15a')});db[_0x4b2d('0x1a')][_0x4b2d('0x121')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x4b2d('0x15a')});db['VoiceQueue'][_0x4b2d('0x121')](db['ReportAgentPreview'],{'as':_0x4b2d('0x7f'),'foreignKey':_0x4b2d('0x15a')});db[_0x4b2d('0x1a')][_0x4b2d('0x121')](db['CmHopperBlack'],{'as':_0x4b2d('0x15b'),'foreignKey':_0x4b2d('0x15a')});db[_0x4b2d('0x1a')]['hasMany'](db['JscriptySessionReport'],{'as':_0x4b2d('0x15c'),'foreignKey':_0x4b2d('0x15a')});db['VoiceQueue']['belongsTo'](db[_0x4b2d('0x2c')],{'as':_0x4b2d('0x2c'),'foreignKey':_0x4b2d('0x15d')});db['VoiceQueue'][_0x4b2d('0x15e')](db[_0x4b2d('0x2c')],{'as':_0x4b2d('0x15f'),'foreignKey':'TrunkBackupId'});db[_0x4b2d('0x1a')]['belongsTo'](db[_0x4b2d('0x8a')],{'as':'Interval','foreignKey':_0x4b2d('0x160')});db[_0x4b2d('0x1a')][_0x4b2d('0x15e')](db[_0x4b2d('0x8c')],{'as':_0x4b2d('0x161'),'foreignKey':_0x4b2d('0x162')});db[_0x4b2d('0x1a')][_0x4b2d('0x133')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x135'),'through':_0x4b2d('0x163')});db[_0x4b2d('0x1a')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x4b2d('0x140')});db[_0x4b2d('0x1a')]['belongsToMany'](db[_0x4b2d('0xef')],{'as':_0x4b2d('0x164'),'through':_0x4b2d('0x117')});db['VoiceQueue'][_0x4b2d('0x133')](db[_0x4b2d('0x101')],{'as':'BlackLists','through':_0x4b2d('0x165')});db[_0x4b2d('0x1c')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x12'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x1e')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x12'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x20')][_0x4b2d('0x121')](db[_0x4b2d('0x166')],{'as':_0x4b2d('0x167'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x168'),'sourceKey':_0x4b2d('0x169')});db[_0x4b2d('0x166')]['belongsTo'](db[_0x4b2d('0x20')],{'foreignKey':_0x4b2d('0x168'),'targetKey':_0x4b2d('0x169')});db[_0x4b2d('0x23')]['hasMany'](db[_0x4b2d('0x28')],{'as':_0x4b2d('0x16a'),'foreignKey':_0x4b2d('0x16b'),'constraints':![]});db[_0x4b2d('0x23')][_0x4b2d('0x121')](db[_0x4b2d('0x26')],{'as':_0x4b2d('0x16c'),'foreignKey':_0x4b2d('0x16b'),'constraints':![]});db[_0x4b2d('0x23')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x12'),'foreignKey':'UserId'});db[_0x4b2d('0x23')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x16d'),'foreignKey':'ContactId'});db['MailServerIn'][_0x4b2d('0x15e')](db['MailAccount'],{'as':_0x4b2d('0x3c'),'foreignKey':_0x4b2d('0x16e')});db['MailServerIn'][_0x4b2d('0x15e')](db[_0x4b2d('0x115')],{'as':_0x4b2d('0x115'),'foreignKey':'CloudProviderId','onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x3a')]['belongsTo'](db[_0x4b2d('0x3c')],{'as':_0x4b2d('0x3c'),'foreignKey':_0x4b2d('0x16e')});db[_0x4b2d('0x3a')][_0x4b2d('0x15e')](db[_0x4b2d('0x115')],{'as':_0x4b2d('0x115'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x4b2d('0x3c')]['hasOne'](db[_0x4b2d('0x39')],{'as':_0x4b2d('0x170'),'onDelete':'cascade'});db[_0x4b2d('0x3c')][_0x4b2d('0x11d')](db[_0x4b2d('0x3a')],{'as':_0x4b2d('0x171'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x3c')]['hasMany'](db[_0x4b2d('0x87')],{'as':_0x4b2d('0x172'),'foreignKey':_0x4b2d('0x16e'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x3c')][_0x4b2d('0x121')](db[_0x4b2d('0x173')],{'as':_0x4b2d('0x174'),'foreignKey':_0x4b2d('0x16e')});db['MailAccount'][_0x4b2d('0x121')](db['MailMessage'],{'as':_0x4b2d('0x167'),'foreignKey':'MailAccountId'});db[_0x4b2d('0x3c')][_0x4b2d('0x121')](db[_0x4b2d('0x42')],{'as':_0x4b2d('0x175')});db[_0x4b2d('0x3c')][_0x4b2d('0x121')](db[_0x4b2d('0x46')],{'as':'Applications','foreignKey':_0x4b2d('0x16e'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x3c')][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':_0x4b2d('0x177')});db['MailAccount'][_0x4b2d('0x15e')](db[_0x4b2d('0x9a')],{'as':_0x4b2d('0x9a'),'foreignKey':_0x4b2d('0x178')});db[_0x4b2d('0x3c')][_0x4b2d('0x15e')](db[_0x4b2d('0x8c')],{'as':_0x4b2d('0x161'),'foreignKey':_0x4b2d('0x162')});db[_0x4b2d('0x3c')]['belongsToMany'](db[_0x4b2d('0x12')],{'as':'Agents','through':_0x4b2d('0x14e')});db[_0x4b2d('0x3e')][_0x4b2d('0x133')](db['User'],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x31')});db[_0x4b2d('0x3e')][_0x4b2d('0x133')](db[_0x4b2d('0xef')],{'through':_0x4b2d('0x17a'),'as':_0x4b2d('0x164')});db[_0x4b2d('0x42')][_0x4b2d('0x121')](db[_0x4b2d('0x44')],{'as':_0x4b2d('0x167'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'MailInteractionId'});db[_0x4b2d('0x42')][_0x4b2d('0x15e')](db[_0x4b2d('0x3c')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x16e')});db[_0x4b2d('0x42')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x16d'),'foreignKey':_0x4b2d('0x17c')});db['MailInteraction'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x4b2d('0x42')][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x17d'),'as':_0x4b2d('0x17e')});db['MailInteraction'][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x17d'),'as':_0x4b2d('0x17f')});db[_0x4b2d('0x42')][_0x4b2d('0x133')](db['User'],{'as':_0x4b2d('0x180'),'through':_0x4b2d('0x138'),'foreignKey':_0x4b2d('0x181')});db[_0x4b2d('0x44')][_0x4b2d('0x121')](db[_0x4b2d('0x182')],{'as':_0x4b2d('0x183'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x44')][_0x4b2d('0x15e')](db['User'],{'as':_0x4b2d('0x12')});db[_0x4b2d('0x44')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'onDelete':_0x4b2d('0x11e'),'as':_0x4b2d('0x16d')});db[_0x4b2d('0x44')][_0x4b2d('0x15e')](db[_0x4b2d('0x42')],{'as':_0x4b2d('0x184'),'foreignKey':'MailInteractionId'});db[_0x4b2d('0x44')][_0x4b2d('0x15e')](db[_0x4b2d('0x3c')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x16e')});db[_0x4b2d('0x44')]['belongsTo'](db[_0x4b2d('0x148')],{'as':_0x4b2d('0x148'),'foreignKey':_0x4b2d('0x185')});db[_0x4b2d('0x44')][_0x4b2d('0x15e')](db['ChatOfflineMessage'],{'as':_0x4b2d('0x70'),'foreignKey':_0x4b2d('0x186')});db[_0x4b2d('0x46')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'onDelete':'restrict'});db[_0x4b2d('0x46')]['belongsTo'](db['MailQueue'],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x46')]['belongsTo'](db[_0x4b2d('0x3c')],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x46')][_0x4b2d('0x15e')](db[_0x4b2d('0x8a')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':'IntervalId'});db['MailApplication'][_0x4b2d('0x15e')](db[_0x4b2d('0x93')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':_0x4b2d('0x187')});db[_0x4b2d('0x48')][_0x4b2d('0x15e')](db[_0x4b2d('0x3c')],{});db['MailQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':_0x4b2d('0x177')});db['MailQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':'Contact','foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x48')][_0x4b2d('0x15e')](db[_0x4b2d('0x42')],{});db[_0x4b2d('0x48')][_0x4b2d('0x15e')](db[_0x4b2d('0x44')],{});db['MailQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{});db[_0x4b2d('0x48')][_0x4b2d('0x15e')](db['MailQueue'],{});db[_0x4b2d('0x188')][_0x4b2d('0x121')](db['DashboardItem'],{'as':_0x4b2d('0x189'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x4d')][_0x4b2d('0x121')](db[_0x4b2d('0x87')],{'as':_0x4b2d('0x172'),'foreignKey':_0x4b2d('0x18a'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db[_0x4b2d('0x173')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0x4b2d('0x4d')]['hasMany'](db[_0x4b2d('0x51')],{'as':_0x4b2d('0x175')});db['FaxAccount']['hasMany'](db['FaxApplication'],{'as':_0x4b2d('0x154'),'foreignKey':_0x4b2d('0x18a'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x4d')][_0x4b2d('0x121')](db[_0x4b2d('0x17')],{'as':_0x4b2d('0x18b'),'onDelete':_0x4b2d('0x11e')});db['FaxAccount'][_0x4b2d('0x121')](db[_0x4b2d('0x52')],{'as':_0x4b2d('0x167')});db['FaxAccount'][_0x4b2d('0x15e')](db[_0x4b2d('0x2c')],{'as':'Trunk'});db[_0x4b2d('0x4d')][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':'ListId'});db[_0x4b2d('0x4d')]['belongsTo'](db[_0x4b2d('0x8c')],{'as':_0x4b2d('0x161'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4b2d('0x4d')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x14c')});db[_0x4b2d('0x4f')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'onDelete':_0x4b2d('0x16f')});db['FaxApplication'][_0x4b2d('0x15e')](db[_0x4b2d('0x54')],{'onDelete':_0x4b2d('0x16f')});db['FaxApplication'][_0x4b2d('0x15e')](db[_0x4b2d('0x4d')],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x4f')][_0x4b2d('0x15e')](db[_0x4b2d('0x93')],{'onDelete':'restrict','foreignKey':_0x4b2d('0x187')});db['FaxInteraction'][_0x4b2d('0x121')](db[_0x4b2d('0x52')],{'as':_0x4b2d('0x167'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x4b2d('0x15e')](db[_0x4b2d('0x4d')],{'as':'Account','foreignKey':_0x4b2d('0x18a')});db[_0x4b2d('0x51')]['belongsTo'](db[_0x4b2d('0x78')],{'as':'Contact','foreignKey':_0x4b2d('0x17c')});db['FaxInteraction'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x18c'),'foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x51')]['belongsToMany'](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x18d'),'as':_0x4b2d('0x17e')});db[_0x4b2d('0x51')][_0x4b2d('0x133')](db['Tag'],{'through':_0x4b2d('0x18d'),'as':_0x4b2d('0x17f')});db[_0x4b2d('0x51')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x180'),'through':_0x4b2d('0x18e'),'foreignKey':'FaxInteractionId'});db[_0x4b2d('0x52')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'onDelete':_0x4b2d('0x11e'),'as':'User'});db[_0x4b2d('0x52')]['belongsTo'](db[_0x4b2d('0x51')],{'as':_0x4b2d('0x184'),'foreignKey':_0x4b2d('0x18f')});db[_0x4b2d('0x52')][_0x4b2d('0x15e')](db['CmContact'],{'onDelete':_0x4b2d('0x11e'),'as':_0x4b2d('0x16d')});db[_0x4b2d('0x52')][_0x4b2d('0x15e')](db[_0x4b2d('0x182')],{'as':_0x4b2d('0x182'),'foreignKey':_0x4b2d('0x190')});db[_0x4b2d('0x52')][_0x4b2d('0x15e')](db[_0x4b2d('0x4d')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x18a')});db[_0x4b2d('0x54')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x179'),'through':'UserFaxQueue'});db[_0x4b2d('0x54')]['belongsToMany'](db[_0x4b2d('0xef')],{'through':_0x4b2d('0x191'),'as':'Teams'});db[_0x4b2d('0x56')][_0x4b2d('0x15e')](db[_0x4b2d('0x4d')],{});db['FaxQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':'ListId'});db[_0x4b2d('0x56')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':'Contact','foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x56')]['belongsTo'](db[_0x4b2d('0x51')],{});db[_0x4b2d('0x56')][_0x4b2d('0x15e')](db[_0x4b2d('0x52')],{});db[_0x4b2d('0x56')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{});db[_0x4b2d('0x56')][_0x4b2d('0x15e')](db[_0x4b2d('0x54')],{});db[_0x4b2d('0x57')][_0x4b2d('0x121')](db[_0x4b2d('0x87')],{'as':_0x4b2d('0x172'),'foreignKey':_0x4b2d('0x192'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x57')][_0x4b2d('0x121')](db[_0x4b2d('0x173')],{'as':'Answers','foreignKey':_0x4b2d('0x192')});db[_0x4b2d('0x57')][_0x4b2d('0x121')](db[_0x4b2d('0x5c')],{'as':'Messages','foreignKey':_0x4b2d('0x192')});db[_0x4b2d('0x57')][_0x4b2d('0x121')](db[_0x4b2d('0x5a')],{'as':_0x4b2d('0x175')});db[_0x4b2d('0x57')]['hasMany'](db[_0x4b2d('0x59')],{'as':'Applications','foreignKey':_0x4b2d('0x192'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x57')][_0x4b2d('0x15e')](db['CmList'],{'as':'List','foreignKey':_0x4b2d('0x177')});db[_0x4b2d('0x57')][_0x4b2d('0x15e')](db[_0x4b2d('0x8c')],{'as':_0x4b2d('0x161'),'foreignKey':_0x4b2d('0x162')});db[_0x4b2d('0x57')]['belongsToMany'](db['User'],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x193')});db['SmsApplication'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x59')][_0x4b2d('0x15e')](db[_0x4b2d('0x5e')],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x59')][_0x4b2d('0x15e')](db[_0x4b2d('0x57')],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x59')][_0x4b2d('0x15e')](db[_0x4b2d('0x8a')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':_0x4b2d('0x160')});db[_0x4b2d('0x59')][_0x4b2d('0x15e')](db[_0x4b2d('0x93')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':_0x4b2d('0x187')});db[_0x4b2d('0x5a')][_0x4b2d('0x121')](db[_0x4b2d('0x5c')],{'as':'Messages','onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x194')});db[_0x4b2d('0x5a')][_0x4b2d('0x15e')](db[_0x4b2d('0x57')],{'as':_0x4b2d('0x17b'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':'Contact','foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x5a')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':'Owner','foreignKey':_0x4b2d('0x11f')});db[_0x4b2d('0x5a')][_0x4b2d('0x133')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x4b2d('0x17e')});db[_0x4b2d('0x5a')][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x195'),'as':_0x4b2d('0x17f')});db[_0x4b2d('0x5a')]['belongsToMany'](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x180'),'through':_0x4b2d('0x13c'),'foreignKey':_0x4b2d('0x194')});db['SmsMessage']['belongsTo'](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x12')});db[_0x4b2d('0x5c')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x4b2d('0x16d')});db[_0x4b2d('0x5c')]['belongsTo'](db[_0x4b2d('0x5a')],{'onDelete':_0x4b2d('0x11e'),'as':'Interaction','foreignKey':_0x4b2d('0x194')});db[_0x4b2d('0x5c')][_0x4b2d('0x15e')](db[_0x4b2d('0x57')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x192')});db['SmsQueue'][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':'Agents','through':_0x4b2d('0x35'),'foreignKey':_0x4b2d('0x196')});db['SmsQueue'][_0x4b2d('0x133')](db[_0x4b2d('0xef')],{'through':'team_has_sms_queues','as':_0x4b2d('0x164')});db['OpenchannelAccount'][_0x4b2d('0x121')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4b2d('0x197'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x60')]['hasMany'](db[_0x4b2d('0x173')],{'as':_0x4b2d('0x174'),'foreignKey':_0x4b2d('0x197')});db[_0x4b2d('0x60')]['hasMany'](db[_0x4b2d('0x127')],{'as':'Interactions','foreignKey':_0x4b2d('0x197')});db[_0x4b2d('0x60')][_0x4b2d('0x121')](db['OpenchannelMessage'],{'as':_0x4b2d('0x167'),'foreignKey':_0x4b2d('0x197')});db[_0x4b2d('0x60')][_0x4b2d('0x121')](db['OpenchannelApplication'],{'as':_0x4b2d('0x154'),'foreignKey':_0x4b2d('0x197'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x60')][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':_0x4b2d('0x177')});db[_0x4b2d('0x60')]['belongsTo'](db[_0x4b2d('0x8c')],{'as':_0x4b2d('0x161'),'foreignKey':_0x4b2d('0x162')});db['OpenchannelAccount'][_0x4b2d('0x133')](db['User'],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x14f')});db['OpenchannelApplication']['belongsTo'](db[_0x4b2d('0x12')],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x198')][_0x4b2d('0x15e')](db[_0x4b2d('0x66')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':'OpenchannelQueueId'});db[_0x4b2d('0x198')][_0x4b2d('0x15e')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x4b2d('0x197')});db[_0x4b2d('0x198')]['belongsTo'](db[_0x4b2d('0x8a')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':'IntervalId'});db[_0x4b2d('0x198')]['belongsTo'](db[_0x4b2d('0x93')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':_0x4b2d('0x187')});db['OpenchannelInteraction']['hasMany'](db['OpenchannelMessage'],{'as':_0x4b2d('0x167'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x199')});db['OpenchannelInteraction'][_0x4b2d('0x15e')](db[_0x4b2d('0x60')],{'as':'Account','foreignKey':_0x4b2d('0x197')});db[_0x4b2d('0x127')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x16d'),'foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x127')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x18c'),'foreignKey':'UserId'});db[_0x4b2d('0x127')][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db['OpenchannelInteraction'][_0x4b2d('0x133')](db['Tag'],{'through':_0x4b2d('0x19a'),'as':_0x4b2d('0x17f')});db[_0x4b2d('0x127')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x180'),'through':_0x4b2d('0x13d'),'foreignKey':_0x4b2d('0x199')});db[_0x4b2d('0x64')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'onDelete':'cascade','as':_0x4b2d('0x12')});db[_0x4b2d('0x64')]['belongsTo'](db[_0x4b2d('0x78')],{'onDelete':_0x4b2d('0x11e'),'as':_0x4b2d('0x16d')});db[_0x4b2d('0x64')][_0x4b2d('0x15e')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x4b2d('0x184'),'foreignKey':_0x4b2d('0x199')});db['OpenchannelMessage'][_0x4b2d('0x15e')](db[_0x4b2d('0x182')],{'as':'Attachment','foreignKey':_0x4b2d('0x190')});db[_0x4b2d('0x64')][_0x4b2d('0x15e')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x4b2d('0x197')});db[_0x4b2d('0x66')]['belongsToMany'](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x37'),'foreignKey':_0x4b2d('0x19b')});db[_0x4b2d('0x66')][_0x4b2d('0x133')](db[_0x4b2d('0xef')],{'through':_0x4b2d('0x19c'),'as':_0x4b2d('0x164')});db[_0x4b2d('0x148')]['hasMany'](db[_0x4b2d('0x87')],{'as':_0x4b2d('0x172'),'foreignKey':_0x4b2d('0x185'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x148')][_0x4b2d('0x121')](db[_0x4b2d('0x173')],{'as':_0x4b2d('0x174'),'foreignKey':_0x4b2d('0x185')});db[_0x4b2d('0x148')][_0x4b2d('0x121')](db[_0x4b2d('0x75')],{'as':_0x4b2d('0x19d')});db[_0x4b2d('0x148')][_0x4b2d('0x121')](db[_0x4b2d('0x6d')],{'as':_0x4b2d('0x175')});db[_0x4b2d('0x148')][_0x4b2d('0x121')](db[_0x4b2d('0x6b')],{'as':_0x4b2d('0x154'),'foreignKey':_0x4b2d('0x185'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x148')][_0x4b2d('0x121')](db[_0x4b2d('0x6e')],{'as':_0x4b2d('0x167')});db[_0x4b2d('0x148')][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':_0x4b2d('0x177')});db[_0x4b2d('0x148')][_0x4b2d('0x15e')](db[_0x4b2d('0x8a')],{'as':_0x4b2d('0x8a'),'foreignKey':'IntervalId'});db[_0x4b2d('0x148')][_0x4b2d('0x15e')](db['MailAccount'],{'as':_0x4b2d('0x3c'),'foreignKey':_0x4b2d('0x16e')});db[_0x4b2d('0x148')][_0x4b2d('0x15e')](db[_0x4b2d('0x8c')],{'as':_0x4b2d('0x161'),'foreignKey':_0x4b2d('0x162')});db['ChatWebsite'][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x14a')});db['OpenchannelQueueReport'][_0x4b2d('0x15e')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':_0x4b2d('0x177')});db[_0x4b2d('0x69')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x16d'),'foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x69')][_0x4b2d('0x15e')](db[_0x4b2d('0x127')],{});db[_0x4b2d('0x69')][_0x4b2d('0x15e')](db['OpenchannelMessage'],{});db[_0x4b2d('0x69')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{});db[_0x4b2d('0x69')]['belongsTo'](db[_0x4b2d('0x66')],{});db[_0x4b2d('0x6b')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x19e'),'foreignKey':_0x4b2d('0x11f'),'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x6b')]['belongsTo'](db['ChatQueue'],{'as':_0x4b2d('0x19f'),'foreignKey':_0x4b2d('0x1a0'),'onDelete':_0x4b2d('0x16f')});db['ChatApplication'][_0x4b2d('0x15e')](db[_0x4b2d('0x148')],{'as':_0x4b2d('0x1a1'),'foreignKey':_0x4b2d('0x185'),'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x6b')][_0x4b2d('0x15e')](db[_0x4b2d('0x93')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':'TagId'});db[_0x4b2d('0x6d')]['hasMany'](db[_0x4b2d('0x6e')],{'as':_0x4b2d('0x167'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'ChatInteractionId'});db[_0x4b2d('0x6d')][_0x4b2d('0x15e')](db[_0x4b2d('0x148')],{'as':_0x4b2d('0x17b'),'foreignKey':'ChatWebsiteId'});db[_0x4b2d('0x6d')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':'Contact','foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x6d')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x18c'),'foreignKey':'UserId'});db[_0x4b2d('0x6d')][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction'][_0x4b2d('0x133')](db['Tag'],{'through':_0x4b2d('0x1a2'),'as':_0x4b2d('0x17f')});db[_0x4b2d('0x6d')]['belongsToMany'](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x180'),'through':'user_has_chat_interactions','foreignKey':_0x4b2d('0x1a3')});db[_0x4b2d('0x6e')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'onDelete':'cascade','as':_0x4b2d('0x12')});db['ChatMessage'][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'onDelete':_0x4b2d('0x11e'),'as':'Contact','foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x6e')][_0x4b2d('0x15e')](db[_0x4b2d('0x6d')],{'onDelete':_0x4b2d('0x11e'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x4b2d('0x6e')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x4b2d('0x6e')][_0x4b2d('0x15e')](db['ChatWebsite'],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x185')});db[_0x4b2d('0x70')]['hasMany'](db[_0x4b2d('0x182')],{'as':_0x4b2d('0x183'),'foreignKey':_0x4b2d('0x186'),'onDelete':'cascade','hooks':!![]});db[_0x4b2d('0x70')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x70')]['belongsTo'](db[_0x4b2d('0x148')],{'as':_0x4b2d('0x17b'),'foreignKey':'ChatWebsiteId'});db[_0x4b2d('0x71')][_0x4b2d('0x133')](db['User'],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x30'),'hooks':!![]});db[_0x4b2d('0x71')][_0x4b2d('0x133')](db[_0x4b2d('0xef')],{'through':'team_has_chat_queues','as':_0x4b2d('0x164')});db['ChatGroup'][_0x4b2d('0x121')](db[_0x4b2d('0xda')],{'as':_0x4b2d('0x167'),'foreignKey':_0x4b2d('0x1a4'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x73')][_0x4b2d('0x133')](db['User'],{'as':_0x4b2d('0x158'),'through':'chat_group_has_users'});db[_0x4b2d('0x75')][_0x4b2d('0x15e')](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0x4b2d('0x1a5')][_0x4b2d('0x121')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x134'),'foreignKey':_0x4b2d('0x1a6')});db[_0x4b2d('0x78')][_0x4b2d('0x121')](db[_0x4b2d('0x1a7')],{'as':_0x4b2d('0x1a8'),'foreignKey':'CmContactId'});db[_0x4b2d('0x78')][_0x4b2d('0x121')](db[_0x4b2d('0x7a')],{'as':_0x4b2d('0x12e'),'foreignKey':_0x4b2d('0x17c')});db['CmContact']['hasMany'](db[_0x4b2d('0x159')],{'as':_0x4b2d('0x124'),'foreignKey':'ContactId'});db['CmContact'][_0x4b2d('0x121')](db['CmHopperHistory'],{'as':_0x4b2d('0x1a9'),'foreignKey':'ContactId'});db[_0x4b2d('0x78')]['hasMany'](db[_0x4b2d('0x7f')],{'as':'ReportAgentPreview','foreignKey':_0x4b2d('0x17c')});db['CmContact'][_0x4b2d('0x121')](db['JscriptySessionReport'],{'as':_0x4b2d('0x15c'),'foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x78')][_0x4b2d('0x121')](db[_0x4b2d('0x127')],{'as':_0x4b2d('0x128'),'foreignKey':_0x4b2d('0x17c'),'onDelete':_0x4b2d('0x16f')});db['CmContact'][_0x4b2d('0x121')](db[_0x4b2d('0x6d')],{'as':_0x4b2d('0x139'),'foreignKey':_0x4b2d('0x17c'),'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x78')][_0x4b2d('0x121')](db[_0x4b2d('0x5a')],{'as':_0x4b2d('0x129'),'foreignKey':_0x4b2d('0x17c'),'onDelete':'restrict'});db[_0x4b2d('0x78')][_0x4b2d('0x121')](db[_0x4b2d('0x51')],{'as':_0x4b2d('0x13b'),'foreignKey':'ContactId','onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x78')][_0x4b2d('0x121')](db[_0x4b2d('0x42')],{'as':'MailInteractions','foreignKey':_0x4b2d('0x17c'),'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x78')][_0x4b2d('0x15e')](db[_0x4b2d('0x1a5')],{'as':'Company','foreignKey':'CompanyId'});db[_0x4b2d('0x78')][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':'List','foreignKey':_0x4b2d('0x177'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x78')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x180'),'through':_0x4b2d('0x1aa')});db[_0x4b2d('0x78')][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x4b2d('0x78')]['belongsToMany'](db[_0x4b2d('0x93')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db['CmHopper']['hasMany'](db['CmHopperAdditionalPhone'],{'as':_0x4b2d('0x1ab'),'foreignKey':_0x4b2d('0x1ac')});db['CmHopper'][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x16d'),'foreignKey':_0x4b2d('0x17c'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x7a')]['belongsTo'](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x176'),'foreignKey':_0x4b2d('0x177'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x7a')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x19e'),'foreignKey':'UserId'});db[_0x4b2d('0x7a')][_0x4b2d('0x15e')](db['VoiceQueue'],{'as':_0x4b2d('0x19f'),'foreignKey':_0x4b2d('0x15a'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x7a')][_0x4b2d('0x15e')](db[_0x4b2d('0xf3')],{'as':_0x4b2d('0xf3'),'foreignKey':_0x4b2d('0x1ad'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x7a')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x18c'),'foreignKey':_0x4b2d('0x1ae')});db[_0x4b2d('0x7c')]['belongsTo'](db[_0x4b2d('0x78')],{'as':'Contact','foreignKey':_0x4b2d('0x17c'),'onDelete':'cascade'});db[_0x4b2d('0x7c')][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x4b2d('0x7c')][_0x4b2d('0x15e')](db['VoiceQueue'],{'as':_0x4b2d('0x19f'),'foreignKey':_0x4b2d('0x15a'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x7c')][_0x4b2d('0x15e')](db['Campaign'],{'as':'Campaign','foreignKey':_0x4b2d('0x1ad'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x84')][_0x4b2d('0x121')](db[_0x4b2d('0x88')],{'as':{'plural':'All','singular':_0x4b2d('0x1af')},'foreignKey':_0x4b2d('0x1b0'),'onDelete':_0x4b2d('0x11e'),'hooks':!![]});db[_0x4b2d('0x84')][_0x4b2d('0x121')](db[_0x4b2d('0x88')],{'as':{'plural':'Any','singular':_0x4b2d('0x1b1')},'foreignKey':_0x4b2d('0x1b2'),'onDelete':_0x4b2d('0x11e'),'hooks':!![]});db[_0x4b2d('0x84')][_0x4b2d('0x121')](db[_0x4b2d('0x82')],{'as':_0x4b2d('0x1b3'),'foreignKey':_0x4b2d('0x1b4'),'onDelete':_0x4b2d('0x11e'),'hooks':!![]});db['Disposition'][_0x4b2d('0x121')](db['Disposition'],{'as':_0x4b2d('0x172'),'foreignKey':_0x4b2d('0x1b5'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x8a')][_0x4b2d('0x121')](db[_0x4b2d('0x8a')],{'as':_0x4b2d('0x1b6'),'foreignKey':_0x4b2d('0x160'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x4b2d('0x8a')][_0x4b2d('0x121')](db[_0x4b2d('0x17')],{'as':'Extensions','foreignKey':_0x4b2d('0x160'),'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x8a')][_0x4b2d('0x121')](db[_0x4b2d('0x46')],{'as':_0x4b2d('0x1b7'),'foreignKey':_0x4b2d('0x160')});db[_0x4b2d('0x8a')][_0x4b2d('0x121')](db[_0x4b2d('0x6b')],{'as':_0x4b2d('0x1b8'),'foreignKey':_0x4b2d('0x160')});db['Interval'][_0x4b2d('0x121')](db['FaxApplication'],{'as':_0x4b2d('0x1b9'),'foreignKey':_0x4b2d('0x160')});db[_0x4b2d('0x8a')]['hasMany'](db[_0x4b2d('0x59')],{'as':_0x4b2d('0x1ba'),'foreignKey':_0x4b2d('0x160')});db[_0x4b2d('0x90')]['belongsTo'](db['MailAccount'],{});db['Schedule'][_0x4b2d('0x15e')](db[_0x4b2d('0xa3')],{'foreignKey':_0x4b2d('0x1bb')});db['Schedule'][_0x4b2d('0x15e')](db[_0x4b2d('0x1bc')],{'foreignKey':_0x4b2d('0x1bd')});db[_0x4b2d('0x155')][_0x4b2d('0x133')](db[_0x4b2d('0x18')],{'as':_0x4b2d('0x1be'),'through':_0x4b2d('0x157'),'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x93')][_0x4b2d('0x133')](db[_0x4b2d('0x78')],{'through':'cm_contact_has_tags'});db[_0x4b2d('0x93')][_0x4b2d('0x133')](db['ChatInteraction'],{'through':_0x4b2d('0x1a2')});db[_0x4b2d('0x93')]['belongsToMany'](db[_0x4b2d('0x42')],{'through':_0x4b2d('0x17d')});db[_0x4b2d('0x93')][_0x4b2d('0x133')](db[_0x4b2d('0x5a')],{'through':_0x4b2d('0x195')});db[_0x4b2d('0x93')][_0x4b2d('0x133')](db[_0x4b2d('0x51')],{'through':_0x4b2d('0x18d')});db[_0x4b2d('0x93')]['belongsToMany'](db[_0x4b2d('0x127')],{'through':_0x4b2d('0x19a')});db[_0x4b2d('0x93')][_0x4b2d('0x133')](db[_0x4b2d('0x12b')],{'through':_0x4b2d('0x1bf')});db[_0x4b2d('0x1a7')]['belongsTo'](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x4b2d('0x1c0')});db[_0x4b2d('0x98')][_0x4b2d('0x15e')](db[_0x4b2d('0x7a')],{'as':_0x4b2d('0x1c1'),'foreignKey':_0x4b2d('0x1ac')});db['CmContactHasItem'][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x16d'),'foreignKey':_0x4b2d('0x1c2')});db[_0x4b2d('0x9c')][_0x4b2d('0x121')](db[_0x4b2d('0x88')],{'as':{'plural':_0x4b2d('0x1c3'),'singular':_0x4b2d('0x1c4')},'foreignKey':_0x4b2d('0x1c5'),'onDelete':_0x4b2d('0x11e'),'hooks':!![]});db['Trigger'][_0x4b2d('0x121')](db[_0x4b2d('0x88')],{'as':{'plural':_0x4b2d('0x1c6'),'singular':_0x4b2d('0x1c7')},'foreignKey':_0x4b2d('0x1c8'),'onDelete':_0x4b2d('0x11e'),'hooks':!![]});db[_0x4b2d('0x9c')][_0x4b2d('0x121')](db[_0x4b2d('0x82')],{'as':_0x4b2d('0x1b3'),'foreignKey':_0x4b2d('0x1c9'),'onDelete':_0x4b2d('0x11e'),'hooks':!![]});db['AnalyticCustomReport'][_0x4b2d('0x121')](db[_0x4b2d('0x1ca')],{'as':_0x4b2d('0x1cb'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1bd'),'hooks':!![]});db[_0x4b2d('0xa3')]['hasMany'](db[_0x4b2d('0x1ca')],{'as':'Fields','onDelete':_0x4b2d('0x11e'),'foreignKey':'DefaultReportId'});db[_0x4b2d('0xa7')][_0x4b2d('0x121')](db[_0x4b2d('0x1ca')],{'as':_0x4b2d('0x1cb'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1cc')});db[_0x4b2d('0x1ca')][_0x4b2d('0x15e')](db[_0x4b2d('0xa7')],{'foreignKey':_0x4b2d('0x1cc')});db[_0x4b2d('0xab')][_0x4b2d('0x121')](db[_0x4b2d('0x1cd')],{'as':_0x4b2d('0x1ce'),'onDelete':'cascade','foreignKey':_0x4b2d('0x1cf')});db[_0x4b2d('0x1cd')][_0x4b2d('0x121')](db[_0x4b2d('0xad')],{'as':_0x4b2d('0x1d0'),'onDelete':'cascade','foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0x1cd')][_0x4b2d('0x121')](db['SalesforceField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x4b2d('0x1cd')][_0x4b2d('0x121')](db['SalesforceField'],{'as':_0x4b2d('0x1cb'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0x1cd')][_0x4b2d('0x15e')](db[_0x4b2d('0xab')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x1cf')});db[_0x4b2d('0xad')][_0x4b2d('0x121')](db[_0x4b2d('0xad')],{'as':_0x4b2d('0x1d3'),'foreignKey':'SubjectId'});db[_0x4b2d('0xad')][_0x4b2d('0x121')](db[_0x4b2d('0xad')],{'as':_0x4b2d('0x1d4'),'foreignKey':_0x4b2d('0x1d5')});db['SalesforceField'][_0x4b2d('0x121')](db[_0x4b2d('0xad')],{'as':_0x4b2d('0x1d6'),'foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0xad')][_0x4b2d('0x15e')](db[_0x4b2d('0x1d7')],{'as':_0x4b2d('0x1d7'),'foreignKey':'VariableId'});db[_0x4b2d('0xaf')]['hasMany'](db[_0x4b2d('0xb1')],{'as':'Configurations','onDelete':_0x4b2d('0x11e'),'foreignKey':'AccountId'});db[_0x4b2d('0xb1')]['hasMany'](db[_0x4b2d('0x1d8')],{'as':_0x4b2d('0x1d0'),'onDelete':'cascade','foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0xb1')][_0x4b2d('0x121')](db['SugarcrmField'],{'as':_0x4b2d('0x1d9'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'DescriptionId'});db[_0x4b2d('0xb1')][_0x4b2d('0x121')](db['SugarcrmField'],{'as':_0x4b2d('0x1cb'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'FieldId'});db[_0x4b2d('0xb1')][_0x4b2d('0x15e')](db[_0x4b2d('0xaf')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x1cf')});db[_0x4b2d('0x1d8')][_0x4b2d('0x121')](db['SugarcrmField'],{'as':_0x4b2d('0x1d3'),'foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0x1d8')]['hasMany'](db[_0x4b2d('0x1d8')],{'as':_0x4b2d('0x1d4'),'foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0x1d8')][_0x4b2d('0x121')](db['SugarcrmField'],{'as':_0x4b2d('0x1d6'),'foreignKey':'FieldId'});db[_0x4b2d('0x1d8')][_0x4b2d('0x15e')](db[_0x4b2d('0x1d7')],{'as':_0x4b2d('0x1d7'),'foreignKey':_0x4b2d('0x1da')});db[_0x4b2d('0xb4')][_0x4b2d('0x121')](db[_0x4b2d('0xb6')],{'as':_0x4b2d('0x1ce'),'onDelete':'cascade','foreignKey':_0x4b2d('0x1cf')});db['DeskConfiguration'][_0x4b2d('0x121')](db['DeskField'],{'as':_0x4b2d('0x1d0'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0xb6')][_0x4b2d('0x121')](db[_0x4b2d('0xb7')],{'as':'Descriptions','onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1d5')});db['DeskConfiguration'][_0x4b2d('0x121')](db['DeskField'],{'as':_0x4b2d('0x1cb'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1d2')});db['DeskConfiguration'][_0x4b2d('0x15e')](db['DeskAccount'],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x1cf')});db['DeskConfiguration']['belongsToMany'](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x1db')});db[_0x4b2d('0xb7')][_0x4b2d('0x121')](db[_0x4b2d('0xb7')],{'as':_0x4b2d('0x1d3'),'foreignKey':_0x4b2d('0x1d1')});db['DeskField'][_0x4b2d('0x121')](db[_0x4b2d('0xb7')],{'as':_0x4b2d('0x1d4'),'foreignKey':'DescriptionId'});db[_0x4b2d('0xb7')][_0x4b2d('0x121')](db[_0x4b2d('0xb7')],{'as':_0x4b2d('0x1d6'),'foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0xb7')]['belongsTo'](db[_0x4b2d('0x1d7')],{'as':_0x4b2d('0x1d7'),'foreignKey':_0x4b2d('0x1da')});db[_0x4b2d('0x1dc')]['hasMany'](db['ZohoConfiguration'],{'as':_0x4b2d('0x1ce'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1cf')});db[_0x4b2d('0xba')][_0x4b2d('0x121')](db['ZohoField'],{'as':_0x4b2d('0x1d0'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1d1')});db['ZohoConfiguration']['hasMany'](db[_0x4b2d('0xbb')],{'as':_0x4b2d('0x1d9'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'DescriptionId'});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0x4b2d('0x1cb'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'FieldId'});db[_0x4b2d('0xba')][_0x4b2d('0x15e')](db[_0x4b2d('0x1dc')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x1cf')});db[_0x4b2d('0xbb')][_0x4b2d('0x121')](db[_0x4b2d('0xbb')],{'as':_0x4b2d('0x1d3'),'foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0xbb')][_0x4b2d('0x121')](db['ZohoField'],{'as':_0x4b2d('0x1d4'),'foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0xbb')][_0x4b2d('0x121')](db['ZohoField'],{'as':_0x4b2d('0x1d6'),'foreignKey':'FieldId'});db[_0x4b2d('0xbb')][_0x4b2d('0x15e')](db[_0x4b2d('0x1d7')],{'as':'Variable','foreignKey':_0x4b2d('0x1da')});db[_0x4b2d('0xbd')][_0x4b2d('0x121')](db[_0x4b2d('0x1dd')],{'as':_0x4b2d('0x1ce'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x4b2d('0x121')](db[_0x4b2d('0x1de')],{'as':_0x4b2d('0x1d0'),'foreignKey':_0x4b2d('0x1d1')});db['ZendeskConfiguration'][_0x4b2d('0x121')](db['ZendeskField'],{'as':_0x4b2d('0x1d9'),'foreignKey':_0x4b2d('0x1d5')});db['ZendeskConfiguration']['hasMany'](db[_0x4b2d('0x1de')],{'as':'Fields','foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0x1dd')]['belongsTo'](db[_0x4b2d('0xbd')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x1cf')});db['ZendeskConfiguration'][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x1df')});db[_0x4b2d('0x1de')][_0x4b2d('0x121')](db[_0x4b2d('0x1de')],{'as':_0x4b2d('0x1d3'),'foreignKey':_0x4b2d('0x1d1')});db['ZendeskField'][_0x4b2d('0x121')](db['ZendeskField'],{'as':_0x4b2d('0x1d4'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0x4b2d('0x121')](db['ZendeskField'],{'as':'Field','foreignKey':_0x4b2d('0x1d2')});db['ZendeskField'][_0x4b2d('0x15e')](db['Variable'],{'as':_0x4b2d('0x1d7'),'foreignKey':_0x4b2d('0x1da')});db['FreshdeskAccount'][_0x4b2d('0x121')](db[_0x4b2d('0xc2')],{'as':_0x4b2d('0x1ce'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1cf')});db[_0x4b2d('0xc2')][_0x4b2d('0x121')](db[_0x4b2d('0xc4')],{'as':_0x4b2d('0x1d0'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0xc2')][_0x4b2d('0x121')](db['FreshdeskField'],{'as':_0x4b2d('0x1d9'),'onDelete':'cascade','foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0xc2')][_0x4b2d('0x121')](db['FreshdeskField'],{'as':_0x4b2d('0x1cb'),'onDelete':'cascade','foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0xc2')]['belongsTo'](db[_0x4b2d('0xc0')],{'as':'Account','foreignKey':'AccountId'});db[_0x4b2d('0xc2')][_0x4b2d('0x133')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0x4b2d('0xc4')]['hasMany'](db[_0x4b2d('0xc4')],{'as':_0x4b2d('0x1d3'),'foreignKey':_0x4b2d('0x1d1')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x4b2d('0x1d4'),'foreignKey':'DescriptionId'});db[_0x4b2d('0xc4')][_0x4b2d('0x121')](db['FreshdeskField'],{'as':_0x4b2d('0x1d6'),'foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0xc4')]['belongsTo'](db[_0x4b2d('0x1d7')],{'as':'Variable','foreignKey':_0x4b2d('0x1da')});db[_0x4b2d('0x1e0')][_0x4b2d('0x121')](db['VtigerConfiguration'],{'as':_0x4b2d('0x1ce'),'onDelete':'cascade','foreignKey':_0x4b2d('0x1cf')});db[_0x4b2d('0x1e1')][_0x4b2d('0x121')](db[_0x4b2d('0xc7')],{'as':_0x4b2d('0x1d0'),'foreignKey':_0x4b2d('0x1d1')});db['VtigerConfiguration'][_0x4b2d('0x121')](db[_0x4b2d('0xc7')],{'as':_0x4b2d('0x1d9'),'foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0x1e1')][_0x4b2d('0x121')](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db['VtigerConfiguration'][_0x4b2d('0x15e')](db[_0x4b2d('0x1e0')],{'as':_0x4b2d('0x17b'),'foreignKey':'AccountId'});db[_0x4b2d('0xc7')][_0x4b2d('0x121')](db[_0x4b2d('0xc7')],{'as':'Subject','foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0xc7')]['hasMany'](db[_0x4b2d('0xc7')],{'as':_0x4b2d('0x1d4'),'foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0xc7')]['hasMany'](db['VtigerField'],{'as':_0x4b2d('0x1d6'),'foreignKey':'FieldId'});db[_0x4b2d('0xc7')]['belongsTo'](db['Variable'],{'as':_0x4b2d('0x1d7'),'foreignKey':_0x4b2d('0x1da')});db[_0x4b2d('0xc9')]['hasMany'](db[_0x4b2d('0x1e2')],{'as':_0x4b2d('0x1ce'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'AccountId'});db[_0x4b2d('0x1e2')]['hasMany'](db[_0x4b2d('0xca')],{'as':_0x4b2d('0x1d0'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x4b2d('0x121')](db['ServicenowField'],{'as':_0x4b2d('0x1d9'),'foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0x1e2')][_0x4b2d('0x121')](db['ServicenowField'],{'as':_0x4b2d('0x1cb'),'foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0x1e2')][_0x4b2d('0x15e')](db[_0x4b2d('0xc9')],{'as':_0x4b2d('0x17b'),'foreignKey':'AccountId'});db[_0x4b2d('0xca')][_0x4b2d('0x121')](db[_0x4b2d('0xca')],{'as':_0x4b2d('0x1d3'),'foreignKey':'SubjectId'});db[_0x4b2d('0xca')][_0x4b2d('0x121')](db[_0x4b2d('0xca')],{'as':_0x4b2d('0x1d4'),'foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0xca')][_0x4b2d('0x121')](db[_0x4b2d('0xca')],{'as':_0x4b2d('0x1d6'),'foreignKey':'FieldId'});db[_0x4b2d('0xca')][_0x4b2d('0x15e')](db['Variable'],{'as':_0x4b2d('0x1d7'),'foreignKey':_0x4b2d('0x1da')});db[_0x4b2d('0xcc')][_0x4b2d('0x121')](db[_0x4b2d('0xce')],{'as':_0x4b2d('0x1ce'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x4b2d('0xcc')][_0x4b2d('0x15e')](db[_0x4b2d('0x115')],{'as':_0x4b2d('0x115'),'foreignKey':'CloudProviderId'});db[_0x4b2d('0xce')]['hasMany'](db[_0x4b2d('0xd0')],{'as':_0x4b2d('0x1d0'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'SubjectId'});db[_0x4b2d('0xce')][_0x4b2d('0x121')](db[_0x4b2d('0xd0')],{'as':_0x4b2d('0x1d9'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'DescriptionId'});db[_0x4b2d('0xce')]['hasMany'](db[_0x4b2d('0xd0')],{'as':_0x4b2d('0x1cb'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1d2')});db['Dynamics365Configuration'][_0x4b2d('0x15e')](db[_0x4b2d('0xcc')],{'as':_0x4b2d('0x17b'),'foreignKey':'AccountId'});db[_0x4b2d('0xd0')][_0x4b2d('0x121')](db[_0x4b2d('0xd0')],{'as':_0x4b2d('0x1d3'),'foreignKey':'SubjectId'});db[_0x4b2d('0xd0')]['hasMany'](db[_0x4b2d('0xd0')],{'as':_0x4b2d('0x1d4'),'foreignKey':_0x4b2d('0x1d5')});db[_0x4b2d('0xd0')][_0x4b2d('0x121')](db[_0x4b2d('0xd0')],{'as':_0x4b2d('0x1d6'),'foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0xd0')][_0x4b2d('0x15e')](db['Variable'],{'as':'Variable','foreignKey':_0x4b2d('0x1da')});db['FreshsalesAccount'][_0x4b2d('0x121')](db[_0x4b2d('0xd4')],{'as':_0x4b2d('0x1ce'),'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1cf')});db['FreshsalesConfiguration'][_0x4b2d('0x121')](db[_0x4b2d('0xd6')],{'as':_0x4b2d('0x1d0'),'foreignKey':_0x4b2d('0x1d1')});db[_0x4b2d('0xd4')][_0x4b2d('0x121')](db[_0x4b2d('0xd6')],{'as':_0x4b2d('0x1d9'),'foreignKey':'DescriptionId'});db[_0x4b2d('0xd4')]['hasMany'](db[_0x4b2d('0xd6')],{'as':'Fields','foreignKey':_0x4b2d('0x1d2')});db[_0x4b2d('0xd4')]['belongsTo'](db[_0x4b2d('0xd2')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x1cf')});db['FreshsalesField'][_0x4b2d('0x121')](db[_0x4b2d('0xd6')],{'as':'Subject','foreignKey':_0x4b2d('0x1d1')});db['FreshsalesField'][_0x4b2d('0x121')](db[_0x4b2d('0xd6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4b2d('0xd6')]['hasMany'](db[_0x4b2d('0xd6')],{'as':_0x4b2d('0x1d6'),'foreignKey':_0x4b2d('0x1d2')});db['FreshsalesField'][_0x4b2d('0x15e')](db['Variable'],{'as':_0x4b2d('0x1d7'),'foreignKey':_0x4b2d('0x1da')});db[_0x4b2d('0xd8')][_0x4b2d('0x15e')](db['ChatWebsite'],{});db[_0x4b2d('0xd8')][_0x4b2d('0x15e')](db['CmList'],{'as':_0x4b2d('0x176'),'foreignKey':_0x4b2d('0x177')});db['ChatQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':_0x4b2d('0x16d'),'foreignKey':'ContactId'});db[_0x4b2d('0xd8')][_0x4b2d('0x15e')](db[_0x4b2d('0x6d')],{});db[_0x4b2d('0xd8')][_0x4b2d('0x15e')](db[_0x4b2d('0x6e')],{});db[_0x4b2d('0xd8')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{});db['ChatQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x71')],{});db[_0x4b2d('0xda')]['belongsTo'](db['User'],{'onDelete':_0x4b2d('0x11e'),'foreignKey':'FromId'});db[_0x4b2d('0xda')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'onDelete':_0x4b2d('0x11e'),'foreignKey':_0x4b2d('0x1e3')});db[_0x4b2d('0xde')][_0x4b2d('0x121')](db[_0x4b2d('0xdc')],{'foreignKey':_0x4b2d('0x1e4'),'onDelete':'cascade'});db[_0x4b2d('0xde')][_0x4b2d('0x121')](db['JscriptyAnswerReport'],{'foreignKey':_0x4b2d('0x1e4'),'onDelete':'cascade'});db[_0x4b2d('0xe0')][_0x4b2d('0x15e')](db[_0x4b2d('0x57')],{});db[_0x4b2d('0xe0')][_0x4b2d('0x15e')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x4b2d('0xe0')][_0x4b2d('0x15e')](db['CmContact'],{'as':_0x4b2d('0x16d'),'foreignKey':_0x4b2d('0x17c')});db['SmsQueueReport']['belongsTo'](db[_0x4b2d('0x5a')],{});db['SmsQueueReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x5c')],{});db[_0x4b2d('0xe0')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{});db[_0x4b2d('0xe0')][_0x4b2d('0x15e')](db[_0x4b2d('0x5e')],{});db[_0x4b2d('0xe5')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x4b2d('0x1e5')});db[_0x4b2d('0xe5')][_0x4b2d('0x121')](db['JscriptyQuestionReport'],{'foreignKey':_0x4b2d('0x1e5')});db[_0x4b2d('0xe5')][_0x4b2d('0x121')](db['JscriptyAnswerReport'],{'foreignKey':_0x4b2d('0x1e5')});db[_0x4b2d('0xef')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':'Agents','through':_0x4b2d('0x137')});db[_0x4b2d('0xef')]['belongsToMany'](db[_0x4b2d('0x1a')],{'through':'TeamVoiceQueue','as':_0x4b2d('0x13f')});db['Team'][_0x4b2d('0x133')](db[_0x4b2d('0x3e')],{'through':'team_has_mail_queues','as':_0x4b2d('0x142')});db[_0x4b2d('0xef')][_0x4b2d('0x133')](db[_0x4b2d('0x71')],{'through':_0x4b2d('0x1e6'),'as':'ChatQueues'});db['Team'][_0x4b2d('0x133')](db[_0x4b2d('0x54')],{'through':_0x4b2d('0x191'),'as':'FaxQueues'});db[_0x4b2d('0xef')][_0x4b2d('0x133')](db[_0x4b2d('0x5e')],{'through':_0x4b2d('0x1e7'),'as':_0x4b2d('0x143')});db[_0x4b2d('0xef')][_0x4b2d('0x133')](db[_0x4b2d('0x66')],{'through':_0x4b2d('0x19c'),'as':'OpenchannelQueues'});db[_0x4b2d('0xef')][_0x4b2d('0x133')](db[_0x4b2d('0x145')],{'through':'team_has_whatsapp_queues','as':_0x4b2d('0x146')});db['Team'][_0x4b2d('0x133')](db[_0x4b2d('0x103')],{'through':_0x4b2d('0x119'),'as':'VoicePrefixes'});db[_0x4b2d('0xf3')][_0x4b2d('0x121')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x4b2d('0x1ad')});db[_0x4b2d('0xf3')]['hasMany'](db[_0x4b2d('0x159')],{'as':_0x4b2d('0x124'),'foreignKey':_0x4b2d('0x1ad')});db[_0x4b2d('0xf3')][_0x4b2d('0x121')](db[_0x4b2d('0x125')],{'as':_0x4b2d('0x1a9'),'foreignKey':_0x4b2d('0x1ad')});db[_0x4b2d('0xf3')][_0x4b2d('0x121')](db[_0x4b2d('0x7c')],{'as':_0x4b2d('0x15b'),'foreignKey':_0x4b2d('0x1ad')});db[_0x4b2d('0xf3')][_0x4b2d('0x15e')](db['Trunk'],{'as':_0x4b2d('0x2c'),'foreignKey':_0x4b2d('0x15d')});db[_0x4b2d('0xf3')][_0x4b2d('0x15e')](db['Trunk'],{'as':_0x4b2d('0x15f'),'foreignKey':_0x4b2d('0x1e8')});db['Campaign'][_0x4b2d('0x15e')](db[_0x4b2d('0x8a')],{'as':_0x4b2d('0x8a'),'foreignKey':_0x4b2d('0x160')});db[_0x4b2d('0xf3')][_0x4b2d('0x15e')](db[_0x4b2d('0xe9')],{'as':'SquareProject','foreignKey':_0x4b2d('0x1e9')});db[_0x4b2d('0xf3')][_0x4b2d('0x133')](db[_0x4b2d('0x101')],{'as':_0x4b2d('0x135'),'through':_0x4b2d('0x1ea')});db[_0x4b2d('0xf3')][_0x4b2d('0x133')](db[_0x4b2d('0x101')],{'as':'BlackLists','through':_0x4b2d('0x1eb')});db[_0x4b2d('0x182')]['belongsTo'](db[_0x4b2d('0x70')],{'as':_0x4b2d('0x70'),'foreignKey':_0x4b2d('0x186')});db[_0x4b2d('0xf9')]['belongsTo'](db[_0x4b2d('0x44')],{});db[_0x4b2d('0xf9')][_0x4b2d('0x15e')](db['MailInteraction'],{});db[_0x4b2d('0xf9')]['belongsTo'](db[_0x4b2d('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x4b2d('0x1ec')});db['MailTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ed'),'as':_0x4b2d('0x1ee')});db[_0x4b2d('0xf9')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ef'),'as':_0x4b2d('0x1f0')});db['MailTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x3e')],{'foreignKey':_0x4b2d('0x1f1'),'as':_0x4b2d('0x1f2')});db['MailTransferReport']['belongsTo'](db[_0x4b2d('0x3c')],{'foreignKey':_0x4b2d('0x1f3'),'as':_0x4b2d('0x1f4')});db[_0x4b2d('0xfb')][_0x4b2d('0x15e')](db[_0x4b2d('0x6e')],{});db[_0x4b2d('0xfb')][_0x4b2d('0x15e')](db[_0x4b2d('0x6d')],{});db[_0x4b2d('0xfb')][_0x4b2d('0x15e')](db[_0x4b2d('0x148')],{'foreignKey':_0x4b2d('0x1f5'),'as':_0x4b2d('0x1ec')});db[_0x4b2d('0xfb')]['belongsTo'](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ed'),'as':_0x4b2d('0x1ee')});db['ChatTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ef'),'as':'ToAgent'});db[_0x4b2d('0xfb')]['belongsTo'](db[_0x4b2d('0x71')],{'foreignKey':_0x4b2d('0x1f6'),'as':_0x4b2d('0x1f2')});db['ChatTransferReport']['belongsTo'](db[_0x4b2d('0x148')],{'foreignKey':'ToChatWebsiteId','as':_0x4b2d('0x1f4')});db[_0x4b2d('0x1f7')][_0x4b2d('0x15e')](db[_0x4b2d('0x52')],{});db['FaxTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x51')],{});db[_0x4b2d('0x1f7')][_0x4b2d('0x15e')](db[_0x4b2d('0x4d')],{'foreignKey':'FromFaxAccountId','as':_0x4b2d('0x1ec')});db[_0x4b2d('0x1f7')]['belongsTo'](db[_0x4b2d('0x12')],{'foreignKey':'FromUserId','as':_0x4b2d('0x1ee')});db['FaxTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ef'),'as':'ToAgent'});db[_0x4b2d('0x1f7')][_0x4b2d('0x15e')](db[_0x4b2d('0x54')],{'foreignKey':_0x4b2d('0x1f8'),'as':_0x4b2d('0x1f2')});db[_0x4b2d('0x1f7')][_0x4b2d('0x15e')](db[_0x4b2d('0x4d')],{'foreignKey':'ToFaxAccountId','as':_0x4b2d('0x1f4')});db[_0x4b2d('0xfd')][_0x4b2d('0x15e')](db[_0x4b2d('0x64')],{});db[_0x4b2d('0xfd')][_0x4b2d('0x15e')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x4b2d('0x15e')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x4b2d('0x1ec')});db['OpenchannelTransferReport'][_0x4b2d('0x15e')](db['User'],{'foreignKey':_0x4b2d('0x1ed'),'as':_0x4b2d('0x1ee')});db[_0x4b2d('0xfd')]['belongsTo'](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ef'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x66')],{'foreignKey':_0x4b2d('0x1f9'),'as':_0x4b2d('0x1f2')});db['OpenchannelTransferReport']['belongsTo'](db[_0x4b2d('0x60')],{'foreignKey':_0x4b2d('0x1fa'),'as':_0x4b2d('0x1f4')});db[_0x4b2d('0xff')][_0x4b2d('0x15e')](db[_0x4b2d('0x5c')],{});db[_0x4b2d('0xff')]['belongsTo'](db[_0x4b2d('0x5a')],{});db[_0x4b2d('0xff')][_0x4b2d('0x15e')](db[_0x4b2d('0x57')],{'foreignKey':'FromSmsAccountId','as':_0x4b2d('0x1ec')});db[_0x4b2d('0xff')]['belongsTo'](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ed'),'as':_0x4b2d('0x1ee')});db[_0x4b2d('0xff')][_0x4b2d('0x15e')](db['User'],{'foreignKey':_0x4b2d('0x1ef'),'as':_0x4b2d('0x1f0')});db[_0x4b2d('0xff')][_0x4b2d('0x15e')](db[_0x4b2d('0x5e')],{'foreignKey':_0x4b2d('0x1fb'),'as':_0x4b2d('0x1f2')});db[_0x4b2d('0xff')][_0x4b2d('0x15e')](db[_0x4b2d('0x57')],{'foreignKey':_0x4b2d('0x1fc'),'as':_0x4b2d('0x1f4')});db[_0x4b2d('0x101')]['hasMany'](db[_0x4b2d('0x87')],{'as':_0x4b2d('0x172'),'foreignKey':_0x4b2d('0x177'),'onDelete':_0x4b2d('0x11e')});db[_0x4b2d('0x101')][_0x4b2d('0x121')](db[_0x4b2d('0x80')],{'as':_0x4b2d('0x1fd'),'foreignKey':_0x4b2d('0x177')});db[_0x4b2d('0x101')][_0x4b2d('0x121')](db['CmContact'],{'as':_0x4b2d('0x134'),'onDelete':_0x4b2d('0x11e'),'foreignKey':'ListId'});db[_0x4b2d('0x101')][_0x4b2d('0x121')](db[_0x4b2d('0x159')],{'as':_0x4b2d('0x124'),'foreignKey':_0x4b2d('0x177')});db['CmList'][_0x4b2d('0x121')](db[_0x4b2d('0x125')],{'as':_0x4b2d('0x126'),'foreignKey':_0x4b2d('0x177')});db[_0x4b2d('0x101')]['hasMany'](db[_0x4b2d('0x7f')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x4b2d('0x101')][_0x4b2d('0x133')](db[_0x4b2d('0x1a')],{'as':_0x4b2d('0x1fe'),'through':_0x4b2d('0x163')});db[_0x4b2d('0x101')][_0x4b2d('0x133')](db['User'],{'as':_0x4b2d('0x179'),'through':_0x4b2d('0x136')});db[_0x4b2d('0x103')]['hasMany'](db[_0x4b2d('0x17')],{'as':_0x4b2d('0x123'),'onDelete':'cascade'});db[_0x4b2d('0x103')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':'Agents','through':'UserVoicePrefix'});db[_0x4b2d('0x103')][_0x4b2d('0x133')](db[_0x4b2d('0xef')],{'through':'TeamVoicePrefix','as':_0x4b2d('0x164')});db[_0x4b2d('0x105')][_0x4b2d('0x121')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x180'),'foreignKey':_0x4b2d('0x130')});db['UserProfile'][_0x4b2d('0x121')](db['UserProfileSection'],{'as':_0x4b2d('0x1ff'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0x4b2d('0x107')][_0x4b2d('0x121')](db[_0x4b2d('0x109')],{'as':'Resources','foreignKey':_0x4b2d('0x200'),'onDelete':'cascade'});db[_0x4b2d('0x10d')][_0x4b2d('0x121')](db[_0x4b2d('0x87')],{'as':_0x4b2d('0x172'),'foreignKey':_0x4b2d('0x201'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0x4b2d('0x173')],{'as':_0x4b2d('0x174'),'foreignKey':_0x4b2d('0x201')});db[_0x4b2d('0x10d')][_0x4b2d('0x121')](db[_0x4b2d('0x111')],{'as':_0x4b2d('0x167'),'foreignKey':'WhatsappAccountId'});db[_0x4b2d('0x10d')]['hasMany'](db[_0x4b2d('0x12b')],{'as':_0x4b2d('0x175')});db[_0x4b2d('0x10d')][_0x4b2d('0x121')](db['WhatsappApplication'],{'as':_0x4b2d('0x154'),'foreignKey':_0x4b2d('0x201'),'onDelete':'cascade'});db[_0x4b2d('0x10d')][_0x4b2d('0x15e')](db[_0x4b2d('0x101')],{'as':'List','foreignKey':'ListId'});db['WhatsappAccount'][_0x4b2d('0x15e')](db[_0x4b2d('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':_0x4b2d('0x162')});db[_0x4b2d('0x10d')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':'Agents','through':_0x4b2d('0x202')});db[_0x4b2d('0x10f')][_0x4b2d('0x15e')](db['User'],{'onDelete':'restrict'});db[_0x4b2d('0x10f')][_0x4b2d('0x15e')](db[_0x4b2d('0x145')],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x10f')][_0x4b2d('0x15e')](db['WhatsappAccount'],{'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x10f')][_0x4b2d('0x15e')](db['Interval'],{'onDelete':_0x4b2d('0x16f'),'foreignKey':_0x4b2d('0x160')});db['WhatsappApplication']['belongsTo'](db[_0x4b2d('0x93')],{'onDelete':_0x4b2d('0x16f'),'foreignKey':'TagId'});db[_0x4b2d('0x12b')][_0x4b2d('0x121')](db['WhatsappMessage'],{'as':_0x4b2d('0x167'),'onDelete':'cascade','foreignKey':_0x4b2d('0x203')});db[_0x4b2d('0x12b')]['belongsTo'](db[_0x4b2d('0x10d')],{'as':_0x4b2d('0x17b'),'foreignKey':'WhatsappAccountId'});db[_0x4b2d('0x12b')]['belongsTo'](db['CmContact'],{'as':_0x4b2d('0x16d'),'foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x12b')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x18c'),'foreignKey':_0x4b2d('0x11f')});db['WhatsappInteraction'][_0x4b2d('0x133')](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x1bf'),'as':'Tags'});db[_0x4b2d('0x12b')]['belongsToMany'](db[_0x4b2d('0x93')],{'through':_0x4b2d('0x1bf'),'as':_0x4b2d('0x17f')});db[_0x4b2d('0x12b')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x180'),'through':_0x4b2d('0x13e'),'foreignKey':_0x4b2d('0x203')});db['WhatsappMessage']['belongsTo'](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x12')});db[_0x4b2d('0x111')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'onDelete':_0x4b2d('0x11e'),'as':'Contact'});db[_0x4b2d('0x111')][_0x4b2d('0x15e')](db[_0x4b2d('0x12b')],{'onDelete':_0x4b2d('0x11e'),'as':'Interaction','foreignKey':_0x4b2d('0x203')});db[_0x4b2d('0x111')][_0x4b2d('0x15e')](db[_0x4b2d('0x10d')],{'as':_0x4b2d('0x17b'),'foreignKey':_0x4b2d('0x201')});db[_0x4b2d('0x204')][_0x4b2d('0x15e')](db[_0x4b2d('0x10d')],{});db[_0x4b2d('0x204')][_0x4b2d('0x15e')](db['CmList'],{'as':_0x4b2d('0x176'),'foreignKey':'ListId'});db[_0x4b2d('0x204')][_0x4b2d('0x15e')](db[_0x4b2d('0x78')],{'as':'Contact','foreignKey':_0x4b2d('0x17c')});db[_0x4b2d('0x204')][_0x4b2d('0x15e')](db[_0x4b2d('0x12b')],{});db[_0x4b2d('0x204')][_0x4b2d('0x15e')](db[_0x4b2d('0x145')],{});db[_0x4b2d('0x204')][_0x4b2d('0x15e')](db[_0x4b2d('0x111')],{});db[_0x4b2d('0x204')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{});db['WhatsappTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x111')],{});db[_0x4b2d('0x113')]['belongsTo'](db[_0x4b2d('0x12b')],{});db[_0x4b2d('0x113')]['belongsTo'](db[_0x4b2d('0x10d')],{'foreignKey':_0x4b2d('0x205'),'as':_0x4b2d('0x1ec')});db['WhatsappTransferReport']['belongsTo'](db[_0x4b2d('0x10d')],{'foreignKey':'ToWhatsappAccountId','as':_0x4b2d('0x1f4')});db['WhatsappTransferReport'][_0x4b2d('0x15e')](db[_0x4b2d('0x145')],{'foreignKey':_0x4b2d('0x206'),'as':_0x4b2d('0x1f2')});db[_0x4b2d('0x113')][_0x4b2d('0x15e')](db['User'],{'foreignKey':_0x4b2d('0x1ed'),'as':_0x4b2d('0x1ee')});db[_0x4b2d('0x113')][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'foreignKey':_0x4b2d('0x1ef'),'as':_0x4b2d('0x1f0')});db[_0x4b2d('0x145')][_0x4b2d('0x133')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x179'),'through':'UserWhatsappQueue','foreignKey':_0x4b2d('0x207')});db[_0x4b2d('0x145')][_0x4b2d('0x133')](db[_0x4b2d('0xef')],{'through':_0x4b2d('0x208'),'as':'Teams'});db['UserSetting'][_0x4b2d('0x15e')](db[_0x4b2d('0x12')],{'as':_0x4b2d('0x209'),'foreignKey':'UserId','onDelete':'cascade','hooks':!![]});db[_0x4b2d('0x115')][_0x4b2d('0x11d')](db['Dynamics365Account'],{'as':_0x4b2d('0xcc'),'onDelete':_0x4b2d('0x16f')});db[_0x4b2d('0x115')]['hasOne'](db[_0x4b2d('0x39')],{'as':_0x4b2d('0x170'),'onDelete':_0x4b2d('0x16f')});db['CloudProvider'][_0x4b2d('0x11d')](db['MailServerOut'],{'as':'Smtp','onDelete':'restrict'});module[_0x4b2d('0x20a')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 86dfb1e..550ad87 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf5a=['/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/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/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','route','get','resolve','appPath','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./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/condition','/api/intervals','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','./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/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./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/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/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/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix'];(function(_0x5dfdd9,_0x2b5aa0){var _0x50a563=function(_0x529a20){while(--_0x529a20){_0x5dfdd9['push'](_0x5dfdd9['shift']());}};_0x50a563(++_0x2b5aa0);}(_0xaf5a,0x144));var _0xaaf5=function(_0x31da33,_0x5aab94){_0x31da33=_0x31da33-0x0;var _0x7ec2a2=_0xaf5a[_0x31da33];return _0x7ec2a2;};'use strict';var path=require('path');var express=require(_0xaaf5('0x0'));var errors=require('./errors');var config=require(_0xaaf5('0x1'));var setupLoggers=require(_0xaaf5('0x2'))[_0xaaf5('0x3')];var clientSideLogs=require(_0xaaf5('0x4'));exports[_0xaaf5('0x5')]=function(_0x277e58){return setupLoggers(_0x277e58)[_0xaaf5('0x6')](function(){_0x277e58[_0xaaf5('0x7')]('/api/users',require(_0xaaf5('0x8')));_0x277e58['use'](_0xaaf5('0x9'),require(_0xaaf5('0xa')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xb'),require(_0xaaf5('0xc')));_0x277e58['use'](_0xaaf5('0xd'),require(_0xaaf5('0xe')));_0x277e58[_0xaaf5('0x7')]('/api/voice/mohs',require(_0xaaf5('0xf')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x10'),require(_0xaaf5('0x11')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x12'),require(_0xaaf5('0x13')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x14'),require(_0xaaf5('0x15')));_0x277e58['use'](_0xaaf5('0x16'),require(_0xaaf5('0x17')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x18'),require(_0xaaf5('0x19')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x1a'),require(_0xaaf5('0x1b')));_0x277e58['use']('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x1c'),require('./api/voiceAgentReport'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x1d'),require(_0xaaf5('0x1e')));_0x277e58['use']('/api/members/reports',require(_0xaaf5('0x1f')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x20'),require(_0xaaf5('0x21')));_0x277e58[_0xaaf5('0x7')]('/api/voice/transfers/reports',require(_0xaaf5('0x22')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x23'),require(_0xaaf5('0x24')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x25'),require(_0xaaf5('0x26')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x27'),require('./api/mailQueue'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x28'),require(_0xaaf5('0x29')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x2a'),require(_0xaaf5('0x2b')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x2c'),require('./api/mailMessage'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x2d'),require(_0xaaf5('0x2e')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x2f'),require(_0xaaf5('0x30')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x31'),require(_0xaaf5('0x32')));_0x277e58[_0xaaf5('0x7')]('/api/dashboards/items',require(_0xaaf5('0x33')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x34'),require(_0xaaf5('0x35')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x36'),require(_0xaaf5('0x37')));_0x277e58['use'](_0xaaf5('0x38'),require(_0xaaf5('0x39')));_0x277e58[_0xaaf5('0x7')]('/api/fax/messages',require('./api/faxMessage'));_0x277e58[_0xaaf5('0x7')]('/api/fax/queues',require(_0xaaf5('0x3a')));_0x277e58['use'](_0xaaf5('0x3b'),require(_0xaaf5('0x3c')));_0x277e58['use']('/api/sms/accounts',require('./api/smsAccount'));_0x277e58['use'](_0xaaf5('0x3d'),require(_0xaaf5('0x3e')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x3f'),require(_0xaaf5('0x40')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x41'),require('./api/smsMessage'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x42'),require(_0xaaf5('0x43')));_0x277e58[_0xaaf5('0x7')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x44'),require('./api/openchannelApplication'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x45'),require('./api/openchannelInteraction'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x46'),require(_0xaaf5('0x47')));_0x277e58['use'](_0xaaf5('0x48'),require(_0xaaf5('0x49')));_0x277e58['use'](_0xaaf5('0x4a'),require('./api/chatWebsite'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x4b'),require(_0xaaf5('0x4c')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x4d'),require('./api/chatApplication'));_0x277e58[_0xaaf5('0x7')]('/api/chat/interactions',require(_0xaaf5('0x4e')));_0x277e58[_0xaaf5('0x7')]('/api/chat/messages',require(_0xaaf5('0x4f')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x50'),require(_0xaaf5('0x51')));_0x277e58['use']('/api/chat/queues',require(_0xaaf5('0x52')));_0x277e58['use'](_0xaaf5('0x53'),require('./api/chatGroup'));_0x277e58['use']('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x277e58['use'](_0xaaf5('0x54'),require(_0xaaf5('0x55')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x56'),require(_0xaaf5('0x57')));_0x277e58['use'](_0xaaf5('0x58'),require(_0xaaf5('0x59')));_0x277e58['use'](_0xaaf5('0x5a'),require('./api/cmHopperBlack'));_0x277e58['use'](_0xaaf5('0x5b'),require(_0xaaf5('0x5c')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x5d'),require(_0xaaf5('0x5e')));_0x277e58['use']('/api/cm/custom_fields',require(_0xaaf5('0x5f')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x60'),require(_0xaaf5('0x61')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x62'),require(_0xaaf5('0x63')));_0x277e58['use'](_0xaaf5('0x64'),require(_0xaaf5('0x65')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x66'),require('./api/disposition'));_0x277e58[_0xaaf5('0x7')]('/api/conditions',require(_0xaaf5('0x67')));_0x277e58['use'](_0xaaf5('0x68'),require('./api/interval'));_0x277e58['use']('/api/pauses',require('./api/pause'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x69'),require(_0xaaf5('0x6a')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x6b'),require(_0xaaf5('0x6c')));_0x277e58[_0xaaf5('0x7')]('/api/schedules',require(_0xaaf5('0x6d')));_0x277e58[_0xaaf5('0x7')]('/api/sounds',require(_0xaaf5('0x6e')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x6f'),require(_0xaaf5('0x70')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x71'),require('./api/contactItemType'));_0x277e58['use'](_0xaaf5('0x72'),require(_0xaaf5('0x73')));_0x277e58[_0xaaf5('0x7')]('/api/cm_hopper_additional_phones',require(_0xaaf5('0x74')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x75'),require(_0xaaf5('0x76')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x77'),require(_0xaaf5('0x78')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x79'),require('./api/variable'));_0x277e58['use'](_0xaaf5('0x7a'),require(_0xaaf5('0x7b')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x7c'),require(_0xaaf5('0x7d')));_0x277e58['use'](_0xaaf5('0x7e'),require(_0xaaf5('0x7f')));_0x277e58['use'](_0xaaf5('0x80'),require(_0xaaf5('0x81')));_0x277e58[_0xaaf5('0x7')]('/api/analytics/extracted_reports',require(_0xaaf5('0x82')));_0x277e58['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x277e58[_0xaaf5('0x7')]('/api/analytics/field_reports',require(_0xaaf5('0x83')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x84'),require(_0xaaf5('0x85')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/salesforce/accounts',require(_0xaaf5('0x86')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x87'),require(_0xaaf5('0x88')));_0x277e58['use'](_0xaaf5('0x89'),require(_0xaaf5('0x8a')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x8b'),require(_0xaaf5('0x8c')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/sugarcrm/fields',require(_0xaaf5('0x8d')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/desk/accounts',require(_0xaaf5('0x8e')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x8f'),require(_0xaaf5('0x90')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x91'),require(_0xaaf5('0x92')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x93'),require(_0xaaf5('0x94')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/zoho/configurations',require(_0xaaf5('0x95')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x277e58[_0xaaf5('0x7')]('/api/integrations/zendesk/accounts',require(_0xaaf5('0x96')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x97'),require(_0xaaf5('0x98')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x99'),require(_0xaaf5('0x9a')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/freshdesk/accounts',require(_0xaaf5('0x9b')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/freshdesk/configurations',require(_0xaaf5('0x9c')));_0x277e58[_0xaaf5('0x7')]('/api/integrations/freshdesk/fields',require(_0xaaf5('0x9d')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x9e'),require(_0xaaf5('0x9f')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xa0'),require(_0xaaf5('0xa1')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xa2'),require(_0xaaf5('0xa3')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xa4'),require('./api/intServicenowAccount'));_0x277e58['use'](_0xaaf5('0xa5'),require(_0xaaf5('0xa6')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xa7'),require(_0xaaf5('0xa8')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xa9'),require(_0xaaf5('0xaa')));_0x277e58['use'](_0xaaf5('0xab'),require('./api/intDynamics365Configuration'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xac'),require(_0xaaf5('0xad')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xae'),require(_0xaaf5('0xaf')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xb0'),require(_0xaaf5('0xb1')));_0x277e58['use'](_0xaaf5('0xb2'),require(_0xaaf5('0xb3')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xb4'),require(_0xaaf5('0xb5')));_0x277e58[_0xaaf5('0x7')]('/api/chat/reports/queue',require(_0xaaf5('0xb6')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xb7'),require(_0xaaf5('0xb8')));_0x277e58[_0xaaf5('0x7')]('/api/jscripty/answers/reports',require(_0xaaf5('0xb9')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xba'),require(_0xaaf5('0xbb')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xbc'),require(_0xaaf5('0xbd')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xbe'),require(_0xaaf5('0xbf')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xc0'),require(_0xaaf5('0xc1')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xc2'),require(_0xaaf5('0xc3')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xc4'),require(_0xaaf5('0xc5')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xc6'),require(_0xaaf5('0xc7')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xc8'),require(_0xaaf5('0xc9')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xca'),require(_0xaaf5('0xcb')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xcc'),require('./api/squareRecording'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xcd'),require(_0xaaf5('0xce')));_0x277e58[_0xaaf5('0x7')]('/api/teams',require(_0xaaf5('0xcf')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xd0'),require(_0xaaf5('0xd1')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xd2'),require(_0xaaf5('0xd3')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xd4'),require('./api/migration'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xd5'),require(_0xaaf5('0xd6')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xd7'),require(_0xaaf5('0xd8')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xd9'),require(_0xaaf5('0xda')));_0x277e58['use'](_0xaaf5('0xdb'),require('./api/chatTransferReport'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xdc'),require(_0xaaf5('0xdd')));_0x277e58[_0xaaf5('0x7')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x277e58[_0xaaf5('0x7')]('/api/sms/reports/transfer',require(_0xaaf5('0xde')));_0x277e58['use'](_0xaaf5('0xdf'),require(_0xaaf5('0xe0')));_0x277e58['use']('/api/voice/prefixes',require(_0xaaf5('0xe1')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xe2'),require(_0xaaf5('0xe3')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xe4'),require(_0xaaf5('0xe5')));_0x277e58[_0xaaf5('0x7')]('/api/userProfile/resources',require(_0xaaf5('0xe6')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xe7'),require(_0xaaf5('0xe8')));_0x277e58['use'](_0xaaf5('0xe9'),require('./api/whatsappAccount'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xea'),require('./api/whatsappApplication'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xeb'),require('./api/whatsappInteraction'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xec'),require(_0xaaf5('0xed')));_0x277e58['use']('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xee'),require(_0xaaf5('0xef')));_0x277e58['use']('/api/whatsapp/queues',require(_0xaaf5('0xf0')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xf1'),require(_0xaaf5('0xf2')));_0x277e58['use'](_0xaaf5('0xf3'),require('./api/realtime'));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xf4'),require(_0xaaf5('0xf5')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xf6'),require(_0xaaf5('0xf7')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xf8'),require(_0xaaf5('0xf9')));_0x277e58['use']('/api/auth/activedirectory',require(_0xaaf5('0xfa')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xfb'),require(_0xaaf5('0xfc')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xfd'),require(_0xaaf5('0xfe')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0xff'),require(_0xaaf5('0x100')));_0x277e58['use'](_0xaaf5('0x101'),require(_0xaaf5('0x102')));_0x277e58[_0xaaf5('0x7')]('/api/pm2',require(_0xaaf5('0x103')));_0x277e58['use']('/api/webbar',require(_0xaaf5('0x104')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x105'),clientSideLogs);_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x106'),express[_0xaaf5('0x107')](path[_0xaaf5('0x108')](config[_0xaaf5('0x109')],_0xaaf5('0x106'))));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x10a'),express['static'](path[_0xaaf5('0x108')](config['root'],'/www')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x10b'),express[_0xaaf5('0x107')](path[_0xaaf5('0x108')](config[_0xaaf5('0x109')],_0xaaf5('0x10b'))));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x10c'),express[_0xaaf5('0x107')](path[_0xaaf5('0x108')](config[_0xaaf5('0x109')],_0xaaf5('0x10d'),'3.5.0')));_0x277e58[_0xaaf5('0x7')](_0xaaf5('0x10e'),express[_0xaaf5('0x107')](path[_0xaaf5('0x108')](config[_0xaaf5('0x109')],'/server/files/plugins')));_0x277e58[_0xaaf5('0x10f')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xaaf5('0x110')](errors[0x194]);_0x277e58[_0xaaf5('0x10f')]('/*')['get'](function(_0x4ab0a9,_0x2283cc){_0x2283cc['sendFile'](path[_0xaaf5('0x111')](_0x277e58[_0xaaf5('0x110')](_0xaaf5('0x112'))+'/index.html'));});return _0x277e58;});}; \ No newline at end of file +var _0x192f=['./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/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/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/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/jscripty/projects','./api/jscriptyProject','/api/square/odbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','get','resolve','appPath','/index.html','path','./errors','./utils/client-side-logger','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication'];(function(_0x29e80d,_0x43df7a){var _0x2ef9fd=function(_0x1dc423){while(--_0x1dc423){_0x29e80d['push'](_0x29e80d['shift']());}};_0x2ef9fd(++_0x43df7a);}(_0x192f,0xd6));var _0xf192=function(_0x3dcf41,_0x3d6e95){_0x3dcf41=_0x3dcf41-0x0;var _0x43c5fa=_0x192f[_0x3dcf41];return _0x43c5fa;};'use strict';var path=require(_0xf192('0x0'));var express=require('express');var errors=require(_0xf192('0x1'));var config=require('./config/environment');var setupLoggers=require(_0xf192('0x2'))['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0xf192('0x3')]=function(_0x3b704f){return setupLoggers(_0x3b704f)[_0xf192('0x4')](function(){_0x3b704f[_0xf192('0x5')](_0xf192('0x6'),require(_0xf192('0x7')));_0x3b704f['use'](_0xf192('0x8'),require(_0xf192('0x9')));_0x3b704f['use'](_0xf192('0xa'),require(_0xf192('0xb')));_0x3b704f[_0xf192('0x5')](_0xf192('0xc'),require(_0xf192('0xd')));_0x3b704f['use']('/api/voice/mohs',require(_0xf192('0xe')));_0x3b704f[_0xf192('0x5')](_0xf192('0xf'),require(_0xf192('0x10')));_0x3b704f[_0xf192('0x5')](_0xf192('0x11'),require(_0xf192('0x12')));_0x3b704f[_0xf192('0x5')]('/api/screen/recordings',require(_0xf192('0x13')));_0x3b704f[_0xf192('0x5')](_0xf192('0x14'),require(_0xf192('0x15')));_0x3b704f[_0xf192('0x5')](_0xf192('0x16'),require(_0xf192('0x17')));_0x3b704f[_0xf192('0x5')](_0xf192('0x18'),require(_0xf192('0x19')));_0x3b704f[_0xf192('0x5')](_0xf192('0x1a'),require('./api/voiceDialReport'));_0x3b704f[_0xf192('0x5')](_0xf192('0x1b'),require('./api/voiceAgentReport'));_0x3b704f[_0xf192('0x5')](_0xf192('0x1c'),require(_0xf192('0x1d')));_0x3b704f[_0xf192('0x5')](_0xf192('0x1e'),require(_0xf192('0x1f')));_0x3b704f[_0xf192('0x5')](_0xf192('0x20'),require(_0xf192('0x21')));_0x3b704f[_0xf192('0x5')](_0xf192('0x22'),require(_0xf192('0x23')));_0x3b704f['use'](_0xf192('0x24'),require(_0xf192('0x25')));_0x3b704f[_0xf192('0x5')](_0xf192('0x26'),require(_0xf192('0x27')));_0x3b704f[_0xf192('0x5')](_0xf192('0x28'),require(_0xf192('0x29')));_0x3b704f['use'](_0xf192('0x2a'),require(_0xf192('0x2b')));_0x3b704f[_0xf192('0x5')](_0xf192('0x2c'),require('./api/mailInteraction'));_0x3b704f[_0xf192('0x5')]('/api/mail/messages',require(_0xf192('0x2d')));_0x3b704f['use'](_0xf192('0x2e'),require(_0xf192('0x2f')));_0x3b704f[_0xf192('0x5')](_0xf192('0x30'),require(_0xf192('0x31')));_0x3b704f[_0xf192('0x5')](_0xf192('0x32'),require(_0xf192('0x33')));_0x3b704f['use'](_0xf192('0x34'),require(_0xf192('0x35')));_0x3b704f[_0xf192('0x5')]('/api/fax/accounts',require('./api/faxAccount'));_0x3b704f[_0xf192('0x5')](_0xf192('0x36'),require(_0xf192('0x37')));_0x3b704f[_0xf192('0x5')]('/api/fax/interactions',require(_0xf192('0x38')));_0x3b704f['use'](_0xf192('0x39'),require('./api/faxMessage'));_0x3b704f['use'](_0xf192('0x3a'),require(_0xf192('0x3b')));_0x3b704f['use']('/api/fax/reports/queue',require(_0xf192('0x3c')));_0x3b704f[_0xf192('0x5')](_0xf192('0x3d'),require('./api/smsAccount'));_0x3b704f[_0xf192('0x5')](_0xf192('0x3e'),require(_0xf192('0x3f')));_0x3b704f[_0xf192('0x5')]('/api/sms/interactions',require(_0xf192('0x40')));_0x3b704f[_0xf192('0x5')](_0xf192('0x41'),require('./api/smsMessage'));_0x3b704f[_0xf192('0x5')](_0xf192('0x42'),require(_0xf192('0x43')));_0x3b704f[_0xf192('0x5')](_0xf192('0x44'),require(_0xf192('0x45')));_0x3b704f[_0xf192('0x5')]('/api/openchannel/applications',require(_0xf192('0x46')));_0x3b704f[_0xf192('0x5')](_0xf192('0x47'),require('./api/openchannelInteraction'));_0x3b704f[_0xf192('0x5')](_0xf192('0x48'),require(_0xf192('0x49')));_0x3b704f[_0xf192('0x5')](_0xf192('0x4a'),require('./api/openchannelQueue'));_0x3b704f[_0xf192('0x5')](_0xf192('0x4b'),require(_0xf192('0x4c')));_0x3b704f['use'](_0xf192('0x4d'),require(_0xf192('0x4e')));_0x3b704f[_0xf192('0x5')](_0xf192('0x4f'),require(_0xf192('0x50')));_0x3b704f[_0xf192('0x5')](_0xf192('0x51'),require('./api/chatInteraction'));_0x3b704f[_0xf192('0x5')]('/api/chat/messages',require('./api/chatMessage'));_0x3b704f[_0xf192('0x5')](_0xf192('0x52'),require(_0xf192('0x53')));_0x3b704f[_0xf192('0x5')](_0xf192('0x54'),require(_0xf192('0x55')));_0x3b704f[_0xf192('0x5')](_0xf192('0x56'),require(_0xf192('0x57')));_0x3b704f[_0xf192('0x5')](_0xf192('0x58'),require(_0xf192('0x59')));_0x3b704f['use']('/api/cm/companies',require('./api/cmCompany'));_0x3b704f['use'](_0xf192('0x5a'),require(_0xf192('0x5b')));_0x3b704f[_0xf192('0x5')](_0xf192('0x5c'),require(_0xf192('0x5d')));_0x3b704f[_0xf192('0x5')](_0xf192('0x5e'),require(_0xf192('0x5f')));_0x3b704f['use']('/api/cm/hopper_final',require(_0xf192('0x60')));_0x3b704f[_0xf192('0x5')](_0xf192('0x61'),require(_0xf192('0x62')));_0x3b704f['use'](_0xf192('0x63'),require(_0xf192('0x64')));_0x3b704f[_0xf192('0x5')](_0xf192('0x65'),require(_0xf192('0x66')));_0x3b704f[_0xf192('0x5')]('/api/automations',require('./api/automation'));_0x3b704f[_0xf192('0x5')](_0xf192('0x67'),require(_0xf192('0x68')));_0x3b704f['use'](_0xf192('0x69'),require(_0xf192('0x6a')));_0x3b704f[_0xf192('0x5')](_0xf192('0x6b'),require(_0xf192('0x6c')));_0x3b704f[_0xf192('0x5')](_0xf192('0x6d'),require(_0xf192('0x6e')));_0x3b704f['use'](_0xf192('0x6f'),require('./api/pause'));_0x3b704f[_0xf192('0x5')](_0xf192('0x70'),require(_0xf192('0x71')));_0x3b704f[_0xf192('0x5')](_0xf192('0x72'),require(_0xf192('0x73')));_0x3b704f[_0xf192('0x5')](_0xf192('0x74'),require(_0xf192('0x75')));_0x3b704f[_0xf192('0x5')]('/api/sounds',require(_0xf192('0x76')));_0x3b704f[_0xf192('0x5')](_0xf192('0x77'),require(_0xf192('0x78')));_0x3b704f['use'](_0xf192('0x79'),require('./api/contactItemType'));_0x3b704f[_0xf192('0x5')](_0xf192('0x7a'),require('./api/cmContactHasItem'));_0x3b704f[_0xf192('0x5')](_0xf192('0x7b'),require(_0xf192('0x7c')));_0x3b704f['use'](_0xf192('0x7d'),require(_0xf192('0x7e')));_0x3b704f['use'](_0xf192('0x7f'),require(_0xf192('0x80')));_0x3b704f[_0xf192('0x5')]('/api/variables',require(_0xf192('0x81')));_0x3b704f[_0xf192('0x5')](_0xf192('0x82'),require(_0xf192('0x83')));_0x3b704f['use'](_0xf192('0x84'),require(_0xf192('0x85')));_0x3b704f['use'](_0xf192('0x86'),require(_0xf192('0x87')));_0x3b704f[_0xf192('0x5')](_0xf192('0x88'),require(_0xf192('0x89')));_0x3b704f[_0xf192('0x5')](_0xf192('0x8a'),require('./api/analyticExtractedReport'));_0x3b704f[_0xf192('0x5')](_0xf192('0x8b'),require(_0xf192('0x8c')));_0x3b704f['use'](_0xf192('0x8d'),require(_0xf192('0x8e')));_0x3b704f[_0xf192('0x5')](_0xf192('0x8f'),require(_0xf192('0x90')));_0x3b704f[_0xf192('0x5')](_0xf192('0x91'),require(_0xf192('0x92')));_0x3b704f['use'](_0xf192('0x93'),require(_0xf192('0x94')));_0x3b704f[_0xf192('0x5')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x3b704f[_0xf192('0x5')](_0xf192('0x95'),require(_0xf192('0x96')));_0x3b704f[_0xf192('0x5')]('/api/integrations/sugarcrm/configurations',require(_0xf192('0x97')));_0x3b704f[_0xf192('0x5')](_0xf192('0x98'),require('./api/intSugarcrmField'));_0x3b704f[_0xf192('0x5')](_0xf192('0x99'),require('./api/intDeskAccount'));_0x3b704f['use']('/api/integrations/desk/configurations',require(_0xf192('0x9a')));_0x3b704f[_0xf192('0x5')](_0xf192('0x9b'),require('./api/intDeskField'));_0x3b704f[_0xf192('0x5')](_0xf192('0x9c'),require(_0xf192('0x9d')));_0x3b704f[_0xf192('0x5')]('/api/integrations/zoho/configurations',require(_0xf192('0x9e')));_0x3b704f[_0xf192('0x5')](_0xf192('0x9f'),require(_0xf192('0xa0')));_0x3b704f[_0xf192('0x5')](_0xf192('0xa1'),require(_0xf192('0xa2')));_0x3b704f[_0xf192('0x5')]('/api/integrations/zendesk/configurations',require(_0xf192('0xa3')));_0x3b704f[_0xf192('0x5')]('/api/integrations/zendesk/fields',require(_0xf192('0xa4')));_0x3b704f[_0xf192('0x5')]('/api/integrations/freshdesk/accounts',require(_0xf192('0xa5')));_0x3b704f[_0xf192('0x5')](_0xf192('0xa6'),require(_0xf192('0xa7')));_0x3b704f[_0xf192('0x5')](_0xf192('0xa8'),require(_0xf192('0xa9')));_0x3b704f[_0xf192('0x5')]('/api/integrations/vtiger/accounts',require(_0xf192('0xaa')));_0x3b704f[_0xf192('0x5')](_0xf192('0xab'),require(_0xf192('0xac')));_0x3b704f['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x3b704f[_0xf192('0x5')](_0xf192('0xad'),require('./api/intServicenowAccount'));_0x3b704f[_0xf192('0x5')](_0xf192('0xae'),require(_0xf192('0xaf')));_0x3b704f['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x3b704f[_0xf192('0x5')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x3b704f[_0xf192('0x5')](_0xf192('0xb0'),require(_0xf192('0xb1')));_0x3b704f[_0xf192('0x5')](_0xf192('0xb2'),require(_0xf192('0xb3')));_0x3b704f[_0xf192('0x5')](_0xf192('0xb4'),require(_0xf192('0xb5')));_0x3b704f['use'](_0xf192('0xb6'),require(_0xf192('0xb7')));_0x3b704f['use']('/api/integrations/freshsales/fields',require(_0xf192('0xb8')));_0x3b704f[_0xf192('0x5')](_0xf192('0xb9'),require(_0xf192('0xba')));_0x3b704f[_0xf192('0x5')]('/api/chat/reports/queue',require(_0xf192('0xbb')));_0x3b704f[_0xf192('0x5')](_0xf192('0xbc'),require(_0xf192('0xbd')));_0x3b704f[_0xf192('0x5')](_0xf192('0xbe'),require('./api/jscriptyAnswerReport'));_0x3b704f[_0xf192('0x5')](_0xf192('0xbf'),require(_0xf192('0xc0')));_0x3b704f[_0xf192('0x5')](_0xf192('0xc1'),require(_0xf192('0xc2')));_0x3b704f[_0xf192('0x5')](_0xf192('0xc3'),require(_0xf192('0xc4')));_0x3b704f[_0xf192('0x5')](_0xf192('0xc5'),require('./api/squareReport'));_0x3b704f[_0xf192('0x5')](_0xf192('0xc6'),require('./api/squareReportDetail'));_0x3b704f[_0xf192('0x5')](_0xf192('0xc7'),require(_0xf192('0xc8')));_0x3b704f['use']('/api/settings',require('./api/setting'));_0x3b704f[_0xf192('0x5')](_0xf192('0xc9'),require('./api/squareOdbc'));_0x3b704f[_0xf192('0x5')](_0xf192('0xca'),require('./api/squareProject'));_0x3b704f[_0xf192('0x5')](_0xf192('0xcb'),require(_0xf192('0xcc')));_0x3b704f[_0xf192('0x5')](_0xf192('0xcd'),require('./api/squareMessage'));_0x3b704f[_0xf192('0x5')](_0xf192('0xce'),require(_0xf192('0xcf')));_0x3b704f[_0xf192('0x5')](_0xf192('0xd0'),require(_0xf192('0xd1')));_0x3b704f[_0xf192('0x5')](_0xf192('0xd2'),require(_0xf192('0xd3')));_0x3b704f[_0xf192('0x5')](_0xf192('0xd4'),require(_0xf192('0xd5')));_0x3b704f[_0xf192('0x5')]('/api/attachments',require('./api/attachment'));_0x3b704f[_0xf192('0x5')](_0xf192('0xd6'),require(_0xf192('0xd7')));_0x3b704f['use'](_0xf192('0xd8'),require(_0xf192('0xd9')));_0x3b704f[_0xf192('0x5')]('/api/chat/reports/transfer',require(_0xf192('0xda')));_0x3b704f[_0xf192('0x5')](_0xf192('0xdb'),require(_0xf192('0xdc')));_0x3b704f[_0xf192('0x5')](_0xf192('0xdd'),require(_0xf192('0xde')));_0x3b704f['use'](_0xf192('0xdf'),require(_0xf192('0xe0')));_0x3b704f[_0xf192('0x5')](_0xf192('0xe1'),require(_0xf192('0xe2')));_0x3b704f[_0xf192('0x5')](_0xf192('0xe3'),require(_0xf192('0xe4')));_0x3b704f[_0xf192('0x5')](_0xf192('0xe5'),require('./api/userProfile'));_0x3b704f[_0xf192('0x5')](_0xf192('0xe6'),require(_0xf192('0xe7')));_0x3b704f[_0xf192('0x5')]('/api/userProfile/resources',require(_0xf192('0xe8')));_0x3b704f['use'](_0xf192('0xe9'),require(_0xf192('0xea')));_0x3b704f[_0xf192('0x5')](_0xf192('0xeb'),require(_0xf192('0xec')));_0x3b704f[_0xf192('0x5')](_0xf192('0xed'),require(_0xf192('0xee')));_0x3b704f[_0xf192('0x5')](_0xf192('0xef'),require('./api/whatsappInteraction'));_0x3b704f[_0xf192('0x5')](_0xf192('0xf0'),require('./api/whatsappMessage'));_0x3b704f[_0xf192('0x5')]('/api/whatsapp/reports/queue',require(_0xf192('0xf1')));_0x3b704f[_0xf192('0x5')]('/api/whatsapp/reports/transfer',require(_0xf192('0xf2')));_0x3b704f[_0xf192('0x5')]('/api/whatsapp/queues',require(_0xf192('0xf3')));_0x3b704f['use'](_0xf192('0xf4'),require(_0xf192('0xf5')));_0x3b704f['use']('/api/realtime',require('./api/realtime'));_0x3b704f['use'](_0xf192('0xf6'),require(_0xf192('0xf7')));_0x3b704f[_0xf192('0x5')](_0xf192('0xf8'),require(_0xf192('0xf9')));_0x3b704f[_0xf192('0x5')](_0xf192('0xfa'),require(_0xf192('0xfb')));_0x3b704f['use'](_0xf192('0xfc'),require(_0xf192('0xfd')));_0x3b704f[_0xf192('0x5')](_0xf192('0xfe'),require(_0xf192('0xff')));_0x3b704f[_0xf192('0x5')](_0xf192('0x100'),require(_0xf192('0x101')));_0x3b704f[_0xf192('0x5')]('/api/version',require(_0xf192('0x102')));_0x3b704f[_0xf192('0x5')](_0xf192('0x103'),require(_0xf192('0x104')));_0x3b704f[_0xf192('0x5')]('/api/pm2',require('./api/pm2'));_0x3b704f[_0xf192('0x5')](_0xf192('0x105'),require(_0xf192('0x106')));_0x3b704f[_0xf192('0x5')]('/api/logs',clientSideLogs);_0x3b704f[_0xf192('0x5')](_0xf192('0x107'),express[_0xf192('0x108')](path[_0xf192('0x109')](config[_0xf192('0x10a')],_0xf192('0x107'))));_0x3b704f[_0xf192('0x5')](_0xf192('0x10b'),express[_0xf192('0x108')](path[_0xf192('0x109')](config[_0xf192('0x10a')],_0xf192('0x10b'))));_0x3b704f[_0xf192('0x5')](_0xf192('0x10c'),express[_0xf192('0x108')](path['join'](config['root'],'/demo')));_0x3b704f[_0xf192('0x5')](_0xf192('0x10d'),express['static'](path[_0xf192('0x109')](config[_0xf192('0x10a')],_0xf192('0x10e'),'3.5.0')));_0x3b704f[_0xf192('0x5')](_0xf192('0x10f'),express[_0xf192('0x108')](path[_0xf192('0x109')](config[_0xf192('0x10a')],_0xf192('0x110'))));_0x3b704f[_0xf192('0x111')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xf192('0x112')](errors[0x194]);_0x3b704f[_0xf192('0x111')]('/*')[_0xf192('0x112')](function(_0x56af80,_0x3479e2){_0x3479e2['sendFile'](path[_0xf192('0x113')](_0x3b704f['get'](_0xf192('0x114'))+_0xf192('0x115')));});return _0x3b704f;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index c6e7bc4..95e081f 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f10=['../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc'];(function(_0x29e3ec,_0x138a18){var _0x25727e=function(_0x2bea0d){while(--_0x2bea0d){_0x29e3ec['push'](_0x29e3ec['shift']());}};_0x25727e(++_0x138a18);}(_0x0f10,0x7b));var _0x00f1=function(_0x5f2eee,_0x2e7405){_0x5f2eee=_0x5f2eee-0x0;var _0x1690b9=_0x0f10[_0x5f2eee];return _0x1690b9;};'use strict';var jayson=require(_0x00f1('0x0'));var _=require(_0x00f1('0x1'));var config=require(_0x00f1('0x2'));exports[_0x00f1('0x3')]=function(){return new Promise(function(_0x364903,_0x1d237d){var _0x445cb9={};_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x4')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x6')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x7')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x8')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x9')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xa')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0xb')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xc')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xd')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xe')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xf')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x10')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x11')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x12')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x13')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x445cb9=_['merge'](_0x445cb9,require('../api/faxAccount/faxAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x14')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/faxInteraction/faxInteraction.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x15')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x16')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x17')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x18')));_0x445cb9=_['merge'](_0x445cb9,require('../api/smsInteraction/smsInteraction.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x19')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1a')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1b')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1c')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1d')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1e')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1f')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x20')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x21')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x22')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x23')));_0x445cb9=_['merge'](_0x445cb9,require('../api/cmHopper/cmHopper.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x24')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x25')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x26')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x27')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x28')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x29')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2a')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2b')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x2c')));_0x445cb9=_['merge'](_0x445cb9,require('../api/variable/variable.rpc'));_0x445cb9=_['merge'](_0x445cb9,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2d')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2e')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2f')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x30')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x31')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x32')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x33')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x34')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/squareReport/squareReport.rpc'));_0x445cb9=_['merge'](_0x445cb9,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x35')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x36')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x37')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/squareRecording/squareRecording.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/squareMessage/squareMessage.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x38')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x39')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3a')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x3b')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3c')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3d')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3e')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x3f')));var _0x5c43e0=jayson[_0x00f1('0x40')](_0x445cb9)[_0x00f1('0x41')]();var _0x5ca473=config[_0x00f1('0x42')][_0x00f1('0x43')]||config[_0x00f1('0x43')]+0x1;var _0x501f2e=config[_0x00f1('0x42')]['ip']||_0x00f1('0x44');_0x5c43e0['on'](_0x00f1('0x45'),function(_0x239e5c){return _0x1d237d(_0x239e5c);});_0x5c43e0[_0x00f1('0x3')](_0x5ca473,_0x501f2e,function(){console['log'](_0x00f1('0x46'),_0x501f2e,_0x5ca473);require(_0x00f1('0x47'))['default']();return _0x364903(_0x00f1('0x48')+_0x501f2e+':'+_0x5ca473);});});}; \ No newline at end of file +var _0xe225=['../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','server','port','rpc','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','lodash','../config/environment','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc'];(function(_0x53cd59,_0x33c319){var _0x19fa73=function(_0x33cd75){while(--_0x33cd75){_0x53cd59['push'](_0x53cd59['shift']());}};_0x19fa73(++_0x33c319);}(_0xe225,0x1bd));var _0x5e22=function(_0x554de9,_0x4b1bd2){_0x554de9=_0x554de9-0x0;var _0x2bcb4f=_0xe225[_0x554de9];return _0x2bcb4f;};'use strict';var jayson=require('jayson/promise');var _=require(_0x5e22('0x0'));var config=require(_0x5e22('0x1'));exports['listen']=function(){return new Promise(function(_0x503eba,_0x4c55ed){var _0x39f972={};_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x2')));_0x39f972=_['merge'](_0x39f972,require('../api/voiceExtension/voiceExtension.rpc'));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x3')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x5')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x6')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x7')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x8')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x9')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/memberReport/memberReport.rpc'));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/trunk/trunk.rpc'));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0xa')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0xb')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0xc')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0xd')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0xe')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0xf')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x10')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x11')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x12')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x13')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x14')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x15')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x16')));_0x39f972=_['merge'](_0x39f972,require('../api/faxQueue/faxQueue.rpc'));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x17')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x18')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x19')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x1a')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x1b')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x1c')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x1d')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x1e')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x1f')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x20')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x21')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x22')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x23')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x24')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x25')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x26')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x27')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/interval/interval.rpc'));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x28')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x29')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x2a')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x2b')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x2c')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x2d')));_0x39f972=_['merge'](_0x39f972,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x2e')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x2f')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x30')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x31')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x32')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x33')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x34')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x35')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x36')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x37')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x38')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x39')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x3a')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x3b')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x3c')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x3d')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x3e')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x3f')));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x40')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/attachment/attachment.rpc'));_0x39f972=_['merge'](_0x39f972,require(_0x5e22('0x41')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x42')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require(_0x5e22('0x43')));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x39f972=_['merge'](_0x39f972,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x39f972=_[_0x5e22('0x4')](_0x39f972,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x33b83a=jayson[_0x5e22('0x44')](_0x39f972)['http']();var _0x1ce5b0=config['rpc'][_0x5e22('0x45')]||config[_0x5e22('0x45')]+0x1;var _0x4d1970=config[_0x5e22('0x46')]['ip']||_0x5e22('0x47');_0x33b83a['on'](_0x5e22('0x48'),function(_0x30a88f){return _0x4c55ed(_0x30a88f);});_0x33b83a['listen'](_0x1ce5b0,_0x4d1970,function(){console['log'](_0x5e22('0x49'),_0x4d1970,_0x1ce5b0);require(_0x5e22('0x4a'))[_0x5e22('0x4b')]();return _0x503eba('RPC\x20listening\x20on\x20'+_0x4d1970+':'+_0x1ce5b0);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 61c9c50..e6ac765 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 _0xe730=['setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','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','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','call','setEncoding','utf8','setTimeout','line','toLowerCase','hangup','emit','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','prototype','command','sync','answer','sendRequest','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s'];(function(_0x33a801,_0x1b9932){var _0x5b688d=function(_0x2dc23d){while(--_0x2dc23d){_0x33a801['push'](_0x33a801['shift']());}};_0x5b688d(++_0x1b9932);}(_0xe730,0xb5));var _0x0e73=function(_0x5f0823,_0x58ae86){_0x5f0823=_0x5f0823-0x0;var _0x41b184=_0xe730[_0x5f0823];return _0x41b184;};'use strict';var util=require(_0x0e73('0x0'));var _=require(_0x0e73('0x1'));var EventEmitter=require(_0x0e73('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0xad90a9){var _0x33d6c3=this,_0x15c716=new AGIReply(),_0xa5507a=![],_0x38c9a9={};EventEmitter[_0x0e73('0x3')](_0x33d6c3);_0xad90a9[_0x0e73('0x4')](_0x0e73('0x5'));_0xad90a9[_0x0e73('0x6')](0x8*0x3c*0x3c*0x3e8);_0x15c716[_0x0e73('0x4')](_0x0e73('0x5'));_0x15c716['on']('headers',function(_0x4633e6){for(var _0x55a5c0 in _0x4633e6){_0x33d6c3[_0x55a5c0]=_0x4633e6[_0x55a5c0];}_0x33d6c3['emit']('ready');});_0x15c716['on'](_0x0e73('0x7'),function(_0xf3538a){if(_0xf3538a[_0x0e73('0x8')]()==_0x0e73('0x9')){_0x33d6c3[_0x0e73('0xa')](_0x0e73('0x9'));return;}if(_0xf3538a[_0x0e73('0xb')](0x0,0xb)==_0x0e73('0xc')){_0xa5507a=!![];}if(_0xa5507a){_0x38c9a9['rx']+=_0xf3538a+'\x0a';if(_0xf3538a['search'](_0x0e73('0xd'))!=-0x1){_0xa5507a=![];}}else{_0x38c9a9['rx']=_0xf3538a;}if(_0xa5507a){return;}if(typeof _0x38c9a9['cb']==_0x0e73('0xe')){var _0x5898e8=_0x38c9a9['rx'][_0x0e73('0xb')](0x0,0x3),_0x1b9151=null,_0x2b4c87=null;_0x5898e8=parseInt(_0x5898e8);if(isNaN(_0x5898e8)){_0x38c9a9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0e73('0xf')});return;}if(_0x5898e8!=0xc8){_0x38c9a9['cb'](null,{'code':_0x5898e8,'result':-0x1,'extra':'KO'});return;}_0x1b9151=_0x38c9a9['rx'][_0x0e73('0xb')](0x4)[_0x0e73('0x10')](_0x0e73('0x11'),'');if(_0x1b9151['indexOf']('\x20')!=-0x1){_0x1b9151=_0x1b9151[_0x0e73('0x12')](0x0,_0x1b9151[_0x0e73('0x13')]('\x20'));}if(_['startsWith'](_0x1b9151,'-1')){_0x1b9151=parseInt(_0x1b9151);}_0x2b4c87=_0x38c9a9['rx'][_0x0e73('0x14')]('\x20');if(_0x2b4c87[_0x0e73('0x15')]==0x3){_0x2b4c87=_0x2b4c87[0x2][_0x0e73('0xb')](0x1,_0x2b4c87[0x2][_0x0e73('0x15')]-0x1);}else if(_0x2b4c87[_0x0e73('0x15')]>0x3){var _0x30db69=/\((.+)\)/;var _0x5ab393=_0x38c9a9['rx'][_0x0e73('0x16')](_0x30db69);if(_0x5ab393){_0x2b4c87=_0x5ab393[0x1];}else{_0x2b4c87=null;}}else{_0x2b4c87=null;}_0x38c9a9['cb'](null,{'code':_0x5898e8,'result':_0x1b9151,'extra':_0x2b4c87});}});_0xad90a9['on'](_0x0e73('0x17'),function(_0x84a399){_0x33d6c3['emit'](_0x0e73('0x17'),new AGIError(_0x0e73('0x18'),_0x84a399[_0x0e73('0x19')]));});_0xad90a9['on'](_0x0e73('0x1a'),function(){_0x33d6c3[_0x0e73('0xa')](_0x0e73('0x1a'),new AGIError(_0x0e73('0x1b')));});_0xad90a9['on'](_0x0e73('0x1c'),function(){_0x33d6c3[_0x0e73('0xa')](_0x0e73('0x1c'),new AGIError(_0x0e73('0x1d')));_0xad90a9[_0x0e73('0x1e')]();});_0xad90a9[_0x0e73('0x1f')](_0x15c716);this['command']=function(_0x33ea99,_0x161be8){var _0x33ea99=_0x33ea99||'',_0x161be8=typeof _0x161be8==_0x0e73('0xe')?_0x161be8:new Function();_0x38c9a9={'tx':_0x33ea99,'rx':'','cb':_0x161be8};_0xad90a9[_0x0e73('0x20')](_0x33ea99+'\x0a');},this[_0x0e73('0x1a')]=function(){_0xad90a9['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x0e73('0x21')]['sendRequest']=function(_0x4e40ca){return this[_0x0e73('0x22')][_0x0e73('0x23')](this,_0x4e40ca);};AGIChannel[_0x0e73('0x21')][_0x0e73('0x24')]=function(){return this[_0x0e73('0x25')](_0x0e73('0x26'));};AGIChannel[_0x0e73('0x21')]['getData']=function(_0x319b89,_0x4fa1ef,_0x1eaef8){_0x319b89=_0x319b89===undefined?_0x0e73('0x27'):_0x319b89;_0x4fa1ef=_0x4fa1ef===undefined?'5':_0x4fa1ef;_0x1eaef8=_0x1eaef8===undefined?'1':_0x1eaef8;return this[_0x0e73('0x25')](util['format'](_0x0e73('0x28'),_0x319b89,_0x4fa1ef*0x3e8,_0x1eaef8));};AGIChannel['prototype'][_0x0e73('0x29')]=function(_0x516899){_0x516899=_0x516899||'NO\x20MESSAGE';return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x2b'),_0x516899));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x2c')]=function(_0x1b325e,_0x22f1b2){if(_['isArray'](_0x22f1b2)){return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x2d'),_0x1b325e,_0x22f1b2[_0x0e73('0x2e')](',')));}return this[_0x0e73('0x25')](util[_0x0e73('0x2a')]('EXEC\x20%s\x20%s',_0x1b325e,_0x22f1b2));};AGIChannel['prototype'][_0x0e73('0x2f')]=function(_0x4ef9d1){return this[_0x0e73('0x25')](util['format']('SET\x20CONTEXT\x20%s',_0x4ef9d1));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x30')]=function(_0x476abe){return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x31'),_0x476abe));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x32')]=function(_0x184a63){return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x33'),_0x184a63));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x9')]=function(){return this[_0x0e73('0x25')](_0x0e73('0x34'));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x35')]=function(_0x528a6c,_0x4ea316){var _0x1e561e=_[_0x0e73('0x36')](_0x4ea316)||_[_0x0e73('0x37')](_0x4ea316)?_0x4ea316[_0x0e73('0x38')]():_0x4ea316;return this['sendRequest'](util[_0x0e73('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x528a6c,_0x1e561e?_0x1e561e[_0x0e73('0x38')]()[_0x0e73('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x0e73('0x39')]=function(_0x2d7879,_0x21be40){return this[_0x0e73('0x25')](util[_0x0e73('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x2d7879,_0x21be40));};AGIChannel['prototype']['sayDigits']=function(_0x4b4c13,_0x3a652a){return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x3a'),_0x4b4c13,_0x3a652a));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x3b')]=function(_0x58d4c6,_0x58d2fc){return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x3c'),_0x58d4c6,_0x58d2fc));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x3d')]=function(_0x2dc47b,_0x19214b,_0x43796c){_0x19214b=_0x19214b||this['extension'];_0x43796c=_0x43796c||0x1;this[_0x0e73('0x2f')](_0x2dc47b);this[_0x0e73('0x30')](_0x19214b);this[_0x0e73('0x32')](_0x43796c);return this['noop'](util['format'](_0x0e73('0x3e'),_0x2dc47b,_0x19214b,_0x43796c));};AGIChannel['prototype'][_0x0e73('0x3f')]=function(_0x1b26fa){return this['sendRequest'](util[_0x0e73('0x2a')](_0x0e73('0x40'),_0x1b26fa));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x41')]=function(_0xc4fbbc,_0x488ce1,_0x3e2fad,_0x336070,_0x482413,_0x2e3396){_0x488ce1=_0x488ce1||'wav';_0x3e2fad=_0x3e2fad||'';_0x336070=_0x336070===undefined?-0x1:_0x336070==='-1'?-0x1:_0x336070*0x3e8;_0x482413=_0x482413===undefined?'':'s='+_0x482413;_0x2e3396=_0x2e3396?_0x0e73('0x42'):'';return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x43'),_0xc4fbbc,_0x488ce1,_0x3e2fad,_0x336070,_0x2e3396,_0x482413));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x44')]=function(_0x425dcc,_0x2011c2){_0x2011c2=_0x2011c2||'';return this[_0x0e73('0x25')](util[_0x0e73('0x2a')](_0x0e73('0x45'),_0x425dcc,_0x2011c2));};AGIChannel[_0x0e73('0x21')][_0x0e73('0x46')]=function(_0x5e9732){return this[_0x0e73('0x2c')](_0x0e73('0x47'),_0x5e9732);};AGIChannel[_0x0e73('0x21')][_0x0e73('0x48')]=function(_0x165e2a){return this['exec'](_0x0e73('0x49'),_0x165e2a);};AGIChannel[_0x0e73('0x21')]['error']=function(_0x3aa11c,_0x1308a7){this['noop'](util[_0x0e73('0x2a')](_0x0e73('0x4a'),_0x3aa11c['id'],_0x3aa11c[_0x0e73('0x4b')],_0x1308a7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0e73('0x4c')]=AGIChannel; \ No newline at end of file +var _0x1f2d=['search','function','no\x20code','result=','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','sync','prototype','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid'];(function(_0x14158a,_0x193248){var _0x45ee29=function(_0xf57ff1){while(--_0xf57ff1){_0x14158a['push'](_0x14158a['shift']());}};_0x45ee29(++_0x193248);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x1f2d[_0x53b53e];return _0xbb6179;};'use strict';var util=require(_0xd1f2('0x0'));var _=require(_0xd1f2('0x1'));var EventEmitter=require(_0xd1f2('0x2'))[_0xd1f2('0x3')];var AGIReply=require('./reply');var AGIError=require(_0xd1f2('0x4'));function AGIChannel(_0xd7780e){var _0x13626e=this,_0xd4f928=new AGIReply(),_0x21f154=![],_0x194b49={};EventEmitter[_0xd1f2('0x5')](_0x13626e);_0xd7780e[_0xd1f2('0x6')](_0xd1f2('0x7'));_0xd7780e[_0xd1f2('0x8')](0x8*0x3c*0x3c*0x3e8);_0xd4f928[_0xd1f2('0x6')](_0xd1f2('0x7'));_0xd4f928['on'](_0xd1f2('0x9'),function(_0x30a60f){for(var _0x2097cf in _0x30a60f){_0x13626e[_0x2097cf]=_0x30a60f[_0x2097cf];}_0x13626e[_0xd1f2('0xa')](_0xd1f2('0xb'));});_0xd4f928['on']('line',function(_0x309e6a){if(_0x309e6a[_0xd1f2('0xc')]()==_0xd1f2('0xd')){_0x13626e[_0xd1f2('0xa')]('hangup');return;}if(_0x309e6a[_0xd1f2('0xe')](0x0,0xb)==_0xd1f2('0xf')){_0x21f154=!![];}if(_0x21f154){_0x194b49['rx']+=_0x309e6a+'\x0a';if(_0x309e6a[_0xd1f2('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x21f154=![];}}else{_0x194b49['rx']=_0x309e6a;}if(_0x21f154){return;}if(typeof _0x194b49['cb']==_0xd1f2('0x11')){var _0x347eba=_0x194b49['rx'][_0xd1f2('0xe')](0x0,0x3),_0x2ef331=null,_0x1d09f6=null;_0x347eba=parseInt(_0x347eba);if(isNaN(_0x347eba)){_0x194b49['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd1f2('0x12')});return;}if(_0x347eba!=0xc8){_0x194b49['cb'](null,{'code':_0x347eba,'result':-0x1,'extra':'KO'});return;}_0x2ef331=_0x194b49['rx'][_0xd1f2('0xe')](0x4)['replace'](_0xd1f2('0x13'),'');if(_0x2ef331['indexOf']('\x20')!=-0x1){_0x2ef331=_0x2ef331['substr'](0x0,_0x2ef331['indexOf']('\x20'));}if(_[_0xd1f2('0x14')](_0x2ef331,'-1')){_0x2ef331=parseInt(_0x2ef331);}_0x1d09f6=_0x194b49['rx'][_0xd1f2('0x15')]('\x20');if(_0x1d09f6[_0xd1f2('0x16')]==0x3){_0x1d09f6=_0x1d09f6[0x2][_0xd1f2('0xe')](0x1,_0x1d09f6[0x2][_0xd1f2('0x16')]-0x1);}else if(_0x1d09f6[_0xd1f2('0x16')]>0x3){var _0x1f100c=/\((.+)\)/;var _0x59433d=_0x194b49['rx'][_0xd1f2('0x17')](_0x1f100c);if(_0x59433d){_0x1d09f6=_0x59433d[0x1];}else{_0x1d09f6=null;}}else{_0x1d09f6=null;}_0x194b49['cb'](null,{'code':_0x347eba,'result':_0x2ef331,'extra':_0x1d09f6});}});_0xd7780e['on'](_0xd1f2('0x18'),function(_0x2cd4fa){_0x13626e[_0xd1f2('0xa')](_0xd1f2('0x18'),new AGIError(_0xd1f2('0x19'),_0x2cd4fa[_0xd1f2('0x1a')]));});_0xd7780e['on']('close',function(){_0x13626e[_0xd1f2('0xa')](_0xd1f2('0x1b'),new AGIError(_0xd1f2('0x1c')));});_0xd7780e['on'](_0xd1f2('0x1d'),function(){_0x13626e[_0xd1f2('0xa')](_0xd1f2('0x1d'),new AGIError(_0xd1f2('0x1e')));_0xd7780e[_0xd1f2('0x1f')]();});_0xd7780e[_0xd1f2('0x20')](_0xd4f928);this[_0xd1f2('0x21')]=function(_0x8c7385,_0x4b74ff){var _0x8c7385=_0x8c7385||'',_0x4b74ff=typeof _0x4b74ff=='function'?_0x4b74ff:new Function();_0x194b49={'tx':_0x8c7385,'rx':'','cb':_0x4b74ff};_0xd7780e['write'](_0x8c7385+'\x0a');},this[_0xd1f2('0x1b')]=function(){_0xd7780e[_0xd1f2('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x559243){return this['command'][_0xd1f2('0x22')](this,_0x559243);};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x24')]=function(){return this[_0xd1f2('0x25')](_0xd1f2('0x26'));};AGIChannel['prototype'][_0xd1f2('0x27')]=function(_0x3a99b2,_0x215a8b,_0x464b1f){_0x3a99b2=_0x3a99b2===undefined?_0xd1f2('0x28'):_0x3a99b2;_0x215a8b=_0x215a8b===undefined?'5':_0x215a8b;_0x464b1f=_0x464b1f===undefined?'1':_0x464b1f;return this[_0xd1f2('0x25')](util[_0xd1f2('0x29')](_0xd1f2('0x2a'),_0x3a99b2,_0x215a8b*0x3e8,_0x464b1f));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x2b')]=function(_0x3e5e6c){_0x3e5e6c=_0x3e5e6c||'NO\x20MESSAGE';return this['sendRequest'](util[_0xd1f2('0x29')](_0xd1f2('0x2c'),_0x3e5e6c));};AGIChannel['prototype'][_0xd1f2('0x2d')]=function(_0x4ce6cd,_0x1b9c0f){if(_[_0xd1f2('0x2e')](_0x1b9c0f)){return this[_0xd1f2('0x25')](util['format'](_0xd1f2('0x2f'),_0x4ce6cd,_0x1b9c0f['join'](',')));}return this['sendRequest'](util[_0xd1f2('0x29')](_0xd1f2('0x2f'),_0x4ce6cd,_0x1b9c0f));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x30')]=function(_0x4b8600){return this[_0xd1f2('0x25')](util['format'](_0xd1f2('0x31'),_0x4b8600));};AGIChannel[_0xd1f2('0x23')]['setExtension']=function(_0xa04d7a){return this['sendRequest'](util[_0xd1f2('0x29')](_0xd1f2('0x32'),_0xa04d7a));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x33')]=function(_0x24e585){return this[_0xd1f2('0x25')](util['format'](_0xd1f2('0x34'),_0x24e585));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0xd')]=function(){return this[_0xd1f2('0x25')](_0xd1f2('0x35'));};AGIChannel['prototype'][_0xd1f2('0x36')]=function(_0x341099,_0x492094){var _0x33cb1c=_['isBoolean'](_0x492094)||_[_0xd1f2('0x37')](_0x492094)?_0x492094[_0xd1f2('0x38')]():_0x492094;return this[_0xd1f2('0x25')](util[_0xd1f2('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x341099,_0x33cb1c?_0x33cb1c[_0xd1f2('0x38')]()[_0xd1f2('0x39')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x3a')]=function(_0x1c2f02,_0x3d6782){return this[_0xd1f2('0x25')](util['format'](_0xd1f2('0x3b'),_0x1c2f02,_0x3d6782));};AGIChannel['prototype'][_0xd1f2('0x3c')]=function(_0x1706e8,_0x1edc3d){return this['sendRequest'](util[_0xd1f2('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0x1706e8,_0x1edc3d));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x3d')]=function(_0x3c4cc1,_0x79861c){return this[_0xd1f2('0x25')](util['format'](_0xd1f2('0x3e'),_0x3c4cc1,_0x79861c));};AGIChannel[_0xd1f2('0x23')]['continueAt']=function(_0x419881,_0x4c16de,_0xbd1c11){_0x4c16de=_0x4c16de||this[_0xd1f2('0x3f')];_0xbd1c11=_0xbd1c11||0x1;this[_0xd1f2('0x30')](_0x419881);this['setExtension'](_0x4c16de);this[_0xd1f2('0x33')](_0xbd1c11);return this['noop'](util[_0xd1f2('0x29')](_0xd1f2('0x40'),_0x419881,_0x4c16de,_0xbd1c11));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x41')]=function(_0x4256b6){return this[_0xd1f2('0x25')](util[_0xd1f2('0x29')](_0xd1f2('0x42'),_0x4256b6));};AGIChannel['prototype'][_0xd1f2('0x43')]=function(_0x5fa73c,_0x29a7b2,_0x19d1fd,_0x110711,_0x2cf8aa,_0x4a9810){_0x29a7b2=_0x29a7b2||_0xd1f2('0x44');_0x19d1fd=_0x19d1fd||'';_0x110711=_0x110711===undefined?-0x1:_0x110711==='-1'?-0x1:_0x110711*0x3e8;_0x2cf8aa=_0x2cf8aa===undefined?'':'s='+_0x2cf8aa;_0x4a9810=_0x4a9810?_0xd1f2('0x45'):'';return this[_0xd1f2('0x25')](util['format'](_0xd1f2('0x46'),_0x5fa73c,_0x29a7b2,_0x19d1fd,_0x110711,_0x4a9810,_0x2cf8aa));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x47')]=function(_0x1d3edf,_0xe6d2b1){_0xe6d2b1=_0xe6d2b1||'';return this[_0xd1f2('0x25')](util['format'](_0xd1f2('0x48'),_0x1d3edf,_0xe6d2b1));};AGIChannel[_0xd1f2('0x23')][_0xd1f2('0x49')]=function(_0x2756a0){return this['exec'](_0xd1f2('0x4a'),_0x2756a0);};AGIChannel[_0xd1f2('0x23')]['wait']=function(_0x21638d){return this['exec'](_0xd1f2('0x4b'),_0x21638d);};AGIChannel['prototype'][_0xd1f2('0x18')]=function(_0x3c26ac,_0x45b0c6){this[_0xd1f2('0x2b')](util[_0xd1f2('0x29')](_0xd1f2('0x4c'),_0x3c26ac['id'],_0x3c26ac['label'],_0x45b0c6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd1f2('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 9743889..7042bad 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 _0xabd6=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x29c5f1,_0x4bdbe9){var _0xa133b8=function(_0x3df70f){while(--_0x3df70f){_0x29c5f1['push'](_0x29c5f1['shift']());}};_0xa133b8(++_0x4bdbe9);}(_0xabd6,0xa9));var _0x6abd=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0xabd6[_0x3794a0];return _0x5bdaba;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x6abd('0x0'),'E_AGI_ARGUMENT_PORT':_0x6abd('0x1'),'E_AGI_SERVER_ERROR':_0x6abd('0x2'),'E_AGI_SERVER_CLOSE':_0x6abd('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x6abd('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x6abd('0x5'),'E_AGI_SOCKET_ERROR':_0x6abd('0x6'),'E_AGI_SOCKET_CLOSE':_0x6abd('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x6abd('0x8'),'E_AGI_COMMAND_EMPTY':_0x6abd('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6abd('0xa'),'E_AGI_IVR_ENTRY':_0x6abd('0xb')};function AGIError(_0x50df67){var _0x50df67=_0x50df67||null,_0x475196=_0x475196||[],_0x13c48f=0x1,_0x107e1d='';if(!error[_0x50df67]){_0x50df67=_0x6abd('0xc');}_0x475196[_0x6abd('0xd')](error[_0x50df67]);while(arguments[_0x13c48f]){_0x475196[_0x6abd('0xd')](arguments[_0x13c48f]);_0x13c48f++;}_0x107e1d=util['format']['apply'](util,_0x475196);this['message']=_0x107e1d;this['name']=_0x50df67;}module[_0x6abd('0xe')]=AGIError; \ No newline at end of file +var _0x3e28=['E_AGI_UNDEFINED','push','format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x536a45,_0x746b23){var _0x25fede=function(_0x42aa93){while(--_0x42aa93){_0x536a45['push'](_0x536a45['shift']());}};_0x25fede(++_0x746b23);}(_0x3e28,0x66));var _0x83e2=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3e28[_0x2064e5];return _0x21a233;};'use strict';var util=require(_0x83e2('0x0'));var error={'E_AGI_UNDEFINED':_0x83e2('0x1'),'E_AGI_ARGUMENT_PORT':_0x83e2('0x2'),'E_AGI_SERVER_ERROR':_0x83e2('0x3'),'E_AGI_SERVER_CLOSE':_0x83e2('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x83e2('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x56dcda){var _0x56dcda=_0x56dcda||null,_0x42a285=_0x42a285||[],_0x56e3f2=0x1,_0x545949='';if(!error[_0x56dcda]){_0x56dcda=_0x83e2('0x6');}_0x42a285[_0x83e2('0x7')](error[_0x56dcda]);while(arguments[_0x56e3f2]){_0x42a285[_0x83e2('0x7')](arguments[_0x56e3f2]);_0x56e3f2++;}_0x545949=util[_0x83e2('0x8')][_0x83e2('0x9')](util,_0x42a285);this[_0x83e2('0xa')]=_0x545949;this[_0x83e2('0xb')]=_0x56dcda;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 5f95d85..8b445d0 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 _0x1e23=['exports','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','emit','error','message','parse','projectUpdate','E_AGI_SERVER_ERROR'];(function(_0x312005,_0x6ca5d4){var _0x11d18b=function(_0x921782){while(--_0x921782){_0x312005['push'](_0x312005['shift']());}};_0x11d18b(++_0x6ca5d4);}(_0x1e23,0x79));var _0x31e2=function(_0x52b944,_0xd9c573){_0x52b944=_0x52b944-0x0;var _0x46c2af=_0x1e23[_0x52b944];return _0x46c2af;};'use strict';var _=require('lodash');var EventEmitter=require(_0x31e2('0x0'))[_0x31e2('0x1')];var Redis=require(_0x31e2('0x2'));var AGIError=require(_0x31e2('0x3'));var config=require(_0x31e2('0x4'));config[_0x31e2('0x5')]=_[_0x31e2('0x6')](config[_0x31e2('0x5')],{'host':_0x31e2('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x31e2('0x5')]);sub['subscribe']('agi',function(_0xdba46d){if(_0xdba46d)return eventEmitter[_0x31e2('0x8')](_0x31e2('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0xdba46d));});sub['on'](_0x31e2('0xa'),function(_0x47daa2,_0x5c8889){if(_0x47daa2!=='agi')return;try{var _0x1c5e4e=JSON[_0x31e2('0xb')](_0x5c8889);eventEmitter[_0x31e2('0x8')](_0x31e2('0xc'),_0x1c5e4e);}catch(_0xacb491){eventEmitter[_0x31e2('0x8')](_0x31e2('0x9'),new AGIError(_0x31e2('0xd'),_0xacb491));}});module[_0x31e2('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xfe78=['defaults','redis','localhost','agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','error','exports','events','ioredis','../../config/environment'];(function(_0x31edd7,_0x540292){var _0x304c97=function(_0x36e67f){while(--_0x36e67f){_0x31edd7['push'](_0x31edd7['shift']());}};_0x304c97(++_0x540292);}(_0xfe78,0x1cb));var _0x8fe7=function(_0x2cab33,_0x31aabc){_0x2cab33=_0x2cab33-0x0;var _0x2b0dba=_0xfe78[_0x2cab33];return _0x2b0dba;};'use strict';var _=require('lodash');var EventEmitter=require(_0x8fe7('0x0'))['EventEmitter'];var Redis=require(_0x8fe7('0x1'));var AGIError=require('./error');var config=require(_0x8fe7('0x2'));config['redis']=_[_0x8fe7('0x3')](config[_0x8fe7('0x4')],{'host':_0x8fe7('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x8fe7('0x4')]);sub['subscribe'](_0x8fe7('0x6'),function(_0x1e9e6e){if(_0x1e9e6e)return eventEmitter[_0x8fe7('0x7')]('error',new AGIError(_0x8fe7('0x8'),_0x1e9e6e));});sub['on'](_0x8fe7('0x9'),function(_0x2b2536,_0x7f4381){if(_0x2b2536!==_0x8fe7('0x6'))return;try{var _0x378d66=JSON[_0x8fe7('0xa')](_0x7f4381);eventEmitter[_0x8fe7('0x7')](_0x8fe7('0xb'),_0x378d66);}catch(_0x3c6dbc){eventEmitter[_0x8fe7('0x7')](_0x8fe7('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x3c6dbc));}});module[_0x8fe7('0xd')]={'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 4bd19c7..88c16e3 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 _0x8581=['getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','addEdge','size','relations','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0x8581,0x163));var _0x1858=function(_0x2e4de6,_0x14e66f){_0x2e4de6=_0x2e4de6-0x0;var _0x25a586=_0x8581[_0x2e4de6];return _0x25a586;};'use strict';var _=require(_0x1858('0x0'));var logger=require(_0x1858('0x1'))(_0x1858('0x2'));var verticesWithRetry=[_0x1858('0x3'),_0x1858('0x4'),_0x1858('0x5')];var Graph=function(){this[_0x1858('0x6')]={};this['edges']={};this[_0x1858('0x7')]=0x0;};Graph[_0x1858('0x8')][_0x1858('0x9')]=function(_0x4e7681){this[_0x1858('0x6')][_0x4e7681['id']]=_0x4e7681;this[_0x1858('0xa')][_0x4e7681['id']]=[];};Graph['prototype'][_0x1858('0xb')]=function(_0x4756a2,_0x67f103,_0x1f9459){this[_0x1858('0xa')][_0x4756a2]['push']({'target':_0x67f103,'condition':_0x1f9459});this[_0x1858('0x7')]+=0x1;};Graph['prototype'][_0x1858('0xc')]=function(){return _[_0x1858('0xc')](this['vertices']);};Graph[_0x1858('0x8')][_0x1858('0xd')]=function(){return this[_0x1858('0x7')];};Graph[_0x1858('0x8')]['getVertex']=function(_0x5bc292){return this['vertices'][_0x5bc292];};Graph[_0x1858('0x8')]['traverseBFS']=function(_0x35566d,_0x445af8){if(!this[_0x1858('0x6')][_0x35566d]){return logger[_0x1858('0xe')](_0x1858('0xf'));}var _0x581c42=_0x445af8(this['vertices'][_0x35566d]);if(!_0x581c42){return logger[_0x1858('0xe')]('stop\x20traverse');}if(this[_0x1858('0xa')][_0x35566d][_0x1858('0x10')]===0x0){return logger[_0x1858('0xe')](_0x1858('0x11'));}for(var _0x4babcd=0x0,_0x19b52d=[],_0x3543ab=![];_0x4babcd\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','createSquareReport','hasOwnProperty','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','catch','[LICENSE]','listening','connection','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','projectUpdate','stack','splice','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format'];(function(_0x24a26b,_0x49c278){var _0x3ebfd0=function(_0x2f1f9c){while(--_0x2f1f9c){_0x24a26b['push'](_0x24a26b['shift']());}};_0x3ebfd0(++_0x49c278);}(_0x9c0f,0xf7));var _0xf9c0=function(_0x442f5b,_0x39d79d){_0x442f5b=_0x442f5b-0x0;var _0x19fd96=_0x9c0f[_0x442f5b];return _0x19fd96;};'use strict';var _=require('lodash');var syncho=require(_0xf9c0('0x0'));var util=require('util');var config=require(_0xf9c0('0x1'));var logger=require(_0xf9c0('0x2'))(_0xf9c0('0x3'));var utilLicense=require(_0xf9c0('0x4'));var rpc=require('./rpc');var Project=require(_0xf9c0('0x5'));var AGIEmitter=require(_0xf9c0('0x6'))[_0xf9c0('0x7')];var projects=[];config[_0xf9c0('0x3')]=_[_0xf9c0('0x8')](config[_0xf9c0('0x3')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0xf9c0('0x9'),projectUpdateHandler);function connectionHandler(_0x4b71fa){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4b71fa);agiHandler(_0x4b71fa);}catch(_0x47ce71){logger['error'](_0x47ce71[_0xf9c0('0xa')]);}});});}function projectUpdateHandler(_0x5e142e){try{var _0x5c588a=_['findIndex'](projects,['id',_0x5e142e['id']]);if(_0x5c588a>-0x1){if(_0x5e142e['deleted']===!![]){projects[_0xf9c0('0xb')](_0x5c588a,0x1);}else{projects[_0x5c588a]=_0x5e142e;}}else{projects['push'](_0x5e142e);}}catch(_0x3820b9){logger[_0xf9c0('0xc')](_0x3820b9[_0xf9c0('0xa')]);}}function listeningHandler(){console[_0xf9c0('0xd')](_0xf9c0('0xe'),config[_0xf9c0('0x3')][_0xf9c0('0xf')]);logger[_0xf9c0('0x10')](util[_0xf9c0('0x11')](_0xf9c0('0x12'),config[_0xf9c0('0x3')]['ip'],config[_0xf9c0('0x3')][_0xf9c0('0xf')]));}function errorHandler(_0x316e89){if(_0x316e89&&_0x316e89[_0xf9c0('0x13')]&&_0x316e89[_0xf9c0('0x14')]){logger[_0xf9c0('0xc')](util['format'](_0xf9c0('0x15'),_0x316e89[_0xf9c0('0x13')],_0x316e89[_0xf9c0('0x14')]));}else{logger[_0xf9c0('0xc')](util[_0xf9c0('0x11')]('[ERROR]\x20%s',_0x316e89[_0xf9c0('0xa')]));}}function closeHandler(){logger['info'](util[_0xf9c0('0x11')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xf9c0('0x16')],this['calleridname'],this['callerid'],this[_0xf9c0('0x17')],this[_0xf9c0('0x18')]));try{createSquareReport(this);}catch(_0x37be23){logger[_0xf9c0('0xc')](_0x37be23['stack']);}}function timeoutHandler(){logger[_0xf9c0('0x10')](util[_0xf9c0('0x11')](_0xf9c0('0x19'),this[_0xf9c0('0x16')],this[_0xf9c0('0x1a')],this['callerid'],this[_0xf9c0('0x17')],this[_0xf9c0('0x18')]));}function hangupHandler(){logger[_0xf9c0('0x10')](util[_0xf9c0('0x11')](_0xf9c0('0x1b'),this[_0xf9c0('0x16')],this[_0xf9c0('0x1a')],this[_0xf9c0('0x1c')],this[_0xf9c0('0x17')],this[_0xf9c0('0x18')]));this[_0xf9c0('0x1d')]=!![];}function createSquareReport(_0x4c0401,_0x1fe158){rpc[_0xf9c0('0x1e')](_0x4c0401)['then'](function(_0x33d7bc){if(_0x1fe158){_0x1fe158(null,_0x33d7bc);}})['catch'](function(_0x524998){if(_0x1fe158){_0x1fe158(null,_0x524998);}});}function setChannelVariables(_0xb469e9){for(var _0xdfdfd7 in _0xb469e9){if(_0xb469e9[_0xf9c0('0x1f')](_0xdfdfd7)){if(_0xdfdfd7['indexOf']('agi_')===0x0){_0xb469e9[_0xdfdfd7[_0xf9c0('0x20')](0x4)]=_0xb469e9[_0xdfdfd7];delete _0xb469e9[_0xdfdfd7];}}}}function agiHandler(_0x4f2ad3){logger['debug']('variables',JSON[_0xf9c0('0x21')](_0x4f2ad3,null,0x2));logger[_0xf9c0('0x10')](util['format'](_0xf9c0('0x22'),_0x4f2ad3[_0xf9c0('0x16')],_0x4f2ad3[_0xf9c0('0x1a')],_0x4f2ad3['callerid'],_0x4f2ad3[_0xf9c0('0x17')],_0x4f2ad3[_0xf9c0('0x18')]));_0x4f2ad3['on'](_0xf9c0('0xc'),errorHandler);_0x4f2ad3['on'](_0xf9c0('0x23'),closeHandler);_0x4f2ad3['on'](_0xf9c0('0x24'),timeoutHandler);_0x4f2ad3[_0xf9c0('0x1d')]=![];_0x4f2ad3['on'](_0xf9c0('0x25'),hangupHandler);var _0x487def=_['find'](projects,['name',_0x4f2ad3['arg_1']]);if(!_0x487def)return Project[_0xf9c0('0x26')](_0x4f2ad3);if(!_0x487def[_0xf9c0('0x27')])return Project[_0xf9c0('0x28')](_0x4f2ad3);return Project[_0xf9c0('0x29')](_0x487def,_0x4f2ad3);}function main(){var _0x2cf8ff;return utilLicense[_0xf9c0('0x2a')]()[_0xf9c0('0x2b')](function(_0x30f0f8){if(!_0x30f0f8)return;if(_0x30f0f8[_0xf9c0('0x2c')]){if(_0x30f0f8[_0xf9c0('0x2d')]&&_0x30f0f8[_0xf9c0('0x2d')]>0x0){logger[_0xf9c0('0x10')](util[_0xf9c0('0x11')](_0xf9c0('0x2e'),_0x30f0f8[_0xf9c0('0x2d')]));_0x2cf8ff=_0x30f0f8['callysquare'];}else{logger[_0xf9c0('0x10')](_0xf9c0('0x2f'));}}else{logger[_0xf9c0('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x2cf8ff=-0x1;}})['then'](function(){return Project[_0xf9c0('0x30')]();})[_0xf9c0('0x2b')](function(_0xe30fd0){projects=_0xe30fd0;return;})[_0xf9c0('0x31')](function(_0x49245c){logger[_0xf9c0('0xc')](_0xf9c0('0x32'),_0x49245c['stack']);})['finally'](function(){var _0x384faf=require('./server')(config[_0xf9c0('0x3')]['port'],config[_0xf9c0('0x3')]['ip'],_0x2cf8ff);_0x384faf['on'](_0xf9c0('0xc'),errorHandler);_0x384faf['on'](_0xf9c0('0x33'),listeningHandler);_0x384faf['on'](_0xf9c0('0x34'),connectionHandler);_0x384faf['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x137d=['[LICENSE]','finally','./server','connection','close','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','splice','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','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','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','then','catch','hasOwnProperty','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll'];(function(_0x3370db,_0x4cef12){var _0x260360=function(_0x4639d9){while(--_0x4639d9){_0x3370db['push'](_0x3370db['shift']());}};_0x260360(++_0x4cef12);}(_0x137d,0x13b));var _0xd137=function(_0xc80b2b,_0x5a12e9){_0xc80b2b=_0xc80b2b-0x0;var _0x22af6f=_0x137d[_0xc80b2b];return _0x22af6f;};'use strict';var _=require(_0xd137('0x0'));var syncho=require('syncho');var util=require(_0xd137('0x1'));var config=require(_0xd137('0x2'));var logger=require(_0xd137('0x3'))(_0xd137('0x4'));var utilLicense=require(_0xd137('0x5'));var rpc=require(_0xd137('0x6'));var Project=require(_0xd137('0x7'));var AGIEmitter=require(_0xd137('0x8'))[_0xd137('0x9')];var projects=[];config['agi']=_['defaults'](config[_0xd137('0x4')],{'ip':_0xd137('0xa'),'port':0x11dd});AGIEmitter['on'](_0xd137('0xb'),projectUpdateHandler);function connectionHandler(_0x16cd87){process[_0xd137('0xc')](function(){syncho(function(){try{setChannelVariables(_0x16cd87);agiHandler(_0x16cd87);}catch(_0x308adb){logger['error'](_0x308adb[_0xd137('0xd')]);}});});}function projectUpdateHandler(_0x26d0c9){try{var _0x1ae45d=_[_0xd137('0xe')](projects,['id',_0x26d0c9['id']]);if(_0x1ae45d>-0x1){if(_0x26d0c9[_0xd137('0xf')]===!![]){projects[_0xd137('0x10')](_0x1ae45d,0x1);}else{projects[_0x1ae45d]=_0x26d0c9;}}else{projects['push'](_0x26d0c9);}}catch(_0x4e90b7){logger[_0xd137('0x11')](_0x4e90b7['stack']);}}function listeningHandler(){console[_0xd137('0x12')](_0xd137('0x13'),config['agi'][_0xd137('0x14')]);logger[_0xd137('0x15')](util[_0xd137('0x16')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xd137('0x4')]['ip'],config[_0xd137('0x4')][_0xd137('0x14')]));}function errorHandler(_0x555608){if(_0x555608&&_0x555608[_0xd137('0x17')]&&_0x555608[_0xd137('0x18')]){logger['error'](util['format'](_0xd137('0x19'),_0x555608[_0xd137('0x17')],_0x555608[_0xd137('0x18')]));}else{logger['error'](util[_0xd137('0x16')](_0xd137('0x1a'),_0x555608[_0xd137('0xd')]));}}function closeHandler(){logger[_0xd137('0x15')](util[_0xd137('0x16')](_0xd137('0x1b'),this['arg_1'],this[_0xd137('0x1c')],this[_0xd137('0x1d')],this[_0xd137('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4ed10c){logger[_0xd137('0x11')](_0x4ed10c['stack']);}}function timeoutHandler(){logger[_0xd137('0x15')](util[_0xd137('0x16')](_0xd137('0x1f'),this['arg_1'],this[_0xd137('0x1c')],this[_0xd137('0x1d')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0xd137('0x15')](util[_0xd137('0x16')](_0xd137('0x20'),this[_0xd137('0x21')],this[_0xd137('0x1c')],this['callerid'],this[_0xd137('0x1e')],this[_0xd137('0x22')]));this['evtHangup']=!![];}function createSquareReport(_0x3a6388,_0x55a1f6){rpc['createSquareReport'](_0x3a6388)[_0xd137('0x23')](function(_0x4ddadd){if(_0x55a1f6){_0x55a1f6(null,_0x4ddadd);}})[_0xd137('0x24')](function(_0x5b10b9){if(_0x55a1f6){_0x55a1f6(null,_0x5b10b9);}});}function setChannelVariables(_0x17e6f4){for(var _0x2c576a in _0x17e6f4){if(_0x17e6f4[_0xd137('0x25')](_0x2c576a)){if(_0x2c576a[_0xd137('0x26')](_0xd137('0x27'))===0x0){_0x17e6f4[_0x2c576a[_0xd137('0x28')](0x4)]=_0x17e6f4[_0x2c576a];delete _0x17e6f4[_0x2c576a];}}}}function agiHandler(_0x1b8aa6){logger['debug'](_0xd137('0x29'),JSON[_0xd137('0x2a')](_0x1b8aa6,null,0x2));logger[_0xd137('0x15')](util[_0xd137('0x16')](_0xd137('0x2b'),_0x1b8aa6[_0xd137('0x21')],_0x1b8aa6['calleridname'],_0x1b8aa6[_0xd137('0x1d')],_0x1b8aa6[_0xd137('0x1e')],_0x1b8aa6[_0xd137('0x22')]));_0x1b8aa6['on'](_0xd137('0x11'),errorHandler);_0x1b8aa6['on']('close',closeHandler);_0x1b8aa6['on'](_0xd137('0x2c'),timeoutHandler);_0x1b8aa6['evtHangup']=![];_0x1b8aa6['on'](_0xd137('0x2d'),hangupHandler);var _0x423d27=_[_0xd137('0x2e')](projects,[_0xd137('0x17'),_0x1b8aa6[_0xd137('0x21')]]);if(!_0x423d27)return Project['handleNotFound'](_0x1b8aa6);if(!_0x423d27[_0xd137('0x2f')])return Project[_0xd137('0x30')](_0x1b8aa6);return Project[_0xd137('0x31')](_0x423d27,_0x1b8aa6);}function main(){var _0x23ef2c;return utilLicense[_0xd137('0x32')]()['then'](function(_0xa27bb9){if(!_0xa27bb9)return;if(_0xa27bb9[_0xd137('0x33')]){if(_0xa27bb9['callysquare']&&_0xa27bb9[_0xd137('0x34')]>0x0){logger['info'](util[_0xd137('0x16')](_0xd137('0x35'),_0xa27bb9[_0xd137('0x34')]));_0x23ef2c=_0xa27bb9[_0xd137('0x34')];}else{logger[_0xd137('0x15')](_0xd137('0x36'));}}else{logger[_0xd137('0x15')](_0xd137('0x37'));_0x23ef2c=-0x1;}})['then'](function(){return Project[_0xd137('0x38')]();})[_0xd137('0x23')](function(_0xd9d418){projects=_0xd9d418;return;})[_0xd137('0x24')](function(_0x5a52a9){logger[_0xd137('0x11')](_0xd137('0x39'),_0x5a52a9['stack']);})[_0xd137('0x3a')](function(){var _0x406ee6=require(_0xd137('0x3b'))(config[_0xd137('0x4')][_0xd137('0x14')],config[_0xd137('0x4')]['ip'],_0x23ef2c);_0x406ee6['on'](_0xd137('0x11'),errorHandler);_0x406ee6['on']('listening',listeningHandler);_0x406ee6['on'](_0xd137('0x3c'),connectionHandler);_0x406ee6['on'](_0xd137('0x3d'),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 e36cb5e..2853018 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 _0x7ccc=['then','error','message','result','bluebird','client','request'];(function(_0x57402d,_0x3ebd30){var _0x224071=function(_0x5c8d23){while(--_0x5c8d23){_0x57402d['push'](_0x57402d['shift']());}};_0x224071(++_0x3ebd30);}(_0x7ccc,0xcf));var _0xc7cc=function(_0x41a659,_0x343639){_0x41a659=_0x41a659-0x0;var _0x5618ca=_0x7ccc[_0x41a659];return _0x5618ca;};'use strict';var BPromise=require(_0xc7cc('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xc7cc('0x1')]['http']({'port':0x232b});function request(_0x8e71ab,_0x9de0d){return new BPromise(function(_0x193352,_0x425a49){return client[_0xc7cc('0x2')](_0x8e71ab,_0x9de0d)[_0xc7cc('0x3')](function(_0x1db3d8){if(_0x1db3d8['error']){return _0x425a49(_0x1db3d8[_0xc7cc('0x4')][_0xc7cc('0x5')]);}else{return _0x193352(_0x1db3d8[_0xc7cc('0x6')]);}})['catch'](function(_0x5e344e){return _0x425a49(_0x5e344e);});});}exports['sendMailMessage']=function(_0x5921aa,_0x3485cd){return request('SendMail',{'account':_0x5921aa,'message':_0x3485cd});}; \ No newline at end of file +var _0xa4d4=['request','error','message','result','catch','sendMailMessage','SendMail','http'];(function(_0x47d060,_0x4a2b1d){var _0xb2d051=function(_0x3434e7){while(--_0x3434e7){_0x47d060['push'](_0x47d060['shift']());}};_0xb2d051(++_0x4a2b1d);}(_0xa4d4,0x1df));var _0x4a4d=function(_0x3d38b1,_0xa516ca){_0x3d38b1=_0x3d38b1-0x0;var _0x3219ab=_0xa4d4[_0x3d38b1];return _0x3219ab;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson['client'][_0x4a4d('0x0')]({'port':0x232b});function request(_0x54e29b,_0x312d4f){return new BPromise(function(_0x27e4a3,_0x514e23){return client[_0x4a4d('0x1')](_0x54e29b,_0x312d4f)['then'](function(_0x556555){if(_0x556555[_0x4a4d('0x2')]){return _0x514e23(_0x556555['error'][_0x4a4d('0x3')]);}else{return _0x27e4a3(_0x556555[_0x4a4d('0x4')]);}})[_0x4a4d('0x5')](function(_0x3d893b){return _0x514e23(_0x3d893b);});});}exports[_0x4a4d('0x6')]=function(_0x519d30,_0x4a9ab9){return request(_0x4a4d('0x7'),{'account':_0x519d30,'message':_0x4a9ab9});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index c01d4d6..1c6a749 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 _0xddee=['./rpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','value','toJson','mxGraphModel','root','production','start','debug','stringify','joinAt','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','dnid','uniqueid','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger'];(function(_0x2def61,_0x4a613a){var _0x1f85be=function(_0x5c0754){while(--_0x5c0754){_0x2def61['push'](_0x2def61['shift']());}};_0x1f85be(++_0x4a613a);}(_0xddee,0xa4));var _0xedde=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xddee[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require(_0xedde('0x0'));var moment=require(_0xedde('0x1'));var parser=require('xml2json');var util=require(_0xedde('0x2'));var logger=require(_0xedde('0x3'))('agi');var rpc=require(_0xedde('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0xedde('0x5'));var Vertices=require(_0xedde('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xedde('0x7')]()['catch'](function(_0x4f65da){logger[_0xedde('0x8')](_0xedde('0x9'),_0x4f65da[_0xedde('0xa')]);return[];});}function addVertex(_0x16b6ea,_0x3e0488,_0x5f45c7){_0x3e0488[_0xedde('0xb')]=_0x5f45c7;if(_0x3e0488['hasOwnProperty'](_0xedde('0xc'))){_0x3e0488[_0xedde('0xd')]=parseInt(_0x3e0488[_0xedde('0xc')],0xa);}_0x16b6ea[_0xedde('0xe')](_[_0xedde('0xf')](_0x3e0488,_0xedde('0x10')));}function initGraph(_0x14a412,_0x517c43){var _0x215da5=new Graph();for(var _0x24d277 in _0x14a412){if(_0x14a412['hasOwnProperty'](_0x24d277)){if(_[_0xedde('0x11')](_0x14a412[_0x24d277])){for(var _0x17a21c=0x0;_0x17a21c<_0x14a412[_0x24d277][_0xedde('0x12')];_0x17a21c+=0x1){addVertex(_0x215da5,_0x14a412[_0x24d277][_0x17a21c],_0x24d277);}}else{addVertex(_0x215da5,_0x14a412[_0x24d277],_0x24d277);}}}for(var _0x18c2da=0x0;_0x18c2da<_0x517c43[_0xedde('0x12')];_0x18c2da+=0x1){if(_0x517c43[_0x18c2da]['source']&&_0x517c43[_0x18c2da][_0xedde('0x13')]){_0x215da5['addEdge'](_0x517c43[_0x18c2da]['source'],_0x517c43[_0x18c2da][_0xedde('0x13')],_0x517c43[_0x18c2da][_0xedde('0x14')]);}}return _0x215da5;}function getRoot(_0x1e3bc6){return parser[_0xedde('0x15')](_0x1e3bc6,{'object':!![]})[_0xedde('0x16')][_0xedde('0x17')];}function inspect(_0x409bbd){return util['inspect'](_0x409bbd,{'showHidden':![],'depth':null});}function initialize(_0x37afb1,_0x19bd17){var _0x4a3539=getRoot(_0x37afb1[_0xedde('0x18')]);if(!_0x4a3539||!_0x4a3539[_0xedde('0x19')])return;var _0x14ea0d,_0x1801a4,_0x2676fc;logger[_0xedde('0x1a')](_0xedde('0x17'),JSON[_0xedde('0x1b')](_0x4a3539,null,0x2));_0x19bd17[_0xedde('0x1c')]=moment()[_0xedde('0x1d')](_0xedde('0x1e'));_0x14ea0d=initGraph(_[_0xedde('0xf')](_0x4a3539,'mxCell'),_0x4a3539[_0xedde('0x10')]);_0x1801a4=new Vertices(_0x19bd17,rpc,mailRpc);logger[_0xedde('0x1f')](util['format'](_0xedde('0x20'),_0x19bd17[_0xedde('0x21')],_0x19bd17[_0xedde('0x22')],_0x19bd17[_0xedde('0x23')],_0x19bd17[_0xedde('0x24')],_0x19bd17[_0xedde('0x25')]));_0x14ea0d['traverseBFS'](_0x4a3539[_0xedde('0x19')]['id'],function(_0x5af11c){try{_0x5af11c=_0x1801a4[_0xedde('0x26')](_0x5af11c);logger['debug'](_0xedde('0x27'),JSON[_0xedde('0x1b')](_0x5af11c,null,0x2));if(_0x5af11c['agicommand']==='gotoc'){logger[_0xedde('0x1f')](_0xedde('0x28'));_0x19bd17[_0xedde('0x29')]=_0x5af11c[_0xedde('0x29')]||_0x19bd17[_0xedde('0x29')];_0x19bd17['extension']=_0x5af11c[_0xedde('0x2a')];_0x19bd17[_0xedde('0x2b')]=_0x5af11c[_0xedde('0x2b')]?_0x5af11c['priority']-0x1:0x1;return null;}else if(_0x5af11c&&_0x1801a4[_0x5af11c[_0xedde('0xb')]]){_0x2676fc=_0x1801a4[_0x5af11c['agicommand']](_0x5af11c);logger[_0xedde('0x1f')](_0xedde('0x2c'),JSON[_0xedde('0x1b')](_0x2676fc,null,0x2));if(_0x2676fc&&_0x2676fc['code']===AGI_CODE_SUCCESS&&_0x2676fc['result']!==AGI_RESULT_ERROR&&!_0x19bd17['evtHangup']){logger[_0xedde('0x1a')](_0xedde('0x2c'),inspect(_0x2676fc));return _[_0xedde('0x2d')](_0x2676fc[_0xedde('0x2e')])?null:_0x2676fc['result'][_0xedde('0x2f')]();}else{logger[_0xedde('0x8')]('response',inspect(_0x2676fc));return null;}}else{logger[_0xedde('0x8')](_0xedde('0x30'));return null;}}catch(_0x5b7265){logger['error'](_0x5b7265['stack']);return null;}});if(_0x4a3539[_0xedde('0x31')]){logger[_0xedde('0x1f')](util[_0xedde('0x1d')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x19bd17[_0xedde('0x21')],_0x19bd17[_0xedde('0x22')],_0x19bd17[_0xedde('0x23')],_0x19bd17['dnid'],_0x19bd17[_0xedde('0x25')]));_0x14ea0d[_0xedde('0x32')](_0x4a3539[_0xedde('0x31')]['id'],function(_0x5606b9){try{_0x5606b9=_0x1801a4[_0xedde('0x26')](_0x5606b9);logger['debug'](_0xedde('0x27'),JSON['stringify'](_0x5606b9,null,0x2));if(_0x5606b9&&_0x1801a4[_0x5606b9[_0xedde('0xb')]]){_0x2676fc=_0x1801a4[_0x5606b9[_0xedde('0xb')]](_0x5606b9);if(_0x2676fc){logger[_0xedde('0x1a')](_0xedde('0x2c'),inspect(_0x2676fc));return _[_0xedde('0x2d')](_0x2676fc[_0xedde('0x2e')])?null:_0x2676fc['result'][_0xedde('0x2f')]();}else{logger[_0xedde('0x8')](_0xedde('0x2c'),inspect(_0x2676fc));return null;}}else{logger[_0xedde('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x281f2c){logger[_0xedde('0x8')](_0x281f2c['stack']);return null;}});}logger['info'](util[_0xedde('0x1d')](_0xedde('0x33'),_0x19bd17[_0xedde('0x21')],_0x19bd17[_0xedde('0x22')],_0x19bd17[_0xedde('0x23')],_0x19bd17[_0xedde('0x24')],_0x19bd17[_0xedde('0x25')]));logger['info'](util[_0xedde('0x1d')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x19bd17[_0xedde('0x29')],_0x19bd17[_0xedde('0x2a')],parseInt(_0x19bd17[_0xedde('0x2b')],0xa)+0x1));_0x19bd17[_0xedde('0x34')](_0x19bd17['context'],_0x19bd17[_0xedde('0x2a')],parseInt(_0x19bd17[_0xedde('0x2b')],0xa)+0x1);_0x19bd17['close']();}function handleNotFound(_0x1de59c){logger[_0xedde('0x8')](util[_0xedde('0x1d')]('Project\x20%s\x20not\x20found',_0x1de59c[_0xedde('0x21')]));_0x1de59c[_0xedde('0x34')](_0x1de59c['context'],_0x1de59c[_0xedde('0x2a')],parseInt(_0x1de59c[_0xedde('0x2b')],0xa)+0x1);_0x1de59c[_0xedde('0x35')]();}function handleUnpublished(_0x3c7092){logger[_0xedde('0x8')](util['format'](_0xedde('0x36'),_0x3c7092[_0xedde('0x21')]));_0x3c7092[_0xedde('0x34')](_0x3c7092[_0xedde('0x29')],_0x3c7092[_0xedde('0x2a')],parseInt(_0x3c7092[_0xedde('0x2b')],0xa)+0x1);_0x3c7092[_0xedde('0x35')]();}module[_0xedde('0x37')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x1b82=['vertex','isUndefined','toString','[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','close','Project\x20%s\x20not\x20found','continueAt','exports','lodash','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','omit','isArray','length','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','format','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1'];(function(_0x21b75e,_0x80026a){var _0x4bf785=function(_0x1aad97){while(--_0x1aad97){_0x21b75e['push'](_0x21b75e['shift']());}};_0x4bf785(++_0x80026a);}(_0x1b82,0xc0));var _0x21b8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1b82[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x21b8('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require('util');var logger=require(_0x21b8('0x1'))('agi');var rpc=require(_0x21b8('0x2'));var mailRpc=require(_0x21b8('0x3'));var Graph=require(_0x21b8('0x4'));var Vertices=require(_0x21b8('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x21b8('0x6')]()[_0x21b8('0x7')](function(_0x17439c){logger[_0x21b8('0x8')](_0x21b8('0x9'),_0x17439c[_0x21b8('0xa')]);return[];});}function addVertex(_0x433c65,_0x2319cd,_0xa13cf6){_0x2319cd[_0x21b8('0xb')]=_0xa13cf6;if(_0x2319cd[_0x21b8('0xc')]('retry')){_0x2319cd['maxRetry']=parseInt(_0x2319cd[_0x21b8('0xd')],0xa);}_0x433c65['addVertex'](_[_0x21b8('0xe')](_0x2319cd,'mxCell'));}function initGraph(_0x14f448,_0xf290f2){var _0x2f2acf=new Graph();for(var _0x221c1a in _0x14f448){if(_0x14f448['hasOwnProperty'](_0x221c1a)){if(_[_0x21b8('0xf')](_0x14f448[_0x221c1a])){for(var _0x52b398=0x0;_0x52b398<_0x14f448[_0x221c1a][_0x21b8('0x10')];_0x52b398+=0x1){addVertex(_0x2f2acf,_0x14f448[_0x221c1a][_0x52b398],_0x221c1a);}}else{addVertex(_0x2f2acf,_0x14f448[_0x221c1a],_0x221c1a);}}}for(var _0x21d6a1=0x0;_0x21d6a1<_0xf290f2[_0x21b8('0x10')];_0x21d6a1+=0x1){if(_0xf290f2[_0x21d6a1]['source']&&_0xf290f2[_0x21d6a1][_0x21b8('0x11')]){_0x2f2acf[_0x21b8('0x12')](_0xf290f2[_0x21d6a1]['source'],_0xf290f2[_0x21d6a1]['target'],_0xf290f2[_0x21d6a1][_0x21b8('0x13')]);}}return _0x2f2acf;}function getRoot(_0x55984b){return parser[_0x21b8('0x14')](_0x55984b,{'object':!![]})[_0x21b8('0x15')][_0x21b8('0x16')];}function inspect(_0x44ae97){return util[_0x21b8('0x17')](_0x44ae97,{'showHidden':![],'depth':null});}function initialize(_0x3b684b,_0x23972f){var _0x21dcd3=getRoot(_0x3b684b[_0x21b8('0x18')]);if(!_0x21dcd3||!_0x21dcd3[_0x21b8('0x19')])return;var _0x312359,_0x5c0792,_0x4eb0e6;logger[_0x21b8('0x1a')](_0x21b8('0x16'),JSON[_0x21b8('0x1b')](_0x21dcd3,null,0x2));_0x23972f[_0x21b8('0x1c')]=moment()['format'](_0x21b8('0x1d'));_0x312359=initGraph(_[_0x21b8('0xe')](_0x21dcd3,_0x21b8('0x1e')),_0x21dcd3[_0x21b8('0x1e')]);_0x5c0792=new Vertices(_0x23972f,rpc,mailRpc);logger[_0x21b8('0x1f')](util[_0x21b8('0x20')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x23972f['arg_1'],_0x23972f[_0x21b8('0x21')],_0x23972f[_0x21b8('0x22')],_0x23972f[_0x21b8('0x23')],_0x23972f[_0x21b8('0x24')]));_0x312359[_0x21b8('0x25')](_0x21dcd3['start']['id'],function(_0x1519d5){try{_0x1519d5=_0x5c0792[_0x21b8('0x26')](_0x1519d5);logger['debug']('vertex',JSON[_0x21b8('0x1b')](_0x1519d5,null,0x2));if(_0x1519d5[_0x21b8('0xb')]===_0x21b8('0x27')){logger[_0x21b8('0x1f')](_0x21b8('0x28'));_0x23972f['context']=_0x1519d5[_0x21b8('0x29')]||_0x23972f[_0x21b8('0x29')];_0x23972f[_0x21b8('0x2a')]=_0x1519d5[_0x21b8('0x2a')];_0x23972f['priority']=_0x1519d5[_0x21b8('0x2b')]?_0x1519d5[_0x21b8('0x2b')]-0x1:0x1;return null;}else if(_0x1519d5&&_0x5c0792[_0x1519d5[_0x21b8('0xb')]]){_0x4eb0e6=_0x5c0792[_0x1519d5[_0x21b8('0xb')]](_0x1519d5);logger['info'](_0x21b8('0x2c'),JSON[_0x21b8('0x1b')](_0x4eb0e6,null,0x2));if(_0x4eb0e6&&_0x4eb0e6[_0x21b8('0x2d')]===AGI_CODE_SUCCESS&&_0x4eb0e6[_0x21b8('0x2e')]!==AGI_RESULT_ERROR&&!_0x23972f[_0x21b8('0x2f')]){logger[_0x21b8('0x1a')](_0x21b8('0x2c'),inspect(_0x4eb0e6));return _['isUndefined'](_0x4eb0e6[_0x21b8('0x2e')])?null:_0x4eb0e6['result']['toString']();}else{logger[_0x21b8('0x8')](_0x21b8('0x2c'),inspect(_0x4eb0e6));return null;}}else{logger[_0x21b8('0x8')](_0x21b8('0x30'));return null;}}catch(_0x2a4d35){logger[_0x21b8('0x8')](_0x2a4d35['stack']);return null;}});if(_0x21dcd3[_0x21b8('0x31')]){logger['info'](util[_0x21b8('0x20')](_0x21b8('0x32'),_0x23972f[_0x21b8('0x33')],_0x23972f[_0x21b8('0x21')],_0x23972f[_0x21b8('0x22')],_0x23972f[_0x21b8('0x23')],_0x23972f[_0x21b8('0x24')]));_0x312359[_0x21b8('0x25')](_0x21dcd3[_0x21b8('0x31')]['id'],function(_0xeb7e4f){try{_0xeb7e4f=_0x5c0792['clear'](_0xeb7e4f);logger[_0x21b8('0x1a')](_0x21b8('0x34'),JSON[_0x21b8('0x1b')](_0xeb7e4f,null,0x2));if(_0xeb7e4f&&_0x5c0792[_0xeb7e4f['agicommand']]){_0x4eb0e6=_0x5c0792[_0xeb7e4f[_0x21b8('0xb')]](_0xeb7e4f);if(_0x4eb0e6){logger['debug'](_0x21b8('0x2c'),inspect(_0x4eb0e6));return _[_0x21b8('0x35')](_0x4eb0e6[_0x21b8('0x2e')])?null:_0x4eb0e6['result'][_0x21b8('0x36')]();}else{logger['error'](_0x21b8('0x2c'),inspect(_0x4eb0e6));return null;}}else{logger['error'](_0x21b8('0x30'));return null;}}catch(_0x35f79d){logger[_0x21b8('0x8')](_0x35f79d[_0x21b8('0xa')]);return null;}});}logger[_0x21b8('0x1f')](util['format'](_0x21b8('0x37'),_0x23972f[_0x21b8('0x33')],_0x23972f[_0x21b8('0x21')],_0x23972f[_0x21b8('0x22')],_0x23972f['dnid'],_0x23972f[_0x21b8('0x24')]));logger[_0x21b8('0x1f')](util[_0x21b8('0x20')](_0x21b8('0x38'),_0x23972f['context'],_0x23972f['extension'],parseInt(_0x23972f[_0x21b8('0x2b')],0xa)+0x1));_0x23972f['continueAt'](_0x23972f[_0x21b8('0x29')],_0x23972f[_0x21b8('0x2a')],parseInt(_0x23972f[_0x21b8('0x2b')],0xa)+0x1);_0x23972f[_0x21b8('0x39')]();}function handleNotFound(_0x14ee28){logger['error'](util[_0x21b8('0x20')](_0x21b8('0x3a'),_0x14ee28[_0x21b8('0x33')]));_0x14ee28[_0x21b8('0x3b')](_0x14ee28[_0x21b8('0x29')],_0x14ee28['extension'],parseInt(_0x14ee28[_0x21b8('0x2b')],0xa)+0x1);_0x14ee28[_0x21b8('0x39')]();}function handleUnpublished(_0x1c1dff){logger[_0x21b8('0x8')](util[_0x21b8('0x20')]('Project\x20%s\x20not\x20published',_0x1c1dff[_0x21b8('0x33')]));_0x1c1dff[_0x21b8('0x3b')](_0x1c1dff[_0x21b8('0x29')],_0x1c1dff[_0x21b8('0x2a')],parseInt(_0x1c1dff[_0x21b8('0x2b')],0xa)+0x1);_0x1c1dff[_0x21b8('0x39')]();}module[_0x21b8('0x3c')]={'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 a450c28..b619f5c 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 _0x6f21=['_localBuffer','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','slice','trim','emit','line','exports','Transform','call'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x6f21,0x1da));var _0x16f2=function(_0x14eba6,_0x395ec9){_0x14eba6=_0x14eba6-0x0;var _0x37f5ad=_0x6f21[_0x14eba6];return _0x37f5ad;};'use strict';var util=require('util');var Transform=require('stream')[_0x16f2('0x0')];function AGIReply(_0x42c79d){Transform[_0x16f2('0x1')](this,_0x42c79d);this[_0x16f2('0x2')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x16f2('0x3')][_0x16f2('0x4')]=function(_0x1fb687,_0x3ad27f,_0x12a7c5){var _0x39256e='\x0a',_0x3bdd2c=['\x0a\x0a',_0x16f2('0x5')],_0xdfb0e=-0x1,_0x44b16c=-0x1,_0x1bae05='',_0x489828=0x0,_0x38a2b8='',_0x5c28d0='';this[_0x16f2('0x2')]+=_0x1fb687[_0x16f2('0x6')]();_0x38a2b8=this[_0x16f2('0x2')];if(!this[_0x16f2('0x7')]){_0x489828=0x0;while(_0x3bdd2c[_0x489828]){while((_0x44b16c=_0x38a2b8[_0x16f2('0x8')](_0x3bdd2c[_0x489828]))!=-0x1){_0x1bae05=_0x3bdd2c[_0x489828];_0x5c28d0=_0x38a2b8[_0x16f2('0x9')](0x0,_0x44b16c);_0x38a2b8=_0x38a2b8['substring'](_0x44b16c+_0x1bae05[_0x16f2('0xa')]);var _0x1fb49b=_0x5c28d0[_0x16f2('0xb')](_0x39256e),_0x455e49=0x0,_0x110be9={},_0x4a8cbb='',_0x42220c='',_0x37b32b=-0x1;while(_0x1fb49b[_0x455e49]){_0x37b32b=_0x1fb49b[_0x455e49]['indexOf'](':');if(_0x37b32b!=-0x1){_0x4a8cbb=_0x1fb49b[_0x455e49][_0x16f2('0xc')](0x0,_0x37b32b)[_0x16f2('0xd')]();_0x42220c=_0x1fb49b[_0x455e49][_0x16f2('0xc')](_0x37b32b+0x1)[_0x16f2('0xd')]();if(_0x4a8cbb[_0x16f2('0xa')]>0x0){_0x110be9[_0x4a8cbb]=_0x42220c;}}else{}_0x455e49++;}this[_0x16f2('0xe')]('headers',_0x110be9);this[_0x16f2('0x7')]=!![];}_0x489828++;}this['_localBuffer']=_0x38a2b8;}else{while((_0xdfb0e=_0x38a2b8['indexOf'](_0x39256e))!=-0x1){_0x5c28d0=_0x38a2b8['substring'](0x0,_0xdfb0e);this[_0x16f2('0xe')](_0x16f2('0xf'),_0x5c28d0);_0x38a2b8=_0x38a2b8['substring'](_0xdfb0e+_0x39256e[_0x16f2('0xa')]);}this['_localBuffer']=_0x38a2b8;}_0x12a7c5();};module[_0x16f2('0x10')]=AGIReply; \ No newline at end of file +var _0x5668=['_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','split','indexOf','emit','headers','line','exports','util','stream','Transform','call','_localBuffer'];(function(_0x5223dd,_0x46cf50){var _0x4b4077=function(_0x17e3d6){while(--_0x17e3d6){_0x5223dd['push'](_0x5223dd['shift']());}};_0x4b4077(++_0x46cf50);}(_0x5668,0x8b));var _0x8566=function(_0x5e52d4,_0x5eb25e){_0x5e52d4=_0x5e52d4-0x0;var _0x440ea9=_0x5668[_0x5e52d4];return _0x440ea9;};'use strict';var util=require(_0x8566('0x0'));var Transform=require(_0x8566('0x1'))[_0x8566('0x2')];function AGIReply(_0x3297a3){Transform[_0x8566('0x3')](this,_0x3297a3);this[_0x8566('0x4')]='';this[_0x8566('0x5')]=![];}util[_0x8566('0x6')](AGIReply,Transform);AGIReply[_0x8566('0x7')][_0x8566('0x8')]=function(_0x174099,_0x1a25d0,_0x2f958c){var _0x4885d6='\x0a',_0x355fce=['\x0a\x0a',_0x8566('0x9')],_0x2ffec4=-0x1,_0x49f55a=-0x1,_0x4aaf3f='',_0x4045ed=0x0,_0x4cbf90='',_0x555ffa='';this['_localBuffer']+=_0x174099[_0x8566('0xa')]();_0x4cbf90=this[_0x8566('0x4')];if(!this[_0x8566('0x5')]){_0x4045ed=0x0;while(_0x355fce[_0x4045ed]){while((_0x49f55a=_0x4cbf90['indexOf'](_0x355fce[_0x4045ed]))!=-0x1){_0x4aaf3f=_0x355fce[_0x4045ed];_0x555ffa=_0x4cbf90[_0x8566('0xb')](0x0,_0x49f55a);_0x4cbf90=_0x4cbf90[_0x8566('0xb')](_0x49f55a+_0x4aaf3f['length']);var _0x4ca241=_0x555ffa[_0x8566('0xc')](_0x4885d6),_0x51c3ba=0x0,_0x522618={},_0x11e0a5='',_0x3318a3='',_0x2025a2=-0x1;while(_0x4ca241[_0x51c3ba]){_0x2025a2=_0x4ca241[_0x51c3ba][_0x8566('0xd')](':');if(_0x2025a2!=-0x1){_0x11e0a5=_0x4ca241[_0x51c3ba]['slice'](0x0,_0x2025a2)['trim']();_0x3318a3=_0x4ca241[_0x51c3ba]['slice'](_0x2025a2+0x1)['trim']();if(_0x11e0a5['length']>0x0){_0x522618[_0x11e0a5]=_0x3318a3;}}else{}_0x51c3ba++;}this[_0x8566('0xe')](_0x8566('0xf'),_0x522618);this[_0x8566('0x5')]=!![];}_0x4045ed++;}this[_0x8566('0x4')]=_0x4cbf90;}else{while((_0x2ffec4=_0x4cbf90[_0x8566('0xd')](_0x4885d6))!=-0x1){_0x555ffa=_0x4cbf90['substring'](0x0,_0x2ffec4);this[_0x8566('0xe')](_0x8566('0x10'),_0x555ffa);_0x4cbf90=_0x4cbf90[_0x8566('0xb')](_0x2ffec4+_0x4885d6['length']);}this[_0x8566('0x4')]=_0x4cbf90;}_0x2f958c();};module[_0x8566('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 8e9d91b..8340f85 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 _0xf1e1=['Intervals','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','LogoutUser','lodash','jayson/promise','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','ShowSound','save_name','getIntervalById','ShowInterval','Interval'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0xf1e1,0x102));var _0x1f1e=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0xf1e1[_0x466bc5];return _0x138952;};'use strict';var _=require(_0x1f1e('0x0'));var moment=require('moment');var jayson=require(_0x1f1e('0x1'));var client=jayson['client'][_0x1f1e('0x2')]({'port':0x2329});function request(_0x490554,_0xdd125){return new Promise(function(_0x1cad88,_0x2243c6){return client[_0x1f1e('0x3')](_0x490554,_0xdd125)[_0x1f1e('0x4')](function(_0x4453c6){if(_0x4453c6[_0x1f1e('0x5')]){return _0x2243c6(_0x4453c6[_0x1f1e('0x5')][_0x1f1e('0x6')]);}else{return _0x1cad88(_0x4453c6[_0x1f1e('0x7')]);}})[_0x1f1e('0x8')](function(_0x3699d2){return _0x2243c6(_0x3699d2);});});}exports[_0x1f1e('0x9')]=function(){return request(_0x1f1e('0xa'),{'options':{'raw':![],'attributes':['id','name',_0x1f1e('0xb')]}});};exports[_0x1f1e('0xc')]=function(_0x12c2ca){return request(_0x1f1e('0xd'),{'options':{'raw':![],'where':{'name':_0x12c2ca},'attributes':[_0x1f1e('0xb')]}});};exports[_0x1f1e('0xe')]=function(_0x29aa81){return request(_0x1f1e('0xf'),{'options':{'raw':![],'where':{'id':_0x29aa81},'include':[{'model':_0x1f1e('0x10'),'as':'Smtp','include':[{'model':_0x1f1e('0x11'),'as':_0x1f1e('0x11')}]}],'attributes':['id',_0x1f1e('0x12'),_0x1f1e('0x13')],'smtp':!![]}});};exports[_0x1f1e('0x14')]=function(_0x3a0261){return request(_0x1f1e('0xd'),{'options':{'where':{'id':_0x3a0261},'attributes':['name']}});};exports[_0x1f1e('0x15')]=function(_0x4609c4){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4609c4},'attributes':[_0x1f1e('0x12')]}});};exports[_0x1f1e('0x16')]=function(_0x5b075c){return request(_0x1f1e('0x17'),{'options':{'where':{'id':_0x5b075c},'attributes':[_0x1f1e('0x12')]}});};exports[_0x1f1e('0x18')]=function(_0x2b0a44){return request(_0x1f1e('0x19'),{'options':{'where':{'id':_0x2b0a44},'attributes':[_0x1f1e('0x1a')]}});};exports[_0x1f1e('0x1b')]=function(_0x2e9227){return request(_0x1f1e('0x1c'),{'options':{'where':{'id':_0x2e9227},'attributes':['name']}});};exports[_0x1f1e('0x1d')]=function(_0x14f812){return request('GetContactByPhone',{'options':{'where':{'phone':_0x14f812[_0x1f1e('0x1e')]},'attributes':['id']}});};exports[_0x1f1e('0x1f')]=function(_0xb1f54f){return request('ShowTrunk',{'options':{'where':{'id':_0xb1f54f},'attributes':['name']}});};exports['getSoundById']=function(_0x1d18d9){return request(_0x1f1e('0x20'),{'options':{'where':{'id':_0x1d18d9},'attributes':[_0x1f1e('0x21')]}});};exports[_0x1f1e('0x22')]=function(_0x300f60){return request(_0x1f1e('0x23'),{'options':{'raw':![],'where':{'id':_0x300f60},'include':[{'model':_0x1f1e('0x24'),'as':_0x1f1e('0x25')}]}});};exports['getSmsAccountById']=function(_0x497c57){return request('ShowSmsAccount',{'options':{'where':{'id':_0x497c57},'attributes':['id',_0x1f1e('0x12')]}});};exports[_0x1f1e('0x26')]=function(_0x2830d0){return request(_0x1f1e('0x27'),{'body':_0x2830d0});};exports['createSquareDetailsReport']=function(_0x79c4db){return request(_0x1f1e('0x28'),{'body':_0x79c4db});};exports[_0x1f1e('0x29')]=function(_0x4be237){return request('CreateSquareReport',{'body':_[_0x1f1e('0x2a')](_0x4be237,{'project_name':_0x4be237[_0x1f1e('0x2b')],'prev_project_name':_0x4be237[_0x1f1e('0x2c')]||'','is_subproject':_0x4be237['arg_2']?!![]:![],'leaveAt':moment()[_0x1f1e('0x2d')](_0x1f1e('0x2e'))})});};exports['createSquareRecording']=function(_0x3689fc){return request('CreateSquareRecording',{'body':_0x3689fc});};exports[_0x1f1e('0x2f')]=function(_0xe84434){return request(_0x1f1e('0x30'),{'body':_0xe84434});};exports[_0x1f1e('0x31')]=function(_0xa2076c){return request(_0x1f1e('0x32'),{'options':{'raw':![],'where':{'phone':_0xa2076c['phone'],'ListId':_0xa2076c[_0x1f1e('0x33')]}}})[_0x1f1e('0x4')](function(_0x290a3b){if(_0x290a3b){return _0x290a3b;}return request(_0x1f1e('0x34'),{'body':_0xa2076c});});};exports[_0x1f1e('0x35')]=function(_0x23729b){return request(_0x1f1e('0x36'),{'options':{'where':{'id':_0x23729b},'attributes':['name']}});};exports[_0x1f1e('0x37')]=function(_0xfbc2f8,_0x2b258f){return request(_0x1f1e('0x38'),{'body':{'interface':_0x2b258f},'options':{'where':_0xfbc2f8}});};exports[_0x1f1e('0x39')]=function(_0xee02ed,_0x11fb5c,_0x16e81f){return request('PauseUser',{'body':{'type':_0x11fb5c,'uniqueid':_0x16e81f},'options':{'where':_0xee02ed}});};exports['agentUnpause']=function(_0x676066){return request('UnpauseUser',{'body':{},'options':{'where':_0x676066}});};exports['agentLogout']=function(_0x60848a){return request(_0x1f1e('0x3a'),{'body':{},'options':{'where':_0x60848a}});}; \ No newline at end of file +var _0xf874=['CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','then','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport'];(function(_0x3ce478,_0x3ef794){var _0x4280dd=function(_0x1140c0){while(--_0x1140c0){_0x3ce478['push'](_0x3ce478['shift']());}};_0x4280dd(++_0x3ef794);}(_0xf874,0x177));var _0x4f87=function(_0xa89bfe,_0x4b6ea2){_0xa89bfe=_0xa89bfe-0x0;var _0x42fba2=_0xf874[_0xa89bfe];return _0x42fba2;};'use strict';var _=require(_0x4f87('0x0'));var moment=require('moment');var jayson=require(_0x4f87('0x1'));var client=jayson[_0x4f87('0x2')][_0x4f87('0x3')]({'port':0x2329});function request(_0xe07d73,_0x18fe31){return new Promise(function(_0xe4464e,_0x87123d){return client['request'](_0xe07d73,_0x18fe31)[_0x4f87('0x4')](function(_0xe6e413){if(_0xe6e413['error']){return _0x87123d(_0xe6e413['error']['message']);}else{return _0xe4464e(_0xe6e413['result']);}})['catch'](function(_0x2aeac4){return _0x87123d(_0x2aeac4);});});}exports['getSquareProjects']=function(){return request(_0x4f87('0x5'),{'options':{'raw':![],'attributes':['id',_0x4f87('0x6'),_0x4f87('0x7')]}});};exports[_0x4f87('0x8')]=function(_0x4dfb28){return request(_0x4f87('0x9'),{'options':{'raw':![],'where':{'name':_0x4dfb28},'attributes':[_0x4f87('0x7')]}});};exports[_0x4f87('0xa')]=function(_0x1777bb){return request(_0x4f87('0xb'),{'options':{'raw':![],'where':{'id':_0x1777bb},'include':[{'model':_0x4f87('0xc'),'as':_0x4f87('0xd'),'include':[{'model':_0x4f87('0xe'),'as':_0x4f87('0xe')}]}],'attributes':['id',_0x4f87('0x6'),_0x4f87('0xf')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2ccfda){return request(_0x4f87('0x9'),{'options':{'where':{'id':_0x2ccfda},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x1dcbf9){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1dcbf9},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x10')]=function(_0x24ac31){return request(_0x4f87('0x11'),{'options':{'where':{'id':_0x24ac31},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x12')]=function(_0x3c327b){return request(_0x4f87('0x13'),{'options':{'where':{'id':_0x3c327b},'attributes':[_0x4f87('0x14')]}});};exports[_0x4f87('0x15')]=function(_0x3ffd7b){return request(_0x4f87('0x16'),{'options':{'where':{'id':_0x3ffd7b},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x17')]=function(_0x8b401b){return request(_0x4f87('0x18'),{'options':{'where':{'phone':_0x8b401b[_0x4f87('0x19')]},'attributes':['id']}});};exports[_0x4f87('0x1a')]=function(_0x135f44){return request('ShowTrunk',{'options':{'where':{'id':_0x135f44},'attributes':[_0x4f87('0x6')]}});};exports[_0x4f87('0x1b')]=function(_0x4f1934){return request(_0x4f87('0x1c'),{'options':{'where':{'id':_0x4f1934},'attributes':[_0x4f87('0x1d')]}});};exports['getIntervalById']=function(_0x26ac97){return request(_0x4f87('0x1e'),{'options':{'raw':![],'where':{'id':_0x26ac97},'include':[{'model':_0x4f87('0x1f'),'as':_0x4f87('0x20')}]}});};exports['getSmsAccountById']=function(_0x2eded4){return request(_0x4f87('0x21'),{'options':{'where':{'id':_0x2eded4},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x345622){return request(_0x4f87('0x22'),{'body':_0x345622});};exports[_0x4f87('0x23')]=function(_0x1179eb){return request(_0x4f87('0x24'),{'body':_0x1179eb});};exports[_0x4f87('0x25')]=function(_0x23ce03){return request(_0x4f87('0x26'),{'body':_['merge'](_0x23ce03,{'project_name':_0x23ce03[_0x4f87('0x27')],'prev_project_name':_0x23ce03[_0x4f87('0x28')]||'','is_subproject':_0x23ce03[_0x4f87('0x28')]?!![]:![],'leaveAt':moment()[_0x4f87('0x29')](_0x4f87('0x2a'))})});};exports[_0x4f87('0x2b')]=function(_0x24d2bb){return request(_0x4f87('0x2c'),{'body':_0x24d2bb});};exports[_0x4f87('0x2d')]=function(_0x1d7421){return request(_0x4f87('0x2e'),{'body':_0x1d7421});};exports[_0x4f87('0x2f')]=function(_0x3c2b61){return request(_0x4f87('0x30'),{'options':{'raw':![],'where':{'phone':_0x3c2b61[_0x4f87('0x19')],'ListId':_0x3c2b61[_0x4f87('0x31')]}}})[_0x4f87('0x4')](function(_0x214a96){if(_0x214a96){return _0x214a96;}return request(_0x4f87('0x32'),{'body':_0x3c2b61});});};exports['getPauseById']=function(_0x3c8c8c){return request(_0x4f87('0x33'),{'options':{'where':{'id':_0x3c8c8c},'attributes':['name']}});};exports[_0x4f87('0x34')]=function(_0x331c52,_0x3a0046){return request(_0x4f87('0x35'),{'body':{'interface':_0x3a0046},'options':{'where':_0x331c52}});};exports[_0x4f87('0x36')]=function(_0x4bc337,_0x1c8e17,_0x370b0f){return request(_0x4f87('0x37'),{'body':{'type':_0x1c8e17,'uniqueid':_0x370b0f},'options':{'where':_0x4bc337}});};exports['agentUnpause']=function(_0x8df7f9){return request(_0x4f87('0x38'),{'body':{},'options':{'where':_0x8df7f9}});};exports[_0x4f87('0x39')]=function(_0x396e17){return request(_0x4f87('0x3a'),{'body':{},'options':{'where':_0x396e17}});}; \ 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 0143536..e7b0df4 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 _0xc99e=['./lex','exports','./polly'];(function(_0x4c10be,_0x36f290){var _0x16678e=function(_0x412879){while(--_0x412879){_0x4c10be['push'](_0x4c10be['shift']());}};_0x16678e(++_0x36f290);}(_0xc99e,0x6e));var _0xec99=function(_0x292b92,_0x2b3a82){_0x292b92=_0x292b92-0x0;var _0x2f62b2=_0xc99e[_0x292b92];return _0x2f62b2;};var polly=require(_0xec99('0x0'));var lex=require(_0xec99('0x1'));module[_0xec99('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x13c5=['./polly'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x13c5,0x7a));var _0x513c=function(_0x235f70,_0x3dae19){_0x235f70=_0x235f70-0x0;var _0x5be25a=_0x13c5[_0x235f70];return _0x5be25a;};var polly=require(_0x513c('0x0'));var lex=require('./lex');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 2896025..1273693 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13f6=['./lib/api','exports'];(function(_0xbb92fe,_0x50ce0a){var _0x29be89=function(_0x558c6e){while(--_0x558c6e){_0xbb92fe['push'](_0xbb92fe['shift']());}};_0x29be89(++_0x50ce0a);}(_0x13f6,0x124));var _0x613f=function(_0x3a5542,_0x460f07){_0x3a5542=_0x3a5542-0x0;var _0x5c4fc3=_0x13f6[_0x3a5542];return _0x5c4fc3;};'use strict';var lex=require(_0x613f('0x0'));module[_0x613f('0x1')]=function(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff){return lex(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a){return lex(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a);}; \ 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 9108542..4c6c004 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(_0x4ccbfd,_0x2c1c51){var _0x370bae=function(_0x2eff4b){while(--_0x2eff4b){_0x4ccbfd['push'](_0x4ccbfd['shift']());}};_0x370bae(++_0x2c1c51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x45b5f0,_0x58f06e){var _0x33721b=function(_0x1345da){while(--_0x1345da){_0x45b5f0['push'](_0x45b5f0['shift']());}};_0x33721b(++_0x58f06e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 4222482..913b083 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 _0x70fb=['exports','./lib/api'];(function(_0x2f1448,_0xd1cf64){var _0x212ff8=function(_0x5567c1){while(--_0x5567c1){_0x2f1448['push'](_0x2f1448['shift']());}};_0x212ff8(++_0xd1cf64);}(_0x70fb,0x85));var _0xb70f=function(_0x254caa,_0x454b80){_0x254caa=_0x254caa-0x0;var _0x1f9aac=_0x70fb[_0x254caa];return _0x1f9aac;};'use strict';var polly=require(_0xb70f('0x0'));module[_0xb70f('0x1')]=function(_0x5cbdf3,_0xfa5c1e,_0x4b29dd,_0x396a3a,_0x4acde7,_0x17b727,_0x1f9843){return polly(_0x5cbdf3,_0xfa5c1e,_0x4b29dd,_0x396a3a,_0x4acde7,_0x17b727,_0x1f9843);}; \ No newline at end of file +var _0x9d72=['exports','./lib/api'];(function(_0x44ff4c,_0xe7fd1c){var _0x2615d5=function(_0xe9392e){while(--_0xe9392e){_0x44ff4c['push'](_0x44ff4c['shift']());}};_0x2615d5(++_0xe7fd1c);}(_0x9d72,0x6b));var _0x29d7=function(_0x243223,_0x3bee50){_0x243223=_0x243223-0x0;var _0x3b5c86=_0x9d72[_0x243223];return _0x3b5c86;};'use strict';var polly=require(_0x29d7('0x0'));module[_0x29d7('0x1')]=function(_0x32a7cc,_0xf6b80,_0xd42cc3,_0x3b6b57,_0x145584,_0x58e097,_0x43ee9a){return polly(_0x32a7cc,_0xf6b80,_0xd42cc3,_0x3b6b57,_0x145584,_0x58e097,_0x43ee9a);}; \ 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 d59d7c0..31dc432 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 _0x9002=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0xfaeb48,_0x35e639){var _0x2a6290=function(_0x49e1f6){while(--_0x49e1f6){_0xfaeb48['push'](_0xfaeb48['shift']());}};_0x2a6290(++_0x35e639);}(_0x9002,0x130));var _0x2900=function(_0x5fb9ae,_0xa2731e){_0x5fb9ae=_0x5fb9ae-0x0;var _0x187388=_0x9002[_0x5fb9ae];return _0x187388;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x2900('0x0'));var rs=require(_0x2900('0x1'));var AWS=require(_0x2900('0x2'));function pollyResult(_0x3e68bd,_0x432aef,_0x302b15){return new BPromise(function(_0x27669f,_0x1d8824){_0x3e68bd[_0x2900('0x3')](_0x432aef,function(_0x24b7dd,_0x31be08){if(_0x24b7dd){_0x1d8824(_0x24b7dd);}else if(_0x31be08){if(_0x31be08[_0x2900('0x4')]instanceof Buffer){fs[_0x2900('0x5')](_0x302b15,_0x31be08[_0x2900('0x4')],function(_0x20a67a){if(_0x20a67a){_0x1d8824(_0x20a67a);}else{_0x27669f();}});}else{_0x1d8824(new Error(_0x2900('0x6')));}}else{_0x1d8824(new Error(_0x2900('0x7')));}});});}module[_0x2900('0x8')]=function(_0x3a2e80,_0x402ea8,_0x20d5d2,_0x15d1fa,_0x26a1af,_0x31494e,_0x174a6e){var _0x32b8c8=new AWS[(_0x2900('0x9'))]({'accessKeyId':_0x3a2e80,'secretAccessKey':_0x402ea8,'region':_0x20d5d2});var _0x273c4a={'Text':_0x26a1af,'TextType':_0x31494e||'text','OutputFormat':_0x2900('0xa'),'VoiceId':_0x15d1fa};return pollyResult(_0x32b8c8,_0x273c4a,_0x174a6e);}; \ No newline at end of file +var _0x3425=['exports','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x3425,0x189));var _0x5342=function(_0x423d0d,_0x149aac){_0x423d0d=_0x423d0d-0x0;var _0x59830d=_0x3425[_0x423d0d];return _0x59830d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x5342('0x0'));var rs=require(_0x5342('0x1'));var AWS=require(_0x5342('0x2'));function pollyResult(_0x1961e4,_0x551e34,_0x3661a5){return new BPromise(function(_0x1947dd,_0x4f9a43){_0x1961e4[_0x5342('0x3')](_0x551e34,function(_0x5d060f,_0x57ceeb){if(_0x5d060f){_0x4f9a43(_0x5d060f);}else if(_0x57ceeb){if(_0x57ceeb['AudioStream']instanceof Buffer){fs[_0x5342('0x4')](_0x3661a5,_0x57ceeb['AudioStream'],function(_0xc45c7d){if(_0xc45c7d){_0x4f9a43(_0xc45c7d);}else{_0x1947dd();}});}else{_0x4f9a43(new Error(_0x5342('0x5')));}}else{_0x4f9a43(new Error(_0x5342('0x6')));}});});}module[_0x5342('0x7')]=function(_0x26fde6,_0x5d2cb2,_0x5c58e4,_0x1ecc91,_0xa03647,_0x5ad7e5,_0x16282c){var _0xa2e450=new AWS['Polly']({'accessKeyId':_0x26fde6,'secretAccessKey':_0x5d2cb2,'region':_0x5c58e4});var _0x16d111={'Text':_0xa03647,'TextType':_0x5ad7e5||'text','OutputFormat':'mp3','VoiceId':_0x1ecc91};return pollyResult(_0xa2e450,_0x16d111,_0x16282c);}; \ 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 08f8336..1ad2584 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 _0x17fb=['exports','./lib/api'];(function(_0x5e2c88,_0x4a0379){var _0xaa9952=function(_0x2c9b4d){while(--_0x2c9b4d){_0x5e2c88['push'](_0x5e2c88['shift']());}};_0xaa9952(++_0x4a0379);}(_0x17fb,0x11d));var _0xb17f=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0x17fb[_0x1c0991];return _0x5034de;};'use strict';var asr=require(_0xb17f('0x0'));module[_0xb17f('0x1')]=function(_0x1b2d85,_0x25d15d,_0x1a0caf,_0x5d96ce){return asr(_0x1b2d85,_0x25d15d,_0x1a0caf);}; \ No newline at end of file +var _0xf82c=['./lib/api','exports'];(function(_0x2c26eb,_0x1cd7b6){var _0x55f8c6=function(_0x4c1d08){while(--_0x4c1d08){_0x2c26eb['push'](_0x2c26eb['shift']());}};_0x55f8c6(++_0x1cd7b6);}(_0xf82c,0x1a8));var _0xcf82=function(_0x2219a9,_0x194656){_0x2219a9=_0x2219a9-0x0;var _0x727d4d=_0xf82c[_0x2219a9];return _0x727d4d;};'use strict';var asr=require(_0xcf82('0x0'));module[_0xcf82('0x1')]=function(_0x571a63,_0x61e442,_0x3adf95,_0x53251a){return asr(_0x571a63,_0x61e442,_0x3adf95);}; \ 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 52d20ee..0e4c770 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 _0x22fb=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','https://speech.googleapis.com'];(function(_0x10cac9,_0x5a16fe){var _0x422a09=function(_0x569364){while(--_0x569364){_0x10cac9['push'](_0x10cac9['shift']());}};_0x422a09(++_0x5a16fe);}(_0x22fb,0x192));var _0xb22f=function(_0xbede39,_0x7b297f){_0xbede39=_0xbede39-0x0;var _0x1e0d70=_0x22fb[_0xbede39];return _0x1e0d70;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xb22f('0x0');module['exports']=function(_0x3f643d,_0x306b6e,_0x2221f1){return new BPromise(function(_0x10d2c4,_0x201512){var _0x50cdab;if(typeof _0x3f643d!==_0xb22f('0x1')||_0x3f643d[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x3'));}if(typeof _0x306b6e!==_0xb22f('0x1')||_0x306b6e[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x4'));}if(typeof _0x2221f1!=='undefined'&&(typeof _0x2221f1!==_0xb22f('0x1')||_0x2221f1[_0xb22f('0x2')]===0x0)){return _0x201512(_0xb22f('0x5'));}try{_0x50cdab=fs[_0xb22f('0x6')](_0x3f643d)[_0xb22f('0x7')](_0xb22f('0x8'));}catch(_0x188cea){return _0x201512(_0x188cea);}return _0x10d2c4({'method':_0xb22f('0x9'),'uri':host+_0xb22f('0xa')+_0x306b6e,'body':{'config':{'encoding':_0xb22f('0xb'),'sampleRateHertz':_0xb22f('0xc'),'languageCode':_0x2221f1},'audio':{'content':_0x50cdab}},'json':!![]});});}; \ No newline at end of file +var _0x0884=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0x4088('0x0'));var BPromise=require(_0x4088('0x1'));var fs=require('fs');var host=_0x4088('0x2');module[_0x4088('0x3')]=function(_0x39e7de,_0x1e9e1d,_0x300c58){return new BPromise(function(_0x556d34,_0x3c15b9){var _0x634f6f;if(typeof _0x39e7de!==_0x4088('0x4')||_0x39e7de[_0x4088('0x5')]===0x0){return _0x3c15b9(_0x4088('0x6'));}if(typeof _0x1e9e1d!=='string'||_0x1e9e1d['length']===0x0){return _0x3c15b9(_0x4088('0x7'));}if(typeof _0x300c58!=='undefined'&&(typeof _0x300c58!==_0x4088('0x4')||_0x300c58[_0x4088('0x5')]===0x0)){return _0x3c15b9(_0x4088('0x8'));}try{_0x634f6f=fs[_0x4088('0x9')](_0x39e7de)[_0x4088('0xa')](_0x4088('0xb'));}catch(_0x1cc7fa){return _0x3c15b9(_0x1cc7fa);}return _0x556d34({'method':_0x4088('0xc'),'uri':host+_0x4088('0xd')+_0x1e9e1d,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x4088('0xe'),'languageCode':_0x300c58},'audio':{'content':_0x634f6f}},'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 8cdb999..7fa165f 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 _0x48e3=['exports','./asr'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x48e3,0xb9));var _0x348e=function(_0x597d6f,_0x4332b0){_0x597d6f=_0x597d6f-0x0;var _0x350970=_0x48e3[_0x597d6f];return _0x350970;};var asr=require(_0x348e('0x0'));module[_0x348e('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf9d4=['exports','./asr'];(function(_0x1b0bfe,_0x589135){var _0x14bb4c=function(_0x143a4d){while(--_0x143a4d){_0x1b0bfe['push'](_0x1b0bfe['shift']());}};_0x14bb4c(++_0x589135);}(_0xf9d4,0x14f));var _0x4f9d=function(_0x14b92d,_0x199505){_0x14b92d=_0x14b92d-0x0;var _0x5444fc=_0xf9d4[_0x14b92d];return _0x5444fc;};var asr=require(_0x4f9d('0x0'));module[_0x4f9d('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index c298eac..100d31d 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 _0x61e1=['fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','url','parse','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','data','end','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','.mp3','from','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','length','text\x20length\x20limit\x20reached','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','name','result','resolvedQuery','action','actionIncomplete','fulfillment','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo'];(function(_0x37ba84,_0x4e635a){var _0x5bb4e8=function(_0x190de8){while(--_0x190de8){_0x37ba84['push'](_0x37ba84['shift']());}};_0x5bb4e8(++_0x4e635a);}(_0x61e1,0x1af));var _0x161e=function(_0x44f1ae,_0x3a122c){_0x44f1ae=_0x44f1ae-0x0;var _0x59f342=_0x61e1[_0x44f1ae];return _0x59f342;};'use strict';var apiai=require(_0x161e('0x0'));var BPromise=require(_0x161e('0x1'));var dialogflow=require(_0x161e('0x2'));var fs=require('fs');var http=require(_0x161e('0x3'));var https=require(_0x161e('0x4'));var md5=require(_0x161e('0x5'));var path=require(_0x161e('0x6'));var querystring=require(_0x161e('0x7'));var rp=require(_0x161e('0x8'));var rs=require(_0x161e('0x9'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x161e('0xa'))[_0x161e('0xb')];var util=require(_0x161e('0xc'));var aws=require(_0x161e('0xd'));var google=require(_0x161e('0xe'));var sestek=require('./sestek');var tilde=require(_0x161e('0xf'));var logger=require('../../../config/logger')(_0x161e('0x10'));var ISPEECH_API=_0x161e('0x11');function downloadFile(_0x57a82d,_0x5d5568){return new BPromise(function(_0xecefc1,_0x52c686){var _0x411841=urlParse(_0x57a82d);var _0x512501=_0x411841[_0x161e('0x12')]===_0x161e('0x13')?https:http;var _0x6b1c47={'host':_0x411841[_0x161e('0x14')],'path':_0x411841[_0x161e('0x6')],'headers':{'user-agent':_0x161e('0x15')}};_0x512501[_0x161e('0x16')](_0x6b1c47,function(_0x389952){if(_0x389952[_0x161e('0x17')]!==0xc8){logger[_0x161e('0x18')](_0x161e('0x19')+_0x57a82d+_0x161e('0x1a')+_0x389952[_0x161e('0x17')]+'\x20('+_0x389952[_0x161e('0x1b')]+')');_0x52c686(new Error('request\x20to\x20'+_0x57a82d+'\x20failed,\x20status\x20code\x20=\x20'+_0x389952[_0x161e('0x17')]+'\x20('+_0x389952['statusMessage']+')'));return;}var _0x4db871=fs[_0x161e('0x1c')](_0x5d5568);_0x4db871['on'](_0x161e('0x1d'),function(){logger['info'](_0x161e('0x1e'));_0x4db871['close'](_0xecefc1);});_0x4db871['on'](_0x161e('0x18'),function(_0x24930b){fs['unlink'](_0x5d5568);logger['error']('download\x20error',_0x24930b);_0x52c686(_0x24930b);});_0x389952['pipe'](_0x4db871);})['on'](_0x161e('0x18'),function(_0x3519c1){logger[_0x161e('0x18')](_0x3519c1);_0x52c686(_0x3519c1);})['end']();});}function uploadFile(_0x2a6dde){return new BPromise(function(_0x388b7a,_0x30d62c){var _0x36facb=urlParse(_0x2a6dde);var _0x31ca08=_0x36facb['protocol']===_0x161e('0x13')?https:http;var _0x25f3a4={'host':_0x36facb[_0x161e('0x14')],'path':_0x36facb['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x31ca08[_0x161e('0x16')](_0x25f3a4,function(_0x5755ae){if(_0x5755ae[_0x161e('0x17')]!==0xc8){_0x30d62c(new Error(_0x161e('0x19')+_0x2a6dde+_0x161e('0x1a')+_0x5755ae[_0x161e('0x17')]+'\x20('+_0x5755ae[_0x161e('0x1b')]+')'));return;}var _0x1546a0='';_0x5755ae['on'](_0x161e('0x1f'),function(_0x4d93ba){_0x1546a0+=_0x4d93ba;});_0x5755ae['on'](_0x161e('0x20'),function(){_0x388b7a(_0x1546a0);});})['on'](_0x161e('0x18'),function(_0x54fc83){_0x30d62c(_0x54fc83);})[_0x161e('0x20')]();});}function convertFile(_0x5726b4,_0x492988){return new BPromise(function(_0x17f51e,_0x5251d1){var _0xdd7f69=sox[_0x161e('0x21')](_0x5726b4,_0x492988,{'sampleRate':0x1f40,'format':_0x161e('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xdd7f69['on'](_0x161e('0x18'),function(_0x167ffe){logger['error'](_0x161e('0x23'),_0x167ffe);_0x5251d1(_0x167ffe);});_0xdd7f69['on']('end',function(){logger[_0x161e('0x24')](_0x161e('0x25'));_0x17f51e();});_0xdd7f69[_0x161e('0x26')]();});}function base64Decode(_0x1305f5,_0x4b38a6){var _0x3e8356=path[_0x161e('0x27')](__dirname,_0x161e('0x28'),rs[_0x161e('0x29')](0x4)+_0x161e('0x2a'));fs[_0x161e('0x2b')](_0x3e8356,_0x1305f5,_0x161e('0x2c'));return convertFile(_0x3e8356,_0x4b38a6)[_0x161e('0x2d')](function(){try{fs[_0x161e('0x2e')](_0x3e8356);fs[_0x161e('0x2f')](_0x4b38a6,'777');}catch(_0x26f150){logger[_0x161e('0x18')](_0x26f150);}return _0x4b38a6[_0x161e('0x30')]('.')[0x0];});}function base64Encode(_0x3449f3){var _0xe527a8=fs[_0x161e('0x31')](_0x3449f3);return new Buffer(_0xe527a8)[_0x161e('0x32')](_0x161e('0x2c'));}exports[_0x161e('0x33')]=function(_0x173b5a,_0x267d04,_0x39615b,_0x249761,_0x50f673,_0x35a7b3){var _0x19375f,_0x3a1629;var _0x48e36e=_0x161e('0x34');var _0x4c4d95=_0x161e('0x35')+_0x173b5a;var _0x1b7888={};if(_0x267d04===_0x161e('0x36')){_0x1b7888[_0x161e('0x37')]={'ssml':_0x39615b};}else{_0x1b7888['input']={'text':_0x39615b};};_0x1b7888[_0x161e('0x38')]={'languageCode':_0x249761,'ssmlGender':_0x50f673};_0x1b7888['audioConfig']={'audioEncoding':_0x161e('0x39'),'sampleRateHertz':0x1f40};var _0x22e00d={'url':_0x48e36e+_0x161e('0x3a')+_0x4c4d95,'method':_0x161e('0x3b'),'json':!![],'body':_0x1b7888};return rp(_0x22e00d)['then'](function(_0x32cd7c){return new BPromise(function(_0x51294c,_0x438b58){_0x19375f=path[_0x161e('0x27')](__dirname,_0x161e('0x28'),rs[_0x161e('0x29')](0x4)+_0x161e('0x3c'));var _0xb27e71=Buffer[_0x161e('0x3d')](_0x32cd7c['audioContent'],_0x161e('0x2c'));return fs[_0x161e('0x3e')](_0x19375f,_0xb27e71,function(_0x534450){_0x438b58(_0x534450);},function(_0x4a6512){fs[_0x161e('0x2f')](_0x19375f,'777');_0x51294c(_0x4a6512);});});})[_0x161e('0x2d')](function(_0x4713ee){_0x3a1629=path[_0x161e('0x27')](__dirname,_0x161e('0x28'),rs[_0x161e('0x29')](0x4)+_0x161e('0x2a'));return convertFile(_0x19375f,_0x3a1629);})[_0x161e('0x2d')](function(){try{fs[_0x161e('0x2e')](_0x19375f);fs[_0x161e('0x2f')](_0x3a1629,_0x161e('0x3f'));}catch(_0x166ae9){logger[_0x161e('0x18')](_0x166ae9);}logger[_0x161e('0x24')](_0x161e('0x40'),_0x3a1629[_0x161e('0x30')]('.')[0x0]);return _0x3a1629[_0x161e('0x30')]('.')[0x0];});};exports[_0x161e('0x41')]=function(_0x3941e2,_0x1b48e5){var _0x294fe4=_0x161e('0x42');var _0x546789,_0x57f914;var _0x25d72f;var _0x41c1fd={'encoding':_0x161e('0x43'),'method':'POST','timeout':0x2710,'url':_0x294fe4,'headers':{'Content-Type':_0x161e('0x44')},'body':_0x161e('0x45')+encodeURIComponent(JSON[_0x161e('0x46')]([[[_0x161e('0x47'),JSON[_0x161e('0x46')]([_0x3941e2,_0x1b48e5||'en',![],_0x161e('0x48')]),null,'generic']]]))};return rp(_0x41c1fd)[_0x161e('0x2d')](function(_0xc6705f){try{_0x25d72f=eval(_0xc6705f[_0x161e('0x49')](0x5))[0x0][0x2];}catch(_0x4f8ea9){throw new Error('parse\x20response\x20failed:\x0a'+_0xc6705f[_0x161e('0x1f')]);}if(!_0x25d72f){if(_0x3941e2[_0x161e('0x4a')]>0xc8){throw new Error(_0x161e('0x4b'));}else{throw new Error('lang\x20\x22'+_0x1b48e5+'\x22\x20might\x20not\x20exist');}}try{_0x25d72f=eval(_0x25d72f)[0x0];}catch(_0x2b8705){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x161e('0x1f')]);}const _0x3628bd=_0x25d72f;_0x546789=path[_0x161e('0x27')](__dirname,_0x161e('0x28'),rs[_0x161e('0x29')](0x4)+_0x161e('0x3c'));fs[_0x161e('0x2b')](_0x546789,_0x25d72f,{'encoding':_0x161e('0x2c')});_0x57f914=path[_0x161e('0x27')](__dirname,_0x161e('0x28'),rs['generate'](0x4)+_0x161e('0x2a'));return convertFile(_0x546789,_0x57f914);})[_0x161e('0x2d')](function(){try{fs[_0x161e('0x2e')](_0x546789);fs['chmodSync'](_0x57f914,_0x161e('0x3f'));}catch(_0xf464b3){logger['error'](_0xf464b3);}logger[_0x161e('0x24')](_0x161e('0x4c'),_0x57f914[_0x161e('0x30')]('.')[0x0]);return _0x57f914[_0x161e('0x30')]('.')[0x0];});};exports[_0x161e('0x4d')]=function(_0x5bc366,_0x3e26f9,_0x4d8507){return google[_0x161e('0x4e')](_0x5bc366,_0x3e26f9,_0x4d8507)[_0x161e('0x2d')](function(_0x3d51c3){logger[_0x161e('0x24')](_0x3d51c3['uri']);return rp(_0x3d51c3);})[_0x161e('0x2d')](function(_0x478760){var _0x4a2799='';var _0x373df3=0x0;try{fs[_0x161e('0x2e')](_0x5bc366);}catch(_0x275fef){logger[_0x161e('0x18')](_0x275fef);}if(_0x478760&&_0x478760[_0x161e('0x4f')]){_0x4a2799=_0x478760[_0x161e('0x4f')][_0x161e('0x50')](function(_0x105b2b){return _0x105b2b&&_0x105b2b['alternatives'][0x0]&&_0x105b2b[_0x161e('0x51')][0x0][_0x161e('0x52')]?_0x105b2b[_0x161e('0x51')][0x0]['transcript']:'';})[_0x161e('0x53')]('\x0a');_0x373df3=_0x478760[_0x161e('0x4f')][_0x161e('0x50')](function(_0x2d19e6){return _0x2d19e6&&_0x2d19e6[_0x161e('0x51')][0x0]&&_0x2d19e6[_0x161e('0x51')][0x0][_0x161e('0x54')]?_0x2d19e6[_0x161e('0x51')][0x0]['confidence']:0x0;})[_0x161e('0x53')]('\x0a');}logger[_0x161e('0x24')](_0x161e('0x55'),_0x4a2799);logger[_0x161e('0x24')]('googleASR\x20confidence',_0x373df3);return{'transcript':_0x4a2799,'confidence':_0x373df3};})['catch'](function(_0x4e830){logger[_0x161e('0x18')](_0x161e('0x56'),_0x4e830[_0x161e('0x17')],_0x4e830[_0x161e('0x57')],_0x4e830['message']);});};exports['googleDialogflow']=function(_0x4aaf60,_0x1e8f86,_0x45dd15,_0x4329dd){var _0x5ab2=apiai(_0x1e8f86,{'language':_0x4329dd||'en'});return _0x5ab2['textRequest'](_0x45dd15,{'sessionId':md5(_0x4aaf60)})['then'](function(_0x48f726){logger[_0x161e('0x24')](JSON['stringify'](_0x48f726));return{'source':_0x48f726[_0x161e('0x58')]['source'],'resolvedQuery':_0x48f726['result'][_0x161e('0x59')],'action':_0x48f726['result'][_0x161e('0x5a')],'actionIncomplete':_0x48f726[_0x161e('0x58')][_0x161e('0x5b')],'speech':_0x48f726[_0x161e('0x58')][_0x161e('0x5c')]['speech'],'score':_0x48f726['result']['score'],'statusCode':_0x48f726[_0x161e('0x5d')][_0x161e('0x5e')],'endConversation':_0x48f726['result'][_0x161e('0x5f')]['endConversation']||![],'isFallbackIntent':_0x48f726[_0x161e('0x58')]['metadata'][_0x161e('0x60')]};});};exports[_0x161e('0x61')]=function(_0x4cf71b,_0x1c555c,_0x31eb9d,_0x4cad1d,_0x3d8478,_0x447687){var _0x9b319=_0x4cad1d[_0x161e('0x62')](/\\n/g,'\x0a');var _0x2e8b2a={'credentials':{'private_key':_0x9b319,'client_email':_0x31eb9d}};var _0x2b21db=new dialogflow[(_0x161e('0x63'))](_0x2e8b2a);var _0x4eab9f=_0x2b21db['sessionPath'](_0x1c555c,md5(_0x4cf71b));var _0x504a04={'session':_0x4eab9f,'queryInput':{'text':{'text':_0x3d8478,'languageCode':_0x447687}}};return _0x2b21db[_0x161e('0x64')](_0x504a04)[_0x161e('0x2d')](function(_0x484f35){if(_0x484f35&&_0x484f35[_0x161e('0x4a')]){logger[_0x161e('0x24')](_0x161e('0x65'),JSON[_0x161e('0x46')](_0x484f35));var _0x4bf3a0=_0x484f35[0x0];if(_0x4bf3a0){var _0x124d85={'action':_0x4bf3a0['queryResult']['action'],'allRequiredParamsPresent':_0x4bf3a0[_0x161e('0x66')][_0x161e('0x67')],'endConversation':_0x4bf3a0['queryResult']['diagnosticInfo']&&_0x4bf3a0[_0x161e('0x66')][_0x161e('0x68')][_0x161e('0x69')]?_0x4bf3a0[_0x161e('0x66')][_0x161e('0x68')][_0x161e('0x69')]['end_conversation'][_0x161e('0x6a')]:![],'fulfillmentText':_0x4bf3a0[_0x161e('0x66')][_0x161e('0x6b')],'intentName':_0x4bf3a0[_0x161e('0x66')][_0x161e('0x6c')]['name'],'intentDisplayName':_0x4bf3a0['queryResult'][_0x161e('0x6c')][_0x161e('0x6d')],'isFallbackIntent':_0x4bf3a0[_0x161e('0x66')]['intent'][_0x161e('0x6e')],'languageCode':_0x4bf3a0['queryResult'][_0x161e('0x6f')],'queryText':_0x4bf3a0[_0x161e('0x66')][_0x161e('0x70')],'responseId':_0x4bf3a0[_0x161e('0x71')],'score':_0x4bf3a0[_0x161e('0x66')][_0x161e('0x72')],'speech':_0x4bf3a0['queryResult'][_0x161e('0x6b')],'providerResponse':JSON[_0x161e('0x46')](_0x484f35)};return _0x124d85;}}});};exports['tildeASR']=function(_0x4e2fa3,_0x19f953,_0x2ecf94,_0x15e1c3){return tilde[_0x161e('0x4e')](_0x4e2fa3,_0x19f953,_0x2ecf94,_0x15e1c3)[_0x161e('0x2d')](function(_0x548c2d){try{fs['unlink'](_0x4e2fa3);}catch(_0x5a16df){logger[_0x161e('0x18')](_0x5a16df);}logger['info'](_0x161e('0x73'),_0x548c2d[_0x161e('0x52')]);logger[_0x161e('0x24')](_0x161e('0x74'),_0x548c2d[_0x161e('0x54')]);return _0x548c2d;});};exports['awsPolly']=function(_0x3e949c,_0x2e545c,_0x38fc93,_0x31f812,_0xd8ea7f,_0x5891e4){var _0x328eec=path[_0x161e('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x161e('0x3c'));var _0x1f1a49;return aws[_0x161e('0x75')](_0x3e949c,_0x2e545c,_0x38fc93,_0x31f812,_0xd8ea7f,_0x5891e4,_0x328eec)[_0x161e('0x2d')](function(){_0x1f1a49=path['resolve'](__dirname,'tmp',rs[_0x161e('0x29')](0x4)+_0x161e('0x2a'));return convertFile(_0x328eec,_0x1f1a49);})[_0x161e('0x2d')](function(){try{fs[_0x161e('0x2e')](_0x328eec);fs['chmodSync'](_0x1f1a49,_0x161e('0x3f'));}catch(_0x43739c){logger[_0x161e('0x18')](_0x43739c);}return _0x1f1a49[_0x161e('0x30')]('.')[0x0];});};exports[_0x161e('0x76')]=function(_0x308210,_0x1308bf,_0x2a3982,_0x533a81,_0x31c255,_0x5d6c35){return aws[_0x161e('0x77')](_0x308210,_0x1308bf,_0x2a3982,_0x533a81,_0x31c255,_0x5d6c35)[_0x161e('0x2d')](function(_0xfcdc17){logger['info'](JSON[_0x161e('0x46')](_0xfcdc17));return _0xfcdc17;});};exports[_0x161e('0x78')]=function(_0x19de2a,_0x237851,_0x1b4355,_0x1b6458){var _0x190510=util[_0x161e('0x79')](_0x161e('0x7a'),ISPEECH_API,_0x19de2a,encodeURIComponent(_0x237851),_0x1b4355,_0x1b6458);var _0x9f4e9f=path[_0x161e('0x27')](__dirname,'tmp',rs[_0x161e('0x29')](0x4)+_0x161e('0x3c'));var _0x357f86;return downloadFile(_0x190510,_0x9f4e9f)[_0x161e('0x2d')](function(){_0x357f86=path[_0x161e('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x161e('0x2a'));return convertFile(_0x9f4e9f,_0x357f86);})[_0x161e('0x2d')](function(){try{fs['unlink'](_0x9f4e9f);fs['chmodSync'](_0x357f86,_0x161e('0x3f'));}catch(_0x27cf34){logger[_0x161e('0x18')](_0x27cf34);}return _0x357f86[_0x161e('0x30')]('.')[0x0];});};exports['ispeechASR']=function(_0x50ef79,_0x3ad11c,_0x1d0c95,_0x5886a9){var _0x418f47=util['format'](_0x161e('0x7b'),ISPEECH_API,_0x3ad11c,_0x1d0c95,base64Encode(_0x50ef79),_0x5886a9?util[_0x161e('0x79')]('model=%s',encodeURIComponent(_0x5886a9)):_0x161e('0x7c'));return uploadFile(_0x418f47)[_0x161e('0x2d')](function(_0x5b6e4f){return querystring[_0x161e('0xb')](_0x5b6e4f);});};exports[_0x161e('0x7d')]=function(_0x161630,_0x3a5772){return sestek[_0x161e('0x7e')](_0x161630,_0x3a5772)[_0x161e('0x2d')](function(_0x33c1ea){logger[_0x161e('0x24')](JSON[_0x161e('0x46')](_0x33c1ea));var _0x43dc4b={'speech':_0x33c1ea[_0x161e('0x7f')],'action':_0x33c1ea[_0x161e('0x80')]?_0x33c1ea['channelData'][_0x161e('0x81')]:undefined,'actiondata':_0x33c1ea[_0x161e('0x80')]?_0x33c1ea[_0x161e('0x80')]['CustomActionData']:undefined};if(_0x33c1ea[_0x161e('0x80')]&&_0x33c1ea[_0x161e('0x80')][_0x161e('0x82')]){return base64Decode(_0x33c1ea[_0x161e('0x80')][_0x161e('0x82')][_0x161e('0x83')],path[_0x161e('0x27')](__dirname,'tmp',rs[_0x161e('0x29')](0x4)+_0x161e('0x2a')))['then'](function(_0x2f48bc){_0x43dc4b[_0x161e('0x84')]=_0x2f48bc;return _0x43dc4b;});}return _0x43dc4b;});};exports[_0x161e('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0xd4c9=['textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','status','code','endConversation','metadata','googleDialogflowV2','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','model=%s','parse','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','./aws','./google','./tilde','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','request\x20to\x20','transcode','wav','error\x20convert','finish\x20to\x20convert','start','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','tmp','from','audioContent','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','.wav','goggleTTS\x20path','googleASR','asr','info','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message'];(function(_0x56f51c,_0x3ca248){var _0x1fe122=function(_0x15b541){while(--_0x15b541){_0x56f51c['push'](_0x56f51c['shift']());}};_0x1fe122(++_0x3ca248);}(_0xd4c9,0xb4));var _0x9d4c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd4c9[_0x6131cd];return _0x47e916;};'use strict';var apiai=require(_0x9d4c('0x0'));var BPromise=require(_0x9d4c('0x1'));var dialogflow=require(_0x9d4c('0x2'));var fs=require('fs');var http=require(_0x9d4c('0x3'));var https=require(_0x9d4c('0x4'));var md5=require(_0x9d4c('0x5'));var path=require(_0x9d4c('0x6'));var querystring=require(_0x9d4c('0x7'));var rp=require('request-promise');var rs=require(_0x9d4c('0x8'));var sox=require(_0x9d4c('0x9'));var tts=require(_0x9d4c('0xa'));var urlParse=require(_0x9d4c('0xb'))['parse'];var util=require('util');var aws=require(_0x9d4c('0xc'));var google=require(_0x9d4c('0xd'));var sestek=require('./sestek');var tilde=require(_0x9d4c('0xe'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x9d4c('0xf');function downloadFile(_0x35a337,_0x27096c){return new BPromise(function(_0x3ae7b0,_0x1ba17b){var _0x23a3a4=urlParse(_0x35a337);var _0x522056=_0x23a3a4[_0x9d4c('0x10')]===_0x9d4c('0x11')?https:http;var _0x347a2b={'host':_0x23a3a4[_0x9d4c('0x12')],'path':_0x23a3a4[_0x9d4c('0x6')],'headers':{'user-agent':_0x9d4c('0x13')}};_0x522056[_0x9d4c('0x14')](_0x347a2b,function(_0x2ebb75){if(_0x2ebb75[_0x9d4c('0x15')]!==0xc8){logger['error']('request\x20to\x20'+_0x35a337+_0x9d4c('0x16')+_0x2ebb75[_0x9d4c('0x15')]+'\x20('+_0x2ebb75[_0x9d4c('0x17')]+')');_0x1ba17b(new Error('request\x20to\x20'+_0x35a337+_0x9d4c('0x16')+_0x2ebb75[_0x9d4c('0x15')]+'\x20('+_0x2ebb75['statusMessage']+')'));return;}var _0x2d8631=fs['createWriteStream'](_0x27096c);_0x2d8631['on'](_0x9d4c('0x18'),function(){logger['info'](_0x9d4c('0x19'));_0x2d8631[_0x9d4c('0x1a')](_0x3ae7b0);});_0x2d8631['on'](_0x9d4c('0x1b'),function(_0x327b52){fs[_0x9d4c('0x1c')](_0x27096c);logger[_0x9d4c('0x1b')](_0x9d4c('0x1d'),_0x327b52);_0x1ba17b(_0x327b52);});_0x2ebb75[_0x9d4c('0x1e')](_0x2d8631);})['on'](_0x9d4c('0x1b'),function(_0x16aab2){logger[_0x9d4c('0x1b')](_0x16aab2);_0x1ba17b(_0x16aab2);})[_0x9d4c('0x1f')]();});}function uploadFile(_0x34e64e){return new BPromise(function(_0xe91605,_0x5b9164){var _0x48480b=urlParse(_0x34e64e);var _0x413f82=_0x48480b[_0x9d4c('0x10')]==='https:'?https:http;var _0x1cbf84={'host':_0x48480b[_0x9d4c('0x12')],'path':_0x48480b[_0x9d4c('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x413f82[_0x9d4c('0x14')](_0x1cbf84,function(_0x465c8d){if(_0x465c8d[_0x9d4c('0x15')]!==0xc8){_0x5b9164(new Error(_0x9d4c('0x20')+_0x34e64e+_0x9d4c('0x16')+_0x465c8d['statusCode']+'\x20('+_0x465c8d[_0x9d4c('0x17')]+')'));return;}var _0x278c6b='';_0x465c8d['on']('data',function(_0x248187){_0x278c6b+=_0x248187;});_0x465c8d['on'](_0x9d4c('0x1f'),function(){_0xe91605(_0x278c6b);});})['on'](_0x9d4c('0x1b'),function(_0x2b8191){_0x5b9164(_0x2b8191);})[_0x9d4c('0x1f')]();});}function convertFile(_0x5095cd,_0x1951ad){return new BPromise(function(_0x325b49,_0x212641){var _0x572356=sox[_0x9d4c('0x21')](_0x5095cd,_0x1951ad,{'sampleRate':0x1f40,'format':_0x9d4c('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x572356['on'](_0x9d4c('0x1b'),function(_0x198a38){logger[_0x9d4c('0x1b')](_0x9d4c('0x23'),_0x198a38);_0x212641(_0x198a38);});_0x572356['on'](_0x9d4c('0x1f'),function(){logger['info'](_0x9d4c('0x24'));_0x325b49();});_0x572356[_0x9d4c('0x25')]();});}function base64Decode(_0x48a98a,_0x4601a2){var _0x1bc0a1=path['resolve'](__dirname,'tmp',rs[_0x9d4c('0x26')](0x4)+'.wav');fs[_0x9d4c('0x27')](_0x1bc0a1,_0x48a98a,_0x9d4c('0x28'));return convertFile(_0x1bc0a1,_0x4601a2)[_0x9d4c('0x29')](function(){try{fs['unlink'](_0x1bc0a1);fs[_0x9d4c('0x2a')](_0x4601a2,_0x9d4c('0x2b'));}catch(_0x46391f){logger[_0x9d4c('0x1b')](_0x46391f);}return _0x4601a2[_0x9d4c('0x2c')]('.')[0x0];});}function base64Encode(_0x37eb5f){var _0x3b7b9c=fs[_0x9d4c('0x2d')](_0x37eb5f);return new Buffer(_0x3b7b9c)[_0x9d4c('0x2e')]('base64');}exports[_0x9d4c('0x2f')]=function(_0x2959ce,_0x3b6b5d,_0x2c5402,_0x270629,_0x56803f,_0x538d1d){var _0x5d1584,_0x29ef94;var _0x985066=_0x9d4c('0x30');var _0x4af296=_0x9d4c('0x31')+_0x2959ce;var _0x13cc8f={};if(_0x3b6b5d===_0x9d4c('0x32')){_0x13cc8f[_0x9d4c('0x33')]={'ssml':_0x2c5402};}else{_0x13cc8f[_0x9d4c('0x33')]={'text':_0x2c5402};};_0x13cc8f[_0x9d4c('0x34')]={'languageCode':_0x270629,'ssmlGender':_0x56803f};_0x13cc8f[_0x9d4c('0x35')]={'audioEncoding':_0x9d4c('0x36'),'sampleRateHertz':0x1f40};var _0x2ddd15={'url':_0x985066+_0x9d4c('0x37')+_0x4af296,'method':_0x9d4c('0x38'),'json':!![],'body':_0x13cc8f};return rp(_0x2ddd15)['then'](function(_0x5cd9e6){return new BPromise(function(_0x135fbb,_0x702278){_0x5d1584=path[_0x9d4c('0x39')](__dirname,_0x9d4c('0x3a'),rs[_0x9d4c('0x26')](0x4)+'.mp3');var _0x5506ec=Buffer[_0x9d4c('0x3b')](_0x5cd9e6[_0x9d4c('0x3c')],_0x9d4c('0x28'));return fs['writeFile'](_0x5d1584,_0x5506ec,function(_0x1c32b2){_0x702278(_0x1c32b2);},function(_0x43149a){fs[_0x9d4c('0x2a')](_0x5d1584,_0x9d4c('0x2b'));_0x135fbb(_0x43149a);});});})[_0x9d4c('0x29')](function(_0x4f2be4){_0x29ef94=path[_0x9d4c('0x39')](__dirname,_0x9d4c('0x3a'),rs[_0x9d4c('0x26')](0x4)+'.wav');return convertFile(_0x5d1584,_0x29ef94);})[_0x9d4c('0x29')](function(){try{fs[_0x9d4c('0x1c')](_0x5d1584);fs[_0x9d4c('0x2a')](_0x29ef94,_0x9d4c('0x2b'));}catch(_0x35a159){logger['error'](_0x35a159);}logger['info']('googleCloudTTS\x20path',_0x29ef94[_0x9d4c('0x2c')]('.')[0x0]);return _0x29ef94[_0x9d4c('0x2c')]('.')[0x0];});};exports['googleTTS']=function(_0x4944c9,_0x2aeae2){var _0x54a146=_0x9d4c('0x3d');var _0x5df5b4,_0x4ae1ad;var _0x1ebff2;var _0x46adfb={'encoding':_0x9d4c('0x3e'),'method':_0x9d4c('0x38'),'timeout':0x2710,'url':_0x54a146,'headers':{'Content-Type':_0x9d4c('0x3f')},'body':'f.req='+encodeURIComponent(JSON[_0x9d4c('0x40')]([[[_0x9d4c('0x41'),JSON[_0x9d4c('0x40')]([_0x4944c9,_0x2aeae2||'en',![],_0x9d4c('0x42')]),null,'generic']]]))};return rp(_0x46adfb)[_0x9d4c('0x29')](function(_0x21587b){try{_0x1ebff2=eval(_0x21587b[_0x9d4c('0x43')](0x5))[0x0][0x2];}catch(_0x5bda0a){throw new Error(_0x9d4c('0x44')+_0x21587b[_0x9d4c('0x45')]);}if(!_0x1ebff2){if(_0x4944c9[_0x9d4c('0x46')]>0xc8){throw new Error(_0x9d4c('0x47'));}else{throw new Error(_0x9d4c('0x48')+_0x2aeae2+_0x9d4c('0x49'));}}try{_0x1ebff2=eval(_0x1ebff2)[0x0];}catch(_0x5c9dad){throw new Error(_0x9d4c('0x44')+res[_0x9d4c('0x45')]);}const _0x2efa0f=_0x1ebff2;_0x5df5b4=path[_0x9d4c('0x39')](__dirname,_0x9d4c('0x3a'),rs[_0x9d4c('0x26')](0x4)+_0x9d4c('0x4a'));fs['writeFileSync'](_0x5df5b4,_0x1ebff2,{'encoding':'base64'});_0x4ae1ad=path[_0x9d4c('0x39')](__dirname,_0x9d4c('0x3a'),rs[_0x9d4c('0x26')](0x4)+_0x9d4c('0x4b'));return convertFile(_0x5df5b4,_0x4ae1ad);})['then'](function(){try{fs[_0x9d4c('0x1c')](_0x5df5b4);fs[_0x9d4c('0x2a')](_0x4ae1ad,_0x9d4c('0x2b'));}catch(_0x5b0bea){logger[_0x9d4c('0x1b')](_0x5b0bea);}logger['info'](_0x9d4c('0x4c'),_0x4ae1ad[_0x9d4c('0x2c')]('.')[0x0]);return _0x4ae1ad['split']('.')[0x0];});};exports[_0x9d4c('0x4d')]=function(_0x392a4e,_0x4d8aea,_0x15d4a6){return google[_0x9d4c('0x4e')](_0x392a4e,_0x4d8aea,_0x15d4a6)[_0x9d4c('0x29')](function(_0x8e8e7b){logger[_0x9d4c('0x4f')](_0x8e8e7b[_0x9d4c('0x50')]);return rp(_0x8e8e7b);})[_0x9d4c('0x29')](function(_0x11224f){var _0x1714ee='';var _0x4a83cf=0x0;try{fs[_0x9d4c('0x1c')](_0x392a4e);}catch(_0x2ac470){logger[_0x9d4c('0x1b')](_0x2ac470);}if(_0x11224f&&_0x11224f[_0x9d4c('0x51')]){_0x1714ee=_0x11224f['results'][_0x9d4c('0x52')](function(_0x31d99a){return _0x31d99a&&_0x31d99a[_0x9d4c('0x53')][0x0]&&_0x31d99a['alternatives'][0x0][_0x9d4c('0x54')]?_0x31d99a['alternatives'][0x0][_0x9d4c('0x54')]:'';})['join']('\x0a');_0x4a83cf=_0x11224f[_0x9d4c('0x51')][_0x9d4c('0x52')](function(_0x1599cb){return _0x1599cb&&_0x1599cb[_0x9d4c('0x53')][0x0]&&_0x1599cb[_0x9d4c('0x53')][0x0][_0x9d4c('0x55')]?_0x1599cb[_0x9d4c('0x53')][0x0][_0x9d4c('0x55')]:0x0;})[_0x9d4c('0x56')]('\x0a');}logger[_0x9d4c('0x4f')](_0x9d4c('0x57'),_0x1714ee);logger[_0x9d4c('0x4f')](_0x9d4c('0x58'),_0x4a83cf);return{'transcript':_0x1714ee,'confidence':_0x4a83cf};})[_0x9d4c('0x59')](function(_0x2db572){logger[_0x9d4c('0x1b')]('[%s]\x20%s:%s',_0x2db572[_0x9d4c('0x15')],_0x2db572[_0x9d4c('0x5a')],_0x2db572[_0x9d4c('0x5b')]);});};exports['googleDialogflow']=function(_0x43521c,_0x223ba9,_0x5eca7f,_0x1b772f){var _0x3fbb7b=apiai(_0x223ba9,{'language':_0x1b772f||'en'});return _0x3fbb7b[_0x9d4c('0x5c')](_0x5eca7f,{'sessionId':md5(_0x43521c)})[_0x9d4c('0x29')](function(_0x1613be){logger[_0x9d4c('0x4f')](JSON['stringify'](_0x1613be));return{'source':_0x1613be[_0x9d4c('0x5d')][_0x9d4c('0x5e')],'resolvedQuery':_0x1613be[_0x9d4c('0x5d')][_0x9d4c('0x5f')],'action':_0x1613be[_0x9d4c('0x5d')][_0x9d4c('0x60')],'actionIncomplete':_0x1613be[_0x9d4c('0x5d')][_0x9d4c('0x61')],'speech':_0x1613be['result'][_0x9d4c('0x62')]['speech'],'score':_0x1613be[_0x9d4c('0x5d')]['score'],'statusCode':_0x1613be[_0x9d4c('0x63')][_0x9d4c('0x64')],'endConversation':_0x1613be[_0x9d4c('0x5d')]['metadata'][_0x9d4c('0x65')]||![],'isFallbackIntent':_0x1613be[_0x9d4c('0x5d')][_0x9d4c('0x66')]['isFallbackIntent']};});};exports[_0x9d4c('0x67')]=function(_0x1c1f40,_0x4cc0c8,_0x4d2dea,_0x363f84,_0x2be3a3,_0x596468){var _0x44b109=_0x363f84['replace'](/\\n/g,'\x0a');var _0x10b0d1={'credentials':{'private_key':_0x44b109,'client_email':_0x4d2dea}};var _0x5dd743=new dialogflow[(_0x9d4c('0x68'))](_0x10b0d1);var _0x4f277a=_0x5dd743[_0x9d4c('0x69')](_0x4cc0c8,md5(_0x1c1f40));var _0x3c104e={'session':_0x4f277a,'queryInput':{'text':{'text':_0x2be3a3,'languageCode':_0x596468}}};return _0x5dd743['detectIntent'](_0x3c104e)[_0x9d4c('0x29')](function(_0x5dc055){if(_0x5dc055&&_0x5dc055[_0x9d4c('0x46')]){logger['info'](_0x9d4c('0x6a'),JSON[_0x9d4c('0x40')](_0x5dc055));var _0x468a81=_0x5dc055[0x0];if(_0x468a81){var _0x13451c={'action':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x60')],'allRequiredParamsPresent':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x6c')],'endConversation':_0x468a81['queryResult']['diagnosticInfo']&&_0x468a81['queryResult'][_0x9d4c('0x6d')][_0x9d4c('0x6e')]?_0x468a81[_0x9d4c('0x6b')]['diagnosticInfo'][_0x9d4c('0x6e')][_0x9d4c('0x6f')][_0x9d4c('0x70')]:![],'fulfillmentText':_0x468a81['queryResult'][_0x9d4c('0x71')],'intentName':_0x468a81['queryResult'][_0x9d4c('0x72')][_0x9d4c('0x5a')],'intentDisplayName':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x72')][_0x9d4c('0x73')],'isFallbackIntent':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x72')][_0x9d4c('0x74')],'languageCode':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x75')],'queryText':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x76')],'responseId':_0x468a81[_0x9d4c('0x77')],'score':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x78')],'speech':_0x468a81[_0x9d4c('0x6b')][_0x9d4c('0x71')],'providerResponse':JSON[_0x9d4c('0x40')](_0x5dc055)};return _0x13451c;}}});};exports['tildeASR']=function(_0x539215,_0x495d9a,_0x683a40,_0x399ba0){return tilde['asr'](_0x539215,_0x495d9a,_0x683a40,_0x399ba0)[_0x9d4c('0x29')](function(_0x46b33d){try{fs[_0x9d4c('0x1c')](_0x539215);}catch(_0x5298fe){logger[_0x9d4c('0x1b')](_0x5298fe);}logger[_0x9d4c('0x4f')]('Tilde\x20ASR\x20transcription',_0x46b33d[_0x9d4c('0x54')]);logger['info'](_0x9d4c('0x79'),_0x46b33d['confidence']);return _0x46b33d;});};exports[_0x9d4c('0x7a')]=function(_0x2da709,_0x4c2439,_0x566e73,_0x162847,_0x4605f5,_0x2e265c){var _0xdaa6de=path['resolve'](__dirname,_0x9d4c('0x3a'),rs[_0x9d4c('0x26')](0x4)+_0x9d4c('0x4a'));var _0x3d396c;return aws[_0x9d4c('0x7b')](_0x2da709,_0x4c2439,_0x566e73,_0x162847,_0x4605f5,_0x2e265c,_0xdaa6de)[_0x9d4c('0x29')](function(){_0x3d396c=path[_0x9d4c('0x39')](__dirname,_0x9d4c('0x3a'),rs['generate'](0x4)+_0x9d4c('0x4b'));return convertFile(_0xdaa6de,_0x3d396c);})[_0x9d4c('0x29')](function(){try{fs[_0x9d4c('0x1c')](_0xdaa6de);fs[_0x9d4c('0x2a')](_0x3d396c,_0x9d4c('0x2b'));}catch(_0x2dac7c){logger[_0x9d4c('0x1b')](_0x2dac7c);}return _0x3d396c[_0x9d4c('0x2c')]('.')[0x0];});};exports[_0x9d4c('0x7c')]=function(_0x99d525,_0x36ae0f,_0x16e254,_0x5c6d8b,_0x2c18af,_0xadaa4e){return aws[_0x9d4c('0x7d')](_0x99d525,_0x36ae0f,_0x16e254,_0x5c6d8b,_0x2c18af,_0xadaa4e)['then'](function(_0x1c957b){logger[_0x9d4c('0x4f')](JSON['stringify'](_0x1c957b));return _0x1c957b;});};exports[_0x9d4c('0x7e')]=function(_0x18ce11,_0x5e44e2,_0x34b46f,_0x10fc9d){var _0x33509d=util[_0x9d4c('0x7f')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x18ce11,encodeURIComponent(_0x5e44e2),_0x34b46f,_0x10fc9d);var _0x29cb82=path[_0x9d4c('0x39')](__dirname,_0x9d4c('0x3a'),rs['generate'](0x4)+'.mp3');var _0x394a47;return downloadFile(_0x33509d,_0x29cb82)[_0x9d4c('0x29')](function(){_0x394a47=path[_0x9d4c('0x39')](__dirname,'tmp',rs[_0x9d4c('0x26')](0x4)+_0x9d4c('0x4b'));return convertFile(_0x29cb82,_0x394a47);})[_0x9d4c('0x29')](function(){try{fs['unlink'](_0x29cb82);fs[_0x9d4c('0x2a')](_0x394a47,_0x9d4c('0x2b'));}catch(_0xc360f2){logger[_0x9d4c('0x1b')](_0xc360f2);}return _0x394a47[_0x9d4c('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x2258f1,_0x485d69,_0xc698,_0x26b905){var _0x5c37e2=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x485d69,_0xc698,base64Encode(_0x2258f1),_0x26b905?util[_0x9d4c('0x7f')](_0x9d4c('0x80'),encodeURIComponent(_0x26b905)):'freeform=3');return uploadFile(_0x5c37e2)[_0x9d4c('0x29')](function(_0x357fb5){return querystring[_0x9d4c('0x81')](_0x357fb5);});};exports[_0x9d4c('0x82')]=function(_0xa57e35,_0x1c13a8){return sestek['nda'](_0xa57e35,_0x1c13a8)[_0x9d4c('0x29')](function(_0x5f3777){logger[_0x9d4c('0x4f')](JSON[_0x9d4c('0x40')](_0x5f3777));var _0x1ae566={'speech':_0x5f3777['text'],'action':_0x5f3777[_0x9d4c('0x83')]?_0x5f3777['channelData'][_0x9d4c('0x84')]:undefined,'actiondata':_0x5f3777['channelData']?_0x5f3777['channelData'][_0x9d4c('0x85')]:undefined};if(_0x5f3777[_0x9d4c('0x83')]&&_0x5f3777['channelData'][_0x9d4c('0x86')]){return base64Decode(_0x5f3777[_0x9d4c('0x83')][_0x9d4c('0x86')]['Data'],path[_0x9d4c('0x39')](__dirname,_0x9d4c('0x3a'),rs[_0x9d4c('0x26')](0x4)+_0x9d4c('0x4b')))[_0x9d4c('0x29')](function(_0x195990){_0x1ae566['audiofile']=_0x195990;return _0x1ae566;});}return _0x1ae566;});};exports[_0x9d4c('0x87')]=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 e0f80b4..2bab876 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 _0x5fe5=['exports'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x5fe5,0x186));var _0x55fe=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0x5fe5[_0x2d2258];return _0x18e155;};var nda=require('./nda');module[_0x55fe('0x0')]={'nda':nda}; \ No newline at end of file +var _0xe59a=['./nda','exports'];(function(_0x531a18,_0x28759b){var _0x1d18bb=function(_0x28e28f){while(--_0x28e28f){_0x531a18['push'](_0x531a18['shift']());}};_0x1d18bb(++_0x28759b);}(_0xe59a,0xe8));var _0xae59=function(_0x1bf838,_0x3a6288){_0x1bf838=_0x1bf838-0x0;var _0x2d6b79=_0xe59a[_0x1bf838];return _0x2d6b79;};var nda=require(_0xae59('0x0'));module[_0xae59('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 9bdeef4..c5f29bd 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 _0x5cd8=['message','Nda','uniqueid','callerid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','CustomActionData','info','request-promise','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x5d2c43,_0x28236e){_0x5d2c43=_0x5d2c43-0x0;var _0x4af679=_0x5cd8[_0x5d2c43];return _0x4af679;};'use strict';var rp=require(_0x85cd('0x0'));var url=require('url');var logger=require(_0x85cd('0x1'))(_0x85cd('0x2'));module[_0x85cd('0x3')]=function(_0xd3df1c,_0x5c637d){var _0x3cbaa9={'method':'POST','uri':url[_0x85cd('0x4')](_0x5c637d[_0x85cd('0x5')],_0x85cd('0x6')),'form':{'grant_type':_0x85cd('0x7'),'username':_0x5c637d[_0x85cd('0x8')],'password':_0x5c637d['password']},'json':!![]};return rp(_0x3cbaa9)[_0x85cd('0x9')](function(_0x1a69c4){var _0x5aa3c3={'method':_0x85cd('0xa'),'uri':url[_0x85cd('0x4')](_0x5c637d[_0x85cd('0xb')],_0x85cd('0xc')),'body':{'type':_0x5c637d[_0x85cd('0xd')]||_0x85cd('0xe'),'channelId':_0x85cd('0xf'),'conversation':{'id':_0xd3df1c[_0x85cd('0x10')]},'from':{'id':_0xd3df1c[_0x85cd('0x11')],'name':_0xd3df1c['calleridname']},'recipient':{'id':_0xd3df1c['dnid'],'name':_0xd3df1c[_0x85cd('0x12')]},'text':_0x5c637d[_0x85cd('0x13')],'channelData':{}},'headers':{'Authorization':_0x85cd('0x14')+_0x1a69c4[_0x85cd('0x15')]},'json':!![]};if(_0x5c637d['project']){_0x5aa3c3[_0x85cd('0x16')][_0x85cd('0x17')][_0x85cd('0x18')]=_0x5c637d[_0x85cd('0x19')];}if(_0x5c637d[_0x85cd('0x1a')]=='1'){_0x5aa3c3[_0x85cd('0x16')][_0x85cd('0x17')][_0x85cd('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5c637d[_0x85cd('0x1c')]){_0x5aa3c3[_0x85cd('0x16')][_0x85cd('0x17')][_0x85cd('0x1d')]=_0x5c637d[_0x85cd('0x1c')];if(_0x5c637d['custom_action_data']){_0x5aa3c3[_0x85cd('0x16')]['channelData'][_0x85cd('0x1e')]=_0x5c637d['custom_action_data'];}}logger[_0x85cd('0x1f')](JSON['stringify'](_0x5aa3c3));return rp(_0x5aa3c3);});}; \ No newline at end of file +var _0x12fd=['ndauth_url','/token','username','then','ndassistant_url','ndaactivity_type','callerid','calleridname','access_token','body','channelData','project','ndagenerate_audio','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12fd,0x199));var _0xd12f=function(_0x289f59,_0x7febfc){_0x289f59=_0x289f59-0x0;var _0xacad9=_0x12fd[_0x289f59];return _0xacad9;};'use strict';var rp=require(_0xd12f('0x0'));var url=require(_0xd12f('0x1'));var logger=require(_0xd12f('0x2'))(_0xd12f('0x3'));module[_0xd12f('0x4')]=function(_0x48fb45,_0x1e72a3){var _0x37f6b4={'method':_0xd12f('0x5'),'uri':url[_0xd12f('0x6')](_0x1e72a3[_0xd12f('0x7')],_0xd12f('0x8')),'form':{'grant_type':'password','username':_0x1e72a3[_0xd12f('0x9')],'password':_0x1e72a3['password']},'json':!![]};return rp(_0x37f6b4)[_0xd12f('0xa')](function(_0x193e89){var _0x62de68={'method':_0xd12f('0x5'),'uri':url['resolve'](_0x1e72a3[_0xd12f('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x1e72a3[_0xd12f('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x48fb45['uniqueid']},'from':{'id':_0x48fb45[_0xd12f('0xd')],'name':_0x48fb45[_0xd12f('0xe')]},'recipient':{'id':_0x48fb45['dnid'],'name':_0x48fb45['extension']},'text':_0x1e72a3['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x193e89[_0xd12f('0xf')]},'json':!![]};if(_0x1e72a3['project']){_0x62de68[_0xd12f('0x10')][_0xd12f('0x11')]['ProjectName']=_0x1e72a3[_0xd12f('0x12')];}if(_0x1e72a3[_0xd12f('0x13')]=='1'){_0x62de68['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xd12f('0x14')};}if(_0x1e72a3[_0xd12f('0x15')]){_0x62de68[_0xd12f('0x10')][_0xd12f('0x11')][_0xd12f('0x16')]=_0x1e72a3[_0xd12f('0x15')];if(_0x1e72a3[_0xd12f('0x17')]){_0x62de68[_0xd12f('0x10')][_0xd12f('0x11')]['CustomActionData']=_0x1e72a3['custom_action_data'];}}logger[_0xd12f('0x18')](JSON[_0xd12f('0x19')](_0x62de68));return rp(_0x62de68);});}; \ 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 deffc6b..d4ed6f6 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 _0x184c=['exports','./lib/api'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x184c,0x87));var _0xc184=function(_0x1bd6a8,_0x440637){_0x1bd6a8=_0x1bd6a8-0x0;var _0x482011=_0x184c[_0x1bd6a8];return _0x482011;};'use strict';var asr=require(_0xc184('0x0'));module[_0xc184('0x1')]=function(_0x11c30f,_0x26f7b2,_0x266065,_0x2aa215){return asr(_0x11c30f,_0x26f7b2,_0x266065,_0x2aa215);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x1ae110,_0x19f8fc,_0x4b8417,_0x9af0a2){return asr(_0x1ae110,_0x19f8fc,_0x4b8417,_0x9af0a2);}; \ 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 cfd1042..4b55ba7 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 _0x33ef=['open','message','bluebird','lodash','../../../../../../config/logger','exports','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','sha1','update','digest','hex','info','unix','send','stringify','createReadStream','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil'];(function(_0x39fff0,_0x259d98){var _0x547163=function(_0x267edf){while(--_0x267edf){_0x39fff0['push'](_0x39fff0['shift']());}};_0x547163(++_0x259d98);}(_0x33ef,0x9a));var _0xf33e=function(_0x224834,_0x4055ff){_0x224834=_0x224834-0x0;var _0x376e50=_0x33ef[_0x224834];return _0x376e50;};'use strict';var BPromise=require(_0xf33e('0x0'));var _=require(_0xf33e('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xf33e('0x2'))('agi');module[_0xf33e('0x3')]=function(_0x330a36,_0x435179,_0x21902f,_0x110be0){return new BPromise(function(_0x172db4,_0xe38bed){logger['info'](_0xf33e('0x4'),_0x110be0||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x556822=new WebSocket(_0x110be0||_0xf33e('0x5'),{'perMessageDeflate':![]});var _0x4b4171='';var _0x31fc9d='0';var _0x491650='1';var _0xd0a694=_0xf33e('0x6');function _0x3b39ba(_0x17a1ab){var _0x56da6e=crypto['createHash'](_0xf33e('0x7'));_0x56da6e[_0xf33e('0x8')](_0x17a1ab);return _0x56da6e[_0xf33e('0x9')](_0xf33e('0xa'));}function _0xbabfbb(){try{logger[_0xf33e('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x837214=moment()[_0xf33e('0xc')]();var _0x230082=_0x3b39ba(_0x837214+_0x435179+_0x21902f);_0x556822[_0xf33e('0xd')](JSON[_0xf33e('0xe')]({'appID':_0x435179,'timestamp':_0x837214,'appKey':_0x230082}));var _0x48eb43=fs[_0xf33e('0xf')](_0x330a36);_0x48eb43['on']('data',function(_0x40afe6){_0x556822[_0xf33e('0xd')](_0x40afe6);});_0x48eb43['on'](_0xf33e('0x10'),function(){_0x556822['send']('EOS');});}catch(_0x22b0e8){logger['error'](_0xf33e('0x11'),JSON[_0xf33e('0xe')](_0x22b0e8));_0x556822[_0xf33e('0x12')]();}}function _0x14cb03(_0x271cd1){try{if(_0x271cd1){var _0xa579f2=JSON[_0xf33e('0x13')](_0x271cd1);switch(_0xa579f2[_0xf33e('0x14')]){case 0x0:if(_0xa579f2[_0xf33e('0x15')]){if(_0xa579f2[_0xf33e('0x15')][_0xf33e('0x16')]){logger[_0xf33e('0xb')](_0xf33e('0x17'),JSON[_0xf33e('0xe')](_0xa579f2['result']['hypotheses']));_0x4b4171=_0xa579f2['result'][_0xf33e('0x18')][0x0]['transcript'];_0x31fc9d=_0xa579f2[_0xf33e('0x15')][_0xf33e('0x18')][0x0][_0xf33e('0x19')];_0x491650='0';_0xd0a694=_0xf33e('0x1a');_0x556822[_0xf33e('0x12')]();}}break;case 0x1:logger['info'](_0xf33e('0x6'));_0x491650='1';_0xd0a694=_0xf33e('0x6');break;case 0x2:logger[_0xf33e('0xb')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x491650='2';_0xd0a694=_0xf33e('0x1b');break;case 0x9:logger[_0xf33e('0xb')](_0xf33e('0x1c'));_0x491650='9';_0xd0a694='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xf33e('0x1d'));_0x491650='10';_0xd0a694=_0xf33e('0x1d');break;case 0xb:logger[_0xf33e('0xb')](_0xf33e('0x1e'));_0x491650='11';_0xd0a694='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xd0d2d8){logger[_0xf33e('0x1f')](_0xf33e('0x20'),JSON['stringify'](_0xd0d2d8));_0x556822['terminate']();}}function _0x226337(){logger[_0xf33e('0xb')](_0xf33e('0x21'));_0x172db4({'transcript':_0x4b4171,'confidence':_0x31fc9d,'status':_0x491650,'status_message':_0xd0a694});}function _0x4f91ff(_0x5826ef){logger[_0xf33e('0x1f')](_0xf33e('0x22'));if(!_[_0xf33e('0x23')](_0x5826ef)){logger[_0xf33e('0x1f')](_['isObject'](_0x5826ef)?JSON[_0xf33e('0xe')](_0x5826ef):_0x5826ef);}}_0x556822['on'](_0xf33e('0x24'),_0xbabfbb);_0x556822['on'](_0xf33e('0x25'),_0x14cb03);_0x556822['on'](_0xf33e('0x10'),_0x226337);_0x556822['on']('error',_0x4f91ff);});}; \ No newline at end of file +var _0xab57=['update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab57,0x1e1));var _0x7ab5=function(_0x14796e,_0x5b4d29){_0x14796e=_0x14796e-0x0;var _0x527280=_0xab57[_0x14796e];return _0x527280;};'use strict';var BPromise=require(_0x7ab5('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7ab5('0x1'));var crypto=require(_0x7ab5('0x2'));var logger=require(_0x7ab5('0x3'))(_0x7ab5('0x4'));module[_0x7ab5('0x5')]=function(_0x5674ef,_0xeac5dc,_0x5a3bcf,_0x4e6788){return new BPromise(function(_0x18fa8d,_0x2b0970){logger[_0x7ab5('0x6')](_0x7ab5('0x7'),_0x4e6788||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x5ae49c=new WebSocket(_0x4e6788||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1c1563='';var _0x5b0782='0';var _0x3d6af8='1';var _0x556775=_0x7ab5('0x8');function _0x3fc3a2(_0x49992d){var _0x2f566e=crypto[_0x7ab5('0x9')](_0x7ab5('0xa'));_0x2f566e[_0x7ab5('0xb')](_0x49992d);return _0x2f566e[_0x7ab5('0xc')](_0x7ab5('0xd'));}function _0x2e72b6(){try{logger['info'](_0x7ab5('0xe'));var _0x5bb551=moment()[_0x7ab5('0xf')]();var _0x3b4ce9=_0x3fc3a2(_0x5bb551+_0xeac5dc+_0x5a3bcf);_0x5ae49c[_0x7ab5('0x10')](JSON[_0x7ab5('0x11')]({'appID':_0xeac5dc,'timestamp':_0x5bb551,'appKey':_0x3b4ce9}));var _0x50c786=fs[_0x7ab5('0x12')](_0x5674ef);_0x50c786['on'](_0x7ab5('0x13'),function(_0x4be35c){_0x5ae49c[_0x7ab5('0x10')](_0x4be35c);});_0x50c786['on'](_0x7ab5('0x14'),function(){_0x5ae49c[_0x7ab5('0x10')]('EOS');});}catch(_0x331856){logger[_0x7ab5('0x15')](_0x7ab5('0x16'),JSON[_0x7ab5('0x11')](_0x331856));_0x5ae49c[_0x7ab5('0x17')]();}}function _0x970931(_0x3aa03f){try{if(_0x3aa03f){var _0x66595a=JSON['parse'](_0x3aa03f);switch(_0x66595a[_0x7ab5('0x18')]){case 0x0:if(_0x66595a['result']){if(_0x66595a[_0x7ab5('0x19')][_0x7ab5('0x1a')]){logger[_0x7ab5('0x6')](_0x7ab5('0x1b'),JSON['stringify'](_0x66595a[_0x7ab5('0x19')][_0x7ab5('0x1c')]));_0x1c1563=_0x66595a['result'][_0x7ab5('0x1c')][0x0][_0x7ab5('0x1d')];_0x5b0782=_0x66595a[_0x7ab5('0x19')][_0x7ab5('0x1c')][0x0][_0x7ab5('0x1e')];_0x3d6af8='0';_0x556775='Success.';_0x5ae49c[_0x7ab5('0x17')]();}}break;case 0x1:logger['info'](_0x7ab5('0x8'));_0x3d6af8='1';_0x556775='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7ab5('0x6')](_0x7ab5('0x1f'));_0x3d6af8='2';_0x556775=_0x7ab5('0x1f');break;case 0x9:logger[_0x7ab5('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3d6af8='9';_0x556775=_0x7ab5('0x20');break;case 0xa:logger['info'](_0x7ab5('0x21'));_0x3d6af8='10';_0x556775='Authentication\x20failed.';break;case 0xb:logger[_0x7ab5('0x6')](_0x7ab5('0x22'));_0x3d6af8='11';_0x556775='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x53dc69){logger[_0x7ab5('0x15')](_0x7ab5('0x23'),JSON[_0x7ab5('0x11')](_0x53dc69));_0x5ae49c[_0x7ab5('0x17')]();}}function _0x3fad2a(){logger['info'](_0x7ab5('0x24'));_0x18fa8d({'transcript':_0x1c1563,'confidence':_0x5b0782,'status':_0x3d6af8,'status_message':_0x556775});}function _0x5758a2(_0x4e91f2){logger[_0x7ab5('0x15')](_0x7ab5('0x25'));if(!_['isNil'](_0x4e91f2)){logger[_0x7ab5('0x15')](_[_0x7ab5('0x26')](_0x4e91f2)?JSON[_0x7ab5('0x11')](_0x4e91f2):_0x4e91f2);}}_0x5ae49c['on'](_0x7ab5('0x27'),_0x2e72b6);_0x5ae49c['on'](_0x7ab5('0x28'),_0x970931);_0x5ae49c['on'](_0x7ab5('0x14'),_0x3fad2a);_0x5ae49c['on'](_0x7ab5('0x15'),_0x5758a2);});}; \ 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 544d42e..a0bbb13 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 _0x17ff=['exports'];(function(_0x481750,_0x54eae0){var _0x4da769=function(_0x4a6677){while(--_0x4a6677){_0x481750['push'](_0x481750['shift']());}};_0x4da769(++_0x54eae0);}(_0x17ff,0x18b));var _0xf17f=function(_0x1858e8,_0x2c6142){_0x1858e8=_0x1858e8-0x0;var _0x446461=_0x17ff[_0x1858e8];return _0x446461;};var asr=require('./asr');module[_0xf17f('0x0')]={'asr':asr}; \ No newline at end of file +var _0x6434=['exports','./asr'];(function(_0x507a87,_0x2f44ab){var _0x288450=function(_0x2fd032){while(--_0x2fd032){_0x507a87['push'](_0x507a87['shift']());}};_0x288450(++_0x2f44ab);}(_0x6434,0x77));var _0x4643=function(_0x283b8a,_0x299b22){_0x283b8a=_0x283b8a-0x0;var _0x31bd0f=_0x6434[_0x283b8a];return _0x31bd0f;};var asr=require(_0x4643('0x0'));module[_0x4643('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4217701..b533b4b 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x332edd,_0x30528b){var _0x310417=function(_0x4b060a){while(--_0x4b060a){_0x332edd['push'](_0x332edd['shift']());}};_0x310417(++_0x30528b);}(_0x34e8,0x12c));var _0x834e=function(_0x1821a5,_0x3550c1){_0x1821a5=_0x1821a5-0x0;var _0x30adf2=_0x34e8[_0x1821a5];return _0x30adf2;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x1261c2,_0x3ef819){var _0x3aabd2=function(_0x425d76){while(--_0x425d76){_0x1261c2['push'](_0x1261c2['shift']());}};_0x3aabd2(++_0x3ef819);}(_0xe706,0xa3));var _0x6e70=function(_0x4bdab6,_0xe86f11){_0x4bdab6=_0x4bdab6-0x0;var _0x5e1c1a=_0xe706[_0x4bdab6];return _0x5e1c1a;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 62a9bc5..0b9660e 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 _0x2494=['no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','unlink','ispeech\x20TTS\x20is\x20unreachable','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','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','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','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','sms_text','sendSMS\x20message','set','variable_value','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','no\x20subproject\x20selected','getSquareProject','project_id','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','isEmpty','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','google_asr_language','appid','appsecret','clear','includes','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','intKey','tilde\x20%s\x20file\x20created','tildeASR','TildeASR\x20Result\x20%s','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','interval_id'];(function(_0x327e1d,_0x5c654e){var _0x2610b6=function(_0x1e8ca2){while(--_0x1e8ca2){_0x327e1d['push'](_0x327e1d['shift']());}};_0x2610b6(++_0x5c654e);}(_0x2494,0x82));var _0x4249=function(_0x468732,_0x1d9981){_0x468732=_0x468732-0x0;var _0x4bdaf9=_0x2494[_0x468732];return _0x4bdaf9;};'use strict';var fs=require('fs');var util=require(_0x4249('0x0'));var _=require('lodash');var sh=require(_0x4249('0x1'));var odbc=require(_0x4249('0x2'))();var rs=require(_0x4249('0x3'));var moment=require(_0x4249('0x4'));var Mustache=require(_0x4249('0x5'));var rp=require(_0x4249('0x6'));var logger=require('../../config/logger')('agi');var config=require(_0x4249('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x4249('0x8');var recursiveMapAttributes=[_0x4249('0x9'),_0x4249('0xa')];var verticesWithRetry=['menu',_0x4249('0xb'),_0x4249('0xc')];var AGIVertices=function(_0x21060d,_0x58529b,_0x495a2c){this[_0x4249('0xd')]=_0x21060d;this[_0x4249('0xe')]=_0x58529b;this[_0x4249('0xf')]=_0x495a2c;};AGIVertices[_0x4249('0x10')][_0x4249('0x11')]=function(_0x2b85cc,_0x18cf79){this['rpc']['getVariableById'](_0x2b85cc)[_0x4249('0x12')](function(_0x4df876){_0x18cf79(null,_0x4df876?_0x4df876[_0x4249('0x13')]:![]);})[_0x4249('0x14')](function(_0x57c3c7){_0x18cf79(_0x57c3c7);});};AGIVertices[_0x4249('0x10')][_0x4249('0x15')]=function(_0x578cce,_0x154c69){this[_0x4249('0xe')][_0x4249('0x16')](_0x578cce)[_0x4249('0x12')](function(_0x2499ff){_0x154c69(null,_0x2499ff?_0x2499ff[_0x4249('0x13')]:![]);})['catch'](function(_0x7da5cf){_0x154c69(_0x7da5cf);});};AGIVertices[_0x4249('0x10')]['getSquareProject']=function(_0x1a455,_0x560d78){this['rpc']['getSquareProjectById'](_0x1a455)[_0x4249('0x12')](function(_0x35ec6e){_0x560d78(null,_0x35ec6e?_0x35ec6e[_0x4249('0x13')]:![]);})[_0x4249('0x14')](function(_0x345606){_0x560d78(_0x345606);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x3d86fd,_0x1333e1){this[_0x4249('0xe')]['getSquareOdbcById'](_0x3d86fd)[_0x4249('0x12')](function(_0x352f3e){_0x1333e1(null,_0x352f3e?_0x352f3e['dsn']:![]);})[_0x4249('0x14')](function(_0x48330d){_0x1333e1(_0x48330d);});};AGIVertices[_0x4249('0x10')][_0x4249('0x17')]=function(_0x34755e,_0x170fb2){this[_0x4249('0xe')][_0x4249('0x18')](_0x34755e)[_0x4249('0x12')](function(_0x3e30a5){_0x170fb2(null,_0x3e30a5?_0x3e30a5[_0x4249('0x13')]:![]);})[_0x4249('0x14')](function(_0x9da8){_0x170fb2(_0x9da8);});};AGIVertices[_0x4249('0x10')][_0x4249('0x19')]=function(_0xc36036,_0x32849f){this[_0x4249('0xe')][_0x4249('0x1a')](_0xc36036)[_0x4249('0x12')](function(_0x4f970e){_0x32849f(null,_0x4f970e?_0x4f970e[_0x4249('0x13')]:![]);})[_0x4249('0x14')](function(_0x1d4fb9){_0x32849f(_0x1d4fb9);});};AGIVertices['prototype'][_0x4249('0x1b')]=function(_0x3b2e1f,_0x434160){var _0x2dc4be=this;this['rpc'][_0x4249('0x1c')](_0x3b2e1f)['then'](function(_0x2dbac8){_0x434160(null,_0x2dbac8?_0x2dc4be[_0x4249('0x1d')](_0x2dbac8[_0x4249('0x1e')]):![]);})['catch'](function(_0xb4d4d8){_0x434160(_0xb4d4d8);});};AGIVertices[_0x4249('0x10')]['getMailAccount']=function(_0x8fe5cb,_0x544b28){this['rpc']['getMailAccountById'](_0x8fe5cb)['then'](function(_0x2f51c0){_0x544b28(null,_0x2f51c0?_0x2f51c0:![]);})[_0x4249('0x14')](function(_0x5cbce6){_0x544b28(_0x5cbce6);});};AGIVertices[_0x4249('0x10')][_0x4249('0x1f')]=function(_0x497d4f,_0x2f67b2,_0x49f975){this['mailRpc'][_0x4249('0x1f')](_0x497d4f,_0x2f67b2)[_0x4249('0x12')](function(){_0x49f975(null);})[_0x4249('0x14')](function(_0x593a57){_0x49f975(_0x593a57);});};AGIVertices[_0x4249('0x10')]['getIntervals']=function(_0x4dde8a,_0x3e41a8){this[_0x4249('0xe')]['getIntervalById'](_0x4dde8a)['then'](function(_0x461d97){if(_0x461d97){if(_0x461d97[_0x4249('0x20')]){_0x3e41a8(null,[_0x461d97[_0x4249('0x21')]]);}else{_0x3e41a8(null,_[_0x4249('0x22')](_0x461d97[_0x4249('0x23')],_0x4249('0x21')));}}else{_0x3e41a8(null,![]);}})[_0x4249('0x14')](function(_0x391c73){_0x3e41a8(_0x391c73);});};AGIVertices[_0x4249('0x10')][_0x4249('0x1d')]=function(_0x3fe9f3){return util[_0x4249('0x24')](_0x4249('0x25'),FILES_PATH,_0x3fe9f3);};AGIVertices[_0x4249('0x10')][_0x4249('0x26')]=function(_0x581fdc,_0x5dba5d,_0x289f13){odbc[_0x4249('0x27')](_0x581fdc,function(_0xacf33c){if(_0xacf33c){logger[_0x4249('0x28')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0xacf33c);_0x289f13(_0xacf33c);}else{logger[_0x4249('0x29')](_0x4249('0x2a'));odbc[_0x4249('0x2b')](_0x5dba5d,function(_0x28deea,_0x40b167){if(_0x28deea){logger[_0x4249('0x29')](_0x4249('0x2c'),_0x5dba5d);_0x289f13(_0x28deea);}else{logger[_0x4249('0x29')](_0x4249('0x2d'),_0x5dba5d);odbc[_0x4249('0x2e')](function(_0x486461){if(_0x486461){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x486461);}_0x289f13(null,_0x40b167);});}});}});};AGIVertices[_0x4249('0x10')][_0x4249('0x2f')]=function(_0x1b6afd,_0x3f5c0a){this['rpc'][_0x4249('0x30')](_0x1b6afd)['then'](function(_0xd71464){_0x3f5c0a(null,_0xd71464?_0xd71464:![]);})[_0x4249('0x14')](function(_0x515df6){_0x3f5c0a(_0x515df6);});};AGIVertices[_0x4249('0x10')][_0x4249('0x31')]=function(_0x1d4e26,_0x42573e){this[_0x4249('0xe')][_0x4249('0x31')](_0x1d4e26)[_0x4249('0x12')](function(_0x1fd1cf){_0x42573e(null,_0x1fd1cf);})[_0x4249('0x14')](function(_0x2868b6){_0x42573e(_0x2868b6);});};AGIVertices['prototype'][_0x4249('0x32')]=function(_0x3d30eb,_0x2e08b4,_0x29a385){this[_0x4249('0xe')][_0x4249('0x32')]({'uniqueid':this[_0x4249('0xd')][_0x4249('0x33')],'node':_0x3d30eb[_0x4249('0x34')],'application':_0x3d30eb[_0x4249('0x35')],'data':_0x2e08b4||null,'project_name':this[_0x4249('0xd')]['arg_1'],'callerid':this[_0x4249('0xd')][_0x4249('0x36')]})[_0x4249('0x12')](function(_0x1ac001){if(_0x29a385){_0x29a385(null,_0x1ac001);}})[_0x4249('0x14')](function(_0x393e76){if(_0x29a385){_0x29a385(_0x393e76);}});};AGIVertices['prototype'][_0x4249('0x37')]=function(_0x407abd,_0x4e5651,_0x30a3ac,_0x3c8102){this['rpc'][_0x4249('0x37')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x4249('0xd')]['callerid'],'calleridname':this[_0x4249('0xd')][_0x4249('0x38')],'context':this[_0x4249('0xd')][_0x4249('0x39')],'extension':this['channel'][_0x4249('0x3a')],'priority':this[_0x4249('0xd')]['priority'],'accountcode':this[_0x4249('0xd')][_0x4249('0x3b')],'dnid':this[_0x4249('0xd')][_0x4249('0x3c')],'projectName':this[_0x4249('0xd')][_0x4249('0x3d')],'saveName':_0x4e5651,'filename':_0x407abd[_0x4249('0x3e')]||_0x4e5651,'savePath':_0x30a3ac})[_0x4249('0x12')](function(_0x35222b){_0x3c8102(null,_0x35222b);})[_0x4249('0x14')](function(_0x1be5d1){_0x3c8102(_0x1be5d1);});};AGIVertices['prototype'][_0x4249('0x3f')]=function(_0x230854,_0x1787f6,_0x39ac55,_0x5e200a,_0x5e1ad8){this[_0x4249('0xe')][_0x4249('0x3f')]({'uniqueid':this[_0x4249('0xd')][_0x4249('0x33')],'body':_0x230854,'direction':_0x1787f6,'providerName':_0x39ac55,'providerResponse':_0x5e200a})[_0x4249('0x12')](function(_0x110cc7){if(_0x5e1ad8){_0x5e1ad8(null,_0x110cc7);}})['catch'](function(_0x4f02d3){if(_0x5e1ad8){_0x5e1ad8(_0x4f02d3);}});};AGIVertices[_0x4249('0x10')]['createCmContact']=function(_0x39d557,_0x58a075){this[_0x4249('0xe')][_0x4249('0x40')]({'firstName':_['isEmpty'](_0x39d557[_0x4249('0x13')])||_[_0x4249('0x41')](_0x39d557['name'])?'callback_'+Math['random']():_0x39d557['name'],'lastName':_[_0x4249('0x42')](_0x39d557[_0x4249('0x43')])||_[_0x4249('0x41')](_0x39d557[_0x4249('0x43')])?null:_0x39d557[_0x4249('0x43')],'phone':_0x39d557[_0x4249('0x44')],'ListId':_0x39d557[_0x4249('0x45')],'scheduledat':_0x39d557['scheduledAt'],'callbackUniqueid':this[_0x4249('0xd')]['uniqueid'],'tags':'callback','description':_0x4249('0x46')+_0x39d557['scheduledAt'][_0x4249('0x47')](),'priority':_0x39d557[_0x4249('0x48')]})['then'](function(_0x5bf23a){_0x58a075(null,_0x5bf23a);})[_0x4249('0x14')](function(_0x76adc2){_0x58a075(_0x76adc2);});};AGIVertices[_0x4249('0x10')][_0x4249('0x49')]=function(_0xb0fd9d,_0x3ac4a2){this[_0x4249('0xe')][_0x4249('0x4a')](_0xb0fd9d)['then'](function(_0x546494){_0x3ac4a2(null,_0x546494?_0x546494[_0x4249('0x13')]:![]);})[_0x4249('0x14')](function(_0x309267){_0x3ac4a2(_0x309267);});};AGIVertices[_0x4249('0x10')][_0x4249('0x4b')]=function(_0x320da5,_0x216aad,_0x366614){var _0x3afb17={'role':_0x4249('0x4c')};_0x3afb17[_0x320da5]=this[_0x4249('0xd')][_0x4249('0x36')];this[_0x4249('0xe')][_0x4249('0x4b')](_0x3afb17,_0x216aad,this['channel']['uniqueid'])['then'](function(_0x4121e8){_0x366614(null,_[_0x4249('0x41')](_0x4121e8)?![]:!![]);})['catch'](function(_0x3f4ec6){logger[_0x4249('0x28')](_0x3f4ec6);_0x366614(null,![]);});};AGIVertices[_0x4249('0x10')][_0x4249('0x4d')]=function(_0xe4e124,_0x6619ed){var _0x3647d8={'role':_0x4249('0x4c')};_0x3647d8[_0xe4e124]=this['channel'][_0x4249('0x36')];this[_0x4249('0xe')][_0x4249('0x4d')](_0x3647d8)['then'](function(_0x324aa2){_0x6619ed(null,_[_0x4249('0x41')](_0x324aa2)?![]:!![]);})['catch'](function(_0x13458c){logger['error'](_0x13458c);_0x6619ed(null,![]);});};AGIVertices[_0x4249('0x10')][_0x4249('0x4e')]=function(_0x5a2a57,_0x5819c1){var _0xab99b7={'role':_0x4249('0x4c')};_0xab99b7[_0x5a2a57]=this[_0x4249('0xd')]['callerid'];this['rpc']['agentLogout'](_0xab99b7)['then'](function(_0x56f4e8){_0x5819c1(null,_[_0x4249('0x41')](_0x56f4e8)?![]:!![]);})[_0x4249('0x14')](function(_0x6fc657){logger['error'](_0x6fc657);_0x5819c1(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x2440ab,_0x4b2e64){var _0x591438={'role':'agent'};_0x591438[_0x2440ab]=this['channel'][_0x4249('0x36')];var _0xe5bab4=_0x2440ab!='internal'?util[_0x4249('0x24')](_0x4249('0x4f'),'LOCAL',this[_0x4249('0xd')][_0x4249('0x36')]):undefined;this[_0x4249('0xe')]['agentLogin'](_0x591438,_0xe5bab4)[_0x4249('0x12')](function(_0x36caa2){_0x4b2e64(null,_[_0x4249('0x41')](_0x36caa2)?![]:!![]);})[_0x4249('0x14')](function(_0x349128){logger[_0x4249('0x28')](_0x349128);_0x4b2e64(null,![]);});};AGIVertices[_0x4249('0x10')]['shellCommand']=function(_0x439047,_0x428bec){sh[_0x4249('0x50')](_[_0x4249('0x51')](_0x439047),function(_0x262539,_0x15167c){var _0xf4f7bb=_0x15167c['replace'](/(\r\n|\n|\r)/gm,'');_0x428bec(null,_0xf4f7bb);});};AGIVertices['prototype'][_0x4249('0x52')]=function(_0x4047d0,_0x112eef){scripts[_0x4249('0x52')](_0x4047d0[_0x4249('0x53')],_0x4047d0[_0x4249('0x54')]||_0x4249('0x55'),_0x4047d0['text'],_0x4047d0[_0x4249('0x56')]||_0x4249('0x57'),_0x4047d0[_0x4249('0x58')]||_0x4249('0x59'),_0x4047d0[_0x4249('0x5a')]||_0x4249('0x5b'))[_0x4249('0x12')](function(_0x477bd9){_0x112eef(null,_0x477bd9);})[_0x4249('0x14')](function(_0x45369f){_0x112eef(_0x45369f);});};AGIVertices[_0x4249('0x10')][_0x4249('0x5c')]=function(_0x1d69eb,_0x4960e8){scripts[_0x4249('0x5c')](_0x1d69eb['text'],_0x1d69eb[_0x4249('0x5d')]||'en',0x1)[_0x4249('0x12')](function(_0x1df584){_0x4960e8(null,_0x1df584);})['catch'](function(_0x14d74c){_0x4960e8(_0x14d74c);});};AGIVertices[_0x4249('0x10')][_0x4249('0x5e')]=function(_0x5e14d8,_0xe5ec6a){var _0x236515={'uri':_0x5e14d8[_0x4249('0x5f')],'method':_0x5e14d8[_0x4249('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5e14d8[_0x4249('0x61')])===_0x4249('0x62')&&parseInt(_0x5e14d8[_0x4249('0x61')])>=0x1?parseInt(_0x5e14d8[_0x4249('0x61')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x4249('0x63'),'PUT'],_0x236515['method']['toUpperCase']())){try{_0x236515[_0x4249('0x64')]=_0x5e14d8['rawBody']?JSON[_0x4249('0x65')](_0x5e14d8[_0x4249('0xa')]):{};}catch(_0x205873){logger['error'](_0x4249('0x66'),_0x205873);}}try{_0x236515[_0x4249('0x67')]=_0x5e14d8[_0x4249('0x9')]?JSON[_0x4249('0x65')](_0x5e14d8[_0x4249('0x9')]):{};}catch(_0x2a396d){logger[_0x4249('0x28')](_0x4249('0x68'),_0x2a396d);}if(_0x5e14d8[_0x4249('0x69')]){try{var _0x59376c=require(_0x5e14d8[_0x4249('0x69')])[_0x4249('0x6a')](this,_0x236515);_0x236515[_0x4249('0x6b')]=Mustache[_0x4249('0x6c')](_0x5e14d8[_0x4249('0x5f')],_0x59376c,{},['$$','$$']);if(_0x236515[_0x4249('0x67')]){_0x236515['headers']=JSON[_0x4249('0x65')](Mustache[_0x4249('0x6c')](JSON[_0x4249('0x6d')](_0x236515[_0x4249('0x67')]),_0x59376c,{},['$$','$$']));}if(_0x236515[_0x4249('0x64')]){_0x236515[_0x4249('0x64')]=JSON[_0x4249('0x65')](Mustache[_0x4249('0x6c')](JSON['stringify'](_0x236515[_0x4249('0x64')]),_0x59376c,{},['$$','$$']));}}catch(_0x48ab5a){logger[_0x4249('0x28')](_0x4249('0x6e'),_0x48ab5a);}}rp(_0x236515)[_0x4249('0x12')](function(_0x1ebcbf){var _0x3630d7={'statusCode':_0x1ebcbf[_0x4249('0x6f')]||0xc8,'statusMessage':_0x1ebcbf[_0x4249('0x70')]||'OK','headers':_0x1ebcbf[_0x4249('0x67')]||{},'body':_0x1ebcbf[_0x4249('0x64')]||{}};_0xe5ec6a(null,_0x3630d7);})[_0x4249('0x14')](function(_0x49865a){var _0x35bbf2={'statusCode':_0x49865a[_0x4249('0x6f')]||0x1f4,'statusMessage':_0x49865a[_0x4249('0x71')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x49865a[_0x4249('0x72')]['headers']||{},'body':_0x49865a[_0x4249('0x72')][_0x4249('0x64')]||{}};_0xe5ec6a(null,_0x35bbf2);});};AGIVertices[_0x4249('0x10')][_0x4249('0x73')]=function(_0x2d0724,_0x28946b){scripts[_0x4249('0x73')](this[_0x4249('0xd')]['uniqueid'],_0x2d0724[_0x4249('0x74')],_0x2d0724[_0x4249('0x55')],_0x2d0724[_0x4249('0x75')]||'en')['then'](function(_0x1eb1af){_0x28946b(null,_0x1eb1af);})[_0x4249('0x14')](function(_0x3133d7){_0x28946b(_0x3133d7);});};AGIVertices[_0x4249('0x10')]['googleDialogflowV2']=function(_0x187ba9,_0x540f42){scripts[_0x4249('0x76')](this['channel'][_0x4249('0x33')],_0x187ba9[_0x4249('0x77')],_0x187ba9[_0x4249('0x78')],_0x187ba9[_0x4249('0x79')],_0x187ba9[_0x4249('0x55')],_0x187ba9['dialogflowV2_language']||'en')[_0x4249('0x12')](function(_0x2cda49){_0x540f42(null,_0x2cda49);})['catch'](function(_0x1e8486){_0x540f42(_0x1e8486);});};AGIVertices[_0x4249('0x10')][_0x4249('0x7a')]=function(_0x32ba11,_0x4d7c1a){scripts['sestekNDA'](this['channel'],_0x32ba11)[_0x4249('0x12')](function(_0x36051b){_0x4d7c1a(null,_0x36051b);})[_0x4249('0x14')](function(_0x37c58b){_0x4d7c1a(_0x37c58b);});};AGIVertices[_0x4249('0x10')][_0x4249('0x7b')]=function(_0x3d6fbd,_0xc5a1b5){scripts[_0x4249('0x7b')](_0x3d6fbd[_0x4249('0x74')],_0x3d6fbd[_0x4249('0x55')],_0x3d6fbd['ispeech_tts_language']||_0x4249('0x57'),_0x3d6fbd['speed'])['then'](function(_0x17c4c4){_0xc5a1b5(null,_0x17c4c4);})[_0x4249('0x14')](function(_0x1af4b3){_0xc5a1b5(_0x1af4b3);});};AGIVertices[_0x4249('0x10')][_0x4249('0x7c')]=function(_0x4d9666,_0x5a59c2,_0x4ebb84){scripts['ispeechASR'](_0x5a59c2,_0x4d9666[_0x4249('0x74')],_0x4d9666[_0x4249('0x7d')]||_0x4249('0x57'),this[_0x4249('0x7e')](_0x4d9666[_0x4249('0x7f')])?_0x4d9666[_0x4249('0x7f')]:undefined)[_0x4249('0x12')](function(_0x4b5f6b){_0x4ebb84(null,_0x4b5f6b);})['catch'](function(_0x43346f){_0x4ebb84(_0x43346f);});};AGIVertices['prototype'][_0x4249('0x80')]=function(_0x20499e,_0x414700){scripts['awsPolly'](_0x20499e[_0x4249('0x81')],_0x20499e[_0x4249('0x82')],_0x20499e[_0x4249('0x83')],_0x20499e[_0x4249('0x84')]||_0x4249('0x85'),_0x20499e[_0x4249('0x55')],_0x20499e[_0x4249('0x86')]||_0x4249('0x55'))[_0x4249('0x12')](function(_0x2a1683){_0x414700(null,_0x2a1683);})[_0x4249('0x14')](function(_0x299e8e){_0x414700(_0x299e8e);});};AGIVertices[_0x4249('0x10')][_0x4249('0x87')]=function(_0x3b7478,_0x55e771){scripts[_0x4249('0x87')](this[_0x4249('0xd')][_0x4249('0x33')],_0x3b7478[_0x4249('0x81')],_0x3b7478[_0x4249('0x82')],_0x3b7478[_0x4249('0x88')],_0x3b7478['text'],_0x3b7478[_0x4249('0x89')])[_0x4249('0x12')](function(_0x58efc1){_0x55e771(null,_0x58efc1);})[_0x4249('0x14')](function(_0x332730){_0x55e771(_0x332730);});};AGIVertices[_0x4249('0x10')]['googleASR']=function(_0x9951fd,_0xfc0d18,_0x17699c){scripts['googleASR'](_0xfc0d18,_0x9951fd[_0x4249('0x74')],_0x9951fd[_0x4249('0x8a')]||_0x4249('0x57'))[_0x4249('0x12')](function(_0x4d1409){_0x17699c(null,_0x4d1409);})['catch'](function(_0x174fb3){_0x17699c(_0x174fb3);});};AGIVertices[_0x4249('0x10')]['tildeASR']=function(_0x1a88c6,_0x4644db,_0x574c64){scripts['tildeASR'](_0x4644db,_0x1a88c6[_0x4249('0x8b')],_0x1a88c6[_0x4249('0x8c')],_0x1a88c6[_0x4249('0x6b')])[_0x4249('0x12')](function(_0x3b3d8b){_0x574c64(null,_0x3b3d8b);})[_0x4249('0x14')](function(_0x5d579a){_0x574c64(_0x5d579a);});};AGIVertices[_0x4249('0x10')][_0x4249('0x8d')]=function(_0x49c8e9){var _0x47286e=_[_0x4249('0x8e')](verticesWithRetry,_0x49c8e9[_0x4249('0x35')])?_0x49c8e9:_['clone'](_0x49c8e9);for(var _0x3a34cf in _0x47286e){if(_0x47286e[_0x4249('0x8f')](_0x3a34cf)){if(_0x47286e[_0x3a34cf]&&_[_0x4249('0x90')](_0x47286e[_0x3a34cf])){if(_[_0x4249('0x8e')](recursiveMapAttributes,_0x3a34cf)){_0x47286e[_0x3a34cf]=this[_0x4249('0x91')](_0x47286e[_0x3a34cf]);}else{_0x47286e[_0x3a34cf]=this[_0x4249('0x92')](_0x47286e[_0x3a34cf]);}}}}return _0x47286e;};AGIVertices[_0x4249('0x10')][_0x4249('0x93')]=function(_0x1c9e36){for(var _0x53000a in _0x1c9e36){if(_0x1c9e36[_0x4249('0x8f')](_0x53000a)){if(_[_0x4249('0x94')](_0x1c9e36[_0x53000a])){this['recursiveNodeIndex'](_0x1c9e36[_0x53000a]);}else if(_[_0x4249('0x95')](_0x1c9e36[_0x53000a])){for(var _0x1c55ab=0x0;_0x1c55ab<_0x1c9e36[_0x53000a][_0x4249('0x96')];_0x1c55ab++){this[_0x4249('0x93')](_0x1c9e36[_0x53000a][_0x1c55ab]);}}else if(_[_0x4249('0x90')](_0x1c9e36[_0x53000a])){_0x1c9e36[_0x53000a]=this[_0x4249('0x92')](_0x1c9e36[_0x53000a]);}}}};AGIVertices[_0x4249('0x10')][_0x4249('0x97')]=function(_0x1cd9c8,_0x250b07){for(var _0x5a7dc3 in _0x1cd9c8){if(_0x1cd9c8[_0x4249('0x8f')](_0x5a7dc3)){if(_[_0x4249('0x94')](_0x1cd9c8[_0x5a7dc3])){if(!_[_0x4249('0x42')](_0x1cd9c8[_0x5a7dc3])){this[_0x4249('0x97')](_0x1cd9c8[_0x5a7dc3],util[_0x4249('0x24')](_0x4249('0x98'),_0x250b07,_0x5a7dc3));}}else if(_[_0x4249('0x95')](_0x1cd9c8[_0x5a7dc3])){for(var _0x5772ec=0x0;_0x5772ec<_0x1cd9c8[_0x5a7dc3][_0x4249('0x96')];_0x5772ec++){this[_0x4249('0x97')](_0x1cd9c8[_0x5a7dc3][_0x5772ec],util[_0x4249('0x24')](_0x4249('0x98'),_0x250b07,_0x5a7dc3+'['+_0x5772ec+']'));}}else{if(!_[_0x4249('0x41')](_0x1cd9c8[_0x5a7dc3])){this[_0x4249('0xd')][_0x4249('0x99')](util['format'](_0x4249('0x98'),_0x250b07,_0x5a7dc3),_0x1cd9c8[_0x5a7dc3]);}}}}};AGIVertices[_0x4249('0x10')][_0x4249('0x91')]=function(_0x160b92){try{var _0x2a5f15=JSON[_0x4249('0x65')](_0x160b92);this[_0x4249('0x93')](_0x2a5f15);return JSON['stringify'](_0x2a5f15);}catch(_0x4eec8a){return this[_0x4249('0x92')](_0x160b92);}};AGIVertices['prototype'][_0x4249('0x92')]=function(_0x45b59b){var _0x5956fa=_0x45b59b['split']('{');for(var _0x3fb8eb=0x1;_0x3fb8eb<_0x5956fa[_0x4249('0x96')];_0x3fb8eb+=0x1){var _0x429bc0=_0x5956fa[_0x3fb8eb][_0x4249('0x9a')]('}');if(_0x429bc0[_0x4249('0x96')]>0x1){_0x45b59b=_0x45b59b[_0x4249('0x9b')]('{'+_0x429bc0[0x0]+'}',this[_0x4249('0xd')][_0x4249('0x11')](_0x429bc0[0x0])[_0x4249('0x9c')]||_0x429bc0[0x0]);}}if(_0x5956fa[_0x4249('0x96')]===0x1){return _0x45b59b[_0x4249('0x47')]();}return this[_0x4249('0x92')](_0x45b59b);};AGIVertices[_0x4249('0x10')][_0x4249('0x9d')]=function(_0x42e76e,_0x5836d1){var _0x259d76=this['channel'][_0x4249('0x11')](_0x42e76e);if(_0x259d76['result']===-0x1){return _0x259d76;}logger['info'](util[_0x4249('0x24')](_0x4249('0x9e'),_0x5836d1,_0x259d76[_0x4249('0x9c')]));return this[_0x4249('0xd')][_0x4249('0x99')](_0x5836d1,_0x259d76[_0x4249('0x9c')]);};AGIVertices[_0x4249('0x10')][_0x4249('0x7e')]=function(_0x4cd58d){return _0x4cd58d&&_0x4cd58d!=='0'&&_0x4cd58d!=='-1'&&_0x4cd58d!=='';};AGIVertices[_0x4249('0x10')]['maxRetry']=function(_0x3a3b22){this['createSquareDetailsReport'][_0x4249('0x6a')](this,_0x3a3b22,'-');_0x3a3b22['retry']=_0x3a3b22[_0x4249('0x9f')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0xb52c52){logger[_0x4249('0x29')](util['format'](_0x4249('0xa0'),_0xb52c52[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0xb52c52[_0x4249('0x55')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa2'));}var _0x20d214='\x22'+_0xb52c52[_0x4249('0x55')]+'\x22';if(this[_0x4249('0x7e')](_0xb52c52[_0x4249('0x72')])){_0x20d214+=','+_0xb52c52['options'];}var _0x475561=this[_0x4249('0xd')][_0x4249('0x50')]('MRCPSynth',_0x20d214);if(_0x475561['result']===-0x1){return _0x475561;}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x20d214));};AGIVertices[_0x4249('0x10')][_0x4249('0xa3')]=function(_0x1ade8d){logger[_0x4249('0x29')](util[_0x4249('0x24')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1ade8d[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x1ade8d[_0x4249('0xa4')])){return this[_0x4249('0xd')]['noop'](_0x4249('0xa5'));}var _0x4612ea=_0x1ade8d[_0x4249('0xa4')];if(this[_0x4249('0x7e')](_0x1ade8d[_0x4249('0x72')])){_0x4612ea+=','+_0x1ade8d[_0x4249('0x72')];}var _0x575f8b=this[_0x4249('0xd')][_0x4249('0x50')](_0x4249('0xa6'),_0x4612ea);if(_0x575f8b[_0x4249('0xa7')]===-0x1){return _0x575f8b;}var _0x43cec3=this[_0x4249('0x9d')](_0x4249('0xa8'),_0x4249('0xa9'));if(_0x43cec3[_0x4249('0xa7')]===-0x1){return _0x43cec3;}var _0x39b566=this[_0x4249('0x9d')](_0x4249('0xaa'),'MRCP_RECOG_TRANSCRIPT');if(_0x39b566[_0x4249('0xa7')]===-0x1){return _0x39b566;}var _0x4b4fe3=this[_0x4249('0x9d')](_0x4249('0xab'),_0x4249('0xac'));if(_0x4b4fe3[_0x4249('0xa7')]===-0x1){return _0x4b4fe3;}return this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4612ea));};AGIVertices[_0x4249('0x10')][_0x4249('0xad')]=function(_0x1e7f65){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0xae'),_0x1e7f65[_0x4249('0x34')]));return this[_0x4249('0xd')][_0x4249('0xad')]([_0x1e7f65[_0x4249('0xaf')],_0x1e7f65[_0x4249('0xb0')]]);};AGIVertices['prototype'][_0x4249('0xb1')]=function(_0x3bdeab){logger['info'](util[_0x4249('0x24')](_0x4249('0xb2'),_0x3bdeab[_0x4249('0x34')]));if(this[_0x4249('0x7e')](_0x3bdeab[_0x4249('0x61')])){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0xb3'),_0x3bdeab[_0x4249('0x61')]));var _0x5e2010=this[_0x4249('0xd')][_0x4249('0xb4')](_0x3bdeab[_0x4249('0x61')]);if(_0x5e2010[_0x4249('0xa7')]===-0x1){return _0x5e2010;}}return this['channel']['answer']();};AGIVertices[_0x4249('0x10')][_0x4249('0xb5')]=function(_0x331957){logger[_0x4249('0x29')](util['format'](_0x4249('0xb6'),_0x331957['label']));if(!this[_0x4249('0x7e')](_0x331957[_0x4249('0x45')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x331957,_0x4249('0xb7'));}_0x331957['scheduledAt']=moment();if(this[_0x4249('0x7e')](_0x331957['delay'])){_0x331957[_0x4249('0xb8')]=moment()[_0x4249('0xb9')](_0x331957['delay'],_0x4249('0xba'));}if(!this[_0x4249('0x7e')](_0x331957[_0x4249('0x48')])){_0x331957['callback_priority']=0x2;}this[_0x4249('0x40')][_0x4249('0x6a')](this,_0x331957);return this[_0x4249('0xd')]['noop'](util['format'](_0x4249('0xbb'),_0x331957[_0x4249('0x44')],_0x331957['list_id'],_0x331957[_0x4249('0xb8')]));};AGIVertices[_0x4249('0x10')][_0x4249('0xbc')]=function(_0x4c309f){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0xbd'),_0x4c309f['label']));var _0x14c65c=this[_0x4249('0xd')][_0x4249('0x50')](_0x4c309f[_0x4249('0xbe')],_0x4c309f['options']);if(_0x14c65c['result']===-0x1){return _0x14c65c;}return this[_0x4249('0xd')][_0x4249('0xa1')](util['format']('Executed\x20command\x20%s\x20%s',_0x4c309f[_0x4249('0xbe')],_0x4c309f['options']));};AGIVertices[_0x4249('0x10')]['lumenvoxtts']=function(_0x18f15d){logger['info'](util['format'](_0x4249('0xbf'),_0x18f15d['label']));if(!this['isConfigured'](_0x18f15d[_0x4249('0x55')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa2'));}var _0x41a37f='\x22'+_0x18f15d[_0x4249('0x55')]+'\x22';if(this['isConfigured'](_0x18f15d[_0x4249('0x72')])){_0x41a37f+=','+_0x18f15d[_0x4249('0x72')];}var _0xce5584=this['channel'][_0x4249('0x50')]('MRCPSynth',_0x41a37f);if(_0xce5584[_0x4249('0xa7')]===-0x1){return _0xce5584;}return this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x41a37f));};AGIVertices[_0x4249('0x10')][_0x4249('0xc0')]=function(_0x43d4d0){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0xc1'),_0x43d4d0[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x43d4d0['text'])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa2'));}var _0x430d95='\x22'+_0x43d4d0['text']+'\x22';if(this[_0x4249('0x7e')](_0x43d4d0[_0x4249('0x72')])){_0x430d95+=','+_0x43d4d0[_0x4249('0x72')];}var _0xee0168=this[_0x4249('0xd')][_0x4249('0x50')](_0x4249('0xc2'),_0x430d95);if(_0xee0168['result']===-0x1){return _0xee0168;}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0xc3'),_0x430d95));};AGIVertices[_0x4249('0x10')][_0x4249('0xc4')]=function(_0x73c08d){logger[_0x4249('0x29')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x73c08d['label']));if(!this[_0x4249('0x7e')](_0x73c08d[_0x4249('0xa4')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa5'));}var _0x372d8c=_0x73c08d[_0x4249('0xa4')];if(this[_0x4249('0x7e')](_0x73c08d['options'])){_0x372d8c+=','+_0x73c08d[_0x4249('0x72')];}var _0x4cb58f=this[_0x4249('0xd')]['exec'](_0x4249('0xa6'),_0x372d8c);if(_0x4cb58f['result']===-0x1){return _0x4cb58f;}var _0x50bf48=this['getAndSetVariable'](_0x4249('0xa8'),_0x4249('0xc5'));if(_0x50bf48['result']===-0x1){return _0x50bf48;}var _0x27f4bc=this[_0x4249('0x9d')](_0x4249('0xaa'),_0x4249('0xc6'));if(_0x27f4bc[_0x4249('0xa7')]===-0x1){return _0x27f4bc;}var _0x4237b5=this['getAndSetVariable']('RECOG_INSTANCE()',_0x4249('0xc7'));if(_0x4237b5[_0x4249('0xa7')]===-0x1){return _0x4237b5;}return this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0xc8'),_0x372d8c));};AGIVertices[_0x4249('0x10')][_0x4249('0xc9')]=function(_0x4496f3){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0xca'),_0x4496f3[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x4496f3['grammar'])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa5'));}var _0x16302a=_0x4496f3[_0x4249('0xa4')];if(this[_0x4249('0x7e')](_0x4496f3[_0x4249('0x72')])){_0x16302a+=','+_0x4496f3[_0x4249('0x72')];}var _0x1f9b21=this[_0x4249('0xd')][_0x4249('0x50')](_0x4249('0xa6'),_0x16302a);if(_0x1f9b21['result']===-0x1){return _0x1f9b21;}var _0x53ec14=this[_0x4249('0x9d')]('RECOG_CONFIDENCE()',_0x4249('0xcb'));if(_0x53ec14['result']===-0x1){return _0x53ec14;}var _0x29488e=this[_0x4249('0x9d')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x29488e[_0x4249('0xa7')]===-0x1){return _0x29488e;}var _0x31426c=this['getAndSetVariable'](_0x4249('0xab'),'SESTEK_ASR_INSTANCE');if(_0x31426c['result']===-0x1){return _0x31426c;}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0xc8'),_0x16302a));};AGIVertices['prototype'][_0x4249('0xcc')]=function(_0x474c0f){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0xcd'),_0x474c0f[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x474c0f[_0x4249('0xce')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x474c0f,_0x4249('0xcf'));}var _0x43f805=this[_0x4249('0xd0')][_0x4249('0x6a')](this,_0x474c0f[_0x4249('0xce')]);if(!_0x43f805){return this[_0x4249('0xd')][_0x4249('0x28')](_0x474c0f,_0x4249('0xd1'));}if(!this[_0x4249('0x7e')](_0x474c0f[_0x4249('0x2b')])){return this['channel'][_0x4249('0x28')](_0x474c0f,_0x4249('0xd2'));}var _0x349196=_0x474c0f[_0x4249('0x2b')][_0x4249('0xd3')](/(\r\n|\n|\r)/gm,'\x20');this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')](_0x4249('0xd4'),_0x349196));var _0x4fb719=this[_0x4249('0x26')][_0x4249('0x6a')](this,_0x43f805,_0x349196);this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x474c0f,_0x349196);if(!this[_0x4249('0x7e')](_0x474c0f['variable_id'])){return this[_0x4249('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4e679e=this[_0x4249('0x11')][_0x4249('0x6a')](this,_0x474c0f['variable_id']);if(!_0x4e679e){return this[_0x4249('0xd')][_0x4249('0x28')](_0x474c0f,'no\x20variable\x20found');}var _0x4bad2f=this;_0x4fb719['forEach'](function(_0x6a6cff,_0x4cb696){Object['keys'](_0x6a6cff)[_0x4249('0xd5')](function(_0x2efa61){_0x4bad2f[_0x4249('0xd')]['setVariable'](util[_0x4249('0x24')](_0x4249('0xd6'),_0x4e679e,_0x4cb696,_0x2efa61),_0x6a6cff[_0x2efa61]);});});this[_0x4249('0xd')][_0x4249('0x99')](util[_0x4249('0x24')](_0x4249('0xd7'),_0x4e679e),_0x4fb719[_0x4249('0x96')]);return this['channel']['noop'](util['format'](_0x4249('0xd8'),_0x4e679e));};AGIVertices[_0x4249('0x10')][_0x4249('0xd9')]=function(_0x373cb3){logger[_0x4249('0xda')](util[_0x4249('0x24')](_0x4249('0xdb'),_0x373cb3[_0x4249('0x34')]));if(!this['isConfigured'](_0x373cb3[_0x4249('0xdc')])){return this['channel'][_0x4249('0x28')](_0x373cb3,_0x4249('0xdd'));}var _0x52f7e1=this['getUser'][_0x4249('0x6a')](this,_0x373cb3[_0x4249('0xdc')]);if(!_0x52f7e1){return this['channel'][_0x4249('0x28')](_0x373cb3,_0x4249('0xde'));}var _0x4ba796=this[_0x4249('0xd')][_0x4249('0x50')](_0x4249('0xdf'),[util['format'](_0x4249('0xe0'),_0x52f7e1),_0x373cb3[_0x4249('0x61')],_0x373cb3[_0x4249('0xe1')],_0x373cb3[_0x4249('0x5f')]]);if(_0x4ba796[_0x4249('0xa7')]===-0x1){return _0x4ba796;}return this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x4249('0x10')][_0x4249('0xe2')]=function(_0x463312){logger['info'](util[_0x4249('0x24')](_0x4249('0xe3'),_0x463312[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x463312[_0x4249('0x74')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x463312['text'])){return this[_0x4249('0xd')][_0x4249('0xa1')]('no\x20text\x20configured');}this[_0x4249('0xd')]['bot']=!![];this[_0x4249('0x32')](_0x463312);this[_0x4249('0x3f')](_0x463312[_0x4249('0x55')],'in','','');this[_0x4249('0xd')][_0x4249('0xa1')](util['format'](_0x4249('0xe4'),_0x463312[_0x4249('0x55')]));var _0x4b7657=this[_0x4249('0x73')][_0x4249('0x6a')](this,_0x463312);if(_0x4b7657){for(var _0x4f902e in _0x4b7657){if(_0x4b7657['hasOwnProperty'](_0x4f902e)){this['channel'][_0x4249('0x99')](util[_0x4249('0x24')](_0x4249('0xe5'),_0x4f902e[_0x4249('0xe6')]()),_0x4b7657[_0x4f902e]);}}this['createSquareMessage'](_0x4b7657[_0x4249('0xe7')],_0x4249('0xe8'),'dialogflow','');return this[_0x4249('0xd')]['noop'](util['format'](_0x4249('0xe9'),_0x4b7657[_0x4249('0xe7')]));}return this[_0x4249('0xd')][_0x4249('0x28')](_0x463312,_0x4249('0xea'));};AGIVertices['prototype'][_0x4249('0xeb')]=function(_0x40c377){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0xec'),_0x40c377[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x40c377[_0x4249('0x77')])){return this['channel'][_0x4249('0xa1')](_0x4249('0xed'));}if(!this[_0x4249('0x7e')](_0x40c377['client_email'])){return this[_0x4249('0xd')][_0x4249('0xa1')]('no\x20client_email\x20configured');}if(!this[_0x4249('0x7e')](_0x40c377[_0x4249('0x79')])){return this['channel'][_0x4249('0xa1')](_0x4249('0xee'));}if(!this[_0x4249('0x7e')](_0x40c377['dialogflowV2_language'])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xef'));}if(!this[_0x4249('0x7e')](_0x40c377[_0x4249('0x55')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa2'));}this[_0x4249('0xd')][_0x4249('0xf0')]=!![];this[_0x4249('0x32')](_0x40c377);this['createSquareMessage'](_0x40c377[_0x4249('0x55')],'in','','');this[_0x4249('0xd')][_0x4249('0xa1')](util['format'](_0x4249('0xf1'),_0x40c377[_0x4249('0x55')]));var _0x5a4bc3=this['googleDialogflowV2'][_0x4249('0x6a')](this,_0x40c377);if(_0x5a4bc3){for(var _0x4056c0 in _0x5a4bc3){if(_0x5a4bc3[_0x4249('0x8f')](_0x4056c0)){if(_0x4056c0!==_0x4249('0xf2')){this[_0x4249('0xd')][_0x4249('0x99')](util['format']('DIALOGFLOW_%s',_0x4056c0[_0x4249('0xe6')]()),_0x5a4bc3[_0x4056c0]);}}}this[_0x4249('0x3f')](_0x5a4bc3[_0x4249('0xe7')],_0x4249('0xe8'),'dialogflowV2',_0x5a4bc3[_0x4249('0xf2')]);return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0xf3'),_0x5a4bc3['speech']));}return this[_0x4249('0xd')]['error'](_0x40c377,_0x4249('0xf4'));};AGIVertices['prototype'][_0x4249('0xf5')]=function(_0x2129cc){logger['info'](util[_0x4249('0x24')](_0x4249('0xf6'),_0x2129cc['label']));if(!this['isConfigured'](_0x2129cc[_0x4249('0xf7')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xf8'));}if(!this['isConfigured'](_0x2129cc[_0x4249('0xf9')])){return this['channel'][_0x4249('0xa1')](_0x4249('0xfa'));}if(!this[_0x4249('0x7e')](_0x2129cc[_0x4249('0xfb')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xfc'));}if(!this['isConfigured'](_0x2129cc['ndassistant_url'])){return this[_0x4249('0xd')]['noop'](_0x4249('0xa2'));}this[_0x4249('0xd')][_0x4249('0xf0')]=!![];this[_0x4249('0x32')](_0x2129cc);this[_0x4249('0x3f')](_0x2129cc[_0x4249('0x55')],'in','','');this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0xfd'),_0x2129cc['text']));var _0x440263=this[_0x4249('0x7a')][_0x4249('0x6a')](this,_0x2129cc);if(_0x440263){for(var _0xc5f4f7 in _0x440263){if(_0x440263[_0x4249('0x8f')](_0xc5f4f7)){this[_0x4249('0xd')][_0x4249('0x99')](util[_0x4249('0x24')](_0x4249('0xfe'),_0xc5f4f7[_0x4249('0xe6')]()),_0x440263[_0xc5f4f7]);}}this[_0x4249('0x3f')](_0x440263['speech'],'out','sesteknda','');if(_0x440263['audiofile']){this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0xff'),_0x440263[_0x4249('0x100')]));var _0x56c895=this[_0x4249('0xd')][_0x4249('0x101')](_0x440263[_0x4249('0x100')]);try{fs['unlink'](_0x440263[_0x4249('0x100')]+_0x4249('0x102'));}catch(_0x34a820){logger[_0x4249('0x28')](_0x34a820);}return _0x56c895;}else{return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x103'),_0x440263[_0x4249('0xe7')]));}}return this[_0x4249('0xd')][_0x4249('0x28')](_0x2129cc,_0x4249('0x104'));};AGIVertices[_0x4249('0x10')][_0x4249('0x105')]=function(_0x276a01){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x106'),_0x276a01[_0x4249('0x34')]));return this[_0x4249('0xd')][_0x4249('0xa1')]('end');};AGIVertices['prototype']['ext_dial']=function(_0x15ed58){logger[_0x4249('0x29')](util['format'](_0x4249('0x107'),_0x15ed58[_0x4249('0x34')]));var _0x128667='';if(_0x15ed58['trunk_id']){if(!this[_0x4249('0x7e')](_0x15ed58['trunk_id'])){return this['channel']['error'](_0x15ed58,'no\x20trunk\x20selected');}else{var _0x1d8ce2=parseInt(_0x15ed58[_0x4249('0x108')],0xa);if(isNaN(_0x1d8ce2)){_0x128667=_0x15ed58['trunk_id'];}else{_0x128667=this[_0x4249('0x19')][_0x4249('0x6a')](this,_0x15ed58['trunk_id']);if(!_0x128667){return this['channel'][_0x4249('0x28')](_0x15ed58,'no\x20trunk\x20found');}}}}else if(_0x15ed58[_0x4249('0x109')]){_0x128667=_0x15ed58[_0x4249('0x109')];}else{return this[_0x4249('0xd')][_0x4249('0x28')](_0x15ed58,'no\x20trunk\x20selected');}var _0x1e989a=this[_0x4249('0xd')][_0x4249('0x50')](_0x4249('0xdf'),[util[_0x4249('0x24')](_0x4249('0x10a'),_0x128667,_0x15ed58['phone']),_0x15ed58['timeout'],_0x15ed58[_0x4249('0xe1')],_0x15ed58[_0x4249('0x5f')]]);if(_0x1e989a[_0x4249('0xa7')]===-0x1){return _0x1e989a;}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x10b'),_0x4249('0xdf')));};AGIVertices[_0x4249('0x10')][_0x4249('0x10c')]=function(_0x1408f5){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x10d'),_0x1408f5[_0x4249('0x34')]));return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x10c'));};AGIVertices[_0x4249('0x10')][_0x4249('0xb')]=function(_0x521870){logger[_0x4249('0x29')](util['format'](_0x4249('0x10e'),_0x521870['label']));if(_0x521870[_0x4249('0x10f')]===0x0){return this[_0x4249('0x9f')](_0x521870);}_0x521870[_0x4249('0x10f')]-=0x1;if(!this[_0x4249('0x7e')](_0x521870[_0x4249('0x110')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x521870,_0x4249('0x111'));}var _0x166aed=this[_0x4249('0x1b')]['sync'](this,_0x521870[_0x4249('0x110')]);if(!_0x166aed){return this[_0x4249('0xd')]['error'](_0x521870,'no\x20file\x20audio\x20found');}if(!this[_0x4249('0x7e')](_0x521870[_0x4249('0x112')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x4249('0x113'));}var _0x1afbec=this[_0x4249('0xd')]['getData'](_0x166aed,_0x521870[_0x4249('0x114')],_0x521870[_0x4249('0x115')]);var _0x503fae=_0x1afbec[_0x4249('0xa7')]?_0x1afbec[_0x4249('0xa7')]['toString']():'';logger[_0x4249('0x29')](_0x4249('0x116'),JSON['stringify'](_0x1afbec));if(_0x1afbec[_0x4249('0xa7')]===-0x1){this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x521870,_0x503fae);return _0x1afbec;}else if(_0x1afbec[_0x4249('0x9c')]===_0x4249('0x61')){_0x1afbec['result']=_0x503fae[_0x4249('0x96')]>=parseInt(_0x521870[_0x4249('0x117')])?'x':'i';}else{_0x1afbec['result']=_0x503fae['length']>=parseInt(_0x521870[_0x4249('0x117')])&&_0x503fae['length']<=parseInt(_0x521870[_0x4249('0x115')])?'x':'i';}var _0x4f3c81=this[_0x4249('0x11')][_0x4249('0x6a')](this,_0x521870[_0x4249('0x112')]);if(!_0x4f3c81){return this['channel'][_0x4249('0x28')](_0x521870,_0x4249('0x118'));}this['channel'][_0x4249('0x99')](_0x4f3c81,_0x503fae);if(this[_0x4249('0x7e')](_0x521870[_0x4249('0x119')])){var _0x20bae5=parseInt(_0x521870[_0x4249('0x119')],0xa);var _0x5941af=rs[_0x4249('0x11a')]({'charset':'*','length':_0x20bae5});var _0x29fbc5=_0x503fae['length'];if(_0x29fbc5>0x0){if(_0x29fbc5>_0x20bae5){this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x521870,_0x521870['hiddendigitspos']==='first'?_0x5941af+_0x503fae[_0x4249('0x11b')](_0x20bae5):_0x503fae[_0x4249('0x11b')](0x0,_0x29fbc5-_0x20bae5)+_0x5941af);}else{this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x521870,rs[_0x4249('0x11a')]({'charset':'*','length':_0x29fbc5}));}}else{this['createSquareDetailsReport'][_0x4249('0x6a')](this,_0x521870,'');}}else{this[_0x4249('0x32')]['sync'](this,_0x521870,_0x503fae);}return _0x1afbec;};AGIVertices['prototype'][_0x4249('0xc')]=function(_0x2153be){logger['info'](util[_0x4249('0x24')](_0x4249('0x11c'),_0x2153be[_0x4249('0x34')]));return this[_0x4249('0xb')](_0x2153be);};AGIVertices[_0x4249('0x10')][_0x4249('0x11d')]=function(_0x27bf26){logger['info'](util[_0x4249('0x24')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x27bf26[_0x4249('0x34')]));this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x27bf26,_0x27bf26[_0x4249('0x11e')]);return this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')](_0x4249('0x11f'),_0x27bf26[_0x4249('0x11e')]));};AGIVertices[_0x4249('0x10')][_0x4249('0x120')]=function(_0x1d8016){logger['info'](util[_0x4249('0x24')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1d8016[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x1d8016['aws_access_key_id'])||!this[_0x4249('0x7e')](_0x1d8016[_0x4249('0x82')])){return this[_0x4249('0xd')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x1d8016['text'])){return this['channel'][_0x4249('0xa1')](_0x4249('0xa2'));}this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')]('Trying\x20aws\x20Polly\x20%s',_0x1d8016['text']));var _0x1d070b=this[_0x4249('0x80')][_0x4249('0x6a')](this,_0x1d8016);if(_0x1d070b){this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')](_0x4249('0x121'),_0x1d070b));var _0x4fe164=this[_0x4249('0xd')][_0x4249('0x101')](_0x1d070b);try{fs['unlink'](_0x1d070b+_0x4249('0x102'));}catch(_0x33cbc9){logger[_0x4249('0x28')](_0x33cbc9);}return _0x4fe164;}return this[_0x4249('0xd')]['error'](_0x1d8016,_0x4249('0x122'));};AGIVertices[_0x4249('0x10')]['awslex']=function(_0xc8ae76){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x123'),_0xc8ae76[_0x4249('0x34')]));if(!this['isConfigured'](_0xc8ae76['aws_access_key_id'])||!this[_0x4249('0x7e')](_0xc8ae76[_0x4249('0x82')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x124'));}if(!this[_0x4249('0x7e')](_0xc8ae76['aws_bot_name'])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x125'));}if(!this[_0x4249('0x7e')](_0xc8ae76[_0x4249('0x55')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa2'));}this[_0x4249('0xd')][_0x4249('0xf0')]=!![];this[_0x4249('0x32')](_0xc8ae76);this[_0x4249('0x3f')](_0xc8ae76[_0x4249('0x55')],'in','','');this['channel'][_0x4249('0xa1')](util['format'](_0x4249('0x126'),_0xc8ae76[_0x4249('0x55')]));var _0x378a55=this[_0x4249('0x87')][_0x4249('0x6a')](this,_0xc8ae76);if(_0x378a55){for(var _0x1e9660 in _0x378a55){if(_0x378a55[_0x4249('0x8f')](_0x1e9660)&&_[_0x4249('0x90')](_0x378a55[_0x1e9660])){this[_0x4249('0xd')][_0x4249('0x99')](util[_0x4249('0x24')](_0x4249('0x127'),_0x1e9660[_0x4249('0xe6')]()),_0x378a55[_0x1e9660]);}}if(_[_0x4249('0x41')](_0x378a55['message'])){return this['channel'][_0x4249('0xa1')](_0x4249('0x128'));}else{this[_0x4249('0x3f')](_0x378a55[_0x4249('0x71')],_0x4249('0xe8'),_0x4249('0x129'),'');return this[_0x4249('0xd')]['noop'](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x378a55[_0x4249('0x71')]));}}return this['channel'][_0x4249('0x28')](_0xc8ae76,_0x4249('0x12a'));};AGIVertices['prototype'][_0x4249('0x12b')]=function(_0x46bf67){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x12c'),_0x46bf67['label'],_0x46bf67[_0x4249('0x61')]));if(!this[_0x4249('0x7e')](_0x46bf67[_0x4249('0x74')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x12d'));}var _0xf45268=_0x4249('0x12e');var _0xdee265=util['format'](_0x4249('0x12f'),FILES_PATH,rs[_0x4249('0x11a')](0x4));var _0x1a42b5=util[_0x4249('0x24')](_0x4249('0x98'),_0xdee265,_0xf45268);var _0x26d174=!![];if(_0x46bf67['beep']===_0x4249('0x130')){_0x26d174=![];}var _0x34cbb0=this[_0x4249('0xd')]['recordFile'](_0xdee265,_0xf45268,_0x46bf67['intKey'],_0x46bf67[_0x4249('0x61')],undefined,_0x26d174);if(_0x34cbb0['result']!==-0x1){this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')](_0x4249('0x131'),_0x1a42b5));var _0x2ad95f=this['googleASR']['sync'](this,_0x46bf67,_0x1a42b5);if(_0x2ad95f){for(var _0x2d4da0 in _0x2ad95f){if(_0x2ad95f[_0x4249('0x8f')](_0x2d4da0)){this[_0x4249('0xd')]['setVariable'](util['format'](_0x4249('0x132'),_0x2d4da0[_0x4249('0xe6')]()),_0x2ad95f[_0x2d4da0]);}}return this['channel']['noop'](util[_0x4249('0x24')](_0x4249('0x133'),JSON['stringify'](_0x2ad95f)));}}return _0x34cbb0;};AGIVertices[_0x4249('0x10')][_0x4249('0x134')]=function(_0x18bdfe){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x135'),_0x18bdfe['label']));if(!this[_0x4249('0x7e')](_0x18bdfe[_0x4249('0x8b')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x136'));}if(!this[_0x4249('0x7e')](_0x18bdfe[_0x4249('0x8c')])){return this[_0x4249('0xd')]['noop'](_0x4249('0x137'));}var _0xb9ab2c=_0x4249('0x12e');var _0x4a4910=util['format'](_0x4249('0x12f'),FILES_PATH,rs[_0x4249('0x11a')](0x4));var _0x27dc91=util[_0x4249('0x24')]('%s.%s',_0x4a4910,_0xb9ab2c);var _0x15b6ae=!![];if(_0x18bdfe[_0x4249('0x138')]==='NOBEEP'){_0x15b6ae=![];}var _0x3518ea=this[_0x4249('0xd')][_0x4249('0x139')](_0x4a4910,_0xb9ab2c,_0x18bdfe[_0x4249('0x13a')],_0x18bdfe[_0x4249('0x61')],undefined,_0x15b6ae);if(_0x3518ea[_0x4249('0xa7')]!==-0x1){this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x13b'),_0x27dc91));var _0x34ebd7=this[_0x4249('0x13c')]['sync'](this,_0x18bdfe,_0x27dc91);if(_0x34ebd7){for(var _0x59d48b in _0x34ebd7){if(_0x34ebd7[_0x4249('0x8f')](_0x59d48b)){this[_0x4249('0xd')][_0x4249('0x99')](util[_0x4249('0x24')]('TILDE_ASR_%s',_0x59d48b['toUpperCase']()),_0x34ebd7[_0x59d48b]);}}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x13d'),JSON[_0x4249('0x6d')](_0x34ebd7)));}}return _0x3518ea;};AGIVertices[_0x4249('0x10')]['gotoc']=function(_0x2ab1cc){logger['info'](util[_0x4249('0x24')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2ab1cc[_0x4249('0x34')]));return this['channel']['continueAt'](_0x2ab1cc[_0x4249('0x39')],_0x2ab1cc[_0x4249('0x3a')],_0x2ab1cc[_0x4249('0x13e')]);};AGIVertices[_0x4249('0x10')]['gotoif']=function(_0x17da77){logger['info'](util[_0x4249('0x24')](_0x4249('0x13f'),_0x17da77['label']));if(!this['isConfigured'](_0x17da77['condition'])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x17da77,_0x4249('0x140'));}try{var _0x5c0324=eval(_0x17da77[_0x4249('0x141')])?_0x4249('0x142'):_0x4249('0x143');this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')]('EVAL\x20CONDITION\x20%s\x20%s',_0x17da77[_0x4249('0x141')],_0x5c0324));return{'code':0xc8,'result':_0x5c0324};}catch(_0x1363b4){return{'code':0xc8,'result':_0x4249('0x143')};}};AGIVertices[_0x4249('0x10')][_0x4249('0x144')]=function(_0x3a09e9){logger['info'](util[_0x4249('0x24')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x3a09e9[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x3a09e9[_0x4249('0x145')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x3a09e9,_0x4249('0x146'));}var _0x351282=this['getIntervals'][_0x4249('0x6a')](this,_0x3a09e9[_0x4249('0x145')]);if(!_0x351282){return this['channel'][_0x4249('0x28')](_0x3a09e9,_0x4249('0x147'));}for(var _0x5b1696=0x0;_0x5b1696<_0x351282[_0x4249('0x96')];_0x5b1696+=0x1){var _0x48e450=this['channel'][_0x4249('0x11')](util[_0x4249('0x24')](_0x4249('0x148'),_0x351282[_0x5b1696]));if(_0x48e450['result']===-0x1){return _0x48e450;}logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x149'),_0x351282[_0x5b1696],_0x48e450[_0x4249('0x9c')]));if(_0x48e450[_0x4249('0x9c')]===_0x4249('0x142')){logger[_0x4249('0x29')](util['format'](_0x4249('0x149'),_0x351282[_0x5b1696],'true'));this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')]('IFTIME\x20%s\x20%s',_0x351282[_0x5b1696],_0x4249('0x142')));return{'code':0xc8,'result':'true'};}else{logger[_0x4249('0x29')](util[_0x4249('0x24')]('IFTIME\x20%s\x20%s',_0x351282[_0x5b1696],'false'));this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x149'),_0x351282[_0x5b1696],_0x4249('0x143')));}}return{'code':0xc8,'result':_0x4249('0x143')};};AGIVertices[_0x4249('0x10')][_0x4249('0x14a')]=function(_0x4be7ed){logger[_0x4249('0x29')](util[_0x4249('0x24')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4be7ed['label']));return this[_0x4249('0xd')][_0x4249('0x14a')]();};AGIVertices[_0x4249('0x10')][_0x4249('0x14b')]=function(_0x44fc6a){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x14c'),_0x44fc6a[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x44fc6a[_0x4249('0x74')])){return this['channel'][_0x4249('0xa1')](_0x4249('0x12d'));}var _0x59640c='wav';var _0x3ccf1b=util[_0x4249('0x24')]('%s/recordings/%s',FILES_PATH,rs[_0x4249('0x11a')](0x4));var _0x102aeb=util[_0x4249('0x24')](_0x4249('0x98'),_0x3ccf1b,_0x59640c);var _0x22cff2=!![];if(_0x44fc6a[_0x4249('0x138')]===_0x4249('0x130')){_0x22cff2=![];}var _0x2481d4=this[_0x4249('0xd')][_0x4249('0x139')](_0x3ccf1b,_0x59640c,_0x44fc6a[_0x4249('0x13a')],_0x44fc6a['timeout'],undefined,_0x22cff2);if(_0x2481d4['result']!==-0x1){this['channel'][_0x4249('0xa1')](util['format'](_0x4249('0x14d'),_0x102aeb));var _0x30aff9=this['ispeechASR'][_0x4249('0x6a')](this,_0x44fc6a,_0x102aeb);if(_0x30aff9){for(var _0x80076b in _0x30aff9){if(_0x30aff9[_0x4249('0x8f')](_0x80076b)){this[_0x4249('0xd')]['setVariable'](util[_0x4249('0x24')](_0x4249('0x14e'),_0x80076b['toUpperCase']()),_0x30aff9[_0x80076b]);}}return this['channel'][_0x4249('0xa1')](util['format'](_0x4249('0x14f'),JSON['stringify'](_0x30aff9)));}}return _0x2481d4;};AGIVertices['prototype']['ispeechtts']=function(_0xb7a0cc){logger['info'](util[_0x4249('0x24')](_0x4249('0x150'),_0xb7a0cc['label']));if(!this['isConfigured'](_0xb7a0cc['key'])){return this[_0x4249('0xd')]['noop'](_0x4249('0x12d'));}if(!this['isConfigured'](_0xb7a0cc[_0x4249('0x55')])){return this[_0x4249('0xd')]['noop'](_0x4249('0xa2'));}this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x151'),_0xb7a0cc[_0x4249('0x55')]));var _0x46b8ad=this[_0x4249('0x7b')][_0x4249('0x6a')](this,_0xb7a0cc);if(_0x46b8ad){this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x14d'),_0x46b8ad));var _0x333e4d=this[_0x4249('0xd')][_0x4249('0x101')](_0x46b8ad,_0xb7a0cc[_0x4249('0x13a')]);try{fs[_0x4249('0x152')](_0x46b8ad+_0x4249('0x102'));}catch(_0x38bf05){logger[_0x4249('0x28')](_0x38bf05);}return _0x333e4d;}return this[_0x4249('0xd')]['error'](_0xb7a0cc,_0x4249('0x153'));};AGIVertices[_0x4249('0x10')]['login']=function(_0x1d2665){logger[_0x4249('0x29')](util['format'](_0x4249('0x154'),_0x1d2665[_0x4249('0x34')]));if(!this['isConfigured'](_0x1d2665[_0x4249('0x155')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x1d2665,_0x4249('0x156'));}logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x157'),this['channel'][_0x4249('0x36')],_0x1d2665['findBy']));var _0x32f66c=this['agentLogin'][_0x4249('0x6a')](this,_0x1d2665[_0x4249('0x155')]);if(_0x32f66c){logger[_0x4249('0x29')](util['format'](_0x4249('0x158'),this[_0x4249('0xd')][_0x4249('0x36')],_0x1d2665[_0x4249('0x155')]));this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x158'),this[_0x4249('0xd')]['callerid'],_0x1d2665[_0x4249('0x155')]));return{'code':0xc8,'result':_0x4249('0x159')};}else{logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x15a'),this[_0x4249('0xd')]['callerid'],_0x1d2665[_0x4249('0x155')]));this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x15a'),this['channel'][_0x4249('0x36')],_0x1d2665[_0x4249('0x155')]));return{'code':0xc8,'result':_0x4249('0x15b')};}};AGIVertices[_0x4249('0x10')]['logout']=function(_0x5c9ced){logger[_0x4249('0x29')](util['format'](_0x4249('0x15c'),_0x5c9ced['label']));if(!this[_0x4249('0x7e')](_0x5c9ced[_0x4249('0x155')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x5c9ced,_0x4249('0x156'));}logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x157'),this[_0x4249('0xd')][_0x4249('0x36')],_0x5c9ced['findBy']));var _0xebf09=this['agentLogout'][_0x4249('0x6a')](this,_0x5c9ced[_0x4249('0x155')]);if(_0xebf09){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x158'),this[_0x4249('0xd')]['callerid'],_0x5c9ced[_0x4249('0x155')]));this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x158'),this[_0x4249('0xd')][_0x4249('0x36')],_0x5c9ced[_0x4249('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4249('0x29')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4249('0xd')][_0x4249('0x36')],_0x5c9ced[_0x4249('0x155')]));this[_0x4249('0xd')]['noop'](util['format'](_0x4249('0x15a'),this['channel'][_0x4249('0x36')],_0x5c9ced[_0x4249('0x155')]));return{'code':0xc8,'result':_0x4249('0x15b')};}};AGIVertices['prototype'][_0x4249('0x15d')]=function(_0x21448e){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x15e'),_0x21448e[_0x4249('0x34')]));if(!this['isConfigured'](_0x21448e[_0x4249('0x15f')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x21448e,_0x4249('0x160'));}this['channel'][_0x4249('0xa1')](util['format'](_0x4249('0x161'),_0x21448e[_0x4249('0x15f')]));var _0x234beb=eval(_0x21448e['operation']);if(!this[_0x4249('0x7e')](_0x21448e[_0x4249('0x112')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x113'));}var _0x2c4371=this[_0x4249('0x11')][_0x4249('0x6a')](this,_0x21448e[_0x4249('0x112')]);if(!_0x2c4371){return this[_0x4249('0xd')]['error'](_0x21448e,_0x4249('0x118'));}if(_[_0x4249('0x95')](_0x234beb)){var _0x1e1c96=this;_0x234beb[_0x4249('0xd5')](function(_0x934fd7,_0x47a175){_0x1e1c96['channel']['setVariable'](util[_0x4249('0x24')](_0x4249('0x162'),_0x2c4371,_0x47a175),_0x934fd7);});return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x163'),_0x2c4371));}else{return this[_0x4249('0xd')][_0x4249('0x99')](_0x2c4371,_0x234beb);}};AGIVertices['prototype'][_0x4249('0x164')]=function(_0x1e7a16){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x165'),_0x1e7a16[_0x4249('0x34')]));if(_0x1e7a16['retry']===0x0){return this[_0x4249('0x9f')](_0x1e7a16);}_0x1e7a16[_0x4249('0x10f')]-=0x1;if(!this[_0x4249('0x7e')](_0x1e7a16[_0x4249('0x110')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x1e7a16,_0x4249('0x111'));}var _0x121b52=this['getSound'][_0x4249('0x6a')](this,_0x1e7a16[_0x4249('0x110')]);if(!_0x121b52){return this[_0x4249('0xd')][_0x4249('0x28')](_0x1e7a16,_0x4249('0x166'));}var _0x6dbcd4=this[_0x4249('0xd')]['getData'](_0x121b52,_0x1e7a16[_0x4249('0x114')],_0x1e7a16['digit']);var _0x35c596=_0x6dbcd4[_0x4249('0xa7')];if(_0x6dbcd4['result']===-0x1){this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x1e7a16,'-1');return _0x6dbcd4;}else if(_0x6dbcd4[_0x4249('0x9c')]==='timeout'){_0x6dbcd4[_0x4249('0xa7')]=_0x6dbcd4[_0x4249('0xa7')][_0x4249('0x96')]>0x0?_0x6dbcd4['result']:'t';}else if(_['isEmpty'](_0x6dbcd4['result'])){_0x6dbcd4[_0x4249('0xa7')]='#';_0x35c596='#';}if(!this[_0x4249('0x7e')](_0x1e7a16[_0x4249('0x112')])){this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x113'));}else{var _0x26bd60=this[_0x4249('0x11')][_0x4249('0x6a')](this,_0x1e7a16[_0x4249('0x112')]);if(!_0x26bd60){return this[_0x4249('0xd')][_0x4249('0x28')](_0x1e7a16,_0x4249('0x118'));}this[_0x4249('0xd')][_0x4249('0x99')](_0x26bd60,_0x35c596);}this[_0x4249('0x32')]['sync'](this,_0x1e7a16,_0x35c596);return _0x6dbcd4;};AGIVertices[_0x4249('0x10')]['noop']=function(_0x1df037){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x167'),_0x1df037[_0x4249('0x34')]));return this['channel'][_0x4249('0xa1')](_0x1df037[_0x4249('0x168')]||_0x1df037['label']);};AGIVertices[_0x4249('0x10')][_0x4249('0x169')]=function(_0x125101){logger['info'](util[_0x4249('0x24')](_0x4249('0x16a'),_0x125101[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x125101[_0x4249('0x155')])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x125101,_0x4249('0x156'));}logger['info'](util[_0x4249('0x24')](_0x4249('0x157'),this['channel'][_0x4249('0x36')],_0x125101[_0x4249('0x155')]));var _0x3dcc3b=this[_0x4249('0x49')]['sync'](this,_0x125101[_0x4249('0x16b')]);var _0x291796=this['agentPause'][_0x4249('0x6a')](this,_0x125101['findBy'],_0x3dcc3b);if(_0x291796){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x158'),this[_0x4249('0xd')][_0x4249('0x36')],_0x125101['findBy']));this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x158'),this[_0x4249('0xd')]['callerid'],_0x125101[_0x4249('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x15a'),this[_0x4249('0xd')][_0x4249('0x36')],_0x125101[_0x4249('0x155')]));this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x158'),this['channel']['callerid'],_0x125101[_0x4249('0x155')]));return{'code':0xc8,'result':_0x4249('0x15b')};}};AGIVertices['prototype'][_0x4249('0x16c')]=function(_0x561104){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x16d'),_0x561104[_0x4249('0x34')]));if(!this['isConfigured'](_0x561104['file_id'])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x561104,_0x4249('0x111'));}var _0x1635a5=this[_0x4249('0x1b')][_0x4249('0x6a')](this,_0x561104[_0x4249('0x110')]);if(!_0x1635a5){return this[_0x4249('0xd')][_0x4249('0x28')](_0x561104,_0x4249('0x166'));}var _0xf991b5=this[_0x4249('0xd')][_0x4249('0x50')](_0x4249('0x16e'),[_0x1635a5,_0x561104[_0x4249('0xe1')]]);if(_0xf991b5['result']===-0x1){return _0xf991b5;}return this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x16f'),_0x4249('0x16e'),_0x1635a5));};AGIVertices[_0x4249('0x10')][_0x4249('0x170')]=function(_0x4af3b2){logger[_0x4249('0x29')](util['format'](_0x4249('0x171'),_0x4af3b2[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x4af3b2['queue_id'])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x4af3b2,_0x4249('0x172'));}var _0x30b837='';var _0x192abb=parseInt(_0x4af3b2[_0x4249('0x173')],0xa);if(isNaN(_0x192abb)){_0x30b837=_0x4af3b2[_0x4249('0x173')];}else{_0x30b837=this[_0x4249('0x15')][_0x4249('0x6a')](this,_0x4af3b2[_0x4249('0x173')]);if(!_0x30b837){return this[_0x4249('0xd')][_0x4249('0x28')](_0x4af3b2,'no\x20queue\x20found');}}var _0x133ad7='';if(this[_0x4249('0x7e')](_0x4af3b2[_0x4249('0x110')])){var _0x1391ef=this[_0x4249('0x1b')]['sync'](this,_0x4af3b2[_0x4249('0x110')]);if(_0x1391ef){_0x133ad7=_0x1391ef;}}this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x4af3b2,_0x30b837);if(_0x4af3b2[_0x4249('0xe1')]['indexOf']('x')<0x0){_0x4af3b2[_0x4249('0xe1')]+='x';}if(_0x4af3b2['opts'][_0x4249('0x174')]('X')<0x0){_0x4af3b2[_0x4249('0xe1')]+='X';}this[_0x4249('0xd')][_0x4249('0x99')](_0x4249('0x175'),_0x30b837?_0x30b837['toLowerCase']():'');var _0x414d04=this[_0x4249('0xd')][_0x4249('0x50')](_0x4249('0x176'),[_0x30b837,_0x4af3b2[_0x4249('0xe1')],_0x4af3b2['url'],_0x133ad7,_0x4af3b2[_0x4249('0x61')],_0x4af3b2['agi'],_0x4af3b2[_0x4249('0x177')],_0x4af3b2[_0x4249('0x178')],'',_0x4af3b2[_0x4249('0x179')]]);if(_0x414d04[_0x4249('0xa7')]===-0x1){return _0x414d04;}return this[_0x4249('0xd')][_0x4249('0xa1')](util['format'](_0x4249('0x16f'),_0x4249('0x176'),_0x30b837));};AGIVertices[_0x4249('0x10')][_0x4249('0x17a')]=function(_0x399e6c){logger['info'](util['format'](_0x4249('0x17b'),_0x399e6c[_0x4249('0x34')]));var _0x292c67=_0x399e6c[_0x4249('0x17c')]||_0x4249('0x12e');var _0x205af9=util[_0x4249('0x24')](_0x4249('0x17d'),this['channel'][_0x4249('0x33')],rs[_0x4249('0x11a')](0x5));var _0x3d3118=util['format'](_0x4249('0x17e'),FILES_PATH,_0x205af9,_0x292c67);var _0x1e1f52=util['format']('%s/recordings/%s',FILES_PATH,_0x205af9);this[_0x4249('0x37')]['sync'](this,_0x399e6c,_0x205af9,_0x3d3118);this[_0x4249('0xd')][_0x4249('0x99')](_0x4249('0x17f'),_0x205af9);logger[_0x4249('0x29')](_0x4249('0x180'),_0x1e1f52,_0x292c67,_0x399e6c[_0x4249('0x181')],_0x399e6c[_0x4249('0x61')]);return this[_0x4249('0xd')][_0x4249('0x139')](_0x1e1f52,_0x292c67,_0x399e6c[_0x4249('0x181')],_0x399e6c[_0x4249('0x61')],undefined,!![]);};AGIVertices[_0x4249('0x10')][_0x4249('0x182')]=function(_0x4988e2){logger['info'](util['format'](_0x4249('0x183'),_0x4988e2[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x4988e2['url'])){return this[_0x4249('0xd')][_0x4249('0xa1')]('no\x20url\x20configured');}var _0x27392b=this[_0x4249('0x5e')][_0x4249('0x6a')](this,_0x4988e2);logger[_0x4249('0x29')](util[_0x4249('0x24')]('Response:',util[_0x4249('0x184')](_0x27392b,{'showHidden':![],'depth':null})));if(!this[_0x4249('0x7e')](_0x4988e2[_0x4249('0x112')])){return this[_0x4249('0xd')]['noop'](_0x4249('0x185'));}var _0x5f4554=this[_0x4249('0x11')][_0x4249('0x6a')](this,_0x4988e2[_0x4249('0x112')]);if(!_0x5f4554){return this['channel'][_0x4249('0x28')](_0x4988e2,_0x4249('0x118'));}this['channel'][_0x4249('0x99')](util['format'](_0x4249('0x186'),_0x5f4554),_0x27392b['statusCode']?_0x27392b[_0x4249('0x6f')]:_0x4249('0x187'));this['channel'][_0x4249('0x99')](util[_0x4249('0x24')]('%s_STATUS_MESSAGE',_0x5f4554),_0x27392b[_0x4249('0x70')]?_0x27392b[_0x4249('0x70')]:'OK');if(_0x27392b[_0x4249('0x64')]){try{this[_0x4249('0x97')](_0x27392b[_0x4249('0x64')],_0x5f4554);}catch(_0x924e69){logger[_0x4249('0x28')](util['format'](_0x4249('0x188'),_0x5f4554));}}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')]('variable\x20%s\x20set',_0x5f4554));};AGIVertices[_0x4249('0x10')][_0x4249('0x189')]=function(_0x39e13c){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x18a'),_0x39e13c[_0x4249('0x34')]));return this['channel'][_0x4249('0x18b')](_0x39e13c[_0x4249('0x18c')][_0x4249('0xd3')](/\s+/g,''),_0x39e13c['escape_digits']);};AGIVertices[_0x4249('0x10')][_0x4249('0x18d')]=function(_0x5c077e){logger['info'](util[_0x4249('0x24')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5c077e[_0x4249('0x34')]));return this[_0x4249('0xd')][_0x4249('0x18e')](_0x5c077e['number']['replace'](/\s+/g,''),_0x5c077e[_0x4249('0x181')]);};AGIVertices[_0x4249('0x10')][_0x4249('0x18f')]=function(_0x37412c){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x190'),_0x37412c[_0x4249('0x34')]));return this[_0x4249('0xd')]['sayPhonetic'](_0x37412c['text'],_0x37412c[_0x4249('0x181')]);};AGIVertices['prototype'][_0x4249('0x191')]=function(_0x355a94){logger['info'](util[_0x4249('0x24')](_0x4249('0x192'),_0x355a94['label']));if(!this[_0x4249('0x7e')](_0x355a94[_0x4249('0x193')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x194'));}var _0x2a5445=this[_0x4249('0x195')][_0x4249('0x6a')](this,_0x355a94[_0x4249('0x193')]);if(!_0x2a5445||!_0x2a5445['Smtp']){return this[_0x4249('0xd')]['error'](_0x355a94,_0x4249('0x196'));}var _0x48ac6f={'from':util['format'](_0x4249('0x197'),_0x2a5445[_0x4249('0x13')],_0x2a5445[_0x4249('0x198')]||_0x2a5445[_0x4249('0x199')][_0x4249('0x19a')]),'to':_0x355a94['to']||'','cc':_0x355a94['cc']||'','bcc':_0x355a94[_0x4249('0x19b')]||'','subject':_0x355a94[_0x4249('0x19c')],'html':_0x355a94[_0x4249('0x55')],'text':_0x355a94[_0x4249('0x55')]};if(this[_0x4249('0x7e')](_0x355a94['template_id'])){}logger[_0x4249('0xda')](_0x4249('0x19d'),JSON['stringify'](_0x48ac6f));this[_0x4249('0x32')]['sync'](this,_0x355a94,_0x355a94[_0x4249('0x193')]);this[_0x4249('0xd')]['noop'](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x2a5445['name']));this[_0x4249('0x1f')][_0x4249('0x6a')](this,_0x2a5445[_0x4249('0x19e')],_0x48ac6f);return this['channel']['noop'](_0x4249('0x19f'));};AGIVertices[_0x4249('0x10')]['sendFax']=function(_0x1acc79){logger[_0x4249('0x29')](util['format'](_0x4249('0x1a0'),_0x1acc79['label']));return this['channel'][_0x4249('0xa1')](_0x4249('0x1a1'));};AGIVertices[_0x4249('0x10')][_0x4249('0x1a2')]=function(_0x4580eb){logger[_0x4249('0x29')](util[_0x4249('0x24')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4580eb[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x4580eb['sms_account_id'])){return this[_0x4249('0xd')]['noop'](_0x4249('0x1a3'));}var _0x1734ca=this[_0x4249('0x2f')][_0x4249('0x6a')](this,_0x4580eb[_0x4249('0x1a4')]);if(!_0x1734ca){return this[_0x4249('0xd')]['error'](_0x4580eb,'no\x20sms\x20account\x20found');}var _0x26f767={'body':_0x4580eb[_0x4249('0x1a5')],'phone':_0x4580eb['to']||'','SmsAccountId':_0x1734ca['id']};logger[_0x4249('0xda')](_0x4249('0x1a6'),JSON[_0x4249('0x6d')](_0x26f767));this[_0x4249('0x32')][_0x4249('0x6a')](this,_0x4580eb,_0x4580eb['sms_account_id']);this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1734ca[_0x4249('0x13')]));this[_0x4249('0x31')][_0x4249('0x6a')](this,_0x26f767);return this[_0x4249('0xd')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4249('0x10')][_0x4249('0x1a7')]=function(_0x6e93d7){logger['info'](util[_0x4249('0x24')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x6e93d7[_0x4249('0x34')]));if(!this['isConfigured'](_0x6e93d7[_0x4249('0x112')])){return this['channel']['error'](_0x6e93d7,'no\x20variable\x20selected');}var _0x42f421=this[_0x4249('0x11')]['sync'](this,_0x6e93d7[_0x4249('0x112')]);if(!_0x42f421){return this[_0x4249('0xd')][_0x4249('0x28')](_0x6e93d7,'no\x20variable\x20found');}return this[_0x4249('0xd')][_0x4249('0x99')](_0x42f421,_0x6e93d7[_0x4249('0x1a8')]);};AGIVertices[_0x4249('0x10')]['start']=function(_0x32ecb2){logger[_0x4249('0x29')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x32ecb2[_0x4249('0x34')]));this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x1a9'));var _0x5a718d=this[_0x4249('0xd')][_0x4249('0x11')](_0x4249('0x1aa'));if(!_[_0x4249('0x42')](_0x5a718d[_0x4249('0x9c')])){this[_0x4249('0xd')]['uniqueid']=_0x5a718d[_0x4249('0x9c')];}if(_0x32ecb2['answer']===_0x4249('0x1ab')){this['channel'][_0x4249('0xa1')](_0x4249('0x1ac'));return this[_0x4249('0xd')]['answer']();}return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x1ad'));};AGIVertices[_0x4249('0x10')][_0x4249('0x1ae')]=function(_0x481dd1){logger[_0x4249('0x29')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x481dd1[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x481dd1['project_id'])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x481dd1,_0x4249('0x1af'));}var _0x596652=this[_0x4249('0x1b0')][_0x4249('0x6a')](this,_0x481dd1[_0x4249('0x1b1')]);if(!this[_0x4249('0x7e')](_0x596652)){return this[_0x4249('0xd')][_0x4249('0x28')](_0x481dd1,util[_0x4249('0x24')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x481dd1[_0x4249('0x1b1')]));}if(_0x596652===this['channel'][_0x4249('0x3d')]){return this[_0x4249('0xd')][_0x4249('0x28')](_0x481dd1,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x4249('0x32')]['sync'](this,_0x481dd1,_0x596652);var _0x25d476=this[_0x4249('0xd')][_0x4249('0x50')]('AGI',util[_0x4249('0x24')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||_0x4249('0x1b2'),_0x596652,this[_0x4249('0xd')][_0x4249('0x3d')]));if(_0x25d476[_0x4249('0xa7')]===-0x1){return _0x25d476;}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')]('Executed\x20command\x20%s\x20%s',_0x4249('0x1b3'),_0x596652));};AGIVertices['prototype'][_0x4249('0x1b4')]=function(_0xd46ba9){logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x1b5'),_0xd46ba9[_0x4249('0x34')]));var _0x134237=this[_0x4249('0x1b6')]['sync'](this,_0xd46ba9['command']);this['createSquareDetailsReport']['sync'](this,_0xd46ba9,_0xd46ba9[_0x4249('0xaf')]);if(this['isConfigured'](_0xd46ba9[_0x4249('0x112')])){var _0x25a42c=this[_0x4249('0x11')][_0x4249('0x6a')](this,_0xd46ba9[_0x4249('0x112')]);if(_0x25a42c){this[_0x4249('0xd')][_0x4249('0x99')](_0x25a42c,_0x134237);return this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0xd46ba9[_0x4249('0xaf')],_0x25a42c));}}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x1b7'),_0xd46ba9[_0x4249('0xaf')]));};AGIVertices[_0x4249('0x10')]['google_cloud_tts']=function(_0x500e6d){logger[_0x4249('0x29')](util['format'](_0x4249('0x1b8'),_0x500e6d[_0x4249('0x34')]));_0x500e6d[_0x4249('0x55')]=_0x500e6d[_0x4249('0x55')][_0x4249('0xd3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4249('0x7e')](_0x500e6d[_0x4249('0x53')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0x1b9'));}if(!this[_0x4249('0x7e')](_0x500e6d[_0x4249('0x55')])){return this[_0x4249('0xd')][_0x4249('0xa1')](_0x4249('0xa2'));}this[_0x4249('0xd')]['noop'](util[_0x4249('0x24')](_0x4249('0x1ba'),_0x500e6d[_0x4249('0x55')]));var _0x1abb2d=this[_0x4249('0x52')]['sync'](this,_0x500e6d);if(_0x1abb2d){this[_0x4249('0xd')]['noop'](util['format'](_0x4249('0x1bb'),_0x1abb2d));var _0x2e1305=this['channel']['streamFile'](_0x1abb2d);try{fs[_0x4249('0x152')](_0x1abb2d+_0x4249('0x102'));}catch(_0xf528d6){logger[_0x4249('0x28')](_0xf528d6);}return _0x2e1305;}return this['channel'][_0x4249('0x28')](_0x500e6d,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x4249('0x10')][_0x4249('0x1bc')]=function(_0x2b4efc){logger['info'](util[_0x4249('0x24')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2b4efc[_0x4249('0x34')]));_0x2b4efc['text']=_0x2b4efc[_0x4249('0x55')][_0x4249('0xd3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4249('0x7e')](_0x2b4efc[_0x4249('0x55')])){return this[_0x4249('0xd')]['noop'](_0x4249('0xa2'));}this['channel']['noop'](util[_0x4249('0x24')]('Trying\x20Google\x20TTS\x20%s',_0x2b4efc[_0x4249('0x55')]));var _0x3677d3=this['googleTTS']['sync'](this,_0x2b4efc);if(_0x3677d3){this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x1bd'),_0x3677d3));var _0x4a954e=this[_0x4249('0xd')][_0x4249('0x101')](_0x3677d3);try{fs['unlink'](_0x3677d3+_0x4249('0x102'));}catch(_0x536598){logger[_0x4249('0x28')](_0x536598);}return _0x4a954e;}return this[_0x4249('0xd')][_0x4249('0x28')](_0x2b4efc,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x4249('0x10')]['unpause']=function(_0x7164bc){logger['info'](util[_0x4249('0x24')](_0x4249('0x1be'),_0x7164bc['label']));if(!this[_0x4249('0x7e')](_0x7164bc['findBy'])){return this[_0x4249('0xd')][_0x4249('0x28')](_0x7164bc,_0x4249('0x156'));}logger[_0x4249('0x29')](util[_0x4249('0x24')](_0x4249('0x157'),this[_0x4249('0xd')]['callerid'],_0x7164bc[_0x4249('0x155')]));var _0x2404c3=this['agentUnpause']['sync'](this,_0x7164bc[_0x4249('0x155')]);if(_0x2404c3){logger['info'](util['format'](_0x4249('0x158'),this[_0x4249('0xd')]['callerid'],_0x7164bc[_0x4249('0x155')]));this['channel'][_0x4249('0xa1')](util[_0x4249('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x4249('0x36')],_0x7164bc[_0x4249('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4249('0x29')](util['format'](_0x4249('0x15a'),this[_0x4249('0xd')][_0x4249('0x36')],_0x7164bc[_0x4249('0x155')]));this['channel']['noop'](util[_0x4249('0x24')](_0x4249('0x15a'),this[_0x4249('0xd')][_0x4249('0x36')],_0x7164bc[_0x4249('0x155')]));return{'code':0xc8,'result':_0x4249('0x15b')};}};AGIVertices['prototype'][_0x4249('0x1bf')]=function(_0x103afe){logger[_0x4249('0x29')](util['format'](_0x4249('0x1c0'),_0x103afe[_0x4249('0x34')]));var _0x1b6219=this['channel']['exec'](_0x4249('0x1c1'),[_0x103afe['mailbox'],_0x103afe[_0x4249('0x72')]]);if(_0x1b6219[_0x4249('0xa7')]===-0x1){return _0x1b6219;}return this[_0x4249('0xd')][_0x4249('0xa1')](util[_0x4249('0x24')](_0x4249('0x16f'),_0x4249('0x1c1'),_0x103afe[_0x4249('0x1c2')]));};AGIVertices[_0x4249('0x10')][_0x4249('0x1c3')]=function(_0x4afcf9){logger['info'](util['format'](_0x4249('0x1c4'),_0x4afcf9[_0x4249('0x34')]));if(!this[_0x4249('0x7e')](_0x4afcf9[_0x4249('0x112')])){return this['channel'][_0x4249('0x28')](_0x4afcf9,_0x4249('0x1c5'));}var _0x324214=this['getVariable'][_0x4249('0x6a')](this,_0x4afcf9[_0x4249('0x112')]);if(!_0x324214){return this[_0x4249('0xd')][_0x4249('0x28')](_0x4afcf9,_0x4249('0x118'));}var _0x42fa84=this[_0x4249('0xd')][_0x4249('0x11')](_0x324214);return{'code':0xc8,'result':_0x42fa84[_0x4249('0x9c')]?_0x42fa84[_0x4249('0x9c')]:'-'};};String[_0x4249('0x10')][_0x4249('0x9b')]=function(_0x2af5f8,_0x8318f2){return this[_0x4249('0x9a')](_0x2af5f8)[_0x4249('0x1c6')](_0x8318f2);};module[_0x4249('0x1c7')]=AGIVertices; \ No newline at end of file +var _0x5089=['getVariable','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','createSquareMessage','createCmContact','isEmpty','callback_','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentLogout','internal','agentLogin','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','includes','POST','PUT','method','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','parse','stringify','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','replaceAllVariables','getAndSetVariable','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','result','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','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','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','no\x20key\x20configured','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','sendMail\x20message','smtpOptions','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','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','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','agentUnpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','lodash','odbc','randomstring','moment','mustache','request-promise','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','channel','mailRpc','prototype'];(function(_0x1b7edd,_0x57456c){var _0x495876=function(_0xf9aa40){while(--_0xf9aa40){_0x1b7edd['push'](_0x1b7edd['shift']());}};_0x495876(++_0x57456c);}(_0x5089,0x1bb));var _0x9508=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x5089[_0x11ce46];return _0x368a1e;};'use strict';var fs=require('fs');var util=require(_0x9508('0x0'));var _=require(_0x9508('0x1'));var sh=require('shelljs');var odbc=require(_0x9508('0x2'))();var rs=require(_0x9508('0x3'));var moment=require(_0x9508('0x4'));var Mustache=require(_0x9508('0x5'));var rp=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var scripts=require(_0x9508('0x8'));var FILES_PATH=_0x9508('0x9');var recursiveMapAttributes=[_0x9508('0xa'),'rawBody'];var verticesWithRetry=[_0x9508('0xb'),_0x9508('0xc'),'getsecretdigits'];var AGIVertices=function(_0x14dae7,_0x338897,_0x4f6720){this[_0x9508('0xd')]=_0x14dae7;this['rpc']=_0x338897;this[_0x9508('0xe')]=_0x4f6720;};AGIVertices[_0x9508('0xf')][_0x9508('0x10')]=function(_0x21f8c1,_0x839509){this[_0x9508('0x11')]['getVariableById'](_0x21f8c1)[_0x9508('0x12')](function(_0x507887){_0x839509(null,_0x507887?_0x507887[_0x9508('0x13')]:![]);})[_0x9508('0x14')](function(_0x554c90){_0x839509(_0x554c90);});};AGIVertices[_0x9508('0xf')][_0x9508('0x15')]=function(_0x10ceef,_0x4701de){this['rpc'][_0x9508('0x16')](_0x10ceef)[_0x9508('0x12')](function(_0x51c80b){_0x4701de(null,_0x51c80b?_0x51c80b[_0x9508('0x13')]:![]);})['catch'](function(_0x25d4d6){_0x4701de(_0x25d4d6);});};AGIVertices[_0x9508('0xf')][_0x9508('0x17')]=function(_0x255a03,_0x127340){this[_0x9508('0x11')][_0x9508('0x18')](_0x255a03)[_0x9508('0x12')](function(_0x5a303c){_0x127340(null,_0x5a303c?_0x5a303c[_0x9508('0x13')]:![]);})[_0x9508('0x14')](function(_0xfcc29d){_0x127340(_0xfcc29d);});};AGIVertices[_0x9508('0xf')][_0x9508('0x19')]=function(_0x22a9fe,_0x52e3c4){this['rpc'][_0x9508('0x1a')](_0x22a9fe)['then'](function(_0x2272e2){_0x52e3c4(null,_0x2272e2?_0x2272e2['dsn']:![]);})[_0x9508('0x14')](function(_0x22ff69){_0x52e3c4(_0x22ff69);});};AGIVertices[_0x9508('0xf')][_0x9508('0x1b')]=function(_0x1edf1b,_0x2f8106){this[_0x9508('0x11')]['getUserById'](_0x1edf1b)['then'](function(_0xd7b601){_0x2f8106(null,_0xd7b601?_0xd7b601[_0x9508('0x13')]:![]);})[_0x9508('0x14')](function(_0xf70830){_0x2f8106(_0xf70830);});};AGIVertices[_0x9508('0xf')][_0x9508('0x1c')]=function(_0x4b68e9,_0x5e9a80){this[_0x9508('0x11')]['getTrunkById'](_0x4b68e9)['then'](function(_0x1d4500){_0x5e9a80(null,_0x1d4500?_0x1d4500['name']:![]);})['catch'](function(_0x1c9b3e){_0x5e9a80(_0x1c9b3e);});};AGIVertices[_0x9508('0xf')]['getSound']=function(_0x49246b,_0x32b0dd){var _0x22b2e2=this;this[_0x9508('0x11')][_0x9508('0x1d')](_0x49246b)[_0x9508('0x12')](function(_0x15c32e){_0x32b0dd(null,_0x15c32e?_0x22b2e2[_0x9508('0x1e')](_0x15c32e[_0x9508('0x1f')]):![]);})[_0x9508('0x14')](function(_0x19a984){_0x32b0dd(_0x19a984);});};AGIVertices['prototype'][_0x9508('0x20')]=function(_0x3b894b,_0x2b3738){this['rpc'][_0x9508('0x21')](_0x3b894b)[_0x9508('0x12')](function(_0x5e1d31){_0x2b3738(null,_0x5e1d31?_0x5e1d31:![]);})[_0x9508('0x14')](function(_0x226645){_0x2b3738(_0x226645);});};AGIVertices['prototype'][_0x9508('0x22')]=function(_0x2fd00e,_0xb06b10,_0x36de9f){this['mailRpc']['sendMailMessage'](_0x2fd00e,_0xb06b10)[_0x9508('0x12')](function(){_0x36de9f(null);})[_0x9508('0x14')](function(_0x2677d6){_0x36de9f(_0x2677d6);});};AGIVertices['prototype']['getIntervals']=function(_0x301dd0,_0x14be59){this[_0x9508('0x11')][_0x9508('0x23')](_0x301dd0)[_0x9508('0x12')](function(_0x3f86d4){if(_0x3f86d4){if(_0x3f86d4[_0x9508('0x24')]){_0x14be59(null,[_0x3f86d4[_0x9508('0x25')]]);}else{_0x14be59(null,_[_0x9508('0x26')](_0x3f86d4[_0x9508('0x27')],'interval'));}}else{_0x14be59(null,![]);}})[_0x9508('0x14')](function(_0x27e248){_0x14be59(_0x27e248);});};AGIVertices['prototype'][_0x9508('0x1e')]=function(_0x42c23c){return util[_0x9508('0x28')](_0x9508('0x29'),FILES_PATH,_0x42c23c);};AGIVertices[_0x9508('0xf')][_0x9508('0x2a')]=function(_0x33e17c,_0x3700f1,_0xfb6676){odbc[_0x9508('0x2b')](_0x33e17c,function(_0x2a5d1b){if(_0x2a5d1b){logger['error'](_0x9508('0x2c'),_0x2a5d1b);_0xfb6676(_0x2a5d1b);}else{logger['info'](_0x9508('0x2d'));odbc[_0x9508('0x2e')](_0x3700f1,function(_0x23a8b6,_0x5644b6){if(_0x23a8b6){logger['info'](_0x9508('0x2f'),_0x3700f1);_0xfb6676(_0x23a8b6);}else{logger[_0x9508('0x30')](_0x9508('0x31'),_0x3700f1);odbc[_0x9508('0x32')](function(_0x4eb600){if(_0x4eb600){logger[_0x9508('0x33')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4eb600);}_0xfb6676(null,_0x5644b6);});}});}});};AGIVertices[_0x9508('0xf')][_0x9508('0x34')]=function(_0x5205f8,_0x33e412){this[_0x9508('0x11')]['getSmsAccountById'](_0x5205f8)[_0x9508('0x12')](function(_0x1e6851){_0x33e412(null,_0x1e6851?_0x1e6851:![]);})[_0x9508('0x14')](function(_0x12fdc6){_0x33e412(_0x12fdc6);});};AGIVertices['prototype']['createSmsMessage']=function(_0xaf138f,_0x4ff354){this[_0x9508('0x11')][_0x9508('0x35')](_0xaf138f)[_0x9508('0x12')](function(_0x4215e9){_0x4ff354(null,_0x4215e9);})['catch'](function(_0x47e3a6){_0x4ff354(_0x47e3a6);});};AGIVertices['prototype'][_0x9508('0x36')]=function(_0x5e7fe3,_0x3f2fc1,_0x54e4bf){this[_0x9508('0x11')][_0x9508('0x36')]({'uniqueid':this[_0x9508('0xd')][_0x9508('0x37')],'node':_0x5e7fe3['label'],'application':_0x5e7fe3[_0x9508('0x38')],'data':_0x3f2fc1||null,'project_name':this[_0x9508('0xd')][_0x9508('0x39')],'callerid':this['channel'][_0x9508('0x3a')]})[_0x9508('0x12')](function(_0x560b9c){if(_0x54e4bf){_0x54e4bf(null,_0x560b9c);}})[_0x9508('0x14')](function(_0x50a4ba){if(_0x54e4bf){_0x54e4bf(_0x50a4ba);}});};AGIVertices[_0x9508('0xf')]['createSquareRecording']=function(_0x5b4888,_0x4194be,_0x168afb,_0x1936c8){this[_0x9508('0x11')][_0x9508('0x3b')]({'uniqueid':this[_0x9508('0xd')]['uniqueid'],'callerid':this[_0x9508('0xd')][_0x9508('0x3a')],'calleridname':this[_0x9508('0xd')]['calleridname'],'context':this[_0x9508('0xd')][_0x9508('0x3c')],'extension':this[_0x9508('0xd')][_0x9508('0x3d')],'priority':this['channel'][_0x9508('0x3e')],'accountcode':this['channel'][_0x9508('0x3f')],'dnid':this[_0x9508('0xd')]['dnid'],'projectName':this[_0x9508('0xd')][_0x9508('0x39')],'saveName':_0x4194be,'filename':_0x5b4888['file']||_0x4194be,'savePath':_0x168afb})[_0x9508('0x12')](function(_0x22306e){_0x1936c8(null,_0x22306e);})['catch'](function(_0x39215b){_0x1936c8(_0x39215b);});};AGIVertices['prototype'][_0x9508('0x40')]=function(_0x50df5e,_0x1e6c8c,_0x55a023,_0x49ac4f,_0x55a158){this['rpc'][_0x9508('0x40')]({'uniqueid':this[_0x9508('0xd')][_0x9508('0x37')],'body':_0x50df5e,'direction':_0x1e6c8c,'providerName':_0x55a023,'providerResponse':_0x49ac4f})[_0x9508('0x12')](function(_0x40e385){if(_0x55a158){_0x55a158(null,_0x40e385);}})[_0x9508('0x14')](function(_0x2b9854){if(_0x55a158){_0x55a158(_0x2b9854);}});};AGIVertices[_0x9508('0xf')][_0x9508('0x41')]=function(_0x5e4992,_0x3398d2){this[_0x9508('0x11')][_0x9508('0x41')]({'firstName':_[_0x9508('0x42')](_0x5e4992[_0x9508('0x13')])||_['isNil'](_0x5e4992['name'])?_0x9508('0x43')+Math['random']():_0x5e4992[_0x9508('0x13')],'lastName':_[_0x9508('0x42')](_0x5e4992['lastName'])||_[_0x9508('0x44')](_0x5e4992['lastName'])?null:_0x5e4992['lastName'],'phone':_0x5e4992[_0x9508('0x45')],'ListId':_0x5e4992[_0x9508('0x46')],'scheduledat':_0x5e4992['scheduledAt'],'callbackUniqueid':this[_0x9508('0xd')][_0x9508('0x37')],'tags':_0x9508('0x47'),'description':_0x9508('0x48')+_0x5e4992[_0x9508('0x49')][_0x9508('0x4a')](),'priority':_0x5e4992[_0x9508('0x4b')]})[_0x9508('0x12')](function(_0x367da4){_0x3398d2(null,_0x367da4);})[_0x9508('0x14')](function(_0x122934){_0x3398d2(_0x122934);});};AGIVertices[_0x9508('0xf')][_0x9508('0x4c')]=function(_0x2005f0,_0x4c7b6b){this[_0x9508('0x11')][_0x9508('0x4d')](_0x2005f0)['then'](function(_0x2573d1){_0x4c7b6b(null,_0x2573d1?_0x2573d1['name']:![]);})['catch'](function(_0x237cf9){_0x4c7b6b(_0x237cf9);});};AGIVertices[_0x9508('0xf')]['agentPause']=function(_0x199c2e,_0x198389,_0x553e6b){var _0x2d22dc={'role':_0x9508('0x4e')};_0x2d22dc[_0x199c2e]=this[_0x9508('0xd')]['callerid'];this[_0x9508('0x11')][_0x9508('0x4f')](_0x2d22dc,_0x198389,this[_0x9508('0xd')][_0x9508('0x37')])[_0x9508('0x12')](function(_0x34a4c5){_0x553e6b(null,_['isNil'](_0x34a4c5)?![]:!![]);})[_0x9508('0x14')](function(_0x460780){logger[_0x9508('0x33')](_0x460780);_0x553e6b(null,![]);});};AGIVertices[_0x9508('0xf')]['agentUnpause']=function(_0x2ff0bb,_0x5e2dab){var _0x314a07={'role':_0x9508('0x4e')};_0x314a07[_0x2ff0bb]=this['channel'][_0x9508('0x3a')];this[_0x9508('0x11')]['agentUnpause'](_0x314a07)[_0x9508('0x12')](function(_0x132e3f){_0x5e2dab(null,_[_0x9508('0x44')](_0x132e3f)?![]:!![]);})[_0x9508('0x14')](function(_0x5aa42b){logger[_0x9508('0x33')](_0x5aa42b);_0x5e2dab(null,![]);});};AGIVertices[_0x9508('0xf')][_0x9508('0x50')]=function(_0x468375,_0x27bae4){var _0x9a59f7={'role':_0x9508('0x4e')};_0x9a59f7[_0x468375]=this[_0x9508('0xd')]['callerid'];this[_0x9508('0x11')][_0x9508('0x50')](_0x9a59f7)[_0x9508('0x12')](function(_0x4fd9af){_0x27bae4(null,_[_0x9508('0x44')](_0x4fd9af)?![]:!![]);})['catch'](function(_0x3256e9){logger['error'](_0x3256e9);_0x27bae4(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x2c2cd8,_0x195be7){var _0x22c0c9={'role':'agent'};_0x22c0c9[_0x2c2cd8]=this[_0x9508('0xd')][_0x9508('0x3a')];var _0x3a092a=_0x2c2cd8!=_0x9508('0x51')?util[_0x9508('0x28')]('%s/%s@from-sip/n','LOCAL',this[_0x9508('0xd')][_0x9508('0x3a')]):undefined;this[_0x9508('0x11')][_0x9508('0x52')](_0x22c0c9,_0x3a092a)[_0x9508('0x12')](function(_0x3ec6b7){_0x195be7(null,_[_0x9508('0x44')](_0x3ec6b7)?![]:!![]);})[_0x9508('0x14')](function(_0x3e60d0){logger[_0x9508('0x33')](_0x3e60d0);_0x195be7(null,![]);});};AGIVertices[_0x9508('0xf')][_0x9508('0x53')]=function(_0x57e389,_0x520f72){sh[_0x9508('0x54')](_['trim'](_0x57e389),function(_0x3847ad,_0x47d7ff){var _0x4c89d2=_0x47d7ff[_0x9508('0x55')](/(\r\n|\n|\r)/gm,'');_0x520f72(null,_0x4c89d2);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x32da5f,_0x5f67d7){scripts[_0x9508('0x56')](_0x32da5f[_0x9508('0x57')],_0x32da5f[_0x9508('0x58')]||_0x9508('0x59'),_0x32da5f[_0x9508('0x59')],_0x32da5f[_0x9508('0x5a')]||_0x9508('0x5b'),_0x32da5f[_0x9508('0x5c')]||_0x9508('0x5d'),_0x32da5f[_0x9508('0x5e')]||_0x9508('0x5f'))[_0x9508('0x12')](function(_0x456828){_0x5f67d7(null,_0x456828);})['catch'](function(_0x2dc584){_0x5f67d7(_0x2dc584);});};AGIVertices['prototype'][_0x9508('0x60')]=function(_0x39618d,_0x42ab8e){scripts[_0x9508('0x60')](_0x39618d[_0x9508('0x59')],_0x39618d[_0x9508('0x61')]||'en',0x1)[_0x9508('0x12')](function(_0x2658e1){_0x42ab8e(null,_0x2658e1);})[_0x9508('0x14')](function(_0x18b441){_0x42ab8e(_0x18b441);});};AGIVertices[_0x9508('0xf')][_0x9508('0x62')]=function(_0x5d0d94,_0x2db0af){var _0x2020bd={'uri':_0x5d0d94[_0x9508('0x63')],'method':_0x5d0d94['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5d0d94['timeout'])===_0x9508('0x64')&&parseInt(_0x5d0d94[_0x9508('0x65')])>=0x1?parseInt(_0x5d0d94[_0x9508('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x9508('0x66')]([_0x9508('0x67'),_0x9508('0x68')],_0x2020bd[_0x9508('0x69')]['toUpperCase']())){try{_0x2020bd[_0x9508('0x6a')]=_0x5d0d94['rawBody']?JSON['parse'](_0x5d0d94[_0x9508('0x6b')]):{};}catch(_0x5b576a){logger[_0x9508('0x33')](_0x9508('0x6c'),_0x5b576a);}}try{_0x2020bd['headers']=_0x5d0d94[_0x9508('0xa')]?JSON['parse'](_0x5d0d94[_0x9508('0xa')]):{};}catch(_0x5d9dd2){logger[_0x9508('0x33')](_0x9508('0x6d'),_0x5d9dd2);}if(_0x5d0d94[_0x9508('0x6e')]){try{var _0x21c1b7=require(_0x5d0d94[_0x9508('0x6e')])[_0x9508('0x6f')](this,_0x2020bd);_0x2020bd[_0x9508('0x70')]=Mustache[_0x9508('0x71')](_0x5d0d94[_0x9508('0x63')],_0x21c1b7,{},['$$','$$']);if(_0x2020bd[_0x9508('0x72')]){_0x2020bd['headers']=JSON[_0x9508('0x73')](Mustache[_0x9508('0x71')](JSON[_0x9508('0x74')](_0x2020bd[_0x9508('0x72')]),_0x21c1b7,{},['$$','$$']));}if(_0x2020bd[_0x9508('0x6a')]){_0x2020bd[_0x9508('0x6a')]=JSON['parse'](Mustache['render'](JSON[_0x9508('0x74')](_0x2020bd[_0x9508('0x6a')]),_0x21c1b7,{},['$$','$$']));}}catch(_0x1ad750){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1ad750);}}rp(_0x2020bd)[_0x9508('0x12')](function(_0x525ce2){var _0x287a1b={'statusCode':_0x525ce2[_0x9508('0x75')]||0xc8,'statusMessage':_0x525ce2[_0x9508('0x76')]||'OK','headers':_0x525ce2['headers']||{},'body':_0x525ce2[_0x9508('0x6a')]||{}};_0x2db0af(null,_0x287a1b);})[_0x9508('0x14')](function(_0x212d04){var _0x3ea6e0={'statusCode':_0x212d04[_0x9508('0x75')]||0x1f4,'statusMessage':_0x212d04[_0x9508('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x212d04['options'][_0x9508('0x72')]||{},'body':_0x212d04[_0x9508('0x78')]['body']||{}};_0x2db0af(null,_0x3ea6e0);});};AGIVertices[_0x9508('0xf')][_0x9508('0x79')]=function(_0xdf4171,_0x4959a6){scripts['googleDialogflow'](this[_0x9508('0xd')]['uniqueid'],_0xdf4171[_0x9508('0x7a')],_0xdf4171[_0x9508('0x59')],_0xdf4171[_0x9508('0x7b')]||'en')[_0x9508('0x12')](function(_0x5af5e4){_0x4959a6(null,_0x5af5e4);})[_0x9508('0x14')](function(_0x178b03){_0x4959a6(_0x178b03);});};AGIVertices['prototype'][_0x9508('0x7c')]=function(_0x146d98,_0xa89fca){scripts['googleDialogflowV2'](this[_0x9508('0xd')]['uniqueid'],_0x146d98[_0x9508('0x7d')],_0x146d98[_0x9508('0x7e')],_0x146d98[_0x9508('0x7f')],_0x146d98[_0x9508('0x59')],_0x146d98[_0x9508('0x80')]||'en')[_0x9508('0x12')](function(_0x2f9f8d){_0xa89fca(null,_0x2f9f8d);})[_0x9508('0x14')](function(_0x234b3e){_0xa89fca(_0x234b3e);});};AGIVertices[_0x9508('0xf')][_0x9508('0x81')]=function(_0x2c271e,_0x33ff9c){scripts[_0x9508('0x81')](this[_0x9508('0xd')],_0x2c271e)[_0x9508('0x12')](function(_0x482b07){_0x33ff9c(null,_0x482b07);})[_0x9508('0x14')](function(_0x47cccc){_0x33ff9c(_0x47cccc);});};AGIVertices['prototype'][_0x9508('0x82')]=function(_0x3bb289,_0x1fa1e8){scripts['ispeechTTS'](_0x3bb289[_0x9508('0x7a')],_0x3bb289[_0x9508('0x59')],_0x3bb289[_0x9508('0x83')]||_0x9508('0x5b'),_0x3bb289[_0x9508('0x84')])[_0x9508('0x12')](function(_0x303d50){_0x1fa1e8(null,_0x303d50);})['catch'](function(_0x1368d2){_0x1fa1e8(_0x1368d2);});};AGIVertices['prototype'][_0x9508('0x85')]=function(_0x2db5ed,_0x1db47b,_0x3cfd6b){scripts[_0x9508('0x85')](_0x1db47b,_0x2db5ed[_0x9508('0x7a')],_0x2db5ed[_0x9508('0x86')]||_0x9508('0x5b'),this[_0x9508('0x87')](_0x2db5ed['model'])?_0x2db5ed[_0x9508('0x88')]:undefined)['then'](function(_0x55900d){_0x3cfd6b(null,_0x55900d);})[_0x9508('0x14')](function(_0x2851ba){_0x3cfd6b(_0x2851ba);});};AGIVertices[_0x9508('0xf')][_0x9508('0x89')]=function(_0x5e3e7a,_0x54e7e8){scripts[_0x9508('0x89')](_0x5e3e7a[_0x9508('0x8a')],_0x5e3e7a[_0x9508('0x8b')],_0x5e3e7a['aws_polly_region'],_0x5e3e7a[_0x9508('0x8c')]||'Amy',_0x5e3e7a['text'],_0x5e3e7a[_0x9508('0x8d')]||'text')[_0x9508('0x12')](function(_0x1d6547){_0x54e7e8(null,_0x1d6547);})[_0x9508('0x14')](function(_0x1d443a){_0x54e7e8(_0x1d443a);});};AGIVertices[_0x9508('0xf')][_0x9508('0x8e')]=function(_0x50ce8b,_0x4566ff){scripts[_0x9508('0x8e')](this['channel'][_0x9508('0x37')],_0x50ce8b['aws_access_key_id'],_0x50ce8b['aws_secret_access_key'],_0x50ce8b[_0x9508('0x8f')],_0x50ce8b[_0x9508('0x59')],_0x50ce8b[_0x9508('0x90')])[_0x9508('0x12')](function(_0x4c8bab){_0x4566ff(null,_0x4c8bab);})[_0x9508('0x14')](function(_0x3ae1a5){_0x4566ff(_0x3ae1a5);});};AGIVertices[_0x9508('0xf')][_0x9508('0x91')]=function(_0x5eeed0,_0x510ba6,_0x4ebc98){scripts[_0x9508('0x91')](_0x510ba6,_0x5eeed0[_0x9508('0x7a')],_0x5eeed0[_0x9508('0x92')]||_0x9508('0x5b'))[_0x9508('0x12')](function(_0x291240){_0x4ebc98(null,_0x291240);})[_0x9508('0x14')](function(_0x1ac4e2){_0x4ebc98(_0x1ac4e2);});};AGIVertices[_0x9508('0xf')][_0x9508('0x93')]=function(_0x21c8c9,_0x1d31e5,_0x721116){scripts[_0x9508('0x93')](_0x1d31e5,_0x21c8c9['appid'],_0x21c8c9[_0x9508('0x94')],_0x21c8c9['uri'])[_0x9508('0x12')](function(_0x4b7ba4){_0x721116(null,_0x4b7ba4);})[_0x9508('0x14')](function(_0x4477ee){_0x721116(_0x4477ee);});};AGIVertices[_0x9508('0xf')][_0x9508('0x95')]=function(_0x155d6d){var _0x25a599=_[_0x9508('0x66')](verticesWithRetry,_0x155d6d[_0x9508('0x38')])?_0x155d6d:_[_0x9508('0x96')](_0x155d6d);for(var _0x46bd70 in _0x25a599){if(_0x25a599[_0x9508('0x97')](_0x46bd70)){if(_0x25a599[_0x46bd70]&&_['isString'](_0x25a599[_0x46bd70])){if(_[_0x9508('0x66')](recursiveMapAttributes,_0x46bd70)){_0x25a599[_0x46bd70]=this[_0x9508('0x98')](_0x25a599[_0x46bd70]);}else{_0x25a599[_0x46bd70]=this['replaceAllVariables'](_0x25a599[_0x46bd70]);}}}}return _0x25a599;};AGIVertices[_0x9508('0xf')]['recursiveNodeIndex']=function(_0x41bcd9){for(var _0x1a0901 in _0x41bcd9){if(_0x41bcd9[_0x9508('0x97')](_0x1a0901)){if(_[_0x9508('0x99')](_0x41bcd9[_0x1a0901])){this[_0x9508('0x9a')](_0x41bcd9[_0x1a0901]);}else if(_[_0x9508('0x9b')](_0x41bcd9[_0x1a0901])){for(var _0x5293da=0x0;_0x5293da<_0x41bcd9[_0x1a0901][_0x9508('0x9c')];_0x5293da++){this['recursiveNodeIndex'](_0x41bcd9[_0x1a0901][_0x5293da]);}}else if(_[_0x9508('0x9d')](_0x41bcd9[_0x1a0901])){_0x41bcd9[_0x1a0901]=this['replaceAllVariables'](_0x41bcd9[_0x1a0901]);}}}};AGIVertices[_0x9508('0xf')][_0x9508('0x9e')]=function(_0x40cc62,_0xbeee60){for(var _0x2e2eb2 in _0x40cc62){if(_0x40cc62[_0x9508('0x97')](_0x2e2eb2)){if(_[_0x9508('0x99')](_0x40cc62[_0x2e2eb2])){if(!_[_0x9508('0x42')](_0x40cc62[_0x2e2eb2])){this[_0x9508('0x9e')](_0x40cc62[_0x2e2eb2],util[_0x9508('0x28')](_0x9508('0x9f'),_0xbeee60,_0x2e2eb2));}}else if(_[_0x9508('0x9b')](_0x40cc62[_0x2e2eb2])){for(var _0x3e8b0a=0x0;_0x3e8b0a<_0x40cc62[_0x2e2eb2]['length'];_0x3e8b0a++){this['saveRestApiResult'](_0x40cc62[_0x2e2eb2][_0x3e8b0a],util[_0x9508('0x28')]('%s.%s',_0xbeee60,_0x2e2eb2+'['+_0x3e8b0a+']'));}}else{if(!_['isNil'](_0x40cc62[_0x2e2eb2])){this['channel'][_0x9508('0xa0')](util[_0x9508('0x28')]('%s.%s',_0xbeee60,_0x2e2eb2),_0x40cc62[_0x2e2eb2]);}}}}};AGIVertices['prototype'][_0x9508('0x98')]=function(_0x230a76){try{var _0x58edee=JSON[_0x9508('0x73')](_0x230a76);this['recursiveNodeIndex'](_0x58edee);return JSON[_0x9508('0x74')](_0x58edee);}catch(_0x1127db){return this['replaceAllVariables'](_0x230a76);}};AGIVertices[_0x9508('0xf')]['replaceAllVariables']=function(_0x249476){var _0x979665=_0x249476[_0x9508('0xa1')]('{');for(var _0x3e35b8=0x1;_0x3e35b8<_0x979665['length'];_0x3e35b8+=0x1){var _0x380f11=_0x979665[_0x3e35b8]['split']('}');if(_0x380f11[_0x9508('0x9c')]>0x1){_0x249476=_0x249476[_0x9508('0xa2')]('{'+_0x380f11[0x0]+'}',this[_0x9508('0xd')][_0x9508('0x10')](_0x380f11[0x0])[_0x9508('0xa3')]||_0x380f11[0x0]);}}if(_0x979665[_0x9508('0x9c')]===0x1){return _0x249476[_0x9508('0x4a')]();}return this[_0x9508('0xa4')](_0x249476);};AGIVertices[_0x9508('0xf')][_0x9508('0xa5')]=function(_0x51b44c,_0x5ede0e){var _0x28cefb=this[_0x9508('0xd')][_0x9508('0x10')](_0x51b44c);if(_0x28cefb['result']===-0x1){return _0x28cefb;}logger[_0x9508('0x30')](util[_0x9508('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5ede0e,_0x28cefb[_0x9508('0xa3')]));return this[_0x9508('0xd')][_0x9508('0xa0')](_0x5ede0e,_0x28cefb[_0x9508('0xa3')]);};AGIVertices['prototype'][_0x9508('0x87')]=function(_0x4a2646){return _0x4a2646&&_0x4a2646!=='0'&&_0x4a2646!=='-1'&&_0x4a2646!=='';};AGIVertices['prototype']['maxRetry']=function(_0x106251){this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x106251,'-');_0x106251[_0x9508('0xa6')]=_0x106251[_0x9508('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9508('0xf')]['mrcpsynth']=function(_0x2802b4){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xa8'),_0x2802b4[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x2802b4['text'])){return this[_0x9508('0xd')]['noop'](_0x9508('0xaa'));}var _0xb79d84='\x22'+_0x2802b4[_0x9508('0x59')]+'\x22';if(this['isConfigured'](_0x2802b4[_0x9508('0x78')])){_0xb79d84+=','+_0x2802b4['options'];}var _0x5a4db4=this[_0x9508('0xd')][_0x9508('0x54')]('MRCPSynth',_0xb79d84);if(_0x5a4db4[_0x9508('0xab')]===-0x1){return _0x5a4db4;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xad'),_0xb79d84));};AGIVertices[_0x9508('0xf')][_0x9508('0xae')]=function(_0x119c3a){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xaf'),_0x119c3a[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x119c3a[_0x9508('0xb0')])){return this['channel'][_0x9508('0xac')](_0x9508('0xb1'));}var _0x3fd814=_0x119c3a[_0x9508('0xb0')];if(this['isConfigured'](_0x119c3a[_0x9508('0x78')])){_0x3fd814+=','+_0x119c3a[_0x9508('0x78')];}var _0x14314b=this[_0x9508('0xd')][_0x9508('0x54')](_0x9508('0xb2'),_0x3fd814);if(_0x14314b['result']===-0x1){return _0x14314b;}var _0x1fdf50=this[_0x9508('0xa5')](_0x9508('0xb3'),_0x9508('0xb4'));if(_0x1fdf50[_0x9508('0xab')]===-0x1){return _0x1fdf50;}var _0x49dbc6=this['getAndSetVariable'](_0x9508('0xb5'),_0x9508('0xb6'));if(_0x49dbc6[_0x9508('0xab')]===-0x1){return _0x49dbc6;}var _0xe77013=this[_0x9508('0xa5')](_0x9508('0xb7'),_0x9508('0xb8'));if(_0xe77013['result']===-0x1){return _0xe77013;}return this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3fd814));};AGIVertices[_0x9508('0xf')][_0x9508('0x7')]=function(_0x10beb2){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xb9'),_0x10beb2[_0x9508('0xa9')]));return this['channel'][_0x9508('0x7')]([_0x10beb2[_0x9508('0xba')],_0x10beb2['args']]);};AGIVertices[_0x9508('0xf')][_0x9508('0xbb')]=function(_0x19d8dd){logger['info'](util['format'](_0x9508('0xbc'),_0x19d8dd[_0x9508('0xa9')]));if(this[_0x9508('0x87')](_0x19d8dd['timeout'])){logger['info'](util[_0x9508('0x28')](_0x9508('0xbd'),_0x19d8dd[_0x9508('0x65')]));var _0x3ef7e3=this[_0x9508('0xd')][_0x9508('0xbe')](_0x19d8dd[_0x9508('0x65')]);if(_0x3ef7e3[_0x9508('0xab')]===-0x1){return _0x3ef7e3;}}return this[_0x9508('0xd')][_0x9508('0xbb')]();};AGIVertices[_0x9508('0xf')][_0x9508('0x47')]=function(_0xd931a4){logger['info'](util[_0x9508('0x28')](_0x9508('0xbf'),_0xd931a4['label']));if(!this[_0x9508('0x87')](_0xd931a4[_0x9508('0x46')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0xd931a4,'no\x20list\x20selected');}_0xd931a4[_0x9508('0x49')]=moment();if(this[_0x9508('0x87')](_0xd931a4['delay'])){_0xd931a4[_0x9508('0x49')]=moment()['add'](_0xd931a4[_0x9508('0xc0')],'minutes');}if(!this[_0x9508('0x87')](_0xd931a4[_0x9508('0x4b')])){_0xd931a4[_0x9508('0x4b')]=0x2;}this[_0x9508('0x41')][_0x9508('0x6f')](this,_0xd931a4);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xc1'),_0xd931a4[_0x9508('0x45')],_0xd931a4[_0x9508('0x46')],_0xd931a4[_0x9508('0x49')]));};AGIVertices['prototype'][_0x9508('0xc2')]=function(_0x1c19ef){logger[_0x9508('0x30')](util['format'](_0x9508('0xc3'),_0x1c19ef[_0x9508('0xa9')]));var _0x1d0e4c=this[_0x9508('0xd')][_0x9508('0x54')](_0x1c19ef['application'],_0x1c19ef[_0x9508('0x78')]);if(_0x1d0e4c[_0x9508('0xab')]===-0x1){return _0x1d0e4c;}return this[_0x9508('0xd')]['noop'](util['format'](_0x9508('0xc4'),_0x1c19ef[_0x9508('0xc5')],_0x1c19ef['options']));};AGIVertices[_0x9508('0xf')][_0x9508('0xc6')]=function(_0x24cfcd){logger['info'](util[_0x9508('0x28')](_0x9508('0xc7'),_0x24cfcd[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x24cfcd['text'])){return this['channel']['noop']('no\x20text\x20configured');}var _0x1a3a7d='\x22'+_0x24cfcd['text']+'\x22';if(this[_0x9508('0x87')](_0x24cfcd[_0x9508('0x78')])){_0x1a3a7d+=','+_0x24cfcd[_0x9508('0x78')];}var _0x423786=this[_0x9508('0xd')][_0x9508('0x54')]('MRCPSynth',_0x1a3a7d);if(_0x423786[_0x9508('0xab')]===-0x1){return _0x423786;}return this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xad'),_0x1a3a7d));};AGIVertices['prototype']['sestektts']=function(_0x36ece0){logger[_0x9508('0x30')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x36ece0[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x36ece0[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20text\x20configured');}var _0x1fb57c='\x22'+_0x36ece0[_0x9508('0x59')]+'\x22';if(this[_0x9508('0x87')](_0x36ece0[_0x9508('0x78')])){_0x1fb57c+=','+_0x36ece0['options'];}var _0x3a066f=this['channel'][_0x9508('0x54')](_0x9508('0xc8'),_0x1fb57c);if(_0x3a066f['result']===-0x1){return _0x3a066f;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xad'),_0x1fb57c));};AGIVertices[_0x9508('0xf')][_0x9508('0xc9')]=function(_0x1ea1b5){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1ea1b5['label']));if(!this[_0x9508('0x87')](_0x1ea1b5[_0x9508('0xb0')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x1fa662=_0x1ea1b5[_0x9508('0xb0')];if(this[_0x9508('0x87')](_0x1ea1b5[_0x9508('0x78')])){_0x1fa662+=','+_0x1ea1b5[_0x9508('0x78')];}var _0x230fdf=this['channel'][_0x9508('0x54')](_0x9508('0xb2'),_0x1fa662);if(_0x230fdf['result']===-0x1){return _0x230fdf;}var _0x1f9e4c=this['getAndSetVariable'](_0x9508('0xb3'),'LUMENVOX_ASR_CONFIDENCE');if(_0x1f9e4c[_0x9508('0xab')]===-0x1){return _0x1f9e4c;}var _0x3ca7b4=this[_0x9508('0xa5')](_0x9508('0xb5'),_0x9508('0xca'));if(_0x3ca7b4[_0x9508('0xab')]===-0x1){return _0x3ca7b4;}var _0x2ad943=this['getAndSetVariable'](_0x9508('0xb7'),_0x9508('0xcb'));if(_0x2ad943[_0x9508('0xab')]===-0x1){return _0x2ad943;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xcc'),_0x1fa662));};AGIVertices[_0x9508('0xf')]['sestekasr']=function(_0xfb0e8e){logger['info'](util['format'](_0x9508('0xcd'),_0xfb0e8e[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0xfb0e8e[_0x9508('0xb0')])){return this['channel'][_0x9508('0xac')](_0x9508('0xb1'));}var _0x3e1a1b=_0xfb0e8e[_0x9508('0xb0')];if(this[_0x9508('0x87')](_0xfb0e8e[_0x9508('0x78')])){_0x3e1a1b+=','+_0xfb0e8e[_0x9508('0x78')];}var _0x4aaca8=this['channel'][_0x9508('0x54')]('MRCPRecog',_0x3e1a1b);if(_0x4aaca8[_0x9508('0xab')]===-0x1){return _0x4aaca8;}var _0x4153b8=this[_0x9508('0xa5')](_0x9508('0xb3'),_0x9508('0xce'));if(_0x4153b8[_0x9508('0xab')]===-0x1){return _0x4153b8;}var _0x57ebdb=this[_0x9508('0xa5')](_0x9508('0xb5'),_0x9508('0xcf'));if(_0x57ebdb[_0x9508('0xab')]===-0x1){return _0x57ebdb;}var _0x318779=this[_0x9508('0xa5')](_0x9508('0xb7'),'SESTEK_ASR_INSTANCE');if(_0x318779[_0x9508('0xab')]===-0x1){return _0x318779;}return this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3e1a1b));};AGIVertices[_0x9508('0xf')]['database']=function(_0x6f2407){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xd0'),_0x6f2407[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x6f2407[_0x9508('0xd1')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x6f2407,_0x9508('0xd2'));}var _0x30884b=this[_0x9508('0x19')][_0x9508('0x6f')](this,_0x6f2407['odbc_id']);if(!_0x30884b){return this['channel']['error'](_0x6f2407,_0x9508('0xd3'));}if(!this[_0x9508('0x87')](_0x6f2407['query'])){return this[_0x9508('0xd')]['error'](_0x6f2407,'no\x20query\x20configured');}var _0x514173=_0x6f2407['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0xd4'),_0x514173));var _0x37043b=this['getQueryOdbc']['sync'](this,_0x30884b,_0x514173);this[_0x9508('0x36')]['sync'](this,_0x6f2407,_0x514173);if(!this[_0x9508('0x87')](_0x6f2407['variable_id'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xd5'));}var _0x178218=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x6f2407[_0x9508('0xd6')]);if(!_0x178218){return this[_0x9508('0xd')]['error'](_0x6f2407,'no\x20variable\x20found');}var _0x58c83b=this;_0x37043b[_0x9508('0xd7')](function(_0x5e0fe1,_0x25c003){Object[_0x9508('0xd8')](_0x5e0fe1)[_0x9508('0xd7')](function(_0x2264e7){_0x58c83b[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0xd9'),_0x178218,_0x25c003,_0x2264e7),_0x5e0fe1[_0x2264e7]);});});this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0xda'),_0x178218),_0x37043b[_0x9508('0x9c')]);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xdb'),_0x178218));};AGIVertices[_0x9508('0xf')][_0x9508('0xdc')]=function(_0x18f2cc){logger['debug'](util[_0x9508('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x18f2cc['label']));if(!this[_0x9508('0x87')](_0x18f2cc[_0x9508('0xdd')])){return this['channel'][_0x9508('0x33')](_0x18f2cc,_0x9508('0xde'));}var _0x336272=this[_0x9508('0x1b')][_0x9508('0x6f')](this,_0x18f2cc['sip_id']);if(!_0x336272){return this[_0x9508('0xd')]['error'](_0x18f2cc,_0x9508('0xdf'));}var _0x5e3e51=this[_0x9508('0xd')][_0x9508('0x54')]('DIAL',[util[_0x9508('0x28')](_0x9508('0xe0'),_0x336272),_0x18f2cc['timeout'],_0x18f2cc[_0x9508('0xe1')],_0x18f2cc['url']]);if(_0x5e3e51['result']===-0x1){return _0x5e3e51;}return this['channel'][_0x9508('0xac')](util[_0x9508('0x28')]('Executed\x20command\x20%s',_0x9508('0xe2')));};AGIVertices['prototype'][_0x9508('0xe3')]=function(_0x27562c){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0xe4'),_0x27562c[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x27562c['key'])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20key\x20configured');}if(!this[_0x9508('0x87')](_0x27562c['text'])){return this[_0x9508('0xd')]['noop']('no\x20text\x20configured');}this[_0x9508('0xd')]['bot']=!![];this[_0x9508('0x36')](_0x27562c);this[_0x9508('0x40')](_0x27562c[_0x9508('0x59')],'in','','');this['channel']['noop'](util[_0x9508('0x28')]('Trying\x20Dialogflow:\x20%s',_0x27562c[_0x9508('0x59')]));var _0x1a9606=this[_0x9508('0x79')][_0x9508('0x6f')](this,_0x27562c);if(_0x1a9606){for(var _0x4c6d79 in _0x1a9606){if(_0x1a9606[_0x9508('0x97')](_0x4c6d79)){this['channel']['setVariable'](util['format'](_0x9508('0xe5'),_0x4c6d79[_0x9508('0xe6')]()),_0x1a9606[_0x4c6d79]);}}this['createSquareMessage'](_0x1a9606[_0x9508('0xe7')],'out',_0x9508('0xe3'),'');return this['channel']['noop'](util[_0x9508('0x28')](_0x9508('0xe8'),_0x1a9606[_0x9508('0xe7')]));}return this[_0x9508('0xd')][_0x9508('0x33')](_0x27562c,_0x9508('0xe9'));};AGIVertices[_0x9508('0xf')][_0x9508('0xea')]=function(_0x58d201){logger['info'](util[_0x9508('0x28')](_0x9508('0xeb'),_0x58d201[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x7d')])){return this[_0x9508('0xd')]['noop'](_0x9508('0xec'));}if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x7e')])){return this['channel'][_0x9508('0xac')](_0x9508('0xed'));}if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x7f')])){return this[_0x9508('0xd')]['noop'](_0x9508('0xee'));}if(!this['isConfigured'](_0x58d201[_0x9508('0x80')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xef'));}if(!this[_0x9508('0x87')](_0x58d201[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xf0')]=!![];this[_0x9508('0x36')](_0x58d201);this[_0x9508('0x40')](_0x58d201[_0x9508('0x59')],'in','','');this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Trying\x20DialogflowV2:\x20%s',_0x58d201['text']));var _0x4fd315=this[_0x9508('0x7c')][_0x9508('0x6f')](this,_0x58d201);if(_0x4fd315){for(var _0xa0cf80 in _0x4fd315){if(_0x4fd315[_0x9508('0x97')](_0xa0cf80)){if(_0xa0cf80!=='providerResponse'){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('DIALOGFLOW_%s',_0xa0cf80[_0x9508('0xe6')]()),_0x4fd315[_0xa0cf80]);}}}this['createSquareMessage'](_0x4fd315[_0x9508('0xe7')],_0x9508('0xf1'),'dialogflowV2',_0x4fd315[_0x9508('0xf2')]);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xf3'),_0x4fd315['speech']));}return this[_0x9508('0xd')]['error'](_0x58d201,_0x9508('0xf4'));};AGIVertices['prototype'][_0x9508('0xf5')]=function(_0x18b597){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x18b597[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x18b597[_0x9508('0xf6')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xf7'));}if(!this['isConfigured'](_0x18b597[_0x9508('0xf8')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xf9'));}if(!this[_0x9508('0x87')](_0x18b597[_0x9508('0xfa')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xfb'));}if(!this[_0x9508('0x87')](_0x18b597[_0x9508('0xfc')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xf0')]=!![];this[_0x9508('0x36')](_0x18b597);this['createSquareMessage'](_0x18b597['text'],'in','','');this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xfd'),_0x18b597[_0x9508('0x59')]));var _0x13b61e=this[_0x9508('0x81')][_0x9508('0x6f')](this,_0x18b597);if(_0x13b61e){for(var _0x43cc15 in _0x13b61e){if(_0x13b61e[_0x9508('0x97')](_0x43cc15)){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('SESTEK_NDA_%s',_0x43cc15[_0x9508('0xe6')]()),_0x13b61e[_0x43cc15]);}}this[_0x9508('0x40')](_0x13b61e[_0x9508('0xe7')],_0x9508('0xf1'),_0x9508('0xf5'),'');if(_0x13b61e[_0x9508('0xfe')]){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x13b61e[_0x9508('0xfe')]));var _0x1e4ad2=this[_0x9508('0xd')][_0x9508('0xff')](_0x13b61e[_0x9508('0xfe')]);try{fs[_0x9508('0x100')](_0x13b61e[_0x9508('0xfe')]+'.wav');}catch(_0x2ba82a){logger[_0x9508('0x33')](_0x2ba82a);}return _0x1e4ad2;}else{return this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x101'),_0x13b61e['speech']));}}return this['channel'][_0x9508('0x33')](_0x18b597,_0x9508('0x102'));};AGIVertices[_0x9508('0xf')][_0x9508('0x103')]=function(_0x16498b){logger[_0x9508('0x30')](util['format'](_0x9508('0x104'),_0x16498b[_0x9508('0xa9')]));return this['channel']['noop'](_0x9508('0x103'));};AGIVertices[_0x9508('0xf')][_0x9508('0x105')]=function(_0x327ecd){logger['info'](util[_0x9508('0x28')](_0x9508('0x106'),_0x327ecd[_0x9508('0xa9')]));var _0x59a048='';if(_0x327ecd[_0x9508('0x107')]){if(!this[_0x9508('0x87')](_0x327ecd[_0x9508('0x107')])){return this[_0x9508('0xd')]['error'](_0x327ecd,'no\x20trunk\x20selected');}else{var _0x1af797=parseInt(_0x327ecd[_0x9508('0x107')],0xa);if(isNaN(_0x1af797)){_0x59a048=_0x327ecd[_0x9508('0x107')];}else{_0x59a048=this[_0x9508('0x1c')]['sync'](this,_0x327ecd[_0x9508('0x107')]);if(!_0x59a048){return this[_0x9508('0xd')][_0x9508('0x33')](_0x327ecd,_0x9508('0x108'));}}}}else if(_0x327ecd[_0x9508('0x109')]){_0x59a048=_0x327ecd[_0x9508('0x109')];}else{return this[_0x9508('0xd')]['error'](_0x327ecd,_0x9508('0x10a'));}var _0x315832=this[_0x9508('0xd')]['exec']('DIAL',[util[_0x9508('0x28')](_0x9508('0x10b'),_0x59a048,_0x327ecd['phone']),_0x327ecd[_0x9508('0x65')],_0x327ecd['opts'],_0x327ecd[_0x9508('0x63')]]);if(_0x315832[_0x9508('0xab')]===-0x1){return _0x315832;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x10c'),_0x9508('0xe2')));};AGIVertices[_0x9508('0xf')]['finally']=function(_0xfaa587){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x10d'),_0xfaa587[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x10e'));};AGIVertices[_0x9508('0xf')]['getdigits']=function(_0x4f0416){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4f0416['label']));if(_0x4f0416[_0x9508('0xa6')]===0x0){return this[_0x9508('0xa7')](_0x4f0416);}_0x4f0416['retry']-=0x1;if(!this['isConfigured'](_0x4f0416[_0x9508('0x10f')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4f0416,_0x9508('0x110'));}var _0x22861c=this['getSound'][_0x9508('0x6f')](this,_0x4f0416[_0x9508('0x10f')]);if(!_0x22861c){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4f0416,_0x9508('0x111'));}if(!this[_0x9508('0x87')](_0x4f0416['variable_id'])){return this[_0x9508('0xd')][_0x9508('0x33')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x12d9b1=this['channel'][_0x9508('0x112')](_0x22861c,_0x4f0416['response'],_0x4f0416[_0x9508('0x113')]);var _0x517c68=_0x12d9b1['result']?_0x12d9b1['result'][_0x9508('0x4a')]():'';logger[_0x9508('0x30')]('test',JSON[_0x9508('0x74')](_0x12d9b1));if(_0x12d9b1['result']===-0x1){this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f0416,_0x517c68);return _0x12d9b1;}else if(_0x12d9b1[_0x9508('0xa3')]==='timeout'){_0x12d9b1[_0x9508('0xab')]=_0x517c68['length']>=parseInt(_0x4f0416['mindigit'])?'x':'i';}else{_0x12d9b1[_0x9508('0xab')]=_0x517c68[_0x9508('0x9c')]>=parseInt(_0x4f0416[_0x9508('0x114')])&&_0x517c68[_0x9508('0x9c')]<=parseInt(_0x4f0416[_0x9508('0x113')])?'x':'i';}var _0x5871b9=this['getVariable'][_0x9508('0x6f')](this,_0x4f0416[_0x9508('0xd6')]);if(!_0x5871b9){return this['channel'][_0x9508('0x33')](_0x4f0416,_0x9508('0x115'));}this[_0x9508('0xd')]['setVariable'](_0x5871b9,_0x517c68);if(this[_0x9508('0x87')](_0x4f0416[_0x9508('0x116')])){var _0x4e9dc4=parseInt(_0x4f0416[_0x9508('0x116')],0xa);var _0x4059cb=rs[_0x9508('0x117')]({'charset':'*','length':_0x4e9dc4});var _0x30a70f=_0x517c68[_0x9508('0x9c')];if(_0x30a70f>0x0){if(_0x30a70f>_0x4e9dc4){this['createSquareDetailsReport']['sync'](this,_0x4f0416,_0x4f0416[_0x9508('0x118')]===_0x9508('0x119')?_0x4059cb+_0x517c68[_0x9508('0x11a')](_0x4e9dc4):_0x517c68[_0x9508('0x11a')](0x0,_0x30a70f-_0x4e9dc4)+_0x4059cb);}else{this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f0416,rs['generate']({'charset':'*','length':_0x30a70f}));}}else{this[_0x9508('0x36')]['sync'](this,_0x4f0416,'');}}else{this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f0416,_0x517c68);}return _0x12d9b1;};AGIVertices[_0x9508('0xf')][_0x9508('0x11b')]=function(_0x58cf1c){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x58cf1c['label']));return this[_0x9508('0xc')](_0x58cf1c);};AGIVertices[_0x9508('0xf')][_0x9508('0x11c')]=function(_0x48d589){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x11d'),_0x48d589[_0x9508('0xa9')]));this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x48d589,_0x48d589['goalname']);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('GOAL\x20%s',_0x48d589['goalname']));};AGIVertices[_0x9508('0xf')][_0x9508('0x11e')]=function(_0x211f7e){logger[_0x9508('0x30')](util[_0x9508('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x211f7e['label']));if(!this[_0x9508('0x87')](_0x211f7e[_0x9508('0x8a')])||!this[_0x9508('0x87')](_0x211f7e['aws_secret_access_key'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x11f'));}if(!this['isConfigured'](_0x211f7e[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this['channel'][_0x9508('0xac')](util['format'](_0x9508('0x120'),_0x211f7e[_0x9508('0x59')]));var _0xf7cad5=this[_0x9508('0x89')][_0x9508('0x6f')](this,_0x211f7e);if(_0xf7cad5){this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x121'),_0xf7cad5));var _0x1d3059=this[_0x9508('0xd')][_0x9508('0xff')](_0xf7cad5);try{fs['unlink'](_0xf7cad5+'.wav');}catch(_0x5db5e6){logger[_0x9508('0x33')](_0x5db5e6);}return _0x1d3059;}return this[_0x9508('0xd')][_0x9508('0x33')](_0x211f7e,_0x9508('0x122'));};AGIVertices['prototype'][_0x9508('0x123')]=function(_0x2a5e13){logger['info'](util[_0x9508('0x28')](_0x9508('0x124'),_0x2a5e13['label']));if(!this[_0x9508('0x87')](_0x2a5e13['aws_access_key_id'])||!this[_0x9508('0x87')](_0x2a5e13[_0x9508('0x8b')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x11f'));}if(!this['isConfigured'](_0x2a5e13[_0x9508('0x90')])){return this[_0x9508('0xd')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x9508('0x87')](_0x2a5e13[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20text\x20configured');}this[_0x9508('0xd')][_0x9508('0xf0')]=!![];this[_0x9508('0x36')](_0x2a5e13);this[_0x9508('0x40')](_0x2a5e13[_0x9508('0x59')],'in','','');this['channel']['noop'](util[_0x9508('0x28')](_0x9508('0x125'),_0x2a5e13['text']));var _0x46620f=this[_0x9508('0x8e')][_0x9508('0x6f')](this,_0x2a5e13);if(_0x46620f){for(var _0x4f5418 in _0x46620f){if(_0x46620f[_0x9508('0x97')](_0x4f5418)&&_[_0x9508('0x9d')](_0x46620f[_0x4f5418])){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('AWS_LEX_%s',_0x4f5418['toUpperCase']()),_0x46620f[_0x4f5418]);}}if(_['isNil'](_0x46620f[_0x9508('0x77')])){return this['channel'][_0x9508('0xac')](_0x9508('0x126'));}else{this[_0x9508('0x40')](_0x46620f[_0x9508('0x77')],_0x9508('0xf1'),_0x9508('0x127'),'');return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x128'),_0x46620f[_0x9508('0x77')]));}}return this[_0x9508('0xd')][_0x9508('0x33')](_0x2a5e13,_0x9508('0x129'));};AGIVertices['prototype'][_0x9508('0x12a')]=function(_0x3f3715){logger[_0x9508('0x30')](util['format'](_0x9508('0x12b'),_0x3f3715['label'],_0x3f3715[_0x9508('0x65')]));if(!this[_0x9508('0x87')](_0x3f3715[_0x9508('0x7a')])){return this['channel'][_0x9508('0xac')]('no\x20key\x20configured');}var _0x91599b=_0x9508('0x12c');var _0x3e9ecf=util[_0x9508('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x9508('0x117')](0x4));var _0x180387=util[_0x9508('0x28')]('%s.%s',_0x3e9ecf,_0x91599b);var _0x514933=!![];if(_0x3f3715[_0x9508('0x12d')]==='NOBEEP'){_0x514933=![];}var _0x3e1b3b=this[_0x9508('0xd')][_0x9508('0x12e')](_0x3e9ecf,_0x91599b,_0x3f3715[_0x9508('0x12f')],_0x3f3715[_0x9508('0x65')],undefined,_0x514933);if(_0x3e1b3b[_0x9508('0xab')]!==-0x1){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x130'),_0x180387));var _0x66a2ec=this[_0x9508('0x91')][_0x9508('0x6f')](this,_0x3f3715,_0x180387);if(_0x66a2ec){for(var _0x6c43be in _0x66a2ec){if(_0x66a2ec[_0x9508('0x97')](_0x6c43be)){this['channel'][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x131'),_0x6c43be[_0x9508('0xe6')]()),_0x66a2ec[_0x6c43be]);}}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x9508('0x74')](_0x66a2ec)));}}return _0x3e1b3b;};AGIVertices[_0x9508('0xf')][_0x9508('0x132')]=function(_0x124303){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x124303[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x124303['appid'])){return this[_0x9508('0xd')][_0x9508('0xac')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x124303[_0x9508('0x94')])){return this[_0x9508('0xd')]['noop'](_0x9508('0x133'));}var _0x220e1f='wav';var _0x946f0f=util[_0x9508('0x28')](_0x9508('0x134'),FILES_PATH,rs['generate'](0x4));var _0x4c620c=util[_0x9508('0x28')](_0x9508('0x9f'),_0x946f0f,_0x220e1f);var _0x60c722=!![];if(_0x124303[_0x9508('0x12d')]===_0x9508('0x135')){_0x60c722=![];}var _0x4a1f78=this[_0x9508('0xd')][_0x9508('0x12e')](_0x946f0f,_0x220e1f,_0x124303[_0x9508('0x12f')],_0x124303[_0x9508('0x65')],undefined,_0x60c722);if(_0x4a1f78[_0x9508('0xab')]!==-0x1){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x136'),_0x4c620c));var _0xa8ae21=this['tildeASR']['sync'](this,_0x124303,_0x4c620c);if(_0xa8ae21){for(var _0x541372 in _0xa8ae21){if(_0xa8ae21['hasOwnProperty'](_0x541372)){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x137'),_0x541372[_0x9508('0xe6')]()),_0xa8ae21[_0x541372]);}}return this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x138'),JSON['stringify'](_0xa8ae21)));}}return _0x4a1f78;};AGIVertices['prototype'][_0x9508('0x139')]=function(_0x36afbb){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x13a'),_0x36afbb['label']));return this[_0x9508('0xd')]['continueAt'](_0x36afbb['context'],_0x36afbb[_0x9508('0x3d')],_0x36afbb[_0x9508('0x3e')]);};AGIVertices['prototype'][_0x9508('0x13b')]=function(_0x18404e){logger[_0x9508('0x30')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x18404e[_0x9508('0xa9')]));if(!this['isConfigured'](_0x18404e[_0x9508('0x13c')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x18404e,_0x9508('0x13d'));}try{var _0x32acf7=eval(_0x18404e[_0x9508('0x13c')])?_0x9508('0x13e'):_0x9508('0x13f');this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x140'),_0x18404e['condition'],_0x32acf7));return{'code':0xc8,'result':_0x32acf7};}catch(_0x4bc03d){return{'code':0xc8,'result':_0x9508('0x13f')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x141')]=function(_0x4b9806){logger['info'](util[_0x9508('0x28')](_0x9508('0x142'),_0x4b9806[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x4b9806[_0x9508('0x143')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4b9806,_0x9508('0x144'));}var _0x5e14d2=this[_0x9508('0x145')][_0x9508('0x6f')](this,_0x4b9806['interval_id']);if(!_0x5e14d2){return this[_0x9508('0xd')][_0x9508('0x33')](_0x4b9806,'no\x20intervals\x20found');}for(var _0x786bdf=0x0;_0x786bdf<_0x5e14d2[_0x9508('0x9c')];_0x786bdf+=0x1){var _0x7db152=this[_0x9508('0xd')][_0x9508('0x10')](util[_0x9508('0x28')](_0x9508('0x146'),_0x5e14d2[_0x786bdf]));if(_0x7db152[_0x9508('0xab')]===-0x1){return _0x7db152;}logger[_0x9508('0x30')](util[_0x9508('0x28')]('IFTIME\x20%s\x20%s',_0x5e14d2[_0x786bdf],_0x7db152[_0x9508('0xa3')]));if(_0x7db152[_0x9508('0xa3')]===_0x9508('0x13e')){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x147'),_0x5e14d2[_0x786bdf],'true'));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x147'),_0x5e14d2[_0x786bdf],_0x9508('0x13e')));return{'code':0xc8,'result':_0x9508('0x13e')};}else{logger['info'](util['format'](_0x9508('0x147'),_0x5e14d2[_0x786bdf],_0x9508('0x13f')));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x147'),_0x5e14d2[_0x786bdf],_0x9508('0x13f')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x9508('0x148')]=function(_0x455508){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x149'),_0x455508['label']));return this[_0x9508('0xd')]['hangup']();};AGIVertices['prototype'][_0x9508('0x14a')]=function(_0x1ca3e5){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x14b'),_0x1ca3e5[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x1ca3e5[_0x9508('0x7a')])){return this['channel'][_0x9508('0xac')]('no\x20key\x20configured');}var _0x15b8d0='wav';var _0x42e701=util[_0x9508('0x28')](_0x9508('0x134'),FILES_PATH,rs[_0x9508('0x117')](0x4));var _0x8cdc4a=util[_0x9508('0x28')]('%s.%s',_0x42e701,_0x15b8d0);var _0x21a922=!![];if(_0x1ca3e5[_0x9508('0x12d')]===_0x9508('0x135')){_0x21a922=![];}var _0x38d7ec=this[_0x9508('0xd')][_0x9508('0x12e')](_0x42e701,_0x15b8d0,_0x1ca3e5['intKey'],_0x1ca3e5[_0x9508('0x65')],undefined,_0x21a922);if(_0x38d7ec[_0x9508('0xab')]!==-0x1){this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x14c'),_0x8cdc4a));var _0x3770ca=this[_0x9508('0x85')][_0x9508('0x6f')](this,_0x1ca3e5,_0x8cdc4a);if(_0x3770ca){for(var _0x6584b9 in _0x3770ca){if(_0x3770ca[_0x9508('0x97')](_0x6584b9)){this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x14d'),_0x6584b9[_0x9508('0xe6')]()),_0x3770ca[_0x6584b9]);}}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0x9508('0x74')](_0x3770ca)));}}return _0x38d7ec;};AGIVertices[_0x9508('0xf')][_0x9508('0x14e')]=function(_0x16bd55){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x14f'),_0x16bd55['label']));if(!this[_0x9508('0x87')](_0x16bd55[_0x9508('0x7a')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x150'));}if(!this[_0x9508('0x87')](_0x16bd55['text'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x16bd55[_0x9508('0x59')]));var _0x189dac=this['ispeechTTS'][_0x9508('0x6f')](this,_0x16bd55);if(_0x189dac){this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x14c'),_0x189dac));var _0x4ab60e=this['channel'][_0x9508('0xff')](_0x189dac,_0x16bd55[_0x9508('0x12f')]);try{fs[_0x9508('0x100')](_0x189dac+_0x9508('0x151'));}catch(_0x4698ea){logger[_0x9508('0x33')](_0x4698ea);}return _0x4ab60e;}return this[_0x9508('0xd')][_0x9508('0x33')](_0x16bd55,_0x9508('0x152'));};AGIVertices[_0x9508('0xf')][_0x9508('0x153')]=function(_0x3b9af2){logger[_0x9508('0x30')](util['format'](_0x9508('0x154'),_0x3b9af2[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x3b9af2[_0x9508('0x155')])){return this[_0x9508('0xd')]['error'](_0x3b9af2,_0x9508('0x156'));}logger[_0x9508('0x30')](util[_0x9508('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9508('0xd')]['callerid'],_0x3b9af2[_0x9508('0x155')]));var _0x546c68=this[_0x9508('0x52')]['sync'](this,_0x3b9af2['findBy']);if(_0x546c68){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')]['callerid'],_0x3b9af2['findBy']));this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')]['callerid'],_0x3b9af2['findBy']));return{'code':0xc8,'result':_0x9508('0x158')};}else{logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x159'),this['channel']['callerid'],_0x3b9af2[_0x9508('0x155')]));this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0x159'),this['channel'][_0x9508('0x3a')],_0x3b9af2['findBy']));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x15b')]=function(_0x1fa941){logger['info'](util[_0x9508('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1fa941[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x1fa941[_0x9508('0x155')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x1fa941,'no\x20find\x20by\x20configured');}logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x15c'),this[_0x9508('0xd')]['callerid'],_0x1fa941[_0x9508('0x155')]));var _0x5e6175=this[_0x9508('0x50')][_0x9508('0x6f')](this,_0x1fa941['findBy']);if(_0x5e6175){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x157'),this['channel']['callerid'],_0x1fa941['findBy']));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')]['callerid'],_0x1fa941[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x158')};}else{logger[_0x9508('0x30')](util['format'](_0x9508('0x159'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x1fa941[_0x9508('0x155')]));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x159'),this['channel'][_0x9508('0x3a')],_0x1fa941['findBy']));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices['prototype'][_0x9508('0x15d')]=function(_0x54250d){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x15e'),_0x54250d['label']));if(!this[_0x9508('0x87')](_0x54250d['operation'])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x54250d,_0x9508('0x15f'));}this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x160'),_0x54250d[_0x9508('0x161')]));var _0x3e7a4a=eval(_0x54250d['operation']);if(!this[_0x9508('0x87')](_0x54250d['variable_id'])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xd5'));}var _0x2db146=this['getVariable'][_0x9508('0x6f')](this,_0x54250d['variable_id']);if(!_0x2db146){return this[_0x9508('0xd')]['error'](_0x54250d,_0x9508('0x115'));}if(_[_0x9508('0x9b')](_0x3e7a4a)){var _0x36ae5a=this;_0x3e7a4a['forEach'](function(_0x3dc2bf,_0x1a24f8){_0x36ae5a['channel'][_0x9508('0xa0')](util[_0x9508('0x28')]('%s[%s]',_0x2db146,_0x1a24f8),_0x3dc2bf);});return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x162'),_0x2db146));}else{return this['channel']['setVariable'](_0x2db146,_0x3e7a4a);}};AGIVertices['prototype'][_0x9508('0xb')]=function(_0x3639a8){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x163'),_0x3639a8[_0x9508('0xa9')]));if(_0x3639a8[_0x9508('0xa6')]===0x0){return this['maxRetry'](_0x3639a8);}_0x3639a8[_0x9508('0xa6')]-=0x1;if(!this['isConfigured'](_0x3639a8['file_id'])){return this[_0x9508('0xd')]['error'](_0x3639a8,_0x9508('0x110'));}var _0x5925ed=this[_0x9508('0x164')]['sync'](this,_0x3639a8['file_id']);if(!_0x5925ed){return this[_0x9508('0xd')][_0x9508('0x33')](_0x3639a8,_0x9508('0x111'));}var _0x449173=this[_0x9508('0xd')][_0x9508('0x112')](_0x5925ed,_0x3639a8[_0x9508('0x165')],_0x3639a8[_0x9508('0x166')]);var _0x36b5db=_0x449173[_0x9508('0xab')];if(_0x449173[_0x9508('0xab')]===-0x1){this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x3639a8,'-1');return _0x449173;}else if(_0x449173[_0x9508('0xa3')]==='timeout'){_0x449173['result']=_0x449173[_0x9508('0xab')][_0x9508('0x9c')]>0x0?_0x449173[_0x9508('0xab')]:'t';}else if(_[_0x9508('0x42')](_0x449173[_0x9508('0xab')])){_0x449173[_0x9508('0xab')]='#';_0x36b5db='#';}if(!this[_0x9508('0x87')](_0x3639a8[_0x9508('0xd6')])){this['channel'][_0x9508('0xac')](_0x9508('0xd5'));}else{var _0xacb7bd=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x3639a8[_0x9508('0xd6')]);if(!_0xacb7bd){return this[_0x9508('0xd')][_0x9508('0x33')](_0x3639a8,_0x9508('0x115'));}this['channel'][_0x9508('0xa0')](_0xacb7bd,_0x36b5db);}this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x3639a8,_0x36b5db);return _0x449173;};AGIVertices['prototype'][_0x9508('0xac')]=function(_0x4487f6){logger[_0x9508('0x30')](util['format'](_0x9508('0x167'),_0x4487f6['label']));return this[_0x9508('0xd')][_0x9508('0xac')](_0x4487f6['output']||_0x4487f6[_0x9508('0xa9')]);};AGIVertices[_0x9508('0xf')]['pause']=function(_0x5580ea){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x168'),_0x5580ea[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x5580ea[_0x9508('0x155')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x5580ea,_0x9508('0x156'));}logger['info'](util['format'](_0x9508('0x15c'),this[_0x9508('0xd')]['callerid'],_0x5580ea['findBy']));var _0xebf2ed=this[_0x9508('0x4c')][_0x9508('0x6f')](this,_0x5580ea['pause_id']);var _0x3235c1=this[_0x9508('0x4f')]['sync'](this,_0x5580ea[_0x9508('0x155')],_0xebf2ed);if(_0x3235c1){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x5580ea[_0x9508('0x155')]));this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x5580ea[_0x9508('0x155')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x9508('0x159'),this[_0x9508('0xd')]['callerid'],_0x5580ea['findBy']));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x5580ea[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x169')]=function(_0x155f5e){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x16a'),_0x155f5e[_0x9508('0xa9')]));if(!this['isConfigured'](_0x155f5e[_0x9508('0x10f')])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x155f5e,_0x9508('0x110'));}var _0x4a8ef8=this[_0x9508('0x164')][_0x9508('0x6f')](this,_0x155f5e[_0x9508('0x10f')]);if(!_0x4a8ef8){return this[_0x9508('0xd')][_0x9508('0x33')](_0x155f5e,'no\x20file\x20audio\x20found');}var _0x1c7b32=this[_0x9508('0xd')][_0x9508('0x54')]('PLAYBACK',[_0x4a8ef8,_0x155f5e[_0x9508('0xe1')]]);if(_0x1c7b32[_0x9508('0xab')]===-0x1){return _0x1c7b32;}return this['channel'][_0x9508('0xac')](util['format']('Executed\x20command\x20%s\x20%s',_0x9508('0x16b'),_0x4a8ef8));};AGIVertices[_0x9508('0xf')][_0x9508('0x16c')]=function(_0x33c3ff){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x33c3ff[_0x9508('0xa9')]));if(!this['isConfigured'](_0x33c3ff['queue_id'])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x33c3ff,'no\x20queue\x20selected');}var _0x1a8c8e='';var _0x4b582f=parseInt(_0x33c3ff[_0x9508('0x16d')],0xa);if(isNaN(_0x4b582f)){_0x1a8c8e=_0x33c3ff[_0x9508('0x16d')];}else{_0x1a8c8e=this[_0x9508('0x15')][_0x9508('0x6f')](this,_0x33c3ff[_0x9508('0x16d')]);if(!_0x1a8c8e){return this['channel']['error'](_0x33c3ff,_0x9508('0x16e'));}}var _0x2351e0='';if(this[_0x9508('0x87')](_0x33c3ff[_0x9508('0x10f')])){var _0x402567=this[_0x9508('0x164')]['sync'](this,_0x33c3ff[_0x9508('0x10f')]);if(_0x402567){_0x2351e0=_0x402567;}}this[_0x9508('0x36')]['sync'](this,_0x33c3ff,_0x1a8c8e);if(_0x33c3ff[_0x9508('0xe1')][_0x9508('0x16f')]('x')<0x0){_0x33c3ff[_0x9508('0xe1')]+='x';}if(_0x33c3ff[_0x9508('0xe1')]['indexOf']('X')<0x0){_0x33c3ff[_0x9508('0xe1')]+='X';}this[_0x9508('0xd')]['setVariable'](_0x9508('0x170'),_0x1a8c8e?_0x1a8c8e[_0x9508('0x171')]():'');var _0x40b50c=this[_0x9508('0xd')][_0x9508('0x54')](_0x9508('0x172'),[_0x1a8c8e,_0x33c3ff[_0x9508('0xe1')],_0x33c3ff[_0x9508('0x63')],_0x2351e0,_0x33c3ff[_0x9508('0x65')],_0x33c3ff[_0x9508('0x7')],_0x33c3ff[_0x9508('0x173')],_0x33c3ff[_0x9508('0x174')],'',_0x33c3ff[_0x9508('0x175')]]);if(_0x40b50c['result']===-0x1){return _0x40b50c;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xc4'),_0x9508('0x172'),_0x1a8c8e));};AGIVertices[_0x9508('0xf')][_0x9508('0x176')]=function(_0x59afdf){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x177'),_0x59afdf['label']));var _0x38c7ff=_0x59afdf['recordingFormat']||_0x9508('0x12c');var _0x230200=util[_0x9508('0x28')](_0x9508('0x178'),this[_0x9508('0xd')][_0x9508('0x37')],rs[_0x9508('0x117')](0x5));var _0x2ea77c=util[_0x9508('0x28')](_0x9508('0x179'),FILES_PATH,_0x230200,_0x38c7ff);var _0x7ef314=util['format'](_0x9508('0x134'),FILES_PATH,_0x230200);this['createSquareRecording']['sync'](this,_0x59afdf,_0x230200,_0x2ea77c);this['channel'][_0x9508('0xa0')](_0x9508('0x17a'),_0x230200);logger['info'](_0x9508('0x17b'),_0x7ef314,_0x38c7ff,_0x59afdf[_0x9508('0x17c')],_0x59afdf[_0x9508('0x65')]);return this['channel'][_0x9508('0x12e')](_0x7ef314,_0x38c7ff,_0x59afdf[_0x9508('0x17c')],_0x59afdf[_0x9508('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x9508('0x17d')]=function(_0x354fb3){logger[_0x9508('0x30')](util[_0x9508('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x354fb3[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x354fb3[_0x9508('0x63')])){return this['channel'][_0x9508('0xac')](_0x9508('0x17e'));}var _0x39deef=this[_0x9508('0x62')][_0x9508('0x6f')](this,_0x354fb3);logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x17f'),util['inspect'](_0x39deef,{'showHidden':![],'depth':null})));if(!this[_0x9508('0x87')](_0x354fb3[_0x9508('0xd6')])){return this[_0x9508('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x500406=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x354fb3[_0x9508('0xd6')]);if(!_0x500406){return this[_0x9508('0xd')][_0x9508('0x33')](_0x354fb3,_0x9508('0x115'));}this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')](_0x9508('0x180'),_0x500406),_0x39deef[_0x9508('0x75')]?_0x39deef[_0x9508('0x75')]:_0x9508('0x181'));this[_0x9508('0xd')][_0x9508('0xa0')](util[_0x9508('0x28')]('%s_STATUS_MESSAGE',_0x500406),_0x39deef[_0x9508('0x76')]?_0x39deef['statusMessage']:'OK');if(_0x39deef[_0x9508('0x6a')]){try{this['saveRestApiResult'](_0x39deef[_0x9508('0x6a')],_0x500406);}catch(_0x1da6be){logger[_0x9508('0x33')](util['format'](_0x9508('0x182'),_0x500406));}}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0xdb'),_0x500406));};AGIVertices[_0x9508('0xf')][_0x9508('0x183')]=function(_0x2c2f09){logger[_0x9508('0x30')](util['format'](_0x9508('0x184'),_0x2c2f09[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0x185')](_0x2c2f09[_0x9508('0x186')][_0x9508('0x55')](/\s+/g,''),_0x2c2f09[_0x9508('0x17c')]);};AGIVertices[_0x9508('0xf')][_0x9508('0x187')]=function(_0x3efeeb){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x188'),_0x3efeeb[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0x189')](_0x3efeeb['number'][_0x9508('0x55')](/\s+/g,''),_0x3efeeb[_0x9508('0x17c')]);};AGIVertices[_0x9508('0xf')][_0x9508('0x18a')]=function(_0x3d6c3e){logger[_0x9508('0x30')](util['format'](_0x9508('0x18b'),_0x3d6c3e[_0x9508('0xa9')]));return this[_0x9508('0xd')][_0x9508('0x18c')](_0x3d6c3e[_0x9508('0x59')],_0x3d6c3e['escape_digits']);};AGIVertices[_0x9508('0xf')][_0x9508('0x18d')]=function(_0x2e0a23){logger['info'](util[_0x9508('0x28')](_0x9508('0x18e'),_0x2e0a23['label']));if(!this[_0x9508('0x87')](_0x2e0a23[_0x9508('0x18f')])){return this['channel'][_0x9508('0xac')]('no\x20mail\x20account\x20configured');}var _0x35d344=this[_0x9508('0x20')][_0x9508('0x6f')](this,_0x2e0a23['account_id']);if(!_0x35d344||!_0x35d344[_0x9508('0x190')]){return this['channel'][_0x9508('0x33')](_0x2e0a23,_0x9508('0x191'));}var _0x325e75={'from':util[_0x9508('0x28')](_0x9508('0x192'),_0x35d344['name'],_0x35d344[_0x9508('0x193')]||_0x35d344[_0x9508('0x190')][_0x9508('0x194')]),'to':_0x2e0a23['to']||'','cc':_0x2e0a23['cc']||'','bcc':_0x2e0a23['bcc']||'','subject':_0x2e0a23[_0x9508('0x195')],'html':_0x2e0a23[_0x9508('0x59')],'text':_0x2e0a23[_0x9508('0x59')]};if(this[_0x9508('0x87')](_0x2e0a23['template_id'])){}logger['debug'](_0x9508('0x196'),JSON[_0x9508('0x74')](_0x325e75));this['createSquareDetailsReport']['sync'](this,_0x2e0a23,_0x2e0a23[_0x9508('0x18f')]);this['channel'][_0x9508('0xac')](util[_0x9508('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x35d344['name']));this[_0x9508('0x22')]['sync'](this,_0x35d344[_0x9508('0x197')],_0x325e75);return this['channel'][_0x9508('0xac')](_0x9508('0x198'));};AGIVertices[_0x9508('0xf')][_0x9508('0x199')]=function(_0x511b55){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x19a'),_0x511b55['label']));return this[_0x9508('0xd')]['noop'](_0x9508('0x19b'));};AGIVertices[_0x9508('0xf')][_0x9508('0x19c')]=function(_0x49e69f){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x19d'),_0x49e69f[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x49e69f[_0x9508('0x19e')])){return this['channel'][_0x9508('0xac')](_0x9508('0x19f'));}var _0x2d6b6d=this[_0x9508('0x34')][_0x9508('0x6f')](this,_0x49e69f[_0x9508('0x19e')]);if(!_0x2d6b6d){return this[_0x9508('0xd')][_0x9508('0x33')](_0x49e69f,_0x9508('0x1a0'));}var _0x4aa0a7={'body':_0x49e69f[_0x9508('0x1a1')],'phone':_0x49e69f['to']||'','SmsAccountId':_0x2d6b6d['id']};logger['debug'](_0x9508('0x1a2'),JSON['stringify'](_0x4aa0a7));this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x49e69f,_0x49e69f[_0x9508('0x19e')]);this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1a3'),_0x2d6b6d[_0x9508('0x13')]));this[_0x9508('0x35')][_0x9508('0x6f')](this,_0x4aa0a7);return this[_0x9508('0xd')][_0x9508('0xac')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x9508('0x1a4')]=function(_0x5a45fd){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1a5'),_0x5a45fd[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x5a45fd[_0x9508('0xd6')])){return this['channel'][_0x9508('0x33')](_0x5a45fd,'no\x20variable\x20selected');}var _0x45d9fc=this[_0x9508('0x10')][_0x9508('0x6f')](this,_0x5a45fd[_0x9508('0xd6')]);if(!_0x45d9fc){return this[_0x9508('0xd')][_0x9508('0x33')](_0x5a45fd,'no\x20variable\x20found');}return this[_0x9508('0xd')][_0x9508('0xa0')](_0x45d9fc,_0x5a45fd[_0x9508('0x1a6')]);};AGIVertices[_0x9508('0xf')][_0x9508('0x1a7')]=function(_0x557984){logger[_0x9508('0x30')](util['format'](_0x9508('0x1a8'),_0x557984[_0x9508('0xa9')]));this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x1a9'));var _0x5ec6ff=this[_0x9508('0xd')][_0x9508('0x10')](_0x9508('0x1aa'));if(!_['isEmpty'](_0x5ec6ff['extra'])){this[_0x9508('0xd')][_0x9508('0x37')]=_0x5ec6ff[_0x9508('0xa3')];}if(_0x557984[_0x9508('0xbb')]===_0x9508('0x1ab')){this['channel'][_0x9508('0xac')](_0x9508('0x1ac'));return this[_0x9508('0xd')][_0x9508('0xbb')]();}return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x1ad'));};AGIVertices[_0x9508('0xf')][_0x9508('0x1ae')]=function(_0x378ba7){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1af'),_0x378ba7[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x378ba7['project_id'])){return this[_0x9508('0xd')][_0x9508('0x33')](_0x378ba7,'no\x20subproject\x20selected');}var _0x4c372d=this[_0x9508('0x17')]['sync'](this,_0x378ba7[_0x9508('0x1b0')]);if(!this[_0x9508('0x87')](_0x4c372d)){return this[_0x9508('0xd')]['error'](_0x378ba7,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x378ba7[_0x9508('0x1b0')]));}if(_0x4c372d===this[_0x9508('0xd')][_0x9508('0x39')]){return this[_0x9508('0xd')][_0x9508('0x33')](_0x378ba7,_0x9508('0x1b1'));}this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x378ba7,_0x4c372d);var _0x2924b8=this['channel']['exec']('AGI',util[_0x9508('0x28')](_0x9508('0x1b2'),config[_0x9508('0x7')][_0x9508('0x1b3')]||_0x9508('0x1b4'),_0x4c372d,this[_0x9508('0xd')][_0x9508('0x39')]));if(_0x2924b8['result']===-0x1){return _0x2924b8;}return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('Executed\x20command\x20%s\x20%s','AGI',_0x4c372d));};AGIVertices[_0x9508('0xf')][_0x9508('0x1b5')]=function(_0x4f8b44){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x4f8b44[_0x9508('0xa9')]));var _0x27f03c=this[_0x9508('0x53')][_0x9508('0x6f')](this,_0x4f8b44['command']);this[_0x9508('0x36')][_0x9508('0x6f')](this,_0x4f8b44,_0x4f8b44[_0x9508('0xba')]);if(this['isConfigured'](_0x4f8b44['variable_id'])){var _0x8d34e=this[_0x9508('0x10')]['sync'](this,_0x4f8b44[_0x9508('0xd6')]);if(_0x8d34e){this[_0x9508('0xd')]['setVariable'](_0x8d34e,_0x27f03c);return this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x4f8b44['command'],_0x8d34e));}}return this[_0x9508('0xd')][_0x9508('0xac')](util['format'](_0x9508('0x1b6'),_0x4f8b44[_0x9508('0xba')]));};AGIVertices[_0x9508('0xf')][_0x9508('0x1b7')]=function(_0x420550){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1b8'),_0x420550[_0x9508('0xa9')]));_0x420550[_0x9508('0x59')]=_0x420550['text'][_0x9508('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x420550[_0x9508('0x57')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0x1b9'));}if(!this[_0x9508('0x87')](_0x420550[_0x9508('0x59')])){return this['channel'][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1ba'),_0x420550['text']));var _0x250d2e=this[_0x9508('0x56')][_0x9508('0x6f')](this,_0x420550);if(_0x250d2e){this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1bb'),_0x250d2e));var _0xf486a1=this['channel']['streamFile'](_0x250d2e);try{fs[_0x9508('0x100')](_0x250d2e+_0x9508('0x151'));}catch(_0x181408){logger['error'](_0x181408);}return _0xf486a1;}return this[_0x9508('0xd')]['error'](_0x420550,_0x9508('0x1bc'));};AGIVertices[_0x9508('0xf')][_0x9508('0x1bd')]=function(_0x1c6a40){logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x1be'),_0x1c6a40[_0x9508('0xa9')]));_0x1c6a40['text']=_0x1c6a40[_0x9508('0x59')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9508('0x87')](_0x1c6a40[_0x9508('0x59')])){return this[_0x9508('0xd')][_0x9508('0xac')](_0x9508('0xaa'));}this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')]('Trying\x20Google\x20TTS\x20%s',_0x1c6a40[_0x9508('0x59')]));var _0x357dab=this[_0x9508('0x60')][_0x9508('0x6f')](this,_0x1c6a40);if(_0x357dab){this['channel'][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x1bf'),_0x357dab));var _0x3d43b8=this['channel']['streamFile'](_0x357dab);try{fs[_0x9508('0x100')](_0x357dab+_0x9508('0x151'));}catch(_0x22fba6){logger['error'](_0x22fba6);}return _0x3d43b8;}return this['channel'][_0x9508('0x33')](_0x1c6a40,_0x9508('0x1c0'));};AGIVertices[_0x9508('0xf')][_0x9508('0x1c1')]=function(_0x2c9dc6){logger['info'](util[_0x9508('0x28')](_0x9508('0x1c2'),_0x2c9dc6[_0x9508('0xa9')]));if(!this[_0x9508('0x87')](_0x2c9dc6[_0x9508('0x155')])){return this[_0x9508('0xd')]['error'](_0x2c9dc6,_0x9508('0x156'));}logger[_0x9508('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));var _0xc8432f=this[_0x9508('0x1c3')]['sync'](this,_0x2c9dc6[_0x9508('0x155')]);if(_0xc8432f){logger['info'](util[_0x9508('0x28')](_0x9508('0x157'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));this[_0x9508('0xd')][_0x9508('0xac')](util[_0x9508('0x28')](_0x9508('0x157'),this['channel']['callerid'],_0x2c9dc6[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x158')};}else{logger[_0x9508('0x30')](util[_0x9508('0x28')](_0x9508('0x159'),this['channel'][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0x159'),this[_0x9508('0xd')][_0x9508('0x3a')],_0x2c9dc6[_0x9508('0x155')]));return{'code':0xc8,'result':_0x9508('0x15a')};}};AGIVertices[_0x9508('0xf')][_0x9508('0x1c4')]=function(_0x141dc0){logger[_0x9508('0x30')](util['format'](_0x9508('0x1c5'),_0x141dc0[_0x9508('0xa9')]));var _0x3436fd=this[_0x9508('0xd')][_0x9508('0x54')](_0x9508('0x1c6'),[_0x141dc0[_0x9508('0x1c7')],_0x141dc0['options']]);if(_0x3436fd[_0x9508('0xab')]===-0x1){return _0x3436fd;}return this[_0x9508('0xd')]['noop'](util[_0x9508('0x28')](_0x9508('0xc4'),_0x9508('0x1c6'),_0x141dc0[_0x9508('0x1c7')]));};AGIVertices['prototype']['vswitch']=function(_0x887c22){logger['info'](util[_0x9508('0x28')](_0x9508('0x1c8'),_0x887c22[_0x9508('0xa9')]));if(!this['isConfigured'](_0x887c22['variable_id'])){return this['channel'][_0x9508('0x33')](_0x887c22,_0x9508('0x1c9'));}var _0x1b246b=this['getVariable']['sync'](this,_0x887c22['variable_id']);if(!_0x1b246b){return this['channel']['error'](_0x887c22,_0x9508('0x115'));}var _0x5daf6a=this[_0x9508('0xd')][_0x9508('0x10')](_0x1b246b);return{'code':0xc8,'result':_0x5daf6a[_0x9508('0xa3')]?_0x5daf6a[_0x9508('0xa3')]:'-'};};String[_0x9508('0xf')][_0x9508('0xa2')]=function(_0x3d08e2,_0x2d73d0){return this[_0x9508('0xa1')](_0x3d08e2)[_0x9508('0x1ca')](_0x2d73d0);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4421c6a..d0a58df 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 _0xe608=['transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','timers','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','channels','ACW','mandatoryDispositionPause','name','agents','resolve','getAgent','then','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','queue','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s'];(function(_0x226f52,_0x44b1bc){var _0x137eea=function(_0x5753ca){while(--_0x5753ca){_0x226f52['push'](_0x226f52['shift']());}};_0x137eea(++_0x44b1bc);}(_0xe608,0xb5));var _0x8e60=function(_0x1e5068,_0x31e9c4){_0x1e5068=_0x1e5068-0x0;var _0x2230b6=_0xe608[_0x1e5068];return _0x2230b6;};'use strict';var _=require(_0x8e60('0x0'));var moment=require('moment');var ami=require(_0x8e60('0x1'));var logger=require(_0x8e60('0x2'))(_0x8e60('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x8e60('0x4'));function Acw(_0xc24f7c){this[_0x8e60('0x5')]=_0xc24f7c[_0x8e60('0x5')];this['agents']=_0xc24f7c['agents'];this['timers']=_0xc24f7c[_0x8e60('0x6')];this['channels']={};ami['on'](_0x8e60('0x7'),this[_0x8e60('0x8')][_0x8e60('0x9')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x8e60('0x9')](this));ami['on']('hangup',this['syncHangup'][_0x8e60('0x9')](this));ami['on'](_0x8e60('0xa'),this[_0x8e60('0xb')][_0x8e60('0x9')](this));ami['on'](_0x8e60('0xc'),this[_0x8e60('0xd')][_0x8e60('0x9')](this));ami['on'](_0x8e60('0xe'),this[_0x8e60('0xf')][_0x8e60('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x8e60('0x10')][_0x8e60('0x9')](this));}function getDiff(_0x302de3){var _0x42f1ab=moment()['milliseconds'](0x0);var _0x1ad42e=moment(_0x302de3)[_0x8e60('0x11')](0x0);return _0x42f1ab[_0x8e60('0x12')](_0x1ad42e,_0x8e60('0x13'));}Acw[_0x8e60('0x14')][_0x8e60('0x15')]=function(_0x293b5e,_0x38e1f3){var _0x5f4fcd=this;var _0xf06b27=getDiff(_0x5f4fcd['timers'][_0x293b5e][_0x8e60('0x16')]);clearTimeout(_0x5f4fcd[_0x8e60('0x6')][_0x293b5e][_0x8e60('0x17')]);_0x5f4fcd[_0x8e60('0x6')][_0x293b5e]['timer']=![];return RpcVoiceAgentReport['update']({'acwtime':_0xf06b27},_0x5f4fcd[_0x8e60('0x6')][_0x293b5e][_0x8e60('0x18')],_0x293b5e)['then'](function(_0x3276ff){logger[_0x8e60('0x19')](_0x8e60('0x1a'),_0x38e1f3,_0xf06b27,_0x3276ff);})[_0x8e60('0x1b')](function(_0x2be024){logger[_0x8e60('0x1c')](_0x8e60('0x1d'),_0x38e1f3,_0x2be024);})[_0x8e60('0x1e')](function(){delete _0x5f4fcd[_0x8e60('0x6')][_0x293b5e];});};Acw[_0x8e60('0x14')][_0x8e60('0x1f')]=function(_0x2d96d0){try{var _0x5ea57f=this;var _0x45b58a=this[_0x8e60('0x20')][_0x2d96d0]['interface'];var _0x32e075=this['channels'][_0x2d96d0]['queue'];var _0x25d5a3=this[_0x8e60('0x5')][_0x32e075];var _0x3ace3f=![];var _0x4c2280=_0x8e60('0x21');if(_0x25d5a3['mandatoryDisposition']&&_0x25d5a3[_0x8e60('0x22')][_0x8e60('0x23')]){_0x3ace3f=!![];_0x4c2280=_0x25d5a3[_0x8e60('0x22')][_0x8e60('0x23')];}if(!_0x5ea57f[_0x8e60('0x24')][_0x45b58a]){return Promise[_0x8e60('0x25')]();}return RpcUser[_0x8e60('0x26')](_0x5ea57f[_0x8e60('0x24')][_0x45b58a]['id'])[_0x8e60('0x27')](function(_0x587b7a){if(!_0x587b7a||_0x587b7a[_0x8e60('0x28')]){logger['info'](_0x8e60('0x29'),_0x2d96d0,_0x45b58a,_0x32e075);return;}logger[_0x8e60('0x19')](_0x8e60('0x2a'),_0x2d96d0,_0x45b58a,_0x32e075);var _0x54c216=_0x5ea57f[_0x8e60('0x20')][_0x2d96d0]['attended']&&_0x5ea57f[_0x8e60('0x20')][_0x2d96d0][_0x8e60('0x2b')]?_0x5ea57f['channels'][_0x2d96d0][_0x8e60('0x2b')]:_0x2d96d0;return RpcUser[_0x8e60('0x2c')](_0x5ea57f['agents'][_0x45b58a],_0x4c2280,_0x54c216);})[_0x8e60('0x27')](function(_0x82553e){if(_0x3ace3f||!_0x82553e){return;}_0x5ea57f[_0x8e60('0x6')][_0x45b58a]={};logger[_0x8e60('0x19')](_0x8e60('0x2d'),_0x2d96d0,_0x5ea57f[_0x8e60('0x5')][_0x32e075][_0x8e60('0x2e')],_0x45b58a,_0x32e075);_0x5ea57f[_0x8e60('0x6')][_0x45b58a]['timer']=setTimeout(_0x5ea57f['stopAcw'][_0x8e60('0x9')](_0x5ea57f,_0x45b58a),_0x5ea57f[_0x8e60('0x5')][_0x32e075][_0x8e60('0x2e')]*0x3e8);_0x5ea57f[_0x8e60('0x6')][_0x45b58a][_0x8e60('0x16')]=moment()[_0x8e60('0x2f')](_0x8e60('0x30'));_0x5ea57f['timers'][_0x45b58a][_0x8e60('0x18')]=_0x2d96d0;_0x5ea57f['timers'][_0x45b58a][_0x8e60('0x31')]=_0x32e075;_0x5ea57f[_0x8e60('0x6')][_0x45b58a][_0x8e60('0x15')]=_0x5ea57f[_0x8e60('0x15')][_0x8e60('0x9')](_0x5ea57f,_0x45b58a,_0x2d96d0);})[_0x8e60('0x1b')](function(){logger[_0x8e60('0x1c')](_0x8e60('0x2d'),_0x2d96d0,_0x5ea57f[_0x8e60('0x5')][_0x32e075][_0x8e60('0x2e')],_0x45b58a,_0x32e075);})[_0x8e60('0x1e')](function(){delete _0x5ea57f[_0x8e60('0x20')][_0x2d96d0];});}catch(_0x4e528b){logger[_0x8e60('0x1c')]('[ACW][START]\x20%s',_0x4e528b[_0x8e60('0x32')]);}};Acw[_0x8e60('0x14')]['stopAcw']=function(_0xe5f811){try{var _0xa046b2=this;if(_0xa046b2[_0x8e60('0x6')][_0xe5f811]){_0xa046b2[_0x8e60('0x6')][_0xe5f811]['timer']=![];var _0x46b2d5=_0xa046b2[_0x8e60('0x6')][_0xe5f811][_0x8e60('0x18')];var _0x49cead=_0xa046b2[_0x8e60('0x6')][_0xe5f811][_0x8e60('0x31')];var _0x127cfe=_0xa046b2[_0x8e60('0x5')][_0x49cead][_0x8e60('0x2e')];logger[_0x8e60('0x19')](_0x8e60('0x33'),_0x46b2d5,_0xe5f811);RpcUser['getAgent'](this[_0x8e60('0x24')][_0xe5f811]['id'])['then'](function(_0x5ac356){if(_0x5ac356[_0x8e60('0x34')]===_0x8e60('0x21')){return RpcUser[_0x8e60('0x35')](_0xa046b2[_0x8e60('0x24')][_0xe5f811]);}});RpcVoiceAgentReport[_0x8e60('0x36')]({'acwtime':_0x127cfe,'agentacw':!![]},_0x46b2d5,_0xe5f811)[_0x8e60('0x27')](function(_0x2993e1){logger['info'](_0x8e60('0x1a'),_0x46b2d5,_0x127cfe,_0x2993e1);})[_0x8e60('0x1b')](function(_0x53d32e){logger['error'](_0x8e60('0x1d'),_0x46b2d5,_0x53d32e);});}else{logger['error'](_0x8e60('0x37'),_0xe5f811);if(_0xa046b2[_0x8e60('0x6')]){logger[_0x8e60('0x19')](_0x8e60('0x38'),JSON[_0x8e60('0x39')](_0xa046b2[_0x8e60('0x6')]));}}}catch(_0x1f75b9){logger[_0x8e60('0x1c')](_0x8e60('0x3a'),_0x1f75b9[_0x8e60('0x32')]);}};Acw[_0x8e60('0x14')][_0x8e60('0x8')]=function(_0x4a39da){try{if(this['voiceQueues'][_0x4a39da[_0x8e60('0x31')]]&&(this['voiceQueues'][_0x4a39da['queue']][_0x8e60('0x3')]||this[_0x8e60('0x5')][_0x4a39da['queue']][_0x8e60('0x3b')])){if(this[_0x8e60('0x24')][_0x4a39da[_0x8e60('0x3c')]]){this[_0x8e60('0x20')][_0x4a39da['uniqueid']]={'queue':_0x4a39da[_0x8e60('0x31')],'interface':_0x4a39da['interface'],'destlinkedid':_0x4a39da[_0x8e60('0x2b')]};}}}catch(_0x4852e1){logger[_0x8e60('0x1c')](_0x8e60('0x3d'),_0x4852e1[_0x8e60('0x32')]);}};Acw[_0x8e60('0x14')][_0x8e60('0x10')]=function(_0x394c21){try{if(this[_0x8e60('0x5')][_0x394c21[_0x8e60('0x31')]]&&(this[_0x8e60('0x5')][_0x394c21['queue']][_0x8e60('0x3')]||this['voiceQueues'][_0x394c21[_0x8e60('0x31')]][_0x8e60('0x3b')])){if(this['agents'][_0x394c21[_0x8e60('0x3c')]]){this[_0x8e60('0x20')][_0x394c21[_0x8e60('0x18')]]={'queue':_0x394c21[_0x8e60('0x31')],'interface':_0x394c21[_0x8e60('0x3c')]};}}}catch(_0x53adec){logger[_0x8e60('0x1c')]('[ACW][syncAgentConnectPreview]\x20%s',_0x53adec['message']);}};Acw[_0x8e60('0x14')]['syncHangupRequest']=function(_0x2190fb){try{if(this[_0x8e60('0x20')][_0x2190fb[_0x8e60('0x18')]]&&_[_0x8e60('0x3e')](this[_0x8e60('0x20')][_0x2190fb[_0x8e60('0x18')]][_0x8e60('0x3f')])){logger[_0x8e60('0x19')]('[%s][HANGUP:UNIQUEID]',_0x2190fb[_0x8e60('0x18')]);this['startAcw'](_0x2190fb[_0x8e60('0x18')]);}else if(this[_0x8e60('0x20')][_0x2190fb[_0x8e60('0x40')]]&&_['isUndefined'](this['channels'][_0x2190fb['linkedid']][_0x8e60('0x3f')])){logger['info'](_0x8e60('0x41'),_0x2190fb[_0x8e60('0x40')]);this[_0x8e60('0x1f')](_0x2190fb[_0x8e60('0x40')]);}}catch(_0x1292f1){logger[_0x8e60('0x1c')](_0x8e60('0x42'),_0x1292f1['message']);}};Acw['prototype'][_0x8e60('0x43')]=function(_0x37b9f7){try{if(this[_0x8e60('0x20')][_0x37b9f7[_0x8e60('0x18')]]&&this[_0x8e60('0x20')][_0x37b9f7[_0x8e60('0x18')]][_0x8e60('0x3f')]){logger[_0x8e60('0x19')](_0x8e60('0x44'),_0x37b9f7[_0x8e60('0x18')]);this[_0x8e60('0x1f')](_0x37b9f7[_0x8e60('0x18')]);}else if(this[_0x8e60('0x20')][_0x37b9f7[_0x8e60('0x40')]]&&this[_0x8e60('0x20')][_0x37b9f7['linkedid']][_0x8e60('0x3f')]){logger[_0x8e60('0x19')](_0x8e60('0x45'),_0x37b9f7[_0x8e60('0x40')]);this[_0x8e60('0x1f')](_0x37b9f7[_0x8e60('0x40')]);}}catch(_0x2953df){logger[_0x8e60('0x1c')](_0x8e60('0x46'),_0x2953df[_0x8e60('0x32')]);}};Acw[_0x8e60('0x14')][_0x8e60('0xd')]=function(_0x3bc310){try{if(!_[_0x8e60('0x47')](this['channels'][_0x3bc310['transfereeuniqueid']])){this[_0x8e60('0x1f')](_0x3bc310[_0x8e60('0x48')]);if(this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x49')]]){this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x49')]][_0x8e60('0x3f')]=!![];this[_0x8e60('0x20')][_0x3bc310['transfertargetuniqueid']]=this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x49')]];delete this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x49')]];}}else if(!_[_0x8e60('0x47')](this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x4a')]])){this[_0x8e60('0x1f')](_0x3bc310[_0x8e60('0x4a')]);if(this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x4b')]]){this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x4b')]][_0x8e60('0x3f')]=!![];this[_0x8e60('0x20')][_0x3bc310['transfereeuniqueid']]=this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x4b')]];delete this[_0x8e60('0x20')][_0x3bc310[_0x8e60('0x4b')]];}}}catch(_0x187a65){logger[_0x8e60('0x1c')](_0x8e60('0x4c'),_0x187a65[_0x8e60('0x32')]);}};Acw[_0x8e60('0x14')][_0x8e60('0xf')]=function(_0x5c6f8b){try{if(this[_0x8e60('0x20')][_0x5c6f8b[_0x8e60('0x4d')]]){logger[_0x8e60('0x19')](_0x8e60('0x4e'),JSON[_0x8e60('0x39')](_0x5c6f8b[_0x8e60('0x4d')]));this['startAcw'](_0x5c6f8b['transfereruniqueid']);}else if(this['channels'][_0x5c6f8b[_0x8e60('0x4f')]]){logger[_0x8e60('0x19')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x8e60('0x39')](_0x5c6f8b[_0x8e60('0x4f')]));this[_0x8e60('0x1f')](_0x5c6f8b[_0x8e60('0x4f')]);}}catch(_0xaac282){logger[_0x8e60('0x1c')](_0x8e60('0x50'),_0xaac282[_0x8e60('0x32')]);}};Acw[_0x8e60('0x14')]['syncAgentRingNoAnswer']=function(_0x20a340){try{if(this[_0x8e60('0x5')][_0x20a340[_0x8e60('0x31')]]&&this[_0x8e60('0x5')][_0x20a340['queue']]['autopause']===_0x8e60('0x51')){if(this[_0x8e60('0x24')][_0x20a340[_0x8e60('0x3c')]]){logger[_0x8e60('0x19')](_0x8e60('0x52'),_0x20a340['uniqueid'],_0x20a340[_0x8e60('0x3c')],_0x20a340[_0x8e60('0x31')]);return RpcUser[_0x8e60('0x2c')](this[_0x8e60('0x24')][_0x20a340[_0x8e60('0x3c')]],_0x8e60('0x53'),_0x20a340['uniqueid']);}}}catch(_0x1de7e5){logger[_0x8e60('0x1c')](_0x8e60('0x54'),_0x1de7e5[_0x8e60('0x32')]);}};module[_0x8e60('0x55')]=Acw; \ No newline at end of file +var _0x208d=['../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','catch','error','finally','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','message','stopAcw','getAgent','pauseType','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','acw','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment'];(function(_0x156e84,_0x337a89){var _0x322d5d=function(_0x2cc16b){while(--_0x2cc16b){_0x156e84['push'](_0x156e84['shift']());}};_0x322d5d(++_0x337a89);}(_0x208d,0xa4));var _0xd208=function(_0x438075,_0x59ca9e){_0x438075=_0x438075-0x0;var _0x3c2ff0=_0x208d[_0x438075];return _0x3c2ff0;};'use strict';var _=require(_0xd208('0x0'));var moment=require(_0xd208('0x1'));var ami=require(_0xd208('0x2'));var logger=require(_0xd208('0x3'))('acw');var RpcUser=require(_0xd208('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1c2598){this[_0xd208('0x5')]=_0x1c2598[_0xd208('0x5')];this[_0xd208('0x6')]=_0x1c2598[_0xd208('0x6')];this['timers']=_0x1c2598[_0xd208('0x7')];this[_0xd208('0x8')]={};ami['on'](_0xd208('0x9'),this['syncAgentConnect'][_0xd208('0xa')](this));ami['on'](_0xd208('0xb'),this['syncHangupRequest'][_0xd208('0xa')](this));ami['on'](_0xd208('0xc'),this['syncHangup'][_0xd208('0xa')](this));ami['on'](_0xd208('0xd'),this[_0xd208('0xe')][_0xd208('0xa')](this));ami['on']('attendedtransfer',this[_0xd208('0xf')][_0xd208('0xa')](this));ami['on']('blindtransfer',this[_0xd208('0x10')][_0xd208('0xa')](this));ami['on'](_0xd208('0x11'),this[_0xd208('0x12')][_0xd208('0xa')](this));}function getDiff(_0x38db76){var _0x3137d0=moment()['milliseconds'](0x0);var _0x5b9631=moment(_0x38db76)[_0xd208('0x13')](0x0);return _0x3137d0[_0xd208('0x14')](_0x5b9631,_0xd208('0x15'));}Acw[_0xd208('0x16')][_0xd208('0x17')]=function(_0x14e6c5,_0x48caac){var _0x21a27b=this;var _0x3d057a=getDiff(_0x21a27b['timers'][_0x14e6c5][_0xd208('0x18')]);clearTimeout(_0x21a27b['timers'][_0x14e6c5][_0xd208('0x19')]);_0x21a27b[_0xd208('0x7')][_0x14e6c5][_0xd208('0x19')]=![];return RpcVoiceAgentReport[_0xd208('0x1a')]({'acwtime':_0x3d057a},_0x21a27b[_0xd208('0x7')][_0x14e6c5][_0xd208('0x1b')],_0x14e6c5)[_0xd208('0x1c')](function(_0x292baa){logger[_0xd208('0x1d')]('[%s][UPDATE][ACWTIME:%s]',_0x48caac,_0x3d057a,_0x292baa);})[_0xd208('0x1e')](function(_0x5f234e){logger[_0xd208('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x48caac,_0x5f234e);})[_0xd208('0x20')](function(){delete _0x21a27b[_0xd208('0x7')][_0x14e6c5];});};Acw[_0xd208('0x16')][_0xd208('0x21')]=function(_0x43f3a7){try{var _0x487a3b=this;var _0x4e2928=this[_0xd208('0x8')][_0x43f3a7]['interface'];var _0x2fca0b=this[_0xd208('0x8')][_0x43f3a7][_0xd208('0x22')];var _0x363e08=this[_0xd208('0x5')][_0x2fca0b];var _0x174297=![];var _0x514bb5=_0xd208('0x23');if(_0x363e08[_0xd208('0x24')]&&_0x363e08[_0xd208('0x25')][_0xd208('0x26')]){_0x174297=!![];_0x514bb5=_0x363e08[_0xd208('0x25')][_0xd208('0x26')];}if(!_0x487a3b['agents'][_0x4e2928]){return Promise['resolve']();}return RpcUser['getAgent'](_0x487a3b['agents'][_0x4e2928]['id'])[_0xd208('0x1c')](function(_0x4b29c0){if(!_0x4b29c0||_0x4b29c0['voicePause']){logger['info'](_0xd208('0x27'),_0x43f3a7,_0x4e2928,_0x2fca0b);return;}logger[_0xd208('0x1d')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x43f3a7,_0x4e2928,_0x2fca0b);var _0x40b576=_0x487a3b['channels'][_0x43f3a7][_0xd208('0x28')]&&_0x487a3b[_0xd208('0x8')][_0x43f3a7][_0xd208('0x29')]?_0x487a3b[_0xd208('0x8')][_0x43f3a7][_0xd208('0x29')]:_0x43f3a7;return RpcUser[_0xd208('0x2a')](_0x487a3b[_0xd208('0x6')][_0x4e2928],_0x514bb5,_0x40b576);})[_0xd208('0x1c')](function(_0x290eec){if(_0x174297||!_0x290eec){return;}_0x487a3b['timers'][_0x4e2928]={};logger[_0xd208('0x1d')](_0xd208('0x2b'),_0x43f3a7,_0x487a3b[_0xd208('0x5')][_0x2fca0b]['acwTimeout'],_0x4e2928,_0x2fca0b);_0x487a3b[_0xd208('0x7')][_0x4e2928][_0xd208('0x19')]=setTimeout(_0x487a3b['stopAcw']['bind'](_0x487a3b,_0x4e2928),_0x487a3b[_0xd208('0x5')][_0x2fca0b][_0xd208('0x2c')]*0x3e8);_0x487a3b[_0xd208('0x7')][_0x4e2928]['lastPauseAt']=moment()[_0xd208('0x2d')](_0xd208('0x2e'));_0x487a3b[_0xd208('0x7')][_0x4e2928][_0xd208('0x1b')]=_0x43f3a7;_0x487a3b[_0xd208('0x7')][_0x4e2928]['queue']=_0x2fca0b;_0x487a3b['timers'][_0x4e2928][_0xd208('0x17')]=_0x487a3b[_0xd208('0x17')][_0xd208('0xa')](_0x487a3b,_0x4e2928,_0x43f3a7);})[_0xd208('0x1e')](function(){logger[_0xd208('0x1f')](_0xd208('0x2b'),_0x43f3a7,_0x487a3b[_0xd208('0x5')][_0x2fca0b][_0xd208('0x2c')],_0x4e2928,_0x2fca0b);})[_0xd208('0x20')](function(){delete _0x487a3b[_0xd208('0x8')][_0x43f3a7];});}catch(_0x19ab59){logger[_0xd208('0x1f')]('[ACW][START]\x20%s',_0x19ab59[_0xd208('0x2f')]);}};Acw[_0xd208('0x16')][_0xd208('0x30')]=function(_0xad319e){try{var _0x388128=this;if(_0x388128[_0xd208('0x7')][_0xad319e]){_0x388128[_0xd208('0x7')][_0xad319e][_0xd208('0x19')]=![];var _0x4617b4=_0x388128[_0xd208('0x7')][_0xad319e][_0xd208('0x1b')];var _0x5c0646=_0x388128[_0xd208('0x7')][_0xad319e][_0xd208('0x22')];var _0x208469=_0x388128['voiceQueues'][_0x5c0646]['acwTimeout'];logger[_0xd208('0x1d')]('[%s][TIMER][STOP][AGENT:%s]',_0x4617b4,_0xad319e);RpcUser[_0xd208('0x31')](this[_0xd208('0x6')][_0xad319e]['id'])[_0xd208('0x1c')](function(_0x104bf4){if(_0x104bf4[_0xd208('0x32')]===_0xd208('0x23')){return RpcUser['saveUnpause'](_0x388128[_0xd208('0x6')][_0xad319e]);}});RpcVoiceAgentReport[_0xd208('0x1a')]({'acwtime':_0x208469,'agentacw':!![]},_0x4617b4,_0xad319e)[_0xd208('0x1c')](function(_0x3d0c32){logger[_0xd208('0x1d')](_0xd208('0x33'),_0x4617b4,_0x208469,_0x3d0c32);})['catch'](function(_0x4df5eb){logger[_0xd208('0x1f')](_0xd208('0x34'),_0x4617b4,_0x4df5eb);});}else{logger[_0xd208('0x1f')](_0xd208('0x35'),_0xad319e);if(_0x388128[_0xd208('0x7')]){logger[_0xd208('0x1d')]('[ACW][TIMERS]',JSON[_0xd208('0x36')](_0x388128[_0xd208('0x7')]));}}}catch(_0x340f75){logger[_0xd208('0x1f')]('[ACW][STOP]\x20%s',_0x340f75[_0xd208('0x2f')]);}};Acw[_0xd208('0x16')][_0xd208('0x37')]=function(_0x5e05ad){try{if(this['voiceQueues'][_0x5e05ad[_0xd208('0x22')]]&&(this[_0xd208('0x5')][_0x5e05ad['queue']]['acw']||this[_0xd208('0x5')][_0x5e05ad[_0xd208('0x22')]]['mandatoryDisposition'])){if(this[_0xd208('0x6')][_0x5e05ad[_0xd208('0x38')]]){this['channels'][_0x5e05ad[_0xd208('0x1b')]]={'queue':_0x5e05ad['queue'],'interface':_0x5e05ad[_0xd208('0x38')],'destlinkedid':_0x5e05ad['destlinkedid']};}}}catch(_0x34febd){logger[_0xd208('0x1f')](_0xd208('0x39'),_0x34febd[_0xd208('0x2f')]);}};Acw[_0xd208('0x16')][_0xd208('0x12')]=function(_0x3bd269){try{if(this[_0xd208('0x5')][_0x3bd269[_0xd208('0x22')]]&&(this[_0xd208('0x5')][_0x3bd269[_0xd208('0x22')]][_0xd208('0x3a')]||this['voiceQueues'][_0x3bd269['queue']][_0xd208('0x24')])){if(this['agents'][_0x3bd269['interface']]){this['channels'][_0x3bd269[_0xd208('0x1b')]]={'queue':_0x3bd269[_0xd208('0x22')],'interface':_0x3bd269[_0xd208('0x38')]};}}}catch(_0x599f51){logger[_0xd208('0x1f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x599f51[_0xd208('0x2f')]);}};Acw[_0xd208('0x16')]['syncHangupRequest']=function(_0x1eea14){try{if(this[_0xd208('0x8')][_0x1eea14[_0xd208('0x1b')]]&&_[_0xd208('0x3b')](this[_0xd208('0x8')][_0x1eea14['uniqueid']]['attended'])){logger[_0xd208('0x1d')](_0xd208('0x3c'),_0x1eea14[_0xd208('0x1b')]);this[_0xd208('0x21')](_0x1eea14[_0xd208('0x1b')]);}else if(this[_0xd208('0x8')][_0x1eea14[_0xd208('0x3d')]]&&_['isUndefined'](this[_0xd208('0x8')][_0x1eea14[_0xd208('0x3d')]]['attended'])){logger[_0xd208('0x1d')](_0xd208('0x3e'),_0x1eea14['linkedid']);this[_0xd208('0x21')](_0x1eea14[_0xd208('0x3d')]);}}catch(_0x29a72b){logger[_0xd208('0x1f')]('[ACW][syncHangupRequest]\x20%s',_0x29a72b['message']);}};Acw[_0xd208('0x16')][_0xd208('0x3f')]=function(_0x34b5d8){try{if(this['channels'][_0x34b5d8[_0xd208('0x1b')]]&&this[_0xd208('0x8')][_0x34b5d8[_0xd208('0x1b')]][_0xd208('0x28')]){logger[_0xd208('0x1d')](_0xd208('0x40'),_0x34b5d8[_0xd208('0x1b')]);this[_0xd208('0x21')](_0x34b5d8[_0xd208('0x1b')]);}else if(this[_0xd208('0x8')][_0x34b5d8[_0xd208('0x3d')]]&&this[_0xd208('0x8')][_0x34b5d8[_0xd208('0x3d')]][_0xd208('0x28')]){logger[_0xd208('0x1d')](_0xd208('0x41'),_0x34b5d8[_0xd208('0x3d')]);this[_0xd208('0x21')](_0x34b5d8[_0xd208('0x3d')]);}}catch(_0x25780d){logger[_0xd208('0x1f')](_0xd208('0x42'),_0x25780d[_0xd208('0x2f')]);}};Acw['prototype'][_0xd208('0xf')]=function(_0x56472a){try{if(!_[_0xd208('0x43')](this[_0xd208('0x8')][_0x56472a[_0xd208('0x44')]])){this['startAcw'](_0x56472a[_0xd208('0x44')]);if(this['channels'][_0x56472a[_0xd208('0x45')]]){this[_0xd208('0x8')][_0x56472a['secondtransfereruniqueid']]['attended']=!![];this[_0xd208('0x8')][_0x56472a['transfertargetuniqueid']]=this[_0xd208('0x8')][_0x56472a[_0xd208('0x45')]];delete this['channels'][_0x56472a[_0xd208('0x45')]];}}else if(!_[_0xd208('0x43')](this[_0xd208('0x8')][_0x56472a['transfertargetuniqueid']])){this[_0xd208('0x21')](_0x56472a[_0xd208('0x46')]);if(this[_0xd208('0x8')][_0x56472a[_0xd208('0x47')]]){this['channels'][_0x56472a[_0xd208('0x47')]]['attended']=!![];this['channels'][_0x56472a[_0xd208('0x44')]]=this[_0xd208('0x8')][_0x56472a['origtransfereruniqueid']];delete this['channels'][_0x56472a['origtransfereruniqueid']];}}}catch(_0x1e4fb3){logger[_0xd208('0x1f')](_0xd208('0x48'),_0x1e4fb3[_0xd208('0x2f')]);}};Acw[_0xd208('0x16')]['syncBlindTransfer']=function(_0x564add){try{if(this[_0xd208('0x8')][_0x564add[_0xd208('0x49')]]){logger[_0xd208('0x1d')](_0xd208('0x4a'),JSON[_0xd208('0x36')](_0x564add[_0xd208('0x49')]));this['startAcw'](_0x564add['transfereruniqueid']);}else if(this['channels'][_0x564add[_0xd208('0x4b')]]){logger[_0xd208('0x1d')](_0xd208('0x4c'),JSON[_0xd208('0x36')](_0x564add[_0xd208('0x4b')]));this[_0xd208('0x21')](_0x564add[_0xd208('0x4b')]);}}catch(_0x2de67f){logger[_0xd208('0x1f')]('[ACW][syncBlindTransfer]\x20%s',_0x2de67f[_0xd208('0x2f')]);}};Acw['prototype'][_0xd208('0xe')]=function(_0x255b2d){try{if(this[_0xd208('0x5')][_0x255b2d[_0xd208('0x22')]]&&this['voiceQueues'][_0x255b2d['queue']][_0xd208('0x4d')]===_0xd208('0x4e')){if(this[_0xd208('0x6')][_0x255b2d['interface']]){logger[_0xd208('0x1d')](_0xd208('0x4f'),_0x255b2d['uniqueid'],_0x255b2d[_0xd208('0x38')],_0x255b2d[_0xd208('0x22')]);return RpcUser[_0xd208('0x2a')](this['agents'][_0x255b2d['interface']],_0xd208('0x50'),_0x255b2d[_0xd208('0x1b')]);}}}catch(_0x4751b0){logger[_0xd208('0x1f')](_0xd208('0x51'),_0x4751b0[_0xd208('0x2f')]);}};module[_0xd208('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 82c071c..dbdbf21 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 _0xc3c0=['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','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','actionSipPeerStatus','catch','[ami.js][fullybooted]','exports','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','keepConnected','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','Action','sipshowregistry','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels'];(function(_0x1a1ec7,_0x2c9cc1){var _0x55650a=function(_0x469410){while(--_0x469410){_0x1a1ec7['push'](_0x1a1ec7['shift']());}};_0x55650a(++_0x2c9cc1);}(_0xc3c0,0x16d));var _0x0c3c=function(_0x4aa07a,_0x4347e1){_0x4aa07a=_0x4aa07a-0x0;var _0x1858fc=_0xc3c0[_0x4aa07a];return _0x1858fc;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0c3c('0x0'));var util=require(_0x0c3c('0x1'));var logger=require(_0x0c3c('0x2'))(_0x0c3c('0x3'));var config=require(_0x0c3c('0x4'));var ami=new Manager(config[_0x0c3c('0x5')][_0x0c3c('0x6')],config[_0x0c3c('0x5')]['ip'],config[_0x0c3c('0x5')][_0x0c3c('0x7')],config[_0x0c3c('0x5')]['password'],!![]);ami[_0x0c3c('0x8')]();ami['Action']=BPromise['promisify'](ami['action']);function error(_0x5156e9){logger[_0x0c3c('0x9')](util[_0x0c3c('0xa')](_0x0c3c('0xb'),config['asterisk'][_0x0c3c('0x7')],config[_0x0c3c('0x5')]['ip'],config['asterisk']['port'],util[_0x0c3c('0xc')](_0x5156e9,![],null)));}function close(){logger[_0x0c3c('0x9')](util[_0x0c3c('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0c3c('0x7')],config['asterisk']['ip'],config[_0x0c3c('0x5')][_0x0c3c('0x6')]));}ami[_0x0c3c('0xd')]=function(){return function(){return ami[_0x0c3c('0xe')]({'action':_0x0c3c('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x0c3c('0xe')]({'action':_0x0c3c('0x10')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x0c3c('0xe')]({'action':'sippeerstatus'});};};ami[_0x0c3c('0x11')]=function(){return function(){return ami[_0x0c3c('0xe')]({'action':'queuesummary'});};};ami[_0x0c3c('0x12')]=function(){return function(){return ami[_0x0c3c('0xe')]({'action':_0x0c3c('0x13')});};};function connect(){logger[_0x0c3c('0x14')](util[_0x0c3c('0xa')](_0x0c3c('0x15'),config[_0x0c3c('0x5')][_0x0c3c('0x7')],config[_0x0c3c('0x5')]['ip'],config[_0x0c3c('0x5')]['port']));ami[_0x0c3c('0x16')]('error',error);ami[_0x0c3c('0x16')](_0x0c3c('0x17'),close);}ami['on'](_0x0c3c('0x18'),connect);ami['on'](_0x0c3c('0x19'),function(_0x45958d){logger['info'](util['format'](_0x0c3c('0x1a'),config[_0x0c3c('0x5')]['username'],config[_0x0c3c('0x5')]['ip'],config[_0x0c3c('0x5')][_0x0c3c('0x6')],util[_0x0c3c('0xc')](_0x45958d,![],null)));});ami['on'](_0x0c3c('0x1b'),function(){logger[_0x0c3c('0x14')](util[_0x0c3c('0xa')](_0x0c3c('0x1c'),config[_0x0c3c('0x5')][_0x0c3c('0x7')],config[_0x0c3c('0x5')]['ip'],config[_0x0c3c('0x5')][_0x0c3c('0x6')]));return Promise['resolve']()[_0x0c3c('0x1d')](ami[_0x0c3c('0xd')]())['then'](ami[_0x0c3c('0x1e')]())[_0x0c3c('0x1d')](ami[_0x0c3c('0x1f')]())[_0x0c3c('0x1d')](ami[_0x0c3c('0x11')]())[_0x0c3c('0x1d')](ami[_0x0c3c('0x12')]())[_0x0c3c('0x20')](function(_0x4f1a9a){logger[_0x0c3c('0x9')](_0x0c3c('0x21'),util[_0x0c3c('0xc')](_0x4f1a9a,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami['once'](_0x0c3c('0x17'),close);module[_0x0c3c('0x22')]=ami; \ No newline at end of file +var _0xdfd7=['info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','actionQueueSummary','queuesummary'];(function(_0x57c5fb,_0x323a28){var _0x48b094=function(_0x502523){while(--_0x502523){_0x57c5fb['push'](_0x57c5fb['shift']());}};_0x48b094(++_0x323a28);}(_0xdfd7,0xed));var _0x7dfd=function(_0x25bee6,_0x5089d2){_0x25bee6=_0x25bee6-0x0;var _0x47d51e=_0xdfd7[_0x25bee6];return _0x47d51e;};'use strict';var Manager=require(_0x7dfd('0x0'));var BPromise=require(_0x7dfd('0x1'));var util=require(_0x7dfd('0x2'));var logger=require('../../config/logger')(_0x7dfd('0x3'));var config=require(_0x7dfd('0x4'));var ami=new Manager(config[_0x7dfd('0x5')][_0x7dfd('0x6')],config['asterisk']['ip'],config[_0x7dfd('0x5')]['username'],config[_0x7dfd('0x5')][_0x7dfd('0x7')],!![]);ami[_0x7dfd('0x8')]();ami[_0x7dfd('0x9')]=BPromise[_0x7dfd('0xa')](ami[_0x7dfd('0xb')]);function error(_0xb2148){logger[_0x7dfd('0xc')](util['format'](_0x7dfd('0xd'),config[_0x7dfd('0x5')][_0x7dfd('0xe')],config[_0x7dfd('0x5')]['ip'],config[_0x7dfd('0x5')]['port'],util['inspect'](_0xb2148,![],null)));}function close(){logger['error'](util[_0x7dfd('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x7dfd('0x5')][_0x7dfd('0xe')],config['asterisk']['ip'],config[_0x7dfd('0x5')][_0x7dfd('0x6')]));}ami[_0x7dfd('0x10')]=function(){return function(){return ami[_0x7dfd('0x9')]({'action':_0x7dfd('0x11')});};};ami[_0x7dfd('0x12')]=function(){return function(){return ami[_0x7dfd('0x9')]({'action':'devicestatelist'});};};ami[_0x7dfd('0x13')]=function(){return function(){return ami[_0x7dfd('0x9')]({'action':'sippeerstatus'});};};ami[_0x7dfd('0x14')]=function(){return function(){return ami['Action']({'action':_0x7dfd('0x15')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x7dfd('0x9')]({'action':'coreshowchannels'});};};function connect(){logger[_0x7dfd('0x16')](util[_0x7dfd('0xf')](_0x7dfd('0x17'),config['asterisk'][_0x7dfd('0xe')],config[_0x7dfd('0x5')]['ip'],config['asterisk'][_0x7dfd('0x6')]));ami[_0x7dfd('0x18')]('error',error);ami[_0x7dfd('0x18')](_0x7dfd('0x19'),close);}ami['on'](_0x7dfd('0x1a'),connect);ami['on']('shutdown',function(_0xad3fd0){logger[_0x7dfd('0x16')](util[_0x7dfd('0xf')](_0x7dfd('0x1b'),config[_0x7dfd('0x5')]['username'],config[_0x7dfd('0x5')]['ip'],config[_0x7dfd('0x5')][_0x7dfd('0x6')],util[_0x7dfd('0x1c')](_0xad3fd0,![],null)));});ami['on'](_0x7dfd('0x1d'),function(){logger[_0x7dfd('0x16')](util[_0x7dfd('0xf')](_0x7dfd('0x1e'),config['asterisk'][_0x7dfd('0xe')],config['asterisk']['ip'],config[_0x7dfd('0x5')][_0x7dfd('0x6')]));return Promise[_0x7dfd('0x1f')]()[_0x7dfd('0x20')](ami[_0x7dfd('0x10')]())[_0x7dfd('0x20')](ami[_0x7dfd('0x12')]())['then'](ami[_0x7dfd('0x13')]())[_0x7dfd('0x20')](ami[_0x7dfd('0x14')]())[_0x7dfd('0x20')](ami[_0x7dfd('0x21')]())[_0x7dfd('0x22')](function(_0x47f02c){logger[_0x7dfd('0xc')](_0x7dfd('0x23'),util[_0x7dfd('0x1c')](_0x47f02c,{'showHidden':![],'depth':null}));});});ami[_0x7dfd('0x18')](_0x7dfd('0xc'),error);ami[_0x7dfd('0x18')](_0x7dfd('0x19'),close);module[_0x7dfd('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 81002ed..813af07 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 _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xb7e7[_0x1c8c28];return _0x1f59b4;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x31f8f3,_0x39bee7){var _0x3f88ce=function(_0x1a5b3d){while(--_0x1a5b3d){_0x31f8f3['push'](_0x31f8f3['shift']());}};_0x3f88ce(++_0x39bee7);}(_0xaa88,0x137));var _0x8aa8=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0xaa88[_0x28b0a4];return _0x105ce6;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 73beaae..52a7515 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 _0x0f6a=['updateOriginated','answertime','queue','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','TIMEOUT','agiafterat','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT','dialAbandonedRetryFrequency','countabandonedretry','dialAbandonedMaxRetry','queueCallerAbandonCreateState','VoiceQueueId','CampaignId','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','pick','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','membername','buildObj','saveInDb','[syncHangupInAMD][createHistory]','Machine','countmachineretry','amd','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HANGUP','AMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countcongestionretry','countagentrejectretry','[rescheduleContact][Machine]','syncHangup','ivrAnswerCallsDay','AGI','[syncHangupIvr][createHistory]','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','online','reachable','length','handlePreviewRecallNotifications','map','Agent','user:%s','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','variables','dialPrefix','trim','substring','dialCutDigit','SIP/%s/%s%s','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countnosuchnumberretry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','stateGlobal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','erlangCalls','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','loggedIn','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','recallme','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','[countReScheduled]\x20','checkIsBlackList','checkContactBlack','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','Umin\x20=\x20','exports','util','moment','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','inspect','format','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','stringify','Interval','NULL_INTERVAL','Intervals','isEmpty','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','indexOf','true','catch','timezones','content','all','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','isIVRCampaign','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Dialer::ifTime()','intervalIftime','OVERTIME_INTERVAL','silly','isGlobal','AMI\x20IfTime','Error','uniqueid','ivr'];(function(_0x18e3b1,_0x684a63){var _0x2d20f9=function(_0x3ed52d){while(--_0x3ed52d){_0x18e3b1['push'](_0x18e3b1['shift']());}};_0x2d20f9(++_0x684a63);}(_0x0f6a,0x163));var _0xa0f6=function(_0x3e3224,_0x1d6bd4){_0x3e3224=_0x3e3224-0x0;var _0x14eaba=_0x0f6a[_0x3e3224];return _0x14eaba;};'use strict';var util=require(_0xa0f6('0x0'));var _=require('lodash');var uuid=require('uuid');var moment=require(_0xa0f6('0x1'));var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require(_0xa0f6('0x2'));var ut=require('../preview/util/util');var config=require(_0xa0f6('0x3'));var logger=require(_0xa0f6('0x4'))(_0xa0f6('0x5'));var loggerBooked=require('../../../config/logger')(_0xa0f6('0x6'));var loggerPredictive=require('../../../config/logger')(_0xa0f6('0x7'));var loggerPredictiveCalls=require(_0xa0f6('0x4'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xa0f6('0x4'))('syncQueueSummary');var ami=require('../ami');config[_0xa0f6('0x8')]=_[_0xa0f6('0x9')](config[_0xa0f6('0x8')],{'host':_0xa0f6('0xa'),'port':0x18eb});var io=require(_0xa0f6('0xb'))(new Redis(config[_0xa0f6('0x8')]));var cmHopper=require(_0xa0f6('0xc'));var voiceQueueRt=require(_0xa0f6('0xd'));var RpcSetting=require(_0xa0f6('0xe'));var Interval=require(_0xa0f6('0xf'));var Action=require(_0xa0f6('0x10'));var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require(_0xa0f6('0x11'));var QueueCallerAbandon=require(_0xa0f6('0x12'));var Hangup=require(_0xa0f6('0x13'));var ipAgi=process[_0xa0f6('0x14')][_0xa0f6('0x15')]||_0xa0f6('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xa0f6('0x17')]['enqueue']=function(_0x424bf2){this[_0xa0f6('0x18')]=this[_0xa0f6('0x18')]?this[_0xa0f6('0x18')][_0xa0f6('0x19')](_0x424bf2):_0x424bf2();};function Dialer(_0x4c99da,_0x4914dd){this[_0xa0f6('0x1a')]=new Sequence();this[_0xa0f6('0x1b')]=_0x4914dd;this[_0xa0f6('0x1c')]=_0x4c99da[_0xa0f6('0x1c')];this[_0xa0f6('0x1d')]=_0x4c99da[_0xa0f6('0x1d')];this[_0xa0f6('0x1e')]=_0x4c99da['agents'];this[_0xa0f6('0x1f')]=_0x4c99da['trunks'];this[_0xa0f6('0x20')]=config['maxNumberOriginate']||0x2;this[_0xa0f6('0x21')]={};this[_0xa0f6('0x22')]={};this['contactsId']={};this[_0xa0f6('0x23')]={};this[_0xa0f6('0x24')]={};this[_0xa0f6('0x25')]={};this[_0xa0f6('0x26')]={};this['ivrOriginated']={};this[_0xa0f6('0x27')]={};this[_0xa0f6('0x28')]={};this[_0xa0f6('0x29')]={};ami['on'](_0xa0f6('0x2a'),this[_0xa0f6('0x2b')][_0xa0f6('0x2c')](this));ami['on'](_0xa0f6('0x2d'),this[_0xa0f6('0x2e')][_0xa0f6('0x2c')](this));ami['on'](_0xa0f6('0x2f'),this[_0xa0f6('0x30')]['bind'](this));ami['on'](_0xa0f6('0x31'),this[_0xa0f6('0x32')][_0xa0f6('0x2c')](this));ami['on'](_0xa0f6('0x33'),this[_0xa0f6('0x34')][_0xa0f6('0x2c')](this));ami['on'](_0xa0f6('0x35'),this[_0xa0f6('0x36')][_0xa0f6('0x2c')](this));ami['on'](_0xa0f6('0x37'),this['syncHangup'][_0xa0f6('0x2c')](this));ami['on'](_0xa0f6('0x38'),this[_0xa0f6('0x39')]['bind'](this));ami['on']('varset',this[_0xa0f6('0x3a')][_0xa0f6('0x2c')](this));ami['on'](_0xa0f6('0x3b'),this[_0xa0f6('0x3c')][_0xa0f6('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xa0f6('0x3d')][_0xa0f6('0x2c')](this));this[_0xa0f6('0x3e')]();this[_0xa0f6('0x3f')]();RpcSetting[_0xa0f6('0x40')]()[_0xa0f6('0x41')](function(_0x6743d4){previewRecallmeReminderInterval=_0x6743d4[_0xa0f6('0x42')];});}function isNotNull(_0x1c8ecc){return _0x1c8ecc!==null&&!_[_0xa0f6('0x43')](_0x1c8ecc);}function msgResponse(_0x5d415e,_0x1f12dc,_0x1402c9){return{'action':_0x5d415e,'response':_0x1f12dc,'message':_0x1402c9,'stack':_0x1402c9};}function emit(_0x5cafd4,_0x274fcf,_0x2596b4){io['to'](_0x5cafd4)[_0xa0f6('0x44')](_0x274fcf,_0x2596b4);}function emitOutboundVoiceQueueSummary(_0x471d6f){if(_0x471d6f[_0xa0f6('0x45')]===_0xa0f6('0x46')){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xa0f6('0x47')](_0x471d6f,{'showHidden':![],'depth':null}));emit(util[_0xa0f6('0x48')]('voice:queue:%s',_0x471d6f[_0xa0f6('0x49')]),_0xa0f6('0x4a'),_0x471d6f);}}function checkGetDataPredictive(_0x4afe85){if(isNotNull(_0x4afe85)&&!_['isEmpty'](_0x4afe85)){loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x4c'));loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x4d'),_0x4afe85['predictiveIntervalTotalCalls']);loggerPredictive[_0xa0f6('0x4b')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4afe85[_0xa0f6('0x4e')]);loggerPredictive['info'](_0xa0f6('0x4f'),_0x4afe85[_0xa0f6('0x50')]);loggerPredictive['info'](_0xa0f6('0x51'),_0x4afe85[_0xa0f6('0x52')]);loggerPredictive['info'](_0xa0f6('0x53'),_0x4afe85['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x54'),_0x4afe85[_0xa0f6('0x55')]);loggerPredictive['info'](_0xa0f6('0x56'));if(_0x4afe85[_0xa0f6('0x57')]>0x0){if(!_[_0xa0f6('0x43')](_0x4afe85['predictiveIntervalAvgTalktime'])&&_0x4afe85['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x58'));if(!_['isUndefined'](_0x4afe85[_0xa0f6('0x59')])&&_0x4afe85['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x5a'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xa0f6('0x4b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1bf5dd){return function(_0x15352d){loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x5b'));loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x5c'),_0x15352d['erlangCalls']);loggerPredictive['info'](_0xa0f6('0x5d'),_0x15352d[_0xa0f6('0x5e')]);loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x5f'),_0x15352d[_0xa0f6('0x60')]);loggerPredictive['info'](_0xa0f6('0x61'),_0x15352d[_0xa0f6('0x62')]);loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x5f'),_0x15352d[_0xa0f6('0x60')]);loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x56'));_[_0xa0f6('0x63')](_0x1bf5dd,_0x15352d);};}function ifInterval(_0x324358,_0xe527e4){if(_[_0xa0f6('0x43')](_0xe527e4)){return![];}return utils[_0xa0f6('0x64')](undefined,_0xe527e4)<_0x324358*0x3c;}function clearPredictiveAttributes(_0x3d331b){if(_0x3d331b['startProgressive']){_0x3d331b[_0xa0f6('0x26')]=undefined;loggerPredictive[_0xa0f6('0x65')](_0x3d331b[_0xa0f6('0x49')],_0xa0f6('0x66'));}if(_0x3d331b[_0xa0f6('0x25')]){_0x3d331b[_0xa0f6('0x25')]=undefined;loggerPredictive[_0xa0f6('0x65')](_0x3d331b[_0xa0f6('0x49')],_0xa0f6('0x67'));}if(_0x3d331b[_0xa0f6('0x68')]){clearInterval(_0x3d331b[_0xa0f6('0x68')]);_0x3d331b[_0xa0f6('0x68')]=undefined;loggerPredictive['debug'](_0x3d331b['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x356678,_0x44be43){return function(_0x445aec){loggerPredictive[_0xa0f6('0x69')](_0x44be43['name'],_0x356678);loggerPredictive[_0xa0f6('0x69')](_0x445aec[_0xa0f6('0x6a')]);clearPredictiveAttributes(_0x44be43);};}function loggerCatch(_0x4a58dc){return function(_0x34d905){logger['error'](_0x4a58dc,util[_0xa0f6('0x47')](_0x34d905,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x50130d,_0x1de544,_0x5c701a){return function(_0x1c1cb5){utils[_0xa0f6('0x6b')](_0x1de544,_0x5c701a,0x0);_0x1de544[_0xa0f6('0x6c')]=0x0;logger['error'](_0x50130d,util[_0xa0f6('0x47')](_0x1c1cb5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x37ecbe){return function(_0x21ebd5){if(isNotNull(_0x21ebd5)&&isNotNull(_0x21ebd5[0x0])){if(_0x21ebd5[0x0][_0xa0f6('0x6d')]>0x0){_0x37ecbe[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')]['CONTACTS_RESCHEDULED'];logger['info']('[getContactDialer2][ReScheduled]'+_0x37ecbe[_0xa0f6('0x49')],_0x21ebd5[0x0][_0xa0f6('0x6d')],_0xa0f6('0x70'));}else{_0x37ecbe[_0xa0f6('0x6e')]=utils['CAMPAIGN_STATUS'][_0xa0f6('0x71')];logger[_0xa0f6('0x4b')](_0xa0f6('0x72')+_0x37ecbe['name']);}}};}function createObjHistory(_0x37a671,_0x38cbd1,_0xe3ce54,_0x2816c5,_0x474374){_0x37a671['message']=_0xe3ce54;var _0xfe5dbd=new Action(_0x37a671,_0x38cbd1);var _0x2bb959=new History(_0xfe5dbd);_0x2bb959[_0xa0f6('0x73')]=_0x2816c5;_0x2bb959[_0xa0f6('0x74')]=_0x474374;_0x2bb959[_0xa0f6('0x75')]=_0xfe5dbd[_0xa0f6('0x76')];return _0x2bb959;}function unlockQueueStatus(_0x17a050,_0x57d6ad){setTimeout(function(){if(_[_0xa0f6('0x43')](_0x17a050['queueStatusComplete'])){loggerBooked[_0xa0f6('0x69')]('[unlockQueueStatus][undefined]',_0x57d6ad);}_0x17a050[_0xa0f6('0x77')]=!![];loggerBooked[_0xa0f6('0x4b')]('[booked][unlockQueueStatus]',_0x57d6ad,JSON[_0xa0f6('0x78')](_['pick'](_0x17a050,[_0xa0f6('0x49'),_0xa0f6('0x77')])));},0x1f3);}function checkInterval(_0x5dc1fe){return function(){if(!isNotNull(_0x5dc1fe[_0xa0f6('0x79')])){_0x5dc1fe['message']=utils['CAMPAIGN_STATUS'][_0xa0f6('0x7a')];throw _0x5dc1fe['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x5dc1fe[_0xa0f6('0x79')][_0xa0f6('0x7b')])){_0x5dc1fe[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')][_0xa0f6('0x7a')];throw _0x5dc1fe[_0xa0f6('0x49')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xa0f6('0x7c')](_0x5dc1fe[_0xa0f6('0x79')][_0xa0f6('0x7b')]))){_0x5dc1fe['message']=utils[_0xa0f6('0x6f')]['NULL_INTERVAL'];throw _0x5dc1fe[_0xa0f6('0x49')]+_0xa0f6('0x7d');}};}function checkIsIVRCampaignActive(_0x25063d){return function(){if(!utils[_0xa0f6('0x7e')](_0x25063d)){_0x25063d[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')][_0xa0f6('0x7f')];throw _0x25063d[_0xa0f6('0x49')]+_0xa0f6('0x80');}};}function emitCampaignSummary(_0x42288a){if(utils['isIVRCampaign'](_0x42288a)){emit(util['format']('campaign:ivr:%s',_0x42288a[_0xa0f6('0x49')]),'campaign:save',_0x42288a);}}function loggerCatchQueueSummary(_0x32d359,_0x1dd504){return function(_0x539557){clearPredictiveAttributes(_0x1dd504);emitCampaignSummary(_0x1dd504);loggerSyncQueueSummary['debug'](_0x32d359,util['inspect'](_0x539557,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x19730d){if(_0x19730d['sendMessageOneNotActive']){if(_0x19730d[_0xa0f6('0x81')]===0x0){_0x19730d[_0xa0f6('0x82')]=![];_0x19730d[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')][_0xa0f6('0x7f')];loggerSyncQueueSummary[_0xa0f6('0x65')](_0xa0f6('0x83'),_0x19730d[_0xa0f6('0x49')],_0xa0f6('0x84'));}else{_0x19730d[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')]['DISACTIVED'];loggerSyncQueueSummary[_0xa0f6('0x65')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x19730d['name'],_0xa0f6('0x85'));}emitCampaignSummary(_0x19730d);}}function myreject(_0x4cb589){return function(_0x2405f6){return _0x4cb589(msgResponse(_0xa0f6('0x86'),'Error',JSON[_0xa0f6('0x78')](_0x2405f6)));};}Dialer[_0xa0f6('0x17')][_0xa0f6('0x87')]=function(_0x1b71ca){return!_[_0xa0f6('0x43')](_0x1b71ca)&&_0x1b71ca&&!_[_0xa0f6('0x43')](_0x1b71ca[_0xa0f6('0x49')])&&!_[_0xa0f6('0x43')](_0x1b71ca[_0xa0f6('0x88')])&&_0x1b71ca[_0xa0f6('0x88')]&&(this['trunks'][util[_0xa0f6('0x48')](_0xa0f6('0x89'),_0x1b71ca[_0xa0f6('0x49')])][_0xa0f6('0x8a')]==='reachable'||this['trunks'][util['format'](_0xa0f6('0x89'),_0x1b71ca[_0xa0f6('0x49')])][_0xa0f6('0x8a')]===_0xa0f6('0x8b'));};Dialer[_0xa0f6('0x17')][_0xa0f6('0x8c')]=function(_0x342ee6){var _0x44d1ef=this;return function(){if(!_0x44d1ef[_0xa0f6('0x87')](_0x342ee6[_0xa0f6('0x8d')])){if(!_0x44d1ef[_0xa0f6('0x87')](_0x342ee6[_0xa0f6('0x8e')])){_0x342ee6[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')][_0xa0f6('0x8f')];throw _0x342ee6[_0xa0f6('0x49')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xa0f6('0x17')][_0xa0f6('0x90')]=function(_0x59f42b,_0x344491,_0x56fca5,_0x2aea65){var _0x55bb36=this;return function(){var _0x229fd3=!![];return _0x55bb36['ifTimeIvr'](_0x59f42b,_0x344491,_0x56fca5,_0x2aea65,_0x229fd3);};};Dialer[_0xa0f6('0x17')][_0xa0f6('0x91')]=function(_0x58b15a,_0x3859ee,_0x36c39b,_0x5331a5){var _0x2c68cb=this;return function(){var _0x24a766=![];return _0x2c68cb['ifTimeIvr'](_0x58b15a[_0xa0f6('0x7b')],_0x3859ee,_0x36c39b,_0x5331a5,_0x24a766);};};Dialer[_0xa0f6('0x17')][_0xa0f6('0x92')]=function(_0x13fbb3,_0x593a52,_0xf43786,_0x4007c1,_0x58d120){var _0x50a65d=[];return new Promise(function(_0x27bef7,_0x736960){if(!isNotNull(_0x13fbb3)){_0x4007c1[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')][_0xa0f6('0x7a')];return _0x736960(msgResponse(_0xa0f6('0x93'),_0xa0f6('0x94'),_0xf43786+_0xa0f6('0x95')));}if(_[_0xa0f6('0x7c')](_0x13fbb3)){_0x4007c1[_0xa0f6('0x6e')]=utils['CAMPAIGN_STATUS'][_0xa0f6('0x96')];return _0x736960(msgResponse(_0xa0f6('0x93'),_0xa0f6('0x94'),_0xf43786+_0xa0f6('0x97')));}if(_0x593a52&&_[_0xa0f6('0x43')](config['timezones'][_0x593a52])){_0x4007c1[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')]['UNKNOWN_TIMEZONE'];return _0x736960(msgResponse(_0xa0f6('0x93'),_0xa0f6('0x94'),_0xf43786+_0xa0f6('0x98')+_0x593a52));}if(_[_0xa0f6('0x99')](_0x13fbb3)){for(var _0x361aff=0x0;_0x361aff<_0x13fbb3['length'];_0x361aff+=0x1){_0x50a65d[_0xa0f6('0x9a')](ami[_0xa0f6('0x9b')]({'action':_0xa0f6('0x9c'),'command':util[_0xa0f6('0x48')](_0xa0f6('0x9d'),_0x13fbb3[_0x361aff][_0xa0f6('0x9e')],!_['isUndefined'](config['timezones'][_0x593a52])?_0x593a52:'')})[_0xa0f6('0x41')](function(_0x3a5612){return _0x3a5612['content'][_0xa0f6('0x9f')](_0xa0f6('0xa0'))>=0x0;})[_0xa0f6('0xa1')](myreject(_0x736960)));}}else{_0x50a65d[_0xa0f6('0x9a')](ami['Action']({'action':_0xa0f6('0x9c'),'command':util['format'](_0xa0f6('0x9d'),_0x13fbb3,!_['isUndefined'](config[_0xa0f6('0xa2')][_0x593a52])?_0x593a52:'')})[_0xa0f6('0x41')](function(_0x5d3774){return _0x5d3774[_0xa0f6('0xa3')][_0xa0f6('0x9f')](_0xa0f6('0xa0'))>=0x0;})[_0xa0f6('0xa1')](myreject(_0x736960)));}Promise[_0xa0f6('0xa4')](_0x50a65d)[_0xa0f6('0x41')](function(_0x27c8da){var _0x354cb9=_['some'](_0x27c8da);if(_0x354cb9){return _0x27bef7(_0x354cb9);}else{_0x4007c1[_0xa0f6('0x6e')]=_0x58d120?utils[_0xa0f6('0x6f')][_0xa0f6('0xa5')]:utils[_0xa0f6('0x6f')]['OVERTIME_INTERVAL'];return _0x736960(msgResponse(_0xa0f6('0xa6'),_0xa0f6('0x94'),'Global:\x20'+_0x58d120+'\x20'+_0xf43786+_0xa0f6('0xa7')+util[_0xa0f6('0x47')](_0x13fbb3,{'showHidden':![],'depth':null})+_0xa0f6('0xa8')+_0x593a52));}})['catch'](function(_0x143be2){return _0x736960(msgResponse(_0xa0f6('0x93'),'Failure',JSON[_0xa0f6('0x78')](_0x143be2)));});});};Dialer[_0xa0f6('0x17')][_0xa0f6('0x3e')]=function(){var _0x46e79d=this;return cmHopper[_0xa0f6('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0xa0f6('0x41')](function(){setInterval(function(){_0x46e79d[_0xa0f6('0xaa')]();},0x3e8);});};Dialer[_0xa0f6('0x17')][_0xa0f6('0xaa')]=function(){var _0x9b04fc=this;var _0x3bfc1c;for(var _0x12916e in this[_0xa0f6('0x1d')]){if(typeof this[_0xa0f6('0x1d')][_0x12916e]!=='undefined'){_0x3bfc1c=this[_0xa0f6('0x1d')][_0x12916e];if(utils[_0xa0f6('0xab')](_0x3bfc1c)&&utils['isIVRCampaignActive'](_0x3bfc1c)){_0x3bfc1c[_0xa0f6('0x82')]=!![];Promise['resolve']()[_0xa0f6('0x41')](checkIsIVRCampaignActive(_0x3bfc1c))[_0xa0f6('0x41')](checkInterval(_0x3bfc1c))[_0xa0f6('0x41')](_0x9b04fc[_0xa0f6('0x8c')](_0x3bfc1c))[_0xa0f6('0x41')](_0x9b04fc[_0xa0f6('0x90')](_0x3bfc1c[_0xa0f6('0xac')],_0x3bfc1c['dialTimezone'],_0x3bfc1c[_0xa0f6('0x49')],_0x3bfc1c))['then'](_0x9b04fc[_0xa0f6('0x91')](_0x3bfc1c[_0xa0f6('0x79')],_0x3bfc1c[_0xa0f6('0xad')],_0x3bfc1c[_0xa0f6('0x49')],_0x3bfc1c))[_0xa0f6('0x41')](_0x9b04fc[_0xa0f6('0xae')](_0x3bfc1c))['catch'](loggerCatchQueueSummary(_0xa0f6('0xaf'),_0x3bfc1c));}else{notSendMessagesCampaign(_0x3bfc1c);}}}};Dialer[_0xa0f6('0x17')][_0xa0f6('0xb0')]=function(_0x19a57b){if(_0x19a57b[_0xa0f6('0xb1')]!==_0xa0f6('0x7')){clearPredictiveAttributes(_0x19a57b);}switch(_0x19a57b['dialMethod']){case _0xa0f6('0xb2'):this[_0xa0f6('0xb3')](_0x19a57b,0x1);break;case _0xa0f6('0xb4'):this['handlePower'](_0x19a57b,_0x19a57b[_0xa0f6('0xb5')]);break;case'predictive':this[_0xa0f6('0x7')](_0x19a57b);break;case _0xa0f6('0x6'):this[_0xa0f6('0xb3')](_0x19a57b,0x1);break;default:logger[_0xa0f6('0x69')]('Queue',_0x19a57b[_0xa0f6('0x49')],'method\x20not\x20recognized');}};Dialer[_0xa0f6('0x17')][_0xa0f6('0x93')]=function(_0xfc5882,_0x3f262d){var _0x1c4bb8=_0xfc5882['dialTimezone'];var _0x4612b0=_0x3f262d?_0xfc5882[_0xa0f6('0xac')]:_0xfc5882[_0xa0f6('0x79')][_0xa0f6('0x7b')];logger['silly'](_0xa0f6('0xb6'),_0x4612b0,_0x1c4bb8,_0xfc5882[_0xa0f6('0x49')],util[_0xa0f6('0x48')]('Voice\x20Queue\x20%s\x20$s',_0xfc5882[_0xa0f6('0x49')],_0xfc5882['id']));var _0x4a3e97=null;return Interval[_0xa0f6('0xb7')](_0x4612b0,_0x1c4bb8)['then'](function(_0xf5c0f7){if(_0xf5c0f7===!![]){return _0xf5c0f7;}else{_0xfc5882[_0xa0f6('0x6e')]=_0x3f262d?utils[_0xa0f6('0x6f')][_0xa0f6('0xa5')]:utils['CAMPAIGN_STATUS'][_0xa0f6('0xb8')];_0x4a3e97=msgResponse(_0xa0f6('0xa6'),_0xa0f6('0x94'),'Global:\x20'+_0x3f262d+'\x20'+_0xfc5882[_0xa0f6('0x49')]+_0xa0f6('0xa7')+util[_0xa0f6('0x47')](_0x4612b0,{'showHidden':![],'depth':null})+_0xa0f6('0xa8')+_0x1c4bb8);}if(_0x4a3e97!==null){logger[_0xa0f6('0xb9')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4a3e97);_0x4a3e97[_0xa0f6('0xba')]=_0x3f262d;throw _0x4a3e97;}})['catch'](function(_0x415c34){logger[_0xa0f6('0x69')](_0xa0f6('0xbb'),_0x415c34);throw msgResponse(_0xa0f6('0x86'),_0xa0f6('0xbc'),util[_0xa0f6('0x47')](_0x415c34,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xa0f6('0x2b')]=function(_0x236a94){if(this[_0xa0f6('0x1c')][_0x236a94['queue']]){if(this[_0xa0f6('0x23')][_0x236a94['uniqueid']]&&this[_0xa0f6('0x23')][_0x236a94[_0xa0f6('0xbd')]]['type']!==_0xa0f6('0xbe')){this[_0xa0f6('0xbf')](this['voiceQueues'][_0x236a94['queue']]);this[_0xa0f6('0x23')][_0x236a94[_0xa0f6('0xbd')]][_0xa0f6('0xc0')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xa0f6('0x32')]=function(_0x375ed3){var _0x9f882e=this['uniqueId'][_0x375ed3[_0xa0f6('0xbd')]];if(this['voiceQueues'][_0x375ed3[_0xa0f6('0xc1')]]){if(_0x9f882e&&_0x9f882e[_0xa0f6('0x45')]!==_0xa0f6('0xbe')){delete this['uniqueId'][_0x375ed3['uniqueid']];this['voiceQueues'][_0x375ed3[_0xa0f6('0xc1')]][_0xa0f6('0xc2')]+=0x1;var _0x2d933e=new AgentComplete(_0x9f882e,_0x375ed3);if(_0x375ed3[_0xa0f6('0xc3')]===_0xa0f6('0xc4')){_0x2d933e['agiafterat']=this[_0xa0f6('0x1c')][_0x375ed3[_0xa0f6('0xc1')]][_0xa0f6('0xc5')]&&this[_0xa0f6('0x1c')][_0x375ed3[_0xa0f6('0xc1')]][_0xa0f6('0xc6')]?moment()['format'](_0xa0f6('0xc7')):undefined;}hopperUtils[_0xa0f6('0xc8')](_0x2d933e)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0xc9')));hopperUtils[_0xa0f6('0xca')](_0x2d933e)[_0xa0f6('0xa1')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0xa0f6('0x2e')]=function(_0x4d0e23){var _0x4939e2=this['uniqueId'][_0x4d0e23[_0xa0f6('0xbd')]];var _0x279981=this;var _0x566e91=![];var _0x28c90b;var _0x28607b;if(this[_0xa0f6('0x1c')][_0x4d0e23['queue']]){if(_0x4939e2&&_0x4939e2['type']!==_0xa0f6('0xbe')){delete this[_0xa0f6('0x23')][_0x4d0e23[_0xa0f6('0xbd')]];this[_0xa0f6('0xbf')](this[_0xa0f6('0x1c')][_0x4d0e23['queue']]);_0x4939e2[_0xa0f6('0xcb')]=moment()['format'](_0xa0f6('0xc7'));var _0x155107=new QueueCallerAbandon(_0x4939e2,_0x4d0e23);if(utils[_0xa0f6('0x64')](_0x4939e2[_0xa0f6('0xcb')],_0x4939e2[_0xa0f6('0xcc')])>=_0x4939e2[_0xa0f6('0xcd')]){this[_0xa0f6('0x1c')][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0x50')]+=0x1;this['voiceQueues'][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0xce')]+=0x1;this[_0xa0f6('0x1c')][_0x4d0e23['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x155107[_0xa0f6('0x73')]=0xa;_0x155107[_0xa0f6('0x74')]=_0xa0f6('0xcf');_0x155107['dropreason']=_0xa0f6('0xd0');_0x155107[_0xa0f6('0xd1')]=this['voiceQueues'][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0xc5')]?moment()['format'](_0xa0f6('0xc7')):undefined;_0x155107[_0xa0f6('0xd2')]+=0x1;_0x155107[_0xa0f6('0xd3')]+=0x1;_0x28c90b=this[_0xa0f6('0x1c')][_0x4d0e23[_0xa0f6('0xc1')]]['dialDropRetryFrequency'];_0x28607b=this[_0xa0f6('0x1c')][_0x4d0e23['queue']][_0xa0f6('0xd4')];hopperUtils[_0xa0f6('0xd5')](_0x155107,_0x155107[_0xa0f6('0x73')],_0x4939e2['voiceQueue'])[_0xa0f6('0x41')](function(_0xed053d){_0x566e91=_0xed053d[_0xa0f6('0xd6')]==0x1;if(_0x155107[_0xa0f6('0xd2')]>=_0x279981[_0xa0f6('0x1c')][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0xd7')]){_0x279981['queueCallerAbandonCreateState'](_0x155107,_0xed053d[_0xa0f6('0xd6')]);}else{hopperUtils[_0xa0f6('0xd8')]({'active':![],'countdropretry':_0x155107[_0xa0f6('0xd2')],'scheduledat':moment()[_0xa0f6('0xd9')](_0x279981[_0xa0f6('0x1c')][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0xda')],_0xa0f6('0xdb'))[_0xa0f6('0x48')](_0xa0f6('0xc7')),'ContactId':_0x4939e2[_0xa0f6('0xdc')],'ListId':_0x4939e2[_0xa0f6('0xdd')],'VoiceQueueId':_0x4939e2['VoiceQueueId']||undefined,'CampaignId':_0x4939e2['CampaignId']||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0xde')));var _0x1861a5=new History(_0x155107);_0x1861a5[_0xa0f6('0x73')]=0xa;_0x1861a5[_0xa0f6('0x74')]=_0xa0f6('0xcf');_0x1861a5[_0xa0f6('0x76')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1861a5['endtime']=_0x1861a5[_0xa0f6('0x76')];_0x1861a5[_0xa0f6('0xdf')]=_0x155107[_0xa0f6('0xdf')];_0x1861a5[_0xa0f6('0xe0')]=_0x155107[_0xa0f6('0xe0')];hopperUtils['createHistory'](_0x1861a5)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0xe1')));}})[_0xa0f6('0x41')](function(){if(_0x566e91)hopperUtils['swapAdditionalPhones'](_0x155107,_0x28c90b,_0x28607b)[_0xa0f6('0x41')](function(){return 0x1;});});}else{this[_0xa0f6('0x1c')][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0x52')]+=0x1;this[_0xa0f6('0x1c')][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0xe2')]+=0x1;_0x155107[_0xa0f6('0x73')]=0xb;_0x155107[_0xa0f6('0x74')]='Abandoned';_0x155107[_0xa0f6('0xe3')]=_0xa0f6('0xe4');_0x155107['countabandonedretry']+=0x1;_0x155107[_0xa0f6('0xd3')]+=0x1;_0x28c90b=this[_0xa0f6('0x1c')][_0x4d0e23['queue']][_0xa0f6('0xe5')];_0x28607b=this[_0xa0f6('0x1c')][_0x4d0e23['queue']]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x155107,_0x155107[_0xa0f6('0x73')],_0x4939e2['voiceQueue'])[_0xa0f6('0x41')](function(_0x163943){if(_0x155107[_0xa0f6('0xe6')]>=_0x279981[_0xa0f6('0x1c')][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0xe7')]){_0x279981[_0xa0f6('0xe8')](_0x155107,_0x163943[_0xa0f6('0xd6')]);}else{hopperUtils[_0xa0f6('0xd8')]({'active':![],'countabandonedretry':_0x155107['countabandonedretry'],'scheduledat':moment()[_0xa0f6('0xd9')](_0x279981['voiceQueues'][_0x4d0e23[_0xa0f6('0xc1')]][_0xa0f6('0xe5')],_0xa0f6('0xdb'))[_0xa0f6('0x48')](_0xa0f6('0xc7')),'ContactId':_0x4939e2[_0xa0f6('0xdc')],'ListId':_0x4939e2[_0xa0f6('0xdd')],'VoiceQueueId':_0x4939e2[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x4939e2[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0xeb')));var _0xcd190b=new History(_0x155107);_0xcd190b[_0xa0f6('0x73')]=0xb;_0xcd190b[_0xa0f6('0x74')]=_0xa0f6('0xec');_0xcd190b['starttime']=moment()[_0xa0f6('0x48')](_0xa0f6('0xc7'));_0xcd190b[_0xa0f6('0x75')]=_0xcd190b[_0xa0f6('0x76')];_0xcd190b[_0xa0f6('0xdf')]=_0x155107['calleridname'];_0xcd190b[_0xa0f6('0xe0')]=_0x155107[_0xa0f6('0xe0')];hopperUtils['createHistory'](_0xcd190b)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0xed')));}})['then'](function(){if(_0x566e91)hopperUtils[_0xa0f6('0xee')](_0x155107,_0x28c90b,_0x28607b)[_0xa0f6('0x41')](function(){return 0x1;});});}}}};Dialer['prototype'][_0xa0f6('0x39')]=function(_0x4fa098){if(this[_0xa0f6('0x22')][_0x4fa098[_0xa0f6('0xbd')]]){this['actions'][_0x4fa098[_0xa0f6('0xbd')]][_0xa0f6('0xef')]=_0x4fa098[_0xa0f6('0xef')];}if(this[_0xa0f6('0x23')][_0x4fa098[_0xa0f6('0xbd')]]){this[_0xa0f6('0x23')][_0x4fa098[_0xa0f6('0xbd')]]['channel']=_0x4fa098['channel'];}};Dialer['prototype'][_0xa0f6('0x3c')]=function(_0xf40e15){if(!this['actions'][_0xf40e15[_0xa0f6('0xf0')]]){return;}var _0x30e90f=this[_0xa0f6('0x1c')][this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]][_0xa0f6('0xf1')]||_0xa0f6('0xf2');if(_0x30e90f===_0xa0f6('0xf3')){if(this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]]&&_[_0xa0f6('0xf4')](this[_0xa0f6('0x22')][_0xf40e15['actionid']][_0xa0f6('0xf5')])&&_0xf40e15[_0xa0f6('0x8a')]==='1'&&_0xf40e15[_0xa0f6('0xf6')]==='0'){if(this[_0xa0f6('0x1e')][_0xf40e15[_0xa0f6('0xf7')]]){if(!this[_0xa0f6('0x1e')][_0xf40e15['stateinterface']]['locked']){this['agents'][_0xf40e15[_0xa0f6('0xf7')]][_0xa0f6('0xf5')]=!![];this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]]['locked']=!![];this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]][_0xa0f6('0xf7')]=_0xf40e15[_0xa0f6('0xf7')];}}}}else if(_0x30e90f===_0xa0f6('0xf2')){if(this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]]){if(this[_0xa0f6('0x1e')][_0xf40e15['stateinterface']]){this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]]['stateinterface']=_0xf40e15['stateinterface'];if(_[_0xa0f6('0xf4')](this[_0xa0f6('0x27')][this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]])){this[_0xa0f6('0x27')][this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]]=[];}this['queueBooked'][this[_0xa0f6('0x22')][_0xf40e15[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]][_0xa0f6('0x9a')](_[_0xa0f6('0x63')](_[_0xa0f6('0xf8')](this[_0xa0f6('0x22')][_0xf40e15['actionid']],[_0xa0f6('0xf9'),_0xa0f6('0xf7')]),{'status':_0xf40e15[_0xa0f6('0x8a')],'paused':_0xf40e15['paused']}));}}}};Dialer[_0xa0f6('0x17')][_0xa0f6('0x3d')]=function(_0x5637be){if(!this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]]){return;}var _0x4f8b7f=this;var _0x5c6057=this['voiceQueues'][this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]];var _0x5889df=_0x5c6057['strategy']||'rrmemory';if(_0x5889df===_0xa0f6('0xf3')){if(this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]]&&this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xf7')]){this[_0xa0f6('0x1b')]['run'](this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]]['idHopper'],this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]]['stateinterface'])[_0xa0f6('0xa1')](function(_0x4a32e6){logger[_0xa0f6('0x69')](_0xa0f6('0xfa'),util[_0xa0f6('0x47')](_0x4a32e6,{'showHidden':![],'depth':null}));})[_0xa0f6('0x19')](function(){_0x4f8b7f[_0xa0f6('0xbf')](_0x4f8b7f[_0xa0f6('0x1c')][_0x4f8b7f['actions'][_0x5637be['actionid']][_0xa0f6('0xc1')]]);_0x4f8b7f[_0xa0f6('0x1e')][_0x4f8b7f[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xf7')]][_0xa0f6('0xf5')]=![];delete _0x4f8b7f[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]];unlockQueueStatus(_0x5c6057);});}else{this['updateOriginated'](this[_0xa0f6('0x1c')][this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]]);hopperUtils[_0xa0f6('0xd8')]({'active':![],'ContactId':this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xdc')],'ListId':this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]]['ListId'],'VoiceQueueId':this[_0xa0f6('0x22')][_0x5637be['actionid']][_0xa0f6('0xe9')]||undefined,'CampaignId':this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0xfb')));delete this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]];unlockQueueStatus(_0x5c6057);}}else if(_0x5889df==='rrmemory'){var _0xe9a6fb;if(this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]]&&!_[_0xa0f6('0x7c')](this[_0xa0f6('0x27')][this['actions'][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]])){if(this[_0xa0f6('0x28')][_0x4f8b7f['actions'][_0x5637be[_0xa0f6('0xf0')]]['queue']]){this[_0xa0f6('0x28')][_0x4f8b7f[_0xa0f6('0x22')][_0x5637be['actionid']][_0xa0f6('0xc1')]]=this[_0xa0f6('0x28')][this['actions'][_0x5637be[_0xa0f6('0xf0')]]['queue']]?this[_0xa0f6('0x28')][this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]]:this['queueBooked'][this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]]?this[_0xa0f6('0x27')][this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]][_0xa0f6('0xfc')]||0x0:0x0;}this[_0xa0f6('0x27')][this['actions'][_0x5637be['actionid']][_0xa0f6('0xc1')]][_0xa0f6('0xfc')]=this[_0xa0f6('0x28')][this[_0xa0f6('0x22')][_0x5637be[_0xa0f6('0xf0')]][_0xa0f6('0xc1')]];for(var _0xb2c94a=0x0;_0xb2c94a=_0x2aa799[_0xa0f6('0x11e')]){_0x396e4b['stateGlobal'](_0x491bc9,_0x14cf75,_0x11a6ed,_0xa0f6('0x11f'));}else{if(_0x491bc9[_0xa0f6('0x118')]>=_0x2aa799[_0xa0f6('0x120')]){_0x396e4b[_0xa0f6('0x121')](_0x491bc9,_0x14cf75,_0x11a6ed,_0xa0f6('0x122'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x491bc9[_0xa0f6('0x118')],'scheduledat':moment()[_0xa0f6('0xd9')](_0x2aa799[_0xa0f6('0x123')],'minutes')['format'](_0xa0f6('0xc7')),'ContactId':_0x491bc9[_0xa0f6('0xdc')],'ListId':_0x491bc9[_0xa0f6('0xdd')],'VoiceQueueId':_0x491bc9[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x491bc9[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x14cf75({'reschedule':0x1});}}});}if(_0x3d0256[_0xa0f6('0x45')]===_0xa0f6('0xbe')&&this[_0xa0f6('0x1d')][_0x3d0256['queue']][_0xa0f6('0x10f')]&&_0x1f3189[_0xa0f6('0x110')]===_0xa0f6('0x124')){delete this[_0xa0f6('0x23')][_0x1f3189[_0xa0f6('0xbd')]];this[_0xa0f6('0xbf')](this[_0xa0f6('0x1d')][_0x3d0256[_0xa0f6('0xc1')]]);_0xfc631e=new Hangup(_0x3d0256,_0x1f3189);_0xfc631e[_0xa0f6('0x73')]=0x12;_0xfc631e[_0xa0f6('0x74')]=_0xa0f6('0x112');_0xfc631e['membername']=_0xa0f6('0x125');ami[_0xa0f6('0x44')](_0xa0f6('0x11a'),ut['buildObj'](_0xfc631e,_0xa0f6('0x119')));this[_0xa0f6('0x115')](_0xfc631e,_0xa0f6('0x126'),_0xa0f6('0x127'));}if(_0x3d0256[_0xa0f6('0x45')]===_0xa0f6('0xbe')&&this[_0xa0f6('0x1d')][_0x3d0256['queue']]['dialAMDActive']&&_0x1f3189[_0xa0f6('0x110')]===_0xa0f6('0x128')){return new Promise(function(_0x255f8a,_0x5ebebd){delete _0x396e4b[_0xa0f6('0x23')][_0x1f3189[_0xa0f6('0xbd')]];_0x396e4b['updateOriginated'](_0x396e4b['campaigns'][_0x3d0256[_0xa0f6('0xc1')]]);_0x396e4b[_0xa0f6('0x1d')][_0x3d0256['queue']][_0xa0f6('0xc2')]+=0x1;_0x396e4b['campaigns'][_0x3d0256['queue']][_0xa0f6('0x111')]+=0x1;var _0x1f1d85=_0x396e4b[_0xa0f6('0x1d')][_0x3d0256[_0xa0f6('0xc1')]];var _0x12e1c9=new Hangup(_0x3d0256,_0x1f3189);_0x12e1c9[_0xa0f6('0x73')]=0x13;_0x12e1c9[_0xa0f6('0x74')]=_0xa0f6('0x117');_0x12e1c9[_0xa0f6('0x113')]=_0xa0f6('0x125');_0x12e1c9['countmachineretry']+=0x1;_0x12e1c9[_0xa0f6('0xd3')]+=0x1;_0x12e1c9[_0xa0f6('0x119')]=!![];ami[_0xa0f6('0x44')](_0xa0f6('0x11a'),ut['buildObj'](_0x12e1c9,_0xa0f6('0x119')));hopperUtils[_0xa0f6('0xc8')](_0x12e1c9)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x11b')));if(_0x12e1c9[_0xa0f6('0x11c')]+_0x12e1c9[_0xa0f6('0x129')]+_0x12e1c9[_0xa0f6('0x11d')]+_0x12e1c9['countnosuchnumberretry']+_0x12e1c9[_0xa0f6('0xd2')]+_0x12e1c9['countabandonedretry']+_0x12e1c9['countmachineretry']+_0x12e1c9[_0xa0f6('0x12a')]>=_0x1f1d85[_0xa0f6('0x11e')]){_0x396e4b['stateGlobal'](_0x12e1c9,_0x255f8a,_0x5ebebd,'reason19\x20machine....');}else{if(_0x12e1c9[_0xa0f6('0x118')]>=_0x1f1d85[_0xa0f6('0x120')]){_0x396e4b[_0xa0f6('0x121')](_0x12e1c9,_0x255f8a,_0x5ebebd,'reason\x2019\x20machine....');}else{hopperUtils[_0xa0f6('0xd8')]({'active':![],'countmachineretry':_0x12e1c9[_0xa0f6('0x118')],'scheduledat':moment()[_0xa0f6('0xd9')](_0x1f1d85[_0xa0f6('0x123')],'minutes')[_0xa0f6('0x48')](_0xa0f6('0xc7')),'ContactId':_0x12e1c9['ContactId'],'ListId':_0x12e1c9['ListId'],'VoiceQueueId':_0x12e1c9[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x12e1c9[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x12b')));_0x255f8a({'reschedule':0x1});}}});}}};Dialer[_0xa0f6('0x17')][_0xa0f6('0x12c')]=function(_0x892618){var _0x47e5bf=this['uniqueId'][_0x892618[_0xa0f6('0xbd')]];var _0x1d8390;if(_0x47e5bf&&_0x47e5bf['type']===_0xa0f6('0xbe')){delete this[_0xa0f6('0x23')][_0x892618[_0xa0f6('0xbd')]];this[_0xa0f6('0xbf')](this[_0xa0f6('0x1d')][_0x47e5bf[_0xa0f6('0xc1')]]);this[_0xa0f6('0x1d')][_0x47e5bf['queue']][_0xa0f6('0x12d')]+=0x1;_0x1d8390=new Hangup(_0x47e5bf,_0x892618);hopperUtils[_0xa0f6('0xc8')](_0x1d8390)[_0xa0f6('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa0f6('0xca')](_0x1d8390)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x47e5bf&&_0x47e5bf['type']!==_0xa0f6('0xbe')&&isNotNull(this[_0xa0f6('0x1c')][_0x47e5bf[_0xa0f6('0xc1')]]['dialQueueProject'])){delete this['uniqueId'][_0x892618[_0xa0f6('0xbd')]];this[_0xa0f6('0xbf')](this[_0xa0f6('0x1c')][_0x47e5bf[_0xa0f6('0xc1')]]);this[_0xa0f6('0x1c')][_0x47e5bf[_0xa0f6('0xc1')]][_0xa0f6('0xc2')]+=0x1;this[_0xa0f6('0x1c')][_0x47e5bf['queue']][_0xa0f6('0x111')]+=0x1;_0x1d8390=new Hangup(_0x47e5bf,_0x892618);_0x1d8390['state']=0x10;_0x1d8390[_0xa0f6('0x74')]='AnswerAGI';_0x1d8390[_0xa0f6('0x113')]=_0xa0f6('0x12e');hopperUtils['createHistory'](_0x1d8390)['catch'](loggerCatch(_0xa0f6('0x12f')));hopperUtils[_0xa0f6('0xca')](_0x1d8390)[_0xa0f6('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x47e5bf&&_0x47e5bf[_0xa0f6('0x45')]!==_0xa0f6('0xbe')&&!isNotNull(this[_0xa0f6('0x1c')][_0x47e5bf[_0xa0f6('0xc1')]][_0xa0f6('0x130')])){delete this[_0xa0f6('0x23')][_0x892618[_0xa0f6('0xbd')]];this[_0xa0f6('0xbf')](this[_0xa0f6('0x1c')][_0x47e5bf[_0xa0f6('0xc1')]]);this['voiceQueues'][_0x47e5bf[_0xa0f6('0xc1')]][_0xa0f6('0x131')]+=0x1;_0x1d8390=new Hangup(_0x47e5bf,_0x892618);_0x1d8390['state']=0xc;_0x1d8390[_0xa0f6('0x74')]=_0x892618[_0xa0f6('0x132')];_0x1d8390['membername']=_0xa0f6('0x133');hopperUtils[_0xa0f6('0xc8')](_0x1d8390)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x12f')));hopperUtils['moveContactManagedDialer'](_0x1d8390)[_0xa0f6('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xa0f6('0x34')]=function(_0x5cf04d){var _0x4983a7=this;if(!_0x4983a7['queuesSummary'][_0x5cf04d['name']]){_0x4983a7[_0xa0f6('0x29')][_0x5cf04d[_0xa0f6('0x49')]]={'running':![]};}else if(_0x4983a7[_0xa0f6('0x29')][_0x5cf04d[_0xa0f6('0x49')]][_0xa0f6('0x134')]===!![]){return;}else if(_0x4983a7[_0xa0f6('0x29')][_0x5cf04d[_0xa0f6('0x49')]][_0xa0f6('0x134')]===![]){_0x4983a7[_0xa0f6('0x29')][_0x5cf04d[_0xa0f6('0x49')]][_0xa0f6('0x134')]=!![];}var _0x3a4671=_0x4983a7[_0xa0f6('0x1c')][_0x5cf04d['name']];var _0x1649d1=_0x3a4671[_0xa0f6('0x6e')]!==utils[_0xa0f6('0x6f')][_0xa0f6('0x7f')];var _0xba91aa=utils[_0xa0f6('0x135')](_0x3a4671);_0x3a4671[_0xa0f6('0x136')]=utils[_0xa0f6('0x137')](_0x3a4671,_0x4983a7['trunks']);Promise[_0xa0f6('0x138')]()[_0xa0f6('0x41')](function(){if(_0x3a4671[_0xa0f6('0x136')]===utils[_0xa0f6('0x6f')][_0xa0f6('0x7f')]){if(_0x1649d1){clearPredictiveAttributes(_0x3a4671);_0x5cf04d[_0xa0f6('0x25')]=undefined;_0x5cf04d['startProgressive']=undefined;}if(_0x3a4671['statusMessage']===utils['CAMPAIGN_STATUS'][_0xa0f6('0x7f')]){_0x5cf04d[_0xa0f6('0x139')]=0x0;_0x5cf04d[_0xa0f6('0xf6')]=0x0;_0x5cf04d['inUse']=0x0;_0x5cf04d['talking']=0x0;_0x5cf04d[_0xa0f6('0x13a')]=0x0;}}else if(_0x3a4671[_0xa0f6('0x136')]===utils[_0xa0f6('0x6f')][_0xa0f6('0x13b')]&&!_0xba91aa){return _0x4983a7[_0xa0f6('0x93')](_0x3a4671,!![])[_0xa0f6('0x41')](function(){return _0x4983a7[_0xa0f6('0x93')](_0x3a4671,![]);})[_0xa0f6('0x41')](function(){return _0x4983a7['checkDialMethod'](_0x3a4671);})['catch'](function(_0x112bcc){loggerSyncQueueSummary[_0xa0f6('0x65')](_0xa0f6('0x13c'),util['inspect'](_0x112bcc,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3a4671);});}else{clearPredictiveAttributes(_0x3a4671);}})[_0xa0f6('0x41')](function(){var _0x48d8fc=_0x5cf04d[_0xa0f6('0x13d')](_0x3a4671);if(_0x48d8fc||_0x3a4671[_0xa0f6('0x13e')]){_0x3a4671[_0xa0f6('0x13e')]=![];_0x5cf04d[_0xa0f6('0x13f')](_0x3a4671);Object[_0xa0f6('0x140')](_0x3a4671,_0x5cf04d);emitOutboundVoiceQueueSummary(_0x5cf04d);}_0x4983a7[_0xa0f6('0x29')][_0x3a4671['name']][_0xa0f6('0x134')]=![];})[_0xa0f6('0xa1')](function(_0x743970){logger[_0xa0f6('0x69')]('[syncQueueSummary]',util[_0xa0f6('0x47')](_0x743970,{'showHidden':![],'depth':null}));_0x4983a7[_0xa0f6('0x29')][_0x3a4671[_0xa0f6('0x49')]][_0xa0f6('0x134')]=![];});};Dialer['prototype'][_0xa0f6('0x36')]=_[_0xa0f6('0x141')](function(){var _0x342546=_[_0xa0f6('0x142')](this[_0xa0f6('0x1c')],function(_0x2aad68){return _0x2aad68['dialPreviewRecallmeReminder'];});var _0x1fade2=_['filter'](this[_0xa0f6('0x1e')],function(_0x599974){return _0x599974[_0xa0f6('0x143')]&&_0x599974['status']===_0xa0f6('0x144');});if(_0x342546[_0xa0f6('0x145')]>0x0&&_0x1fade2['length']>0x0){return Promise[_0xa0f6('0x138')]()['then'](cmHopper[_0xa0f6('0x146')](_[_0xa0f6('0x147')](_0x342546,'id'),previewRecallmeReminderInterval,_[_0xa0f6('0x147')](_0x1fade2,'id')))[_0xa0f6('0x41')](function(_0x19a43b){for(var _0x31b38b=0x0;_0x31b38b<_0x19a43b['length'];_0x31b38b++){var _0x1710cc=_0x19a43b[_0x31b38b][_0xa0f6('0x148')][_0xa0f6('0x49')];if(_0x1710cc)io['to'](util[_0xa0f6('0x48')](_0xa0f6('0x149'),_0x1710cc))[_0xa0f6('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x19a43b[_0x31b38b]});}})[_0xa0f6('0xa1')](function(_0x261601){logger['error'](_0xa0f6('0x14a'),_0x261601);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa0f6('0x17')][_0xa0f6('0x3f')]=function(){var _0x4c499e=this;setInterval(function(){_0x4c499e['clearZombieChannels'](_0x4c499e['uniqueId'],_0xa0f6('0x14b'));_0x4c499e[_0xa0f6('0x14c')](_0x4c499e[_0xa0f6('0x22')],_0xa0f6('0x14d'));},0x32c8);};Dialer['prototype'][_0xa0f6('0x14c')]=function(_0x46af2f,_0x2c6ea4){var _0x29d5be=this;for(var _0x51732f in _0x46af2f){if(typeof _0x46af2f[_0x51732f]!=='undefined'){this[_0xa0f6('0x1a')][_0xa0f6('0x14e')](function(){if(!_[_0xa0f6('0xf4')](_0x46af2f[_0x51732f])){return ami[_0xa0f6('0x9b')]({'action':'status','channel':_0x46af2f[_0x51732f][_0xa0f6('0xef')]})['catch'](function(_0x4273){if(_0x4273[_0xa0f6('0x6e')]===_0xa0f6('0x14f')){setTimeout(function(){if(_0x46af2f[_0x51732f]&&_0x46af2f[_0x51732f]['type']!==_0xa0f6('0xbe')){_0x29d5be[_0xa0f6('0xbf')](_0x29d5be[_0xa0f6('0x1c')][_0x46af2f[_0x51732f][_0xa0f6('0xc1')]]);logger[_0xa0f6('0x69')](_0xa0f6('0x150'),_0x2c6ea4,_0x51732f,_0x46af2f[_0x51732f]['queue']);delete _0x46af2f[_0x51732f];}if(_0x46af2f[_0x51732f]&&_0x46af2f[_0x51732f][_0xa0f6('0x45')]===_0xa0f6('0xbe')){_0x29d5be[_0xa0f6('0xbf')](_0x29d5be[_0xa0f6('0x1d')][_0x46af2f[_0x51732f][_0xa0f6('0xc1')]]);logger[_0xa0f6('0x69')]('[Dialer][checkChannel][ivr]',_0x2c6ea4,_0x51732f,_0x46af2f[_0x51732f][_0xa0f6('0xc1')]);delete _0x46af2f[_0x51732f];}},0x2328);}});}});}}};Dialer[_0xa0f6('0x17')][_0xa0f6('0x151')]=function(_0x33049d){return Promise[_0xa0f6('0x138')]()[_0xa0f6('0x41')](voiceQueueRt[_0xa0f6('0x151')](_0x33049d))[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x152')));};Dialer['prototype']['updateOriginated']=function(_0x39efbc){if(!_[_0xa0f6('0x43')](_0x39efbc)&&_0x39efbc!==null){if(typeof _0x39efbc[_0xa0f6('0x81')]!==_0xa0f6('0x153')){if(_0x39efbc[_0xa0f6('0x81')]>0x0){_0x39efbc[_0xa0f6('0x81')]-=0x1;}else{logger[_0xa0f6('0x69')](_0xa0f6('0x154'));}}}else{logger[_0xa0f6('0x69')](_0xa0f6('0x155'));}};Dialer['prototype'][_0xa0f6('0x156')]=function(_0x3ef069,_0x334c36){var _0x1ebd7c=this;return function(_0x5227e){_0x1ebd7c['updateOriginated'](_0x334c36);logger[_0xa0f6('0x69')](_0x3ef069,util[_0xa0f6('0x47')](_0x5227e,{'showHidden':![],'depth':null}));};};Dialer[_0xa0f6('0x17')][_0xa0f6('0x157')]=function(_0x21c57e,_0x19779d,_0x22c5a1){var _0xe041ee={'state':0x19,'statedesc':_0xa0f6('0x158')};this[_0xa0f6('0xbf')](_0x19779d);this['saveInDb'](_[_0xa0f6('0x63')](_0xe041ee,_[_0xa0f6('0xf8')](_0x22c5a1,[_0xa0f6('0xdc'),_0xa0f6('0xdd'),_0xa0f6('0x159'),_0xa0f6('0xe9'),_0xa0f6('0xea')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0xa0f6('0x69')](_0x21c57e);};Dialer[_0xa0f6('0x17')]['saveInDb']=function(_0xd144d0,_0x287bee,_0x383ccb){hopperUtils['createHistory'](_0xd144d0)[_0xa0f6('0xa1')](loggerCatch(_0x287bee));hopperUtils['moveContactManagedDialer'](_0xd144d0)[_0xa0f6('0xa1')](loggerCatch(_0x383ccb));};Dialer[_0xa0f6('0x17')][_0xa0f6('0xe8')]=function(_0x19171c,_0x2dca8f){hopperUtils[_0xa0f6('0xc8')](_0x19171c)[_0xa0f6('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x2dca8f==0x0){hopperUtils['moveContactManagedDialer'](_0x19171c)['catch'](loggerCatch(_0xa0f6('0x15a')));}};Dialer[_0xa0f6('0x17')][_0xa0f6('0x14a')]=function(_0x36bd9c){return Promise[_0xa0f6('0x138')]()[_0xa0f6('0x41')](cmHopper[_0xa0f6('0x146')](_0x36bd9c['id'],previewRecallmeReminderInterval))[_0xa0f6('0x41')](function(_0x44aa0e){for(var _0x560d1e=0x0;_0x560d1e<_0x44aa0e['length'];_0x560d1e++){var _0x511d3c=_0x44aa0e[_0x560d1e][_0xa0f6('0x148')][_0xa0f6('0x49')];if(_0x511d3c)io['to'](util['format'](_0xa0f6('0x149'),_0x511d3c))[_0xa0f6('0x44')](_0xa0f6('0x15b'),{'hopper':_0x44aa0e[_0x560d1e]});}})[_0xa0f6('0xa1')](function(){});};Dialer[_0xa0f6('0x17')][_0xa0f6('0xae')]=function(_0xad79e6){var _0x41b687=this;return function(){_0x41b687[_0xa0f6('0x15c')](_0xad79e6);};};Dialer[_0xa0f6('0x17')][_0xa0f6('0x15d')]=function(_0x3e2fdd,_0x53baa9){var _0x55cdd0=this;var _0x35ee5b=uuid['v4']();this[_0xa0f6('0x22')][_0x35ee5b]=new Action(_0x3e2fdd,_0x53baa9,_0x35ee5b);return new Promise(function(_0xb2deb7,_0x34f452){if(_[_0xa0f6('0x43')](_0x3e2fdd)&&typeof _0x3e2fdd!==_0xa0f6('0x15e')){return _0x34f452(msgResponse(_0xa0f6('0x15f'),_0xa0f6('0x94'),_0xa0f6('0x160')));}if(_[_0xa0f6('0x43')](_0x53baa9[_0xa0f6('0x161')])||_0x53baa9[_0xa0f6('0x161')]===null){return _0x34f452(msgResponse(_0xa0f6('0x15f'),_0xa0f6('0x94'),'contact\x20is\x20undefine'));}var _0x45642c={'XMD-CALLERID':_0x55cdd0['actions'][_0x35ee5b][_0xa0f6('0x162')](),'XMD-AGI':_0x3e2fdd['dialQueueProject']?util['format'](_0xa0f6('0x163'),ipAgi,_0x3e2fdd[_0xa0f6('0x130')]):_0xa0f6('0x164'),'XMD-AGIAFTER':_0x3e2fdd['dialQueueProject2']?util[_0xa0f6('0x48')](_0xa0f6('0x163'),ipAgi,_0x3e2fdd[_0xa0f6('0xc5')]):_0xa0f6('0x164'),'XMD-QUEUE':utils[_0xa0f6('0x165')](_0x3e2fdd)?util[_0xa0f6('0x48')]('\x22%s,%s%s,,,%s\x22',_0x3e2fdd['name'],_0x3e2fdd[_0xa0f6('0x166')]||'',_0x3e2fdd[_0xa0f6('0xc6')]?'c':'',_0x3e2fdd[_0xa0f6('0xcd')]||0x3):'NONE','XMD-CONTACTID':_0x53baa9[_0xa0f6('0xdc')],'XMD-CDRTYPE':_0xa0f6('0x5'),'CALLERID(all)':_0x55cdd0['actions'][_0x35ee5b]['getCaller'](),'XMD-AMD':_0x3e2fdd[_0xa0f6('0x10f')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xa0f6('0x10e')};if(_0x3e2fdd['dialAMDActive']){_0x45642c[_0xa0f6('0x167')]=_0x3e2fdd[_0xa0f6('0x168')]||0x9c4;_0x45642c[_0xa0f6('0x169')]=_0x3e2fdd[_0xa0f6('0x16a')]||0x5dc;_0x45642c[_0xa0f6('0x16b')]=_0x3e2fdd[_0xa0f6('0x16c')]||0x320;_0x45642c[_0xa0f6('0x16d')]=_0x3e2fdd['dialAMDTotalAnalysisTime']||0x1388;_0x45642c['XMD-AMDMINWORDLENGTH']=_0x3e2fdd[_0xa0f6('0x16e')]||0x64;_0x45642c[_0xa0f6('0x16f')]=_0x3e2fdd[_0xa0f6('0x170')]||0x32;_0x45642c[_0xa0f6('0x171')]=_0x3e2fdd['dialAMDMaximumNumberOfWords']||0x3;_0x45642c[_0xa0f6('0x172')]=_0x3e2fdd[_0xa0f6('0x173')]||0x100;_0x45642c[_0xa0f6('0x174')]=_0x3e2fdd[_0xa0f6('0x175')]||0x1388;}if(utils['isOutboundQueue'](_0x3e2fdd)){_0x45642c['XMD-VOICEQUEUEID']=_0x53baa9[_0xa0f6('0xe9')];}else{_0x45642c[_0xa0f6('0x176')]=_0x53baa9['CampaignId'];}var _0x3726dc=utils[_0xa0f6('0x177')](_0x53baa9[_0xa0f6('0x178')]);Object[_0xa0f6('0x140')](_0x45642c,_0x3726dc);var _0x19da9c=_0x55cdd0[_0xa0f6('0x87')](_0x3e2fdd['Trunk'])?utils[_0xa0f6('0x179')](_0x3e2fdd['Trunk'][_0xa0f6('0x17a')],_0x3e2fdd[_0xa0f6('0x17b')],_0x3e2fdd[_0xa0f6('0x17c')]>0x0?utils[_0xa0f6('0x17d')](_0x3e2fdd['dialOriginateCallerIdNumber'],_0x3e2fdd[_0xa0f6('0x17c')]):_0x3e2fdd[_0xa0f6('0x17e')]):utils[_0xa0f6('0x179')](_[_0xa0f6('0xf4')](_0x3e2fdd[_0xa0f6('0x8e')])?_0x3e2fdd[_0xa0f6('0x8d')][_0xa0f6('0x17a')]:_0x3e2fdd[_0xa0f6('0x8e')]['callerid'],_0x3e2fdd['dialOriginateCallerIdName'],_0x3e2fdd[_0xa0f6('0x17c')]>0x0?utils[_0xa0f6('0x17d')](_0x3e2fdd[_0xa0f6('0x17e')],_0x3e2fdd['dialRandomLastDigitCallerIdNumber']):_0x3e2fdd[_0xa0f6('0x17e')]);if(_0x19da9c){_0x45642c[_0xa0f6('0x17f')]=_0x55cdd0[_0xa0f6('0x22')][_0x35ee5b][_0xa0f6('0x180')]=utils[_0xa0f6('0x181')](_0x19da9c);_0x45642c['XMD-ORIGINATECALLERIDNUM']=_0x53baa9['phone'];}_0x3e2fdd[_0xa0f6('0x182')]=_0x45642c;return ami['Action']({'actionid':_0x35ee5b,'action':_0xa0f6('0x15f'),'channel':_0x55cdd0[_0xa0f6('0x87')](_0x3e2fdd['Trunk'])?util[_0xa0f6('0x48')]('SIP/%s/%s%s',_0x3e2fdd[_0xa0f6('0x8d')][_0xa0f6('0x49')],isNotNull(_0x3e2fdd[_0xa0f6('0x183')])?_0x3e2fdd[_0xa0f6('0x183')][_0xa0f6('0x184')]()||'':'',_0x3e2fdd['dialCutDigit']>0x0?_0x53baa9[_0xa0f6('0x161')][_0xa0f6('0x185')](_0x3e2fdd[_0xa0f6('0x186')]):_0x53baa9['phone']):util[_0xa0f6('0x48')](_0xa0f6('0x187'),_[_0xa0f6('0xf4')](_0x3e2fdd[_0xa0f6('0x8e')])?_0x3e2fdd[_0xa0f6('0x8d')]['name']:_0x3e2fdd[_0xa0f6('0x8e')][_0xa0f6('0x49')],isNotNull(_0x3e2fdd[_0xa0f6('0x183')])?_0x3e2fdd['dialPrefix'][_0xa0f6('0x184')]()||'':'',_0x3e2fdd[_0xa0f6('0x186')]>0x0?_0x53baa9['phone'][_0xa0f6('0x185')](_0x3e2fdd[_0xa0f6('0x186')]):_0x53baa9[_0xa0f6('0x161')]),'callerid':_0x19da9c,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x45642c,'timeout':(_0x3e2fdd[_0xa0f6('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x35ee5b})[_0xa0f6('0x41')](function(_0x2c0e38){return _0xb2deb7(_0x2c0e38);})['catch'](function(_0xce5648){_0x3e2fdd[_0xa0f6('0x189')]+=0x1;var _0x122bff=new History(_0x55cdd0[_0xa0f6('0x22')][_0x35ee5b]);logger[_0xa0f6('0x69')](util[_0xa0f6('0x48')]('[originateError]:\x20%s',JSON[_0xa0f6('0x78')](_0xce5648)));_0x122bff['state']=0xe;_0x122bff['statedesc']=_0xa0f6('0x18a');_0x122bff[_0xa0f6('0x76')]=moment()[_0xa0f6('0x48')](_0xa0f6('0xc7'));_0x122bff[_0xa0f6('0x75')]=_0x122bff[_0xa0f6('0x76')];hopperUtils[_0xa0f6('0xc8')](_0x122bff)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x18b')));_0x55cdd0[_0xa0f6('0xca')](_0x122bff)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x18b')))['finally'](function(){delete _0x55cdd0[_0xa0f6('0x22')][_0x35ee5b];return _0x34f452(msgResponse(_0xa0f6('0x15f'),_0xa0f6('0xbc'),_0xa0f6('0x18c')));});});});};Dialer['prototype'][_0xa0f6('0x18d')]=function(_0x2e039e,_0x4ef840,_0x32ffce){var _0x291278=new History(_0x4ef840);if(_0x291278[_0xa0f6('0x11c')]+_0x291278['countcongestionretry']+_0x291278[_0xa0f6('0x11d')]+_0x291278[_0xa0f6('0x18e')]+_0x291278[_0xa0f6('0xd2')]+_0x291278[_0xa0f6('0xe6')]+_0x291278[_0xa0f6('0x118')]+_0x291278[_0xa0f6('0x12a')]>=_0x32ffce[_0xa0f6('0x11e')]-0x1){return!![];}switch(_0x2e039e){case 0x3:if(_0x291278[_0xa0f6('0x11d')]>=_0x32ffce['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x291278[_0xa0f6('0x11d')]+=0x1,'scheduledat':moment()['add'](_0x32ffce[_0xa0f6('0x18f')],'minutes')[_0xa0f6('0x48')](_0xa0f6('0xc7')),'ContactId':_0x291278[_0xa0f6('0xdc')],'ListId':_0x291278[_0xa0f6('0xdd')],'VoiceQueueId':_0x291278['VoiceQueueId']||undefined,'CampaignId':_0x291278[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x291278['countbusyretry']>=_0x32ffce[_0xa0f6('0x190')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x291278[_0xa0f6('0x11c')]+=0x1,'scheduledat':moment()[_0xa0f6('0xd9')](_0x32ffce[_0xa0f6('0x191')],'minutes')['format'](_0xa0f6('0xc7')),'ContactId':_0x291278['ContactId'],'ListId':_0x291278['ListId'],'VoiceQueueId':_0x291278[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x291278[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x192')));break;case 0x8:if(_0x291278[_0xa0f6('0x129')]>=_0x32ffce['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xa0f6('0xd8')]({'active':![],'countcongestionretry':_0x291278['countcongestionretry']+=0x1,'scheduledat':moment()[_0xa0f6('0xd9')](_0x32ffce[_0xa0f6('0x193')],_0xa0f6('0xdb'))[_0xa0f6('0x48')](_0xa0f6('0xc7')),'ContactId':_0x291278[_0xa0f6('0xdc')],'ListId':_0x291278[_0xa0f6('0xdd')],'VoiceQueueId':_0x291278[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x291278[_0xa0f6('0xea')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x291278[_0xa0f6('0x18e')]>=_0x32ffce[_0xa0f6('0x194')]-0x1){return!![];}else{hopperUtils[_0xa0f6('0xd8')]({'active':![],'countnosuchnumberretry':_0x291278[_0xa0f6('0x18e')]+=0x1,'scheduledat':moment()[_0xa0f6('0xd9')](_0x32ffce['dialNoSuchNumberRetryFrequency'],_0xa0f6('0xdb'))['format'](_0xa0f6('0xc7')),'ContactId':_0x291278['ContactId'],'ListId':_0x291278['ListId'],'VoiceQueueId':_0x291278[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x291278[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x195')));}break;case 0xa:if(_0x291278[_0xa0f6('0xd2')]>=_0x32ffce[_0xa0f6('0xd7')]-0x1){return!![];}hopperUtils[_0xa0f6('0xd8')]({'active':![],'countdropretry':_0x291278[_0xa0f6('0xd2')]+=0x1,'scheduledat':moment()[_0xa0f6('0xd9')](_0x32ffce[_0xa0f6('0xda')],_0xa0f6('0xdb'))[_0xa0f6('0x48')](_0xa0f6('0xc7')),'ContactId':_0x291278['ContactId'],'ListId':_0x291278[_0xa0f6('0xdd')],'VoiceQueueId':_0x291278['VoiceQueueId']||undefined,'CampaignId':_0x291278[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0xde')));break;case 0xb:if(_0x291278['countabandonedretry']>=_0x32ffce[_0xa0f6('0xe7')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x291278['countabandonedretry']+=0x1,'scheduledat':moment()[_0xa0f6('0xd9')](_0x32ffce[_0xa0f6('0xe5')],_0xa0f6('0xdb'))['format'](_0xa0f6('0xc7')),'ContactId':_0x291278[_0xa0f6('0xdc')],'ListId':_0x291278['ListId'],'VoiceQueueId':_0x291278['VoiceQueueId']||undefined,'CampaignId':_0x291278[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x291278[_0xa0f6('0x118')]>=_0x32ffce[_0xa0f6('0x120')]-0x1){return!![];}hopperUtils[_0xa0f6('0xd8')]({'active':![],'countmachineretry':_0x291278[_0xa0f6('0x118')]+=0x1,'scheduledat':moment()[_0xa0f6('0xd9')](_0x32ffce[_0xa0f6('0x123')],_0xa0f6('0xdb'))[_0xa0f6('0x48')](_0xa0f6('0xc7')),'ContactId':_0x291278['ContactId'],'ListId':_0x291278[_0xa0f6('0xdd')],'VoiceQueueId':_0x291278[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x291278[_0xa0f6('0xea')]||undefined})['catch'](loggerCatch(_0xa0f6('0x12b')));break;case 0x14:if(_0x291278[_0xa0f6('0x12a')]>=_0x32ffce[_0xa0f6('0x196')]-0x1){return!![];}hopperUtils[_0xa0f6('0xd8')]({'active':![],'countagentrejectretry':_0x291278[_0xa0f6('0x12a')]+=0x1,'scheduledat':moment()[_0xa0f6('0xd9')](_0x32ffce[_0xa0f6('0x197')],_0xa0f6('0xdb'))[_0xa0f6('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x291278[_0xa0f6('0xdc')],'ListId':_0x291278[_0xa0f6('0xdd')],'VoiceQueueId':_0x291278['VoiceQueueId']||undefined,'CampaignId':_0x291278['CampaignId']||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x198')));break;default:return!![];}};Dialer['prototype'][_0xa0f6('0x109')]=function(_0x1a07b9,_0x135ae9,_0x2f6d0b){var _0x5a0f7f=this;var _0x9b938e=new History(_0x1a07b9);var _0x30712c=![];var _0x7219c;var _0x51ff8b;return new Promise(function(_0x5a3d30,_0x31439a){if(_[_0xa0f6('0x43')](_0x135ae9)&&typeof _0x135ae9!==_0xa0f6('0x15e')){return _0x31439a(msgResponse(_0xa0f6('0x199'),_0xa0f6('0x94'),'entity\x20is\x20undefine'));}if(_[_0xa0f6('0x43')](_0x2f6d0b)&&typeof _0x2f6d0b!==_0xa0f6('0x15e')){return _0x31439a(msgResponse(_0xa0f6('0x199'),'Failure',_0xa0f6('0x19a')));}hopperUtils[_0xa0f6('0xd5')](_0x9b938e,_0x2f6d0b[_0xa0f6('0xc3')],_0x135ae9)['then'](function(_0xd8a558){if(_0xd8a558['additional']==0x1)_0x30712c=!![];switch(_0x2f6d0b['reason']){case'0':_0x135ae9[_0xa0f6('0x19b')]+=0x1;_0x9b938e[_0xa0f6('0x73')]=0x0;_0x9b938e['statedesc']=_0xa0f6('0x19c');_0x9b938e[_0xa0f6('0x18e')]+=0x1;_0x9b938e['countglobal']+=0x1;ami[_0xa0f6('0x44')](_0xa0f6('0x19d'),ut[_0xa0f6('0x114')](_0x1a07b9,_0xa0f6('0x19e')));_0x7219c=_0x135ae9[_0xa0f6('0x19f')];_0x51ff8b=_0x135ae9['callAdditionalPhoneAfterMin'];hopperUtils[_0xa0f6('0xc8')](_0x9b938e)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x11b')));if(_0x5a0f7f[_0xa0f6('0x18d')](0x0,_0x1a07b9,_0x135ae9)&&!_0x30712c){if(_0x9b938e[_0xa0f6('0x18e')]>=_0x135ae9['dialNoSuchNumberMaxRetry']){_0x5a0f7f[_0xa0f6('0x121')](_0x9b938e,_0x5a3d30,_0x31439a,'reason\x200\x20no\x20such\x20number....');}else{_0x5a0f7f[_0xa0f6('0x1a0')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1a1'));}}break;case'3':_0x135ae9[_0xa0f6('0x1a2')]+=0x1;_0x9b938e[_0xa0f6('0x73')]=0x3;_0x9b938e['statedesc']=_0xa0f6('0x1a3');_0x9b938e[_0xa0f6('0x11d')]+=0x1;_0x9b938e[_0xa0f6('0xd3')]+=0x1;var _0x4b9b86=ut[_0xa0f6('0x1a4')](_0x1a07b9,_0x135ae9);ami[_0xa0f6('0x44')](_0xa0f6('0x1a5'),_0x4b9b86);_0x7219c=_0x135ae9[_0xa0f6('0x18f')];_0x51ff8b=_0x135ae9[_0xa0f6('0xd4')];hopperUtils[_0xa0f6('0xc8')](_0x9b938e)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x1a6')));if(_0x5a0f7f[_0xa0f6('0x18d')](0x3,_0x1a07b9,_0x135ae9)&&!_0x30712c){if(_0x9b938e['countnoanswerretry']>=_0x135ae9[_0xa0f6('0x1a7')]){_0x5a0f7f[_0xa0f6('0x121')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1a8'));}else{_0x5a0f7f[_0xa0f6('0x1a0')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1a8'));}}break;case'5':_0x135ae9[_0xa0f6('0x1a9')]+=0x1;_0x9b938e[_0xa0f6('0x73')]=0x5;_0x9b938e[_0xa0f6('0x74')]=_0xa0f6('0x1aa');_0x9b938e[_0xa0f6('0x11c')]+=0x1;_0x9b938e[_0xa0f6('0xd3')]+=0x1;ami['emit'](_0xa0f6('0x1ab'),ut['buildObj'](_0x1a07b9,_0xa0f6('0x1ac')));_0x7219c=_0x135ae9[_0xa0f6('0x191')];_0x51ff8b=_0x135ae9[_0xa0f6('0xd4')];hopperUtils[_0xa0f6('0xc8')](_0x9b938e)['catch'](loggerCatch(_0xa0f6('0x1ad')));if(_0x5a0f7f[_0xa0f6('0x18d')](0x5,_0x1a07b9,_0x135ae9)&&!_0x30712c){if(_0x9b938e[_0xa0f6('0x11c')]>=_0x135ae9[_0xa0f6('0x190')]){_0x5a0f7f[_0xa0f6('0x121')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1ae'));}else{_0x5a0f7f['stateGlobal'](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1ae'));}}break;case'8':_0x135ae9[_0xa0f6('0x1af')]+=0x1;_0x9b938e[_0xa0f6('0x73')]=0x8;_0x9b938e[_0xa0f6('0x74')]=_0xa0f6('0x1b0');_0x9b938e[_0xa0f6('0x129')]+=0x1;_0x9b938e[_0xa0f6('0xd3')]+=0x1;_0x7219c=_0x135ae9['dialCongestionRetryFrequency'];_0x51ff8b=_0x135ae9[_0xa0f6('0xd4')];ami[_0xa0f6('0x44')](_0xa0f6('0x1b1'),ut[_0xa0f6('0x114')](_0x1a07b9,'congestion'));hopperUtils['createHistory'](_0x9b938e)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x1b2')));if(_0x5a0f7f[_0xa0f6('0x18d')](0x8,_0x1a07b9,_0x135ae9)&&!_0x30712c){if(_0x9b938e[_0xa0f6('0x129')]>=_0x135ae9['dialCongestionMaxRetry']){_0x5a0f7f['createStateFinal'](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1b3'));}else{_0x5a0f7f[_0xa0f6('0x1a0')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1b3'));}}break;case'11':_0x135ae9['outboundAbandonedCallsDay']+=0x1;_0x9b938e[_0xa0f6('0x73')]=0xb;_0x9b938e[_0xa0f6('0x74')]=_0xa0f6('0xec');_0x9b938e['countabandonedretry']+=0x1;_0x9b938e[_0xa0f6('0xd3')]+=0x1;_0x7219c=_0x135ae9[_0xa0f6('0xe5')];_0x51ff8b=_0x135ae9[_0xa0f6('0xd4')];hopperUtils[_0xa0f6('0xc8')](_0x9b938e)['catch'](loggerCatch(_0xa0f6('0xed')));if(_0x5a0f7f[_0xa0f6('0x18d')](0xb,_0x1a07b9,_0x135ae9)&&!_0x30712c){if(_0x9b938e[_0xa0f6('0xe6')]>=_0x135ae9[_0xa0f6('0xe7')]){_0x5a0f7f[_0xa0f6('0x121')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1b4'));}else{_0x5a0f7f[_0xa0f6('0x1a0')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1b4'));}}break;case'20':_0x135ae9['outboundRejectCallsDay']+=0x1;_0x9b938e[_0xa0f6('0x73')]=0x14;_0x9b938e[_0xa0f6('0x74')]=_0xa0f6('0x1b5');_0x9b938e[_0xa0f6('0x12a')]+=0x1;_0x9b938e[_0xa0f6('0xd3')]+=0x1;_0x7219c=_0x135ae9['dialAgentRejectRetryFrequency'];_0x51ff8b=_0x135ae9[_0xa0f6('0xd4')];ami['emit']('custom:agentreject',ut['buildObj'](_0x1a07b9,'agentreject'));hopperUtils[_0xa0f6('0xc8')](_0x9b938e)[_0xa0f6('0xa1')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5a0f7f['checkRetriveMax'](0x14,_0x1a07b9,_0x135ae9)&&!_0x30712c){if(_0x9b938e['countagentrejectretry']>=_0x135ae9[_0xa0f6('0x196')]){_0x5a0f7f['createStateFinal'](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1b6'));}else{_0x5a0f7f[_0xa0f6('0x1a0')](_0x9b938e,_0x5a3d30,_0x31439a,_0xa0f6('0x1b6'));}}break;default:_0x135ae9[_0xa0f6('0x131')]+=0x1;_0x9b938e[_0xa0f6('0x73')]=0xc;_0x9b938e[_0xa0f6('0x74')]=_0x2f6d0b[_0xa0f6('0xc3')];_0x7219c=_0x135ae9['dialAgentRejectRetryFrequency'];_0x51ff8b=_0x135ae9[_0xa0f6('0xd4')];hopperUtils['createHistory'](_0x9b938e)[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x1b7')));if(_0x5a0f7f[_0xa0f6('0x18d')](_0x2f6d0b[_0xa0f6('0xc3')],_0x1a07b9,_0x135ae9)&&!_0x30712c){if(_0x9b938e[_0xa0f6('0x11c')]+_0x9b938e[_0xa0f6('0x129')]+_0x9b938e[_0xa0f6('0x11d')]+_0x9b938e[_0xa0f6('0x18e')]+_0x9b938e[_0xa0f6('0xd2')]+_0x9b938e[_0xa0f6('0xe6')]+_0x9b938e[_0xa0f6('0x118')]+_0x9b938e[_0xa0f6('0x12a')]>=_0x135ae9[_0xa0f6('0x11e')]){_0x5a0f7f[_0xa0f6('0x1a0')](_0x9b938e,_0x5a3d30,_0x31439a,_0x2f6d0b[_0xa0f6('0xc3')]);}else{_0x5a0f7f[_0xa0f6('0x121')](_0x9b938e,_0x5a3d30,_0x31439a,_0x2f6d0b['reason']);}}}})[_0xa0f6('0x41')](function(){if(_0x30712c){hopperUtils[_0xa0f6('0xee')](_0x9b938e,_0x7219c,_0x51ff8b)['then'](function(){return _0x5a3d30(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x211d96,_0x173b1f,_0x2977a6,_0x5e4b87){var _0x385f1f=new Final(_0x211d96);_0x385f1f[_0xa0f6('0x73')]=0xf;_0x385f1f[_0xa0f6('0x74')]='Global';this['createStateFinal'](_0x385f1f,_0x173b1f,_0x2977a6,_0x5e4b87);};Dialer[_0xa0f6('0x17')]['createStateFinal']=function(_0x4f76c4,_0x1c3167,_0x317698,_0x225e55){hopperUtils[_0xa0f6('0xca')](_0x4f76c4)[_0xa0f6('0x41')](function(){return _0x1c3167(msgResponse(_0xa0f6('0x199'),_0xa0f6('0x1b8'),_0x225e55));})[_0xa0f6('0xa1')](function(){return _0x317698(msgResponse(_0xa0f6('0x1b9'),'Failure','contact\x20not\x20moved'));});};Dialer['prototype'][_0xa0f6('0x7')]=function(_0x122f0c){var _0x2e6579=_0x122f0c['dialPredictiveOptimizationPercentage']/0x64;var _0x17dddc=_0x122f0c[_0xa0f6('0xce')]/(_0x122f0c[_0xa0f6('0xce')]+_0x122f0c[_0xa0f6('0xc2')]);var _0x5da265=Math[_0xa0f6('0x1ba')](_0x122f0c[_0xa0f6('0x1bb')]*(_0x122f0c[_0xa0f6('0x1bc')]/0x64));var _0x403b50=Math[_0xa0f6('0x1ba')](_0x122f0c[_0xa0f6('0x1bb')]*(_0x122f0c[_0xa0f6('0x1bd')]/0x64));var _0x40050e=_0x122f0c[_0xa0f6('0x139')]+_0x122f0c[_0xa0f6('0x1be')];var _0x1b76b0=Math[_0xa0f6('0x1bf')](_0x122f0c[_0xa0f6('0x1c0')]*_0x122f0c['erlangAbandonmentRate']*_0x122f0c['predictiveIntervalHitRate']*_0x122f0c[_0xa0f6('0x1c1')]);if(_[_0xa0f6('0x43')](_0x122f0c[_0xa0f6('0x26')])){if(!_['isUndefined'](_0x122f0c['startPredictive'])){_0x122f0c[_0xa0f6('0x25')]=undefined;loggerPredictive[_0xa0f6('0x69')](_0xa0f6('0x1c2'),_0xa0f6('0x1c3'));}if(!_[_0xa0f6('0x43')](_0x122f0c[_0xa0f6('0x68')])){loggerPredictive[_0xa0f6('0x69')](_0xa0f6('0x1c2'),_0xa0f6('0x1c4'));clearInterval(_0x122f0c['handlePredictive']);_0x122f0c[_0xa0f6('0x68')]=undefined;}_0x122f0c[_0xa0f6('0x26')]=moment()[_0xa0f6('0x48')](_0xa0f6('0xc7'));loggerPredictive[_0xa0f6('0x4b')](_0x122f0c['name'],_0xa0f6('0x1c5'),_0x122f0c['startProgressive']);this[_0xa0f6('0xb3')](_0x122f0c,0x1);}else if(ifInterval(_0x122f0c[_0xa0f6('0x1c6')],_0x122f0c[_0xa0f6('0x26')])){this[_0xa0f6('0xb3')](_0x122f0c,0x1);loggerPredictiveCalls[_0xa0f6('0x4b')](_0xa0f6('0x1c7'),_0x122f0c[_0xa0f6('0x26')],_0x122f0c[_0xa0f6('0x49')]);_0x122f0c['erlangCalls']=0x0;_0x122f0c[_0xa0f6('0x1c8')]=0x0;}else if(_0x2e6579<_0x17dddc&&_0x122f0c[_0xa0f6('0x1c9')]==='dropRate'){clearPredictiveAttributes(_0x122f0c);loggerPredictive['info'](_0xa0f6('0x1ca'),_0xa0f6('0x1cb'),_0x17dddc,_0xa0f6('0x26'),_0x122f0c[_0xa0f6('0x49')]);}else if(_0x1b76b0<_0x122f0c[_0xa0f6('0x1c8')]&&_0x122f0c['dialPredictiveOptimization']===_0xa0f6('0x1cc')){clearPredictiveAttributes(_0x122f0c);loggerPredictive[_0xa0f6('0x4b')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xa0f6('0x1cd'),_0x1b76b0,'Drop\x20in\x20this\x20interval',_0x122f0c[_0xa0f6('0x1c8')],_0xa0f6('0x26'),_0x122f0c['name']);}else if(!ifInterval(_0x122f0c[_0xa0f6('0x1c6')],_0x122f0c[_0xa0f6('0x26')])&&_[_0xa0f6('0x43')](_0x122f0c[_0xa0f6('0x25')])&&!_[_0xa0f6('0x43')](_0x122f0c[_0xa0f6('0x26')])){_0x122f0c[_0xa0f6('0x25')]=moment()[_0xa0f6('0x48')](_0xa0f6('0xc7'));loggerPredictive[_0xa0f6('0x4b')](_0x122f0c[_0xa0f6('0x49')],_0xa0f6('0x1ce'),_0x122f0c[_0xa0f6('0x25')]);hopperUtils[_0xa0f6('0x1cf')](_0x122f0c[_0xa0f6('0x1c6')])[_0xa0f6('0x41')](this[_0xa0f6('0x1d0')](_0x122f0c))[_0xa0f6('0x41')](mergeDataErlangB(_0x122f0c))[_0xa0f6('0x41')](this[_0xa0f6('0x1d1')](_0x122f0c))[_0xa0f6('0xa1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x122f0c));}else if(!ifInterval(_0x122f0c[_0xa0f6('0x1c6')],_0x122f0c[_0xa0f6('0x25')])){_0x122f0c[_0xa0f6('0x1c8')]=0x0;_0x122f0c[_0xa0f6('0x25')]=moment()[_0xa0f6('0x48')](_0xa0f6('0xc7'));loggerPredictive[_0xa0f6('0x4b')](_0x122f0c[_0xa0f6('0x49')],'recalculate\x20predictive\x20at',_0x122f0c[_0xa0f6('0x25')]);clearInterval(_0x122f0c[_0xa0f6('0x68')]);_0x122f0c[_0xa0f6('0x68')]=undefined;hopperUtils[_0xa0f6('0x1cf')](_0x122f0c['dialPredictiveInterval'])[_0xa0f6('0x41')](this[_0xa0f6('0x1d0')](_0x122f0c))[_0xa0f6('0x41')](mergeDataErlangB(_0x122f0c))['then'](this['startMethodPredictive'](_0x122f0c))['catch'](loggerCatchPredictive(_0xa0f6('0x1d2'),_0x122f0c));}else if(_0x122f0c[_0xa0f6('0x1bb')]&&_0x40050e<_0x122f0c['predictiveIntervalAvailable']-_0x403b50){clearPredictiveAttributes(_0x122f0c);loggerPredictive[_0xa0f6('0x4b')](_0x122f0c[_0xa0f6('0x49')],_0xa0f6('0x1d3'),_0x40050e,_0xa0f6('0x1d4'),_0x122f0c[_0xa0f6('0x1bb')],'-',_0x403b50,'=',_0x122f0c[_0xa0f6('0x1bb')]-_0x403b50,')');}else if(_0x122f0c[_0xa0f6('0x1bb')]&&_0x40050e>_0x122f0c[_0xa0f6('0x1bb')]+_0x5da265){clearPredictiveAttributes(_0x122f0c);loggerPredictive['info'](_0x122f0c['name'],_0xa0f6('0x1d3'),_0x40050e,_0xa0f6('0x1d5'),_0x122f0c[_0xa0f6('0x1bb')],'+',_0x5da265,'=',_0x122f0c[_0xa0f6('0x1bb')]+_0x5da265,')');}};Dialer['prototype'][_0xa0f6('0x1d0')]=function(_0x33b6d9){var _0x473cb9=this;return function(_0x35c977){return new Promise(function(_0x5f02b6,_0x23db0b){_[_0xa0f6('0x63')](_0x33b6d9,_0x35c977[0x0]);if(checkGetDataPredictive(_0x35c977[0x0])){var _0x3ebf44=_0x33b6d9[_0xa0f6('0x1bb')]=_0x33b6d9[_0xa0f6('0x1be')]+_0x33b6d9[_0xa0f6('0x139')];var _0x2a061f=_0x33b6d9[_0xa0f6('0x1c6')]*0x3c;var _0x5d0979=_0x35c977[0x0][_0xa0f6('0x55')]+_0x35c977[0x0][_0xa0f6('0x59')];var _0x1bc139=(_0x35c977[0x0][_0xa0f6('0x4e')]+_0x35c977[0x0][_0xa0f6('0x50')]+_0x35c977[0x0][_0xa0f6('0x52')])/_0x35c977[0x0][_0xa0f6('0x57')];_0x33b6d9[_0xa0f6('0x1d6')]=_0x1bc139>0x0?_0x1bc139:0x1;switch(_0x33b6d9[_0xa0f6('0x1c9')]){case _0xa0f6('0x1cc'):var _0x48ea55=_0x33b6d9[_0xa0f6('0x1d7')]/0x64;return _0x473cb9[_0xa0f6('0x1d8')](_0x3ebf44,_0x2a061f,_0x5d0979,_0x1bc139,_0x48ea55)[_0xa0f6('0x41')](function(_0x23a3b1){return _0x5f02b6(_0x23a3b1);});case _0xa0f6('0x1d9'):var _0x3ec311=_0x33b6d9[_0xa0f6('0x1d7')]/0x64;return _0x473cb9[_0xa0f6('0x1da')](_0x3ebf44,_0x2a061f,_0x5d0979,_0x1bc139,_0x3ec311)[_0xa0f6('0x41')](function(_0x4bce70){return _0x5f02b6(_0x4bce70);});default:return _0x23db0b(msgResponse(_0xa0f6('0x1db'),_0xa0f6('0x94'),_0xa0f6('0x1dc')));}}else{return _0x23db0b(msgResponse(_0xa0f6('0x1db'),_0xa0f6('0x94'),_0xa0f6('0x1dd')));}});};};Dialer[_0xa0f6('0x17')][_0xa0f6('0x1de')]=function(_0x4cd471){var _0x120539=this;return function(_0x33b5c7){return new Promise(function(_0x3fe3be,_0x1301bb){_['merge'](_0x4cd471,_0x33b5c7[0x0]);if(checkGetDataPredictive(_0x33b5c7[0x0])){loggerPredictive[_0xa0f6('0x4b')](JSON['stringify'](_0x33b5c7[0x0]));if(_0x4cd471[_0xa0f6('0x1c9')]==='dropRate'){return _0x120539['getVoiceQueueRtPauses'](_0x4cd471['id'])[_0xa0f6('0x41')](function(_0x4e49a1){var _0x4967d9=_0x4cd471['loggedIn']-_0x4e49a1[0x0][_0xa0f6('0x1df')];var _0x2fa6ee=_0x4cd471[_0xa0f6('0x1c6')]*0x3c;var _0x3c4085=_0x33b5c7[0x0]['predictiveIntervalAvgTalktime']+_0x33b5c7[0x0][_0xa0f6('0x59')];var _0x116b80=(_0x33b5c7[0x0][_0xa0f6('0x4e')]+_0x33b5c7[0x0][_0xa0f6('0x50')]+_0x33b5c7[0x0][_0xa0f6('0x52')])/_0x33b5c7[0x0][_0xa0f6('0x57')];var _0x4ea7f9=_0x4cd471['dialPredictiveOptimizationPercentage']/0x64;_0x4cd471[_0xa0f6('0x1e0')]=_0x4e49a1[0x0][_0xa0f6('0x1df')]||0x0;_0x4cd471[_0xa0f6('0x1d6')]=_0x116b80>0x0?_0x116b80:0x1;return _0x120539[_0xa0f6('0x1d8')](_0x4967d9,_0x2fa6ee,_0x3c4085,_0x116b80,_0x4ea7f9);})[_0xa0f6('0x41')](function(_0x438e97){return _0x3fe3be(_0x438e97);})[_0xa0f6('0xa1')](function(_0x17a467){return _0x1301bb(msgResponse('[CatchErlangB]','Failure',JSON[_0xa0f6('0x78')](_0x17a467)));});}if(_0x4cd471['dialPredictiveOptimization']==='agentBusyFactor'){return _0x120539[_0xa0f6('0x151')](_0x4cd471['id'])[_0xa0f6('0x41')](function(_0x107b8a){var _0xa872a8=_0x4cd471[_0xa0f6('0x1e1')]-_0x107b8a[0x0][_0xa0f6('0x1df')];var _0x1d2149=_0x4cd471[_0xa0f6('0x1c6')]*0x3c;var _0x59dbba=_0x33b5c7[0x0][_0xa0f6('0x55')]+_0x33b5c7[0x0][_0xa0f6('0x59')];var _0x1c4c46=(_0x33b5c7[0x0]['predictiveIntervalAnsweredCalls']+_0x33b5c7[0x0][_0xa0f6('0x50')]+_0x33b5c7[0x0][_0xa0f6('0x52')])/_0x33b5c7[0x0][_0xa0f6('0x57')];var _0xd8e987=_0x4cd471[_0xa0f6('0x1d7')]/0x64;_0x4cd471[_0xa0f6('0x1e0')]=_0x107b8a[0x0][_0xa0f6('0x1df')]||0x0;_0x4cd471[_0xa0f6('0x1d6')]=_0x1c4c46>0x0?_0x1c4c46:0x1;return _0x120539['busyFactor'](_0xa872a8,_0x1d2149,_0x59dbba,_0x1c4c46,_0xd8e987);})['then'](function(_0x2781cd){return _0x3fe3be(_0x2781cd);})['catch'](function(_0x59a469){return _0x1301bb(msgResponse(_0xa0f6('0x1e2'),_0xa0f6('0x94'),JSON['stringify'](_0x59a469)));});}}else{return _0x1301bb(msgResponse(_0xa0f6('0x1db'),_0xa0f6('0x94'),_0xa0f6('0x1dd')));}});};};Dialer[_0xa0f6('0x17')][_0xa0f6('0x1d1')]=function(_0x55ed89){var _0x59a30c=this;return function(){var _0x152ef7=0x0;var _0xa5331=Math[_0xa0f6('0x1bf')](_0x55ed89[_0xa0f6('0x5e')]*0x3e8);if(_0xa5331>0x0){_0xa5331=_0xa5331<0x64?0x64:_0xa5331;loggerPredictive[_0xa0f6('0x4b')](_0x55ed89[_0xa0f6('0x49')],_0xa0f6('0x1e3'),_0xa5331,_0xa0f6('0x1e4'));_0x55ed89[_0xa0f6('0x68')]=setInterval(function(){_0x59a30c[_0xa0f6('0x68')](_0x55ed89);loggerPredictiveCalls[_0xa0f6('0x4b')](_0xa0f6('0x1e5'),_0x152ef7+=0x1);},_0xa5331);}else{loggerPredictive[_0xa0f6('0x4b')](_0x55ed89['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xa0f6('0x17')]['checkContactBlack']=function(_0x480478,_0x115dfc){var _0x388f50=this;return function(_0x1b4c26){if(_['isEmpty'](_0x1b4c26)){if(_[_0xa0f6('0xf4')](_0x115dfc[_0xa0f6('0x159')])||!_0x115dfc[_0xa0f6('0x1e6')]){if(_0x480478[_0xa0f6('0xb1')]===_0xa0f6('0x6')){_0x480478[_0xa0f6('0x77')]=_[_0xa0f6('0x43')](_0x480478[_0xa0f6('0x77')])?!![]:_0x480478['queueStatusComplete'];var _0x5c2bda=uuid['v4']();_0x388f50[_0xa0f6('0x22')][_0x5c2bda]=new Action(_0x480478,_0x115dfc,_0x5c2bda);loggerBooked[_0xa0f6('0x4b')](_0xa0f6('0x1e7'),_0x5c2bda,'queueStatusComplete:\x20',JSON[_0xa0f6('0x78')](_0x480478[_0xa0f6('0x77')]),'Queue:\x20',_0x480478[_0xa0f6('0x49')]);if(_0x480478[_0xa0f6('0x77')]){_0x480478[_0xa0f6('0x77')]=![];_0x388f50[_0xa0f6('0x27')][_0x388f50[_0xa0f6('0x22')][_0x5c2bda][_0xa0f6('0xc1')]]=[];ami['Action']({'actionid':_0x5c2bda,'action':_0xa0f6('0x1e8'),'queue':_0x480478[_0xa0f6('0x49')]})[_0xa0f6('0xa1')](function(){_0x388f50[_0xa0f6('0xbf')](_0x480478);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x388f50[_0xa0f6('0x22')][_0x5c2bda]['ContactId'],'ListId':_0x388f50['actions'][_0x5c2bda]['ListId'],'VoiceQueueId':_0x388f50['actions'][_0x5c2bda][_0xa0f6('0xe9')]||undefined,'CampaignId':_0x388f50[_0xa0f6('0x22')][_0x5c2bda][_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x1e9')));delete _0x388f50['actions'][_0x5c2bda];});}else{loggerBooked[_0xa0f6('0x4b')](_0xa0f6('0x1ea'),JSON[_0xa0f6('0x78')](_0x480478[_0xa0f6('0x77')]),_0xa0f6('0x1eb'),_0x480478[_0xa0f6('0x49')]);_0x388f50['updateOriginated'](_0x480478);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x388f50[_0xa0f6('0x22')][_0x5c2bda][_0xa0f6('0xdc')],'ListId':_0x388f50[_0xa0f6('0x22')][_0x5c2bda]['ListId'],'VoiceQueueId':_0x388f50[_0xa0f6('0x22')][_0x5c2bda][_0xa0f6('0xe9')]||undefined,'CampaignId':_0x388f50[_0xa0f6('0x22')][_0x5c2bda][_0xa0f6('0xea')]||undefined})['catch'](loggerCatch(_0xa0f6('0x1e9')));delete _0x388f50['actions'][_0x5c2bda];}}else{return _0x388f50[_0xa0f6('0x15d')](_0x480478,_0x115dfc);}}else{if(utils[_0xa0f6('0x64')](undefined,_0x115dfc['scheduledat'])<_0x480478[_0xa0f6('0x1ec')]*0x3c){if(_0x115dfc[_0xa0f6('0x148')]&&!_0x115dfc[_0xa0f6('0x148')][_0xa0f6('0x1ed')]){_0x388f50[_0xa0f6('0x1b')][_0xa0f6('0x101')](_0x115dfc['id'])['finally'](function(){_0x388f50[_0xa0f6('0xbf')](_0x480478);});}else{hopperUtils['unlockContact']({'active':![]},_0x115dfc['id'],0x1)[_0xa0f6('0x19')](function(){_0x388f50[_0xa0f6('0xbf')](_0x480478);});}}else{_0x480478[_0xa0f6('0x1ee')]+=0x1;_0x388f50[_0xa0f6('0xbf')](_0x480478);if(_0x480478[_0xa0f6('0x1ef')]){hopperUtils[_0xa0f6('0xd8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x115dfc[_0xa0f6('0xdc')],'ListId':_0x115dfc[_0xa0f6('0xdd')],'VoiceQueueId':_0x115dfc[_0xa0f6('0xe9')]||undefined,'CampaignId':_0x115dfc[_0xa0f6('0xea')]||undefined})[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x1f0')));hopperUtils[_0xa0f6('0xc8')](createObjHistory(_0x480478,_0x115dfc,utils[_0xa0f6('0x6f')][_0xa0f6('0x1f1')],0x17,_0xa0f6('0x1f2')))['catch'](loggerCatch(_0xa0f6('0x1f3')));}else{_0x388f50[_0xa0f6('0x115')](createObjHistory(_0x480478,_0x115dfc,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0xa0f6('0x1f4')),_0xa0f6('0x1f5'),_0xa0f6('0x1f6'));}}}}else{_0x480478[_0xa0f6('0x1f7')]+=0x1;_0x388f50[_0xa0f6('0x115')](createObjHistory(_0x480478,_0x115dfc,utils['CAMPAIGN_STATUS'][_0xa0f6('0x1f8')],0xd,_0xa0f6('0x1f9')),_0xa0f6('0x1fa'),_0xa0f6('0x1fb'));throw _0xa0f6('0x1fc');}};};Dialer[_0xa0f6('0x17')]['handleIvr']=function(_0x6bc751){var _0x2912a4=this;var _0x559464=_0x6bc751[_0xa0f6('0x1fd')]-_0x6bc751[_0xa0f6('0x81')];emitCampaignSummary(_0x6bc751);if(_0x559464>0x0&&_0x6bc751[_0xa0f6('0x6c')]==0x0){if(_0x559464>this[_0xa0f6('0x20')]){_0x559464=this[_0xa0f6('0x20')];}_0x6bc751[_0xa0f6('0x6c')]=0x1;hopperUtils[_0xa0f6('0x1fe')](_0x6bc751,_0x559464)[_0xa0f6('0x41')](function(_0x7a7268){_0x6bc751[_0xa0f6('0x6c')]=0x0;if(_0x7a7268){if(!utils['checkContactEmpty'](_0x7a7268)){_0x6bc751[_0xa0f6('0x6e')]=utils[_0xa0f6('0x6f')][_0xa0f6('0x71')];logger[_0xa0f6('0x4b')](_0xa0f6('0x1ff')+_0x6bc751[_0xa0f6('0x49')]);}else{_0x6bc751['originated']+=_0x7a7268['length'];_0x6bc751[_0xa0f6('0x6e')]=utils['CAMPAIGN_STATUS'][_0xa0f6('0x200')];for(var _0x30a36e=0x0;_0x30a36e<_0x7a7268[_0xa0f6('0x145')];_0x30a36e+=0x1){_0x6bc751[_0xa0f6('0x201')]+=0x1;if(_['isNil'](_0x7a7268[_0x30a36e])||_[_0xa0f6('0xf4')](_0x7a7268[_0x30a36e][_0xa0f6('0x178')])||_[_0xa0f6('0xf4')](_0x7a7268[_0x30a36e]['phone'])){_0x2912a4[_0xa0f6('0x157')]('[actionOriginate]\x20',_0x6bc751,_0x7a7268[_0x30a36e]);}else{hopperUtils[_0xa0f6('0x202')](_[_0xa0f6('0xf8')](_0x7a7268[_0x30a36e],['CampaignId',_0xa0f6('0x161')]))[_0xa0f6('0x41')](_0x2912a4['checkContactBlack'](_0x6bc751,_0x7a7268[_0x30a36e]))[_0xa0f6('0xa1')](_0x2912a4[_0xa0f6('0x156')](_0xa0f6('0x203'),_0x6bc751));}}}}})[_0xa0f6('0xa1')](loggerGetContactDialer(_0xa0f6('0x204'),_0x6bc751,_0x559464));}};Dialer[_0xa0f6('0x17')]['handlePower']=function(_0x4d40c3,_0x4d29b5){var _0x56a0f8=this;var _0x59849b=[];if(_0x4d29b5<0x1||_0x4d40c3[_0xa0f6('0xb1')]===_0xa0f6('0x6')){_0x4d29b5=0x1;}var _0x45cc3e=Math[_0xa0f6('0x1bf')](_0x4d40c3['available']*_0x4d29b5)-_0x4d40c3[_0xa0f6('0x81')];if(_0x4d40c3[_0xa0f6('0x205')]>0x0){var _0x3c07d2=_0x4d40c3[_0xa0f6('0x205')]-_0x4d40c3[_0xa0f6('0x81')]-_0x4d40c3[_0xa0f6('0x1be')]-_0x4d40c3['pTalking'];if(_0x45cc3e>_0x3c07d2){_0x45cc3e=_0x3c07d2;}}if(_0x45cc3e>0x0&&_0x4d40c3[_0xa0f6('0x6c')]==0x0){if(_0x4d40c3[_0xa0f6('0xb1')]===_0xa0f6('0x6')){_0x45cc3e=0x1;}if(_0x45cc3e>this[_0xa0f6('0x20')]){_0x45cc3e=this['maxNumberOriginate'];}for(var _0x436ac1 in this[_0xa0f6('0x1e')]){if(typeof this[_0xa0f6('0x1e')][_0x436ac1]!==_0xa0f6('0x153')){if(this[_0xa0f6('0x1e')][_0x436ac1][_0xa0f6('0x73')]===_0xa0f6('0x206')&&this['agents'][_0x436ac1]['status']===_0xa0f6('0x144')){_0x59849b[_0xa0f6('0x9a')](this[_0xa0f6('0x1e')][_0x436ac1]['id']);}}}_0x4d40c3['temp']=0x1;hopperUtils[_0xa0f6('0x207')](_0x4d40c3,_0x59849b,_0x45cc3e)[_0xa0f6('0x41')](function(_0x2c0d05){_0x4d40c3[_0xa0f6('0x6c')]=0x0;if(_0x2c0d05){if(!utils['checkContactEmpty'](_0x2c0d05)){hopperUtils[_0xa0f6('0x208')](_0x4d40c3)['then'](sendMessageReschedule(_0x4d40c3))[_0xa0f6('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x4d40c3[_0xa0f6('0x81')]+=_0x2c0d05[_0xa0f6('0x145')];_0x4d40c3['message']=_0x4d40c3[_0xa0f6('0xb1')]==='booked'?utils[_0xa0f6('0x6f')][_0xa0f6('0x13b')]:utils['CAMPAIGN_STATUS'][_0xa0f6('0x200')];for(var _0x3b2fe5=0x0;_0x3b2fe5<_0x2c0d05[_0xa0f6('0x145')];_0x3b2fe5+=0x1){if(_['isNil'](_0x2c0d05[_0x3b2fe5])||_['isNil'](_0x2c0d05[_0x3b2fe5][_0xa0f6('0x178')])||_[_0xa0f6('0xf4')](_0x2c0d05[_0x3b2fe5][_0xa0f6('0x161')])){_0x56a0f8[_0xa0f6('0x157')](_0xa0f6('0x209'),_0x4d40c3,_0x2c0d05[_0x3b2fe5]);}else{hopperUtils['checkIsBlackList'](_[_0xa0f6('0xf8')](_0x2c0d05[_0x3b2fe5],[_0xa0f6('0xe9'),_0xa0f6('0x161')]))[_0xa0f6('0x41')](_0x56a0f8['checkContactBlack'](_0x4d40c3,_0x2c0d05[_0x3b2fe5]))[_0xa0f6('0xa1')](_0x56a0f8['loggerHandler'](_0xa0f6('0x209'),_0x4d40c3));}}}}})[_0xa0f6('0xa1')](loggerGetContactDialer(_0xa0f6('0x20a'),_0x4d40c3,_0x45cc3e));}};Dialer['prototype']['handlePredictive']=function(_0x175e23){if(_0x175e23[_0xa0f6('0x205')]>0x0){var _0x441b50=_0x175e23[_0xa0f6('0x205')]-_0x175e23['originated']-_0x175e23[_0xa0f6('0x1be')];if(_0x441b50>0x0&&_0x175e23[_0xa0f6('0x6c')]==0x0){this['tryOriginatePredictive'](_0x175e23);}else{loggerPredictiveCalls[_0xa0f6('0x4b')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x175e23);}};Dialer[_0xa0f6('0x17')][_0xa0f6('0x20b')]=function(_0x21d6ca){var _0x588ce2=this;var _0x53e8ed=[];_0x21d6ca[_0xa0f6('0x81')]+=0x1;for(var _0x45272f in this['agents']){if(typeof this[_0xa0f6('0x1e')][_0x45272f]!==_0xa0f6('0x153')){if(this[_0xa0f6('0x1e')][_0x45272f][_0xa0f6('0x73')]===_0xa0f6('0x206')&&this['agents'][_0x45272f]['status']===_0xa0f6('0x144')){_0x53e8ed['push'](this['agents'][_0x45272f]['id']);}}}_0x21d6ca['temp']=0x1;return this[_0xa0f6('0x207')](_0x21d6ca['id'],_0x53e8ed,0x1,_0x21d6ca[_0xa0f6('0x20c')],_0x21d6ca)[_0xa0f6('0x41')](function(_0x101f1c){_0x21d6ca['temp']=0x1;if(_0x101f1c){if(!utils['checkContactEmpty'](_0x101f1c)){utils['checkContactLowerLimitOriginate'](_0x21d6ca,0x1,0x0);return hopperUtils[_0xa0f6('0x208')](_0x21d6ca)['then'](sendMessageReschedule(_0x21d6ca))[_0xa0f6('0xa1')](loggerCatch(_0xa0f6('0x20d')));}else{_0x21d6ca['message']=utils[_0xa0f6('0x6f')][_0xa0f6('0x200')];if(_['isNil'](_0x101f1c[0x0])||_['isNil'](_0x101f1c[0x0]['Contact'])||_[_0xa0f6('0xf4')](_0x101f1c[0x0]['phone'])){_0x588ce2[_0xa0f6('0x157')]('[actionOriginate]\x20',_0x21d6ca,_0x101f1c[0x0]);}else{return hopperUtils[_0xa0f6('0x20e')](_[_0xa0f6('0xf8')](_0x101f1c[0x0],[_0xa0f6('0xe9'),_0xa0f6('0x161')]))[_0xa0f6('0x41')](_0x588ce2[_0xa0f6('0x20f')](_0x21d6ca,_0x101f1c[0x0]))[_0xa0f6('0xa1')](_0x588ce2[_0xa0f6('0x156')](_0xa0f6('0x210'),_0x21d6ca));}}}})[_0xa0f6('0xa1')](loggerGetContactDialer(_0xa0f6('0x211'),_0x21d6ca,0x1));};Dialer[_0xa0f6('0x17')]['abandonmentRate']=function(_0x528745,_0x23501e,_0x22d7c4,_0x72612,_0x13579d,_0x572a72){loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x212'));loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x213'),_0x528745);loggerPredictive[_0xa0f6('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23501e);loggerPredictive['info'](_0xa0f6('0x214'),_0x22d7c4);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',_0x72612);loggerPredictive['info'](_0xa0f6('0x215'),_0x13579d);loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x56'));return new Promise(function(_0x4a43a5,_0x42b56e){if(_0x528745<=0x0||isNaN(_0x528745)){return _0x42b56e(msgResponse(_0xa0f6('0x216'),_0xa0f6('0xbc'),_0xa0f6('0x217')+_0x528745));}if(_0x22d7c4<=0x0||isNaN(_0x22d7c4)){return _0x42b56e(msgResponse(_0xa0f6('0x216'),_0xa0f6('0xbc'),_0xa0f6('0x218')+_0x22d7c4));}if(_0x72612<=0x0||isNaN(_0x72612)){return _0x42b56e(msgResponse(_0xa0f6('0x216'),_0xa0f6('0xbc'),'p\x20=\x20'+_0x72612));}if(_0x23501e<=0x0||isNaN(_0x23501e)){return _0x42b56e(msgResponse('[abandonmentRate]',_0xa0f6('0xbc'),_0xa0f6('0x219')+_0x23501e));}if(_0x13579d<=0x0||isNaN(_0x13579d)){return _0x42b56e(msgResponse(_0xa0f6('0x216'),_0xa0f6('0xbc'),_0xa0f6('0x21a')+_0x13579d));}_0x572a72=_0x572a72||0x0;var _0x1d2699=0x1/_0x22d7c4;var _0x49a580=0x0;var _0x452246=0x0;var _0x2bc0be=0x0;var _0x40c970=0x0;for(var _0x34ee81=0x0;_0x2bc0be<_0x13579d;_0x34ee81+=0x1){_0x452246=_0x34ee81/_0x23501e;_0x49a580=(_0x72612*_0x452246+_0x572a72)/_0x1d2699;_0x2bc0be=utils[_0xa0f6('0x21b')](_0x49a580,_0x528745);_0x40c970=_0x49a580/_0x528745*(0x1-utils[_0xa0f6('0x21b')](_0x49a580,_0x528745));}return _0x4a43a5({'erlangCalls':_0x34ee81,'erlangCallToSecond':_0x23501e/_0x34ee81,'erlangAbandonmentRate':_0x2bc0be,'erlangBusyFactor':_0x40c970});});};Dialer[_0xa0f6('0x17')][_0xa0f6('0x1da')]=function(_0x2fcae1,_0xc1b4f0,_0x3a95f2,_0x5daad7,_0x5d0923,_0x33e225){loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x21c'));loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x213'),_0x2fcae1);loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x21d'),_0xc1b4f0);loggerPredictive[_0xa0f6('0x4b')]('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',_0x3a95f2);loggerPredictive[_0xa0f6('0x4b')](_0xa0f6('0x21e'),_0x5daad7);loggerPredictive[_0xa0f6('0x4b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d0923);loggerPredictive['info'](_0xa0f6('0x56'));return new Promise(function(_0x296421,_0x524f1d){if(_0x2fcae1<=0x0||isNaN(_0x2fcae1)){return _0x524f1d(msgResponse(_0xa0f6('0x21f'),_0xa0f6('0xbc'),_0xa0f6('0x217')+_0x2fcae1));}if(_0x3a95f2<=0x0||isNaN(_0x3a95f2)){return _0x524f1d(msgResponse(_0xa0f6('0x21f'),_0xa0f6('0xbc'),_0xa0f6('0x218')+_0x3a95f2));}if(_0x5daad7<=0x0||isNaN(_0x5daad7)){return _0x524f1d(msgResponse(_0xa0f6('0x21f'),_0xa0f6('0xbc'),'p\x20=\x20'+_0x5daad7));}if(_0xc1b4f0<=0x0||isNaN(_0xc1b4f0)){return _0x524f1d(msgResponse(_0xa0f6('0x21f'),_0xa0f6('0xbc'),'interval\x20=\x20'+_0xc1b4f0));}if(_0x5d0923<=0x0||isNaN(_0x5d0923)){return _0x524f1d(msgResponse(_0xa0f6('0x21f'),_0xa0f6('0xbc'),_0xa0f6('0x220')+_0x5d0923));}_0x33e225=_0x33e225||0x0;var _0x335dcc=0x1/_0x3a95f2;var _0x28ecf1=0x0;var _0x5820cd=0x0;var _0x5c524a=0x0;var _0x5dd287=0x0;for(var _0x4a3798=0x0;_0x5dd287<_0x5d0923;_0x4a3798+=0x1){_0x5820cd=_0x4a3798/_0xc1b4f0;_0x28ecf1=(_0x5daad7*_0x5820cd+_0x33e225)/_0x335dcc;_0x5c524a=utils[_0xa0f6('0x21b')](_0x28ecf1,_0x2fcae1);_0x5dd287=_0x28ecf1/_0x2fcae1*(0x1-utils['erlangb'](_0x28ecf1,_0x2fcae1));}return _0x296421({'erlangCalls':_0x4a3798,'erlangCallToSecond':_0xc1b4f0/_0x4a3798,'erlangAbandonmentRate':_0x5c524a,'erlangBusyFactor':_0x5dd287});});};module[_0xa0f6('0x221')]=Dialer; \ No newline at end of file +var _0x3885=['syncCampaigns','undefined','resolve','checkIfTime','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','predictive','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','reason','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','agiafterat','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','dialDropRetryFrequency','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','countabandonedretry','add','ContactId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','roundrobin','isNil','locked','paused','stateinterface','rrmemory','queueBooked','push','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','preview','[booked][RR][finaly]','contactAgent-idHopper:\x20','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','emit','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','reason19\x20machine....','createStateFinal','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','running','isPreviewCampaign','statusMessage','available','inUse','talking','pTalking','queueSummaryCountersUpdated','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','user:%s','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','actionOriginate','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','object','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','uuid','moment','ioredis','./utils/hopper','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/hangup','127.0.0.1','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','isUndefined','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','predictiveIntervalTotalCalls','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','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contactsRescheduled','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','indexOf','true','catch','then','content','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls'];(function(_0x133e1f,_0x4cd91e){var _0x4e5847=function(_0x4b8c62){while(--_0x4b8c62){_0x133e1f['push'](_0x133e1f['shift']());}};_0x4e5847(++_0x4cd91e);}(_0x3885,0x17f));var _0x5388=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3885[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0x5388('0x0'));var moment=require(_0x5388('0x1'));var rr=require('rr');var Redis=require(_0x5388('0x2'));var utils=require('./utils');var hopperUtils=require(_0x5388('0x3'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x5388('0x4'))('dialer');var loggerBooked=require(_0x5388('0x4'))(_0x5388('0x5'));var loggerPredictive=require(_0x5388('0x4'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x5388('0x6'));var loggerSyncQueueSummary=require(_0x5388('0x4'))(_0x5388('0x7'));var ami=require(_0x5388('0x8'));config[_0x5388('0x9')]=_[_0x5388('0xa')](config[_0x5388('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x5388('0xb'))(new Redis(config[_0x5388('0x9')]));var cmHopper=require(_0x5388('0xc'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x5388('0xd'));var Interval=require(_0x5388('0xe'));var Action=require(_0x5388('0xf'));var History=require(_0x5388('0x10'));var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x5388('0x11'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x5388('0x12');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5388('0x13')][_0x5388('0x14')]=function(_0x497589){this[_0x5388('0x15')]=this[_0x5388('0x15')]?this[_0x5388('0x15')]['finally'](_0x497589):_0x497589();};function Dialer(_0x4e45e5,_0x92667f){this[_0x5388('0x16')]=new Sequence();this['preview']=_0x92667f;this[_0x5388('0x17')]=_0x4e45e5[_0x5388('0x17')];this[_0x5388('0x18')]=_0x4e45e5[_0x5388('0x18')];this[_0x5388('0x19')]=_0x4e45e5[_0x5388('0x19')];this['trunks']=_0x4e45e5[_0x5388('0x1a')];this[_0x5388('0x1b')]=config[_0x5388('0x1b')]||0x2;this[_0x5388('0x1c')]={};this[_0x5388('0x1d')]={};this[_0x5388('0x1e')]={};this[_0x5388('0x1f')]={};this['optionPredictive']={};this[_0x5388('0x20')]={};this[_0x5388('0x21')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x5388('0x22')]={};this[_0x5388('0x23')]={};ami['on'](_0x5388('0x24'),this['syncAgentConnect'][_0x5388('0x25')](this));ami['on'](_0x5388('0x26'),this[_0x5388('0x27')][_0x5388('0x25')](this));ami['on'](_0x5388('0x28'),this[_0x5388('0x29')][_0x5388('0x25')](this));ami['on'](_0x5388('0x2a'),this[_0x5388('0x2b')][_0x5388('0x25')](this));ami['on']('custom:queuesummary',this[_0x5388('0x7')][_0x5388('0x25')](this));ami['on'](_0x5388('0x2c'),this[_0x5388('0x2d')][_0x5388('0x25')](this));ami['on'](_0x5388('0x2e'),this[_0x5388('0x2f')][_0x5388('0x25')](this));ami['on']('newexten',this[_0x5388('0x30')][_0x5388('0x25')](this));ami['on'](_0x5388('0x31'),this[_0x5388('0x32')]['bind'](this));ami['on']('queuemember',this[_0x5388('0x33')][_0x5388('0x25')](this));ami['on'](_0x5388('0x34'),this[_0x5388('0x35')]['bind'](this));this['loopCampaigns']();this[_0x5388('0x36')]();RpcSetting[_0x5388('0x37')]()['then'](function(_0x2688fa){previewRecallmeReminderInterval=_0x2688fa['previewRecallmeReminderInterval'];});}function isNotNull(_0x3a06ea){return _0x3a06ea!==null&&!_[_0x5388('0x38')](_0x3a06ea);}function msgResponse(_0x510c10,_0x4eda94,_0x1806da){return{'action':_0x510c10,'response':_0x4eda94,'message':_0x1806da,'stack':_0x1806da};}function emit(_0x2741a3,_0x4f2f6f,_0x5709d1){io['to'](_0x2741a3)['emit'](_0x4f2f6f,_0x5709d1);}function emitOutboundVoiceQueueSummary(_0x1c5f09){if(_0x1c5f09[_0x5388('0x39')]===_0x5388('0x3a')){logger[_0x5388('0x3b')](_0x5388('0x3c'),util[_0x5388('0x3d')](_0x1c5f09,{'showHidden':![],'depth':null}));emit(util[_0x5388('0x3e')](_0x5388('0x3f'),_0x1c5f09['name']),_0x5388('0x40'),_0x1c5f09);}}function checkGetDataPredictive(_0x14584a){if(isNotNull(_0x14584a)&&!_[_0x5388('0x41')](_0x14584a)){loggerPredictive[_0x5388('0x42')](_0x5388('0x43'));loggerPredictive[_0x5388('0x42')](_0x5388('0x44'),_0x14584a['predictiveIntervalTotalCalls']);loggerPredictive[_0x5388('0x42')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14584a[_0x5388('0x45')]);loggerPredictive[_0x5388('0x42')](_0x5388('0x46'),_0x14584a[_0x5388('0x47')]);loggerPredictive['info'](_0x5388('0x48'),_0x14584a['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x5388('0x42')](_0x5388('0x49'),_0x14584a[_0x5388('0x4a')]);loggerPredictive['info'](_0x5388('0x4b'),_0x14584a[_0x5388('0x4c')]);loggerPredictive[_0x5388('0x42')](_0x5388('0x4d'));if(_0x14584a[_0x5388('0x4e')]>0x0){if(!_['isUndefined'](_0x14584a[_0x5388('0x4c')])&&_0x14584a['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x5388('0x42')](_0x5388('0x4f'));if(!_[_0x5388('0x38')](_0x14584a[_0x5388('0x4a')])&&_0x14584a[_0x5388('0x4a')]>0x0){return!![];}loggerPredictive[_0x5388('0x42')](_0x5388('0x50'));}else{loggerPredictive['info'](_0x5388('0x51'));}}else{loggerPredictive[_0x5388('0x42')](_0x5388('0x52'));}return![];}function mergeDataErlangB(_0x2e44db){return function(_0x43cf08){loggerPredictive['info'](_0x5388('0x53'));loggerPredictive[_0x5388('0x42')](_0x5388('0x54'),_0x43cf08[_0x5388('0x55')]);loggerPredictive[_0x5388('0x42')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43cf08[_0x5388('0x56')]);loggerPredictive[_0x5388('0x42')](_0x5388('0x57'),_0x43cf08[_0x5388('0x58')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43cf08[_0x5388('0x59')]);loggerPredictive[_0x5388('0x42')](_0x5388('0x57'),_0x43cf08[_0x5388('0x58')]);loggerPredictive[_0x5388('0x42')](_0x5388('0x4d'));_[_0x5388('0x5a')](_0x2e44db,_0x43cf08);};}function ifInterval(_0x534b5f,_0x5ad1de){if(_[_0x5388('0x38')](_0x5ad1de)){return![];}return utils[_0x5388('0x5b')](undefined,_0x5ad1de)<_0x534b5f*0x3c;}function clearPredictiveAttributes(_0x122f11){if(_0x122f11['startProgressive']){_0x122f11[_0x5388('0x21')]=undefined;loggerPredictive['debug'](_0x122f11[_0x5388('0x5c')],_0x5388('0x5d'));}if(_0x122f11[_0x5388('0x20')]){_0x122f11[_0x5388('0x20')]=undefined;loggerPredictive[_0x5388('0x3b')](_0x122f11['name'],_0x5388('0x5e'));}if(_0x122f11[_0x5388('0x5f')]){clearInterval(_0x122f11['handlePredictive']);_0x122f11[_0x5388('0x5f')]=undefined;loggerPredictive[_0x5388('0x3b')](_0x122f11['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x96d44c,_0x2da4dd){return function(_0x37e0ab){loggerPredictive['error'](_0x2da4dd[_0x5388('0x5c')],_0x96d44c);loggerPredictive[_0x5388('0x60')](_0x37e0ab[_0x5388('0x61')]);clearPredictiveAttributes(_0x2da4dd);};}function loggerCatch(_0x41d83b){return function(_0x7f9095){logger['error'](_0x41d83b,util[_0x5388('0x3d')](_0x7f9095,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x107fc5,_0x542e90,_0x1ab22d){return function(_0x30a865){utils[_0x5388('0x62')](_0x542e90,_0x1ab22d,0x0);_0x542e90[_0x5388('0x63')]=0x0;logger[_0x5388('0x60')](_0x107fc5,util[_0x5388('0x3d')](_0x30a865,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3b3e35){return function(_0x5c049f){if(isNotNull(_0x5c049f)&&isNotNull(_0x5c049f[0x0])){if(_0x5c049f[0x0]['contactsRescheduled']>0x0){_0x3b3e35[_0x5388('0x64')]=utils[_0x5388('0x65')]['CONTACTS_RESCHEDULED'];logger[_0x5388('0x42')](_0x5388('0x66')+_0x3b3e35[_0x5388('0x5c')],_0x5c049f[0x0][_0x5388('0x67')],'contacts');}else{_0x3b3e35['message']=utils['CAMPAIGN_STATUS'][_0x5388('0x68')];logger[_0x5388('0x42')](_0x5388('0x69')+_0x3b3e35[_0x5388('0x5c')]);}}};}function createObjHistory(_0x19fc4f,_0x24f6b2,_0x35004f,_0x19ef24,_0xadfa13){_0x19fc4f[_0x5388('0x64')]=_0x35004f;var _0x1e7c64=new Action(_0x19fc4f,_0x24f6b2);var _0x13b0a3=new History(_0x1e7c64);_0x13b0a3[_0x5388('0x6a')]=_0x19ef24;_0x13b0a3[_0x5388('0x6b')]=_0xadfa13;_0x13b0a3[_0x5388('0x6c')]=_0x1e7c64[_0x5388('0x6d')];return _0x13b0a3;}function unlockQueueStatus(_0x42fa29,_0x3345d7){setTimeout(function(){if(_[_0x5388('0x38')](_0x42fa29[_0x5388('0x6e')])){loggerBooked['error'](_0x5388('0x6f'),_0x3345d7);}_0x42fa29[_0x5388('0x6e')]=!![];loggerBooked[_0x5388('0x42')](_0x5388('0x70'),_0x3345d7,JSON[_0x5388('0x71')](_[_0x5388('0x72')](_0x42fa29,[_0x5388('0x5c'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x4d1cf9){return function(){if(!isNotNull(_0x4d1cf9[_0x5388('0x73')])){_0x4d1cf9[_0x5388('0x64')]=utils[_0x5388('0x65')][_0x5388('0x74')];throw _0x4d1cf9[_0x5388('0x5c')]+_0x5388('0x75');}if(!isNotNull(_0x4d1cf9[_0x5388('0x73')]['Intervals'])){_0x4d1cf9['message']=utils['CAMPAIGN_STATUS'][_0x5388('0x74')];throw _0x4d1cf9[_0x5388('0x5c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x5388('0x41')](_0x4d1cf9[_0x5388('0x73')][_0x5388('0x76')]))){_0x4d1cf9[_0x5388('0x64')]=utils[_0x5388('0x65')][_0x5388('0x74')];throw _0x4d1cf9[_0x5388('0x5c')]+_0x5388('0x75');}};}function checkIsIVRCampaignActive(_0x5c395f){return function(){if(!utils['isIVRCampaignActive'](_0x5c395f)){_0x5c395f[_0x5388('0x64')]=utils['CAMPAIGN_STATUS']['INACTIVE'];throw _0x5c395f[_0x5388('0x5c')]+_0x5388('0x77');}};}function emitCampaignSummary(_0x105633){if(utils[_0x5388('0x78')](_0x105633)){emit(util[_0x5388('0x3e')](_0x5388('0x79'),_0x105633[_0x5388('0x5c')]),_0x5388('0x7a'),_0x105633);}}function loggerCatchQueueSummary(_0x181397,_0x5b7b29){return function(_0x46eb6b){clearPredictiveAttributes(_0x5b7b29);emitCampaignSummary(_0x5b7b29);loggerSyncQueueSummary['debug'](_0x181397,util['inspect'](_0x46eb6b,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1b8a81){if(_0x1b8a81[_0x5388('0x7b')]){if(_0x1b8a81[_0x5388('0x7c')]===0x0){_0x1b8a81[_0x5388('0x7b')]=![];_0x1b8a81['message']=utils[_0x5388('0x65')][_0x5388('0x7d')];loggerSyncQueueSummary[_0x5388('0x3b')](_0x5388('0x7e'),_0x1b8a81['name'],'is\x20not\x20active');}else{_0x1b8a81[_0x5388('0x64')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x5388('0x3b')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1b8a81[_0x5388('0x5c')],_0x5388('0x7f'));}emitCampaignSummary(_0x1b8a81);}}function myreject(_0x392473){return function(_0x1a8576){return _0x392473(msgResponse(_0x5388('0x80'),_0x5388('0x81'),JSON['stringify'](_0x1a8576)));};}Dialer[_0x5388('0x13')][_0x5388('0x82')]=function(_0x530b5){return!_[_0x5388('0x38')](_0x530b5)&&_0x530b5&&!_[_0x5388('0x38')](_0x530b5['name'])&&!_[_0x5388('0x38')](_0x530b5[_0x5388('0x83')])&&_0x530b5[_0x5388('0x83')]&&(this[_0x5388('0x1a')][util[_0x5388('0x3e')](_0x5388('0x84'),_0x530b5[_0x5388('0x5c')])]['status']===_0x5388('0x85')||this[_0x5388('0x1a')][util['format'](_0x5388('0x84'),_0x530b5[_0x5388('0x5c')])][_0x5388('0x86')]===_0x5388('0x87'));};Dialer[_0x5388('0x13')][_0x5388('0x88')]=function(_0x1ef4ab){var _0x29d48a=this;return function(){if(!_0x29d48a[_0x5388('0x82')](_0x1ef4ab[_0x5388('0x89')])){if(!_0x29d48a['isTrunkReachable'](_0x1ef4ab[_0x5388('0x8a')])){_0x1ef4ab[_0x5388('0x64')]=utils[_0x5388('0x65')]['TRUNK_NOT_REACHABLE'];throw _0x1ef4ab[_0x5388('0x5c')]+_0x5388('0x8b');}}};};Dialer[_0x5388('0x13')]['checkIfTime']=function(_0x2f70e3,_0x500cd2,_0x4a1478,_0x474335){var _0x36330e=this;return function(){var _0x1da15a=!![];return _0x36330e[_0x5388('0x8c')](_0x2f70e3,_0x500cd2,_0x4a1478,_0x474335,_0x1da15a);};};Dialer[_0x5388('0x13')][_0x5388('0x8d')]=function(_0x359b31,_0x26d292,_0xb5a0b1,_0x18b245){var _0x1cb52e=this;return function(){var _0x4a9d3a=![];return _0x1cb52e[_0x5388('0x8c')](_0x359b31[_0x5388('0x76')],_0x26d292,_0xb5a0b1,_0x18b245,_0x4a9d3a);};};Dialer['prototype'][_0x5388('0x8c')]=function(_0x1f6b7e,_0x33822,_0x3f8e45,_0x1e0b6f,_0x26709e){var _0x4ff9ef=[];return new Promise(function(_0x55fee1,_0x1a08d0){if(!isNotNull(_0x1f6b7e)){_0x1e0b6f[_0x5388('0x64')]=utils[_0x5388('0x65')][_0x5388('0x74')];return _0x1a08d0(msgResponse('ifTime',_0x5388('0x8e'),_0x3f8e45+_0x5388('0x8f')));}if(_[_0x5388('0x41')](_0x1f6b7e)){_0x1e0b6f[_0x5388('0x64')]=utils[_0x5388('0x65')][_0x5388('0x90')];return _0x1a08d0(msgResponse(_0x5388('0x91'),_0x5388('0x8e'),_0x3f8e45+_0x5388('0x92')));}if(_0x33822&&_[_0x5388('0x38')](config[_0x5388('0x93')][_0x33822])){_0x1e0b6f[_0x5388('0x64')]=utils[_0x5388('0x65')][_0x5388('0x94')];return _0x1a08d0(msgResponse(_0x5388('0x91'),_0x5388('0x8e'),_0x3f8e45+_0x5388('0x95')+_0x33822));}if(_[_0x5388('0x96')](_0x1f6b7e)){for(var _0x5d5358=0x0;_0x5d5358<_0x1f6b7e['length'];_0x5d5358+=0x1){_0x4ff9ef['push'](ami[_0x5388('0x97')]({'action':_0x5388('0x98'),'command':util[_0x5388('0x3e')](_0x5388('0x99'),_0x1f6b7e[_0x5d5358][_0x5388('0x9a')],!_[_0x5388('0x38')](config['timezones'][_0x33822])?_0x33822:'')})['then'](function(_0xe35cc7){return _0xe35cc7['content'][_0x5388('0x9b')](_0x5388('0x9c'))>=0x0;})[_0x5388('0x9d')](myreject(_0x1a08d0)));}}else{_0x4ff9ef['push'](ami[_0x5388('0x97')]({'action':_0x5388('0x98'),'command':util[_0x5388('0x3e')](_0x5388('0x99'),_0x1f6b7e,!_['isUndefined'](config[_0x5388('0x93')][_0x33822])?_0x33822:'')})[_0x5388('0x9e')](function(_0x2c6cec){return _0x2c6cec[_0x5388('0x9f')]['indexOf'](_0x5388('0x9c'))>=0x0;})[_0x5388('0x9d')](myreject(_0x1a08d0)));}Promise['all'](_0x4ff9ef)[_0x5388('0x9e')](function(_0x5308e0){var _0x976f15=_[_0x5388('0xa0')](_0x5308e0);if(_0x976f15){return _0x55fee1(_0x976f15);}else{_0x1e0b6f[_0x5388('0x64')]=_0x26709e?utils[_0x5388('0x65')][_0x5388('0xa1')]:utils['CAMPAIGN_STATUS'][_0x5388('0xa2')];return _0x1a08d0(msgResponse(_0x5388('0xa3'),_0x5388('0x8e'),_0x5388('0xa4')+_0x26709e+'\x20'+_0x3f8e45+_0x5388('0xa5')+util[_0x5388('0x3d')](_0x1f6b7e,{'showHidden':![],'depth':null})+_0x5388('0xa6')+_0x33822));}})[_0x5388('0x9d')](function(_0x37c61f){return _0x1a08d0(msgResponse(_0x5388('0x91'),'Failure',JSON[_0x5388('0x71')](_0x37c61f)));});});};Dialer[_0x5388('0x13')][_0x5388('0xa7')]=function(){var _0x301c1b=this;return cmHopper[_0x5388('0xa8')]({'active':![]},{'where':{'active':!![]}})[_0x5388('0x9e')](function(){setInterval(function(){_0x301c1b['syncCampaigns']();},0x3e8);});};Dialer[_0x5388('0x13')][_0x5388('0xa9')]=function(){var _0x37c0b9=this;var _0x21739b;for(var _0x283cc9 in this[_0x5388('0x18')]){if(typeof this[_0x5388('0x18')][_0x283cc9]!==_0x5388('0xaa')){_0x21739b=this['campaigns'][_0x283cc9];if(utils[_0x5388('0x78')](_0x21739b)&&utils['isIVRCampaignActive'](_0x21739b)){_0x21739b[_0x5388('0x7b')]=!![];Promise[_0x5388('0xab')]()[_0x5388('0x9e')](checkIsIVRCampaignActive(_0x21739b))[_0x5388('0x9e')](checkInterval(_0x21739b))['then'](_0x37c0b9[_0x5388('0x88')](_0x21739b))[_0x5388('0x9e')](_0x37c0b9[_0x5388('0xac')](_0x21739b[_0x5388('0xad')],_0x21739b['dialTimezone'],_0x21739b[_0x5388('0x5c')],_0x21739b))[_0x5388('0x9e')](_0x37c0b9[_0x5388('0x8d')](_0x21739b[_0x5388('0x73')],_0x21739b[_0x5388('0xae')],_0x21739b[_0x5388('0x5c')],_0x21739b))[_0x5388('0x9e')](_0x37c0b9['launchHandleIvr'](_0x21739b))['catch'](loggerCatchQueueSummary(_0x5388('0xaf'),_0x21739b));}else{notSendMessagesCampaign(_0x21739b);}}}};Dialer[_0x5388('0x13')][_0x5388('0xb0')]=function(_0x5cdbcb){if(_0x5cdbcb['dialMethod']!==_0x5388('0xb1')){clearPredictiveAttributes(_0x5cdbcb);}switch(_0x5cdbcb[_0x5388('0xb2')]){case _0x5388('0xb3'):this[_0x5388('0xb4')](_0x5cdbcb,0x1);break;case _0x5388('0xb5'):this['handlePower'](_0x5cdbcb,_0x5cdbcb[_0x5388('0xb6')]);break;case _0x5388('0xb1'):this[_0x5388('0xb1')](_0x5cdbcb);break;case _0x5388('0x5'):this[_0x5388('0xb4')](_0x5cdbcb,0x1);break;default:logger[_0x5388('0x60')](_0x5388('0xb7'),_0x5cdbcb[_0x5388('0x5c')],_0x5388('0xb8'));}};Dialer[_0x5388('0x13')]['ifTime']=function(_0x58bb50,_0x21af3e){var _0x4682e4=_0x58bb50[_0x5388('0xae')];var _0x1ba6d8=_0x21af3e?_0x58bb50[_0x5388('0xad')]:_0x58bb50[_0x5388('0x73')]['Intervals'];logger['silly'](_0x5388('0xb9'),_0x1ba6d8,_0x4682e4,_0x58bb50[_0x5388('0x5c')],util[_0x5388('0x3e')](_0x5388('0xba'),_0x58bb50[_0x5388('0x5c')],_0x58bb50['id']));var _0x223499=null;return Interval[_0x5388('0xbb')](_0x1ba6d8,_0x4682e4)[_0x5388('0x9e')](function(_0xc063b5){if(_0xc063b5===!![]){return _0xc063b5;}else{_0x58bb50[_0x5388('0x64')]=_0x21af3e?utils[_0x5388('0x65')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x5388('0x65')][_0x5388('0xa2')];_0x223499=msgResponse(_0x5388('0xa3'),_0x5388('0x8e'),_0x5388('0xa4')+_0x21af3e+'\x20'+_0x58bb50[_0x5388('0x5c')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x1ba6d8,{'showHidden':![],'depth':null})+_0x5388('0xa6')+_0x4682e4);}if(_0x223499!==null){logger['silly'](_0x5388('0xbc'),_0x223499);_0x223499[_0x5388('0xbd')]=_0x21af3e;throw _0x223499;}})[_0x5388('0x9d')](function(_0x3b6bdd){logger['error'](_0x5388('0xbe'),_0x3b6bdd);throw msgResponse(_0x5388('0x80'),_0x5388('0x81'),util[_0x5388('0x3d')](_0x3b6bdd,{'showHidden':![],'depth':null}));});};Dialer[_0x5388('0x13')]['syncAgentConnect']=function(_0x798b5c){if(this[_0x5388('0x17')][_0x798b5c[_0x5388('0xbf')]]){if(this[_0x5388('0x1f')][_0x798b5c[_0x5388('0xc0')]]&&this[_0x5388('0x1f')][_0x798b5c[_0x5388('0xc0')]][_0x5388('0x39')]!=='ivr'){this['updateOriginated'](this[_0x5388('0x17')][_0x798b5c['queue']]);this[_0x5388('0x1f')][_0x798b5c[_0x5388('0xc0')]][_0x5388('0xc1')]=moment()[_0x5388('0x3e')](_0x5388('0xc2'));}}};Dialer[_0x5388('0x13')]['syncAgentComplete']=function(_0x9c565b){var _0x56757f=this[_0x5388('0x1f')][_0x9c565b['uniqueid']];if(this[_0x5388('0x17')][_0x9c565b[_0x5388('0xbf')]]){if(_0x56757f&&_0x56757f[_0x5388('0x39')]!==_0x5388('0xc3')){delete this[_0x5388('0x1f')][_0x9c565b[_0x5388('0xc0')]];this[_0x5388('0x17')][_0x9c565b[_0x5388('0xbf')]][_0x5388('0xc4')]+=0x1;var _0x256a8a=new AgentComplete(_0x56757f,_0x9c565b);if(_0x9c565b[_0x5388('0xc5')]==='agent'){_0x256a8a['agiafterat']=this['voiceQueues'][_0x9c565b[_0x5388('0xbf')]][_0x5388('0xc6')]&&this[_0x5388('0x17')][_0x9c565b[_0x5388('0xbf')]][_0x5388('0xc7')]?moment()[_0x5388('0x3e')](_0x5388('0xc2')):undefined;}hopperUtils[_0x5388('0xc8')](_0x256a8a)[_0x5388('0x9d')](loggerCatch(_0x5388('0xc9')));hopperUtils[_0x5388('0xca')](_0x256a8a)['catch'](loggerCatch(_0x5388('0xcb')));}}};Dialer[_0x5388('0x13')]['syncQueueCallerAbandon']=function(_0x5414d6){var _0x149514=this['uniqueId'][_0x5414d6[_0x5388('0xc0')]];var _0x2acdc8=this;var _0x1bdcfe=![];var _0x52e794;var _0x511a74;if(this[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]]){if(_0x149514&&_0x149514[_0x5388('0x39')]!==_0x5388('0xc3')){delete this[_0x5388('0x1f')][_0x5414d6[_0x5388('0xc0')]];this[_0x5388('0xcc')](this['voiceQueues'][_0x5414d6['queue']]);_0x149514[_0x5388('0xcd')]=moment()[_0x5388('0x3e')](_0x5388('0xc2'));var _0x14175d=new QueueCallerAbandon(_0x149514,_0x5414d6);if(utils[_0x5388('0x5b')](_0x149514[_0x5388('0xcd')],_0x149514[_0x5388('0xce')])>=_0x149514[_0x5388('0xcf')]){this['voiceQueues'][_0x5414d6['queue']][_0x5388('0x47')]+=0x1;this[_0x5388('0x17')][_0x5414d6['queue']][_0x5388('0xd0')]+=0x1;this[_0x5388('0x17')][_0x5414d6['queue']][_0x5388('0xd1')]+=0x1;_0x14175d[_0x5388('0x6a')]=0xa;_0x14175d[_0x5388('0x6b')]=_0x5388('0xd2');_0x14175d[_0x5388('0xd3')]='TIMEOUT';_0x14175d[_0x5388('0xd4')]=this[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]]['dialQueueProject2']?moment()['format'](_0x5388('0xc2')):undefined;_0x14175d[_0x5388('0xd5')]+=0x1;_0x14175d[_0x5388('0xd6')]+=0x1;_0x52e794=this['voiceQueues'][_0x5414d6[_0x5388('0xbf')]]['dialDropRetryFrequency'];_0x511a74=this[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]][_0x5388('0xd7')];hopperUtils[_0x5388('0xd8')](_0x14175d,_0x14175d[_0x5388('0x6a')],_0x149514[_0x5388('0xd9')])['then'](function(_0x26745d){_0x1bdcfe=_0x26745d[_0x5388('0xda')]==0x1;if(_0x14175d[_0x5388('0xd5')]>=_0x2acdc8[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]][_0x5388('0xdb')]){_0x2acdc8[_0x5388('0xdc')](_0x14175d,_0x26745d[_0x5388('0xda')]);}else{hopperUtils[_0x5388('0xdd')]({'active':![],'countdropretry':_0x14175d[_0x5388('0xd5')],'scheduledat':moment()['add'](_0x2acdc8[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]][_0x5388('0xde')],_0x5388('0xdf'))[_0x5388('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x149514['ContactId'],'ListId':_0x149514[_0x5388('0xe0')],'VoiceQueueId':_0x149514[_0x5388('0xe1')]||undefined,'CampaignId':_0x149514[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0xe3')));var _0x5c8c26=new History(_0x14175d);_0x5c8c26[_0x5388('0x6a')]=0xa;_0x5c8c26[_0x5388('0x6b')]=_0x5388('0xd2');_0x5c8c26[_0x5388('0x6d')]=moment()[_0x5388('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c8c26[_0x5388('0x6c')]=_0x5c8c26[_0x5388('0x6d')];_0x5c8c26[_0x5388('0xe4')]=_0x14175d['calleridname'];_0x5c8c26[_0x5388('0xe5')]=_0x14175d['calleridnum'];hopperUtils[_0x5388('0xc8')](_0x5c8c26)[_0x5388('0x9d')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x5388('0x9e')](function(){if(_0x1bdcfe)hopperUtils['swapAdditionalPhones'](_0x14175d,_0x52e794,_0x511a74)[_0x5388('0x9e')](function(){return 0x1;});});}else{this[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]][_0x5388('0xe6')]+=0x1;this[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]][_0x5388('0xe7')]+=0x1;_0x14175d[_0x5388('0x6a')]=0xb;_0x14175d[_0x5388('0x6b')]=_0x5388('0xe8');_0x14175d[_0x5388('0xd3')]=_0x5388('0xe9');_0x14175d['countabandonedretry']+=0x1;_0x14175d[_0x5388('0xd6')]+=0x1;_0x52e794=this[_0x5388('0x17')][_0x5414d6['queue']][_0x5388('0xea')];_0x511a74=this['voiceQueues'][_0x5414d6[_0x5388('0xbf')]][_0x5388('0xd7')];hopperUtils[_0x5388('0xd8')](_0x14175d,_0x14175d['state'],_0x149514[_0x5388('0xd9')])['then'](function(_0x589f33){if(_0x14175d[_0x5388('0xeb')]>=_0x2acdc8[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]]['dialAbandonedMaxRetry']){_0x2acdc8['queueCallerAbandonCreateState'](_0x14175d,_0x589f33[_0x5388('0xda')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x14175d[_0x5388('0xeb')],'scheduledat':moment()[_0x5388('0xec')](_0x2acdc8[_0x5388('0x17')][_0x5414d6[_0x5388('0xbf')]][_0x5388('0xea')],'minutes')[_0x5388('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x149514[_0x5388('0xed')],'ListId':_0x149514[_0x5388('0xe0')],'VoiceQueueId':_0x149514[_0x5388('0xe1')]||undefined,'CampaignId':_0x149514[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0xee')));var _0x2461df=new History(_0x14175d);_0x2461df[_0x5388('0x6a')]=0xb;_0x2461df[_0x5388('0x6b')]=_0x5388('0xe8');_0x2461df['starttime']=moment()[_0x5388('0x3e')](_0x5388('0xc2'));_0x2461df['endtime']=_0x2461df['starttime'];_0x2461df[_0x5388('0xe4')]=_0x14175d[_0x5388('0xe4')];_0x2461df[_0x5388('0xe5')]=_0x14175d[_0x5388('0xe5')];hopperUtils[_0x5388('0xc8')](_0x2461df)['catch'](loggerCatch(_0x5388('0xef')));}})[_0x5388('0x9e')](function(){if(_0x1bdcfe)hopperUtils['swapAdditionalPhones'](_0x14175d,_0x52e794,_0x511a74)[_0x5388('0x9e')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x4ca2a9){if(this[_0x5388('0x1d')][_0x4ca2a9[_0x5388('0xc0')]]){this['actions'][_0x4ca2a9[_0x5388('0xc0')]]['channel']=_0x4ca2a9[_0x5388('0xf0')];}if(this['uniqueId'][_0x4ca2a9[_0x5388('0xc0')]]){this[_0x5388('0x1f')][_0x4ca2a9[_0x5388('0xc0')]]['channel']=_0x4ca2a9[_0x5388('0xf0')];}};Dialer[_0x5388('0x13')][_0x5388('0x33')]=function(_0x152cc5){if(!this[_0x5388('0x1d')][_0x152cc5['actionid']]){return;}var _0x4d8209=this[_0x5388('0x17')][this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]][_0x5388('0xbf')]][_0x5388('0xf2')]||'rrmemory';if(_0x4d8209===_0x5388('0xf3')){if(this['actions'][_0x152cc5[_0x5388('0xf1')]]&&_[_0x5388('0xf4')](this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]][_0x5388('0xf5')])&&_0x152cc5[_0x5388('0x86')]==='1'&&_0x152cc5[_0x5388('0xf6')]==='0'){if(this['agents'][_0x152cc5['stateinterface']]){if(!this['agents'][_0x152cc5['stateinterface']][_0x5388('0xf5')]){this['agents'][_0x152cc5[_0x5388('0xf7')]][_0x5388('0xf5')]=!![];this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]][_0x5388('0xf5')]=!![];this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]]['stateinterface']=_0x152cc5[_0x5388('0xf7')];}}}}else if(_0x4d8209===_0x5388('0xf8')){if(this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]]){if(this['agents'][_0x152cc5['stateinterface']]){this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]][_0x5388('0xf7')]=_0x152cc5[_0x5388('0xf7')];if(_[_0x5388('0xf4')](this[_0x5388('0xf9')][this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]][_0x5388('0xbf')]])){this[_0x5388('0xf9')][this[_0x5388('0x1d')][_0x152cc5[_0x5388('0xf1')]][_0x5388('0xbf')]]=[];}this['queueBooked'][this['actions'][_0x152cc5[_0x5388('0xf1')]][_0x5388('0xbf')]][_0x5388('0xfa')](_[_0x5388('0x5a')](_[_0x5388('0x72')](this['actions'][_0x152cc5['actionid']],[_0x5388('0xfb'),'stateinterface']),{'status':_0x152cc5['status'],'paused':_0x152cc5[_0x5388('0xf6')]}));}}}};Dialer[_0x5388('0x13')]['syncQueueStatusComplete']=function(_0x3dfdff){if(!this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]]){return;}var _0x213f4c=this;var _0x40c2ca=this[_0x5388('0x17')][this['actions'][_0x3dfdff[_0x5388('0xf1')]]['queue']];var _0x734cd9=_0x40c2ca[_0x5388('0xf2')]||_0x5388('0xf8');if(_0x734cd9==='roundrobin'){if(this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]]&&this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xf7')]){this['preview'][_0x5388('0xfc')](this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xfb')],this[_0x5388('0x1d')][_0x3dfdff['actionid']][_0x5388('0xf7')])[_0x5388('0x9d')](function(_0x3c294b){logger[_0x5388('0x60')](_0x5388('0xfd'),util[_0x5388('0x3d')](_0x3c294b,{'showHidden':![],'depth':null}));})[_0x5388('0xfe')](function(){_0x213f4c[_0x5388('0xcc')](_0x213f4c[_0x5388('0x17')][_0x213f4c[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]]);_0x213f4c['agents'][_0x213f4c[_0x5388('0x1d')][_0x3dfdff['actionid']][_0x5388('0xf7')]][_0x5388('0xf5')]=![];delete _0x213f4c[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]];unlockQueueStatus(_0x40c2ca);});}else{this[_0x5388('0xcc')](this[_0x5388('0x17')][this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]]);hopperUtils[_0x5388('0xdd')]({'active':![],'ContactId':this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xed')],'ListId':this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xe0')],'VoiceQueueId':this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0xff')));delete this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]];unlockQueueStatus(_0x40c2ca);}}else if(_0x734cd9==='rrmemory'){var _0x4d6f0a;if(this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]]&&!_[_0x5388('0x41')](this['queueBooked'][this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]])){if(this[_0x5388('0x22')][_0x213f4c[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]]['queue']]){this[_0x5388('0x22')][_0x213f4c[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]]=this[_0x5388('0x22')][this['actions'][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]]?this['queueBookedRR'][this['actions'][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]]:this[_0x5388('0xf9')][this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]]?this[_0x5388('0xf9')][this[_0x5388('0x1d')][_0x3dfdff['actionid']][_0x5388('0xbf')]][_0x5388('0x100')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x3dfdff['actionid']][_0x5388('0xbf')]][_0x5388('0x100')]=this[_0x5388('0x22')][this[_0x5388('0x1d')][_0x3dfdff[_0x5388('0xf1')]][_0x5388('0xbf')]];for(var _0x120795=0x0;_0x120795=_0x1818ae[_0x5388('0x125')]){_0x2e3bd2[_0x5388('0x126')](_0x478393,_0x39cfd2,_0x5aa072,'reason19\x20machine....');}else{if(_0x478393[_0x5388('0x123')]>=_0x1818ae[_0x5388('0x127')]){_0x2e3bd2['createStateFinal'](_0x478393,_0x39cfd2,_0x5aa072,_0x5388('0x128'));}else{hopperUtils[_0x5388('0xdd')]({'active':![],'countmachineretry':_0x478393['countmachineretry'],'scheduledat':moment()[_0x5388('0xec')](_0x1818ae[_0x5388('0x129')],_0x5388('0xdf'))[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x478393[_0x5388('0xed')],'ListId':_0x478393['ListId'],'VoiceQueueId':_0x478393[_0x5388('0xe1')]||undefined,'CampaignId':_0x478393[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0x12a')));_0x39cfd2({'reschedule':0x1});}}});}if(_0x326b3a[_0x5388('0x39')]===_0x5388('0xc3')&&this[_0x5388('0x18')][_0x326b3a[_0x5388('0xbf')]]['dialAMDActive']&&_0x59efe2[_0x5388('0x114')]===_0x5388('0x115')){delete this['uniqueId'][_0x59efe2['uniqueid']];this[_0x5388('0xcc')](this[_0x5388('0x18')][_0x326b3a[_0x5388('0xbf')]]);_0x371d9f=new Hangup(_0x326b3a,_0x59efe2);_0x371d9f[_0x5388('0x6a')]=0x12;_0x371d9f[_0x5388('0x6b')]=_0x5388('0x12b');_0x371d9f[_0x5388('0x117')]=_0x5388('0x118');ami[_0x5388('0x119')](_0x5388('0x11a'),ut[_0x5388('0x11b')](_0x371d9f,_0x5388('0x12c')));this[_0x5388('0x11c')](_0x371d9f,_0x5388('0x12d'),_0x5388('0x12e'));}if(_0x326b3a['type']==='ivr'&&this[_0x5388('0x18')][_0x326b3a['queue']][_0x5388('0x113')]&&_0x59efe2['value']===_0x5388('0x11f')){return new Promise(function(_0xaf0d9f,_0x1cbdbe){delete _0x2e3bd2[_0x5388('0x1f')][_0x59efe2['uniqueid']];_0x2e3bd2[_0x5388('0xcc')](_0x2e3bd2[_0x5388('0x18')][_0x326b3a['queue']]);_0x2e3bd2[_0x5388('0x18')][_0x326b3a[_0x5388('0xbf')]]['outboundAnswerCallsDay']+=0x1;_0x2e3bd2['campaigns'][_0x326b3a['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x5cb63a=_0x2e3bd2[_0x5388('0x18')][_0x326b3a['queue']];var _0x50d889=new Hangup(_0x326b3a,_0x59efe2);_0x50d889[_0x5388('0x6a')]=0x13;_0x50d889[_0x5388('0x6b')]=_0x5388('0x12f');_0x50d889[_0x5388('0x117')]=_0x5388('0x118');_0x50d889[_0x5388('0x123')]+=0x1;_0x50d889[_0x5388('0xd6')]+=0x1;_0x50d889[_0x5388('0x12c')]=!![];ami[_0x5388('0x119')](_0x5388('0x11a'),ut[_0x5388('0x11b')](_0x50d889,'amd'));hopperUtils[_0x5388('0xc8')](_0x50d889)[_0x5388('0x9d')](loggerCatch(_0x5388('0x130')));if(_0x50d889[_0x5388('0x131')]+_0x50d889[_0x5388('0x120')]+_0x50d889[_0x5388('0x121')]+_0x50d889['countnosuchnumberretry']+_0x50d889[_0x5388('0xd5')]+_0x50d889[_0x5388('0xeb')]+_0x50d889[_0x5388('0x123')]+_0x50d889[_0x5388('0x124')]>=_0x5cb63a['dialGlobalMaxRetry']){_0x2e3bd2['stateGlobal'](_0x50d889,_0xaf0d9f,_0x1cbdbe,_0x5388('0x132'));}else{if(_0x50d889[_0x5388('0x123')]>=_0x5cb63a[_0x5388('0x127')]){_0x2e3bd2[_0x5388('0x133')](_0x50d889,_0xaf0d9f,_0x1cbdbe,_0x5388('0x128'));}else{hopperUtils[_0x5388('0xdd')]({'active':![],'countmachineretry':_0x50d889[_0x5388('0x123')],'scheduledat':moment()['add'](_0x5cb63a[_0x5388('0x129')],_0x5388('0xdf'))[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x50d889[_0x5388('0xed')],'ListId':_0x50d889[_0x5388('0xe0')],'VoiceQueueId':_0x50d889[_0x5388('0xe1')]||undefined,'CampaignId':_0x50d889[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch('[rescheduleContact][Machine]'));_0xaf0d9f({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x5388('0x2f')]=function(_0x4620d1){var _0x5097de=this[_0x5388('0x1f')][_0x4620d1[_0x5388('0xc0')]];var _0x52b4ab;if(_0x5097de&&_0x5097de[_0x5388('0x39')]===_0x5388('0xc3')){delete this[_0x5388('0x1f')][_0x4620d1[_0x5388('0xc0')]];this[_0x5388('0xcc')](this[_0x5388('0x18')][_0x5097de['queue']]);this[_0x5388('0x18')][_0x5097de['queue']]['ivrAnswerCallsDay']+=0x1;_0x52b4ab=new Hangup(_0x5097de,_0x4620d1);hopperUtils[_0x5388('0xc8')](_0x52b4ab)['catch'](loggerCatch(_0x5388('0x134')));hopperUtils[_0x5388('0xca')](_0x52b4ab)[_0x5388('0x9d')](loggerCatch(_0x5388('0x135')));}if(_0x5097de&&_0x5097de[_0x5388('0x39')]!==_0x5388('0xc3')&&isNotNull(this[_0x5388('0x17')][_0x5097de[_0x5388('0xbf')]][_0x5388('0x136')])){delete this[_0x5388('0x1f')][_0x4620d1[_0x5388('0xc0')]];this[_0x5388('0xcc')](this['voiceQueues'][_0x5097de[_0x5388('0xbf')]]);this[_0x5388('0x17')][_0x5097de['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x5097de[_0x5388('0xbf')]][_0x5388('0x116')]+=0x1;_0x52b4ab=new Hangup(_0x5097de,_0x4620d1);_0x52b4ab[_0x5388('0x6a')]=0x10;_0x52b4ab[_0x5388('0x6b')]='AnswerAGI';_0x52b4ab[_0x5388('0x117')]=_0x5388('0x137');hopperUtils[_0x5388('0xc8')](_0x52b4ab)[_0x5388('0x9d')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x5388('0xca')](_0x52b4ab)[_0x5388('0x9d')](loggerCatch(_0x5388('0x135')));}if(_0x5097de&&_0x5097de[_0x5388('0x39')]!==_0x5388('0xc3')&&!isNotNull(this[_0x5388('0x17')][_0x5097de[_0x5388('0xbf')]]['dialQueueProject'])){delete this[_0x5388('0x1f')][_0x4620d1['uniqueid']];this[_0x5388('0xcc')](this[_0x5388('0x17')][_0x5097de[_0x5388('0xbf')]]);this['voiceQueues'][_0x5097de['queue']][_0x5388('0x138')]+=0x1;_0x52b4ab=new Hangup(_0x5097de,_0x4620d1);_0x52b4ab[_0x5388('0x6a')]=0xc;_0x52b4ab[_0x5388('0x6b')]=_0x4620d1[_0x5388('0x139')];_0x52b4ab['membername']='Unknow';hopperUtils[_0x5388('0xc8')](_0x52b4ab)['catch'](loggerCatch(_0x5388('0x134')));hopperUtils[_0x5388('0xca')](_0x52b4ab)[_0x5388('0x9d')](loggerCatch(_0x5388('0x135')));}};Dialer[_0x5388('0x13')]['syncQueueSummary']=function(_0x40513f){var _0x3a6bcd=this;if(!_0x3a6bcd['queuesSummary'][_0x40513f[_0x5388('0x5c')]]){_0x3a6bcd[_0x5388('0x23')][_0x40513f[_0x5388('0x5c')]]={'running':![]};}else if(_0x3a6bcd[_0x5388('0x23')][_0x40513f[_0x5388('0x5c')]][_0x5388('0x13a')]===!![]){return;}else if(_0x3a6bcd['queuesSummary'][_0x40513f['name']][_0x5388('0x13a')]===![]){_0x3a6bcd['queuesSummary'][_0x40513f[_0x5388('0x5c')]][_0x5388('0x13a')]=!![];}var _0x5b1864=_0x3a6bcd[_0x5388('0x17')][_0x40513f[_0x5388('0x5c')]];var _0x21d54e=_0x5b1864[_0x5388('0x64')]!==utils['CAMPAIGN_STATUS'][_0x5388('0x7d')];var _0x91ff7a=utils[_0x5388('0x13b')](_0x5b1864);_0x5b1864[_0x5388('0x13c')]=utils['getQueueCampaignStatusMessage'](_0x5b1864,_0x3a6bcd['trunks']);Promise['resolve']()[_0x5388('0x9e')](function(){if(_0x5b1864[_0x5388('0x13c')]===utils[_0x5388('0x65')][_0x5388('0x7d')]){if(_0x21d54e){clearPredictiveAttributes(_0x5b1864);_0x40513f[_0x5388('0x20')]=undefined;_0x40513f[_0x5388('0x21')]=undefined;}if(_0x5b1864[_0x5388('0x13c')]===utils['CAMPAIGN_STATUS'][_0x5388('0x7d')]){_0x40513f[_0x5388('0x13d')]=0x0;_0x40513f[_0x5388('0xf6')]=0x0;_0x40513f[_0x5388('0x13e')]=0x0;_0x40513f[_0x5388('0x13f')]=0x0;_0x40513f[_0x5388('0x140')]=0x0;}}else if(_0x5b1864['statusMessage']===utils[_0x5388('0x65')]['ACTIVE']&&!_0x91ff7a){return _0x3a6bcd[_0x5388('0x91')](_0x5b1864,!![])['then'](function(){return _0x3a6bcd[_0x5388('0x91')](_0x5b1864,![]);})[_0x5388('0x9e')](function(){return _0x3a6bcd[_0x5388('0xb0')](_0x5b1864);})[_0x5388('0x9d')](function(_0x4c090e){loggerSyncQueueSummary[_0x5388('0x3b')]('[syncQueueSummary]',util[_0x5388('0x3d')](_0x4c090e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5b1864);});}else{clearPredictiveAttributes(_0x5b1864);}})[_0x5388('0x9e')](function(){var _0x43d0ba=_0x40513f['compareToOutboundQueue'](_0x5b1864);if(_0x43d0ba||_0x5b1864[_0x5388('0x141')]){_0x5b1864[_0x5388('0x141')]=![];_0x40513f['updateReportFromOutboundQueue'](_0x5b1864);Object['assign'](_0x5b1864,_0x40513f);emitOutboundVoiceQueueSummary(_0x40513f);}_0x3a6bcd['queuesSummary'][_0x5b1864['name']]['running']=![];})[_0x5388('0x9d')](function(_0x275d1e){logger[_0x5388('0x60')]('[syncQueueSummary]',util[_0x5388('0x3d')](_0x275d1e,{'showHidden':![],'depth':null}));_0x3a6bcd[_0x5388('0x23')][_0x5b1864['name']][_0x5388('0x13a')]=![];});};Dialer['prototype'][_0x5388('0x2d')]=_[_0x5388('0x142')](function(){var _0x32c221=_['filter'](this[_0x5388('0x17')],function(_0x349094){return _0x349094[_0x5388('0x143')];});var _0x5e19b0=_[_0x5388('0x144')](this[_0x5388('0x19')],function(_0x2189e8){return _0x2189e8[_0x5388('0x145')]&&_0x2189e8[_0x5388('0x86')]==='reachable';});if(_0x32c221[_0x5388('0x101')]>0x0&&_0x5e19b0[_0x5388('0x101')]>0x0){return Promise[_0x5388('0xab')]()[_0x5388('0x9e')](cmHopper[_0x5388('0x146')](_[_0x5388('0x147')](_0x32c221,'id'),previewRecallmeReminderInterval,_[_0x5388('0x147')](_0x5e19b0,'id')))['then'](function(_0x27446b){for(var _0x343e99=0x0;_0x343e99<_0x27446b[_0x5388('0x101')];_0x343e99++){var _0x2e3e0d=_0x27446b[_0x343e99]['Agent'][_0x5388('0x5c')];if(_0x2e3e0d)io['to'](util[_0x5388('0x3e')](_0x5388('0x148'),_0x2e3e0d))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x27446b[_0x343e99]});}})[_0x5388('0x9d')](function(_0x46e54b){logger['error'](_0x5388('0x149'),_0x46e54b);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5388('0x13')][_0x5388('0x36')]=function(){var _0xe6139d=this;setInterval(function(){_0xe6139d['clearZombieChannels'](_0xe6139d[_0x5388('0x1f')],_0x5388('0x14a'));_0xe6139d[_0x5388('0x14b')](_0xe6139d['actions'],'[actions]');},0x32c8);};Dialer[_0x5388('0x13')]['clearZombieChannels']=function(_0x1ce32a,_0x15f178){var _0x126cfd=this;for(var _0x5f026c in _0x1ce32a){if(typeof _0x1ce32a[_0x5f026c]!==_0x5388('0xaa')){this[_0x5388('0x16')]['enqueue'](function(){if(!_[_0x5388('0xf4')](_0x1ce32a[_0x5f026c])){return ami[_0x5388('0x97')]({'action':_0x5388('0x86'),'channel':_0x1ce32a[_0x5f026c][_0x5388('0xf0')]})[_0x5388('0x9d')](function(_0x4e1c5a){if(_0x4e1c5a['message']===_0x5388('0x14c')){setTimeout(function(){if(_0x1ce32a[_0x5f026c]&&_0x1ce32a[_0x5f026c][_0x5388('0x39')]!==_0x5388('0xc3')){_0x126cfd[_0x5388('0xcc')](_0x126cfd[_0x5388('0x17')][_0x1ce32a[_0x5f026c][_0x5388('0xbf')]]);logger[_0x5388('0x60')](_0x5388('0x14d'),_0x15f178,_0x5f026c,_0x1ce32a[_0x5f026c][_0x5388('0xbf')]);delete _0x1ce32a[_0x5f026c];}if(_0x1ce32a[_0x5f026c]&&_0x1ce32a[_0x5f026c][_0x5388('0x39')]===_0x5388('0xc3')){_0x126cfd[_0x5388('0xcc')](_0x126cfd[_0x5388('0x18')][_0x1ce32a[_0x5f026c][_0x5388('0xbf')]]);logger['error'](_0x5388('0x14e'),_0x15f178,_0x5f026c,_0x1ce32a[_0x5f026c][_0x5388('0xbf')]);delete _0x1ce32a[_0x5f026c];}},0x2328);}});}});}}};Dialer['prototype'][_0x5388('0x14f')]=function(_0x4ad45b){return Promise[_0x5388('0xab')]()[_0x5388('0x9e')](voiceQueueRt[_0x5388('0x14f')](_0x4ad45b))[_0x5388('0x9d')](loggerCatch(_0x5388('0x150')));};Dialer[_0x5388('0x13')][_0x5388('0xcc')]=function(_0x3dba16){if(!_[_0x5388('0x38')](_0x3dba16)&&_0x3dba16!==null){if(typeof _0x3dba16[_0x5388('0x7c')]!==_0x5388('0xaa')){if(_0x3dba16[_0x5388('0x7c')]>0x0){_0x3dba16['originated']-=0x1;}else{logger[_0x5388('0x60')](_0x5388('0x151'));}}}else{logger[_0x5388('0x60')](_0x5388('0x152'));}};Dialer['prototype'][_0x5388('0x153')]=function(_0x195909,_0x4f2bd3){var _0x3dd30c=this;return function(_0x8db37){_0x3dd30c[_0x5388('0xcc')](_0x4f2bd3);logger[_0x5388('0x60')](_0x195909,util['inspect'](_0x8db37,{'showHidden':![],'depth':null}));};};Dialer[_0x5388('0x13')]['emptyContact']=function(_0x8f95ea,_0x43898f,_0x751064){var _0x23364d={'state':0x19,'statedesc':_0x5388('0x154')};this[_0x5388('0xcc')](_0x43898f);this[_0x5388('0x11c')](_[_0x5388('0x5a')](_0x23364d,_[_0x5388('0x72')](_0x751064,[_0x5388('0xed'),_0x5388('0xe0'),_0x5388('0x155'),_0x5388('0xe1'),_0x5388('0xe2')])),_0x5388('0x156'),_0x5388('0x157'));logger[_0x5388('0x60')](_0x8f95ea);};Dialer[_0x5388('0x13')]['saveInDb']=function(_0x2ceb27,_0x4c76f5,_0x3e10f3){hopperUtils['createHistory'](_0x2ceb27)[_0x5388('0x9d')](loggerCatch(_0x4c76f5));hopperUtils[_0x5388('0xca')](_0x2ceb27)[_0x5388('0x9d')](loggerCatch(_0x3e10f3));};Dialer[_0x5388('0x13')][_0x5388('0xdc')]=function(_0x3f8f73,_0x30565f){hopperUtils[_0x5388('0xc8')](_0x3f8f73)[_0x5388('0x9d')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x30565f==0x0){hopperUtils[_0x5388('0xca')](_0x3f8f73)[_0x5388('0x9d')](loggerCatch(_0x5388('0x158')));}};Dialer[_0x5388('0x13')][_0x5388('0x149')]=function(_0x172cf6){return Promise['resolve']()['then'](cmHopper[_0x5388('0x146')](_0x172cf6['id'],previewRecallmeReminderInterval))[_0x5388('0x9e')](function(_0x4a43a0){for(var _0x358bf4=0x0;_0x358bf4<_0x4a43a0[_0x5388('0x101')];_0x358bf4++){var _0x479388=_0x4a43a0[_0x358bf4]['Agent'][_0x5388('0x5c')];if(_0x479388)io['to'](util['format']('user:%s',_0x479388))[_0x5388('0x119')](_0x5388('0x159'),{'hopper':_0x4a43a0[_0x358bf4]});}})[_0x5388('0x9d')](function(){});};Dialer[_0x5388('0x13')][_0x5388('0x15a')]=function(_0x4e3355){var _0x328e24=this;return function(){_0x328e24[_0x5388('0x15b')](_0x4e3355);};};Dialer[_0x5388('0x13')][_0x5388('0x15c')]=function(_0x3164cc,_0x24895c){var _0x43364b=this;var _0x173af6=uuid['v4']();this['actions'][_0x173af6]=new Action(_0x3164cc,_0x24895c,_0x173af6);return new Promise(function(_0x51b4ef,_0x37f355){if(_[_0x5388('0x38')](_0x3164cc)&&typeof _0x3164cc!=='object'){return _0x37f355(msgResponse('originate',_0x5388('0x8e'),_0x5388('0x15d')));}if(_[_0x5388('0x38')](_0x24895c[_0x5388('0x15e')])||_0x24895c[_0x5388('0x15e')]===null){return _0x37f355(msgResponse(_0x5388('0x15f'),_0x5388('0x8e'),_0x5388('0x160')));}var _0x1efd57={'XMD-CALLERID':_0x43364b[_0x5388('0x1d')][_0x173af6]['getCaller'](),'XMD-AGI':_0x3164cc[_0x5388('0x136')]?util[_0x5388('0x3e')](_0x5388('0x161'),ipAgi,_0x3164cc[_0x5388('0x136')]):_0x5388('0x162'),'XMD-AGIAFTER':_0x3164cc[_0x5388('0xc6')]?util[_0x5388('0x3e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3164cc[_0x5388('0xc6')]):'NONE','XMD-QUEUE':utils[_0x5388('0x163')](_0x3164cc)?util[_0x5388('0x3e')](_0x5388('0x164'),_0x3164cc['name'],_0x3164cc[_0x5388('0x165')]||'',_0x3164cc[_0x5388('0xc7')]?'c':'',_0x3164cc[_0x5388('0xcf')]||0x3):'NONE','XMD-CONTACTID':_0x24895c[_0x5388('0xed')],'XMD-CDRTYPE':_0x5388('0x166'),'CALLERID(all)':_0x43364b[_0x5388('0x1d')][_0x173af6][_0x5388('0x167')](),'XMD-AMD':_0x3164cc['dialAMDActive']?_0x5388('0x168'):_0x5388('0x162'),'XMD-DESTINATION':_0x5388('0x112')};if(_0x3164cc[_0x5388('0x113')]){_0x1efd57[_0x5388('0x169')]=_0x3164cc[_0x5388('0x16a')]||0x9c4;_0x1efd57[_0x5388('0x16b')]=_0x3164cc['dialAMDGreeting']||0x5dc;_0x1efd57[_0x5388('0x16c')]=_0x3164cc[_0x5388('0x16d')]||0x320;_0x1efd57['XMD-AMDTOTALANALYSISTIME']=_0x3164cc['dialAMDTotalAnalysisTime']||0x1388;_0x1efd57[_0x5388('0x16e')]=_0x3164cc[_0x5388('0x16f')]||0x64;_0x1efd57[_0x5388('0x170')]=_0x3164cc[_0x5388('0x171')]||0x32;_0x1efd57[_0x5388('0x172')]=_0x3164cc[_0x5388('0x173')]||0x3;_0x1efd57[_0x5388('0x174')]=_0x3164cc[_0x5388('0x175')]||0x100;_0x1efd57[_0x5388('0x176')]=_0x3164cc[_0x5388('0x177')]||0x1388;}if(utils[_0x5388('0x163')](_0x3164cc)){_0x1efd57[_0x5388('0x178')]=_0x24895c[_0x5388('0xe1')];}else{_0x1efd57['XMD-CAMPAIGNID']=_0x24895c[_0x5388('0xe2')];}var _0x3490c7=utils[_0x5388('0x179')](_0x24895c['Contact']);Object['assign'](_0x1efd57,_0x3490c7);var _0xa1f3c8=_0x43364b['isTrunkReachable'](_0x3164cc[_0x5388('0x89')])?utils[_0x5388('0x17a')](_0x3164cc[_0x5388('0x89')][_0x5388('0x17b')],_0x3164cc[_0x5388('0x17c')],_0x3164cc[_0x5388('0x17d')]>0x0?utils[_0x5388('0x17e')](_0x3164cc[_0x5388('0x17f')],_0x3164cc[_0x5388('0x17d')]):_0x3164cc[_0x5388('0x17f')]):utils[_0x5388('0x17a')](_[_0x5388('0xf4')](_0x3164cc[_0x5388('0x8a')])?_0x3164cc[_0x5388('0x89')][_0x5388('0x17b')]:_0x3164cc['TrunkBackup'][_0x5388('0x17b')],_0x3164cc[_0x5388('0x17c')],_0x3164cc['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x5388('0x17e')](_0x3164cc[_0x5388('0x17f')],_0x3164cc[_0x5388('0x17d')]):_0x3164cc[_0x5388('0x17f')]);if(_0xa1f3c8){_0x1efd57[_0x5388('0x180')]=_0x43364b[_0x5388('0x1d')][_0x173af6]['originatecalleridname']=utils[_0x5388('0x181')](_0xa1f3c8);_0x1efd57[_0x5388('0x182')]=_0x24895c[_0x5388('0x15e')];}_0x3164cc[_0x5388('0x183')]=_0x1efd57;return ami[_0x5388('0x97')]({'actionid':_0x173af6,'action':_0x5388('0x15f'),'channel':_0x43364b['isTrunkReachable'](_0x3164cc['Trunk'])?util['format']('SIP/%s/%s%s',_0x3164cc[_0x5388('0x89')]['name'],isNotNull(_0x3164cc[_0x5388('0x184')])?_0x3164cc[_0x5388('0x184')][_0x5388('0x185')]()||'':'',_0x3164cc[_0x5388('0x186')]>0x0?_0x24895c[_0x5388('0x15e')][_0x5388('0x187')](_0x3164cc[_0x5388('0x186')]):_0x24895c['phone']):util[_0x5388('0x3e')](_0x5388('0x188'),_['isNil'](_0x3164cc[_0x5388('0x8a')])?_0x3164cc[_0x5388('0x89')][_0x5388('0x5c')]:_0x3164cc[_0x5388('0x8a')][_0x5388('0x5c')],isNotNull(_0x3164cc[_0x5388('0x184')])?_0x3164cc['dialPrefix'][_0x5388('0x185')]()||'':'',_0x3164cc[_0x5388('0x186')]>0x0?_0x24895c[_0x5388('0x15e')]['substring'](_0x3164cc[_0x5388('0x186')]):_0x24895c[_0x5388('0x15e')]),'callerid':_0xa1f3c8,'Exten':_0x5388('0x112'),'Context':_0x5388('0x189'),'Priority':'1','variable':_0x1efd57,'timeout':(_0x3164cc[_0x5388('0x18a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x173af6})['then'](function(_0x17382c){return _0x51b4ef(_0x17382c);})[_0x5388('0x9d')](function(_0x4e7770){_0x3164cc[_0x5388('0x18b')]+=0x1;var _0x286826=new History(_0x43364b[_0x5388('0x1d')][_0x173af6]);logger[_0x5388('0x60')](util['format'](_0x5388('0x18c'),JSON['stringify'](_0x4e7770)));_0x286826[_0x5388('0x6a')]=0xe;_0x286826[_0x5388('0x6b')]=_0x5388('0x18d');_0x286826[_0x5388('0x6d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x286826[_0x5388('0x6c')]=_0x286826['starttime'];hopperUtils[_0x5388('0xc8')](_0x286826)[_0x5388('0x9d')](loggerCatch(_0x5388('0x18e')));_0x43364b[_0x5388('0xca')](_0x286826)['catch'](loggerCatch(_0x5388('0x18e')))[_0x5388('0xfe')](function(){delete _0x43364b[_0x5388('0x1d')][_0x173af6];return _0x37f355(msgResponse(_0x5388('0x15f'),_0x5388('0x81'),_0x5388('0x18f')));});});});};Dialer[_0x5388('0x13')][_0x5388('0x190')]=function(_0x40d21e,_0x2c94a1,_0x23545a){var _0x4dd0b0=new History(_0x2c94a1);if(_0x4dd0b0[_0x5388('0x131')]+_0x4dd0b0['countcongestionretry']+_0x4dd0b0[_0x5388('0x121')]+_0x4dd0b0[_0x5388('0x122')]+_0x4dd0b0[_0x5388('0xd5')]+_0x4dd0b0[_0x5388('0xeb')]+_0x4dd0b0[_0x5388('0x123')]+_0x4dd0b0[_0x5388('0x124')]>=_0x23545a['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x40d21e){case 0x3:if(_0x4dd0b0['countnoanswerretry']>=_0x23545a[_0x5388('0x191')]-0x1){return!![];}hopperUtils[_0x5388('0xdd')]({'active':![],'countnoanswerretry':_0x4dd0b0[_0x5388('0x121')]+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a['dialNoAnswerRetryFrequency'],_0x5388('0xdf'))[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x4dd0b0[_0x5388('0xed')],'ListId':_0x4dd0b0[_0x5388('0xe0')],'VoiceQueueId':_0x4dd0b0[_0x5388('0xe1')]||undefined,'CampaignId':_0x4dd0b0[_0x5388('0xe2')]||undefined})['catch'](loggerCatch(_0x5388('0x192')));break;case 0x5:if(_0x4dd0b0[_0x5388('0x131')]>=_0x23545a[_0x5388('0x193')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x4dd0b0['countbusyretry']+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a[_0x5388('0x194')],_0x5388('0xdf'))[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x4dd0b0[_0x5388('0xed')],'ListId':_0x4dd0b0[_0x5388('0xe0')],'VoiceQueueId':_0x4dd0b0['VoiceQueueId']||undefined,'CampaignId':_0x4dd0b0['CampaignId']||undefined})['catch'](loggerCatch(_0x5388('0x195')));break;case 0x8:if(_0x4dd0b0[_0x5388('0x120')]>=_0x23545a[_0x5388('0x196')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x4dd0b0[_0x5388('0x120')]+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a[_0x5388('0x197')],_0x5388('0xdf'))[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x4dd0b0[_0x5388('0xed')],'ListId':_0x4dd0b0[_0x5388('0xe0')],'VoiceQueueId':_0x4dd0b0['VoiceQueueId']||undefined,'CampaignId':_0x4dd0b0[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4dd0b0[_0x5388('0x122')]>=_0x23545a['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x5388('0xdd')]({'active':![],'countnosuchnumberretry':_0x4dd0b0[_0x5388('0x122')]+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a[_0x5388('0x198')],_0x5388('0xdf'))[_0x5388('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4dd0b0[_0x5388('0xed')],'ListId':_0x4dd0b0[_0x5388('0xe0')],'VoiceQueueId':_0x4dd0b0['VoiceQueueId']||undefined,'CampaignId':_0x4dd0b0['CampaignId']||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0x199')));}break;case 0xa:if(_0x4dd0b0['countdropretry']>=_0x23545a[_0x5388('0xdb')]-0x1){return!![];}hopperUtils[_0x5388('0xdd')]({'active':![],'countdropretry':_0x4dd0b0[_0x5388('0xd5')]+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a[_0x5388('0xde')],_0x5388('0xdf'))[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x4dd0b0['ContactId'],'ListId':_0x4dd0b0[_0x5388('0xe0')],'VoiceQueueId':_0x4dd0b0[_0x5388('0xe1')]||undefined,'CampaignId':_0x4dd0b0[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0xe3')));break;case 0xb:if(_0x4dd0b0['countabandonedretry']>=_0x23545a['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4dd0b0[_0x5388('0xeb')]+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a['dialAbandonedRetryFrequency'],_0x5388('0xdf'))[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x4dd0b0[_0x5388('0xed')],'ListId':_0x4dd0b0[_0x5388('0xe0')],'VoiceQueueId':_0x4dd0b0['VoiceQueueId']||undefined,'CampaignId':_0x4dd0b0['CampaignId']||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0xee')));break;case 0x13:if(_0x4dd0b0['countmachineretry']>=_0x23545a['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4dd0b0['countmachineretry']+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a[_0x5388('0x129')],'minutes')[_0x5388('0x3e')](_0x5388('0xc2')),'ContactId':_0x4dd0b0['ContactId'],'ListId':_0x4dd0b0['ListId'],'VoiceQueueId':_0x4dd0b0[_0x5388('0xe1')]||undefined,'CampaignId':_0x4dd0b0[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0x12a')));break;case 0x14:if(_0x4dd0b0[_0x5388('0x124')]>=_0x23545a['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x5388('0xdd')]({'active':![],'countagentrejectretry':_0x4dd0b0[_0x5388('0x124')]+=0x1,'scheduledat':moment()[_0x5388('0xec')](_0x23545a[_0x5388('0x19a')],'minutes')['format'](_0x5388('0xc2')),'ContactId':_0x4dd0b0[_0x5388('0xed')],'ListId':_0x4dd0b0['ListId'],'VoiceQueueId':_0x4dd0b0[_0x5388('0xe1')]||undefined,'CampaignId':_0x4dd0b0[_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0x19b')));break;default:return!![];}};Dialer[_0x5388('0x13')][_0x5388('0x19c')]=function(_0x8b307,_0x36d6df,_0x3f1d37){var _0x34bb59=this;var _0x39f9b9=new History(_0x8b307);var _0x43af55=![];var _0x4b7d87;var _0x37ac26;return new Promise(function(_0x448a0d,_0x22269d){if(_[_0x5388('0x38')](_0x36d6df)&&typeof _0x36d6df!=='object'){return _0x22269d(msgResponse('[callProgressDetecting]',_0x5388('0x8e'),_0x5388('0x19d')));}if(_[_0x5388('0x38')](_0x3f1d37)&&typeof _0x3f1d37!==_0x5388('0x19e')){return _0x22269d(msgResponse(_0x5388('0x19f'),_0x5388('0x8e'),'evt\x20is\x20undefine'));}hopperUtils['verifyAdditionalPhones'](_0x39f9b9,_0x3f1d37['reason'],_0x36d6df)[_0x5388('0x9e')](function(_0x1f3c09){if(_0x1f3c09[_0x5388('0xda')]==0x1)_0x43af55=!![];switch(_0x3f1d37[_0x5388('0xc5')]){case'0':_0x36d6df[_0x5388('0x1a0')]+=0x1;_0x39f9b9[_0x5388('0x6a')]=0x0;_0x39f9b9[_0x5388('0x6b')]=_0x5388('0x1a1');_0x39f9b9['countnosuchnumberretry']+=0x1;_0x39f9b9[_0x5388('0xd6')]+=0x1;ami['emit'](_0x5388('0x1a2'),ut[_0x5388('0x11b')](_0x8b307,_0x5388('0x1a3')));_0x4b7d87=_0x36d6df[_0x5388('0x198')];_0x37ac26=_0x36d6df['callAdditionalPhoneAfterMin'];hopperUtils[_0x5388('0xc8')](_0x39f9b9)[_0x5388('0x9d')](loggerCatch(_0x5388('0x130')));if(_0x34bb59[_0x5388('0x190')](0x0,_0x8b307,_0x36d6df)&&!_0x43af55){if(_0x39f9b9['countnosuchnumberretry']>=_0x36d6df[_0x5388('0x1a4')]){_0x34bb59[_0x5388('0x133')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1a5'));}else{_0x34bb59[_0x5388('0x126')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1a5'));}}break;case'3':_0x36d6df['outboundNoAnswerCallsDay']+=0x1;_0x39f9b9['state']=0x3;_0x39f9b9[_0x5388('0x6b')]=_0x5388('0x1a6');_0x39f9b9[_0x5388('0x121')]+=0x1;_0x39f9b9[_0x5388('0xd6')]+=0x1;var _0x1819ba=ut['buildNoAnswerEventPayload'](_0x8b307,_0x36d6df);ami[_0x5388('0x119')](_0x5388('0x1a7'),_0x1819ba);_0x4b7d87=_0x36d6df[_0x5388('0x1a8')];_0x37ac26=_0x36d6df['callAdditionalPhoneAfterMin'];hopperUtils[_0x5388('0xc8')](_0x39f9b9)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x34bb59['checkRetriveMax'](0x3,_0x8b307,_0x36d6df)&&!_0x43af55){if(_0x39f9b9[_0x5388('0x121')]>=_0x36d6df[_0x5388('0x191')]){_0x34bb59[_0x5388('0x133')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1a9'));}else{_0x34bb59[_0x5388('0x126')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1a9'));}}break;case'5':_0x36d6df[_0x5388('0x1aa')]+=0x1;_0x39f9b9[_0x5388('0x6a')]=0x5;_0x39f9b9[_0x5388('0x6b')]='Busy';_0x39f9b9['countbusyretry']+=0x1;_0x39f9b9[_0x5388('0xd6')]+=0x1;ami[_0x5388('0x119')](_0x5388('0x1ab'),ut[_0x5388('0x11b')](_0x8b307,_0x5388('0x1ac')));_0x4b7d87=_0x36d6df[_0x5388('0x194')];_0x37ac26=_0x36d6df[_0x5388('0xd7')];hopperUtils[_0x5388('0xc8')](_0x39f9b9)[_0x5388('0x9d')](loggerCatch(_0x5388('0x1ad')));if(_0x34bb59[_0x5388('0x190')](0x5,_0x8b307,_0x36d6df)&&!_0x43af55){if(_0x39f9b9[_0x5388('0x131')]>=_0x36d6df[_0x5388('0x193')]){_0x34bb59[_0x5388('0x133')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1ae'));}else{_0x34bb59['stateGlobal'](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1ae'));}}break;case'8':_0x36d6df[_0x5388('0x1af')]+=0x1;_0x39f9b9[_0x5388('0x6a')]=0x8;_0x39f9b9[_0x5388('0x6b')]=_0x5388('0x1b0');_0x39f9b9[_0x5388('0x120')]+=0x1;_0x39f9b9[_0x5388('0xd6')]+=0x1;_0x4b7d87=_0x36d6df[_0x5388('0x197')];_0x37ac26=_0x36d6df[_0x5388('0xd7')];ami[_0x5388('0x119')]('custom:agentcongestion',ut['buildObj'](_0x8b307,_0x5388('0x1b1')));hopperUtils['createHistory'](_0x39f9b9)[_0x5388('0x9d')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x34bb59['checkRetriveMax'](0x8,_0x8b307,_0x36d6df)&&!_0x43af55){if(_0x39f9b9['countcongestionretry']>=_0x36d6df[_0x5388('0x196')]){_0x34bb59[_0x5388('0x133')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1b2'));}else{_0x34bb59['stateGlobal'](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1b2'));}}break;case'11':_0x36d6df[_0x5388('0x1b3')]+=0x1;_0x39f9b9['state']=0xb;_0x39f9b9['statedesc']=_0x5388('0xe8');_0x39f9b9['countabandonedretry']+=0x1;_0x39f9b9[_0x5388('0xd6')]+=0x1;_0x4b7d87=_0x36d6df[_0x5388('0xea')];_0x37ac26=_0x36d6df[_0x5388('0xd7')];hopperUtils[_0x5388('0xc8')](_0x39f9b9)['catch'](loggerCatch(_0x5388('0xef')));if(_0x34bb59[_0x5388('0x190')](0xb,_0x8b307,_0x36d6df)&&!_0x43af55){if(_0x39f9b9[_0x5388('0xeb')]>=_0x36d6df[_0x5388('0x1b4')]){_0x34bb59[_0x5388('0x133')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1b5'));}else{_0x34bb59[_0x5388('0x126')](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1b5'));}}break;case'20':_0x36d6df[_0x5388('0x1b6')]+=0x1;_0x39f9b9['state']=0x14;_0x39f9b9[_0x5388('0x6b')]=_0x5388('0x1b7');_0x39f9b9['countagentrejectretry']+=0x1;_0x39f9b9[_0x5388('0xd6')]+=0x1;_0x4b7d87=_0x36d6df['dialAgentRejectRetryFrequency'];_0x37ac26=_0x36d6df[_0x5388('0xd7')];ami['emit'](_0x5388('0x1b8'),ut[_0x5388('0x11b')](_0x8b307,_0x5388('0x1b9')));hopperUtils[_0x5388('0xc8')](_0x39f9b9)[_0x5388('0x9d')](loggerCatch(_0x5388('0x1ba')));if(_0x34bb59['checkRetriveMax'](0x14,_0x8b307,_0x36d6df)&&!_0x43af55){if(_0x39f9b9[_0x5388('0x124')]>=_0x36d6df[_0x5388('0x1bb')]){_0x34bb59[_0x5388('0x133')](_0x39f9b9,_0x448a0d,_0x22269d,'reason\x2020\x20agentreject');}else{_0x34bb59['stateGlobal'](_0x39f9b9,_0x448a0d,_0x22269d,_0x5388('0x1bc'));}}break;default:_0x36d6df[_0x5388('0x138')]+=0x1;_0x39f9b9[_0x5388('0x6a')]=0xc;_0x39f9b9[_0x5388('0x6b')]=_0x3f1d37['reason'];_0x4b7d87=_0x36d6df[_0x5388('0x19a')];_0x37ac26=_0x36d6df[_0x5388('0xd7')];hopperUtils[_0x5388('0xc8')](_0x39f9b9)['catch'](loggerCatch(_0x5388('0x1bd')));if(_0x34bb59[_0x5388('0x190')](_0x3f1d37[_0x5388('0xc5')],_0x8b307,_0x36d6df)&&!_0x43af55){if(_0x39f9b9['countbusyretry']+_0x39f9b9[_0x5388('0x120')]+_0x39f9b9['countnoanswerretry']+_0x39f9b9['countnosuchnumberretry']+_0x39f9b9['countdropretry']+_0x39f9b9[_0x5388('0xeb')]+_0x39f9b9['countmachineretry']+_0x39f9b9[_0x5388('0x124')]>=_0x36d6df['dialGlobalMaxRetry']){_0x34bb59['stateGlobal'](_0x39f9b9,_0x448a0d,_0x22269d,_0x3f1d37[_0x5388('0xc5')]);}else{_0x34bb59[_0x5388('0x133')](_0x39f9b9,_0x448a0d,_0x22269d,_0x3f1d37[_0x5388('0xc5')]);}}}})[_0x5388('0x9e')](function(){if(_0x43af55){hopperUtils['swapAdditionalPhones'](_0x39f9b9,_0x4b7d87,_0x37ac26)[_0x5388('0x9e')](function(){return _0x448a0d(0x1);});}});});};Dialer['prototype'][_0x5388('0x126')]=function(_0x1d08d5,_0x59dcf0,_0x369966,_0x5e5e46){var _0x308e29=new Final(_0x1d08d5);_0x308e29[_0x5388('0x6a')]=0xf;_0x308e29['statedesc']=_0x5388('0x1be');this[_0x5388('0x133')](_0x308e29,_0x59dcf0,_0x369966,_0x5e5e46);};Dialer['prototype'][_0x5388('0x133')]=function(_0x1c1f39,_0x56151e,_0xddd9b,_0x201b31){hopperUtils[_0x5388('0xca')](_0x1c1f39)['then'](function(){return _0x56151e(msgResponse(_0x5388('0x19f'),_0x5388('0x10d'),_0x201b31));})[_0x5388('0x9d')](function(){return _0xddd9b(msgResponse('[moveContactManagedDialer][0]',_0x5388('0x8e'),_0x5388('0x1bf')));});};Dialer[_0x5388('0x13')][_0x5388('0xb1')]=function(_0x49281f){var _0x1c77d4=_0x49281f[_0x5388('0x1c0')]/0x64;var _0x1dd544=_0x49281f[_0x5388('0xd0')]/(_0x49281f[_0x5388('0xd0')]+_0x49281f['outboundAnswerCallsDay']);var _0x2c105f=Math[_0x5388('0x1c1')](_0x49281f[_0x5388('0x1c2')]*(_0x49281f[_0x5388('0x1c3')]/0x64));var _0x46c8ad=Math[_0x5388('0x1c1')](_0x49281f[_0x5388('0x1c2')]*(_0x49281f[_0x5388('0x1c4')]/0x64));var _0x16a51b=_0x49281f[_0x5388('0x13d')]+_0x49281f[_0x5388('0x13f')];var _0x4ae1b6=Math['floor'](_0x49281f[_0x5388('0x55')]*_0x49281f[_0x5388('0x58')]*_0x49281f[_0x5388('0x1c5')]*_0x49281f[_0x5388('0x1c6')]);if(_[_0x5388('0x38')](_0x49281f[_0x5388('0x21')])){if(!_[_0x5388('0x38')](_0x49281f[_0x5388('0x20')])){_0x49281f[_0x5388('0x20')]=undefined;loggerPredictive[_0x5388('0x60')](_0x5388('0x1c7'),_0x5388('0x1c8'));}if(!_[_0x5388('0x38')](_0x49281f['handlePredictive'])){loggerPredictive[_0x5388('0x60')](_0x5388('0x1c7'),_0x5388('0x1c9'));clearInterval(_0x49281f['handlePredictive']);_0x49281f[_0x5388('0x5f')]=undefined;}_0x49281f['startProgressive']=moment()[_0x5388('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5388('0x42')](_0x49281f[_0x5388('0x5c')],_0x5388('0x1ca'),_0x49281f[_0x5388('0x21')]);this[_0x5388('0xb4')](_0x49281f,0x1);}else if(ifInterval(_0x49281f[_0x5388('0x1cb')],_0x49281f[_0x5388('0x21')])){this['handlePower'](_0x49281f,0x1);loggerPredictiveCalls[_0x5388('0x42')](_0x5388('0x1cc'),_0x49281f[_0x5388('0x21')],_0x49281f['name']);_0x49281f[_0x5388('0x55')]=0x0;_0x49281f[_0x5388('0xd1')]=0x0;}else if(_0x1c77d4<_0x1dd544&&_0x49281f[_0x5388('0x1cd')]===_0x5388('0x1ce')){clearPredictiveAttributes(_0x49281f);loggerPredictive[_0x5388('0x42')](_0x5388('0x1cf'),_0x5388('0x1d0'),_0x1dd544,'startProgressive',_0x49281f[_0x5388('0x5c')]);}else if(_0x4ae1b6<_0x49281f[_0x5388('0xd1')]&&_0x49281f[_0x5388('0x1cd')]===_0x5388('0x1ce')){clearPredictiveAttributes(_0x49281f);loggerPredictive[_0x5388('0x42')](_0x5388('0x1d1'),'Max\x20Drop\x20',_0x4ae1b6,'Drop\x20in\x20this\x20interval',_0x49281f['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x49281f[_0x5388('0x5c')]);}else if(!ifInterval(_0x49281f['dialPredictiveInterval'],_0x49281f[_0x5388('0x21')])&&_[_0x5388('0x38')](_0x49281f[_0x5388('0x20')])&&!_[_0x5388('0x38')](_0x49281f[_0x5388('0x21')])){_0x49281f[_0x5388('0x20')]=moment()[_0x5388('0x3e')](_0x5388('0xc2'));loggerPredictive[_0x5388('0x42')](_0x49281f[_0x5388('0x5c')],_0x5388('0x1d2'),_0x49281f[_0x5388('0x20')]);hopperUtils[_0x5388('0x1d3')](_0x49281f[_0x5388('0x1cb')])[_0x5388('0x9e')](this[_0x5388('0x1d4')](_0x49281f))[_0x5388('0x9e')](mergeDataErlangB(_0x49281f))[_0x5388('0x9e')](this[_0x5388('0x1d5')](_0x49281f))[_0x5388('0x9d')](loggerCatchPredictive(_0x5388('0x1d6'),_0x49281f));}else if(!ifInterval(_0x49281f[_0x5388('0x1cb')],_0x49281f[_0x5388('0x20')])){_0x49281f[_0x5388('0xd1')]=0x0;_0x49281f[_0x5388('0x20')]=moment()[_0x5388('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5388('0x42')](_0x49281f['name'],_0x5388('0x1d7'),_0x49281f[_0x5388('0x20')]);clearInterval(_0x49281f['handlePredictive']);_0x49281f[_0x5388('0x5f')]=undefined;hopperUtils[_0x5388('0x1d3')](_0x49281f[_0x5388('0x1cb')])[_0x5388('0x9e')](this[_0x5388('0x1d4')](_0x49281f))[_0x5388('0x9e')](mergeDataErlangB(_0x49281f))[_0x5388('0x9e')](this[_0x5388('0x1d5')](_0x49281f))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x49281f));}else if(_0x49281f[_0x5388('0x1c2')]&&_0x16a51b<_0x49281f[_0x5388('0x1c2')]-_0x46c8ad){clearPredictiveAttributes(_0x49281f);loggerPredictive['info'](_0x49281f[_0x5388('0x5c')],_0x5388('0x1d8'),_0x16a51b,_0x5388('0x1d9'),_0x49281f[_0x5388('0x1c2')],'-',_0x46c8ad,'=',_0x49281f[_0x5388('0x1c2')]-_0x46c8ad,')');}else if(_0x49281f[_0x5388('0x1c2')]&&_0x16a51b>_0x49281f['predictiveIntervalAvailable']+_0x2c105f){clearPredictiveAttributes(_0x49281f);loggerPredictive['info'](_0x49281f[_0x5388('0x5c')],_0x5388('0x1d8'),_0x16a51b,_0x5388('0x1da'),_0x49281f[_0x5388('0x1c2')],'+',_0x2c105f,'=',_0x49281f[_0x5388('0x1c2')]+_0x2c105f,')');}};Dialer[_0x5388('0x13')]['getDataPredictive']=function(_0x277077){var _0x46e247=this;return function(_0x599d8f){return new Promise(function(_0x5311ec,_0x4adc3f){_[_0x5388('0x5a')](_0x277077,_0x599d8f[0x0]);if(checkGetDataPredictive(_0x599d8f[0x0])){var _0x1de6e8=_0x277077[_0x5388('0x1c2')]=_0x277077[_0x5388('0x13f')]+_0x277077[_0x5388('0x13d')];var _0x1cd149=_0x277077[_0x5388('0x1cb')]*0x3c;var _0x3da154=_0x599d8f[0x0][_0x5388('0x4c')]+_0x599d8f[0x0][_0x5388('0x4a')];var _0xe822dc=(_0x599d8f[0x0][_0x5388('0x45')]+_0x599d8f[0x0][_0x5388('0x47')]+_0x599d8f[0x0][_0x5388('0xe6')])/_0x599d8f[0x0][_0x5388('0x4e')];_0x277077[_0x5388('0x1c5')]=_0xe822dc>0x0?_0xe822dc:0x1;switch(_0x277077[_0x5388('0x1cd')]){case _0x5388('0x1ce'):var _0x105833=_0x277077[_0x5388('0x1c0')]/0x64;return _0x46e247[_0x5388('0x1db')](_0x1de6e8,_0x1cd149,_0x3da154,_0xe822dc,_0x105833)[_0x5388('0x9e')](function(_0x2e0fd1){return _0x5311ec(_0x2e0fd1);});case _0x5388('0x1dc'):var _0x1c47c1=_0x277077[_0x5388('0x1c0')]/0x64;return _0x46e247[_0x5388('0x1dd')](_0x1de6e8,_0x1cd149,_0x3da154,_0xe822dc,_0x1c47c1)[_0x5388('0x9e')](function(_0x154117){return _0x5311ec(_0x154117);});default:return _0x4adc3f(msgResponse(_0x5388('0x1de'),_0x5388('0x8e'),_0x5388('0x1df')));}}else{return _0x4adc3f(msgResponse(_0x5388('0x1de'),_0x5388('0x8e'),_0x5388('0x1e0')));}});};};Dialer[_0x5388('0x13')][_0x5388('0x1e1')]=function(_0x19f43b){var _0x2cec03=this;return function(_0x266e16){return new Promise(function(_0x54f741,_0x24b557){_[_0x5388('0x5a')](_0x19f43b,_0x266e16[0x0]);if(checkGetDataPredictive(_0x266e16[0x0])){loggerPredictive['info'](JSON[_0x5388('0x71')](_0x266e16[0x0]));if(_0x19f43b[_0x5388('0x1cd')]===_0x5388('0x1ce')){return _0x2cec03[_0x5388('0x14f')](_0x19f43b['id'])['then'](function(_0x598666){var _0x21ddb2=_0x19f43b[_0x5388('0x1e2')]-_0x598666[0x0][_0x5388('0x1e3')];var _0x53a96b=_0x19f43b[_0x5388('0x1cb')]*0x3c;var _0x16f5e6=_0x266e16[0x0]['predictiveIntervalAvgTalktime']+_0x266e16[0x0][_0x5388('0x4a')];var _0x3c541a=(_0x266e16[0x0][_0x5388('0x45')]+_0x266e16[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x266e16[0x0][_0x5388('0xe6')])/_0x266e16[0x0][_0x5388('0x4e')];var _0x3bd1bc=_0x19f43b['dialPredictiveOptimizationPercentage']/0x64;_0x19f43b[_0x5388('0x1e4')]=_0x598666[0x0]['outboundQueuePauses']||0x0;_0x19f43b[_0x5388('0x1c5')]=_0x3c541a>0x0?_0x3c541a:0x1;return _0x2cec03[_0x5388('0x1db')](_0x21ddb2,_0x53a96b,_0x16f5e6,_0x3c541a,_0x3bd1bc);})['then'](function(_0x14dcc7){return _0x54f741(_0x14dcc7);})[_0x5388('0x9d')](function(_0x3e6947){return _0x24b557(msgResponse(_0x5388('0x1e5'),_0x5388('0x8e'),JSON[_0x5388('0x71')](_0x3e6947)));});}if(_0x19f43b[_0x5388('0x1cd')]==='agentBusyFactor'){return _0x2cec03[_0x5388('0x14f')](_0x19f43b['id'])[_0x5388('0x9e')](function(_0x5e451f){var _0x3073fd=_0x19f43b[_0x5388('0x1e2')]-_0x5e451f[0x0][_0x5388('0x1e3')];var _0x558669=_0x19f43b[_0x5388('0x1cb')]*0x3c;var _0x34c38f=_0x266e16[0x0][_0x5388('0x4c')]+_0x266e16[0x0][_0x5388('0x4a')];var _0x436973=(_0x266e16[0x0][_0x5388('0x45')]+_0x266e16[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x266e16[0x0][_0x5388('0xe6')])/_0x266e16[0x0][_0x5388('0x4e')];var _0x86115d=_0x19f43b[_0x5388('0x1c0')]/0x64;_0x19f43b[_0x5388('0x1e4')]=_0x5e451f[0x0][_0x5388('0x1e3')]||0x0;_0x19f43b[_0x5388('0x1c5')]=_0x436973>0x0?_0x436973:0x1;return _0x2cec03['busyFactor'](_0x3073fd,_0x558669,_0x34c38f,_0x436973,_0x86115d);})[_0x5388('0x9e')](function(_0x35dde3){return _0x54f741(_0x35dde3);})[_0x5388('0x9d')](function(_0x5925e3){return _0x24b557(msgResponse('[CatchErlangB]','Failure',JSON[_0x5388('0x71')](_0x5925e3)));});}}else{return _0x24b557(msgResponse(_0x5388('0x1de'),_0x5388('0x8e'),_0x5388('0x1e0')));}});};};Dialer[_0x5388('0x13')][_0x5388('0x1d5')]=function(_0x4772cf){var _0x3b814a=this;return function(){var _0x5f56d5=0x0;var _0x199163=Math[_0x5388('0x1e6')](_0x4772cf['erlangCallToSecond']*0x3e8);if(_0x199163>0x0){_0x199163=_0x199163<0x64?0x64:_0x199163;loggerPredictive[_0x5388('0x42')](_0x4772cf[_0x5388('0x5c')],_0x5388('0x1e7'),_0x199163,_0x5388('0x1e8'));_0x4772cf['handlePredictive']=setInterval(function(){_0x3b814a[_0x5388('0x5f')](_0x4772cf);loggerPredictiveCalls[_0x5388('0x42')](_0x5388('0x1e9'),_0x5f56d5+=0x1);},_0x199163);}else{loggerPredictive[_0x5388('0x42')](_0x4772cf['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x5388('0x13')]['checkContactBlack']=function(_0x34afba,_0x5a53df){var _0x6fabe7=this;return function(_0x552050){if(_[_0x5388('0x41')](_0x552050)){if(_[_0x5388('0xf4')](_0x5a53df[_0x5388('0x155')])||!_0x5a53df[_0x5388('0x1ea')]){if(_0x34afba[_0x5388('0xb2')]==='booked'){_0x34afba['queueStatusComplete']=_[_0x5388('0x38')](_0x34afba[_0x5388('0x6e')])?!![]:_0x34afba[_0x5388('0x6e')];var _0x803db4=uuid['v4']();_0x6fabe7[_0x5388('0x1d')][_0x803db4]=new Action(_0x34afba,_0x5a53df,_0x803db4);loggerBooked[_0x5388('0x42')](_0x5388('0x1eb'),_0x803db4,_0x5388('0x1ec'),JSON[_0x5388('0x71')](_0x34afba[_0x5388('0x6e')]),_0x5388('0x1ed'),_0x34afba[_0x5388('0x5c')]);if(_0x34afba['queueStatusComplete']){_0x34afba[_0x5388('0x6e')]=![];_0x6fabe7['queueBooked'][_0x6fabe7[_0x5388('0x1d')][_0x803db4][_0x5388('0xbf')]]=[];ami[_0x5388('0x97')]({'actionid':_0x803db4,'action':_0x5388('0x1ee'),'queue':_0x34afba[_0x5388('0x5c')]})['catch'](function(){_0x6fabe7[_0x5388('0xcc')](_0x34afba);hopperUtils[_0x5388('0xdd')]({'active':![],'ContactId':_0x6fabe7[_0x5388('0x1d')][_0x803db4][_0x5388('0xed')],'ListId':_0x6fabe7['actions'][_0x803db4][_0x5388('0xe0')],'VoiceQueueId':_0x6fabe7[_0x5388('0x1d')][_0x803db4]['VoiceQueueId']||undefined,'CampaignId':_0x6fabe7['actions'][_0x803db4][_0x5388('0xe2')]||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0x1ef')));delete _0x6fabe7['actions'][_0x803db4];});}else{loggerBooked['info'](_0x5388('0x1f0'),JSON[_0x5388('0x71')](_0x34afba['queueStatusComplete']),_0x5388('0x1ed'),_0x34afba['name']);_0x6fabe7[_0x5388('0xcc')](_0x34afba);hopperUtils[_0x5388('0xdd')]({'active':![],'ContactId':_0x6fabe7[_0x5388('0x1d')][_0x803db4][_0x5388('0xed')],'ListId':_0x6fabe7['actions'][_0x803db4][_0x5388('0xe0')],'VoiceQueueId':_0x6fabe7[_0x5388('0x1d')][_0x803db4][_0x5388('0xe1')]||undefined,'CampaignId':_0x6fabe7['actions'][_0x803db4]['CampaignId']||undefined})[_0x5388('0x9d')](loggerCatch(_0x5388('0x1ef')));delete _0x6fabe7[_0x5388('0x1d')][_0x803db4];}}else{return _0x6fabe7[_0x5388('0x15c')](_0x34afba,_0x5a53df);}}else{if(utils[_0x5388('0x5b')](undefined,_0x5a53df[_0x5388('0x1f1')])<_0x34afba[_0x5388('0x1f2')]*0x3c){if(_0x5a53df[_0x5388('0x1f3')]&&!_0x5a53df[_0x5388('0x1f3')][_0x5388('0x1f4')]){_0x6fabe7[_0x5388('0x105')][_0x5388('0xfc')](_0x5a53df['id'])[_0x5388('0xfe')](function(){_0x6fabe7['updateOriginated'](_0x34afba);});}else{hopperUtils['unlockContact']({'active':![]},_0x5a53df['id'],0x1)[_0x5388('0xfe')](function(){_0x6fabe7[_0x5388('0xcc')](_0x34afba);});}}else{_0x34afba[_0x5388('0x1f5')]+=0x1;_0x6fabe7[_0x5388('0xcc')](_0x34afba);if(_0x34afba['dialRecallInQueue']){hopperUtils[_0x5388('0xdd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a53df['ContactId'],'ListId':_0x5a53df['ListId'],'VoiceQueueId':_0x5a53df['VoiceQueueId']||undefined,'CampaignId':_0x5a53df[_0x5388('0xe2')]||undefined})['catch'](loggerCatch(_0x5388('0x1f6')));hopperUtils[_0x5388('0xc8')](createObjHistory(_0x34afba,_0x5a53df,utils[_0x5388('0x65')][_0x5388('0x1f7')],0x17,'RecallInQueue'))[_0x5388('0x9d')](loggerCatch(_0x5388('0x1f8')));}else{_0x6fabe7[_0x5388('0x11c')](createObjHistory(_0x34afba,_0x5a53df,utils[_0x5388('0x65')][_0x5388('0x1f9')],0x16,_0x5388('0x1fa')),_0x5388('0x1fb'),_0x5388('0x1fc'));}}}}else{_0x34afba[_0x5388('0x1fd')]+=0x1;_0x6fabe7[_0x5388('0x11c')](createObjHistory(_0x34afba,_0x5a53df,utils['CAMPAIGN_STATUS']['BLACKLIST'],0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x5388('0x1fe'));throw _0x5388('0x1ff');}};};Dialer['prototype'][_0x5388('0x15b')]=function(_0x3d38c2){var _0x130549=this;var _0xe36dd6=_0x3d38c2[_0x5388('0x200')]-_0x3d38c2[_0x5388('0x7c')];emitCampaignSummary(_0x3d38c2);if(_0xe36dd6>0x0&&_0x3d38c2[_0x5388('0x63')]==0x0){if(_0xe36dd6>this[_0x5388('0x1b')]){_0xe36dd6=this[_0x5388('0x1b')];}_0x3d38c2['temp']=0x1;hopperUtils[_0x5388('0x201')](_0x3d38c2,_0xe36dd6)['then'](function(_0x218fc0){_0x3d38c2[_0x5388('0x63')]=0x0;if(_0x218fc0){if(!utils[_0x5388('0x202')](_0x218fc0)){_0x3d38c2[_0x5388('0x64')]=utils[_0x5388('0x65')][_0x5388('0x68')];logger[_0x5388('0x42')](_0x5388('0x203')+_0x3d38c2['name']);}else{_0x3d38c2[_0x5388('0x7c')]+=_0x218fc0[_0x5388('0x101')];_0x3d38c2['message']=utils[_0x5388('0x65')][_0x5388('0x204')];for(var _0x2dea3b=0x0;_0x2dea3b<_0x218fc0[_0x5388('0x101')];_0x2dea3b+=0x1){_0x3d38c2[_0x5388('0x205')]+=0x1;if(_[_0x5388('0xf4')](_0x218fc0[_0x2dea3b])||_[_0x5388('0xf4')](_0x218fc0[_0x2dea3b][_0x5388('0x206')])||_[_0x5388('0xf4')](_0x218fc0[_0x2dea3b][_0x5388('0x15e')])){_0x130549[_0x5388('0x207')](_0x5388('0x208'),_0x3d38c2,_0x218fc0[_0x2dea3b]);}else{hopperUtils[_0x5388('0x209')](_['pick'](_0x218fc0[_0x2dea3b],[_0x5388('0xe2'),'phone']))[_0x5388('0x9e')](_0x130549[_0x5388('0x20a')](_0x3d38c2,_0x218fc0[_0x2dea3b]))[_0x5388('0x9d')](_0x130549[_0x5388('0x153')](_0x5388('0x20b'),_0x3d38c2));}}}}})[_0x5388('0x9d')](loggerGetContactDialer('[getContactCampaign2]',_0x3d38c2,_0xe36dd6));}};Dialer[_0x5388('0x13')][_0x5388('0xb4')]=function(_0x53f541,_0x2469c2){var _0x39f817=this;var _0xb0e43c=[];if(_0x2469c2<0x1||_0x53f541['dialMethod']===_0x5388('0x5')){_0x2469c2=0x1;}var _0x326388=Math[_0x5388('0x1e6')](_0x53f541['available']*_0x2469c2)-_0x53f541[_0x5388('0x7c')];if(_0x53f541['dialLimitQueue']>0x0){var _0x5cce8c=_0x53f541[_0x5388('0x20c')]-_0x53f541[_0x5388('0x7c')]-_0x53f541[_0x5388('0x13f')]-_0x53f541[_0x5388('0x140')];if(_0x326388>_0x5cce8c){_0x326388=_0x5cce8c;}}if(_0x326388>0x0&&_0x53f541[_0x5388('0x63')]==0x0){if(_0x53f541[_0x5388('0xb2')]===_0x5388('0x5')){_0x326388=0x1;}if(_0x326388>this['maxNumberOriginate']){_0x326388=this['maxNumberOriginate'];}for(var _0x2a8bb8 in this['agents']){if(typeof this[_0x5388('0x19')][_0x2a8bb8]!==_0x5388('0xaa')){if(this['agents'][_0x2a8bb8][_0x5388('0x6a')]===_0x5388('0x20d')&&this[_0x5388('0x19')][_0x2a8bb8][_0x5388('0x86')]===_0x5388('0x85')){_0xb0e43c['push'](this[_0x5388('0x19')][_0x2a8bb8]['id']);}}}_0x53f541[_0x5388('0x63')]=0x1;hopperUtils[_0x5388('0x20e')](_0x53f541,_0xb0e43c,_0x326388)[_0x5388('0x9e')](function(_0x772764){_0x53f541['temp']=0x0;if(_0x772764){if(!utils[_0x5388('0x202')](_0x772764)){hopperUtils[_0x5388('0x20f')](_0x53f541)[_0x5388('0x9e')](sendMessageReschedule(_0x53f541))[_0x5388('0x9d')](loggerCatch(_0x5388('0x210')));}else{_0x53f541[_0x5388('0x7c')]+=_0x772764[_0x5388('0x101')];_0x53f541[_0x5388('0x64')]=_0x53f541['dialMethod']===_0x5388('0x5')?utils[_0x5388('0x65')][_0x5388('0x168')]:utils[_0x5388('0x65')]['RUNNING'];for(var _0x17f0b4=0x0;_0x17f0b4<_0x772764[_0x5388('0x101')];_0x17f0b4+=0x1){if(_['isNil'](_0x772764[_0x17f0b4])||_[_0x5388('0xf4')](_0x772764[_0x17f0b4][_0x5388('0x206')])||_[_0x5388('0xf4')](_0x772764[_0x17f0b4][_0x5388('0x15e')])){_0x39f817[_0x5388('0x207')](_0x5388('0x208'),_0x53f541,_0x772764[_0x17f0b4]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x772764[_0x17f0b4],[_0x5388('0xe1'),'phone']))[_0x5388('0x9e')](_0x39f817[_0x5388('0x20a')](_0x53f541,_0x772764[_0x17f0b4]))[_0x5388('0x9d')](_0x39f817['loggerHandler'](_0x5388('0x208'),_0x53f541));}}}}})['catch'](loggerGetContactDialer(_0x5388('0x211'),_0x53f541,_0x326388));}};Dialer[_0x5388('0x13')][_0x5388('0x5f')]=function(_0x5089b5){if(_0x5089b5[_0x5388('0x20c')]>0x0){var _0x23301f=_0x5089b5[_0x5388('0x20c')]-_0x5089b5['originated']-_0x5089b5['talking'];if(_0x23301f>0x0&&_0x5089b5[_0x5388('0x63')]==0x0){this['tryOriginatePredictive'](_0x5089b5);}else{loggerPredictiveCalls['info'](_0x5388('0x212'));}}else{this['tryOriginatePredictive'](_0x5089b5);}};Dialer[_0x5388('0x13')][_0x5388('0x213')]=function(_0x334b7d){var _0x1cd028=this;var _0x63280=[];_0x334b7d[_0x5388('0x7c')]+=0x1;for(var _0x361203 in this[_0x5388('0x19')]){if(typeof this[_0x5388('0x19')][_0x361203]!==_0x5388('0xaa')){if(this[_0x5388('0x19')][_0x361203][_0x5388('0x6a')]==='not_inuse'&&this['agents'][_0x361203]['status']===_0x5388('0x85')){_0x63280[_0x5388('0xfa')](this[_0x5388('0x19')][_0x361203]['id']);}}}_0x334b7d[_0x5388('0x63')]=0x1;return this['getContactDialer'](_0x334b7d['id'],_0x63280,0x1,_0x334b7d['dialOrderByScheduledAt'],_0x334b7d)[_0x5388('0x9e')](function(_0x490e3f){_0x334b7d[_0x5388('0x63')]=0x1;if(_0x490e3f){if(!utils[_0x5388('0x202')](_0x490e3f)){utils[_0x5388('0x62')](_0x334b7d,0x1,0x0);return hopperUtils[_0x5388('0x20f')](_0x334b7d)[_0x5388('0x9e')](sendMessageReschedule(_0x334b7d))[_0x5388('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x334b7d[_0x5388('0x64')]=utils[_0x5388('0x65')][_0x5388('0x204')];if(_[_0x5388('0xf4')](_0x490e3f[0x0])||_[_0x5388('0xf4')](_0x490e3f[0x0]['Contact'])||_['isNil'](_0x490e3f[0x0]['phone'])){_0x1cd028[_0x5388('0x207')](_0x5388('0x208'),_0x334b7d,_0x490e3f[0x0]);}else{return hopperUtils[_0x5388('0x214')](_[_0x5388('0x72')](_0x490e3f[0x0],[_0x5388('0xe1'),_0x5388('0x15e')]))[_0x5388('0x9e')](_0x1cd028['checkContactBlack'](_0x334b7d,_0x490e3f[0x0]))['catch'](_0x1cd028[_0x5388('0x153')](_0x5388('0x215'),_0x334b7d));}}}})[_0x5388('0x9d')](loggerGetContactDialer(_0x5388('0x216'),_0x334b7d,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x27c577,_0x3c7fb6,_0x11ded4,_0x57f714,_0x20e7d7,_0x11f7be){loggerPredictive[_0x5388('0x42')](_0x5388('0x217'));loggerPredictive[_0x5388('0x42')](_0x5388('0x218'),_0x27c577);loggerPredictive[_0x5388('0x42')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c7fb6);loggerPredictive[_0x5388('0x42')](_0x5388('0x219'),_0x11ded4);loggerPredictive[_0x5388('0x42')]('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',_0x57f714);loggerPredictive[_0x5388('0x42')](_0x5388('0x21a'),_0x20e7d7);loggerPredictive[_0x5388('0x42')](_0x5388('0x4d'));return new Promise(function(_0x2d27de,_0x516049){if(_0x27c577<=0x0||isNaN(_0x27c577)){return _0x516049(msgResponse(_0x5388('0x21b'),_0x5388('0x81'),_0x5388('0x21c')+_0x27c577));}if(_0x11ded4<=0x0||isNaN(_0x11ded4)){return _0x516049(msgResponse(_0x5388('0x21b'),_0x5388('0x81'),_0x5388('0x21d')+_0x11ded4));}if(_0x57f714<=0x0||isNaN(_0x57f714)){return _0x516049(msgResponse('[abandonmentRate]','Error',_0x5388('0x21e')+_0x57f714));}if(_0x3c7fb6<=0x0||isNaN(_0x3c7fb6)){return _0x516049(msgResponse(_0x5388('0x21b'),'Error',_0x5388('0x21f')+_0x3c7fb6));}if(_0x20e7d7<=0x0||isNaN(_0x20e7d7)){return _0x516049(msgResponse(_0x5388('0x21b'),'Error',_0x5388('0x220')+_0x20e7d7));}_0x11f7be=_0x11f7be||0x0;var _0x1bd62c=0x1/_0x11ded4;var _0x16409d=0x0;var _0x583559=0x0;var _0x3af7dc=0x0;var _0x4efb98=0x0;for(var _0x1c1eba=0x0;_0x3af7dc<_0x20e7d7;_0x1c1eba+=0x1){_0x583559=_0x1c1eba/_0x3c7fb6;_0x16409d=(_0x57f714*_0x583559+_0x11f7be)/_0x1bd62c;_0x3af7dc=utils[_0x5388('0x221')](_0x16409d,_0x27c577);_0x4efb98=_0x16409d/_0x27c577*(0x1-utils['erlangb'](_0x16409d,_0x27c577));}return _0x2d27de({'erlangCalls':_0x1c1eba,'erlangCallToSecond':_0x3c7fb6/_0x1c1eba,'erlangAbandonmentRate':_0x3af7dc,'erlangBusyFactor':_0x4efb98});});};Dialer['prototype'][_0x5388('0x1dd')]=function(_0x1ccdbc,_0x3340a5,_0x52e4d4,_0x1b1d9f,_0x5a082e,_0xb8cc09){loggerPredictive[_0x5388('0x42')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x5388('0x42')](_0x5388('0x218'),_0x1ccdbc);loggerPredictive['info'](_0x5388('0x222'),_0x3340a5);loggerPredictive[_0x5388('0x42')]('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',_0x52e4d4);loggerPredictive[_0x5388('0x42')](_0x5388('0x223'),_0x1b1d9f);loggerPredictive[_0x5388('0x42')](_0x5388('0x224'),_0x5a082e);loggerPredictive['info']('---------------------------');return new Promise(function(_0x387460,_0x3fada8){if(_0x1ccdbc<=0x0||isNaN(_0x1ccdbc)){return _0x3fada8(msgResponse(_0x5388('0x225'),_0x5388('0x81'),'m\x20=\x20'+_0x1ccdbc));}if(_0x52e4d4<=0x0||isNaN(_0x52e4d4)){return _0x3fada8(msgResponse(_0x5388('0x225'),'Error',_0x5388('0x21d')+_0x52e4d4));}if(_0x1b1d9f<=0x0||isNaN(_0x1b1d9f)){return _0x3fada8(msgResponse('[busyFactor]',_0x5388('0x81'),_0x5388('0x21e')+_0x1b1d9f));}if(_0x3340a5<=0x0||isNaN(_0x3340a5)){return _0x3fada8(msgResponse(_0x5388('0x225'),'Error',_0x5388('0x21f')+_0x3340a5));}if(_0x5a082e<=0x0||isNaN(_0x5a082e)){return _0x3fada8(msgResponse(_0x5388('0x225'),'Error',_0x5388('0x226')+_0x5a082e));}_0xb8cc09=_0xb8cc09||0x0;var _0x373b83=0x1/_0x52e4d4;var _0x65db8d=0x0;var _0x5144eb=0x0;var _0x3a4c21=0x0;var _0x1016e3=0x0;for(var _0x1f42c1=0x0;_0x1016e3<_0x5a082e;_0x1f42c1+=0x1){_0x5144eb=_0x1f42c1/_0x3340a5;_0x65db8d=(_0x1b1d9f*_0x5144eb+_0xb8cc09)/_0x373b83;_0x3a4c21=utils['erlangb'](_0x65db8d,_0x1ccdbc);_0x1016e3=_0x65db8d/_0x1ccdbc*(0x1-utils['erlangb'](_0x65db8d,_0x1ccdbc));}return _0x387460({'erlangCalls':_0x1f42c1,'erlangCallToSecond':_0x3340a5/_0x1f42c1,'erlangAbandonmentRate':_0x3a4c21,'erlangBusyFactor':_0x1016e3});});};module[_0x5388('0x227')]=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 2901238..1dcdcdd 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 _0x7e16=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','queue','exports','util','moment','isNil','string','voiceQueue','name','Contact','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7e16,0x112));var _0x67e1=function(_0x4a65dd,_0x5c7a76){_0x4a65dd=_0x4a65dd-0x0;var _0x2a6cdc=_0x7e16[_0x4a65dd];return _0x2a6cdc;};'use strict';var util=require(_0x67e1('0x0'));var _=require('lodash');var moment=require(_0x67e1('0x1'));function checkNameSurname(_0x3ca6f9,_0x313242,_0x2f5e1b){var _0xaecc65='';if(!_[_0x67e1('0x2')](_0x313242)&&_0x67e1('0x3')===typeof _0x313242){_0xaecc65+=_0x313242;}if(!_[_0x67e1('0x2')](_0x2f5e1b)&&_0x67e1('0x3')===typeof _0x2f5e1b){_0xaecc65+='\x20'+_0x2f5e1b;}if(_0xaecc65!==''){return _0xaecc65;}return _0x3ca6f9;}function Action(_0x34d20b,_0x2b9dd9,_0x30c185){this[_0x67e1('0x4')]=_0x34d20b;this['uniqueid']=_0x30c185||undefined;this[_0x67e1('0x5')]=checkNameSurname(_0x2b9dd9[_0x67e1('0x6')]['phone'],_0x2b9dd9['Contact']['firstName'],_0x2b9dd9[_0x67e1('0x6')]['lastName']);this[_0x67e1('0x7')]=_0x2b9dd9[_0x67e1('0x8')];this['queue']=_0x34d20b[_0x67e1('0x5')];this[_0x67e1('0x9')]=_0x2b9dd9[_0x67e1('0x9')]||![];this['type']=_0x34d20b[_0x67e1('0xa')];this[_0x67e1('0xb')]=_0x34d20b['dialQueueTimeout']||0x3;this[_0x67e1('0xc')]=_0x2b9dd9['scheduledat'];this[_0x67e1('0xd')]=_0x2b9dd9[_0x67e1('0xd')];this[_0x67e1('0xe')]=_0x2b9dd9[_0x67e1('0xe')];this['countnoanswerretry']=_0x2b9dd9[_0x67e1('0xf')];this[_0x67e1('0x10')]=_0x2b9dd9[_0x67e1('0x10')];this[_0x67e1('0x11')]=_0x2b9dd9['countdropretry'];this['countabandonedretry']=_0x2b9dd9[_0x67e1('0x12')];this[_0x67e1('0x13')]=_0x2b9dd9[_0x67e1('0x13')];this[_0x67e1('0x14')]=_0x2b9dd9['countagentrejectretry'];this[_0x67e1('0x15')]=_0x2b9dd9['ContactId'];this[_0x67e1('0x16')]=_0x2b9dd9['ListId'];this[_0x67e1('0x17')]=_0x2b9dd9[_0x67e1('0x17')];this['VoiceQueueId']=_0x2b9dd9[_0x67e1('0x18')];this[_0x67e1('0x19')]=_0x2b9dd9['CampaignId'];this[_0x67e1('0x1a')]=_0x2b9dd9['id'];this['ContactFirstName']=_0x2b9dd9['Contact']['firstName']||'';this[_0x67e1('0x1b')]=moment()[_0x67e1('0x1c')](_0x67e1('0x1d'));this[_0x67e1('0x1e')]=_0x2b9dd9['callback'];this['callbackuniqueid']=_0x2b9dd9[_0x67e1('0x1f')];this[_0x67e1('0x20')]=_0x2b9dd9[_0x67e1('0x20')];this['recallme']=_0x2b9dd9['recallme'];this[_0x67e1('0x21')]='';this[_0x67e1('0x22')]='';}Action[_0x67e1('0x23')][_0x67e1('0x24')]=function(){return util['format'](_0x67e1('0x25'),this[_0x67e1('0x5')],this[_0x67e1('0x4')]['dialCutDigit']>0x0?this['number'][_0x67e1('0x26')](this[_0x67e1('0x4')][_0x67e1('0x27')]):this['number']);};Action[_0x67e1('0x23')][_0x67e1('0x28')]=function(){return this[_0x67e1('0x29')];};module[_0x67e1('0x2a')]=Action; \ No newline at end of file +var _0x83e9=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','util','lodash','moment','string','isNil','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x49a7ba,_0x3370d5){var _0x465eab=function(_0x300a8f){while(--_0x300a8f){_0x49a7ba['push'](_0x49a7ba['shift']());}};_0x465eab(++_0x3370d5);}(_0x83e9,0x129));var _0x983e=function(_0x59a294,_0x17dde5){_0x59a294=_0x59a294-0x0;var _0x175f9b=_0x83e9[_0x59a294];return _0x175f9b;};'use strict';var util=require(_0x983e('0x0'));var _=require(_0x983e('0x1'));var moment=require(_0x983e('0x2'));function checkNameSurname(_0x300b20,_0x9848ae,_0x139e9b){var _0x2d3b7e='';if(!_['isNil'](_0x9848ae)&&_0x983e('0x3')===typeof _0x9848ae){_0x2d3b7e+=_0x9848ae;}if(!_[_0x983e('0x4')](_0x139e9b)&&_0x983e('0x3')===typeof _0x139e9b){_0x2d3b7e+='\x20'+_0x139e9b;}if(_0x2d3b7e!==''){return _0x2d3b7e;}return _0x300b20;}function Action(_0x5c30a9,_0x6a1621,_0x25ec68){this[_0x983e('0x5')]=_0x5c30a9;this[_0x983e('0x6')]=_0x25ec68||undefined;this[_0x983e('0x7')]=checkNameSurname(_0x6a1621['Contact'][_0x983e('0x8')],_0x6a1621[_0x983e('0x9')][_0x983e('0xa')],_0x6a1621['Contact'][_0x983e('0xb')]);this[_0x983e('0xc')]=_0x6a1621['phone'];this[_0x983e('0xd')]=_0x5c30a9[_0x983e('0x7')];this[_0x983e('0xe')]=_0x6a1621['active']||![];this[_0x983e('0xf')]=_0x5c30a9['type'];this[_0x983e('0x10')]=_0x5c30a9[_0x983e('0x10')]||0x3;this[_0x983e('0x11')]=_0x6a1621['scheduledat'];this[_0x983e('0x12')]=_0x6a1621[_0x983e('0x12')];this['countcongestionretry']=_0x6a1621[_0x983e('0x13')];this[_0x983e('0x14')]=_0x6a1621[_0x983e('0x14')];this[_0x983e('0x15')]=_0x6a1621[_0x983e('0x15')];this['countdropretry']=_0x6a1621['countdropretry'];this['countabandonedretry']=_0x6a1621[_0x983e('0x16')];this[_0x983e('0x17')]=_0x6a1621[_0x983e('0x17')];this[_0x983e('0x18')]=_0x6a1621[_0x983e('0x18')];this[_0x983e('0x19')]=_0x6a1621['ContactId'];this[_0x983e('0x1a')]=_0x6a1621[_0x983e('0x1a')];this[_0x983e('0x1b')]=_0x6a1621['UserId'];this[_0x983e('0x1c')]=_0x6a1621[_0x983e('0x1c')];this[_0x983e('0x1d')]=_0x6a1621[_0x983e('0x1d')];this['idHopper']=_0x6a1621['id'];this[_0x983e('0x1e')]=_0x6a1621['Contact']['firstName']||'';this[_0x983e('0x1f')]=moment()[_0x983e('0x20')](_0x983e('0x21'));this[_0x983e('0x22')]=_0x6a1621[_0x983e('0x22')];this[_0x983e('0x23')]=_0x6a1621[_0x983e('0x23')];this[_0x983e('0x24')]=_0x6a1621['callbackat'];this[_0x983e('0x25')]=_0x6a1621[_0x983e('0x25')];this[_0x983e('0x26')]='';this[_0x983e('0x27')]='';}Action[_0x983e('0x28')][_0x983e('0x29')]=function(){return util[_0x983e('0x20')](_0x983e('0x2a'),this[_0x983e('0x7')],this[_0x983e('0x5')]['dialCutDigit']>0x0?this[_0x983e('0xc')][_0x983e('0x2b')](this[_0x983e('0x5')][_0x983e('0x2c')]):this[_0x983e('0xc')]);};Action[_0x983e('0x28')][_0x983e('0x2d')]=function(){return this['queue'];};module['exports']=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 af40911..9048d86 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 _0xe210=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','getSeconds','membername'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0xe210,0x8e));var _0x0e21=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xe210[_0x1477ef];return _0x164acd;};'use strict';var moment=require(_0x0e21('0x0'));var utils=require(_0x0e21('0x1'));function AgentComplete(_0x460dae,_0x4323ba){this['state']=0x4;this[_0x0e21('0x2')]=_0x0e21('0x3');this[_0x0e21('0x4')]=_0x460dae['scheduledat'];this[_0x0e21('0x5')]=_0x460dae[_0x0e21('0x5')];this['campaigntype']=_0x460dae[_0x0e21('0x5')]===_0x0e21('0x6')?_0x0e21('0x7'):_0x460dae[_0x0e21('0x5')];this['countbusyretry']=_0x460dae[_0x0e21('0x8')];this[_0x0e21('0x9')]=_0x460dae['countcongestionretry'];this['countnoanswerretry']=_0x460dae[_0x0e21('0xa')];this['countglobal']=_0x460dae[_0x0e21('0x8')]+_0x460dae[_0x0e21('0x9')]+_0x460dae[_0x0e21('0xa')]+_0x460dae[_0x0e21('0xb')]+_0x460dae[_0x0e21('0xc')]+_0x460dae[_0x0e21('0xd')]+_0x460dae[_0x0e21('0xe')]+_0x460dae[_0x0e21('0xf')];this[_0x0e21('0xb')]=_0x460dae['countnosuchnumberretry'];this[_0x0e21('0xc')]=_0x460dae[_0x0e21('0xc')];this[_0x0e21('0xd')]=_0x460dae[_0x0e21('0xd')];this[_0x0e21('0xe')]=_0x460dae['countmachineretry'];this[_0x0e21('0xf')]=_0x460dae['countagentrejectretry'];this[_0x0e21('0x10')]=_0x4323ba[_0x0e21('0x10')];this['calleridname']=_0x460dae[_0x0e21('0x11')];this[_0x0e21('0x12')]=_0x460dae[_0x0e21('0x13')];this[_0x0e21('0x14')]=_0x460dae[_0x0e21('0x14')];this[_0x0e21('0x15')]=_0x460dae['responsetime'];this[_0x0e21('0x16')]=_0x460dae[_0x0e21('0x16')];this[_0x0e21('0x17')]=moment()[_0x0e21('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0e21('0x19')]=utils['getSeconds'](_0x460dae['responsetime'],_0x460dae[_0x0e21('0x14')]);this[_0x0e21('0x1a')]=utils['getSeconds'](_0x460dae[_0x0e21('0x16')],_0x460dae[_0x0e21('0x15')]);this[_0x0e21('0x1b')]=utils[_0x0e21('0x1c')](this[_0x0e21('0x17')],_0x460dae[_0x0e21('0x16')]);this[_0x0e21('0x7')]=_0x4323ba[_0x0e21('0x7')];this[_0x0e21('0x1d')]=_0x4323ba[_0x0e21('0x1d')];this[_0x0e21('0x1e')]=_0x4323ba[_0x0e21('0x1e')];this[_0x0e21('0x1f')]=_0x460dae['callback'];this[_0x0e21('0x20')]=_0x460dae[_0x0e21('0x20')];this[_0x0e21('0x21')]=_0x460dae['callbackat'];this[_0x0e21('0x22')]=_0x460dae[_0x0e21('0x22')];this[_0x0e21('0x23')]=_0x460dae[_0x0e21('0x23')];this['ListId']=_0x460dae['ListId'];this[_0x0e21('0x24')]=_0x460dae[_0x0e21('0x24')];this[_0x0e21('0x25')]=_0x460dae['VoiceQueueId'];this[_0x0e21('0x26')]=_0x460dae['CampaignId'];this[_0x0e21('0x27')]=_0x460dae[_0x0e21('0x27')]||'';this[_0x0e21('0x28')]=_0x460dae[_0x0e21('0x28')]||'';this[_0x0e21('0x29')]=_0x460dae[_0x0e21('0x29')];}module[_0x0e21('0x2a')]=AgentComplete; \ No newline at end of file +var _0xd75e=['holdtime','talktime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0xd75e,0x1c8));var _0xed75=function(_0x3a77b9,_0x26ee2d){_0x3a77b9=_0x3a77b9-0x0;var _0x38fd17=_0xd75e[_0x3a77b9];return _0x38fd17;};'use strict';var moment=require(_0xed75('0x0'));var utils=require(_0xed75('0x1'));function AgentComplete(_0x122716,_0x10dedb){this[_0xed75('0x2')]=0x4;this[_0xed75('0x3')]=_0xed75('0x4');this['scheduledat']=_0x122716[_0xed75('0x5')];this[_0xed75('0x6')]=_0x122716['type'];this[_0xed75('0x7')]=_0x122716[_0xed75('0x6')]===_0xed75('0x8')?_0xed75('0x9'):_0x122716[_0xed75('0x6')];this[_0xed75('0xa')]=_0x122716[_0xed75('0xa')];this['countcongestionretry']=_0x122716[_0xed75('0xb')];this[_0xed75('0xc')]=_0x122716[_0xed75('0xc')];this['countglobal']=_0x122716[_0xed75('0xa')]+_0x122716[_0xed75('0xb')]+_0x122716[_0xed75('0xc')]+_0x122716['countnosuchnumberretry']+_0x122716[_0xed75('0xd')]+_0x122716[_0xed75('0xe')]+_0x122716[_0xed75('0xf')]+_0x122716[_0xed75('0x10')];this['countnosuchnumberretry']=_0x122716[_0xed75('0x11')];this[_0xed75('0xd')]=_0x122716[_0xed75('0xd')];this['countabandonedretry']=_0x122716['countabandonedretry'];this[_0xed75('0xf')]=_0x122716[_0xed75('0xf')];this[_0xed75('0x10')]=_0x122716[_0xed75('0x10')];this[_0xed75('0x12')]=_0x10dedb[_0xed75('0x12')];this[_0xed75('0x13')]=_0x122716['name'];this[_0xed75('0x14')]=_0x122716[_0xed75('0x15')];this['starttime']=_0x122716[_0xed75('0x16')];this[_0xed75('0x17')]=_0x122716['responsetime'];this[_0xed75('0x18')]=_0x122716[_0xed75('0x18')];this[_0xed75('0x19')]=moment()['format'](_0xed75('0x1a'));this[_0xed75('0x1b')]=utils['getSeconds'](_0x122716[_0xed75('0x17')],_0x122716[_0xed75('0x16')]);this[_0xed75('0x1c')]=utils['getSeconds'](_0x122716['answertime'],_0x122716[_0xed75('0x17')]);this[_0xed75('0x1d')]=utils[_0xed75('0x1e')](this[_0xed75('0x19')],_0x122716[_0xed75('0x18')]);this['queue']=_0x10dedb[_0xed75('0x9')];this[_0xed75('0x1f')]=_0x10dedb[_0xed75('0x1f')];this[_0xed75('0x20')]=_0x10dedb[_0xed75('0x20')];this[_0xed75('0x21')]=_0x122716[_0xed75('0x21')];this[_0xed75('0x22')]=_0x122716[_0xed75('0x22')];this[_0xed75('0x23')]=_0x122716[_0xed75('0x23')];this[_0xed75('0x24')]=_0x122716['recallme'];this['ContactId']=_0x122716['ContactId'];this[_0xed75('0x25')]=_0x122716[_0xed75('0x25')];this[_0xed75('0x26')]=_0x122716[_0xed75('0x26')];this['VoiceQueueId']=_0x122716['VoiceQueueId'];this[_0xed75('0x27')]=_0x122716[_0xed75('0x27')];this[_0xed75('0x28')]=_0x122716['originatecalleridnum']||'';this[_0xed75('0x29')]=_0x122716[_0xed75('0x29')]||'';this['agiafterat']=_0x122716[_0xed75('0x2a')];}module[_0xed75('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 016802d..0b8348e 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 _0x4d10=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4bfb00,_0x5403ff){var _0x356a19=function(_0x3ea860){while(--_0x3ea860){_0x4bfb00['push'](_0x4bfb00['shift']());}};_0x356a19(++_0x5403ff);}(_0x4d10,0xed));var _0x04d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d10[_0x3dd15e];return _0x231fd0;};'use strict';function Final(_0x183d47){this[_0x04d1('0x0')]=_0x183d47['uniqueid'];this[_0x04d1('0x1')]=_0x183d47[_0x04d1('0x1')];this['type']=_0x183d47['type'];this[_0x04d1('0x2')]=_0x183d47[_0x04d1('0x3')]===_0x04d1('0x4')?'queue':_0x183d47[_0x04d1('0x3')];this[_0x04d1('0x5')]=_0x183d47[_0x04d1('0x5')];this[_0x04d1('0x6')]=_0x183d47[_0x04d1('0x6')];this[_0x04d1('0x7')]=_0x183d47[_0x04d1('0x7')];this[_0x04d1('0x8')]=_0x183d47[_0x04d1('0x5')]+_0x183d47[_0x04d1('0x6')]+_0x183d47[_0x04d1('0x7')]+_0x183d47[_0x04d1('0x9')]+_0x183d47[_0x04d1('0xa')]+_0x183d47[_0x04d1('0xb')]+_0x183d47[_0x04d1('0xc')]+_0x183d47[_0x04d1('0xd')];this[_0x04d1('0x9')]=_0x183d47[_0x04d1('0x9')];this[_0x04d1('0xa')]=_0x183d47['countdropretry'];this[_0x04d1('0xb')]=_0x183d47['countabandonedretry'];this['countmachineretry']=_0x183d47[_0x04d1('0xc')];this[_0x04d1('0xd')]=_0x183d47['countagentrejectretry'];this[_0x04d1('0xe')]=_0x183d47['queue'];this[_0x04d1('0xf')]=_0x183d47['calleridname'];this['calleridnum']=_0x183d47[_0x04d1('0x10')];this[_0x04d1('0x11')]=_0x183d47[_0x04d1('0x11')];this['responsetime']=_0x183d47['responsetime'];this[_0x04d1('0x12')]=_0x183d47['responsetime'];this[_0x04d1('0x13')]=_0x183d47[_0x04d1('0x13')]||0x0;this['holdtime']=_0x183d47[_0x04d1('0x14')]||0x0;this[_0x04d1('0x15')]=_0x183d47[_0x04d1('0x15')]||0x0;this['callback']=_0x183d47[_0x04d1('0x16')];this['callbackuniqueid']=_0x183d47['callbackuniqueid'];this[_0x04d1('0x17')]=_0x183d47[_0x04d1('0x17')];this[_0x04d1('0x18')]=_0x183d47[_0x04d1('0x18')];this[_0x04d1('0x19')]=_0x183d47[_0x04d1('0x19')];this[_0x04d1('0x1a')]=_0x183d47[_0x04d1('0x1a')];this['UserId']=_0x183d47[_0x04d1('0x1b')];this[_0x04d1('0x1c')]=_0x183d47['VoiceQueueId'];this[_0x04d1('0x1d')]=_0x183d47[_0x04d1('0x1d')];this['originatecalleridnum']=_0x183d47[_0x04d1('0x1e')]||'';this[_0x04d1('0x1f')]=_0x183d47[_0x04d1('0x1f')]||'';this[_0x04d1('0x20')]=_0x183d47['state'];this[_0x04d1('0x21')]=_0x183d47[_0x04d1('0x21')];}module[_0x04d1('0x22')]=Final; \ No newline at end of file +var _0x177c=['CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x5f1f9d,_0x5a046f){var _0x16f062=function(_0x5424b3){while(--_0x5424b3){_0x5f1f9d['push'](_0x5f1f9d['shift']());}};_0x16f062(++_0x5a046f);}(_0x177c,0x11e));var _0xc177=function(_0x53d5ef,_0xbfefae){_0x53d5ef=_0x53d5ef-0x0;var _0x6721ef=_0x177c[_0x53d5ef];return _0x6721ef;};'use strict';function Final(_0x5174f3){this[_0xc177('0x0')]=_0x5174f3[_0xc177('0x0')];this[_0xc177('0x1')]=_0x5174f3[_0xc177('0x1')];this['type']=_0x5174f3[_0xc177('0x2')];this[_0xc177('0x3')]=_0x5174f3[_0xc177('0x2')]===_0xc177('0x4')?_0xc177('0x5'):_0x5174f3[_0xc177('0x2')];this['countbusyretry']=_0x5174f3[_0xc177('0x6')];this[_0xc177('0x7')]=_0x5174f3[_0xc177('0x7')];this[_0xc177('0x8')]=_0x5174f3['countnoanswerretry'];this[_0xc177('0x9')]=_0x5174f3[_0xc177('0x6')]+_0x5174f3[_0xc177('0x7')]+_0x5174f3[_0xc177('0x8')]+_0x5174f3[_0xc177('0xa')]+_0x5174f3[_0xc177('0xb')]+_0x5174f3[_0xc177('0xc')]+_0x5174f3[_0xc177('0xd')]+_0x5174f3[_0xc177('0xe')];this[_0xc177('0xa')]=_0x5174f3[_0xc177('0xa')];this[_0xc177('0xb')]=_0x5174f3['countdropretry'];this[_0xc177('0xc')]=_0x5174f3[_0xc177('0xc')];this[_0xc177('0xd')]=_0x5174f3[_0xc177('0xd')];this['countagentrejectretry']=_0x5174f3[_0xc177('0xe')];this[_0xc177('0x5')]=_0x5174f3[_0xc177('0x5')];this[_0xc177('0xf')]=_0x5174f3[_0xc177('0xf')];this[_0xc177('0x10')]=_0x5174f3[_0xc177('0x10')];this['starttime']=_0x5174f3[_0xc177('0x11')];this['responsetime']=_0x5174f3[_0xc177('0x12')];this['endtime']=_0x5174f3['responsetime'];this[_0xc177('0x13')]=_0x5174f3[_0xc177('0x13')]||0x0;this[_0xc177('0x14')]=_0x5174f3[_0xc177('0x14')]||0x0;this[_0xc177('0x15')]=_0x5174f3[_0xc177('0x15')]||0x0;this[_0xc177('0x16')]=_0x5174f3['callback'];this[_0xc177('0x17')]=_0x5174f3[_0xc177('0x17')];this[_0xc177('0x18')]=_0x5174f3[_0xc177('0x18')];this['recallme']=_0x5174f3['recallme'];this[_0xc177('0x19')]=_0x5174f3[_0xc177('0x19')];this[_0xc177('0x1a')]=_0x5174f3[_0xc177('0x1a')];this[_0xc177('0x1b')]=_0x5174f3[_0xc177('0x1b')];this[_0xc177('0x1c')]=_0x5174f3[_0xc177('0x1c')];this[_0xc177('0x1d')]=_0x5174f3[_0xc177('0x1d')];this[_0xc177('0x1e')]=_0x5174f3[_0xc177('0x1e')]||'';this[_0xc177('0x1f')]=_0x5174f3[_0xc177('0x1f')]||'';this[_0xc177('0x20')]=_0x5174f3[_0xc177('0x20')];this[_0xc177('0x21')]=_0x5174f3['statedesc'];}module[_0xc177('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 b7c5d35..acb7e5a 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 _0xf9fc=['getSeconds','starttime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','../utils','statedesc','Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x54d86b,_0x7de4f8){var _0x3c80=function(_0x206059){while(--_0x206059){_0x54d86b['push'](_0x54d86b['shift']());}};_0x3c80(++_0x7de4f8);}(_0xf9fc,0x107));var _0xcf9f=function(_0xfdd4e5,_0x5e94d1){_0xfdd4e5=_0xfdd4e5-0x0;var _0x135edd=_0xf9fc[_0xfdd4e5];return _0x135edd;};'use strict';var moment=require('moment');var utils=require(_0xcf9f('0x0'));function Hangup(_0xc18c83,_0x51bff5){this['state']=0x4;this[_0xcf9f('0x1')]=_0xcf9f('0x2');this['scheduledat']=_0xc18c83[_0xcf9f('0x3')];this[_0xcf9f('0x4')]=_0xc18c83['type'];this[_0xcf9f('0x5')]=_0xc18c83[_0xcf9f('0x4')]==='outbound'?_0xcf9f('0x6'):_0xc18c83[_0xcf9f('0x4')];this[_0xcf9f('0x7')]=_0xc18c83[_0xcf9f('0x7')]||![];this[_0xcf9f('0x8')]=_0xc18c83[_0xcf9f('0x8')];this[_0xcf9f('0x9')]=_0xc18c83[_0xcf9f('0x9')];this['countnoanswerretry']=_0xc18c83[_0xcf9f('0xa')];this['countglobal']=_0xc18c83[_0xcf9f('0x8')]+_0xc18c83[_0xcf9f('0x9')]+_0xc18c83['countnoanswerretry']+_0xc18c83[_0xcf9f('0xb')]+_0xc18c83['countdropretry']+_0xc18c83[_0xcf9f('0xc')]+_0xc18c83[_0xcf9f('0xd')]+_0xc18c83[_0xcf9f('0xe')];this[_0xcf9f('0xb')]=_0xc18c83[_0xcf9f('0xb')];this[_0xcf9f('0xf')]=_0xc18c83[_0xcf9f('0xf')];this[_0xcf9f('0xc')]=_0xc18c83[_0xcf9f('0xc')];this[_0xcf9f('0xd')]=_0xc18c83[_0xcf9f('0xd')];this['countagentrejectretry']=_0xc18c83[_0xcf9f('0xe')];this[_0xcf9f('0x10')]=_0x51bff5[_0xcf9f('0x10')];this[_0xcf9f('0x11')]=_0xc18c83[_0xcf9f('0x12')];this[_0xcf9f('0x13')]=_0xc18c83['number'];this['starttime']=_0xc18c83['starttime'];this['responsetime']=_0xc18c83[_0xcf9f('0x14')];this[_0xcf9f('0x15')]=moment()['format'](_0xcf9f('0x16'));this[_0xcf9f('0x17')]=utils[_0xcf9f('0x18')](_0xc18c83[_0xcf9f('0x14')],_0xc18c83[_0xcf9f('0x19')]);this[_0xcf9f('0x1a')]=0x0;this[_0xcf9f('0x1b')]=utils[_0xcf9f('0x18')](this['endtime'],_0xc18c83[_0xcf9f('0x14')]);this[_0xcf9f('0x6')]=_0xc18c83['queue'];this[_0xcf9f('0x1c')]=_0xcf9f('0x1d');this[_0xcf9f('0x1e')]=_0x51bff5[_0xcf9f('0x1f')];this[_0xcf9f('0x20')]=_0xc18c83[_0xcf9f('0x20')];this[_0xcf9f('0x21')]=_0xc18c83[_0xcf9f('0x21')];this['callbackat']=_0xc18c83[_0xcf9f('0x22')];this[_0xcf9f('0x23')]=_0xc18c83['recallme'];this[_0xcf9f('0x24')]=_0xc18c83[_0xcf9f('0x24')];this['ListId']=_0xc18c83['ListId'];this[_0xcf9f('0x25')]=_0xc18c83[_0xcf9f('0x25')];this[_0xcf9f('0x26')]=_0xc18c83['VoiceQueueId'];this[_0xcf9f('0x27')]=_0xc18c83[_0xcf9f('0x27')];}module[_0xcf9f('0x28')]=Hangup; \ No newline at end of file +var _0x4088=['VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId'];(function(_0x257630,_0x59cf38){var _0x5abdfd=function(_0x5a10d4){while(--_0x5a10d4){_0x257630['push'](_0x257630['shift']());}};_0x5abdfd(++_0x59cf38);}(_0x4088,0x1b0));var _0x8408=function(_0x3ba938,_0x27414d){_0x3ba938=_0x3ba938-0x0;var _0x2aabff=_0x4088[_0x3ba938];return _0x2aabff;};'use strict';var moment=require(_0x8408('0x0'));var utils=require('../utils');function Hangup(_0x252081,_0x8302d9){this[_0x8408('0x1')]=0x4;this[_0x8408('0x2')]=_0x8408('0x3');this[_0x8408('0x4')]=_0x252081[_0x8408('0x4')];this[_0x8408('0x5')]=_0x252081[_0x8408('0x5')];this[_0x8408('0x6')]=_0x252081[_0x8408('0x5')]===_0x8408('0x7')?_0x8408('0x8'):_0x252081[_0x8408('0x5')];this[_0x8408('0x9')]=_0x252081[_0x8408('0x9')]||![];this[_0x8408('0xa')]=_0x252081['countbusyretry'];this[_0x8408('0xb')]=_0x252081[_0x8408('0xb')];this[_0x8408('0xc')]=_0x252081[_0x8408('0xc')];this[_0x8408('0xd')]=_0x252081[_0x8408('0xa')]+_0x252081[_0x8408('0xb')]+_0x252081['countnoanswerretry']+_0x252081[_0x8408('0xe')]+_0x252081[_0x8408('0xf')]+_0x252081[_0x8408('0x10')]+_0x252081[_0x8408('0x11')]+_0x252081[_0x8408('0x12')];this[_0x8408('0xe')]=_0x252081[_0x8408('0xe')];this['countdropretry']=_0x252081['countdropretry'];this[_0x8408('0x10')]=_0x252081[_0x8408('0x10')];this[_0x8408('0x11')]=_0x252081[_0x8408('0x11')];this[_0x8408('0x12')]=_0x252081[_0x8408('0x12')];this['uniqueid']=_0x8302d9[_0x8408('0x13')];this[_0x8408('0x14')]=_0x252081['name'];this['calleridnum']=_0x252081['number'];this[_0x8408('0x15')]=_0x252081[_0x8408('0x15')];this[_0x8408('0x16')]=_0x252081['responsetime'];this[_0x8408('0x17')]=moment()[_0x8408('0x18')](_0x8408('0x19'));this['ringtime']=utils[_0x8408('0x1a')](_0x252081[_0x8408('0x16')],_0x252081[_0x8408('0x15')]);this[_0x8408('0x1b')]=0x0;this['talktime']=utils['getSeconds'](this[_0x8408('0x17')],_0x252081[_0x8408('0x16')]);this[_0x8408('0x8')]=_0x252081[_0x8408('0x8')];this['membername']='IVR';this[_0x8408('0x1c')]=_0x8302d9[_0x8408('0x1d')];this['callback']=_0x252081[_0x8408('0x1e')];this[_0x8408('0x1f')]=_0x252081[_0x8408('0x1f')];this['callbackat']=_0x252081[_0x8408('0x20')];this['recallme']=_0x252081['recallme'];this[_0x8408('0x21')]=_0x252081[_0x8408('0x21')];this[_0x8408('0x22')]=_0x252081[_0x8408('0x22')];this[_0x8408('0x23')]=_0x252081[_0x8408('0x23')];this[_0x8408('0x24')]=_0x252081[_0x8408('0x24')];this[_0x8408('0x25')]=_0x252081['CampaignId'];}module[_0x8408('0x26')]=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 bf32e3e..2436029 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 _0x7caa=['state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum'];(function(_0x13a79a,_0x2e2829){var _0x2b6f16=function(_0x448543){while(--_0x448543){_0x13a79a['push'](_0x13a79a['shift']());}};_0x2b6f16(++_0x2e2829);}(_0x7caa,0x6f));var _0xa7ca=function(_0xb4d0c,_0x491f02){_0xb4d0c=_0xb4d0c-0x0;var _0x17ccf9=_0x7caa[_0xb4d0c];return _0x17ccf9;};'use strict';var utils=require(_0xa7ca('0x0'));function History(_0x2fcb59){this[_0xa7ca('0x1')]=_0x2fcb59[_0xa7ca('0x1')];this[_0xa7ca('0x2')]=_0x2fcb59['scheduledat']||undefined;this[_0xa7ca('0x3')]=_0x2fcb59['type'];this[_0xa7ca('0x4')]=_0x2fcb59[_0xa7ca('0x3')]===_0xa7ca('0x5')?_0xa7ca('0x6'):_0x2fcb59['type'];this[_0xa7ca('0x7')]=_0x2fcb59[_0xa7ca('0x7')];this['countcongestionretry']=_0x2fcb59[_0xa7ca('0x8')];this[_0xa7ca('0x9')]=_0x2fcb59[_0xa7ca('0x9')];this['countglobal']=_0x2fcb59[_0xa7ca('0x7')]+_0x2fcb59[_0xa7ca('0x8')]+_0x2fcb59[_0xa7ca('0x9')]+_0x2fcb59[_0xa7ca('0xa')]+_0x2fcb59[_0xa7ca('0xb')]+_0x2fcb59[_0xa7ca('0xc')]+_0x2fcb59[_0xa7ca('0xd')]+_0x2fcb59[_0xa7ca('0xe')];this[_0xa7ca('0xa')]=_0x2fcb59[_0xa7ca('0xa')];this[_0xa7ca('0xb')]=_0x2fcb59[_0xa7ca('0xb')];this[_0xa7ca('0xc')]=_0x2fcb59['countabandonedretry'];this['countmachineretry']=_0x2fcb59[_0xa7ca('0xd')];this['countagentrejectretry']=_0x2fcb59['countagentrejectretry'];this[_0xa7ca('0x6')]=_0x2fcb59[_0xa7ca('0x6')];this[_0xa7ca('0xf')]=_0x2fcb59[_0xa7ca('0x10')];this[_0xa7ca('0x11')]=_0x2fcb59[_0xa7ca('0x12')];this['starttime']=_0x2fcb59[_0xa7ca('0x13')];this[_0xa7ca('0x14')]=_0x2fcb59['responsetime'];this[_0xa7ca('0x15')]=_0x2fcb59[_0xa7ca('0x14')];this[_0xa7ca('0x16')]=utils['getSeconds'](_0x2fcb59[_0xa7ca('0x14')],_0x2fcb59[_0xa7ca('0x13')]);this['holdtime']=0x0;this[_0xa7ca('0x17')]=0x0;this[_0xa7ca('0x18')]=_0x2fcb59[_0xa7ca('0x18')];this[_0xa7ca('0x19')]=_0x2fcb59[_0xa7ca('0x19')];this[_0xa7ca('0x1a')]=_0x2fcb59['callbackat'];this[_0xa7ca('0x1b')]=_0x2fcb59[_0xa7ca('0x1b')];this[_0xa7ca('0x1c')]=_0x2fcb59[_0xa7ca('0x1c')];this[_0xa7ca('0x1d')]=_0x2fcb59['ListId'];this[_0xa7ca('0x1e')]=_0x2fcb59['UserId'];this['VoiceQueueId']=_0x2fcb59['VoiceQueueId'];this[_0xa7ca('0x1f')]=_0x2fcb59[_0xa7ca('0x1f')];this[_0xa7ca('0x20')]=_0x2fcb59[_0xa7ca('0x20')]||'';this['originatecalleridname']=_0x2fcb59['originatecalleridname']||'';this[_0xa7ca('0x21')]=_0x2fcb59['state'];this['statedesc']=_0x2fcb59[_0xa7ca('0x22')];}module[_0xa7ca('0x23')]=History; \ No newline at end of file +var _0xcc06=['campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','name','starttime','responsetime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','scheduledat','type'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xcc06,0x1ea));var _0x6cc0=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xcc06[_0x4243a3];return _0x1b2a33;};'use strict';var utils=require(_0x6cc0('0x0'));function History(_0x313965){this['uniqueid']=_0x313965['uniqueid'];this[_0x6cc0('0x1')]=_0x313965[_0x6cc0('0x1')]||undefined;this[_0x6cc0('0x2')]=_0x313965[_0x6cc0('0x2')];this[_0x6cc0('0x3')]=_0x313965[_0x6cc0('0x2')]==='outbound'?_0x6cc0('0x4'):_0x313965[_0x6cc0('0x2')];this[_0x6cc0('0x5')]=_0x313965['countbusyretry'];this['countcongestionretry']=_0x313965[_0x6cc0('0x6')];this['countnoanswerretry']=_0x313965['countnoanswerretry'];this[_0x6cc0('0x7')]=_0x313965[_0x6cc0('0x5')]+_0x313965[_0x6cc0('0x6')]+_0x313965[_0x6cc0('0x8')]+_0x313965[_0x6cc0('0x9')]+_0x313965[_0x6cc0('0xa')]+_0x313965['countabandonedretry']+_0x313965[_0x6cc0('0xb')]+_0x313965[_0x6cc0('0xc')];this[_0x6cc0('0x9')]=_0x313965[_0x6cc0('0x9')];this[_0x6cc0('0xa')]=_0x313965[_0x6cc0('0xa')];this[_0x6cc0('0xd')]=_0x313965[_0x6cc0('0xd')];this[_0x6cc0('0xb')]=_0x313965[_0x6cc0('0xb')];this[_0x6cc0('0xc')]=_0x313965[_0x6cc0('0xc')];this[_0x6cc0('0x4')]=_0x313965[_0x6cc0('0x4')];this['calleridname']=_0x313965[_0x6cc0('0xe')];this['calleridnum']=_0x313965['number'];this['starttime']=_0x313965[_0x6cc0('0xf')];this[_0x6cc0('0x10')]=_0x313965['responsetime'];this['endtime']=_0x313965[_0x6cc0('0x10')];this['ringtime']=utils['getSeconds'](_0x313965[_0x6cc0('0x10')],_0x313965[_0x6cc0('0xf')]);this[_0x6cc0('0x11')]=0x0;this['talktime']=0x0;this[_0x6cc0('0x12')]=_0x313965[_0x6cc0('0x12')];this[_0x6cc0('0x13')]=_0x313965[_0x6cc0('0x13')];this['callbackat']=_0x313965['callbackat'];this[_0x6cc0('0x14')]=_0x313965['recallme'];this[_0x6cc0('0x15')]=_0x313965['ContactId'];this[_0x6cc0('0x16')]=_0x313965[_0x6cc0('0x16')];this[_0x6cc0('0x17')]=_0x313965[_0x6cc0('0x17')];this[_0x6cc0('0x18')]=_0x313965[_0x6cc0('0x18')];this['CampaignId']=_0x313965['CampaignId'];this[_0x6cc0('0x19')]=_0x313965[_0x6cc0('0x19')]||'';this['originatecalleridname']=_0x313965[_0x6cc0('0x1a')]||'';this[_0x6cc0('0x1b')]=_0x313965[_0x6cc0('0x1b')];this[_0x6cc0('0x1c')]=_0x313965['statedesc'];}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 12ec155..bac8119 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 _0xdcee=['queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','dropreason','droptime','ringtime','holdtime','talktime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdcee,0xbb));var _0xedce=function(_0x7d5a8b,_0x2aedef){_0x7d5a8b=_0x7d5a8b-0x0;var _0x56ac46=_0xdcee[_0x7d5a8b];return _0x56ac46;};'use strict';var utils=require(_0xedce('0x0'));function QueueCallerAbandon(_0x371c83,_0x3daacb){this[_0xedce('0x1')]=_0x371c83[_0xedce('0x1')];this['type']=_0x371c83['type'];this[_0xedce('0x2')]=_0x371c83[_0xedce('0x3')]===_0xedce('0x4')?'queue':_0x371c83['type'];this[_0xedce('0x5')]=_0x371c83[_0xedce('0x5')];this[_0xedce('0x6')]=_0x371c83[_0xedce('0x6')];this[_0xedce('0x7')]=_0x371c83[_0xedce('0x7')];this['countglobal']=_0x371c83['countbusyretry']+_0x371c83['countcongestionretry']+_0x371c83[_0xedce('0x7')]+_0x371c83['countnosuchnumberretry']+_0x371c83['countdropretry']+_0x371c83[_0xedce('0x8')]+_0x371c83[_0xedce('0x9')]+_0x371c83[_0xedce('0xa')];this['countnosuchnumberretry']=_0x371c83['countnosuchnumberretry'];this[_0xedce('0xb')]=_0x371c83[_0xedce('0xb')];this[_0xedce('0x8')]=_0x371c83[_0xedce('0x8')];this[_0xedce('0x9')]=_0x371c83[_0xedce('0x9')];this['countagentrejectretry']=_0x371c83[_0xedce('0xa')];this['uniqueid']=_0x3daacb[_0xedce('0xc')];this['calleridname']=_0x371c83[_0xedce('0xd')];this[_0xedce('0xe')]=_0x371c83[_0xedce('0xf')];this[_0xedce('0x10')]=_0x371c83[_0xedce('0x10')];this['responsetime']=_0x371c83[_0xedce('0x11')];this['droptime']=_0x371c83['droptime'];this[_0xedce('0x12')]=_0x371c83[_0xedce('0x12')];this['endtime']=this[_0xedce('0x13')];this[_0xedce('0x14')]=utils['getSeconds'](_0x371c83[_0xedce('0x11')],_0x371c83[_0xedce('0x10')]);this[_0xedce('0x15')]=utils['getSeconds'](this[_0xedce('0x13')],_0x371c83['responsetime']);this[_0xedce('0x16')]=0x0;this[_0xedce('0x17')]=_0x3daacb[_0xedce('0x17')];this[_0xedce('0x18')]=_0x3daacb[_0xedce('0x19')];this[_0xedce('0x1a')]=_0x3daacb[_0xedce('0x1a')];this['callback']=_0x371c83[_0xedce('0x1b')];this[_0xedce('0x1c')]=_0x371c83[_0xedce('0x1c')];this[_0xedce('0x1d')]=_0x371c83[_0xedce('0x1d')];this[_0xedce('0x1e')]=_0x371c83[_0xedce('0x1e')];this[_0xedce('0x1f')]=_0x371c83[_0xedce('0x1f')];this[_0xedce('0x20')]=_0x371c83[_0xedce('0x20')];this[_0xedce('0x21')]=_0x371c83['UserId'];this[_0xedce('0x22')]=_0x371c83[_0xedce('0x22')];this[_0xedce('0x23')]=_0x371c83[_0xedce('0x23')];this['originatecalleridnum']=_0x371c83[_0xedce('0x24')]||'';this[_0xedce('0x25')]=_0x371c83[_0xedce('0x25')]||'';this[_0xedce('0x26')]=_0x371c83['agiafterat'];this[_0xedce('0x27')]=_0x371c83[_0xedce('0x27')];this[_0xedce('0x28')]=_0x371c83[_0xedce('0x28')];}module[_0xedce('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xd515=['../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports'];(function(_0x2be0ad,_0x47deb6){var _0x368a73=function(_0x45356e){while(--_0x45356e){_0x2be0ad['push'](_0x2be0ad['shift']());}};_0x368a73(++_0x47deb6);}(_0xd515,0x12d));var _0x5d51=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd515[_0x122ef9];return _0x42fba0;};'use strict';var utils=require(_0x5d51('0x0'));function QueueCallerAbandon(_0x195573,_0x6eeb56){this[_0x5d51('0x1')]=_0x195573[_0x5d51('0x1')];this[_0x5d51('0x2')]=_0x195573[_0x5d51('0x2')];this[_0x5d51('0x3')]=_0x195573[_0x5d51('0x2')]===_0x5d51('0x4')?_0x5d51('0x5'):_0x195573[_0x5d51('0x2')];this[_0x5d51('0x6')]=_0x195573[_0x5d51('0x6')];this[_0x5d51('0x7')]=_0x195573['countcongestionretry'];this['countnoanswerretry']=_0x195573[_0x5d51('0x8')];this['countglobal']=_0x195573[_0x5d51('0x6')]+_0x195573[_0x5d51('0x7')]+_0x195573[_0x5d51('0x8')]+_0x195573['countnosuchnumberretry']+_0x195573[_0x5d51('0x9')]+_0x195573['countabandonedretry']+_0x195573[_0x5d51('0xa')]+_0x195573[_0x5d51('0xb')];this['countnosuchnumberretry']=_0x195573['countnosuchnumberretry'];this[_0x5d51('0x9')]=_0x195573['countdropretry'];this[_0x5d51('0xc')]=_0x195573[_0x5d51('0xc')];this[_0x5d51('0xa')]=_0x195573[_0x5d51('0xa')];this[_0x5d51('0xb')]=_0x195573[_0x5d51('0xb')];this[_0x5d51('0xd')]=_0x6eeb56[_0x5d51('0xd')];this[_0x5d51('0xe')]=_0x195573[_0x5d51('0xf')];this[_0x5d51('0x10')]=_0x195573[_0x5d51('0x11')];this['starttime']=_0x195573[_0x5d51('0x12')];this[_0x5d51('0x13')]=_0x195573[_0x5d51('0x13')];this[_0x5d51('0x14')]=_0x195573['droptime'];this[_0x5d51('0x15')]=_0x195573[_0x5d51('0x15')];this[_0x5d51('0x16')]=this['droptime'];this[_0x5d51('0x17')]=utils[_0x5d51('0x18')](_0x195573['responsetime'],_0x195573['starttime']);this['holdtime']=utils[_0x5d51('0x18')](this[_0x5d51('0x14')],_0x195573[_0x5d51('0x13')]);this[_0x5d51('0x19')]=0x0;this[_0x5d51('0x5')]=_0x6eeb56[_0x5d51('0x5')];this[_0x5d51('0x1a')]=_0x6eeb56[_0x5d51('0x1b')];this[_0x5d51('0x1c')]=_0x6eeb56[_0x5d51('0x1c')];this[_0x5d51('0x1d')]=_0x195573['callback'];this['callbackuniqueid']=_0x195573['callbackuniqueid'];this[_0x5d51('0x1e')]=_0x195573['callbackat'];this[_0x5d51('0x1f')]=_0x195573[_0x5d51('0x1f')];this[_0x5d51('0x20')]=_0x195573[_0x5d51('0x20')];this[_0x5d51('0x21')]=_0x195573[_0x5d51('0x21')];this[_0x5d51('0x22')]=_0x195573[_0x5d51('0x22')];this[_0x5d51('0x23')]=_0x195573[_0x5d51('0x23')];this[_0x5d51('0x24')]=_0x195573[_0x5d51('0x24')];this[_0x5d51('0x25')]=_0x195573[_0x5d51('0x25')]||'';this['originatecalleridname']=_0x195573[_0x5d51('0x26')]||'';this[_0x5d51('0x27')]=_0x195573[_0x5d51('0x27')];this[_0x5d51('0x28')]=_0x195573[_0x5d51('0x28')];this[_0x5d51('0x29')]=_0x195573[_0x5d51('0x29')];}module[_0x5d51('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 4abf965..9bcd025 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 _0x2da6=['../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','createHistory','[createHistory]','util','../../../../config/logger','dialer'];(function(_0x3cbf2d,_0x2e8845){var _0x2cfbe2=function(_0x59e556){while(--_0x59e556){_0x3cbf2d['push'](_0x3cbf2d['shift']());}};_0x2cfbe2(++_0x2e8845);}(_0x2da6,0x1dd));var _0x62da=function(_0x58dedd,_0x115977){_0x58dedd=_0x58dedd-0x0;var _0x56d059=_0x2da6[_0x58dedd];return _0x56d059;};'use strict';var util=require(_0x62da('0x0'));var logger=require(_0x62da('0x1'))(_0x62da('0x2'));var cmHopper=require(_0x62da('0x3'));var cmHopperAdditionalPhone=require(_0x62da('0x4'));var cmHopperBlack=require(_0x62da('0x5'));var cmHopperHistory=require(_0x62da('0x6'));function inspectError(_0x3552dc){return util['inspect'](_0x3552dc,{'showHidden':![],'depth':null});}function getContactDialer(_0x4a8428,_0xe28204,_0x3163df){return cmHopper[_0x62da('0x7')](_0x4a8428['id'],_0xe28204,_0x3163df,_0x4a8428[_0x62da('0x8')])[_0x62da('0x9')](function(_0x9d9139){_0x4a8428[_0x62da('0xa')]=0x0;logger[_0x62da('0xb')](_0x62da('0xc'),inspectError(_0x9d9139));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x19b866,_0x2a3937){return cmHopper[_0x62da('0xd')](_0x19b866['id'],_0x2a3937,_0x19b866[_0x62da('0x8')])['catch'](function(_0x241090){_0x19b866[_0x62da('0xa')]=0x0;logger[_0x62da('0xb')](_0x62da('0xe'),inspectError(_0x241090));});}exports[_0x62da('0xd')]=getContactDialerIvr;function countReScheduled(_0x5c990c){return cmHopper[_0x62da('0xf')](_0x5c990c)[_0x62da('0x9')](function(_0xd27693){logger[_0x62da('0xb')](_0x62da('0x10'),inspectError(_0xd27693));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x47c18e){return cmHopper[_0x62da('0x11')](_0x47c18e)[_0x62da('0x9')](function(_0x1bd7f9){logger[_0x62da('0xb')](_0x62da('0x12'),inspectError(_0x1bd7f9));});}exports[_0x62da('0x11')]=rescheduleContact;function unlockContact(_0x3c6498,_0x624a1c,_0x2cbdf6){return cmHopper[_0x62da('0x13')](_0x3c6498,_0x624a1c,_0x2cbdf6)[_0x62da('0x9')](function(_0x27ab5f){logger[_0x62da('0xb')](_0x62da('0x14'),inspectError(_0x27ab5f));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x4ad626){return cmHopper[_0x62da('0x15')](_0x4ad626)['catch'](function(_0x4d6482){logger[_0x62da('0xb')](_0x62da('0x16'),inspectError(_0x4d6482));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x29191b){return cmHopperBlack['checkIsBlackList'](_0x29191b)[_0x62da('0x9')](function(_0x37c15d){logger[_0x62da('0xb')](_0x62da('0x17'),inspectError(_0x37c15d));});}exports[_0x62da('0x18')]=checkIsBlackList;function checkIsBlackListIvr(_0x267cef){return cmHopperBlack[_0x62da('0x19')](_0x267cef)[_0x62da('0x9')](function(_0x1cb647){logger['error'](_0x62da('0x1a'),inspectError(_0x1cb647));});}exports[_0x62da('0x19')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2fd925,_0x1f6f96,_0x35f687){return cmHopperAdditionalPhone[_0x62da('0x1b')](_0x2fd925,_0x1f6f96,_0x35f687)[_0x62da('0x9')](function(_0x50ed6b){logger['error']('[verifyAdditionalPhone]',inspectError(_0x50ed6b));});}exports[_0x62da('0x1b')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1d1ef3,_0x14897c,_0x3f6fc9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1d1ef3,_0x14897c,_0x3f6fc9)[_0x62da('0x9')](function(_0x3b9c06){logger['error'](_0x62da('0x1c'),inspectError(_0x3b9c06));});}exports[_0x62da('0x1d')]=swapAdditionalPhones;function avgHandleTime(_0x1775ea){return cmHopperHistory['avgHandleTime'](_0x1775ea)[_0x62da('0x9')](function(_0x87f92b){logger[_0x62da('0xb')]('[avgHandleTime]',inspectError(_0x87f92b));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x3c6274){return cmHopperHistory[_0x62da('0x1e')](_0x3c6274)[_0x62da('0x9')](function(_0x594c5a){logger[_0x62da('0xb')](_0x62da('0x1f'),inspectError(_0x594c5a));});}exports[_0x62da('0x1e')]=createHistory; \ No newline at end of file +var _0xafb9=['[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','temp','error','[getContactDialer]','getContactDialerIvr','catch','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xafb9,0x68));var _0x9afb=function(_0x189cdb,_0x31ec15){_0x189cdb=_0x189cdb-0x0;var _0x2aba87=_0xafb9[_0x189cdb];return _0x2aba87;};'use strict';var util=require(_0x9afb('0x0'));var logger=require(_0x9afb('0x1'))(_0x9afb('0x2'));var cmHopper=require(_0x9afb('0x3'));var cmHopperAdditionalPhone=require(_0x9afb('0x4'));var cmHopperBlack=require(_0x9afb('0x5'));var cmHopperHistory=require(_0x9afb('0x6'));function inspectError(_0x44892f){return util[_0x9afb('0x7')](_0x44892f,{'showHidden':![],'depth':null});}function getContactDialer(_0x4e983d,_0x498463,_0x91ffa0){return cmHopper['getContactDialer'](_0x4e983d['id'],_0x498463,_0x91ffa0,_0x4e983d[_0x9afb('0x8')])['catch'](function(_0x556880){_0x4e983d[_0x9afb('0x9')]=0x0;logger[_0x9afb('0xa')](_0x9afb('0xb'),inspectError(_0x556880));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x3ef362,_0x3e0264){return cmHopper[_0x9afb('0xc')](_0x3ef362['id'],_0x3e0264,_0x3ef362[_0x9afb('0x8')])[_0x9afb('0xd')](function(_0x56f477){_0x3ef362['temp']=0x0;logger[_0x9afb('0xa')](_0x9afb('0xe'),inspectError(_0x56f477));});}exports[_0x9afb('0xc')]=getContactDialerIvr;function countReScheduled(_0x31b574){return cmHopper[_0x9afb('0xf')](_0x31b574)[_0x9afb('0xd')](function(_0x374094){logger[_0x9afb('0xa')](_0x9afb('0x10'),inspectError(_0x374094));});}exports[_0x9afb('0xf')]=countReScheduled;function rescheduleContact(_0x47a804){return cmHopper[_0x9afb('0x11')](_0x47a804)['catch'](function(_0x59fd82){logger[_0x9afb('0xa')](_0x9afb('0x12'),inspectError(_0x59fd82));});}exports[_0x9afb('0x11')]=rescheduleContact;function unlockContact(_0x2d664d,_0x46b16f,_0x39cdf1){return cmHopper[_0x9afb('0x13')](_0x2d664d,_0x46b16f,_0x39cdf1)['catch'](function(_0x18505a){logger[_0x9afb('0xa')](_0x9afb('0x14'),inspectError(_0x18505a));});}exports[_0x9afb('0x13')]=unlockContact;function moveContactManagedDialer(_0x223aef){return cmHopper['moveContactManagedDialer'](_0x223aef)[_0x9afb('0xd')](function(_0x50a7e4){logger[_0x9afb('0xa')](_0x9afb('0x15'),inspectError(_0x50a7e4));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x4a1c74){return cmHopperBlack[_0x9afb('0x16')](_0x4a1c74)[_0x9afb('0xd')](function(_0x3d8450){logger[_0x9afb('0xa')](_0x9afb('0x17'),inspectError(_0x3d8450));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x105253){return cmHopperBlack['checkIsBlackListIvr'](_0x105253)['catch'](function(_0x3fb534){logger[_0x9afb('0xa')](_0x9afb('0x18'),inspectError(_0x3fb534));});}exports[_0x9afb('0x19')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x50c835,_0x1e6f9c,_0x725a04){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x50c835,_0x1e6f9c,_0x725a04)['catch'](function(_0x5b5dab){logger[_0x9afb('0xa')]('[verifyAdditionalPhone]',inspectError(_0x5b5dab));});}exports[_0x9afb('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x123510,_0x50a919,_0x324293){return cmHopperAdditionalPhone[_0x9afb('0x1b')](_0x123510,_0x50a919,_0x324293)[_0x9afb('0xd')](function(_0x337d81){logger['error'](_0x9afb('0x1c'),inspectError(_0x337d81));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x29e092){return cmHopperHistory['avgHandleTime'](_0x29e092)['catch'](function(_0x1e6100){logger[_0x9afb('0xa')](_0x9afb('0x1d'),inspectError(_0x1e6100));});}exports[_0x9afb('0x1e')]=avgHandleTime;function createHistory(_0x119e04){return cmHopperHistory[_0x9afb('0x1f')](_0x119e04)[_0x9afb('0xd')](function(_0x5aabd5){logger['error'](_0x9afb('0x20'),inspectError(_0x5aabd5));});}exports[_0x9afb('0x1f')]=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 ace299d..eb4531a 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 _0xb3bf=['dialActive','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','active','includes','status','TrunkBackup','ACTIVE','DISACTIVED','NO_AGENTS_LOGGED','INACTIVE','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','replace','random','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','ivr','isIVRCampaign','type'];(function(_0x2f12fe,_0x44ab13){var _0x26832c=function(_0x28e5ee){while(--_0x28e5ee){_0x2f12fe['push'](_0x2f12fe['shift']());}};_0x26832c(++_0x44ab13);}(_0xb3bf,0x1db));var _0xfb3b=function(_0x14dde2,_0x3ec312){_0x14dde2=_0x14dde2-0x0;var _0x31418c=_0xb3bf[_0x14dde2];return _0x31418c;};'use strict';var _=require(_0xfb3b('0x0'));var moment=require(_0xfb3b('0x1'));var util=require(_0xfb3b('0x2'));var logger=require(_0xfb3b('0x3'))(_0xfb3b('0x4'));var timezones=require(_0xfb3b('0x5'))[_0xfb3b('0x6')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xfb3b('0x7'),'CONTACTS_RESCHEDULED':_0xfb3b('0x8'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xfb3b('0x9'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xfb3b('0xa'),'NO_AGENTS_LOGGED':_0xfb3b('0xb'),'NO_AVAILABLE_CONTACTS':_0xfb3b('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xfb3b('0xd'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xfb3b('0xe'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0xfb3b('0xf'),'UNKNOWN_TIMEZONE':_0xfb3b('0x10'),'UNREACHABLE_TRUNK':_0xfb3b('0x11')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2b5ed5){return _0x2b5ed5[_0xfb3b('0x12')]===_0xfb3b('0x13');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x5aae25){return _0x5aae25['type']===_0xfb3b('0x14');}exports[_0xfb3b('0x15')]=isIVRCampaign;function isOutboundQueue(_0x3c2460){return _0x3c2460[_0xfb3b('0x16')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x25dd0c){return _0x25dd0c[_0xfb3b('0x17')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x323ef5){return _0x323ef5['active'];}exports[_0xfb3b('0x18')]=isIVRCampaignActive;function getSeconds(_0x36e6b1,_0x4affca){var _0x28f4fd=moment(_0x36e6b1)[_0xfb3b('0x19')](0x0);var _0x35926e=moment(_0x4affca)[_0xfb3b('0x19')](0x0);return _0x28f4fd['diff'](_0x35926e,_0xfb3b('0x1a'));}exports[_0xfb3b('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x41f908,_0x53ea90){var _0x341774=![];var _0x294f77=_0x41f908[_0xfb3b('0x12')]!==_0x53ea90[_0xfb3b('0x12')]||_0x41f908[_0xfb3b('0x17')]!==_0x53ea90[_0xfb3b('0x17')]||_0x41f908[_0xfb3b('0x1c')]!==_0x53ea90[_0xfb3b('0x1c')];var _0x50fd4a=_0x41f908[_0xfb3b('0x1d')]!==_0x53ea90[_0xfb3b('0x1d')]||_0x41f908[_0xfb3b('0x1e')]!==_0x53ea90[_0xfb3b('0x1e')]||_0x41f908[_0xfb3b('0x1f')]!==_0x53ea90[_0xfb3b('0x1f')]||_0x41f908[_0xfb3b('0x20')]!==_0x53ea90[_0xfb3b('0x20')]||_0x41f908[_0xfb3b('0x21')]!==_0x53ea90[_0xfb3b('0x21')]||_0x41f908['pTalking']!==_0x53ea90[_0xfb3b('0x22')]||_0x41f908[_0xfb3b('0x23')]!==_0x53ea90[_0xfb3b('0x23')]||_0x41f908[_0xfb3b('0x24')]!==_0x53ea90[_0xfb3b('0x24')]||_0x41f908[_0xfb3b('0x25')]!==_0x53ea90[_0xfb3b('0x25')];if(_0x41f908[_0xfb3b('0x26')]&&_0x53ea90[_0xfb3b('0x26')]){_0x341774=_0x41f908['Trunk'][_0xfb3b('0x27')]!==_0x53ea90[_0xfb3b('0x26')][_0xfb3b('0x27')]||_0x41f908[_0xfb3b('0x26')]['active']!==_0x53ea90[_0xfb3b('0x26')]['active'];}return _0x294f77||_0x50fd4a||_0x341774;}exports[_0xfb3b('0x28')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x31673b){var _0x1e4fca=null;var _0x4a75f2=_0x31673b['dialTimezone'];if(_[_0xfb3b('0x29')](_0x31673b[_0xfb3b('0x2a')])||_[_0xfb3b('0x29')](_0x31673b[_0xfb3b('0x2b')])||_[_0xfb3b('0x29')](_0x31673b[_0xfb3b('0x2b')][_0xfb3b('0x2c')])){_0x1e4fca=CAMPAIGN_STATUS[_0xfb3b('0x2d')];}else if(_[_0xfb3b('0x2e')](_0x31673b['dialGlobalInterval'])||_[_0xfb3b('0x2e')](_0x31673b[_0xfb3b('0x2b')][_0xfb3b('0x2c')])){_0x1e4fca=CAMPAIGN_STATUS[_0xfb3b('0x2f')];}else if(_0x4a75f2&&!timezones[_0x4a75f2]){_0x1e4fca=CAMPAIGN_STATUS[_0xfb3b('0x30')];}return _0x1e4fca;}function checkAnyValidTrunk(_0x41e658,_0x459d5f){var _0x13b6fc=null;var _0x5d29cc='SIP/';var _0x2b64e6=[_0xfb3b('0x31'),_0xfb3b('0x32')];var _0x213448=!![];if(_0x41e658[_0xfb3b('0x26')]&&_0x41e658[_0xfb3b('0x26')][_0xfb3b('0x33')]){_0x5d29cc+=_0x41e658[_0xfb3b('0x26')][_0xfb3b('0x27')];_0x13b6fc=_0x459d5f[_0x5d29cc];_0x213448=_0x2b64e6[_0xfb3b('0x34')](_0x13b6fc[_0xfb3b('0x35')]);}else if(_0x41e658['TrunkBackup']&&_0x41e658['TrunkBackup'][_0xfb3b('0x33')]){_0x5d29cc+=_0x41e658[_0xfb3b('0x36')][_0xfb3b('0x27')];_0x13b6fc=_0x459d5f[_0x5d29cc];_0x213448=_0x2b64e6['includes'](_0x13b6fc[_0xfb3b('0x35')]);}return _0x213448;}function getQueueCampaignStatusMessage(_0xf177d1,_0x394256){var _0x1a330e=CAMPAIGN_STATUS[_0xfb3b('0x37')];var _0x205fb1=isPreviewCampaign(_0xf177d1);if(!isQueueCampaignActive(_0xf177d1)){if(_0x205fb1){_0x1a330e=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0xf177d1[_0xfb3b('0x25')]===0x0&&_0xf177d1[_0xfb3b('0x21')]===0x0&&_0xf177d1[_0xfb3b('0x23')]===0x0&&(_0xf177d1[_0xfb3b('0x22')]||0x0)===0x0){_0x1a330e=CAMPAIGN_STATUS['INACTIVE'];}else{_0x1a330e=CAMPAIGN_STATUS[_0xfb3b('0x38')];}}}else if(_0xf177d1[_0xfb3b('0x1e')]===0x0){_0x1a330e=CAMPAIGN_STATUS[_0xfb3b('0x39')];}else if(!checkAnyValidTrunk(_0xf177d1,_0x394256)){_0x1a330e=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0xf177d1)){var _0x1cdbce=checkAnyValidQueueCampaignInterval(_0xf177d1);if(_0x1cdbce){_0x1a330e=_0x1cdbce;}}return _0x1a330e;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x355552){var _0xa1a509=CAMPAIGN_STATUS[_0xfb3b('0x38')];if(_0x355552[_0xfb3b('0x25')]===0x0&&_0x355552[_0xfb3b('0x21')]===0x0&&_0x355552[_0xfb3b('0x23')]===0x0&&(_0x355552['pTalking']||0x0)===0x0){_0xa1a509=CAMPAIGN_STATUS[_0xfb3b('0x3a')];}return _0xa1a509;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4436c1){var _0x3bdf86=_0x4436c1[_0xfb3b('0x3b')](/"(.*?)"/);return _0x3bdf86?_0x3bdf86[0x1]:_0x4436c1;}exports[_0xfb3b('0x3c')]=extractCalleridName;function getCallerId(_0x598715,_0x548e9b,_0x5b945c){if(!_[_0xfb3b('0x3d')](_0x5b945c)&&typeof _0x5b945c==='string'&&!_[_0xfb3b('0x2e')](_0x5b945c)){if(!_[_0xfb3b('0x3d')](_0x548e9b)&&typeof _0x548e9b===_0xfb3b('0x3e')&&!_[_0xfb3b('0x2e')](_0x548e9b)){return util[_0xfb3b('0x3f')](_0xfb3b('0x40'),_0x548e9b,_0x5b945c);}return util[_0xfb3b('0x3f')]('\x22%s\x22\x20<%s>',_0x5b945c,_0x5b945c);}if(!_[_0xfb3b('0x3d')](_0x598715)&&typeof _0x598715===_0xfb3b('0x3e')&&!_[_0xfb3b('0x2e')](_0x598715)){return _0x598715;}return _0xfb3b('0x41');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x33070d,_0x5f0e7e){var _0x230884;var _0x13c91c;var _0x1c893a;if(_0x5f0e7e<=0x0){_0x5f0e7e=0x1;}_0x230884=new RegExp(_0xfb3b('0x42')+_0x5f0e7e+'}$');_0x13c91c=Math['pow'](0xa,_0x5f0e7e-0x1);_0x1c893a=Math['pow'](0xa,_0x5f0e7e)-0x1;return util['format']('%s',_[_0xfb3b('0x43')](_0x33070d,_0x230884,_[_0xfb3b('0x44')](_0x13c91c,_0x1c893a)['toString']()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0xb154f2){if(_0xb154f2[_0xfb3b('0x25')]&&_0xb154f2[_0xfb3b('0x25')]>0x0){_0xb154f2[_0xfb3b('0x25')]-=0x1;}else{logger['error'](_0xfb3b('0x45'));}}exports[_0xfb3b('0x46')]=decrementOriginate;function checkContactEmpty(_0x2a3616){return _0x2a3616&&_0x2a3616[_0xfb3b('0x47')]>0x0;}exports[_0xfb3b('0x48')]=checkContactEmpty;function erlangb(_0x558fbb,_0x289b6e){if(_0x289b6e===0x0){return 0x0;}var _0x60247d=0x1;for(var _0x52afba=0x1;_0x52afba<=_0x289b6e;_0x52afba+=0x1){_0x60247d=0x1+_0x60247d*_0x52afba/_0x558fbb;}return 0x1/_0x60247d;}exports[_0xfb3b('0x49')]=erlangb;function checkContactLowerLimitOriginate(_0x3d4081,_0x23c01f,_0x35967b){if(_0x23c01f>_0x35967b){for(var _0x4362ee=0x0;_0x4362ee<_0x23c01f-_0x35967b;_0x4362ee+=0x1){decrementOriginate(_0x3d4081);}}}exports[_0xfb3b('0x4a')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4e8994){var _0x1ea0ff={};var _0x44d25e=['id',_0xfb3b('0x4b'),_0xfb3b('0x4c'),'tags',_0xfb3b('0x4d')];if(_0x4e8994){for(var _0x3a927e in _0x4e8994){if(typeof _0x4e8994[_0x3a927e]!==_0xfb3b('0x4e')){if(!_['isNil'](_0x4e8994[_0x3a927e])&&!_0x44d25e[_0xfb3b('0x34')](_0x3a927e)){_0x1ea0ff[util[_0xfb3b('0x3f')](_0xfb3b('0x4f'),_0xfb3b('0x50'),_0x3a927e[_0xfb3b('0x51')]())]=_0x4e8994[_0x3a927e];}}}}return _0x1ea0ff;}exports[_0xfb3b('0x52')]=setXMDContactVariables; \ No newline at end of file +var _0x9c13=['\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','includes','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','util','../../../../config/logger','dialer','timezones','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','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','preview','type','ivr','isOutboundQueue','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','dialMethod','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','TrunkBackup','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','format'];(function(_0x4cbdad,_0x1ec8f){var _0x5dff07=function(_0x2bef2c){while(--_0x2bef2c){_0x4cbdad['push'](_0x4cbdad['shift']());}};_0x5dff07(++_0x1ec8f);}(_0x9c13,0x1d9));var _0x39c1=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0x9c13[_0x1895b7];return _0x1aecdc;};'use strict';var _=require(_0x39c1('0x0'));var moment=require('moment');var util=require(_0x39c1('0x1'));var logger=require(_0x39c1('0x2'))(_0x39c1('0x3'));var timezones=require('../../../../config/environment/shared')[_0x39c1('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x39c1('0x5'),'BLACKLIST':_0x39c1('0x6'),'CONTACTS_RESCHEDULED':_0x39c1('0x7'),'DEACTIVATED':_0x39c1('0x8'),'DISACTIVED':_0x39c1('0x9'),'EMPTY_INTERVAL':_0x39c1('0xa'),'INACTIVE':_0x39c1('0xb'),'NO_AGENTS_LOGGED':_0x39c1('0xc'),'NO_AVAILABLE_CONTACTS':_0x39c1('0xd'),'NULL_INTERVAL':_0x39c1('0xe'),'OVERTIME_INTERVAL':_0x39c1('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x39c1('0x10'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x39c1('0x11'),'RUNNING':_0x39c1('0x12'),'UNKNOWN_TIMEZONE':_0x39c1('0x13'),'UNREACHABLE_TRUNK':_0x39c1('0x14')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2c51c4){return _0x2c51c4['dialMethod']===_0x39c1('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x547d82){return _0x547d82[_0x39c1('0x16')]===_0x39c1('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x3b764c){return _0x3b764c['type']==='outbound';}exports[_0x39c1('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x153f28){return _0x153f28['dialActive'];}exports[_0x39c1('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0xcdd912){return _0xcdd912['active'];}exports[_0x39c1('0x1a')]=isIVRCampaignActive;function getSeconds(_0x4de51b,_0x2eff85){var _0x5e2e8c=moment(_0x4de51b)[_0x39c1('0x1b')](0x0);var _0x5b1299=moment(_0x2eff85)['milliseconds'](0x0);return _0x5e2e8c[_0x39c1('0x1c')](_0x5b1299,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x1b55a0,_0x3629ce){var _0x4fd4ba=![];var _0x348181=_0x1b55a0['dialMethod']!==_0x3629ce[_0x39c1('0x1d')]||_0x1b55a0[_0x39c1('0x1e')]!==_0x3629ce[_0x39c1('0x1e')]||_0x1b55a0[_0x39c1('0x1f')]!==_0x3629ce[_0x39c1('0x1f')];var _0x2c4587=_0x1b55a0[_0x39c1('0x20')]!==_0x3629ce['available']||_0x1b55a0[_0x39c1('0x21')]!==_0x3629ce[_0x39c1('0x21')]||_0x1b55a0[_0x39c1('0x22')]!==_0x3629ce[_0x39c1('0x22')]||_0x1b55a0[_0x39c1('0x23')]!==_0x3629ce[_0x39c1('0x23')]||_0x1b55a0[_0x39c1('0x24')]!==_0x3629ce[_0x39c1('0x24')]||_0x1b55a0['pTalking']!==_0x3629ce[_0x39c1('0x25')]||_0x1b55a0[_0x39c1('0x26')]!==_0x3629ce[_0x39c1('0x26')]||_0x1b55a0[_0x39c1('0x27')]!==_0x3629ce[_0x39c1('0x27')]||_0x1b55a0[_0x39c1('0x28')]!==_0x3629ce[_0x39c1('0x28')];if(_0x1b55a0[_0x39c1('0x29')]&&_0x3629ce[_0x39c1('0x29')]){_0x4fd4ba=_0x1b55a0[_0x39c1('0x29')][_0x39c1('0x2a')]!==_0x3629ce[_0x39c1('0x29')][_0x39c1('0x2a')]||_0x1b55a0[_0x39c1('0x29')][_0x39c1('0x2b')]!==_0x3629ce[_0x39c1('0x29')][_0x39c1('0x2b')];}return _0x348181||_0x2c4587||_0x4fd4ba;}exports[_0x39c1('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2f321b){var _0x8ca39a=null;var _0x56742b=_0x2f321b[_0x39c1('0x2d')];if(_[_0x39c1('0x2e')](_0x2f321b[_0x39c1('0x2f')])||_[_0x39c1('0x2e')](_0x2f321b['Interval'])||_[_0x39c1('0x2e')](_0x2f321b[_0x39c1('0x30')]['Intervals'])){_0x8ca39a=CAMPAIGN_STATUS[_0x39c1('0x31')];}else if(_['isEmpty'](_0x2f321b[_0x39c1('0x2f')])||_[_0x39c1('0x32')](_0x2f321b[_0x39c1('0x30')][_0x39c1('0x33')])){_0x8ca39a=CAMPAIGN_STATUS[_0x39c1('0x34')];}else if(_0x56742b&&!timezones[_0x56742b]){_0x8ca39a=CAMPAIGN_STATUS[_0x39c1('0x35')];}return _0x8ca39a;}function checkAnyValidTrunk(_0x476320,_0x346e1d){var _0x482e5f=null;var _0x1266cc=_0x39c1('0x36');var _0x3c3d9b=['reachable',_0x39c1('0x37')];var _0x1140ec=!![];if(_0x476320[_0x39c1('0x29')]&&_0x476320['Trunk'][_0x39c1('0x2b')]){_0x1266cc+=_0x476320[_0x39c1('0x29')][_0x39c1('0x2a')];_0x482e5f=_0x346e1d[_0x1266cc];_0x1140ec=_0x3c3d9b['includes'](_0x482e5f['status']);}else if(_0x476320['TrunkBackup']&&_0x476320[_0x39c1('0x38')]['active']){_0x1266cc+=_0x476320[_0x39c1('0x38')][_0x39c1('0x2a')];_0x482e5f=_0x346e1d[_0x1266cc];_0x1140ec=_0x3c3d9b['includes'](_0x482e5f[_0x39c1('0x39')]);}return _0x1140ec;}function getQueueCampaignStatusMessage(_0x50df8e,_0x183fea){var _0x50f4f6=CAMPAIGN_STATUS['ACTIVE'];var _0x3be992=isPreviewCampaign(_0x50df8e);if(!isQueueCampaignActive(_0x50df8e)){if(_0x3be992){_0x50f4f6=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x50df8e['originated']===0x0&&_0x50df8e[_0x39c1('0x24')]===0x0&&_0x50df8e[_0x39c1('0x26')]===0x0&&(_0x50df8e[_0x39c1('0x25')]||0x0)===0x0){_0x50f4f6=CAMPAIGN_STATUS[_0x39c1('0x3a')];}else{_0x50f4f6=CAMPAIGN_STATUS[_0x39c1('0x3b')];}}}else if(_0x50df8e[_0x39c1('0x21')]===0x0){_0x50f4f6=CAMPAIGN_STATUS[_0x39c1('0x3c')];}else if(!checkAnyValidTrunk(_0x50df8e,_0x183fea)){_0x50f4f6=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x50df8e)){var _0x5ceb74=checkAnyValidQueueCampaignInterval(_0x50df8e);if(_0x5ceb74){_0x50f4f6=_0x5ceb74;}}return _0x50f4f6;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x52f9be){var _0x1e9250=CAMPAIGN_STATUS['DISACTIVED'];if(_0x52f9be['originated']===0x0&&_0x52f9be[_0x39c1('0x24')]===0x0&&_0x52f9be[_0x39c1('0x26')]===0x0&&(_0x52f9be[_0x39c1('0x25')]||0x0)===0x0){_0x1e9250=CAMPAIGN_STATUS[_0x39c1('0x3a')];}return _0x1e9250;}exports[_0x39c1('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x19a928){var _0x4ca9c2=_0x19a928[_0x39c1('0x3e')](/"(.*?)"/);return _0x4ca9c2?_0x4ca9c2[0x1]:_0x19a928;}exports[_0x39c1('0x3f')]=extractCalleridName;function getCallerId(_0x4def16,_0x529ce5,_0x519ff9){if(!_['isUndefined'](_0x519ff9)&&typeof _0x519ff9===_0x39c1('0x40')&&!_[_0x39c1('0x32')](_0x519ff9)){if(!_[_0x39c1('0x41')](_0x529ce5)&&typeof _0x529ce5===_0x39c1('0x40')&&!_[_0x39c1('0x32')](_0x529ce5)){return util[_0x39c1('0x42')](_0x39c1('0x43'),_0x529ce5,_0x519ff9);}return util[_0x39c1('0x42')]('\x22%s\x22\x20<%s>',_0x519ff9,_0x519ff9);}if(!_[_0x39c1('0x41')](_0x4def16)&&typeof _0x4def16==='string'&&!_[_0x39c1('0x32')](_0x4def16)){return _0x4def16;}return _0x39c1('0x44');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x18f511,_0xef36e0){var _0x5280a2;var _0x2cf767;var _0x539aac;if(_0xef36e0<=0x0){_0xef36e0=0x1;}_0x5280a2=new RegExp(_0x39c1('0x45')+_0xef36e0+'}$');_0x2cf767=Math[_0x39c1('0x46')](0xa,_0xef36e0-0x1);_0x539aac=Math[_0x39c1('0x46')](0xa,_0xef36e0)-0x1;return util[_0x39c1('0x42')]('%s',_[_0x39c1('0x47')](_0x18f511,_0x5280a2,_[_0x39c1('0x48')](_0x2cf767,_0x539aac)[_0x39c1('0x49')]()));}exports[_0x39c1('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x48f555){if(_0x48f555['originated']&&_0x48f555[_0x39c1('0x28')]>0x0){_0x48f555[_0x39c1('0x28')]-=0x1;}else{logger[_0x39c1('0x4b')](_0x39c1('0x4c'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x1627bd){return _0x1627bd&&_0x1627bd['length']>0x0;}exports[_0x39c1('0x4d')]=checkContactEmpty;function erlangb(_0x282762,_0x5b9d4c){if(_0x5b9d4c===0x0){return 0x0;}var _0x1f9036=0x1;for(var _0x182667=0x1;_0x182667<=_0x5b9d4c;_0x182667+=0x1){_0x1f9036=0x1+_0x1f9036*_0x182667/_0x282762;}return 0x1/_0x1f9036;}exports[_0x39c1('0x4e')]=erlangb;function checkContactLowerLimitOriginate(_0x4d07b4,_0x415321,_0x5034c3){if(_0x415321>_0x5034c3){for(var _0x2b3bb2=0x0;_0x2b3bb2<_0x415321-_0x5034c3;_0x2b3bb2+=0x1){decrementOriginate(_0x4d07b4);}}}exports[_0x39c1('0x4f')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1d9b50){var _0x324c50={};var _0x3f55e7=['id',_0x39c1('0x50'),_0x39c1('0x51'),_0x39c1('0x52'),_0x39c1('0x53')];if(_0x1d9b50){for(var _0x54f0e2 in _0x1d9b50){if(typeof _0x1d9b50[_0x54f0e2]!==_0x39c1('0x54')){if(!_[_0x39c1('0x2e')](_0x1d9b50[_0x54f0e2])&&!_0x3f55e7[_0x39c1('0x55')](_0x54f0e2)){_0x324c50[util[_0x39c1('0x42')](_0x39c1('0x56'),_0x39c1('0x57'),_0x54f0e2[_0x39c1('0x58')]())]=_0x1d9b50[_0x54f0e2];}}}}return _0x324c50;}exports[_0x39c1('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 2e02a7e..f18d30f 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(_0xcc8e15,_0x1e6738){var _0x5430db=function(_0x1e13d4){while(--_0x1e13d4){_0xcc8e15['push'](_0xcc8e15['shift']());}};_0x5430db(++_0x1e6738);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x44ed23,_0x10932f){var _0x4db9f5=function(_0x5ba480){while(--_0x5ba480){_0x44ed23['push'](_0x44ed23['shift']());}};_0x4db9f5(++_0x10932f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 4b09a49..edc190b 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 _0x5847=['[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','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','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./channel','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','newchannel','bind','syncVarSet','syncNewState','newexten','syncFaxStatus','syncReceiveFax','originateresponse','syncNewchannel','context','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','prototype','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','.pdf','notify','parse','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','merge','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received'];(function(_0x3998bf,_0x11f831){var _0x4498c5=function(_0x322528){while(--_0x322528){_0x3998bf['push'](_0x3998bf['shift']());}};_0x4498c5(++_0x11f831);}(_0x5847,0xf5));var _0x7584=function(_0x53b1fa,_0x57faea){_0x53b1fa=_0x53b1fa-0x0;var _0x5f8e15=_0x5847[_0x53b1fa];return _0x5f8e15;};'use strict';var util=require(_0x7584('0x0'));var _=require(_0x7584('0x1'));var BPromise=require(_0x7584('0x2'));var uuid=require(_0x7584('0x3'));var moment=require(_0x7584('0x4'));var path=require(_0x7584('0x5'));var tiff2pdf=require(_0x7584('0x6'));var gs=require(_0x7584('0x7'));var logger=require(_0x7584('0x8'))(_0x7584('0x9'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x7584('0xa'));var ut=require('./util/util');var Action=require(_0x7584('0xb'));var faxAccount=require(_0x7584('0xc'));var attachment=require(_0x7584('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2864eb){this[_0x7584('0xe')]={};this[_0x7584('0xf')]=_0x2864eb[_0x7584('0xf')];this[_0x7584('0x10')]=_0x2864eb[_0x7584('0x10')];this['actions']={};ami['on'](_0x7584('0x11'),this['syncNewchannel'][_0x7584('0x12')](this));ami['on']('varset',this[_0x7584('0x13')][_0x7584('0x12')](this));ami['on']('newstate',this[_0x7584('0x14')][_0x7584('0x12')](this));ami['on'](_0x7584('0x15'),this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0x7584('0x16')][_0x7584('0x12')](this));ami['on']('receivefax',this[_0x7584('0x17')][_0x7584('0x12')](this));ami['on']('hangup',this['syncHangup'][_0x7584('0x12')](this));ami['on'](_0x7584('0x18'),this['syncOriginateResponse'][_0x7584('0x12')](this));}Fax['prototype'][_0x7584('0x19')]=function(_0x3ae2bf){if(_0x3ae2bf[_0x7584('0x1a')]==='from-voip-provider'){for(var _0x4c620f in this['faxAccounts']){if(this[_0x7584('0xf')][_0x7584('0x1b')](_0x4c620f)){if(_0x3ae2bf['exten']===this['faxAccounts'][_0x4c620f][_0x7584('0x1c')]){this[_0x7584('0xe')][_0x3ae2bf[_0x7584('0x1d')]]={};this[_0x7584('0xe')][_0x3ae2bf[_0x7584('0x1d')]]['channel']=_0x3ae2bf[_0x7584('0x1e')];this[_0x7584('0xe')][_0x3ae2bf[_0x7584('0x1d')]]['id']=this[_0x7584('0xf')][_0x4c620f]['id'];this['channels'][_0x3ae2bf[_0x7584('0x1d')]][_0x7584('0x1f')]=this['faxAccounts'][_0x4c620f][_0x7584('0x1f')];logger[_0x7584('0x20')](_0x3ae2bf[_0x7584('0x1d')],_0x7584('0x21'));}}}}if(this[_0x7584('0x22')][_0x3ae2bf[_0x7584('0x1d')]]){this[_0x7584('0xe')][_0x3ae2bf[_0x7584('0x1d')]]={};this[_0x7584('0xe')][_0x3ae2bf[_0x7584('0x1d')]][_0x7584('0x1e')]=_0x3ae2bf['channel'];logger[_0x7584('0x20')](_0x3ae2bf[_0x7584('0x1d')],_0x7584('0x21'));}};Fax['prototype'][_0x7584('0x13')]=function(_0x16416b){if(this[_0x7584('0xe')][_0x16416b[_0x7584('0x1d')]]){for(var _0x4b79c5 in _0x16416b[_0x7584('0x23')]){if(_0x16416b[_0x7584('0x23')][_0x7584('0x1b')](_0x4b79c5)){this[_0x7584('0xe')][_0x16416b[_0x7584('0x1d')]][_0x4b79c5]=_0x16416b[_0x7584('0x24')];}}}};Fax[_0x7584('0x25')][_0x7584('0x14')]=function(_0x73139b){if(this[_0x7584('0xe')][_0x73139b['uniqueid']]){this[_0x7584('0xe')][_0x73139b[_0x7584('0x1d')]][_0x7584('0x26')]=_0x73139b[_0x7584('0x26')];this[_0x7584('0xe')][_0x73139b['uniqueid']][_0x7584('0x27')]=_0x73139b[_0x7584('0x27')];}};Fax['prototype'][_0x7584('0x28')]=function(_0x539776){if(this[_0x7584('0xe')][_0x539776[_0x7584('0x1d')]]){for(var _0x1c5919 in _0x539776['variable']){if(_0x539776[_0x7584('0x23')]['hasOwnProperty'](_0x1c5919)){this[_0x7584('0xe')][_0x539776[_0x7584('0x1d')]][_0x1c5919]=_0x539776[_0x7584('0x24')];}}}};Fax[_0x7584('0x25')][_0x7584('0x16')]=function(_0x38bff3){if(this['channels'][_0x38bff3[_0x7584('0x1d')]]){this[_0x7584('0xe')][_0x38bff3['uniqueid']]['operation']=_0x38bff3[_0x7584('0x29')];this[_0x7584('0xe')][_0x38bff3[_0x7584('0x1d')]][_0x7584('0x2a')]=_0x38bff3['status'];this['channels'][_0x38bff3[_0x7584('0x1d')]][_0x7584('0x1c')]=_0x38bff3[_0x7584('0x1c')];this[_0x7584('0xe')][_0x38bff3[_0x7584('0x1d')]][_0x7584('0x2b')]=_0x38bff3[_0x7584('0x2b')];logger['info'](_0x38bff3['uniqueid'],_0x7584('0x2c'));}};Fax[_0x7584('0x25')][_0x7584('0x17')]=function(_0x5cb8dd){var _0xc323e6=this;if(this[_0x7584('0xe')][_0x5cb8dd['uniqueid']]){var _0x26c9d0=this[_0x7584('0xe')][_0x5cb8dd['uniqueid']]['id'];this[_0x7584('0xe')][_0x5cb8dd[_0x7584('0x1d')]][_0x7584('0x2d')]=_0x5cb8dd[_0x7584('0x2d')];this[_0x7584('0xe')][_0x5cb8dd[_0x7584('0x1d')]][_0x7584('0x2e')]=_0x5cb8dd[_0x7584('0x2e')];this['channels'][_0x5cb8dd[_0x7584('0x1d')]][_0x7584('0x1c')]=_0x5cb8dd[_0x7584('0x1c')];this[_0x7584('0xe')][_0x5cb8dd['uniqueid']]['resolution']=_0x5cb8dd[_0x7584('0x2f')];this[_0x7584('0xe')][_0x5cb8dd[_0x7584('0x1d')]][_0x7584('0x30')]=_0x5cb8dd[_0x7584('0x30')];this[_0x7584('0xe')][_0x5cb8dd[_0x7584('0x1d')]][_0x7584('0x2b')]=_0x5cb8dd[_0x7584('0x2b')];this[_0x7584('0xe')][_0x5cb8dd[_0x7584('0x1d')]][_0x7584('0x31')]=_0x5cb8dd[_0x7584('0x31')];if(this[_0x7584('0xe')][_0x5cb8dd[_0x7584('0x1d')]]['pagestransferred']>0x0){tiff2pdf(_0x5cb8dd[_0x7584('0x2b')],'/var/opt/motion2/server/files/attachments/',function(_0x2171f2){logger[_0x7584('0x20')](_0x5cb8dd[_0x7584('0x1d')],_0x7584('0x32'),_0x2171f2[_0x7584('0x33')]);attachment[_0x7584('0x34')]({'name':path['parse'](_0x5cb8dd[_0x7584('0x2b')])[_0x7584('0x1f')],'basename':path['parse'](_0x5cb8dd[_0x7584('0x2b')])[_0x7584('0x1f')]+_0x7584('0x35'),'type':'application/pdf'})['then'](function(_0x2e734c){faxAccount[_0x7584('0x36')](_0x26c9d0,{'from':_0x5cb8dd[_0x7584('0x31')],'mapKey':_0x7584('0x9'),'body':path[_0x7584('0x37')](_0x5cb8dd[_0x7584('0x2b')])[_0x7584('0x1f')]+_0x7584('0x35'),'AttachmentId':_0x2e734c['id']})['catch'](function(_0x5cc10d){logger[_0x7584('0x38')](_0x5cb8dd[_0x7584('0x1d')],_0x7584('0x39'),JSON['stringify'](_0x5cc10d));});})[_0x7584('0x3a')](function(_0x181719){logger[_0x7584('0x38')](_0x5cb8dd[_0x7584('0x1d')],_0x7584('0x3b'),JSON[_0x7584('0x3c')](_0x181719));});});}logger[_0x7584('0x20')](_0x5cb8dd['uniqueid'],_0x7584('0x3b'));}};Fax[_0x7584('0x25')]['syncOriginateResponse']=function(_0x1d1868){if(this['actions'][_0x1d1868['uniqueid']]){_[_0x7584('0x3d')](this[_0x7584('0xe')][_0x1d1868['uniqueid']],_['pick'](_0x1d1868,['response',_0x7584('0x3e')]));}};function updateStatus(_0x4524b8){if(_0x4524b8[_0x7584('0x3f')]){faxMessage[_0x7584('0x40')](_0x4524b8[_0x7584('0x3f')],{'failMessage':_0x7584('0x41')})[_0x7584('0x42')](function(_0x3990a0){ut[_0x7584('0x43')](_0x7584('0x44'),_0x3990a0);})[_0x7584('0x3a')](function(_0x450a71){ut[_0x7584('0x43')](_0x7584('0x45'),_0x450a71);});}else{ut[_0x7584('0x43')](_0x7584('0x46'));}}Fax['prototype'][_0x7584('0x47')]=function(_0x38e4ca,_0x3b5daa,_0x77355d){var _0x1a56ec=this;var _0x511f9b={};if(_0x3b5daa){_0x511f9b={'read':_0x3b5daa};}else{_0x511f9b={'failMessage':_0x77355d};}if(this['actions'][_0x38e4ca][_0x7584('0x3f')]){faxMessage[_0x7584('0x40')](this[_0x7584('0x22')][_0x38e4ca][_0x7584('0x3f')],_0x511f9b)[_0x7584('0x42')](function(_0x1feb1b){ut[_0x7584('0x43')]('[Fax][Message][Updated]',_0x1feb1b);})[_0x7584('0x3a')](function(_0x2e8e0c){ut[_0x7584('0x43')](_0x7584('0x48'),_0x2e8e0c);})[_0x7584('0x49')](function(){delete _0x1a56ec['channels'][_0x38e4ca];delete _0x1a56ec[_0x7584('0x22')][_0x38e4ca];});}else{ut[_0x7584('0x43')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x38e4ca];delete this[_0x7584('0x22')][_0x38e4ca];}};Fax[_0x7584('0x25')]['syncHangup']=function(_0x45635a){var _0x2d5070=this;if(this[_0x7584('0xe')][_0x45635a[_0x7584('0x1d')]]){if(this[_0x7584('0x22')][_0x45635a[_0x7584('0x1d')]]){this['channels'][_0x45635a[_0x7584('0x1d')]]['id']=this[_0x7584('0x22')][_0x45635a[_0x7584('0x1d')]]['id'];this[_0x7584('0xe')][_0x45635a[_0x7584('0x1d')]][_0x7584('0x1f')]=this['actions'][_0x45635a[_0x7584('0x1d')]][_0x7584('0x1f')];}logger['info'](_0x45635a[_0x7584('0x1d')],this[_0x7584('0x22')][_0x45635a[_0x7584('0x1d')]]?_0x7584('0x4a'):_0x7584('0x4b'),JSON[_0x7584('0x3c')](this[_0x7584('0xe')][_0x45635a[_0x7584('0x1d')]]));if(this['actions'][_0x45635a[_0x7584('0x1d')]]){if(this[_0x7584('0xe')][_0x45635a[_0x7584('0x1d')]][_0x7584('0x4c')]>0x0&&this['channels'][_0x45635a[_0x7584('0x1d')]][_0x7584('0x4d')]==='SUCCESS'){this[_0x7584('0x47')](_0x45635a[_0x7584('0x1d')],!![]);}else{this[_0x7584('0x47')](_0x45635a[_0x7584('0x1d')],![],this['channels'][_0x45635a[_0x7584('0x1d')]][_0x7584('0x4e')]?_0x7584('0x4f')+this[_0x7584('0xe')][_0x45635a[_0x7584('0x1d')]][_0x7584('0x4e')]:'SENDING\x20FAILED');}}}};Fax[_0x7584('0x25')][_0x7584('0x50')]=function(_0x51fc0a){var _0x1f012e=this;return new BPromise(function(_0x4a0854,_0x1649a5){_0x1f012e[_0x7584('0x51')](_0x51fc0a,_0x1f012e[_0x7584('0xf')][_0x51fc0a[_0x7584('0x52')]])[_0x7584('0x42')](function(_0x53ef12){ut[_0x7584('0x43')](_0x7584('0x53'),_0x53ef12);_0x4a0854(ut[_0x7584('0x33')](_0x7584('0x54')));})[_0x7584('0x3a')](function(_0x5af852){ut[_0x7584('0x43')](_0x7584('0x55'),_0x5af852);updateStatus(_0x51fc0a);_0x1649a5(ut['message'](_0x7584('0x56')));});});};Fax[_0x7584('0x25')][_0x7584('0x57')]=function(_0x50201d){var _0x318553=this;return new BPromise(function(_0x5b57de,_0x5dd328){var _0x2c9c4b=_0x318553[_0x7584('0x58')](_0x318553[_0x7584('0xf')][_0x50201d[_0x7584('0x52')]]['Trunk'],_0x50201d);if(_0x2c9c4b['isValid']){_0x5b57de(ut[_0x7584('0x33')]('Trunk\x20Reachable'));}else{_0x5dd328(ut[_0x7584('0x33')](_0x2c9c4b[_0x7584('0x33')]));}});};function originate(_0x4dc8c2,_0x8566d,_0x375031){return new BPromise(function(_0x5d54b0,_0x2a82c9){if(_0x375031){var _0x2e4fdf=util[_0x7584('0x59')](_0x7584('0x5a'),path[_0x7584('0x37')](_0x4dc8c2[_0x7584('0x5')])[_0x7584('0x1f')],_0x4dc8c2[_0x7584('0x5')]);gs[_0x7584('0x5b')](_0x2e4fdf)['then'](function(){_0x4dc8c2[_0x7584('0x5')]=util[_0x7584('0x59')](_0x7584('0x5c'),path['parse'](_0x4dc8c2[_0x7584('0x5')])[_0x7584('0x5d')],path['parse'](_0x4dc8c2[_0x7584('0x5')])[_0x7584('0x1f')]);_0x8566d[_0x7584('0x5e')]=_0x4dc8c2[_0x7584('0x5')];ut[_0x7584('0x43')]('Convert\x20pdf\x20to\x20tif','');ami[_0x7584('0x5f')](ut[_0x7584('0x60')](_0x4dc8c2,_0x8566d))[_0x7584('0x42')](function(_0x54f342){_0x5d54b0(_0x54f342);})['catch'](function(_0x20e3e5){_0x2a82c9(_0x20e3e5);});})[_0x7584('0x3a')](function(_0x1a5665){_0x2a82c9(_0x1a5665);});}else{ami[_0x7584('0x5f')](ut[_0x7584('0x60')](_0x4dc8c2,_0x8566d))[_0x7584('0x42')](function(_0x4fd3c6){_0x5d54b0(_0x4fd3c6);})[_0x7584('0x3a')](function(_0x1c63e3){_0x2a82c9(_0x1c63e3);});}});}Fax[_0x7584('0x25')]['execOriginate']=function(_0x12429d,_0x3f57a8){var _0x4651a6=this;return new BPromise(function(_0x52779d,_0x569fc3){var _0x2e5b2b=uuid['v4']();var _0x1ccb59=ut[_0x7584('0x61')](_0x12429d,_0x3f57a8);_0x4651a6[_0x7584('0x22')][_0x2e5b2b]=new Action(_0x2e5b2b,_0x3f57a8,_0x12429d);var _0x1d53f7=_0x4651a6[_0x7584('0x22')][_0x2e5b2b];if(path['parse'](_0x12429d[_0x7584('0x5')])[_0x7584('0x62')]===_0x7584('0x35')){originate(_0x1d53f7,_0x1ccb59,!![])[_0x7584('0x42')](function(_0x304bce){_0x52779d(_0x304bce);})[_0x7584('0x3a')](function(_0x1b8fc1){_0x569fc3(_0x1b8fc1);});}else{originate(_0x1d53f7,_0x1ccb59,![])['then'](function(_0x5187cd){_0x52779d(_0x5187cd);})[_0x7584('0x3a')](function(_0x4374ee){_0x569fc3(_0x4374ee);});}});};Fax[_0x7584('0x25')][_0x7584('0x63')]=function(_0x502598){return!_[_0x7584('0x64')](_0x502598)&&!_[_0x7584('0x64')](_0x502598['name'])&&!_[_0x7584('0x64')](_0x502598[_0x7584('0x65')])&&_0x502598[_0x7584('0x65')]&&!_['isNil'](this['trunks'][util[_0x7584('0x59')](_0x7584('0x66'),_0x502598['name'])])&&!_['isNil'](this[_0x7584('0x10')][util[_0x7584('0x59')](_0x7584('0x66'),_0x502598[_0x7584('0x1f')])]['status'])&&(this['trunks'][util[_0x7584('0x59')](_0x7584('0x66'),_0x502598['name'])][_0x7584('0x2a')]===_0x7584('0x67')||this[_0x7584('0x10')][util[_0x7584('0x59')](_0x7584('0x66'),_0x502598[_0x7584('0x1f')])][_0x7584('0x2a')]===_0x7584('0x68'));};Fax[_0x7584('0x25')]['checkTrunk']=function(_0x5695d8,_0xf9b129){if(!this[_0x7584('0x63')](_0x5695d8)){ut[_0x7584('0x43')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x7584('0x64')](_0x5695d8)?'':_0x5695d8['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x7584('0x69')};}if(_[_0x7584('0x64')](_0xf9b129[_0x7584('0x9')])){ut[_0x7584('0x43')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x7584('0x3c')](_0xf9b129));return{'isValid':![],'message':_0x7584('0x6a')};}if(_[_0x7584('0x64')](_0xf9b129[_0x7584('0x5')])){ut[_0x7584('0x43')](_0x7584('0x6b'),JSON[_0x7584('0x3c')](_0xf9b129));return{'isValid':![],'message':_0x7584('0x6c')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x7584('0x6d')]=Fax; \ No newline at end of file +var _0x8c80=['Fax\x20failed','checkAfterSend','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','path','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channels','channel','info','\x20syncNewchannel\x20','variable','hasOwnProperty','syncNewState','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]'];(function(_0xb2d5e0,_0x376535){var _0x244aab=function(_0xd632ef){while(--_0xd632ef){_0xb2d5e0['push'](_0xb2d5e0['shift']());}};_0x244aab(++_0x376535);}(_0x8c80,0x97));var _0x08c8=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0x8c80[_0x3816c2];return _0x144669;};'use strict';var util=require(_0x08c8('0x0'));var _=require('lodash');var BPromise=require(_0x08c8('0x1'));var uuid=require(_0x08c8('0x2'));var moment=require(_0x08c8('0x3'));var path=require('path');var tiff2pdf=require(_0x08c8('0x4'));var gs=require(_0x08c8('0x5'));var logger=require(_0x08c8('0x6'))(_0x08c8('0x7'));var ami=require(_0x08c8('0x8'));var rpcDb=require(_0x08c8('0x9'));var Channel=require(_0x08c8('0xa'));var ut=require(_0x08c8('0xb'));var Action=require(_0x08c8('0xc'));var faxAccount=require(_0x08c8('0xd'));var attachment=require(_0x08c8('0xe'));var faxMessage=require(_0x08c8('0xf'));function Fax(_0x42d8c9){this['channels']={};this[_0x08c8('0x10')]=_0x42d8c9['faxAccounts'];this[_0x08c8('0x11')]=_0x42d8c9['trunks'];this[_0x08c8('0x12')]={};ami['on'](_0x08c8('0x13'),this[_0x08c8('0x14')]['bind'](this));ami['on'](_0x08c8('0x15'),this[_0x08c8('0x16')][_0x08c8('0x17')](this));ami['on'](_0x08c8('0x18'),this['syncNewState'][_0x08c8('0x17')](this));ami['on']('newexten',this[_0x08c8('0x19')]['bind'](this));ami['on'](_0x08c8('0x1a'),this[_0x08c8('0x1b')][_0x08c8('0x17')](this));ami['on'](_0x08c8('0x1c'),this[_0x08c8('0x1d')][_0x08c8('0x17')](this));ami['on'](_0x08c8('0x1e'),this[_0x08c8('0x1f')][_0x08c8('0x17')](this));ami['on']('originateresponse',this[_0x08c8('0x20')][_0x08c8('0x17')](this));}Fax[_0x08c8('0x21')][_0x08c8('0x14')]=function(_0x20402a){if(_0x20402a[_0x08c8('0x22')]===_0x08c8('0x23')){for(var _0x4c86c5 in this['faxAccounts']){if(this['faxAccounts']['hasOwnProperty'](_0x4c86c5)){if(_0x20402a[_0x08c8('0x24')]===this[_0x08c8('0x10')][_0x4c86c5][_0x08c8('0x25')]){this['channels'][_0x20402a[_0x08c8('0x26')]]={};this[_0x08c8('0x27')][_0x20402a['uniqueid']]['channel']=_0x20402a[_0x08c8('0x28')];this[_0x08c8('0x27')][_0x20402a[_0x08c8('0x26')]]['id']=this['faxAccounts'][_0x4c86c5]['id'];this[_0x08c8('0x27')][_0x20402a[_0x08c8('0x26')]]['name']=this[_0x08c8('0x10')][_0x4c86c5]['name'];logger[_0x08c8('0x29')](_0x20402a[_0x08c8('0x26')],'\x20syncNewchannel\x20');}}}}if(this[_0x08c8('0x12')][_0x20402a[_0x08c8('0x26')]]){this[_0x08c8('0x27')][_0x20402a[_0x08c8('0x26')]]={};this[_0x08c8('0x27')][_0x20402a[_0x08c8('0x26')]][_0x08c8('0x28')]=_0x20402a[_0x08c8('0x28')];logger[_0x08c8('0x29')](_0x20402a[_0x08c8('0x26')],_0x08c8('0x2a'));}};Fax[_0x08c8('0x21')][_0x08c8('0x16')]=function(_0x3556c7){if(this['channels'][_0x3556c7[_0x08c8('0x26')]]){for(var _0x3bad6a in _0x3556c7[_0x08c8('0x2b')]){if(_0x3556c7[_0x08c8('0x2b')][_0x08c8('0x2c')](_0x3bad6a)){this['channels'][_0x3556c7[_0x08c8('0x26')]][_0x3bad6a]=_0x3556c7['value'];}}}};Fax['prototype'][_0x08c8('0x2d')]=function(_0x5f1f34){if(this[_0x08c8('0x27')][_0x5f1f34[_0x08c8('0x26')]]){this['channels'][_0x5f1f34['uniqueid']][_0x08c8('0x2e')]=_0x5f1f34[_0x08c8('0x2e')];this[_0x08c8('0x27')][_0x5f1f34[_0x08c8('0x26')]][_0x08c8('0x2f')]=_0x5f1f34[_0x08c8('0x2f')];}};Fax[_0x08c8('0x21')][_0x08c8('0x19')]=function(_0x3fe395){if(this[_0x08c8('0x27')][_0x3fe395['uniqueid']]){for(var _0x1b5f5f in _0x3fe395[_0x08c8('0x2b')]){if(_0x3fe395['variable'][_0x08c8('0x2c')](_0x1b5f5f)){this[_0x08c8('0x27')][_0x3fe395[_0x08c8('0x26')]][_0x1b5f5f]=_0x3fe395[_0x08c8('0x30')];}}}};Fax[_0x08c8('0x21')][_0x08c8('0x1b')]=function(_0x39a6bb){if(this['channels'][_0x39a6bb[_0x08c8('0x26')]]){this[_0x08c8('0x27')][_0x39a6bb[_0x08c8('0x26')]][_0x08c8('0x31')]=_0x39a6bb[_0x08c8('0x31')];this['channels'][_0x39a6bb['uniqueid']][_0x08c8('0x32')]=_0x39a6bb['status'];this['channels'][_0x39a6bb[_0x08c8('0x26')]]['localstationid']=_0x39a6bb[_0x08c8('0x25')];this['channels'][_0x39a6bb[_0x08c8('0x26')]][_0x08c8('0x33')]=_0x39a6bb[_0x08c8('0x33')];logger['info'](_0x39a6bb[_0x08c8('0x26')],_0x08c8('0x34'));}};Fax['prototype'][_0x08c8('0x1d')]=function(_0x51a039){var _0x10048e=this;if(this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]]){var _0x1bbc80=this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]]['id'];this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]][_0x08c8('0x35')]=_0x51a039[_0x08c8('0x35')];this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]][_0x08c8('0x36')]=_0x51a039[_0x08c8('0x36')];this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]]['localstationid']=_0x51a039[_0x08c8('0x25')];this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]][_0x08c8('0x37')]=_0x51a039[_0x08c8('0x37')];this['channels'][_0x51a039[_0x08c8('0x26')]][_0x08c8('0x38')]=_0x51a039[_0x08c8('0x38')];this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]][_0x08c8('0x33')]=_0x51a039[_0x08c8('0x33')];this[_0x08c8('0x27')][_0x51a039[_0x08c8('0x26')]][_0x08c8('0x39')]=_0x51a039[_0x08c8('0x39')];if(this['channels'][_0x51a039[_0x08c8('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0x51a039[_0x08c8('0x33')],_0x08c8('0x3a'),function(_0x352352){logger[_0x08c8('0x29')](_0x51a039['uniqueid'],_0x08c8('0x3b'),_0x352352[_0x08c8('0x3c')]);attachment[_0x08c8('0x3d')]({'name':path[_0x08c8('0x3e')](_0x51a039['filename'])[_0x08c8('0x3f')],'basename':path[_0x08c8('0x3e')](_0x51a039[_0x08c8('0x33')])[_0x08c8('0x3f')]+_0x08c8('0x40'),'type':_0x08c8('0x41')})[_0x08c8('0x42')](function(_0x3eca48){faxAccount[_0x08c8('0x43')](_0x1bbc80,{'from':_0x51a039[_0x08c8('0x39')],'mapKey':'fax','body':path[_0x08c8('0x3e')](_0x51a039[_0x08c8('0x33')])[_0x08c8('0x3f')]+'.pdf','AttachmentId':_0x3eca48['id']})[_0x08c8('0x44')](function(_0x1510f1){logger['error'](_0x51a039[_0x08c8('0x26')],_0x08c8('0x45'),JSON[_0x08c8('0x46')](_0x1510f1));});})[_0x08c8('0x44')](function(_0x4ebc44){logger[_0x08c8('0x47')](_0x51a039[_0x08c8('0x26')],_0x08c8('0x48'),JSON['stringify'](_0x4ebc44));});});}logger['info'](_0x51a039[_0x08c8('0x26')],_0x08c8('0x48'));}};Fax[_0x08c8('0x21')]['syncOriginateResponse']=function(_0xce7517){if(this[_0x08c8('0x12')][_0xce7517['uniqueid']]){_[_0x08c8('0x49')](this[_0x08c8('0x27')][_0xce7517['uniqueid']],_[_0x08c8('0x4a')](_0xce7517,['response',_0x08c8('0x4b')]));}};function updateStatus(_0x384f1a){if(_0x384f1a[_0x08c8('0x4c')]){faxMessage['update'](_0x384f1a[_0x08c8('0x4c')],{'failMessage':_0x08c8('0x4d')})[_0x08c8('0x42')](function(_0x187562){ut['logger'](_0x08c8('0x4e'),_0x187562);})[_0x08c8('0x44')](function(_0x53aad2){ut['logger'](_0x08c8('0x4f'),_0x53aad2);});}else{ut[_0x08c8('0x50')](_0x08c8('0x51'));}}Fax['prototype'][_0x08c8('0x52')]=function(_0xaef7d2,_0x12b097,_0x43c145){var _0x4d2156=this;var _0x298867={};if(_0x12b097){_0x298867={'read':_0x12b097};}else{_0x298867={'failMessage':_0x43c145};}if(this[_0x08c8('0x12')][_0xaef7d2][_0x08c8('0x4c')]){faxMessage[_0x08c8('0x53')](this[_0x08c8('0x12')][_0xaef7d2][_0x08c8('0x4c')],_0x298867)[_0x08c8('0x42')](function(_0x2fccf8){ut[_0x08c8('0x50')](_0x08c8('0x54'),_0x2fccf8);})[_0x08c8('0x44')](function(_0x13364b){ut[_0x08c8('0x50')](_0x08c8('0x55'),_0x13364b);})[_0x08c8('0x56')](function(){delete _0x4d2156[_0x08c8('0x27')][_0xaef7d2];delete _0x4d2156[_0x08c8('0x12')][_0xaef7d2];});}else{ut['logger'](_0x08c8('0x57'));delete this[_0x08c8('0x27')][_0xaef7d2];delete this[_0x08c8('0x12')][_0xaef7d2];}};Fax[_0x08c8('0x21')][_0x08c8('0x1f')]=function(_0x541451){var _0xf478ae=this;if(this[_0x08c8('0x27')][_0x541451[_0x08c8('0x26')]]){if(this['actions'][_0x541451['uniqueid']]){this['channels'][_0x541451[_0x08c8('0x26')]]['id']=this[_0x08c8('0x12')][_0x541451[_0x08c8('0x26')]]['id'];this[_0x08c8('0x27')][_0x541451[_0x08c8('0x26')]][_0x08c8('0x3f')]=this[_0x08c8('0x12')][_0x541451[_0x08c8('0x26')]]['name'];}logger[_0x08c8('0x29')](_0x541451[_0x08c8('0x26')],this['actions'][_0x541451[_0x08c8('0x26')]]?_0x08c8('0x58'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x08c8('0x27')][_0x541451[_0x08c8('0x26')]]));if(this[_0x08c8('0x12')][_0x541451[_0x08c8('0x26')]]){if(this['channels'][_0x541451['uniqueid']]['faxpages']>0x0&&this[_0x08c8('0x27')][_0x541451[_0x08c8('0x26')]]['faxstatus']===_0x08c8('0x59')){this[_0x08c8('0x52')](_0x541451[_0x08c8('0x26')],!![]);}else{this[_0x08c8('0x52')](_0x541451[_0x08c8('0x26')],![],this[_0x08c8('0x27')][_0x541451[_0x08c8('0x26')]][_0x08c8('0x5a')]?_0x08c8('0x5b')+this['channels'][_0x541451[_0x08c8('0x26')]][_0x08c8('0x5a')]:_0x08c8('0x5c'));}}}};Fax['prototype'][_0x08c8('0x5d')]=function(_0x5b2d5c){var _0x13e26d=this;return new BPromise(function(_0x586996,_0x3b359e){_0x13e26d[_0x08c8('0x5e')](_0x5b2d5c,_0x13e26d[_0x08c8('0x10')][_0x5b2d5c[_0x08c8('0x5f')]])['then'](function(_0x4fbe3e){ut[_0x08c8('0x50')](_0x08c8('0x60'),_0x4fbe3e);_0x586996(ut[_0x08c8('0x3c')](_0x08c8('0x61')));})['catch'](function(_0x459a42){ut['logger'](_0x08c8('0x62'),_0x459a42);updateStatus(_0x5b2d5c);_0x3b359e(ut[_0x08c8('0x3c')](_0x08c8('0x63')));});});};Fax[_0x08c8('0x21')][_0x08c8('0x64')]=function(_0x35c83c){var _0x3c1761=this;return new BPromise(function(_0x344410,_0x151001){var _0x48d704=_0x3c1761[_0x08c8('0x65')](_0x3c1761[_0x08c8('0x10')][_0x35c83c[_0x08c8('0x5f')]]['Trunk'],_0x35c83c);if(_0x48d704[_0x08c8('0x66')]){_0x344410(ut['message'](_0x08c8('0x67')));}else{_0x151001(ut[_0x08c8('0x3c')](_0x48d704[_0x08c8('0x3c')]));}});};function originate(_0x330edd,_0x311a81,_0x38baf3){return new BPromise(function(_0x81957,_0x32f259){if(_0x38baf3){var _0x1d2841=util[_0x08c8('0x68')](_0x08c8('0x69'),path[_0x08c8('0x3e')](_0x330edd['path'])[_0x08c8('0x3f')],_0x330edd[_0x08c8('0x6a')]);gs[_0x08c8('0x6b')](_0x1d2841)[_0x08c8('0x42')](function(){_0x330edd[_0x08c8('0x6a')]=util[_0x08c8('0x68')](_0x08c8('0x6c'),path[_0x08c8('0x3e')](_0x330edd[_0x08c8('0x6a')])[_0x08c8('0x6d')],path[_0x08c8('0x3e')](_0x330edd['path'])[_0x08c8('0x3f')]);_0x311a81[_0x08c8('0x6e')]=_0x330edd[_0x08c8('0x6a')];ut[_0x08c8('0x50')]('Convert\x20pdf\x20to\x20tif','');ami[_0x08c8('0x6f')](ut[_0x08c8('0x70')](_0x330edd,_0x311a81))[_0x08c8('0x42')](function(_0x538a7b){_0x81957(_0x538a7b);})[_0x08c8('0x44')](function(_0x1afffc){_0x32f259(_0x1afffc);});})[_0x08c8('0x44')](function(_0xc6b772){_0x32f259(_0xc6b772);});}else{ami[_0x08c8('0x6f')](ut[_0x08c8('0x70')](_0x330edd,_0x311a81))[_0x08c8('0x42')](function(_0x496daa){_0x81957(_0x496daa);})['catch'](function(_0x4dc153){_0x32f259(_0x4dc153);});}});}Fax['prototype'][_0x08c8('0x5e')]=function(_0x29a543,_0x314d63){var _0xe94f17=this;return new BPromise(function(_0x310853,_0x508ab1){var _0x5c73f9=uuid['v4']();var _0x37e3e2=ut[_0x08c8('0x71')](_0x29a543,_0x314d63);_0xe94f17['actions'][_0x5c73f9]=new Action(_0x5c73f9,_0x314d63,_0x29a543);var _0x3e7018=_0xe94f17[_0x08c8('0x12')][_0x5c73f9];if(path[_0x08c8('0x3e')](_0x29a543['path'])[_0x08c8('0x72')]===_0x08c8('0x40')){originate(_0x3e7018,_0x37e3e2,!![])[_0x08c8('0x42')](function(_0x59907b){_0x310853(_0x59907b);})['catch'](function(_0x53e68c){_0x508ab1(_0x53e68c);});}else{originate(_0x3e7018,_0x37e3e2,![])[_0x08c8('0x42')](function(_0x73695){_0x310853(_0x73695);})['catch'](function(_0x3cb35d){_0x508ab1(_0x3cb35d);});}});};Fax[_0x08c8('0x21')]['isTrunkReachable']=function(_0x4df124){return!_[_0x08c8('0x73')](_0x4df124)&&!_[_0x08c8('0x73')](_0x4df124[_0x08c8('0x3f')])&&!_['isNil'](_0x4df124['active'])&&_0x4df124[_0x08c8('0x74')]&&!_['isNil'](this[_0x08c8('0x11')][util[_0x08c8('0x68')](_0x08c8('0x75'),_0x4df124[_0x08c8('0x3f')])])&&!_['isNil'](this['trunks'][util[_0x08c8('0x68')]('SIP/%s',_0x4df124[_0x08c8('0x3f')])][_0x08c8('0x32')])&&(this[_0x08c8('0x11')][util['format'](_0x08c8('0x75'),_0x4df124[_0x08c8('0x3f')])][_0x08c8('0x32')]===_0x08c8('0x76')||this['trunks'][util[_0x08c8('0x68')]('SIP/%s',_0x4df124[_0x08c8('0x3f')])][_0x08c8('0x32')]==='unmonitored');};Fax['prototype'][_0x08c8('0x65')]=function(_0x39a538,_0x47fc48){if(!this[_0x08c8('0x77')](_0x39a538)){ut[_0x08c8('0x50')](_0x08c8('0x78'),_[_0x08c8('0x73')](_0x39a538)?'':_0x39a538[_0x08c8('0x3f')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x08c8('0x79')};}if(_[_0x08c8('0x73')](_0x47fc48[_0x08c8('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x47fc48));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x08c8('0x73')](_0x47fc48[_0x08c8('0x6a')])){ut['logger'](_0x08c8('0x7a'),JSON[_0x08c8('0x46')](_0x47fc48));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x08c8('0x7b')};};module[_0x08c8('0x7c')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 25df0c5..aedce8d 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 _0x80d5=['preview','lodash','../rpc/faxAccount','notify','resolve','then','catch','[Notify]\x20','util','../../../config/logger'];(function(_0x1c12bd,_0x348360){var _0x1de620=function(_0x2ab4d5){while(--_0x2ab4d5){_0x1c12bd['push'](_0x1c12bd['shift']());}};_0x1de620(++_0x348360);}(_0x80d5,0xf8));var _0x580d=function(_0x30aaa9,_0x5152f9){_0x30aaa9=_0x30aaa9-0x0;var _0x29165a=_0x80d5[_0x30aaa9];return _0x29165a;};'use strict';var util=require(_0x580d('0x0'));var BPromise=require('bluebird');var logger=require(_0x580d('0x1'))(_0x580d('0x2'));var _=require(_0x580d('0x3'));var faxAccount=require(_0x580d('0x4'));function loggerCatch(_0x39d091){return function(_0x164bc3){logger['error'](_0x39d091,util['inspect'](_0x164bc3,{'showHidden':![],'depth':null}));};}exports[_0x580d('0x5')]=function(_0x2a52ee,_0x4d2138){return BPromise[_0x580d('0x6')]()[_0x580d('0x7')](faxAccount[_0x580d('0x5')](_0x2a52ee,_0x4d2138))[_0x580d('0x8')](loggerCatch(_0x580d('0x9')));}; \ No newline at end of file +var _0x9e03=['[Notify]\x20','util','bluebird','../../../config/logger','preview','error','resolve','then','notify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e03,0x1a8));var _0x39e0=function(_0x565709,_0x432554){_0x565709=_0x565709-0x0;var _0x41b2f6=_0x9e03[_0x565709];return _0x41b2f6;};'use strict';var util=require(_0x39e0('0x0'));var BPromise=require(_0x39e0('0x1'));var logger=require(_0x39e0('0x2'))(_0x39e0('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x587dd1){return function(_0x4b4bee){logger[_0x39e0('0x4')](_0x587dd1,util['inspect'](_0x4b4bee,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x53c914,_0x4f8263){return BPromise[_0x39e0('0x5')]()[_0x39e0('0x6')](faxAccount[_0x39e0('0x7')](_0x53c914,_0x4f8263))['catch'](loggerCatch(_0x39e0('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 50337e7..d39cd00 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 _0xa5da=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x2d69f2,_0x25a92b){var _0x84d778=function(_0x483838){while(--_0x483838){_0x2d69f2['push'](_0x2d69f2['shift']());}};_0x84d778(++_0x25a92b);}(_0xa5da,0x11a));var _0xaa5d=function(_0x431750,_0x4f5d0b){_0x431750=_0x431750-0x0;var _0x4ee35a=_0xa5da[_0x431750];return _0x4ee35a;};'use strict';var util=require(_0xaa5d('0x0'));var logger=require(_0xaa5d('0x1'))(_0xaa5d('0x2'));var BPromise=require(_0xaa5d('0x3'));var exec=require(_0xaa5d('0x4'))[_0xaa5d('0x5')];exports[_0xaa5d('0x6')]=function(_0x4af206){return new BPromise(function(_0x370b9d,_0x105b25){exec(_0x4af206,function(_0x2423c4,_0x16e9d7,_0x3a9862){logger[_0xaa5d('0x7')](_0xaa5d('0x8'),_0x16e9d7);if(_0x2423c4){logger[_0xaa5d('0x7')](_0xaa5d('0x8'),_0xaa5d('0x9'),util[_0xaa5d('0xa')](_0x2423c4,{'showHidden':![],'depth':null}),_0x16e9d7,_0x3a9862);_0x105b25(_0x2423c4);}_0x370b9d(_0x16e9d7);});});}; \ No newline at end of file +var _0xdf42=['info','Exec\x20gs','\x20Error\x20:','inspect','util','fax','bluebird','execute'];(function(_0x4f6009,_0x292385){var _0x391fdd=function(_0x4b52ef){while(--_0x4b52ef){_0x4f6009['push'](_0x4f6009['shift']());}};_0x391fdd(++_0x292385);}(_0xdf42,0xcc));var _0x2df4=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xdf42[_0x126558];return _0x1f6d14;};'use strict';var util=require(_0x2df4('0x0'));var logger=require('../../../../config/logger')(_0x2df4('0x1'));var BPromise=require(_0x2df4('0x2'));var exec=require('child_process')['exec'];exports[_0x2df4('0x3')]=function(_0x14ae8d){return new BPromise(function(_0x23b062,_0x790d7e){exec(_0x14ae8d,function(_0x3e8ee9,_0x4aa376,_0x115459){logger[_0x2df4('0x4')](_0x2df4('0x5'),_0x4aa376);if(_0x3e8ee9){logger[_0x2df4('0x4')](_0x2df4('0x5'),_0x2df4('0x6'),util[_0x2df4('0x7')](_0x3e8ee9,{'showHidden':![],'depth':null}),_0x4aa376,_0x115459);_0x790d7e(_0x3e8ee9);}_0x23b062(_0x4aa376);});});}; \ 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 cb937a9..d8aec15 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 _0x7c04=['util','moment','../../../../config/logger','fax','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','\x22%s\x22\x20<%s>'];(function(_0x4d44c9,_0x399f24){var _0x14e7ac=function(_0x3e6a49){while(--_0x3e6a49){_0x4d44c9['push'](_0x4d44c9['shift']());}};_0x14e7ac(++_0x399f24);}(_0x7c04,0xc0));var _0x47c0=function(_0x32a89d,_0x5343e5){_0x32a89d=_0x32a89d-0x0;var _0x439cb7=_0x7c04[_0x32a89d];return _0x439cb7;};'use strict';var util=require(_0x47c0('0x0'));var _=require('lodash');var moment=require(_0x47c0('0x1'));var logger=require(_0x47c0('0x2'))(_0x47c0('0x3'));exports['message']=function(_0x40dd30){return{'message':_0x40dd30};};exports[_0x47c0('0x4')]=function(_0x16eca1,_0xd54bcb){logger[_0x47c0('0x5')](_0x16eca1,util[_0x47c0('0x6')](_0xd54bcb,{'showHidden':![],'depth':null}));};exports[_0x47c0('0x7')]=function(_0x5b18ec,_0x3957a9){var _0x206719={'XMF-ECM':_0x3957a9[_0x47c0('0x8')],'XMF-HEADERINFO':_0x3957a9[_0x47c0('0x9')],'XMF-MINRATE':_0x3957a9[_0x47c0('0xa')],'XMF-MAXRATE':_0x3957a9[_0x47c0('0xb')],'XMF-MODEM':util[_0x47c0('0xc')]('\x22%s\x22',_0x3957a9[_0x47c0('0xd')]),'XMF-GATEWAY':_0x3957a9[_0x47c0('0xe')],'XMF-FAXDETECT':_0x3957a9[_0x47c0('0xf')],'XMF-T38TIMEOUT':_0x3957a9[_0x47c0('0x10')],'XMF-LOCALSTATIONID':_0x3957a9[_0x47c0('0x11')],'XMF-PATH':_0x5b18ec[_0x47c0('0x12')]};return _0x206719;};exports[_0x47c0('0x13')]=function(_0x2cdb89,_0x5c4641){return{'actionid':_0x2cdb89[_0x47c0('0x14')],'action':_0x47c0('0x15'),'channel':_0x2cdb89[_0x47c0('0x16')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x47c0('0xc')](_0x47c0('0x17'),_0x2cdb89[_0x47c0('0x9')]?_0x2cdb89[_0x47c0('0x9')]:'',_0x2cdb89['localstationid']),'variable':_0x5c4641,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2cdb89['uniqueid']};}; \ No newline at end of file +var _0x1e05=['gateway','path','variablesAction','uniqueid','format','localstationid','util','lodash','moment','fax','message','logger','info','inspect','ecm','headerinfo','minrate','modem'];(function(_0x5476af,_0x432ad6){var _0x5f0ee0=function(_0x2d5686){while(--_0x2d5686){_0x5476af['push'](_0x5476af['shift']());}};_0x5f0ee0(++_0x432ad6);}(_0x1e05,0x72));var _0x51e0=function(_0x1a12c8,_0x2df4dc){_0x1a12c8=_0x1a12c8-0x0;var _0x305109=_0x1e05[_0x1a12c8];return _0x305109;};'use strict';var util=require(_0x51e0('0x0'));var _=require(_0x51e0('0x1'));var moment=require(_0x51e0('0x2'));var logger=require('../../../../config/logger')(_0x51e0('0x3'));exports[_0x51e0('0x4')]=function(_0x54faaa){return{'message':_0x54faaa};};exports[_0x51e0('0x5')]=function(_0x3c41a4,_0x288a25){logger[_0x51e0('0x6')](_0x3c41a4,util[_0x51e0('0x7')](_0x288a25,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1a038b,_0x2b4545){var _0x54c4d7={'XMF-ECM':_0x2b4545[_0x51e0('0x8')],'XMF-HEADERINFO':_0x2b4545[_0x51e0('0x9')],'XMF-MINRATE':_0x2b4545[_0x51e0('0xa')],'XMF-MAXRATE':_0x2b4545['maxrate'],'XMF-MODEM':util['format']('\x22%s\x22',_0x2b4545[_0x51e0('0xb')]),'XMF-GATEWAY':_0x2b4545[_0x51e0('0xc')],'XMF-FAXDETECT':_0x2b4545['faxdetect'],'XMF-T38TIMEOUT':_0x2b4545['t38timeout'],'XMF-LOCALSTATIONID':_0x2b4545['localstationid'],'XMF-PATH':_0x1a038b[_0x51e0('0xd')]};return _0x54c4d7;};exports[_0x51e0('0xe')]=function(_0x2113f2,_0x579b26){return{'actionid':_0x2113f2[_0x51e0('0xf')],'action':'originate','channel':_0x2113f2['channel'],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x51e0('0x10')]('\x22%s\x22\x20<%s>',_0x2113f2[_0x51e0('0x9')]?_0x2113f2['headerinfo']:'',_0x2113f2[_0x51e0('0x11')]),'variable':_0x579b26,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2113f2['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 77062e9..df049a3 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 _0xedd7=['initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','inspect','listen','sync','error','[index.js][main]','util','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./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/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory'];(function(_0x571459,_0x2985ff){var _0x582b82=function(_0x1d549d){while(--_0x1d549d){_0x571459['push'](_0x571459['shift']());}};_0x582b82(++_0x2985ff);}(_0xedd7,0x168));var _0x7edd=function(_0x24e721,_0x4aec0c){_0x24e721=_0x24e721-0x0;var _0x16434e=_0xedd7[_0x24e721];return _0x16434e;};'use strict';var util=require(_0x7edd('0x0'));var moment=require('moment');var server=require(_0x7edd('0x1'));var Realtime=require(_0x7edd('0x2'));var Report=require(_0x7edd('0x3'));var Acw=require(_0x7edd('0x4'));var Trigger=require(_0x7edd('0x5'));var Dialer=require('./dialer');var Preview=require(_0x7edd('0x6'));var Fax=require(_0x7edd('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x7edd('0x8'));var voiceQueueReport=require(_0x7edd('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x7edd('0xa'));var trigger=require(_0x7edd('0xb'));var template=require(_0x7edd('0xc'));var cmHopperHistory=require(_0x7edd('0xd'));var campaign=require(_0x7edd('0xe'));var voiceExtension=require(_0x7edd('0xf'));var faxAccount=require(_0x7edd('0x10'));var zendesk=require(_0x7edd('0x11'));var salesforce=require(_0x7edd('0x12'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x7edd('0x13'));var zoho=require(_0x7edd('0x14'));var vtiger=require(_0x7edd('0x15'));var freshsales=require(_0x7edd('0x16'));var servicenow=require(_0x7edd('0x17'));var dynamics365=require(_0x7edd('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x7edd('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7edd('0x1a')](_0x7edd('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7edd('0x1a')](_0x7edd('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x7edd('0x1c')]()['then'](user[_0x7edd('0x1d')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x1f')]())[_0x7edd('0x1e')](user[_0x7edd('0x20')]())['then'](realtime[_0x7edd('0x21')]())['then'](trunk['getTrunks']())[_0x7edd('0x1e')](realtime[_0x7edd('0x22')]())['then'](voiceQueue[_0x7edd('0x23')]())['then'](realtime[_0x7edd('0x24')]())['then'](trigger[_0x7edd('0x25')]())[_0x7edd('0x1e')](realtime['initTriggers']())['then'](template[_0x7edd('0x26')]())[_0x7edd('0x1e')](realtime['initTemplates']())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0x7edd('0x27')]())[_0x7edd('0x1e')](salesforce[_0x7edd('0x28')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x29')]())['then'](sugarcrm[_0x7edd('0x2a')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x2b')]())[_0x7edd('0x1e')](freshdesk['getFreshdeskAccounts']())[_0x7edd('0x1e')](realtime['initFreshdeskAccounts']())['then'](desk[_0x7edd('0x2c')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x2d')]())[_0x7edd('0x1e')](zoho[_0x7edd('0x2e')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x2f')]())['then'](vtiger['getVtigerAccounts']())[_0x7edd('0x1e')](realtime['initVtigerAccounts']())[_0x7edd('0x1e')](freshsales[_0x7edd('0x30')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x31')]())[_0x7edd('0x1e')](servicenow[_0x7edd('0x32')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x33')]())['then'](dynamics365[_0x7edd('0x34')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x35')]())[_0x7edd('0x1e')](campaign[_0x7edd('0x36')]())['then'](realtime['initCampaigns']())[_0x7edd('0x1e')](voiceExtension[_0x7edd('0x37')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x38')]())[_0x7edd('0x1e')](faxAccount['getFaxAccounts']())[_0x7edd('0x1e')](realtime[_0x7edd('0x39')]())[_0x7edd('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0x7edd('0x1c')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x7edd('0x1e')](realtime[_0x7edd('0x3a')]())[_0x7edd('0x1e')](cmHopperHistory[_0x7edd('0x3b')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x3c')]())[_0x7edd('0x1e')](cmHopperHistory[_0x7edd('0x3d')]())[_0x7edd('0x1e')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x7edd('0x3e')]())[_0x7edd('0x1e')](realtime[_0x7edd('0x3f')]())[_0x7edd('0x40')](function(_0x411d02){logger['error']('[index.js][initParams]',util[_0x7edd('0x41')](_0x411d02,{'showHidden':![],'depth':null}));});}function main(){return server[_0x7edd('0x42')](realtime,preview,fax)[_0x7edd('0x1e')](function(){return initRealtime();})[_0x7edd('0x1e')](function(){return initParams();})['then'](function(){report[_0x7edd('0x43')]();setInterval(initRealtime,0x1388);})[_0x7edd('0x40')](function(_0x1bd35d){logger[_0x7edd('0x44')](_0x7edd('0x45'),util[_0x7edd('0x41')](_0x1bd35d,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x252a=['getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./report','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initTelephones','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x252a,0x86));var _0xa252=function(_0x2b7647,_0x2e6683){_0x2b7647=_0x2b7647-0x0;var _0x373dda=_0x252a[_0x2b7647];return _0x373dda;};'use strict';var util=require(_0xa252('0x0'));var moment=require(_0xa252('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0xa252('0x2'));var Acw=require('./acw');var Trigger=require(_0xa252('0x3'));var Dialer=require('./dialer');var Preview=require(_0xa252('0x4'));var Fax=require(_0xa252('0x5'));var user=require(_0xa252('0x6'));var voiceQueue=require(_0xa252('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xa252('0x8'));var trigger=require(_0xa252('0x9'));var template=require(_0xa252('0xa'));var cmHopperHistory=require(_0xa252('0xb'));var campaign=require(_0xa252('0xc'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xa252('0xd'));var zendesk=require(_0xa252('0xe'));var salesforce=require(_0xa252('0xf'));var sugarcrm=require(_0xa252('0x10'));var freshdesk=require(_0xa252('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xa252('0x12'));var servicenow=require(_0xa252('0x13'));var dynamics365=require(_0xa252('0x14'));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('../../config/logger')(_0xa252('0x15'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa252('0x16')](_0xa252('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xa252('0x18')]()[_0xa252('0x19')](user[_0xa252('0x1a')]())[_0xa252('0x19')](realtime['initAgents']())[_0xa252('0x19')](user['getTelephones']())[_0xa252('0x19')](realtime[_0xa252('0x1b')]())[_0xa252('0x19')](trunk['getTrunks']())[_0xa252('0x19')](realtime[_0xa252('0x1c')]())[_0xa252('0x19')](voiceQueue[_0xa252('0x1d')]())[_0xa252('0x19')](realtime['initVoiceQueues']())[_0xa252('0x19')](trigger[_0xa252('0x1e')]())[_0xa252('0x19')](realtime[_0xa252('0x1f')]())[_0xa252('0x19')](template[_0xa252('0x20')]())[_0xa252('0x19')](realtime['initTemplates']())[_0xa252('0x19')](zendesk[_0xa252('0x21')]())[_0xa252('0x19')](realtime['initZendeskAccounts']())[_0xa252('0x19')](salesforce['getSalesforceAccounts']())[_0xa252('0x19')](realtime[_0xa252('0x22')]())[_0xa252('0x19')](sugarcrm[_0xa252('0x23')]())[_0xa252('0x19')](realtime[_0xa252('0x24')]())[_0xa252('0x19')](freshdesk['getFreshdeskAccounts']())['then'](realtime['initFreshdeskAccounts']())[_0xa252('0x19')](desk[_0xa252('0x25')]())[_0xa252('0x19')](realtime[_0xa252('0x26')]())[_0xa252('0x19')](zoho[_0xa252('0x27')]())['then'](realtime[_0xa252('0x28')]())['then'](vtiger['getVtigerAccounts']())[_0xa252('0x19')](realtime['initVtigerAccounts']())[_0xa252('0x19')](freshsales['getFreshsalesAccounts']())[_0xa252('0x19')](realtime['initFreshsalesAccounts']())[_0xa252('0x19')](servicenow[_0xa252('0x29')]())[_0xa252('0x19')](realtime[_0xa252('0x2a')]())[_0xa252('0x19')](dynamics365[_0xa252('0x2b')]())[_0xa252('0x19')](realtime[_0xa252('0x2c')]())[_0xa252('0x19')](campaign[_0xa252('0x2d')]())[_0xa252('0x19')](realtime[_0xa252('0x2e')]())[_0xa252('0x19')](voiceExtension[_0xa252('0x2f')]())[_0xa252('0x19')](realtime[_0xa252('0x30')]())[_0xa252('0x19')](faxAccount['getFaxAccounts']())[_0xa252('0x19')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return Promise[_0xa252('0x18')]()['then'](voiceQueueReport[_0xa252('0x31')]())[_0xa252('0x19')](realtime[_0xa252('0x32')]())[_0xa252('0x19')](cmHopperHistory[_0xa252('0x33')]())[_0xa252('0x19')](realtime[_0xa252('0x34')]())[_0xa252('0x19')](cmHopperHistory[_0xa252('0x35')]())[_0xa252('0x19')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0xa252('0x36')]())[_0xa252('0x19')](realtime['initVoiceCallReports']())['catch'](function(_0x9e7647){logger[_0xa252('0x37')](_0xa252('0x38'),util[_0xa252('0x39')](_0x9e7647,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa252('0x3a')](realtime,preview,fax)['then'](function(){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xa252('0x3b')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x478fc0){logger[_0xa252('0x37')](_0xa252('0x3c'),util[_0xa252('0x39')](_0x478fc0,{'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 941bb41..126e7fc 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 _0x9a96=['voiceStatusQueue','onhold','local','md5','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','toNumber','format','stateTime','stringify','user:%s','user:ami:update','omit','emit','exports','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber'];(function(_0x5d5fce,_0x2e1543){var _0x4a1ee5=function(_0x52eba0){while(--_0x52eba0){_0x5d5fce['push'](_0x5d5fce['shift']());}};_0x4a1ee5(++_0x2e1543);}(_0x9a96,0x104));var _0x69a9=function(_0x2b879e,_0x580efd){_0x2b879e=_0x2b879e-0x0;var _0x10c32d=_0x9a96[_0x2b879e];return _0x10c32d;};'use strict';var _=require('lodash');var util=require(_0x69a9('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x69a9('0x1'));var config=require(_0x69a9('0x2'));config[_0x69a9('0x3')]=_[_0x69a9('0x4')](config[_0x69a9('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x69a9('0x5'))(new Redis(config[_0x69a9('0x3')]));function Agent(_0x52a834){this['id']=_0x52a834['id']||0x0;this[_0x69a9('0x6')]=_0x52a834[_0x69a9('0x6')]||'';this['email']=_0x52a834[_0x69a9('0x7')]||'';this[_0x69a9('0x8')]=_0x52a834[_0x69a9('0x8')]||'';this[_0x69a9('0x9')]=_0x52a834[_0x69a9('0x9')]||'';this['state']=_0x69a9('0xa');this['stateTime']=0x0;this[_0x69a9('0xb')]=_0x69a9('0xa');this[_0x69a9('0xc')]='';this[_0x69a9('0xd')]='';this[_0x69a9('0xe')]='';this[_0x69a9('0xf')]='';this[_0x69a9('0x10')]=_0x52a834[_0x69a9('0x10')]||![];this[_0x69a9('0x11')]=_0x69a9('0xa');this[_0x69a9('0x12')]=0x0;this[_0x69a9('0x13')]='';this[_0x69a9('0x14')]='';this[_0x69a9('0x15')]=![];this[_0x69a9('0x16')]=![];this[_0x69a9('0x17')]='';}Agent['prototype'][_0x69a9('0x18')]=function(_0x39597b){var _0x14148c;if(_0x39597b&&_0x39597b['state']){_0x14148c=_0x39597b[_0x69a9('0x19')][_0x69a9('0x1a')]();switch(_0x14148c){case _0x69a9('0x1b'):_0x14148c=_0x69a9('0x1c');break;case _0x69a9('0x1d'):_0x14148c=_0x69a9('0x1e');break;}}if(_0x14148c&&this[_0x69a9('0x11')]!==_0x14148c||_0x39597b['statePause']){this[_0x69a9('0x12')]=_[_0x69a9('0x1f')](moment()[_0x69a9('0x20')]('x'));}if(_0x14148c){this[_0x69a9('0x11')]=_0x14148c;}var _0xf60b5d={'id':this['id'],'name':this['name'],'email':this[_0x69a9('0x7')],'accountcode':this[_0x69a9('0x8')],'fullname':this[_0x69a9('0x9')],'state':this[_0x69a9('0x19')],'stateTime':this[_0x69a9('0x21')],'status':this['status'],'address':this[_0x69a9('0xc')],'online':this[_0x69a9('0x10')],'voiceStatus':this[_0x69a9('0x11')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x69a9('0x13')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x69a9('0xf')],'onhold':this[_0x69a9('0x15')]};var _0x551ef7=md5(JSON[_0x69a9('0x22')](_0xf60b5d));if(this['md5']!==_0x551ef7){this[_0x69a9('0x17')]=_0x551ef7;io['to'](util[_0x69a9('0x20')](_0x69a9('0x23'),_0xf60b5d[_0x69a9('0x6')]))['emit'](_0x69a9('0x24'),_[_0x69a9('0x25')](_0xf60b5d,[_0x69a9('0x10')]));io[_0x69a9('0x26')]('user:presence',_0xf60b5d);}};module[_0x69a9('0x27')]=Agent; \ No newline at end of file +var _0xe47c=['state','toLowerCase','not_inuse','inuse','talking','statePause','format','accountcode','stringify','user:%s','emit','user:ami:update','user:presence','exports','util','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','email','fullname','unknown','stateTime','status','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime'];(function(_0x48b62f,_0x4c0c1b){var _0x390ee5=function(_0x27806a){while(--_0x27806a){_0x48b62f['push'](_0x48b62f['shift']());}};_0x390ee5(++_0x4c0c1b);}(_0xe47c,0x1ef));var _0xce47=function(_0xcc562c,_0x4203fe){_0xcc562c=_0xcc562c-0x0;var _0x4fa1f8=_0xe47c[_0xcc562c];return _0x4fa1f8;};'use strict';var _=require('lodash');var util=require(_0xce47('0x0'));var moment=require('moment');var md5=require(_0xce47('0x1'));var Redis=require(_0xce47('0x2'));var config=require(_0xce47('0x3'));config['redis']=_[_0xce47('0x4')](config[_0xce47('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xce47('0x6'))(new Redis(config[_0xce47('0x5')]));function Agent(_0x19d726){this['id']=_0x19d726['id']||0x0;this['name']=_0x19d726[_0xce47('0x7')]||'';this[_0xce47('0x8')]=_0x19d726[_0xce47('0x8')]||'';this['accountcode']=_0x19d726['accountcode']||'';this[_0xce47('0x9')]=_0x19d726[_0xce47('0x9')]||'';this['state']=_0xce47('0xa');this[_0xce47('0xb')]=0x0;this[_0xce47('0xc')]=_0xce47('0xa');this['address']='';this[_0xce47('0xd')]='';this['mobile']='';this[_0xce47('0xe')]='';this[_0xce47('0xf')]=_0x19d726[_0xce47('0xf')]||![];this[_0xce47('0x10')]=_0xce47('0xa');this[_0xce47('0x11')]=0x0;this[_0xce47('0x12')]='';this[_0xce47('0x13')]='';this['onhold']=![];this[_0xce47('0x14')]=![];this[_0xce47('0x1')]='';}Agent[_0xce47('0x15')][_0xce47('0x16')]=function(_0x57e36f){var _0x2f39ba;if(_0x57e36f&&_0x57e36f[_0xce47('0x17')]){_0x2f39ba=_0x57e36f[_0xce47('0x17')][_0xce47('0x18')]();switch(_0x2f39ba){case _0xce47('0x19'):_0x2f39ba='idle';break;case _0xce47('0x1a'):_0x2f39ba=_0xce47('0x1b');break;}}if(_0x2f39ba&&this['voiceStatus']!==_0x2f39ba||_0x57e36f[_0xce47('0x1c')]){this['voiceStatusTime']=_['toNumber'](moment()[_0xce47('0x1d')]('x'));}if(_0x2f39ba){this[_0xce47('0x10')]=_0x2f39ba;}var _0x1fc482={'id':this['id'],'name':this['name'],'email':this[_0xce47('0x8')],'accountcode':this[_0xce47('0x1e')],'fullname':this[_0xce47('0x9')],'state':this['state'],'stateTime':this[_0xce47('0xb')],'status':this[_0xce47('0xc')],'address':this['address'],'online':this[_0xce47('0xf')],'voiceStatus':this[_0xce47('0x10')],'voiceStatusTime':this[_0xce47('0x11')],'voiceStatusCallerIdNumber':this[_0xce47('0x12')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xce47('0xe')],'onhold':this['onhold']};var _0x24bfdb=md5(JSON[_0xce47('0x1f')](_0x1fc482));if(this[_0xce47('0x1')]!==_0x24bfdb){this['md5']=_0x24bfdb;io['to'](util[_0xce47('0x1d')](_0xce47('0x20'),_0x1fc482[_0xce47('0x7')]))[_0xce47('0x21')](_0xce47('0x22'),_['omit'](_0x1fc482,['online']));io[_0xce47('0x21')](_0xce47('0x23'),_0x1fc482);}};module[_0xce47('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 35eb26b..6d462f9 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 _0xa4d0=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x43bdc3,_0x3bb893){var _0x230719=function(_0x445699){while(--_0x445699){_0x43bdc3['push'](_0x43bdc3['shift']());}};_0x230719(++_0x3bb893);}(_0xa4d0,0xfd));var _0x0a4d=function(_0x855e49,_0x32fa29){_0x855e49=_0x855e49-0x0;var _0x3a9204=_0xa4d0[_0x855e49];return _0x3a9204;};'use strict';function Campaign(_0x26f14d){this['id']=_0x26f14d['id']||0x0;this[_0x0a4d('0x0')]=_0x26f14d[_0x0a4d('0x0')]||'';this[_0x0a4d('0x1')]=_0x26f14d[_0x0a4d('0x1')]||'campaign';this[_0x0a4d('0x2')]=0x0;this['temp']=0x0;this[_0x0a4d('0x3')]=0x0;this[_0x0a4d('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x0a4d('0x5')]=_0x26f14d[_0x0a4d('0x5')];this[_0x0a4d('0x6')]=_0x26f14d[_0x0a4d('0x6')];this[_0x0a4d('0x7')]=_0x26f14d[_0x0a4d('0x7')]||null;this[_0x0a4d('0x8')]=_0x26f14d[_0x0a4d('0x8')]?_0x26f14d[_0x0a4d('0x8')]:null;this[_0x0a4d('0x9')]=_0x26f14d[_0x0a4d('0x9')];this[_0x0a4d('0xa')]=_0x26f14d[_0x0a4d('0xa')];this[_0x0a4d('0xb')]=_0x26f14d['dialOriginateTimeout']||0x1e;this[_0x0a4d('0xc')]=_0x26f14d['dialCongestionMaxRetry'];this[_0x0a4d('0xd')]=_0x26f14d[_0x0a4d('0xd')];this[_0x0a4d('0xe')]=_0x26f14d[_0x0a4d('0xe')];this[_0x0a4d('0xf')]=_0x26f14d[_0x0a4d('0xf')];this[_0x0a4d('0x10')]=_0x26f14d[_0x0a4d('0x10')];this['dialNoAnswerRetryFrequency']=_0x26f14d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x26f14d[_0x0a4d('0x11')];this[_0x0a4d('0x12')]=_0x26f14d[_0x0a4d('0x12')]||0x3;this[_0x0a4d('0x13')]=_0x26f14d[_0x0a4d('0x13')]||0x96;this['dialDropMaxRetry']=_0x26f14d['dialDropMaxRetry']||0x3;this[_0x0a4d('0x14')]=_0x26f14d[_0x0a4d('0x14')]||0x96;this['dialAbandonedMaxRetry']=_0x26f14d['dialAbandonedMaxRetry']||0x3;this[_0x0a4d('0x15')]=_0x26f14d[_0x0a4d('0x15')]||0x96;this[_0x0a4d('0x16')]=_0x26f14d[_0x0a4d('0x16')]||0x3;this[_0x0a4d('0x17')]=_0x26f14d[_0x0a4d('0x17')]||0x96;this['dialAgentRejectMaxRetry']=_0x26f14d[_0x0a4d('0x18')]||0x3;this[_0x0a4d('0x19')]=_0x26f14d[_0x0a4d('0x19')]||0x96;this[_0x0a4d('0x1a')]=_0x26f14d[_0x0a4d('0x1a')]||_0x0a4d('0x1b');this[_0x0a4d('0x1c')]=_0x26f14d[_0x0a4d('0x1c')]||undefined;this[_0x0a4d('0x1d')]=_0x26f14d[_0x0a4d('0x1d')]||undefined;this['dialCutDigit']=_0x26f14d[_0x0a4d('0x1e')]||undefined;this[_0x0a4d('0x1f')]=_0x26f14d[_0x0a4d('0x1f')]?_0x26f14d[_0x0a4d('0x1f')]:undefined;this[_0x0a4d('0x20')]=_0x26f14d[_0x0a4d('0x20')]?_0x26f14d[_0x0a4d('0x20')]:undefined;this[_0x0a4d('0x21')]=_0x26f14d[_0x0a4d('0x21')]?_0x26f14d[_0x0a4d('0x21')]:undefined;this[_0x0a4d('0x22')]=_0x26f14d[_0x0a4d('0x22')]?_0x26f14d[_0x0a4d('0x22')]:undefined;this[_0x0a4d('0x23')]=_0x26f14d[_0x0a4d('0x22')]?_0x26f14d['SquareProject'][_0x0a4d('0x0')]:undefined;this[_0x0a4d('0x24')]=_0x26f14d['dialAMDActive']||![];this[_0x0a4d('0x25')]=_0x26f14d[_0x0a4d('0x25')];this['dialAMDGreeting']=_0x26f14d[_0x0a4d('0x26')];this['dialAMDAfterGreetingSilence']=_0x26f14d['dialAMDAfterGreetingSilence'];this[_0x0a4d('0x27')]=_0x26f14d['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x26f14d[_0x0a4d('0x28')];this['dialAMDBetweenWordsSilence']=_0x26f14d['dialAMDBetweenWordsSilence'];this[_0x0a4d('0x29')]=_0x26f14d['dialAMDMaximumNumberOfWords'];this[_0x0a4d('0x2a')]=_0x26f14d[_0x0a4d('0x2a')];this['dialAMDMaximumWordLength']=_0x26f14d[_0x0a4d('0x2b')];}module[_0x0a4d('0x2c')]=Campaign; \ No newline at end of file +var _0x2262=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x2262,0xbd));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';function Campaign(_0xd1fdce){this['id']=_0xd1fdce['id']||0x0;this[_0x2226('0x0')]=_0xd1fdce['name']||'';this['type']=_0xd1fdce['type']||_0x2226('0x1');this[_0x2226('0x2')]=0x0;this[_0x2226('0x3')]=0x0;this[_0x2226('0x4')]=0x0;this[_0x2226('0x5')]=0x0;this['message']='';this[_0x2226('0x6')]=!![];this[_0x2226('0x7')]=_0xd1fdce[_0x2226('0x7')];this['limitCalls']=_0xd1fdce[_0x2226('0x8')];this[_0x2226('0x9')]=_0xd1fdce[_0x2226('0x9')]||null;this[_0x2226('0xa')]=_0xd1fdce[_0x2226('0xa')]?_0xd1fdce['dialGlobalInterval']:null;this[_0x2226('0xb')]=_0xd1fdce['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0xd1fdce[_0x2226('0xc')];this['dialOriginateTimeout']=_0xd1fdce[_0x2226('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0xd1fdce['dialCongestionMaxRetry'];this[_0x2226('0xe')]=_0xd1fdce[_0x2226('0xe')];this[_0x2226('0xf')]=_0xd1fdce[_0x2226('0xf')];this[_0x2226('0x10')]=_0xd1fdce['dialBusyRetryFrequency'];this[_0x2226('0x11')]=_0xd1fdce[_0x2226('0x11')];this[_0x2226('0x12')]=_0xd1fdce[_0x2226('0x12')];this[_0x2226('0x13')]=_0xd1fdce['dialGlobalMaxRetry'];this[_0x2226('0x14')]=_0xd1fdce[_0x2226('0x14')]||0x3;this[_0x2226('0x15')]=_0xd1fdce[_0x2226('0x15')]||0x96;this[_0x2226('0x16')]=_0xd1fdce['dialDropMaxRetry']||0x3;this[_0x2226('0x17')]=_0xd1fdce[_0x2226('0x17')]||0x96;this[_0x2226('0x18')]=_0xd1fdce[_0x2226('0x18')]||0x3;this[_0x2226('0x19')]=_0xd1fdce[_0x2226('0x19')]||0x96;this[_0x2226('0x1a')]=_0xd1fdce[_0x2226('0x1a')]||0x3;this[_0x2226('0x1b')]=_0xd1fdce[_0x2226('0x1b')]||0x96;this[_0x2226('0x1c')]=_0xd1fdce[_0x2226('0x1c')]||0x3;this[_0x2226('0x1d')]=_0xd1fdce['dialAgentRejectRetryFrequency']||0x96;this[_0x2226('0x1e')]=_0xd1fdce['dialOrderByScheduledAt']||_0x2226('0x1f');this[_0x2226('0x20')]=_0xd1fdce[_0x2226('0x20')]||undefined;this[_0x2226('0x21')]=_0xd1fdce[_0x2226('0x21')]||undefined;this[_0x2226('0x22')]=_0xd1fdce[_0x2226('0x22')]||undefined;this['TrunkBackup']=_0xd1fdce[_0x2226('0x23')]?_0xd1fdce[_0x2226('0x23')]:undefined;this[_0x2226('0x24')]=_0xd1fdce['Trunk']?_0xd1fdce[_0x2226('0x24')]:undefined;this[_0x2226('0x25')]=_0xd1fdce[_0x2226('0x25')]?_0xd1fdce['Interval']:undefined;this[_0x2226('0x26')]=_0xd1fdce[_0x2226('0x26')]?_0xd1fdce['SquareProject']:undefined;this[_0x2226('0x27')]=_0xd1fdce['SquareProject']?_0xd1fdce['SquareProject'][_0x2226('0x0')]:undefined;this[_0x2226('0x28')]=_0xd1fdce['dialAMDActive']||![];this['dialAMDInitialSilence']=_0xd1fdce[_0x2226('0x29')];this['dialAMDGreeting']=_0xd1fdce[_0x2226('0x2a')];this['dialAMDAfterGreetingSilence']=_0xd1fdce[_0x2226('0x2b')];this['dialAMDTotalAnalysisTime']=_0xd1fdce[_0x2226('0x2c')];this[_0x2226('0x2d')]=_0xd1fdce[_0x2226('0x2d')];this[_0x2226('0x2e')]=_0xd1fdce[_0x2226('0x2e')];this[_0x2226('0x2f')]=_0xd1fdce[_0x2226('0x2f')];this[_0x2226('0x30')]=_0xd1fdce[_0x2226('0x30')];this[_0x2226('0x31')]=_0xd1fdce[_0x2226('0x31')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index fcdca42..bffba3a 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 _0x80e6=['exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','channel','destinationchannel','calleridname','connectedlinenum','accountcode','uniqueid','linkedid'];(function(_0x4000fe,_0x3bdddd){var _0x187560=function(_0x12e9e6){while(--_0x12e9e6){_0x4000fe['push'](_0x4000fe['shift']());}};_0x187560(++_0x3bdddd);}(_0x80e6,0x1e7));var _0x680e=function(_0x5d5551,_0x231d05){_0x5d5551=_0x5d5551-0x0;var _0x530c85=_0x80e6[_0x5d5551];return _0x530c85;};'use strict';function Channel(){this['starttime']=null;this[_0x680e('0x0')]='';this[_0x680e('0x1')]='';this['calleridnum']=0x0;this[_0x680e('0x2')]='';this[_0x680e('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x680e('0x4')]=0x0;this['context']='';this[_0x680e('0x5')]=0x0;this[_0x680e('0x6')]=0x0;this[_0x680e('0x7')]=0x0;this[_0x680e('0x8')]=![];this[_0x680e('0x9')]=null;this[_0x680e('0xa')]=null;this[_0x680e('0xb')]=![];this[_0x680e('0xc')]=![];this[_0x680e('0xd')]='';this[_0x680e('0xe')]='';this[_0x680e('0xf')]=0x0;this[_0x680e('0x10')]=0x0;this[_0x680e('0x11')]=0x0;this[_0x680e('0x12')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x680e('0x13')]=null;this[_0x680e('0x14')]=null;this[_0x680e('0x15')]=[];this[_0x680e('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x680e('0x17')]=undefined;this[_0x680e('0x18')]=0x0;}module[_0x680e('0x19')]=Channel; \ No newline at end of file +var _0x65ec=['starttime','channel','destinationchannel','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename','monitors','transferconnectedlinenum','transferType','mohtime','exports'];(function(_0x312c40,_0x2acc55){var _0x3f40bb=function(_0x5c6d4d){while(--_0x5c6d4d){_0x312c40['push'](_0x312c40['shift']());}};_0x3f40bb(++_0x2acc55);}(_0x65ec,0x16c));var _0xc65e=function(_0x28695b,_0x25350b){_0x28695b=_0x28695b-0x0;var _0x2fc3cc=_0x65ec[_0x28695b];return _0x2fc3cc;};'use strict';function Channel(){this[_0xc65e('0x0')]=null;this[_0xc65e('0x1')]='';this[_0xc65e('0x2')]='';this['calleridnum']=0x0;this[_0xc65e('0x3')]='';this['connectedlinenum']=undefined;this[_0xc65e('0x4')]=undefined;this[_0xc65e('0x5')]=0x0;this[_0xc65e('0x6')]='';this[_0xc65e('0x7')]=0x0;this[_0xc65e('0x8')]=0x0;this[_0xc65e('0x9')]=0x0;this[_0xc65e('0xa')]=![];this[_0xc65e('0xb')]=null;this[_0xc65e('0xc')]=null;this['unmanaged']=![];this[_0xc65e('0xd')]=![];this[_0xc65e('0xe')]='';this[_0xc65e('0xf')]='';this[_0xc65e('0x10')]=0x0;this[_0xc65e('0x11')]=0x0;this[_0xc65e('0x12')]=0x0;this[_0xc65e('0x13')]=null;this['tag']=null;this[_0xc65e('0x14')]=null;this[_0xc65e('0x15')]=![];this[_0xc65e('0x16')]=null;this['queue']=null;this[_0xc65e('0x17')]=[];this['transfercalleridnum']=undefined;this[_0xc65e('0x18')]=undefined;this[_0xc65e('0x19')]=undefined;this[_0xc65e('0x1a')]=0x0;}module[_0xc65e('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a69e289..4330adf 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 _0xc34e=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x1cc5ce,_0x37405f){var _0x5e4391=function(_0x3fad98){while(--_0x3fad98){_0x1cc5ce['push'](_0x1cc5ce['shift']());}};_0x5e4391(++_0x37405f);}(_0xc34e,0x132));var _0xec34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34e[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x1c9559){this['id']=_0x1c9559['id']||0x0;this[_0xec34('0x0')]=_0x1c9559['name']||'';this[_0xec34('0x1')]=_0x1c9559[_0xec34('0x1')]||'';this[_0xec34('0x2')]=_0x1c9559[_0xec34('0x2')]||'';this[_0xec34('0x3')]=_0x1c9559[_0xec34('0x3')]||'';this[_0xec34('0x4')]=_0x1c9559[_0xec34('0x4')]||'';this[_0xec34('0x5')]=_0x1c9559['consumerKey']||'';this['consumerSecret']=_0x1c9559[_0xec34('0x6')]||'';this[_0xec34('0x7')]=_0x1c9559['token']||'';this[_0xec34('0x8')]=_0x1c9559[_0xec34('0x8')]||'';this[_0xec34('0x9')]=_0x1c9559['type']||'';this[_0xec34('0xa')]=_0x1c9559[_0xec34('0xa')]||'';this[_0xec34('0xb')]=_0x1c9559[_0xec34('0xb')]||{};}module[_0xec34('0xc')]=DeskAccount; \ No newline at end of file +var _0x209b=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','authType'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x209b,0xbd));var _0xb209=function(_0x221a3d,_0x2b9912){_0x221a3d=_0x221a3d-0x0;var _0x30566f=_0x209b[_0x221a3d];return _0x30566f;};'use strict';function DeskAccount(_0x1e8b2f){this['id']=_0x1e8b2f['id']||0x0;this[_0xb209('0x0')]=_0x1e8b2f[_0xb209('0x0')]||'';this[_0xb209('0x1')]=_0x1e8b2f[_0xb209('0x1')]||'';this['remoteUri']=_0x1e8b2f['remoteUri']||'';this['authType']=_0x1e8b2f[_0xb209('0x2')]||'';this[_0xb209('0x3')]=_0x1e8b2f[_0xb209('0x3')]||'';this[_0xb209('0x4')]=_0x1e8b2f[_0xb209('0x4')]||'';this['consumerSecret']=_0x1e8b2f[_0xb209('0x5')]||'';this[_0xb209('0x6')]=_0x1e8b2f[_0xb209('0x6')]||'';this[_0xb209('0x7')]=_0x1e8b2f[_0xb209('0x7')]||'';this[_0xb209('0x8')]=_0x1e8b2f[_0xb209('0x8')]||'';this[_0xb209('0x9')]=_0x1e8b2f[_0xb209('0x9')]||'';this[_0xb209('0xa')]=_0x1e8b2f[_0xb209('0xa')]||{};}module[_0xb209('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index db05c93..7a5068f 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 _0x3715=['exports','name','password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x1923d4,_0x537193){var _0x39acd4=function(_0x4de0b2){while(--_0x4de0b2){_0x1923d4['push'](_0x1923d4['shift']());}};_0x39acd4(++_0x537193);}(_0x3715,0xd3));var _0x5371=function(_0x6c5290,_0x162a07){_0x6c5290=_0x6c5290-0x0;var _0x3ac73f=_0x3715[_0x6c5290];return _0x3ac73f;};'use strict';function Dynamics365Account(_0x17899d){this['id']=_0x17899d['id']||0x0;this['name']=_0x17899d[_0x5371('0x0')]||'';this['username']=_0x17899d['username']||'';this['password']=_0x17899d[_0x5371('0x1')]||'';this[_0x5371('0x2')]=_0x17899d['remoteUri']||'';this[_0x5371('0x3')]=_0x17899d[_0x5371('0x3')]||'';this['clientId']=_0x17899d['clientId']||'';this[_0x5371('0x4')]=_0x17899d['clientSecret']||{};this[_0x5371('0x5')]=_0x17899d[_0x5371('0x5')]||'';this['modernAuthentication']=_0x17899d[_0x5371('0x6')]||![];this['Configurations']=_0x17899d[_0x5371('0x7')]||{};this[_0x5371('0x8')]=_0x17899d[_0x5371('0x8')]||{};}module[_0x5371('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x7d4d=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri','tenantId'];(function(_0xc1bf3c,_0x5eadb0){var _0x2a3135=function(_0x963415){while(--_0x963415){_0xc1bf3c['push'](_0xc1bf3c['shift']());}};_0x2a3135(++_0x5eadb0);}(_0x7d4d,0x1b3));var _0xd7d4=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0x7d4d[_0x5df61d];return _0x24cc4c;};'use strict';function Dynamics365Account(_0x42a0f8){this['id']=_0x42a0f8['id']||0x0;this['name']=_0x42a0f8[_0xd7d4('0x0')]||'';this[_0xd7d4('0x1')]=_0x42a0f8[_0xd7d4('0x1')]||'';this[_0xd7d4('0x2')]=_0x42a0f8[_0xd7d4('0x2')]||'';this[_0xd7d4('0x3')]=_0x42a0f8[_0xd7d4('0x3')]||'';this[_0xd7d4('0x4')]=_0x42a0f8['tenantId']||'';this[_0xd7d4('0x5')]=_0x42a0f8[_0xd7d4('0x5')]||'';this[_0xd7d4('0x6')]=_0x42a0f8[_0xd7d4('0x6')]||{};this['serverUrl']=_0x42a0f8[_0xd7d4('0x7')]||'';this[_0xd7d4('0x8')]=_0x42a0f8[_0xd7d4('0x8')]||![];this[_0xd7d4('0x9')]=_0x42a0f8[_0xd7d4('0x9')]||{};this[_0xd7d4('0xa')]=_0x42a0f8[_0xd7d4('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2652808..73a7c42 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 _0xae31=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x53aa2a,_0x3e514a){var _0x3369da=function(_0x4832d0){while(--_0x4832d0){_0x53aa2a['push'](_0x53aa2a['shift']());}};_0x3369da(++_0x3e514a);}(_0xae31,0x131));var _0x1ae3=function(_0x1d3470,_0x35887b){_0x1d3470=_0x1d3470-0x0;var _0x11805f=_0xae31[_0x1d3470];return _0x11805f;};'use strict';function FaxAccount(_0x11d3fd){this['id']=_0x11d3fd['id']||0x0;this[_0x1ae3('0x0')]=_0x11d3fd[_0x1ae3('0x0')]||'';this[_0x1ae3('0x1')]=_0x11d3fd['description'];this['ecm']=_0x11d3fd[_0x1ae3('0x2')];this[_0x1ae3('0x3')]=_0x11d3fd[_0x1ae3('0x3')];this['localstationid']=_0x11d3fd[_0x1ae3('0x4')];this[_0x1ae3('0x5')]=_0x11d3fd[_0x1ae3('0x5')]||0x960;this[_0x1ae3('0x6')]=_0x11d3fd['maxrate']||0x3840;this[_0x1ae3('0x7')]=_0x11d3fd['modem']||_0x1ae3('0x8');this[_0x1ae3('0x9')]=_0x11d3fd[_0x1ae3('0x9')]||'no';this['faxdetect']=_0x11d3fd['faxdetect']||'no';this[_0x1ae3('0xa')]=_0x11d3fd[_0x1ae3('0xa')]||0x1388;this[_0x1ae3('0xb')]=_0x11d3fd['tech']||_0x1ae3('0xc');this[_0x1ae3('0xd')]=_0x11d3fd['Trunk']?_0x11d3fd[_0x1ae3('0xd')]:undefined;this['ListId']=_0x11d3fd[_0x1ae3('0xe')];this[_0x1ae3('0xf')]=_0x11d3fd[_0x1ae3('0xf')];}module[_0x1ae3('0x10')]=FaxAccount; \ No newline at end of file +var _0x0471=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x27097a,_0x1b7f8b){var _0x26378b=function(_0x39f8f8){while(--_0x39f8f8){_0x27097a['push'](_0x27097a['shift']());}};_0x26378b(++_0x1b7f8b);}(_0x0471,0x192));var _0x1047=function(_0x36984a,_0x3f07cd){_0x36984a=_0x36984a-0x0;var _0x519713=_0x0471[_0x36984a];return _0x519713;};'use strict';function FaxAccount(_0x5f4a94){this['id']=_0x5f4a94['id']||0x0;this[_0x1047('0x0')]=_0x5f4a94[_0x1047('0x0')]||'';this[_0x1047('0x1')]=_0x5f4a94['description'];this[_0x1047('0x2')]=_0x5f4a94[_0x1047('0x2')];this[_0x1047('0x3')]=_0x5f4a94['headerinfo'];this[_0x1047('0x4')]=_0x5f4a94[_0x1047('0x4')];this[_0x1047('0x5')]=_0x5f4a94[_0x1047('0x5')]||0x960;this[_0x1047('0x6')]=_0x5f4a94[_0x1047('0x6')]||0x3840;this[_0x1047('0x7')]=_0x5f4a94[_0x1047('0x7')]||_0x1047('0x8');this[_0x1047('0x9')]=_0x5f4a94[_0x1047('0x9')]||'no';this[_0x1047('0xa')]=_0x5f4a94[_0x1047('0xa')]||'no';this[_0x1047('0xb')]=_0x5f4a94[_0x1047('0xb')]||0x1388;this[_0x1047('0xc')]=_0x5f4a94[_0x1047('0xc')]||_0x1047('0xd');this[_0x1047('0xe')]=_0x5f4a94['Trunk']?_0x5f4a94[_0x1047('0xe')]:undefined;this['ListId']=_0x5f4a94['ListId'];this[_0x1047('0xf')]=_0x5f4a94[_0x1047('0xf')];}module[_0x1047('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 3e31ce7..0923744 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 _0x2b91=['apiKey','token','remoteUri','serverUrl','name','username'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x2b91,0x118));var _0x12b9=function(_0x2f779c,_0x32990c){_0x2f779c=_0x2f779c-0x0;var _0x56941c=_0x2b91[_0x2f779c];return _0x56941c;};'use strict';function FreshdeskAccount(_0x19a8c7){this['id']=_0x19a8c7['id']||0x0;this[_0x12b9('0x0')]=_0x19a8c7[_0x12b9('0x0')]||'';this[_0x12b9('0x1')]=_0x19a8c7[_0x12b9('0x1')]||'';this[_0x12b9('0x2')]=_0x19a8c7[_0x12b9('0x3')]||'';this[_0x12b9('0x4')]=_0x19a8c7[_0x12b9('0x4')]||'';this[_0x12b9('0x5')]=_0x19a8c7[_0x12b9('0x5')]||'';this['Configurations']=_0x19a8c7['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xca7c=['apiKey','serverUrl','Configurations','name','username'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xca7c,0x8a));var _0xcca7=function(_0x215865,_0x2d6890){_0x215865=_0x215865-0x0;var _0x5e6494=_0xca7c[_0x215865];return _0x5e6494;};'use strict';function FreshdeskAccount(_0x1b173b){this['id']=_0x1b173b['id']||0x0;this[_0xcca7('0x0')]=_0x1b173b[_0xcca7('0x0')]||'';this['username']=_0x1b173b[_0xcca7('0x1')]||'';this[_0xcca7('0x2')]=_0x1b173b['token']||'';this['remoteUri']=_0x1b173b['remoteUri']||'';this[_0xcca7('0x3')]=_0x1b173b[_0xcca7('0x3')]||'';this['Configurations']=_0x1b173b[_0xcca7('0x4')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 3c3ff13..6643c8b 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 _0x6379=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6379,0x84));var _0x9637=function(_0x5f25f7,_0x5ae75f){_0x5f25f7=_0x5f25f7-0x0;var _0x30b621=_0x6379[_0x5f25f7];return _0x30b621;};'use strict';function FreshsalesAccount(_0x17b97e){this['id']=_0x17b97e['id']||0x0;this[_0x9637('0x0')]=_0x17b97e[_0x9637('0x0')]||'';this[_0x9637('0x1')]=_0x17b97e[_0x9637('0x1')]||'';this['apiKey']=_0x17b97e[_0x9637('0x2')]||'';this[_0x9637('0x3')]=_0x17b97e['remoteUri']||'';this['serverUrl']=_0x17b97e[_0x9637('0x4')]||'';this[_0x9637('0x5')]=_0x17b97e[_0x9637('0x5')]||{};}module[_0x9637('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xf360=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xf360,0x9e));var _0x0f36=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf360[_0x3e5086];return _0xfeb102;};'use strict';function FreshsalesAccount(_0x18c229){this['id']=_0x18c229['id']||0x0;this[_0x0f36('0x0')]=_0x18c229[_0x0f36('0x0')]||'';this['username']=_0x18c229[_0x0f36('0x1')]||'';this['apiKey']=_0x18c229[_0x0f36('0x2')]||'';this[_0x0f36('0x3')]=_0x18c229[_0x0f36('0x3')]||'';this['serverUrl']=_0x18c229[_0x0f36('0x4')]||'';this[_0x0f36('0x5')]=_0x18c229[_0x0f36('0x5')]||{};}module[_0x0f36('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index fd4825e..08188ab 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 _0x3c61=['originalposition','channel','connectedlinenum','accountcode','exten','priority','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','uniqueid','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt'];(function(_0x4319e9,_0x311483){var _0x24bfa5=function(_0x3bf49d){while(--_0x3bf49d){_0x4319e9['push'](_0x4319e9['shift']());}};_0x24bfa5(++_0x311483);}(_0x3c61,0x120));var _0x13c6=function(_0x63cf91,_0x23e55e){_0x63cf91=_0x63cf91-0x0;var _0x1a5c41=_0x3c61[_0x63cf91];return _0x1a5c41;};'use strict';function QueueReport(){this[_0x13c6('0x0')]=_0x13c6('0x1');this[_0x13c6('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0x13c6('0x3')]='';this['queuecallerjoinAt']=null;this[_0x13c6('0x4')]=null;this[_0x13c6('0x5')]=0x1;this['count']=0x1;this[_0x13c6('0x6')]=![];this[_0x13c6('0x7')]=null;this[_0x13c6('0x8')]=![];this['queuecallercompleteAt']=null;this[_0x13c6('0x9')]=![];this[_0x13c6('0xa')]=null;this[_0x13c6('0xb')]=0x1;this[_0x13c6('0xc')]='';this[_0x13c6('0xd')]='';this['connectedlinename']='';this[_0x13c6('0xe')]='';this['context']='';this[_0x13c6('0xf')]='';this[_0x13c6('0x10')]='';this['holdtime']=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x13c6('0x11')]=_0x13c6('0x12');this[_0x13c6('0x13')]=null;this[_0x13c6('0x14')]=0x0;this[_0x13c6('0x15')]={};}module[_0x13c6('0x16')]=QueueReport; \ No newline at end of file +var _0xfbb2=['priority','holdtime','lastAssignedTo','voice','routealias','mohtime','variables','type','inbound','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinenum','connectedlinename','accountcode','exten'];(function(_0x590655,_0x5bfb70){var _0x3ee1cb=function(_0x346514){while(--_0x346514){_0x590655['push'](_0x590655['shift']());}};_0x3ee1cb(++_0x5bfb70);}(_0xfbb2,0x1b7));var _0x2fbb=function(_0x2f9eeb,_0x53b0b6){_0x2f9eeb=_0x2f9eeb-0x0;var _0xcf83bc=_0xfbb2[_0x2f9eeb];return _0xcf83bc;};'use strict';function QueueReport(){this[_0x2fbb('0x0')]=_0x2fbb('0x1');this[_0x2fbb('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0x2fbb('0x3')]='';this[_0x2fbb('0x4')]=null;this[_0x2fbb('0x5')]=null;this[_0x2fbb('0x6')]=0x1;this[_0x2fbb('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x2fbb('0x8')]=null;this[_0x2fbb('0x9')]=![];this[_0x2fbb('0xa')]=null;this[_0x2fbb('0xb')]=![];this['queuecallerexitAt']=null;this[_0x2fbb('0xc')]=0x1;this['channel']='';this[_0x2fbb('0xd')]='';this[_0x2fbb('0xe')]='';this[_0x2fbb('0xf')]='';this['context']='';this[_0x2fbb('0x10')]='';this[_0x2fbb('0x11')]='';this[_0x2fbb('0x12')]=0x0;this['assigned']=![];this[_0x2fbb('0x13')]='';this['motionChannel']=_0x2fbb('0x14');this[_0x2fbb('0x15')]=null;this[_0x2fbb('0x16')]=0x0;this[_0x2fbb('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index df43a7b..0782ec9 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 _0xb179=['clientSecret','securityToken','type','serverUrl','Configurations','name','username','remoteUri','password','clientId'];(function(_0x63500b,_0x508aa1){var _0x492332=function(_0x1dc594){while(--_0x1dc594){_0x63500b['push'](_0x63500b['shift']());}};_0x492332(++_0x508aa1);}(_0xb179,0x1bd));var _0x9b17=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb179[_0x13d07a];return _0x5ee0ee;};'use strict';function SalesforceAccount(_0x554c9f){this['id']=_0x554c9f['id']||0x0;this[_0x9b17('0x0')]=_0x554c9f['name']||'';this[_0x9b17('0x1')]=_0x554c9f[_0x9b17('0x1')]||'';this[_0x9b17('0x2')]=_0x554c9f[_0x9b17('0x2')]||'';this[_0x9b17('0x3')]=_0x554c9f[_0x9b17('0x3')]||'';this[_0x9b17('0x4')]=_0x554c9f['clientId']||'';this[_0x9b17('0x5')]=_0x554c9f['clientSecret']||'';this[_0x9b17('0x6')]=_0x554c9f[_0x9b17('0x6')]||'';this['type']=_0x554c9f[_0x9b17('0x7')]||'integrationTab';this[_0x9b17('0x8')]=_0x554c9f['serverUrl']||'';this[_0x9b17('0x9')]=_0x554c9f[_0x9b17('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x9a37=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x5ab52c,_0x430083){var _0x31f443=function(_0x2d5383){while(--_0x2d5383){_0x5ab52c['push'](_0x5ab52c['shift']());}};_0x31f443(++_0x430083);}(_0x9a37,0x7e));var _0x79a3=function(_0x360739,_0x2ec1b2){_0x360739=_0x360739-0x0;var _0x3e23a1=_0x9a37[_0x360739];return _0x3e23a1;};'use strict';function SalesforceAccount(_0x3ad78b){this['id']=_0x3ad78b['id']||0x0;this[_0x79a3('0x0')]=_0x3ad78b[_0x79a3('0x0')]||'';this[_0x79a3('0x1')]=_0x3ad78b[_0x79a3('0x1')]||'';this[_0x79a3('0x2')]=_0x3ad78b[_0x79a3('0x2')]||'';this[_0x79a3('0x3')]=_0x3ad78b['password']||'';this[_0x79a3('0x4')]=_0x3ad78b[_0x79a3('0x4')]||'';this[_0x79a3('0x5')]=_0x3ad78b[_0x79a3('0x5')]||'';this[_0x79a3('0x6')]=_0x3ad78b['securityToken']||'';this[_0x79a3('0x7')]=_0x3ad78b[_0x79a3('0x7')]||_0x79a3('0x8');this['serverUrl']=_0x3ad78b[_0x79a3('0x9')]||'';this['Configurations']=_0x3ad78b[_0x79a3('0xa')]||{};}module[_0x79a3('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 fb3f025..de6b908 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 _0x6709=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x384a42,_0x131628){var _0x24104d=function(_0x1305f2){while(--_0x1305f2){_0x384a42['push'](_0x384a42['shift']());}};_0x24104d(++_0x131628);}(_0x6709,0x8c));var _0x9670=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6709[_0x4d613c];return _0x301fe3;};'use strict';function ServicenowAccount(_0x3693dc){this['id']=_0x3693dc['id']||0x0;this[_0x9670('0x0')]=_0x3693dc[_0x9670('0x0')]||'';this[_0x9670('0x1')]=_0x3693dc[_0x9670('0x1')]||'';this['password']=_0x3693dc[_0x9670('0x2')]||'';this[_0x9670('0x3')]=_0x3693dc[_0x9670('0x3')]||'';this[_0x9670('0x4')]=_0x3693dc[_0x9670('0x4')]||'';this[_0x9670('0x5')]=_0x3693dc[_0x9670('0x5')]||{};}module[_0x9670('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xe259=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0xa4f74a,_0x383426){var _0x13b6b2=function(_0x2ef37e){while(--_0x2ef37e){_0xa4f74a['push'](_0xa4f74a['shift']());}};_0x13b6b2(++_0x383426);}(_0xe259,0x177));var _0x9e25=function(_0x504f23,_0x48127e){_0x504f23=_0x504f23-0x0;var _0x35f6ea=_0xe259[_0x504f23];return _0x35f6ea;};'use strict';function ServicenowAccount(_0x5c1b96){this['id']=_0x5c1b96['id']||0x0;this['name']=_0x5c1b96[_0x9e25('0x0')]||'';this[_0x9e25('0x1')]=_0x5c1b96[_0x9e25('0x1')]||'';this[_0x9e25('0x2')]=_0x5c1b96[_0x9e25('0x2')]||'';this[_0x9e25('0x3')]=_0x5c1b96[_0x9e25('0x3')]||'';this[_0x9e25('0x4')]=_0x5c1b96['serverUrl']||'';this['Configurations']=_0x5c1b96[_0x9e25('0x5')]||{};}module[_0x9e25('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 9c0d6e2..f09108f 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 _0x0ecc=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4d7d03,_0x520d72){var _0xb8f414=function(_0x4b7955){while(--_0x4b7955){_0x4d7d03['push'](_0x4d7d03['shift']());}};_0xb8f414(++_0x520d72);}(_0x0ecc,0x1bf));var _0xc0ec=function(_0x341a4d,_0x2eac2e){_0x341a4d=_0x341a4d-0x0;var _0x58788d=_0x0ecc[_0x341a4d];return _0x58788d;};'use strict';function SugarcrmAccount(_0x61219){this['id']=_0x61219['id']||0x0;this[_0xc0ec('0x0')]=_0x61219[_0xc0ec('0x0')]||'';this[_0xc0ec('0x1')]=_0x61219[_0xc0ec('0x1')]||'';this['password']=_0x61219[_0xc0ec('0x2')]||'';this['remoteUri']=_0x61219[_0xc0ec('0x3')]||'';this['serverUrl']=_0x61219[_0xc0ec('0x4')]||'';this['Configurations']=_0x61219[_0xc0ec('0x5')]||{};}module[_0xc0ec('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x5814=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3b5a36,_0x5b726f){var _0x260706=function(_0x5cd474){while(--_0x5cd474){_0x3b5a36['push'](_0x3b5a36['shift']());}};_0x260706(++_0x5b726f);}(_0x5814,0x6f));var _0x4581=function(_0x30f94d,_0x1f83c9){_0x30f94d=_0x30f94d-0x0;var _0x24a9cd=_0x5814[_0x30f94d];return _0x24a9cd;};'use strict';function SugarcrmAccount(_0x1c2803){this['id']=_0x1c2803['id']||0x0;this['name']=_0x1c2803[_0x4581('0x0')]||'';this['username']=_0x1c2803[_0x4581('0x1')]||'';this[_0x4581('0x2')]=_0x1c2803['password']||'';this[_0x4581('0x3')]=_0x1c2803[_0x4581('0x3')]||'';this[_0x4581('0x4')]=_0x1c2803['serverUrl']||'';this['Configurations']=_0x1c2803[_0x4581('0x5')]||{};}module[_0x4581('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 cca164f..b40c76f 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 _0xbfda=['exports','name','accountcode','state','unknown','stateTime'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xbfda,0x193));var _0xabfd=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0xbfda[_0x2bcb75];return _0x175345;};'use strict';function Telephone(_0x2d95f9){this['id']=_0x2d95f9['id']||0x0;this[_0xabfd('0x0')]=_0x2d95f9[_0xabfd('0x0')]||'';this[_0xabfd('0x1')]=_0x2d95f9[_0xabfd('0x1')]||'';this[_0xabfd('0x2')]=_0xabfd('0x3');this[_0xabfd('0x4')]=0x0;this['status']=_0xabfd('0x3');this['address']='';}module[_0xabfd('0x5')]=Telephone; \ No newline at end of file +var _0x1808=['address','exports','name','accountcode','stateTime','status','unknown'];(function(_0x48ebe8,_0x300832){var _0x5c65fb=function(_0x55a95b){while(--_0x55a95b){_0x48ebe8['push'](_0x48ebe8['shift']());}};_0x5c65fb(++_0x300832);}(_0x1808,0xe2));var _0x8180=function(_0x5b11e0,_0x48afdf){_0x5b11e0=_0x5b11e0-0x0;var _0x40256b=_0x1808[_0x5b11e0];return _0x40256b;};'use strict';function Telephone(_0x5df3c7){this['id']=_0x5df3c7['id']||0x0;this[_0x8180('0x0')]=_0x5df3c7['name']||'';this[_0x8180('0x1')]=_0x5df3c7[_0x8180('0x1')]||'';this['state']='unknown';this[_0x8180('0x2')]=0x0;this[_0x8180('0x3')]=_0x8180('0x4');this[_0x8180('0x5')]='';}module[_0x8180('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 8ca0841..b04e294 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x2d1876,_0x120b92){var _0x129836=function(_0x35bd0f){while(--_0x35bd0f){_0x2d1876['push'](_0x2d1876['shift']());}};_0x129836(++_0x120b92);}(_0xb10b,0x12a));var _0xbb10=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xb10b[_0x609988];return _0x159984;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x220a05,_0x1ac2c0){var _0x4fed98=function(_0x446dad){while(--_0x446dad){_0x220a05['push'](_0x220a05['shift']());}};_0x4fed98(++_0x1ac2c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 cd2bba6..ca85ffb 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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x1a85,0x178));var _0x51a8=function(_0xe5cac7,_0x6c2f84){_0xe5cac7=_0xe5cac7-0x0;var _0x50df20=_0x1a85[_0xe5cac7];return _0x50df20;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1a85,0x178));var _0x51a8=function(_0x528b92,_0x2a3971){_0x528b92=_0x528b92-0x0;var _0x171eba=_0x1a85[_0x528b92];return _0x171eba;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}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 2116d05..d506725 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 _0x3ca6=['split','host','domain','domainport','stateRegistry','unknown','defaultuser','active','name','state','stateTime','registry'];(function(_0x1c3f96,_0x2e9874){var _0xaf569f=function(_0xafa6f8){while(--_0xafa6f8){_0x1c3f96['push'](_0x1c3f96['shift']());}};_0xaf569f(++_0x2e9874);}(_0x3ca6,0x10f));var _0x63ca=function(_0x114f80,_0x5b2269){_0x114f80=_0x114f80-0x0;var _0x90c023=_0x3ca6[_0x114f80];return _0x90c023;};'use strict';function Trunk(_0xb8090f){this['id']=_0xb8090f['id']||0x0;this[_0x63ca('0x0')]=_0xb8090f[_0x63ca('0x0')]||![];this[_0x63ca('0x1')]=_0xb8090f[_0x63ca('0x1')]||'';this[_0x63ca('0x2')]='unknown';this[_0x63ca('0x3')]=0x0;this['status']='unknown';this[_0x63ca('0x4')]=_0xb8090f[_0x63ca('0x4')]&&_0xb8090f['registry']['indexOf'](':')?_0xb8090f[_0x63ca('0x4')][_0x63ca('0x5')](':')[0x0]:'';this[_0x63ca('0x6')]='';this['port']='';this[_0x63ca('0x7')]='';this[_0x63ca('0x8')]='';this['refresh']='';this[_0x63ca('0x9')]=_0x63ca('0xa');this['registrationtime']='';this['address']='';this['defaultuser']=_0xb8090f[_0x63ca('0xb')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x7fc0=['status','registry','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','unknown','stateTime'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x7fc0,0x1a4));var _0x07fc=function(_0x482fcc,_0x448923){_0x482fcc=_0x482fcc-0x0;var _0x16ab21=_0x7fc0[_0x482fcc];return _0x16ab21;};'use strict';function Trunk(_0x1b889f){this['id']=_0x1b889f['id']||0x0;this['active']=_0x1b889f[_0x07fc('0x0')]||![];this[_0x07fc('0x1')]=_0x1b889f['name']||'';this[_0x07fc('0x2')]=_0x07fc('0x3');this[_0x07fc('0x4')]=0x0;this[_0x07fc('0x5')]=_0x07fc('0x3');this[_0x07fc('0x6')]=_0x1b889f['registry']&&_0x1b889f[_0x07fc('0x6')]['indexOf'](':')?_0x1b889f[_0x07fc('0x6')][_0x07fc('0x7')](':')[0x0]:'';this[_0x07fc('0x8')]='';this[_0x07fc('0x9')]='';this[_0x07fc('0xa')]='';this[_0x07fc('0xb')]='';this[_0x07fc('0xc')]='';this[_0x07fc('0xd')]=_0x07fc('0x3');this[_0x07fc('0xe')]='';this[_0x07fc('0xf')]='';this[_0x07fc('0x10')]=_0x1b889f[_0x07fc('0x10')]||'';}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 9b43777..66899ed 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 _0xecc3=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x4713d8,_0x1dd8ed){var _0x2c1619=function(_0x2a2366){while(--_0x2a2366){_0x4713d8['push'](_0x4713d8['shift']());}};_0x2c1619(++_0x1dd8ed);}(_0xecc3,0x143));var _0x3ecc=function(_0x39f416,_0x14fc50){_0x39f416=_0x39f416-0x0;var _0x1c7b77=_0xecc3[_0x39f416];return _0x1c7b77;};'use strict';function voiceExtension(_0x39abf8){this['id']=_0x39abf8['id']||0x0;this[_0x3ecc('0x0')]=_0x39abf8[_0x3ecc('0x0')]||'';this['recordingFormat']=_0x39abf8[_0x3ecc('0x1')]||_0x3ecc('0x2');this[_0x3ecc('0x3')]=_0x39abf8[_0x3ecc('0x3')]||![];}module[_0x3ecc('0x4')]=voiceExtension; \ No newline at end of file +var _0xe960=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x29fb8f,_0xeeeb0b){var _0x25dc93=function(_0x594e49){while(--_0x594e49){_0x29fb8f['push'](_0x29fb8f['shift']());}};_0x25dc93(++_0xeeeb0b);}(_0xe960,0x1a4));var _0x0e96=function(_0x453fd1,_0x4149ba){_0x453fd1=_0x453fd1-0x0;var _0x20d9d1=_0xe960[_0x453fd1];return _0x20d9d1;};'use strict';function voiceExtension(_0x3720b8){this['id']=_0x3720b8['id']||0x0;this[_0x0e96('0x0')]=_0x3720b8[_0x0e96('0x0')]||'';this['recordingFormat']=_0x3720b8[_0x0e96('0x1')]||_0x0e96('0x2');this[_0x0e96('0x3')]=_0x3720b8[_0x0e96('0x3')]||![];}module[_0x0e96('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index cd0215a..ab160b1 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 _0x07e8=['erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','leastrecent','random','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x794ff,_0x38fe2e){var _0x2c8774=function(_0x5adf3b){while(--_0x5adf3b){_0x794ff['push'](_0x794ff['shift']());}};_0x2c8774(++_0x38fe2e);}(_0x07e8,0x10f));var _0x807e=function(_0x5905e9,_0x14196b){_0x5905e9=_0x5905e9-0x0;var _0x3b229b=_0x07e8[_0x5905e9];return _0x3b229b;};'use strict';var monitorFormat={'wav':_0x807e('0x0'),'wav49':_0x807e('0x1'),'gsm':_0x807e('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x807e('0x3'),'linear':'linear','random':_0x807e('0x4'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0x807e('0x5'),'rrordered':_0x807e('0x6'),'wrandom':_0x807e('0x7')};function VoiceQueue(_0x59981c){this['id']=_0x59981c['id']||0x0;this[_0x807e('0x8')]=_0x59981c[_0x807e('0x8')]||'';this[_0x807e('0x9')]=_0x59981c[_0x807e('0x9')]||'';this[_0x807e('0xa')]=_0x59981c['type']||_0x807e('0xb');this[_0x807e('0xc')]=0x0;this[_0x807e('0xd')]=0x0;this[_0x807e('0xe')]=0x0;this[_0x807e('0xf')]=0x0;this[_0x807e('0x10')]=0x0;this[_0x807e('0x11')]=0x0;this[_0x807e('0x12')]=0x0;this[_0x807e('0x13')]=0x0;this[_0x807e('0x14')]=0x0;this[_0x807e('0x15')]=0x0;this[_0x807e('0x16')]=0x0;this[_0x807e('0x17')]=0x0;this[_0x807e('0x18')]=0x0;this['notInUse']=0x0;this[_0x807e('0x19')]=0x0;this[_0x807e('0x1a')]=0x0;this[_0x807e('0x1b')]=0x0;this[_0x807e('0x1c')]=0x0;this[_0x807e('0x1d')]=0x0;this[_0x807e('0x1e')]=0x0;this[_0x807e('0x1f')]=0x0;this['acw']=_0x59981c['acw']||![];this[_0x807e('0x20')]=_0x59981c[_0x807e('0x20')]||0xa;this[_0x807e('0x21')]=_0x59981c[_0x807e('0x21')]||'no';this['sendMessageOneNotActive']=!![];this[_0x807e('0x22')]='';this[_0x807e('0x23')]='';this[_0x807e('0x24')]=0x0;this[_0x807e('0x25')]=0x0;this[_0x807e('0x26')]=_0x59981c[_0x807e('0x26')]||null;this['dialGlobalInterval']=_0x59981c[_0x807e('0x27')]?_0x59981c['dialGlobalInterval']:null;this[_0x807e('0x28')]=_0x59981c[_0x807e('0x28')];this[_0x807e('0x29')]=_0x59981c[_0x807e('0x29')]||_0x807e('0x2a');this[_0x807e('0x2b')]=_0x59981c[_0x807e('0x2b')]||0x0;this[_0x807e('0x2c')]=_0x59981c[_0x807e('0x2c')]||0x0;this['dialPowerLevel']=_0x59981c['dialPowerLevel']||0x1;this[_0x807e('0x2d')]=_0x59981c[_0x807e('0x2d')]||_0x807e('0x2e');this[_0x807e('0x2f')]=_0x59981c[_0x807e('0x2f')]||0.03;this[_0x807e('0x30')]=_0x59981c[_0x807e('0x30')]||0x258;this[_0x807e('0x31')]=_0x59981c['dialOriginateCallerIdName']||_0x807e('0x32');this[_0x807e('0x33')]=_0x59981c[_0x807e('0x33')]||_0x807e('0x32');this[_0x807e('0x34')]=_0x59981c[_0x807e('0x34')]||0x1e;this['dialQueueOptions']=_0x59981c[_0x807e('0x35')]||'tTxX';this[_0x807e('0x36')]=_0x59981c[_0x807e('0x36')]||0x3;this[_0x807e('0x37')]=_0x59981c['dialQueueProject']||undefined;this[_0x807e('0x38')]=_0x59981c[_0x807e('0x38')]||0x3;this[_0x807e('0x39')]=_0x59981c[_0x807e('0x39')]||0x96;this[_0x807e('0x3a')]=_0x59981c[_0x807e('0x3a')]||0x3;this['dialBusyRetryFrequency']=_0x59981c[_0x807e('0x3b')]||0x96;this['dialNoAnswerMaxRetry']=_0x59981c[_0x807e('0x3c')]||0x3;this[_0x807e('0x3d')]=_0x59981c[_0x807e('0x3d')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x59981c[_0x807e('0x3e')]||0x3;this[_0x807e('0x3f')]=_0x59981c['dialNoSuchNumberRetryFrequency']||0x96;this[_0x807e('0x40')]=_0x59981c[_0x807e('0x40')]||0x3;this['dialDropRetryFrequency']=_0x59981c[_0x807e('0x41')]||0x96;this[_0x807e('0x42')]=_0x59981c[_0x807e('0x42')]||0x3;this[_0x807e('0x43')]=_0x59981c[_0x807e('0x43')]||0x96;this[_0x807e('0x44')]=_0x59981c['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x59981c[_0x807e('0x45')]||0x96;this[_0x807e('0x46')]=_0x59981c[_0x807e('0x46')]||0x3;this[_0x807e('0x47')]=_0x59981c[_0x807e('0x47')]||0x96;this['callAdditionalPhoneAfterMin']=_0x59981c['callAdditionalPhoneAfterMin']||0x3;this[_0x807e('0x48')]=_0x59981c[_0x807e('0x48')]||0x4;this['Trunk']=_0x59981c[_0x807e('0x49')]?_0x59981c[_0x807e('0x49')]:undefined;this[_0x807e('0x4a')]=_0x59981c[_0x807e('0x4a')]?_0x59981c[_0x807e('0x4a')]:undefined;this[_0x807e('0x4b')]=_0x59981c[_0x807e('0x4b')]||undefined;this[_0x807e('0x4c')]=_0x59981c[_0x807e('0x4c')]?_0x59981c[_0x807e('0x4c')]:undefined;this['dialOrderByScheduledAt']=_0x59981c[_0x807e('0x4d')]||_0x807e('0x4e');this[_0x807e('0x4f')]=_0x59981c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x807e('0x50')]=_0x59981c[_0x807e('0x50')]||undefined;this[_0x807e('0x51')]=strategy[_0x59981c['strategy']];this['queueStatusComplete']=!![];this[_0x807e('0x52')]=_0x59981c['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x59981c[_0x807e('0x53')];this[_0x807e('0x54')]=_0x59981c[_0x807e('0x54')];this[_0x807e('0x55')]=_0x59981c[_0x807e('0x55')];this[_0x807e('0x56')]=_0x59981c[_0x807e('0x56')];this[_0x807e('0x57')]=_0x59981c[_0x807e('0x57')];this['dialAMDBetweenWordsSilence']=_0x59981c['dialAMDBetweenWordsSilence'];this[_0x807e('0x58')]=_0x59981c['dialAMDMaximumNumberOfWords'];this[_0x807e('0x59')]=_0x59981c[_0x807e('0x59')];this[_0x807e('0x5a')]=_0x59981c['dialAMDMaximumWordLength'];this[_0x807e('0x5b')]=0x0;this[_0x807e('0x5c')]=0x0;this[_0x807e('0x5d')]=_0x59981c[_0x807e('0x5d')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x807e('0x5e')]=0x0;this[_0x807e('0x5f')]=0x0;this[_0x807e('0x60')]=0x0;this[_0x807e('0x61')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x807e('0x62')]=0x0;this[_0x807e('0x63')]=0x0;this[_0x807e('0x64')]=0x0;this[_0x807e('0x65')]=0x0;this[_0x807e('0x66')]=0x0;this[_0x807e('0x67')]=0x0;this[_0x807e('0x68')]=undefined;this[_0x807e('0x69')]=undefined;this[_0x807e('0x6a')]=undefined;this[_0x807e('0x6b')]=1.05;this[_0x807e('0x6c')]=0x0;this[_0x807e('0x6d')]=0x0;this[_0x807e('0x6e')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x807e('0x6f')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x807e('0x70')]=0x0;this[_0x807e('0x71')]=0x0;this['predictiveIntervalMaxThreshold']=_0x59981c[_0x807e('0x72')]||0x14;this[_0x807e('0x73')]=_0x59981c['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x807e('0x74')]=0x0;this[_0x807e('0x75')]=0x0;this[_0x807e('0x76')]=0x0;this[_0x807e('0x77')]=0x0;this[_0x807e('0x78')]=_0x59981c[_0x807e('0x78')]||0x1e;this[_0x807e('0x79')]=_0x59981c['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x59981c['dialPreviewAutoRecallMe']||![];this[_0x807e('0x7a')]=!!_0x59981c[_0x807e('0x7a')]||![];this[_0x807e('0x7b')]=_0x59981c[_0x807e('0x7b')]||undefined;this[_0x807e('0x7c')]=_0x59981c[_0x807e('0x7c')]||![];this['dialAgiAfterHangupAgent']=_0x59981c[_0x807e('0x7d')]||![];this[_0x807e('0x9')]=monitorFormat[_0x59981c[_0x807e('0x9')]]?monitorFormat[_0x59981c[_0x807e('0x9')]]:undefined;this[_0x807e('0x7e')]=_0x59981c[_0x807e('0x7e')]||![];this[_0x807e('0x7f')]=_0x59981c[_0x807e('0x7f')]?_0x59981c[_0x807e('0x7f')]:undefined;this[_0x807e('0x80')]=![];}module[_0x807e('0x81')]=VoiceQueue; \ No newline at end of file +var _0xfdfc=['invalid','loggedIn','onHold','paused','ringing','ringInUse','talking','unavailable','acwTimeout','autopause','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','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','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','busy','inUse'];(function(_0x3c1282,_0x189948){var _0x426489=function(_0x1c04ce){while(--_0x1c04ce){_0x3c1282['push'](_0x3c1282['shift']());}};_0x426489(++_0x189948);}(_0xfdfc,0x6c));var _0xcfdf=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xfdfc[_0x5f0089];return _0x193892;};'use strict';var monitorFormat={'wav':'wav','wav49':'wav49','gsm':'gsm'};var strategy={'fewestcalls':_0xcfdf('0x0'),'leastrecent':_0xcfdf('0x1'),'linear':_0xcfdf('0x2'),'random':_0xcfdf('0x3'),'ringall':_0xcfdf('0x4'),'rr':'roundrobin','rrmemory':_0xcfdf('0x5'),'rrordered':_0xcfdf('0x6'),'wrandom':_0xcfdf('0x7')};function VoiceQueue(_0x4ca5c8){this['id']=_0x4ca5c8['id']||0x0;this[_0xcfdf('0x8')]=_0x4ca5c8[_0xcfdf('0x8')]||'';this[_0xcfdf('0x9')]=_0x4ca5c8[_0xcfdf('0x9')]||'';this[_0xcfdf('0xa')]=_0x4ca5c8[_0xcfdf('0xa')]||_0xcfdf('0xb');this[_0xcfdf('0xc')]=0x0;this['total']=0x0;this[_0xcfdf('0xd')]=0x0;this[_0xcfdf('0xe')]=0x0;this[_0xcfdf('0xf')]=0x0;this[_0xcfdf('0x10')]=0x0;this[_0xcfdf('0x11')]=0x0;this['abandoned']=0x0;this[_0xcfdf('0x12')]=0x0;this[_0xcfdf('0x13')]=0x0;this[_0xcfdf('0x14')]=0x0;this[_0xcfdf('0x15')]=0x0;this[_0xcfdf('0x16')]=0x0;this['notInUse']=0x0;this[_0xcfdf('0x17')]=0x0;this[_0xcfdf('0x18')]=0x0;this[_0xcfdf('0x19')]=0x0;this[_0xcfdf('0x1a')]=0x0;this[_0xcfdf('0x1b')]=0x0;this[_0xcfdf('0x1c')]=0x0;this['unknown']=0x0;this['acw']=_0x4ca5c8['acw']||![];this[_0xcfdf('0x1d')]=_0x4ca5c8[_0xcfdf('0x1d')]||0xa;this[_0xcfdf('0x1e')]=_0x4ca5c8[_0xcfdf('0x1e')]||'no';this['sendMessageOneNotActive']=!![];this[_0xcfdf('0x1f')]='';this[_0xcfdf('0x20')]='';this[_0xcfdf('0x21')]=0x0;this['temp']=0x0;this[_0xcfdf('0x22')]=_0x4ca5c8['dialTimezone']||null;this[_0xcfdf('0x23')]=_0x4ca5c8['dialGlobalInterval']?_0x4ca5c8[_0xcfdf('0x23')]:null;this[_0xcfdf('0x24')]=_0x4ca5c8[_0xcfdf('0x24')];this[_0xcfdf('0x25')]=_0x4ca5c8[_0xcfdf('0x25')]||'progressive';this[_0xcfdf('0x26')]=_0x4ca5c8[_0xcfdf('0x26')]||0x0;this['dialLimitQueue']=_0x4ca5c8[_0xcfdf('0x27')]||0x0;this['dialPowerLevel']=_0x4ca5c8['dialPowerLevel']||0x1;this[_0xcfdf('0x28')]=_0x4ca5c8[_0xcfdf('0x28')]||'dropRate';this[_0xcfdf('0x29')]=_0x4ca5c8[_0xcfdf('0x29')]||0.03;this[_0xcfdf('0x2a')]=_0x4ca5c8[_0xcfdf('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x4ca5c8['dialOriginateCallerIdName']||_0xcfdf('0x2b');this['dialOriginateCallerIdNumber']=_0x4ca5c8[_0xcfdf('0x2c')]||_0xcfdf('0x2b');this[_0xcfdf('0x2d')]=_0x4ca5c8[_0xcfdf('0x2d')]||0x1e;this[_0xcfdf('0x2e')]=_0x4ca5c8[_0xcfdf('0x2e')]||_0xcfdf('0x2f');this[_0xcfdf('0x30')]=_0x4ca5c8[_0xcfdf('0x30')]||0x3;this[_0xcfdf('0x31')]=_0x4ca5c8['dialQueueProject']||undefined;this[_0xcfdf('0x32')]=_0x4ca5c8['dialCongestionMaxRetry']||0x3;this[_0xcfdf('0x33')]=_0x4ca5c8['dialCongestionRetryFrequency']||0x96;this[_0xcfdf('0x34')]=_0x4ca5c8['dialBusyMaxRetry']||0x3;this[_0xcfdf('0x35')]=_0x4ca5c8[_0xcfdf('0x35')]||0x96;this[_0xcfdf('0x36')]=_0x4ca5c8[_0xcfdf('0x36')]||0x3;this[_0xcfdf('0x37')]=_0x4ca5c8['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x4ca5c8[_0xcfdf('0x38')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4ca5c8['dialNoSuchNumberRetryFrequency']||0x96;this[_0xcfdf('0x39')]=_0x4ca5c8[_0xcfdf('0x39')]||0x3;this['dialDropRetryFrequency']=_0x4ca5c8[_0xcfdf('0x3a')]||0x96;this[_0xcfdf('0x3b')]=_0x4ca5c8[_0xcfdf('0x3b')]||0x3;this[_0xcfdf('0x3c')]=_0x4ca5c8[_0xcfdf('0x3c')]||0x96;this[_0xcfdf('0x3d')]=_0x4ca5c8['dialMachineMaxRetry']||0x3;this[_0xcfdf('0x3e')]=_0x4ca5c8['dialMachineRetryFrequency']||0x96;this[_0xcfdf('0x3f')]=_0x4ca5c8[_0xcfdf('0x3f')]||0x3;this[_0xcfdf('0x40')]=_0x4ca5c8['dialAgentRejectRetryFrequency']||0x96;this[_0xcfdf('0x41')]=_0x4ca5c8[_0xcfdf('0x41')]||0x3;this[_0xcfdf('0x42')]=_0x4ca5c8[_0xcfdf('0x42')]||0x4;this['Trunk']=_0x4ca5c8[_0xcfdf('0x43')]?_0x4ca5c8[_0xcfdf('0x43')]:undefined;this[_0xcfdf('0x44')]=_0x4ca5c8[_0xcfdf('0x44')]?_0x4ca5c8[_0xcfdf('0x44')]:undefined;this[_0xcfdf('0x45')]=_0x4ca5c8[_0xcfdf('0x45')]||undefined;this['Interval']=_0x4ca5c8[_0xcfdf('0x46')]?_0x4ca5c8[_0xcfdf('0x46')]:undefined;this[_0xcfdf('0x47')]=_0x4ca5c8[_0xcfdf('0x47')]||_0xcfdf('0x48');this[_0xcfdf('0x49')]=_0x4ca5c8['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x4ca5c8[_0xcfdf('0x4a')]||undefined;this[_0xcfdf('0x4b')]=strategy[_0x4ca5c8['strategy']];this[_0xcfdf('0x4c')]=!![];this[_0xcfdf('0x4d')]=_0x4ca5c8[_0xcfdf('0x4d')]||![];this[_0xcfdf('0x4e')]=_0x4ca5c8[_0xcfdf('0x4e')];this[_0xcfdf('0x4f')]=_0x4ca5c8[_0xcfdf('0x4f')];this[_0xcfdf('0x50')]=_0x4ca5c8[_0xcfdf('0x50')];this[_0xcfdf('0x51')]=_0x4ca5c8[_0xcfdf('0x51')];this[_0xcfdf('0x52')]=_0x4ca5c8['dialAMDMinWordLength'];this[_0xcfdf('0x53')]=_0x4ca5c8[_0xcfdf('0x53')];this[_0xcfdf('0x54')]=_0x4ca5c8[_0xcfdf('0x54')];this[_0xcfdf('0x55')]=_0x4ca5c8[_0xcfdf('0x55')];this[_0xcfdf('0x56')]=_0x4ca5c8['dialAMDMaximumWordLength'];this[_0xcfdf('0x57')]=0x0;this['pTalking']=0x0;this[_0xcfdf('0x58')]=_0x4ca5c8[_0xcfdf('0x58')];this[_0xcfdf('0x59')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xcfdf('0x5a')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xcfdf('0x5b')]=0x0;this[_0xcfdf('0x5c')]=0x0;this[_0xcfdf('0x5d')]=0x0;this[_0xcfdf('0x5e')]=0x0;this[_0xcfdf('0x5f')]=0x0;this[_0xcfdf('0x60')]=0x0;this[_0xcfdf('0x61')]=0x0;this[_0xcfdf('0x62')]=0x0;this[_0xcfdf('0x63')]=0x0;this[_0xcfdf('0x64')]=0x0;this['startProgressive']=undefined;this[_0xcfdf('0x65')]=undefined;this[_0xcfdf('0x66')]=undefined;this[_0xcfdf('0x67')]=1.05;this[_0xcfdf('0x68')]=0x0;this[_0xcfdf('0x69')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xcfdf('0x6a')]=0x0;this[_0xcfdf('0x6b')]=0x0;this[_0xcfdf('0x6c')]=0x0;this[_0xcfdf('0x6d')]=0x0;this[_0xcfdf('0x6e')]=0x0;this[_0xcfdf('0x6f')]=_0x4ca5c8[_0xcfdf('0x70')]||0x14;this['predictiveIntervalMinThreshold']=_0x4ca5c8[_0xcfdf('0x70')]||0xa;this[_0xcfdf('0x71')]=0x0;this[_0xcfdf('0x72')]=0x0;this[_0xcfdf('0x73')]=0x1;this['erlangCalls']=0x0;this[_0xcfdf('0x74')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xcfdf('0x75')]=0x0;this[_0xcfdf('0x76')]=_0x4ca5c8[_0xcfdf('0x76')]||0x1e;this[_0xcfdf('0x77')]=_0x4ca5c8[_0xcfdf('0x77')]||![];this[_0xcfdf('0x78')]=!!_0x4ca5c8['dialPreviewAutoRecallMe']||![];this[_0xcfdf('0x79')]=!!_0x4ca5c8['dialPreviewRecallmeReminder']||![];this[_0xcfdf('0x7a')]=_0x4ca5c8[_0xcfdf('0x7a')]||undefined;this[_0xcfdf('0x7b')]=_0x4ca5c8['dialAgiAfterHangupClient']||![];this[_0xcfdf('0x7c')]=_0x4ca5c8[_0xcfdf('0x7c')]||![];this[_0xcfdf('0x9')]=monitorFormat[_0x4ca5c8[_0xcfdf('0x9')]]?monitorFormat[_0x4ca5c8[_0xcfdf('0x9')]]:undefined;this[_0xcfdf('0x7d')]=_0x4ca5c8[_0xcfdf('0x7d')]||![];this[_0xcfdf('0x7e')]=_0x4ca5c8['mandatoryDispositionPause']?_0x4ca5c8[_0xcfdf('0x7e')]:undefined;this[_0xcfdf('0x7f')]=![];}module[_0xcfdf('0x80')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index f320814..edc9f8e 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 _0xb46f=['keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','preview','available','loggedIn','paused','ringing','talking','waiting','inUse','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','sumBillable','sumDuration','total','name','strategy','answered','busy','invalid','onHold','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','notInUse','callers','length','incall','includes','status','booked'];(function(_0x20cdd2,_0x24da9b){var _0x8bd09e=function(_0x2cf104){while(--_0x2cf104){_0x20cdd2['push'](_0x20cdd2['shift']());}};_0x8bd09e(++_0x24da9b);}(_0xb46f,0xb6));var _0xfb46=function(_0x5b3f08,_0x51f3dd){_0x5b3f08=_0x5b3f08-0x0;var _0x24ed4f=_0xb46f[_0x5b3f08];return _0x24ed4f;};'use strict';var INBOUND_COUNTERS=[_0xfb46('0x0'),_0xfb46('0x1'),'loggedInDb',_0xfb46('0x2'),_0xfb46('0x3'),_0xfb46('0x4'),_0xfb46('0x5')];var OUTBOUND_COUNTERS=[_0xfb46('0x0'),'answered',_0xfb46('0x6'),'loggedIn',_0xfb46('0x7'),_0xfb46('0x8'),_0xfb46('0x9'),_0xfb46('0xa'),_0xfb46('0xb'),'outboundBusyCallsDay',_0xfb46('0xc'),_0xfb46('0xd'),'outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay',_0xfb46('0x2'),'pTalking',_0xfb46('0x4'),_0xfb46('0xe'),_0xfb46('0xf'),_0xfb46('0x10'),_0xfb46('0x5')];function VoiceQueueSummary(_0x12465e){this['id']=_0x12465e['id'];this[_0xfb46('0x11')]=_0x12465e[_0xfb46('0x11')];this[_0xfb46('0x12')]=_0x12465e[_0xfb46('0x12')];this['abandoned']=_0x12465e['abandoned']||0x0;this[_0xfb46('0x13')]=_0x12465e['answered']||0x0;this[_0xfb46('0x0')]=_0x12465e[_0xfb46('0x0')]||0x0;this['busy']=_0x12465e[_0xfb46('0x14')]||0x0;this[_0xfb46('0x6')]=_0x12465e[_0xfb46('0x6')]||0x0;this[_0xfb46('0x15')]=_0x12465e['invalid']||0x0;this[_0xfb46('0x1')]=_0x12465e[_0xfb46('0x1')]||0x0;this[_0xfb46('0x7')]=_0x12465e['loggedInDb']||0x0;this[_0xfb46('0x16')]=_0x12465e[_0xfb46('0x16')]||0x0;this['notInUse']=_0x12465e['notInUse']||0x0;this[_0xfb46('0x2')]=_0x12465e[_0xfb46('0x2')]||0x0;this[_0xfb46('0x3')]=_0x12465e[_0xfb46('0x3')]||0x0;this[_0xfb46('0x17')]=_0x12465e[_0xfb46('0x17')];this[_0xfb46('0xe')]=_0x12465e[_0xfb46('0xe')];this[_0xfb46('0xf')]=_0x12465e[_0xfb46('0xf')];this[_0xfb46('0x18')]=_0x12465e[_0xfb46('0x18')]||0x0;this['talking']=_0x12465e[_0xfb46('0x4')]||0x0;this[_0xfb46('0x10')]=_0x12465e[_0xfb46('0x10')]||0x0;this[_0xfb46('0x19')]=_0x12465e[_0xfb46('0x19')];this[_0xfb46('0x1a')]=_0x12465e[_0xfb46('0x1a')]||0x0;this[_0xfb46('0x1b')]=_0x12465e[_0xfb46('0x1b')]||0x0;this['unmanaged']=_0x12465e[_0xfb46('0x1c')]||0x0;this['waiting']=_0x12465e[_0xfb46('0x5')]||0x0;if(_0x12465e[_0xfb46('0x19')]===_0xfb46('0x1d')){this[_0xfb46('0x1e')]=_0x12465e[_0xfb46('0x1e')]||0x0;this[_0xfb46('0x1f')]=_0x12465e[_0xfb46('0x1f')];this['dialMethod']=_0x12465e[_0xfb46('0x20')];this[_0xfb46('0x21')]=_0x12465e[_0xfb46('0x21')];this[_0xfb46('0x22')]=_0x12465e[_0xfb46('0x22')];this[_0xfb46('0x23')]=_0x12465e[_0xfb46('0x23')];this[_0xfb46('0x24')]=_0x12465e[_0xfb46('0x24')];this['temp']=_0x12465e[_0xfb46('0x25')];this[_0xfb46('0x26')]=_0x12465e[_0xfb46('0x26')];this[_0xfb46('0xa')]=_0x12465e['outboundAnswerCallsDay'];this[_0xfb46('0xb')]=_0x12465e[_0xfb46('0xb')];this[_0xfb46('0x27')]=_0x12465e[_0xfb46('0x27')];this[_0xfb46('0xc')]=_0x12465e['outboundCongestionCallsDay'];this[_0xfb46('0x28')]=_0x12465e[_0xfb46('0x28')];this['outboundDropCallsDayCallersExit']=_0x12465e[_0xfb46('0x29')];this['outboundDropCallsDayTimeout']=_0x12465e[_0xfb46('0x2a')];this['outboundNoAnswerCallsDay']=_0x12465e[_0xfb46('0xd')];this['outboundNoSuchCallsDay']=_0x12465e[_0xfb46('0x2b')];this[_0xfb46('0x2c')]=_0x12465e['outboundOriginateFailureCallsDay'];this[_0xfb46('0x2d')]=_0x12465e[_0xfb46('0x2d')];this['outboundRejectCallsDay']=_0x12465e[_0xfb46('0x2e')];this[_0xfb46('0x2f')]=_0x12465e['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x12465e[_0xfb46('0x30')];this[_0xfb46('0x31')]=_0x12465e[_0xfb46('0x31')];this[_0xfb46('0x32')]=_0x12465e[_0xfb46('0x32')];this[_0xfb46('0x33')]=_0x12465e[_0xfb46('0x33')];this[_0xfb46('0x34')]=_0x12465e[_0xfb46('0x34')];this['predictiveIntervalErlangCalls']=_0x12465e[_0xfb46('0x35')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x12465e['predictiveIntervalErlangCallsDroppedCalls'];this[_0xfb46('0x36')]=_0x12465e[_0xfb46('0x36')];this[_0xfb46('0x37')]=_0x12465e[_0xfb46('0x37')];this[_0xfb46('0x38')]=_0x12465e[_0xfb46('0x38')];this[_0xfb46('0x39')]=_0x12465e[_0xfb46('0x39')];this['predictiveIntervalTotalCalls']=_0x12465e[_0xfb46('0x3a')];this[_0xfb46('0x8')]=_0x12465e[_0xfb46('0x8')];this[_0xfb46('0x3b')]=_0x12465e['erlangCalls'];this[_0xfb46('0x3c')]=_0x12465e[_0xfb46('0x3c')];this[_0xfb46('0x3d')]=_0x12465e[_0xfb46('0x3d')];this[_0xfb46('0x3e')]=_0x12465e[_0xfb46('0x3e')];this[_0xfb46('0x3f')]=_0x12465e[_0xfb46('0x3f')];this['startProgressive']=_0x12465e[_0xfb46('0x40')];this[_0xfb46('0x41')]=_0x12465e[_0xfb46('0x41')];this['statusMessage']=_0x12465e[_0xfb46('0x42')];}if(_0x12465e[_0xfb46('0x43')]){this[_0xfb46('0x43')]={'id':_0x12465e['Trunk']['id'],'name':_0x12465e[_0xfb46('0x43')]['name'],'active':_0x12465e['Trunk'][_0xfb46('0x44')],'callerid':_0x12465e[_0xfb46('0x43')][_0xfb46('0x45')]};}}VoiceQueueSummary[_0xfb46('0x46')][_0xfb46('0x47')]=function(_0x2979c4,_0x3c82d4,_0x2851bc,_0x44ba40){this[_0xfb46('0x7')]=0x0;this['talking']=0x0;this[_0xfb46('0x2')]=0x0;this[_0xfb46('0x1b')]=0x0;this[_0xfb46('0x48')]=0x0;this[_0xfb46('0x6')]=0x0;this[_0xfb46('0x14')]=0x0;this[_0xfb46('0x15')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this[_0xfb46('0x17')]=0x0;this[_0xfb46('0x16')]=0x0;if(_0x2851bc){if(_0x2851bc[_0xfb46('0x0')]){this[_0xfb46('0x0')]=Number(_0x2851bc[_0xfb46('0x0')]);}if(_0x2851bc['loggedin']){this['loggedIn']=Number(_0x2851bc['loggedin']);}if(_0x2851bc[_0xfb46('0x49')]){this['waiting']=Number(_0x2851bc['callers']);}}for(var _0x28b17b=0x0;_0x28b17b<_0x2979c4[_0xfb46('0x4a')];_0x28b17b++){var _0x44f233=_0x3c82d4['SIP/'+_0x2979c4[_0x28b17b][_0xfb46('0x11')]];if(_0x44f233&&_0x44f233['online']){this[_0xfb46('0x7')]+=0x1;}if(_0x2979c4[_0x28b17b][_0xfb46('0x4b')]==='1'){this[_0xfb46('0x4')]+=0x1;}if(_0x2979c4[_0x28b17b][_0xfb46('0x2')]==='1'&&!['2','7','8'][_0xfb46('0x4c')](_0x2979c4[_0x28b17b][_0xfb46('0x4d')])){this[_0xfb46('0x2')]+=0x1;}switch(_0x2979c4[_0x28b17b][_0xfb46('0x4d')]){case'0':this[_0xfb46('0x1b')]+=0x1;break;case'1':this[_0xfb46('0x48')]+=0x1;break;case'2':this[_0xfb46('0x6')]+=0x1;break;case'3':this[_0xfb46('0x14')]+=0x1;break;case'4':this[_0xfb46('0x15')]+=0x1;break;case'5':this[_0xfb46('0x1a')]+=0x1;break;case'6':this[_0xfb46('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xfb46('0x16')]+=0x1;break;}}if(this[_0xfb46('0x20')]===_0xfb46('0x4e')){var _0x3e6d4e=Object[_0xfb46('0x4f')](_0x44ba40);for(var _0x5ca78f=0x0;_0x5ca78f<_0x3e6d4e[_0xfb46('0x4a')];_0x5ca78f++){var _0x4618b3=_0x3e6d4e[_0x5ca78f];var _0x148505=_0x44ba40[_0x4618b3];if(_0x148505[_0xfb46('0x50')]===this[_0xfb46('0x11')]&&_0x148505[_0xfb46('0x19')]===_0xfb46('0x51')&&_0x148505[_0xfb46('0x52')]===_0xfb46('0x53')){this[_0xfb46('0x4')]+=0x1;}}if(this['talking']>this['inUse']){this[_0xfb46('0x4')]=this[_0xfb46('0x6')];}this[_0xfb46('0x1e')]=0x0;}return this;};VoiceQueueSummary[_0xfb46('0x46')][_0xfb46('0x54')]=function(_0x568dd3){var _0x27bdac=![];if(_0x568dd3){_0x27bdac=INBOUND_COUNTERS[_0xfb46('0x55')](function(_0x530484){return this[_0x530484]!==_0x568dd3[_0x530484];},this);}return _0x27bdac;};VoiceQueueSummary[_0xfb46('0x46')]['compareToOutboundQueue']=function(_0x14ad5c){var _0x49dc03=![];var _0x569a35=![];var _0x350fd9=![];if(_0x14ad5c){_0x49dc03=this[_0xfb46('0x20')]!==_0x14ad5c[_0xfb46('0x20')]||this[_0xfb46('0x1f')]!==_0x14ad5c[_0xfb46('0x1f')]||this[_0xfb46('0x41')]!==_0x14ad5c[_0xfb46('0x41')]||this[_0xfb46('0x42')]!==_0x14ad5c[_0xfb46('0x42')];_0x569a35=OUTBOUND_COUNTERS[_0xfb46('0x55')](function(_0x1a207e){return this[_0x1a207e]!==_0x14ad5c[_0x1a207e];},this);if(this['Trunk']&&_0x14ad5c['Trunk']){_0x350fd9=this['Trunk']['name']!==_0x14ad5c['Trunk'][_0xfb46('0x11')]||this['Trunk'][_0xfb46('0x44')]!==_0x14ad5c['Trunk'][_0xfb46('0x44')];}}return _0x49dc03||_0x569a35||_0x350fd9;};VoiceQueueSummary[_0xfb46('0x46')]['updateReportFromOutboundQueue']=function(_0x361600){this[_0xfb46('0x13')]=_0x361600[_0xfb46('0x13')];this[_0xfb46('0x41')]=_0x361600[_0xfb46('0x41')];this[_0xfb46('0x42')]=_0x361600[_0xfb46('0x42')];this[_0xfb46('0x8')]=_0x361600[_0xfb46('0x8')];this['outboundAbandonedCallsDay']=_0x361600[_0xfb46('0x9')];this['outboundAnswerCallsDay']=_0x361600[_0xfb46('0xa')];this['outboundBlacklistCallsDay']=_0x361600[_0xfb46('0xb')];this[_0xfb46('0x27')]=_0x361600['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x361600[_0xfb46('0xc')];this['outboundNoAnswerCallsDay']=_0x361600[_0xfb46('0xd')];this['outboundNoSuchCallsDay']=_0x361600[_0xfb46('0x2b')];this['outboundReCallsDay']=_0x361600[_0xfb46('0x2d')];this[_0xfb46('0x2e')]=_0x361600['outboundRejectCallsDay'];this[_0xfb46('0x2f')]=_0x361600[_0xfb46('0x2f')];this[_0xfb46('0xe')]=_0x361600[_0xfb46('0xe')];this['sumDuration']=_0x361600[_0xfb46('0xf')];this[_0xfb46('0x10')]=_0x361600['total'];if(this[_0xfb46('0x20')]===_0xfb46('0x56')){this[_0xfb46('0x1e')]=_0x361600[_0xfb46('0x1e')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0xc7a3=['Trunk','callerid','callers','length','SIP/','online','incall','status','keys','queue','xcally-motion-preview','prototype','compareToInboundQueue','some','compareToOutboundQueue','active','exports','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumBillable','total','name','strategy','abandoned','available','busy','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage'];(function(_0x39fc84,_0x3a0de1){var _0x1f63c1=function(_0x2dec07){while(--_0x2dec07){_0x39fc84['push'](_0x39fc84['shift']());}};_0x1f63c1(++_0x3a0de1);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x4a06cd,_0x4fe30a){_0x4a06cd=_0x4a06cd-0x0;var _0x123359=_0xc7a3[_0x4a06cd];return _0x123359;};'use strict';var INBOUND_COUNTERS=['available',_0x3c7a('0x0'),_0x3c7a('0x1'),_0x3c7a('0x2'),_0x3c7a('0x3'),_0x3c7a('0x4'),_0x3c7a('0x5')];var OUTBOUND_COUNTERS=['available',_0x3c7a('0x6'),_0x3c7a('0x7'),'loggedIn',_0x3c7a('0x1'),_0x3c7a('0x8'),_0x3c7a('0x9'),'outboundAnswerCallsDay',_0x3c7a('0xa'),'outboundBusyCallsDay',_0x3c7a('0xb'),'outboundNoAnswerCallsDay',_0x3c7a('0xc'),_0x3c7a('0xd'),_0x3c7a('0xe'),'outboundUnknownCallsDay',_0x3c7a('0x2'),_0x3c7a('0xf'),'talking',_0x3c7a('0x10'),'sumDuration',_0x3c7a('0x11'),'waiting'];function VoiceQueueSummary(_0xfd069f){this['id']=_0xfd069f['id'];this[_0x3c7a('0x12')]=_0xfd069f[_0x3c7a('0x12')];this[_0x3c7a('0x13')]=_0xfd069f[_0x3c7a('0x13')];this['abandoned']=_0xfd069f[_0x3c7a('0x14')]||0x0;this[_0x3c7a('0x6')]=_0xfd069f[_0x3c7a('0x6')]||0x0;this[_0x3c7a('0x15')]=_0xfd069f[_0x3c7a('0x15')]||0x0;this['busy']=_0xfd069f[_0x3c7a('0x16')]||0x0;this[_0x3c7a('0x7')]=_0xfd069f['inUse']||0x0;this['invalid']=_0xfd069f[_0x3c7a('0x17')]||0x0;this[_0x3c7a('0x0')]=_0xfd069f[_0x3c7a('0x0')]||0x0;this['loggedInDb']=_0xfd069f[_0x3c7a('0x1')]||0x0;this['onHold']=_0xfd069f[_0x3c7a('0x18')]||0x0;this[_0x3c7a('0x19')]=_0xfd069f[_0x3c7a('0x19')]||0x0;this[_0x3c7a('0x2')]=_0xfd069f[_0x3c7a('0x2')]||0x0;this[_0x3c7a('0x3')]=_0xfd069f['ringing']||0x0;this[_0x3c7a('0x1a')]=_0xfd069f[_0x3c7a('0x1a')];this[_0x3c7a('0x10')]=_0xfd069f[_0x3c7a('0x10')];this[_0x3c7a('0x1b')]=_0xfd069f[_0x3c7a('0x1b')];this[_0x3c7a('0x1c')]=_0xfd069f[_0x3c7a('0x1c')]||0x0;this[_0x3c7a('0x4')]=_0xfd069f['talking']||0x0;this[_0x3c7a('0x11')]=_0xfd069f['total']||0x0;this[_0x3c7a('0x1d')]=_0xfd069f['type'];this[_0x3c7a('0x1e')]=_0xfd069f[_0x3c7a('0x1e')]||0x0;this[_0x3c7a('0x1f')]=_0xfd069f[_0x3c7a('0x1f')]||0x0;this[_0x3c7a('0x20')]=_0xfd069f[_0x3c7a('0x20')]||0x0;this[_0x3c7a('0x5')]=_0xfd069f[_0x3c7a('0x5')]||0x0;if(_0xfd069f[_0x3c7a('0x1d')]===_0x3c7a('0x21')){this[_0x3c7a('0xf')]=_0xfd069f[_0x3c7a('0xf')]||0x0;this['dialActive']=_0xfd069f[_0x3c7a('0x22')];this[_0x3c7a('0x23')]=_0xfd069f[_0x3c7a('0x23')];this[_0x3c7a('0x24')]=_0xfd069f[_0x3c7a('0x24')];this[_0x3c7a('0x25')]=_0xfd069f[_0x3c7a('0x25')];this[_0x3c7a('0x26')]=_0xfd069f['dialOriginateTimeout'];this[_0x3c7a('0x27')]=_0xfd069f[_0x3c7a('0x27')];this[_0x3c7a('0x28')]=_0xfd069f[_0x3c7a('0x28')];this[_0x3c7a('0x29')]=_0xfd069f[_0x3c7a('0x29')];this[_0x3c7a('0x2a')]=_0xfd069f[_0x3c7a('0x2a')];this[_0x3c7a('0xa')]=_0xfd069f[_0x3c7a('0xa')];this[_0x3c7a('0x2b')]=_0xfd069f[_0x3c7a('0x2b')];this[_0x3c7a('0xb')]=_0xfd069f[_0x3c7a('0xb')];this[_0x3c7a('0x2c')]=_0xfd069f[_0x3c7a('0x2c')];this[_0x3c7a('0x2d')]=_0xfd069f[_0x3c7a('0x2d')];this[_0x3c7a('0x2e')]=_0xfd069f[_0x3c7a('0x2e')];this[_0x3c7a('0x2f')]=_0xfd069f[_0x3c7a('0x2f')];this['outboundNoSuchCallsDay']=_0xfd069f['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0xfd069f['outboundOriginateFailureCallsDay'];this[_0x3c7a('0xd')]=_0xfd069f[_0x3c7a('0xd')];this[_0x3c7a('0xe')]=_0xfd069f[_0x3c7a('0xe')];this[_0x3c7a('0x30')]=_0xfd069f[_0x3c7a('0x30')];this[_0x3c7a('0x31')]=_0xfd069f[_0x3c7a('0x31')];this[_0x3c7a('0x32')]=_0xfd069f[_0x3c7a('0x32')];this[_0x3c7a('0x33')]=_0xfd069f[_0x3c7a('0x33')];this[_0x3c7a('0x34')]=_0xfd069f[_0x3c7a('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0xfd069f[_0x3c7a('0x35')];this[_0x3c7a('0x36')]=_0xfd069f['predictiveIntervalErlangCalls'];this[_0x3c7a('0x37')]=_0xfd069f['predictiveIntervalErlangCallsDroppedCalls'];this[_0x3c7a('0x38')]=_0xfd069f[_0x3c7a('0x38')];this['predictiveIntervalMultiplicativeFactor']=_0xfd069f[_0x3c7a('0x39')];this[_0x3c7a('0x3a')]=_0xfd069f[_0x3c7a('0x3a')];this[_0x3c7a('0x3b')]=_0xfd069f[_0x3c7a('0x3b')];this[_0x3c7a('0x3c')]=_0xfd069f[_0x3c7a('0x3c')];this[_0x3c7a('0x8')]=_0xfd069f[_0x3c7a('0x8')];this[_0x3c7a('0x3d')]=_0xfd069f['erlangCalls'];this[_0x3c7a('0x3e')]=_0xfd069f[_0x3c7a('0x3e')];this[_0x3c7a('0x3f')]=_0xfd069f[_0x3c7a('0x3f')];this[_0x3c7a('0x40')]=_0xfd069f[_0x3c7a('0x40')];this[_0x3c7a('0x41')]=_0xfd069f[_0x3c7a('0x41')];this['startProgressive']=_0xfd069f[_0x3c7a('0x42')];this[_0x3c7a('0x43')]=_0xfd069f['message'];this[_0x3c7a('0x44')]=_0xfd069f['statusMessage'];}if(_0xfd069f['Trunk']){this['Trunk']={'id':_0xfd069f['Trunk']['id'],'name':_0xfd069f[_0x3c7a('0x45')][_0x3c7a('0x12')],'active':_0xfd069f[_0x3c7a('0x45')]['active'],'callerid':_0xfd069f[_0x3c7a('0x45')][_0x3c7a('0x46')]};}}VoiceQueueSummary['prototype']['createReport']=function(_0x491335,_0x2a68d5,_0x15d7fe,_0x22c7c7){this[_0x3c7a('0x1')]=0x0;this[_0x3c7a('0x4')]=0x0;this[_0x3c7a('0x2')]=0x0;this[_0x3c7a('0x1f')]=0x0;this[_0x3c7a('0x19')]=0x0;this[_0x3c7a('0x7')]=0x0;this[_0x3c7a('0x16')]=0x0;this[_0x3c7a('0x17')]=0x0;this[_0x3c7a('0x1e')]=0x0;this[_0x3c7a('0x3')]=0x0;this[_0x3c7a('0x1a')]=0x0;this[_0x3c7a('0x18')]=0x0;if(_0x15d7fe){if(_0x15d7fe['available']){this[_0x3c7a('0x15')]=Number(_0x15d7fe[_0x3c7a('0x15')]);}if(_0x15d7fe['loggedin']){this['loggedIn']=Number(_0x15d7fe['loggedin']);}if(_0x15d7fe[_0x3c7a('0x47')]){this[_0x3c7a('0x5')]=Number(_0x15d7fe[_0x3c7a('0x47')]);}}for(var _0x84e2b5=0x0;_0x84e2b5<_0x491335[_0x3c7a('0x48')];_0x84e2b5++){var _0x321b1b=_0x2a68d5[_0x3c7a('0x49')+_0x491335[_0x84e2b5][_0x3c7a('0x12')]];if(_0x321b1b&&_0x321b1b[_0x3c7a('0x4a')]){this[_0x3c7a('0x1')]+=0x1;}if(_0x491335[_0x84e2b5][_0x3c7a('0x4b')]==='1'){this['talking']+=0x1;}if(_0x491335[_0x84e2b5]['paused']==='1'&&!['2','7','8']['includes'](_0x491335[_0x84e2b5][_0x3c7a('0x4c')])){this[_0x3c7a('0x2')]+=0x1;}switch(_0x491335[_0x84e2b5][_0x3c7a('0x4c')]){case'0':this[_0x3c7a('0x1f')]+=0x1;break;case'1':this[_0x3c7a('0x19')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x3c7a('0x16')]+=0x1;break;case'4':this[_0x3c7a('0x17')]+=0x1;break;case'5':this[_0x3c7a('0x1e')]+=0x1;break;case'6':this[_0x3c7a('0x3')]+=0x1;break;case'7':this[_0x3c7a('0x1a')]+=0x1;break;case'8':this[_0x3c7a('0x18')]+=0x1;break;}}if(this[_0x3c7a('0x23')]==='booked'){var _0x519831=Object[_0x3c7a('0x4d')](_0x22c7c7);for(var _0x350ea7=0x0;_0x350ea7<_0x519831[_0x3c7a('0x48')];_0x350ea7++){var _0xf57f2=_0x519831[_0x350ea7];var _0xf607f3=_0x22c7c7[_0xf57f2];if(_0xf607f3[_0x3c7a('0x4e')]===this['name']&&_0xf607f3[_0x3c7a('0x1d')]==='dialer'&&_0xf607f3['exten']===_0x3c7a('0x4f')){this[_0x3c7a('0x4')]+=0x1;}}if(this[_0x3c7a('0x4')]>this['inUse']){this['talking']=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x3c7a('0x50')][_0x3c7a('0x51')]=function(_0x3c22c6){var _0x1a26ed=![];if(_0x3c22c6){_0x1a26ed=INBOUND_COUNTERS[_0x3c7a('0x52')](function(_0x11f7ee){return this[_0x11f7ee]!==_0x3c22c6[_0x11f7ee];},this);}return _0x1a26ed;};VoiceQueueSummary[_0x3c7a('0x50')][_0x3c7a('0x53')]=function(_0x3f5656){var _0x118c9c=![];var _0x46360d=![];var _0x433cca=![];if(_0x3f5656){_0x118c9c=this[_0x3c7a('0x23')]!==_0x3f5656[_0x3c7a('0x23')]||this[_0x3c7a('0x22')]!==_0x3f5656['dialActive']||this['message']!==_0x3f5656['message']||this['statusMessage']!==_0x3f5656['statusMessage'];_0x46360d=OUTBOUND_COUNTERS[_0x3c7a('0x52')](function(_0x4e4995){return this[_0x4e4995]!==_0x3f5656[_0x4e4995];},this);if(this[_0x3c7a('0x45')]&&_0x3f5656[_0x3c7a('0x45')]){_0x433cca=this['Trunk'][_0x3c7a('0x12')]!==_0x3f5656['Trunk']['name']||this[_0x3c7a('0x45')][_0x3c7a('0x54')]!==_0x3f5656[_0x3c7a('0x45')]['active'];}}return _0x118c9c||_0x46360d||_0x433cca;};VoiceQueueSummary[_0x3c7a('0x50')]['updateReportFromOutboundQueue']=function(_0x1e29e0){this['answered']=_0x1e29e0[_0x3c7a('0x6')];this[_0x3c7a('0x43')]=_0x1e29e0['message'];this[_0x3c7a('0x44')]=_0x1e29e0[_0x3c7a('0x44')];this[_0x3c7a('0x8')]=_0x1e29e0[_0x3c7a('0x8')];this[_0x3c7a('0x9')]=_0x1e29e0[_0x3c7a('0x9')];this[_0x3c7a('0x2a')]=_0x1e29e0['outboundAnswerCallsDay'];this[_0x3c7a('0xa')]=_0x1e29e0[_0x3c7a('0xa')];this['outboundBusyCallsDay']=_0x1e29e0[_0x3c7a('0x2b')];this['outboundCongestionCallsDay']=_0x1e29e0[_0x3c7a('0xb')];this[_0x3c7a('0x2f')]=_0x1e29e0['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x1e29e0[_0x3c7a('0xc')];this[_0x3c7a('0xd')]=_0x1e29e0['outboundReCallsDay'];this[_0x3c7a('0xe')]=_0x1e29e0[_0x3c7a('0xe')];this[_0x3c7a('0x30')]=_0x1e29e0[_0x3c7a('0x30')];this['sumBillable']=_0x1e29e0[_0x3c7a('0x10')];this['sumDuration']=_0x1e29e0[_0x3c7a('0x1b')];this[_0x3c7a('0x11')]=_0x1e29e0['total'];if(this['dialMethod']==='preview'){this[_0x3c7a('0xf')]=_0x1e29e0[_0x3c7a('0xf')];}};module[_0x3c7a('0x55')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 722f5e9..ff47880 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 _0x12e2=['name','username','accessKey','serverUrl','Configurations'];(function(_0x59790c,_0x3f21a9){var _0x58ae3a=function(_0x2f3805){while(--_0x2f3805){_0x59790c['push'](_0x59790c['shift']());}};_0x58ae3a(++_0x3f21a9);}(_0x12e2,0xd7));var _0x212e=function(_0x4fc801,_0x1cd14b){_0x4fc801=_0x4fc801-0x0;var _0x3e9bee=_0x12e2[_0x4fc801];return _0x3e9bee;};'use strict';function VtigerAccount(_0x5bb4d9){this['id']=_0x5bb4d9['id']||0x0;this[_0x212e('0x0')]=_0x5bb4d9[_0x212e('0x0')]||'';this[_0x212e('0x1')]=_0x5bb4d9['username']||'';this['accessKey']=_0x5bb4d9[_0x212e('0x2')]||'';this['remoteUri']=_0x5bb4d9['remoteUri']||'';this[_0x212e('0x3')]=_0x5bb4d9['serverUrl']||'';this[_0x212e('0x4')]=_0x5bb4d9[_0x212e('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x5033=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x323b64,_0x1df9f4){var _0x4a1135=function(_0x379338){while(--_0x379338){_0x323b64['push'](_0x323b64['shift']());}};_0x4a1135(++_0x1df9f4);}(_0x5033,0xa5));var _0x3503=function(_0x1c9bff,_0x276bcd){_0x1c9bff=_0x1c9bff-0x0;var _0x218e83=_0x5033[_0x1c9bff];return _0x218e83;};'use strict';function VtigerAccount(_0x3557f7){this['id']=_0x3557f7['id']||0x0;this[_0x3503('0x0')]=_0x3557f7[_0x3503('0x0')]||'';this['username']=_0x3557f7[_0x3503('0x1')]||'';this['accessKey']=_0x3557f7[_0x3503('0x2')]||'';this[_0x3503('0x3')]=_0x3557f7[_0x3503('0x3')]||'';this[_0x3503('0x4')]=_0x3557f7[_0x3503('0x4')]||'';this['Configurations']=_0x3557f7[_0x3503('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index d282a05..113fc7f 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 _0xece6=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','password','token'];(function(_0x3ef95c,_0x206af5){var _0x29add2=function(_0x18f9a5){while(--_0x18f9a5){_0x3ef95c['push'](_0x3ef95c['shift']());}};_0x29add2(++_0x206af5);}(_0xece6,0xc5));var _0x6ece=function(_0x3810a2,_0x545ecd){_0x3810a2=_0x3810a2-0x0;var _0x14f6cf=_0xece6[_0x3810a2];return _0x14f6cf;};'use strict';function ZendeskAccount(_0x292e68){this['id']=_0x292e68['id']||0x0;this[_0x6ece('0x0')]=_0x292e68[_0x6ece('0x0')]||'';this['username']=_0x292e68['username']||'';this[_0x6ece('0x1')]=_0x292e68[_0x6ece('0x1')]||'';this[_0x6ece('0x2')]=_0x292e68[_0x6ece('0x2')]||'';this[_0x6ece('0x3')]=_0x292e68['remoteUri']||'';this[_0x6ece('0x4')]=_0x292e68['authType']||'';this[_0x6ece('0x5')]=_0x292e68['type']||_0x6ece('0x6');this[_0x6ece('0x7')]=_0x292e68['serverUrl']||'';this[_0x6ece('0x8')]=_0x292e68['Configurations']||{};}module[_0x6ece('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xfe7b=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x9ea8db,_0x3fe379){var _0x3507e8=function(_0xa98679){while(--_0xa98679){_0x9ea8db['push'](_0x9ea8db['shift']());}};_0x3507e8(++_0x3fe379);}(_0xfe7b,0xb0));var _0xbfe7=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0xfe7b[_0x544072];return _0x590bf6;};'use strict';function ZendeskAccount(_0x558816){this['id']=_0x558816['id']||0x0;this[_0xbfe7('0x0')]=_0x558816[_0xbfe7('0x0')]||'';this[_0xbfe7('0x1')]=_0x558816[_0xbfe7('0x1')]||'';this['password']=_0x558816[_0xbfe7('0x2')]||'';this[_0xbfe7('0x3')]=_0x558816[_0xbfe7('0x3')]||'';this[_0xbfe7('0x4')]=_0x558816[_0xbfe7('0x4')]||'';this[_0xbfe7('0x5')]=_0x558816['authType']||'';this[_0xbfe7('0x6')]=_0x558816[_0xbfe7('0x6')]||_0xbfe7('0x7');this[_0xbfe7('0x8')]=_0x558816[_0xbfe7('0x8')]||'';this[_0xbfe7('0x9')]=_0x558816['Configurations']||{};}module[_0xbfe7('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 5ebe763..caa1f7a 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 _0xb526=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb526,0x17c));var _0x6b52=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0xb526[_0x1064bc];return _0x5edc45;};'use strict';function ZohoAccount(_0x17e9b3){this['id']=_0x17e9b3['id']||0x0;this[_0x6b52('0x0')]=_0x17e9b3[_0x6b52('0x0')]||'';this[_0x6b52('0x1')]=_0x17e9b3[_0x6b52('0x1')]||'';this[_0x6b52('0x2')]=_0x17e9b3['host']||'';this['zone']=_0x17e9b3[_0x6b52('0x3')]||'';this[_0x6b52('0x4')]=_0x17e9b3[_0x6b52('0x4')]||'';this[_0x6b52('0x5')]=_0x17e9b3[_0x6b52('0x5')]||'';this[_0x6b52('0x6')]=_0x17e9b3[_0x6b52('0x6')]||'';this['code']=_0x17e9b3[_0x6b52('0x7')]||'';this[_0x6b52('0x8')]=_0x17e9b3[_0x6b52('0x8')]||'';this[_0x6b52('0x9')]=_0x17e9b3[_0x6b52('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xb45d=['serverUrl','Configurations','name','description','zone','clientId','clientSecret'];(function(_0x269fb6,_0x551e65){var _0x5816f8=function(_0xbe7880){while(--_0xbe7880){_0x269fb6['push'](_0x269fb6['shift']());}};_0x5816f8(++_0x551e65);}(_0xb45d,0xa3));var _0xdb45=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0xb45d[_0xb6e43];return _0x47c40f;};'use strict';function ZohoAccount(_0x2b1908){this['id']=_0x2b1908['id']||0x0;this[_0xdb45('0x0')]=_0x2b1908[_0xdb45('0x0')]||'';this['description']=_0x2b1908[_0xdb45('0x1')]||'';this['host']=_0x2b1908['host']||'';this['zone']=_0x2b1908[_0xdb45('0x2')]||'';this['clientId']=_0x2b1908[_0xdb45('0x3')]||'';this['clientSecret']=_0x2b1908[_0xdb45('0x4')]||'';this[_0xdb45('0x5')]=_0x2b1908[_0xdb45('0x5')]||'';this['code']=_0x2b1908['code']||'';this['refreshToken']=_0x2b1908['refreshToken']||'';this[_0xdb45('0x6')]=_0x2b1908[_0xdb45('0x6')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 03747f7..fe48743 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 _0xd914=['format','SIP/%s','phone','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','calleridname','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','channelAgent'];(function(_0x5d9987,_0x3c9d0c){var _0x4eb5a4=function(_0x23a46c){while(--_0x23a46c){_0x5d9987['push'](_0x5d9987['shift']());}};_0x4eb5a4(++_0x3c9d0c);}(_0xd914,0x17f));var _0x4d91=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0xd914[_0xfc406a];return _0x395473;};'use strict';var util=require(_0x4d91('0x0'));var _=require(_0x4d91('0x1'));var moment=require('moment');function checkNameSurname(_0x212202,_0x17d4ce,_0x3b8cae){var _0x2314d1='';if(!_[_0x4d91('0x2')](_0x17d4ce)&&_0x4d91('0x3')===typeof _0x17d4ce){_0x2314d1+=_0x17d4ce;}if(!_['isNil'](_0x3b8cae)&&_0x4d91('0x3')===typeof _0x3b8cae){_0x2314d1+='\x20'+_0x3b8cae;}if(_0x2314d1!==''){return _0x2314d1;}return _0x212202;}function Action(_0x5d8af4,_0x3ab6f8,_0x42d7ae,_0x175ce3,_0x27c0d5){this[_0x4d91('0x4')]=_0x42d7ae||undefined;this[_0x4d91('0x5')]=_0x5d8af4['id'];this[_0x4d91('0x6')]=_0x3ab6f8[_0x4d91('0x7')];this['type']=_0x3ab6f8[_0x4d91('0x8')];this[_0x4d91('0x9')]=_0x4d91('0x6');this[_0x4d91('0xa')]=![];this[_0x4d91('0xb')]=_[_0x4d91('0x2')](_0x5d8af4['Agent'])?undefined:_0x5d8af4['Agent'][_0x4d91('0x7')];this[_0x4d91('0xc')]=this[_0x4d91('0xb')]?util[_0x4d91('0xd')](_0x4d91('0xe'),this[_0x4d91('0xb')]):_0x175ce3||undefined;this['calleridname']=checkNameSurname(_0x5d8af4['Contact'][_0x4d91('0xf')],_0x5d8af4[_0x4d91('0x10')][_0x4d91('0x11')],_0x5d8af4[_0x4d91('0x10')][_0x4d91('0x12')]);this[_0x4d91('0x13')]=_0x5d8af4[_0x4d91('0x13')]||![];this['calleridnum']=_0x5d8af4[_0x4d91('0xf')];this[_0x4d91('0x14')]=_0x5d8af4[_0x4d91('0x14')];this[_0x4d91('0x15')]=_0x5d8af4[_0x4d91('0x15')]||0x0;this['countcongestionretry']=_0x5d8af4[_0x4d91('0x16')]||0x0;this[_0x4d91('0x17')]=_0x5d8af4[_0x4d91('0x17')]||0x0;this[_0x4d91('0x18')]=(_0x5d8af4['countbusyretry']||0x0)+(_0x5d8af4[_0x4d91('0x16')]||0x0)+(_0x5d8af4[_0x4d91('0x17')]||0x0)+(_0x5d8af4[_0x4d91('0x19')]||0x0)+(_0x5d8af4['countdropretry']||0x0)+(_0x5d8af4[_0x4d91('0x1a')]||0x0)+(_0x5d8af4[_0x4d91('0x1b')]||0x0)+(_0x5d8af4[_0x4d91('0x1c')]||0x0);this[_0x4d91('0x19')]=_0x5d8af4[_0x4d91('0x19')]||0x0;this[_0x4d91('0x1d')]=_0x5d8af4[_0x4d91('0x1d')]||0x0;this[_0x4d91('0x1a')]=_0x5d8af4[_0x4d91('0x1a')]||0x0;this[_0x4d91('0x1b')]=_0x5d8af4['countmachineretry']||0x0;this[_0x4d91('0x1c')]=_0x5d8af4['countagentrejectretry']||0x0;this['callback']=_0x5d8af4[_0x4d91('0x1e')];this[_0x4d91('0x1f')]=_0x5d8af4[_0x4d91('0x1f')];this[_0x4d91('0x20')]=_0x5d8af4[_0x4d91('0x20')];this[_0x4d91('0x21')]=_0x5d8af4[_0x4d91('0x21')];this[_0x4d91('0x22')]=_0x5d8af4['ContactId'];this['ListId']=_0x5d8af4[_0x4d91('0x23')];this[_0x4d91('0x24')]=_[_0x4d91('0x2')](_0x5d8af4[_0x4d91('0x25')])?_0x5d8af4[_0x4d91('0x24')]:_0x5d8af4[_0x4d91('0x25')]['id'];this[_0x4d91('0x26')]=_0x5d8af4['VoiceQueueId'];this[_0x4d91('0x27')]='';this[_0x4d91('0x28')]='';}Action[_0x4d91('0x29')]['getCaller']=function(){return util['format'](_0x4d91('0x2a'),this[_0x4d91('0x2b')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x8603=['prototype','getCaller','number','exports','lodash','moment','isNil','string','uniqueid','type','queue','dialAnswer','Agent','name','channelAgent','format','SIP/%s','membername','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0x5d299f,_0x165fa2){var _0x29e13f=function(_0x2c575d){while(--_0x2c575d){_0x5d299f['push'](_0x5d299f['shift']());}};_0x29e13f(++_0x165fa2);}(_0x8603,0x190));var _0x3860=function(_0xbf56e5,_0xc085e9){_0xbf56e5=_0xbf56e5-0x0;var _0x579e15=_0x8603[_0xbf56e5];return _0x579e15;};'use strict';var util=require('util');var _=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));function checkNameSurname(_0x96d2bc,_0x51bfda,_0x4961d6){var _0x2ebe8b='';if(!_[_0x3860('0x2')](_0x51bfda)&&_0x3860('0x3')===typeof _0x51bfda){_0x2ebe8b+=_0x51bfda;}if(!_['isNil'](_0x4961d6)&&_0x3860('0x3')===typeof _0x4961d6){_0x2ebe8b+='\x20'+_0x4961d6;}if(_0x2ebe8b!==''){return _0x2ebe8b;}return _0x96d2bc;}function Action(_0x56f8c5,_0xb0fc24,_0x40739b,_0x1eca44,_0xd3ce26){this[_0x3860('0x4')]=_0x40739b||undefined;this['idContact']=_0x56f8c5['id'];this['queue']=_0xb0fc24['name'];this[_0x3860('0x5')]=_0xb0fc24[_0x3860('0x5')];this['campaigntype']=_0x3860('0x6');this[_0x3860('0x7')]=![];this['membername']=_[_0x3860('0x2')](_0x56f8c5[_0x3860('0x8')])?undefined:_0x56f8c5['Agent'][_0x3860('0x9')];this[_0x3860('0xa')]=this['membername']?util[_0x3860('0xb')](_0x3860('0xc'),this[_0x3860('0xd')]):_0x1eca44||undefined;this[_0x3860('0xe')]=checkNameSurname(_0x56f8c5[_0x3860('0xf')][_0x3860('0x10')],_0x56f8c5[_0x3860('0xf')][_0x3860('0x11')],_0x56f8c5[_0x3860('0xf')][_0x3860('0x12')]);this['active']=_0x56f8c5[_0x3860('0x13')]||![];this[_0x3860('0x14')]=_0x56f8c5[_0x3860('0x10')];this[_0x3860('0x15')]=_0x56f8c5[_0x3860('0x15')];this[_0x3860('0x16')]=_0x56f8c5[_0x3860('0x16')]||0x0;this[_0x3860('0x17')]=_0x56f8c5[_0x3860('0x17')]||0x0;this[_0x3860('0x18')]=_0x56f8c5[_0x3860('0x18')]||0x0;this[_0x3860('0x19')]=(_0x56f8c5['countbusyretry']||0x0)+(_0x56f8c5['countcongestionretry']||0x0)+(_0x56f8c5[_0x3860('0x18')]||0x0)+(_0x56f8c5[_0x3860('0x1a')]||0x0)+(_0x56f8c5[_0x3860('0x1b')]||0x0)+(_0x56f8c5['countabandonedretry']||0x0)+(_0x56f8c5[_0x3860('0x1c')]||0x0)+(_0x56f8c5[_0x3860('0x1d')]||0x0);this[_0x3860('0x1a')]=_0x56f8c5[_0x3860('0x1a')]||0x0;this[_0x3860('0x1b')]=_0x56f8c5[_0x3860('0x1b')]||0x0;this[_0x3860('0x1e')]=_0x56f8c5[_0x3860('0x1e')]||0x0;this[_0x3860('0x1c')]=_0x56f8c5[_0x3860('0x1c')]||0x0;this[_0x3860('0x1d')]=_0x56f8c5[_0x3860('0x1d')]||0x0;this[_0x3860('0x1f')]=_0x56f8c5[_0x3860('0x1f')];this[_0x3860('0x20')]=_0x56f8c5['callbackuniqueid'];this[_0x3860('0x21')]=_0x56f8c5[_0x3860('0x21')];this[_0x3860('0x22')]=_0x56f8c5[_0x3860('0x22')];this[_0x3860('0x23')]=_0x56f8c5['ContactId'];this[_0x3860('0x24')]=_0x56f8c5['ListId'];this['UserId']=_[_0x3860('0x2')](_0x56f8c5[_0x3860('0x8')])?_0x56f8c5['UserId']:_0x56f8c5['Agent']['id'];this['VoiceQueueId']=_0x56f8c5[_0x3860('0x25')];this[_0x3860('0x26')]='';this[_0x3860('0x27')]='';}Action[_0x3860('0x28')][_0x3860('0x29')]=function(){return util[_0x3860('0xb')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x3860('0x2a')]);};module[_0x3860('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6c0abee..8e47138 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x27e315,_0x418e4f){var _0x4c0f2f=function(_0x2d61f0){while(--_0x2d61f0){_0x27e315['push'](_0x27e315['shift']());}};_0x4c0f2f(++_0x418e4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x90025e,_0x1d05e4){var _0x4f9858=function(_0x36b521){while(--_0x36b521){_0x90025e['push'](_0x90025e['shift']());}};_0x4f9858(++_0x1d05e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 030a4bf..0d1086a 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 _0x5a51=['resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0x5a51,0x137));var _0x15a5=function(_0x40736a,_0x4ed684){_0x40736a=_0x40736a-0x0;var _0x4a47aa=_0x5a51[_0x40736a];return _0x4a47aa;};'use strict';var util=require(_0x15a5('0x0'));var BPromise=require(_0x15a5('0x1'));var logger=require(_0x15a5('0x2'))(_0x15a5('0x3'));var cmHopper=require(_0x15a5('0x4'));var cmHopperHistory=require(_0x15a5('0x5'));var cmHopperBlack=require(_0x15a5('0x6'));var agentReportPreview=require(_0x15a5('0x7'));var voiceQueueReport=require(_0x15a5('0x8'));function loggerCatch(_0x119ad5){return function(_0x53a5f5){logger[_0x15a5('0x9')](_0x119ad5,util['inspect'](_0x53a5f5,{'showHidden':![],'depth':null}));};}function create(_0x574e41){return cmHopperHistory[_0x15a5('0xa')](_0x574e41)[_0x15a5('0xb')](loggerCatch(_0x15a5('0xc')));}function createAgent(_0x35d2d7){return BPromise[_0x15a5('0xd')]()[_0x15a5('0xe')](agentReportPreview['createHistory'](_0x35d2d7))['catch'](loggerCatch(_0x15a5('0xc')));}function moveContact(_0x44f5d6){return cmHopper[_0x15a5('0xf')](_0x44f5d6,!![])[_0x15a5('0xb')](loggerCatch(_0x15a5('0x10')));}exports['checkIsBlackList']=function(_0x2da85d){return cmHopperBlack['checkIsBlackList'](_0x2da85d)['catch'](loggerCatch(_0x15a5('0x11')));};exports[_0x15a5('0x12')]=function(_0x31523d){return BPromise[_0x15a5('0xd')]()[_0x15a5('0xe')](cmHopper[_0x15a5('0x12')](_0x31523d))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x15a5('0xa')]=function(_0x3c1053,_0x30227e){create(_0x3c1053)[_0x15a5('0xb')](loggerCatch(_0x30227e));moveContact(_0x3c1053)[_0x15a5('0xb')](loggerCatch(_0x30227e));};exports[_0x15a5('0x13')]=function(_0x23412a,_0x5e26a9){createAgent(_0x23412a)[_0x15a5('0xb')](loggerCatch(_0x5e26a9));};exports[_0x15a5('0x14')]=function(_0x5d0d40,_0x3e610b){create(_0x5d0d40)[_0x15a5('0xb')](loggerCatch(_0x3e610b));};exports['createCustomerFinal']=function(_0x4c673e,_0x12f65d){moveContact(_0x4c673e)[_0x15a5('0xb')](loggerCatch(_0x12f65d));};exports[_0x15a5('0x15')]=function(_0x5064a5,_0x426849,_0x158db2){if(_0x426849){_0x5064a5[_0x15a5('0x16')]=null;}if(_0x158db2){_0x5064a5[_0x15a5('0x17')]=![];}return cmHopper[_0x15a5('0x15')](_0x5064a5)[_0x15a5('0xb')](loggerCatch(_0x15a5('0x18')));};exports[_0x15a5('0x19')]=function(_0x1225c2){return cmHopper[_0x15a5('0x19')](_0x1225c2)[_0x15a5('0xb')](loggerCatch(_0x15a5('0x1a')));};exports['unlockContact']=function(_0x56720b){return cmHopper[_0x15a5('0x1b')]({'UserId':null},_0x56720b,0x1)[_0x15a5('0xb')](loggerCatch(_0x15a5('0x1c')));};exports[_0x15a5('0x1d')]=function(_0x203bae){return cmHopper[_0x15a5('0x1b')]({'active':![]},_0x203bae,0x1)['catch'](loggerCatch(_0x15a5('0x1e')));};exports[_0x15a5('0x1f')]=function(_0x547996){var _0x3ae807={};_0x3ae807['type']=_0x547996['type'];_0x3ae807[_0x15a5('0x20')]=_0x547996[_0x15a5('0x20')];_0x3ae807[_0x15a5('0x21')]=_0x547996['calleridnum'];_0x3ae807[_0x15a5('0x22')]=_0x547996[_0x15a5('0x22')];_0x3ae807[_0x15a5('0x23')]=_0x547996[_0x15a5('0x23')];_0x3ae807[_0x15a5('0x24')]=_0x547996['answertime'];_0x3ae807[_0x15a5('0x25')]=_0x547996[_0x15a5('0x26')];_0x3ae807['queuecallercomplete']=0x1;_0x3ae807['queuecallercompleteAt']=_0x547996['endtime'];_0x3ae807[_0x15a5('0x27')]=_0x547996[_0x15a5('0x28')];_0x3ae807['context']=_0x15a5('0x29');_0x3ae807[_0x15a5('0x2a')]=_0x15a5('0x2b');_0x3ae807['holdtime']=0x0;_0x3ae807[_0x15a5('0x2c')]=0x1;_0x3ae807[_0x15a5('0x2d')]=_0x547996[_0x15a5('0x28')];_0x3ae807[_0x15a5('0x2e')]=_0x15a5('0x2f');return BPromise[_0x15a5('0xd')]()['then'](voiceQueueReport[_0x15a5('0x30')](_0x3ae807))['catch'](loggerCatch(_0x15a5('0x31')));};exports[_0x15a5('0x32')]=function(_0x510b99,_0xd7eaee){return BPromise[_0x15a5('0xd')]()[_0x15a5('0xe')](cmHopper[_0x15a5('0x32')](_0x510b99,_0xd7eaee))[_0x15a5('0xb')](loggerCatch(_0x15a5('0x33')));};exports[_0x15a5('0x34')]=function(_0x2c61bc){return cmHopper['rescheduleContact'](_0x2c61bc,!![],!![])[_0x15a5('0xb')](loggerCatch(_0x15a5('0x35')));}; \ No newline at end of file +var _0x9347=['../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperBlack'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x9347,0x160));var _0x7934=function(_0x3521f6,_0x2676da){_0x3521f6=_0x3521f6-0x0;var _0x73d85c=_0x9347[_0x3521f6];return _0x73d85c;};'use strict';var util=require(_0x7934('0x0'));var BPromise=require('bluebird');var logger=require(_0x7934('0x1'))(_0x7934('0x2'));var cmHopper=require(_0x7934('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x7934('0x4'));var agentReportPreview=require(_0x7934('0x5'));var voiceQueueReport=require(_0x7934('0x6'));function loggerCatch(_0x41cfa7){return function(_0xdf38d2){logger['error'](_0x41cfa7,util[_0x7934('0x7')](_0xdf38d2,{'showHidden':![],'depth':null}));};}function create(_0x94d84c){return cmHopperHistory[_0x7934('0x8')](_0x94d84c)[_0x7934('0x9')](loggerCatch(_0x7934('0xa')));}function createAgent(_0x2803ce){return BPromise['resolve']()[_0x7934('0xb')](agentReportPreview[_0x7934('0x8')](_0x2803ce))[_0x7934('0x9')](loggerCatch(_0x7934('0xa')));}function moveContact(_0x227156){return cmHopper[_0x7934('0xc')](_0x227156,!![])['catch'](loggerCatch(_0x7934('0xd')));}exports[_0x7934('0xe')]=function(_0xe93f15){return cmHopperBlack[_0x7934('0xe')](_0xe93f15)[_0x7934('0x9')](loggerCatch(_0x7934('0xf')));};exports[_0x7934('0x10')]=function(_0x4a9334){return BPromise[_0x7934('0x11')]()[_0x7934('0xb')](cmHopper[_0x7934('0x10')](_0x4a9334))[_0x7934('0x9')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x592af4,_0x40dbc1){create(_0x592af4)[_0x7934('0x9')](loggerCatch(_0x40dbc1));moveContact(_0x592af4)['catch'](loggerCatch(_0x40dbc1));};exports['createAgentHistory']=function(_0x465321,_0x12083d){createAgent(_0x465321)[_0x7934('0x9')](loggerCatch(_0x12083d));};exports['createCustomerHistory']=function(_0x327613,_0x1d67e9){create(_0x327613)[_0x7934('0x9')](loggerCatch(_0x1d67e9));};exports[_0x7934('0x12')]=function(_0x2e6bf4,_0x4787dc){moveContact(_0x2e6bf4)[_0x7934('0x9')](loggerCatch(_0x4787dc));};exports['rescheduleContact']=function(_0x3fb98e,_0x31cc86,_0xc2a535){if(_0x31cc86){_0x3fb98e['UserId']=null;}if(_0xc2a535){_0x3fb98e[_0x7934('0x13')]=![];}return cmHopper[_0x7934('0x14')](_0x3fb98e)['catch'](loggerCatch(_0x7934('0x15')));};exports[_0x7934('0x16')]=function(_0x54ff0f){return cmHopper['countReScheduled'](_0x54ff0f)[_0x7934('0x9')](loggerCatch(_0x7934('0x17')));};exports[_0x7934('0x18')]=function(_0x8c448){return cmHopper[_0x7934('0x18')]({'UserId':null},_0x8c448,0x1)['catch'](loggerCatch(_0x7934('0x19')));};exports[_0x7934('0x1a')]=function(_0x25ef2e){return cmHopper[_0x7934('0x18')]({'active':![]},_0x25ef2e,0x1)[_0x7934('0x9')](loggerCatch(_0x7934('0x1b')));};exports[_0x7934('0x1c')]=function(_0x394321){var _0x365e9a={};_0x365e9a[_0x7934('0x1d')]=_0x394321[_0x7934('0x1d')];_0x365e9a[_0x7934('0x1e')]=_0x394321['uniqueid'];_0x365e9a[_0x7934('0x1f')]=_0x394321[_0x7934('0x1f')];_0x365e9a[_0x7934('0x20')]=_0x394321['calleridname'];_0x365e9a[_0x7934('0x21')]=_0x394321['queue'];_0x365e9a[_0x7934('0x22')]=_0x394321[_0x7934('0x23')];_0x365e9a[_0x7934('0x24')]=_0x394321['answertime'];_0x365e9a[_0x7934('0x25')]=0x1;_0x365e9a[_0x7934('0x26')]=_0x394321[_0x7934('0x27')];_0x365e9a[_0x7934('0x28')]=_0x394321[_0x7934('0x29')];_0x365e9a['context']=_0x7934('0x2a');_0x365e9a[_0x7934('0x2b')]=_0x7934('0x2c');_0x365e9a['holdtime']=0x0;_0x365e9a[_0x7934('0x2d')]=0x1;_0x365e9a['lastAssignedTo']=_0x394321['membername'];_0x365e9a[_0x7934('0x2e')]=_0x7934('0x2f');return BPromise[_0x7934('0x11')]()[_0x7934('0xb')](voiceQueueReport['create'](_0x365e9a))[_0x7934('0x9')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x7934('0x30')]=function(_0x4d9d8b,_0x29f536){return BPromise[_0x7934('0x11')]()[_0x7934('0xb')](cmHopper[_0x7934('0x30')](_0x4d9d8b,_0x29f536))[_0x7934('0x9')](loggerCatch(_0x7934('0x31')));};exports[_0x7934('0x32')]=function(_0x279c9f){return cmHopper['rescheduleContact'](_0x279c9f,!![],!![])[_0x7934('0x9')](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 ff714f8..192725b 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 _0x6f47=['ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','not_inuse','status','reachable','push','milliseconds','diff','createBody','CampaignId','filterKey','idContact','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','sipcallid','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','preview','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','endtime','logAgent','statedesc','responsetime','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','calleridname','BOOKED','channelAgent','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f47,0xc7));var _0x76f4=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x6f47[_0x1c8c28];return _0x1f59b4;};'use strict';var util=require('util');var _=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var logger=require('../../../../config/logger')(_0x76f4('0x2'));var ipAgi=process['env'][_0x76f4('0x3')]||'127.0.0.1';var utils=require(_0x76f4('0x4'));exports[_0x76f4('0x5')]=function(_0x2795ee){return function(_0x2523ba){logger['error'](_0x2795ee,util[_0x76f4('0x6')](_0x2523ba,{'showHidden':![],'depth':null}));};};exports[_0x76f4('0x7')]=function(_0x2176a7,_0x497f99){logger[_0x76f4('0x8')](_0x2176a7,util[_0x76f4('0x6')](_0x497f99,{'showHidden':![],'depth':null}));};exports[_0x76f4('0x9')]=function(_0xf9b468,_0x101f55){logger['error'](_0xf9b468,util['inspect'](_0x101f55,{'showHidden':![],'depth':null}));};exports[_0x76f4('0xa')]=function(_0x18e41a){return function(_0x5af83c){logger['info'](_0x18e41a,util[_0x76f4('0x6')](_0x5af83c,{'showHidden':![],'depth':null}));};};exports[_0x76f4('0xb')]=function(_0x369dc1,_0x1e6a30,_0x1aee7f){return{'message':_0x369dc1,'unlock':_0x1e6a30,'active':_0x1aee7f};};exports[_0x76f4('0xc')]=function(_0xf7e347,_0x3ec740,_0x2157f9){if(!_['isUndefined'](_0x2157f9)&&_0x76f4('0xd')===typeof _0x2157f9&&!_[_0x76f4('0xe')](_0x2157f9)){if(!_['isUndefined'](_0x3ec740)&&'string'===typeof _0x3ec740&&!_['isEmpty'](_0x3ec740)){return util[_0x76f4('0xf')](_0x76f4('0x10'),_0x3ec740,_0x2157f9);}return util[_0x76f4('0xf')](_0x76f4('0x10'),_0x2157f9,_0x2157f9);}if(!_[_0x76f4('0x11')](_0xf7e347)&&_0x76f4('0xd')===typeof _0xf7e347&&!_[_0x76f4('0xe')](_0xf7e347)){return _0xf7e347;}return _0x76f4('0x12');};exports[_0x76f4('0x13')]=function(_0xb159a9){if(_[_0x76f4('0x14')](_0xb159a9)){return![];}return _0xb159a9;};exports[_0x76f4('0x15')]=function(_0x214bef,_0x38450e,_0x17625e,_0x397360,_0xfedbe4,_0x3e809f){var _0x435534={'XMD-QUEUE':_0x38450e[_0x76f4('0x16')]?_0x38450e[_0x76f4('0x16')][_0x76f4('0x17')]:'','XMD-CALLERID':_0x397360,'XMD-CALLERID-PREVIEW':_0x3e809f?util['format'](_0x76f4('0x10'),_0x3e809f['calleridname'],_0x3e809f[_0x76f4('0x18')]):_0x397360,'XMD-DIALID':_0xfedbe4,'XMD-CONTACTID':_0x38450e[_0x76f4('0x19')],'XMD-CDRTYPE':_0x76f4('0x1a'),'CALLERID(all)':_0x397360,'XMD-VOICEQUEUEID':_0x38450e['VoiceQueueId'],'XMD-DIALCHANNEL':_0x17625e,'XMD-DIALTIMEOUT':_0x214bef['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x76f4('0x1b'),_0x214bef[_0x76f4('0x1c')]?'g':'',_[_0x76f4('0xe')](_0x214bef[_0x76f4('0x1d')])?'':_0x76f4('0x1e')),'XMD-DIALURL':_0x214bef[_0x76f4('0x1f')]||'','XMD-AGI':_0x214bef[_0x76f4('0x20')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x214bef[_0x76f4('0x20')]):'NONE','XMD-AGIAFTER':_0x214bef[_0x76f4('0x1c')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x214bef['dialQueueProject2']):_0x76f4('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x3e809f?_0x3e809f[_0x76f4('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x3e809f?_0x3e809f[_0x76f4('0x23')]:'','XMD-DESTINATION':_0x76f4('0x24'),'SIPADDHEADER':_0x76f4('0x25')};if(!_[_0x76f4('0xe')](_0x214bef['monitor_format'])){_0x435534[util[_0x76f4('0xf')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x214bef['monitor_format'];_0x435534[util['format']('%s',_0x76f4('0x26'))]=_0xfedbe4;}return _0x435534;};exports[_0x76f4('0x27')]=function(_0x41dea4){var _0x1dea0e={};for(var _0x54f854 in _0x41dea4){if(_0x41dea4[_0x76f4('0x28')](_0x54f854)){_0x1dea0e[util['format']('%s',_[_0x76f4('0x29')](_0x54f854))]=_0x41dea4[_0x54f854];}}return{'variables':_0x1dea0e};};exports[_0x76f4('0x2a')]=function(_0x43ac4a,_0x1c2c5c){if(!_[_0x76f4('0x14')](_0x43ac4a)){if(_0x43ac4a['hasOwnProperty']('originated')){if(_0x43ac4a[_0x76f4('0x2b')]>0x0){_0x43ac4a[_0x76f4('0x2b')]-=0x1;}else{logger[_0x76f4('0x2c')](_0x76f4('0x2d'),_0x1c2c5c);}}}else{logger[_0x76f4('0x2c')](_0x76f4('0x2e'),_0x1c2c5c);}};exports[_0x76f4('0x2f')]=function(_0x46ba77){var _0x2580e3=moment()[_0x76f4('0xf')](_0x76f4('0x30'));_0x46ba77[_0x76f4('0x31')]=0xd;_0x46ba77['statedesc']='Blacklist';_0x46ba77['starttime']=_0x2580e3;_0x46ba77['responsetime']=_0x2580e3;_0x46ba77[_0x76f4('0x32')]=_0x2580e3;};exports[_0x76f4('0x33')]=function(_0x1d5782,_0x456b1f,_0x26fdd6){var _0x51aa36=moment()[_0x76f4('0xf')](_0x76f4('0x30'));_0x1d5782[_0x76f4('0x31')]=_0x456b1f;_0x1d5782[_0x76f4('0x34')]=_0x26fdd6;_0x1d5782[_0x76f4('0x35')]=_0x51aa36;_0x1d5782[_0x76f4('0x36')]=utils[_0x76f4('0x37')](_0x1d5782[_0x76f4('0x35')],_0x1d5782[_0x76f4('0x38')]);};exports[_0x76f4('0x39')]=function(_0x6953ca,_0x244607,_0x2d744e){_0x6953ca[_0x76f4('0x3a')]=_0x244607;_0x6953ca[_0x76f4('0x3b')]=_0x2d744e;};exports[_0x76f4('0x3c')]=function(_0x3308e3,_0x336b5e,_0x597119){var _0x4038b3=moment()[_0x76f4('0xf')](_0x76f4('0x30'));_0x3308e3['state']=_0x336b5e;_0x3308e3['statedesc']=_0x597119;_0x3308e3[_0x76f4('0x35')]=_0x3308e3['responsetime']?_0x3308e3[_0x76f4('0x35')]:_0x4038b3;_0x3308e3['endtime']=_0x3308e3[_0x76f4('0x32')]?_0x3308e3[_0x76f4('0x32')]:_0x4038b3;_0x3308e3[_0x76f4('0x36')]=utils[_0x76f4('0x37')](_0x3308e3[_0x76f4('0x35')]||0x0,_0x3308e3[_0x76f4('0x38')]||0x0);_0x3308e3[_0x76f4('0x3d')]=_0x3308e3[_0x76f4('0x3e')]?utils[_0x76f4('0x37')](_0x3308e3[_0x76f4('0x32')],_0x3308e3['answertime']):0x0;};exports['isFailure']=function(_0x1f7bac){return _0x1f7bac===_0x76f4('0x3f');};exports[_0x76f4('0x40')]=function(_0x427c70,_0x2b7dc8,_0x2d6068,_0x42754d,_0x122856){var _0x308bab=_0x42754d?'RECALL':_0x427c70[_0x76f4('0x41')];_0x308bab=_0x122856?_0x76f4('0x42'):_0x308bab;return{'actionid':_0x427c70['uniqueid'],'action':'originate','channel':_0x427c70[_0x76f4('0x43')],'callerid':util[_0x76f4('0xf')](_0x76f4('0x10'),_0x308bab,_0x427c70[_0x76f4('0x18')]),'Exten':_0x76f4('0x24'),'Context':'from-sip','Priority':'1','variable':_0x2d6068,'timeout':(_0x2b7dc8[_0x76f4('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x427c70[_0x76f4('0x45')]};};exports[_0x76f4('0x46')]=function(_0x10217d){return _0x10217d[_0x76f4('0x47')]+_0x10217d[_0x76f4('0x48')]+_0x10217d['countnoanswerretry']+_0x10217d[_0x76f4('0x49')]+_0x10217d[_0x76f4('0x4a')];};exports[_0x76f4('0x4b')]=function(_0x4bfab1){var _0x571261=_[_0x76f4('0x4c')](_0x4bfab1);_0x571261[_0x76f4('0x31')]=0xf;_0x571261[_0x76f4('0x34')]=_0x76f4('0x4d');return _0x571261;};exports[_0x76f4('0x4e')]=function(_0x5da3db,_0x532557,_0x8e5b60){var _0x4a1f9f={};_0x4a1f9f[_0x532557]=_0x5da3db[_0x532557];_0x4a1f9f[_0x76f4('0x4f')]=![];_0x4a1f9f[_0x76f4('0x50')]=moment()['add'](_0x8e5b60,'minutes')[_0x76f4('0xf')](_0x76f4('0x30'));_0x4a1f9f[_0x76f4('0x19')]=_0x5da3db[_0x76f4('0x19')];_0x4a1f9f['ListId']=_0x5da3db[_0x76f4('0x51')];_0x4a1f9f[_0x76f4('0x52')]=_0x5da3db[_0x76f4('0x52')]||undefined;return _0x4a1f9f;};exports['decrementTalkink']=function(_0x23afe4,_0x6bbcf2){if(!_['isNil'](_0x23afe4)){if(_0x23afe4['pTalking']>0x0){_0x23afe4[_0x76f4('0x53')]-=0x1;}else{logger[_0x76f4('0x2c')](_0x6bbcf2,_0x76f4('0x54'));}}else{logger[_0x76f4('0x2c')](_0x6bbcf2,_0x76f4('0x55'));}};exports['IsNotLoggedIn']=function(_0xa3d139){if(_0xa3d139<=0x0){return!![];}return![];};function buildObj(_0x597de5,_0x27d95a,_0x3ea748){_0x597de5[_0x76f4('0x56')]=_0x27d95a;_0x597de5['name']=_0x597de5[_0x76f4('0x57')];_0x597de5[_0x76f4('0x58')]=_0x597de5['channelAgent'];_0x597de5[_0x76f4('0x59')]=_0x76f4('0x5a');if(_0x3ea748){_0x597de5[_0x76f4('0x5b')]=_0x3ea748[_0x76f4('0x5b')];}return _0x597de5;}exports[_0x76f4('0x5c')]=buildObj;exports['agentReadyId']=function(_0x1041da){var _0x533380=[];for(var _0x45b246 in _0x1041da){if(_0x1041da[_0x76f4('0x28')](_0x45b246)){if(!_[_0x76f4('0x14')](_0x1041da[_0x45b246])&&_0x1041da[_0x45b246]['state']===_0x76f4('0x5d')&&_0x1041da[_0x45b246][_0x76f4('0x5e')]===_0x76f4('0x5f')){_0x533380[_0x76f4('0x60')](_0x1041da[_0x45b246]['id']);}}}return _0x533380;};exports['getDiff']=function(_0x2028e9){var _0xf11e07=moment()[_0x76f4('0x61')](0x0);var _0xff4b9b=moment(_0x2028e9)['milliseconds'](0x0);return _0xf11e07[_0x76f4('0x62')](_0xff4b9b,'seconds');};exports[_0x76f4('0x63')]=function(_0x190c8d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x190c8d['ContactId'],'ListId':_0x190c8d['ListId'],'VoiceQueueId':_0x190c8d[_0x76f4('0x52')]||undefined,'CampaignId':_0x190c8d[_0x76f4('0x64')]||undefined};};exports[_0x76f4('0x65')]=function(_0x596b51){if(_0x596b51===_0x76f4('0x45')||_0x596b51===_0x76f4('0x66')||_0x596b51===_0x76f4('0x57')||_0x596b51==='type'||_0x596b51==='campaigntype'||_0x596b51===_0x76f4('0x67')||_0x596b51===_0x76f4('0x3a')||_0x596b51==='channelAgent'||_0x596b51==='calleridname'||_0x596b51===_0x76f4('0x4f')||_0x596b51===_0x76f4('0x18')||_0x596b51===_0x76f4('0x50')||_0x596b51===_0x76f4('0x47')||_0x596b51===_0x76f4('0x48')||_0x596b51===_0x76f4('0x68')||_0x596b51===_0x76f4('0x69')||_0x596b51===_0x76f4('0x6a')||_0x596b51===_0x76f4('0x6b')||_0x596b51==='callbackat'||_0x596b51==='recallme'||_0x596b51==='ContactId'||_0x596b51===_0x76f4('0x51')||_0x596b51===_0x76f4('0x3b')||_0x596b51===_0x76f4('0x52')||_0x596b51===_0x76f4('0x6c')||_0x596b51==='xmd-voicequeueid'||_0x596b51==='xmd-queue'||_0x596b51===_0x76f4('0x6d')||_0x596b51==='xmd-listid'||_0x596b51===_0x76f4('0x6e')||_0x596b51==='xmd-dialtimeout'||_0x596b51===_0x76f4('0x6f')||_0x596b51===_0x76f4('0x70')||_0x596b51===_0x76f4('0x71')||_0x596b51===_0x76f4('0x72')||_0x596b51==='xmd-cdrtype'||_0x596b51===_0x76f4('0x73')||_0x596b51===_0x76f4('0x74')||_0x596b51===_0x76f4('0x75')||_0x596b51===_0x76f4('0x76')||_0x596b51===_0x76f4('0x77')||_0x596b51===_0x76f4('0x78')||_0x596b51===_0x76f4('0x79')||_0x596b51==='rtpaudioqosloss'||_0x596b51===_0x76f4('0x7a')||_0x596b51===_0x76f4('0x7b')||_0x596b51===_0x76f4('0x7c')||_0x596b51===_0x76f4('0x76')||_0x596b51===_0x76f4('0x77')||_0x596b51===_0x76f4('0x78')||_0x596b51===_0x76f4('0x79')||_0x596b51===_0x76f4('0x7d')||_0x596b51==='rtpaudioqoslossbridged'||_0x596b51==='rtpaudioqosrtt'||_0x596b51===_0x76f4('0x7c')||_0x596b51===_0x76f4('0x7e')||_0x596b51===_0x76f4('0x7f')||_0x596b51==='state'||_0x596b51===_0x76f4('0x34')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x13b012,_0x31aa51){var _0x4e837b,_0xda0ac2,_0x37b7f7;if(_0x31aa51<=0x0){_0x31aa51=0x1;}_0x4e837b=new RegExp(_0x76f4('0x80')+_0x31aa51+'}$');_0xda0ac2=Math[_0x76f4('0x81')](0xa,_0x31aa51-0x1);_0x37b7f7=Math[_0x76f4('0x81')](0xa,_0x31aa51)-0x1;return util[_0x76f4('0xf')]('%s',_[_0x76f4('0x82')](_0x13b012,_0x4e837b,_[_0x76f4('0x83')](_0xda0ac2,_0x37b7f7)));};exports[_0x76f4('0x84')]=function(_0x47a27f){var _0x456b5d=_0x47a27f['match'](/"(.*?)"/);return _0x456b5d?_0x456b5d[0x1]:_0x47a27f;};exports[_0x76f4('0x85')]=function(_0x2488c7){var _0xbf19e7=_0x2488c7[_0x76f4('0x86')](/<(.*?)>/);return _0xbf19e7?_0xbf19e7[0x1]:_0x2488c7;};function buildNoAnswerEventPayload(_0xfbb52c,_0x8de630){var _0x3a5d96=buildObj(_0xfbb52c,_0x76f4('0x87'));if(!_[_0x76f4('0xe')](_0x8de630[_0x76f4('0x88')])){Object['keys'](_0x8de630[_0x76f4('0x88')])[_0x76f4('0x89')](function(_0x47bca3){_0x3a5d96[_0x47bca3[_0x76f4('0x8a')]()]=_0x8de630[_0x76f4('0x88')][_0x47bca3];});}return _0x3a5d96;}exports[_0x76f4('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xdbad=['moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','getSeconds','logLookAgent','UserId','logCustomer','talktime','answertime','Failure','variablesAction','BOOKED','channelAgent','timeout','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ContactId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','buildObj','agentReadyId','not_inuse','status','reachable','getDiff','milliseconds','createBody','ListId','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash'];(function(_0x3e289b,_0x10e9a2){var _0x316c5d=function(_0x1c7d06){while(--_0x1c7d06){_0x3e289b['push'](_0x3e289b['shift']());}};_0x316c5d(++_0x10e9a2);}(_0xdbad,0x8f));var _0xddba=function(_0x234f79,_0x4302c9){_0x234f79=_0x234f79-0x0;var _0x4d3bb6=_0xdbad[_0x234f79];return _0x4d3bb6;};'use strict';var util=require(_0xddba('0x0'));var _=require(_0xddba('0x1'));var moment=require(_0xddba('0x2'));var logger=require(_0xddba('0x3'))(_0xddba('0x4'));var ipAgi=process[_0xddba('0x5')][_0xddba('0x6')]||_0xddba('0x7');var utils=require(_0xddba('0x8'));exports[_0xddba('0x9')]=function(_0x45b439){return function(_0x3c62ee){logger[_0xddba('0xa')](_0x45b439,util[_0xddba('0xb')](_0x3c62ee,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x23d48f,_0x2e30d9){logger[_0xddba('0xc')](_0x23d48f,util[_0xddba('0xb')](_0x2e30d9,{'showHidden':![],'depth':null}));};exports[_0xddba('0xd')]=function(_0x3083d4,_0x2bcc4a){logger['error'](_0x3083d4,util[_0xddba('0xb')](_0x2bcc4a,{'showHidden':![],'depth':null}));};exports[_0xddba('0xe')]=function(_0x233c4c){return function(_0x5d5c81){logger['info'](_0x233c4c,util[_0xddba('0xb')](_0x5d5c81,{'showHidden':![],'depth':null}));};};exports[_0xddba('0xf')]=function(_0x4a2eb0,_0x2eace0,_0x212351){return{'message':_0x4a2eb0,'unlock':_0x2eace0,'active':_0x212351};};exports['getCallerId']=function(_0x1c78b5,_0x3074f1,_0x53ef1d){if(!_[_0xddba('0x10')](_0x53ef1d)&&_0xddba('0x11')===typeof _0x53ef1d&&!_[_0xddba('0x12')](_0x53ef1d)){if(!_[_0xddba('0x10')](_0x3074f1)&&_0xddba('0x11')===typeof _0x3074f1&&!_[_0xddba('0x12')](_0x3074f1)){return util[_0xddba('0x13')](_0xddba('0x14'),_0x3074f1,_0x53ef1d);}return util['format'](_0xddba('0x14'),_0x53ef1d,_0x53ef1d);}if(!_['isUndefined'](_0x1c78b5)&&_0xddba('0x11')===typeof _0x1c78b5&&!_[_0xddba('0x12')](_0x1c78b5)){return _0x1c78b5;}return _0xddba('0x15');};exports['isActive']=function(_0x42de33){if(_[_0xddba('0x16')](_0x42de33)){return![];}return _0x42de33;};exports['addVariables']=function(_0x5232d5,_0x475944,_0x30a811,_0x16bbe4,_0x11c659,_0x1d3d07){var _0x121adb={'XMD-QUEUE':_0x475944[_0xddba('0x17')]?_0x475944['Queue'][_0xddba('0x18')]:'','XMD-CALLERID':_0x16bbe4,'XMD-CALLERID-PREVIEW':_0x1d3d07?util[_0xddba('0x13')]('\x22%s\x22\x20<%s>',_0x1d3d07[_0xddba('0x19')],_0x1d3d07[_0xddba('0x1a')]):_0x16bbe4,'XMD-DIALID':_0x11c659,'XMD-CONTACTID':_0x475944['ContactId'],'XMD-CDRTYPE':_0xddba('0x1b'),'CALLERID(all)':_0x16bbe4,'XMD-VOICEQUEUEID':_0x475944[_0xddba('0x1c')],'XMD-DIALCHANNEL':_0x30a811,'XMD-DIALTIMEOUT':_0x5232d5[_0xddba('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xddba('0x13')](_0xddba('0x1e'),_0x5232d5['dialQueueProject2']?'g':'',_[_0xddba('0x12')](_0x5232d5[_0xddba('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5232d5['dialPreviewUrl']||'','XMD-AGI':_0x5232d5[_0xddba('0x20')]?util[_0xddba('0x13')](_0xddba('0x21'),ipAgi,_0x5232d5[_0xddba('0x20')]):_0xddba('0x22'),'XMD-AGIAFTER':_0x5232d5['dialQueueProject2']?util[_0xddba('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5232d5[_0xddba('0x23')]):_0xddba('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x1d3d07?_0x1d3d07[_0xddba('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x1d3d07?_0x1d3d07[_0xddba('0x25')]:'','XMD-DESTINATION':_0xddba('0x26'),'SIPADDHEADER':_0xddba('0x27')};if(!_[_0xddba('0x12')](_0x5232d5[_0xddba('0x1f')])){_0x121adb[util[_0xddba('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5232d5[_0xddba('0x1f')];_0x121adb[util[_0xddba('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x11c659;}return _0x121adb;};exports[_0xddba('0x28')]=function(_0x26281d){var _0x4c8592={};for(var _0x247a1d in _0x26281d){if(_0x26281d[_0xddba('0x29')](_0x247a1d)){_0x4c8592[util['format']('%s',_[_0xddba('0x2a')](_0x247a1d))]=_0x26281d[_0x247a1d];}}return{'variables':_0x4c8592};};exports[_0xddba('0x2b')]=function(_0x464a9c,_0x28e24e){if(!_[_0xddba('0x16')](_0x464a9c)){if(_0x464a9c[_0xddba('0x29')](_0xddba('0x2c'))){if(_0x464a9c['originated']>0x0){_0x464a9c[_0xddba('0x2c')]-=0x1;}else{logger[_0xddba('0xa')](_0xddba('0x2d'),_0x28e24e);}}}else{logger[_0xddba('0xa')](_0xddba('0x2e'),_0x28e24e);}};exports[_0xddba('0x2f')]=function(_0x56304b){var _0x11c974=moment()['format'](_0xddba('0x30'));_0x56304b['state']=0xd;_0x56304b[_0xddba('0x31')]=_0xddba('0x32');_0x56304b[_0xddba('0x33')]=_0x11c974;_0x56304b[_0xddba('0x34')]=_0x11c974;_0x56304b[_0xddba('0x35')]=_0x11c974;};exports[_0xddba('0x36')]=function(_0x4c37cc,_0xf508b7,_0x169c01){var _0x53a2c1=moment()[_0xddba('0x13')](_0xddba('0x30'));_0x4c37cc[_0xddba('0x37')]=_0xf508b7;_0x4c37cc[_0xddba('0x31')]=_0x169c01;_0x4c37cc[_0xddba('0x34')]=_0x53a2c1;_0x4c37cc[_0xddba('0x38')]=utils[_0xddba('0x39')](_0x4c37cc[_0xddba('0x34')],_0x4c37cc[_0xddba('0x33')]);};exports[_0xddba('0x3a')]=function(_0xf2aab8,_0x1271d3,_0x447a68){_0xf2aab8['membername']=_0x1271d3;_0xf2aab8[_0xddba('0x3b')]=_0x447a68;};exports[_0xddba('0x3c')]=function(_0x4afea3,_0x5a0ae9,_0x15193b){var _0x279f61=moment()[_0xddba('0x13')](_0xddba('0x30'));_0x4afea3[_0xddba('0x37')]=_0x5a0ae9;_0x4afea3['statedesc']=_0x15193b;_0x4afea3['responsetime']=_0x4afea3[_0xddba('0x34')]?_0x4afea3[_0xddba('0x34')]:_0x279f61;_0x4afea3[_0xddba('0x35')]=_0x4afea3[_0xddba('0x35')]?_0x4afea3['endtime']:_0x279f61;_0x4afea3[_0xddba('0x38')]=utils['getSeconds'](_0x4afea3['responsetime']||0x0,_0x4afea3[_0xddba('0x33')]||0x0);_0x4afea3[_0xddba('0x3d')]=_0x4afea3[_0xddba('0x3e')]?utils[_0xddba('0x39')](_0x4afea3[_0xddba('0x35')],_0x4afea3[_0xddba('0x3e')]):0x0;};exports['isFailure']=function(_0x41f791){return _0x41f791===_0xddba('0x3f');};exports[_0xddba('0x40')]=function(_0x85a59b,_0x3748c3,_0x29e3bc,_0x391317,_0x484592){var _0x40cd05=_0x391317?'RECALL':_0x85a59b[_0xddba('0x19')];_0x40cd05=_0x484592?_0xddba('0x41'):_0x40cd05;return{'actionid':_0x85a59b['uniqueid'],'action':'originate','channel':_0x85a59b[_0xddba('0x42')],'callerid':util[_0xddba('0x13')](_0xddba('0x14'),_0x40cd05,_0x85a59b[_0xddba('0x1a')]),'Exten':_0xddba('0x26'),'Context':'from-sip','Priority':'1','variable':_0x29e3bc,'timeout':(_0x3748c3[_0xddba('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x85a59b[_0xddba('0x44')]};};exports['totalGlobal']=function(_0x3c62d4){return _0x3c62d4[_0xddba('0x45')]+_0x3c62d4[_0xddba('0x46')]+_0x3c62d4[_0xddba('0x47')]+_0x3c62d4[_0xddba('0x48')]+_0x3c62d4[_0xddba('0x49')];};exports[_0xddba('0x4a')]=function(_0x494a1d){var _0x2ceef2=_[_0xddba('0x4b')](_0x494a1d);_0x2ceef2['state']=0xf;_0x2ceef2[_0xddba('0x31')]=_0xddba('0x4c');return _0x2ceef2;};exports[_0xddba('0x4d')]=function(_0x246045,_0x1f4861,_0x1555d5){var _0x4c9d4b={};_0x4c9d4b[_0x1f4861]=_0x246045[_0x1f4861];_0x4c9d4b['active']=![];_0x4c9d4b[_0xddba('0x4e')]=moment()[_0xddba('0x4f')](_0x1555d5,_0xddba('0x50'))[_0xddba('0x13')](_0xddba('0x30'));_0x4c9d4b[_0xddba('0x51')]=_0x246045[_0xddba('0x51')];_0x4c9d4b['ListId']=_0x246045['ListId'];_0x4c9d4b[_0xddba('0x1c')]=_0x246045[_0xddba('0x1c')]||undefined;return _0x4c9d4b;};exports['decrementTalkink']=function(_0x5c49d5,_0xd18409){if(!_['isNil'](_0x5c49d5)){if(_0x5c49d5[_0xddba('0x52')]>0x0){_0x5c49d5[_0xddba('0x52')]-=0x1;}else{logger['error'](_0xd18409,_0xddba('0x53'));}}else{logger['error'](_0xd18409,_0xddba('0x54'));}};exports[_0xddba('0x55')]=function(_0x1c11b2){if(_0x1c11b2<=0x0){return!![];}return![];};function buildObj(_0x56d0c8,_0x465b95,_0x5d36d1){_0x56d0c8[_0xddba('0x56')]=_0x465b95;_0x56d0c8[_0xddba('0x18')]=_0x56d0c8[_0xddba('0x57')];_0x56d0c8[_0xddba('0x58')]=_0x56d0c8[_0xddba('0x42')];_0x56d0c8[_0xddba('0x59')]=_0xddba('0x5a');if(_0x5d36d1){_0x56d0c8['mandatoryDisposition']=_0x5d36d1['mandatoryDisposition'];}return _0x56d0c8;}exports[_0xddba('0x5b')]=buildObj;exports[_0xddba('0x5c')]=function(_0x504076){var _0x20b605=[];for(var _0x329ecc in _0x504076){if(_0x504076['hasOwnProperty'](_0x329ecc)){if(!_['isNil'](_0x504076[_0x329ecc])&&_0x504076[_0x329ecc][_0xddba('0x37')]===_0xddba('0x5d')&&_0x504076[_0x329ecc][_0xddba('0x5e')]===_0xddba('0x5f')){_0x20b605['push'](_0x504076[_0x329ecc]['id']);}}}return _0x20b605;};exports[_0xddba('0x60')]=function(_0x4a1284){var _0x187351=moment()[_0xddba('0x61')](0x0);var _0x3719be=moment(_0x4a1284)['milliseconds'](0x0);return _0x187351['diff'](_0x3719be,'seconds');};exports[_0xddba('0x62')]=function(_0x2f5990){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2f5990[_0xddba('0x51')],'ListId':_0x2f5990[_0xddba('0x63')],'VoiceQueueId':_0x2f5990['VoiceQueueId']||undefined,'CampaignId':_0x2f5990[_0xddba('0x64')]||undefined};};exports[_0xddba('0x65')]=function(_0x2322aa){if(_0x2322aa===_0xddba('0x44')||_0x2322aa===_0xddba('0x66')||_0x2322aa===_0xddba('0x57')||_0x2322aa===_0xddba('0x67')||_0x2322aa===_0xddba('0x68')||_0x2322aa===_0xddba('0x69')||_0x2322aa==='membername'||_0x2322aa==='channelAgent'||_0x2322aa===_0xddba('0x19')||_0x2322aa===_0xddba('0x6a')||_0x2322aa===_0xddba('0x1a')||_0x2322aa===_0xddba('0x4e')||_0x2322aa===_0xddba('0x45')||_0x2322aa==='countcongestionretry'||_0x2322aa===_0xddba('0x47')||_0x2322aa==='countglobal'||_0x2322aa===_0xddba('0x6b')||_0x2322aa==='callbackuniqueid'||_0x2322aa===_0xddba('0x6c')||_0x2322aa===_0xddba('0x6d')||_0x2322aa==='ContactId'||_0x2322aa===_0xddba('0x63')||_0x2322aa==='UserId'||_0x2322aa==='VoiceQueueId'||_0x2322aa===_0xddba('0x6e')||_0x2322aa===_0xddba('0x6f')||_0x2322aa===_0xddba('0x70')||_0x2322aa===_0xddba('0x71')||_0x2322aa==='xmd-listid'||_0x2322aa===_0xddba('0x72')||_0x2322aa==='xmd-dialtimeout'||_0x2322aa===_0xddba('0x73')||_0x2322aa==='xmd-dialid'||_0x2322aa==='xmd-dialchannel'||_0x2322aa===_0xddba('0x74')||_0x2322aa===_0xddba('0x75')||_0x2322aa===_0xddba('0x76')||_0x2322aa===_0xddba('0x77')||_0x2322aa===_0xddba('0x78')||_0x2322aa===_0xddba('0x79')||_0x2322aa===_0xddba('0x7a')||_0x2322aa===_0xddba('0x7b')||_0x2322aa===_0xddba('0x7c')||_0x2322aa===_0xddba('0x7d')||_0x2322aa==='rtpaudioqoslossbridged'||_0x2322aa===_0xddba('0x7e')||_0x2322aa===_0xddba('0x7f')||_0x2322aa===_0xddba('0x79')||_0x2322aa===_0xddba('0x7a')||_0x2322aa==='rtpaudioqosjitter'||_0x2322aa==='rtpaudioqosjitterbridged'||_0x2322aa===_0xddba('0x7d')||_0x2322aa===_0xddba('0x80')||_0x2322aa===_0xddba('0x7e')||_0x2322aa===_0xddba('0x7f')||_0x2322aa===_0xddba('0x81')||_0x2322aa===_0xddba('0x82')||_0x2322aa===_0xddba('0x37')||_0x2322aa===_0xddba('0x31')){return![];}return!![];};exports[_0xddba('0x83')]=function(_0x34bee6,_0x1488aa){var _0x556f65,_0x52acbb,_0x1bf131;if(_0x1488aa<=0x0){_0x1488aa=0x1;}_0x556f65=new RegExp(_0xddba('0x84')+_0x1488aa+'}$');_0x52acbb=Math['pow'](0xa,_0x1488aa-0x1);_0x1bf131=Math[_0xddba('0x85')](0xa,_0x1488aa)-0x1;return util[_0xddba('0x13')]('%s',_[_0xddba('0x86')](_0x34bee6,_0x556f65,_[_0xddba('0x87')](_0x52acbb,_0x1bf131)));};exports[_0xddba('0x88')]=function(_0x1ce9d2){var _0x2fd947=_0x1ce9d2[_0xddba('0x89')](/"(.*?)"/);return _0x2fd947?_0x2fd947[0x1]:_0x1ce9d2;};exports[_0xddba('0x8a')]=function(_0x1a7c16){var _0x270de3=_0x1a7c16[_0xddba('0x89')](/<(.*?)>/);return _0x270de3?_0x270de3[0x1]:_0x1a7c16;};function buildNoAnswerEventPayload(_0x49544c,_0x23061a){var _0x4f7561=buildObj(_0x49544c,_0xddba('0x8b'));if(!_['isEmpty'](_0x23061a[_0xddba('0x8c')])){Object[_0xddba('0x8d')](_0x23061a[_0xddba('0x8c')])[_0xddba('0x8e')](function(_0x99c62f){_0x4f7561[_0x99c62f[_0xddba('0x8f')]()]=_0x23061a[_0xddba('0x8c')][_0x99c62f];});}return _0x4f7561;}exports[_0xddba('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 93b9e50..485fa74 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 _0x200f=['voicequeuechannelredirect','queueadd','string','number','queueremove','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0x200f,0xc9));var _0xf200=function(_0x47dd05,_0x4aa69a){_0x47dd05=_0x47dd05-0x0;var _0x1ac7c7=_0x200f[_0x47dd05];return _0x1ac7c7;};'use strict';exports[_0xf200('0x0')]={'queue':{'type':_0xf200('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xf200('0x1'),'required':!![]},'penalty':{'type':_0xf200('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xf200('0x3')]={'queue':{'type':_0xf200('0x1'),'required':!![]},'interface':{'type':_0xf200('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0xf200('0x4')},'reason':{'type':_0xf200('0x1'),'required':![]}};exports[_0xf200('0x5')]={'module':{'type':'string','required':![]}};exports[_0xf200('0x6')]={'uniqueid':{'type':_0xf200('0x1'),'required':!![]}};exports[_0xf200('0x7')]={'uniqueid':{'type':_0xf200('0x1'),'required':!![]},'filename':{'type':_0xf200('0x1')},'format':{'type':_0xf200('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xf200('0x8')]={'uniqueid':{'type':_0xf200('0x1'),'required':!![]}};exports[_0xf200('0x9')]={'uniqueid':{'type':_0xf200('0x1'),'required':!![]},'exten':{'type':_0xf200('0x1'),'required':!![]},'context':{'type':_0xf200('0x1')}}; \ No newline at end of file +var _0xf10d=['queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x4314c9,_0x1a6d36){var _0x1f8798=function(_0x27858f){while(--_0x27858f){_0x4314c9['push'](_0x4314c9['shift']());}};_0x1f8798(++_0x1a6d36);}(_0xf10d,0x132));var _0xdf10=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xf10d[_0x255d5b];return _0x3e141a;};'use strict';exports[_0xdf10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xdf10('0x1'),'required':!![]},'membername':{'type':_0xdf10('0x1'),'required':!![]},'penalty':{'type':_0xdf10('0x2'),'required':![]},'paused':{'type':_0xdf10('0x3'),'required':![]}};exports[_0xdf10('0x4')]={'queue':{'type':_0xdf10('0x1'),'required':!![]},'interface':{'type':_0xdf10('0x1'),'required':!![]}};exports[_0xdf10('0x5')]={'interface':{'type':_0xdf10('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xdf10('0x1'),'required':![]}};exports[_0xdf10('0x6')]={'module':{'type':_0xdf10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0xdf10('0x7')]={'uniqueid':{'type':_0xdf10('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0xdf10('0x1')}};exports[_0xdf10('0x8')]={'uniqueid':{'type':_0xdf10('0x1'),'required':!![]}};exports[_0xdf10('0x9')]={'uniqueid':{'type':_0xdf10('0x1'),'required':!![]},'exten':{'type':_0xdf10('0x1'),'required':!![]},'context':{'type':_0xdf10('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 0b729cd..df9bc40 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 _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x2187ed,_0x4102b1){var _0x2693e3=function(_0x3ceef1){while(--_0x3ceef1){_0x2187ed['push'](_0x2187ed['shift']());}};_0x2693e3(++_0x4102b1);}(_0x5f2f,0x73));var _0xf5f2=function(_0xce137e,_0x20bce1){_0xce137e=_0xce137e-0x0;var _0xb4aab7=_0x5f2f[_0xce137e];return _0xb4aab7;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0b0e,0x187));var _0xe0b0=function(_0x32358b,_0x5c7c35){_0x32358b=_0x32358b-0x0;var _0x58c21d=_0x0b0e[_0x32358b];return _0x58c21d;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 10a1e98..23b1f8a 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 _0xddae=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xddae,0x1de));var _0xedda=function(_0x44abf9,_0x25790b){_0x44abf9=_0x44abf9-0x0;var _0x4e9de3=_0xddae[_0x44abf9];return _0x4e9de3;};'use strict';function mergeDBDataToRealtime(_0x38d45b,_0x338a21){var _0x5ee586=Object['assign']({},_0x38d45b);for(var _0x214e9d in _0x338a21){if(_0x5ee586[_0xedda('0x0')](_0x214e9d)){_0x5ee586[_0x214e9d]=_0x338a21[_0x214e9d];}}return _0x5ee586;}exports[_0xedda('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x48ac=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x2d6df9,_0x45da50){var _0x429b18=function(_0x5b3c09){while(--_0x5b3c09){_0x2d6df9['push'](_0x2d6df9['shift']());}};_0x429b18(++_0x45da50);}(_0x48ac,0x171));var _0xc48a=function(_0xc83a81,_0x51b682){_0xc83a81=_0xc83a81-0x0;var _0x28337c=_0x48ac[_0xc83a81];return _0x28337c;};'use strict';function mergeDBDataToRealtime(_0x3a0d1a,_0x28a6eb){var _0x499203=Object[_0xc48a('0x0')]({},_0x3a0d1a);for(var _0x15962f in _0x28a6eb){if(_0x499203[_0xc48a('0x1')](_0x15962f)){_0x499203[_0x15962f]=_0x28a6eb[_0x15962f];}}return _0x499203;}exports[_0xc48a('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 44ea582..81e0310 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 _0x054e=['accountcode','interface','format','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','getCallType','channel','getAgentByInternal','outbound','destination','exten','dialer','queue','lastdata','callerid','context','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','blindTransfer','type','UserId','split','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','isArray','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceAgentReport','./userReport','agents','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','attendedtransfer','attendedTransfer','find','name','isNil'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x054e,0x185));var _0xe054=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x054e[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var moment=require(_0xe054('0x0'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0xe054('0x1'));var RpcVoiceAgentReport=require(_0xe054('0x2'));var RpcVoiceCallReport=require(_0xe054('0x3'));var RpcVoiceDialReport=require(_0xe054('0x4'));var RpcMemberReport=require(_0xe054('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xe054('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xe054('0x7'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xe054('0x8'));function Report(_0x190381){this['realtime']=_0x190381;this['agents']=_0x190381[_0xe054('0x9')];this['telephones']=_0x190381['telephones'];}Report[_0xe054('0xa')]['sync']=function(_0x38e54b){var _0x2a1ad3=new VoiceQueueReport(this['realtime']);var _0x5ccf1a=new VoiceAgentReport(this[_0xe054('0xb')]);var _0x4794a9=new VoiceDialReport(this[_0xe054('0xb')]);var _0x536a34=new VoiceCallReport(this[_0xe054('0xb')]);var _0x2926ba=new UserReport(this[_0xe054('0xb')]);if(config['xdr']&&config[_0xe054('0xc')][_0xe054('0xd')]){ami['on'](_0xe054('0xe'),this[_0xe054('0xf')][_0xe054('0x10')](this));ami['on']('custom:voiceCallReport',this[_0xe054('0x11')][_0xe054('0x10')](this));ami['on']('custom:voiceAgentReport',this[_0xe054('0x12')][_0xe054('0x10')](this));ami['on'](_0xe054('0x13'),this[_0xe054('0x14')][_0xe054('0x10')](this));ami['on']('blindtransfer',this['blindTransfer'][_0xe054('0x10')](this));ami['on'](_0xe054('0x15'),this[_0xe054('0x16')]['bind'](this));}};Report[_0xe054('0xa')]['findAgent']=function(_0x1bd4e0){var _0x54ebe1;_0x54ebe1=_[_0xe054('0x17')](this[_0xe054('0x9')],function(_0x424d8b){return _0x424d8b['accountcode']==_0x1bd4e0||_0x424d8b[_0xe054('0x18')]==_0x1bd4e0;});if(_[_0xe054('0x19')](_0x54ebe1)){var _0x367101=_[_0xe054('0x17')](this['telephones'],function(_0x9c1bed){return _0x9c1bed[_0xe054('0x1a')]==_0x1bd4e0||_0x9c1bed[_0xe054('0x18')]==_0x1bd4e0;});if(_0x367101){_0x54ebe1=_[_0xe054('0x17')](this[_0xe054('0x9')],function(_0x396cba){return _0x396cba[_0xe054('0x1b')]==util[_0xe054('0x1c')](_0xe054('0x1d'),_0x367101[_0xe054('0x18')]);});}}return _0x54ebe1;};Report['prototype'][_0xe054('0xf')]=function(_0x530e9c){for(var _0x5696f1=0x0;_0x5696f1<_0x530e9c[_0xe054('0x1e')];_0x5696f1+=0x1){var _0x4a63a9=this[_0xe054('0x1f')](_0x530e9c[_0x5696f1][_0xe054('0x20')]);if(_0x4a63a9){_0x530e9c[_0x5696f1][_0xe054('0x1a')]=_0x4a63a9[_0xe054('0x1a')];_0x530e9c[_0x5696f1][_0xe054('0x21')]=!![];_0x530e9c[_0x5696f1][_0xe054('0x22')]=_0x4a63a9[_0xe054('0x18')];_0x530e9c[_0x5696f1][_0xe054('0x1b')]=_[_0xe054('0x19')](_0x4a63a9[_0xe054('0x1b')])?util[_0xe054('0x1c')]('SIP/%s',_0x4a63a9[_0xe054('0x18')]):_0x4a63a9[_0xe054('0x1b')];if(_0x530e9c[_0x5696f1]['queuecallercomplete']){_0x530e9c[_0x5696f1][_0xe054('0x23')]=moment()['format'](_0xe054('0x24'));}if(_0x530e9c[_0x5696f1][_0xe054('0x25')]){_0x530e9c[_0x5696f1][_0xe054('0x26')]=moment()['format'](_0xe054('0x24'));}RpcMemberReport[_0xe054('0xf')](_0x530e9c[_0x5696f1]);}RpcVoiceQueueReport[_0xe054('0x27')](_0x530e9c[_0x5696f1]);}};function extractCalleridNumber(_0x175821){var _0x18821a=_0x175821[_0xe054('0x28')](/<(.*?)>/);return _0x18821a?_0x18821a[0x1]:_0x175821;}Report[_0xe054('0xa')]['getAgentByInternal']=function(_0x2f110a){for(var _0x343130=0x0;_0x343130/);return _0x183ce3?_0x183ce3[0x1]:_0x1a6a95;}Report[_0x170e('0x10')][_0x170e('0x2f')]=function(_0x1df948){for(var _0xd89d81=0x0;_0xd89d81',_0x4bc834['calleridname'],_0x4bc834[_0x170e('0x34')]);}if(RpcVoiceTransferReport[_0x170e('0x46')][_0x4bc834['linkedid']]){var _0x317af9=RpcVoiceTransferReport[_0x170e('0x46')][_0x4bc834[_0x170e('0x47')]];_0x317af9['transfereelinkedid']=_0x4bc834[_0x170e('0x48')];RpcVoiceTransferReport[_0x170e('0x1b')](_0x317af9);delete RpcVoiceTransferReport[_0x170e('0x46')][_0x4bc834[_0x170e('0x47')]];}if(_[_0x170e('0x22')](_0x4bc834[_0x170e('0x39')])){_0x4bc834[_0x170e('0x39')]=this['getCallType'](_0x4bc834);}if(_[_0x170e('0x22')](_0x4bc834[_0x170e('0x49')])){var _0x1d7b26=_0x4bc834['channel']['split']('-')[0x0];var _0x5cace7=this[_0x170e('0xe')][_0x1d7b26];if(!_0x5cace7)_0x5cace7=this[_0x170e('0x2f')](_0x4bc834[_0x170e('0x20')]);if(_0x5cace7){_0x4bc834[_0x170e('0x49')]=_0x5cace7['id'];_0x4bc834[_0x170e('0x4a')]=_0x5cace7[_0x170e('0x21')];}}RpcVoiceCallReport[_0x170e('0x2d')](_0x4bc834);if(_0x4bc834[_0x170e('0x4b')]){for(var _0x360fba=0x0;_0x360fba<_0x4bc834[_0x170e('0x4c')][_0x170e('0x24')];_0x360fba+=0x1){_0x4bc834[_0x170e('0x4d')]=_0x4bc834[_0x170e('0x4c')][_0x360fba][_0x170e('0x4e')];_0x4bc834['createdAt']=_0x4bc834[_0x170e('0x4c')][_0x360fba][_0x170e('0x4f')];if(_0x4bc834[_0x170e('0x38')]==_0x170e('0x41')){_0x4bc834[_0x170e('0x34')]=_0x4bc834['connectedlinenum'];_0x4bc834['calleridname']=_0x4bc834[_0x170e('0x50')];_0x4bc834['connectedlinenum']=_0x4bc834[_0x170e('0x20')];_0x4bc834[_0x170e('0x50')]=_0x4bc834[_0x170e('0x4a')];_0x4bc834[_0x170e('0x38')]=_0x4bc834[_0x170e('0x42')];}else if(_0x4bc834[_0x170e('0x38')]==_0x170e('0x51')){_0x4bc834[_0x170e('0x34')]=_0x4bc834[_0x170e('0x37')];_0x4bc834[_0x170e('0x38')]=_0x4bc834['originatecalleridnum'];}RpcVoiceRecording[_0x170e('0x2d')](_0x4bc834);}}};Report[_0x170e('0x10')][_0x170e('0x18')]=function(_0x4b05d6){if(_['isArray'](_0x4b05d6)){_0x4b05d6[_0x170e('0x52')](function(_0x17a552){RpcVoiceAgentReport[_0x170e('0x2d')](_0x17a552);});}else{RpcVoiceAgentReport[_0x170e('0x2d')](_0x4b05d6);}};Report['prototype'][_0x170e('0x53')]=function(_0x7a7bf4){RpcVoiceDialReport[_0x170e('0x2d')](_0x7a7bf4);var _0x9e1c01;var _0x514a75;var _0x35dbdb=_0x7a7bf4['channel'];if(_[_0x170e('0x54')](_0x35dbdb,'Local')){_0x514a75=_0x35dbdb[_0x170e('0x55')](_0x35dbdb[_0x170e('0x56')]('/')+0x1,_0x35dbdb[_0x170e('0x56')]('@'));_0x9e1c01=_[_0x170e('0x1f')](this[_0x170e('0xe')],function(_0x59b566){return _0x59b566[_0x170e('0x57')]==_0x514a75||_0x59b566[_0x170e('0x58')]==_0x514a75||_0x59b566[_0x170e('0x20')]==_0x514a75;});}else{_0x514a75=_0x35dbdb[_0x170e('0x55')](_0x35dbdb[_0x170e('0x56')]('/')+0x1,_0x35dbdb[_0x170e('0x59')]('-'));_0x9e1c01=this[_0x170e('0x1e')](_0x514a75);}if(_0x9e1c01){_0x7a7bf4['interface']=_[_0x170e('0x22')](_0x9e1c01[_0x170e('0x27')])?util[_0x170e('0x23')](_0x170e('0x28'),_0x9e1c01[_0x170e('0x21')]):_0x9e1c01['interface'];_0x7a7bf4['membername']=_0x9e1c01[_0x170e('0x21')];_0x7a7bf4[_0x170e('0x20')]=_0x9e1c01[_0x170e('0x20')];RpcMemberReport[_0x170e('0x53')](_0x7a7bf4);}};Report['prototype'][_0x170e('0x1b')]=function(_0x1b6620){RpcVoiceTransferReport[_0x170e('0x46')][_0x1b6620[_0x170e('0x5a')]]=_0x1b6620;};Report[_0x170e('0x10')][_0x170e('0x1d')]=function(_0x739b82){RpcVoiceTransferReport[_0x170e('0x1d')](_0x739b82);};module[_0x170e('0x5b')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 2b31b99..05007ea 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c8f=['phone','accountcode','peerstatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','info','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','username','[userReport][registry]\x20sending\x20trunk:save\x20event:','name','trunk:save','device','[userReport][devicestatechange]','inuse','local','toLowerCase','toNumber','format','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf'];(function(_0x3fc95e,_0x3b3cb4){var _0x11f30a=function(_0xd218e3){while(--_0xd218e3){_0x3fc95e['push'](_0x3fc95e['shift']());}};_0x11f30a(++_0x3b3cb4);}(_0x6c8f,0x18a));var _0xf6c8=function(_0x1af261,_0x452759){_0x1af261=_0x1af261-0x0;var _0x53b93d=_0x6c8f[_0x1af261];return _0x53b93d;};'use strict';var _=require(_0xf6c8('0x0'));var moment=require(_0xf6c8('0x1'));var util=require(_0xf6c8('0x2'));var Redis=require(_0xf6c8('0x3'));var BPromise=require('bluebird');var config=require(_0xf6c8('0x4'));var logger=require(_0xf6c8('0x5'))(_0xf6c8('0x6'));var ami=require('../ami');config[_0xf6c8('0x7')]=_[_0xf6c8('0x8')](config['redis'],{'host':_0xf6c8('0x9'),'port':0x18eb});var io=require(_0xf6c8('0xa'))(new Redis(config[_0xf6c8('0x7')]));function UserReport(_0x4f223f){this[_0xf6c8('0xb')]=_0x4f223f[_0xf6c8('0xb')];this[_0xf6c8('0xc')]=_0x4f223f[_0xf6c8('0xc')];this['telephones']=_0x4f223f[_0xf6c8('0xd')];ami['on'](_0xf6c8('0xe'),this[_0xf6c8('0xf')][_0xf6c8('0x10')](this));ami['on'](_0xf6c8('0x11'),this[_0xf6c8('0xf')][_0xf6c8('0x10')](this));ami['on'](_0xf6c8('0x12'),this[_0xf6c8('0x13')][_0xf6c8('0x10')](this));ami['on']('peerstatus',this[_0xf6c8('0x14')][_0xf6c8('0x10')](this));return this[_0xf6c8('0x15')]();}function showSipRegistrations(){Promise[_0xf6c8('0x16')]()[_0xf6c8('0x17')](ami[_0xf6c8('0x18')]())[_0xf6c8('0x19')](function(_0x23d6ac){logger[_0xf6c8('0x1a')](_0xf6c8('0x1b'),util[_0xf6c8('0x1c')](_0x23d6ac,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf6c8('0x16')]()[_0xf6c8('0x17')](ami[_0xf6c8('0x1d')]())[_0xf6c8('0x19')](function(_0x49d49e){logger[_0xf6c8('0x1a')](_0xf6c8('0x1e'),util[_0xf6c8('0x1c')](_0x49d49e,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf6c8('0x16')]()[_0xf6c8('0x17')](ami[_0xf6c8('0x1f')]())[_0xf6c8('0x19')](function(_0x521056){logger[_0xf6c8('0x1a')]('[userReport][sippeerstatus]',util['inspect'](_0x521056,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0xf6c8('0x15')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0xf6c8('0x17')](listDeviceStates())[_0xf6c8('0x17')](showPeersStatus());},0x32c8);};UserReport[_0xf6c8('0x20')][_0xf6c8('0x21')]=function(_0x32f49b){return _0x32f49b!==null&&!_[_0xf6c8('0x22')](_0x32f49b);};UserReport[_0xf6c8('0x20')][_0xf6c8('0x23')]=function(_0x535a80,_0x21e0a2,_0x1a9545){io['to'](_0x535a80)[_0xf6c8('0x23')](_0x21e0a2,_0x1a9545);};UserReport['prototype'][_0xf6c8('0xf')]=function(_0x4f8df3){try{if(this[_0xf6c8('0x21')](_0x4f8df3)){logger[_0xf6c8('0x24')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x4f8df3['username'],_0x4f8df3[_0xf6c8('0x25')]);logger[_0xf6c8('0x26')](_0xf6c8('0x27'),util[_0xf6c8('0x1c')](_0x4f8df3,{'showHidden':![],'depth':null}));var _0x10bf3c=_[_0xf6c8('0x28')](this['trunks'],{'defaultuser':_0x4f8df3['username']});if(_0x10bf3c){_0x4f8df3[_0xf6c8('0x29')]=_0x4f8df3[_0xf6c8('0x25')];_[_0xf6c8('0x2a')](_0x10bf3c,_[_0xf6c8('0x2b')](_0x4f8df3,[_0xf6c8('0x2c'),_0xf6c8('0x2d'),_0xf6c8('0x2e'),_0xf6c8('0x25')]));logger[_0xf6c8('0x26')](_0xf6c8('0x2f'),util[_0xf6c8('0x1c')](_0x10bf3c,{'showHidden':![],'depth':null}));this[_0xf6c8('0x23')](util['format']('trunk:%s',_0x10bf3c[_0xf6c8('0x30')]),_0xf6c8('0x31'),_0x10bf3c);}}}catch(_0x28dcde){logger[_0xf6c8('0x1a')](_0xf6c8('0x27'),util['inspect'](_0x28dcde,{'showHidden':![],'depth':null}));}};UserReport[_0xf6c8('0x20')]['syncDeviceState']=function(_0x2a6f8c){try{if(this['isNotNull'](_0x2a6f8c)){logger[_0xf6c8('0x24')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x2a6f8c[_0xf6c8('0x32')],_0x2a6f8c[_0xf6c8('0x25')]);logger[_0xf6c8('0x26')](_0xf6c8('0x33'),util['inspect'](_0x2a6f8c,{'showHidden':![],'depth':null}));if(this[_0xf6c8('0xc')][_0x2a6f8c[_0xf6c8('0x32')]]){if(!this[_0xf6c8('0xc')][_0x2a6f8c[_0xf6c8('0x32')]]['local']||_0x2a6f8c[_0xf6c8('0x25')]['toLowerCase']()==_0xf6c8('0x34')){this['agents'][_0x2a6f8c['device']][_0xf6c8('0x35')]=![];if(this[_0xf6c8('0xc')][_0x2a6f8c[_0xf6c8('0x32')]][_0xf6c8('0x25')]!==_0x2a6f8c[_0xf6c8('0x25')][_0xf6c8('0x36')]()){this[_0xf6c8('0xc')][_0x2a6f8c['device']]['stateTime']=_[_0xf6c8('0x37')](moment()[_0xf6c8('0x38')]('x'));}this['agents'][_0x2a6f8c[_0xf6c8('0x32')]][_0xf6c8('0x25')]=_0x2a6f8c[_0xf6c8('0x25')]['toLowerCase']();this['agents'][_0x2a6f8c[_0xf6c8('0x32')]][_0xf6c8('0x39')](_0x2a6f8c);}}else if(this['telephones'][_0x2a6f8c[_0xf6c8('0x32')]]){if(this[_0xf6c8('0xd')][_0x2a6f8c[_0xf6c8('0x32')]]['state']!==_0x2a6f8c[_0xf6c8('0x25')][_0xf6c8('0x36')]()){this[_0xf6c8('0xd')][_0x2a6f8c[_0xf6c8('0x32')]][_0xf6c8('0x3a')]=_['toNumber'](moment()[_0xf6c8('0x38')]('x'));}this[_0xf6c8('0xd')][_0x2a6f8c[_0xf6c8('0x32')]]['state']=_0x2a6f8c[_0xf6c8('0x25')][_0xf6c8('0x36')]();logger[_0xf6c8('0x26')](_0xf6c8('0x3b'),util[_0xf6c8('0x1c')](this[_0xf6c8('0xd')][_0x2a6f8c[_0xf6c8('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xf6c8('0x3c'),this[_0xf6c8('0xd')][_0x2a6f8c['device']][_0xf6c8('0x30')]),_0xf6c8('0x3d'),this['telephones'][_0x2a6f8c['device']]);}else if(this[_0xf6c8('0xb')][_0x2a6f8c[_0xf6c8('0x32')]]){if(this[_0xf6c8('0xb')][_0x2a6f8c['device']]['state']!==_0x2a6f8c[_0xf6c8('0x25')]['toLowerCase']()){this['trunks'][_0x2a6f8c[_0xf6c8('0x32')]][_0xf6c8('0x3a')]=_[_0xf6c8('0x37')](moment()[_0xf6c8('0x38')]('x'));}this['trunks'][_0x2a6f8c['device']][_0xf6c8('0x25')]=_0x2a6f8c[_0xf6c8('0x25')]['toLowerCase']();logger[_0xf6c8('0x26')](_0xf6c8('0x3e'),util['inspect'](this[_0xf6c8('0xb')][_0x2a6f8c[_0xf6c8('0x32')]],{'showHidden':![],'depth':null}));this[_0xf6c8('0x23')](util[_0xf6c8('0x38')](_0xf6c8('0x3f'),this['trunks'][_0x2a6f8c[_0xf6c8('0x32')]][_0xf6c8('0x30')]),_0xf6c8('0x31'),this[_0xf6c8('0xb')][_0x2a6f8c[_0xf6c8('0x32')]]);}else if(_[_0xf6c8('0x40')](_0x2a6f8c[_0xf6c8('0x32')],_0xf6c8('0x41'))){var _0x407da9=_0x2a6f8c[_0xf6c8('0x32')];var _0x4a7eb4=_0x407da9[_0xf6c8('0x42')](_0x407da9[_0xf6c8('0x43')]('/')+0x1,_0x407da9['indexOf']('@'));var _0x19e533=_[_0xf6c8('0x28')](this['agents'],function(_0x24fc6b){return _0x24fc6b['mobile']==_0x4a7eb4||_0x24fc6b[_0xf6c8('0x44')]==_0x4a7eb4||_0x24fc6b[_0xf6c8('0x45')]==_0x4a7eb4;});if(_0x19e533){if(_0x19e533[_0xf6c8('0x25')]!==_0x2a6f8c[_0xf6c8('0x25')][_0xf6c8('0x36')]()){_0x19e533[_0xf6c8('0x3a')]=_[_0xf6c8('0x37')](moment()['format']('x'));}_0x19e533[_0xf6c8('0x25')]=_0x2a6f8c['state'][_0xf6c8('0x36')]();_0x19e533[_0xf6c8('0x35')]=!![];_0x19e533[_0xf6c8('0x39')](_0x2a6f8c);}}}}catch(_0x3f8f90){logger['error']('[userReport][devicestatechange]',util['inspect'](_0x3f8f90,{'showHidden':![],'depth':null}));}};UserReport[_0xf6c8('0x20')]['syncPeerStatus']=function(_0x27e7c7){try{if(this['isNotNull'](_0x27e7c7)&&this[_0xf6c8('0x21')](_0x27e7c7[_0xf6c8('0x46')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x27e7c7[_0xf6c8('0x47')],_0x27e7c7[_0xf6c8('0x48')],_0x27e7c7['peerstatus']);logger[_0xf6c8('0x26')](_0xf6c8('0x49'),util[_0xf6c8('0x1c')](_0x27e7c7,{'showHidden':![],'depth':null}));if(this[_0xf6c8('0xc')][_0x27e7c7['peer']]){if(!this[_0xf6c8('0xc')][_0x27e7c7[_0xf6c8('0x47')]][_0xf6c8('0x35')]||_0x27e7c7['peerstatus'][_0xf6c8('0x36')]()==_0xf6c8('0x4a')){this['agents'][_0x27e7c7['peer']][_0xf6c8('0x35')]=![];this[_0xf6c8('0xc')][_0x27e7c7[_0xf6c8('0x47')]][_0xf6c8('0x4b')]=_0x27e7c7[_0xf6c8('0x46')][_0xf6c8('0x36')]();this[_0xf6c8('0xc')][_0x27e7c7[_0xf6c8('0x47')]][_0xf6c8('0x48')]=_0x27e7c7['address'];this['agents'][_0x27e7c7[_0xf6c8('0x47')]][_0xf6c8('0x39')](_0x27e7c7);}}else if(this[_0xf6c8('0xd')][_0x27e7c7[_0xf6c8('0x47')]]){this['telephones'][_0x27e7c7[_0xf6c8('0x47')]][_0xf6c8('0x4b')]=_0x27e7c7[_0xf6c8('0x46')][_0xf6c8('0x36')]();this[_0xf6c8('0xd')][_0x27e7c7[_0xf6c8('0x47')]][_0xf6c8('0x48')]=_0x27e7c7[_0xf6c8('0x48')];logger[_0xf6c8('0x26')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util['inspect'](this['telephones'][_0x27e7c7[_0xf6c8('0x47')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xf6c8('0x3c'),this[_0xf6c8('0xd')][_0x27e7c7[_0xf6c8('0x47')]]['name']),_0xf6c8('0x3d'),this[_0xf6c8('0xd')][_0x27e7c7[_0xf6c8('0x47')]]);}else if(this[_0xf6c8('0xb')][_0x27e7c7['peer']]){this['trunks'][_0x27e7c7[_0xf6c8('0x47')]]['status']=_0x27e7c7[_0xf6c8('0x46')]['toLowerCase']();this[_0xf6c8('0xb')][_0x27e7c7['peer']][_0xf6c8('0x48')]=_0x27e7c7[_0xf6c8('0x48')];logger[_0xf6c8('0x26')](_0xf6c8('0x4c'),util[_0xf6c8('0x1c')](this[_0xf6c8('0xb')][_0x27e7c7[_0xf6c8('0x47')]],{'showHidden':![],'depth':null}));this[_0xf6c8('0x23')](util['format'](_0xf6c8('0x3f'),this['trunks'][_0x27e7c7['peer']]['name']),_0xf6c8('0x31'),this[_0xf6c8('0xb')][_0x27e7c7[_0xf6c8('0x47')]]);}}}catch(_0x4c5e47){logger[_0xf6c8('0x1a')]('[userReport][peerstatus]',util[_0xf6c8('0x1c')](_0x4c5e47,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x1b61=['device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','substring','indexOf','accountcode','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','inspect','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x1b61,0xfa));var _0x11b6=function(_0x373a27,_0x37e69e){_0x373a27=_0x373a27-0x0;var _0x15947c=_0x1b61[_0x373a27];return _0x15947c;};'use strict';var _=require(_0x11b6('0x0'));var moment=require(_0x11b6('0x1'));var util=require(_0x11b6('0x2'));var Redis=require(_0x11b6('0x3'));var BPromise=require(_0x11b6('0x4'));var config=require(_0x11b6('0x5'));var logger=require(_0x11b6('0x6'))(_0x11b6('0x7'));var ami=require(_0x11b6('0x8'));config['redis']=_[_0x11b6('0x9')](config[_0x11b6('0xa')],{'host':_0x11b6('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x11b6('0xa')]));function UserReport(_0x4c0f40){this[_0x11b6('0xc')]=_0x4c0f40['trunks'];this[_0x11b6('0xd')]=_0x4c0f40['agents'];this[_0x11b6('0xe')]=_0x4c0f40[_0x11b6('0xe')];ami['on'](_0x11b6('0xf'),this[_0x11b6('0x10')][_0x11b6('0x11')](this));ami['on']('registry',this[_0x11b6('0x10')][_0x11b6('0x11')](this));ami['on'](_0x11b6('0x12'),this['syncDeviceState'][_0x11b6('0x11')](this));ami['on']('peerstatus',this[_0x11b6('0x13')][_0x11b6('0x11')](this));return this[_0x11b6('0x14')]();}function showSipRegistrations(){Promise[_0x11b6('0x15')]()[_0x11b6('0x16')](ami[_0x11b6('0x17')]())[_0x11b6('0x18')](function(_0x27ba05){logger[_0x11b6('0x19')]('[userReport][sipshowregistry]',util[_0x11b6('0x1a')](_0x27ba05,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x11b6('0x15')]()[_0x11b6('0x16')](ami['actionDeviceStateList']())[_0x11b6('0x18')](function(_0x5177a9){logger[_0x11b6('0x19')](_0x11b6('0x1b'),util[_0x11b6('0x1a')](_0x5177a9,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x11b6('0x15')]()[_0x11b6('0x16')](ami[_0x11b6('0x1c')]())[_0x11b6('0x18')](function(_0x3d87b8){logger[_0x11b6('0x19')](_0x11b6('0x1d'),util['inspect'](_0x3d87b8,{'showHidden':![],'depth':null}));});}UserReport[_0x11b6('0x1e')][_0x11b6('0x14')]=function(){setInterval(function(){BPromise[_0x11b6('0x15')]()[_0x11b6('0x16')](showSipRegistrations())[_0x11b6('0x16')](listDeviceStates())[_0x11b6('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x11b6('0x1e')]['isNotNull']=function(_0x5ed798){return _0x5ed798!==null&&!_[_0x11b6('0x1f')](_0x5ed798);};UserReport[_0x11b6('0x1e')][_0x11b6('0x20')]=function(_0x398162,_0x59cce6,_0x553abe){io['to'](_0x398162)[_0x11b6('0x20')](_0x59cce6,_0x553abe);};UserReport[_0x11b6('0x1e')][_0x11b6('0x10')]=function(_0x5b94a7){try{if(this[_0x11b6('0x21')](_0x5b94a7)){logger[_0x11b6('0x22')](_0x11b6('0x23'),_0x5b94a7[_0x11b6('0x24')],_0x5b94a7[_0x11b6('0x25')]);logger[_0x11b6('0x26')](_0x11b6('0x27'),util['inspect'](_0x5b94a7,{'showHidden':![],'depth':null}));var _0x4ec421=_[_0x11b6('0x28')](this[_0x11b6('0xc')],{'defaultuser':_0x5b94a7[_0x11b6('0x24')]});if(_0x4ec421){_0x5b94a7[_0x11b6('0x29')]=_0x5b94a7[_0x11b6('0x25')];_[_0x11b6('0x2a')](_0x4ec421,_[_0x11b6('0x2b')](_0x5b94a7,[_0x11b6('0x2c'),_0x11b6('0x2d'),_0x11b6('0x24'),_0x11b6('0x25')]));logger[_0x11b6('0x26')](_0x11b6('0x2e'),util[_0x11b6('0x1a')](_0x4ec421,{'showHidden':![],'depth':null}));this[_0x11b6('0x20')](util['format'](_0x11b6('0x2f'),_0x4ec421[_0x11b6('0x30')]),_0x11b6('0x31'),_0x4ec421);}}}catch(_0x16e374){logger[_0x11b6('0x19')](_0x11b6('0x27'),util[_0x11b6('0x1a')](_0x16e374,{'showHidden':![],'depth':null}));}};UserReport[_0x11b6('0x1e')]['syncDeviceState']=function(_0x1ca439){try{if(this[_0x11b6('0x21')](_0x1ca439)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x1ca439[_0x11b6('0x32')],_0x1ca439[_0x11b6('0x25')]);logger[_0x11b6('0x26')](_0x11b6('0x33'),util['inspect'](_0x1ca439,{'showHidden':![],'depth':null}));if(this[_0x11b6('0xd')][_0x1ca439[_0x11b6('0x32')]]){if(!this[_0x11b6('0xd')][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x34')]||_0x1ca439[_0x11b6('0x25')][_0x11b6('0x35')]()==_0x11b6('0x36')){this[_0x11b6('0xd')][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x34')]=![];if(this[_0x11b6('0xd')][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x25')]!==_0x1ca439['state']['toLowerCase']()){this[_0x11b6('0xd')][_0x1ca439['device']][_0x11b6('0x37')]=_[_0x11b6('0x38')](moment()['format']('x'));}this[_0x11b6('0xd')][_0x1ca439[_0x11b6('0x32')]]['state']=_0x1ca439[_0x11b6('0x25')][_0x11b6('0x35')]();this['agents'][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x39')](_0x1ca439);}}else if(this[_0x11b6('0xe')][_0x1ca439[_0x11b6('0x32')]]){if(this['telephones'][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x25')]!==_0x1ca439[_0x11b6('0x25')]['toLowerCase']()){this[_0x11b6('0xe')][_0x1ca439[_0x11b6('0x32')]]['stateTime']=_[_0x11b6('0x38')](moment()[_0x11b6('0x3a')]('x'));}this[_0x11b6('0xe')][_0x1ca439['device']][_0x11b6('0x25')]=_0x1ca439[_0x11b6('0x25')][_0x11b6('0x35')]();logger[_0x11b6('0x26')](_0x11b6('0x3b'),util['inspect'](this[_0x11b6('0xe')][_0x1ca439[_0x11b6('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x11b6('0x3c'),this[_0x11b6('0xe')][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x30')]),_0x11b6('0x3d'),this[_0x11b6('0xe')][_0x1ca439[_0x11b6('0x32')]]);}else if(this['trunks'][_0x1ca439[_0x11b6('0x32')]]){if(this[_0x11b6('0xc')][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x25')]!==_0x1ca439['state'][_0x11b6('0x35')]()){this[_0x11b6('0xc')][_0x1ca439[_0x11b6('0x32')]]['stateTime']=_[_0x11b6('0x38')](moment()[_0x11b6('0x3a')]('x'));}this[_0x11b6('0xc')][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x25')]=_0x1ca439['state'][_0x11b6('0x35')]();logger[_0x11b6('0x26')](_0x11b6('0x3e'),util[_0x11b6('0x1a')](this['trunks'][_0x1ca439[_0x11b6('0x32')]],{'showHidden':![],'depth':null}));this[_0x11b6('0x20')](util['format'](_0x11b6('0x2f'),this['trunks'][_0x1ca439[_0x11b6('0x32')]][_0x11b6('0x30')]),_0x11b6('0x31'),this[_0x11b6('0xc')][_0x1ca439[_0x11b6('0x32')]]);}else if(_['startsWith'](_0x1ca439['device'],'Local')){var _0x24ce8a=_0x1ca439['device'];var _0x4276f4=_0x24ce8a[_0x11b6('0x3f')](_0x24ce8a[_0x11b6('0x40')]('/')+0x1,_0x24ce8a['indexOf']('@'));var _0x55c6cb=_[_0x11b6('0x28')](this[_0x11b6('0xd')],function(_0x583e02){return _0x583e02['mobile']==_0x4276f4||_0x583e02['phone']==_0x4276f4||_0x583e02[_0x11b6('0x41')]==_0x4276f4;});if(_0x55c6cb){if(_0x55c6cb[_0x11b6('0x25')]!==_0x1ca439[_0x11b6('0x25')][_0x11b6('0x35')]()){_0x55c6cb['stateTime']=_[_0x11b6('0x38')](moment()['format']('x'));}_0x55c6cb[_0x11b6('0x25')]=_0x1ca439[_0x11b6('0x25')][_0x11b6('0x35')]();_0x55c6cb[_0x11b6('0x34')]=!![];_0x55c6cb['updateStatusRealtime'](_0x1ca439);}}}}catch(_0x2bc2bc){logger[_0x11b6('0x19')](_0x11b6('0x33'),util['inspect'](_0x2bc2bc,{'showHidden':![],'depth':null}));}};UserReport[_0x11b6('0x1e')]['syncPeerStatus']=function(_0x611403){try{if(this[_0x11b6('0x21')](_0x611403)&&this['isNotNull'](_0x611403[_0x11b6('0x42')])){logger[_0x11b6('0x22')](_0x11b6('0x43'),_0x611403[_0x11b6('0x44')],_0x611403['address'],_0x611403[_0x11b6('0x42')]);logger[_0x11b6('0x26')](_0x11b6('0x45'),util[_0x11b6('0x1a')](_0x611403,{'showHidden':![],'depth':null}));if(this['agents'][_0x611403[_0x11b6('0x44')]]){if(!this['agents'][_0x611403[_0x11b6('0x44')]][_0x11b6('0x34')]||_0x611403['peerstatus'][_0x11b6('0x35')]()=='registered'){this['agents'][_0x611403[_0x11b6('0x44')]]['local']=![];this['agents'][_0x611403[_0x11b6('0x44')]]['status']=_0x611403[_0x11b6('0x42')][_0x11b6('0x35')]();this[_0x11b6('0xd')][_0x611403['peer']][_0x11b6('0x46')]=_0x611403['address'];this[_0x11b6('0xd')][_0x611403[_0x11b6('0x44')]][_0x11b6('0x39')](_0x611403);}}else if(this[_0x11b6('0xe')][_0x611403['peer']]){this[_0x11b6('0xe')][_0x611403['peer']][_0x11b6('0x47')]=_0x611403['peerstatus'][_0x11b6('0x35')]();this[_0x11b6('0xe')][_0x611403[_0x11b6('0x44')]]['address']=_0x611403[_0x11b6('0x46')];logger[_0x11b6('0x26')](_0x11b6('0x48'),util[_0x11b6('0x1a')](this[_0x11b6('0xe')][_0x611403['peer']],{'showHidden':![],'depth':null}));this[_0x11b6('0x20')](util[_0x11b6('0x3a')]('telephone:%s',this['telephones'][_0x611403[_0x11b6('0x44')]][_0x11b6('0x30')]),_0x11b6('0x3d'),this[_0x11b6('0xe')][_0x611403['peer']]);}else if(this[_0x11b6('0xc')][_0x611403[_0x11b6('0x44')]]){this[_0x11b6('0xc')][_0x611403[_0x11b6('0x44')]][_0x11b6('0x47')]=_0x611403[_0x11b6('0x42')][_0x11b6('0x35')]();this[_0x11b6('0xc')][_0x611403[_0x11b6('0x44')]][_0x11b6('0x46')]=_0x611403[_0x11b6('0x46')];logger[_0x11b6('0x26')](_0x11b6('0x49'),util[_0x11b6('0x1a')](this[_0x11b6('0xc')][_0x611403['peer']],{'showHidden':![],'depth':null}));this[_0x11b6('0x20')](util[_0x11b6('0x3a')](_0x11b6('0x2f'),this['trunks'][_0x611403[_0x11b6('0x44')]]['name']),_0x11b6('0x31'),this[_0x11b6('0xc')][_0x611403['peer']]);}}}catch(_0x25fd3d){logger['error']('[userReport][peerstatus]',util[_0x11b6('0x1a')](_0x25fd3d,{'showHidden':![],'depth':null}));}};module[_0x11b6('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index dbe6233..9012c81 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x425d=['omit','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','pick','name','accountcode','exten','queue','custom:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','agentcompleteAt','diff','secondtransfereruniqueid','seconds','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','voice','assign'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0x425d,0x69));var _0xd425=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x425d[_0x347471];return _0x422b6a;};'use strict';var _=require(_0xd425('0x0'));var moment=require(_0xd425('0x1'));var util=require(_0xd425('0x2'));var Redis=require(_0xd425('0x3'));var config=require(_0xd425('0x4'));var logger=require(_0xd425('0x5'))(_0xd425('0x6'));var ami=require(_0xd425('0x7'));config[_0xd425('0x8')]=_[_0xd425('0x9')](config[_0xd425('0x8')],{'host':_0xd425('0xa'),'port':0x18eb});var io=require(_0xd425('0xb'))(new Redis(config[_0xd425('0x8')]));function VoiceAgentReport(_0x1ddaa3){this[_0xd425('0xc')]={};this[_0xd425('0xd')]=_0x1ddaa3[_0xd425('0xc')];this[_0xd425('0xe')]=_0x1ddaa3[_0xd425('0xe')];this[_0xd425('0xf')]=_0x1ddaa3['agents'];this[_0xd425('0x10')]={};ami['on']('agentcalled',this[_0xd425('0x11')][_0xd425('0x12')](this));ami['on'](_0xd425('0x13'),this[_0xd425('0x14')]['bind'](this));ami['on'](_0xd425('0x15'),this[_0xd425('0x16')]['bind'](this));ami['on'](_0xd425('0x17'),this[_0xd425('0x18')][_0xd425('0x12')](this));ami['on'](_0xd425('0x19'),this[_0xd425('0x1a')][_0xd425('0x12')](this));ami['on'](_0xd425('0x1b'),this[_0xd425('0x1c')]['bind'](this));ami['on'](_0xd425('0x1d'),this['syncHangup'][_0xd425('0x12')](this));ami['on'](_0xd425('0x1e'),this[_0xd425('0x1f')][_0xd425('0x12')](this));ami['on'](_0xd425('0x20'),this['syncMusicOnHoldStop']['bind'](this));ami['on']('attendedtransfer',this[_0xd425('0x21')][_0xd425('0x12')](this));ami['on'](_0xd425('0x22'),this[_0xd425('0x23')][_0xd425('0x12')](this));}VoiceAgentReport[_0xd425('0x24')][_0xd425('0x25')]=function(_0x4bf9a9,_0x300e2d,_0x4114a3){io['to'](_0x4bf9a9)[_0xd425('0x25')](_0x300e2d,_0x4114a3);};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x26')]=function(_0x2945bb){return _0x2945bb!==null&&!_[_0xd425('0x27')](_0x2945bb);};VoiceAgentReport['prototype'][_0xd425('0x11')]=function(_0x33253d){try{if(this[_0xd425('0x26')](_0x33253d)){logger[_0xd425('0x28')](_0xd425('0x29'),_0x33253d[_0xd425('0x2a')],_0x33253d[_0xd425('0x2b')],_0x33253d[_0xd425('0x2c')]);logger['debug'](_0xd425('0x2d'),_0x33253d[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x33253d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xd425('0xc')][_0x33253d[_0xd425('0x2a')]])){this['channels'][_0x33253d[_0xd425('0x2a')]]={};}var _0x5bb637=this[_0xd425('0xf')][_0x33253d[_0xd425('0x2f')]];var _0x4b1872=this[_0xd425('0xc')][_0x33253d[_0xd425('0x2a')]][_0x33253d[_0xd425('0x2c')]];var _0x5b4090=this[_0xd425('0xe')][_0x33253d['queue']];var _0x6a43c=this[_0xd425('0x10')][_0x33253d[_0xd425('0x2a')]];if(_[_0xd425('0x27')](_0x4b1872)){_0x4b1872={'agentcalledAt':moment()[_0xd425('0x30')](_0xd425('0x31')),'lastevent':_0xd425('0x32'),'mandatoryDisposition':_0x5b4090&&_0x5b4090[_0xd425('0x33')]?_0x5b4090[_0xd425('0x33')]:![],'type':_0x5b4090&&_0x5b4090[_0xd425('0x34')]?_0x5b4090[_0xd425('0x34')]:'inbound','variables':_0x6a43c,'motionChannel':_0xd425('0x35')};}Object[_0xd425('0x36')](_0x4b1872,_[_0xd425('0x37')](_0x33253d,['event','privilege']));this[_0xd425('0xc')][_0x33253d[_0xd425('0x2a')]][_0x33253d[_0xd425('0x2c')]]=_0x4b1872;logger[_0xd425('0x38')](_0xd425('0x39'),_0x33253d[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x4b1872,{'showHidden':![],'depth':null}));ami[_0xd425('0x25')](_0xd425('0x3a'),_0x4b1872);var _0x2cebf7={'id':_0x5bb637['id'],'calleridnum':_0x4b1872[_0xd425('0x3b')],'queue':_0x4b1872['queue'],'variables':_0x4b1872[_0xd425('0x10')],'uniqueid':_0x33253d[_0xd425('0x2a')]};logger[_0xd425('0x38')](_0xd425('0x3c'),_0x33253d[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x2cebf7,{'showHidden':![],'depth':null}));this[_0xd425('0x25')](util[_0xd425('0x30')](_0xd425('0x3d'),_0x33253d['membername']),_0xd425('0x3e'),_0x2cebf7);}}catch(_0x3165af){logger[_0xd425('0x3f')](_0xd425('0x40'),_0x33253d['uniqueid'],util[_0xd425('0x2e')](_0x3165af,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x14')]=function(_0x461ca4){try{if(this[_0xd425('0x26')](_0x461ca4)){if(this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]]){for(var _0x5a84da in this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]]){if(this['channels'][_0x461ca4['uniqueid']][_0xd425('0x41')](_0x5a84da)){if(_0x461ca4[_0xd425('0x2c')]===_0x5a84da){logger[_0xd425('0x28')](_0xd425('0x42'),_0x461ca4[_0xd425('0x2a')],_0x461ca4[_0xd425('0x2b')],_0x461ca4['destuniqueid']);this['channels'][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x43')]=moment()[_0xd425('0x30')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x44')]=_0x461ca4[_0xd425('0x44')];this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x45')]=_0x461ca4['connectedlinenum'];this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x46')]=_0x461ca4[_0xd425('0x46')];this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x47')]=_0x461ca4['destchannelstatedesc'];this[_0xd425('0xc')][_0x461ca4['uniqueid']][_0x5a84da][_0xd425('0x48')]=_0x461ca4['holdtime'];this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x49')]=_0xd425('0x4a');if(this[_0xd425('0xd')][this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da]['uniqueid']]){var _0x21b77b=this['voiceChannels'][this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x2a')]][_0xd425('0x4b')];this['channels'][_0x461ca4['uniqueid']][_0x5a84da]['routealias']=_0x21b77b;_0x461ca4['routealias']=_0x21b77b;}_[_0xd425('0x4c')](this[_0xd425('0xf')][_0x461ca4[_0xd425('0x2f')]],_[_0xd425('0x4d')](_0x461ca4,['queue','destconnectedlinenum',_0xd425('0x4b')]));var _0x43f4ee=this[_0xd425('0xf')][_0x461ca4['interface']];var _0x3e953c={'id':_0x43f4ee['id'],'name':_0x43f4ee[_0xd425('0x4e')],'agentconnected':!![],'destaccountcode':_0x43f4ee[_0xd425('0x4f')],'destconnectedlinenum':this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x461ca4[_0xd425('0x2c')]][_0xd425('0x50')],'queue':this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x461ca4[_0xd425('0x2c')]][_0xd425('0x51')],'routealias':this[_0xd425('0xc')][_0x461ca4['uniqueid']][_0x461ca4['destuniqueid']][_0xd425('0x4b')],'uniqueid':this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x461ca4[_0xd425('0x2c')]][_0xd425('0x2a')]};ami['emit'](_0xd425('0x52'),this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x461ca4[_0xd425('0x2c')]]);this[_0xd425('0x25')](util[_0xd425('0x30')]('user:%s',_0x461ca4[_0xd425('0x2b')]),'user:agentconnect',_0x3e953c);}else if(!this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x15')]&&!this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da]['agentcomplete']){logger[_0xd425('0x28')](_0xd425('0x53'),_0x461ca4['uniqueid'],this['channels'][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x2b')],_0x5a84da);this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x15')]=!![];this[_0xd425('0xc')][_0x461ca4['uniqueid']][_0x5a84da][_0xd425('0x54')]=moment()[_0xd425('0x30')](_0xd425('0x31'));this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da]['answeredelsewheredestinationuniqueid']=_0x461ca4[_0xd425('0x2c')];this[_0xd425('0xc')][_0x461ca4[_0xd425('0x2a')]][_0x5a84da][_0xd425('0x55')]=_0x461ca4['membername'];this[_0xd425('0xc')][_0x461ca4['uniqueid']][_0x5a84da][_0xd425('0x49')]='answered_elsewhere';this[_0xd425('0xc')][_0x461ca4['uniqueid']][_0x5a84da][_0xd425('0x56')]=_0xd425('0x57');logger['debug'](_0xd425('0x58'),_0x461ca4[_0xd425('0x2a')],util['inspect'](this['channels'][_0x461ca4[_0xd425('0x2a')]][_0x5a84da],{'showHidden':![],'depth':null}));ami[_0xd425('0x25')]('custom:agentansweredelsewhere',this['channels'][_0x461ca4[_0xd425('0x2a')]][_0x5a84da]);}else{logger['debug'](_0xd425('0x59'),_0x461ca4[_0xd425('0x2a')]);}}}}}}catch(_0x2ab4d9){logger[_0xd425('0x3f')](_0xd425('0x5a'),_0x461ca4['uniqueid'],util[_0xd425('0x2e')](_0x2ab4d9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x16')]=function(_0x42e37a){try{if(this[_0xd425('0x26')](_0x42e37a)){logger[_0xd425('0x38')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x42e37a[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x42e37a,{'showHidden':![],'depth':null}));if(this[_0xd425('0xc')][_0x42e37a[_0xd425('0x2a')]]&&this['channels'][_0x42e37a[_0xd425('0x2a')]][_0x42e37a['destuniqueid']]){logger['info'](_0xd425('0x5b'),_0x42e37a[_0xd425('0x2a')],_0x42e37a[_0xd425('0x2b')],_0x42e37a['destuniqueid']);var _0x4e4b91=this['agents'][_0x42e37a[_0xd425('0x2f')]];var _0x33814a=this[_0xd425('0xc')][_0x42e37a['uniqueid']][_0x42e37a['destuniqueid']];_0x33814a[_0xd425('0x15')]=!![];_0x33814a[_0xd425('0x54')]=moment()[_0xd425('0x30')](_0xd425('0x31'));_0x33814a['lastevent']=_0xd425('0x5c');_0x33814a['reason']='rejected';var _0x1e90c4={'id':_0x4e4b91['id'],'name':_0x4e4b91['name'],'queue':_0x33814a[_0xd425('0x51')],'uniqueid':_0x33814a['uniqueid']};logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x42e37a['uniqueid'],util[_0xd425('0x2e')](_0x1e90c4,{'showHidden':![],'depth':null}));this['emit'](util[_0xd425('0x30')](_0xd425('0x3d'),_0x4e4b91['name']),_0xd425('0x5d'),_0x1e90c4);ami[_0xd425('0x25')](_0xd425('0x5e'),_0x33814a);this[_0xd425('0xc')][_0x42e37a[_0xd425('0x2a')]][_0x42e37a[_0xd425('0x2c')]]=Object[_0xd425('0x36')]({},_0x33814a);}}}catch(_0x4f49fd){logger[_0xd425('0x3f')](_0xd425('0x5f'),_0x42e37a[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x4f49fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd425('0x18')]=function(_0x52fa1f){try{if(this['isNotNull'](_0x52fa1f)){logger[_0xd425('0x38')](_0xd425('0x60'),_0x52fa1f['uniqueid'],util[_0xd425('0x2e')](_0x52fa1f,{'showHidden':![],'depth':null}));if(this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]]){for(var _0x5bf2af in this['channels'][_0x52fa1f['uniqueid']]){if(this[_0xd425('0xc')][_0x52fa1f['uniqueid']]['hasOwnProperty'](_0x5bf2af)&&!this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af]['agentringnoanswer']&&!this[_0xd425('0xc')][_0x52fa1f['uniqueid']][_0x5bf2af][_0xd425('0x19')]){logger[_0xd425('0x28')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x52fa1f[_0xd425('0x2a')],this['channels'][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af][_0xd425('0x2b')],_0x5bf2af);this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af][_0xd425('0x15')]=!![];this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af][_0xd425('0x54')]=moment()[_0xd425('0x30')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af]['lastevent']=_0xd425('0x61');this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af][_0xd425('0x56')]='abandoned';logger[_0xd425('0x38')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x52fa1f[_0xd425('0x2a')],util[_0xd425('0x2e')](this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af],{'showHidden':![],'depth':null}));ami['emit'](_0xd425('0x62'),this[_0xd425('0xc')][_0x52fa1f[_0xd425('0x2a')]][_0x5bf2af]);}}}}}catch(_0x4c0bce){logger[_0xd425('0x3f')]('[%s][voiceAgentReport][queuecallerabandon]',_0x52fa1f['uniqueid'],util[_0xd425('0x2e')](_0x4c0bce,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x1cf4a0){try{if(this['isNotNull'](_0x1cf4a0)){logger[_0xd425('0x38')](_0xd425('0x63'),_0x1cf4a0[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x1cf4a0,{'showHidden':![],'depth':null}));if(this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]]){for(var _0x452e4f in this['channels'][_0x1cf4a0[_0xd425('0x2a')]]){if(this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]]['hasOwnProperty'](_0x452e4f)){if(this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f][_0xd425('0x43')]&&!this[_0xd425('0xc')][_0x1cf4a0['uniqueid']][_0x452e4f][_0xd425('0x19')]){logger[_0xd425('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1cf4a0['uniqueid'],this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f][_0xd425('0x2b')],_0x452e4f);this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f][_0xd425('0x19')]=!![];this['channels'][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f]['agentcompleteAt']=moment()[_0xd425('0x30')](_0xd425('0x31'));this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f]['lastevent']=_0xd425('0x64');this['channels'][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f][_0xd425('0x56')]=_0x1cf4a0[_0xd425('0x56')]==_0xd425('0x65')?_0xd425('0x66'):_0x1cf4a0['reason'];this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f]['talktime']=_0x1cf4a0[_0xd425('0x67')];if(this['voiceQueues'][_0x1cf4a0[_0xd425('0x51')]]&&this[_0xd425('0xe')][_0x1cf4a0[_0xd425('0x51')]][_0xd425('0x68')]){this[_0xd425('0xc')][_0x1cf4a0['uniqueid']][_0x452e4f][_0xd425('0x69')]=this[_0xd425('0xe')][_0x1cf4a0[_0xd425('0x51')]][_0xd425('0x6a')];this['channels'][_0x1cf4a0['uniqueid']][_0x452e4f][_0xd425('0x6b')]=!![];}this[_0xd425('0xf')][_0x1cf4a0[_0xd425('0x2f')]]=_[_0xd425('0x37')](this[_0xd425('0xf')][_0x1cf4a0['interface']],[_0xd425('0x51'),_0xd425('0x6c')]);logger['debug'](_0xd425('0x6d'),_0x1cf4a0[_0xd425('0x2a')],util[_0xd425('0x2e')](this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f],{'showHidden':![],'depth':null}));ami[_0xd425('0x25')](_0xd425('0x6e'),this[_0xd425('0xc')][_0x1cf4a0[_0xd425('0x2a')]][_0x452e4f]);logger['debug'](_0xd425('0x6f'),_0x1cf4a0[_0xd425('0x2a')],util[_0xd425('0x2e')]({'id':this[_0xd425('0xf')][_0x1cf4a0['interface']]['id'],'destaccountcode':_0x1cf4a0['destaccountcode']},{'showHidden':![],'depth':null}));this[_0xd425('0x25')](util[_0xd425('0x30')](_0xd425('0x3d'),_0x1cf4a0[_0xd425('0x2b')]),_0xd425('0x70'),{'id':this[_0xd425('0xf')][_0x1cf4a0[_0xd425('0x2f')]]['id'],'destaccountcode':Number(_0x1cf4a0['destaccountcode'])});}}}}}}catch(_0x4c47c1){logger['error'](_0xd425('0x71'),_0x1cf4a0[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x4c47c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x1c')]=function(_0x19ddc2){try{if(this[_0xd425('0x26')](_0x19ddc2)){logger[_0xd425('0x38')](_0xd425('0x72'),_0x19ddc2[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x19ddc2,{'showHidden':![],'depth':null}));this[_0xd425('0x73')](_0x19ddc2['uniqueid'],_['keys'](_0x19ddc2[_0xd425('0x74')])[0x0],_0x19ddc2[_0xd425('0x75')]);if(this[_0xd425('0xc')][_0x19ddc2['uniqueid']]){for(var _0x225cbf in this[_0xd425('0xc')][_0x19ddc2[_0xd425('0x2a')]]){if(this[_0xd425('0xc')][_0x19ddc2[_0xd425('0x2a')]][_0xd425('0x41')](_0x225cbf)){logger[_0xd425('0x28')](_0xd425('0x76'),_0x19ddc2[_0xd425('0x2a')],_0x225cbf,_[_0xd425('0x77')](_0x19ddc2['variable'])[0x0],_0x19ddc2[_0xd425('0x75')]);if(_[_0xd425('0x27')](this[_0xd425('0xc')][_0x19ddc2[_0xd425('0x2a')]][_0x225cbf][_0xd425('0x10')])){this[_0xd425('0xc')][_0x19ddc2[_0xd425('0x2a')]][_0x225cbf][_0xd425('0x10')]={};}this[_0xd425('0xc')][_0x19ddc2[_0xd425('0x2a')]][_0x225cbf]['variables']=this['variables'][_0x19ddc2['uniqueid']];}}}}}catch(_0x4f0e08){logger[_0xd425('0x3f')](_0xd425('0x78'),_0x19ddc2[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x4f0e08,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x73')]=function(_0x21252e,_0x51c869,_0x319029){var _0x1d5346=[_0xd425('0x79'),_0xd425('0x7a'),_0xd425('0x7b'),_0xd425('0x7c'),_0xd425('0x7d'),_0xd425('0x7e'),_0xd425('0x7f'),'rtpaudioqosrttbridged',_0xd425('0x80'),_0xd425('0x81'),'bridgepeer',_0xd425('0x82'),_0xd425('0x83'),_0xd425('0x84'),'memberinterface',_0xd425('0x85'),_0xd425('0x2b'),_0xd425('0x86'),_0xd425('0x87')];if(!_[_0xd425('0x88')](_0x51c869)&&!_[_0xd425('0x89')](_0x1d5346,_0x51c869)){if(_[_0xd425('0x27')](this[_0xd425('0x10')][_0x21252e])){this[_0xd425('0x10')][_0x21252e]={};}this[_0xd425('0x10')][_0x21252e][_0x51c869]=_0x319029;}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x8a')]=function(_0x135ccf){try{if(this[_0xd425('0x26')](_0x135ccf)){logger[_0xd425('0x38')](_0xd425('0x8b'),_0x135ccf[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x135ccf,{'showHidden':![],'depth':null}));if(this[_0xd425('0xc')][_0x135ccf['uniqueid']]){for(var _0x513818 in this['channels'][_0x135ccf['uniqueid']]){if(this['channels'][_0x135ccf['uniqueid']][_0xd425('0x41')](_0x513818)){if(this[_0xd425('0xc')][_0x135ccf[_0xd425('0x2a')]][_0x513818][_0xd425('0x56')]==_0xd425('0x65')&&this[_0xd425('0xc')][_0x135ccf[_0xd425('0x2a')]][_0x513818]['agentcomplete']){logger[_0xd425('0x28')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x135ccf[_0xd425('0x2a')],_0x513818);this[_0xd425('0xc')][_0x135ccf[_0xd425('0x2a')]][_0x513818]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0xd425('0x38')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x135ccf[_0xd425('0x2a')],util[_0xd425('0x2e')](_[_0xd425('0x8c')](this[_0xd425('0xc')][_0x135ccf[_0xd425('0x2a')]]),{'showHidden':![],'depth':null}));ami[_0xd425('0x25')](_0xd425('0x8d'),_[_0xd425('0x8c')](this[_0xd425('0xc')][_0x135ccf[_0xd425('0x2a')]]));delete this[_0xd425('0xc')][_0x135ccf[_0xd425('0x2a')]];}if(this[_0xd425('0x10')][_0x135ccf['uniqueid']]){delete this[_0xd425('0x10')][_0x135ccf[_0xd425('0x2a')]];}}}catch(_0x4130bd){logger['error'](_0xd425('0x8e'),_0x135ccf['uniqueid'],util[_0xd425('0x2e')](_0x4130bd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x21')]=function(_0x2789d1){try{if(this['isNotNull'](_0x2789d1)){logger[_0xd425('0x38')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x2789d1['uniqueid'],util[_0xd425('0x2e')](_0x2789d1,{'showHidden':![],'depth':null}));if(this['channels'][_0x2789d1[_0xd425('0x8f')]]){for(var _0x3dde77 in this[_0xd425('0xc')][_0x2789d1[_0xd425('0x8f')]]){if(this[_0xd425('0xc')][_0x2789d1['transfereeuniqueid']][_0xd425('0x41')](_0x3dde77)){if(_0x2789d1[_0xd425('0x90')]===_0x3dde77){logger[_0xd425('0x28')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2789d1['uniqueid'],this[_0xd425('0xc')][_0x2789d1[_0xd425('0x8f')]][_0x3dde77][_0xd425('0x2b')],_0x3dde77);var _0x5b685a=moment();this[_0xd425('0xc')][_0x2789d1[_0xd425('0x8f')]][_0x3dde77][_0xd425('0x19')]=!![];this[_0xd425('0xc')][_0x2789d1[_0xd425('0x8f')]][_0x3dde77][_0xd425('0x91')]=moment()[_0xd425('0x30')](_0xd425('0x31'));this[_0xd425('0xc')][_0x2789d1[_0xd425('0x8f')]][_0x3dde77][_0xd425('0x49')]=_0xd425('0x64');this[_0xd425('0xc')][_0x2789d1['transfereeuniqueid']][_0x3dde77][_0xd425('0x56')]=_0xd425('0x65');this['channels'][_0x2789d1['transfereeuniqueid']][_0x3dde77][_0xd425('0x67')]=_0x5b685a[_0xd425('0x92')](this[_0xd425('0xc')][_0x2789d1['transfereeuniqueid']][_0x3dde77][_0xd425('0x43')],'seconds');}}}}if(this[_0xd425('0xc')][_0x2789d1[_0xd425('0x93')]]){var _0x4c120f=this[_0xd425('0xc')][_0x2789d1['secondtransfereruniqueid']];this[_0xd425('0xc')][_0x2789d1['secondtransfereruniqueid']]=this[_0xd425('0xc')][_0x2789d1[_0xd425('0x8f')]];this[_0xd425('0xc')][_0x2789d1[_0xd425('0x8f')]]=_0x4c120f;}}}catch(_0x1f62ea){logger[_0xd425('0x3f')]('[%s][voiceAgentReport][attendedtransfer]',_0x2789d1[_0xd425('0x2a')],util['inspect'](_0x1f62ea,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x23')]=function(_0x353b48){try{if(this[_0xd425('0x26')](_0x353b48)){logger['debug']('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x353b48['uniqueid'],util[_0xd425('0x2e')](_0x353b48,{'showHidden':![],'depth':null}));if(this[_0xd425('0xc')][_0x353b48[_0xd425('0x8f')]]){for(var _0x1d114f in this['channels'][_0x353b48[_0xd425('0x8f')]]){if(this[_0xd425('0xc')][_0x353b48[_0xd425('0x8f')]][_0xd425('0x41')](_0x1d114f)){if(_0x353b48['transfereruniqueid']===_0x1d114f){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x353b48[_0xd425('0x2a')],this[_0xd425('0xc')][_0x353b48[_0xd425('0x8f')]][_0x1d114f]['membername'],_0x1d114f);var _0x28c27a=moment();this['channels'][_0x353b48[_0xd425('0x8f')]][_0x1d114f][_0xd425('0x19')]=!![];this['channels'][_0x353b48[_0xd425('0x8f')]][_0x1d114f][_0xd425('0x91')]=_0x28c27a;this['channels'][_0x353b48[_0xd425('0x8f')]][_0x1d114f][_0xd425('0x49')]=_0xd425('0x64');this[_0xd425('0xc')][_0x353b48[_0xd425('0x8f')]][_0x1d114f][_0xd425('0x56')]='transfer';this['channels'][_0x353b48[_0xd425('0x8f')]][_0x1d114f][_0xd425('0x67')]=_0x28c27a[_0xd425('0x92')](this[_0xd425('0xc')][_0x353b48[_0xd425('0x8f')]][_0x1d114f][_0xd425('0x43')],_0xd425('0x94'));}}}}}}catch(_0x4b3582){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0x353b48['uniqueid'],util['inspect'](_0x4b3582,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd425('0x24')][_0xd425('0x1f')]=function(_0x59b4f9){var _0x258448='';try{if(this[_0xd425('0x26')](_0x59b4f9)){logger[_0xd425('0x38')](_0xd425('0x95'),_0x59b4f9[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x59b4f9,{'showHidden':![],'depth':null}));if(_0x59b4f9[_0xd425('0x96')]){_0x258448=_0x59b4f9[_0xd425('0x96')][_0xd425('0x97')](0x0,_0x59b4f9[_0xd425('0x96')][_0xd425('0x98')]('-'));if(this[_0xd425('0xf')][_0x258448]){logger[_0xd425('0x28')](_0xd425('0x99'),_0x59b4f9[_0xd425('0x2a')],_0x258448);this[_0xd425('0xf')][_0x258448][_0xd425('0x9a')]=!![];}}}}catch(_0x56c574){logger['error'](_0xd425('0x9b'),_0x59b4f9[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x56c574,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd425('0x9c')]=function(_0x3c46c9){var _0x29a8b3='';try{if(this[_0xd425('0x26')](_0x3c46c9)){logger[_0xd425('0x38')](_0xd425('0x9d'),_0x3c46c9[_0xd425('0x2a')],util[_0xd425('0x2e')](_0x3c46c9,{'showHidden':![],'depth':null}));if(_0x3c46c9[_0xd425('0x96')]){_0x29a8b3=_0x3c46c9[_0xd425('0x96')][_0xd425('0x97')](0x0,_0x3c46c9[_0xd425('0x96')][_0xd425('0x98')]('-'));if(this['agents'][_0x29a8b3]){logger[_0xd425('0x28')](_0xd425('0x9e'),_0x3c46c9[_0xd425('0x2a')],_0x29a8b3);this[_0xd425('0xf')][_0x29a8b3][_0xd425('0x9a')]=![];}}}}catch(_0x51680d){logger['error'](_0xd425('0x9f'),_0x3c46c9[_0xd425('0x2a')],util['inspect'](_0x51680d,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x6e82=['destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','name','accountcode','exten','custom:agentconnect','agentringnoanswer','agentcomplete','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','talktime','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncQueueCallerAbandon','syncVarSet','hangup','syncHangup','musiconholdstart','blindtransfer','syncBlindTransfer','emit','prototype','isUndefined','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','assign','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','error','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate'];(function(_0x120920,_0x19e995){var _0x3d9237=function(_0x55e893){while(--_0x55e893){_0x120920['push'](_0x120920['shift']());}};_0x3d9237(++_0x19e995);}(_0x6e82,0xf8));var _0x26e8=function(_0x3037c0,_0x5de2fe){_0x3037c0=_0x3037c0-0x0;var _0x59802e=_0x6e82[_0x3037c0];return _0x59802e;};'use strict';var _=require(_0x26e8('0x0'));var moment=require(_0x26e8('0x1'));var util=require(_0x26e8('0x2'));var Redis=require(_0x26e8('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x26e8('0x4'));var ami=require(_0x26e8('0x5'));config[_0x26e8('0x6')]=_[_0x26e8('0x7')](config[_0x26e8('0x6')],{'host':_0x26e8('0x8'),'port':0x18eb});var io=require(_0x26e8('0x9'))(new Redis(config[_0x26e8('0x6')]));function VoiceAgentReport(_0x1695ce){this[_0x26e8('0xa')]={};this['voiceChannels']=_0x1695ce['channels'];this[_0x26e8('0xb')]=_0x1695ce[_0x26e8('0xb')];this[_0x26e8('0xc')]=_0x1695ce[_0x26e8('0xc')];this[_0x26e8('0xd')]={};ami['on'](_0x26e8('0xe'),this[_0x26e8('0xf')][_0x26e8('0x10')](this));ami['on'](_0x26e8('0x11'),this[_0x26e8('0x12')][_0x26e8('0x10')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x26e8('0x10')](this));ami['on']('queuecallerabandon',this[_0x26e8('0x13')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x26e8('0x10')](this));ami['on']('varset',this[_0x26e8('0x14')][_0x26e8('0x10')](this));ami['on'](_0x26e8('0x15'),this[_0x26e8('0x16')][_0x26e8('0x10')](this));ami['on'](_0x26e8('0x17'),this['syncMusicOnHoldStart'][_0x26e8('0x10')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x26e8('0x10')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x26e8('0x10')](this));ami['on'](_0x26e8('0x18'),this[_0x26e8('0x19')][_0x26e8('0x10')](this));}VoiceAgentReport['prototype'][_0x26e8('0x1a')]=function(_0x2d1c47,_0x1a6999,_0x3897e2){io['to'](_0x2d1c47)[_0x26e8('0x1a')](_0x1a6999,_0x3897e2);};VoiceAgentReport[_0x26e8('0x1b')]['isNotNull']=function(_0x14bdd7){return _0x14bdd7!==null&&!_[_0x26e8('0x1c')](_0x14bdd7);};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0xf')]=function(_0xadf749){try{if(this[_0x26e8('0x1d')](_0xadf749)){logger[_0x26e8('0x1e')](_0x26e8('0x1f'),_0xadf749[_0x26e8('0x20')],_0xadf749[_0x26e8('0x21')],_0xadf749[_0x26e8('0x22')]);logger[_0x26e8('0x23')](_0x26e8('0x24'),_0xadf749[_0x26e8('0x20')],util[_0x26e8('0x25')](_0xadf749,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0xadf749['uniqueid']])){this['channels'][_0xadf749[_0x26e8('0x20')]]={};}var _0x5446ae=this[_0x26e8('0xc')][_0xadf749[_0x26e8('0x26')]];var _0x3313e8=this[_0x26e8('0xa')][_0xadf749[_0x26e8('0x20')]][_0xadf749['destuniqueid']];var _0x5f14c4=this[_0x26e8('0xb')][_0xadf749[_0x26e8('0x27')]];var _0x2c31f7=this['variables'][_0xadf749['uniqueid']];if(_[_0x26e8('0x1c')](_0x3313e8)){_0x3313e8={'agentcalledAt':moment()['format'](_0x26e8('0x28')),'lastevent':_0x26e8('0x29'),'mandatoryDisposition':_0x5f14c4&&_0x5f14c4['mandatoryDisposition']?_0x5f14c4[_0x26e8('0x2a')]:![],'type':_0x5f14c4&&_0x5f14c4['type']?_0x5f14c4[_0x26e8('0x2b')]:_0x26e8('0x2c'),'variables':_0x2c31f7,'motionChannel':_0x26e8('0x2d')};}Object[_0x26e8('0x2e')](_0x3313e8,_['omit'](_0xadf749,[_0x26e8('0x2f'),_0x26e8('0x30')]));this[_0x26e8('0xa')][_0xadf749['uniqueid']][_0xadf749[_0x26e8('0x22')]]=_0x3313e8;logger[_0x26e8('0x23')](_0x26e8('0x31'),_0xadf749[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x3313e8,{'showHidden':![],'depth':null}));ami[_0x26e8('0x1a')](_0x26e8('0x32'),_0x3313e8);var _0x5e53fb={'id':_0x5446ae['id'],'calleridnum':_0x3313e8[_0x26e8('0x33')],'queue':_0x3313e8[_0x26e8('0x27')],'variables':_0x3313e8[_0x26e8('0xd')],'uniqueid':_0xadf749[_0x26e8('0x20')]};logger[_0x26e8('0x23')](_0x26e8('0x34'),_0xadf749[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x5e53fb,{'showHidden':![],'depth':null}));this[_0x26e8('0x1a')](util[_0x26e8('0x35')](_0x26e8('0x36'),_0xadf749[_0x26e8('0x21')]),'user:called',_0x5e53fb);}}catch(_0x4274ba){logger[_0x26e8('0x37')]('[%s][voiceAgentReport][agentcalled]',_0xadf749['uniqueid'],util[_0x26e8('0x25')](_0x4274ba,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x12')]=function(_0x472a87){try{if(this['isNotNull'](_0x472a87)){if(this[_0x26e8('0xa')][_0x472a87['uniqueid']]){for(var _0x5c60fd in this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]]){if(this[_0x26e8('0xa')][_0x472a87['uniqueid']]['hasOwnProperty'](_0x5c60fd)){if(_0x472a87[_0x26e8('0x22')]===_0x5c60fd){logger[_0x26e8('0x1e')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x472a87[_0x26e8('0x20')],_0x472a87['membername'],_0x472a87['destuniqueid']);this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x5c60fd][_0x26e8('0x38')]=moment()[_0x26e8('0x35')](_0x26e8('0x28'));this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x39')]=_0x472a87['connectedlinename'];this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x5c60fd][_0x26e8('0x3a')]=_0x472a87['connectedlinenum'];this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x3b')]=_0x472a87[_0x26e8('0x3b')];this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x3c')]=_0x472a87[_0x26e8('0x3c')];this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x3d')]=_0x472a87[_0x26e8('0x3d')];this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x5c60fd][_0x26e8('0x3e')]=_0x26e8('0x3f');if(this['voiceChannels'][this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd]['uniqueid']]){var _0x48640f=this[_0x26e8('0x40')][this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x20')]][_0x26e8('0x41')];this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd]['routealias']=_0x48640f;_0x472a87[_0x26e8('0x41')]=_0x48640f;}_[_0x26e8('0x42')](this['agents'][_0x472a87[_0x26e8('0x26')]],_[_0x26e8('0x43')](_0x472a87,['queue',_0x26e8('0x44'),_0x26e8('0x41')]));var _0x32c018=this[_0x26e8('0xc')][_0x472a87['interface']];var _0x110c5e={'id':_0x32c018['id'],'name':_0x32c018[_0x26e8('0x45')],'agentconnected':!![],'destaccountcode':_0x32c018[_0x26e8('0x46')],'destconnectedlinenum':this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x472a87[_0x26e8('0x22')]][_0x26e8('0x47')],'queue':this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x472a87[_0x26e8('0x22')]][_0x26e8('0x27')],'routealias':this['channels'][_0x472a87['uniqueid']][_0x472a87[_0x26e8('0x22')]][_0x26e8('0x41')],'uniqueid':this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x472a87[_0x26e8('0x22')]][_0x26e8('0x20')]};ami[_0x26e8('0x1a')](_0x26e8('0x48'),this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x472a87['destuniqueid']]);this[_0x26e8('0x1a')](util[_0x26e8('0x35')](_0x26e8('0x36'),_0x472a87[_0x26e8('0x21')]),'user:agentconnect',_0x110c5e);}else if(!this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x5c60fd][_0x26e8('0x49')]&&!this['channels'][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x4a')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x472a87[_0x26e8('0x20')],this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x21')],_0x5c60fd);this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x49')]=!![];this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x4b')]=moment()[_0x26e8('0x35')](_0x26e8('0x28'));this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x5c60fd][_0x26e8('0x4c')]=_0x472a87[_0x26e8('0x22')];this['channels'][_0x472a87['uniqueid']][_0x5c60fd][_0x26e8('0x4d')]=_0x472a87[_0x26e8('0x21')];this['channels'][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x3e')]=_0x26e8('0x4e');this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd][_0x26e8('0x4f')]=_0x26e8('0x4e');logger[_0x26e8('0x23')](_0x26e8('0x50'),_0x472a87[_0x26e8('0x20')],util[_0x26e8('0x25')](this[_0x26e8('0xa')][_0x472a87[_0x26e8('0x20')]][_0x5c60fd],{'showHidden':![],'depth':null}));ami[_0x26e8('0x1a')](_0x26e8('0x51'),this[_0x26e8('0xa')][_0x472a87['uniqueid']][_0x5c60fd]);}else{logger[_0x26e8('0x23')](_0x26e8('0x52'),_0x472a87[_0x26e8('0x20')]);}}}}}}catch(_0x2971ee){logger[_0x26e8('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x472a87['uniqueid'],util[_0x26e8('0x25')](_0x2971ee,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x1a4efe){try{if(this[_0x26e8('0x1d')](_0x1a4efe)){logger['debug'](_0x26e8('0x53'),_0x1a4efe[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x1a4efe,{'showHidden':![],'depth':null}));if(this[_0x26e8('0xa')][_0x1a4efe[_0x26e8('0x20')]]&&this[_0x26e8('0xa')][_0x1a4efe[_0x26e8('0x20')]][_0x1a4efe[_0x26e8('0x22')]]){logger[_0x26e8('0x1e')](_0x26e8('0x54'),_0x1a4efe[_0x26e8('0x20')],_0x1a4efe[_0x26e8('0x21')],_0x1a4efe[_0x26e8('0x22')]);var _0x149d04=this[_0x26e8('0xc')][_0x1a4efe['interface']];var _0x3a845e=this[_0x26e8('0xa')][_0x1a4efe[_0x26e8('0x20')]][_0x1a4efe['destuniqueid']];_0x3a845e[_0x26e8('0x49')]=!![];_0x3a845e[_0x26e8('0x4b')]=moment()[_0x26e8('0x35')](_0x26e8('0x28'));_0x3a845e['lastevent']=_0x26e8('0x55');_0x3a845e['reason']='rejected';var _0x1cf8bc={'id':_0x149d04['id'],'name':_0x149d04[_0x26e8('0x45')],'queue':_0x3a845e[_0x26e8('0x27')],'uniqueid':_0x3a845e[_0x26e8('0x20')]};logger[_0x26e8('0x23')](_0x26e8('0x56'),_0x1a4efe[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x1cf8bc,{'showHidden':![],'depth':null}));this['emit'](util[_0x26e8('0x35')](_0x26e8('0x36'),_0x149d04[_0x26e8('0x45')]),_0x26e8('0x57'),_0x1cf8bc);ami[_0x26e8('0x1a')]('custom:agentringnoanswer',_0x3a845e);this[_0x26e8('0xa')][_0x1a4efe['uniqueid']][_0x1a4efe[_0x26e8('0x22')]]=Object[_0x26e8('0x2e')]({},_0x3a845e);}}}catch(_0x226c31){logger['error'](_0x26e8('0x58'),_0x1a4efe[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x226c31,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x13')]=function(_0x11bdcf){try{if(this['isNotNull'](_0x11bdcf)){logger[_0x26e8('0x23')](_0x26e8('0x59'),_0x11bdcf[_0x26e8('0x20')],util['inspect'](_0x11bdcf,{'showHidden':![],'depth':null}));if(this['channels'][_0x11bdcf[_0x26e8('0x20')]]){for(var _0x88120f in this[_0x26e8('0xa')][_0x11bdcf[_0x26e8('0x20')]]){if(this[_0x26e8('0xa')][_0x11bdcf[_0x26e8('0x20')]][_0x26e8('0x5a')](_0x88120f)&&!this[_0x26e8('0xa')][_0x11bdcf['uniqueid']][_0x88120f][_0x26e8('0x49')]&&!this[_0x26e8('0xa')][_0x11bdcf[_0x26e8('0x20')]][_0x88120f][_0x26e8('0x4a')]){logger['info']('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x11bdcf[_0x26e8('0x20')],this['channels'][_0x11bdcf[_0x26e8('0x20')]][_0x88120f]['membername'],_0x88120f);this['channels'][_0x11bdcf[_0x26e8('0x20')]][_0x88120f][_0x26e8('0x49')]=!![];this[_0x26e8('0xa')][_0x11bdcf[_0x26e8('0x20')]][_0x88120f][_0x26e8('0x4b')]=moment()[_0x26e8('0x35')](_0x26e8('0x28'));this[_0x26e8('0xa')][_0x11bdcf[_0x26e8('0x20')]][_0x88120f][_0x26e8('0x3e')]=_0x26e8('0x5b');this['channels'][_0x11bdcf[_0x26e8('0x20')]][_0x88120f][_0x26e8('0x4f')]=_0x26e8('0x5b');logger[_0x26e8('0x23')](_0x26e8('0x5c'),_0x11bdcf[_0x26e8('0x20')],util[_0x26e8('0x25')](this['channels'][_0x11bdcf[_0x26e8('0x20')]][_0x88120f],{'showHidden':![],'depth':null}));ami['emit'](_0x26e8('0x5d'),this[_0x26e8('0xa')][_0x11bdcf[_0x26e8('0x20')]][_0x88120f]);}}}}}catch(_0xbbb7c2){logger[_0x26e8('0x37')](_0x26e8('0x5e'),_0x11bdcf[_0x26e8('0x20')],util[_0x26e8('0x25')](_0xbbb7c2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')]['syncAgentComplete']=function(_0x5065bd){try{if(this[_0x26e8('0x1d')](_0x5065bd)){logger[_0x26e8('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x5065bd['uniqueid'],util[_0x26e8('0x25')](_0x5065bd,{'showHidden':![],'depth':null}));if(this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]]){for(var _0xb10235 in this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]]){if(this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]]['hasOwnProperty'](_0xb10235)){if(this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235][_0x26e8('0x38')]&&!this['channels'][_0x5065bd[_0x26e8('0x20')]][_0xb10235][_0x26e8('0x4a')]){logger[_0x26e8('0x1e')](_0x26e8('0x5f'),_0x5065bd['uniqueid'],this[_0x26e8('0xa')][_0x5065bd['uniqueid']][_0xb10235][_0x26e8('0x21')],_0xb10235);this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235][_0x26e8('0x4a')]=!![];this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235][_0x26e8('0x60')]=moment()[_0x26e8('0x35')](_0x26e8('0x28'));this['channels'][_0x5065bd[_0x26e8('0x20')]][_0xb10235][_0x26e8('0x3e')]=_0x26e8('0x61');this['channels'][_0x5065bd['uniqueid']][_0xb10235][_0x26e8('0x4f')]=_0x5065bd[_0x26e8('0x4f')]==_0x26e8('0x62')?_0x26e8('0x63'):_0x5065bd[_0x26e8('0x4f')];this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235]['talktime']=_0x5065bd['talktime'];if(this['voiceQueues'][_0x5065bd[_0x26e8('0x27')]]&&this['voiceQueues'][_0x5065bd[_0x26e8('0x27')]]['acw']){this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235][_0x26e8('0x64')]=this[_0x26e8('0xb')][_0x5065bd[_0x26e8('0x27')]]['acwTimeout'];this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235][_0x26e8('0x65')]=!![];}this[_0x26e8('0xc')][_0x5065bd['interface']]=_['omit'](this[_0x26e8('0xc')][_0x5065bd[_0x26e8('0x26')]],[_0x26e8('0x27'),_0x26e8('0x44')]);logger[_0x26e8('0x23')](_0x26e8('0x66'),_0x5065bd[_0x26e8('0x20')],util[_0x26e8('0x25')](this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235],{'showHidden':![],'depth':null}));ami[_0x26e8('0x1a')](_0x26e8('0x67'),this[_0x26e8('0xa')][_0x5065bd[_0x26e8('0x20')]][_0xb10235]);logger[_0x26e8('0x23')](_0x26e8('0x68'),_0x5065bd['uniqueid'],util[_0x26e8('0x25')]({'id':this[_0x26e8('0xc')][_0x5065bd[_0x26e8('0x26')]]['id'],'destaccountcode':_0x5065bd[_0x26e8('0x69')]},{'showHidden':![],'depth':null}));this[_0x26e8('0x1a')](util[_0x26e8('0x35')](_0x26e8('0x36'),_0x5065bd['membername']),_0x26e8('0x6a'),{'id':this['agents'][_0x5065bd[_0x26e8('0x26')]]['id'],'destaccountcode':Number(_0x5065bd[_0x26e8('0x69')])});}}}}}}catch(_0x278df5){logger[_0x26e8('0x37')]('[%s][voiceAgentReport][agentcomplete]',_0x5065bd[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x278df5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x14')]=function(_0x496106){try{if(this[_0x26e8('0x1d')](_0x496106)){logger[_0x26e8('0x23')](_0x26e8('0x6b'),_0x496106[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x496106,{'showHidden':![],'depth':null}));this[_0x26e8('0x6c')](_0x496106[_0x26e8('0x20')],_[_0x26e8('0x6d')](_0x496106['variable'])[0x0],_0x496106[_0x26e8('0x6e')]);if(this[_0x26e8('0xa')][_0x496106['uniqueid']]){for(var _0x207266 in this[_0x26e8('0xa')][_0x496106['uniqueid']]){if(this['channels'][_0x496106[_0x26e8('0x20')]][_0x26e8('0x5a')](_0x207266)){logger[_0x26e8('0x1e')](_0x26e8('0x6f'),_0x496106[_0x26e8('0x20')],_0x207266,_[_0x26e8('0x6d')](_0x496106['variable'])[0x0],_0x496106[_0x26e8('0x6e')]);if(_[_0x26e8('0x1c')](this['channels'][_0x496106[_0x26e8('0x20')]][_0x207266]['variables'])){this[_0x26e8('0xa')][_0x496106['uniqueid']][_0x207266]['variables']={};}this[_0x26e8('0xa')][_0x496106[_0x26e8('0x20')]][_0x207266]['variables']=this['variables'][_0x496106['uniqueid']];}}}}}catch(_0x1cf34f){logger[_0x26e8('0x37')](_0x26e8('0x70'),_0x496106['uniqueid'],util[_0x26e8('0x25')](_0x1cf34f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x6c')]=function(_0xfe98f6,_0x98a6be,_0x24a731){var _0x5061d3=['rtpaudioqos',_0x26e8('0x71'),_0x26e8('0x72'),'rtpaudioqosjitterbridged',_0x26e8('0x73'),_0x26e8('0x74'),_0x26e8('0x75'),'rtpaudioqosrttbridged',_0x26e8('0x76'),_0x26e8('0x77'),_0x26e8('0x78'),_0x26e8('0x79'),'membercalls',_0x26e8('0x7a'),_0x26e8('0x7b'),_0x26e8('0x7c'),'membername',_0x26e8('0x7d'),_0x26e8('0x7e')];if(!_['isNil'](_0x98a6be)&&!_[_0x26e8('0x7f')](_0x5061d3,_0x98a6be)){if(_[_0x26e8('0x1c')](this[_0x26e8('0xd')][_0xfe98f6])){this[_0x26e8('0xd')][_0xfe98f6]={};}this[_0x26e8('0xd')][_0xfe98f6][_0x98a6be]=_0x24a731;}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x16')]=function(_0x5bde07){try{if(this[_0x26e8('0x1d')](_0x5bde07)){logger[_0x26e8('0x23')]('[%s][voiceAgentReport][hangup]\x20event:',_0x5bde07[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x5bde07,{'showHidden':![],'depth':null}));if(this[_0x26e8('0xa')][_0x5bde07[_0x26e8('0x20')]]){for(var _0x3a0861 in this['channels'][_0x5bde07[_0x26e8('0x20')]]){if(this[_0x26e8('0xa')][_0x5bde07['uniqueid']][_0x26e8('0x5a')](_0x3a0861)){if(this[_0x26e8('0xa')][_0x5bde07['uniqueid']][_0x3a0861][_0x26e8('0x4f')]=='transfer'&&this['channels'][_0x5bde07[_0x26e8('0x20')]][_0x3a0861][_0x26e8('0x4a')]){logger[_0x26e8('0x1e')](_0x26e8('0x80'),_0x5bde07['uniqueid'],_0x3a0861);this[_0x26e8('0xa')][_0x5bde07[_0x26e8('0x20')]][_0x3a0861][_0x26e8('0x60')]=moment()[_0x26e8('0x35')](_0x26e8('0x28'));}}}logger[_0x26e8('0x23')](_0x26e8('0x81'),_0x5bde07[_0x26e8('0x20')],util['inspect'](_['values'](this[_0x26e8('0xa')][_0x5bde07[_0x26e8('0x20')]]),{'showHidden':![],'depth':null}));ami[_0x26e8('0x1a')]('custom:voiceAgentReport',_['values'](this[_0x26e8('0xa')][_0x5bde07[_0x26e8('0x20')]]));delete this[_0x26e8('0xa')][_0x5bde07[_0x26e8('0x20')]];}if(this[_0x26e8('0xd')][_0x5bde07['uniqueid']]){delete this[_0x26e8('0xd')][_0x5bde07[_0x26e8('0x20')]];}}}catch(_0x1db7ad){logger[_0x26e8('0x37')]('[%s][voiceAgentReport][hangup]',_0x5bde07['uniqueid'],util['inspect'](_0x1db7ad,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x26e8('0x82')]=function(_0x44f042){try{if(this[_0x26e8('0x1d')](_0x44f042)){logger['debug'](_0x26e8('0x83'),_0x44f042[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x44f042,{'showHidden':![],'depth':null}));if(this['channels'][_0x44f042[_0x26e8('0x84')]]){for(var _0x27daf9 in this['channels'][_0x44f042[_0x26e8('0x84')]]){if(this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x84')]]['hasOwnProperty'](_0x27daf9)){if(_0x44f042[_0x26e8('0x85')]===_0x27daf9){logger[_0x26e8('0x1e')](_0x26e8('0x86'),_0x44f042[_0x26e8('0x20')],this['channels'][_0x44f042[_0x26e8('0x84')]][_0x27daf9][_0x26e8('0x21')],_0x27daf9);var _0x3d5a8a=moment();this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x84')]][_0x27daf9]['agentcomplete']=!![];this['channels'][_0x44f042['transfereeuniqueid']][_0x27daf9][_0x26e8('0x60')]=moment()['format'](_0x26e8('0x28'));this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x84')]][_0x27daf9][_0x26e8('0x3e')]=_0x26e8('0x61');this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x84')]][_0x27daf9][_0x26e8('0x4f')]=_0x26e8('0x62');this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x84')]][_0x27daf9][_0x26e8('0x87')]=_0x3d5a8a[_0x26e8('0x88')](this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x84')]][_0x27daf9]['agentconnectAt'],_0x26e8('0x89'));}}}}if(this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x8a')]]){var _0x3372af=this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x8a')]];this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x8a')]]=this[_0x26e8('0xa')][_0x44f042[_0x26e8('0x84')]];this[_0x26e8('0xa')][_0x44f042['transfereeuniqueid']]=_0x3372af;}}}catch(_0x99432b){logger[_0x26e8('0x37')]('[%s][voiceAgentReport][attendedtransfer]',_0x44f042[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x99432b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x19')]=function(_0x4fbbdf){try{if(this[_0x26e8('0x1d')](_0x4fbbdf)){logger[_0x26e8('0x23')](_0x26e8('0x8b'),_0x4fbbdf[_0x26e8('0x20')],util['inspect'](_0x4fbbdf,{'showHidden':![],'depth':null}));if(this['channels'][_0x4fbbdf[_0x26e8('0x84')]]){for(var _0xfc7483 in this[_0x26e8('0xa')][_0x4fbbdf[_0x26e8('0x84')]]){if(this[_0x26e8('0xa')][_0x4fbbdf[_0x26e8('0x84')]][_0x26e8('0x5a')](_0xfc7483)){if(_0x4fbbdf['transfereruniqueid']===_0xfc7483){logger[_0x26e8('0x1e')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4fbbdf[_0x26e8('0x20')],this[_0x26e8('0xa')][_0x4fbbdf[_0x26e8('0x84')]][_0xfc7483]['membername'],_0xfc7483);var _0x18ff38=moment();this['channels'][_0x4fbbdf[_0x26e8('0x84')]][_0xfc7483]['agentcomplete']=!![];this[_0x26e8('0xa')][_0x4fbbdf['transfereeuniqueid']][_0xfc7483][_0x26e8('0x60')]=_0x18ff38;this[_0x26e8('0xa')][_0x4fbbdf[_0x26e8('0x84')]][_0xfc7483][_0x26e8('0x3e')]=_0x26e8('0x61');this[_0x26e8('0xa')][_0x4fbbdf[_0x26e8('0x84')]][_0xfc7483][_0x26e8('0x4f')]=_0x26e8('0x62');this['channels'][_0x4fbbdf[_0x26e8('0x84')]][_0xfc7483][_0x26e8('0x87')]=_0x18ff38[_0x26e8('0x88')](this['channels'][_0x4fbbdf[_0x26e8('0x84')]][_0xfc7483][_0x26e8('0x38')],_0x26e8('0x89'));}}}}}}catch(_0x5de87b){logger[_0x26e8('0x37')](_0x26e8('0x8c'),_0x4fbbdf['uniqueid'],util[_0x26e8('0x25')](_0x5de87b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x8d')]=function(_0x27d4c7){var _0x523aed='';try{if(this[_0x26e8('0x1d')](_0x27d4c7)){logger[_0x26e8('0x23')](_0x26e8('0x8e'),_0x27d4c7[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x27d4c7,{'showHidden':![],'depth':null}));if(_0x27d4c7[_0x26e8('0x8f')]){_0x523aed=_0x27d4c7[_0x26e8('0x8f')][_0x26e8('0x90')](0x0,_0x27d4c7[_0x26e8('0x8f')][_0x26e8('0x91')]('-'));if(this[_0x26e8('0xc')][_0x523aed]){logger[_0x26e8('0x1e')](_0x26e8('0x92'),_0x27d4c7[_0x26e8('0x20')],_0x523aed);this[_0x26e8('0xc')][_0x523aed][_0x26e8('0x93')]=!![];}}}}catch(_0x3e22e6){logger[_0x26e8('0x37')](_0x26e8('0x94'),_0x27d4c7[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x3e22e6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x26e8('0x1b')][_0x26e8('0x95')]=function(_0x49f73c){var _0x4f3123='';try{if(this[_0x26e8('0x1d')](_0x49f73c)){logger['debug'](_0x26e8('0x96'),_0x49f73c[_0x26e8('0x20')],util['inspect'](_0x49f73c,{'showHidden':![],'depth':null}));if(_0x49f73c[_0x26e8('0x8f')]){_0x4f3123=_0x49f73c[_0x26e8('0x8f')][_0x26e8('0x90')](0x0,_0x49f73c[_0x26e8('0x8f')][_0x26e8('0x91')]('-'));if(this[_0x26e8('0xc')][_0x4f3123]){logger[_0x26e8('0x1e')](_0x26e8('0x97'),_0x49f73c[_0x26e8('0x20')],_0x4f3123);this[_0x26e8('0xc')][_0x4f3123][_0x26e8('0x93')]=![];}}}}catch(_0x48ce85){logger[_0x26e8('0x37')](_0x26e8('0x98'),_0x49f73c[_0x26e8('0x20')],util[_0x26e8('0x25')](_0x48ce85,{'showHidden':![],'depth':null}));}};module[_0x26e8('0x99')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 8e37fd2..26aecaa 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed82=['xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','[%s][voiceCallReport][varset]','answertime','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','transferToInternal','isEmpty','getSettings','stopRecordingOnTransfer','StopMixMonitor','catch','Action','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','routeid','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','name','accountcode','connectedlinenum','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','undefined','user:%s','user:agentconnect','[%s][voiceCallReport][newchannel]','syncNewExten','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastapplication','lastdata','set','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','connectedlinename','membername','destinationchannel','UserId','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','.wav49','.WAV','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','destination'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed82,0x1cf));var _0x2ed8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xed82[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x2ed8('0x0'));var moment=require(_0x2ed8('0x1'));var util=require(_0x2ed8('0x2'));var path=require(_0x2ed8('0x3'));var Redis=require(_0x2ed8('0x4'));var config=require(_0x2ed8('0x5'));var logger=require(_0x2ed8('0x6'))(_0x2ed8('0x7'));var ami=require(_0x2ed8('0x8'));var Channel=require(_0x2ed8('0x9'));var RpcSetting=require(_0x2ed8('0xa'));var applications=['set',_0x2ed8('0xb'),_0x2ed8('0xc'),_0x2ed8('0xd'),_0x2ed8('0xe'),'voicemail'];var dispositions=[_0x2ed8('0xf'),'FAILED',_0x2ed8('0x10'),_0x2ed8('0xf'),_0x2ed8('0xf'),_0x2ed8('0xf'),_0x2ed8('0x11'),_0x2ed8('0x12'),_0x2ed8('0x10'),'FAILED',_0x2ed8('0x10')];config[_0x2ed8('0x13')]=_[_0x2ed8('0x14')](config[_0x2ed8('0x13')],{'host':_0x2ed8('0x15'),'port':0x18eb});var io=require(_0x2ed8('0x16'))(new Redis(config['redis']));function VoiceCallReport(_0x51af87){this[_0x2ed8('0x17')]=_0x51af87['channels'];this[_0x2ed8('0x18')]=_0x51af87[_0x2ed8('0x18')];this['blindTransfers']={};ami['on']('coreshowchannel',this['syncNewExten'][_0x2ed8('0x19')](this));ami['on'](_0x2ed8('0x1a'),this['syncNewExten'][_0x2ed8('0x19')](this));ami['on'](_0x2ed8('0x1b'),this[_0x2ed8('0x1c')][_0x2ed8('0x19')](this));ami['on'](_0x2ed8('0x1d'),this[_0x2ed8('0x1e')][_0x2ed8('0x19')](this));ami['on'](_0x2ed8('0x1f'),this[_0x2ed8('0x20')][_0x2ed8('0x19')](this));ami['on']('hangup',this[_0x2ed8('0x21')][_0x2ed8('0x19')](this));ami['on'](_0x2ed8('0x22'),this[_0x2ed8('0x23')][_0x2ed8('0x19')](this));ami['on']('attendedtransfer',this[_0x2ed8('0x24')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x2ed8('0x19')](this));ami['on'](_0x2ed8('0x25'),this[_0x2ed8('0x26')][_0x2ed8('0x19')](this));ami['on'](_0x2ed8('0x27'),this[_0x2ed8('0x28')][_0x2ed8('0x19')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x2ed8('0x29')]();}catch(_0x43e54f){logger[_0x2ed8('0x2a')](_0x2ed8('0x2b'),util[_0x2ed8('0x2c')](_0x43e54f,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x2ed8('0x2d')][_0x2ed8('0x2e')]=function(_0x3f6d87){return _0x3f6d87!==null&&!_['isUndefined'](_0x3f6d87);};VoiceCallReport[_0x2ed8('0x2d')][_0x2ed8('0x2f')]=function(_0x5ee0e3,_0x4cb082,_0x4f90c1){io['to'](_0x5ee0e3)[_0x2ed8('0x2f')](_0x4cb082,_0x4f90c1);};VoiceCallReport[_0x2ed8('0x2d')]['syncNewCallerId']=function(_0x54c522){try{if(this[_0x2ed8('0x2e')](_0x54c522)){logger[_0x2ed8('0x30')](_0x2ed8('0x31'),_0x54c522[_0x2ed8('0x32')],_0x54c522[_0x2ed8('0x33')],_0x54c522[_0x2ed8('0x34')]);logger[_0x2ed8('0x35')](_0x2ed8('0x36'),_0x54c522['uniqueid'],util[_0x2ed8('0x2c')](_0x54c522,{'showHidden':![],'depth':null}));if(_0x54c522[_0x2ed8('0x32')]===_0x54c522[_0x2ed8('0x37')]){if(!_[_0x2ed8('0x38')](this[_0x2ed8('0x17')][_0x54c522[_0x2ed8('0x32')]])){_[_0x2ed8('0x39')](this[_0x2ed8('0x17')][_0x54c522[_0x2ed8('0x32')]],_[_0x2ed8('0x3a')](_0x54c522,_[_0x2ed8('0x3b')](this[_0x2ed8('0x17')][_0x54c522[_0x2ed8('0x32')]])));}}if(_0x54c522[_0x2ed8('0x3c')]===_0x2ed8('0x3d')){var _0x55cf05=this['agents'][_0x54c522[_0x2ed8('0x3e')][_0x2ed8('0x3f')]('-')[0x0]];if(_0x55cf05){if(_0x54c522[_0x2ed8('0x40')]==_0x2ed8('0x41')){_0x55cf05[_0x2ed8('0x42')]=_0x54c522['connectedlinenum'];this[_0x2ed8('0x2f')](util['format']('user:%s',_0x55cf05[_0x2ed8('0x43')]),'user:agentconnect',{'id':_0x55cf05['id'],'destaccountcode':_0x55cf05[_0x2ed8('0x44')],'destconnectedlinenum':_0x54c522[_0x2ed8('0x45')]});}}}}}catch(_0x4e7acd){logger[_0x2ed8('0x2a')]('[%s][voiceCallReport][newcallerid]',_0x54c522['uniqueid'],util[_0x2ed8('0x2c')](_0x4e7acd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2ed8('0x2d')]['syncNewChannel']=function(_0x10b6c8){try{if(this[_0x2ed8('0x2e')](_0x10b6c8)){logger['debug'](_0x2ed8('0x46'),_0x10b6c8[_0x2ed8('0x32')],util[_0x2ed8('0x2c')](_0x10b6c8,{'showHidden':![],'depth':null}));if(this['channels'][_0x10b6c8['uniqueid']]){return;}if(_0x10b6c8[_0x2ed8('0x3e')]===_0x2ed8('0x47')){return;}if(_0x10b6c8[_0x2ed8('0x32')]!==_0x10b6c8[_0x2ed8('0x37')]&&!this[_0x2ed8('0x48')][_0x10b6c8[_0x2ed8('0x37')]]){return;}logger[_0x2ed8('0x30')](_0x2ed8('0x49'),_0x10b6c8[_0x2ed8('0x32')],_0x10b6c8[_0x2ed8('0x3c')],_0x10b6c8[_0x2ed8('0x40')]);this['channels'][_0x10b6c8['uniqueid']]=new Channel();this[_0x2ed8('0x17')][_0x10b6c8[_0x2ed8('0x32')]][_0x2ed8('0x4a')]=moment()[_0x2ed8('0x4b')](_0x2ed8('0x4c'));this[_0x2ed8('0x17')][_0x10b6c8[_0x2ed8('0x32')]][_0x2ed8('0x4d')]=dispositions[_[_0x2ed8('0x4e')](_0x10b6c8[_0x2ed8('0x4f')])];_[_0x2ed8('0x39')](this[_0x2ed8('0x17')][_0x10b6c8['uniqueid']],_[_0x2ed8('0x3a')](_0x10b6c8,_[_0x2ed8('0x3b')](this['channels'][_0x10b6c8[_0x2ed8('0x32')]])));if(_0x10b6c8[_0x2ed8('0x3c')]==='from-sip'){var _0x38ecb2=this[_0x2ed8('0x18')][_0x10b6c8['channel'][_0x2ed8('0x3f')]('-')[0x0]];if(_0x38ecb2&&typeof _0x38ecb2['destconnectedlinenum']===_0x2ed8('0x50')){_0x38ecb2['destconnectedlinenum']=_0x10b6c8[_0x2ed8('0x40')];logger[_0x2ed8('0x35')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x10b6c8[_0x2ed8('0x32')],util[_0x2ed8('0x2c')]({'id':_0x38ecb2['id'],'destaccountcode':_0x38ecb2[_0x2ed8('0x44')],'destconnectedlinenum':_0x10b6c8[_0x2ed8('0x40')]},{'showHidden':![],'depth':null}));this[_0x2ed8('0x2f')](util[_0x2ed8('0x4b')](_0x2ed8('0x51'),_0x38ecb2[_0x2ed8('0x43')]),_0x2ed8('0x52'),{'id':_0x38ecb2['id'],'destaccountcode':_0x38ecb2[_0x2ed8('0x44')],'destconnectedlinenum':_0x10b6c8[_0x2ed8('0x40')]});}}}}catch(_0xff0f8f){logger[_0x2ed8('0x2a')](_0x2ed8('0x53'),_0x10b6c8[_0x2ed8('0x32')],util['inspect'](_0xff0f8f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2ed8('0x2d')][_0x2ed8('0x54')]=function(_0x584f1a){try{if(this[_0x2ed8('0x2e')](_0x584f1a)){logger[_0x2ed8('0x35')](_0x2ed8('0x55'),_0x584f1a[_0x2ed8('0x32')],util[_0x2ed8('0x2c')](_0x584f1a,{'showHidden':![],'depth':null}));if(_0x584f1a[_0x2ed8('0x3e')]===_0x2ed8('0x47')||_0x584f1a[_0x2ed8('0x40')]==='h')return;if(_0x584f1a[_0x2ed8('0x32')]===_0x584f1a[_0x2ed8('0x37')]||this[_0x2ed8('0x48')][_0x584f1a[_0x2ed8('0x37')]]){_0x584f1a[_0x2ed8('0x56')]=_0x584f1a[_0x2ed8('0x56')]?_0x584f1a[_0x2ed8('0x56')][_0x2ed8('0x57')]():undefined;_0x584f1a[_0x2ed8('0x58')]=_0x584f1a['appdata']||_0x584f1a[_0x2ed8('0x58')];if(_0x584f1a[_0x2ed8('0x59')]&&!_0x584f1a[_0x2ed8('0x59')][_0x2ed8('0x5a')]('CDR(routeAlias)')&&_0x584f1a[_0x2ed8('0x56')]!==_0x2ed8('0xb')){_0x584f1a[_0x2ed8('0x58')]=_0x584f1a['applicationdata']['toLowerCase']();}logger[_0x2ed8('0x30')](_0x2ed8('0x5b'),_0x584f1a[_0x2ed8('0x32')],_0x584f1a[_0x2ed8('0x56')],_0x584f1a[_0x2ed8('0x58')]);if(_['isUndefined'](this['channels'][_0x584f1a[_0x2ed8('0x32')]])){this[_0x2ed8('0x17')][_0x584f1a[_0x2ed8('0x32')]]=new Channel();this[_0x2ed8('0x17')][_0x584f1a[_0x2ed8('0x32')]][_0x2ed8('0x4a')]=_0x584f1a['duration']?moment()['subtract'](moment[_0x2ed8('0x5c')](_0x584f1a['duration'])[_0x2ed8('0x5d')](),'seconds')['format'](_0x2ed8('0x4c')):moment()[_0x2ed8('0x4b')](_0x2ed8('0x4c'));this[_0x2ed8('0x17')][_0x584f1a['uniqueid']]['disposition']='NO\x20ANSWER';}_[_0x2ed8('0x39')](this[_0x2ed8('0x17')][_0x584f1a[_0x2ed8('0x32')]],_[_0x2ed8('0x3a')](_0x584f1a,_[_0x2ed8('0x3b')](this[_0x2ed8('0x17')][_0x584f1a['uniqueid']])));if(_[_0x2ed8('0x5e')](applications,_0x584f1a['application'])){this[_0x2ed8('0x17')][_0x584f1a[_0x2ed8('0x32')]][_0x2ed8('0x5f')]=_0x584f1a['application'];this[_0x2ed8('0x17')][_0x584f1a[_0x2ed8('0x32')]][_0x2ed8('0x60')]=_0x584f1a[_0x2ed8('0x58')];if(_0x584f1a[_0x2ed8('0x56')]===_0x2ed8('0x61')&&_[_0x2ed8('0x5a')](_0x584f1a['applicationdata']['toLowerCase'](),_0x2ed8('0x62'))){var _0x27b81d=_0x584f1a[_0x2ed8('0x58')][_0x2ed8('0x3f')]('=');var _0x34b585=_0x27b81d[0x0][_0x2ed8('0x57')]()[_0x2ed8('0x63')](/cdr\((.*)\)/);if(_0x34b585){if(_0x34b585[0x1]===_0x2ed8('0x64')&&!_[_0x2ed8('0x65')](this['channels'][_0x584f1a['uniqueid']][_0x34b585[0x1]]))return;this['channels'][_0x584f1a['uniqueid']][_0x34b585[0x1]]=_0x27b81d[0x1];}}else if(_0x584f1a[_0x2ed8('0x56')]===_0x2ed8('0xb')){this['channels'][_0x584f1a[_0x2ed8('0x32')]]['queue']=_0x584f1a[_0x2ed8('0x58')][_0x2ed8('0x3f')](',')[0x0];}}}}}catch(_0x1b05bf){logger[_0x2ed8('0x2a')](_0x2ed8('0x66'),_0x584f1a[_0x2ed8('0x32')],util[_0x2ed8('0x2c')](_0x1b05bf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2ed8('0x2d')]['syncNewState']=function(_0x34d27f){try{if(this[_0x2ed8('0x2e')](_0x34d27f)){logger[_0x2ed8('0x30')](_0x2ed8('0x67'),_0x34d27f[_0x2ed8('0x32')],_0x34d27f[_0x2ed8('0x37')],_0x34d27f['calleridname'],_0x34d27f[_0x2ed8('0x34')]);logger[_0x2ed8('0x35')](_0x2ed8('0x68'),_0x34d27f[_0x2ed8('0x32')],util[_0x2ed8('0x2c')](_0x34d27f,{'showHidden':![],'depth':null}));if(_0x34d27f[_0x2ed8('0x4f')]!=='6')return;var _0x5b6be1=this[_0x2ed8('0x18')][_0x34d27f[_0x2ed8('0x3e')][_0x2ed8('0x3f')]('-')[0x0]];if(_0x34d27f[_0x2ed8('0x32')]!==_0x34d27f[_0x2ed8('0x37')]){var _0x39f0be=moment();if(this[_0x2ed8('0x17')][_0x34d27f['linkedid']]){if(!this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]][_0x2ed8('0x69')]){this[_0x2ed8('0x17')][_0x34d27f['linkedid']][_0x2ed8('0x69')]=!![];this[_0x2ed8('0x17')][_0x34d27f['linkedid']]['answertime']=_0x39f0be[_0x2ed8('0x4b')](_0x2ed8('0x4c'));if(this[_0x2ed8('0x17')][_0x34d27f['linkedid']][_0x2ed8('0x4a')]){this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]][_0x2ed8('0x6a')]=_0x39f0be[_0x2ed8('0x6b')](this['channels'][_0x34d27f[_0x2ed8('0x37')]][_0x2ed8('0x4a')],_0x2ed8('0x5d'));}}this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]][_0x2ed8('0x37')]=_0x34d27f[_0x2ed8('0x32')];if(_0x34d27f[_0x2ed8('0x34')]!==_0x2ed8('0x41')){this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]]['connectedlinenum']=_0x34d27f['calleridnum'];}this['channels'][_0x34d27f['linkedid']][_0x2ed8('0x6c')]=_0x34d27f[_0x2ed8('0x33')];this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]]['destinationchannel']=_0x34d27f[_0x2ed8('0x3e')];this['channels'][_0x34d27f[_0x2ed8('0x37')]][_0x2ed8('0x4d')]=dispositions[_[_0x2ed8('0x4e')](_0x34d27f[_0x2ed8('0x4f')])];if(_0x5b6be1){this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]]['UserId']=_0x5b6be1['id'];this[_0x2ed8('0x17')][_0x34d27f['linkedid']][_0x2ed8('0x6d')]=_0x5b6be1[_0x2ed8('0x43')];}}if(this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]]){if(!this['channels'][_0x34d27f['uniqueid']][_0x2ed8('0x69')]){this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x69')]=!![];this[_0x2ed8('0x17')][_0x34d27f['uniqueid']]['answertime']=_0x39f0be[_0x2ed8('0x4b')](_0x2ed8('0x4c'));if(this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x4a')]){this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x6a')]=_0x39f0be[_0x2ed8('0x6b')](this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x4a')],_0x2ed8('0x5d'));}}if(_0x34d27f[_0x2ed8('0x34')]!==_0x2ed8('0x41')){this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x45')]=_0x34d27f[_0x2ed8('0x34')];}this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x6c')]=_0x34d27f[_0x2ed8('0x33')];this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x6e')]=_0x34d27f[_0x2ed8('0x3e')];this['channels'][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x4d')]=dispositions[_[_0x2ed8('0x4e')](_0x34d27f[_0x2ed8('0x4f')])];}}else{if(this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]]){if(_0x5b6be1){this['channels'][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x6f')]=_0x5b6be1['id'];this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0x6d')]=_0x5b6be1[_0x2ed8('0x43')];}}}if(_0x34d27f[_0x2ed8('0x3c')]===_0x2ed8('0x3d')){if(_0x5b6be1){_0x5b6be1[_0x2ed8('0x42')]=_0x34d27f[_0x2ed8('0x40')];var _0x3087fa,_0x54a00d;if(this['channels'][_0x34d27f['uniqueid']]){_0x3087fa=this['channels'][_0x34d27f[_0x2ed8('0x32')]]['routealias'];_0x54a00d=this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x32')]][_0x2ed8('0xb')];}else if(this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]]){_0x3087fa=this['channels'][_0x34d27f[_0x2ed8('0x37')]][_0x2ed8('0x70')];_0x54a00d=this[_0x2ed8('0x17')][_0x34d27f[_0x2ed8('0x37')]]['queue'];}_0x5b6be1[_0x2ed8('0xb')]=_0x54a00d;_0x5b6be1['routealias']=_0x3087fa;var _0x167030={'id':_0x5b6be1['id'],'name':_0x5b6be1[_0x2ed8('0x43')],'agentconnected':!![],'destaccountcode':_0x5b6be1['accountcode'],'destconnectedlinenum':_0x34d27f[_0x2ed8('0x40')],'queue':_0x54a00d||undefined,'routealias':_0x3087fa,'uniqueid':_0x34d27f[_0x2ed8('0x37')]};logger[_0x2ed8('0x35')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x34d27f[_0x2ed8('0x32')],util[_0x2ed8('0x2c')](_0x167030,{'showHidden':![],'depth':null}));this['emit'](util[_0x2ed8('0x4b')]('user:%s',_0x5b6be1[_0x2ed8('0x43')]),_0x2ed8('0x52'),_0x167030);}}}}catch(_0x505f20){logger[_0x2ed8('0x2a')](_0x2ed8('0x71'),_0x34d27f[_0x2ed8('0x32')],util[_0x2ed8('0x2c')](_0x505f20,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2ed8('0x2d')][_0x2ed8('0x72')]=function(_0x386c78,_0x543231){try{if(this['channels'][_0x386c78]){logger['info']('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x386c78,_0x543231);this[_0x2ed8('0x17')][_0x386c78][_0x2ed8('0x73')]=!![];if(_['endsWith'](_0x543231,_0x2ed8('0x74'))){_0x543231=_0x543231['replace'](_0x2ed8('0x74'),_0x2ed8('0x75'));}this['channels'][_0x386c78]['monitorFilename']=_0x543231;var _0x2bd1b4=_[_0x2ed8('0x76')](this[_0x2ed8('0x17')][_0x386c78][_0x2ed8('0x77')],{'filename':_0x543231});if(_[_0x2ed8('0x65')](_0x2bd1b4)){this[_0x2ed8('0x17')][_0x386c78][_0x2ed8('0x77')][_0x2ed8('0x78')]({'filename':_0x543231,'createdAt':moment()[_0x2ed8('0x4b')](_0x2ed8('0x4c')),'mixmonitorid':'','status':'rec'});}}}catch(_0x5b0ea5){logger[_0x2ed8('0x2a')](_0x2ed8('0x79'),_0x386c78,util[_0x2ed8('0x2c')](_0x5b0ea5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2ed8('0x2d')][_0x2ed8('0x20')]=function(_0x282b28){try{if(this[_0x2ed8('0x2e')](_0x282b28)){logger[_0x2ed8('0x35')](_0x2ed8('0x7a'),_0x282b28[_0x2ed8('0x32')],util['inspect'](_0x282b28,{'showHidden':![],'depth':null}));if(this['channels'][_0x282b28[_0x2ed8('0x32')]]&&_0x282b28[_0x2ed8('0x3e')]!=_0x2ed8('0x47')){if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')])){if(this[_0x2ed8('0x2e')](_0x282b28['variable']['mixmonitor_filename'])){logger['info'](_0x2ed8('0x7c'),_0x282b28[_0x2ed8('0x32')],_0x282b28[_0x2ed8('0x7d')]);this['syncMixMonitorFilename'](_0x282b28[_0x2ed8('0x32')],_0x282b28[_0x2ed8('0x7d')]);}else if(this['isNotNull'](_0x282b28[_0x2ed8('0x7b')][_0x2ed8('0x7e')])){logger[_0x2ed8('0x30')](_0x2ed8('0x7f'),_0x282b28[_0x2ed8('0x32')],_0x282b28['value']);this[_0x2ed8('0x17')][_0x282b28[_0x2ed8('0x32')]][_0x2ed8('0x34')]=_0x282b28[_0x2ed8('0x7d')];}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')][_0x2ed8('0x80')])){logger['info'](_0x2ed8('0x81'),_0x282b28[_0x2ed8('0x32')],_0x282b28['value']);this['channels'][_0x282b28['uniqueid']]['callerid']=_0x282b28[_0x2ed8('0x7d')];}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')][_0x2ed8('0x82')])){logger['info'](_0x2ed8('0x83'),_0x282b28['uniqueid'],_0x282b28[_0x2ed8('0x7d')]);this[_0x2ed8('0x17')][_0x282b28['uniqueid']][_0x2ed8('0x64')]=_0x282b28[_0x2ed8('0x7d')];}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')]['xmd-queue'])){logger[_0x2ed8('0x30')](_0x2ed8('0x84'),_0x282b28[_0x2ed8('0x32')],_0x282b28[_0x2ed8('0x7d')][_0x2ed8('0x3f')](',')[0x0]);this[_0x2ed8('0x17')][_0x282b28[_0x2ed8('0x32')]]['queue']=_0x282b28[_0x2ed8('0x7d')][_0x2ed8('0x3f')](',')[0x0];}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')][_0x2ed8('0x85')])){logger[_0x2ed8('0x30')](_0x2ed8('0x86'),_0x282b28['uniqueid'],_0x282b28['value']);this[_0x2ed8('0x17')][_0x282b28['uniqueid']]['originatecalleridnum']=_0x282b28[_0x2ed8('0x7d')];}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')][_0x2ed8('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x282b28['uniqueid'],_0x282b28[_0x2ed8('0x7d')]);this[_0x2ed8('0x17')][_0x282b28[_0x2ed8('0x32')]][_0x2ed8('0x88')]=_0x282b28[_0x2ed8('0x7d')];}else if(this['isNotNull'](_0x282b28['variable'][_0x2ed8('0x89')])){logger[_0x2ed8('0x30')](_0x2ed8('0x8a'),_0x282b28[_0x2ed8('0x32')],_0x282b28[_0x2ed8('0x7d')]);this[_0x2ed8('0x17')][_0x282b28[_0x2ed8('0x32')]][_0x2ed8('0x8b')]=_0x282b28['value'];}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')][_0x2ed8('0x8c')])){logger[_0x2ed8('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x282b28[_0x2ed8('0x32')],_0x282b28['value']);this['channels'][_0x282b28[_0x2ed8('0x32')]]['queue']=_0x282b28[_0x2ed8('0x7d')];}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')][_0x2ed8('0x8d')])){logger[_0x2ed8('0x30')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x282b28[_0x2ed8('0x32')],_0x282b28[_0x2ed8('0x7d')]);this[_0x2ed8('0x17')][_0x282b28[_0x2ed8('0x32')]][_0x2ed8('0x8e')]=_0x282b28['value'];}}}else if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')]['mixmonitor_filename'])){if(_0x282b28[_0x2ed8('0x7d')]){var _0xa7b647=path[_0x2ed8('0x8f')](_0x282b28['value'])['name'];logger[_0x2ed8('0x30')](_0x2ed8('0x7c'),_0xa7b647,_0x282b28[_0x2ed8('0x7d')]);this[_0x2ed8('0x72')](_0xa7b647,_0x282b28['value']);}}else if(this[_0x2ed8('0x17')][_0x282b28[_0x2ed8('0x37')]]){if(this[_0x2ed8('0x2e')](_0x282b28[_0x2ed8('0x7b')])){if(this[_0x2ed8('0x2e')](_0x282b28['variable'][_0x2ed8('0x8d')])){logger['info'](_0x2ed8('0x90'),_0x282b28['linkedid'],_0x282b28['value']);this[_0x2ed8('0x17')][_0x282b28['linkedid']]['sipcalllinkedid']=_0x282b28[_0x2ed8('0x7d')];}}}}}catch(_0x19483a){logger[_0x2ed8('0x2a')](_0x2ed8('0x91'),_0x282b28[_0x2ed8('0x32')],util[_0x2ed8('0x2c')](_0x19483a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2ed8('0x2d')][_0x2ed8('0x21')]=function(_0x361d11){try{if(this[_0x2ed8('0x2e')](_0x361d11)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x361d11[_0x2ed8('0x32')],util['inspect'](_0x361d11,{'showHidden':![],'depth':null}));if(this[_0x2ed8('0x48')][_0x361d11['linkedid']]){if(this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]]['linkedid']]){this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11['linkedid']][_0x2ed8('0x37')]][_0x2ed8('0x32')]=_0x361d11[_0x2ed8('0x32')];this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11['linkedid']][_0x2ed8('0x37')]]['answered']=this[_0x2ed8('0x17')][_0x361d11[_0x2ed8('0x32')]]['answered'];this['channels'][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x37')]]['answertime']=this['channels'][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x92')];this['channels'][this['blindTransfers'][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x37')]][_0x2ed8('0x6e')]=this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x37')]][_0x2ed8('0x3e')];this[_0x2ed8('0x17')][this['blindTransfers'][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x37')]]['disposition']=this['channels'][_0x361d11['uniqueid']]['disposition'];this[_0x2ed8('0x17')][_0x361d11[_0x2ed8('0x32')]]=this[_0x2ed8('0x17')][this['blindTransfers'][_0x361d11[_0x2ed8('0x37')]]['linkedid']];delete this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x37')]];}else if(this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]]['uniqueid']]){this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x32')]]['uniqueid']=[this[_0x2ed8('0x17')][this['blindTransfers'][_0x361d11['linkedid']][_0x2ed8('0x32')]][_0x2ed8('0x37')],this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11['linkedid']][_0x2ed8('0x32')]][_0x2ed8('0x37')]=this[_0x2ed8('0x17')][this['blindTransfers'][_0x361d11['linkedid']][_0x2ed8('0x32')]][_0x2ed8('0x32')]][0x0];this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]]['uniqueid']][_0x2ed8('0x69')]=this[_0x2ed8('0x17')][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x69')];this['channels'][this[_0x2ed8('0x48')][_0x361d11['linkedid']][_0x2ed8('0x32')]][_0x2ed8('0x92')]=this[_0x2ed8('0x17')][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x92')];this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x32')]][_0x2ed8('0x6e')]=this['channels'][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x32')]][_0x2ed8('0x3e')];this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]][_0x2ed8('0x32')]]['disposition']=this[_0x2ed8('0x17')][_0x361d11['uniqueid']]['disposition'];this[_0x2ed8('0x17')][_0x361d11[_0x2ed8('0x32')]]=this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11['linkedid']]['uniqueid']];delete this[_0x2ed8('0x17')][this[_0x2ed8('0x48')][_0x361d11[_0x2ed8('0x37')]]['uniqueid']];}}if(this['channels'][_0x361d11[_0x2ed8('0x32')]]){logger[_0x2ed8('0x30')](_0x2ed8('0x93'),_0x361d11['uniqueid'],_0x361d11['cause-txt']);var _0x2ffa00=moment();this['channels'][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x94')]=_0x2ffa00[_0x2ed8('0x4b')](_0x2ed8('0x4c'));this[_0x2ed8('0x17')][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x5c')]=_0x2ffa00[_0x2ed8('0x6b')](this['channels'][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x4a')],_0x2ed8('0x5d'));if(this['channels'][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x69')]){this['channels'][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x95')]=_0x2ffa00[_0x2ed8('0x6b')](this['channels'][_0x361d11['uniqueid']][_0x2ed8('0x92')],'seconds');this[_0x2ed8('0x17')][_0x361d11[_0x2ed8('0x32')]]['holdtime']=this[_0x2ed8('0x17')][_0x361d11['uniqueid']]['duration']-this['channels'][_0x361d11[_0x2ed8('0x32')]][_0x2ed8('0x95')];}if(_0x361d11[_0x2ed8('0x3c')]===_0x2ed8('0x3d')){if(this[_0x2ed8('0x18')][_0x361d11[_0x2ed8('0x3e')][_0x2ed8('0x3f')]('-')[0x0]]){this['agents'][_0x361d11['channel'][_0x2ed8('0x3f')]('-')[0x0]]=_[_0x2ed8('0x96')](this[_0x2ed8('0x18')][_0x361d11['channel'][_0x2ed8('0x3f')]('-')[0x0]],[_0x2ed8('0x42')]);logger['debug'](_0x2ed8('0x97'),_0x361d11[_0x2ed8('0x32')],util['inspect']({'id':this[_0x2ed8('0x18')][_0x361d11['channel'][_0x2ed8('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x2ed8('0x18')][_0x361d11[_0x2ed8('0x3e')][_0x2ed8('0x3f')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x2ed8('0x2f')](util[_0x2ed8('0x4b')]('user:%s',this[_0x2ed8('0x18')][_0x361d11[_0x2ed8('0x3e')]['split']('-')[0x0]][_0x2ed8('0x43')]),_0x2ed8('0x98'),{'id':this[_0x2ed8('0x18')][_0x361d11[_0x2ed8('0x3e')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x2ed8('0x18')][_0x361d11[_0x2ed8('0x3e')][_0x2ed8('0x3f')]('-')[0x0]][_0x2ed8('0x44')]});for(var _0x24e162=0x0;_0x24e1620x0?!![]:![];if(!_0x15ba94){return this[_0xe16e('0x66')](this[_0xe16e('0x18')]['completeEvent']);}};VoiceQueueReport['prototype']['syncQueueMember']=function(_0x574a2b){var _0x297c61=this[_0xe16e('0x18')]['id'];if(this[_0xe16e('0x18')][_0xe16e('0x5d')][_0x297c61]&&this[_0xe16e('0x18')][_0xe16e('0x5d')][_0x297c61][_0x574a2b['actionid']]){this[_0xe16e('0x18')][_0xe16e('0x5d')][_0x297c61][_0x574a2b['actionid']][_0xe16e('0x14')][_0xe16e('0x67')](_0x574a2b);}};VoiceQueueReport['prototype'][_0xe16e('0x1a')]=function(_0x104ec4){var _0x2799dc=this;try{if(this[_0xe16e('0x56')](_0x104ec4)&&this[_0xe16e('0x56')](_0x104ec4[_0xe16e('0x48')])){logger[_0xe16e('0x43')](_0xe16e('0x68'),util[_0xe16e('0x3a')](_0x104ec4,{'showHidden':![],'depth':null}));var _0x1fc873=this['voiceQueues'][_0x104ec4['queue']];if(_0x1fc873){logger[_0xe16e('0x43')](_0xe16e('0x69'),_0x1fc873[_0xe16e('0x54')]);this[_0xe16e('0x18')][_0xe16e('0x59')][_0x1fc873[_0xe16e('0x54')]]={'summaryEvent':_0x104ec4};this[_0xe16e('0x18')][_0xe16e('0x65')]+=0x1;return ami[_0xe16e('0x5b')]({'action':_0xe16e('0x5d'),'queue':_0x1fc873['name']})['then'](function(_0x2b9e34){if(!_0x2799dc[_0xe16e('0x18')][_0xe16e('0x5d')][_0x104ec4[_0xe16e('0x5e')]]){_0x2799dc[_0xe16e('0x18')]['queuestatus'][_0x104ec4[_0xe16e('0x5e')]]={};}_0x2799dc[_0xe16e('0x18')][_0xe16e('0x5d')][_0x104ec4[_0xe16e('0x5e')]][_0x2b9e34['actionid']]={'queue':_0x1fc873[_0xe16e('0x54')],'agents':[]};})[_0xe16e('0x36')](function(_0xb5ea77){throw _0xb5ea77;});}}}catch(_0x52df24){logger[_0xe16e('0x39')](_0xe16e('0x5f'),util[_0xe16e('0x3a')](_0x52df24,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe16e('0xd')][_0xe16e('0x66')]=function(_0xb9c3bc){if(this['summary'][_0xe16e('0x65')]>0x0){this[_0xe16e('0x18')]['completeEvent']=_0xb9c3bc;return;}logger[_0xe16e('0x43')](_0xe16e('0x6a'),util[_0xe16e('0x3a')](_0xb9c3bc,{'showHidden':![],'depth':null}));this[_0xe16e('0x18')]=initializeSummary();ami[_0xe16e('0x42')](_0xe16e('0x6b'),{});};VoiceQueueReport[_0xe16e('0xd')][_0xe16e('0x1e')]=function(_0x3140b6){try{if(this['isNotNull'](_0x3140b6)){logger['debug'](_0xe16e('0x6c'),_0x3140b6[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x3140b6,{'showHidden':![],'depth':null}));if(_[_0xe16e('0x57')](this[_0xe16e('0x12')][_0x3140b6[_0xe16e('0x4b')]])){this[_0xe16e('0x12')][_0x3140b6[_0xe16e('0x4b')]]=[];}if(_[_0xe16e('0x57')](this[_0xe16e('0x15')][_0x3140b6['uniqueid']])){this[_0xe16e('0x15')][_0x3140b6[_0xe16e('0x4b')]]={};}var _0x23cf02=new QueueReport();_0x23cf02[_0xe16e('0x48')]=_0x3140b6[_0xe16e('0x48')];_0x23cf02['type']=this[_0xe16e('0x16')][_0x23cf02['queue']]&&this[_0xe16e('0x16')][_0x23cf02[_0xe16e('0x48')]][_0xe16e('0x51')]?this[_0xe16e('0x16')][_0x23cf02[_0xe16e('0x48')]][_0xe16e('0x51')]||_0xe16e('0x52'):'inbound';_0x23cf02['queuecallerjoinAt']=moment()[_0xe16e('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x23cf02['position']=_0x3140b6[_0xe16e('0x6d')];_0x23cf02[_0xe16e('0x6e')]=_0x3140b6['count'];_0x23cf02[_0xe16e('0x4b')]=_0x3140b6[_0xe16e('0x4b')];_0x23cf02[_0xe16e('0x6f')]=this[_0xe16e('0x15')][_0x3140b6['uniqueid']][_0xe16e('0x6f')];logger[_0xe16e('0x70')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x23cf02[_0xe16e('0x48')],_0x23cf02['type']);Object[_0xe16e('0x71')](_0x23cf02,_[_0xe16e('0x72')](_0x3140b6,_[_0xe16e('0x73')](_0x23cf02)));this[_0xe16e('0x12')][_0x3140b6[_0xe16e('0x4b')]]['push'](_0x23cf02);this['channels'][_0x3140b6[_0xe16e('0x4b')]]=_0x23cf02;this[_0xe16e('0x74')](_0x23cf02,'queuecallerjoin');}}catch(_0x5dd4e9){logger['error'](_0xe16e('0x6c'),_0x3140b6['uniqueid'],util['inspect'](_0x5dd4e9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe16e('0xd')][_0xe16e('0x75')]=function(_0x206d59){try{if(this[_0xe16e('0x56')](_0x206d59)){logger[_0xe16e('0x43')](_0xe16e('0x76'),_0x206d59[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x206d59,{'showHidden':![],'depth':null}));if(this[_0xe16e('0x12')][_0x206d59[_0xe16e('0x4b')]]){var _0x203933=_[_0xe16e('0x77')](this[_0xe16e('0x12')][_0x206d59['uniqueid']]);_0x203933['queuecallercomplete']=![];_0x203933[_0xe16e('0x78')]=null;_0x203933[_0xe16e('0x79')]=_0x206d59[_0xe16e('0x79')];_0x203933[_0xe16e('0x7a')]=_0x206d59[_0xe16e('0x7a')];_0x203933[_0xe16e('0x1f')]=!![];_0x203933['queuecallerabandonAt']=moment()['format'](_0xe16e('0x7b'));_0x203933[_0xe16e('0x4c')]='ABANDONED';_0x203933[_0xe16e('0x7c')]=null;logger[_0xe16e('0x70')](_0xe16e('0x7d'),_0x203933[_0xe16e('0x48')],_0x203933[_0xe16e('0x51')]);this[_0xe16e('0x15')][_0x206d59['uniqueid']]=_0x203933;this['emitVoiceQueueChannelRemove'](_0x203933,_0xe16e('0x1f'));}}}catch(_0x3fd65e){logger[_0xe16e('0x39')](_0xe16e('0x76'),_0x206d59['uniqueid'],util[_0xe16e('0x3a')](_0x3fd65e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe16e('0x20')]=function(_0x186a4f){try{if(this[_0xe16e('0x56')](_0x186a4f)){logger['debug'](_0xe16e('0x7e'),_0x186a4f[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x186a4f,{'showHidden':![],'depth':null}));if(this[_0xe16e('0x12')][_0x186a4f[_0xe16e('0x4b')]]){var _0x4737fa=_['last'](this['queueReports'][_0x186a4f[_0xe16e('0x4b')]]);_0x4737fa[_0xe16e('0x7f')]=moment()[_0xe16e('0x46')](_0xe16e('0x7b'));_0x4737fa[_0xe16e('0x80')]=_0x186a4f[_0xe16e('0x80')];_0x4737fa[_0xe16e('0x81')]=_0x186a4f['connectedlinename'];logger[_0xe16e('0x70')](_0xe16e('0x82'),_0x4737fa[_0xe16e('0x48')],_0x4737fa[_0xe16e('0x51')],_0x186a4f['connectedlinenum'],_0x186a4f['connectedlinename']);this[_0xe16e('0x15')][_0x186a4f[_0xe16e('0x4b')]]=_0x4737fa;this[_0xe16e('0x74')](_0x4737fa,_0xe16e('0x83'));}}}catch(_0x290544){logger[_0xe16e('0x39')](_0xe16e('0x7e'),_0x186a4f['uniqueid'],util['inspect'](_0x290544,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe16e('0xd')][_0xe16e('0x84')]=function(_0x27e3b5){try{if(this[_0xe16e('0x56')](_0x27e3b5)){logger[_0xe16e('0x43')](_0xe16e('0x85'),_0x27e3b5[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x27e3b5,{'showHidden':![],'depth':null}));if(this[_0xe16e('0x12')][_0x27e3b5[_0xe16e('0x4b')]]){var _0x333501=_[_0xe16e('0x77')](this[_0xe16e('0x12')][_0x27e3b5['uniqueid']]);_0x333501[_0xe16e('0x33')]=!![];_0x333501['queuecallerexitreason']=_0xe16e('0x86');logger['info'](_0xe16e('0x87'),_0x333501[_0xe16e('0x48')],_0x333501[_0xe16e('0x51')]);}}}catch(_0x5a0a80){logger[_0xe16e('0x39')](_0xe16e('0x85'),_0x27e3b5['uniqueid'],util[_0xe16e('0x3a')](_0x5a0a80,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe16e('0x88')]=function(_0x5f1e6f){try{if(this['isNotNull'](_0x5f1e6f)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x5f1e6f[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x5f1e6f,{'showHidden':![],'depth':null}));if(this[_0xe16e('0x12')][_0x5f1e6f[_0xe16e('0x4b')]]){var _0x13f37=_['last'](this[_0xe16e('0x12')][_0x5f1e6f[_0xe16e('0x4b')]]);_0x13f37['queuecallerabandon']=![];_0x13f37[_0xe16e('0x89')]=null;_0x13f37[_0xe16e('0x8a')]=!![];_0x13f37[_0xe16e('0x7c')]=_0x5f1e6f[_0xe16e('0x8b')];_0x13f37['holdtime']=_0x5f1e6f[_0xe16e('0x79')];_0x13f37[_0xe16e('0x33')]=!![];_0x13f37[_0xe16e('0x32')]=![];_0x13f37[_0xe16e('0x8c')]=null;if(!_0x13f37[_0xe16e('0x8d')]){if(_0x5f1e6f['reason']==_0xe16e('0x8d')){_0x13f37[_0xe16e('0x4c')]=_0xe16e('0x8e');logger['info'](_0xe16e('0x8f'),_0x13f37[_0xe16e('0x48')],_0x13f37[_0xe16e('0x51')]);}else{if(_[_0xe16e('0x90')](_0x5f1e6f['channel'][_0xe16e('0x91')](),_0xe16e('0x92'))){if(this[_0xe16e('0x12')][_0x5f1e6f['linkedid']]){var _0x27f401=_[_0xe16e('0x77')](this['queueReports'][_0x5f1e6f[_0xe16e('0x93')]]);_0x27f401[_0xe16e('0x33')]=![];_0x27f401['queuecallerexit']=!![];_0x27f401[_0xe16e('0x8c')]=moment(_0x13f37[_0xe16e('0x94')])[_0xe16e('0x95')](_0x5f1e6f[_0xe16e('0x79')],'seconds')[_0xe16e('0x46')](_0xe16e('0x7b'));_0x27f401['queuecallerexitreason']=_0xe16e('0x96');_0x27f401[_0xe16e('0x8d')]=!![];_0x27f401[_0xe16e('0x97')]='FORWARD';_0x27f401[_0xe16e('0x98')]=_0x5f1e6f[_0xe16e('0x99')];_0x27f401['transferuniqueid']=_0x5f1e6f[_0xe16e('0x4b')];logger[_0xe16e('0x70')](_0xe16e('0x9a'),_0x27f401['queue'],_0x27f401[_0xe16e('0x51')]);var _0x1eae90=this[_0xe16e('0x12')][_0x5f1e6f[_0xe16e('0x93')]];this['queueReports'][_0x5f1e6f['linkedid']]=this[_0xe16e('0x12')][_0x5f1e6f[_0xe16e('0x4b')]];this[_0xe16e('0x12')][_0x5f1e6f['uniqueid']]=_0x1eae90;}}else{_0x13f37[_0xe16e('0x4c')]='COMPLETEDBY'+_0x5f1e6f[_0xe16e('0x9b')][_0xe16e('0x9c')]();logger['info'](_0xe16e('0x9d'),_0x13f37[_0xe16e('0x48')],_0x13f37[_0xe16e('0x51')],_0x13f37[_0xe16e('0x4c')]);}}}this[_0xe16e('0x15')][_0x5f1e6f[_0xe16e('0x4b')]]=_0x13f37;}}}catch(_0x58b307){logger['error'](_0xe16e('0x9e'),_0x5f1e6f[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x58b307,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe16e('0xd')][_0xe16e('0x22')]=function(_0x2a4ea4){try{if(this[_0xe16e('0x56')](_0x2a4ea4)){logger[_0xe16e('0x43')]('[%s][voiceQueueReport][varset]',_0x2a4ea4[_0xe16e('0x4b')],util['inspect'](_0x2a4ea4,{'showHidden':![],'depth':null}));this[_0xe16e('0x9f')](_0x2a4ea4[_0xe16e('0x4b')],_[_0xe16e('0x73')](_0x2a4ea4[_0xe16e('0xa0')])[0x0],_0x2a4ea4['value']);if(this[_0xe16e('0x12')][_0x2a4ea4[_0xe16e('0x4b')]]){var _0x554aed=_[_0xe16e('0x77')](this['queueReports'][_0x2a4ea4[_0xe16e('0x4b')]]);if(_0x554aed){if(this[_0xe16e('0x56')](_0x2a4ea4[_0xe16e('0xa0')])&&this[_0xe16e('0x56')](_0x2a4ea4['variable'][_0xe16e('0x5d')])){switch(_0x2a4ea4[_0xe16e('0xa1')]){case _0xe16e('0xa2'):_0x554aed[_0xe16e('0x32')]=![];_0x554aed[_0xe16e('0x8c')]=null;break;case _0xe16e('0xa3'):_0x554aed[_0xe16e('0xa4')]=_0xe16e('0xa5');_0x554aed[_0xe16e('0x32')]=!![];_0x554aed[_0xe16e('0x8c')]=moment()[_0xe16e('0x46')](_0xe16e('0x7b'));_0x554aed[_0xe16e('0x7f')]=moment()[_0xe16e('0x46')](_0xe16e('0x7b'));logger[_0xe16e('0x43')](_0xe16e('0xa6'),_0x2a4ea4[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x554aed,{'showHidden':![],'depth':null}));ami['emit'](_0xe16e('0xa7'),_0x554aed);break;default:_0x554aed[_0xe16e('0x32')]=!![];_0x554aed[_0xe16e('0x8c')]=moment()[_0xe16e('0x46')](_0xe16e('0x7b'));_0x554aed[_0xe16e('0x7f')]=moment()['format'](_0xe16e('0x7b'));}_0x554aed['queuecallerabandon']=![];_0x554aed[_0xe16e('0x89')]=null;_0x554aed['queuecallerexitreason']=_0x2a4ea4['value'];this[_0xe16e('0x15')][_0x2a4ea4['uniqueid']]=_0x554aed;this[_0xe16e('0x40')](_0x554aed,_0xe16e('0x21'));}else if(this['isNotNull'](_0x2a4ea4['variable'])&&this[_0xe16e('0x56')](_0x2a4ea4[_0xe16e('0xa0')][_0xe16e('0xa8')])){if(!_0x554aed[_0xe16e('0x1f')]){_0x554aed[_0xe16e('0x32')]=!![];_0x554aed[_0xe16e('0x8c')]=moment()[_0xe16e('0x46')](_0xe16e('0x7b'));_0x554aed[_0xe16e('0x4c')]=_0xe16e('0xa9');_0x554aed[_0xe16e('0x7f')]=moment()[_0xe16e('0x46')](_0xe16e('0x7b'));this[_0xe16e('0x15')][_0x2a4ea4[_0xe16e('0x4b')]]=_0x554aed;}}logger[_0xe16e('0x70')](_0xe16e('0xaa'),_0x2a4ea4[_0xe16e('0x4b')],_0x554aed['queue'],_0x554aed['type'],_[_0xe16e('0x73')](_0x2a4ea4[_0xe16e('0xa0')])[0x0],_0x2a4ea4[_0xe16e('0xa1')]);_0x554aed['variables']=this['variables'][_0x2a4ea4['uniqueid']];}}}}catch(_0x139023){logger[_0xe16e('0x39')](_0xe16e('0xab'),_0x2a4ea4[_0xe16e('0x4b')],util[_0xe16e('0x3a')](_0x139023,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe16e('0xd')][_0xe16e('0x9f')]=function(_0x9b9c71,_0x4a084a,_0x408b40){var _0x52e27c=[_0xe16e('0xac'),_0xe16e('0xad'),_0xe16e('0xae'),'rtpaudioqosjitterbridged',_0xe16e('0xaf'),_0xe16e('0xb0'),_0xe16e('0xb1'),_0xe16e('0xb2'),_0xe16e('0xb3'),_0xe16e('0xb4'),_0xe16e('0xb5'),_0xe16e('0xb6'),_0xe16e('0xb7'),_0xe16e('0xb8'),_0xe16e('0xb9'),_0xe16e('0xba'),_0xe16e('0x8b'),_0xe16e('0xbb'),_0xe16e('0xbc')];if(!_[_0xe16e('0xbd')](_0x4a084a)&&!_[_0xe16e('0xbe')](_0x52e27c,_0x4a084a)){if(_[_0xe16e('0x57')](this['variables'][_0x9b9c71])){this[_0xe16e('0x3b')][_0x9b9c71]={};}this[_0xe16e('0x3b')][_0x9b9c71][_0x4a084a]=_0x408b40;}};VoiceQueueReport['prototype'][_0xe16e('0xbf')]=function(_0x1e5dcc,_0x7ca80e,_0x40b056){try{var _0x4a931d={};if(this[_0xe16e('0x12')][_0x1e5dcc]){for(var _0x304c35=0x0;_0x304c350x0?!![]:![];if(!_0x3e3e90){return this['syncQueueSummaryComplete'](this['summary'][_0xd8d6('0x67')]);}};VoiceQueueReport[_0xd8d6('0xa')]['syncQueueMember']=function(_0x7562c2){var _0x220378=this[_0xd8d6('0x15')]['id'];if(this[_0xd8d6('0x15')][_0xd8d6('0x5e')][_0x220378]&&this[_0xd8d6('0x15')][_0xd8d6('0x5e')][_0x220378][_0x7562c2[_0xd8d6('0x5d')]]){this[_0xd8d6('0x15')][_0xd8d6('0x5e')][_0x220378][_0x7562c2[_0xd8d6('0x5d')]]['agents']['push'](_0x7562c2);}};VoiceQueueReport[_0xd8d6('0xa')]['syncQueueSummary']=function(_0x188816){var _0x5e8fd2=this;try{if(this[_0xd8d6('0x68')](_0x188816)&&this['isNotNull'](_0x188816[_0xd8d6('0x4d')])){logger[_0xd8d6('0x48')](_0xd8d6('0x69'),util[_0xd8d6('0x3f')](_0x188816,{'showHidden':![],'depth':null}));var _0x3f8db8=this[_0xd8d6('0x13')][_0x188816[_0xd8d6('0x4d')]];if(_0x3f8db8){logger[_0xd8d6('0x48')](_0xd8d6('0x6a'),_0x3f8db8[_0xd8d6('0x56')]);this[_0xd8d6('0x15')][_0xd8d6('0x58')][_0x3f8db8[_0xd8d6('0x56')]]={'summaryEvent':_0x188816};this[_0xd8d6('0x15')][_0xd8d6('0x6b')]+=0x1;return ami[_0xd8d6('0x39')]({'action':_0xd8d6('0x5e'),'queue':_0x3f8db8['name']})[_0xd8d6('0x5c')](function(_0x28fb37){if(!_0x5e8fd2['summary']['queuestatus'][_0x188816[_0xd8d6('0x5d')]]){_0x5e8fd2[_0xd8d6('0x15')][_0xd8d6('0x5e')][_0x188816[_0xd8d6('0x5d')]]={};}_0x5e8fd2['summary'][_0xd8d6('0x5e')][_0x188816[_0xd8d6('0x5d')]][_0x28fb37[_0xd8d6('0x5d')]]={'queue':_0x3f8db8[_0xd8d6('0x56')],'agents':[]};})[_0xd8d6('0x3c')](function(_0x2a70b4){throw _0x2a70b4;});}}}catch(_0x4a0db5){logger[_0xd8d6('0x40')](_0xd8d6('0x5f'),util['inspect'](_0x4a0db5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8d6('0xa')][_0xd8d6('0x1a')]=function(_0x464863){if(this['summary']['statusRequests']>0x0){this[_0xd8d6('0x15')][_0xd8d6('0x67')]=_0x464863;return;}logger[_0xd8d6('0x48')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xd8d6('0x3f')](_0x464863,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0xd8d6('0x46')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xd8d6('0xa')]['syncQueueCallerJoin']=function(_0x1f4e50){try{if(this[_0xd8d6('0x68')](_0x1f4e50)){logger[_0xd8d6('0x48')](_0xd8d6('0x6c'),_0x1f4e50['uniqueid'],util[_0xd8d6('0x3f')](_0x1f4e50,{'showHidden':![],'depth':null}));if(_[_0xd8d6('0x6d')](this[_0xd8d6('0xe')][_0x1f4e50[_0xd8d6('0x4a')]])){this[_0xd8d6('0xe')][_0x1f4e50[_0xd8d6('0x4a')]]=[];}if(_[_0xd8d6('0x6d')](this[_0xd8d6('0x11')][_0x1f4e50[_0xd8d6('0x4a')]])){this[_0xd8d6('0x11')][_0x1f4e50[_0xd8d6('0x4a')]]={};}var _0x75e45c=new QueueReport();_0x75e45c[_0xd8d6('0x4d')]=_0x1f4e50[_0xd8d6('0x4d')];_0x75e45c[_0xd8d6('0x53')]=this['voiceQueues'][_0x75e45c[_0xd8d6('0x4d')]]&&this['voiceQueues'][_0x75e45c[_0xd8d6('0x4d')]][_0xd8d6('0x53')]?this[_0xd8d6('0x13')][_0x75e45c['queue']][_0xd8d6('0x53')]||'inbound':_0xd8d6('0x54');_0x75e45c[_0xd8d6('0x6e')]=moment()[_0xd8d6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x75e45c[_0xd8d6('0x6f')]=_0x1f4e50['position'];_0x75e45c[_0xd8d6('0x70')]=_0x1f4e50[_0xd8d6('0x70')];_0x75e45c[_0xd8d6('0x4a')]=_0x1f4e50['uniqueid'];_0x75e45c[_0xd8d6('0x71')]=this['channels'][_0x1f4e50['uniqueid']][_0xd8d6('0x71')];logger['info'](_0xd8d6('0x72'),_0x75e45c['queue'],_0x75e45c[_0xd8d6('0x53')]);Object[_0xd8d6('0x73')](_0x75e45c,_[_0xd8d6('0x74')](_0x1f4e50,_[_0xd8d6('0x75')](_0x75e45c)));this[_0xd8d6('0xe')][_0x1f4e50[_0xd8d6('0x4a')]][_0xd8d6('0x76')](_0x75e45c);this[_0xd8d6('0x11')][_0x1f4e50['uniqueid']]=_0x75e45c;this[_0xd8d6('0x47')](_0x75e45c,_0xd8d6('0x1e'));}}catch(_0x54c89a){logger[_0xd8d6('0x40')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1f4e50[_0xd8d6('0x4a')],util[_0xd8d6('0x3f')](_0x54c89a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8d6('0xa')][_0xd8d6('0x77')]=function(_0x506f20){try{if(this[_0xd8d6('0x68')](_0x506f20)){logger[_0xd8d6('0x48')](_0xd8d6('0x78'),_0x506f20['uniqueid'],util[_0xd8d6('0x3f')](_0x506f20,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x506f20[_0xd8d6('0x4a')]]){var _0x4486a0=_[_0xd8d6('0x79')](this[_0xd8d6('0xe')][_0x506f20[_0xd8d6('0x4a')]]);_0x4486a0[_0xd8d6('0x36')]=![];_0x4486a0[_0xd8d6('0x7a')]=null;_0x4486a0[_0xd8d6('0x7b')]=_0x506f20[_0xd8d6('0x7b')];_0x4486a0[_0xd8d6('0x7c')]=_0x506f20[_0xd8d6('0x7c')];_0x4486a0[_0xd8d6('0x1f')]=!![];_0x4486a0['queuecallerabandonAt']=moment()['format'](_0xd8d6('0x7d'));_0x4486a0[_0xd8d6('0x7e')]=_0xd8d6('0x7f');_0x4486a0[_0xd8d6('0x80')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4486a0[_0xd8d6('0x4d')],_0x4486a0['type']);this['channels'][_0x506f20['uniqueid']]=_0x4486a0;this['emitVoiceQueueChannelRemove'](_0x4486a0,_0xd8d6('0x1f'));}}}catch(_0x19d11b){logger['error'](_0xd8d6('0x78'),_0x506f20['uniqueid'],util[_0xd8d6('0x3f')](_0x19d11b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8d6('0xa')][_0xd8d6('0x81')]=function(_0x5dfa26){try{if(this['isNotNull'](_0x5dfa26)){logger['debug'](_0xd8d6('0x82'),_0x5dfa26[_0xd8d6('0x4a')],util[_0xd8d6('0x3f')](_0x5dfa26,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5dfa26[_0xd8d6('0x4a')]]){var _0x58a88b=_[_0xd8d6('0x79')](this[_0xd8d6('0xe')][_0x5dfa26[_0xd8d6('0x4a')]]);_0x58a88b[_0xd8d6('0x83')]=moment()[_0xd8d6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x58a88b['connectedlinenum']=_0x5dfa26[_0xd8d6('0x84')];_0x58a88b[_0xd8d6('0x85')]=_0x5dfa26[_0xd8d6('0x85')];logger[_0xd8d6('0x86')](_0xd8d6('0x87'),_0x58a88b['queue'],_0x58a88b['type'],_0x5dfa26[_0xd8d6('0x84')],_0x5dfa26[_0xd8d6('0x85')]);this[_0xd8d6('0x11')][_0x5dfa26[_0xd8d6('0x4a')]]=_0x58a88b;this[_0xd8d6('0x47')](_0x58a88b,_0xd8d6('0x20'));}}}catch(_0x14e146){logger[_0xd8d6('0x40')]('[%s][voiceQueueReport][queuecallerleave]',_0x5dfa26[_0xd8d6('0x4a')],util[_0xd8d6('0x3f')](_0x14e146,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8d6('0xa')][_0xd8d6('0x88')]=function(_0x268a97){try{if(this[_0xd8d6('0x68')](_0x268a97)){logger[_0xd8d6('0x48')](_0xd8d6('0x89'),_0x268a97['uniqueid'],util[_0xd8d6('0x3f')](_0x268a97,{'showHidden':![],'depth':null}));if(this[_0xd8d6('0xe')][_0x268a97[_0xd8d6('0x4a')]]){var _0x23c182=_[_0xd8d6('0x79')](this[_0xd8d6('0xe')][_0x268a97[_0xd8d6('0x4a')]]);_0x23c182['queuecallercomplete']=!![];_0x23c182[_0xd8d6('0x7e')]=_0xd8d6('0x8a');logger[_0xd8d6('0x86')](_0xd8d6('0x8b'),_0x23c182[_0xd8d6('0x4d')],_0x23c182['type']);}}}catch(_0xbbf04c){logger[_0xd8d6('0x40')](_0xd8d6('0x89'),_0x268a97[_0xd8d6('0x4a')],util[_0xd8d6('0x3f')](_0xbbf04c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8d6('0xa')]['syncAgentComplete']=function(_0x400b1b){try{if(this['isNotNull'](_0x400b1b)){logger[_0xd8d6('0x48')](_0xd8d6('0x8c'),_0x400b1b[_0xd8d6('0x4a')],util[_0xd8d6('0x3f')](_0x400b1b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x400b1b[_0xd8d6('0x4a')]]){var _0x52f69c=_[_0xd8d6('0x79')](this[_0xd8d6('0xe')][_0x400b1b[_0xd8d6('0x4a')]]);_0x52f69c[_0xd8d6('0x1f')]=![];_0x52f69c[_0xd8d6('0x8d')]=null;_0x52f69c[_0xd8d6('0x8e')]=!![];_0x52f69c[_0xd8d6('0x80')]=_0x400b1b['membername'];_0x52f69c['holdtime']=_0x400b1b['holdtime'];_0x52f69c[_0xd8d6('0x36')]=!![];_0x52f69c['queuecallerexit']=![];_0x52f69c['queuecallerexitAt']=null;if(!_0x52f69c[_0xd8d6('0x8f')]){if(_0x400b1b[_0xd8d6('0x90')]==_0xd8d6('0x8f')){_0x52f69c[_0xd8d6('0x7e')]=_0xd8d6('0x91');logger[_0xd8d6('0x86')](_0xd8d6('0x92'),_0x52f69c[_0xd8d6('0x4d')],_0x52f69c[_0xd8d6('0x53')]);}else{if(_[_0xd8d6('0x93')](_0x400b1b[_0xd8d6('0x3b')]['toLowerCase'](),_0xd8d6('0x94'))){if(this['queueReports'][_0x400b1b['linkedid']]){var _0x3e0db2=_[_0xd8d6('0x79')](this[_0xd8d6('0xe')][_0x400b1b['linkedid']]);_0x3e0db2[_0xd8d6('0x36')]=![];_0x3e0db2[_0xd8d6('0x35')]=!![];_0x3e0db2[_0xd8d6('0x95')]=moment(_0x52f69c[_0xd8d6('0x6e')])[_0xd8d6('0x96')](_0x400b1b[_0xd8d6('0x7b')],_0xd8d6('0x97'))[_0xd8d6('0x4b')](_0xd8d6('0x7d'));_0x3e0db2[_0xd8d6('0x7e')]=_0xd8d6('0x98');_0x3e0db2['transfer']=!![];_0x3e0db2['transfertype']=_0xd8d6('0x99');_0x3e0db2[_0xd8d6('0x9a')]=_0x400b1b[_0xd8d6('0x9b')];_0x3e0db2[_0xd8d6('0x9c')]=_0x400b1b['uniqueid'];logger[_0xd8d6('0x86')](_0xd8d6('0x9d'),_0x3e0db2['queue'],_0x3e0db2[_0xd8d6('0x53')]);var _0x5b9be8=this['queueReports'][_0x400b1b['linkedid']];this[_0xd8d6('0xe')][_0x400b1b[_0xd8d6('0x9e')]]=this[_0xd8d6('0xe')][_0x400b1b[_0xd8d6('0x4a')]];this[_0xd8d6('0xe')][_0x400b1b[_0xd8d6('0x4a')]]=_0x5b9be8;}}else{_0x52f69c[_0xd8d6('0x7e')]=_0xd8d6('0x9f')+_0x400b1b['reason']['toUpperCase']();logger[_0xd8d6('0x86')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x52f69c[_0xd8d6('0x4d')],_0x52f69c[_0xd8d6('0x53')],_0x52f69c[_0xd8d6('0x7e')]);}}}this[_0xd8d6('0x11')][_0x400b1b['uniqueid']]=_0x52f69c;}}}catch(_0x372dde){logger[_0xd8d6('0x40')](_0xd8d6('0x8c'),_0x400b1b[_0xd8d6('0x4a')],util['inspect'](_0x372dde,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd8d6('0xa0')]=function(_0xb47a94){try{if(this['isNotNull'](_0xb47a94)){logger[_0xd8d6('0x48')]('[%s][voiceQueueReport][varset]',_0xb47a94[_0xd8d6('0x4a')],util[_0xd8d6('0x3f')](_0xb47a94,{'showHidden':![],'depth':null}));this[_0xd8d6('0xa1')](_0xb47a94[_0xd8d6('0x4a')],_[_0xd8d6('0x75')](_0xb47a94['variable'])[0x0],_0xb47a94[_0xd8d6('0xa2')]);if(this[_0xd8d6('0xe')][_0xb47a94[_0xd8d6('0x4a')]]){var _0x4763a8=_[_0xd8d6('0x79')](this[_0xd8d6('0xe')][_0xb47a94[_0xd8d6('0x4a')]]);if(_0x4763a8){if(this[_0xd8d6('0x68')](_0xb47a94['variable'])&&this[_0xd8d6('0x68')](_0xb47a94[_0xd8d6('0xa3')][_0xd8d6('0x5e')])){switch(_0xb47a94['value']){case _0xd8d6('0xa4'):_0x4763a8[_0xd8d6('0x35')]=![];_0x4763a8[_0xd8d6('0x95')]=null;break;case'TIMEOUT':_0x4763a8[_0xd8d6('0xa5')]=_0xd8d6('0xa6');_0x4763a8[_0xd8d6('0x35')]=!![];_0x4763a8['queuecallerexitAt']=moment()[_0xd8d6('0x4b')](_0xd8d6('0x7d'));_0x4763a8['queuecallerleaveAt']=moment()['format'](_0xd8d6('0x7d'));logger[_0xd8d6('0x48')](_0xd8d6('0xa7'),_0xb47a94[_0xd8d6('0x4a')],util['inspect'](_0x4763a8,{'showHidden':![],'depth':null}));ami[_0xd8d6('0x46')]('custom:timeout',_0x4763a8);break;default:_0x4763a8['queuecallerexit']=!![];_0x4763a8[_0xd8d6('0x95')]=moment()[_0xd8d6('0x4b')](_0xd8d6('0x7d'));_0x4763a8[_0xd8d6('0x83')]=moment()[_0xd8d6('0x4b')](_0xd8d6('0x7d'));}_0x4763a8['queuecallerabandon']=![];_0x4763a8[_0xd8d6('0x8d')]=null;_0x4763a8[_0xd8d6('0x7e')]=_0xb47a94[_0xd8d6('0xa2')];this[_0xd8d6('0x11')][_0xb47a94[_0xd8d6('0x4a')]]=_0x4763a8;this[_0xd8d6('0x44')](_0x4763a8,_0xd8d6('0xa8'));}else if(this['isNotNull'](_0xb47a94[_0xd8d6('0xa3')])&&this['isNotNull'](_0xb47a94[_0xd8d6('0xa3')][_0xd8d6('0xa9')])){if(!_0x4763a8['queuecallerabandon']){_0x4763a8[_0xd8d6('0x35')]=!![];_0x4763a8[_0xd8d6('0x95')]=moment()[_0xd8d6('0x4b')](_0xd8d6('0x7d'));_0x4763a8[_0xd8d6('0x7e')]=_0xd8d6('0xaa');_0x4763a8[_0xd8d6('0x83')]=moment()[_0xd8d6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd8d6('0x11')][_0xb47a94['uniqueid']]=_0x4763a8;}}logger['info'](_0xd8d6('0xab'),_0xb47a94['uniqueid'],_0x4763a8['queue'],_0x4763a8[_0xd8d6('0x53')],_[_0xd8d6('0x75')](_0xb47a94[_0xd8d6('0xa3')])[0x0],_0xb47a94[_0xd8d6('0xa2')]);_0x4763a8['variables']=this[_0xd8d6('0x16')][_0xb47a94['uniqueid']];}}}}catch(_0x37ebe6){logger[_0xd8d6('0x40')](_0xd8d6('0xac'),_0xb47a94['uniqueid'],util['inspect'](_0x37ebe6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd8d6('0xa')][_0xd8d6('0xa1')]=function(_0x13fa84,_0x5b9afd,_0x123226){var _0x36a10f=['rtpaudioqos',_0xd8d6('0xad'),'rtpaudioqosjitter',_0xd8d6('0xae'),_0xd8d6('0xaf'),_0xd8d6('0xb0'),_0xd8d6('0xb1'),_0xd8d6('0xb2'),_0xd8d6('0xb3'),_0xd8d6('0xb4'),_0xd8d6('0xb5'),'bridgepvtcallid',_0xd8d6('0xb6'),_0xd8d6('0xb7'),_0xd8d6('0xb8'),_0xd8d6('0xb9'),_0xd8d6('0xba'),_0xd8d6('0xbb'),_0xd8d6('0xbc')];if(!_[_0xd8d6('0x38')](_0x5b9afd)&&!_['includes'](_0x36a10f,_0x5b9afd)){if(_[_0xd8d6('0x6d')](this[_0xd8d6('0x16')][_0x13fa84])){this[_0xd8d6('0x16')][_0x13fa84]={};}this[_0xd8d6('0x16')][_0x13fa84][_0x5b9afd]=_0x123226;}};VoiceQueueReport[_0xd8d6('0xa')][_0xd8d6('0xbd')]=function(_0x3fd91d,_0x1068da,_0x52a448){try{var _0x5c3009={};if(this[_0xd8d6('0xe')][_0x3fd91d]){for(var _0x1d176a=0x0;_0x1d176a=0x0?moment(_0x5552a6[_0x318e('0x1c')])['diff'](_0x5552a6[_0x318e('0x1b')],_0x318e('0xf')):null,'data1':_0x318e('0x1d'),'data2':_0x5552a6[_0x318e('0x16')],'data3':_0x5552a6['exten'],'data4':_0x5552a6['dialstring']||null,'role':_0x318e('0x14'),'internal':_0x5552a6['accountcode']?_[_0x318e('0x15')](_0x5552a6['accountcode']):undefined,'uniqueid':_0x5552a6[_0x318e('0x17')]},'log':_0x318e('0x7')});}; \ No newline at end of file +var _0x2028=['../client','voiceQueueReport','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','agent','accountcode','toNumber','voiceDialReport','membername','starttime','endtime','outbound','dialstring','uniqueid','moment','lodash','util'];(function(_0xdb0dd2,_0x1ea646){var _0x280e76=function(_0x1058c2){while(--_0x1058c2){_0xdb0dd2['push'](_0xdb0dd2['shift']());}};_0x280e76(++_0x1ea646);}(_0x2028,0x1b0));var _0x8202=function(_0x1e9d46,_0x437706){_0x1e9d46=_0x1e9d46-0x0;var _0x3e6ef6=_0x2028[_0x1e9d46];return _0x3e6ef6;};'use strict';var moment=require(_0x8202('0x0'));var _=require(_0x8202('0x1'));var util=require(_0x8202('0x2'));var client=require(_0x8202('0x3'));exports[_0x8202('0x4')]=function(_0x437d31){var _0x4a32a6=_0x437d31['queuecallercompleteAt']||_0x437d31['queuecallerexitAt'];return client[_0x8202('0x5')](_0x8202('0x6'),{'body':{'channel':_0x8202('0x7'),'membername':_0x437d31[_0x8202('0x8')],'interface':_[_0x8202('0x9')](_0x437d31[_0x8202('0xa')])?util['format'](_0x8202('0xb'),_0x437d31['lastAssignedTo']):_0x437d31['interface'],'type':_0x8202('0xc'),'enterAt':_0x437d31[_0x8202('0xd')],'exitAt':_0x4a32a6,'duration':moment(_0x4a32a6)[_0x8202('0xe')](_0x437d31[_0x8202('0xd')],_0x8202('0xf')),'data1':_0x8202('0x10'),'data2':_0x437d31['calleridnum'],'data3':_0x437d31[_0x8202('0x11')],'data4':null,'data5':_0x437d31[_0x8202('0x12')],'role':_0x8202('0x13'),'internal':_0x437d31[_0x8202('0x14')]?_[_0x8202('0x15')](_0x437d31[_0x8202('0x14')]):undefined,'uniqueid':_0x437d31['uniqueid']},'log':_0x8202('0x6')});};exports[_0x8202('0x16')]=function(_0x5777ea){return client[_0x8202('0x5')](_0x8202('0x6'),{'body':{'channel':_0x8202('0x7'),'membername':_0x5777ea[_0x8202('0x17')],'interface':_0x5777ea[_0x8202('0xa')],'type':_0x8202('0xc'),'enterAt':_0x5777ea[_0x8202('0x18')],'exitAt':_0x5777ea[_0x8202('0x19')],'duration':moment(_0x5777ea[_0x8202('0x19')])[_0x8202('0xe')](_0x5777ea[_0x8202('0x18')],'seconds')>=0x0?moment(_0x5777ea[_0x8202('0x19')])['diff'](_0x5777ea[_0x8202('0x18')],'seconds'):null,'data1':_0x8202('0x1a'),'data2':_0x5777ea['accountcode'],'data3':_0x5777ea[_0x8202('0x11')],'data4':_0x5777ea[_0x8202('0x1b')]||null,'role':_0x8202('0x13'),'internal':_0x5777ea['accountcode']?_[_0x8202('0x15')](_0x5777ea[_0x8202('0x14')]):undefined,'uniqueid':_0x5777ea[_0x8202('0x1c')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 15d6efb..e0aba61 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 _0xb114=['previewRecallmeReminderInterval','GetSettings','../client','Request','ShowSetting'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0xb114,0x11f));var _0x4b11=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xb114[_0x2fc012];return _0x2891f9;};'use strict';var client=require(_0x4b11('0x0'));exports['getSettings']=function(){return client[_0x4b11('0x1')](_0x4b11('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x4b11('0x3')]},'log':_0x4b11('0x4')});}; \ No newline at end of file +var _0x13ae=['stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x13ae,0xe6));var _0xe13a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x13ae[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe13a('0x0'),_0xe13a('0x1')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 14c9639..05bbdcb 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 _0x7677=['Request','name','html','GetTemplate','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7677,0x18f));var _0x7767=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7677[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x7767('0x0'));exports['getTemplates']=function(_0x2d4f9d){return function(_0x1b4969){return client[_0x7767('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x7767('0x2'),_0x7767('0x3')]},'log':_0x7767('0x4')});};}; \ No newline at end of file +var _0x1677=['GetTemplate','name','html','getTemplates'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x1677,0x18f));var _0x7167=function(_0x55cf52,_0x2cf5c8){_0x55cf52=_0x55cf52-0x0;var _0x3a56de=_0x1677[_0x55cf52];return _0x3a56de;};'use strict';var client=require('../client');exports[_0x7167('0x0')]=function(_0x4c05f0){return function(_0xedabe0){return client['Request'](_0x7167('0x1'),{'options':{'raw':!![],'attributes':['id',_0x7167('0x2'),_0x7167('0x3')]},'log':_0x7167('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 766eb6f..c21050c 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 _0xcfb7=['channel','status','Condition','AllConditions','field','operator','AnyConditions','Actions','action','data2','data3','data6','data7','../client','getTriggers','Request','GetTrigger','name'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcfb7,0x11b));var _0x7cfb=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0xcfb7[_0x3fb9dd];return _0x20136a;};'use strict';var client=require(_0x7cfb('0x0'));exports[_0x7cfb('0x1')]=function(_0x5f4fc6){return function(_0x24e747){return client[_0x7cfb('0x2')](_0x7cfb('0x3'),{'options':{'raw':![],'attributes':['id',_0x7cfb('0x4'),_0x7cfb('0x5'),_0x7cfb('0x6')],'include':[{'model':_0x7cfb('0x7'),'as':_0x7cfb('0x8'),'attributes':['id',_0x7cfb('0x9'),_0x7cfb('0xa'),'value']},{'model':_0x7cfb('0x7'),'as':_0x7cfb('0xb'),'attributes':['id',_0x7cfb('0x9'),_0x7cfb('0xa'),'value']},{'model':'Action','as':_0x7cfb('0xc'),'attributes':['id',_0x7cfb('0xd'),'data1',_0x7cfb('0xe'),_0x7cfb('0xf'),'data4','data5',_0x7cfb('0x10'),_0x7cfb('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x1552=['data3','data4','data7','Request','GetTrigger','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','action','data1'];(function(_0x593327,_0x438272){var _0x46b5d2=function(_0x524f8f){while(--_0x524f8f){_0x593327['push'](_0x593327['shift']());}};_0x46b5d2(++_0x438272);}(_0x1552,0xd5));var _0x2155=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x1552[_0x3430aa];return _0x2ac5c;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x1d8056){return function(_0x2a6713){return client[_0x2155('0x0')](_0x2155('0x1'),{'options':{'raw':![],'attributes':['id','name','channel',_0x2155('0x2')],'include':[{'model':_0x2155('0x3'),'as':_0x2155('0x4'),'attributes':['id',_0x2155('0x5'),_0x2155('0x6'),'value']},{'model':_0x2155('0x3'),'as':_0x2155('0x7'),'attributes':['id',_0x2155('0x5'),_0x2155('0x6'),_0x2155('0x8')]},{'model':_0x2155('0x9'),'as':'Actions','attributes':['id',_0x2155('0xa'),_0x2155('0xb'),'data2',_0x2155('0xc'),_0x2155('0xd'),'data5','data6',_0x2155('0xe')]}]},'log':_0x2155('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index df721b6..f9614e7 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 _0x4bcc=['name','defaultuser','../client','getTrunks','GetTrunk'];(function(_0x4986b2,_0x2fe5fb){var _0xfb0b29=function(_0x521a76){while(--_0x521a76){_0x4986b2['push'](_0x4986b2['shift']());}};_0xfb0b29(++_0x2fe5fb);}(_0x4bcc,0x1a6));var _0xc4bc=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4bcc[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0xc4bc('0x0'));exports[_0xc4bc('0x1')]=function(_0x3d0540){return function(_0x15efe0){return client['Request'](_0xc4bc('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc4bc('0x3'),'registry',_0xc4bc('0x4')]},'log':_0xc4bc('0x2')});};}; \ No newline at end of file +var _0xa25a=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x1115df,_0x121e5a){var _0x3283d7=function(_0x1c9da7){while(--_0x1c9da7){_0x1115df['push'](_0x1115df['shift']());}};_0x3283d7(++_0x121e5a);}(_0xa25a,0x160));var _0xaa25=function(_0xacef71,_0x2e58c2){_0xacef71=_0xacef71-0x0;var _0x4df6de=_0xa25a[_0xacef71];return _0x4df6de;};'use strict';var client=require(_0xaa25('0x0'));exports[_0xaa25('0x1')]=function(_0x212df1){return function(_0x22c967){return client[_0xaa25('0x2')](_0xaa25('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xaa25('0x4'),_0xaa25('0x5'),_0xaa25('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7464fc1..e8f4fb6 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x4e01bf,_0x2748ec){var _0x42857e=function(_0x1f5df9){while(--_0x1f5df9){_0x4e01bf['push'](_0x4e01bf['shift']());}};_0x42857e(++_0x2748ec);}(_0x70e0,0x17b));var _0x070e=function(_0xda9310,_0x265fb3){_0xda9310=_0xda9310-0x0;var _0x337d94=_0x70e0[_0xda9310];return _0x337d94;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4e7f8b4..dc6ffdb 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 _0xaaa1=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x38aa0b,_0x2f080a){var _0x54f37b=function(_0x2d7c57){while(--_0x2d7c57){_0x38aa0b['push'](_0x38aa0b['shift']());}};_0x54f37b(++_0x2f080a);}(_0xaaa1,0x104));var _0x1aaa=function(_0x5c918f,_0x3d4c6a){_0x5c918f=_0x5c918f-0x0;var _0x23a936=_0xaaa1[_0x5c918f];return _0x23a936;};'use strict';var client=require(_0x1aaa('0x0'));exports[_0x1aaa('0x1')]=function(_0x11bb8f){return client[_0x1aaa('0x2')](_0x1aaa('0x3'),{'body':_0x11bb8f,'log':'CreateVoiceAgentReport'});};exports[_0x1aaa('0x4')]=function(_0x2229a4,_0x429692,_0x3c4282){return client['Request'](_0x1aaa('0x5'),{'body':_0x2229a4,'options':{'where':{'uniqueid':_0x429692,'interface':_0x3c4282,'agentcomplete':!![]}},'log':_0x1aaa('0x5')});}; \ No newline at end of file +var _0x0998=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x157907,_0x3a9ea3){var _0x37bada=function(_0x27f09e){while(--_0x27f09e){_0x157907['push'](_0x157907['shift']());}};_0x37bada(++_0x3a9ea3);}(_0x0998,0xe5));var _0x8099=function(_0x1485cf,_0x3eff35){_0x1485cf=_0x1485cf-0x0;var _0x7a0e54=_0x0998[_0x1485cf];return _0x7a0e54;};'use strict';var client=require(_0x8099('0x0'));exports[_0x8099('0x1')]=function(_0x3c7951){return client[_0x8099('0x2')](_0x8099('0x3'),{'body':_0x3c7951,'log':_0x8099('0x3')});};exports[_0x8099('0x4')]=function(_0x3d7d58,_0x1a49c6,_0x2e040b){return client[_0x8099('0x2')](_0x8099('0x5'),{'body':_0x3d7d58,'options':{'where':{'uniqueid':_0x1a49c6,'interface':_0x2e040b,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 470c5d2..de1f008 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 _0x55d4=['DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid'];(function(_0xf48244,_0x115cad){var _0x37d890=function(_0x19a886){while(--_0x19a886){_0xf48244['push'](_0xf48244['shift']());}};_0x37d890(++_0x115cad);}(_0x55d4,0x97));var _0x455d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x55d4[_0x2c91e9];return _0x13f0ff;};'use strict';var moment=require('moment');var util=require(_0x455d('0x0'));var _=require(_0x455d('0x1'));var client=require(_0x455d('0x2'));exports[_0x455d('0x3')]=function(_0x1e1ade){return client[_0x455d('0x4')](_0x455d('0x5'),{'body':_[_0x455d('0x6')](_0x1e1ade,{'source':_0x1e1ade[_0x455d('0x7')],'destinationcontext':_0x1e1ade['context'],'callerid':_0x1e1ade[_0x455d('0x8')],'amaflags':_0x455d('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x455d('0xa')]=function(){return function(){return client[_0x455d('0x4')](_0x455d('0xb'),{'options':{'where':{'type':[_0x455d('0xc')],'createdAt':{'$between':[moment()[_0x455d('0xd')]('day')[_0x455d('0xe')](_0x455d('0xf')),moment()[_0x455d('0x10')](_0x455d('0x11'))['format'](_0x455d('0xf'))]}},'attributes':[_0x455d('0x12'),_0x455d('0x13'),'duration','billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xb426=['util','../client','create','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','outbound','startOf','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports','moment'];(function(_0x11dcf0,_0x4eb137){var _0x4f9831=function(_0x2d278e){while(--_0x2d278e){_0x11dcf0['push'](_0x11dcf0['shift']());}};_0x4f9831(++_0x4eb137);}(_0xb426,0xef));var _0x6b42=function(_0x593e71,_0x31ba76){_0x593e71=_0x593e71-0x0;var _0x4f73b5=_0xb426[_0x593e71];return _0x4f73b5;};'use strict';var moment=require(_0x6b42('0x0'));var util=require(_0x6b42('0x1'));var _=require('lodash');var client=require(_0x6b42('0x2'));exports[_0x6b42('0x3')]=function(_0x2b421b){return client['Request']('CreateVoiceCallReport',{'body':_[_0x6b42('0x4')](_0x2b421b,{'source':_0x2b421b['calleridnum'],'destinationcontext':_0x2b421b[_0x6b42('0x5')],'callerid':_0x2b421b[_0x6b42('0x6')],'amaflags':_0x6b42('0x7')}),'log':'CreateVoiceCallReport'});};exports[_0x6b42('0x8')]=function(){return function(){return client[_0x6b42('0x9')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x6b42('0xa')],'createdAt':{'$between':[moment()[_0x6b42('0xb')](_0x6b42('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x6b42('0xd')](_0x6b42('0xc'))[_0x6b42('0xe')](_0x6b42('0xf'))]}},'attributes':[_0x6b42('0x10'),'disposition',_0x6b42('0x11'),_0x6b42('0x12')]},'log':_0x6b42('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index bb071c4..260fe19 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 _0xaec4=['../client','create','Request','CreateVoiceDialReport'];(function(_0x1fad82,_0x318901){var _0x5168d6=function(_0x5b076e){while(--_0x5b076e){_0x1fad82['push'](_0x1fad82['shift']());}};_0x5168d6(++_0x318901);}(_0xaec4,0x7c));var _0x4aec=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xaec4[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x4aec('0x0'));exports[_0x4aec('0x1')]=function(_0x5f03a4){return client[_0x4aec('0x2')](_0x4aec('0x3'),{'body':_0x5f03a4,'log':_0x4aec('0x3')});}; \ No newline at end of file +var _0x03d7=['Request','CreateVoiceDialReport','../client','create'];(function(_0x33c534,_0x50a3ce){var _0x1eb737=function(_0x5142d6){while(--_0x5142d6){_0x33c534['push'](_0x33c534['shift']());}};_0x1eb737(++_0x50a3ce);}(_0x03d7,0x1ce));var _0x703d=function(_0x56dbf6,_0x262a10){_0x56dbf6=_0x56dbf6-0x0;var _0x3dd600=_0x03d7[_0x56dbf6];return _0x3dd600;};'use strict';var client=require(_0x703d('0x0'));exports[_0x703d('0x1')]=function(_0x14012){return client[_0x703d('0x2')]('CreateVoiceDialReport',{'body':_0x14012,'log':_0x703d('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 517aefa..c9e63a0 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 _0x8c38=['recordingFormat','../client','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x22d9c2,_0x25175b){var _0x5ad79f=function(_0x4695c3){while(--_0x4695c3){_0x22d9c2['push'](_0x22d9c2['shift']());}};_0x5ad79f(++_0x25175b);}(_0x8c38,0x83));var _0x88c3=function(_0x476d53,_0x1947d7){_0x476d53=_0x476d53-0x0;var _0x358f8c=_0x8c38[_0x476d53];return _0x358f8c;};'use strict';var client=require(_0x88c3('0x0'));exports[_0x88c3('0x1')]=function(){return function(){return client['Request'](_0x88c3('0x2'),{'options':{'raw':!![],'attributes':['id',_0x88c3('0x3'),_0x88c3('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x88c3('0x1')});};}; \ No newline at end of file +var _0x0102=['GetVoiceExtension','exten','getVoiceExtensions','Request'];(function(_0x3e06b1,_0x5c0dc4){var _0x239e70=function(_0x277bb3){while(--_0x277bb3){_0x3e06b1['push'](_0x3e06b1['shift']());}};_0x239e70(++_0x5c0dc4);}(_0x0102,0x186));var _0x2010=function(_0x3694f,_0x25c74c){_0x3694f=_0x3694f-0x0;var _0x537422=_0x0102[_0x3694f];return _0x537422;};'use strict';var client=require('../client');exports[_0x2010('0x0')]=function(){return function(){return client[_0x2010('0x1')](_0x2010('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2010('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1402f08..f03a245 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 _0xc1e1=['autopause','monitor_format','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout'];(function(_0x54c2e4,_0x44d27f){var _0x3c566d=function(_0x133342){while(--_0x133342){_0x54c2e4['push'](_0x54c2e4['shift']());}};_0x3c566d(++_0x44d27f);}(_0xc1e1,0x130));var _0x1c1e=function(_0x3d9839,_0x909f65){_0x3d9839=_0x3d9839-0x0;var _0x523240=_0xc1e1[_0x3d9839];return _0x523240;};'use strict';var client=require('../client');exports[_0x1c1e('0x0')]=function(){return function(){return client[_0x1c1e('0x1')](_0x1c1e('0x2'),{'options':{'raw':![],'attributes':['id',_0x1c1e('0x3'),_0x1c1e('0x4'),_0x1c1e('0x5'),_0x1c1e('0x6'),_0x1c1e('0x7'),'type',_0x1c1e('0x8'),_0x1c1e('0x9'),'dialLimitChannel','dialLimitQueue',_0x1c1e('0xa'),_0x1c1e('0xb'),'dialPredictiveOptimizationPercentage',_0x1c1e('0xc'),_0x1c1e('0xd'),'dialOriginateCallerIdNumber',_0x1c1e('0xe'),'dialQueueOptions',_0x1c1e('0xf'),'dialQueueProject',_0x1c1e('0x10'),_0x1c1e('0x11'),_0x1c1e('0x12'),'dialBusyRetryFrequency',_0x1c1e('0x13'),_0x1c1e('0x14'),_0x1c1e('0x15'),_0x1c1e('0x16'),_0x1c1e('0x17'),_0x1c1e('0x18'),_0x1c1e('0x19'),_0x1c1e('0x1a'),'dialAMDInitialSilence',_0x1c1e('0x1b'),_0x1c1e('0x1c'),'dialAMDTotalAnalysisTime',_0x1c1e('0x1d'),_0x1c1e('0x1e'),'dialAMDMaximumNumberOfWords',_0x1c1e('0x1f'),_0x1c1e('0x20'),'timeout',_0x1c1e('0x21'),_0x1c1e('0x22'),_0x1c1e('0x23'),_0x1c1e('0x24'),_0x1c1e('0x25'),_0x1c1e('0x26'),_0x1c1e('0x7'),_0x1c1e('0x27'),'dialRandomLastDigitCallerIdNumber',_0x1c1e('0x28'),'dialNoSuchNumberMaxRetry',_0x1c1e('0x29'),'dialDropMaxRetry',_0x1c1e('0x2a'),_0x1c1e('0x2b'),_0x1c1e('0x2c'),_0x1c1e('0x2d'),_0x1c1e('0x2e'),'dialAgentRejectMaxRetry',_0x1c1e('0x2f'),_0x1c1e('0x30'),_0x1c1e('0x31'),_0x1c1e('0x32'),_0x1c1e('0x33'),_0x1c1e('0x34')],'include':[{'model':'Trunk','as':_0x1c1e('0x35'),'attributes':['id',_0x1c1e('0x3'),_0x1c1e('0x36'),_0x1c1e('0x37')]},{'model':_0x1c1e('0x38'),'as':_0x1c1e('0x39'),'attributes':['id',_0x1c1e('0x3')]},{'model':_0x1c1e('0x35'),'as':_0x1c1e('0x3a'),'attributes':['id',_0x1c1e('0x3'),'callerid',_0x1c1e('0x37')]},{'model':_0x1c1e('0x3b'),'as':_0x1c1e('0x3b'),'attributes':['id',_0x1c1e('0x3')],'include':[{'model':_0x1c1e('0x3b'),'as':_0x1c1e('0x3c'),'attributes':['id',_0x1c1e('0x3'),_0x1c1e('0x3d')]}]}]},'log':_0x1c1e('0x0')});};}; \ No newline at end of file +var _0x6c48=['mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause'];(function(_0x596129,_0x34b27f){var _0x447bf5=function(_0x1a5296){while(--_0x1a5296){_0x596129['push'](_0x596129['shift']());}};_0x447bf5(++_0x34b27f);}(_0x6c48,0x7f));var _0x86c4=function(_0x1a4362,_0x2b98d8){_0x1a4362=_0x1a4362-0x0;var _0x57f069=_0x6c48[_0x1a4362];return _0x57f069;};'use strict';var client=require(_0x86c4('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x86c4('0x1')](_0x86c4('0x2'),{'options':{'raw':![],'attributes':['id',_0x86c4('0x3'),_0x86c4('0x4'),_0x86c4('0x5'),_0x86c4('0x6'),_0x86c4('0x7'),'type',_0x86c4('0x8'),'dialMethod',_0x86c4('0x9'),_0x86c4('0xa'),_0x86c4('0xb'),_0x86c4('0xc'),_0x86c4('0xd'),_0x86c4('0xe'),_0x86c4('0xf'),_0x86c4('0x10'),_0x86c4('0x11'),_0x86c4('0x12'),'dialQueueTimeout',_0x86c4('0x13'),'dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry',_0x86c4('0x14'),'dialNoAnswerMaxRetry',_0x86c4('0x15'),_0x86c4('0x16'),'dialTimezone','dialGlobalInterval',_0x86c4('0x17'),'dialCheckDuplicateType',_0x86c4('0x18'),_0x86c4('0x19'),_0x86c4('0x1a'),_0x86c4('0x1b'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0x86c4('0x1c'),'dialAMDMaximumNumberOfWords',_0x86c4('0x1d'),_0x86c4('0x1e'),_0x86c4('0x1f'),_0x86c4('0x20'),_0x86c4('0x21'),_0x86c4('0x22'),'dialAgiAfterHangupAgent',_0x86c4('0x23'),'dialQueueProject2',_0x86c4('0x7'),_0x86c4('0x24'),_0x86c4('0x25'),_0x86c4('0x26'),_0x86c4('0x27'),_0x86c4('0x28'),_0x86c4('0x29'),_0x86c4('0x2a'),_0x86c4('0x2b'),_0x86c4('0x2c'),_0x86c4('0x2d'),_0x86c4('0x2e'),_0x86c4('0x2f'),_0x86c4('0x30'),'mandatoryDisposition',_0x86c4('0x31'),_0x86c4('0x32'),'dialPreviewAutoRecallMe',_0x86c4('0x33')],'include':[{'model':'Trunk','as':_0x86c4('0x34'),'attributes':['id',_0x86c4('0x3'),_0x86c4('0x35'),_0x86c4('0x36')]},{'model':_0x86c4('0x37'),'as':_0x86c4('0x38'),'attributes':['id',_0x86c4('0x3')]},{'model':_0x86c4('0x34'),'as':_0x86c4('0x39'),'attributes':['id',_0x86c4('0x3'),_0x86c4('0x35'),_0x86c4('0x36')]},{'model':_0x86c4('0x3a'),'as':_0x86c4('0x3a'),'attributes':['id',_0x86c4('0x3')],'include':[{'model':_0x86c4('0x3a'),'as':_0x86c4('0x3b'),'attributes':['id','name',_0x86c4('0x3c')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index dd9495e..f706996 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(_0x2e70ef,_0x2ecc8e){var _0x58e141=function(_0x1eb03b){while(--_0x1eb03b){_0x2e70ef['push'](_0x2e70ef['shift']());}};_0x58e141(++_0x2ecc8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x446438,_0x771136){var _0x58cfcc=function(_0x460868){while(--_0x460868){_0x446438['push'](_0x446438['shift']());}};_0x58cfcc(++_0x771136);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 d21a8b8..7f5ea1a 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 _0x3c6a=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x1bed32,_0x4f04f8){var _0x30f4a7=function(_0xe04a37){while(--_0xe04a37){_0x1bed32['push'](_0x1bed32['shift']());}};_0x30f4a7(++_0x4f04f8);}(_0x3c6a,0xda));var _0xa3c6=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x3c6a[_0x519756];return _0x37047e;};'use strict';var client=require(_0xa3c6('0x0'));exports[_0xa3c6('0x1')]=function(_0x568cfd){return function(){return client['Request'](_0xa3c6('0x2'),{'options':{'where':{'VoiceQueueId':_0x568cfd,'paused':!![]},'raw':!![]},'log':_0xa3c6('0x1')});};}; \ No newline at end of file +var _0xc125=['getVoiceQueueRtPauses'];(function(_0x176830,_0x5a4fc3){var _0x2e96d8=function(_0x3ed4ac){while(--_0x3ed4ac){_0x176830['push'](_0x176830['shift']());}};_0x2e96d8(++_0x5a4fc3);}(_0xc125,0xca));var _0x5c12=function(_0x5ed5ad,_0x490098){_0x5ed5ad=_0x5ed5ad-0x0;var _0x56e88c=_0xc125[_0x5ed5ad];return _0x56e88c;};'use strict';var client=require('../client');exports[_0x5c12('0x0')]=function(_0x4aafc0){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4aafc0,'paused':!![]},'raw':!![]},'log':_0x5c12('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e5fd429..6804f28 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(_0x3573ee,_0x7bd9d1){var _0x5cf80d=function(_0x34516a){while(--_0x34516a){_0x3573ee['push'](_0x3573ee['shift']());}};_0x5cf80d(++_0x7bd9d1);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x21e62e,_0x1f56d5){var _0x34bb9f=function(_0x12c391){while(--_0x12c391){_0x21e62e['push'](_0x21e62e['shift']());}};_0x34bb9f(++_0x1f56d5);}(_0x7a54,0x106));var _0x47a5=function(_0x419e7a,_0x5bd4ac){_0x419e7a=_0x419e7a-0x0;var _0x175fae=_0x7a54[_0x419e7a];return _0x175fae;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 59b3a36..c1d37c0 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 _0xbc66=['attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','isexternal','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','context','extension'];(function(_0x4b503e,_0x114b8e){var _0x5e1859=function(_0x55421d){while(--_0x55421d){_0x4b503e['push'](_0x4b503e['shift']());}};_0x5e1859(++_0x114b8e);}(_0xbc66,0xa1));var _0x6bc6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbc66[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0x6bc6('0x0'));exports[_0x6bc6('0x1')]={};exports['blindTransfer']=function(_0x4b6551){return client[_0x6bc6('0x2')](_0x6bc6('0x3'),{'body':{'result':_0x4b6551[_0x6bc6('0x4')],'transfererchannel':_0x4b6551['transfererchannel'],'transferercalleridnum':_0x4b6551[_0x6bc6('0x5')],'transferercalleridname':_0x4b6551['transferercalleridname'],'transfererconnectedlinenum':_0x4b6551['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4b6551['transfererconnectedlinename'],'transfereraccountcode':_0x4b6551[_0x6bc6('0x6')],'transferercontext':_0x4b6551[_0x6bc6('0x7')],'transfererexten':_0x4b6551[_0x6bc6('0x8')],'transfererlinkedid':_0x4b6551[_0x6bc6('0x9')],'transfereechannel':_0x4b6551[_0x6bc6('0xa')],'transfereecalleridnum':_0x4b6551[_0x6bc6('0xb')],'transfereecalleridname':_0x4b6551[_0x6bc6('0xc')],'transfereeconnectedlinenum':_0x4b6551[_0x6bc6('0xd')],'transfereeconnectedlinename':_0x4b6551[_0x6bc6('0xe')],'transfereeaccountcode':_0x4b6551[_0x6bc6('0xf')],'transfereecontext':_0x4b6551[_0x6bc6('0x10')],'transfereeexten':_0x4b6551['transfereeexten'],'transfereelinkedid':_0x4b6551['transfereelinkedid'],'isexternal':_0x4b6551['isexternal'],'context':_0x4b6551[_0x6bc6('0x11')],'extension':_0x4b6551[_0x6bc6('0x12')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x6bc6('0x13')]=function(_0x24140e){return client['Request'](_0x6bc6('0x3'),{'body':{'result':_0x24140e[_0x6bc6('0x4')],'transfererchannel':_0x24140e[_0x6bc6('0x14')],'transferercalleridnum':_0x24140e[_0x6bc6('0x15')],'transferercalleridname':_0x24140e[_0x6bc6('0x16')],'transfererconnectedlinenum':_0x24140e['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x24140e[_0x6bc6('0x17')],'transfereraccountcode':_0x24140e[_0x6bc6('0x18')],'transferercontext':_0x24140e[_0x6bc6('0x19')],'transfererexten':_0x24140e[_0x6bc6('0x1a')],'transfererlinkedid':_0x24140e['origtransfererlinkedid'],'transfereechannel':_0x24140e['transfertargetchannel'],'transfereecalleridnum':_0x24140e[_0x6bc6('0x1b')],'transfereecalleridname':_0x24140e[_0x6bc6('0x1c')],'transfereeconnectedlinenum':_0x24140e[_0x6bc6('0x1d')],'transfereeconnectedlinename':_0x24140e[_0x6bc6('0x1e')],'transfereeaccountcode':_0x24140e['transfertargetaccountcode'],'transfereecontext':_0x24140e[_0x6bc6('0x1f')],'transfereeexten':_0x24140e[_0x6bc6('0x20')],'transfereelinkedid':_0x24140e['transfertargetlinkedid'],'isexternal':_0x24140e[_0x6bc6('0x21')],'context':_0x24140e['origtransferercontext'],'extension':_0x24140e[_0x6bc6('0x22')],'type':_0x6bc6('0x23')},'log':_0x6bc6('0x3')});}; \ No newline at end of file +var _0xa2c3=['secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereelinkedid','isexternal','context','CreateVoiceTransferReport','attendedTransfer','Request','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum'];(function(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_0xa2c3,0xa2));var _0x3a2c=function(_0x5da4d8,_0x31cca6){_0x5da4d8=_0x5da4d8-0x0;var _0x354518=_0xa2c3[_0x5da4d8];return _0x354518;};'use strict';var client=require(_0x3a2c('0x0'));exports[_0x3a2c('0x1')]={};exports[_0x3a2c('0x2')]=function(_0x1e23d4){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x1e23d4[_0x3a2c('0x3')],'transfererchannel':_0x1e23d4[_0x3a2c('0x4')],'transferercalleridnum':_0x1e23d4[_0x3a2c('0x5')],'transferercalleridname':_0x1e23d4[_0x3a2c('0x6')],'transfererconnectedlinenum':_0x1e23d4['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1e23d4['transfererconnectedlinename'],'transfereraccountcode':_0x1e23d4[_0x3a2c('0x7')],'transferercontext':_0x1e23d4[_0x3a2c('0x8')],'transfererexten':_0x1e23d4[_0x3a2c('0x9')],'transfererlinkedid':_0x1e23d4[_0x3a2c('0xa')],'transfereechannel':_0x1e23d4['transfereechannel'],'transfereecalleridnum':_0x1e23d4['transfereecalleridnum'],'transfereecalleridname':_0x1e23d4[_0x3a2c('0xb')],'transfereeconnectedlinenum':_0x1e23d4[_0x3a2c('0xc')],'transfereeconnectedlinename':_0x1e23d4['transfereeconnectedlinename'],'transfereeaccountcode':_0x1e23d4[_0x3a2c('0xd')],'transfereecontext':_0x1e23d4['transfereecontext'],'transfereeexten':_0x1e23d4['transfereeexten'],'transfereelinkedid':_0x1e23d4[_0x3a2c('0xe')],'isexternal':_0x1e23d4[_0x3a2c('0xf')],'context':_0x1e23d4[_0x3a2c('0x10')],'extension':_0x1e23d4['extension'],'type':'blind'},'log':_0x3a2c('0x11')});};exports[_0x3a2c('0x12')]=function(_0x1eb674){return client[_0x3a2c('0x13')](_0x3a2c('0x11'),{'body':{'result':_0x1eb674[_0x3a2c('0x3')],'transfererchannel':_0x1eb674['origtransfererchannel'],'transferercalleridnum':_0x1eb674[_0x3a2c('0x14')],'transferercalleridname':_0x1eb674[_0x3a2c('0x15')],'transfererconnectedlinenum':_0x1eb674[_0x3a2c('0x16')],'transfererconnectedlinename':_0x1eb674['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1eb674['origtransfereraccountcode'],'transferercontext':_0x1eb674[_0x3a2c('0x17')],'transfererexten':_0x1eb674['secondtransfererexten'],'transfererlinkedid':_0x1eb674[_0x3a2c('0x18')],'transfereechannel':_0x1eb674[_0x3a2c('0x19')],'transfereecalleridnum':_0x1eb674[_0x3a2c('0x1a')],'transfereecalleridname':_0x1eb674[_0x3a2c('0x1b')],'transfereeconnectedlinenum':_0x1eb674[_0x3a2c('0x1c')],'transfereeconnectedlinename':_0x1eb674[_0x3a2c('0x1d')],'transfereeaccountcode':_0x1eb674[_0x3a2c('0x1e')],'transfereecontext':_0x1eb674[_0x3a2c('0x1f')],'transfereeexten':_0x1eb674[_0x3a2c('0x20')],'transfereelinkedid':_0x1eb674[_0x3a2c('0x21')],'isexternal':_0x1eb674['isexternal'],'context':_0x1eb674[_0x3a2c('0x22')],'extension':_0x1eb674[_0x3a2c('0x23')],'type':_0x3a2c('0x24')},'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 e728aec..fc53f1e 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x4b81a9,_0x1608f9){var _0x43da47=function(_0x2d3ed2){while(--_0x2d3ed2){_0x4b81a9['push'](_0x4b81a9['shift']());}};_0x43da47(++_0x1608f9);}(_0x7a54,0x106));var _0x47a5=function(_0x2afdda,_0x862a6a){_0x2afdda=_0x2afdda-0x0;var _0x5ca1f5=_0x7a54[_0x2afdda];return _0x5ca1f5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +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(_0x5c8caa,_0x2e13b6){var _0xfe4ab7=function(_0x2aa883){while(--_0x2aa883){_0x5c8caa['push'](_0x5c8caa['shift']());}};_0xfe4ab7(++_0x2e13b6);}(_0xb10b,0x12a));var _0xbb10=function(_0x4843cf,_0x480cb5){_0x4843cf=_0x4843cf-0x0;var _0x52ad78=_0xb10b[_0x4843cf];return _0x52ad78;};'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 d5d410f..0d64c3d 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 _0x51b7=['trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','calleridnum','routeId','destcalleridnum','firstName','lastName','mobile','fax','updatedAt','union','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird'];(function(_0x13abb0,_0x5c992f){var _0x3c1c68=function(_0x4bd067){while(--_0x4bd067){_0x13abb0['push'](_0x13abb0['shift']());}};_0x3c1c68(++_0x5c992f);}(_0x51b7,0x142));var _0x751b=function(_0x598abd,_0xefa9c7){_0x598abd=_0x598abd-0x0;var _0xfb3ecd=_0x51b7[_0x598abd];return _0xfb3ecd;};'use strict';var _=require(_0x751b('0x0'));var BPromise=require(_0x751b('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x751b('0x2'));var cmContactRpc=require(_0x751b('0x3'));config[_0x751b('0x4')]=_[_0x751b('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x751b('0x6'))(new Redis(config[_0x751b('0x4')]));function emit(_0x3d30c3,_0x428eb3,_0x19e947,_0x1a9f71,_0x49c5c6){logger[_0x751b('0x7')](_0x751b('0x8'),_0x3d30c3,_0x428eb3['id'],_0x19e947,_0x1a9f71,JSON[_0x751b('0x9')](_0x49c5c6));io['to'](_0x19e947)['emit'](_0x1a9f71,_0x49c5c6);}exports[_0x751b('0xa')]=function(_0x354380,_0x1a6953,_0x60abd3,_0x14880f){var _0xe0c7d,_0x43646a;var _0x114c8c={};var _0x248f96;var _0x47263e=Number(_0x60abd3['data1']);var _0xa0c015=_0x60abd3[_0x751b('0xb')]?Boolean(Number(_0x60abd3['data2'])):![];var _0x3e0ae9;var _0x2c0e09=![];if(!_[_0x751b('0xc')](_0x60abd3[_0x751b('0xd')])){if(_0x60abd3[_0x751b('0xd')]=='1')_0x2c0e09=!![];}if(!_0x2c0e09){if(_0x14880f[_0x751b('0xe')]){_0x114c8c['id']=_0x14880f[_0x751b('0xe')];}}if(!_0x114c8c['id']){_0x114c8c[_0x751b('0xf')]=_0x47263e;_0x3e0ae9=_0x60abd3[_0x751b('0x10')]&&_0x60abd3[_0x751b('0x10')]!=='0'?_0x60abd3[_0x751b('0x10')][_0x751b('0x11')](','):[_0x751b('0x12')];_0x114c8c[_0x751b('0x13')]=_[_0x751b('0x14')](_0x3e0ae9,function(_0x115186){var _0x3b65ac={};_0x3b65ac[_0x115186]=_0x14880f['routeId']?_0x14880f['destcalleridnum']:_0x14880f[_0x751b('0x15')];return _0x3b65ac;});_0x248f96=_0x14880f[_0x751b('0x16')]?_0x14880f[_0x751b('0x17')]:_0x14880f[_0x751b('0x15')];}var _0x3fd548=['id',_0x751b('0x18'),_0x751b('0x19'),'phone',_0x751b('0x1a'),_0x751b('0x1b'),_0x751b('0xf'),'createdAt','scheduledAt',_0x751b('0x1c')];var _0x1ed868=_[_0x751b('0x1d')](_0x3fd548,_0x3e0ae9);BPromise['resolve']()[_0x751b('0x1e')](cmContactRpc[_0x751b('0x1f')]({'attributes':_0x1ed868,'where':_0x114c8c,'phone':_0x248f96}))[_0x751b('0x1e')](function(_0x51e68f){_0x43646a=_0x51e68f;if(!_['isEmpty'](_0x43646a)){if(_0x43646a['length']===0x1){_0xe0c7d=_0x43646a[0x0];logger[_0x751b('0x7')](_0x751b('0x20'),_0x14880f[_0x751b('0x21')],_0x1a6953['id'],_0xe0c7d['id']);}else{logger['info'](_0x751b('0x22'),_0x14880f[_0x751b('0x21')],_0x1a6953['id'],_[_0x751b('0x14')](_0x43646a,'id')[_0x751b('0x23')](','));}return;}else{logger['info'](_0x751b('0x24'),_0x14880f[_0x751b('0x21')],_0x1a6953['id']);var _0x73258a={'ListId':_0x47263e};var _0x4583d7=_0x60abd3[_0x751b('0x25')]&&_0x60abd3[_0x751b('0x25')]!=='0'?_0x60abd3[_0x751b('0x25')]:_0x751b('0x12');if(_0xa0c015){logger[_0x751b('0x7')](_0x751b('0x26'),_0x14880f[_0x751b('0x21')],_0x1a6953['id']);_0x73258a[_0x4583d7]=_[_0x751b('0xc')](_0x14880f['routeId'])?_0x14880f['calleridnum']:_0x14880f[_0x751b('0x17')];if(_[_0x751b('0xc')](_0x14880f['routeId'])){_0x73258a[_0x751b('0x18')]=_0x14880f[_0x751b('0x27')]&&_0x14880f[_0x751b('0x27')]!==_0x751b('0x28')?_0x14880f[_0x751b('0x27')]:_0x751b('0x29');}else{_0x73258a[_0x751b('0x18')]=_0x14880f[_0x751b('0x2a')]&&_0x14880f[_0x751b('0x2a')]!==_0x751b('0x28')?_0x14880f[_0x751b('0x2a')]:_0x751b('0x29');}return BPromise[_0x751b('0x2b')]()[_0x751b('0x1e')](cmContactRpc[_0x751b('0x2c')](_0x73258a))[_0x751b('0x1e')](function(_0x5b7b16){_0xe0c7d=_0x5b7b16;_0x43646a[_0x751b('0x2d')](_0x5b7b16);if(_0xe0c7d){logger[_0x751b('0x7')](_0x751b('0x2e'),_0x14880f[_0x751b('0x21')],_0x1a6953['id'],_0xe0c7d['id']);}return;});}else{logger[_0x751b('0x7')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x14880f[_0x751b('0x21')],_0x1a6953['id']);_0x73258a[_0x4583d7]=_[_0x751b('0xc')](_0x14880f[_0x751b('0x16')])?_0x14880f[_0x751b('0x15')]:_0x14880f['destcalleridnum'];if(_[_0x751b('0xc')](_0x14880f[_0x751b('0x16')])){_0x73258a[_0x751b('0x18')]=_0x14880f[_0x751b('0x27')]&&_0x14880f[_0x751b('0x27')]!==_0x751b('0x28')?_0x14880f['calleridname']:_0x751b('0x29');}else{_0x73258a[_0x751b('0x18')]=_0x14880f[_0x751b('0x2a')]&&_0x14880f[_0x751b('0x2a')]!==''?_0x14880f[_0x751b('0x2a')]:_0x751b('0x29');}_0xe0c7d=_0x73258a;_0x43646a[_0x751b('0x2d')](_0x73258a);return;}}})[_0x751b('0x1e')](function(){if(_0x354380){emit(_0x14880f['uniqueid'],_0x1a6953,util[_0x751b('0x2f')](_0x751b('0x30'),_0x354380['name']),util[_0x751b('0x2f')](_0x751b('0x31'),_0x60abd3[_0x751b('0x32')][_0x751b('0x33')]()),{'evt':_[_0x751b('0x34')](_0x14880f,{'autoCreate':_0xa0c015}),'contact':_0xe0c7d===undefined?{}:_0xe0c7d,'contacts':_0x43646a[_0x751b('0x35')]===0x0?undefined:_0x43646a});}});}; \ No newline at end of file +var _0x9d2e=['ioredis','util','../../../../config/environment','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','$or','map','routeId','destcalleridnum','calleridnum','lastName','phone','mobile','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','data4','firstName','calleridname','','destcalleridname','Unknown','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','merge','lodash','bluebird'];(function(_0x35a058,_0x162209){var _0x4255c1=function(_0x57f24f){while(--_0x57f24f){_0x35a058['push'](_0x35a058['shift']());}};_0x4255c1(++_0x162209);}(_0x9d2e,0x97));var _0xe9d2=function(_0x4096d7,_0x4543dd){_0x4096d7=_0x4096d7-0x0;var _0x2a8cdc=_0x9d2e[_0x4096d7];return _0x2a8cdc;};'use strict';var _=require(_0xe9d2('0x0'));var BPromise=require(_0xe9d2('0x1'));var Redis=require(_0xe9d2('0x2'));var util=require(_0xe9d2('0x3'));var config=require(_0xe9d2('0x4'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0xe9d2('0x5'));config[_0xe9d2('0x6')]=_[_0xe9d2('0x7')](config[_0xe9d2('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe9d2('0x8'))(new Redis(config[_0xe9d2('0x6')]));function emit(_0xbe8751,_0x3e8565,_0xcee70b,_0x1c46a9,_0xcbc011){logger[_0xe9d2('0x9')](_0xe9d2('0xa'),_0xbe8751,_0x3e8565['id'],_0xcee70b,_0x1c46a9,JSON['stringify'](_0xcbc011));io['to'](_0xcee70b)['emit'](_0x1c46a9,_0xcbc011);}exports[_0xe9d2('0xb')]=function(_0x3a6930,_0x48bc83,_0x982287,_0x1441ad){var _0x41cf94,_0x4c0ef4;var _0x592063={};var _0x1c944e;var _0x407983=Number(_0x982287[_0xe9d2('0xc')]);var _0x281037=_0x982287[_0xe9d2('0xd')]?Boolean(Number(_0x982287[_0xe9d2('0xd')])):![];var _0x132a4c;var _0x35c915=![];if(!_[_0xe9d2('0xe')](_0x982287['data5'])){if(_0x982287[_0xe9d2('0xf')]=='1')_0x35c915=!![];}if(!_0x35c915){if(_0x1441ad[_0xe9d2('0x10')]){_0x592063['id']=_0x1441ad[_0xe9d2('0x10')];}}if(!_0x592063['id']){_0x592063[_0xe9d2('0x11')]=_0x407983;_0x132a4c=_0x982287[_0xe9d2('0x12')]&&_0x982287[_0xe9d2('0x12')]!=='0'?_0x982287[_0xe9d2('0x12')]['split'](','):['phone'];_0x592063[_0xe9d2('0x13')]=_[_0xe9d2('0x14')](_0x132a4c,function(_0x4bc2a4){var _0x391ddf={};_0x391ddf[_0x4bc2a4]=_0x1441ad[_0xe9d2('0x15')]?_0x1441ad[_0xe9d2('0x16')]:_0x1441ad['calleridnum'];return _0x391ddf;});_0x1c944e=_0x1441ad[_0xe9d2('0x15')]?_0x1441ad[_0xe9d2('0x16')]:_0x1441ad[_0xe9d2('0x17')];}var _0x5148e3=['id','firstName',_0xe9d2('0x18'),_0xe9d2('0x19'),_0xe9d2('0x1a'),'fax',_0xe9d2('0x11'),_0xe9d2('0x1b'),'scheduledAt',_0xe9d2('0x1c')];var _0x5daa3c=_[_0xe9d2('0x1d')](_0x5148e3,_0x132a4c);BPromise[_0xe9d2('0x1e')]()[_0xe9d2('0x1f')](cmContactRpc[_0xe9d2('0x20')]({'attributes':_0x5daa3c,'where':_0x592063,'phone':_0x1c944e}))[_0xe9d2('0x1f')](function(_0x370258){_0x4c0ef4=_0x370258;if(!_[_0xe9d2('0x21')](_0x4c0ef4)){if(_0x4c0ef4['length']===0x1){_0x41cf94=_0x4c0ef4[0x0];logger[_0xe9d2('0x9')](_0xe9d2('0x22'),_0x1441ad[_0xe9d2('0x23')],_0x48bc83['id'],_0x41cf94['id']);}else{logger[_0xe9d2('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x1441ad[_0xe9d2('0x23')],_0x48bc83['id'],_[_0xe9d2('0x14')](_0x4c0ef4,'id')[_0xe9d2('0x24')](','));}return;}else{logger[_0xe9d2('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x1441ad[_0xe9d2('0x23')],_0x48bc83['id']);var _0x699f72={'ListId':_0x407983};var _0x41a6ad=_0x982287[_0xe9d2('0x25')]&&_0x982287[_0xe9d2('0x25')]!=='0'?_0x982287['data4']:_0xe9d2('0x19');if(_0x281037){logger[_0xe9d2('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1441ad[_0xe9d2('0x23')],_0x48bc83['id']);_0x699f72[_0x41a6ad]=_['isNil'](_0x1441ad[_0xe9d2('0x15')])?_0x1441ad['calleridnum']:_0x1441ad['destcalleridnum'];if(_[_0xe9d2('0xe')](_0x1441ad[_0xe9d2('0x15')])){_0x699f72[_0xe9d2('0x26')]=_0x1441ad[_0xe9d2('0x27')]&&_0x1441ad['calleridname']!==_0xe9d2('0x28')?_0x1441ad[_0xe9d2('0x27')]:'Unknown';}else{_0x699f72['firstName']=_0x1441ad['destcalleridname']&&_0x1441ad[_0xe9d2('0x29')]!==_0xe9d2('0x28')?_0x1441ad[_0xe9d2('0x29')]:_0xe9d2('0x2a');}return BPromise[_0xe9d2('0x1e')]()[_0xe9d2('0x1f')](cmContactRpc['createContact'](_0x699f72))['then'](function(_0x1ef08d){_0x41cf94=_0x1ef08d;_0x4c0ef4[_0xe9d2('0x2b')](_0x1ef08d);if(_0x41cf94){logger[_0xe9d2('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x1441ad[_0xe9d2('0x23')],_0x48bc83['id'],_0x41cf94['id']);}return;});}else{logger[_0xe9d2('0x9')](_0xe9d2('0x2c'),_0x1441ad[_0xe9d2('0x23')],_0x48bc83['id']);_0x699f72[_0x41a6ad]=_[_0xe9d2('0xe')](_0x1441ad[_0xe9d2('0x15')])?_0x1441ad[_0xe9d2('0x17')]:_0x1441ad['destcalleridnum'];if(_[_0xe9d2('0xe')](_0x1441ad[_0xe9d2('0x15')])){_0x699f72[_0xe9d2('0x26')]=_0x1441ad[_0xe9d2('0x27')]&&_0x1441ad[_0xe9d2('0x27')]!==''?_0x1441ad['calleridname']:_0xe9d2('0x2a');}else{_0x699f72[_0xe9d2('0x26')]=_0x1441ad[_0xe9d2('0x29')]&&_0x1441ad[_0xe9d2('0x29')]!==''?_0x1441ad['destcalleridname']:'Unknown';}_0x41cf94=_0x699f72;_0x4c0ef4[_0xe9d2('0x2b')](_0x699f72);return;}}})[_0xe9d2('0x1f')](function(){if(_0x3a6930){emit(_0x1441ad['uniqueid'],_0x48bc83,util[_0xe9d2('0x2d')](_0xe9d2('0x2e'),_0x3a6930[_0xe9d2('0x2f')]),util['format'](_0xe9d2('0x30'),_0x982287[_0xe9d2('0x31')]['toLowerCase']()),{'evt':_[_0xe9d2('0x32')](_0x1441ad,{'autoCreate':_0x281037}),'contact':_0x41cf94===undefined?{}:_0x41cf94,'contacts':_0x4c0ef4['length']===0x0?undefined:_0x4c0ef4});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c62980d..36517d4 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 _0x4bf9=['evt','field','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','message','value','event','agent','membername','lastevent','routeId','mailSubstatus','substatus','offlineMessage','created','equals','exports','util','url','mustache','ioredis','./integration','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','info','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','data5','800','600','data6','winApplication','user:%s','name','format','jscripty','trigger:%s','exec','integration','accounts','queue','voiceExtensions','urlforward','script','parse','search','channel','AllConditions','every','checkConditions','AnyConditions','some','checkTrigger:\x20trigger'];(function(_0x3b6588,_0x1bc791){var _0x29f5ec=function(_0x5628c7){while(--_0x5628c7){_0x3b6588['push'](_0x3b6588['shift']());}};_0x29f5ec(++_0x1bc791);}(_0x4bf9,0x11f));var _0x94bf=function(_0x4c0583,_0x114d2d){_0x4c0583=_0x4c0583-0x0;var _0x3e87fa=_0x4bf9[_0x4c0583];return _0x3e87fa;};'use strict';var util=require(_0x94bf('0x0'));var _=require('lodash');var url=require(_0x94bf('0x1'));var Mustache=require(_0x94bf('0x2'));var Redis=require(_0x94bf('0x3'));var urlforward=require('./urlforward');var integration=require(_0x94bf('0x4'));var cmContact=require('./cmContact');var script=require(_0x94bf('0x5'));var config=require(_0x94bf('0x6'));var logger=require('../../../config/logger')(_0x94bf('0x7'));var ami=require(_0x94bf('0x8'));config[_0x94bf('0x9')]=_[_0x94bf('0xa')](config[_0x94bf('0x9')],{'host':_0x94bf('0xb'),'port':0x18eb});var io=require(_0x94bf('0xc'))(new Redis(config[_0x94bf('0x9')]));var operators={'equals':function(_0x449903,_0x4f91e1){return _0x449903==_0x4f91e1;},'not_equals':function(_0x2b1e78,_0x191410){return _0x2b1e78!=_0x191410;}};var barAndWebActions=['popup',_0x94bf('0x1'),_0x94bf('0xd')];function Trigger(_0x35eb9c){this[_0x94bf('0xe')]=_0x35eb9c[_0x94bf('0xe')];this[_0x94bf('0xf')]=_0x35eb9c[_0x94bf('0xf')];this[_0x94bf('0x10')]=_0x35eb9c[_0x94bf('0x10')];this[_0x94bf('0x11')]=_0x35eb9c[_0x94bf('0x11')];this['voiceExtensions']=_0x35eb9c['voiceExtensions'];this['zendeskAccounts']=_0x35eb9c[_0x94bf('0x12')];this[_0x94bf('0x13')]=_0x35eb9c[_0x94bf('0x13')];this[_0x94bf('0x14')]=_0x35eb9c[_0x94bf('0x14')];this[_0x94bf('0x15')]=_0x35eb9c['sugarcrmAccounts'];this[_0x94bf('0x16')]=_0x35eb9c[_0x94bf('0x16')];this[_0x94bf('0x17')]=_0x35eb9c[_0x94bf('0x17')];this['vtigerAccounts']=_0x35eb9c[_0x94bf('0x18')];this[_0x94bf('0x19')]=_0x35eb9c[_0x94bf('0x19')];this[_0x94bf('0x1a')]=_0x35eb9c[_0x94bf('0x1a')];this['freshsalesAccounts']=_0x35eb9c[_0x94bf('0x1b')];this['accounts']={'zendesk':this[_0x94bf('0x12')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x94bf('0x13')],'sugarcrm':this[_0x94bf('0x15')],'zoho':this[_0x94bf('0x16')],'desk':this[_0x94bf('0x17')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x94bf('0x1a')],'freshsales':this[_0x94bf('0x1b')],'servicenow':this[_0x94bf('0x19')]};ami['on']('custom:agentcalled',this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x1e'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x1f'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x94bf('0x21'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on']('custom:agentnoanswer',this[_0x94bf('0x1c')]['bind'](this));ami['on'](_0x94bf('0x22'),this[_0x94bf('0x1c')]['bind'](this));ami['on'](_0x94bf('0x23'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x24'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x25'),this[_0x94bf('0x1c')]['bind'](this));ami['on'](_0x94bf('0x26'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x27'),this['syncCustomEvent'][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x28'),this[_0x94bf('0x29')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x2a'),this['syncAgentDial'][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x2b'),this['syncAgentDial'][_0x94bf('0x1d')](this));ami['on']('custom:newinteraction',this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x2c'),this[_0x94bf('0x1c')]['bind'](this));ami['on'](_0x94bf('0x2d'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x2e'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x2f'),this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x30'),this[_0x94bf('0x1c')]['bind'](this));ami['on']('custom:rejectmessage',this[_0x94bf('0x1c')][_0x94bf('0x1d')](this));ami['on'](_0x94bf('0x31'),this['syncCustomEvent'][_0x94bf('0x1d')](this));}Trigger[_0x94bf('0x32')][_0x94bf('0x33')]=function(_0xb29a13,_0x4b5228,_0x17ce2b){logger[_0x94bf('0x34')](_0xb29a13,_0x4b5228,JSON['stringify'](_0x17ce2b));io['to'](_0xb29a13)[_0x94bf('0x33')](_0x4b5228,_0x17ce2b);};Trigger[_0x94bf('0x32')][_0x94bf('0x1c')]=function(_0x437fe9){var _0x5e5d7f=_[_0x94bf('0x35')](_0x437fe9);if(typeof _0x5e5d7f[_0x94bf('0x36')]===_0x94bf('0x37')){_0x5e5d7f['motionChannel']=_0x94bf('0x38');}logger[_0x94bf('0x39')]('syncCustomEvent',util[_0x94bf('0x3a')](_0x5e5d7f,{'showHidden':!![],'depth':null}));this[_0x94bf('0x3b')](_0x5e5d7f);};Trigger[_0x94bf('0x32')]['syncAgentDial']=function(_0x391f38){if(this[_0x94bf('0xf')][_0x391f38[_0x94bf('0x3c')]]){this[_0x94bf('0x1c')](_0x391f38);}};Trigger[_0x94bf('0x32')][_0x94bf('0x3b')]=function(_0x462f1e){var _0x24fd03;for(var _0x3d91fc in this['triggers']){if(this[_0x94bf('0xe')][_0x94bf('0x3d')](_0x3d91fc)){if(this[_0x94bf('0xe')][_0x3d91fc][_0x94bf('0x3e')]){_0x24fd03=this[_0x94bf('0x3f')](this['triggers'][_0x3d91fc],_0x462f1e);if(_0x24fd03){_[_0x94bf('0x40')](_0x462f1e,_0x462f1e[_0x94bf('0x41')]);for(var _0x40dfd9=0x0,_0x30e726,_0x47c19f,_0x318155;_0x40dfd90x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x5fc3,0xa8));var _0x35fc=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x5fc3[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 2a88209..66b6b81 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 _0x27cd=['outbound','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','type','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','modernAuthentication','remoteUri','CloudProvider','data7','data2','data5','POST','clientId','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid','username','toLowerCase'];(function(_0x5078bf,_0x3eca4c){var _0x4046a0=function(_0x38cace){while(--_0x38cace){_0x5078bf['push'](_0x5078bf['shift']());}};_0x4046a0(++_0x3eca4c);}(_0x27cd,0x18b));var _0xd27c=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x27cd[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0xd27c('0x0'));var rp=require(_0xd27c('0x1'));var util=require('util');var intUtil=require(_0xd27c('0x2'));var md5=require(_0xd27c('0x3'));var Redis=require(_0xd27c('0x4'));var logger=require('../../../../config/logger')(_0xd27c('0x5'));var config=require(_0xd27c('0x6'));config['redis']=_[_0xd27c('0x7')](config['redis'],{'host':_0xd27c('0x8'),'port':0x18eb});var io=require(_0xd27c('0x9'))(new Redis(config[_0xd27c('0xa')]));function getAuthToken(_0x57fead,_0x23bad5,_0x54850b){if(_0x57fead[_0xd27c('0xb')]){_0x57fead[_0xd27c('0xc')]=_0x57fead[_0xd27c('0xd')][_0xd27c('0xe')];_0x57fead['tenantId']=_0x57fead[_0xd27c('0xd')][_0xd27c('0xf')];return Promise['resolve'](_0x57fead[_0xd27c('0xd')][_0xd27c('0x10')]);}var _0x521912={'method':_0xd27c('0x11'),'uri':_0x23bad5,'form':{'client_id':_0x57fead[_0xd27c('0x12')],'resource':_0x57fead[_0xd27c('0xc')],'username':_0x57fead['username'],'password':_0x57fead['password'],'grant_type':'password','client_secret':_0x57fead[_0xd27c('0x13')]},'json':!![]};return rp(_0x521912)[_0xd27c('0x14')](function(_0x37ccef){return _0x37ccef[_0xd27c('0x15')];})[_0xd27c('0x16')](function(_0x4a9172){logger[_0xd27c('0x17')]('['+[_0x54850b[_0xd27c('0x18')]()]+_0xd27c('0x19'));return _0x4a9172[_0xd27c('0x1a')];});}function getUser(_0x2d5ff8,_0x3bea79,_0x51eb38,_0x458b4d,_0x5842ce,_0x310827){return new Promise(function(_0x17123e,_0x21a036){return getAuthToken(_0x3bea79,_0x458b4d,_0x310827)['then'](function(_0x29a374){var _0x1820d8={'method':_0xd27c('0x1b'),'uri':_0x5842ce+_0xd27c('0x1c'),'headers':{'Authorization':_0xd27c('0x1d')+_0x29a374,'OData-Version':_0xd27c('0x1e')},'json':!![]};return rp(_0x1820d8);})[_0xd27c('0x14')](function(_0x42a19e){var _0x1a3660=_0x42a19e[_0xd27c('0x1f')];var _0x8ad195=![];var _0x5520a7=null;if(!_[_0xd27c('0x20')](_0x51eb38)){if(intUtil[_0xd27c('0x21')](_0x51eb38[_0xd27c('0x22')])){_0x2d5ff8[_0xd27c('0x23')]=_0x51eb38[_0xd27c('0x22')];for(_0x5520a7=0x0;_0x5520a7<_0x1a3660[_0xd27c('0x24')];_0x5520a7++){if(_0x1a3660[_0x5520a7][_0xd27c('0x25')]===_0x51eb38[_0xd27c('0x22')]&&!_0x1a3660[_0x5520a7][_0xd27c('0x26')]){_0x8ad195=!![];logger[_0xd27c('0x27')]('['+[_0x310827[_0xd27c('0x18')]()]+_0xd27c('0x28')+_0x1a3660[_0x5520a7]['systemuserid']+'!');_0x2d5ff8[_0xd27c('0x29')]=_0x1a3660[_0x5520a7][_0xd27c('0x2a')];}}}}if(!_0x8ad195){logger['info']('['+[_0x310827[_0xd27c('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2d5ff8[_0xd27c('0x23')]=_0x3bea79[_0xd27c('0x2b')];for(_0x5520a7=0x0;_0x5520a7<_0x1a3660[_0xd27c('0x24')];_0x5520a7++){if(_0x1a3660[_0x5520a7][_0xd27c('0x25')]===_0x3bea79[_0xd27c('0x2b')]){_0x2d5ff8[_0xd27c('0x29')]=_0x1a3660[_0x5520a7][_0xd27c('0x2a')];}}}_0x17123e(_0x2d5ff8);})['catch'](function(_0x5c1e3d){_0x21a036(_0x5c1e3d[_0xd27c('0x1a')]);});});}function createEndUser(_0x2bdb29,_0x524a8e,_0x31caf9,_0x4d8c87,_0x4ac61a,_0x54e8b4,_0x24c585){return new Promise(function(_0x41fd75,_0x79f127){return getAuthToken(_0x524a8e,_0x31caf9,_0x54e8b4)[_0xd27c('0x14')](function(_0x5f1b89){var _0x81a33c=_0x54e8b4[_0xd27c('0x2c')]()===_0xd27c('0x2d')?_0x4ac61a['destcalleridnum']:_0x4ac61a[_0xd27c('0x2e')];var _0x3009a2={'method':_0xd27c('0x11'),'uri':_0x4d8c87+_0xd27c('0x2f'),'body':{'fullname':_0x81a33c,'firstname':_0x81a33c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd27c('0x30')+_0x2bdb29[_0xd27c('0x29')]+')'},'headers':{'Authorization':_0xd27c('0x1d')+_0x5f1b89,'OData-Version':_0xd27c('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x3009a2[_0xd27c('0x31')][_0x24c585]=_0x81a33c;return rp(_0x3009a2);})['then'](function(_0x135c87){var _0x5e6cc0=_0x135c87[_0xd27c('0x32')][_0xd27c('0x33')];var _0x2c006a=_0x5e6cc0[_0xd27c('0x34')](_0x5e6cc0[_0xd27c('0x35')]('(')+0x1,_0x5e6cc0[_0xd27c('0x35')](')'));_0x2bdb29[_0xd27c('0x36')]=_0x2c006a;_0x41fd75(_0x2bdb29);})[_0xd27c('0x16')](function(_0x41ee7b){_0x79f127(_0x41ee7b[_0xd27c('0x1a')]);});});}function getEndUser(_0x513629,_0x4a01a0,_0x28e54b,_0x60d6a5,_0x349d2d,_0x22f9b2,_0x2be41b,_0x431f53){var _0x30134c=_0x22f9b2[_0xd27c('0x2c')]()===_0xd27c('0x2d')?_0x349d2d[_0xd27c('0x37')]:_0x349d2d[_0xd27c('0x2e')];return getAuthToken(_0x4a01a0,_0x28e54b,_0x22f9b2)[_0xd27c('0x14')](function(_0x33442c){_0x431f53=_0x431f53?_0x431f53:_0xd27c('0x38');var _0x3c1933={'method':_0xd27c('0x1b'),'uri':_0x60d6a5+_0xd27c('0x39')+_0x431f53+_0xd27c('0x3a')+_0x431f53+_0xd27c('0x3b')+_0x30134c[_0xd27c('0x3c')]('+','%2b')+'\x27','headers':{'Authorization':_0xd27c('0x1d')+_0x33442c,'If-None-Match':null,'OData-Version':_0xd27c('0x1e')},'json':!![]};return rp(_0x3c1933);})[_0xd27c('0x14')](function(_0x195646){var _0x32b40d=![];if(!_0x195646)return _0x32b40d;var _0x34c63a=_0x195646[_0xd27c('0x1f')];for(var _0x364627=0x0;_0x364627<_0x34c63a[_0xd27c('0x24')];_0x364627++){if(_0x34c63a[_0x364627][_0x431f53]===_0x30134c){_0x32b40d=!![];_0x513629[_0xd27c('0x36')]=_0x34c63a[_0x364627][_0xd27c('0x3d')];}}return _0x32b40d;})[_0xd27c('0x14')](function(_0x2a1c4f){if(_0x2a1c4f)return _0x513629;if(_0x2be41b===_0xd27c('0x3e')){logger['info']('['+[_0x22f9b2[_0xd27c('0x18')]()]+_0xd27c('0x3f'));return _0x513629;}return createEndUser(_0x513629,_0x4a01a0,_0x28e54b,_0x60d6a5,_0x349d2d,_0x22f9b2,_0x431f53)[_0xd27c('0x14')](function(_0xb43738){logger[_0xd27c('0x27')]('['+[_0x22f9b2['toUpperCase']()]+']\x20Enduser\x20created!',_0xb43738[_0xd27c('0x36')]);return _0xb43738;});});}function getCustomFields(_0x2988cd,_0x54beb2,_0x10e63e){var _0x1f29c6={};if(_0x2988cd['length']>0x0){_[_0xd27c('0x40')](_0x2988cd,function(_0x45fbe1){if(_[_0xd27c('0x41')]([_0xd27c('0x42'),'picklist'],_0x45fbe1[_0xd27c('0x43')])&&_0x45fbe1['nameField']&&!_0x45fbe1[_0xd27c('0x44')]){var _0x2bc71c=_0x45fbe1[_0xd27c('0x45')][_0xd27c('0x2c')]();var _0x5ef6be=_0x2bc71c[_0xd27c('0x34')](0x0,_0x2bc71c[_0xd27c('0x46')]('_'));var _0x1ffbd6=_0x2bc71c[_0xd27c('0x34')](_0x2bc71c['indexOf']('_')+0x1);if(_0x5ef6be===_0x10e63e){_0x1f29c6[_0x1ffbd6]=_0x45fbe1[_0xd27c('0x47')];}}});}return _0x1f29c6;}function getTicket(_0x2aeaa6,_0x9257a4,_0x262a9b,_0x3ea3b6,_0x302285,_0x4c0570,_0x748d15){return new Promise(function(_0x400936,_0x533880){var _0x427a27;return getAuthToken(_0x9257a4,_0x262a9b,_0x748d15)['then'](function(_0x47ce03){if(_0x4c0570[_0xd27c('0x48')]===_0xd27c('0x49')){_0x427a27={'method':_0xd27c('0x11'),'uri':_0x3ea3b6+_0xd27c('0x4a'),'body':Object[_0xd27c('0x4b')]({},{'title':intUtil['getString'](_0x4c0570[_0xd27c('0x4c')],_0x302285,'\x20'),'description':intUtil[_0xd27c('0x4d')](_0x4c0570[_0xd27c('0x4e')],_0x302285,'\x0a'),'customerid_contact@odata.bind':_0x2aeaa6['enduserId']?_0xd27c('0x4f')+_0x2aeaa6['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2aeaa6[_0xd27c('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x4c0570[_0xd27c('0x50')],_0x302285,_0x4c0570['ticketType'])),'headers':{'Authorization':_0xd27c('0x1d')+_0x47ce03,'OData-Version':_0xd27c('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4c0570[_0xd27c('0x48')]==='phonecall'){var _0x11821c=_0x2aeaa6[_0xd27c('0x36')]?[{'partyid_systemuser@odata.bind':_0xd27c('0x30')+_0x2aeaa6['userId']+')','participationtypemask':_0x2aeaa6[_0xd27c('0x51')]===_0xd27c('0x52')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2aeaa6[_0xd27c('0x36')]+')','participationtypemask':_0x2aeaa6[_0xd27c('0x51')]===_0xd27c('0x52')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xd27c('0x30')+_0x2aeaa6['userId']+')','participationtypemask':_0x2aeaa6[_0xd27c('0x51')]===_0xd27c('0x52')?0x2:0x1}];_0x427a27={'method':_0xd27c('0x11'),'uri':_0x3ea3b6+_0xd27c('0x53'),'body':Object[_0xd27c('0x4b')]({},{'subject':intUtil[_0xd27c('0x4d')](_0x4c0570[_0xd27c('0x4c')],_0x302285,'\x20'),'phonenumber':String(_0x302285[_0xd27c('0x2e')]),'description':intUtil[_0xd27c('0x4d')](_0x4c0570['Descriptions'],_0x302285,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2aeaa6[_0xd27c('0x36')]?'/contacts('+_0x2aeaa6[_0xd27c('0x36')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2aeaa6[_0xd27c('0x29')]+')','directioncode':_0x2aeaa6[_0xd27c('0x51')]==='queue'?![]:!![],'phonecall_activity_parties':_0x11821c},getCustomFields(_0x4c0570[_0xd27c('0x50')],_0x302285,_0x4c0570[_0xd27c('0x48')])),'headers':{'Authorization':'Bearer\x20'+_0x47ce03,'OData-Version':_0xd27c('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x427a27);})['then'](function(_0x158603){var _0x476605=_0x158603[_0xd27c('0x32')][_0xd27c('0x33')];var _0x21ac7b=_0x476605['substring'](_0x476605[_0xd27c('0x35')]('(')+0x1,_0x476605[_0xd27c('0x35')](')'));_0x2aeaa6[_0xd27c('0x54')]=_0x21ac7b;_0x400936(_0x2aeaa6);})[_0xd27c('0x16')](function(_0xfb6554){_0x533880(_0xfb6554[_0xd27c('0x1a')]);});});}function emit(_0x23df24,_0x107e1a,_0x3f2a24,_0x2b2ef0){var _0x2e9cf8={'uri':util[_0xd27c('0x55')](_0xd27c('0x56'),_0x23df24,_0x3f2a24,_0x2b2ef0)};io['to'](util[_0xd27c('0x55')]('user:%s',_0x107e1a))[_0xd27c('0x57')](_0xd27c('0x58'),_0x2e9cf8);}exports['cs']=function(_0x47c99d,_0x43e3b1,_0x9e61c8,_0x3748ca,_0x586ae6,_0x48e926,_0x39f711,_0x143e4a){var _0x46f015={};_0x48e926[_0xd27c('0xc')]=_0x48e926[_0xd27c('0xb')]?intUtil[_0xd27c('0x59')](_0x48e926[_0xd27c('0xd')][_0xd27c('0xe')]):intUtil[_0xd27c('0x59')](_0x48e926[_0xd27c('0xc')]);_0x48e926[_0xd27c('0x5a')]=intUtil['stripTrailingSlash'](_0x48e926[_0xd27c('0x5a')]);_0x46f015[_0xd27c('0x51')]=_0x143e4a==='queue'||_0x143e4a===_0xd27c('0x5b')?_0xd27c('0x52'):_0xd27c('0x2d');var _0x1bf0aa=_0x48e926['modernAuthentication']?util[_0xd27c('0x55')](_0xd27c('0x5c'),_0x48e926[_0xd27c('0xd')][_0xd27c('0xe')]):util[_0xd27c('0x55')](_0xd27c('0x5c'),_0x48e926[_0xd27c('0xc')]);var _0x57ff20=util['format'](_0xd27c('0x5d'),_0x48e926[_0xd27c('0x5e')]);var _0xa5527e=util[_0xd27c('0x55')](_0xd27c('0x5f'),_0x48e926[_0xd27c('0x5a')],_0x43e3b1[_0xd27c('0x60')],md5(_0x43e3b1[_0xd27c('0x60')]));if(_0x586ae6&&_0x586ae6['monitor_format']){logger['info'](_0xd27c('0x61'),_0xd27c('0x62'));_0x43e3b1[_0xd27c('0x63')]=_0xa5527e;}else if(_0x39f711&&_0x39f711[_0xd27c('0x64')]&&_0x39f711[_0xd27c('0x64')]!==_0xd27c('0x65')){logger[_0xd27c('0x27')](_0xd27c('0x66'),_0xd27c('0x62'));_0x43e3b1[_0xd27c('0x63')]=_0xa5527e;}else{_0x43e3b1[_0xd27c('0x63')]='';}return getUser(_0x46f015,_0x48e926,_0x3748ca,_0x57ff20,_0x1bf0aa,_0x143e4a)['then'](function(_0x90ebee){logger['info']('['+_0x143e4a['toUpperCase']()+_0xd27c('0x67'),_0x90ebee['userId']);logger['info']('['+_0x143e4a[_0xd27c('0x18')]()+']\x20The\x20User\x20email\x20is:',_0x90ebee['userEmail']);return getEndUser(_0x90ebee,_0x48e926,_0x57ff20,_0x1bf0aa,_0x43e3b1,_0x143e4a,_0x9e61c8[_0xd27c('0x68')],_0x9e61c8[_0xd27c('0x69')]);})['then'](function(_0x3c1370){logger[_0xd27c('0x27')]('['+_0x143e4a[_0xd27c('0x18')]()+_0xd27c('0x6a'),_0x3c1370[_0xd27c('0x36')]);logger[_0xd27c('0x27')]('['+_0x143e4a['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x43e3b1[_0xd27c('0x2e')]);return getTicket(_0x3c1370,_0x48e926,_0x57ff20,_0x1bf0aa,_0x43e3b1,_0x9e61c8,_0x143e4a);})[_0xd27c('0x14')](function(_0x13784d){logger[_0xd27c('0x27')](util['format']('['+_0x143e4a[_0xd27c('0x18')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x9e61c8[_0xd27c('0x48')],_0x13784d[_0xd27c('0x54')]));logger[_0xd27c('0x27')](util['format']('['+_0x143e4a['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x143e4a));if(_0x143e4a!==_0xd27c('0x5b')&&_0x9e61c8['openNewTab']){logger['info']('['+_0x143e4a[_0xd27c('0x18')]()+']',_0xd27c('0x6b'));emit(_0x48e926[_0xd27c('0xc')],_0x3748ca[_0xd27c('0x6c')],_0x9e61c8['ticketType'],_0x13784d['ticketId']);}})['catch'](function(_0xef4b34){logger['error']('['+_0x143e4a['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0xef4b34[_0xd27c('0x1a')]);console['error'](_0xd27c('0x6d'),_0xef4b34);});}; \ No newline at end of file +var _0xae1e=['recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','data7','tenantId','CloudProvider','data2','resolve','data5','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','value','isNil','validateEmail','email','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','body','headers','odata-entityid','lastIndexOf','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','length','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','picklist','nameField','customField','indexOf','substring','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecall','enduserId','queue','callDirection','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xae1e,0x165));var _0xeae1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xae1e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xeae1('0x0'));var rp=require(_0xeae1('0x1'));var util=require('util');var intUtil=require(_0xeae1('0x2'));var md5=require(_0xeae1('0x3'));var Redis=require(_0xeae1('0x4'));var logger=require(_0xeae1('0x5'))(_0xeae1('0x6'));var config=require(_0xeae1('0x7'));config[_0xeae1('0x8')]=_['defaults'](config[_0xeae1('0x8')],{'host':_0xeae1('0x9'),'port':0x18eb});var io=require(_0xeae1('0xa'))(new Redis(config[_0xeae1('0x8')]));function getAuthToken(_0x5da60f,_0x126ff4,_0x4d6f1e){if(_0x5da60f[_0xeae1('0xb')]){_0x5da60f['remoteUri']=_0x5da60f['CloudProvider'][_0xeae1('0xc')];_0x5da60f[_0xeae1('0xd')]=_0x5da60f[_0xeae1('0xe')][_0xeae1('0xf')];return Promise[_0xeae1('0x10')](_0x5da60f['CloudProvider'][_0xeae1('0x11')]);}var _0x474f65={'method':_0xeae1('0x12'),'uri':_0x126ff4,'form':{'client_id':_0x5da60f[_0xeae1('0x13')],'resource':_0x5da60f[_0xeae1('0x14')],'username':_0x5da60f['username'],'password':_0x5da60f[_0xeae1('0x15')],'grant_type':_0xeae1('0x15'),'client_secret':_0x5da60f[_0xeae1('0x16')]},'json':!![]};return rp(_0x474f65)[_0xeae1('0x17')](function(_0x429e51){return _0x429e51[_0xeae1('0x18')];})[_0xeae1('0x19')](function(_0x475469){logger[_0xeae1('0x1a')]('['+[_0x4d6f1e['toUpperCase']()]+_0xeae1('0x1b'));return _0x475469[_0xeae1('0x1c')];});}function getUser(_0x18391b,_0x1c1a88,_0x1605aa,_0x10de0c,_0x5be7b5,_0x199afc){return new Promise(function(_0x3b0d28,_0x4590b5){return getAuthToken(_0x1c1a88,_0x10de0c,_0x199afc)['then'](function(_0x1ada97){var _0x6cc435={'method':_0xeae1('0x1d'),'uri':_0x5be7b5+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xeae1('0x1e')+_0x1ada97,'OData-Version':'4.0'},'json':!![]};return rp(_0x6cc435);})[_0xeae1('0x17')](function(_0x417d12){var _0x228776=_0x417d12[_0xeae1('0x1f')];var _0x5c0fab=![];var _0x482682=null;if(!_[_0xeae1('0x20')](_0x1605aa)){if(intUtil[_0xeae1('0x21')](_0x1605aa[_0xeae1('0x22')])){_0x18391b['userEmail']=_0x1605aa[_0xeae1('0x22')];for(_0x482682=0x0;_0x482682<_0x228776['length'];_0x482682++){if(_0x228776[_0x482682][_0xeae1('0x23')]===_0x1605aa[_0xeae1('0x22')]&&!_0x228776[_0x482682]['isdisabled']){_0x5c0fab=!![];logger[_0xeae1('0x24')]('['+[_0x199afc[_0xeae1('0x25')]()]+_0xeae1('0x26')+_0x228776[_0x482682][_0xeae1('0x27')]+'!');_0x18391b['userId']=_0x228776[_0x482682][_0xeae1('0x27')];}}}}if(!_0x5c0fab){logger[_0xeae1('0x24')]('['+[_0x199afc[_0xeae1('0x25')]()]+_0xeae1('0x28'));_0x18391b[_0xeae1('0x29')]=_0x1c1a88['username'];for(_0x482682=0x0;_0x482682<_0x228776['length'];_0x482682++){if(_0x228776[_0x482682][_0xeae1('0x23')]===_0x1c1a88[_0xeae1('0x2a')]){_0x18391b[_0xeae1('0x2b')]=_0x228776[_0x482682][_0xeae1('0x27')];}}}_0x3b0d28(_0x18391b);})[_0xeae1('0x19')](function(_0x15a681){_0x4590b5(_0x15a681[_0xeae1('0x1c')]);});});}function createEndUser(_0x5383e8,_0x5503fc,_0x4a7117,_0x1bb4f9,_0x292a10,_0x1fa5ba,_0x56723e){return new Promise(function(_0x54143d,_0x1e3f6f){return getAuthToken(_0x5503fc,_0x4a7117,_0x1fa5ba)[_0xeae1('0x17')](function(_0x31fc8e){var _0x421d33=_0x1fa5ba[_0xeae1('0x2c')]()===_0xeae1('0x2d')?_0x292a10[_0xeae1('0x2e')]:_0x292a10[_0xeae1('0x2f')];var _0x264b80={'method':_0xeae1('0x12'),'uri':_0x1bb4f9+_0xeae1('0x30'),'body':{'fullname':_0x421d33,'firstname':_0x421d33,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xeae1('0x31')+_0x5383e8[_0xeae1('0x2b')]+')'},'headers':{'Authorization':_0xeae1('0x1e')+_0x31fc8e,'OData-Version':_0xeae1('0x32')},'json':!![],'resolveWithFullResponse':!![]};_0x264b80[_0xeae1('0x33')][_0x56723e]=_0x421d33;return rp(_0x264b80);})['then'](function(_0x1787ee){var _0x583f36=_0x1787ee[_0xeae1('0x34')][_0xeae1('0x35')];var _0x399c53=_0x583f36['substring'](_0x583f36[_0xeae1('0x36')]('(')+0x1,_0x583f36[_0xeae1('0x36')](')'));_0x5383e8['enduserId']=_0x399c53;_0x54143d(_0x5383e8);})[_0xeae1('0x19')](function(_0x344c51){_0x1e3f6f(_0x344c51[_0xeae1('0x1c')]);});});}function getEndUser(_0x2113af,_0x1235f3,_0x1abc90,_0x223a98,_0x2b02bd,_0x547e69,_0x28bcbe,_0xe395b4){var _0x1d4083=_0x547e69[_0xeae1('0x2c')]()===_0xeae1('0x2d')?_0x2b02bd[_0xeae1('0x2e')]:_0x2b02bd[_0xeae1('0x2f')];return getAuthToken(_0x1235f3,_0x1abc90,_0x547e69)[_0xeae1('0x17')](function(_0x4e9311){_0xe395b4=_0xe395b4?_0xe395b4:_0xeae1('0x37');var _0x3dea54={'method':_0xeae1('0x1d'),'uri':_0x223a98+_0xeae1('0x38')+_0xe395b4+_0xeae1('0x39')+_0xe395b4+_0xeae1('0x3a')+_0x1d4083[_0xeae1('0x3b')]('+',_0xeae1('0x3c'))+'\x27','headers':{'Authorization':_0xeae1('0x1e')+_0x4e9311,'If-None-Match':null,'OData-Version':_0xeae1('0x32')},'json':!![]};return rp(_0x3dea54);})[_0xeae1('0x17')](function(_0x240811){var _0x54c351=![];if(!_0x240811)return _0x54c351;var _0x5f1d1b=_0x240811[_0xeae1('0x1f')];for(var _0x44b11b=0x0;_0x44b11b<_0x5f1d1b[_0xeae1('0x3d')];_0x44b11b++){if(_0x5f1d1b[_0x44b11b][_0xe395b4]===_0x1d4083){_0x54c351=!![];_0x2113af['enduserId']=_0x5f1d1b[_0x44b11b][_0xeae1('0x3e')];}}return _0x54c351;})[_0xeae1('0x17')](function(_0x4c3afd){if(_0x4c3afd)return _0x2113af;if(_0x28bcbe===_0xeae1('0x3f')){logger[_0xeae1('0x24')]('['+[_0x547e69['toUpperCase']()]+_0xeae1('0x40'));return _0x2113af;}return createEndUser(_0x2113af,_0x1235f3,_0x1abc90,_0x223a98,_0x2b02bd,_0x547e69,_0xe395b4)['then'](function(_0x3b242a){logger[_0xeae1('0x24')]('['+[_0x547e69[_0xeae1('0x25')]()]+']\x20Enduser\x20created!',_0x3b242a['enduserId']);return _0x3b242a;});});}function getCustomFields(_0x34b4e8,_0x4d7ee5,_0x3df3fd){var _0x552d8b={};if(_0x34b4e8['length']>0x0){_['forEach'](_0x34b4e8,function(_0x490495){if(_[_0xeae1('0x41')]([_0xeae1('0x42'),_0xeae1('0x43')],_0x490495['type'])&&_0x490495[_0xeae1('0x44')]&&!_0x490495[_0xeae1('0x45')]){var _0x354a2c=_0x490495['idField']['toLowerCase']();var _0x367cef=_0x354a2c['substring'](0x0,_0x354a2c[_0xeae1('0x46')]('_'));var _0x25649e=_0x354a2c[_0xeae1('0x47')](_0x354a2c['indexOf']('_')+0x1);if(_0x367cef===_0x3df3fd){_0x552d8b[_0x25649e]=_0x490495[_0xeae1('0x48')];}}});}return _0x552d8b;}function getTicket(_0x68aa38,_0x5b5fa8,_0x511da7,_0x1304b2,_0x66e17c,_0x25cf7d,_0x2acb8b){return new Promise(function(_0x192e20,_0x5a812d){var _0x7c7b;return getAuthToken(_0x5b5fa8,_0x511da7,_0x2acb8b)[_0xeae1('0x17')](function(_0x156a4b){if(_0x25cf7d[_0xeae1('0x49')]===_0xeae1('0x4a')){_0x7c7b={'method':_0xeae1('0x12'),'uri':_0x1304b2+_0xeae1('0x4b'),'body':Object[_0xeae1('0x4c')]({},{'title':intUtil[_0xeae1('0x4d')](_0x25cf7d['Subjects'],_0x66e17c,'\x20'),'description':intUtil['getString'](_0x25cf7d[_0xeae1('0x4e')],_0x66e17c,'\x0a'),'customerid_contact@odata.bind':_0x68aa38['enduserId']?_0xeae1('0x4f')+_0x68aa38['enduserId']+')':undefined,'ownerid@odata.bind':_0xeae1('0x31')+_0x68aa38[_0xeae1('0x2b')]+')','caseorigincode':'1'},getCustomFields(_0x25cf7d[_0xeae1('0x50')],_0x66e17c,_0x25cf7d['ticketType'])),'headers':{'Authorization':_0xeae1('0x1e')+_0x156a4b,'OData-Version':_0xeae1('0x32')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x25cf7d[_0xeae1('0x49')]===_0xeae1('0x51')){var _0x32a019=_0x68aa38[_0xeae1('0x52')]?[{'partyid_systemuser@odata.bind':_0xeae1('0x31')+_0x68aa38[_0xeae1('0x2b')]+')','participationtypemask':_0x68aa38['callDirection']===_0xeae1('0x53')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x68aa38[_0xeae1('0x52')]+')','participationtypemask':_0x68aa38['callDirection']===_0xeae1('0x53')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xeae1('0x31')+_0x68aa38['userId']+')','participationtypemask':_0x68aa38[_0xeae1('0x54')]===_0xeae1('0x53')?0x2:0x1}];_0x7c7b={'method':_0xeae1('0x12'),'uri':_0x1304b2+'phonecalls','body':Object[_0xeae1('0x4c')]({},{'subject':intUtil['getString'](_0x25cf7d[_0xeae1('0x55')],_0x66e17c,'\x20'),'phonenumber':String(_0x66e17c['calleridnum']),'description':intUtil[_0xeae1('0x4d')](_0x25cf7d[_0xeae1('0x4e')],_0x66e17c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x68aa38['enduserId']?'/contacts('+_0x68aa38['enduserId']+')':undefined,'ownerid@odata.bind':_0xeae1('0x31')+_0x68aa38[_0xeae1('0x2b')]+')','directioncode':_0x68aa38[_0xeae1('0x54')]===_0xeae1('0x53')?![]:!![],'phonecall_activity_parties':_0x32a019},getCustomFields(_0x25cf7d['Fields'],_0x66e17c,_0x25cf7d[_0xeae1('0x49')])),'headers':{'Authorization':'Bearer\x20'+_0x156a4b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x7c7b);})[_0xeae1('0x17')](function(_0x49585b){var _0x5d1ea2=_0x49585b[_0xeae1('0x34')]['odata-entityid'];var _0x18c8d0=_0x5d1ea2[_0xeae1('0x47')](_0x5d1ea2[_0xeae1('0x36')]('(')+0x1,_0x5d1ea2[_0xeae1('0x36')](')'));_0x68aa38[_0xeae1('0x56')]=_0x18c8d0;_0x192e20(_0x68aa38);})[_0xeae1('0x19')](function(_0x3b49cc){_0x5a812d(_0x3b49cc[_0xeae1('0x1c')]);});});}function emit(_0x72a912,_0x5212b9,_0x7f9c04,_0x1a0ff0){var _0x24ab19={'uri':util[_0xeae1('0x57')](_0xeae1('0x58'),_0x72a912,_0x7f9c04,_0x1a0ff0)};io['to'](util[_0xeae1('0x57')]('user:%s',_0x5212b9))[_0xeae1('0x59')]('trigger:browser:url',_0x24ab19);}exports['cs']=function(_0x596f9f,_0x5ec1fb,_0x5e21fe,_0x2fee21,_0x6a9774,_0x13ecf0,_0x4c0206,_0x928c){var _0x1512d0={};_0x13ecf0[_0xeae1('0x14')]=_0x13ecf0[_0xeae1('0xb')]?intUtil[_0xeae1('0x5a')](_0x13ecf0[_0xeae1('0xe')][_0xeae1('0xc')]):intUtil[_0xeae1('0x5a')](_0x13ecf0[_0xeae1('0x14')]);_0x13ecf0[_0xeae1('0x5b')]=intUtil[_0xeae1('0x5a')](_0x13ecf0[_0xeae1('0x5b')]);_0x1512d0['callDirection']=_0x928c===_0xeae1('0x53')||_0x928c===_0xeae1('0x5c')?_0xeae1('0x53'):'outbound';var _0x270d1e=_0x13ecf0[_0xeae1('0xb')]?util['format'](_0xeae1('0x5d'),_0x13ecf0[_0xeae1('0xe')]['data7']):util['format'](_0xeae1('0x5d'),_0x13ecf0[_0xeae1('0x14')]);var _0x72045b=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x13ecf0['tenantId']);var _0x40340f=util['format'](_0xeae1('0x5e'),_0x13ecf0[_0xeae1('0x5b')],_0x5ec1fb[_0xeae1('0x5f')],md5(_0x5ec1fb[_0xeae1('0x5f')]));if(_0x6a9774&&_0x6a9774[_0xeae1('0x60')]){logger[_0xeae1('0x24')](_0xeae1('0x61'),_0xeae1('0x62'));_0x5ec1fb['recordingURL']=_0x40340f;}else if(_0x4c0206&&_0x4c0206[_0xeae1('0x63')]&&_0x4c0206[_0xeae1('0x63')]!==_0xeae1('0x64')){logger['info'](_0xeae1('0x65'),'Recording\x20is\x20enabled!');_0x5ec1fb[_0xeae1('0x66')]=_0x40340f;}else{_0x5ec1fb[_0xeae1('0x66')]='';}return getUser(_0x1512d0,_0x13ecf0,_0x2fee21,_0x72045b,_0x270d1e,_0x928c)[_0xeae1('0x17')](function(_0x54c42b){logger[_0xeae1('0x24')]('['+_0x928c[_0xeae1('0x25')]()+_0xeae1('0x67'),_0x54c42b['userId']);logger[_0xeae1('0x24')]('['+_0x928c['toUpperCase']()+_0xeae1('0x68'),_0x54c42b[_0xeae1('0x29')]);return getEndUser(_0x54c42b,_0x13ecf0,_0x72045b,_0x270d1e,_0x5ec1fb,_0x928c,_0x5e21fe[_0xeae1('0x69')],_0x5e21fe[_0xeae1('0x6a')]);})[_0xeae1('0x17')](function(_0x448233){logger[_0xeae1('0x24')]('['+_0x928c[_0xeae1('0x25')]()+_0xeae1('0x6b'),_0x448233[_0xeae1('0x52')]);logger[_0xeae1('0x24')]('['+_0x928c[_0xeae1('0x25')]()+_0xeae1('0x6c'),_0x5ec1fb[_0xeae1('0x2f')]);return getTicket(_0x448233,_0x13ecf0,_0x72045b,_0x270d1e,_0x5ec1fb,_0x5e21fe,_0x928c);})[_0xeae1('0x17')](function(_0x333afe){logger[_0xeae1('0x24')](util[_0xeae1('0x57')]('['+_0x928c[_0xeae1('0x25')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x5e21fe[_0xeae1('0x49')],_0x333afe['ticketId']));logger[_0xeae1('0x24')](util['format']('['+_0x928c[_0xeae1('0x25')]()+_0xeae1('0x6d'),_0x928c));if(_0x928c!==_0xeae1('0x5c')&&_0x5e21fe[_0xeae1('0x6e')]){logger[_0xeae1('0x24')]('['+_0x928c['toUpperCase']()+']',_0xeae1('0x6f'));emit(_0x13ecf0['remoteUri'],_0x2fee21[_0xeae1('0x70')],_0x5e21fe[_0xeae1('0x49')],_0x333afe[_0xeae1('0x56')]);}})[_0xeae1('0x19')](function(_0x43418b){logger[_0xeae1('0x1a')]('['+_0x928c['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x43418b[_0xeae1('0x1c')]);console['error'](_0xeae1('0x71'),_0x43418b);});}; \ 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 d5fede2..bf3aba0 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 _0x94fb=['uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','stringify','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','catch','unmanaged','monitor_format','lastevent','toUpperCase','Authorization','lodash','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','mapValues','value','remoteUri','POST','validateEmail','%s/api/v2/agents','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','toString','debug','[HTTP]','map','forEach','includes','string','picklist','customField','type','push','variable','variableName','idField','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x12d514,_0x17f823){var _0xa58573=function(_0x485748){while(--_0x485748){_0x12d514['push'](_0x12d514['shift']());}};_0xa58573(++_0x17f823);}(_0x94fb,0x16d));var _0xb94f=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x94fb[_0x14e9f0];return _0xa63f7e;};'use strict';var _=require(_0xb94f('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xb94f('0x1'));var config=require('../../../../config/environment');var logger=require(_0xb94f('0x2'))(_0xb94f('0x3'));config[_0xb94f('0x4')]=_[_0xb94f('0x5')](config[_0xb94f('0x4')],{'host':_0xb94f('0x6'),'port':0x18eb});var io=require(_0xb94f('0x7'))(new Redis(config[_0xb94f('0x4')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x108a46,_0x1b5a3e,_0x282206){io['to'](_0x108a46)[_0xb94f('0x8')](_0x1b5a3e,_0x282206);}function getTicket(_0x1f70a2,_0x1874e1,_0x42e60b,_0x21ab7d,_0x2c9f5e){logger[_0xb94f('0x9')](_0xb94f('0xa'));var _0x2621ed=_[_0xb94f('0xb')]({'responder_id':_0x1874e1['id'],'requester_id':_0x42e60b['id'],'name':util[_0xb94f('0xc')](_0xb94f('0xd'),_0x2c9f5e[_0xb94f('0xe')]),'phone':_0x2c9f5e['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb94f('0xf')](_0x21ab7d[_0xb94f('0x10')],_0x2c9f5e,'\x20'),'description':intUtil[_0xb94f('0xf')](_0x21ab7d[_0xb94f('0x11')],_0x2c9f5e,'
'),'tags':getTags(_0x21ab7d[_0xb94f('0x12')],_0xb94f('0x13'))},getCustomFields(_0x21ab7d[_0xb94f('0x14')],_0x2c9f5e));_0x2621ed[_0xb94f('0x15')]=_[_0xb94f('0x16')](_['keyBy'](_0x2621ed[_0xb94f('0x15')],'id'),_0xb94f('0x17'));return request({'uri':util[_0xb94f('0xc')]('%s/api/v2/tickets',_0x1f70a2[_0xb94f('0x18')]),'method':_0xb94f('0x19'),'body':_0x2621ed})['then'](function(_0x5aaf44){logger[_0xb94f('0x9')]('Ticket\x20created!');return _0x5aaf44;});}function getUser(_0x200300,_0x2ac9a9){if(intUtil[_0xb94f('0x1a')](_0x2ac9a9)){return request({'uri':util[_0xb94f('0xc')](_0xb94f('0x1b'),_0x200300[_0xb94f('0x18')]),'qs':{'email':_0x2ac9a9}})[_0xb94f('0x1c')](function(_0xb915b0){if(_0xb915b0['length']){logger['info'](_0xb94f('0x1d'));return _['find'](_0xb915b0,function(_0x20533b){return _0x20533b['contact']['email']===_0x2ac9a9;});}else{logger[_0xb94f('0x9')](_0xb94f('0x1e'));return request({'uri':util[_0xb94f('0xc')](_0xb94f('0x1f'),_0x200300[_0xb94f('0x18')])})[_0xb94f('0x1c')](function(_0x1ceb82){logger[_0xb94f('0x9')](_0xb94f('0x20'));return _0x1ceb82;});}});}else{logger[_0xb94f('0x9')](_0xb94f('0x21'));return request({'uri':util[_0xb94f('0xc')]('%s/api/v2/agents/me',_0x200300[_0xb94f('0x18')])})[_0xb94f('0x1c')](function(_0x40765c){logger[_0xb94f('0x9')]('Admin\x20account\x20selected.');return _0x40765c;});}}function getEndUser(_0x55320b,_0x1fdfc7,_0x1e406b){logger['info'](_0xb94f('0x22'),_0x1e406b);return request({'uri':util[_0xb94f('0xc')]('%s/api/v2/contacts',_0x55320b[_0xb94f('0x18')]),'qs':{'phone':_0x1e406b}})[_0xb94f('0x1c')](function(_0x23059b){if(_0x23059b[_0xb94f('0x23')]){logger[_0xb94f('0x9')](_0xb94f('0x24'));return _[_0xb94f('0x25')](_0x23059b,{'phone':_0x1e406b});}else{logger['info'](_0xb94f('0x26'));return request({'uri':util[_0xb94f('0xc')](_0xb94f('0x27'),_0x55320b['remoteUri']),'method':'POST','body':{'name':_0x1fdfc7,'phone':_0x1e406b}})[_0xb94f('0x1c')](function(_0x161146){logger[_0xb94f('0x9')]('Enduser\x20created.');return _0x161146;});}});}function getAuth(_0x2461c7){return util[_0xb94f('0xc')](_0xb94f('0x28'),new Buffer(_0x2461c7['apiKey']+':X')[_0xb94f('0x29')]('base64'));}function request(_0x8c8777){logger[_0xb94f('0x2a')](_0xb94f('0x2b'),JSON['stringify'](_0x8c8777));return rp(_['defaults'](_0x8c8777,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4d117f,_0x5e394d){var _0x289777=[];if(_0x4d117f&&_0x4d117f['length']>0x0){_0x289777=_[_0xb94f('0x2c')](_0x4d117f,_0x5e394d);}return _0x289777;}function getCustomFields(_0x22ab39,_0x471c83){var _0x4f00aa=[];var _0x38124d={'custom_fields':[]};if(_0x22ab39[_0xb94f('0x23')]>0x0){_[_0xb94f('0x2d')](_0x22ab39,function(_0x2fb414){if(_[_0xb94f('0x2e')]([_0xb94f('0x2f'),_0xb94f('0x30')],_0x2fb414['type'])&&_0x2fb414['nameField']&&!_0x2fb414[_0xb94f('0x31')]){_0x38124d[_0x2fb414['nameField']['toLowerCase']()]=_0x2fb414['content'][_0xb94f('0x29')]();}else if(_['includes']([_0xb94f('0x2f'),'picklist'],_0x2fb414[_0xb94f('0x32')])&&_0x2fb414['idField']&&_0x2fb414[_0xb94f('0x31')]){_0x38124d[_0xb94f('0x15')][_0xb94f('0x33')]({'id':_0x2fb414['idField'],'value':_0x2fb414['content'][_0xb94f('0x29')]()});}else if(_0x2fb414[_0xb94f('0x32')]===_0xb94f('0x34')&&_0x2fb414[_0xb94f('0x35')]&&_0x2fb414[_0xb94f('0x36')]&&_0x2fb414[_0xb94f('0x31')]){_0x471c83[_0x2fb414[_0xb94f('0x35')]]&&_0x38124d[_0xb94f('0x15')]['push']({'id':_0x2fb414['idField'],'value':_0x471c83[_0x2fb414['variableName']][_0xb94f('0x29')]()});}else if(_0x2fb414[_0xb94f('0x32')]===_0xb94f('0x37')&&_0x2fb414['Variable']&&_0x2fb414['Variable']['name']&&_0x2fb414[_0xb94f('0x36')]&&_0x2fb414[_0xb94f('0x31')]){_0x471c83[_0x2fb414[_0xb94f('0x38')][_0xb94f('0x13')][_0xb94f('0x39')]()]&&_0x38124d['custom_fields']['push']({'id':_0x2fb414[_0xb94f('0x36')],'value':_0x471c83[_0x2fb414['Variable'][_0xb94f('0x13')][_0xb94f('0x39')]()][_0xb94f('0x29')]()});}});}return _0x38124d;}exports[_0xb94f('0x3a')]=function(_0x2868f9,_0x2c46ea,_0x193641,_0x565611,_0x1dc1c8,_0x5e6150){var _0x2c8fd8,_0x1dc247;_0x5e6150[_0xb94f('0x18')]=intUtil['stripTrailingSlash'](_0x5e6150['remoteUri']);_0x5e6150[_0xb94f('0x3b')]=intUtil[_0xb94f('0x3c')](_0x5e6150[_0xb94f('0x3b')]);if(_0x1dc1c8&&_0x1dc1c8['monitor_format']){logger['info'](_0xb94f('0x3d'),_0xb94f('0x3e'));_0x2c46ea[_0xb94f('0x3f')]=util[_0xb94f('0xc')](_0xb94f('0x40'),_0x5e6150[_0xb94f('0x3b')],_0x2c46ea['uniqueid'],md5(_0x2c46ea[_0xb94f('0x41')]));}else{_0x2c46ea['recordingURL']='';}headers['Authorization']=getAuth(_0x5e6150);return getUser(_0x5e6150,_0x565611['email'])[_0xb94f('0x1c')](function(_0x1d296a){_0x2c8fd8=_0x1d296a;logger[_0xb94f('0x9')](_0xb94f('0x42'),_0x2c8fd8['id']);return getEndUser(_0x5e6150,_0x2c46ea[_0xb94f('0xe')],_0x2c46ea[_0xb94f('0x43')]);})['then'](function(_0x310058){_0x1dc247=_0x310058;logger['info'](_0xb94f('0x44'),_0x1dc247['id']);return getTicket(_0x5e6150,_0x2c8fd8,_0x1dc247,_0x193641,_0x2c46ea);})[_0xb94f('0x1c')](function(_0x4498d3){if(_0x4498d3&&_0x4498d3['id']){logger[_0xb94f('0x9')](_0xb94f('0x45'));logger[_0xb94f('0x9')]('The\x20Ticket\x20ID\x20is:',_0x4498d3['id']);logger[_0xb94f('0x9')](_0xb94f('0x3d'),_0xb94f('0x46'));emit(util[_0xb94f('0xc')](_0xb94f('0x47'),_0x565611[_0xb94f('0x13')]),'trigger:browser:url',{'uri':util[_0xb94f('0xc')]('%s/helpdesk/tickets/%d',_0x5e6150[_0xb94f('0x18')],_0x4498d3['id'])});}})['catch'](function(_0x29517f){logger['error'](_0xb94f('0x3d'),JSON[_0xb94f('0x48')](_0x29517f));});};exports[_0xb94f('0x49')]=function(_0x32dc4,_0x12f9f4,_0x3f0ddb,_0xb9397d,_0xf95bd4,_0x54748e,_0x536cb9){var _0x37aaab,_0x1e227a;_0x54748e[_0xb94f('0x18')]=intUtil[_0xb94f('0x3c')](_0x54748e[_0xb94f('0x18')]);_0x54748e[_0xb94f('0x3b')]=intUtil[_0xb94f('0x3c')](_0x54748e[_0xb94f('0x3b')]);if(_0x536cb9&&_0x536cb9[_0xb94f('0x4a')]&&_0x536cb9[_0xb94f('0x4a')]!=='none'){logger[_0xb94f('0x9')](_0xb94f('0x4b'),_0xb94f('0x3e'));_0x12f9f4[_0xb94f('0x3f')]=util[_0xb94f('0xc')](_0xb94f('0x40'),_0x54748e['serverUrl'],_0x12f9f4['uniqueid'],md5(_0x12f9f4[_0xb94f('0x41')]));}headers['Authorization']=getAuth(_0x54748e);return getUser(_0x54748e,_0xb9397d[_0xb94f('0x4c')])['then'](function(_0x33e3c0){_0x37aaab=_0x33e3c0;logger['info'](_0xb94f('0x42'),_0x37aaab['id']);return getEndUser(_0x54748e,_0x12f9f4[_0xb94f('0x4d')],_0x12f9f4[_0xb94f('0x4e')]);})[_0xb94f('0x1c')](function(_0x2c30ef){_0x1e227a=_0x2c30ef;logger['info'](_0xb94f('0x44'),_0x1e227a['id']);return getTicket(_0x54748e,_0x37aaab,_0x1e227a,_0x3f0ddb,_0x12f9f4);})[_0xb94f('0x1c')](function(_0x45a1af){if(_0x45a1af&&_0x45a1af['id']){logger['info'](_0xb94f('0x45'));logger[_0xb94f('0x9')]('The\x20Ticket\x20ID\x20is:',_0x45a1af['id']);logger[_0xb94f('0x9')](_0xb94f('0x4b'),_0xb94f('0x46'));emit(util['format']('user:%s',_0xb9397d[_0xb94f('0x13')]),'trigger:browser:url',{'uri':util[_0xb94f('0xc')](_0xb94f('0x4f'),_0x54748e[_0xb94f('0x18')],_0x45a1af['id'])});}})[_0xb94f('0x50')](function(_0x462851){logger['error']('[OUTBOUND]',JSON[_0xb94f('0x48')](_0x462851));});};exports[_0xb94f('0x51')]=function(_0x46fedb,_0x2e520b,_0x50269e,_0x188417,_0x5432ba,_0x7be350){var _0x12a0a4,_0x2152d9;_0x7be350[_0xb94f('0x18')]=intUtil['stripTrailingSlash'](_0x7be350[_0xb94f('0x18')]);_0x7be350['serverUrl']=intUtil[_0xb94f('0x3c')](_0x7be350[_0xb94f('0x3b')]);if(_0x5432ba&&_0x5432ba[_0xb94f('0x52')]){logger[_0xb94f('0x9')]('['+_0x2e520b[_0xb94f('0x53')][_0xb94f('0x54')]()+']',_0xb94f('0x3e'));_0x2e520b['recordingURL']=util[_0xb94f('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x7be350[_0xb94f('0x3b')],_0x2e520b[_0xb94f('0x41')],md5(_0x2e520b[_0xb94f('0x41')]));}else{_0x2e520b[_0xb94f('0x3f')]='';}headers[_0xb94f('0x55')]=getAuth(_0x7be350);return getUser(_0x7be350,'')['then'](function(_0x388e0e){_0x12a0a4=_0x388e0e;logger[_0xb94f('0x9')](_0xb94f('0x42'),_0x12a0a4['id']);return getEndUser(_0x7be350,_0x2e520b[_0xb94f('0xe')],_0x2e520b[_0xb94f('0x43')]);})[_0xb94f('0x1c')](function(_0x365453){_0x2152d9=_0x365453;logger[_0xb94f('0x9')](_0xb94f('0x44'),_0x2152d9['id']);return getTicket(_0x7be350,_0x12a0a4,_0x2152d9,_0x50269e,_0x2e520b);})[_0xb94f('0x1c')](function(_0x30ac24){if(_0x30ac24){logger[_0xb94f('0x9')](_0xb94f('0x45'));logger[_0xb94f('0x9')]('The\x20Ticket\x20ID\x20is:',_0x30ac24['id']);}})[_0xb94f('0x50')](function(_0x41f4dc){logger['error']('['+_0x2e520b[_0xb94f('0x53')][_0xb94f('0x54')]()+']',JSON[_0xb94f('0x48')](_0x41f4dc));});}; \ No newline at end of file +var _0xeb64=['unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','./util','freshdesk','redis','localhost','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','defaults','GET','map','forEach','includes','string','picklist','type','customField','nameField','content','push','variable','idField','customVariable','Variable','toLowerCase','toString','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\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','user:%s','catch','error'];(function(_0x269fb2,_0x55bf32){var _0x507215=function(_0x3ae37d){while(--_0x3ae37d){_0x269fb2['push'](_0x269fb2['shift']());}};_0x507215(++_0x55bf32);}(_0xeb64,0xbf));var _0x4eb6=function(_0x3273f0,_0x4d6f5c){_0x3273f0=_0x3273f0-0x0;var _0x4ea89d=_0xeb64[_0x3273f0];return _0x4ea89d;};'use strict';var _=require(_0x4eb6('0x0'));var rp=require(_0x4eb6('0x1'));var md5=require(_0x4eb6('0x2'));var util=require('util');var Redis=require(_0x4eb6('0x3'));var intUtil=require(_0x4eb6('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4eb6('0x5'));config[_0x4eb6('0x6')]=_['defaults'](config[_0x4eb6('0x6')],{'host':_0x4eb6('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4eb6('0x6')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x2c68d2,_0xfa720b,_0x567aa7){io['to'](_0x2c68d2)[_0x4eb6('0x8')](_0xfa720b,_0x567aa7);}function getTicket(_0x22d970,_0x4a18fc,_0x5f3fa5,_0x3f9bc5,_0x10fc69){logger[_0x4eb6('0x9')](_0x4eb6('0xa'));var _0x4a7bb6=_[_0x4eb6('0xb')]({'responder_id':_0x4a18fc['id'],'requester_id':_0x5f3fa5['id'],'name':util[_0x4eb6('0xc')](_0x4eb6('0xd'),_0x10fc69[_0x4eb6('0xe')]),'phone':_0x10fc69[_0x4eb6('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3f9bc5[_0x4eb6('0x10')],_0x10fc69,'\x20'),'description':intUtil[_0x4eb6('0x11')](_0x3f9bc5[_0x4eb6('0x12')],_0x10fc69,'
'),'tags':getTags(_0x3f9bc5['Tags'],_0x4eb6('0x13'))},getCustomFields(_0x3f9bc5[_0x4eb6('0x14')],_0x10fc69));_0x4a7bb6[_0x4eb6('0x15')]=_[_0x4eb6('0x16')](_[_0x4eb6('0x17')](_0x4a7bb6[_0x4eb6('0x15')],'id'),_0x4eb6('0x18'));return request({'uri':util[_0x4eb6('0xc')](_0x4eb6('0x19'),_0x22d970['remoteUri']),'method':_0x4eb6('0x1a'),'body':_0x4a7bb6})[_0x4eb6('0x1b')](function(_0x34f0c6){logger[_0x4eb6('0x9')](_0x4eb6('0x1c'));return _0x34f0c6;});}function getUser(_0xc5fc0f,_0x548b26){if(intUtil[_0x4eb6('0x1d')](_0x548b26)){return request({'uri':util[_0x4eb6('0xc')](_0x4eb6('0x1e'),_0xc5fc0f[_0x4eb6('0x1f')]),'qs':{'email':_0x548b26}})[_0x4eb6('0x1b')](function(_0x413797){if(_0x413797[_0x4eb6('0x20')]){logger[_0x4eb6('0x9')](_0x4eb6('0x21'));return _[_0x4eb6('0x22')](_0x413797,function(_0x3d5ecd){return _0x3d5ecd['contact'][_0x4eb6('0x23')]===_0x548b26;});}else{logger['info'](_0x4eb6('0x24'));return request({'uri':util[_0x4eb6('0xc')](_0x4eb6('0x25'),_0xc5fc0f[_0x4eb6('0x1f')])})[_0x4eb6('0x1b')](function(_0x563c0e){logger[_0x4eb6('0x9')](_0x4eb6('0x26'));return _0x563c0e;});}});}else{logger[_0x4eb6('0x9')](_0x4eb6('0x27'));return request({'uri':util[_0x4eb6('0xc')]('%s/api/v2/agents/me',_0xc5fc0f['remoteUri'])})[_0x4eb6('0x1b')](function(_0x129921){logger['info'](_0x4eb6('0x26'));return _0x129921;});}}function getEndUser(_0x4784c5,_0x4af592,_0x328e94){logger['info'](_0x4eb6('0x28'),_0x328e94);return request({'uri':util[_0x4eb6('0xc')](_0x4eb6('0x29'),_0x4784c5[_0x4eb6('0x1f')]),'qs':{'phone':_0x328e94}})['then'](function(_0x27f46f){if(_0x27f46f['length']){logger[_0x4eb6('0x9')](_0x4eb6('0x2a'));return _[_0x4eb6('0x22')](_0x27f46f,{'phone':_0x328e94});}else{logger['info'](_0x4eb6('0x2b'));return request({'uri':util[_0x4eb6('0xc')](_0x4eb6('0x29'),_0x4784c5[_0x4eb6('0x1f')]),'method':_0x4eb6('0x1a'),'body':{'name':_0x4af592,'phone':_0x328e94}})[_0x4eb6('0x1b')](function(_0x371708){logger[_0x4eb6('0x9')](_0x4eb6('0x2c'));return _0x371708;});}});}function getAuth(_0x1b56cf){return util['format'](_0x4eb6('0x2d'),new Buffer(_0x1b56cf[_0x4eb6('0x2e')]+':X')['toString'](_0x4eb6('0x2f')));}function request(_0x317213){logger[_0x4eb6('0x30')](_0x4eb6('0x31'),JSON['stringify'](_0x317213));return rp(_[_0x4eb6('0x32')](_0x317213,{'method':_0x4eb6('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x578988,_0x176544){var _0x3e9b75=[];if(_0x578988&&_0x578988['length']>0x0){_0x3e9b75=_[_0x4eb6('0x34')](_0x578988,_0x176544);}return _0x3e9b75;}function getCustomFields(_0x3c5648,_0x20ddbc){var _0x141773=[];var _0x202ec1={'custom_fields':[]};if(_0x3c5648[_0x4eb6('0x20')]>0x0){_[_0x4eb6('0x35')](_0x3c5648,function(_0x2fc42b){if(_[_0x4eb6('0x36')]([_0x4eb6('0x37'),_0x4eb6('0x38')],_0x2fc42b[_0x4eb6('0x39')])&&_0x2fc42b['nameField']&&!_0x2fc42b[_0x4eb6('0x3a')]){_0x202ec1[_0x2fc42b[_0x4eb6('0x3b')]['toLowerCase']()]=_0x2fc42b[_0x4eb6('0x3c')]['toString']();}else if(_[_0x4eb6('0x36')]([_0x4eb6('0x37'),_0x4eb6('0x38')],_0x2fc42b['type'])&&_0x2fc42b['idField']&&_0x2fc42b[_0x4eb6('0x3a')]){_0x202ec1[_0x4eb6('0x15')][_0x4eb6('0x3d')]({'id':_0x2fc42b['idField'],'value':_0x2fc42b['content']['toString']()});}else if(_0x2fc42b[_0x4eb6('0x39')]===_0x4eb6('0x3e')&&_0x2fc42b['variableName']&&_0x2fc42b[_0x4eb6('0x3f')]&&_0x2fc42b[_0x4eb6('0x3a')]){_0x20ddbc[_0x2fc42b['variableName']]&&_0x202ec1['custom_fields'][_0x4eb6('0x3d')]({'id':_0x2fc42b['idField'],'value':_0x20ddbc[_0x2fc42b['variableName']]['toString']()});}else if(_0x2fc42b[_0x4eb6('0x39')]===_0x4eb6('0x40')&&_0x2fc42b[_0x4eb6('0x41')]&&_0x2fc42b[_0x4eb6('0x41')][_0x4eb6('0x13')]&&_0x2fc42b['idField']&&_0x2fc42b[_0x4eb6('0x3a')]){_0x20ddbc[_0x2fc42b[_0x4eb6('0x41')][_0x4eb6('0x13')][_0x4eb6('0x42')]()]&&_0x202ec1['custom_fields'][_0x4eb6('0x3d')]({'id':_0x2fc42b[_0x4eb6('0x3f')],'value':_0x20ddbc[_0x2fc42b['Variable'][_0x4eb6('0x13')][_0x4eb6('0x42')]()][_0x4eb6('0x43')]()});}});}return _0x202ec1;}exports['queue']=function(_0x16456b,_0x3979bd,_0x1c7a85,_0x1cb424,_0x2ab356,_0x1a03f8){var _0x468032,_0x129c8e;_0x1a03f8[_0x4eb6('0x1f')]=intUtil[_0x4eb6('0x44')](_0x1a03f8[_0x4eb6('0x1f')]);_0x1a03f8[_0x4eb6('0x45')]=intUtil[_0x4eb6('0x44')](_0x1a03f8['serverUrl']);if(_0x2ab356&&_0x2ab356[_0x4eb6('0x46')]){logger[_0x4eb6('0x9')](_0x4eb6('0x47'),_0x4eb6('0x48'));_0x3979bd[_0x4eb6('0x49')]=util[_0x4eb6('0xc')](_0x4eb6('0x4a'),_0x1a03f8['serverUrl'],_0x3979bd[_0x4eb6('0x4b')],md5(_0x3979bd[_0x4eb6('0x4b')]));}else{_0x3979bd['recordingURL']='';}headers[_0x4eb6('0x4c')]=getAuth(_0x1a03f8);return getUser(_0x1a03f8,_0x1cb424[_0x4eb6('0x23')])[_0x4eb6('0x1b')](function(_0x1090e7){_0x468032=_0x1090e7;logger['info'](_0x4eb6('0x4d'),_0x468032['id']);return getEndUser(_0x1a03f8,_0x3979bd[_0x4eb6('0xe')],_0x3979bd[_0x4eb6('0xf')]);})[_0x4eb6('0x1b')](function(_0x52df10){_0x129c8e=_0x52df10;logger['info']('The\x20Enduser\x20ID\x20is:',_0x129c8e['id']);return getTicket(_0x1a03f8,_0x468032,_0x129c8e,_0x1c7a85,_0x3979bd);})[_0x4eb6('0x1b')](function(_0x253cf1){if(_0x253cf1&&_0x253cf1['id']){logger[_0x4eb6('0x9')](_0x4eb6('0x1c'));logger['info'](_0x4eb6('0x4e'),_0x253cf1['id']);logger[_0x4eb6('0x9')](_0x4eb6('0x47'),_0x4eb6('0x4f'));emit(util[_0x4eb6('0xc')]('user:%s',_0x1cb424[_0x4eb6('0x13')]),_0x4eb6('0x50'),{'uri':util[_0x4eb6('0xc')](_0x4eb6('0x51'),_0x1a03f8['remoteUri'],_0x253cf1['id'])});}})['catch'](function(_0x4b9097){logger['error'](_0x4eb6('0x47'),JSON[_0x4eb6('0x52')](_0x4b9097));});};exports[_0x4eb6('0x53')]=function(_0x2ecd77,_0x491af7,_0x2d31a2,_0x4d87c7,_0x118795,_0x194d92,_0x5d5800){var _0x161612,_0x2b4672;_0x194d92[_0x4eb6('0x1f')]=intUtil[_0x4eb6('0x44')](_0x194d92[_0x4eb6('0x1f')]);_0x194d92[_0x4eb6('0x45')]=intUtil[_0x4eb6('0x44')](_0x194d92[_0x4eb6('0x45')]);if(_0x5d5800&&_0x5d5800[_0x4eb6('0x54')]&&_0x5d5800[_0x4eb6('0x54')]!=='none'){logger['info'](_0x4eb6('0x55'),_0x4eb6('0x48'));_0x491af7[_0x4eb6('0x49')]=util[_0x4eb6('0xc')](_0x4eb6('0x4a'),_0x194d92[_0x4eb6('0x45')],_0x491af7[_0x4eb6('0x4b')],md5(_0x491af7['uniqueid']));}headers['Authorization']=getAuth(_0x194d92);return getUser(_0x194d92,_0x4d87c7[_0x4eb6('0x23')])[_0x4eb6('0x1b')](function(_0x1dacb9){_0x161612=_0x1dacb9;logger[_0x4eb6('0x9')](_0x4eb6('0x4d'),_0x161612['id']);return getEndUser(_0x194d92,_0x491af7[_0x4eb6('0x56')],_0x491af7['destcalleridnum']);})['then'](function(_0x1df449){_0x2b4672=_0x1df449;logger[_0x4eb6('0x9')](_0x4eb6('0x57'),_0x2b4672['id']);return getTicket(_0x194d92,_0x161612,_0x2b4672,_0x2d31a2,_0x491af7);})['then'](function(_0x53890d){if(_0x53890d&&_0x53890d['id']){logger[_0x4eb6('0x9')](_0x4eb6('0x1c'));logger[_0x4eb6('0x9')](_0x4eb6('0x4e'),_0x53890d['id']);logger[_0x4eb6('0x9')](_0x4eb6('0x55'),_0x4eb6('0x4f'));emit(util[_0x4eb6('0xc')](_0x4eb6('0x58'),_0x4d87c7['name']),_0x4eb6('0x50'),{'uri':util[_0x4eb6('0xc')](_0x4eb6('0x51'),_0x194d92[_0x4eb6('0x1f')],_0x53890d['id'])});}})[_0x4eb6('0x59')](function(_0x4a3e72){logger[_0x4eb6('0x5a')](_0x4eb6('0x55'),JSON[_0x4eb6('0x52')](_0x4a3e72));});};exports[_0x4eb6('0x5b')]=function(_0x4bda59,_0x2f106b,_0x7769b2,_0x1356c3,_0x20134b,_0x30dd2f){var _0x554e9a,_0x5e73eb;_0x30dd2f[_0x4eb6('0x1f')]=intUtil[_0x4eb6('0x44')](_0x30dd2f[_0x4eb6('0x1f')]);_0x30dd2f['serverUrl']=intUtil[_0x4eb6('0x44')](_0x30dd2f['serverUrl']);if(_0x20134b&&_0x20134b[_0x4eb6('0x46')]){logger[_0x4eb6('0x9')]('['+_0x2f106b[_0x4eb6('0x5c')][_0x4eb6('0x5d')]()+']',_0x4eb6('0x48'));_0x2f106b[_0x4eb6('0x49')]=util[_0x4eb6('0xc')](_0x4eb6('0x4a'),_0x30dd2f[_0x4eb6('0x45')],_0x2f106b[_0x4eb6('0x4b')],md5(_0x2f106b[_0x4eb6('0x4b')]));}else{_0x2f106b[_0x4eb6('0x49')]='';}headers[_0x4eb6('0x4c')]=getAuth(_0x30dd2f);return getUser(_0x30dd2f,'')[_0x4eb6('0x1b')](function(_0x165fb1){_0x554e9a=_0x165fb1;logger['info'](_0x4eb6('0x4d'),_0x554e9a['id']);return getEndUser(_0x30dd2f,_0x2f106b[_0x4eb6('0xe')],_0x2f106b[_0x4eb6('0xf')]);})[_0x4eb6('0x1b')](function(_0x518399){_0x5e73eb=_0x518399;logger[_0x4eb6('0x9')]('The\x20Enduser\x20ID\x20is:',_0x5e73eb['id']);return getTicket(_0x30dd2f,_0x554e9a,_0x5e73eb,_0x7769b2,_0x2f106b);})[_0x4eb6('0x1b')](function(_0x51662a){if(_0x51662a){logger[_0x4eb6('0x9')](_0x4eb6('0x1c'));logger[_0x4eb6('0x9')]('The\x20Ticket\x20ID\x20is:',_0x51662a['id']);}})[_0x4eb6('0x59')](function(_0x296de8){logger[_0x4eb6('0x5a')]('['+_0x2f106b[_0x4eb6('0x5c')][_0x4eb6('0x5d')]()+']',JSON['stringify'](_0x296de8));});}; \ 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 d3d858d..6a08bf7 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 _0xc919=['socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','Admin\x20found:','adminId','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','catch','&f=','&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:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','getString','Descriptions','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost'];(function(_0x3b3ce7,_0x284108){var _0x2c992f=function(_0x43f96a){while(--_0x43f96a){_0x3b3ce7['push'](_0x3b3ce7['shift']());}};_0x2c992f(++_0x284108);}(_0xc919,0x159));var _0x9c91=function(_0x25d8dc,_0x102538){_0x25d8dc=_0x25d8dc-0x0;var _0x204bc2=_0xc919[_0x25d8dc];return _0x204bc2;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x9c91('0x0'));var util=require(_0x9c91('0x1'));var moment=require(_0x9c91('0x2'));var Promise=require(_0x9c91('0x3'));var Redis=require(_0x9c91('0x4'));var intUtil=require('./util');var config=require(_0x9c91('0x5'));var logger=require(_0x9c91('0x6'))(_0x9c91('0x7'));config[_0x9c91('0x8')]=_[_0x9c91('0x9')](config[_0x9c91('0x8')],{'host':_0x9c91('0xa'),'port':0x18eb});var io=require(_0x9c91('0xb'))(new Redis(config[_0x9c91('0x8')]));function getAdminId(_0x4970cd,_0x14bb64,_0x2ff079,_0x24220b){return new Promise(function(_0x5b782b,_0x105562){var _0x5f0615=![];var _0x542041={'method':_0x9c91('0xc'),'uri':_0x24220b+_0x9c91('0xd'),'json':!![]};_0x542041[_0x9c91('0xe')]=_0x2ff079;logger[_0x9c91('0xf')](_0x9c91('0x10'));return rp(_0x542041)[_0x9c91('0x11')](function(_0x528704){if(_0x528704){var _0x2f90c5=_0x528704[_0x9c91('0x12')];var _0x5a63c8=null;for(_0x5a63c8=0x0;_0x5a63c8<_0x2f90c5[_0x9c91('0x13')];_0x5a63c8++){if(_0x2f90c5[_0x5a63c8][_0x9c91('0x14')]===_0x4970cd['adminEmail']){_0x4970cd['adminId']=_0x2f90c5[_0x5a63c8]['id'];_0x5f0615=!![];}}if(_0x5f0615){logger[_0x9c91('0xf')](_0x9c91('0x15'),_0x4970cd[_0x9c91('0x16')]);_0x5b782b(_0x4970cd);}else{_0x105562({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x105562({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0xb86aa){logger[_0x9c91('0x17')]('['+[_0x14bb64[_0x9c91('0x18')]()]+']',_0xb86aa[_0x9c91('0x19')]);_0x105562(_0xb86aa);});});}function getUser(_0x3d6d62,_0xd5eeca,_0x3cf1df){return function(_0x5be915){return new Promise(function(_0x5d4496,_0x551bea){var _0xc252c9={'method':_0x9c91('0xc'),'uri':_0x3cf1df+_0x9c91('0xd'),'json':!![]};_0xc252c9[_0x9c91('0xe')]=_0xd5eeca;logger[_0x9c91('0xf')](_0x9c91('0x1a'));return rp(_0xc252c9)[_0x9c91('0x11')](function(_0x46585f){if(_0x46585f){var _0x17d0d7=_0x46585f['users'];var _0x229a03=![];var _0x4f7ea0=null;if(_0x5be915[_0x9c91('0x1b')]!==null){logger[_0x9c91('0xf')](_0x9c91('0x1c'),_0x5be915[_0x9c91('0x1b')]);_0x5be915[_0x9c91('0x1d')]=_0x5be915['agentEmail'];for(_0x4f7ea0=0x0;_0x4f7ea0<_0x17d0d7[_0x9c91('0x13')];_0x4f7ea0++){if(_0x17d0d7[_0x4f7ea0][_0x9c91('0x14')]===_0x5be915[_0x9c91('0x1b')]){_0x229a03=!![];_0x5be915[_0x9c91('0x1e')]=_0x17d0d7[_0x4f7ea0]['id'];logger[_0x9c91('0xf')](_0x9c91('0x1f'),_0x5be915[_0x9c91('0x1e')]);}}}if(!_0x229a03){logger[_0x9c91('0xf')](_0x9c91('0x20'));_0x5be915[_0x9c91('0x1d')]=_0x5be915['adminEmail'];_0x5be915[_0x9c91('0x1e')]=_0x5be915[_0x9c91('0x16')];_0x229a03=!![];}if(_0x229a03){_0x5d4496(_0x5be915);}else{_0x551bea({'statusCode':0x194,'message':_0x9c91('0x21')});}}else{_0x551bea({'statusCode':0x194,'message':_0x9c91('0x21')});}})[_0x9c91('0x22')](function(_0xb65118){logger[_0x9c91('0x17')]('['+[_0x3d6d62[_0x9c91('0x18')]()]+']',_0xb65118[_0x9c91('0x19')]);_0x551bea(_0xb65118);});});};}function searchContact(_0x4385cf,_0x136030,_0x4e96a2,_0x383af1){return new Promise(function(_0x329c23,_0x42fbf8){var _0x515c0a={'method':_0x9c91('0xc'),'headers':_0x136030,'uri':_0x4385cf+'/api/lookup?q='+_0x383af1+_0x9c91('0x23')+_0x4e96a2+_0x9c91('0x24'),'json':!![]};rp(_0x515c0a)['then'](function(_0x123a1d){var _0x33ede2=_[_0x9c91('0x25')](_0x123a1d[_0x9c91('0x26')][_0x9c91('0x26')],[_0x4e96a2,_0x383af1]);_0x329c23(_0x33ede2);})[_0x9c91('0x22')](function(_0x8510f2){_0x42fbf8(_0x8510f2);});});}function getEndUser(_0x29478f,_0x3e0f8a,_0x179178){return function(_0x518867){return new Promise(function(_0x1e5f9c,_0x4ddabb){logger[_0x9c91('0xf')](util[_0x9c91('0x27')](_0x9c91('0x28'),_0x518867[_0x9c91('0x29')]));searchContact(_0x179178,_0x3e0f8a,_0x9c91('0x2a'),_0x518867[_0x9c91('0x29')])[_0x9c91('0x11')](function(_0x2d0df4){if(_0x2d0df4){_0x518867[_0x9c91('0x2b')]=_0x2d0df4['id'];logger[_0x9c91('0xf')](_0x9c91('0x2c'),_0x518867[_0x9c91('0x2b')]);return _0x1e5f9c(_0x518867);}searchContact(_0x179178,_0x3e0f8a,_0x9c91('0x2d'),_0x518867['contactNumber'])[_0x9c91('0x11')](function(_0x10c206){if(_0x10c206){_0x518867[_0x9c91('0x2b')]=_0x10c206['id'];logger[_0x9c91('0xf')](_0x9c91('0x2e'),_0x518867[_0x9c91('0x2b')]);return _0x1e5f9c(_0x518867);}createEndUser(_0x518867,_0x29478f,_0x3e0f8a,_0x179178)['then'](function(_0x454d3f){logger[_0x9c91('0xf')](_0x9c91('0x2f'),_0x454d3f[_0x9c91('0x2b')]);return _0x1e5f9c(_0x454d3f);});});})['catch'](function(_0x2adc27){_0x4ddabb(_0x2adc27);});});};}function createEndUser(_0x360138,_0x17ae4a,_0x33e365,_0x396ee9){return new Promise(function(_0x28f088,_0x21c679){var _0x44fd04=moment();var _0x40a862={'method':'POST','uri':_0x396ee9+_0x9c91('0x30'),'body':{'contact':{'last_name':_0x360138[_0x9c91('0x29')],'work_number':_0x360138['contactNumber'],'mobile_number':_0x360138['contactNumber'],'owner_id':_0x360138[_0x9c91('0x1e')],'created_at':_0x44fd04['format'](_0x9c91('0x31'))}},'json':!![]};_0x40a862[_0x9c91('0xe')]=_0x33e365;logger['info'](_0x9c91('0x32'));return rp(_0x40a862)[_0x9c91('0x11')](function(_0x31c0d3){_0x360138[_0x9c91('0x2b')]=_0x31c0d3['contact']['id'];_0x28f088(_0x360138);})[_0x9c91('0x22')](function(_0x3597db){logger[_0x9c91('0x17')]('['+[_0x17ae4a['toUpperCase']()]+']',_0x3597db[_0x9c91('0x19')]);_0x21c679(_0x3597db[_0x9c91('0x19')]);});});}function getTicket(_0x4af698,_0x4be5ec,_0x2e8517,_0x226985,_0x256668){return function(_0x295c10){logger['info'](_0x9c91('0x33'));return new Promise(function(_0x40bafe,_0x4b160a){var _0x3f9f3d=moment();var _0x326fe3={'method':_0x9c91('0x34'),'uri':_0x2e8517+_0x9c91('0x35'),'body':{'title':intUtil['getString'](_0x226985['Subjects'],_0x256668,'\x20'),'description':intUtil[_0x9c91('0x36')](_0x226985[_0x9c91('0x37')],_0x256668,'\x0a'),'owner_id':_0x295c10[_0x9c91('0x1e')],'creater_id':_0x295c10[_0x9c91('0x16')],'targetable_id':_0x295c10['endUserId'],'targetable_type':'Contact','created_at':_0x3f9f3d['format'](_0x9c91('0x31')),'due_date':_0x3f9f3d[_0x9c91('0x38')](0x1e,'m')[_0x9c91('0x27')](_0x9c91('0x31'))},'json':!![]};_0x326fe3[_0x9c91('0xe')]=_0x4be5ec;return rp(_0x326fe3)[_0x9c91('0x11')](function(_0x1bccc1){_0x295c10[_0x9c91('0x39')]=_0x1bccc1[_0x9c91('0x3a')]['id'];logger[_0x9c91('0xf')]('Task\x20created:',_0x295c10[_0x9c91('0x39')]);_0x40bafe(_0x295c10);})[_0x9c91('0x22')](function(_0x3bcdab){logger[_0x9c91('0x17')]('['+[_0x4af698[_0x9c91('0x18')]()]+']',_0x3bcdab['message']);_0x4b160a(_0x3bcdab['message']);});});};}function emit(_0x3aa3d6,_0x38c76a,_0x5cdb2f){var _0x310592={'uri':_0x3aa3d6+_0x9c91('0x3b')+_0x5cdb2f};io['to'](util[_0x9c91('0x27')](_0x9c91('0x3c'),_0x38c76a))[_0x9c91('0x3d')](_0x9c91('0x3e'),_0x310592);}exports['cs']=function(_0x532b08,_0x34301f,_0x289b61,_0x3268e8,_0x5a3d8f,_0x6e9939,_0x126766,_0x3a55dd){var _0x51b1df={};var _0x3ff3f5={'Authorization':_0x9c91('0x3f')+_0x6e9939[_0x9c91('0x40')]};_0x6e9939[_0x9c91('0x41')]=intUtil[_0x9c91('0x42')](_0x6e9939[_0x9c91('0x41')]);_0x6e9939['serverUrl']=intUtil[_0x9c91('0x42')](_0x6e9939[_0x9c91('0x43')]);var _0x569332=_0x6e9939[_0x9c91('0x41')];_0x51b1df[_0x9c91('0x44')]=_0x6e9939[_0x9c91('0x45')];_0x51b1df[_0x9c91('0x29')]=_0x3a55dd[_0x9c91('0x46')]()===_0x9c91('0x47')?_0x34301f[_0x9c91('0x48')]:_0x34301f[_0x9c91('0x49')];_0x51b1df[_0x9c91('0x4a')]=_0x3a55dd==='queue'||_0x3a55dd==='unmanaged'?_0x9c91('0x4b'):_0x9c91('0x47');if(_0x3268e8){_0x51b1df[_0x9c91('0x1b')]=_0x3268e8['email'];}var _0x50cafb=util[_0x9c91('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6e9939['serverUrl'],_0x34301f[_0x9c91('0x4c')],md5(_0x34301f[_0x9c91('0x4c')]));if(_0x5a3d8f&&_0x5a3d8f[_0x9c91('0x4d')]){logger[_0x9c91('0xf')](_0x9c91('0x4e'),_0x9c91('0x4f'));_0x34301f[_0x9c91('0x50')]=_0x50cafb;}else if(_0x126766&&_0x126766[_0x9c91('0x51')]&&_0x126766[_0x9c91('0x51')]!==_0x9c91('0x52')){logger[_0x9c91('0xf')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x34301f[_0x9c91('0x50')]=_0x50cafb;}else{_0x34301f[_0x9c91('0x50')]='';}return getAdminId(_0x51b1df,_0x3a55dd,_0x3ff3f5,_0x569332)['then'](getUser(_0x3a55dd,_0x3ff3f5,_0x569332))['then'](getEndUser(_0x3a55dd,_0x3ff3f5,_0x569332))[_0x9c91('0x11')](getTicket(_0x3a55dd,_0x3ff3f5,_0x569332,_0x289b61,_0x34301f))['then'](function(_0x2c59a4){logger[_0x9c91('0xf')](util[_0x9c91('0x27')](_0x9c91('0x53'),_0x2c59a4[_0x9c91('0x39')]));if(_0x3a55dd!==_0x9c91('0x54')){logger['info']('['+[_0x3a55dd['toUpperCase']()]+']',_0x9c91('0x55'));emit(_0x569332,_0x3268e8[_0x9c91('0x56')],_0x2c59a4[_0x9c91('0x2b')]);}})['catch'](function(_0x30fc93){logger[_0x9c91('0x17')]('['+[_0x3a55dd[_0x9c91('0x18')]()]+_0x9c91('0x57'),util[_0x9c91('0x58')](_0x30fc93,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfe8b=['freshsales','redis','defaults','localhost','socket.io-emitter','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','Subjects','getString','Descriptions','Contact','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','stripTrailingSlash','serverUrl','remoteUri','username','calleridnum','queue','unmanaged','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','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger'];(function(_0x454fa1,_0xa4117a){var _0x3dc462=function(_0x132778){while(--_0x132778){_0x454fa1['push'](_0x454fa1['shift']());}};_0x3dc462(++_0xa4117a);}(_0xfe8b,0x154));var _0xbfe8=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xfe8b[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var rp=require(_0xbfe8('0x0'));var md5=require(_0xbfe8('0x1'));var util=require(_0xbfe8('0x2'));var moment=require(_0xbfe8('0x3'));var Promise=require(_0xbfe8('0x4'));var Redis=require('ioredis');var intUtil=require(_0xbfe8('0x5'));var config=require(_0xbfe8('0x6'));var logger=require(_0xbfe8('0x7'))(_0xbfe8('0x8'));config[_0xbfe8('0x9')]=_[_0xbfe8('0xa')](config[_0xbfe8('0x9')],{'host':_0xbfe8('0xb'),'port':0x18eb});var io=require(_0xbfe8('0xc'))(new Redis(config[_0xbfe8('0x9')]));function getAdminId(_0x5deb63,_0x17b0d9,_0x2cd02d,_0x2a2893){return new Promise(function(_0x1b98a1,_0x2b0915){var _0x288a19=![];var _0x4d1bb5={'method':'GET','uri':_0x2a2893+'/api/selector/owners','json':!![]};_0x4d1bb5[_0xbfe8('0xd')]=_0x2cd02d;logger[_0xbfe8('0xe')](_0xbfe8('0xf'));return rp(_0x4d1bb5)[_0xbfe8('0x10')](function(_0x478be8){if(_0x478be8){var _0x4edc01=_0x478be8[_0xbfe8('0x11')];var _0x18b2f7=null;for(_0x18b2f7=0x0;_0x18b2f7<_0x4edc01[_0xbfe8('0x12')];_0x18b2f7++){if(_0x4edc01[_0x18b2f7][_0xbfe8('0x13')]===_0x5deb63[_0xbfe8('0x14')]){_0x5deb63[_0xbfe8('0x15')]=_0x4edc01[_0x18b2f7]['id'];_0x288a19=!![];}}if(_0x288a19){logger[_0xbfe8('0xe')](_0xbfe8('0x16'),_0x5deb63[_0xbfe8('0x15')]);_0x1b98a1(_0x5deb63);}else{_0x2b0915({'statusCode':0x194,'message':_0xbfe8('0x17')});}}else{_0x2b0915({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xbfe8('0x18')](function(_0x33acfe){logger[_0xbfe8('0x19')]('['+[_0x17b0d9[_0xbfe8('0x1a')]()]+']',_0x33acfe[_0xbfe8('0x1b')]);_0x2b0915(_0x33acfe);});});}function getUser(_0x5d6d4d,_0x4c4ce1,_0x438ede){return function(_0x4ab892){return new Promise(function(_0x874bb,_0x17fd99){var _0x52e2b7={'method':_0xbfe8('0x1c'),'uri':_0x438ede+_0xbfe8('0x1d'),'json':!![]};_0x52e2b7['headers']=_0x4c4ce1;logger[_0xbfe8('0xe')](_0xbfe8('0x1e'));return rp(_0x52e2b7)[_0xbfe8('0x10')](function(_0x4c4edd){if(_0x4c4edd){var _0x168bdc=_0x4c4edd[_0xbfe8('0x11')];var _0x1e58b9=![];var _0xcd4aa=null;if(_0x4ab892['agentEmail']!==null){logger[_0xbfe8('0xe')](_0xbfe8('0x1f'),_0x4ab892[_0xbfe8('0x20')]);_0x4ab892[_0xbfe8('0x21')]=_0x4ab892[_0xbfe8('0x20')];for(_0xcd4aa=0x0;_0xcd4aa<_0x168bdc[_0xbfe8('0x12')];_0xcd4aa++){if(_0x168bdc[_0xcd4aa]['email']===_0x4ab892[_0xbfe8('0x20')]){_0x1e58b9=!![];_0x4ab892[_0xbfe8('0x22')]=_0x168bdc[_0xcd4aa]['id'];logger[_0xbfe8('0xe')](_0xbfe8('0x23'),_0x4ab892[_0xbfe8('0x22')]);}}}if(!_0x1e58b9){logger[_0xbfe8('0xe')](_0xbfe8('0x24'));_0x4ab892[_0xbfe8('0x21')]=_0x4ab892[_0xbfe8('0x14')];_0x4ab892['userId']=_0x4ab892[_0xbfe8('0x15')];_0x1e58b9=!![];}if(_0x1e58b9){_0x874bb(_0x4ab892);}else{_0x17fd99({'statusCode':0x194,'message':_0xbfe8('0x17')});}}else{_0x17fd99({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xbfe8('0x18')](function(_0x5c8163){logger[_0xbfe8('0x19')]('['+[_0x5d6d4d[_0xbfe8('0x1a')]()]+']',_0x5c8163['message']);_0x17fd99(_0x5c8163);});});};}function searchContact(_0x579ea7,_0x26f180,_0x41ac05,_0x3ea564){return new Promise(function(_0x4f9219,_0x25e7d0){var _0x115cdb={'method':_0xbfe8('0x1c'),'headers':_0x26f180,'uri':_0x579ea7+_0xbfe8('0x25')+_0x3ea564+_0xbfe8('0x26')+_0x41ac05+_0xbfe8('0x27'),'json':!![]};rp(_0x115cdb)[_0xbfe8('0x10')](function(_0x243f51){var _0x2791ca=_[_0xbfe8('0x28')](_0x243f51[_0xbfe8('0x29')][_0xbfe8('0x29')],[_0x41ac05,_0x3ea564]);_0x4f9219(_0x2791ca);})['catch'](function(_0xf42f51){_0x25e7d0(_0xf42f51);});});}function getEndUser(_0x50d04d,_0x3207d0,_0x1e10bf){return function(_0x57e2eb){return new Promise(function(_0x31d1cc,_0x13f4a1){logger[_0xbfe8('0xe')](util[_0xbfe8('0x2a')](_0xbfe8('0x2b'),_0x57e2eb[_0xbfe8('0x2c')]));searchContact(_0x1e10bf,_0x3207d0,_0xbfe8('0x2d'),_0x57e2eb[_0xbfe8('0x2c')])[_0xbfe8('0x10')](function(_0x13cc95){if(_0x13cc95){_0x57e2eb[_0xbfe8('0x2e')]=_0x13cc95['id'];logger[_0xbfe8('0xe')]('Contact\x20found\x20mobile_number:',_0x57e2eb[_0xbfe8('0x2e')]);return _0x31d1cc(_0x57e2eb);}searchContact(_0x1e10bf,_0x3207d0,_0xbfe8('0x2f'),_0x57e2eb[_0xbfe8('0x2c')])[_0xbfe8('0x10')](function(_0x937a82){if(_0x937a82){_0x57e2eb[_0xbfe8('0x2e')]=_0x937a82['id'];logger[_0xbfe8('0xe')](_0xbfe8('0x30'),_0x57e2eb[_0xbfe8('0x2e')]);return _0x31d1cc(_0x57e2eb);}createEndUser(_0x57e2eb,_0x50d04d,_0x3207d0,_0x1e10bf)[_0xbfe8('0x10')](function(_0x2731eb){logger['info'](_0xbfe8('0x31'),_0x2731eb[_0xbfe8('0x2e')]);return _0x31d1cc(_0x2731eb);});});})[_0xbfe8('0x18')](function(_0x567a92){_0x13f4a1(_0x567a92);});});};}function createEndUser(_0x457195,_0x5d217f,_0x52edaf,_0x31bbf1){return new Promise(function(_0x5ac0fa,_0x212948){var _0x984b52=moment();var _0x5c6d7f={'method':'POST','uri':_0x31bbf1+_0xbfe8('0x32'),'body':{'contact':{'last_name':_0x457195['contactNumber'],'work_number':_0x457195['contactNumber'],'mobile_number':_0x457195[_0xbfe8('0x2c')],'owner_id':_0x457195[_0xbfe8('0x22')],'created_at':_0x984b52[_0xbfe8('0x2a')](_0xbfe8('0x33'))}},'json':!![]};_0x5c6d7f['headers']=_0x52edaf;logger[_0xbfe8('0xe')](_0xbfe8('0x34'));return rp(_0x5c6d7f)['then'](function(_0x131bbb){_0x457195['endUserId']=_0x131bbb['contact']['id'];_0x5ac0fa(_0x457195);})[_0xbfe8('0x18')](function(_0x227b71){logger[_0xbfe8('0x19')]('['+[_0x5d217f[_0xbfe8('0x1a')]()]+']',_0x227b71[_0xbfe8('0x1b')]);_0x212948(_0x227b71[_0xbfe8('0x1b')]);});});}function getTicket(_0x51ede3,_0x3f8f7e,_0xb74af9,_0x448726,_0x419c3d){return function(_0x155d07){logger['info'](_0xbfe8('0x35'));return new Promise(function(_0x2335ca,_0x5808fb){var _0x2fd2dc=moment();var _0x43b22f={'method':_0xbfe8('0x36'),'uri':_0xb74af9+_0xbfe8('0x37'),'body':{'title':intUtil['getString'](_0x448726[_0xbfe8('0x38')],_0x419c3d,'\x20'),'description':intUtil[_0xbfe8('0x39')](_0x448726[_0xbfe8('0x3a')],_0x419c3d,'\x0a'),'owner_id':_0x155d07[_0xbfe8('0x22')],'creater_id':_0x155d07[_0xbfe8('0x15')],'targetable_id':_0x155d07[_0xbfe8('0x2e')],'targetable_type':_0xbfe8('0x3b'),'created_at':_0x2fd2dc[_0xbfe8('0x2a')](_0xbfe8('0x33')),'due_date':_0x2fd2dc['add'](0x1e,'m')['format'](_0xbfe8('0x33'))},'json':!![]};_0x43b22f[_0xbfe8('0xd')]=_0x3f8f7e;return rp(_0x43b22f)['then'](function(_0x410c23){_0x155d07[_0xbfe8('0x3c')]=_0x410c23['task']['id'];logger['info'](_0xbfe8('0x3d'),_0x155d07[_0xbfe8('0x3c')]);_0x2335ca(_0x155d07);})['catch'](function(_0xcf639a){logger[_0xbfe8('0x19')]('['+[_0x51ede3[_0xbfe8('0x1a')]()]+']',_0xcf639a[_0xbfe8('0x1b')]);_0x5808fb(_0xcf639a[_0xbfe8('0x1b')]);});});};}function emit(_0x22d168,_0x2dff68,_0x2be7f0){var _0x2eb47b={'uri':_0x22d168+_0xbfe8('0x3e')+_0x2be7f0};io['to'](util[_0xbfe8('0x2a')](_0xbfe8('0x3f'),_0x2dff68))[_0xbfe8('0x40')](_0xbfe8('0x41'),_0x2eb47b);}exports['cs']=function(_0x26f742,_0xd2cf36,_0x5d863c,_0x2d9a09,_0x3c273b,_0x3ac6d2,_0xe33e79,_0x179df1){var _0x2c3906={};var _0x11a500={'Authorization':_0xbfe8('0x42')+_0x3ac6d2['apiKey']};_0x3ac6d2['remoteUri']=intUtil[_0xbfe8('0x43')](_0x3ac6d2['remoteUri']);_0x3ac6d2['serverUrl']=intUtil[_0xbfe8('0x43')](_0x3ac6d2[_0xbfe8('0x44')]);var _0x105eec=_0x3ac6d2[_0xbfe8('0x45')];_0x2c3906[_0xbfe8('0x14')]=_0x3ac6d2[_0xbfe8('0x46')];_0x2c3906[_0xbfe8('0x2c')]=_0x179df1['toLowerCase']()==='outbound'?_0xd2cf36['destcalleridnum']:_0xd2cf36[_0xbfe8('0x47')];_0x2c3906['callDirection']=_0x179df1===_0xbfe8('0x48')||_0x179df1===_0xbfe8('0x49')?'queue':'outbound';if(_0x2d9a09){_0x2c3906[_0xbfe8('0x20')]=_0x2d9a09[_0xbfe8('0x13')];}var _0x4ea1e0=util[_0xbfe8('0x2a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d2['serverUrl'],_0xd2cf36[_0xbfe8('0x4a')],md5(_0xd2cf36['uniqueid']));if(_0x3c273b&&_0x3c273b[_0xbfe8('0x4b')]){logger[_0xbfe8('0xe')](_0xbfe8('0x4c'),_0xbfe8('0x4d'));_0xd2cf36[_0xbfe8('0x4e')]=_0x4ea1e0;}else if(_0xe33e79&&_0xe33e79[_0xbfe8('0x4f')]&&_0xe33e79[_0xbfe8('0x4f')]!==_0xbfe8('0x50')){logger['info'](_0xbfe8('0x51'),_0xbfe8('0x4d'));_0xd2cf36[_0xbfe8('0x4e')]=_0x4ea1e0;}else{_0xd2cf36['recordingURL']='';}return getAdminId(_0x2c3906,_0x179df1,_0x11a500,_0x105eec)[_0xbfe8('0x10')](getUser(_0x179df1,_0x11a500,_0x105eec))['then'](getEndUser(_0x179df1,_0x11a500,_0x105eec))[_0xbfe8('0x10')](getTicket(_0x179df1,_0x11a500,_0x105eec,_0x5d863c,_0xd2cf36))[_0xbfe8('0x10')](function(_0x2d2f1f){logger['info'](util[_0xbfe8('0x2a')](_0xbfe8('0x52'),_0x2d2f1f['ticketId']));if(_0x179df1!==_0xbfe8('0x49')){logger['info']('['+[_0x179df1[_0xbfe8('0x1a')]()]+']',_0xbfe8('0x53'));emit(_0x105eec,_0x2d9a09[_0xbfe8('0x54')],_0x2d2f1f[_0xbfe8('0x2e')]);}})[_0xbfe8('0x18')](function(_0x442454){logger['error']('['+[_0x179df1[_0xbfe8('0x1a')]()]+_0xbfe8('0x55'),util[_0xbfe8('0x56')](_0x442454,{'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 bf12aed..59f142d 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 _0x94fe=['%s\x20configuration\x20#%s\x20not\x20found','data3','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','unmanaged','data1','zendesk','dynamics365','unknown\x20integration','error','format'];(function(_0x117259,_0x11cb60){var _0x4f859b=function(_0x286296){while(--_0x286296){_0x117259['push'](_0x117259['shift']());}};_0x4f859b(++_0x11cb60);}(_0x94fe,0x11c));var _0xe94f=function(_0x15f1e5,_0x404557){_0x15f1e5=_0x15f1e5-0x0;var _0x8adcec=_0x94fe[_0x15f1e5];return _0x8adcec;};'use strict';var _=require(_0xe94f('0x0'));var util=require('util');var zendesk=require(_0xe94f('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0xe94f('0x2'));var freshdesk=require(_0xe94f('0x3'));var zoho=require('./zoho');var desk=require(_0xe94f('0x4'));var vtiger=require(_0xe94f('0x5'));var servicenow=require(_0xe94f('0x6'));var dynamics365=require(_0xe94f('0x7'));var freshsales=require(_0xe94f('0x8'));var integrations=['zendesk','salesforce','sugarcrm',_0xe94f('0x9'),_0xe94f('0xa'),_0xe94f('0xb'),_0xe94f('0xc'),'dynamics365',_0xe94f('0xd'),_0xe94f('0xe')];exports[_0xe94f('0xf')]=function(_0x13a08d,_0x51b429,_0x4cc161,_0x3aeea5,_0x4ba46b,_0x2ef8e0){if(_0x4cc161){if(_['includes'](integrations,_0x13a08d['data1']['toLowerCase']())){try{var _0x35c034=null;var _0x3bfd5f='';var _0x123dc6=_0x4cc161[_0x13a08d['data1'][_0xe94f('0x10')]()];if(_0x123dc6){var _0x417dd5=_0x123dc6[_0x13a08d[_0xe94f('0x11')]];if(_0x417dd5){var _0x173ae5=_[_0xe94f('0x12')](_0x417dd5[_0xe94f('0x13')],{'id':parseInt(_0x13a08d['data3'],0xa)});if(_0x173ae5){if(_0x3aeea5){if(_0x4ba46b&&_0x51b429[_0xe94f('0x14')]){_0x3bfd5f=_0xe94f('0x14');}else if(_0x51b429[_0xe94f('0x15')]){_0x3bfd5f=_0xe94f('0x16');}else{console[_0xe94f('0x17')]('EVENT\x20UNKNOWN',_0x51b429);}}else{_0x3bfd5f=_0xe94f('0x18');}switch(_0x13a08d[_0xe94f('0x19')][_0xe94f('0x10')]()){case _0xe94f('0x1a'):zendesk[_0x3bfd5f](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0);break;case'salesforce':salesforce[_0x3bfd5f](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0);break;case'sugarcrm':sugarcrm[_0x3bfd5f](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0);break;case _0xe94f('0x9'):freshdesk[_0x3bfd5f](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0);break;case _0xe94f('0xa'):zoho[_0x3bfd5f](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0);break;case _0xe94f('0xb'):desk[_0x3bfd5f](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0);break;case _0xe94f('0xc'):vtiger[_0x3bfd5f](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0);break;case _0xe94f('0xd'):freshsales['cs'](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0,_0x3bfd5f);break;case'servicenow':servicenow['cs'](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0,_0x3bfd5f);break;case _0xe94f('0x1b'):dynamics365['cs'](_0x13a08d,_0x51b429,_0x173ae5,_0x3aeea5,_0x4ba46b,_0x417dd5,_0x2ef8e0,_0x3bfd5f);break;default:console[_0xe94f('0x17')](_0xe94f('0x1c'));}}else{_0x35c034=require('../../../../config/logger')(_0x13a08d['data1'][_0xe94f('0x10')]());_0x35c034[_0xe94f('0x1d')]('[EXEC]',util[_0xe94f('0x1e')](_0xe94f('0x1f'),_0x13a08d['data1']['toLowerCase'](),_0x13a08d[_0xe94f('0x20')]));}}else{_0x35c034=require('../../../../config/logger')(_0x13a08d[_0xe94f('0x19')][_0xe94f('0x10')]());_0x35c034[_0xe94f('0x1d')](_0xe94f('0x21'),util[_0xe94f('0x1e')](_0xe94f('0x22'),_0x13a08d[_0xe94f('0x19')][_0xe94f('0x10')](),_0x13a08d[_0xe94f('0x11')]));}}else{}}catch(_0x37a098){console[_0xe94f('0x1d')](_0x37a098);}}}}; \ No newline at end of file +var _0x2570=['../../../../config/logger','%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','vtiger','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','unmanaged','salesforce','dynamics365','unknown\x20integration'];(function(_0x182fe1,_0x2f1227){var _0x468935=function(_0x179544){while(--_0x179544){_0x182fe1['push'](_0x182fe1['shift']());}};_0x468935(++_0x2f1227);}(_0x2570,0xea));var _0x0257=function(_0x8d244d,_0x49c04a){_0x8d244d=_0x8d244d-0x0;var _0x30fcd2=_0x2570[_0x8d244d];return _0x30fcd2;};'use strict';var _=require('lodash');var util=require(_0x0257('0x0'));var zendesk=require(_0x0257('0x1'));var salesforce=require(_0x0257('0x2'));var sugarcrm=require(_0x0257('0x3'));var freshdesk=require(_0x0257('0x4'));var zoho=require(_0x0257('0x5'));var desk=require(_0x0257('0x6'));var vtiger=require(_0x0257('0x7'));var servicenow=require(_0x0257('0x8'));var dynamics365=require(_0x0257('0x9'));var freshsales=require(_0x0257('0xa'));var integrations=[_0x0257('0xb'),'salesforce',_0x0257('0xc'),_0x0257('0xd'),_0x0257('0xe'),'desk',_0x0257('0xf'),'dynamics365',_0x0257('0x10'),_0x0257('0x11')];exports['exec']=function(_0x12d4f0,_0x1f71c7,_0x18338e,_0xa0ceac,_0x24a38b,_0x3d3a01){if(_0x18338e){if(_[_0x0257('0x12')](integrations,_0x12d4f0[_0x0257('0x13')][_0x0257('0x14')]())){try{var _0xe293ef=null;var _0x5da7d0='';var _0x37be6c=_0x18338e[_0x12d4f0[_0x0257('0x13')][_0x0257('0x14')]()];if(_0x37be6c){var _0xba724f=_0x37be6c[_0x12d4f0[_0x0257('0x15')]];if(_0xba724f){var _0x28dcf6=_[_0x0257('0x16')](_0xba724f[_0x0257('0x17')],{'id':parseInt(_0x12d4f0[_0x0257('0x18')],0xa)});if(_0x28dcf6){if(_0xa0ceac){if(_0x24a38b&&_0x1f71c7[_0x0257('0x19')]){_0x5da7d0=_0x0257('0x19');}else if(_0x1f71c7['routeId']){_0x5da7d0='outbound';}else{console[_0x0257('0x1a')](_0x0257('0x1b'),_0x1f71c7);}}else{_0x5da7d0=_0x0257('0x1c');}switch(_0x12d4f0[_0x0257('0x13')][_0x0257('0x14')]()){case _0x0257('0xb'):zendesk[_0x5da7d0](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01);break;case _0x0257('0x1d'):salesforce[_0x5da7d0](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01);break;case'sugarcrm':sugarcrm[_0x5da7d0](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01);break;case _0x0257('0xd'):freshdesk[_0x5da7d0](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01);break;case'zoho':zoho[_0x5da7d0](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01);break;case'desk':desk[_0x5da7d0](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01);break;case'vtiger':vtiger[_0x5da7d0](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01);break;case _0x0257('0x10'):freshsales['cs'](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01,_0x5da7d0);break;case _0x0257('0x11'):servicenow['cs'](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01,_0x5da7d0);break;case _0x0257('0x1e'):dynamics365['cs'](_0x12d4f0,_0x1f71c7,_0x28dcf6,_0xa0ceac,_0x24a38b,_0xba724f,_0x3d3a01,_0x5da7d0);break;default:console[_0x0257('0x1a')](_0x0257('0x1f'));}}else{_0xe293ef=require(_0x0257('0x20'))(_0x12d4f0[_0x0257('0x13')]['toLowerCase']());_0xe293ef['error']('[EXEC]',util['format'](_0x0257('0x21'),_0x12d4f0['data1'][_0x0257('0x14')](),_0x12d4f0[_0x0257('0x18')]));}}else{_0xe293ef=require(_0x0257('0x20'))(_0x12d4f0[_0x0257('0x13')][_0x0257('0x14')]());_0xe293ef[_0x0257('0x22')](_0x0257('0x23'),util[_0x0257('0x24')](_0x0257('0x25'),_0x12d4f0[_0x0257('0x13')]['toLowerCase'](),_0x12d4f0[_0x0257('0x15')]));}}else{}}catch(_0x5a8075){console['error'](_0x5a8075);}}}}; \ 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 ee9c39c..f89295d 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 _0x6bf3=['trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','execute','then','length','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','Contact','additionalSearchLead','merge','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','Company','No\x20Company','upperFirst','create','includes','string','idField','toString','variable','variableName','customVariable','Variable','name','securityToken','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s'];(function(_0x5e9913,_0x4552cc){var _0x4ac3f2=function(_0x4cdfcb){while(--_0x4cdfcb){_0x5e9913['push'](_0x5e9913['shift']());}};_0x4ac3f2(++_0x4552cc);}(_0x6bf3,0x97));var _0x36bf=function(_0x309d9f,_0x344fde){_0x309d9f=_0x309d9f-0x0;var _0x15446c=_0x6bf3[_0x309d9f];return _0x15446c;};'use strict';var _=require(_0x36bf('0x0'));var rp=require(_0x36bf('0x1'));var moment=require('moment');var BPromise=require(_0x36bf('0x2'));var md5=require(_0x36bf('0x3'));var jsforce=require(_0x36bf('0x4'));var util=require('util');var Redis=require(_0x36bf('0x5'));var intUtil=require(_0x36bf('0x6'));var config=require(_0x36bf('0x7'));var logger=require(_0x36bf('0x8'))(_0x36bf('0x9'));config[_0x36bf('0xa')]=_[_0x36bf('0xb')](config['redis'],{'host':_0x36bf('0xc'),'port':0x18eb});var io=require(_0x36bf('0xd'))(new Redis(config[_0x36bf('0xa')]));function emit(_0x32858d,_0x4d83e5,_0x1a44e0){io['to'](_0x32858d)[_0x36bf('0xe')](_0x4d83e5,_0x1a44e0);}function getTicket(_0x5d613d,_0x460459,_0x40520b,_0x544ddd,_0x3dd162,_0x46f136,_0x772229,_0x25eba5){var _0x489c86=Object[_0x36bf('0xf')]({},{'OwnerId':_0x460459['id'],'Subject':intUtil[_0x36bf('0x10')](_0x544ddd[_0x36bf('0x11')],_0x3dd162,'\x20'),'Description':intUtil[_0x36bf('0x10')](_0x544ddd[_0x36bf('0x12')],_0x3dd162,'\x0a')},getCustomFields(_0x46f136,_0x3dd162));if(_0x40520b){if(_0x544ddd[_0x36bf('0x13')]==='Task'){_0x489c86[_0x36bf('0x14')]=moment[_0x36bf('0x15')]();_0x489c86[_0x36bf('0x16')]=![];_0x489c86[_0x36bf('0x17')]=![];if(_0x40520b['endUserType']===_0x36bf('0x18')||_0x40520b[_0x36bf('0x19')]===_0x36bf('0x1a')){_0x489c86[_0x36bf('0x1b')]=_0x40520b['id'];}else if(_0x40520b[_0x36bf('0x19')]===_0x36bf('0x1c')){_0x489c86[_0x36bf('0x1d')]=_0x40520b['id'];}}else if(_0x544ddd['ticketType']===_0x36bf('0x1e')){if(_0x40520b[_0x36bf('0x19')]==='contact'){_0x489c86[_0x36bf('0x1f')]=_0x40520b['id'];}else if(_0x40520b[_0x36bf('0x19')]===_0x36bf('0x1c')){_0x489c86[_0x36bf('0x20')]=_0x40520b['id'];}else if(_0x40520b[_0x36bf('0x19')]==='lead'&&_0x544ddd['leadId']){_0x489c86[_0x544ddd[_0x36bf('0x21')]]=_0x40520b['id'];}else{logger[_0x36bf('0x22')](_0x36bf('0x23'));}}}return _0x772229[_0x36bf('0x24')](_0x544ddd[_0x36bf('0x13')])['create'](_0x489c86);}function getUser(_0x6c45f9,_0x86e28c,_0x19806d){if(!_[_0x36bf('0x25')](_0x86e28c)&&intUtil[_0x36bf('0x26')](_0x86e28c)){var _0x5d83c6={'Email':_0x86e28c};var _0x319e83={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x19806d[_0x36bf('0x24')](_0x36bf('0x27'))['find'](_0x5d83c6,_0x319e83)[_0x36bf('0x28')]()[_0x36bf('0x29')](function(_0x1b31df){if(_0x1b31df[_0x36bf('0x2a')]){var _0x349e79=_[_0x36bf('0x2b')](_0x1b31df,function(_0x120639){return _0x120639[_0x36bf('0x2c')]===_0x86e28c;});if(_0x349e79){logger['info'](_0x36bf('0x2d'),_0x86e28c);return BPromise[_0x36bf('0x2e')]({'id':_0x349e79['Id'],'name':_0x349e79[_0x36bf('0x2f')]});}}else{logger[_0x36bf('0x22')](_0x36bf('0x30'),_0x86e28c);return _0x19806d[_0x36bf('0x31')]()[_0x36bf('0x29')](function(_0x67ccf7){return BPromise[_0x36bf('0x2e')]({'id':_0x67ccf7[_0x36bf('0x32')],'name':_0x67ccf7['display_name']});});}});}else{logger['info'](_0x36bf('0x30'),_0x86e28c);return _0x19806d[_0x36bf('0x31')]()['then'](function(_0xaee738){return BPromise[_0x36bf('0x2e')]({'id':_0xaee738[_0x36bf('0x32')],'name':_0xaee738['display_name']});});}}function getEndUser(_0x3bc644,_0x4397fe,_0x4159e8,_0x1e1370,_0x3b7f88){var _0x3f1781={'$or':{'Phone':_0x1e1370}};var _0x4ad2a6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x36bf('0x29')](function(){logger[_0x36bf('0x22')](_0x36bf('0x33'),_0x1e1370,_0x4397fe[_0x36bf('0x34')]);switch(_0x4397fe['moduleSearch']){case _0x36bf('0x35'):var _0x3a6fb8=_[_0x36bf('0x36')](_0x3f1781);if(_0x4397fe['additionalSearchContact']){var _0x2ee1b9={};_0x2ee1b9[_0x4397fe[_0x36bf('0x37')]]=_0x1e1370;_['merge'](_0x3a6fb8['$or'],_0x2ee1b9);}return _0x3b7f88[_0x36bf('0x24')](_0x36bf('0x38'))[_0x36bf('0x2b')](_0x3a6fb8,_0x4ad2a6)['execute']()[_0x36bf('0x29')](function(_0x98c432){if(_0x98c432&&_0x98c432[_0x36bf('0x2a')]){return _0x98c432;}else{var _0x47a22c=_['cloneDeep'](_0x3f1781);if(_0x4397fe[_0x36bf('0x39')]){var _0x48c2f9={};_0x48c2f9[_0x4397fe[_0x36bf('0x39')]]=_0x1e1370;_[_0x36bf('0x3a')](_0x47a22c[_0x36bf('0x3b')],_0x48c2f9);}return _0x3b7f88['sobject'](_0x36bf('0x3c'))[_0x36bf('0x2b')](_0x47a22c,_0x4ad2a6);}});case _0x36bf('0x3d'):var _0x5cc539=_['cloneDeep'](_0x3f1781);if(_0x4397fe[_0x36bf('0x3e')]){var _0x2ee1b9={};_0x2ee1b9[_0x4397fe[_0x36bf('0x3e')]]=_0x1e1370;_[_0x36bf('0x3a')](_0x5cc539[_0x36bf('0x3b')],_0x2ee1b9);}return _0x3b7f88[_0x36bf('0x24')](_0x36bf('0x3f'))[_0x36bf('0x2b')](_0x5cc539,_0x4ad2a6)[_0x36bf('0x28')]()['then'](function(_0x353b50){if(_0x353b50&&_0x353b50['length']){return _0x353b50;}else{var _0x2d0579=_[_0x36bf('0x36')](_0x3f1781);if(_0x4397fe[_0x36bf('0x37')]){var _0x1c6be5={};_0x1c6be5[_0x4397fe[_0x36bf('0x37')]]=_0x1e1370;_[_0x36bf('0x3a')](_0x2d0579[_0x36bf('0x3b')],_0x1c6be5);}return _0x3b7f88[_0x36bf('0x24')](_0x36bf('0x38'))['find'](_0x2d0579,_0x4ad2a6)['then'](function(_0xdbf588){if(_0xdbf588&&_0xdbf588[_0x36bf('0x2a')]){return _0xdbf588;}else{var _0x1daefb=_[_0x36bf('0x36')](_0x3f1781);if(_0x4397fe[_0x36bf('0x39')]){var _0x5cb7c9={};_0x5cb7c9[_0x4397fe[_0x36bf('0x39')]]=_0x1e1370;_[_0x36bf('0x3a')](_0x1daefb[_0x36bf('0x3b')],_0x5cb7c9);}return _0x3b7f88[_0x36bf('0x24')]('Lead')[_0x36bf('0x2b')](_0x1daefb,_0x4ad2a6);}});}});case _0x36bf('0x18'):var _0x3a6fb8=_[_0x36bf('0x36')](_0x3f1781);if(_0x4397fe['additionalSearchContact']){var _0x2ee1b9={};_0x2ee1b9[_0x4397fe['additionalSearchContact']]=_0x1e1370;_['merge'](_0x3a6fb8[_0x36bf('0x3b')],_0x2ee1b9);}return _0x3b7f88[_0x36bf('0x24')](_0x36bf('0x38'))[_0x36bf('0x2b')](_0x3a6fb8,_0x4ad2a6)[_0x36bf('0x28')]();case _0x36bf('0x1a'):var _0x1b8703=_[_0x36bf('0x36')](_0x3f1781);if(_0x4397fe[_0x36bf('0x39')]){var _0x2ee1b9={};_0x2ee1b9[_0x4397fe[_0x36bf('0x39')]]=_0x1e1370;_[_0x36bf('0x3a')](_0x1b8703['$or'],_0x2ee1b9);}return _0x3b7f88['sobject']('Lead')[_0x36bf('0x2b')](_0x1b8703,_0x4ad2a6);case _0x36bf('0x1c'):var _0x5cc539=_['cloneDeep'](_0x3f1781);if(_0x4397fe[_0x36bf('0x3e')]){var _0x2ee1b9={};_0x2ee1b9[_0x4397fe[_0x36bf('0x3e')]]=_0x1e1370;_[_0x36bf('0x3a')](_0x5cc539[_0x36bf('0x3b')],_0x2ee1b9);}return _0x3b7f88[_0x36bf('0x24')](_0x36bf('0x3f'))[_0x36bf('0x2b')](_0x5cc539,_0x4ad2a6);default:return null;}})[_0x36bf('0x29')](function(_0x32a501){if(_0x32a501&&_0x32a501[_0x36bf('0x2a')]){var _0x460de0=_['first'](_0x32a501);if(_0x460de0){return BPromise['resolve']({'id':_0x460de0['Id'],'name':_0x460de0[_0x36bf('0x2f')],'phone':_0x460de0[_0x36bf('0x40')],'endUserType':_0x460de0[_0x36bf('0x41')][_0x36bf('0x42')][_0x36bf('0x43')]()});}}})[_0x36bf('0x29')](function(_0x55698c){if(_0x55698c){logger[_0x36bf('0x22')](_0x36bf('0x44'),_0x55698c['endUserType'],_0x1e1370);return BPromise['resolve'](_0x55698c);}else{logger[_0x36bf('0x22')](_0x36bf('0x45'),_0x1e1370);var _0x10f0ba={'Phone':_0x1e1370};if(_0x4397fe['moduleCreate']){if(_0x4397fe[_0x36bf('0x46')]===_0x36bf('0x18')){logger[_0x36bf('0x22')](_0x36bf('0x47'),_0x1e1370,_0x4397fe[_0x36bf('0x46')]);_0x10f0ba[_0x36bf('0x48')]=_0x4159e8!==''?_0x4159e8:util[_0x36bf('0x49')](_0x36bf('0x4a'),_0x1e1370);}else if(_0x4397fe[_0x36bf('0x46')]===_0x36bf('0x1a')){logger[_0x36bf('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1e1370,_0x4397fe[_0x36bf('0x46')]);_0x10f0ba[_0x36bf('0x48')]=_0x4159e8!==_0x36bf('0x4b')?_0x4159e8:util['format']('Caller\x20-\x20%s',_0x1e1370);_0x10f0ba[_0x36bf('0x4c')]=_0x36bf('0x4d');}else if(_0x4397fe[_0x36bf('0x46')]===_0x36bf('0x1c')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1e1370,_0x4397fe[_0x36bf('0x46')]);_0x10f0ba[_0x36bf('0x2f')]=_0x4159e8!==''?_0x4159e8:util[_0x36bf('0x49')](_0x36bf('0x4a'),_0x1e1370);}else{return null;}}return _0x3b7f88['sobject'](_[_0x36bf('0x4e')](_0x4397fe[_0x36bf('0x46')]))[_0x36bf('0x4f')](_0x10f0ba)[_0x36bf('0x29')](function(_0x5a1e50){return BPromise[_0x36bf('0x2e')]({'id':_0x5a1e50['id'],'endUserType':_0x4397fe[_0x36bf('0x46')]});});}});}function getCustomFields(_0x390fc0,_0x3ed9ae){var _0xdf295d={};if(_0x390fc0['length']>0x0){_['forEach'](_0x390fc0,function(_0x53ee0e){if(_[_0x36bf('0x50')]([_0x36bf('0x51'),'picklist'],_0x53ee0e[_0x36bf('0x42')])&&_0x53ee0e[_0x36bf('0x52')]){_0xdf295d[_0x53ee0e['idField']]=_0x53ee0e['content'][_0x36bf('0x53')]();}else if(_0x53ee0e[_0x36bf('0x42')]===_0x36bf('0x54')&&_0x53ee0e[_0x36bf('0x55')]&&_0x53ee0e[_0x36bf('0x52')]){_0x3ed9ae[_0x53ee0e[_0x36bf('0x55')]]&&(_0xdf295d[_0x53ee0e[_0x36bf('0x52')]]=_0x3ed9ae[_0x53ee0e[_0x36bf('0x55')]]['toString']());}else if(_0x53ee0e[_0x36bf('0x42')]===_0x36bf('0x56')&&_0x53ee0e[_0x36bf('0x57')]&&_0x53ee0e[_0x36bf('0x57')][_0x36bf('0x58')]&&_0x53ee0e[_0x36bf('0x52')]){_0x3ed9ae[_0x53ee0e['Variable']['name'][_0x36bf('0x43')]()]&&(_0xdf295d[_0x53ee0e[_0x36bf('0x52')]]=_0x3ed9ae[_0x53ee0e['Variable'][_0x36bf('0x58')]['toLowerCase']()]['toString']());}});}return _0xdf295d;}function getConnection(_0x23b1ba){var _0x4d082a=_0x23b1ba['password']['concat'](_0x23b1ba[_0x36bf('0x59')]);var _0x460bd5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x23b1ba['remoteUri']||_0x36bf('0x5a'),'clientId':_0x23b1ba[_0x36bf('0x5b')],'clientSecret':_0x23b1ba['clientSecret']}});return _0x460bd5[_0x36bf('0x5c')](_0x23b1ba[_0x36bf('0x5d')],_0x4d082a)[_0x36bf('0x29')](function(){logger[_0x36bf('0x22')](_0x36bf('0x5e'));return _0x460bd5;});}exports[_0x36bf('0x5f')]=function(_0x4dee0f,_0x47ad4c,_0x21d9ac,_0x9fe6e,_0x5ec239,_0x35af8a){var _0x51314a,_0x5d11ee,_0x2e3258,_0x233a13;_0x35af8a[_0x36bf('0x60')]=intUtil[_0x36bf('0x61')](_0x35af8a['serverUrl']);_0x35af8a[_0x36bf('0x62')]=intUtil[_0x36bf('0x61')](_0x35af8a[_0x36bf('0x62')]);if(_0x5ec239&&_0x5ec239['monitor_format']){logger['info'](_0x36bf('0x63'),_0x36bf('0x64'));_0x47ad4c[_0x36bf('0x65')]=util[_0x36bf('0x49')](_0x36bf('0x66'),_0x35af8a[_0x36bf('0x60')],_0x47ad4c[_0x36bf('0x67')],md5(_0x47ad4c['uniqueid']));}else{_0x47ad4c[_0x36bf('0x65')]='';}return getConnection(_0x35af8a)['then'](function(_0x2ed19b){_0x233a13=_0x2ed19b;return getUser(_0x35af8a,_0x9fe6e[_0x36bf('0x68')],_0x233a13);})[_0x36bf('0x29')](function(_0x4ea309){_0x51314a=_0x4ea309;return getEndUser(_0x35af8a,_0x21d9ac,_0x47ad4c[_0x36bf('0x69')],_0x47ad4c[_0x36bf('0x6a')],_0x233a13);})[_0x36bf('0x29')](function(_0x14fd34){_0x5d11ee=_0x14fd34;return getTicket(_0x35af8a,_0x51314a,_0x5d11ee,_0x21d9ac,_0x47ad4c,_0x21d9ac[_0x36bf('0x6b')],_0x233a13,_0x36bf('0x5f'));})[_0x36bf('0x29')](function(_0xbe7129){_0x2e3258=_0xbe7129;logger[_0x36bf('0x22')](_0x36bf('0x6c'),_0x2e3258['id']);logger[_0x36bf('0x22')](_0x36bf('0x6d'),_0x2e3258['id'],_0x9fe6e[_0x36bf('0x58')],_0x35af8a['type']);switch(_0x35af8a[_0x36bf('0x42')]){case'integrationTab':emit(util['format'](_0x36bf('0x6e'),_0x9fe6e[_0x36bf('0x58')]),_0x36bf('0x6f'),{'recordId':_0x2e3258['id']});break;case _0x36bf('0x70'):emit(util[_0x36bf('0x49')](_0x36bf('0x6e'),_0x9fe6e[_0x36bf('0x58')]),'trigger:browser:url',{'uri':util[_0x36bf('0x49')](_0x36bf('0x71'),_0x233a13[_0x36bf('0x72')],_0x2e3258['id'])});break;default:logger[_0x36bf('0x73')](_0x36bf('0x74'));}})[_0x36bf('0x75')](function(_0x3f2529){logger['error'](_0x36bf('0x63'),_0x3f2529);});};exports[_0x36bf('0x76')]=function(_0x3aa6d9,_0x50234e,_0x233e28,_0x578d74,_0x233886,_0x40ab00,_0x5680c2){var _0x2fbbc9,_0x56d228,_0x13e825,_0x2a2912;_0x40ab00[_0x36bf('0x60')]=intUtil['stripTrailingSlash'](_0x40ab00[_0x36bf('0x60')]);_0x40ab00[_0x36bf('0x62')]=intUtil[_0x36bf('0x61')](_0x40ab00[_0x36bf('0x62')]);if(_0x5680c2&&_0x5680c2[_0x36bf('0x77')]&&_0x5680c2['recordingFormat']!=='none'){logger[_0x36bf('0x22')](_0x36bf('0x78'),_0x36bf('0x64'));_0x50234e['recordingURL']=util[_0x36bf('0x49')](_0x36bf('0x66'),_0x40ab00[_0x36bf('0x60')],_0x50234e[_0x36bf('0x67')],md5(_0x50234e[_0x36bf('0x67')]));}return getConnection(_0x40ab00)[_0x36bf('0x29')](function(_0x4d2224){_0x2a2912=_0x4d2224;return getUser(_0x40ab00,_0x578d74[_0x36bf('0x68')],_0x2a2912);})[_0x36bf('0x29')](function(_0x519fe2){_0x2fbbc9=_0x519fe2;return getEndUser(_0x40ab00,_0x233e28,_0x50234e[_0x36bf('0x79')],_0x50234e[_0x36bf('0x7a')],_0x2a2912);})[_0x36bf('0x29')](function(_0x253395){_0x56d228=_0x253395;return getTicket(_0x40ab00,_0x2fbbc9,_0x56d228,_0x233e28,_0x50234e,_0x233e28[_0x36bf('0x6b')],_0x2a2912,_0x36bf('0x76'));})[_0x36bf('0x29')](function(_0x5a2d14){_0x13e825=_0x5a2d14;logger['info'](_0x36bf('0x7b'),_0x13e825['id']);logger[_0x36bf('0x22')](_0x36bf('0x7c'),_0x13e825['id'],_0x578d74['name'],_0x40ab00[_0x36bf('0x42')]);switch(_0x40ab00[_0x36bf('0x42')]){case'integrationTab':emit(util[_0x36bf('0x49')]('user:%s',_0x578d74[_0x36bf('0x58')]),_0x36bf('0x6f'),{'recordId':_0x13e825['id']});break;case _0x36bf('0x70'):emit(util[_0x36bf('0x49')](_0x36bf('0x6e'),_0x578d74[_0x36bf('0x58')]),_0x36bf('0x7d'),{'uri':util[_0x36bf('0x49')](_0x36bf('0x71'),_0x2a2912['instanceUrl'],_0x13e825['id'])});break;default:logger[_0x36bf('0x73')](_0x36bf('0x78'),_0x36bf('0x7e'));}})[_0x36bf('0x75')](function(_0x2cb41b){logger['error'](_0x36bf('0x78'),_0x2cb41b);});};exports[_0x36bf('0x7f')]=function(_0x4c783e,_0x5c71ad,_0x173158,_0x349d3e,_0x20d4ee,_0x2cf804){var _0x4000fc,_0x30b43d,_0x2ed311,_0x492a71;_0x2cf804[_0x36bf('0x60')]=intUtil[_0x36bf('0x61')](_0x2cf804['serverUrl']);_0x2cf804[_0x36bf('0x62')]=intUtil[_0x36bf('0x61')](_0x2cf804[_0x36bf('0x62')]);if(_0x20d4ee&&_0x20d4ee[_0x36bf('0x80')]){logger[_0x36bf('0x22')]('['+_0x5c71ad[_0x36bf('0x81')][_0x36bf('0x82')]()+']','Recording\x20is\x20enabled!');_0x5c71ad[_0x36bf('0x65')]=util[_0x36bf('0x49')](_0x36bf('0x66'),_0x2cf804['serverUrl'],_0x5c71ad[_0x36bf('0x67')],md5(_0x5c71ad[_0x36bf('0x67')]));}else{_0x5c71ad[_0x36bf('0x65')]='';}return getConnection(_0x2cf804)[_0x36bf('0x29')](function(_0x4b3137){_0x492a71=_0x4b3137;if(!_[_0x36bf('0x25')](_0x349d3e)){return getUser(_0x2cf804,_0x349d3e[_0x36bf('0x58')],_0x492a71);}else{return getUser(_0x2cf804,null,_0x492a71);}})[_0x36bf('0x29')](function(_0x5a21b1){_0x4000fc=_0x5a21b1;return getEndUser(_0x2cf804,_0x173158,_0x5c71ad[_0x36bf('0x69')],_0x5c71ad['calleridnum'],_0x492a71);})[_0x36bf('0x29')](function(_0x439f02){_0x30b43d=_0x439f02;return getTicket(_0x2cf804,_0x4000fc,_0x30b43d,_0x173158,_0x5c71ad,_0x173158[_0x36bf('0x6b')],_0x492a71);})['then'](function(_0x2eb7a8){_0x2ed311=_0x2eb7a8;logger[_0x36bf('0x22')]('['+_0x5c71ad['lastevent'][_0x36bf('0x82')]()+']\x20Ticket\x20%s\x20created.',_0x2ed311['id']);logger[_0x36bf('0x22')]('['+_0x5c71ad['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x2cf804['type']);})['catch'](function(_0x30eab2){logger['error']('['+_0x5c71ad[_0x36bf('0x81')][_0x36bf('0x82')]()+']',_0x30eab2);});}; \ No newline at end of file +var _0xbedc=['Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','$or','Contact','execute','length','cloneDeep','additionalSearchLead','account_contact_lead','additionalSearchAccount','merge','Account','additionalSearchContact','Lead','first','Phone','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','lead','WhoId','endUserType','account','WhatId','Case','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','sobject','User','find','then','Email','info','Name'];(function(_0x922956,_0x1fe605){var _0x3a4d5f=function(_0x26835a){while(--_0x26835a){_0x922956['push'](_0x922956['shift']());}};_0x3a4d5f(++_0x1fe605);}(_0xbedc,0x15f));var _0xcbed=function(_0x256e87,_0x489c85){_0x256e87=_0x256e87-0x0;var _0x2e0861=_0xbedc[_0x256e87];return _0x2e0861;};'use strict';var _=require(_0xcbed('0x0'));var rp=require(_0xcbed('0x1'));var moment=require(_0xcbed('0x2'));var BPromise=require(_0xcbed('0x3'));var md5=require(_0xcbed('0x4'));var jsforce=require(_0xcbed('0x5'));var util=require(_0xcbed('0x6'));var Redis=require('ioredis');var intUtil=require(_0xcbed('0x7'));var config=require(_0xcbed('0x8'));var logger=require(_0xcbed('0x9'))(_0xcbed('0xa'));config[_0xcbed('0xb')]=_[_0xcbed('0xc')](config[_0xcbed('0xb')],{'host':_0xcbed('0xd'),'port':0x18eb});var io=require(_0xcbed('0xe'))(new Redis(config['redis']));function emit(_0x5b4a8b,_0x1e9641,_0x19ce77){io['to'](_0x5b4a8b)[_0xcbed('0xf')](_0x1e9641,_0x19ce77);}function getTicket(_0x1de97a,_0x2e1f3c,_0x561cf8,_0x3427a9,_0x334cc6,_0x5e94cc,_0x1d5e14,_0x211f0c){var _0x158b31=Object['assign']({},{'OwnerId':_0x2e1f3c['id'],'Subject':intUtil['getString'](_0x3427a9[_0xcbed('0x10')],_0x334cc6,'\x20'),'Description':intUtil[_0xcbed('0x11')](_0x3427a9['Descriptions'],_0x334cc6,'\x0a')},getCustomFields(_0x5e94cc,_0x334cc6));if(_0x561cf8){if(_0x3427a9[_0xcbed('0x12')]===_0xcbed('0x13')){_0x158b31[_0xcbed('0x14')]=moment[_0xcbed('0x15')]();_0x158b31[_0xcbed('0x16')]=![];_0x158b31[_0xcbed('0x17')]=![];if(_0x561cf8['endUserType']===_0xcbed('0x18')||_0x561cf8['endUserType']===_0xcbed('0x19')){_0x158b31[_0xcbed('0x1a')]=_0x561cf8['id'];}else if(_0x561cf8[_0xcbed('0x1b')]===_0xcbed('0x1c')){_0x158b31[_0xcbed('0x1d')]=_0x561cf8['id'];}}else if(_0x3427a9[_0xcbed('0x12')]===_0xcbed('0x1e')){if(_0x561cf8['endUserType']===_0xcbed('0x18')){_0x158b31['ContactId']=_0x561cf8['id'];}else if(_0x561cf8[_0xcbed('0x1b')]===_0xcbed('0x1c')){_0x158b31['AccountId']=_0x561cf8['id'];}else if(_0x561cf8[_0xcbed('0x1b')]==='lead'&&_0x3427a9['leadId']){_0x158b31[_0x3427a9[_0xcbed('0x1f')]]=_0x561cf8['id'];}else{logger['info'](_0xcbed('0x20'));}}}return _0x1d5e14['sobject'](_0x3427a9['ticketType'])[_0xcbed('0x21')](_0x158b31);}function getUser(_0x4b61bf,_0x4afab2,_0x580bcf){if(!_[_0xcbed('0x22')](_0x4afab2)&&intUtil['validateEmail'](_0x4afab2)){var _0x2df128={'Email':_0x4afab2};var _0x195c6a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x580bcf[_0xcbed('0x23')](_0xcbed('0x24'))[_0xcbed('0x25')](_0x2df128,_0x195c6a)['execute']()[_0xcbed('0x26')](function(_0x4b12a3){if(_0x4b12a3['length']){var _0x23be7f=_[_0xcbed('0x25')](_0x4b12a3,function(_0x4208dc){return _0x4208dc[_0xcbed('0x27')]===_0x4afab2;});if(_0x23be7f){logger[_0xcbed('0x28')]('Agent\x20%s\x20found.',_0x4afab2);return BPromise['resolve']({'id':_0x23be7f['Id'],'name':_0x23be7f[_0xcbed('0x29')]});}}else{logger['info'](_0xcbed('0x2a'),_0x4afab2);return _0x580bcf['identity']()[_0xcbed('0x26')](function(_0x3d31e9){return BPromise[_0xcbed('0x2b')]({'id':_0x3d31e9[_0xcbed('0x2c')],'name':_0x3d31e9[_0xcbed('0x2d')]});});}});}else{logger[_0xcbed('0x28')](_0xcbed('0x2a'),_0x4afab2);return _0x580bcf[_0xcbed('0x2e')]()[_0xcbed('0x26')](function(_0x6e8225){return BPromise['resolve']({'id':_0x6e8225[_0xcbed('0x2c')],'name':_0x6e8225['display_name']});});}}function getEndUser(_0x1d80bf,_0x231806,_0x98b92a,_0x26a87f,_0x36df21){var _0xa1418a={'$or':{'Phone':_0x26a87f}};var _0x536166={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xcbed('0x2b')]()['then'](function(){logger[_0xcbed('0x28')](_0xcbed('0x2f'),_0x26a87f,_0x231806[_0xcbed('0x30')]);switch(_0x231806[_0xcbed('0x30')]){case _0xcbed('0x31'):var _0x38d49a=_['cloneDeep'](_0xa1418a);if(_0x231806['additionalSearchContact']){var _0x240957={};_0x240957[_0x231806['additionalSearchContact']]=_0x26a87f;_['merge'](_0x38d49a[_0xcbed('0x32')],_0x240957);}return _0x36df21[_0xcbed('0x23')](_0xcbed('0x33'))[_0xcbed('0x25')](_0x38d49a,_0x536166)[_0xcbed('0x34')]()[_0xcbed('0x26')](function(_0x8f3d02){if(_0x8f3d02&&_0x8f3d02[_0xcbed('0x35')]){return _0x8f3d02;}else{var _0x4866a4=_[_0xcbed('0x36')](_0xa1418a);if(_0x231806[_0xcbed('0x37')]){var _0x244045={};_0x244045[_0x231806[_0xcbed('0x37')]]=_0x26a87f;_['merge'](_0x4866a4[_0xcbed('0x32')],_0x244045);}return _0x36df21[_0xcbed('0x23')]('Lead')[_0xcbed('0x25')](_0x4866a4,_0x536166);}});case _0xcbed('0x38'):var _0x2ee41f=_[_0xcbed('0x36')](_0xa1418a);if(_0x231806[_0xcbed('0x39')]){var _0x240957={};_0x240957[_0x231806[_0xcbed('0x39')]]=_0x26a87f;_[_0xcbed('0x3a')](_0x2ee41f[_0xcbed('0x32')],_0x240957);}return _0x36df21['sobject'](_0xcbed('0x3b'))[_0xcbed('0x25')](_0x2ee41f,_0x536166)[_0xcbed('0x34')]()['then'](function(_0x1392a7){if(_0x1392a7&&_0x1392a7[_0xcbed('0x35')]){return _0x1392a7;}else{var _0xe817f3=_[_0xcbed('0x36')](_0xa1418a);if(_0x231806[_0xcbed('0x3c')]){var _0x350adf={};_0x350adf[_0x231806[_0xcbed('0x3c')]]=_0x26a87f;_[_0xcbed('0x3a')](_0xe817f3[_0xcbed('0x32')],_0x350adf);}return _0x36df21['sobject'](_0xcbed('0x33'))[_0xcbed('0x25')](_0xe817f3,_0x536166)['then'](function(_0x13cc5b){if(_0x13cc5b&&_0x13cc5b[_0xcbed('0x35')]){return _0x13cc5b;}else{var _0x3e298c=_[_0xcbed('0x36')](_0xa1418a);if(_0x231806[_0xcbed('0x37')]){var _0x4e9d9e={};_0x4e9d9e[_0x231806[_0xcbed('0x37')]]=_0x26a87f;_[_0xcbed('0x3a')](_0x3e298c[_0xcbed('0x32')],_0x4e9d9e);}return _0x36df21[_0xcbed('0x23')](_0xcbed('0x3d'))[_0xcbed('0x25')](_0x3e298c,_0x536166);}});}});case _0xcbed('0x18'):var _0x38d49a=_[_0xcbed('0x36')](_0xa1418a);if(_0x231806[_0xcbed('0x3c')]){var _0x240957={};_0x240957[_0x231806[_0xcbed('0x3c')]]=_0x26a87f;_[_0xcbed('0x3a')](_0x38d49a[_0xcbed('0x32')],_0x240957);}return _0x36df21[_0xcbed('0x23')](_0xcbed('0x33'))[_0xcbed('0x25')](_0x38d49a,_0x536166)['execute']();case _0xcbed('0x19'):var _0x53142e=_['cloneDeep'](_0xa1418a);if(_0x231806[_0xcbed('0x37')]){var _0x240957={};_0x240957[_0x231806[_0xcbed('0x37')]]=_0x26a87f;_[_0xcbed('0x3a')](_0x53142e[_0xcbed('0x32')],_0x240957);}return _0x36df21['sobject'](_0xcbed('0x3d'))['find'](_0x53142e,_0x536166);case _0xcbed('0x1c'):var _0x2ee41f=_['cloneDeep'](_0xa1418a);if(_0x231806['additionalSearchAccount']){var _0x240957={};_0x240957[_0x231806['additionalSearchAccount']]=_0x26a87f;_['merge'](_0x2ee41f[_0xcbed('0x32')],_0x240957);}return _0x36df21[_0xcbed('0x23')]('Account')[_0xcbed('0x25')](_0x2ee41f,_0x536166);default:return null;}})['then'](function(_0x51868c){if(_0x51868c&&_0x51868c[_0xcbed('0x35')]){var _0x161808=_[_0xcbed('0x3e')](_0x51868c);if(_0x161808){return BPromise[_0xcbed('0x2b')]({'id':_0x161808['Id'],'name':_0x161808[_0xcbed('0x29')],'phone':_0x161808[_0xcbed('0x3f')],'endUserType':_0x161808['attributes'][_0xcbed('0x40')][_0xcbed('0x41')]()});}}})[_0xcbed('0x26')](function(_0x3fe836){if(_0x3fe836){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x3fe836[_0xcbed('0x1b')],_0x26a87f);return BPromise[_0xcbed('0x2b')](_0x3fe836);}else{logger[_0xcbed('0x28')](_0xcbed('0x42'),_0x26a87f);var _0x991a66={'Phone':_0x26a87f};if(_0x231806[_0xcbed('0x43')]){if(_0x231806['moduleCreate']===_0xcbed('0x18')){logger['info'](_0xcbed('0x44'),_0x26a87f,_0x231806[_0xcbed('0x43')]);_0x991a66[_0xcbed('0x45')]=_0x98b92a!==_0xcbed('0x46')?_0x98b92a:util[_0xcbed('0x47')](_0xcbed('0x48'),_0x26a87f);}else if(_0x231806[_0xcbed('0x43')]==='lead'){logger[_0xcbed('0x28')](_0xcbed('0x44'),_0x26a87f,_0x231806[_0xcbed('0x43')]);_0x991a66[_0xcbed('0x45')]=_0x98b92a!==''?_0x98b92a:util[_0xcbed('0x47')](_0xcbed('0x48'),_0x26a87f);_0x991a66['Company']=_0xcbed('0x49');}else if(_0x231806[_0xcbed('0x43')]==='account'){logger[_0xcbed('0x28')](_0xcbed('0x44'),_0x26a87f,_0x231806['moduleCreate']);_0x991a66[_0xcbed('0x29')]=_0x98b92a!==_0xcbed('0x46')?_0x98b92a:util[_0xcbed('0x47')](_0xcbed('0x48'),_0x26a87f);}else{return null;}}return _0x36df21[_0xcbed('0x23')](_['upperFirst'](_0x231806[_0xcbed('0x43')]))[_0xcbed('0x21')](_0x991a66)[_0xcbed('0x26')](function(_0x4c644d){return BPromise[_0xcbed('0x2b')]({'id':_0x4c644d['id'],'endUserType':_0x231806[_0xcbed('0x43')]});});}});}function getCustomFields(_0x5b363b,_0x46ed64){var _0x5d943c={};if(_0x5b363b[_0xcbed('0x35')]>0x0){_[_0xcbed('0x4a')](_0x5b363b,function(_0x488692){if(_[_0xcbed('0x4b')]([_0xcbed('0x4c'),_0xcbed('0x4d')],_0x488692[_0xcbed('0x40')])&&_0x488692[_0xcbed('0x4e')]){_0x5d943c[_0x488692['idField']]=_0x488692[_0xcbed('0x4f')][_0xcbed('0x50')]();}else if(_0x488692[_0xcbed('0x40')]===_0xcbed('0x51')&&_0x488692[_0xcbed('0x52')]&&_0x488692[_0xcbed('0x4e')]){_0x46ed64[_0x488692['variableName']]&&(_0x5d943c[_0x488692[_0xcbed('0x4e')]]=_0x46ed64[_0x488692[_0xcbed('0x52')]]['toString']());}else if(_0x488692[_0xcbed('0x40')]===_0xcbed('0x53')&&_0x488692[_0xcbed('0x54')]&&_0x488692[_0xcbed('0x54')][_0xcbed('0x55')]&&_0x488692[_0xcbed('0x4e')]){_0x46ed64[_0x488692[_0xcbed('0x54')][_0xcbed('0x55')][_0xcbed('0x41')]()]&&(_0x5d943c[_0x488692[_0xcbed('0x4e')]]=_0x46ed64[_0x488692[_0xcbed('0x54')][_0xcbed('0x55')][_0xcbed('0x41')]()][_0xcbed('0x50')]());}});}return _0x5d943c;}function getConnection(_0xeffb31){var _0x504fe7=_0xeffb31['password']['concat'](_0xeffb31[_0xcbed('0x56')]);var _0x46871e=new jsforce[(_0xcbed('0x57'))]({'oauth2':{'loginUrl':_0xeffb31[_0xcbed('0x58')]||_0xcbed('0x59'),'clientId':_0xeffb31[_0xcbed('0x5a')],'clientSecret':_0xeffb31['clientSecret']}});return _0x46871e[_0xcbed('0x5b')](_0xeffb31[_0xcbed('0x5c')],_0x504fe7)[_0xcbed('0x26')](function(){logger[_0xcbed('0x28')](_0xcbed('0x5d'));return _0x46871e;});}exports[_0xcbed('0x5e')]=function(_0x5d3d2d,_0x1e5254,_0x8fb797,_0x30c760,_0x50d9aa,_0x1b5993){var _0x475632,_0x50d3b0,_0x41f639,_0x33e2cb;_0x1b5993['serverUrl']=intUtil[_0xcbed('0x5f')](_0x1b5993[_0xcbed('0x60')]);_0x1b5993[_0xcbed('0x58')]=intUtil[_0xcbed('0x5f')](_0x1b5993[_0xcbed('0x58')]);if(_0x50d9aa&&_0x50d9aa['monitor_format']){logger['info'](_0xcbed('0x61'),_0xcbed('0x62'));_0x1e5254['recordingURL']=util[_0xcbed('0x47')](_0xcbed('0x63'),_0x1b5993[_0xcbed('0x60')],_0x1e5254['uniqueid'],md5(_0x1e5254[_0xcbed('0x64')]));}else{_0x1e5254[_0xcbed('0x65')]='';}return getConnection(_0x1b5993)['then'](function(_0x5112b1){_0x33e2cb=_0x5112b1;return getUser(_0x1b5993,_0x30c760['email'],_0x33e2cb);})['then'](function(_0x5ee5fc){_0x475632=_0x5ee5fc;return getEndUser(_0x1b5993,_0x8fb797,_0x1e5254[_0xcbed('0x66')],_0x1e5254['calleridnum'],_0x33e2cb);})[_0xcbed('0x26')](function(_0x196ee0){_0x50d3b0=_0x196ee0;return getTicket(_0x1b5993,_0x475632,_0x50d3b0,_0x8fb797,_0x1e5254,_0x8fb797[_0xcbed('0x67')],_0x33e2cb,_0xcbed('0x5e'));})['then'](function(_0x214e6a){_0x41f639=_0x214e6a;logger[_0xcbed('0x28')](_0xcbed('0x68'),_0x41f639['id']);logger[_0xcbed('0x28')](_0xcbed('0x69'),_0x41f639['id'],_0x30c760[_0xcbed('0x55')],_0x1b5993[_0xcbed('0x40')]);switch(_0x1b5993['type']){case _0xcbed('0x6a'):emit(util[_0xcbed('0x47')]('user:%s',_0x30c760['name']),_0xcbed('0x6b'),{'recordId':_0x41f639['id']});break;case'newTab':emit(util[_0xcbed('0x47')](_0xcbed('0x6c'),_0x30c760[_0xcbed('0x55')]),_0xcbed('0x6d'),{'uri':util['format'](_0xcbed('0x6e'),_0x33e2cb[_0xcbed('0x6f')],_0x41f639['id'])});break;default:logger[_0xcbed('0x70')](_0xcbed('0x71'));}})[_0xcbed('0x72')](function(_0x2d82d6){logger[_0xcbed('0x70')](_0xcbed('0x61'),_0x2d82d6);});};exports['outbound']=function(_0x218a89,_0xe0f916,_0x1b7a9f,_0x73cc2c,_0x49ab9b,_0x35e91c,_0x5297e0){var _0x414e07,_0x43c03b,_0x19425e,_0x42abb3;_0x35e91c[_0xcbed('0x60')]=intUtil[_0xcbed('0x5f')](_0x35e91c[_0xcbed('0x60')]);_0x35e91c['remoteUri']=intUtil[_0xcbed('0x5f')](_0x35e91c[_0xcbed('0x58')]);if(_0x5297e0&&_0x5297e0[_0xcbed('0x73')]&&_0x5297e0[_0xcbed('0x73')]!==_0xcbed('0x74')){logger['info'](_0xcbed('0x75'),_0xcbed('0x62'));_0xe0f916['recordingURL']=util[_0xcbed('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35e91c[_0xcbed('0x60')],_0xe0f916[_0xcbed('0x64')],md5(_0xe0f916[_0xcbed('0x64')]));}return getConnection(_0x35e91c)[_0xcbed('0x26')](function(_0x252168){_0x42abb3=_0x252168;return getUser(_0x35e91c,_0x73cc2c[_0xcbed('0x76')],_0x42abb3);})[_0xcbed('0x26')](function(_0x137d73){_0x414e07=_0x137d73;return getEndUser(_0x35e91c,_0x1b7a9f,_0xe0f916[_0xcbed('0x77')],_0xe0f916[_0xcbed('0x78')],_0x42abb3);})[_0xcbed('0x26')](function(_0x358e41){_0x43c03b=_0x358e41;return getTicket(_0x35e91c,_0x414e07,_0x43c03b,_0x1b7a9f,_0xe0f916,_0x1b7a9f[_0xcbed('0x67')],_0x42abb3,_0xcbed('0x79'));})[_0xcbed('0x26')](function(_0x132bed){_0x19425e=_0x132bed;logger[_0xcbed('0x28')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x19425e['id']);logger[_0xcbed('0x28')](_0xcbed('0x7a'),_0x19425e['id'],_0x73cc2c['name'],_0x35e91c[_0xcbed('0x40')]);switch(_0x35e91c['type']){case _0xcbed('0x6a'):emit(util[_0xcbed('0x47')](_0xcbed('0x6c'),_0x73cc2c['name']),_0xcbed('0x6b'),{'recordId':_0x19425e['id']});break;case _0xcbed('0x7b'):emit(util[_0xcbed('0x47')](_0xcbed('0x6c'),_0x73cc2c['name']),_0xcbed('0x6d'),{'uri':util[_0xcbed('0x47')](_0xcbed('0x6e'),_0x42abb3[_0xcbed('0x6f')],_0x19425e['id'])});break;default:logger[_0xcbed('0x70')](_0xcbed('0x75'),_0xcbed('0x7c'));}})['catch'](function(_0x310353){logger[_0xcbed('0x70')](_0xcbed('0x75'),_0x310353);});};exports[_0xcbed('0x7d')]=function(_0x1932ea,_0x3e8a7b,_0x57e66e,_0x5e9190,_0x27d53f,_0xd14c08){var _0x53f789,_0x3d4883,_0x2287af,_0x296ec7;_0xd14c08[_0xcbed('0x60')]=intUtil[_0xcbed('0x5f')](_0xd14c08[_0xcbed('0x60')]);_0xd14c08[_0xcbed('0x58')]=intUtil['stripTrailingSlash'](_0xd14c08[_0xcbed('0x58')]);if(_0x27d53f&&_0x27d53f['monitor_format']){logger[_0xcbed('0x28')]('['+_0x3e8a7b[_0xcbed('0x7e')][_0xcbed('0x7f')]()+']','Recording\x20is\x20enabled!');_0x3e8a7b[_0xcbed('0x65')]=util[_0xcbed('0x47')](_0xcbed('0x63'),_0xd14c08[_0xcbed('0x60')],_0x3e8a7b['uniqueid'],md5(_0x3e8a7b[_0xcbed('0x64')]));}else{_0x3e8a7b['recordingURL']='';}return getConnection(_0xd14c08)[_0xcbed('0x26')](function(_0x2565d3){_0x296ec7=_0x2565d3;if(!_[_0xcbed('0x22')](_0x5e9190)){return getUser(_0xd14c08,_0x5e9190[_0xcbed('0x55')],_0x296ec7);}else{return getUser(_0xd14c08,null,_0x296ec7);}})[_0xcbed('0x26')](function(_0x513318){_0x53f789=_0x513318;return getEndUser(_0xd14c08,_0x57e66e,_0x3e8a7b[_0xcbed('0x66')],_0x3e8a7b[_0xcbed('0x80')],_0x296ec7);})['then'](function(_0x50a46c){_0x3d4883=_0x50a46c;return getTicket(_0xd14c08,_0x53f789,_0x3d4883,_0x57e66e,_0x3e8a7b,_0x57e66e[_0xcbed('0x67')],_0x296ec7);})['then'](function(_0x1442c8){_0x2287af=_0x1442c8;logger[_0xcbed('0x28')]('['+_0x3e8a7b[_0xcbed('0x7e')]['toUpperCase']()+_0xcbed('0x81'),_0x2287af['id']);logger[_0xcbed('0x28')]('['+_0x3e8a7b[_0xcbed('0x7e')][_0xcbed('0x7f')]()+_0xcbed('0x82'),_0xd14c08[_0xcbed('0x40')]);})['catch'](function(_0x2db2b7){logger[_0xcbed('0x70')]('['+_0x3e8a7b[_0xcbed('0x7e')]['toUpperCase']()+']',_0x2db2b7);});}; \ 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 1cf2e93..47f8dba 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 _0xd344=['trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','active','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','includes','string','picklist','type','nameField','toString','idField','toLowerCase','content','variable','customField','customVariable','Variable','name','outbound','POST','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit'];(function(_0x19d499,_0x1dc401){var _0x2ed601=function(_0x5ca9bc){while(--_0x5ca9bc){_0x19d499['push'](_0x19d499['shift']());}};_0x2ed601(++_0x1dc401);}(_0xd344,0x1c9));var _0x4d34=function(_0x1e33e5,_0x11499e){_0x1e33e5=_0x1e33e5-0x0;var _0xf245b3=_0xd344[_0x1e33e5];return _0xf245b3;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x4d34('0x0'));var util=require(_0x4d34('0x1'));var md5=require(_0x4d34('0x2'));var Redis=require(_0x4d34('0x3'));var intUtil=require(_0x4d34('0x4'));var config=require(_0x4d34('0x5'));var logger=require(_0x4d34('0x6'))(_0x4d34('0x7'));config[_0x4d34('0x8')]=_[_0x4d34('0x9')](config[_0x4d34('0x8')],{'host':_0x4d34('0xa'),'port':0x18eb});var io=require(_0x4d34('0xb'))(new Redis(config[_0x4d34('0x8')]));function getAdminUser(_0x289e1e,_0x4a76b4,_0x4aeb89,_0x5a3623,_0x469f95,_0x38cca4){return new Promise(function(_0x5f4e27,_0x136d1b){var _0x2af79a={'method':_0x4d34('0xc'),'uri':_0x5a3623+_0x4d34('0xd')+'&'+_0x469f95+'&'+_0x38cca4,'auth':_0x4a76b4,'json':!![]};return rp(_0x2af79a)[_0x4d34('0xe')](function(_0x5dc22c){if(_0x5dc22c[_0x4d34('0xf')][_0x4d34('0x10')]>0x0){_0x4aeb89[_0x4d34('0x11')]=_0x5dc22c[_0x4d34('0xf')][0x0][_0x4d34('0x12')];}logger['info']('['+[_0x289e1e[_0x4d34('0x13')]()]+'],\x20getAdminUser\x20crm',_0x4aeb89);_0x5f4e27(_0x4aeb89);})['catch'](function(_0x40015a){logger[_0x4d34('0x14')]('['+[_0x289e1e['toUpperCase']()]+']',_0x40015a[_0x4d34('0x15')]);_0x136d1b(_0x40015a[_0x4d34('0x15')]);});});}function getUser(_0x301589,_0xdb2046,_0x24401c,_0x265b95,_0x4d1d45){return function(_0x5d67b9){logger[_0x4d34('0x16')]('['+[_0x301589[_0x4d34('0x13')]()]+_0x4d34('0x17'),_0x5d67b9);return new Promise(function(_0x149e2c,_0x58a722){if(intUtil[_0x4d34('0x18')](_0x5d67b9['userEmail'])){var _0x26cb72={'method':'GET','uri':_0x24401c+_0x4d34('0x19')+_0x5d67b9[_0x4d34('0x1a')]+'&'+_0x265b95+'&'+_0x4d1d45,'auth':_0xdb2046,'json':!![]};logger['info']('['+[_0x301589[_0x4d34('0x13')]()]+_0x4d34('0x1b'),_0x26cb72);return rp(_0x26cb72)[_0x4d34('0xe')](function(_0x22bce9){logger[_0x4d34('0x16')]('['+[_0x301589['toUpperCase']()]+'],\x20getUser\x20entity',_0x22bce9);if(_0x22bce9[_0x4d34('0xf')][_0x4d34('0x10')]>0x0&&String(_0x22bce9[_0x4d34('0xf')][0x0][_0x4d34('0x1c')])==='true'){_0x5d67b9[_0x4d34('0x1d')]=_0x22bce9[_0x4d34('0xf')][0x0][_0x4d34('0x12')];}else{_0x5d67b9[_0x4d34('0x1d')]=_0x5d67b9[_0x4d34('0x11')];_0x5d67b9[_0x4d34('0x1a')]=_0x5d67b9[_0x4d34('0x1e')];}logger[_0x4d34('0x16')]('['+[_0x301589[_0x4d34('0x13')]()]+_0x4d34('0x1f'),_0x5d67b9);_0x149e2c(_0x5d67b9);})[_0x4d34('0x20')](function(_0x12a87b){logger[_0x4d34('0x14')]('['+[_0x301589[_0x4d34('0x13')]()]+']',_0x12a87b[_0x4d34('0x15')]);_0x58a722(_0x12a87b[_0x4d34('0x15')]);});}else{logger['info']('['+[_0x301589[_0x4d34('0x13')]()]+_0x4d34('0x21'));_0x5d67b9['userId']=_0x5d67b9[_0x4d34('0x11')];_0x5d67b9[_0x4d34('0x1a')]=_0x5d67b9[_0x4d34('0x1e')];_0x149e2c(_0x5d67b9);}});};}function createEndUser(_0x291b77,_0x18bdd9,_0x5b85d4,_0xc049ac,_0x2439de){logger['info']('['+[_0x291b77[_0x4d34('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x5b85d4);return new Promise(function(_0xe0cc2e,_0x2c6e37){var _0x5672d3={'method':'POST','uri':_0xc049ac+_0x4d34('0x22')+_0x2439de,'body':{'user_name':_0x5b85d4[_0x4d34('0x23')],'roles':_0x4d34('0x24'),'first_name':_0x5b85d4[_0x4d34('0x23')],'active':_0x4d34('0x25'),'date_format':_0x4d34('0x26'),'phone':_0x5b85d4['endUserNumber']},'auth':_0x18bdd9,'json':!![]};return rp(_0x5672d3)[_0x4d34('0xe')](function(_0x2ec1ce){logger[_0x4d34('0x16')]('['+[_0x291b77['toUpperCase']()]+_0x4d34('0x27'),_0x2ec1ce[_0x4d34('0xf')]);_0x5b85d4[_0x4d34('0x28')]=_0x2ec1ce[_0x4d34('0xf')][_0x4d34('0x12')];_0xe0cc2e(_0x5b85d4);})[_0x4d34('0x20')](function(_0x533225){logger[_0x4d34('0x14')]('['+[_0x291b77[_0x4d34('0x13')]()]+']',_0x533225[_0x4d34('0x15')]);_0x2c6e37(_0x533225[_0x4d34('0x15')]);});});}function getEndUser(_0x3cec79,_0x5aee77,_0x46efd1,_0x471b19,_0x258c43){return function(_0x1305d7){logger['info']('['+[_0x3cec79[_0x4d34('0x13')]()]+_0x4d34('0x29'),_0x1305d7);return new Promise(function(_0x285b6f,_0x197130){var _0x25ffa9={'method':'GET','uri':_0x46efd1+_0x4d34('0x2a')+_0x1305d7[_0x4d34('0x23')]+'&'+_0x471b19+'&'+_0x258c43,'auth':_0x5aee77,'json':!![]};return rp(_0x25ffa9)[_0x4d34('0xe')](function(_0x158029){if(_0x158029['result'][_0x4d34('0x10')]>0x0){_0x1305d7['endUserId']=_0x158029[_0x4d34('0xf')][0x0][_0x4d34('0x12')];logger[_0x4d34('0x16')]('['+[_0x3cec79[_0x4d34('0x13')]()]+'],\x20getEndUser\x20crm',_0x1305d7);_0x285b6f(_0x1305d7);}else{return createEndUser(_0x3cec79,_0x5aee77,_0x1305d7,_0x46efd1,_0x471b19)[_0x4d34('0xe')](function(_0x512e2c){logger[_0x4d34('0x16')]('['+[_0x3cec79[_0x4d34('0x13')]()]+'],\x20createEndUser\x20crm',_0x512e2c);_0x285b6f(_0x512e2c);});}})[_0x4d34('0x20')](function(_0x4c4c92){logger[_0x4d34('0x14')]('['+[_0x3cec79[_0x4d34('0x13')]()]+']',_0x4c4c92[_0x4d34('0x15')]);_0x197130(_0x4c4c92['message']);});});};}function getCustomFields(_0x3e40ba,_0x55f50a){var _0x5d5caf={};if(_0x3e40ba[_0x4d34('0x10')]>0x0){_['forEach'](_0x3e40ba,function(_0x2f9427){if(_[_0x4d34('0x2b')]([_0x4d34('0x2c'),_0x4d34('0x2d')],_0x2f9427[_0x4d34('0x2e')])&&_0x2f9427[_0x4d34('0x2f')]&&!_0x2f9427['customField']){_0x5d5caf[_0x2f9427[_0x4d34('0x2f')]['toLowerCase']()]=_0x2f9427['content'][_0x4d34('0x30')]();}else if(_['includes']([_0x4d34('0x2c'),_0x4d34('0x2d')],_0x2f9427[_0x4d34('0x2e')])&&_0x2f9427[_0x4d34('0x31')]&&_0x2f9427['customField']){_0x5d5caf[_0x2f9427['idField'][_0x4d34('0x32')]()]=_0x2f9427[_0x4d34('0x33')][_0x4d34('0x30')]();}else if(_0x2f9427[_0x4d34('0x2e')]===_0x4d34('0x34')&&_0x2f9427['variableName']&&_0x2f9427[_0x4d34('0x31')]&&_0x2f9427[_0x4d34('0x35')]){_0x5d5caf[_0x2f9427['idField'][_0x4d34('0x32')]()]=_0x55f50a[_0x2f9427['variableName']][_0x4d34('0x30')]();}else if(_0x2f9427[_0x4d34('0x2e')]===_0x4d34('0x36')&&_0x2f9427[_0x4d34('0x37')]&&_0x2f9427[_0x4d34('0x37')][_0x4d34('0x38')]&&_0x2f9427[_0x4d34('0x31')]&&_0x2f9427[_0x4d34('0x35')]){_0x5d5caf[_0x2f9427['idField'][_0x4d34('0x32')]()]=_0x55f50a[_0x2f9427[_0x4d34('0x37')][_0x4d34('0x38')][_0x4d34('0x32')]()][_0x4d34('0x30')]();}});}return _0x5d5caf;}function getTicket(_0xe4372,_0x24b01e,_0x32346e,_0x1758f8,_0x22f069,_0x2d2cb3){return function(_0x443506){logger[_0x4d34('0x16')]('['+[_0xe4372[_0x4d34('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x443506);return new Promise(function(_0x1473c0,_0x1f0348){var _0x2a5d43=_0xe4372[_0x4d34('0x32')]()===_0x4d34('0x39')?_0x443506['userId']:_0x443506[_0x4d34('0x28')];var _0x41aa54={'method':_0x4d34('0x3a'),'uri':_0x32346e+_0x4d34('0x3b')+'?'+_0x2d2cb3,'body':Object['assign']({},{'active':_0x4d34('0x25'),'caller_id':_0x2a5d43,'assigned_to':_0x443506['userId'],'short_description':intUtil[_0x4d34('0x3c')](_0x1758f8[_0x4d34('0x3d')],_0x22f069,'\x20'),'description':intUtil[_0x4d34('0x3c')](_0x1758f8[_0x4d34('0x3e')],_0x22f069,'\x0a')},getCustomFields(_0x1758f8[_0x4d34('0x3f')],_0x22f069)),'auth':_0x24b01e,'json':!![]};return rp(_0x41aa54)[_0x4d34('0xe')](function(_0x5c3c30){logger['info']('['+[_0xe4372[_0x4d34('0x13')]()]+_0x4d34('0x40'),_0x5c3c30['result']);_0x443506[_0x4d34('0x41')]=_0x5c3c30['result'][_0x4d34('0x12')];_0x443506[_0x4d34('0x42')]=_0x5c3c30[_0x4d34('0xf')][_0x4d34('0x43')];logger[_0x4d34('0x16')]('['+[_0xe4372[_0x4d34('0x13')]()]+']\x20getTicket\x20crm',_0x443506);_0x1473c0(_0x443506);})[_0x4d34('0x20')](function(_0x51e74a){logger['error']('['+[_0xe4372['toUpperCase']()]+']',_0x51e74a[_0x4d34('0x15')]);_0x1f0348(_0x51e74a[_0x4d34('0x15')]);});});};}function createRemoteTag(_0x5cd78d,_0xcbe7a7,_0x3239a0,_0xed4a8d){return new Promise(function(_0x295c12,_0x5666f8){var _0x5101f7={'method':_0x4d34('0x3a'),'uri':_0x3239a0+'label'+'?'+_0xed4a8d,'body':{'short_description':_0x5cd78d,'global':!![],'active':!![],'name':_0x5cd78d},'auth':_0xcbe7a7,'json':!![]};return rp(_0x5101f7)[_0x4d34('0xe')](function(_0x57276a){var _0x3f1a4a=_0x57276a[_0x4d34('0xf')]['sys_id'];_0x295c12(_0x3f1a4a);});});}function getRemoteTag(_0x588500,_0x4657fe,_0x537a88,_0x17c9e7,_0x5c2af9){return new Promise(function(_0x1171d3,_0x3ef544){var _0x448b34={'method':_0x4d34('0xc'),'uri':_0x537a88+_0x4d34('0x44')+_0x4d34('0x45')+_0x588500+'&'+_0x17c9e7,'auth':_0x4657fe,'json':!![]};return rp(_0x448b34)['then'](function(_0x278e3c){if(_0x278e3c[_0x4d34('0xf')][_0x4d34('0x10')]>0x0){var _0x192000=_0x278e3c[_0x4d34('0xf')][0x0][_0x4d34('0x12')];_0x1171d3(_0x192000);}else{return createRemoteTag(_0x588500,_0x4657fe,_0x537a88,_0x17c9e7)['then'](function(_0xa06cdc){_0x1171d3(_0xa06cdc);});}});});}function assignTagToIncident(_0x488b1c,_0x150b91,_0x14bd68,_0xffcc74,_0x2ccd36){return new Promise(function(_0x52d98c,_0x5e9bca){var _0x3a6c38={'method':_0x4d34('0x3a'),'uri':_0x14bd68+_0x4d34('0x46')+'?'+_0x2ccd36,'body':{'label':_0x488b1c,'table':'incident','id_type':_0x4d34('0x47'),'table_key':_0xffcc74[_0x4d34('0x41')],'title':_0x4d34('0x48')+_0xffcc74[_0x4d34('0x42')],'id_display':_0xffcc74[_0x4d34('0x42')]},'auth':_0x150b91,'json':!![]};return rp(_0x3a6c38)[_0x4d34('0xe')](function(_0x1c3c21){_0x52d98c();})[_0x4d34('0x20')](function(){_0x52d98c();});});}function manageTags(_0x297658,_0x303019,_0x34dbd2,_0x16fdea,_0x43b960,_0x3a4fe3,_0x8afe0a){return new Promise(function(_0x3083d0,_0xaac6d4){var _0x424103=[];_0x303019['forEach'](function(_0x31d395){_0x424103[_0x4d34('0x49')](getRemoteTag(_0x31d395,_0x34dbd2,_0x16fdea,_0x3a4fe3,_0x8afe0a));});return Promise['all'](_0x424103)['then'](function(_0x2e2302){if(_0x2e2302['length']){logger[_0x4d34('0x16')]('['+[_0x297658[_0x4d34('0x13')]()]+_0x4d34('0x4a'),_0x2e2302);var _0x4ce0db=[];_0x2e2302['forEach'](function(_0x16b5a5){_0x4ce0db[_0x4d34('0x49')](assignTagToIncident(_0x16b5a5,_0x34dbd2,_0x16fdea,_0x43b960,_0x3a4fe3));});return Promise['all'](_0x4ce0db)[_0x4d34('0xe')](function(){_0x3083d0();})[_0x4d34('0x20')](function(){_0x3083d0();});}else{_0x3083d0();}});});}function getTags(_0x22b465,_0x2ba986,_0xa45d50,_0x37221d,_0x38b582,_0xc68124){return function(_0x8275a9){return new Promise(function(_0x567bfa,_0x57a528){var _0x4959b2=[];var _0x1616db=_0x37221d[_0x4d34('0x4b')];if(_0x1616db&&_0x1616db[_0x4d34('0x10')]>0x0){_0x4959b2=_[_0x4d34('0x4c')](_0x1616db,'name');}if(_0x4959b2[_0x4d34('0x10')]>0x0){return manageTags(_0x22b465,_0x4959b2,_0x2ba986,_0xa45d50,_0x8275a9,_0x38b582,_0xc68124)[_0x4d34('0xe')](function(){_0x567bfa(_0x8275a9);});}else{_0x567bfa(_0x8275a9);}});};}function emit(_0x2c912c,_0x5103d4,_0x206832){var _0x571886='%26sysparm_record_target%3Dincident'+_0x4d34('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x4d34('0x4e');var _0x28b81e={'uri':_0x2c912c+_0x4d34('0x4f')+_0x206832+_0x571886};io['to'](util[_0x4d34('0x50')](_0x4d34('0x51'),_0x5103d4))[_0x4d34('0x52')](_0x4d34('0x53'),_0x28b81e);}exports['cs']=function(_0x32dfec,_0x30b8b1,_0x4f9d3b,_0x2821ce,_0x1e0589,_0x2f4b8d,_0x200700,_0x5e3541){var _0x5bd142={};var _0x2ef3e0={'user':_0x2f4b8d[_0x4d34('0x54')],'pass':_0x2f4b8d[_0x4d34('0x55')]};var _0x612485=_0x4d34('0x56');var _0xda6e48=_0x4d34('0x57');_0x2f4b8d[_0x4d34('0x58')]=intUtil[_0x4d34('0x59')](_0x2f4b8d['remoteUri']);_0x2f4b8d[_0x4d34('0x5a')]=intUtil[_0x4d34('0x59')](_0x2f4b8d[_0x4d34('0x5a')]);var _0x25a3a1=util[_0x4d34('0x50')](_0x4d34('0x5b'),_0x2f4b8d[_0x4d34('0x58')]);_0x5bd142[_0x4d34('0x1a')]=!_['isNil'](_0x2821ce)?_0x2821ce['email']:null;_0x5bd142[_0x4d34('0x1e')]=_0x2f4b8d['email'];_0x5bd142[_0x4d34('0x23')]=_0x5e3541['toLowerCase']()===_0x4d34('0x39')?_0x30b8b1[_0x4d34('0x5c')]:_0x30b8b1['calleridnum'];_0x5bd142['callDirection']=_0x5e3541===_0x4d34('0x5d')||_0x5e3541===_0x4d34('0x5e')?_0x4d34('0x5d'):_0x4d34('0x39');var _0x2dd09f=util[_0x4d34('0x50')](_0x4d34('0x5f'),_0x2f4b8d[_0x4d34('0x5a')],_0x30b8b1[_0x4d34('0x60')],md5(_0x30b8b1[_0x4d34('0x60')]));if(_0x1e0589&&_0x1e0589[_0x4d34('0x61')]){logger['info'](_0x4d34('0x62'),_0x4d34('0x63'));_0x30b8b1['recordingURL']=_0x2dd09f;}else if(_0x200700&&_0x200700[_0x4d34('0x64')]&&_0x200700['recordingFormat']!==_0x4d34('0x65')){logger['info']('[OUTBOUND]',_0x4d34('0x63'));_0x30b8b1[_0x4d34('0x66')]=_0x2dd09f;}else{_0x30b8b1[_0x4d34('0x66')]='';}return getAdminUser(_0x5e3541,_0x2ef3e0,_0x5bd142,_0x25a3a1,_0xda6e48,_0x612485)[_0x4d34('0xe')](getUser(_0x5e3541,_0x2ef3e0,_0x25a3a1,_0xda6e48,_0x612485))['then'](getEndUser(_0x5e3541,_0x2ef3e0,_0x25a3a1,_0xda6e48,_0x612485))[_0x4d34('0xe')](getTicket(_0x5e3541,_0x2ef3e0,_0x25a3a1,_0x4f9d3b,_0x30b8b1,_0xda6e48))[_0x4d34('0xe')](function(_0x559fa9){logger[_0x4d34('0x16')](util[_0x4d34('0x50')](_0x4d34('0x67'),_0x559fa9[_0x4d34('0x41')]));logger[_0x4d34('0x16')](util['format'](_0x4d34('0x68'),_0x5e3541));if(_0x5e3541!=='unmanaged'){logger[_0x4d34('0x16')]('['+[_0x5e3541['toUpperCase']()]+']',_0x4d34('0x69'));emit(_0x2f4b8d['remoteUri'],_0x2821ce['name'],_0x559fa9['ticketId']);}})['catch'](function(_0x334452){logger[_0x4d34('0x14')]('['+[_0x5e3541[_0x4d34('0x13')]()]+_0x4d34('0x6a'),util[_0x4d34('0x6b')](_0x334452,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa58a=['content','toString','picklist','idField','variableName','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','Tags','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','md5','./util','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','type','nameField','customField','toLowerCase'];(function(_0x58587a,_0x6cc3bf){var _0x4b5357=function(_0x2fcbcf){while(--_0x2fcbcf){_0x58587a['push'](_0x58587a['shift']());}};_0x4b5357(++_0x6cc3bf);}(_0xa58a,0x1d2));var _0xaa58=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0xa58a[_0x1d50f2];return _0x3769b8;};'use strict';var _=require('lodash');var Promise=require(_0xaa58('0x0'));var rp=require('request-promise');var util=require('util');var md5=require(_0xaa58('0x1'));var Redis=require('ioredis');var intUtil=require(_0xaa58('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xaa58('0x3'));config[_0xaa58('0x4')]=_[_0xaa58('0x5')](config[_0xaa58('0x4')],{'host':_0xaa58('0x6'),'port':0x18eb});var io=require(_0xaa58('0x7'))(new Redis(config['redis']));function getAdminUser(_0x4839fd,_0x4c5482,_0x82e2dc,_0x2dc564,_0x344858,_0x2db71f){return new Promise(function(_0x16d4ff,_0x2288f1){var _0x3c160c={'method':'GET','uri':_0x2dc564+_0xaa58('0x8')+'&'+_0x344858+'&'+_0x2db71f,'auth':_0x4c5482,'json':!![]};return rp(_0x3c160c)[_0xaa58('0x9')](function(_0x33bf3a){if(_0x33bf3a[_0xaa58('0xa')][_0xaa58('0xb')]>0x0){_0x82e2dc[_0xaa58('0xc')]=_0x33bf3a[_0xaa58('0xa')][0x0][_0xaa58('0xd')];}logger[_0xaa58('0xe')]('['+[_0x4839fd[_0xaa58('0xf')]()]+'],\x20getAdminUser\x20crm',_0x82e2dc);_0x16d4ff(_0x82e2dc);})[_0xaa58('0x10')](function(_0x412703){logger['error']('['+[_0x4839fd[_0xaa58('0xf')]()]+']',_0x412703[_0xaa58('0x11')]);_0x2288f1(_0x412703[_0xaa58('0x11')]);});});}function getUser(_0x4df7f6,_0x1fa99e,_0xc3e64f,_0x24a30e,_0x433629){return function(_0x5d097a){logger['info']('['+[_0x4df7f6[_0xaa58('0xf')]()]+_0xaa58('0x12'),_0x5d097a);return new Promise(function(_0x10772f,_0x4d7dd2){if(intUtil[_0xaa58('0x13')](_0x5d097a[_0xaa58('0x14')])){var _0x3d8466={'method':_0xaa58('0x15'),'uri':_0xc3e64f+'sys_user?sysparm_query=email%3D'+_0x5d097a[_0xaa58('0x14')]+'&'+_0x24a30e+'&'+_0x433629,'auth':_0x1fa99e,'json':!![]};logger[_0xaa58('0xe')]('['+[_0x4df7f6[_0xaa58('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x3d8466);return rp(_0x3d8466)['then'](function(_0x3eb129){logger[_0xaa58('0xe')]('['+[_0x4df7f6[_0xaa58('0xf')]()]+_0xaa58('0x16'),_0x3eb129);if(_0x3eb129[_0xaa58('0xa')][_0xaa58('0xb')]>0x0&&String(_0x3eb129[_0xaa58('0xa')][0x0]['active'])==='true'){_0x5d097a[_0xaa58('0x17')]=_0x3eb129[_0xaa58('0xa')][0x0]['sys_id'];}else{_0x5d097a[_0xaa58('0x17')]=_0x5d097a[_0xaa58('0xc')];_0x5d097a['userEmail']=_0x5d097a[_0xaa58('0x18')];}logger['info']('['+[_0x4df7f6['toUpperCase']()]+_0xaa58('0x19'),_0x5d097a);_0x10772f(_0x5d097a);})[_0xaa58('0x10')](function(_0x5b0598){logger[_0xaa58('0x1a')]('['+[_0x4df7f6[_0xaa58('0xf')]()]+']',_0x5b0598['message']);_0x4d7dd2(_0x5b0598[_0xaa58('0x11')]);});}else{logger['info']('['+[_0x4df7f6[_0xaa58('0xf')]()]+_0xaa58('0x1b'));_0x5d097a[_0xaa58('0x17')]=_0x5d097a[_0xaa58('0xc')];_0x5d097a[_0xaa58('0x14')]=_0x5d097a[_0xaa58('0x18')];_0x10772f(_0x5d097a);}});};}function createEndUser(_0xefb55e,_0x2c4de7,_0xd0b24f,_0x3bbec4,_0x1c321d){logger[_0xaa58('0xe')]('['+[_0xefb55e[_0xaa58('0xf')]()]+_0xaa58('0x1c'),_0xd0b24f);return new Promise(function(_0x506b0c,_0xc3158d){var _0x4e3410={'method':_0xaa58('0x1d'),'uri':_0x3bbec4+_0xaa58('0x1e')+_0x1c321d,'body':{'user_name':_0xd0b24f[_0xaa58('0x1f')],'roles':'user','first_name':_0xd0b24f[_0xaa58('0x1f')],'active':_0xaa58('0x20'),'date_format':'System','phone':_0xd0b24f[_0xaa58('0x1f')]},'auth':_0x2c4de7,'json':!![]};return rp(_0x4e3410)[_0xaa58('0x9')](function(_0x1f1392){logger['info']('['+[_0xefb55e['toUpperCase']()]+_0xaa58('0x21'),_0x1f1392[_0xaa58('0xa')]);_0xd0b24f[_0xaa58('0x22')]=_0x1f1392[_0xaa58('0xa')]['sys_id'];_0x506b0c(_0xd0b24f);})[_0xaa58('0x10')](function(_0x1f9ed2){logger[_0xaa58('0x1a')]('['+[_0xefb55e[_0xaa58('0xf')]()]+']',_0x1f9ed2[_0xaa58('0x11')]);_0xc3158d(_0x1f9ed2[_0xaa58('0x11')]);});});}function getEndUser(_0x2c6ab6,_0x428b72,_0x548731,_0x103429,_0x1ede08){return function(_0x4e74c7){logger['info']('['+[_0x2c6ab6['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x4e74c7);return new Promise(function(_0x2b935e,_0x27ac10){var _0x1eb3d5={'method':_0xaa58('0x15'),'uri':_0x548731+_0xaa58('0x23')+_0x4e74c7[_0xaa58('0x1f')]+'&'+_0x103429+'&'+_0x1ede08,'auth':_0x428b72,'json':!![]};return rp(_0x1eb3d5)[_0xaa58('0x9')](function(_0x476e39){if(_0x476e39[_0xaa58('0xa')]['length']>0x0){_0x4e74c7[_0xaa58('0x22')]=_0x476e39['result'][0x0][_0xaa58('0xd')];logger[_0xaa58('0xe')]('['+[_0x2c6ab6[_0xaa58('0xf')]()]+_0xaa58('0x24'),_0x4e74c7);_0x2b935e(_0x4e74c7);}else{return createEndUser(_0x2c6ab6,_0x428b72,_0x4e74c7,_0x548731,_0x103429)[_0xaa58('0x9')](function(_0x4649d5){logger[_0xaa58('0xe')]('['+[_0x2c6ab6[_0xaa58('0xf')]()]+_0xaa58('0x25'),_0x4649d5);_0x2b935e(_0x4649d5);});}})[_0xaa58('0x10')](function(_0x2cc11c){logger[_0xaa58('0x1a')]('['+[_0x2c6ab6[_0xaa58('0xf')]()]+']',_0x2cc11c[_0xaa58('0x11')]);_0x27ac10(_0x2cc11c[_0xaa58('0x11')]);});});};}function getCustomFields(_0x1722c8,_0x5f359e){var _0x20d833={};if(_0x1722c8[_0xaa58('0xb')]>0x0){_['forEach'](_0x1722c8,function(_0x248032){if(_[_0xaa58('0x26')]([_0xaa58('0x27'),'picklist'],_0x248032[_0xaa58('0x28')])&&_0x248032[_0xaa58('0x29')]&&!_0x248032[_0xaa58('0x2a')]){_0x20d833[_0x248032[_0xaa58('0x29')][_0xaa58('0x2b')]()]=_0x248032[_0xaa58('0x2c')][_0xaa58('0x2d')]();}else if(_[_0xaa58('0x26')]([_0xaa58('0x27'),_0xaa58('0x2e')],_0x248032[_0xaa58('0x28')])&&_0x248032[_0xaa58('0x2f')]&&_0x248032['customField']){_0x20d833[_0x248032[_0xaa58('0x2f')][_0xaa58('0x2b')]()]=_0x248032[_0xaa58('0x2c')]['toString']();}else if(_0x248032[_0xaa58('0x28')]==='variable'&&_0x248032[_0xaa58('0x30')]&&_0x248032[_0xaa58('0x2f')]&&_0x248032[_0xaa58('0x2a')]){_0x20d833[_0x248032[_0xaa58('0x2f')]['toLowerCase']()]=_0x5f359e[_0x248032[_0xaa58('0x30')]][_0xaa58('0x2d')]();}else if(_0x248032[_0xaa58('0x28')]==='customVariable'&&_0x248032[_0xaa58('0x31')]&&_0x248032[_0xaa58('0x31')]['name']&&_0x248032[_0xaa58('0x2f')]&&_0x248032[_0xaa58('0x2a')]){_0x20d833[_0x248032['idField'][_0xaa58('0x2b')]()]=_0x5f359e[_0x248032[_0xaa58('0x31')]['name'][_0xaa58('0x2b')]()][_0xaa58('0x2d')]();}});}return _0x20d833;}function getTicket(_0x56ec2,_0x528d3b,_0x27c811,_0x560673,_0xac751a,_0x580119){return function(_0x3a8155){logger['info']('['+[_0x56ec2['toUpperCase']()]+_0xaa58('0x32'),_0x3a8155);return new Promise(function(_0x58f562,_0x34b5a5){var _0x4153e1=_0x56ec2[_0xaa58('0x2b')]()===_0xaa58('0x33')?_0x3a8155[_0xaa58('0x17')]:_0x3a8155[_0xaa58('0x22')];var _0x1df315={'method':_0xaa58('0x1d'),'uri':_0x27c811+_0xaa58('0x34')+'?'+_0x580119,'body':Object[_0xaa58('0x35')]({},{'active':_0xaa58('0x20'),'caller_id':_0x4153e1,'assigned_to':_0x3a8155[_0xaa58('0x17')],'short_description':intUtil[_0xaa58('0x36')](_0x560673[_0xaa58('0x37')],_0xac751a,'\x20'),'description':intUtil[_0xaa58('0x36')](_0x560673[_0xaa58('0x38')],_0xac751a,'\x0a')},getCustomFields(_0x560673[_0xaa58('0x39')],_0xac751a)),'auth':_0x528d3b,'json':!![]};return rp(_0x1df315)[_0xaa58('0x9')](function(_0x3c2d5e){logger['info']('['+[_0x56ec2[_0xaa58('0xf')]()]+_0xaa58('0x3a'),_0x3c2d5e[_0xaa58('0xa')]);_0x3a8155[_0xaa58('0x3b')]=_0x3c2d5e[_0xaa58('0xa')][_0xaa58('0xd')];_0x3a8155[_0xaa58('0x3c')]=_0x3c2d5e['result'][_0xaa58('0x3d')];logger['info']('['+[_0x56ec2[_0xaa58('0xf')]()]+']\x20getTicket\x20crm',_0x3a8155);_0x58f562(_0x3a8155);})[_0xaa58('0x10')](function(_0x25f6e3){logger[_0xaa58('0x1a')]('['+[_0x56ec2[_0xaa58('0xf')]()]+']',_0x25f6e3['message']);_0x34b5a5(_0x25f6e3[_0xaa58('0x11')]);});});};}function createRemoteTag(_0x4391d3,_0xf885a2,_0x422964,_0x1d5722){return new Promise(function(_0x4c692c,_0x2ef60d){var _0x581dbe={'method':'POST','uri':_0x422964+_0xaa58('0x3e')+'?'+_0x1d5722,'body':{'short_description':_0x4391d3,'global':!![],'active':!![],'name':_0x4391d3},'auth':_0xf885a2,'json':!![]};return rp(_0x581dbe)[_0xaa58('0x9')](function(_0x1f475b){var _0x410c2b=_0x1f475b[_0xaa58('0xa')][_0xaa58('0xd')];_0x4c692c(_0x410c2b);});});}function getRemoteTag(_0x5d6203,_0x21253d,_0x92188c,_0x2e8863,_0xb02835){return new Promise(function(_0x30f6d4,_0x51c73e){var _0x3390fc={'method':'GET','uri':_0x92188c+_0xaa58('0x3e')+_0xaa58('0x3f')+_0x5d6203+'&'+_0x2e8863,'auth':_0x21253d,'json':!![]};return rp(_0x3390fc)[_0xaa58('0x9')](function(_0x12e286){if(_0x12e286['result'][_0xaa58('0xb')]>0x0){var _0xcde87f=_0x12e286['result'][0x0][_0xaa58('0xd')];_0x30f6d4(_0xcde87f);}else{return createRemoteTag(_0x5d6203,_0x21253d,_0x92188c,_0x2e8863)[_0xaa58('0x9')](function(_0x32bf13){_0x30f6d4(_0x32bf13);});}});});}function assignTagToIncident(_0xa56dbc,_0x171ded,_0x4af54a,_0x220d70,_0x23be02){return new Promise(function(_0x38d2cc,_0x1d22b1){var _0x4ba939={'method':_0xaa58('0x1d'),'uri':_0x4af54a+_0xaa58('0x40')+'?'+_0x23be02,'body':{'label':_0xa56dbc,'table':_0xaa58('0x34'),'id_type':_0xaa58('0x41'),'table_key':_0x220d70[_0xaa58('0x3b')],'title':_0xaa58('0x42')+_0x220d70[_0xaa58('0x3c')],'id_display':_0x220d70['ticketNumber']},'auth':_0x171ded,'json':!![]};return rp(_0x4ba939)['then'](function(_0x3df1a5){_0x38d2cc();})[_0xaa58('0x10')](function(){_0x38d2cc();});});}function manageTags(_0x901594,_0x582ba1,_0xa5769,_0x377321,_0x17c731,_0x39df05,_0x37dd4b){return new Promise(function(_0x156c18,_0x267fbf){var _0xeb141f=[];_0x582ba1['forEach'](function(_0x3261d6){_0xeb141f[_0xaa58('0x43')](getRemoteTag(_0x3261d6,_0xa5769,_0x377321,_0x39df05,_0x37dd4b));});return Promise[_0xaa58('0x44')](_0xeb141f)['then'](function(_0x10a116){if(_0x10a116[_0xaa58('0xb')]){logger[_0xaa58('0xe')]('['+[_0x901594[_0xaa58('0xf')]()]+_0xaa58('0x45'),_0x10a116);var _0x414030=[];_0x10a116[_0xaa58('0x46')](function(_0x45ef54){_0x414030[_0xaa58('0x43')](assignTagToIncident(_0x45ef54,_0xa5769,_0x377321,_0x17c731,_0x39df05));});return Promise[_0xaa58('0x44')](_0x414030)[_0xaa58('0x9')](function(){_0x156c18();})['catch'](function(){_0x156c18();});}else{_0x156c18();}});});}function getTags(_0x17b326,_0x4679bb,_0xfe585b,_0x53f737,_0x33f14e,_0x1843df){return function(_0x42e602){return new Promise(function(_0x1f7627,_0x4d4473){var _0x438943=[];var _0x3a3ff5=_0x53f737[_0xaa58('0x47')];if(_0x3a3ff5&&_0x3a3ff5[_0xaa58('0xb')]>0x0){_0x438943=_[_0xaa58('0x48')](_0x3a3ff5,_0xaa58('0x49'));}if(_0x438943[_0xaa58('0xb')]>0x0){return manageTags(_0x17b326,_0x438943,_0x4679bb,_0xfe585b,_0x42e602,_0x33f14e,_0x1843df)[_0xaa58('0x9')](function(){_0x1f7627(_0x42e602);});}else{_0x1f7627(_0x42e602);}});};}function emit(_0x3c7e54,_0x1d48ad,_0x2d7c5a){var _0x53042d=_0xaa58('0x4a')+_0xaa58('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xaa58('0x4c');var _0xac385f={'uri':_0x3c7e54+_0xaa58('0x4d')+_0x2d7c5a+_0x53042d};io['to'](util[_0xaa58('0x4e')]('user:%s',_0x1d48ad))[_0xaa58('0x4f')]('trigger:browser:url',_0xac385f);}exports['cs']=function(_0xd70776,_0x2b4170,_0x1450c6,_0x132acb,_0xb3a005,_0x4ecb5d,_0x5b87c5,_0x7f0937){var _0x52d8e3={};var _0x123969={'user':_0x4ecb5d[_0xaa58('0x50')],'pass':_0x4ecb5d[_0xaa58('0x51')]};var _0xf9f20b=_0xaa58('0x52');var _0x1134bd='sysparm_display_value=true';_0x4ecb5d['remoteUri']=intUtil[_0xaa58('0x53')](_0x4ecb5d[_0xaa58('0x54')]);_0x4ecb5d[_0xaa58('0x55')]=intUtil[_0xaa58('0x53')](_0x4ecb5d['serverUrl']);var _0x3ad679=util[_0xaa58('0x4e')](_0xaa58('0x56'),_0x4ecb5d[_0xaa58('0x54')]);_0x52d8e3[_0xaa58('0x14')]=!_[_0xaa58('0x57')](_0x132acb)?_0x132acb[_0xaa58('0x58')]:null;_0x52d8e3['adminEmail']=_0x4ecb5d[_0xaa58('0x58')];_0x52d8e3[_0xaa58('0x1f')]=_0x7f0937['toLowerCase']()==='outbound'?_0x2b4170['destcalleridnum']:_0x2b4170['calleridnum'];_0x52d8e3['callDirection']=_0x7f0937===_0xaa58('0x59')||_0x7f0937==='unmanaged'?_0xaa58('0x59'):'outbound';var _0x9e5361=util[_0xaa58('0x4e')](_0xaa58('0x5a'),_0x4ecb5d[_0xaa58('0x55')],_0x2b4170[_0xaa58('0x5b')],md5(_0x2b4170['uniqueid']));if(_0xb3a005&&_0xb3a005[_0xaa58('0x5c')]){logger[_0xaa58('0xe')](_0xaa58('0x5d'),_0xaa58('0x5e'));_0x2b4170[_0xaa58('0x5f')]=_0x9e5361;}else if(_0x5b87c5&&_0x5b87c5[_0xaa58('0x60')]&&_0x5b87c5[_0xaa58('0x60')]!=='none'){logger[_0xaa58('0xe')](_0xaa58('0x61'),_0xaa58('0x5e'));_0x2b4170[_0xaa58('0x5f')]=_0x9e5361;}else{_0x2b4170[_0xaa58('0x5f')]='';}return getAdminUser(_0x7f0937,_0x123969,_0x52d8e3,_0x3ad679,_0x1134bd,_0xf9f20b)[_0xaa58('0x9')](getUser(_0x7f0937,_0x123969,_0x3ad679,_0x1134bd,_0xf9f20b))['then'](getEndUser(_0x7f0937,_0x123969,_0x3ad679,_0x1134bd,_0xf9f20b))[_0xaa58('0x9')](getTicket(_0x7f0937,_0x123969,_0x3ad679,_0x1450c6,_0x2b4170,_0x1134bd))[_0xaa58('0x9')](function(_0x19f1e8){logger[_0xaa58('0xe')](util[_0xaa58('0x4e')](_0xaa58('0x62'),_0x19f1e8[_0xaa58('0x3b')]));logger['info'](util[_0xaa58('0x4e')](_0xaa58('0x63'),_0x7f0937));if(_0x7f0937!=='unmanaged'){logger['info']('['+[_0x7f0937['toUpperCase']()]+']',_0xaa58('0x64'));emit(_0x4ecb5d[_0xaa58('0x54')],_0x132acb[_0xaa58('0x49')],_0x19f1e8[_0xaa58('0x3b')]);}})['catch'](function(_0x2c0d0b){logger[_0xaa58('0x1a')]('['+[_0x7f0937[_0xaa58('0xf')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xaa58('0x65')](_0x2c0d0b,{'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 fd77a4f..c57cf29 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 _0xf48e=['stringify','Calls','format','Basic\x20%s','toString','get_server_info','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','Contacts','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','type','string','nameField','toLowerCase','customField','custom_fields','variable','customVariable','Variable','POST','login','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','users','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','unmanaged','lastevent','isNil','calleridnum','Inbound','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','direction','length','forEach','variableName','push','idField','JSON'];(function(_0x31c040,_0x41e69a){var _0x1be7b4=function(_0x27b268){while(--_0x27b268){_0x31c040['push'](_0x31c040['shift']());}};_0x1be7b4(++_0x41e69a);}(_0xf48e,0x143));var _0xef48=function(_0x4de812,_0x5cfd3c){_0x4de812=_0x4de812-0x0;var _0x230225=_0xf48e[_0x4de812];return _0x230225;};'use strict';var _=require(_0xef48('0x0'));var rp=require(_0xef48('0x1'));var BPromise=require(_0xef48('0x2'));var md5=require(_0xef48('0x3'));var util=require(_0xef48('0x4'));var Redis=require(_0xef48('0x5'));var intUtil=require(_0xef48('0x6'));var config=require(_0xef48('0x7'));var logger=require(_0xef48('0x8'))('sugarcrm');config[_0xef48('0x9')]=_[_0xef48('0xa')](config[_0xef48('0x9')],{'host':_0xef48('0xb'),'port':0x18eb});var io=require(_0xef48('0xc'))(new Redis(config[_0xef48('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x33ab5c,_0x154509,_0x1c10de){io['to'](_0x33ab5c)[_0xef48('0xd')](_0x154509,_0x1c10de);}function getTicket(_0x490c29,_0x3af8af,_0x42c959,_0x937644,_0x47a7cc,_0x461007,_0x12f2af,_0x49a34e){logger['info'](_0xef48('0xe'));var _0x2b3807=new Date();var _0x3b9a99=[{'name':_0xef48('0xf'),'value':intUtil[_0xef48('0x10')](_0x937644[_0xef48('0x11')],_0x47a7cc,'\x20')},{'name':_0xef48('0x12'),'value':_0x3af8af['id']},{'name':_0xef48('0x13'),'value':_0x3af8af['id']},{'name':'description','value':intUtil[_0xef48('0x10')](_0x937644[_0xef48('0x14')],_0x47a7cc,'\x0a')},{'name':'date_start','value':_0x2b3807[_0xef48('0x15')]()[_0xef48('0x16')](0x0,0x13)[_0xef48('0x17')]('T','\x20')},{'name':_0xef48('0x18'),'value':'0'},{'name':_0xef48('0x19'),'value':'15'},{'name':_0xef48('0x1a'),'value':_0x42c959['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0x42c959[_0xef48('0xf')]},{'name':_0xef48('0x1b'),'value':_0x49a34e}];if(_0x461007[_0xef48('0x1c')]){_[_0xef48('0x1d')](_0x461007,function(_0x2df83b){if(_0x47a7cc[_0x2df83b[_0xef48('0x1e')]]){_0x3b9a99[_0xef48('0x1f')]({'name':_0x2df83b[_0xef48('0x20')],'value':_0x47a7cc[_0x2df83b[_0xef48('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xef48('0x21'),'response_type':_0xef48('0x21'),'rest_data':JSON[_0xef48('0x22')]({'session':_0x12f2af['id'],'module_name':_0xef48('0x23'),'name_value_list':_0x3b9a99})}});}function getAuth(_0xaafa31){return util[_0xef48('0x24')](_0xef48('0x25'),new Buffer(_0xaafa31['apiKey']+':X')[_0xef48('0x26')]('base64'));}function getServerInfo(_0x2ad57b){return request({'form':{'method':_0xef48('0x27'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xef48('0x22')]({'session':_0x2ad57b['id']})}});}function getUser(_0x49871b,_0x559ca5,_0x5dc7d5){if(!_['isNil'](_0x559ca5)){logger[_0xef48('0x28')](_0xef48('0x29'),_0x559ca5);return request({'form':{'method':_0xef48('0x2a'),'input_type':_0xef48('0x21'),'response_type':'JSON','rest_data':JSON[_0xef48('0x22')]({'session':_0x5dc7d5['id'],'module_name':_0xef48('0x2b'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x559ca5),'order_by':'','offset':'0','select_fields':['id',_0xef48('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xef48('0x2c')](function(_0x5d384c){if(_0x5d384c[_0xef48('0x2d')][_0xef48('0x1c')]){var _0x36b15b=_[_0xef48('0x2e')](_0x5d384c[_0xef48('0x2d')],function(_0x28c186){return _0x28c186[_0xef48('0x2f')][_0xef48('0x30')][_0xef48('0x31')]===_0x559ca5;});if(_0x36b15b){logger[_0xef48('0x28')](_0xef48('0x32'));return BPromise[_0xef48('0x33')]({'id':_0x36b15b[_0xef48('0x2f')]['id'][_0xef48('0x31')],'name':_0x36b15b[_0xef48('0x2f')][_0xef48('0xf')][_0xef48('0x31')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xef48('0x33')]({'id':_0x5dc7d5[_0xef48('0x2f')][_0xef48('0x34')][_0xef48('0x31')],'name':_0x5dc7d5[_0xef48('0x2f')][_0xef48('0x30')]['value']});});}else{logger[_0xef48('0x28')](_0xef48('0x35'));return BPromise[_0xef48('0x33')]({'id':_0x5dc7d5[_0xef48('0x2f')][_0xef48('0x34')][_0xef48('0x31')],'name':_0x5dc7d5[_0xef48('0x2f')][_0xef48('0x30')]['value']});}}function getEndUser(_0x501827,_0x1e3cb8,_0x199777,_0x44861a){logger[_0xef48('0x28')](_0xef48('0x36'),_0x199777);return request({'form':{'method':_0xef48('0x2a'),'input_type':_0xef48('0x21'),'response_type':'JSON','rest_data':JSON[_0xef48('0x22')]({'session':_0x44861a['id'],'module_name':'Contacts','query':util[_0xef48('0x24')](_0xef48('0x37'),_0x199777),'order_by':'','offset':'0','select_fields':['id','name',_0xef48('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x21f39e){if(_0x21f39e[_0xef48('0x2d')]['length']){var _0x5b607d=_[_0xef48('0x2e')](_0x21f39e['entry_list'],function(_0x3938da){return _0x3938da[_0xef48('0x2f')]['phone_home'][_0xef48('0x31')]===_0x199777;});if(_0x5b607d){logger[_0xef48('0x28')](_0xef48('0x39'));return BPromise['resolve']({'id':_0x5b607d[_0xef48('0x2f')]['id'][_0xef48('0x31')],'name':_0x5b607d[_0xef48('0x2f')]['name'][_0xef48('0x31')],'phone':_0x5b607d[_0xef48('0x2f')][_0xef48('0x38')][_0xef48('0x31')]});}}else{logger[_0xef48('0x28')](_0xef48('0x3a'));return request({'form':{'method':_0xef48('0x3b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xef48('0x22')]({'session':_0x44861a['id'],'module_name':_0xef48('0x3c'),'name_value_list':[{'name':_0xef48('0x3d'),'value':_0x1e3cb8!==_0xef48('0x3e')?_0x1e3cb8:util[_0xef48('0x24')](_0xef48('0x3f'),_0x199777)},{'name':'phone_home','value':_0x199777}]})}})[_0xef48('0x2c')](function(_0x27ed68){logger[_0xef48('0x28')](_0xef48('0x40'));return BPromise[_0xef48('0x33')]({'id':_0x27ed68['id'],'name':_0x27ed68['entry_list']['first_name'][_0xef48('0x31')],'phone':_0x27ed68['entry_list'][_0xef48('0x38')]['value']});});}});}function request(_0x412ce9){logger[_0xef48('0x41')]('[HTTP]',JSON['stringify'](_0x412ce9));return rp(_[_0xef48('0x42')](def,_0x412ce9));}function getTags(_0x50b029,_0x1aeaab){var _0x419519=[];if(_0x50b029&&_0x50b029[_0xef48('0x1c')]>0x0){_0x419519=_[_0xef48('0x43')](_0x50b029,_0x1aeaab);}return _0x419519;}function getCustomFields(_0x2a7916,_0x2bdbb2){var _0x4ecb93=[];var _0xf17aa9={'custom_fields':[]};if(_0x2a7916[_0xef48('0x1c')]>0x0){_[_0xef48('0x1d')](_0x2a7916,function(_0x10dd3f){if(_0x10dd3f[_0xef48('0x44')]===_0xef48('0x45')&&_0x10dd3f[_0xef48('0x46')]&&!_0x10dd3f['customField']){_0xf17aa9[_0x10dd3f[_0xef48('0x46')][_0xef48('0x47')]()]=_0x10dd3f['content']['toString']();}else if(_0x10dd3f[_0xef48('0x44')]===_0xef48('0x45')&&_0x10dd3f[_0xef48('0x20')]&&_0x10dd3f[_0xef48('0x48')]){_0xf17aa9[_0xef48('0x49')]['push']({'id':_0x10dd3f[_0xef48('0x20')],'value':_0x10dd3f['content'][_0xef48('0x26')]()});}else if(_0x10dd3f[_0xef48('0x44')]===_0xef48('0x4a')&&_0x10dd3f[_0xef48('0x1e')]&&_0x10dd3f['idField']&&_0x10dd3f[_0xef48('0x48')]){_0x2bdbb2[_0x10dd3f['variableName']]&&_0xf17aa9['custom_fields'][_0xef48('0x1f')]({'id':_0x10dd3f['idField'],'value':_0x2bdbb2[_0x10dd3f[_0xef48('0x1e')]][_0xef48('0x26')]()});}else if(_0x10dd3f[_0xef48('0x44')]===_0xef48('0x4b')&&_0x10dd3f[_0xef48('0x4c')]&&_0x10dd3f[_0xef48('0x4c')][_0xef48('0xf')]&&_0x10dd3f[_0xef48('0x20')]&&_0x10dd3f['customField']){_0x2bdbb2[_0x10dd3f[_0xef48('0x4c')][_0xef48('0xf')][_0xef48('0x47')]()]&&_0xf17aa9['custom_fields'][_0xef48('0x1f')]({'id':_0x10dd3f['idField'],'value':_0x2bdbb2[_0x10dd3f['Variable']['name'][_0xef48('0x47')]()][_0xef48('0x26')]()});}});}return _0xf17aa9;}function getConnection(_0x5b394e){return request({'method':_0xef48('0x4d'),'form':{'method':_0xef48('0x4e'),'input_type':_0xef48('0x21'),'response_type':'JSON','rest_data':JSON[_0xef48('0x22')]({'user_auth':{'user_name':_0x5b394e['username'],'password':_0x5b394e['password'],'encryption':_0xef48('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xef48('0x2c')](function(_0x5edcd6){var _0x2cf13f=_0x5edcd6;if(_0x2cf13f['id']){def[_0xef48('0x50')]=_0x2cf13f['id'];return BPromise[_0xef48('0x33')](_0x2cf13f);}else{throw new Error(util[_0xef48('0x24')](_0xef48('0x51'),_0x5b394e['id']));}});}function setRelationship(_0x41fcb0,_0x7c5785,_0x4a376a,_0x3f21bc){return request({'form':{'method':'set_relationship','input_type':_0xef48('0x21'),'response_type':'JSON','rest_data':JSON[_0xef48('0x22')]({'session':_0x41fcb0['id'],'module_name':_0xef48('0x23'),'module_id':_0x4a376a['id'],'link_field_name':_0x3f21bc,'related_ids':[_0x7c5785['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x252a7a,_0x31e0dc,_0x117137,_0x356803,_0x2c77e7,_0xf50569){var _0x19914e,_0xf3bffa,_0x4a3466,_0x232c3b;_0xf50569[_0xef48('0x52')]=intUtil[_0xef48('0x53')](_0xf50569[_0xef48('0x52')]);_0xf50569['serverUrl']=intUtil[_0xef48('0x53')](_0xf50569[_0xef48('0x54')]);def[_0xef48('0x55')]=util[_0xef48('0x24')]('%s/service/v4_1/rest.php',_0xf50569[_0xef48('0x52')]);if(_0x2c77e7&&_0x2c77e7[_0xef48('0x56')]){logger[_0xef48('0x28')](_0xef48('0x57'),_0xef48('0x58'));_0x31e0dc['recordingURL']=util[_0xef48('0x24')](_0xef48('0x59'),_0xf50569['serverUrl'],_0x31e0dc['uniqueid'],md5(_0x31e0dc[_0xef48('0x5a')]));}else{_0x31e0dc[_0xef48('0x5b')]='';}return getConnection(_0xf50569)[_0xef48('0x2c')](function(_0x32b28e){_0x232c3b=_0x32b28e;return getUser(_0xf50569,_0x356803[_0xef48('0xf')],_0x232c3b);})[_0xef48('0x2c')](function(_0x3bb183){_0x19914e=_0x3bb183;logger[_0xef48('0x28')](_0xef48('0x5c'),_0x19914e['id']);return getEndUser(_0xf50569,_0x31e0dc[_0xef48('0x5d')],_0x31e0dc['calleridnum'],_0x232c3b);})[_0xef48('0x2c')](function(_0x49a0cc){_0xf3bffa=_0x49a0cc;logger['info'](_0xef48('0x5e'),_0xf3bffa['id']);return getTicket(_0xf50569,_0x19914e,_0xf3bffa,_0x117137,_0x31e0dc,_0x117137['Fields'],_0x232c3b,'Inbound');})['then'](function(_0x237cfa){_0x4a3466=_0x237cfa;logger['info'](_0xef48('0x5f'));logger[_0xef48('0x28')](_0xef48('0x60'),_0x4a3466['id']);return setRelationship(_0x232c3b,_0x19914e,_0x4a3466,'users');})[_0xef48('0x2c')](function(){return setRelationship(_0x232c3b,_0xf3bffa,_0x4a3466,_0xef48('0x61'));})[_0xef48('0x2c')](function(){return getServerInfo(_0x232c3b);})['then'](function(_0x5f3761){var _0x531bae=parseInt(_0x5f3761[_0xef48('0x62')][_0xef48('0x63')](0x0));var _0x4220ae=util[_0xef48('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xf50569[_0xef48('0x52')],_0x4a3466['id']);if(_0x531bae>0x6){_0x4220ae=util['format'](_0xef48('0x64'),_0xf50569['remoteUri'],_0x4a3466['id']);}logger[_0xef48('0x28')](_0xef48('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xef48('0x24')]('user:%s',_0x356803[_0xef48('0xf')]),_0xef48('0x65'),{'uri':_0x4220ae});})['catch'](function(_0xa08aeb){logger['error'](_0xef48('0x57'),JSON[_0xef48('0x22')](_0xa08aeb));});};exports[_0xef48('0x66')]=function(_0x2d3f65,_0xbd88f,_0x25b413,_0x2c3991,_0x821392,_0x1b8075,_0x4bade0){var _0x49e827,_0x37dad6,_0x1c9e4f,_0x8c82e;_0x1b8075[_0xef48('0x52')]=intUtil[_0xef48('0x53')](_0x1b8075[_0xef48('0x52')]);_0x1b8075['serverUrl']=intUtil[_0xef48('0x53')](_0x1b8075[_0xef48('0x54')]);def[_0xef48('0x55')]=util[_0xef48('0x24')](_0xef48('0x67'),_0x1b8075[_0xef48('0x52')]);if(_0x4bade0&&_0x4bade0[_0xef48('0x68')]&&_0x4bade0[_0xef48('0x68')]!==_0xef48('0x69')){logger[_0xef48('0x28')](_0xef48('0x6a'),_0xef48('0x58'));_0xbd88f[_0xef48('0x5b')]=util[_0xef48('0x24')](_0xef48('0x59'),_0x1b8075['serverUrl'],_0xbd88f[_0xef48('0x5a')],md5(_0xbd88f[_0xef48('0x5a')]));}return getConnection(_0x1b8075)[_0xef48('0x2c')](function(_0x5523c9){_0x8c82e=_0x5523c9;return getUser(_0x1b8075,_0x2c3991['name'],_0x8c82e);})[_0xef48('0x2c')](function(_0x62bb6f){_0x49e827=_0x62bb6f;logger[_0xef48('0x28')](_0xef48('0x5c'),_0x49e827['id']);return getEndUser(_0x1b8075,_0xbd88f[_0xef48('0x6b')],_0xbd88f['destcalleridnum'],_0x8c82e);})[_0xef48('0x2c')](function(_0x45ff16){_0x37dad6=_0x45ff16;logger[_0xef48('0x28')](_0xef48('0x5e'),_0x37dad6['id']);return getTicket(_0x1b8075,_0x49e827,_0x37dad6,_0x25b413,_0xbd88f,_0x25b413[_0xef48('0x6c')],_0x8c82e,'Outbound');})[_0xef48('0x2c')](function(_0x56b79f){_0x1c9e4f=_0x56b79f;logger['info'](_0xef48('0x5f'));logger[_0xef48('0x28')]('The\x20Ticket\x20ID\x20is:',_0x1c9e4f['id']);return setRelationship(_0x8c82e,_0x49e827,_0x1c9e4f,_0xef48('0x6d'));})['then'](function(){return setRelationship(_0x8c82e,_0x37dad6,_0x1c9e4f,'contacts');})[_0xef48('0x2c')](function(){return getServerInfo(_0x8c82e);})[_0xef48('0x2c')](function(_0xde0326){var _0x489b58=parseInt(_0xde0326['version'][_0xef48('0x63')](0x0));var _0x329c09=util[_0xef48('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1b8075['remoteUri'],_0x1c9e4f['id']);if(_0x489b58>0x6){_0x329c09=util[_0xef48('0x24')](_0xef48('0x64'),_0x1b8075[_0xef48('0x52')],_0x1c9e4f['id']);}logger['info'](_0xef48('0x6a'),_0xef48('0x6e'));emit(util[_0xef48('0x24')]('user:%s',_0x2c3991[_0xef48('0xf')]),'trigger:browser:url',{'uri':_0x329c09});})[_0xef48('0x6f')](function(_0x351939){logger[_0xef48('0x70')](_0xef48('0x6a'),JSON[_0xef48('0x22')](_0x351939));});};exports[_0xef48('0x71')]=function(_0xd56da9,_0x1891df,_0x5e32cf,_0x4842c3,_0x47b1bb,_0x4fee1b){var _0x150e60,_0x38561f,_0x44f16f,_0x190a07;_0x4fee1b[_0xef48('0x52')]=intUtil['stripTrailingSlash'](_0x4fee1b['remoteUri']);_0x4fee1b['serverUrl']=intUtil[_0xef48('0x53')](_0x4fee1b[_0xef48('0x54')]);def[_0xef48('0x55')]=util[_0xef48('0x24')](_0xef48('0x67'),_0x4fee1b[_0xef48('0x52')]);if(_0x47b1bb&&_0x47b1bb[_0xef48('0x56')]){logger['info']('['+_0x1891df[_0xef48('0x72')]['toUpperCase']()+']',_0xef48('0x58'));_0x1891df[_0xef48('0x5b')]=util[_0xef48('0x24')](_0xef48('0x59'),_0x4fee1b['serverUrl'],_0x1891df[_0xef48('0x5a')],md5(_0x1891df[_0xef48('0x5a')]));}else{_0x1891df['recordingURL']='';}return getConnection(_0x4fee1b)['then'](function(_0x549397){_0x190a07=_0x549397;if(!_[_0xef48('0x73')](_0x4842c3)){return getUser(_0x4fee1b,_0x4842c3[_0xef48('0xf')],_0x190a07);}else{return getUser(_0x4fee1b,null,_0x190a07);}})[_0xef48('0x2c')](function(_0x4cb38d){_0x150e60=_0x4cb38d;logger[_0xef48('0x28')](_0xef48('0x5c'),_0x150e60['id']);return getEndUser(_0x4fee1b,_0x1891df[_0xef48('0x5d')],_0x1891df[_0xef48('0x74')],_0x190a07);})[_0xef48('0x2c')](function(_0x1da01b){_0x38561f=_0x1da01b;logger[_0xef48('0x28')]('The\x20Enduser\x20ID\x20is:',_0x38561f['id']);return getTicket(_0x4fee1b,_0x150e60,_0x38561f,_0x5e32cf,_0x1891df,_0x5e32cf[_0xef48('0x6c')],_0x190a07,_0xef48('0x75'));})[_0xef48('0x2c')](function(_0x1960c0){_0x44f16f=_0x1960c0;logger[_0xef48('0x28')](_0xef48('0x5f'));logger[_0xef48('0x28')](_0xef48('0x60'),_0x44f16f['id']);return setRelationship(_0x190a07,_0x150e60,_0x44f16f,_0xef48('0x6d'));})[_0xef48('0x2c')](function(){return setRelationship(_0x190a07,_0x38561f,_0x44f16f,'contacts');})['then'](function(){return getServerInfo(_0x190a07);})[_0xef48('0x6f')](function(_0x50c3a8){logger[_0xef48('0x70')]('['+_0x1891df[_0xef48('0x72')][_0xef48('0x76')]()+']',JSON[_0xef48('0x22')](_0x50c3a8));});}; \ No newline at end of file +var _0x3650=['parent_type','parent_name','direction','forEach','variableName','idField','JSON','Calls','format','Basic\x20%s','apiKey','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','length','name_value_list','user_name','value','info','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','find','first_name','','Enduser\x20created.','phone_home','debug','[HTTP]','map','string','nameField','customField','toLowerCase','toString','type','custom_fields','push','content','variable','customVariable','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','uri','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','users','contacts','charAt','catch','unmanaged','toUpperCase','calleridnum','Inbound','lastevent','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x3650,0xde));var _0x0365=function(_0x35eeee,_0x35794d){_0x35eeee=_0x35eeee-0x0;var _0x5ca4fd=_0x3650[_0x35eeee];return _0x5ca4fd;};'use strict';var _=require(_0x0365('0x0'));var rp=require(_0x0365('0x1'));var BPromise=require('bluebird');var md5=require(_0x0365('0x2'));var util=require('util');var Redis=require(_0x0365('0x3'));var intUtil=require(_0x0365('0x4'));var config=require(_0x0365('0x5'));var logger=require(_0x0365('0x6'))('sugarcrm');config[_0x0365('0x7')]=_['defaults'](config['redis'],{'host':_0x0365('0x8'),'port':0x18eb});var io=require(_0x0365('0x9'))(new Redis(config['redis']));var def={'method':_0x0365('0xa'),'json':!![]};function emit(_0xfa6772,_0x3a6d60,_0x14686b){io['to'](_0xfa6772)[_0x0365('0xb')](_0x3a6d60,_0x14686b);}function getTicket(_0x52c9a0,_0x3548d0,_0x38a33f,_0x43025b,_0x29bfe2,_0x395f7a,_0x5695b2,_0x42190d){logger['info'](_0x0365('0xc'));var _0x18c4b9=new Date();var _0x24540f=[{'name':_0x0365('0xd'),'value':intUtil['getString'](_0x43025b['Subjects'],_0x29bfe2,'\x20')},{'name':_0x0365('0xe'),'value':_0x3548d0['id']},{'name':_0x0365('0xf'),'value':_0x3548d0['id']},{'name':_0x0365('0x10'),'value':intUtil[_0x0365('0x11')](_0x43025b[_0x0365('0x12')],_0x29bfe2,'\x0a')},{'name':_0x0365('0x13'),'value':_0x18c4b9[_0x0365('0x14')]()[_0x0365('0x15')](0x0,0x13)[_0x0365('0x16')]('T','\x20')},{'name':_0x0365('0x17'),'value':'0'},{'name':_0x0365('0x18'),'value':'15'},{'name':_0x0365('0x19'),'value':_0x38a33f['id']},{'name':_0x0365('0x1a'),'value':'Contacts'},{'name':_0x0365('0x1b'),'value':_0x38a33f[_0x0365('0xd')]},{'name':_0x0365('0x1c'),'value':_0x42190d}];if(_0x395f7a['length']){_[_0x0365('0x1d')](_0x395f7a,function(_0x3a2b48){if(_0x29bfe2[_0x3a2b48[_0x0365('0x1e')]]){_0x24540f['push']({'name':_0x3a2b48[_0x0365('0x1f')],'value':_0x29bfe2[_0x3a2b48[_0x0365('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x0365('0x20'),'rest_data':JSON['stringify']({'session':_0x5695b2['id'],'module_name':_0x0365('0x21'),'name_value_list':_0x24540f})}});}function getAuth(_0x1f2302){return util[_0x0365('0x22')](_0x0365('0x23'),new Buffer(_0x1f2302[_0x0365('0x24')]+':X')['toString']('base64'));}function getServerInfo(_0x49414d){return request({'form':{'method':_0x0365('0x25'),'input_type':_0x0365('0x20'),'response_type':'JSON','rest_data':JSON[_0x0365('0x26')]({'session':_0x49414d['id']})}});}function getUser(_0x4d0c7d,_0x47c04c,_0x3d6bc7){if(!_[_0x0365('0x27')](_0x47c04c)){logger['info'](_0x0365('0x28'),_0x47c04c);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x0365('0x26')]({'session':_0x3d6bc7['id'],'module_name':_0x0365('0x29'),'query':util['format'](_0x0365('0x2a'),_0x47c04c),'order_by':'','offset':'0','select_fields':['id',_0x0365('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0365('0x2b')](function(_0x26c525){if(_0x26c525[_0x0365('0x2c')][_0x0365('0x2d')]){var _0x2de5e1=_['find'](_0x26c525['entry_list'],function(_0x2d33e8){return _0x2d33e8[_0x0365('0x2e')][_0x0365('0x2f')][_0x0365('0x30')]===_0x47c04c;});if(_0x2de5e1){logger[_0x0365('0x31')](_0x0365('0x32'));return BPromise[_0x0365('0x33')]({'id':_0x2de5e1['name_value_list']['id'][_0x0365('0x30')],'name':_0x2de5e1[_0x0365('0x2e')][_0x0365('0xd')][_0x0365('0x30')]});}}logger[_0x0365('0x31')](_0x0365('0x34'));return BPromise[_0x0365('0x33')]({'id':_0x3d6bc7['name_value_list'][_0x0365('0x35')][_0x0365('0x30')],'name':_0x3d6bc7[_0x0365('0x2e')][_0x0365('0x2f')][_0x0365('0x30')]});});}else{logger[_0x0365('0x31')](_0x0365('0x36'));return BPromise[_0x0365('0x33')]({'id':_0x3d6bc7[_0x0365('0x2e')][_0x0365('0x35')]['value'],'name':_0x3d6bc7['name_value_list'][_0x0365('0x2f')][_0x0365('0x30')]});}}function getEndUser(_0x4fe1ad,_0x31202e,_0x8b2830,_0x4915a6){logger[_0x0365('0x31')](_0x0365('0x37'),_0x8b2830);return request({'form':{'method':'get_entry_list','input_type':_0x0365('0x20'),'response_type':_0x0365('0x20'),'rest_data':JSON[_0x0365('0x26')]({'session':_0x4915a6['id'],'module_name':_0x0365('0x38'),'query':util[_0x0365('0x22')](_0x0365('0x39'),_0x8b2830),'order_by':'','offset':'0','select_fields':['id',_0x0365('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0365('0x2b')](function(_0x1c7c51){if(_0x1c7c51['entry_list'][_0x0365('0x2d')]){var _0x9829c4=_[_0x0365('0x3a')](_0x1c7c51[_0x0365('0x2c')],function(_0xe399fa){return _0xe399fa[_0x0365('0x2e')]['phone_home'][_0x0365('0x30')]===_0x8b2830;});if(_0x9829c4){logger[_0x0365('0x31')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x9829c4[_0x0365('0x2e')]['id'][_0x0365('0x30')],'name':_0x9829c4[_0x0365('0x2e')][_0x0365('0xd')][_0x0365('0x30')],'phone':_0x9829c4[_0x0365('0x2e')]['phone_home'][_0x0365('0x30')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x0365('0x20'),'rest_data':JSON['stringify']({'session':_0x4915a6['id'],'module_name':_0x0365('0x38'),'name_value_list':[{'name':_0x0365('0x3b'),'value':_0x31202e!==_0x0365('0x3c')?_0x31202e:util[_0x0365('0x22')]('Caller\x20-\x20%s',_0x8b2830)},{'name':'phone_home','value':_0x8b2830}]})}})[_0x0365('0x2b')](function(_0x5702a5){logger[_0x0365('0x31')](_0x0365('0x3d'));return BPromise[_0x0365('0x33')]({'id':_0x5702a5['id'],'name':_0x5702a5['entry_list'][_0x0365('0x3b')][_0x0365('0x30')],'phone':_0x5702a5[_0x0365('0x2c')][_0x0365('0x3e')]['value']});});}});}function request(_0x1d00cd){logger[_0x0365('0x3f')](_0x0365('0x40'),JSON['stringify'](_0x1d00cd));return rp(_['merge'](def,_0x1d00cd));}function getTags(_0x36e23d,_0x10a390){var _0x382ecd=[];if(_0x36e23d&&_0x36e23d['length']>0x0){_0x382ecd=_[_0x0365('0x41')](_0x36e23d,_0x10a390);}return _0x382ecd;}function getCustomFields(_0x328039,_0x61c8e9){var _0x1bcc8d=[];var _0x5f28ee={'custom_fields':[]};if(_0x328039[_0x0365('0x2d')]>0x0){_[_0x0365('0x1d')](_0x328039,function(_0x3eca0f){if(_0x3eca0f['type']===_0x0365('0x42')&&_0x3eca0f[_0x0365('0x43')]&&!_0x3eca0f[_0x0365('0x44')]){_0x5f28ee[_0x3eca0f[_0x0365('0x43')][_0x0365('0x45')]()]=_0x3eca0f['content'][_0x0365('0x46')]();}else if(_0x3eca0f[_0x0365('0x47')]===_0x0365('0x42')&&_0x3eca0f['idField']&&_0x3eca0f[_0x0365('0x44')]){_0x5f28ee[_0x0365('0x48')][_0x0365('0x49')]({'id':_0x3eca0f[_0x0365('0x1f')],'value':_0x3eca0f[_0x0365('0x4a')][_0x0365('0x46')]()});}else if(_0x3eca0f['type']===_0x0365('0x4b')&&_0x3eca0f['variableName']&&_0x3eca0f['idField']&&_0x3eca0f[_0x0365('0x44')]){_0x61c8e9[_0x3eca0f['variableName']]&&_0x5f28ee[_0x0365('0x48')][_0x0365('0x49')]({'id':_0x3eca0f[_0x0365('0x1f')],'value':_0x61c8e9[_0x3eca0f[_0x0365('0x1e')]]['toString']()});}else if(_0x3eca0f[_0x0365('0x47')]===_0x0365('0x4c')&&_0x3eca0f[_0x0365('0x4d')]&&_0x3eca0f[_0x0365('0x4d')][_0x0365('0xd')]&&_0x3eca0f[_0x0365('0x1f')]&&_0x3eca0f[_0x0365('0x44')]){_0x61c8e9[_0x3eca0f[_0x0365('0x4d')][_0x0365('0xd')][_0x0365('0x45')]()]&&_0x5f28ee['custom_fields'][_0x0365('0x49')]({'id':_0x3eca0f['idField'],'value':_0x61c8e9[_0x3eca0f['Variable'][_0x0365('0xd')][_0x0365('0x45')]()][_0x0365('0x46')]()});}});}return _0x5f28ee;}function getConnection(_0x44acc5){return request({'method':_0x0365('0xa'),'form':{'method':_0x0365('0x4e'),'input_type':_0x0365('0x20'),'response_type':_0x0365('0x20'),'rest_data':JSON[_0x0365('0x26')]({'user_auth':{'user_name':_0x44acc5['username'],'password':_0x44acc5['password'],'encryption':_0x0365('0x4f')},'application':_0x0365('0x50')})}})['then'](function(_0x219291){var _0x2a071a=_0x219291;if(_0x2a071a['id']){def[_0x0365('0x51')]=_0x2a071a['id'];return BPromise['resolve'](_0x2a071a);}else{throw new Error(util[_0x0365('0x22')](_0x0365('0x52'),_0x44acc5['id']));}});}function setRelationship(_0xc1571c,_0x667748,_0x59b0f0,_0x21db6c){return request({'form':{'method':_0x0365('0x53'),'input_type':'JSON','response_type':_0x0365('0x20'),'rest_data':JSON[_0x0365('0x26')]({'session':_0xc1571c['id'],'module_name':'Calls','module_id':_0x59b0f0['id'],'link_field_name':_0x21db6c,'related_ids':[_0x667748['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0365('0x54')]=function(_0x17a78b,_0x2bff91,_0x4a5592,_0xb76bd1,_0xc2266a,_0x333ccc){var _0x2b5482,_0x152dd9,_0x59a855,_0x2755ab;_0x333ccc[_0x0365('0x55')]=intUtil[_0x0365('0x56')](_0x333ccc[_0x0365('0x55')]);_0x333ccc[_0x0365('0x57')]=intUtil[_0x0365('0x56')](_0x333ccc['serverUrl']);def['uri']=util['format'](_0x0365('0x58'),_0x333ccc[_0x0365('0x55')]);if(_0xc2266a&&_0xc2266a[_0x0365('0x59')]){logger['info'](_0x0365('0x5a'),'Recording\x20is\x20enabled!');_0x2bff91[_0x0365('0x5b')]=util[_0x0365('0x22')](_0x0365('0x5c'),_0x333ccc[_0x0365('0x57')],_0x2bff91[_0x0365('0x5d')],md5(_0x2bff91[_0x0365('0x5d')]));}else{_0x2bff91[_0x0365('0x5b')]='';}return getConnection(_0x333ccc)[_0x0365('0x2b')](function(_0x3f2271){_0x2755ab=_0x3f2271;return getUser(_0x333ccc,_0xb76bd1[_0x0365('0xd')],_0x2755ab);})[_0x0365('0x2b')](function(_0x31860b){_0x2b5482=_0x31860b;logger[_0x0365('0x31')](_0x0365('0x5e'),_0x2b5482['id']);return getEndUser(_0x333ccc,_0x2bff91[_0x0365('0x5f')],_0x2bff91['calleridnum'],_0x2755ab);})['then'](function(_0x545dba){_0x152dd9=_0x545dba;logger[_0x0365('0x31')](_0x0365('0x60'),_0x152dd9['id']);return getTicket(_0x333ccc,_0x2b5482,_0x152dd9,_0x4a5592,_0x2bff91,_0x4a5592['Fields'],_0x2755ab,'Inbound');})[_0x0365('0x2b')](function(_0x149af2){_0x59a855=_0x149af2;logger[_0x0365('0x31')]('Ticket\x20created!');logger[_0x0365('0x31')](_0x0365('0x61'),_0x59a855['id']);return setRelationship(_0x2755ab,_0x2b5482,_0x59a855,'users');})[_0x0365('0x2b')](function(){return setRelationship(_0x2755ab,_0x152dd9,_0x59a855,'contacts');})[_0x0365('0x2b')](function(){return getServerInfo(_0x2755ab);})['then'](function(_0x44f3cd){var _0x4dda1a=parseInt(_0x44f3cd[_0x0365('0x62')]['charAt'](0x0));var _0x48248c=util[_0x0365('0x22')](_0x0365('0x63'),_0x333ccc[_0x0365('0x55')],_0x59a855['id']);if(_0x4dda1a>0x6){_0x48248c=util['format'](_0x0365('0x64'),_0x333ccc['remoteUri'],_0x59a855['id']);}logger['info'](_0x0365('0x5a'),_0x0365('0x65'));emit(util[_0x0365('0x22')](_0x0365('0x66'),_0xb76bd1[_0x0365('0xd')]),_0x0365('0x67'),{'uri':_0x48248c});})['catch'](function(_0x1e3803){logger[_0x0365('0x68')](_0x0365('0x5a'),JSON[_0x0365('0x26')](_0x1e3803));});};exports[_0x0365('0x69')]=function(_0x49e46f,_0x1c8743,_0x118889,_0xff6b00,_0x3d1404,_0x4eea8b,_0x2a3630){var _0x145afd,_0x27e449,_0x5bfceb,_0x1a22c6;_0x4eea8b[_0x0365('0x55')]=intUtil[_0x0365('0x56')](_0x4eea8b[_0x0365('0x55')]);_0x4eea8b['serverUrl']=intUtil[_0x0365('0x56')](_0x4eea8b[_0x0365('0x57')]);def[_0x0365('0x6a')]=util[_0x0365('0x22')](_0x0365('0x58'),_0x4eea8b[_0x0365('0x55')]);if(_0x2a3630&&_0x2a3630['recordingFormat']&&_0x2a3630['recordingFormat']!==_0x0365('0x6b')){logger['info'](_0x0365('0x6c'),_0x0365('0x6d'));_0x1c8743[_0x0365('0x5b')]=util[_0x0365('0x22')](_0x0365('0x5c'),_0x4eea8b[_0x0365('0x57')],_0x1c8743[_0x0365('0x5d')],md5(_0x1c8743[_0x0365('0x5d')]));}return getConnection(_0x4eea8b)[_0x0365('0x2b')](function(_0x5135f7){_0x1a22c6=_0x5135f7;return getUser(_0x4eea8b,_0xff6b00[_0x0365('0xd')],_0x1a22c6);})['then'](function(_0x4f67b8){_0x145afd=_0x4f67b8;logger['info'](_0x0365('0x5e'),_0x145afd['id']);return getEndUser(_0x4eea8b,_0x1c8743[_0x0365('0x6e')],_0x1c8743[_0x0365('0x6f')],_0x1a22c6);})['then'](function(_0x364668){_0x27e449=_0x364668;logger[_0x0365('0x31')](_0x0365('0x60'),_0x27e449['id']);return getTicket(_0x4eea8b,_0x145afd,_0x27e449,_0x118889,_0x1c8743,_0x118889[_0x0365('0x70')],_0x1a22c6,_0x0365('0x71'));})['then'](function(_0x144c3d){_0x5bfceb=_0x144c3d;logger[_0x0365('0x31')](_0x0365('0x72'));logger[_0x0365('0x31')]('The\x20Ticket\x20ID\x20is:',_0x5bfceb['id']);return setRelationship(_0x1a22c6,_0x145afd,_0x5bfceb,_0x0365('0x73'));})[_0x0365('0x2b')](function(){return setRelationship(_0x1a22c6,_0x27e449,_0x5bfceb,_0x0365('0x74'));})[_0x0365('0x2b')](function(){return getServerInfo(_0x1a22c6);})['then'](function(_0x182753){var _0x38c1bc=parseInt(_0x182753[_0x0365('0x62')][_0x0365('0x75')](0x0));var _0x15cee2=util[_0x0365('0x22')](_0x0365('0x63'),_0x4eea8b[_0x0365('0x55')],_0x5bfceb['id']);if(_0x38c1bc>0x6){_0x15cee2=util[_0x0365('0x22')](_0x0365('0x64'),_0x4eea8b[_0x0365('0x55')],_0x5bfceb['id']);}logger['info']('[OUTBOUND]',_0x0365('0x65'));emit(util[_0x0365('0x22')](_0x0365('0x66'),_0xff6b00[_0x0365('0xd')]),_0x0365('0x67'),{'uri':_0x15cee2});})[_0x0365('0x76')](function(_0x4ee5a6){logger[_0x0365('0x68')](_0x0365('0x6c'),JSON[_0x0365('0x26')](_0x4ee5a6));});};exports[_0x0365('0x77')]=function(_0x3d3896,_0x69fbc6,_0x2fa4d5,_0x518b9e,_0x50586b,_0x97066e){var _0x1391a6,_0x196fa3,_0x23a15c,_0x1049b9;_0x97066e['remoteUri']=intUtil[_0x0365('0x56')](_0x97066e[_0x0365('0x55')]);_0x97066e[_0x0365('0x57')]=intUtil[_0x0365('0x56')](_0x97066e[_0x0365('0x57')]);def[_0x0365('0x6a')]=util[_0x0365('0x22')]('%s/service/v4_1/rest.php',_0x97066e[_0x0365('0x55')]);if(_0x50586b&&_0x50586b[_0x0365('0x59')]){logger['info']('['+_0x69fbc6['lastevent'][_0x0365('0x78')]()+']',_0x0365('0x6d'));_0x69fbc6[_0x0365('0x5b')]=util[_0x0365('0x22')](_0x0365('0x5c'),_0x97066e['serverUrl'],_0x69fbc6['uniqueid'],md5(_0x69fbc6[_0x0365('0x5d')]));}else{_0x69fbc6['recordingURL']='';}return getConnection(_0x97066e)[_0x0365('0x2b')](function(_0x530aa0){_0x1049b9=_0x530aa0;if(!_[_0x0365('0x27')](_0x518b9e)){return getUser(_0x97066e,_0x518b9e[_0x0365('0xd')],_0x1049b9);}else{return getUser(_0x97066e,null,_0x1049b9);}})[_0x0365('0x2b')](function(_0x2fd138){_0x1391a6=_0x2fd138;logger[_0x0365('0x31')](_0x0365('0x5e'),_0x1391a6['id']);return getEndUser(_0x97066e,_0x69fbc6[_0x0365('0x5f')],_0x69fbc6[_0x0365('0x79')],_0x1049b9);})[_0x0365('0x2b')](function(_0x39921c){_0x196fa3=_0x39921c;logger[_0x0365('0x31')](_0x0365('0x60'),_0x196fa3['id']);return getTicket(_0x97066e,_0x1391a6,_0x196fa3,_0x2fa4d5,_0x69fbc6,_0x2fa4d5[_0x0365('0x70')],_0x1049b9,_0x0365('0x7a'));})[_0x0365('0x2b')](function(_0x33fc4d){_0x23a15c=_0x33fc4d;logger[_0x0365('0x31')]('Ticket\x20created!');logger[_0x0365('0x31')](_0x0365('0x61'),_0x23a15c['id']);return setRelationship(_0x1049b9,_0x1391a6,_0x23a15c,'users');})[_0x0365('0x2b')](function(){return setRelationship(_0x1049b9,_0x196fa3,_0x23a15c,_0x0365('0x74'));})['then'](function(){return getServerInfo(_0x1049b9);})['catch'](function(_0xd80652){logger['error']('['+_0x69fbc6[_0x0365('0x7b')]['toUpperCase']()+']',JSON['stringify'](_0xd80652));});}; \ 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 b03c634..956403b 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 _0x8bfd=['length','type','push','content','variable','variableName','customVariable','Variable','name','toString','keyValue','keyType','string','key','%s:\x20%s','format','toLowerCase','join','stripTrailingSlash','substring','lastIndexOf','isNil','util','getString'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8bfd,0xee));var _0xd8bf=function(_0x2c60d1,_0x5b778f){_0x2c60d1=_0x2c60d1-0x0;var _0xdf6e43=_0x8bfd[_0x2c60d1];return _0xdf6e43;};'use strict';var _=require('lodash');var util=require(_0xd8bf('0x0'));exports[_0xd8bf('0x1')]=function(_0x1cf89d,_0x7ae910,_0x384a26){var _0x31a227=[];if(_0x1cf89d[_0xd8bf('0x2')]>0x0){var _0x855a17=_['sortBy'](_0x1cf89d,['id']);for(var _0xff4f9a=0x0;_0xff4f9a<_0x855a17['length'];_0xff4f9a++){var _0x2f4aa8=_0x855a17[_0xff4f9a];if(_0x2f4aa8[_0xd8bf('0x3')]==='string'){_0x31a227[_0xd8bf('0x4')](_0x2f4aa8[_0xd8bf('0x5')]);}else if(_0x2f4aa8[_0xd8bf('0x3')]===_0xd8bf('0x6')&&_0x2f4aa8[_0xd8bf('0x7')]){_0x7ae910[_0x2f4aa8[_0xd8bf('0x7')]]&&_0x31a227['push'](_0x7ae910[_0x2f4aa8[_0xd8bf('0x7')]]['toString']());}else if(_0x2f4aa8['type']===_0xd8bf('0x8')&&_0x2f4aa8[_0xd8bf('0x9')]&&_0x2f4aa8[_0xd8bf('0x9')][_0xd8bf('0xa')]){_0x7ae910[_0x2f4aa8['Variable'][_0xd8bf('0xa')]['toLowerCase']()]&&_0x31a227[_0xd8bf('0x4')](_0x7ae910[_0x2f4aa8[_0xd8bf('0x9')]['name']['toLowerCase']()][_0xd8bf('0xb')]());}else if(_0x2f4aa8[_0xd8bf('0x3')]===_0xd8bf('0xc')){if(_0x2f4aa8[_0xd8bf('0xd')]===_0xd8bf('0xe')&&_0x2f4aa8[_0xd8bf('0xf')]){_0x31a227[_0xd8bf('0x4')](util['format'](_0xd8bf('0x10'),_0x2f4aa8['key'],_0x2f4aa8['keyContent']));}else if(_0x2f4aa8[_0xd8bf('0xd')]==='variable'&&_0x2f4aa8[_0xd8bf('0x7')]&&_0x2f4aa8[_0xd8bf('0xf')]){_0x7ae910[_0x2f4aa8[_0xd8bf('0x7')]]&&_0x31a227[_0xd8bf('0x4')](util[_0xd8bf('0x11')](_0xd8bf('0x10'),_0x2f4aa8[_0xd8bf('0xf')],_0x7ae910[_0x2f4aa8[_0xd8bf('0x7')]]));}else if(_0x2f4aa8[_0xd8bf('0xd')]===_0xd8bf('0x8')&&_0x2f4aa8[_0xd8bf('0x9')]&&_0x2f4aa8[_0xd8bf('0x9')][_0xd8bf('0xa')]&&_0x2f4aa8['key']){_0x7ae910[_0x2f4aa8['Variable'][_0xd8bf('0xa')][_0xd8bf('0x12')]()]&&_0x31a227['push'](util['format']('%s:\x20%s',_0x2f4aa8[_0xd8bf('0xf')],_0x7ae910[_0x2f4aa8['Variable'][_0xd8bf('0xa')][_0xd8bf('0x12')]()]));}}}}return _0x31a227[_0xd8bf('0x13')](_0x384a26);};exports[_0xd8bf('0x14')]=function(_0x423024){var _0x4eb355=_0x423024['slice'](-0x1);if(_0x4eb355==='/'){_0x423024=_0x423024[_0xd8bf('0x15')](0x0,_0x423024[_0xd8bf('0x16')](_0x4eb355));}return _0x423024;};exports['validateEmail']=function(_0x2e622c){if(!_[_0xd8bf('0x17')](_0x2e622c)&&_0x2e622c!==''){var _0x33b281=/^(([^<>()\[\]\\.,;:\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 _0x33b281['test'](String(_0x2e622c)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xfc3c=['variable','variableName','push','toString','type','customVariable','Variable','name','keyValue','keyType','key','%s:\x20%s','keyContent','format','toLowerCase','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','sortBy','length','string'];(function(_0xe3d29f,_0x4b6ae1){var _0x126bae=function(_0x1fae2e){while(--_0x1fae2e){_0xe3d29f['push'](_0xe3d29f['shift']());}};_0x126bae(++_0x4b6ae1);}(_0xfc3c,0x11a));var _0xcfc3=function(_0x37be36,_0x18fe03){_0x37be36=_0x37be36-0x0;var _0x47108e=_0xfc3c[_0x37be36];return _0x47108e;};'use strict';var _=require(_0xcfc3('0x0'));var util=require('util');exports['getString']=function(_0x1d156e,_0x5d0311,_0x900b4a){var _0x5bb2fd=[];if(_0x1d156e['length']>0x0){var _0x1bb626=_[_0xcfc3('0x1')](_0x1d156e,['id']);for(var _0x4dae04=0x0;_0x4dae04<_0x1bb626[_0xcfc3('0x2')];_0x4dae04++){var _0x5bd100=_0x1bb626[_0x4dae04];if(_0x5bd100['type']===_0xcfc3('0x3')){_0x5bb2fd['push'](_0x5bd100['content']);}else if(_0x5bd100['type']===_0xcfc3('0x4')&&_0x5bd100[_0xcfc3('0x5')]){_0x5d0311[_0x5bd100['variableName']]&&_0x5bb2fd[_0xcfc3('0x6')](_0x5d0311[_0x5bd100[_0xcfc3('0x5')]][_0xcfc3('0x7')]());}else if(_0x5bd100[_0xcfc3('0x8')]===_0xcfc3('0x9')&&_0x5bd100[_0xcfc3('0xa')]&&_0x5bd100[_0xcfc3('0xa')][_0xcfc3('0xb')]){_0x5d0311[_0x5bd100[_0xcfc3('0xa')][_0xcfc3('0xb')]['toLowerCase']()]&&_0x5bb2fd[_0xcfc3('0x6')](_0x5d0311[_0x5bd100[_0xcfc3('0xa')][_0xcfc3('0xb')]['toLowerCase']()][_0xcfc3('0x7')]());}else if(_0x5bd100['type']===_0xcfc3('0xc')){if(_0x5bd100[_0xcfc3('0xd')]===_0xcfc3('0x3')&&_0x5bd100[_0xcfc3('0xe')]){_0x5bb2fd['push'](util['format'](_0xcfc3('0xf'),_0x5bd100[_0xcfc3('0xe')],_0x5bd100[_0xcfc3('0x10')]));}else if(_0x5bd100[_0xcfc3('0xd')]==='variable'&&_0x5bd100['variableName']&&_0x5bd100['key']){_0x5d0311[_0x5bd100[_0xcfc3('0x5')]]&&_0x5bb2fd['push'](util[_0xcfc3('0x11')](_0xcfc3('0xf'),_0x5bd100[_0xcfc3('0xe')],_0x5d0311[_0x5bd100[_0xcfc3('0x5')]]));}else if(_0x5bd100[_0xcfc3('0xd')]===_0xcfc3('0x9')&&_0x5bd100[_0xcfc3('0xa')]&&_0x5bd100[_0xcfc3('0xa')][_0xcfc3('0xb')]&&_0x5bd100['key']){_0x5d0311[_0x5bd100[_0xcfc3('0xa')][_0xcfc3('0xb')][_0xcfc3('0x12')]()]&&_0x5bb2fd[_0xcfc3('0x6')](util[_0xcfc3('0x11')]('%s:\x20%s',_0x5bd100[_0xcfc3('0xe')],_0x5d0311[_0x5bd100[_0xcfc3('0xa')]['name'][_0xcfc3('0x12')]()]));}}}}return _0x5bb2fd[_0xcfc3('0x13')](_0x900b4a);};exports[_0xcfc3('0x14')]=function(_0x5bbd47){var _0x17cfe5=_0x5bbd47[_0xcfc3('0x15')](-0x1);if(_0x17cfe5==='/'){_0x5bbd47=_0x5bbd47[_0xcfc3('0x16')](0x0,_0x5bbd47['lastIndexOf'](_0x17cfe5));}return _0x5bbd47;};exports[_0xcfc3('0x17')]=function(_0x4e29e5){if(!_[_0xcfc3('0x18')](_0x4e29e5)&&_0x4e29e5!==''){var _0x3d948e=/^(([^<>()\[\]\\.,;:\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 _0x3d948e[_0xcfc3('0x19')](String(_0x4e29e5)[_0xcfc3('0x12')]());}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 79f0206..9b45480 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(_0x4796ac,_0x26ef34){var _0x27af10=function(_0x56b242){while(--_0x56b242){_0x4796ac['push'](_0x4796ac['shift']());}};_0x27af10(++_0x26ef34);}(_0x34e8,0x12c));var _0x834e=function(_0xe07f99,_0x2c9af6){_0xe07f99=_0xe07f99-0x0;var _0x70a9f8=_0x34e8[_0xe07f99];return _0x70a9f8;};'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(_0x2c67af,_0x367db4){var _0x56bb38=function(_0x4eb5c7){while(--_0x4eb5c7){_0x2c67af['push'](_0x2c67af['shift']());}};_0x56bb38(++_0x367db4);}(_0xe706,0xa3));var _0x6e70=function(_0x2a4a99,_0x64b4a){_0x2a4a99=_0x2a4a99-0x0;var _0x1cef2f=_0xe706[_0x2a4a99];return _0x1cef2f;};'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 3d219f5..33db915 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 _0x2239=['queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','catch','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','./util','../../../../config/environment','zendesk','defaults','redis','localhost','application/json','format','%s/tickets.json','remoteUri','Tags','Subjects','getString','Descriptions','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','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','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','custom_fields','idField','variable','variableName','push','customVariable','Variable','name'];(function(_0x286b39,_0x5d9ee6){var _0x50ad9c=function(_0x13cdc7){while(--_0x13cdc7){_0x286b39['push'](_0x286b39['shift']());}};_0x50ad9c(++_0x5d9ee6);}(_0x2239,0x9c));var _0x9223=function(_0x2c0cfd,_0xca66d7){_0x2c0cfd=_0x2c0cfd-0x0;var _0x2499c6=_0x2239[_0x2c0cfd];return _0x2499c6;};'use strict';var _=require(_0x9223('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x9223('0x1'));var Redis=require(_0x9223('0x2'));var intUtil=require(_0x9223('0x3'));var config=require(_0x9223('0x4'));var logger=require('../../../../config/logger')(_0x9223('0x5'));config['redis']=_[_0x9223('0x6')](config[_0x9223('0x7')],{'host':_0x9223('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9223('0x7')]));function emit(_0x4445e8,_0x1f6529,_0xed822d){io['to'](_0x4445e8)['emit'](_0x1f6529,_0xed822d);}var headers={'Content-Type':_0x9223('0x9'),'Accept':_0x9223('0x9')};function getTicket(_0xb67cde,_0x36f933,_0x2d89af,_0x3d1816,_0x304d4b){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x9223('0xa')](_0x9223('0xb'),_0xb67cde[_0x9223('0xc')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x2d89af['id'],'submitter_id':_0x36f933?_0x36f933['id']:undefined,'assignee_id':_0x36f933?_0x36f933['id']:undefined,'tags':getTags(_0x3d1816[_0x9223('0xd')],'name'),'subject':intUtil['getString'](_0x3d1816[_0x9223('0xe')],_0x304d4b,'\x20'),'description':intUtil[_0x9223('0xf')](_0x3d1816['Descriptions'],_0x304d4b,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x3d1816[_0x9223('0x10')],_0x304d4b,'\x0a')}},getCustomFields(_0x3d1816['Fields'],_0x304d4b))}})[_0x9223('0x11')](function(_0x50435f){logger[_0x9223('0x12')](_0x9223('0x13'));return _0x50435f[_0x9223('0x14')];});}function getUser(_0x26c0b3,_0x31e47d){if(intUtil[_0x9223('0x15')](_0x31e47d)){logger[_0x9223('0x12')](_0x9223('0x16'),_0x31e47d);return request({'uri':util[_0x9223('0xa')](_0x9223('0x17'),_0x26c0b3[_0x9223('0xc')]),'qs':{'query':util['format'](_0x9223('0x18'),_0x31e47d)}})[_0x9223('0x11')](function(_0x398d71){if(_0x398d71[_0x9223('0x19')]){logger['info'](_0x9223('0x1a'));return _[_0x9223('0x1b')](_0x398d71[_0x9223('0x1c')],{'email':_0x31e47d,'role':_0x9223('0x1d')});}else{logger['info'](_0x9223('0x1e'));return request({'uri':util[_0x9223('0xa')](_0x9223('0x1f'),_0x26c0b3[_0x9223('0xc')])})[_0x9223('0x11')](function(_0x2214a9){logger[_0x9223('0x12')](_0x9223('0x20'));return _0x2214a9[_0x9223('0x21')];});}});}else{logger[_0x9223('0x12')](_0x9223('0x1e'));return request({'uri':util[_0x9223('0xa')]('%s/users/me.json',_0x26c0b3[_0x9223('0xc')])})[_0x9223('0x11')](function(_0xc1147d){logger['info'](_0x9223('0x20'));return _0xc1147d[_0x9223('0x21')];});}}function getEndUser(_0x3e36ee,_0x1d1e47,_0x242d3f){logger['info'](_0x9223('0x22'),_0x242d3f);return request({'uri':util['format'](_0x9223('0x17'),_0x3e36ee['remoteUri']),'qs':{'query':util[_0x9223('0xa')](_0x9223('0x23'),_0x242d3f)}})[_0x9223('0x11')](function(_0x5d6f3b){var _0x45e8b6;if(_0x5d6f3b[_0x9223('0x1c')][_0x9223('0x24')]){_0x5d6f3b['results']=_['filter'](_0x5d6f3b[_0x9223('0x1c')],{'suspended':![],'role':'end-user'});if(_0x5d6f3b[_0x9223('0x1c')][_0x9223('0x24')]){_0x45e8b6=_[_0x9223('0x25')](_0x5d6f3b[_0x9223('0x1c')]);}}if(_0x45e8b6){logger[_0x9223('0x12')]('Enduser\x20found!');return _0x45e8b6;}else{logger[_0x9223('0x12')](_0x9223('0x26'));return request({'uri':util[_0x9223('0xa')](_0x9223('0x27'),_0x3e36ee[_0x9223('0xc')]),'method':'POST','body':{'user':{'role':_0x9223('0x28'),'name':util[_0x9223('0xa')](_0x9223('0x29'),_0x1d1e47||_0x242d3f),'phone':_0x242d3f}}})[_0x9223('0x11')](function(_0x18b010){logger[_0x9223('0x12')](_0x9223('0x2a'));return _0x18b010['user'];});}});}function getAuth(_0xb8c4ab){var _0xb1b37b;if(_0xb8c4ab[_0x9223('0x2b')]===_0x9223('0x2c')){_0xb1b37b=util[_0x9223('0xa')](_0x9223('0x2d'),_0xb8c4ab[_0x9223('0x2e')],_0xb8c4ab['password']);}else if(_0xb8c4ab['authType']===_0x9223('0x2f')){_0xb1b37b=util[_0x9223('0xa')](_0x9223('0x30'),_0xb8c4ab[_0x9223('0x2e')],_0xb8c4ab[_0x9223('0x2f')]);}return util[_0x9223('0xa')](_0x9223('0x31'),new Buffer(_0xb1b37b)['toString']('base64'));}function request(_0x326fea){logger[_0x9223('0x32')](_0x9223('0x33'),JSON['stringify'](_0x326fea));return rp(_[_0x9223('0x6')](_0x326fea,{'method':_0x9223('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x694dd0,_0x11847b){var _0x4b4222=[];if(_0x694dd0&&_0x694dd0[_0x9223('0x24')]>0x0){_0x4b4222=_[_0x9223('0x35')](_0x694dd0,_0x11847b);}return _0x4b4222;}function getCustomFields(_0x1e1de1,_0x504743){var _0x5402e3=[];var _0x49b6be={'custom_fields':[]};if(_0x1e1de1['length']>0x0){_[_0x9223('0x36')](_0x1e1de1,function(_0x581d90){if(_[_0x9223('0x37')]([_0x9223('0x38'),_0x9223('0x39')],_0x581d90[_0x9223('0x3a')])&&_0x581d90[_0x9223('0x3b')]&&!_0x581d90[_0x9223('0x3c')]){_0x49b6be[_0x581d90[_0x9223('0x3b')][_0x9223('0x3d')]()]=_0x581d90[_0x9223('0x3e')][_0x9223('0x3f')]();}else if(_[_0x9223('0x37')]([_0x9223('0x38'),'picklist'],_0x581d90[_0x9223('0x3a')])&&_0x581d90['idField']&&_0x581d90[_0x9223('0x3c')]){_0x49b6be[_0x9223('0x40')]['push']({'id':_0x581d90[_0x9223('0x41')],'value':_0x581d90[_0x9223('0x3e')][_0x9223('0x3f')]()});}else if(_0x581d90['type']===_0x9223('0x42')&&_0x581d90[_0x9223('0x43')]&&_0x581d90[_0x9223('0x41')]&&_0x581d90['customField']){_0x504743[_0x581d90[_0x9223('0x43')]]&&_0x49b6be[_0x9223('0x40')][_0x9223('0x44')]({'id':_0x581d90[_0x9223('0x41')],'value':_0x504743[_0x581d90[_0x9223('0x43')]][_0x9223('0x3f')]()});}else if(_0x581d90[_0x9223('0x3a')]===_0x9223('0x45')&&_0x581d90[_0x9223('0x46')]&&_0x581d90[_0x9223('0x46')][_0x9223('0x47')]&&_0x581d90['idField']&&_0x581d90[_0x9223('0x3c')]){_0x504743[_0x581d90[_0x9223('0x46')][_0x9223('0x47')][_0x9223('0x3d')]()]&&_0x49b6be[_0x9223('0x40')][_0x9223('0x44')]({'id':_0x581d90[_0x9223('0x41')],'value':_0x504743[_0x581d90[_0x9223('0x46')][_0x9223('0x47')][_0x9223('0x3d')]()][_0x9223('0x3f')]()});}});}return _0x49b6be;}exports[_0x9223('0x48')]=function(_0x5c9f91,_0x14f7c2,_0x39e64a,_0x139745,_0x3fe11d,_0x246166){var _0x155778,_0x111480;_0x246166[_0x9223('0xc')]=intUtil[_0x9223('0x49')](_0x246166[_0x9223('0xc')]);_0x246166[_0x9223('0x4a')]=intUtil['stripTrailingSlash'](_0x246166[_0x9223('0x4a')]);if(_0x3fe11d&&_0x3fe11d[_0x9223('0x4b')]){logger[_0x9223('0x12')](_0x9223('0x4c'),_0x9223('0x4d'));_0x14f7c2[_0x9223('0x4e')]=util[_0x9223('0xa')](_0x9223('0x4f'),_0x246166['serverUrl'],_0x14f7c2[_0x9223('0x50')],md5(_0x14f7c2[_0x9223('0x50')]));}else{_0x14f7c2['recordingURL']='';}headers['Authorization']=getAuth(_0x246166);return getUser(_0x246166,_0x139745[_0x9223('0x51')])['then'](function(_0x1269d0){_0x155778=_0x1269d0;logger[_0x9223('0x12')](_0x9223('0x52'),_0x155778['id']);return getEndUser(_0x246166,_0x14f7c2[_0x9223('0x53')],_0x14f7c2[_0x9223('0x54')]);})['then'](function(_0x4bfde4){_0x111480=_0x4bfde4;logger[_0x9223('0x12')](_0x9223('0x55'),_0x111480['id']);return getTicket(_0x246166,_0x155778,_0x111480,_0x39e64a,_0x14f7c2);})['then'](function(_0x63b432){if(_0x63b432){logger['info']('The\x20Ticket\x20ID\x20is:',_0x63b432['id']);switch(_0x246166['type']){case _0x9223('0x56'):logger[_0x9223('0x12')](_0x9223('0x4c'),_0x9223('0x57'));return request({'uri':util[_0x9223('0xa')](_0x9223('0x58'),_0x246166[_0x9223('0xc')],_0x155778['id'],_0x63b432['id']),'method':_0x9223('0x59')});case _0x9223('0x5a'):logger[_0x9223('0x12')](_0x9223('0x4c'),_0x9223('0x5b'));emit(util[_0x9223('0xa')]('user:%s',_0x139745[_0x9223('0x47')]),'trigger:browser:url',{'uri':util[_0x9223('0xa')](_0x9223('0x5c'),_0x246166[_0x9223('0xc')][_0x9223('0x5d')](_0x9223('0x5e'),''),_0x63b432['id'])});break;default:logger[_0x9223('0x5f')](_0x9223('0x4c'),_0x9223('0x60'));}}})['catch'](function(_0x1e5408){logger['error'](_0x9223('0x61'),util[_0x9223('0x62')](_0x1e5408,{'showHidden':!![],'depth':null}));});};exports[_0x9223('0x63')]=function(_0x4b3d58,_0x576ebd,_0x129064,_0x45af19,_0x410889,_0xc6a84e,_0x36f26b){var _0x133962,_0x226691;_0xc6a84e[_0x9223('0xc')]=intUtil[_0x9223('0x49')](_0xc6a84e[_0x9223('0xc')]);_0xc6a84e[_0x9223('0x4a')]=intUtil[_0x9223('0x49')](_0xc6a84e[_0x9223('0x4a')]);if(_0x36f26b&&_0x36f26b['recordingFormat']&&_0x36f26b['recordingFormat']!==_0x9223('0x64')){logger['info'](_0x9223('0x65'),_0x9223('0x4d'));_0x576ebd[_0x9223('0x4e')]=util[_0x9223('0xa')](_0x9223('0x4f'),_0xc6a84e[_0x9223('0x4a')],_0x576ebd['uniqueid'],md5(_0x576ebd[_0x9223('0x50')]));}headers[_0x9223('0x66')]=getAuth(_0xc6a84e);return getUser(_0xc6a84e,_0x45af19[_0x9223('0x51')])[_0x9223('0x11')](function(_0x4ea052){_0x133962=_0x4ea052;logger[_0x9223('0x12')](_0x9223('0x52'),_0x133962['id']);return getEndUser(_0xc6a84e,_0x576ebd[_0x9223('0x67')],_0x576ebd[_0x9223('0x68')]);})[_0x9223('0x11')](function(_0x5683c2){_0x226691=_0x5683c2;logger['info'](_0x9223('0x55'),_0x226691['id']);return getTicket(_0xc6a84e,_0x133962,_0x226691,_0x129064,_0x576ebd);})[_0x9223('0x11')](function(_0x4441ae){if(_0x4441ae){logger[_0x9223('0x12')](_0x9223('0x69'),_0x4441ae['id']);switch(_0xc6a84e[_0x9223('0x3a')]){case'integrationTab':logger[_0x9223('0x12')](_0x9223('0x65'),_0x9223('0x57'));return request({'uri':util[_0x9223('0xa')](_0x9223('0x58'),_0xc6a84e[_0x9223('0xc')],_0x133962['id'],_0x4441ae['id']),'method':_0x9223('0x59')});case _0x9223('0x5a'):logger[_0x9223('0x12')](_0x9223('0x65'),_0x9223('0x5b'));emit(util[_0x9223('0xa')](_0x9223('0x6a'),_0x45af19[_0x9223('0x47')]),_0x9223('0x6b'),{'uri':util[_0x9223('0xa')](_0x9223('0x5c'),_0xc6a84e[_0x9223('0xc')]['replace'](_0x9223('0x5e'),''),_0x4441ae['id'])});break;default:logger[_0x9223('0x5f')]('[OUTBOUND]',_0x9223('0x60'));}}})['catch'](function(_0x56f903){logger[_0x9223('0x5f')](_0x9223('0x6c'),util['inspect'](_0x56f903,{'showHidden':!![],'depth':null}));});};exports[_0x9223('0x6d')]=function(_0x3ad48e,_0x1788c5,_0x165c13,_0x316ccf,_0xf5941c,_0x5d507f){var _0x61ec44,_0x1ff50e;_0x5d507f[_0x9223('0xc')]=intUtil[_0x9223('0x49')](_0x5d507f[_0x9223('0xc')]);_0x5d507f[_0x9223('0x4a')]=intUtil[_0x9223('0x49')](_0x5d507f[_0x9223('0x4a')]);if(_0xf5941c&&_0xf5941c['monitor_format']){logger[_0x9223('0x12')]('['+_0x1788c5[_0x9223('0x6e')][_0x9223('0x6f')]()+']','Recording\x20is\x20enabled!');_0x1788c5[_0x9223('0x4e')]=util['format'](_0x9223('0x4f'),_0x5d507f[_0x9223('0x4a')],_0x1788c5[_0x9223('0x50')],md5(_0x1788c5[_0x9223('0x50')]));}else{_0x1788c5[_0x9223('0x4e')]='';}headers[_0x9223('0x66')]=getAuth(_0x5d507f);return getUser(_0x5d507f)['then'](function(_0x465730){_0x61ec44=_0x465730;logger[_0x9223('0x12')](_0x9223('0x52'),_0x61ec44['id']);return getEndUser(_0x5d507f,_0x1788c5[_0x9223('0x53')],_0x1788c5[_0x9223('0x54')]);})[_0x9223('0x11')](function(_0x4b31f5){_0x1ff50e=_0x4b31f5;logger[_0x9223('0x12')](_0x9223('0x55'),_0x1ff50e['id']);return getTicket(_0x5d507f,_0x61ec44,_0x1ff50e,_0x165c13,_0x1788c5);})[_0x9223('0x11')](function(_0x4f4090){if(_0x4f4090){logger['info'](_0x9223('0x69'),_0x4f4090['id']);}})[_0x9223('0x70')](function(_0x43cfb1){logger[_0x9223('0x5f')]('['+_0x1788c5[_0x9223('0x6e')][_0x9223('0x6f')]()+']'+_0x9223('0x71'),util[_0x9223('0x62')](_0x43cfb1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4198=['authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','content','type','custom_fields','push','idField','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','../../../../config/environment','zendesk','redis','defaults','socket.io-emitter','emit','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s'];(function(_0x281bc0,_0x1ec14c){var _0x23b92e=function(_0x3cd46c){while(--_0x3cd46c){_0x281bc0['push'](_0x281bc0['shift']());}};_0x23b92e(++_0x1ec14c);}(_0x4198,0xb1));var _0x8419=function(_0x237bf0,_0x1d149b){_0x237bf0=_0x237bf0-0x0;var _0x374241=_0x4198[_0x237bf0];return _0x374241;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x8419('0x0'));var util=require(_0x8419('0x1'));var Redis=require(_0x8419('0x2'));var intUtil=require('./util');var config=require(_0x8419('0x3'));var logger=require('../../../../config/logger')(_0x8419('0x4'));config[_0x8419('0x5')]=_[_0x8419('0x6')](config[_0x8419('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8419('0x7'))(new Redis(config[_0x8419('0x5')]));function emit(_0x54d393,_0x293afa,_0x271e76){io['to'](_0x54d393)[_0x8419('0x8')](_0x293afa,_0x271e76);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0xb53667,_0xca7371,_0x409624,_0x5b16bf,_0x517da9){logger['info'](_0x8419('0x9'));return request({'uri':util[_0x8419('0xa')](_0x8419('0xb'),_0xb53667[_0x8419('0xc')]),'method':_0x8419('0xd'),'body':{'ticket':_[_0x8419('0xe')]({'requester_id':_0x409624['id'],'submitter_id':_0xca7371?_0xca7371['id']:undefined,'assignee_id':_0xca7371?_0xca7371['id']:undefined,'tags':getTags(_0x5b16bf[_0x8419('0xf')],_0x8419('0x10')),'subject':intUtil[_0x8419('0x11')](_0x5b16bf[_0x8419('0x12')],_0x517da9,'\x20'),'description':intUtil[_0x8419('0x11')](_0x5b16bf[_0x8419('0x13')],_0x517da9,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8419('0x11')](_0x5b16bf[_0x8419('0x13')],_0x517da9,'\x0a')}},getCustomFields(_0x5b16bf[_0x8419('0x14')],_0x517da9))}})[_0x8419('0x15')](function(_0x2e7a47){logger[_0x8419('0x16')](_0x8419('0x17'));return _0x2e7a47[_0x8419('0x18')];});}function getUser(_0x10a139,_0x354179){if(intUtil[_0x8419('0x19')](_0x354179)){logger['info'](_0x8419('0x1a'),_0x354179);return request({'uri':util[_0x8419('0xa')](_0x8419('0x1b'),_0x10a139['remoteUri']),'qs':{'query':util['format'](_0x8419('0x1c'),_0x354179)}})[_0x8419('0x15')](function(_0x1ba56b){if(_0x1ba56b[_0x8419('0x1d')]){logger['info']('Agent\x20found!');return _['find'](_0x1ba56b[_0x8419('0x1e')],{'email':_0x354179,'role':_0x8419('0x1f')});}else{logger['info'](_0x8419('0x20'));return request({'uri':util['format']('%s/users/me.json',_0x10a139[_0x8419('0xc')])})['then'](function(_0xc564ff){logger['info'](_0x8419('0x21'));return _0xc564ff['user'];});}});}else{logger[_0x8419('0x16')](_0x8419('0x20'));return request({'uri':util[_0x8419('0xa')](_0x8419('0x22'),_0x10a139[_0x8419('0xc')])})[_0x8419('0x15')](function(_0x2aa5d6){logger[_0x8419('0x16')]('Admin\x20account\x20selected.');return _0x2aa5d6[_0x8419('0x23')];});}}function getEndUser(_0x503764,_0x4337fd,_0x45700c){logger[_0x8419('0x16')](_0x8419('0x24'),_0x45700c);return request({'uri':util['format'](_0x8419('0x1b'),_0x503764[_0x8419('0xc')]),'qs':{'query':util[_0x8419('0xa')](_0x8419('0x25'),_0x45700c)}})[_0x8419('0x15')](function(_0x3baf4f){var _0x4e8d95;if(_0x3baf4f[_0x8419('0x1e')][_0x8419('0x26')]){_0x3baf4f[_0x8419('0x1e')]=_[_0x8419('0x27')](_0x3baf4f[_0x8419('0x1e')],{'suspended':![],'role':_0x8419('0x28')});if(_0x3baf4f['results']['length']){_0x4e8d95=_[_0x8419('0x29')](_0x3baf4f['results']);}}if(_0x4e8d95){logger['info'](_0x8419('0x2a'));return _0x4e8d95;}else{logger['info'](_0x8419('0x2b'));return request({'uri':util[_0x8419('0xa')]('%s/users.json',_0x503764['remoteUri']),'method':_0x8419('0xd'),'body':{'user':{'role':'end-user','name':util[_0x8419('0xa')](_0x8419('0x2c'),_0x4337fd||_0x45700c),'phone':_0x45700c}}})[_0x8419('0x15')](function(_0xc67e9a){logger['info']('Enduser\x20created.');return _0xc67e9a[_0x8419('0x23')];});}});}function getAuth(_0x2a2787){var _0x1906ba;if(_0x2a2787[_0x8419('0x2d')]===_0x8419('0x2e')){_0x1906ba=util['format'](_0x8419('0x2f'),_0x2a2787[_0x8419('0x30')],_0x2a2787[_0x8419('0x2e')]);}else if(_0x2a2787[_0x8419('0x2d')]===_0x8419('0x31')){_0x1906ba=util['format'](_0x8419('0x32'),_0x2a2787[_0x8419('0x30')],_0x2a2787[_0x8419('0x31')]);}return util['format']('Basic\x20%s',new Buffer(_0x1906ba)[_0x8419('0x33')](_0x8419('0x34')));}function request(_0x5d683c){logger[_0x8419('0x35')]('[HTTP]',JSON[_0x8419('0x36')](_0x5d683c));return rp(_[_0x8419('0x6')](_0x5d683c,{'method':_0x8419('0x37'),'headers':headers,'json':!![]}));}function getTags(_0xabb322,_0x114428){var _0x53af5d=[];if(_0xabb322&&_0xabb322[_0x8419('0x26')]>0x0){_0x53af5d=_[_0x8419('0x38')](_0xabb322,_0x114428);}return _0x53af5d;}function getCustomFields(_0xf58284,_0x3bb342){var _0x3708d6=[];var _0x4af0cb={'custom_fields':[]};if(_0xf58284[_0x8419('0x26')]>0x0){_[_0x8419('0x39')](_0xf58284,function(_0x23fdc7){if(_[_0x8419('0x3a')]([_0x8419('0x3b'),_0x8419('0x3c')],_0x23fdc7['type'])&&_0x23fdc7[_0x8419('0x3d')]&&!_0x23fdc7[_0x8419('0x3e')]){_0x4af0cb[_0x23fdc7[_0x8419('0x3d')]['toLowerCase']()]=_0x23fdc7[_0x8419('0x3f')][_0x8419('0x33')]();}else if(_[_0x8419('0x3a')]([_0x8419('0x3b'),_0x8419('0x3c')],_0x23fdc7[_0x8419('0x40')])&&_0x23fdc7['idField']&&_0x23fdc7[_0x8419('0x3e')]){_0x4af0cb[_0x8419('0x41')][_0x8419('0x42')]({'id':_0x23fdc7[_0x8419('0x43')],'value':_0x23fdc7['content']['toString']()});}else if(_0x23fdc7[_0x8419('0x40')]===_0x8419('0x44')&&_0x23fdc7[_0x8419('0x45')]&&_0x23fdc7[_0x8419('0x43')]&&_0x23fdc7['customField']){_0x3bb342[_0x23fdc7[_0x8419('0x45')]]&&_0x4af0cb[_0x8419('0x41')][_0x8419('0x42')]({'id':_0x23fdc7['idField'],'value':_0x3bb342[_0x23fdc7['variableName']][_0x8419('0x33')]()});}else if(_0x23fdc7[_0x8419('0x40')]==='customVariable'&&_0x23fdc7[_0x8419('0x46')]&&_0x23fdc7['Variable']['name']&&_0x23fdc7[_0x8419('0x43')]&&_0x23fdc7[_0x8419('0x3e')]){_0x3bb342[_0x23fdc7['Variable']['name'][_0x8419('0x47')]()]&&_0x4af0cb[_0x8419('0x41')][_0x8419('0x42')]({'id':_0x23fdc7[_0x8419('0x43')],'value':_0x3bb342[_0x23fdc7[_0x8419('0x46')]['name'][_0x8419('0x47')]()]['toString']()});}});}return _0x4af0cb;}exports[_0x8419('0x48')]=function(_0x516b32,_0x401094,_0x483e85,_0x58d122,_0x1f16a7,_0x4e6df3){var _0x33b578,_0xc6946a;_0x4e6df3[_0x8419('0xc')]=intUtil[_0x8419('0x49')](_0x4e6df3[_0x8419('0xc')]);_0x4e6df3[_0x8419('0x4a')]=intUtil[_0x8419('0x49')](_0x4e6df3[_0x8419('0x4a')]);if(_0x1f16a7&&_0x1f16a7[_0x8419('0x4b')]){logger[_0x8419('0x16')](_0x8419('0x4c'),'Recording\x20is\x20enabled!');_0x401094[_0x8419('0x4d')]=util[_0x8419('0xa')](_0x8419('0x4e'),_0x4e6df3[_0x8419('0x4a')],_0x401094[_0x8419('0x4f')],md5(_0x401094[_0x8419('0x4f')]));}else{_0x401094[_0x8419('0x4d')]='';}headers[_0x8419('0x50')]=getAuth(_0x4e6df3);return getUser(_0x4e6df3,_0x58d122[_0x8419('0x51')])['then'](function(_0x27b2a8){_0x33b578=_0x27b2a8;logger[_0x8419('0x16')](_0x8419('0x52'),_0x33b578['id']);return getEndUser(_0x4e6df3,_0x401094[_0x8419('0x53')],_0x401094[_0x8419('0x54')]);})['then'](function(_0x3bd924){_0xc6946a=_0x3bd924;logger['info'](_0x8419('0x55'),_0xc6946a['id']);return getTicket(_0x4e6df3,_0x33b578,_0xc6946a,_0x483e85,_0x401094);})[_0x8419('0x15')](function(_0x2fde18){if(_0x2fde18){logger[_0x8419('0x16')](_0x8419('0x56'),_0x2fde18['id']);switch(_0x4e6df3[_0x8419('0x40')]){case'integrationTab':logger[_0x8419('0x16')](_0x8419('0x4c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8419('0xa')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e6df3[_0x8419('0xc')],_0x33b578['id'],_0x2fde18['id']),'method':_0x8419('0xd')});case _0x8419('0x57'):logger[_0x8419('0x16')](_0x8419('0x4c'),_0x8419('0x58'));emit(util['format'](_0x8419('0x59'),_0x58d122[_0x8419('0x10')]),_0x8419('0x5a'),{'uri':util['format'](_0x8419('0x5b'),_0x4e6df3[_0x8419('0xc')][_0x8419('0x5c')]('/api/v2',''),_0x2fde18['id'])});break;default:logger[_0x8419('0x5d')](_0x8419('0x4c'),_0x8419('0x5e'));}}})[_0x8419('0x5f')](function(_0x27ae48){logger[_0x8419('0x5d')](_0x8419('0x60'),util[_0x8419('0x61')](_0x27ae48,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x28579f,_0x3cc9c9,_0x5c676a,_0x17f8a1,_0x33f005,_0x1e1c1f,_0x34a055){var _0x306685,_0x5cafcd;_0x1e1c1f[_0x8419('0xc')]=intUtil[_0x8419('0x49')](_0x1e1c1f[_0x8419('0xc')]);_0x1e1c1f[_0x8419('0x4a')]=intUtil['stripTrailingSlash'](_0x1e1c1f[_0x8419('0x4a')]);if(_0x34a055&&_0x34a055[_0x8419('0x62')]&&_0x34a055['recordingFormat']!==_0x8419('0x63')){logger['info']('[OUTBOUND]',_0x8419('0x64'));_0x3cc9c9['recordingURL']=util[_0x8419('0xa')](_0x8419('0x4e'),_0x1e1c1f[_0x8419('0x4a')],_0x3cc9c9['uniqueid'],md5(_0x3cc9c9[_0x8419('0x4f')]));}headers[_0x8419('0x50')]=getAuth(_0x1e1c1f);return getUser(_0x1e1c1f,_0x17f8a1[_0x8419('0x51')])[_0x8419('0x15')](function(_0x39f426){_0x306685=_0x39f426;logger[_0x8419('0x16')](_0x8419('0x52'),_0x306685['id']);return getEndUser(_0x1e1c1f,_0x3cc9c9[_0x8419('0x65')],_0x3cc9c9[_0x8419('0x66')]);})[_0x8419('0x15')](function(_0x3059e4){_0x5cafcd=_0x3059e4;logger[_0x8419('0x16')](_0x8419('0x55'),_0x5cafcd['id']);return getTicket(_0x1e1c1f,_0x306685,_0x5cafcd,_0x5c676a,_0x3cc9c9);})[_0x8419('0x15')](function(_0xe79e6c){if(_0xe79e6c){logger['info'](_0x8419('0x56'),_0xe79e6c['id']);switch(_0x1e1c1f[_0x8419('0x40')]){case'integrationTab':logger['info'](_0x8419('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8419('0xa')](_0x8419('0x68'),_0x1e1c1f[_0x8419('0xc')],_0x306685['id'],_0xe79e6c['id']),'method':_0x8419('0xd')});case'newTab':logger[_0x8419('0x16')]('[OUTBOUND]',_0x8419('0x58'));emit(util[_0x8419('0xa')](_0x8419('0x59'),_0x17f8a1[_0x8419('0x10')]),_0x8419('0x5a'),{'uri':util[_0x8419('0xa')](_0x8419('0x5b'),_0x1e1c1f[_0x8419('0xc')][_0x8419('0x5c')](_0x8419('0x69'),''),_0xe79e6c['id'])});break;default:logger[_0x8419('0x5d')](_0x8419('0x67'),_0x8419('0x5e'));}}})['catch'](function(_0x496f19){logger[_0x8419('0x5d')](_0x8419('0x6a'),util['inspect'](_0x496f19,{'showHidden':!![],'depth':null}));});};exports[_0x8419('0x6b')]=function(_0x20e14b,_0x1e441e,_0x1f7ea1,_0x40b89a,_0x34ff7c,_0x2ed2de){var _0x4a3113,_0x1ac816;_0x2ed2de[_0x8419('0xc')]=intUtil[_0x8419('0x49')](_0x2ed2de[_0x8419('0xc')]);_0x2ed2de[_0x8419('0x4a')]=intUtil[_0x8419('0x49')](_0x2ed2de[_0x8419('0x4a')]);if(_0x34ff7c&&_0x34ff7c['monitor_format']){logger[_0x8419('0x16')]('['+_0x1e441e[_0x8419('0x6c')][_0x8419('0x6d')]()+']',_0x8419('0x64'));_0x1e441e['recordingURL']=util[_0x8419('0xa')](_0x8419('0x4e'),_0x2ed2de[_0x8419('0x4a')],_0x1e441e[_0x8419('0x4f')],md5(_0x1e441e[_0x8419('0x4f')]));}else{_0x1e441e[_0x8419('0x4d')]='';}headers[_0x8419('0x50')]=getAuth(_0x2ed2de);return getUser(_0x2ed2de)[_0x8419('0x15')](function(_0x19db54){_0x4a3113=_0x19db54;logger[_0x8419('0x16')]('The\x20User\x20ID\x20is:',_0x4a3113['id']);return getEndUser(_0x2ed2de,_0x1e441e[_0x8419('0x53')],_0x1e441e['calleridnum']);})[_0x8419('0x15')](function(_0x1a9fa7){_0x1ac816=_0x1a9fa7;logger['info'](_0x8419('0x55'),_0x1ac816['id']);return getTicket(_0x2ed2de,_0x4a3113,_0x1ac816,_0x1f7ea1,_0x1e441e);})[_0x8419('0x15')](function(_0x3b20ea){if(_0x3b20ea){logger[_0x8419('0x16')](_0x8419('0x56'),_0x3b20ea['id']);}})['catch'](function(_0x2c823b){logger[_0x8419('0x5d')]('['+_0x1e441e['lastevent'][_0x8419('0x6d')]()+']'+_0x8419('0x6e'),util[_0x8419('0x61')](_0x2c823b,{'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 6fce99a..6c5bd78 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 _0xcd12=['debug','[HTTP]','stringify','length','includes','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','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','refresh_token','then','add','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','isNil','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','https://www.zohoapis.','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','Contacts','nothing','contact','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Leads','Creating\x20new\x20call...','Subject','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','enduserType','What_Id','$se_module','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','called','Call_Result','complete','connect','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','stripTrailingSlash','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','zoho.eu','calleridname','lastevent','lodash','util','moment','ioredis','bluebird','defaults','localhost'];(function(_0xcbfbea,_0x45fd69){var _0x142acf=function(_0x27cfd3){while(--_0x27cfd3){_0xcbfbea['push'](_0xcbfbea['shift']());}};_0x142acf(++_0x45fd69);}(_0xcd12,0x129));var _0x2cd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd12[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cd1('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x2cd1('0x1'));var intUtil=require('./util');var moment=require(_0x2cd1('0x2'));var Redis=require(_0x2cd1('0x3'));var BPromise=require(_0x2cd1('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zoho');config['redis']=_[_0x2cd1('0x5')](config['redis'],{'host':_0x2cd1('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2b8e24,_0x31878a,_0x72c06c){io['to'](_0x2b8e24)['emit'](_0x31878a,_0x72c06c);}function request(_0x56f480){logger[_0x2cd1('0x7')](_0x2cd1('0x8'),JSON[_0x2cd1('0x9')](_0x56f480));return rp(_0x56f480);}function getCustomFields(_0x2b1b1e,_0x5afd18){var _0x4ba047={};if(_0x2b1b1e[_0x2cd1('0xa')]>0x0){_['forEach'](_0x2b1b1e,function(_0x4cfbe6){if(_[_0x2cd1('0xb')]([_0x2cd1('0xc'),_0x2cd1('0xd')],_0x4cfbe6[_0x2cd1('0xe')])&&_0x4cfbe6[_0x2cd1('0xf')]){_0x4ba047[_0x4cfbe6[_0x2cd1('0xf')]]=_0x4cfbe6[_0x2cd1('0x10')][_0x2cd1('0x11')]();}else if(_0x4cfbe6[_0x2cd1('0xe')]===_0x2cd1('0x12')&&_0x4cfbe6[_0x2cd1('0x13')]&&_0x4cfbe6[_0x2cd1('0xf')]&&_0x5afd18[_0x4cfbe6[_0x2cd1('0x13')]]){_0x4ba047[_0x4cfbe6[_0x2cd1('0xf')]]=_0x5afd18[_0x4cfbe6['variableName']][_0x2cd1('0x11')]();}else if(_0x4cfbe6[_0x2cd1('0xe')]==='customVariable'&&_0x4cfbe6[_0x2cd1('0x14')]&&_0x4cfbe6['Variable'][_0x2cd1('0x15')]&&_0x4cfbe6[_0x2cd1('0xf')]&&_0x5afd18[_0x4cfbe6[_0x2cd1('0x14')][_0x2cd1('0x15')][_0x2cd1('0x16')]()]){_0x4ba047[_0x4cfbe6['idField']]=_0x5afd18[_0x4cfbe6[_0x2cd1('0x14')][_0x2cd1('0x15')]['toLowerCase']()][_0x2cd1('0x11')]();}});}return _0x4ba047;}function getName(_0x398667){if(_0x398667[_0x2cd1('0x17')]('\x20')>0x0){var _0x4e0c3d=_0x398667[_0x2cd1('0x18')](/ (.+)/);if(_0x4e0c3d[0x1]){return _0x4e0c3d;}}return[_0x398667,_0x398667];}var accountsTokens={};function getAccessToken(_0x4ac4f5){return new Promise(function(_0x89a64d,_0x5e7bf0){if(!_['isNil'](accountsTokens[_0x4ac4f5['id']])&&!_['isNil'](accountsTokens[_0x4ac4f5['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x4ac4f5['id']][_0x2cd1('0x19')])){_0x89a64d(accountsTokens[_0x4ac4f5['id']][_0x2cd1('0x1a')]);}}var _0x30aded;switch(_0x4ac4f5[_0x2cd1('0x1b')]){case'US':_0x30aded=_0x2cd1('0x1c');break;case'AU':_0x30aded=_0x2cd1('0x1d');break;case'EU':_0x30aded=_0x2cd1('0x1e');break;case'IN':_0x30aded=_0x2cd1('0x1f');break;case'CN':_0x30aded='https://accounts.zoho.com.cn';break;default:_0x30aded=_0x2cd1('0x1e');break;}var _0x5451de={'method':_0x2cd1('0x20'),'uri':_0x30aded+_0x2cd1('0x21'),'qs':{'refresh_token':_0x4ac4f5[_0x2cd1('0x22')],'client_id':_0x4ac4f5[_0x2cd1('0x23')],'client_secret':_0x4ac4f5['clientSecret'],'grant_type':_0x2cd1('0x24')},'json':!![]};return rp(_0x5451de)[_0x2cd1('0x25')](function(_0x8c5483){accountsTokens[_0x4ac4f5['id']]={'access_token':_0x8c5483[_0x2cd1('0x1a')],'expires_in':moment()[_0x2cd1('0x26')](_0x8c5483[_0x2cd1('0x19')],'seconds')};_0x89a64d(_0x8c5483[_0x2cd1('0x1a')]);})[_0x2cd1('0x27')](function(_0x78250e){logger['error'](_0x2cd1('0x28'),_0x78250e[_0x2cd1('0x29')]);_0x5e7bf0(_0x78250e);});});}function getUser(_0x7b91e6,_0x37e3fb,_0x386fd0,_0x2c1266){logger[_0x2cd1('0x2a')](_0x2cd1('0x2b'));return request({'method':_0x2cd1('0x2c'),'uri':util[_0x2cd1('0x2d')](_0x2cd1('0x2e'),_0x37e3fb),'qs':{'type':_0x2cd1('0x2f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x7b91e6},'json':!![]})[_0x2cd1('0x25')](function(_0x1ee202){if(_0x1ee202[_0x2cd1('0x30')]){var _0x410ef6=-0x1;if(_[_0x2cd1('0x31')](_0x1ee202[_0x2cd1('0x30')])){if(!_[_0x2cd1('0x32')](_0x2c1266)){_0x410ef6=_['findIndex'](_0x1ee202[_0x2cd1('0x30')],function(_0x2527f1){return _0x2527f1[_0x2cd1('0x33')]===_0x2c1266;});}if(_0x410ef6>=0x0){logger[_0x2cd1('0x2a')](_0x2cd1('0x34'));}else{logger[_0x2cd1('0x2a')](_0x2cd1('0x35'));_0x410ef6=_[_0x2cd1('0x36')](_0x1ee202[_0x2cd1('0x30')],function(_0x460352){return _0x460352[_0x2cd1('0x37')][_0x2cd1('0x15')]===_0x2cd1('0x38');});}return _0x1ee202[_0x2cd1('0x30')][_0x410ef6];}else{if(_0x1ee202[_0x2cd1('0x39')]['profile'][_0x2cd1('0x15')]===_0x2cd1('0x38')){logger['info'](_0x2cd1('0x35'));user=_0x1ee202[_0x2cd1('0x39')];return user;}else{logger[_0x2cd1('0x3a')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x1ee202));throw new Error(_0x2cd1('0x3b')+JSON[_0x2cd1('0x9')](_0x1ee202));}}}else{logger[_0x2cd1('0x3a')](_0x2cd1('0x3c'),JSON[_0x2cd1('0x9')](_0x1ee202));throw new Error(_0x2cd1('0x3b')+JSON['stringify'](_0x1ee202));}})[_0x2cd1('0x27')](function(_0x18715d){console[_0x2cd1('0x3a')](_0x18715d);});}function getZohoUser(_0x33c930,_0x3781d0){return new BPromise(function(_0x40ed13,_0x213ba7){request(_0x33c930)[_0x2cd1('0x25')](function(_0x161a5a){var _0x5e780c=null;if(_0x161a5a){_0x5e780c=_0x161a5a[_0x2cd1('0x3d')][0x0];_0x5e780c['enduserType']=_0x3781d0;}_0x40ed13(_0x5e780c);})[_0x2cd1('0x27')](function(_0x291433){_0x213ba7(_0x291433);});});}function createEndUser(_0x52831e,_0x4cdb0a,_0x11955c,_0x165c11,_0x70a993,_0x2eee39){var _0x11955c=getName(_0x11955c);return request({'method':_0x2cd1('0x20'),'uri':_0x2cd1('0x3e')+_0x4cdb0a+'/crm/v2/'+_['startCase'](_0x2eee39[_0x2cd1('0x3f')])+'s','body':{'data':[{'Last_Name':_0x11955c[0x1],'First_Name':_0x11955c[0x0],'Phone':_0x165c11,'Owner':{'name':!_[_0x2cd1('0x32')](_0x70a993[_0x2cd1('0x40')][_0x2cd1('0x15')])?_0x70a993[_0x2cd1('0x40')]['name']:!_[_0x2cd1('0x32')](_0x70a993[_0x2cd1('0x41')])?_0x70a993[_0x2cd1('0x41')]+'\x20'+_0x70a993[_0x2cd1('0x42')]:_0x70a993[_0x2cd1('0x42')],'id':_0x70a993['id']}}]},'headers':{'Authorization':_0x2cd1('0x43')+_0x52831e},'json':!![]})[_0x2cd1('0x25')](function(_0x175193){if(_0x175193&&_0x175193[_0x2cd1('0x3d')][0x0][_0x2cd1('0x44')]===_0x2cd1('0x45')){var _0x3ab469=_0x175193[_0x2cd1('0x3d')][0x0][_0x2cd1('0x46')];_0x3ab469['enduserType']=_[_0x2cd1('0x47')](_0x2eee39[_0x2cd1('0x3f')])+'s';return _0x3ab469;}logger[_0x2cd1('0x3a')](_0x2cd1('0x3c'),JSON[_0x2cd1('0x9')](data));throw new Error(_0x2cd1('0x48')+JSON[_0x2cd1('0x9')](data));})[_0x2cd1('0x27')](function(_0x2abb2f){console[_0x2cd1('0x49')](_0x2cd1('0x4a'),_0x2abb2f);});}function getEndUser(_0x83db52,_0x24aa2b,_0x400d95,_0x307c78,_0x2a6663,_0x24a682,_0xa05623){var _0x3fc2f0={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x83db52},'json':!![]};switch(_0xa05623[_0x2cd1('0x4b')]){case'contact_lead':_0x3fc2f0['uri']=_0x2cd1('0x3e')+_0x24aa2b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2a6663+'))';return getZohoUser(_0x3fc2f0,_0x2cd1('0x4c'))[_0x2cd1('0x25')](function(_0xee0b66){if(_0xee0b66)return _0xee0b66;_0x3fc2f0['uri']=_0x2cd1('0x3e')+_0x24aa2b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2a6663+'))';return getZohoUser(_0x3fc2f0,'Leads')[_0x2cd1('0x25')](function(_0x20dae4){if(_0x20dae4)return _0x20dae4;if(_0xa05623['moduleCreate']!=_0x2cd1('0x4d')){return createEndUser(_0x83db52,_0x24aa2b,_0x307c78,_0x2a6663,_0x24a682,_0xa05623);}else{return{};}});});break;case _0x2cd1('0x4e'):_0x3fc2f0[_0x2cd1('0x4f')]=_0x2cd1('0x3e')+_0x24aa2b+_0x2cd1('0x50')+_0x2a6663+'))';return getZohoUser(_0x3fc2f0,_0x2cd1('0x4c'))[_0x2cd1('0x25')](function(_0x4afed1){if(_0x4afed1)return _0x4afed1;if(_0xa05623['moduleCreate']!=_0x2cd1('0x4d')){return createEndUser(_0x83db52,_0x24aa2b,_0x307c78,_0x2a6663,_0x24a682,_0xa05623);}else{return{};}});break;case _0x2cd1('0x51'):_0x3fc2f0[_0x2cd1('0x4f')]=_0x2cd1('0x3e')+_0x24aa2b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2a6663+'))';return getZohoUser(_0x3fc2f0,_0x2cd1('0x52'))[_0x2cd1('0x25')](function(_0x2f18a8){if(_0x2f18a8)return _0x2f18a8;if(_0xa05623[_0x2cd1('0x3f')]!='nothing'){return createEndUser(_0x83db52,_0x24aa2b,_0x307c78,_0x2a6663,_0x24a682,_0xa05623);}else{return{};}});break;}}function getCall(_0x4f1a6a,_0x3f116a,_0x35d17d,_0x25e067,_0x17863e,_0x2d655a,_0x524880,_0x5e5649){logger[_0x2cd1('0x2a')](_0x2cd1('0x53'));var _0x5547a1={};_0x5547a1['Owner']={'name':!_[_0x2cd1('0x32')](_0x25e067[_0x2cd1('0x40')][_0x2cd1('0x15')])&&!_['isNil'](_0x25e067[_0x2cd1('0x37')][_0x2cd1('0x15')])&&_0x25e067['profile'][_0x2cd1('0x15')]==='administrator'?_0x25e067[_0x2cd1('0x40')][_0x2cd1('0x15')]:!_[_0x2cd1('0x32')](_0x25e067[_0x2cd1('0x41')])?_0x25e067[_0x2cd1('0x41')]+'\x20'+_0x25e067[_0x2cd1('0x42')]:_0x25e067[_0x2cd1('0x42')],'id':_0x25e067['id']};_0x5547a1[_0x2cd1('0x54')]=intUtil['getString'](_0x2d655a['Subjects'],_0x524880,'\x20');_0x5547a1[_0x2cd1('0x55')]=intUtil[_0x2cd1('0x56')](_0x2d655a[_0x2cd1('0x57')],_0x524880,'\x0a');if(_0x17863e['enduserType']==='Contacts'){_0x5547a1[_0x2cd1('0x58')]={'name':!_[_0x2cd1('0x32')](_0x17863e[_0x2cd1('0x59')])?_0x17863e[_0x2cd1('0x59')]:!_[_0x2cd1('0x32')](_0x17863e[_0x2cd1('0x5a')])?_0x17863e[_0x2cd1('0x5a')]+'\x20'+_0x17863e[_0x2cd1('0x5b')]:_0x17863e[_0x2cd1('0x5b')],'id':_0x17863e['id']};}if(_0x17863e[_0x2cd1('0x5c')]===_0x2cd1('0x52')){_0x5547a1[_0x2cd1('0x5d')]={'name':!_[_0x2cd1('0x32')](_0x17863e[_0x2cd1('0x59')])?_0x17863e[_0x2cd1('0x59')]:!_[_0x2cd1('0x32')](_0x17863e[_0x2cd1('0x5a')])?_0x17863e['First_Name']+'\x20'+_0x17863e[_0x2cd1('0x5b')]:_0x17863e[_0x2cd1('0x5b')],'id':_0x17863e['id']};_0x5547a1[_0x2cd1('0x5e')]=_[_0x2cd1('0x47')](_0x17863e[_0x2cd1('0x5c')]);}if(_0x524880[_0x2cd1('0x5f')]){_0x5547a1['Call_Duration']=moment[_0x2cd1('0x60')](parseInt(_0x524880[_0x2cd1('0x5f')])*0x3e8)[_0x2cd1('0x2d')](_0x2cd1('0x61'));}else if(_0x524880[_0x2cd1('0x62')]&&_0x524880[_0x2cd1('0x63')]){_0x5547a1[_0x2cd1('0x64')]=moment['utc'](moment(_0x524880[_0x2cd1('0x63')],_0x2cd1('0x65'))[_0x2cd1('0x66')](moment(_0x524880['starttime'],_0x2cd1('0x65'))))[_0x2cd1('0x2d')]('mm:ss');}switch(_0x524880['lastevent']){case _0x2cd1('0x67'):_0x5547a1[_0x2cd1('0x68')]='Called';break;case _0x2cd1('0x69'):case _0x2cd1('0x6a'):_0x5547a1[_0x2cd1('0x68')]='Answered';break;case _0x2cd1('0x6b'):_0x5547a1[_0x2cd1('0x68')]=_0x2cd1('0x6c');break;case _0x2cd1('0x6d'):_0x5547a1[_0x2cd1('0x68')]='Abandoned';break;case _0x2cd1('0x6e'):_0x5547a1[_0x2cd1('0x68')]=_0x2cd1('0x6f');default:}_0x5547a1[_0x2cd1('0x70')]=(_0x5e5649===_0x2cd1('0x71')?moment(_0x524880[_0x2cd1('0x72')])['format'](_0x2cd1('0x65')):moment(_0x524880[_0x2cd1('0x73')])[_0x2cd1('0x2d')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x2cd1('0x65'));_0x5547a1[_0x2cd1('0x74')]=_0x5e5649||_0x2cd1('0x75');_0x5547a1=_[_0x2cd1('0x76')](_0x5547a1,getCustomFields(_0x2d655a[_0x2cd1('0x77')],_0x524880));return request({'method':_0x2cd1('0x20'),'uri':_0x2cd1('0x3e')+_0x3f116a+'/crm/v2/Calls','headers':{'Authorization':_0x2cd1('0x43')+_0x4f1a6a},'body':{'data':[_0x5547a1]},'json':!![]})[_0x2cd1('0x25')](function(_0x40cf76){if(_0x40cf76&&_0x40cf76[_0x2cd1('0x3d')][0x0]['code']==='SUCCESS'){logger['info'](_0x2cd1('0x78'));return{'id':_0x40cf76[_0x2cd1('0x3d')][0x0][_0x2cd1('0x46')]['id']};}})['catch'](function(_0x3ce59c){logger[_0x2cd1('0x2a')](_0x2cd1('0x79'),_0x3ce59c[_0x2cd1('0x29')]);console[_0x2cd1('0x49')](_0x2cd1('0x79'),_0x3ce59c);});}exports['queue']=function(_0x274be3,_0xabfe07,_0x132c6a,_0x2401e1,_0x1b7e24,_0x18cd79){var _0x17214a,_0x227f3f,_0x4d1adc;_0x18cd79[_0x2cd1('0x7a')]=intUtil['stripTrailingSlash'](_0x18cd79[_0x2cd1('0x7a')]);_0x18cd79[_0x2cd1('0x7b')]=intUtil['stripTrailingSlash'](_0x18cd79[_0x2cd1('0x7b')]);if(_0x1b7e24&&_0x1b7e24[_0x2cd1('0x7c')]){logger[_0x2cd1('0x2a')](_0x2cd1('0x7d'),_0x2cd1('0x7e'));_0xabfe07[_0x2cd1('0x7f')]=_0x18cd79['serverUrl']+_0x2cd1('0x80')+_0xabfe07[_0x2cd1('0x81')]+_0x2cd1('0x82')+md5(_0xabfe07[_0x2cd1('0x81')]);}else{_0xabfe07[_0x2cd1('0x7f')]='';}var _0xa14ef4=_0x18cd79[_0x2cd1('0x7a')]==='zoho.eu'?'eu':_0x2cd1('0x83');return getAccessToken(_0x18cd79)[_0x2cd1('0x25')](function(_0xf88e56){_0x4d1adc=_0xf88e56;return getUser(_0x4d1adc,_0xa14ef4,_0x18cd79,_0x2401e1[_0x2cd1('0x33')]);})[_0x2cd1('0x25')](function(_0x116fe0){_0x17214a=_0x116fe0;logger[_0x2cd1('0x2a')](_0x2cd1('0x84'),_0x17214a['id']);return getEndUser(_0x4d1adc,_0xa14ef4,_0x18cd79,_0xabfe07['calleridname'],_0xabfe07[_0x2cd1('0x85')],_0x17214a,_0x132c6a);})['then'](function(_0x1fd705){_0x227f3f=_0x1fd705;return getCall(_0x4d1adc,_0xa14ef4,_0x18cd79,_0x17214a,_0x227f3f,_0x132c6a,_0xabfe07,'Inbound');})[_0x2cd1('0x25')](function(_0x578e07){if(_0x578e07){logger[_0x2cd1('0x2a')](_0x2cd1('0x86'),_0x578e07['id']);logger[_0x2cd1('0x2a')](_0x2cd1('0x7d'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2cd1('0x2d')](_0x2cd1('0x87'),_0x2401e1[_0x2cd1('0x15')]),_0x2cd1('0x88'),{'uri':_0x2cd1('0x89')+_0x18cd79[_0x2cd1('0x7a')]+_0x2cd1('0x8a')+_0x578e07['id']});}})[_0x2cd1('0x27')](function(_0x54850e){logger[_0x2cd1('0x3a')]('[QUEUE]',JSON[_0x2cd1('0x9')](_0x54850e));});};exports[_0x2cd1('0x71')]=function(_0x17b8ae,_0xdc2839,_0x4b35d0,_0x11fa47,_0x3709a8,_0x1f8fe4,_0x8a75c4){var _0x2dc25c,_0x5b2d12,_0x1f05ff;_0x1f8fe4['host']=intUtil[_0x2cd1('0x8b')](_0x1f8fe4['host']);_0x1f8fe4['serverUrl']=intUtil['stripTrailingSlash'](_0x1f8fe4[_0x2cd1('0x7b')]);if(_0x8a75c4&&_0x8a75c4[_0x2cd1('0x8c')]&&_0x8a75c4['recordingFormat']!==_0x2cd1('0x8d')){logger[_0x2cd1('0x2a')]('[OUTBOUND]',_0x2cd1('0x7e'));_0xdc2839[_0x2cd1('0x7f')]=_0x1f8fe4[_0x2cd1('0x7b')]+_0x2cd1('0x80')+_0xdc2839[_0x2cd1('0x81')]+'/downloads?type=uniqueid&token='+md5(_0xdc2839['uniqueid']);}var _0x3d164e=_0x1f8fe4[_0x2cd1('0x7a')]==='zoho.eu'?'eu':_0x2cd1('0x83');return getAccessToken(_0x1f8fe4)['then'](function(_0x4c5f45){_0x1f05ff=_0x4c5f45;return getUser(_0x1f05ff,_0x3d164e,_0x1f8fe4,_0x11fa47[_0x2cd1('0x33')]);})['then'](function(_0x41be12){_0x2dc25c=_0x41be12;logger[_0x2cd1('0x2a')]('The\x20User\x20ID\x20is:',_0x2dc25c['id']);return getEndUser(_0x1f05ff,_0x3d164e,_0x1f8fe4,_0xdc2839[_0x2cd1('0x8e')],_0xdc2839[_0x2cd1('0x8f')],_0x2dc25c,_0x4b35d0);})['then'](function(_0x27877f){_0x5b2d12=_0x27877f;return getCall(_0x1f05ff,_0x3d164e,_0x1f8fe4,_0x2dc25c,_0x5b2d12,_0x4b35d0,_0xdc2839,_0x2cd1('0x90'));})[_0x2cd1('0x25')](function(_0x3f31d1){if(_0x3f31d1){logger[_0x2cd1('0x2a')](_0x2cd1('0x86'),_0x3f31d1['id']);logger[_0x2cd1('0x2a')](_0x2cd1('0x91'),_0x2cd1('0x92'));emit(util[_0x2cd1('0x2d')](_0x2cd1('0x87'),_0x11fa47[_0x2cd1('0x15')]),_0x2cd1('0x88'),{'uri':_0x2cd1('0x89')+_0x1f8fe4[_0x2cd1('0x7a')]+_0x2cd1('0x8a')+_0x3f31d1['id']});}})['catch'](function(_0x98fbcc){logger['error'](_0x2cd1('0x91'),JSON[_0x2cd1('0x9')](_0x98fbcc));});};exports[_0x2cd1('0x93')]=function(_0x2b0849,_0xb9ff5b,_0x184723,_0x1ff136,_0x1e9b23,_0x37aa99){var _0x381556,_0x1b75e3,_0x98121e;_0x37aa99[_0x2cd1('0x7a')]=intUtil['stripTrailingSlash'](_0x37aa99['host']);_0x37aa99[_0x2cd1('0x7b')]=intUtil['stripTrailingSlash'](_0x37aa99['serverUrl']);if(_0x1e9b23&&_0x1e9b23[_0x2cd1('0x7c')]){logger[_0x2cd1('0x2a')]('['+_0xb9ff5b['lastevent'][_0x2cd1('0x94')]()+']','Recording\x20is\x20enabled!');_0xb9ff5b[_0x2cd1('0x7f')]=_0x37aa99['serverUrl']+_0x2cd1('0x80')+_0xb9ff5b[_0x2cd1('0x81')]+_0x2cd1('0x82')+md5(_0xb9ff5b[_0x2cd1('0x81')]);}else{_0xb9ff5b['recordingURL']='';}var _0x272271=_0x37aa99[_0x2cd1('0x7a')]===_0x2cd1('0x95')?'eu':'com';return getAccessToken(_0x37aa99)[_0x2cd1('0x25')](function(_0x4d9f67){_0x98121e=_0x4d9f67;return getUser(_0x98121e,_0x272271,_0x37aa99);})['then'](function(_0x3a70ea){_0x381556=_0x3a70ea;logger[_0x2cd1('0x2a')]('The\x20User\x20ID\x20is:',_0x381556['id']);return getEndUser(_0x98121e,_0x272271,_0x37aa99,_0xb9ff5b[_0x2cd1('0x96')],_0xb9ff5b['calleridnum'],_0x381556,_0x184723);})['then'](function(_0x26b60a){_0x1b75e3=_0x26b60a;return getCall(_0x98121e,_0x272271,_0x37aa99,_0x381556,_0x1b75e3,_0x184723,_0xb9ff5b,_0x2cd1('0x75'));})[_0x2cd1('0x25')](function(_0x24a3ae){if(_0x24a3ae){logger[_0x2cd1('0x2a')](_0x2cd1('0x86'),_0x24a3ae['id']);}})['catch'](function(_0x133e1a){logger[_0x2cd1('0x3a')]('['+_0xb9ff5b[_0x2cd1('0x97')][_0x2cd1('0x94')]()+']',JSON[_0x2cd1('0x9')](_0x133e1a));});}; \ No newline at end of file +var _0x8f94=['First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','unmanaged','monitor_format','toUpperCase','The\x20User\x20ID\x20is:','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/logger','redis','localhost','emit','debug','stringify','length','forEach','includes','string','picklist','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','Agent\x20found!','profile','user','Administrator','Using\x20the\x20admin\x20account!','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x8f94,0xd7));var _0x48f9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8f94[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x48f9('0x0'));var rp=require(_0x48f9('0x1'));var md5=require(_0x48f9('0x2'));var util=require(_0x48f9('0x3'));var intUtil=require(_0x48f9('0x4'));var moment=require('moment');var Redis=require(_0x48f9('0x5'));var BPromise=require(_0x48f9('0x6'));var config=require('../../../../config/environment');var logger=require(_0x48f9('0x7'))('zoho');config[_0x48f9('0x8')]=_['defaults'](config[_0x48f9('0x8')],{'host':_0x48f9('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x48f9('0x8')]));function emit(_0x28704d,_0x24bc0f,_0x1fde15){io['to'](_0x28704d)[_0x48f9('0xa')](_0x24bc0f,_0x1fde15);}function request(_0x5b0b86){logger[_0x48f9('0xb')]('[HTTP]',JSON[_0x48f9('0xc')](_0x5b0b86));return rp(_0x5b0b86);}function getCustomFields(_0x26345e,_0x2edf0b){var _0x5d9d1b={};if(_0x26345e[_0x48f9('0xd')]>0x0){_[_0x48f9('0xe')](_0x26345e,function(_0x4839ad){if(_[_0x48f9('0xf')]([_0x48f9('0x10'),_0x48f9('0x11')],_0x4839ad['type'])&&_0x4839ad[_0x48f9('0x12')]){_0x5d9d1b[_0x4839ad[_0x48f9('0x12')]]=_0x4839ad['content'][_0x48f9('0x13')]();}else if(_0x4839ad[_0x48f9('0x14')]===_0x48f9('0x15')&&_0x4839ad['variableName']&&_0x4839ad[_0x48f9('0x12')]&&_0x2edf0b[_0x4839ad['variableName']]){_0x5d9d1b[_0x4839ad[_0x48f9('0x12')]]=_0x2edf0b[_0x4839ad[_0x48f9('0x16')]][_0x48f9('0x13')]();}else if(_0x4839ad[_0x48f9('0x14')]===_0x48f9('0x17')&&_0x4839ad[_0x48f9('0x18')]&&_0x4839ad[_0x48f9('0x18')][_0x48f9('0x19')]&&_0x4839ad[_0x48f9('0x12')]&&_0x2edf0b[_0x4839ad['Variable']['name'][_0x48f9('0x1a')]()]){_0x5d9d1b[_0x4839ad[_0x48f9('0x12')]]=_0x2edf0b[_0x4839ad[_0x48f9('0x18')][_0x48f9('0x19')][_0x48f9('0x1a')]()][_0x48f9('0x13')]();}});}return _0x5d9d1b;}function getName(_0x2802a0){if(_0x2802a0[_0x48f9('0x1b')]('\x20')>0x0){var _0x284bc3=_0x2802a0['split'](/ (.+)/);if(_0x284bc3[0x1]){return _0x284bc3;}}return[_0x2802a0,_0x2802a0];}var accountsTokens={};function getAccessToken(_0x1fc14a){return new Promise(function(_0x2591ec,_0x545671){if(!_[_0x48f9('0x1c')](accountsTokens[_0x1fc14a['id']])&&!_[_0x48f9('0x1c')](accountsTokens[_0x1fc14a['id']][_0x48f9('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x1fc14a['id']][_0x48f9('0x1e')])){_0x2591ec(accountsTokens[_0x1fc14a['id']][_0x48f9('0x1d')]);}}var _0x1201e1;switch(_0x1fc14a[_0x48f9('0x1f')]){case'US':_0x1201e1=_0x48f9('0x20');break;case'AU':_0x1201e1=_0x48f9('0x21');break;case'EU':_0x1201e1=_0x48f9('0x22');break;case'IN':_0x1201e1=_0x48f9('0x23');break;case'CN':_0x1201e1=_0x48f9('0x24');break;default:_0x1201e1='https://accounts.zoho.eu';break;}var _0x2a90f2={'method':_0x48f9('0x25'),'uri':_0x1201e1+_0x48f9('0x26'),'qs':{'refresh_token':_0x1fc14a[_0x48f9('0x27')],'client_id':_0x1fc14a[_0x48f9('0x28')],'client_secret':_0x1fc14a[_0x48f9('0x29')],'grant_type':_0x48f9('0x2a')},'json':!![]};return rp(_0x2a90f2)[_0x48f9('0x2b')](function(_0x75c557){accountsTokens[_0x1fc14a['id']]={'access_token':_0x75c557[_0x48f9('0x1d')],'expires_in':moment()['add'](_0x75c557['expires_in'],_0x48f9('0x2c'))};_0x2591ec(_0x75c557[_0x48f9('0x1d')]);})[_0x48f9('0x2d')](function(_0x5b76bd){logger[_0x48f9('0x2e')](_0x48f9('0x2f'),_0x5b76bd[_0x48f9('0x30')]);_0x545671(_0x5b76bd);});});}function getUser(_0x2f6d62,_0x1f6e24,_0x30d436,_0x3e7ad8){logger[_0x48f9('0x31')](_0x48f9('0x32'));return request({'method':_0x48f9('0x33'),'uri':util[_0x48f9('0x34')](_0x48f9('0x35'),_0x1f6e24),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x48f9('0x36')+_0x2f6d62},'json':!![]})[_0x48f9('0x2b')](function(_0x3094e5){if(_0x3094e5['users']){var _0x5df606=-0x1;if(_[_0x48f9('0x37')](_0x3094e5['users'])){if(!_[_0x48f9('0x1c')](_0x3e7ad8)){_0x5df606=_[_0x48f9('0x38')](_0x3094e5[_0x48f9('0x39')],function(_0x18ff02){return _0x18ff02['email']===_0x3e7ad8;});}if(_0x5df606>=0x0){logger['info'](_0x48f9('0x3a'));}else{logger[_0x48f9('0x31')]('Using\x20the\x20admin\x20account!');_0x5df606=_[_0x48f9('0x38')](_0x3094e5[_0x48f9('0x39')],function(_0x1c9d80){return _0x1c9d80[_0x48f9('0x3b')][_0x48f9('0x19')]==='Administrator';});}return _0x3094e5['users'][_0x5df606];}else{if(_0x3094e5[_0x48f9('0x3c')][_0x48f9('0x3b')][_0x48f9('0x19')]===_0x48f9('0x3d')){logger[_0x48f9('0x31')](_0x48f9('0x3e'));user=_0x3094e5[_0x48f9('0x3c')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x3094e5));throw new Error(_0x48f9('0x3f')+JSON['stringify'](_0x3094e5));}}}else{logger[_0x48f9('0x2e')](_0x48f9('0x40'),JSON['stringify'](_0x3094e5));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x48f9('0xc')](_0x3094e5));}})['catch'](function(_0x4bdb63){console[_0x48f9('0x2e')](_0x4bdb63);});}function getZohoUser(_0x582bfd,_0x4e08db){return new BPromise(function(_0x219211,_0x4c33ea){request(_0x582bfd)['then'](function(_0x3f1d06){var _0x3ba6af=null;if(_0x3f1d06){_0x3ba6af=_0x3f1d06[_0x48f9('0x41')][0x0];_0x3ba6af[_0x48f9('0x42')]=_0x4e08db;}_0x219211(_0x3ba6af);})[_0x48f9('0x2d')](function(_0x1f96e0){_0x4c33ea(_0x1f96e0);});});}function createEndUser(_0x47b883,_0x244780,_0x14f883,_0x2f9316,_0xa27ca5,_0x5df138){var _0x14f883=getName(_0x14f883);return request({'method':_0x48f9('0x25'),'uri':_0x48f9('0x43')+_0x244780+_0x48f9('0x44')+_['startCase'](_0x5df138[_0x48f9('0x45')])+'s','body':{'data':[{'Last_Name':_0x14f883[0x1],'First_Name':_0x14f883[0x0],'Phone':_0x2f9316,'Owner':{'name':!_[_0x48f9('0x1c')](_0xa27ca5['role'][_0x48f9('0x19')])?_0xa27ca5[_0x48f9('0x46')][_0x48f9('0x19')]:!_[_0x48f9('0x1c')](_0xa27ca5['first_name'])?_0xa27ca5['first_name']+'\x20'+_0xa27ca5[_0x48f9('0x47')]:_0xa27ca5['last_name'],'id':_0xa27ca5['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x47b883},'json':!![]})[_0x48f9('0x2b')](function(_0x5161e6){if(_0x5161e6&&_0x5161e6[_0x48f9('0x41')][0x0]['code']===_0x48f9('0x48')){var _0x12b99e=_0x5161e6[_0x48f9('0x41')][0x0][_0x48f9('0x49')];_0x12b99e[_0x48f9('0x42')]=_['startCase'](_0x5df138[_0x48f9('0x45')])+'s';return _0x12b99e;}logger['error'](_0x48f9('0x40'),JSON[_0x48f9('0xc')](data));throw new Error(_0x48f9('0x4a')+JSON[_0x48f9('0xc')](data));})[_0x48f9('0x2d')](function(_0x23ff98){console[_0x48f9('0x4b')](_0x48f9('0x4c'),_0x23ff98);});}function getEndUser(_0x52e8ab,_0x3f587c,_0xad01e6,_0x2eebf8,_0x4ba861,_0x3f938d,_0x1d20de){var _0x81c800={'method':_0x48f9('0x33'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x52e8ab},'json':!![]};switch(_0x1d20de[_0x48f9('0x4d')]){case'contact_lead':_0x81c800[_0x48f9('0x4e')]=_0x48f9('0x43')+_0x3f587c+_0x48f9('0x4f')+_0x4ba861+'))';return getZohoUser(_0x81c800,'Contacts')[_0x48f9('0x2b')](function(_0x454af4){if(_0x454af4)return _0x454af4;_0x81c800['uri']=_0x48f9('0x43')+_0x3f587c+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4ba861+'))';return getZohoUser(_0x81c800,_0x48f9('0x50'))[_0x48f9('0x2b')](function(_0x22f3fd){if(_0x22f3fd)return _0x22f3fd;if(_0x1d20de['moduleCreate']!=_0x48f9('0x51')){return createEndUser(_0x52e8ab,_0x3f587c,_0x2eebf8,_0x4ba861,_0x3f938d,_0x1d20de);}else{return{};}});});break;case _0x48f9('0x52'):_0x81c800[_0x48f9('0x4e')]=_0x48f9('0x43')+_0x3f587c+_0x48f9('0x4f')+_0x4ba861+'))';return getZohoUser(_0x81c800,_0x48f9('0x53'))[_0x48f9('0x2b')](function(_0x51ea39){if(_0x51ea39)return _0x51ea39;if(_0x1d20de[_0x48f9('0x45')]!=_0x48f9('0x51')){return createEndUser(_0x52e8ab,_0x3f587c,_0x2eebf8,_0x4ba861,_0x3f938d,_0x1d20de);}else{return{};}});break;case'lead':_0x81c800[_0x48f9('0x4e')]='https://www.zohoapis.'+_0x3f587c+_0x48f9('0x54')+_0x4ba861+'))';return getZohoUser(_0x81c800,_0x48f9('0x50'))[_0x48f9('0x2b')](function(_0x35bd3a){if(_0x35bd3a)return _0x35bd3a;if(_0x1d20de[_0x48f9('0x45')]!=_0x48f9('0x51')){return createEndUser(_0x52e8ab,_0x3f587c,_0x2eebf8,_0x4ba861,_0x3f938d,_0x1d20de);}else{return{};}});break;}}function getCall(_0x232acc,_0x3b5862,_0x45ec71,_0x5d345d,_0x387e09,_0x3b64af,_0x271eaa,_0x3b364a){logger[_0x48f9('0x31')](_0x48f9('0x55'));var _0x3e3015={};_0x3e3015[_0x48f9('0x56')]={'name':!_[_0x48f9('0x1c')](_0x5d345d[_0x48f9('0x46')][_0x48f9('0x19')])&&!_[_0x48f9('0x1c')](_0x5d345d[_0x48f9('0x3b')][_0x48f9('0x19')])&&_0x5d345d[_0x48f9('0x3b')][_0x48f9('0x19')]===_0x48f9('0x57')?_0x5d345d[_0x48f9('0x46')][_0x48f9('0x19')]:!_[_0x48f9('0x1c')](_0x5d345d[_0x48f9('0x58')])?_0x5d345d[_0x48f9('0x58')]+'\x20'+_0x5d345d['last_name']:_0x5d345d[_0x48f9('0x47')],'id':_0x5d345d['id']};_0x3e3015[_0x48f9('0x59')]=intUtil[_0x48f9('0x5a')](_0x3b64af[_0x48f9('0x5b')],_0x271eaa,'\x20');_0x3e3015['Description']=intUtil['getString'](_0x3b64af[_0x48f9('0x5c')],_0x271eaa,'\x0a');if(_0x387e09[_0x48f9('0x42')]===_0x48f9('0x53')){_0x3e3015[_0x48f9('0x5d')]={'name':!_[_0x48f9('0x1c')](_0x387e09[_0x48f9('0x5e')])?_0x387e09[_0x48f9('0x5e')]:!_[_0x48f9('0x1c')](_0x387e09[_0x48f9('0x5f')])?_0x387e09[_0x48f9('0x5f')]+'\x20'+_0x387e09['Last_Name']:_0x387e09[_0x48f9('0x60')],'id':_0x387e09['id']};}if(_0x387e09[_0x48f9('0x42')]==='Leads'){_0x3e3015[_0x48f9('0x61')]={'name':!_[_0x48f9('0x1c')](_0x387e09[_0x48f9('0x5e')])?_0x387e09[_0x48f9('0x5e')]:!_[_0x48f9('0x1c')](_0x387e09['First_Name'])?_0x387e09[_0x48f9('0x5f')]+'\x20'+_0x387e09[_0x48f9('0x60')]:_0x387e09[_0x48f9('0x60')],'id':_0x387e09['id']};_0x3e3015[_0x48f9('0x62')]=_['startCase'](_0x387e09[_0x48f9('0x42')]);}if(_0x271eaa[_0x48f9('0x63')]){_0x3e3015[_0x48f9('0x64')]=moment[_0x48f9('0x65')](parseInt(_0x271eaa[_0x48f9('0x63')])*0x3e8)['format'](_0x48f9('0x66'));}else if(_0x271eaa[_0x48f9('0x67')]&&_0x271eaa[_0x48f9('0x68')]){_0x3e3015['Call_Duration']=moment[_0x48f9('0x65')](moment(_0x271eaa['endtime'],_0x48f9('0x69'))[_0x48f9('0x6a')](moment(_0x271eaa[_0x48f9('0x6b')],_0x48f9('0x69'))))['format'](_0x48f9('0x66'));}switch(_0x271eaa[_0x48f9('0x6c')]){case'called':_0x3e3015[_0x48f9('0x6d')]=_0x48f9('0x6e');break;case _0x48f9('0x6f'):case _0x48f9('0x70'):_0x3e3015[_0x48f9('0x6d')]='Answered';break;case _0x48f9('0x71'):_0x3e3015['Call_Result']=_0x48f9('0x72');break;case _0x48f9('0x73'):_0x3e3015['Call_Result']=_0x48f9('0x74');break;case _0x48f9('0x75'):_0x3e3015['Call_Result']='Timeout';default:}_0x3e3015[_0x48f9('0x76')]=(_0x3b364a==='outbound'?moment(_0x271eaa['starttime'])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x271eaa[_0x48f9('0x77')])[_0x48f9('0x34')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x48f9('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x3e3015[_0x48f9('0x78')]=_0x3b364a||_0x48f9('0x79');_0x3e3015=_['merge'](_0x3e3015,getCustomFields(_0x3b64af[_0x48f9('0x7a')],_0x271eaa));return request({'method':'POST','uri':_0x48f9('0x43')+_0x3b5862+'/crm/v2/Calls','headers':{'Authorization':_0x48f9('0x36')+_0x232acc},'body':{'data':[_0x3e3015]},'json':!![]})[_0x48f9('0x2b')](function(_0x3fe3b2){if(_0x3fe3b2&&_0x3fe3b2[_0x48f9('0x41')][0x0]['code']===_0x48f9('0x48')){logger[_0x48f9('0x31')](_0x48f9('0x7b'));return{'id':_0x3fe3b2['data'][0x0]['details']['id']};}})['catch'](function(_0x1cb52a){logger['info']('err',_0x1cb52a[_0x48f9('0x30')]);console[_0x48f9('0x4b')](_0x48f9('0x7c'),_0x1cb52a);});}exports[_0x48f9('0x7d')]=function(_0x1cff9b,_0x4b6bef,_0x5e1278,_0x478674,_0x4349de,_0x2e1540){var _0x52e835,_0xf0a4f9,_0x5283d9;_0x2e1540[_0x48f9('0x7e')]=intUtil[_0x48f9('0x7f')](_0x2e1540[_0x48f9('0x7e')]);_0x2e1540[_0x48f9('0x80')]=intUtil[_0x48f9('0x7f')](_0x2e1540[_0x48f9('0x80')]);if(_0x4349de&&_0x4349de['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x4b6bef['recordingURL']=_0x2e1540[_0x48f9('0x80')]+_0x48f9('0x81')+_0x4b6bef[_0x48f9('0x82')]+_0x48f9('0x83')+md5(_0x4b6bef['uniqueid']);}else{_0x4b6bef['recordingURL']='';}var _0xbff956=_0x2e1540[_0x48f9('0x7e')]===_0x48f9('0x84')?'eu':_0x48f9('0x85');return getAccessToken(_0x2e1540)[_0x48f9('0x2b')](function(_0x536190){_0x5283d9=_0x536190;return getUser(_0x5283d9,_0xbff956,_0x2e1540,_0x478674['email']);})[_0x48f9('0x2b')](function(_0x55e1cc){_0x52e835=_0x55e1cc;logger[_0x48f9('0x31')]('The\x20User\x20ID\x20is:',_0x52e835['id']);return getEndUser(_0x5283d9,_0xbff956,_0x2e1540,_0x4b6bef[_0x48f9('0x86')],_0x4b6bef[_0x48f9('0x87')],_0x52e835,_0x5e1278);})[_0x48f9('0x2b')](function(_0x1bb486){_0xf0a4f9=_0x1bb486;return getCall(_0x5283d9,_0xbff956,_0x2e1540,_0x52e835,_0xf0a4f9,_0x5e1278,_0x4b6bef,_0x48f9('0x79'));})['then'](function(_0x2b2f12){if(_0x2b2f12){logger[_0x48f9('0x31')](_0x48f9('0x88'),_0x2b2f12['id']);logger[_0x48f9('0x31')](_0x48f9('0x89'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x48f9('0x34')]('user:%s',_0x478674[_0x48f9('0x19')]),_0x48f9('0x8a'),{'uri':'https://crm.'+_0x2e1540[_0x48f9('0x7e')]+_0x48f9('0x8b')+_0x2b2f12['id']});}})['catch'](function(_0x1fd6a7){logger[_0x48f9('0x2e')](_0x48f9('0x89'),JSON[_0x48f9('0xc')](_0x1fd6a7));});};exports['outbound']=function(_0x5e9481,_0x486579,_0x18fb9b,_0x38e473,_0x221497,_0x163e98,_0x2db652){var _0x4de4ad,_0x4a1ae4,_0x528fd9;_0x163e98['host']=intUtil[_0x48f9('0x7f')](_0x163e98[_0x48f9('0x7e')]);_0x163e98[_0x48f9('0x80')]=intUtil[_0x48f9('0x7f')](_0x163e98[_0x48f9('0x80')]);if(_0x2db652&&_0x2db652['recordingFormat']&&_0x2db652[_0x48f9('0x8c')]!==_0x48f9('0x8d')){logger[_0x48f9('0x31')]('[OUTBOUND]',_0x48f9('0x8e'));_0x486579[_0x48f9('0x8f')]=_0x163e98[_0x48f9('0x80')]+_0x48f9('0x81')+_0x486579['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x486579[_0x48f9('0x82')]);}var _0x25f502=_0x163e98['host']===_0x48f9('0x84')?'eu':_0x48f9('0x85');return getAccessToken(_0x163e98)['then'](function(_0x2f7de1){_0x528fd9=_0x2f7de1;return getUser(_0x528fd9,_0x25f502,_0x163e98,_0x38e473['email']);})[_0x48f9('0x2b')](function(_0x38f679){_0x4de4ad=_0x38f679;logger[_0x48f9('0x31')]('The\x20User\x20ID\x20is:',_0x4de4ad['id']);return getEndUser(_0x528fd9,_0x25f502,_0x163e98,_0x486579[_0x48f9('0x90')],_0x486579[_0x48f9('0x91')],_0x4de4ad,_0x18fb9b);})[_0x48f9('0x2b')](function(_0x2d6a41){_0x4a1ae4=_0x2d6a41;return getCall(_0x528fd9,_0x25f502,_0x163e98,_0x4de4ad,_0x4a1ae4,_0x18fb9b,_0x486579,_0x48f9('0x92'));})[_0x48f9('0x2b')](function(_0x4f294f){if(_0x4f294f){logger[_0x48f9('0x31')](_0x48f9('0x88'),_0x4f294f['id']);logger['info'](_0x48f9('0x93'),_0x48f9('0x94'));emit(util['format'](_0x48f9('0x95'),_0x38e473[_0x48f9('0x19')]),_0x48f9('0x8a'),{'uri':_0x48f9('0x96')+_0x163e98[_0x48f9('0x7e')]+_0x48f9('0x8b')+_0x4f294f['id']});}})[_0x48f9('0x2d')](function(_0x2c1e37){logger[_0x48f9('0x2e')](_0x48f9('0x93'),JSON[_0x48f9('0xc')](_0x2c1e37));});};exports[_0x48f9('0x97')]=function(_0xff610f,_0x31e2b4,_0x119a2e,_0x57f716,_0x5daa9e,_0x13f288){var _0x128ae3,_0x2eb4db,_0x4a9c82;_0x13f288[_0x48f9('0x7e')]=intUtil[_0x48f9('0x7f')](_0x13f288['host']);_0x13f288[_0x48f9('0x80')]=intUtil[_0x48f9('0x7f')](_0x13f288['serverUrl']);if(_0x5daa9e&&_0x5daa9e[_0x48f9('0x98')]){logger['info']('['+_0x31e2b4['lastevent'][_0x48f9('0x99')]()+']','Recording\x20is\x20enabled!');_0x31e2b4[_0x48f9('0x8f')]=_0x13f288[_0x48f9('0x80')]+_0x48f9('0x81')+_0x31e2b4[_0x48f9('0x82')]+_0x48f9('0x83')+md5(_0x31e2b4[_0x48f9('0x82')]);}else{_0x31e2b4[_0x48f9('0x8f')]='';}var _0x5dc6b4=_0x13f288['host']===_0x48f9('0x84')?'eu':_0x48f9('0x85');return getAccessToken(_0x13f288)[_0x48f9('0x2b')](function(_0x3bc1c2){_0x4a9c82=_0x3bc1c2;return getUser(_0x4a9c82,_0x5dc6b4,_0x13f288);})['then'](function(_0x38cd0a){_0x128ae3=_0x38cd0a;logger[_0x48f9('0x31')](_0x48f9('0x9a'),_0x128ae3['id']);return getEndUser(_0x4a9c82,_0x5dc6b4,_0x13f288,_0x31e2b4[_0x48f9('0x86')],_0x31e2b4['calleridnum'],_0x128ae3,_0x119a2e);})[_0x48f9('0x2b')](function(_0x34d786){_0x2eb4db=_0x34d786;return getCall(_0x4a9c82,_0x5dc6b4,_0x13f288,_0x128ae3,_0x2eb4db,_0x119a2e,_0x31e2b4,_0x48f9('0x79'));})[_0x48f9('0x2b')](function(_0x290be8){if(_0x290be8){logger[_0x48f9('0x31')](_0x48f9('0x88'),_0x290be8['id']);}})[_0x48f9('0x2d')](function(_0x46bd93){logger[_0x48f9('0x2e')]('['+_0x31e2b4[_0x48f9('0x6c')][_0x48f9('0x99')]()+']',JSON['stringify'](_0x46bd93));});}; \ 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 52e245b..35ea408 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 _0x5ea1=['render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x38b2c2,_0x333c55){var _0x57d163=function(_0x596b0b){while(--_0x596b0b){_0x38b2c2['push'](_0x38b2c2['shift']());}};_0x57d163(++_0x333c55);}(_0x5ea1,0x198));var _0x15ea=function(_0x1d0fde,_0x30dff7){_0x1d0fde=_0x1d0fde-0x0;var _0x14d46f=_0x5ea1[_0x1d0fde];return _0x14d46f;};'use strict';var util=require(_0x15ea('0x0'));var sh=require('shelljs');var Mustache=require(_0x15ea('0x1'));var logger=require(_0x15ea('0x2'))(_0x15ea('0x3'));exports[_0x15ea('0x4')]=function(_0x5c7c49,_0x7832b){var _0x3075d0=_0x5c7c49[_0x15ea('0x5')]?_0x5c7c49[_0x15ea('0x5')]:_0x15ea('0x6');var _0x52edf7=_0x5c7c49[_0x15ea('0x7')]?Mustache[_0x15ea('0x8')](_0x5c7c49[_0x15ea('0x7')],_0x7832b):_0x7832b;sh[_0x15ea('0x4')](_0x52edf7,function(_0xaffc9d,_0x3fd1c1,_0x373e60){if(_0xaffc9d!==0x0){logger[_0x15ea('0x9')](util['format'](_0x15ea('0xa'),_0x3075d0,_0x52edf7,_0xaffc9d,_0x373e60));}else{logger['info'](util[_0x15ea('0xb')](_0x15ea('0xc'),_0x3075d0,_0x52edf7,_0x3fd1c1));}});}; \ No newline at end of file +var _0xb6c8=['mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','util','shelljs'];(function(_0x544685,_0x31e2de){var _0x3433a0=function(_0x5b129d){while(--_0x5b129d){_0x544685['push'](_0x544685['shift']());}};_0x3433a0(++_0x31e2de);}(_0xb6c8,0x1ea));var _0x8b6c=function(_0x2ebbed,_0x4fd78a){_0x2ebbed=_0x2ebbed-0x0;var _0xa56196=_0xb6c8[_0x2ebbed];return _0xa56196;};'use strict';var util=require(_0x8b6c('0x0'));var sh=require(_0x8b6c('0x1'));var Mustache=require(_0x8b6c('0x2'));var logger=require(_0x8b6c('0x3'))(_0x8b6c('0x4'));exports[_0x8b6c('0x5')]=function(_0x172ff0,_0x567042){var _0x2b8886=_0x172ff0[_0x8b6c('0x6')]?_0x172ff0[_0x8b6c('0x6')]:_0x8b6c('0x7');var _0x263efc=_0x172ff0[_0x8b6c('0x8')]?Mustache[_0x8b6c('0x9')](_0x172ff0[_0x8b6c('0x8')],_0x567042):_0x567042;sh[_0x8b6c('0x5')](_0x263efc,function(_0x63f978,_0x5f2446,_0x18b006){if(_0x63f978!==0x0){logger[_0x8b6c('0xa')](util[_0x8b6c('0xb')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x2b8886,_0x263efc,_0x63f978,_0x18b006));}else{logger['info'](util[_0x8b6c('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2b8886,_0x263efc,_0x5f2446));}});}; \ 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 ccfd1e8..49bfad8 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 _0xa873=['trigger','data1','render','number','data5','headers','data6','parse','error','stack','toUpperCase','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','isNil',',\x20request\x20body:\x20','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa873,0x1b5));var _0x3a87=function(_0x18d8e9,_0x2d9568){_0x18d8e9=_0x18d8e9-0x0;var _0x1b9102=_0xa873[_0x18d8e9];return _0x1b9102;};'use strict';var rp=require(_0x3a87('0x0'));var util=require(_0x3a87('0x1'));var _=require(_0x3a87('0x2'));var Mustache=require(_0x3a87('0x3'));var logger=require(_0x3a87('0x4'))(_0x3a87('0x5'));exports['exec']=function(_0x51e3d8,_0x654740){var _0x53b2de,_0x33a560;var _0xe01b79={'method':_0x51e3d8[_0x3a87('0x6')]['toUpperCase'](),'uri':Mustache[_0x3a87('0x7')](_0x51e3d8['data2'],_0x654740),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x51e3d8['data5'])===_0x3a87('0x8')&&parseInt(_0x51e3d8[_0x3a87('0x9')])>=0x1&&parseInt(_0x51e3d8[_0x3a87('0x9')])<=0xa?parseInt(_0x51e3d8['data5'])*0x3e8:0x5*0x3e8};try{_0xe01b79[_0x3a87('0xa')]=_0x51e3d8[_0x3a87('0xb')]?JSON[_0x3a87('0xc')](Mustache['render'](_0x51e3d8['data6'],_0x654740)):{};}catch(_0x437d69){logger[_0x3a87('0xd')](_0x437d69[_0x3a87('0xe')]);}switch(_0x51e3d8[_0x3a87('0x6')][_0x3a87('0xf')]()){case'GET':case'DELETE':_0x53b2de=null;_0xe01b79['qs']=_0x654740;break;case _0x3a87('0x10'):case _0x3a87('0x11'):if(_0x51e3d8[_0x3a87('0x12')]){try{_0x53b2de=JSON[_0x3a87('0xc')](Mustache['render'](_0x51e3d8[_0x3a87('0x12')],_0x654740));_0xe01b79[_0x3a87('0x13')]=_0x53b2de;}catch(_0x1b28bf){logger[_0x3a87('0xd')](_0x1b28bf['stack']);logger[_0x3a87('0xd')](_0x3a87('0x14'));}}else{_0x53b2de=_0x654740;_0xe01b79[_0x3a87('0x13')]=_0x53b2de;}break;}logger[_0x3a87('0x15')](util[_0x3a87('0x16')](_0x3a87('0x17'),_0x51e3d8[_0x3a87('0x6')],_0x51e3d8[_0x3a87('0x18')],JSON[_0x3a87('0x19')](_0xe01b79)));rp(_0xe01b79)['then'](function(_0xcd8f96){_0x53b2de=!_[_0x3a87('0x1a')](_0x53b2de)?_0x3a87('0x1b')+_0x53b2de:'';_0x33a560=typeof _0xcd8f96[_0x3a87('0x13')]===_0x3a87('0x1c')?JSON[_0x3a87('0x19')](_0xcd8f96[_0x3a87('0x13')]):_0xcd8f96[_0x3a87('0x13')];logger[_0x3a87('0x15')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x51e3d8[_0x3a87('0x6')],_0x51e3d8[_0x3a87('0x18')],_0xcd8f96['statusCode'],_0x33a560));})[_0x3a87('0x1d')](function(_0x30e0a4){logger[_0x3a87('0xd')](util[_0x3a87('0x16')](_0x3a87('0x1e'),_0x51e3d8[_0x3a87('0x6')],_0x51e3d8[_0x3a87('0x18')],_0x30e0a4[_0x3a87('0x1f')],_0x30e0a4[_0x3a87('0x20')],_0x30e0a4[_0x3a87('0x21')]));});}; \ No newline at end of file +var _0x64af=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','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','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','headers','data6','error','stack','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format'];(function(_0x25f334,_0x44aab9){var _0x11fb6e=function(_0x15a527){while(--_0x15a527){_0x25f334['push'](_0x25f334['shift']());}};_0x11fb6e(++_0x44aab9);}(_0x64af,0x6e));var _0xf64a=function(_0x1889d2,_0x340dfc){_0x1889d2=_0x1889d2-0x0;var _0x43d542=_0x64af[_0x1889d2];return _0x43d542;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0xf64a('0x0'));var Mustache=require(_0xf64a('0x1'));var logger=require(_0xf64a('0x2'))('trigger');exports[_0xf64a('0x3')]=function(_0x3a5337,_0x42e525){var _0x1199ff,_0x454413;var _0x12c225={'method':_0x3a5337[_0xf64a('0x4')][_0xf64a('0x5')](),'uri':Mustache[_0xf64a('0x6')](_0x3a5337[_0xf64a('0x7')],_0x42e525),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3a5337[_0xf64a('0x8')])==='number'&&parseInt(_0x3a5337[_0xf64a('0x8')])>=0x1&&parseInt(_0x3a5337['data5'])<=0xa?parseInt(_0x3a5337[_0xf64a('0x8')])*0x3e8:0x5*0x3e8};try{_0x12c225[_0xf64a('0x9')]=_0x3a5337[_0xf64a('0xa')]?JSON['parse'](Mustache[_0xf64a('0x6')](_0x3a5337['data6'],_0x42e525)):{};}catch(_0x366c58){logger[_0xf64a('0xb')](_0x366c58[_0xf64a('0xc')]);}switch(_0x3a5337['data1']['toUpperCase']()){case _0xf64a('0xd'):case _0xf64a('0xe'):_0x1199ff=null;_0x12c225['qs']=_0x42e525;break;case _0xf64a('0xf'):case _0xf64a('0x10'):if(_0x3a5337[_0xf64a('0x11')]){try{_0x1199ff=JSON['parse'](Mustache['render'](_0x3a5337['data7'],_0x42e525));_0x12c225['body']=_0x1199ff;}catch(_0x6c668a){logger['error'](_0x6c668a['stack']);logger['error'](_0xf64a('0x12'));}}else{_0x1199ff=_0x42e525;_0x12c225[_0xf64a('0x13')]=_0x1199ff;}break;}logger[_0xf64a('0x14')](util[_0xf64a('0x15')](_0xf64a('0x16'),_0x3a5337['data1'],_0x3a5337['data2'],JSON[_0xf64a('0x17')](_0x12c225)));rp(_0x12c225)['then'](function(_0x4ba0cc){_0x1199ff=!_[_0xf64a('0x18')](_0x1199ff)?_0xf64a('0x19')+_0x1199ff:'';_0x454413=typeof _0x4ba0cc[_0xf64a('0x13')]===_0xf64a('0x1a')?JSON[_0xf64a('0x17')](_0x4ba0cc['body']):_0x4ba0cc[_0xf64a('0x13')];logger['info'](util[_0xf64a('0x15')](_0xf64a('0x1b'),_0x3a5337['data1'],_0x3a5337[_0xf64a('0x7')],_0x4ba0cc[_0xf64a('0x1c')],_0x454413));})[_0xf64a('0x1d')](function(_0x250124){logger[_0xf64a('0xb')](util[_0xf64a('0x15')](_0xf64a('0x1e'),_0x3a5337[_0xf64a('0x4')],_0x3a5337[_0xf64a('0x7')],_0x250124[_0xf64a('0x1c')],_0x250124[_0xf64a('0x1f')],_0x250124[_0xf64a('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 920abde..769268b 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 _0x6d3e=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc','error','result','catch','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6d3e,0x8c));var _0xe6d3=function(_0x29c50a,_0x30dcd2){_0x29c50a=_0x29c50a-0x0;var _0x162737=_0x6d3e[_0x29c50a];return _0x162737;};'use strict';var jayson=require(_0xe6d3('0x0'));var BPromise=require(_0xe6d3('0x1'));var logger=require(_0xe6d3('0x2'))(_0xe6d3('0x3'));var client=jayson[_0xe6d3('0x4')][_0xe6d3('0x5')]({'port':0x2329});client[_0xe6d3('0x6')]=function(_0x1bf998,_0x586ba0){return new BPromise(function(_0x421b84,_0x2931a){return client[_0xe6d3('0x7')](_0x1bf998,_0x586ba0)['then'](function(_0x58b2f9){logger[_0xe6d3('0x8')](_0xe6d3('0x9'),_0xe6d3('0x3'),_0x1bf998,_0x586ba0,_0x58b2f9);if(_0x58b2f9[_0xe6d3('0xa')]){logger[_0xe6d3('0xa')](_0xe6d3('0x9'),_0xe6d3('0x3'),_0x1bf998,_0x58b2f9[_0xe6d3('0xa')]['message'],_0x586ba0);return _0x2931a(_0x58b2f9[_0xe6d3('0xa')]['message']);}else{return _0x421b84(_0x58b2f9[_0xe6d3('0xb')]);}})[_0xe6d3('0xc')](function(_0x282dce){logger[_0xe6d3('0xa')](_0xe6d3('0x9'),'routing',_0x1bf998,_0x282dce,_0x586ba0);return _0x2931a(_0x282dce);});});};module[_0xe6d3('0xd')]=client; \ No newline at end of file +var _0xdedd=['result','exports','jayson/promise','bluebird','routing','http','Request','request','then','rpc','error','message'];(function(_0x319b7c,_0x49bf97){var _0x2a30b7=function(_0xaae0f2){while(--_0xaae0f2){_0x319b7c['push'](_0x319b7c['shift']());}};_0x2a30b7(++_0x49bf97);}(_0xdedd,0xc2));var _0xdded=function(_0x21c88a,_0x4e6931){_0x21c88a=_0x21c88a-0x0;var _0x380963=_0xdedd[_0x21c88a];return _0x380963;};'use strict';var jayson=require(_0xdded('0x0'));var BPromise=require(_0xdded('0x1'));var logger=require('../../config/logger')(_0xdded('0x2'));var client=jayson['client'][_0xdded('0x3')]({'port':0x2329});client[_0xdded('0x4')]=function(_0x42633c,_0x386231){return new BPromise(function(_0xc1d78a,_0x19f5b1){return client[_0xdded('0x5')](_0x42633c,_0x386231)[_0xdded('0x6')](function(_0x25f3e8){logger['debug'](_0xdded('0x7'),_0xdded('0x2'),_0x42633c,_0x386231,_0x25f3e8);if(_0x25f3e8['error']){logger[_0xdded('0x8')](_0xdded('0x7'),'routing',_0x42633c,_0x25f3e8[_0xdded('0x8')][_0xdded('0x9')],_0x386231);return _0x19f5b1(_0x25f3e8[_0xdded('0x8')]['message']);}else{return _0xc1d78a(_0x25f3e8[_0xdded('0xa')]);}})['catch'](function(_0x1751f9){logger['error'](_0xdded('0x7'),'routing',_0x42633c,_0x1751f9,_0x386231);return _0x19f5b1(_0x1751f9);});});};module[_0xdded('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 343510c..4b65f76 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 _0x4dee=['resolve','then','initMailAccounts','refresh','listen','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email'];(function(_0x327e8b,_0x912506){var _0x89151=function(_0x25f76c){while(--_0x25f76c){_0x327e8b['push'](_0x327e8b['shift']());}};_0x89151(++_0x912506);}(_0x4dee,0xef));var _0xe4de=function(_0x5ab0f6,_0x219763){_0x5ab0f6=_0x5ab0f6-0x0;var _0x3ba5fe=_0x4dee[_0x5ab0f6];return _0x3ba5fe;};'use strict';var server=require(_0xe4de('0x0'));var Realtime=require(_0xe4de('0x1'));var EmailChannel=require(_0xe4de('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe4de('0x3')]()[_0xe4de('0x4')](mailAccount['getMailAccounts']())['then'](realtime[_0xe4de('0x5')]())[_0xe4de('0x4')](function(){email[_0xe4de('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xe4de('0x7')](realtime,email)[_0xe4de('0x4')](function(){return initRealtime();})[_0xe4de('0x4')](function(){return setting['getSettings']();})[_0xe4de('0x4')](function(_0x242013){return setInterval(initRealtime,_0x242013['loginMailFrequency']*0x3e8);})[_0xe4de('0x8')](function(_0x278368){logger[_0xe4de('0x9')](_0xe4de('0xa'),_0x278368);});}main(); \ No newline at end of file +var _0xdf32=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server'];(function(_0x578682,_0x2341e2){var _0x3d35a0=function(_0x56820b){while(--_0x56820b){_0x578682['push'](_0x578682['shift']());}};_0x3d35a0(++_0x2341e2);}(_0xdf32,0x14f));var _0x2df3=function(_0x218aab,_0x1c25e3){_0x218aab=_0x218aab-0x0;var _0x18171c=_0xdf32[_0x218aab];return _0x18171c;};'use strict';var server=require(_0x2df3('0x0'));var Realtime=require(_0x2df3('0x1'));var EmailChannel=require(_0x2df3('0x2'));var mailAccount=require(_0x2df3('0x3'));var setting=require(_0x2df3('0x4'));var logger=require(_0x2df3('0x5'))(_0x2df3('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2df3('0x7')]()[_0x2df3('0x8')](mailAccount[_0x2df3('0x9')]())['then'](realtime[_0x2df3('0xa')]())['then'](function(){email[_0x2df3('0xb')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x2df3('0x8')](function(){return initRealtime();})[_0x2df3('0x8')](function(){return setting[_0x2df3('0xc')]();})['then'](function(_0x477719){return setInterval(initRealtime,_0x477719[_0x2df3('0xd')]*0x3e8);})['catch'](function(_0x44888f){logger[_0x2df3('0xe')](_0x2df3('0xf'),_0x44888f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f45a1e1..feb7217 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 _0xf91a=['Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','Smtp','smtp','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','name','key','active','Imap','status','messageStatus','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','mailAccounts','disabled','prototype','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then'];(function(_0x44767b,_0x4d439d){var _0x570d75=function(_0x946ee9){while(--_0x946ee9){_0x44767b['push'](_0x44767b['shift']());}};_0x570d75(++_0x4d439d);}(_0xf91a,0xbe));var _0xaf91=function(_0x40c2ce,_0x17b447){_0x40c2ce=_0x40c2ce-0x0;var _0x1d45d1=_0xf91a[_0x40c2ce];return _0x1d45d1;};'use strict';var _=require(_0xaf91('0x0'));var moment=require(_0xaf91('0x1'));var BPromise=require(_0xaf91('0x2'));var md5=require(_0xaf91('0x3'));var Redis=require(_0xaf91('0x4'));var config=require(_0xaf91('0x5'));var logger=require(_0xaf91('0x6'))('email');config[_0xaf91('0x7')]=_['defaults'](config[_0xaf91('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xaf91('0x8'))(new Redis(config[_0xaf91('0x7')]));var EmailImap=require(_0xaf91('0x9'));var EmailSmtp=require(_0xaf91('0xa'));var mailAccount=require(_0xaf91('0xb'));var md5Accounts={};function EmailChannel(_0x19953c){logger[_0xaf91('0xc')](_0xaf91('0xd'));this['mailAccounts']=_0x19953c['mailAccounts'];this[_0xaf91('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x3d7878){var _0x5735b8=this['mailAccounts'][_0x3d7878];var _0x504a22={'id':_0x5735b8['id'],'name':_0x5735b8[_0xaf91('0xf')],'key':_0x5735b8[_0xaf91('0x10')],'active':_0x5735b8[_0xaf91('0x11')],'Imap':{'status':_0x5735b8[_0xaf91('0x12')][_0xaf91('0x13')],'messageStatus':_0x5735b8[_0xaf91('0x12')][_0xaf91('0x14')],'total':_0x5735b8[_0xaf91('0x12')][_0xaf91('0x15')]}};if(_[_0xaf91('0x16')](md5Accounts[_0x3d7878])){md5Accounts[_0x3d7878]={};}var _0x552d3f=md5(JSON[_0xaf91('0x17')](_0x504a22));if(md5Accounts[_0x3d7878][_0xaf91('0x3')]!==_0x552d3f){md5Accounts[_0x3d7878][_0xaf91('0x3')]=_0x552d3f;io[_0xaf91('0x18')](_0xaf91('0x19'),_0x504a22);}};EmailChannel['prototype'][_0xaf91('0x1a')]=function(_0x1e7be1){for(var _0x468e75 in _0x1e7be1){if(_0x1e7be1[_0xaf91('0x1b')](_0x468e75)){if(_0x1e7be1[_0x468e75]['Imap']&&_0x1e7be1[_0x468e75][_0xaf91('0x11')]){var _0x4d3386=_0x1e7be1[_0x468e75][_0xaf91('0x12')];if(!_0x4d3386[_0xaf91('0x1c')]&&_0x1e7be1[_0x468e75][_0xaf91('0x1d')]!==_0xaf91('0x1e'))_0x4d3386['service']=_0x1e7be1[_0x468e75][_0xaf91('0x1d')];if(!this[_0xaf91('0xe')][_0xaf91('0x1b')](_0x4d3386['id'])){this[_0xaf91('0xe')][_0x4d3386['id']]=new EmailImap(_0x4d3386,_0x1e7be1[_0x468e75]['email']);this[_0xaf91('0xe')][_0x4d3386['id']]['on'](_0xaf91('0x1f'),this[_0xaf91('0x20')]['bind'](this,_0x468e75));this['imapAccounts'][_0x4d3386['id']]['on']('email',this[_0xaf91('0x21')][_0xaf91('0x22')](this,_0x468e75));this['imapAccounts'][_0x4d3386['id']]['on'](_0xaf91('0x23'),this[_0xaf91('0x24')]['bind'](this,_0x468e75));this[_0xaf91('0xe')][_0x4d3386['id']]['on'](_0xaf91('0x25'),this[_0xaf91('0x26')][_0xaf91('0x22')](this,_0x468e75));}}else{if(_[_0xaf91('0x16')](this[_0xaf91('0x27')][_0x468e75][_0xaf91('0x12')])){this['mailAccounts'][_0x468e75][_0xaf91('0x12')]={};}this[_0xaf91('0x27')][_0x468e75][_0xaf91('0x12')][_0xaf91('0x13')]=_0xaf91('0x28');this[_0xaf91('0x27')][_0x468e75][_0xaf91('0x12')][_0xaf91('0x14')]='';this['emit'](_0x468e75);}}}};EmailChannel[_0xaf91('0x29')][_0xaf91('0x20')]=function(_0x2ed2f1,_0x313663){if(this[_0xaf91('0x27')][_0x2ed2f1]){this[_0xaf91('0x27')][_0x2ed2f1][_0xaf91('0x12')][_0xaf91('0x13')]=_0xaf91('0x2a');this['mailAccounts'][_0x2ed2f1][_0xaf91('0x12')][_0xaf91('0x14')]=_0x313663[_0xaf91('0xf')];if(_0x313663[_0xaf91('0x2b')]){this[_0xaf91('0x27')][_0x2ed2f1][_0xaf91('0x12')][_0xaf91('0x15')]=_0x313663[_0xaf91('0x2b')][_0xaf91('0x15')];}return this[_0xaf91('0x18')](_0x2ed2f1);}};EmailChannel['prototype'][_0xaf91('0x21')]=function(_0x427627,_0x3593b5){logger['info'](_0xaf91('0x2c'),_0x3593b5[_0xaf91('0x2d')],_0x3593b5[_0xaf91('0x2e')],_0x3593b5[_0xaf91('0x2f')],_0x427627);if(this[_0xaf91('0x27')][_0x427627]){return mailAccount[_0xaf91('0x30')](_0x427627,_0x3593b5)[_0xaf91('0x31')](function(_0x2ea866){if(_0x2ea866){logger[_0xaf91('0xc')](_0xaf91('0x32'));}})[_0xaf91('0x33')](function(_0x67a94d){logger[_0xaf91('0x25')](_0xaf91('0x34'),JSON[_0xaf91('0x17')](_0x67a94d));});}};EmailChannel[_0xaf91('0x29')][_0xaf91('0x24')]=function(_0x5b64c6){if(this[_0xaf91('0x27')][_0x5b64c6]&&this[_0xaf91('0x27')][_0x5b64c6][_0xaf91('0x12')]){if(this[_0xaf91('0xe')][this['mailAccounts'][_0x5b64c6]['Imap']['id']]){delete this[_0xaf91('0xe')][this['mailAccounts'][_0x5b64c6][_0xaf91('0x12')]['id']];}this[_0xaf91('0x27')][_0x5b64c6][_0xaf91('0x12')][_0xaf91('0x35')]=moment();this['emit'](_0x5b64c6);}};EmailChannel['prototype'][_0xaf91('0x26')]=function(_0x1dcfb1,_0x11432b){if(this[_0xaf91('0x27')][_0x1dcfb1]){this[_0xaf91('0x27')][_0x1dcfb1][_0xaf91('0x12')]['status']='error';this[_0xaf91('0x27')][_0x1dcfb1]['Imap']['messageStatus']=_0x11432b;return this[_0xaf91('0x18')](_0x1dcfb1);}};EmailChannel[_0xaf91('0x29')][_0xaf91('0x36')]=function(_0x3e4df7,_0x13ea26){return this['smtp'][_0xaf91('0x37')](_0x3e4df7,_0x13ea26);};EmailChannel[_0xaf91('0x29')]['verifySmtp']=function(_0x2df478){var _0x499256=this;if(this[_0xaf91('0x27')][_0x2df478['id']]){if(_[_0xaf91('0x16')](this['mailAccounts'][_0x2df478['id']][_0xaf91('0x38')])){this['mailAccounts'][_0x2df478['id']][_0xaf91('0x38')]={};}this[_0xaf91('0x27')][_0x2df478['id']][_0xaf91('0x38')]['lastSync']=moment();return new BPromise(function(_0x1cff4d,_0x55b1bb){return _0x499256[_0xaf91('0x39')][_0xaf91('0x3a')](_0x2df478)['then'](function(_0x22a6c4){_0x499256[_0xaf91('0x27')][_0x2df478['id']][_0xaf91('0x38')]['status']=_0xaf91('0x3b');_0x499256[_0xaf91('0x27')][_0x2df478['id']][_0xaf91('0x38')][_0xaf91('0x14')]='';_0x499256[_0xaf91('0x18')](_0x2df478['id']);_0x1cff4d(_0x22a6c4);})[_0xaf91('0x33')](function(_0x32769b){_0x499256['mailAccounts'][_0x2df478['id']][_0xaf91('0x38')][_0xaf91('0x13')]=_0xaf91('0x25');_0x499256[_0xaf91('0x27')][_0x2df478['id']]['Smtp'][_0xaf91('0x14')]=_0x32769b;_0x499256[_0xaf91('0x18')](_0x2df478['id']);_0x55b1bb(_0x32769b);});});}return this['smtp'][_0xaf91('0x3a')](_0x2df478);};module['exports']=EmailChannel; \ No newline at end of file +var _0x2817=['active','Imap','isNil','stringify','emit','mailAccount:update','hasOwnProperty','service','provider','custom','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','status','disabled','messageStatus','connected','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapError','sendMail','send','Smtp','lastSync','verified','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','key'];(function(_0x3d89ce,_0x5d5e4b){var _0x494a2e=function(_0x1222b8){while(--_0x1222b8){_0x3d89ce['push'](_0x3d89ce['shift']());}};_0x494a2e(++_0x5d5e4b);}(_0x2817,0x95));var _0x7281=function(_0x28902f,_0x2a8dbf){_0x28902f=_0x28902f-0x0;var _0x4a4f6d=_0x2817[_0x28902f];return _0x4a4f6d;};'use strict';var _=require('lodash');var moment=require(_0x7281('0x0'));var BPromise=require(_0x7281('0x1'));var md5=require(_0x7281('0x2'));var Redis=require(_0x7281('0x3'));var config=require(_0x7281('0x4'));var logger=require(_0x7281('0x5'))(_0x7281('0x6'));config[_0x7281('0x7')]=_[_0x7281('0x8')](config[_0x7281('0x7')],{'host':_0x7281('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7281('0x7')]));var EmailImap=require(_0x7281('0xa'));var EmailSmtp=require(_0x7281('0xb'));var mailAccount=require(_0x7281('0xc'));var md5Accounts={};function EmailChannel(_0x5e06e2){logger[_0x7281('0xd')]('start\x20email\x20channel');this[_0x7281('0xe')]=_0x5e06e2[_0x7281('0xe')];this[_0x7281('0xf')]={};this[_0x7281('0x10')]=new EmailSmtp();}EmailChannel[_0x7281('0x11')]['emit']=function(_0x4ced00){var _0x3a87df=this[_0x7281('0xe')][_0x4ced00];var _0x339c83={'id':_0x3a87df['id'],'name':_0x3a87df['name'],'key':_0x3a87df[_0x7281('0x12')],'active':_0x3a87df[_0x7281('0x13')],'Imap':{'status':_0x3a87df[_0x7281('0x14')]['status'],'messageStatus':_0x3a87df[_0x7281('0x14')]['messageStatus'],'total':_0x3a87df[_0x7281('0x14')]['total']}};if(_[_0x7281('0x15')](md5Accounts[_0x4ced00])){md5Accounts[_0x4ced00]={};}var _0x58bd3e=md5(JSON[_0x7281('0x16')](_0x339c83));if(md5Accounts[_0x4ced00][_0x7281('0x2')]!==_0x58bd3e){md5Accounts[_0x4ced00][_0x7281('0x2')]=_0x58bd3e;io[_0x7281('0x17')](_0x7281('0x18'),_0x339c83);}};EmailChannel[_0x7281('0x11')]['refresh']=function(_0x36b951){for(var _0x1b8544 in _0x36b951){if(_0x36b951[_0x7281('0x19')](_0x1b8544)){if(_0x36b951[_0x1b8544][_0x7281('0x14')]&&_0x36b951[_0x1b8544][_0x7281('0x13')]){var _0x5bb8c2=_0x36b951[_0x1b8544]['Imap'];if(!_0x5bb8c2[_0x7281('0x1a')]&&_0x36b951[_0x1b8544][_0x7281('0x1b')]!==_0x7281('0x1c'))_0x5bb8c2['service']=_0x36b951[_0x1b8544][_0x7281('0x1b')];if(!this['imapAccounts']['hasOwnProperty'](_0x5bb8c2['id'])){this[_0x7281('0xf')][_0x5bb8c2['id']]=new EmailImap(_0x5bb8c2,_0x36b951[_0x1b8544][_0x7281('0x6')]);this[_0x7281('0xf')][_0x5bb8c2['id']]['on']('box',this[_0x7281('0x1d')][_0x7281('0x1e')](this,_0x1b8544));this[_0x7281('0xf')][_0x5bb8c2['id']]['on'](_0x7281('0x6'),this[_0x7281('0x1f')][_0x7281('0x1e')](this,_0x1b8544));this['imapAccounts'][_0x5bb8c2['id']]['on'](_0x7281('0x20'),this[_0x7281('0x21')][_0x7281('0x1e')](this,_0x1b8544));this['imapAccounts'][_0x5bb8c2['id']]['on'](_0x7281('0x22'),this['handleImapError'][_0x7281('0x1e')](this,_0x1b8544));}}else{if(_[_0x7281('0x15')](this['mailAccounts'][_0x1b8544]['Imap'])){this[_0x7281('0xe')][_0x1b8544][_0x7281('0x14')]={};}this[_0x7281('0xe')][_0x1b8544][_0x7281('0x14')][_0x7281('0x23')]=_0x7281('0x24');this[_0x7281('0xe')][_0x1b8544]['Imap'][_0x7281('0x25')]='';this[_0x7281('0x17')](_0x1b8544);}}}};EmailChannel[_0x7281('0x11')][_0x7281('0x1d')]=function(_0x46f698,_0x46939f){if(this[_0x7281('0xe')][_0x46f698]){this[_0x7281('0xe')][_0x46f698][_0x7281('0x14')][_0x7281('0x23')]=_0x7281('0x26');this['mailAccounts'][_0x46f698][_0x7281('0x14')][_0x7281('0x25')]=_0x46939f[_0x7281('0x27')];if(_0x46939f[_0x7281('0x28')]){this[_0x7281('0xe')][_0x46f698]['Imap'][_0x7281('0x29')]=_0x46939f[_0x7281('0x28')][_0x7281('0x29')];}return this['emit'](_0x46f698);}};EmailChannel[_0x7281('0x11')][_0x7281('0x1f')]=function(_0x5f1521,_0x5dd5c7){logger['info'](_0x7281('0x2a'),_0x5dd5c7['firstName'],_0x5dd5c7[_0x7281('0x2b')],_0x5dd5c7['from'],_0x5f1521);if(this['mailAccounts'][_0x5f1521]){return mailAccount[_0x7281('0x2c')](_0x5f1521,_0x5dd5c7)[_0x7281('0x2d')](function(_0x1aab30){if(_0x1aab30){logger['info'](_0x7281('0x2e'));}})[_0x7281('0x2f')](function(_0x47c7a8){logger['error'](_0x7281('0x30'),JSON[_0x7281('0x16')](_0x47c7a8));});}};EmailChannel['prototype']['handleImapEnd']=function(_0xf49891){if(this['mailAccounts'][_0xf49891]&&this[_0x7281('0xe')][_0xf49891][_0x7281('0x14')]){if(this[_0x7281('0xf')][this[_0x7281('0xe')][_0xf49891][_0x7281('0x14')]['id']]){delete this[_0x7281('0xf')][this[_0x7281('0xe')][_0xf49891][_0x7281('0x14')]['id']];}this['mailAccounts'][_0xf49891][_0x7281('0x14')]['lastSync']=moment();this[_0x7281('0x17')](_0xf49891);}};EmailChannel[_0x7281('0x11')][_0x7281('0x31')]=function(_0xdbf65a,_0x9f6942){if(this[_0x7281('0xe')][_0xdbf65a]){this[_0x7281('0xe')][_0xdbf65a]['Imap'][_0x7281('0x23')]='error';this[_0x7281('0xe')][_0xdbf65a]['Imap'][_0x7281('0x25')]=_0x9f6942;return this[_0x7281('0x17')](_0xdbf65a);}};EmailChannel[_0x7281('0x11')][_0x7281('0x32')]=function(_0x2f761e,_0x1a2d56){return this['smtp'][_0x7281('0x33')](_0x2f761e,_0x1a2d56);};EmailChannel['prototype']['verifySmtp']=function(_0x39edb8){var _0x2c91a2=this;if(this[_0x7281('0xe')][_0x39edb8['id']]){if(_['isNil'](this[_0x7281('0xe')][_0x39edb8['id']][_0x7281('0x34')])){this[_0x7281('0xe')][_0x39edb8['id']][_0x7281('0x34')]={};}this[_0x7281('0xe')][_0x39edb8['id']]['Smtp'][_0x7281('0x35')]=moment();return new BPromise(function(_0x21a156,_0x29a9fc){return _0x2c91a2[_0x7281('0x10')]['verify'](_0x39edb8)['then'](function(_0x3348b4){_0x2c91a2[_0x7281('0xe')][_0x39edb8['id']]['Smtp'][_0x7281('0x23')]=_0x7281('0x36');_0x2c91a2['mailAccounts'][_0x39edb8['id']][_0x7281('0x34')][_0x7281('0x25')]='';_0x2c91a2['emit'](_0x39edb8['id']);_0x21a156(_0x3348b4);})[_0x7281('0x2f')](function(_0x5283b4){_0x2c91a2['mailAccounts'][_0x39edb8['id']][_0x7281('0x34')][_0x7281('0x23')]=_0x7281('0x22');_0x2c91a2[_0x7281('0xe')][_0x39edb8['id']][_0x7281('0x34')][_0x7281('0x25')]=_0x5283b4;_0x2c91a2['emit'](_0x39edb8['id']);_0x29a9fc(_0x5283b4);});});}return this[_0x7281('0x10')]['verify'](_0x39edb8);};module[_0x7281('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 44d4828..11d09c2 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 _0xaddf=['port','tls','autotls','required','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','textCode','hasOwnProperty','exports','lodash','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','once','ready','handleReady','error','handleError','bind','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','xoauth2','CloudProvider','data5','password','authentication','anonymous@xcally.com','host'];(function(_0x23f164,_0x4df3cf){var _0xa2fca2=function(_0x50a7ab){while(--_0x50a7ab){_0x23f164['push'](_0x23f164['shift']());}};_0xa2fca2(++_0x4df3cf);}(_0xaddf,0x1d7));var _0xfadd=function(_0xf23629,_0x571dc7){_0xf23629=_0xf23629-0x0;var _0x5c250a=_0xaddf[_0xf23629];return _0x5c250a;};'use strict';var _=require(_0xfadd('0x0'));var util=require(_0xfadd('0x1'));var Imap=require(_0xfadd('0x2'));var simpleParser=require('mailparser')[_0xfadd('0x3')];var Iconv=require(_0xfadd('0x4'))[_0xfadd('0x5')];var EventEmitter=require(_0xfadd('0x6'))[_0xfadd('0x7')];var utils=require(_0xfadd('0x8'));var logger=require(_0xfadd('0x9'))(_0xfadd('0xa'));function EmailImap(_0x11fbe7,_0x88107d){this['mailbox']=_0x11fbe7[_0xfadd('0xb')];this[_0xfadd('0xc')]=this['getAccount'](_0x11fbe7,_0x88107d);this[_0xfadd('0x2')]=new Imap(this[_0xfadd('0xc')]);this['imap'][_0xfadd('0xd')](_0xfadd('0xe'),this[_0xfadd('0xf')]['bind'](this));this[_0xfadd('0x2')][_0xfadd('0xd')]('end',this['handleEnd']['bind'](this));this['imap']['on'](_0xfadd('0x10'),this[_0xfadd('0x11')][_0xfadd('0x12')](this));this[_0xfadd('0x2')]['connect']();}util[_0xfadd('0x13')](EmailImap,EventEmitter);EmailImap[_0xfadd('0x14')][_0xfadd('0x15')]=function(_0x1af10d,_0x40f626){var _0x57f641={'connTimeout':_0x1af10d[_0xfadd('0x16')]?_0x1af10d[_0xfadd('0x16')]*0x3e8:0x2710,'authTimeout':_0x1af10d[_0xfadd('0x17')]?_0x1af10d[_0xfadd('0x17')]*0x3e8:0x1388};if(_0x1af10d[_0xfadd('0x18')]){_0x57f641['user']=_0x1af10d[_0xfadd('0x19')];if(_0x1af10d['modernAuthentication']){_0x57f641[_0xfadd('0x1a')]=utils['generateXOAuth2Token'](_0x1af10d[_0xfadd('0x1b')][_0xfadd('0x1c')],_0x1af10d['user']);}else{_0x57f641[_0xfadd('0x1d')]=_0x1af10d[_0xfadd('0x1d')];}}else{if(_0x1af10d[_0xfadd('0x1e')]){_0x57f641['user']=_0x1af10d['user'];_0x57f641[_0xfadd('0x1d')]=_0x1af10d[_0xfadd('0x1d')];}}_0x57f641[_0xfadd('0xa')]=_0x40f626||_0x1af10d['user']||_0xfadd('0x1f');_0x57f641[_0xfadd('0x20')]=_0x1af10d['host'];_0x57f641[_0xfadd('0x21')]=_0x1af10d[_0xfadd('0x21')]||0x3e1;if(_0x1af10d[_0xfadd('0x22')]){_0x57f641[_0xfadd('0x22')]=!![];}else{_0x57f641[_0xfadd('0x22')]=![];_0x57f641[_0xfadd('0x23')]=_0xfadd('0x24');}return _0x57f641;};EmailImap[_0xfadd('0x14')][_0xfadd('0xf')]=function(){this[_0xfadd('0x2')]['openBox'](this['mailbox'],![],this['handleOpenBox']['bind'](this));};EmailImap['prototype'][_0xfadd('0x25')]=function(_0x323b84,_0x36a3da){if(_0x323b84){this['handleError'](_0x323b84,!![]);}else{this[_0xfadd('0x26')](_0xfadd('0x27'),_0x36a3da);this[_0xfadd('0x28')]();}};EmailImap[_0xfadd('0x14')][_0xfadd('0x29')]=function(_0x332140){if(_0x332140){this[_0xfadd('0x11')](_0x332140,!![]);}else{this['imap']['end']();}};EmailImap[_0xfadd('0x14')][_0xfadd('0x28')]=function(){this[_0xfadd('0x2')][_0xfadd('0x2a')]([_0xfadd('0x2b')],this[_0xfadd('0x2c')][_0xfadd('0x12')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x462065,_0x2fae7c){if(_0x462065){this[_0xfadd('0x11')](_0x462065,!![]);}else{if(_0x2fae7c[_0xfadd('0x2d')]){try{var _0x404430=this[_0xfadd('0x2')][_0xfadd('0x2e')](_0x2fae7c,{'bodies':'','markSeen':!![]});_0x404430['on']('message',this[_0xfadd('0x2f')]['bind'](this));_0x404430[_0xfadd('0xd')](_0xfadd('0x10'),this[_0xfadd('0x30')][_0xfadd('0x12')](this));_0x404430[_0xfadd('0xd')](_0xfadd('0x31'),this[_0xfadd('0x32')]['bind'](this));}catch(_0x14e31f){logger[_0xfadd('0x10')](_0x14e31f);}}else{this[_0xfadd('0x2')][_0xfadd('0x33')](!![],this[_0xfadd('0x29')][_0xfadd('0x12')](this));}}};EmailImap[_0xfadd('0x14')][_0xfadd('0x2f')]=function(_0xaf2876){_0xaf2876['on'](_0xfadd('0x34'),this[_0xfadd('0x35')][_0xfadd('0x12')](this));_0xaf2876['once'](_0xfadd('0x36'),this[_0xfadd('0x37')]['bind'](this));_0xaf2876['once'](_0xfadd('0x31'),this[_0xfadd('0x38')][_0xfadd('0x12')](this));};EmailImap['prototype'][_0xfadd('0x35')]=function(_0x3631f0){simpleParser(_0x3631f0,{'Iconv':Iconv},this['handleSimpleParser'][_0xfadd('0x12')](this));};EmailImap[_0xfadd('0x14')][_0xfadd('0x37')]=function(){};EmailImap[_0xfadd('0x14')][_0xfadd('0x38')]=function(){};EmailImap['prototype'][_0xfadd('0x39')]=function(_0x5d99f5,_0x57a789){if(_0x5d99f5){logger[_0xfadd('0x10')](_0x5d99f5);}else{var _0x3ba838=this;utils[_0xfadd('0x3a')](this[_0xfadd('0xc')],_0x57a789,function(_0x5fcec8){_0x3ba838[_0xfadd('0x26')](_0xfadd('0xa'),_0x5fcec8);});}};EmailImap['prototype'][_0xfadd('0x32')]=function(){this['imap']['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0xfadd('0x30')]=function(_0x5e472b){this[_0xfadd('0x11')](_0x5e472b);this[_0xfadd('0x2')][_0xfadd('0x33')](!![],this[_0xfadd('0x29')][_0xfadd('0x12')](this));};EmailImap[_0xfadd('0x14')][_0xfadd('0x3b')]=function(){this[_0xfadd('0x26')](_0xfadd('0x31'));};EmailImap[_0xfadd('0x14')][_0xfadd('0x11')]=function(_0x179cd0,_0x4a3eb2){logger[_0xfadd('0x10')]('handleError',this[_0xfadd('0xc')][_0xfadd('0xa')],JSON['stringify'](_0x179cd0));var _0x442b31='';if(_0x179cd0){if(_0x179cd0[_0xfadd('0x3c')]){_0x442b31=_0x179cd0[_0xfadd('0x3c')];}else{for(var _0xc32d4d in _0x179cd0){if(_0x179cd0[_0xfadd('0x3d')](_0xc32d4d)){_0x442b31+=_['upperFirst'](_0xc32d4d)+':\x20'+_0x179cd0[_0xc32d4d]+'\x0a';}}}}if(_0x4a3eb2){this[_0xfadd('0x2')]['end']();}else{this[_0xfadd('0x26')](_0xfadd('0x10'),_0x442b31);this[_0xfadd('0x26')](_0xfadd('0x31'));}};module[_0xfadd('0x3e')]=EmailImap; \ No newline at end of file +var _0x1224=['handleFetchMessage','error','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','account','handleFetchError','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','imap','once','handleReady','end','handleError','bind','connect','inherits','prototype','getAccount','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message'];(function(_0x44ca9c,_0xb2050){var _0x463a7f=function(_0x539b87){while(--_0x539b87){_0x44ca9c['push'](_0x44ca9c['shift']());}};_0x463a7f(++_0xb2050);}(_0x1224,0x92));var _0x4122=function(_0x2e1591,_0x1f0cfc){_0x2e1591=_0x2e1591-0x0;var _0x43c542=_0x1224[_0x2e1591];return _0x43c542;};'use strict';var _=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x4122('0x2'))[_0x4122('0x3')];var EventEmitter=require(_0x4122('0x4'))[_0x4122('0x5')];var utils=require(_0x4122('0x6'));var logger=require(_0x4122('0x7'))('email');function EmailImap(_0x47ac65,_0x4d804c){this[_0x4122('0x8')]=_0x47ac65[_0x4122('0x8')];this['account']=this['getAccount'](_0x47ac65,_0x4d804c);this[_0x4122('0x9')]=new Imap(this['account']);this['imap'][_0x4122('0xa')]('ready',this[_0x4122('0xb')]['bind'](this));this[_0x4122('0x9')][_0x4122('0xa')](_0x4122('0xc'),this['handleEnd']['bind'](this));this[_0x4122('0x9')]['on']('error',this[_0x4122('0xd')][_0x4122('0xe')](this));this[_0x4122('0x9')][_0x4122('0xf')]();}util[_0x4122('0x10')](EmailImap,EventEmitter);EmailImap[_0x4122('0x11')][_0x4122('0x12')]=function(_0x412375,_0x26cdbb){var _0x57d677={'connTimeout':_0x412375['connTimeout']?_0x412375[_0x4122('0x13')]*0x3e8:0x2710,'authTimeout':_0x412375[_0x4122('0x14')]?_0x412375['authTimeout']*0x3e8:0x1388};if(_0x412375['service']){_0x57d677[_0x4122('0x15')]=_0x412375[_0x4122('0x15')];if(_0x412375[_0x4122('0x16')]){_0x57d677[_0x4122('0x17')]=utils[_0x4122('0x18')](_0x412375[_0x4122('0x19')][_0x4122('0x1a')],_0x412375[_0x4122('0x15')]);}else{_0x57d677[_0x4122('0x1b')]=_0x412375[_0x4122('0x1b')];}}else{if(_0x412375[_0x4122('0x1c')]){_0x57d677[_0x4122('0x15')]=_0x412375[_0x4122('0x15')];_0x57d677['password']=_0x412375[_0x4122('0x1b')];}}_0x57d677[_0x4122('0x1d')]=_0x26cdbb||_0x412375['user']||_0x4122('0x1e');_0x57d677[_0x4122('0x1f')]=_0x412375[_0x4122('0x1f')];_0x57d677[_0x4122('0x20')]=_0x412375[_0x4122('0x20')]||0x3e1;if(_0x412375[_0x4122('0x21')]){_0x57d677[_0x4122('0x21')]=!![];}else{_0x57d677[_0x4122('0x21')]=![];_0x57d677[_0x4122('0x22')]='required';}return _0x57d677;};EmailImap[_0x4122('0x11')]['handleReady']=function(){this['imap'][_0x4122('0x23')](this[_0x4122('0x8')],![],this[_0x4122('0x24')][_0x4122('0xe')](this));};EmailImap[_0x4122('0x11')][_0x4122('0x24')]=function(_0x22ea3d,_0x250e7f){if(_0x22ea3d){this[_0x4122('0xd')](_0x22ea3d,!![]);}else{this[_0x4122('0x25')]('box',_0x250e7f);this[_0x4122('0x26')]();}};EmailImap[_0x4122('0x11')][_0x4122('0x27')]=function(_0xdd6e3){if(_0xdd6e3){this[_0x4122('0xd')](_0xdd6e3,!![]);}else{this[_0x4122('0x9')][_0x4122('0xc')]();}};EmailImap['prototype'][_0x4122('0x26')]=function(){this[_0x4122('0x9')][_0x4122('0x28')]([_0x4122('0x29')],this[_0x4122('0x2a')][_0x4122('0xe')](this));};EmailImap[_0x4122('0x11')]['handleReadUnseen']=function(_0x50becd,_0x1b32cc){if(_0x50becd){this[_0x4122('0xd')](_0x50becd,!![]);}else{if(_0x1b32cc[_0x4122('0x2b')]){try{var _0x1036e3=this[_0x4122('0x9')][_0x4122('0x2c')](_0x1b32cc,{'bodies':'','markSeen':!![]});_0x1036e3['on'](_0x4122('0x2d'),this[_0x4122('0x2e')][_0x4122('0xe')](this));_0x1036e3[_0x4122('0xa')](_0x4122('0x2f'),this['handleFetchError']['bind'](this));_0x1036e3[_0x4122('0xa')](_0x4122('0xc'),this[_0x4122('0x30')][_0x4122('0xe')](this));}catch(_0x55f40b){logger['error'](_0x55f40b);}}else{this[_0x4122('0x9')][_0x4122('0x31')](!![],this[_0x4122('0x27')][_0x4122('0xe')](this));}}};EmailImap[_0x4122('0x11')][_0x4122('0x2e')]=function(_0x12bfd1){_0x12bfd1['on'](_0x4122('0x32'),this[_0x4122('0x33')][_0x4122('0xe')](this));_0x12bfd1[_0x4122('0xa')](_0x4122('0x34'),this[_0x4122('0x35')][_0x4122('0xe')](this));_0x12bfd1[_0x4122('0xa')]('end',this['handleMessageEnd'][_0x4122('0xe')](this));};EmailImap['prototype'][_0x4122('0x33')]=function(_0x23d969){simpleParser(_0x23d969,{'Iconv':Iconv},this['handleSimpleParser'][_0x4122('0xe')](this));};EmailImap[_0x4122('0x11')][_0x4122('0x35')]=function(){};EmailImap[_0x4122('0x11')]['handleMessageEnd']=function(){};EmailImap[_0x4122('0x11')][_0x4122('0x36')]=function(_0x2cb723,_0x3af8ae){if(_0x2cb723){logger[_0x4122('0x2f')](_0x2cb723);}else{var _0x544505=this;utils[_0x4122('0x37')](this[_0x4122('0x38')],_0x3af8ae,function(_0x5925dc){_0x544505[_0x4122('0x25')](_0x4122('0x1d'),_0x5925dc);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x4122('0x9')][_0x4122('0x31')](!![],this[_0x4122('0x27')][_0x4122('0xe')](this));};EmailImap[_0x4122('0x11')][_0x4122('0x39')]=function(_0x56a024){this['handleError'](_0x56a024);this['imap'][_0x4122('0x31')](!![],this['handleCloseBox'][_0x4122('0xe')](this));};EmailImap[_0x4122('0x11')][_0x4122('0x3a')]=function(){this[_0x4122('0x25')](_0x4122('0xc'));};EmailImap[_0x4122('0x11')][_0x4122('0xd')]=function(_0x2457a8,_0x1a9810){logger[_0x4122('0x2f')](_0x4122('0xd'),this['account'][_0x4122('0x1d')],JSON[_0x4122('0x3b')](_0x2457a8));var _0x3665a1='';if(_0x2457a8){if(_0x2457a8[_0x4122('0x3c')]){_0x3665a1=_0x2457a8['textCode'];}else{for(var _0x3e0576 in _0x2457a8){if(_0x2457a8[_0x4122('0x3d')](_0x3e0576)){_0x3665a1+=_[_0x4122('0x3e')](_0x3e0576)+':\x20'+_0x2457a8[_0x3e0576]+'\x0a';}}}}if(_0x1a9810){this[_0x4122('0x9')][_0x4122('0xc')]();}else{this[_0x4122('0x25')](_0x4122('0x2f'),_0x3665a1);this[_0x4122('0x25')](_0x4122('0xc'));}};module[_0x4122('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 1a3f093..76b54df 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 _0x56a9=['toString','verify','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail'];(function(_0x2879a6,_0x3ad19a){var _0x4a8f34=function(_0x58a92b){while(--_0x58a92b){_0x2879a6['push'](_0x2879a6['shift']());}};_0x4a8f34(++_0x3ad19a);}(_0x56a9,0x77));var _0x956a=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x56a9[_0x121886];return _0x20ca01;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x956a('0x0'));function EmailSmtp(){}EmailSmtp[_0x956a('0x1')][_0x956a('0x2')]=function(_0x23641f,_0x488843){return new Promise(function(_0x1fac48,_0x368a7a){var _0x6ebfbd=nodemailer[_0x956a('0x3')](_0x23641f);_0x6ebfbd[_0x956a('0x4')](_0x956a('0x5'),inlineBase64());_0x6ebfbd[_0x956a('0x6')](_0x488843,function(_0x2fe074,_0x5880bc){if(_0x2fe074){_0x368a7a(_0x2fe074[_0x956a('0x7')]());}else{_0x1fac48(_0x5880bc);}});});};EmailSmtp[_0x956a('0x1')]['verify']=function(_0x6601cd){return new Promise(function(_0x2950e7,_0x4340dc){var _0x21afbf=nodemailer[_0x956a('0x3')](_0x6601cd);_0x21afbf[_0x956a('0x8')](function(_0x1e8519,_0x549616){if(_0x1e8519){_0x4340dc(_0x1e8519[_0x956a('0x7')]());}else{if(_0x549616){_0x2950e7(_0x549616);}else{_0x4340dc('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xcc9c=['exports','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xcc9c,0x119));var _0xccc9=function(_0x3912f5,_0x47c54a){_0x3912f5=_0x3912f5-0x0;var _0x53453f=_0xcc9c[_0x3912f5];return _0x53453f;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xccc9('0x0'));function EmailSmtp(){}EmailSmtp[_0xccc9('0x1')]['send']=function(_0x2d7342,_0x2c3ece){return new Promise(function(_0xeae830,_0x2fb33e){var _0xf7869f=nodemailer[_0xccc9('0x2')](_0x2d7342);_0xf7869f[_0xccc9('0x3')](_0xccc9('0x4'),inlineBase64());_0xf7869f[_0xccc9('0x5')](_0x2c3ece,function(_0x413417,_0x216c7d){if(_0x413417){_0x2fb33e(_0x413417[_0xccc9('0x6')]());}else{_0xeae830(_0x216c7d);}});});};EmailSmtp[_0xccc9('0x1')][_0xccc9('0x7')]=function(_0x617960){return new Promise(function(_0x1c594c,_0x2fae88){var _0x25c5c8=nodemailer[_0xccc9('0x2')](_0x617960);_0x25c5c8['verify'](function(_0x4e3f37,_0x12ac80){if(_0x4e3f37){_0x2fae88(_0x4e3f37[_0xccc9('0x6')]());}else{if(_0x12ac80){_0x1c594c(_0x12ac80);}else{_0x2fae88(_0xccc9('0x8'));}}});});};module[_0xccc9('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 5969fdb..d11fd2b 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 _0x63db=['pop','isEmpty','generate','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','join','utf-8','toString','base64','lodash','moment','path','node-tnef','../../../config/logger','value','address','anonymous','head','name','substring','indexOf','split','length','slice','Anonymous'];(function(_0x271d2f,_0x421a09){var _0x152e10=function(_0x1d6f56){while(--_0x1d6f56){_0x271d2f['push'](_0x271d2f['shift']());}};_0x152e10(++_0x421a09);}(_0x63db,0x1e8));var _0xb63d=function(_0x524a18,_0xfe22aa){_0x524a18=_0x524a18-0x0;var _0x51dc67=_0x63db[_0x524a18];return _0x51dc67;};'use strict';var _=require(_0xb63d('0x0'));var moment=require(_0xb63d('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xb63d('0x2'));var util=require('util');var tnef=require(_0xb63d('0x3'));var logger=require(_0xb63d('0x4'))('email');var config=require('../../../config/environment');function getAddress(_0xf20524){var _0x11d8d9=_['head'](_0xf20524[_0xb63d('0x5')]);return _0x11d8d9&&_0x11d8d9[_0xb63d('0x6')]?_0x11d8d9[_0xb63d('0x6')]:_0xb63d('0x7')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x4b688a){var _0x48a81d=_[_0xb63d('0x8')](_0x4b688a[_0xb63d('0x5')]);if(_0x48a81d&&_0x48a81d['name']){if(_0x48a81d[_0xb63d('0x9')]==_0x48a81d[_0xb63d('0x6')]){return _0x48a81d[_0xb63d('0x9')][_0xb63d('0xa')](0x0,_0x48a81d['name'][_0xb63d('0xb')]('@'));}var _0x44a289=_0x48a81d[_0xb63d('0x9')][_0xb63d('0xc')](/\s+/);return _0x44a289[_0xb63d('0xd')]>0x1?_0x44a289[_0xb63d('0xe')](0x0,-0x1)['join']('\x20'):_0x48a81d[_0xb63d('0x9')];}return _0xb63d('0xf');}function getLastName(_0x5bf51c){var _0x2b471e=_[_0xb63d('0x8')](_0x5bf51c['value']);if(_0x2b471e&&_0x2b471e['name']){var _0x55d9a6=_0x2b471e['name'][_0xb63d('0xc')](/\s+/);return _0x55d9a6['length']>0x1?_0x55d9a6[_0xb63d('0x10')]():'';}return'';}function getMails(_0x57c242,_0x4e7d73){var _0x517d4a='';for(var _0x3c14ab=0x0;_0x3c14ab<_0x4e7d73[_0xb63d('0x5')][_0xb63d('0xd')];_0x3c14ab+=0x1){if(_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x6')]!==_0x57c242){if(!_[_0xb63d('0x11')](_0x517d4a)){_0x517d4a+=',';}_0x517d4a+=_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x9')]||_0x4e7d73['value'][_0x3c14ab][_0xb63d('0x6')]||'';_0x517d4a+='\x20<';_0x517d4a+=_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x6')]?_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x6')]:_0xb63d('0x7')+random[_0xb63d('0x12')](0x6)+_0xb63d('0x13');_0x517d4a+='>';}}return _0x517d4a;}function parseEmail(_0xb232a0,_0x58a785,_0xcfc86a){if(_0x58a785[_0xb63d('0x14')]){var _0x117ec8=/)<[^<]*)*<\/script>/gi;while(_0x117ec8[_0xb63d('0x15')](_0x58a785[_0xb63d('0x14')])){_0x58a785[_0xb63d('0x14')]=_0x58a785['html'][_0xb63d('0x16')](_0x117ec8,'');}if(_0x58a785[_0xb63d('0x14')][_0xb63d('0x17')](_0xb63d('0x18'))){var _0x21108c=[];_0x58a785[_0xb63d('0x19')]['forEach'](_0x39a9f1=>{_0x21108c[_0xb63d('0x1a')](_0x39a9f1[_0xb63d('0x1b')]);});var _0x3537b3=/]+>/g;var _0x2a4bc6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2aafa5=_0x58a785[_0xb63d('0x14')][_0xb63d('0x16')](_0x2a4bc6,_0xb63d('0x1c'));var _0x595e3d=_0x2aafa5[_0xb63d('0x16')](_0x3537b3,_0xb63d('0x1d'));for(let _0x29204b=0x0;_0x29204b<_0x21108c['length'];_0x29204b++){var _0xab8638=_0x595e3d[_0xb63d('0x16')]('_IMG',_0xb63d('0x1e')+_0x21108c[_0x29204b]+_0xb63d('0x1f'));_0x595e3d=_0xab8638;}_0x58a785[_0xb63d('0x14')]=_0x595e3d;}_0xcfc86a[_0xb63d('0x20')]=_0x58a785['html'];}else{_0xcfc86a[_0xb63d('0x20')]=_0x58a785[_0xb63d('0x21')];}if(_0xcfc86a[_0xb63d('0x20')]){_0xcfc86a[_0xb63d('0x20')]=_0xcfc86a[_0xb63d('0x20')][_0xb63d('0x16')](/0x0){var _0x595050=[_0xb63d('0x32'),_0xb63d('0x33'),_0xb63d('0x34')];for(var _0x66bcee=0x0;_0x66bcee<_0x58a785[_0xb63d('0x31')][_0xb63d('0xd')];_0x66bcee++){var _0x3f9301=_['indexOf'](_0x595050,_0x58a785[_0xb63d('0x31')][_0x66bcee][_0xb63d('0x35')]);if(_0x3f9301>=0x0){_0xcfc86a[_0xb63d('0x36')]=!![];}}}return _0xcfc86a;}exports['parser']=function(_0x5cea0f,_0x169669,_0x7b358e){var _0x2d0e34={'from':getAddress(_0x169669['from']),'firstName':getFirstName(_0x169669[_0xb63d('0x37')]),'lastName':getLastName(_0x169669[_0xb63d('0x37')]),'mapKey':_0xb63d('0x25'),'message':{'from':getMails(_0x5cea0f['email'],_0x169669[_0xb63d('0x37')]),'to':_0x5cea0f[_0xb63d('0x25')],'cc':'','subject':_0x169669[_0xb63d('0x38')]||'','messageId':_0x169669[_0xb63d('0x39')],'inReplyTo':_0x169669[_0xb63d('0x3a')],'sentAt':moment(_0x169669['date'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x169669[_0xb63d('0x14')]&&!_0x169669['textAsHtml']){var _0x108f3d=_[_0xb63d('0x3b')](_0x169669['attachments'],{'contentType':_0xb63d('0x3c')});if(_0x108f3d[_0xb63d('0xd')]){logger['info'](util[_0xb63d('0x3d')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x169669[_0xb63d('0x39')]));tnef['parseBuffer'](_['first'](_0x108f3d)[_0xb63d('0x2f')],function(_0x5703ef,_0x1049ea){if(_0x1049ea){_0x169669['html']=_0x1049ea['BodyHTML']||_0xb63d('0x3e');if(_0x1049ea[_0xb63d('0x3f')]){for(var _0x2fe2ef=0x0;_0x2fe2ef<_0x1049ea['Attachments']['length'];_0x2fe2ef++){var _0xd2fdbf=_0x1049ea[_0xb63d('0x3f')][_0x2fe2ef];_0x2d0e34[_0xb63d('0x23')]['attachments'][_0xb63d('0x1a')]({'filename':_0xd2fdbf['Title'],'content':Buffer[_0xb63d('0x37')](_0xd2fdbf[_0xb63d('0x40')])});}}}_0x7b358e(parseEmail(_0x5cea0f,_0x169669,_0x2d0e34));});}else{_0x169669['html']='

Empty\x20message

';_0x7b358e(parseEmail(_0x5cea0f,_0x169669,_0x2d0e34));}}else{_0x7b358e(parseEmail(_0x5cea0f,_0x169669,_0x2d0e34));}};exports[_0xb63d('0x41')]=function(_0x3f497a,_0x332fb8){var _0x1da408=[_0xb63d('0x42')+(_0x332fb8||''),_0xb63d('0x43')+_0x3f497a,'',''];return Buffer[_0xb63d('0x37')](_0x1da408[_0xb63d('0x44')](''),_0xb63d('0x45'))[_0xb63d('0x46')](_0xb63d('0x47'));}; \ No newline at end of file +var _0x5821=['bcc','type','attachment','filename','attachment-','format','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','

Empty\x20message

','Attachments','Title','from','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','node-tnef','../../../config/logger','email','../../../config/environment','address','@xcally.com','value','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','generate','html','test','replace','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x25bc8c[_0x1582('0xf')](0x0,-0x1)[_0x1582('0x10')]('\x20'):_0x5746fd['name'];}return _0x1582('0x11');}function getLastName(_0xb4728d){var _0xa774a=_['head'](_0xb4728d[_0x1582('0x9')]);if(_0xa774a&&_0xa774a['name']){var _0x2e7ce0=_0xa774a['name'][_0x1582('0xd')](/\s+/);return _0x2e7ce0[_0x1582('0xe')]>0x1?_0x2e7ce0[_0x1582('0x12')]():'';}return'';}function getMails(_0x12fe2d,_0x538cfd){var _0x17bbb8='';for(var _0x365d96=0x0;_0x365d96<_0x538cfd[_0x1582('0x9')][_0x1582('0xe')];_0x365d96+=0x1){if(_0x538cfd[_0x1582('0x9')][_0x365d96][_0x1582('0x7')]!==_0x12fe2d){if(!_[_0x1582('0x13')](_0x17bbb8)){_0x17bbb8+=',';}_0x17bbb8+=_0x538cfd[_0x1582('0x9')][_0x365d96][_0x1582('0xa')]||_0x538cfd['value'][_0x365d96]['address']||'';_0x17bbb8+='\x20<';_0x17bbb8+=_0x538cfd['value'][_0x365d96]['address']?_0x538cfd[_0x1582('0x9')][_0x365d96]['address']:_0x1582('0x14')+random[_0x1582('0x15')](0x6)+_0x1582('0x8');_0x17bbb8+='>';}}return _0x17bbb8;}function parseEmail(_0x570bbb,_0x2f4d4c,_0x2fc7c9){if(_0x2f4d4c[_0x1582('0x16')]){var _0xeeeabb=/)<[^<]*)*<\/script>/gi;while(_0xeeeabb[_0x1582('0x17')](_0x2f4d4c[_0x1582('0x16')])){_0x2f4d4c[_0x1582('0x16')]=_0x2f4d4c['html'][_0x1582('0x18')](_0xeeeabb,'');}if(_0x2f4d4c['html'][_0x1582('0x19')](_0x1582('0x1a'))){var _0x365d05=[];_0x2f4d4c[_0x1582('0x1b')][_0x1582('0x1c')](_0x1d1617=>{_0x365d05[_0x1582('0x1d')](_0x1d1617['filename']);});var _0x45c116=/]+>/g;var _0x5986da=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4d20a3=_0x2f4d4c[_0x1582('0x16')][_0x1582('0x18')](_0x5986da,_0x1582('0x1e'));var _0x352725=_0x4d20a3[_0x1582('0x18')](_0x45c116,'_IMG');for(let _0x5cdef5=0x0;_0x5cdef5<_0x365d05[_0x1582('0xe')];_0x5cdef5++){var _0x2e77a6=_0x352725[_0x1582('0x18')](_0x1582('0x1f'),_0x1582('0x20')+_0x365d05[_0x5cdef5]+'\x20]');_0x352725=_0x2e77a6;}_0x2f4d4c[_0x1582('0x16')]=_0x352725;}_0x2fc7c9[_0x1582('0x21')]=_0x2f4d4c[_0x1582('0x16')];}else{_0x2fc7c9['body']=_0x2f4d4c[_0x1582('0x22')];}if(_0x2fc7c9[_0x1582('0x21')]){_0x2fc7c9[_0x1582('0x21')]=_0x2fc7c9[_0x1582('0x21')][_0x1582('0x18')](/0x0){var _0x2aeaad=[_0x1582('0x34'),_0x1582('0x35'),_0x1582('0x36')];for(var _0x602f7a=0x0;_0x602f7a<_0x2f4d4c['headerLines'][_0x1582('0xe')];_0x602f7a++){var _0x5e8282=_[_0x1582('0xc')](_0x2aeaad,_0x2f4d4c[_0x1582('0x33')][_0x602f7a]['line']);if(_0x5e8282>=0x0){_0x2fc7c9[_0x1582('0x37')]=!![];}}}return _0x2fc7c9;}exports['parser']=function(_0x2b025a,_0x22cdae,_0x1068de){var _0x582bcc={'from':getAddress(_0x22cdae['from']),'firstName':getFirstName(_0x22cdae['from']),'lastName':getLastName(_0x22cdae['from']),'mapKey':'email','message':{'from':getMails(_0x2b025a['email'],_0x22cdae['from']),'to':_0x2b025a['email'],'cc':'','subject':_0x22cdae['subject']||'','messageId':_0x22cdae[_0x1582('0x38')],'inReplyTo':_0x22cdae['inReplyTo'],'sentAt':moment(_0x22cdae[_0x1582('0x39')])[_0x1582('0x2c')](_0x1582('0x3a')),'attach':![],'attachments':[]}};if(!_0x22cdae['html']&&!_0x22cdae['textAsHtml']){var _0x3633ac=_[_0x1582('0x3b')](_0x22cdae[_0x1582('0x1b')],{'contentType':_0x1582('0x3c')});if(_0x3633ac[_0x1582('0xe')]){logger[_0x1582('0x3d')](util['format'](_0x1582('0x3e'),_0x22cdae['messageId']));tnef[_0x1582('0x3f')](_[_0x1582('0x40')](_0x3633ac)[_0x1582('0x31')],function(_0x227cc3,_0x29350d){if(_0x29350d){_0x22cdae[_0x1582('0x16')]=_0x29350d['BodyHTML']||_0x1582('0x41');if(_0x29350d[_0x1582('0x42')]){for(var _0x1416b6=0x0;_0x1416b6<_0x29350d[_0x1582('0x42')][_0x1582('0xe')];_0x1416b6++){var _0x4037db=_0x29350d[_0x1582('0x42')][_0x1416b6];_0x582bcc[_0x1582('0x25')][_0x1582('0x1b')][_0x1582('0x1d')]({'filename':_0x4037db[_0x1582('0x43')],'content':Buffer[_0x1582('0x44')](_0x4037db[_0x1582('0x45')])});}}}_0x1068de(parseEmail(_0x2b025a,_0x22cdae,_0x582bcc));});}else{_0x22cdae[_0x1582('0x16')]=_0x1582('0x41');_0x1068de(parseEmail(_0x2b025a,_0x22cdae,_0x582bcc));}}else{_0x1068de(parseEmail(_0x2b025a,_0x22cdae,_0x582bcc));}};exports[_0x1582('0x46')]=function(_0x587d01,_0x585d7c){var _0x3f8577=[_0x1582('0x47')+(_0x585d7c||''),_0x1582('0x48')+_0x587d01,'',''];return Buffer[_0x1582('0x44')](_0x3f8577[_0x1582('0x10')](''),'utf-8')[_0x1582('0x49')](_0x1582('0x4a'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 5dc3ac0..7bdb11b 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 _0xa2bf=['active','Imap','Smtp','exports','lodash','name','Service','key','SERV'];(function(_0xb07545,_0xc1e633){var _0x3db0db=function(_0x1daddc){while(--_0x1daddc){_0xb07545['push'](_0xb07545['shift']());}};_0x3db0db(++_0xc1e633);}(_0xa2bf,0x12d));var _0xfa2b=function(_0x5b270a,_0x4c1850){_0x5b270a=_0x5b270a-0x0;var _0x247c16=_0xa2bf[_0x5b270a];return _0x247c16;};'use strict';var _=require(_0xfa2b('0x0'));function MailAccount(_0x11d803){this['id']=_0x11d803['id']||0x0;this['name']=_0x11d803[_0xfa2b('0x1')]||_0xfa2b('0x2');this[_0xfa2b('0x3')]=_0x11d803[_0xfa2b('0x3')]||_0xfa2b('0x4');this[_0xfa2b('0x5')]=_0x11d803[_0xfa2b('0x5')]||![];this[_0xfa2b('0x6')]=_0x11d803['Imap']||[];this[_0xfa2b('0x7')]=_0x11d803[_0xfa2b('0x7')]||[];}module[_0xfa2b('0x8')]=MailAccount; \ No newline at end of file +var _0x9f34=['active','Imap','Smtp','exports','Service','key'];(function(_0x434d75,_0x221cfb){var _0x249f74=function(_0x4d5944){while(--_0x4d5944){_0x434d75['push'](_0x434d75['shift']());}};_0x249f74(++_0x221cfb);}(_0x9f34,0xac));var _0x49f3=function(_0x11003f,_0x2f2e95){_0x11003f=_0x11003f-0x0;var _0x15be81=_0x9f34[_0x11003f];return _0x15be81;};'use strict';var _=require('lodash');function MailAccount(_0x27f852){this['id']=_0x27f852['id']||0x0;this['name']=_0x27f852['name']||_0x49f3('0x0');this[_0x49f3('0x1')]=_0x27f852[_0x49f3('0x1')]||'SERV';this['active']=_0x27f852[_0x49f3('0x2')]||![];this['Imap']=_0x27f852[_0x49f3('0x3')]||[];this[_0x49f3('0x4')]=_0x27f852[_0x49f3('0x4')]||[];}module[_0x49f3('0x5')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 5b6a650..6b7b57c 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 _0xe7c5=['mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','lodash','mailAccounts'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0xe7c5,0x1c6));var _0x5e7c=function(_0x4ed5d7,_0x1a61a8){_0x4ed5d7=_0x4ed5d7-0x0;var _0x9a927c=_0xe7c5[_0x4ed5d7];return _0x9a927c;};'use strict';var _=require(_0x5e7c('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x5e7c('0x1')]={};};function freeIsNotKey(_0x10c11d,_0x4ae4a9,_0x2bb356){var _0xfaeae8=_[_0x5e7c('0x2')](_0x10c11d,function(_0x33c953,_0x112971){return _0x33c953[_0x2bb356];});for(var _0x491873 in _0x4ae4a9){if(_0x4ae4a9[_0x5e7c('0x3')](_0x491873)){if(!_0xfaeae8[_0x491873]){delete _0x4ae4a9[_0x491873];}}}}Realtime[_0x5e7c('0x4')]['mergeFromDatabase']=function(_0xd65c5b,_0xe5ecb6){for(var _0x39f515 in _0xe5ecb6){if(_0xd65c5b['hasOwnProperty'](_0x39f515)){_0xd65c5b[_0x39f515]=_0xe5ecb6[_0x39f515];}}};Realtime[_0x5e7c('0x4')][_0x5e7c('0x5')]=function(){var _0x21e653=this;return function(_0x3c8e12){if(_0x3c8e12){freeIsNotKey(_0x3c8e12,_0x21e653[_0x5e7c('0x1')],'id');for(var _0x2417c0=0x0,_0x2441fe={},_0x5029d7={};_0x2417c0<_0x3c8e12[_0x5e7c('0x6')];_0x2417c0+=0x1){_0x2441fe=_0x3c8e12[_0x2417c0];if(_[_0x5e7c('0x7')](_0x21e653[_0x5e7c('0x1')][_0x2441fe['id']])){_0x21e653[_0x5e7c('0x1')][_0x2441fe['id']]=new MailAccount(_0x2441fe);}else{_['merge'](_0x21e653[_0x5e7c('0x1')][_0x2441fe['id']],_0x2441fe);}}}return _0x21e653[_0x5e7c('0x1')];};};module['exports']=Realtime; \ No newline at end of file +var _0x2413=['length','isUndefined','merge','exports','mapKeys','hasOwnProperty','prototype','mailAccounts'];(function(_0x107f31,_0x1bcd53){var _0x10560c=function(_0x5e1fc4){while(--_0x5e1fc4){_0x107f31['push'](_0x107f31['shift']());}};_0x10560c(++_0x1bcd53);}(_0x2413,0xd4));var _0x3241=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2413[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x26e217,_0x3038c9,_0x4d982d){var _0xe886bd=_[_0x3241('0x0')](_0x26e217,function(_0x5d8d4e,_0x57323a){return _0x5d8d4e[_0x4d982d];});for(var _0xf9265b in _0x3038c9){if(_0x3038c9[_0x3241('0x1')](_0xf9265b)){if(!_0xe886bd[_0xf9265b]){delete _0x3038c9[_0xf9265b];}}}}Realtime[_0x3241('0x2')]['mergeFromDatabase']=function(_0x5e6756,_0x95c14a){for(var _0x4a9346 in _0x95c14a){if(_0x5e6756['hasOwnProperty'](_0x4a9346)){_0x5e6756[_0x4a9346]=_0x95c14a[_0x4a9346];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x3dc149=this;return function(_0xedfc42){if(_0xedfc42){freeIsNotKey(_0xedfc42,_0x3dc149[_0x3241('0x3')],'id');for(var _0x4de33a=0x0,_0x4fce06={},_0x92058={};_0x4de33a<_0xedfc42[_0x3241('0x4')];_0x4de33a+=0x1){_0x4fce06=_0xedfc42[_0x4de33a];if(_[_0x3241('0x5')](_0x3dc149['mailAccounts'][_0x4fce06['id']])){_0x3dc149[_0x3241('0x3')][_0x4fce06['id']]=new MailAccount(_0x4fce06);}else{_[_0x3241('0x6')](_0x3dc149['mailAccounts'][_0x4fce06['id']],_0x4fce06);}}}return _0x3dc149[_0x3241('0x3')];};};module[_0x3241('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index a62a25d..9940b76 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 _0x995a=['email','active','key','ListId','MailServerIn','Imap','CloudProvider','service','type','MailServerOut','data5','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x995a,0x176));var _0xa995=function(_0x3ffe48,_0x4b1fcb){_0x3ffe48=_0x3ffe48-0x0;var _0x261baf=_0x995a[_0x3ffe48];return _0x261baf;};'use strict';var client=require(_0xa995('0x0'));exports[_0xa995('0x1')]=function(){return function(){return client[_0xa995('0x2')](_0xa995('0x3'),{'options':{'attributes':['id',_0xa995('0x4'),_0xa995('0x5'),'service',_0xa995('0x6'),_0xa995('0x7'),_0xa995('0x8'),_0xa995('0x9'),'TemplateId'],'raw':![],'include':[{'model':_0xa995('0xa'),'as':_0xa995('0xb'),'include':[{'model':_0xa995('0xc'),'attributes':['id',_0xa995('0x4'),_0xa995('0xd'),_0xa995('0xe'),'data5'],'as':_0xa995('0xc')}]},{'model':_0xa995('0xf'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id','name','service',_0xa995('0xe'),_0xa995('0x10')],'as':_0xa995('0xc')}]}]},'log':_0xa995('0x11')});};};exports[_0xa995('0x12')]=function(_0x5ee58c,_0x520701){return client['Request']('NotifyMailAccount',{'account':{'id':_0x5ee58c},'body':_0x520701,'log':_0xa995('0x13')});}; \ No newline at end of file +var _0xf435=['ListId','MailServerIn','Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','email','active','key'];(function(_0x18df02,_0xb60a75){var _0x590b06=function(_0x4dc0d1){while(--_0x4dc0d1){_0x18df02['push'](_0x18df02['shift']());}};_0x590b06(++_0xb60a75);}(_0xf435,0x174));var _0x5f43=function(_0x30b57b,_0x4726ff){_0x30b57b=_0x30b57b-0x0;var _0x8fd3d6=_0xf435[_0x30b57b];return _0x8fd3d6;};'use strict';var client=require('../client');exports[_0x5f43('0x0')]=function(){return function(){return client[_0x5f43('0x1')](_0x5f43('0x2'),{'options':{'attributes':['id',_0x5f43('0x3'),_0x5f43('0x4'),'service',_0x5f43('0x5'),_0x5f43('0x6'),_0x5f43('0x7'),_0x5f43('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x5f43('0x9'),'as':_0x5f43('0xa'),'include':[{'model':_0x5f43('0xb'),'attributes':['id','name',_0x5f43('0xc'),_0x5f43('0xd'),_0x5f43('0xe')],'as':_0x5f43('0xb')}]},{'model':_0x5f43('0xf'),'as':_0x5f43('0x10'),'include':[{'model':_0x5f43('0xb'),'attributes':['id',_0x5f43('0x3'),_0x5f43('0xc'),_0x5f43('0xd'),_0x5f43('0xe')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x5f43('0x11')]=function(_0x43627f,_0x46a927){return client[_0x5f43('0x1')](_0x5f43('0x12'),{'account':{'id':_0x43627f},'body':_0x46a927,'log':_0x5f43('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 0e8f9ec..d689a23 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 _0x9fe1=['ShowSetting'];(function(_0x1f305e,_0x1cfb79){var _0x5c6b70=function(_0x31ac7f){while(--_0x31ac7f){_0x1f305e['push'](_0x1f305e['shift']());}};_0x5c6b70(++_0x1cfb79);}(_0x9fe1,0xb7));var _0x19fe=function(_0x221c5d,_0x9d5d52){_0x221c5d=_0x221c5d-0x0;var _0x363049=_0x9fe1[_0x221c5d];return _0x363049;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request'](_0x19fe('0x0'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0x3725=['Request','ShowSetting','loginMailFrequency','getSettings'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x3725,0x173));var _0x5372=function(_0x14e469,_0x20bbce){_0x14e469=_0x14e469-0x0;var _0x2ab3f4=_0x3725[_0x14e469];return _0x2ab3f4;};'use strict';var client=require('../client');exports[_0x5372('0x0')]=function(){return client[_0x5372('0x1')](_0x5372('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5372('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 39cd279..83b87ba 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 505bb5b..1501047 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 _0x051a=['listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','sticky-session','ioredis','../../config/environment','listen','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','once'];(function(_0x51eeba,_0x4a5d5c){var _0x1ea24e=function(_0x58eb7d){while(--_0x58eb7d){_0x51eeba['push'](_0x51eeba['shift']());}};_0x1ea24e(++_0x4a5d5c);}(_0x051a,0x83));var _0xa051=function(_0x3f6e72,_0x559c4e){_0x3f6e72=_0x3f6e72-0x0;var _0x344818=_0x051a[_0x3f6e72];return _0x344818;};'use strict';var _=require(_0xa051('0x0'));var http=require(_0xa051('0x1'));var express=require('express');var sticky=require(_0xa051('0x2'));var Redis=require(_0xa051('0x3'));var config=require(_0xa051('0x4'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0xa051('0x5')](server,config['port'])){var socketio=require(_0xa051('0x6'))(server,{'transports':[_0xa051('0x7'),'polling']});config[_0xa051('0x8')]=_[_0xa051('0x9')](config['redis'],{'host':_0xa051('0xa'),'port':0x18eb});socketio[_0xa051('0xb')](require(_0xa051('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xa051('0x8')])}));require('../../config/triggers')[_0xa051('0xd')]();require(_0xa051('0xe'))[_0xa051('0xd')](socketio);require('../../config/express')[_0xa051('0xd')](app);require('../../routes')['default'](app);}else{server[_0xa051('0xf')](_0xa051('0x10'),function(){console[_0xa051('0x11')](_0xa051('0x12'),config[_0xa051('0x13')]);});}exports=module[_0xa051('0x14')]=app; \ No newline at end of file +var _0x14a9=['websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','../../config/environment','createServer','timeout','port'];(function(_0x196d29,_0x3c9273){var _0x3f43e0=function(_0x229f50){while(--_0x229f50){_0x196d29['push'](_0x196d29['shift']());}};_0x3f43e0(++_0x3c9273);}(_0x14a9,0x162));var _0x914a=function(_0x36426d,_0x4d62fe){_0x36426d=_0x36426d-0x0;var _0x40bd33=_0x14a9[_0x36426d];return _0x40bd33;};'use strict';var _=require(_0x914a('0x0'));var http=require(_0x914a('0x1'));var express=require('express');var sticky=require(_0x914a('0x2'));var Redis=require('ioredis');var config=require(_0x914a('0x3'));var app=express();var server=http[_0x914a('0x4')](app);server[_0x914a('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x914a('0x6')])){var socketio=require('socket.io')(server,{'transports':[_0x914a('0x7'),'polling']});config[_0x914a('0x8')]=_[_0x914a('0x9')](config['redis'],{'host':_0x914a('0xa'),'port':0x18eb});socketio[_0x914a('0xb')](require(_0x914a('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x914a('0x8')])}));require(_0x914a('0xd'))[_0x914a('0xe')]();require(_0x914a('0xf'))[_0x914a('0xe')](socketio);require('../../config/express')['default'](app);require('../../routes')[_0x914a('0xe')](app);}else{server['once'](_0x914a('0x10'),function(){console['log'](_0x914a('0x11'),config[_0x914a('0x6')]);});}exports=module[_0x914a('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 756ad84..d59e1e0 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 _0x8f6a=['then','rpc','error','routing','message','result','jayson/promise','bluebird','../../config/logger','client','http','Request','request'];(function(_0x1cffd2,_0x3373b4){var _0x2a35de=function(_0x4f3f7c){while(--_0x4f3f7c){_0x1cffd2['push'](_0x1cffd2['shift']());}};_0x2a35de(++_0x3373b4);}(_0x8f6a,0x1f4));var _0xa8f6=function(_0x90afc6,_0x523d1f){_0x90afc6=_0x90afc6-0x0;var _0x4ccd4e=_0x8f6a[_0x90afc6];return _0x4ccd4e;};'use strict';var jayson=require(_0xa8f6('0x0'));var BPromise=require(_0xa8f6('0x1'));var logger=require(_0xa8f6('0x2'))('routing');var client=jayson[_0xa8f6('0x3')][_0xa8f6('0x4')]({'port':0x2329});client[_0xa8f6('0x5')]=function(_0x5ca909,_0x3bf836){return new BPromise(function(_0x4cd438,_0xeaf2b9){return client[_0xa8f6('0x6')](_0x5ca909,_0x3bf836)[_0xa8f6('0x7')](function(_0x181c37){logger['debug'](_0xa8f6('0x8'),'routing',_0x5ca909,_0x3bf836,_0x181c37);if(_0x181c37['error']){logger[_0xa8f6('0x9')](_0xa8f6('0x8'),_0xa8f6('0xa'),_0x5ca909,_0x181c37[_0xa8f6('0x9')][_0xa8f6('0xb')],_0x3bf836);return _0xeaf2b9(_0x181c37[_0xa8f6('0x9')][_0xa8f6('0xb')]);}else{return _0x4cd438(_0x181c37[_0xa8f6('0xc')]);}})['catch'](function(_0x1ef1ec){logger[_0xa8f6('0x9')](_0xa8f6('0x8'),'routing',_0x5ca909,_0x1ef1ec,_0x3bf836);return _0xeaf2b9(_0x1ef1ec);});});};module['exports']=client; \ No newline at end of file +var _0xcf53=['http','request','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client'];(function(_0x50fa47,_0x239f87){var _0x1e72a0=function(_0x54c75e){while(--_0x54c75e){_0x50fa47['push'](_0x50fa47['shift']());}};_0x1e72a0(++_0x239f87);}(_0xcf53,0x106));var _0x3cf5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf53[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x3cf5('0x0'));var BPromise=require(_0x3cf5('0x1'));var logger=require(_0x3cf5('0x2'))('routing');var client=jayson[_0x3cf5('0x3')][_0x3cf5('0x4')]({'port':0x2329});client['Request']=function(_0x153739,_0x4e9127){return new BPromise(function(_0xa923d7,_0x1dc603){return client[_0x3cf5('0x5')](_0x153739,_0x4e9127)['then'](function(_0x569bbc){logger[_0x3cf5('0x6')](_0x3cf5('0x7'),_0x3cf5('0x8'),_0x153739,_0x4e9127,_0x569bbc);if(_0x569bbc[_0x3cf5('0x9')]){logger[_0x3cf5('0x9')](_0x3cf5('0x7'),_0x3cf5('0x8'),_0x153739,_0x569bbc[_0x3cf5('0x9')][_0x3cf5('0xa')],_0x4e9127);return _0x1dc603(_0x569bbc[_0x3cf5('0x9')][_0x3cf5('0xa')]);}else{return _0xa923d7(_0x569bbc[_0x3cf5('0xb')]);}})[_0x3cf5('0xc')](function(_0x27bf1b){logger[_0x3cf5('0x9')]('rpc',_0x3cf5('0x8'),_0x153739,_0x27bf1b,_0x4e9127);return _0x1dc603(_0x27bf1b);});});};module[_0x3cf5('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 3670322..3349783 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 _0xd477=['./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xd477,0xa9));var _0x7d47=function(_0x3748ab,_0x13059e){_0x3748ab=_0x3748ab-0x0;var _0x3aca73=_0xd477[_0x3748ab];return _0x3aca73;};'use strict';var BPromise=require(_0x7d47('0x0'));var server=require('./server');var Realtime=require(_0x7d47('0x1'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x7d47('0x2'));var chatQueue=require(_0x7d47('0x3'));var smsQueue=require(_0x7d47('0x4'));var mailQueue=require(_0x7d47('0x5'));var faxQueue=require(_0x7d47('0x6'));var whatsappQueue=require(_0x7d47('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7d47('0x8')]()['then'](user[_0x7d47('0x9')]())[_0x7d47('0xa')](realtime['initAgents']())[_0x7d47('0xa')](interval['getIntervals']())['then'](realtime['initIntervals']())[_0x7d47('0xa')](openchannelQueue[_0x7d47('0xb')]())[_0x7d47('0xa')](realtime[_0x7d47('0xc')]())[_0x7d47('0xa')](chatQueue[_0x7d47('0xd')]())[_0x7d47('0xa')](realtime[_0x7d47('0xe')]())[_0x7d47('0xa')](smsQueue[_0x7d47('0xf')]())['then'](realtime[_0x7d47('0x10')]())[_0x7d47('0xa')](mailQueue[_0x7d47('0x11')]())[_0x7d47('0xa')](realtime[_0x7d47('0x12')]())['then'](faxQueue['getFaxQueues']())[_0x7d47('0xa')](realtime[_0x7d47('0x13')]())[_0x7d47('0xa')](whatsappQueue[_0x7d47('0x14')]())['then'](realtime[_0x7d47('0x15')]())[_0x7d47('0xa')](function(){return realtime;});}function main(){return server[_0x7d47('0x16')](realtime)[_0x7d47('0xa')](function(_0x233a68){return initRealtime();})[_0x7d47('0xa')](function(_0x4e6cab){return setInterval(initRealtime,0x1388);})[_0x7d47('0x17')](function(_0x176433){console[_0x7d47('0x18')](_0x176433);});}main(); \ No newline at end of file +var _0x6f56=['getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals'];(function(_0xbc65dc,_0x379208){var _0xafb4=function(_0x3655a9){while(--_0x3655a9){_0xbc65dc['push'](_0xbc65dc['shift']());}};_0xafb4(++_0x379208);}(_0x6f56,0x14f));var _0x66f5=function(_0x27d9a7,_0x3635bd){_0x27d9a7=_0x27d9a7-0x0;var _0x420495=_0x6f56[_0x27d9a7];return _0x420495;};'use strict';var BPromise=require(_0x66f5('0x0'));var server=require(_0x66f5('0x1'));var Realtime=require(_0x66f5('0x2'));var user=require(_0x66f5('0x3'));var interval=require(_0x66f5('0x4'));var openchannelQueue=require(_0x66f5('0x5'));var chatQueue=require(_0x66f5('0x6'));var smsQueue=require(_0x66f5('0x7'));var mailQueue=require(_0x66f5('0x8'));var faxQueue=require(_0x66f5('0x9'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x66f5('0xa')]()[_0x66f5('0xb')](user[_0x66f5('0xc')]())[_0x66f5('0xb')](realtime[_0x66f5('0xd')]())[_0x66f5('0xb')](interval[_0x66f5('0xe')]())['then'](realtime[_0x66f5('0xf')]())['then'](openchannelQueue[_0x66f5('0x10')]())[_0x66f5('0xb')](realtime[_0x66f5('0x11')]())[_0x66f5('0xb')](chatQueue['getChatQueues']())[_0x66f5('0xb')](realtime[_0x66f5('0x12')]())[_0x66f5('0xb')](smsQueue[_0x66f5('0x13')]())[_0x66f5('0xb')](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())[_0x66f5('0xb')](realtime[_0x66f5('0x14')]())['then'](faxQueue[_0x66f5('0x15')]())['then'](realtime[_0x66f5('0x16')]())['then'](whatsappQueue[_0x66f5('0x17')]())[_0x66f5('0xb')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x66f5('0x18')](realtime)[_0x66f5('0xb')](function(_0x535566){return initRealtime();})[_0x66f5('0xb')](function(_0x8286d){return setInterval(initRealtime,0x1388);})[_0x66f5('0x19')](function(_0x5caf04){console[_0x66f5('0x1a')](_0x5caf04);});}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 e30d403..6e8ee2a 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x560fd4,_0x3b94b9){var _0x505450=function(_0x1c5095){while(--_0x1c5095){_0x560fd4['push'](_0x560fd4['shift']());}};_0x505450(++_0x3b94b9);}(_0x7a54,0x106));var _0x47a5=function(_0xad8669,_0xa35d2c){_0xad8669=_0xad8669-0x0;var _0x125f59=_0x7a54[_0xad8669];return _0x125f59;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x14f925,_0x32cf82){var _0x132539=function(_0xbc7154){while(--_0xbc7154){_0x14f925['push'](_0x14f925['shift']());}};_0x132539(++_0x32cf82);}(_0x2ef3,0xba));var _0x32ef=function(_0x138eb1,_0xe58cd5){_0x138eb1=_0x138eb1-0x0;var _0xed95b5=_0x2ef3[_0x138eb1];return _0xed95b5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 9189804..f9ca9c4 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 _0xdd5e=['result','catch','SendMail','bluebird','jayson/promise','client','request','then','error','message'];(function(_0x3ddcb6,_0x53c8a9){var _0x27fdd6=function(_0x3c588b){while(--_0x3c588b){_0x3ddcb6['push'](_0x3ddcb6['shift']());}};_0x27fdd6(++_0x53c8a9);}(_0xdd5e,0x125));var _0xedd5=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xdd5e[_0x368bba];return _0x409f8f;};'use strict';var BPromise=require(_0xedd5('0x0'));var jayson=require(_0xedd5('0x1'));var client=jayson[_0xedd5('0x2')]['http']({'port':0x232b});function request(_0x3f46f9,_0x13c37f){return new BPromise(function(_0x1dde39,_0x547b0e){return client[_0xedd5('0x3')](_0x3f46f9,_0x13c37f)[_0xedd5('0x4')](function(_0xf4a692){if(_0xf4a692[_0xedd5('0x5')]){return _0x547b0e(_0xf4a692['error'][_0xedd5('0x6')]);}else{return _0x1dde39(_0xf4a692[_0xedd5('0x7')]);}})[_0xedd5('0x8')](function(_0x254f97){return _0x547b0e(_0x254f97);});});}exports['sendMailMessage']=function(_0x187fbe,_0xa249e9){return request(_0xedd5('0x9'),{'account':_0x187fbe,'message':_0xa249e9});}; \ No newline at end of file +var _0xa264=['client','http','request','error','message','sendMailMessage','SendMail','bluebird'];(function(_0x1dbf6f,_0x59d8c3){var _0x3639cf=function(_0x59d6f6){while(--_0x59d6f6){_0x1dbf6f['push'](_0x1dbf6f['shift']());}};_0x3639cf(++_0x59d8c3);}(_0xa264,0x1d7));var _0x4a26=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xa264[_0x12fc8d];return _0x3f9d04;};'use strict';var BPromise=require(_0x4a26('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x4a26('0x1')][_0x4a26('0x2')]({'port':0x232b});function request(_0x3efd5f,_0x331207){return new BPromise(function(_0xdf9dc2,_0x3ccc84){return client[_0x4a26('0x3')](_0x3efd5f,_0x331207)['then'](function(_0x5e6e4e){if(_0x5e6e4e[_0x4a26('0x4')]){return _0x3ccc84(_0x5e6e4e[_0x4a26('0x4')][_0x4a26('0x5')]);}else{return _0xdf9dc2(_0x5e6e4e['result']);}})['catch'](function(_0x4c1467){return _0x3ccc84(_0x4c1467);});});}exports[_0x4a26('0x6')]=function(_0x49e721,_0xaae23d){return request(_0x4a26('0x7'),{'account':_0x49e721,'message':_0xaae23d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 089ab22..6dd0594 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 _0x6343=['chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','md5','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','whatsapp','getChannelStatus','StatusTime','toNumber','smsPause','chatStatus','faxCurrentCapacity','smsCurrentCapacity','whatsappStatusTime','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','emit','user:routing:update','exports','moment','ioredis','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','openchannelPause','unknown','chatStatusTime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6343,0x168));var _0x3634=function(_0x509325,_0x3ebecc){_0x509325=_0x509325-0x0;var _0x3988c0=_0x6343[_0x509325];return _0x3988c0;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x3634('0x0'));var Redis=require(_0x3634('0x1'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x3634('0x2'),'port':0x18eb});var io=require(_0x3634('0x3'))(new Redis(config['redis']));function Agent(_0x247964){this['id']=_0x247964['id']||0x0;this[_0x3634('0x4')]=_0x247964['name']||'';this[_0x3634('0x5')]=_0x247964[_0x3634('0x5')]||!![];this['voicePause']=_0x247964['voicePause']||![];this[_0x3634('0x6')]=_0x247964[_0x3634('0x6')]||![];this[_0x3634('0x7')]=_0x247964[_0x3634('0x7')]||![];this[_0x3634('0x8')]=_0x247964[_0x3634('0x8')]||![];this['smsPause']=_0x247964['smsPause']||![];this[_0x3634('0x9')]=_0x247964[_0x3634('0x9')]||![];this['chatStatus']=_0x3634('0xa');this[_0x3634('0xb')]=0x0;this[_0x3634('0xc')]=_0x247964[_0x3634('0xc')]||0x0;this[_0x3634('0xd')]=0x0;this[_0x3634('0xe')]=_0x3634('0xa');this[_0x3634('0xf')]=0x0;this[_0x3634('0x10')]=_0x247964[_0x3634('0x10')]||0x0;this[_0x3634('0x11')]=0x0;this[_0x3634('0x12')]=_0x3634('0xa');this[_0x3634('0x13')]=0x0;this['faxCapacity']=_0x247964[_0x3634('0x14')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x3634('0x15')]=_0x3634('0xa');this[_0x3634('0x16')]=0x0;this[_0x3634('0x17')]=_0x247964[_0x3634('0x17')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x3634('0x18')]='unknown';this['whatsappStatusTime']=0x0;this[_0x3634('0x19')]=_0x247964['whatsappCapacity']||0x0;this[_0x3634('0x1a')]=0x0;this[_0x3634('0x1b')]=_0x3634('0xa');this['openchannelStatusTime']=0x0;this[_0x3634('0x1c')]=_0x247964[_0x3634('0x1c')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3634('0x1d')]=![];this['busyQueue']=undefined;this[_0x3634('0x1e')]='';this[_0x3634('0x1f')]={};this['faxWaitingInteractions']={};this[_0x3634('0x20')]={};this[_0x3634('0x21')]={};this[_0x3634('0x22')]={};this['whatsappWaitingInteractions']={};this[_0x3634('0x23')]();}Agent[_0x3634('0x24')]['getChannelStatus']=function(_0x3936ee){if(this[_0x3936ee+'CurrentCapacity']>0x0){if(this[_0x3936ee+'Capacity']>0x0&&this[_0x3936ee+_0x3634('0x25')]>=this[_0x3936ee+_0x3634('0x26')]){return'maxcapacity';}else{return _0x3634('0x27');}}else{return _0x3634('0x28');}};Agent[_0x3634('0x24')][_0x3634('0x23')]=function(){var _0x363ca2=[_0x3634('0x29'),_0x3634('0x2a'),_0x3634('0x2b'),_0x3634('0x2c'),'sms',_0x3634('0x2d')];for(var _0x552cc3=0x0;_0x552cc3<_0x363ca2['length'];_0x552cc3+=0x1){var _0x59f481=this[_0x3634('0x2e')](_0x363ca2[_0x552cc3]);if(this[_0x363ca2[_0x552cc3]+'Status']!==_0x59f481){this[_0x363ca2[_0x552cc3]+_0x3634('0x2f')]=_[_0x3634('0x30')](moment()['format']('x'));}this[_0x363ca2[_0x552cc3]+'Status']=_0x59f481;}var _0x282f73={'id':this['id'],'name':this['name'],'online':this[_0x3634('0x5')],'voicePause':this['voicePause'],'chatPause':this[_0x3634('0x6')],'mailPause':this[_0x3634('0x7')],'smsPause':this[_0x3634('0x31')],'faxPause':this[_0x3634('0x8')],'openchannelPause':this[_0x3634('0x9')],'chatStatus':this[_0x3634('0x32')],'chatStatusTime':this[_0x3634('0xb')],'chatCapacity':this[_0x3634('0xc')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x3634('0x10')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x3634('0x12')],'faxStatusTime':this[_0x3634('0x13')],'faxCapacity':this[_0x3634('0x14')],'faxCurrentCapacity':this[_0x3634('0x33')],'smsStatus':this[_0x3634('0x15')],'smsStatusTime':this[_0x3634('0x16')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x3634('0x34')],'whatsappStatus':this[_0x3634('0x18')],'whatsappStatusTime':this[_0x3634('0x35')],'whatsappCapacity':this[_0x3634('0x19')],'whatsappCurrentCapacity':this[_0x3634('0x1a')],'openchannelStatus':this[_0x3634('0x1b')],'openchannelStatusTime':this[_0x3634('0x36')],'openchannelCapacity':this[_0x3634('0x1c')],'openchannelCurrentCapacity':this[_0x3634('0x37')],'busy':this['busy'],'busyQueue':this[_0x3634('0x38')],'chatWaitingInteractions':this[_0x3634('0x1f')],'faxWaitingInteractions':this[_0x3634('0x39')],'mailWaitingInteractions':this[_0x3634('0x20')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x3634('0x22')],'whatsappWaitingInteractions':this[_0x3634('0x3a')]};var _0x22d091=md5(JSON['stringify'](_0x282f73));if(this['md5']!==_0x22d091){this['md5']=_0x22d091;io[_0x3634('0x3b')](_0x3634('0x3c'),_['omit'](_0x282f73,[_0x3634('0x5')]));}};module[_0x3634('0x3d')]=Agent; \ No newline at end of file +var _0x32b6=['format','faxPause','mailStatusTime','faxStatus','busy','chatWaitingInteractions','stringify','emit','user:routing:update','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','mail','chat','fax','sms','whatsapp','length','Status','StatusTime'];(function(_0x28e5ef,_0x4e406f){var _0x128683=function(_0x189fe8){while(--_0x189fe8){_0x28e5ef['push'](_0x28e5ef['shift']());}};_0x128683(++_0x4e406f);}(_0x32b6,0x1d1));var _0x632b=function(_0x1fb4dc,_0x213d96){_0x1fb4dc=_0x1fb4dc-0x0;var _0x26a9c8=_0x32b6[_0x1fb4dc];return _0x26a9c8;};'use strict';var _=require(_0x632b('0x0'));var md5=require(_0x632b('0x1'));var moment=require('moment');var Redis=require(_0x632b('0x2'));var config=require(_0x632b('0x3'));config['redis']=_['defaults'](config[_0x632b('0x4')],{'host':_0x632b('0x5'),'port':0x18eb});var io=require(_0x632b('0x6'))(new Redis(config[_0x632b('0x4')]));function Agent(_0x1adfe6){this['id']=_0x1adfe6['id']||0x0;this[_0x632b('0x7')]=_0x1adfe6[_0x632b('0x7')]||'';this[_0x632b('0x8')]=_0x1adfe6[_0x632b('0x8')]||!![];this[_0x632b('0x9')]=_0x1adfe6['voicePause']||![];this[_0x632b('0xa')]=_0x1adfe6[_0x632b('0xa')]||![];this[_0x632b('0xb')]=_0x1adfe6[_0x632b('0xb')]||![];this['faxPause']=_0x1adfe6['faxPause']||![];this['smsPause']=_0x1adfe6[_0x632b('0xc')]||![];this['openchannelPause']=_0x1adfe6[_0x632b('0xd')]||![];this[_0x632b('0xe')]=_0x632b('0xf');this[_0x632b('0x10')]=0x0;this[_0x632b('0x11')]=_0x1adfe6[_0x632b('0x11')]||0x0;this[_0x632b('0x12')]=0x0;this[_0x632b('0x13')]=_0x632b('0xf');this['mailStatusTime']=0x0;this[_0x632b('0x14')]=_0x1adfe6[_0x632b('0x14')]||0x0;this[_0x632b('0x15')]=0x0;this['faxStatus']=_0x632b('0xf');this[_0x632b('0x16')]=0x0;this[_0x632b('0x17')]=_0x1adfe6[_0x632b('0x17')]||0x0;this[_0x632b('0x18')]=0x0;this[_0x632b('0x19')]='unknown';this[_0x632b('0x1a')]=0x0;this['smsCapacity']=_0x1adfe6['smsCapacity']||0x0;this[_0x632b('0x1b')]=0x0;this['whatsappStatus']=_0x632b('0xf');this[_0x632b('0x1c')]=0x0;this[_0x632b('0x1d')]=_0x1adfe6['whatsappCapacity']||0x0;this[_0x632b('0x1e')]=0x0;this[_0x632b('0x1f')]=_0x632b('0xf');this[_0x632b('0x20')]=0x0;this['openchannelCapacity']=_0x1adfe6[_0x632b('0x21')]||0x0;this[_0x632b('0x22')]=0x0;this['busy']=![];this[_0x632b('0x23')]=undefined;this['md5']='';this['chatWaitingInteractions']={};this[_0x632b('0x24')]={};this['mailWaitingInteractions']={};this[_0x632b('0x25')]={};this[_0x632b('0x26')]={};this[_0x632b('0x27')]={};this['updateRealtime']();}Agent[_0x632b('0x28')][_0x632b('0x29')]=function(_0x59d83a){if(this[_0x59d83a+_0x632b('0x2a')]>0x0){if(this[_0x59d83a+_0x632b('0x2b')]>0x0&&this[_0x59d83a+_0x632b('0x2a')]>=this[_0x59d83a+_0x632b('0x2b')]){return _0x632b('0x2c');}else{return _0x632b('0x2d');}}else{return'idle';}};Agent['prototype'][_0x632b('0x2e')]=function(){var _0x4d3a70=[_0x632b('0x2f'),_0x632b('0x30'),'openchannel',_0x632b('0x31'),_0x632b('0x32'),_0x632b('0x33')];for(var _0x18dc8c=0x0;_0x18dc8c<_0x4d3a70[_0x632b('0x34')];_0x18dc8c+=0x1){var _0x515d74=this[_0x632b('0x29')](_0x4d3a70[_0x18dc8c]);if(this[_0x4d3a70[_0x18dc8c]+_0x632b('0x35')]!==_0x515d74){this[_0x4d3a70[_0x18dc8c]+_0x632b('0x36')]=_['toNumber'](moment()[_0x632b('0x37')]('x'));}this[_0x4d3a70[_0x18dc8c]+_0x632b('0x35')]=_0x515d74;}var _0x1819fa={'id':this['id'],'name':this[_0x632b('0x7')],'online':this[_0x632b('0x8')],'voicePause':this[_0x632b('0x9')],'chatPause':this[_0x632b('0xa')],'mailPause':this[_0x632b('0xb')],'smsPause':this[_0x632b('0xc')],'faxPause':this[_0x632b('0x38')],'openchannelPause':this[_0x632b('0xd')],'chatStatus':this[_0x632b('0xe')],'chatStatusTime':this[_0x632b('0x10')],'chatCapacity':this[_0x632b('0x11')],'chatCurrentCapacity':this[_0x632b('0x12')],'mailStatus':this[_0x632b('0x13')],'mailStatusTime':this[_0x632b('0x39')],'mailCapacity':this[_0x632b('0x14')],'mailCurrentCapacity':this[_0x632b('0x15')],'faxStatus':this[_0x632b('0x3a')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x632b('0x17')],'faxCurrentCapacity':this[_0x632b('0x18')],'smsStatus':this[_0x632b('0x19')],'smsStatusTime':this[_0x632b('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x632b('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x632b('0x1c')],'whatsappCapacity':this[_0x632b('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x632b('0x1f')],'openchannelStatusTime':this[_0x632b('0x20')],'openchannelCapacity':this[_0x632b('0x21')],'openchannelCurrentCapacity':this[_0x632b('0x22')],'busy':this[_0x632b('0x3b')],'busyQueue':this[_0x632b('0x23')],'chatWaitingInteractions':this[_0x632b('0x3c')],'faxWaitingInteractions':this[_0x632b('0x24')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x632b('0x26')],'whatsappWaitingInteractions':this[_0x632b('0x27')]};var _0x52872a=md5(JSON[_0x632b('0x3d')](_0x1819fa));if(this[_0x632b('0x1')]!==_0x52872a){this[_0x632b('0x1')]=_0x52872a;io[_0x632b('0x3e')](_0x632b('0x3f'),_['omit'](_0x1819fa,['online']));}};module[_0x632b('0x40')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 77e4103..a40d2f9 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 _0x58c5=['stringify','format','emit','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','available'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x58c5,0x126));var _0x558c=function(_0x11a6bf,_0x5d7b1f){_0x11a6bf=_0x11a6bf-0x0;var _0x3fb42e=_0x58c5[_0x11a6bf];return _0x3fb42e;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x558c('0x0'));var Redis=require(_0x558c('0x1'));var config=require(_0x558c('0x2'));config[_0x558c('0x3')]=_[_0x558c('0x4')](config[_0x558c('0x3')],{'host':_0x558c('0x5'),'port':0x18eb});var io=require(_0x558c('0x6'))(new Redis(config[_0x558c('0x3')]));function ChatQueue(_0x1a00fe){this['id']=_0x1a00fe['id']||0x0;this[_0x558c('0x7')]=_0x1a00fe['name']||'';this[_0x558c('0x8')]=_0x1a00fe[_0x558c('0x8')]||0xa;this[_0x558c('0x9')]=_0x1a00fe[_0x558c('0x9')]||_0x558c('0xa');this[_0x558c('0xb')]=_0x1a00fe[_0x558c('0xb')];this[_0x558c('0xc')]={};this[_0x558c('0xd')]=0x0;this[_0x558c('0xe')]='';this[_0x558c('0xf')]();this[_0x558c('0x10')]();}ChatQueue['prototype'][_0x558c('0xf')]=function(){var _0x1bc7aa=this[_0x558c('0xc')][_0x558c('0x11')];this[_0x558c('0xc')]=_[_0x558c('0x12')](this[_0x558c('0xb')],'id');this[_0x558c('0xc')][_0x558c('0x11')]=_0x1bc7aa;};ChatQueue[_0x558c('0x13')][_0x558c('0x10')]=function(){this[_0x558c('0x14')]=0x0;this[_0x558c('0x15')]=0x0;for(var _0x1e036a=0x0;_0x1e036a=0x0?this[_0x558c('0x18')]:0x0;var _0xd30921={'id':this['id'],'available':this[_0x558c('0x18')],'loggedIn':this[_0x558c('0x14')],'name':this[_0x558c('0x7')],'paused':this[_0x558c('0x15')],'waiting':this['waiting']};var _0x26896d=md5(JSON[_0x558c('0x19')](_0xd30921));if(this[_0x558c('0xe')]!==_0x26896d){this[_0x558c('0xe')]=_0x26896d;io['to'](util[_0x558c('0x1a')]('chat:queue:%s',_0xd30921[_0x558c('0x7')]))[_0x558c('0x1b')]('chat_queue:save',_0xd30921);}};module[_0x558c('0x1c')]=ChatQueue; \ No newline at end of file +var _0x95c0=['available','waiting','stringify','format','emit','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','prototype','updateRouting','map','updateRealtime','loggedIn','online','chatPause','paused'];(function(_0x253899,_0x1bc443){var _0x34e6ee=function(_0xed2e2e){while(--_0xed2e2e){_0x253899['push'](_0x253899['shift']());}};_0x34e6ee(++_0x1bc443);}(_0x95c0,0xae));var _0x095c=function(_0x1275cb,_0x39c04c){_0x1275cb=_0x1275cb-0x0;var _0x2e4270=_0x95c0[_0x1275cb];return _0x2e4270;};'use strict';var _=require(_0x095c('0x0'));var md5=require(_0x095c('0x1'));var util=require('util');var Redis=require(_0x095c('0x2'));var config=require(_0x095c('0x3'));config[_0x095c('0x4')]=_[_0x095c('0x5')](config[_0x095c('0x4')],{'host':_0x095c('0x6'),'port':0x18eb});var io=require(_0x095c('0x7'))(new Redis(config[_0x095c('0x4')]));function ChatQueue(_0x20fe9b){this['id']=_0x20fe9b['id']||0x0;this[_0x095c('0x8')]=_0x20fe9b['name']||'';this['timeout']=_0x20fe9b[_0x095c('0x9')]||0xa;this[_0x095c('0xa')]=_0x20fe9b[_0x095c('0xa')]||_0x095c('0xb');this[_0x095c('0xc')]=_0x20fe9b[_0x095c('0xc')];this[_0x095c('0xd')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x095c('0xe')][_0x095c('0xf')]=function(){var _0x347863=this[_0x095c('0xd')]['_rr'];this[_0x095c('0xd')]=_[_0x095c('0x10')](this['Agents'],'id');this[_0x095c('0xd')]['_rr']=_0x347863;};ChatQueue[_0x095c('0xe')][_0x095c('0x11')]=function(){this[_0x095c('0x12')]=0x0;this['paused']=0x0;for(var _0x1f8a80=0x0;_0x1f8a80=0x0?this['available']:0x0;var _0x4cba23={'id':this['id'],'available':this[_0x095c('0x16')],'loggedIn':this[_0x095c('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x095c('0x17')]};var _0x4fc4a9=md5(JSON[_0x095c('0x18')](_0x4cba23));if(this[_0x095c('0x1')]!==_0x4fc4a9){this['md5']=_0x4fc4a9;io['to'](util[_0x095c('0x19')]('chat:queue:%s',_0x4cba23[_0x095c('0x8')]))[_0x095c('0x1a')]('chat_queue:save',_0x4cba23);}};module[_0x095c('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index dc91778..1457a20 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 _0xcf9c=['faxPause','available','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','map','_rr','prototype','updateRealtime','loggedIn','paused','online'];(function(_0x263f76,_0x2ee49f){var _0x4112de=function(_0x590ef1){while(--_0x590ef1){_0x263f76['push'](_0x263f76['shift']());}};_0x4112de(++_0x2ee49f);}(_0xcf9c,0x151));var _0xccf9=function(_0x429979,_0x106329){_0x429979=_0x429979-0x0;var _0x20f329=_0xcf9c[_0x429979];return _0x20f329;};'use strict';var _=require(_0xccf9('0x0'));var md5=require('md5');var util=require(_0xccf9('0x1'));var Redis=require(_0xccf9('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xccf9('0x3')](config[_0xccf9('0x4')],{'host':_0xccf9('0x5'),'port':0x18eb});var io=require(_0xccf9('0x6'))(new Redis(config[_0xccf9('0x4')]));function FaxQueue(_0x59c50b){this['id']=_0x59c50b['id']||0x0;this[_0xccf9('0x7')]=_0x59c50b[_0xccf9('0x7')]||'';this['timeout']=_0x59c50b[_0xccf9('0x8')]||0xa;this[_0xccf9('0x9')]=_0x59c50b['strategy']||_0xccf9('0xa');this['Agents']=_0x59c50b[_0xccf9('0xb')];this[_0xccf9('0xc')]={};this[_0xccf9('0xd')]=0x0;this[_0xccf9('0xe')]='';this[_0xccf9('0xf')]();this['updateRealtime']();}FaxQueue['prototype'][_0xccf9('0xf')]=function(){var _0x37cfd8=this[_0xccf9('0xc')]['_rr'];this[_0xccf9('0xc')]=_[_0xccf9('0x10')](this[_0xccf9('0xb')],'id');this[_0xccf9('0xc')][_0xccf9('0x11')]=_0x37cfd8;};FaxQueue[_0xccf9('0x12')][_0xccf9('0x13')]=function(){this[_0xccf9('0x14')]=0x0;this[_0xccf9('0x15')]=0x0;for(var _0x388973=0x0;_0x388973=0x0?this[_0xccf9('0x18')]:0x0;var _0x40ddc3={'id':this['id'],'available':this[_0xccf9('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xccf9('0x7')],'paused':this[_0xccf9('0x15')],'waiting':this[_0xccf9('0xd')]};var _0x2a5d57=md5(JSON['stringify'](_0x40ddc3));if(this['md5']!==_0x2a5d57){this[_0xccf9('0xe')]=_0x2a5d57;io['to'](util[_0xccf9('0x19')](_0xccf9('0x1a'),_0x40ddc3[_0xccf9('0x7')]))[_0xccf9('0x1b')](_0xccf9('0x1c'),_0x40ddc3);}};module[_0xccf9('0x1d')]=FaxQueue; \ No newline at end of file +var _0xa798=['lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','_rr','map','Agents','prototype','paused','length','online','faxPause','available','loggedIn','format','fax:queue:%s','fax_queue:save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa798,0x1b0));var _0x8a79=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xa798[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x8a79('0x0'));var md5=require(_0x8a79('0x1'));var util=require(_0x8a79('0x2'));var Redis=require('ioredis');var config=require(_0x8a79('0x3'));config[_0x8a79('0x4')]=_[_0x8a79('0x5')](config[_0x8a79('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x8a79('0x6'))(new Redis(config[_0x8a79('0x4')]));function FaxQueue(_0x32323a){this['id']=_0x32323a['id']||0x0;this[_0x8a79('0x7')]=_0x32323a[_0x8a79('0x7')]||'';this[_0x8a79('0x8')]=_0x32323a[_0x8a79('0x8')]||0xa;this[_0x8a79('0x9')]=_0x32323a[_0x8a79('0x9')]||_0x8a79('0xa');this['Agents']=_0x32323a['Agents'];this[_0x8a79('0xb')]={};this[_0x8a79('0xc')]=0x0;this[_0x8a79('0x1')]='';this[_0x8a79('0xd')]();this['updateRealtime']();}FaxQueue['prototype'][_0x8a79('0xd')]=function(){var _0x439edf=this[_0x8a79('0xb')][_0x8a79('0xe')];this[_0x8a79('0xb')]=_[_0x8a79('0xf')](this[_0x8a79('0x10')],'id');this['mapAgentsId']['_rr']=_0x439edf;};FaxQueue[_0x8a79('0x11')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x8a79('0x12')]=0x0;for(var _0x13c52f=0x0;_0x13c52f=0x0?this[_0x8a79('0x16')]:0x0;var _0x2c96f9={'id':this['id'],'available':this[_0x8a79('0x16')],'loggedIn':this[_0x8a79('0x17')],'name':this[_0x8a79('0x7')],'paused':this[_0x8a79('0x12')],'waiting':this[_0x8a79('0xc')]};var _0x2fe5ac=md5(JSON['stringify'](_0x2c96f9));if(this[_0x8a79('0x1')]!==_0x2fe5ac){this[_0x8a79('0x1')]=_0x2fe5ac;io['to'](util[_0x8a79('0x18')](_0x8a79('0x19'),_0x2c96f9['name']))['emit'](_0x8a79('0x1a'),_0x2c96f9);}};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 03cac91..aad38a4 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 _0x29ec=['Intervals','exports','name'];(function(_0x4a8d93,_0x11f08a){var _0x328967=function(_0x495ca6){while(--_0x495ca6){_0x4a8d93['push'](_0x4a8d93['shift']());}};_0x328967(++_0x11f08a);}(_0x29ec,0x197));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0x4bbb3c){this['id']=_0x4bbb3c['id']||0x0;this[_0xc29e('0x0')]=_0x4bbb3c[_0xc29e('0x0')]||'';this[_0xc29e('0x1')]=_0x4bbb3c[_0xc29e('0x1')]||{};}module[_0xc29e('0x2')]=Interval; \ No newline at end of file +var _0x2ef3=['name','Intervals','exports'];(function(_0x5f17d5,_0x1cfa09){var _0x513005=function(_0x317d86){while(--_0x317d86){_0x5f17d5['push'](_0x5f17d5['shift']());}};_0x513005(++_0x1cfa09);}(_0x2ef3,0x198));var _0x32ef=function(_0x510bdf,_0x202f47){_0x510bdf=_0x510bdf-0x0;var _0x2c0c35=_0x2ef3[_0x510bdf];return _0x2c0c35;};'use strict';function Interval(_0x3a7456){this['id']=_0x3a7456['id']||0x0;this[_0x32ef('0x0')]=_0x3a7456[_0x32ef('0x0')]||'';this[_0x32ef('0x1')]=_0x3a7456[_0x32ef('0x1')]||{};}module[_0x32ef('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 16f848e..05812b5 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 _0x0dd4=['paused','available','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','mailPause'];(function(_0x28c96f,_0x3c738b){var _0x6296e2=function(_0x2eb65a){while(--_0x2eb65a){_0x28c96f['push'](_0x28c96f['shift']());}};_0x6296e2(++_0x3c738b);}(_0x0dd4,0x172));var _0x40dd=function(_0x1be5b4,_0x9e4700){_0x1be5b4=_0x1be5b4-0x0;var _0x9dcc79=_0x0dd4[_0x1be5b4];return _0x9dcc79;};'use strict';var _=require(_0x40dd('0x0'));var md5=require(_0x40dd('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x40dd('0x2'));config[_0x40dd('0x3')]=_[_0x40dd('0x4')](config[_0x40dd('0x3')],{'host':_0x40dd('0x5'),'port':0x18eb});var io=require(_0x40dd('0x6'))(new Redis(config[_0x40dd('0x3')]));function MailQueue(_0x247427){this['id']=_0x247427['id']||0x0;this['name']=_0x247427[_0x40dd('0x7')]||'';this['timeout']=_0x247427[_0x40dd('0x8')]||0xa;this[_0x40dd('0x9')]=_0x247427[_0x40dd('0x9')]||'beepall';this['Agents']=_0x247427[_0x40dd('0xa')];this[_0x40dd('0xb')]={};this[_0x40dd('0xc')]=0x0;this[_0x40dd('0x1')]='';this[_0x40dd('0xd')]();this[_0x40dd('0xe')]();}MailQueue['prototype'][_0x40dd('0xd')]=function(){var _0x330e0e=this['mapAgentsId'][_0x40dd('0xf')];this['mapAgentsId']=_[_0x40dd('0x10')](this[_0x40dd('0xa')],'id');this[_0x40dd('0xb')][_0x40dd('0xf')]=_0x330e0e;};MailQueue[_0x40dd('0x11')][_0x40dd('0xe')]=function(){this[_0x40dd('0x12')]=0x0;this['paused']=0x0;for(var _0x18790f=0x0;_0x18790f=0x0?this[_0x40dd('0x17')]:0x0;var _0x34d84c={'id':this['id'],'available':this[_0x40dd('0x17')],'loggedIn':this[_0x40dd('0x12')],'name':this[_0x40dd('0x7')],'paused':this[_0x40dd('0x16')],'waiting':this['waiting']};var _0x2aebca=md5(JSON['stringify'](_0x34d84c));if(this[_0x40dd('0x1')]!==_0x2aebca){this[_0x40dd('0x1')]=_0x2aebca;io['to'](util[_0x40dd('0x18')](_0x40dd('0x19'),_0x34d84c[_0x40dd('0x7')]))['emit'](_0x40dd('0x1a'),_0x34d84c);}};module[_0x40dd('0x1b')]=MailQueue; \ No newline at end of file +var _0x9222=['mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','mailPause','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x248f6b,_0x401324){var _0x54b829=function(_0x51ad90){while(--_0x51ad90){_0x248f6b['push'](_0x248f6b['shift']());}};_0x54b829(++_0x401324);}(_0x9222,0x15d));var _0x2922=function(_0x4204f3,_0x46c923){_0x4204f3=_0x4204f3-0x0;var _0x3de0e6=_0x9222[_0x4204f3];return _0x3de0e6;};'use strict';var _=require(_0x2922('0x0'));var md5=require('md5');var util=require(_0x2922('0x1'));var Redis=require(_0x2922('0x2'));var config=require(_0x2922('0x3'));config[_0x2922('0x4')]=_[_0x2922('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2922('0x6'))(new Redis(config[_0x2922('0x4')]));function MailQueue(_0x28f46b){this['id']=_0x28f46b['id']||0x0;this[_0x2922('0x7')]=_0x28f46b[_0x2922('0x7')]||'';this[_0x2922('0x8')]=_0x28f46b[_0x2922('0x8')]||0xa;this[_0x2922('0x9')]=_0x28f46b[_0x2922('0x9')]||'beepall';this[_0x2922('0xa')]=_0x28f46b[_0x2922('0xa')];this[_0x2922('0xb')]={};this['waiting']=0x0;this[_0x2922('0xc')]='';this[_0x2922('0xd')]();this[_0x2922('0xe')]();}MailQueue[_0x2922('0xf')][_0x2922('0xd')]=function(){var _0x374442=this[_0x2922('0xb')][_0x2922('0x10')];this[_0x2922('0xb')]=_[_0x2922('0x11')](this[_0x2922('0xa')],'id');this[_0x2922('0xb')]['_rr']=_0x374442;};MailQueue[_0x2922('0xf')][_0x2922('0xe')]=function(){this[_0x2922('0x12')]=0x0;this[_0x2922('0x13')]=0x0;for(var _0x231844=0x0;_0x231844=0x0?this[_0x2922('0x16')]:0x0;var _0x32ea09={'id':this['id'],'available':this[_0x2922('0x16')],'loggedIn':this[_0x2922('0x12')],'name':this[_0x2922('0x7')],'paused':this[_0x2922('0x13')],'waiting':this[_0x2922('0x17')]};var _0x5282e5=md5(JSON[_0x2922('0x18')](_0x32ea09));if(this[_0x2922('0xc')]!==_0x5282e5){this[_0x2922('0xc')]=_0x5282e5;io['to'](util[_0x2922('0x19')](_0x2922('0x1a'),_0x32ea09[_0x2922('0x7')]))[_0x2922('0x1b')](_0x2922('0x1c'),_0x32ea09);}};module[_0x2922('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 39e27ae..eba5974 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(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x1261,0x144));var _0x1126=function(_0x17dd1d,_0x31f1b5){_0x17dd1d=_0x17dd1d-0x0;var _0x5e9d0c=_0x1261[_0x17dd1d];return _0x5e9d0c;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index b3128bb..678f1eb 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 _0xb332=['map','loggedIn','length','online','smsPause','paused','available','stringify','md5','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0x4eca42,_0x4116d5){var _0x1e7950=function(_0x115588){while(--_0x115588){_0x4eca42['push'](_0x4eca42['shift']());}};_0x1e7950(++_0x4116d5);}(_0xb332,0xd9));var _0x2b33=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xb332[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x2b33('0x0'));var md5=require('md5');var util=require(_0x2b33('0x1'));var Redis=require(_0x2b33('0x2'));var config=require('../../../config/environment');config[_0x2b33('0x3')]=_['defaults'](config[_0x2b33('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x2b33('0x4'))(new Redis(config['redis']));function SmsQueue(_0xf9b9c2){this['id']=_0xf9b9c2['id']||0x0;this[_0x2b33('0x5')]=_0xf9b9c2[_0x2b33('0x5')]||'';this[_0x2b33('0x6')]=_0xf9b9c2['timeout']||0xa;this['strategy']=_0xf9b9c2[_0x2b33('0x7')]||'beepall';this[_0x2b33('0x8')]=_0xf9b9c2[_0x2b33('0x8')];this[_0x2b33('0x9')]={};this[_0x2b33('0xa')]=0x0;this['md5']='';this[_0x2b33('0xb')]();this[_0x2b33('0xc')]();}SmsQueue[_0x2b33('0xd')][_0x2b33('0xb')]=function(){var _0x1989f3=this[_0x2b33('0x9')][_0x2b33('0xe')];this[_0x2b33('0x9')]=_[_0x2b33('0xf')](this[_0x2b33('0x8')],'id');this[_0x2b33('0x9')]['_rr']=_0x1989f3;};SmsQueue[_0x2b33('0xd')][_0x2b33('0xc')]=function(){this[_0x2b33('0x10')]=0x0;this['paused']=0x0;for(var _0x173c75=0x0;_0x173c75=0x0?this['available']:0x0;var _0x4041bd={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x2b33('0x5')],'paused':this[_0x2b33('0x14')],'waiting':this[_0x2b33('0xa')]};var _0x539c5f=md5(JSON[_0x2b33('0x16')](_0x4041bd));if(this['md5']!==_0x539c5f){this[_0x2b33('0x17')]=_0x539c5f;io['to'](util[_0x2b33('0x18')](_0x2b33('0x19'),_0x4041bd[_0x2b33('0x5')]))[_0x2b33('0x1a')](_0x2b33('0x1b'),_0x4041bd);}};module[_0x2b33('0x1c')]=SmsQueue; \ No newline at end of file +var _0x17ba=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','length','smsPause','paused','available','waiting','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x37c468,_0xa00257){var _0x28382d=function(_0x2f5c32){while(--_0x2f5c32){_0x37c468['push'](_0x37c468['shift']());}};_0x28382d(++_0xa00257);}(_0x17ba,0xab));var _0xa17b=function(_0xb1636e,_0x47afdf){_0xb1636e=_0xb1636e-0x0;var _0x509d68=_0x17ba[_0xb1636e];return _0x509d68;};'use strict';var _=require(_0xa17b('0x0'));var md5=require(_0xa17b('0x1'));var util=require('util');var Redis=require(_0xa17b('0x2'));var config=require(_0xa17b('0x3'));config[_0xa17b('0x4')]=_[_0xa17b('0x5')](config[_0xa17b('0x4')],{'host':_0xa17b('0x6'),'port':0x18eb});var io=require(_0xa17b('0x7'))(new Redis(config[_0xa17b('0x4')]));function SmsQueue(_0x1dc353){this['id']=_0x1dc353['id']||0x0;this[_0xa17b('0x8')]=_0x1dc353[_0xa17b('0x8')]||'';this[_0xa17b('0x9')]=_0x1dc353[_0xa17b('0x9')]||0xa;this[_0xa17b('0xa')]=_0x1dc353[_0xa17b('0xa')]||_0xa17b('0xb');this[_0xa17b('0xc')]=_0x1dc353[_0xa17b('0xc')];this[_0xa17b('0xd')]={};this['waiting']=0x0;this[_0xa17b('0x1')]='';this[_0xa17b('0xe')]();this[_0xa17b('0xf')]();}SmsQueue[_0xa17b('0x10')][_0xa17b('0xe')]=function(){var _0x4382df=this[_0xa17b('0xd')]['_rr'];this[_0xa17b('0xd')]=_[_0xa17b('0x11')](this[_0xa17b('0xc')],'id');this['mapAgentsId'][_0xa17b('0x12')]=_0x4382df;};SmsQueue[_0xa17b('0x10')][_0xa17b('0xf')]=function(){this[_0xa17b('0x13')]=0x0;this['paused']=0x0;for(var _0x117ad9=0x0;_0x117ad9=0x0?this[_0xa17b('0x17')]:0x0;var _0x197237={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa17b('0x13')],'name':this[_0xa17b('0x8')],'paused':this[_0xa17b('0x16')],'waiting':this[_0xa17b('0x18')]};var _0x2a340d=md5(JSON[_0xa17b('0x19')](_0x197237));if(this[_0xa17b('0x1')]!==_0x2a340d){this['md5']=_0x2a340d;io['to'](util[_0xa17b('0x1a')](_0xa17b('0x1b'),_0x197237[_0xa17b('0x8')]))['emit'](_0xa17b('0x1c'),_0x197237);}};module[_0xa17b('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 c5a4187..6393084 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 _0xb20e=['online','whatsappPause','available','format','whatsapp:queue:%s','whatsapp_queue:save','lodash','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused'];(function(_0x3ae0f0,_0x3335cf){var _0x45449a=function(_0x35fad8){while(--_0x35fad8){_0x3ae0f0['push'](_0x3ae0f0['shift']());}};_0x45449a(++_0x3335cf);}(_0xb20e,0xbc));var _0xeb20=function(_0x40ef10,_0x578727){_0x40ef10=_0x40ef10-0x0;var _0x2d5380=_0xb20e[_0x40ef10];return _0x2d5380;};'use strict';var _=require(_0xeb20('0x0'));var md5=require(_0xeb20('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xeb20('0x2'));config['redis']=_[_0xeb20('0x3')](config[_0xeb20('0x4')],{'host':_0xeb20('0x5'),'port':0x18eb});var io=require(_0xeb20('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x5925c7){this['id']=_0x5925c7['id']||0x0;this[_0xeb20('0x7')]=_0x5925c7[_0xeb20('0x7')]||'';this['timeout']=_0x5925c7[_0xeb20('0x8')]||0xa;this['strategy']=_0x5925c7[_0xeb20('0x9')]||_0xeb20('0xa');this[_0xeb20('0xb')]=_0x5925c7[_0xeb20('0xb')];this['mapAgentsId']={};this[_0xeb20('0xc')]=0x0;this[_0xeb20('0x1')]='';this[_0xeb20('0xd')]();this[_0xeb20('0xe')]();}WhatsappQueue[_0xeb20('0xf')][_0xeb20('0xd')]=function(){var _0x3f2c2c=this[_0xeb20('0x10')][_0xeb20('0x11')];this[_0xeb20('0x10')]=_['map'](this['Agents'],'id');this[_0xeb20('0x10')][_0xeb20('0x11')]=_0x3f2c2c;};WhatsappQueue[_0xeb20('0xf')][_0xeb20('0xe')]=function(){this[_0xeb20('0x12')]=0x0;this[_0xeb20('0x13')]=0x0;for(var _0x45da6b=0x0;_0x45da6b=0x0?this[_0xeb20('0x16')]:0x0;var _0x1dfb27={'id':this['id'],'available':this[_0xeb20('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xeb20('0x13')],'waiting':this['waiting']};var _0xbf8da3=md5(JSON['stringify'](_0x1dfb27));if(this[_0xeb20('0x1')]!==_0xbf8da3){this[_0xeb20('0x1')]=_0xbf8da3;io['to'](util[_0xeb20('0x17')](_0xeb20('0x18'),_0x1dfb27[_0xeb20('0x7')]))['emit'](_0xeb20('0x19'),_0x1dfb27);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x0bbe=['mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','length','whatsappPause','paused','available','format','whatsapp:queue:%s','emit','exports','ioredis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents'];(function(_0x39650f,_0x591e64){var _0x529282=function(_0xdcc474){while(--_0xdcc474){_0x39650f['push'](_0x39650f['shift']());}};_0x529282(++_0x591e64);}(_0x0bbe,0xf2));var _0xe0bb=function(_0x1b48dc,_0x4aa730){_0x1b48dc=_0x1b48dc-0x0;var _0x4c8b42=_0x0bbe[_0x1b48dc];return _0x4c8b42;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0xe0bb('0x0'));var config=require('../../../config/environment');config['redis']=_[_0xe0bb('0x1')](config['redis'],{'host':_0xe0bb('0x2'),'port':0x18eb});var io=require(_0xe0bb('0x3'))(new Redis(config['redis']));function WhatsappQueue(_0x2795ea){this['id']=_0x2795ea['id']||0x0;this['name']=_0x2795ea[_0xe0bb('0x4')]||'';this['timeout']=_0x2795ea['timeout']||0xa;this[_0xe0bb('0x5')]=_0x2795ea['strategy']||_0xe0bb('0x6');this[_0xe0bb('0x7')]=_0x2795ea[_0xe0bb('0x7')];this[_0xe0bb('0x8')]={};this[_0xe0bb('0x9')]=0x0;this[_0xe0bb('0xa')]='';this['updateRouting']();this[_0xe0bb('0xb')]();}WhatsappQueue[_0xe0bb('0xc')][_0xe0bb('0xd')]=function(){var _0x2f83aa=this[_0xe0bb('0x8')]['_rr'];this[_0xe0bb('0x8')]=_[_0xe0bb('0xe')](this['Agents'],'id');this['mapAgentsId'][_0xe0bb('0xf')]=_0x2f83aa;};WhatsappQueue[_0xe0bb('0xc')][_0xe0bb('0xb')]=function(){this[_0xe0bb('0x10')]=0x0;this['paused']=0x0;for(var _0x5236e1=0x0;_0x5236e1=0x0?this[_0xe0bb('0x14')]:0x0;var _0x268a8d={'id':this['id'],'available':this[_0xe0bb('0x14')],'loggedIn':this[_0xe0bb('0x10')],'name':this['name'],'paused':this[_0xe0bb('0x13')],'waiting':this[_0xe0bb('0x9')]};var _0x541b27=md5(JSON['stringify'](_0x268a8d));if(this[_0xe0bb('0xa')]!==_0x541b27){this[_0xe0bb('0xa')]=_0x541b27;io['to'](util[_0xe0bb('0x15')](_0xe0bb('0x16'),_0x268a8d['name']))[_0xe0bb('0x17')]('whatsapp_queue:save',_0x268a8d);}};module[_0xe0bb('0x18')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b58d0e3..49a74b8 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(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 fa5c9dc..d9147b7 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 _0x4c6a=['addTags','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x361512,_0x55a19f){var _0x4eed7b=function(_0x4c03d7){while(--_0x4c03d7){_0x361512['push'](_0x361512['shift']());}};_0x4eed7b(++_0x55a19f);}(_0x4c6a,0x79));var _0xa4c6=function(_0x368326,_0x1ab78e){_0x368326=_0x368326-0x0;var _0x161b39=_0x4c6a[_0x368326];return _0x161b39;};'use strict';var client=require(_0xa4c6('0x0'));exports[_0xa4c6('0x1')]=function(_0x5a1e86,_0x7666a3){return client[_0xa4c6('0x2')](_0xa4c6('0x3'),{'body':_0x7666a3,'options':{'where':{'id':_0x5a1e86}},'log':_0xa4c6('0x4')});};exports[_0xa4c6('0x5')]=function(_0x1fbd2d,_0x501c1c){return client['Request']('AddTagsToChatInteraction',{'body':_0x501c1c,'options':{'where':{'id':_0x1fbd2d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2d30=['../client','update','Request','updateChatInteraction','addTags','addTagsToChatInteraction'];(function(_0xd12f88,_0x441890){var _0x1db5b0=function(_0xd0263){while(--_0xd0263){_0xd12f88['push'](_0xd12f88['shift']());}};_0x1db5b0(++_0x441890);}(_0x2d30,0x174));var _0x02d3=function(_0x4a6156,_0x2b8ce6){_0x4a6156=_0x4a6156-0x0;var _0x12c1f6=_0x2d30[_0x4a6156];return _0x12c1f6;};'use strict';var client=require(_0x02d3('0x0'));exports[_0x02d3('0x1')]=function(_0x2ef42d,_0x16bddd){return client[_0x02d3('0x2')]('UpdateChatInteraction',{'body':_0x16bddd,'options':{'where':{'id':_0x2ef42d}},'log':_0x02d3('0x3')});};exports[_0x02d3('0x4')]=function(_0x195149,_0x43bb42){return client[_0x02d3('0x2')]('AddTagsToChatInteraction',{'body':_0x43bb42,'options':{'where':{'id':_0x195149}},'log':_0x02d3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0e781c6..136f397 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 _0xd388=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x26b0fa,_0x2070db){var _0x319eda=function(_0x46c085){while(--_0x46c085){_0x26b0fa['push'](_0x26b0fa['shift']());}};_0x319eda(++_0x2070db);}(_0xd388,0x116));var _0x8d38=function(_0x1c081d,_0x10b432){_0x1c081d=_0x1c081d-0x0;var _0x2deb0e=_0xd388[_0x1c081d];return _0x2deb0e;};'use strict';var client=require(_0x8d38('0x0'));exports[_0x8d38('0x1')]=function(_0x4e865d){return client[_0x8d38('0x2')](_0x8d38('0x3'),{'body':_0x4e865d,'log':_0x8d38('0x4')});}; \ No newline at end of file +var _0x156a=['Request','createChatMessage','../client','create'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0x156a,0x82));var _0xa156=function(_0x403f87,_0xcb6f55){_0x403f87=_0x403f87-0x0;var _0x499961=_0x156a[_0x403f87];return _0x499961;};'use strict';var client=require(_0xa156('0x0'));exports[_0xa156('0x1')]=function(_0x55b62e){return client[_0xa156('0x2')]('CreateChatMessage',{'body':_0x55b62e,'log':_0xa156('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 638045e..24c22d2 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 _0x7579=['name','timeout','User','Agents','online','../client','getChatQueues','Request','GetChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7579,0x1e2));var _0x9757=function(_0x80358b,_0x344c2f){_0x80358b=_0x80358b-0x0;var _0x25a84b=_0x7579[_0x80358b];return _0x25a84b;};'use strict';var client=require(_0x9757('0x0'));exports[_0x9757('0x1')]=function(){return function(){return client[_0x9757('0x2')](_0x9757('0x3'),{'options':{'raw':![],'attributes':['id',_0x9757('0x4'),_0x9757('0x5'),'strategy'],'include':[{'model':_0x9757('0x6'),'as':_0x9757('0x7'),'attributes':['id',_0x9757('0x4'),_0x9757('0x8'),'chatPause']}]},'log':_0x9757('0x1')});};}; \ No newline at end of file +var _0x6075=['timeout','strategy','User','Agents','chatPause','getChatQueues','Request','GetChatQueue','name'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x6075,0x191));var _0x5607=function(_0x321f1e,_0x28b6e1){_0x321f1e=_0x321f1e-0x0;var _0x1a3fd8=_0x6075[_0x321f1e];return _0x1a3fd8;};'use strict';var client=require('../client');exports[_0x5607('0x0')]=function(){return function(){return client[_0x5607('0x1')](_0x5607('0x2'),{'options':{'raw':![],'attributes':['id',_0x5607('0x3'),_0x5607('0x4'),_0x5607('0x5')],'include':[{'model':_0x5607('0x6'),'as':_0x5607('0x7'),'attributes':['id',_0x5607('0x3'),'online',_0x5607('0x8')]}]},'log':_0x5607('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a227bc4..9cb815d 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 _0xf9bb=['Request','UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport'];(function(_0xf95101,_0x5ad502){var _0x477acf=function(_0x318238){while(--_0x318238){_0xf95101['push'](_0xf95101['shift']());}};_0x477acf(++_0x5ad502);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x414f45,_0x1ee7d3){_0x414f45=_0x414f45-0x0;var _0x3bc907=_0xf9bb[_0x414f45];return _0x3bc907;};'use strict';var client=require(_0xbf9b('0x0'));exports[_0xbf9b('0x1')]=function(_0x26844f){return client['Request'](_0xbf9b('0x2'),{'body':_0x26844f,'log':_0xbf9b('0x2')});};exports['update']=function(_0x4e5db7,_0x190028){return client[_0xbf9b('0x3')](_0xbf9b('0x4'),{'body':_0x190028,'options':{'where':{'uniqueid':_0x4e5db7},'order':[['id',_0xbf9b('0x5')]],'limit':0x1},'log':_0xbf9b('0x4')});}; \ No newline at end of file +var _0xb717=['update','Request','UpdateChatQueueReport','DESC','../client','CreateChatQueueReport'];(function(_0x3d8fe3,_0x4ae668){var _0x24fbd1=function(_0x1d8715){while(--_0x1d8715){_0x3d8fe3['push'](_0x3d8fe3['shift']());}};_0x24fbd1(++_0x4ae668);}(_0xb717,0x1b4));var _0x7b71=function(_0x59f860,_0x24716c){_0x59f860=_0x59f860-0x0;var _0x2d558a=_0xb717[_0x59f860];return _0x2d558a;};'use strict';var client=require(_0x7b71('0x0'));exports['create']=function(_0x161237){return client['Request'](_0x7b71('0x1'),{'body':_0x161237,'log':_0x7b71('0x1')});};exports[_0x7b71('0x2')]=function(_0x52c5dd,_0x238319){return client[_0x7b71('0x3')](_0x7b71('0x4'),{'body':_0x238319,'options':{'where':{'uniqueid':_0x52c5dd},'order':[['id',_0x7b71('0x5')]],'limit':0x1},'log':_0x7b71('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index f19b643..c9f1733 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(_0x17dd99,_0x2c5acd){var _0x4ecea1=function(_0x3eb749){while(--_0x3eb749){_0x17dd99['push'](_0x17dd99['shift']());}};_0x4ecea1(++_0x2c5acd);}(_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(_0xb8281f,_0xd0171f){var _0xac2377=function(_0x3f3f3c){while(--_0x3f3f3c){_0xb8281f['push'](_0xb8281f['shift']());}};_0xac2377(++_0xd0171f);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 2388b07..ca1979f 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 _0xe0c8=['CreateFaxMessage','createFaxMessage','../client'];(function(_0x5d4c20,_0xabc4dd){var _0x314eab=function(_0x7dca06){while(--_0x7dca06){_0x5d4c20['push'](_0x5d4c20['shift']());}};_0x314eab(++_0xabc4dd);}(_0xe0c8,0x161));var _0x8e0c=function(_0x4b44ac,_0x84990a){_0x4b44ac=_0x4b44ac-0x0;var _0x1f3c0a=_0xe0c8[_0x4b44ac];return _0x1f3c0a;};'use strict';var client=require(_0x8e0c('0x0'));exports['create']=function(_0x30218f){return client['Request'](_0x8e0c('0x1'),{'body':_0x30218f,'log':_0x8e0c('0x2')});}; \ No newline at end of file +var _0x70a9=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x56a893,_0x450ad1){var _0x4984b4=function(_0x733bde){while(--_0x733bde){_0x56a893['push'](_0x56a893['shift']());}};_0x4984b4(++_0x450ad1);}(_0x70a9,0xb5));var _0x970a=function(_0x5b6e1e,_0x453a0b){_0x5b6e1e=_0x5b6e1e-0x0;var _0x564edd=_0x70a9[_0x5b6e1e];return _0x564edd;};'use strict';var client=require(_0x970a('0x0'));exports['create']=function(_0x958b88){return client[_0x970a('0x1')](_0x970a('0x2'),{'body':_0x958b88,'log':_0x970a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6f9332c..cfe646b 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 _0xc6ff=['name','strategy','User','Agents','online','getFaxQueues','GetFaxQueue'];(function(_0x2f85af,_0x3875fd){var _0x3f9612=function(_0x1c70de){while(--_0x1c70de){_0x2f85af['push'](_0x2f85af['shift']());}};_0x3f9612(++_0x3875fd);}(_0xc6ff,0x18d));var _0xfc6f=function(_0x557f18,_0x3f747d){_0x557f18=_0x557f18-0x0;var _0x31adb0=_0xc6ff[_0x557f18];return _0x31adb0;};'use strict';var client=require('../client');exports[_0xfc6f('0x0')]=function(){return function(){return client['Request'](_0xfc6f('0x1'),{'options':{'raw':![],'attributes':['id',_0xfc6f('0x2'),'timeout',_0xfc6f('0x3')],'include':[{'model':_0xfc6f('0x4'),'as':_0xfc6f('0x5'),'attributes':['id','name',_0xfc6f('0x6'),'faxPause']}]},'log':_0xfc6f('0x0')});};}; \ No newline at end of file +var _0x6584=['GetFaxQueue','name','timeout','strategy','Agents','online','faxPause','../client','getFaxQueues','Request'];(function(_0x3ef74c,_0x31030b){var _0xe05b2e=function(_0x14ef85){while(--_0x14ef85){_0x3ef74c['push'](_0x3ef74c['shift']());}};_0xe05b2e(++_0x31030b);}(_0x6584,0x15b));var _0x4658=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x6584[_0xa9a245];return _0x2d0eaa;};'use strict';var client=require(_0x4658('0x0'));exports[_0x4658('0x1')]=function(){return function(){return client[_0x4658('0x2')](_0x4658('0x3'),{'options':{'raw':![],'attributes':['id',_0x4658('0x4'),_0x4658('0x5'),_0x4658('0x6')],'include':[{'model':'User','as':_0x4658('0x7'),'attributes':['id',_0x4658('0x4'),_0x4658('0x8'),_0x4658('0x9')]}]},'log':_0x4658('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 9b7cb33..94f2add 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 _0x57b9=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x57b9,0x18c));var _0x957b=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x57b9[_0x44bcb0];return _0xfaf881;};'use strict';var client=require(_0x957b('0x0'));exports[_0x957b('0x1')]=function(_0x175178){return client[_0x957b('0x2')](_0x957b('0x3'),{'body':_0x175178,'log':_0x957b('0x3')});};exports[_0x957b('0x4')]=function(_0x3a03f3,_0x1990cc){return client[_0x957b('0x2')](_0x957b('0x5'),{'body':_0x1990cc,'options':{'where':{'uniqueid':_0x3a03f3},'order':[['id',_0x957b('0x6')]],'limit':0x1},'log':_0x957b('0x5')});}; \ No newline at end of file +var _0xca5c=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x42ea4e,_0x52167b){var _0x1a8899=function(_0x56c2fc){while(--_0x56c2fc){_0x42ea4e['push'](_0x42ea4e['shift']());}};_0x1a8899(++_0x52167b);}(_0xca5c,0xb6));var _0xcca5=function(_0x592cbc,_0x5ec030){_0x592cbc=_0x592cbc-0x0;var _0x39b8d9=_0xca5c[_0x592cbc];return _0x39b8d9;};'use strict';var client=require(_0xcca5('0x0'));exports[_0xcca5('0x1')]=function(_0x21dd18){return client[_0xcca5('0x2')](_0xcca5('0x3'),{'body':_0x21dd18,'log':_0xcca5('0x3')});};exports[_0xcca5('0x4')]=function(_0x58eca1,_0xcf07b0){return client[_0xcca5('0x2')](_0xcca5('0x5'),{'body':_0xcf07b0,'options':{'where':{'uniqueid':_0x58eca1},'order':[['id',_0xcca5('0x6')]],'limit':0x1},'log':_0xcca5('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 629dcce..2d4106e 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 _0x8d5d=['Request','GetInterval','Interval','Intervals','name','interval','../client'];(function(_0x3909ae,_0x3183c7){var _0x15000b=function(_0x591ff5){while(--_0x591ff5){_0x3909ae['push'](_0x3909ae['shift']());}};_0x15000b(++_0x3183c7);}(_0x8d5d,0x15d));var _0xd8d5=function(_0xb34d75,_0x233fc9){_0xb34d75=_0xb34d75-0x0;var _0x145a0b=_0x8d5d[_0xb34d75];return _0x145a0b;};'use strict';var client=require(_0xd8d5('0x0'));exports['getIntervals']=function(){return function(){return client[_0xd8d5('0x1')](_0xd8d5('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xd8d5('0x3'),'as':_0xd8d5('0x4'),'attributes':['id',_0xd8d5('0x5'),_0xd8d5('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xc0b8=['GetInterval','name','Interval','Intervals','interval','getIntervals','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0b8,0x1ae));var _0x8c0b=function(_0x128015,_0x118364){_0x128015=_0x128015-0x0;var _0x1c593b=_0xc0b8[_0x128015];return _0x1c593b;};'use strict';var client=require(_0x8c0b('0x0'));exports['getIntervals']=function(){return function(){return client[_0x8c0b('0x1')](_0x8c0b('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8c0b('0x3')],'include':[{'model':_0x8c0b('0x4'),'as':_0x8c0b('0x5'),'attributes':['id','name',_0x8c0b('0x6')]}]},'log':_0x8c0b('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 433c9f0..35e84d2 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 _0xf61e=['addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0xf61e,0x191));var _0xef61=function(_0x3f956b,_0x42b037){_0x3f956b=_0x3f956b-0x0;var _0x5e7f45=_0xf61e[_0x3f956b];return _0x5e7f45;};'use strict';var client=require(_0xef61('0x0'));exports[_0xef61('0x1')]=function(_0xe535c3,_0xcf15bd){return client[_0xef61('0x2')](_0xef61('0x3'),{'body':_0xcf15bd,'options':{'where':{'id':_0xe535c3}},'log':_0xef61('0x4')});};exports[_0xef61('0x5')]=function(_0x2bd1d0,_0x14122a){return client[_0xef61('0x2')](_0xef61('0x6'),{'body':_0x14122a,'options':{'where':{'id':_0x2bd1d0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xa456=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x2bc9e2,_0x1f4772){var _0x598e41=function(_0x5c8005){while(--_0x5c8005){_0x2bc9e2['push'](_0x2bc9e2['shift']());}};_0x598e41(++_0x1f4772);}(_0xa456,0x142));var _0x6a45=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xa456[_0x26f702];return _0x11417d;};'use strict';var client=require(_0x6a45('0x0'));exports[_0x6a45('0x1')]=function(_0x56dfe8,_0xd5464e){return client['Request'](_0x6a45('0x2'),{'body':_0xd5464e,'options':{'where':{'id':_0x56dfe8}},'log':_0x6a45('0x3')});};exports[_0x6a45('0x4')]=function(_0x500c72,_0x1f0701){return client[_0x6a45('0x5')](_0x6a45('0x6'),{'body':_0x1f0701,'options':{'where':{'id':_0x500c72}},'log':_0x6a45('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 79c0702..ec4c24f 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 _0xe575=['CreateMailMessage','createMailMessage','../client','Request'];(function(_0x2ecc68,_0x3694a8){var _0xc24394=function(_0x3c5602){while(--_0x3c5602){_0x2ecc68['push'](_0x2ecc68['shift']());}};_0xc24394(++_0x3694a8);}(_0xe575,0x112));var _0x5e57=function(_0x5685a8,_0x36106a){_0x5685a8=_0x5685a8-0x0;var _0x180ec3=_0xe575[_0x5685a8];return _0x180ec3;};'use strict';var client=require(_0x5e57('0x0'));exports['create']=function(_0x3f3525){return client[_0x5e57('0x1')](_0x5e57('0x2'),{'body':_0x3f3525,'log':_0x5e57('0x3')});}; \ No newline at end of file +var _0xa87a=['create','CreateMailMessage','../client'];(function(_0x2a958d,_0x4e71f5){var _0x5856e4=function(_0x398747){while(--_0x398747){_0x2a958d['push'](_0x2a958d['shift']());}};_0x5856e4(++_0x4e71f5);}(_0xa87a,0x19a));var _0xaa87=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xa87a[_0x2f9467];return _0x39894c;};'use strict';var client=require(_0xaa87('0x0'));exports[_0xaa87('0x1')]=function(_0x246568){return client['Request'](_0xaa87('0x2'),{'body':_0x246568,'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 994421b..e0a9245 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 _0xdc29=['User','online','mailPause','getMailQueues','Request','name','timeout','strategy'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0xdc29,0x143));var _0x9dc2=function(_0x4fbf4e,_0x3a473d){_0x4fbf4e=_0x4fbf4e-0x0;var _0x32727b=_0xdc29[_0x4fbf4e];return _0x32727b;};'use strict';var client=require('../client');exports[_0x9dc2('0x0')]=function(){return function(){return client[_0x9dc2('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x9dc2('0x2'),_0x9dc2('0x3'),_0x9dc2('0x4')],'include':[{'model':_0x9dc2('0x5'),'as':'Agents','attributes':['id',_0x9dc2('0x2'),_0x9dc2('0x6'),_0x9dc2('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x1e17=['strategy','online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout'];(function(_0x513457,_0x597aef){var _0x24ef56=function(_0x5ee731){while(--_0x5ee731){_0x513457['push'](_0x513457['shift']());}};_0x24ef56(++_0x597aef);}(_0x1e17,0x133));var _0x71e1=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x1e17[_0xf79bae];return _0x5d2cb7;};'use strict';var client=require(_0x71e1('0x0'));exports[_0x71e1('0x1')]=function(){return function(){return client['Request'](_0x71e1('0x2'),{'options':{'raw':![],'attributes':['id',_0x71e1('0x3'),_0x71e1('0x4'),_0x71e1('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x71e1('0x3'),_0x71e1('0x6'),_0x71e1('0x7')]}]},'log':_0x71e1('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 2961d41..af6ec5a 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 _0x938c=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x8a5732,_0x578167){var _0x1b009b=function(_0x5921fd){while(--_0x5921fd){_0x8a5732['push'](_0x8a5732['shift']());}};_0x1b009b(++_0x578167);}(_0x938c,0x7b));var _0xc938=function(_0x260a8,_0x3cca62){_0x260a8=_0x260a8-0x0;var _0x376604=_0x938c[_0x260a8];return _0x376604;};'use strict';var client=require(_0xc938('0x0'));exports[_0xc938('0x1')]=function(_0x1ea436){return client[_0xc938('0x2')](_0xc938('0x3'),{'body':_0x1ea436,'log':'CreateMailQueueReport'});};exports[_0xc938('0x4')]=function(_0x4f4813,_0x4bfb51){return client[_0xc938('0x2')](_0xc938('0x5'),{'body':_0x4bfb51,'options':{'where':{'uniqueid':_0x4f4813},'order':[['id',_0xc938('0x6')]],'limit':0x1},'log':_0xc938('0x5')});}; \ No newline at end of file +var _0x3f5a=['update','UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0x2340c4,_0xafe8bf){var _0x1f66da=function(_0x440ba9){while(--_0x440ba9){_0x2340c4['push'](_0x2340c4['shift']());}};_0x1f66da(++_0xafe8bf);}(_0x3f5a,0x183));var _0xa3f5=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x3f5a[_0x492af5];return _0x59f529;};'use strict';var client=require('../client');exports[_0xa3f5('0x0')]=function(_0x19f6f1){return client[_0xa3f5('0x1')](_0xa3f5('0x2'),{'body':_0x19f6f1,'log':_0xa3f5('0x2')});};exports[_0xa3f5('0x3')]=function(_0x3987eb,_0xe25662){return client[_0xa3f5('0x1')](_0xa3f5('0x4'),{'body':_0xe25662,'options':{'where':{'uniqueid':_0x3987eb},'order':[['id','DESC']],'limit':0x1},'log':_0xa3f5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 4599911..0292830 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 _0xe1fc=['../client','update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xe1fc,0xd9));var _0xce1f=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xe1fc[_0x3de8a4];return _0x4635cf;};'use strict';var client=require(_0xce1f('0x0'));exports[_0xce1f('0x1')]=function(_0x717ee3,_0x4ebf8f){return client[_0xce1f('0x2')](_0xce1f('0x3'),{'body':_0x4ebf8f,'options':{'where':{'id':_0x717ee3}},'log':'updateOpenchannelInteraction'});};exports[_0xce1f('0x4')]=function(_0x17f117,_0x1a4083){return client['Request'](_0xce1f('0x5'),{'body':_0x1a4083,'options':{'where':{'id':_0x17f117}},'log':_0xce1f('0x6')});}; \ No newline at end of file +var _0x7137=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xfc6bc0,_0x233766){var _0xdf70c4=function(_0x471951){while(--_0x471951){_0xfc6bc0['push'](_0xfc6bc0['shift']());}};_0xdf70c4(++_0x233766);}(_0x7137,0x115));var _0x7713=function(_0x1bc12f,_0x2f498a){_0x1bc12f=_0x1bc12f-0x0;var _0x362186=_0x7137[_0x1bc12f];return _0x362186;};'use strict';var client=require(_0x7713('0x0'));exports[_0x7713('0x1')]=function(_0x581e67,_0x37077f){return client[_0x7713('0x2')](_0x7713('0x3'),{'body':_0x37077f,'options':{'where':{'id':_0x581e67}},'log':_0x7713('0x4')});};exports[_0x7713('0x5')]=function(_0x545b15,_0x38c863){return client[_0x7713('0x2')](_0x7713('0x6'),{'body':_0x38c863,'options':{'where':{'id':_0x545b15}},'log':_0x7713('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 226fca1..2be8df0 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 _0x18fe=['create','CreateOpenchannelMessage','../client'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x18fe,0x155));var _0xe18f=function(_0x2e2a44,_0x49c5a0){_0x2e2a44=_0x2e2a44-0x0;var _0x5500a5=_0x18fe[_0x2e2a44];return _0x5500a5;};'use strict';var client=require(_0xe18f('0x0'));exports[_0xe18f('0x1')]=function(_0x28a387){return client['Request'](_0xe18f('0x2'),{'body':_0x28a387,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x05e5=['createOpenchannelMessage','../client','Request'];(function(_0x303617,_0x5a7c5){var _0x2131ac=function(_0xcf3846){while(--_0xcf3846){_0x303617['push'](_0x303617['shift']());}};_0x2131ac(++_0x5a7c5);}(_0x05e5,0x6d));var _0x505e=function(_0x2616a5,_0x16564c){_0x2616a5=_0x2616a5-0x0;var _0x594e2b=_0x05e5[_0x2616a5];return _0x594e2b;};'use strict';var client=require(_0x505e('0x0'));exports['create']=function(_0x1f590c){return client[_0x505e('0x1')]('CreateOpenchannelMessage',{'body':_0x1f590c,'log':_0x505e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6926a48..d504719 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 _0x1c7d=['name','timeout','strategy','Agents','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x1c7d,0x19a));var _0xd1c7=function(_0x8bda20,_0x52ad98){_0x8bda20=_0x8bda20-0x0;var _0x29407b=_0x1c7d[_0x8bda20];return _0x29407b;};'use strict';var client=require(_0xd1c7('0x0'));exports[_0xd1c7('0x1')]=function(){return function(){return client[_0xd1c7('0x2')](_0xd1c7('0x3'),{'options':{'raw':![],'attributes':['id',_0xd1c7('0x4'),_0xd1c7('0x5'),_0xd1c7('0x6')],'include':[{'model':'User','as':_0xd1c7('0x7'),'attributes':['id',_0xd1c7('0x4'),'online',_0xd1c7('0x8')]}]},'log':_0xd1c7('0x1')});};}; \ No newline at end of file +var _0x19cf=['name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue'];(function(_0x4e0d45,_0x55f937){var _0xb25758=function(_0x18d517){while(--_0x18d517){_0x4e0d45['push'](_0x4e0d45['shift']());}};_0xb25758(++_0x55f937);}(_0x19cf,0x197));var _0xf19c=function(_0x2478c2,_0x418956){_0x2478c2=_0x2478c2-0x0;var _0x246f1e=_0x19cf[_0x2478c2];return _0x246f1e;};'use strict';var client=require(_0xf19c('0x0'));exports[_0xf19c('0x1')]=function(){return function(){return client['Request'](_0xf19c('0x2'),{'options':{'raw':![],'attributes':['id',_0xf19c('0x3'),_0xf19c('0x4'),_0xf19c('0x5')],'include':[{'model':_0xf19c('0x6'),'as':_0xf19c('0x7'),'attributes':['id',_0xf19c('0x3'),_0xf19c('0x8'),_0xf19c('0x9')]}]},'log':_0xf19c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 2c0db9a..5393dd2 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 _0x7782=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7782,0xa2));var _0x2778=function(_0x5eae73,_0x274f14){_0x5eae73=_0x5eae73-0x0;var _0x1695b5=_0x7782[_0x5eae73];return _0x1695b5;};'use strict';var client=require('../client');exports[_0x2778('0x0')]=function(_0x5cb0f3){return client[_0x2778('0x1')](_0x2778('0x2'),{'body':_0x5cb0f3,'log':_0x2778('0x2')});};exports[_0x2778('0x3')]=function(_0x24d3e7,_0x67a11){return client[_0x2778('0x1')](_0x2778('0x4'),{'body':_0x67a11,'options':{'where':{'uniqueid':_0x24d3e7},'order':[['id',_0x2778('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xc0d8=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xc0d8,0x6e));var _0x8c0d=function(_0x23c514,_0x13043a){_0x23c514=_0x23c514-0x0;var _0x6813b6=_0xc0d8[_0x23c514];return _0x6813b6;};'use strict';var client=require(_0x8c0d('0x0'));exports[_0x8c0d('0x1')]=function(_0x36ba0f){return client[_0x8c0d('0x2')]('CreateOpenchannelQueueReport',{'body':_0x36ba0f,'log':_0x8c0d('0x3')});};exports[_0x8c0d('0x4')]=function(_0x4d9e58,_0x4296e3){return client[_0x8c0d('0x2')](_0x8c0d('0x5'),{'body':_0x4296e3,'options':{'where':{'uniqueid':_0x4d9e58},'order':[['id',_0x8c0d('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index b0fba39..da79f30 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 _0x423b=['UpdateSmsInteraction','Request','addTagsToSmsInteraction','update'];(function(_0x30b0b1,_0x22c5bb){var _0x20571b=function(_0x3171ea){while(--_0x3171ea){_0x30b0b1['push'](_0x30b0b1['shift']());}};_0x20571b(++_0x22c5bb);}(_0x423b,0x12b));var _0xb423=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x423b[_0x8a969d];return _0x1d8dc7;};'use strict';var client=require('../client');exports[_0xb423('0x0')]=function(_0x539554,_0x46e2a8){return client['Request'](_0xb423('0x1'),{'body':_0x46e2a8,'options':{'where':{'id':_0x539554}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x50f31a,_0x2fa5da){return client[_0xb423('0x2')]('AddTagsToSmsInteraction',{'body':_0x2fa5da,'options':{'where':{'id':_0x50f31a}},'log':_0xb423('0x3')});}; \ No newline at end of file +var _0x7d86=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x5c7b9b,_0x47b8ca){var _0x4699fd=function(_0x3dba75){while(--_0x3dba75){_0x5c7b9b['push'](_0x5c7b9b['shift']());}};_0x4699fd(++_0x47b8ca);}(_0x7d86,0x86));var _0x67d8=function(_0x254ee7,_0x2cb964){_0x254ee7=_0x254ee7-0x0;var _0x1510b4=_0x7d86[_0x254ee7];return _0x1510b4;};'use strict';var client=require(_0x67d8('0x0'));exports['update']=function(_0xff82a6,_0x8af490){return client[_0x67d8('0x1')](_0x67d8('0x2'),{'body':_0x8af490,'options':{'where':{'id':_0xff82a6}},'log':_0x67d8('0x3')});};exports[_0x67d8('0x4')]=function(_0x3f58a1,_0x517caf){return client[_0x67d8('0x1')](_0x67d8('0x5'),{'body':_0x517caf,'options':{'where':{'id':_0x3f58a1}},'log':_0x67d8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 2131d55..e31d202 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 _0x128b=['../client','CreateSmsMessage'];(function(_0x1e6ebb,_0x2dc09f){var _0x11374d=function(_0x417853){while(--_0x417853){_0x1e6ebb['push'](_0x1e6ebb['shift']());}};_0x11374d(++_0x2dc09f);}(_0x128b,0xe0));var _0xb128=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x128b[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0xb128('0x0'));exports['create']=function(_0x4ce2a8){return client['Request'](_0xb128('0x1'),{'body':_0x4ce2a8,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xd024=['create','Request','CreateSmsMessage'];(function(_0x78df4a,_0x133438){var _0x57a8f7=function(_0x48ea5f){while(--_0x48ea5f){_0x78df4a['push'](_0x78df4a['shift']());}};_0x57a8f7(++_0x133438);}(_0xd024,0x16b));var _0x4d02=function(_0x30aff4,_0x146e72){_0x30aff4=_0x30aff4-0x0;var _0xd95966=_0xd024[_0x30aff4];return _0xd95966;};'use strict';var client=require('../client');exports[_0x4d02('0x0')]=function(_0x44cdf7){return client[_0x4d02('0x1')](_0x4d02('0x2'),{'body':_0x44cdf7,'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 4e3fe72..87cf44b 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x12170d,_0x25c5f2){var _0x27143b=function(_0x5e9856){while(--_0x5e9856){_0x12170d['push'](_0x12170d['shift']());}};_0x27143b(++_0x25c5f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index b5d724c..cd28a92 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x2fa552,_0x1ce305){var _0x2fd140=function(_0x3cfbb8){while(--_0x3cfbb8){_0x2fa552['push'](_0x2fa552['shift']());}};_0x2fd140(++_0x1ce305);}(_0x70e0,0x17b));var _0x070e=function(_0xe24448,_0x524c3a){_0xe24448=_0xe24448-0x0;var _0x3a445d=_0x70e0[_0xe24448];return _0x3a445d;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x460ede,_0x185eb5){var _0x31944e=function(_0xcfe7e1){while(--_0xcfe7e1){_0x460ede['push'](_0x460ede['shift']());}};_0x31944e(++_0x185eb5);}(_0x008c,0x188));var _0xc008=function(_0x345de7,_0x1de531){_0x345de7=_0x345de7-0x0;var _0x26ffc7=_0x008c[_0x345de7];return _0x26ffc7;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 6bd74fb..710e12e 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(_0x340660,_0x4383f8){var _0x2008fa=function(_0x41c2ba){while(--_0x41c2ba){_0x340660['push'](_0x340660['shift']());}};_0x2008fa(++_0x4383f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x59ce11,_0x3a0de5){var _0x4181a0=function(_0x1b7730){while(--_0x1b7730){_0x59ce11['push'](_0x59ce11['shift']());}};_0x4181a0(++_0x3a0de5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 fa370d1..b1c0678 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 _0x539d=['updateWhatsappInteraction','addTags','Request','addTagsToWhatsappInteraction','../client'];(function(_0x4b3585,_0x263efc){var _0x5a23e3=function(_0x6d94c2){while(--_0x6d94c2){_0x4b3585['push'](_0x4b3585['shift']());}};_0x5a23e3(++_0x263efc);}(_0x539d,0x17b));var _0xd539=function(_0x441db3,_0x10f359){_0x441db3=_0x441db3-0x0;var _0x16c05d=_0x539d[_0x441db3];return _0x16c05d;};'use strict';var client=require(_0xd539('0x0'));exports['update']=function(_0x2bd59f,_0x1c859a){return client['Request']('UpdateWhatsappInteraction',{'body':_0x1c859a,'options':{'where':{'id':_0x2bd59f}},'log':_0xd539('0x1')});};exports[_0xd539('0x2')]=function(_0xe8e6e4,_0x19ae25){return client[_0xd539('0x3')]('AddTagsToWhatsappInteraction',{'body':_0x19ae25,'options':{'where':{'id':_0xe8e6e4}},'log':_0xd539('0x4')});}; \ No newline at end of file +var _0xb511=['../client','update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x1b618,_0x8addce){var _0x191120=function(_0x2f8c97){while(--_0x2f8c97){_0x1b618['push'](_0x1b618['shift']());}};_0x191120(++_0x8addce);}(_0xb511,0x165));var _0x1b51=function(_0x37e423,_0x44cd78){_0x37e423=_0x37e423-0x0;var _0x57a395=_0xb511[_0x37e423];return _0x57a395;};'use strict';var client=require(_0x1b51('0x0'));exports[_0x1b51('0x1')]=function(_0x15178f,_0x56baac){return client[_0x1b51('0x2')](_0x1b51('0x3'),{'body':_0x56baac,'options':{'where':{'id':_0x15178f}},'log':'updateWhatsappInteraction'});};exports[_0x1b51('0x4')]=function(_0x439eca,_0x110e7f){return client['Request'](_0x1b51('0x5'),{'body':_0x110e7f,'options':{'where':{'id':_0x439eca}},'log':_0x1b51('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ec4abcd..5e0b1f2 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 _0x3083=['CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x3c47b4,_0x4103e2){var _0x186968=function(_0x4bb230){while(--_0x4bb230){_0x3c47b4['push'](_0x3c47b4['shift']());}};_0x186968(++_0x4103e2);}(_0x3083,0x1e5));var _0x3308=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x3083[_0x299784];return _0x5ab008;};'use strict';var client=require(_0x3308('0x0'));exports['create']=function(_0x2f144f){return client['Request'](_0x3308('0x1'),{'body':_0x2f144f,'log':_0x3308('0x2')});}; \ No newline at end of file +var _0xaeb3=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0xaeb3,0x14f));var _0x3aeb=function(_0x27ba9b,_0x570bb6){_0x27ba9b=_0x27ba9b-0x0;var _0x32b62c=_0xaeb3[_0x27ba9b];return _0x32b62c;};'use strict';var client=require(_0x3aeb('0x0'));exports[_0x3aeb('0x1')]=function(_0x46be83){return client[_0x3aeb('0x2')](_0x3aeb('0x3'),{'body':_0x46be83,'log':_0x3aeb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 11ff4c8..ecba4eb 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 _0x9729=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0x17c6d8,_0x184a62){var _0x35015c=function(_0x4e7934){while(--_0x4e7934){_0x17c6d8['push'](_0x17c6d8['shift']());}};_0x35015c(++_0x184a62);}(_0x9729,0x1a3));var _0x9972=function(_0x271b64,_0x163ca5){_0x271b64=_0x271b64-0x0;var _0x1515b1=_0x9729[_0x271b64];return _0x1515b1;};'use strict';var client=require(_0x9972('0x0'));exports[_0x9972('0x1')]=function(){return function(){return client[_0x9972('0x2')](_0x9972('0x3'),{'options':{'raw':![],'attributes':['id',_0x9972('0x4'),_0x9972('0x5'),_0x9972('0x6')],'include':[{'model':_0x9972('0x7'),'as':_0x9972('0x8'),'attributes':['id',_0x9972('0x4'),_0x9972('0x9'),'whatsappPause']}]},'log':_0x9972('0x1')});};}; \ No newline at end of file +var _0xa500=['GetWhatsappQueue','name','timeout','strategy','User','Agents','online','whatsappPause','getWhatsappQueues','../client','Request'];(function(_0x90b1b1,_0x3c996d){var _0x2f23dc=function(_0x34646e){while(--_0x34646e){_0x90b1b1['push'](_0x90b1b1['shift']());}};_0x2f23dc(++_0x3c996d);}(_0xa500,0xe5));var _0x0a50=function(_0x44c868,_0xd93c33){_0x44c868=_0x44c868-0x0;var _0x368eb1=_0xa500[_0x44c868];return _0x368eb1;};'use strict';var client=require(_0x0a50('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x0a50('0x1')](_0x0a50('0x2'),{'options':{'raw':![],'attributes':['id',_0x0a50('0x3'),_0x0a50('0x4'),_0x0a50('0x5')],'include':[{'model':_0x0a50('0x6'),'as':_0x0a50('0x7'),'attributes':['id',_0x0a50('0x3'),_0x0a50('0x8'),_0x0a50('0x9')]}]},'log':_0x0a50('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 94ab466..a28c748 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 _0x0707=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create'];(function(_0x1b576d,_0x2ce437){var _0xa33e9b=function(_0x47b2da){while(--_0x47b2da){_0x1b576d['push'](_0x1b576d['shift']());}};_0xa33e9b(++_0x2ce437);}(_0x0707,0xf4));var _0x7070=function(_0x2db12c,_0x7523ec){_0x2db12c=_0x2db12c-0x0;var _0x2e7e98=_0x0707[_0x2db12c];return _0x2e7e98;};'use strict';var client=require(_0x7070('0x0'));exports[_0x7070('0x1')]=function(_0xb24c89){return client[_0x7070('0x2')]('CreateWhatsappQueueReport',{'body':_0xb24c89,'log':_0x7070('0x3')});};exports[_0x7070('0x4')]=function(_0x240d43,_0x5769c8){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x5769c8,'options':{'where':{'uniqueid':_0x240d43},'order':[['id','DESC']],'limit':0x1},'log':_0x7070('0x5')});}; \ No newline at end of file +var _0x89ba=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create'];(function(_0x491020,_0x597b55){var _0x503b44=function(_0x3aa5de){while(--_0x3aa5de){_0x491020['push'](_0x491020['shift']());}};_0x503b44(++_0x597b55);}(_0x89ba,0xc4));var _0xa89b=function(_0x26a169,_0x54f908){_0x26a169=_0x26a169-0x0;var _0x1f07a1=_0x89ba[_0x26a169];return _0x1f07a1;};'use strict';var client=require(_0xa89b('0x0'));exports[_0xa89b('0x1')]=function(_0x11459f){return client[_0xa89b('0x2')](_0xa89b('0x3'),{'body':_0x11459f,'log':'CreateWhatsappQueueReport'});};exports[_0xa89b('0x4')]=function(_0x35c8e2,_0x5712ab){return client[_0xa89b('0x2')]('UpdateWhatsappQueueReport',{'body':_0x5712ab,'options':{'where':{'uniqueid':_0x35c8e2},'order':[['id','DESC']],'limit':0x1},'log':_0xa89b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 7d12084..c13123d 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 _0xc892=['agents','timeout','createQueue','channel','START:%s','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','util','seq-queue','../../../../config/logger','routing','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc892,0xd0));var _0x2c89=function(_0x2eac1a,_0x1b457f){_0x2eac1a=_0x2eac1a-0x0;var _0x199b32=_0xc892[_0x2eac1a];return _0x199b32;};'use strict';var schema=require(_0x2c89('0x0'));var _=require('lodash');var util=require(_0x2c89('0x1'));var seqqueue=require(_0x2c89('0x2'));var logger=require(_0x2c89('0x3'))(_0x2c89('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x2c89('0x5')}});function writeLog(_0x5c9599,_0xbee858,_0x11977d){return logger['info'](util[_0x2c89('0x6')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5c9599,_0xbee858[_0x2c89('0x7')],_0x11977d));}function handleFindAgent(_0x53b945){return function(_0x3190ce){return _0x3190ce['name'][_0x2c89('0x8')]()===_0x53b945[_0x2c89('0x8')]();};}exports[_0x2c89('0x9')]=function(_0x23e125,_0x3cd2a9,_0x49904a,_0x30484e){return function(_0x2804c1){try{var _0x48b0b8={'name':_0x3cd2a9[0x0],'timeout':_0x3cd2a9[0x1]};var _0x483426=queue[_0x2c89('0x0')](_0x48b0b8,{'typecast':!![]});if(_0x483426['length']){logger['error'](_0x2c89('0xa'),_0x23e125,_[_0x2c89('0xb')](_0x483426,_0x2c89('0xc'))[_0x2c89('0xd')](',\x20'));_0x2804c1[_0x2c89('0xe')]();}else{var _0x51bf01=_[_0x2c89('0xf')](_0x49904a[_0x2c89('0x10')],handleFindAgent(_0x48b0b8[_0x2c89('0x7')]));if(_0x51bf01){var _0x56a362=(_0x48b0b8[_0x2c89('0x11')]||0xa)*0x3e8;var _0x39749a,_0x5543a8;var _0xffe58b=seqqueue[_0x2c89('0x12')](_0x56a362);_0xffe58b['id']=_0x23e125;_0xffe58b['atimeout']=_0x56a362;_0xffe58b['channel']=_0x30484e[_0x2c89('0x13')];writeLog(_0x23e125,_0x51bf01,util[_0x2c89('0x6')](_0x2c89('0x14'),_0x56a362));_0x49904a['rules'][_0x23e125]['on'](_0x2c89('0x15'),function(){logger[_0x2c89('0x16')](_0x2c89('0x17'),_0x23e125);clearTimeout(_0x5543a8);_0x5543a8=undefined;_0xffe58b[_0x2c89('0x18')]();if(_0x49904a[_0x2c89('0x19')][_0x23e125]){delete _0x49904a['rules'][_0x23e125];}_0x2804c1[_0x2c89('0xe')]();});_0x49904a[_0x2c89('0x19')][_0x23e125]['on'](_0x2c89('0x1a'),function(){if(_0x49904a[_0x2c89('0x19')][_0x23e125]){delete _0x49904a[_0x2c89('0x19')][_0x23e125];}});_0x5543a8=setTimeout(function(){logger[_0x2c89('0x16')]('[%s][AGENT]\x20ROUTING\x20END',_0x23e125);clearTimeout(_0x5543a8);_0xffe58b[_0x2c89('0x18')]();_0x2804c1['next']();},_0x56a362);strategy[_0x2c89('0x1b')](_0xffe58b,_0x51bf01,_0x49904a,_0x30484e);}else{logger[_0x2c89('0x1c')](_0x2c89('0x1d'),_0x23e125,_0x48b0b8[_0x2c89('0x7')]);_0x2804c1['stop']();}}}catch(_0x5323a4){console[_0x2c89('0x1e')](_0x5323a4);logger[_0x2c89('0x1c')](_0x2c89('0x1f'),_0x23e125,_0x5323a4['stack']);_0x2804c1[_0x2c89('0xe')]();}};}; \ No newline at end of file +var _0x7916=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','error','[%s][AGENT]\x20%s','map','message','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash'];(function(_0x146d45,_0x4a5867){var _0xcee738=function(_0x3e9bc2){while(--_0x3e9bc2){_0x146d45['push'](_0x146d45['shift']());}};_0xcee738(++_0x4a5867);}(_0x7916,0x9a));var _0x6791=function(_0x148aa9,_0x421ae3){_0x148aa9=_0x148aa9-0x0;var _0x530a22=_0x7916[_0x148aa9];return _0x530a22;};'use strict';var schema=require('validate');var _=require(_0x6791('0x0'));var util=require('util');var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')('routing');var strategy=require(_0x6791('0x1'));var queue=schema({'name':{'type':_0x6791('0x2'),'required':!![],'message':_0x6791('0x3')},'timeout':{'type':'number','message':_0x6791('0x4')}});function writeLog(_0x50c624,_0x304941,_0x1b1822){return logger[_0x6791('0x5')](util[_0x6791('0x6')](_0x6791('0x7'),_0x50c624,_0x304941[_0x6791('0x8')],_0x1b1822));}function handleFindAgent(_0xc60bbf){return function(_0x34ebff){return _0x34ebff['name']['toLowerCase']()===_0xc60bbf['toLowerCase']();};}exports[_0x6791('0x9')]=function(_0x16ec2a,_0xd5f6a0,_0x3b8e00,_0x46515c){return function(_0x529465){try{var _0x2c0033={'name':_0xd5f6a0[0x0],'timeout':_0xd5f6a0[0x1]};var _0x2996e6=queue['validate'](_0x2c0033,{'typecast':!![]});if(_0x2996e6['length']){logger[_0x6791('0xa')](_0x6791('0xb'),_0x16ec2a,_[_0x6791('0xc')](_0x2996e6,_0x6791('0xd'))['join'](',\x20'));_0x529465['stop']();}else{var _0x1ad3e5=_[_0x6791('0xe')](_0x3b8e00[_0x6791('0xf')],handleFindAgent(_0x2c0033[_0x6791('0x8')]));if(_0x1ad3e5){var _0x1644b6=(_0x2c0033[_0x6791('0x10')]||0xa)*0x3e8;var _0x377418,_0x5e22a5;var _0x233268=seqqueue[_0x6791('0x11')](_0x1644b6);_0x233268['id']=_0x16ec2a;_0x233268[_0x6791('0x12')]=_0x1644b6;_0x233268[_0x6791('0x13')]=_0x46515c[_0x6791('0x13')];writeLog(_0x16ec2a,_0x1ad3e5,util[_0x6791('0x6')](_0x6791('0x14'),_0x1644b6));_0x3b8e00[_0x6791('0x15')][_0x16ec2a]['on'](_0x6791('0x16'),function(){logger['info'](_0x6791('0x17'),_0x16ec2a);clearTimeout(_0x5e22a5);_0x5e22a5=undefined;_0x233268[_0x6791('0x18')]();if(_0x3b8e00[_0x6791('0x15')][_0x16ec2a]){delete _0x3b8e00[_0x6791('0x15')][_0x16ec2a];}_0x529465['stop']();});_0x3b8e00[_0x6791('0x15')][_0x16ec2a]['on'](_0x6791('0x19'),function(){if(_0x3b8e00[_0x6791('0x15')][_0x16ec2a]){delete _0x3b8e00[_0x6791('0x15')][_0x16ec2a];}});_0x5e22a5=setTimeout(function(){logger[_0x6791('0x5')](_0x6791('0x1a'),_0x16ec2a);clearTimeout(_0x5e22a5);_0x233268[_0x6791('0x18')]();_0x529465['next']();},_0x1644b6);strategy[_0x6791('0x1b')](_0x233268,_0x1ad3e5,_0x3b8e00,_0x46515c);}else{logger[_0x6791('0xa')](_0x6791('0x1c'),_0x16ec2a,_0x2c0033[_0x6791('0x8')]);_0x529465['stop']();}}}catch(_0x2c385c){console['log'](_0x2c385c);logger[_0x6791('0xa')](_0x6791('0x1d'),_0x16ec2a,_0x2c385c[_0x6791('0x1e')]);_0x529465['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 99fbfb8..0e057fe 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 _0x2496=['phone','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','Message','create','then','body','catch','error','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','providerResponse','stringify','dialogState','Failed','moment','aws-sdk','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp'];(function(_0x48dc12,_0x16f0cf){var _0x51d461=function(_0x37924c){while(--_0x37924c){_0x48dc12['push'](_0x48dc12['shift']());}};_0x51d461(++_0x16f0cf);}(_0x2496,0x135));var _0x6249=function(_0x6fc29b,_0x3e1bcb){_0x6fc29b=_0x6fc29b-0x0;var _0xe7d8c1=_0x2496[_0x6fc29b];return _0xe7d8c1;};'use strict';var _=require('lodash');var moment=require(_0x6249('0x0'));var AWS=require(_0x6249('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x6249('0x2'));var rpc={'chatMessage':require(_0x6249('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6249('0x4')),'smsMessage':require(_0x6249('0x5')),'faxMessage':require(_0x6249('0x6')),'whatsappMessage':require(_0x6249('0x7'))};exports[_0x6249('0x8')]=function(_0x32d7c3,_0x24d59e){return function(_0x5a4906){try{if(!_[_0x6249('0x9')](this[_0x6249('0xa')]['UserId'])){logger[_0x6249('0xb')](_0x6249('0xc'),_0x32d7c3,_0x6249('0xd'));return _0x5a4906[_0x6249('0xe')]();}var _0x1edb19={'ContactId':this['contact']['id'],'sentAt':moment()[_0x6249('0xf')](_0x6249('0x10')),'direction':_0x6249('0x11')};if(this[_0x6249('0x12')]==='sms'||this[_0x6249('0x12')]===_0x6249('0x13')){_0x1edb19[_0x6249('0x14')]=this[_0x6249('0xa')][_0x6249('0x14')];}var _0x3cd861=this[_0x6249('0x12')];if(_0x3cd861===_0x6249('0x15')){_0x1edb19[_0x6249('0x16')]=this['account']['id'];}else{_0x1edb19[_[_0x6249('0x17')](_0x3cd861)+'AccountId']=this['account']['id'];}_0x1edb19[_[_0x6249('0x17')](_0x3cd861)+_0x6249('0x18')]=this[_0x6249('0xa')]['id'];if(this[_0x6249('0xa')][_0x6249('0x19')]){var _0x12cb18=_0x24d59e[0x4];if(!_[_0x6249('0x1a')](_0x12cb18)){_0x1edb19['body']=utils['getMustacheRender'](_0x12cb18,this);return rpc[_0x3cd861+_0x6249('0x1b')][_0x6249('0x1c')](_0x1edb19)[_0x6249('0x1d')](function(_0x293c9c){logger['info']('[%s][AMAZONLEX]\x20%s',_0x32d7c3,_0x1edb19[_0x6249('0x1e')]);})[_0x6249('0x1f')](function(_0x2375c8){logger[_0x6249('0x20')](_0x6249('0xc'),_0x32d7c3,JSON['stringify'](_0x2375c8));})[_0x6249('0x21')](function(){logger[_0x6249('0xb')](_0x6249('0x22'),_0x32d7c3);_0x5a4906[_0x6249('0x23')]();});}else{logger[_0x6249('0xb')](_0x6249('0x24'),_0x32d7c3);_0x5a4906[_0x6249('0x23')]();}}else{var _0x22f2af=this;var _0x2a2f59=new AWS[(_0x6249('0x25'))]({'accessKeyId':_0x24d59e[0x0],'secretAccessKey':_0x24d59e[0x1],'region':_0x24d59e[0x2]});var _0x4162fd={'botAlias':_0x6249('0x26'),'botName':_0x24d59e[0x3],'inputText':this[_0x6249('0x27')][_0x6249('0x1e')],'userId':this[_0x6249('0x12')]+':'+this[_0x6249('0xa')]['id'][_0x6249('0x28')]()};_0x2a2f59[_0x6249('0x29')](_0x4162fd,function(_0x5d97c1,_0x4eace6){if(_0x5d97c1){logger[_0x6249('0x20')](_0x6249('0xc'),_0x32d7c3,_0x5d97c1['message']);_0x5a4906[_0x6249('0xe')]();}else if(_0x4eace6&&_0x4eace6['message']){_0x22f2af[_0x6249('0x1e')][_0x6249('0x2a')]=_0x4eace6;_0x1edb19[_0x6249('0x1e')]=_0x4eace6[_0x6249('0x27')];_0x1edb19['providerName']='amazonlex';_0x1edb19[_0x6249('0x2b')]=JSON[_0x6249('0x2c')](_0x4eace6);return rpc[_0x3cd861+_0x6249('0x1b')]['create'](_0x1edb19)['then'](function(_0x280158){logger[_0x6249('0xb')](_0x6249('0xc'),_0x32d7c3,_0x1edb19[_0x6249('0x1e')]);if(_0x4eace6[_0x6249('0x2d')]==_0x6249('0x2e')){_0x5a4906[_0x6249('0xe')]();}else{_0x5a4906['stop']();}})['catch'](function(_0xf470dc){logger[_0x6249('0x20')](_0x6249('0xc'),_0x32d7c3,JSON['stringify'](_0xf470dc));_0x5a4906['next']();});}else{_0x5a4906[_0x6249('0xe')]();}});}}catch(_0x35affc){logger[_0x6249('0x20')](_0x6249('0xc'),_0x32d7c3,JSON[_0x6249('0x2c')](_0x35affc));_0x5a4906[_0x6249('0x23')]();}};}; \ No newline at end of file +var _0xdfb2=['lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','stringify','[%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','error','amazonlex','dialogState','Failed','catch'];(function(_0x4b2083,_0x1140bf){var _0xc48cfe=function(_0x29a594){while(--_0x29a594){_0x4b2083['push'](_0x4b2083['shift']());}};_0xc48cfe(++_0x1140bf);}(_0xdfb2,0x149));var _0x2dfb=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xdfb2[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x2dfb('0x0'));var moment=require(_0x2dfb('0x1'));var AWS=require(_0x2dfb('0x2'));var utils=require('./utils');var logger=require(_0x2dfb('0x3'))(_0x2dfb('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2dfb('0x5')),'mailMessage':require(_0x2dfb('0x6')),'smsMessage':require(_0x2dfb('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2dfb('0x8'))};exports['consequence']=function(_0x4cf64f,_0x115278){return function(_0x50c9db){try{if(!_[_0x2dfb('0x9')](this[_0x2dfb('0xa')][_0x2dfb('0xb')])){logger[_0x2dfb('0xc')](_0x2dfb('0xd'),_0x4cf64f,_0x2dfb('0xe'));return _0x50c9db[_0x2dfb('0xf')]();}var _0x5a4449={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2dfb('0x10')](_0x2dfb('0x11')),'direction':'out'};if(this['channel']===_0x2dfb('0x12')||this[_0x2dfb('0x13')]===_0x2dfb('0x14')){_0x5a4449[_0x2dfb('0x15')]=this[_0x2dfb('0xa')][_0x2dfb('0x15')];}var _0x263187=this[_0x2dfb('0x13')];if(_0x263187===_0x2dfb('0x16')){_0x5a4449[_0x2dfb('0x17')]=this[_0x2dfb('0x18')]['id'];}else{_0x5a4449[_[_0x2dfb('0x19')](_0x263187)+_0x2dfb('0x1a')]=this[_0x2dfb('0x18')]['id'];}_0x5a4449[_[_0x2dfb('0x19')](_0x263187)+_0x2dfb('0x1b')]=this[_0x2dfb('0xa')]['id'];if(this[_0x2dfb('0xa')][_0x2dfb('0x1c')]){var _0x217a02=_0x115278[0x4];if(!_[_0x2dfb('0x1d')](_0x217a02)){_0x5a4449[_0x2dfb('0x1e')]=utils[_0x2dfb('0x1f')](_0x217a02,this);return rpc[_0x263187+_0x2dfb('0x20')][_0x2dfb('0x21')](_0x5a4449)[_0x2dfb('0x22')](function(_0x6f5b78){logger[_0x2dfb('0xc')](_0x2dfb('0xd'),_0x4cf64f,_0x5a4449[_0x2dfb('0x1e')]);})['catch'](function(_0x4e073e){logger['error'](_0x2dfb('0xd'),_0x4cf64f,JSON[_0x2dfb('0x23')](_0x4e073e));})['finally'](function(){logger[_0x2dfb('0xc')](_0x2dfb('0x24'),_0x4cf64f);_0x50c9db[_0x2dfb('0x25')]();});}else{logger[_0x2dfb('0xc')](_0x2dfb('0x26'),_0x4cf64f);_0x50c9db[_0x2dfb('0x25')]();}}else{var _0x462933=this;var _0x4ebb36=new AWS[(_0x2dfb('0x27'))]({'accessKeyId':_0x115278[0x0],'secretAccessKey':_0x115278[0x1],'region':_0x115278[0x2]});var _0x15e023={'botAlias':_0x2dfb('0x28'),'botName':_0x115278[0x3],'inputText':this[_0x2dfb('0x29')]['body'],'userId':this[_0x2dfb('0x13')]+':'+this[_0x2dfb('0xa')]['id']['toString']()};_0x4ebb36['postText'](_0x15e023,function(_0x959855,_0x43449b){if(_0x959855){logger[_0x2dfb('0x2a')](_0x2dfb('0xd'),_0x4cf64f,_0x959855[_0x2dfb('0x29')]);_0x50c9db['next']();}else if(_0x43449b&&_0x43449b[_0x2dfb('0x29')]){_0x462933[_0x2dfb('0x1e')]['amazonlex']=_0x43449b;_0x5a4449['body']=_0x43449b[_0x2dfb('0x29')];_0x5a4449['providerName']=_0x2dfb('0x2b');_0x5a4449['providerResponse']=JSON[_0x2dfb('0x23')](_0x43449b);return rpc[_0x263187+_0x2dfb('0x20')][_0x2dfb('0x21')](_0x5a4449)[_0x2dfb('0x22')](function(_0x28a612){logger[_0x2dfb('0xc')](_0x2dfb('0xd'),_0x4cf64f,_0x5a4449[_0x2dfb('0x1e')]);if(_0x43449b[_0x2dfb('0x2c')]==_0x2dfb('0x2d')){_0x50c9db[_0x2dfb('0xf')]();}else{_0x50c9db[_0x2dfb('0x25')]();}})[_0x2dfb('0x2e')](function(_0x2661c6){logger[_0x2dfb('0x2a')](_0x2dfb('0xd'),_0x4cf64f,JSON[_0x2dfb('0x23')](_0x2661c6));_0x50c9db[_0x2dfb('0xf')]();});}else{_0x50c9db[_0x2dfb('0xf')]();}});}}catch(_0x397095){logger[_0x2dfb('0x2a')](_0x2dfb('0xd'),_0x4cf64f,JSON[_0x2dfb('0x23')](_0x397095));_0x50c9db[_0x2dfb('0x25')]();}};}; \ 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 41b2182..c4fbf3a 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 _0xe26b=['stringify','catch','finally','resolve','autoreplyExecuted','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','isAutoreply','[%s][AUTOREPLY]\x20%s','isNil','interaction','created','info','Autoreply\x20already\x20sent','next','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','mail','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','inReplyTo','messageId','html','replace','','auto-replied','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe26b,0x1a8));var _0xbe26=function(_0x379ebe,_0x43ceb8){_0x379ebe=_0x379ebe-0x0;var _0x46d903=_0xe26b[_0x379ebe];return _0x46d903;};'use strict';var _=require(_0xbe26('0x0'));var moment=require('moment');var utils=require(_0xbe26('0x1'));var logger=require(_0xbe26('0x2'))(_0xbe26('0x3'));var rpc={'chatMessage':require(_0xbe26('0x4')),'openchannelMessage':require(_0xbe26('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xbe26('0x6')),'faxMessage':require(_0xbe26('0x7')),'whatsappMessage':require(_0xbe26('0x8')),'chatInteraction':require(_0xbe26('0x9')),'openchannelInteraction':require(_0xbe26('0xa')),'mailInteraction':require(_0xbe26('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xbe26('0xc')),'whatsappInteraction':require(_0xbe26('0xd'))};var mailRpc=require(_0xbe26('0xe'));exports[_0xbe26('0xf')]=function(_0x139495,_0x37daf9,_0x44602a,_0x5a9dc6){return function(_0x2b2b35){try{var _0x15ea6f=this[_0xbe26('0x10')];if(_0x15ea6f==='mail'&&_0x5a9dc6[_0xbe26('0x11')][_0xbe26('0x12')]){logger['info'](_0xbe26('0x13'),_0x139495,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x2b2b35['next']();}if(_0x37daf9[0x0]==='1'&&(_[_0xbe26('0x14')](this[_0xbe26('0x15')][_0xbe26('0x16')])||!this[_0xbe26('0x15')][_0xbe26('0x16')])){logger[_0xbe26('0x17')](_0xbe26('0x13'),_0x139495,_0xbe26('0x18'));return _0x2b2b35[_0xbe26('0x19')]();}if(_0x37daf9[0x0]==='2'&&this[_0xbe26('0x15')]['autoreplyExecuted']){logger[_0xbe26('0x17')](_0xbe26('0x1a'),_0x139495,'One\x20Time\x20already\x20sent');return _0x2b2b35['next']();}var _0x55e7c3={'ContactId':this['contact']['id'],'sentAt':moment()[_0xbe26('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0xbe26('0x1c')){_0x55e7c3[_0xbe26('0x11')]=utils[_0xbe26('0x1d')](_0x37daf9[0x2],this);}else{_0x55e7c3['body']=utils[_0xbe26('0x1d')](_0x37daf9[0x1],this);}if(this[_0xbe26('0x1e')]){_0x55e7c3['to']=this[_0xbe26('0x1e')]['from']||'';if(this[_0xbe26('0x10')]===_0xbe26('0x1c')&&_0x37daf9[0x1]==='1'){_0x55e7c3['cc']=this[_0xbe26('0x1e')]['cc']||'';}_0x55e7c3[_0xbe26('0x1f')]=this[_0xbe26('0x1e')]['to']||'';_0x55e7c3[_0xbe26('0x20')]=this[_0xbe26('0x1e')][_0xbe26('0x20')]||'';_0x55e7c3[_0xbe26('0x21')]=!![];if(this[_0xbe26('0x1e')][_0xbe26('0x22')]){_0x55e7c3[_0xbe26('0x22')]='';_0x55e7c3[_0xbe26('0x22')]+=_[_0xbe26('0x23')](this['message'][_0xbe26('0x22')],_0xbe26('0x24'))?'':_0xbe26('0x25');_0x55e7c3['subject']+=this[_0xbe26('0x1e')][_0xbe26('0x22')];}}if(this[_0xbe26('0x10')]===_0xbe26('0x26')){_0x55e7c3[_0xbe26('0x27')]=this['account']['id'];}else{_0x55e7c3[_[_0xbe26('0x28')](this[_0xbe26('0x10')])+_0xbe26('0x29')]=this[_0xbe26('0x2a')]['id'];}_0x55e7c3[_[_0xbe26('0x28')](this[_0xbe26('0x10')])+_0xbe26('0x2b')]=this[_0xbe26('0x15')]['id'];var _0x4aa8c5=this[_0xbe26('0x15')];if(rpc[this[_0xbe26('0x10')]+_0xbe26('0x2c')]){if(this[_0xbe26('0x10')]===_0xbe26('0x1c')){_0x55e7c3[_0xbe26('0x2d')]=this[_0xbe26('0x1e')][_0xbe26('0x2e')];_0x55e7c3[_0xbe26('0x2f')]=''+_[_0xbe26('0x30')](_0x55e7c3[_0xbe26('0x11')],_0xbe26('0x31'),_0xbe26('0x32'))+_0xbe26('0x33');_0x55e7c3['headers']={'Auto-Submitted':_0xbe26('0x34'),'X-Auto-Response-Suppress':_0xbe26('0x35'),'Precedence':'auto_reply'};return mailRpc[_0xbe26('0x36')](this[_0xbe26('0x2a')][_0xbe26('0x37')],_0x55e7c3)[_0xbe26('0x38')](function(_0x553256){logger[_0xbe26('0x17')](_0xbe26('0x39'),_0x139495);_0x55e7c3[_0xbe26('0x2e')]=_0x553256['message'][_0xbe26('0x2e')];return rpc[_0x15ea6f+_0xbe26('0x2c')][_0xbe26('0x3a')](_0x55e7c3);})[_0xbe26('0x38')](function(_0xa86d11){logger['info']('[%s][AUTOREPLY]\x20%s',_0x139495,JSON[_0xbe26('0x3b')](_0xa86d11));})[_0xbe26('0x3c')](function(_0x3ce484){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x139495,JSON[_0xbe26('0x3b')](_0x3ce484));})[_0xbe26('0x3d')](function(){Promise[_0xbe26('0x3e')]()[_0xbe26('0x38')](function(){if(_0x37daf9[0x0]!=='2'||_0x4aa8c5[_0xbe26('0x3f')])return;return rpc[_0x15ea6f+_0xbe26('0x40')][_0xbe26('0x41')](_0x4aa8c5['id'],{'autoreplyExecuted':!![]})[_0xbe26('0x38')](function(_0x5e64a4){logger[_0xbe26('0x17')](_0xbe26('0x1a'),_0x139495,JSON[_0xbe26('0x3b')](_0x5e64a4));})['catch'](function(_0x5bc792){logger[_0xbe26('0x42')](_0xbe26('0x43'),_0x139495,JSON[_0xbe26('0x3b')](_0x5bc792));});})['then'](function(){_0x2b2b35[_0xbe26('0x19')]();});});}else{return rpc[this[_0xbe26('0x10')]+'Message'][_0xbe26('0x3a')](_0x55e7c3)['then'](function(){logger[_0xbe26('0x17')]('[%s][AUTOREPLY]\x20%s',_0x139495,_0x55e7c3[_0xbe26('0x11')]);})[_0xbe26('0x3c')](function(_0x5b7898){logger[_0xbe26('0x42')](_0xbe26('0x13'),_0x139495,JSON[_0xbe26('0x3b')](_0x5b7898));})[_0xbe26('0x3d')](function(){Promise[_0xbe26('0x3e')]()[_0xbe26('0x38')](function(){if(_0x37daf9[0x0]!=='2'||_0x4aa8c5[_0xbe26('0x3f')])return;return rpc[_0x15ea6f+_0xbe26('0x40')]['update'](_0x4aa8c5['id'],{'autoreplyExecuted':!![]})[_0xbe26('0x38')](function(_0x5e245e){logger[_0xbe26('0x17')](_0xbe26('0x1a'),_0x139495,JSON[_0xbe26('0x3b')](_0x5e245e));})['catch'](function(_0x21de01){logger['error'](_0xbe26('0x43'),_0x139495,JSON[_0xbe26('0x3b')](_0x21de01));});})['then'](function(){_0x2b2b35[_0xbe26('0x19')]();});});}}}catch(_0x214852){logger[_0xbe26('0x42')](_0xbe26('0x13'),_0x139495,JSON['stringify'](_0x214852));_0x2b2b35[_0xbe26('0x44')]();}};}; \ No newline at end of file +var _0x1737=['AccountId','inReplyTo','messageId','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','create','stringify','catch','error','finally','resolve','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Message','Interaction','stop','lodash','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','channel','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x1737,0xa0));var _0x7173=function(_0x5e4b78,_0xf3825f){_0x5e4b78=_0x5e4b78-0x0;var _0xec812c=_0x1737[_0x5e4b78];return _0xec812c;};'use strict';var _=require(_0x7173('0x0'));var moment=require(_0x7173('0x1'));var utils=require('./utils');var logger=require(_0x7173('0x2'))('routing');var rpc={'chatMessage':require(_0x7173('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7173('0x4')),'faxMessage':require(_0x7173('0x5')),'whatsappMessage':require(_0x7173('0x6')),'chatInteraction':require(_0x7173('0x7')),'openchannelInteraction':require(_0x7173('0x8')),'mailInteraction':require(_0x7173('0x9')),'smsInteraction':require(_0x7173('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x7173('0xb'))};var mailRpc=require('../../mailRpc');exports[_0x7173('0xc')]=function(_0x285af0,_0x383847,_0x2035cd,_0x112e22){return function(_0x54753b){try{var _0x4d2628=this[_0x7173('0xd')];if(_0x4d2628==='mail'&&_0x112e22[_0x7173('0xe')][_0x7173('0xf')]){logger['info'](_0x7173('0x10'),_0x285af0,_0x7173('0x11'));return _0x54753b[_0x7173('0x12')]();}if(_0x383847[0x0]==='1'&&(_[_0x7173('0x13')](this[_0x7173('0x14')]['created'])||!this[_0x7173('0x14')][_0x7173('0x15')])){logger[_0x7173('0x16')](_0x7173('0x10'),_0x285af0,'Autoreply\x20already\x20sent');return _0x54753b[_0x7173('0x12')]();}if(_0x383847[0x0]==='2'&&this['interaction'][_0x7173('0x17')]){logger[_0x7173('0x16')](_0x7173('0x18'),_0x285af0,'One\x20Time\x20already\x20sent');return _0x54753b[_0x7173('0x12')]();}var _0x54c69d={'ContactId':this[_0x7173('0x19')]['id'],'sentAt':moment()['format'](_0x7173('0x1a')),'direction':_0x7173('0x1b')};if(this['channel']===_0x7173('0x1c')){_0x54c69d[_0x7173('0xe')]=utils[_0x7173('0x1d')](_0x383847[0x2],this);}else{_0x54c69d[_0x7173('0xe')]=utils['getMustacheRender'](_0x383847[0x1],this);}if(this[_0x7173('0x1e')]){_0x54c69d['to']=this['message'][_0x7173('0x1f')]||'';if(this[_0x7173('0xd')]==='mail'&&_0x383847[0x1]==='1'){_0x54c69d['cc']=this[_0x7173('0x1e')]['cc']||'';}_0x54c69d[_0x7173('0x1f')]=this[_0x7173('0x1e')]['to']||'';_0x54c69d['phone']=this[_0x7173('0x1e')][_0x7173('0x20')]||'';_0x54c69d['read']=!![];if(this[_0x7173('0x1e')][_0x7173('0x21')]){_0x54c69d['subject']='';_0x54c69d[_0x7173('0x21')]+=_[_0x7173('0x22')](this[_0x7173('0x1e')][_0x7173('0x21')],_0x7173('0x23'))?'':_0x7173('0x24');_0x54c69d[_0x7173('0x21')]+=this[_0x7173('0x1e')][_0x7173('0x21')];}}if(this['channel']===_0x7173('0x25')){_0x54c69d[_0x7173('0x26')]=this[_0x7173('0x27')]['id'];}else{_0x54c69d[_[_0x7173('0x28')](this['channel'])+_0x7173('0x29')]=this['account']['id'];}_0x54c69d[_['upperFirst'](this['channel'])+'InteractionId']=this['interaction']['id'];var _0x10a527=this[_0x7173('0x14')];if(rpc[this[_0x7173('0xd')]+'Message']){if(this[_0x7173('0xd')]==='mail'){_0x54c69d[_0x7173('0x2a')]=this['message'][_0x7173('0x2b')];_0x54c69d['html']=_0x7173('0x2c')+_[_0x7173('0x2d')](_0x54c69d[_0x7173('0xe')],_0x7173('0x2e'),_0x7173('0x2f'))+_0x7173('0x30');_0x54c69d[_0x7173('0x31')]={'Auto-Submitted':_0x7173('0x32'),'X-Auto-Response-Suppress':_0x7173('0x33'),'Precedence':_0x7173('0x34')};return mailRpc[_0x7173('0x35')](this[_0x7173('0x27')][_0x7173('0x36')],_0x54c69d)[_0x7173('0x37')](function(_0x4b8ed7){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x285af0);_0x54c69d[_0x7173('0x2b')]=_0x4b8ed7['message'][_0x7173('0x2b')];return rpc[_0x4d2628+'Message'][_0x7173('0x38')](_0x54c69d);})[_0x7173('0x37')](function(_0x32f1b2){logger['info'](_0x7173('0x10'),_0x285af0,JSON[_0x7173('0x39')](_0x32f1b2));})[_0x7173('0x3a')](function(_0xd26a){logger[_0x7173('0x3b')]('[RPC][%s][AUTOREPLY]\x20%s',_0x285af0,JSON[_0x7173('0x39')](_0xd26a));})[_0x7173('0x3c')](function(){Promise[_0x7173('0x3d')]()[_0x7173('0x37')](function(){if(_0x383847[0x0]!=='2'||_0x10a527[_0x7173('0x17')])return;return rpc[_0x4d2628+'Interaction'][_0x7173('0x3e')](_0x10a527['id'],{'autoreplyExecuted':!![]})['then'](function(_0x50fc97){logger[_0x7173('0x16')](_0x7173('0x18'),_0x285af0,JSON['stringify'](_0x50fc97));})[_0x7173('0x3a')](function(_0x12797c){logger[_0x7173('0x3b')](_0x7173('0x3f'),_0x285af0,JSON[_0x7173('0x39')](_0x12797c));});})[_0x7173('0x37')](function(){_0x54753b[_0x7173('0x12')]();});});}else{return rpc[this[_0x7173('0xd')]+_0x7173('0x40')][_0x7173('0x38')](_0x54c69d)[_0x7173('0x37')](function(){logger[_0x7173('0x16')](_0x7173('0x10'),_0x285af0,_0x54c69d[_0x7173('0xe')]);})[_0x7173('0x3a')](function(_0x58395f){logger['error']('[%s][AUTOREPLY]\x20%s',_0x285af0,JSON[_0x7173('0x39')](_0x58395f));})[_0x7173('0x3c')](function(){Promise[_0x7173('0x3d')]()[_0x7173('0x37')](function(){if(_0x383847[0x0]!=='2'||_0x10a527['autoreplyExecuted'])return;return rpc[_0x4d2628+_0x7173('0x41')][_0x7173('0x3e')](_0x10a527['id'],{'autoreplyExecuted':!![]})[_0x7173('0x37')](function(_0x2b83bf){logger[_0x7173('0x16')](_0x7173('0x18'),_0x285af0,JSON['stringify'](_0x2b83bf));})[_0x7173('0x3a')](function(_0x8c8ec6){logger[_0x7173('0x3b')](_0x7173('0x3f'),_0x285af0,JSON[_0x7173('0x39')](_0x8c8ec6));});})[_0x7173('0x37')](function(){_0x54753b[_0x7173('0x12')]();});});}}}catch(_0x330963){logger[_0x7173('0x3b')](_0x7173('0x10'),_0x285af0,JSON['stringify'](_0x330963));_0x54753b[_0x7173('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 5cd4aff..8f17b71 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 _0x079b=['[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','catch'];(function(_0x48e6e1,_0x4aed12){var _0x27633d=function(_0x3df189){while(--_0x3df189){_0x48e6e1['push'](_0x48e6e1['shift']());}};_0x27633d(++_0x4aed12);}(_0x079b,0x19d));var _0xb079=function(_0x6866e3,_0x3ddb25){_0x6866e3=_0x6866e3-0x0;var _0x394cfe=_0x079b[_0x6866e3];return _0x394cfe;};'use strict';var moment=require(_0xb079('0x0'));var logger=require(_0xb079('0x1'))(_0xb079('0x2'));var rpc={'chatInteraction':require(_0xb079('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xb079('0x4')),'mailInteraction':require(_0xb079('0x5')),'faxInteraction':require(_0xb079('0x6')),'whatsappInteraction':require(_0xb079('0x7'))};exports[_0xb079('0x8')]=function(_0xb09447,_0x2eadde,_0x3c2a3d,_0x51d24d){return function(_0x63e2f7){try{logger[_0xb079('0x9')](_0xb079('0xa'),_0xb09447,_0x2eadde[0x0]);var _0x53377f={'closed':0x1,'closedAt':moment()[_0xb079('0xb')](_0xb079('0xc')),'closeReason':_0xb079('0xd'),'disposition':_0x2eadde[0x0]};if(rpc[_0x51d24d['channel']+_0xb079('0xe')]){rpc[_0x51d24d[_0xb079('0xf')]+_0xb079('0xe')][_0xb079('0x10')](_0x51d24d[_0xb079('0x11')]['id'],_0x53377f)['then'](function(_0x15cf08){logger[_0xb079('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xb09447,_0x51d24d['interaction']['id']);})[_0xb079('0x12')](function(_0x129f89){logger['error'](_0xb079('0x13'),_0xb09447,JSON[_0xb079('0x14')](_0x129f89));})[_0xb079('0x15')](function(){_0x63e2f7[_0xb079('0x16')]();});}}catch(_0x44ce0c){logger[_0xb079('0x17')](_0xb079('0x13'),_0xb09447,JSON[_0xb079('0x14')](_0x44ce0c));_0x63e2f7[_0xb079('0x16')]();}};}; \ No newline at end of file +var _0xa4df=['info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence'];(function(_0x193d09,_0x2d5922){var _0x1ec751=function(_0x23126f){while(--_0x23126f){_0x193d09['push'](_0x193d09['shift']());}};_0x1ec751(++_0x2d5922);}(_0xa4df,0x185));var _0xfa4d=function(_0x3a5de2,_0x4bb9a4){_0x3a5de2=_0x3a5de2-0x0;var _0x3f2b1c=_0xa4df[_0x3a5de2];return _0x3f2b1c;};'use strict';var moment=require(_0xfa4d('0x0'));var logger=require(_0xfa4d('0x1'))(_0xfa4d('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xfa4d('0x3')),'smsInteraction':require(_0xfa4d('0x4')),'mailInteraction':require(_0xfa4d('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xfa4d('0x6')]=function(_0x1e8f22,_0x5105cd,_0x28a57e,_0x41b8ab){return function(_0x632b94){try{logger[_0xfa4d('0x7')](_0xfa4d('0x8'),_0x1e8f22,_0x5105cd[0x0]);var _0x7db3cc={'closed':0x1,'closedAt':moment()[_0xfa4d('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xfa4d('0xa'),'disposition':_0x5105cd[0x0]};if(rpc[_0x41b8ab[_0xfa4d('0xb')]+'Interaction']){rpc[_0x41b8ab[_0xfa4d('0xb')]+'Interaction'][_0xfa4d('0xc')](_0x41b8ab['interaction']['id'],_0x7db3cc)[_0xfa4d('0xd')](function(_0x395281){logger[_0xfa4d('0x7')](_0xfa4d('0xe'),_0x1e8f22,_0x41b8ab['interaction']['id']);})['catch'](function(_0xe5adbc){logger[_0xfa4d('0xf')](_0xfa4d('0x10'),_0x1e8f22,JSON['stringify'](_0xe5adbc));})['finally'](function(){_0x632b94[_0xfa4d('0x11')]();});}}catch(_0x5e39f3){logger[_0xfa4d('0xf')]('[%s][CLOSE]\x20%s',_0x1e8f22,JSON['stringify'](_0x5e39f3));_0x632b94[_0xfa4d('0x11')]();}};}; \ 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 468fcde..0790413 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 _0xe626=['speech','providerName','providerResponse','metadata','endConversation','catch','next','lodash','moment','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','out','sms','channel','whatsapp','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','stringify','finally','info','[%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'];(function(_0xd31621,_0x17b567){var _0x2e7ac0=function(_0x3c5a8d){while(--_0x3c5a8d){_0xd31621['push'](_0xd31621['shift']());}};_0x2e7ac0(++_0x17b567);}(_0xe626,0x9d));var _0x6e62=function(_0x550e3c,_0x1ffe38){_0x550e3c=_0x550e3c-0x0;var _0xaeb1c4=_0xe626[_0x550e3c];return _0xaeb1c4;};'use strict';var _=require(_0x6e62('0x0'));var moment=require(_0x6e62('0x1'));var apiai=require(_0x6e62('0x2'));var md5=require(_0x6e62('0x3'));var utils=require('./utils');var logger=require(_0x6e62('0x4'))(_0x6e62('0x5'));var rpc={'chatMessage':require(_0x6e62('0x6')),'openchannelMessage':require(_0x6e62('0x7')),'mailMessage':require(_0x6e62('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6e62('0x9')]=function(_0x157047,_0x55165e){return function(_0x32fd89){try{if(!_[_0x6e62('0xa')](this[_0x6e62('0xb')][_0x6e62('0xc')])){logger['info'](_0x6e62('0xd'),_0x157047,_0x6e62('0xe'));return _0x32fd89['next']();}var _0x2fbfd0={'ContactId':this['contact']['id'],'sentAt':moment()[_0x6e62('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x6e62('0x10')};if(this['channel']===_0x6e62('0x11')||this[_0x6e62('0x12')]===_0x6e62('0x13')){_0x2fbfd0[_0x6e62('0x14')]=this[_0x6e62('0xb')][_0x6e62('0x14')];}var _0x3b5c11=this['channel'];if(_0x3b5c11==='chat'){_0x2fbfd0[_0x6e62('0x15')]=this[_0x6e62('0x16')]['id'];}else{_0x2fbfd0[_['upperFirst'](_0x3b5c11)+_0x6e62('0x17')]=this[_0x6e62('0x16')]['id'];}_0x2fbfd0[_[_0x6e62('0x18')](_0x3b5c11)+_0x6e62('0x19')]=this['interaction']['id'];if(this[_0x6e62('0xb')][_0x6e62('0x1a')]){var _0x8aef1b=_0x55165e[0x2];if(!_[_0x6e62('0x1b')](_0x8aef1b)){_0x2fbfd0[_0x6e62('0x1c')]=utils[_0x6e62('0x1d')](_0x8aef1b,this);return rpc[_0x3b5c11+_0x6e62('0x1e')][_0x6e62('0x1f')](_0x2fbfd0)[_0x6e62('0x20')](function(_0x15bce5){logger['info'](_0x6e62('0xd'),_0x157047,_0x2fbfd0[_0x6e62('0x1c')]);})['catch'](function(_0xefbfb6){logger['error'](_0x6e62('0xd'),_0x157047,JSON[_0x6e62('0x21')](_0xefbfb6));})[_0x6e62('0x22')](function(){logger[_0x6e62('0x23')](_0x6e62('0x24'),_0x157047);_0x32fd89[_0x6e62('0x25')]();});}else{logger[_0x6e62('0x23')](_0x6e62('0x26'),_0x157047);_0x32fd89[_0x6e62('0x25')]();}}else{var _0x421d13=this;var _0x1954dc=apiai(_0x55165e[0x0],{'language':_0x55165e[0x1]||'en'});return _0x1954dc['textRequest'](this[_0x6e62('0x27')]['body'],{'sessionId':md5(this[_0x6e62('0xb')]['id'])})[_0x6e62('0x20')](function(_0x345af8){_0x421d13[_0x6e62('0x1c')][_0x6e62('0x28')]=_0x345af8;_0x2fbfd0[_0x6e62('0x1c')]=_0x345af8[_0x6e62('0x29')][_0x6e62('0x2a')][_0x6e62('0x2b')];_0x2fbfd0[_0x6e62('0x2c')]='dialogflow';_0x2fbfd0[_0x6e62('0x2d')]=JSON['stringify'](_0x345af8);return rpc[_0x3b5c11+_0x6e62('0x1e')][_0x6e62('0x1f')](_0x2fbfd0)[_0x6e62('0x20')](function(_0x17fee0){logger[_0x6e62('0x23')](_0x6e62('0xd'),_0x157047,_0x2fbfd0['body']);if(_0x345af8[_0x6e62('0x29')][_0x6e62('0x2e')][_0x6e62('0x2f')]){_0x32fd89['next']();}else{_0x32fd89['stop']();}})[_0x6e62('0x30')](function(_0x50813d){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x157047,JSON['stringify'](_0x50813d));_0x32fd89[_0x6e62('0x31')]();});})['catch'](function(_0x2d9172){logger['error'](_0x6e62('0xd'),_0x157047,_0x2d9172[_0x6e62('0x27')]);_0x32fd89[_0x6e62('0x31')]();});}}catch(_0x4f73b5){logger['error'](_0x6e62('0xd'),_0x157047,JSON[_0x6e62('0x21')](_0x4f73b5));_0x32fd89['stop']();}};}; \ No newline at end of file +var _0xbdb9=['phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','dialogflow','result','fulfillment','providerName','providerResponse','stringify','metadata','endConversation','catch','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xbdb9,0xac));var _0x9bdb=function(_0x5899ab,_0x445a13){_0x5899ab=_0x5899ab-0x0;var _0x341eab=_0xbdb9[_0x5899ab];return _0x341eab;};'use strict';var _=require(_0x9bdb('0x0'));var moment=require(_0x9bdb('0x1'));var apiai=require(_0x9bdb('0x2'));var md5=require(_0x9bdb('0x3'));var utils=require(_0x9bdb('0x4'));var logger=require('../../../../config/logger')(_0x9bdb('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9bdb('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x9bdb('0x7')]=function(_0x4e9c54,_0x369e4a){return function(_0x27cdd8){try{if(!_[_0x9bdb('0x8')](this[_0x9bdb('0x9')][_0x9bdb('0xa')])){logger[_0x9bdb('0xb')](_0x9bdb('0xc'),_0x4e9c54,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x27cdd8[_0x9bdb('0xd')]();}var _0x355bad={'ContactId':this[_0x9bdb('0xe')]['id'],'sentAt':moment()[_0x9bdb('0xf')](_0x9bdb('0x10')),'direction':'out'};if(this['channel']===_0x9bdb('0x11')||this[_0x9bdb('0x12')]===_0x9bdb('0x13')){_0x355bad[_0x9bdb('0x14')]=this[_0x9bdb('0x9')][_0x9bdb('0x14')];}var _0x5d626d=this[_0x9bdb('0x12')];if(_0x5d626d===_0x9bdb('0x15')){_0x355bad[_0x9bdb('0x16')]=this[_0x9bdb('0x17')]['id'];}else{_0x355bad[_[_0x9bdb('0x18')](_0x5d626d)+'AccountId']=this[_0x9bdb('0x17')]['id'];}_0x355bad[_[_0x9bdb('0x18')](_0x5d626d)+_0x9bdb('0x19')]=this['interaction']['id'];if(this[_0x9bdb('0x9')][_0x9bdb('0x1a')]){var _0x1cb06d=_0x369e4a[0x2];if(!_[_0x9bdb('0x1b')](_0x1cb06d)){_0x355bad[_0x9bdb('0x1c')]=utils[_0x9bdb('0x1d')](_0x1cb06d,this);return rpc[_0x5d626d+_0x9bdb('0x1e')][_0x9bdb('0x1f')](_0x355bad)[_0x9bdb('0x20')](function(_0x38b812){logger['info'](_0x9bdb('0xc'),_0x4e9c54,_0x355bad[_0x9bdb('0x1c')]);})['catch'](function(_0x119c69){logger[_0x9bdb('0x21')](_0x9bdb('0xc'),_0x4e9c54,JSON['stringify'](_0x119c69));})[_0x9bdb('0x22')](function(){logger[_0x9bdb('0xb')](_0x9bdb('0x23'),_0x4e9c54);_0x27cdd8['stop']();});}else{logger[_0x9bdb('0xb')](_0x9bdb('0x24'),_0x4e9c54);_0x27cdd8[_0x9bdb('0x25')]();}}else{var _0x2150da=this;var _0x41a213=apiai(_0x369e4a[0x0],{'language':_0x369e4a[0x1]||'en'});return _0x41a213[_0x9bdb('0x26')](this['message']['body'],{'sessionId':md5(this[_0x9bdb('0x9')]['id'])})[_0x9bdb('0x20')](function(_0x1bba44){_0x2150da['body'][_0x9bdb('0x27')]=_0x1bba44;_0x355bad[_0x9bdb('0x1c')]=_0x1bba44[_0x9bdb('0x28')][_0x9bdb('0x29')]['speech'];_0x355bad[_0x9bdb('0x2a')]='dialogflow';_0x355bad[_0x9bdb('0x2b')]=JSON[_0x9bdb('0x2c')](_0x1bba44);return rpc[_0x5d626d+_0x9bdb('0x1e')]['create'](_0x355bad)[_0x9bdb('0x20')](function(_0xab83c9){logger[_0x9bdb('0xb')](_0x9bdb('0xc'),_0x4e9c54,_0x355bad[_0x9bdb('0x1c')]);if(_0x1bba44[_0x9bdb('0x28')][_0x9bdb('0x2d')][_0x9bdb('0x2e')]){_0x27cdd8[_0x9bdb('0xd')]();}else{_0x27cdd8[_0x9bdb('0x25')]();}})['catch'](function(_0x3af112){logger[_0x9bdb('0x21')](_0x9bdb('0xc'),_0x4e9c54,JSON[_0x9bdb('0x2c')](_0x3af112));_0x27cdd8[_0x9bdb('0xd')]();});})[_0x9bdb('0x2f')](function(_0x106160){logger['error'](_0x9bdb('0xc'),_0x4e9c54,_0x106160['message']);_0x27cdd8[_0x9bdb('0xd')]();});}}catch(_0xed0f41){logger[_0x9bdb('0x21')](_0x9bdb('0xc'),_0x4e9c54,JSON[_0x9bdb('0x2c')](_0xed0f41));_0x27cdd8[_0x9bdb('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index e5ea804..b51c559 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 _0xba3d=['sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','next','message','stack','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xba3d,0x79));var _0xdba3=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xba3d[_0x455c6c];return _0x488242;};'use strict';var _=require('lodash');var dialogflow=require(_0xdba3('0x0'));var md5=require(_0xdba3('0x1'));var moment=require(_0xdba3('0x2'));var Promise=require(_0xdba3('0x3'));var logger=require('../../../../config/logger')(_0xdba3('0x4'));var utils=require(_0xdba3('0x5'));var rpc={'chatMessage':require(_0xdba3('0x6')),'openchannelMessage':require(_0xdba3('0x7')),'mailMessage':require(_0xdba3('0x8')),'smsMessage':require(_0xdba3('0x9')),'faxMessage':require(_0xdba3('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x696c96,_0x21f109,_0x44104e,_0x28462a){return new Promise(function(_0x1962d2,_0x174201){var _0x291ca0=_[_0xdba3('0xb')](_0x44104e);_0x291ca0['body']=_0x28462a;return rpc[_0x21f109+'Message'][_0xdba3('0xc')](_0x291ca0)[_0xdba3('0xd')](function(){logger[_0xdba3('0xe')](_0xdba3('0xf'),_0x696c96,_0x291ca0[_0xdba3('0x10')]);_0x1962d2();})[_0xdba3('0x11')](function(_0x275c4b){logger[_0xdba3('0x12')](_0xdba3('0xf'),_0x696c96,JSON[_0xdba3('0x13')](_0x275c4b));_0x174201(_0x275c4b);});});}exports[_0xdba3('0x14')]=function(_0x52a516,_0x4be64d){return function(_0xe46c2){try{if(!_[_0xdba3('0x15')](this[_0xdba3('0x16')][_0xdba3('0x17')])){logger[_0xdba3('0xe')](_0xdba3('0xf'),_0x52a516,_0xdba3('0x18'));return _0xe46c2['next']();}var _0x8dd080={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdba3('0x19')](_0xdba3('0x1a')),'direction':_0xdba3('0x1b')};if(this[_0xdba3('0x1c')]===_0xdba3('0x1d')||this['channel']===_0xdba3('0x1e')){_0x8dd080[_0xdba3('0x1f')]=this[_0xdba3('0x16')]['phone'];}var _0x47f07b=this[_0xdba3('0x1c')];if(_0x47f07b===_0xdba3('0x20')){_0x8dd080[_0xdba3('0x21')]=this[_0xdba3('0x22')]['id'];}else{_0x8dd080[_[_0xdba3('0x23')](_0x47f07b)+_0xdba3('0x24')]=this[_0xdba3('0x22')]['id'];}_0x8dd080[_['upperFirst'](_0x47f07b)+_0xdba3('0x25')]=this['interaction']['id'];if(this[_0xdba3('0x16')][_0xdba3('0x26')]){var _0xd88de8=_0x4be64d[0x4];if(!_[_0xdba3('0x27')](_0xd88de8)){_0x8dd080[_0xdba3('0x10')]=utils['getMustacheRender'](_0xd88de8,this);return rpc[_0x47f07b+_0xdba3('0x28')][_0xdba3('0xc')](_0x8dd080)[_0xdba3('0xd')](function(_0x398c2c){logger[_0xdba3('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x52a516,_0x8dd080[_0xdba3('0x10')]);})[_0xdba3('0x11')](function(_0x4c2b6e){logger[_0xdba3('0x12')](_0xdba3('0xf'),_0x52a516,JSON[_0xdba3('0x13')](_0x4c2b6e));})[_0xdba3('0x29')](function(){logger[_0xdba3('0xe')](_0xdba3('0x2a'),_0x52a516);_0xe46c2[_0xdba3('0x2b')]();});}else{logger[_0xdba3('0xe')](_0xdba3('0x2c'),_0x52a516);_0xe46c2[_0xdba3('0x2b')]();}}else{var _0x32296d=this;var _0x7436f8=_0x4be64d[0x2][_0xdba3('0x2d')](/\\n/g,'\x0a');var _0x244dd9={'credentials':{'private_key':_0x7436f8,'client_email':_0x4be64d[0x1]}};var _0x51fd97=new dialogflow[(_0xdba3('0x2e'))](_0x244dd9);var _0x1ee03a=_0x51fd97[_0xdba3('0x2f')](_0x4be64d[0x0],md5(_0x32296d[_0xdba3('0x16')]['id']));var _0xe496a9={'session':_0x1ee03a,'queryInput':{'text':{'text':_0x32296d['message'][_0xdba3('0x10')],'languageCode':_0x4be64d[0x3]||'en'}}};return _0x51fd97[_0xdba3('0x30')](_0xe496a9)[_0xdba3('0xd')](function(_0x10d38f){if(_0x10d38f&&_0x10d38f[_0xdba3('0x31')]){_0x32296d[_0xdba3('0x10')][_0xdba3('0x32')]=_0x10d38f;var _0x5ad3b8=_0x10d38f[0x0];var _0x17f55c=_0x5ad3b8[_0xdba3('0x33')]['diagnosticInfo']&&_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x34')]['fields']?_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x34')][_0xdba3('0x35')][_0xdba3('0x36')][_0xdba3('0x37')]:![];_0x32296d['body']['DIALOGFLOWV2_ACTION']=_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x38')];_0x32296d['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x39')];_0x32296d[_0xdba3('0x10')][_0xdba3('0x3a')]=_0x5ad3b8['queryResult'][_0xdba3('0x34')]&&_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x34')][_0xdba3('0x35')]?_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x34')]['fields'][_0xdba3('0x36')][_0xdba3('0x37')]:![];_0x32296d[_0xdba3('0x10')][_0xdba3('0x3b')]=_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x3c')][_0xdba3('0x3d')];_0x32296d[_0xdba3('0x10')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x5ad3b8[_0xdba3('0x33')][_0xdba3('0x3c')][_0xdba3('0x3e')];_0x32296d[_0xdba3('0x10')][_0xdba3('0x3f')]=_0x5ad3b8[_0xdba3('0x33')]['intent'][_0xdba3('0x40')];_0x32296d[_0xdba3('0x10')]['DIALOGFLOWV2_LANGUAGECODE']=_0x5ad3b8['queryResult'][_0xdba3('0x41')];_0x32296d[_0xdba3('0x10')][_0xdba3('0x42')]=_0x5ad3b8[_0xdba3('0x33')]['queryText'];_0x32296d['body'][_0xdba3('0x43')]=_0x5ad3b8[_0xdba3('0x33')]['intentDetectionConfidence'];_0x8dd080[_0xdba3('0x44')]=_0xdba3('0x32');_0x8dd080[_0xdba3('0x45')]=JSON[_0xdba3('0x13')](_0x10d38f);var _0x344af4=[];for(var _0x4018f1=0x0;_0x4018f1<_0x10d38f['length'];_0x4018f1++){var _0x325033=_0x10d38f[_0x4018f1];if(_0x325033&&_0x325033[_0xdba3('0x33')]&&_0x325033['queryResult'][_0xdba3('0x46')]){_0x344af4[_0xdba3('0x47')](createMessage(_0x52a516,_0x47f07b,_0x8dd080,_0x325033['queryResult'][_0xdba3('0x46')]));}}return Promise['all'](_0x344af4)[_0xdba3('0xd')](function(){if(_0x17f55c){_0xe46c2[_0xdba3('0x48')]();}else{_0xe46c2[_0xdba3('0x2b')]();}})[_0xdba3('0x11')](function(_0x14fcce){logger[_0xdba3('0x12')](_0xdba3('0xf'),_0x52a516,JSON[_0xdba3('0x13')](_0x14fcce));_0xe46c2[_0xdba3('0x48')]();});}})[_0xdba3('0x11')](function(_0x567872){logger[_0xdba3('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x52a516,_0x567872[_0xdba3('0x49')],_0x567872[_0xdba3('0x4a')]);_0xe46c2[_0xdba3('0x48')]();});}}catch(_0x2c9a27){logger['error'](_0xdba3('0xf'),_0x52a516,JSON['stringify'](_0x2c9a27));_0xe46c2[_0xdba3('0x2b')]();}};}; \ No newline at end of file +var _0x1312=['end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','providerResponse','fulfillmentText','push','all','lodash','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','then','catch','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields'];(function(_0x4a97f8,_0x19f15b){var _0x34b7fe=function(_0x5a2858){while(--_0x5a2858){_0x4a97f8['push'](_0x4a97f8['shift']());}};_0x34b7fe(++_0x19f15b);}(_0x1312,0x9d));var _0x2131=function(_0x356005,_0x411466){_0x356005=_0x356005-0x0;var _0x2bb35b=_0x1312[_0x356005];return _0x2bb35b;};'use strict';var _=require(_0x2131('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x2131('0x1'));var Promise=require('bluebird');var logger=require(_0x2131('0x2'))(_0x2131('0x3'));var utils=require(_0x2131('0x4'));var rpc={'chatMessage':require(_0x2131('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2131('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2131('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x3d6912,_0x27b71c,_0x3a521e,_0x15088f){return new Promise(function(_0xc8b77f,_0x42e6b1){var _0x5826b7=_['clone'](_0x3a521e);_0x5826b7[_0x2131('0x8')]=_0x15088f;return rpc[_0x27b71c+_0x2131('0x9')][_0x2131('0xa')](_0x5826b7)['then'](function(){logger[_0x2131('0xb')](_0x2131('0xc'),_0x3d6912,_0x5826b7[_0x2131('0x8')]);_0xc8b77f();})['catch'](function(_0x423d09){logger[_0x2131('0xd')](_0x2131('0xc'),_0x3d6912,JSON[_0x2131('0xe')](_0x423d09));_0x42e6b1(_0x423d09);});});}exports[_0x2131('0xf')]=function(_0x4fa011,_0x45bfd4){return function(_0x576de4){try{if(!_[_0x2131('0x10')](this[_0x2131('0x11')][_0x2131('0x12')])){logger['info'](_0x2131('0xc'),_0x4fa011,_0x2131('0x13'));return _0x576de4[_0x2131('0x14')]();}var _0x5d3728={'ContactId':this[_0x2131('0x15')]['id'],'sentAt':moment()[_0x2131('0x16')](_0x2131('0x17')),'direction':'out'};if(this['channel']==='sms'||this[_0x2131('0x18')]===_0x2131('0x19')){_0x5d3728[_0x2131('0x1a')]=this[_0x2131('0x11')][_0x2131('0x1a')];}var _0x437b4f=this[_0x2131('0x18')];if(_0x437b4f===_0x2131('0x1b')){_0x5d3728[_0x2131('0x1c')]=this[_0x2131('0x1d')]['id'];}else{_0x5d3728[_[_0x2131('0x1e')](_0x437b4f)+_0x2131('0x1f')]=this[_0x2131('0x1d')]['id'];}_0x5d3728[_['upperFirst'](_0x437b4f)+_0x2131('0x20')]=this[_0x2131('0x11')]['id'];if(this[_0x2131('0x11')][_0x2131('0x21')]){var _0x14c085=_0x45bfd4[0x4];if(!_[_0x2131('0x22')](_0x14c085)){_0x5d3728[_0x2131('0x8')]=utils[_0x2131('0x23')](_0x14c085,this);return rpc[_0x437b4f+_0x2131('0x9')][_0x2131('0xa')](_0x5d3728)[_0x2131('0x24')](function(_0x2194e9){logger[_0x2131('0xb')](_0x2131('0xc'),_0x4fa011,_0x5d3728['body']);})[_0x2131('0x25')](function(_0x4f81c7){logger[_0x2131('0xd')](_0x2131('0xc'),_0x4fa011,JSON['stringify'](_0x4f81c7));})['finally'](function(){logger[_0x2131('0xb')](_0x2131('0x26'),_0x4fa011);_0x576de4[_0x2131('0x27')]();});}else{logger[_0x2131('0xb')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4fa011);_0x576de4['stop']();}}else{var _0xd32952=this;var _0x358632=_0x45bfd4[0x2][_0x2131('0x28')](/\\n/g,'\x0a');var _0x4b4d71={'credentials':{'private_key':_0x358632,'client_email':_0x45bfd4[0x1]}};var _0x33622d=new dialogflow[(_0x2131('0x29'))](_0x4b4d71);var _0x264ddf=_0x33622d[_0x2131('0x2a')](_0x45bfd4[0x0],md5(_0xd32952['interaction']['id']));var _0x1c4518={'session':_0x264ddf,'queryInput':{'text':{'text':_0xd32952[_0x2131('0x2b')][_0x2131('0x8')],'languageCode':_0x45bfd4[0x3]||'en'}}};return _0x33622d[_0x2131('0x2c')](_0x1c4518)[_0x2131('0x24')](function(_0x1dda6c){if(_0x1dda6c&&_0x1dda6c[_0x2131('0x2d')]){_0xd32952[_0x2131('0x8')][_0x2131('0x2e')]=_0x1dda6c;var _0x3cd6d1=_0x1dda6c[0x0];var _0x52d235=_0x3cd6d1[_0x2131('0x2f')]['diagnosticInfo']&&_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x30')][_0x2131('0x31')]?_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x30')][_0x2131('0x31')][_0x2131('0x32')][_0x2131('0x33')]:![];_0xd32952['body']['DIALOGFLOWV2_ACTION']=_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x34')];_0xd32952[_0x2131('0x8')][_0x2131('0x35')]=_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x36')];_0xd32952[_0x2131('0x8')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x30')]&&_0x3cd6d1[_0x2131('0x2f')]['diagnosticInfo'][_0x2131('0x31')]?_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x30')][_0x2131('0x31')][_0x2131('0x32')]['boolValue']:![];_0xd32952[_0x2131('0x8')][_0x2131('0x37')]=_0x3cd6d1['queryResult']['intent'][_0x2131('0x38')];_0xd32952[_0x2131('0x8')][_0x2131('0x39')]=_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x3a')][_0x2131('0x3b')];_0xd32952[_0x2131('0x8')][_0x2131('0x3c')]=_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x3a')][_0x2131('0x3d')];_0xd32952[_0x2131('0x8')]['DIALOGFLOWV2_LANGUAGECODE']=_0x3cd6d1['queryResult'][_0x2131('0x3e')];_0xd32952['body'][_0x2131('0x3f')]=_0x3cd6d1[_0x2131('0x2f')][_0x2131('0x40')];_0xd32952['body']['DIALOGFLOWV2_SCORE']=_0x3cd6d1[_0x2131('0x2f')]['intentDetectionConfidence'];_0x5d3728['providerName']=_0x2131('0x2e');_0x5d3728[_0x2131('0x41')]=JSON[_0x2131('0xe')](_0x1dda6c);var _0x10ec6=[];for(var _0x45928c=0x0;_0x45928c<_0x1dda6c[_0x2131('0x2d')];_0x45928c++){var _0x3204fb=_0x1dda6c[_0x45928c];if(_0x3204fb&&_0x3204fb[_0x2131('0x2f')]&&_0x3204fb[_0x2131('0x2f')][_0x2131('0x42')]){_0x10ec6[_0x2131('0x43')](createMessage(_0x4fa011,_0x437b4f,_0x5d3728,_0x3204fb[_0x2131('0x2f')][_0x2131('0x42')]));}}return Promise[_0x2131('0x44')](_0x10ec6)[_0x2131('0x24')](function(){if(_0x52d235){_0x576de4[_0x2131('0x14')]();}else{_0x576de4[_0x2131('0x27')]();}})[_0x2131('0x25')](function(_0x10a4d2){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4fa011,JSON[_0x2131('0xe')](_0x10a4d2));_0x576de4[_0x2131('0x14')]();});}})[_0x2131('0x25')](function(_0x38a56e){logger[_0x2131('0xd')](_0x2131('0xc'),_0x4fa011,_0x38a56e[_0x2131('0x2b')],_0x38a56e['stack']);_0x576de4[_0x2131('0x14')]();});}}catch(_0x9e29b6){logger[_0x2131('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x4fa011,JSON[_0x2131('0xe')](_0x9e29b6));_0x576de4[_0x2131('0x27')]();}};}; \ 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 5594ed9..5a139a2 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 _0xf0ae=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string'];(function(_0x111c75,_0x2822ff){var _0x49fc4d=function(_0x218cc9){while(--_0x218cc9){_0x111c75['push'](_0x111c75['shift']());}};_0x49fc4d(++_0x2822ff);}(_0xf0ae,0x155));var _0xef0a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xf0ae[_0x173441];return _0x2423a8;};'use strict';var schema=require(_0xef0a('0x0'));var _=require(_0xef0a('0x1'));var htmlToText=require(_0xef0a('0x2'));var utils=require(_0xef0a('0x3'));var logger=require(_0xef0a('0x4'))(_0xef0a('0x5'));var gotoif=schema({'condition':{'type':_0xef0a('0x6'),'required':!![],'message':_0xef0a('0x7')},'priorityTrue':{'type':'number','message':_0xef0a('0x8')},'priorityFalse':{'type':_0xef0a('0x9'),'message':_0xef0a('0xa')}});exports[_0xef0a('0xb')]=function(_0x2841d9,_0x3a1455){return function(_0x46a9ba){try{var _0x118775={'condition':htmlToText[_0xef0a('0xc')](utils[_0xef0a('0xd')](_0x3a1455[0x0],this),{'wordwrap':![]})[_0xef0a('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3a1455[0x1],'priorityFalse':_0x3a1455[0x2]};var _0x18488b=gotoif[_0xef0a('0x0')](_0x118775,{'typecast':!![]});if(_0x18488b[_0xef0a('0xf')]){logger[_0xef0a('0x10')](_0xef0a('0x11'),_0x2841d9,_[_0xef0a('0x12')](_0x18488b,_0xef0a('0x13'))[_0xef0a('0x14')](',\x20'));_0x46a9ba[_0xef0a('0x15')]();}else{try{var _0x1a373b=eval('('+_0x118775[_0xef0a('0x16')]+')');var _0xedae13=_0x1a373b?_0x118775['priorityTrue']:_0x118775['priorityFalse'];logger[_0xef0a('0x17')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2841d9,_0x118775[_0xef0a('0x16')],_0x1a373b,_0xedae13||_0xef0a('0x18'));if(_0xedae13){var _0x226848=_['findIndex'](_0x46a9ba[_0xef0a('0x19')](),{'p':_0xedae13});if(_0x226848>=0x0){logger['info'](_0xef0a('0x1a'),_0x2841d9,_0xedae13||_0xef0a('0x18'),_0x226848);_0x46a9ba[_0xef0a('0x18')](_0x226848);}else{logger[_0xef0a('0x17')](_0xef0a('0x1b'),_0x2841d9,_0xedae13||_0xef0a('0x18'));_0x46a9ba[_0xef0a('0x15')]();}}else{_0x46a9ba[_0xef0a('0x18')]();}}catch(_0x470f5d){logger[_0xef0a('0x10')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2841d9,_0x470f5d[_0xef0a('0x13')]);_0x46a9ba[_0xef0a('0x15')]();}}}catch(_0x37c8ab){logger['error'](_0xef0a('0x11'),_0x2841d9,JSON[_0xef0a('0x1c')](_0x37c8ab));_0x46a9ba[_0xef0a('0x15')]();}};}; \ No newline at end of file +var _0x56a5=['priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','./utils','../../../../config/logger','routing','string','number'];(function(_0x44f7e4,_0xafecef){var _0x204ed3=function(_0x38ffc5){while(--_0x38ffc5){_0x44f7e4['push'](_0x44f7e4['shift']());}};_0x204ed3(++_0xafecef);}(_0x56a5,0x1f2));var _0x556a=function(_0x1dba7c,_0x1b4722){_0x1dba7c=_0x1dba7c-0x0;var _0x12c849=_0x56a5[_0x1dba7c];return _0x12c849;};'use strict';var schema=require(_0x556a('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x556a('0x1'));var logger=require(_0x556a('0x2'))(_0x556a('0x3'));var gotoif=schema({'condition':{'type':_0x556a('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x556a('0x5'),'message':_0x556a('0x6')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x556a('0x7')]=function(_0x45f8bb,_0xc6b02d){return function(_0xf5d9a){try{var _0x1891bf={'condition':htmlToText['fromString'](utils[_0x556a('0x8')](_0xc6b02d[0x0],this),{'wordwrap':![]})[_0x556a('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xc6b02d[0x1],'priorityFalse':_0xc6b02d[0x2]};var _0x459ec6=gotoif[_0x556a('0x0')](_0x1891bf,{'typecast':!![]});if(_0x459ec6[_0x556a('0xa')]){logger['error'](_0x556a('0xb'),_0x45f8bb,_[_0x556a('0xc')](_0x459ec6,_0x556a('0xd'))['join'](',\x20'));_0xf5d9a[_0x556a('0xe')]();}else{try{var _0x32d61c=eval('('+_0x1891bf[_0x556a('0xf')]+')');var _0x4873a1=_0x32d61c?_0x1891bf[_0x556a('0x10')]:_0x1891bf[_0x556a('0x11')];logger[_0x556a('0x12')](_0x556a('0x13'),_0x45f8bb,_0x1891bf[_0x556a('0xf')],_0x32d61c,_0x4873a1||_0x556a('0x14'));if(_0x4873a1){var _0xa3bf73=_[_0x556a('0x15')](_0xf5d9a[_0x556a('0x16')](),{'p':_0x4873a1});if(_0xa3bf73>=0x0){logger[_0x556a('0x12')](_0x556a('0x17'),_0x45f8bb,_0x4873a1||_0x556a('0x14'),_0xa3bf73);_0xf5d9a[_0x556a('0x14')](_0xa3bf73);}else{logger[_0x556a('0x12')](_0x556a('0x18'),_0x45f8bb,_0x4873a1||_0x556a('0x14'));_0xf5d9a[_0x556a('0xe')]();}}else{_0xf5d9a['next']();}}catch(_0x278878){logger[_0x556a('0x19')](_0x556a('0x1a'),_0x45f8bb,_0x278878[_0x556a('0xd')]);_0xf5d9a[_0x556a('0xe')]();}}}catch(_0x5260d8){logger['error'](_0x556a('0xb'),_0x45f8bb,JSON[_0x556a('0x1b')](_0x5260d8));_0xf5d9a[_0x556a('0xe')]();}};}; \ 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 38a82b8..facb604 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 _0xee15=['rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0x52a7f2,_0x2c1cca){var _0x25f0b2=function(_0x2e50bb){while(--_0x2e50bb){_0x52a7f2['push'](_0x52a7f2['shift']());}};_0x25f0b2(++_0x2c1cca);}(_0xee15,0x7e));var _0x5ee1=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xee15[_0x43a6cd];return _0x5acb36;};'use strict';var schema=require('validate');var _=require(_0x5ee1('0x0'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x5ee1('0x1'),'required':!![],'message':_0x5ee1('0x2')}});exports['consequence']=function(_0x4d88c1,_0x30e8f0){return function(_0x2c46f6){try{var _0x4d384c={'priority':_0x30e8f0[0x0]};var _0x312fa8=gotop[_0x5ee1('0x3')](_0x4d384c,{'typecast':!![]});if(_0x312fa8[_0x5ee1('0x4')]){logger[_0x5ee1('0x5')](_0x5ee1('0x6'),_0x4d88c1,_[_0x5ee1('0x7')](_0x312fa8,_0x5ee1('0x8'))[_0x5ee1('0x9')](',\x20'));_0x2c46f6[_0x5ee1('0xa')]();}else{logger['info'](_0x5ee1('0xb'),_0x4d88c1,_0x4d384c[_0x5ee1('0xc')]);if(_0x4d384c[_0x5ee1('0xc')]){var _0x241f28=_[_0x5ee1('0xd')](_0x2c46f6[_0x5ee1('0xe')](),{'p':_0x4d384c[_0x5ee1('0xc')]});if(_0x241f28>=0x0){logger[_0x5ee1('0xf')](_0x5ee1('0x10'),_0x4d88c1,_0x4d384c['priority']||_0x5ee1('0x11'),_0x241f28);_0x2c46f6['next'](_0x241f28);}else{logger['info'](_0x5ee1('0x12'),_0x4d88c1,_0x4d384c[_0x5ee1('0xc')]||_0x5ee1('0x11'));_0x2c46f6[_0x5ee1('0xa')]();}}else{_0x2c46f6[_0x5ee1('0x11')]();}}}catch(_0x33e6bc){logger[_0x5ee1('0x5')]('[%s][GOTOP]\x20%s',_0x4d88c1,JSON[_0x5ee1('0x13')](_0x33e6bc));_0x2c46f6[_0x5ee1('0xa')]();}};}; \ No newline at end of file +var _0xcfe6=['findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','consequence','error','[%s][GOTOP]\x20%s','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority'];(function(_0x41bc3a,_0x39021f){var _0x965f4a=function(_0x52ad92){while(--_0x52ad92){_0x41bc3a['push'](_0x41bc3a['shift']());}};_0x965f4a(++_0x39021f);}(_0xcfe6,0x9f));var _0x6cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe6[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x6cfe('0x0'));var _=require(_0x6cfe('0x1'));var logger=require(_0x6cfe('0x2'))(_0x6cfe('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x6cfe('0x4')]=function(_0x1b8f88,_0x268aff){return function(_0x2b6a07){try{var _0x3aa00d={'priority':_0x268aff[0x0]};var _0x30fe69=gotop[_0x6cfe('0x0')](_0x3aa00d,{'typecast':!![]});if(_0x30fe69['length']){logger[_0x6cfe('0x5')](_0x6cfe('0x6'),_0x1b8f88,_[_0x6cfe('0x7')](_0x30fe69,_0x6cfe('0x8'))['join'](',\x20'));_0x2b6a07[_0x6cfe('0x9')]();}else{logger['info'](_0x6cfe('0xa'),_0x1b8f88,_0x3aa00d[_0x6cfe('0xb')]);if(_0x3aa00d[_0x6cfe('0xb')]){var _0x2d1911=_[_0x6cfe('0xc')](_0x2b6a07[_0x6cfe('0xd')](),{'p':_0x3aa00d[_0x6cfe('0xb')]});if(_0x2d1911>=0x0){logger['info'](_0x6cfe('0xe'),_0x1b8f88,_0x3aa00d[_0x6cfe('0xb')]||_0x6cfe('0xf'),_0x2d1911);_0x2b6a07['next'](_0x2d1911);}else{logger[_0x6cfe('0x10')](_0x6cfe('0x11'),_0x1b8f88,_0x3aa00d[_0x6cfe('0xb')]||_0x6cfe('0xf'));_0x2b6a07['stop']();}}else{_0x2b6a07['next']();}}}catch(_0x489f8e){logger[_0x6cfe('0x5')](_0x6cfe('0x6'),_0x1b8f88,JSON[_0x6cfe('0x12')](_0x489f8e));_0x2b6a07['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 3b7482a..a8b3166 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 _0xf042=['../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','stringify','stop','error','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0xf042,0xfe));var _0x2f04=function(_0x5aaf4d,_0xd26b38){_0x5aaf4d=_0x5aaf4d-0x0;var _0x4d85bd=_0xf042[_0x5aaf4d];return _0x4d85bd;};'use strict';var _=require(_0x2f04('0x0'));var utils=require(_0x2f04('0x1'));var logger=require(_0x2f04('0x2'))('routing');var rpc={'chatMessage':require(_0x2f04('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2f04('0x4')),'smsMessage':require(_0x2f04('0x5')),'faxMessage':require(_0x2f04('0x6')),'whatsappMessage':require(_0x2f04('0x7'))};exports[_0x2f04('0x8')]=function(_0x492a1c,_0x9a49e8){return function(_0xa2d6c6){try{var _0xe8c454={'body':utils['getMustacheRender'](_0x9a49e8[0x0],this),'ContactId':this[_0x2f04('0x9')]['id']};if(this[_0x2f04('0xa')]===_0x2f04('0xb')){_0xe8c454[_0x2f04('0xc')]=this[_0x2f04('0xd')]['id'];}else{_0xe8c454[_[_0x2f04('0xe')](this[_0x2f04('0xa')])+'AccountId']=this[_0x2f04('0xd')]['id'];}_0xe8c454[_[_0x2f04('0xe')](this['channel'])+_0x2f04('0xf')]=this['interaction']['id'];if(rpc[this[_0x2f04('0xa')]+_0x2f04('0x10')]){return rpc[this[_0x2f04('0xa')]+'Message'][_0x2f04('0x11')](_0xe8c454)[_0x2f04('0x12')](function(_0x7fd344){logger[_0x2f04('0x13')](_0x2f04('0x14'),_0x492a1c,_0xe8c454['body']);_0xa2d6c6[_0x2f04('0x15')]();})[_0x2f04('0x16')](function(_0x41e525){logger['error'](_0x2f04('0x14'),_0x492a1c,JSON[_0x2f04('0x17')](_0x41e525));_0xa2d6c6[_0x2f04('0x18')]();});}}catch(_0x38cb1a){logger[_0x2f04('0x19')](_0x2f04('0x14'),_0x492a1c,JSON[_0x2f04('0x17')](_0x38cb1a));_0xa2d6c6[_0x2f04('0x18')]();}};}; \ No newline at end of file +var _0x1060=['getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x112080,_0x1f2b71){var _0x4b46ef=function(_0x2d69a2){while(--_0x2d69a2){_0x112080['push'](_0x112080['shift']());}};_0x4b46ef(++_0x1f2b71);}(_0x1060,0x147));var _0x0106=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1060[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x0106('0x0'));var utils=require(_0x0106('0x1'));var logger=require(_0x0106('0x2'))(_0x0106('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0106('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0106('0x5')),'faxMessage':require(_0x0106('0x6')),'whatsappMessage':require(_0x0106('0x7'))};exports[_0x0106('0x8')]=function(_0x5946ad,_0x260c50){return function(_0xa8504f){try{var _0x848c04={'body':utils[_0x0106('0x9')](_0x260c50[0x0],this),'ContactId':this[_0x0106('0xa')]['id']};if(this[_0x0106('0xb')]===_0x0106('0xc')){_0x848c04[_0x0106('0xd')]=this[_0x0106('0xe')]['id'];}else{_0x848c04[_[_0x0106('0xf')](this['channel'])+_0x0106('0x10')]=this[_0x0106('0xe')]['id'];}_0x848c04[_['upperFirst'](this[_0x0106('0xb')])+_0x0106('0x11')]=this[_0x0106('0x12')]['id'];if(rpc[this[_0x0106('0xb')]+'Message']){return rpc[this[_0x0106('0xb')]+_0x0106('0x13')]['create'](_0x848c04)['then'](function(_0x56f982){logger[_0x0106('0x14')](_0x0106('0x15'),_0x5946ad,_0x848c04[_0x0106('0x16')]);_0xa8504f[_0x0106('0x17')]();})[_0x0106('0x18')](function(_0x576d5d){logger[_0x0106('0x19')](_0x0106('0x15'),_0x5946ad,JSON['stringify'](_0x576d5d));_0xa8504f[_0x0106('0x1a')]();});}}catch(_0x12f256){logger[_0x0106('0x19')](_0x0106('0x15'),_0x5946ad,JSON[_0x0106('0x1b')](_0x12f256));_0xa8504f[_0x0106('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 2d01251..5f5e63b 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 _0xf324=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf324,0xa6));var _0x4f32=function(_0x5b6699,_0x57e850){_0x5b6699=_0x5b6699-0x0;var _0x2a6c63=_0xf324[_0x5b6699];return _0x2a6c63;};'use strict';var utils=require(_0x4f32('0x0'));var logger=require(_0x4f32('0x1'))(_0x4f32('0x2'));exports[_0x4f32('0x3')]=function(_0x519f74,_0x2bc83c){return function(_0x393509){try{logger[_0x4f32('0x4')](_0x4f32('0x5'),_0x519f74,utils[_0x4f32('0x6')](_0x2bc83c[0x0],this));_0x393509[_0x4f32('0x7')]();}catch(_0x20864d){logger['error']('[%s][NOOP]\x20%s',_0x519f74,JSON[_0x4f32('0x8')](_0x20864d));_0x393509[_0x4f32('0x9')]();}};}; \ No newline at end of file +var _0xcef5=['routing','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils'];(function(_0x4d9f43,_0x37e651){var _0x158bfd=function(_0x2990ea){while(--_0x2990ea){_0x4d9f43['push'](_0x4d9f43['shift']());}};_0x158bfd(++_0x37e651);}(_0xcef5,0x86));var _0x5cef=function(_0x60da0b,_0x396627){_0x60da0b=_0x60da0b-0x0;var _0x3c6d42=_0xcef5[_0x60da0b];return _0x3c6d42;};'use strict';var utils=require(_0x5cef('0x0'));var logger=require('../../../../config/logger')(_0x5cef('0x1'));exports['consequence']=function(_0x17cd5d,_0x571132){return function(_0xdb98db){try{logger[_0x5cef('0x2')](_0x5cef('0x3'),_0x17cd5d,utils[_0x5cef('0x4')](_0x571132[0x0],this));_0xdb98db[_0x5cef('0x5')]();}catch(_0xf783fc){logger[_0x5cef('0x6')](_0x5cef('0x3'),_0x17cd5d,JSON[_0x5cef('0x7')](_0xf783fc));_0xdb98db[_0x5cef('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 5f96dce..e6e3d46 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 _0xeb82=['../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','body','Interaction','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','find','Queues','createQueue','rules','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','stack','validate','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','from','joinAt','emit','account','push','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xeb82,0x174));var _0x2eb8=function(_0x550a8c,_0x3fd3ac){_0x550a8c=_0x550a8c-0x0;var _0x4352c5=_0xeb82[_0x550a8c];return _0x4352c5;};'use strict';var schema=require(_0x2eb8('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x2eb8('0x1'));var moment=require(_0x2eb8('0x2'));var Redis=require('ioredis');var config=require(_0x2eb8('0x3'));var logger=require(_0x2eb8('0x4'))(_0x2eb8('0x5'));var strategy=require(_0x2eb8('0x6'));config['redis']=_[_0x2eb8('0x7')](config[_0x2eb8('0x8')],{'host':_0x2eb8('0x9'),'port':0x18eb});var io=require(_0x2eb8('0xa'))(new Redis(config['redis']));var attributes=['id',_0x2eb8('0xb'),'account','queue',_0x2eb8('0xc'),_0x2eb8('0xd')];function emit(_0xc708cd,_0x1daf6f,_0x86a12e){io['to'](_0xc708cd)[_0x2eb8('0xe')](_0x1daf6f,_0x86a12e);}function emitChannelQueueInteraction(_0x4445c3,_0x7bf8ad,_0x279db2,_0xc6671,_0x36b6c3,_0xaf9e11,_0x52efd5,_0x4b86cd){var _0x39ffc4=_['clone'](_0x279db2);_0x39ffc4[_0x2eb8('0xb')]=_0x4b86cd;_0x39ffc4['queue']=_0x7bf8ad;_0x39ffc4[_0x2eb8('0xf')]=_0xc6671;_0x39ffc4['id']=_0x36b6c3;if(_0xaf9e11){attributes[_0x2eb8('0x10')](_['capitalize'](_0x4445c3)+_0x2eb8('0x11'));_0x52efd5[util[_0x2eb8('0x12')](_0x2eb8('0x13'),_0x4445c3)][_0x36b6c3]=_['pick'](_0x39ffc4,attributes);}else{delete _0x52efd5[util['format'](_0x2eb8('0x13'),_0x4445c3)][_0x36b6c3];}emit(util[_0x2eb8('0x12')](_0x2eb8('0x14'),_0x4445c3,_0x7bf8ad),util[_0x2eb8('0x12')](_0x2eb8('0x15'),_0x4445c3,_0xaf9e11?_0x2eb8('0x16'):_0x2eb8('0x17')),_[_0x2eb8('0x18')](_0x39ffc4,attributes));}var rpc={'openchannelQueueReport':require(_0x2eb8('0x19')),'mailQueueReport':require(_0x2eb8('0x1a')),'chatQueueReport':require(_0x2eb8('0x1b')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require(_0x2eb8('0x1c')),'faxInteraction':require(_0x2eb8('0x1d')),'mailInteraction':require(_0x2eb8('0x1e')),'openchannelInteraction':require(_0x2eb8('0x1f')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x2eb8('0x20'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x2eb8('0x21')},'timeout':{'type':_0x2eb8('0x22'),'message':_0x2eb8('0x23')}});function startRouting(_0x1cef55,_0x1d8b41,_0x1a79c5,_0x4aadfd){if(_0x1cef55&&_0x1d8b41&&_0x1a79c5){_0x1d8b41['waiting']+=0x1;var _0x7a69c={'uniqueid':_0x1cef55,'from':_0x1a79c5['body']?_0x1a79c5['body'][_0x2eb8('0xc')]:'','joinAt':moment()[_0x2eb8('0x12')](_0x2eb8('0x24')),'ContactId':_0x1a79c5[_0x2eb8('0x25')]?_0x1a79c5[_0x2eb8('0x25')]['id']:null,'ListId':_0x1a79c5[_0x2eb8('0x26')]?_0x1a79c5[_0x2eb8('0x26')]['id']:null};_0x7a69c[_[_0x2eb8('0x27')](_0x1a79c5['channel'])+'QueueId']=_0x1d8b41['id']||null;_0x7a69c[_['upperFirst'](_0x1a79c5[_0x2eb8('0x28')])+_0x2eb8('0x11')]=_0x1a79c5[_0x2eb8('0x29')]?_0x1a79c5[_0x2eb8('0x29')]['id']:null;_0x7a69c[_['upperFirst'](_0x1a79c5[_0x2eb8('0x28')])+_0x2eb8('0x2a')]=_0x1a79c5[_0x2eb8('0x2b')]?_0x1a79c5['message']['id']:null;_0x7a69c[_['upperFirst'](_0x1a79c5[_0x2eb8('0x28')])+(_0x1a79c5['channel']!==_0x2eb8('0x2c')?_0x2eb8('0x2d'):_0x2eb8('0x2e'))]=_0x1a79c5[_0x2eb8('0xf')]?_0x1a79c5[_0x2eb8('0xf')]['id']:null;logger[_0x2eb8('0x2f')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x1cef55,_0x1d8b41[_0x2eb8('0x30')]));emitChannelQueueInteraction(_0x1a79c5[_0x2eb8('0x28')],_0x1d8b41[_0x2eb8('0x30')],_0x7a69c,_0x1a79c5[_0x2eb8('0xf')][_0x2eb8('0x30')],_0x1a79c5['message']['id'],!![],_0x4aadfd,_0x1d8b41['id']);if(rpc[_0x1a79c5[_0x2eb8('0x28')]+'QueueReport']){return rpc[_0x1a79c5['channel']+_0x2eb8('0x31')][_0x2eb8('0x32')](_0x7a69c)[_0x2eb8('0x33')](function(_0x1550c8){logger[_0x2eb8('0x34')]('create\x20queue\x20report',_0x1550c8);});}}}function stopRouting(_0x1f0f0e,_0x483f08,_0x15c482,_0xd3e6e9){if(_0x1f0f0e&&_0x483f08){_0x483f08[_0x2eb8('0x35')]-=0x1;var _0x454336={'leaveAt':moment()[_0x2eb8('0x12')](_0x2eb8('0x24')),'acceptAt':moment()[_0x2eb8('0x12')](_0x2eb8('0x24')),'reason':_0x2eb8('0x36')};logger[_0x2eb8('0x2f')](util['format'](_0x2eb8('0x37'),_0x1f0f0e,_0x483f08[_0x2eb8('0x30')]));emitChannelQueueInteraction(_0x15c482[_0x2eb8('0x28')],_0x483f08[_0x2eb8('0x30')],_0x15c482[_0x2eb8('0x38')],_0x15c482[_0x2eb8('0xf')][_0x2eb8('0x30')],_0x15c482[_0x2eb8('0x2b')]['id'],![],_0xd3e6e9,_0x483f08['id']);return rpc[_0x15c482['channel']+_0x2eb8('0x39')][_0x2eb8('0x3a')](_0x15c482['interaction']['id'],{'queueId':_0x483f08['id']})['then'](function(){if(rpc[_0x15c482[_0x2eb8('0x28')]+_0x2eb8('0x31')]){return rpc[_0x15c482[_0x2eb8('0x28')]+_0x2eb8('0x31')][_0x2eb8('0x3a')](_0x1f0f0e,_0x454336)['catch'](function(_0x5a4d2c){logger[_0x2eb8('0x34')](_0x2eb8('0x3b'),_0x5a4d2c);});}});}}function endRouting(_0x57a18f,_0x2da577,_0x56d34f,_0x3182cb){if(_0x57a18f&&_0x2da577){_0x2da577[_0x2eb8('0x35')]-=0x1;var _0x58e886={'leaveAt':moment()[_0x2eb8('0x12')](_0x2eb8('0x24')),'exitAt':moment()[_0x2eb8('0x12')](_0x2eb8('0x24')),'reason':_0x2eb8('0x3c')};logger[_0x2eb8('0x2f')](util[_0x2eb8('0x12')](_0x2eb8('0x3d'),_0x57a18f,_0x2da577[_0x2eb8('0x30')]));emitChannelQueueInteraction(_0x56d34f[_0x2eb8('0x28')],_0x2da577['name'],_0x56d34f[_0x2eb8('0x38')],_0x56d34f[_0x2eb8('0xf')]['name'],_0x56d34f[_0x2eb8('0x2b')]['id'],![],_0x3182cb);if(rpc[_0x56d34f[_0x2eb8('0x28')]+'QueueReport']){return rpc[_0x56d34f[_0x2eb8('0x28')]+'QueueReport']['update'](_0x57a18f,_0x58e886)[_0x2eb8('0x33')](function(_0x52f1e3){logger[_0x2eb8('0x34')]('update\x20queue\x20report',_0x52f1e3);});}}}function handleFindQueue(_0x214a23){return function(_0x45cabf){return _0x45cabf[_0x2eb8('0x30')][_0x2eb8('0x3e')]()===_0x214a23[_0x2eb8('0x3e')]();};}exports[_0x2eb8('0x3f')]=function(_0x2c4b0b,_0x27b79a,_0x4f0d1f,_0x2205dd){return function(_0x37625e){try{var _0x19c464={'name':_0x27b79a[0x0],'timeout':_0x27b79a[0x1]};var _0x75955f=queue['validate'](_0x19c464,{'typecast':!![]});if(_0x75955f[_0x2eb8('0x40')]){logger[_0x2eb8('0x34')](_0x2eb8('0x41'),_0x2c4b0b,_['map'](_0x75955f,'message')[_0x2eb8('0x42')](',\x20'));_0x37625e['stop']();}else{var _0x329743=_[_0x2eb8('0x43')](_0x4f0d1f[_0x2205dd['channel']+_0x2eb8('0x44')],handleFindQueue(_0x19c464[_0x2eb8('0x30')]));if(_0x329743){startRouting(_0x2c4b0b,_0x329743,_0x2205dd,_0x4f0d1f);var _0x149e14=(_0x329743['timeout']||0xa)*0x3e8;var _0x2ba6ba=(_0x19c464[_0x2eb8('0x3c')]||0x14)*0x3e8;var _0x41b2fb;if(_0x149e14>_0x2ba6ba){_0x2ba6ba=_0x149e14;}var _0x1fa2b2=seqqueue[_0x2eb8('0x45')](_0x149e14);_0x1fa2b2['id']=_0x2c4b0b;_0x1fa2b2['atimeout']=_0x149e14;_0x1fa2b2['qtimeout']=_0x2ba6ba;_0x1fa2b2['channel']=_0x2205dd[_0x2eb8('0x28')];_0x4f0d1f[_0x2eb8('0x46')][_0x2c4b0b]['on']('end',function(){logger[_0x2eb8('0x2f')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2c4b0b);stopRouting(_0x2c4b0b,_0x329743,_0x2205dd,_0x4f0d1f);clearTimeout(_0x41b2fb);_0x41b2fb=undefined;_0x1fa2b2[_0x2eb8('0x47')](!![]);if(_0x4f0d1f[_0x2eb8('0x46')][_0x2c4b0b]){delete _0x4f0d1f['rules'][_0x2c4b0b];}_0x37625e['stop']();});_0x4f0d1f['rules'][_0x2c4b0b]['on'](_0x2eb8('0x48'),function(){if(_0x4f0d1f[_0x2eb8('0x46')][_0x2c4b0b]){delete _0x4f0d1f['rules'][_0x2c4b0b];}});_0x41b2fb=setTimeout(function(){logger['info'](_0x2eb8('0x49'),_0x2c4b0b);endRouting(_0x2c4b0b,_0x329743,_0x2205dd,_0x4f0d1f);clearTimeout(_0x41b2fb);_0x1fa2b2['close'](!![]);_0x37625e[_0x2eb8('0x4a')]();},_0x2ba6ba);switch(_0x329743[_0x2eb8('0x4b')]){case _0x2eb8('0x4c'):strategy['rrmemory'](_0x1fa2b2,_0x329743,_0x4f0d1f,_0x2205dd);break;default:strategy['beepall'](_0x1fa2b2,_0x329743,_0x4f0d1f,_0x2205dd);}}else{logger[_0x2eb8('0x34')](_0x2eb8('0x4d'),_0x2c4b0b,_0x19c464['name']);_0x37625e[_0x2eb8('0x4e')]();}}}catch(_0x188a82){logger['error'](_0x2eb8('0x41'),_0x2c4b0b,_0x188a82[_0x2eb8('0x4f')]);_0x37625e[_0x2eb8('0x4e')]();}};}; \ No newline at end of file +var _0x8e8a=['ioredis','../../../../config/environment','routing','defaults','redis','localhost','socket.io-emitter','account','from','joinAt','emit','clone','queue_id','queue','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','toLowerCase','consequence','length','map','find','Queues','timeout','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment'];(function(_0x17f11c,_0x43931f){var _0x75347f=function(_0x55cf96){while(--_0x55cf96){_0x17f11c['push'](_0x17f11c['shift']());}};_0x75347f(++_0x43931f);}(_0x8e8a,0xa4));var _0xa8e8=function(_0x17c22c,_0x2de553){_0x17c22c=_0x17c22c-0x0;var _0x4ca47a=_0x8e8a[_0x17c22c];return _0x4ca47a;};'use strict';var schema=require('validate');var _=require(_0xa8e8('0x0'));var util=require(_0xa8e8('0x1'));var seqqueue=require(_0xa8e8('0x2'));var moment=require(_0xa8e8('0x3'));var Redis=require(_0xa8e8('0x4'));var config=require(_0xa8e8('0x5'));var logger=require('../../../../config/logger')(_0xa8e8('0x6'));var strategy=require('./strategy');config['redis']=_[_0xa8e8('0x7')](config[_0xa8e8('0x8')],{'host':_0xa8e8('0x9'),'port':0x18eb});var io=require(_0xa8e8('0xa'))(new Redis(config[_0xa8e8('0x8')]));var attributes=['id','queue_id',_0xa8e8('0xb'),'queue',_0xa8e8('0xc'),_0xa8e8('0xd')];function emit(_0x511f34,_0x5d815c,_0x43c479){io['to'](_0x511f34)[_0xa8e8('0xe')](_0x5d815c,_0x43c479);}function emitChannelQueueInteraction(_0x2ebf52,_0x158f44,_0x5627f6,_0x4b5a39,_0x3a8882,_0x87d0c3,_0x4b5f3f,_0xa3a0eb){var _0x32479d=_[_0xa8e8('0xf')](_0x5627f6);_0x32479d[_0xa8e8('0x10')]=_0xa3a0eb;_0x32479d[_0xa8e8('0x11')]=_0x158f44;_0x32479d[_0xa8e8('0xb')]=_0x4b5a39;_0x32479d['id']=_0x3a8882;if(_0x87d0c3){attributes[_0xa8e8('0x12')](_[_0xa8e8('0x13')](_0x2ebf52)+_0xa8e8('0x14'));_0x4b5f3f[util[_0xa8e8('0x15')](_0xa8e8('0x16'),_0x2ebf52)][_0x3a8882]=_['pick'](_0x32479d,attributes);}else{delete _0x4b5f3f[util[_0xa8e8('0x15')](_0xa8e8('0x16'),_0x2ebf52)][_0x3a8882];}emit(util[_0xa8e8('0x15')]('%s:queue:%s',_0x2ebf52,_0x158f44),util[_0xa8e8('0x15')](_0xa8e8('0x17'),_0x2ebf52,_0x87d0c3?'save':'remove'),_[_0xa8e8('0x18')](_0x32479d,attributes));}var rpc={'openchannelQueueReport':require(_0xa8e8('0x19')),'mailQueueReport':require(_0xa8e8('0x1a')),'chatQueueReport':require(_0xa8e8('0x1b')),'smsQueueReport':require(_0xa8e8('0x1c')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa8e8('0x1d')),'chatInteraction':require(_0xa8e8('0x1e')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0xa8e8('0x1f')),'smsInteraction':require(_0xa8e8('0x20')),'whatsappInteraction':require(_0xa8e8('0x21'))};var queue=schema({'name':{'type':_0xa8e8('0x22'),'required':!![],'message':_0xa8e8('0x23')},'timeout':{'type':_0xa8e8('0x24'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x469ac7,_0x57b334,_0x5de392,_0x199f14){if(_0x469ac7&&_0x57b334&&_0x5de392){_0x57b334[_0xa8e8('0x25')]+=0x1;var _0x37e66c={'uniqueid':_0x469ac7,'from':_0x5de392[_0xa8e8('0x26')]?_0x5de392[_0xa8e8('0x26')][_0xa8e8('0xc')]:'','joinAt':moment()[_0xa8e8('0x15')](_0xa8e8('0x27')),'ContactId':_0x5de392['contact']?_0x5de392[_0xa8e8('0x28')]['id']:null,'ListId':_0x5de392['list']?_0x5de392[_0xa8e8('0x29')]['id']:null};_0x37e66c[_['upperFirst'](_0x5de392[_0xa8e8('0x2a')])+'QueueId']=_0x57b334['id']||null;_0x37e66c[_[_0xa8e8('0x2b')](_0x5de392[_0xa8e8('0x2a')])+_0xa8e8('0x14')]=_0x5de392['interaction']?_0x5de392[_0xa8e8('0x2c')]['id']:null;_0x37e66c[_['upperFirst'](_0x5de392[_0xa8e8('0x2a')])+'MessageId']=_0x5de392[_0xa8e8('0x2d')]?_0x5de392['message']['id']:null;_0x37e66c[_['upperFirst'](_0x5de392[_0xa8e8('0x2a')])+(_0x5de392[_0xa8e8('0x2a')]!==_0xa8e8('0x2e')?_0xa8e8('0x2f'):_0xa8e8('0x30'))]=_0x5de392[_0xa8e8('0xb')]?_0x5de392[_0xa8e8('0xb')]['id']:null;logger[_0xa8e8('0x31')](util['format'](_0xa8e8('0x32'),_0x469ac7,_0x57b334[_0xa8e8('0x33')]));emitChannelQueueInteraction(_0x5de392[_0xa8e8('0x2a')],_0x57b334[_0xa8e8('0x33')],_0x37e66c,_0x5de392['account'][_0xa8e8('0x33')],_0x5de392['message']['id'],!![],_0x199f14,_0x57b334['id']);if(rpc[_0x5de392[_0xa8e8('0x2a')]+_0xa8e8('0x34')]){return rpc[_0x5de392['channel']+_0xa8e8('0x34')][_0xa8e8('0x35')](_0x37e66c)[_0xa8e8('0x36')](function(_0x87f935){logger[_0xa8e8('0x37')](_0xa8e8('0x38'),_0x87f935);});}}}function stopRouting(_0x38140b,_0x443df3,_0x16da2d,_0x3a1a4d){if(_0x38140b&&_0x443df3){_0x443df3[_0xa8e8('0x25')]-=0x1;var _0x52c3c2={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xa8e8('0x27')),'reason':_0xa8e8('0x39')};logger[_0xa8e8('0x31')](util[_0xa8e8('0x15')](_0xa8e8('0x3a'),_0x38140b,_0x443df3[_0xa8e8('0x33')]));emitChannelQueueInteraction(_0x16da2d[_0xa8e8('0x2a')],_0x443df3[_0xa8e8('0x33')],_0x16da2d[_0xa8e8('0x26')],_0x16da2d[_0xa8e8('0xb')]['name'],_0x16da2d['message']['id'],![],_0x3a1a4d,_0x443df3['id']);return rpc[_0x16da2d[_0xa8e8('0x2a')]+_0xa8e8('0x3b')][_0xa8e8('0x3c')](_0x16da2d[_0xa8e8('0x2c')]['id'],{'queueId':_0x443df3['id']})[_0xa8e8('0x3d')](function(){if(rpc[_0x16da2d[_0xa8e8('0x2a')]+_0xa8e8('0x34')]){return rpc[_0x16da2d['channel']+_0xa8e8('0x34')][_0xa8e8('0x3c')](_0x38140b,_0x52c3c2)['catch'](function(_0x3de9a6){logger['error'](_0xa8e8('0x3e'),_0x3de9a6);});}});}}function endRouting(_0x263083,_0x3cdf23,_0x21c861,_0x3fe029){if(_0x263083&&_0x3cdf23){_0x3cdf23[_0xa8e8('0x25')]-=0x1;var _0xee9f21={'leaveAt':moment()['format'](_0xa8e8('0x27')),'exitAt':moment()['format'](_0xa8e8('0x27')),'reason':'timeout'};logger[_0xa8e8('0x31')](util[_0xa8e8('0x15')]('[%s][END:QUEUE][NAME:%s]',_0x263083,_0x3cdf23[_0xa8e8('0x33')]));emitChannelQueueInteraction(_0x21c861[_0xa8e8('0x2a')],_0x3cdf23[_0xa8e8('0x33')],_0x21c861[_0xa8e8('0x26')],_0x21c861[_0xa8e8('0xb')][_0xa8e8('0x33')],_0x21c861[_0xa8e8('0x2d')]['id'],![],_0x3fe029);if(rpc[_0x21c861[_0xa8e8('0x2a')]+_0xa8e8('0x34')]){return rpc[_0x21c861['channel']+_0xa8e8('0x34')][_0xa8e8('0x3c')](_0x263083,_0xee9f21)[_0xa8e8('0x36')](function(_0xf5db8b){logger[_0xa8e8('0x37')](_0xa8e8('0x3e'),_0xf5db8b);});}}}function handleFindQueue(_0x683fe9){return function(_0x301fb2){return _0x301fb2[_0xa8e8('0x33')][_0xa8e8('0x3f')]()===_0x683fe9['toLowerCase']();};}exports[_0xa8e8('0x40')]=function(_0x1706d0,_0x254e06,_0x32f2bb,_0x49cc0a){return function(_0x1e139a){try{var _0x591d2f={'name':_0x254e06[0x0],'timeout':_0x254e06[0x1]};var _0x283c9b=queue['validate'](_0x591d2f,{'typecast':!![]});if(_0x283c9b[_0xa8e8('0x41')]){logger[_0xa8e8('0x37')]('[%s][QUEUE]\x20%s',_0x1706d0,_[_0xa8e8('0x42')](_0x283c9b,_0xa8e8('0x2d'))['join'](',\x20'));_0x1e139a['stop']();}else{var _0x1e26a6=_[_0xa8e8('0x43')](_0x32f2bb[_0x49cc0a[_0xa8e8('0x2a')]+_0xa8e8('0x44')],handleFindQueue(_0x591d2f[_0xa8e8('0x33')]));if(_0x1e26a6){startRouting(_0x1706d0,_0x1e26a6,_0x49cc0a,_0x32f2bb);var _0x46b507=(_0x1e26a6[_0xa8e8('0x45')]||0xa)*0x3e8;var _0x4dd24e=(_0x591d2f[_0xa8e8('0x45')]||0x14)*0x3e8;var _0x2f80da;if(_0x46b507>_0x4dd24e){_0x4dd24e=_0x46b507;}var _0x1166c0=seqqueue['createQueue'](_0x46b507);_0x1166c0['id']=_0x1706d0;_0x1166c0[_0xa8e8('0x46')]=_0x46b507;_0x1166c0[_0xa8e8('0x47')]=_0x4dd24e;_0x1166c0['channel']=_0x49cc0a[_0xa8e8('0x2a')];_0x32f2bb[_0xa8e8('0x48')][_0x1706d0]['on'](_0xa8e8('0x49'),function(){logger[_0xa8e8('0x31')](_0xa8e8('0x4a'),_0x1706d0);stopRouting(_0x1706d0,_0x1e26a6,_0x49cc0a,_0x32f2bb);clearTimeout(_0x2f80da);_0x2f80da=undefined;_0x1166c0[_0xa8e8('0x4b')](!![]);if(_0x32f2bb[_0xa8e8('0x48')][_0x1706d0]){delete _0x32f2bb[_0xa8e8('0x48')][_0x1706d0];}_0x1e139a[_0xa8e8('0x4c')]();});_0x32f2bb[_0xa8e8('0x48')][_0x1706d0]['on'](_0xa8e8('0x4d'),function(){if(_0x32f2bb['rules'][_0x1706d0]){delete _0x32f2bb[_0xa8e8('0x48')][_0x1706d0];}});_0x2f80da=setTimeout(function(){logger[_0xa8e8('0x31')](_0xa8e8('0x4e'),_0x1706d0);endRouting(_0x1706d0,_0x1e26a6,_0x49cc0a,_0x32f2bb);clearTimeout(_0x2f80da);_0x1166c0[_0xa8e8('0x4b')](!![]);_0x1e139a['next']();},_0x4dd24e);switch(_0x1e26a6[_0xa8e8('0x4f')]){case _0xa8e8('0x50'):strategy[_0xa8e8('0x50')](_0x1166c0,_0x1e26a6,_0x32f2bb,_0x49cc0a);break;default:strategy[_0xa8e8('0x51')](_0x1166c0,_0x1e26a6,_0x32f2bb,_0x49cc0a);}}else{logger[_0xa8e8('0x37')](_0xa8e8('0x52'),_0x1706d0,_0x591d2f['name']);_0x1e139a['stop']();}}}catch(_0x54bfad){logger['error']('[%s][QUEUE]\x20%s',_0x1706d0,_0x54bfad[_0xa8e8('0x53')]);_0x1e139a['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 96a9619..7cc0893 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 _0x0faf=['showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','debug','forcedOwnership','channel','busy','busyQueue','saveWaitingNotification'];(function(_0x73278a,_0x580660){var _0x158d1=function(_0x2f5f02){while(--_0x2f5f02){_0x73278a['push'](_0x73278a['shift']());}};_0x158d1(++_0x580660);}(_0x0faf,0x132));var _0xf0fa=function(_0x5ae93d,_0x48a929){_0x5ae93d=_0x5ae93d-0x0;var _0x3bc344=_0x0faf[_0x5ae93d];return _0x3bc344;};'use strict';var _=require(_0xf0fa('0x0'));var uuid=require('uuid');var util=require(_0xf0fa('0x1'));var logger=require(_0xf0fa('0x2'))(_0xf0fa('0x3'));var Agent=function(_0x35a260,_0xccb93e,_0xdc9ce3,_0x515b12){this[_0xf0fa('0x4')]=uuid['v4']();this[_0xf0fa('0x5')]=_0x35a260;this['agent']=_0xccb93e;this[_0xf0fa('0x6')]=_0xdc9ce3;this[_0xf0fa('0x3')]=_0x515b12;this[_0xf0fa('0x5')][_0xf0fa('0x7')](this[_0xf0fa('0x8')]['bind'](this),this[_0xf0fa('0x9')][_0xf0fa('0xa')](this));this['squeue']['on']('timeout',this[_0xf0fa('0x9')][_0xf0fa('0xa')](this));this[_0xf0fa('0x5')]['on'](_0xf0fa('0xb'),this[_0xf0fa('0xc')][_0xf0fa('0xa')](this));};Agent[_0xf0fa('0xd')][_0xf0fa('0x7')]=function(){this['squeue'][_0xf0fa('0x7')](this['handleRun'][_0xf0fa('0xa')](this),this['handleTimeout'][_0xf0fa('0xa')](this));};Agent[_0xf0fa('0xd')][_0xf0fa('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xf0fa('0x8')]=function(){logger['debug'](_0xf0fa('0xe'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);if(_[_0xf0fa('0x10')](this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']])){logger[_0xf0fa('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);setTimeout(this[_0xf0fa('0x7')][_0xf0fa('0xa')](this),0x3e8);}else{if(this[_0xf0fa('0x3')][_0xf0fa('0x13')]||util['isAgentAvailable'](this['squeue']['id'],this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],this[_0xf0fa('0x5')][_0xf0fa('0x14')],![])){this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']][_0xf0fa('0x15')]=!![];this[_0xf0fa('0x6')][_0xf0fa('0x11')][this['agent']['id']][_0xf0fa('0x16')]=undefined;util[_0xf0fa('0x17')](this[_0xf0fa('0x6')],this[_0xf0fa('0x3')],this[_0xf0fa('0xf')],this[_0xf0fa('0x5')][_0xf0fa('0x14')]);util[_0xf0fa('0x18')](this[_0xf0fa('0x4')],this['squeue']['id'],this[_0xf0fa('0x6')][_0xf0fa('0x11')][this['agent']['id']],null,this[_0xf0fa('0x3')]);util[_0xf0fa('0x19')](this[_0xf0fa('0x5')]['id'],this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],_0xf0fa('0x1a')+(this[_0xf0fa('0x3')]['forcedOwnership']?':FORCED':''));}else{logger[_0xf0fa('0x12')](_0xf0fa('0x1b'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);setTimeout(this['push'][_0xf0fa('0xa')](this),0x3e8);}}};Agent[_0xf0fa('0xd')][_0xf0fa('0x9')]=function(_0x5a4fd3){if(_[_0xf0fa('0x10')](this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']])){return logger[_0xf0fa('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);}else{logger[_0xf0fa('0x12')](_0xf0fa('0x1c'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);util['hideNotification'](this['notificationId'],this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0x6')]['agents'][this[_0xf0fa('0xf')]['id']],null,this['routing']);this['realtime']['agents'][this[_0xf0fa('0xf')]['id']]['busy']=![];this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']][_0xf0fa('0x16')]=undefined;util[_0xf0fa('0x1d')](this[_0xf0fa('0x6')],this[_0xf0fa('0x3')],this[_0xf0fa('0xf')],this['squeue'][_0xf0fa('0x14')]);util[_0xf0fa('0x19')](this[_0xf0fa('0x5')]['id'],this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],_0x5a4fd3?_0xf0fa('0x1e'):_0xf0fa('0x1f'));}if(!_0x5a4fd3){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x2a9f4b,_0x68b3fe,_0x2a6560,_0x47486f){return new Agent(_0x2a9f4b,_0x68b3fe,_0x2a6560,_0x47486f);}module[_0xf0fa('0x20')]=agent; \ No newline at end of file +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(_0x4365df,_0x422f02){var _0x4198ed=function(_0x211180){while(--_0x211180){_0x4365df['push'](_0x4365df['shift']());}};_0x4198ed(++_0x422f02);}(_0x9f62,0x154));var _0x29f6=function(_0x4365e4,_0x246141){_0x4365e4=_0x4365e4-0x0;var _0x203caf=_0x9f62[_0x4365e4];return _0x203caf;};'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 diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 29c6ff5..7cb5c04 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 _0x6f36=['name','saveWaitingNotification','showNotification','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','queue','Agents','realtime','debug','isAgentAvailable','agents','channel','writeLog','RINGING','busy','busyQueue'];(function(_0x24479d,_0x2b8d32){var _0x2897b1=function(_0x223917){while(--_0x223917){_0x24479d['push'](_0x24479d['shift']());}};_0x2897b1(++_0x2b8d32);}(_0x6f36,0x1f3));var _0x66f3=function(_0x1ec0c3,_0x4b3a64){_0x1ec0c3=_0x1ec0c3-0x0;var _0x21e305=_0x6f36[_0x1ec0c3];return _0x21e305;};'use strict';var _=require(_0x66f3('0x0'));var uuid=require(_0x66f3('0x1'));var util=require('./util');var logger=require(_0x66f3('0x2'))(_0x66f3('0x3'));var Beepall=function(_0x536405,_0x426c14,_0x5026ae,_0x457e87){this[_0x66f3('0x4')]=uuid['v4']();this['squeue']=_0x536405;this['queue']=_0x426c14;this['realtime']=_0x5026ae;this[_0x66f3('0x3')]=_0x457e87;this[_0x66f3('0x5')][_0x66f3('0x6')](this['handleRun'][_0x66f3('0x7')](this),this['handleTimeout'][_0x66f3('0x7')](this));this[_0x66f3('0x5')]['on'](_0x66f3('0x8'),this[_0x66f3('0x9')]['bind'](this));this['squeue']['on'](_0x66f3('0xa'),this[_0x66f3('0xb')][_0x66f3('0x7')](this));};Beepall[_0x66f3('0xc')][_0x66f3('0x6')]=function(){this['squeue']['push'](this[_0x66f3('0xd')][_0x66f3('0x7')](this),this['handleTimeout'][_0x66f3('0x7')](this));};Beepall[_0x66f3('0xc')][_0x66f3('0xb')]=function(){this['handleTimeout'](!![]);};Beepall['prototype'][_0x66f3('0xd')]=function(){var _0x7f7db0=!![];if(!_[_0x66f3('0xe')](this[_0x66f3('0xf')])&&!_['isNil'](this[_0x66f3('0xf')][_0x66f3('0x10')])&&this[_0x66f3('0xf')][_0x66f3('0x10')]['length']>0x0){for(var _0x5e4965=0x0,_0xec2b3f;_0x5e49650x0){for(var _0x2a1331=0x0,_0x5b61f4;_0x2a13310x0&&_0xdb4f90[_0xe5482f+_0x5314('0x24')]>=_0xdb4f90[_0xe5482f+_0x5314('0x23')]){writeLog(_0x43a0f0,_0xdb4f90,_0xe5482f['toUpperCase']()+_0x5314('0x25'));return![];}}return!![];};exports[_0x5314('0x26')]=function(_0x2091a3,_0x19f9b6,_0x26bf99,_0x21d151,_0x492f67){return sendNotification(!![],_0x2091a3,_0x19f9b6,_0x26bf99,_0x21d151,_0x492f67);};exports[_0x5314('0x27')]=function(_0x54b613,_0x284233,_0x255789,_0xa5110,_0x559365){return sendNotification(![],_0x54b613,_0x284233,_0x255789,_0xa5110,_0x559365);};exports[_0x5314('0x28')]=function(_0x180301,_0x57ced9,_0x2a49e6){var _0x4d2183=_0x57ced9[_0x5314('0x29')][_0x5314('0x2a')];if(!_0x4d2183&&_0x2a49e6){_0x4d2183=_0x2a49e6['id'];}var _0xc3db8c=_[_0x5314('0x2b')](_0x180301[_0x57ced9[_0x5314('0x2c')]+'QueuesWaitingInteractions'],function(_0x40a2ca){var _0x2de516=_[_0x5314('0x2d')](_0x57ced9[_0x5314('0x2c')])+'InteractionId';return _0x40a2ca[_0x2de516]===_0x57ced9[_0x5314('0x29')]['id'];});if(!_0xc3db8c&&_0x4d2183&&_0x180301['agents'][_0x4d2183]){_0xc3db8c=_['some'](_0x180301[_0x5314('0x2e')][_0x4d2183][_0x57ced9['channel']+'WaitingInteractions'],function(_0x5aa9a2){return _0x5aa9a2['id']===_0x57ced9[_0x5314('0x29')]['id'];});}return _0xc3db8c;};exports[_0x5314('0x2f')]=function(_0x48087c,_0x487fe3,_0x3712f8,_0x16929b){if(_0x3712f8&&_0x3712f8['id']&&_0x48087c[_0x5314('0x2e')]&&_0x48087c[_0x5314('0x2e')][_0x3712f8['id']]){_0x48087c[_0x5314('0x2e')][_0x3712f8['id']][_0x16929b+_0x5314('0x30')][_0x487fe3[_0x5314('0x17')]['id']]={'id':_0x487fe3[_0x5314('0x29')]['id']};}};exports[_0x5314('0x31')]=function(_0x44a836,_0x4ecd85,_0x149392,_0x410d59){if(_0x149392&&_0x149392['id']&&_0x44a836[_0x5314('0x2e')]&&_0x44a836[_0x5314('0x2e')][_0x149392['id']]){delete _0x44a836[_0x5314('0x2e')][_0x149392['id']][_0x410d59+_0x5314('0x30')][_0x4ecd85[_0x5314('0x17')]['id']];}};exports['writeLog']=writeLog; \ No newline at end of file +var _0x8a2c=['[%s][QUEUE]\x20%s','message','format','user:%s','emit','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','name','isAgentAvailable','BUSY','online','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','socket.io-emitter','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate'];(function(_0x1f570b,_0x2805a5){var _0x5b11c7=function(_0x1d4cb0){while(--_0x1d4cb0){_0x1f570b['push'](_0x1f570b['shift']());}};_0x5b11c7(++_0x2805a5);}(_0x8a2c,0xb8));var _0xc8a2=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x8a2c[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xc8a2('0x0'));var util=require('util');var utils=require(_0xc8a2('0x1'));var Redis=require(_0xc8a2('0x2'));var config=require(_0xc8a2('0x3'));var logger=require(_0xc8a2('0x4'))('routing');config[_0xc8a2('0x5')]=_[_0xc8a2('0x6')](config[_0xc8a2('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc8a2('0x7'))(new Redis(config[_0xc8a2('0x5')]));function sendNotification(_0x57c5d9,_0xc329cb,_0x40d6e6,_0x413ae3,_0x5744ba,_0xa82b15){var _0x15279d=_0xa82b15||{};var _0x48d2e2=_0x40d6e6['split']('.');var _0x2767a6={'uniqueid':_0xc329cb,'channel':_0x48d2e2[0x0],'id':_0x48d2e2[0x1],'title':_0x48d2e2[0x0]+_0xc8a2('0x8'),'interactionId':_0x48d2e2[0x2],'queue':_0x5744ba?_0x5744ba['name']:null,'sound':_0x15279d[_0xc8a2('0x9')][_0xc8a2('0xa')],'shake':_0x15279d[_0xc8a2('0x9')][_0xc8a2('0xb')]};try{if(!_0x15279d['body']){_0x15279d[_0xc8a2('0xc')]={};}if(_0x5744ba){_0x15279d[_0xc8a2('0xc')][_0xc8a2('0xd')]=_0x5744ba;}else if(_0x15279d[_0xc8a2('0xc')]['queue']){delete _0x15279d[_0xc8a2('0xc')][_0xc8a2('0xd')];}_0x2767a6[_0xc8a2('0xe')]=utils['getMustacheRender'](_0x15279d[_0xc8a2('0x9')][_0xc8a2('0xf')],_0x15279d);}catch(_0x350507){_0x2767a6[_0xc8a2('0xe')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util['format'](_0xc8a2('0x10'),_0xc329cb,_0x350507[_0xc8a2('0x11')]));}io['to'](util[_0xc8a2('0x12')](_0xc8a2('0x13'),_0x413ae3['name']))[_0xc8a2('0x14')](util['format'](_0xc8a2('0x15'),_0x57c5d9?_0xc8a2('0x16'):_0xc8a2('0x17')),_0x2767a6);}function writeLog(_0x1d1397,_0xb9e4b8,_0x6f4dba){return logger[_0xc8a2('0x18')](util['format'](_0xc8a2('0x19'),_0x1d1397,_0xb9e4b8[_0xc8a2('0x1a')],_0x6f4dba));}exports[_0xc8a2('0x1b')]=function(_0x5e5ddf,_0x21ad5a,_0x1d9fd2,_0x4b2272){if(_0x21ad5a['busy']){writeLog(_0x5e5ddf,_0x21ad5a,_0xc8a2('0x1c'));return![];}if(!_0x21ad5a[_0xc8a2('0x1d')]){writeLog(_0x5e5ddf,_0x21ad5a,'OFFLINE');return![];}if(_0x21ad5a[_0x1d9fd2+_0xc8a2('0x1e')]){writeLog(_0x5e5ddf,_0x21ad5a,_0xc8a2('0x1f'));return![];}if(_0x4b2272&&_0x21ad5a['hasOwnProperty'](_0x1d9fd2+_0xc8a2('0x20'))&&_0x21ad5a[_0xc8a2('0x21')](_0x1d9fd2+_0xc8a2('0x22'))){if(_0x21ad5a[_0x1d9fd2+'Capacity']>0x0&&_0x21ad5a[_0x1d9fd2+_0xc8a2('0x22')]>=_0x21ad5a[_0x1d9fd2+_0xc8a2('0x20')]){writeLog(_0x5e5ddf,_0x21ad5a,_0x1d9fd2['toUpperCase']()+_0xc8a2('0x23'));return![];}}return!![];};exports[_0xc8a2('0x24')]=function(_0x422495,_0x22cdac,_0x5b840e,_0x388e92,_0x3507ac){return sendNotification(!![],_0x422495,_0x22cdac,_0x5b840e,_0x388e92,_0x3507ac);};exports[_0xc8a2('0x25')]=function(_0x153767,_0x42bf4d,_0x29a31f,_0x9aa559,_0x45bfe0){return sendNotification(![],_0x153767,_0x42bf4d,_0x29a31f,_0x9aa559,_0x45bfe0);};exports[_0xc8a2('0x26')]=function(_0x295ebe,_0x53d611,_0x14b191){var _0x818077=_0x53d611[_0xc8a2('0x27')][_0xc8a2('0x28')];if(!_0x818077&&_0x14b191){_0x818077=_0x14b191['id'];}var _0xbba0c1=_[_0xc8a2('0x29')](_0x295ebe[_0x53d611[_0xc8a2('0x2a')]+'QueuesWaitingInteractions'],function(_0x138356){var _0x3ee245=_[_0xc8a2('0x2b')](_0x53d611[_0xc8a2('0x2a')])+_0xc8a2('0x2c');return _0x138356[_0x3ee245]===_0x53d611[_0xc8a2('0x27')]['id'];});if(!_0xbba0c1&&_0x818077&&_0x295ebe[_0xc8a2('0x2d')][_0x818077]){_0xbba0c1=_[_0xc8a2('0x29')](_0x295ebe[_0xc8a2('0x2d')][_0x818077][_0x53d611[_0xc8a2('0x2a')]+_0xc8a2('0x2e')],function(_0x8eb749){return _0x8eb749['id']===_0x53d611['interaction']['id'];});}return _0xbba0c1;};exports[_0xc8a2('0x2f')]=function(_0x4c040a,_0x4f9725,_0x390cfb,_0x13262a){if(_0x390cfb&&_0x390cfb['id']&&_0x4c040a[_0xc8a2('0x2d')]&&_0x4c040a[_0xc8a2('0x2d')][_0x390cfb['id']]){_0x4c040a[_0xc8a2('0x2d')][_0x390cfb['id']][_0x13262a+_0xc8a2('0x2e')][_0x4f9725[_0xc8a2('0x11')]['id']]={'id':_0x4f9725['interaction']['id']};}};exports[_0xc8a2('0x30')]=function(_0x4369d4,_0xa5c7ce,_0x5e04e8,_0x294ef8){if(_0x5e04e8&&_0x5e04e8['id']&&_0x4369d4[_0xc8a2('0x2d')]&&_0x4369d4[_0xc8a2('0x2d')][_0x5e04e8['id']]){delete _0x4369d4[_0xc8a2('0x2d')][_0x5e04e8['id']][_0x294ef8+_0xc8a2('0x2e')][_0xa5c7ce[_0xc8a2('0x11')]['id']];}};exports[_0xc8a2('0x31')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 75866bf..33abb92 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 _0x511e=['isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','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','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x511e,0xea));var _0xe511=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x511e[_0x5d31f3];return _0x1cc88c;};'use strict';var schema=require(_0xe511('0x0'));var sh=require(_0xe511('0x1'));var _=require(_0xe511('0x2'));var utils=require(_0xe511('0x3'));var logger=require(_0xe511('0x4'))(_0xe511('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xe511('0x6')}});exports[_0xe511('0x7')]=function(_0x36d8f6,_0x58452d){return function(_0x1c6f59){try{var _0x2214d7={'command':_0x58452d[0x0]};var _0x54d587=system['validate'](_0x2214d7,{'typecast':!![]});if(_0x54d587[_0xe511('0x8')]){logger[_0xe511('0x9')]('[%s][SYSTEM]\x20%s',_0x36d8f6,_[_0xe511('0xa')](_0x54d587,_0xe511('0xb'))[_0xe511('0xc')](',\x20'));logger[_0xe511('0xd')](_0xe511('0xe'),_0x36d8f6);_0x1c6f59[_0xe511('0xf')]();}else{var _0x308e88=this;var _0x130a47=utils[_0xe511('0x10')](_0x58452d[0x0],this);logger[_0xe511('0xd')](_0xe511('0x11'),_0x36d8f6,_0x130a47);sh[_0xe511('0x12')](_[_0xe511('0x13')](_0x130a47),function(_0x464a3f,_0x396ac2){logger[_0xe511('0xd')](_0xe511('0x14'),_0x36d8f6,_0x464a3f);if(_0x464a3f==0x0){var _0x4abb48=_0x396ac2[_0xe511('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0xe511('0x16')](_0x58452d[0x1])||_['isEmpty'](_0x58452d[0x1])){logger[_0xe511('0xd')](_0xe511('0x17'),_0x36d8f6);_0x308e88[_0xe511('0x18')][_0x58452d[0x1]]=_0x4abb48;}else{logger[_0xe511('0xd')](_0xe511('0x19'),_0x36d8f6,_0x58452d[0x1],_0x4abb48);_0x308e88['body'][_0x58452d[0x1]]=_0x4abb48;}}_0x1c6f59[_0xe511('0xf')]();});}}catch(_0xb666a3){logger[_0xe511('0x9')](_0xe511('0x1a'),_0x36d8f6,_[_0xe511('0x1b')](_0xb666a3)?JSON[_0xe511('0x1c')](_0xb666a3):_0xb666a3);logger[_0xe511('0xd')](_0xe511('0xe'),_0x36d8f6);_0x1c6f59[_0xe511('0xf')]();}};}; \ No newline at end of file +var _0x3a60=['exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','string','consequence','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0x54af6e,_0x44cd8f){var _0x38dc27=function(_0xbe1d4e){while(--_0xbe1d4e){_0x54af6e['push'](_0x54af6e['shift']());}};_0x38dc27(++_0x44cd8f);}(_0x3a60,0x135));var _0x03a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a60[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x03a6('0x0'));var sh=require(_0x03a6('0x1'));var _=require(_0x03a6('0x2'));var utils=require(_0x03a6('0x3'));var logger=require(_0x03a6('0x4'))('routing');var system=schema({'command':{'type':_0x03a6('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x03a6('0x6')]=function(_0x4dc8ad,_0x3a87df){return function(_0x3cebae){try{var _0x441249={'command':_0x3a87df[0x0]};var _0x5a4e2d=system[_0x03a6('0x0')](_0x441249,{'typecast':!![]});if(_0x5a4e2d['length']){logger[_0x03a6('0x7')](_0x03a6('0x8'),_0x4dc8ad,_['map'](_0x5a4e2d,_0x03a6('0x9'))[_0x03a6('0xa')](',\x20'));logger[_0x03a6('0xb')](_0x03a6('0xc'),_0x4dc8ad);_0x3cebae[_0x03a6('0xd')]();}else{var _0x4c4db1=this;var _0x5151b6=utils[_0x03a6('0xe')](_0x3a87df[0x0],this);logger[_0x03a6('0xb')](_0x03a6('0xf'),_0x4dc8ad,_0x5151b6);sh[_0x03a6('0x10')](_[_0x03a6('0x11')](_0x5151b6),function(_0x6c9d07,_0x57019e){logger[_0x03a6('0xb')](_0x03a6('0x12'),_0x4dc8ad,_0x6c9d07);if(_0x6c9d07==0x0){var _0x5f4a65=_0x57019e[_0x03a6('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3a87df[0x1])||_[_0x03a6('0x14')](_0x3a87df[0x1])){logger[_0x03a6('0xb')](_0x03a6('0x15'),_0x4dc8ad);_0x4c4db1[_0x03a6('0x16')][_0x3a87df[0x1]]=_0x5f4a65;}else{logger['info'](_0x03a6('0x17'),_0x4dc8ad,_0x3a87df[0x1],_0x5f4a65);_0x4c4db1['body'][_0x3a87df[0x1]]=_0x5f4a65;}}_0x3cebae[_0x03a6('0xd')]();});}}catch(_0x4394fb){logger[_0x03a6('0x7')](_0x03a6('0x8'),_0x4dc8ad,_[_0x03a6('0x18')](_0x4394fb)?JSON['stringify'](_0x4394fb):_0x4394fb);logger[_0x03a6('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4dc8ad);_0x3cebae[_0x03a6('0xd')]();}};}; \ 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 eae55ee..301adc0 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 _0xf754=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][TAG]\x20%s','map','message','join','info','next','Interaction','channel','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number'];(function(_0x39eea2,_0x1ae953){var _0x57ef3a=function(_0x57494b){while(--_0x57494b){_0x39eea2['push'](_0x39eea2['shift']());}};_0x57ef3a(++_0x1ae953);}(_0xf754,0x110));var _0x4f75=function(_0x33d72f,_0x1ab76d){_0x33d72f=_0x33d72f-0x0;var _0x181b60=_0xf754[_0x33d72f];return _0x181b60;};'use strict';var schema=require('validate');var _=require(_0x4f75('0x0'));var rpc={'chatInteraction':require(_0x4f75('0x1')),'openchannelInteraction':require(_0x4f75('0x2')),'smsInteraction':require(_0x4f75('0x3')),'mailInteraction':require(_0x4f75('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x4f75('0x5'))};var logger=require(_0x4f75('0x6'))('routing');var tag=schema({'tag':{'type':_0x4f75('0x7'),'required':!![],'message':_0x4f75('0x8')}});exports['consequence']=function(_0x18ab40,_0x44ac9e,_0x5768f0,_0x2ccc35){return function(_0x5c8c4f){try{var _0x566daa={'tag':_0x44ac9e[0x0]};var _0x469663=tag[_0x4f75('0x9')](_0x566daa,{'typecast':!![]});if(_0x469663[_0x4f75('0xa')]){logger[_0x4f75('0xb')](_0x4f75('0xc'),_0x18ab40,_[_0x4f75('0xd')](_0x469663,_0x4f75('0xe'))[_0x4f75('0xf')](',\x20'));logger[_0x4f75('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x18ab40);_0x5c8c4f[_0x4f75('0x11')]();}else{var _0x2a176e={'ids':[_0x44ac9e[0x0]]};if(rpc[_0x2ccc35['channel']+_0x4f75('0x12')]){rpc[_0x2ccc35[_0x4f75('0x13')]+_0x4f75('0x12')][_0x4f75('0x14')](_0x2ccc35[_0x4f75('0x15')]['id'],_0x2a176e)['then'](function(_0x399c6b){logger[_0x4f75('0x10')](_0x4f75('0x16'),_0x18ab40,_0x44ac9e[0x1],_0x2ccc35['channel'],_0x2ccc35[_0x4f75('0x15')]['id']);})[_0x4f75('0x17')](function(_0x225d1a){logger[_0x4f75('0xb')](_0x4f75('0xc'),_0x18ab40,JSON['stringify'](_0x225d1a));logger[_0x4f75('0x10')](_0x4f75('0x18'),_0x18ab40);})[_0x4f75('0x19')](function(){_0x5c8c4f[_0x4f75('0x11')]();});}}}catch(_0xe649bd){logger[_0x4f75('0xb')](_0x4f75('0xc'),_0x18ab40,_[_0x4f75('0x1a')](_0xe649bd)?JSON[_0x4f75('0x1b')](_0xe649bd):_0xe649bd);logger[_0x4f75('0x10')](_0x4f75('0x18'),_0x18ab40);_0x5c8c4f[_0x4f75('0x11')]();}};}; \ No newline at end of file +var _0x207b=['../../rpc/whatsappInteraction','../../../../config/logger','number','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','validate','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x207b,0x19b));var _0xb207=function(_0x370281,_0x50b615){_0x370281=_0x370281-0x0;var _0x33a7ae=_0x207b[_0x370281];return _0x33a7ae;};'use strict';var schema=require(_0xb207('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb207('0x1')),'smsInteraction':require(_0xb207('0x2')),'mailInteraction':require(_0xb207('0x3')),'faxInteraction':require(_0xb207('0x4')),'whatsappInteraction':require(_0xb207('0x5'))};var logger=require(_0xb207('0x6'))('routing');var tag=schema({'tag':{'type':_0xb207('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xb207('0x8')]=function(_0x5de88f,_0x20f4bc,_0x29c3be,_0x201afa){return function(_0x426033){try{var _0x1808d1={'tag':_0x20f4bc[0x0]};var _0x21d6a6=tag['validate'](_0x1808d1,{'typecast':!![]});if(_0x21d6a6[_0xb207('0x9')]){logger[_0xb207('0xa')](_0xb207('0xb'),_0x5de88f,_[_0xb207('0xc')](_0x21d6a6,_0xb207('0xd'))[_0xb207('0xe')](',\x20'));logger[_0xb207('0xf')](_0xb207('0x10'),_0x5de88f);_0x426033[_0xb207('0x11')]();}else{var _0x2a4bfa={'ids':[_0x20f4bc[0x0]]};if(rpc[_0x201afa[_0xb207('0x12')]+'Interaction']){rpc[_0x201afa[_0xb207('0x12')]+_0xb207('0x13')][_0xb207('0x14')](_0x201afa[_0xb207('0x15')]['id'],_0x2a4bfa)['then'](function(_0x3167b9){logger[_0xb207('0xf')](_0xb207('0x16'),_0x5de88f,_0x20f4bc[0x1],_0x201afa[_0xb207('0x12')],_0x201afa['interaction']['id']);})['catch'](function(_0x521b03){logger[_0xb207('0xa')](_0xb207('0xb'),_0x5de88f,JSON[_0xb207('0x17')](_0x521b03));logger[_0xb207('0xf')](_0xb207('0x10'),_0x5de88f);})[_0xb207('0x18')](function(){_0x426033[_0xb207('0x11')]();});}}}catch(_0x4fdaf4){logger['error'](_0xb207('0xb'),_0x5de88f,_[_0xb207('0x19')](_0x4fdaf4)?JSON['stringify'](_0x4fdaf4):_0x4fdaf4);logger['info'](_0xb207('0x10'),_0x5de88f);_0x426033[_0xb207('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index c8789b3..f5f90f5 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 _0x475a=['login','params','stringify','POST','application/json-rpc','then','parse','result','logged','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','[%s][TVOX]\x20%s','isObject','stop','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method'];(function(_0x1b9d1e,_0x101ff2){var _0x35384a=function(_0x3174c4){while(--_0x3174c4){_0x1b9d1e['push'](_0x1b9d1e['shift']());}};_0x35384a(++_0x101ff2);}(_0x475a,0xba));var _0xa475=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x475a[_0x122ef9];return _0x42fba0;};'use strict';var rp=require('request-promise');var logger=require(_0xa475('0x0'))(_0xa475('0x1'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x15c3c2,_0x16aebd){return function(_0x169020){var _0x10ed91=_0x16aebd[0xa];var _0x499b5=_0x16aebd[0xb];var _0xc20584=_0x16aebd[0xc];var _0x1886d5=_0x16aebd[0xd];var _0x52171b=_0x16aebd[0xe];var _0x3a29e0=_0x16aebd[0xf][_0xa475('0x2')](/\n/g,'\x20-\x20');var _0x269991=_0x16aebd[0x10][_0xa475('0x2')](/\n/g,'\x20');if(!arr[_0xa475('0x3')](_0x499b5)){arr[_0xa475('0x4')](_0x499b5);var _0x1018bc=_0x16aebd[0x3];var _0x5a1003=_0x16aebd[0x4];var _0x1b87ae=_0x16aebd[0x1];var _0x5f7111=_0x16aebd[0x0];var _0x545182={};_0x545182[_0xa475('0x5')]=_0x16aebd[0x8]+_0xa475('0x6')+_0xc20584+'|'+_0x10ed91+'|'+_0x1886d5+'|'+_0x499b5+'|'+_0x52171b;_0x545182[_0xa475('0x7')]=_0x16aebd[0x7]+_0xa475('0x6')+_0xc20584+'|'+_0x10ed91+'|'+_0x1886d5+'|'+_0x499b5+'|'+_0x52171b+'|'+_0x3a29e0+'|'+_0x269991;_0x545182[_0xa475('0x8')]=_0x16aebd[0x9];var _0x26e514={};_0x26e514[_0xa475('0x9')]=_0xa475('0xa');_0x26e514[_0xa475('0xb')]=_0xa475('0xc');var _0x517d10=[];_0x517d10['push'](_0x16aebd[0x2]);_0x517d10[_0xa475('0x4')](_0x16aebd[0x5]);_0x517d10[_0xa475('0x4')](_0x16aebd[0x6]);_0x26e514[_0xa475('0xd')]=_0x517d10;_0x26e514['id']=0x1;var _0x917f39=JSON[_0xa475('0xe')](_0x26e514);var _0x596cf4={'encoding':'utf8','method':_0xa475('0xf'),'timeout':0x2710,'url':_0x1018bc,'headers':{'Content-Type':_0xa475('0x10')},'body':_0x917f39};return rp(_0x596cf4)[_0xa475('0x11')](function(_0x29c1c5){const _0x136986=JSON[_0xa475('0x12')](_0x29c1c5);if(!_0x136986[_0xa475('0x13')][_0xa475('0x14')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x5920c7=_0x499b5;var _0x5a2cff=_0xa475('0x15')+_0x1b87ae+_0xa475('0x16')+_0x5f7111+_0xa475('0x17')+_0x5920c7+_0xa475('0x18')+JSON[_0xa475('0xe')](_0x545182);var _0x1eac31=_0x5a1003+'?'+_0x5a2cff;return rp(_0x1eac31);})[_0xa475('0x11')](function(_0x49d29b){logger['info'](_0xa475('0x19'),_0x15c3c2,_0x49d29b);_0x169020['stop']();})['catch'](function(_0x5f8db1){logger[_0xa475('0x1a')](_0xa475('0x1b'),_0x15c3c2,_[_0xa475('0x1c')](_0x5f8db1)?JSON[_0xa475('0xe')](_0x5f8db1):_0x5f8db1);_0x169020[_0xa475('0x1d')]();});}else{logger[_0xa475('0x1e')](_0xa475('0x1f'),_0x15c3c2);_0x169020[_0xa475('0x20')]();}};}; \ No newline at end of file +var _0x5e9d=['&serviceId=','&sessionId=','&data=','stringify','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','method','utf8','application/json-rpc','parse','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId='];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5e9d,0x64));var _0xd5e9=function(_0x3e10b0,_0x4544e3){_0x3e10b0=_0x3e10b0-0x0;var _0x14b94d=_0x5e9d[_0x3e10b0];return _0x14b94d;};'use strict';var rp=require('request-promise');var logger=require(_0xd5e9('0x0'))(_0xd5e9('0x1'));var _=require('lodash');var arr=[];exports[_0xd5e9('0x2')]=function(_0x49151c,_0xbdcc0d){return function(_0x218315){var _0x3a1961=_0xbdcc0d[0xa];var _0x1d0a3b=_0xbdcc0d[0xb];var _0x16fe30=_0xbdcc0d[0xc];var _0x62b0f1=_0xbdcc0d[0xd];var _0x379551=_0xbdcc0d[0xe];var _0x1afa8b=_0xbdcc0d[0xf][_0xd5e9('0x3')](/\n/g,'\x20-\x20');var _0x3c88c4=_0xbdcc0d[0x10][_0xd5e9('0x3')](/\n/g,'\x20');if(!arr[_0xd5e9('0x4')](_0x1d0a3b)){arr[_0xd5e9('0x5')](_0x1d0a3b);var _0x3cb6e6=_0xbdcc0d[0x3];var _0x22758e=_0xbdcc0d[0x4];var _0x17703b=_0xbdcc0d[0x1];var _0xd06bb4=_0xbdcc0d[0x0];var _0x111ae7={};_0x111ae7[_0xd5e9('0x6')]=_0xbdcc0d[0x8]+_0xd5e9('0x7')+_0x16fe30+'|'+_0x3a1961+'|'+_0x62b0f1+'|'+_0x1d0a3b+'|'+_0x379551;_0x111ae7[_0xd5e9('0x8')]=_0xbdcc0d[0x7]+_0xd5e9('0x7')+_0x16fe30+'|'+_0x3a1961+'|'+_0x62b0f1+'|'+_0x1d0a3b+'|'+_0x379551+'|'+_0x1afa8b+'|'+_0x3c88c4;_0x111ae7['title']=_0xbdcc0d[0x9];var _0x11d06e={};_0x11d06e[_0xd5e9('0x9')]='2.0';_0x11d06e[_0xd5e9('0xa')]='login';var _0x23599b=[];_0x23599b[_0xd5e9('0x5')](_0xbdcc0d[0x2]);_0x23599b[_0xd5e9('0x5')](_0xbdcc0d[0x5]);_0x23599b[_0xd5e9('0x5')](_0xbdcc0d[0x6]);_0x11d06e['params']=_0x23599b;_0x11d06e['id']=0x1;var _0x13b395=JSON['stringify'](_0x11d06e);var _0x27ca43={'encoding':_0xd5e9('0xb'),'method':'POST','timeout':0x2710,'url':_0x3cb6e6,'headers':{'Content-Type':_0xd5e9('0xc')},'body':_0x13b395};return rp(_0x27ca43)['then'](function(_0x4c4ab1){const _0x1eab16=JSON[_0xd5e9('0xd')](_0x4c4ab1);if(!_0x1eab16['result']['logged']){throw new Error(_0xd5e9('0xe'));}var _0x23b560=_0x1d0a3b;var _0x40691a=_0xd5e9('0xf')+_0x17703b+_0xd5e9('0x10')+_0xd06bb4+_0xd5e9('0x11')+_0x23b560+_0xd5e9('0x12')+JSON[_0xd5e9('0x13')](_0x111ae7);var _0xfc9d07=_0x22758e+'?'+_0x40691a;return rp(_0xfc9d07);})[_0xd5e9('0x14')](function(_0x4fb796){logger[_0xd5e9('0x15')](_0xd5e9('0x16'),_0x49151c,_0x4fb796);_0x218315[_0xd5e9('0x17')]();})[_0xd5e9('0x18')](function(_0x3b3af0){logger[_0xd5e9('0x19')]('[%s][TVOX]\x20%s',_0x49151c,_[_0xd5e9('0x1a')](_0x3b3af0)?JSON[_0xd5e9('0x13')](_0x3b3af0):_0x3b3af0);_0x218315['stop']();});}else{logger[_0xd5e9('0x15')](_0xd5e9('0x1b'),_0x49151c);_0x218315[_0xd5e9('0x1c')]();}};}; \ 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 b9d297d..cb1c5f0 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x38bba7,_0x594de8){var _0x37e9b2=function(_0x53bee3){while(--_0x53bee3){_0x38bba7['push'](_0x38bba7['shift']());}};_0x37e9b2(++_0x594de8);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x1ac309,_0x55a94b){var _0x5c1ee3=function(_0x5c2882){while(--_0x5c2882){_0x1ac309['push'](_0x1ac309['shift']());}};_0x5c1ee3(++_0x55a94b);}(_0xe706,0xa3));var _0x6e70=function(_0x5d491a,_0x46fe1b){_0x5d491a=_0x5d491a-0x0;var _0x31b402=_0xe706[_0x5d491a];return _0x31b402;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 1271a7b..3a7deff 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 _0xf7a1=['UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','interaction','applications','isArray','length','app','.js','autoreply','appdata','split','channel','mail','push','slice','join','dialogflow','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','message','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update'];(function(_0x438415,_0x5ee367){var _0x5d254c=function(_0x29040c){while(--_0x29040c){_0x438415['push'](_0x438415['shift']());}};_0x5d254c(++_0x5ee367);}(_0xf7a1,0xed));var _0x1f7a=function(_0x3dacc3,_0x3a475f){_0x3dacc3=_0x3dacc3-0x0;var _0x3ed9a5=_0xf7a1[_0x3dacc3];return _0x3ed9a5;};'use strict';var _=require(_0x1f7a('0x0'));var util=require(_0x1f7a('0x1'));var path=require(_0x1f7a('0x2'));var fs=require('fs');var jayson=require(_0x1f7a('0x3'));var BPromise=require(_0x1f7a('0x4'));var utils=require(_0x1f7a('0x5'));var sUtils=require(_0x1f7a('0x6'));var logger=require('../../../config/logger')(_0x1f7a('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x1f7a('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x1f7a('0x9')),'whatsappQueueReport':require(_0x1f7a('0xa'))};var RuleEngine=require(_0x1f7a('0xb'));function getId(_0x1ff20a,_0x4c4f12,_0x3971ab){return util[_0x1f7a('0xc')](_0x1f7a('0xd'),_0x1ff20a,_0x4c4f12||0x0,_0x3971ab||0x0);}function getIntervals(_0x32d27b,_0x5d357a){var _0x527b0a=[];if(!_['isNil'](_0x5d357a[_0x1f7a('0xe')])&&!_[_0x1f7a('0xf')](_0x32d27b[_0x5d357a['IntervalId']])&&!_[_0x1f7a('0xf')](_0x32d27b[_0x5d357a['IntervalId']][_0x1f7a('0x10')])){_0x527b0a=_[_0x1f7a('0x11')](_0x32d27b[_0x5d357a[_0x1f7a('0xe')]][_0x1f7a('0x10')],_0x1f7a('0x12'));}else if(!_[_0x1f7a('0xf')](_0x5d357a[_0x1f7a('0x12')])){_0x527b0a=[_0x5d357a[_0x1f7a('0x12')]];}return _0x527b0a;}exports[_0x1f7a('0x13')]=function(_0x3abda2){_0x3abda2[_0x1f7a('0x14')]={};return new BPromise(function(_0xbc6854,_0x3d7e0f){var _0x43c89b={'Start':function(_0x2de9bf){var _0x44762b=this;return new Promise(function(_0x4d3601,_0x44a419){if(_0x2de9bf){try{var _0x29dff4=[];var _0x2ef907=getId(_0x2de9bf['channel'],_0x2de9bf['message']?_0x2de9bf['message']['id']:0x0,_0x2de9bf[_0x1f7a('0x15')]?_0x2de9bf[_0x1f7a('0x15')]['id']:0x0);var _0x29d0f5=sUtils['checkWaitingNotifications'](_0x3abda2,_0x2de9bf);if(_0x2de9bf['transfer']||!_0x29d0f5&&_0x2de9bf[_0x1f7a('0x16')]&&_[_0x1f7a('0x17')](_0x2de9bf[_0x1f7a('0x16')])&&_0x2de9bf[_0x1f7a('0x16')]['length']){for(var _0x33151b=0x0;_0x33151b<_0x2de9bf[_0x1f7a('0x16')][_0x1f7a('0x18')];_0x33151b+=0x1){var _0x1cdf43=_0x2de9bf[_0x1f7a('0x16')][_0x33151b];if(fs['existsSync'](path['join'](__dirname,_0x1f7a('0x16'),_0x1cdf43[_0x1f7a('0x19')]+_0x1f7a('0x1a')))){var _0x189434=[];switch(_0x1cdf43[_0x1f7a('0x19')]['toLowerCase']()){case _0x1f7a('0x1b'):var _0x2ca312=_0x1cdf43[_0x1f7a('0x1c')][_0x1f7a('0x1d')](',');if(_0x2de9bf[_0x1f7a('0x1e')]===_0x1f7a('0x1f')){_0x189434[_0x1f7a('0x20')](_0x2ca312[0x0]);_0x189434[_0x1f7a('0x20')](_0x2ca312[0x1]);_0x189434[_0x1f7a('0x20')](_0x2ca312[_0x1f7a('0x21')](0x2,_0x2ca312[_0x1f7a('0x18')])['join'](','));}else{_0x189434[_0x1f7a('0x20')](_0x2ca312[0x0]);_0x189434['push'](_0x2ca312['slice'](0x1,_0x2ca312[_0x1f7a('0x18')])[_0x1f7a('0x22')](','));}break;case _0x1f7a('0x23'):var _0x527139=_0x1cdf43['appdata'][_0x1f7a('0x1d')](',');_0x189434[_0x1f7a('0x20')](_0x527139[0x0]);_0x189434[_0x1f7a('0x20')](_0x527139[0x1]);_0x189434[_0x1f7a('0x20')](_0x527139[_0x1f7a('0x21')](0x2,_0x527139['length'])['join'](','));break;case'dialogflowv2':var _0x1d4086=_0x1cdf43[_0x1f7a('0x1c')][_0x1f7a('0x1d')](',');_0x189434['push'](_0x1d4086[0x0]);_0x189434[_0x1f7a('0x20')](_0x1d4086[0x1]);_0x189434[_0x1f7a('0x20')](_0x1d4086[0x2]);_0x189434[_0x1f7a('0x20')](_0x1d4086[0x3]);_0x189434[_0x1f7a('0x20')](_0x1d4086[_0x1f7a('0x21')](0x4,_0x1d4086[_0x1f7a('0x18')])[_0x1f7a('0x22')](','));break;case _0x1f7a('0x24'):var _0x2d13b0=_0x1cdf43[_0x1f7a('0x1c')]['split'](',');_0x189434[_0x1f7a('0x20')](_0x2d13b0[0x0]);_0x189434[_0x1f7a('0x20')](_0x2d13b0[0x1]);_0x189434[_0x1f7a('0x20')](_0x2d13b0[0x2]);_0x189434[_0x1f7a('0x20')](_0x2d13b0[0x3]);_0x189434[_0x1f7a('0x20')](_0x2d13b0[_0x1f7a('0x21')](0x4,_0x2d13b0[_0x1f7a('0x18')])[_0x1f7a('0x22')](','));break;case'message':_0x189434[_0x1f7a('0x20')](_0x1cdf43[_0x1f7a('0x1c')]);break;case _0x1f7a('0x25'):_0x189434[_0x1f7a('0x20')](_0x1cdf43[_0x1f7a('0x26')]);_0x189434[_0x1f7a('0x20')](_0x1cdf43[_0x1f7a('0x1c')]);break;case'tvox':var _0x5abf5e=utils[_0x1f7a('0x27')](_0x2de9bf[_0x1f7a('0x28')][_0x1f7a('0x29')],_0x2de9bf);var _0x4de2f2=_0x1cdf43[_0x1f7a('0x1c')]['split'](',');_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x0]);_0x189434['push'](_0x4de2f2[0x1]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x2]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x3]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x4]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x5]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x6]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x7]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x8]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0x9]);_0x189434[_0x1f7a('0x20')](_0x4de2f2[0xa]);_0x189434[_0x1f7a('0x20')](_0x2de9bf[_0x1f7a('0x15')]['id']);_0x189434[_0x1f7a('0x20')](_0x2de9bf[_0x1f7a('0x2a')]['id']);_0x189434['push'](_0x1cdf43[_0x1f7a('0x2b')]);_0x189434[_0x1f7a('0x20')](_0x2de9bf[_0x1f7a('0x15')][_0x1f7a('0x2c')]);_0x189434[_0x1f7a('0x20')](_0x2de9bf['body'][_0x1f7a('0x2d')]);_0x189434[_0x1f7a('0x20')](_0x5abf5e);break;default:_0x189434=_[_0x1f7a('0xf')](_0x1cdf43['appdata'])?[]:_0x1cdf43[_0x1f7a('0x1c')][_0x1f7a('0x1d')](',');}var _0x38200f={'id':util['format'](_0x1f7a('0x2e'),_0x2ef907,_0x1cdf43['id'],_0x1cdf43['app']),'condition':require(_0x1f7a('0x2f'))[_0x1f7a('0x30')](_0x2ef907,getIntervals(_0x3abda2['intervals'],_0x1cdf43),_0x3abda2),'consequence':require(_0x1f7a('0x31')+_0x1cdf43['app'])[_0x1f7a('0x32')](_0x2ef907,_0x189434,_0x3abda2,_0x2de9bf),'p':_0x1cdf43[_0x1f7a('0x33')]||0x0};logger[_0x1f7a('0x34')]('Push\x20new\x20rule',_0x38200f['id'],_0x1f7a('0x35'),getIntervals(_0x3abda2['intervals'],_0x1cdf43)[_0x1f7a('0x22')](_0x1f7a('0x36')));_0x29dff4[_0x1f7a('0x20')](_0x38200f);}else{logger[_0x1f7a('0x37')](_0x1f7a('0x38'),path[_0x1f7a('0x22')](__dirname,_0x1f7a('0x16'),_0x1cdf43[_0x1f7a('0x19')]+'.js'));}}_0x3abda2['rules'][_0x2ef907]=new RuleEngine(_0x29dff4);_0x3abda2[_0x1f7a('0x14')][_0x2ef907][_0x1f7a('0x39')](_0x2de9bf,function(_0x451260){logger[_0x1f7a('0x34')](_0x1f7a('0x3a'),JSON[_0x1f7a('0x3b')](_0x451260['matchPath']));if(_0x3abda2[_0x1f7a('0x14')][_0x2ef907]){_0x3abda2['rules'][_0x2ef907][_0x1f7a('0x3c')](_0x1f7a('0x3d'));}});return _0x4d3601({'code':0xc8,'message':_0x2de9bf});}else{if(_0x29d0f5){logger[_0x1f7a('0x34')](util[_0x1f7a('0xc')](_0x1f7a('0x3e'),_0x2ef907));}else{logger['info'](_0x1f7a('0x3f'));}return _0x4d3601({'code':0xc8,'message':_0x2de9bf});}}catch(_0x595640){logger[_0x1f7a('0x37')](_0x595640['stack']);return _0x44a419(_0x44762b[_0x1f7a('0x37')](0x1f4,_0x595640));}}return _0x44a419(_0x1f7a('0x40'));});},'AcceptMessage':function(_0x19e5be){var _0x59dcd0=this;return new Promise(function(_0x5efd10,_0x42ed1c){if(_0x19e5be[_0x1f7a('0x41')]&&_0x19e5be[_0x1f7a('0x41')]['id']){if(_0x3abda2['agents'][_0x19e5be[_0x1f7a('0x41')]['id']]){_0x3abda2[_0x1f7a('0x42')][_0x19e5be[_0x1f7a('0x41')]['id']][_0x1f7a('0x43')]=![];_0x3abda2[_0x1f7a('0x42')][_0x19e5be[_0x1f7a('0x41')]['id']][_0x1f7a('0x44')]=undefined;}}if(_0x19e5be[_0x1f7a('0x2a')]&&_0x19e5be[_0x1f7a('0x2a')]['id']){try{var _0x43bdce=getId(_0x19e5be[_0x1f7a('0x1e')],_0x19e5be[_0x1f7a('0x2a')]?_0x19e5be['message']['id']:0x0,_0x19e5be[_0x1f7a('0x15')]?_0x19e5be[_0x1f7a('0x15')]['id']:0x0);if(_0x3abda2[_0x1f7a('0x14')][_0x43bdce]){_0x3abda2[_0x1f7a('0x14')][_0x43bdce][_0x1f7a('0x3c')](_0x1f7a('0x45'));if(rpc[_0x19e5be['channel']+_0x1f7a('0x46')]){rpc[_0x19e5be[_0x1f7a('0x1e')]+'QueueReport'][_0x1f7a('0x47')](_0x43bdce,{'UserId':_0x19e5be[_0x1f7a('0x2a')][_0x1f7a('0x48')]})['catch'](function(){logger[_0x1f7a('0x37')](_0x1f7a('0x49'));});}}return _0x5efd10({'code':0xc8,'message':_0x19e5be});}catch(_0x29e759){logger[_0x1f7a('0x37')](_0x29e759[_0x1f7a('0x4a')]);return _0x42ed1c(_0x59dcd0[_0x1f7a('0x37')](0x1f4,_0x29e759));}}logger['error'](_0x1f7a('0x4b'));return _0x42ed1c(_0x59dcd0['error'](0x1f4,_0x1f7a('0x4b')));});},'RejectMessage':function(_0x40981e){var _0x1b2b50=this;return new Promise(function(_0x42c673,_0x17cedd){if(_0x40981e[_0x1f7a('0x41')]&&_0x40981e['agent']['id']){try{if(_0x3abda2[_0x1f7a('0x42')][_0x40981e[_0x1f7a('0x41')]['id']]){_0x3abda2[_0x1f7a('0x42')][_0x40981e[_0x1f7a('0x41')]['id']][_0x1f7a('0x43')]=![];_0x3abda2[_0x1f7a('0x42')][_0x40981e[_0x1f7a('0x41')]['id']][_0x1f7a('0x44')]=undefined;}return _0x42c673({'code':0xc8,'message':_0x40981e});}catch(_0x5dc206){logger['error'](_0x5dc206['stack']);return _0x17cedd(_0x1b2b50[_0x1f7a('0x37')](0x1f4,_0x5dc206));}}logger[_0x1f7a('0x37')]('message\x20is\x20empty');return _0x17cedd(_0x1b2b50['error'](0x1f4,_0x1f7a('0x4b')));});},'AbandonInteraction':function(_0xfbccf1){var _0x4102b6=this;return new Promise(function(_0x482329,_0x4ba2d7){if(_0xfbccf1['channel']&&_0xfbccf1[_0x1f7a('0x15')]&&_0xfbccf1[_0x1f7a('0x15')]['id']){try{var _0xc27293=getId(_0xfbccf1[_0x1f7a('0x1e')],_0xfbccf1[_0x1f7a('0x2a')]?_0xfbccf1['message']['id']:0x0,_0xfbccf1['interaction']?_0xfbccf1['interaction']['id']:0x0);if(_0x3abda2['rules'][_0xc27293]){_0x3abda2[_0x1f7a('0x14')][_0xc27293][_0x1f7a('0x3c')](_0x1f7a('0x45'));}return _0x482329({'code':0xc8,'message':_0xfbccf1});}catch(_0x4c6357){logger[_0x1f7a('0x37')](_0x4c6357[_0x1f7a('0x4a')]);return _0x4ba2d7(_0x4102b6[_0x1f7a('0x37')](0x1f4,_0x4c6357));}}logger[_0x1f7a('0x37')](_0x1f7a('0x4b'));return _0x4ba2d7(_0x4102b6['error'](0x1f4,_0x1f7a('0x4b')));});},'AgentCapacity':function(_0xd77420){var _0x5e3711=this;return new Promise(function(_0xdd2d6c,_0x5c8688){if(_0x3abda2['agents']['hasOwnProperty'](_0xd77420['id'])){for(var _0x48099f in _0xd77420[_0x1f7a('0x4c')]){if(_0xd77420['capacity']['hasOwnProperty'](_0x48099f)){if(_0x3abda2[_0x1f7a('0x42')][_0xd77420['id']][_0x1f7a('0x4d')](_0x48099f+_0x1f7a('0x4e'))){_0x3abda2[_0x1f7a('0x42')][_0xd77420['id']][_0x48099f+'CurrentCapacity']=parseInt(_0xd77420[_0x1f7a('0x4c')][_0x48099f],0xa);}}}_0x3abda2['agents'][_0xd77420['id']][_0x1f7a('0x4f')]();return _0xdd2d6c({'code':0xc8,'message':_0x3abda2[_0x1f7a('0x42')][_0xd77420['id']]});}else{return _0x5c8688(_0x5e3711[_0x1f7a('0x37')](0x1f4,_0x1f7a('0x50')));}});},'Agents':function(_0x49f38f){return new Promise(function(_0x5782d3){var _0x9841c9=_[_0x1f7a('0x51')](_0x3abda2[_0x1f7a('0x42')]);if(_0x49f38f&&_0x49f38f['id']){var _0x112861=_[_0x1f7a('0x52')](_0x9841c9,function(_0x11a4a5){return _0x11a4a5['id']===_0x49f38f['id'];});_0x5782d3(_0x112861);}else{_0x5782d3({'count':_0x9841c9[_0x1f7a('0x18')],'rows':_0x9841c9});}});},'ChatQueues':function(){return new Promise(function(_0xce59aa){var _0x34cf88=[];for(var _0x1c4e8f in _0x3abda2['chatQueues']){if(_0x3abda2['chatQueues']['hasOwnProperty'](_0x1c4e8f)){var _0x3c008e=_0x3abda2['chatQueues'][_0x1c4e8f];var _0x1bbdb8={'id':_0x3c008e['id'],'available':_0x3c008e['available'],'loggedIn':_0x3c008e[_0x1f7a('0x53')],'name':_0x3c008e['name'],'paused':_0x3c008e[_0x1f7a('0x54')],'waiting':_0x3c008e[_0x1f7a('0x55')]};_0x34cf88['push'](_0x1bbdb8);}}_0xce59aa({'count':_0x34cf88[_0x1f7a('0x18')],'rows':_0x34cf88});});},'MailQueues':function(){return new Promise(function(_0x3322c9){var _0x570dbb=[];for(var _0x5bfcbf in _0x3abda2[_0x1f7a('0x56')]){if(_0x3abda2['mailQueues'][_0x1f7a('0x4d')](_0x5bfcbf)){var _0x5d32fd=_0x3abda2['mailQueues'][_0x5bfcbf];var _0x217ecc={'id':_0x5d32fd['id'],'available':_0x5d32fd[_0x1f7a('0x57')],'loggedIn':_0x5d32fd[_0x1f7a('0x53')],'name':_0x5d32fd[_0x1f7a('0x58')],'paused':_0x5d32fd[_0x1f7a('0x54')],'waiting':_0x5d32fd[_0x1f7a('0x55')]};_0x570dbb[_0x1f7a('0x20')](_0x217ecc);}}_0x3322c9({'count':_0x570dbb[_0x1f7a('0x18')],'rows':_0x570dbb});});},'OpenchannelQueues':function(){return new Promise(function(_0x1c2dc7){var _0x2024e2=[];for(var _0xa038af in _0x3abda2[_0x1f7a('0x59')]){if(_0x3abda2['openchannelQueues'][_0x1f7a('0x4d')](_0xa038af)){var _0x335054=_0x3abda2[_0x1f7a('0x59')][_0xa038af];var _0x508bc5={'id':_0x335054['id'],'available':_0x335054[_0x1f7a('0x57')],'loggedIn':_0x335054[_0x1f7a('0x53')],'name':_0x335054[_0x1f7a('0x58')],'paused':_0x335054['paused'],'waiting':_0x335054[_0x1f7a('0x55')]};_0x2024e2['push'](_0x508bc5);}}_0x1c2dc7({'count':_0x2024e2[_0x1f7a('0x18')],'rows':_0x2024e2});});},'SmsQueues':function(){return new Promise(function(_0x1198b0){var _0x3089b1=[];for(var _0x17aaa9 in _0x3abda2[_0x1f7a('0x5a')]){if(_0x3abda2[_0x1f7a('0x5a')][_0x1f7a('0x4d')](_0x17aaa9)){var _0x2466ec=_0x3abda2[_0x1f7a('0x5a')][_0x17aaa9];var _0x358c3e={'id':_0x2466ec['id'],'available':_0x2466ec['available'],'loggedIn':_0x2466ec['loggedIn'],'name':_0x2466ec[_0x1f7a('0x58')],'paused':_0x2466ec[_0x1f7a('0x54')],'waiting':_0x2466ec['waiting']};_0x3089b1[_0x1f7a('0x20')](_0x358c3e);}}_0x1198b0({'count':_0x3089b1[_0x1f7a('0x18')],'rows':_0x3089b1});});},'FaxQueues':function(){return new Promise(function(_0x2c22b3){var _0x5ce727=[];for(var _0x2a044 in _0x3abda2['faxQueues']){if(_0x3abda2[_0x1f7a('0x5b')][_0x1f7a('0x4d')](_0x2a044)){var _0x3151ff=_0x3abda2[_0x1f7a('0x5b')][_0x2a044];var _0x24f7b8={'id':_0x3151ff['id'],'available':_0x3151ff[_0x1f7a('0x57')],'loggedIn':_0x3151ff[_0x1f7a('0x53')],'name':_0x3151ff[_0x1f7a('0x58')],'paused':_0x3151ff['paused'],'waiting':_0x3151ff[_0x1f7a('0x55')]};_0x5ce727['push'](_0x24f7b8);}}_0x2c22b3({'count':_0x5ce727[_0x1f7a('0x18')],'rows':_0x5ce727});});},'WhatsappQueues':function(){return new Promise(function(_0x43befb){var _0x5c7cc2=[];for(var _0x543b94 in _0x3abda2[_0x1f7a('0x5c')]){if(_0x3abda2[_0x1f7a('0x5c')]['hasOwnProperty'](_0x543b94)){var _0x42d717=_0x3abda2[_0x1f7a('0x5c')][_0x543b94];var _0x4673cd={'id':_0x42d717['id'],'available':_0x42d717[_0x1f7a('0x57')],'loggedIn':_0x42d717[_0x1f7a('0x53')],'name':_0x42d717[_0x1f7a('0x58')],'paused':_0x42d717[_0x1f7a('0x54')],'waiting':_0x42d717[_0x1f7a('0x55')]};_0x5c7cc2[_0x1f7a('0x20')](_0x4673cd);}}_0x43befb({'count':_0x5c7cc2[_0x1f7a('0x18')],'rows':_0x5c7cc2});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x20564e){var _0x432e2c=_[_0x1f7a('0x51')](_0x3abda2['chatQueuesWaitingInteractions']);_0x20564e({'count':_0x432e2c[_0x1f7a('0x18')],'rows':_0x432e2c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x404173){var _0xe238c7=_[_0x1f7a('0x51')](_0x3abda2[_0x1f7a('0x5d')]);_0x404173({'count':_0xe238c7[_0x1f7a('0x18')],'rows':_0xe238c7});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x475fae){var _0xecb41d=_[_0x1f7a('0x51')](_0x3abda2[_0x1f7a('0x5e')]);_0x475fae({'count':_0xecb41d['length'],'rows':_0xecb41d});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1d74e0){var _0x40f579=_[_0x1f7a('0x51')](_0x3abda2[_0x1f7a('0x5f')]);_0x1d74e0({'count':_0x40f579[_0x1f7a('0x18')],'rows':_0x40f579});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x581e3f){var _0x18e032=_[_0x1f7a('0x51')](_0x3abda2[_0x1f7a('0x60')]);_0x581e3f({'count':_0x18e032['length'],'rows':_0x18e032});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xd13435){var _0x5309df=_[_0x1f7a('0x51')](_0x3abda2[_0x1f7a('0x61')]);_0xd13435({'count':_0x5309df['length'],'rows':_0x5309df});});}};var _0x19d9ce=jayson[_0x1f7a('0x62')](_0x43c89b)['http']();_0x19d9ce['on'](_0x1f7a('0x37'),function(_0x57e5d3){logger[_0x1f7a('0x37')](JSON[_0x1f7a('0x3b')](_0x57e5d3));return _0x3d7e0f(_0x57e5d3);});_0x19d9ce['listen'](0x232c,_0x1f7a('0x63'),function(){console[_0x1f7a('0x64')](_0x1f7a('0x65'),0x232c);return _0xbc6854(_0x1f7a('0x66')+0x232c);});});}; \ No newline at end of file +var _0x5430=['tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','complete','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','app','.js','toLowerCase','split','mail','push','slice','join','dialogflow','appdata'];(function(_0x41d643,_0x47e321){var _0x2aa9fc=function(_0x5e4e7e){while(--_0x5e4e7e){_0x41d643['push'](_0x41d643['shift']());}};_0x2aa9fc(++_0x47e321);}(_0x5430,0x10c));var _0x0543=function(_0x3a1e12,_0x70989a){_0x3a1e12=_0x3a1e12-0x0;var _0x1ff5b0=_0x5430[_0x3a1e12];return _0x1ff5b0;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var fs=require('fs');var jayson=require(_0x0543('0x3'));var BPromise=require(_0x0543('0x4'));var utils=require(_0x0543('0x5'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0x0543('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x0543('0x7')),'smsQueueReport':require(_0x0543('0x8')),'faxQueueReport':require(_0x0543('0x9')),'whatsappQueueReport':require(_0x0543('0xa'))};var RuleEngine=require(_0x0543('0xb'));function getId(_0x5ac352,_0x372974,_0x7b8280){return util[_0x0543('0xc')](_0x0543('0xd'),_0x5ac352,_0x372974||0x0,_0x7b8280||0x0);}function getIntervals(_0x2fb723,_0x94b9e7){var _0x56003c=[];if(!_[_0x0543('0xe')](_0x94b9e7[_0x0543('0xf')])&&!_['isNil'](_0x2fb723[_0x94b9e7[_0x0543('0xf')]])&&!_[_0x0543('0xe')](_0x2fb723[_0x94b9e7[_0x0543('0xf')]][_0x0543('0x10')])){_0x56003c=_[_0x0543('0x11')](_0x2fb723[_0x94b9e7[_0x0543('0xf')]][_0x0543('0x10')],_0x0543('0x12'));}else if(!_[_0x0543('0xe')](_0x94b9e7[_0x0543('0x12')])){_0x56003c=[_0x94b9e7[_0x0543('0x12')]];}return _0x56003c;}exports[_0x0543('0x13')]=function(_0x552980){_0x552980[_0x0543('0x14')]={};return new BPromise(function(_0x21e9ac,_0x4d2a27){var _0x4c4763={'Start':function(_0xcb09df){var _0x40fb03=this;return new Promise(function(_0x1dff7d,_0x1cfadf){if(_0xcb09df){try{var _0x38a32e=[];var _0x50d504=getId(_0xcb09df[_0x0543('0x15')],_0xcb09df[_0x0543('0x16')]?_0xcb09df[_0x0543('0x16')]['id']:0x0,_0xcb09df[_0x0543('0x17')]?_0xcb09df[_0x0543('0x17')]['id']:0x0);var _0x285080=sUtils[_0x0543('0x18')](_0x552980,_0xcb09df);if(_0xcb09df['transfer']||!_0x285080&&_0xcb09df[_0x0543('0x19')]&&_['isArray'](_0xcb09df['applications'])&&_0xcb09df[_0x0543('0x19')][_0x0543('0x1a')]){for(var _0x1aece5=0x0;_0x1aece5<_0xcb09df['applications'][_0x0543('0x1a')];_0x1aece5+=0x1){var _0x51c271=_0xcb09df[_0x0543('0x19')][_0x1aece5];if(fs[_0x0543('0x1b')](path['join'](__dirname,_0x0543('0x19'),_0x51c271[_0x0543('0x1c')]+_0x0543('0x1d')))){var _0x110060=[];switch(_0x51c271[_0x0543('0x1c')][_0x0543('0x1e')]()){case'autoreply':var _0x5979d2=_0x51c271['appdata'][_0x0543('0x1f')](',');if(_0xcb09df[_0x0543('0x15')]===_0x0543('0x20')){_0x110060[_0x0543('0x21')](_0x5979d2[0x0]);_0x110060[_0x0543('0x21')](_0x5979d2[0x1]);_0x110060[_0x0543('0x21')](_0x5979d2[_0x0543('0x22')](0x2,_0x5979d2[_0x0543('0x1a')])[_0x0543('0x23')](','));}else{_0x110060[_0x0543('0x21')](_0x5979d2[0x0]);_0x110060[_0x0543('0x21')](_0x5979d2[_0x0543('0x22')](0x1,_0x5979d2['length'])[_0x0543('0x23')](','));}break;case _0x0543('0x24'):var _0x30ad9e=_0x51c271['appdata'][_0x0543('0x1f')](',');_0x110060[_0x0543('0x21')](_0x30ad9e[0x0]);_0x110060[_0x0543('0x21')](_0x30ad9e[0x1]);_0x110060[_0x0543('0x21')](_0x30ad9e['slice'](0x2,_0x30ad9e[_0x0543('0x1a')])[_0x0543('0x23')](','));break;case'dialogflowv2':var _0x576084=_0x51c271[_0x0543('0x25')][_0x0543('0x1f')](',');_0x110060['push'](_0x576084[0x0]);_0x110060[_0x0543('0x21')](_0x576084[0x1]);_0x110060[_0x0543('0x21')](_0x576084[0x2]);_0x110060[_0x0543('0x21')](_0x576084[0x3]);_0x110060[_0x0543('0x21')](_0x576084[_0x0543('0x22')](0x4,_0x576084[_0x0543('0x1a')])[_0x0543('0x23')](','));break;case'amazonlex':var _0x45ac71=_0x51c271['appdata'][_0x0543('0x1f')](',');_0x110060[_0x0543('0x21')](_0x45ac71[0x0]);_0x110060[_0x0543('0x21')](_0x45ac71[0x1]);_0x110060[_0x0543('0x21')](_0x45ac71[0x2]);_0x110060[_0x0543('0x21')](_0x45ac71[0x3]);_0x110060['push'](_0x45ac71[_0x0543('0x22')](0x4,_0x45ac71['length'])[_0x0543('0x23')](','));break;case _0x0543('0x16'):_0x110060[_0x0543('0x21')](_0x51c271[_0x0543('0x25')]);break;case'tag':_0x110060[_0x0543('0x21')](_0x51c271['TagId']);_0x110060[_0x0543('0x21')](_0x51c271[_0x0543('0x25')]);break;case _0x0543('0x26'):var _0x316c6f=utils[_0x0543('0x27')](_0xcb09df[_0x0543('0x28')][_0x0543('0x29')],_0xcb09df);var _0x44c771=_0x51c271[_0x0543('0x25')][_0x0543('0x1f')](',');_0x110060['push'](_0x44c771[0x0]);_0x110060[_0x0543('0x21')](_0x44c771[0x1]);_0x110060[_0x0543('0x21')](_0x44c771[0x2]);_0x110060['push'](_0x44c771[0x3]);_0x110060[_0x0543('0x21')](_0x44c771[0x4]);_0x110060['push'](_0x44c771[0x5]);_0x110060[_0x0543('0x21')](_0x44c771[0x6]);_0x110060[_0x0543('0x21')](_0x44c771[0x7]);_0x110060['push'](_0x44c771[0x8]);_0x110060['push'](_0x44c771[0x9]);_0x110060[_0x0543('0x21')](_0x44c771[0xa]);_0x110060[_0x0543('0x21')](_0xcb09df['interaction']['id']);_0x110060[_0x0543('0x21')](_0xcb09df[_0x0543('0x16')]['id']);_0x110060['push'](_0x51c271[_0x0543('0x2a')]);_0x110060[_0x0543('0x21')](_0xcb09df[_0x0543('0x17')][_0x0543('0x2b')]);_0x110060[_0x0543('0x21')](_0xcb09df['body']['body']);_0x110060['push'](_0x316c6f);break;default:_0x110060=_[_0x0543('0xe')](_0x51c271[_0x0543('0x25')])?[]:_0x51c271[_0x0543('0x25')][_0x0543('0x1f')](',');}var _0x529ee0={'id':util[_0x0543('0xc')](_0x0543('0x2c'),_0x50d504,_0x51c271['id'],_0x51c271[_0x0543('0x1c')]),'condition':require(_0x0543('0x2d'))[_0x0543('0x2e')](_0x50d504,getIntervals(_0x552980[_0x0543('0x2f')],_0x51c271),_0x552980),'consequence':require(_0x0543('0x30')+_0x51c271['app'])[_0x0543('0x31')](_0x50d504,_0x110060,_0x552980,_0xcb09df),'p':_0x51c271[_0x0543('0x32')]||0x0};logger[_0x0543('0x33')](_0x0543('0x34'),_0x529ee0['id'],_0x0543('0x35'),getIntervals(_0x552980[_0x0543('0x2f')],_0x51c271)['join']('\x20|\x20'));_0x38a32e[_0x0543('0x21')](_0x529ee0);}else{logger[_0x0543('0x36')](_0x0543('0x37'),path[_0x0543('0x23')](__dirname,_0x0543('0x19'),_0x51c271[_0x0543('0x1c')]+_0x0543('0x1d')));}}_0x552980[_0x0543('0x14')][_0x50d504]=new RuleEngine(_0x38a32e);_0x552980[_0x0543('0x14')][_0x50d504]['execute'](_0xcb09df,function(_0x4c99f0){logger[_0x0543('0x33')](_0x0543('0x38'),JSON['stringify'](_0x4c99f0['matchPath']));if(_0x552980[_0x0543('0x14')][_0x50d504]){_0x552980[_0x0543('0x14')][_0x50d504]['emit'](_0x0543('0x39'));}});return _0x1dff7d({'code':0xc8,'message':_0xcb09df});}else{if(_0x285080){logger['info'](util[_0x0543('0xc')](_0x0543('0x3a'),_0x50d504));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x1dff7d({'code':0xc8,'message':_0xcb09df});}}catch(_0xd95442){logger['error'](_0xd95442[_0x0543('0x3b')]);return _0x1cfadf(_0x40fb03[_0x0543('0x36')](0x1f4,_0xd95442));}}return _0x1cfadf(_0x0543('0x3c'));});},'AcceptMessage':function(_0x270ce0){var _0x158536=this;return new Promise(function(_0x310da4,_0x5a28a3){if(_0x270ce0[_0x0543('0x3d')]&&_0x270ce0[_0x0543('0x3d')]['id']){if(_0x552980[_0x0543('0x3e')][_0x270ce0[_0x0543('0x3d')]['id']]){_0x552980[_0x0543('0x3e')][_0x270ce0['agent']['id']][_0x0543('0x3f')]=![];_0x552980['agents'][_0x270ce0[_0x0543('0x3d')]['id']][_0x0543('0x40')]=undefined;}}if(_0x270ce0[_0x0543('0x16')]&&_0x270ce0[_0x0543('0x16')]['id']){try{var _0x32e4e6=getId(_0x270ce0[_0x0543('0x15')],_0x270ce0['message']?_0x270ce0['message']['id']:0x0,_0x270ce0['interaction']?_0x270ce0[_0x0543('0x17')]['id']:0x0);if(_0x552980[_0x0543('0x14')][_0x32e4e6]){_0x552980['rules'][_0x32e4e6][_0x0543('0x41')](_0x0543('0x42'));if(rpc[_0x270ce0[_0x0543('0x15')]+_0x0543('0x43')]){rpc[_0x270ce0[_0x0543('0x15')]+_0x0543('0x43')]['update'](_0x32e4e6,{'UserId':_0x270ce0[_0x0543('0x16')][_0x0543('0x44')]})[_0x0543('0x45')](function(){logger[_0x0543('0x36')](_0x0543('0x46'));});}}return _0x310da4({'code':0xc8,'message':_0x270ce0});}catch(_0x449150){logger[_0x0543('0x36')](_0x449150[_0x0543('0x3b')]);return _0x5a28a3(_0x158536[_0x0543('0x36')](0x1f4,_0x449150));}}logger[_0x0543('0x36')](_0x0543('0x47'));return _0x5a28a3(_0x158536[_0x0543('0x36')](0x1f4,_0x0543('0x47')));});},'RejectMessage':function(_0x95e296){var _0x5805f7=this;return new Promise(function(_0x14358d,_0x3c5acc){if(_0x95e296[_0x0543('0x3d')]&&_0x95e296[_0x0543('0x3d')]['id']){try{if(_0x552980[_0x0543('0x3e')][_0x95e296[_0x0543('0x3d')]['id']]){_0x552980[_0x0543('0x3e')][_0x95e296[_0x0543('0x3d')]['id']][_0x0543('0x3f')]=![];_0x552980[_0x0543('0x3e')][_0x95e296[_0x0543('0x3d')]['id']][_0x0543('0x40')]=undefined;}return _0x14358d({'code':0xc8,'message':_0x95e296});}catch(_0x8e8ac9){logger[_0x0543('0x36')](_0x8e8ac9[_0x0543('0x3b')]);return _0x3c5acc(_0x5805f7['error'](0x1f4,_0x8e8ac9));}}logger[_0x0543('0x36')](_0x0543('0x47'));return _0x3c5acc(_0x5805f7['error'](0x1f4,_0x0543('0x47')));});},'AbandonInteraction':function(_0xcd4d5){var _0x38d66f=this;return new Promise(function(_0x51df8d,_0x190e43){if(_0xcd4d5['channel']&&_0xcd4d5[_0x0543('0x17')]&&_0xcd4d5['interaction']['id']){try{var _0x31aea7=getId(_0xcd4d5['channel'],_0xcd4d5[_0x0543('0x16')]?_0xcd4d5[_0x0543('0x16')]['id']:0x0,_0xcd4d5[_0x0543('0x17')]?_0xcd4d5['interaction']['id']:0x0);if(_0x552980[_0x0543('0x14')][_0x31aea7]){_0x552980[_0x0543('0x14')][_0x31aea7][_0x0543('0x41')](_0x0543('0x42'));}return _0x51df8d({'code':0xc8,'message':_0xcd4d5});}catch(_0x313937){logger[_0x0543('0x36')](_0x313937[_0x0543('0x3b')]);return _0x190e43(_0x38d66f[_0x0543('0x36')](0x1f4,_0x313937));}}logger[_0x0543('0x36')](_0x0543('0x47'));return _0x190e43(_0x38d66f[_0x0543('0x36')](0x1f4,_0x0543('0x47')));});},'AgentCapacity':function(_0x378566){var _0x21504b=this;return new Promise(function(_0x2fc5f4,_0x48cb2c){if(_0x552980['agents'][_0x0543('0x48')](_0x378566['id'])){for(var _0x685f15 in _0x378566[_0x0543('0x49')]){if(_0x378566[_0x0543('0x49')][_0x0543('0x48')](_0x685f15)){if(_0x552980[_0x0543('0x3e')][_0x378566['id']][_0x0543('0x48')](_0x685f15+_0x0543('0x4a'))){_0x552980[_0x0543('0x3e')][_0x378566['id']][_0x685f15+'CurrentCapacity']=parseInt(_0x378566[_0x0543('0x49')][_0x685f15],0xa);}}}_0x552980[_0x0543('0x3e')][_0x378566['id']][_0x0543('0x4b')]();return _0x2fc5f4({'code':0xc8,'message':_0x552980[_0x0543('0x3e')][_0x378566['id']]});}else{return _0x48cb2c(_0x21504b['error'](0x1f4,_0x0543('0x4c')));}});},'Agents':function(_0x1cbb25){return new Promise(function(_0x1bd8d3){var _0x5f08ce=_['values'](_0x552980[_0x0543('0x3e')]);if(_0x1cbb25&&_0x1cbb25['id']){var _0x280fbd=_[_0x0543('0x4d')](_0x5f08ce,function(_0x5311b7){return _0x5311b7['id']===_0x1cbb25['id'];});_0x1bd8d3(_0x280fbd);}else{_0x1bd8d3({'count':_0x5f08ce[_0x0543('0x1a')],'rows':_0x5f08ce});}});},'ChatQueues':function(){return new Promise(function(_0x1dfdd7){var _0x29b72c=[];for(var _0x537b72 in _0x552980[_0x0543('0x4e')]){if(_0x552980[_0x0543('0x4e')][_0x0543('0x48')](_0x537b72)){var _0x183b8f=_0x552980[_0x0543('0x4e')][_0x537b72];var _0x1e694e={'id':_0x183b8f['id'],'available':_0x183b8f[_0x0543('0x4f')],'loggedIn':_0x183b8f[_0x0543('0x50')],'name':_0x183b8f[_0x0543('0x51')],'paused':_0x183b8f[_0x0543('0x52')],'waiting':_0x183b8f[_0x0543('0x53')]};_0x29b72c[_0x0543('0x21')](_0x1e694e);}}_0x1dfdd7({'count':_0x29b72c[_0x0543('0x1a')],'rows':_0x29b72c});});},'MailQueues':function(){return new Promise(function(_0x2b16ef){var _0x4fe411=[];for(var _0x50abbb in _0x552980[_0x0543('0x54')]){if(_0x552980[_0x0543('0x54')][_0x0543('0x48')](_0x50abbb)){var _0x2ee541=_0x552980['mailQueues'][_0x50abbb];var _0xcf969f={'id':_0x2ee541['id'],'available':_0x2ee541['available'],'loggedIn':_0x2ee541[_0x0543('0x50')],'name':_0x2ee541[_0x0543('0x51')],'paused':_0x2ee541[_0x0543('0x52')],'waiting':_0x2ee541['waiting']};_0x4fe411['push'](_0xcf969f);}}_0x2b16ef({'count':_0x4fe411[_0x0543('0x1a')],'rows':_0x4fe411});});},'OpenchannelQueues':function(){return new Promise(function(_0x537b7d){var _0x4a10e8=[];for(var _0x30ee35 in _0x552980[_0x0543('0x55')]){if(_0x552980[_0x0543('0x55')][_0x0543('0x48')](_0x30ee35)){var _0x338c62=_0x552980[_0x0543('0x55')][_0x30ee35];var _0x90fd4a={'id':_0x338c62['id'],'available':_0x338c62[_0x0543('0x4f')],'loggedIn':_0x338c62[_0x0543('0x50')],'name':_0x338c62['name'],'paused':_0x338c62[_0x0543('0x52')],'waiting':_0x338c62[_0x0543('0x53')]};_0x4a10e8[_0x0543('0x21')](_0x90fd4a);}}_0x537b7d({'count':_0x4a10e8[_0x0543('0x1a')],'rows':_0x4a10e8});});},'SmsQueues':function(){return new Promise(function(_0x3d918d){var _0x53f0f3=[];for(var _0x3feaba in _0x552980['smsQueues']){if(_0x552980[_0x0543('0x56')][_0x0543('0x48')](_0x3feaba)){var _0x2b33fd=_0x552980[_0x0543('0x56')][_0x3feaba];var _0x5b4d15={'id':_0x2b33fd['id'],'available':_0x2b33fd[_0x0543('0x4f')],'loggedIn':_0x2b33fd[_0x0543('0x50')],'name':_0x2b33fd[_0x0543('0x51')],'paused':_0x2b33fd['paused'],'waiting':_0x2b33fd[_0x0543('0x53')]};_0x53f0f3['push'](_0x5b4d15);}}_0x3d918d({'count':_0x53f0f3[_0x0543('0x1a')],'rows':_0x53f0f3});});},'FaxQueues':function(){return new Promise(function(_0x3f8fb5){var _0x174dae=[];for(var _0x916a51 in _0x552980[_0x0543('0x57')]){if(_0x552980[_0x0543('0x57')]['hasOwnProperty'](_0x916a51)){var _0x59f214=_0x552980['faxQueues'][_0x916a51];var _0x387334={'id':_0x59f214['id'],'available':_0x59f214[_0x0543('0x4f')],'loggedIn':_0x59f214[_0x0543('0x50')],'name':_0x59f214[_0x0543('0x51')],'paused':_0x59f214[_0x0543('0x52')],'waiting':_0x59f214[_0x0543('0x53')]};_0x174dae[_0x0543('0x21')](_0x387334);}}_0x3f8fb5({'count':_0x174dae[_0x0543('0x1a')],'rows':_0x174dae});});},'WhatsappQueues':function(){return new Promise(function(_0x47ae34){var _0x530b87=[];for(var _0x30390b in _0x552980[_0x0543('0x58')]){if(_0x552980['whatsappQueues'][_0x0543('0x48')](_0x30390b)){var _0x5f5d72=_0x552980[_0x0543('0x58')][_0x30390b];var _0x130901={'id':_0x5f5d72['id'],'available':_0x5f5d72[_0x0543('0x4f')],'loggedIn':_0x5f5d72[_0x0543('0x50')],'name':_0x5f5d72[_0x0543('0x51')],'paused':_0x5f5d72['paused'],'waiting':_0x5f5d72[_0x0543('0x53')]};_0x530b87[_0x0543('0x21')](_0x130901);}}_0x47ae34({'count':_0x530b87['length'],'rows':_0x530b87});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x30992a){var _0x3520e8=_[_0x0543('0x59')](_0x552980['chatQueuesWaitingInteractions']);_0x30992a({'count':_0x3520e8[_0x0543('0x1a')],'rows':_0x3520e8});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x328825){var _0x44d480=_['values'](_0x552980[_0x0543('0x5a')]);_0x328825({'count':_0x44d480[_0x0543('0x1a')],'rows':_0x44d480});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x339b0b){var _0x2e96ce=_['values'](_0x552980[_0x0543('0x5b')]);_0x339b0b({'count':_0x2e96ce[_0x0543('0x1a')],'rows':_0x2e96ce});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xdf249b){var _0x53d3ab=_[_0x0543('0x59')](_0x552980[_0x0543('0x5c')]);_0xdf249b({'count':_0x53d3ab[_0x0543('0x1a')],'rows':_0x53d3ab});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x11bdee){var _0x420b02=_[_0x0543('0x59')](_0x552980[_0x0543('0x5d')]);_0x11bdee({'count':_0x420b02[_0x0543('0x1a')],'rows':_0x420b02});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x18a84d){var _0x20df70=_[_0x0543('0x59')](_0x552980[_0x0543('0x5e')]);_0x18a84d({'count':_0x20df70[_0x0543('0x1a')],'rows':_0x20df70});});}};var _0x59c2af=jayson[_0x0543('0x5f')](_0x4c4763)[_0x0543('0x60')]();_0x59c2af['on'](_0x0543('0x36'),function(_0x41e88a){logger[_0x0543('0x36')](JSON[_0x0543('0x61')](_0x41e88a));return _0x4d2a27(_0x41e88a);});_0x59c2af[_0x0543('0x13')](0x232c,_0x0543('0x62'),function(){console[_0x0543('0x63')](_0x0543('0x64'),0x232c);return _0x21e9ac(_0x0543('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 48b2c7a..49f7101 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 _0x7a6e=['../../../utils/iftime','iftime','../../../config/logger','routing','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','some','info','join','\x20|\x20','lodash'];(function(_0x172660,_0x260d9b){var _0x83204f=function(_0x4d6c80){while(--_0x4d6c80){_0x172660['push'](_0x172660['shift']());}};_0x83204f(++_0x260d9b);}(_0x7a6e,0xfb));var _0xe7a6=function(_0x3d71ba,_0x49a38b){_0x3d71ba=_0x3d71ba-0x0;var _0x5e0ed0=_0x7a6e[_0x3d71ba];return _0x5e0ed0;};'use strict';var _=require(_0xe7a6('0x0'));var iftime=require(_0xe7a6('0x1'))[_0xe7a6('0x2')];var logger=require(_0xe7a6('0x3'))(_0xe7a6('0x4'));exports['condition']=function(_0x594e84,_0x49a3a0,_0x51cf5c){return function(_0x5285c1){if(_0x51cf5c[_0xe7a6('0x5')]&&!_0x51cf5c['rules'][_0x594e84]){logger['info'](_0xe7a6('0x6'),_0x594e84);return _0x5285c1[_0xe7a6('0x7')]();}var _0x209e62=_0x49a3a0['map'](function(_0x1a0893){return iftime(_0x1a0893);});var _0x48d0d4=_[_0xe7a6('0x8')](_0x209e62);if(_0x48d0d4){logger[_0xe7a6('0x9')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x594e84,_0x49a3a0[_0xe7a6('0xa')](_0xe7a6('0xb')),_0x48d0d4);_0x5285c1['when'](_0x48d0d4);}else{logger[_0xe7a6('0x9')]('[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s',_0x594e84,_0x49a3a0[_0xe7a6('0xa')](_0xe7a6('0xb')));_0x5285c1['stop']();}};}; \ No newline at end of file +var _0x0cef=['[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20'];(function(_0x4e08c2,_0x4e1e0e){var _0x16e612=function(_0x3d1a9e){while(--_0x3d1a9e){_0x4e08c2['push'](_0x4e08c2['shift']());}};_0x16e612(++_0x4e1e0e);}(_0x0cef,0x15f));var _0xf0ce=function(_0x5168e3,_0x4b9c51){_0x5168e3=_0x5168e3-0x0;var _0x3112c3=_0x0cef[_0x5168e3];return _0x3112c3;};'use strict';var _=require(_0xf0ce('0x0'));var iftime=require(_0xf0ce('0x1'))[_0xf0ce('0x2')];var logger=require(_0xf0ce('0x3'))(_0xf0ce('0x4'));exports[_0xf0ce('0x5')]=function(_0x517235,_0x24d23c,_0xd78d04){return function(_0x37346d){if(_0xd78d04['rules']&&!_0xd78d04['rules'][_0x517235]){logger[_0xf0ce('0x6')](_0xf0ce('0x7'),_0x517235);return _0x37346d[_0xf0ce('0x8')]();}var _0x1e7f1=_0x24d23c[_0xf0ce('0x9')](function(_0xf1d1ed){return iftime(_0xf1d1ed);});var _0x478f91=_['some'](_0x1e7f1);if(_0x478f91){logger[_0xf0ce('0x6')](_0xf0ce('0xa'),_0x517235,_0x24d23c[_0xf0ce('0xb')](_0xf0ce('0xc')),_0x478f91);_0x37346d['when'](_0x478f91);}else{logger[_0xf0ce('0x6')](_0xf0ce('0xd'),_0x517235,_0x24d23c['join'](_0xf0ce('0xc')));_0x37346d[_0xf0ce('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 0632968..841903f 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 _0x6b20=['includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','transferexten','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','error','queuecallerabandon','forIn'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6b20,0xd1));var _0x06b2=function(_0x35e57c,_0x38857b){_0x35e57c=_0x35e57c-0x0;var _0x4f83d2=_0x6b20[_0x35e57c];return _0x4f83d2;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x2d5e24,_0x54947c){utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x4'),_0x2d5e24['uniqueid'],_0x2d5e24[_0x06b2('0x5')],_0x2d5e24[_0x06b2('0x6')],_0x2d5e24[_0x06b2('0x7')],_0x2d5e24[_0x06b2('0x8')],_0x2d5e24[_0x06b2('0x9')],_0x2d5e24[_0x06b2('0xa')],_0x2d5e24[_0x06b2('0xb')]));if(_0x2d5e24['queue']){utils[_0x06b2('0xc')](_0x2d5e24[_0x06b2('0x6')])[_0x06b2('0xd')](function(_0x58538a){if(_0x58538a){_0x2d5e24[_0x06b2('0xe')]=_0x58538a['type'];_0x2d5e24[_0x06b2('0xf')]=_0x2d5e24['agentcomplete']?_0x58538a['acw']:![];_0x2d5e24[_0x06b2('0x10')]=_0x2d5e24[_0x06b2('0xf')]?_0x58538a['acwTimeout']:0x0;}utils[_0x06b2('0x11')](_0x06b2('0x12'),_0x2d5e24);});}else{utils[_0x06b2('0x11')](_0x06b2('0x12'),_0x2d5e24);}if(_0x54947c){delete transfers[_0x2d5e24[_0x06b2('0x13')]];}else{delete agents[_0x2d5e24[_0x06b2('0x14')]];}}exports[_0x06b2('0x15')]=function(_0x926bf6){try{utils[_0x06b2('0x16')](util[_0x06b2('0x3')](_0x06b2('0x17'),_0x926bf6[_0x06b2('0x13')]),_0x926bf6);agents[_0x926bf6[_0x06b2('0x14')]]=_0x926bf6;agents[_0x926bf6['destuniqueid']][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x1a');agents[_0x926bf6[_0x06b2('0x14')]]['connectedlinenum']=null;agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0x1b')]=null;utils['info'](util[_0x06b2('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x926bf6['uniqueid'],agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0x7')],_0x926bf6[_0x06b2('0x14')]));}catch(_0x2182f3){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x17'),_0x926bf6[_0x06b2('0x13')]),_0x2182f3);}};exports[_0x06b2('0x1c')]=function(_0xe28985){try{if(!_[_0x06b2('0x1d')](agents[_0xe28985[_0x06b2('0x14')]])){utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x1e'),_0xe28985[_0x06b2('0x13')]),_0xe28985);utils[_0x06b2('0x2')](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0xe28985[_0x06b2('0x13')],agents[_0xe28985[_0x06b2('0x14')]]['membername'],_0xe28985[_0x06b2('0x14')]));agents[_0xe28985['destuniqueid']][_0x06b2('0x1c')]=!![];agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x1f')]=utils['now']();agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x20');agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x21')]='timeout';agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x22')]=_0xe28985[_0x06b2('0x23')]?parseInt(_0xe28985[_0x06b2('0x23')])/0x3e8:0x0;agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x24')]=0x0;unanswered['push'](_0xe28985[_0x06b2('0x14')]);}}catch(_0x2a3228){utils[_0x06b2('0x25')](util[_0x06b2('0x3')](_0x06b2('0x1e'),_0xe28985[_0x06b2('0x13')]),_0x2a3228);}};exports[_0x06b2('0x26')]=function(_0x51698b){try{_[_0x06b2('0x27')](agents,function(_0x32eeea,_0x1637c2){if(_0x32eeea[_0x06b2('0x13')]==_0x51698b[_0x06b2('0x13')]&&!_[_0x06b2('0x28')](unanswered,_0x32eeea[_0x06b2('0x14')])){utils[_0x06b2('0x16')](util['format'](_0x06b2('0x29'),_0x51698b[_0x06b2('0x13')]),_0x51698b);utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x2a'),_0x51698b[_0x06b2('0x13')],_0x32eeea[_0x06b2('0x7')],_0x32eeea['destuniqueid']));_0x32eeea['agentringnoanswer']=!![];_0x32eeea[_0x06b2('0x1f')]=utils[_0x06b2('0x19')]();_0x32eeea[_0x06b2('0xb')]='abandoned';_0x32eeea[_0x06b2('0x21')]=_0x06b2('0x2b');_0x32eeea[_0x06b2('0x22')]=_0x51698b[_0x06b2('0x22')];_0x32eeea[_0x06b2('0x24')]=0x0;writeDB(_0x32eeea);}});}catch(_0x27f172){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x29'),_0x51698b[_0x06b2('0x13')]),_0x27f172);}};exports['agentconnect']=function(_0x268780){try{if(agents[_0x268780[_0x06b2('0x14')]]){utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x2c'),_0x268780[_0x06b2('0x13')]),_0x268780);utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x2d'),_0x268780[_0x06b2('0x13')],agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0x7')],_0x268780[_0x06b2('0x14')]));agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0x2e')]=utils['now']();agents[_0x268780[_0x06b2('0x14')]]['connectedlinenum']=_0x268780['connectedlinenum'];agents[_0x268780[_0x06b2('0x14')]]['connectedlinename']=_0x268780[_0x06b2('0x1b')];agents[_0x268780['destuniqueid']][_0x06b2('0x22')]=_0x268780[_0x06b2('0x23')];agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x2f');_['forIn'](agents,function(_0x404eab,_0xee3ec6){if(_0x404eab[_0x06b2('0x14')]!=_0x268780[_0x06b2('0x14')]&&_0x404eab[_0x06b2('0x13')]==_0x268780[_0x06b2('0x13')]){_0x404eab['talktime']=0x0;_0x404eab[_0x06b2('0x22')]=_0x268780[_0x06b2('0x23')];_0x404eab['agentringnoanswer']=!![];_0x404eab['agentringnoanswerAt']=utils[_0x06b2('0x19')]();_0x404eab[_0x06b2('0xb')]=_0x06b2('0x30');_0x404eab[_0x06b2('0x21')]=_0x06b2('0x30');_0x404eab[_0x06b2('0x31')]=_0x268780[_0x06b2('0x14')];_0x404eab[_0x06b2('0x32')]=_0x268780[_0x06b2('0x7')];writeDB(_0x404eab);}});}}catch(_0x117bf4){utils[_0x06b2('0x25')](util[_0x06b2('0x3')](_0x06b2('0x2c'),_0x268780[_0x06b2('0x13')]),_0x117bf4);}};exports[_0x06b2('0x33')]=function(_0x190781){try{if(!_[_0x06b2('0x1d')](agents[_0x190781[_0x06b2('0x14')]])){utils[_0x06b2('0x16')](util['format'](_0x06b2('0x34'),_0x190781[_0x06b2('0x13')]),_0x190781);utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x190781[_0x06b2('0x13')],agents[_0x190781[_0x06b2('0x14')]]['membername'],_0x190781[_0x06b2('0x14')]));agents[_0x190781[_0x06b2('0x14')]]['agentcomplete']=!![];agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x35')]=utils['now']();agents[_0x190781['destuniqueid']]['talktime']=utils[_0x06b2('0x36')](agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x35')],agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x2e')]);agents[_0x190781['destuniqueid']]['reason']=_0x190781[_0x06b2('0x21')];agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x37');writeDB(agents[_0x190781[_0x06b2('0x14')]]);}}catch(_0xc18216){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x34'),_0x190781[_0x06b2('0x13')]),_0xc18216);}};exports[_0x06b2('0x38')]=function(_0x146c5c){try{if(!_[_0x06b2('0x1d')](agents[_0x146c5c['transfereruniqueid']])){utils[_0x06b2('0x16')](util[_0x06b2('0x3')](_0x06b2('0x39'),_0x146c5c[_0x06b2('0x13')]),_0x146c5c);utils['info'](util[_0x06b2('0x3')](_0x06b2('0x3a'),_0x146c5c[_0x06b2('0x13')],agents[_0x146c5c[_0x06b2('0x3b')]]['membername'],agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x13')]));agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x3c')]=!![];agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x3d')]=_0x06b2('0x3e');agents[_0x146c5c[_0x06b2('0x3b')]]['transferexten']=_0x146c5c[_0x06b2('0x3f')];agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x40')]=agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x13')];}}catch(_0x2f75a0){utils['error'](util['format'](_0x06b2('0x39'),_0x146c5c['uniqueid']),_0x2f75a0);}};exports['attendedtransfer']=function(_0x2daf62){try{utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x41'),_0x2daf62[_0x06b2('0x42')]),_0x2daf62);if(_0x2daf62[_0x06b2('0x42')]==_0x2daf62[_0x06b2('0x43')]){if(!_[_0x06b2('0x1d')](agents[_0x2daf62[_0x06b2('0x44')]])){utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x45'),_0x2daf62['origtransfereruniqueid'],agents[_0x2daf62['secondtransfereruniqueid']][_0x06b2('0x7')]));agents[_0x2daf62[_0x06b2('0x44')]]['transfer']=!![];agents[_0x2daf62[_0x06b2('0x44')]][_0x06b2('0x3d')]=_0x06b2('0x46');agents[_0x2daf62[_0x06b2('0x44')]]['transferexten']=_0x2daf62['origtransfererexten'];agents[_0x2daf62['secondtransfereruniqueid']][_0x06b2('0x40')]=_0x2daf62['origtransfereruniqueid'];}if(_0x2daf62['transfereeuniqueid']&&agents[_0x2daf62[_0x06b2('0x47')]]){agents[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x48')]=0x1;transfers[_0x2daf62[_0x06b2('0x47')]]=_[_0x06b2('0x49')](agents[_0x2daf62[_0x06b2('0x47')]]);transfers[_0x2daf62['transfereeuniqueid']][_0x06b2('0x9')]=agents[_0x2daf62[_0x06b2('0x44')]]['calleridnum'];transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x4a')]=agents[_0x2daf62[_0x06b2('0x44')]][_0x06b2('0x4a')];transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x2e')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x22')]=0x0;transfers[_0x2daf62['transfereeuniqueid']][_0x06b2('0x48')]=0x2;}}else if(_0x2daf62[_0x06b2('0x44')]==_0x2daf62['secondtransfererlinkedid']){if(!_[_0x06b2('0x1d')](agents[_0x2daf62[_0x06b2('0x42')]])){utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2daf62[_0x06b2('0x42')],agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x7')]));agents[_0x2daf62['origtransfereruniqueid']][_0x06b2('0x3c')]=!![];agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x3d')]=_0x06b2('0x46');agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x4b')]=_0x2daf62[_0x06b2('0x4c')];agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x40')]=_0x2daf62['secondtransfereruniqueid'];}if(_0x2daf62['transfertargetuniqueid']&&agents[_0x2daf62['transfertargetuniqueid']]){agents[_0x2daf62['transfertargetuniqueid']][_0x06b2('0x48')]=0x1;transfers[_0x2daf62['transfertargetuniqueid']]=_[_0x06b2('0x49')](agents[_0x2daf62[_0x06b2('0x4d')]]);transfers[_0x2daf62[_0x06b2('0x4d')]][_0x06b2('0x9')]=agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x9')];transfers[_0x2daf62['transfertargetuniqueid']]['calleridname']=agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x4a')];transfers[_0x2daf62['transfertargetuniqueid']][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x4d')]][_0x06b2('0x2e')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x4d')]]['holdtime']=0x0;transfers[_0x2daf62[_0x06b2('0x4d')]]['agententerreason']=0x2;}}}catch(_0x4023b0){utils[_0x06b2('0x25')](util[_0x06b2('0x3')]('[%s][agents][attendedtransfer]',_0x2daf62[_0x06b2('0x42')]),_0x4023b0);}};exports[_0x06b2('0x4e')]=function(_0x461c4d){try{utils['debug'](util[_0x06b2('0x3')]('[%s][agents][hangup]',_0x461c4d[_0x06b2('0x13')]),_0x461c4d);if(agents[_0x461c4d[_0x06b2('0x13')]]&&agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]===_0x06b2('0x20')){if(_0x461c4d[_0x06b2('0x4f')]==='21'){agents[_0x461c4d['uniqueid']][_0x06b2('0x21')]=_0x06b2('0x50');agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]='rejected';}utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x51'),_0x461c4d['uniqueid'],agents[_0x461c4d['uniqueid']][_0x06b2('0x7')],agents[_0x461c4d['uniqueid']][_0x06b2('0x21')],agents[_0x461c4d['uniqueid']]['lastevent']));writeDB(agents[_0x461c4d[_0x06b2('0x13')]]);var _0x38647d=unanswered['indexOf'](_0x461c4d[_0x06b2('0x13')]);if(_0x38647d>-0x1){unanswered[_0x06b2('0x52')](_0x38647d,0x1);}}if(transfers[_0x461c4d[_0x06b2('0x13')]]){transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x33')]=!![];transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x35')]=utils[_0x06b2('0x19')]();transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x24')]=utils[_0x06b2('0x36')](transfers[_0x461c4d['uniqueid']][_0x06b2('0x35')],transfers[_0x461c4d['uniqueid']]['agentconnectAt']);transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]='agent';transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]=_0x06b2('0x37');utils['info'](util[_0x06b2('0x3')](_0x06b2('0x51'),_0x461c4d['uniqueid'],transfers[_0x461c4d['uniqueid']]['membername'],transfers[_0x461c4d['uniqueid']][_0x06b2('0x21')],transfers[_0x461c4d['uniqueid']][_0x06b2('0xb')]));writeDB(transfers[_0x461c4d[_0x06b2('0x13')]],!![]);}if(agents[_0x461c4d[_0x06b2('0x13')]]&&agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x2e')]){agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x33')]=!![];agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x35')]=utils[_0x06b2('0x19')]();agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x24')]=utils[_0x06b2('0x36')](agents[_0x461c4d['uniqueid']]['agentcompleteAt'],agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x2e')]);agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]=agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x3c')]?'transfer':'agent';agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]=_0x06b2('0x37');utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x461c4d[_0x06b2('0x13')],agents[_0x461c4d['uniqueid']]['membername'],agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')],agents[_0x461c4d['uniqueid']]['lastevent']));writeDB(agents[_0x461c4d[_0x06b2('0x13')]]);}}catch(_0x3fa469){utils['error'](util['format']('[%s][agents][hangup]',_0x461c4d['uniqueid']),_0x3fa469);}}; \ No newline at end of file +var _0xae60=['transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','lodash','util','./utils','info','format','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten'];(function(_0x19c808,_0x2f77a5){var _0x58cc66=function(_0x1dd2e0){while(--_0x1dd2e0){_0x19c808['push'](_0x19c808['shift']());}};_0x58cc66(++_0x2f77a5);}(_0xae60,0x1c7));var _0x0ae6=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xae60[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var utils=require(_0x0ae6('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x52d7cd,_0x267ad6){utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x52d7cd[_0x0ae6('0x5')],_0x52d7cd[_0x0ae6('0x6')],_0x52d7cd['queue'],_0x52d7cd[_0x0ae6('0x7')],_0x52d7cd[_0x0ae6('0x8')],_0x52d7cd[_0x0ae6('0x9')],_0x52d7cd[_0x0ae6('0xa')],_0x52d7cd[_0x0ae6('0xb')]));if(_0x52d7cd[_0x0ae6('0xc')]){utils[_0x0ae6('0xd')](_0x52d7cd[_0x0ae6('0xc')])['then'](function(_0x3b3fc3){if(_0x3b3fc3){_0x52d7cd[_0x0ae6('0xe')]=_0x3b3fc3[_0x0ae6('0xe')];_0x52d7cd[_0x0ae6('0xf')]=_0x52d7cd['agentcomplete']?_0x3b3fc3[_0x0ae6('0x10')]:![];_0x52d7cd[_0x0ae6('0x11')]=_0x52d7cd[_0x0ae6('0xf')]?_0x3b3fc3[_0x0ae6('0x12')]:0x0;}utils[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x52d7cd);});}else{utils[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x52d7cd);}if(_0x267ad6){delete transfers[_0x52d7cd[_0x0ae6('0x5')]];}else{delete agents[_0x52d7cd[_0x0ae6('0x15')]];}}exports[_0x0ae6('0x16')]=function(_0xf86cad){try{utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')]('[%s][agents][agentcalled]',_0xf86cad[_0x0ae6('0x5')]),_0xf86cad);agents[_0xf86cad[_0x0ae6('0x15')]]=_0xf86cad;agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0x18')]=utils[_0x0ae6('0x19')]();agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0xb')]=_0x0ae6('0x1a');agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0xa')]=null;agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0x1b')]=null;utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x1c'),_0xf86cad[_0x0ae6('0x5')],agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0x7')],_0xf86cad[_0x0ae6('0x15')]));}catch(_0x9e2c46){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')]('[%s][agents][agentcalled]',_0xf86cad[_0x0ae6('0x5')]),_0x9e2c46);}};exports[_0x0ae6('0x1e')]=function(_0x140a3b){try{if(!_[_0x0ae6('0x1f')](agents[_0x140a3b[_0x0ae6('0x15')]])){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')](_0x0ae6('0x20'),_0x140a3b['uniqueid']),_0x140a3b);utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x21'),_0x140a3b[_0x0ae6('0x5')],agents[_0x140a3b[_0x0ae6('0x15')]]['membername'],_0x140a3b[_0x0ae6('0x15')]));agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x1e')]=!![];agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x22')]=utils[_0x0ae6('0x19')]();agents[_0x140a3b['destuniqueid']][_0x0ae6('0xb')]=_0x0ae6('0x23');agents[_0x140a3b['destuniqueid']]['reason']=_0x0ae6('0x23');agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x24')]=_0x140a3b['ringtime']?parseInt(_0x140a3b[_0x0ae6('0x25')])/0x3e8:0x0;agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x26')]=0x0;unanswered['push'](_0x140a3b[_0x0ae6('0x15')]);}}catch(_0x29fef3){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x20'),_0x140a3b[_0x0ae6('0x5')]),_0x29fef3);}};exports['queuecallerabandon']=function(_0x5b2ad6){try{_[_0x0ae6('0x27')](agents,function(_0x419384,_0x4e6df8){if(_0x419384['uniqueid']==_0x5b2ad6[_0x0ae6('0x5')]&&!_[_0x0ae6('0x28')](unanswered,_0x419384[_0x0ae6('0x15')])){utils[_0x0ae6('0x17')](util['format'](_0x0ae6('0x29'),_0x5b2ad6[_0x0ae6('0x5')]),_0x5b2ad6);utils[_0x0ae6('0x3')](util['format'](_0x0ae6('0x2a'),_0x5b2ad6[_0x0ae6('0x5')],_0x419384[_0x0ae6('0x7')],_0x419384[_0x0ae6('0x15')]));_0x419384[_0x0ae6('0x1e')]=!![];_0x419384[_0x0ae6('0x22')]=utils[_0x0ae6('0x19')]();_0x419384[_0x0ae6('0xb')]=_0x0ae6('0x2b');_0x419384[_0x0ae6('0x2c')]='abandoned';_0x419384[_0x0ae6('0x24')]=_0x5b2ad6[_0x0ae6('0x24')];_0x419384['talktime']=0x0;writeDB(_0x419384);}});}catch(_0x3264d5){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')]('[%s][agents][queuecallerabandon]',_0x5b2ad6[_0x0ae6('0x5')]),_0x3264d5);}};exports['agentconnect']=function(_0x59e388){try{if(agents[_0x59e388[_0x0ae6('0x15')]]){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')](_0x0ae6('0x2d'),_0x59e388[_0x0ae6('0x5')]),_0x59e388);utils['info'](util['format'](_0x0ae6('0x2e'),_0x59e388['uniqueid'],agents[_0x59e388[_0x0ae6('0x15')]]['membername'],_0x59e388[_0x0ae6('0x15')]));agents[_0x59e388['destuniqueid']][_0x0ae6('0x2f')]=utils[_0x0ae6('0x19')]();agents[_0x59e388[_0x0ae6('0x15')]][_0x0ae6('0xa')]=_0x59e388['connectedlinenum'];agents[_0x59e388['destuniqueid']][_0x0ae6('0x1b')]=_0x59e388[_0x0ae6('0x1b')];agents[_0x59e388[_0x0ae6('0x15')]]['holdtime']=_0x59e388[_0x0ae6('0x25')];agents[_0x59e388['destuniqueid']][_0x0ae6('0xb')]=_0x0ae6('0x30');_[_0x0ae6('0x27')](agents,function(_0x19403c,_0x450f00){if(_0x19403c[_0x0ae6('0x15')]!=_0x59e388['destuniqueid']&&_0x19403c[_0x0ae6('0x5')]==_0x59e388[_0x0ae6('0x5')]){_0x19403c[_0x0ae6('0x26')]=0x0;_0x19403c[_0x0ae6('0x24')]=_0x59e388[_0x0ae6('0x25')];_0x19403c[_0x0ae6('0x1e')]=!![];_0x19403c[_0x0ae6('0x22')]=utils[_0x0ae6('0x19')]();_0x19403c['lastevent']=_0x0ae6('0x31');_0x19403c[_0x0ae6('0x2c')]=_0x0ae6('0x31');_0x19403c[_0x0ae6('0x32')]=_0x59e388[_0x0ae6('0x15')];_0x19403c[_0x0ae6('0x33')]=_0x59e388[_0x0ae6('0x7')];writeDB(_0x19403c);}});}}catch(_0x21431e){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x2d'),_0x59e388[_0x0ae6('0x5')]),_0x21431e);}};exports[_0x0ae6('0x34')]=function(_0x85d9ce){try{if(!_[_0x0ae6('0x1f')](agents[_0x85d9ce[_0x0ae6('0x15')]])){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')]('[%s][agents][agentcomplete]',_0x85d9ce[_0x0ae6('0x5')]),_0x85d9ce);utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x35'),_0x85d9ce[_0x0ae6('0x5')],agents[_0x85d9ce[_0x0ae6('0x15')]]['membername'],_0x85d9ce[_0x0ae6('0x15')]));agents[_0x85d9ce[_0x0ae6('0x15')]][_0x0ae6('0x34')]=!![];agents[_0x85d9ce[_0x0ae6('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x85d9ce['destuniqueid']][_0x0ae6('0x26')]=utils[_0x0ae6('0x36')](agents[_0x85d9ce[_0x0ae6('0x15')]]['agentcompleteAt'],agents[_0x85d9ce[_0x0ae6('0x15')]][_0x0ae6('0x2f')]);agents[_0x85d9ce['destuniqueid']][_0x0ae6('0x2c')]=_0x85d9ce[_0x0ae6('0x2c')];agents[_0x85d9ce['destuniqueid']][_0x0ae6('0xb')]=_0x0ae6('0x37');writeDB(agents[_0x85d9ce['destuniqueid']]);}}catch(_0x76e561){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')]('[%s][agents][agentcomplete]',_0x85d9ce[_0x0ae6('0x5')]),_0x76e561);}};exports[_0x0ae6('0x38')]=function(_0x46075a){try{if(!_[_0x0ae6('0x1f')](agents[_0x46075a[_0x0ae6('0x39')]])){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')]('[%s][agents][blindtransfer]',_0x46075a['uniqueid']),_0x46075a);utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x3a'),_0x46075a['uniqueid'],agents[_0x46075a[_0x0ae6('0x39')]]['membername'],agents[_0x46075a['transfereruniqueid']][_0x0ae6('0x5')]));agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x3b')]=!![];agents[_0x46075a['transfereruniqueid']][_0x0ae6('0x3c')]=_0x0ae6('0x3d');agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x3e')]=_0x46075a[_0x0ae6('0x3f')];agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x40')]=agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x5')];}}catch(_0x117d24){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x41'),_0x46075a[_0x0ae6('0x5')]),_0x117d24);}};exports[_0x0ae6('0x42')]=function(_0x5c4785){try{utils['debug'](util[_0x0ae6('0x4')](_0x0ae6('0x43'),_0x5c4785[_0x0ae6('0x44')]),_0x5c4785);if(_0x5c4785[_0x0ae6('0x44')]==_0x5c4785[_0x0ae6('0x45')]){if(!_[_0x0ae6('0x1f')](agents[_0x5c4785[_0x0ae6('0x46')]])){utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x47'),_0x5c4785[_0x0ae6('0x44')],agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x7')]));agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x3b')]=!![];agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x3c')]=_0x0ae6('0x48');agents[_0x5c4785['secondtransfereruniqueid']][_0x0ae6('0x3e')]=_0x5c4785[_0x0ae6('0x49')];agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x40')]=_0x5c4785[_0x0ae6('0x44')];}if(_0x5c4785[_0x0ae6('0x4a')]&&agents[_0x5c4785[_0x0ae6('0x4a')]]){agents[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x4b')]=0x1;transfers[_0x5c4785[_0x0ae6('0x4a')]]=_['clone'](agents[_0x5c4785[_0x0ae6('0x4a')]]);transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x9')]=agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x9')];transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x4c')]=agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x4c')];transfers[_0x5c4785['transfereeuniqueid']]['agentcalledAt']=utils[_0x0ae6('0x19')]();transfers[_0x5c4785[_0x0ae6('0x4a')]]['agentconnectAt']=utils['now']();transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x24')]=0x0;transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x4b')]=0x2;}}else if(_0x5c4785[_0x0ae6('0x46')]==_0x5c4785[_0x0ae6('0x4d')]){if(!_[_0x0ae6('0x1f')](agents[_0x5c4785['origtransfereruniqueid']])){utils[_0x0ae6('0x3')](util['format'](_0x0ae6('0x47'),_0x5c4785[_0x0ae6('0x44')],agents[_0x5c4785['origtransfereruniqueid']][_0x0ae6('0x7')]));agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x3b')]=!![];agents[_0x5c4785['origtransfereruniqueid']][_0x0ae6('0x3c')]='ATTENDED';agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x3e')]=_0x5c4785[_0x0ae6('0x4e')];agents[_0x5c4785[_0x0ae6('0x44')]]['transferuniqueid']=_0x5c4785['secondtransfereruniqueid'];}if(_0x5c4785[_0x0ae6('0x4f')]&&agents[_0x5c4785[_0x0ae6('0x4f')]]){agents[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x4b')]=0x1;transfers[_0x5c4785[_0x0ae6('0x4f')]]=_[_0x0ae6('0x50')](agents[_0x5c4785['transfertargetuniqueid']]);transfers[_0x5c4785['transfertargetuniqueid']][_0x0ae6('0x9')]=agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x9')];transfers[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x4c')]=agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x4c')];transfers[_0x5c4785[_0x0ae6('0x4f')]]['agentcalledAt']=utils[_0x0ae6('0x19')]();transfers[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x2f')]=utils[_0x0ae6('0x19')]();transfers[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x24')]=0x0;transfers[_0x5c4785['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x35068d){utils[_0x0ae6('0x1d')](util['format'](_0x0ae6('0x43'),_0x5c4785[_0x0ae6('0x44')]),_0x35068d);}};exports[_0x0ae6('0x51')]=function(_0x37ad9b){try{utils['debug'](util[_0x0ae6('0x4')](_0x0ae6('0x52'),_0x37ad9b[_0x0ae6('0x5')]),_0x37ad9b);if(agents[_0x37ad9b[_0x0ae6('0x5')]]&&agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')]===_0x0ae6('0x23')){if(_0x37ad9b[_0x0ae6('0x53')]==='21'){agents[_0x37ad9b['uniqueid']][_0x0ae6('0x2c')]=_0x0ae6('0x54');agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]=_0x0ae6('0x54');}utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x55'),_0x37ad9b[_0x0ae6('0x5')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x7')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]));writeDB(agents[_0x37ad9b[_0x0ae6('0x5')]]);var _0x346d19=unanswered[_0x0ae6('0x56')](_0x37ad9b[_0x0ae6('0x5')]);if(_0x346d19>-0x1){unanswered[_0x0ae6('0x57')](_0x346d19,0x1);}}if(transfers[_0x37ad9b[_0x0ae6('0x5')]]){transfers[_0x37ad9b['uniqueid']][_0x0ae6('0x34')]=!![];transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x58')]=utils[_0x0ae6('0x19')]();transfers[_0x37ad9b['uniqueid']][_0x0ae6('0x26')]=utils[_0x0ae6('0x36')](transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x58')],transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2f')]);transfers[_0x37ad9b['uniqueid']][_0x0ae6('0x2c')]='agent';transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]=_0x0ae6('0x37');utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x55'),_0x37ad9b[_0x0ae6('0x5')],transfers[_0x37ad9b['uniqueid']]['membername'],transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')],transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]));writeDB(transfers[_0x37ad9b['uniqueid']],!![]);}if(agents[_0x37ad9b[_0x0ae6('0x5')]]&&agents[_0x37ad9b[_0x0ae6('0x5')]]['agentconnectAt']){agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x34')]=!![];agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x58')]=utils[_0x0ae6('0x19')]();agents[_0x37ad9b[_0x0ae6('0x5')]]['talktime']=utils['diffTime'](agents[_0x37ad9b['uniqueid']][_0x0ae6('0x58')],agents[_0x37ad9b['uniqueid']]['agentconnectAt']);agents[_0x37ad9b['uniqueid']]['reason']=agents[_0x37ad9b[_0x0ae6('0x5')]]['transfer']?_0x0ae6('0x3b'):'agent';agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]=_0x0ae6('0x37');utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x37ad9b[_0x0ae6('0x5')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x7')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]));writeDB(agents[_0x37ad9b['uniqueid']]);}}catch(_0x435707){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x52'),_0x37ad9b[_0x0ae6('0x5')]),_0x435707);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 9083115..b1d0665 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 _0x3ae8=['destinationchannel','answertime','disposition','hangup','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','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','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','lastapplication','[%s][calls][newexten]','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer'];(function(_0x29fa91,_0x13eea2){var _0x4b21b7=function(_0xa04a84){while(--_0xa04a84){_0x29fa91['push'](_0x29fa91['shift']());}};_0x4b21b7(++_0x13eea2);}(_0x3ae8,0x1de));var _0x83ae=function(_0x3ff0d9,_0x2811d8){_0x3ff0d9=_0x3ff0d9-0x0;var _0x3b91b1=_0x3ae8[_0x3ff0d9];return _0x3b91b1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x83ae('0x0'));var dispositions=[_0x83ae('0x1'),_0x83ae('0x2'),_0x83ae('0x2'),_0x83ae('0x1'),_0x83ae('0x1'),_0x83ae('0x1'),_0x83ae('0x3'),_0x83ae('0x4'),'FAILED','FAILED',_0x83ae('0x2')];var channels={};function writeDB(_0x492768){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x7'),_0x492768['uniqueid'],_0x492768[_0x83ae('0x8')],_0x492768[_0x83ae('0x9')],_0x492768['membername'],_0x492768[_0x83ae('0xa')],_0x492768['calleridnum'],_0x492768['connectedlinenum'],_0x492768['lastevent']));if(_0x492768[_0x83ae('0xb')]){utils[_0x83ae('0xc')](_0x492768[_0x83ae('0xb')])[_0x83ae('0xd')](function(_0x418358){if(_0x418358){_0x492768[_0x83ae('0xe')]=_0x418358['id'];}utils[_0x83ae('0xf')](_0x83ae('0x10'),_0x492768);});}else{utils[_0x83ae('0xf')](_0x83ae('0x10'),_0x492768);}if(channels[_0x492768[_0x83ae('0x11')]]){delete channels[_0x492768[_0x83ae('0x11')]];}}exports[_0x83ae('0x12')]=function(_0x27de10){try{utils[_0x83ae('0x13')](util[_0x83ae('0x6')]('[%s][calls][newchannel]',_0x27de10[_0x83ae('0x11')]),_0x27de10);if(_0x27de10['uniqueid']==_0x27de10[_0x83ae('0x14')]&&_0x27de10['channel']!=_0x83ae('0x15')){utils[_0x83ae('0x5')](util['format'](_0x83ae('0x16'),_0x27de10[_0x83ae('0x11')],_0x27de10[_0x83ae('0x17')],_0x27de10[_0x83ae('0x18')]));channels[_0x27de10[_0x83ae('0x11')]]={'uniqueid':_0x27de10[_0x83ae('0x11')],'accountcode':_0x27de10['accountcode'],'source':_0x27de10[_0x83ae('0x19')],'destination':_0x27de10[_0x83ae('0x18')],'destinationcontext':_0x27de10['context'],'channel':_0x27de10[_0x83ae('0x8')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x83ae('0x1'),'amaflags':_0x83ae('0x1a')};}}catch(_0x17ed5a){utils[_0x83ae('0x1b')](util[_0x83ae('0x6')](_0x83ae('0x1c'),_0x27de10[_0x83ae('0x11')]),_0x17ed5a);}};exports[_0x83ae('0x1d')]=function(_0x456346){try{utils[_0x83ae('0x13')](util[_0x83ae('0x6')](_0x83ae('0x1e'),_0x456346[_0x83ae('0x11')]),_0x456346);if(!_[_0x83ae('0x1f')](channels[_0x456346[_0x83ae('0x11')]])&&_0x456346[_0x83ae('0x20')]==0x6){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x21'),_0x456346[_0x83ae('0x11')],_0x456346[_0x83ae('0x17')],_0x456346[_0x83ae('0x8')]));if(_[_0x83ae('0x1f')](channels[_0x456346[_0x83ae('0x11')]][_0x83ae('0x22')])){channels[_0x456346['uniqueid']][_0x83ae('0x22')]=utils[_0x83ae('0x23')]();}}else if(!_[_0x83ae('0x1f')](channels[_0x456346['linkedid']])&&_0x456346[_0x83ae('0x20')]==0x6&&_0x456346[_0x83ae('0x17')]!=_0x83ae('0x24')){utils[_0x83ae('0x5')](util[_0x83ae('0x6')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x456346[_0x83ae('0x11')],_0x456346[_0x83ae('0x14')],_0x456346[_0x83ae('0x17')],_0x456346[_0x83ae('0x8')]));channels[_0x456346[_0x83ae('0x14')]][_0x83ae('0xb')]=_0x456346[_0x83ae('0xb')];channels[_0x456346[_0x83ae('0x14')]][_0x83ae('0x25')]=_0x456346[_0x83ae('0x8')];if(_[_0x83ae('0x1f')](channels[_0x456346['linkedid']][_0x83ae('0x26')])){channels[_0x456346['linkedid']][_0x83ae('0x26')]=utils[_0x83ae('0x23')]();}channels[_0x456346[_0x83ae('0x14')]][_0x83ae('0x27')]=dispositions[_['toNumber'](_0x456346[_0x83ae('0x20')])]||_0x83ae('0x3');}}catch(_0x5e598b){utils[_0x83ae('0x1b')](util['format'](_0x83ae('0x1e'),_0x456346[_0x83ae('0x11')]),_0x5e598b);}};exports[_0x83ae('0x28')]=function(_0x575a36){try{if(!_[_0x83ae('0x1f')](channels[_0x575a36['uniqueid']])){utils[_0x83ae('0x13')](util['format']('[%s][calls][hangup]',_0x575a36[_0x83ae('0x11')]),_0x575a36);if(_['isNil'](channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x29')])){channels[_0x575a36[_0x83ae('0x11')]]['callerid']=_0x575a36['calleridname']+'\x20<'+_0x575a36[_0x83ae('0x19')]+'>';}utils[_0x83ae('0x5')](util[_0x83ae('0x6')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x575a36[_0x83ae('0x11')],channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x29')],_0x575a36[_0x83ae('0x2a')]));channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x2b')]=utils[_0x83ae('0x23')]();channels[_0x575a36['uniqueid']][_0x83ae('0x2c')]=utils[_0x83ae('0x2d')](channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x2b')],channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x2e')]);channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x2f')]=channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x26')]?utils[_0x83ae('0x2d')](channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x2b')],channels[_0x575a36[_0x83ae('0x11')]][_0x83ae('0x26')]):0x0;writeDB(channels[_0x575a36[_0x83ae('0x11')]]);}}catch(_0x3fc3a){utils[_0x83ae('0x1b')](util['format'](_0x83ae('0x30'),_0x575a36[_0x83ae('0x11')]),_0x3fc3a);}};exports[_0x83ae('0x31')]=function(_0x520c58){try{if(!_[_0x83ae('0x1f')](channels[_0x520c58[_0x83ae('0x32')]])){utils[_0x83ae('0x13')](util[_0x83ae('0x6')](_0x83ae('0x33'),_0x520c58[_0x83ae('0x34')]),_0x520c58);if(channels[_0x520c58['localtwolinkedid']][_0x83ae('0x8')]==_0x520c58[_0x83ae('0x35')]){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x36'),_0x520c58[_0x83ae('0x34')],_0x520c58[_0x83ae('0x32')],_0x520c58['secondtransfererchannel']));channels[_0x520c58[_0x83ae('0x32')]][_0x83ae('0x25')]=_0x520c58[_0x83ae('0x37')];channels[_0x520c58['localtwolinkedid']][_0x83ae('0x38')]='_attended';}else if(channels[_0x520c58[_0x83ae('0x32')]][_0x83ae('0x8')]=_0x520c58['transfertargetchannel']){utils[_0x83ae('0x5')](util[_0x83ae('0x6')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x520c58[_0x83ae('0x34')],_0x520c58['localtwolinkedid'],_0x520c58[_0x83ae('0x39')]));channels[_0x520c58[_0x83ae('0x32')]][_0x83ae('0x25')]=_0x520c58[_0x83ae('0x39')];channels[_0x520c58['localtwolinkedid']][_0x83ae('0x38')]='_attended';}}}catch(_0xfb84d0){utils[_0x83ae('0x1b')](util['format'](_0x83ae('0x33'),_0x520c58[_0x83ae('0x34')]),_0xfb84d0);}};exports[_0x83ae('0x3a')]=function(_0x3407e8){try{if(!_[_0x83ae('0x1f')](channels[_0x3407e8['uniqueid']])){utils['debug'](util[_0x83ae('0x6')]('[%s][calls][musiconholdstart]',_0x3407e8[_0x83ae('0x11')]),_0x3407e8);channels[_0x3407e8[_0x83ae('0x11')]]['musiconholdstartAt']=utils[_0x83ae('0x23')]();utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x3b'),_0x3407e8[_0x83ae('0x11')],channels[_0x3407e8[_0x83ae('0x11')]]['musiconholdstartAt']));}}catch(_0x49829c){utils['error'](util[_0x83ae('0x6')]('[%s][calls][musiconholdstart]',_0x3407e8[_0x83ae('0x11')]),_0x49829c);}};exports[_0x83ae('0x3c')]=function(_0xf04848){try{if(!_[_0x83ae('0x1f')](channels[_0xf04848[_0x83ae('0x11')]])){utils[_0x83ae('0x13')](util['format']('[%s][calls][musiconholdstop]',_0xf04848[_0x83ae('0x11')]),_0xf04848);if(!_[_0x83ae('0x1f')](channels[_0xf04848[_0x83ae('0x11')]][_0x83ae('0x3d')])){channels[_0xf04848['uniqueid']][_0x83ae('0x3e')]+=utils[_0x83ae('0x2d')](utils[_0x83ae('0x23')](),channels[_0xf04848['uniqueid']]['musiconholdstartAt']);utils[_0x83ae('0x5')](util['format'](_0x83ae('0x3f'),_0xf04848[_0x83ae('0x11')],channels[_0xf04848[_0x83ae('0x11')]]['mohtime']));delete channels[_0xf04848[_0x83ae('0x11')]][_0x83ae('0x3d')];}}}catch(_0x4aa9c2){utils[_0x83ae('0x1b')](util['format'](_0x83ae('0x40'),_0xf04848[_0x83ae('0x11')]),_0x4aa9c2);}};exports[_0x83ae('0x41')]=function(_0x2f3608){try{if(!_[_0x83ae('0x1f')](channels[_0x2f3608['uniqueid']])){utils[_0x83ae('0x13')](util[_0x83ae('0x6')](_0x83ae('0x42'),_0x2f3608[_0x83ae('0x11')]),_0x2f3608);if(!_[_0x83ae('0x1f')](_0x2f3608[_0x83ae('0x43')][_0x83ae('0x44')])){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x45'),_0x2f3608[_0x83ae('0x11')],_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608[_0x83ae('0x11')]][_0x83ae('0x47')]=_0x2f3608[_0x83ae('0x46')];}if(!_['isNil'](_0x2f3608[_0x83ae('0x43')][_0x83ae('0x48')])){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x49'),_0x2f3608['uniqueid'],_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608[_0x83ae('0x11')]]['destination']=_0x2f3608['value'];channels[_0x2f3608[_0x83ae('0x11')]]['callerid']='\x22'+_0x2f3608[_0x83ae('0x46')]+'\x22\x20<'+_0x2f3608[_0x83ae('0x46')]+'>';}if(!_[_0x83ae('0x1f')](_0x2f3608[_0x83ae('0x43')][_0x83ae('0x4a')])||!_[_0x83ae('0x1f')](_0x2f3608['variable'][_0x83ae('0x4b')])){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x4c'),_0x2f3608[_0x83ae('0x11')],!_[_0x83ae('0x1f')](_0x2f3608[_0x83ae('0x43')][_0x83ae('0x4a')])?_0x83ae('0x4a'):_0x83ae('0x4b'),_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608[_0x83ae('0x11')]][_0x83ae('0x29')]=_0x2f3608[_0x83ae('0x46')];}if(!_[_0x83ae('0x1f')](_0x2f3608['variable']['xmd-queue'])||!_[_0x83ae('0x1f')](_0x2f3608['variable'][_0x83ae('0x4d')])){utils['info'](util[_0x83ae('0x6')](_0x83ae('0x4c'),_0x2f3608['uniqueid'],!_['isNil'](_0x2f3608[_0x83ae('0x43')]['xmd-queue'])?_0x83ae('0x4e'):_0x83ae('0x4d'),_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608['uniqueid']]['lastapplication']=_0x83ae('0x4f');channels[_0x2f3608[_0x83ae('0x11')]][_0x83ae('0x50')]=_0x2f3608[_0x83ae('0x46')];channels[_0x2f3608[_0x83ae('0x11')]][_0x83ae('0x9')]=!![];}if(!_[_0x83ae('0x1f')](_0x2f3608['variable'][_0x83ae('0x51')])){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x52'),_0x2f3608[_0x83ae('0x11')],_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608[_0x83ae('0x11')]][_0x83ae('0x53')]=_0x2f3608[_0x83ae('0x46')];}if(!_[_0x83ae('0x1f')](_0x2f3608['variable']['xmd-cdrtype'])){utils['info'](util[_0x83ae('0x6')](_0x83ae('0x54'),_0x2f3608['uniqueid'],_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608[_0x83ae('0x11')]][_0x83ae('0x55')]=_0x2f3608['value'];}if(!_[_0x83ae('0x1f')](_0x2f3608[_0x83ae('0x43')][_0x83ae('0x56')])){utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x57'),_0x2f3608[_0x83ae('0x11')],_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608[_0x83ae('0x11')]]['routeid']=_0x2f3608['value'];}if(!_['isNil'](_0x2f3608[_0x83ae('0x43')]['sipcallid'])){utils[_0x83ae('0x5')](util[_0x83ae('0x6')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x2f3608[_0x83ae('0x11')],_0x2f3608[_0x83ae('0x46')]));channels[_0x2f3608[_0x83ae('0x11')]][_0x83ae('0x58')]=_0x2f3608[_0x83ae('0x46')];}}}catch(_0x4c7d23){utils['error'](util[_0x83ae('0x6')]('[%s][calls][varset]',_0x2f3608[_0x83ae('0x11')]),_0x4c7d23);}};exports['newexten']=function(_0xc7cdf5){try{if(!_['isNil'](channels[_0xc7cdf5[_0x83ae('0x11')]])){utils[_0x83ae('0x13')](util[_0x83ae('0x6')]('[%s][calls][newexten]',_0xc7cdf5[_0x83ae('0x11')]),_0xc7cdf5);utils[_0x83ae('0x5')](util[_0x83ae('0x6')](_0x83ae('0x59'),_0xc7cdf5[_0x83ae('0x11')],_0xc7cdf5[_0x83ae('0x5a')],_0xc7cdf5[_0x83ae('0x5b')]));if(_0xc7cdf5[_0x83ae('0x5a')][_0x83ae('0x5c')]()==_0x83ae('0x5d')&&_[_0x83ae('0x5e')](_0xc7cdf5['appdata']['toLowerCase'](),_0x83ae('0x5f'))){var _0x2bd9d5=_0xc7cdf5[_0x83ae('0x5b')][_0x83ae('0x60')]('=');var _0x10289b=_0x2bd9d5[0x0][_0x83ae('0x61')](_0x2bd9d5[0x0][_0x83ae('0x62')]('(')+0x1,_0x2bd9d5[0x0][_0x83ae('0x62')](')'));var _0x5eed83=_0x2bd9d5[0x1];channels[_0xc7cdf5[_0x83ae('0x11')]][_0x10289b]=_0x5eed83;}if(!_[_0x83ae('0x63')]([_0x83ae('0x28'),_0x83ae('0x64'),'execif',_0x83ae('0x5d'),'gotoif'],_0xc7cdf5['application'][_0x83ae('0x5c')]())){channels[_0xc7cdf5[_0x83ae('0x11')]][_0x83ae('0x65')]=_0xc7cdf5[_0x83ae('0x5a')];channels[_0xc7cdf5[_0x83ae('0x11')]]['lastdata']=_0xc7cdf5['appdata'];}}}catch(_0x37a4b6){utils[_0x83ae('0x1b')](util[_0x83ae('0x6')](_0x83ae('0x66'),_0xc7cdf5[_0x83ae('0x11')]),_0x37a4b6);}}; \ No newline at end of file +var _0xbf39=['xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','xmd-callerid-preview','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','substring','lastIndexOf','includes','noop','set','gotoif','[%s][calls][newexten]','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','connectedlinenum','lastevent','getUserByInternal','accountcode','then','request','CreateVoiceCallReport','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','channel','now','error','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','variable'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0xbf39,0x100));var _0x9bf3=function(_0x221e42,_0x763508){_0x221e42=_0x221e42-0x0;var _0x599586=_0xbf39[_0x221e42];return _0x599586;};'use strict';var _=require(_0x9bf3('0x0'));var util=require(_0x9bf3('0x1'));var utils=require('./utils');var dispositions=[_0x9bf3('0x2'),_0x9bf3('0x3'),_0x9bf3('0x3'),_0x9bf3('0x2'),_0x9bf3('0x2'),_0x9bf3('0x2'),_0x9bf3('0x4'),_0x9bf3('0x5'),_0x9bf3('0x3'),_0x9bf3('0x3'),_0x9bf3('0x3')];var channels={};function writeDB(_0x977cbe){utils['info'](util[_0x9bf3('0x6')](_0x9bf3('0x7'),_0x977cbe[_0x9bf3('0x8')],_0x977cbe['channel'],_0x977cbe[_0x9bf3('0x9')],_0x977cbe[_0x9bf3('0xa')],_0x977cbe[_0x9bf3('0xb')],_0x977cbe['calleridnum'],_0x977cbe[_0x9bf3('0xc')],_0x977cbe[_0x9bf3('0xd')]));if(_0x977cbe['accountcode']){utils[_0x9bf3('0xe')](_0x977cbe[_0x9bf3('0xf')])[_0x9bf3('0x10')](function(_0x17d461){if(_0x17d461){_0x977cbe['UserId']=_0x17d461['id'];}utils[_0x9bf3('0x11')](_0x9bf3('0x12'),_0x977cbe);});}else{utils[_0x9bf3('0x11')](_0x9bf3('0x12'),_0x977cbe);}if(channels[_0x977cbe[_0x9bf3('0x8')]]){delete channels[_0x977cbe['uniqueid']];}}exports['newchannel']=function(_0x447bcd){try{utils['debug'](util[_0x9bf3('0x6')](_0x9bf3('0x13'),_0x447bcd[_0x9bf3('0x8')]),_0x447bcd);if(_0x447bcd['uniqueid']==_0x447bcd[_0x9bf3('0x14')]&&_0x447bcd['channel']!=_0x9bf3('0x15')){utils[_0x9bf3('0x16')](util['format'](_0x9bf3('0x17'),_0x447bcd[_0x9bf3('0x8')],_0x447bcd[_0x9bf3('0x18')],_0x447bcd[_0x9bf3('0x19')]));channels[_0x447bcd[_0x9bf3('0x8')]]={'uniqueid':_0x447bcd['uniqueid'],'accountcode':_0x447bcd[_0x9bf3('0xf')],'source':_0x447bcd[_0x9bf3('0x1a')],'destination':_0x447bcd['exten'],'destinationcontext':_0x447bcd[_0x9bf3('0x18')],'channel':_0x447bcd[_0x9bf3('0x1b')],'starttime':utils[_0x9bf3('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9bf3('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x43fcf7){utils[_0x9bf3('0x1d')](util[_0x9bf3('0x6')]('[%s][calls][newchannel]',_0x447bcd[_0x9bf3('0x8')]),_0x43fcf7);}};exports[_0x9bf3('0x1e')]=function(_0x4c332a){try{utils[_0x9bf3('0x1f')](util['format'](_0x9bf3('0x20'),_0x4c332a[_0x9bf3('0x8')]),_0x4c332a);if(!_[_0x9bf3('0x21')](channels[_0x4c332a[_0x9bf3('0x8')]])&&_0x4c332a[_0x9bf3('0x22')]==0x6){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x23'),_0x4c332a[_0x9bf3('0x8')],_0x4c332a['context'],_0x4c332a['channel']));if(_[_0x9bf3('0x21')](channels[_0x4c332a['uniqueid']][_0x9bf3('0x24')])){channels[_0x4c332a[_0x9bf3('0x8')]][_0x9bf3('0x24')]=utils['now']();}}else if(!_[_0x9bf3('0x21')](channels[_0x4c332a[_0x9bf3('0x14')]])&&_0x4c332a[_0x9bf3('0x22')]==0x6&&_0x4c332a[_0x9bf3('0x18')]!=_0x9bf3('0x25')){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x26'),_0x4c332a['uniqueid'],_0x4c332a['linkedid'],_0x4c332a[_0x9bf3('0x18')],_0x4c332a[_0x9bf3('0x1b')]));channels[_0x4c332a[_0x9bf3('0x14')]][_0x9bf3('0xf')]=_0x4c332a['accountcode'];channels[_0x4c332a[_0x9bf3('0x14')]][_0x9bf3('0x27')]=_0x4c332a[_0x9bf3('0x1b')];if(_[_0x9bf3('0x21')](channels[_0x4c332a[_0x9bf3('0x14')]][_0x9bf3('0x28')])){channels[_0x4c332a[_0x9bf3('0x14')]][_0x9bf3('0x28')]=utils[_0x9bf3('0x1c')]();}channels[_0x4c332a[_0x9bf3('0x14')]][_0x9bf3('0x29')]=dispositions[_[_0x9bf3('0x2a')](_0x4c332a['channelstate'])]||_0x9bf3('0x4');}}catch(_0x43f214){utils[_0x9bf3('0x1d')](util[_0x9bf3('0x6')](_0x9bf3('0x20'),_0x4c332a[_0x9bf3('0x8')]),_0x43f214);}};exports[_0x9bf3('0x2b')]=function(_0x421f6d){try{if(!_['isNil'](channels[_0x421f6d[_0x9bf3('0x8')]])){utils[_0x9bf3('0x1f')](util[_0x9bf3('0x6')](_0x9bf3('0x2c'),_0x421f6d[_0x9bf3('0x8')]),_0x421f6d);if(_[_0x9bf3('0x21')](channels[_0x421f6d['uniqueid']]['callerid'])){channels[_0x421f6d[_0x9bf3('0x8')]][_0x9bf3('0x2d')]=_0x421f6d['calleridname']+'\x20<'+_0x421f6d['calleridnum']+'>';}utils[_0x9bf3('0x16')](util['format'](_0x9bf3('0x2e'),_0x421f6d[_0x9bf3('0x8')],channels[_0x421f6d['uniqueid']][_0x9bf3('0x2d')],_0x421f6d[_0x9bf3('0x2f')]));channels[_0x421f6d['uniqueid']][_0x9bf3('0x30')]=utils[_0x9bf3('0x1c')]();channels[_0x421f6d[_0x9bf3('0x8')]]['duration']=utils['diffTime'](channels[_0x421f6d[_0x9bf3('0x8')]][_0x9bf3('0x30')],channels[_0x421f6d['uniqueid']][_0x9bf3('0x31')]);channels[_0x421f6d[_0x9bf3('0x8')]][_0x9bf3('0x32')]=channels[_0x421f6d[_0x9bf3('0x8')]]['answertime']?utils[_0x9bf3('0x33')](channels[_0x421f6d['uniqueid']][_0x9bf3('0x30')],channels[_0x421f6d[_0x9bf3('0x8')]][_0x9bf3('0x28')]):0x0;writeDB(channels[_0x421f6d['uniqueid']]);}}catch(_0x103442){utils[_0x9bf3('0x1d')](util[_0x9bf3('0x6')](_0x9bf3('0x2c'),_0x421f6d[_0x9bf3('0x8')]),_0x103442);}};exports[_0x9bf3('0x34')]=function(_0x43fc69){try{if(!_[_0x9bf3('0x21')](channels[_0x43fc69[_0x9bf3('0x35')]])){utils[_0x9bf3('0x1f')](util[_0x9bf3('0x6')](_0x9bf3('0x36'),_0x43fc69[_0x9bf3('0x37')]),_0x43fc69);if(channels[_0x43fc69['localtwolinkedid']][_0x9bf3('0x1b')]==_0x43fc69['transfereechannel']){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x38'),_0x43fc69[_0x9bf3('0x37')],_0x43fc69['localtwolinkedid'],_0x43fc69[_0x9bf3('0x39')]));channels[_0x43fc69[_0x9bf3('0x35')]][_0x9bf3('0x27')]=_0x43fc69[_0x9bf3('0x39')];channels[_0x43fc69[_0x9bf3('0x35')]][_0x9bf3('0x3a')]=_0x9bf3('0x3b');}else if(channels[_0x43fc69[_0x9bf3('0x35')]][_0x9bf3('0x1b')]=_0x43fc69[_0x9bf3('0x3c')]){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x38'),_0x43fc69[_0x9bf3('0x37')],_0x43fc69[_0x9bf3('0x35')],_0x43fc69[_0x9bf3('0x3d')]));channels[_0x43fc69[_0x9bf3('0x35')]][_0x9bf3('0x27')]=_0x43fc69[_0x9bf3('0x3d')];channels[_0x43fc69[_0x9bf3('0x35')]][_0x9bf3('0x3a')]=_0x9bf3('0x3b');}}}catch(_0x33618d){utils[_0x9bf3('0x1d')](util['format'](_0x9bf3('0x36'),_0x43fc69[_0x9bf3('0x37')]),_0x33618d);}};exports[_0x9bf3('0x3e')]=function(_0x58f2e4){try{if(!_[_0x9bf3('0x21')](channels[_0x58f2e4[_0x9bf3('0x8')]])){utils[_0x9bf3('0x1f')](util[_0x9bf3('0x6')]('[%s][calls][musiconholdstart]',_0x58f2e4[_0x9bf3('0x8')]),_0x58f2e4);channels[_0x58f2e4[_0x9bf3('0x8')]][_0x9bf3('0x3f')]=utils[_0x9bf3('0x1c')]();utils['info'](util[_0x9bf3('0x6')](_0x9bf3('0x40'),_0x58f2e4[_0x9bf3('0x8')],channels[_0x58f2e4[_0x9bf3('0x8')]]['musiconholdstartAt']));}}catch(_0x5b7949){utils[_0x9bf3('0x1d')](util[_0x9bf3('0x6')](_0x9bf3('0x41'),_0x58f2e4[_0x9bf3('0x8')]),_0x5b7949);}};exports[_0x9bf3('0x42')]=function(_0x3b72c1){try{if(!_['isNil'](channels[_0x3b72c1['uniqueid']])){utils['debug'](util['format'](_0x9bf3('0x43'),_0x3b72c1[_0x9bf3('0x8')]),_0x3b72c1);if(!_['isNil'](channels[_0x3b72c1[_0x9bf3('0x8')]][_0x9bf3('0x3f')])){channels[_0x3b72c1[_0x9bf3('0x8')]][_0x9bf3('0x44')]+=utils[_0x9bf3('0x33')](utils[_0x9bf3('0x1c')](),channels[_0x3b72c1[_0x9bf3('0x8')]][_0x9bf3('0x3f')]);utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x45'),_0x3b72c1[_0x9bf3('0x8')],channels[_0x3b72c1[_0x9bf3('0x8')]][_0x9bf3('0x44')]));delete channels[_0x3b72c1[_0x9bf3('0x8')]]['musiconholdstartAt'];}}}catch(_0x4cc3c1){utils['error'](util[_0x9bf3('0x6')](_0x9bf3('0x43'),_0x3b72c1[_0x9bf3('0x8')]),_0x4cc3c1);}};exports['varset']=function(_0x21eb12){try{if(!_[_0x9bf3('0x21')](channels[_0x21eb12[_0x9bf3('0x8')]])){utils[_0x9bf3('0x1f')](util[_0x9bf3('0x6')]('[%s][calls][varset]',_0x21eb12[_0x9bf3('0x8')]),_0x21eb12);if(!_['isNil'](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x47')])){utils['info'](util[_0x9bf3('0x6')](_0x9bf3('0x48'),_0x21eb12[_0x9bf3('0x8')],_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]]['source']=_0x21eb12[_0x9bf3('0x49')];}if(!_[_0x9bf3('0x21')](_0x21eb12['variable'][_0x9bf3('0x4a')])){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x4b'),_0x21eb12['uniqueid'],_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]][_0x9bf3('0x4c')]=_0x21eb12['value'];channels[_0x21eb12['uniqueid']][_0x9bf3('0x2d')]='\x22'+_0x21eb12[_0x9bf3('0x49')]+_0x9bf3('0x4d')+_0x21eb12[_0x9bf3('0x49')]+'>';}if(!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')]['xmd-callerid-preview'])||!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x4e')])){utils['info'](util[_0x9bf3('0x6')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x21eb12[_0x9bf3('0x8')],!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x4f')])?_0x9bf3('0x4f'):_0x9bf3('0x4e'),_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]]['callerid']=_0x21eb12[_0x9bf3('0x49')];}if(!_[_0x9bf3('0x21')](_0x21eb12['variable'][_0x9bf3('0x50')])||!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')]['xmcs-queue'])){utils['info'](util[_0x9bf3('0x6')](_0x9bf3('0x51'),_0x21eb12[_0x9bf3('0x8')],!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x50')])?_0x9bf3('0x50'):'xmcs-queue',_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]][_0x9bf3('0x52')]=_0x9bf3('0x53');channels[_0x21eb12['uniqueid']]['lastdata']=_0x21eb12[_0x9bf3('0x49')];channels[_0x21eb12[_0x9bf3('0x8')]][_0x9bf3('0x9')]=!![];}if(!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x54')])){utils['info'](util[_0x9bf3('0x6')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x21eb12[_0x9bf3('0x8')],_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]][_0x9bf3('0x55')]=_0x21eb12['value'];}if(!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x56')])){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x57'),_0x21eb12[_0x9bf3('0x8')],_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]][_0x9bf3('0x58')]=_0x21eb12[_0x9bf3('0x49')];}if(!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x59')])){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x5a'),_0x21eb12[_0x9bf3('0x8')],_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]][_0x9bf3('0x5b')]=_0x21eb12[_0x9bf3('0x49')];}if(!_[_0x9bf3('0x21')](_0x21eb12[_0x9bf3('0x46')][_0x9bf3('0x5c')])){utils[_0x9bf3('0x16')](util[_0x9bf3('0x6')](_0x9bf3('0x5d'),_0x21eb12[_0x9bf3('0x8')],_0x21eb12[_0x9bf3('0x49')]));channels[_0x21eb12[_0x9bf3('0x8')]][_0x9bf3('0x5c')]=_0x21eb12['value'];}}}catch(_0xf49a29){utils[_0x9bf3('0x1d')](util[_0x9bf3('0x6')](_0x9bf3('0x5e'),_0x21eb12[_0x9bf3('0x8')]),_0xf49a29);}};exports[_0x9bf3('0x5f')]=function(_0x5059e1){try{if(!_[_0x9bf3('0x21')](channels[_0x5059e1[_0x9bf3('0x8')]])){utils[_0x9bf3('0x1f')](util[_0x9bf3('0x6')]('[%s][calls][newexten]',_0x5059e1[_0x9bf3('0x8')]),_0x5059e1);utils[_0x9bf3('0x16')](util['format'](_0x9bf3('0x60'),_0x5059e1[_0x9bf3('0x8')],_0x5059e1[_0x9bf3('0x61')],_0x5059e1[_0x9bf3('0x62')]));if(_0x5059e1[_0x9bf3('0x61')][_0x9bf3('0x63')]()=='set'&&_[_0x9bf3('0x64')](_0x5059e1['appdata'][_0x9bf3('0x63')](),_0x9bf3('0x65'))){var _0x4fc6b0=_0x5059e1['appdata']['split']('=');var _0x1b1d91=_0x4fc6b0[0x0][_0x9bf3('0x66')](_0x4fc6b0[0x0][_0x9bf3('0x67')]('(')+0x1,_0x4fc6b0[0x0][_0x9bf3('0x67')](')'));var _0x2df9c6=_0x4fc6b0[0x1];channels[_0x5059e1['uniqueid']][_0x1b1d91]=_0x2df9c6;}if(!_[_0x9bf3('0x68')](['hangup',_0x9bf3('0x69'),'execif',_0x9bf3('0x6a'),_0x9bf3('0x6b')],_0x5059e1['application'][_0x9bf3('0x63')]())){channels[_0x5059e1[_0x9bf3('0x8')]][_0x9bf3('0x52')]=_0x5059e1[_0x9bf3('0x61')];channels[_0x5059e1[_0x9bf3('0x8')]]['lastdata']=_0x5059e1['appdata'];}}}catch(_0x4e5f4d){utils[_0x9bf3('0x1d')](util['format'](_0x9bf3('0x6c'),_0x5059e1[_0x9bf3('0x8')]),_0x4e5f4d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 5b9aa62..06b85d2 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 _0x17bf=['[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x17bf,0x11d));var _0xf17b=function(_0x226c02,_0x43bd90){_0x226c02=_0x226c02-0x0;var _0x72daef=_0x17bf[_0x226c02];return _0x72daef;};'use strict';var utils=require(_0xf17b('0x0'));exports[_0xf17b('0x1')]=function(){utils[_0xf17b('0x2')](_0xf17b('0x3'));};exports[_0xf17b('0x4')]=function(){utils[_0xf17b('0x2')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0xf17b('0x2')](_0xf17b('0x5'));};exports[_0xf17b('0x6')]=function(_0x35e93c){utils[_0xf17b('0x6')](_0xf17b('0x7'),_0x35e93c);};exports['close']=function(){utils[_0xf17b('0x2')](_0xf17b('0x8'));};exports[_0xf17b('0x9')]=function(_0x4856a5){}; \ No newline at end of file +var _0xc35e=['[core]\x20close','managerevent','./utils','connect','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','[core]\x20error','close','info'];(function(_0x561ab2,_0x5dd79d){var _0x34147e=function(_0x554db1){while(--_0x554db1){_0x561ab2['push'](_0x561ab2['shift']());}};_0x34147e(++_0x5dd79d);}(_0xc35e,0x9e));var _0xec35=function(_0x8739f5,_0x55a924){_0x8739f5=_0x8739f5-0x0;var _0x403a42=_0xc35e[_0x8739f5];return _0x403a42;};'use strict';var utils=require(_0xec35('0x0'));exports[_0xec35('0x1')]=function(){utils['info'](_0xec35('0x2'));};exports[_0xec35('0x3')]=function(){utils['info'](_0xec35('0x4'));};exports[_0xec35('0x5')]=function(){utils['info'](_0xec35('0x6'));};exports['error']=function(_0x16d853){utils['error'](_0xec35('0x7'),_0x16d853);};exports[_0xec35('0x8')]=function(){utils[_0xec35('0x9')](_0xec35('0xa'));};exports[_0xec35('0xb')]=function(_0x31a597){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 75fbcd9..8c63b3a 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 _0x543f=['answertime','lastevent','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','cause-txt','complete','diffTime','endtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','error','varset','debug','[%s][dials][varset]','isNil','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','dialend','[%s][dials][dialend]','ANSWER'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x543f,0x163));var _0xf543=function(_0x312890,_0x11d6eb){_0x312890=_0x312890-0x0;var _0x34bbf8=_0x543f[_0x312890];return _0x34bbf8;};'use strict';var _=require(_0xf543('0x0'));var util=require(_0xf543('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x275dfd){utils[_0xf543('0x2')](util[_0xf543('0x3')](_0xf543('0x4'),_0x275dfd[_0xf543('0x5')],_0x275dfd[_0xf543('0x6')],_0x275dfd[_0xf543('0x7')],_0x275dfd[_0xf543('0x8')],_0x275dfd[_0xf543('0x9')],_0x275dfd[_0xf543('0xa')]));utils[_0xf543('0xb')]('CreateVoiceDialReport',_0x275dfd);delete dials[_0x275dfd['uniqueid']];}exports[_0xf543('0xc')]=function(_0x3e336f){try{utils['debug'](util[_0xf543('0x3')](_0xf543('0xd'),_0x3e336f[_0xf543('0x5')]),_0x3e336f);utils[_0xf543('0x2')](util[_0xf543('0x3')](_0xf543('0xe'),_0x3e336f[_0xf543('0x5')],_0x3e336f[_0xf543('0xf')],_0x3e336f[_0xf543('0x10')]));if(_0x3e336f[_0xf543('0xf')]['toLowerCase']()==_0xf543('0x11')&&_[_0xf543('0x12')](_0x3e336f[_0xf543('0x10')][_0xf543('0x13')](),_0xf543('0x14'))){var _0x488e7e=_0x3e336f[_0xf543('0x10')]['split']('=');dials[_0x3e336f[_0xf543('0x5')]]={'routeId':_0x488e7e[0x1]};}}catch(_0x3d015b){utils[_0xf543('0x15')](util['format']('[%s][dials][newexten]',_0x3e336f[_0xf543('0x5')]),_0x3d015b);}};exports[_0xf543('0x16')]=function(_0x526fed){try{utils[_0xf543('0x17')](util[_0xf543('0x3')](_0xf543('0x18'),_0x526fed[_0xf543('0x5')]),_0x526fed);if(!_[_0xf543('0x19')](_0x526fed['variable'][_0xf543('0x1a')])){utils[_0xf543('0x2')](util[_0xf543('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x526fed[_0xf543('0x5')],_0x526fed[_0xf543('0x1b')]));dials[_0x526fed[_0xf543('0x5')]]={'routeId':_0x526fed['value']};}}catch(_0x59bee1){utils[_0xf543('0x15')](util['format'](_0xf543('0x18'),_0x526fed['uniqueid']),_0x59bee1);}};exports[_0xf543('0x1c')]=function(_0x3f2e58){try{if(!_[_0xf543('0x19')](dials[_0x3f2e58['uniqueid']])){utils[_0xf543('0x17')](util[_0xf543('0x3')](_0xf543('0x1d'),_0x3f2e58['uniqueid']),_0x3f2e58);dials[_0x3f2e58['uniqueid']]=_[_0xf543('0x1e')](dials[_0x3f2e58[_0xf543('0x5')]],_0x3f2e58);dials[_0x3f2e58['uniqueid']][_0xf543('0x1f')]=utils[_0xf543('0x20')]();dials[_0x3f2e58['uniqueid']]['lastevent']=_0xf543('0x21');utils[_0xf543('0x2')](util[_0xf543('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3f2e58['uniqueid'],dials[_0x3f2e58[_0xf543('0x5')]][_0xf543('0x1f')]));}}catch(_0x14c187){utils[_0xf543('0x15')](util[_0xf543('0x3')](_0xf543('0x1d'),_0x3f2e58[_0xf543('0x5')]),_0x14c187);}};exports[_0xf543('0x22')]=function(_0x567298){try{if(!_[_0xf543('0x19')](dials[_0x567298[_0xf543('0x5')]])){utils[_0xf543('0x17')](util[_0xf543('0x3')](_0xf543('0x23'),_0x567298[_0xf543('0x5')]),_0x567298);dials[_0x567298[_0xf543('0x5')]]['dialstatus']=_0x567298[_0xf543('0xa')];if(_0x567298[_0xf543('0xa')]==_0xf543('0x24')){dials[_0x567298['uniqueid']]=_['assign'](dials[_0x567298[_0xf543('0x5')]],_0x567298);dials[_0x567298[_0xf543('0x5')]][_0xf543('0x25')]=utils['now']();dials[_0x567298['uniqueid']][_0xf543('0x26')]=_0xf543('0x27');utils[_0xf543('0x2')](util[_0xf543('0x3')](_0xf543('0x28'),_0x567298[_0xf543('0x5')],_0x567298[_0xf543('0xa')],dials[_0x567298[_0xf543('0x5')]][_0xf543('0x25')]));}else{utils['info'](util[_0xf543('0x3')](_0xf543('0x29'),_0x567298[_0xf543('0x5')],_0x567298[_0xf543('0xa')]));}}}catch(_0xaa99f){utils[_0xf543('0x15')](util['format'](_0xf543('0x23'),_0x567298[_0xf543('0x5')]),_0xaa99f);}};exports[_0xf543('0x2a')]=function(_0x11a017){try{if(!_['isNil'](dials[_0x11a017[_0xf543('0x5')]])){utils[_0xf543('0x17')](util[_0xf543('0x3')]('[%s][dials][hangup]',_0x11a017[_0xf543('0x5')]),_0x11a017);utils[_0xf543('0x2')](util[_0xf543('0x3')](_0xf543('0x2b'),_0x11a017['uniqueid'],_0x11a017[_0xf543('0x8')],_0x11a017['calleridname'],_0x11a017[_0xf543('0x2c')]));dials[_0x11a017[_0xf543('0x5')]]=_[_0xf543('0x1e')](dials[_0x11a017['uniqueid']],{'endtime':utils[_0xf543('0x20')](),'lastevent':_0xf543('0x2d')});dials[_0x11a017[_0xf543('0x5')]]['duration']=utils[_0xf543('0x2e')](dials[_0x11a017['uniqueid']][_0xf543('0x2f')],dials[_0x11a017[_0xf543('0x5')]][_0xf543('0x1f')]);dials[_0x11a017[_0xf543('0x5')]]['holdtime']=utils[_0xf543('0x2e')](dials[_0x11a017[_0xf543('0x5')]][_0xf543('0x25')]||dials[_0x11a017['uniqueid']][_0xf543('0x2f')],dials[_0x11a017[_0xf543('0x5')]][_0xf543('0x1f')]);dials[_0x11a017[_0xf543('0x5')]][_0xf543('0x30')]=dials[_0x11a017[_0xf543('0x5')]][_0xf543('0x25')]?utils[_0xf543('0x2e')](dials[_0x11a017['uniqueid']][_0xf543('0x2f')],dials[_0x11a017[_0xf543('0x5')]][_0xf543('0x25')]):0x0;writeDB(dials[_0x11a017[_0xf543('0x5')]]);}}catch(_0x36f6c0){utils[_0xf543('0x15')](util[_0xf543('0x3')]('[%s][dials][hangup]',_0x11a017[_0xf543('0x5')]),_0x36f6c0);}}; \ No newline at end of file +var _0x2ee8=['[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','duration','diffTime','endtime','lodash','util','./utils','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','info','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','error','varset'];(function(_0x44cd28,_0x1502d9){var _0x39356e=function(_0x4dfe82){while(--_0x4dfe82){_0x44cd28['push'](_0x44cd28['shift']());}};_0x39356e(++_0x1502d9);}(_0x2ee8,0x178));var _0x82ee=function(_0x5ec636,_0x43c345){_0x5ec636=_0x5ec636-0x0;var _0x1fc247=_0x2ee8[_0x5ec636];return _0x1fc247;};'use strict';var _=require(_0x82ee('0x0'));var util=require(_0x82ee('0x1'));var utils=require(_0x82ee('0x2'));var dials={};function writeDB(_0x1d6155){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1d6155[_0x82ee('0x3')],_0x1d6155[_0x82ee('0x4')],_0x1d6155[_0x82ee('0x5')],_0x1d6155[_0x82ee('0x6')],_0x1d6155[_0x82ee('0x7')],_0x1d6155[_0x82ee('0x8')]));utils[_0x82ee('0x9')](_0x82ee('0xa'),_0x1d6155);delete dials[_0x1d6155[_0x82ee('0x3')]];}exports[_0x82ee('0xb')]=function(_0x326f30){try{utils[_0x82ee('0xc')](util[_0x82ee('0xd')](_0x82ee('0xe'),_0x326f30[_0x82ee('0x3')]),_0x326f30);utils[_0x82ee('0xf')](util[_0x82ee('0xd')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x326f30[_0x82ee('0x3')],_0x326f30[_0x82ee('0x10')],_0x326f30['appdata']));if(_0x326f30[_0x82ee('0x10')][_0x82ee('0x11')]()==_0x82ee('0x12')&&_[_0x82ee('0x13')](_0x326f30[_0x82ee('0x14')][_0x82ee('0x11')](),_0x82ee('0x15'))){var _0x5814a1=_0x326f30[_0x82ee('0x14')]['split']('=');dials[_0x326f30[_0x82ee('0x3')]]={'routeId':_0x5814a1[0x1]};}}catch(_0x1a621c){utils[_0x82ee('0x16')](util['format'](_0x82ee('0xe'),_0x326f30['uniqueid']),_0x1a621c);}};exports[_0x82ee('0x17')]=function(_0x4a3d52){try{utils[_0x82ee('0xc')](util[_0x82ee('0xd')](_0x82ee('0x18'),_0x4a3d52[_0x82ee('0x3')]),_0x4a3d52);if(!_[_0x82ee('0x19')](_0x4a3d52[_0x82ee('0x1a')][_0x82ee('0x1b')])){utils[_0x82ee('0xf')](util[_0x82ee('0xd')](_0x82ee('0x1c'),_0x4a3d52[_0x82ee('0x3')],_0x4a3d52[_0x82ee('0x1d')]));dials[_0x4a3d52[_0x82ee('0x3')]]={'routeId':_0x4a3d52['value']};}}catch(_0x4d6a0c){utils[_0x82ee('0x16')](util[_0x82ee('0xd')](_0x82ee('0x18'),_0x4a3d52[_0x82ee('0x3')]),_0x4d6a0c);}};exports[_0x82ee('0x1e')]=function(_0x3313ae){try{if(!_[_0x82ee('0x19')](dials[_0x3313ae[_0x82ee('0x3')]])){utils[_0x82ee('0xc')](util[_0x82ee('0xd')](_0x82ee('0x1f'),_0x3313ae[_0x82ee('0x3')]),_0x3313ae);dials[_0x3313ae[_0x82ee('0x3')]]=_[_0x82ee('0x20')](dials[_0x3313ae['uniqueid']],_0x3313ae);dials[_0x3313ae[_0x82ee('0x3')]][_0x82ee('0x21')]=utils[_0x82ee('0x22')]();dials[_0x3313ae['uniqueid']][_0x82ee('0x23')]='called';utils[_0x82ee('0xf')](util[_0x82ee('0xd')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3313ae[_0x82ee('0x3')],dials[_0x3313ae[_0x82ee('0x3')]]['starttime']));}}catch(_0x140186){utils[_0x82ee('0x16')](util[_0x82ee('0xd')](_0x82ee('0x1f'),_0x3313ae['uniqueid']),_0x140186);}};exports[_0x82ee('0x24')]=function(_0x49de28){try{if(!_[_0x82ee('0x19')](dials[_0x49de28[_0x82ee('0x3')]])){utils[_0x82ee('0xc')](util[_0x82ee('0xd')](_0x82ee('0x25'),_0x49de28[_0x82ee('0x3')]),_0x49de28);dials[_0x49de28[_0x82ee('0x3')]][_0x82ee('0x8')]=_0x49de28[_0x82ee('0x8')];if(_0x49de28[_0x82ee('0x8')]==_0x82ee('0x26')){dials[_0x49de28[_0x82ee('0x3')]]=_[_0x82ee('0x20')](dials[_0x49de28['uniqueid']],_0x49de28);dials[_0x49de28[_0x82ee('0x3')]][_0x82ee('0x27')]=utils[_0x82ee('0x22')]();dials[_0x49de28[_0x82ee('0x3')]]['lastevent']=_0x82ee('0x28');utils[_0x82ee('0xf')](util['format'](_0x82ee('0x29'),_0x49de28[_0x82ee('0x3')],_0x49de28[_0x82ee('0x8')],dials[_0x49de28[_0x82ee('0x3')]][_0x82ee('0x27')]));}else{utils[_0x82ee('0xf')](util[_0x82ee('0xd')](_0x82ee('0x2a'),_0x49de28['uniqueid'],_0x49de28['dialstatus']));}}}catch(_0x222f59){utils[_0x82ee('0x16')](util[_0x82ee('0xd')](_0x82ee('0x25'),_0x49de28[_0x82ee('0x3')]),_0x222f59);}};exports[_0x82ee('0x2b')]=function(_0x4952f0){try{if(!_[_0x82ee('0x19')](dials[_0x4952f0[_0x82ee('0x3')]])){utils[_0x82ee('0xc')](util[_0x82ee('0xd')](_0x82ee('0x2c'),_0x4952f0[_0x82ee('0x3')]),_0x4952f0);utils[_0x82ee('0xf')](util[_0x82ee('0xd')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4952f0[_0x82ee('0x3')],_0x4952f0[_0x82ee('0x6')],_0x4952f0[_0x82ee('0x2d')],_0x4952f0[_0x82ee('0x2e')]));dials[_0x4952f0[_0x82ee('0x3')]]=_[_0x82ee('0x20')](dials[_0x4952f0[_0x82ee('0x3')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4952f0[_0x82ee('0x3')]][_0x82ee('0x2f')]=utils[_0x82ee('0x30')](dials[_0x4952f0['uniqueid']]['endtime'],dials[_0x4952f0['uniqueid']][_0x82ee('0x21')]);dials[_0x4952f0[_0x82ee('0x3')]]['holdtime']=utils[_0x82ee('0x30')](dials[_0x4952f0[_0x82ee('0x3')]]['answertime']||dials[_0x4952f0[_0x82ee('0x3')]][_0x82ee('0x31')],dials[_0x4952f0[_0x82ee('0x3')]][_0x82ee('0x21')]);dials[_0x4952f0[_0x82ee('0x3')]]['billableseconds']=dials[_0x4952f0[_0x82ee('0x3')]][_0x82ee('0x27')]?utils[_0x82ee('0x30')](dials[_0x4952f0[_0x82ee('0x3')]]['endtime'],dials[_0x4952f0[_0x82ee('0x3')]]['answertime']):0x0;writeDB(dials[_0x4952f0['uniqueid']]);}}catch(_0x18936a){utils[_0x82ee('0x16')](util[_0x82ee('0xd')](_0x82ee('0x2c'),_0x4952f0[_0x82ee('0x3')]),_0x18936a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index e838c5d..8f7c578 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 _0xbf15=['agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','env','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect'];(function(_0x17575b,_0x1d7af7){var _0x5b6f87=function(_0x42e06){while(--_0x42e06){_0x17575b['push'](_0x17575b['shift']());}};_0x5b6f87(++_0x1d7af7);}(_0xbf15,0x17f));var _0x5bf1=function(_0x7dc20,_0x263566){_0x7dc20=_0x7dc20-0x0;var _0x44291b=_0xbf15[_0x7dc20];return _0x44291b;};var AsteriskManager=require(_0x5bf1('0x0'));var config=require(_0x5bf1('0x1'));var utils=require('./utils');var util=require(_0x5bf1('0x2'));var isXDREnabled=config[_0x5bf1('0x3')]&&config['xdr']['disabled']?!config['xdr']['disabled']:!![];var isProduction=config[_0x5bf1('0x4')]===_0x5bf1('0x5')||![];var isLocalAsterisk=config[_0x5bf1('0x3')]&&config[_0x5bf1('0x3')][_0x5bf1('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x5bf1('0x7')][_0x5bf1('0x8')],config[_0x5bf1('0x7')]['ip'],config[_0x5bf1('0x7')][_0x5bf1('0x9')],config[_0x5bf1('0x7')][_0x5bf1('0xa')],!![]);ami[_0x5bf1('0xb')]();if(!isXDREnabled){utils[_0x5bf1('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x5bf1('0xc')](_0x5bf1('0xd'));}else{var agents=require(_0x5bf1('0xe'));var calls=require(_0x5bf1('0xf'));var queues=require(_0x5bf1('0x10'));var recordings=require(_0x5bf1('0x11'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x5bf1('0x12'));var core=require(_0x5bf1('0x13'));ami['on']('connect',core[_0x5bf1('0x14')]);ami['on'](_0x5bf1('0x15'),core[_0x5bf1('0x15')]);ami['on'](_0x5bf1('0x16'),core[_0x5bf1('0x16')]);ami['on'](_0x5bf1('0x17'),core[_0x5bf1('0x17')]);ami['on']('close',core[_0x5bf1('0x18')]);ami['on'](_0x5bf1('0x19'),core[_0x5bf1('0x19')]);ami['on']('devicestatechange',function(_0x3d0f5c){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x1c'),_0x3d0f5c['device']),_0x3d0f5c);members[_0x5bf1('0x1d')](_0x3d0f5c);}catch(_0xb1dde9){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x1c'),_0x3d0f5c[_0x5bf1('0x1e')]),_0xb1dde9);}});ami['on'](_0x5bf1('0x1f'),function(_0x51bff8){try{utils['debug'](util[_0x5bf1('0x1b')]('[%s][index][agentcalled]',_0x51bff8[_0x5bf1('0x20')]),_0x51bff8);agents[_0x5bf1('0x1f')](_0x51bff8);}catch(_0x523bbe){utils['error'](util[_0x5bf1('0x1b')](_0x5bf1('0x21'),_0x51bff8['uniqueid']),_0x523bbe);}});ami['on'](_0x5bf1('0x22'),function(_0x27fd50){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x23'),_0x27fd50[_0x5bf1('0x20')]),_0x27fd50);agents[_0x5bf1('0x22')](_0x27fd50);}catch(_0x5a3b12){utils[_0x5bf1('0x17')](util['format'](_0x5bf1('0x23'),_0x27fd50[_0x5bf1('0x20')]),_0x5a3b12);}});ami['on'](_0x5bf1('0x24'),function(_0x3a99ff){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')]('[%s][index][agentconnect]',_0x3a99ff[_0x5bf1('0x20')]),_0x3a99ff);agents[_0x5bf1('0x24')](_0x3a99ff);queues[_0x5bf1('0x24')](_0x3a99ff);}catch(_0x65c2df){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')]('[%s][index][agentconnect]',_0x3a99ff['uniqueid']),_0x65c2df);}});ami['on'](_0x5bf1('0x25'),function(_0x38d9e2){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x26'),_0x38d9e2['uniqueid']),_0x38d9e2);agents[_0x5bf1('0x25')](_0x38d9e2);queues[_0x5bf1('0x25')](_0x38d9e2);members[_0x5bf1('0x25')](_0x38d9e2);}catch(_0x51b495){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x26'),_0x38d9e2[_0x5bf1('0x20')]),_0x51b495);}});ami['on'](_0x5bf1('0x27'),function(_0x507c3d){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')]('[%s][index][queuecallerabandon]',_0x507c3d[_0x5bf1('0x20')]),_0x507c3d);agents[_0x5bf1('0x27')](_0x507c3d);queues['queuecallerabandon'](_0x507c3d);}catch(_0x5bfe63){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x28'),_0x507c3d[_0x5bf1('0x20')]),_0x5bfe63);}});ami['on'](_0x5bf1('0x29'),function(_0x483564){try{utils['debug'](util[_0x5bf1('0x1b')](_0x5bf1('0x2a'),_0x483564[_0x5bf1('0x20')]),_0x483564);queues['queuecallerjoin'](_0x483564);recordings[_0x5bf1('0x29')](_0x483564);}catch(_0x455c71){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x2a'),_0x483564['uniqueid']),_0x455c71);}});ami['on'](_0x5bf1('0x2b'),function(_0x3009e6){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')]('[%s][index][queuecallerleave]',_0x3009e6[_0x5bf1('0x20')]),_0x3009e6);queues['queuecallerleave'](_0x3009e6);}catch(_0x4cf419){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x2c'),_0x3009e6['uniqueid']),_0x4cf419);}});ami['on'](_0x5bf1('0x2d'),function(_0x278b12){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')]('[%s][index][musiconholdstart]',_0x278b12[_0x5bf1('0x20')]),_0x278b12);queues[_0x5bf1('0x2d')](_0x278b12);calls[_0x5bf1('0x2d')](_0x278b12);}catch(_0x2391fe){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x278b12[_0x5bf1('0x20')]),_0x2391fe);}});ami['on'](_0x5bf1('0x2e'),function(_0x18362b){try{utils['debug'](util[_0x5bf1('0x1b')](_0x5bf1('0x2f'),_0x18362b[_0x5bf1('0x20')]),_0x18362b);queues['musiconholdstop'](_0x18362b);calls['musiconholdstop'](_0x18362b);}catch(_0x758b9a){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x2f'),_0x18362b['uniqueid']),_0x758b9a);}});ami['on'](_0x5bf1('0x30'),function(_0x25e934){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x31'),_0x25e934[_0x5bf1('0x20')]),_0x25e934);calls[_0x5bf1('0x30')](_0x25e934);recordings[_0x5bf1('0x30')](_0x25e934);}catch(_0x57c4f2){utils[_0x5bf1('0x17')](util['format'](_0x5bf1('0x31'),_0x25e934[_0x5bf1('0x20')]),_0x57c4f2);}});ami['on'](_0x5bf1('0x32'),function(_0x47d28b){try{utils[_0x5bf1('0x1a')](util['format']('[%s][index][hangup]',_0x47d28b[_0x5bf1('0x20')]),_0x47d28b);calls['hangup'](_0x47d28b);recordings[_0x5bf1('0x32')](_0x47d28b);dials[_0x5bf1('0x32')](_0x47d28b);agents[_0x5bf1('0x32')](_0x47d28b);queues[_0x5bf1('0x32')](_0x47d28b);}catch(_0x480324){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x33'),_0x47d28b[_0x5bf1('0x20')]),_0x480324);}});ami['on'](_0x5bf1('0x34'),function(_0x4233fc){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x35'),_0x4233fc[_0x5bf1('0x20')]),_0x4233fc);members[_0x5bf1('0x34')](_0x4233fc);}catch(_0x19b2ba){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x35'),_0x4233fc[_0x5bf1('0x20')]),_0x19b2ba);}});ami['on']('blindtransfer',function(_0x1b7778){try{utils[_0x5bf1('0x1a')](util['format'](_0x5bf1('0x36'),_0x1b7778[_0x5bf1('0x20')]),_0x1b7778);queues[_0x5bf1('0x37')](_0x1b7778);agents[_0x5bf1('0x37')](_0x1b7778);transfers[_0x5bf1('0x37')](_0x1b7778);}catch(_0x4ace39){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x36'),_0x1b7778[_0x5bf1('0x20')]),_0x4ace39);}});ami['on'](_0x5bf1('0x38'),function(_0x50d7c8){try{utils[_0x5bf1('0x1a')](util['format']('[%s][index][attendedtransfer]',_0x50d7c8[_0x5bf1('0x39')]),_0x50d7c8);queues['attendedtransfer'](_0x50d7c8);transfers['attendedtransfer'](_0x50d7c8);agents['attendedtransfer'](_0x50d7c8);calls[_0x5bf1('0x38')](_0x50d7c8);}catch(_0x34243e){utils['error'](util['format'](_0x5bf1('0x3a'),_0x50d7c8[_0x5bf1('0x39')]),_0x34243e);}});ami['on'](_0x5bf1('0x3b'),function(_0x28c858){try{utils['debug'](util[_0x5bf1('0x1b')](_0x5bf1('0x3c'),_0x28c858[_0x5bf1('0x20')]),_0x28c858);queues[_0x5bf1('0x3b')](_0x28c858);recordings[_0x5bf1('0x3b')](_0x28c858);calls[_0x5bf1('0x3b')](_0x28c858);dials[_0x5bf1('0x3b')](_0x28c858);}catch(_0x2f71ee){utils['error'](util[_0x5bf1('0x1b')](_0x5bf1('0x3c'),_0x28c858['uniqueid']),_0x2f71ee);}});ami['on']('newexten',function(_0x5882ee){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x3d'),_0x5882ee[_0x5bf1('0x20')]),_0x5882ee);calls['newexten'](_0x5882ee);recordings[_0x5bf1('0x3e')](_0x5882ee);dials['newexten'](_0x5882ee);}catch(_0x46bceb){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x3d'),_0x5882ee[_0x5bf1('0x20')]),_0x46bceb);}});ami['on'](_0x5bf1('0x3f'),function(_0x44699d){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x40'),_0x44699d[_0x5bf1('0x20')]),_0x44699d);calls[_0x5bf1('0x3f')](_0x44699d);recordings['newchannel'](_0x44699d);}catch(_0x5e120b){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')]('[%s][index][newchannel]',_0x44699d['uniqueid']),_0x5e120b);}});ami['on']('dialbegin',function(_0x35bd4d){try{utils[_0x5bf1('0x1a')](util['format'](_0x5bf1('0x41'),_0x35bd4d[_0x5bf1('0x20')]),_0x35bd4d);dials[_0x5bf1('0x42')](_0x35bd4d);}catch(_0x48f0e7){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x43'),_0x35bd4d[_0x5bf1('0x20')]),_0x48f0e7);}});ami['on'](_0x5bf1('0x44'),function(_0x3b75d3){try{utils[_0x5bf1('0x1a')](util[_0x5bf1('0x1b')](_0x5bf1('0x45'),_0x3b75d3[_0x5bf1('0x20')]),_0x3b75d3);dials['dialend'](_0x3b75d3);}catch(_0x43c931){utils[_0x5bf1('0x17')](util[_0x5bf1('0x1b')](_0x5bf1('0x45'),_0x3b75d3['uniqueid']),_0x43c931);}});} \ No newline at end of file +var _0xe746=['queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','util','xdr','env','production','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','agentcalled','format','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]'];(function(_0x5b11f8,_0x11dbd1){var _0x2a9d9b=function(_0x75faea){while(--_0x75faea){_0x5b11f8['push'](_0x5b11f8['shift']());}};_0x2a9d9b(++_0x11dbd1);}(_0xe746,0x1e4));var _0x6e74=function(_0x3fffff,_0x29ea80){_0x3fffff=_0x3fffff-0x0;var _0x2b57ff=_0xe746[_0x3fffff];return _0x2b57ff;};var AsteriskManager=require(_0x6e74('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x6e74('0x1'));var isXDREnabled=config[_0x6e74('0x2')]&&config[_0x6e74('0x2')]['disabled']?!config['xdr']['disabled']:!![];var isProduction=config[_0x6e74('0x3')]===_0x6e74('0x4')||![];var isLocalAsterisk=config[_0x6e74('0x2')]&&config[_0x6e74('0x2')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x6e74('0x5')][_0x6e74('0x6')],config[_0x6e74('0x5')]['ip'],config[_0x6e74('0x5')]['username'],config[_0x6e74('0x5')][_0x6e74('0x7')],!![]);ami[_0x6e74('0x8')]();if(!isXDREnabled){utils[_0x6e74('0x9')](_0x6e74('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x6e74('0xb'));}else{var agents=require(_0x6e74('0xc'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x6e74('0xd'));var members=require(_0x6e74('0xe'));var dials=require(_0x6e74('0xf'));var transfers=require(_0x6e74('0x10'));var core=require(_0x6e74('0x11'));ami['on'](_0x6e74('0x12'),core[_0x6e74('0x12')]);ami['on'](_0x6e74('0x13'),core['shutdown']);ami['on']('fullybooted',core[_0x6e74('0x14')]);ami['on'](_0x6e74('0x15'),core['error']);ami['on']('close',core[_0x6e74('0x16')]);ami['on'](_0x6e74('0x17'),core[_0x6e74('0x17')]);ami['on'](_0x6e74('0x18'),function(_0x29faf0){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x1a'),_0x29faf0['device']),_0x29faf0);members[_0x6e74('0x18')](_0x29faf0);}catch(_0xdf36e1){utils[_0x6e74('0x15')](util['format']('[%s][index][devicestatechange]',_0x29faf0['device']),_0xdf36e1);}});ami['on'](_0x6e74('0x1b'),function(_0x145d20){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')]('[%s][index][agentcalled]',_0x145d20['uniqueid']),_0x145d20);agents[_0x6e74('0x1b')](_0x145d20);}catch(_0x85fd9d){utils['error'](util[_0x6e74('0x1c')]('[%s][index][agentcalled]',_0x145d20[_0x6e74('0x1d')]),_0x85fd9d);}});ami['on'](_0x6e74('0x1e'),function(_0x2aede9){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x1f'),_0x2aede9[_0x6e74('0x1d')]),_0x2aede9);agents[_0x6e74('0x1e')](_0x2aede9);}catch(_0x5bf517){utils[_0x6e74('0x15')](util['format'](_0x6e74('0x1f'),_0x2aede9[_0x6e74('0x1d')]),_0x5bf517);}});ami['on'](_0x6e74('0x20'),function(_0x19f8a7){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x21'),_0x19f8a7[_0x6e74('0x1d')]),_0x19f8a7);agents[_0x6e74('0x20')](_0x19f8a7);queues['agentconnect'](_0x19f8a7);}catch(_0x58e8d7){utils[_0x6e74('0x15')](util[_0x6e74('0x1c')](_0x6e74('0x21'),_0x19f8a7['uniqueid']),_0x58e8d7);}});ami['on'](_0x6e74('0x22'),function(_0x144cee){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x23'),_0x144cee[_0x6e74('0x1d')]),_0x144cee);agents['agentcomplete'](_0x144cee);queues[_0x6e74('0x22')](_0x144cee);members[_0x6e74('0x22')](_0x144cee);}catch(_0x1d5c79){utils['error'](util[_0x6e74('0x1c')]('[%s][index][agentcomplete]',_0x144cee[_0x6e74('0x1d')]),_0x1d5c79);}});ami['on'](_0x6e74('0x24'),function(_0x5325e7){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')]('[%s][index][queuecallerabandon]',_0x5325e7[_0x6e74('0x1d')]),_0x5325e7);agents['queuecallerabandon'](_0x5325e7);queues[_0x6e74('0x24')](_0x5325e7);}catch(_0x4ede2d){utils[_0x6e74('0x15')](util[_0x6e74('0x1c')](_0x6e74('0x25'),_0x5325e7[_0x6e74('0x1d')]),_0x4ede2d);}});ami['on']('queuecallerjoin',function(_0x239d2e){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x26'),_0x239d2e[_0x6e74('0x1d')]),_0x239d2e);queues[_0x6e74('0x27')](_0x239d2e);recordings[_0x6e74('0x27')](_0x239d2e);}catch(_0x357d4c){utils['error'](util[_0x6e74('0x1c')](_0x6e74('0x26'),_0x239d2e[_0x6e74('0x1d')]),_0x357d4c);}});ami['on']('queuecallerleave',function(_0x5ab82f){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x28'),_0x5ab82f[_0x6e74('0x1d')]),_0x5ab82f);queues['queuecallerleave'](_0x5ab82f);}catch(_0x477975){utils['error'](util['format'](_0x6e74('0x28'),_0x5ab82f[_0x6e74('0x1d')]),_0x477975);}});ami['on'](_0x6e74('0x29'),function(_0x35afc3){try{utils['debug'](util[_0x6e74('0x1c')](_0x6e74('0x2a'),_0x35afc3[_0x6e74('0x1d')]),_0x35afc3);queues[_0x6e74('0x29')](_0x35afc3);calls[_0x6e74('0x29')](_0x35afc3);}catch(_0x26a7e2){utils['error'](util['format'](_0x6e74('0x2a'),_0x35afc3[_0x6e74('0x1d')]),_0x26a7e2);}});ami['on'](_0x6e74('0x2b'),function(_0x34a46d){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x2c'),_0x34a46d[_0x6e74('0x1d')]),_0x34a46d);queues[_0x6e74('0x2b')](_0x34a46d);calls[_0x6e74('0x2b')](_0x34a46d);}catch(_0x116a79){utils['error'](util['format'](_0x6e74('0x2c'),_0x34a46d[_0x6e74('0x1d')]),_0x116a79);}});ami['on'](_0x6e74('0x2d'),function(_0x124adc){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')](_0x6e74('0x2e'),_0x124adc[_0x6e74('0x1d')]),_0x124adc);calls[_0x6e74('0x2d')](_0x124adc);recordings[_0x6e74('0x2d')](_0x124adc);}catch(_0x26e5f9){utils[_0x6e74('0x15')](util[_0x6e74('0x1c')]('[%s][index][newstate]',_0x124adc[_0x6e74('0x1d')]),_0x26e5f9);}});ami['on'](_0x6e74('0x2f'),function(_0x2c14f1){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')](_0x6e74('0x30'),_0x2c14f1[_0x6e74('0x1d')]),_0x2c14f1);calls[_0x6e74('0x2f')](_0x2c14f1);recordings[_0x6e74('0x2f')](_0x2c14f1);dials['hangup'](_0x2c14f1);agents['hangup'](_0x2c14f1);queues[_0x6e74('0x2f')](_0x2c14f1);}catch(_0x407a84){utils[_0x6e74('0x15')](util[_0x6e74('0x1c')](_0x6e74('0x30'),_0x2c14f1['uniqueid']),_0x407a84);}});ami['on'](_0x6e74('0x31'),function(_0x40eaac){try{utils['debug'](util[_0x6e74('0x1c')](_0x6e74('0x32'),_0x40eaac['uniqueid']),_0x40eaac);members[_0x6e74('0x31')](_0x40eaac);}catch(_0x14636c){utils[_0x6e74('0x15')](util[_0x6e74('0x1c')](_0x6e74('0x32'),_0x40eaac[_0x6e74('0x1d')]),_0x14636c);}});ami['on']('blindtransfer',function(_0x418719){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')](_0x6e74('0x33'),_0x418719[_0x6e74('0x1d')]),_0x418719);queues[_0x6e74('0x34')](_0x418719);agents['blindtransfer'](_0x418719);transfers[_0x6e74('0x34')](_0x418719);}catch(_0x496434){utils[_0x6e74('0x15')](util[_0x6e74('0x1c')](_0x6e74('0x33'),_0x418719[_0x6e74('0x1d')]),_0x496434);}});ami['on'](_0x6e74('0x35'),function(_0x111854){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')]('[%s][index][attendedtransfer]',_0x111854['origtransfereruniqueid']),_0x111854);queues[_0x6e74('0x35')](_0x111854);transfers[_0x6e74('0x35')](_0x111854);agents[_0x6e74('0x35')](_0x111854);calls['attendedtransfer'](_0x111854);}catch(_0xecbc82){utils['error'](util[_0x6e74('0x1c')]('[%s][index][attendedtransfer]',_0x111854[_0x6e74('0x36')]),_0xecbc82);}});ami['on']('varset',function(_0x29feeb){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')](_0x6e74('0x37'),_0x29feeb[_0x6e74('0x1d')]),_0x29feeb);queues[_0x6e74('0x38')](_0x29feeb);recordings[_0x6e74('0x38')](_0x29feeb);calls[_0x6e74('0x38')](_0x29feeb);dials['varset'](_0x29feeb);}catch(_0x4ae03c){utils['error'](util[_0x6e74('0x1c')](_0x6e74('0x37'),_0x29feeb['uniqueid']),_0x4ae03c);}});ami['on'](_0x6e74('0x39'),function(_0x431de5){try{utils[_0x6e74('0x19')](util['format']('[%s][index][newexten]',_0x431de5[_0x6e74('0x1d')]),_0x431de5);calls[_0x6e74('0x39')](_0x431de5);recordings[_0x6e74('0x39')](_0x431de5);dials[_0x6e74('0x39')](_0x431de5);}catch(_0x358656){utils[_0x6e74('0x15')](util['format'](_0x6e74('0x3a'),_0x431de5[_0x6e74('0x1d')]),_0x358656);}});ami['on'](_0x6e74('0x3b'),function(_0x1e6fa2){try{utils[_0x6e74('0x19')](util['format']('[%s][index][newchannel]',_0x1e6fa2[_0x6e74('0x1d')]),_0x1e6fa2);calls[_0x6e74('0x3b')](_0x1e6fa2);recordings[_0x6e74('0x3b')](_0x1e6fa2);}catch(_0x166386){utils['error'](util[_0x6e74('0x1c')]('[%s][index][newchannel]',_0x1e6fa2[_0x6e74('0x1d')]),_0x166386);}});ami['on']('dialbegin',function(_0x854dab){try{utils[_0x6e74('0x19')](util['format'](_0x6e74('0x3c'),_0x854dab[_0x6e74('0x1d')]),_0x854dab);dials[_0x6e74('0x3d')](_0x854dab);}catch(_0x365cda){utils[_0x6e74('0x15')](util[_0x6e74('0x1c')](_0x6e74('0x3e'),_0x854dab[_0x6e74('0x1d')]),_0x365cda);}});ami['on']('dialend',function(_0x498596){try{utils[_0x6e74('0x19')](util[_0x6e74('0x1c')](_0x6e74('0x3f'),_0x498596[_0x6e74('0x1d')]),_0x498596);dials[_0x6e74('0x40')](_0x498596);}catch(_0xb30014){utils[_0x6e74('0x15')](util['format'](_0x6e74('0x3f'),_0x498596[_0x6e74('0x1d')]),_0xb30014);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index cda8c08..a4b69a0 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 _0x4c91=['[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','destination','[%s][members][cdr]','lodash','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','state','INUSE','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]'];(function(_0x3ddb52,_0x7790cf){var _0x378940=function(_0x49dbbb){while(--_0x49dbbb){_0x3ddb52['push'](_0x3ddb52['shift']());}};_0x378940(++_0x7790cf);}(_0x4c91,0x161));var _0x14c9=function(_0x2fda14,_0x48d5d6){_0x2fda14=_0x2fda14-0x0;var _0x2ad21f=_0x4c91[_0x2fda14];return _0x2ad21f;};'use strict';var _=require(_0x14c9('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x14c9('0x1'),_0x14c9('0x2')];function writeDB(_0x192b1c){utils[_0x14c9('0x3')](util[_0x14c9('0x4')](_0x14c9('0x5'),_0x192b1c['uniqueid'],_0x192b1c[_0x14c9('0x6')],_0x192b1c[_0x14c9('0x7')],_0x192b1c[_0x14c9('0x8')],_0x192b1c[_0x14c9('0x9')],_0x192b1c[_0x14c9('0xa')]));if(_0x192b1c['interface']){utils[_0x14c9('0xb')](_0x192b1c[_0x14c9('0x6')])[_0x14c9('0xc')](function(_0x3054ad){if(_0x3054ad){_0x192b1c['membername']=_0x3054ad[_0x14c9('0xd')];_0x192b1c[_0x14c9('0xe')]=_0x3054ad[_0x14c9('0xe')];utils[_0x14c9('0xf')](_0x14c9('0x10'),_0x192b1c);}else{utils[_0x14c9('0x11')](_0x192b1c[_0x14c9('0x6')][_0x14c9('0x12')]('/')[0x1])['then'](function(_0x5819ed){if(_0x5819ed){_0x192b1c[_0x14c9('0x9')]=_0x5819ed[_0x14c9('0xd')];_0x192b1c[_0x14c9('0xe')]=_0x5819ed[_0x14c9('0xe')];utils[_0x14c9('0xf')]('CreateMemberReport',_0x192b1c);}});}})['catch'](function(_0x1f06d2){utils[_0x14c9('0x13')](util[_0x14c9('0x4')](_0x14c9('0x14'),_0x192b1c['uniqueid']),_0x1f06d2);});}delete members[_0x192b1c[_0x14c9('0x6')]];}function startsWith(_0x46a16b,_0x45825a){return _['some'](_0x46a16b,function(_0x450264){return _[_0x14c9('0x15')](_0x45825a,_0x450264);});}exports[_0x14c9('0x16')]=function(_0x526b10){try{utils[_0x14c9('0x17')](util[_0x14c9('0x4')](_0x14c9('0x18'),members[_0x526b10[_0x14c9('0x19')]]?members[_0x526b10[_0x14c9('0x19')]][_0x14c9('0x1a')]:_0x526b10[_0x14c9('0x19')]),_0x526b10);utils['info'](util[_0x14c9('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x526b10[_0x14c9('0x19')]]?members[_0x526b10[_0x14c9('0x19')]][_0x14c9('0x1a')]:_0x526b10[_0x14c9('0x19')],_0x526b10[_0x14c9('0x1b')],_0x526b10[_0x14c9('0x19')]));switch(_0x526b10[_0x14c9('0x1b')]){case _0x14c9('0x1c'):case'BUSY':if(!startsWith(exclude,_0x526b10['device'])){members[_0x526b10[_0x14c9('0x19')]]={'channel':_0x14c9('0x1d'),'interface':_0x526b10[_0x14c9('0x19')],'type':_0x14c9('0x1e'),'enterAt':utils[_0x14c9('0x1f')](),'role':_0x14c9('0x20')};}break;case'NOT_INUSE':if(!_[_0x14c9('0x21')](members[_0x526b10[_0x14c9('0x19')]])){members[_0x526b10[_0x14c9('0x19')]][_0x14c9('0x22')]=utils['now']();members[_0x526b10[_0x14c9('0x19')]][_0x14c9('0x23')]=utils[_0x14c9('0x24')](members[_0x526b10['device']][_0x14c9('0x22')],members[_0x526b10[_0x14c9('0x19')]][_0x14c9('0x25')]);if(members[_0x526b10[_0x14c9('0x19')]]['uniqueid']){writeDB(members[_0x526b10[_0x14c9('0x19')]]);}}break;default:break;}}catch(_0x17dae3){utils[_0x14c9('0x13')](util[_0x14c9('0x4')]('[%s][members][devicestatechange]',members[_0x526b10[_0x14c9('0x19')]]?members[_0x526b10[_0x14c9('0x19')]][_0x14c9('0x1a')]:_0x526b10['device']),_0x17dae3);}};exports['agentcomplete']=function(_0x7f394e){try{if(!_[_0x14c9('0x21')](members[_0x7f394e['interface']])){utils['debug'](util[_0x14c9('0x4')](_0x14c9('0x26'),_0x7f394e[_0x14c9('0x1a')]),_0x7f394e);utils[_0x14c9('0x3')](util['format'](_0x14c9('0x27'),_0x7f394e['uniqueid'],_0x7f394e[_0x14c9('0x6')],_0x7f394e['queue']));members[_0x7f394e[_0x14c9('0x6')]]=_[_0x14c9('0x28')](members[_0x7f394e[_0x14c9('0x6')]],{'data4':_0x7f394e[_0x14c9('0x29')],'uniqueid':_0x7f394e[_0x14c9('0x1a')]});}}catch(_0x5533a6){utils['error'](util[_0x14c9('0x4')](_0x14c9('0x26'),_0x7f394e['uniqueid']),_0x5533a6);}};exports['cdr']=function(_0xaba681){try{utils[_0x14c9('0x17')](util['format']('[%s][members][cdr]',_0xaba681[_0x14c9('0x1a')]),_0xaba681);if(_0xaba681[_0x14c9('0x7')]){var _0x32f8d2=_0xaba681[_0x14c9('0x7')]['split']('-')[0x0];if(!_[_0x14c9('0x21')](members[_0x32f8d2])){members[_0x32f8d2]=_[_0x14c9('0x28')](members[_0x32f8d2],{'data1':members[_0x32f8d2]['data1']||_0xaba681[_0x14c9('0xa')],'data2':members[_0x32f8d2][_0x14c9('0x8')]||_0xaba681[_0x14c9('0x2a')],'data3':members[_0x32f8d2][_0x14c9('0x2b')]||_0xaba681['destination'],'uniqueid':members[_0x32f8d2][_0x14c9('0x1a')]||_0xaba681['uniqueid']});utils[_0x14c9('0x3')](util['format'](_0x14c9('0x2c'),_0xaba681[_0x14c9('0x1a')],members[_0x32f8d2][_0x14c9('0x2d')],members[_0x32f8d2][_0x14c9('0x8')],members[_0x32f8d2][_0x14c9('0x2b')]));if(members[_0x32f8d2]['exitAt']){writeDB(members[_0x32f8d2]);}}}if(_0xaba681['destinationchannel']){var _0x3d761d=_0xaba681[_0x14c9('0x2e')][_0x14c9('0x12')]('-')[0x0];if(!_[_0x14c9('0x21')](members[_0x3d761d])){members[_0x3d761d]=_['assign'](members[_0x3d761d],{'data1':members[_0x3d761d][_0x14c9('0x2d')]||_0xaba681[_0x14c9('0xa')],'data2':members[_0x3d761d][_0x14c9('0x8')]||_0xaba681['source'],'data3':members[_0x3d761d][_0x14c9('0x2b')]||_0xaba681[_0x14c9('0x2f')],'uniqueid':members[_0x3d761d][_0x14c9('0x1a')]||_0xaba681[_0x14c9('0x1a')]});utils[_0x14c9('0x3')](util[_0x14c9('0x4')](_0x14c9('0x2c'),_0xaba681['uniqueid'],members[_0x3d761d][_0x14c9('0x2d')],members[_0x3d761d][_0x14c9('0x8')],members[_0x3d761d][_0x14c9('0x2b')]));if(members[_0x3d761d]['exitAt']){writeDB(members[_0x3d761d]);}}}}catch(_0x11fe14){utils[_0x14c9('0x13')](util[_0x14c9('0x4')](_0x14c9('0x30'),_0xaba681[_0x14c9('0x1a')]),_0x11fe14);}}; \ No newline at end of file +var _0xb2ff=['destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','Local/_attended@transfer','format','uniqueid','interface','channel','data2','then','membername','internal','request','getUserByName','split','name','CreateMemberReport','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','assign','data1','type','data3'];(function(_0x2d7e3e,_0x3f7fcb){var _0x15a11e=function(_0x47161a){while(--_0x47161a){_0x2d7e3e['push'](_0x2d7e3e['shift']());}};_0x15a11e(++_0x3f7fcb);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var utils=require('./utils');var members={};var exclude=[_0xfb2f('0x2'),'Queue:'];function writeDB(_0x584330){utils['info'](util[_0xfb2f('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x584330[_0xfb2f('0x4')],_0x584330[_0xfb2f('0x5')],_0x584330[_0xfb2f('0x6')],_0x584330[_0xfb2f('0x7')],_0x584330['membername'],_0x584330['type']));if(_0x584330[_0xfb2f('0x5')]){utils['getUserByInterface'](_0x584330[_0xfb2f('0x5')])[_0xfb2f('0x8')](function(_0x29e9e4){if(_0x29e9e4){_0x584330[_0xfb2f('0x9')]=_0x29e9e4['name'];_0x584330[_0xfb2f('0xa')]=_0x29e9e4['internal'];utils[_0xfb2f('0xb')]('CreateMemberReport',_0x584330);}else{utils[_0xfb2f('0xc')](_0x584330[_0xfb2f('0x5')][_0xfb2f('0xd')]('/')[0x1])[_0xfb2f('0x8')](function(_0xef9376){if(_0xef9376){_0x584330['membername']=_0xef9376[_0xfb2f('0xe')];_0x584330[_0xfb2f('0xa')]=_0xef9376[_0xfb2f('0xa')];utils[_0xfb2f('0xb')](_0xfb2f('0xf'),_0x584330);}});}})[_0xfb2f('0x10')](function(_0x36562f){utils[_0xfb2f('0x11')](util['format'](_0xfb2f('0x12'),_0x584330[_0xfb2f('0x4')]),_0x36562f);});}delete members[_0x584330[_0xfb2f('0x5')]];}function startsWith(_0xbfd8c2,_0x34a57f){return _['some'](_0xbfd8c2,function(_0xb6177a){return _[_0xfb2f('0x13')](_0x34a57f,_0xb6177a);});}exports[_0xfb2f('0x14')]=function(_0x240b79){try{utils[_0xfb2f('0x15')](util[_0xfb2f('0x3')]('[%s][members][devicestatechange]',members[_0x240b79[_0xfb2f('0x16')]]?members[_0x240b79[_0xfb2f('0x16')]]['uniqueid']:_0x240b79[_0xfb2f('0x16')]),_0x240b79);utils[_0xfb2f('0x17')](util[_0xfb2f('0x3')](_0xfb2f('0x18'),members[_0x240b79[_0xfb2f('0x16')]]?members[_0x240b79['device']]['uniqueid']:_0x240b79[_0xfb2f('0x16')],_0x240b79['state'],_0x240b79[_0xfb2f('0x16')]));switch(_0x240b79['state']){case'INUSE':case _0xfb2f('0x19'):if(!startsWith(exclude,_0x240b79[_0xfb2f('0x16')])){members[_0x240b79['device']]={'channel':_0xfb2f('0x1a'),'interface':_0x240b79[_0xfb2f('0x16')],'type':_0xfb2f('0x1b'),'enterAt':utils[_0xfb2f('0x1c')](),'role':_0xfb2f('0x1d')};}break;case'NOT_INUSE':if(!_[_0xfb2f('0x1e')](members[_0x240b79[_0xfb2f('0x16')]])){members[_0x240b79['device']][_0xfb2f('0x1f')]=utils['now']();members[_0x240b79[_0xfb2f('0x16')]][_0xfb2f('0x20')]=utils[_0xfb2f('0x21')](members[_0x240b79[_0xfb2f('0x16')]][_0xfb2f('0x1f')],members[_0x240b79['device']][_0xfb2f('0x22')]);if(members[_0x240b79[_0xfb2f('0x16')]][_0xfb2f('0x4')]){writeDB(members[_0x240b79[_0xfb2f('0x16')]]);}}break;default:break;}}catch(_0x464909){utils[_0xfb2f('0x11')](util['format'](_0xfb2f('0x23'),members[_0x240b79[_0xfb2f('0x16')]]?members[_0x240b79[_0xfb2f('0x16')]][_0xfb2f('0x4')]:_0x240b79['device']),_0x464909);}};exports['agentcomplete']=function(_0xef637a){try{if(!_[_0xfb2f('0x1e')](members[_0xef637a[_0xfb2f('0x5')]])){utils['debug'](util[_0xfb2f('0x3')]('[%s][members][agentcomplete]',_0xef637a['uniqueid']),_0xef637a);utils[_0xfb2f('0x17')](util['format'](_0xfb2f('0x24'),_0xef637a[_0xfb2f('0x4')],_0xef637a[_0xfb2f('0x5')],_0xef637a[_0xfb2f('0x25')]));members[_0xef637a[_0xfb2f('0x5')]]=_['assign'](members[_0xef637a[_0xfb2f('0x5')]],{'data4':_0xef637a[_0xfb2f('0x25')],'uniqueid':_0xef637a['uniqueid']});}}catch(_0x5de0ff){utils['error'](util[_0xfb2f('0x3')](_0xfb2f('0x26'),_0xef637a[_0xfb2f('0x4')]),_0x5de0ff);}};exports[_0xfb2f('0x27')]=function(_0x2421f8){try{utils[_0xfb2f('0x15')](util[_0xfb2f('0x3')](_0xfb2f('0x28'),_0x2421f8[_0xfb2f('0x4')]),_0x2421f8);if(_0x2421f8[_0xfb2f('0x6')]){var _0x351412=_0x2421f8[_0xfb2f('0x6')][_0xfb2f('0xd')]('-')[0x0];if(!_['isNil'](members[_0x351412])){members[_0x351412]=_[_0xfb2f('0x29')](members[_0x351412],{'data1':members[_0x351412][_0xfb2f('0x2a')]||_0x2421f8[_0xfb2f('0x2b')],'data2':members[_0x351412][_0xfb2f('0x7')]||_0x2421f8['source'],'data3':members[_0x351412][_0xfb2f('0x2c')]||_0x2421f8[_0xfb2f('0x2d')],'uniqueid':members[_0x351412][_0xfb2f('0x4')]||_0x2421f8[_0xfb2f('0x4')]});utils[_0xfb2f('0x17')](util['format'](_0xfb2f('0x2e'),_0x2421f8[_0xfb2f('0x4')],members[_0x351412][_0xfb2f('0x2a')],members[_0x351412][_0xfb2f('0x7')],members[_0x351412]['data3']));if(members[_0x351412][_0xfb2f('0x1f')]){writeDB(members[_0x351412]);}}}if(_0x2421f8[_0xfb2f('0x2f')]){var _0x12d2aa=_0x2421f8[_0xfb2f('0x2f')]['split']('-')[0x0];if(!_[_0xfb2f('0x1e')](members[_0x12d2aa])){members[_0x12d2aa]=_[_0xfb2f('0x29')](members[_0x12d2aa],{'data1':members[_0x12d2aa][_0xfb2f('0x2a')]||_0x2421f8['type'],'data2':members[_0x12d2aa]['data2']||_0x2421f8['source'],'data3':members[_0x12d2aa]['data3']||_0x2421f8['destination'],'uniqueid':members[_0x12d2aa][_0xfb2f('0x4')]||_0x2421f8[_0xfb2f('0x4')]});utils[_0xfb2f('0x17')](util['format'](_0xfb2f('0x2e'),_0x2421f8[_0xfb2f('0x4')],members[_0x12d2aa][_0xfb2f('0x2a')],members[_0x12d2aa][_0xfb2f('0x7')],members[_0x12d2aa][_0xfb2f('0x2c')]));if(members[_0x12d2aa][_0xfb2f('0x1f')]){writeDB(members[_0x12d2aa]);}}}}catch(_0x229311){utils[_0xfb2f('0x11')](util[_0xfb2f('0x3')]('[%s][members][cdr]',_0x2421f8[_0xfb2f('0x4')]),_0x229311);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 33360f3..209ee5e 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 _0xa7c8=['then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','error','[%s][queues][queuecallerjoin]','hangup','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','name','variable','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','position','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','queuecallerenterreason','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode'];(function(_0x2fef43,_0x2b366d){var _0xdb9a84=function(_0x4678b0){while(--_0x4678b0){_0x2fef43['push'](_0x2fef43['shift']());}};_0xdb9a84(++_0x2b366d);}(_0xa7c8,0x1a1));var _0x8a7c=function(_0x4d42d6,_0x37fb2c){_0x4d42d6=_0x4d42d6-0x0;var _0x15c0ba=_0xa7c8[_0x4d42d6];return _0x15c0ba;};'use strict';var _=require(_0x8a7c('0x0'));var util=require(_0x8a7c('0x1'));var utils=require(_0x8a7c('0x2'));var queues={};function writeDB(_0x3958af){utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3958af[_0x8a7c('0x5')],_0x3958af[_0x8a7c('0x6')],_0x3958af[_0x8a7c('0x7')],_0x3958af[_0x8a7c('0x8')],_0x3958af[_0x8a7c('0x9')],_0x3958af[_0x8a7c('0xa')],_0x3958af['queuecallerexitreason']));if(_0x3958af[_0x8a7c('0x7')]){utils['getVoiceQueueByName'](_0x3958af[_0x8a7c('0x7')])[_0x8a7c('0xb')](function(_0x4cce67){if(_0x4cce67){_0x3958af['type']=_0x4cce67['type'];}utils[_0x8a7c('0xc')](_0x8a7c('0xd'),_0x3958af);});}else{utils[_0x8a7c('0xc')]('CreateVoiceQueueReport',_0x3958af);}if(_0x3958af[_0x8a7c('0xe')]){delete queues[_0x3958af['transfereduniqueid']];}else{delete queues[_0x3958af[_0x8a7c('0x5')]];}}exports[_0x8a7c('0xf')]=function(_0x1e8c52){try{utils[_0x8a7c('0x10')](util['format']('[%s][queues][queuecallerjoin]',_0x1e8c52['uniqueid']),_0x1e8c52);utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x11'),_0x1e8c52[_0x8a7c('0x5')],_0x1e8c52[_0x8a7c('0x7')],_0x1e8c52['position']));queues[_0x1e8c52[_0x8a7c('0x5')]]=_[_0x8a7c('0x12')](_0x1e8c52,{'originalposition':_0x1e8c52['position'],'queuecallerjoinAt':utils[_0x8a7c('0x13')](),'mohtime':0x0});}catch(_0x2ddf32){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')](_0x8a7c('0x15'),_0x1e8c52[_0x8a7c('0x5')]),_0x2ddf32);}};exports[_0x8a7c('0x16')]=function(_0x4f1ee9){try{if(!_['isNil'](queues[_0x4f1ee9['uniqueid']])){utils[_0x8a7c('0x10')](util[_0x8a7c('0x4')]('[%s][queues][hangup]',_0x4f1ee9[_0x8a7c('0x5')]),_0x4f1ee9);if(queues[_0x4f1ee9[_0x8a7c('0x5')]][_0x8a7c('0x17')]){if(!queues[_0x4f1ee9[_0x8a7c('0x5')]][_0x8a7c('0x18')]&&!queues[_0x4f1ee9[_0x8a7c('0x5')]]['queuecallerexit']){queues[_0x4f1ee9['uniqueid']][_0x8a7c('0x19')]=!![];queues[_0x4f1ee9[_0x8a7c('0x5')]][_0x8a7c('0x1a')]=utils[_0x8a7c('0x13')]();queues[_0x4f1ee9[_0x8a7c('0x5')]][_0x8a7c('0x1b')]=_0x8a7c('0x1c');}utils['info'](util[_0x8a7c('0x4')](_0x8a7c('0x1d'),_0x4f1ee9[_0x8a7c('0x5')],queues[_0x4f1ee9[_0x8a7c('0x5')]]['name'],queues[_0x4f1ee9[_0x8a7c('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x4f1ee9[_0x8a7c('0x5')]]);}else if(queues[_0x4f1ee9[_0x8a7c('0x5')]][_0x8a7c('0xe')]){utils['info'](util[_0x8a7c('0x4')](_0x8a7c('0x1e'),_0x4f1ee9[_0x8a7c('0x5')],queues[_0x4f1ee9['uniqueid']]['name'],queues[_0x4f1ee9['uniqueid']][_0x8a7c('0xe')]));queues[queues[_0x4f1ee9['uniqueid']][_0x8a7c('0xe')]]=queues[_0x4f1ee9[_0x8a7c('0x5')]];queues[queues[_0x4f1ee9[_0x8a7c('0x5')]][_0x8a7c('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x4f1ee9[_0x8a7c('0x5')]];}}}catch(_0xe82e5f){utils[_0x8a7c('0x14')](util['format'](_0x8a7c('0x1f'),_0x4f1ee9[_0x8a7c('0x5')]),_0xe82e5f);}};exports[_0x8a7c('0x20')]=function(_0x36327c){try{utils['debug'](util[_0x8a7c('0x4')](_0x8a7c('0x21'),_0x36327c['uniqueid']),_0x36327c);if(!_[_0x8a7c('0x22')](_0x36327c['variable'][_0x8a7c('0x23')])&&_0x36327c[_0x8a7c('0x24')][_0x8a7c('0x25')]()!==_0x8a7c('0x26')){if(!_[_0x8a7c('0x22')](queues[_0x36327c[_0x8a7c('0x5')]])){queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x18')]=![];queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x27')]=null;queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x28')]=!![];queues[_0x36327c[_0x8a7c('0x5')]]['queuecallerexitAt']=utils[_0x8a7c('0x13')]();queues[_0x36327c['uniqueid']][_0x8a7c('0x1b')]=_0x36327c[_0x8a7c('0x24')][_0x8a7c('0x25')]();utils['info'](util[_0x8a7c('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x36327c['uniqueid'],queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x29')],_0x36327c[_0x8a7c('0x24')],queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x1b')]));writeDB(queues[_0x36327c[_0x8a7c('0x5')]]);}}else if(!_[_0x8a7c('0x22')](_0x36327c[_0x8a7c('0x2a')][_0x8a7c('0x2b')])){if(!_[_0x8a7c('0x22')](queues[_0x36327c['uniqueid']])&&!queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x18')]){queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x18')]=![];queues[_0x36327c['uniqueid']]['queuecallerabandonAt']=null;queues[_0x36327c['uniqueid']][_0x8a7c('0x28')]=!![];queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x2c')]=utils[_0x8a7c('0x13')]();queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x1b')]=_0x8a7c('0x2d');utils[_0x8a7c('0x3')](util['format'](_0x8a7c('0x2e'),_0x36327c[_0x8a7c('0x5')],queues[_0x36327c[_0x8a7c('0x5')]][_0x8a7c('0x29')],_0x36327c['value'],queues[_0x36327c[_0x8a7c('0x5')]]['queuecallerexitreason']));}}}catch(_0x2980db){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')]('[%s][queues][varset]',_0x36327c[_0x8a7c('0x5')]),_0x2980db);}};exports['queuecallerabandon']=function(_0x3ed0ee){try{if(!_['isNil'](queues[_0x3ed0ee['uniqueid']])){utils[_0x8a7c('0x10')](util[_0x8a7c('0x4')](_0x8a7c('0x2f'),_0x3ed0ee[_0x8a7c('0x5')]),_0x3ed0ee);queues[_0x3ed0ee[_0x8a7c('0x5')]][_0x8a7c('0x28')]=![];queues[_0x3ed0ee[_0x8a7c('0x5')]][_0x8a7c('0x2c')]=null;queues[_0x3ed0ee[_0x8a7c('0x5')]]['queuecallerabandon']=!![];queues[_0x3ed0ee[_0x8a7c('0x5')]][_0x8a7c('0x27')]=utils[_0x8a7c('0x13')]();queues[_0x3ed0ee[_0x8a7c('0x5')]]['queuecallerexitreason']=_0x8a7c('0x30');utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x31'),_0x3ed0ee[_0x8a7c('0x5')],queues[_0x3ed0ee[_0x8a7c('0x5')]][_0x8a7c('0x29')],queues[_0x3ed0ee['uniqueid']]['queuecallerexitreason']));}}catch(_0x52b8b8){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')](_0x8a7c('0x2f'),_0x3ed0ee[_0x8a7c('0x5')]),_0x52b8b8);}};exports[_0x8a7c('0x32')]=function(_0x5a618e){try{if(!_['isNil'](queues[_0x5a618e['uniqueid']])){utils[_0x8a7c('0x10')](util[_0x8a7c('0x4')](_0x8a7c('0x33'),_0x5a618e[_0x8a7c('0x5')]),_0x5a618e);utils[_0x8a7c('0x3')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5a618e[_0x8a7c('0x5')],queues[_0x5a618e[_0x8a7c('0x5')]][_0x8a7c('0x29')],_0x5a618e[_0x8a7c('0x34')],_0x5a618e[_0x8a7c('0x35')]));queues[_0x5a618e['uniqueid']][_0x8a7c('0x32')]=!![];queues[_0x5a618e[_0x8a7c('0x5')]][_0x8a7c('0x17')]=utils[_0x8a7c('0x13')]();queues[_0x5a618e[_0x8a7c('0x5')]][_0x8a7c('0x36')]=utils[_0x8a7c('0x37')](queues[_0x5a618e['uniqueid']][_0x8a7c('0x17')],queues[_0x5a618e[_0x8a7c('0x5')]][_0x8a7c('0x38')]);queues[_0x5a618e[_0x8a7c('0x5')]][_0x8a7c('0x39')]=_0x5a618e[_0x8a7c('0x39')];queues[_0x5a618e[_0x8a7c('0x5')]][_0x8a7c('0x3a')]=_0x5a618e[_0x8a7c('0x3a')];queues[_0x5a618e['uniqueid']][_0x8a7c('0x34')]=_0x5a618e['connectedlinenum'];queues[_0x5a618e[_0x8a7c('0x5')]][_0x8a7c('0x35')]=_0x5a618e[_0x8a7c('0x35')];}}catch(_0x469604){utils['error'](util[_0x8a7c('0x4')](_0x8a7c('0x33'),_0x5a618e[_0x8a7c('0x5')]),_0x469604);}};exports['agentconnect']=function(_0x158d44){try{if(!_[_0x8a7c('0x22')](queues[_0x158d44[_0x8a7c('0x5')]])){utils[_0x8a7c('0x10')](util[_0x8a7c('0x4')](_0x8a7c('0x3b'),_0x158d44[_0x8a7c('0x5')]),_0x158d44);utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x3c'),_0x158d44[_0x8a7c('0x5')],queues[_0x158d44['uniqueid']][_0x8a7c('0x29')],_0x158d44[_0x8a7c('0x3d')],_0x158d44[_0x8a7c('0x3e')]));queues[_0x158d44['uniqueid']][_0x8a7c('0x18')]=![];queues[_0x158d44[_0x8a7c('0x5')]]['queuecallerabandon']=![];queues[_0x158d44['uniqueid']][_0x8a7c('0x27')]=null;queues[_0x158d44['uniqueid']]['queuecallerexit']=![];queues[_0x158d44[_0x8a7c('0x5')]][_0x8a7c('0x1b')]=null;queues[_0x158d44[_0x8a7c('0x5')]][_0x8a7c('0x2c')]=null;queues[_0x158d44[_0x8a7c('0x5')]][_0x8a7c('0x3f')]=!![];queues[_0x158d44[_0x8a7c('0x5')]][_0x8a7c('0xa')]=_0x158d44[_0x8a7c('0x3e')];queues[_0x158d44[_0x8a7c('0x5')]][_0x8a7c('0x8')]=_0x158d44[_0x8a7c('0x3d')];}}catch(_0x585a45){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')](_0x8a7c('0x3b'),_0x158d44['uniqueid']),_0x585a45);}};exports[_0x8a7c('0x40')]=function(_0xf454be){try{if(!_[_0x8a7c('0x22')](queues[_0xf454be[_0x8a7c('0x5')]])){if(queues[_0xf454be['uniqueid']]['queuecallerleaveAt']){utils[_0x8a7c('0x10')](util[_0x8a7c('0x4')]('[%s][queues][agentcomplete]',_0xf454be[_0x8a7c('0x5')]),_0xf454be);queues[_0xf454be['uniqueid']]['queuecallerabandon']=![];queues[_0xf454be['uniqueid']]['queuecallerabandon']=![];queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x27')]=null;queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x28')]=![];queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x2c')]=null;queues[_0xf454be['uniqueid']][_0x8a7c('0x3f')]=!![];queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x8')]=_0xf454be[_0x8a7c('0x3d')];queues[_0xf454be['uniqueid']][_0x8a7c('0x19')]=!![];queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x1a')]=utils[_0x8a7c('0x13')]();if(_0xf454be[_0x8a7c('0x41')]==_0x8a7c('0x42')){if(!queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x42')]){queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x1b')]='TRANSFER';}}else{queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x1b')]=_0x8a7c('0x43')+_0xf454be[_0x8a7c('0x41')][_0x8a7c('0x25')]();}utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x44'),_0xf454be[_0x8a7c('0x5')],queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x29')],_0xf454be[_0x8a7c('0x3d')],queues[_0xf454be[_0x8a7c('0x5')]][_0x8a7c('0x1b')]));writeDB(queues[_0xf454be[_0x8a7c('0x5')]]);}}}catch(_0x501c54){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')](_0x8a7c('0x45'),_0xf454be[_0x8a7c('0x5')]),_0x501c54);}};exports[_0x8a7c('0x46')]=function(_0x1ac968){try{if(!_[_0x8a7c('0x22')](queues[_0x1ac968['transfereeuniqueid']])){utils['debug'](util[_0x8a7c('0x4')](_0x8a7c('0x47'),_0x1ac968[_0x8a7c('0x5')]),_0x1ac968);queues[_0x1ac968[_0x8a7c('0x48')]]['transfer']=!![];queues[_0x1ac968[_0x8a7c('0x48')]][_0x8a7c('0x49')]=_0x8a7c('0x4a');queues[_0x1ac968['transfereeuniqueid']][_0x8a7c('0x4b')]=_0x1ac968[_0x8a7c('0x4c')];queues[_0x1ac968['transfereeuniqueid']]['transferuniqueid']=_0x1ac968[_0x8a7c('0x48')];queues[_0x1ac968[_0x8a7c('0x48')]][_0x8a7c('0x1b')]=_0x8a7c('0x4d');utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x4e'),_0x1ac968[_0x8a7c('0x5')],queues[_0x1ac968[_0x8a7c('0x48')]][_0x8a7c('0x29')],_0x1ac968[_0x8a7c('0x48')],_0x1ac968[_0x8a7c('0x4c')]));}}catch(_0x4a485c){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')]('[%s][queues][blindtransfer]',_0x1ac968[_0x8a7c('0x5')]),_0x4a485c);}};exports[_0x8a7c('0x4f')]=function(_0x46e544){try{utils['debug'](util[_0x8a7c('0x4')](_0x8a7c('0x50'),_0x46e544[_0x8a7c('0x51')]),_0x46e544);if(_0x46e544[_0x8a7c('0x51')]==_0x46e544[_0x8a7c('0x52')]){if(!_[_0x8a7c('0x22')](queues[_0x46e544[_0x8a7c('0x53')]])){utils[_0x8a7c('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x46e544[_0x8a7c('0x51')],queues[_0x46e544[_0x8a7c('0x53')]]['name'],_0x46e544[_0x8a7c('0x54')]));queues[_0x46e544['secondtransfererlinkedid']][_0x8a7c('0x42')]=!![];queues[_0x46e544[_0x8a7c('0x53')]][_0x8a7c('0x49')]=_0x8a7c('0x55');queues[_0x46e544[_0x8a7c('0x53')]][_0x8a7c('0x4b')]=_0x46e544[_0x8a7c('0x54')];queues[_0x46e544[_0x8a7c('0x53')]][_0x8a7c('0x56')]=_0x46e544[_0x8a7c('0x51')];queues[_0x46e544[_0x8a7c('0x53')]]['queuecallerexitreason']=_0x8a7c('0x57');}if(!_[_0x8a7c('0x22')](queues[_0x46e544['origtransfererlinkedid']])){if(_0x46e544[_0x8a7c('0x58')]&&queues[_0x46e544[_0x8a7c('0x58')]]){queues[_0x46e544[_0x8a7c('0x58')]]['queuecallerenterreason']=0x1;queues[_0x46e544[_0x8a7c('0x48')]]=_[_0x8a7c('0x59')](queues[_0x46e544[_0x8a7c('0x58')]]);queues[_0x46e544['transfereeuniqueid']][_0x8a7c('0xe')]=_0x46e544['transfertargetuniqueid'];queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x5a')]=0x2;queues[_0x46e544[_0x8a7c('0x48')]]['calleridnum']=queues[_0x46e544[_0x8a7c('0x53')]][_0x8a7c('0x9')];queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x5b')]=queues[_0x46e544['secondtransfererlinkedid']]['calleridname'];queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x38')]=utils[_0x8a7c('0x13')]();queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x17')]=utils[_0x8a7c('0x13')]();queues[_0x46e544[_0x8a7c('0x48')]]['holdtime']=0x0;queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x5c')]=0x0;utils[_0x8a7c('0x3')](util['format'](_0x8a7c('0x5d'),_0x46e544['origtransfereruniqueid'],queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x29')],queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x9')],queues[_0x46e544[_0x8a7c('0x48')]][_0x8a7c('0x5b')]));}else{utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x5e'),_0x46e544[_0x8a7c('0x51')],queues[_0x46e544[_0x8a7c('0x52')]]['name'],_0x46e544['secondtransfererlinkedid']));queues[_0x46e544[_0x8a7c('0x52')]][_0x8a7c('0xe')]=_0x46e544[_0x8a7c('0x53')];}}}else if(_0x46e544[_0x8a7c('0x5f')]==_0x46e544[_0x8a7c('0x53')]){if(!_[_0x8a7c('0x22')](queues[_0x46e544[_0x8a7c('0x52')]])){utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x60'),_0x46e544[_0x8a7c('0x51')],queues[_0x46e544[_0x8a7c('0x52')]][_0x8a7c('0x29')],_0x46e544[_0x8a7c('0x5f')],_0x46e544[_0x8a7c('0x61')]));queues[_0x46e544['origtransfererlinkedid']][_0x8a7c('0x42')]=!![];queues[_0x46e544[_0x8a7c('0x52')]][_0x8a7c('0x49')]=_0x8a7c('0x55');queues[_0x46e544['origtransfererlinkedid']]['transferexten']=_0x46e544[_0x8a7c('0x61')];queues[_0x46e544[_0x8a7c('0x52')]]['transferuniqueid']=_0x46e544[_0x8a7c('0x5f')];queues[_0x46e544[_0x8a7c('0x52')]][_0x8a7c('0x1b')]=_0x8a7c('0x57');}if(!_[_0x8a7c('0x22')](queues[_0x46e544['secondtransfererlinkedid']])){if(_0x46e544[_0x8a7c('0x62')]&&queues[_0x46e544['transfertargetlinkedid']]){queues[_0x46e544[_0x8a7c('0x62')]]['queuecallerenterreason']=0x1;queues[_0x46e544[_0x8a7c('0x63')]]=_[_0x8a7c('0x59')](queues[_0x46e544[_0x8a7c('0x62')]]);queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0xe')]=_0x46e544[_0x8a7c('0x63')];queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x5a')]=0x2;queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x9')]=queues[_0x46e544[_0x8a7c('0x52')]][_0x8a7c('0x9')];queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x5b')]=queues[_0x46e544[_0x8a7c('0x52')]][_0x8a7c('0x5b')];queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x38')]=utils['now']();queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x17')]=utils[_0x8a7c('0x13')]();queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x36')]=0x0;queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x5c')]=0x0;utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x64'),_0x46e544[_0x8a7c('0x51')],queues[_0x46e544['transfertargetuniqueid']][_0x8a7c('0x29')],queues[_0x46e544['transfertargetuniqueid']][_0x8a7c('0xe')],queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x9')],queues[_0x46e544[_0x8a7c('0x63')]][_0x8a7c('0x5b')]));}else{utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x46e544['origtransfereruniqueid'],queues[_0x46e544[_0x8a7c('0x53')]][_0x8a7c('0x29')],_0x46e544[_0x8a7c('0x52')]));queues[_0x46e544[_0x8a7c('0x53')]][_0x8a7c('0xe')]=_0x46e544[_0x8a7c('0x52')];}}}}catch(_0x570f43){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')](_0x8a7c('0x50'),_0x46e544[_0x8a7c('0x51')]),_0x570f43);}};exports[_0x8a7c('0x65')]=function(_0x22436a){try{if(!_[_0x8a7c('0x22')](queues[_0x22436a[_0x8a7c('0x5')]])){utils['debug'](util[_0x8a7c('0x4')](_0x8a7c('0x66'),_0x22436a['uniqueid']),_0x22436a);queues[_0x22436a[_0x8a7c('0x5')]]['musiconholdstartAt']=utils[_0x8a7c('0x13')]();utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x22436a[_0x8a7c('0x5')],queues[_0x22436a['uniqueid']][_0x8a7c('0x29')],queues[_0x22436a[_0x8a7c('0x5')]][_0x8a7c('0x67')]));}}catch(_0x58ac97){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')](_0x8a7c('0x66'),_0x22436a[_0x8a7c('0x5')]),_0x58ac97);}};exports[_0x8a7c('0x68')]=function(_0x16ae66){try{if(!_[_0x8a7c('0x22')](queues[_0x16ae66['uniqueid']])){if(!_[_0x8a7c('0x22')](queues[_0x16ae66[_0x8a7c('0x5')]][_0x8a7c('0x67')])){utils['debug'](util['format'](_0x8a7c('0x69'),_0x16ae66[_0x8a7c('0x5')]),_0x16ae66);queues[_0x16ae66[_0x8a7c('0x5')]][_0x8a7c('0x5c')]+=utils['diffTime'](utils[_0x8a7c('0x13')](),queues[_0x16ae66[_0x8a7c('0x5')]][_0x8a7c('0x67')]);utils[_0x8a7c('0x3')](util[_0x8a7c('0x4')](_0x8a7c('0x6a'),_0x16ae66[_0x8a7c('0x5')],queues[_0x16ae66[_0x8a7c('0x5')]][_0x8a7c('0x29')],queues[_0x16ae66[_0x8a7c('0x5')]]['mohtime']));delete queues[_0x16ae66[_0x8a7c('0x5')]][_0x8a7c('0x67')];}}}catch(_0x5a21d3){utils[_0x8a7c('0x14')](util[_0x8a7c('0x4')](_0x8a7c('0x69'),_0x16ae66[_0x8a7c('0x5')]),_0x5a21d3);}}; \ No newline at end of file +var _0x046d=['assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','queueposition','EXITWITHKEY','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','accountcode','destaccountcode','membername','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','info','position'];(function(_0x433ced,_0x224f23){var _0x248cf7=function(_0x419d02){while(--_0x419d02){_0x433ced['push'](_0x433ced['shift']());}};_0x248cf7(++_0x224f23);}(_0x046d,0x11e));var _0xd046=function(_0x59ecf9,_0x9a29d){_0x59ecf9=_0x59ecf9-0x0;var _0x3c68c1=_0x046d[_0x59ecf9];return _0x3c68c1;};'use strict';var _=require(_0xd046('0x0'));var util=require(_0xd046('0x1'));var utils=require(_0xd046('0x2'));var queues={};function writeDB(_0x37379b){utils['info'](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x37379b[_0xd046('0x3')],_0x37379b[_0xd046('0x4')],_0x37379b[_0xd046('0x5')],_0x37379b[_0xd046('0x6')],_0x37379b[_0xd046('0x7')],_0x37379b['accountcode'],_0x37379b[_0xd046('0x8')]));if(_0x37379b['queue']){utils[_0xd046('0x9')](_0x37379b[_0xd046('0x5')])[_0xd046('0xa')](function(_0x4df0bf){if(_0x4df0bf){_0x37379b[_0xd046('0xb')]=_0x4df0bf['type'];}utils[_0xd046('0xc')](_0xd046('0xd'),_0x37379b);});}else{utils[_0xd046('0xc')](_0xd046('0xd'),_0x37379b);}if(_0x37379b[_0xd046('0xe')]){delete queues[_0x37379b[_0xd046('0xe')]];}else{delete queues[_0x37379b['uniqueid']];}}exports[_0xd046('0xf')]=function(_0x32ec22){try{utils[_0xd046('0x10')](util[_0xd046('0x11')]('[%s][queues][queuecallerjoin]',_0x32ec22[_0xd046('0x3')]),_0x32ec22);utils[_0xd046('0x12')](util[_0xd046('0x11')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x32ec22[_0xd046('0x3')],_0x32ec22['queue'],_0x32ec22[_0xd046('0x13')]));queues[_0x32ec22['uniqueid']]=_[_0xd046('0x14')](_0x32ec22,{'originalposition':_0x32ec22[_0xd046('0x13')],'queuecallerjoinAt':utils[_0xd046('0x15')](),'mohtime':0x0});}catch(_0xd6e4aa){utils[_0xd046('0x16')](util[_0xd046('0x11')]('[%s][queues][queuecallerjoin]',_0x32ec22[_0xd046('0x3')]),_0xd6e4aa);}};exports[_0xd046('0x17')]=function(_0x8522e9){try{if(!_[_0xd046('0x18')](queues[_0x8522e9[_0xd046('0x3')]])){utils[_0xd046('0x10')](util[_0xd046('0x11')](_0xd046('0x19'),_0x8522e9[_0xd046('0x3')]),_0x8522e9);if(queues[_0x8522e9['uniqueid']][_0xd046('0x1a')]){if(!queues[_0x8522e9[_0xd046('0x3')]]['queuecallerabandon']&&!queues[_0x8522e9['uniqueid']][_0xd046('0x1b')]){queues[_0x8522e9[_0xd046('0x3')]][_0xd046('0x1c')]=!![];queues[_0x8522e9[_0xd046('0x3')]][_0xd046('0x1d')]=utils[_0xd046('0x15')]();queues[_0x8522e9['uniqueid']][_0xd046('0x8')]=_0xd046('0x1e');}utils[_0xd046('0x12')](util[_0xd046('0x11')](_0xd046('0x1f'),_0x8522e9[_0xd046('0x3')],queues[_0x8522e9['uniqueid']][_0xd046('0x20')],queues[_0x8522e9['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x8522e9[_0xd046('0x3')]]);}else if(queues[_0x8522e9[_0xd046('0x3')]][_0xd046('0xe')]){utils['info'](util[_0xd046('0x11')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x8522e9[_0xd046('0x3')],queues[_0x8522e9[_0xd046('0x3')]][_0xd046('0x20')],queues[_0x8522e9['uniqueid']][_0xd046('0xe')]));queues[queues[_0x8522e9[_0xd046('0x3')]][_0xd046('0xe')]]=queues[_0x8522e9[_0xd046('0x3')]];queues[queues[_0x8522e9[_0xd046('0x3')]][_0xd046('0xe')]][_0xd046('0x21')]=0x2;delete queues[_0x8522e9[_0xd046('0x3')]];}}}catch(_0xba6ce1){utils[_0xd046('0x16')](util[_0xd046('0x11')](_0xd046('0x19'),_0x8522e9['uniqueid']),_0xba6ce1);}};exports['varset']=function(_0x4cccce){try{utils[_0xd046('0x10')](util[_0xd046('0x11')]('[%s][queues][varset]',_0x4cccce[_0xd046('0x3')]),_0x4cccce);if(!_[_0xd046('0x18')](_0x4cccce[_0xd046('0x22')][_0xd046('0x23')])&&_0x4cccce[_0xd046('0x24')][_0xd046('0x25')]()!==_0xd046('0x26')){if(!_[_0xd046('0x18')](queues[_0x4cccce[_0xd046('0x3')]])){queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x27')]=![];queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x28')]=null;queues[_0x4cccce[_0xd046('0x3')]]['queuecallerexit']=!![];queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x29')]=utils['now']();queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x8')]=_0x4cccce[_0xd046('0x24')][_0xd046('0x25')]();utils[_0xd046('0x12')](util[_0xd046('0x11')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4cccce[_0xd046('0x3')],queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x20')],_0x4cccce[_0xd046('0x24')],queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x8')]));writeDB(queues[_0x4cccce[_0xd046('0x3')]]);}}else if(!_[_0xd046('0x18')](_0x4cccce['variable'][_0xd046('0x2a')])){if(!_[_0xd046('0x18')](queues[_0x4cccce[_0xd046('0x3')]])&&!queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x27')]){queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x27')]=![];queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x28')]=null;queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x1b')]=!![];queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x29')]=utils[_0xd046('0x15')]();queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x8')]=_0xd046('0x2b');utils[_0xd046('0x12')](util[_0xd046('0x11')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4cccce[_0xd046('0x3')],queues[_0x4cccce[_0xd046('0x3')]][_0xd046('0x20')],_0x4cccce['value'],queues[_0x4cccce['uniqueid']]['queuecallerexitreason']));}}}catch(_0x4f8ad0){utils[_0xd046('0x16')](util['format'](_0xd046('0x2c'),_0x4cccce[_0xd046('0x3')]),_0x4f8ad0);}};exports[_0xd046('0x27')]=function(_0x2c27b4){try{if(!_[_0xd046('0x18')](queues[_0x2c27b4[_0xd046('0x3')]])){utils['debug'](util[_0xd046('0x11')](_0xd046('0x2d'),_0x2c27b4[_0xd046('0x3')]),_0x2c27b4);queues[_0x2c27b4['uniqueid']][_0xd046('0x1b')]=![];queues[_0x2c27b4[_0xd046('0x3')]][_0xd046('0x29')]=null;queues[_0x2c27b4[_0xd046('0x3')]][_0xd046('0x27')]=!![];queues[_0x2c27b4['uniqueid']]['queuecallerabandonAt']=utils[_0xd046('0x15')]();queues[_0x2c27b4[_0xd046('0x3')]][_0xd046('0x8')]=_0xd046('0x2e');utils[_0xd046('0x12')](util[_0xd046('0x11')](_0xd046('0x2f'),_0x2c27b4[_0xd046('0x3')],queues[_0x2c27b4[_0xd046('0x3')]]['name'],queues[_0x2c27b4['uniqueid']][_0xd046('0x8')]));}}catch(_0x227ed1){utils[_0xd046('0x16')](util[_0xd046('0x11')](_0xd046('0x2d'),_0x2c27b4['uniqueid']),_0x227ed1);}};exports[_0xd046('0x30')]=function(_0x22a422){try{if(!_[_0xd046('0x18')](queues[_0x22a422['uniqueid']])){utils[_0xd046('0x10')](util[_0xd046('0x11')](_0xd046('0x31'),_0x22a422['uniqueid']),_0x22a422);utils[_0xd046('0x12')](util[_0xd046('0x11')](_0xd046('0x32'),_0x22a422[_0xd046('0x3')],queues[_0x22a422['uniqueid']][_0xd046('0x20')],_0x22a422[_0xd046('0x33')],_0x22a422[_0xd046('0x34')]));queues[_0x22a422['uniqueid']][_0xd046('0x30')]=!![];queues[_0x22a422[_0xd046('0x3')]][_0xd046('0x1a')]=utils[_0xd046('0x15')]();queues[_0x22a422[_0xd046('0x3')]][_0xd046('0x35')]=utils[_0xd046('0x36')](queues[_0x22a422[_0xd046('0x3')]]['queuecallerleaveAt'],queues[_0x22a422[_0xd046('0x3')]][_0xd046('0x37')]);queues[_0x22a422['uniqueid']][_0xd046('0x13')]=_0x22a422[_0xd046('0x13')];queues[_0x22a422[_0xd046('0x3')]][_0xd046('0x38')]=_0x22a422['count'];queues[_0x22a422[_0xd046('0x3')]][_0xd046('0x33')]=_0x22a422[_0xd046('0x33')];queues[_0x22a422[_0xd046('0x3')]][_0xd046('0x34')]=_0x22a422[_0xd046('0x34')];}}catch(_0x25e3ee){utils['error'](util[_0xd046('0x11')]('[%s][queues][queuecallerleave]',_0x22a422[_0xd046('0x3')]),_0x25e3ee);}};exports['agentconnect']=function(_0x28a7c2){try{if(!_[_0xd046('0x18')](queues[_0x28a7c2[_0xd046('0x3')]])){utils['debug'](util[_0xd046('0x11')](_0xd046('0x39'),_0x28a7c2[_0xd046('0x3')]),_0x28a7c2);utils[_0xd046('0x12')](util[_0xd046('0x11')](_0xd046('0x3a'),_0x28a7c2[_0xd046('0x3')],queues[_0x28a7c2['uniqueid']]['name'],_0x28a7c2['membername'],_0x28a7c2['destaccountcode']));queues[_0x28a7c2[_0xd046('0x3')]][_0xd046('0x27')]=![];queues[_0x28a7c2[_0xd046('0x3')]][_0xd046('0x27')]=![];queues[_0x28a7c2[_0xd046('0x3')]][_0xd046('0x28')]=null;queues[_0x28a7c2['uniqueid']][_0xd046('0x1b')]=![];queues[_0x28a7c2[_0xd046('0x3')]][_0xd046('0x8')]=null;queues[_0x28a7c2[_0xd046('0x3')]][_0xd046('0x29')]=null;queues[_0x28a7c2[_0xd046('0x3')]][_0xd046('0x3b')]=!![];queues[_0x28a7c2['uniqueid']][_0xd046('0x3c')]=_0x28a7c2[_0xd046('0x3d')];queues[_0x28a7c2[_0xd046('0x3')]][_0xd046('0x6')]=_0x28a7c2[_0xd046('0x3e')];}}catch(_0x88f341){utils[_0xd046('0x16')](util[_0xd046('0x11')](_0xd046('0x39'),_0x28a7c2[_0xd046('0x3')]),_0x88f341);}};exports['agentcomplete']=function(_0x5e7d3b){try{if(!_[_0xd046('0x18')](queues[_0x5e7d3b['uniqueid']])){if(queues[_0x5e7d3b[_0xd046('0x3')]]['queuecallerleaveAt']){utils[_0xd046('0x10')](util[_0xd046('0x11')](_0xd046('0x3f'),_0x5e7d3b[_0xd046('0x3')]),_0x5e7d3b);queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x27')]=![];queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x27')]=![];queues[_0x5e7d3b['uniqueid']][_0xd046('0x28')]=null;queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x1b')]=![];queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x29')]=null;queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x3b')]=!![];queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x6')]=_0x5e7d3b[_0xd046('0x3e')];queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x1c')]=!![];queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x1d')]=utils[_0xd046('0x15')]();if(_0x5e7d3b['reason']==_0xd046('0x40')){if(!queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x40')]){queues[_0x5e7d3b[_0xd046('0x3')]]['queuecallerexitreason']=_0xd046('0x41');}}else{queues[_0x5e7d3b[_0xd046('0x3')]][_0xd046('0x8')]=_0xd046('0x42')+_0x5e7d3b['reason']['toUpperCase']();}utils['info'](util[_0xd046('0x11')](_0xd046('0x43'),_0x5e7d3b[_0xd046('0x3')],queues[_0x5e7d3b[_0xd046('0x3')]]['name'],_0x5e7d3b['membername'],queues[_0x5e7d3b['uniqueid']][_0xd046('0x8')]));writeDB(queues[_0x5e7d3b['uniqueid']]);}}}catch(_0xefc722){utils[_0xd046('0x16')](util[_0xd046('0x11')](_0xd046('0x3f'),_0x5e7d3b[_0xd046('0x3')]),_0xefc722);}};exports[_0xd046('0x44')]=function(_0x322e39){try{if(!_[_0xd046('0x18')](queues[_0x322e39[_0xd046('0x45')]])){utils['debug'](util[_0xd046('0x11')](_0xd046('0x46'),_0x322e39[_0xd046('0x3')]),_0x322e39);queues[_0x322e39[_0xd046('0x45')]]['transfer']=!![];queues[_0x322e39['transfereeuniqueid']][_0xd046('0x47')]='BLIND';queues[_0x322e39[_0xd046('0x45')]][_0xd046('0x48')]=_0x322e39[_0xd046('0x49')];queues[_0x322e39[_0xd046('0x45')]][_0xd046('0x4a')]=_0x322e39[_0xd046('0x45')];queues[_0x322e39[_0xd046('0x45')]][_0xd046('0x8')]=_0xd046('0x4b');utils['info'](util['format'](_0xd046('0x4c'),_0x322e39[_0xd046('0x3')],queues[_0x322e39[_0xd046('0x45')]][_0xd046('0x20')],_0x322e39['transfereeuniqueid'],_0x322e39['extension']));}}catch(_0x2d65dd){utils[_0xd046('0x16')](util[_0xd046('0x11')]('[%s][queues][blindtransfer]',_0x322e39[_0xd046('0x3')]),_0x2d65dd);}};exports[_0xd046('0x4d')]=function(_0x55dca4){try{utils[_0xd046('0x10')](util[_0xd046('0x11')]('[%s][queues][attendedtransfer]',_0x55dca4[_0xd046('0x4e')]),_0x55dca4);if(_0x55dca4[_0xd046('0x4e')]==_0x55dca4[_0xd046('0x4f')]){if(!_[_0xd046('0x18')](queues[_0x55dca4[_0xd046('0x50')]])){utils['info'](util[_0xd046('0x11')](_0xd046('0x51'),_0x55dca4[_0xd046('0x4e')],queues[_0x55dca4[_0xd046('0x50')]][_0xd046('0x20')],_0x55dca4['origtransfererexten']));queues[_0x55dca4[_0xd046('0x50')]]['transfer']=!![];queues[_0x55dca4[_0xd046('0x50')]][_0xd046('0x47')]=_0xd046('0x52');queues[_0x55dca4[_0xd046('0x50')]][_0xd046('0x48')]=_0x55dca4[_0xd046('0x53')];queues[_0x55dca4[_0xd046('0x50')]][_0xd046('0x4a')]=_0x55dca4[_0xd046('0x4e')];queues[_0x55dca4[_0xd046('0x50')]][_0xd046('0x8')]='ATTENDEDTRANSFER';}if(!_[_0xd046('0x18')](queues[_0x55dca4[_0xd046('0x4f')]])){if(_0x55dca4[_0xd046('0x54')]&&queues[_0x55dca4[_0xd046('0x54')]]){queues[_0x55dca4['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x55dca4[_0xd046('0x45')]]=_[_0xd046('0x55')](queues[_0x55dca4[_0xd046('0x54')]]);queues[_0x55dca4[_0xd046('0x45')]][_0xd046('0xe')]=_0x55dca4[_0xd046('0x56')];queues[_0x55dca4['transfereeuniqueid']][_0xd046('0x21')]=0x2;queues[_0x55dca4[_0xd046('0x45')]][_0xd046('0x7')]=queues[_0x55dca4[_0xd046('0x50')]][_0xd046('0x7')];queues[_0x55dca4['transfereeuniqueid']][_0xd046('0x57')]=queues[_0x55dca4[_0xd046('0x50')]][_0xd046('0x57')];queues[_0x55dca4[_0xd046('0x45')]][_0xd046('0x37')]=utils['now']();queues[_0x55dca4['transfereeuniqueid']][_0xd046('0x1a')]=utils[_0xd046('0x15')]();queues[_0x55dca4[_0xd046('0x45')]][_0xd046('0x35')]=0x0;queues[_0x55dca4['transfereeuniqueid']]['mohtime']=0x0;utils[_0xd046('0x12')](util[_0xd046('0x11')](_0xd046('0x58'),_0x55dca4[_0xd046('0x4e')],queues[_0x55dca4[_0xd046('0x45')]][_0xd046('0x20')],queues[_0x55dca4['transfereeuniqueid']][_0xd046('0x7')],queues[_0x55dca4[_0xd046('0x45')]][_0xd046('0x57')]));}else{utils[_0xd046('0x12')](util[_0xd046('0x11')](_0xd046('0x59'),_0x55dca4[_0xd046('0x4e')],queues[_0x55dca4[_0xd046('0x4f')]][_0xd046('0x20')],_0x55dca4[_0xd046('0x50')]));queues[_0x55dca4['origtransfererlinkedid']]['transfereduniqueid']=_0x55dca4['secondtransfererlinkedid'];}}}else if(_0x55dca4[_0xd046('0x5a')]==_0x55dca4[_0xd046('0x50')]){if(!_[_0xd046('0x18')](queues[_0x55dca4[_0xd046('0x4f')]])){utils[_0xd046('0x12')](util[_0xd046('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x55dca4['origtransfereruniqueid'],queues[_0x55dca4[_0xd046('0x4f')]][_0xd046('0x20')],_0x55dca4[_0xd046('0x5a')],_0x55dca4[_0xd046('0x5b')]));queues[_0x55dca4[_0xd046('0x4f')]][_0xd046('0x40')]=!![];queues[_0x55dca4[_0xd046('0x4f')]][_0xd046('0x47')]=_0xd046('0x52');queues[_0x55dca4['origtransfererlinkedid']]['transferexten']=_0x55dca4[_0xd046('0x5b')];queues[_0x55dca4['origtransfererlinkedid']]['transferuniqueid']=_0x55dca4['secondtransfereruniqueid'];queues[_0x55dca4[_0xd046('0x4f')]][_0xd046('0x8')]='ATTENDEDTRANSFER';}if(!_[_0xd046('0x18')](queues[_0x55dca4['secondtransfererlinkedid']])){if(_0x55dca4['transfertargetlinkedid']&&queues[_0x55dca4[_0xd046('0x5c')]]){queues[_0x55dca4[_0xd046('0x5c')]][_0xd046('0x21')]=0x1;queues[_0x55dca4[_0xd046('0x56')]]=_[_0xd046('0x55')](queues[_0x55dca4[_0xd046('0x5c')]]);queues[_0x55dca4[_0xd046('0x56')]][_0xd046('0xe')]=_0x55dca4[_0xd046('0x56')];queues[_0x55dca4[_0xd046('0x56')]]['queuecallerenterreason']=0x2;queues[_0x55dca4[_0xd046('0x56')]][_0xd046('0x7')]=queues[_0x55dca4[_0xd046('0x4f')]][_0xd046('0x7')];queues[_0x55dca4[_0xd046('0x56')]]['calleridname']=queues[_0x55dca4['origtransfererlinkedid']][_0xd046('0x57')];queues[_0x55dca4[_0xd046('0x56')]][_0xd046('0x37')]=utils['now']();queues[_0x55dca4[_0xd046('0x56')]][_0xd046('0x1a')]=utils[_0xd046('0x15')]();queues[_0x55dca4['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x55dca4[_0xd046('0x56')]]['mohtime']=0x0;utils['info'](util[_0xd046('0x11')](_0xd046('0x5d'),_0x55dca4[_0xd046('0x4e')],queues[_0x55dca4[_0xd046('0x56')]]['name'],queues[_0x55dca4[_0xd046('0x56')]][_0xd046('0xe')],queues[_0x55dca4[_0xd046('0x56')]]['calleridnum'],queues[_0x55dca4[_0xd046('0x56')]]['calleridname']));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x55dca4['origtransfereruniqueid'],queues[_0x55dca4[_0xd046('0x50')]]['name'],_0x55dca4[_0xd046('0x4f')]));queues[_0x55dca4['secondtransfererlinkedid']][_0xd046('0xe')]=_0x55dca4[_0xd046('0x4f')];}}}}catch(_0x1969e9){utils['error'](util[_0xd046('0x11')]('[%s][queues][attendedtransfer]',_0x55dca4['origtransfereruniqueid']),_0x1969e9);}};exports[_0xd046('0x5e')]=function(_0x2c91c5){try{if(!_['isNil'](queues[_0x2c91c5['uniqueid']])){utils[_0xd046('0x10')](util[_0xd046('0x11')](_0xd046('0x5f'),_0x2c91c5['uniqueid']),_0x2c91c5);queues[_0x2c91c5['uniqueid']][_0xd046('0x60')]=utils['now']();utils['info'](util[_0xd046('0x11')](_0xd046('0x61'),_0x2c91c5[_0xd046('0x3')],queues[_0x2c91c5[_0xd046('0x3')]]['name'],queues[_0x2c91c5[_0xd046('0x3')]][_0xd046('0x60')]));}}catch(_0x3aac6f){utils[_0xd046('0x16')](util[_0xd046('0x11')](_0xd046('0x5f'),_0x2c91c5['uniqueid']),_0x3aac6f);}};exports[_0xd046('0x62')]=function(_0x4eb018){try{if(!_[_0xd046('0x18')](queues[_0x4eb018[_0xd046('0x3')]])){if(!_[_0xd046('0x18')](queues[_0x4eb018[_0xd046('0x3')]][_0xd046('0x60')])){utils[_0xd046('0x10')](util['format'](_0xd046('0x63'),_0x4eb018['uniqueid']),_0x4eb018);queues[_0x4eb018[_0xd046('0x3')]][_0xd046('0x64')]+=utils[_0xd046('0x36')](utils[_0xd046('0x15')](),queues[_0x4eb018[_0xd046('0x3')]]['musiconholdstartAt']);utils['info'](util[_0xd046('0x11')](_0xd046('0x65'),_0x4eb018[_0xd046('0x3')],queues[_0x4eb018[_0xd046('0x3')]][_0xd046('0x20')],queues[_0x4eb018[_0xd046('0x3')]][_0xd046('0x64')]));delete queues[_0x4eb018['uniqueid']]['musiconholdstartAt'];}}}catch(_0x51eff5){utils[_0xd046('0x16')](util[_0xd046('0x11')]('[%s][queues][musiconholdstop]',_0x4eb018['uniqueid']),_0x51eff5);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 90be43e..7413a90 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 _0xfade=['[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','endsWith','value','replace','.wav49','.WAV','find','monitors'];(function(_0x176754,_0x3512ac){var _0x1ec1a4=function(_0x120532){while(--_0x120532){_0x176754['push'](_0x176754['shift']());}};_0x1ec1a4(++_0x3512ac);}(_0xfade,0x1f0));var _0xefad=function(_0x2efe11,_0x17c557){_0x2efe11=_0x2efe11-0x0;var _0x1172d9=_0xfade[_0x2efe11];return _0x1172d9;};'use strict';var _=require(_0xefad('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x15e0b5){utils[_0xefad('0x1')](util[_0xefad('0x2')]('[%s][recordings][writeDB]',_0x15e0b5['uniqueid']));if(_0x15e0b5[_0xefad('0x3')]){utils[_0xefad('0x4')](_0x15e0b5['accountcode'])[_0xefad('0x5')](function(_0x4cc1a1){if(_0x4cc1a1){_0x15e0b5[_0xefad('0x6')]=_0x4cc1a1[_0xefad('0x7')];_0x15e0b5['UserId']=_0x4cc1a1['id'];}utils[_0xefad('0x8')](_0xefad('0x9'),_0x15e0b5);});}else{utils[_0xefad('0x8')]('CreateVoiceRecording',_0x15e0b5);}}exports[_0xefad('0xa')]=function(_0xb34a5e){try{utils[_0xefad('0xb')](util[_0xefad('0x2')](_0xefad('0xc'),_0xb34a5e[_0xefad('0xd')]),_0xb34a5e);if(_0xb34a5e['uniqueid']==_0xb34a5e['linkedid']){utils['info'](util[_0xefad('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0xb34a5e[_0xefad('0xd')],_0xb34a5e[_0xefad('0xe')],_0xb34a5e[_0xefad('0xf')]));recordings[_0xb34a5e[_0xefad('0xd')]]={'uniqueid':_0xb34a5e[_0xefad('0xd')],'accountcode':_0xb34a5e[_0xefad('0x3')],'exten':_0xb34a5e[_0xefad('0xf')],'context':_0xb34a5e['context'],'channel':_0xb34a5e[_0xefad('0x10')],'monitors':[]};}}catch(_0xceaa90){utils[_0xefad('0x11')](util[_0xefad('0x2')](_0xefad('0xc'),_0xb34a5e['uniqueid']),_0xceaa90);}};exports[_0xefad('0x12')]=function(_0x2a2d82){try{utils[_0xefad('0xb')](util['format'](_0xefad('0x13'),_0x2a2d82[_0xefad('0xd')]),_0x2a2d82);if(!_[_0xefad('0x14')](recordings[_0x2a2d82[_0xefad('0xd')]])&&_0x2a2d82[_0xefad('0x15')]==0x6){utils[_0xefad('0x1')](util[_0xefad('0x2')](_0xefad('0x16'),_0x2a2d82[_0xefad('0xd')],_0x2a2d82[_0xefad('0xe')],_0x2a2d82[_0xefad('0x10')]));}else if(!_[_0xefad('0x14')](recordings[_0x2a2d82[_0xefad('0x17')]])&&_0x2a2d82[_0xefad('0x15')]==0x6&&_0x2a2d82[_0xefad('0xe')]!=_0xefad('0x18')){utils[_0xefad('0x1')](util[_0xefad('0x2')](_0xefad('0x19'),_0x2a2d82[_0xefad('0xd')],_0x2a2d82[_0xefad('0x17')],_0x2a2d82[_0xefad('0xe')],_0x2a2d82[_0xefad('0x10')]));recordings[_0x2a2d82[_0xefad('0x17')]]['accountcode']=_0x2a2d82['accountcode'];}}catch(_0x258516){utils['error'](util['format'](_0xefad('0x13'),_0x2a2d82[_0xefad('0xd')]),_0x258516);}};exports['varset']=function(_0x1ea8b5){try{if(!_[_0xefad('0x14')](_0x1ea8b5[_0xefad('0x1a')])&&!_[_0xefad('0x14')](_0x1ea8b5[_0xefad('0x1a')][_0xefad('0x1b')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x1ea8b5['uniqueid']),_0x1ea8b5);utils[_0xefad('0x1')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1ea8b5[_0xefad('0xd')],_0x1ea8b5[_0xefad('0x1a')],_0x1ea8b5['value']));if(_[_0xefad('0x1c')](_0x1ea8b5['value'],'.wav49')){_0x1ea8b5[_0xefad('0x1d')]=_0x1ea8b5[_0xefad('0x1d')][_0xefad('0x1e')](_0xefad('0x1f'),_0xefad('0x20'));}if(recordings[_0x1ea8b5['linkedid']]){var _0x2144da=_[_0xefad('0x21')](recordings[_0x1ea8b5[_0xefad('0x17')]][_0xefad('0x22')],{'value':_0x1ea8b5[_0xefad('0x1d')]});if(_[_0xefad('0x14')](_0x2144da)){recordings[_0x1ea8b5[_0xefad('0x17')]][_0xefad('0x22')]['push']({'value':_0x1ea8b5[_0xefad('0x1d')]});}}}}catch(_0x252e43){utils[_0xefad('0x11')](util[_0xefad('0x2')](_0xefad('0x23'),_0x1ea8b5['uniqueid']),_0x252e43);}};exports[_0xefad('0x24')]=function(_0x147cc0){try{if(!_[_0xefad('0x14')](recordings[_0x147cc0['uniqueid']])){utils['debug'](util[_0xefad('0x2')](_0xefad('0x25'),_0x147cc0['uniqueid']),_0x147cc0);utils[_0xefad('0x1')](util[_0xefad('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x147cc0[_0xefad('0xd')],_0x147cc0['calleridnum'],_0x147cc0[_0xefad('0x26')],_0x147cc0[_0xefad('0x27')]));recordings[_0x147cc0[_0xefad('0xd')]][_0xefad('0x28')]=_0x147cc0['calleridnum'];recordings[_0x147cc0['uniqueid']][_0xefad('0x26')]=_0x147cc0[_0xefad('0x26')];recordings[_0x147cc0['uniqueid']][_0xefad('0x29')]=_0x147cc0[_0xefad('0x29')];recordings[_0x147cc0[_0xefad('0xd')]]['connectedlinename']=_0x147cc0[_0xefad('0x2a')];if(recordings[_0x147cc0[_0xefad('0xd')]][_0xefad('0x2b')]==_0xefad('0x2c')&&recordings[_0x147cc0[_0xefad('0xd')]]['accountcode']){recordings[_0x147cc0['uniqueid']][_0xefad('0x29')]=recordings[_0x147cc0[_0xefad('0xd')]][_0xefad('0x3')];recordings[_0x147cc0[_0xefad('0xd')]][_0xefad('0x2a')]='';}recordings[_0x147cc0['uniqueid']][_0xefad('0x22')]['forEach'](function(_0x126322){var _0x5dec1f=_[_0xefad('0x2d')](recordings[_0x147cc0[_0xefad('0xd')]]);_0x5dec1f[_0xefad('0x1d')]=_0x126322[_0xefad('0x1d')];writeDB(_0x5dec1f);});delete recordings[_0x147cc0[_0xefad('0xd')]];}}catch(_0x2aaa48){utils['error'](util[_0xefad('0x2')]('[%s][recordings][hangup]',_0x147cc0[_0xefad('0xd')]),_0x2aaa48);}};exports['newexten']=function(_0x1c7569){try{if(!_[_0xefad('0x14')](recordings[_0x1c7569[_0xefad('0xd')]])){utils[_0xefad('0xb')](util[_0xefad('0x2')](_0xefad('0x2e'),_0x1c7569['uniqueid']),_0x1c7569);utils[_0xefad('0x1')](util[_0xefad('0x2')](_0xefad('0x2f'),_0x1c7569['uniqueid'],_0x1c7569[_0xefad('0x30')],_0x1c7569[_0xefad('0x31')]));if(_0x1c7569['application'][_0xefad('0x32')]()=='set'&&_['startsWith'](_0x1c7569[_0xefad('0x31')][_0xefad('0x32')](),_0xefad('0x33'))){var _0x1f3e21=_0x1c7569[_0xefad('0x31')][_0xefad('0x34')]('=');var _0x5d6863=_0x1f3e21[0x0][_0xefad('0x35')](_0x1f3e21[0x0][_0xefad('0x36')]('(')+0x1,_0x1f3e21[0x0][_0xefad('0x36')](')'));var _0x2aa516=_0x1f3e21[0x1];recordings[_0x1c7569[_0xefad('0xd')]][_0x5d6863]=_0x2aa516;}}}catch(_0xe624af){utils[_0xefad('0x11')](util[_0xefad('0x2')](_0xefad('0x2e'),_0x1c7569[_0xefad('0xd')]),_0xe624af);}};exports[_0xefad('0x37')]=function(_0x256b18){try{if(!_[_0xefad('0x14')](recordings[_0x256b18[_0xefad('0xd')]])){utils[_0xefad('0xb')](util[_0xefad('0x2')](_0xefad('0x38'),_0x256b18[_0xefad('0xd')]),_0x256b18);utils[_0xefad('0x1')](util['format'](_0xefad('0x39'),_0x256b18[_0xefad('0xd')],_0x256b18['queue']));recordings[_0x256b18[_0xefad('0xd')]][_0xefad('0x3a')]=_0x256b18[_0xefad('0x3a')];}}catch(_0x231588){utils[_0xefad('0x11')](util[_0xefad('0x2')](_0xefad('0x38'),_0x256b18[_0xefad('0xd')]),_0x231588);}}; \ No newline at end of file +var _0xc599=['.wav49','replace','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','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','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value'];(function(_0x13c595,_0x2c2465){var _0x179028=function(_0x53a403){while(--_0x53a403){_0x13c595['push'](_0x13c595['shift']());}};_0x179028(++_0x2c2465);}(_0xc599,0x10e));var _0x9c59=function(_0x448a56,_0x3cd4d1){_0x448a56=_0x448a56-0x0;var _0x1ba466=_0xc599[_0x448a56];return _0x1ba466;};'use strict';var _=require('lodash');var util=require(_0x9c59('0x0'));var utils=require(_0x9c59('0x1'));var recordings={};function writeDB(_0x58eba0){utils[_0x9c59('0x2')](util[_0x9c59('0x3')](_0x9c59('0x4'),_0x58eba0[_0x9c59('0x5')]));if(_0x58eba0[_0x9c59('0x6')]){utils[_0x9c59('0x7')](_0x58eba0[_0x9c59('0x6')])[_0x9c59('0x8')](function(_0x1a0e0d){if(_0x1a0e0d){_0x58eba0[_0x9c59('0x9')]=_0x1a0e0d[_0x9c59('0xa')];_0x58eba0[_0x9c59('0xb')]=_0x1a0e0d['id'];}utils['request'](_0x9c59('0xc'),_0x58eba0);});}else{utils[_0x9c59('0xd')](_0x9c59('0xc'),_0x58eba0);}}exports[_0x9c59('0xe')]=function(_0x22c05e){try{utils[_0x9c59('0xf')](util[_0x9c59('0x3')](_0x9c59('0x10'),_0x22c05e[_0x9c59('0x5')]),_0x22c05e);if(_0x22c05e[_0x9c59('0x5')]==_0x22c05e[_0x9c59('0x11')]){utils[_0x9c59('0x2')](util['format'](_0x9c59('0x12'),_0x22c05e[_0x9c59('0x5')],_0x22c05e[_0x9c59('0x13')],_0x22c05e[_0x9c59('0x14')]));recordings[_0x22c05e['uniqueid']]={'uniqueid':_0x22c05e[_0x9c59('0x5')],'accountcode':_0x22c05e['accountcode'],'exten':_0x22c05e[_0x9c59('0x14')],'context':_0x22c05e['context'],'channel':_0x22c05e[_0x9c59('0x15')],'monitors':[]};}}catch(_0x587b9e){utils[_0x9c59('0x16')](util[_0x9c59('0x3')]('[%s][recordings][newchannel]',_0x22c05e[_0x9c59('0x5')]),_0x587b9e);}};exports[_0x9c59('0x17')]=function(_0x49b36b){try{utils[_0x9c59('0xf')](util['format'](_0x9c59('0x18'),_0x49b36b['uniqueid']),_0x49b36b);if(!_[_0x9c59('0x19')](recordings[_0x49b36b[_0x9c59('0x5')]])&&_0x49b36b[_0x9c59('0x1a')]==0x6){utils[_0x9c59('0x2')](util[_0x9c59('0x3')](_0x9c59('0x1b'),_0x49b36b[_0x9c59('0x5')],_0x49b36b[_0x9c59('0x13')],_0x49b36b[_0x9c59('0x15')]));}else if(!_[_0x9c59('0x19')](recordings[_0x49b36b['linkedid']])&&_0x49b36b[_0x9c59('0x1a')]==0x6&&_0x49b36b['context']!=_0x9c59('0x1c')){utils[_0x9c59('0x2')](util[_0x9c59('0x3')](_0x9c59('0x1d'),_0x49b36b[_0x9c59('0x5')],_0x49b36b['linkedid'],_0x49b36b['context'],_0x49b36b['channel']));recordings[_0x49b36b[_0x9c59('0x11')]][_0x9c59('0x6')]=_0x49b36b[_0x9c59('0x6')];}}catch(_0x40365d){utils[_0x9c59('0x16')](util['format'](_0x9c59('0x18'),_0x49b36b[_0x9c59('0x5')]),_0x40365d);}};exports[_0x9c59('0x1e')]=function(_0x42f75d){try{if(!_[_0x9c59('0x19')](_0x42f75d[_0x9c59('0x1f')])&&!_[_0x9c59('0x19')](_0x42f75d[_0x9c59('0x1f')]['mixmonitor_filename'])){utils['debug'](util[_0x9c59('0x3')](_0x9c59('0x20'),_0x42f75d[_0x9c59('0x5')]),_0x42f75d);utils[_0x9c59('0x2')](util[_0x9c59('0x3')](_0x9c59('0x21'),_0x42f75d[_0x9c59('0x5')],_0x42f75d[_0x9c59('0x1f')],_0x42f75d[_0x9c59('0x22')]));if(_['endsWith'](_0x42f75d[_0x9c59('0x22')],_0x9c59('0x23'))){_0x42f75d[_0x9c59('0x22')]=_0x42f75d[_0x9c59('0x22')][_0x9c59('0x24')](_0x9c59('0x23'),'.WAV');}if(recordings[_0x42f75d[_0x9c59('0x11')]]){var _0x202e50=_[_0x9c59('0x25')](recordings[_0x42f75d[_0x9c59('0x11')]][_0x9c59('0x26')],{'value':_0x42f75d['value']});if(_[_0x9c59('0x19')](_0x202e50)){recordings[_0x42f75d['linkedid']]['monitors'][_0x9c59('0x27')]({'value':_0x42f75d[_0x9c59('0x22')]});}}}}catch(_0x58b381){utils['error'](util['format'](_0x9c59('0x20'),_0x42f75d['uniqueid']),_0x58b381);}};exports['hangup']=function(_0x4c9ead){try{if(!_[_0x9c59('0x19')](recordings[_0x4c9ead['uniqueid']])){utils[_0x9c59('0xf')](util[_0x9c59('0x3')](_0x9c59('0x28'),_0x4c9ead[_0x9c59('0x5')]),_0x4c9ead);utils[_0x9c59('0x2')](util[_0x9c59('0x3')](_0x9c59('0x29'),_0x4c9ead[_0x9c59('0x5')],_0x4c9ead[_0x9c59('0x2a')],_0x4c9ead[_0x9c59('0x2b')],_0x4c9ead[_0x9c59('0x2c')]));recordings[_0x4c9ead['uniqueid']][_0x9c59('0x2a')]=_0x4c9ead[_0x9c59('0x2a')];recordings[_0x4c9ead[_0x9c59('0x5')]][_0x9c59('0x2b')]=_0x4c9ead[_0x9c59('0x2b')];recordings[_0x4c9ead[_0x9c59('0x5')]][_0x9c59('0x2d')]=_0x4c9ead['connectedlinenum'];recordings[_0x4c9ead[_0x9c59('0x5')]]['connectedlinename']=_0x4c9ead[_0x9c59('0x2e')];if(recordings[_0x4c9ead[_0x9c59('0x5')]][_0x9c59('0x2f')]=='outbound'&&recordings[_0x4c9ead[_0x9c59('0x5')]][_0x9c59('0x6')]){recordings[_0x4c9ead[_0x9c59('0x5')]][_0x9c59('0x2d')]=recordings[_0x4c9ead[_0x9c59('0x5')]][_0x9c59('0x6')];recordings[_0x4c9ead['uniqueid']][_0x9c59('0x2e')]='';}recordings[_0x4c9ead['uniqueid']][_0x9c59('0x26')][_0x9c59('0x30')](function(_0x4b64a8){var _0x32e5db=_[_0x9c59('0x31')](recordings[_0x4c9ead[_0x9c59('0x5')]]);_0x32e5db[_0x9c59('0x22')]=_0x4b64a8[_0x9c59('0x22')];writeDB(_0x32e5db);});delete recordings[_0x4c9ead[_0x9c59('0x5')]];}}catch(_0x28b5a5){utils[_0x9c59('0x16')](util['format']('[%s][recordings][hangup]',_0x4c9ead[_0x9c59('0x5')]),_0x28b5a5);}};exports['newexten']=function(_0x2b349e){try{if(!_[_0x9c59('0x19')](recordings[_0x2b349e[_0x9c59('0x5')]])){utils[_0x9c59('0xf')](util[_0x9c59('0x3')]('[%s][recordings][newexten]',_0x2b349e[_0x9c59('0x5')]),_0x2b349e);utils['info'](util[_0x9c59('0x3')](_0x9c59('0x32'),_0x2b349e[_0x9c59('0x5')],_0x2b349e[_0x9c59('0x33')],_0x2b349e[_0x9c59('0x34')]));if(_0x2b349e[_0x9c59('0x33')][_0x9c59('0x35')]()=='set'&&_['startsWith'](_0x2b349e[_0x9c59('0x34')][_0x9c59('0x35')](),_0x9c59('0x36'))){var _0x342333=_0x2b349e[_0x9c59('0x34')]['split']('=');var _0x713a86=_0x342333[0x0][_0x9c59('0x37')](_0x342333[0x0]['lastIndexOf']('(')+0x1,_0x342333[0x0][_0x9c59('0x38')](')'));var _0x58a08c=_0x342333[0x1];recordings[_0x2b349e[_0x9c59('0x5')]][_0x713a86]=_0x58a08c;}}}catch(_0xcb2af5){utils[_0x9c59('0x16')](util[_0x9c59('0x3')]('[%s][recordings][newexten]',_0x2b349e[_0x9c59('0x5')]),_0xcb2af5);}};exports[_0x9c59('0x39')]=function(_0x6d9985){try{if(!_[_0x9c59('0x19')](recordings[_0x6d9985[_0x9c59('0x5')]])){utils[_0x9c59('0xf')](util[_0x9c59('0x3')](_0x9c59('0x3a'),_0x6d9985['uniqueid']),_0x6d9985);utils[_0x9c59('0x2')](util['format'](_0x9c59('0x3b'),_0x6d9985['uniqueid'],_0x6d9985[_0x9c59('0x3c')]));recordings[_0x6d9985[_0x9c59('0x5')]][_0x9c59('0x3c')]=_0x6d9985[_0x9c59('0x3c')];}}catch(_0x71a771){utils[_0x9c59('0x16')](util['format'](_0x9c59('0x3a'),_0x6d9985['uniqueid']),_0x71a771);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 066098e..19ea571 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 _0xc540=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetexten','transfertargetlinkedid','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc540,0x184));var _0x0c54=function(_0x3765e1,_0x5458a9){_0x3765e1=_0x3765e1-0x0;var _0x2eb72c=_0xc540[_0x3765e1];return _0x2eb72c;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');function writeDB(_0x352f45){utils['info'](util[_0x0c54('0x0')](_0x0c54('0x1'),_0x352f45[_0x0c54('0x2')]===_0x0c54('0x3')?_0x352f45[_0x0c54('0x4')]:_0x352f45['uniqueid'],_0x352f45[_0x0c54('0x2')]));utils[_0x0c54('0x5')](_0x0c54('0x6'),_0x352f45);}exports[_0x0c54('0x7')]=function(_0x2eee8f){try{utils[_0x0c54('0x8')](util[_0x0c54('0x0')](_0x0c54('0x9'),_0x2eee8f[_0x0c54('0xa')]),_0x2eee8f);utils[_0x0c54('0xb')](util[_0x0c54('0x0')](_0x0c54('0xc'),_0x2eee8f['uniqueid'],_0x2eee8f[_0x0c54('0xd')],_0x2eee8f['transferercalleridname'],_0x2eee8f[_0x0c54('0xe')],_0x2eee8f[_0x0c54('0xf')]));_0x2eee8f[_0x0c54('0x2')]='blind';writeDB(_0x2eee8f);}catch(_0x4a6c00){utils[_0x0c54('0x10')](util[_0x0c54('0x0')](_0x0c54('0x9'),_0x2eee8f[_0x0c54('0xa')]),_0x4a6c00);}};exports[_0x0c54('0x11')]=function(_0x9e95a5){try{utils['debug'](util['format'](_0x0c54('0x12'),_0x9e95a5[_0x0c54('0x4')]),_0x9e95a5);utils['info'](util['format'](_0x0c54('0x13'),_0x9e95a5[_0x0c54('0x4')],_0x9e95a5[_0x0c54('0x14')],_0x9e95a5[_0x0c54('0x15')],_0x9e95a5['transfertargetcalleridnum'],_0x9e95a5[_0x0c54('0x16')]));_0x9e95a5=_['assign'](_0x9e95a5,{'transfererchannel':_0x9e95a5[_0x0c54('0x17')],'transferercalleridnum':_0x9e95a5[_0x0c54('0x14')],'transferercalleridname':_0x9e95a5['origtransferercalleridname'],'transfererconnectedlinenum':_0x9e95a5[_0x0c54('0x18')],'transfererconnectedlinename':_0x9e95a5[_0x0c54('0x19')],'transfereraccountcode':_0x9e95a5[_0x0c54('0x1a')],'transferercontext':_0x9e95a5['secondtransferercontext'],'transfererexten':_0x9e95a5[_0x0c54('0x1b')],'transfererlinkedid':_0x9e95a5[_0x0c54('0x1c')],'context':_0x9e95a5[_0x0c54('0x1d')],'extension':_0x9e95a5[_0x0c54('0x1e')],'type':_0x0c54('0x3')});if(_[_0x0c54('0x1f')](_0x9e95a5[_0x0c54('0x20')])){_0x9e95a5=_['assign'](_0x9e95a5,{'transfereechannel':_0x9e95a5['transfertargetchannel'],'transfereecalleridnum':_0x9e95a5[_0x0c54('0x21')],'transfereecalleridname':_0x9e95a5[_0x0c54('0x16')],'transfereeconnectedlinenum':_0x9e95a5[_0x0c54('0x22')],'transfereeconnectedlinename':_0x9e95a5['transfertargetconnectedlinename'],'transfereeaccountcode':_0x9e95a5['transfertargetaccountcode'],'transfereecontext':_0x9e95a5['transfertargetcontext'],'transfereeexten':_0x9e95a5[_0x0c54('0x23')],'transfereelinkedid':_0x9e95a5[_0x0c54('0x24')]});}writeDB(_0x9e95a5);}catch(_0x1cee4a){utils[_0x0c54('0x10')](util['format'](_0x0c54('0x12'),_0x9e95a5[_0x0c54('0x4')]),_0x1cee4a);}}; \ No newline at end of file +var _0x466f=['info','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','request','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils'];(function(_0x3bf4c5,_0x553fdf){var _0x5a1c2c=function(_0x46cf9f){while(--_0x46cf9f){_0x3bf4c5['push'](_0x3bf4c5['shift']());}};_0x5a1c2c(++_0x553fdf);}(_0x466f,0x76));var _0xf466=function(_0x5d5737,_0x4f56a4){_0x5d5737=_0x5d5737-0x0;var _0x1dd268=_0x466f[_0x5d5737];return _0x1dd268;};'use strict';var _=require(_0xf466('0x0'));var util=require('util');var utils=require(_0xf466('0x1'));function writeDB(_0x3a3c33){utils[_0xf466('0x2')](util['format'](_0xf466('0x3'),_0x3a3c33['type']===_0xf466('0x4')?_0x3a3c33['origtransfereruniqueid']:_0x3a3c33[_0xf466('0x5')],_0x3a3c33[_0xf466('0x6')]));utils[_0xf466('0x7')]('CreateVoiceTransferReport',_0x3a3c33);}exports[_0xf466('0x8')]=function(_0x4b7ae1){try{utils[_0xf466('0x9')](util[_0xf466('0xa')](_0xf466('0xb'),_0x4b7ae1[_0xf466('0x5')]),_0x4b7ae1);utils[_0xf466('0x2')](util[_0xf466('0xa')](_0xf466('0xc'),_0x4b7ae1[_0xf466('0x5')],_0x4b7ae1['transferercalleridnum'],_0x4b7ae1[_0xf466('0xd')],_0x4b7ae1[_0xf466('0xe')],_0x4b7ae1[_0xf466('0xf')]));_0x4b7ae1[_0xf466('0x6')]='blind';writeDB(_0x4b7ae1);}catch(_0x18782e){utils[_0xf466('0x10')](util['format'](_0xf466('0xb'),_0x4b7ae1[_0xf466('0x5')]),_0x18782e);}};exports[_0xf466('0x11')]=function(_0x442b2b){try{utils[_0xf466('0x9')](util[_0xf466('0xa')](_0xf466('0x12'),_0x442b2b[_0xf466('0x13')]),_0x442b2b);utils[_0xf466('0x2')](util[_0xf466('0xa')](_0xf466('0x14'),_0x442b2b[_0xf466('0x13')],_0x442b2b['origtransferercalleridnum'],_0x442b2b['origtransferercalleridname'],_0x442b2b[_0xf466('0x15')],_0x442b2b[_0xf466('0x16')]));_0x442b2b=_[_0xf466('0x17')](_0x442b2b,{'transfererchannel':_0x442b2b[_0xf466('0x18')],'transferercalleridnum':_0x442b2b['origtransferercalleridnum'],'transferercalleridname':_0x442b2b['origtransferercalleridname'],'transfererconnectedlinenum':_0x442b2b[_0xf466('0x19')],'transfererconnectedlinename':_0x442b2b[_0xf466('0x1a')],'transfereraccountcode':_0x442b2b[_0xf466('0x1b')],'transferercontext':_0x442b2b[_0xf466('0x1c')],'transfererexten':_0x442b2b[_0xf466('0x1d')],'transfererlinkedid':_0x442b2b[_0xf466('0x1e')],'context':_0x442b2b[_0xf466('0x1f')],'extension':_0x442b2b[_0xf466('0x20')],'type':_0xf466('0x4')});if(_[_0xf466('0x21')](_0x442b2b[_0xf466('0x22')])){_0x442b2b=_[_0xf466('0x17')](_0x442b2b,{'transfereechannel':_0x442b2b['transfertargetchannel'],'transfereecalleridnum':_0x442b2b['transfertargetcalleridnum'],'transfereecalleridname':_0x442b2b[_0xf466('0x16')],'transfereeconnectedlinenum':_0x442b2b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x442b2b[_0xf466('0x23')],'transfereeaccountcode':_0x442b2b[_0xf466('0x24')],'transfereecontext':_0x442b2b[_0xf466('0x25')],'transfereeexten':_0x442b2b[_0xf466('0x26')],'transfereelinkedid':_0x442b2b[_0xf466('0x27')]});}writeDB(_0x442b2b);}catch(_0x12ee9e){utils[_0xf466('0x10')](util[_0xf466('0xa')](_0xf466('0x12'),_0x442b2b[_0xf466('0x13')]),_0x12ee9e);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 5c5f8bf..5a24039 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 _0xf19c=['client','http','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','result','length','getUserByInternal','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment'];(function(_0x2c18b4,_0x4cf88e){var _0x29acbd=function(_0x1e5e7a){while(--_0x1e5e7a){_0x2c18b4['push'](_0x2c18b4['shift']());}};_0x29acbd(++_0x4cf88e);}(_0xf19c,0x10b));var _0xcf19=function(_0x2cd47f,_0x57dbf5){_0x2cd47f=_0x2cd47f-0x0;var _0x139859=_0xf19c[_0x2cd47f];return _0x139859;};'use strict';var BPromise=require(_0xcf19('0x0'));var jayson=require(_0xcf19('0x1'));var moment=require(_0xcf19('0x2'));var util=require('util');var client=jayson[_0xcf19('0x3')][_0xcf19('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xcf19('0x5'));exports[_0xcf19('0x6')]=function(_0x460b4f,_0x87534f){logger[_0xcf19('0x6')](_0x460b4f,_0x87534f?util['inspect'](_0x87534f,{'showHidden':![],'depth':null}):'');};exports[_0xcf19('0x7')]=function(_0x1d4132,_0x3d1dd0){logger[_0xcf19('0x7')](_0x1d4132,_0x3d1dd0?util[_0xcf19('0x8')](_0x3d1dd0,{'showHidden':![],'depth':null}):'');};exports[_0xcf19('0x9')]=function(_0x5e0540,_0x3327d1){logger[_0xcf19('0x9')](_0x5e0540,_0x3327d1?util[_0xcf19('0x8')](_0x3327d1,{'showHidden':![],'depth':null}):'');};exports[_0xcf19('0xa')]=function(_0x87afe6,_0x3141eb){return client[_0xcf19('0xa')](_0x87afe6,{'body':_0x3141eb})[_0xcf19('0xb')](function(_0x3d2762){logger['debug'](_0xcf19('0xc'),_0x87afe6,_0x3d2762?util[_0xcf19('0x8')](_0x3d2762,{'showHidden':![],'depth':null}):'');})[_0xcf19('0xd')](function(_0x1d6396){logger[_0xcf19('0x9')](_0xcf19('0xc'),_0x87afe6,_0x1d6396?util[_0xcf19('0x8')](_0x1d6396,{'showHidden':![],'depth':null}):'');});};function getUser(_0x195ae2){return client[_0xcf19('0xa')](_0xcf19('0xe'),{'options':{'raw':!![],'attributes':['id',_0xcf19('0xf'),_0xcf19('0x10'),_0xcf19('0x11')],'where':_0x195ae2,'limit':0x1}})[_0xcf19('0xb')](function(_0xff426b){logger[_0xcf19('0x7')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x195ae2),_0xff426b?util[_0xcf19('0x8')](_0xff426b,{'showHidden':![],'depth':null}):'');return _0xff426b[_0xcf19('0x12')][_0xcf19('0x13')]?_0xff426b[_0xcf19('0x12')][0x0]:null;});}exports[_0xcf19('0x14')]=function(_0xbd06db){return new BPromise(function(_0x5f3fc0,_0xe1a1e3){if(_0xbd06db){return getUser({'internal':_0xbd06db})[_0xcf19('0xb')](function(_0x5e28e3){logger[_0xcf19('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xbd06db,_0x5e28e3?_0xcf19('0x15'):'notfound');return _0x5f3fc0(_0x5e28e3);})[_0xcf19('0xd')](function(_0x1cff96){logger[_0xcf19('0x9')](_0xcf19('0x16'),_0x1cff96?util[_0xcf19('0x8')](_0x1cff96,{'showHidden':![],'depth':null}):'');return _0x5f3fc0(null);});}return _0x5f3fc0(null);});};exports[_0xcf19('0x17')]=function(_0x4d68ad){return new BPromise(function(_0x4a7bc2,_0x37f1ae){if(_0x4d68ad){return getUser({'interface':_0x4d68ad})[_0xcf19('0xb')](function(_0x2aa822){logger[_0xcf19('0x6')](_0xcf19('0x18'),_0x4d68ad,_0x2aa822?_0xcf19('0x15'):_0xcf19('0x19'));return _0x4a7bc2(_0x2aa822);})[_0xcf19('0xd')](function(_0x5c8863){logger['error'](_0xcf19('0x1a'),_0x5c8863?util[_0xcf19('0x8')](_0x5c8863,{'showHidden':![],'depth':null}):'');return _0x4a7bc2(null);});}return _0x4a7bc2(null);});};exports[_0xcf19('0x1b')]=function(_0x27a241){return new BPromise(function(_0x237e8b,_0x1e87d8){if(_0x27a241){return getUser({'name':_0x27a241})[_0xcf19('0xb')](function(_0x5907c8){logger['info'](_0xcf19('0x1c'),_0x27a241,_0x5907c8?_0xcf19('0x15'):_0xcf19('0x19'));return _0x237e8b(_0x5907c8);})[_0xcf19('0xd')](function(_0x341d8b){logger[_0xcf19('0x9')](_0xcf19('0x1d'),_0x341d8b?util[_0xcf19('0x8')](_0x341d8b,{'showHidden':![],'depth':null}):'');return _0x237e8b(null);});}return _0x237e8b(null);});};exports[_0xcf19('0x1e')]=function(_0x64481){return new BPromise(function(_0x552b9f,_0x5bc90e){if(_0x64481){return client[_0xcf19('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xcf19('0x10'),_0xcf19('0x1f'),'acw',_0xcf19('0x20')],'where':{'name':_0x64481},'limit':0x1}})[_0xcf19('0xb')](function(_0x150215){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x64481,_0x150215?util[_0xcf19('0x8')](_0x150215,{'showHidden':![],'depth':null}):'');logger[_0xcf19('0x6')](_0xcf19('0x21'),_0x64481,_0x150215?_0xcf19('0x15'):'notfound');return _0x552b9f(_0x150215[_0xcf19('0x12')][_0xcf19('0x13')]?_0x150215['result'][0x0]:null);})[_0xcf19('0xd')](function(_0x3f5ed0){logger[_0xcf19('0x9')](_0xcf19('0x22'),_0x3f5ed0?util['inspect'](_0x3f5ed0,{'showHidden':![],'depth':null}):'');return _0x552b9f(null);});}return _0x552b9f(null);});};exports['addTime']=function(_0x37caf4,_0x4b1aca){return moment(_0x37caf4)[_0xcf19('0x23')](_0x4b1aca,_0xcf19('0x24'))['format'](_0xcf19('0x25'));};exports[_0xcf19('0x26')]=function(_0x5f9854,_0x17fed3){return moment(_0x5f9854)[_0xcf19('0x27')](_0x17fed3,_0xcf19('0x24'))[_0xcf19('0x28')](_0xcf19('0x25'));};exports[_0xcf19('0x29')]=function(_0x51d0af,_0x82cc06){return moment(_0x51d0af)['diff'](moment(_0x82cc06),_0xcf19('0x24'));};exports[_0xcf19('0x2a')]=function(_0x3d140c,_0x362ed6){return parseInt(_0x3d140c,0xa)+parseInt(_0x362ed6,0xa);};exports['now']=function(){return moment()[_0xcf19('0x28')](_0xcf19('0x25'));};exports[_0xcf19('0x2b')]=function(_0x1d844e,_0x3869c2){if(_0x3869c2){return moment(_0x1d844e)['isAfter'](_0x3869c2);}return!![];};exports['isBefore']=function(_0x53b01e,_0x5b64ea){if(_0x5b64ea){return moment(_0x53b01e)[_0xcf19('0x2c')](_0x5b64ea);}else if(_0x53b01e){return!![];}return![];}; \ No newline at end of file +var _0x84eb=['[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','result'];(function(_0x3ed4d3,_0x18a20a){var _0x5f1bca=function(_0x10a639){while(--_0x10a639){_0x3ed4d3['push'](_0x3ed4d3['shift']());}};_0x5f1bca(++_0x18a20a);}(_0x84eb,0x130));var _0xb84e=function(_0x3d0cd4,_0x474eba){_0x3d0cd4=_0x3d0cd4-0x0;var _0x3f72df=_0x84eb[_0x3d0cd4];return _0x3f72df;};'use strict';var BPromise=require(_0xb84e('0x0'));var jayson=require(_0xb84e('0x1'));var moment=require(_0xb84e('0x2'));var util=require(_0xb84e('0x3'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0xb84e('0x4'))(_0xb84e('0x5'));exports[_0xb84e('0x6')]=function(_0x3fa386,_0x8c9291){logger[_0xb84e('0x6')](_0x3fa386,_0x8c9291?util[_0xb84e('0x7')](_0x8c9291,{'showHidden':![],'depth':null}):'');};exports[_0xb84e('0x8')]=function(_0x14b767,_0x579cba){logger['debug'](_0x14b767,_0x579cba?util[_0xb84e('0x7')](_0x579cba,{'showHidden':![],'depth':null}):'');};exports[_0xb84e('0x9')]=function(_0x263292,_0x5f1cca){logger[_0xb84e('0x9')](_0x263292,_0x5f1cca?util[_0xb84e('0x7')](_0x5f1cca,{'showHidden':![],'depth':null}):'');};exports[_0xb84e('0xa')]=function(_0x3cb9d9,_0xcfbe4a){return client['request'](_0x3cb9d9,{'body':_0xcfbe4a})[_0xb84e('0xb')](function(_0x14bb8c){logger[_0xb84e('0x8')](_0xb84e('0xc'),_0x3cb9d9,_0x14bb8c?util[_0xb84e('0x7')](_0x14bb8c,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x4e534b){logger[_0xb84e('0x9')](_0xb84e('0xc'),_0x3cb9d9,_0x4e534b?util[_0xb84e('0x7')](_0x4e534b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x316d71){return client[_0xb84e('0xa')](_0xb84e('0xd'),{'options':{'raw':!![],'attributes':['id',_0xb84e('0xe'),_0xb84e('0xf'),'interface'],'where':_0x316d71,'limit':0x1}})[_0xb84e('0xb')](function(_0x99e3f8){logger[_0xb84e('0x8')](_0xb84e('0x10'),JSON['stringify'](_0x316d71),_0x99e3f8?util['inspect'](_0x99e3f8,{'showHidden':![],'depth':null}):'');return _0x99e3f8[_0xb84e('0x11')]['length']?_0x99e3f8['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x49fb0b){return new BPromise(function(_0x3a1b74,_0xcf988d){if(_0x49fb0b){return getUser({'internal':_0x49fb0b})[_0xb84e('0xb')](function(_0x470ad0){logger[_0xb84e('0x6')](_0xb84e('0x12'),_0x49fb0b,_0x470ad0?'found':_0xb84e('0x13'));return _0x3a1b74(_0x470ad0);})[_0xb84e('0x14')](function(_0x19903f){logger[_0xb84e('0x9')](_0xb84e('0x15'),_0x19903f?util['inspect'](_0x19903f,{'showHidden':![],'depth':null}):'');return _0x3a1b74(null);});}return _0x3a1b74(null);});};exports[_0xb84e('0x16')]=function(_0x2fdd6b){return new BPromise(function(_0x568fad,_0x29a677){if(_0x2fdd6b){return getUser({'interface':_0x2fdd6b})[_0xb84e('0xb')](function(_0x27e05f){logger[_0xb84e('0x6')](_0xb84e('0x17'),_0x2fdd6b,_0x27e05f?_0xb84e('0x18'):_0xb84e('0x13'));return _0x568fad(_0x27e05f);})[_0xb84e('0x14')](function(_0x34793a){logger[_0xb84e('0x9')]('[utils][getUserByInterface]',_0x34793a?util[_0xb84e('0x7')](_0x34793a,{'showHidden':![],'depth':null}):'');return _0x568fad(null);});}return _0x568fad(null);});};exports[_0xb84e('0x19')]=function(_0xac1f86){return new BPromise(function(_0x2f3fb5,_0x6b4f00){if(_0xac1f86){return getUser({'name':_0xac1f86})['then'](function(_0x1b6455){logger[_0xb84e('0x6')](_0xb84e('0x1a'),_0xac1f86,_0x1b6455?'found':_0xb84e('0x13'));return _0x2f3fb5(_0x1b6455);})['catch'](function(_0x50c490){logger[_0xb84e('0x9')](_0xb84e('0x1b'),_0x50c490?util['inspect'](_0x50c490,{'showHidden':![],'depth':null}):'');return _0x2f3fb5(null);});}return _0x2f3fb5(null);});};exports['getVoiceQueueByName']=function(_0x4371d3){return new BPromise(function(_0x224b52,_0xbdc62){if(_0x4371d3){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xb84e('0xf'),_0xb84e('0x1c'),_0xb84e('0x1d'),_0xb84e('0x1e')],'where':{'name':_0x4371d3},'limit':0x1}})['then'](function(_0x127dc7){logger[_0xb84e('0x8')](_0xb84e('0x1f'),_0x4371d3,_0x127dc7?util[_0xb84e('0x7')](_0x127dc7,{'showHidden':![],'depth':null}):'');logger[_0xb84e('0x6')](_0xb84e('0x20'),_0x4371d3,_0x127dc7?'found':_0xb84e('0x13'));return _0x224b52(_0x127dc7['result'][_0xb84e('0x21')]?_0x127dc7[_0xb84e('0x11')][0x0]:null);})[_0xb84e('0x14')](function(_0x5b21ab){logger['error'](_0xb84e('0x22'),_0x5b21ab?util['inspect'](_0x5b21ab,{'showHidden':![],'depth':null}):'');return _0x224b52(null);});}return _0x224b52(null);});};exports[_0xb84e('0x23')]=function(_0x578aac,_0x52e75d){return moment(_0x578aac)['add'](_0x52e75d,_0xb84e('0x24'))[_0xb84e('0x25')](_0xb84e('0x26'));};exports[_0xb84e('0x27')]=function(_0x5aabe6,_0x59475f){return moment(_0x5aabe6)[_0xb84e('0x28')](_0x59475f,_0xb84e('0x24'))[_0xb84e('0x25')](_0xb84e('0x26'));};exports[_0xb84e('0x29')]=function(_0x47ee5b,_0x29770e){return moment(_0x47ee5b)[_0xb84e('0x2a')](moment(_0x29770e),_0xb84e('0x24'));};exports['sumTime']=function(_0x45b1b7,_0x125df2){return parseInt(_0x45b1b7,0xa)+parseInt(_0x125df2,0xa);};exports[_0xb84e('0x2b')]=function(){return moment()[_0xb84e('0x25')](_0xb84e('0x26'));};exports[_0xb84e('0x2c')]=function(_0x3c21c6,_0x5f46c3){if(_0x5f46c3){return moment(_0x3c21c6)[_0xb84e('0x2c')](_0x5f46c3);}return!![];};exports[_0xb84e('0x2d')]=function(_0x22c3d7,_0x3e548c){if(_0x3e548c){return moment(_0x22c3d7)[_0xb84e('0x2d')](_0x3e548c);}else if(_0x22c3d7){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 540be85..bdfe343 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 _0xb4cf=['client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','responseTime','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','error','auth','set'];(function(_0x15b12f,_0x1d1af2){var _0x25ade5=function(_0x48cfdb){while(--_0x48cfdb){_0x15b12f['push'](_0x15b12f['shift']());}};_0x25ade5(++_0x1d1af2);}(_0xb4cf,0xa9));var _0xfb4c=function(_0x11560d,_0x3732b6){_0x11560d=_0x11560d-0x0;var _0x1760a6=_0xb4cf[_0x11560d];return _0x1760a6;};var fs=require(_0xfb4c('0x0'));var _=require(_0xfb4c('0x1'));var ewinston=require(_0xfb4c('0x2'));var path=require(_0xfb4c('0x3'));var util=require(_0xfb4c('0x4'));var fileLogger=require(_0xfb4c('0x5'))[_0xfb4c('0x6')];var safeTemplate=require(_0xfb4c('0x7'))[_0xfb4c('0x8')];var maskSensitiveData=require('./mask-sensitive-data')[_0xfb4c('0x9')];function ClientSideLogger(){function _0x7cfa06(_0x421b0d){var _0x2f18fb=path[_0xfb4c('0xa')](_0xfb4c('0xb'),_0xfb4c('0xc'),_0xfb4c('0xd'));var _0x148870=path[_0xfb4c('0xa')](_0xfb4c('0xe'),_0x421b0d[_0xfb4c('0xf')]+'-'+_0x421b0d[_0xfb4c('0x10')]);return fs[_0xfb4c('0x11')](path['join'](_0x2f18fb,_0x148870))[_0xfb4c('0x12')](function(){var _0x4d9aef=fileLogger(_0xfb4c('0xe'),path[_0xfb4c('0xa')](_0x2f18fb,_0x148870));return _0x4d9aef;})[_0xfb4c('0x13')](function(_0x213d04){throw _0x213d04;});}this[_0xfb4c('0xc')]=function(_0x18c90c,_0x3ad6c4,_0x15e6df,_0x447378){return _0x7cfa06(_0x18c90c[_0xfb4c('0x14')])[_0xfb4c('0x12')](function(_0x1c9092){var _0x2134ec=_0x1c9092[_0x3ad6c4];return _0x2134ec;})[_0xfb4c('0x12')](function(_0x3cf8db){var _0x2e5c4d=_0x18c90c[_0xfb4c('0x14')]?_0x18c90c[_0xfb4c('0x14')]['id']:_0xfb4c('0x15');var _0x23fe1b=_0x447378[_0xfb4c('0x16')];var _0x150091=_0x447378[_0xfb4c('0x17')];var _0x334ce3=new Date(Number(_0x150091));return _0x3cf8db(_0x2e5c4d,_0x334ce3,_0x15e6df,_0x23fe1b);})[_0xfb4c('0x13')](function(_0x30e360){fileLogger('client')[_0xfb4c('0x18')](_0x30e360);});};}function setupLoggers(_0x5adc9b){return new Promise(function(_0x546822){var _0x571d0b=new ClientSideLogger();var _0x526ff7=fileLogger('api');var _0x46c191=fileLogger(_0xfb4c('0x19'));_0x5adc9b[_0xfb4c('0x1a')](_0xfb4c('0x1b'),_0x571d0b);_0x5adc9b[_0xfb4c('0x1c')](ewinston[_0xfb4c('0x1d')]({'winstonInstance':_0x526ff7,'meta':![],'statusLevels':!![],'msg':function(_0x39d6ed,_0xec9e3c){var _0xacbae2=_0xfb4c('0x1e');if(!_['isEmpty'](_0x39d6ed['body'])){_0xacbae2+='\x20body=%s';var _0x11fe9b=_0x39d6ed[_0xfb4c('0x1f')];maskSensitiveData(_0x11fe9b);}return safeTemplate(util['format'](_0xacbae2,_0x39d6ed[_0xfb4c('0x20')],_0x39d6ed[_0xfb4c('0x21')][_0xfb4c('0x22')]?_0x39d6ed['headers'][_0xfb4c('0x22')]:_0x39d6ed[_0xfb4c('0x23')][_0xfb4c('0x24')]||_0x39d6ed['ip'],_0x39d6ed[_0xfb4c('0x25')],_0xec9e3c[_0xfb4c('0x26')],_0xec9e3c['responseTime'],_0x39d6ed['user']?_0x39d6ed[_0xfb4c('0x14')]['id']:null,_0x39d6ed[_0xfb4c('0x14')]?_0x39d6ed[_0xfb4c('0x14')][_0xfb4c('0x10')]:null,_0x39d6ed[_0xfb4c('0x14')]?_0x39d6ed[_0xfb4c('0x14')][_0xfb4c('0xf')]:null,_0x11fe9b?util['inspect'](_0x11fe9b,![],null):''));}}));_0x5adc9b[_0xfb4c('0x1c')](ewinston['logger']({'winstonInstance':_0x46c191,'meta':![],'statusLevels':!![],'msg':function(_0x4df938,_0xed184e){var _0x695541=_0xfb4c('0x27');if(_0x4df938[_0xfb4c('0x1f')]&&_0x4df938[_0xfb4c('0x1f')]['device']&&_0x4df938['body'][_0xfb4c('0x28')]){_0x695541=_0xfb4c('0x29');}return util[_0xfb4c('0x2a')](_0x695541,_0x4df938['method'],_0x4df938[_0xfb4c('0x21')][_0xfb4c('0x22')]?_0x4df938['headers'][_0xfb4c('0x22')]:_0x4df938['connection'][_0xfb4c('0x24')]||_0x4df938['ip'],_0x4df938[_0xfb4c('0x25')],_0xed184e[_0xfb4c('0x26')],_0xed184e[_0xfb4c('0x2b')],_0x4df938['user']?_0x4df938[_0xfb4c('0x14')]['id']:null,_0x4df938[_0xfb4c('0x14')]?_0x4df938[_0xfb4c('0x14')][_0xfb4c('0x10')]:null,_0x4df938['user']?_0x4df938['user'][_0xfb4c('0xf')]:null,_0x4df938['body']&&_0x4df938[_0xfb4c('0x1f')][_0xfb4c('0x2c')]?_0x4df938[_0xfb4c('0x1f')][_0xfb4c('0x2c')]:_0xfb4c('0x2d'),_0x4df938['body']&&_0x4df938[_0xfb4c('0x1f')][_0xfb4c('0x28')]?_0x4df938[_0xfb4c('0x1f')]['agent_id']:'',_0x4df938[_0xfb4c('0x1f')]&&_0x4df938['body'][_0xfb4c('0x2e')]?_0x4df938['body'][_0xfb4c('0x2e')]:'');},'ignoreRoute':function(_0x5b828f){var _0x45c737=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x45c737[_0xfb4c('0x2f')](_0x5b828f[_0xfb4c('0x25')]);}}));return _0x546822();});}exports[_0xfb4c('0x30')]=setupLoggers; \ No newline at end of file +var _0xb57e=['log','xcally','role','ensureDir','client','catch','user','no-user','data','error','api','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','fileLogger','maskSensitiveData','join','/var'];(function(_0x47f567,_0x8670ba){var _0x4cce34=function(_0x45753f){while(--_0x45753f){_0x47f567['push'](_0x47f567['shift']());}};_0x4cce34(++_0x8670ba);}(_0xb57e,0xd8));var _0xeb57=function(_0x3c59c5,_0x527f24){_0x3c59c5=_0x3c59c5-0x0;var _0x271aad=_0xb57e[_0x3c59c5];return _0x271aad;};var fs=require(_0xeb57('0x0'));var _=require(_0xeb57('0x1'));var ewinston=require(_0xeb57('0x2'));var path=require('path');var util=require(_0xeb57('0x3'));var fileLogger=require(_0xeb57('0x4'))[_0xeb57('0x5')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0xeb57('0x6')];function ClientSideLogger(){function _0x284ddc(_0x12a60d){var _0x4e457f=path[_0xeb57('0x7')](_0xeb57('0x8'),_0xeb57('0x9'),_0xeb57('0xa'));var _0x34f971=path[_0xeb57('0x7')]('client',_0x12a60d[_0xeb57('0xb')]+'-'+_0x12a60d['name']);return fs[_0xeb57('0xc')](path['join'](_0x4e457f,_0x34f971))['then'](function(){var _0x20dfce=fileLogger(_0xeb57('0xd'),path[_0xeb57('0x7')](_0x4e457f,_0x34f971));return _0x20dfce;})[_0xeb57('0xe')](function(_0x4a17d5){throw _0x4a17d5;});}this['log']=function(_0x13b38b,_0x1da9de,_0xeb7549,_0x1ddac8){return _0x284ddc(_0x13b38b[_0xeb57('0xf')])['then'](function(_0x109c62){var _0x4a5a10=_0x109c62[_0x1da9de];return _0x4a5a10;})['then'](function(_0xf2a5a5){var _0x20eab7=_0x13b38b[_0xeb57('0xf')]?_0x13b38b[_0xeb57('0xf')]['id']:_0xeb57('0x10');var _0x4f0acb=_0x1ddac8[_0xeb57('0x11')];var _0x5b0eda=_0x1ddac8['timestamp'];var _0x217553=new Date(Number(_0x5b0eda));return _0xf2a5a5(_0x20eab7,_0x217553,_0xeb7549,_0x4f0acb);})[_0xeb57('0xe')](function(_0x220f14){fileLogger('client')[_0xeb57('0x12')](_0x220f14);});};}function setupLoggers(_0x2f04a1){return new Promise(function(_0x8acf07){var _0x1b614e=new ClientSideLogger();var _0x337ed1=fileLogger(_0xeb57('0x13'));var _0x394f3b=fileLogger('auth');_0x2f04a1[_0xeb57('0x14')](_0xeb57('0x15'),_0x1b614e);_0x2f04a1['use'](ewinston[_0xeb57('0x16')]({'winstonInstance':_0x337ed1,'meta':![],'statusLevels':!![],'msg':function(_0x127cfb,_0xaf2ef1){var _0x2c1edd=_0xeb57('0x17');if(!_[_0xeb57('0x18')](_0x127cfb[_0xeb57('0x19')])){_0x2c1edd+=_0xeb57('0x1a');var _0x54fb7e=_0x127cfb[_0xeb57('0x19')];maskSensitiveData(_0x54fb7e);}return safeTemplate(util[_0xeb57('0x1b')](_0x2c1edd,_0x127cfb[_0xeb57('0x1c')],_0x127cfb[_0xeb57('0x1d')]['x-forwarded-for']?_0x127cfb[_0xeb57('0x1d')][_0xeb57('0x1e')]:_0x127cfb[_0xeb57('0x1f')][_0xeb57('0x20')]||_0x127cfb['ip'],_0x127cfb[_0xeb57('0x21')],_0xaf2ef1[_0xeb57('0x22')],_0xaf2ef1[_0xeb57('0x23')],_0x127cfb[_0xeb57('0xf')]?_0x127cfb[_0xeb57('0xf')]['id']:null,_0x127cfb[_0xeb57('0xf')]?_0x127cfb[_0xeb57('0xf')][_0xeb57('0x24')]:null,_0x127cfb[_0xeb57('0xf')]?_0x127cfb[_0xeb57('0xf')][_0xeb57('0xb')]:null,_0x54fb7e?util[_0xeb57('0x25')](_0x54fb7e,![],null):''));}}));_0x2f04a1['use'](ewinston[_0xeb57('0x16')]({'winstonInstance':_0x394f3b,'meta':![],'statusLevels':!![],'msg':function(_0x222fcd,_0xbc6aa0){var _0x5303a7=_0xeb57('0x26');if(_0x222fcd['body']&&_0x222fcd[_0xeb57('0x19')][_0xeb57('0x27')]&&_0x222fcd['body'][_0xeb57('0x28')]){_0x5303a7=_0xeb57('0x29');}return util['format'](_0x5303a7,_0x222fcd[_0xeb57('0x1c')],_0x222fcd['headers']['x-forwarded-for']?_0x222fcd[_0xeb57('0x1d')]['x-forwarded-for']:_0x222fcd[_0xeb57('0x1f')][_0xeb57('0x20')]||_0x222fcd['ip'],_0x222fcd['url'],_0xbc6aa0[_0xeb57('0x22')],_0xbc6aa0[_0xeb57('0x23')],_0x222fcd[_0xeb57('0xf')]?_0x222fcd[_0xeb57('0xf')]['id']:null,_0x222fcd[_0xeb57('0xf')]?_0x222fcd[_0xeb57('0xf')][_0xeb57('0x24')]:null,_0x222fcd[_0xeb57('0xf')]?_0x222fcd[_0xeb57('0xf')][_0xeb57('0xb')]:null,_0x222fcd['body']&&_0x222fcd[_0xeb57('0x19')][_0xeb57('0x27')]?_0x222fcd[_0xeb57('0x19')]['device']:'other',_0x222fcd[_0xeb57('0x19')]&&_0x222fcd[_0xeb57('0x19')]['agent_id']?_0x222fcd[_0xeb57('0x19')][_0xeb57('0x28')]:'',_0x222fcd[_0xeb57('0x19')]&&_0x222fcd['body'][_0xeb57('0x2a')]?_0x222fcd[_0xeb57('0x19')][_0xeb57('0x2a')]:'');},'ignoreRoute':function(_0x1266bd){var _0x1be6bb=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1be6bb[_0xeb57('0x2b')](_0x1266bd[_0xeb57('0x21')]);}}));return _0x8acf07();});}exports[_0xeb57('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 5578bf4..fc124bb 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04f5=['split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','monthsShort','exports','clone','minutes','hours','isBefore','startOf','endOf','day','isBetween','timeCompare','format','includes','dowCompare','date','daysInMonth','min','max','domCompare','MMM','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid'];(function(_0x742767,_0xfee16a){var _0xa89319=function(_0x2647dd){while(--_0x2647dd){_0x742767['push'](_0x742767['shift']());}};_0xa89319(++_0xfee16a);}(_0x04f5,0x1ce));var _0x504f=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0x04f5[_0x33080e];return _0x407395;};var _=require(_0x504f('0x0'));var moment=require(_0x504f('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][_0x504f('0x2')](function(_0x14f2e0){return _0x14f2e0['source'];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x504f('0x3');var EINVALID_DATE=_0x504f('0x4');function throwIfDateNotValid(_0x54a12f){if(!_0x54a12f[_0x504f('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5c5201){var _0xba2fe6=_0x5c5201[_0x504f('0x6')](':')['map'](function(_0x1c629c){return parseInt(_0x1c629c,0xa);});var _0x2e68ee=_0xba2fe6[0x0];var _0x54c4df=_0xba2fe6[0x1];if(_0x2e68ee<0x0||_0x2e68ee>0x17||_0x54c4df<0x0||_0x54c4df>0x3b){throw new Error(EINVALID_DATE);}return[_0x2e68ee,_0x54c4df];}function circularDoWInterval(_0x466ac0,_0x1b41ea){if(_0x466ac0===_0x1b41ea){return[_0x466ac0];}else{var _0x1ddc67=moment[_0x504f('0x7')]();moment['locale']('en');var _0xcf101c=moment[_0x504f('0x8')]()['map'](function(_0x4c95ff){return _0x4c95ff[_0x504f('0x9')]();});moment[_0x504f('0x7')](_0x1ddc67);var _0xbfb365=_0xcf101c['indexOf'](_0x466ac0);var _0x3c365c=_0xcf101c[_0x504f('0xa')](_0x1b41ea);if(_0x3c365c>_0xbfb365){return _0xcf101c[_0x504f('0xb')](_0xbfb365,_0x3c365c+0x1);}else{var _0x455f55=_0xcf101c[_0x504f('0xb')](0x0,_0x3c365c+0x1);var _0x416367=_0xcf101c[_0x504f('0xb')](_0xbfb365);return _0x416367[_0x504f('0xc')](_0x455f55);}}}module['exports']['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x371dbb,_0x606a4a){if(_0x371dbb===_0x606a4a){return[_0x371dbb];}else{var _0x459375=moment[_0x504f('0x7')]();moment[_0x504f('0x7')]('en');var _0x26a08f=moment[_0x504f('0xd')]()[_0x504f('0x2')](function(_0x3c1053){return _0x3c1053[_0x504f('0x9')]();});moment[_0x504f('0x7')](_0x459375);var _0x5bd46e=_0x26a08f['indexOf'](_0x371dbb);var _0x3c1682=_0x26a08f[_0x504f('0xa')](_0x606a4a);if(_0x3c1682>_0x5bd46e){return _0x26a08f[_0x504f('0xb')](_0x5bd46e,_0x3c1682+0x1);}else{var _0x47ae3d=_0x26a08f[_0x504f('0xb')](0x0,_0x3c1682+0x1);var _0x2ed128=_0x26a08f[_0x504f('0xb')](_0x5bd46e);return _0x2ed128[_0x504f('0xc')](_0x47ae3d);}}}module[_0x504f('0xe')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x27355c){var _0x3a7e7d=parseInt(_0x27355c,0xa);if(_0x3a7e7d<0x1||_0x3a7e7d>0x1f){throw new Error(EINVALID_DATE);}return _0x3a7e7d;}function timeCompare(_0x51ae17,_0x40016d,_0x160043){var _0x4acd1c=_0x51ae17[_0x504f('0xf')]();var _0xf59b70=extractTime(_0x40016d);var _0x46dc21=_0xf59b70[0x0];var _0xddb01f=_0xf59b70[0x1];var _0x3c4602=_0x51ae17[_0x504f('0xf')]()['hours'](_0x46dc21)[_0x504f('0x10')](_0xddb01f);throwIfDateNotValid(_0x3c4602);var _0x5ec9c3=extractTime(_0x160043);var _0x17884c=_0x5ec9c3[0x0];var _0x159c7e=_0x5ec9c3[0x1];var _0xb1fe0b=_0x51ae17[_0x504f('0xf')]()[_0x504f('0x11')](_0x17884c)[_0x504f('0x10')](_0x159c7e);throwIfDateNotValid(_0xb1fe0b);if(_0xb1fe0b[_0x504f('0x12')](_0x3c4602)){var _0x1c8ce4=_0x4acd1c[_0x504f('0xf')]()[_0x504f('0x13')]('day');var _0xa487ac=_0x4acd1c[_0x504f('0xf')]()[_0x504f('0x14')](_0x504f('0x15'));return _0x4acd1c[_0x504f('0x16')](_0x3c4602,_0xa487ac,undefined,'[]')||_0x4acd1c[_0x504f('0x16')](_0x1c8ce4,_0xb1fe0b,undefined,'[]');}else{return _0x4acd1c['isBetween'](_0x3c4602,_0xb1fe0b,undefined,'[]');}}module[_0x504f('0xe')][_0x504f('0x17')]=timeCompare;function dowCompare(_0x55091d,_0x5ddca4,_0x4db08d){var _0x937133=_0x55091d[_0x504f('0x7')]('en')[_0x504f('0x18')]('ddd')[_0x504f('0x9')]();return circularDoWInterval(_0x5ddca4,_0x4db08d)[_0x504f('0x19')](_0x937133);}module[_0x504f('0xe')][_0x504f('0x1a')]=dowCompare;function domCompare(_0x335905,_0x334985,_0xe7b27b){var _0x4026d5=_0x335905[_0x504f('0x1b')]();if(_0x334985===_0xe7b27b){return _0x4026d5===_0x334985;}else{var _0x3743e9=_0x335905[_0x504f('0x1c')]();var _0x2de658=_0x334985<_0xe7b27b;let _0x360a49=![];var _0x15a05c=0x0;var _0x391a0f=0x0;if(_0x2de658){_0x15a05c=Math['max'](0x1,_0x334985);_0x391a0f=Math[_0x504f('0x1d')](_0xe7b27b,_0x3743e9);_0x360a49=_0x4026d5>=_0x15a05c&&_0x4026d5<=_0x391a0f;}else{_0x15a05c=Math[_0x504f('0x1d')](_0x334985,_0x3743e9);_0x391a0f=Math[_0x504f('0x1e')](0x1,_0xe7b27b);_0x360a49=_0x4026d5>=_0x15a05c||_0x4026d5<=_0x391a0f;}return _0x360a49;}}module[_0x504f('0xe')][_0x504f('0x1f')]=domCompare;function monthCompare(_0x112a75,_0x38d934,_0x467db5){var _0x593417=_0x112a75[_0x504f('0x7')]('en')[_0x504f('0x18')](_0x504f('0x20'))[_0x504f('0x9')]();return circularMonthInterval(_0x38d934,_0x467db5)['includes'](_0x593417);}module['exports']['monthCompare']=monthCompare;function iftime(_0x49ffe8,_0x30c6f6=moment['tz'][_0x504f('0x21')](),_0x1a13b5=moment()){if(!validateRx[_0x504f('0x22')](_0x49ffe8)){throw new Error(EINVALID_STRING);}else{var _0x3db7eb=(moment[_0x504f('0x23')](_0x1a13b5)?_0x1a13b5[_0x504f('0xf')]():moment(_0x1a13b5))['tz'](_0x30c6f6)[_0x504f('0x7')]('en');throwIfDateNotValid(_0x3db7eb);var _0x2cd3fa=_0x49ffe8[_0x504f('0x6')](',');var _0x448048=_0x2cd3fa[0x0];var _0x362977=_0x2cd3fa[0x1];var _0x470a32=_0x2cd3fa[0x2];var _0x454534=_0x2cd3fa[0x3];let _0x11153d=!![];if(_0x448048!=='*'){var _0x141231=_0x448048[_0x504f('0x6')]('-');var _0xc03b67=_[_0x504f('0x24')](_0x141231[0x0],0x5,'0');var _0x281024=_0x141231[_0x504f('0x25')]===0x2?_[_0x504f('0x24')](_0x141231[0x1],0x5,'0'):_0xc03b67;_0x11153d=timeCompare(_0x3db7eb,_0xc03b67,_0x281024);}let _0x43e8c2=!![];if(_0x362977!=='*'){var _0x1d2c4d=_0x362977[_0x504f('0x6')]('-');var _0x523654=_0x1d2c4d[0x0];var _0x5e1499=_0x1d2c4d['length']===0x2?_0x1d2c4d[0x1]:_0x523654;_0x43e8c2=dowCompare(_0x3db7eb,_0x523654,_0x5e1499);}let _0x209e34=!![];if(_0x470a32!=='*'){var _0x3b7d3a=_0x470a32['split']('-');var _0x5bb3f5=parseDom(_0x3b7d3a[0x0]);var _0x1c8fe1=_0x3b7d3a[_0x504f('0x25')]===0x2?parseDom(_0x3b7d3a[0x1]):_0x5bb3f5;_0x209e34=domCompare(_0x3db7eb,_0x5bb3f5,_0x1c8fe1);}let _0x467dc1=!![];if(_0x454534!=='*'){var _0x149be2=_0x454534[_0x504f('0x6')]('-');var _0x393036=_0x149be2[0x0];var _0x4bf9a6=_0x149be2[_0x504f('0x25')]===0x2?_0x149be2[0x1]:_0x149be2[0x0];_0x467dc1=monthCompare(_0x3db7eb,_0x393036,_0x4bf9a6);}return _0x11153d&&_0x43e8c2&&_0x209e34&&_0x467dc1;}}module[_0x504f('0xe')][_0x504f('0x26')]=iftime; \ No newline at end of file +var _0x8d9a=['minutes','isBefore','startOf','day','isBetween','timeCompare','dowCompare','daysInMonth','min','max','format','MMM','guess','isMoment','padStart','length','iftime','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','circularMonthInterval','clone'];(function(_0x7002d0,_0x172db8){var _0x52df28=function(_0x317016){while(--_0x317016){_0x7002d0['push'](_0x7002d0['shift']());}};_0x52df28(++_0x172db8);}(_0x8d9a,0x129));var _0xa8d9=function(_0x49782f,_0x193f81){_0x49782f=_0x49782f-0x0;var _0x4d6769=_0x8d9a[_0x49782f];return _0x4d6769;};var _=require(_0xa8d9('0x0'));var moment=require(_0xa8d9('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]['map'](function(_0x1757bd){return _0x1757bd[_0xa8d9('0x2')];})[_0xa8d9('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xa8d9('0x4');var EINVALID_DATE=_0xa8d9('0x5');function throwIfDateNotValid(_0x5f429c){if(!_0x5f429c['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3b9943){var _0x2a0c79=_0x3b9943[_0xa8d9('0x6')](':')[_0xa8d9('0x7')](function(_0x2eb17f){return parseInt(_0x2eb17f,0xa);});var _0x43395d=_0x2a0c79[0x0];var _0x1d5126=_0x2a0c79[0x1];if(_0x43395d<0x0||_0x43395d>0x17||_0x1d5126<0x0||_0x1d5126>0x3b){throw new Error(EINVALID_DATE);}return[_0x43395d,_0x1d5126];}function circularDoWInterval(_0x1591b7,_0x3e1fe4){if(_0x1591b7===_0x3e1fe4){return[_0x1591b7];}else{var _0x5739c1=moment[_0xa8d9('0x8')]();moment[_0xa8d9('0x8')]('en');var _0x3e42ab=moment[_0xa8d9('0x9')]()[_0xa8d9('0x7')](function(_0xdd70bf){return _0xdd70bf[_0xa8d9('0xa')]();});moment[_0xa8d9('0x8')](_0x5739c1);var _0x50b75c=_0x3e42ab[_0xa8d9('0xb')](_0x1591b7);var _0x15a921=_0x3e42ab['indexOf'](_0x3e1fe4);if(_0x15a921>_0x50b75c){return _0x3e42ab[_0xa8d9('0xc')](_0x50b75c,_0x15a921+0x1);}else{var _0x6b67f1=_0x3e42ab['slice'](0x0,_0x15a921+0x1);var _0x13f5e7=_0x3e42ab[_0xa8d9('0xc')](_0x50b75c);return _0x13f5e7[_0xa8d9('0xd')](_0x6b67f1);}}}module[_0xa8d9('0xe')][_0xa8d9('0xf')]=circularDoWInterval;function circularMonthInterval(_0x53203a,_0x387bfc){if(_0x53203a===_0x387bfc){return[_0x53203a];}else{var _0x3eee97=moment[_0xa8d9('0x8')]();moment[_0xa8d9('0x8')]('en');var _0x56ad3a=moment['monthsShort']()[_0xa8d9('0x7')](function(_0x280727){return _0x280727[_0xa8d9('0xa')]();});moment[_0xa8d9('0x8')](_0x3eee97);var _0x473dba=_0x56ad3a[_0xa8d9('0xb')](_0x53203a);var _0x147481=_0x56ad3a['indexOf'](_0x387bfc);if(_0x147481>_0x473dba){return _0x56ad3a[_0xa8d9('0xc')](_0x473dba,_0x147481+0x1);}else{var _0x51411b=_0x56ad3a['slice'](0x0,_0x147481+0x1);var _0x389ceb=_0x56ad3a[_0xa8d9('0xc')](_0x473dba);return _0x389ceb['concat'](_0x51411b);}}}module[_0xa8d9('0xe')][_0xa8d9('0x10')]=circularMonthInterval;function parseDom(_0x26ae43){var _0x1773c8=parseInt(_0x26ae43,0xa);if(_0x1773c8<0x1||_0x1773c8>0x1f){throw new Error(EINVALID_DATE);}return _0x1773c8;}function timeCompare(_0x24fa05,_0x1b2b20,_0x357280){var _0x5d207b=_0x24fa05[_0xa8d9('0x11')]();var _0x206f92=extractTime(_0x1b2b20);var _0x3501f5=_0x206f92[0x0];var _0x437807=_0x206f92[0x1];var _0x1f0860=_0x24fa05['clone']()['hours'](_0x3501f5)[_0xa8d9('0x12')](_0x437807);throwIfDateNotValid(_0x1f0860);var _0x1e5adf=extractTime(_0x357280);var _0x54f310=_0x1e5adf[0x0];var _0x290a0a=_0x1e5adf[0x1];var _0x424660=_0x24fa05[_0xa8d9('0x11')]()['hours'](_0x54f310)[_0xa8d9('0x12')](_0x290a0a);throwIfDateNotValid(_0x424660);if(_0x424660[_0xa8d9('0x13')](_0x1f0860)){var _0x38fd3c=_0x5d207b[_0xa8d9('0x11')]()[_0xa8d9('0x14')](_0xa8d9('0x15'));var _0x1316cd=_0x5d207b[_0xa8d9('0x11')]()['endOf'](_0xa8d9('0x15'));return _0x5d207b[_0xa8d9('0x16')](_0x1f0860,_0x1316cd,undefined,'[]')||_0x5d207b['isBetween'](_0x38fd3c,_0x424660,undefined,'[]');}else{return _0x5d207b[_0xa8d9('0x16')](_0x1f0860,_0x424660,undefined,'[]');}}module[_0xa8d9('0xe')][_0xa8d9('0x17')]=timeCompare;function dowCompare(_0x4c7467,_0x3c3f5b,_0x1ad4d9){var _0x5f270b=_0x4c7467[_0xa8d9('0x8')]('en')['format']('ddd')['toLowerCase']();return circularDoWInterval(_0x3c3f5b,_0x1ad4d9)['includes'](_0x5f270b);}module[_0xa8d9('0xe')][_0xa8d9('0x18')]=dowCompare;function domCompare(_0x4377a7,_0x2ccbed,_0x4cb2af){var _0x5a1fd1=_0x4377a7['date']();if(_0x2ccbed===_0x4cb2af){return _0x5a1fd1===_0x2ccbed;}else{var _0x22e39f=_0x4377a7[_0xa8d9('0x19')]();var _0x5822e1=_0x2ccbed<_0x4cb2af;let _0x420b43=![];var _0x2f1a38=0x0;var _0x560653=0x0;if(_0x5822e1){_0x2f1a38=Math['max'](0x1,_0x2ccbed);_0x560653=Math['min'](_0x4cb2af,_0x22e39f);_0x420b43=_0x5a1fd1>=_0x2f1a38&&_0x5a1fd1<=_0x560653;}else{_0x2f1a38=Math[_0xa8d9('0x1a')](_0x2ccbed,_0x22e39f);_0x560653=Math[_0xa8d9('0x1b')](0x1,_0x4cb2af);_0x420b43=_0x5a1fd1>=_0x2f1a38||_0x5a1fd1<=_0x560653;}return _0x420b43;}}module[_0xa8d9('0xe')]['domCompare']=domCompare;function monthCompare(_0x1a4dbb,_0x1ed2cf,_0x344fd4){var _0x5b31da=_0x1a4dbb['locale']('en')[_0xa8d9('0x1c')](_0xa8d9('0x1d'))[_0xa8d9('0xa')]();return circularMonthInterval(_0x1ed2cf,_0x344fd4)['includes'](_0x5b31da);}module[_0xa8d9('0xe')]['monthCompare']=monthCompare;function iftime(_0x5a519e,_0x1b9773=moment['tz'][_0xa8d9('0x1e')](),_0x4e14fd=moment()){if(!validateRx['test'](_0x5a519e)){throw new Error(EINVALID_STRING);}else{var _0xcc0847=(moment[_0xa8d9('0x1f')](_0x4e14fd)?_0x4e14fd[_0xa8d9('0x11')]():moment(_0x4e14fd))['tz'](_0x1b9773)[_0xa8d9('0x8')]('en');throwIfDateNotValid(_0xcc0847);var _0x3a68e3=_0x5a519e['split'](',');var _0xe0aff9=_0x3a68e3[0x0];var _0x5c667a=_0x3a68e3[0x1];var _0x271afb=_0x3a68e3[0x2];var _0x28d070=_0x3a68e3[0x3];let _0x559f22=!![];if(_0xe0aff9!=='*'){var _0x2354c9=_0xe0aff9[_0xa8d9('0x6')]('-');var _0x3303a9=_[_0xa8d9('0x20')](_0x2354c9[0x0],0x5,'0');var _0x5c604b=_0x2354c9[_0xa8d9('0x21')]===0x2?_['padStart'](_0x2354c9[0x1],0x5,'0'):_0x3303a9;_0x559f22=timeCompare(_0xcc0847,_0x3303a9,_0x5c604b);}let _0x13e4fc=!![];if(_0x5c667a!=='*'){var _0x3b08db=_0x5c667a['split']('-');var _0x12384c=_0x3b08db[0x0];var _0x372097=_0x3b08db[_0xa8d9('0x21')]===0x2?_0x3b08db[0x1]:_0x12384c;_0x13e4fc=dowCompare(_0xcc0847,_0x12384c,_0x372097);}let _0x2a3614=!![];if(_0x271afb!=='*'){var _0x327df4=_0x271afb[_0xa8d9('0x6')]('-');var _0x306371=parseDom(_0x327df4[0x0]);var _0x55a596=_0x327df4[_0xa8d9('0x21')]===0x2?parseDom(_0x327df4[0x1]):_0x306371;_0x2a3614=domCompare(_0xcc0847,_0x306371,_0x55a596);}let _0x52faa5=!![];if(_0x28d070!=='*'){var _0x7a840b=_0x28d070[_0xa8d9('0x6')]('-');var _0x43e7d1=_0x7a840b[0x0];var _0x2aabf9=_0x7a840b[_0xa8d9('0x21')]===0x2?_0x7a840b[0x1]:_0x7a840b[0x0];_0x52faa5=monthCompare(_0xcc0847,_0x43e7d1,_0x2aabf9);}return _0x559f22&&_0x13e4fc&&_0x2a3614&&_0x52faa5;}}module[_0xa8d9('0xe')][_0xa8d9('0x22')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 3b7d27d..f585592 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06fd=['length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','warn','File','%s-%s','error','transports','path','util','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','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','meta','keys'];(function(_0x3a2e79,_0x2fefd){var _0x47aa63=function(_0x564a7a){while(--_0x564a7a){_0x3a2e79['push'](_0x3a2e79['shift']());}};_0x47aa63(++_0x2fefd);}(_0x06fd,0x7b));var _0xd06f=function(_0x54b719,_0x39ade5){_0x54b719=_0x54b719-0x0;var _0x31edd9=_0x06fd[_0x54b719];return _0x31edd9;};'use strict';var path=require(_0xd06f('0x0'));var util=require(_0xd06f('0x1'));var moment=require('moment');var winston=require(_0xd06f('0x2'));var config=require(_0xd06f('0x3'));var debugLevel=config[_0xd06f('0x4')]?config[_0xd06f('0x4')][_0xd06f('0x5')]():_0xd06f('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xd06f('0x7'),'error':_0xd06f('0x8'),'warn':_0xd06f('0x9'),'info':_0xd06f('0xa'),'print':_0xd06f('0xb'),'success':_0xd06f('0xc'),'http':_0xd06f('0xd'),'verbose':_0xd06f('0xe'),'debug':_0xd06f('0xf'),'silly':_0xd06f('0x10')};winston[_0xd06f('0x11')](XC_LOG_COLORS);function getLogFileName(_0x2b144e,_0x17a70d,_0x32f5ff){var _0x4b04cd=_0x2b144e||_0xd06f('0x12');return path['join'](_0x4b04cd,util[_0xd06f('0x13')](_0xd06f('0x14'),_0x17a70d,_0x32f5ff));}function formatter(_0x4c110d,_0x883384){_0x883384[_0xd06f('0x15')]=_0x883384[_0xd06f('0x15')]['replace'](/@@{/g,_0xd06f('0x16'))[_0xd06f('0x17')](/}@@/g,_0xd06f('0x18'))[_0xd06f('0x17')](/@{/g,'{{')[_0xd06f('0x17')](/}@/g,'}}');return util[_0xd06f('0x13')](_0xd06f('0x19'),moment()[_0xd06f('0x13')](_0xd06f('0x1a')),_0x883384['level']['toUpperCase'](),_0x4c110d,_0x883384['message']);}function fileFormat(_0x53107b,_0x3383c9){_0x3383c9[_0xd06f('0x15')]=_0x3383c9['message'][_0xd06f('0x17')](/@@{/g,_0xd06f('0x16'))['replace'](/}@@/g,_0xd06f('0x18'))[_0xd06f('0x17')](/@{/g,'{{')[_0xd06f('0x17')](/}@/g,'}}');var _0x211f5a=_0x3383c9[_0xd06f('0x1b')]&&Object[_0xd06f('0x1c')](_0x3383c9['meta'])[_0xd06f('0x1d')]?'\x0a\x09'+JSON[_0xd06f('0x1e')](_0x3383c9['meta']):'';return util[_0xd06f('0x13')](_0xd06f('0x1f'),moment()[_0xd06f('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3383c9[_0xd06f('0x20')]['toUpperCase'](),_0x53107b,_0x3383c9[_0xd06f('0x15')],_0x211f5a);}function consoleLogger(){var _0x28417a=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0xd06f('0x21'),'json':![],'formatter':function(_0x2aae58){return formatter('',_0x2aae58);}})]});return _0x28417a;}function fileLogger(_0x4eba28,_0x2f558d){var _0x321a1e=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xd06f('0x22'))]({'name':util[_0xd06f('0x13')](_0xd06f('0x23'),_0x4eba28,_0xd06f('0x24')),'filename':getLogFileName(_0x2f558d,_0x4eba28,_0xd06f('0x24')),'level':_0xd06f('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1a6e8f){return fileFormat(_0x4eba28,_0x1a6e8f);}}),new winston[(_0xd06f('0x25'))][(_0xd06f('0x22'))]({'name':util['format']('%s-%s',_0x4eba28,debugLevel),'filename':getLogFileName(_0x2f558d,_0x4eba28,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xa273ac){return fileFormat(_0x4eba28,_0xa273ac);}}),new winston[(_0xd06f('0x25'))]['Console']({'level':_0xd06f('0x21'),'json':![],'formatter':function(_0x4f3556){return fileFormat(_0x4eba28,_0x4f3556);}})]});return _0x321a1e;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x324c=['util','moment','winston','../config/environment','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','File','%s-%s','error','warn','consoleLogger','fileLogger','path'];(function(_0x572979,_0x3f2c5a){var _0x351b05=function(_0x124247){while(--_0x124247){_0x572979['push'](_0x572979['shift']());}};_0x351b05(++_0x3f2c5a);}(_0x324c,0xc7));var _0xc324=function(_0x397892,_0x163676){_0x397892=_0x397892-0x0;var _0x2947fa=_0x324c[_0x397892];return _0x2947fa;};'use strict';var path=require(_0xc324('0x0'));var util=require(_0xc324('0x1'));var moment=require(_0xc324('0x2'));var winston=require(_0xc324('0x3'));var config=require(_0xc324('0x4'));var debugLevel=config['debugLevel']?config['debugLevel'][_0xc324('0x5')]():_0xc324('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xc324('0x7'),'error':_0xc324('0x8'),'warn':_0xc324('0x9'),'info':_0xc324('0xa'),'print':_0xc324('0xb'),'success':_0xc324('0xc'),'http':_0xc324('0xd'),'verbose':_0xc324('0xe'),'debug':_0xc324('0xf'),'silly':_0xc324('0x10')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x13496d,_0x5506b0,_0x2cad8a){var _0x404f78=_0x13496d||_0xc324('0x11');return path['join'](_0x404f78,util['format']('%s-%s.log',_0x5506b0,_0x2cad8a));}function formatter(_0x4f339e,_0x113954){_0x113954['message']=_0x113954[_0xc324('0x12')][_0xc324('0x13')](/@@{/g,'{{{')[_0xc324('0x13')](/}@@/g,_0xc324('0x14'))[_0xc324('0x13')](/@{/g,'{{')[_0xc324('0x13')](/}@/g,'}}');return util['format'](_0xc324('0x15'),moment()[_0xc324('0x16')](_0xc324('0x17')),_0x113954[_0xc324('0x18')][_0xc324('0x19')](),_0x4f339e,_0x113954[_0xc324('0x12')]);}function fileFormat(_0x3955f4,_0x1b03f2){_0x1b03f2[_0xc324('0x12')]=_0x1b03f2[_0xc324('0x12')][_0xc324('0x13')](/@@{/g,_0xc324('0x1a'))[_0xc324('0x13')](/}@@/g,_0xc324('0x14'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x9ee1d1=_0x1b03f2[_0xc324('0x1b')]&&Object[_0xc324('0x1c')](_0x1b03f2[_0xc324('0x1b')])['length']?'\x0a\x09'+JSON[_0xc324('0x1d')](_0x1b03f2[_0xc324('0x1b')]):'';return util[_0xc324('0x16')](_0xc324('0x1e'),moment()[_0xc324('0x16')](_0xc324('0x17')),_0x1b03f2[_0xc324('0x18')]['toUpperCase'](),_0x3955f4,_0x1b03f2[_0xc324('0x12')],_0x9ee1d1);}function consoleLogger(){var _0x4a0631=new winston[(_0xc324('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc324('0x20'))][(_0xc324('0x21'))]({'level':'warn','json':![],'formatter':function(_0x82dde6){return formatter('',_0x82dde6);}})]});return _0x4a0631;}function fileLogger(_0x1eb0a9,_0x2b13e8){var _0xb2de25=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xc324('0x22'))]({'name':util['format'](_0xc324('0x23'),_0x1eb0a9,_0xc324('0x24')),'filename':getLogFileName(_0x2b13e8,_0x1eb0a9,_0xc324('0x24')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x27121e){return fileFormat(_0x1eb0a9,_0x27121e);}}),new winston[(_0xc324('0x20'))][(_0xc324('0x22'))]({'name':util[_0xc324('0x16')](_0xc324('0x23'),_0x1eb0a9,debugLevel),'filename':getLogFileName(_0x2b13e8,_0x1eb0a9,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38edff){return fileFormat(_0x1eb0a9,_0x38edff);}}),new winston['transports'][(_0xc324('0x21'))]({'level':_0xc324('0x25'),'json':![],'formatter':function(_0x386393){return fileFormat(_0x1eb0a9,_0x386393);}})]});return _0xb2de25;}exports[_0xc324('0x26')]=consoleLogger;exports[_0xc324('0x27')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 3e3f3ee..b0a017f 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 _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x5613af,_0x4fe1bf){var _0x1b8a5=function(_0x134849){while(--_0x134849){_0x5613af['push'](_0x5613af['shift']());}};_0x1b8a5(++_0x4fe1bf);}(_0x66fa,0x117));var _0xa66f=function(_0x1c16f8,_0x3b2797){_0x1c16f8=_0x1c16f8-0x0;var _0x3ec33b=_0x66fa[_0x1c16f8];return _0x3ec33b;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file +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(_0x41de75,_0x1db803){var _0x778fcc=function(_0x1c7045){while(--_0x1c7045){_0x41de75['push'](_0x41de75['shift']());}};_0x778fcc(++_0x1db803);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x0b0e[_0x2aa0e7];return _0x1472c0;};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 diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 1008f74..3b5e518 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 _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x2570e1,_0x5f4918){var _0x5dbde8=function(_0x9d0cda){while(--_0x9d0cda){_0x2570e1['push'](_0x2570e1['shift']());}};_0x5dbde8(++_0x5f4918);}(_0xea28,0x13a));var _0x8ea2=function(_0x15d1c8,_0x2307a5){_0x15d1c8=_0x15d1c8-0x0;var _0x51233b=_0xea28[_0x15d1c8];return _0x51233b;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate; \ No newline at end of file +var _0x087b=['exports','safeTemplate','lodash','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x5f89d5,_0x3c3963){var _0x33306a=function(_0x4127ed){while(--_0x4127ed){_0x5f89d5['push'](_0x5f89d5['shift']());}};_0x33306a(++_0x3c3963);}(_0x087b,0x11a));var _0xb087=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x087b[_0x45783c];return _0x1161da;};var _=require(_0xb087('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x35e3d3){return _0x35e3d3==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0x40e6d6){var _0x5aa7a8=_0x40e6d6;if(typeof _0x40e6d6===_0xb087('0x1')){_0x5aa7a8=_0x40e6d6[_0xb087('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xb087('0x3')](_0x40e6d6)){_0x5aa7a8=_0x40e6d6[_0xb087('0x4')](function(_0x183efd){return safeTemplate(_0x183efd);});}else if(_[_0xb087('0x5')](_0x40e6d6)){_0x5aa7a8=Object[_0xb087('0x6')](_0x40e6d6)[_0xb087('0x7')](function(_0xecf080,_0x36ac30){_0xecf080[_0x36ac30]=safeTemplate(_0x40e6d6[_0x36ac30]);return _0xecf080;},{});}return _0x5aa7a8;}module[_0xb087('0x8')][_0xb087('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 7048f44..ac67a82 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 _0x86fc=['path','../config/environment','resolve','server/app.json','legacy-libs','isArray','apps','name','motion2','env','NODE_PATH','string','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra'];(function(_0x4b6534,_0x3c640d){var _0x4f52c5=function(_0x3260fa){while(--_0x3260fa){_0x4b6534['push'](_0x4b6534['shift']());}};_0x4f52c5(++_0x3c640d);}(_0x86fc,0x1df));var _0xc86f=function(_0x201b98,_0x263251){_0x201b98=_0x201b98-0x0;var _0x296209=_0x86fc[_0x201b98];return _0x296209;};var fs=require(_0xc86f('0x0'));var path=require(_0xc86f('0x1'));var config=require(_0xc86f('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0xc86f('0x3')](root,_0xc86f('0x4'));var NODEPATH=path[_0xc86f('0x3')](root,_0xc86f('0x5'));function setLegacyLibsNodeEnvPath(_0x1a2b73){let _0x16dd90=![];if(Array[_0xc86f('0x6')](_0x1a2b73[_0xc86f('0x7')])){var _0x1bfd8f=_0x1a2b73[_0xc86f('0x7')]['findIndex'](function(_0x3fc87c){return _0x3fc87c[_0xc86f('0x8')]===_0xc86f('0x9');});if(_0x1bfd8f>-0x1){var _0x2d5e36=_0x1a2b73['apps'][_0x1bfd8f];if(typeof _0x2d5e36[_0xc86f('0xa')][_0xc86f('0xb')]!==_0xc86f('0xc')){_0x2d5e36[_0xc86f('0xa')][_0xc86f('0xb')]=NODEPATH;_0x16dd90=!![];}}return{'appConfig':_0x1a2b73,'updated':_0x16dd90};}}function updateAppConfig(_0x156cb0){return fs['pathExists'](APP_JSON_PATH)[_0xc86f('0xd')](function(_0x23a81d){if(_0x23a81d){return fs[_0xc86f('0xe')](APP_JSON_PATH)[_0xc86f('0xd')](function(_0x1cce0c){var _0x3eafb1=setLegacyLibsNodeEnvPath(_0x1cce0c);if(_0x3eafb1[_0xc86f('0xf')]){_0x156cb0[_0xc86f('0x10')](_0xc86f('0x11'));return fs[_0xc86f('0x12')](APP_JSON_PATH,_0x1cce0c,{'spaces':0x2});}else{return Promise[_0xc86f('0x3')]();}});}else{return Promise[_0xc86f('0x3')]();}});}module[_0xc86f('0x13')]=updateAppConfig; \ No newline at end of file +var _0x69b3=['updated','info','writeJSON','exports','fs-extra','path','../config/environment','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','NODE_PATH','string','env','then','readJSON'];(function(_0x272cb1,_0x53b90c){var _0x1b1609=function(_0x64dcf5){while(--_0x64dcf5){_0x272cb1['push'](_0x272cb1['shift']());}};_0x1b1609(++_0x53b90c);}(_0x69b3,0x9c));var _0x369b=function(_0x40dc65,_0x194f03){_0x40dc65=_0x40dc65-0x0;var _0x3d5b89=_0x69b3[_0x40dc65];return _0x3d5b89;};var fs=require(_0x369b('0x0'));var path=require(_0x369b('0x1'));var config=require(_0x369b('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x369b('0x3')](root,'server/app.json');var NODEPATH=path[_0x369b('0x3')](root,_0x369b('0x4'));function setLegacyLibsNodeEnvPath(_0x5ce070){let _0x338824=![];if(Array[_0x369b('0x5')](_0x5ce070[_0x369b('0x6')])){var _0x45b270=_0x5ce070[_0x369b('0x6')][_0x369b('0x7')](function(_0x194e04){return _0x194e04[_0x369b('0x8')]===_0x369b('0x9');});if(_0x45b270>-0x1){var _0x23c6df=_0x5ce070[_0x369b('0x6')][_0x45b270];if(typeof _0x23c6df['env'][_0x369b('0xa')]!==_0x369b('0xb')){_0x23c6df[_0x369b('0xc')][_0x369b('0xa')]=NODEPATH;_0x338824=!![];}}return{'appConfig':_0x5ce070,'updated':_0x338824};}}function updateAppConfig(_0x4db5b6){return fs['pathExists'](APP_JSON_PATH)[_0x369b('0xd')](function(_0x448200){if(_0x448200){return fs[_0x369b('0xe')](APP_JSON_PATH)[_0x369b('0xd')](function(_0x5bc7d9){var _0x5ca4ee=setLegacyLibsNodeEnvPath(_0x5bc7d9);if(_0x5ca4ee[_0x369b('0xf')]){_0x4db5b6[_0x369b('0x10')]('Updating\x20app.json');return fs[_0x369b('0x11')](APP_JSON_PATH,_0x5bc7d9,{'spaces':0x2});}else{return Promise[_0x369b('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x369b('0x12')]=updateAppConfig; \ No newline at end of file -- 1.7.1